From e5d36004b3057f9417d6547fb5bc5d73dfb5ed29 Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Wed, 1 Apr 2026 08:16:26 +0000 Subject: [PATCH 1/2] docs: update SelectiveGapicGeneration usage doc PiperOrigin-RevId: 892649773 Source-Link: https://github.com/googleapis/googleapis/commit/06a20b286850ebcb792cd2085ae6d0556a7c5498 Source-Link: https://github.com/googleapis/googleapis-gen/commit/d9ae66451f81c9df99dbdc9b23bd75d007380f4e Copy-Tag: eyJwIjoiZ29vZ2xlLWNsb3VkLXZpc2lvbi12MXAzYmV0YTEvLk93bEJvdC55YW1sIiwiaCI6ImQ5YWU2NjQ1MWY4MWM5ZGY5OWRiZGM5YjIzYmQ3NWQwMDczODBmNGUifQ== Copy-Tag: eyJwIjoiZ29vZ2xlLWNsb3VkLXZpc2lvbi12MXA0YmV0YTEvLk93bEJvdC55YW1sIiwiaCI6ImQ5YWU2NjQ1MWY4MWM5ZGY5OWRiZGM5YjIzYmQ3NWQwMDczODBmNGUifQ== Copy-Tag: eyJwIjoiZ29vZ2xlLWNsb3VkLXZpc2lvbl9haS12MS8uT3dsQm90LnlhbWwiLCJoIjoiZDlhZTY2NDUxZjgxYzlkZjk5ZGJkYzliMjNiZDc1ZDAwNzM4MGY0ZSJ9 Copy-Tag: eyJwIjoiZ29vZ2xlLWNsb3VkLXZtX21pZ3JhdGlvbi12MS8uT3dsQm90LnlhbWwiLCJoIjoiZDlhZTY2NDUxZjgxYzlkZjk5ZGJkYzliMjNiZDc1ZDAwNzM4MGY0ZSJ9 Copy-Tag: eyJwIjoiZ29vZ2xlLWNsb3VkLXZtd2FyZV9lbmdpbmUtdjEvLk93bEJvdC55YW1sIiwiaCI6ImQ5YWU2NjQ1MWY4MWM5ZGY5OWRiZGM5YjIzYmQ3NWQwMDczODBmNGUifQ== Copy-Tag: eyJwIjoiZ29vZ2xlLWNsb3VkLXZwY19hY2Nlc3MtdjEvLk93bEJvdC55YW1sIiwiaCI6ImQ5YWU2NjQ1MWY4MWM5ZGY5OWRiZGM5YjIzYmQ3NWQwMDczODBmNGUifQ== Copy-Tag: eyJwIjoiZ29vZ2xlLWNsb3VkLXdlYl9yaXNrLXYxLy5Pd2xCb3QueWFtbCIsImgiOiJkOWFlNjY0NTFmODFjOWRmOTlkYmRjOWIyM2JkNzVkMDA3MzgwZjRlIn0= Copy-Tag: eyJwIjoiZ29vZ2xlLWNsb3VkLXdlYl9yaXNrLXYxYmV0YTEvLk93bEJvdC55YW1sIiwiaCI6ImQ5YWU2NjQ1MWY4MWM5ZGY5OWRiZGM5YjIzYmQ3NWQwMDczODBmNGUifQ== Copy-Tag: eyJwIjoiZ29vZ2xlLWNsb3VkLXdlYl9zZWN1cml0eV9zY2FubmVyLXYxLy5Pd2xCb3QueWFtbCIsImgiOiJkOWFlNjY0NTFmODFjOWRmOTlkYmRjOWIyM2JkNzVkMDA3MzgwZjRlIn0= Copy-Tag: eyJwIjoiZ29vZ2xlLWNsb3VkLXdlYl9zZWN1cml0eV9zY2FubmVyLXYxYmV0YS8uT3dsQm90LnlhbWwiLCJoIjoiZDlhZTY2NDUxZjgxYzlkZjk5ZGJkYzliMjNiZDc1ZDAwNzM4MGY0ZSJ9 Copy-Tag: eyJwIjoiZ29vZ2xlLWNsb3VkLXdvcmtmbG93cy1leGVjdXRpb25zLXYxLy5Pd2xCb3QueWFtbCIsImgiOiJkOWFlNjY0NTFmODFjOWRmOTlkYmRjOWIyM2JkNzVkMDA3MzgwZjRlIn0= Copy-Tag: eyJwIjoiZ29vZ2xlLWNsb3VkLXdvcmtmbG93cy1leGVjdXRpb25zLXYxYmV0YS8uT3dsQm90LnlhbWwiLCJoIjoiZDlhZTY2NDUxZjgxYzlkZjk5ZGJkYzliMjNiZDc1ZDAwNzM4MGY0ZSJ9 Copy-Tag: eyJwIjoiZ29vZ2xlLWNsb3VkLXdvcmtmbG93cy12MS8uT3dsQm90LnlhbWwiLCJoIjoiZDlhZTY2NDUxZjgxYzlkZjk5ZGJkYzliMjNiZDc1ZDAwNzM4MGY0ZSJ9 Copy-Tag: eyJwIjoiZ29vZ2xlLWNsb3VkLXdvcmtmbG93cy12MWJldGEvLk93bEJvdC55YW1sIiwiaCI6ImQ5YWU2NjQ1MWY4MWM5ZGY5OWRiZGM5YjIzYmQ3NWQwMDczODBmNGUifQ== Copy-Tag: eyJwIjoiZ29vZ2xlLWNsb3VkLXdvcmtzdGF0aW9ucy12MS8uT3dsQm90LnlhbWwiLCJoIjoiZDlhZTY2NDUxZjgxYzlkZjk5ZGJkYzliMjNiZDc1ZDAwNzM4MGY0ZSJ9 Copy-Tag: eyJwIjoiZ29vZ2xlLWNsb3VkLXdvcmtzdGF0aW9ucy12MWJldGEvLk93bEJvdC55YW1sIiwiaCI6ImQ5YWU2NjQ1MWY4MWM5ZGY5OWRiZGM5YjIzYmQ3NWQwMDczODBmNGUifQ== Copy-Tag: eyJwIjoiZ29vZ2xlLWlhbS1jcmVkZW50aWFscy12MS8uT3dsQm90LnlhbWwiLCJoIjoiZDlhZTY2NDUxZjgxYzlkZjk5ZGJkYzliMjNiZDc1ZDAwNzM4MGY0ZSJ9 Copy-Tag: eyJwIjoiZ29vZ2xlLWlhbS12MS8uT3dsQm90LnlhbWwiLCJoIjoiZDlhZTY2NDUxZjgxYzlkZjk5ZGJkYzliMjNiZDc1ZDAwNzM4MGY0ZSJ9 Copy-Tag: eyJwIjoiZ29vZ2xlLWlhbS12MWJldGEvLk93bEJvdC55YW1sIiwiaCI6ImQ5YWU2NjQ1MWY4MWM5ZGY5OWRiZGM5YjIzYmQ3NWQwMDczODBmNGUifQ== Copy-Tag: eyJwIjoiZ29vZ2xlLWlhbS12Mi8uT3dsQm90LnlhbWwiLCJoIjoiZDlhZTY2NDUxZjgxYzlkZjk5ZGJkYzliMjNiZDc1ZDAwNzM4MGY0ZSJ9 --- .../google-cloud-vision-v1p3beta1/.gitignore | 22 + .../.repo-metadata.json | 18 + .../.rubocop.yml | 33 + .../google-cloud-vision-v1p3beta1/.toys.rb | 28 + .../google-cloud-vision-v1p3beta1/.yardopts | 12 + .../AUTHENTICATION.md | 122 + .../CHANGELOG.md | 2 + .../google-cloud-vision-v1p3beta1/Gemfile | 14 + .../google-cloud-vision-v1p3beta1/LICENSE.md | 201 + .../google-cloud-vision-v1p3beta1/README.md | 154 + .../google-cloud-vision-v1p3beta1/Rakefile | 169 + .../gapic_metadata.json | 127 + .../google-cloud-vision-v1p3beta1.gemspec | 28 + .../lib/google-cloud-vision-v1p3beta1.rb | 21 + .../lib/google/cloud/vision/v1p3beta1.rb | 46 + .../cloud/vision/v1p3beta1/geometry_pb.rb | 24 + .../cloud/vision/v1p3beta1/image_annotator.rb | 58 + .../v1p3beta1/image_annotator/client.rb | 590 + .../v1p3beta1/image_annotator/credentials.rb | 52 + .../v1p3beta1/image_annotator/operations.rb | 841 ++ .../vision/v1p3beta1/image_annotator/paths.rb | 52 + .../vision/v1p3beta1/image_annotator/rest.rb | 55 + .../v1p3beta1/image_annotator/rest/client.rb | 549 + .../image_annotator/rest/operations.rb | 925 ++ .../image_annotator/rest/service_stub.rb | 201 + .../vision/v1p3beta1/image_annotator_pb.rb | 72 + .../v1p3beta1/image_annotator_services_pb.rb | 55 + .../cloud/vision/v1p3beta1/product_search.rb | 69 + .../vision/v1p3beta1/product_search/client.rb | 2429 +++++ .../v1p3beta1/product_search/credentials.rb | 52 + .../v1p3beta1/product_search/operations.rb | 841 ++ .../vision/v1p3beta1/product_search/paths.rb | 109 + .../vision/v1p3beta1/product_search/rest.rb | 66 + .../v1p3beta1/product_search/rest/client.rb | 2260 ++++ .../product_search/rest/operations.rb | 925 ++ .../product_search/rest/service_stub.rb | 1187 ++ .../vision/v1p3beta1/product_search_pb.rb | 30 + .../v1p3beta1/product_search_service_pb.rb | 62 + .../product_search_service_services_pb.rb | 222 + .../lib/google/cloud/vision/v1p3beta1/rest.rb | 38 + .../vision/v1p3beta1/text_annotation_pb.rb | 33 + .../google/cloud/vision/v1p3beta1/version.rb | 28 + .../vision/v1p3beta1/web_detection_pb.rb | 25 + .../proto_docs/README.md | 4 + .../proto_docs/google/api/client.rb | 593 + .../proto_docs/google/api/field_behavior.rb | 85 + .../proto_docs/google/api/launch_stage.rb | 71 + .../proto_docs/google/api/resource.rb | 227 + .../google/cloud/vision/v1p3beta1/geometry.rb | 82 + .../cloud/vision/v1p3beta1/image_annotator.rb | 888 ++ .../cloud/vision/v1p3beta1/product_search.rb | 134 + .../v1p3beta1/product_search_service.rb | 630 ++ .../cloud/vision/v1p3beta1/text_annotation.rb | 286 + .../cloud/vision/v1p3beta1/web_detection.rb | 120 + .../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 | 148 + .../proto_docs/google/rpc/status.rb | 48 + .../proto_docs/google/type/color.rb | 173 + .../proto_docs/google/type/latlng.rb | 38 + .../snippets/Gemfile | 32 + .../async_batch_annotate_files.rb | 54 + .../image_annotator/batch_annotate_images.rb | 47 + .../add_product_to_product_set.rb | 47 + .../snippets/product_search/create_product.rb | 47 + .../product_search/create_product_set.rb | 47 + .../product_search/create_reference_image.rb | 47 + .../snippets/product_search/delete_product.rb | 47 + .../product_search/delete_product_set.rb | 47 + .../product_search/delete_reference_image.rb | 47 + .../snippets/product_search/get_product.rb | 47 + .../product_search/get_product_set.rb | 47 + .../product_search/get_reference_image.rb | 47 + .../product_search/import_product_sets.rb | 54 + .../product_search/list_product_sets.rb | 51 + .../snippets/product_search/list_products.rb | 51 + .../list_products_in_product_set.rb | 51 + .../product_search/list_reference_images.rb | 51 + .../remove_product_from_product_set.rb | 47 + .../snippets/product_search/update_product.rb | 47 + .../product_search/update_product_set.rb | 47 + ...etadata_google.cloud.vision.v1p3beta1.json | 815 ++ .../image_annotator_operations_test.rb | 400 + .../v1p3beta1/image_annotator_paths_test.rb | 55 + .../v1p3beta1/image_annotator_rest_test.rb | 207 + .../vision/v1p3beta1/image_annotator_test.rb | 239 + .../product_search_operations_test.rb | 400 + .../v1p3beta1/product_search_paths_test.rb | 91 + .../v1p3beta1/product_search_rest_test.rb | 1090 ++ .../vision/v1p3beta1/product_search_test.rb | 1225 +++ .../test/helper.rb | 26 + .../google-cloud-vision-v1p4beta1/.gitignore | 22 + .../.repo-metadata.json | 18 + .../.rubocop.yml | 33 + .../google-cloud-vision-v1p4beta1/.toys.rb | 28 + .../google-cloud-vision-v1p4beta1/.yardopts | 12 + .../AUTHENTICATION.md | 122 + .../CHANGELOG.md | 2 + .../google-cloud-vision-v1p4beta1/Gemfile | 14 + .../google-cloud-vision-v1p4beta1/LICENSE.md | 201 + .../google-cloud-vision-v1p4beta1/README.md | 154 + .../google-cloud-vision-v1p4beta1/Rakefile | 169 + .../gapic_metadata.json | 142 + .../google-cloud-vision-v1p4beta1.gemspec | 28 + .../lib/google-cloud-vision-v1p4beta1.rb | 21 + .../lib/google/cloud/vision/v1p4beta1.rb | 46 + .../google/cloud/vision/v1p4beta1/face_pb.rb | 25 + .../cloud/vision/v1p4beta1/geometry_pb.rb | 24 + .../cloud/vision/v1p4beta1/image_annotator.rb | 58 + .../v1p4beta1/image_annotator/client.rb | 794 ++ .../v1p4beta1/image_annotator/credentials.rb | 52 + .../v1p4beta1/image_annotator/operations.rb | 841 ++ .../vision/v1p4beta1/image_annotator/paths.rb | 52 + .../vision/v1p4beta1/image_annotator/rest.rb | 55 + .../v1p4beta1/image_annotator/rest/client.rb | 755 ++ .../image_annotator/rest/operations.rb | 925 ++ .../image_annotator/rest/service_stub.rb | 321 + .../vision/v1p4beta1/image_annotator_pb.rb | 78 + .../v1p4beta1/image_annotator_services_pb.rb | 73 + .../cloud/vision/v1p4beta1/product_search.rb | 73 + .../vision/v1p4beta1/product_search/client.rb | 2558 +++++ .../v1p4beta1/product_search/credentials.rb | 52 + .../v1p4beta1/product_search/operations.rb | 841 ++ .../vision/v1p4beta1/product_search/paths.rb | 109 + .../vision/v1p4beta1/product_search/rest.rb | 70 + .../v1p4beta1/product_search/rest/client.rb | 2382 ++++ .../product_search/rest/operations.rb | 925 ++ .../product_search/rest/service_stub.rb | 1249 +++ .../vision/v1p4beta1/product_search_pb.rb | 30 + .../v1p4beta1/product_search_service_pb.rb | 64 + .../product_search_service_services_pb.rb | 236 + .../lib/google/cloud/vision/v1p4beta1/rest.rb | 38 + .../vision/v1p4beta1/text_annotation_pb.rb | 33 + .../google/cloud/vision/v1p4beta1/version.rb | 28 + .../vision/v1p4beta1/web_detection_pb.rb | 25 + .../proto_docs/README.md | 4 + .../proto_docs/google/api/client.rb | 593 + .../proto_docs/google/api/field_behavior.rb | 85 + .../proto_docs/google/api/launch_stage.rb | 71 + .../proto_docs/google/api/resource.rb | 227 + .../google/cloud/vision/v1p4beta1/face.rb | 68 + .../google/cloud/vision/v1p4beta1/geometry.rb | 82 + .../cloud/vision/v1p4beta1/image_annotator.rb | 994 ++ .../cloud/vision/v1p4beta1/product_search.rb | 136 + .../v1p4beta1/product_search_service.rb | 680 ++ .../cloud/vision/v1p4beta1/text_annotation.rb | 286 + .../cloud/vision/v1p4beta1/web_detection.rb | 121 + .../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 | 148 + .../proto_docs/google/rpc/status.rb | 48 + .../proto_docs/google/type/color.rb | 173 + .../proto_docs/google/type/latlng.rb | 38 + .../snippets/Gemfile | 32 + .../async_batch_annotate_files.rb | 54 + .../async_batch_annotate_images.rb | 54 + .../image_annotator/batch_annotate_files.rb | 47 + .../image_annotator/batch_annotate_images.rb | 47 + .../add_product_to_product_set.rb | 47 + .../snippets/product_search/create_product.rb | 47 + .../product_search/create_product_set.rb | 47 + .../product_search/create_reference_image.rb | 47 + .../snippets/product_search/delete_product.rb | 47 + .../product_search/delete_product_set.rb | 47 + .../product_search/delete_reference_image.rb | 47 + .../snippets/product_search/get_product.rb | 47 + .../product_search/get_product_set.rb | 47 + .../product_search/get_reference_image.rb | 47 + .../product_search/import_product_sets.rb | 54 + .../product_search/list_product_sets.rb | 51 + .../snippets/product_search/list_products.rb | 51 + .../list_products_in_product_set.rb | 51 + .../product_search/list_reference_images.rb | 51 + .../snippets/product_search/purge_products.rb | 54 + .../remove_product_from_product_set.rb | 47 + .../snippets/product_search/update_product.rb | 47 + .../product_search/update_product_set.rb | 47 + ...etadata_google.cloud.vision.v1p4beta1.json | 935 ++ .../image_annotator_operations_test.rb | 400 + .../v1p4beta1/image_annotator_paths_test.rb | 55 + .../v1p4beta1/image_annotator_rest_test.rb | 316 + .../vision/v1p4beta1/image_annotator_test.rb | 362 + .../product_search_operations_test.rb | 400 + .../v1p4beta1/product_search_paths_test.rb | 91 + .../v1p4beta1/product_search_rest_test.rb | 1146 ++ .../vision/v1p4beta1/product_search_test.rb | 1293 +++ .../test/helper.rb | 26 + .../google-cloud-vision_ai-v1/.gitignore | 22 + .../.repo-metadata.json | 17 + .../google-cloud-vision_ai-v1/.rubocop.yml | 33 + .../google-cloud-vision_ai-v1/.toys.rb | 28 + .../google-cloud-vision_ai-v1/.yardopts | 12 + .../AUTHENTICATION.md | 122 + .../google-cloud-vision_ai-v1/CHANGELOG.md | 2 + .../google-cloud-vision_ai-v1/Gemfile | 14 + .../google-cloud-vision_ai-v1/LICENSE.md | 201 + .../google-cloud-vision_ai-v1/README.md | 154 + .../google-cloud-vision_ai-v1/Rakefile | 169 + .../gapic_metadata.json | 748 ++ .../google-cloud-vision_ai-v1.gemspec | 30 + .../lib/google-cloud-vision_ai-v1.rb | 21 + .../lib/google/cloud/vision_ai/v1.rb | 50 + .../google/cloud/vision_ai/v1/app_platform.rb | 56 + .../cloud/vision_ai/v1/app_platform/client.rb | 3365 ++++++ .../vision_ai/v1/app_platform/credentials.rb | 47 + .../vision_ai/v1/app_platform/operations.rb | 841 ++ .../cloud/vision_ai/v1/app_platform/paths.rb | 151 + .../cloud/vision_ai/v1/app_platform/rest.rb | 54 + .../vision_ai/v1/app_platform/rest/client.rb | 3148 ++++++ .../v1/app_platform/rest/operations.rb | 974 ++ .../v1/app_platform/rest/service_stub.rb | 1682 +++ .../cloud/vision_ai/v1/bindings_override.rb | 75 + .../vision_ai/v1/health_check_service.rb | 56 + .../v1/health_check_service/client.rb | 507 + .../v1/health_check_service/credentials.rb | 47 + .../v1/health_check_service/paths.rb | 52 + .../vision_ai/v1/health_check_service/rest.rb | 54 + .../v1/health_check_service/rest/client.rb | 465 + .../health_check_service/rest/service_stub.rb | 142 + .../vision_ai/v1/live_video_analytics.rb | 57 + .../v1/live_video_analytics/client.rb | 2423 +++++ .../v1/live_video_analytics/credentials.rb | 47 + .../v1/live_video_analytics/operations.rb | 841 ++ .../v1/live_video_analytics/paths.rb | 130 + .../vision_ai/v1/live_video_analytics/rest.rb | 55 + .../v1/live_video_analytics/rest/client.rb | 2262 ++++ .../live_video_analytics/rest/operations.rb | 974 ++ .../live_video_analytics/rest/service_stub.rb | 1187 ++ .../lib/google/cloud/vision_ai/v1/rest.rb | 43 + .../cloud/vision_ai/v1/streaming_service.rb | 55 + .../vision_ai/v1/streaming_service/client.rb | 961 ++ .../v1/streaming_service/credentials.rb | 47 + .../vision_ai/v1/streaming_service/paths.rb | 54 + .../vision_ai/v1/streaming_service/rest.rb | 53 + .../v1/streaming_service/rest/client.rb | 650 ++ .../v1/streaming_service/rest/service_stub.rb | 267 + .../cloud/vision_ai/v1/streams_service.rb | 59 + .../vision_ai/v1/streams_service/client.rb | 2978 +++++ .../v1/streams_service/credentials.rb | 47 + .../v1/streams_service/operations.rb | 841 ++ .../vision_ai/v1/streams_service/paths.rb | 153 + .../vision_ai/v1/streams_service/rest.rb | 57 + .../v1/streams_service/rest/client.rb | 2782 +++++ .../v1/streams_service/rest/operations.rb | 974 ++ .../v1/streams_service/rest/service_stub.rb | 1495 +++ .../lib/google/cloud/vision_ai/v1/version.rb | 28 + .../google/cloud/vision_ai/v1/warehouse.rb | 56 + .../cloud/vision_ai/v1/warehouse/client.rb | 6982 ++++++++++++ .../vision_ai/v1/warehouse/credentials.rb | 47 + .../vision_ai/v1/warehouse/operations.rb | 841 ++ .../cloud/vision_ai/v1/warehouse/paths.rb | 237 + .../cloud/vision_ai/v1/warehouse/rest.rb | 54 + .../vision_ai/v1/warehouse/rest/client.rb | 6420 +++++++++++ .../vision_ai/v1/warehouse/rest/operations.rb | 974 ++ .../v1/warehouse/rest/service_stub.rb | 3896 +++++++ .../cloud/visionai/v1/annotations_pb.rb | 67 + .../lib/google/cloud/visionai/v1/common_pb.rb | 28 + .../cloud/visionai/v1/health_service_pb.rb | 27 + .../visionai/v1/health_service_services_pb.rb | 46 + .../lib/google/cloud/visionai/v1/lva_pb.rb | 33 + .../cloud/visionai/v1/lva_resources_pb.rb | 28 + .../cloud/visionai/v1/lva_service_pb.rb | 57 + .../visionai/v1/lva_service_services_pb.rb | 81 + .../google/cloud/visionai/v1/platform_pb.rb | 135 + .../cloud/visionai/v1/platform_services_pb.rb | 111 + .../visionai/v1/streaming_resources_pb.rb | 34 + .../cloud/visionai/v1/streaming_service_pb.rb | 47 + .../v1/streaming_service_services_pb.rb | 55 + .../cloud/visionai/v1/streams_resources_pb.rb | 30 + .../cloud/visionai/v1/streams_service_pb.rb | 60 + .../v1/streams_service_services_pb.rb | 92 + .../google/cloud/visionai/v1/warehouse_pb.rb | 222 + .../visionai/v1/warehouse_services_pb.rb | 228 + .../proto_docs/README.md | 4 + .../proto_docs/google/api/client.rb | 593 + .../proto_docs/google/api/field_behavior.rb | 85 + .../proto_docs/google/api/launch_stage.rb | 71 + .../proto_docs/google/api/resource.rb | 227 + .../google/cloud/visionai/v1/annotations.rb | 791 ++ .../google/cloud/visionai/v1/common.rb | 134 + .../cloud/visionai/v1/health_service.rb | 61 + .../google/cloud/visionai/v1/lva.rb | 353 + .../google/cloud/visionai/v1/lva_resources.rb | 167 + .../google/cloud/visionai/v1/lva_service.rb | 543 + .../google/cloud/visionai/v1/platform.rb | 2272 ++++ .../cloud/visionai/v1/streaming_resources.rb | 182 + .../cloud/visionai/v1/streaming_service.rb | 425 + .../cloud/visionai/v1/streams_resources.rb | 229 + .../cloud/visionai/v1/streams_service.rb | 644 ++ .../google/cloud/visionai/v1/warehouse.rb | 3119 ++++++ .../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/struct.rb | 108 + .../proto_docs/google/protobuf/timestamp.rb | 127 + .../proto_docs/google/rpc/status.rb | 48 + .../proto_docs/google/type/datetime.rb | 104 + .../proto_docs/google/type/expr.rb | 75 + .../snippets/Gemfile | 32 + .../add_application_stream_input.rb | 54 + .../app_platform/create_application.rb | 54 + .../create_application_instances.rb | 54 + .../snippets/app_platform/create_draft.rb | 54 + .../snippets/app_platform/create_processor.rb | 54 + .../app_platform/delete_application.rb | 54 + .../delete_application_instances.rb | 54 + .../snippets/app_platform/delete_draft.rb | 54 + .../snippets/app_platform/delete_processor.rb | 54 + .../app_platform/deploy_application.rb | 54 + .../snippets/app_platform/get_application.rb | 47 + .../snippets/app_platform/get_draft.rb | 47 + .../snippets/app_platform/get_instance.rb | 47 + .../snippets/app_platform/get_processor.rb | 47 + .../app_platform/list_applications.rb | 51 + .../snippets/app_platform/list_drafts.rb | 51 + .../snippets/app_platform/list_instances.rb | 51 + .../app_platform/list_prebuilt_processors.rb | 47 + .../snippets/app_platform/list_processors.rb | 51 + .../remove_application_stream_input.rb | 54 + .../app_platform/undeploy_application.rb | 54 + .../app_platform/update_application.rb | 54 + .../update_application_instances.rb | 54 + .../update_application_stream_input.rb | 54 + .../snippets/app_platform/update_draft.rb | 54 + .../snippets/app_platform/update_processor.rb | 54 + .../health_check_service/health_check.rb | 47 + .../live_video_analytics/batch_run_process.rb | 54 + .../live_video_analytics/create_analysis.rb | 54 + .../live_video_analytics/create_operator.rb | 54 + .../live_video_analytics/create_process.rb | 54 + .../live_video_analytics/delete_analysis.rb | 54 + .../live_video_analytics/delete_operator.rb | 54 + .../live_video_analytics/delete_process.rb | 54 + .../live_video_analytics/get_analysis.rb | 47 + .../live_video_analytics/get_operator.rb | 47 + .../live_video_analytics/get_process.rb | 47 + .../live_video_analytics/list_analyses.rb | 51 + .../live_video_analytics/list_operators.rb | 51 + .../live_video_analytics/list_processes.rb | 51 + .../list_public_operators.rb | 51 + .../resolve_operator_info.rb | 47 + .../live_video_analytics/update_analysis.rb | 54 + .../live_video_analytics/update_operator.rb | 54 + .../live_video_analytics/update_process.rb | 54 + ...pet_metadata_google.cloud.visionai.v1.json | 5495 ++++++++++ .../streaming_service/acquire_lease.rb | 47 + .../streaming_service/receive_events.rb | 56 + .../streaming_service/receive_packets.rb | 56 + .../streaming_service/release_lease.rb | 47 + .../snippets/streaming_service/renew_lease.rb | 47 + .../streaming_service/send_packets.rb | 56 + .../streams_service/create_cluster.rb | 54 + .../snippets/streams_service/create_event.rb | 54 + .../snippets/streams_service/create_series.rb | 54 + .../snippets/streams_service/create_stream.rb | 54 + .../streams_service/delete_cluster.rb | 54 + .../snippets/streams_service/delete_event.rb | 54 + .../snippets/streams_service/delete_series.rb | 54 + .../snippets/streams_service/delete_stream.rb | 54 + .../generate_stream_hls_token.rb | 47 + .../snippets/streams_service/get_cluster.rb | 47 + .../snippets/streams_service/get_event.rb | 47 + .../snippets/streams_service/get_series.rb | 47 + .../snippets/streams_service/get_stream.rb | 47 + .../streams_service/get_stream_thumbnail.rb | 54 + .../snippets/streams_service/list_clusters.rb | 51 + .../snippets/streams_service/list_events.rb | 51 + .../snippets/streams_service/list_series.rb | 51 + .../snippets/streams_service/list_streams.rb | 51 + .../streams_service/materialize_channel.rb | 54 + .../streams_service/update_cluster.rb | 54 + .../snippets/streams_service/update_event.rb | 54 + .../snippets/streams_service/update_series.rb | 54 + .../snippets/streams_service/update_stream.rb | 54 + .../snippets/warehouse/add_collection_item.rb | 47 + .../snippets/warehouse/analyze_asset.rb | 54 + .../snippets/warehouse/analyze_corpus.rb | 54 + .../snippets/warehouse/clip_asset.rb | 47 + .../snippets/warehouse/create_annotation.rb | 47 + .../snippets/warehouse/create_asset.rb | 47 + .../snippets/warehouse/create_collection.rb | 54 + .../snippets/warehouse/create_corpus.rb | 54 + .../snippets/warehouse/create_data_schema.rb | 47 + .../snippets/warehouse/create_index.rb | 54 + .../warehouse/create_index_endpoint.rb | 54 + .../warehouse/create_search_config.rb | 47 + .../warehouse/create_search_hypernym.rb | 47 + .../snippets/warehouse/delete_annotation.rb | 47 + .../snippets/warehouse/delete_asset.rb | 54 + .../snippets/warehouse/delete_collection.rb | 54 + .../snippets/warehouse/delete_corpus.rb | 47 + .../snippets/warehouse/delete_data_schema.rb | 47 + .../snippets/warehouse/delete_index.rb | 54 + .../warehouse/delete_index_endpoint.rb | 54 + .../warehouse/delete_search_config.rb | 47 + .../warehouse/delete_search_hypernym.rb | 47 + .../snippets/warehouse/deploy_index.rb | 54 + .../snippets/warehouse/generate_hls_uri.rb | 47 + .../warehouse/generate_retrieval_url.rb | 47 + .../snippets/warehouse/get_annotation.rb | 47 + .../snippets/warehouse/get_asset.rb | 47 + .../snippets/warehouse/get_collection.rb | 47 + .../snippets/warehouse/get_corpus.rb | 47 + .../snippets/warehouse/get_data_schema.rb | 47 + .../snippets/warehouse/get_index.rb | 47 + .../snippets/warehouse/get_index_endpoint.rb | 47 + .../snippets/warehouse/get_search_config.rb | 47 + .../snippets/warehouse/get_search_hypernym.rb | 47 + .../snippets/warehouse/import_assets.rb | 54 + .../snippets/warehouse/index_asset.rb | 54 + .../snippets/warehouse/ingest_asset.rb | 56 + .../snippets/warehouse/list_annotations.rb | 51 + .../snippets/warehouse/list_assets.rb | 51 + .../snippets/warehouse/list_collections.rb | 51 + .../snippets/warehouse/list_corpora.rb | 51 + .../snippets/warehouse/list_data_schemas.rb | 51 + .../warehouse/list_index_endpoints.rb | 51 + .../snippets/warehouse/list_indexes.rb | 51 + .../snippets/warehouse/list_search_configs.rb | 51 + .../warehouse/list_search_hypernyms.rb | 51 + .../warehouse/remove_collection_item.rb | 47 + .../snippets/warehouse/remove_index_asset.rb | 54 + .../snippets/warehouse/search_assets.rb | 51 + .../warehouse/search_index_endpoint.rb | 51 + .../snippets/warehouse/undeploy_index.rb | 54 + .../snippets/warehouse/update_annotation.rb | 47 + .../snippets/warehouse/update_asset.rb | 47 + .../snippets/warehouse/update_collection.rb | 47 + .../snippets/warehouse/update_corpus.rb | 47 + .../snippets/warehouse/update_data_schema.rb | 47 + .../snippets/warehouse/update_index.rb | 54 + .../warehouse/update_index_endpoint.rb | 54 + .../warehouse/update_search_config.rb | 47 + .../warehouse/update_search_hypernym.rb | 47 + .../snippets/warehouse/upload_asset.rb | 54 + .../warehouse/view_collection_items.rb | 51 + .../snippets/warehouse/view_indexed_assets.rb | 51 + .../v1/app_platform_operations_test.rb | 400 + .../vision_ai/v1/app_platform_paths_test.rb | 115 + .../vision_ai/v1/app_platform_rest_test.rb | 1557 +++ .../cloud/vision_ai/v1/app_platform_test.rb | 1839 ++++ .../v1/health_check_service_paths_test.rb | 55 + .../v1/health_check_service_rest_test.rb | 153 + .../vision_ai/v1/health_check_service_test.rb | 162 + .../live_video_analytics_operations_test.rb | 400 + .../v1/live_video_analytics_paths_test.rb | 103 + .../v1/live_video_analytics_rest_test.rb | 1109 ++ .../vision_ai/v1/live_video_analytics_test.rb | 1308 +++ .../v1/streaming_service_paths_test.rb | 55 + .../v1/streaming_service_rest_test.rb | 269 + .../vision_ai/v1/streaming_service_test.rb | 561 + .../v1/streams_service_operations_test.rb | 400 + .../v1/streams_service_paths_test.rb | 115 + .../vision_ai/v1/streams_service_rest_test.rb | 1387 +++ .../vision_ai/v1/streams_service_test.rb | 1634 +++ .../vision_ai/v1/warehouse_operations_test.rb | 400 + .../vision_ai/v1/warehouse_paths_test.rb | 163 + .../cloud/vision_ai/v1/warehouse_rest_test.rb | 3520 ++++++ .../cloud/vision_ai/v1/warehouse_test.rb | 4111 +++++++ .../google-cloud-vision_ai-v1/test/helper.rb | 26 + .../google-cloud-vm_migration-v1/.gitignore | 22 + .../.repo-metadata.json | 18 + .../google-cloud-vm_migration-v1/.rubocop.yml | 33 + .../google-cloud-vm_migration-v1/.toys.rb | 28 + .../google-cloud-vm_migration-v1/.yardopts | 12 + .../AUTHENTICATION.md | 122 + .../google-cloud-vm_migration-v1/CHANGELOG.md | 2 + .../google-cloud-vm_migration-v1/Gemfile | 14 + .../google-cloud-vm_migration-v1/LICENSE.md | 201 + .../google-cloud-vm_migration-v1/README.md | 154 + .../google-cloud-vm_migration-v1/Rakefile | 169 + .../gapic_metadata.json | 328 + .../google-cloud-vm_migration-v1.gemspec | 30 + .../lib/google-cloud-vm_migration-v1.rb | 22 + .../lib/google/cloud/vm_migration/v1.rb | 45 + .../vm_migration/v1/bindings_override.rb | 75 + .../lib/google/cloud/vm_migration/v1/rest.rb | 38 + .../google/cloud/vm_migration/v1/version.rb | 28 + .../cloud/vm_migration/v1/vm_migration.rb | 56 + .../vm_migration/v1/vm_migration/client.rb | 7173 +++++++++++++ .../v1/vm_migration/credentials.rb | 47 + .../v1/vm_migration/operations.rb | 841 ++ .../vm_migration/v1/vm_migration/paths.rb | 355 + .../vm_migration/v1/vm_migration/rest.rb | 54 + .../v1/vm_migration/rest/client.rb | 6704 ++++++++++++ .../v1/vm_migration/rest/operations.rb | 925 ++ .../v1/vm_migration/rest/service_stub.rb | 3891 +++++++ .../cloud/vmmigration/v1/vmmigration_pb.rb | 262 + .../vmmigration/v1/vmmigration_services_pb.rb | 203 + .../lib/google/iam/v1.rb | 43 + .../lib/google/iam/v1/bindings_override.rb | 73 + .../lib/google/iam/v1/iam_policy.rb | 76 + .../lib/google/iam/v1/iam_policy/client.rb | 727 ++ .../google/iam/v1/iam_policy/credentials.rb | 42 + .../lib/google/iam/v1/iam_policy/rest.rb | 74 + .../google/iam/v1/iam_policy/rest/client.rb | 671 ++ .../iam/v1/iam_policy/rest/service_stub.rb | 265 + .../lib/google/iam/v1/rest.rb | 36 + .../proto_docs/README.md | 4 + .../proto_docs/google/api/client.rb | 593 + .../proto_docs/google/api/field_behavior.rb | 85 + .../proto_docs/google/api/field_info.rb | 88 + .../proto_docs/google/api/launch_stage.rb | 71 + .../proto_docs/google/api/resource.rb | 227 + .../cloud/vmmigration/v1/vmmigration.rb | 4882 +++++++++ .../proto_docs/google/iam/v1/iam_policy.rb | 87 + .../proto_docs/google/iam/v1/options.rb | 50 + .../proto_docs/google/iam/v1/policy.rb | 426 + .../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/rpc/error_details.rb | 420 + .../proto_docs/google/rpc/status.rb | 48 + .../proto_docs/google/type/expr.rb | 75 + .../snippets/Gemfile | 32 + .../snippets/iam_policy/get_iam_policy.rb | 47 + .../snippets/iam_policy/set_iam_policy.rb | 47 + .../iam_policy/test_iam_permissions.rb | 47 + ..._metadata_google.cloud.vmmigration.v1.json | 2495 +++++ .../snippet_metadata_google.iam.v1.json | 135 + .../vm_migration/add_group_migration.rb | 54 + .../snippets/vm_migration/cancel_clone_job.rb | 54 + .../vm_migration/cancel_cutover_job.rb | 54 + .../vm_migration/cancel_disk_migration_job.rb | 54 + .../vm_migration/cancel_image_import_job.rb | 54 + .../snippets/vm_migration/create_clone_job.rb | 54 + .../vm_migration/create_cutover_job.rb | 54 + .../create_datacenter_connector.rb | 54 + .../vm_migration/create_disk_migration_job.rb | 54 + .../snippets/vm_migration/create_group.rb | 54 + .../vm_migration/create_image_import.rb | 54 + .../vm_migration/create_migrating_vm.rb | 54 + .../snippets/vm_migration/create_source.rb | 54 + .../vm_migration/create_target_project.rb | 54 + .../vm_migration/create_utilization_report.rb | 54 + .../delete_datacenter_connector.rb | 54 + .../vm_migration/delete_disk_migration_job.rb | 54 + .../snippets/vm_migration/delete_group.rb | 54 + .../vm_migration/delete_image_import.rb | 54 + .../vm_migration/delete_migrating_vm.rb | 54 + .../snippets/vm_migration/delete_source.rb | 54 + .../vm_migration/delete_target_project.rb | 54 + .../vm_migration/delete_utilization_report.rb | 54 + .../snippets/vm_migration/extend_migration.rb | 54 + .../snippets/vm_migration/fetch_inventory.rb | 47 + .../vm_migration/fetch_storage_inventory.rb | 51 + .../vm_migration/finalize_migration.rb | 54 + .../snippets/vm_migration/get_clone_job.rb | 47 + .../snippets/vm_migration/get_cutover_job.rb | 47 + .../vm_migration/get_datacenter_connector.rb | 47 + .../vm_migration/get_disk_migration_job.rb | 47 + .../snippets/vm_migration/get_group.rb | 47 + .../snippets/vm_migration/get_image_import.rb | 47 + .../vm_migration/get_image_import_job.rb | 47 + .../snippets/vm_migration/get_migrating_vm.rb | 47 + .../vm_migration/get_replication_cycle.rb | 47 + .../snippets/vm_migration/get_source.rb | 47 + .../vm_migration/get_target_project.rb | 47 + .../vm_migration/get_utilization_report.rb | 47 + .../snippets/vm_migration/list_clone_jobs.rb | 51 + .../vm_migration/list_cutover_jobs.rb | 51 + .../list_datacenter_connectors.rb | 51 + .../vm_migration/list_disk_migration_jobs.rb | 51 + .../snippets/vm_migration/list_groups.rb | 51 + .../vm_migration/list_image_import_jobs.rb | 51 + .../vm_migration/list_image_imports.rb | 51 + .../vm_migration/list_migrating_vms.rb | 51 + .../vm_migration/list_replication_cycles.rb | 51 + .../snippets/vm_migration/list_sources.rb | 51 + .../vm_migration/list_target_projects.rb | 51 + .../vm_migration/list_utilization_reports.rb | 51 + .../snippets/vm_migration/pause_migration.rb | 54 + .../vm_migration/remove_group_migration.rb | 54 + .../snippets/vm_migration/resume_migration.rb | 54 + .../vm_migration/run_disk_migration_job.rb | 54 + .../snippets/vm_migration/start_migration.rb | 54 + .../vm_migration/update_disk_migration_job.rb | 54 + .../snippets/vm_migration/update_group.rb | 54 + .../vm_migration/update_migrating_vm.rb | 54 + .../snippets/vm_migration/update_source.rb | 54 + .../vm_migration/update_target_project.rb | 54 + .../vm_migration/upgrade_appliance.rb | 54 + .../v1/vm_migration_operations_test.rb | 400 + .../v1/vm_migration_paths_test.rb | 235 + .../vm_migration/v1/vm_migration_rest_test.rb | 3553 ++++++ .../vm_migration/v1/vm_migration_test.rb | 4171 +++++++ .../google/iam/v1/iam_policy_rest_test.rb | 265 + .../test/google/iam/v1/iam_policy_test.rb | 286 + .../test/helper.rb | 26 + .../google-cloud-vmware_engine-v1/.gitignore | 22 + .../.repo-metadata.json | 17 + .../.rubocop.yml | 33 + .../google-cloud-vmware_engine-v1/.toys.rb | 28 + .../google-cloud-vmware_engine-v1/.yardopts | 12 + .../AUTHENTICATION.md | 122 + .../CHANGELOG.md | 2 + .../google-cloud-vmware_engine-v1/Gemfile | 14 + .../google-cloud-vmware_engine-v1/LICENSE.md | 201 + .../google-cloud-vmware_engine-v1/README.md | 154 + .../google-cloud-vmware_engine-v1/Rakefile | 169 + .../gapic_metadata.json | 388 + .../google-cloud-vmware_engine-v1.gemspec | 30 + .../lib/google-cloud-vmware_engine-v1.rb | 21 + .../lib/google/cloud/vmware_engine/v1.rb | 45 + .../vmware_engine/v1/bindings_override.rb | 156 + .../lib/google/cloud/vmware_engine/v1/rest.rb | 38 + .../google/cloud/vmware_engine/v1/version.rb | 28 + .../cloud/vmware_engine/v1/vmware_engine.rb | 56 + .../vmware_engine/v1/vmware_engine/client.rb | 9555 +++++++++++++++++ .../v1/vmware_engine/credentials.rb | 47 + .../v1/vmware_engine/operations.rb | 841 ++ .../vmware_engine/v1/vmware_engine/paths.rb | 387 + .../vmware_engine/v1/vmware_engine/rest.rb | 54 + .../v1/vmware_engine/rest/client.rb | 9003 ++++++++++++++++ .../v1/vmware_engine/rest/operations.rb | 925 ++ .../v1/vmware_engine/rest/service_stub.rb | 4624 ++++++++ .../cloud/vmwareengine/v1/vmwareengine_pb.rb | 123 + .../v1/vmwareengine_resources_pb.rb | 90 + .../v1/vmwareengine_services_pb.rb | 313 + .../proto_docs/README.md | 4 + .../proto_docs/google/api/client.rb | 593 + .../proto_docs/google/api/field_behavior.rb | 85 + .../proto_docs/google/api/field_info.rb | 88 + .../proto_docs/google/api/launch_stage.rb | 71 + .../proto_docs/google/api/resource.rb | 227 + .../cloud/vmwareengine/v1/vmwareengine.rb | 2791 +++++ .../vmwareengine/v1/vmwareengine_resources.rb | 1690 +++ .../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/rpc/status.rb | 48 + .../proto_docs/google/type/expr.rb | 75 + .../snippets/Gemfile | 32 + ...metadata_google.cloud.vmwareengine.v1.json | 2975 +++++ .../snippets/vmware_engine/create_cluster.rb | 54 + .../create_external_access_rule.rb | 54 + .../vmware_engine/create_external_address.rb | 54 + .../create_hcx_activation_key.rb | 54 + .../vmware_engine/create_logging_server.rb | 54 + .../create_management_dns_zone_binding.rb | 54 + .../vmware_engine/create_network_peering.rb | 54 + .../vmware_engine/create_network_policy.rb | 54 + .../vmware_engine/create_private_cloud.rb | 54 + .../create_private_connection.rb | 54 + .../create_vmware_engine_network.rb | 54 + .../snippets/vmware_engine/delete_cluster.rb | 54 + .../delete_external_access_rule.rb | 54 + .../vmware_engine/delete_external_address.rb | 54 + .../vmware_engine/delete_logging_server.rb | 54 + .../delete_management_dns_zone_binding.rb | 54 + .../vmware_engine/delete_network_peering.rb | 54 + .../vmware_engine/delete_network_policy.rb | 54 + .../vmware_engine/delete_private_cloud.rb | 54 + .../delete_private_connection.rb | 54 + .../delete_vmware_engine_network.rb | 54 + ...fetch_network_policy_external_addresses.rb | 51 + .../snippets/vmware_engine/get_cluster.rb | 47 + .../vmware_engine/get_dns_bind_permission.rb | 47 + .../vmware_engine/get_dns_forwarding.rb | 47 + .../vmware_engine/get_external_access_rule.rb | 47 + .../vmware_engine/get_external_address.rb | 47 + .../vmware_engine/get_hcx_activation_key.rb | 47 + .../vmware_engine/get_logging_server.rb | 47 + .../get_management_dns_zone_binding.rb | 47 + .../vmware_engine/get_network_peering.rb | 47 + .../vmware_engine/get_network_policy.rb | 47 + .../snippets/vmware_engine/get_node.rb | 47 + .../snippets/vmware_engine/get_node_type.rb | 47 + .../vmware_engine/get_private_cloud.rb | 47 + .../vmware_engine/get_private_connection.rb | 47 + .../snippets/vmware_engine/get_subnet.rb | 47 + .../get_vmware_engine_network.rb | 47 + .../grant_dns_bind_permission.rb | 54 + .../snippets/vmware_engine/list_clusters.rb | 51 + .../list_external_access_rules.rb | 51 + .../vmware_engine/list_external_addresses.rb | 51 + .../vmware_engine/list_hcx_activation_keys.rb | 51 + .../vmware_engine/list_logging_servers.rb | 51 + .../list_management_dns_zone_bindings.rb | 51 + .../vmware_engine/list_network_peerings.rb | 51 + .../vmware_engine/list_network_policies.rb | 51 + .../snippets/vmware_engine/list_node_types.rb | 51 + .../snippets/vmware_engine/list_nodes.rb | 51 + .../vmware_engine/list_peering_routes.rb | 51 + .../vmware_engine/list_private_clouds.rb | 51 + .../list_private_connection_peering_routes.rb | 51 + .../vmware_engine/list_private_connections.rb | 51 + .../snippets/vmware_engine/list_subnets.rb | 51 + .../list_vmware_engine_networks.rb | 51 + .../repair_management_dns_zone_binding.rb | 54 + .../vmware_engine/reset_nsx_credentials.rb | 54 + .../reset_vcenter_credentials.rb | 54 + .../revoke_dns_bind_permission.rb | 54 + .../vmware_engine/show_nsx_credentials.rb | 47 + .../vmware_engine/show_vcenter_credentials.rb | 47 + .../vmware_engine/undelete_private_cloud.rb | 54 + .../snippets/vmware_engine/update_cluster.rb | 54 + .../vmware_engine/update_dns_forwarding.rb | 54 + .../update_external_access_rule.rb | 54 + .../vmware_engine/update_external_address.rb | 54 + .../vmware_engine/update_logging_server.rb | 54 + .../update_management_dns_zone_binding.rb | 54 + .../vmware_engine/update_network_peering.rb | 54 + .../vmware_engine/update_network_policy.rb | 54 + .../vmware_engine/update_private_cloud.rb | 54 + .../update_private_connection.rb | 54 + .../snippets/vmware_engine/update_subnet.rb | 54 + .../update_vmware_engine_network.rb | 54 + .../v1/vmware_engine_operations_test.rb | 400 + .../v1/vmware_engine_paths_test.rb | 259 + .../v1/vmware_engine_rest_test.rb | 4233 ++++++++ .../vmware_engine/v1/vmware_engine_test.rb | 4967 +++++++++ .../test/helper.rb | 26 + .../google-cloud-vpc_access-v1/.gitignore | 22 + .../.repo-metadata.json | 18 + .../google-cloud-vpc_access-v1/.rubocop.yml | 33 + .../google-cloud-vpc_access-v1/.toys.rb | 28 + .../google-cloud-vpc_access-v1/.yardopts | 12 + .../AUTHENTICATION.md | 122 + .../google-cloud-vpc_access-v1/CHANGELOG.md | 2 + .../google-cloud-vpc_access-v1/Gemfile | 14 + .../google-cloud-vpc_access-v1/LICENSE.md | 201 + .../google-cloud-vpc_access-v1/README.md | 154 + .../google-cloud-vpc_access-v1/Rakefile | 169 + .../gapic_metadata.json | 38 + .../google-cloud-vpc_access-v1.gemspec | 29 + .../lib/google-cloud-vpc_access-v1.rb | 21 + .../lib/google/cloud/vpc_access/v1.rb | 45 + .../cloud/vpc_access/v1/bindings_override.rb | 64 + .../lib/google/cloud/vpc_access/v1/rest.rb | 38 + .../lib/google/cloud/vpc_access/v1/version.rb | 28 + .../cloud/vpc_access/v1/vpc_access_service.rb | 58 + .../v1/vpc_access_service/client.rb | 830 ++ .../v1/vpc_access_service/credentials.rb | 51 + .../v1/vpc_access_service/operations.rb | 841 ++ .../vpc_access/v1/vpc_access_service/paths.rb | 69 + .../vpc_access/v1/vpc_access_service/rest.rb | 56 + .../v1/vpc_access_service/rest/client.rb | 767 ++ .../v1/vpc_access_service/rest/operations.rb | 925 ++ .../vpc_access_service/rest/service_stub.rb | 326 + .../cloud/vpcaccess/v1/vpc_access_pb.rb | 36 + .../vpcaccess/v1/vpc_access_services_pb.rb | 55 + .../proto_docs/README.md | 4 + .../proto_docs/google/api/client.rb | 593 + .../proto_docs/google/api/field_behavior.rb | 85 + .../proto_docs/google/api/launch_stage.rb | 71 + .../proto_docs/google/api/resource.rb | 227 + .../google/cloud/vpcaccess/v1/vpc_access.rb | 185 + .../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/timestamp.rb | 127 + .../proto_docs/google/rpc/status.rb | 48 + .../snippets/Gemfile | 32 + ...et_metadata_google.cloud.vpcaccess.v1.json | 175 + .../vpc_access_service/create_connector.rb | 54 + .../vpc_access_service/delete_connector.rb | 54 + .../vpc_access_service/get_connector.rb | 47 + .../vpc_access_service/list_connectors.rb | 51 + .../v1/vpc_access_service_operations_test.rb | 400 + .../v1/vpc_access_service_paths_test.rb | 67 + .../v1/vpc_access_service_rest_test.rb | 319 + .../vpc_access/v1/vpc_access_service_test.rb | 373 + .../google-cloud-vpc_access-v1/test/helper.rb | 26 + .../google-cloud-web_risk-v1/.gitignore | 22 + .../.repo-metadata.json | 18 + .../google-cloud-web_risk-v1/.rubocop.yml | 33 + .../google-cloud-web_risk-v1/.toys.rb | 28 + .../google-cloud-web_risk-v1/.yardopts | 12 + .../AUTHENTICATION.md | 122 + .../google-cloud-web_risk-v1/CHANGELOG.md | 2 + .../google-cloud-web_risk-v1/Gemfile | 14 + .../google-cloud-web_risk-v1/LICENSE.md | 201 + .../google-cloud-web_risk-v1/README.md | 154 + .../google-cloud-web_risk-v1/Rakefile | 169 + .../gapic_metadata.json | 43 + .../google-cloud-web_risk-v1.gemspec | 28 + .../lib/google-cloud-web_risk-v1.rb | 21 + .../lib/google/cloud/web_risk/v1.rb | 45 + .../lib/google/cloud/web_risk/v1/rest.rb | 37 + .../lib/google/cloud/web_risk/v1/version.rb | 28 + .../cloud/web_risk/v1/web_risk_service.rb | 57 + .../web_risk/v1/web_risk_service/client.rb | 916 ++ .../v1/web_risk_service/credentials.rb | 51 + .../v1/web_risk_service/operations.rb | 841 ++ .../web_risk/v1/web_risk_service/paths.rb | 47 + .../web_risk/v1/web_risk_service/rest.rb | 54 + .../v1/web_risk_service/rest/client.rb | 862 ++ .../v1/web_risk_service/rest/operations.rb | 925 ++ .../v1/web_risk_service/rest/service_stub.rb | 382 + .../lib/google/cloud/webrisk/v1/webrisk_pb.rb | 58 + .../cloud/webrisk/v1/webrisk_services_pb.rb | 82 + .../proto_docs/README.md | 4 + .../proto_docs/google/api/client.rb | 593 + .../proto_docs/google/api/field_behavior.rb | 85 + .../proto_docs/google/api/launch_stage.rb | 71 + .../proto_docs/google/api/resource.rb | 227 + .../google/cloud/webrisk/v1/webrisk.rb | 528 + .../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/timestamp.rb | 127 + .../proto_docs/google/rpc/status.rb | 48 + .../google-cloud-web_risk-v1/snippets/Gemfile | 32 + ...ppet_metadata_google.cloud.webrisk.v1.json | 215 + .../compute_threat_list_diff.rb | 47 + .../web_risk_service/create_submission.rb | 47 + .../web_risk_service/search_hashes.rb | 47 + .../snippets/web_risk_service/search_uris.rb | 47 + .../snippets/web_risk_service/submit_uri.rb | 54 + .../v1/web_risk_service_operations_test.rb | 400 + .../v1/web_risk_service_paths_test.rb | 55 + .../web_risk/v1/web_risk_service_rest_test.rb | 377 + .../web_risk/v1/web_risk_service_test.rb | 429 + .../google-cloud-web_risk-v1/test/helper.rb | 26 + .../google-cloud-web_risk-v1beta1/.gitignore | 22 + .../.repo-metadata.json | 19 + .../.rubocop.yml | 33 + .../google-cloud-web_risk-v1beta1/.toys.rb | 28 + .../google-cloud-web_risk-v1beta1/.yardopts | 12 + .../AUTHENTICATION.md | 122 + .../CHANGELOG.md | 2 + .../google-cloud-web_risk-v1beta1/Gemfile | 14 + .../google-cloud-web_risk-v1beta1/LICENSE.md | 201 + .../google-cloud-web_risk-v1beta1/README.md | 154 + .../google-cloud-web_risk-v1beta1/Rakefile | 169 + .../gapic_metadata.json | 33 + .../google-cloud-web_risk-v1beta1.gemspec | 28 + .../lib/google-cloud-web_risk-v1beta1.rb | 21 + .../lib/google/cloud/web_risk/v1beta1.rb | 45 + .../lib/google/cloud/web_risk/v1beta1/rest.rb | 37 + .../google/cloud/web_risk/v1beta1/version.rb | 28 + .../web_risk/v1beta1/web_risk_service.rb | 55 + .../v1beta1/web_risk_service/client.rb | 662 ++ .../v1beta1/web_risk_service/credentials.rb | 51 + .../web_risk/v1beta1/web_risk_service/rest.rb | 52 + .../v1beta1/web_risk_service/rest/client.rb | 622 ++ .../web_risk_service/rest/service_stub.rb | 258 + .../cloud/webrisk/v1beta1/webrisk_pb.rb | 43 + .../webrisk/v1beta1/webrisk_services_pb.rb | 55 + .../proto_docs/README.md | 4 + .../proto_docs/google/api/client.rb | 593 + .../proto_docs/google/api/field_behavior.rb | 85 + .../proto_docs/google/api/launch_stage.rb | 71 + .../proto_docs/google/api/resource.rb | 227 + .../google/cloud/webrisk/v1beta1/webrisk.rb | 307 + .../proto_docs/google/protobuf/duration.rb | 98 + .../proto_docs/google/protobuf/timestamp.rb | 127 + .../snippets/Gemfile | 32 + ...metadata_google.cloud.webrisk.v1beta1.json | 135 + .../compute_threat_list_diff.rb | 47 + .../web_risk_service/search_hashes.rb | 47 + .../snippets/web_risk_service/search_uris.rb | 47 + .../v1beta1/web_risk_service_rest_test.rb | 265 + .../web_risk/v1beta1/web_risk_service_test.rb | 286 + .../test/helper.rb | 26 + .../.gitignore | 22 + .../.repo-metadata.json | 18 + .../.rubocop.yml | 33 + .../.toys.rb | 28 + .../.yardopts | 12 + .../AUTHENTICATION.md | 122 + .../CHANGELOG.md | 2 + .../Gemfile | 14 + .../LICENSE.md | 201 + .../README.md | 154 + .../Rakefile | 169 + .../gapic_metadata.json | 83 + ...ogle-cloud-web_security_scanner-v1.gemspec | 28 + .../google-cloud-web_security_scanner-v1.rb | 21 + .../google/cloud/web_security_scanner/v1.rb | 45 + .../cloud/web_security_scanner/v1/rest.rb | 37 + .../cloud/web_security_scanner/v1/version.rb | 28 + .../v1/web_security_scanner.rb | 56 + .../v1/web_security_scanner/client.rb | 1719 +++ .../v1/web_security_scanner/credentials.rb | 51 + .../v1/web_security_scanner/rest.rb | 53 + .../v1/web_security_scanner/rest/client.rb | 1585 +++ .../web_security_scanner/rest/service_stub.rb | 878 ++ .../websecurityscanner/v1/crawled_url_pb.rb | 21 + .../websecurityscanner/v1/finding_addon_pb.rb | 30 + .../cloud/websecurityscanner/v1/finding_pb.rb | 26 + .../v1/finding_type_stats_pb.rb | 21 + .../v1/scan_config_error_pb.rb | 22 + .../websecurityscanner/v1/scan_config_pb.rb | 33 + .../v1/scan_run_error_trace_pb.rb | 24 + .../websecurityscanner/v1/scan_run_log_pb.rb | 24 + .../websecurityscanner/v1/scan_run_pb.rb | 27 + .../v1/scan_run_warning_trace_pb.rb | 22 + .../v1/web_security_scanner_pb.rb | 48 + .../v1/web_security_scanner_services_pb.rb | 72 + .../proto_docs/README.md | 4 + .../proto_docs/google/api/client.rb | 593 + .../proto_docs/google/api/field_behavior.rb | 85 + .../proto_docs/google/api/launch_stage.rb | 71 + .../proto_docs/google/api/resource.rb | 227 + .../websecurityscanner/v1/crawled_url.rb | 44 + .../cloud/websecurityscanner/v1/finding.rb | 117 + .../websecurityscanner/v1/finding_addon.rb | 191 + .../v1/finding_type_stats.rb | 39 + .../websecurityscanner/v1/scan_config.rb | 211 + .../v1/scan_config_error.rb | 191 + .../cloud/websecurityscanner/v1/scan_run.rb | 110 + .../v1/scan_run_error_trace.rb | 77 + .../websecurityscanner/v1/scan_run_log.rb | 56 + .../v1/scan_run_warning_trace.rb | 65 + .../v1/web_security_scanner.rb | 278 + .../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 + .../snippets/Gemfile | 32 + ...ta_google.cloud.websecurityscanner.v1.json | 535 + .../create_scan_config.rb | 47 + .../delete_scan_config.rb | 47 + .../web_security_scanner/get_finding.rb | 47 + .../web_security_scanner/get_scan_config.rb | 47 + .../web_security_scanner/get_scan_run.rb | 47 + .../web_security_scanner/list_crawled_urls.rb | 51 + .../list_finding_type_stats.rb | 47 + .../web_security_scanner/list_findings.rb | 51 + .../web_security_scanner/list_scan_configs.rb | 51 + .../web_security_scanner/list_scan_runs.rb | 51 + .../web_security_scanner/start_scan_run.rb | 47 + .../web_security_scanner/stop_scan_run.rb | 47 + .../update_scan_config.rb | 47 + .../v1/web_security_scanner_rest_test.rb | 812 ++ .../v1/web_security_scanner_test.rb | 900 ++ .../test/helper.rb | 26 + .../.gitignore | 22 + .../.repo-metadata.json | 18 + .../.rubocop.yml | 33 + .../.toys.rb | 28 + .../.yardopts | 12 + .../AUTHENTICATION.md | 122 + .../CHANGELOG.md | 2 + .../Gemfile | 14 + .../LICENSE.md | 201 + .../README.md | 154 + .../Rakefile | 169 + .../gapic_metadata.json | 83 + ...-cloud-web_security_scanner-v1beta.gemspec | 28 + ...oogle-cloud-web_security_scanner-v1beta.rb | 21 + .../cloud/web_security_scanner/v1beta.rb | 45 + .../cloud/web_security_scanner/v1beta/rest.rb | 37 + .../web_security_scanner/v1beta/version.rb | 28 + .../v1beta/web_security_scanner.rb | 57 + .../v1beta/web_security_scanner/client.rb | 1721 +++ .../web_security_scanner/credentials.rb | 51 + .../v1beta/web_security_scanner/paths.rb | 104 + .../v1beta/web_security_scanner/rest.rb | 54 + .../web_security_scanner/rest/client.rb | 1587 +++ .../web_security_scanner/rest/service_stub.rb | 878 ++ .../v1beta/crawled_url_pb.rb | 21 + .../v1beta/finding_addon_pb.rb | 27 + .../websecurityscanner/v1beta/finding_pb.rb | 24 + .../v1beta/finding_type_stats_pb.rb | 21 + .../v1beta/scan_config_error_pb.rb | 22 + .../v1beta/scan_config_pb.rb | 34 + .../v1beta/scan_run_error_trace_pb.rb | 24 + .../websecurityscanner/v1beta/scan_run_pb.rb | 28 + .../v1beta/scan_run_warning_trace_pb.rb | 22 + .../v1beta/web_security_scanner_pb.rb | 50 + .../web_security_scanner_services_pb.rb | 73 + .../proto_docs/README.md | 4 + .../proto_docs/google/api/client.rb | 593 + .../proto_docs/google/api/field_behavior.rb | 85 + .../proto_docs/google/api/launch_stage.rb | 71 + .../proto_docs/google/api/resource.rb | 227 + .../websecurityscanner/v1beta/crawled_url.rb | 44 + .../websecurityscanner/v1beta/finding.rb | 93 + .../v1beta/finding_addon.rb | 111 + .../v1beta/finding_type_stats.rb | 39 + .../websecurityscanner/v1beta/scan_config.rb | 192 + .../v1beta/scan_config_error.rb | 191 + .../websecurityscanner/v1beta/scan_run.rb | 110 + .../v1beta/scan_run_error_trace.rb | 77 + .../v1beta/scan_run_warning_trace.rb | 62 + .../v1beta/web_security_scanner.rb | 278 + .../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 + .../snippets/Gemfile | 32 + ...oogle.cloud.websecurityscanner.v1beta.json | 535 + .../create_scan_config.rb | 47 + .../delete_scan_config.rb | 47 + .../web_security_scanner/get_finding.rb | 47 + .../web_security_scanner/get_scan_config.rb | 47 + .../web_security_scanner/get_scan_run.rb | 47 + .../web_security_scanner/list_crawled_urls.rb | 51 + .../list_finding_type_stats.rb | 47 + .../web_security_scanner/list_findings.rb | 51 + .../web_security_scanner/list_scan_configs.rb | 51 + .../web_security_scanner/list_scan_runs.rb | 51 + .../web_security_scanner/start_scan_run.rb | 47 + .../web_security_scanner/stop_scan_run.rb | 47 + .../update_scan_config.rb | 47 + .../v1beta/web_security_scanner_paths_test.rb | 91 + .../v1beta/web_security_scanner_rest_test.rb | 812 ++ .../v1beta/web_security_scanner_test.rb | 900 ++ .../test/helper.rb | 26 + .../.gitignore | 22 + .../.repo-metadata.json | 18 + .../.rubocop.yml | 33 + .../.toys.rb | 28 + .../.yardopts | 12 + .../AUTHENTICATION.md | 122 + .../CHANGELOG.md | 2 + .../Gemfile | 14 + .../LICENSE.md | 201 + .../README.md | 154 + .../Rakefile | 169 + .../gapic_metadata.json | 38 + ...ogle-cloud-workflows-executions-v1.gemspec | 28 + .../google-cloud-workflows-executions-v1.rb | 21 + .../google/cloud/workflows/executions/v1.rb | 47 + .../workflows/executions/v1/executions.rb | 58 + .../executions/v1/executions/client.rb | 802 ++ .../executions/v1/executions/credentials.rb | 53 + .../executions/v1/executions/paths.rb | 75 + .../executions/v1/executions/rest.rb | 55 + .../executions/v1/executions/rest/client.rb | 731 ++ .../v1/executions/rest/service_stub.rb | 329 + .../workflows/executions/v1/executions_pb.rb | 46 + .../executions/v1/executions_services_pb.rb | 57 + .../cloud/workflows/executions/v1/rest.rb | 39 + .../cloud/workflows/executions/v1/version.rb | 30 + .../proto_docs/README.md | 4 + .../proto_docs/google/api/client.rb | 593 + .../proto_docs/google/api/field_behavior.rb | 85 + .../proto_docs/google/api/launch_stage.rb | 71 + .../proto_docs/google/api/resource.rb | 227 + .../workflows/executions/v1/executions.rb | 369 + .../proto_docs/google/protobuf/duration.rb | 98 + .../proto_docs/google/protobuf/timestamp.rb | 127 + .../snippets/Gemfile | 32 + .../snippets/executions/cancel_execution.rb | 47 + .../snippets/executions/create_execution.rb | 47 + .../snippets/executions/get_execution.rb | 47 + .../snippets/executions/list_executions.rb | 51 + ..._google.cloud.workflows.executions.v1.json | 175 + .../executions/v1/executions_paths_test.rb | 67 + .../executions/v1/executions_rest_test.rb | 322 + .../executions/v1/executions_test.rb | 355 + .../test/helper.rb | 26 + .../.gitignore | 22 + .../.repo-metadata.json | 18 + .../.rubocop.yml | 33 + .../.toys.rb | 28 + .../.yardopts | 12 + .../AUTHENTICATION.md | 122 + .../CHANGELOG.md | 2 + .../Gemfile | 14 + .../LICENSE.md | 201 + .../README.md | 154 + .../Rakefile | 169 + .../gapic_metadata.json | 38 + ...-cloud-workflows-executions-v1beta.gemspec | 28 + ...oogle-cloud-workflows-executions-v1beta.rb | 21 + .../cloud/workflows/executions/v1beta.rb | 42 + .../workflows/executions/v1beta/executions.rb | 52 + .../executions/v1beta/executions/client.rb | 789 ++ .../v1beta/executions/credentials.rb | 53 + .../executions/v1beta/executions/paths.rb | 75 + .../executions/v1beta/executions_pb.rb | 37 + .../v1beta/executions_services_pb.rb | 57 + .../workflows/executions/v1beta/version.rb | 30 + .../proto_docs/README.md | 4 + .../proto_docs/google/api/client.rb | 593 + .../proto_docs/google/api/field_behavior.rb | 85 + .../proto_docs/google/api/launch_stage.rb | 71 + .../proto_docs/google/api/resource.rb | 227 + .../workflows/executions/v1beta/executions.rb | 200 + .../proto_docs/google/protobuf/duration.rb | 98 + .../proto_docs/google/protobuf/timestamp.rb | 127 + .../snippets/Gemfile | 32 + .../snippets/executions/cancel_execution.rb | 47 + .../snippets/executions/create_execution.rb | 47 + .../snippets/executions/get_execution.rb | 47 + .../snippets/executions/list_executions.rb | 51 + ...gle.cloud.workflows.executions.v1beta.json | 175 + .../v1beta/executions_paths_test.rb | 67 + .../executions/v1beta/executions_test.rb | 351 + .../test/helper.rb | 26 + .../google-cloud-workflows-v1/.gitignore | 22 + .../.repo-metadata.json | 18 + .../google-cloud-workflows-v1/.rubocop.yml | 33 + .../google-cloud-workflows-v1/.toys.rb | 28 + .../google-cloud-workflows-v1/.yardopts | 12 + .../AUTHENTICATION.md | 122 + .../google-cloud-workflows-v1/CHANGELOG.md | 2 + .../google-cloud-workflows-v1/Gemfile | 14 + .../google-cloud-workflows-v1/LICENSE.md | 201 + .../google-cloud-workflows-v1/README.md | 154 + .../google-cloud-workflows-v1/Rakefile | 169 + .../gapic_metadata.json | 48 + .../google-cloud-workflows-v1.gemspec | 29 + .../lib/google-cloud-workflows-v1.rb | 21 + .../lib/google/cloud/workflows/v1.rb | 45 + .../cloud/workflows/v1/bindings_override.rb | 75 + .../lib/google/cloud/workflows/v1/rest.rb | 38 + .../lib/google/cloud/workflows/v1/version.rb | 28 + .../google/cloud/workflows/v1/workflows.rb | 58 + .../cloud/workflows/v1/workflows/client.rb | 1074 ++ .../workflows/v1/workflows/credentials.rb | 51 + .../workflows/v1/workflows/operations.rb | 841 ++ .../cloud/workflows/v1/workflows/paths.rb | 113 + .../cloud/workflows/v1/workflows/rest.rb | 56 + .../workflows/v1/workflows/rest/client.rb | 997 ++ .../workflows/v1/workflows/rest/operations.rb | 925 ++ .../v1/workflows/rest/service_stub.rb | 449 + .../google/cloud/workflows/v1/workflows_pb.rb | 44 + .../workflows/v1/workflows_services_pb.rb | 66 + .../proto_docs/README.md | 4 + .../proto_docs/google/api/client.rb | 593 + .../proto_docs/google/api/field_behavior.rb | 85 + .../proto_docs/google/api/launch_stage.rb | 71 + .../proto_docs/google/api/resource.rb | 227 + .../google/cloud/workflows/v1/workflows.rb | 424 + .../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/rpc/status.rb | 48 + .../snippets/Gemfile | 32 + ...et_metadata_google.cloud.workflows.v1.json | 255 + .../snippets/workflows/create_workflow.rb | 54 + .../snippets/workflows/delete_workflow.rb | 54 + .../snippets/workflows/get_workflow.rb | 47 + .../workflows/list_workflow_revisions.rb | 51 + .../snippets/workflows/list_workflows.rb | 51 + .../snippets/workflows/update_workflow.rb | 54 + .../workflows/v1/workflows_operations_test.rb | 400 + .../workflows/v1/workflows_paths_test.rb | 91 + .../cloud/workflows/v1/workflows_rest_test.rb | 433 + .../cloud/workflows/v1/workflows_test.rb | 511 + .../google-cloud-workflows-v1/test/helper.rb | 26 + .../google-cloud-workflows-v1beta/.gitignore | 22 + .../.repo-metadata.json | 18 + .../.rubocop.yml | 33 + .../google-cloud-workflows-v1beta/.toys.rb | 28 + .../google-cloud-workflows-v1beta/.yardopts | 12 + .../AUTHENTICATION.md | 122 + .../CHANGELOG.md | 2 + .../google-cloud-workflows-v1beta/Gemfile | 14 + .../google-cloud-workflows-v1beta/LICENSE.md | 201 + .../google-cloud-workflows-v1beta/README.md | 154 + .../google-cloud-workflows-v1beta/Rakefile | 169 + .../gapic_metadata.json | 43 + .../google-cloud-workflows-v1beta.gemspec | 29 + .../lib/google-cloud-workflows-v1beta.rb | 21 + .../lib/google/cloud/workflows/v1beta.rb | 45 + .../workflows/v1beta/bindings_override.rb | 75 + .../lib/google/cloud/workflows/v1beta/rest.rb | 38 + .../google/cloud/workflows/v1beta/version.rb | 28 + .../cloud/workflows/v1beta/workflows.rb | 58 + .../workflows/v1beta/workflows/client.rb | 952 ++ .../workflows/v1beta/workflows/credentials.rb | 51 + .../workflows/v1beta/workflows/operations.rb | 841 ++ .../cloud/workflows/v1beta/workflows/paths.rb | 69 + .../cloud/workflows/v1beta/workflows/rest.rb | 56 + .../workflows/v1beta/workflows/rest/client.rb | 882 ++ .../v1beta/workflows/rest/operations.rb | 925 ++ .../v1beta/workflows/rest/service_stub.rb | 388 + .../cloud/workflows/v1beta/workflows_pb.rb | 38 + .../workflows/v1beta/workflows_services_pb.rb | 64 + .../proto_docs/README.md | 4 + .../proto_docs/google/api/client.rb | 593 + .../proto_docs/google/api/field_behavior.rb | 85 + .../proto_docs/google/api/launch_stage.rb | 71 + .../proto_docs/google/api/resource.rb | 227 + .../cloud/workflows/v1beta/workflows.rb | 245 + .../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/rpc/status.rb | 48 + .../snippets/Gemfile | 32 + ...etadata_google.cloud.workflows.v1beta.json | 215 + .../snippets/workflows/create_workflow.rb | 54 + .../snippets/workflows/delete_workflow.rb | 54 + .../snippets/workflows/get_workflow.rb | 47 + .../snippets/workflows/list_workflows.rb | 51 + .../snippets/workflows/update_workflow.rb | 54 + .../v1beta/workflows_operations_test.rb | 400 + .../workflows/v1beta/workflows_paths_test.rb | 67 + .../workflows/v1beta/workflows_rest_test.rb | 376 + .../cloud/workflows/v1beta/workflows_test.rb | 442 + .../test/helper.rb | 26 + .../google-cloud-workstations-v1/.gitignore | 22 + .../.repo-metadata.json | 17 + .../google-cloud-workstations-v1/.rubocop.yml | 33 + .../google-cloud-workstations-v1/.toys.rb | 28 + .../google-cloud-workstations-v1/.yardopts | 12 + .../AUTHENTICATION.md | 122 + .../google-cloud-workstations-v1/CHANGELOG.md | 2 + .../google-cloud-workstations-v1/Gemfile | 14 + .../google-cloud-workstations-v1/LICENSE.md | 201 + .../google-cloud-workstations-v1/README.md | 153 + .../google-cloud-workstations-v1/Rakefile | 169 + .../gapic_metadata.json | 118 + .../google-cloud-workstations-v1.gemspec | 30 + .../lib/google-cloud-workstations-v1.rb | 21 + .../lib/google/cloud/workstations/v1.rb | 45 + .../workstations/v1/bindings_override.rb | 110 + .../lib/google/cloud/workstations/v1/rest.rb | 38 + .../google/cloud/workstations/v1/version.rb | 28 + .../cloud/workstations/v1/workstations.rb | 56 + .../workstations/v1/workstations/client.rb | 2595 +++++ .../v1/workstations/credentials.rb | 47 + .../v1/workstations/operations.rb | 841 ++ .../workstations/v1/workstations/paths.rb | 113 + .../workstations/v1/workstations/rest.rb | 54 + .../v1/workstations/rest/client.rb | 2420 +++++ .../v1/workstations/rest/operations.rb | 925 ++ .../v1/workstations/rest/service_stub.rb | 1310 +++ .../cloud/workstations/v1/workstations_pb.rb | 72 + .../v1/workstations_services_pb.rb | 86 + .../proto_docs/README.md | 4 + .../proto_docs/google/api/client.rb | 593 + .../proto_docs/google/api/field_behavior.rb | 85 + .../proto_docs/google/api/launch_stage.rb | 71 + .../proto_docs/google/api/resource.rb | 227 + .../cloud/workstations/v1/workstations.rb | 1177 ++ .../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/rpc/status.rb | 48 + .../proto_docs/google/type/expr.rb | 75 + .../snippets/Gemfile | 32 + ...metadata_google.cloud.workstations.v1.json | 815 ++ .../workstations/create_workstation.rb | 54 + .../create_workstation_cluster.rb | 54 + .../workstations/create_workstation_config.rb | 54 + .../workstations/delete_workstation.rb | 54 + .../delete_workstation_cluster.rb | 54 + .../workstations/delete_workstation_config.rb | 54 + .../workstations/generate_access_token.rb | 47 + .../snippets/workstations/get_workstation.rb | 47 + .../workstations/get_workstation_cluster.rb | 47 + .../workstations/get_workstation_config.rb | 47 + .../list_usable_workstation_configs.rb | 51 + .../workstations/list_usable_workstations.rb | 51 + .../workstations/list_workstation_clusters.rb | 51 + .../workstations/list_workstation_configs.rb | 51 + .../workstations/list_workstations.rb | 51 + .../workstations/start_workstation.rb | 54 + .../snippets/workstations/stop_workstation.rb | 54 + .../workstations/update_workstation.rb | 54 + .../update_workstation_cluster.rb | 54 + .../workstations/update_workstation_config.rb | 54 + .../v1/workstations_operations_test.rb | 400 + .../v1/workstations_paths_test.rb | 91 + .../workstations/v1/workstations_rest_test.rb | 1220 +++ .../workstations/v1/workstations_test.rb | 1441 +++ .../test/helper.rb | 26 + .../.gitignore | 22 + .../.repo-metadata.json | 17 + .../.rubocop.yml | 33 + .../google-cloud-workstations-v1beta/.toys.rb | 28 + .../.yardopts | 12 + .../AUTHENTICATION.md | 122 + .../CHANGELOG.md | 2 + .../google-cloud-workstations-v1beta/Gemfile | 14 + .../LICENSE.md | 201 + .../README.md | 153 + .../google-cloud-workstations-v1beta/Rakefile | 169 + .../gapic_metadata.json | 118 + .../google-cloud-workstations-v1beta.gemspec | 30 + .../lib/google-cloud-workstations-v1beta.rb | 21 + .../lib/google/cloud/workstations/v1beta.rb | 45 + .../workstations/v1beta/bindings_override.rb | 110 + .../google/cloud/workstations/v1beta/rest.rb | 38 + .../cloud/workstations/v1beta/version.rb | 28 + .../cloud/workstations/v1beta/workstations.rb | 56 + .../v1beta/workstations/client.rb | 2595 +++++ .../v1beta/workstations/credentials.rb | 47 + .../v1beta/workstations/operations.rb | 841 ++ .../workstations/v1beta/workstations/paths.rb | 113 + .../workstations/v1beta/workstations/rest.rb | 54 + .../v1beta/workstations/rest/client.rb | 2420 +++++ .../v1beta/workstations/rest/operations.rb | 925 ++ .../v1beta/workstations/rest/service_stub.rb | 1310 +++ .../workstations/v1beta/workstations_pb.rb | 75 + .../v1beta/workstations_services_pb.rb | 86 + .../proto_docs/README.md | 4 + .../proto_docs/google/api/client.rb | 593 + .../proto_docs/google/api/field_behavior.rb | 85 + .../proto_docs/google/api/launch_stage.rb | 71 + .../proto_docs/google/api/resource.rb | 227 + .../cloud/workstations/v1beta/workstations.rb | 1265 +++ .../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/rpc/status.rb | 48 + .../proto_docs/google/type/expr.rb | 75 + .../snippets/Gemfile | 32 + ...data_google.cloud.workstations.v1beta.json | 815 ++ .../workstations/create_workstation.rb | 54 + .../create_workstation_cluster.rb | 54 + .../workstations/create_workstation_config.rb | 54 + .../workstations/delete_workstation.rb | 54 + .../delete_workstation_cluster.rb | 54 + .../workstations/delete_workstation_config.rb | 54 + .../workstations/generate_access_token.rb | 47 + .../snippets/workstations/get_workstation.rb | 47 + .../workstations/get_workstation_cluster.rb | 47 + .../workstations/get_workstation_config.rb | 47 + .../list_usable_workstation_configs.rb | 51 + .../workstations/list_usable_workstations.rb | 51 + .../workstations/list_workstation_clusters.rb | 51 + .../workstations/list_workstation_configs.rb | 51 + .../workstations/list_workstations.rb | 51 + .../workstations/start_workstation.rb | 54 + .../snippets/workstations/stop_workstation.rb | 54 + .../workstations/update_workstation.rb | 54 + .../update_workstation_cluster.rb | 54 + .../workstations/update_workstation_config.rb | 54 + .../v1beta/workstations_operations_test.rb | 400 + .../v1beta/workstations_paths_test.rb | 91 + .../v1beta/workstations_rest_test.rb | 1220 +++ .../workstations/v1beta/workstations_test.rb | 1441 +++ .../test/helper.rb | 26 + .../google-iam-credentials-v1/.gitignore | 22 + .../.repo-metadata.json | 18 + .../google-iam-credentials-v1/.rubocop.yml | 33 + .../google-iam-credentials-v1/.toys.rb | 28 + .../google-iam-credentials-v1/.yardopts | 12 + .../AUTHENTICATION.md | 122 + .../google-iam-credentials-v1/CHANGELOG.md | 2 + .../google-iam-credentials-v1/Gemfile | 14 + .../google-iam-credentials-v1/LICENSE.md | 201 + .../google-iam-credentials-v1/README.md | 154 + .../google-iam-credentials-v1/Rakefile | 169 + .../gapic_metadata.json | 38 + .../google-iam-credentials-v1.gemspec | 28 + .../lib/google-iam-credentials-v1.rb | 21 + .../lib/google/iam/credentials/v1.rb | 45 + .../google/iam/credentials/v1/common_pb.rb | 33 + .../iam/credentials/v1/iam_credentials.rb | 63 + .../credentials/v1/iam_credentials/client.rb | 854 ++ .../v1/iam_credentials/credentials.rb | 51 + .../credentials/v1/iam_credentials/paths.rb | 50 + .../credentials/v1/iam_credentials/rest.rb | 60 + .../v1/iam_credentials/rest/client.rb | 783 ++ .../v1/iam_credentials/rest/service_stub.rb | 329 + .../iam/credentials/v1/iamcredentials_pb.rb | 24 + .../v1/iamcredentials_services_pb.rb | 59 + .../lib/google/iam/credentials/v1/rest.rb | 37 + .../lib/google/iam/credentials/v1/version.rb | 28 + .../proto_docs/README.md | 4 + .../proto_docs/google/api/client.rb | 593 + .../proto_docs/google/api/field_behavior.rb | 85 + .../proto_docs/google/api/launch_stage.rb | 71 + .../proto_docs/google/api/resource.rb | 227 + .../google/iam/credentials/v1/common.rb | 186 + .../proto_docs/google/protobuf/duration.rb | 98 + .../proto_docs/google/protobuf/timestamp.rb | 127 + .../snippets/Gemfile | 32 + .../iam_credentials/generate_access_token.rb | 47 + .../iam_credentials/generate_id_token.rb | 47 + .../snippets/iam_credentials/sign_blob.rb | 47 + .../snippets/iam_credentials/sign_jwt.rb | 47 + ...et_metadata_google.iam.credentials.v1.json | 175 + .../v1/iam_credentials_paths_test.rb | 55 + .../v1/iam_credentials_rest_test.rb | 325 + .../credentials/v1/iam_credentials_test.rb | 356 + .../google-iam-credentials-v1/test/helper.rb | 26 + owl-bot-staging/google-iam-v1/.gitignore | 22 + .../google-iam-v1/.repo-metadata.json | 15 + owl-bot-staging/google-iam-v1/.rubocop.yml | 33 + owl-bot-staging/google-iam-v1/.toys.rb | 28 + owl-bot-staging/google-iam-v1/.yardopts | 12 + .../google-iam-v1/AUTHENTICATION.md | 122 + owl-bot-staging/google-iam-v1/CHANGELOG.md | 2 + owl-bot-staging/google-iam-v1/Gemfile | 14 + owl-bot-staging/google-iam-v1/LICENSE.md | 201 + owl-bot-staging/google-iam-v1/README.md | 151 + owl-bot-staging/google-iam-v1/Rakefile | 169 + .../google-iam-v1/gapic_metadata.json | 33 + .../google-iam-v1/google-iam-v1.gemspec | 29 + .../google-iam-v1/lib/google-iam-v1.rb | 21 + .../google-iam-v1/lib/google/iam/v1.rb | 43 + .../lib/google/iam/v1/iam_policy.rb | 76 + .../lib/google/iam/v1/iam_policy/client.rb | 711 ++ .../google/iam/v1/iam_policy/credentials.rb | 42 + .../lib/google/iam/v1/iam_policy/rest.rb | 73 + .../google/iam/v1/iam_policy/rest/client.rb | 660 ++ .../iam/v1/iam_policy/rest/service_stub.rb | 280 + .../lib/google/iam/v1/iam_policy_pb.rb | 30 + .../google/iam/v1/iam_policy_services_pb.rb | 82 + .../google/iam/v1/logging/audit_data_pb.rb | 23 + .../lib/google/iam/v1/options_pb.rb | 19 + .../lib/google/iam/v1/policy_pb.rb | 30 + .../iam/v1/resource_policy_member_pb.rb | 21 + .../google-iam-v1/lib/google/iam/v1/rest.rb | 35 + .../lib/google/iam/v1/version.rb | 26 + .../google-iam-v1/proto_docs/README.md | 4 + .../proto_docs/google/api/client.rb | 593 + .../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/iam/v1/iam_policy.rb | 87 + .../proto_docs/google/iam/v1/options.rb | 50 + .../proto_docs/google/iam/v1/policy.rb | 426 + .../google/iam/v1/resource_policy_member.rb | 49 + .../proto_docs/google/protobuf/duration.rb | 98 + .../proto_docs/google/protobuf/field_mask.rb | 229 + .../proto_docs/google/type/expr.rb | 75 + .../google-iam-v1/snippets/Gemfile | 32 + .../snippets/iam_policy/get_iam_policy.rb | 47 + .../snippets/iam_policy/set_iam_policy.rb | 47 + .../iam_policy/test_iam_permissions.rb | 47 + .../snippet_metadata_google.iam.v1.json | 135 + .../google/iam/v1/iam_policy_rest_test.rb | 265 + .../test/google/iam/v1/iam_policy_test.rb | 286 + owl-bot-staging/google-iam-v1/test/helper.rb | 26 + owl-bot-staging/google-iam-v1beta/.gitignore | 22 + .../google-iam-v1beta/.repo-metadata.json | 18 + .../google-iam-v1beta/.rubocop.yml | 33 + owl-bot-staging/google-iam-v1beta/.toys.rb | 28 + owl-bot-staging/google-iam-v1beta/.yardopts | 12 + .../google-iam-v1beta/AUTHENTICATION.md | 122 + .../google-iam-v1beta/CHANGELOG.md | 2 + owl-bot-staging/google-iam-v1beta/Gemfile | 14 + owl-bot-staging/google-iam-v1beta/LICENSE.md | 201 + owl-bot-staging/google-iam-v1beta/README.md | 154 + owl-bot-staging/google-iam-v1beta/Rakefile | 169 + .../google-iam-v1beta/gapic_metadata.json | 78 + .../google-iam-v1beta.gemspec | 28 + .../lib/google-iam-v1beta.rb | 21 + .../lib/google/iam/v1beta.rb | 38 + .../lib/google/iam/v1beta/version.rb | 26 + .../iam/v1beta/workload_identity_pool_pb.rb | 47 + .../workload_identity_pool_services_pb.rb | 103 + .../iam/v1beta/workload_identity_pools.rb | 48 + .../v1beta/workload_identity_pools/client.rb | 1718 +++ .../workload_identity_pools/credentials.rb | 49 + .../workload_identity_pools/operations.rb | 839 ++ .../v1beta/workload_identity_pools/paths.rb | 85 + .../google-iam-v1beta/proto_docs/README.md | 4 + .../proto_docs/google/api/client.rb | 593 + .../proto_docs/google/api/field_behavior.rb | 85 + .../proto_docs/google/api/launch_stage.rb | 71 + .../proto_docs/google/api/resource.rb | 227 + .../iam/v1beta/workload_identity_pool.rb | 467 + .../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/rpc/status.rb | 48 + .../google-iam-v1beta/snippets/Gemfile | 32 + .../snippet_metadata_google.iam.v1beta.json | 495 + .../create_workload_identity_pool.rb | 54 + .../create_workload_identity_pool_provider.rb | 54 + .../delete_workload_identity_pool.rb | 54 + .../delete_workload_identity_pool_provider.rb | 54 + .../get_workload_identity_pool.rb | 47 + .../get_workload_identity_pool_provider.rb | 47 + .../list_workload_identity_pool_providers.rb | 51 + .../list_workload_identity_pools.rb | 51 + .../undelete_workload_identity_pool.rb | 54 + ...ndelete_workload_identity_pool_provider.rb | 54 + .../update_workload_identity_pool.rb | 54 + .../update_workload_identity_pool_provider.rb | 54 + ...workload_identity_pools_operations_test.rb | 400 + .../workload_identity_pools_paths_test.rb | 79 + .../v1beta/workload_identity_pools_test.rb | 888 ++ .../google-iam-v1beta/test/helper.rb | 26 + owl-bot-staging/google-iam-v2/.gitignore | 22 + .../google-iam-v2/.repo-metadata.json | 17 + owl-bot-staging/google-iam-v2/.rubocop.yml | 33 + owl-bot-staging/google-iam-v2/.toys.rb | 28 + owl-bot-staging/google-iam-v2/.yardopts | 12 + .../google-iam-v2/AUTHENTICATION.md | 122 + owl-bot-staging/google-iam-v2/CHANGELOG.md | 2 + owl-bot-staging/google-iam-v2/Gemfile | 14 + owl-bot-staging/google-iam-v2/LICENSE.md | 201 + owl-bot-staging/google-iam-v2/README.md | 154 + owl-bot-staging/google-iam-v2/Rakefile | 169 + .../google-iam-v2/gapic_metadata.json | 43 + .../google-iam-v2/google-iam-v2.gemspec | 28 + .../google-iam-v2/lib/google-iam-v2.rb | 21 + .../google-iam-v2/lib/google/iam/v2.rb | 43 + .../lib/google/iam/v2/deny_pb.rb | 21 + .../lib/google/iam/v2/policies.rb | 53 + .../lib/google/iam/v2/policies/client.rb | 987 ++ .../lib/google/iam/v2/policies/credentials.rb | 45 + .../lib/google/iam/v2/policies/operations.rb | 839 ++ .../lib/google/iam/v2/policies/rest.rb | 50 + .../lib/google/iam/v2/policies/rest/client.rb | 909 ++ .../google/iam/v2/policies/rest/operations.rb | 923 ++ .../iam/v2/policies/rest/service_stub.rb | 386 + .../lib/google/iam/v2/policy_pb.rb | 34 + .../lib/google/iam/v2/policy_services_pb.rb | 65 + .../google-iam-v2/lib/google/iam/v2/rest.rb | 35 + .../lib/google/iam/v2/version.rb | 26 + .../google-iam-v2/proto_docs/README.md | 4 + .../proto_docs/google/api/client.rb | 593 + .../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/iam/v2/deny.rb | 110 + .../proto_docs/google/iam/v2/policy.rb | 241 + .../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/timestamp.rb | 127 + .../proto_docs/google/rpc/status.rb | 48 + .../proto_docs/google/type/expr.rb | 75 + .../google-iam-v2/snippets/Gemfile | 32 + .../snippets/policies/create_policy.rb | 54 + .../snippets/policies/delete_policy.rb | 54 + .../snippets/policies/get_policy.rb | 47 + .../snippets/policies/list_policies.rb | 51 + .../snippets/policies/update_policy.rb | 54 + .../snippet_metadata_google.iam.v2.json | 215 + .../google/iam/v2/policies_operations_test.rb | 400 + .../test/google/iam/v2/policies_rest_test.rb | 374 + .../test/google/iam/v2/policies_test.rb | 438 + owl-bot-staging/google-iam-v2/test/helper.rb | 26 + 1552 files changed, 382359 insertions(+) create mode 100644 owl-bot-staging/google-cloud-vision-v1p3beta1/.gitignore create mode 100644 owl-bot-staging/google-cloud-vision-v1p3beta1/.repo-metadata.json create mode 100644 owl-bot-staging/google-cloud-vision-v1p3beta1/.rubocop.yml create mode 100644 owl-bot-staging/google-cloud-vision-v1p3beta1/.toys.rb create mode 100644 owl-bot-staging/google-cloud-vision-v1p3beta1/.yardopts create mode 100644 owl-bot-staging/google-cloud-vision-v1p3beta1/AUTHENTICATION.md create mode 100644 owl-bot-staging/google-cloud-vision-v1p3beta1/CHANGELOG.md create mode 100644 owl-bot-staging/google-cloud-vision-v1p3beta1/Gemfile create mode 100644 owl-bot-staging/google-cloud-vision-v1p3beta1/LICENSE.md create mode 100644 owl-bot-staging/google-cloud-vision-v1p3beta1/README.md create mode 100644 owl-bot-staging/google-cloud-vision-v1p3beta1/Rakefile create mode 100644 owl-bot-staging/google-cloud-vision-v1p3beta1/gapic_metadata.json create mode 100644 owl-bot-staging/google-cloud-vision-v1p3beta1/google-cloud-vision-v1p3beta1.gemspec create mode 100644 owl-bot-staging/google-cloud-vision-v1p3beta1/lib/google-cloud-vision-v1p3beta1.rb create mode 100644 owl-bot-staging/google-cloud-vision-v1p3beta1/lib/google/cloud/vision/v1p3beta1.rb create mode 100644 owl-bot-staging/google-cloud-vision-v1p3beta1/lib/google/cloud/vision/v1p3beta1/geometry_pb.rb create mode 100644 owl-bot-staging/google-cloud-vision-v1p3beta1/lib/google/cloud/vision/v1p3beta1/image_annotator.rb create mode 100644 owl-bot-staging/google-cloud-vision-v1p3beta1/lib/google/cloud/vision/v1p3beta1/image_annotator/client.rb create mode 100644 owl-bot-staging/google-cloud-vision-v1p3beta1/lib/google/cloud/vision/v1p3beta1/image_annotator/credentials.rb create mode 100644 owl-bot-staging/google-cloud-vision-v1p3beta1/lib/google/cloud/vision/v1p3beta1/image_annotator/operations.rb create mode 100644 owl-bot-staging/google-cloud-vision-v1p3beta1/lib/google/cloud/vision/v1p3beta1/image_annotator/paths.rb create mode 100644 owl-bot-staging/google-cloud-vision-v1p3beta1/lib/google/cloud/vision/v1p3beta1/image_annotator/rest.rb create mode 100644 owl-bot-staging/google-cloud-vision-v1p3beta1/lib/google/cloud/vision/v1p3beta1/image_annotator/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-vision-v1p3beta1/lib/google/cloud/vision/v1p3beta1/image_annotator/rest/operations.rb create mode 100644 owl-bot-staging/google-cloud-vision-v1p3beta1/lib/google/cloud/vision/v1p3beta1/image_annotator/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-vision-v1p3beta1/lib/google/cloud/vision/v1p3beta1/image_annotator_pb.rb create mode 100644 owl-bot-staging/google-cloud-vision-v1p3beta1/lib/google/cloud/vision/v1p3beta1/image_annotator_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-vision-v1p3beta1/lib/google/cloud/vision/v1p3beta1/product_search.rb create mode 100644 owl-bot-staging/google-cloud-vision-v1p3beta1/lib/google/cloud/vision/v1p3beta1/product_search/client.rb create mode 100644 owl-bot-staging/google-cloud-vision-v1p3beta1/lib/google/cloud/vision/v1p3beta1/product_search/credentials.rb create mode 100644 owl-bot-staging/google-cloud-vision-v1p3beta1/lib/google/cloud/vision/v1p3beta1/product_search/operations.rb create mode 100644 owl-bot-staging/google-cloud-vision-v1p3beta1/lib/google/cloud/vision/v1p3beta1/product_search/paths.rb create mode 100644 owl-bot-staging/google-cloud-vision-v1p3beta1/lib/google/cloud/vision/v1p3beta1/product_search/rest.rb create mode 100644 owl-bot-staging/google-cloud-vision-v1p3beta1/lib/google/cloud/vision/v1p3beta1/product_search/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-vision-v1p3beta1/lib/google/cloud/vision/v1p3beta1/product_search/rest/operations.rb create mode 100644 owl-bot-staging/google-cloud-vision-v1p3beta1/lib/google/cloud/vision/v1p3beta1/product_search/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-vision-v1p3beta1/lib/google/cloud/vision/v1p3beta1/product_search_pb.rb create mode 100644 owl-bot-staging/google-cloud-vision-v1p3beta1/lib/google/cloud/vision/v1p3beta1/product_search_service_pb.rb create mode 100644 owl-bot-staging/google-cloud-vision-v1p3beta1/lib/google/cloud/vision/v1p3beta1/product_search_service_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-vision-v1p3beta1/lib/google/cloud/vision/v1p3beta1/rest.rb create mode 100644 owl-bot-staging/google-cloud-vision-v1p3beta1/lib/google/cloud/vision/v1p3beta1/text_annotation_pb.rb create mode 100644 owl-bot-staging/google-cloud-vision-v1p3beta1/lib/google/cloud/vision/v1p3beta1/version.rb create mode 100644 owl-bot-staging/google-cloud-vision-v1p3beta1/lib/google/cloud/vision/v1p3beta1/web_detection_pb.rb create mode 100644 owl-bot-staging/google-cloud-vision-v1p3beta1/proto_docs/README.md create mode 100644 owl-bot-staging/google-cloud-vision-v1p3beta1/proto_docs/google/api/client.rb create mode 100644 owl-bot-staging/google-cloud-vision-v1p3beta1/proto_docs/google/api/field_behavior.rb create mode 100644 owl-bot-staging/google-cloud-vision-v1p3beta1/proto_docs/google/api/launch_stage.rb create mode 100644 owl-bot-staging/google-cloud-vision-v1p3beta1/proto_docs/google/api/resource.rb create mode 100644 owl-bot-staging/google-cloud-vision-v1p3beta1/proto_docs/google/cloud/vision/v1p3beta1/geometry.rb create mode 100644 owl-bot-staging/google-cloud-vision-v1p3beta1/proto_docs/google/cloud/vision/v1p3beta1/image_annotator.rb create mode 100644 owl-bot-staging/google-cloud-vision-v1p3beta1/proto_docs/google/cloud/vision/v1p3beta1/product_search.rb create mode 100644 owl-bot-staging/google-cloud-vision-v1p3beta1/proto_docs/google/cloud/vision/v1p3beta1/product_search_service.rb create mode 100644 owl-bot-staging/google-cloud-vision-v1p3beta1/proto_docs/google/cloud/vision/v1p3beta1/text_annotation.rb create mode 100644 owl-bot-staging/google-cloud-vision-v1p3beta1/proto_docs/google/cloud/vision/v1p3beta1/web_detection.rb create mode 100644 owl-bot-staging/google-cloud-vision-v1p3beta1/proto_docs/google/longrunning/operations.rb create mode 100644 owl-bot-staging/google-cloud-vision-v1p3beta1/proto_docs/google/protobuf/any.rb create mode 100644 owl-bot-staging/google-cloud-vision-v1p3beta1/proto_docs/google/protobuf/duration.rb create mode 100644 owl-bot-staging/google-cloud-vision-v1p3beta1/proto_docs/google/protobuf/empty.rb create mode 100644 owl-bot-staging/google-cloud-vision-v1p3beta1/proto_docs/google/protobuf/field_mask.rb create mode 100644 owl-bot-staging/google-cloud-vision-v1p3beta1/proto_docs/google/protobuf/timestamp.rb create mode 100644 owl-bot-staging/google-cloud-vision-v1p3beta1/proto_docs/google/protobuf/wrappers.rb create mode 100644 owl-bot-staging/google-cloud-vision-v1p3beta1/proto_docs/google/rpc/status.rb create mode 100644 owl-bot-staging/google-cloud-vision-v1p3beta1/proto_docs/google/type/color.rb create mode 100644 owl-bot-staging/google-cloud-vision-v1p3beta1/proto_docs/google/type/latlng.rb create mode 100644 owl-bot-staging/google-cloud-vision-v1p3beta1/snippets/Gemfile create mode 100644 owl-bot-staging/google-cloud-vision-v1p3beta1/snippets/image_annotator/async_batch_annotate_files.rb create mode 100644 owl-bot-staging/google-cloud-vision-v1p3beta1/snippets/image_annotator/batch_annotate_images.rb create mode 100644 owl-bot-staging/google-cloud-vision-v1p3beta1/snippets/product_search/add_product_to_product_set.rb create mode 100644 owl-bot-staging/google-cloud-vision-v1p3beta1/snippets/product_search/create_product.rb create mode 100644 owl-bot-staging/google-cloud-vision-v1p3beta1/snippets/product_search/create_product_set.rb create mode 100644 owl-bot-staging/google-cloud-vision-v1p3beta1/snippets/product_search/create_reference_image.rb create mode 100644 owl-bot-staging/google-cloud-vision-v1p3beta1/snippets/product_search/delete_product.rb create mode 100644 owl-bot-staging/google-cloud-vision-v1p3beta1/snippets/product_search/delete_product_set.rb create mode 100644 owl-bot-staging/google-cloud-vision-v1p3beta1/snippets/product_search/delete_reference_image.rb create mode 100644 owl-bot-staging/google-cloud-vision-v1p3beta1/snippets/product_search/get_product.rb create mode 100644 owl-bot-staging/google-cloud-vision-v1p3beta1/snippets/product_search/get_product_set.rb create mode 100644 owl-bot-staging/google-cloud-vision-v1p3beta1/snippets/product_search/get_reference_image.rb create mode 100644 owl-bot-staging/google-cloud-vision-v1p3beta1/snippets/product_search/import_product_sets.rb create mode 100644 owl-bot-staging/google-cloud-vision-v1p3beta1/snippets/product_search/list_product_sets.rb create mode 100644 owl-bot-staging/google-cloud-vision-v1p3beta1/snippets/product_search/list_products.rb create mode 100644 owl-bot-staging/google-cloud-vision-v1p3beta1/snippets/product_search/list_products_in_product_set.rb create mode 100644 owl-bot-staging/google-cloud-vision-v1p3beta1/snippets/product_search/list_reference_images.rb create mode 100644 owl-bot-staging/google-cloud-vision-v1p3beta1/snippets/product_search/remove_product_from_product_set.rb create mode 100644 owl-bot-staging/google-cloud-vision-v1p3beta1/snippets/product_search/update_product.rb create mode 100644 owl-bot-staging/google-cloud-vision-v1p3beta1/snippets/product_search/update_product_set.rb create mode 100644 owl-bot-staging/google-cloud-vision-v1p3beta1/snippets/snippet_metadata_google.cloud.vision.v1p3beta1.json create mode 100644 owl-bot-staging/google-cloud-vision-v1p3beta1/test/google/cloud/vision/v1p3beta1/image_annotator_operations_test.rb create mode 100644 owl-bot-staging/google-cloud-vision-v1p3beta1/test/google/cloud/vision/v1p3beta1/image_annotator_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-vision-v1p3beta1/test/google/cloud/vision/v1p3beta1/image_annotator_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-vision-v1p3beta1/test/google/cloud/vision/v1p3beta1/image_annotator_test.rb create mode 100644 owl-bot-staging/google-cloud-vision-v1p3beta1/test/google/cloud/vision/v1p3beta1/product_search_operations_test.rb create mode 100644 owl-bot-staging/google-cloud-vision-v1p3beta1/test/google/cloud/vision/v1p3beta1/product_search_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-vision-v1p3beta1/test/google/cloud/vision/v1p3beta1/product_search_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-vision-v1p3beta1/test/google/cloud/vision/v1p3beta1/product_search_test.rb create mode 100644 owl-bot-staging/google-cloud-vision-v1p3beta1/test/helper.rb create mode 100644 owl-bot-staging/google-cloud-vision-v1p4beta1/.gitignore create mode 100644 owl-bot-staging/google-cloud-vision-v1p4beta1/.repo-metadata.json create mode 100644 owl-bot-staging/google-cloud-vision-v1p4beta1/.rubocop.yml create mode 100644 owl-bot-staging/google-cloud-vision-v1p4beta1/.toys.rb create mode 100644 owl-bot-staging/google-cloud-vision-v1p4beta1/.yardopts create mode 100644 owl-bot-staging/google-cloud-vision-v1p4beta1/AUTHENTICATION.md create mode 100644 owl-bot-staging/google-cloud-vision-v1p4beta1/CHANGELOG.md create mode 100644 owl-bot-staging/google-cloud-vision-v1p4beta1/Gemfile create mode 100644 owl-bot-staging/google-cloud-vision-v1p4beta1/LICENSE.md create mode 100644 owl-bot-staging/google-cloud-vision-v1p4beta1/README.md create mode 100644 owl-bot-staging/google-cloud-vision-v1p4beta1/Rakefile create mode 100644 owl-bot-staging/google-cloud-vision-v1p4beta1/gapic_metadata.json create mode 100644 owl-bot-staging/google-cloud-vision-v1p4beta1/google-cloud-vision-v1p4beta1.gemspec create mode 100644 owl-bot-staging/google-cloud-vision-v1p4beta1/lib/google-cloud-vision-v1p4beta1.rb create mode 100644 owl-bot-staging/google-cloud-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1.rb create mode 100644 owl-bot-staging/google-cloud-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1/face_pb.rb create mode 100644 owl-bot-staging/google-cloud-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1/geometry_pb.rb create mode 100644 owl-bot-staging/google-cloud-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1/image_annotator.rb create mode 100644 owl-bot-staging/google-cloud-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1/image_annotator/client.rb create mode 100644 owl-bot-staging/google-cloud-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1/image_annotator/credentials.rb create mode 100644 owl-bot-staging/google-cloud-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1/image_annotator/operations.rb create mode 100644 owl-bot-staging/google-cloud-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1/image_annotator/paths.rb create mode 100644 owl-bot-staging/google-cloud-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1/image_annotator/rest.rb create mode 100644 owl-bot-staging/google-cloud-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1/image_annotator/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1/image_annotator/rest/operations.rb create mode 100644 owl-bot-staging/google-cloud-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1/image_annotator/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1/image_annotator_pb.rb create mode 100644 owl-bot-staging/google-cloud-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1/image_annotator_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1/product_search.rb create mode 100644 owl-bot-staging/google-cloud-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1/product_search/client.rb create mode 100644 owl-bot-staging/google-cloud-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1/product_search/credentials.rb create mode 100644 owl-bot-staging/google-cloud-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1/product_search/operations.rb create mode 100644 owl-bot-staging/google-cloud-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1/product_search/paths.rb create mode 100644 owl-bot-staging/google-cloud-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1/product_search/rest.rb create mode 100644 owl-bot-staging/google-cloud-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1/product_search/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1/product_search/rest/operations.rb create mode 100644 owl-bot-staging/google-cloud-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1/product_search/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1/product_search_pb.rb create mode 100644 owl-bot-staging/google-cloud-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1/product_search_service_pb.rb create mode 100644 owl-bot-staging/google-cloud-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1/product_search_service_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1/rest.rb create mode 100644 owl-bot-staging/google-cloud-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1/text_annotation_pb.rb create mode 100644 owl-bot-staging/google-cloud-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1/version.rb create mode 100644 owl-bot-staging/google-cloud-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1/web_detection_pb.rb create mode 100644 owl-bot-staging/google-cloud-vision-v1p4beta1/proto_docs/README.md create mode 100644 owl-bot-staging/google-cloud-vision-v1p4beta1/proto_docs/google/api/client.rb create mode 100644 owl-bot-staging/google-cloud-vision-v1p4beta1/proto_docs/google/api/field_behavior.rb create mode 100644 owl-bot-staging/google-cloud-vision-v1p4beta1/proto_docs/google/api/launch_stage.rb create mode 100644 owl-bot-staging/google-cloud-vision-v1p4beta1/proto_docs/google/api/resource.rb create mode 100644 owl-bot-staging/google-cloud-vision-v1p4beta1/proto_docs/google/cloud/vision/v1p4beta1/face.rb create mode 100644 owl-bot-staging/google-cloud-vision-v1p4beta1/proto_docs/google/cloud/vision/v1p4beta1/geometry.rb create mode 100644 owl-bot-staging/google-cloud-vision-v1p4beta1/proto_docs/google/cloud/vision/v1p4beta1/image_annotator.rb create mode 100644 owl-bot-staging/google-cloud-vision-v1p4beta1/proto_docs/google/cloud/vision/v1p4beta1/product_search.rb create mode 100644 owl-bot-staging/google-cloud-vision-v1p4beta1/proto_docs/google/cloud/vision/v1p4beta1/product_search_service.rb create mode 100644 owl-bot-staging/google-cloud-vision-v1p4beta1/proto_docs/google/cloud/vision/v1p4beta1/text_annotation.rb create mode 100644 owl-bot-staging/google-cloud-vision-v1p4beta1/proto_docs/google/cloud/vision/v1p4beta1/web_detection.rb create mode 100644 owl-bot-staging/google-cloud-vision-v1p4beta1/proto_docs/google/longrunning/operations.rb create mode 100644 owl-bot-staging/google-cloud-vision-v1p4beta1/proto_docs/google/protobuf/any.rb create mode 100644 owl-bot-staging/google-cloud-vision-v1p4beta1/proto_docs/google/protobuf/duration.rb create mode 100644 owl-bot-staging/google-cloud-vision-v1p4beta1/proto_docs/google/protobuf/empty.rb create mode 100644 owl-bot-staging/google-cloud-vision-v1p4beta1/proto_docs/google/protobuf/field_mask.rb create mode 100644 owl-bot-staging/google-cloud-vision-v1p4beta1/proto_docs/google/protobuf/timestamp.rb create mode 100644 owl-bot-staging/google-cloud-vision-v1p4beta1/proto_docs/google/protobuf/wrappers.rb create mode 100644 owl-bot-staging/google-cloud-vision-v1p4beta1/proto_docs/google/rpc/status.rb create mode 100644 owl-bot-staging/google-cloud-vision-v1p4beta1/proto_docs/google/type/color.rb create mode 100644 owl-bot-staging/google-cloud-vision-v1p4beta1/proto_docs/google/type/latlng.rb create mode 100644 owl-bot-staging/google-cloud-vision-v1p4beta1/snippets/Gemfile create mode 100644 owl-bot-staging/google-cloud-vision-v1p4beta1/snippets/image_annotator/async_batch_annotate_files.rb create mode 100644 owl-bot-staging/google-cloud-vision-v1p4beta1/snippets/image_annotator/async_batch_annotate_images.rb create mode 100644 owl-bot-staging/google-cloud-vision-v1p4beta1/snippets/image_annotator/batch_annotate_files.rb create mode 100644 owl-bot-staging/google-cloud-vision-v1p4beta1/snippets/image_annotator/batch_annotate_images.rb create mode 100644 owl-bot-staging/google-cloud-vision-v1p4beta1/snippets/product_search/add_product_to_product_set.rb create mode 100644 owl-bot-staging/google-cloud-vision-v1p4beta1/snippets/product_search/create_product.rb create mode 100644 owl-bot-staging/google-cloud-vision-v1p4beta1/snippets/product_search/create_product_set.rb create mode 100644 owl-bot-staging/google-cloud-vision-v1p4beta1/snippets/product_search/create_reference_image.rb create mode 100644 owl-bot-staging/google-cloud-vision-v1p4beta1/snippets/product_search/delete_product.rb create mode 100644 owl-bot-staging/google-cloud-vision-v1p4beta1/snippets/product_search/delete_product_set.rb create mode 100644 owl-bot-staging/google-cloud-vision-v1p4beta1/snippets/product_search/delete_reference_image.rb create mode 100644 owl-bot-staging/google-cloud-vision-v1p4beta1/snippets/product_search/get_product.rb create mode 100644 owl-bot-staging/google-cloud-vision-v1p4beta1/snippets/product_search/get_product_set.rb create mode 100644 owl-bot-staging/google-cloud-vision-v1p4beta1/snippets/product_search/get_reference_image.rb create mode 100644 owl-bot-staging/google-cloud-vision-v1p4beta1/snippets/product_search/import_product_sets.rb create mode 100644 owl-bot-staging/google-cloud-vision-v1p4beta1/snippets/product_search/list_product_sets.rb create mode 100644 owl-bot-staging/google-cloud-vision-v1p4beta1/snippets/product_search/list_products.rb create mode 100644 owl-bot-staging/google-cloud-vision-v1p4beta1/snippets/product_search/list_products_in_product_set.rb create mode 100644 owl-bot-staging/google-cloud-vision-v1p4beta1/snippets/product_search/list_reference_images.rb create mode 100644 owl-bot-staging/google-cloud-vision-v1p4beta1/snippets/product_search/purge_products.rb create mode 100644 owl-bot-staging/google-cloud-vision-v1p4beta1/snippets/product_search/remove_product_from_product_set.rb create mode 100644 owl-bot-staging/google-cloud-vision-v1p4beta1/snippets/product_search/update_product.rb create mode 100644 owl-bot-staging/google-cloud-vision-v1p4beta1/snippets/product_search/update_product_set.rb create mode 100644 owl-bot-staging/google-cloud-vision-v1p4beta1/snippets/snippet_metadata_google.cloud.vision.v1p4beta1.json create mode 100644 owl-bot-staging/google-cloud-vision-v1p4beta1/test/google/cloud/vision/v1p4beta1/image_annotator_operations_test.rb create mode 100644 owl-bot-staging/google-cloud-vision-v1p4beta1/test/google/cloud/vision/v1p4beta1/image_annotator_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-vision-v1p4beta1/test/google/cloud/vision/v1p4beta1/image_annotator_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-vision-v1p4beta1/test/google/cloud/vision/v1p4beta1/image_annotator_test.rb create mode 100644 owl-bot-staging/google-cloud-vision-v1p4beta1/test/google/cloud/vision/v1p4beta1/product_search_operations_test.rb create mode 100644 owl-bot-staging/google-cloud-vision-v1p4beta1/test/google/cloud/vision/v1p4beta1/product_search_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-vision-v1p4beta1/test/google/cloud/vision/v1p4beta1/product_search_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-vision-v1p4beta1/test/google/cloud/vision/v1p4beta1/product_search_test.rb create mode 100644 owl-bot-staging/google-cloud-vision-v1p4beta1/test/helper.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/.gitignore create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/.repo-metadata.json create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/.rubocop.yml create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/.toys.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/.yardopts create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/AUTHENTICATION.md create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/CHANGELOG.md create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/Gemfile create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/LICENSE.md create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/README.md create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/Rakefile create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/gapic_metadata.json create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/google-cloud-vision_ai-v1.gemspec create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/lib/google-cloud-vision_ai-v1.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/app_platform.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/app_platform/client.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/app_platform/credentials.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/app_platform/operations.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/app_platform/paths.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/app_platform/rest.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/app_platform/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/app_platform/rest/operations.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/app_platform/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/bindings_override.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/health_check_service.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/health_check_service/client.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/health_check_service/credentials.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/health_check_service/paths.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/health_check_service/rest.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/health_check_service/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/health_check_service/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/live_video_analytics.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/live_video_analytics/client.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/live_video_analytics/credentials.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/live_video_analytics/operations.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/live_video_analytics/paths.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/live_video_analytics/rest.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/live_video_analytics/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/live_video_analytics/rest/operations.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/live_video_analytics/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/rest.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/streaming_service.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/streaming_service/client.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/streaming_service/credentials.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/streaming_service/paths.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/streaming_service/rest.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/streaming_service/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/streaming_service/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/streams_service.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/streams_service/client.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/streams_service/credentials.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/streams_service/operations.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/streams_service/paths.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/streams_service/rest.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/streams_service/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/streams_service/rest/operations.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/streams_service/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/version.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/warehouse.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/warehouse/client.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/warehouse/credentials.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/warehouse/operations.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/warehouse/paths.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/warehouse/rest.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/warehouse/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/warehouse/rest/operations.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/warehouse/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/visionai/v1/annotations_pb.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/visionai/v1/common_pb.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/visionai/v1/health_service_pb.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/visionai/v1/health_service_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/visionai/v1/lva_pb.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/visionai/v1/lva_resources_pb.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/visionai/v1/lva_service_pb.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/visionai/v1/lva_service_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/visionai/v1/platform_pb.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/visionai/v1/platform_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/visionai/v1/streaming_resources_pb.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/visionai/v1/streaming_service_pb.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/visionai/v1/streaming_service_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/visionai/v1/streams_resources_pb.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/visionai/v1/streams_service_pb.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/visionai/v1/streams_service_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/visionai/v1/warehouse_pb.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/visionai/v1/warehouse_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/proto_docs/README.md create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/proto_docs/google/api/client.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/proto_docs/google/api/field_behavior.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/proto_docs/google/api/launch_stage.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/proto_docs/google/api/resource.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/proto_docs/google/cloud/visionai/v1/annotations.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/proto_docs/google/cloud/visionai/v1/common.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/proto_docs/google/cloud/visionai/v1/health_service.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/proto_docs/google/cloud/visionai/v1/lva.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/proto_docs/google/cloud/visionai/v1/lva_resources.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/proto_docs/google/cloud/visionai/v1/lva_service.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/proto_docs/google/cloud/visionai/v1/platform.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/proto_docs/google/cloud/visionai/v1/streaming_resources.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/proto_docs/google/cloud/visionai/v1/streaming_service.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/proto_docs/google/cloud/visionai/v1/streams_resources.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/proto_docs/google/cloud/visionai/v1/streams_service.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/proto_docs/google/cloud/visionai/v1/warehouse.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/proto_docs/google/longrunning/operations.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/proto_docs/google/protobuf/any.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/proto_docs/google/protobuf/duration.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/proto_docs/google/protobuf/empty.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/proto_docs/google/protobuf/field_mask.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/proto_docs/google/protobuf/struct.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/proto_docs/google/protobuf/timestamp.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/proto_docs/google/rpc/status.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/proto_docs/google/type/datetime.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/proto_docs/google/type/expr.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/Gemfile create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/app_platform/add_application_stream_input.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/app_platform/create_application.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/app_platform/create_application_instances.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/app_platform/create_draft.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/app_platform/create_processor.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/app_platform/delete_application.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/app_platform/delete_application_instances.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/app_platform/delete_draft.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/app_platform/delete_processor.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/app_platform/deploy_application.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/app_platform/get_application.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/app_platform/get_draft.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/app_platform/get_instance.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/app_platform/get_processor.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/app_platform/list_applications.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/app_platform/list_drafts.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/app_platform/list_instances.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/app_platform/list_prebuilt_processors.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/app_platform/list_processors.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/app_platform/remove_application_stream_input.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/app_platform/undeploy_application.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/app_platform/update_application.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/app_platform/update_application_instances.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/app_platform/update_application_stream_input.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/app_platform/update_draft.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/app_platform/update_processor.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/health_check_service/health_check.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/live_video_analytics/batch_run_process.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/live_video_analytics/create_analysis.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/live_video_analytics/create_operator.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/live_video_analytics/create_process.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/live_video_analytics/delete_analysis.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/live_video_analytics/delete_operator.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/live_video_analytics/delete_process.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/live_video_analytics/get_analysis.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/live_video_analytics/get_operator.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/live_video_analytics/get_process.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/live_video_analytics/list_analyses.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/live_video_analytics/list_operators.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/live_video_analytics/list_processes.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/live_video_analytics/list_public_operators.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/live_video_analytics/resolve_operator_info.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/live_video_analytics/update_analysis.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/live_video_analytics/update_operator.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/live_video_analytics/update_process.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/snippet_metadata_google.cloud.visionai.v1.json create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/streaming_service/acquire_lease.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/streaming_service/receive_events.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/streaming_service/receive_packets.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/streaming_service/release_lease.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/streaming_service/renew_lease.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/streaming_service/send_packets.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/streams_service/create_cluster.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/streams_service/create_event.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/streams_service/create_series.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/streams_service/create_stream.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/streams_service/delete_cluster.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/streams_service/delete_event.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/streams_service/delete_series.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/streams_service/delete_stream.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/streams_service/generate_stream_hls_token.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/streams_service/get_cluster.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/streams_service/get_event.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/streams_service/get_series.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/streams_service/get_stream.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/streams_service/get_stream_thumbnail.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/streams_service/list_clusters.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/streams_service/list_events.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/streams_service/list_series.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/streams_service/list_streams.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/streams_service/materialize_channel.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/streams_service/update_cluster.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/streams_service/update_event.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/streams_service/update_series.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/streams_service/update_stream.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/add_collection_item.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/analyze_asset.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/analyze_corpus.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/clip_asset.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/create_annotation.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/create_asset.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/create_collection.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/create_corpus.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/create_data_schema.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/create_index.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/create_index_endpoint.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/create_search_config.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/create_search_hypernym.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/delete_annotation.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/delete_asset.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/delete_collection.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/delete_corpus.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/delete_data_schema.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/delete_index.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/delete_index_endpoint.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/delete_search_config.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/delete_search_hypernym.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/deploy_index.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/generate_hls_uri.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/generate_retrieval_url.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/get_annotation.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/get_asset.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/get_collection.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/get_corpus.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/get_data_schema.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/get_index.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/get_index_endpoint.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/get_search_config.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/get_search_hypernym.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/import_assets.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/index_asset.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/ingest_asset.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/list_annotations.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/list_assets.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/list_collections.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/list_corpora.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/list_data_schemas.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/list_index_endpoints.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/list_indexes.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/list_search_configs.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/list_search_hypernyms.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/remove_collection_item.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/remove_index_asset.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/search_assets.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/search_index_endpoint.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/undeploy_index.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/update_annotation.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/update_asset.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/update_collection.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/update_corpus.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/update_data_schema.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/update_index.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/update_index_endpoint.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/update_search_config.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/update_search_hypernym.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/upload_asset.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/view_collection_items.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/view_indexed_assets.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/test/google/cloud/vision_ai/v1/app_platform_operations_test.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/test/google/cloud/vision_ai/v1/app_platform_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/test/google/cloud/vision_ai/v1/app_platform_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/test/google/cloud/vision_ai/v1/app_platform_test.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/test/google/cloud/vision_ai/v1/health_check_service_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/test/google/cloud/vision_ai/v1/health_check_service_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/test/google/cloud/vision_ai/v1/health_check_service_test.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/test/google/cloud/vision_ai/v1/live_video_analytics_operations_test.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/test/google/cloud/vision_ai/v1/live_video_analytics_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/test/google/cloud/vision_ai/v1/live_video_analytics_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/test/google/cloud/vision_ai/v1/live_video_analytics_test.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/test/google/cloud/vision_ai/v1/streaming_service_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/test/google/cloud/vision_ai/v1/streaming_service_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/test/google/cloud/vision_ai/v1/streaming_service_test.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/test/google/cloud/vision_ai/v1/streams_service_operations_test.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/test/google/cloud/vision_ai/v1/streams_service_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/test/google/cloud/vision_ai/v1/streams_service_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/test/google/cloud/vision_ai/v1/streams_service_test.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/test/google/cloud/vision_ai/v1/warehouse_operations_test.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/test/google/cloud/vision_ai/v1/warehouse_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/test/google/cloud/vision_ai/v1/warehouse_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/test/google/cloud/vision_ai/v1/warehouse_test.rb create mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/test/helper.rb create mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/.gitignore create mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/.repo-metadata.json create mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/.rubocop.yml create mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/.toys.rb create mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/.yardopts create mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/AUTHENTICATION.md create mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/CHANGELOG.md create mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/Gemfile create mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/LICENSE.md create mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/README.md create mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/Rakefile create mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/gapic_metadata.json create mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/google-cloud-vm_migration-v1.gemspec create mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/lib/google-cloud-vm_migration-v1.rb create mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/lib/google/cloud/vm_migration/v1.rb create mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/lib/google/cloud/vm_migration/v1/bindings_override.rb create mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/lib/google/cloud/vm_migration/v1/rest.rb create mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/lib/google/cloud/vm_migration/v1/version.rb create mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/lib/google/cloud/vm_migration/v1/vm_migration.rb create mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/lib/google/cloud/vm_migration/v1/vm_migration/client.rb create mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/lib/google/cloud/vm_migration/v1/vm_migration/credentials.rb create mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/lib/google/cloud/vm_migration/v1/vm_migration/operations.rb create mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/lib/google/cloud/vm_migration/v1/vm_migration/paths.rb create mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/lib/google/cloud/vm_migration/v1/vm_migration/rest.rb create mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/lib/google/cloud/vm_migration/v1/vm_migration/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/lib/google/cloud/vm_migration/v1/vm_migration/rest/operations.rb create mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/lib/google/cloud/vm_migration/v1/vm_migration/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/lib/google/cloud/vmmigration/v1/vmmigration_pb.rb create mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/lib/google/cloud/vmmigration/v1/vmmigration_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/lib/google/iam/v1.rb create mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/lib/google/iam/v1/bindings_override.rb create mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/lib/google/iam/v1/iam_policy.rb create mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/lib/google/iam/v1/iam_policy/client.rb create mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/lib/google/iam/v1/iam_policy/credentials.rb create mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/lib/google/iam/v1/iam_policy/rest.rb create mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/lib/google/iam/v1/iam_policy/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/lib/google/iam/v1/iam_policy/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/lib/google/iam/v1/rest.rb create mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/proto_docs/README.md create mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/proto_docs/google/api/client.rb create mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/proto_docs/google/api/field_behavior.rb create mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/proto_docs/google/api/field_info.rb create mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/proto_docs/google/api/launch_stage.rb create mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/proto_docs/google/api/resource.rb create mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/proto_docs/google/cloud/vmmigration/v1/vmmigration.rb create mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/proto_docs/google/iam/v1/iam_policy.rb create mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/proto_docs/google/iam/v1/options.rb create mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/proto_docs/google/iam/v1/policy.rb create mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/proto_docs/google/longrunning/operations.rb create mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/proto_docs/google/protobuf/any.rb create mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/proto_docs/google/protobuf/duration.rb create mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/proto_docs/google/protobuf/empty.rb create mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/proto_docs/google/protobuf/field_mask.rb create mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/proto_docs/google/protobuf/timestamp.rb create mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/proto_docs/google/rpc/error_details.rb create mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/proto_docs/google/rpc/status.rb create mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/proto_docs/google/type/expr.rb create mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/snippets/Gemfile create mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/snippets/iam_policy/get_iam_policy.rb create mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/snippets/iam_policy/set_iam_policy.rb create mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/snippets/iam_policy/test_iam_permissions.rb create mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/snippets/snippet_metadata_google.cloud.vmmigration.v1.json create mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/snippets/snippet_metadata_google.iam.v1.json create mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/add_group_migration.rb create mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/cancel_clone_job.rb create mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/cancel_cutover_job.rb create mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/cancel_disk_migration_job.rb create mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/cancel_image_import_job.rb create mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/create_clone_job.rb create mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/create_cutover_job.rb create mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/create_datacenter_connector.rb create mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/create_disk_migration_job.rb create mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/create_group.rb create mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/create_image_import.rb create mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/create_migrating_vm.rb create mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/create_source.rb create mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/create_target_project.rb create mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/create_utilization_report.rb create mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/delete_datacenter_connector.rb create mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/delete_disk_migration_job.rb create mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/delete_group.rb create mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/delete_image_import.rb create mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/delete_migrating_vm.rb create mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/delete_source.rb create mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/delete_target_project.rb create mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/delete_utilization_report.rb create mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/extend_migration.rb create mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/fetch_inventory.rb create mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/fetch_storage_inventory.rb create mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/finalize_migration.rb create mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/get_clone_job.rb create mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/get_cutover_job.rb create mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/get_datacenter_connector.rb create mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/get_disk_migration_job.rb create mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/get_group.rb create mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/get_image_import.rb create mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/get_image_import_job.rb create mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/get_migrating_vm.rb create mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/get_replication_cycle.rb create mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/get_source.rb create mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/get_target_project.rb create mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/get_utilization_report.rb create mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/list_clone_jobs.rb create mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/list_cutover_jobs.rb create mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/list_datacenter_connectors.rb create mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/list_disk_migration_jobs.rb create mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/list_groups.rb create mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/list_image_import_jobs.rb create mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/list_image_imports.rb create mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/list_migrating_vms.rb create mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/list_replication_cycles.rb create mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/list_sources.rb create mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/list_target_projects.rb create mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/list_utilization_reports.rb create mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/pause_migration.rb create mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/remove_group_migration.rb create mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/resume_migration.rb create mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/run_disk_migration_job.rb create mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/start_migration.rb create mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/update_disk_migration_job.rb create mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/update_group.rb create mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/update_migrating_vm.rb create mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/update_source.rb create mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/update_target_project.rb create mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/upgrade_appliance.rb create mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/test/google/cloud/vm_migration/v1/vm_migration_operations_test.rb create mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/test/google/cloud/vm_migration/v1/vm_migration_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/test/google/cloud/vm_migration/v1/vm_migration_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/test/google/cloud/vm_migration/v1/vm_migration_test.rb create mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/test/google/iam/v1/iam_policy_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/test/google/iam/v1/iam_policy_test.rb create mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/test/helper.rb create mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/.gitignore create mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/.repo-metadata.json create mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/.rubocop.yml create mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/.toys.rb create mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/.yardopts create mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/AUTHENTICATION.md create mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/CHANGELOG.md create mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/Gemfile create mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/LICENSE.md create mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/README.md create mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/Rakefile create mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/gapic_metadata.json create mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/google-cloud-vmware_engine-v1.gemspec create mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/lib/google-cloud-vmware_engine-v1.rb create mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/lib/google/cloud/vmware_engine/v1.rb create mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/lib/google/cloud/vmware_engine/v1/bindings_override.rb create mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/lib/google/cloud/vmware_engine/v1/rest.rb create mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/lib/google/cloud/vmware_engine/v1/version.rb create mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/lib/google/cloud/vmware_engine/v1/vmware_engine.rb create mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/lib/google/cloud/vmware_engine/v1/vmware_engine/client.rb create mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/lib/google/cloud/vmware_engine/v1/vmware_engine/credentials.rb create mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/lib/google/cloud/vmware_engine/v1/vmware_engine/operations.rb create mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/lib/google/cloud/vmware_engine/v1/vmware_engine/paths.rb create mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/lib/google/cloud/vmware_engine/v1/vmware_engine/rest.rb create mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/lib/google/cloud/vmware_engine/v1/vmware_engine/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/lib/google/cloud/vmware_engine/v1/vmware_engine/rest/operations.rb create mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/lib/google/cloud/vmware_engine/v1/vmware_engine/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/lib/google/cloud/vmwareengine/v1/vmwareengine_pb.rb create mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/lib/google/cloud/vmwareengine/v1/vmwareengine_resources_pb.rb create mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/lib/google/cloud/vmwareengine/v1/vmwareengine_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/proto_docs/README.md create mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/proto_docs/google/api/client.rb create mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/proto_docs/google/api/field_behavior.rb create mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/proto_docs/google/api/field_info.rb create mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/proto_docs/google/api/launch_stage.rb create mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/proto_docs/google/api/resource.rb create mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/proto_docs/google/cloud/vmwareengine/v1/vmwareengine.rb create mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/proto_docs/google/cloud/vmwareengine/v1/vmwareengine_resources.rb create mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/proto_docs/google/longrunning/operations.rb create mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/proto_docs/google/protobuf/any.rb create mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/proto_docs/google/protobuf/duration.rb create mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/proto_docs/google/protobuf/empty.rb create mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/proto_docs/google/protobuf/field_mask.rb create mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/proto_docs/google/protobuf/timestamp.rb create mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/proto_docs/google/rpc/status.rb create mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/proto_docs/google/type/expr.rb create mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/snippets/Gemfile create mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/snippets/snippet_metadata_google.cloud.vmwareengine.v1.json create mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/create_cluster.rb create mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/create_external_access_rule.rb create mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/create_external_address.rb create mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/create_hcx_activation_key.rb create mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/create_logging_server.rb create mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/create_management_dns_zone_binding.rb create mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/create_network_peering.rb create mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/create_network_policy.rb create mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/create_private_cloud.rb create mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/create_private_connection.rb create mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/create_vmware_engine_network.rb create mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/delete_cluster.rb create mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/delete_external_access_rule.rb create mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/delete_external_address.rb create mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/delete_logging_server.rb create mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/delete_management_dns_zone_binding.rb create mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/delete_network_peering.rb create mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/delete_network_policy.rb create mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/delete_private_cloud.rb create mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/delete_private_connection.rb create mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/delete_vmware_engine_network.rb create mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/fetch_network_policy_external_addresses.rb create mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/get_cluster.rb create mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/get_dns_bind_permission.rb create mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/get_dns_forwarding.rb create mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/get_external_access_rule.rb create mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/get_external_address.rb create mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/get_hcx_activation_key.rb create mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/get_logging_server.rb create mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/get_management_dns_zone_binding.rb create mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/get_network_peering.rb create mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/get_network_policy.rb create mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/get_node.rb create mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/get_node_type.rb create mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/get_private_cloud.rb create mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/get_private_connection.rb create mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/get_subnet.rb create mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/get_vmware_engine_network.rb create mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/grant_dns_bind_permission.rb create mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/list_clusters.rb create mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/list_external_access_rules.rb create mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/list_external_addresses.rb create mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/list_hcx_activation_keys.rb create mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/list_logging_servers.rb create mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/list_management_dns_zone_bindings.rb create mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/list_network_peerings.rb create mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/list_network_policies.rb create mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/list_node_types.rb create mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/list_nodes.rb create mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/list_peering_routes.rb create mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/list_private_clouds.rb create mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/list_private_connection_peering_routes.rb create mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/list_private_connections.rb create mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/list_subnets.rb create mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/list_vmware_engine_networks.rb create mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/repair_management_dns_zone_binding.rb create mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/reset_nsx_credentials.rb create mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/reset_vcenter_credentials.rb create mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/revoke_dns_bind_permission.rb create mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/show_nsx_credentials.rb create mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/show_vcenter_credentials.rb create mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/undelete_private_cloud.rb create mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/update_cluster.rb create mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/update_dns_forwarding.rb create mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/update_external_access_rule.rb create mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/update_external_address.rb create mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/update_logging_server.rb create mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/update_management_dns_zone_binding.rb create mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/update_network_peering.rb create mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/update_network_policy.rb create mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/update_private_cloud.rb create mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/update_private_connection.rb create mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/update_subnet.rb create mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/update_vmware_engine_network.rb create mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/test/google/cloud/vmware_engine/v1/vmware_engine_operations_test.rb create mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/test/google/cloud/vmware_engine/v1/vmware_engine_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/test/google/cloud/vmware_engine/v1/vmware_engine_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/test/google/cloud/vmware_engine/v1/vmware_engine_test.rb create mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/test/helper.rb create mode 100644 owl-bot-staging/google-cloud-vpc_access-v1/.gitignore create mode 100644 owl-bot-staging/google-cloud-vpc_access-v1/.repo-metadata.json create mode 100644 owl-bot-staging/google-cloud-vpc_access-v1/.rubocop.yml create mode 100644 owl-bot-staging/google-cloud-vpc_access-v1/.toys.rb create mode 100644 owl-bot-staging/google-cloud-vpc_access-v1/.yardopts create mode 100644 owl-bot-staging/google-cloud-vpc_access-v1/AUTHENTICATION.md create mode 100644 owl-bot-staging/google-cloud-vpc_access-v1/CHANGELOG.md create mode 100644 owl-bot-staging/google-cloud-vpc_access-v1/Gemfile create mode 100644 owl-bot-staging/google-cloud-vpc_access-v1/LICENSE.md create mode 100644 owl-bot-staging/google-cloud-vpc_access-v1/README.md create mode 100644 owl-bot-staging/google-cloud-vpc_access-v1/Rakefile create mode 100644 owl-bot-staging/google-cloud-vpc_access-v1/gapic_metadata.json create mode 100644 owl-bot-staging/google-cloud-vpc_access-v1/google-cloud-vpc_access-v1.gemspec create mode 100644 owl-bot-staging/google-cloud-vpc_access-v1/lib/google-cloud-vpc_access-v1.rb create mode 100644 owl-bot-staging/google-cloud-vpc_access-v1/lib/google/cloud/vpc_access/v1.rb create mode 100644 owl-bot-staging/google-cloud-vpc_access-v1/lib/google/cloud/vpc_access/v1/bindings_override.rb create mode 100644 owl-bot-staging/google-cloud-vpc_access-v1/lib/google/cloud/vpc_access/v1/rest.rb create mode 100644 owl-bot-staging/google-cloud-vpc_access-v1/lib/google/cloud/vpc_access/v1/version.rb create mode 100644 owl-bot-staging/google-cloud-vpc_access-v1/lib/google/cloud/vpc_access/v1/vpc_access_service.rb create mode 100644 owl-bot-staging/google-cloud-vpc_access-v1/lib/google/cloud/vpc_access/v1/vpc_access_service/client.rb create mode 100644 owl-bot-staging/google-cloud-vpc_access-v1/lib/google/cloud/vpc_access/v1/vpc_access_service/credentials.rb create mode 100644 owl-bot-staging/google-cloud-vpc_access-v1/lib/google/cloud/vpc_access/v1/vpc_access_service/operations.rb create mode 100644 owl-bot-staging/google-cloud-vpc_access-v1/lib/google/cloud/vpc_access/v1/vpc_access_service/paths.rb create mode 100644 owl-bot-staging/google-cloud-vpc_access-v1/lib/google/cloud/vpc_access/v1/vpc_access_service/rest.rb create mode 100644 owl-bot-staging/google-cloud-vpc_access-v1/lib/google/cloud/vpc_access/v1/vpc_access_service/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-vpc_access-v1/lib/google/cloud/vpc_access/v1/vpc_access_service/rest/operations.rb create mode 100644 owl-bot-staging/google-cloud-vpc_access-v1/lib/google/cloud/vpc_access/v1/vpc_access_service/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-vpc_access-v1/lib/google/cloud/vpcaccess/v1/vpc_access_pb.rb create mode 100644 owl-bot-staging/google-cloud-vpc_access-v1/lib/google/cloud/vpcaccess/v1/vpc_access_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-vpc_access-v1/proto_docs/README.md create mode 100644 owl-bot-staging/google-cloud-vpc_access-v1/proto_docs/google/api/client.rb create mode 100644 owl-bot-staging/google-cloud-vpc_access-v1/proto_docs/google/api/field_behavior.rb create mode 100644 owl-bot-staging/google-cloud-vpc_access-v1/proto_docs/google/api/launch_stage.rb create mode 100644 owl-bot-staging/google-cloud-vpc_access-v1/proto_docs/google/api/resource.rb create mode 100644 owl-bot-staging/google-cloud-vpc_access-v1/proto_docs/google/cloud/vpcaccess/v1/vpc_access.rb create mode 100644 owl-bot-staging/google-cloud-vpc_access-v1/proto_docs/google/longrunning/operations.rb create mode 100644 owl-bot-staging/google-cloud-vpc_access-v1/proto_docs/google/protobuf/any.rb create mode 100644 owl-bot-staging/google-cloud-vpc_access-v1/proto_docs/google/protobuf/duration.rb create mode 100644 owl-bot-staging/google-cloud-vpc_access-v1/proto_docs/google/protobuf/empty.rb create mode 100644 owl-bot-staging/google-cloud-vpc_access-v1/proto_docs/google/protobuf/timestamp.rb create mode 100644 owl-bot-staging/google-cloud-vpc_access-v1/proto_docs/google/rpc/status.rb create mode 100644 owl-bot-staging/google-cloud-vpc_access-v1/snippets/Gemfile create mode 100644 owl-bot-staging/google-cloud-vpc_access-v1/snippets/snippet_metadata_google.cloud.vpcaccess.v1.json create mode 100644 owl-bot-staging/google-cloud-vpc_access-v1/snippets/vpc_access_service/create_connector.rb create mode 100644 owl-bot-staging/google-cloud-vpc_access-v1/snippets/vpc_access_service/delete_connector.rb create mode 100644 owl-bot-staging/google-cloud-vpc_access-v1/snippets/vpc_access_service/get_connector.rb create mode 100644 owl-bot-staging/google-cloud-vpc_access-v1/snippets/vpc_access_service/list_connectors.rb create mode 100644 owl-bot-staging/google-cloud-vpc_access-v1/test/google/cloud/vpc_access/v1/vpc_access_service_operations_test.rb create mode 100644 owl-bot-staging/google-cloud-vpc_access-v1/test/google/cloud/vpc_access/v1/vpc_access_service_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-vpc_access-v1/test/google/cloud/vpc_access/v1/vpc_access_service_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-vpc_access-v1/test/google/cloud/vpc_access/v1/vpc_access_service_test.rb create mode 100644 owl-bot-staging/google-cloud-vpc_access-v1/test/helper.rb create mode 100644 owl-bot-staging/google-cloud-web_risk-v1/.gitignore create mode 100644 owl-bot-staging/google-cloud-web_risk-v1/.repo-metadata.json create mode 100644 owl-bot-staging/google-cloud-web_risk-v1/.rubocop.yml create mode 100644 owl-bot-staging/google-cloud-web_risk-v1/.toys.rb create mode 100644 owl-bot-staging/google-cloud-web_risk-v1/.yardopts create mode 100644 owl-bot-staging/google-cloud-web_risk-v1/AUTHENTICATION.md create mode 100644 owl-bot-staging/google-cloud-web_risk-v1/CHANGELOG.md create mode 100644 owl-bot-staging/google-cloud-web_risk-v1/Gemfile create mode 100644 owl-bot-staging/google-cloud-web_risk-v1/LICENSE.md create mode 100644 owl-bot-staging/google-cloud-web_risk-v1/README.md create mode 100644 owl-bot-staging/google-cloud-web_risk-v1/Rakefile create mode 100644 owl-bot-staging/google-cloud-web_risk-v1/gapic_metadata.json create mode 100644 owl-bot-staging/google-cloud-web_risk-v1/google-cloud-web_risk-v1.gemspec create mode 100644 owl-bot-staging/google-cloud-web_risk-v1/lib/google-cloud-web_risk-v1.rb create mode 100644 owl-bot-staging/google-cloud-web_risk-v1/lib/google/cloud/web_risk/v1.rb create mode 100644 owl-bot-staging/google-cloud-web_risk-v1/lib/google/cloud/web_risk/v1/rest.rb create mode 100644 owl-bot-staging/google-cloud-web_risk-v1/lib/google/cloud/web_risk/v1/version.rb create mode 100644 owl-bot-staging/google-cloud-web_risk-v1/lib/google/cloud/web_risk/v1/web_risk_service.rb create mode 100644 owl-bot-staging/google-cloud-web_risk-v1/lib/google/cloud/web_risk/v1/web_risk_service/client.rb create mode 100644 owl-bot-staging/google-cloud-web_risk-v1/lib/google/cloud/web_risk/v1/web_risk_service/credentials.rb create mode 100644 owl-bot-staging/google-cloud-web_risk-v1/lib/google/cloud/web_risk/v1/web_risk_service/operations.rb create mode 100644 owl-bot-staging/google-cloud-web_risk-v1/lib/google/cloud/web_risk/v1/web_risk_service/paths.rb create mode 100644 owl-bot-staging/google-cloud-web_risk-v1/lib/google/cloud/web_risk/v1/web_risk_service/rest.rb create mode 100644 owl-bot-staging/google-cloud-web_risk-v1/lib/google/cloud/web_risk/v1/web_risk_service/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-web_risk-v1/lib/google/cloud/web_risk/v1/web_risk_service/rest/operations.rb create mode 100644 owl-bot-staging/google-cloud-web_risk-v1/lib/google/cloud/web_risk/v1/web_risk_service/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-web_risk-v1/lib/google/cloud/webrisk/v1/webrisk_pb.rb create mode 100644 owl-bot-staging/google-cloud-web_risk-v1/lib/google/cloud/webrisk/v1/webrisk_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-web_risk-v1/proto_docs/README.md create mode 100644 owl-bot-staging/google-cloud-web_risk-v1/proto_docs/google/api/client.rb create mode 100644 owl-bot-staging/google-cloud-web_risk-v1/proto_docs/google/api/field_behavior.rb create mode 100644 owl-bot-staging/google-cloud-web_risk-v1/proto_docs/google/api/launch_stage.rb create mode 100644 owl-bot-staging/google-cloud-web_risk-v1/proto_docs/google/api/resource.rb create mode 100644 owl-bot-staging/google-cloud-web_risk-v1/proto_docs/google/cloud/webrisk/v1/webrisk.rb create mode 100644 owl-bot-staging/google-cloud-web_risk-v1/proto_docs/google/longrunning/operations.rb create mode 100644 owl-bot-staging/google-cloud-web_risk-v1/proto_docs/google/protobuf/any.rb create mode 100644 owl-bot-staging/google-cloud-web_risk-v1/proto_docs/google/protobuf/duration.rb create mode 100644 owl-bot-staging/google-cloud-web_risk-v1/proto_docs/google/protobuf/empty.rb create mode 100644 owl-bot-staging/google-cloud-web_risk-v1/proto_docs/google/protobuf/timestamp.rb create mode 100644 owl-bot-staging/google-cloud-web_risk-v1/proto_docs/google/rpc/status.rb create mode 100644 owl-bot-staging/google-cloud-web_risk-v1/snippets/Gemfile create mode 100644 owl-bot-staging/google-cloud-web_risk-v1/snippets/snippet_metadata_google.cloud.webrisk.v1.json create mode 100644 owl-bot-staging/google-cloud-web_risk-v1/snippets/web_risk_service/compute_threat_list_diff.rb create mode 100644 owl-bot-staging/google-cloud-web_risk-v1/snippets/web_risk_service/create_submission.rb create mode 100644 owl-bot-staging/google-cloud-web_risk-v1/snippets/web_risk_service/search_hashes.rb create mode 100644 owl-bot-staging/google-cloud-web_risk-v1/snippets/web_risk_service/search_uris.rb create mode 100644 owl-bot-staging/google-cloud-web_risk-v1/snippets/web_risk_service/submit_uri.rb create mode 100644 owl-bot-staging/google-cloud-web_risk-v1/test/google/cloud/web_risk/v1/web_risk_service_operations_test.rb create mode 100644 owl-bot-staging/google-cloud-web_risk-v1/test/google/cloud/web_risk/v1/web_risk_service_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-web_risk-v1/test/google/cloud/web_risk/v1/web_risk_service_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-web_risk-v1/test/google/cloud/web_risk/v1/web_risk_service_test.rb create mode 100644 owl-bot-staging/google-cloud-web_risk-v1/test/helper.rb create mode 100644 owl-bot-staging/google-cloud-web_risk-v1beta1/.gitignore create mode 100644 owl-bot-staging/google-cloud-web_risk-v1beta1/.repo-metadata.json create mode 100644 owl-bot-staging/google-cloud-web_risk-v1beta1/.rubocop.yml create mode 100644 owl-bot-staging/google-cloud-web_risk-v1beta1/.toys.rb create mode 100644 owl-bot-staging/google-cloud-web_risk-v1beta1/.yardopts create mode 100644 owl-bot-staging/google-cloud-web_risk-v1beta1/AUTHENTICATION.md create mode 100644 owl-bot-staging/google-cloud-web_risk-v1beta1/CHANGELOG.md create mode 100644 owl-bot-staging/google-cloud-web_risk-v1beta1/Gemfile create mode 100644 owl-bot-staging/google-cloud-web_risk-v1beta1/LICENSE.md create mode 100644 owl-bot-staging/google-cloud-web_risk-v1beta1/README.md create mode 100644 owl-bot-staging/google-cloud-web_risk-v1beta1/Rakefile create mode 100644 owl-bot-staging/google-cloud-web_risk-v1beta1/gapic_metadata.json create mode 100644 owl-bot-staging/google-cloud-web_risk-v1beta1/google-cloud-web_risk-v1beta1.gemspec create mode 100644 owl-bot-staging/google-cloud-web_risk-v1beta1/lib/google-cloud-web_risk-v1beta1.rb create mode 100644 owl-bot-staging/google-cloud-web_risk-v1beta1/lib/google/cloud/web_risk/v1beta1.rb create mode 100644 owl-bot-staging/google-cloud-web_risk-v1beta1/lib/google/cloud/web_risk/v1beta1/rest.rb create mode 100644 owl-bot-staging/google-cloud-web_risk-v1beta1/lib/google/cloud/web_risk/v1beta1/version.rb create mode 100644 owl-bot-staging/google-cloud-web_risk-v1beta1/lib/google/cloud/web_risk/v1beta1/web_risk_service.rb create mode 100644 owl-bot-staging/google-cloud-web_risk-v1beta1/lib/google/cloud/web_risk/v1beta1/web_risk_service/client.rb create mode 100644 owl-bot-staging/google-cloud-web_risk-v1beta1/lib/google/cloud/web_risk/v1beta1/web_risk_service/credentials.rb create mode 100644 owl-bot-staging/google-cloud-web_risk-v1beta1/lib/google/cloud/web_risk/v1beta1/web_risk_service/rest.rb create mode 100644 owl-bot-staging/google-cloud-web_risk-v1beta1/lib/google/cloud/web_risk/v1beta1/web_risk_service/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-web_risk-v1beta1/lib/google/cloud/web_risk/v1beta1/web_risk_service/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-web_risk-v1beta1/lib/google/cloud/webrisk/v1beta1/webrisk_pb.rb create mode 100644 owl-bot-staging/google-cloud-web_risk-v1beta1/lib/google/cloud/webrisk/v1beta1/webrisk_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-web_risk-v1beta1/proto_docs/README.md create mode 100644 owl-bot-staging/google-cloud-web_risk-v1beta1/proto_docs/google/api/client.rb create mode 100644 owl-bot-staging/google-cloud-web_risk-v1beta1/proto_docs/google/api/field_behavior.rb create mode 100644 owl-bot-staging/google-cloud-web_risk-v1beta1/proto_docs/google/api/launch_stage.rb create mode 100644 owl-bot-staging/google-cloud-web_risk-v1beta1/proto_docs/google/api/resource.rb create mode 100644 owl-bot-staging/google-cloud-web_risk-v1beta1/proto_docs/google/cloud/webrisk/v1beta1/webrisk.rb create mode 100644 owl-bot-staging/google-cloud-web_risk-v1beta1/proto_docs/google/protobuf/duration.rb create mode 100644 owl-bot-staging/google-cloud-web_risk-v1beta1/proto_docs/google/protobuf/timestamp.rb create mode 100644 owl-bot-staging/google-cloud-web_risk-v1beta1/snippets/Gemfile create mode 100644 owl-bot-staging/google-cloud-web_risk-v1beta1/snippets/snippet_metadata_google.cloud.webrisk.v1beta1.json create mode 100644 owl-bot-staging/google-cloud-web_risk-v1beta1/snippets/web_risk_service/compute_threat_list_diff.rb create mode 100644 owl-bot-staging/google-cloud-web_risk-v1beta1/snippets/web_risk_service/search_hashes.rb create mode 100644 owl-bot-staging/google-cloud-web_risk-v1beta1/snippets/web_risk_service/search_uris.rb create mode 100644 owl-bot-staging/google-cloud-web_risk-v1beta1/test/google/cloud/web_risk/v1beta1/web_risk_service_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-web_risk-v1beta1/test/google/cloud/web_risk/v1beta1/web_risk_service_test.rb create mode 100644 owl-bot-staging/google-cloud-web_risk-v1beta1/test/helper.rb create mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1/.gitignore create mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1/.repo-metadata.json create mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1/.rubocop.yml create mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1/.toys.rb create mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1/.yardopts create mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1/AUTHENTICATION.md create mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1/CHANGELOG.md create mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1/Gemfile create mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1/LICENSE.md create mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1/README.md create mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1/Rakefile create mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1/gapic_metadata.json create mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1/google-cloud-web_security_scanner-v1.gemspec create mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1/lib/google-cloud-web_security_scanner-v1.rb create mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1/lib/google/cloud/web_security_scanner/v1.rb create mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1/lib/google/cloud/web_security_scanner/v1/rest.rb create mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1/lib/google/cloud/web_security_scanner/v1/version.rb create mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1/lib/google/cloud/web_security_scanner/v1/web_security_scanner.rb create mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1/lib/google/cloud/web_security_scanner/v1/web_security_scanner/client.rb create mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1/lib/google/cloud/web_security_scanner/v1/web_security_scanner/credentials.rb create mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1/lib/google/cloud/web_security_scanner/v1/web_security_scanner/rest.rb create mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1/lib/google/cloud/web_security_scanner/v1/web_security_scanner/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1/lib/google/cloud/web_security_scanner/v1/web_security_scanner/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1/lib/google/cloud/websecurityscanner/v1/crawled_url_pb.rb create mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1/lib/google/cloud/websecurityscanner/v1/finding_addon_pb.rb create mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1/lib/google/cloud/websecurityscanner/v1/finding_pb.rb create mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1/lib/google/cloud/websecurityscanner/v1/finding_type_stats_pb.rb create mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1/lib/google/cloud/websecurityscanner/v1/scan_config_error_pb.rb create mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1/lib/google/cloud/websecurityscanner/v1/scan_config_pb.rb create mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1/lib/google/cloud/websecurityscanner/v1/scan_run_error_trace_pb.rb create mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1/lib/google/cloud/websecurityscanner/v1/scan_run_log_pb.rb create mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1/lib/google/cloud/websecurityscanner/v1/scan_run_pb.rb create mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1/lib/google/cloud/websecurityscanner/v1/scan_run_warning_trace_pb.rb create mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1/lib/google/cloud/websecurityscanner/v1/web_security_scanner_pb.rb create mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1/lib/google/cloud/websecurityscanner/v1/web_security_scanner_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1/proto_docs/README.md create mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1/proto_docs/google/api/client.rb create mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1/proto_docs/google/api/field_behavior.rb create mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1/proto_docs/google/api/launch_stage.rb create mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1/proto_docs/google/api/resource.rb create mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1/proto_docs/google/cloud/websecurityscanner/v1/crawled_url.rb create mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1/proto_docs/google/cloud/websecurityscanner/v1/finding.rb create mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1/proto_docs/google/cloud/websecurityscanner/v1/finding_addon.rb create mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1/proto_docs/google/cloud/websecurityscanner/v1/finding_type_stats.rb create mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1/proto_docs/google/cloud/websecurityscanner/v1/scan_config.rb create mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1/proto_docs/google/cloud/websecurityscanner/v1/scan_config_error.rb create mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1/proto_docs/google/cloud/websecurityscanner/v1/scan_run.rb create mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1/proto_docs/google/cloud/websecurityscanner/v1/scan_run_error_trace.rb create mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1/proto_docs/google/cloud/websecurityscanner/v1/scan_run_log.rb create mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1/proto_docs/google/cloud/websecurityscanner/v1/scan_run_warning_trace.rb create mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1/proto_docs/google/cloud/websecurityscanner/v1/web_security_scanner.rb create mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1/proto_docs/google/protobuf/duration.rb create mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1/proto_docs/google/protobuf/empty.rb create mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1/proto_docs/google/protobuf/field_mask.rb create mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1/proto_docs/google/protobuf/timestamp.rb create mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1/snippets/Gemfile create mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1/snippets/snippet_metadata_google.cloud.websecurityscanner.v1.json create mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1/snippets/web_security_scanner/create_scan_config.rb create mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1/snippets/web_security_scanner/delete_scan_config.rb create mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1/snippets/web_security_scanner/get_finding.rb create mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1/snippets/web_security_scanner/get_scan_config.rb create mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1/snippets/web_security_scanner/get_scan_run.rb create mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1/snippets/web_security_scanner/list_crawled_urls.rb create mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1/snippets/web_security_scanner/list_finding_type_stats.rb create mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1/snippets/web_security_scanner/list_findings.rb create mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1/snippets/web_security_scanner/list_scan_configs.rb create mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1/snippets/web_security_scanner/list_scan_runs.rb create mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1/snippets/web_security_scanner/start_scan_run.rb create mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1/snippets/web_security_scanner/stop_scan_run.rb create mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1/snippets/web_security_scanner/update_scan_config.rb create mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1/test/google/cloud/web_security_scanner/v1/web_security_scanner_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1/test/google/cloud/web_security_scanner/v1/web_security_scanner_test.rb create mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1/test/helper.rb create mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1beta/.gitignore create mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1beta/.repo-metadata.json create mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1beta/.rubocop.yml create mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1beta/.toys.rb create mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1beta/.yardopts create mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1beta/AUTHENTICATION.md create mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1beta/CHANGELOG.md create mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1beta/Gemfile create mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1beta/LICENSE.md create mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1beta/README.md create mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1beta/Rakefile create mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1beta/gapic_metadata.json create mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1beta/google-cloud-web_security_scanner-v1beta.gemspec create mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1beta/lib/google-cloud-web_security_scanner-v1beta.rb create mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1beta/lib/google/cloud/web_security_scanner/v1beta.rb create mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1beta/lib/google/cloud/web_security_scanner/v1beta/rest.rb create mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1beta/lib/google/cloud/web_security_scanner/v1beta/version.rb create mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1beta/lib/google/cloud/web_security_scanner/v1beta/web_security_scanner.rb create mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1beta/lib/google/cloud/web_security_scanner/v1beta/web_security_scanner/client.rb create mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1beta/lib/google/cloud/web_security_scanner/v1beta/web_security_scanner/credentials.rb create mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1beta/lib/google/cloud/web_security_scanner/v1beta/web_security_scanner/paths.rb create mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1beta/lib/google/cloud/web_security_scanner/v1beta/web_security_scanner/rest.rb create mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1beta/lib/google/cloud/web_security_scanner/v1beta/web_security_scanner/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1beta/lib/google/cloud/web_security_scanner/v1beta/web_security_scanner/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1beta/lib/google/cloud/websecurityscanner/v1beta/crawled_url_pb.rb create mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1beta/lib/google/cloud/websecurityscanner/v1beta/finding_addon_pb.rb create mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1beta/lib/google/cloud/websecurityscanner/v1beta/finding_pb.rb create mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1beta/lib/google/cloud/websecurityscanner/v1beta/finding_type_stats_pb.rb create mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1beta/lib/google/cloud/websecurityscanner/v1beta/scan_config_error_pb.rb create mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1beta/lib/google/cloud/websecurityscanner/v1beta/scan_config_pb.rb create mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1beta/lib/google/cloud/websecurityscanner/v1beta/scan_run_error_trace_pb.rb create mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1beta/lib/google/cloud/websecurityscanner/v1beta/scan_run_pb.rb create mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1beta/lib/google/cloud/websecurityscanner/v1beta/scan_run_warning_trace_pb.rb create mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1beta/lib/google/cloud/websecurityscanner/v1beta/web_security_scanner_pb.rb create mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1beta/lib/google/cloud/websecurityscanner/v1beta/web_security_scanner_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1beta/proto_docs/README.md create mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1beta/proto_docs/google/api/client.rb create mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1beta/proto_docs/google/api/field_behavior.rb create mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1beta/proto_docs/google/api/launch_stage.rb create mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1beta/proto_docs/google/api/resource.rb create mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1beta/proto_docs/google/cloud/websecurityscanner/v1beta/crawled_url.rb create mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1beta/proto_docs/google/cloud/websecurityscanner/v1beta/finding.rb create mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1beta/proto_docs/google/cloud/websecurityscanner/v1beta/finding_addon.rb create mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1beta/proto_docs/google/cloud/websecurityscanner/v1beta/finding_type_stats.rb create mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1beta/proto_docs/google/cloud/websecurityscanner/v1beta/scan_config.rb create mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1beta/proto_docs/google/cloud/websecurityscanner/v1beta/scan_config_error.rb create mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1beta/proto_docs/google/cloud/websecurityscanner/v1beta/scan_run.rb create mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1beta/proto_docs/google/cloud/websecurityscanner/v1beta/scan_run_error_trace.rb create mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1beta/proto_docs/google/cloud/websecurityscanner/v1beta/scan_run_warning_trace.rb create mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1beta/proto_docs/google/cloud/websecurityscanner/v1beta/web_security_scanner.rb create mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1beta/proto_docs/google/protobuf/duration.rb create mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1beta/proto_docs/google/protobuf/empty.rb create mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1beta/proto_docs/google/protobuf/field_mask.rb create mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1beta/proto_docs/google/protobuf/timestamp.rb create mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1beta/snippets/Gemfile create mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1beta/snippets/snippet_metadata_google.cloud.websecurityscanner.v1beta.json create mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1beta/snippets/web_security_scanner/create_scan_config.rb create mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1beta/snippets/web_security_scanner/delete_scan_config.rb create mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1beta/snippets/web_security_scanner/get_finding.rb create mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1beta/snippets/web_security_scanner/get_scan_config.rb create mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1beta/snippets/web_security_scanner/get_scan_run.rb create mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1beta/snippets/web_security_scanner/list_crawled_urls.rb create mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1beta/snippets/web_security_scanner/list_finding_type_stats.rb create mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1beta/snippets/web_security_scanner/list_findings.rb create mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1beta/snippets/web_security_scanner/list_scan_configs.rb create mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1beta/snippets/web_security_scanner/list_scan_runs.rb create mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1beta/snippets/web_security_scanner/start_scan_run.rb create mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1beta/snippets/web_security_scanner/stop_scan_run.rb create mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1beta/snippets/web_security_scanner/update_scan_config.rb create mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1beta/test/google/cloud/web_security_scanner/v1beta/web_security_scanner_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1beta/test/google/cloud/web_security_scanner/v1beta/web_security_scanner_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1beta/test/google/cloud/web_security_scanner/v1beta/web_security_scanner_test.rb create mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1beta/test/helper.rb create mode 100644 owl-bot-staging/google-cloud-workflows-executions-v1/.gitignore create mode 100644 owl-bot-staging/google-cloud-workflows-executions-v1/.repo-metadata.json create mode 100644 owl-bot-staging/google-cloud-workflows-executions-v1/.rubocop.yml create mode 100644 owl-bot-staging/google-cloud-workflows-executions-v1/.toys.rb create mode 100644 owl-bot-staging/google-cloud-workflows-executions-v1/.yardopts create mode 100644 owl-bot-staging/google-cloud-workflows-executions-v1/AUTHENTICATION.md create mode 100644 owl-bot-staging/google-cloud-workflows-executions-v1/CHANGELOG.md create mode 100644 owl-bot-staging/google-cloud-workflows-executions-v1/Gemfile create mode 100644 owl-bot-staging/google-cloud-workflows-executions-v1/LICENSE.md create mode 100644 owl-bot-staging/google-cloud-workflows-executions-v1/README.md create mode 100644 owl-bot-staging/google-cloud-workflows-executions-v1/Rakefile create mode 100644 owl-bot-staging/google-cloud-workflows-executions-v1/gapic_metadata.json create mode 100644 owl-bot-staging/google-cloud-workflows-executions-v1/google-cloud-workflows-executions-v1.gemspec create mode 100644 owl-bot-staging/google-cloud-workflows-executions-v1/lib/google-cloud-workflows-executions-v1.rb create mode 100644 owl-bot-staging/google-cloud-workflows-executions-v1/lib/google/cloud/workflows/executions/v1.rb create mode 100644 owl-bot-staging/google-cloud-workflows-executions-v1/lib/google/cloud/workflows/executions/v1/executions.rb create mode 100644 owl-bot-staging/google-cloud-workflows-executions-v1/lib/google/cloud/workflows/executions/v1/executions/client.rb create mode 100644 owl-bot-staging/google-cloud-workflows-executions-v1/lib/google/cloud/workflows/executions/v1/executions/credentials.rb create mode 100644 owl-bot-staging/google-cloud-workflows-executions-v1/lib/google/cloud/workflows/executions/v1/executions/paths.rb create mode 100644 owl-bot-staging/google-cloud-workflows-executions-v1/lib/google/cloud/workflows/executions/v1/executions/rest.rb create mode 100644 owl-bot-staging/google-cloud-workflows-executions-v1/lib/google/cloud/workflows/executions/v1/executions/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-workflows-executions-v1/lib/google/cloud/workflows/executions/v1/executions/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-workflows-executions-v1/lib/google/cloud/workflows/executions/v1/executions_pb.rb create mode 100644 owl-bot-staging/google-cloud-workflows-executions-v1/lib/google/cloud/workflows/executions/v1/executions_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-workflows-executions-v1/lib/google/cloud/workflows/executions/v1/rest.rb create mode 100644 owl-bot-staging/google-cloud-workflows-executions-v1/lib/google/cloud/workflows/executions/v1/version.rb create mode 100644 owl-bot-staging/google-cloud-workflows-executions-v1/proto_docs/README.md create mode 100644 owl-bot-staging/google-cloud-workflows-executions-v1/proto_docs/google/api/client.rb create mode 100644 owl-bot-staging/google-cloud-workflows-executions-v1/proto_docs/google/api/field_behavior.rb create mode 100644 owl-bot-staging/google-cloud-workflows-executions-v1/proto_docs/google/api/launch_stage.rb create mode 100644 owl-bot-staging/google-cloud-workflows-executions-v1/proto_docs/google/api/resource.rb create mode 100644 owl-bot-staging/google-cloud-workflows-executions-v1/proto_docs/google/cloud/workflows/executions/v1/executions.rb create mode 100644 owl-bot-staging/google-cloud-workflows-executions-v1/proto_docs/google/protobuf/duration.rb create mode 100644 owl-bot-staging/google-cloud-workflows-executions-v1/proto_docs/google/protobuf/timestamp.rb create mode 100644 owl-bot-staging/google-cloud-workflows-executions-v1/snippets/Gemfile create mode 100644 owl-bot-staging/google-cloud-workflows-executions-v1/snippets/executions/cancel_execution.rb create mode 100644 owl-bot-staging/google-cloud-workflows-executions-v1/snippets/executions/create_execution.rb create mode 100644 owl-bot-staging/google-cloud-workflows-executions-v1/snippets/executions/get_execution.rb create mode 100644 owl-bot-staging/google-cloud-workflows-executions-v1/snippets/executions/list_executions.rb create mode 100644 owl-bot-staging/google-cloud-workflows-executions-v1/snippets/snippet_metadata_google.cloud.workflows.executions.v1.json create mode 100644 owl-bot-staging/google-cloud-workflows-executions-v1/test/google/cloud/workflows/executions/v1/executions_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-workflows-executions-v1/test/google/cloud/workflows/executions/v1/executions_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-workflows-executions-v1/test/google/cloud/workflows/executions/v1/executions_test.rb create mode 100644 owl-bot-staging/google-cloud-workflows-executions-v1/test/helper.rb create mode 100644 owl-bot-staging/google-cloud-workflows-executions-v1beta/.gitignore create mode 100644 owl-bot-staging/google-cloud-workflows-executions-v1beta/.repo-metadata.json create mode 100644 owl-bot-staging/google-cloud-workflows-executions-v1beta/.rubocop.yml create mode 100644 owl-bot-staging/google-cloud-workflows-executions-v1beta/.toys.rb create mode 100644 owl-bot-staging/google-cloud-workflows-executions-v1beta/.yardopts create mode 100644 owl-bot-staging/google-cloud-workflows-executions-v1beta/AUTHENTICATION.md create mode 100644 owl-bot-staging/google-cloud-workflows-executions-v1beta/CHANGELOG.md create mode 100644 owl-bot-staging/google-cloud-workflows-executions-v1beta/Gemfile create mode 100644 owl-bot-staging/google-cloud-workflows-executions-v1beta/LICENSE.md create mode 100644 owl-bot-staging/google-cloud-workflows-executions-v1beta/README.md create mode 100644 owl-bot-staging/google-cloud-workflows-executions-v1beta/Rakefile create mode 100644 owl-bot-staging/google-cloud-workflows-executions-v1beta/gapic_metadata.json create mode 100644 owl-bot-staging/google-cloud-workflows-executions-v1beta/google-cloud-workflows-executions-v1beta.gemspec create mode 100644 owl-bot-staging/google-cloud-workflows-executions-v1beta/lib/google-cloud-workflows-executions-v1beta.rb create mode 100644 owl-bot-staging/google-cloud-workflows-executions-v1beta/lib/google/cloud/workflows/executions/v1beta.rb create mode 100644 owl-bot-staging/google-cloud-workflows-executions-v1beta/lib/google/cloud/workflows/executions/v1beta/executions.rb create mode 100644 owl-bot-staging/google-cloud-workflows-executions-v1beta/lib/google/cloud/workflows/executions/v1beta/executions/client.rb create mode 100644 owl-bot-staging/google-cloud-workflows-executions-v1beta/lib/google/cloud/workflows/executions/v1beta/executions/credentials.rb create mode 100644 owl-bot-staging/google-cloud-workflows-executions-v1beta/lib/google/cloud/workflows/executions/v1beta/executions/paths.rb create mode 100644 owl-bot-staging/google-cloud-workflows-executions-v1beta/lib/google/cloud/workflows/executions/v1beta/executions_pb.rb create mode 100644 owl-bot-staging/google-cloud-workflows-executions-v1beta/lib/google/cloud/workflows/executions/v1beta/executions_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-workflows-executions-v1beta/lib/google/cloud/workflows/executions/v1beta/version.rb create mode 100644 owl-bot-staging/google-cloud-workflows-executions-v1beta/proto_docs/README.md create mode 100644 owl-bot-staging/google-cloud-workflows-executions-v1beta/proto_docs/google/api/client.rb create mode 100644 owl-bot-staging/google-cloud-workflows-executions-v1beta/proto_docs/google/api/field_behavior.rb create mode 100644 owl-bot-staging/google-cloud-workflows-executions-v1beta/proto_docs/google/api/launch_stage.rb create mode 100644 owl-bot-staging/google-cloud-workflows-executions-v1beta/proto_docs/google/api/resource.rb create mode 100644 owl-bot-staging/google-cloud-workflows-executions-v1beta/proto_docs/google/cloud/workflows/executions/v1beta/executions.rb create mode 100644 owl-bot-staging/google-cloud-workflows-executions-v1beta/proto_docs/google/protobuf/duration.rb create mode 100644 owl-bot-staging/google-cloud-workflows-executions-v1beta/proto_docs/google/protobuf/timestamp.rb create mode 100644 owl-bot-staging/google-cloud-workflows-executions-v1beta/snippets/Gemfile create mode 100644 owl-bot-staging/google-cloud-workflows-executions-v1beta/snippets/executions/cancel_execution.rb create mode 100644 owl-bot-staging/google-cloud-workflows-executions-v1beta/snippets/executions/create_execution.rb create mode 100644 owl-bot-staging/google-cloud-workflows-executions-v1beta/snippets/executions/get_execution.rb create mode 100644 owl-bot-staging/google-cloud-workflows-executions-v1beta/snippets/executions/list_executions.rb create mode 100644 owl-bot-staging/google-cloud-workflows-executions-v1beta/snippets/snippet_metadata_google.cloud.workflows.executions.v1beta.json create mode 100644 owl-bot-staging/google-cloud-workflows-executions-v1beta/test/google/cloud/workflows/executions/v1beta/executions_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-workflows-executions-v1beta/test/google/cloud/workflows/executions/v1beta/executions_test.rb create mode 100644 owl-bot-staging/google-cloud-workflows-executions-v1beta/test/helper.rb create mode 100644 owl-bot-staging/google-cloud-workflows-v1/.gitignore create mode 100644 owl-bot-staging/google-cloud-workflows-v1/.repo-metadata.json create mode 100644 owl-bot-staging/google-cloud-workflows-v1/.rubocop.yml create mode 100644 owl-bot-staging/google-cloud-workflows-v1/.toys.rb create mode 100644 owl-bot-staging/google-cloud-workflows-v1/.yardopts create mode 100644 owl-bot-staging/google-cloud-workflows-v1/AUTHENTICATION.md create mode 100644 owl-bot-staging/google-cloud-workflows-v1/CHANGELOG.md create mode 100644 owl-bot-staging/google-cloud-workflows-v1/Gemfile create mode 100644 owl-bot-staging/google-cloud-workflows-v1/LICENSE.md create mode 100644 owl-bot-staging/google-cloud-workflows-v1/README.md create mode 100644 owl-bot-staging/google-cloud-workflows-v1/Rakefile create mode 100644 owl-bot-staging/google-cloud-workflows-v1/gapic_metadata.json create mode 100644 owl-bot-staging/google-cloud-workflows-v1/google-cloud-workflows-v1.gemspec create mode 100644 owl-bot-staging/google-cloud-workflows-v1/lib/google-cloud-workflows-v1.rb create mode 100644 owl-bot-staging/google-cloud-workflows-v1/lib/google/cloud/workflows/v1.rb create mode 100644 owl-bot-staging/google-cloud-workflows-v1/lib/google/cloud/workflows/v1/bindings_override.rb create mode 100644 owl-bot-staging/google-cloud-workflows-v1/lib/google/cloud/workflows/v1/rest.rb create mode 100644 owl-bot-staging/google-cloud-workflows-v1/lib/google/cloud/workflows/v1/version.rb create mode 100644 owl-bot-staging/google-cloud-workflows-v1/lib/google/cloud/workflows/v1/workflows.rb create mode 100644 owl-bot-staging/google-cloud-workflows-v1/lib/google/cloud/workflows/v1/workflows/client.rb create mode 100644 owl-bot-staging/google-cloud-workflows-v1/lib/google/cloud/workflows/v1/workflows/credentials.rb create mode 100644 owl-bot-staging/google-cloud-workflows-v1/lib/google/cloud/workflows/v1/workflows/operations.rb create mode 100644 owl-bot-staging/google-cloud-workflows-v1/lib/google/cloud/workflows/v1/workflows/paths.rb create mode 100644 owl-bot-staging/google-cloud-workflows-v1/lib/google/cloud/workflows/v1/workflows/rest.rb create mode 100644 owl-bot-staging/google-cloud-workflows-v1/lib/google/cloud/workflows/v1/workflows/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-workflows-v1/lib/google/cloud/workflows/v1/workflows/rest/operations.rb create mode 100644 owl-bot-staging/google-cloud-workflows-v1/lib/google/cloud/workflows/v1/workflows/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-workflows-v1/lib/google/cloud/workflows/v1/workflows_pb.rb create mode 100644 owl-bot-staging/google-cloud-workflows-v1/lib/google/cloud/workflows/v1/workflows_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-workflows-v1/proto_docs/README.md create mode 100644 owl-bot-staging/google-cloud-workflows-v1/proto_docs/google/api/client.rb create mode 100644 owl-bot-staging/google-cloud-workflows-v1/proto_docs/google/api/field_behavior.rb create mode 100644 owl-bot-staging/google-cloud-workflows-v1/proto_docs/google/api/launch_stage.rb create mode 100644 owl-bot-staging/google-cloud-workflows-v1/proto_docs/google/api/resource.rb create mode 100644 owl-bot-staging/google-cloud-workflows-v1/proto_docs/google/cloud/workflows/v1/workflows.rb create mode 100644 owl-bot-staging/google-cloud-workflows-v1/proto_docs/google/longrunning/operations.rb create mode 100644 owl-bot-staging/google-cloud-workflows-v1/proto_docs/google/protobuf/any.rb create mode 100644 owl-bot-staging/google-cloud-workflows-v1/proto_docs/google/protobuf/duration.rb create mode 100644 owl-bot-staging/google-cloud-workflows-v1/proto_docs/google/protobuf/empty.rb create mode 100644 owl-bot-staging/google-cloud-workflows-v1/proto_docs/google/protobuf/field_mask.rb create mode 100644 owl-bot-staging/google-cloud-workflows-v1/proto_docs/google/protobuf/timestamp.rb create mode 100644 owl-bot-staging/google-cloud-workflows-v1/proto_docs/google/rpc/status.rb create mode 100644 owl-bot-staging/google-cloud-workflows-v1/snippets/Gemfile create mode 100644 owl-bot-staging/google-cloud-workflows-v1/snippets/snippet_metadata_google.cloud.workflows.v1.json create mode 100644 owl-bot-staging/google-cloud-workflows-v1/snippets/workflows/create_workflow.rb create mode 100644 owl-bot-staging/google-cloud-workflows-v1/snippets/workflows/delete_workflow.rb create mode 100644 owl-bot-staging/google-cloud-workflows-v1/snippets/workflows/get_workflow.rb create mode 100644 owl-bot-staging/google-cloud-workflows-v1/snippets/workflows/list_workflow_revisions.rb create mode 100644 owl-bot-staging/google-cloud-workflows-v1/snippets/workflows/list_workflows.rb create mode 100644 owl-bot-staging/google-cloud-workflows-v1/snippets/workflows/update_workflow.rb create mode 100644 owl-bot-staging/google-cloud-workflows-v1/test/google/cloud/workflows/v1/workflows_operations_test.rb create mode 100644 owl-bot-staging/google-cloud-workflows-v1/test/google/cloud/workflows/v1/workflows_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-workflows-v1/test/google/cloud/workflows/v1/workflows_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-workflows-v1/test/google/cloud/workflows/v1/workflows_test.rb create mode 100644 owl-bot-staging/google-cloud-workflows-v1/test/helper.rb create mode 100644 owl-bot-staging/google-cloud-workflows-v1beta/.gitignore create mode 100644 owl-bot-staging/google-cloud-workflows-v1beta/.repo-metadata.json create mode 100644 owl-bot-staging/google-cloud-workflows-v1beta/.rubocop.yml create mode 100644 owl-bot-staging/google-cloud-workflows-v1beta/.toys.rb create mode 100644 owl-bot-staging/google-cloud-workflows-v1beta/.yardopts create mode 100644 owl-bot-staging/google-cloud-workflows-v1beta/AUTHENTICATION.md create mode 100644 owl-bot-staging/google-cloud-workflows-v1beta/CHANGELOG.md create mode 100644 owl-bot-staging/google-cloud-workflows-v1beta/Gemfile create mode 100644 owl-bot-staging/google-cloud-workflows-v1beta/LICENSE.md create mode 100644 owl-bot-staging/google-cloud-workflows-v1beta/README.md create mode 100644 owl-bot-staging/google-cloud-workflows-v1beta/Rakefile create mode 100644 owl-bot-staging/google-cloud-workflows-v1beta/gapic_metadata.json create mode 100644 owl-bot-staging/google-cloud-workflows-v1beta/google-cloud-workflows-v1beta.gemspec create mode 100644 owl-bot-staging/google-cloud-workflows-v1beta/lib/google-cloud-workflows-v1beta.rb create mode 100644 owl-bot-staging/google-cloud-workflows-v1beta/lib/google/cloud/workflows/v1beta.rb create mode 100644 owl-bot-staging/google-cloud-workflows-v1beta/lib/google/cloud/workflows/v1beta/bindings_override.rb create mode 100644 owl-bot-staging/google-cloud-workflows-v1beta/lib/google/cloud/workflows/v1beta/rest.rb create mode 100644 owl-bot-staging/google-cloud-workflows-v1beta/lib/google/cloud/workflows/v1beta/version.rb create mode 100644 owl-bot-staging/google-cloud-workflows-v1beta/lib/google/cloud/workflows/v1beta/workflows.rb create mode 100644 owl-bot-staging/google-cloud-workflows-v1beta/lib/google/cloud/workflows/v1beta/workflows/client.rb create mode 100644 owl-bot-staging/google-cloud-workflows-v1beta/lib/google/cloud/workflows/v1beta/workflows/credentials.rb create mode 100644 owl-bot-staging/google-cloud-workflows-v1beta/lib/google/cloud/workflows/v1beta/workflows/operations.rb create mode 100644 owl-bot-staging/google-cloud-workflows-v1beta/lib/google/cloud/workflows/v1beta/workflows/paths.rb create mode 100644 owl-bot-staging/google-cloud-workflows-v1beta/lib/google/cloud/workflows/v1beta/workflows/rest.rb create mode 100644 owl-bot-staging/google-cloud-workflows-v1beta/lib/google/cloud/workflows/v1beta/workflows/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-workflows-v1beta/lib/google/cloud/workflows/v1beta/workflows/rest/operations.rb create mode 100644 owl-bot-staging/google-cloud-workflows-v1beta/lib/google/cloud/workflows/v1beta/workflows/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-workflows-v1beta/lib/google/cloud/workflows/v1beta/workflows_pb.rb create mode 100644 owl-bot-staging/google-cloud-workflows-v1beta/lib/google/cloud/workflows/v1beta/workflows_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-workflows-v1beta/proto_docs/README.md create mode 100644 owl-bot-staging/google-cloud-workflows-v1beta/proto_docs/google/api/client.rb create mode 100644 owl-bot-staging/google-cloud-workflows-v1beta/proto_docs/google/api/field_behavior.rb create mode 100644 owl-bot-staging/google-cloud-workflows-v1beta/proto_docs/google/api/launch_stage.rb create mode 100644 owl-bot-staging/google-cloud-workflows-v1beta/proto_docs/google/api/resource.rb create mode 100644 owl-bot-staging/google-cloud-workflows-v1beta/proto_docs/google/cloud/workflows/v1beta/workflows.rb create mode 100644 owl-bot-staging/google-cloud-workflows-v1beta/proto_docs/google/longrunning/operations.rb create mode 100644 owl-bot-staging/google-cloud-workflows-v1beta/proto_docs/google/protobuf/any.rb create mode 100644 owl-bot-staging/google-cloud-workflows-v1beta/proto_docs/google/protobuf/duration.rb create mode 100644 owl-bot-staging/google-cloud-workflows-v1beta/proto_docs/google/protobuf/empty.rb create mode 100644 owl-bot-staging/google-cloud-workflows-v1beta/proto_docs/google/protobuf/field_mask.rb create mode 100644 owl-bot-staging/google-cloud-workflows-v1beta/proto_docs/google/protobuf/timestamp.rb create mode 100644 owl-bot-staging/google-cloud-workflows-v1beta/proto_docs/google/rpc/status.rb create mode 100644 owl-bot-staging/google-cloud-workflows-v1beta/snippets/Gemfile create mode 100644 owl-bot-staging/google-cloud-workflows-v1beta/snippets/snippet_metadata_google.cloud.workflows.v1beta.json create mode 100644 owl-bot-staging/google-cloud-workflows-v1beta/snippets/workflows/create_workflow.rb create mode 100644 owl-bot-staging/google-cloud-workflows-v1beta/snippets/workflows/delete_workflow.rb create mode 100644 owl-bot-staging/google-cloud-workflows-v1beta/snippets/workflows/get_workflow.rb create mode 100644 owl-bot-staging/google-cloud-workflows-v1beta/snippets/workflows/list_workflows.rb create mode 100644 owl-bot-staging/google-cloud-workflows-v1beta/snippets/workflows/update_workflow.rb create mode 100644 owl-bot-staging/google-cloud-workflows-v1beta/test/google/cloud/workflows/v1beta/workflows_operations_test.rb create mode 100644 owl-bot-staging/google-cloud-workflows-v1beta/test/google/cloud/workflows/v1beta/workflows_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-workflows-v1beta/test/google/cloud/workflows/v1beta/workflows_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-workflows-v1beta/test/google/cloud/workflows/v1beta/workflows_test.rb create mode 100644 owl-bot-staging/google-cloud-workflows-v1beta/test/helper.rb create mode 100644 owl-bot-staging/google-cloud-workstations-v1/.gitignore create mode 100644 owl-bot-staging/google-cloud-workstations-v1/.repo-metadata.json create mode 100644 owl-bot-staging/google-cloud-workstations-v1/.rubocop.yml create mode 100644 owl-bot-staging/google-cloud-workstations-v1/.toys.rb create mode 100644 owl-bot-staging/google-cloud-workstations-v1/.yardopts create mode 100644 owl-bot-staging/google-cloud-workstations-v1/AUTHENTICATION.md create mode 100644 owl-bot-staging/google-cloud-workstations-v1/CHANGELOG.md create mode 100644 owl-bot-staging/google-cloud-workstations-v1/Gemfile create mode 100644 owl-bot-staging/google-cloud-workstations-v1/LICENSE.md create mode 100644 owl-bot-staging/google-cloud-workstations-v1/README.md create mode 100644 owl-bot-staging/google-cloud-workstations-v1/Rakefile create mode 100644 owl-bot-staging/google-cloud-workstations-v1/gapic_metadata.json create mode 100644 owl-bot-staging/google-cloud-workstations-v1/google-cloud-workstations-v1.gemspec create mode 100644 owl-bot-staging/google-cloud-workstations-v1/lib/google-cloud-workstations-v1.rb create mode 100644 owl-bot-staging/google-cloud-workstations-v1/lib/google/cloud/workstations/v1.rb create mode 100644 owl-bot-staging/google-cloud-workstations-v1/lib/google/cloud/workstations/v1/bindings_override.rb create mode 100644 owl-bot-staging/google-cloud-workstations-v1/lib/google/cloud/workstations/v1/rest.rb create mode 100644 owl-bot-staging/google-cloud-workstations-v1/lib/google/cloud/workstations/v1/version.rb create mode 100644 owl-bot-staging/google-cloud-workstations-v1/lib/google/cloud/workstations/v1/workstations.rb create mode 100644 owl-bot-staging/google-cloud-workstations-v1/lib/google/cloud/workstations/v1/workstations/client.rb create mode 100644 owl-bot-staging/google-cloud-workstations-v1/lib/google/cloud/workstations/v1/workstations/credentials.rb create mode 100644 owl-bot-staging/google-cloud-workstations-v1/lib/google/cloud/workstations/v1/workstations/operations.rb create mode 100644 owl-bot-staging/google-cloud-workstations-v1/lib/google/cloud/workstations/v1/workstations/paths.rb create mode 100644 owl-bot-staging/google-cloud-workstations-v1/lib/google/cloud/workstations/v1/workstations/rest.rb create mode 100644 owl-bot-staging/google-cloud-workstations-v1/lib/google/cloud/workstations/v1/workstations/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-workstations-v1/lib/google/cloud/workstations/v1/workstations/rest/operations.rb create mode 100644 owl-bot-staging/google-cloud-workstations-v1/lib/google/cloud/workstations/v1/workstations/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-workstations-v1/lib/google/cloud/workstations/v1/workstations_pb.rb create mode 100644 owl-bot-staging/google-cloud-workstations-v1/lib/google/cloud/workstations/v1/workstations_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-workstations-v1/proto_docs/README.md create mode 100644 owl-bot-staging/google-cloud-workstations-v1/proto_docs/google/api/client.rb create mode 100644 owl-bot-staging/google-cloud-workstations-v1/proto_docs/google/api/field_behavior.rb create mode 100644 owl-bot-staging/google-cloud-workstations-v1/proto_docs/google/api/launch_stage.rb create mode 100644 owl-bot-staging/google-cloud-workstations-v1/proto_docs/google/api/resource.rb create mode 100644 owl-bot-staging/google-cloud-workstations-v1/proto_docs/google/cloud/workstations/v1/workstations.rb create mode 100644 owl-bot-staging/google-cloud-workstations-v1/proto_docs/google/longrunning/operations.rb create mode 100644 owl-bot-staging/google-cloud-workstations-v1/proto_docs/google/protobuf/any.rb create mode 100644 owl-bot-staging/google-cloud-workstations-v1/proto_docs/google/protobuf/duration.rb create mode 100644 owl-bot-staging/google-cloud-workstations-v1/proto_docs/google/protobuf/empty.rb create mode 100644 owl-bot-staging/google-cloud-workstations-v1/proto_docs/google/protobuf/field_mask.rb create mode 100644 owl-bot-staging/google-cloud-workstations-v1/proto_docs/google/protobuf/timestamp.rb create mode 100644 owl-bot-staging/google-cloud-workstations-v1/proto_docs/google/rpc/status.rb create mode 100644 owl-bot-staging/google-cloud-workstations-v1/proto_docs/google/type/expr.rb create mode 100644 owl-bot-staging/google-cloud-workstations-v1/snippets/Gemfile create mode 100644 owl-bot-staging/google-cloud-workstations-v1/snippets/snippet_metadata_google.cloud.workstations.v1.json create mode 100644 owl-bot-staging/google-cloud-workstations-v1/snippets/workstations/create_workstation.rb create mode 100644 owl-bot-staging/google-cloud-workstations-v1/snippets/workstations/create_workstation_cluster.rb create mode 100644 owl-bot-staging/google-cloud-workstations-v1/snippets/workstations/create_workstation_config.rb create mode 100644 owl-bot-staging/google-cloud-workstations-v1/snippets/workstations/delete_workstation.rb create mode 100644 owl-bot-staging/google-cloud-workstations-v1/snippets/workstations/delete_workstation_cluster.rb create mode 100644 owl-bot-staging/google-cloud-workstations-v1/snippets/workstations/delete_workstation_config.rb create mode 100644 owl-bot-staging/google-cloud-workstations-v1/snippets/workstations/generate_access_token.rb create mode 100644 owl-bot-staging/google-cloud-workstations-v1/snippets/workstations/get_workstation.rb create mode 100644 owl-bot-staging/google-cloud-workstations-v1/snippets/workstations/get_workstation_cluster.rb create mode 100644 owl-bot-staging/google-cloud-workstations-v1/snippets/workstations/get_workstation_config.rb create mode 100644 owl-bot-staging/google-cloud-workstations-v1/snippets/workstations/list_usable_workstation_configs.rb create mode 100644 owl-bot-staging/google-cloud-workstations-v1/snippets/workstations/list_usable_workstations.rb create mode 100644 owl-bot-staging/google-cloud-workstations-v1/snippets/workstations/list_workstation_clusters.rb create mode 100644 owl-bot-staging/google-cloud-workstations-v1/snippets/workstations/list_workstation_configs.rb create mode 100644 owl-bot-staging/google-cloud-workstations-v1/snippets/workstations/list_workstations.rb create mode 100644 owl-bot-staging/google-cloud-workstations-v1/snippets/workstations/start_workstation.rb create mode 100644 owl-bot-staging/google-cloud-workstations-v1/snippets/workstations/stop_workstation.rb create mode 100644 owl-bot-staging/google-cloud-workstations-v1/snippets/workstations/update_workstation.rb create mode 100644 owl-bot-staging/google-cloud-workstations-v1/snippets/workstations/update_workstation_cluster.rb create mode 100644 owl-bot-staging/google-cloud-workstations-v1/snippets/workstations/update_workstation_config.rb create mode 100644 owl-bot-staging/google-cloud-workstations-v1/test/google/cloud/workstations/v1/workstations_operations_test.rb create mode 100644 owl-bot-staging/google-cloud-workstations-v1/test/google/cloud/workstations/v1/workstations_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-workstations-v1/test/google/cloud/workstations/v1/workstations_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-workstations-v1/test/google/cloud/workstations/v1/workstations_test.rb create mode 100644 owl-bot-staging/google-cloud-workstations-v1/test/helper.rb create mode 100644 owl-bot-staging/google-cloud-workstations-v1beta/.gitignore create mode 100644 owl-bot-staging/google-cloud-workstations-v1beta/.repo-metadata.json create mode 100644 owl-bot-staging/google-cloud-workstations-v1beta/.rubocop.yml create mode 100644 owl-bot-staging/google-cloud-workstations-v1beta/.toys.rb create mode 100644 owl-bot-staging/google-cloud-workstations-v1beta/.yardopts create mode 100644 owl-bot-staging/google-cloud-workstations-v1beta/AUTHENTICATION.md create mode 100644 owl-bot-staging/google-cloud-workstations-v1beta/CHANGELOG.md create mode 100644 owl-bot-staging/google-cloud-workstations-v1beta/Gemfile create mode 100644 owl-bot-staging/google-cloud-workstations-v1beta/LICENSE.md create mode 100644 owl-bot-staging/google-cloud-workstations-v1beta/README.md create mode 100644 owl-bot-staging/google-cloud-workstations-v1beta/Rakefile create mode 100644 owl-bot-staging/google-cloud-workstations-v1beta/gapic_metadata.json create mode 100644 owl-bot-staging/google-cloud-workstations-v1beta/google-cloud-workstations-v1beta.gemspec create mode 100644 owl-bot-staging/google-cloud-workstations-v1beta/lib/google-cloud-workstations-v1beta.rb create mode 100644 owl-bot-staging/google-cloud-workstations-v1beta/lib/google/cloud/workstations/v1beta.rb create mode 100644 owl-bot-staging/google-cloud-workstations-v1beta/lib/google/cloud/workstations/v1beta/bindings_override.rb create mode 100644 owl-bot-staging/google-cloud-workstations-v1beta/lib/google/cloud/workstations/v1beta/rest.rb create mode 100644 owl-bot-staging/google-cloud-workstations-v1beta/lib/google/cloud/workstations/v1beta/version.rb create mode 100644 owl-bot-staging/google-cloud-workstations-v1beta/lib/google/cloud/workstations/v1beta/workstations.rb create mode 100644 owl-bot-staging/google-cloud-workstations-v1beta/lib/google/cloud/workstations/v1beta/workstations/client.rb create mode 100644 owl-bot-staging/google-cloud-workstations-v1beta/lib/google/cloud/workstations/v1beta/workstations/credentials.rb create mode 100644 owl-bot-staging/google-cloud-workstations-v1beta/lib/google/cloud/workstations/v1beta/workstations/operations.rb create mode 100644 owl-bot-staging/google-cloud-workstations-v1beta/lib/google/cloud/workstations/v1beta/workstations/paths.rb create mode 100644 owl-bot-staging/google-cloud-workstations-v1beta/lib/google/cloud/workstations/v1beta/workstations/rest.rb create mode 100644 owl-bot-staging/google-cloud-workstations-v1beta/lib/google/cloud/workstations/v1beta/workstations/rest/client.rb create mode 100644 owl-bot-staging/google-cloud-workstations-v1beta/lib/google/cloud/workstations/v1beta/workstations/rest/operations.rb create mode 100644 owl-bot-staging/google-cloud-workstations-v1beta/lib/google/cloud/workstations/v1beta/workstations/rest/service_stub.rb create mode 100644 owl-bot-staging/google-cloud-workstations-v1beta/lib/google/cloud/workstations/v1beta/workstations_pb.rb create mode 100644 owl-bot-staging/google-cloud-workstations-v1beta/lib/google/cloud/workstations/v1beta/workstations_services_pb.rb create mode 100644 owl-bot-staging/google-cloud-workstations-v1beta/proto_docs/README.md create mode 100644 owl-bot-staging/google-cloud-workstations-v1beta/proto_docs/google/api/client.rb create mode 100644 owl-bot-staging/google-cloud-workstations-v1beta/proto_docs/google/api/field_behavior.rb create mode 100644 owl-bot-staging/google-cloud-workstations-v1beta/proto_docs/google/api/launch_stage.rb create mode 100644 owl-bot-staging/google-cloud-workstations-v1beta/proto_docs/google/api/resource.rb create mode 100644 owl-bot-staging/google-cloud-workstations-v1beta/proto_docs/google/cloud/workstations/v1beta/workstations.rb create mode 100644 owl-bot-staging/google-cloud-workstations-v1beta/proto_docs/google/longrunning/operations.rb create mode 100644 owl-bot-staging/google-cloud-workstations-v1beta/proto_docs/google/protobuf/any.rb create mode 100644 owl-bot-staging/google-cloud-workstations-v1beta/proto_docs/google/protobuf/duration.rb create mode 100644 owl-bot-staging/google-cloud-workstations-v1beta/proto_docs/google/protobuf/empty.rb create mode 100644 owl-bot-staging/google-cloud-workstations-v1beta/proto_docs/google/protobuf/field_mask.rb create mode 100644 owl-bot-staging/google-cloud-workstations-v1beta/proto_docs/google/protobuf/timestamp.rb create mode 100644 owl-bot-staging/google-cloud-workstations-v1beta/proto_docs/google/rpc/status.rb create mode 100644 owl-bot-staging/google-cloud-workstations-v1beta/proto_docs/google/type/expr.rb create mode 100644 owl-bot-staging/google-cloud-workstations-v1beta/snippets/Gemfile create mode 100644 owl-bot-staging/google-cloud-workstations-v1beta/snippets/snippet_metadata_google.cloud.workstations.v1beta.json create mode 100644 owl-bot-staging/google-cloud-workstations-v1beta/snippets/workstations/create_workstation.rb create mode 100644 owl-bot-staging/google-cloud-workstations-v1beta/snippets/workstations/create_workstation_cluster.rb create mode 100644 owl-bot-staging/google-cloud-workstations-v1beta/snippets/workstations/create_workstation_config.rb create mode 100644 owl-bot-staging/google-cloud-workstations-v1beta/snippets/workstations/delete_workstation.rb create mode 100644 owl-bot-staging/google-cloud-workstations-v1beta/snippets/workstations/delete_workstation_cluster.rb create mode 100644 owl-bot-staging/google-cloud-workstations-v1beta/snippets/workstations/delete_workstation_config.rb create mode 100644 owl-bot-staging/google-cloud-workstations-v1beta/snippets/workstations/generate_access_token.rb create mode 100644 owl-bot-staging/google-cloud-workstations-v1beta/snippets/workstations/get_workstation.rb create mode 100644 owl-bot-staging/google-cloud-workstations-v1beta/snippets/workstations/get_workstation_cluster.rb create mode 100644 owl-bot-staging/google-cloud-workstations-v1beta/snippets/workstations/get_workstation_config.rb create mode 100644 owl-bot-staging/google-cloud-workstations-v1beta/snippets/workstations/list_usable_workstation_configs.rb create mode 100644 owl-bot-staging/google-cloud-workstations-v1beta/snippets/workstations/list_usable_workstations.rb create mode 100644 owl-bot-staging/google-cloud-workstations-v1beta/snippets/workstations/list_workstation_clusters.rb create mode 100644 owl-bot-staging/google-cloud-workstations-v1beta/snippets/workstations/list_workstation_configs.rb create mode 100644 owl-bot-staging/google-cloud-workstations-v1beta/snippets/workstations/list_workstations.rb create mode 100644 owl-bot-staging/google-cloud-workstations-v1beta/snippets/workstations/start_workstation.rb create mode 100644 owl-bot-staging/google-cloud-workstations-v1beta/snippets/workstations/stop_workstation.rb create mode 100644 owl-bot-staging/google-cloud-workstations-v1beta/snippets/workstations/update_workstation.rb create mode 100644 owl-bot-staging/google-cloud-workstations-v1beta/snippets/workstations/update_workstation_cluster.rb create mode 100644 owl-bot-staging/google-cloud-workstations-v1beta/snippets/workstations/update_workstation_config.rb create mode 100644 owl-bot-staging/google-cloud-workstations-v1beta/test/google/cloud/workstations/v1beta/workstations_operations_test.rb create mode 100644 owl-bot-staging/google-cloud-workstations-v1beta/test/google/cloud/workstations/v1beta/workstations_paths_test.rb create mode 100644 owl-bot-staging/google-cloud-workstations-v1beta/test/google/cloud/workstations/v1beta/workstations_rest_test.rb create mode 100644 owl-bot-staging/google-cloud-workstations-v1beta/test/google/cloud/workstations/v1beta/workstations_test.rb create mode 100644 owl-bot-staging/google-cloud-workstations-v1beta/test/helper.rb create mode 100644 owl-bot-staging/google-iam-credentials-v1/.gitignore create mode 100644 owl-bot-staging/google-iam-credentials-v1/.repo-metadata.json create mode 100644 owl-bot-staging/google-iam-credentials-v1/.rubocop.yml create mode 100644 owl-bot-staging/google-iam-credentials-v1/.toys.rb create mode 100644 owl-bot-staging/google-iam-credentials-v1/.yardopts create mode 100644 owl-bot-staging/google-iam-credentials-v1/AUTHENTICATION.md create mode 100644 owl-bot-staging/google-iam-credentials-v1/CHANGELOG.md create mode 100644 owl-bot-staging/google-iam-credentials-v1/Gemfile create mode 100644 owl-bot-staging/google-iam-credentials-v1/LICENSE.md create mode 100644 owl-bot-staging/google-iam-credentials-v1/README.md create mode 100644 owl-bot-staging/google-iam-credentials-v1/Rakefile create mode 100644 owl-bot-staging/google-iam-credentials-v1/gapic_metadata.json create mode 100644 owl-bot-staging/google-iam-credentials-v1/google-iam-credentials-v1.gemspec create mode 100644 owl-bot-staging/google-iam-credentials-v1/lib/google-iam-credentials-v1.rb create mode 100644 owl-bot-staging/google-iam-credentials-v1/lib/google/iam/credentials/v1.rb create mode 100644 owl-bot-staging/google-iam-credentials-v1/lib/google/iam/credentials/v1/common_pb.rb create mode 100644 owl-bot-staging/google-iam-credentials-v1/lib/google/iam/credentials/v1/iam_credentials.rb create mode 100644 owl-bot-staging/google-iam-credentials-v1/lib/google/iam/credentials/v1/iam_credentials/client.rb create mode 100644 owl-bot-staging/google-iam-credentials-v1/lib/google/iam/credentials/v1/iam_credentials/credentials.rb create mode 100644 owl-bot-staging/google-iam-credentials-v1/lib/google/iam/credentials/v1/iam_credentials/paths.rb create mode 100644 owl-bot-staging/google-iam-credentials-v1/lib/google/iam/credentials/v1/iam_credentials/rest.rb create mode 100644 owl-bot-staging/google-iam-credentials-v1/lib/google/iam/credentials/v1/iam_credentials/rest/client.rb create mode 100644 owl-bot-staging/google-iam-credentials-v1/lib/google/iam/credentials/v1/iam_credentials/rest/service_stub.rb create mode 100644 owl-bot-staging/google-iam-credentials-v1/lib/google/iam/credentials/v1/iamcredentials_pb.rb create mode 100644 owl-bot-staging/google-iam-credentials-v1/lib/google/iam/credentials/v1/iamcredentials_services_pb.rb create mode 100644 owl-bot-staging/google-iam-credentials-v1/lib/google/iam/credentials/v1/rest.rb create mode 100644 owl-bot-staging/google-iam-credentials-v1/lib/google/iam/credentials/v1/version.rb create mode 100644 owl-bot-staging/google-iam-credentials-v1/proto_docs/README.md create mode 100644 owl-bot-staging/google-iam-credentials-v1/proto_docs/google/api/client.rb create mode 100644 owl-bot-staging/google-iam-credentials-v1/proto_docs/google/api/field_behavior.rb create mode 100644 owl-bot-staging/google-iam-credentials-v1/proto_docs/google/api/launch_stage.rb create mode 100644 owl-bot-staging/google-iam-credentials-v1/proto_docs/google/api/resource.rb create mode 100644 owl-bot-staging/google-iam-credentials-v1/proto_docs/google/iam/credentials/v1/common.rb create mode 100644 owl-bot-staging/google-iam-credentials-v1/proto_docs/google/protobuf/duration.rb create mode 100644 owl-bot-staging/google-iam-credentials-v1/proto_docs/google/protobuf/timestamp.rb create mode 100644 owl-bot-staging/google-iam-credentials-v1/snippets/Gemfile create mode 100644 owl-bot-staging/google-iam-credentials-v1/snippets/iam_credentials/generate_access_token.rb create mode 100644 owl-bot-staging/google-iam-credentials-v1/snippets/iam_credentials/generate_id_token.rb create mode 100644 owl-bot-staging/google-iam-credentials-v1/snippets/iam_credentials/sign_blob.rb create mode 100644 owl-bot-staging/google-iam-credentials-v1/snippets/iam_credentials/sign_jwt.rb create mode 100644 owl-bot-staging/google-iam-credentials-v1/snippets/snippet_metadata_google.iam.credentials.v1.json create mode 100644 owl-bot-staging/google-iam-credentials-v1/test/google/iam/credentials/v1/iam_credentials_paths_test.rb create mode 100644 owl-bot-staging/google-iam-credentials-v1/test/google/iam/credentials/v1/iam_credentials_rest_test.rb create mode 100644 owl-bot-staging/google-iam-credentials-v1/test/google/iam/credentials/v1/iam_credentials_test.rb create mode 100644 owl-bot-staging/google-iam-credentials-v1/test/helper.rb create mode 100644 owl-bot-staging/google-iam-v1/.gitignore create mode 100644 owl-bot-staging/google-iam-v1/.repo-metadata.json create mode 100644 owl-bot-staging/google-iam-v1/.rubocop.yml create mode 100644 owl-bot-staging/google-iam-v1/.toys.rb create mode 100644 owl-bot-staging/google-iam-v1/.yardopts create mode 100644 owl-bot-staging/google-iam-v1/AUTHENTICATION.md create mode 100644 owl-bot-staging/google-iam-v1/CHANGELOG.md create mode 100644 owl-bot-staging/google-iam-v1/Gemfile create mode 100644 owl-bot-staging/google-iam-v1/LICENSE.md create mode 100644 owl-bot-staging/google-iam-v1/README.md create mode 100644 owl-bot-staging/google-iam-v1/Rakefile create mode 100644 owl-bot-staging/google-iam-v1/gapic_metadata.json create mode 100644 owl-bot-staging/google-iam-v1/google-iam-v1.gemspec create mode 100644 owl-bot-staging/google-iam-v1/lib/google-iam-v1.rb create mode 100644 owl-bot-staging/google-iam-v1/lib/google/iam/v1.rb create mode 100644 owl-bot-staging/google-iam-v1/lib/google/iam/v1/iam_policy.rb create mode 100644 owl-bot-staging/google-iam-v1/lib/google/iam/v1/iam_policy/client.rb create mode 100644 owl-bot-staging/google-iam-v1/lib/google/iam/v1/iam_policy/credentials.rb create mode 100644 owl-bot-staging/google-iam-v1/lib/google/iam/v1/iam_policy/rest.rb create mode 100644 owl-bot-staging/google-iam-v1/lib/google/iam/v1/iam_policy/rest/client.rb create mode 100644 owl-bot-staging/google-iam-v1/lib/google/iam/v1/iam_policy/rest/service_stub.rb create mode 100644 owl-bot-staging/google-iam-v1/lib/google/iam/v1/iam_policy_pb.rb create mode 100644 owl-bot-staging/google-iam-v1/lib/google/iam/v1/iam_policy_services_pb.rb create mode 100644 owl-bot-staging/google-iam-v1/lib/google/iam/v1/logging/audit_data_pb.rb create mode 100644 owl-bot-staging/google-iam-v1/lib/google/iam/v1/options_pb.rb create mode 100644 owl-bot-staging/google-iam-v1/lib/google/iam/v1/policy_pb.rb create mode 100644 owl-bot-staging/google-iam-v1/lib/google/iam/v1/resource_policy_member_pb.rb create mode 100644 owl-bot-staging/google-iam-v1/lib/google/iam/v1/rest.rb create mode 100644 owl-bot-staging/google-iam-v1/lib/google/iam/v1/version.rb create mode 100644 owl-bot-staging/google-iam-v1/proto_docs/README.md create mode 100644 owl-bot-staging/google-iam-v1/proto_docs/google/api/client.rb create mode 100644 owl-bot-staging/google-iam-v1/proto_docs/google/api/field_behavior.rb create mode 100644 owl-bot-staging/google-iam-v1/proto_docs/google/api/launch_stage.rb create mode 100644 owl-bot-staging/google-iam-v1/proto_docs/google/api/resource.rb create mode 100644 owl-bot-staging/google-iam-v1/proto_docs/google/iam/v1/iam_policy.rb create mode 100644 owl-bot-staging/google-iam-v1/proto_docs/google/iam/v1/options.rb create mode 100644 owl-bot-staging/google-iam-v1/proto_docs/google/iam/v1/policy.rb create mode 100644 owl-bot-staging/google-iam-v1/proto_docs/google/iam/v1/resource_policy_member.rb create mode 100644 owl-bot-staging/google-iam-v1/proto_docs/google/protobuf/duration.rb create mode 100644 owl-bot-staging/google-iam-v1/proto_docs/google/protobuf/field_mask.rb create mode 100644 owl-bot-staging/google-iam-v1/proto_docs/google/type/expr.rb create mode 100644 owl-bot-staging/google-iam-v1/snippets/Gemfile create mode 100644 owl-bot-staging/google-iam-v1/snippets/iam_policy/get_iam_policy.rb create mode 100644 owl-bot-staging/google-iam-v1/snippets/iam_policy/set_iam_policy.rb create mode 100644 owl-bot-staging/google-iam-v1/snippets/iam_policy/test_iam_permissions.rb create mode 100644 owl-bot-staging/google-iam-v1/snippets/snippet_metadata_google.iam.v1.json create mode 100644 owl-bot-staging/google-iam-v1/test/google/iam/v1/iam_policy_rest_test.rb create mode 100644 owl-bot-staging/google-iam-v1/test/google/iam/v1/iam_policy_test.rb create mode 100644 owl-bot-staging/google-iam-v1/test/helper.rb create mode 100644 owl-bot-staging/google-iam-v1beta/.gitignore create mode 100644 owl-bot-staging/google-iam-v1beta/.repo-metadata.json create mode 100644 owl-bot-staging/google-iam-v1beta/.rubocop.yml create mode 100644 owl-bot-staging/google-iam-v1beta/.toys.rb create mode 100644 owl-bot-staging/google-iam-v1beta/.yardopts create mode 100644 owl-bot-staging/google-iam-v1beta/AUTHENTICATION.md create mode 100644 owl-bot-staging/google-iam-v1beta/CHANGELOG.md create mode 100644 owl-bot-staging/google-iam-v1beta/Gemfile create mode 100644 owl-bot-staging/google-iam-v1beta/LICENSE.md create mode 100644 owl-bot-staging/google-iam-v1beta/README.md create mode 100644 owl-bot-staging/google-iam-v1beta/Rakefile create mode 100644 owl-bot-staging/google-iam-v1beta/gapic_metadata.json create mode 100644 owl-bot-staging/google-iam-v1beta/google-iam-v1beta.gemspec create mode 100644 owl-bot-staging/google-iam-v1beta/lib/google-iam-v1beta.rb create mode 100644 owl-bot-staging/google-iam-v1beta/lib/google/iam/v1beta.rb create mode 100644 owl-bot-staging/google-iam-v1beta/lib/google/iam/v1beta/version.rb create mode 100644 owl-bot-staging/google-iam-v1beta/lib/google/iam/v1beta/workload_identity_pool_pb.rb create mode 100644 owl-bot-staging/google-iam-v1beta/lib/google/iam/v1beta/workload_identity_pool_services_pb.rb create mode 100644 owl-bot-staging/google-iam-v1beta/lib/google/iam/v1beta/workload_identity_pools.rb create mode 100644 owl-bot-staging/google-iam-v1beta/lib/google/iam/v1beta/workload_identity_pools/client.rb create mode 100644 owl-bot-staging/google-iam-v1beta/lib/google/iam/v1beta/workload_identity_pools/credentials.rb create mode 100644 owl-bot-staging/google-iam-v1beta/lib/google/iam/v1beta/workload_identity_pools/operations.rb create mode 100644 owl-bot-staging/google-iam-v1beta/lib/google/iam/v1beta/workload_identity_pools/paths.rb create mode 100644 owl-bot-staging/google-iam-v1beta/proto_docs/README.md create mode 100644 owl-bot-staging/google-iam-v1beta/proto_docs/google/api/client.rb create mode 100644 owl-bot-staging/google-iam-v1beta/proto_docs/google/api/field_behavior.rb create mode 100644 owl-bot-staging/google-iam-v1beta/proto_docs/google/api/launch_stage.rb create mode 100644 owl-bot-staging/google-iam-v1beta/proto_docs/google/api/resource.rb create mode 100644 owl-bot-staging/google-iam-v1beta/proto_docs/google/iam/v1beta/workload_identity_pool.rb create mode 100644 owl-bot-staging/google-iam-v1beta/proto_docs/google/longrunning/operations.rb create mode 100644 owl-bot-staging/google-iam-v1beta/proto_docs/google/protobuf/any.rb create mode 100644 owl-bot-staging/google-iam-v1beta/proto_docs/google/protobuf/duration.rb create mode 100644 owl-bot-staging/google-iam-v1beta/proto_docs/google/protobuf/empty.rb create mode 100644 owl-bot-staging/google-iam-v1beta/proto_docs/google/protobuf/field_mask.rb create mode 100644 owl-bot-staging/google-iam-v1beta/proto_docs/google/rpc/status.rb create mode 100644 owl-bot-staging/google-iam-v1beta/snippets/Gemfile create mode 100644 owl-bot-staging/google-iam-v1beta/snippets/snippet_metadata_google.iam.v1beta.json create mode 100644 owl-bot-staging/google-iam-v1beta/snippets/workload_identity_pools/create_workload_identity_pool.rb create mode 100644 owl-bot-staging/google-iam-v1beta/snippets/workload_identity_pools/create_workload_identity_pool_provider.rb create mode 100644 owl-bot-staging/google-iam-v1beta/snippets/workload_identity_pools/delete_workload_identity_pool.rb create mode 100644 owl-bot-staging/google-iam-v1beta/snippets/workload_identity_pools/delete_workload_identity_pool_provider.rb create mode 100644 owl-bot-staging/google-iam-v1beta/snippets/workload_identity_pools/get_workload_identity_pool.rb create mode 100644 owl-bot-staging/google-iam-v1beta/snippets/workload_identity_pools/get_workload_identity_pool_provider.rb create mode 100644 owl-bot-staging/google-iam-v1beta/snippets/workload_identity_pools/list_workload_identity_pool_providers.rb create mode 100644 owl-bot-staging/google-iam-v1beta/snippets/workload_identity_pools/list_workload_identity_pools.rb create mode 100644 owl-bot-staging/google-iam-v1beta/snippets/workload_identity_pools/undelete_workload_identity_pool.rb create mode 100644 owl-bot-staging/google-iam-v1beta/snippets/workload_identity_pools/undelete_workload_identity_pool_provider.rb create mode 100644 owl-bot-staging/google-iam-v1beta/snippets/workload_identity_pools/update_workload_identity_pool.rb create mode 100644 owl-bot-staging/google-iam-v1beta/snippets/workload_identity_pools/update_workload_identity_pool_provider.rb create mode 100644 owl-bot-staging/google-iam-v1beta/test/google/iam/v1beta/workload_identity_pools_operations_test.rb create mode 100644 owl-bot-staging/google-iam-v1beta/test/google/iam/v1beta/workload_identity_pools_paths_test.rb create mode 100644 owl-bot-staging/google-iam-v1beta/test/google/iam/v1beta/workload_identity_pools_test.rb create mode 100644 owl-bot-staging/google-iam-v1beta/test/helper.rb create mode 100644 owl-bot-staging/google-iam-v2/.gitignore create mode 100644 owl-bot-staging/google-iam-v2/.repo-metadata.json create mode 100644 owl-bot-staging/google-iam-v2/.rubocop.yml create mode 100644 owl-bot-staging/google-iam-v2/.toys.rb create mode 100644 owl-bot-staging/google-iam-v2/.yardopts create mode 100644 owl-bot-staging/google-iam-v2/AUTHENTICATION.md create mode 100644 owl-bot-staging/google-iam-v2/CHANGELOG.md create mode 100644 owl-bot-staging/google-iam-v2/Gemfile create mode 100644 owl-bot-staging/google-iam-v2/LICENSE.md create mode 100644 owl-bot-staging/google-iam-v2/README.md create mode 100644 owl-bot-staging/google-iam-v2/Rakefile create mode 100644 owl-bot-staging/google-iam-v2/gapic_metadata.json create mode 100644 owl-bot-staging/google-iam-v2/google-iam-v2.gemspec create mode 100644 owl-bot-staging/google-iam-v2/lib/google-iam-v2.rb create mode 100644 owl-bot-staging/google-iam-v2/lib/google/iam/v2.rb create mode 100644 owl-bot-staging/google-iam-v2/lib/google/iam/v2/deny_pb.rb create mode 100644 owl-bot-staging/google-iam-v2/lib/google/iam/v2/policies.rb create mode 100644 owl-bot-staging/google-iam-v2/lib/google/iam/v2/policies/client.rb create mode 100644 owl-bot-staging/google-iam-v2/lib/google/iam/v2/policies/credentials.rb create mode 100644 owl-bot-staging/google-iam-v2/lib/google/iam/v2/policies/operations.rb create mode 100644 owl-bot-staging/google-iam-v2/lib/google/iam/v2/policies/rest.rb create mode 100644 owl-bot-staging/google-iam-v2/lib/google/iam/v2/policies/rest/client.rb create mode 100644 owl-bot-staging/google-iam-v2/lib/google/iam/v2/policies/rest/operations.rb create mode 100644 owl-bot-staging/google-iam-v2/lib/google/iam/v2/policies/rest/service_stub.rb create mode 100644 owl-bot-staging/google-iam-v2/lib/google/iam/v2/policy_pb.rb create mode 100644 owl-bot-staging/google-iam-v2/lib/google/iam/v2/policy_services_pb.rb create mode 100644 owl-bot-staging/google-iam-v2/lib/google/iam/v2/rest.rb create mode 100644 owl-bot-staging/google-iam-v2/lib/google/iam/v2/version.rb create mode 100644 owl-bot-staging/google-iam-v2/proto_docs/README.md create mode 100644 owl-bot-staging/google-iam-v2/proto_docs/google/api/client.rb create mode 100644 owl-bot-staging/google-iam-v2/proto_docs/google/api/field_behavior.rb create mode 100644 owl-bot-staging/google-iam-v2/proto_docs/google/api/launch_stage.rb create mode 100644 owl-bot-staging/google-iam-v2/proto_docs/google/api/resource.rb create mode 100644 owl-bot-staging/google-iam-v2/proto_docs/google/iam/v2/deny.rb create mode 100644 owl-bot-staging/google-iam-v2/proto_docs/google/iam/v2/policy.rb create mode 100644 owl-bot-staging/google-iam-v2/proto_docs/google/longrunning/operations.rb create mode 100644 owl-bot-staging/google-iam-v2/proto_docs/google/protobuf/any.rb create mode 100644 owl-bot-staging/google-iam-v2/proto_docs/google/protobuf/duration.rb create mode 100644 owl-bot-staging/google-iam-v2/proto_docs/google/protobuf/empty.rb create mode 100644 owl-bot-staging/google-iam-v2/proto_docs/google/protobuf/timestamp.rb create mode 100644 owl-bot-staging/google-iam-v2/proto_docs/google/rpc/status.rb create mode 100644 owl-bot-staging/google-iam-v2/proto_docs/google/type/expr.rb create mode 100644 owl-bot-staging/google-iam-v2/snippets/Gemfile create mode 100644 owl-bot-staging/google-iam-v2/snippets/policies/create_policy.rb create mode 100644 owl-bot-staging/google-iam-v2/snippets/policies/delete_policy.rb create mode 100644 owl-bot-staging/google-iam-v2/snippets/policies/get_policy.rb create mode 100644 owl-bot-staging/google-iam-v2/snippets/policies/list_policies.rb create mode 100644 owl-bot-staging/google-iam-v2/snippets/policies/update_policy.rb create mode 100644 owl-bot-staging/google-iam-v2/snippets/snippet_metadata_google.iam.v2.json create mode 100644 owl-bot-staging/google-iam-v2/test/google/iam/v2/policies_operations_test.rb create mode 100644 owl-bot-staging/google-iam-v2/test/google/iam/v2/policies_rest_test.rb create mode 100644 owl-bot-staging/google-iam-v2/test/google/iam/v2/policies_test.rb create mode 100644 owl-bot-staging/google-iam-v2/test/helper.rb diff --git a/owl-bot-staging/google-cloud-vision-v1p3beta1/.gitignore b/owl-bot-staging/google-cloud-vision-v1p3beta1/.gitignore new file mode 100644 index 000000000000..0135b6bc6cfc --- /dev/null +++ b/owl-bot-staging/google-cloud-vision-v1p3beta1/.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-vision-v1p3beta1/.repo-metadata.json b/owl-bot-staging/google-cloud-vision-v1p3beta1/.repo-metadata.json new file mode 100644 index 000000000000..30a5a4a4aaf9 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision-v1p3beta1/.repo-metadata.json @@ -0,0 +1,18 @@ +{ + "api_id": "vision.googleapis.com", + "api_shortname": "vision", + "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-vision-v1p3beta1/latest", + "distribution_name": "google-cloud-vision-v1p3beta1", + "is_cloud": true, + "language": "ruby", + "name": "vision", + "name_pretty": "Cloud Vision V1p3beta1 API", + "product_documentation": "https://cloud.google.com/vision", + "release_level": "unreleased", + "repo": "googleapis/google-cloud-ruby", + "requires_billing": true, + "ruby-cloud-description": "Cloud Vision API allows developers to easily integrate vision detection features within applications, including image labeling, face and landmark detection, optical character recognition (OCR), and tagging of explicit content. Note that google-cloud-vision-v1p3beta1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-vision instead. See the readme for more details.", + "ruby-cloud-env-prefix": "VISION", + "ruby-cloud-product-url": "https://cloud.google.com/vision", + "library_type": "GAPIC_AUTO" +} diff --git a/owl-bot-staging/google-cloud-vision-v1p3beta1/.rubocop.yml b/owl-bot-staging/google-cloud-vision-v1p3beta1/.rubocop.yml new file mode 100644 index 000000000000..a1a5953f98fb --- /dev/null +++ b/owl-bot-staging/google-cloud-vision-v1p3beta1/.rubocop.yml @@ -0,0 +1,33 @@ +inherit_gem: + google-style: google-style.yml + +AllCops: + Exclude: + - "google-cloud-vision-v1p3beta1.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-vision-v1p3beta1.rb" diff --git a/owl-bot-staging/google-cloud-vision-v1p3beta1/.toys.rb b/owl-bot-staging/google-cloud-vision-v1p3beta1/.toys.rb new file mode 100644 index 000000000000..177e22456e8a --- /dev/null +++ b/owl-bot-staging/google-cloud-vision-v1p3beta1/.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-vision-v1p3beta1/.yardopts b/owl-bot-staging/google-cloud-vision-v1p3beta1/.yardopts new file mode 100644 index 000000000000..bf7e43450e71 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision-v1p3beta1/.yardopts @@ -0,0 +1,12 @@ +--no-private +--title="Cloud Vision V1p3beta1 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-vision-v1p3beta1/AUTHENTICATION.md b/owl-bot-staging/google-cloud-vision-v1p3beta1/AUTHENTICATION.md new file mode 100644 index 000000000000..14862ca33879 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision-v1p3beta1/AUTHENTICATION.md @@ -0,0 +1,122 @@ +# Authentication + +The recommended way to authenticate to the google-cloud-vision-v1p3beta1 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-vision-v1p3beta1 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/vision/v1p3beta1" + +client = ::Google::Cloud::Vision::V1p3beta1::ProductSearch::Client.new do |config| + config.credentials = "path/to/credentialfile.json" +end +``` + +To configure a credentials file globally for all clients: + +```ruby +require "google/cloud/vision/v1p3beta1" + +::Google::Cloud::Vision::V1p3beta1::ProductSearch::Client.configure do |config| + config.credentials = "path/to/credentialfile.json" +end + +client = ::Google::Cloud::Vision::V1p3beta1::ProductSearch::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-vision-v1p3beta1 +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/vision/v1p3beta1" + +ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" + +client = ::Google::Cloud::Vision::V1p3beta1::ProductSearch::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-vision-v1p3beta1/CHANGELOG.md b/owl-bot-staging/google-cloud-vision-v1p3beta1/CHANGELOG.md new file mode 100644 index 000000000000..f88957a62ba2 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision-v1p3beta1/CHANGELOG.md @@ -0,0 +1,2 @@ +# Release History + diff --git a/owl-bot-staging/google-cloud-vision-v1p3beta1/Gemfile b/owl-bot-staging/google-cloud-vision-v1p3beta1/Gemfile new file mode 100644 index 000000000000..1d08558908d8 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision-v1p3beta1/Gemfile @@ -0,0 +1,14 @@ +source "https://rubygems.org" + +gemspec + +gem "google-style", "~> 1.32.0" +gem "irb", "~> 1.17" +gem "minitest", "~> 6.0.2" +gem "minitest-focus", "~> 1.4" +gem "minitest-mock", "~> 5.27" +gem "minitest-rg", "~> 5.3" +gem "ostruct", "~> 0.5.5" +gem "rake", ">= 13.0" +gem "redcarpet", "~> 3.6" +gem "yard", "~> 0.9" diff --git a/owl-bot-staging/google-cloud-vision-v1p3beta1/LICENSE.md b/owl-bot-staging/google-cloud-vision-v1p3beta1/LICENSE.md new file mode 100644 index 000000000000..c261857ba6ad --- /dev/null +++ b/owl-bot-staging/google-cloud-vision-v1p3beta1/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-vision-v1p3beta1/README.md b/owl-bot-staging/google-cloud-vision-v1p3beta1/README.md new file mode 100644 index 000000000000..ea2de28aa1ed --- /dev/null +++ b/owl-bot-staging/google-cloud-vision-v1p3beta1/README.md @@ -0,0 +1,154 @@ +# Ruby Client for the Cloud Vision V1p3beta1 API + +Integrates Google Vision features, including image labeling, face, logo, and landmark detection, optical character recognition (OCR), and detection of explicit content, into applications. + +Cloud Vision API allows developers to easily integrate vision detection features within applications, including image labeling, face and landmark detection, optical character recognition (OCR), and tagging of explicit content. + +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 Vision V1p3beta1 API. Most users should consider using +the main client gem, +[google-cloud-vision](https://rubygems.org/gems/google-cloud-vision). +See the section below titled *Which client should I use?* for more information. + +## Installation + +``` +$ gem install google-cloud-vision-v1p3beta1 +``` + +## 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/vision.googleapis.com) +1. [Set up authentication.](AUTHENTICATION.md) + +## Quick Start + +```ruby +require "google/cloud/vision/v1p3beta1" + +client = ::Google::Cloud::Vision::V1p3beta1::ProductSearch::Client.new +request = ::Google::Cloud::Vision::V1p3beta1::CreateProductSetRequest.new # (request fields as keyword arguments...) +response = client.create_product_set request +``` + +View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-vision-v1p3beta1/latest) +for class and method documentation. + +See also the [Product Documentation](https://cloud.google.com/vision) +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/vision/v1p3beta1" +require "logger" + +client = ::Google::Cloud::Vision::V1p3beta1::ProductSearch::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-vision`, +and lower-level _versioned_ client libraries with names such as +`google-cloud-vision-v1p3beta1`. +_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-vision`. +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-vision-v1p3beta1`. + +### 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-vision-v1p3beta1/Rakefile b/owl-bot-staging/google-cloud-vision-v1p3beta1/Rakefile new file mode 100644 index 000000000000..4ddeb5b558b9 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision-v1p3beta1/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-vision-v1p3beta1 acceptance tests." +task :acceptance, :project, :keyfile do |t, args| + project = args[:project] + project ||= + ENV["VISION_TEST_PROJECT"] || + ENV["GCLOUD_TEST_PROJECT"] + keyfile = args[:keyfile] + keyfile ||= + ENV["VISION_TEST_KEYFILE"] || + ENV["GCLOUD_TEST_KEYFILE"] + if keyfile + keyfile = File.read keyfile + else + keyfile ||= + ENV["VISION_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 VISION_TEST_PROJECT=test123 VISION_TEST_KEYFILE=/path/to/keyfile.json rake acceptance" + end + require "google/cloud/vision/v1p3beta1/product_search/credentials" + ::Google::Cloud::Vision::V1p3beta1::ProductSearch::Credentials.env_vars.each do |path| + ENV[path] = nil + end + ENV["VISION_PROJECT"] = project + ENV["VISION_TEST_PROJECT"] = project + ENV["VISION_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-vision-v1p3beta1 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-vision-v1p3beta1 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-vision-v1p3beta1 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-vision-v1p3beta1 gem does not have doctest tests." +end + +desc "Run the CI build" +task :ci do + header "BUILDING google-cloud-vision-v1p3beta1" + header "google-cloud-vision-v1p3beta1 rubocop", "*" + Rake::Task[:rubocop].invoke + header "google-cloud-vision-v1p3beta1 yard", "*" + Rake::Task[:yard].invoke + header "google-cloud-vision-v1p3beta1 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-vision-v1p3beta1 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-vision-v1p3beta1 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-vision-v1p3beta1/gapic_metadata.json b/owl-bot-staging/google-cloud-vision-v1p3beta1/gapic_metadata.json new file mode 100644 index 000000000000..dac137fd5f24 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision-v1p3beta1/gapic_metadata.json @@ -0,0 +1,127 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "ruby", + "protoPackage": "google.cloud.vision.v1p3beta1", + "libraryPackage": "::Google::Cloud::Vision::V1p3beta1", + "services": { + "ProductSearch": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::Vision::V1p3beta1::ProductSearch::Client", + "rpcs": { + "CreateProductSet": { + "methods": [ + "create_product_set" + ] + }, + "ListProductSets": { + "methods": [ + "list_product_sets" + ] + }, + "GetProductSet": { + "methods": [ + "get_product_set" + ] + }, + "UpdateProductSet": { + "methods": [ + "update_product_set" + ] + }, + "DeleteProductSet": { + "methods": [ + "delete_product_set" + ] + }, + "CreateProduct": { + "methods": [ + "create_product" + ] + }, + "ListProducts": { + "methods": [ + "list_products" + ] + }, + "GetProduct": { + "methods": [ + "get_product" + ] + }, + "UpdateProduct": { + "methods": [ + "update_product" + ] + }, + "DeleteProduct": { + "methods": [ + "delete_product" + ] + }, + "CreateReferenceImage": { + "methods": [ + "create_reference_image" + ] + }, + "DeleteReferenceImage": { + "methods": [ + "delete_reference_image" + ] + }, + "ListReferenceImages": { + "methods": [ + "list_reference_images" + ] + }, + "GetReferenceImage": { + "methods": [ + "get_reference_image" + ] + }, + "AddProductToProductSet": { + "methods": [ + "add_product_to_product_set" + ] + }, + "RemoveProductFromProductSet": { + "methods": [ + "remove_product_from_product_set" + ] + }, + "ListProductsInProductSet": { + "methods": [ + "list_products_in_product_set" + ] + }, + "ImportProductSets": { + "methods": [ + "import_product_sets" + ] + } + } + } + } + }, + "ImageAnnotator": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::Vision::V1p3beta1::ImageAnnotator::Client", + "rpcs": { + "BatchAnnotateImages": { + "methods": [ + "batch_annotate_images" + ] + }, + "AsyncBatchAnnotateFiles": { + "methods": [ + "async_batch_annotate_files" + ] + } + } + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-vision-v1p3beta1/google-cloud-vision-v1p3beta1.gemspec b/owl-bot-staging/google-cloud-vision-v1p3beta1/google-cloud-vision-v1p3beta1.gemspec new file mode 100644 index 000000000000..931107b4720f --- /dev/null +++ b/owl-bot-staging/google-cloud-vision-v1p3beta1/google-cloud-vision-v1p3beta1.gemspec @@ -0,0 +1,28 @@ +# -*- ruby -*- +# encoding: utf-8 + +require File.expand_path("lib/google/cloud/vision/v1p3beta1/version", __dir__) + +Gem::Specification.new do |gem| + gem.name = "google-cloud-vision-v1p3beta1" + gem.version = Google::Cloud::Vision::V1p3beta1::VERSION + + gem.authors = ["Google LLC"] + gem.email = "googleapis-packages@google.com" + gem.description = "Cloud Vision API allows developers to easily integrate vision detection features within applications, including image labeling, face and landmark detection, optical character recognition (OCR), and tagging of explicit content. Note that google-cloud-vision-v1p3beta1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-vision instead. See the readme for more details." + gem.summary = "Integrates Google Vision features, including image labeling, face, logo, and landmark detection, optical character recognition (OCR), and detection of explicit content, into 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.2" + + gem.add_dependency "gapic-common", "~> 1.2" + gem.add_dependency "google-cloud-errors", "~> 1.0" +end diff --git a/owl-bot-staging/google-cloud-vision-v1p3beta1/lib/google-cloud-vision-v1p3beta1.rb b/owl-bot-staging/google-cloud-vision-v1p3beta1/lib/google-cloud-vision-v1p3beta1.rb new file mode 100644 index 000000000000..e1b1874d5d61 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision-v1p3beta1/lib/google-cloud-vision-v1p3beta1.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/vision/v1p3beta1" diff --git a/owl-bot-staging/google-cloud-vision-v1p3beta1/lib/google/cloud/vision/v1p3beta1.rb b/owl-bot-staging/google-cloud-vision-v1p3beta1/lib/google/cloud/vision/v1p3beta1.rb new file mode 100644 index 000000000000..0bf1423aef5b --- /dev/null +++ b/owl-bot-staging/google-cloud-vision-v1p3beta1/lib/google/cloud/vision/v1p3beta1.rb @@ -0,0 +1,46 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/vision/v1p3beta1/product_search" +require "google/cloud/vision/v1p3beta1/image_annotator" +require "google/cloud/vision/v1p3beta1/version" + +module Google + module Cloud + module Vision + ## + # API client module. + # + # @example Load this package, including all its services, and instantiate a gRPC client + # + # require "google/cloud/vision/v1p3beta1" + # client = ::Google::Cloud::Vision::V1p3beta1::ProductSearch::Client.new + # + # @example Load this package, including all its services, and instantiate a REST client + # + # require "google/cloud/vision/v1p3beta1" + # client = ::Google::Cloud::Vision::V1p3beta1::ProductSearch::Rest::Client.new + # + module V1p3beta1 + end + end + end +end + +helper_path = ::File.join __dir__, "v1p3beta1", "_helpers.rb" +require "google/cloud/vision/v1p3beta1/_helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-vision-v1p3beta1/lib/google/cloud/vision/v1p3beta1/geometry_pb.rb b/owl-bot-staging/google-cloud-vision-v1p3beta1/lib/google/cloud/vision/v1p3beta1/geometry_pb.rb new file mode 100644 index 000000000000..b934be0f3ef7 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision-v1p3beta1/lib/google/cloud/vision/v1p3beta1/geometry_pb.rb @@ -0,0 +1,24 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/vision/v1p3beta1/geometry.proto + +require 'google/protobuf' + + +descriptor_data = "\n,google/cloud/vision/v1p3beta1/geometry.proto\x12\x1dgoogle.cloud.vision.v1p3beta1\"\x1e\n\x06Vertex\x12\t\n\x01x\x18\x01 \x01(\x05\x12\t\n\x01y\x18\x02 \x01(\x05\"(\n\x10NormalizedVertex\x12\t\n\x01x\x18\x01 \x01(\x02\x12\t\n\x01y\x18\x02 \x01(\x02\"\x95\x01\n\x0c\x42oundingPoly\x12\x37\n\x08vertices\x18\x01 \x03(\x0b\x32%.google.cloud.vision.v1p3beta1.Vertex\x12L\n\x13normalized_vertices\x18\x02 \x03(\x0b\x32/.google.cloud.vision.v1p3beta1.NormalizedVertex\"+\n\x08Position\x12\t\n\x01x\x18\x01 \x01(\x02\x12\t\n\x01y\x18\x02 \x01(\x02\x12\t\n\x01z\x18\x03 \x01(\x02\x42y\n!com.google.cloud.vision.v1p3beta1B\rGeometryProtoP\x01Z9cloud.google.com/go/vision/apiv1p3beta1/visionpb;visionpb\xf8\x01\x01\xa2\x02\x04GCVNb\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module Vision + module V1p3beta1 + Vertex = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p3beta1.Vertex").msgclass + NormalizedVertex = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p3beta1.NormalizedVertex").msgclass + BoundingPoly = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p3beta1.BoundingPoly").msgclass + Position = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p3beta1.Position").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-vision-v1p3beta1/lib/google/cloud/vision/v1p3beta1/image_annotator.rb b/owl-bot-staging/google-cloud-vision-v1p3beta1/lib/google/cloud/vision/v1p3beta1/image_annotator.rb new file mode 100644 index 000000000000..84650572725f --- /dev/null +++ b/owl-bot-staging/google-cloud-vision-v1p3beta1/lib/google/cloud/vision/v1p3beta1/image_annotator.rb @@ -0,0 +1,58 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/vision/v1p3beta1/version" + +require "google/cloud/vision/v1p3beta1/image_annotator/credentials" +require "google/cloud/vision/v1p3beta1/image_annotator/paths" +require "google/cloud/vision/v1p3beta1/image_annotator/operations" +require "google/cloud/vision/v1p3beta1/image_annotator/client" +require "google/cloud/vision/v1p3beta1/image_annotator/rest" + +module Google + module Cloud + module Vision + module V1p3beta1 + ## + # Service that performs Google Cloud Vision API detection tasks over client + # images, such as face, landmark, logo, label, and text detection. The + # ImageAnnotator service returns detected entities from the images. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/vision/v1p3beta1/image_annotator" + # client = ::Google::Cloud::Vision::V1p3beta1::ImageAnnotator::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/vision/v1p3beta1/image_annotator/rest" + # client = ::Google::Cloud::Vision::V1p3beta1::ImageAnnotator::Rest::Client.new + # + module ImageAnnotator + end + end + end + end +end + +helper_path = ::File.join __dir__, "image_annotator", "helpers.rb" +require "google/cloud/vision/v1p3beta1/image_annotator/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-vision-v1p3beta1/lib/google/cloud/vision/v1p3beta1/image_annotator/client.rb b/owl-bot-staging/google-cloud-vision-v1p3beta1/lib/google/cloud/vision/v1p3beta1/image_annotator/client.rb new file mode 100644 index 000000000000..eb6c7473f064 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision-v1p3beta1/lib/google/cloud/vision/v1p3beta1/image_annotator/client.rb @@ -0,0 +1,590 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/vision/v1p3beta1/image_annotator_pb" + +module Google + module Cloud + module Vision + module V1p3beta1 + module ImageAnnotator + ## + # Client for the ImageAnnotator service. + # + # Service that performs Google Cloud Vision API detection tasks over client + # images, such as face, landmark, logo, label, and text detection. The + # ImageAnnotator service returns detected entities from the images. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "vision.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :image_annotator_stub + + ## + # Configure the ImageAnnotator Client class. + # + # See {::Google::Cloud::Vision::V1p3beta1::ImageAnnotator::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all ImageAnnotator clients + # ::Google::Cloud::Vision::V1p3beta1::ImageAnnotator::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", "Vision", "V1p3beta1"] + 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.batch_annotate_images.timeout = 600.0 + default_config.rpcs.batch_annotate_images.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.async_batch_annotate_files.timeout = 600.0 + default_config.rpcs.async_batch_annotate_files.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the ImageAnnotator 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::Vision::V1p3beta1::ImageAnnotator::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 + @image_annotator_stub.universe_domain + end + + ## + # Create a new ImageAnnotator client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Vision::V1p3beta1::ImageAnnotator::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Vision::V1p3beta1::ImageAnnotator::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the ImageAnnotator 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/vision/v1p3beta1/image_annotator_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 + + @image_annotator_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::Vision::V1p3beta1::ImageAnnotator::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 + ) + + @image_annotator_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 + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::Vision::V1p3beta1::ImageAnnotator::Operations] + # + attr_reader :operations_client + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @image_annotator_stub.logger + end + + # Service calls + + ## + # Run image detection and annotation for a batch of images. + # + # @overload batch_annotate_images(request, options = nil) + # Pass arguments to `batch_annotate_images` via a request object, either of type + # {::Google::Cloud::Vision::V1p3beta1::BatchAnnotateImagesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Vision::V1p3beta1::BatchAnnotateImagesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload batch_annotate_images(requests: nil) + # Pass arguments to `batch_annotate_images` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param requests [::Array<::Google::Cloud::Vision::V1p3beta1::AnnotateImageRequest, ::Hash>] + # Individual image annotation requests for this batch. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Vision::V1p3beta1::BatchAnnotateImagesResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Vision::V1p3beta1::BatchAnnotateImagesResponse] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/vision/v1p3beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Vision::V1p3beta1::ImageAnnotator::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Vision::V1p3beta1::BatchAnnotateImagesRequest.new + # + # # Call the batch_annotate_images method. + # result = client.batch_annotate_images request + # + # # The returned object is of type Google::Cloud::Vision::V1p3beta1::BatchAnnotateImagesResponse. + # p result + # + def batch_annotate_images request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Vision::V1p3beta1::BatchAnnotateImagesRequest + + # Converts hash 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.batch_annotate_images.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::Vision::V1p3beta1::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.batch_annotate_images.timeout, + metadata: metadata, + retry_policy: @config.rpcs.batch_annotate_images.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @image_annotator_stub.call_rpc :batch_annotate_images, 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 + + ## + # Run asynchronous image detection and annotation for a list of generic + # files, such as PDF files, which may contain multiple pages and multiple + # images per page. Progress and results can be retrieved through the + # `google.longrunning.Operations` interface. + # `Operation.metadata` contains `OperationMetadata` (metadata). + # `Operation.response` contains `AsyncBatchAnnotateFilesResponse` (results). + # + # @overload async_batch_annotate_files(request, options = nil) + # Pass arguments to `async_batch_annotate_files` via a request object, either of type + # {::Google::Cloud::Vision::V1p3beta1::AsyncBatchAnnotateFilesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Vision::V1p3beta1::AsyncBatchAnnotateFilesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload async_batch_annotate_files(requests: nil) + # Pass arguments to `async_batch_annotate_files` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param requests [::Array<::Google::Cloud::Vision::V1p3beta1::AsyncAnnotateFileRequest, ::Hash>] + # Required. Individual async file annotation requests for this batch. + # + # @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/vision/v1p3beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Vision::V1p3beta1::ImageAnnotator::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Vision::V1p3beta1::AsyncBatchAnnotateFilesRequest.new + # + # # Call the async_batch_annotate_files method. + # result = client.async_batch_annotate_files 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 async_batch_annotate_files request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Vision::V1p3beta1::AsyncBatchAnnotateFilesRequest + + # Converts hash 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.async_batch_annotate_files.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::Vision::V1p3beta1::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.async_batch_annotate_files.timeout, + metadata: metadata, + retry_policy: @config.rpcs.async_batch_annotate_files.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @image_annotator_stub.call_rpc :async_batch_annotate_files, 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 ImageAnnotator API. + # + # This class represents the configuration for ImageAnnotator, + # 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::Vision::V1p3beta1::ImageAnnotator::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 + # # batch_annotate_images to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Vision::V1p3beta1::ImageAnnotator::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.batch_annotate_images.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Vision::V1p3beta1::ImageAnnotator::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.batch_annotate_images.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::Vision::V1p3beta1::ImageAnnotator::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 = "vision.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 ImageAnnotator 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 `batch_annotate_images` + # @return [::Gapic::Config::Method] + # + attr_reader :batch_annotate_images + ## + # RPC-specific configuration for `async_batch_annotate_files` + # @return [::Gapic::Config::Method] + # + attr_reader :async_batch_annotate_files + + # @private + def initialize parent_rpcs = nil + batch_annotate_images_config = parent_rpcs.batch_annotate_images if parent_rpcs.respond_to? :batch_annotate_images + @batch_annotate_images = ::Gapic::Config::Method.new batch_annotate_images_config + async_batch_annotate_files_config = parent_rpcs.async_batch_annotate_files if parent_rpcs.respond_to? :async_batch_annotate_files + @async_batch_annotate_files = ::Gapic::Config::Method.new async_batch_annotate_files_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-vision-v1p3beta1/lib/google/cloud/vision/v1p3beta1/image_annotator/credentials.rb b/owl-bot-staging/google-cloud-vision-v1p3beta1/lib/google/cloud/vision/v1p3beta1/image_annotator/credentials.rb new file mode 100644 index 000000000000..1e1740f8329e --- /dev/null +++ b/owl-bot-staging/google-cloud-vision-v1p3beta1/lib/google/cloud/vision/v1p3beta1/image_annotator/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 Vision + module V1p3beta1 + module ImageAnnotator + # Credentials for the ImageAnnotator API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-vision" + ] + self.env_vars = [ + "VISION_CREDENTIALS", + "VISION_KEYFILE", + "GOOGLE_CLOUD_CREDENTIALS", + "GOOGLE_CLOUD_KEYFILE", + "GCLOUD_KEYFILE", + "VISION_CREDENTIALS_JSON", + "VISION_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-vision-v1p3beta1/lib/google/cloud/vision/v1p3beta1/image_annotator/operations.rb b/owl-bot-staging/google-cloud-vision-v1p3beta1/lib/google/cloud/vision/v1p3beta1/image_annotator/operations.rb new file mode 100644 index 000000000000..12bd396910d5 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision-v1p3beta1/lib/google/cloud/vision/v1p3beta1/image_annotator/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 Vision + module V1p3beta1 + module ImageAnnotator + # Service that implements Longrunning Operations API. + class Operations + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "vision.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :operations_stub + + ## + # Configuration for the ImageAnnotator 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 ImageAnnotator 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::Vision::V1p3beta1::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::Vision::V1p3beta1::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::Vision::V1p3beta1::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::Vision::V1p3beta1::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::Vision::V1p3beta1::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 = "vision.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-vision-v1p3beta1/lib/google/cloud/vision/v1p3beta1/image_annotator/paths.rb b/owl-bot-staging/google-cloud-vision-v1p3beta1/lib/google/cloud/vision/v1p3beta1/image_annotator/paths.rb new file mode 100644 index 000000000000..98b4b7b34af3 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision-v1p3beta1/lib/google/cloud/vision/v1p3beta1/image_annotator/paths.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! + + +module Google + module Cloud + module Vision + module V1p3beta1 + module ImageAnnotator + # Path helper methods for the ImageAnnotator API. + module Paths + ## + # Create a fully-qualified ProductSet resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/productSets/{product_set}` + # + # @param project [String] + # @param location [String] + # @param product_set [String] + # + # @return [::String] + def product_set_path project:, location:, product_set: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/productSets/#{product_set}" + end + + extend self + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-vision-v1p3beta1/lib/google/cloud/vision/v1p3beta1/image_annotator/rest.rb b/owl-bot-staging/google-cloud-vision-v1p3beta1/lib/google/cloud/vision/v1p3beta1/image_annotator/rest.rb new file mode 100644 index 000000000000..3536e3389641 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision-v1p3beta1/lib/google/cloud/vision/v1p3beta1/image_annotator/rest.rb @@ -0,0 +1,55 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/vision/v1p3beta1/version" + +require "google/cloud/vision/v1p3beta1/image_annotator/credentials" +require "google/cloud/vision/v1p3beta1/image_annotator/paths" +require "google/cloud/vision/v1p3beta1/image_annotator/rest/operations" +require "google/cloud/vision/v1p3beta1/image_annotator/rest/client" + +module Google + module Cloud + module Vision + module V1p3beta1 + ## + # Service that performs Google Cloud Vision API detection tasks over client + # images, such as face, landmark, logo, label, and text detection. The + # ImageAnnotator service returns detected entities from the images. + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/vision/v1p3beta1/image_annotator/rest" + # client = ::Google::Cloud::Vision::V1p3beta1::ImageAnnotator::Rest::Client.new + # + module ImageAnnotator + # Client for the REST transport + module Rest + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "rest", "helpers.rb" +require "google/cloud/vision/v1p3beta1/image_annotator/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-vision-v1p3beta1/lib/google/cloud/vision/v1p3beta1/image_annotator/rest/client.rb b/owl-bot-staging/google-cloud-vision-v1p3beta1/lib/google/cloud/vision/v1p3beta1/image_annotator/rest/client.rb new file mode 100644 index 000000000000..cc28aa72ad67 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision-v1p3beta1/lib/google/cloud/vision/v1p3beta1/image_annotator/rest/client.rb @@ -0,0 +1,549 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/vision/v1p3beta1/image_annotator_pb" +require "google/cloud/vision/v1p3beta1/image_annotator/rest/service_stub" + +module Google + module Cloud + module Vision + module V1p3beta1 + module ImageAnnotator + module Rest + ## + # REST client for the ImageAnnotator service. + # + # Service that performs Google Cloud Vision API detection tasks over client + # images, such as face, landmark, logo, label, and text detection. The + # ImageAnnotator service returns detected entities from the images. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "vision.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :image_annotator_stub + + ## + # Configure the ImageAnnotator Client class. + # + # See {::Google::Cloud::Vision::V1p3beta1::ImageAnnotator::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all ImageAnnotator clients + # ::Google::Cloud::Vision::V1p3beta1::ImageAnnotator::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", "Vision", "V1p3beta1"] + 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.batch_annotate_images.timeout = 600.0 + default_config.rpcs.batch_annotate_images.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.async_batch_annotate_files.timeout = 600.0 + default_config.rpcs.async_batch_annotate_files.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the ImageAnnotator 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::Vision::V1p3beta1::ImageAnnotator::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 + @image_annotator_stub.universe_domain + end + + ## + # Create a new ImageAnnotator REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Vision::V1p3beta1::ImageAnnotator::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Vision::V1p3beta1::ImageAnnotator::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the ImageAnnotator 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::Vision::V1p3beta1::ImageAnnotator::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 + + @image_annotator_stub = ::Google::Cloud::Vision::V1p3beta1::ImageAnnotator::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials, + logger: @config.logger + ) + + @image_annotator_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 + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::Vision::V1p3beta1::ImageAnnotator::Rest::Operations] + # + attr_reader :operations_client + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @image_annotator_stub.logger + end + + # Service calls + + ## + # Run image detection and annotation for a batch of images. + # + # @overload batch_annotate_images(request, options = nil) + # Pass arguments to `batch_annotate_images` via a request object, either of type + # {::Google::Cloud::Vision::V1p3beta1::BatchAnnotateImagesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Vision::V1p3beta1::BatchAnnotateImagesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload batch_annotate_images(requests: nil) + # Pass arguments to `batch_annotate_images` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param requests [::Array<::Google::Cloud::Vision::V1p3beta1::AnnotateImageRequest, ::Hash>] + # Individual image annotation requests for this batch. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Vision::V1p3beta1::BatchAnnotateImagesResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Vision::V1p3beta1::BatchAnnotateImagesResponse] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/vision/v1p3beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Vision::V1p3beta1::ImageAnnotator::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Vision::V1p3beta1::BatchAnnotateImagesRequest.new + # + # # Call the batch_annotate_images method. + # result = client.batch_annotate_images request + # + # # The returned object is of type Google::Cloud::Vision::V1p3beta1::BatchAnnotateImagesResponse. + # p result + # + def batch_annotate_images request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Vision::V1p3beta1::BatchAnnotateImagesRequest + + # Converts hash 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.batch_annotate_images.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::Vision::V1p3beta1::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.batch_annotate_images.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.batch_annotate_images.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @image_annotator_stub.batch_annotate_images 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 + + ## + # Run asynchronous image detection and annotation for a list of generic + # files, such as PDF files, which may contain multiple pages and multiple + # images per page. Progress and results can be retrieved through the + # `google.longrunning.Operations` interface. + # `Operation.metadata` contains `OperationMetadata` (metadata). + # `Operation.response` contains `AsyncBatchAnnotateFilesResponse` (results). + # + # @overload async_batch_annotate_files(request, options = nil) + # Pass arguments to `async_batch_annotate_files` via a request object, either of type + # {::Google::Cloud::Vision::V1p3beta1::AsyncBatchAnnotateFilesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Vision::V1p3beta1::AsyncBatchAnnotateFilesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload async_batch_annotate_files(requests: nil) + # Pass arguments to `async_batch_annotate_files` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param requests [::Array<::Google::Cloud::Vision::V1p3beta1::AsyncAnnotateFileRequest, ::Hash>] + # Required. Individual async file annotation requests for this batch. + # @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/vision/v1p3beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Vision::V1p3beta1::ImageAnnotator::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Vision::V1p3beta1::AsyncBatchAnnotateFilesRequest.new + # + # # Call the async_batch_annotate_files method. + # result = client.async_batch_annotate_files 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 async_batch_annotate_files request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Vision::V1p3beta1::AsyncBatchAnnotateFilesRequest + + # Converts hash 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.async_batch_annotate_files.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::Vision::V1p3beta1::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.async_batch_annotate_files.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.async_batch_annotate_files.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @image_annotator_stub.async_batch_annotate_files 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 + + ## + # Configuration class for the ImageAnnotator REST API. + # + # This class represents the configuration for ImageAnnotator 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::Vision::V1p3beta1::ImageAnnotator::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 + # # batch_annotate_images to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Vision::V1p3beta1::ImageAnnotator::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.batch_annotate_images.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Vision::V1p3beta1::ImageAnnotator::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.batch_annotate_images.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 = "vision.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 ImageAnnotator 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 `batch_annotate_images` + # @return [::Gapic::Config::Method] + # + attr_reader :batch_annotate_images + ## + # RPC-specific configuration for `async_batch_annotate_files` + # @return [::Gapic::Config::Method] + # + attr_reader :async_batch_annotate_files + + # @private + def initialize parent_rpcs = nil + batch_annotate_images_config = parent_rpcs.batch_annotate_images if parent_rpcs.respond_to? :batch_annotate_images + @batch_annotate_images = ::Gapic::Config::Method.new batch_annotate_images_config + async_batch_annotate_files_config = parent_rpcs.async_batch_annotate_files if parent_rpcs.respond_to? :async_batch_annotate_files + @async_batch_annotate_files = ::Gapic::Config::Method.new async_batch_annotate_files_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-vision-v1p3beta1/lib/google/cloud/vision/v1p3beta1/image_annotator/rest/operations.rb b/owl-bot-staging/google-cloud-vision-v1p3beta1/lib/google/cloud/vision/v1p3beta1/image_annotator/rest/operations.rb new file mode 100644 index 000000000000..7001792ef50e --- /dev/null +++ b/owl-bot-staging/google-cloud-vision-v1p3beta1/lib/google/cloud/vision/v1p3beta1/image_annotator/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 Vision + module V1p3beta1 + module ImageAnnotator + module Rest + # Service that implements Longrunning Operations API. + class Operations + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "vision.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :operations_stub + + ## + # Configuration for the ImageAnnotator 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 ImageAnnotator 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::Vision::V1p3beta1::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::Vision::V1p3beta1::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::Vision::V1p3beta1::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::Vision::V1p3beta1::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 = "vision.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{^operations(?:/.*)?$}, true] + ] + ) + 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-vision-v1p3beta1/lib/google/cloud/vision/v1p3beta1/image_annotator/rest/service_stub.rb b/owl-bot-staging/google-cloud-vision-v1p3beta1/lib/google/cloud/vision/v1p3beta1/image_annotator/rest/service_stub.rb new file mode 100644 index 000000000000..be1f56c5d62e --- /dev/null +++ b/owl-bot-staging/google-cloud-vision-v1p3beta1/lib/google/cloud/vision/v1p3beta1/image_annotator/rest/service_stub.rb @@ -0,0 +1,201 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/vision/v1p3beta1/image_annotator_pb" + +module Google + module Cloud + module Vision + module V1p3beta1 + module ImageAnnotator + module Rest + ## + # REST service stub for the ImageAnnotator 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 batch_annotate_images REST call + # + # @param request_pb [::Google::Cloud::Vision::V1p3beta1::BatchAnnotateImagesRequest] + # 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::Vision::V1p3beta1::BatchAnnotateImagesResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Vision::V1p3beta1::BatchAnnotateImagesResponse] + # A result object deserialized from the server's reply + def batch_annotate_images request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_batch_annotate_images_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: "batch_annotate_images", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Vision::V1p3beta1::BatchAnnotateImagesResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the async_batch_annotate_files REST call + # + # @param request_pb [::Google::Cloud::Vision::V1p3beta1::AsyncBatchAnnotateFilesRequest] + # 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 async_batch_annotate_files request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_async_batch_annotate_files_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: "async_batch_annotate_files", + 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 + + ## + # @private + # + # GRPC transcoding helper method for the batch_annotate_images REST call + # + # @param request_pb [::Google::Cloud::Vision::V1p3beta1::BatchAnnotateImagesRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_batch_annotate_images_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1p3beta1/images:annotate", + body: "*", + matches: [] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the async_batch_annotate_files REST call + # + # @param request_pb [::Google::Cloud::Vision::V1p3beta1::AsyncBatchAnnotateFilesRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_async_batch_annotate_files_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1p3beta1/files:asyncBatchAnnotate", + body: "*", + matches: [] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-vision-v1p3beta1/lib/google/cloud/vision/v1p3beta1/image_annotator_pb.rb b/owl-bot-staging/google-cloud-vision-v1p3beta1/lib/google/cloud/vision/v1p3beta1/image_annotator_pb.rb new file mode 100644 index 000000000000..2143defa89f2 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision-v1p3beta1/lib/google/cloud/vision/v1p3beta1/image_annotator_pb.rb @@ -0,0 +1,72 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/vision/v1p3beta1/image_annotator.proto + +require 'google/protobuf' + +require 'google/api/annotations_pb' +require 'google/api/client_pb' +require 'google/api/field_behavior_pb' +require 'google/cloud/vision/v1p3beta1/geometry_pb' +require 'google/cloud/vision/v1p3beta1/product_search_pb' +require 'google/cloud/vision/v1p3beta1/text_annotation_pb' +require 'google/cloud/vision/v1p3beta1/web_detection_pb' +require 'google/longrunning/operations_pb' +require 'google/protobuf/timestamp_pb' +require 'google/rpc/status_pb' +require 'google/type/color_pb' +require 'google/type/latlng_pb' + + +descriptor_data = "\n3google/cloud/vision/v1p3beta1/image_annotator.proto\x12\x1dgoogle.cloud.vision.v1p3beta1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a,google/cloud/vision/v1p3beta1/geometry.proto\x1a\x32google/cloud/vision/v1p3beta1/product_search.proto\x1a\x33google/cloud/vision/v1p3beta1/text_annotation.proto\x1a\x31google/cloud/vision/v1p3beta1/web_detection.proto\x1a#google/longrunning/operations.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x17google/rpc/status.proto\x1a\x17google/type/color.proto\x1a\x18google/type/latlng.proto\"\x8e\x03\n\x07\x46\x65\x61ture\x12\x39\n\x04type\x18\x01 \x01(\x0e\x32+.google.cloud.vision.v1p3beta1.Feature.Type\x12\x13\n\x0bmax_results\x18\x02 \x01(\x05\x12\r\n\x05model\x18\x03 \x01(\t\"\xa3\x02\n\x04Type\x12\x14\n\x10TYPE_UNSPECIFIED\x10\x00\x12\x12\n\x0e\x46\x41\x43\x45_DETECTION\x10\x01\x12\x16\n\x12LANDMARK_DETECTION\x10\x02\x12\x12\n\x0eLOGO_DETECTION\x10\x03\x12\x13\n\x0fLABEL_DETECTION\x10\x04\x12\x12\n\x0eTEXT_DETECTION\x10\x05\x12\x1b\n\x17\x44OCUMENT_TEXT_DETECTION\x10\x0b\x12\x19\n\x15SAFE_SEARCH_DETECTION\x10\x06\x12\x14\n\x10IMAGE_PROPERTIES\x10\x07\x12\x0e\n\nCROP_HINTS\x10\t\x12\x11\n\rWEB_DETECTION\x10\n\x12\x12\n\x0ePRODUCT_SEARCH\x10\x0c\x12\x17\n\x13OBJECT_LOCALIZATION\x10\x13\"7\n\x0bImageSource\x12\x15\n\rgcs_image_uri\x18\x01 \x01(\t\x12\x11\n\timage_uri\x18\x02 \x01(\t\"T\n\x05Image\x12\x0f\n\x07\x63ontent\x18\x01 \x01(\x0c\x12:\n\x06source\x18\x02 \x01(\x0b\x32*.google.cloud.vision.v1p3beta1.ImageSource\"\x9b\x0e\n\x0e\x46\x61\x63\x65\x41nnotation\x12\x42\n\rbounding_poly\x18\x01 \x01(\x0b\x32+.google.cloud.vision.v1p3beta1.BoundingPoly\x12\x45\n\x10\x66\x64_bounding_poly\x18\x02 \x01(\x0b\x32+.google.cloud.vision.v1p3beta1.BoundingPoly\x12I\n\tlandmarks\x18\x03 \x03(\x0b\x32\x36.google.cloud.vision.v1p3beta1.FaceAnnotation.Landmark\x12\x12\n\nroll_angle\x18\x04 \x01(\x02\x12\x11\n\tpan_angle\x18\x05 \x01(\x02\x12\x12\n\ntilt_angle\x18\x06 \x01(\x02\x12\x1c\n\x14\x64\x65tection_confidence\x18\x07 \x01(\x02\x12\x1e\n\x16landmarking_confidence\x18\x08 \x01(\x02\x12\x41\n\x0ejoy_likelihood\x18\t \x01(\x0e\x32).google.cloud.vision.v1p3beta1.Likelihood\x12\x44\n\x11sorrow_likelihood\x18\n \x01(\x0e\x32).google.cloud.vision.v1p3beta1.Likelihood\x12\x43\n\x10\x61nger_likelihood\x18\x0b \x01(\x0e\x32).google.cloud.vision.v1p3beta1.Likelihood\x12\x46\n\x13surprise_likelihood\x18\x0c \x01(\x0e\x32).google.cloud.vision.v1p3beta1.Likelihood\x12K\n\x18under_exposed_likelihood\x18\r \x01(\x0e\x32).google.cloud.vision.v1p3beta1.Likelihood\x12\x45\n\x12\x62lurred_likelihood\x18\x0e \x01(\x0e\x32).google.cloud.vision.v1p3beta1.Likelihood\x12\x46\n\x13headwear_likelihood\x18\x0f \x01(\x0e\x32).google.cloud.vision.v1p3beta1.Likelihood\x1a\xc7\x07\n\x08Landmark\x12I\n\x04type\x18\x03 \x01(\x0e\x32;.google.cloud.vision.v1p3beta1.FaceAnnotation.Landmark.Type\x12\x39\n\x08position\x18\x04 \x01(\x0b\x32\'.google.cloud.vision.v1p3beta1.Position\"\xb4\x06\n\x04Type\x12\x14\n\x10UNKNOWN_LANDMARK\x10\x00\x12\x0c\n\x08LEFT_EYE\x10\x01\x12\r\n\tRIGHT_EYE\x10\x02\x12\x18\n\x14LEFT_OF_LEFT_EYEBROW\x10\x03\x12\x19\n\x15RIGHT_OF_LEFT_EYEBROW\x10\x04\x12\x19\n\x15LEFT_OF_RIGHT_EYEBROW\x10\x05\x12\x1a\n\x16RIGHT_OF_RIGHT_EYEBROW\x10\x06\x12\x19\n\x15MIDPOINT_BETWEEN_EYES\x10\x07\x12\x0c\n\x08NOSE_TIP\x10\x08\x12\r\n\tUPPER_LIP\x10\t\x12\r\n\tLOWER_LIP\x10\n\x12\x0e\n\nMOUTH_LEFT\x10\x0b\x12\x0f\n\x0bMOUTH_RIGHT\x10\x0c\x12\x10\n\x0cMOUTH_CENTER\x10\r\x12\x15\n\x11NOSE_BOTTOM_RIGHT\x10\x0e\x12\x14\n\x10NOSE_BOTTOM_LEFT\x10\x0f\x12\x16\n\x12NOSE_BOTTOM_CENTER\x10\x10\x12\x19\n\x15LEFT_EYE_TOP_BOUNDARY\x10\x11\x12\x19\n\x15LEFT_EYE_RIGHT_CORNER\x10\x12\x12\x1c\n\x18LEFT_EYE_BOTTOM_BOUNDARY\x10\x13\x12\x18\n\x14LEFT_EYE_LEFT_CORNER\x10\x14\x12\x1a\n\x16RIGHT_EYE_TOP_BOUNDARY\x10\x15\x12\x1a\n\x16RIGHT_EYE_RIGHT_CORNER\x10\x16\x12\x1d\n\x19RIGHT_EYE_BOTTOM_BOUNDARY\x10\x17\x12\x19\n\x15RIGHT_EYE_LEFT_CORNER\x10\x18\x12\x1f\n\x1bLEFT_EYEBROW_UPPER_MIDPOINT\x10\x19\x12 \n\x1cRIGHT_EYEBROW_UPPER_MIDPOINT\x10\x1a\x12\x14\n\x10LEFT_EAR_TRAGION\x10\x1b\x12\x15\n\x11RIGHT_EAR_TRAGION\x10\x1c\x12\x12\n\x0eLEFT_EYE_PUPIL\x10\x1d\x12\x13\n\x0fRIGHT_EYE_PUPIL\x10\x1e\x12\x15\n\x11\x46OREHEAD_GLABELLA\x10\x1f\x12\x11\n\rCHIN_GNATHION\x10 \x12\x14\n\x10\x43HIN_LEFT_GONION\x10!\x12\x15\n\x11\x43HIN_RIGHT_GONION\x10\"\"4\n\x0cLocationInfo\x12$\n\x07lat_lng\x18\x01 \x01(\x0b\x32\x13.google.type.LatLng\"=\n\x08Property\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t\x12\x14\n\x0cuint64_value\x18\x03 \x01(\x04\"\xbc\x02\n\x10\x45ntityAnnotation\x12\x0b\n\x03mid\x18\x01 \x01(\t\x12\x0e\n\x06locale\x18\x02 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x03 \x01(\t\x12\r\n\x05score\x18\x04 \x01(\x02\x12\x12\n\nconfidence\x18\x05 \x01(\x02\x12\x12\n\ntopicality\x18\x06 \x01(\x02\x12\x42\n\rbounding_poly\x18\x07 \x01(\x0b\x32+.google.cloud.vision.v1p3beta1.BoundingPoly\x12>\n\tlocations\x18\x08 \x03(\x0b\x32+.google.cloud.vision.v1p3beta1.LocationInfo\x12;\n\nproperties\x18\t \x03(\x0b\x32\'.google.cloud.vision.v1p3beta1.Property\"\xa0\x01\n\x19LocalizedObjectAnnotation\x12\x0b\n\x03mid\x18\x01 \x01(\t\x12\x15\n\rlanguage_code\x18\x02 \x01(\t\x12\x0c\n\x04name\x18\x03 \x01(\t\x12\r\n\x05score\x18\x04 \x01(\x02\x12\x42\n\rbounding_poly\x18\x05 \x01(\x0b\x32+.google.cloud.vision.v1p3beta1.BoundingPoly\"\xbc\x02\n\x14SafeSearchAnnotation\x12\x38\n\x05\x61\x64ult\x18\x01 \x01(\x0e\x32).google.cloud.vision.v1p3beta1.Likelihood\x12\x38\n\x05spoof\x18\x02 \x01(\x0e\x32).google.cloud.vision.v1p3beta1.Likelihood\x12:\n\x07medical\x18\x03 \x01(\x0e\x32).google.cloud.vision.v1p3beta1.Likelihood\x12;\n\x08violence\x18\x04 \x01(\x0e\x32).google.cloud.vision.v1p3beta1.Likelihood\x12\x37\n\x04racy\x18\t \x01(\x0e\x32).google.cloud.vision.v1p3beta1.Likelihood\"a\n\x0bLatLongRect\x12(\n\x0bmin_lat_lng\x18\x01 \x01(\x0b\x32\x13.google.type.LatLng\x12(\n\x0bmax_lat_lng\x18\x02 \x01(\x0b\x32\x13.google.type.LatLng\"U\n\tColorInfo\x12!\n\x05\x63olor\x18\x01 \x01(\x0b\x32\x12.google.type.Color\x12\r\n\x05score\x18\x02 \x01(\x02\x12\x16\n\x0epixel_fraction\x18\x03 \x01(\x02\"T\n\x18\x44ominantColorsAnnotation\x12\x38\n\x06\x63olors\x18\x01 \x03(\x0b\x32(.google.cloud.vision.v1p3beta1.ColorInfo\"c\n\x0fImageProperties\x12P\n\x0f\x64ominant_colors\x18\x01 \x01(\x0b\x32\x37.google.cloud.vision.v1p3beta1.DominantColorsAnnotation\"\x7f\n\x08\x43ropHint\x12\x42\n\rbounding_poly\x18\x01 \x01(\x0b\x32+.google.cloud.vision.v1p3beta1.BoundingPoly\x12\x12\n\nconfidence\x18\x02 \x01(\x02\x12\x1b\n\x13importance_fraction\x18\x03 \x01(\x02\"R\n\x13\x43ropHintsAnnotation\x12;\n\ncrop_hints\x18\x01 \x03(\x0b\x32\'.google.cloud.vision.v1p3beta1.CropHint\"(\n\x0f\x43ropHintsParams\x12\x15\n\raspect_ratios\x18\x01 \x03(\x02\"1\n\x12WebDetectionParams\x12\x1b\n\x13include_geo_results\x18\x02 \x01(\x08\"c\n\x13TextDetectionParams\x12.\n&enable_text_detection_confidence_score\x18\t \x01(\x08\x12\x1c\n\x14\x61\x64vanced_ocr_options\x18\x0b \x03(\t\"\xab\x03\n\x0cImageContext\x12\x41\n\rlat_long_rect\x18\x01 \x01(\x0b\x32*.google.cloud.vision.v1p3beta1.LatLongRect\x12\x16\n\x0elanguage_hints\x18\x02 \x03(\t\x12I\n\x11\x63rop_hints_params\x18\x04 \x01(\x0b\x32..google.cloud.vision.v1p3beta1.CropHintsParams\x12Q\n\x15product_search_params\x18\x05 \x01(\x0b\x32\x32.google.cloud.vision.v1p3beta1.ProductSearchParams\x12O\n\x14web_detection_params\x18\x06 \x01(\x0b\x32\x31.google.cloud.vision.v1p3beta1.WebDetectionParams\x12Q\n\x15text_detection_params\x18\x0c \x01(\x0b\x32\x32.google.cloud.vision.v1p3beta1.TextDetectionParams\"\xc9\x01\n\x14\x41nnotateImageRequest\x12\x33\n\x05image\x18\x01 \x01(\x0b\x32$.google.cloud.vision.v1p3beta1.Image\x12\x38\n\x08\x66\x65\x61tures\x18\x02 \x03(\x0b\x32&.google.cloud.vision.v1p3beta1.Feature\x12\x42\n\rimage_context\x18\x03 \x01(\x0b\x32+.google.cloud.vision.v1p3beta1.ImageContext\":\n\x16ImageAnnotationContext\x12\x0b\n\x03uri\x18\x01 \x01(\t\x12\x13\n\x0bpage_number\x18\x02 \x01(\x05\"\xbf\x08\n\x15\x41nnotateImageResponse\x12G\n\x10\x66\x61\x63\x65_annotations\x18\x01 \x03(\x0b\x32-.google.cloud.vision.v1p3beta1.FaceAnnotation\x12M\n\x14landmark_annotations\x18\x02 \x03(\x0b\x32/.google.cloud.vision.v1p3beta1.EntityAnnotation\x12I\n\x10logo_annotations\x18\x03 \x03(\x0b\x32/.google.cloud.vision.v1p3beta1.EntityAnnotation\x12J\n\x11label_annotations\x18\x04 \x03(\x0b\x32/.google.cloud.vision.v1p3beta1.EntityAnnotation\x12^\n\x1clocalized_object_annotations\x18\x16 \x03(\x0b\x32\x38.google.cloud.vision.v1p3beta1.LocalizedObjectAnnotation\x12I\n\x10text_annotations\x18\x05 \x03(\x0b\x32/.google.cloud.vision.v1p3beta1.EntityAnnotation\x12K\n\x14\x66ull_text_annotation\x18\x0c \x01(\x0b\x32-.google.cloud.vision.v1p3beta1.TextAnnotation\x12S\n\x16safe_search_annotation\x18\x06 \x01(\x0b\x32\x33.google.cloud.vision.v1p3beta1.SafeSearchAnnotation\x12S\n\x1bimage_properties_annotation\x18\x08 \x01(\x0b\x32..google.cloud.vision.v1p3beta1.ImageProperties\x12Q\n\x15\x63rop_hints_annotation\x18\x0b \x01(\x0b\x32\x32.google.cloud.vision.v1p3beta1.CropHintsAnnotation\x12\x42\n\rweb_detection\x18\r \x01(\x0b\x32+.google.cloud.vision.v1p3beta1.WebDetection\x12S\n\x16product_search_results\x18\x0e \x01(\x0b\x32\x33.google.cloud.vision.v1p3beta1.ProductSearchResults\x12!\n\x05\x65rror\x18\t \x01(\x0b\x32\x12.google.rpc.Status\x12\x46\n\x07\x63ontext\x18\x15 \x01(\x0b\x32\x35.google.cloud.vision.v1p3beta1.ImageAnnotationContext\"\xa1\x01\n\x14\x41nnotateFileResponse\x12@\n\x0cinput_config\x18\x01 \x01(\x0b\x32*.google.cloud.vision.v1p3beta1.InputConfig\x12G\n\tresponses\x18\x02 \x03(\x0b\x32\x34.google.cloud.vision.v1p3beta1.AnnotateImageResponse\"h\n\x1a\x42\x61tchAnnotateImagesRequest\x12J\n\x08requests\x18\x01 \x03(\x0b\x32\x33.google.cloud.vision.v1p3beta1.AnnotateImageRequestB\x03\xe0\x41\x02\"f\n\x1b\x42\x61tchAnnotateImagesResponse\x12G\n\tresponses\x18\x01 \x03(\x0b\x32\x34.google.cloud.vision.v1p3beta1.AnnotateImageResponse\"\x9e\x02\n\x18\x41syncAnnotateFileRequest\x12@\n\x0cinput_config\x18\x01 \x01(\x0b\x32*.google.cloud.vision.v1p3beta1.InputConfig\x12\x38\n\x08\x66\x65\x61tures\x18\x02 \x03(\x0b\x32&.google.cloud.vision.v1p3beta1.Feature\x12\x42\n\rimage_context\x18\x03 \x01(\x0b\x32+.google.cloud.vision.v1p3beta1.ImageContext\x12\x42\n\routput_config\x18\x04 \x01(\x0b\x32+.google.cloud.vision.v1p3beta1.OutputConfig\"_\n\x19\x41syncAnnotateFileResponse\x12\x42\n\routput_config\x18\x01 \x01(\x0b\x32+.google.cloud.vision.v1p3beta1.OutputConfig\"p\n\x1e\x41syncBatchAnnotateFilesRequest\x12N\n\x08requests\x18\x01 \x03(\x0b\x32\x37.google.cloud.vision.v1p3beta1.AsyncAnnotateFileRequestB\x03\xe0\x41\x02\"n\n\x1f\x41syncBatchAnnotateFilesResponse\x12K\n\tresponses\x18\x01 \x03(\x0b\x32\x38.google.cloud.vision.v1p3beta1.AsyncAnnotateFileResponse\"^\n\x0bInputConfig\x12<\n\ngcs_source\x18\x01 \x01(\x0b\x32(.google.cloud.vision.v1p3beta1.GcsSource\x12\x11\n\tmime_type\x18\x02 \x01(\t\"j\n\x0cOutputConfig\x12\x46\n\x0fgcs_destination\x18\x01 \x01(\x0b\x32-.google.cloud.vision.v1p3beta1.GcsDestination\x12\x12\n\nbatch_size\x18\x02 \x01(\x05\"\x18\n\tGcsSource\x12\x0b\n\x03uri\x18\x01 \x01(\t\"\x1d\n\x0eGcsDestination\x12\x0b\n\x03uri\x18\x01 \x01(\t\"\x8f\x02\n\x11OperationMetadata\x12\x45\n\x05state\x18\x01 \x01(\x0e\x32\x36.google.cloud.vision.v1p3beta1.OperationMetadata.State\x12/\n\x0b\x63reate_time\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12/\n\x0bupdate_time\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"Q\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0b\n\x07\x43REATED\x10\x01\x12\x0b\n\x07RUNNING\x10\x02\x12\x08\n\x04\x44ONE\x10\x03\x12\r\n\tCANCELLED\x10\x04*e\n\nLikelihood\x12\x0b\n\x07UNKNOWN\x10\x00\x12\x11\n\rVERY_UNLIKELY\x10\x01\x12\x0c\n\x08UNLIKELY\x10\x02\x12\x0c\n\x08POSSIBLE\x10\x03\x12\n\n\x06LIKELY\x10\x04\x12\x0f\n\x0bVERY_LIKELY\x10\x05\x32\xb5\x04\n\x0eImageAnnotator\x12\xbe\x01\n\x13\x42\x61tchAnnotateImages\x12\x39.google.cloud.vision.v1p3beta1.BatchAnnotateImagesRequest\x1a:.google.cloud.vision.v1p3beta1.BatchAnnotateImagesResponse\"0\xda\x41\x08requests\x82\xd3\xe4\x93\x02\x1f\"\x1a/v1p3beta1/images:annotate:\x01*\x12\xe9\x01\n\x17\x41syncBatchAnnotateFiles\x12=.google.cloud.vision.v1p3beta1.AsyncBatchAnnotateFilesRequest\x1a\x1d.google.longrunning.Operation\"p\xca\x41\x34\n\x1f\x41syncBatchAnnotateFilesResponse\x12\x11OperationMetadata\xda\x41\x08requests\x82\xd3\xe4\x93\x02(\"#/v1p3beta1/files:asyncBatchAnnotate:\x01*\x1av\xca\x41\x15vision.googleapis.com\xd2\x41[https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/cloud-visionBx\n!com.google.cloud.vision.v1p3beta1B\x13ImageAnnotatorProtoP\x01Z9cloud.google.com/go/vision/apiv1p3beta1/visionpb;visionpb\xf8\x01\x01\x62\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module Vision + module V1p3beta1 + Feature = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p3beta1.Feature").msgclass + Feature::Type = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p3beta1.Feature.Type").enummodule + ImageSource = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p3beta1.ImageSource").msgclass + Image = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p3beta1.Image").msgclass + FaceAnnotation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p3beta1.FaceAnnotation").msgclass + FaceAnnotation::Landmark = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p3beta1.FaceAnnotation.Landmark").msgclass + FaceAnnotation::Landmark::Type = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p3beta1.FaceAnnotation.Landmark.Type").enummodule + LocationInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p3beta1.LocationInfo").msgclass + Property = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p3beta1.Property").msgclass + EntityAnnotation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p3beta1.EntityAnnotation").msgclass + LocalizedObjectAnnotation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p3beta1.LocalizedObjectAnnotation").msgclass + SafeSearchAnnotation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p3beta1.SafeSearchAnnotation").msgclass + LatLongRect = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p3beta1.LatLongRect").msgclass + ColorInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p3beta1.ColorInfo").msgclass + DominantColorsAnnotation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p3beta1.DominantColorsAnnotation").msgclass + ImageProperties = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p3beta1.ImageProperties").msgclass + CropHint = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p3beta1.CropHint").msgclass + CropHintsAnnotation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p3beta1.CropHintsAnnotation").msgclass + CropHintsParams = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p3beta1.CropHintsParams").msgclass + WebDetectionParams = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p3beta1.WebDetectionParams").msgclass + TextDetectionParams = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p3beta1.TextDetectionParams").msgclass + ImageContext = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p3beta1.ImageContext").msgclass + AnnotateImageRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p3beta1.AnnotateImageRequest").msgclass + ImageAnnotationContext = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p3beta1.ImageAnnotationContext").msgclass + AnnotateImageResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p3beta1.AnnotateImageResponse").msgclass + AnnotateFileResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p3beta1.AnnotateFileResponse").msgclass + BatchAnnotateImagesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p3beta1.BatchAnnotateImagesRequest").msgclass + BatchAnnotateImagesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p3beta1.BatchAnnotateImagesResponse").msgclass + AsyncAnnotateFileRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p3beta1.AsyncAnnotateFileRequest").msgclass + AsyncAnnotateFileResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p3beta1.AsyncAnnotateFileResponse").msgclass + AsyncBatchAnnotateFilesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p3beta1.AsyncBatchAnnotateFilesRequest").msgclass + AsyncBatchAnnotateFilesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p3beta1.AsyncBatchAnnotateFilesResponse").msgclass + InputConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p3beta1.InputConfig").msgclass + OutputConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p3beta1.OutputConfig").msgclass + GcsSource = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p3beta1.GcsSource").msgclass + GcsDestination = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p3beta1.GcsDestination").msgclass + OperationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p3beta1.OperationMetadata").msgclass + OperationMetadata::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p3beta1.OperationMetadata.State").enummodule + Likelihood = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p3beta1.Likelihood").enummodule + end + end + end +end diff --git a/owl-bot-staging/google-cloud-vision-v1p3beta1/lib/google/cloud/vision/v1p3beta1/image_annotator_services_pb.rb b/owl-bot-staging/google-cloud-vision-v1p3beta1/lib/google/cloud/vision/v1p3beta1/image_annotator_services_pb.rb new file mode 100644 index 000000000000..8a8f2c55fac0 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision-v1p3beta1/lib/google/cloud/vision/v1p3beta1/image_annotator_services_pb.rb @@ -0,0 +1,55 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/cloud/vision/v1p3beta1/image_annotator.proto for package 'google.cloud.vision.v1p3beta1' +# 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/vision/v1p3beta1/image_annotator_pb' + +module Google + module Cloud + module Vision + module V1p3beta1 + module ImageAnnotator + # Service that performs Google Cloud Vision API detection tasks over client + # images, such as face, landmark, logo, label, and text detection. The + # ImageAnnotator service returns detected entities from the images. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.cloud.vision.v1p3beta1.ImageAnnotator' + + # Run image detection and annotation for a batch of images. + rpc :BatchAnnotateImages, ::Google::Cloud::Vision::V1p3beta1::BatchAnnotateImagesRequest, ::Google::Cloud::Vision::V1p3beta1::BatchAnnotateImagesResponse + # Run asynchronous image detection and annotation for a list of generic + # files, such as PDF files, which may contain multiple pages and multiple + # images per page. Progress and results can be retrieved through the + # `google.longrunning.Operations` interface. + # `Operation.metadata` contains `OperationMetadata` (metadata). + # `Operation.response` contains `AsyncBatchAnnotateFilesResponse` (results). + rpc :AsyncBatchAnnotateFiles, ::Google::Cloud::Vision::V1p3beta1::AsyncBatchAnnotateFilesRequest, ::Google::Longrunning::Operation + end + + Stub = Service.rpc_stub_class + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-vision-v1p3beta1/lib/google/cloud/vision/v1p3beta1/product_search.rb b/owl-bot-staging/google-cloud-vision-v1p3beta1/lib/google/cloud/vision/v1p3beta1/product_search.rb new file mode 100644 index 000000000000..9706818d4c6b --- /dev/null +++ b/owl-bot-staging/google-cloud-vision-v1p3beta1/lib/google/cloud/vision/v1p3beta1/product_search.rb @@ -0,0 +1,69 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/vision/v1p3beta1/version" + +require "google/cloud/vision/v1p3beta1/product_search/credentials" +require "google/cloud/vision/v1p3beta1/product_search/paths" +require "google/cloud/vision/v1p3beta1/product_search/operations" +require "google/cloud/vision/v1p3beta1/product_search/client" +require "google/cloud/vision/v1p3beta1/product_search/rest" + +module Google + module Cloud + module Vision + module V1p3beta1 + ## + # Manages Products and ProductSets of reference images for use in product + # search. It uses the following resource model: + # + # - The API has a collection of {::Google::Cloud::Vision::V1p3beta1::ProductSet ProductSet} resources, named + # `projects/*/locations/*/productSets/*`, which acts as a way to put different + # products into groups to limit identification. + # + # In parallel, + # + # - The API has a collection of {::Google::Cloud::Vision::V1p3beta1::Product Product} resources, named + # `projects/*/locations/*/products/*` + # + # - Each {::Google::Cloud::Vision::V1p3beta1::Product Product} has a collection of {::Google::Cloud::Vision::V1p3beta1::ReferenceImage ReferenceImage} resources, named + # `projects/*/locations/*/products/*/referenceImages/*` + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/vision/v1p3beta1/product_search" + # client = ::Google::Cloud::Vision::V1p3beta1::ProductSearch::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/vision/v1p3beta1/product_search/rest" + # client = ::Google::Cloud::Vision::V1p3beta1::ProductSearch::Rest::Client.new + # + module ProductSearch + end + end + end + end +end + +helper_path = ::File.join __dir__, "product_search", "helpers.rb" +require "google/cloud/vision/v1p3beta1/product_search/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-vision-v1p3beta1/lib/google/cloud/vision/v1p3beta1/product_search/client.rb b/owl-bot-staging/google-cloud-vision-v1p3beta1/lib/google/cloud/vision/v1p3beta1/product_search/client.rb new file mode 100644 index 000000000000..1d0d59cb2903 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision-v1p3beta1/lib/google/cloud/vision/v1p3beta1/product_search/client.rb @@ -0,0 +1,2429 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/vision/v1p3beta1/product_search_service_pb" + +module Google + module Cloud + module Vision + module V1p3beta1 + module ProductSearch + ## + # Client for the ProductSearch service. + # + # Manages Products and ProductSets of reference images for use in product + # search. It uses the following resource model: + # + # - The API has a collection of {::Google::Cloud::Vision::V1p3beta1::ProductSet ProductSet} resources, named + # `projects/*/locations/*/productSets/*`, which acts as a way to put different + # products into groups to limit identification. + # + # In parallel, + # + # - The API has a collection of {::Google::Cloud::Vision::V1p3beta1::Product Product} resources, named + # `projects/*/locations/*/products/*` + # + # - Each {::Google::Cloud::Vision::V1p3beta1::Product Product} has a collection of {::Google::Cloud::Vision::V1p3beta1::ReferenceImage ReferenceImage} resources, named + # `projects/*/locations/*/products/*/referenceImages/*` + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "vision.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :product_search_stub + + ## + # Configure the ProductSearch Client class. + # + # See {::Google::Cloud::Vision::V1p3beta1::ProductSearch::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all ProductSearch clients + # ::Google::Cloud::Vision::V1p3beta1::ProductSearch::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", "Vision", "V1p3beta1"] + 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_product_set.timeout = 600.0 + default_config.rpcs.create_product_set.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [] + } + + default_config.rpcs.list_product_sets.timeout = 600.0 + default_config.rpcs.list_product_sets.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.get_product_set.timeout = 600.0 + default_config.rpcs.get_product_set.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.update_product_set.timeout = 600.0 + default_config.rpcs.update_product_set.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [] + } + + default_config.rpcs.delete_product_set.timeout = 600.0 + default_config.rpcs.delete_product_set.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.create_product.timeout = 600.0 + default_config.rpcs.create_product.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [] + } + + default_config.rpcs.list_products.timeout = 600.0 + default_config.rpcs.list_products.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.get_product.timeout = 600.0 + default_config.rpcs.get_product.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.update_product.timeout = 600.0 + default_config.rpcs.update_product.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [] + } + + default_config.rpcs.delete_product.timeout = 600.0 + default_config.rpcs.delete_product.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.create_reference_image.timeout = 600.0 + default_config.rpcs.create_reference_image.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [] + } + + default_config.rpcs.delete_reference_image.timeout = 600.0 + default_config.rpcs.delete_reference_image.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.list_reference_images.timeout = 600.0 + default_config.rpcs.list_reference_images.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.get_reference_image.timeout = 600.0 + default_config.rpcs.get_reference_image.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.add_product_to_product_set.timeout = 600.0 + default_config.rpcs.add_product_to_product_set.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [] + } + + default_config.rpcs.remove_product_from_product_set.timeout = 600.0 + default_config.rpcs.remove_product_from_product_set.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [] + } + + default_config.rpcs.list_products_in_product_set.timeout = 600.0 + default_config.rpcs.list_products_in_product_set.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.import_product_sets.timeout = 600.0 + default_config.rpcs.import_product_sets.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the ProductSearch 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::Vision::V1p3beta1::ProductSearch::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 + @product_search_stub.universe_domain + end + + ## + # Create a new ProductSearch client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Vision::V1p3beta1::ProductSearch::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Vision::V1p3beta1::ProductSearch::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the ProductSearch 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/vision/v1p3beta1/product_search_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 + + @product_search_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::Vision::V1p3beta1::ProductSearch::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 + ) + + @product_search_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 + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::Vision::V1p3beta1::ProductSearch::Operations] + # + attr_reader :operations_client + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @product_search_stub.logger + end + + # Service calls + + ## + # Creates and returns a new ProductSet resource. + # + # Possible errors: + # + # * Returns INVALID_ARGUMENT if display_name is missing, or is longer than + # 4096 characters. + # + # @overload create_product_set(request, options = nil) + # Pass arguments to `create_product_set` via a request object, either of type + # {::Google::Cloud::Vision::V1p3beta1::CreateProductSetRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Vision::V1p3beta1::CreateProductSetRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_product_set(parent: nil, product_set: nil, product_set_id: nil) + # Pass arguments to `create_product_set` via keyword arguments. Note that at + # least one keyword argument is 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 in which the ProductSet should be created. + # + # Format is `projects/PROJECT_ID/locations/LOC_ID`. + # @param product_set [::Google::Cloud::Vision::V1p3beta1::ProductSet, ::Hash] + # Required. The ProductSet to create. + # @param product_set_id [::String] + # A user-supplied resource id for this ProductSet. If set, the server will + # attempt to use this value as the resource id. If it is already in use, an + # error is returned with code ALREADY_EXISTS. Must be at most 128 characters + # long. It cannot contain the character `/`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Vision::V1p3beta1::ProductSet] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Vision::V1p3beta1::ProductSet] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/vision/v1p3beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Vision::V1p3beta1::ProductSearch::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Vision::V1p3beta1::CreateProductSetRequest.new + # + # # Call the create_product_set method. + # result = client.create_product_set request + # + # # The returned object is of type Google::Cloud::Vision::V1p3beta1::ProductSet. + # p result + # + def create_product_set request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Vision::V1p3beta1::CreateProductSetRequest + + # Converts hash 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_product_set.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::Vision::V1p3beta1::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_product_set.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_product_set.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @product_search_stub.call_rpc :create_product_set, 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 ProductSets in an unspecified order. + # + # Possible errors: + # + # * Returns INVALID_ARGUMENT if page_size is greater than 100, or less + # than 1. + # + # @overload list_product_sets(request, options = nil) + # Pass arguments to `list_product_sets` via a request object, either of type + # {::Google::Cloud::Vision::V1p3beta1::ListProductSetsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Vision::V1p3beta1::ListProductSetsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_product_sets(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_product_sets` via keyword arguments. Note that at + # least one keyword argument is 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 from which ProductSets should be listed. + # + # Format is `projects/PROJECT_ID/locations/LOC_ID`. + # @param page_size [::Integer] + # The maximum number of items to return. Default 10, maximum 100. + # @param page_token [::String] + # The next_page_token returned from a previous List request, if any. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Vision::V1p3beta1::ProductSet>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::Vision::V1p3beta1::ProductSet>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/vision/v1p3beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Vision::V1p3beta1::ProductSearch::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Vision::V1p3beta1::ListProductSetsRequest.new + # + # # Call the list_product_sets method. + # result = client.list_product_sets 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::Vision::V1p3beta1::ProductSet. + # p item + # end + # + def list_product_sets request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Vision::V1p3beta1::ListProductSetsRequest + + # Converts hash 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_product_sets.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::Vision::V1p3beta1::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_product_sets.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_product_sets.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @product_search_stub.call_rpc :list_product_sets, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @product_search_stub, :list_product_sets, 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 + + ## + # Gets information associated with a ProductSet. + # + # Possible errors: + # + # * Returns NOT_FOUND if the ProductSet does not exist. + # + # @overload get_product_set(request, options = nil) + # Pass arguments to `get_product_set` via a request object, either of type + # {::Google::Cloud::Vision::V1p3beta1::GetProductSetRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Vision::V1p3beta1::GetProductSetRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_product_set(name: nil) + # Pass arguments to `get_product_set` via keyword arguments. Note that at + # least one keyword argument is 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. Resource name of the ProductSet to get. + # + # Format is: + # `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Vision::V1p3beta1::ProductSet] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Vision::V1p3beta1::ProductSet] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/vision/v1p3beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Vision::V1p3beta1::ProductSearch::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Vision::V1p3beta1::GetProductSetRequest.new + # + # # Call the get_product_set method. + # result = client.get_product_set request + # + # # The returned object is of type Google::Cloud::Vision::V1p3beta1::ProductSet. + # p result + # + def get_product_set request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Vision::V1p3beta1::GetProductSetRequest + + # Converts hash 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_product_set.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::Vision::V1p3beta1::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_product_set.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_product_set.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @product_search_stub.call_rpc :get_product_set, 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 + + ## + # Makes changes to a ProductSet resource. + # Only display_name can be updated currently. + # + # Possible errors: + # + # * Returns NOT_FOUND if the ProductSet does not exist. + # * Returns INVALID_ARGUMENT if display_name is present in update_mask but + # missing from the request or longer than 4096 characters. + # + # @overload update_product_set(request, options = nil) + # Pass arguments to `update_product_set` via a request object, either of type + # {::Google::Cloud::Vision::V1p3beta1::UpdateProductSetRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Vision::V1p3beta1::UpdateProductSetRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_product_set(product_set: nil, update_mask: nil) + # Pass arguments to `update_product_set` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param product_set [::Google::Cloud::Vision::V1p3beta1::ProductSet, ::Hash] + # Required. The ProductSet resource which replaces the one on the server. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # The {::Google::Protobuf::FieldMask FieldMask} that specifies which fields to + # update. + # If update_mask isn't specified, all mutable fields are to be updated. + # Valid mask path is `display_name`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Vision::V1p3beta1::ProductSet] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Vision::V1p3beta1::ProductSet] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/vision/v1p3beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Vision::V1p3beta1::ProductSearch::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Vision::V1p3beta1::UpdateProductSetRequest.new + # + # # Call the update_product_set method. + # result = client.update_product_set request + # + # # The returned object is of type Google::Cloud::Vision::V1p3beta1::ProductSet. + # p result + # + def update_product_set request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Vision::V1p3beta1::UpdateProductSetRequest + + # Converts hash 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_product_set.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::Vision::V1p3beta1::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.product_set&.name + header_params["product_set.name"] = request.product_set.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_product_set.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_product_set.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @product_search_stub.call_rpc :update_product_set, 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 a ProductSet. All Products and ReferenceImages in the + # ProductSet will be deleted. + # + # The actual image files are not deleted from Google Cloud Storage. + # + # Possible errors: + # + # * Returns NOT_FOUND if the ProductSet does not exist. + # + # @overload delete_product_set(request, options = nil) + # Pass arguments to `delete_product_set` via a request object, either of type + # {::Google::Cloud::Vision::V1p3beta1::DeleteProductSetRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Vision::V1p3beta1::DeleteProductSetRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_product_set(name: nil) + # Pass arguments to `delete_product_set` via keyword arguments. Note that at + # least one keyword argument is 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. Resource name of the ProductSet to delete. + # + # Format is: + # `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID` + # + # @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/vision/v1p3beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Vision::V1p3beta1::ProductSearch::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Vision::V1p3beta1::DeleteProductSetRequest.new + # + # # Call the delete_product_set method. + # result = client.delete_product_set request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_product_set request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Vision::V1p3beta1::DeleteProductSetRequest + + # Converts hash 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_product_set.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::Vision::V1p3beta1::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_product_set.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_product_set.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @product_search_stub.call_rpc :delete_product_set, 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 and returns a new product resource. + # + # Possible errors: + # + # * Returns INVALID_ARGUMENT if display_name is missing or longer than 4096 + # characters. + # * Returns INVALID_ARGUMENT if description is longer than 4096 characters. + # * Returns INVALID_ARGUMENT if product_category is missing or invalid. + # + # @overload create_product(request, options = nil) + # Pass arguments to `create_product` via a request object, either of type + # {::Google::Cloud::Vision::V1p3beta1::CreateProductRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Vision::V1p3beta1::CreateProductRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_product(parent: nil, product: nil, product_id: nil) + # Pass arguments to `create_product` via keyword arguments. Note that at + # least one keyword argument is 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 in which the Product should be created. + # + # Format is + # `projects/PROJECT_ID/locations/LOC_ID`. + # @param product [::Google::Cloud::Vision::V1p3beta1::Product, ::Hash] + # Required. The product to create. + # @param product_id [::String] + # A user-supplied resource id for this Product. If set, the server will + # attempt to use this value as the resource id. If it is already in use, an + # error is returned with code ALREADY_EXISTS. Must be at most 128 characters + # long. It cannot contain the character `/`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Vision::V1p3beta1::Product] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Vision::V1p3beta1::Product] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/vision/v1p3beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Vision::V1p3beta1::ProductSearch::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Vision::V1p3beta1::CreateProductRequest.new + # + # # Call the create_product method. + # result = client.create_product request + # + # # The returned object is of type Google::Cloud::Vision::V1p3beta1::Product. + # p result + # + def create_product request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Vision::V1p3beta1::CreateProductRequest + + # Converts hash 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_product.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::Vision::V1p3beta1::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_product.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_product.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @product_search_stub.call_rpc :create_product, 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 products in an unspecified order. + # + # Possible errors: + # + # * Returns INVALID_ARGUMENT if page_size is greater than 100 or less than 1. + # + # @overload list_products(request, options = nil) + # Pass arguments to `list_products` via a request object, either of type + # {::Google::Cloud::Vision::V1p3beta1::ListProductsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Vision::V1p3beta1::ListProductsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_products(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_products` via keyword arguments. Note that at + # least one keyword argument is 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 OR ProductSet from which Products should be listed. + # + # Format: + # `projects/PROJECT_ID/locations/LOC_ID` + # @param page_size [::Integer] + # The maximum number of items to return. Default 10, maximum 100. + # @param page_token [::String] + # The next_page_token returned from a previous List request, if any. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Vision::V1p3beta1::Product>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::Vision::V1p3beta1::Product>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/vision/v1p3beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Vision::V1p3beta1::ProductSearch::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Vision::V1p3beta1::ListProductsRequest.new + # + # # Call the list_products method. + # result = client.list_products 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::Vision::V1p3beta1::Product. + # p item + # end + # + def list_products request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Vision::V1p3beta1::ListProductsRequest + + # Converts hash 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_products.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::Vision::V1p3beta1::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_products.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_products.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @product_search_stub.call_rpc :list_products, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @product_search_stub, :list_products, 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 + + ## + # Gets information associated with a Product. + # + # Possible errors: + # + # * Returns NOT_FOUND if the Product does not exist. + # + # @overload get_product(request, options = nil) + # Pass arguments to `get_product` via a request object, either of type + # {::Google::Cloud::Vision::V1p3beta1::GetProductRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Vision::V1p3beta1::GetProductRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_product(name: nil) + # Pass arguments to `get_product` via keyword arguments. Note that at + # least one keyword argument is 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. Resource name of the Product to get. + # + # Format is: + # `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Vision::V1p3beta1::Product] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Vision::V1p3beta1::Product] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/vision/v1p3beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Vision::V1p3beta1::ProductSearch::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Vision::V1p3beta1::GetProductRequest.new + # + # # Call the get_product method. + # result = client.get_product request + # + # # The returned object is of type Google::Cloud::Vision::V1p3beta1::Product. + # p result + # + def get_product request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Vision::V1p3beta1::GetProductRequest + + # Converts hash 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_product.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::Vision::V1p3beta1::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_product.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_product.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @product_search_stub.call_rpc :get_product, 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 + + ## + # Makes changes to a Product resource. + # Only display_name, description and labels can be updated right now. + # + # If labels are updated, the change will not be reflected in queries until + # the next index time. + # + # Possible errors: + # + # * Returns NOT_FOUND if the Product does not exist. + # * Returns INVALID_ARGUMENT if display_name is present in update_mask but is + # missing from the request or longer than 4096 characters. + # * Returns INVALID_ARGUMENT if description is present in update_mask but is + # longer than 4096 characters. + # * Returns INVALID_ARGUMENT if product_category is present in update_mask. + # + # @overload update_product(request, options = nil) + # Pass arguments to `update_product` via a request object, either of type + # {::Google::Cloud::Vision::V1p3beta1::UpdateProductRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Vision::V1p3beta1::UpdateProductRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_product(product: nil, update_mask: nil) + # Pass arguments to `update_product` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param product [::Google::Cloud::Vision::V1p3beta1::Product, ::Hash] + # Required. The Product resource which replaces the one on the server. + # product.name is immutable. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # The {::Google::Protobuf::FieldMask FieldMask} that specifies which fields + # to update. + # If update_mask isn't specified, all mutable fields are to be updated. + # Valid mask paths include `product_labels`, `display_name`, and + # `description`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Vision::V1p3beta1::Product] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Vision::V1p3beta1::Product] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/vision/v1p3beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Vision::V1p3beta1::ProductSearch::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Vision::V1p3beta1::UpdateProductRequest.new + # + # # Call the update_product method. + # result = client.update_product request + # + # # The returned object is of type Google::Cloud::Vision::V1p3beta1::Product. + # p result + # + def update_product request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Vision::V1p3beta1::UpdateProductRequest + + # Converts hash 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_product.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::Vision::V1p3beta1::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.product&.name + header_params["product.name"] = request.product.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_product.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_product.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @product_search_stub.call_rpc :update_product, 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 a product and its reference images. + # + # Metadata of the product and all its images will be deleted right away, but + # search queries against ProductSets containing the product may still work + # until all related caches are refreshed. + # + # Possible errors: + # + # * Returns NOT_FOUND if the product does not exist. + # + # @overload delete_product(request, options = nil) + # Pass arguments to `delete_product` via a request object, either of type + # {::Google::Cloud::Vision::V1p3beta1::DeleteProductRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Vision::V1p3beta1::DeleteProductRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_product(name: nil) + # Pass arguments to `delete_product` via keyword arguments. Note that at + # least one keyword argument is 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. Resource name of product to delete. + # + # Format is: + # `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID` + # + # @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/vision/v1p3beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Vision::V1p3beta1::ProductSearch::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Vision::V1p3beta1::DeleteProductRequest.new + # + # # Call the delete_product method. + # result = client.delete_product request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_product request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Vision::V1p3beta1::DeleteProductRequest + + # Converts hash 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_product.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::Vision::V1p3beta1::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_product.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_product.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @product_search_stub.call_rpc :delete_product, 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 and returns a new ReferenceImage resource. + # + # The `bounding_poly` field is optional. If `bounding_poly` is not specified, + # the system will try to detect regions of interest in the image that are + # compatible with the product_category on the parent product. If it is + # specified, detection is ALWAYS skipped. The system converts polygons into + # non-rotated rectangles. + # + # Note that the pipeline will resize the image if the image resolution is too + # large to process (above 50MP). + # + # Possible errors: + # + # * Returns INVALID_ARGUMENT if the image_uri is missing or longer than 4096 + # characters. + # * Returns INVALID_ARGUMENT if the product does not exist. + # * Returns INVALID_ARGUMENT if bounding_poly is not provided, and nothing + # compatible with the parent product's product_category is detected. + # * Returns INVALID_ARGUMENT if bounding_poly contains more than 10 polygons. + # + # @overload create_reference_image(request, options = nil) + # Pass arguments to `create_reference_image` via a request object, either of type + # {::Google::Cloud::Vision::V1p3beta1::CreateReferenceImageRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Vision::V1p3beta1::CreateReferenceImageRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_reference_image(parent: nil, reference_image: nil, reference_image_id: nil) + # Pass arguments to `create_reference_image` via keyword arguments. Note that at + # least one keyword argument is 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. Resource name of the product in which to create the reference image. + # + # Format is + # `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`. + # @param reference_image [::Google::Cloud::Vision::V1p3beta1::ReferenceImage, ::Hash] + # Required. The reference image to create. + # If an image ID is specified, it is ignored. + # @param reference_image_id [::String] + # A user-supplied resource id for the ReferenceImage to be added. If set, + # the server will attempt to use this value as the resource id. If it is + # already in use, an error is returned with code ALREADY_EXISTS. Must be at + # most 128 characters long. It cannot contain the character `/`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Vision::V1p3beta1::ReferenceImage] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Vision::V1p3beta1::ReferenceImage] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/vision/v1p3beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Vision::V1p3beta1::ProductSearch::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Vision::V1p3beta1::CreateReferenceImageRequest.new + # + # # Call the create_reference_image method. + # result = client.create_reference_image request + # + # # The returned object is of type Google::Cloud::Vision::V1p3beta1::ReferenceImage. + # p result + # + def create_reference_image request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Vision::V1p3beta1::CreateReferenceImageRequest + + # Converts hash 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_reference_image.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::Vision::V1p3beta1::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_reference_image.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_reference_image.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @product_search_stub.call_rpc :create_reference_image, 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 a reference image. + # + # The image metadata will be deleted right away, but search queries + # against ProductSets containing the image may still work until all related + # caches are refreshed. + # + # The actual image files are not deleted from Google Cloud Storage. + # + # Possible errors: + # + # * Returns NOT_FOUND if the reference image does not exist. + # + # @overload delete_reference_image(request, options = nil) + # Pass arguments to `delete_reference_image` via a request object, either of type + # {::Google::Cloud::Vision::V1p3beta1::DeleteReferenceImageRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Vision::V1p3beta1::DeleteReferenceImageRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_reference_image(name: nil) + # Pass arguments to `delete_reference_image` via keyword arguments. Note that at + # least one keyword argument is 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 reference image to delete. + # + # Format is: + # + # `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID` + # + # @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/vision/v1p3beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Vision::V1p3beta1::ProductSearch::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Vision::V1p3beta1::DeleteReferenceImageRequest.new + # + # # Call the delete_reference_image method. + # result = client.delete_reference_image request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_reference_image request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Vision::V1p3beta1::DeleteReferenceImageRequest + + # Converts hash 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_reference_image.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::Vision::V1p3beta1::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_reference_image.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_reference_image.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @product_search_stub.call_rpc :delete_reference_image, 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 reference images. + # + # Possible errors: + # + # * Returns NOT_FOUND if the parent product does not exist. + # * Returns INVALID_ARGUMENT if the page_size is greater than 100, or less + # than 1. + # + # @overload list_reference_images(request, options = nil) + # Pass arguments to `list_reference_images` via a request object, either of type + # {::Google::Cloud::Vision::V1p3beta1::ListReferenceImagesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Vision::V1p3beta1::ListReferenceImagesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_reference_images(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_reference_images` via keyword arguments. Note that at + # least one keyword argument is 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. Resource name of the product containing the reference images. + # + # Format is + # `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`. + # @param page_size [::Integer] + # The maximum number of items to return. Default 10, maximum 100. + # @param page_token [::String] + # A token identifying a page of results to be returned. This is the value + # of `nextPageToken` returned in a previous reference image list request. + # + # Defaults to the first page if not specified. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Vision::V1p3beta1::ReferenceImage>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::Vision::V1p3beta1::ReferenceImage>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/vision/v1p3beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Vision::V1p3beta1::ProductSearch::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Vision::V1p3beta1::ListReferenceImagesRequest.new + # + # # Call the list_reference_images method. + # result = client.list_reference_images 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::Vision::V1p3beta1::ReferenceImage. + # p item + # end + # + def list_reference_images request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Vision::V1p3beta1::ListReferenceImagesRequest + + # Converts hash 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_reference_images.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::Vision::V1p3beta1::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_reference_images.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_reference_images.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @product_search_stub.call_rpc :list_reference_images, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @product_search_stub, :list_reference_images, 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 + + ## + # Gets information associated with a ReferenceImage. + # + # Possible errors: + # + # * Returns NOT_FOUND if the specified image does not exist. + # + # @overload get_reference_image(request, options = nil) + # Pass arguments to `get_reference_image` via a request object, either of type + # {::Google::Cloud::Vision::V1p3beta1::GetReferenceImageRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Vision::V1p3beta1::GetReferenceImageRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_reference_image(name: nil) + # Pass arguments to `get_reference_image` via keyword arguments. Note that at + # least one keyword argument is 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 ReferenceImage to get. + # + # Format is: + # + # `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Vision::V1p3beta1::ReferenceImage] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Vision::V1p3beta1::ReferenceImage] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/vision/v1p3beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Vision::V1p3beta1::ProductSearch::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Vision::V1p3beta1::GetReferenceImageRequest.new + # + # # Call the get_reference_image method. + # result = client.get_reference_image request + # + # # The returned object is of type Google::Cloud::Vision::V1p3beta1::ReferenceImage. + # p result + # + def get_reference_image request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Vision::V1p3beta1::GetReferenceImageRequest + + # Converts hash 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_reference_image.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::Vision::V1p3beta1::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_reference_image.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_reference_image.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @product_search_stub.call_rpc :get_reference_image, 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 + + ## + # Adds a Product to the specified ProductSet. If the Product is already + # present, no change is made. + # + # One Product can be added to at most 100 ProductSets. + # + # Possible errors: + # + # * Returns NOT_FOUND if the Product or the ProductSet doesn't exist. + # + # @overload add_product_to_product_set(request, options = nil) + # Pass arguments to `add_product_to_product_set` via a request object, either of type + # {::Google::Cloud::Vision::V1p3beta1::AddProductToProductSetRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Vision::V1p3beta1::AddProductToProductSetRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload add_product_to_product_set(name: nil, product: nil) + # Pass arguments to `add_product_to_product_set` via keyword arguments. Note that at + # least one keyword argument is 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 for the ProductSet to modify. + # + # Format is: + # `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID` + # @param product [::String] + # Required. The resource name for the Product to be added to this ProductSet. + # + # Format is: + # `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID` + # + # @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/vision/v1p3beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Vision::V1p3beta1::ProductSearch::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Vision::V1p3beta1::AddProductToProductSetRequest.new + # + # # Call the add_product_to_product_set method. + # result = client.add_product_to_product_set request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def add_product_to_product_set request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Vision::V1p3beta1::AddProductToProductSetRequest + + # Converts hash 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.add_product_to_product_set.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::Vision::V1p3beta1::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.add_product_to_product_set.timeout, + metadata: metadata, + retry_policy: @config.rpcs.add_product_to_product_set.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @product_search_stub.call_rpc :add_product_to_product_set, 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 + + ## + # Removes a Product from the specified ProductSet. + # + # Possible errors: + # + # * Returns NOT_FOUND If the Product is not found under the ProductSet. + # + # @overload remove_product_from_product_set(request, options = nil) + # Pass arguments to `remove_product_from_product_set` via a request object, either of type + # {::Google::Cloud::Vision::V1p3beta1::RemoveProductFromProductSetRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Vision::V1p3beta1::RemoveProductFromProductSetRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload remove_product_from_product_set(name: nil, product: nil) + # Pass arguments to `remove_product_from_product_set` via keyword arguments. Note that at + # least one keyword argument is 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 for the ProductSet to modify. + # + # Format is: + # `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID` + # @param product [::String] + # Required. The resource name for the Product to be removed from this ProductSet. + # + # Format is: + # `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID` + # + # @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/vision/v1p3beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Vision::V1p3beta1::ProductSearch::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Vision::V1p3beta1::RemoveProductFromProductSetRequest.new + # + # # Call the remove_product_from_product_set method. + # result = client.remove_product_from_product_set request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def remove_product_from_product_set request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Vision::V1p3beta1::RemoveProductFromProductSetRequest + + # Converts hash 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.remove_product_from_product_set.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::Vision::V1p3beta1::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.remove_product_from_product_set.timeout, + metadata: metadata, + retry_policy: @config.rpcs.remove_product_from_product_set.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @product_search_stub.call_rpc :remove_product_from_product_set, 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 the Products in a ProductSet, in an unspecified order. If the + # ProductSet does not exist, the products field of the response will be + # empty. + # + # Possible errors: + # + # * Returns INVALID_ARGUMENT if page_size is greater than 100 or less than 1. + # + # @overload list_products_in_product_set(request, options = nil) + # Pass arguments to `list_products_in_product_set` via a request object, either of type + # {::Google::Cloud::Vision::V1p3beta1::ListProductsInProductSetRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Vision::V1p3beta1::ListProductsInProductSetRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_products_in_product_set(name: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_products_in_product_set` via keyword arguments. Note that at + # least one keyword argument is 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 ProductSet resource for which to retrieve Products. + # + # Format is: + # `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID` + # @param page_size [::Integer] + # The maximum number of items to return. Default 10, maximum 100. + # @param page_token [::String] + # The next_page_token returned from a previous List request, if any. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Vision::V1p3beta1::Product>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::Vision::V1p3beta1::Product>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/vision/v1p3beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Vision::V1p3beta1::ProductSearch::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Vision::V1p3beta1::ListProductsInProductSetRequest.new + # + # # Call the list_products_in_product_set method. + # result = client.list_products_in_product_set 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::Vision::V1p3beta1::Product. + # p item + # end + # + def list_products_in_product_set request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Vision::V1p3beta1::ListProductsInProductSetRequest + + # Converts hash 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_products_in_product_set.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::Vision::V1p3beta1::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_products_in_product_set.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_products_in_product_set.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @product_search_stub.call_rpc :list_products_in_product_set, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @product_search_stub, :list_products_in_product_set, 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 + + ## + # Asynchronous API that imports a list of reference images to specified + # product sets based on a list of image information. + # + # The {::Google::Longrunning::Operation google.longrunning.Operation} API can be + # used to keep track of the progress and results of the request. + # `Operation.metadata` contains `BatchOperationMetadata`. (progress) + # `Operation.response` contains `ImportProductSetsResponse`. (results) + # + # The input source of this method is a csv file on Google Cloud Storage. + # For the format of the csv file please see + # {::Google::Cloud::Vision::V1p3beta1::ImportProductSetsGcsSource#csv_file_uri ImportProductSetsGcsSource.csv_file_uri}. + # + # @overload import_product_sets(request, options = nil) + # Pass arguments to `import_product_sets` via a request object, either of type + # {::Google::Cloud::Vision::V1p3beta1::ImportProductSetsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Vision::V1p3beta1::ImportProductSetsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_product_sets(parent: nil, input_config: nil) + # Pass arguments to `import_product_sets` via keyword arguments. Note that at + # least one keyword argument is 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 in which the ProductSets should be imported. + # + # Format is `projects/PROJECT_ID/locations/LOC_ID`. + # @param input_config [::Google::Cloud::Vision::V1p3beta1::ImportProductSetsInputConfig, ::Hash] + # Required. The input content for the list of requests. + # + # @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/vision/v1p3beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Vision::V1p3beta1::ProductSearch::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Vision::V1p3beta1::ImportProductSetsRequest.new + # + # # Call the import_product_sets method. + # result = client.import_product_sets 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 import_product_sets request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Vision::V1p3beta1::ImportProductSetsRequest + + # Converts hash 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_product_sets.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::Vision::V1p3beta1::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_product_sets.timeout, + metadata: metadata, + retry_policy: @config.rpcs.import_product_sets.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @product_search_stub.call_rpc :import_product_sets, 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 ProductSearch API. + # + # This class represents the configuration for ProductSearch, + # 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::Vision::V1p3beta1::ProductSearch::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_product_set to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Vision::V1p3beta1::ProductSearch::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.create_product_set.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Vision::V1p3beta1::ProductSearch::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.create_product_set.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::Vision::V1p3beta1::ProductSearch::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 = "vision.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 ProductSearch 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_product_set` + # @return [::Gapic::Config::Method] + # + attr_reader :create_product_set + ## + # RPC-specific configuration for `list_product_sets` + # @return [::Gapic::Config::Method] + # + attr_reader :list_product_sets + ## + # RPC-specific configuration for `get_product_set` + # @return [::Gapic::Config::Method] + # + attr_reader :get_product_set + ## + # RPC-specific configuration for `update_product_set` + # @return [::Gapic::Config::Method] + # + attr_reader :update_product_set + ## + # RPC-specific configuration for `delete_product_set` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_product_set + ## + # RPC-specific configuration for `create_product` + # @return [::Gapic::Config::Method] + # + attr_reader :create_product + ## + # RPC-specific configuration for `list_products` + # @return [::Gapic::Config::Method] + # + attr_reader :list_products + ## + # RPC-specific configuration for `get_product` + # @return [::Gapic::Config::Method] + # + attr_reader :get_product + ## + # RPC-specific configuration for `update_product` + # @return [::Gapic::Config::Method] + # + attr_reader :update_product + ## + # RPC-specific configuration for `delete_product` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_product + ## + # RPC-specific configuration for `create_reference_image` + # @return [::Gapic::Config::Method] + # + attr_reader :create_reference_image + ## + # RPC-specific configuration for `delete_reference_image` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_reference_image + ## + # RPC-specific configuration for `list_reference_images` + # @return [::Gapic::Config::Method] + # + attr_reader :list_reference_images + ## + # RPC-specific configuration for `get_reference_image` + # @return [::Gapic::Config::Method] + # + attr_reader :get_reference_image + ## + # RPC-specific configuration for `add_product_to_product_set` + # @return [::Gapic::Config::Method] + # + attr_reader :add_product_to_product_set + ## + # RPC-specific configuration for `remove_product_from_product_set` + # @return [::Gapic::Config::Method] + # + attr_reader :remove_product_from_product_set + ## + # RPC-specific configuration for `list_products_in_product_set` + # @return [::Gapic::Config::Method] + # + attr_reader :list_products_in_product_set + ## + # RPC-specific configuration for `import_product_sets` + # @return [::Gapic::Config::Method] + # + attr_reader :import_product_sets + + # @private + def initialize parent_rpcs = nil + create_product_set_config = parent_rpcs.create_product_set if parent_rpcs.respond_to? :create_product_set + @create_product_set = ::Gapic::Config::Method.new create_product_set_config + list_product_sets_config = parent_rpcs.list_product_sets if parent_rpcs.respond_to? :list_product_sets + @list_product_sets = ::Gapic::Config::Method.new list_product_sets_config + get_product_set_config = parent_rpcs.get_product_set if parent_rpcs.respond_to? :get_product_set + @get_product_set = ::Gapic::Config::Method.new get_product_set_config + update_product_set_config = parent_rpcs.update_product_set if parent_rpcs.respond_to? :update_product_set + @update_product_set = ::Gapic::Config::Method.new update_product_set_config + delete_product_set_config = parent_rpcs.delete_product_set if parent_rpcs.respond_to? :delete_product_set + @delete_product_set = ::Gapic::Config::Method.new delete_product_set_config + create_product_config = parent_rpcs.create_product if parent_rpcs.respond_to? :create_product + @create_product = ::Gapic::Config::Method.new create_product_config + list_products_config = parent_rpcs.list_products if parent_rpcs.respond_to? :list_products + @list_products = ::Gapic::Config::Method.new list_products_config + get_product_config = parent_rpcs.get_product if parent_rpcs.respond_to? :get_product + @get_product = ::Gapic::Config::Method.new get_product_config + update_product_config = parent_rpcs.update_product if parent_rpcs.respond_to? :update_product + @update_product = ::Gapic::Config::Method.new update_product_config + delete_product_config = parent_rpcs.delete_product if parent_rpcs.respond_to? :delete_product + @delete_product = ::Gapic::Config::Method.new delete_product_config + create_reference_image_config = parent_rpcs.create_reference_image if parent_rpcs.respond_to? :create_reference_image + @create_reference_image = ::Gapic::Config::Method.new create_reference_image_config + delete_reference_image_config = parent_rpcs.delete_reference_image if parent_rpcs.respond_to? :delete_reference_image + @delete_reference_image = ::Gapic::Config::Method.new delete_reference_image_config + list_reference_images_config = parent_rpcs.list_reference_images if parent_rpcs.respond_to? :list_reference_images + @list_reference_images = ::Gapic::Config::Method.new list_reference_images_config + get_reference_image_config = parent_rpcs.get_reference_image if parent_rpcs.respond_to? :get_reference_image + @get_reference_image = ::Gapic::Config::Method.new get_reference_image_config + add_product_to_product_set_config = parent_rpcs.add_product_to_product_set if parent_rpcs.respond_to? :add_product_to_product_set + @add_product_to_product_set = ::Gapic::Config::Method.new add_product_to_product_set_config + remove_product_from_product_set_config = parent_rpcs.remove_product_from_product_set if parent_rpcs.respond_to? :remove_product_from_product_set + @remove_product_from_product_set = ::Gapic::Config::Method.new remove_product_from_product_set_config + list_products_in_product_set_config = parent_rpcs.list_products_in_product_set if parent_rpcs.respond_to? :list_products_in_product_set + @list_products_in_product_set = ::Gapic::Config::Method.new list_products_in_product_set_config + import_product_sets_config = parent_rpcs.import_product_sets if parent_rpcs.respond_to? :import_product_sets + @import_product_sets = ::Gapic::Config::Method.new import_product_sets_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-vision-v1p3beta1/lib/google/cloud/vision/v1p3beta1/product_search/credentials.rb b/owl-bot-staging/google-cloud-vision-v1p3beta1/lib/google/cloud/vision/v1p3beta1/product_search/credentials.rb new file mode 100644 index 000000000000..53d6f69d33e9 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision-v1p3beta1/lib/google/cloud/vision/v1p3beta1/product_search/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 Vision + module V1p3beta1 + module ProductSearch + # Credentials for the ProductSearch API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-vision" + ] + self.env_vars = [ + "VISION_CREDENTIALS", + "VISION_KEYFILE", + "GOOGLE_CLOUD_CREDENTIALS", + "GOOGLE_CLOUD_KEYFILE", + "GCLOUD_KEYFILE", + "VISION_CREDENTIALS_JSON", + "VISION_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-vision-v1p3beta1/lib/google/cloud/vision/v1p3beta1/product_search/operations.rb b/owl-bot-staging/google-cloud-vision-v1p3beta1/lib/google/cloud/vision/v1p3beta1/product_search/operations.rb new file mode 100644 index 000000000000..1c778ed43a8f --- /dev/null +++ b/owl-bot-staging/google-cloud-vision-v1p3beta1/lib/google/cloud/vision/v1p3beta1/product_search/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 Vision + module V1p3beta1 + module ProductSearch + # Service that implements Longrunning Operations API. + class Operations + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "vision.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :operations_stub + + ## + # Configuration for the ProductSearch 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 ProductSearch 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::Vision::V1p3beta1::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::Vision::V1p3beta1::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::Vision::V1p3beta1::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::Vision::V1p3beta1::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::Vision::V1p3beta1::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 = "vision.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-vision-v1p3beta1/lib/google/cloud/vision/v1p3beta1/product_search/paths.rb b/owl-bot-staging/google-cloud-vision-v1p3beta1/lib/google/cloud/vision/v1p3beta1/product_search/paths.rb new file mode 100644 index 000000000000..ad78880db1b4 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision-v1p3beta1/lib/google/cloud/vision/v1p3beta1/product_search/paths.rb @@ -0,0 +1,109 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Vision + module V1p3beta1 + module ProductSearch + # Path helper methods for the ProductSearch 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 Product resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/products/{product}` + # + # @param project [String] + # @param location [String] + # @param product [String] + # + # @return [::String] + def product_path project:, location:, product: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/products/#{product}" + end + + ## + # Create a fully-qualified ProductSet resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/productSets/{product_set}` + # + # @param project [String] + # @param location [String] + # @param product_set [String] + # + # @return [::String] + def product_set_path project:, location:, product_set: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/productSets/#{product_set}" + end + + ## + # Create a fully-qualified ReferenceImage resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/products/{product}/referenceImages/{reference_image}` + # + # @param project [String] + # @param location [String] + # @param product [String] + # @param reference_image [String] + # + # @return [::String] + def reference_image_path project:, location:, product:, reference_image: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "product cannot contain /" if product.to_s.include? "/" + + "projects/#{project}/locations/#{location}/products/#{product}/referenceImages/#{reference_image}" + end + + extend self + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-vision-v1p3beta1/lib/google/cloud/vision/v1p3beta1/product_search/rest.rb b/owl-bot-staging/google-cloud-vision-v1p3beta1/lib/google/cloud/vision/v1p3beta1/product_search/rest.rb new file mode 100644 index 000000000000..dbb9b858e8fe --- /dev/null +++ b/owl-bot-staging/google-cloud-vision-v1p3beta1/lib/google/cloud/vision/v1p3beta1/product_search/rest.rb @@ -0,0 +1,66 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/vision/v1p3beta1/version" + +require "google/cloud/vision/v1p3beta1/product_search/credentials" +require "google/cloud/vision/v1p3beta1/product_search/paths" +require "google/cloud/vision/v1p3beta1/product_search/rest/operations" +require "google/cloud/vision/v1p3beta1/product_search/rest/client" + +module Google + module Cloud + module Vision + module V1p3beta1 + ## + # Manages Products and ProductSets of reference images for use in product + # search. It uses the following resource model: + # + # - The API has a collection of {::Google::Cloud::Vision::V1p3beta1::ProductSet ProductSet} resources, named + # `projects/*/locations/*/productSets/*`, which acts as a way to put different + # products into groups to limit identification. + # + # In parallel, + # + # - The API has a collection of {::Google::Cloud::Vision::V1p3beta1::Product Product} resources, named + # `projects/*/locations/*/products/*` + # + # - Each {::Google::Cloud::Vision::V1p3beta1::Product Product} has a collection of {::Google::Cloud::Vision::V1p3beta1::ReferenceImage ReferenceImage} resources, named + # `projects/*/locations/*/products/*/referenceImages/*` + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/vision/v1p3beta1/product_search/rest" + # client = ::Google::Cloud::Vision::V1p3beta1::ProductSearch::Rest::Client.new + # + module ProductSearch + # Client for the REST transport + module Rest + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "rest", "helpers.rb" +require "google/cloud/vision/v1p3beta1/product_search/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-vision-v1p3beta1/lib/google/cloud/vision/v1p3beta1/product_search/rest/client.rb b/owl-bot-staging/google-cloud-vision-v1p3beta1/lib/google/cloud/vision/v1p3beta1/product_search/rest/client.rb new file mode 100644 index 000000000000..28f85c45cbd6 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision-v1p3beta1/lib/google/cloud/vision/v1p3beta1/product_search/rest/client.rb @@ -0,0 +1,2260 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/vision/v1p3beta1/product_search_service_pb" +require "google/cloud/vision/v1p3beta1/product_search/rest/service_stub" + +module Google + module Cloud + module Vision + module V1p3beta1 + module ProductSearch + module Rest + ## + # REST client for the ProductSearch service. + # + # Manages Products and ProductSets of reference images for use in product + # search. It uses the following resource model: + # + # - The API has a collection of {::Google::Cloud::Vision::V1p3beta1::ProductSet ProductSet} resources, named + # `projects/*/locations/*/productSets/*`, which acts as a way to put different + # products into groups to limit identification. + # + # In parallel, + # + # - The API has a collection of {::Google::Cloud::Vision::V1p3beta1::Product Product} resources, named + # `projects/*/locations/*/products/*` + # + # - Each {::Google::Cloud::Vision::V1p3beta1::Product Product} has a collection of {::Google::Cloud::Vision::V1p3beta1::ReferenceImage ReferenceImage} resources, named + # `projects/*/locations/*/products/*/referenceImages/*` + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "vision.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :product_search_stub + + ## + # Configure the ProductSearch Client class. + # + # See {::Google::Cloud::Vision::V1p3beta1::ProductSearch::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all ProductSearch clients + # ::Google::Cloud::Vision::V1p3beta1::ProductSearch::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", "Vision", "V1p3beta1"] + 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_product_set.timeout = 600.0 + default_config.rpcs.create_product_set.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [] + } + + default_config.rpcs.list_product_sets.timeout = 600.0 + default_config.rpcs.list_product_sets.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.get_product_set.timeout = 600.0 + default_config.rpcs.get_product_set.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.update_product_set.timeout = 600.0 + default_config.rpcs.update_product_set.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [] + } + + default_config.rpcs.delete_product_set.timeout = 600.0 + default_config.rpcs.delete_product_set.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.create_product.timeout = 600.0 + default_config.rpcs.create_product.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [] + } + + default_config.rpcs.list_products.timeout = 600.0 + default_config.rpcs.list_products.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.get_product.timeout = 600.0 + default_config.rpcs.get_product.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.update_product.timeout = 600.0 + default_config.rpcs.update_product.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [] + } + + default_config.rpcs.delete_product.timeout = 600.0 + default_config.rpcs.delete_product.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.create_reference_image.timeout = 600.0 + default_config.rpcs.create_reference_image.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [] + } + + default_config.rpcs.delete_reference_image.timeout = 600.0 + default_config.rpcs.delete_reference_image.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.list_reference_images.timeout = 600.0 + default_config.rpcs.list_reference_images.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.get_reference_image.timeout = 600.0 + default_config.rpcs.get_reference_image.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.add_product_to_product_set.timeout = 600.0 + default_config.rpcs.add_product_to_product_set.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [] + } + + default_config.rpcs.remove_product_from_product_set.timeout = 600.0 + default_config.rpcs.remove_product_from_product_set.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [] + } + + default_config.rpcs.list_products_in_product_set.timeout = 600.0 + default_config.rpcs.list_products_in_product_set.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.import_product_sets.timeout = 600.0 + default_config.rpcs.import_product_sets.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the ProductSearch 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::Vision::V1p3beta1::ProductSearch::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 + @product_search_stub.universe_domain + end + + ## + # Create a new ProductSearch REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Vision::V1p3beta1::ProductSearch::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Vision::V1p3beta1::ProductSearch::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the ProductSearch 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::Vision::V1p3beta1::ProductSearch::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 + + @product_search_stub = ::Google::Cloud::Vision::V1p3beta1::ProductSearch::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials, + logger: @config.logger + ) + + @product_search_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 + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::Vision::V1p3beta1::ProductSearch::Rest::Operations] + # + attr_reader :operations_client + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @product_search_stub.logger + end + + # Service calls + + ## + # Creates and returns a new ProductSet resource. + # + # Possible errors: + # + # * Returns INVALID_ARGUMENT if display_name is missing, or is longer than + # 4096 characters. + # + # @overload create_product_set(request, options = nil) + # Pass arguments to `create_product_set` via a request object, either of type + # {::Google::Cloud::Vision::V1p3beta1::CreateProductSetRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Vision::V1p3beta1::CreateProductSetRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_product_set(parent: nil, product_set: nil, product_set_id: nil) + # Pass arguments to `create_product_set` via keyword arguments. Note that at + # least one keyword argument is 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 in which the ProductSet should be created. + # + # Format is `projects/PROJECT_ID/locations/LOC_ID`. + # @param product_set [::Google::Cloud::Vision::V1p3beta1::ProductSet, ::Hash] + # Required. The ProductSet to create. + # @param product_set_id [::String] + # A user-supplied resource id for this ProductSet. If set, the server will + # attempt to use this value as the resource id. If it is already in use, an + # error is returned with code ALREADY_EXISTS. Must be at most 128 characters + # long. It cannot contain the character `/`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Vision::V1p3beta1::ProductSet] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Vision::V1p3beta1::ProductSet] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/vision/v1p3beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Vision::V1p3beta1::ProductSearch::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Vision::V1p3beta1::CreateProductSetRequest.new + # + # # Call the create_product_set method. + # result = client.create_product_set request + # + # # The returned object is of type Google::Cloud::Vision::V1p3beta1::ProductSet. + # p result + # + def create_product_set request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Vision::V1p3beta1::CreateProductSetRequest + + # Converts hash 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_product_set.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::Vision::V1p3beta1::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_product_set.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_product_set.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @product_search_stub.create_product_set 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 ProductSets in an unspecified order. + # + # Possible errors: + # + # * Returns INVALID_ARGUMENT if page_size is greater than 100, or less + # than 1. + # + # @overload list_product_sets(request, options = nil) + # Pass arguments to `list_product_sets` via a request object, either of type + # {::Google::Cloud::Vision::V1p3beta1::ListProductSetsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Vision::V1p3beta1::ListProductSetsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_product_sets(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_product_sets` via keyword arguments. Note that at + # least one keyword argument is 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 from which ProductSets should be listed. + # + # Format is `projects/PROJECT_ID/locations/LOC_ID`. + # @param page_size [::Integer] + # The maximum number of items to return. Default 10, maximum 100. + # @param page_token [::String] + # The next_page_token returned from a previous List request, if any. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Vision::V1p3beta1::ProductSet>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Vision::V1p3beta1::ProductSet>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/vision/v1p3beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Vision::V1p3beta1::ProductSearch::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Vision::V1p3beta1::ListProductSetsRequest.new + # + # # Call the list_product_sets method. + # result = client.list_product_sets 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::Vision::V1p3beta1::ProductSet. + # p item + # end + # + def list_product_sets request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Vision::V1p3beta1::ListProductSetsRequest + + # Converts hash 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_product_sets.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::Vision::V1p3beta1::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_product_sets.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_product_sets.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @product_search_stub.list_product_sets request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @product_search_stub, :list_product_sets, "product_sets", 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 information associated with a ProductSet. + # + # Possible errors: + # + # * Returns NOT_FOUND if the ProductSet does not exist. + # + # @overload get_product_set(request, options = nil) + # Pass arguments to `get_product_set` via a request object, either of type + # {::Google::Cloud::Vision::V1p3beta1::GetProductSetRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Vision::V1p3beta1::GetProductSetRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_product_set(name: nil) + # Pass arguments to `get_product_set` via keyword arguments. Note that at + # least one keyword argument is 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. Resource name of the ProductSet to get. + # + # Format is: + # `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID` + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Vision::V1p3beta1::ProductSet] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Vision::V1p3beta1::ProductSet] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/vision/v1p3beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Vision::V1p3beta1::ProductSearch::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Vision::V1p3beta1::GetProductSetRequest.new + # + # # Call the get_product_set method. + # result = client.get_product_set request + # + # # The returned object is of type Google::Cloud::Vision::V1p3beta1::ProductSet. + # p result + # + def get_product_set request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Vision::V1p3beta1::GetProductSetRequest + + # Converts hash 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_product_set.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::Vision::V1p3beta1::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_product_set.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_product_set.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @product_search_stub.get_product_set 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 + + ## + # Makes changes to a ProductSet resource. + # Only display_name can be updated currently. + # + # Possible errors: + # + # * Returns NOT_FOUND if the ProductSet does not exist. + # * Returns INVALID_ARGUMENT if display_name is present in update_mask but + # missing from the request or longer than 4096 characters. + # + # @overload update_product_set(request, options = nil) + # Pass arguments to `update_product_set` via a request object, either of type + # {::Google::Cloud::Vision::V1p3beta1::UpdateProductSetRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Vision::V1p3beta1::UpdateProductSetRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_product_set(product_set: nil, update_mask: nil) + # Pass arguments to `update_product_set` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param product_set [::Google::Cloud::Vision::V1p3beta1::ProductSet, ::Hash] + # Required. The ProductSet resource which replaces the one on the server. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # The {::Google::Protobuf::FieldMask FieldMask} that specifies which fields to + # update. + # If update_mask isn't specified, all mutable fields are to be updated. + # Valid mask path is `display_name`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Vision::V1p3beta1::ProductSet] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Vision::V1p3beta1::ProductSet] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/vision/v1p3beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Vision::V1p3beta1::ProductSearch::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Vision::V1p3beta1::UpdateProductSetRequest.new + # + # # Call the update_product_set method. + # result = client.update_product_set request + # + # # The returned object is of type Google::Cloud::Vision::V1p3beta1::ProductSet. + # p result + # + def update_product_set request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Vision::V1p3beta1::UpdateProductSetRequest + + # Converts hash 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_product_set.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::Vision::V1p3beta1::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_product_set.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_product_set.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @product_search_stub.update_product_set 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 a ProductSet. All Products and ReferenceImages in the + # ProductSet will be deleted. + # + # The actual image files are not deleted from Google Cloud Storage. + # + # Possible errors: + # + # * Returns NOT_FOUND if the ProductSet does not exist. + # + # @overload delete_product_set(request, options = nil) + # Pass arguments to `delete_product_set` via a request object, either of type + # {::Google::Cloud::Vision::V1p3beta1::DeleteProductSetRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Vision::V1p3beta1::DeleteProductSetRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_product_set(name: nil) + # Pass arguments to `delete_product_set` via keyword arguments. Note that at + # least one keyword argument is 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. Resource name of the ProductSet to delete. + # + # Format is: + # `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID` + # @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/vision/v1p3beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Vision::V1p3beta1::ProductSearch::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Vision::V1p3beta1::DeleteProductSetRequest.new + # + # # Call the delete_product_set method. + # result = client.delete_product_set request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_product_set request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Vision::V1p3beta1::DeleteProductSetRequest + + # Converts hash 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_product_set.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::Vision::V1p3beta1::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_product_set.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_product_set.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @product_search_stub.delete_product_set 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 and returns a new product resource. + # + # Possible errors: + # + # * Returns INVALID_ARGUMENT if display_name is missing or longer than 4096 + # characters. + # * Returns INVALID_ARGUMENT if description is longer than 4096 characters. + # * Returns INVALID_ARGUMENT if product_category is missing or invalid. + # + # @overload create_product(request, options = nil) + # Pass arguments to `create_product` via a request object, either of type + # {::Google::Cloud::Vision::V1p3beta1::CreateProductRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Vision::V1p3beta1::CreateProductRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_product(parent: nil, product: nil, product_id: nil) + # Pass arguments to `create_product` via keyword arguments. Note that at + # least one keyword argument is 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 in which the Product should be created. + # + # Format is + # `projects/PROJECT_ID/locations/LOC_ID`. + # @param product [::Google::Cloud::Vision::V1p3beta1::Product, ::Hash] + # Required. The product to create. + # @param product_id [::String] + # A user-supplied resource id for this Product. If set, the server will + # attempt to use this value as the resource id. If it is already in use, an + # error is returned with code ALREADY_EXISTS. Must be at most 128 characters + # long. It cannot contain the character `/`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Vision::V1p3beta1::Product] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Vision::V1p3beta1::Product] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/vision/v1p3beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Vision::V1p3beta1::ProductSearch::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Vision::V1p3beta1::CreateProductRequest.new + # + # # Call the create_product method. + # result = client.create_product request + # + # # The returned object is of type Google::Cloud::Vision::V1p3beta1::Product. + # p result + # + def create_product request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Vision::V1p3beta1::CreateProductRequest + + # Converts hash 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_product.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::Vision::V1p3beta1::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_product.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_product.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @product_search_stub.create_product 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 products in an unspecified order. + # + # Possible errors: + # + # * Returns INVALID_ARGUMENT if page_size is greater than 100 or less than 1. + # + # @overload list_products(request, options = nil) + # Pass arguments to `list_products` via a request object, either of type + # {::Google::Cloud::Vision::V1p3beta1::ListProductsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Vision::V1p3beta1::ListProductsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_products(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_products` via keyword arguments. Note that at + # least one keyword argument is 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 OR ProductSet from which Products should be listed. + # + # Format: + # `projects/PROJECT_ID/locations/LOC_ID` + # @param page_size [::Integer] + # The maximum number of items to return. Default 10, maximum 100. + # @param page_token [::String] + # The next_page_token returned from a previous List request, if any. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Vision::V1p3beta1::Product>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Vision::V1p3beta1::Product>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/vision/v1p3beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Vision::V1p3beta1::ProductSearch::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Vision::V1p3beta1::ListProductsRequest.new + # + # # Call the list_products method. + # result = client.list_products 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::Vision::V1p3beta1::Product. + # p item + # end + # + def list_products request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Vision::V1p3beta1::ListProductsRequest + + # Converts hash 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_products.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::Vision::V1p3beta1::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_products.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_products.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @product_search_stub.list_products request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @product_search_stub, :list_products, "products", 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 information associated with a Product. + # + # Possible errors: + # + # * Returns NOT_FOUND if the Product does not exist. + # + # @overload get_product(request, options = nil) + # Pass arguments to `get_product` via a request object, either of type + # {::Google::Cloud::Vision::V1p3beta1::GetProductRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Vision::V1p3beta1::GetProductRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_product(name: nil) + # Pass arguments to `get_product` via keyword arguments. Note that at + # least one keyword argument is 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. Resource name of the Product to get. + # + # Format is: + # `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID` + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Vision::V1p3beta1::Product] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Vision::V1p3beta1::Product] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/vision/v1p3beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Vision::V1p3beta1::ProductSearch::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Vision::V1p3beta1::GetProductRequest.new + # + # # Call the get_product method. + # result = client.get_product request + # + # # The returned object is of type Google::Cloud::Vision::V1p3beta1::Product. + # p result + # + def get_product request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Vision::V1p3beta1::GetProductRequest + + # Converts hash 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_product.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::Vision::V1p3beta1::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_product.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_product.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @product_search_stub.get_product 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 + + ## + # Makes changes to a Product resource. + # Only display_name, description and labels can be updated right now. + # + # If labels are updated, the change will not be reflected in queries until + # the next index time. + # + # Possible errors: + # + # * Returns NOT_FOUND if the Product does not exist. + # * Returns INVALID_ARGUMENT if display_name is present in update_mask but is + # missing from the request or longer than 4096 characters. + # * Returns INVALID_ARGUMENT if description is present in update_mask but is + # longer than 4096 characters. + # * Returns INVALID_ARGUMENT if product_category is present in update_mask. + # + # @overload update_product(request, options = nil) + # Pass arguments to `update_product` via a request object, either of type + # {::Google::Cloud::Vision::V1p3beta1::UpdateProductRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Vision::V1p3beta1::UpdateProductRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_product(product: nil, update_mask: nil) + # Pass arguments to `update_product` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param product [::Google::Cloud::Vision::V1p3beta1::Product, ::Hash] + # Required. The Product resource which replaces the one on the server. + # product.name is immutable. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # The {::Google::Protobuf::FieldMask FieldMask} that specifies which fields + # to update. + # If update_mask isn't specified, all mutable fields are to be updated. + # Valid mask paths include `product_labels`, `display_name`, and + # `description`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Vision::V1p3beta1::Product] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Vision::V1p3beta1::Product] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/vision/v1p3beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Vision::V1p3beta1::ProductSearch::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Vision::V1p3beta1::UpdateProductRequest.new + # + # # Call the update_product method. + # result = client.update_product request + # + # # The returned object is of type Google::Cloud::Vision::V1p3beta1::Product. + # p result + # + def update_product request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Vision::V1p3beta1::UpdateProductRequest + + # Converts hash 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_product.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::Vision::V1p3beta1::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_product.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_product.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @product_search_stub.update_product 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 a product and its reference images. + # + # Metadata of the product and all its images will be deleted right away, but + # search queries against ProductSets containing the product may still work + # until all related caches are refreshed. + # + # Possible errors: + # + # * Returns NOT_FOUND if the product does not exist. + # + # @overload delete_product(request, options = nil) + # Pass arguments to `delete_product` via a request object, either of type + # {::Google::Cloud::Vision::V1p3beta1::DeleteProductRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Vision::V1p3beta1::DeleteProductRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_product(name: nil) + # Pass arguments to `delete_product` via keyword arguments. Note that at + # least one keyword argument is 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. Resource name of product to delete. + # + # Format is: + # `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID` + # @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/vision/v1p3beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Vision::V1p3beta1::ProductSearch::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Vision::V1p3beta1::DeleteProductRequest.new + # + # # Call the delete_product method. + # result = client.delete_product request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_product request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Vision::V1p3beta1::DeleteProductRequest + + # Converts hash 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_product.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::Vision::V1p3beta1::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_product.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_product.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @product_search_stub.delete_product 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 and returns a new ReferenceImage resource. + # + # The `bounding_poly` field is optional. If `bounding_poly` is not specified, + # the system will try to detect regions of interest in the image that are + # compatible with the product_category on the parent product. If it is + # specified, detection is ALWAYS skipped. The system converts polygons into + # non-rotated rectangles. + # + # Note that the pipeline will resize the image if the image resolution is too + # large to process (above 50MP). + # + # Possible errors: + # + # * Returns INVALID_ARGUMENT if the image_uri is missing or longer than 4096 + # characters. + # * Returns INVALID_ARGUMENT if the product does not exist. + # * Returns INVALID_ARGUMENT if bounding_poly is not provided, and nothing + # compatible with the parent product's product_category is detected. + # * Returns INVALID_ARGUMENT if bounding_poly contains more than 10 polygons. + # + # @overload create_reference_image(request, options = nil) + # Pass arguments to `create_reference_image` via a request object, either of type + # {::Google::Cloud::Vision::V1p3beta1::CreateReferenceImageRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Vision::V1p3beta1::CreateReferenceImageRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_reference_image(parent: nil, reference_image: nil, reference_image_id: nil) + # Pass arguments to `create_reference_image` via keyword arguments. Note that at + # least one keyword argument is 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. Resource name of the product in which to create the reference image. + # + # Format is + # `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`. + # @param reference_image [::Google::Cloud::Vision::V1p3beta1::ReferenceImage, ::Hash] + # Required. The reference image to create. + # If an image ID is specified, it is ignored. + # @param reference_image_id [::String] + # A user-supplied resource id for the ReferenceImage to be added. If set, + # the server will attempt to use this value as the resource id. If it is + # already in use, an error is returned with code ALREADY_EXISTS. Must be at + # most 128 characters long. It cannot contain the character `/`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Vision::V1p3beta1::ReferenceImage] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Vision::V1p3beta1::ReferenceImage] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/vision/v1p3beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Vision::V1p3beta1::ProductSearch::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Vision::V1p3beta1::CreateReferenceImageRequest.new + # + # # Call the create_reference_image method. + # result = client.create_reference_image request + # + # # The returned object is of type Google::Cloud::Vision::V1p3beta1::ReferenceImage. + # p result + # + def create_reference_image request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Vision::V1p3beta1::CreateReferenceImageRequest + + # Converts hash 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_reference_image.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::Vision::V1p3beta1::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_reference_image.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_reference_image.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @product_search_stub.create_reference_image 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 a reference image. + # + # The image metadata will be deleted right away, but search queries + # against ProductSets containing the image may still work until all related + # caches are refreshed. + # + # The actual image files are not deleted from Google Cloud Storage. + # + # Possible errors: + # + # * Returns NOT_FOUND if the reference image does not exist. + # + # @overload delete_reference_image(request, options = nil) + # Pass arguments to `delete_reference_image` via a request object, either of type + # {::Google::Cloud::Vision::V1p3beta1::DeleteReferenceImageRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Vision::V1p3beta1::DeleteReferenceImageRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_reference_image(name: nil) + # Pass arguments to `delete_reference_image` via keyword arguments. Note that at + # least one keyword argument is 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 reference image to delete. + # + # Format is: + # + # `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID` + # @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/vision/v1p3beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Vision::V1p3beta1::ProductSearch::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Vision::V1p3beta1::DeleteReferenceImageRequest.new + # + # # Call the delete_reference_image method. + # result = client.delete_reference_image request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_reference_image request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Vision::V1p3beta1::DeleteReferenceImageRequest + + # Converts hash 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_reference_image.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::Vision::V1p3beta1::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_reference_image.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_reference_image.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @product_search_stub.delete_reference_image 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 reference images. + # + # Possible errors: + # + # * Returns NOT_FOUND if the parent product does not exist. + # * Returns INVALID_ARGUMENT if the page_size is greater than 100, or less + # than 1. + # + # @overload list_reference_images(request, options = nil) + # Pass arguments to `list_reference_images` via a request object, either of type + # {::Google::Cloud::Vision::V1p3beta1::ListReferenceImagesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Vision::V1p3beta1::ListReferenceImagesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_reference_images(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_reference_images` via keyword arguments. Note that at + # least one keyword argument is 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. Resource name of the product containing the reference images. + # + # Format is + # `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`. + # @param page_size [::Integer] + # The maximum number of items to return. Default 10, maximum 100. + # @param page_token [::String] + # A token identifying a page of results to be returned. This is the value + # of `nextPageToken` returned in a previous reference image list request. + # + # Defaults to the first page if not specified. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Vision::V1p3beta1::ReferenceImage>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Vision::V1p3beta1::ReferenceImage>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/vision/v1p3beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Vision::V1p3beta1::ProductSearch::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Vision::V1p3beta1::ListReferenceImagesRequest.new + # + # # Call the list_reference_images method. + # result = client.list_reference_images 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::Vision::V1p3beta1::ReferenceImage. + # p item + # end + # + def list_reference_images request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Vision::V1p3beta1::ListReferenceImagesRequest + + # Converts hash 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_reference_images.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::Vision::V1p3beta1::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_reference_images.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_reference_images.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @product_search_stub.list_reference_images request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @product_search_stub, :list_reference_images, "reference_images", 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 information associated with a ReferenceImage. + # + # Possible errors: + # + # * Returns NOT_FOUND if the specified image does not exist. + # + # @overload get_reference_image(request, options = nil) + # Pass arguments to `get_reference_image` via a request object, either of type + # {::Google::Cloud::Vision::V1p3beta1::GetReferenceImageRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Vision::V1p3beta1::GetReferenceImageRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_reference_image(name: nil) + # Pass arguments to `get_reference_image` via keyword arguments. Note that at + # least one keyword argument is 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 ReferenceImage to get. + # + # Format is: + # + # `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Vision::V1p3beta1::ReferenceImage] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Vision::V1p3beta1::ReferenceImage] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/vision/v1p3beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Vision::V1p3beta1::ProductSearch::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Vision::V1p3beta1::GetReferenceImageRequest.new + # + # # Call the get_reference_image method. + # result = client.get_reference_image request + # + # # The returned object is of type Google::Cloud::Vision::V1p3beta1::ReferenceImage. + # p result + # + def get_reference_image request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Vision::V1p3beta1::GetReferenceImageRequest + + # Converts hash 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_reference_image.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::Vision::V1p3beta1::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_reference_image.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_reference_image.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @product_search_stub.get_reference_image 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 + + ## + # Adds a Product to the specified ProductSet. If the Product is already + # present, no change is made. + # + # One Product can be added to at most 100 ProductSets. + # + # Possible errors: + # + # * Returns NOT_FOUND if the Product or the ProductSet doesn't exist. + # + # @overload add_product_to_product_set(request, options = nil) + # Pass arguments to `add_product_to_product_set` via a request object, either of type + # {::Google::Cloud::Vision::V1p3beta1::AddProductToProductSetRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Vision::V1p3beta1::AddProductToProductSetRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload add_product_to_product_set(name: nil, product: nil) + # Pass arguments to `add_product_to_product_set` via keyword arguments. Note that at + # least one keyword argument is 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 for the ProductSet to modify. + # + # Format is: + # `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID` + # @param product [::String] + # Required. The resource name for the Product to be added to this ProductSet. + # + # Format is: + # `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID` + # @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/vision/v1p3beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Vision::V1p3beta1::ProductSearch::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Vision::V1p3beta1::AddProductToProductSetRequest.new + # + # # Call the add_product_to_product_set method. + # result = client.add_product_to_product_set request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def add_product_to_product_set request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Vision::V1p3beta1::AddProductToProductSetRequest + + # Converts hash 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.add_product_to_product_set.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::Vision::V1p3beta1::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.add_product_to_product_set.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.add_product_to_product_set.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @product_search_stub.add_product_to_product_set 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 + + ## + # Removes a Product from the specified ProductSet. + # + # Possible errors: + # + # * Returns NOT_FOUND If the Product is not found under the ProductSet. + # + # @overload remove_product_from_product_set(request, options = nil) + # Pass arguments to `remove_product_from_product_set` via a request object, either of type + # {::Google::Cloud::Vision::V1p3beta1::RemoveProductFromProductSetRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Vision::V1p3beta1::RemoveProductFromProductSetRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload remove_product_from_product_set(name: nil, product: nil) + # Pass arguments to `remove_product_from_product_set` via keyword arguments. Note that at + # least one keyword argument is 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 for the ProductSet to modify. + # + # Format is: + # `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID` + # @param product [::String] + # Required. The resource name for the Product to be removed from this ProductSet. + # + # Format is: + # `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID` + # @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/vision/v1p3beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Vision::V1p3beta1::ProductSearch::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Vision::V1p3beta1::RemoveProductFromProductSetRequest.new + # + # # Call the remove_product_from_product_set method. + # result = client.remove_product_from_product_set request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def remove_product_from_product_set request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Vision::V1p3beta1::RemoveProductFromProductSetRequest + + # Converts hash 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.remove_product_from_product_set.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::Vision::V1p3beta1::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.remove_product_from_product_set.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.remove_product_from_product_set.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @product_search_stub.remove_product_from_product_set 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 the Products in a ProductSet, in an unspecified order. If the + # ProductSet does not exist, the products field of the response will be + # empty. + # + # Possible errors: + # + # * Returns INVALID_ARGUMENT if page_size is greater than 100 or less than 1. + # + # @overload list_products_in_product_set(request, options = nil) + # Pass arguments to `list_products_in_product_set` via a request object, either of type + # {::Google::Cloud::Vision::V1p3beta1::ListProductsInProductSetRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Vision::V1p3beta1::ListProductsInProductSetRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_products_in_product_set(name: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_products_in_product_set` via keyword arguments. Note that at + # least one keyword argument is 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 ProductSet resource for which to retrieve Products. + # + # Format is: + # `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID` + # @param page_size [::Integer] + # The maximum number of items to return. Default 10, maximum 100. + # @param page_token [::String] + # The next_page_token returned from a previous List request, if any. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Vision::V1p3beta1::Product>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Vision::V1p3beta1::Product>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/vision/v1p3beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Vision::V1p3beta1::ProductSearch::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Vision::V1p3beta1::ListProductsInProductSetRequest.new + # + # # Call the list_products_in_product_set method. + # result = client.list_products_in_product_set 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::Vision::V1p3beta1::Product. + # p item + # end + # + def list_products_in_product_set request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Vision::V1p3beta1::ListProductsInProductSetRequest + + # Converts hash 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_products_in_product_set.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::Vision::V1p3beta1::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_products_in_product_set.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_products_in_product_set.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @product_search_stub.list_products_in_product_set request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @product_search_stub, :list_products_in_product_set, "products", 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 + + ## + # Asynchronous API that imports a list of reference images to specified + # product sets based on a list of image information. + # + # The {::Google::Longrunning::Operation google.longrunning.Operation} API can be + # used to keep track of the progress and results of the request. + # `Operation.metadata` contains `BatchOperationMetadata`. (progress) + # `Operation.response` contains `ImportProductSetsResponse`. (results) + # + # The input source of this method is a csv file on Google Cloud Storage. + # For the format of the csv file please see + # {::Google::Cloud::Vision::V1p3beta1::ImportProductSetsGcsSource#csv_file_uri ImportProductSetsGcsSource.csv_file_uri}. + # + # @overload import_product_sets(request, options = nil) + # Pass arguments to `import_product_sets` via a request object, either of type + # {::Google::Cloud::Vision::V1p3beta1::ImportProductSetsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Vision::V1p3beta1::ImportProductSetsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_product_sets(parent: nil, input_config: nil) + # Pass arguments to `import_product_sets` via keyword arguments. Note that at + # least one keyword argument is 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 in which the ProductSets should be imported. + # + # Format is `projects/PROJECT_ID/locations/LOC_ID`. + # @param input_config [::Google::Cloud::Vision::V1p3beta1::ImportProductSetsInputConfig, ::Hash] + # Required. The input content for the list of requests. + # @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/vision/v1p3beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Vision::V1p3beta1::ProductSearch::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Vision::V1p3beta1::ImportProductSetsRequest.new + # + # # Call the import_product_sets method. + # result = client.import_product_sets 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 import_product_sets request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Vision::V1p3beta1::ImportProductSetsRequest + + # Converts hash 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_product_sets.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::Vision::V1p3beta1::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_product_sets.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.import_product_sets.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @product_search_stub.import_product_sets 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 + + ## + # Configuration class for the ProductSearch REST API. + # + # This class represents the configuration for ProductSearch 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::Vision::V1p3beta1::ProductSearch::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_product_set to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Vision::V1p3beta1::ProductSearch::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.create_product_set.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Vision::V1p3beta1::ProductSearch::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.create_product_set.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 = "vision.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 ProductSearch 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_product_set` + # @return [::Gapic::Config::Method] + # + attr_reader :create_product_set + ## + # RPC-specific configuration for `list_product_sets` + # @return [::Gapic::Config::Method] + # + attr_reader :list_product_sets + ## + # RPC-specific configuration for `get_product_set` + # @return [::Gapic::Config::Method] + # + attr_reader :get_product_set + ## + # RPC-specific configuration for `update_product_set` + # @return [::Gapic::Config::Method] + # + attr_reader :update_product_set + ## + # RPC-specific configuration for `delete_product_set` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_product_set + ## + # RPC-specific configuration for `create_product` + # @return [::Gapic::Config::Method] + # + attr_reader :create_product + ## + # RPC-specific configuration for `list_products` + # @return [::Gapic::Config::Method] + # + attr_reader :list_products + ## + # RPC-specific configuration for `get_product` + # @return [::Gapic::Config::Method] + # + attr_reader :get_product + ## + # RPC-specific configuration for `update_product` + # @return [::Gapic::Config::Method] + # + attr_reader :update_product + ## + # RPC-specific configuration for `delete_product` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_product + ## + # RPC-specific configuration for `create_reference_image` + # @return [::Gapic::Config::Method] + # + attr_reader :create_reference_image + ## + # RPC-specific configuration for `delete_reference_image` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_reference_image + ## + # RPC-specific configuration for `list_reference_images` + # @return [::Gapic::Config::Method] + # + attr_reader :list_reference_images + ## + # RPC-specific configuration for `get_reference_image` + # @return [::Gapic::Config::Method] + # + attr_reader :get_reference_image + ## + # RPC-specific configuration for `add_product_to_product_set` + # @return [::Gapic::Config::Method] + # + attr_reader :add_product_to_product_set + ## + # RPC-specific configuration for `remove_product_from_product_set` + # @return [::Gapic::Config::Method] + # + attr_reader :remove_product_from_product_set + ## + # RPC-specific configuration for `list_products_in_product_set` + # @return [::Gapic::Config::Method] + # + attr_reader :list_products_in_product_set + ## + # RPC-specific configuration for `import_product_sets` + # @return [::Gapic::Config::Method] + # + attr_reader :import_product_sets + + # @private + def initialize parent_rpcs = nil + create_product_set_config = parent_rpcs.create_product_set if parent_rpcs.respond_to? :create_product_set + @create_product_set = ::Gapic::Config::Method.new create_product_set_config + list_product_sets_config = parent_rpcs.list_product_sets if parent_rpcs.respond_to? :list_product_sets + @list_product_sets = ::Gapic::Config::Method.new list_product_sets_config + get_product_set_config = parent_rpcs.get_product_set if parent_rpcs.respond_to? :get_product_set + @get_product_set = ::Gapic::Config::Method.new get_product_set_config + update_product_set_config = parent_rpcs.update_product_set if parent_rpcs.respond_to? :update_product_set + @update_product_set = ::Gapic::Config::Method.new update_product_set_config + delete_product_set_config = parent_rpcs.delete_product_set if parent_rpcs.respond_to? :delete_product_set + @delete_product_set = ::Gapic::Config::Method.new delete_product_set_config + create_product_config = parent_rpcs.create_product if parent_rpcs.respond_to? :create_product + @create_product = ::Gapic::Config::Method.new create_product_config + list_products_config = parent_rpcs.list_products if parent_rpcs.respond_to? :list_products + @list_products = ::Gapic::Config::Method.new list_products_config + get_product_config = parent_rpcs.get_product if parent_rpcs.respond_to? :get_product + @get_product = ::Gapic::Config::Method.new get_product_config + update_product_config = parent_rpcs.update_product if parent_rpcs.respond_to? :update_product + @update_product = ::Gapic::Config::Method.new update_product_config + delete_product_config = parent_rpcs.delete_product if parent_rpcs.respond_to? :delete_product + @delete_product = ::Gapic::Config::Method.new delete_product_config + create_reference_image_config = parent_rpcs.create_reference_image if parent_rpcs.respond_to? :create_reference_image + @create_reference_image = ::Gapic::Config::Method.new create_reference_image_config + delete_reference_image_config = parent_rpcs.delete_reference_image if parent_rpcs.respond_to? :delete_reference_image + @delete_reference_image = ::Gapic::Config::Method.new delete_reference_image_config + list_reference_images_config = parent_rpcs.list_reference_images if parent_rpcs.respond_to? :list_reference_images + @list_reference_images = ::Gapic::Config::Method.new list_reference_images_config + get_reference_image_config = parent_rpcs.get_reference_image if parent_rpcs.respond_to? :get_reference_image + @get_reference_image = ::Gapic::Config::Method.new get_reference_image_config + add_product_to_product_set_config = parent_rpcs.add_product_to_product_set if parent_rpcs.respond_to? :add_product_to_product_set + @add_product_to_product_set = ::Gapic::Config::Method.new add_product_to_product_set_config + remove_product_from_product_set_config = parent_rpcs.remove_product_from_product_set if parent_rpcs.respond_to? :remove_product_from_product_set + @remove_product_from_product_set = ::Gapic::Config::Method.new remove_product_from_product_set_config + list_products_in_product_set_config = parent_rpcs.list_products_in_product_set if parent_rpcs.respond_to? :list_products_in_product_set + @list_products_in_product_set = ::Gapic::Config::Method.new list_products_in_product_set_config + import_product_sets_config = parent_rpcs.import_product_sets if parent_rpcs.respond_to? :import_product_sets + @import_product_sets = ::Gapic::Config::Method.new import_product_sets_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-vision-v1p3beta1/lib/google/cloud/vision/v1p3beta1/product_search/rest/operations.rb b/owl-bot-staging/google-cloud-vision-v1p3beta1/lib/google/cloud/vision/v1p3beta1/product_search/rest/operations.rb new file mode 100644 index 000000000000..7e192b331f69 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision-v1p3beta1/lib/google/cloud/vision/v1p3beta1/product_search/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 Vision + module V1p3beta1 + module ProductSearch + module Rest + # Service that implements Longrunning Operations API. + class Operations + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "vision.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :operations_stub + + ## + # Configuration for the ProductSearch 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 ProductSearch 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::Vision::V1p3beta1::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::Vision::V1p3beta1::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::Vision::V1p3beta1::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::Vision::V1p3beta1::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 = "vision.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{^operations(?:/.*)?$}, true] + ] + ) + 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-vision-v1p3beta1/lib/google/cloud/vision/v1p3beta1/product_search/rest/service_stub.rb b/owl-bot-staging/google-cloud-vision-v1p3beta1/lib/google/cloud/vision/v1p3beta1/product_search/rest/service_stub.rb new file mode 100644 index 000000000000..cda5e5059ea4 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision-v1p3beta1/lib/google/cloud/vision/v1p3beta1/product_search/rest/service_stub.rb @@ -0,0 +1,1187 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/vision/v1p3beta1/product_search_service_pb" + +module Google + module Cloud + module Vision + module V1p3beta1 + module ProductSearch + module Rest + ## + # REST service stub for the ProductSearch 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_product_set REST call + # + # @param request_pb [::Google::Cloud::Vision::V1p3beta1::CreateProductSetRequest] + # 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::Vision::V1p3beta1::ProductSet] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Vision::V1p3beta1::ProductSet] + # A result object deserialized from the server's reply + def create_product_set request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_product_set_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_product_set", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Vision::V1p3beta1::ProductSet.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_product_sets REST call + # + # @param request_pb [::Google::Cloud::Vision::V1p3beta1::ListProductSetsRequest] + # 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::Vision::V1p3beta1::ListProductSetsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Vision::V1p3beta1::ListProductSetsResponse] + # A result object deserialized from the server's reply + def list_product_sets request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_product_sets_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_product_sets", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Vision::V1p3beta1::ListProductSetsResponse.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_product_set REST call + # + # @param request_pb [::Google::Cloud::Vision::V1p3beta1::GetProductSetRequest] + # 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::Vision::V1p3beta1::ProductSet] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Vision::V1p3beta1::ProductSet] + # A result object deserialized from the server's reply + def get_product_set request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_product_set_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_product_set", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Vision::V1p3beta1::ProductSet.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_product_set REST call + # + # @param request_pb [::Google::Cloud::Vision::V1p3beta1::UpdateProductSetRequest] + # 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::Vision::V1p3beta1::ProductSet] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Vision::V1p3beta1::ProductSet] + # A result object deserialized from the server's reply + def update_product_set request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_product_set_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_product_set", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Vision::V1p3beta1::ProductSet.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_product_set REST call + # + # @param request_pb [::Google::Cloud::Vision::V1p3beta1::DeleteProductSetRequest] + # 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_product_set request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_product_set_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_product_set", + 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 create_product REST call + # + # @param request_pb [::Google::Cloud::Vision::V1p3beta1::CreateProductRequest] + # 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::Vision::V1p3beta1::Product] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Vision::V1p3beta1::Product] + # A result object deserialized from the server's reply + def create_product request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_product_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_product", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Vision::V1p3beta1::Product.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_products REST call + # + # @param request_pb [::Google::Cloud::Vision::V1p3beta1::ListProductsRequest] + # 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::Vision::V1p3beta1::ListProductsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Vision::V1p3beta1::ListProductsResponse] + # A result object deserialized from the server's reply + def list_products request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_products_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_products", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Vision::V1p3beta1::ListProductsResponse.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_product REST call + # + # @param request_pb [::Google::Cloud::Vision::V1p3beta1::GetProductRequest] + # 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::Vision::V1p3beta1::Product] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Vision::V1p3beta1::Product] + # A result object deserialized from the server's reply + def get_product request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_product_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_product", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Vision::V1p3beta1::Product.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_product REST call + # + # @param request_pb [::Google::Cloud::Vision::V1p3beta1::UpdateProductRequest] + # 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::Vision::V1p3beta1::Product] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Vision::V1p3beta1::Product] + # A result object deserialized from the server's reply + def update_product request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_product_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_product", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Vision::V1p3beta1::Product.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_product REST call + # + # @param request_pb [::Google::Cloud::Vision::V1p3beta1::DeleteProductRequest] + # 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_product request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_product_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_product", + 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 create_reference_image REST call + # + # @param request_pb [::Google::Cloud::Vision::V1p3beta1::CreateReferenceImageRequest] + # 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::Vision::V1p3beta1::ReferenceImage] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Vision::V1p3beta1::ReferenceImage] + # A result object deserialized from the server's reply + def create_reference_image request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_reference_image_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_reference_image", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Vision::V1p3beta1::ReferenceImage.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_reference_image REST call + # + # @param request_pb [::Google::Cloud::Vision::V1p3beta1::DeleteReferenceImageRequest] + # 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_reference_image request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_reference_image_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_reference_image", + 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 list_reference_images REST call + # + # @param request_pb [::Google::Cloud::Vision::V1p3beta1::ListReferenceImagesRequest] + # 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::Vision::V1p3beta1::ListReferenceImagesResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Vision::V1p3beta1::ListReferenceImagesResponse] + # A result object deserialized from the server's reply + def list_reference_images request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_reference_images_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_reference_images", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Vision::V1p3beta1::ListReferenceImagesResponse.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_reference_image REST call + # + # @param request_pb [::Google::Cloud::Vision::V1p3beta1::GetReferenceImageRequest] + # 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::Vision::V1p3beta1::ReferenceImage] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Vision::V1p3beta1::ReferenceImage] + # A result object deserialized from the server's reply + def get_reference_image request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_reference_image_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_reference_image", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Vision::V1p3beta1::ReferenceImage.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the add_product_to_product_set REST call + # + # @param request_pb [::Google::Cloud::Vision::V1p3beta1::AddProductToProductSetRequest] + # 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 add_product_to_product_set request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_add_product_to_product_set_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: "add_product_to_product_set", + 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 remove_product_from_product_set REST call + # + # @param request_pb [::Google::Cloud::Vision::V1p3beta1::RemoveProductFromProductSetRequest] + # 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 remove_product_from_product_set request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_remove_product_from_product_set_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: "remove_product_from_product_set", + 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 list_products_in_product_set REST call + # + # @param request_pb [::Google::Cloud::Vision::V1p3beta1::ListProductsInProductSetRequest] + # 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::Vision::V1p3beta1::ListProductsInProductSetResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Vision::V1p3beta1::ListProductsInProductSetResponse] + # A result object deserialized from the server's reply + def list_products_in_product_set request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_products_in_product_set_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_products_in_product_set", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Vision::V1p3beta1::ListProductsInProductSetResponse.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_product_sets REST call + # + # @param request_pb [::Google::Cloud::Vision::V1p3beta1::ImportProductSetsRequest] + # 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 import_product_sets request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_import_product_sets_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_product_sets", + 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 + + ## + # @private + # + # GRPC transcoding helper method for the create_product_set REST call + # + # @param request_pb [::Google::Cloud::Vision::V1p3beta1::CreateProductSetRequest] + # 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_product_set_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1p3beta1/{parent}/productSets", + body: "product_set", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_product_sets REST call + # + # @param request_pb [::Google::Cloud::Vision::V1p3beta1::ListProductSetsRequest] + # 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_product_sets_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1p3beta1/{parent}/productSets", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_product_set REST call + # + # @param request_pb [::Google::Cloud::Vision::V1p3beta1::GetProductSetRequest] + # 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_product_set_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1p3beta1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/productSets/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_product_set REST call + # + # @param request_pb [::Google::Cloud::Vision::V1p3beta1::UpdateProductSetRequest] + # 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_product_set_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v1p3beta1/{product_set.name}", + body: "product_set", + matches: [ + ["product_set.name", %r{^projects/[^/]+/locations/[^/]+/productSets/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_product_set REST call + # + # @param request_pb [::Google::Cloud::Vision::V1p3beta1::DeleteProductSetRequest] + # 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_product_set_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1p3beta1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/productSets/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_product REST call + # + # @param request_pb [::Google::Cloud::Vision::V1p3beta1::CreateProductRequest] + # 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_product_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1p3beta1/{parent}/products", + body: "product", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_products REST call + # + # @param request_pb [::Google::Cloud::Vision::V1p3beta1::ListProductsRequest] + # 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_products_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1p3beta1/{parent}/products", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_product REST call + # + # @param request_pb [::Google::Cloud::Vision::V1p3beta1::GetProductRequest] + # 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_product_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1p3beta1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/products/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_product REST call + # + # @param request_pb [::Google::Cloud::Vision::V1p3beta1::UpdateProductRequest] + # 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_product_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v1p3beta1/{product.name}", + body: "product", + matches: [ + ["product.name", %r{^projects/[^/]+/locations/[^/]+/products/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_product REST call + # + # @param request_pb [::Google::Cloud::Vision::V1p3beta1::DeleteProductRequest] + # 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_product_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1p3beta1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/products/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_reference_image REST call + # + # @param request_pb [::Google::Cloud::Vision::V1p3beta1::CreateReferenceImageRequest] + # 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_reference_image_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1p3beta1/{parent}/referenceImages", + body: "reference_image", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/products/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_reference_image REST call + # + # @param request_pb [::Google::Cloud::Vision::V1p3beta1::DeleteReferenceImageRequest] + # 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_reference_image_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1p3beta1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/products/[^/]+/referenceImages/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_reference_images REST call + # + # @param request_pb [::Google::Cloud::Vision::V1p3beta1::ListReferenceImagesRequest] + # 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_reference_images_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1p3beta1/{parent}/referenceImages", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/products/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_reference_image REST call + # + # @param request_pb [::Google::Cloud::Vision::V1p3beta1::GetReferenceImageRequest] + # 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_reference_image_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1p3beta1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/products/[^/]+/referenceImages/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the add_product_to_product_set REST call + # + # @param request_pb [::Google::Cloud::Vision::V1p3beta1::AddProductToProductSetRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_add_product_to_product_set_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1p3beta1/{name}:addProduct", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/productSets/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the remove_product_from_product_set REST call + # + # @param request_pb [::Google::Cloud::Vision::V1p3beta1::RemoveProductFromProductSetRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_remove_product_from_product_set_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1p3beta1/{name}:removeProduct", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/productSets/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_products_in_product_set REST call + # + # @param request_pb [::Google::Cloud::Vision::V1p3beta1::ListProductsInProductSetRequest] + # 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_products_in_product_set_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1p3beta1/{name}/products", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/productSets/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the import_product_sets REST call + # + # @param request_pb [::Google::Cloud::Vision::V1p3beta1::ImportProductSetsRequest] + # 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_product_sets_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1p3beta1/{parent}/productSets:import", + body: "*", + 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-vision-v1p3beta1/lib/google/cloud/vision/v1p3beta1/product_search_pb.rb b/owl-bot-staging/google-cloud-vision-v1p3beta1/lib/google/cloud/vision/v1p3beta1/product_search_pb.rb new file mode 100644 index 000000000000..3f311656f1a5 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision-v1p3beta1/lib/google/cloud/vision/v1p3beta1/product_search_pb.rb @@ -0,0 +1,30 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/vision/v1p3beta1/product_search.proto + +require 'google/protobuf' + +require 'google/api/resource_pb' +require 'google/cloud/vision/v1p3beta1/geometry_pb' +require 'google/cloud/vision/v1p3beta1/product_search_service_pb' +require 'google/protobuf/timestamp_pb' + + +descriptor_data = "\n2google/cloud/vision/v1p3beta1/product_search.proto\x12\x1dgoogle.cloud.vision.v1p3beta1\x1a\x19google/api/resource.proto\x1a,google/cloud/vision/v1p3beta1/geometry.proto\x1a:google/cloud/vision/v1p3beta1/product_search_service.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xc1\x01\n\x13ProductSearchParams\x12\x42\n\rbounding_poly\x18\t \x01(\x0b\x32+.google.cloud.vision.v1p3beta1.BoundingPoly\x12:\n\x0bproduct_set\x18\x06 \x01(\tB%\xfa\x41\"\n vision.googleapis.com/ProductSet\x12\x1a\n\x12product_categories\x18\x07 \x03(\t\x12\x0e\n\x06\x66ilter\x18\x08 \x01(\t\"\xb2\x05\n\x14ProductSearchResults\x12.\n\nindex_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12K\n\x07results\x18\x05 \x03(\x0b\x32:.google.cloud.vision.v1p3beta1.ProductSearchResults.Result\x12\x62\n\x17product_grouped_results\x18\x06 \x03(\x0b\x32\x41.google.cloud.vision.v1p3beta1.ProductSearchResults.GroupedResult\x1a_\n\x06Result\x12\x37\n\x07product\x18\x01 \x01(\x0b\x32&.google.cloud.vision.v1p3beta1.Product\x12\r\n\x05score\x18\x02 \x01(\x02\x12\r\n\x05image\x18\x03 \x01(\t\x1aS\n\x10ObjectAnnotation\x12\x0b\n\x03mid\x18\x01 \x01(\t\x12\x15\n\rlanguage_code\x18\x02 \x01(\t\x12\x0c\n\x04name\x18\x03 \x01(\t\x12\r\n\x05score\x18\x04 \x01(\x02\x1a\x82\x02\n\rGroupedResult\x12\x42\n\rbounding_poly\x18\x01 \x01(\x0b\x32+.google.cloud.vision.v1p3beta1.BoundingPoly\x12K\n\x07results\x18\x02 \x03(\x0b\x32:.google.cloud.vision.v1p3beta1.ProductSearchResults.Result\x12`\n\x12object_annotations\x18\x03 \x03(\x0b\x32\x44.google.cloud.vision.v1p3beta1.ProductSearchResults.ObjectAnnotationB~\n!com.google.cloud.vision.v1p3beta1B\x12ProductSearchProtoP\x01Z9cloud.google.com/go/vision/apiv1p3beta1/visionpb;visionpb\xf8\x01\x01\xa2\x02\x04GCVNb\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module Vision + module V1p3beta1 + ProductSearchParams = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p3beta1.ProductSearchParams").msgclass + ProductSearchResults = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p3beta1.ProductSearchResults").msgclass + ProductSearchResults::Result = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p3beta1.ProductSearchResults.Result").msgclass + ProductSearchResults::ObjectAnnotation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p3beta1.ProductSearchResults.ObjectAnnotation").msgclass + ProductSearchResults::GroupedResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p3beta1.ProductSearchResults.GroupedResult").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-vision-v1p3beta1/lib/google/cloud/vision/v1p3beta1/product_search_service_pb.rb b/owl-bot-staging/google-cloud-vision-v1p3beta1/lib/google/cloud/vision/v1p3beta1/product_search_service_pb.rb new file mode 100644 index 000000000000..44e4525965db --- /dev/null +++ b/owl-bot-staging/google-cloud-vision-v1p3beta1/lib/google/cloud/vision/v1p3beta1/product_search_service_pb.rb @@ -0,0 +1,62 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/vision/v1p3beta1/product_search_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/vision/v1p3beta1/geometry_pb' +require 'google/longrunning/operations_pb' +require 'google/protobuf/empty_pb' +require 'google/protobuf/field_mask_pb' +require 'google/protobuf/timestamp_pb' +require 'google/rpc/status_pb' + + +descriptor_data = "\n:google/cloud/vision/v1p3beta1/product_search_service.proto\x12\x1dgoogle.cloud.vision.v1p3beta1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a,google/cloud/vision/v1p3beta1/geometry.proto\x1a#google/longrunning/operations.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x17google/rpc/status.proto\"\xb2\x02\n\x07Product\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x14\n\x0c\x64isplay_name\x18\x02 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x03 \x01(\t\x12\x1d\n\x10product_category\x18\x04 \x01(\tB\x03\xe0\x41\x05\x12G\n\x0eproduct_labels\x18\x05 \x03(\x0b\x32/.google.cloud.vision.v1p3beta1.Product.KeyValue\x1a&\n\x08KeyValue\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:^\xea\x41[\n\x1dvision.googleapis.com/Product\x12:projects/{project}/locations/{location}/products/{product}\"\xfd\x01\n\nProductSet\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x14\n\x0c\x64isplay_name\x18\x02 \x01(\t\x12\x33\n\nindex_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12,\n\x0bindex_error\x18\x04 \x01(\x0b\x32\x12.google.rpc.StatusB\x03\xe0\x41\x03:h\xea\x41\x65\n vision.googleapis.com/ProductSet\x12\x41projects/{project}/locations/{location}/productSets/{product_set}\"\x85\x02\n\x0eReferenceImage\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x10\n\x03uri\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12H\n\x0e\x62ounding_polys\x18\x03 \x03(\x0b\x32+.google.cloud.vision.v1p3beta1.BoundingPolyB\x03\xe0\x41\x01:\x88\x01\xea\x41\x84\x01\n$vision.googleapis.com/ReferenceImage\x12\\projects/{project}/locations/{location}/products/{product}/referenceImages/{reference_image}\"\xa3\x01\n\x14\x43reateProductRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\x12<\n\x07product\x18\x02 \x01(\x0b\x32&.google.cloud.vision.v1p3beta1.ProductB\x03\xe0\x41\x02\x12\x12\n\nproduct_id\x18\x03 \x01(\t\"w\n\x13ListProductsRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\"i\n\x14ListProductsResponse\x12\x38\n\x08products\x18\x01 \x03(\x0b\x32&.google.cloud.vision.v1p3beta1.Product\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"H\n\x11GetProductRequest\x12\x33\n\x04name\x18\x01 \x01(\tB%\xe0\x41\x02\xfa\x41\x1f\n\x1dvision.googleapis.com/Product\"\x85\x01\n\x14UpdateProductRequest\x12<\n\x07product\x18\x01 \x01(\x0b\x32&.google.cloud.vision.v1p3beta1.ProductB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"K\n\x14\x44\x65leteProductRequest\x12\x33\n\x04name\x18\x01 \x01(\tB%\xe0\x41\x02\xfa\x41\x1f\n\x1dvision.googleapis.com/Product\"\xb1\x01\n\x17\x43reateProductSetRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\x12\x43\n\x0bproduct_set\x18\x02 \x01(\x0b\x32).google.cloud.vision.v1p3beta1.ProductSetB\x03\xe0\x41\x02\x12\x16\n\x0eproduct_set_id\x18\x03 \x01(\t\"z\n\x16ListProductSetsRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\"s\n\x17ListProductSetsResponse\x12?\n\x0cproduct_sets\x18\x01 \x03(\x0b\x32).google.cloud.vision.v1p3beta1.ProductSet\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"N\n\x14GetProductSetRequest\x12\x36\n\x04name\x18\x01 \x01(\tB(\xe0\x41\x02\xfa\x41\"\n vision.googleapis.com/ProductSet\"\x8f\x01\n\x17UpdateProductSetRequest\x12\x43\n\x0bproduct_set\x18\x01 \x01(\x0b\x32).google.cloud.vision.v1p3beta1.ProductSetB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"Q\n\x17\x44\x65leteProductSetRequest\x12\x36\n\x04name\x18\x01 \x01(\tB(\xe0\x41\x02\xfa\x41\"\n vision.googleapis.com/ProductSet\"\xbd\x01\n\x1b\x43reateReferenceImageRequest\x12\x35\n\x06parent\x18\x01 \x01(\tB%\xe0\x41\x02\xfa\x41\x1f\n\x1dvision.googleapis.com/Product\x12K\n\x0freference_image\x18\x02 \x01(\x0b\x32-.google.cloud.vision.v1p3beta1.ReferenceImageB\x03\xe0\x41\x02\x12\x1a\n\x12reference_image_id\x18\x03 \x01(\t\"z\n\x1aListReferenceImagesRequest\x12\x35\n\x06parent\x18\x01 \x01(\tB%\xe0\x41\x02\xfa\x41\x1f\n\x1dvision.googleapis.com/Product\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\"\x92\x01\n\x1bListReferenceImagesResponse\x12G\n\x10reference_images\x18\x01 \x03(\x0b\x32-.google.cloud.vision.v1p3beta1.ReferenceImage\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x17\n\x0fnext_page_token\x18\x03 \x01(\t\"V\n\x18GetReferenceImageRequest\x12:\n\x04name\x18\x01 \x01(\tB,\xe0\x41\x02\xfa\x41&\n$vision.googleapis.com/ReferenceImage\"Y\n\x1b\x44\x65leteReferenceImageRequest\x12:\n\x04name\x18\x01 \x01(\tB,\xe0\x41\x02\xfa\x41&\n$vision.googleapis.com/ReferenceImage\"\x8f\x01\n\x1d\x41\x64\x64ProductToProductSetRequest\x12\x36\n\x04name\x18\x01 \x01(\tB(\xe0\x41\x02\xfa\x41\"\n vision.googleapis.com/ProductSet\x12\x36\n\x07product\x18\x02 \x01(\tB%\xe0\x41\x02\xfa\x41\x1f\n\x1dvision.googleapis.com/Product\"\x94\x01\n\"RemoveProductFromProductSetRequest\x12\x36\n\x04name\x18\x01 \x01(\tB(\xe0\x41\x02\xfa\x41\"\n vision.googleapis.com/ProductSet\x12\x36\n\x07product\x18\x02 \x01(\tB%\xe0\x41\x02\xfa\x41\x1f\n\x1dvision.googleapis.com/Product\"\x80\x01\n\x1fListProductsInProductSetRequest\x12\x36\n\x04name\x18\x01 \x01(\tB(\xe0\x41\x02\xfa\x41\"\n vision.googleapis.com/ProductSet\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\"u\n ListProductsInProductSetResponse\x12\x38\n\x08products\x18\x01 \x03(\x0b\x32&.google.cloud.vision.v1p3beta1.Product\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"2\n\x1aImportProductSetsGcsSource\x12\x14\n\x0c\x63sv_file_uri\x18\x01 \x01(\t\"y\n\x1cImportProductSetsInputConfig\x12O\n\ngcs_source\x18\x01 \x01(\x0b\x32\x39.google.cloud.vision.v1p3beta1.ImportProductSetsGcsSourceH\x00\x42\x08\n\x06source\"\xad\x01\n\x18ImportProductSetsRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\x12V\n\x0cinput_config\x18\x02 \x01(\x0b\x32;.google.cloud.vision.v1p3beta1.ImportProductSetsInputConfigB\x03\xe0\x41\x02\"\x8a\x01\n\x19ImportProductSetsResponse\x12G\n\x10reference_images\x18\x01 \x03(\x0b\x32-.google.cloud.vision.v1p3beta1.ReferenceImage\x12$\n\x08statuses\x18\x02 \x03(\x0b\x32\x12.google.rpc.Status\"\x9e\x02\n\x16\x42\x61tchOperationMetadata\x12J\n\x05state\x18\x01 \x01(\x0e\x32;.google.cloud.vision.v1p3beta1.BatchOperationMetadata.State\x12/\n\x0bsubmit_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12,\n\x08\x65nd_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"Y\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0e\n\nPROCESSING\x10\x01\x12\x0e\n\nSUCCESSFUL\x10\x02\x12\n\n\x06\x46\x41ILED\x10\x03\x12\r\n\tCANCELLED\x10\x04\x32\xeb\x1e\n\rProductSearch\x12\xe6\x01\n\x10\x43reateProductSet\x12\x36.google.cloud.vision.v1p3beta1.CreateProductSetRequest\x1a).google.cloud.vision.v1p3beta1.ProductSet\"o\xda\x41!parent,product_set,product_set_id\x82\xd3\xe4\x93\x02\x45\"6/v1p3beta1/{parent=projects/*/locations/*}/productSets:\x0bproduct_set\x12\xc9\x01\n\x0fListProductSets\x12\x35.google.cloud.vision.v1p3beta1.ListProductSetsRequest\x1a\x36.google.cloud.vision.v1p3beta1.ListProductSetsResponse\"G\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x38\x12\x36/v1p3beta1/{parent=projects/*/locations/*}/productSets\x12\xb6\x01\n\rGetProductSet\x12\x33.google.cloud.vision.v1p3beta1.GetProductSetRequest\x1a).google.cloud.vision.v1p3beta1.ProductSet\"E\xda\x41\x04name\x82\xd3\xe4\x93\x02\x38\x12\x36/v1p3beta1/{name=projects/*/locations/*/productSets/*}\x12\xe8\x01\n\x10UpdateProductSet\x12\x36.google.cloud.vision.v1p3beta1.UpdateProductSetRequest\x1a).google.cloud.vision.v1p3beta1.ProductSet\"q\xda\x41\x17product_set,update_mask\x82\xd3\xe4\x93\x02Q2B/v1p3beta1/{product_set.name=projects/*/locations/*/productSets/*}:\x0bproduct_set\x12\xa9\x01\n\x10\x44\x65leteProductSet\x12\x36.google.cloud.vision.v1p3beta1.DeleteProductSetRequest\x1a\x16.google.protobuf.Empty\"E\xda\x41\x04name\x82\xd3\xe4\x93\x02\x38*6/v1p3beta1/{name=projects/*/locations/*/productSets/*}\x12\xce\x01\n\rCreateProduct\x12\x33.google.cloud.vision.v1p3beta1.CreateProductRequest\x1a&.google.cloud.vision.v1p3beta1.Product\"`\xda\x41\x19parent,product,product_id\x82\xd3\xe4\x93\x02>\"3/v1p3beta1/{parent=projects/*/locations/*}/products:\x07product\x12\xbd\x01\n\x0cListProducts\x12\x32.google.cloud.vision.v1p3beta1.ListProductsRequest\x1a\x33.google.cloud.vision.v1p3beta1.ListProductsResponse\"D\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x35\x12\x33/v1p3beta1/{parent=projects/*/locations/*}/products\x12\xaa\x01\n\nGetProduct\x12\x30.google.cloud.vision.v1p3beta1.GetProductRequest\x1a&.google.cloud.vision.v1p3beta1.Product\"B\xda\x41\x04name\x82\xd3\xe4\x93\x02\x35\x12\x33/v1p3beta1/{name=projects/*/locations/*/products/*}\x12\xd0\x01\n\rUpdateProduct\x12\x33.google.cloud.vision.v1p3beta1.UpdateProductRequest\x1a&.google.cloud.vision.v1p3beta1.Product\"b\xda\x41\x13product,update_mask\x82\xd3\xe4\x93\x02\x46\x32;/v1p3beta1/{product.name=projects/*/locations/*/products/*}:\x07product\x12\xa0\x01\n\rDeleteProduct\x12\x33.google.cloud.vision.v1p3beta1.DeleteProductRequest\x1a\x16.google.protobuf.Empty\"B\xda\x41\x04name\x82\xd3\xe4\x93\x02\x35*3/v1p3beta1/{name=projects/*/locations/*/products/*}\x12\x8e\x02\n\x14\x43reateReferenceImage\x12:.google.cloud.vision.v1p3beta1.CreateReferenceImageRequest\x1a-.google.cloud.vision.v1p3beta1.ReferenceImage\"\x8a\x01\xda\x41)parent,reference_image,reference_image_id\x82\xd3\xe4\x93\x02X\"E/v1p3beta1/{parent=projects/*/locations/*/products/*}/referenceImages:\x0freference_image\x12\xc0\x01\n\x14\x44\x65leteReferenceImage\x12:.google.cloud.vision.v1p3beta1.DeleteReferenceImageRequest\x1a\x16.google.protobuf.Empty\"T\xda\x41\x04name\x82\xd3\xe4\x93\x02G*E/v1p3beta1/{name=projects/*/locations/*/products/*/referenceImages/*}\x12\xe4\x01\n\x13ListReferenceImages\x12\x39.google.cloud.vision.v1p3beta1.ListReferenceImagesRequest\x1a:.google.cloud.vision.v1p3beta1.ListReferenceImagesResponse\"V\xda\x41\x06parent\x82\xd3\xe4\x93\x02G\x12\x45/v1p3beta1/{parent=projects/*/locations/*/products/*}/referenceImages\x12\xd1\x01\n\x11GetReferenceImage\x12\x37.google.cloud.vision.v1p3beta1.GetReferenceImageRequest\x1a-.google.cloud.vision.v1p3beta1.ReferenceImage\"T\xda\x41\x04name\x82\xd3\xe4\x93\x02G\x12\x45/v1p3beta1/{name=projects/*/locations/*/products/*/referenceImages/*}\x12\xcb\x01\n\x16\x41\x64\x64ProductToProductSet\x12<.google.cloud.vision.v1p3beta1.AddProductToProductSetRequest\x1a\x16.google.protobuf.Empty\"[\xda\x41\x0cname,product\x82\xd3\xe4\x93\x02\x46\"A/v1p3beta1/{name=projects/*/locations/*/productSets/*}:addProduct:\x01*\x12\xd8\x01\n\x1bRemoveProductFromProductSet\x12\x41.google.cloud.vision.v1p3beta1.RemoveProductFromProductSetRequest\x1a\x16.google.protobuf.Empty\"^\xda\x41\x0cname,product\x82\xd3\xe4\x93\x02I\"D/v1p3beta1/{name=projects/*/locations/*/productSets/*}:removeProduct:\x01*\x12\xeb\x01\n\x18ListProductsInProductSet\x12>.google.cloud.vision.v1p3beta1.ListProductsInProductSetRequest\x1a?.google.cloud.vision.v1p3beta1.ListProductsInProductSetResponse\"N\xda\x41\x04name\x82\xd3\xe4\x93\x02\x41\x12?/v1p3beta1/{name=projects/*/locations/*/productSets/*}/products\x12\x82\x02\n\x11ImportProductSets\x12\x37.google.cloud.vision.v1p3beta1.ImportProductSetsRequest\x1a\x1d.google.longrunning.Operation\"\x94\x01\xca\x41\x33\n\x19ImportProductSetsResponse\x12\x16\x42\x61tchOperationMetadata\xda\x41\x13parent,input_config\x82\xd3\xe4\x93\x02\x42\"=/v1p3beta1/{parent=projects/*/locations/*}/productSets:import:\x01*\x1av\xca\x41\x15vision.googleapis.com\xd2\x41[https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/cloud-visionB~\n!com.google.cloud.vision.v1p3beta1B\x19ProductSearchServiceProtoP\x01Z9cloud.google.com/go/vision/apiv1p3beta1/visionpb;visionpb\xf8\x01\x01\x62\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module Vision + module V1p3beta1 + Product = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p3beta1.Product").msgclass + Product::KeyValue = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p3beta1.Product.KeyValue").msgclass + ProductSet = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p3beta1.ProductSet").msgclass + ReferenceImage = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p3beta1.ReferenceImage").msgclass + CreateProductRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p3beta1.CreateProductRequest").msgclass + ListProductsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p3beta1.ListProductsRequest").msgclass + ListProductsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p3beta1.ListProductsResponse").msgclass + GetProductRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p3beta1.GetProductRequest").msgclass + UpdateProductRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p3beta1.UpdateProductRequest").msgclass + DeleteProductRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p3beta1.DeleteProductRequest").msgclass + CreateProductSetRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p3beta1.CreateProductSetRequest").msgclass + ListProductSetsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p3beta1.ListProductSetsRequest").msgclass + ListProductSetsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p3beta1.ListProductSetsResponse").msgclass + GetProductSetRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p3beta1.GetProductSetRequest").msgclass + UpdateProductSetRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p3beta1.UpdateProductSetRequest").msgclass + DeleteProductSetRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p3beta1.DeleteProductSetRequest").msgclass + CreateReferenceImageRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p3beta1.CreateReferenceImageRequest").msgclass + ListReferenceImagesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p3beta1.ListReferenceImagesRequest").msgclass + ListReferenceImagesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p3beta1.ListReferenceImagesResponse").msgclass + GetReferenceImageRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p3beta1.GetReferenceImageRequest").msgclass + DeleteReferenceImageRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p3beta1.DeleteReferenceImageRequest").msgclass + AddProductToProductSetRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p3beta1.AddProductToProductSetRequest").msgclass + RemoveProductFromProductSetRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p3beta1.RemoveProductFromProductSetRequest").msgclass + ListProductsInProductSetRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p3beta1.ListProductsInProductSetRequest").msgclass + ListProductsInProductSetResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p3beta1.ListProductsInProductSetResponse").msgclass + ImportProductSetsGcsSource = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p3beta1.ImportProductSetsGcsSource").msgclass + ImportProductSetsInputConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p3beta1.ImportProductSetsInputConfig").msgclass + ImportProductSetsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p3beta1.ImportProductSetsRequest").msgclass + ImportProductSetsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p3beta1.ImportProductSetsResponse").msgclass + BatchOperationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p3beta1.BatchOperationMetadata").msgclass + BatchOperationMetadata::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p3beta1.BatchOperationMetadata.State").enummodule + end + end + end +end diff --git a/owl-bot-staging/google-cloud-vision-v1p3beta1/lib/google/cloud/vision/v1p3beta1/product_search_service_services_pb.rb b/owl-bot-staging/google-cloud-vision-v1p3beta1/lib/google/cloud/vision/v1p3beta1/product_search_service_services_pb.rb new file mode 100644 index 000000000000..e177b3044f3a --- /dev/null +++ b/owl-bot-staging/google-cloud-vision-v1p3beta1/lib/google/cloud/vision/v1p3beta1/product_search_service_services_pb.rb @@ -0,0 +1,222 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/cloud/vision/v1p3beta1/product_search_service.proto for package 'google.cloud.vision.v1p3beta1' +# 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/vision/v1p3beta1/product_search_service_pb' + +module Google + module Cloud + module Vision + module V1p3beta1 + module ProductSearch + # Manages Products and ProductSets of reference images for use in product + # search. It uses the following resource model: + # + # - The API has a collection of [ProductSet][google.cloud.vision.v1p3beta1.ProductSet] resources, named + # `projects/*/locations/*/productSets/*`, which acts as a way to put different + # products into groups to limit identification. + # + # In parallel, + # + # - The API has a collection of [Product][google.cloud.vision.v1p3beta1.Product] resources, named + # `projects/*/locations/*/products/*` + # + # - Each [Product][google.cloud.vision.v1p3beta1.Product] has a collection of [ReferenceImage][google.cloud.vision.v1p3beta1.ReferenceImage] resources, named + # `projects/*/locations/*/products/*/referenceImages/*` + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.cloud.vision.v1p3beta1.ProductSearch' + + # Creates and returns a new ProductSet resource. + # + # Possible errors: + # + # * Returns INVALID_ARGUMENT if display_name is missing, or is longer than + # 4096 characters. + rpc :CreateProductSet, ::Google::Cloud::Vision::V1p3beta1::CreateProductSetRequest, ::Google::Cloud::Vision::V1p3beta1::ProductSet + # Lists ProductSets in an unspecified order. + # + # Possible errors: + # + # * Returns INVALID_ARGUMENT if page_size is greater than 100, or less + # than 1. + rpc :ListProductSets, ::Google::Cloud::Vision::V1p3beta1::ListProductSetsRequest, ::Google::Cloud::Vision::V1p3beta1::ListProductSetsResponse + # Gets information associated with a ProductSet. + # + # Possible errors: + # + # * Returns NOT_FOUND if the ProductSet does not exist. + rpc :GetProductSet, ::Google::Cloud::Vision::V1p3beta1::GetProductSetRequest, ::Google::Cloud::Vision::V1p3beta1::ProductSet + # Makes changes to a ProductSet resource. + # Only display_name can be updated currently. + # + # Possible errors: + # + # * Returns NOT_FOUND if the ProductSet does not exist. + # * Returns INVALID_ARGUMENT if display_name is present in update_mask but + # missing from the request or longer than 4096 characters. + rpc :UpdateProductSet, ::Google::Cloud::Vision::V1p3beta1::UpdateProductSetRequest, ::Google::Cloud::Vision::V1p3beta1::ProductSet + # Permanently deletes a ProductSet. All Products and ReferenceImages in the + # ProductSet will be deleted. + # + # The actual image files are not deleted from Google Cloud Storage. + # + # Possible errors: + # + # * Returns NOT_FOUND if the ProductSet does not exist. + rpc :DeleteProductSet, ::Google::Cloud::Vision::V1p3beta1::DeleteProductSetRequest, ::Google::Protobuf::Empty + # Creates and returns a new product resource. + # + # Possible errors: + # + # * Returns INVALID_ARGUMENT if display_name is missing or longer than 4096 + # characters. + # * Returns INVALID_ARGUMENT if description is longer than 4096 characters. + # * Returns INVALID_ARGUMENT if product_category is missing or invalid. + rpc :CreateProduct, ::Google::Cloud::Vision::V1p3beta1::CreateProductRequest, ::Google::Cloud::Vision::V1p3beta1::Product + # Lists products in an unspecified order. + # + # Possible errors: + # + # * Returns INVALID_ARGUMENT if page_size is greater than 100 or less than 1. + rpc :ListProducts, ::Google::Cloud::Vision::V1p3beta1::ListProductsRequest, ::Google::Cloud::Vision::V1p3beta1::ListProductsResponse + # Gets information associated with a Product. + # + # Possible errors: + # + # * Returns NOT_FOUND if the Product does not exist. + rpc :GetProduct, ::Google::Cloud::Vision::V1p3beta1::GetProductRequest, ::Google::Cloud::Vision::V1p3beta1::Product + # Makes changes to a Product resource. + # Only display_name, description and labels can be updated right now. + # + # If labels are updated, the change will not be reflected in queries until + # the next index time. + # + # Possible errors: + # + # * Returns NOT_FOUND if the Product does not exist. + # * Returns INVALID_ARGUMENT if display_name is present in update_mask but is + # missing from the request or longer than 4096 characters. + # * Returns INVALID_ARGUMENT if description is present in update_mask but is + # longer than 4096 characters. + # * Returns INVALID_ARGUMENT if product_category is present in update_mask. + rpc :UpdateProduct, ::Google::Cloud::Vision::V1p3beta1::UpdateProductRequest, ::Google::Cloud::Vision::V1p3beta1::Product + # Permanently deletes a product and its reference images. + # + # Metadata of the product and all its images will be deleted right away, but + # search queries against ProductSets containing the product may still work + # until all related caches are refreshed. + # + # Possible errors: + # + # * Returns NOT_FOUND if the product does not exist. + rpc :DeleteProduct, ::Google::Cloud::Vision::V1p3beta1::DeleteProductRequest, ::Google::Protobuf::Empty + # Creates and returns a new ReferenceImage resource. + # + # The `bounding_poly` field is optional. If `bounding_poly` is not specified, + # the system will try to detect regions of interest in the image that are + # compatible with the product_category on the parent product. If it is + # specified, detection is ALWAYS skipped. The system converts polygons into + # non-rotated rectangles. + # + # Note that the pipeline will resize the image if the image resolution is too + # large to process (above 50MP). + # + # Possible errors: + # + # * Returns INVALID_ARGUMENT if the image_uri is missing or longer than 4096 + # characters. + # * Returns INVALID_ARGUMENT if the product does not exist. + # * Returns INVALID_ARGUMENT if bounding_poly is not provided, and nothing + # compatible with the parent product's product_category is detected. + # * Returns INVALID_ARGUMENT if bounding_poly contains more than 10 polygons. + rpc :CreateReferenceImage, ::Google::Cloud::Vision::V1p3beta1::CreateReferenceImageRequest, ::Google::Cloud::Vision::V1p3beta1::ReferenceImage + # Permanently deletes a reference image. + # + # The image metadata will be deleted right away, but search queries + # against ProductSets containing the image may still work until all related + # caches are refreshed. + # + # The actual image files are not deleted from Google Cloud Storage. + # + # Possible errors: + # + # * Returns NOT_FOUND if the reference image does not exist. + rpc :DeleteReferenceImage, ::Google::Cloud::Vision::V1p3beta1::DeleteReferenceImageRequest, ::Google::Protobuf::Empty + # Lists reference images. + # + # Possible errors: + # + # * Returns NOT_FOUND if the parent product does not exist. + # * Returns INVALID_ARGUMENT if the page_size is greater than 100, or less + # than 1. + rpc :ListReferenceImages, ::Google::Cloud::Vision::V1p3beta1::ListReferenceImagesRequest, ::Google::Cloud::Vision::V1p3beta1::ListReferenceImagesResponse + # Gets information associated with a ReferenceImage. + # + # Possible errors: + # + # * Returns NOT_FOUND if the specified image does not exist. + rpc :GetReferenceImage, ::Google::Cloud::Vision::V1p3beta1::GetReferenceImageRequest, ::Google::Cloud::Vision::V1p3beta1::ReferenceImage + # Adds a Product to the specified ProductSet. If the Product is already + # present, no change is made. + # + # One Product can be added to at most 100 ProductSets. + # + # Possible errors: + # + # * Returns NOT_FOUND if the Product or the ProductSet doesn't exist. + rpc :AddProductToProductSet, ::Google::Cloud::Vision::V1p3beta1::AddProductToProductSetRequest, ::Google::Protobuf::Empty + # Removes a Product from the specified ProductSet. + # + # Possible errors: + # + # * Returns NOT_FOUND If the Product is not found under the ProductSet. + rpc :RemoveProductFromProductSet, ::Google::Cloud::Vision::V1p3beta1::RemoveProductFromProductSetRequest, ::Google::Protobuf::Empty + # Lists the Products in a ProductSet, in an unspecified order. If the + # ProductSet does not exist, the products field of the response will be + # empty. + # + # Possible errors: + # + # * Returns INVALID_ARGUMENT if page_size is greater than 100 or less than 1. + rpc :ListProductsInProductSet, ::Google::Cloud::Vision::V1p3beta1::ListProductsInProductSetRequest, ::Google::Cloud::Vision::V1p3beta1::ListProductsInProductSetResponse + # Asynchronous API that imports a list of reference images to specified + # product sets based on a list of image information. + # + # The [google.longrunning.Operation][google.longrunning.Operation] API can be + # used to keep track of the progress and results of the request. + # `Operation.metadata` contains `BatchOperationMetadata`. (progress) + # `Operation.response` contains `ImportProductSetsResponse`. (results) + # + # The input source of this method is a csv file on Google Cloud Storage. + # For the format of the csv file please see + # [ImportProductSetsGcsSource.csv_file_uri][google.cloud.vision.v1p3beta1.ImportProductSetsGcsSource.csv_file_uri]. + rpc :ImportProductSets, ::Google::Cloud::Vision::V1p3beta1::ImportProductSetsRequest, ::Google::Longrunning::Operation + end + + Stub = Service.rpc_stub_class + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-vision-v1p3beta1/lib/google/cloud/vision/v1p3beta1/rest.rb b/owl-bot-staging/google-cloud-vision-v1p3beta1/lib/google/cloud/vision/v1p3beta1/rest.rb new file mode 100644 index 000000000000..81f51ad2579e --- /dev/null +++ b/owl-bot-staging/google-cloud-vision-v1p3beta1/lib/google/cloud/vision/v1p3beta1/rest.rb @@ -0,0 +1,38 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/vision/v1p3beta1/product_search/rest" +require "google/cloud/vision/v1p3beta1/image_annotator/rest" +require "google/cloud/vision/v1p3beta1/version" + +module Google + module Cloud + module Vision + ## + # To load just the REST part of this package, including all its services, and instantiate a REST client: + # + # @example + # + # require "google/cloud/vision/v1p3beta1/rest" + # client = ::Google::Cloud::Vision::V1p3beta1::ProductSearch::Rest::Client.new + # + module V1p3beta1 + end + end + end +end diff --git a/owl-bot-staging/google-cloud-vision-v1p3beta1/lib/google/cloud/vision/v1p3beta1/text_annotation_pb.rb b/owl-bot-staging/google-cloud-vision-v1p3beta1/lib/google/cloud/vision/v1p3beta1/text_annotation_pb.rb new file mode 100644 index 000000000000..0a5409aa7036 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision-v1p3beta1/lib/google/cloud/vision/v1p3beta1/text_annotation_pb.rb @@ -0,0 +1,33 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/vision/v1p3beta1/text_annotation.proto + +require 'google/protobuf' + +require 'google/cloud/vision/v1p3beta1/geometry_pb' + + +descriptor_data = "\n3google/cloud/vision/v1p3beta1/text_annotation.proto\x12\x1dgoogle.cloud.vision.v1p3beta1\x1a,google/cloud/vision/v1p3beta1/geometry.proto\"\xb2\x04\n\x0eTextAnnotation\x12\x32\n\x05pages\x18\x01 \x03(\x0b\x32#.google.cloud.vision.v1p3beta1.Page\x12\x0c\n\x04text\x18\x02 \x01(\t\x1a=\n\x10\x44\x65tectedLanguage\x12\x15\n\rlanguage_code\x18\x01 \x01(\t\x12\x12\n\nconfidence\x18\x02 \x01(\x02\x1a\xdc\x01\n\rDetectedBreak\x12S\n\x04type\x18\x01 \x01(\x0e\x32\x45.google.cloud.vision.v1p3beta1.TextAnnotation.DetectedBreak.BreakType\x12\x11\n\tis_prefix\x18\x02 \x01(\x08\"c\n\tBreakType\x12\x0b\n\x07UNKNOWN\x10\x00\x12\t\n\x05SPACE\x10\x01\x12\x0e\n\nSURE_SPACE\x10\x02\x12\x12\n\x0e\x45OL_SURE_SPACE\x10\x03\x12\n\n\x06HYPHEN\x10\x04\x12\x0e\n\nLINE_BREAK\x10\x05\x1a\xbf\x01\n\x0cTextProperty\x12Z\n\x12\x64\x65tected_languages\x18\x01 \x03(\x0b\x32>.google.cloud.vision.v1p3beta1.TextAnnotation.DetectedLanguage\x12S\n\x0e\x64\x65tected_break\x18\x02 \x01(\x0b\x32;.google.cloud.vision.v1p3beta1.TextAnnotation.DetectedBreak\"\xbd\x01\n\x04Page\x12L\n\x08property\x18\x01 \x01(\x0b\x32:.google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty\x12\r\n\x05width\x18\x02 \x01(\x05\x12\x0e\n\x06height\x18\x03 \x01(\x05\x12\x34\n\x06\x62locks\x18\x04 \x03(\x0b\x32$.google.cloud.vision.v1p3beta1.Block\x12\x12\n\nconfidence\x18\x05 \x01(\x02\"\x82\x03\n\x05\x42lock\x12L\n\x08property\x18\x01 \x01(\x0b\x32:.google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty\x12\x41\n\x0c\x62ounding_box\x18\x02 \x01(\x0b\x32+.google.cloud.vision.v1p3beta1.BoundingPoly\x12<\n\nparagraphs\x18\x03 \x03(\x0b\x32(.google.cloud.vision.v1p3beta1.Paragraph\x12\x42\n\nblock_type\x18\x04 \x01(\x0e\x32..google.cloud.vision.v1p3beta1.Block.BlockType\x12\x12\n\nconfidence\x18\x05 \x01(\x02\"R\n\tBlockType\x12\x0b\n\x07UNKNOWN\x10\x00\x12\x08\n\x04TEXT\x10\x01\x12\t\n\x05TABLE\x10\x02\x12\x0b\n\x07PICTURE\x10\x03\x12\t\n\x05RULER\x10\x04\x12\x0b\n\x07\x42\x41RCODE\x10\x05\"\xe4\x01\n\tParagraph\x12L\n\x08property\x18\x01 \x01(\x0b\x32:.google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty\x12\x41\n\x0c\x62ounding_box\x18\x02 \x01(\x0b\x32+.google.cloud.vision.v1p3beta1.BoundingPoly\x12\x32\n\x05words\x18\x03 \x03(\x0b\x32#.google.cloud.vision.v1p3beta1.Word\x12\x12\n\nconfidence\x18\x04 \x01(\x02\"\xe3\x01\n\x04Word\x12L\n\x08property\x18\x01 \x01(\x0b\x32:.google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty\x12\x41\n\x0c\x62ounding_box\x18\x02 \x01(\x0b\x32+.google.cloud.vision.v1p3beta1.BoundingPoly\x12\x36\n\x07symbols\x18\x03 \x03(\x0b\x32%.google.cloud.vision.v1p3beta1.Symbol\x12\x12\n\nconfidence\x18\x04 \x01(\x02\"\xbb\x01\n\x06Symbol\x12L\n\x08property\x18\x01 \x01(\x0b\x32:.google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty\x12\x41\n\x0c\x62ounding_box\x18\x02 \x01(\x0b\x32+.google.cloud.vision.v1p3beta1.BoundingPoly\x12\x0c\n\x04text\x18\x03 \x01(\t\x12\x12\n\nconfidence\x18\x04 \x01(\x02\x42x\n!com.google.cloud.vision.v1p3beta1B\x13TextAnnotationProtoP\x01Z9cloud.google.com/go/vision/apiv1p3beta1/visionpb;visionpb\xf8\x01\x01\x62\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module Vision + module V1p3beta1 + TextAnnotation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p3beta1.TextAnnotation").msgclass + TextAnnotation::DetectedLanguage = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p3beta1.TextAnnotation.DetectedLanguage").msgclass + TextAnnotation::DetectedBreak = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p3beta1.TextAnnotation.DetectedBreak").msgclass + TextAnnotation::DetectedBreak::BreakType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p3beta1.TextAnnotation.DetectedBreak.BreakType").enummodule + TextAnnotation::TextProperty = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty").msgclass + Page = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p3beta1.Page").msgclass + Block = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p3beta1.Block").msgclass + Block::BlockType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p3beta1.Block.BlockType").enummodule + Paragraph = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p3beta1.Paragraph").msgclass + Word = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p3beta1.Word").msgclass + Symbol = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p3beta1.Symbol").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-vision-v1p3beta1/lib/google/cloud/vision/v1p3beta1/version.rb b/owl-bot-staging/google-cloud-vision-v1p3beta1/lib/google/cloud/vision/v1p3beta1/version.rb new file mode 100644 index 000000000000..d81d32458c35 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision-v1p3beta1/lib/google/cloud/vision/v1p3beta1/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 Vision + module V1p3beta1 + VERSION = "0.0.1" + end + end + end +end diff --git a/owl-bot-staging/google-cloud-vision-v1p3beta1/lib/google/cloud/vision/v1p3beta1/web_detection_pb.rb b/owl-bot-staging/google-cloud-vision-v1p3beta1/lib/google/cloud/vision/v1p3beta1/web_detection_pb.rb new file mode 100644 index 000000000000..fbf1cce38347 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision-v1p3beta1/lib/google/cloud/vision/v1p3beta1/web_detection_pb.rb @@ -0,0 +1,25 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/vision/v1p3beta1/web_detection.proto + +require 'google/protobuf' + + +descriptor_data = "\n1google/cloud/vision/v1p3beta1/web_detection.proto\x12\x1dgoogle.cloud.vision.v1p3beta1\"\x8c\x07\n\x0cWebDetection\x12K\n\x0cweb_entities\x18\x01 \x03(\x0b\x32\x35.google.cloud.vision.v1p3beta1.WebDetection.WebEntity\x12R\n\x14\x66ull_matching_images\x18\x02 \x03(\x0b\x32\x34.google.cloud.vision.v1p3beta1.WebDetection.WebImage\x12U\n\x17partial_matching_images\x18\x03 \x03(\x0b\x32\x34.google.cloud.vision.v1p3beta1.WebDetection.WebImage\x12W\n\x1apages_with_matching_images\x18\x04 \x03(\x0b\x32\x33.google.cloud.vision.v1p3beta1.WebDetection.WebPage\x12U\n\x17visually_similar_images\x18\x06 \x03(\x0b\x32\x34.google.cloud.vision.v1p3beta1.WebDetection.WebImage\x12O\n\x11\x62\x65st_guess_labels\x18\x08 \x03(\x0b\x32\x34.google.cloud.vision.v1p3beta1.WebDetection.WebLabel\x1a\x42\n\tWebEntity\x12\x11\n\tentity_id\x18\x01 \x01(\t\x12\r\n\x05score\x18\x02 \x01(\x02\x12\x13\n\x0b\x64\x65scription\x18\x03 \x01(\t\x1a&\n\x08WebImage\x12\x0b\n\x03url\x18\x01 \x01(\t\x12\r\n\x05score\x18\x02 \x01(\x02\x1a\xe4\x01\n\x07WebPage\x12\x0b\n\x03url\x18\x01 \x01(\t\x12\r\n\x05score\x18\x02 \x01(\x02\x12\x12\n\npage_title\x18\x03 \x01(\t\x12R\n\x14\x66ull_matching_images\x18\x04 \x03(\x0b\x32\x34.google.cloud.vision.v1p3beta1.WebDetection.WebImage\x12U\n\x17partial_matching_images\x18\x05 \x03(\x0b\x32\x34.google.cloud.vision.v1p3beta1.WebDetection.WebImage\x1a\x30\n\x08WebLabel\x12\r\n\x05label\x18\x01 \x01(\t\x12\x15\n\rlanguage_code\x18\x02 \x01(\tBv\n!com.google.cloud.vision.v1p3beta1B\x11WebDetectionProtoP\x01Z9cloud.google.com/go/vision/apiv1p3beta1/visionpb;visionpb\xf8\x01\x01\x62\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module Vision + module V1p3beta1 + WebDetection = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p3beta1.WebDetection").msgclass + WebDetection::WebEntity = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p3beta1.WebDetection.WebEntity").msgclass + WebDetection::WebImage = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p3beta1.WebDetection.WebImage").msgclass + WebDetection::WebPage = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p3beta1.WebDetection.WebPage").msgclass + WebDetection::WebLabel = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p3beta1.WebDetection.WebLabel").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-vision-v1p3beta1/proto_docs/README.md b/owl-bot-staging/google-cloud-vision-v1p3beta1/proto_docs/README.md new file mode 100644 index 000000000000..686393024ffb --- /dev/null +++ b/owl-bot-staging/google-cloud-vision-v1p3beta1/proto_docs/README.md @@ -0,0 +1,4 @@ +# Cloud Vision V1p3beta1 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-vision-v1p3beta1/proto_docs/google/api/client.rb b/owl-bot-staging/google-cloud-vision-v1p3beta1/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..3ab0b096d445 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision-v1p3beta1/proto_docs/google/api/client.rb @@ -0,0 +1,593 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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. + # + # Note: This field should not be used in most cases. + 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: + # library_settings: + # 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. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Php. Clobbers the php_namespace option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.php.package_name" field + # in gapic.yaml. API teams should use the protobuf php_namespace option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # library_settings: + # php_settings: + # library_package: Google\Cloud\PubSub\V1 + 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. + # + # Example: + # + # 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 + # @!attribute [rw] batching + # @return [::Google::Api::BatchingConfigProto] + # Batching configuration for an API method in client libraries. + # + # Example of a YAML configuration: + # + # publishing: + # method_settings: + # - selector: google.example.v1.ExampleService.BatchCreateExample + # batching: + # element_count_threshold: 1000 + # request_byte_threshold: 100000000 + # delay_threshold_millis: 10 + 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. + # + # Note: This feature should not be used in most cases. + # @!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 + + # `BatchingConfigProto` defines the batching configuration for an API method. + # @!attribute [rw] thresholds + # @return [::Google::Api::BatchingSettingsProto] + # The thresholds which trigger a batched request to be sent. + # @!attribute [rw] batch_descriptor + # @return [::Google::Api::BatchingDescriptorProto] + # The request and response fields used in batching. + class BatchingConfigProto + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `BatchingSettingsProto` specifies a set of batching thresholds, each of + # which acts as a trigger to send a batch of messages as a request. At least + # one threshold must be positive nonzero. + # @!attribute [rw] element_count_threshold + # @return [::Integer] + # The number of elements of a field collected into a batch which, if + # exceeded, causes the batch to be sent. + # @!attribute [rw] request_byte_threshold + # @return [::Integer] + # The aggregated size of the batched field which, if exceeded, causes the + # batch to be sent. This size is computed by aggregating the sizes of the + # request field to be batched, not of the entire request message. + # @!attribute [rw] delay_threshold + # @return [::Google::Protobuf::Duration] + # The duration after which a batch should be sent, starting from the addition + # of the first message to that batch. + # @!attribute [rw] element_count_limit + # @return [::Integer] + # The maximum number of elements collected in a batch that could be accepted + # by server. + # @!attribute [rw] request_byte_limit + # @return [::Integer] + # The maximum size of the request that could be accepted by server. + # @!attribute [rw] flow_control_element_limit + # @return [::Integer] + # The maximum number of elements allowed by flow control. + # @!attribute [rw] flow_control_byte_limit + # @return [::Integer] + # The maximum size of data allowed by flow control. + # @!attribute [rw] flow_control_limit_exceeded_behavior + # @return [::Google::Api::FlowControlLimitExceededBehaviorProto] + # The behavior to take when the flow control limit is exceeded. + class BatchingSettingsProto + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `BatchingDescriptorProto` specifies the fields of the request message to be + # used for batching, and, optionally, the fields of the response message to be + # used for demultiplexing. + # @!attribute [rw] batched_field + # @return [::String] + # The repeated field in the request message to be aggregated by batching. + # @!attribute [rw] discriminator_fields + # @return [::Array<::String>] + # A list of the fields in the request message. Two requests will be batched + # together only if the values of every field specified in + # `request_discriminator_fields` is equal between the two requests. + # @!attribute [rw] subresponse_field + # @return [::String] + # Optional. When present, indicates the field in the response message to be + # used to demultiplex the response into multiple response messages, in + # correspondence with the multiple request messages originally batched + # together. + class BatchingDescriptorProto + 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 + + # The behavior to take when the flow control limit is exceeded. + module FlowControlLimitExceededBehaviorProto + # Default behavior, system-defined. + UNSET_BEHAVIOR = 0 + + # Stop operation, raise error. + THROW_EXCEPTION = 1 + + # Pause operation until limit clears. + BLOCK = 2 + + # Continue operation, disregard limit. + IGNORE = 3 + end + end +end diff --git a/owl-bot-staging/google-cloud-vision-v1p3beta1/proto_docs/google/api/field_behavior.rb b/owl-bot-staging/google-cloud-vision-v1p3beta1/proto_docs/google/api/field_behavior.rb new file mode 100644 index 000000000000..582be187d115 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision-v1p3beta1/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-vision-v1p3beta1/proto_docs/google/api/launch_stage.rb b/owl-bot-staging/google-cloud-vision-v1p3beta1/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..9392a413fb1b --- /dev/null +++ b/owl-bot-staging/google-cloud-vision-v1p3beta1/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-vision-v1p3beta1/proto_docs/google/api/resource.rb b/owl-bot-staging/google-cloud-vision-v1p3beta1/proto_docs/google/api/resource.rb new file mode 100644 index 000000000000..25dec4847ac1 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision-v1p3beta1/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-vision-v1p3beta1/proto_docs/google/cloud/vision/v1p3beta1/geometry.rb b/owl-bot-staging/google-cloud-vision-v1p3beta1/proto_docs/google/cloud/vision/v1p3beta1/geometry.rb new file mode 100644 index 000000000000..0c3bbeb9aaa4 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision-v1p3beta1/proto_docs/google/cloud/vision/v1p3beta1/geometry.rb @@ -0,0 +1,82 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Vision + module V1p3beta1 + # A vertex represents a 2D point in the image. + # NOTE: the vertex coordinates are in the same scale as the original image. + # @!attribute [rw] x + # @return [::Integer] + # X coordinate. + # @!attribute [rw] y + # @return [::Integer] + # Y coordinate. + class Vertex + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A vertex represents a 2D point in the image. + # NOTE: the normalized vertex coordinates are relative to the original image + # and range from 0 to 1. + # @!attribute [rw] x + # @return [::Float] + # X coordinate. + # @!attribute [rw] y + # @return [::Float] + # Y coordinate. + class NormalizedVertex + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A bounding polygon for the detected image annotation. + # @!attribute [rw] vertices + # @return [::Array<::Google::Cloud::Vision::V1p3beta1::Vertex>] + # The bounding polygon vertices. + # @!attribute [rw] normalized_vertices + # @return [::Array<::Google::Cloud::Vision::V1p3beta1::NormalizedVertex>] + # The bounding polygon normalized vertices. + class BoundingPoly + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A 3D position in the image, used primarily for Face detection landmarks. + # A valid Position must have both x and y coordinates. + # The position coordinates are in the same scale as the original image. + # @!attribute [rw] x + # @return [::Float] + # X coordinate. + # @!attribute [rw] y + # @return [::Float] + # Y coordinate. + # @!attribute [rw] z + # @return [::Float] + # Z coordinate (or depth). + class Position + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-vision-v1p3beta1/proto_docs/google/cloud/vision/v1p3beta1/image_annotator.rb b/owl-bot-staging/google-cloud-vision-v1p3beta1/proto_docs/google/cloud/vision/v1p3beta1/image_annotator.rb new file mode 100644 index 000000000000..e69372467857 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision-v1p3beta1/proto_docs/google/cloud/vision/v1p3beta1/image_annotator.rb @@ -0,0 +1,888 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Vision + module V1p3beta1 + # The type of Google Cloud Vision API detection to perform, and the maximum + # number of results to return for that type. Multiple `Feature` objects can + # be specified in the `features` list. + # @!attribute [rw] type + # @return [::Google::Cloud::Vision::V1p3beta1::Feature::Type] + # The feature type. + # @!attribute [rw] max_results + # @return [::Integer] + # Maximum number of results of this type. Does not apply to + # `TEXT_DETECTION`, `DOCUMENT_TEXT_DETECTION`, or `CROP_HINTS`. + # @!attribute [rw] model + # @return [::String] + # Model to use for the feature. + # Supported values: "builtin/stable" (the default if unset) and + # "builtin/latest". `DOCUMENT_TEXT_DETECTION` and `TEXT_DETECTION` also + # support "builtin/weekly" for the bleeding edge release updated weekly. + class Feature + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Type of Google Cloud Vision API feature to be extracted. + module Type + # Unspecified feature type. + TYPE_UNSPECIFIED = 0 + + # Run face detection. + FACE_DETECTION = 1 + + # Run landmark detection. + LANDMARK_DETECTION = 2 + + # Run logo detection. + LOGO_DETECTION = 3 + + # Run label detection. + LABEL_DETECTION = 4 + + # Run text detection / optical character recognition (OCR). Text detection + # is optimized for areas of text within a larger image; if the image is + # a document, use `DOCUMENT_TEXT_DETECTION` instead. + TEXT_DETECTION = 5 + + # Run dense text document OCR. Takes precedence when both + # `DOCUMENT_TEXT_DETECTION` and `TEXT_DETECTION` are present. + DOCUMENT_TEXT_DETECTION = 11 + + # Run Safe Search to detect potentially unsafe + # or undesirable content. + SAFE_SEARCH_DETECTION = 6 + + # Compute a set of image properties, such as the + # image's dominant colors. + IMAGE_PROPERTIES = 7 + + # Run crop hints. + CROP_HINTS = 9 + + # Run web detection. + WEB_DETECTION = 10 + + # Run Product Search. + PRODUCT_SEARCH = 12 + + # Run localizer for object detection. + OBJECT_LOCALIZATION = 19 + end + end + + # External image source (Google Cloud Storage or web URL image location). + # @!attribute [rw] gcs_image_uri + # @return [::String] + # **Use `image_uri` instead.** + # + # The Google Cloud Storage URI of the form + # `gs://bucket_name/object_name`. Object versioning is not supported. See + # [Google Cloud Storage Request + # URIs](https://cloud.google.com/storage/docs/reference-uris) for more info. + # @!attribute [rw] image_uri + # @return [::String] + # The URI of the source image. Can be either: + # + # 1. A Google Cloud Storage URI of the form + # `gs://bucket_name/object_name`. Object versioning is not supported. See + # [Google Cloud Storage Request + # URIs](https://cloud.google.com/storage/docs/reference-uris) for more + # info. + # + # 2. A publicly-accessible image HTTP/HTTPS URL. When fetching images from + # HTTP/HTTPS URLs, Google cannot guarantee that the request will be + # completed. Your request may fail if the specified host denies the + # request (e.g. due to request throttling or DOS prevention), or if Google + # throttles requests to the site for abuse prevention. You should not + # depend on externally-hosted images for production applications. + # + # When both `gcs_image_uri` and `image_uri` are specified, `image_uri` takes + # precedence. + class ImageSource + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Client image to perform Google Cloud Vision API tasks over. + # @!attribute [rw] content + # @return [::String] + # Image content, represented as a stream of bytes. + # Note: As with all `bytes` fields, protobuffers use a pure binary + # representation, whereas JSON representations use base64. + # @!attribute [rw] source + # @return [::Google::Cloud::Vision::V1p3beta1::ImageSource] + # Google Cloud Storage image location, or publicly-accessible image + # URL. If both `content` and `source` are provided for an image, `content` + # takes precedence and is used to perform the image annotation request. + class Image + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A face annotation object contains the results of face detection. + # @!attribute [rw] bounding_poly + # @return [::Google::Cloud::Vision::V1p3beta1::BoundingPoly] + # The bounding polygon around the face. The coordinates of the bounding box + # are in the original image's scale, as returned in `ImageParams`. + # The bounding box is computed to "frame" the face in accordance with human + # expectations. It is based on the landmarker results. + # Note that one or more x and/or y coordinates may not be generated in the + # `BoundingPoly` (the polygon will be unbounded) if only a partial face + # appears in the image to be annotated. + # @!attribute [rw] fd_bounding_poly + # @return [::Google::Cloud::Vision::V1p3beta1::BoundingPoly] + # The `fd_bounding_poly` bounding polygon is tighter than the + # `boundingPoly`, and encloses only the skin part of the face. Typically, it + # is used to eliminate the face from any image analysis that detects the + # "amount of skin" visible in an image. It is not based on the + # landmarker results, only on the initial face detection, hence + # the fd (face detection) prefix. + # @!attribute [rw] landmarks + # @return [::Array<::Google::Cloud::Vision::V1p3beta1::FaceAnnotation::Landmark>] + # Detected face landmarks. + # @!attribute [rw] roll_angle + # @return [::Float] + # Roll angle, which indicates the amount of clockwise/anti-clockwise rotation + # of the face relative to the image vertical about the axis perpendicular to + # the face. Range [-180,180]. + # @!attribute [rw] pan_angle + # @return [::Float] + # Yaw angle, which indicates the leftward/rightward angle that the face is + # pointing relative to the vertical plane perpendicular to the image. Range + # [-180,180]. + # @!attribute [rw] tilt_angle + # @return [::Float] + # Pitch angle, which indicates the upwards/downwards angle that the face is + # pointing relative to the image's horizontal plane. Range [-180,180]. + # @!attribute [rw] detection_confidence + # @return [::Float] + # Detection confidence. Range [0, 1]. + # @!attribute [rw] landmarking_confidence + # @return [::Float] + # Face landmarking confidence. Range [0, 1]. + # @!attribute [rw] joy_likelihood + # @return [::Google::Cloud::Vision::V1p3beta1::Likelihood] + # Joy likelihood. + # @!attribute [rw] sorrow_likelihood + # @return [::Google::Cloud::Vision::V1p3beta1::Likelihood] + # Sorrow likelihood. + # @!attribute [rw] anger_likelihood + # @return [::Google::Cloud::Vision::V1p3beta1::Likelihood] + # Anger likelihood. + # @!attribute [rw] surprise_likelihood + # @return [::Google::Cloud::Vision::V1p3beta1::Likelihood] + # Surprise likelihood. + # @!attribute [rw] under_exposed_likelihood + # @return [::Google::Cloud::Vision::V1p3beta1::Likelihood] + # Under-exposed likelihood. + # @!attribute [rw] blurred_likelihood + # @return [::Google::Cloud::Vision::V1p3beta1::Likelihood] + # Blurred likelihood. + # @!attribute [rw] headwear_likelihood + # @return [::Google::Cloud::Vision::V1p3beta1::Likelihood] + # Headwear likelihood. + class FaceAnnotation + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # A face-specific landmark (for example, a face feature). + # @!attribute [rw] type + # @return [::Google::Cloud::Vision::V1p3beta1::FaceAnnotation::Landmark::Type] + # Face landmark type. + # @!attribute [rw] position + # @return [::Google::Cloud::Vision::V1p3beta1::Position] + # Face landmark position. + class Landmark + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Face landmark (feature) type. + # Left and right are defined from the vantage of the viewer of the image + # without considering mirror projections typical of photos. So, `LEFT_EYE`, + # typically, is the person's right eye. + module Type + # Unknown face landmark detected. Should not be filled. + UNKNOWN_LANDMARK = 0 + + # Left eye. + LEFT_EYE = 1 + + # Right eye. + RIGHT_EYE = 2 + + # Left of left eyebrow. + LEFT_OF_LEFT_EYEBROW = 3 + + # Right of left eyebrow. + RIGHT_OF_LEFT_EYEBROW = 4 + + # Left of right eyebrow. + LEFT_OF_RIGHT_EYEBROW = 5 + + # Right of right eyebrow. + RIGHT_OF_RIGHT_EYEBROW = 6 + + # Midpoint between eyes. + MIDPOINT_BETWEEN_EYES = 7 + + # Nose tip. + NOSE_TIP = 8 + + # Upper lip. + UPPER_LIP = 9 + + # Lower lip. + LOWER_LIP = 10 + + # Mouth left. + MOUTH_LEFT = 11 + + # Mouth right. + MOUTH_RIGHT = 12 + + # Mouth center. + MOUTH_CENTER = 13 + + # Nose, bottom right. + NOSE_BOTTOM_RIGHT = 14 + + # Nose, bottom left. + NOSE_BOTTOM_LEFT = 15 + + # Nose, bottom center. + NOSE_BOTTOM_CENTER = 16 + + # Left eye, top boundary. + LEFT_EYE_TOP_BOUNDARY = 17 + + # Left eye, right corner. + LEFT_EYE_RIGHT_CORNER = 18 + + # Left eye, bottom boundary. + LEFT_EYE_BOTTOM_BOUNDARY = 19 + + # Left eye, left corner. + LEFT_EYE_LEFT_CORNER = 20 + + # Right eye, top boundary. + RIGHT_EYE_TOP_BOUNDARY = 21 + + # Right eye, right corner. + RIGHT_EYE_RIGHT_CORNER = 22 + + # Right eye, bottom boundary. + RIGHT_EYE_BOTTOM_BOUNDARY = 23 + + # Right eye, left corner. + RIGHT_EYE_LEFT_CORNER = 24 + + # Left eyebrow, upper midpoint. + LEFT_EYEBROW_UPPER_MIDPOINT = 25 + + # Right eyebrow, upper midpoint. + RIGHT_EYEBROW_UPPER_MIDPOINT = 26 + + # Left ear tragion. + LEFT_EAR_TRAGION = 27 + + # Right ear tragion. + RIGHT_EAR_TRAGION = 28 + + # Left eye pupil. + LEFT_EYE_PUPIL = 29 + + # Right eye pupil. + RIGHT_EYE_PUPIL = 30 + + # Forehead glabella. + FOREHEAD_GLABELLA = 31 + + # Chin gnathion. + CHIN_GNATHION = 32 + + # Chin left gonion. + CHIN_LEFT_GONION = 33 + + # Chin right gonion. + CHIN_RIGHT_GONION = 34 + end + end + end + + # Detected entity location information. + # @!attribute [rw] lat_lng + # @return [::Google::Type::LatLng] + # lat/long location coordinates. + class LocationInfo + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A `Property` consists of a user-supplied name/value pair. + # @!attribute [rw] name + # @return [::String] + # Name of the property. + # @!attribute [rw] value + # @return [::String] + # Value of the property. + # @!attribute [rw] uint64_value + # @return [::Integer] + # Value of numeric properties. + class Property + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Set of detected entity features. + # @!attribute [rw] mid + # @return [::String] + # Opaque entity ID. Some IDs may be available in + # [Google Knowledge Graph Search + # API](https://developers.google.com/knowledge-graph/). + # @!attribute [rw] locale + # @return [::String] + # The language code for the locale in which the entity textual + # `description` is expressed. + # @!attribute [rw] description + # @return [::String] + # Entity textual description, expressed in its `locale` language. + # @!attribute [rw] score + # @return [::Float] + # Overall score of the result. Range [0, 1]. + # @!attribute [rw] confidence + # @return [::Float] + # **Deprecated. Use `score` instead.** + # The accuracy of the entity detection in an image. + # For example, for an image in which the "Eiffel Tower" entity is detected, + # this field represents the confidence that there is a tower in the query + # image. Range [0, 1]. + # @!attribute [rw] topicality + # @return [::Float] + # The relevancy of the ICA (Image Content Annotation) label to the + # image. For example, the relevancy of "tower" is likely higher to an image + # containing the detected "Eiffel Tower" than to an image containing a + # detected distant towering building, even though the confidence that + # there is a tower in each image may be the same. Range [0, 1]. + # @!attribute [rw] bounding_poly + # @return [::Google::Cloud::Vision::V1p3beta1::BoundingPoly] + # Image region to which this entity belongs. Not produced + # for `LABEL_DETECTION` features. + # @!attribute [rw] locations + # @return [::Array<::Google::Cloud::Vision::V1p3beta1::LocationInfo>] + # The location information for the detected entity. Multiple + # `LocationInfo` elements can be present because one location may + # indicate the location of the scene in the image, and another location + # may indicate the location of the place where the image was taken. + # Location information is usually present for landmarks. + # @!attribute [rw] properties + # @return [::Array<::Google::Cloud::Vision::V1p3beta1::Property>] + # Some entities may have optional user-supplied `Property` (name/value) + # fields, such a score or string that qualifies the entity. + class EntityAnnotation + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Set of detected objects with bounding boxes. + # @!attribute [rw] mid + # @return [::String] + # Object ID that should align with EntityAnnotation mid. + # @!attribute [rw] language_code + # @return [::String] + # The BCP-47 language code, such as "en-US" or "sr-Latn". For more + # information, see + # http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. + # @!attribute [rw] name + # @return [::String] + # Object name, expressed in its `language_code` language. + # @!attribute [rw] score + # @return [::Float] + # Score of the result. Range [0, 1]. + # @!attribute [rw] bounding_poly + # @return [::Google::Cloud::Vision::V1p3beta1::BoundingPoly] + # Image region to which this object belongs. This must be populated. + class LocalizedObjectAnnotation + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Set of features pertaining to the image, computed by computer vision + # methods over safe-search verticals (for example, adult, spoof, medical, + # violence). + # @!attribute [rw] adult + # @return [::Google::Cloud::Vision::V1p3beta1::Likelihood] + # Represents the adult content likelihood for the image. Adult content may + # contain elements such as nudity, pornographic images or cartoons, or + # sexual activities. + # @!attribute [rw] spoof + # @return [::Google::Cloud::Vision::V1p3beta1::Likelihood] + # Spoof likelihood. The likelihood that an modification + # was made to the image's canonical version to make it appear + # funny or offensive. + # @!attribute [rw] medical + # @return [::Google::Cloud::Vision::V1p3beta1::Likelihood] + # Likelihood that this is a medical image. + # @!attribute [rw] violence + # @return [::Google::Cloud::Vision::V1p3beta1::Likelihood] + # Likelihood that this image contains violent content. + # @!attribute [rw] racy + # @return [::Google::Cloud::Vision::V1p3beta1::Likelihood] + # Likelihood that the request image contains racy content. Racy content may + # include (but is not limited to) skimpy or sheer clothing, strategically + # covered nudity, lewd or provocative poses, or close-ups of sensitive + # body areas. + class SafeSearchAnnotation + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Rectangle determined by min and max `LatLng` pairs. + # @!attribute [rw] min_lat_lng + # @return [::Google::Type::LatLng] + # Min lat/long pair. + # @!attribute [rw] max_lat_lng + # @return [::Google::Type::LatLng] + # Max lat/long pair. + class LatLongRect + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Color information consists of RGB channels, score, and the fraction of + # the image that the color occupies in the image. + # @!attribute [rw] color + # @return [::Google::Type::Color] + # RGB components of the color. + # @!attribute [rw] score + # @return [::Float] + # Image-specific score for this color. Value in range [0, 1]. + # @!attribute [rw] pixel_fraction + # @return [::Float] + # The fraction of pixels the color occupies in the image. + # Value in range [0, 1]. + class ColorInfo + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Set of dominant colors and their corresponding scores. + # @!attribute [rw] colors + # @return [::Array<::Google::Cloud::Vision::V1p3beta1::ColorInfo>] + # RGB color values with their score and pixel fraction. + class DominantColorsAnnotation + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Stores image properties, such as dominant colors. + # @!attribute [rw] dominant_colors + # @return [::Google::Cloud::Vision::V1p3beta1::DominantColorsAnnotation] + # If present, dominant colors completed successfully. + class ImageProperties + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Single crop hint that is used to generate a new crop when serving an image. + # @!attribute [rw] bounding_poly + # @return [::Google::Cloud::Vision::V1p3beta1::BoundingPoly] + # The bounding polygon for the crop region. The coordinates of the bounding + # box are in the original image's scale, as returned in `ImageParams`. + # @!attribute [rw] confidence + # @return [::Float] + # Confidence of this being a salient region. Range [0, 1]. + # @!attribute [rw] importance_fraction + # @return [::Float] + # Fraction of importance of this salient region with respect to the original + # image. + class CropHint + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Set of crop hints that are used to generate new crops when serving images. + # @!attribute [rw] crop_hints + # @return [::Array<::Google::Cloud::Vision::V1p3beta1::CropHint>] + # Crop hint results. + class CropHintsAnnotation + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Parameters for crop hints annotation request. + # @!attribute [rw] aspect_ratios + # @return [::Array<::Float>] + # Aspect ratios in floats, representing the ratio of the width to the height + # of the image. For example, if the desired aspect ratio is 4/3, the + # corresponding float value should be 1.33333. If not specified, the + # best possible crop is returned. The number of provided aspect ratios is + # limited to a maximum of 16; any aspect ratios provided after the 16th are + # ignored. + class CropHintsParams + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Parameters for web detection request. + # @!attribute [rw] include_geo_results + # @return [::Boolean] + # Whether to include results derived from the geo information in the image. + class WebDetectionParams + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Parameters for text detections. This is used to control TEXT_DETECTION and + # DOCUMENT_TEXT_DETECTION features. + # @!attribute [rw] enable_text_detection_confidence_score + # @return [::Boolean] + # By default, Cloud Vision API only includes confidence score for + # DOCUMENT_TEXT_DETECTION result. Set the flag to true to include confidence + # score for TEXT_DETECTION as well. + # @!attribute [rw] advanced_ocr_options + # @return [::Array<::String>] + # A list of advanced OCR options to fine-tune OCR behavior. + class TextDetectionParams + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Image context and/or feature-specific parameters. + # @!attribute [rw] lat_long_rect + # @return [::Google::Cloud::Vision::V1p3beta1::LatLongRect] + # Not used. + # @!attribute [rw] language_hints + # @return [::Array<::String>] + # List of languages to use for TEXT_DETECTION. In most cases, an empty value + # yields the best results since it enables automatic language detection. For + # languages based on the Latin alphabet, setting `language_hints` is not + # needed. In rare cases, when the language of the text in the image is known, + # setting a hint will help get better results (although it will be a + # significant hindrance if the hint is wrong). Text detection returns an + # error if one or more of the specified languages is not one of the + # [supported languages](https://cloud.google.com/vision/docs/languages). + # @!attribute [rw] crop_hints_params + # @return [::Google::Cloud::Vision::V1p3beta1::CropHintsParams] + # Parameters for crop hints annotation request. + # @!attribute [rw] product_search_params + # @return [::Google::Cloud::Vision::V1p3beta1::ProductSearchParams] + # Parameters for product search. + # @!attribute [rw] web_detection_params + # @return [::Google::Cloud::Vision::V1p3beta1::WebDetectionParams] + # Parameters for web detection. + # @!attribute [rw] text_detection_params + # @return [::Google::Cloud::Vision::V1p3beta1::TextDetectionParams] + # Parameters for text detection and document text detection. + class ImageContext + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request for performing Google Cloud Vision API tasks over a user-provided + # image, with user-requested features. + # @!attribute [rw] image + # @return [::Google::Cloud::Vision::V1p3beta1::Image] + # The image to be processed. + # @!attribute [rw] features + # @return [::Array<::Google::Cloud::Vision::V1p3beta1::Feature>] + # Requested features. + # @!attribute [rw] image_context + # @return [::Google::Cloud::Vision::V1p3beta1::ImageContext] + # Additional context that may accompany the image. + class AnnotateImageRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # If an image was produced from a file (e.g. a PDF), this message gives + # information about the source of that image. + # @!attribute [rw] uri + # @return [::String] + # The URI of the file used to produce the image. + # @!attribute [rw] page_number + # @return [::Integer] + # If the file was a PDF or TIFF, this field gives the page number within + # the file used to produce the image. + class ImageAnnotationContext + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response to an image annotation request. + # @!attribute [rw] face_annotations + # @return [::Array<::Google::Cloud::Vision::V1p3beta1::FaceAnnotation>] + # If present, face detection has completed successfully. + # @!attribute [rw] landmark_annotations + # @return [::Array<::Google::Cloud::Vision::V1p3beta1::EntityAnnotation>] + # If present, landmark detection has completed successfully. + # @!attribute [rw] logo_annotations + # @return [::Array<::Google::Cloud::Vision::V1p3beta1::EntityAnnotation>] + # If present, logo detection has completed successfully. + # @!attribute [rw] label_annotations + # @return [::Array<::Google::Cloud::Vision::V1p3beta1::EntityAnnotation>] + # If present, label detection has completed successfully. + # @!attribute [rw] localized_object_annotations + # @return [::Array<::Google::Cloud::Vision::V1p3beta1::LocalizedObjectAnnotation>] + # If present, localized object detection has completed successfully. + # This will be sorted descending by confidence score. + # @!attribute [rw] text_annotations + # @return [::Array<::Google::Cloud::Vision::V1p3beta1::EntityAnnotation>] + # If present, text (OCR) detection has completed successfully. + # @!attribute [rw] full_text_annotation + # @return [::Google::Cloud::Vision::V1p3beta1::TextAnnotation] + # If present, text (OCR) detection or document (OCR) text detection has + # completed successfully. + # This annotation provides the structural hierarchy for the OCR detected + # text. + # @!attribute [rw] safe_search_annotation + # @return [::Google::Cloud::Vision::V1p3beta1::SafeSearchAnnotation] + # If present, safe-search annotation has completed successfully. + # @!attribute [rw] image_properties_annotation + # @return [::Google::Cloud::Vision::V1p3beta1::ImageProperties] + # If present, image properties were extracted successfully. + # @!attribute [rw] crop_hints_annotation + # @return [::Google::Cloud::Vision::V1p3beta1::CropHintsAnnotation] + # If present, crop hints have completed successfully. + # @!attribute [rw] web_detection + # @return [::Google::Cloud::Vision::V1p3beta1::WebDetection] + # If present, web detection has completed successfully. + # @!attribute [rw] product_search_results + # @return [::Google::Cloud::Vision::V1p3beta1::ProductSearchResults] + # If present, product search has completed successfully. + # @!attribute [rw] error + # @return [::Google::Rpc::Status] + # If set, represents the error message for the operation. + # Note that filled-in image annotations are guaranteed to be + # correct, even when `error` is set. + # @!attribute [rw] context + # @return [::Google::Cloud::Vision::V1p3beta1::ImageAnnotationContext] + # If present, contextual information is needed to understand where this image + # comes from. + class AnnotateImageResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response to a single file annotation request. A file may contain one or more + # images, which individually have their own responses. + # @!attribute [rw] input_config + # @return [::Google::Cloud::Vision::V1p3beta1::InputConfig] + # Information about the file for which this response is generated. + # @!attribute [rw] responses + # @return [::Array<::Google::Cloud::Vision::V1p3beta1::AnnotateImageResponse>] + # Individual responses to images found within the file. + class AnnotateFileResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Multiple image annotation requests are batched into a single service call. + # @!attribute [rw] requests + # @return [::Array<::Google::Cloud::Vision::V1p3beta1::AnnotateImageRequest>] + # Individual image annotation requests for this batch. + class BatchAnnotateImagesRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response to a batch image annotation request. + # @!attribute [rw] responses + # @return [::Array<::Google::Cloud::Vision::V1p3beta1::AnnotateImageResponse>] + # Individual responses to image annotation requests within the batch. + class BatchAnnotateImagesResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # An offline file annotation request. + # @!attribute [rw] input_config + # @return [::Google::Cloud::Vision::V1p3beta1::InputConfig] + # Required. Information about the input file. + # @!attribute [rw] features + # @return [::Array<::Google::Cloud::Vision::V1p3beta1::Feature>] + # Required. Requested features. + # @!attribute [rw] image_context + # @return [::Google::Cloud::Vision::V1p3beta1::ImageContext] + # Additional context that may accompany the image(s) in the file. + # @!attribute [rw] output_config + # @return [::Google::Cloud::Vision::V1p3beta1::OutputConfig] + # Required. The desired output location and metadata (e.g. format). + class AsyncAnnotateFileRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The response for a single offline file annotation request. + # @!attribute [rw] output_config + # @return [::Google::Cloud::Vision::V1p3beta1::OutputConfig] + # The output location and metadata from AsyncAnnotateFileRequest. + class AsyncAnnotateFileResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Multiple async file annotation requests are batched into a single service + # call. + # @!attribute [rw] requests + # @return [::Array<::Google::Cloud::Vision::V1p3beta1::AsyncAnnotateFileRequest>] + # Required. Individual async file annotation requests for this batch. + class AsyncBatchAnnotateFilesRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response to an async batch file annotation request. + # @!attribute [rw] responses + # @return [::Array<::Google::Cloud::Vision::V1p3beta1::AsyncAnnotateFileResponse>] + # The list of file annotation responses, one for each request in + # AsyncBatchAnnotateFilesRequest. + class AsyncBatchAnnotateFilesResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The desired input location and metadata. + # @!attribute [rw] gcs_source + # @return [::Google::Cloud::Vision::V1p3beta1::GcsSource] + # The Google Cloud Storage location to read the input from. + # @!attribute [rw] mime_type + # @return [::String] + # The type of the file. Currently only "application/pdf" and "image/tiff" + # are supported. Wildcards are not supported. + class InputConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The desired output location and metadata. + # @!attribute [rw] gcs_destination + # @return [::Google::Cloud::Vision::V1p3beta1::GcsDestination] + # The Google Cloud Storage location to write the output(s) to. + # @!attribute [rw] batch_size + # @return [::Integer] + # The max number of response protos to put into each output JSON file on + # Google Cloud Storage. + # The valid range is [1, 100]. If not specified, the default value is 20. + # + # For example, for one pdf file with 100 pages, 100 response protos will + # be generated. If `batch_size` = 20, then 5 json files each + # containing 20 response protos will be written under the prefix + # `gcs_destination`.`uri`. + # + # Currently, batch_size only applies to GcsDestination, with potential future + # support for other output configurations. + class OutputConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The Google Cloud Storage location where the input will be read from. + # @!attribute [rw] uri + # @return [::String] + # Google Cloud Storage URI for the input file. This must only be a + # Google Cloud Storage object. Wildcards are not currently supported. + class GcsSource + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The Google Cloud Storage location where the output will be written to. + # @!attribute [rw] uri + # @return [::String] + # Google Cloud Storage URI where the results will be stored. Results will + # be in JSON format and preceded by its corresponding input URI. This field + # can either represent a single file, or a prefix for multiple outputs. + # Prefixes must end in a `/`. + # + # Examples: + # + # * File: gs://bucket-name/filename.json + # * Prefix: gs://bucket-name/prefix/here/ + # * File: gs://bucket-name/prefix/here + # + # If multiple outputs, each response is still AnnotateFileResponse, each of + # which contains some subset of the full list of AnnotateImageResponse. + # Multiple outputs can happen if, for example, the output JSON is too large + # and overflows into multiple sharded files. + class GcsDestination + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Contains metadata for the BatchAnnotateImages operation. + # @!attribute [rw] state + # @return [::Google::Cloud::Vision::V1p3beta1::OperationMetadata::State] + # Current state of the batch operation. + # @!attribute [rw] create_time + # @return [::Google::Protobuf::Timestamp] + # The time when the batch request was received. + # @!attribute [rw] update_time + # @return [::Google::Protobuf::Timestamp] + # The time when the operation result was last updated. + class OperationMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Batch operation states. + module State + # Invalid. + STATE_UNSPECIFIED = 0 + + # Request is received. + CREATED = 1 + + # Request is actively being processed. + RUNNING = 2 + + # The batch processing is done. + DONE = 3 + + # The batch processing was cancelled. + CANCELLED = 4 + end + end + + # A bucketized representation of likelihood, which is intended to give clients + # highly stable results across model upgrades. + module Likelihood + # Unknown likelihood. + UNKNOWN = 0 + + # It is very unlikely that the image belongs to the specified vertical. + VERY_UNLIKELY = 1 + + # It is unlikely that the image belongs to the specified vertical. + UNLIKELY = 2 + + # It is possible that the image belongs to the specified vertical. + POSSIBLE = 3 + + # It is likely that the image belongs to the specified vertical. + LIKELY = 4 + + # It is very likely that the image belongs to the specified vertical. + VERY_LIKELY = 5 + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-vision-v1p3beta1/proto_docs/google/cloud/vision/v1p3beta1/product_search.rb b/owl-bot-staging/google-cloud-vision-v1p3beta1/proto_docs/google/cloud/vision/v1p3beta1/product_search.rb new file mode 100644 index 000000000000..bb560c3cf6f3 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision-v1p3beta1/proto_docs/google/cloud/vision/v1p3beta1/product_search.rb @@ -0,0 +1,134 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Vision + module V1p3beta1 + # Parameters for a product search request. + # @!attribute [rw] bounding_poly + # @return [::Google::Cloud::Vision::V1p3beta1::BoundingPoly] + # The bounding polygon around the area of interest in the image. + # If it is not specified, system discretion will be applied. + # @!attribute [rw] product_set + # @return [::String] + # The resource name of a {::Google::Cloud::Vision::V1p3beta1::ProductSet ProductSet} to be searched for similar images. + # + # Format is: + # `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`. + # @!attribute [rw] product_categories + # @return [::Array<::String>] + # The list of product categories to search in. Currently, we only consider + # the first category, and either "homegoods-v2", "apparel-v2", "toys-v2", + # "packagedgoods-v1", or "general-v1" should be specified. The legacy + # categories "homegoods", "apparel", and "toys" are still supported but will + # be deprecated. For new products, please use "homegoods-v2", "apparel-v2", + # or "toys-v2" for better product search accuracy. It is recommended to + # migrate existing products to these categories as well. + # @!attribute [rw] filter + # @return [::String] + # The filtering expression. This can be used to restrict search results based + # on Product labels. We currently support an AND of OR of key-value + # expressions, where each expression within an OR must have the same key. An + # '=' should be used to connect the key and value. + # + # For example, "(color = red OR color = blue) AND brand = Google" is + # acceptable, but "(color = red OR brand = Google)" is not acceptable. + # "color: red" is not acceptable because it uses a ':' instead of an '='. + class ProductSearchParams + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Results for a product search request. + # @!attribute [rw] index_time + # @return [::Google::Protobuf::Timestamp] + # Timestamp of the index which provided these results. Products added to the + # product set and products removed from the product set after this time are + # not reflected in the current results. + # @!attribute [rw] results + # @return [::Array<::Google::Cloud::Vision::V1p3beta1::ProductSearchResults::Result>] + # List of results, one for each product match. + # @!attribute [rw] product_grouped_results + # @return [::Array<::Google::Cloud::Vision::V1p3beta1::ProductSearchResults::GroupedResult>] + # List of results grouped by products detected in the query image. Each entry + # corresponds to one bounding polygon in the query image, and contains the + # matching products specific to that region. There may be duplicate product + # matches in the union of all the per-product results. + class ProductSearchResults + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Information about a product. + # @!attribute [rw] product + # @return [::Google::Cloud::Vision::V1p3beta1::Product] + # The Product. + # @!attribute [rw] score + # @return [::Float] + # A confidence level on the match, ranging from 0 (no confidence) to + # 1 (full confidence). + # @!attribute [rw] image + # @return [::String] + # The resource name of the image from the product that is the closest match + # to the query. + class Result + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Prediction for what the object in the bounding box is. + # @!attribute [rw] mid + # @return [::String] + # Object ID that should align with EntityAnnotation mid. + # @!attribute [rw] language_code + # @return [::String] + # The BCP-47 language code, such as "en-US" or "sr-Latn". For more + # information, see + # http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. + # @!attribute [rw] name + # @return [::String] + # Object name, expressed in its `language_code` language. + # @!attribute [rw] score + # @return [::Float] + # Score of the result. Range [0, 1]. + class ObjectAnnotation + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Information about the products similar to a single product in a query + # image. + # @!attribute [rw] bounding_poly + # @return [::Google::Cloud::Vision::V1p3beta1::BoundingPoly] + # The bounding polygon around the product detected in the query image. + # @!attribute [rw] results + # @return [::Array<::Google::Cloud::Vision::V1p3beta1::ProductSearchResults::Result>] + # List of results, one for each product match. + # @!attribute [rw] object_annotations + # @return [::Array<::Google::Cloud::Vision::V1p3beta1::ProductSearchResults::ObjectAnnotation>] + # List of generic predictions for the object in the bounding box. + class GroupedResult + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-vision-v1p3beta1/proto_docs/google/cloud/vision/v1p3beta1/product_search_service.rb b/owl-bot-staging/google-cloud-vision-v1p3beta1/proto_docs/google/cloud/vision/v1p3beta1/product_search_service.rb new file mode 100644 index 000000000000..06d75f8a2143 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision-v1p3beta1/proto_docs/google/cloud/vision/v1p3beta1/product_search_service.rb @@ -0,0 +1,630 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Vision + module V1p3beta1 + # A Product contains ReferenceImages. + # @!attribute [rw] name + # @return [::String] + # The resource name of the product. + # + # Format is: + # `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`. + # + # This field is ignored when creating a product. + # @!attribute [rw] display_name + # @return [::String] + # The user-provided name for this Product. Must not be empty. Must be at most + # 4096 characters long. + # @!attribute [rw] description + # @return [::String] + # User-provided metadata to be stored with this product. Must be at most 4096 + # characters long. + # @!attribute [rw] product_category + # @return [::String] + # Immutable. The category for the product identified by the reference image. This should + # be either "homegoods-v2", "apparel-v2", or "toys-v2". The legacy categories + # "homegoods", "apparel", and "toys" are still supported, but these should + # not be used for new products. + # @!attribute [rw] product_labels + # @return [::Array<::Google::Cloud::Vision::V1p3beta1::Product::KeyValue>] + # Key-value pairs that can be attached to a product. At query time, + # constraints can be specified based on the product_labels. + # + # Note that integer values can be provided as strings, e.g. "1199". Only + # strings with integer values can match a range-based restriction which is + # to be supported soon. + # + # Multiple values can be assigned to the same key. One product may have up to + # 100 product_labels. + class Product + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # A product label represented as a key-value pair. + # @!attribute [rw] key + # @return [::String] + # The key of the label attached to the product. Cannot be empty and cannot + # exceed 128 bytes. + # @!attribute [rw] value + # @return [::String] + # The value of the label attached to the product. Cannot be empty and + # cannot exceed 128 bytes. + class KeyValue + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # A ProductSet contains Products. A ProductSet can contain a maximum of 1 + # million reference images. If the limit is exceeded, periodic indexing will + # fail. + # @!attribute [rw] name + # @return [::String] + # The resource name of the ProductSet. + # + # Format is: + # `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`. + # + # This field is ignored when creating a ProductSet. + # @!attribute [rw] display_name + # @return [::String] + # The user-provided name for this ProductSet. Must not be empty. Must be at + # most 4096 characters long. + # @!attribute [r] index_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time at which this ProductSet was last indexed. Query + # results will reflect all updates before this time. If this ProductSet has + # never been indexed, this field is 0. + # + # This field is ignored when creating a ProductSet. + # @!attribute [r] index_error + # @return [::Google::Rpc::Status] + # Output only. If there was an error with indexing the product set, the field + # is populated. + # + # This field is ignored when creating a ProductSet. + class ProductSet + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A `ReferenceImage` represents a product image and its associated metadata, + # such as bounding boxes. + # @!attribute [rw] name + # @return [::String] + # The resource name of the reference image. + # + # Format is: + # + # `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID`. + # + # This field is ignored when creating a reference image. + # @!attribute [rw] uri + # @return [::String] + # Required. The Google Cloud Storage URI of the reference image. + # + # The URI must start with `gs://`. + # @!attribute [rw] bounding_polys + # @return [::Array<::Google::Cloud::Vision::V1p3beta1::BoundingPoly>] + # Optional. Bounding polygons around the areas of interest in the reference image. + # If this field is empty, the system will try to detect regions of + # interest. At most 10 bounding polygons will be used. + # + # The provided shape is converted into a non-rotated rectangle. Once + # converted, the small edge of the rectangle must be greater than or equal + # to 300 pixels. The aspect ratio must be 1:4 or less (i.e. 1:3 is ok; 1:5 + # is not). + class ReferenceImage + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for the `CreateProduct` method. + # @!attribute [rw] parent + # @return [::String] + # Required. The project in which the Product should be created. + # + # Format is + # `projects/PROJECT_ID/locations/LOC_ID`. + # @!attribute [rw] product + # @return [::Google::Cloud::Vision::V1p3beta1::Product] + # Required. The product to create. + # @!attribute [rw] product_id + # @return [::String] + # A user-supplied resource id for this Product. If set, the server will + # attempt to use this value as the resource id. If it is already in use, an + # error is returned with code ALREADY_EXISTS. Must be at most 128 characters + # long. It cannot contain the character `/`. + class CreateProductRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for the `ListProducts` method. + # @!attribute [rw] parent + # @return [::String] + # Required. The project OR ProductSet from which Products should be listed. + # + # Format: + # `projects/PROJECT_ID/locations/LOC_ID` + # @!attribute [rw] page_size + # @return [::Integer] + # The maximum number of items to return. Default 10, maximum 100. + # @!attribute [rw] page_token + # @return [::String] + # The next_page_token returned from a previous List request, if any. + class ListProductsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for the `ListProducts` method. + # @!attribute [rw] products + # @return [::Array<::Google::Cloud::Vision::V1p3beta1::Product>] + # List of products. + # @!attribute [rw] next_page_token + # @return [::String] + # Token to retrieve the next page of results, or empty if there are no more + # results in the list. + class ListProductsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for the `GetProduct` method. + # @!attribute [rw] name + # @return [::String] + # Required. Resource name of the Product to get. + # + # Format is: + # `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID` + class GetProductRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for the `UpdateProduct` method. + # @!attribute [rw] product + # @return [::Google::Cloud::Vision::V1p3beta1::Product] + # Required. The Product resource which replaces the one on the server. + # product.name is immutable. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # The {::Google::Protobuf::FieldMask FieldMask} that specifies which fields + # to update. + # If update_mask isn't specified, all mutable fields are to be updated. + # Valid mask paths include `product_labels`, `display_name`, and + # `description`. + class UpdateProductRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for the `DeleteProduct` method. + # @!attribute [rw] name + # @return [::String] + # Required. Resource name of product to delete. + # + # Format is: + # `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID` + class DeleteProductRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for the `CreateProductSet` method. + # @!attribute [rw] parent + # @return [::String] + # Required. The project in which the ProductSet should be created. + # + # Format is `projects/PROJECT_ID/locations/LOC_ID`. + # @!attribute [rw] product_set + # @return [::Google::Cloud::Vision::V1p3beta1::ProductSet] + # Required. The ProductSet to create. + # @!attribute [rw] product_set_id + # @return [::String] + # A user-supplied resource id for this ProductSet. If set, the server will + # attempt to use this value as the resource id. If it is already in use, an + # error is returned with code ALREADY_EXISTS. Must be at most 128 characters + # long. It cannot contain the character `/`. + class CreateProductSetRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for the `ListProductSets` method. + # @!attribute [rw] parent + # @return [::String] + # Required. The project from which ProductSets should be listed. + # + # Format is `projects/PROJECT_ID/locations/LOC_ID`. + # @!attribute [rw] page_size + # @return [::Integer] + # The maximum number of items to return. Default 10, maximum 100. + # @!attribute [rw] page_token + # @return [::String] + # The next_page_token returned from a previous List request, if any. + class ListProductSetsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for the `ListProductSets` method. + # @!attribute [rw] product_sets + # @return [::Array<::Google::Cloud::Vision::V1p3beta1::ProductSet>] + # List of ProductSets. + # @!attribute [rw] next_page_token + # @return [::String] + # Token to retrieve the next page of results, or empty if there are no more + # results in the list. + class ListProductSetsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for the `GetProductSet` method. + # @!attribute [rw] name + # @return [::String] + # Required. Resource name of the ProductSet to get. + # + # Format is: + # `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID` + class GetProductSetRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for the `UpdateProductSet` method. + # @!attribute [rw] product_set + # @return [::Google::Cloud::Vision::V1p3beta1::ProductSet] + # Required. The ProductSet resource which replaces the one on the server. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # The {::Google::Protobuf::FieldMask FieldMask} that specifies which fields to + # update. + # If update_mask isn't specified, all mutable fields are to be updated. + # Valid mask path is `display_name`. + class UpdateProductSetRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for the `DeleteProductSet` method. + # @!attribute [rw] name + # @return [::String] + # Required. Resource name of the ProductSet to delete. + # + # Format is: + # `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID` + class DeleteProductSetRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for the `CreateReferenceImage` method. + # @!attribute [rw] parent + # @return [::String] + # Required. Resource name of the product in which to create the reference image. + # + # Format is + # `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`. + # @!attribute [rw] reference_image + # @return [::Google::Cloud::Vision::V1p3beta1::ReferenceImage] + # Required. The reference image to create. + # If an image ID is specified, it is ignored. + # @!attribute [rw] reference_image_id + # @return [::String] + # A user-supplied resource id for the ReferenceImage to be added. If set, + # the server will attempt to use this value as the resource id. If it is + # already in use, an error is returned with code ALREADY_EXISTS. Must be at + # most 128 characters long. It cannot contain the character `/`. + class CreateReferenceImageRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for the `ListReferenceImages` method. + # @!attribute [rw] parent + # @return [::String] + # Required. Resource name of the product containing the reference images. + # + # Format is + # `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`. + # @!attribute [rw] page_size + # @return [::Integer] + # The maximum number of items to return. Default 10, maximum 100. + # @!attribute [rw] page_token + # @return [::String] + # A token identifying a page of results to be returned. This is the value + # of `nextPageToken` returned in a previous reference image list request. + # + # Defaults to the first page if not specified. + class ListReferenceImagesRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for the `ListReferenceImages` method. + # @!attribute [rw] reference_images + # @return [::Array<::Google::Cloud::Vision::V1p3beta1::ReferenceImage>] + # The list of reference images. + # @!attribute [rw] page_size + # @return [::Integer] + # The maximum number of items to return. Default 10, maximum 100. + # @!attribute [rw] next_page_token + # @return [::String] + # The next_page_token returned from a previous List request, if any. + class ListReferenceImagesResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for the `GetReferenceImage` method. + # @!attribute [rw] name + # @return [::String] + # Required. The resource name of the ReferenceImage to get. + # + # Format is: + # + # `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID`. + class GetReferenceImageRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for the `DeleteReferenceImage` method. + # @!attribute [rw] name + # @return [::String] + # Required. The resource name of the reference image to delete. + # + # Format is: + # + # `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID` + class DeleteReferenceImageRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for the `AddProductToProductSet` method. + # @!attribute [rw] name + # @return [::String] + # Required. The resource name for the ProductSet to modify. + # + # Format is: + # `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID` + # @!attribute [rw] product + # @return [::String] + # Required. The resource name for the Product to be added to this ProductSet. + # + # Format is: + # `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID` + class AddProductToProductSetRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for the `RemoveProductFromProductSet` method. + # @!attribute [rw] name + # @return [::String] + # Required. The resource name for the ProductSet to modify. + # + # Format is: + # `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID` + # @!attribute [rw] product + # @return [::String] + # Required. The resource name for the Product to be removed from this ProductSet. + # + # Format is: + # `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID` + class RemoveProductFromProductSetRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for the `ListProductsInProductSet` method. + # @!attribute [rw] name + # @return [::String] + # Required. The ProductSet resource for which to retrieve Products. + # + # Format is: + # `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID` + # @!attribute [rw] page_size + # @return [::Integer] + # The maximum number of items to return. Default 10, maximum 100. + # @!attribute [rw] page_token + # @return [::String] + # The next_page_token returned from a previous List request, if any. + class ListProductsInProductSetRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for the `ListProductsInProductSet` method. + # @!attribute [rw] products + # @return [::Array<::Google::Cloud::Vision::V1p3beta1::Product>] + # The list of Products. + # @!attribute [rw] next_page_token + # @return [::String] + # Token to retrieve the next page of results, or empty if there are no more + # results in the list. + class ListProductsInProductSetResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The Google Cloud Storage location for a csv file which preserves a list of + # ImportProductSetRequests in each line. + # @!attribute [rw] csv_file_uri + # @return [::String] + # The Google Cloud Storage URI of the input csv file. + # + # The URI must start with `gs://`. + # + # The format of the input csv file should be one image per line. + # In each line, there are 6 columns. + # 1. image_uri + # 2, image_id + # 3. product_set_id + # 4. product_id + # 5, product_category + # 6, product_display_name + # 7, labels + # 8. bounding_poly + # + # Columns 1, 3, 4, and 5 are required, other columns are optional. A new + # ProductSet/Product with the same id will be created on the fly + # if the ProductSet/Product specified by product_set_id/product_id does not + # exist. + # + # The image_id field is optional but has to be unique if provided. If it is + # empty, we will automatically assign an unique id to the image. + # + # The product_display_name field is optional. If it is empty, a space (" ") + # is used as the place holder for the product display_name, which can + # be updated later through the realtime API. + # + # If the Product with product_id already exists, the fields + # product_display_name, product_category and labels are ignored. + # + # If a Product doesn't exist and needs to be created on the fly, the + # product_display_name field refers to + # {::Google::Cloud::Vision::V1p3beta1::Product#display_name Product.display_name}, + # the product_category field refers to + # {::Google::Cloud::Vision::V1p3beta1::Product#product_category Product.product_category}, + # and the labels field refers to [Product.labels][]. + # + # Labels (optional) should be a line containing a list of comma-separated + # key-value pairs, with the format + # "key_1=value_1,key_2=value_2,...,key_n=value_n". + # + # The bounding_poly (optional) field is used to identify one region of + # interest from the image in the same manner as CreateReferenceImage. If no + # bounding_poly is specified, the system will try to detect regions of + # interest automatically. + # + # Note that the pipeline will resize the image if the image resolution is too + # large to process (above 20MP). + # + # Also note that at most one bounding_poly is allowed per line. If the image + # contains multiple regions of interest, the csv should contain one line per + # region of interest. + # + # The bounding_poly column should contain an even number of comma-separated + # numbers, with the format "p1_x,p1_y,p2_x,p2_y,...,pn_x,pn_y". Nonnegative + # integers should be used for absolute bounding polygons, and float values + # in [0, 1] should be used for normalized bounding polygons. + class ImportProductSetsGcsSource + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The input content for the `ImportProductSets` method. + # @!attribute [rw] gcs_source + # @return [::Google::Cloud::Vision::V1p3beta1::ImportProductSetsGcsSource] + # The Google Cloud Storage location for a csv file which preserves a list + # of ImportProductSetRequests in each line. + class ImportProductSetsInputConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for the `ImportProductSets` method. + # @!attribute [rw] parent + # @return [::String] + # Required. The project in which the ProductSets should be imported. + # + # Format is `projects/PROJECT_ID/locations/LOC_ID`. + # @!attribute [rw] input_config + # @return [::Google::Cloud::Vision::V1p3beta1::ImportProductSetsInputConfig] + # Required. The input content for the list of requests. + class ImportProductSetsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for the `ImportProductSets` method. + # + # This message is returned by the + # google.longrunning.Operations.GetOperation + # method in the returned + # {::Google::Longrunning::Operation#response google.longrunning.Operation.response} + # field. + # @!attribute [rw] reference_images + # @return [::Array<::Google::Cloud::Vision::V1p3beta1::ReferenceImage>] + # The list of reference_images that are imported successfully. + # @!attribute [rw] statuses + # @return [::Array<::Google::Rpc::Status>] + # The rpc status for each ImportProductSet request, including both successes + # and errors. + # + # The number of statuses here matches the number of lines in the csv file, + # and statuses[i] stores the success or failure status of processing the i-th + # line of the csv, starting from line 0. + class ImportProductSetsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Metadata for the batch operations such as the current state. + # + # This is included in the `metadata` field of the `Operation` returned by the + # `GetOperation` call of the `google::longrunning::Operations` service. + # @!attribute [rw] state + # @return [::Google::Cloud::Vision::V1p3beta1::BatchOperationMetadata::State] + # The current state of the batch operation. + # @!attribute [rw] submit_time + # @return [::Google::Protobuf::Timestamp] + # The time when the batch request was submitted to the server. + # @!attribute [rw] end_time + # @return [::Google::Protobuf::Timestamp] + # The time when the batch request is finished and + # {::Google::Longrunning::Operation#done google.longrunning.Operation.done} is + # set to true. + class BatchOperationMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Enumerates the possible states that the batch request can be in. + module State + # Invalid. + STATE_UNSPECIFIED = 0 + + # Request is actively being processed. + PROCESSING = 1 + + # The request is done and at least one item has been successfully + # processed. + SUCCESSFUL = 2 + + # The request is done and no item has been successfully processed. + FAILED = 3 + + # The request is done after the longrunning.Operations.CancelOperation has + # been called by the user. Any records that were processed before the + # cancel command are output as specified in the request. + CANCELLED = 4 + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-vision-v1p3beta1/proto_docs/google/cloud/vision/v1p3beta1/text_annotation.rb b/owl-bot-staging/google-cloud-vision-v1p3beta1/proto_docs/google/cloud/vision/v1p3beta1/text_annotation.rb new file mode 100644 index 000000000000..beb1cf354514 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision-v1p3beta1/proto_docs/google/cloud/vision/v1p3beta1/text_annotation.rb @@ -0,0 +1,286 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Vision + module V1p3beta1 + # TextAnnotation contains a structured representation of OCR extracted text. + # The hierarchy of an OCR extracted text structure is like this: + # TextAnnotation -> Page -> Block -> Paragraph -> Word -> Symbol + # Each structural component, starting from Page, may further have their own + # properties. Properties describe detected languages, breaks etc.. Please refer + # to the + # {::Google::Cloud::Vision::V1p3beta1::TextAnnotation::TextProperty TextAnnotation.TextProperty} + # message definition below for more detail. + # @!attribute [rw] pages + # @return [::Array<::Google::Cloud::Vision::V1p3beta1::Page>] + # List of pages detected by OCR. + # @!attribute [rw] text + # @return [::String] + # UTF-8 text detected on the pages. + class TextAnnotation + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Detected language for a structural component. + # @!attribute [rw] language_code + # @return [::String] + # The BCP-47 language code, such as "en-US" or "sr-Latn". For more + # information, see + # http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. + # @!attribute [rw] confidence + # @return [::Float] + # Confidence of detected language. Range [0, 1]. + class DetectedLanguage + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Detected start or end of a structural component. + # @!attribute [rw] type + # @return [::Google::Cloud::Vision::V1p3beta1::TextAnnotation::DetectedBreak::BreakType] + # Detected break type. + # @!attribute [rw] is_prefix + # @return [::Boolean] + # True if break prepends the element. + class DetectedBreak + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Enum to denote the type of break found. New line, space etc. + module BreakType + # Unknown break label type. + UNKNOWN = 0 + + # Regular space. + SPACE = 1 + + # Sure space (very wide). + SURE_SPACE = 2 + + # Line-wrapping break. + EOL_SURE_SPACE = 3 + + # End-line hyphen that is not present in text; does not co-occur with + # `SPACE`, `LEADER_SPACE`, or `LINE_BREAK`. + HYPHEN = 4 + + # Line break that ends a paragraph. + LINE_BREAK = 5 + end + end + + # Additional information detected on the structural component. + # @!attribute [rw] detected_languages + # @return [::Array<::Google::Cloud::Vision::V1p3beta1::TextAnnotation::DetectedLanguage>] + # A list of detected languages together with confidence. + # @!attribute [rw] detected_break + # @return [::Google::Cloud::Vision::V1p3beta1::TextAnnotation::DetectedBreak] + # Detected start or end of a text segment. + class TextProperty + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Detected page from OCR. + # @!attribute [rw] property + # @return [::Google::Cloud::Vision::V1p3beta1::TextAnnotation::TextProperty] + # Additional information detected on the page. + # @!attribute [rw] width + # @return [::Integer] + # Page width. For PDFs the unit is points. For images (including + # TIFFs) the unit is pixels. + # @!attribute [rw] height + # @return [::Integer] + # Page height. For PDFs the unit is points. For images (including + # TIFFs) the unit is pixels. + # @!attribute [rw] blocks + # @return [::Array<::Google::Cloud::Vision::V1p3beta1::Block>] + # List of blocks of text, images etc on this page. + # @!attribute [rw] confidence + # @return [::Float] + # Confidence of the OCR results on the page. Range [0, 1]. + class Page + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Logical element on the page. + # @!attribute [rw] property + # @return [::Google::Cloud::Vision::V1p3beta1::TextAnnotation::TextProperty] + # Additional information detected for the block. + # @!attribute [rw] bounding_box + # @return [::Google::Cloud::Vision::V1p3beta1::BoundingPoly] + # The bounding box for the block. + # The vertices are in the order of top-left, top-right, bottom-right, + # bottom-left. When a rotation of the bounding box is detected the rotation + # is represented as around the top-left corner as defined when the text is + # read in the 'natural' orientation. + # For example: + # + # * when the text is horizontal it might look like: + # + # 0----1 + # | | + # 3----2 + # + # * when it's rotated 180 degrees around the top-left corner it becomes: + # + # 2----3 + # | | + # 1----0 + # + # and the vertice order will still be (0, 1, 2, 3). + # @!attribute [rw] paragraphs + # @return [::Array<::Google::Cloud::Vision::V1p3beta1::Paragraph>] + # List of paragraphs in this block (if this blocks is of type text). + # @!attribute [rw] block_type + # @return [::Google::Cloud::Vision::V1p3beta1::Block::BlockType] + # Detected block type (text, image etc) for this block. + # @!attribute [rw] confidence + # @return [::Float] + # Confidence of the OCR results on the block. Range [0, 1]. + class Block + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Type of a block (text, image etc) as identified by OCR. + module BlockType + # Unknown block type. + UNKNOWN = 0 + + # Regular text block. + TEXT = 1 + + # Table block. + TABLE = 2 + + # Image block. + PICTURE = 3 + + # Horizontal/vertical line box. + RULER = 4 + + # Barcode block. + BARCODE = 5 + end + end + + # Structural unit of text representing a number of words in certain order. + # @!attribute [rw] property + # @return [::Google::Cloud::Vision::V1p3beta1::TextAnnotation::TextProperty] + # Additional information detected for the paragraph. + # @!attribute [rw] bounding_box + # @return [::Google::Cloud::Vision::V1p3beta1::BoundingPoly] + # The bounding box for the paragraph. + # The vertices are in the order of top-left, top-right, bottom-right, + # bottom-left. When a rotation of the bounding box is detected the rotation + # is represented as around the top-left corner as defined when the text is + # read in the 'natural' orientation. + # For example: + # * when the text is horizontal it might look like: + # 0----1 + # | | + # 3----2 + # * when it's rotated 180 degrees around the top-left corner it becomes: + # 2----3 + # | | + # 1----0 + # and the vertice order will still be (0, 1, 2, 3). + # @!attribute [rw] words + # @return [::Array<::Google::Cloud::Vision::V1p3beta1::Word>] + # List of words in this paragraph. + # @!attribute [rw] confidence + # @return [::Float] + # Confidence of the OCR results for the paragraph. Range [0, 1]. + class Paragraph + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A word representation. + # @!attribute [rw] property + # @return [::Google::Cloud::Vision::V1p3beta1::TextAnnotation::TextProperty] + # Additional information detected for the word. + # @!attribute [rw] bounding_box + # @return [::Google::Cloud::Vision::V1p3beta1::BoundingPoly] + # The bounding box for the word. + # The vertices are in the order of top-left, top-right, bottom-right, + # bottom-left. When a rotation of the bounding box is detected the rotation + # is represented as around the top-left corner as defined when the text is + # read in the 'natural' orientation. + # For example: + # * when the text is horizontal it might look like: + # 0----1 + # | | + # 3----2 + # * when it's rotated 180 degrees around the top-left corner it becomes: + # 2----3 + # | | + # 1----0 + # and the vertice order will still be (0, 1, 2, 3). + # @!attribute [rw] symbols + # @return [::Array<::Google::Cloud::Vision::V1p3beta1::Symbol>] + # List of symbols in the word. + # The order of the symbols follows the natural reading order. + # @!attribute [rw] confidence + # @return [::Float] + # Confidence of the OCR results for the word. Range [0, 1]. + class Word + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A single symbol representation. + # @!attribute [rw] property + # @return [::Google::Cloud::Vision::V1p3beta1::TextAnnotation::TextProperty] + # Additional information detected for the symbol. + # @!attribute [rw] bounding_box + # @return [::Google::Cloud::Vision::V1p3beta1::BoundingPoly] + # The bounding box for the symbol. + # The vertices are in the order of top-left, top-right, bottom-right, + # bottom-left. When a rotation of the bounding box is detected the rotation + # is represented as around the top-left corner as defined when the text is + # read in the 'natural' orientation. + # For example: + # * when the text is horizontal it might look like: + # 0----1 + # | | + # 3----2 + # * when it's rotated 180 degrees around the top-left corner it becomes: + # 2----3 + # | | + # 1----0 + # and the vertice order will still be (0, 1, 2, 3). + # @!attribute [rw] text + # @return [::String] + # The actual UTF-8 representation of the symbol. + # @!attribute [rw] confidence + # @return [::Float] + # Confidence of the OCR results for the symbol. Range [0, 1]. + class Symbol + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-vision-v1p3beta1/proto_docs/google/cloud/vision/v1p3beta1/web_detection.rb b/owl-bot-staging/google-cloud-vision-v1p3beta1/proto_docs/google/cloud/vision/v1p3beta1/web_detection.rb new file mode 100644 index 000000000000..01b730aadb1c --- /dev/null +++ b/owl-bot-staging/google-cloud-vision-v1p3beta1/proto_docs/google/cloud/vision/v1p3beta1/web_detection.rb @@ -0,0 +1,120 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Vision + module V1p3beta1 + # Relevant information for the image from the Internet. + # @!attribute [rw] web_entities + # @return [::Array<::Google::Cloud::Vision::V1p3beta1::WebDetection::WebEntity>] + # Deduced entities from similar images on the Internet. + # @!attribute [rw] full_matching_images + # @return [::Array<::Google::Cloud::Vision::V1p3beta1::WebDetection::WebImage>] + # Fully matching images from the Internet. + # Can include resized copies of the query image. + # @!attribute [rw] partial_matching_images + # @return [::Array<::Google::Cloud::Vision::V1p3beta1::WebDetection::WebImage>] + # Partial matching images from the Internet. + # Those images are similar enough to share some key-point features. For + # example an original image will likely have partial matching for its crops. + # @!attribute [rw] pages_with_matching_images + # @return [::Array<::Google::Cloud::Vision::V1p3beta1::WebDetection::WebPage>] + # Web pages containing the matching images from the Internet. + # @!attribute [rw] visually_similar_images + # @return [::Array<::Google::Cloud::Vision::V1p3beta1::WebDetection::WebImage>] + # The visually similar image results. + # @!attribute [rw] best_guess_labels + # @return [::Array<::Google::Cloud::Vision::V1p3beta1::WebDetection::WebLabel>] + # Best guess text labels for the request image. + class WebDetection + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Entity deduced from similar images on the Internet. + # @!attribute [rw] entity_id + # @return [::String] + # Opaque entity ID. + # @!attribute [rw] score + # @return [::Float] + # Overall relevancy score for the entity. + # Not normalized and not comparable across different image queries. + # @!attribute [rw] description + # @return [::String] + # Canonical description of the entity, in English. + class WebEntity + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Metadata for online images. + # @!attribute [rw] url + # @return [::String] + # The result image URL. + # @!attribute [rw] score + # @return [::Float] + # (Deprecated) Overall relevancy score for the image. + class WebImage + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Metadata for web pages. + # @!attribute [rw] url + # @return [::String] + # The result web page URL. + # @!attribute [rw] score + # @return [::Float] + # (Deprecated) Overall relevancy score for the web page. + # @!attribute [rw] page_title + # @return [::String] + # Title for the web page, may contain HTML markups. + # @!attribute [rw] full_matching_images + # @return [::Array<::Google::Cloud::Vision::V1p3beta1::WebDetection::WebImage>] + # Fully matching images on the page. + # Can include resized copies of the query image. + # @!attribute [rw] partial_matching_images + # @return [::Array<::Google::Cloud::Vision::V1p3beta1::WebDetection::WebImage>] + # Partial matching images on the page. + # Those images are similar enough to share some key-point features. For + # example an original image will likely have partial matching for its + # crops. + class WebPage + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Label to provide extra metadata for the web detection. + # @!attribute [rw] label + # @return [::String] + # Label for extra metadata. + # @!attribute [rw] language_code + # @return [::String] + # The BCP-47 language code for `label`, such as "en-US" or "sr-Latn". + # For more information, see + # http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. + class WebLabel + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-vision-v1p3beta1/proto_docs/google/longrunning/operations.rb b/owl-bot-staging/google-cloud-vision-v1p3beta1/proto_docs/google/longrunning/operations.rb new file mode 100644 index 000000000000..7a757f512165 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision-v1p3beta1/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-vision-v1p3beta1/proto_docs/google/protobuf/any.rb b/owl-bot-staging/google-cloud-vision-v1p3beta1/proto_docs/google/protobuf/any.rb new file mode 100644 index 000000000000..58691995f02e --- /dev/null +++ b/owl-bot-staging/google-cloud-vision-v1p3beta1/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-vision-v1p3beta1/proto_docs/google/protobuf/duration.rb b/owl-bot-staging/google-cloud-vision-v1p3beta1/proto_docs/google/protobuf/duration.rb new file mode 100644 index 000000000000..ea59f1f91daf --- /dev/null +++ b/owl-bot-staging/google-cloud-vision-v1p3beta1/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-vision-v1p3beta1/proto_docs/google/protobuf/empty.rb b/owl-bot-staging/google-cloud-vision-v1p3beta1/proto_docs/google/protobuf/empty.rb new file mode 100644 index 000000000000..83e4481834a6 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision-v1p3beta1/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-vision-v1p3beta1/proto_docs/google/protobuf/field_mask.rb b/owl-bot-staging/google-cloud-vision-v1p3beta1/proto_docs/google/protobuf/field_mask.rb new file mode 100644 index 000000000000..7f3ffc78601a --- /dev/null +++ b/owl-bot-staging/google-cloud-vision-v1p3beta1/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-vision-v1p3beta1/proto_docs/google/protobuf/timestamp.rb b/owl-bot-staging/google-cloud-vision-v1p3beta1/proto_docs/google/protobuf/timestamp.rb new file mode 100644 index 000000000000..74352be9c58c --- /dev/null +++ b/owl-bot-staging/google-cloud-vision-v1p3beta1/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-vision-v1p3beta1/proto_docs/google/protobuf/wrappers.rb b/owl-bot-staging/google-cloud-vision-v1p3beta1/proto_docs/google/protobuf/wrappers.rb new file mode 100644 index 000000000000..9a7c0269fa42 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision-v1p3beta1/proto_docs/google/protobuf/wrappers.rb @@ -0,0 +1,148 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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. + # + # Not recommended for use in new APIs, but still useful for legacy APIs and + # has no plan to be removed. + # @!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. + # + # Not recommended for use in new APIs, but still useful for legacy APIs and + # has no plan to be removed. + # @!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. + # + # Not recommended for use in new APIs, but still useful for legacy APIs and + # has no plan to be removed. + # @!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. + # + # Not recommended for use in new APIs, but still useful for legacy APIs and + # has no plan to be removed. + # @!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. + # + # Not recommended for use in new APIs, but still useful for legacy APIs and + # has no plan to be removed. + # @!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. + # + # Not recommended for use in new APIs, but still useful for legacy APIs and + # has no plan to be removed. + # @!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`. + # + # Not recommended for use in new APIs, but still useful for legacy APIs and + # has no plan to be removed. + # @!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. + # + # Not recommended for use in new APIs, but still useful for legacy APIs and + # has no plan to be removed. + # @!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. + # + # Not recommended for use in new APIs, but still useful for legacy APIs and + # has no plan to be removed. + # @!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-vision-v1p3beta1/proto_docs/google/rpc/status.rb b/owl-bot-staging/google-cloud-vision-v1p3beta1/proto_docs/google/rpc/status.rb new file mode 100644 index 000000000000..c1a1c07eb2db --- /dev/null +++ b/owl-bot-staging/google-cloud-vision-v1p3beta1/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-vision-v1p3beta1/proto_docs/google/type/color.rb b/owl-bot-staging/google-cloud-vision-v1p3beta1/proto_docs/google/type/color.rb new file mode 100644 index 000000000000..5728bc06bc83 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision-v1p3beta1/proto_docs/google/type/color.rb @@ -0,0 +1,173 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 color in the RGBA color space. This representation is designed + # for simplicity of conversion to and from color representations in various + # languages over compactness. For example, the fields of this representation + # can be trivially provided to the constructor of `java.awt.Color` in Java; it + # can also be trivially provided to UIColor's `+colorWithRed:green:blue:alpha` + # method in iOS; and, with just a little work, it can be easily formatted into + # a CSS `rgba()` string in JavaScript. + # + # This reference page doesn't have information about the absolute color + # space that should be used to interpret the RGB value—for example, sRGB, + # Adobe RGB, + # DCI-P3, and BT.2020. By default, applications should assume the sRGB color + # space. + # + # When color equality needs to be decided, implementations, unless documented + # otherwise, treat two colors as equal if all their red, green, blue, and alpha + # values each differ by at most `1e-5`. + # + # Example (Java): + # + # import com.google.type.Color; + # + # // ... + # public static java.awt.Color fromProto(Color protocolor) { + # float alpha = protocolor.hasAlpha() + # ? protocolor.getAlpha().getValue() + # : 1.0; + # + # return new java.awt.Color( + # protocolor.getRed(), + # protocolor.getGreen(), + # protocolor.getBlue(), + # alpha); + # } + # + # public static Color toProto(java.awt.Color color) { + # float red = (float) color.getRed(); + # float green = (float) color.getGreen(); + # float blue = (float) color.getBlue(); + # float denominator = 255.0; + # Color.Builder resultBuilder = + # Color + # .newBuilder() + # .setRed(red / denominator) + # .setGreen(green / denominator) + # .setBlue(blue / denominator); + # int alpha = color.getAlpha(); + # if (alpha != 255) { + # result.setAlpha( + # FloatValue + # .newBuilder() + # .setValue(((float) alpha) / denominator) + # .build()); + # } + # return resultBuilder.build(); + # } + # // ... + # + # Example (iOS / Obj-C): + # + # // ... + # static UIColor* fromProto(Color* protocolor) { + # float red = [protocolor red]; + # float green = [protocolor green]; + # float blue = [protocolor blue]; + # FloatValue* alpha_wrapper = [protocolor alpha]; + # float alpha = 1.0; + # if (alpha_wrapper != nil) { + # alpha = [alpha_wrapper value]; + # } + # return [UIColor colorWithRed:red green:green blue:blue alpha:alpha]; + # } + # + # static Color* toProto(UIColor* color) { + # CGFloat red, green, blue, alpha; + # if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) { + # return nil; + # } + # Color* result = [[Color alloc] init]; + # [result setRed:red]; + # [result setGreen:green]; + # [result setBlue:blue]; + # if (alpha <= 0.9999) { + # [result setAlpha:floatWrapperWithValue(alpha)]; + # } + # [result autorelease]; + # return result; + # } + # // ... + # + # Example (JavaScript): + # + # // ... + # + # var protoToCssColor = function(rgb_color) { + # var redFrac = rgb_color.red || 0.0; + # var greenFrac = rgb_color.green || 0.0; + # var blueFrac = rgb_color.blue || 0.0; + # var red = Math.floor(redFrac * 255); + # var green = Math.floor(greenFrac * 255); + # var blue = Math.floor(blueFrac * 255); + # + # if (!('alpha' in rgb_color)) { + # return rgbToCssColor(red, green, blue); + # } + # + # var alphaFrac = rgb_color.alpha.value || 0.0; + # var rgbParams = [red, green, blue].join(','); + # return ['rgba(', rgbParams, ',', alphaFrac, ')'].join(''); + # }; + # + # var rgbToCssColor = function(red, green, blue) { + # var rgbNumber = new Number((red << 16) | (green << 8) | blue); + # var hexString = rgbNumber.toString(16); + # var missingZeros = 6 - hexString.length; + # var resultBuilder = ['#']; + # for (var i = 0; i < missingZeros; i++) { + # resultBuilder.push('0'); + # } + # resultBuilder.push(hexString); + # return resultBuilder.join(''); + # }; + # + # // ... + # @!attribute [rw] red + # @return [::Float] + # The amount of red in the color as a value in the interval [0, 1]. + # @!attribute [rw] green + # @return [::Float] + # The amount of green in the color as a value in the interval [0, 1]. + # @!attribute [rw] blue + # @return [::Float] + # The amount of blue in the color as a value in the interval [0, 1]. + # @!attribute [rw] alpha + # @return [::Google::Protobuf::FloatValue] + # The fraction of this color that should be applied to the pixel. That is, + # the final pixel color is defined by the equation: + # + # `pixel color = alpha * (this color) + (1.0 - alpha) * (background color)` + # + # This means that a value of 1.0 corresponds to a solid color, whereas + # a value of 0.0 corresponds to a completely transparent color. This + # uses a wrapper message rather than a simple float scalar so that it is + # possible to distinguish between a default value and the value being unset. + # If omitted, this color object is rendered as a solid color + # (as if the alpha value had been explicitly given a value of 1.0). + class Color + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-vision-v1p3beta1/proto_docs/google/type/latlng.rb b/owl-bot-staging/google-cloud-vision-v1p3beta1/proto_docs/google/type/latlng.rb new file mode 100644 index 000000000000..593314b4cde5 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision-v1p3beta1/proto_docs/google/type/latlng.rb @@ -0,0 +1,38 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 + # An object that represents a latitude/longitude pair. This is expressed as a + # pair of doubles to represent degrees latitude and degrees longitude. Unless + # specified otherwise, this object must conform to the + # + # WGS84 standard. Values must be within normalized ranges. + # @!attribute [rw] latitude + # @return [::Float] + # The latitude in degrees. It must be in the range [-90.0, +90.0]. + # @!attribute [rw] longitude + # @return [::Float] + # The longitude in degrees. It must be in the range [-180.0, +180.0]. + class LatLng + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-vision-v1p3beta1/snippets/Gemfile b/owl-bot-staging/google-cloud-vision-v1p3beta1/snippets/Gemfile new file mode 100644 index 000000000000..4321e3a73dc1 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision-v1p3beta1/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-vision-v1p3beta1", path: "../" +else + gem "google-cloud-vision-v1p3beta1" +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-vision-v1p3beta1/snippets/image_annotator/async_batch_annotate_files.rb b/owl-bot-staging/google-cloud-vision-v1p3beta1/snippets/image_annotator/async_batch_annotate_files.rb new file mode 100644 index 000000000000..4ddd3393dcfa --- /dev/null +++ b/owl-bot-staging/google-cloud-vision-v1p3beta1/snippets/image_annotator/async_batch_annotate_files.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 vision_v1p3beta1_generated_ImageAnnotator_AsyncBatchAnnotateFiles_sync] +require "google/cloud/vision/v1p3beta1" + +## +# Snippet for the async_batch_annotate_files call in the ImageAnnotator 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::Vision::V1p3beta1::ImageAnnotator::Client#async_batch_annotate_files. +# +def async_batch_annotate_files + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Vision::V1p3beta1::ImageAnnotator::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Vision::V1p3beta1::AsyncBatchAnnotateFilesRequest.new + + # Call the async_batch_annotate_files method. + result = client.async_batch_annotate_files 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 vision_v1p3beta1_generated_ImageAnnotator_AsyncBatchAnnotateFiles_sync] diff --git a/owl-bot-staging/google-cloud-vision-v1p3beta1/snippets/image_annotator/batch_annotate_images.rb b/owl-bot-staging/google-cloud-vision-v1p3beta1/snippets/image_annotator/batch_annotate_images.rb new file mode 100644 index 000000000000..06a7d8393e27 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision-v1p3beta1/snippets/image_annotator/batch_annotate_images.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 vision_v1p3beta1_generated_ImageAnnotator_BatchAnnotateImages_sync] +require "google/cloud/vision/v1p3beta1" + +## +# Snippet for the batch_annotate_images call in the ImageAnnotator 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::Vision::V1p3beta1::ImageAnnotator::Client#batch_annotate_images. +# +def batch_annotate_images + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Vision::V1p3beta1::ImageAnnotator::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Vision::V1p3beta1::BatchAnnotateImagesRequest.new + + # Call the batch_annotate_images method. + result = client.batch_annotate_images request + + # The returned object is of type Google::Cloud::Vision::V1p3beta1::BatchAnnotateImagesResponse. + p result +end +# [END vision_v1p3beta1_generated_ImageAnnotator_BatchAnnotateImages_sync] diff --git a/owl-bot-staging/google-cloud-vision-v1p3beta1/snippets/product_search/add_product_to_product_set.rb b/owl-bot-staging/google-cloud-vision-v1p3beta1/snippets/product_search/add_product_to_product_set.rb new file mode 100644 index 000000000000..72e0c5891061 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision-v1p3beta1/snippets/product_search/add_product_to_product_set.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 vision_v1p3beta1_generated_ProductSearch_AddProductToProductSet_sync] +require "google/cloud/vision/v1p3beta1" + +## +# Snippet for the add_product_to_product_set call in the ProductSearch 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::Vision::V1p3beta1::ProductSearch::Client#add_product_to_product_set. +# +def add_product_to_product_set + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Vision::V1p3beta1::ProductSearch::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Vision::V1p3beta1::AddProductToProductSetRequest.new + + # Call the add_product_to_product_set method. + result = client.add_product_to_product_set request + + # The returned object is of type Google::Protobuf::Empty. + p result +end +# [END vision_v1p3beta1_generated_ProductSearch_AddProductToProductSet_sync] diff --git a/owl-bot-staging/google-cloud-vision-v1p3beta1/snippets/product_search/create_product.rb b/owl-bot-staging/google-cloud-vision-v1p3beta1/snippets/product_search/create_product.rb new file mode 100644 index 000000000000..0635900e9530 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision-v1p3beta1/snippets/product_search/create_product.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 vision_v1p3beta1_generated_ProductSearch_CreateProduct_sync] +require "google/cloud/vision/v1p3beta1" + +## +# Snippet for the create_product call in the ProductSearch 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::Vision::V1p3beta1::ProductSearch::Client#create_product. +# +def create_product + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Vision::V1p3beta1::ProductSearch::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Vision::V1p3beta1::CreateProductRequest.new + + # Call the create_product method. + result = client.create_product request + + # The returned object is of type Google::Cloud::Vision::V1p3beta1::Product. + p result +end +# [END vision_v1p3beta1_generated_ProductSearch_CreateProduct_sync] diff --git a/owl-bot-staging/google-cloud-vision-v1p3beta1/snippets/product_search/create_product_set.rb b/owl-bot-staging/google-cloud-vision-v1p3beta1/snippets/product_search/create_product_set.rb new file mode 100644 index 000000000000..d347ab0fce39 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision-v1p3beta1/snippets/product_search/create_product_set.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 vision_v1p3beta1_generated_ProductSearch_CreateProductSet_sync] +require "google/cloud/vision/v1p3beta1" + +## +# Snippet for the create_product_set call in the ProductSearch 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::Vision::V1p3beta1::ProductSearch::Client#create_product_set. +# +def create_product_set + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Vision::V1p3beta1::ProductSearch::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Vision::V1p3beta1::CreateProductSetRequest.new + + # Call the create_product_set method. + result = client.create_product_set request + + # The returned object is of type Google::Cloud::Vision::V1p3beta1::ProductSet. + p result +end +# [END vision_v1p3beta1_generated_ProductSearch_CreateProductSet_sync] diff --git a/owl-bot-staging/google-cloud-vision-v1p3beta1/snippets/product_search/create_reference_image.rb b/owl-bot-staging/google-cloud-vision-v1p3beta1/snippets/product_search/create_reference_image.rb new file mode 100644 index 000000000000..7e78ab1f7330 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision-v1p3beta1/snippets/product_search/create_reference_image.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 vision_v1p3beta1_generated_ProductSearch_CreateReferenceImage_sync] +require "google/cloud/vision/v1p3beta1" + +## +# Snippet for the create_reference_image call in the ProductSearch 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::Vision::V1p3beta1::ProductSearch::Client#create_reference_image. +# +def create_reference_image + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Vision::V1p3beta1::ProductSearch::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Vision::V1p3beta1::CreateReferenceImageRequest.new + + # Call the create_reference_image method. + result = client.create_reference_image request + + # The returned object is of type Google::Cloud::Vision::V1p3beta1::ReferenceImage. + p result +end +# [END vision_v1p3beta1_generated_ProductSearch_CreateReferenceImage_sync] diff --git a/owl-bot-staging/google-cloud-vision-v1p3beta1/snippets/product_search/delete_product.rb b/owl-bot-staging/google-cloud-vision-v1p3beta1/snippets/product_search/delete_product.rb new file mode 100644 index 000000000000..44eb1115fb95 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision-v1p3beta1/snippets/product_search/delete_product.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 vision_v1p3beta1_generated_ProductSearch_DeleteProduct_sync] +require "google/cloud/vision/v1p3beta1" + +## +# Snippet for the delete_product call in the ProductSearch 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::Vision::V1p3beta1::ProductSearch::Client#delete_product. +# +def delete_product + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Vision::V1p3beta1::ProductSearch::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Vision::V1p3beta1::DeleteProductRequest.new + + # Call the delete_product method. + result = client.delete_product request + + # The returned object is of type Google::Protobuf::Empty. + p result +end +# [END vision_v1p3beta1_generated_ProductSearch_DeleteProduct_sync] diff --git a/owl-bot-staging/google-cloud-vision-v1p3beta1/snippets/product_search/delete_product_set.rb b/owl-bot-staging/google-cloud-vision-v1p3beta1/snippets/product_search/delete_product_set.rb new file mode 100644 index 000000000000..0618c52f4d7a --- /dev/null +++ b/owl-bot-staging/google-cloud-vision-v1p3beta1/snippets/product_search/delete_product_set.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 vision_v1p3beta1_generated_ProductSearch_DeleteProductSet_sync] +require "google/cloud/vision/v1p3beta1" + +## +# Snippet for the delete_product_set call in the ProductSearch 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::Vision::V1p3beta1::ProductSearch::Client#delete_product_set. +# +def delete_product_set + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Vision::V1p3beta1::ProductSearch::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Vision::V1p3beta1::DeleteProductSetRequest.new + + # Call the delete_product_set method. + result = client.delete_product_set request + + # The returned object is of type Google::Protobuf::Empty. + p result +end +# [END vision_v1p3beta1_generated_ProductSearch_DeleteProductSet_sync] diff --git a/owl-bot-staging/google-cloud-vision-v1p3beta1/snippets/product_search/delete_reference_image.rb b/owl-bot-staging/google-cloud-vision-v1p3beta1/snippets/product_search/delete_reference_image.rb new file mode 100644 index 000000000000..fcae51b9374c --- /dev/null +++ b/owl-bot-staging/google-cloud-vision-v1p3beta1/snippets/product_search/delete_reference_image.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 vision_v1p3beta1_generated_ProductSearch_DeleteReferenceImage_sync] +require "google/cloud/vision/v1p3beta1" + +## +# Snippet for the delete_reference_image call in the ProductSearch 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::Vision::V1p3beta1::ProductSearch::Client#delete_reference_image. +# +def delete_reference_image + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Vision::V1p3beta1::ProductSearch::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Vision::V1p3beta1::DeleteReferenceImageRequest.new + + # Call the delete_reference_image method. + result = client.delete_reference_image request + + # The returned object is of type Google::Protobuf::Empty. + p result +end +# [END vision_v1p3beta1_generated_ProductSearch_DeleteReferenceImage_sync] diff --git a/owl-bot-staging/google-cloud-vision-v1p3beta1/snippets/product_search/get_product.rb b/owl-bot-staging/google-cloud-vision-v1p3beta1/snippets/product_search/get_product.rb new file mode 100644 index 000000000000..ba15d6232a7f --- /dev/null +++ b/owl-bot-staging/google-cloud-vision-v1p3beta1/snippets/product_search/get_product.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 vision_v1p3beta1_generated_ProductSearch_GetProduct_sync] +require "google/cloud/vision/v1p3beta1" + +## +# Snippet for the get_product call in the ProductSearch 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::Vision::V1p3beta1::ProductSearch::Client#get_product. +# +def get_product + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Vision::V1p3beta1::ProductSearch::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Vision::V1p3beta1::GetProductRequest.new + + # Call the get_product method. + result = client.get_product request + + # The returned object is of type Google::Cloud::Vision::V1p3beta1::Product. + p result +end +# [END vision_v1p3beta1_generated_ProductSearch_GetProduct_sync] diff --git a/owl-bot-staging/google-cloud-vision-v1p3beta1/snippets/product_search/get_product_set.rb b/owl-bot-staging/google-cloud-vision-v1p3beta1/snippets/product_search/get_product_set.rb new file mode 100644 index 000000000000..d62d02cb2ff2 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision-v1p3beta1/snippets/product_search/get_product_set.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 vision_v1p3beta1_generated_ProductSearch_GetProductSet_sync] +require "google/cloud/vision/v1p3beta1" + +## +# Snippet for the get_product_set call in the ProductSearch 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::Vision::V1p3beta1::ProductSearch::Client#get_product_set. +# +def get_product_set + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Vision::V1p3beta1::ProductSearch::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Vision::V1p3beta1::GetProductSetRequest.new + + # Call the get_product_set method. + result = client.get_product_set request + + # The returned object is of type Google::Cloud::Vision::V1p3beta1::ProductSet. + p result +end +# [END vision_v1p3beta1_generated_ProductSearch_GetProductSet_sync] diff --git a/owl-bot-staging/google-cloud-vision-v1p3beta1/snippets/product_search/get_reference_image.rb b/owl-bot-staging/google-cloud-vision-v1p3beta1/snippets/product_search/get_reference_image.rb new file mode 100644 index 000000000000..8b5f078cbab2 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision-v1p3beta1/snippets/product_search/get_reference_image.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 vision_v1p3beta1_generated_ProductSearch_GetReferenceImage_sync] +require "google/cloud/vision/v1p3beta1" + +## +# Snippet for the get_reference_image call in the ProductSearch 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::Vision::V1p3beta1::ProductSearch::Client#get_reference_image. +# +def get_reference_image + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Vision::V1p3beta1::ProductSearch::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Vision::V1p3beta1::GetReferenceImageRequest.new + + # Call the get_reference_image method. + result = client.get_reference_image request + + # The returned object is of type Google::Cloud::Vision::V1p3beta1::ReferenceImage. + p result +end +# [END vision_v1p3beta1_generated_ProductSearch_GetReferenceImage_sync] diff --git a/owl-bot-staging/google-cloud-vision-v1p3beta1/snippets/product_search/import_product_sets.rb b/owl-bot-staging/google-cloud-vision-v1p3beta1/snippets/product_search/import_product_sets.rb new file mode 100644 index 000000000000..a17e856f8db6 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision-v1p3beta1/snippets/product_search/import_product_sets.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 vision_v1p3beta1_generated_ProductSearch_ImportProductSets_sync] +require "google/cloud/vision/v1p3beta1" + +## +# Snippet for the import_product_sets call in the ProductSearch 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::Vision::V1p3beta1::ProductSearch::Client#import_product_sets. +# +def import_product_sets + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Vision::V1p3beta1::ProductSearch::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Vision::V1p3beta1::ImportProductSetsRequest.new + + # Call the import_product_sets method. + result = client.import_product_sets 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 vision_v1p3beta1_generated_ProductSearch_ImportProductSets_sync] diff --git a/owl-bot-staging/google-cloud-vision-v1p3beta1/snippets/product_search/list_product_sets.rb b/owl-bot-staging/google-cloud-vision-v1p3beta1/snippets/product_search/list_product_sets.rb new file mode 100644 index 000000000000..07e3dc4caf09 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision-v1p3beta1/snippets/product_search/list_product_sets.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 vision_v1p3beta1_generated_ProductSearch_ListProductSets_sync] +require "google/cloud/vision/v1p3beta1" + +## +# Snippet for the list_product_sets call in the ProductSearch 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::Vision::V1p3beta1::ProductSearch::Client#list_product_sets. +# +def list_product_sets + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Vision::V1p3beta1::ProductSearch::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Vision::V1p3beta1::ListProductSetsRequest.new + + # Call the list_product_sets method. + result = client.list_product_sets 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::Vision::V1p3beta1::ProductSet. + p item + end +end +# [END vision_v1p3beta1_generated_ProductSearch_ListProductSets_sync] diff --git a/owl-bot-staging/google-cloud-vision-v1p3beta1/snippets/product_search/list_products.rb b/owl-bot-staging/google-cloud-vision-v1p3beta1/snippets/product_search/list_products.rb new file mode 100644 index 000000000000..99dca5f70254 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision-v1p3beta1/snippets/product_search/list_products.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 vision_v1p3beta1_generated_ProductSearch_ListProducts_sync] +require "google/cloud/vision/v1p3beta1" + +## +# Snippet for the list_products call in the ProductSearch 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::Vision::V1p3beta1::ProductSearch::Client#list_products. +# +def list_products + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Vision::V1p3beta1::ProductSearch::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Vision::V1p3beta1::ListProductsRequest.new + + # Call the list_products method. + result = client.list_products 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::Vision::V1p3beta1::Product. + p item + end +end +# [END vision_v1p3beta1_generated_ProductSearch_ListProducts_sync] diff --git a/owl-bot-staging/google-cloud-vision-v1p3beta1/snippets/product_search/list_products_in_product_set.rb b/owl-bot-staging/google-cloud-vision-v1p3beta1/snippets/product_search/list_products_in_product_set.rb new file mode 100644 index 000000000000..530fec8cb1d7 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision-v1p3beta1/snippets/product_search/list_products_in_product_set.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 vision_v1p3beta1_generated_ProductSearch_ListProductsInProductSet_sync] +require "google/cloud/vision/v1p3beta1" + +## +# Snippet for the list_products_in_product_set call in the ProductSearch 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::Vision::V1p3beta1::ProductSearch::Client#list_products_in_product_set. +# +def list_products_in_product_set + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Vision::V1p3beta1::ProductSearch::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Vision::V1p3beta1::ListProductsInProductSetRequest.new + + # Call the list_products_in_product_set method. + result = client.list_products_in_product_set 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::Vision::V1p3beta1::Product. + p item + end +end +# [END vision_v1p3beta1_generated_ProductSearch_ListProductsInProductSet_sync] diff --git a/owl-bot-staging/google-cloud-vision-v1p3beta1/snippets/product_search/list_reference_images.rb b/owl-bot-staging/google-cloud-vision-v1p3beta1/snippets/product_search/list_reference_images.rb new file mode 100644 index 000000000000..d0307e5133e8 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision-v1p3beta1/snippets/product_search/list_reference_images.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 vision_v1p3beta1_generated_ProductSearch_ListReferenceImages_sync] +require "google/cloud/vision/v1p3beta1" + +## +# Snippet for the list_reference_images call in the ProductSearch 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::Vision::V1p3beta1::ProductSearch::Client#list_reference_images. +# +def list_reference_images + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Vision::V1p3beta1::ProductSearch::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Vision::V1p3beta1::ListReferenceImagesRequest.new + + # Call the list_reference_images method. + result = client.list_reference_images 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::Vision::V1p3beta1::ReferenceImage. + p item + end +end +# [END vision_v1p3beta1_generated_ProductSearch_ListReferenceImages_sync] diff --git a/owl-bot-staging/google-cloud-vision-v1p3beta1/snippets/product_search/remove_product_from_product_set.rb b/owl-bot-staging/google-cloud-vision-v1p3beta1/snippets/product_search/remove_product_from_product_set.rb new file mode 100644 index 000000000000..e5748c283499 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision-v1p3beta1/snippets/product_search/remove_product_from_product_set.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 vision_v1p3beta1_generated_ProductSearch_RemoveProductFromProductSet_sync] +require "google/cloud/vision/v1p3beta1" + +## +# Snippet for the remove_product_from_product_set call in the ProductSearch 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::Vision::V1p3beta1::ProductSearch::Client#remove_product_from_product_set. +# +def remove_product_from_product_set + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Vision::V1p3beta1::ProductSearch::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Vision::V1p3beta1::RemoveProductFromProductSetRequest.new + + # Call the remove_product_from_product_set method. + result = client.remove_product_from_product_set request + + # The returned object is of type Google::Protobuf::Empty. + p result +end +# [END vision_v1p3beta1_generated_ProductSearch_RemoveProductFromProductSet_sync] diff --git a/owl-bot-staging/google-cloud-vision-v1p3beta1/snippets/product_search/update_product.rb b/owl-bot-staging/google-cloud-vision-v1p3beta1/snippets/product_search/update_product.rb new file mode 100644 index 000000000000..e1e3020720cd --- /dev/null +++ b/owl-bot-staging/google-cloud-vision-v1p3beta1/snippets/product_search/update_product.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 vision_v1p3beta1_generated_ProductSearch_UpdateProduct_sync] +require "google/cloud/vision/v1p3beta1" + +## +# Snippet for the update_product call in the ProductSearch 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::Vision::V1p3beta1::ProductSearch::Client#update_product. +# +def update_product + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Vision::V1p3beta1::ProductSearch::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Vision::V1p3beta1::UpdateProductRequest.new + + # Call the update_product method. + result = client.update_product request + + # The returned object is of type Google::Cloud::Vision::V1p3beta1::Product. + p result +end +# [END vision_v1p3beta1_generated_ProductSearch_UpdateProduct_sync] diff --git a/owl-bot-staging/google-cloud-vision-v1p3beta1/snippets/product_search/update_product_set.rb b/owl-bot-staging/google-cloud-vision-v1p3beta1/snippets/product_search/update_product_set.rb new file mode 100644 index 000000000000..ca7c016737e8 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision-v1p3beta1/snippets/product_search/update_product_set.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 vision_v1p3beta1_generated_ProductSearch_UpdateProductSet_sync] +require "google/cloud/vision/v1p3beta1" + +## +# Snippet for the update_product_set call in the ProductSearch 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::Vision::V1p3beta1::ProductSearch::Client#update_product_set. +# +def update_product_set + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Vision::V1p3beta1::ProductSearch::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Vision::V1p3beta1::UpdateProductSetRequest.new + + # Call the update_product_set method. + result = client.update_product_set request + + # The returned object is of type Google::Cloud::Vision::V1p3beta1::ProductSet. + p result +end +# [END vision_v1p3beta1_generated_ProductSearch_UpdateProductSet_sync] diff --git a/owl-bot-staging/google-cloud-vision-v1p3beta1/snippets/snippet_metadata_google.cloud.vision.v1p3beta1.json b/owl-bot-staging/google-cloud-vision-v1p3beta1/snippets/snippet_metadata_google.cloud.vision.v1p3beta1.json new file mode 100644 index 000000000000..3fe8aa600c9d --- /dev/null +++ b/owl-bot-staging/google-cloud-vision-v1p3beta1/snippets/snippet_metadata_google.cloud.vision.v1p3beta1.json @@ -0,0 +1,815 @@ +{ + "client_library": { + "name": "google-cloud-vision-v1p3beta1", + "version": "", + "language": "RUBY", + "apis": [ + { + "id": "google.cloud.vision.v1p3beta1", + "version": "v1p3beta1" + } + ] + }, + "snippets": [ + { + "region_tag": "vision_v1p3beta1_generated_ProductSearch_CreateProductSet_sync", + "title": "Snippet for the create_product_set call in the ProductSearch service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Vision::V1p3beta1::ProductSearch::Client#create_product_set.", + "file": "product_search/create_product_set.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_product_set", + "full_name": "::Google::Cloud::Vision::V1p3beta1::ProductSearch::Client#create_product_set", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Vision::V1p3beta1::CreateProductSetRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Vision::V1p3beta1::ProductSet", + "client": { + "short_name": "ProductSearch::Client", + "full_name": "::Google::Cloud::Vision::V1p3beta1::ProductSearch::Client" + }, + "method": { + "short_name": "CreateProductSet", + "full_name": "google.cloud.vision.v1p3beta1.ProductSearch.CreateProductSet", + "service": { + "short_name": "ProductSearch", + "full_name": "google.cloud.vision.v1p3beta1.ProductSearch" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "vision_v1p3beta1_generated_ProductSearch_ListProductSets_sync", + "title": "Snippet for the list_product_sets call in the ProductSearch service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Vision::V1p3beta1::ProductSearch::Client#list_product_sets.", + "file": "product_search/list_product_sets.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_product_sets", + "full_name": "::Google::Cloud::Vision::V1p3beta1::ProductSearch::Client#list_product_sets", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Vision::V1p3beta1::ListProductSetsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Vision::V1p3beta1::ListProductSetsResponse", + "client": { + "short_name": "ProductSearch::Client", + "full_name": "::Google::Cloud::Vision::V1p3beta1::ProductSearch::Client" + }, + "method": { + "short_name": "ListProductSets", + "full_name": "google.cloud.vision.v1p3beta1.ProductSearch.ListProductSets", + "service": { + "short_name": "ProductSearch", + "full_name": "google.cloud.vision.v1p3beta1.ProductSearch" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "vision_v1p3beta1_generated_ProductSearch_GetProductSet_sync", + "title": "Snippet for the get_product_set call in the ProductSearch service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Vision::V1p3beta1::ProductSearch::Client#get_product_set.", + "file": "product_search/get_product_set.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_product_set", + "full_name": "::Google::Cloud::Vision::V1p3beta1::ProductSearch::Client#get_product_set", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Vision::V1p3beta1::GetProductSetRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Vision::V1p3beta1::ProductSet", + "client": { + "short_name": "ProductSearch::Client", + "full_name": "::Google::Cloud::Vision::V1p3beta1::ProductSearch::Client" + }, + "method": { + "short_name": "GetProductSet", + "full_name": "google.cloud.vision.v1p3beta1.ProductSearch.GetProductSet", + "service": { + "short_name": "ProductSearch", + "full_name": "google.cloud.vision.v1p3beta1.ProductSearch" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "vision_v1p3beta1_generated_ProductSearch_UpdateProductSet_sync", + "title": "Snippet for the update_product_set call in the ProductSearch service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Vision::V1p3beta1::ProductSearch::Client#update_product_set.", + "file": "product_search/update_product_set.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_product_set", + "full_name": "::Google::Cloud::Vision::V1p3beta1::ProductSearch::Client#update_product_set", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Vision::V1p3beta1::UpdateProductSetRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Vision::V1p3beta1::ProductSet", + "client": { + "short_name": "ProductSearch::Client", + "full_name": "::Google::Cloud::Vision::V1p3beta1::ProductSearch::Client" + }, + "method": { + "short_name": "UpdateProductSet", + "full_name": "google.cloud.vision.v1p3beta1.ProductSearch.UpdateProductSet", + "service": { + "short_name": "ProductSearch", + "full_name": "google.cloud.vision.v1p3beta1.ProductSearch" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "vision_v1p3beta1_generated_ProductSearch_DeleteProductSet_sync", + "title": "Snippet for the delete_product_set call in the ProductSearch service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Vision::V1p3beta1::ProductSearch::Client#delete_product_set.", + "file": "product_search/delete_product_set.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_product_set", + "full_name": "::Google::Cloud::Vision::V1p3beta1::ProductSearch::Client#delete_product_set", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Vision::V1p3beta1::DeleteProductSetRequest", + "name": "request" + } + ], + "result_type": "::Google::Protobuf::Empty", + "client": { + "short_name": "ProductSearch::Client", + "full_name": "::Google::Cloud::Vision::V1p3beta1::ProductSearch::Client" + }, + "method": { + "short_name": "DeleteProductSet", + "full_name": "google.cloud.vision.v1p3beta1.ProductSearch.DeleteProductSet", + "service": { + "short_name": "ProductSearch", + "full_name": "google.cloud.vision.v1p3beta1.ProductSearch" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "vision_v1p3beta1_generated_ProductSearch_CreateProduct_sync", + "title": "Snippet for the create_product call in the ProductSearch service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Vision::V1p3beta1::ProductSearch::Client#create_product.", + "file": "product_search/create_product.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_product", + "full_name": "::Google::Cloud::Vision::V1p3beta1::ProductSearch::Client#create_product", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Vision::V1p3beta1::CreateProductRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Vision::V1p3beta1::Product", + "client": { + "short_name": "ProductSearch::Client", + "full_name": "::Google::Cloud::Vision::V1p3beta1::ProductSearch::Client" + }, + "method": { + "short_name": "CreateProduct", + "full_name": "google.cloud.vision.v1p3beta1.ProductSearch.CreateProduct", + "service": { + "short_name": "ProductSearch", + "full_name": "google.cloud.vision.v1p3beta1.ProductSearch" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "vision_v1p3beta1_generated_ProductSearch_ListProducts_sync", + "title": "Snippet for the list_products call in the ProductSearch service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Vision::V1p3beta1::ProductSearch::Client#list_products.", + "file": "product_search/list_products.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_products", + "full_name": "::Google::Cloud::Vision::V1p3beta1::ProductSearch::Client#list_products", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Vision::V1p3beta1::ListProductsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Vision::V1p3beta1::ListProductsResponse", + "client": { + "short_name": "ProductSearch::Client", + "full_name": "::Google::Cloud::Vision::V1p3beta1::ProductSearch::Client" + }, + "method": { + "short_name": "ListProducts", + "full_name": "google.cloud.vision.v1p3beta1.ProductSearch.ListProducts", + "service": { + "short_name": "ProductSearch", + "full_name": "google.cloud.vision.v1p3beta1.ProductSearch" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "vision_v1p3beta1_generated_ProductSearch_GetProduct_sync", + "title": "Snippet for the get_product call in the ProductSearch service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Vision::V1p3beta1::ProductSearch::Client#get_product.", + "file": "product_search/get_product.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_product", + "full_name": "::Google::Cloud::Vision::V1p3beta1::ProductSearch::Client#get_product", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Vision::V1p3beta1::GetProductRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Vision::V1p3beta1::Product", + "client": { + "short_name": "ProductSearch::Client", + "full_name": "::Google::Cloud::Vision::V1p3beta1::ProductSearch::Client" + }, + "method": { + "short_name": "GetProduct", + "full_name": "google.cloud.vision.v1p3beta1.ProductSearch.GetProduct", + "service": { + "short_name": "ProductSearch", + "full_name": "google.cloud.vision.v1p3beta1.ProductSearch" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "vision_v1p3beta1_generated_ProductSearch_UpdateProduct_sync", + "title": "Snippet for the update_product call in the ProductSearch service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Vision::V1p3beta1::ProductSearch::Client#update_product.", + "file": "product_search/update_product.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_product", + "full_name": "::Google::Cloud::Vision::V1p3beta1::ProductSearch::Client#update_product", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Vision::V1p3beta1::UpdateProductRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Vision::V1p3beta1::Product", + "client": { + "short_name": "ProductSearch::Client", + "full_name": "::Google::Cloud::Vision::V1p3beta1::ProductSearch::Client" + }, + "method": { + "short_name": "UpdateProduct", + "full_name": "google.cloud.vision.v1p3beta1.ProductSearch.UpdateProduct", + "service": { + "short_name": "ProductSearch", + "full_name": "google.cloud.vision.v1p3beta1.ProductSearch" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "vision_v1p3beta1_generated_ProductSearch_DeleteProduct_sync", + "title": "Snippet for the delete_product call in the ProductSearch service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Vision::V1p3beta1::ProductSearch::Client#delete_product.", + "file": "product_search/delete_product.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_product", + "full_name": "::Google::Cloud::Vision::V1p3beta1::ProductSearch::Client#delete_product", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Vision::V1p3beta1::DeleteProductRequest", + "name": "request" + } + ], + "result_type": "::Google::Protobuf::Empty", + "client": { + "short_name": "ProductSearch::Client", + "full_name": "::Google::Cloud::Vision::V1p3beta1::ProductSearch::Client" + }, + "method": { + "short_name": "DeleteProduct", + "full_name": "google.cloud.vision.v1p3beta1.ProductSearch.DeleteProduct", + "service": { + "short_name": "ProductSearch", + "full_name": "google.cloud.vision.v1p3beta1.ProductSearch" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "vision_v1p3beta1_generated_ProductSearch_CreateReferenceImage_sync", + "title": "Snippet for the create_reference_image call in the ProductSearch service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Vision::V1p3beta1::ProductSearch::Client#create_reference_image.", + "file": "product_search/create_reference_image.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_reference_image", + "full_name": "::Google::Cloud::Vision::V1p3beta1::ProductSearch::Client#create_reference_image", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Vision::V1p3beta1::CreateReferenceImageRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Vision::V1p3beta1::ReferenceImage", + "client": { + "short_name": "ProductSearch::Client", + "full_name": "::Google::Cloud::Vision::V1p3beta1::ProductSearch::Client" + }, + "method": { + "short_name": "CreateReferenceImage", + "full_name": "google.cloud.vision.v1p3beta1.ProductSearch.CreateReferenceImage", + "service": { + "short_name": "ProductSearch", + "full_name": "google.cloud.vision.v1p3beta1.ProductSearch" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "vision_v1p3beta1_generated_ProductSearch_DeleteReferenceImage_sync", + "title": "Snippet for the delete_reference_image call in the ProductSearch service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Vision::V1p3beta1::ProductSearch::Client#delete_reference_image.", + "file": "product_search/delete_reference_image.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_reference_image", + "full_name": "::Google::Cloud::Vision::V1p3beta1::ProductSearch::Client#delete_reference_image", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Vision::V1p3beta1::DeleteReferenceImageRequest", + "name": "request" + } + ], + "result_type": "::Google::Protobuf::Empty", + "client": { + "short_name": "ProductSearch::Client", + "full_name": "::Google::Cloud::Vision::V1p3beta1::ProductSearch::Client" + }, + "method": { + "short_name": "DeleteReferenceImage", + "full_name": "google.cloud.vision.v1p3beta1.ProductSearch.DeleteReferenceImage", + "service": { + "short_name": "ProductSearch", + "full_name": "google.cloud.vision.v1p3beta1.ProductSearch" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "vision_v1p3beta1_generated_ProductSearch_ListReferenceImages_sync", + "title": "Snippet for the list_reference_images call in the ProductSearch service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Vision::V1p3beta1::ProductSearch::Client#list_reference_images.", + "file": "product_search/list_reference_images.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_reference_images", + "full_name": "::Google::Cloud::Vision::V1p3beta1::ProductSearch::Client#list_reference_images", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Vision::V1p3beta1::ListReferenceImagesRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Vision::V1p3beta1::ListReferenceImagesResponse", + "client": { + "short_name": "ProductSearch::Client", + "full_name": "::Google::Cloud::Vision::V1p3beta1::ProductSearch::Client" + }, + "method": { + "short_name": "ListReferenceImages", + "full_name": "google.cloud.vision.v1p3beta1.ProductSearch.ListReferenceImages", + "service": { + "short_name": "ProductSearch", + "full_name": "google.cloud.vision.v1p3beta1.ProductSearch" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "vision_v1p3beta1_generated_ProductSearch_GetReferenceImage_sync", + "title": "Snippet for the get_reference_image call in the ProductSearch service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Vision::V1p3beta1::ProductSearch::Client#get_reference_image.", + "file": "product_search/get_reference_image.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_reference_image", + "full_name": "::Google::Cloud::Vision::V1p3beta1::ProductSearch::Client#get_reference_image", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Vision::V1p3beta1::GetReferenceImageRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Vision::V1p3beta1::ReferenceImage", + "client": { + "short_name": "ProductSearch::Client", + "full_name": "::Google::Cloud::Vision::V1p3beta1::ProductSearch::Client" + }, + "method": { + "short_name": "GetReferenceImage", + "full_name": "google.cloud.vision.v1p3beta1.ProductSearch.GetReferenceImage", + "service": { + "short_name": "ProductSearch", + "full_name": "google.cloud.vision.v1p3beta1.ProductSearch" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "vision_v1p3beta1_generated_ProductSearch_AddProductToProductSet_sync", + "title": "Snippet for the add_product_to_product_set call in the ProductSearch service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Vision::V1p3beta1::ProductSearch::Client#add_product_to_product_set.", + "file": "product_search/add_product_to_product_set.rb", + "language": "RUBY", + "client_method": { + "short_name": "add_product_to_product_set", + "full_name": "::Google::Cloud::Vision::V1p3beta1::ProductSearch::Client#add_product_to_product_set", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Vision::V1p3beta1::AddProductToProductSetRequest", + "name": "request" + } + ], + "result_type": "::Google::Protobuf::Empty", + "client": { + "short_name": "ProductSearch::Client", + "full_name": "::Google::Cloud::Vision::V1p3beta1::ProductSearch::Client" + }, + "method": { + "short_name": "AddProductToProductSet", + "full_name": "google.cloud.vision.v1p3beta1.ProductSearch.AddProductToProductSet", + "service": { + "short_name": "ProductSearch", + "full_name": "google.cloud.vision.v1p3beta1.ProductSearch" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "vision_v1p3beta1_generated_ProductSearch_RemoveProductFromProductSet_sync", + "title": "Snippet for the remove_product_from_product_set call in the ProductSearch service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Vision::V1p3beta1::ProductSearch::Client#remove_product_from_product_set.", + "file": "product_search/remove_product_from_product_set.rb", + "language": "RUBY", + "client_method": { + "short_name": "remove_product_from_product_set", + "full_name": "::Google::Cloud::Vision::V1p3beta1::ProductSearch::Client#remove_product_from_product_set", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Vision::V1p3beta1::RemoveProductFromProductSetRequest", + "name": "request" + } + ], + "result_type": "::Google::Protobuf::Empty", + "client": { + "short_name": "ProductSearch::Client", + "full_name": "::Google::Cloud::Vision::V1p3beta1::ProductSearch::Client" + }, + "method": { + "short_name": "RemoveProductFromProductSet", + "full_name": "google.cloud.vision.v1p3beta1.ProductSearch.RemoveProductFromProductSet", + "service": { + "short_name": "ProductSearch", + "full_name": "google.cloud.vision.v1p3beta1.ProductSearch" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "vision_v1p3beta1_generated_ProductSearch_ListProductsInProductSet_sync", + "title": "Snippet for the list_products_in_product_set call in the ProductSearch service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Vision::V1p3beta1::ProductSearch::Client#list_products_in_product_set.", + "file": "product_search/list_products_in_product_set.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_products_in_product_set", + "full_name": "::Google::Cloud::Vision::V1p3beta1::ProductSearch::Client#list_products_in_product_set", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Vision::V1p3beta1::ListProductsInProductSetRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Vision::V1p3beta1::ListProductsInProductSetResponse", + "client": { + "short_name": "ProductSearch::Client", + "full_name": "::Google::Cloud::Vision::V1p3beta1::ProductSearch::Client" + }, + "method": { + "short_name": "ListProductsInProductSet", + "full_name": "google.cloud.vision.v1p3beta1.ProductSearch.ListProductsInProductSet", + "service": { + "short_name": "ProductSearch", + "full_name": "google.cloud.vision.v1p3beta1.ProductSearch" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "vision_v1p3beta1_generated_ProductSearch_ImportProductSets_sync", + "title": "Snippet for the import_product_sets call in the ProductSearch service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Vision::V1p3beta1::ProductSearch::Client#import_product_sets.", + "file": "product_search/import_product_sets.rb", + "language": "RUBY", + "client_method": { + "short_name": "import_product_sets", + "full_name": "::Google::Cloud::Vision::V1p3beta1::ProductSearch::Client#import_product_sets", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Vision::V1p3beta1::ImportProductSetsRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "ProductSearch::Client", + "full_name": "::Google::Cloud::Vision::V1p3beta1::ProductSearch::Client" + }, + "method": { + "short_name": "ImportProductSets", + "full_name": "google.cloud.vision.v1p3beta1.ProductSearch.ImportProductSets", + "service": { + "short_name": "ProductSearch", + "full_name": "google.cloud.vision.v1p3beta1.ProductSearch" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "vision_v1p3beta1_generated_ImageAnnotator_BatchAnnotateImages_sync", + "title": "Snippet for the batch_annotate_images call in the ImageAnnotator service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Vision::V1p3beta1::ImageAnnotator::Client#batch_annotate_images.", + "file": "image_annotator/batch_annotate_images.rb", + "language": "RUBY", + "client_method": { + "short_name": "batch_annotate_images", + "full_name": "::Google::Cloud::Vision::V1p3beta1::ImageAnnotator::Client#batch_annotate_images", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Vision::V1p3beta1::BatchAnnotateImagesRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Vision::V1p3beta1::BatchAnnotateImagesResponse", + "client": { + "short_name": "ImageAnnotator::Client", + "full_name": "::Google::Cloud::Vision::V1p3beta1::ImageAnnotator::Client" + }, + "method": { + "short_name": "BatchAnnotateImages", + "full_name": "google.cloud.vision.v1p3beta1.ImageAnnotator.BatchAnnotateImages", + "service": { + "short_name": "ImageAnnotator", + "full_name": "google.cloud.vision.v1p3beta1.ImageAnnotator" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "vision_v1p3beta1_generated_ImageAnnotator_AsyncBatchAnnotateFiles_sync", + "title": "Snippet for the async_batch_annotate_files call in the ImageAnnotator service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Vision::V1p3beta1::ImageAnnotator::Client#async_batch_annotate_files.", + "file": "image_annotator/async_batch_annotate_files.rb", + "language": "RUBY", + "client_method": { + "short_name": "async_batch_annotate_files", + "full_name": "::Google::Cloud::Vision::V1p3beta1::ImageAnnotator::Client#async_batch_annotate_files", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Vision::V1p3beta1::AsyncBatchAnnotateFilesRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "ImageAnnotator::Client", + "full_name": "::Google::Cloud::Vision::V1p3beta1::ImageAnnotator::Client" + }, + "method": { + "short_name": "AsyncBatchAnnotateFiles", + "full_name": "google.cloud.vision.v1p3beta1.ImageAnnotator.AsyncBatchAnnotateFiles", + "service": { + "short_name": "ImageAnnotator", + "full_name": "google.cloud.vision.v1p3beta1.ImageAnnotator" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + } + ] +} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-vision-v1p3beta1/test/google/cloud/vision/v1p3beta1/image_annotator_operations_test.rb b/owl-bot-staging/google-cloud-vision-v1p3beta1/test/google/cloud/vision/v1p3beta1/image_annotator_operations_test.rb new file mode 100644 index 000000000000..f0952f2bdc85 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision-v1p3beta1/test/google/cloud/vision/v1p3beta1/image_annotator_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/vision/v1p3beta1/image_annotator_pb" +require "google/cloud/vision/v1p3beta1/image_annotator_services_pb" +require "google/cloud/vision/v1p3beta1/image_annotator" + +class ::Google::Cloud::Vision::V1p3beta1::ImageAnnotator::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::Vision::V1p3beta1::ImageAnnotator::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::Vision::V1p3beta1::ImageAnnotator::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::Vision::V1p3beta1::ImageAnnotator::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::Vision::V1p3beta1::ImageAnnotator::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::Vision::V1p3beta1::ImageAnnotator::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::Vision::V1p3beta1::ImageAnnotator::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::Vision::V1p3beta1::ImageAnnotator::Operations::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-vision-v1p3beta1/test/google/cloud/vision/v1p3beta1/image_annotator_paths_test.rb b/owl-bot-staging/google-cloud-vision-v1p3beta1/test/google/cloud/vision/v1p3beta1/image_annotator_paths_test.rb new file mode 100644 index 000000000000..d1b56b68f316 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision-v1p3beta1/test/google/cloud/vision/v1p3beta1/image_annotator_paths_test.rb @@ -0,0 +1,55 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/vision/v1p3beta1/image_annotator" + +class ::Google::Cloud::Vision::V1p3beta1::ImageAnnotator::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_product_set_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Vision::V1p3beta1::ImageAnnotator::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.product_set_path project: "value0", location: "value1", product_set: "value2" + assert_equal "projects/value0/locations/value1/productSets/value2", path + end + end +end diff --git a/owl-bot-staging/google-cloud-vision-v1p3beta1/test/google/cloud/vision/v1p3beta1/image_annotator_rest_test.rb b/owl-bot-staging/google-cloud-vision-v1p3beta1/test/google/cloud/vision/v1p3beta1/image_annotator_rest_test.rb new file mode 100644 index 000000000000..b3a646a63442 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision-v1p3beta1/test/google/cloud/vision/v1p3beta1/image_annotator_rest_test.rb @@ -0,0 +1,207 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/vision/v1p3beta1/image_annotator_pb" +require "google/cloud/vision/v1p3beta1/image_annotator/rest" + + +class ::Google::Cloud::Vision::V1p3beta1::ImageAnnotator::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_batch_annotate_images + # Create test objects. + client_result = ::Google::Cloud::Vision::V1p3beta1::BatchAnnotateImagesResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + requests = [{}] + + batch_annotate_images_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::Vision::V1p3beta1::ImageAnnotator::Rest::ServiceStub.stub :transcode_batch_annotate_images_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, batch_annotate_images_client_stub do + # Create client + client = ::Google::Cloud::Vision::V1p3beta1::ImageAnnotator::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.batch_annotate_images({ requests: requests }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.batch_annotate_images requests: requests do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.batch_annotate_images ::Google::Cloud::Vision::V1p3beta1::BatchAnnotateImagesRequest.new(requests: requests) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.batch_annotate_images({ requests: requests }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.batch_annotate_images(::Google::Cloud::Vision::V1p3beta1::BatchAnnotateImagesRequest.new(requests: requests), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, batch_annotate_images_client_stub.call_count + end + end + end + + def test_async_batch_annotate_files + # 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. + requests = [{}] + + async_batch_annotate_files_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::Vision::V1p3beta1::ImageAnnotator::Rest::ServiceStub.stub :transcode_async_batch_annotate_files_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, async_batch_annotate_files_client_stub do + # Create client + client = ::Google::Cloud::Vision::V1p3beta1::ImageAnnotator::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.async_batch_annotate_files({ requests: requests }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.async_batch_annotate_files requests: requests do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.async_batch_annotate_files ::Google::Cloud::Vision::V1p3beta1::AsyncBatchAnnotateFilesRequest.new(requests: requests) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.async_batch_annotate_files({ requests: requests }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.async_batch_annotate_files(::Google::Cloud::Vision::V1p3beta1::AsyncBatchAnnotateFilesRequest.new(requests: requests), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, async_batch_annotate_files_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::Vision::V1p3beta1::ImageAnnotator::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::Vision::V1p3beta1::ImageAnnotator::Rest::Client::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-vision-v1p3beta1/test/google/cloud/vision/v1p3beta1/image_annotator_test.rb b/owl-bot-staging/google-cloud-vision-v1p3beta1/test/google/cloud/vision/v1p3beta1/image_annotator_test.rb new file mode 100644 index 000000000000..dec04f8ba62f --- /dev/null +++ b/owl-bot-staging/google-cloud-vision-v1p3beta1/test/google/cloud/vision/v1p3beta1/image_annotator_test.rb @@ -0,0 +1,239 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/vision/v1p3beta1/image_annotator_pb" +require "google/cloud/vision/v1p3beta1/image_annotator" + +class ::Google::Cloud::Vision::V1p3beta1::ImageAnnotator::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_batch_annotate_images + # Create GRPC objects. + grpc_response = ::Google::Cloud::Vision::V1p3beta1::BatchAnnotateImagesResponse.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. + requests = [{}] + + batch_annotate_images_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :batch_annotate_images, name + assert_kind_of ::Google::Cloud::Vision::V1p3beta1::BatchAnnotateImagesRequest, request + assert_kind_of ::Google::Cloud::Vision::V1p3beta1::AnnotateImageRequest, request["requests"].first + refute_nil options + end + + Gapic::ServiceStub.stub :new, batch_annotate_images_client_stub do + # Create client + client = ::Google::Cloud::Vision::V1p3beta1::ImageAnnotator::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.batch_annotate_images({ requests: requests }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.batch_annotate_images requests: requests do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.batch_annotate_images ::Google::Cloud::Vision::V1p3beta1::BatchAnnotateImagesRequest.new(requests: requests) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.batch_annotate_images({ requests: requests }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.batch_annotate_images(::Google::Cloud::Vision::V1p3beta1::BatchAnnotateImagesRequest.new(requests: requests), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, batch_annotate_images_client_stub.call_rpc_count + end + end + + def test_async_batch_annotate_files + # 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. + requests = [{}] + + async_batch_annotate_files_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :async_batch_annotate_files, name + assert_kind_of ::Google::Cloud::Vision::V1p3beta1::AsyncBatchAnnotateFilesRequest, request + assert_kind_of ::Google::Cloud::Vision::V1p3beta1::AsyncAnnotateFileRequest, request["requests"].first + refute_nil options + end + + Gapic::ServiceStub.stub :new, async_batch_annotate_files_client_stub do + # Create client + client = ::Google::Cloud::Vision::V1p3beta1::ImageAnnotator::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.async_batch_annotate_files({ requests: requests }) 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.async_batch_annotate_files requests: requests 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.async_batch_annotate_files ::Google::Cloud::Vision::V1p3beta1::AsyncBatchAnnotateFilesRequest.new(requests: requests) 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.async_batch_annotate_files({ requests: requests }, 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.async_batch_annotate_files(::Google::Cloud::Vision::V1p3beta1::AsyncBatchAnnotateFilesRequest.new(requests: requests), 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, async_batch_annotate_files_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::Vision::V1p3beta1::ImageAnnotator::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::Vision::V1p3beta1::ImageAnnotator::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::Vision::V1p3beta1::ImageAnnotator::Client.new do |config| + config.credentials = creds + end + assert_kind_of ::Google::Cloud::Vision::V1p3beta1::ImageAnnotator::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::Vision::V1p3beta1::ImageAnnotator::Client.new do |config| + config.credentials = grpc_channel + end + end + + assert_kind_of ::Google::Cloud::Vision::V1p3beta1::ImageAnnotator::Operations, client.operations_client + end +end diff --git a/owl-bot-staging/google-cloud-vision-v1p3beta1/test/google/cloud/vision/v1p3beta1/product_search_operations_test.rb b/owl-bot-staging/google-cloud-vision-v1p3beta1/test/google/cloud/vision/v1p3beta1/product_search_operations_test.rb new file mode 100644 index 000000000000..5b77b03de60a --- /dev/null +++ b/owl-bot-staging/google-cloud-vision-v1p3beta1/test/google/cloud/vision/v1p3beta1/product_search_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/vision/v1p3beta1/product_search_service_pb" +require "google/cloud/vision/v1p3beta1/product_search_service_services_pb" +require "google/cloud/vision/v1p3beta1/product_search" + +class ::Google::Cloud::Vision::V1p3beta1::ProductSearch::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::Vision::V1p3beta1::ProductSearch::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::Vision::V1p3beta1::ProductSearch::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::Vision::V1p3beta1::ProductSearch::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::Vision::V1p3beta1::ProductSearch::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::Vision::V1p3beta1::ProductSearch::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::Vision::V1p3beta1::ProductSearch::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::Vision::V1p3beta1::ProductSearch::Operations::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-vision-v1p3beta1/test/google/cloud/vision/v1p3beta1/product_search_paths_test.rb b/owl-bot-staging/google-cloud-vision-v1p3beta1/test/google/cloud/vision/v1p3beta1/product_search_paths_test.rb new file mode 100644 index 000000000000..bb6638c5da76 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision-v1p3beta1/test/google/cloud/vision/v1p3beta1/product_search_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/vision/v1p3beta1/product_search" + +class ::Google::Cloud::Vision::V1p3beta1::ProductSearch::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::Vision::V1p3beta1::ProductSearch::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_product_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Vision::V1p3beta1::ProductSearch::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.product_path project: "value0", location: "value1", product: "value2" + assert_equal "projects/value0/locations/value1/products/value2", path + end + end + + def test_product_set_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Vision::V1p3beta1::ProductSearch::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.product_set_path project: "value0", location: "value1", product_set: "value2" + assert_equal "projects/value0/locations/value1/productSets/value2", path + end + end + + def test_reference_image_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Vision::V1p3beta1::ProductSearch::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.reference_image_path project: "value0", location: "value1", product: "value2", reference_image: "value3" + assert_equal "projects/value0/locations/value1/products/value2/referenceImages/value3", path + end + end +end diff --git a/owl-bot-staging/google-cloud-vision-v1p3beta1/test/google/cloud/vision/v1p3beta1/product_search_rest_test.rb b/owl-bot-staging/google-cloud-vision-v1p3beta1/test/google/cloud/vision/v1p3beta1/product_search_rest_test.rb new file mode 100644 index 000000000000..219d39df70f9 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision-v1p3beta1/test/google/cloud/vision/v1p3beta1/product_search_rest_test.rb @@ -0,0 +1,1090 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/vision/v1p3beta1/product_search_service_pb" +require "google/cloud/vision/v1p3beta1/product_search/rest" + + +class ::Google::Cloud::Vision::V1p3beta1::ProductSearch::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_product_set + # Create test objects. + client_result = ::Google::Cloud::Vision::V1p3beta1::ProductSet.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + product_set = {} + product_set_id = "hello world" + + create_product_set_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::Vision::V1p3beta1::ProductSearch::Rest::ServiceStub.stub :transcode_create_product_set_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_product_set_client_stub do + # Create client + client = ::Google::Cloud::Vision::V1p3beta1::ProductSearch::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_product_set({ parent: parent, product_set: product_set, product_set_id: product_set_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_product_set parent: parent, product_set: product_set, product_set_id: product_set_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_product_set ::Google::Cloud::Vision::V1p3beta1::CreateProductSetRequest.new(parent: parent, product_set: product_set, product_set_id: product_set_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_product_set({ parent: parent, product_set: product_set, product_set_id: product_set_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_product_set(::Google::Cloud::Vision::V1p3beta1::CreateProductSetRequest.new(parent: parent, product_set: product_set, product_set_id: product_set_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_product_set_client_stub.call_count + end + end + end + + def test_list_product_sets + # Create test objects. + client_result = ::Google::Cloud::Vision::V1p3beta1::ListProductSetsResponse.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_product_sets_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::Vision::V1p3beta1::ProductSearch::Rest::ServiceStub.stub :transcode_list_product_sets_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_product_sets_client_stub do + # Create client + client = ::Google::Cloud::Vision::V1p3beta1::ProductSearch::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_product_sets({ 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_product_sets 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_product_sets ::Google::Cloud::Vision::V1p3beta1::ListProductSetsRequest.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_product_sets({ 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_product_sets(::Google::Cloud::Vision::V1p3beta1::ListProductSetsRequest.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_product_sets_client_stub.call_count + end + end + end + + def test_get_product_set + # Create test objects. + client_result = ::Google::Cloud::Vision::V1p3beta1::ProductSet.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_product_set_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::Vision::V1p3beta1::ProductSearch::Rest::ServiceStub.stub :transcode_get_product_set_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_product_set_client_stub do + # Create client + client = ::Google::Cloud::Vision::V1p3beta1::ProductSearch::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_product_set({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_product_set name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_product_set ::Google::Cloud::Vision::V1p3beta1::GetProductSetRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_product_set({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_product_set(::Google::Cloud::Vision::V1p3beta1::GetProductSetRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_product_set_client_stub.call_count + end + end + end + + def test_update_product_set + # Create test objects. + client_result = ::Google::Cloud::Vision::V1p3beta1::ProductSet.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + product_set = {} + update_mask = {} + + update_product_set_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::Vision::V1p3beta1::ProductSearch::Rest::ServiceStub.stub :transcode_update_product_set_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_product_set_client_stub do + # Create client + client = ::Google::Cloud::Vision::V1p3beta1::ProductSearch::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_product_set({ product_set: product_set, update_mask: update_mask }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_product_set product_set: product_set, update_mask: update_mask do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_product_set ::Google::Cloud::Vision::V1p3beta1::UpdateProductSetRequest.new(product_set: product_set, update_mask: update_mask) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_product_set({ product_set: product_set, update_mask: update_mask }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_product_set(::Google::Cloud::Vision::V1p3beta1::UpdateProductSetRequest.new(product_set: product_set, update_mask: update_mask), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_product_set_client_stub.call_count + end + end + end + + def test_delete_product_set + # 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_product_set_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::Vision::V1p3beta1::ProductSearch::Rest::ServiceStub.stub :transcode_delete_product_set_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_product_set_client_stub do + # Create client + client = ::Google::Cloud::Vision::V1p3beta1::ProductSearch::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_product_set({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_product_set name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_product_set ::Google::Cloud::Vision::V1p3beta1::DeleteProductSetRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_product_set({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_product_set(::Google::Cloud::Vision::V1p3beta1::DeleteProductSetRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_product_set_client_stub.call_count + end + end + end + + def test_create_product + # Create test objects. + client_result = ::Google::Cloud::Vision::V1p3beta1::Product.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + product = {} + product_id = "hello world" + + create_product_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::Vision::V1p3beta1::ProductSearch::Rest::ServiceStub.stub :transcode_create_product_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_product_client_stub do + # Create client + client = ::Google::Cloud::Vision::V1p3beta1::ProductSearch::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_product({ parent: parent, product: product, product_id: product_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_product parent: parent, product: product, product_id: product_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_product ::Google::Cloud::Vision::V1p3beta1::CreateProductRequest.new(parent: parent, product: product, product_id: product_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_product({ parent: parent, product: product, product_id: product_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_product(::Google::Cloud::Vision::V1p3beta1::CreateProductRequest.new(parent: parent, product: product, product_id: product_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_product_client_stub.call_count + end + end + end + + def test_list_products + # Create test objects. + client_result = ::Google::Cloud::Vision::V1p3beta1::ListProductsResponse.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_products_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::Vision::V1p3beta1::ProductSearch::Rest::ServiceStub.stub :transcode_list_products_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_products_client_stub do + # Create client + client = ::Google::Cloud::Vision::V1p3beta1::ProductSearch::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_products({ 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_products 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_products ::Google::Cloud::Vision::V1p3beta1::ListProductsRequest.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_products({ 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_products(::Google::Cloud::Vision::V1p3beta1::ListProductsRequest.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_products_client_stub.call_count + end + end + end + + def test_get_product + # Create test objects. + client_result = ::Google::Cloud::Vision::V1p3beta1::Product.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_product_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::Vision::V1p3beta1::ProductSearch::Rest::ServiceStub.stub :transcode_get_product_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_product_client_stub do + # Create client + client = ::Google::Cloud::Vision::V1p3beta1::ProductSearch::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_product({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_product name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_product ::Google::Cloud::Vision::V1p3beta1::GetProductRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_product({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_product(::Google::Cloud::Vision::V1p3beta1::GetProductRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_product_client_stub.call_count + end + end + end + + def test_update_product + # Create test objects. + client_result = ::Google::Cloud::Vision::V1p3beta1::Product.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + product = {} + update_mask = {} + + update_product_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::Vision::V1p3beta1::ProductSearch::Rest::ServiceStub.stub :transcode_update_product_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_product_client_stub do + # Create client + client = ::Google::Cloud::Vision::V1p3beta1::ProductSearch::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_product({ product: product, update_mask: update_mask }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_product product: product, update_mask: update_mask do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_product ::Google::Cloud::Vision::V1p3beta1::UpdateProductRequest.new(product: product, update_mask: update_mask) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_product({ product: product, update_mask: update_mask }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_product(::Google::Cloud::Vision::V1p3beta1::UpdateProductRequest.new(product: product, update_mask: update_mask), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_product_client_stub.call_count + end + end + end + + def test_delete_product + # 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_product_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::Vision::V1p3beta1::ProductSearch::Rest::ServiceStub.stub :transcode_delete_product_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_product_client_stub do + # Create client + client = ::Google::Cloud::Vision::V1p3beta1::ProductSearch::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_product({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_product name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_product ::Google::Cloud::Vision::V1p3beta1::DeleteProductRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_product({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_product(::Google::Cloud::Vision::V1p3beta1::DeleteProductRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_product_client_stub.call_count + end + end + end + + def test_create_reference_image + # Create test objects. + client_result = ::Google::Cloud::Vision::V1p3beta1::ReferenceImage.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + reference_image = {} + reference_image_id = "hello world" + + create_reference_image_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::Vision::V1p3beta1::ProductSearch::Rest::ServiceStub.stub :transcode_create_reference_image_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_reference_image_client_stub do + # Create client + client = ::Google::Cloud::Vision::V1p3beta1::ProductSearch::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_reference_image({ parent: parent, reference_image: reference_image, reference_image_id: reference_image_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_reference_image parent: parent, reference_image: reference_image, reference_image_id: reference_image_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_reference_image ::Google::Cloud::Vision::V1p3beta1::CreateReferenceImageRequest.new(parent: parent, reference_image: reference_image, reference_image_id: reference_image_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_reference_image({ parent: parent, reference_image: reference_image, reference_image_id: reference_image_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_reference_image(::Google::Cloud::Vision::V1p3beta1::CreateReferenceImageRequest.new(parent: parent, reference_image: reference_image, reference_image_id: reference_image_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_reference_image_client_stub.call_count + end + end + end + + def test_delete_reference_image + # 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_reference_image_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::Vision::V1p3beta1::ProductSearch::Rest::ServiceStub.stub :transcode_delete_reference_image_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_reference_image_client_stub do + # Create client + client = ::Google::Cloud::Vision::V1p3beta1::ProductSearch::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_reference_image({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_reference_image name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_reference_image ::Google::Cloud::Vision::V1p3beta1::DeleteReferenceImageRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_reference_image({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_reference_image(::Google::Cloud::Vision::V1p3beta1::DeleteReferenceImageRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_reference_image_client_stub.call_count + end + end + end + + def test_list_reference_images + # Create test objects. + client_result = ::Google::Cloud::Vision::V1p3beta1::ListReferenceImagesResponse.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_reference_images_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::Vision::V1p3beta1::ProductSearch::Rest::ServiceStub.stub :transcode_list_reference_images_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_reference_images_client_stub do + # Create client + client = ::Google::Cloud::Vision::V1p3beta1::ProductSearch::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_reference_images({ 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_reference_images 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_reference_images ::Google::Cloud::Vision::V1p3beta1::ListReferenceImagesRequest.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_reference_images({ 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_reference_images(::Google::Cloud::Vision::V1p3beta1::ListReferenceImagesRequest.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_reference_images_client_stub.call_count + end + end + end + + def test_get_reference_image + # Create test objects. + client_result = ::Google::Cloud::Vision::V1p3beta1::ReferenceImage.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_reference_image_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::Vision::V1p3beta1::ProductSearch::Rest::ServiceStub.stub :transcode_get_reference_image_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_reference_image_client_stub do + # Create client + client = ::Google::Cloud::Vision::V1p3beta1::ProductSearch::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_reference_image({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_reference_image name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_reference_image ::Google::Cloud::Vision::V1p3beta1::GetReferenceImageRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_reference_image({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_reference_image(::Google::Cloud::Vision::V1p3beta1::GetReferenceImageRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_reference_image_client_stub.call_count + end + end + end + + def test_add_product_to_product_set + # 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" + product = "hello world" + + add_product_to_product_set_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::Vision::V1p3beta1::ProductSearch::Rest::ServiceStub.stub :transcode_add_product_to_product_set_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, add_product_to_product_set_client_stub do + # Create client + client = ::Google::Cloud::Vision::V1p3beta1::ProductSearch::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.add_product_to_product_set({ name: name, product: product }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.add_product_to_product_set name: name, product: product do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.add_product_to_product_set ::Google::Cloud::Vision::V1p3beta1::AddProductToProductSetRequest.new(name: name, product: product) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.add_product_to_product_set({ name: name, product: product }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.add_product_to_product_set(::Google::Cloud::Vision::V1p3beta1::AddProductToProductSetRequest.new(name: name, product: product), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, add_product_to_product_set_client_stub.call_count + end + end + end + + def test_remove_product_from_product_set + # 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" + product = "hello world" + + remove_product_from_product_set_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::Vision::V1p3beta1::ProductSearch::Rest::ServiceStub.stub :transcode_remove_product_from_product_set_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, remove_product_from_product_set_client_stub do + # Create client + client = ::Google::Cloud::Vision::V1p3beta1::ProductSearch::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.remove_product_from_product_set({ name: name, product: product }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.remove_product_from_product_set name: name, product: product do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.remove_product_from_product_set ::Google::Cloud::Vision::V1p3beta1::RemoveProductFromProductSetRequest.new(name: name, product: product) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.remove_product_from_product_set({ name: name, product: product }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.remove_product_from_product_set(::Google::Cloud::Vision::V1p3beta1::RemoveProductFromProductSetRequest.new(name: name, product: product), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, remove_product_from_product_set_client_stub.call_count + end + end + end + + def test_list_products_in_product_set + # Create test objects. + client_result = ::Google::Cloud::Vision::V1p3beta1::ListProductsInProductSetResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + page_size = 42 + page_token = "hello world" + + list_products_in_product_set_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::Vision::V1p3beta1::ProductSearch::Rest::ServiceStub.stub :transcode_list_products_in_product_set_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_products_in_product_set_client_stub do + # Create client + client = ::Google::Cloud::Vision::V1p3beta1::ProductSearch::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_products_in_product_set({ name: name, page_size: page_size, page_token: page_token }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.list_products_in_product_set name: name, page_size: page_size, page_token: page_token do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.list_products_in_product_set ::Google::Cloud::Vision::V1p3beta1::ListProductsInProductSetRequest.new(name: name, 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_products_in_product_set({ name: name, 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_products_in_product_set(::Google::Cloud::Vision::V1p3beta1::ListProductsInProductSetRequest.new(name: name, 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_products_in_product_set_client_stub.call_count + end + end + end + + def test_import_product_sets + # 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" + input_config = {} + + import_product_sets_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::Vision::V1p3beta1::ProductSearch::Rest::ServiceStub.stub :transcode_import_product_sets_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, import_product_sets_client_stub do + # Create client + client = ::Google::Cloud::Vision::V1p3beta1::ProductSearch::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.import_product_sets({ parent: parent, input_config: input_config }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.import_product_sets parent: parent, input_config: input_config do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.import_product_sets ::Google::Cloud::Vision::V1p3beta1::ImportProductSetsRequest.new(parent: parent, input_config: input_config) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.import_product_sets({ parent: parent, input_config: input_config }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.import_product_sets(::Google::Cloud::Vision::V1p3beta1::ImportProductSetsRequest.new(parent: parent, input_config: input_config), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, import_product_sets_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::Vision::V1p3beta1::ProductSearch::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::Vision::V1p3beta1::ProductSearch::Rest::Client::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-vision-v1p3beta1/test/google/cloud/vision/v1p3beta1/product_search_test.rb b/owl-bot-staging/google-cloud-vision-v1p3beta1/test/google/cloud/vision/v1p3beta1/product_search_test.rb new file mode 100644 index 000000000000..2535f0d3b3c9 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision-v1p3beta1/test/google/cloud/vision/v1p3beta1/product_search_test.rb @@ -0,0 +1,1225 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/vision/v1p3beta1/product_search_service_pb" +require "google/cloud/vision/v1p3beta1/product_search" + +class ::Google::Cloud::Vision::V1p3beta1::ProductSearch::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_product_set + # Create GRPC objects. + grpc_response = ::Google::Cloud::Vision::V1p3beta1::ProductSet.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" + product_set = {} + product_set_id = "hello world" + + create_product_set_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_product_set, name + assert_kind_of ::Google::Cloud::Vision::V1p3beta1::CreateProductSetRequest, request + assert_equal "hello world", request["parent"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Vision::V1p3beta1::ProductSet), request["product_set"] + assert_equal "hello world", request["product_set_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_product_set_client_stub do + # Create client + client = ::Google::Cloud::Vision::V1p3beta1::ProductSearch::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_product_set({ parent: parent, product_set: product_set, product_set_id: product_set_id }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.create_product_set parent: parent, product_set: product_set, product_set_id: product_set_id do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.create_product_set ::Google::Cloud::Vision::V1p3beta1::CreateProductSetRequest.new(parent: parent, product_set: product_set, product_set_id: product_set_id) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.create_product_set({ parent: parent, product_set: product_set, product_set_id: product_set_id }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.create_product_set(::Google::Cloud::Vision::V1p3beta1::CreateProductSetRequest.new(parent: parent, product_set: product_set, product_set_id: product_set_id), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, create_product_set_client_stub.call_rpc_count + end + end + + def test_list_product_sets + # Create GRPC objects. + grpc_response = ::Google::Cloud::Vision::V1p3beta1::ListProductSetsResponse.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_product_sets_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_product_sets, name + assert_kind_of ::Google::Cloud::Vision::V1p3beta1::ListProductSetsRequest, 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_product_sets_client_stub do + # Create client + client = ::Google::Cloud::Vision::V1p3beta1::ProductSearch::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_product_sets({ 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_product_sets 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_product_sets ::Google::Cloud::Vision::V1p3beta1::ListProductSetsRequest.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_product_sets({ 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_product_sets(::Google::Cloud::Vision::V1p3beta1::ListProductSetsRequest.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_product_sets_client_stub.call_rpc_count + end + end + + def test_get_product_set + # Create GRPC objects. + grpc_response = ::Google::Cloud::Vision::V1p3beta1::ProductSet.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_product_set_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_product_set, name + assert_kind_of ::Google::Cloud::Vision::V1p3beta1::GetProductSetRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_product_set_client_stub do + # Create client + client = ::Google::Cloud::Vision::V1p3beta1::ProductSearch::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_product_set({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_product_set name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_product_set ::Google::Cloud::Vision::V1p3beta1::GetProductSetRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_product_set({ 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_product_set(::Google::Cloud::Vision::V1p3beta1::GetProductSetRequest.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_product_set_client_stub.call_rpc_count + end + end + + def test_update_product_set + # Create GRPC objects. + grpc_response = ::Google::Cloud::Vision::V1p3beta1::ProductSet.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. + product_set = {} + update_mask = {} + + update_product_set_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_product_set, name + assert_kind_of ::Google::Cloud::Vision::V1p3beta1::UpdateProductSetRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Vision::V1p3beta1::ProductSet), request["product_set"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_product_set_client_stub do + # Create client + client = ::Google::Cloud::Vision::V1p3beta1::ProductSearch::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_product_set({ product_set: product_set, update_mask: update_mask }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.update_product_set product_set: product_set, update_mask: update_mask do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.update_product_set ::Google::Cloud::Vision::V1p3beta1::UpdateProductSetRequest.new(product_set: product_set, 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_product_set({ product_set: product_set, 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_product_set(::Google::Cloud::Vision::V1p3beta1::UpdateProductSetRequest.new(product_set: product_set, 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_product_set_client_stub.call_rpc_count + end + end + + def test_delete_product_set + # 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_product_set_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_product_set, name + assert_kind_of ::Google::Cloud::Vision::V1p3beta1::DeleteProductSetRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_product_set_client_stub do + # Create client + client = ::Google::Cloud::Vision::V1p3beta1::ProductSearch::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_product_set({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_product_set name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_product_set ::Google::Cloud::Vision::V1p3beta1::DeleteProductSetRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_product_set({ 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_product_set(::Google::Cloud::Vision::V1p3beta1::DeleteProductSetRequest.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_product_set_client_stub.call_rpc_count + end + end + + def test_create_product + # Create GRPC objects. + grpc_response = ::Google::Cloud::Vision::V1p3beta1::Product.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" + product = {} + product_id = "hello world" + + create_product_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_product, name + assert_kind_of ::Google::Cloud::Vision::V1p3beta1::CreateProductRequest, request + assert_equal "hello world", request["parent"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Vision::V1p3beta1::Product), request["product"] + assert_equal "hello world", request["product_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_product_client_stub do + # Create client + client = ::Google::Cloud::Vision::V1p3beta1::ProductSearch::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_product({ parent: parent, product: product, product_id: product_id }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.create_product parent: parent, product: product, product_id: product_id do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.create_product ::Google::Cloud::Vision::V1p3beta1::CreateProductRequest.new(parent: parent, product: product, product_id: product_id) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.create_product({ parent: parent, product: product, product_id: product_id }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.create_product(::Google::Cloud::Vision::V1p3beta1::CreateProductRequest.new(parent: parent, product: product, product_id: product_id), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, create_product_client_stub.call_rpc_count + end + end + + def test_list_products + # Create GRPC objects. + grpc_response = ::Google::Cloud::Vision::V1p3beta1::ListProductsResponse.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_products_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_products, name + assert_kind_of ::Google::Cloud::Vision::V1p3beta1::ListProductsRequest, 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_products_client_stub do + # Create client + client = ::Google::Cloud::Vision::V1p3beta1::ProductSearch::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_products({ 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_products 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_products ::Google::Cloud::Vision::V1p3beta1::ListProductsRequest.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_products({ 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_products(::Google::Cloud::Vision::V1p3beta1::ListProductsRequest.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_products_client_stub.call_rpc_count + end + end + + def test_get_product + # Create GRPC objects. + grpc_response = ::Google::Cloud::Vision::V1p3beta1::Product.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_product_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_product, name + assert_kind_of ::Google::Cloud::Vision::V1p3beta1::GetProductRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_product_client_stub do + # Create client + client = ::Google::Cloud::Vision::V1p3beta1::ProductSearch::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_product({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_product name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_product ::Google::Cloud::Vision::V1p3beta1::GetProductRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_product({ 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_product(::Google::Cloud::Vision::V1p3beta1::GetProductRequest.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_product_client_stub.call_rpc_count + end + end + + def test_update_product + # Create GRPC objects. + grpc_response = ::Google::Cloud::Vision::V1p3beta1::Product.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. + product = {} + update_mask = {} + + update_product_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_product, name + assert_kind_of ::Google::Cloud::Vision::V1p3beta1::UpdateProductRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Vision::V1p3beta1::Product), request["product"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_product_client_stub do + # Create client + client = ::Google::Cloud::Vision::V1p3beta1::ProductSearch::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_product({ product: product, update_mask: update_mask }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.update_product product: product, update_mask: update_mask do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.update_product ::Google::Cloud::Vision::V1p3beta1::UpdateProductRequest.new(product: product, 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_product({ product: product, 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_product(::Google::Cloud::Vision::V1p3beta1::UpdateProductRequest.new(product: product, 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_product_client_stub.call_rpc_count + end + end + + def test_delete_product + # 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_product_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_product, name + assert_kind_of ::Google::Cloud::Vision::V1p3beta1::DeleteProductRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_product_client_stub do + # Create client + client = ::Google::Cloud::Vision::V1p3beta1::ProductSearch::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_product({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_product name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_product ::Google::Cloud::Vision::V1p3beta1::DeleteProductRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_product({ 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_product(::Google::Cloud::Vision::V1p3beta1::DeleteProductRequest.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_product_client_stub.call_rpc_count + end + end + + def test_create_reference_image + # Create GRPC objects. + grpc_response = ::Google::Cloud::Vision::V1p3beta1::ReferenceImage.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" + reference_image = {} + reference_image_id = "hello world" + + create_reference_image_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_reference_image, name + assert_kind_of ::Google::Cloud::Vision::V1p3beta1::CreateReferenceImageRequest, request + assert_equal "hello world", request["parent"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Vision::V1p3beta1::ReferenceImage), request["reference_image"] + assert_equal "hello world", request["reference_image_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_reference_image_client_stub do + # Create client + client = ::Google::Cloud::Vision::V1p3beta1::ProductSearch::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_reference_image({ parent: parent, reference_image: reference_image, reference_image_id: reference_image_id }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.create_reference_image parent: parent, reference_image: reference_image, reference_image_id: reference_image_id do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.create_reference_image ::Google::Cloud::Vision::V1p3beta1::CreateReferenceImageRequest.new(parent: parent, reference_image: reference_image, reference_image_id: reference_image_id) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.create_reference_image({ parent: parent, reference_image: reference_image, reference_image_id: reference_image_id }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.create_reference_image(::Google::Cloud::Vision::V1p3beta1::CreateReferenceImageRequest.new(parent: parent, reference_image: reference_image, reference_image_id: reference_image_id), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, create_reference_image_client_stub.call_rpc_count + end + end + + def test_delete_reference_image + # 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_reference_image_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_reference_image, name + assert_kind_of ::Google::Cloud::Vision::V1p3beta1::DeleteReferenceImageRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_reference_image_client_stub do + # Create client + client = ::Google::Cloud::Vision::V1p3beta1::ProductSearch::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_reference_image({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_reference_image name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_reference_image ::Google::Cloud::Vision::V1p3beta1::DeleteReferenceImageRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_reference_image({ 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_reference_image(::Google::Cloud::Vision::V1p3beta1::DeleteReferenceImageRequest.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_reference_image_client_stub.call_rpc_count + end + end + + def test_list_reference_images + # Create GRPC objects. + grpc_response = ::Google::Cloud::Vision::V1p3beta1::ListReferenceImagesResponse.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_reference_images_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_reference_images, name + assert_kind_of ::Google::Cloud::Vision::V1p3beta1::ListReferenceImagesRequest, 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_reference_images_client_stub do + # Create client + client = ::Google::Cloud::Vision::V1p3beta1::ProductSearch::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_reference_images({ 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_reference_images 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_reference_images ::Google::Cloud::Vision::V1p3beta1::ListReferenceImagesRequest.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_reference_images({ 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_reference_images(::Google::Cloud::Vision::V1p3beta1::ListReferenceImagesRequest.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_reference_images_client_stub.call_rpc_count + end + end + + def test_get_reference_image + # Create GRPC objects. + grpc_response = ::Google::Cloud::Vision::V1p3beta1::ReferenceImage.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_reference_image_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_reference_image, name + assert_kind_of ::Google::Cloud::Vision::V1p3beta1::GetReferenceImageRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_reference_image_client_stub do + # Create client + client = ::Google::Cloud::Vision::V1p3beta1::ProductSearch::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_reference_image({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_reference_image name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_reference_image ::Google::Cloud::Vision::V1p3beta1::GetReferenceImageRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_reference_image({ 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_reference_image(::Google::Cloud::Vision::V1p3beta1::GetReferenceImageRequest.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_reference_image_client_stub.call_rpc_count + end + end + + def test_add_product_to_product_set + # 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" + product = "hello world" + + add_product_to_product_set_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :add_product_to_product_set, name + assert_kind_of ::Google::Cloud::Vision::V1p3beta1::AddProductToProductSetRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["product"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, add_product_to_product_set_client_stub do + # Create client + client = ::Google::Cloud::Vision::V1p3beta1::ProductSearch::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.add_product_to_product_set({ name: name, product: product }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.add_product_to_product_set name: name, product: product do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.add_product_to_product_set ::Google::Cloud::Vision::V1p3beta1::AddProductToProductSetRequest.new(name: name, product: product) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.add_product_to_product_set({ name: name, product: product }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.add_product_to_product_set(::Google::Cloud::Vision::V1p3beta1::AddProductToProductSetRequest.new(name: name, product: product), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, add_product_to_product_set_client_stub.call_rpc_count + end + end + + def test_remove_product_from_product_set + # 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" + product = "hello world" + + remove_product_from_product_set_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :remove_product_from_product_set, name + assert_kind_of ::Google::Cloud::Vision::V1p3beta1::RemoveProductFromProductSetRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["product"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, remove_product_from_product_set_client_stub do + # Create client + client = ::Google::Cloud::Vision::V1p3beta1::ProductSearch::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.remove_product_from_product_set({ name: name, product: product }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.remove_product_from_product_set name: name, product: product do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.remove_product_from_product_set ::Google::Cloud::Vision::V1p3beta1::RemoveProductFromProductSetRequest.new(name: name, product: product) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.remove_product_from_product_set({ name: name, product: product }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.remove_product_from_product_set(::Google::Cloud::Vision::V1p3beta1::RemoveProductFromProductSetRequest.new(name: name, product: product), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, remove_product_from_product_set_client_stub.call_rpc_count + end + end + + def test_list_products_in_product_set + # Create GRPC objects. + grpc_response = ::Google::Cloud::Vision::V1p3beta1::ListProductsInProductSetResponse.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" + page_size = 42 + page_token = "hello world" + + list_products_in_product_set_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_products_in_product_set, name + assert_kind_of ::Google::Cloud::Vision::V1p3beta1::ListProductsInProductSetRequest, request + assert_equal "hello world", request["name"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_products_in_product_set_client_stub do + # Create client + client = ::Google::Cloud::Vision::V1p3beta1::ProductSearch::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_products_in_product_set({ name: name, 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_products_in_product_set name: name, 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_products_in_product_set ::Google::Cloud::Vision::V1p3beta1::ListProductsInProductSetRequest.new(name: name, 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_products_in_product_set({ name: name, 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_products_in_product_set(::Google::Cloud::Vision::V1p3beta1::ListProductsInProductSetRequest.new(name: name, 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_products_in_product_set_client_stub.call_rpc_count + end + end + + def test_import_product_sets + # 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" + input_config = {} + + import_product_sets_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :import_product_sets, name + assert_kind_of ::Google::Cloud::Vision::V1p3beta1::ImportProductSetsRequest, request + assert_equal "hello world", request["parent"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Vision::V1p3beta1::ImportProductSetsInputConfig), request["input_config"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, import_product_sets_client_stub do + # Create client + client = ::Google::Cloud::Vision::V1p3beta1::ProductSearch::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.import_product_sets({ parent: parent, input_config: input_config }) 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.import_product_sets parent: parent, input_config: input_config 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.import_product_sets ::Google::Cloud::Vision::V1p3beta1::ImportProductSetsRequest.new(parent: parent, input_config: input_config) 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.import_product_sets({ parent: parent, input_config: input_config }, 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.import_product_sets(::Google::Cloud::Vision::V1p3beta1::ImportProductSetsRequest.new(parent: parent, input_config: input_config), 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, import_product_sets_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::Vision::V1p3beta1::ProductSearch::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::Vision::V1p3beta1::ProductSearch::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::Vision::V1p3beta1::ProductSearch::Client.new do |config| + config.credentials = creds + end + assert_kind_of ::Google::Cloud::Vision::V1p3beta1::ProductSearch::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::Vision::V1p3beta1::ProductSearch::Client.new do |config| + config.credentials = grpc_channel + end + end + + assert_kind_of ::Google::Cloud::Vision::V1p3beta1::ProductSearch::Operations, client.operations_client + end +end diff --git a/owl-bot-staging/google-cloud-vision-v1p3beta1/test/helper.rb b/owl-bot-staging/google-cloud-vision-v1p3beta1/test/helper.rb new file mode 100644 index 000000000000..672b337030e7 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision-v1p3beta1/test/helper.rb @@ -0,0 +1,26 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/mock" +require "minitest/rg" + +require "grpc" + +require "ostruct" diff --git a/owl-bot-staging/google-cloud-vision-v1p4beta1/.gitignore b/owl-bot-staging/google-cloud-vision-v1p4beta1/.gitignore new file mode 100644 index 000000000000..0135b6bc6cfc --- /dev/null +++ b/owl-bot-staging/google-cloud-vision-v1p4beta1/.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-vision-v1p4beta1/.repo-metadata.json b/owl-bot-staging/google-cloud-vision-v1p4beta1/.repo-metadata.json new file mode 100644 index 000000000000..2e6a125e1ed7 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision-v1p4beta1/.repo-metadata.json @@ -0,0 +1,18 @@ +{ + "api_id": "vision.googleapis.com", + "api_shortname": "vision", + "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-vision-v1p4beta1/latest", + "distribution_name": "google-cloud-vision-v1p4beta1", + "is_cloud": true, + "language": "ruby", + "name": "vision", + "name_pretty": "Cloud Vision V1p4beta1 API", + "product_documentation": "https://cloud.google.com/vision", + "release_level": "unreleased", + "repo": "googleapis/google-cloud-ruby", + "requires_billing": true, + "ruby-cloud-description": "Cloud Vision API allows developers to easily integrate vision detection features within applications, including image labeling, face and landmark detection, optical character recognition (OCR), and tagging of explicit content. Note that google-cloud-vision-v1p4beta1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-vision instead. See the readme for more details.", + "ruby-cloud-env-prefix": "VISION", + "ruby-cloud-product-url": "https://cloud.google.com/vision", + "library_type": "GAPIC_AUTO" +} diff --git a/owl-bot-staging/google-cloud-vision-v1p4beta1/.rubocop.yml b/owl-bot-staging/google-cloud-vision-v1p4beta1/.rubocop.yml new file mode 100644 index 000000000000..3b29e65f7fbe --- /dev/null +++ b/owl-bot-staging/google-cloud-vision-v1p4beta1/.rubocop.yml @@ -0,0 +1,33 @@ +inherit_gem: + google-style: google-style.yml + +AllCops: + Exclude: + - "google-cloud-vision-v1p4beta1.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-vision-v1p4beta1.rb" diff --git a/owl-bot-staging/google-cloud-vision-v1p4beta1/.toys.rb b/owl-bot-staging/google-cloud-vision-v1p4beta1/.toys.rb new file mode 100644 index 000000000000..177e22456e8a --- /dev/null +++ b/owl-bot-staging/google-cloud-vision-v1p4beta1/.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-vision-v1p4beta1/.yardopts b/owl-bot-staging/google-cloud-vision-v1p4beta1/.yardopts new file mode 100644 index 000000000000..4d5d42768816 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision-v1p4beta1/.yardopts @@ -0,0 +1,12 @@ +--no-private +--title="Cloud Vision V1p4beta1 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-vision-v1p4beta1/AUTHENTICATION.md b/owl-bot-staging/google-cloud-vision-v1p4beta1/AUTHENTICATION.md new file mode 100644 index 000000000000..94d7020a4c49 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision-v1p4beta1/AUTHENTICATION.md @@ -0,0 +1,122 @@ +# Authentication + +The recommended way to authenticate to the google-cloud-vision-v1p4beta1 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-vision-v1p4beta1 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/vision/v1p4beta1" + +client = ::Google::Cloud::Vision::V1p4beta1::ProductSearch::Client.new do |config| + config.credentials = "path/to/credentialfile.json" +end +``` + +To configure a credentials file globally for all clients: + +```ruby +require "google/cloud/vision/v1p4beta1" + +::Google::Cloud::Vision::V1p4beta1::ProductSearch::Client.configure do |config| + config.credentials = "path/to/credentialfile.json" +end + +client = ::Google::Cloud::Vision::V1p4beta1::ProductSearch::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-vision-v1p4beta1 +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/vision/v1p4beta1" + +ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" + +client = ::Google::Cloud::Vision::V1p4beta1::ProductSearch::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-vision-v1p4beta1/CHANGELOG.md b/owl-bot-staging/google-cloud-vision-v1p4beta1/CHANGELOG.md new file mode 100644 index 000000000000..f88957a62ba2 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision-v1p4beta1/CHANGELOG.md @@ -0,0 +1,2 @@ +# Release History + diff --git a/owl-bot-staging/google-cloud-vision-v1p4beta1/Gemfile b/owl-bot-staging/google-cloud-vision-v1p4beta1/Gemfile new file mode 100644 index 000000000000..1d08558908d8 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision-v1p4beta1/Gemfile @@ -0,0 +1,14 @@ +source "https://rubygems.org" + +gemspec + +gem "google-style", "~> 1.32.0" +gem "irb", "~> 1.17" +gem "minitest", "~> 6.0.2" +gem "minitest-focus", "~> 1.4" +gem "minitest-mock", "~> 5.27" +gem "minitest-rg", "~> 5.3" +gem "ostruct", "~> 0.5.5" +gem "rake", ">= 13.0" +gem "redcarpet", "~> 3.6" +gem "yard", "~> 0.9" diff --git a/owl-bot-staging/google-cloud-vision-v1p4beta1/LICENSE.md b/owl-bot-staging/google-cloud-vision-v1p4beta1/LICENSE.md new file mode 100644 index 000000000000..c261857ba6ad --- /dev/null +++ b/owl-bot-staging/google-cloud-vision-v1p4beta1/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-vision-v1p4beta1/README.md b/owl-bot-staging/google-cloud-vision-v1p4beta1/README.md new file mode 100644 index 000000000000..780aaacb1d2b --- /dev/null +++ b/owl-bot-staging/google-cloud-vision-v1p4beta1/README.md @@ -0,0 +1,154 @@ +# Ruby Client for the Cloud Vision V1p4beta1 API + +Integrates Google Vision features, including image labeling, face, logo, and landmark detection, optical character recognition (OCR), and detection of explicit content, into applications. + +Cloud Vision API allows developers to easily integrate vision detection features within applications, including image labeling, face and landmark detection, optical character recognition (OCR), and tagging of explicit content. + +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 Vision V1p4beta1 API. Most users should consider using +the main client gem, +[google-cloud-vision](https://rubygems.org/gems/google-cloud-vision). +See the section below titled *Which client should I use?* for more information. + +## Installation + +``` +$ gem install google-cloud-vision-v1p4beta1 +``` + +## 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/vision.googleapis.com) +1. [Set up authentication.](AUTHENTICATION.md) + +## Quick Start + +```ruby +require "google/cloud/vision/v1p4beta1" + +client = ::Google::Cloud::Vision::V1p4beta1::ProductSearch::Client.new +request = ::Google::Cloud::Vision::V1p4beta1::CreateProductSetRequest.new # (request fields as keyword arguments...) +response = client.create_product_set request +``` + +View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-vision-v1p4beta1/latest) +for class and method documentation. + +See also the [Product Documentation](https://cloud.google.com/vision) +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/vision/v1p4beta1" +require "logger" + +client = ::Google::Cloud::Vision::V1p4beta1::ProductSearch::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-vision`, +and lower-level _versioned_ client libraries with names such as +`google-cloud-vision-v1p4beta1`. +_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-vision`. +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-vision-v1p4beta1`. + +### 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-vision-v1p4beta1/Rakefile b/owl-bot-staging/google-cloud-vision-v1p4beta1/Rakefile new file mode 100644 index 000000000000..88648aa39bba --- /dev/null +++ b/owl-bot-staging/google-cloud-vision-v1p4beta1/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-vision-v1p4beta1 acceptance tests." +task :acceptance, :project, :keyfile do |t, args| + project = args[:project] + project ||= + ENV["VISION_TEST_PROJECT"] || + ENV["GCLOUD_TEST_PROJECT"] + keyfile = args[:keyfile] + keyfile ||= + ENV["VISION_TEST_KEYFILE"] || + ENV["GCLOUD_TEST_KEYFILE"] + if keyfile + keyfile = File.read keyfile + else + keyfile ||= + ENV["VISION_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 VISION_TEST_PROJECT=test123 VISION_TEST_KEYFILE=/path/to/keyfile.json rake acceptance" + end + require "google/cloud/vision/v1p4beta1/product_search/credentials" + ::Google::Cloud::Vision::V1p4beta1::ProductSearch::Credentials.env_vars.each do |path| + ENV[path] = nil + end + ENV["VISION_PROJECT"] = project + ENV["VISION_TEST_PROJECT"] = project + ENV["VISION_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-vision-v1p4beta1 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-vision-v1p4beta1 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-vision-v1p4beta1 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-vision-v1p4beta1 gem does not have doctest tests." +end + +desc "Run the CI build" +task :ci do + header "BUILDING google-cloud-vision-v1p4beta1" + header "google-cloud-vision-v1p4beta1 rubocop", "*" + Rake::Task[:rubocop].invoke + header "google-cloud-vision-v1p4beta1 yard", "*" + Rake::Task[:yard].invoke + header "google-cloud-vision-v1p4beta1 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-vision-v1p4beta1 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-vision-v1p4beta1 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-vision-v1p4beta1/gapic_metadata.json b/owl-bot-staging/google-cloud-vision-v1p4beta1/gapic_metadata.json new file mode 100644 index 000000000000..ced5866fddd0 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision-v1p4beta1/gapic_metadata.json @@ -0,0 +1,142 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "ruby", + "protoPackage": "google.cloud.vision.v1p4beta1", + "libraryPackage": "::Google::Cloud::Vision::V1p4beta1", + "services": { + "ProductSearch": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::Vision::V1p4beta1::ProductSearch::Client", + "rpcs": { + "CreateProductSet": { + "methods": [ + "create_product_set" + ] + }, + "ListProductSets": { + "methods": [ + "list_product_sets" + ] + }, + "GetProductSet": { + "methods": [ + "get_product_set" + ] + }, + "UpdateProductSet": { + "methods": [ + "update_product_set" + ] + }, + "DeleteProductSet": { + "methods": [ + "delete_product_set" + ] + }, + "CreateProduct": { + "methods": [ + "create_product" + ] + }, + "ListProducts": { + "methods": [ + "list_products" + ] + }, + "GetProduct": { + "methods": [ + "get_product" + ] + }, + "UpdateProduct": { + "methods": [ + "update_product" + ] + }, + "DeleteProduct": { + "methods": [ + "delete_product" + ] + }, + "CreateReferenceImage": { + "methods": [ + "create_reference_image" + ] + }, + "DeleteReferenceImage": { + "methods": [ + "delete_reference_image" + ] + }, + "ListReferenceImages": { + "methods": [ + "list_reference_images" + ] + }, + "GetReferenceImage": { + "methods": [ + "get_reference_image" + ] + }, + "AddProductToProductSet": { + "methods": [ + "add_product_to_product_set" + ] + }, + "RemoveProductFromProductSet": { + "methods": [ + "remove_product_from_product_set" + ] + }, + "ListProductsInProductSet": { + "methods": [ + "list_products_in_product_set" + ] + }, + "ImportProductSets": { + "methods": [ + "import_product_sets" + ] + }, + "PurgeProducts": { + "methods": [ + "purge_products" + ] + } + } + } + } + }, + "ImageAnnotator": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::Vision::V1p4beta1::ImageAnnotator::Client", + "rpcs": { + "BatchAnnotateImages": { + "methods": [ + "batch_annotate_images" + ] + }, + "BatchAnnotateFiles": { + "methods": [ + "batch_annotate_files" + ] + }, + "AsyncBatchAnnotateImages": { + "methods": [ + "async_batch_annotate_images" + ] + }, + "AsyncBatchAnnotateFiles": { + "methods": [ + "async_batch_annotate_files" + ] + } + } + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-vision-v1p4beta1/google-cloud-vision-v1p4beta1.gemspec b/owl-bot-staging/google-cloud-vision-v1p4beta1/google-cloud-vision-v1p4beta1.gemspec new file mode 100644 index 000000000000..fe0b5808e934 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision-v1p4beta1/google-cloud-vision-v1p4beta1.gemspec @@ -0,0 +1,28 @@ +# -*- ruby -*- +# encoding: utf-8 + +require File.expand_path("lib/google/cloud/vision/v1p4beta1/version", __dir__) + +Gem::Specification.new do |gem| + gem.name = "google-cloud-vision-v1p4beta1" + gem.version = Google::Cloud::Vision::V1p4beta1::VERSION + + gem.authors = ["Google LLC"] + gem.email = "googleapis-packages@google.com" + gem.description = "Cloud Vision API allows developers to easily integrate vision detection features within applications, including image labeling, face and landmark detection, optical character recognition (OCR), and tagging of explicit content. Note that google-cloud-vision-v1p4beta1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-vision instead. See the readme for more details." + gem.summary = "Integrates Google Vision features, including image labeling, face, logo, and landmark detection, optical character recognition (OCR), and detection of explicit content, into 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.2" + + gem.add_dependency "gapic-common", "~> 1.2" + gem.add_dependency "google-cloud-errors", "~> 1.0" +end diff --git a/owl-bot-staging/google-cloud-vision-v1p4beta1/lib/google-cloud-vision-v1p4beta1.rb b/owl-bot-staging/google-cloud-vision-v1p4beta1/lib/google-cloud-vision-v1p4beta1.rb new file mode 100644 index 000000000000..c8b30388aac1 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision-v1p4beta1/lib/google-cloud-vision-v1p4beta1.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/vision/v1p4beta1" diff --git a/owl-bot-staging/google-cloud-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1.rb b/owl-bot-staging/google-cloud-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1.rb new file mode 100644 index 000000000000..fff4835afa60 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1.rb @@ -0,0 +1,46 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/vision/v1p4beta1/product_search" +require "google/cloud/vision/v1p4beta1/image_annotator" +require "google/cloud/vision/v1p4beta1/version" + +module Google + module Cloud + module Vision + ## + # API client module. + # + # @example Load this package, including all its services, and instantiate a gRPC client + # + # require "google/cloud/vision/v1p4beta1" + # client = ::Google::Cloud::Vision::V1p4beta1::ProductSearch::Client.new + # + # @example Load this package, including all its services, and instantiate a REST client + # + # require "google/cloud/vision/v1p4beta1" + # client = ::Google::Cloud::Vision::V1p4beta1::ProductSearch::Rest::Client.new + # + module V1p4beta1 + end + end + end +end + +helper_path = ::File.join __dir__, "v1p4beta1", "_helpers.rb" +require "google/cloud/vision/v1p4beta1/_helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1/face_pb.rb b/owl-bot-staging/google-cloud-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1/face_pb.rb new file mode 100644 index 000000000000..c52d29d87def --- /dev/null +++ b/owl-bot-staging/google-cloud-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1/face_pb.rb @@ -0,0 +1,25 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/vision/v1p4beta1/face.proto + +require 'google/protobuf' + +require 'google/cloud/vision/v1p4beta1/geometry_pb' + + +descriptor_data = "\n(google/cloud/vision/v1p4beta1/face.proto\x12\x1dgoogle.cloud.vision.v1p4beta1\x1a,google/cloud/vision/v1p4beta1/geometry.proto\".\n\x15\x46\x61\x63\x65RecognitionParams\x12\x15\n\rcelebrity_set\x18\x01 \x03(\t\"D\n\tCelebrity\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x14\n\x0c\x64isplay_name\x18\x02 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x03 \x01(\t\"h\n\x15\x46\x61\x63\x65RecognitionResult\x12;\n\tcelebrity\x18\x01 \x01(\x0b\x32(.google.cloud.vision.v1p4beta1.Celebrity\x12\x12\n\nconfidence\x18\x02 \x01(\x02\x42z\n!com.google.cloud.vision.v1p4beta1B\x0e\x43\x65lebrityProtoP\x01Z9cloud.google.com/go/vision/apiv1p4beta1/visionpb;visionpb\xf8\x01\x01\xa2\x02\x04GCVNb\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module Vision + module V1p4beta1 + FaceRecognitionParams = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p4beta1.FaceRecognitionParams").msgclass + Celebrity = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p4beta1.Celebrity").msgclass + FaceRecognitionResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p4beta1.FaceRecognitionResult").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1/geometry_pb.rb b/owl-bot-staging/google-cloud-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1/geometry_pb.rb new file mode 100644 index 000000000000..966725a595fc --- /dev/null +++ b/owl-bot-staging/google-cloud-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1/geometry_pb.rb @@ -0,0 +1,24 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/vision/v1p4beta1/geometry.proto + +require 'google/protobuf' + + +descriptor_data = "\n,google/cloud/vision/v1p4beta1/geometry.proto\x12\x1dgoogle.cloud.vision.v1p4beta1\"\x1e\n\x06Vertex\x12\t\n\x01x\x18\x01 \x01(\x05\x12\t\n\x01y\x18\x02 \x01(\x05\"(\n\x10NormalizedVertex\x12\t\n\x01x\x18\x01 \x01(\x02\x12\t\n\x01y\x18\x02 \x01(\x02\"\x95\x01\n\x0c\x42oundingPoly\x12\x37\n\x08vertices\x18\x01 \x03(\x0b\x32%.google.cloud.vision.v1p4beta1.Vertex\x12L\n\x13normalized_vertices\x18\x02 \x03(\x0b\x32/.google.cloud.vision.v1p4beta1.NormalizedVertex\"+\n\x08Position\x12\t\n\x01x\x18\x01 \x01(\x02\x12\t\n\x01y\x18\x02 \x01(\x02\x12\t\n\x01z\x18\x03 \x01(\x02\x42y\n!com.google.cloud.vision.v1p4beta1B\rGeometryProtoP\x01Z9cloud.google.com/go/vision/apiv1p4beta1/visionpb;visionpb\xf8\x01\x01\xa2\x02\x04GCVNb\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module Vision + module V1p4beta1 + Vertex = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p4beta1.Vertex").msgclass + NormalizedVertex = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p4beta1.NormalizedVertex").msgclass + BoundingPoly = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p4beta1.BoundingPoly").msgclass + Position = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p4beta1.Position").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1/image_annotator.rb b/owl-bot-staging/google-cloud-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1/image_annotator.rb new file mode 100644 index 000000000000..1d62da930e19 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1/image_annotator.rb @@ -0,0 +1,58 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/vision/v1p4beta1/version" + +require "google/cloud/vision/v1p4beta1/image_annotator/credentials" +require "google/cloud/vision/v1p4beta1/image_annotator/paths" +require "google/cloud/vision/v1p4beta1/image_annotator/operations" +require "google/cloud/vision/v1p4beta1/image_annotator/client" +require "google/cloud/vision/v1p4beta1/image_annotator/rest" + +module Google + module Cloud + module Vision + module V1p4beta1 + ## + # Service that performs Google Cloud Vision API detection tasks over client + # images, such as face, landmark, logo, label, and text detection. The + # ImageAnnotator service returns detected entities from the images. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/vision/v1p4beta1/image_annotator" + # client = ::Google::Cloud::Vision::V1p4beta1::ImageAnnotator::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/vision/v1p4beta1/image_annotator/rest" + # client = ::Google::Cloud::Vision::V1p4beta1::ImageAnnotator::Rest::Client.new + # + module ImageAnnotator + end + end + end + end +end + +helper_path = ::File.join __dir__, "image_annotator", "helpers.rb" +require "google/cloud/vision/v1p4beta1/image_annotator/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1/image_annotator/client.rb b/owl-bot-staging/google-cloud-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1/image_annotator/client.rb new file mode 100644 index 000000000000..aa8219bcc679 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1/image_annotator/client.rb @@ -0,0 +1,794 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/vision/v1p4beta1/image_annotator_pb" + +module Google + module Cloud + module Vision + module V1p4beta1 + module ImageAnnotator + ## + # Client for the ImageAnnotator service. + # + # Service that performs Google Cloud Vision API detection tasks over client + # images, such as face, landmark, logo, label, and text detection. The + # ImageAnnotator service returns detected entities from the images. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "vision.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :image_annotator_stub + + ## + # Configure the ImageAnnotator Client class. + # + # See {::Google::Cloud::Vision::V1p4beta1::ImageAnnotator::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all ImageAnnotator clients + # ::Google::Cloud::Vision::V1p4beta1::ImageAnnotator::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", "Vision", "V1p4beta1"] + 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.batch_annotate_images.timeout = 600.0 + default_config.rpcs.batch_annotate_images.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [] + } + + default_config.rpcs.batch_annotate_files.timeout = 600.0 + default_config.rpcs.batch_annotate_files.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [] + } + + default_config.rpcs.async_batch_annotate_images.timeout = 600.0 + default_config.rpcs.async_batch_annotate_images.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [] + } + + default_config.rpcs.async_batch_annotate_files.timeout = 600.0 + default_config.rpcs.async_batch_annotate_files.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the ImageAnnotator 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::Vision::V1p4beta1::ImageAnnotator::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 + @image_annotator_stub.universe_domain + end + + ## + # Create a new ImageAnnotator client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Vision::V1p4beta1::ImageAnnotator::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Vision::V1p4beta1::ImageAnnotator::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the ImageAnnotator 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/vision/v1p4beta1/image_annotator_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 + + @image_annotator_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::Vision::V1p4beta1::ImageAnnotator::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 + ) + + @image_annotator_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 + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::Vision::V1p4beta1::ImageAnnotator::Operations] + # + attr_reader :operations_client + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @image_annotator_stub.logger + end + + # Service calls + + ## + # Run image detection and annotation for a batch of images. + # + # @overload batch_annotate_images(request, options = nil) + # Pass arguments to `batch_annotate_images` via a request object, either of type + # {::Google::Cloud::Vision::V1p4beta1::BatchAnnotateImagesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Vision::V1p4beta1::BatchAnnotateImagesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload batch_annotate_images(requests: nil) + # Pass arguments to `batch_annotate_images` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param requests [::Array<::Google::Cloud::Vision::V1p4beta1::AnnotateImageRequest, ::Hash>] + # Required. Individual image annotation requests for this batch. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Vision::V1p4beta1::BatchAnnotateImagesResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Vision::V1p4beta1::BatchAnnotateImagesResponse] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/vision/v1p4beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Vision::V1p4beta1::ImageAnnotator::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Vision::V1p4beta1::BatchAnnotateImagesRequest.new + # + # # Call the batch_annotate_images method. + # result = client.batch_annotate_images request + # + # # The returned object is of type Google::Cloud::Vision::V1p4beta1::BatchAnnotateImagesResponse. + # p result + # + def batch_annotate_images request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Vision::V1p4beta1::BatchAnnotateImagesRequest + + # Converts hash 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.batch_annotate_images.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::Vision::V1p4beta1::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.batch_annotate_images.timeout, + metadata: metadata, + retry_policy: @config.rpcs.batch_annotate_images.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @image_annotator_stub.call_rpc :batch_annotate_images, 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 + + ## + # Service that performs image detection and annotation for a batch of files. + # Now only "application/pdf", "image/tiff" and "image/gif" are supported. + # + # This service will extract at most 5 (customers can specify which 5 in + # AnnotateFileRequest.pages) frames (gif) or pages (pdf or tiff) from each + # file provided and perform detection and annotation for each image + # extracted. + # + # @overload batch_annotate_files(request, options = nil) + # Pass arguments to `batch_annotate_files` via a request object, either of type + # {::Google::Cloud::Vision::V1p4beta1::BatchAnnotateFilesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Vision::V1p4beta1::BatchAnnotateFilesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload batch_annotate_files(requests: nil) + # Pass arguments to `batch_annotate_files` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param requests [::Array<::Google::Cloud::Vision::V1p4beta1::AnnotateFileRequest, ::Hash>] + # Required. The list of file annotation requests. Right now we support only + # one AnnotateFileRequest in BatchAnnotateFilesRequest. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Vision::V1p4beta1::BatchAnnotateFilesResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Vision::V1p4beta1::BatchAnnotateFilesResponse] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/vision/v1p4beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Vision::V1p4beta1::ImageAnnotator::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Vision::V1p4beta1::BatchAnnotateFilesRequest.new + # + # # Call the batch_annotate_files method. + # result = client.batch_annotate_files request + # + # # The returned object is of type Google::Cloud::Vision::V1p4beta1::BatchAnnotateFilesResponse. + # p result + # + def batch_annotate_files request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Vision::V1p4beta1::BatchAnnotateFilesRequest + + # Converts hash 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.batch_annotate_files.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::Vision::V1p4beta1::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.batch_annotate_files.timeout, + metadata: metadata, + retry_policy: @config.rpcs.batch_annotate_files.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @image_annotator_stub.call_rpc :batch_annotate_files, 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 + + ## + # Run asynchronous image detection and annotation for a list of images. + # + # Progress and results can be retrieved through the + # `google.longrunning.Operations` interface. + # `Operation.metadata` contains `OperationMetadata` (metadata). + # `Operation.response` contains `AsyncBatchAnnotateImagesResponse` (results). + # + # This service will write image annotation outputs to json files in customer + # GCS bucket, each json file containing BatchAnnotateImagesResponse proto. + # + # @overload async_batch_annotate_images(request, options = nil) + # Pass arguments to `async_batch_annotate_images` via a request object, either of type + # {::Google::Cloud::Vision::V1p4beta1::AsyncBatchAnnotateImagesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Vision::V1p4beta1::AsyncBatchAnnotateImagesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload async_batch_annotate_images(requests: nil, output_config: nil) + # Pass arguments to `async_batch_annotate_images` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param requests [::Array<::Google::Cloud::Vision::V1p4beta1::AnnotateImageRequest, ::Hash>] + # Required. Individual image annotation requests for this batch. + # @param output_config [::Google::Cloud::Vision::V1p4beta1::OutputConfig, ::Hash] + # Required. The desired output location and metadata (e.g. format). + # + # @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/vision/v1p4beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Vision::V1p4beta1::ImageAnnotator::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Vision::V1p4beta1::AsyncBatchAnnotateImagesRequest.new + # + # # Call the async_batch_annotate_images method. + # result = client.async_batch_annotate_images 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 async_batch_annotate_images request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Vision::V1p4beta1::AsyncBatchAnnotateImagesRequest + + # Converts hash 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.async_batch_annotate_images.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::Vision::V1p4beta1::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.async_batch_annotate_images.timeout, + metadata: metadata, + retry_policy: @config.rpcs.async_batch_annotate_images.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @image_annotator_stub.call_rpc :async_batch_annotate_images, 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 + + ## + # Run asynchronous image detection and annotation for a list of generic + # files, such as PDF files, which may contain multiple pages and multiple + # images per page. Progress and results can be retrieved through the + # `google.longrunning.Operations` interface. + # `Operation.metadata` contains `OperationMetadata` (metadata). + # `Operation.response` contains `AsyncBatchAnnotateFilesResponse` (results). + # + # @overload async_batch_annotate_files(request, options = nil) + # Pass arguments to `async_batch_annotate_files` via a request object, either of type + # {::Google::Cloud::Vision::V1p4beta1::AsyncBatchAnnotateFilesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Vision::V1p4beta1::AsyncBatchAnnotateFilesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload async_batch_annotate_files(requests: nil) + # Pass arguments to `async_batch_annotate_files` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param requests [::Array<::Google::Cloud::Vision::V1p4beta1::AsyncAnnotateFileRequest, ::Hash>] + # Required. Individual async file annotation requests for this batch. + # + # @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/vision/v1p4beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Vision::V1p4beta1::ImageAnnotator::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Vision::V1p4beta1::AsyncBatchAnnotateFilesRequest.new + # + # # Call the async_batch_annotate_files method. + # result = client.async_batch_annotate_files 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 async_batch_annotate_files request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Vision::V1p4beta1::AsyncBatchAnnotateFilesRequest + + # Converts hash 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.async_batch_annotate_files.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::Vision::V1p4beta1::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.async_batch_annotate_files.timeout, + metadata: metadata, + retry_policy: @config.rpcs.async_batch_annotate_files.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @image_annotator_stub.call_rpc :async_batch_annotate_files, 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 ImageAnnotator API. + # + # This class represents the configuration for ImageAnnotator, + # 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::Vision::V1p4beta1::ImageAnnotator::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 + # # batch_annotate_images to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Vision::V1p4beta1::ImageAnnotator::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.batch_annotate_images.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Vision::V1p4beta1::ImageAnnotator::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.batch_annotate_images.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::Vision::V1p4beta1::ImageAnnotator::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 = "vision.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 ImageAnnotator 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 `batch_annotate_images` + # @return [::Gapic::Config::Method] + # + attr_reader :batch_annotate_images + ## + # RPC-specific configuration for `batch_annotate_files` + # @return [::Gapic::Config::Method] + # + attr_reader :batch_annotate_files + ## + # RPC-specific configuration for `async_batch_annotate_images` + # @return [::Gapic::Config::Method] + # + attr_reader :async_batch_annotate_images + ## + # RPC-specific configuration for `async_batch_annotate_files` + # @return [::Gapic::Config::Method] + # + attr_reader :async_batch_annotate_files + + # @private + def initialize parent_rpcs = nil + batch_annotate_images_config = parent_rpcs.batch_annotate_images if parent_rpcs.respond_to? :batch_annotate_images + @batch_annotate_images = ::Gapic::Config::Method.new batch_annotate_images_config + batch_annotate_files_config = parent_rpcs.batch_annotate_files if parent_rpcs.respond_to? :batch_annotate_files + @batch_annotate_files = ::Gapic::Config::Method.new batch_annotate_files_config + async_batch_annotate_images_config = parent_rpcs.async_batch_annotate_images if parent_rpcs.respond_to? :async_batch_annotate_images + @async_batch_annotate_images = ::Gapic::Config::Method.new async_batch_annotate_images_config + async_batch_annotate_files_config = parent_rpcs.async_batch_annotate_files if parent_rpcs.respond_to? :async_batch_annotate_files + @async_batch_annotate_files = ::Gapic::Config::Method.new async_batch_annotate_files_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1/image_annotator/credentials.rb b/owl-bot-staging/google-cloud-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1/image_annotator/credentials.rb new file mode 100644 index 000000000000..e4193e52b799 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1/image_annotator/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 Vision + module V1p4beta1 + module ImageAnnotator + # Credentials for the ImageAnnotator API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-vision" + ] + self.env_vars = [ + "VISION_CREDENTIALS", + "VISION_KEYFILE", + "GOOGLE_CLOUD_CREDENTIALS", + "GOOGLE_CLOUD_KEYFILE", + "GCLOUD_KEYFILE", + "VISION_CREDENTIALS_JSON", + "VISION_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-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1/image_annotator/operations.rb b/owl-bot-staging/google-cloud-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1/image_annotator/operations.rb new file mode 100644 index 000000000000..2ad367b5c005 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1/image_annotator/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 Vision + module V1p4beta1 + module ImageAnnotator + # Service that implements Longrunning Operations API. + class Operations + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "vision.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :operations_stub + + ## + # Configuration for the ImageAnnotator 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 ImageAnnotator 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::Vision::V1p4beta1::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::Vision::V1p4beta1::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::Vision::V1p4beta1::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::Vision::V1p4beta1::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::Vision::V1p4beta1::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 = "vision.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-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1/image_annotator/paths.rb b/owl-bot-staging/google-cloud-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1/image_annotator/paths.rb new file mode 100644 index 000000000000..853dee7b526d --- /dev/null +++ b/owl-bot-staging/google-cloud-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1/image_annotator/paths.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! + + +module Google + module Cloud + module Vision + module V1p4beta1 + module ImageAnnotator + # Path helper methods for the ImageAnnotator API. + module Paths + ## + # Create a fully-qualified ProductSet resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/productSets/{product_set}` + # + # @param project [String] + # @param location [String] + # @param product_set [String] + # + # @return [::String] + def product_set_path project:, location:, product_set: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/productSets/#{product_set}" + end + + extend self + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1/image_annotator/rest.rb b/owl-bot-staging/google-cloud-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1/image_annotator/rest.rb new file mode 100644 index 000000000000..bb924636f07e --- /dev/null +++ b/owl-bot-staging/google-cloud-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1/image_annotator/rest.rb @@ -0,0 +1,55 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/vision/v1p4beta1/version" + +require "google/cloud/vision/v1p4beta1/image_annotator/credentials" +require "google/cloud/vision/v1p4beta1/image_annotator/paths" +require "google/cloud/vision/v1p4beta1/image_annotator/rest/operations" +require "google/cloud/vision/v1p4beta1/image_annotator/rest/client" + +module Google + module Cloud + module Vision + module V1p4beta1 + ## + # Service that performs Google Cloud Vision API detection tasks over client + # images, such as face, landmark, logo, label, and text detection. The + # ImageAnnotator service returns detected entities from the images. + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/vision/v1p4beta1/image_annotator/rest" + # client = ::Google::Cloud::Vision::V1p4beta1::ImageAnnotator::Rest::Client.new + # + module ImageAnnotator + # Client for the REST transport + module Rest + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "rest", "helpers.rb" +require "google/cloud/vision/v1p4beta1/image_annotator/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1/image_annotator/rest/client.rb b/owl-bot-staging/google-cloud-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1/image_annotator/rest/client.rb new file mode 100644 index 000000000000..6b4c7032b4bb --- /dev/null +++ b/owl-bot-staging/google-cloud-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1/image_annotator/rest/client.rb @@ -0,0 +1,755 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/vision/v1p4beta1/image_annotator_pb" +require "google/cloud/vision/v1p4beta1/image_annotator/rest/service_stub" + +module Google + module Cloud + module Vision + module V1p4beta1 + module ImageAnnotator + module Rest + ## + # REST client for the ImageAnnotator service. + # + # Service that performs Google Cloud Vision API detection tasks over client + # images, such as face, landmark, logo, label, and text detection. The + # ImageAnnotator service returns detected entities from the images. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "vision.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :image_annotator_stub + + ## + # Configure the ImageAnnotator Client class. + # + # See {::Google::Cloud::Vision::V1p4beta1::ImageAnnotator::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all ImageAnnotator clients + # ::Google::Cloud::Vision::V1p4beta1::ImageAnnotator::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", "Vision", "V1p4beta1"] + 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.batch_annotate_images.timeout = 600.0 + default_config.rpcs.batch_annotate_images.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [] + } + + default_config.rpcs.batch_annotate_files.timeout = 600.0 + default_config.rpcs.batch_annotate_files.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [] + } + + default_config.rpcs.async_batch_annotate_images.timeout = 600.0 + default_config.rpcs.async_batch_annotate_images.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [] + } + + default_config.rpcs.async_batch_annotate_files.timeout = 600.0 + default_config.rpcs.async_batch_annotate_files.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the ImageAnnotator 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::Vision::V1p4beta1::ImageAnnotator::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 + @image_annotator_stub.universe_domain + end + + ## + # Create a new ImageAnnotator REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Vision::V1p4beta1::ImageAnnotator::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Vision::V1p4beta1::ImageAnnotator::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the ImageAnnotator 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::Vision::V1p4beta1::ImageAnnotator::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 + + @image_annotator_stub = ::Google::Cloud::Vision::V1p4beta1::ImageAnnotator::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials, + logger: @config.logger + ) + + @image_annotator_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 + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::Vision::V1p4beta1::ImageAnnotator::Rest::Operations] + # + attr_reader :operations_client + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @image_annotator_stub.logger + end + + # Service calls + + ## + # Run image detection and annotation for a batch of images. + # + # @overload batch_annotate_images(request, options = nil) + # Pass arguments to `batch_annotate_images` via a request object, either of type + # {::Google::Cloud::Vision::V1p4beta1::BatchAnnotateImagesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Vision::V1p4beta1::BatchAnnotateImagesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload batch_annotate_images(requests: nil) + # Pass arguments to `batch_annotate_images` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param requests [::Array<::Google::Cloud::Vision::V1p4beta1::AnnotateImageRequest, ::Hash>] + # Required. Individual image annotation requests for this batch. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Vision::V1p4beta1::BatchAnnotateImagesResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Vision::V1p4beta1::BatchAnnotateImagesResponse] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/vision/v1p4beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Vision::V1p4beta1::ImageAnnotator::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Vision::V1p4beta1::BatchAnnotateImagesRequest.new + # + # # Call the batch_annotate_images method. + # result = client.batch_annotate_images request + # + # # The returned object is of type Google::Cloud::Vision::V1p4beta1::BatchAnnotateImagesResponse. + # p result + # + def batch_annotate_images request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Vision::V1p4beta1::BatchAnnotateImagesRequest + + # Converts hash 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.batch_annotate_images.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::Vision::V1p4beta1::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.batch_annotate_images.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.batch_annotate_images.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @image_annotator_stub.batch_annotate_images 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 + + ## + # Service that performs image detection and annotation for a batch of files. + # Now only "application/pdf", "image/tiff" and "image/gif" are supported. + # + # This service will extract at most 5 (customers can specify which 5 in + # AnnotateFileRequest.pages) frames (gif) or pages (pdf or tiff) from each + # file provided and perform detection and annotation for each image + # extracted. + # + # @overload batch_annotate_files(request, options = nil) + # Pass arguments to `batch_annotate_files` via a request object, either of type + # {::Google::Cloud::Vision::V1p4beta1::BatchAnnotateFilesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Vision::V1p4beta1::BatchAnnotateFilesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload batch_annotate_files(requests: nil) + # Pass arguments to `batch_annotate_files` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param requests [::Array<::Google::Cloud::Vision::V1p4beta1::AnnotateFileRequest, ::Hash>] + # Required. The list of file annotation requests. Right now we support only + # one AnnotateFileRequest in BatchAnnotateFilesRequest. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Vision::V1p4beta1::BatchAnnotateFilesResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Vision::V1p4beta1::BatchAnnotateFilesResponse] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/vision/v1p4beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Vision::V1p4beta1::ImageAnnotator::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Vision::V1p4beta1::BatchAnnotateFilesRequest.new + # + # # Call the batch_annotate_files method. + # result = client.batch_annotate_files request + # + # # The returned object is of type Google::Cloud::Vision::V1p4beta1::BatchAnnotateFilesResponse. + # p result + # + def batch_annotate_files request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Vision::V1p4beta1::BatchAnnotateFilesRequest + + # Converts hash 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.batch_annotate_files.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::Vision::V1p4beta1::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.batch_annotate_files.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.batch_annotate_files.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @image_annotator_stub.batch_annotate_files 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 + + ## + # Run asynchronous image detection and annotation for a list of images. + # + # Progress and results can be retrieved through the + # `google.longrunning.Operations` interface. + # `Operation.metadata` contains `OperationMetadata` (metadata). + # `Operation.response` contains `AsyncBatchAnnotateImagesResponse` (results). + # + # This service will write image annotation outputs to json files in customer + # GCS bucket, each json file containing BatchAnnotateImagesResponse proto. + # + # @overload async_batch_annotate_images(request, options = nil) + # Pass arguments to `async_batch_annotate_images` via a request object, either of type + # {::Google::Cloud::Vision::V1p4beta1::AsyncBatchAnnotateImagesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Vision::V1p4beta1::AsyncBatchAnnotateImagesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload async_batch_annotate_images(requests: nil, output_config: nil) + # Pass arguments to `async_batch_annotate_images` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param requests [::Array<::Google::Cloud::Vision::V1p4beta1::AnnotateImageRequest, ::Hash>] + # Required. Individual image annotation requests for this batch. + # @param output_config [::Google::Cloud::Vision::V1p4beta1::OutputConfig, ::Hash] + # Required. The desired output location and metadata (e.g. format). + # @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/vision/v1p4beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Vision::V1p4beta1::ImageAnnotator::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Vision::V1p4beta1::AsyncBatchAnnotateImagesRequest.new + # + # # Call the async_batch_annotate_images method. + # result = client.async_batch_annotate_images 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 async_batch_annotate_images request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Vision::V1p4beta1::AsyncBatchAnnotateImagesRequest + + # Converts hash 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.async_batch_annotate_images.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::Vision::V1p4beta1::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.async_batch_annotate_images.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.async_batch_annotate_images.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @image_annotator_stub.async_batch_annotate_images 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 + + ## + # Run asynchronous image detection and annotation for a list of generic + # files, such as PDF files, which may contain multiple pages and multiple + # images per page. Progress and results can be retrieved through the + # `google.longrunning.Operations` interface. + # `Operation.metadata` contains `OperationMetadata` (metadata). + # `Operation.response` contains `AsyncBatchAnnotateFilesResponse` (results). + # + # @overload async_batch_annotate_files(request, options = nil) + # Pass arguments to `async_batch_annotate_files` via a request object, either of type + # {::Google::Cloud::Vision::V1p4beta1::AsyncBatchAnnotateFilesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Vision::V1p4beta1::AsyncBatchAnnotateFilesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload async_batch_annotate_files(requests: nil) + # Pass arguments to `async_batch_annotate_files` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param requests [::Array<::Google::Cloud::Vision::V1p4beta1::AsyncAnnotateFileRequest, ::Hash>] + # Required. Individual async file annotation requests for this batch. + # @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/vision/v1p4beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Vision::V1p4beta1::ImageAnnotator::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Vision::V1p4beta1::AsyncBatchAnnotateFilesRequest.new + # + # # Call the async_batch_annotate_files method. + # result = client.async_batch_annotate_files 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 async_batch_annotate_files request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Vision::V1p4beta1::AsyncBatchAnnotateFilesRequest + + # Converts hash 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.async_batch_annotate_files.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::Vision::V1p4beta1::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.async_batch_annotate_files.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.async_batch_annotate_files.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @image_annotator_stub.async_batch_annotate_files 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 + + ## + # Configuration class for the ImageAnnotator REST API. + # + # This class represents the configuration for ImageAnnotator 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::Vision::V1p4beta1::ImageAnnotator::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 + # # batch_annotate_images to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Vision::V1p4beta1::ImageAnnotator::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.batch_annotate_images.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Vision::V1p4beta1::ImageAnnotator::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.batch_annotate_images.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 = "vision.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 ImageAnnotator 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 `batch_annotate_images` + # @return [::Gapic::Config::Method] + # + attr_reader :batch_annotate_images + ## + # RPC-specific configuration for `batch_annotate_files` + # @return [::Gapic::Config::Method] + # + attr_reader :batch_annotate_files + ## + # RPC-specific configuration for `async_batch_annotate_images` + # @return [::Gapic::Config::Method] + # + attr_reader :async_batch_annotate_images + ## + # RPC-specific configuration for `async_batch_annotate_files` + # @return [::Gapic::Config::Method] + # + attr_reader :async_batch_annotate_files + + # @private + def initialize parent_rpcs = nil + batch_annotate_images_config = parent_rpcs.batch_annotate_images if parent_rpcs.respond_to? :batch_annotate_images + @batch_annotate_images = ::Gapic::Config::Method.new batch_annotate_images_config + batch_annotate_files_config = parent_rpcs.batch_annotate_files if parent_rpcs.respond_to? :batch_annotate_files + @batch_annotate_files = ::Gapic::Config::Method.new batch_annotate_files_config + async_batch_annotate_images_config = parent_rpcs.async_batch_annotate_images if parent_rpcs.respond_to? :async_batch_annotate_images + @async_batch_annotate_images = ::Gapic::Config::Method.new async_batch_annotate_images_config + async_batch_annotate_files_config = parent_rpcs.async_batch_annotate_files if parent_rpcs.respond_to? :async_batch_annotate_files + @async_batch_annotate_files = ::Gapic::Config::Method.new async_batch_annotate_files_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1/image_annotator/rest/operations.rb b/owl-bot-staging/google-cloud-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1/image_annotator/rest/operations.rb new file mode 100644 index 000000000000..40d87bee3397 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1/image_annotator/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 Vision + module V1p4beta1 + module ImageAnnotator + module Rest + # Service that implements Longrunning Operations API. + class Operations + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "vision.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :operations_stub + + ## + # Configuration for the ImageAnnotator 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 ImageAnnotator 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::Vision::V1p4beta1::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::Vision::V1p4beta1::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::Vision::V1p4beta1::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::Vision::V1p4beta1::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 = "vision.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{^operations(?:/.*)?$}, true] + ] + ) + 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-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1/image_annotator/rest/service_stub.rb b/owl-bot-staging/google-cloud-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1/image_annotator/rest/service_stub.rb new file mode 100644 index 000000000000..1f7eefd44806 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1/image_annotator/rest/service_stub.rb @@ -0,0 +1,321 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/vision/v1p4beta1/image_annotator_pb" + +module Google + module Cloud + module Vision + module V1p4beta1 + module ImageAnnotator + module Rest + ## + # REST service stub for the ImageAnnotator 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 batch_annotate_images REST call + # + # @param request_pb [::Google::Cloud::Vision::V1p4beta1::BatchAnnotateImagesRequest] + # 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::Vision::V1p4beta1::BatchAnnotateImagesResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Vision::V1p4beta1::BatchAnnotateImagesResponse] + # A result object deserialized from the server's reply + def batch_annotate_images request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_batch_annotate_images_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: "batch_annotate_images", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Vision::V1p4beta1::BatchAnnotateImagesResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the batch_annotate_files REST call + # + # @param request_pb [::Google::Cloud::Vision::V1p4beta1::BatchAnnotateFilesRequest] + # 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::Vision::V1p4beta1::BatchAnnotateFilesResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Vision::V1p4beta1::BatchAnnotateFilesResponse] + # A result object deserialized from the server's reply + def batch_annotate_files request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_batch_annotate_files_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: "batch_annotate_files", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Vision::V1p4beta1::BatchAnnotateFilesResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the async_batch_annotate_images REST call + # + # @param request_pb [::Google::Cloud::Vision::V1p4beta1::AsyncBatchAnnotateImagesRequest] + # 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 async_batch_annotate_images request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_async_batch_annotate_images_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: "async_batch_annotate_images", + 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 async_batch_annotate_files REST call + # + # @param request_pb [::Google::Cloud::Vision::V1p4beta1::AsyncBatchAnnotateFilesRequest] + # 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 async_batch_annotate_files request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_async_batch_annotate_files_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: "async_batch_annotate_files", + 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 + + ## + # @private + # + # GRPC transcoding helper method for the batch_annotate_images REST call + # + # @param request_pb [::Google::Cloud::Vision::V1p4beta1::BatchAnnotateImagesRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_batch_annotate_images_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1p4beta1/images:annotate", + body: "*", + matches: [] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the batch_annotate_files REST call + # + # @param request_pb [::Google::Cloud::Vision::V1p4beta1::BatchAnnotateFilesRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_batch_annotate_files_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1p4beta1/files:annotate", + body: "*", + matches: [] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the async_batch_annotate_images REST call + # + # @param request_pb [::Google::Cloud::Vision::V1p4beta1::AsyncBatchAnnotateImagesRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_async_batch_annotate_images_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1p4beta1/images:asyncBatchAnnotate", + body: "*", + matches: [] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the async_batch_annotate_files REST call + # + # @param request_pb [::Google::Cloud::Vision::V1p4beta1::AsyncBatchAnnotateFilesRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_async_batch_annotate_files_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1p4beta1/files:asyncBatchAnnotate", + body: "*", + matches: [] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1/image_annotator_pb.rb b/owl-bot-staging/google-cloud-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1/image_annotator_pb.rb new file mode 100644 index 000000000000..e0b4ceeefcd7 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1/image_annotator_pb.rb @@ -0,0 +1,78 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/vision/v1p4beta1/image_annotator.proto + +require 'google/protobuf' + +require 'google/api/annotations_pb' +require 'google/api/client_pb' +require 'google/api/field_behavior_pb' +require 'google/cloud/vision/v1p4beta1/face_pb' +require 'google/cloud/vision/v1p4beta1/geometry_pb' +require 'google/cloud/vision/v1p4beta1/product_search_pb' +require 'google/cloud/vision/v1p4beta1/text_annotation_pb' +require 'google/cloud/vision/v1p4beta1/web_detection_pb' +require 'google/longrunning/operations_pb' +require 'google/protobuf/timestamp_pb' +require 'google/rpc/status_pb' +require 'google/type/color_pb' +require 'google/type/latlng_pb' + + +descriptor_data = "\n3google/cloud/vision/v1p4beta1/image_annotator.proto\x12\x1dgoogle.cloud.vision.v1p4beta1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a(google/cloud/vision/v1p4beta1/face.proto\x1a,google/cloud/vision/v1p4beta1/geometry.proto\x1a\x32google/cloud/vision/v1p4beta1/product_search.proto\x1a\x33google/cloud/vision/v1p4beta1/text_annotation.proto\x1a\x31google/cloud/vision/v1p4beta1/web_detection.proto\x1a#google/longrunning/operations.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x17google/rpc/status.proto\x1a\x17google/type/color.proto\x1a\x18google/type/latlng.proto\"\x8e\x03\n\x07\x46\x65\x61ture\x12\x39\n\x04type\x18\x01 \x01(\x0e\x32+.google.cloud.vision.v1p4beta1.Feature.Type\x12\x13\n\x0bmax_results\x18\x02 \x01(\x05\x12\r\n\x05model\x18\x03 \x01(\t\"\xa3\x02\n\x04Type\x12\x14\n\x10TYPE_UNSPECIFIED\x10\x00\x12\x12\n\x0e\x46\x41\x43\x45_DETECTION\x10\x01\x12\x16\n\x12LANDMARK_DETECTION\x10\x02\x12\x12\n\x0eLOGO_DETECTION\x10\x03\x12\x13\n\x0fLABEL_DETECTION\x10\x04\x12\x12\n\x0eTEXT_DETECTION\x10\x05\x12\x1b\n\x17\x44OCUMENT_TEXT_DETECTION\x10\x0b\x12\x19\n\x15SAFE_SEARCH_DETECTION\x10\x06\x12\x14\n\x10IMAGE_PROPERTIES\x10\x07\x12\x0e\n\nCROP_HINTS\x10\t\x12\x11\n\rWEB_DETECTION\x10\n\x12\x12\n\x0ePRODUCT_SEARCH\x10\x0c\x12\x17\n\x13OBJECT_LOCALIZATION\x10\x13\"7\n\x0bImageSource\x12\x15\n\rgcs_image_uri\x18\x01 \x01(\t\x12\x11\n\timage_uri\x18\x02 \x01(\t\"T\n\x05Image\x12\x0f\n\x07\x63ontent\x18\x01 \x01(\x0c\x12:\n\x06source\x18\x02 \x01(\x0b\x32*.google.cloud.vision.v1p4beta1.ImageSource\"\xed\x0e\n\x0e\x46\x61\x63\x65\x41nnotation\x12\x42\n\rbounding_poly\x18\x01 \x01(\x0b\x32+.google.cloud.vision.v1p4beta1.BoundingPoly\x12\x45\n\x10\x66\x64_bounding_poly\x18\x02 \x01(\x0b\x32+.google.cloud.vision.v1p4beta1.BoundingPoly\x12I\n\tlandmarks\x18\x03 \x03(\x0b\x32\x36.google.cloud.vision.v1p4beta1.FaceAnnotation.Landmark\x12\x12\n\nroll_angle\x18\x04 \x01(\x02\x12\x11\n\tpan_angle\x18\x05 \x01(\x02\x12\x12\n\ntilt_angle\x18\x06 \x01(\x02\x12\x1c\n\x14\x64\x65tection_confidence\x18\x07 \x01(\x02\x12\x1e\n\x16landmarking_confidence\x18\x08 \x01(\x02\x12\x41\n\x0ejoy_likelihood\x18\t \x01(\x0e\x32).google.cloud.vision.v1p4beta1.Likelihood\x12\x44\n\x11sorrow_likelihood\x18\n \x01(\x0e\x32).google.cloud.vision.v1p4beta1.Likelihood\x12\x43\n\x10\x61nger_likelihood\x18\x0b \x01(\x0e\x32).google.cloud.vision.v1p4beta1.Likelihood\x12\x46\n\x13surprise_likelihood\x18\x0c \x01(\x0e\x32).google.cloud.vision.v1p4beta1.Likelihood\x12K\n\x18under_exposed_likelihood\x18\r \x01(\x0e\x32).google.cloud.vision.v1p4beta1.Likelihood\x12\x45\n\x12\x62lurred_likelihood\x18\x0e \x01(\x0e\x32).google.cloud.vision.v1p4beta1.Likelihood\x12\x46\n\x13headwear_likelihood\x18\x0f \x01(\x0e\x32).google.cloud.vision.v1p4beta1.Likelihood\x12P\n\x12recognition_result\x18\x10 \x03(\x0b\x32\x34.google.cloud.vision.v1p4beta1.FaceRecognitionResult\x1a\xc7\x07\n\x08Landmark\x12I\n\x04type\x18\x03 \x01(\x0e\x32;.google.cloud.vision.v1p4beta1.FaceAnnotation.Landmark.Type\x12\x39\n\x08position\x18\x04 \x01(\x0b\x32\'.google.cloud.vision.v1p4beta1.Position\"\xb4\x06\n\x04Type\x12\x14\n\x10UNKNOWN_LANDMARK\x10\x00\x12\x0c\n\x08LEFT_EYE\x10\x01\x12\r\n\tRIGHT_EYE\x10\x02\x12\x18\n\x14LEFT_OF_LEFT_EYEBROW\x10\x03\x12\x19\n\x15RIGHT_OF_LEFT_EYEBROW\x10\x04\x12\x19\n\x15LEFT_OF_RIGHT_EYEBROW\x10\x05\x12\x1a\n\x16RIGHT_OF_RIGHT_EYEBROW\x10\x06\x12\x19\n\x15MIDPOINT_BETWEEN_EYES\x10\x07\x12\x0c\n\x08NOSE_TIP\x10\x08\x12\r\n\tUPPER_LIP\x10\t\x12\r\n\tLOWER_LIP\x10\n\x12\x0e\n\nMOUTH_LEFT\x10\x0b\x12\x0f\n\x0bMOUTH_RIGHT\x10\x0c\x12\x10\n\x0cMOUTH_CENTER\x10\r\x12\x15\n\x11NOSE_BOTTOM_RIGHT\x10\x0e\x12\x14\n\x10NOSE_BOTTOM_LEFT\x10\x0f\x12\x16\n\x12NOSE_BOTTOM_CENTER\x10\x10\x12\x19\n\x15LEFT_EYE_TOP_BOUNDARY\x10\x11\x12\x19\n\x15LEFT_EYE_RIGHT_CORNER\x10\x12\x12\x1c\n\x18LEFT_EYE_BOTTOM_BOUNDARY\x10\x13\x12\x18\n\x14LEFT_EYE_LEFT_CORNER\x10\x14\x12\x1a\n\x16RIGHT_EYE_TOP_BOUNDARY\x10\x15\x12\x1a\n\x16RIGHT_EYE_RIGHT_CORNER\x10\x16\x12\x1d\n\x19RIGHT_EYE_BOTTOM_BOUNDARY\x10\x17\x12\x19\n\x15RIGHT_EYE_LEFT_CORNER\x10\x18\x12\x1f\n\x1bLEFT_EYEBROW_UPPER_MIDPOINT\x10\x19\x12 \n\x1cRIGHT_EYEBROW_UPPER_MIDPOINT\x10\x1a\x12\x14\n\x10LEFT_EAR_TRAGION\x10\x1b\x12\x15\n\x11RIGHT_EAR_TRAGION\x10\x1c\x12\x12\n\x0eLEFT_EYE_PUPIL\x10\x1d\x12\x13\n\x0fRIGHT_EYE_PUPIL\x10\x1e\x12\x15\n\x11\x46OREHEAD_GLABELLA\x10\x1f\x12\x11\n\rCHIN_GNATHION\x10 \x12\x14\n\x10\x43HIN_LEFT_GONION\x10!\x12\x15\n\x11\x43HIN_RIGHT_GONION\x10\"\"4\n\x0cLocationInfo\x12$\n\x07lat_lng\x18\x01 \x01(\x0b\x32\x13.google.type.LatLng\"=\n\x08Property\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t\x12\x14\n\x0cuint64_value\x18\x03 \x01(\x04\"\xc0\x02\n\x10\x45ntityAnnotation\x12\x0b\n\x03mid\x18\x01 \x01(\t\x12\x0e\n\x06locale\x18\x02 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x03 \x01(\t\x12\r\n\x05score\x18\x04 \x01(\x02\x12\x16\n\nconfidence\x18\x05 \x01(\x02\x42\x02\x18\x01\x12\x12\n\ntopicality\x18\x06 \x01(\x02\x12\x42\n\rbounding_poly\x18\x07 \x01(\x0b\x32+.google.cloud.vision.v1p4beta1.BoundingPoly\x12>\n\tlocations\x18\x08 \x03(\x0b\x32+.google.cloud.vision.v1p4beta1.LocationInfo\x12;\n\nproperties\x18\t \x03(\x0b\x32\'.google.cloud.vision.v1p4beta1.Property\"\xa0\x01\n\x19LocalizedObjectAnnotation\x12\x0b\n\x03mid\x18\x01 \x01(\t\x12\x15\n\rlanguage_code\x18\x02 \x01(\t\x12\x0c\n\x04name\x18\x03 \x01(\t\x12\r\n\x05score\x18\x04 \x01(\x02\x12\x42\n\rbounding_poly\x18\x05 \x01(\x0b\x32+.google.cloud.vision.v1p4beta1.BoundingPoly\"\xbc\x02\n\x14SafeSearchAnnotation\x12\x38\n\x05\x61\x64ult\x18\x01 \x01(\x0e\x32).google.cloud.vision.v1p4beta1.Likelihood\x12\x38\n\x05spoof\x18\x02 \x01(\x0e\x32).google.cloud.vision.v1p4beta1.Likelihood\x12:\n\x07medical\x18\x03 \x01(\x0e\x32).google.cloud.vision.v1p4beta1.Likelihood\x12;\n\x08violence\x18\x04 \x01(\x0e\x32).google.cloud.vision.v1p4beta1.Likelihood\x12\x37\n\x04racy\x18\t \x01(\x0e\x32).google.cloud.vision.v1p4beta1.Likelihood\"a\n\x0bLatLongRect\x12(\n\x0bmin_lat_lng\x18\x01 \x01(\x0b\x32\x13.google.type.LatLng\x12(\n\x0bmax_lat_lng\x18\x02 \x01(\x0b\x32\x13.google.type.LatLng\"U\n\tColorInfo\x12!\n\x05\x63olor\x18\x01 \x01(\x0b\x32\x12.google.type.Color\x12\r\n\x05score\x18\x02 \x01(\x02\x12\x16\n\x0epixel_fraction\x18\x03 \x01(\x02\"T\n\x18\x44ominantColorsAnnotation\x12\x38\n\x06\x63olors\x18\x01 \x03(\x0b\x32(.google.cloud.vision.v1p4beta1.ColorInfo\"c\n\x0fImageProperties\x12P\n\x0f\x64ominant_colors\x18\x01 \x01(\x0b\x32\x37.google.cloud.vision.v1p4beta1.DominantColorsAnnotation\"\x7f\n\x08\x43ropHint\x12\x42\n\rbounding_poly\x18\x01 \x01(\x0b\x32+.google.cloud.vision.v1p4beta1.BoundingPoly\x12\x12\n\nconfidence\x18\x02 \x01(\x02\x12\x1b\n\x13importance_fraction\x18\x03 \x01(\x02\"R\n\x13\x43ropHintsAnnotation\x12;\n\ncrop_hints\x18\x01 \x03(\x0b\x32\'.google.cloud.vision.v1p4beta1.CropHint\"(\n\x0f\x43ropHintsParams\x12\x15\n\raspect_ratios\x18\x01 \x03(\x02\"1\n\x12WebDetectionParams\x12\x1b\n\x13include_geo_results\x18\x02 \x01(\x08\"c\n\x13TextDetectionParams\x12.\n&enable_text_detection_confidence_score\x18\t \x01(\x08\x12\x1c\n\x14\x61\x64vanced_ocr_options\x18\x0b \x03(\t\"\x82\x04\n\x0cImageContext\x12\x41\n\rlat_long_rect\x18\x01 \x01(\x0b\x32*.google.cloud.vision.v1p4beta1.LatLongRect\x12\x16\n\x0elanguage_hints\x18\x02 \x03(\t\x12I\n\x11\x63rop_hints_params\x18\x04 \x01(\x0b\x32..google.cloud.vision.v1p4beta1.CropHintsParams\x12U\n\x17\x66\x61\x63\x65_recognition_params\x18\n \x01(\x0b\x32\x34.google.cloud.vision.v1p4beta1.FaceRecognitionParams\x12Q\n\x15product_search_params\x18\x05 \x01(\x0b\x32\x32.google.cloud.vision.v1p4beta1.ProductSearchParams\x12O\n\x14web_detection_params\x18\x06 \x01(\x0b\x32\x31.google.cloud.vision.v1p4beta1.WebDetectionParams\x12Q\n\x15text_detection_params\x18\x0c \x01(\x0b\x32\x32.google.cloud.vision.v1p4beta1.TextDetectionParams\"\xc9\x01\n\x14\x41nnotateImageRequest\x12\x33\n\x05image\x18\x01 \x01(\x0b\x32$.google.cloud.vision.v1p4beta1.Image\x12\x38\n\x08\x66\x65\x61tures\x18\x02 \x03(\x0b\x32&.google.cloud.vision.v1p4beta1.Feature\x12\x42\n\rimage_context\x18\x03 \x01(\x0b\x32+.google.cloud.vision.v1p4beta1.ImageContext\":\n\x16ImageAnnotationContext\x12\x0b\n\x03uri\x18\x01 \x01(\t\x12\x13\n\x0bpage_number\x18\x02 \x01(\x05\"\xbf\x08\n\x15\x41nnotateImageResponse\x12G\n\x10\x66\x61\x63\x65_annotations\x18\x01 \x03(\x0b\x32-.google.cloud.vision.v1p4beta1.FaceAnnotation\x12M\n\x14landmark_annotations\x18\x02 \x03(\x0b\x32/.google.cloud.vision.v1p4beta1.EntityAnnotation\x12I\n\x10logo_annotations\x18\x03 \x03(\x0b\x32/.google.cloud.vision.v1p4beta1.EntityAnnotation\x12J\n\x11label_annotations\x18\x04 \x03(\x0b\x32/.google.cloud.vision.v1p4beta1.EntityAnnotation\x12^\n\x1clocalized_object_annotations\x18\x16 \x03(\x0b\x32\x38.google.cloud.vision.v1p4beta1.LocalizedObjectAnnotation\x12I\n\x10text_annotations\x18\x05 \x03(\x0b\x32/.google.cloud.vision.v1p4beta1.EntityAnnotation\x12K\n\x14\x66ull_text_annotation\x18\x0c \x01(\x0b\x32-.google.cloud.vision.v1p4beta1.TextAnnotation\x12S\n\x16safe_search_annotation\x18\x06 \x01(\x0b\x32\x33.google.cloud.vision.v1p4beta1.SafeSearchAnnotation\x12S\n\x1bimage_properties_annotation\x18\x08 \x01(\x0b\x32..google.cloud.vision.v1p4beta1.ImageProperties\x12Q\n\x15\x63rop_hints_annotation\x18\x0b \x01(\x0b\x32\x32.google.cloud.vision.v1p4beta1.CropHintsAnnotation\x12\x42\n\rweb_detection\x18\r \x01(\x0b\x32+.google.cloud.vision.v1p4beta1.WebDetection\x12S\n\x16product_search_results\x18\x0e \x01(\x0b\x32\x33.google.cloud.vision.v1p4beta1.ProductSearchResults\x12!\n\x05\x65rror\x18\t \x01(\x0b\x32\x12.google.rpc.Status\x12\x46\n\x07\x63ontext\x18\x15 \x01(\x0b\x32\x35.google.cloud.vision.v1p4beta1.ImageAnnotationContext\"h\n\x1a\x42\x61tchAnnotateImagesRequest\x12J\n\x08requests\x18\x01 \x03(\x0b\x32\x33.google.cloud.vision.v1p4beta1.AnnotateImageRequestB\x03\xe0\x41\x02\"f\n\x1b\x42\x61tchAnnotateImagesResponse\x12G\n\tresponses\x18\x01 \x03(\x0b\x32\x34.google.cloud.vision.v1p4beta1.AnnotateImageResponse\"\xe4\x01\n\x13\x41nnotateFileRequest\x12@\n\x0cinput_config\x18\x01 \x01(\x0b\x32*.google.cloud.vision.v1p4beta1.InputConfig\x12\x38\n\x08\x66\x65\x61tures\x18\x02 \x03(\x0b\x32&.google.cloud.vision.v1p4beta1.Feature\x12\x42\n\rimage_context\x18\x03 \x01(\x0b\x32+.google.cloud.vision.v1p4beta1.ImageContext\x12\r\n\x05pages\x18\x04 \x03(\x05\"\xd9\x01\n\x14\x41nnotateFileResponse\x12@\n\x0cinput_config\x18\x01 \x01(\x0b\x32*.google.cloud.vision.v1p4beta1.InputConfig\x12G\n\tresponses\x18\x02 \x03(\x0b\x32\x34.google.cloud.vision.v1p4beta1.AnnotateImageResponse\x12\x13\n\x0btotal_pages\x18\x03 \x01(\x05\x12!\n\x05\x65rror\x18\x04 \x01(\x0b\x32\x12.google.rpc.Status\"f\n\x19\x42\x61tchAnnotateFilesRequest\x12I\n\x08requests\x18\x01 \x03(\x0b\x32\x32.google.cloud.vision.v1p4beta1.AnnotateFileRequestB\x03\xe0\x41\x02\"d\n\x1a\x42\x61tchAnnotateFilesResponse\x12\x46\n\tresponses\x18\x01 \x03(\x0b\x32\x33.google.cloud.vision.v1p4beta1.AnnotateFileResponse\"\x9e\x02\n\x18\x41syncAnnotateFileRequest\x12@\n\x0cinput_config\x18\x01 \x01(\x0b\x32*.google.cloud.vision.v1p4beta1.InputConfig\x12\x38\n\x08\x66\x65\x61tures\x18\x02 \x03(\x0b\x32&.google.cloud.vision.v1p4beta1.Feature\x12\x42\n\rimage_context\x18\x03 \x01(\x0b\x32+.google.cloud.vision.v1p4beta1.ImageContext\x12\x42\n\routput_config\x18\x04 \x01(\x0b\x32+.google.cloud.vision.v1p4beta1.OutputConfig\"_\n\x19\x41syncAnnotateFileResponse\x12\x42\n\routput_config\x18\x01 \x01(\x0b\x32+.google.cloud.vision.v1p4beta1.OutputConfig\"\xb6\x01\n\x1f\x41syncBatchAnnotateImagesRequest\x12J\n\x08requests\x18\x01 \x03(\x0b\x32\x33.google.cloud.vision.v1p4beta1.AnnotateImageRequestB\x03\xe0\x41\x02\x12G\n\routput_config\x18\x02 \x01(\x0b\x32+.google.cloud.vision.v1p4beta1.OutputConfigB\x03\xe0\x41\x02\"f\n AsyncBatchAnnotateImagesResponse\x12\x42\n\routput_config\x18\x01 \x01(\x0b\x32+.google.cloud.vision.v1p4beta1.OutputConfig\"p\n\x1e\x41syncBatchAnnotateFilesRequest\x12N\n\x08requests\x18\x01 \x03(\x0b\x32\x37.google.cloud.vision.v1p4beta1.AsyncAnnotateFileRequestB\x03\xe0\x41\x02\"n\n\x1f\x41syncBatchAnnotateFilesResponse\x12K\n\tresponses\x18\x01 \x03(\x0b\x32\x38.google.cloud.vision.v1p4beta1.AsyncAnnotateFileResponse\"o\n\x0bInputConfig\x12<\n\ngcs_source\x18\x01 \x01(\x0b\x32(.google.cloud.vision.v1p4beta1.GcsSource\x12\x0f\n\x07\x63ontent\x18\x03 \x01(\x0c\x12\x11\n\tmime_type\x18\x02 \x01(\t\"j\n\x0cOutputConfig\x12\x46\n\x0fgcs_destination\x18\x01 \x01(\x0b\x32-.google.cloud.vision.v1p4beta1.GcsDestination\x12\x12\n\nbatch_size\x18\x02 \x01(\x05\"\x18\n\tGcsSource\x12\x0b\n\x03uri\x18\x01 \x01(\t\"\x1d\n\x0eGcsDestination\x12\x0b\n\x03uri\x18\x01 \x01(\t\"\x8f\x02\n\x11OperationMetadata\x12\x45\n\x05state\x18\x01 \x01(\x0e\x32\x36.google.cloud.vision.v1p4beta1.OperationMetadata.State\x12/\n\x0b\x63reate_time\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12/\n\x0bupdate_time\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"Q\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0b\n\x07\x43REATED\x10\x01\x12\x0b\n\x07RUNNING\x10\x02\x12\x08\n\x04\x44ONE\x10\x03\x12\r\n\tCANCELLED\x10\x04*e\n\nLikelihood\x12\x0b\n\x07UNKNOWN\x10\x00\x12\x11\n\rVERY_UNLIKELY\x10\x01\x12\x0c\n\x08UNLIKELY\x10\x02\x12\x0c\n\x08POSSIBLE\x10\x03\x12\n\n\x06LIKELY\x10\x04\x12\x0f\n\x0bVERY_LIKELY\x10\x05\x32\xf1\x07\n\x0eImageAnnotator\x12\xbe\x01\n\x13\x42\x61tchAnnotateImages\x12\x39.google.cloud.vision.v1p4beta1.BatchAnnotateImagesRequest\x1a:.google.cloud.vision.v1p4beta1.BatchAnnotateImagesResponse\"0\xda\x41\x08requests\x82\xd3\xe4\x93\x02\x1f\"\x1a/v1p4beta1/images:annotate:\x01*\x12\xba\x01\n\x12\x42\x61tchAnnotateFiles\x12\x38.google.cloud.vision.v1p4beta1.BatchAnnotateFilesRequest\x1a\x39.google.cloud.vision.v1p4beta1.BatchAnnotateFilesResponse\"/\xda\x41\x08requests\x82\xd3\xe4\x93\x02\x1e\"\x19/v1p4beta1/files:annotate:\x01*\x12\xfc\x01\n\x18\x41syncBatchAnnotateImages\x12>.google.cloud.vision.v1p4beta1.AsyncBatchAnnotateImagesRequest\x1a\x1d.google.longrunning.Operation\"\x80\x01\xca\x41\x35\n AsyncBatchAnnotateImagesResponse\x12\x11OperationMetadata\xda\x41\x16requests,output_config\x82\xd3\xe4\x93\x02)\"$/v1p4beta1/images:asyncBatchAnnotate:\x01*\x12\xe9\x01\n\x17\x41syncBatchAnnotateFiles\x12=.google.cloud.vision.v1p4beta1.AsyncBatchAnnotateFilesRequest\x1a\x1d.google.longrunning.Operation\"p\xca\x41\x34\n\x1f\x41syncBatchAnnotateFilesResponse\x12\x11OperationMetadata\xda\x41\x08requests\x82\xd3\xe4\x93\x02(\"#/v1p4beta1/files:asyncBatchAnnotate:\x01*\x1av\xca\x41\x15vision.googleapis.com\xd2\x41[https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/cloud-visionB\x7f\n!com.google.cloud.vision.v1p4beta1B\x13ImageAnnotatorProtoP\x01Z9cloud.google.com/go/vision/apiv1p4beta1/visionpb;visionpb\xf8\x01\x01\xa2\x02\x04GCVNb\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module Vision + module V1p4beta1 + Feature = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p4beta1.Feature").msgclass + Feature::Type = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p4beta1.Feature.Type").enummodule + ImageSource = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p4beta1.ImageSource").msgclass + Image = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p4beta1.Image").msgclass + FaceAnnotation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p4beta1.FaceAnnotation").msgclass + FaceAnnotation::Landmark = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p4beta1.FaceAnnotation.Landmark").msgclass + FaceAnnotation::Landmark::Type = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p4beta1.FaceAnnotation.Landmark.Type").enummodule + LocationInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p4beta1.LocationInfo").msgclass + Property = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p4beta1.Property").msgclass + EntityAnnotation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p4beta1.EntityAnnotation").msgclass + LocalizedObjectAnnotation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p4beta1.LocalizedObjectAnnotation").msgclass + SafeSearchAnnotation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p4beta1.SafeSearchAnnotation").msgclass + LatLongRect = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p4beta1.LatLongRect").msgclass + ColorInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p4beta1.ColorInfo").msgclass + DominantColorsAnnotation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p4beta1.DominantColorsAnnotation").msgclass + ImageProperties = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p4beta1.ImageProperties").msgclass + CropHint = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p4beta1.CropHint").msgclass + CropHintsAnnotation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p4beta1.CropHintsAnnotation").msgclass + CropHintsParams = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p4beta1.CropHintsParams").msgclass + WebDetectionParams = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p4beta1.WebDetectionParams").msgclass + TextDetectionParams = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p4beta1.TextDetectionParams").msgclass + ImageContext = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p4beta1.ImageContext").msgclass + AnnotateImageRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p4beta1.AnnotateImageRequest").msgclass + ImageAnnotationContext = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p4beta1.ImageAnnotationContext").msgclass + AnnotateImageResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p4beta1.AnnotateImageResponse").msgclass + BatchAnnotateImagesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p4beta1.BatchAnnotateImagesRequest").msgclass + BatchAnnotateImagesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p4beta1.BatchAnnotateImagesResponse").msgclass + AnnotateFileRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p4beta1.AnnotateFileRequest").msgclass + AnnotateFileResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p4beta1.AnnotateFileResponse").msgclass + BatchAnnotateFilesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p4beta1.BatchAnnotateFilesRequest").msgclass + BatchAnnotateFilesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p4beta1.BatchAnnotateFilesResponse").msgclass + AsyncAnnotateFileRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p4beta1.AsyncAnnotateFileRequest").msgclass + AsyncAnnotateFileResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p4beta1.AsyncAnnotateFileResponse").msgclass + AsyncBatchAnnotateImagesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p4beta1.AsyncBatchAnnotateImagesRequest").msgclass + AsyncBatchAnnotateImagesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p4beta1.AsyncBatchAnnotateImagesResponse").msgclass + AsyncBatchAnnotateFilesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p4beta1.AsyncBatchAnnotateFilesRequest").msgclass + AsyncBatchAnnotateFilesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p4beta1.AsyncBatchAnnotateFilesResponse").msgclass + InputConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p4beta1.InputConfig").msgclass + OutputConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p4beta1.OutputConfig").msgclass + GcsSource = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p4beta1.GcsSource").msgclass + GcsDestination = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p4beta1.GcsDestination").msgclass + OperationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p4beta1.OperationMetadata").msgclass + OperationMetadata::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p4beta1.OperationMetadata.State").enummodule + Likelihood = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p4beta1.Likelihood").enummodule + end + end + end +end diff --git a/owl-bot-staging/google-cloud-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1/image_annotator_services_pb.rb b/owl-bot-staging/google-cloud-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1/image_annotator_services_pb.rb new file mode 100644 index 000000000000..e34e7d914cce --- /dev/null +++ b/owl-bot-staging/google-cloud-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1/image_annotator_services_pb.rb @@ -0,0 +1,73 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/cloud/vision/v1p4beta1/image_annotator.proto for package 'google.cloud.vision.v1p4beta1' +# 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/vision/v1p4beta1/image_annotator_pb' + +module Google + module Cloud + module Vision + module V1p4beta1 + module ImageAnnotator + # Service that performs Google Cloud Vision API detection tasks over client + # images, such as face, landmark, logo, label, and text detection. The + # ImageAnnotator service returns detected entities from the images. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.cloud.vision.v1p4beta1.ImageAnnotator' + + # Run image detection and annotation for a batch of images. + rpc :BatchAnnotateImages, ::Google::Cloud::Vision::V1p4beta1::BatchAnnotateImagesRequest, ::Google::Cloud::Vision::V1p4beta1::BatchAnnotateImagesResponse + # Service that performs image detection and annotation for a batch of files. + # Now only "application/pdf", "image/tiff" and "image/gif" are supported. + # + # This service will extract at most 5 (customers can specify which 5 in + # AnnotateFileRequest.pages) frames (gif) or pages (pdf or tiff) from each + # file provided and perform detection and annotation for each image + # extracted. + rpc :BatchAnnotateFiles, ::Google::Cloud::Vision::V1p4beta1::BatchAnnotateFilesRequest, ::Google::Cloud::Vision::V1p4beta1::BatchAnnotateFilesResponse + # Run asynchronous image detection and annotation for a list of images. + # + # Progress and results can be retrieved through the + # `google.longrunning.Operations` interface. + # `Operation.metadata` contains `OperationMetadata` (metadata). + # `Operation.response` contains `AsyncBatchAnnotateImagesResponse` (results). + # + # This service will write image annotation outputs to json files in customer + # GCS bucket, each json file containing BatchAnnotateImagesResponse proto. + rpc :AsyncBatchAnnotateImages, ::Google::Cloud::Vision::V1p4beta1::AsyncBatchAnnotateImagesRequest, ::Google::Longrunning::Operation + # Run asynchronous image detection and annotation for a list of generic + # files, such as PDF files, which may contain multiple pages and multiple + # images per page. Progress and results can be retrieved through the + # `google.longrunning.Operations` interface. + # `Operation.metadata` contains `OperationMetadata` (metadata). + # `Operation.response` contains `AsyncBatchAnnotateFilesResponse` (results). + rpc :AsyncBatchAnnotateFiles, ::Google::Cloud::Vision::V1p4beta1::AsyncBatchAnnotateFilesRequest, ::Google::Longrunning::Operation + end + + Stub = Service.rpc_stub_class + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1/product_search.rb b/owl-bot-staging/google-cloud-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1/product_search.rb new file mode 100644 index 000000000000..012158d076ed --- /dev/null +++ b/owl-bot-staging/google-cloud-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1/product_search.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/vision/v1p4beta1/version" + +require "google/cloud/vision/v1p4beta1/product_search/credentials" +require "google/cloud/vision/v1p4beta1/product_search/paths" +require "google/cloud/vision/v1p4beta1/product_search/operations" +require "google/cloud/vision/v1p4beta1/product_search/client" +require "google/cloud/vision/v1p4beta1/product_search/rest" + +module Google + module Cloud + module Vision + module V1p4beta1 + ## + # Manages Products and ProductSets of reference images for use in product + # search. It uses the following resource model: + # + # - The API has a collection of + # {::Google::Cloud::Vision::V1p4beta1::ProductSet ProductSet} resources, named + # `projects/*/locations/*/productSets/*`, which acts as a way to put different + # products into groups to limit identification. + # + # In parallel, + # + # - The API has a collection of + # {::Google::Cloud::Vision::V1p4beta1::Product Product} resources, named + # `projects/*/locations/*/products/*` + # + # - Each {::Google::Cloud::Vision::V1p4beta1::Product Product} has a collection of + # {::Google::Cloud::Vision::V1p4beta1::ReferenceImage ReferenceImage} resources, + # named + # `projects/*/locations/*/products/*/referenceImages/*` + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/vision/v1p4beta1/product_search" + # client = ::Google::Cloud::Vision::V1p4beta1::ProductSearch::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/vision/v1p4beta1/product_search/rest" + # client = ::Google::Cloud::Vision::V1p4beta1::ProductSearch::Rest::Client.new + # + module ProductSearch + end + end + end + end +end + +helper_path = ::File.join __dir__, "product_search", "helpers.rb" +require "google/cloud/vision/v1p4beta1/product_search/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1/product_search/client.rb b/owl-bot-staging/google-cloud-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1/product_search/client.rb new file mode 100644 index 000000000000..9813ed9b82d1 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1/product_search/client.rb @@ -0,0 +1,2558 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/vision/v1p4beta1/product_search_service_pb" + +module Google + module Cloud + module Vision + module V1p4beta1 + module ProductSearch + ## + # Client for the ProductSearch service. + # + # Manages Products and ProductSets of reference images for use in product + # search. It uses the following resource model: + # + # - The API has a collection of + # {::Google::Cloud::Vision::V1p4beta1::ProductSet ProductSet} resources, named + # `projects/*/locations/*/productSets/*`, which acts as a way to put different + # products into groups to limit identification. + # + # In parallel, + # + # - The API has a collection of + # {::Google::Cloud::Vision::V1p4beta1::Product Product} resources, named + # `projects/*/locations/*/products/*` + # + # - Each {::Google::Cloud::Vision::V1p4beta1::Product Product} has a collection of + # {::Google::Cloud::Vision::V1p4beta1::ReferenceImage ReferenceImage} resources, + # named + # `projects/*/locations/*/products/*/referenceImages/*` + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "vision.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :product_search_stub + + ## + # Configure the ProductSearch Client class. + # + # See {::Google::Cloud::Vision::V1p4beta1::ProductSearch::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all ProductSearch clients + # ::Google::Cloud::Vision::V1p4beta1::ProductSearch::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", "Vision", "V1p4beta1"] + 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_product_set.timeout = 600.0 + default_config.rpcs.create_product_set.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [] + } + + default_config.rpcs.list_product_sets.timeout = 600.0 + default_config.rpcs.list_product_sets.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.get_product_set.timeout = 600.0 + default_config.rpcs.get_product_set.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.update_product_set.timeout = 600.0 + default_config.rpcs.update_product_set.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [] + } + + default_config.rpcs.delete_product_set.timeout = 600.0 + default_config.rpcs.delete_product_set.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.create_product.timeout = 600.0 + default_config.rpcs.create_product.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [] + } + + default_config.rpcs.list_products.timeout = 600.0 + default_config.rpcs.list_products.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.get_product.timeout = 600.0 + default_config.rpcs.get_product.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.update_product.timeout = 600.0 + default_config.rpcs.update_product.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [] + } + + default_config.rpcs.delete_product.timeout = 600.0 + default_config.rpcs.delete_product.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.create_reference_image.timeout = 600.0 + default_config.rpcs.create_reference_image.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [] + } + + default_config.rpcs.delete_reference_image.timeout = 600.0 + default_config.rpcs.delete_reference_image.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.list_reference_images.timeout = 600.0 + default_config.rpcs.list_reference_images.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.get_reference_image.timeout = 600.0 + default_config.rpcs.get_reference_image.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.add_product_to_product_set.timeout = 600.0 + default_config.rpcs.add_product_to_product_set.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [] + } + + default_config.rpcs.remove_product_from_product_set.timeout = 600.0 + default_config.rpcs.remove_product_from_product_set.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [] + } + + default_config.rpcs.list_products_in_product_set.timeout = 600.0 + default_config.rpcs.list_products_in_product_set.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.import_product_sets.timeout = 600.0 + default_config.rpcs.import_product_sets.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the ProductSearch 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::Vision::V1p4beta1::ProductSearch::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 + @product_search_stub.universe_domain + end + + ## + # Create a new ProductSearch client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Vision::V1p4beta1::ProductSearch::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Vision::V1p4beta1::ProductSearch::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the ProductSearch 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/vision/v1p4beta1/product_search_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 + + @product_search_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::Vision::V1p4beta1::ProductSearch::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 + ) + + @product_search_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 + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::Vision::V1p4beta1::ProductSearch::Operations] + # + attr_reader :operations_client + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @product_search_stub.logger + end + + # Service calls + + ## + # Creates and returns a new ProductSet resource. + # + # Possible errors: + # + # * Returns INVALID_ARGUMENT if display_name is missing, or is longer than + # 4096 characters. + # + # @overload create_product_set(request, options = nil) + # Pass arguments to `create_product_set` via a request object, either of type + # {::Google::Cloud::Vision::V1p4beta1::CreateProductSetRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Vision::V1p4beta1::CreateProductSetRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_product_set(parent: nil, product_set: nil, product_set_id: nil) + # Pass arguments to `create_product_set` via keyword arguments. Note that at + # least one keyword argument is 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 in which the ProductSet should be created. + # + # Format is `projects/PROJECT_ID/locations/LOC_ID`. + # @param product_set [::Google::Cloud::Vision::V1p4beta1::ProductSet, ::Hash] + # Required. The ProductSet to create. + # @param product_set_id [::String] + # A user-supplied resource id for this ProductSet. If set, the server will + # attempt to use this value as the resource id. If it is already in use, an + # error is returned with code ALREADY_EXISTS. Must be at most 128 characters + # long. It cannot contain the character `/`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Vision::V1p4beta1::ProductSet] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Vision::V1p4beta1::ProductSet] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/vision/v1p4beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Vision::V1p4beta1::ProductSearch::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Vision::V1p4beta1::CreateProductSetRequest.new + # + # # Call the create_product_set method. + # result = client.create_product_set request + # + # # The returned object is of type Google::Cloud::Vision::V1p4beta1::ProductSet. + # p result + # + def create_product_set request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Vision::V1p4beta1::CreateProductSetRequest + + # Converts hash 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_product_set.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::Vision::V1p4beta1::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_product_set.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_product_set.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @product_search_stub.call_rpc :create_product_set, 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 ProductSets in an unspecified order. + # + # Possible errors: + # + # * Returns INVALID_ARGUMENT if page_size is greater than 100, or less + # than 1. + # + # @overload list_product_sets(request, options = nil) + # Pass arguments to `list_product_sets` via a request object, either of type + # {::Google::Cloud::Vision::V1p4beta1::ListProductSetsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Vision::V1p4beta1::ListProductSetsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_product_sets(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_product_sets` via keyword arguments. Note that at + # least one keyword argument is 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 from which ProductSets should be listed. + # + # Format is `projects/PROJECT_ID/locations/LOC_ID`. + # @param page_size [::Integer] + # The maximum number of items to return. Default 10, maximum 100. + # @param page_token [::String] + # The next_page_token returned from a previous List request, if any. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Vision::V1p4beta1::ProductSet>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::Vision::V1p4beta1::ProductSet>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/vision/v1p4beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Vision::V1p4beta1::ProductSearch::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Vision::V1p4beta1::ListProductSetsRequest.new + # + # # Call the list_product_sets method. + # result = client.list_product_sets 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::Vision::V1p4beta1::ProductSet. + # p item + # end + # + def list_product_sets request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Vision::V1p4beta1::ListProductSetsRequest + + # Converts hash 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_product_sets.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::Vision::V1p4beta1::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_product_sets.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_product_sets.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @product_search_stub.call_rpc :list_product_sets, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @product_search_stub, :list_product_sets, 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 + + ## + # Gets information associated with a ProductSet. + # + # Possible errors: + # + # * Returns NOT_FOUND if the ProductSet does not exist. + # + # @overload get_product_set(request, options = nil) + # Pass arguments to `get_product_set` via a request object, either of type + # {::Google::Cloud::Vision::V1p4beta1::GetProductSetRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Vision::V1p4beta1::GetProductSetRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_product_set(name: nil) + # Pass arguments to `get_product_set` via keyword arguments. Note that at + # least one keyword argument is 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. Resource name of the ProductSet to get. + # + # Format is: + # `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Vision::V1p4beta1::ProductSet] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Vision::V1p4beta1::ProductSet] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/vision/v1p4beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Vision::V1p4beta1::ProductSearch::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Vision::V1p4beta1::GetProductSetRequest.new + # + # # Call the get_product_set method. + # result = client.get_product_set request + # + # # The returned object is of type Google::Cloud::Vision::V1p4beta1::ProductSet. + # p result + # + def get_product_set request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Vision::V1p4beta1::GetProductSetRequest + + # Converts hash 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_product_set.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::Vision::V1p4beta1::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_product_set.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_product_set.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @product_search_stub.call_rpc :get_product_set, 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 + + ## + # Makes changes to a ProductSet resource. + # Only display_name can be updated currently. + # + # Possible errors: + # + # * Returns NOT_FOUND if the ProductSet does not exist. + # * Returns INVALID_ARGUMENT if display_name is present in update_mask but + # missing from the request or longer than 4096 characters. + # + # @overload update_product_set(request, options = nil) + # Pass arguments to `update_product_set` via a request object, either of type + # {::Google::Cloud::Vision::V1p4beta1::UpdateProductSetRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Vision::V1p4beta1::UpdateProductSetRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_product_set(product_set: nil, update_mask: nil) + # Pass arguments to `update_product_set` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param product_set [::Google::Cloud::Vision::V1p4beta1::ProductSet, ::Hash] + # Required. The ProductSet resource which replaces the one on the server. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # The {::Google::Protobuf::FieldMask FieldMask} that specifies which fields to + # update. + # If update_mask isn't specified, all mutable fields are to be updated. + # Valid mask path is `display_name`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Vision::V1p4beta1::ProductSet] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Vision::V1p4beta1::ProductSet] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/vision/v1p4beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Vision::V1p4beta1::ProductSearch::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Vision::V1p4beta1::UpdateProductSetRequest.new + # + # # Call the update_product_set method. + # result = client.update_product_set request + # + # # The returned object is of type Google::Cloud::Vision::V1p4beta1::ProductSet. + # p result + # + def update_product_set request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Vision::V1p4beta1::UpdateProductSetRequest + + # Converts hash 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_product_set.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::Vision::V1p4beta1::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.product_set&.name + header_params["product_set.name"] = request.product_set.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_product_set.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_product_set.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @product_search_stub.call_rpc :update_product_set, 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 a ProductSet. Products and ReferenceImages in the + # ProductSet are not deleted. + # + # The actual image files are not deleted from Google Cloud Storage. + # + # @overload delete_product_set(request, options = nil) + # Pass arguments to `delete_product_set` via a request object, either of type + # {::Google::Cloud::Vision::V1p4beta1::DeleteProductSetRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Vision::V1p4beta1::DeleteProductSetRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_product_set(name: nil) + # Pass arguments to `delete_product_set` via keyword arguments. Note that at + # least one keyword argument is 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. Resource name of the ProductSet to delete. + # + # Format is: + # `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID` + # + # @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/vision/v1p4beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Vision::V1p4beta1::ProductSearch::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Vision::V1p4beta1::DeleteProductSetRequest.new + # + # # Call the delete_product_set method. + # result = client.delete_product_set request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_product_set request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Vision::V1p4beta1::DeleteProductSetRequest + + # Converts hash 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_product_set.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::Vision::V1p4beta1::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_product_set.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_product_set.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @product_search_stub.call_rpc :delete_product_set, 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 and returns a new product resource. + # + # Possible errors: + # + # * Returns INVALID_ARGUMENT if display_name is missing or longer than 4096 + # characters. + # * Returns INVALID_ARGUMENT if description is longer than 4096 characters. + # * Returns INVALID_ARGUMENT if product_category is missing or invalid. + # + # @overload create_product(request, options = nil) + # Pass arguments to `create_product` via a request object, either of type + # {::Google::Cloud::Vision::V1p4beta1::CreateProductRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Vision::V1p4beta1::CreateProductRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_product(parent: nil, product: nil, product_id: nil) + # Pass arguments to `create_product` via keyword arguments. Note that at + # least one keyword argument is 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 in which the Product should be created. + # + # Format is + # `projects/PROJECT_ID/locations/LOC_ID`. + # @param product [::Google::Cloud::Vision::V1p4beta1::Product, ::Hash] + # Required. The product to create. + # @param product_id [::String] + # A user-supplied resource id for this Product. If set, the server will + # attempt to use this value as the resource id. If it is already in use, an + # error is returned with code ALREADY_EXISTS. Must be at most 128 characters + # long. It cannot contain the character `/`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Vision::V1p4beta1::Product] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Vision::V1p4beta1::Product] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/vision/v1p4beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Vision::V1p4beta1::ProductSearch::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Vision::V1p4beta1::CreateProductRequest.new + # + # # Call the create_product method. + # result = client.create_product request + # + # # The returned object is of type Google::Cloud::Vision::V1p4beta1::Product. + # p result + # + def create_product request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Vision::V1p4beta1::CreateProductRequest + + # Converts hash 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_product.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::Vision::V1p4beta1::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_product.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_product.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @product_search_stub.call_rpc :create_product, 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 products in an unspecified order. + # + # Possible errors: + # + # * Returns INVALID_ARGUMENT if page_size is greater than 100 or less than 1. + # + # @overload list_products(request, options = nil) + # Pass arguments to `list_products` via a request object, either of type + # {::Google::Cloud::Vision::V1p4beta1::ListProductsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Vision::V1p4beta1::ListProductsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_products(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_products` via keyword arguments. Note that at + # least one keyword argument is 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 OR ProductSet from which Products should be listed. + # + # Format: + # `projects/PROJECT_ID/locations/LOC_ID` + # @param page_size [::Integer] + # The maximum number of items to return. Default 10, maximum 100. + # @param page_token [::String] + # The next_page_token returned from a previous List request, if any. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Vision::V1p4beta1::Product>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::Vision::V1p4beta1::Product>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/vision/v1p4beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Vision::V1p4beta1::ProductSearch::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Vision::V1p4beta1::ListProductsRequest.new + # + # # Call the list_products method. + # result = client.list_products 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::Vision::V1p4beta1::Product. + # p item + # end + # + def list_products request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Vision::V1p4beta1::ListProductsRequest + + # Converts hash 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_products.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::Vision::V1p4beta1::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_products.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_products.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @product_search_stub.call_rpc :list_products, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @product_search_stub, :list_products, 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 + + ## + # Gets information associated with a Product. + # + # Possible errors: + # + # * Returns NOT_FOUND if the Product does not exist. + # + # @overload get_product(request, options = nil) + # Pass arguments to `get_product` via a request object, either of type + # {::Google::Cloud::Vision::V1p4beta1::GetProductRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Vision::V1p4beta1::GetProductRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_product(name: nil) + # Pass arguments to `get_product` via keyword arguments. Note that at + # least one keyword argument is 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. Resource name of the Product to get. + # + # Format is: + # `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Vision::V1p4beta1::Product] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Vision::V1p4beta1::Product] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/vision/v1p4beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Vision::V1p4beta1::ProductSearch::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Vision::V1p4beta1::GetProductRequest.new + # + # # Call the get_product method. + # result = client.get_product request + # + # # The returned object is of type Google::Cloud::Vision::V1p4beta1::Product. + # p result + # + def get_product request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Vision::V1p4beta1::GetProductRequest + + # Converts hash 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_product.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::Vision::V1p4beta1::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_product.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_product.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @product_search_stub.call_rpc :get_product, 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 + + ## + # Makes changes to a Product resource. + # Only the `display_name`, `description`, and `labels` fields can be updated + # right now. + # + # If labels are updated, the change will not be reflected in queries until + # the next index time. + # + # Possible errors: + # + # * Returns NOT_FOUND if the Product does not exist. + # * Returns INVALID_ARGUMENT if display_name is present in update_mask but is + # missing from the request or longer than 4096 characters. + # * Returns INVALID_ARGUMENT if description is present in update_mask but is + # longer than 4096 characters. + # * Returns INVALID_ARGUMENT if product_category is present in update_mask. + # + # @overload update_product(request, options = nil) + # Pass arguments to `update_product` via a request object, either of type + # {::Google::Cloud::Vision::V1p4beta1::UpdateProductRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Vision::V1p4beta1::UpdateProductRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_product(product: nil, update_mask: nil) + # Pass arguments to `update_product` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param product [::Google::Cloud::Vision::V1p4beta1::Product, ::Hash] + # Required. The Product resource which replaces the one on the server. + # product.name is immutable. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # The {::Google::Protobuf::FieldMask FieldMask} that specifies which fields + # to update. + # If update_mask isn't specified, all mutable fields are to be updated. + # Valid mask paths include `product_labels`, `display_name`, and + # `description`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Vision::V1p4beta1::Product] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Vision::V1p4beta1::Product] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/vision/v1p4beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Vision::V1p4beta1::ProductSearch::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Vision::V1p4beta1::UpdateProductRequest.new + # + # # Call the update_product method. + # result = client.update_product request + # + # # The returned object is of type Google::Cloud::Vision::V1p4beta1::Product. + # p result + # + def update_product request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Vision::V1p4beta1::UpdateProductRequest + + # Converts hash 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_product.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::Vision::V1p4beta1::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.product&.name + header_params["product.name"] = request.product.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_product.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_product.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @product_search_stub.call_rpc :update_product, 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 a product and its reference images. + # + # Metadata of the product and all its images will be deleted right away, but + # search queries against ProductSets containing the product may still work + # until all related caches are refreshed. + # + # @overload delete_product(request, options = nil) + # Pass arguments to `delete_product` via a request object, either of type + # {::Google::Cloud::Vision::V1p4beta1::DeleteProductRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Vision::V1p4beta1::DeleteProductRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_product(name: nil) + # Pass arguments to `delete_product` via keyword arguments. Note that at + # least one keyword argument is 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. Resource name of product to delete. + # + # Format is: + # `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID` + # + # @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/vision/v1p4beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Vision::V1p4beta1::ProductSearch::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Vision::V1p4beta1::DeleteProductRequest.new + # + # # Call the delete_product method. + # result = client.delete_product request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_product request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Vision::V1p4beta1::DeleteProductRequest + + # Converts hash 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_product.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::Vision::V1p4beta1::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_product.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_product.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @product_search_stub.call_rpc :delete_product, 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 and returns a new ReferenceImage resource. + # + # The `bounding_poly` field is optional. If `bounding_poly` is not specified, + # the system will try to detect regions of interest in the image that are + # compatible with the product_category on the parent product. If it is + # specified, detection is ALWAYS skipped. The system converts polygons into + # non-rotated rectangles. + # + # Note that the pipeline will resize the image if the image resolution is too + # large to process (above 50MP). + # + # Possible errors: + # + # * Returns INVALID_ARGUMENT if the image_uri is missing or longer than 4096 + # characters. + # * Returns INVALID_ARGUMENT if the product does not exist. + # * Returns INVALID_ARGUMENT if bounding_poly is not provided, and nothing + # compatible with the parent product's product_category is detected. + # * Returns INVALID_ARGUMENT if bounding_poly contains more than 10 polygons. + # + # @overload create_reference_image(request, options = nil) + # Pass arguments to `create_reference_image` via a request object, either of type + # {::Google::Cloud::Vision::V1p4beta1::CreateReferenceImageRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Vision::V1p4beta1::CreateReferenceImageRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_reference_image(parent: nil, reference_image: nil, reference_image_id: nil) + # Pass arguments to `create_reference_image` via keyword arguments. Note that at + # least one keyword argument is 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. Resource name of the product in which to create the reference + # image. + # + # Format is + # `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`. + # @param reference_image [::Google::Cloud::Vision::V1p4beta1::ReferenceImage, ::Hash] + # Required. The reference image to create. + # If an image ID is specified, it is ignored. + # @param reference_image_id [::String] + # A user-supplied resource id for the ReferenceImage to be added. If set, + # the server will attempt to use this value as the resource id. If it is + # already in use, an error is returned with code ALREADY_EXISTS. Must be at + # most 128 characters long. It cannot contain the character `/`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Vision::V1p4beta1::ReferenceImage] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Vision::V1p4beta1::ReferenceImage] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/vision/v1p4beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Vision::V1p4beta1::ProductSearch::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Vision::V1p4beta1::CreateReferenceImageRequest.new + # + # # Call the create_reference_image method. + # result = client.create_reference_image request + # + # # The returned object is of type Google::Cloud::Vision::V1p4beta1::ReferenceImage. + # p result + # + def create_reference_image request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Vision::V1p4beta1::CreateReferenceImageRequest + + # Converts hash 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_reference_image.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::Vision::V1p4beta1::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_reference_image.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_reference_image.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @product_search_stub.call_rpc :create_reference_image, 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 a reference image. + # + # The image metadata will be deleted right away, but search queries + # against ProductSets containing the image may still work until all related + # caches are refreshed. + # + # The actual image files are not deleted from Google Cloud Storage. + # + # @overload delete_reference_image(request, options = nil) + # Pass arguments to `delete_reference_image` via a request object, either of type + # {::Google::Cloud::Vision::V1p4beta1::DeleteReferenceImageRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Vision::V1p4beta1::DeleteReferenceImageRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_reference_image(name: nil) + # Pass arguments to `delete_reference_image` via keyword arguments. Note that at + # least one keyword argument is 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 reference image to delete. + # + # Format is: + # + # `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID` + # + # @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/vision/v1p4beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Vision::V1p4beta1::ProductSearch::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Vision::V1p4beta1::DeleteReferenceImageRequest.new + # + # # Call the delete_reference_image method. + # result = client.delete_reference_image request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_reference_image request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Vision::V1p4beta1::DeleteReferenceImageRequest + + # Converts hash 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_reference_image.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::Vision::V1p4beta1::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_reference_image.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_reference_image.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @product_search_stub.call_rpc :delete_reference_image, 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 reference images. + # + # Possible errors: + # + # * Returns NOT_FOUND if the parent product does not exist. + # * Returns INVALID_ARGUMENT if the page_size is greater than 100, or less + # than 1. + # + # @overload list_reference_images(request, options = nil) + # Pass arguments to `list_reference_images` via a request object, either of type + # {::Google::Cloud::Vision::V1p4beta1::ListReferenceImagesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Vision::V1p4beta1::ListReferenceImagesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_reference_images(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_reference_images` via keyword arguments. Note that at + # least one keyword argument is 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. Resource name of the product containing the reference images. + # + # Format is + # `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`. + # @param page_size [::Integer] + # The maximum number of items to return. Default 10, maximum 100. + # @param page_token [::String] + # A token identifying a page of results to be returned. This is the value + # of `nextPageToken` returned in a previous reference image list request. + # + # Defaults to the first page if not specified. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Vision::V1p4beta1::ReferenceImage>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::Vision::V1p4beta1::ReferenceImage>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/vision/v1p4beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Vision::V1p4beta1::ProductSearch::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Vision::V1p4beta1::ListReferenceImagesRequest.new + # + # # Call the list_reference_images method. + # result = client.list_reference_images 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::Vision::V1p4beta1::ReferenceImage. + # p item + # end + # + def list_reference_images request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Vision::V1p4beta1::ListReferenceImagesRequest + + # Converts hash 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_reference_images.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::Vision::V1p4beta1::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_reference_images.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_reference_images.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @product_search_stub.call_rpc :list_reference_images, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @product_search_stub, :list_reference_images, 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 + + ## + # Gets information associated with a ReferenceImage. + # + # Possible errors: + # + # * Returns NOT_FOUND if the specified image does not exist. + # + # @overload get_reference_image(request, options = nil) + # Pass arguments to `get_reference_image` via a request object, either of type + # {::Google::Cloud::Vision::V1p4beta1::GetReferenceImageRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Vision::V1p4beta1::GetReferenceImageRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_reference_image(name: nil) + # Pass arguments to `get_reference_image` via keyword arguments. Note that at + # least one keyword argument is 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 ReferenceImage to get. + # + # Format is: + # + # `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Vision::V1p4beta1::ReferenceImage] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Vision::V1p4beta1::ReferenceImage] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/vision/v1p4beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Vision::V1p4beta1::ProductSearch::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Vision::V1p4beta1::GetReferenceImageRequest.new + # + # # Call the get_reference_image method. + # result = client.get_reference_image request + # + # # The returned object is of type Google::Cloud::Vision::V1p4beta1::ReferenceImage. + # p result + # + def get_reference_image request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Vision::V1p4beta1::GetReferenceImageRequest + + # Converts hash 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_reference_image.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::Vision::V1p4beta1::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_reference_image.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_reference_image.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @product_search_stub.call_rpc :get_reference_image, 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 + + ## + # Adds a Product to the specified ProductSet. If the Product is already + # present, no change is made. + # + # One Product can be added to at most 100 ProductSets. + # + # Possible errors: + # + # * Returns NOT_FOUND if the Product or the ProductSet doesn't exist. + # + # @overload add_product_to_product_set(request, options = nil) + # Pass arguments to `add_product_to_product_set` via a request object, either of type + # {::Google::Cloud::Vision::V1p4beta1::AddProductToProductSetRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Vision::V1p4beta1::AddProductToProductSetRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload add_product_to_product_set(name: nil, product: nil) + # Pass arguments to `add_product_to_product_set` via keyword arguments. Note that at + # least one keyword argument is 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 for the ProductSet to modify. + # + # Format is: + # `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID` + # @param product [::String] + # Required. The resource name for the Product to be added to this ProductSet. + # + # Format is: + # `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID` + # + # @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/vision/v1p4beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Vision::V1p4beta1::ProductSearch::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Vision::V1p4beta1::AddProductToProductSetRequest.new + # + # # Call the add_product_to_product_set method. + # result = client.add_product_to_product_set request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def add_product_to_product_set request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Vision::V1p4beta1::AddProductToProductSetRequest + + # Converts hash 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.add_product_to_product_set.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::Vision::V1p4beta1::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.add_product_to_product_set.timeout, + metadata: metadata, + retry_policy: @config.rpcs.add_product_to_product_set.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @product_search_stub.call_rpc :add_product_to_product_set, 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 + + ## + # Removes a Product from the specified ProductSet. + # + # @overload remove_product_from_product_set(request, options = nil) + # Pass arguments to `remove_product_from_product_set` via a request object, either of type + # {::Google::Cloud::Vision::V1p4beta1::RemoveProductFromProductSetRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Vision::V1p4beta1::RemoveProductFromProductSetRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload remove_product_from_product_set(name: nil, product: nil) + # Pass arguments to `remove_product_from_product_set` via keyword arguments. Note that at + # least one keyword argument is 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 for the ProductSet to modify. + # + # Format is: + # `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID` + # @param product [::String] + # Required. The resource name for the Product to be removed from this + # ProductSet. + # + # Format is: + # `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID` + # + # @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/vision/v1p4beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Vision::V1p4beta1::ProductSearch::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Vision::V1p4beta1::RemoveProductFromProductSetRequest.new + # + # # Call the remove_product_from_product_set method. + # result = client.remove_product_from_product_set request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def remove_product_from_product_set request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Vision::V1p4beta1::RemoveProductFromProductSetRequest + + # Converts hash 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.remove_product_from_product_set.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::Vision::V1p4beta1::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.remove_product_from_product_set.timeout, + metadata: metadata, + retry_policy: @config.rpcs.remove_product_from_product_set.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @product_search_stub.call_rpc :remove_product_from_product_set, 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 the Products in a ProductSet, in an unspecified order. If the + # ProductSet does not exist, the products field of the response will be + # empty. + # + # Possible errors: + # + # * Returns INVALID_ARGUMENT if page_size is greater than 100 or less than 1. + # + # @overload list_products_in_product_set(request, options = nil) + # Pass arguments to `list_products_in_product_set` via a request object, either of type + # {::Google::Cloud::Vision::V1p4beta1::ListProductsInProductSetRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Vision::V1p4beta1::ListProductsInProductSetRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_products_in_product_set(name: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_products_in_product_set` via keyword arguments. Note that at + # least one keyword argument is 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 ProductSet resource for which to retrieve Products. + # + # Format is: + # `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID` + # @param page_size [::Integer] + # The maximum number of items to return. Default 10, maximum 100. + # @param page_token [::String] + # The next_page_token returned from a previous List request, if any. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Vision::V1p4beta1::Product>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::Vision::V1p4beta1::Product>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/vision/v1p4beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Vision::V1p4beta1::ProductSearch::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Vision::V1p4beta1::ListProductsInProductSetRequest.new + # + # # Call the list_products_in_product_set method. + # result = client.list_products_in_product_set 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::Vision::V1p4beta1::Product. + # p item + # end + # + def list_products_in_product_set request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Vision::V1p4beta1::ListProductsInProductSetRequest + + # Converts hash 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_products_in_product_set.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::Vision::V1p4beta1::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_products_in_product_set.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_products_in_product_set.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @product_search_stub.call_rpc :list_products_in_product_set, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @product_search_stub, :list_products_in_product_set, 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 + + ## + # Asynchronous API that imports a list of reference images to specified + # product sets based on a list of image information. + # + # The {::Google::Longrunning::Operation google.longrunning.Operation} API can be + # used to keep track of the progress and results of the request. + # `Operation.metadata` contains `BatchOperationMetadata`. (progress) + # `Operation.response` contains `ImportProductSetsResponse`. (results) + # + # The input source of this method is a csv file on Google Cloud Storage. + # For the format of the csv file please see + # {::Google::Cloud::Vision::V1p4beta1::ImportProductSetsGcsSource#csv_file_uri ImportProductSetsGcsSource.csv_file_uri}. + # + # @overload import_product_sets(request, options = nil) + # Pass arguments to `import_product_sets` via a request object, either of type + # {::Google::Cloud::Vision::V1p4beta1::ImportProductSetsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Vision::V1p4beta1::ImportProductSetsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_product_sets(parent: nil, input_config: nil) + # Pass arguments to `import_product_sets` via keyword arguments. Note that at + # least one keyword argument is 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 in which the ProductSets should be imported. + # + # Format is `projects/PROJECT_ID/locations/LOC_ID`. + # @param input_config [::Google::Cloud::Vision::V1p4beta1::ImportProductSetsInputConfig, ::Hash] + # Required. The input content for the list of requests. + # + # @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/vision/v1p4beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Vision::V1p4beta1::ProductSearch::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Vision::V1p4beta1::ImportProductSetsRequest.new + # + # # Call the import_product_sets method. + # result = client.import_product_sets 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 import_product_sets request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Vision::V1p4beta1::ImportProductSetsRequest + + # Converts hash 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_product_sets.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::Vision::V1p4beta1::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_product_sets.timeout, + metadata: metadata, + retry_policy: @config.rpcs.import_product_sets.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @product_search_stub.call_rpc :import_product_sets, 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 + + ## + # Asynchronous API to delete all Products in a ProductSet or all Products + # that are in no ProductSet. + # + # If a Product is a member of the specified ProductSet in addition to other + # ProductSets, the Product will still be deleted. + # + # It is recommended to not delete the specified ProductSet until after this + # operation has completed. It is also recommended to not add any of the + # Products involved in the batch delete to a new ProductSet while this + # operation is running because those Products may still end up deleted. + # + # It's not possible to undo the PurgeProducts operation. Therefore, it is + # recommended to keep the csv files used in ImportProductSets (if that was + # how you originally built the Product Set) before starting PurgeProducts, in + # case you need to re-import the data after deletion. + # + # If the plan is to purge all of the Products from a ProductSet and then + # re-use the empty ProductSet to re-import new Products into the empty + # ProductSet, you must wait until the PurgeProducts operation has finished + # for that ProductSet. + # + # The {::Google::Longrunning::Operation google.longrunning.Operation} API can be + # used to keep track of the progress and results of the request. + # `Operation.metadata` contains `BatchOperationMetadata`. (progress) + # + # @overload purge_products(request, options = nil) + # Pass arguments to `purge_products` via a request object, either of type + # {::Google::Cloud::Vision::V1p4beta1::PurgeProductsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Vision::V1p4beta1::PurgeProductsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload purge_products(product_set_purge_config: nil, delete_orphan_products: nil, parent: nil, force: nil) + # Pass arguments to `purge_products` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param product_set_purge_config [::Google::Cloud::Vision::V1p4beta1::ProductSetPurgeConfig, ::Hash] + # Specify which ProductSet contains the Products to be deleted. + # + # Note: The following parameters are mutually exclusive: `product_set_purge_config`, `delete_orphan_products`. 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 delete_orphan_products [::Boolean] + # If delete_orphan_products is true, all Products that are not in any + # ProductSet will be deleted. + # + # Note: The following parameters are mutually exclusive: `delete_orphan_products`, `product_set_purge_config`. 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 parent [::String] + # Required. The project and location in which the Products should be deleted. + # + # Format is `projects/PROJECT_ID/locations/LOC_ID`. + # @param force [::Boolean] + # The default value is false. Override this value to true to actually perform + # the purge. + # + # @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/vision/v1p4beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Vision::V1p4beta1::ProductSearch::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Vision::V1p4beta1::PurgeProductsRequest.new + # + # # Call the purge_products method. + # result = client.purge_products 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 purge_products request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Vision::V1p4beta1::PurgeProductsRequest + + # Converts hash 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.purge_products.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::Vision::V1p4beta1::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.purge_products.timeout, + metadata: metadata, + retry_policy: @config.rpcs.purge_products.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @product_search_stub.call_rpc :purge_products, 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 ProductSearch API. + # + # This class represents the configuration for ProductSearch, + # 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::Vision::V1p4beta1::ProductSearch::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_product_set to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Vision::V1p4beta1::ProductSearch::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.create_product_set.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Vision::V1p4beta1::ProductSearch::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.create_product_set.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::Vision::V1p4beta1::ProductSearch::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 = "vision.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 ProductSearch 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_product_set` + # @return [::Gapic::Config::Method] + # + attr_reader :create_product_set + ## + # RPC-specific configuration for `list_product_sets` + # @return [::Gapic::Config::Method] + # + attr_reader :list_product_sets + ## + # RPC-specific configuration for `get_product_set` + # @return [::Gapic::Config::Method] + # + attr_reader :get_product_set + ## + # RPC-specific configuration for `update_product_set` + # @return [::Gapic::Config::Method] + # + attr_reader :update_product_set + ## + # RPC-specific configuration for `delete_product_set` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_product_set + ## + # RPC-specific configuration for `create_product` + # @return [::Gapic::Config::Method] + # + attr_reader :create_product + ## + # RPC-specific configuration for `list_products` + # @return [::Gapic::Config::Method] + # + attr_reader :list_products + ## + # RPC-specific configuration for `get_product` + # @return [::Gapic::Config::Method] + # + attr_reader :get_product + ## + # RPC-specific configuration for `update_product` + # @return [::Gapic::Config::Method] + # + attr_reader :update_product + ## + # RPC-specific configuration for `delete_product` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_product + ## + # RPC-specific configuration for `create_reference_image` + # @return [::Gapic::Config::Method] + # + attr_reader :create_reference_image + ## + # RPC-specific configuration for `delete_reference_image` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_reference_image + ## + # RPC-specific configuration for `list_reference_images` + # @return [::Gapic::Config::Method] + # + attr_reader :list_reference_images + ## + # RPC-specific configuration for `get_reference_image` + # @return [::Gapic::Config::Method] + # + attr_reader :get_reference_image + ## + # RPC-specific configuration for `add_product_to_product_set` + # @return [::Gapic::Config::Method] + # + attr_reader :add_product_to_product_set + ## + # RPC-specific configuration for `remove_product_from_product_set` + # @return [::Gapic::Config::Method] + # + attr_reader :remove_product_from_product_set + ## + # RPC-specific configuration for `list_products_in_product_set` + # @return [::Gapic::Config::Method] + # + attr_reader :list_products_in_product_set + ## + # RPC-specific configuration for `import_product_sets` + # @return [::Gapic::Config::Method] + # + attr_reader :import_product_sets + ## + # RPC-specific configuration for `purge_products` + # @return [::Gapic::Config::Method] + # + attr_reader :purge_products + + # @private + def initialize parent_rpcs = nil + create_product_set_config = parent_rpcs.create_product_set if parent_rpcs.respond_to? :create_product_set + @create_product_set = ::Gapic::Config::Method.new create_product_set_config + list_product_sets_config = parent_rpcs.list_product_sets if parent_rpcs.respond_to? :list_product_sets + @list_product_sets = ::Gapic::Config::Method.new list_product_sets_config + get_product_set_config = parent_rpcs.get_product_set if parent_rpcs.respond_to? :get_product_set + @get_product_set = ::Gapic::Config::Method.new get_product_set_config + update_product_set_config = parent_rpcs.update_product_set if parent_rpcs.respond_to? :update_product_set + @update_product_set = ::Gapic::Config::Method.new update_product_set_config + delete_product_set_config = parent_rpcs.delete_product_set if parent_rpcs.respond_to? :delete_product_set + @delete_product_set = ::Gapic::Config::Method.new delete_product_set_config + create_product_config = parent_rpcs.create_product if parent_rpcs.respond_to? :create_product + @create_product = ::Gapic::Config::Method.new create_product_config + list_products_config = parent_rpcs.list_products if parent_rpcs.respond_to? :list_products + @list_products = ::Gapic::Config::Method.new list_products_config + get_product_config = parent_rpcs.get_product if parent_rpcs.respond_to? :get_product + @get_product = ::Gapic::Config::Method.new get_product_config + update_product_config = parent_rpcs.update_product if parent_rpcs.respond_to? :update_product + @update_product = ::Gapic::Config::Method.new update_product_config + delete_product_config = parent_rpcs.delete_product if parent_rpcs.respond_to? :delete_product + @delete_product = ::Gapic::Config::Method.new delete_product_config + create_reference_image_config = parent_rpcs.create_reference_image if parent_rpcs.respond_to? :create_reference_image + @create_reference_image = ::Gapic::Config::Method.new create_reference_image_config + delete_reference_image_config = parent_rpcs.delete_reference_image if parent_rpcs.respond_to? :delete_reference_image + @delete_reference_image = ::Gapic::Config::Method.new delete_reference_image_config + list_reference_images_config = parent_rpcs.list_reference_images if parent_rpcs.respond_to? :list_reference_images + @list_reference_images = ::Gapic::Config::Method.new list_reference_images_config + get_reference_image_config = parent_rpcs.get_reference_image if parent_rpcs.respond_to? :get_reference_image + @get_reference_image = ::Gapic::Config::Method.new get_reference_image_config + add_product_to_product_set_config = parent_rpcs.add_product_to_product_set if parent_rpcs.respond_to? :add_product_to_product_set + @add_product_to_product_set = ::Gapic::Config::Method.new add_product_to_product_set_config + remove_product_from_product_set_config = parent_rpcs.remove_product_from_product_set if parent_rpcs.respond_to? :remove_product_from_product_set + @remove_product_from_product_set = ::Gapic::Config::Method.new remove_product_from_product_set_config + list_products_in_product_set_config = parent_rpcs.list_products_in_product_set if parent_rpcs.respond_to? :list_products_in_product_set + @list_products_in_product_set = ::Gapic::Config::Method.new list_products_in_product_set_config + import_product_sets_config = parent_rpcs.import_product_sets if parent_rpcs.respond_to? :import_product_sets + @import_product_sets = ::Gapic::Config::Method.new import_product_sets_config + purge_products_config = parent_rpcs.purge_products if parent_rpcs.respond_to? :purge_products + @purge_products = ::Gapic::Config::Method.new purge_products_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1/product_search/credentials.rb b/owl-bot-staging/google-cloud-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1/product_search/credentials.rb new file mode 100644 index 000000000000..c5f696af4315 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1/product_search/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 Vision + module V1p4beta1 + module ProductSearch + # Credentials for the ProductSearch API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/cloud-platform", + "https://www.googleapis.com/auth/cloud-vision" + ] + self.env_vars = [ + "VISION_CREDENTIALS", + "VISION_KEYFILE", + "GOOGLE_CLOUD_CREDENTIALS", + "GOOGLE_CLOUD_KEYFILE", + "GCLOUD_KEYFILE", + "VISION_CREDENTIALS_JSON", + "VISION_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-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1/product_search/operations.rb b/owl-bot-staging/google-cloud-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1/product_search/operations.rb new file mode 100644 index 000000000000..41322f7e33b1 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1/product_search/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 Vision + module V1p4beta1 + module ProductSearch + # Service that implements Longrunning Operations API. + class Operations + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "vision.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :operations_stub + + ## + # Configuration for the ProductSearch 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 ProductSearch 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::Vision::V1p4beta1::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::Vision::V1p4beta1::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::Vision::V1p4beta1::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::Vision::V1p4beta1::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::Vision::V1p4beta1::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 = "vision.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-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1/product_search/paths.rb b/owl-bot-staging/google-cloud-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1/product_search/paths.rb new file mode 100644 index 000000000000..a4e5df23a7cf --- /dev/null +++ b/owl-bot-staging/google-cloud-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1/product_search/paths.rb @@ -0,0 +1,109 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Vision + module V1p4beta1 + module ProductSearch + # Path helper methods for the ProductSearch 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 Product resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/products/{product}` + # + # @param project [String] + # @param location [String] + # @param product [String] + # + # @return [::String] + def product_path project:, location:, product: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/products/#{product}" + end + + ## + # Create a fully-qualified ProductSet resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/productSets/{product_set}` + # + # @param project [String] + # @param location [String] + # @param product_set [String] + # + # @return [::String] + def product_set_path project:, location:, product_set: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/productSets/#{product_set}" + end + + ## + # Create a fully-qualified ReferenceImage resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/products/{product}/referenceImages/{reference_image}` + # + # @param project [String] + # @param location [String] + # @param product [String] + # @param reference_image [String] + # + # @return [::String] + def reference_image_path project:, location:, product:, reference_image: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "product cannot contain /" if product.to_s.include? "/" + + "projects/#{project}/locations/#{location}/products/#{product}/referenceImages/#{reference_image}" + end + + extend self + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1/product_search/rest.rb b/owl-bot-staging/google-cloud-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1/product_search/rest.rb new file mode 100644 index 000000000000..8a761f864824 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1/product_search/rest.rb @@ -0,0 +1,70 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/vision/v1p4beta1/version" + +require "google/cloud/vision/v1p4beta1/product_search/credentials" +require "google/cloud/vision/v1p4beta1/product_search/paths" +require "google/cloud/vision/v1p4beta1/product_search/rest/operations" +require "google/cloud/vision/v1p4beta1/product_search/rest/client" + +module Google + module Cloud + module Vision + module V1p4beta1 + ## + # Manages Products and ProductSets of reference images for use in product + # search. It uses the following resource model: + # + # - The API has a collection of + # {::Google::Cloud::Vision::V1p4beta1::ProductSet ProductSet} resources, named + # `projects/*/locations/*/productSets/*`, which acts as a way to put different + # products into groups to limit identification. + # + # In parallel, + # + # - The API has a collection of + # {::Google::Cloud::Vision::V1p4beta1::Product Product} resources, named + # `projects/*/locations/*/products/*` + # + # - Each {::Google::Cloud::Vision::V1p4beta1::Product Product} has a collection of + # {::Google::Cloud::Vision::V1p4beta1::ReferenceImage ReferenceImage} resources, + # named + # `projects/*/locations/*/products/*/referenceImages/*` + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/vision/v1p4beta1/product_search/rest" + # client = ::Google::Cloud::Vision::V1p4beta1::ProductSearch::Rest::Client.new + # + module ProductSearch + # Client for the REST transport + module Rest + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "rest", "helpers.rb" +require "google/cloud/vision/v1p4beta1/product_search/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1/product_search/rest/client.rb b/owl-bot-staging/google-cloud-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1/product_search/rest/client.rb new file mode 100644 index 000000000000..4b56ab73e1da --- /dev/null +++ b/owl-bot-staging/google-cloud-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1/product_search/rest/client.rb @@ -0,0 +1,2382 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/vision/v1p4beta1/product_search_service_pb" +require "google/cloud/vision/v1p4beta1/product_search/rest/service_stub" + +module Google + module Cloud + module Vision + module V1p4beta1 + module ProductSearch + module Rest + ## + # REST client for the ProductSearch service. + # + # Manages Products and ProductSets of reference images for use in product + # search. It uses the following resource model: + # + # - The API has a collection of + # {::Google::Cloud::Vision::V1p4beta1::ProductSet ProductSet} resources, named + # `projects/*/locations/*/productSets/*`, which acts as a way to put different + # products into groups to limit identification. + # + # In parallel, + # + # - The API has a collection of + # {::Google::Cloud::Vision::V1p4beta1::Product Product} resources, named + # `projects/*/locations/*/products/*` + # + # - Each {::Google::Cloud::Vision::V1p4beta1::Product Product} has a collection of + # {::Google::Cloud::Vision::V1p4beta1::ReferenceImage ReferenceImage} resources, + # named + # `projects/*/locations/*/products/*/referenceImages/*` + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "vision.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :product_search_stub + + ## + # Configure the ProductSearch Client class. + # + # See {::Google::Cloud::Vision::V1p4beta1::ProductSearch::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all ProductSearch clients + # ::Google::Cloud::Vision::V1p4beta1::ProductSearch::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", "Vision", "V1p4beta1"] + 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_product_set.timeout = 600.0 + default_config.rpcs.create_product_set.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [] + } + + default_config.rpcs.list_product_sets.timeout = 600.0 + default_config.rpcs.list_product_sets.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.get_product_set.timeout = 600.0 + default_config.rpcs.get_product_set.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.update_product_set.timeout = 600.0 + default_config.rpcs.update_product_set.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [] + } + + default_config.rpcs.delete_product_set.timeout = 600.0 + default_config.rpcs.delete_product_set.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.create_product.timeout = 600.0 + default_config.rpcs.create_product.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [] + } + + default_config.rpcs.list_products.timeout = 600.0 + default_config.rpcs.list_products.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.get_product.timeout = 600.0 + default_config.rpcs.get_product.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.update_product.timeout = 600.0 + default_config.rpcs.update_product.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [] + } + + default_config.rpcs.delete_product.timeout = 600.0 + default_config.rpcs.delete_product.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.create_reference_image.timeout = 600.0 + default_config.rpcs.create_reference_image.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [] + } + + default_config.rpcs.delete_reference_image.timeout = 600.0 + default_config.rpcs.delete_reference_image.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.list_reference_images.timeout = 600.0 + default_config.rpcs.list_reference_images.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.get_reference_image.timeout = 600.0 + default_config.rpcs.get_reference_image.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.add_product_to_product_set.timeout = 600.0 + default_config.rpcs.add_product_to_product_set.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [] + } + + default_config.rpcs.remove_product_from_product_set.timeout = 600.0 + default_config.rpcs.remove_product_from_product_set.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [] + } + + default_config.rpcs.list_products_in_product_set.timeout = 600.0 + default_config.rpcs.list_products_in_product_set.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.import_product_sets.timeout = 600.0 + default_config.rpcs.import_product_sets.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the ProductSearch 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::Vision::V1p4beta1::ProductSearch::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 + @product_search_stub.universe_domain + end + + ## + # Create a new ProductSearch REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Vision::V1p4beta1::ProductSearch::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Vision::V1p4beta1::ProductSearch::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the ProductSearch 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::Vision::V1p4beta1::ProductSearch::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 + + @product_search_stub = ::Google::Cloud::Vision::V1p4beta1::ProductSearch::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials, + logger: @config.logger + ) + + @product_search_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 + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::Vision::V1p4beta1::ProductSearch::Rest::Operations] + # + attr_reader :operations_client + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @product_search_stub.logger + end + + # Service calls + + ## + # Creates and returns a new ProductSet resource. + # + # Possible errors: + # + # * Returns INVALID_ARGUMENT if display_name is missing, or is longer than + # 4096 characters. + # + # @overload create_product_set(request, options = nil) + # Pass arguments to `create_product_set` via a request object, either of type + # {::Google::Cloud::Vision::V1p4beta1::CreateProductSetRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Vision::V1p4beta1::CreateProductSetRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_product_set(parent: nil, product_set: nil, product_set_id: nil) + # Pass arguments to `create_product_set` via keyword arguments. Note that at + # least one keyword argument is 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 in which the ProductSet should be created. + # + # Format is `projects/PROJECT_ID/locations/LOC_ID`. + # @param product_set [::Google::Cloud::Vision::V1p4beta1::ProductSet, ::Hash] + # Required. The ProductSet to create. + # @param product_set_id [::String] + # A user-supplied resource id for this ProductSet. If set, the server will + # attempt to use this value as the resource id. If it is already in use, an + # error is returned with code ALREADY_EXISTS. Must be at most 128 characters + # long. It cannot contain the character `/`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Vision::V1p4beta1::ProductSet] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Vision::V1p4beta1::ProductSet] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/vision/v1p4beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Vision::V1p4beta1::ProductSearch::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Vision::V1p4beta1::CreateProductSetRequest.new + # + # # Call the create_product_set method. + # result = client.create_product_set request + # + # # The returned object is of type Google::Cloud::Vision::V1p4beta1::ProductSet. + # p result + # + def create_product_set request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Vision::V1p4beta1::CreateProductSetRequest + + # Converts hash 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_product_set.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::Vision::V1p4beta1::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_product_set.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_product_set.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @product_search_stub.create_product_set 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 ProductSets in an unspecified order. + # + # Possible errors: + # + # * Returns INVALID_ARGUMENT if page_size is greater than 100, or less + # than 1. + # + # @overload list_product_sets(request, options = nil) + # Pass arguments to `list_product_sets` via a request object, either of type + # {::Google::Cloud::Vision::V1p4beta1::ListProductSetsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Vision::V1p4beta1::ListProductSetsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_product_sets(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_product_sets` via keyword arguments. Note that at + # least one keyword argument is 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 from which ProductSets should be listed. + # + # Format is `projects/PROJECT_ID/locations/LOC_ID`. + # @param page_size [::Integer] + # The maximum number of items to return. Default 10, maximum 100. + # @param page_token [::String] + # The next_page_token returned from a previous List request, if any. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Vision::V1p4beta1::ProductSet>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Vision::V1p4beta1::ProductSet>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/vision/v1p4beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Vision::V1p4beta1::ProductSearch::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Vision::V1p4beta1::ListProductSetsRequest.new + # + # # Call the list_product_sets method. + # result = client.list_product_sets 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::Vision::V1p4beta1::ProductSet. + # p item + # end + # + def list_product_sets request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Vision::V1p4beta1::ListProductSetsRequest + + # Converts hash 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_product_sets.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::Vision::V1p4beta1::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_product_sets.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_product_sets.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @product_search_stub.list_product_sets request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @product_search_stub, :list_product_sets, "product_sets", 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 information associated with a ProductSet. + # + # Possible errors: + # + # * Returns NOT_FOUND if the ProductSet does not exist. + # + # @overload get_product_set(request, options = nil) + # Pass arguments to `get_product_set` via a request object, either of type + # {::Google::Cloud::Vision::V1p4beta1::GetProductSetRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Vision::V1p4beta1::GetProductSetRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_product_set(name: nil) + # Pass arguments to `get_product_set` via keyword arguments. Note that at + # least one keyword argument is 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. Resource name of the ProductSet to get. + # + # Format is: + # `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID` + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Vision::V1p4beta1::ProductSet] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Vision::V1p4beta1::ProductSet] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/vision/v1p4beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Vision::V1p4beta1::ProductSearch::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Vision::V1p4beta1::GetProductSetRequest.new + # + # # Call the get_product_set method. + # result = client.get_product_set request + # + # # The returned object is of type Google::Cloud::Vision::V1p4beta1::ProductSet. + # p result + # + def get_product_set request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Vision::V1p4beta1::GetProductSetRequest + + # Converts hash 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_product_set.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::Vision::V1p4beta1::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_product_set.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_product_set.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @product_search_stub.get_product_set 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 + + ## + # Makes changes to a ProductSet resource. + # Only display_name can be updated currently. + # + # Possible errors: + # + # * Returns NOT_FOUND if the ProductSet does not exist. + # * Returns INVALID_ARGUMENT if display_name is present in update_mask but + # missing from the request or longer than 4096 characters. + # + # @overload update_product_set(request, options = nil) + # Pass arguments to `update_product_set` via a request object, either of type + # {::Google::Cloud::Vision::V1p4beta1::UpdateProductSetRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Vision::V1p4beta1::UpdateProductSetRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_product_set(product_set: nil, update_mask: nil) + # Pass arguments to `update_product_set` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param product_set [::Google::Cloud::Vision::V1p4beta1::ProductSet, ::Hash] + # Required. The ProductSet resource which replaces the one on the server. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # The {::Google::Protobuf::FieldMask FieldMask} that specifies which fields to + # update. + # If update_mask isn't specified, all mutable fields are to be updated. + # Valid mask path is `display_name`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Vision::V1p4beta1::ProductSet] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Vision::V1p4beta1::ProductSet] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/vision/v1p4beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Vision::V1p4beta1::ProductSearch::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Vision::V1p4beta1::UpdateProductSetRequest.new + # + # # Call the update_product_set method. + # result = client.update_product_set request + # + # # The returned object is of type Google::Cloud::Vision::V1p4beta1::ProductSet. + # p result + # + def update_product_set request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Vision::V1p4beta1::UpdateProductSetRequest + + # Converts hash 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_product_set.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::Vision::V1p4beta1::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_product_set.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_product_set.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @product_search_stub.update_product_set 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 a ProductSet. Products and ReferenceImages in the + # ProductSet are not deleted. + # + # The actual image files are not deleted from Google Cloud Storage. + # + # @overload delete_product_set(request, options = nil) + # Pass arguments to `delete_product_set` via a request object, either of type + # {::Google::Cloud::Vision::V1p4beta1::DeleteProductSetRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Vision::V1p4beta1::DeleteProductSetRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_product_set(name: nil) + # Pass arguments to `delete_product_set` via keyword arguments. Note that at + # least one keyword argument is 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. Resource name of the ProductSet to delete. + # + # Format is: + # `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID` + # @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/vision/v1p4beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Vision::V1p4beta1::ProductSearch::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Vision::V1p4beta1::DeleteProductSetRequest.new + # + # # Call the delete_product_set method. + # result = client.delete_product_set request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_product_set request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Vision::V1p4beta1::DeleteProductSetRequest + + # Converts hash 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_product_set.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::Vision::V1p4beta1::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_product_set.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_product_set.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @product_search_stub.delete_product_set 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 and returns a new product resource. + # + # Possible errors: + # + # * Returns INVALID_ARGUMENT if display_name is missing or longer than 4096 + # characters. + # * Returns INVALID_ARGUMENT if description is longer than 4096 characters. + # * Returns INVALID_ARGUMENT if product_category is missing or invalid. + # + # @overload create_product(request, options = nil) + # Pass arguments to `create_product` via a request object, either of type + # {::Google::Cloud::Vision::V1p4beta1::CreateProductRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Vision::V1p4beta1::CreateProductRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_product(parent: nil, product: nil, product_id: nil) + # Pass arguments to `create_product` via keyword arguments. Note that at + # least one keyword argument is 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 in which the Product should be created. + # + # Format is + # `projects/PROJECT_ID/locations/LOC_ID`. + # @param product [::Google::Cloud::Vision::V1p4beta1::Product, ::Hash] + # Required. The product to create. + # @param product_id [::String] + # A user-supplied resource id for this Product. If set, the server will + # attempt to use this value as the resource id. If it is already in use, an + # error is returned with code ALREADY_EXISTS. Must be at most 128 characters + # long. It cannot contain the character `/`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Vision::V1p4beta1::Product] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Vision::V1p4beta1::Product] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/vision/v1p4beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Vision::V1p4beta1::ProductSearch::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Vision::V1p4beta1::CreateProductRequest.new + # + # # Call the create_product method. + # result = client.create_product request + # + # # The returned object is of type Google::Cloud::Vision::V1p4beta1::Product. + # p result + # + def create_product request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Vision::V1p4beta1::CreateProductRequest + + # Converts hash 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_product.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::Vision::V1p4beta1::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_product.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_product.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @product_search_stub.create_product 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 products in an unspecified order. + # + # Possible errors: + # + # * Returns INVALID_ARGUMENT if page_size is greater than 100 or less than 1. + # + # @overload list_products(request, options = nil) + # Pass arguments to `list_products` via a request object, either of type + # {::Google::Cloud::Vision::V1p4beta1::ListProductsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Vision::V1p4beta1::ListProductsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_products(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_products` via keyword arguments. Note that at + # least one keyword argument is 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 OR ProductSet from which Products should be listed. + # + # Format: + # `projects/PROJECT_ID/locations/LOC_ID` + # @param page_size [::Integer] + # The maximum number of items to return. Default 10, maximum 100. + # @param page_token [::String] + # The next_page_token returned from a previous List request, if any. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Vision::V1p4beta1::Product>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Vision::V1p4beta1::Product>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/vision/v1p4beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Vision::V1p4beta1::ProductSearch::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Vision::V1p4beta1::ListProductsRequest.new + # + # # Call the list_products method. + # result = client.list_products 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::Vision::V1p4beta1::Product. + # p item + # end + # + def list_products request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Vision::V1p4beta1::ListProductsRequest + + # Converts hash 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_products.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::Vision::V1p4beta1::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_products.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_products.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @product_search_stub.list_products request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @product_search_stub, :list_products, "products", 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 information associated with a Product. + # + # Possible errors: + # + # * Returns NOT_FOUND if the Product does not exist. + # + # @overload get_product(request, options = nil) + # Pass arguments to `get_product` via a request object, either of type + # {::Google::Cloud::Vision::V1p4beta1::GetProductRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Vision::V1p4beta1::GetProductRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_product(name: nil) + # Pass arguments to `get_product` via keyword arguments. Note that at + # least one keyword argument is 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. Resource name of the Product to get. + # + # Format is: + # `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID` + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Vision::V1p4beta1::Product] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Vision::V1p4beta1::Product] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/vision/v1p4beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Vision::V1p4beta1::ProductSearch::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Vision::V1p4beta1::GetProductRequest.new + # + # # Call the get_product method. + # result = client.get_product request + # + # # The returned object is of type Google::Cloud::Vision::V1p4beta1::Product. + # p result + # + def get_product request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Vision::V1p4beta1::GetProductRequest + + # Converts hash 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_product.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::Vision::V1p4beta1::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_product.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_product.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @product_search_stub.get_product 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 + + ## + # Makes changes to a Product resource. + # Only the `display_name`, `description`, and `labels` fields can be updated + # right now. + # + # If labels are updated, the change will not be reflected in queries until + # the next index time. + # + # Possible errors: + # + # * Returns NOT_FOUND if the Product does not exist. + # * Returns INVALID_ARGUMENT if display_name is present in update_mask but is + # missing from the request or longer than 4096 characters. + # * Returns INVALID_ARGUMENT if description is present in update_mask but is + # longer than 4096 characters. + # * Returns INVALID_ARGUMENT if product_category is present in update_mask. + # + # @overload update_product(request, options = nil) + # Pass arguments to `update_product` via a request object, either of type + # {::Google::Cloud::Vision::V1p4beta1::UpdateProductRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Vision::V1p4beta1::UpdateProductRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_product(product: nil, update_mask: nil) + # Pass arguments to `update_product` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param product [::Google::Cloud::Vision::V1p4beta1::Product, ::Hash] + # Required. The Product resource which replaces the one on the server. + # product.name is immutable. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # The {::Google::Protobuf::FieldMask FieldMask} that specifies which fields + # to update. + # If update_mask isn't specified, all mutable fields are to be updated. + # Valid mask paths include `product_labels`, `display_name`, and + # `description`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Vision::V1p4beta1::Product] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Vision::V1p4beta1::Product] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/vision/v1p4beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Vision::V1p4beta1::ProductSearch::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Vision::V1p4beta1::UpdateProductRequest.new + # + # # Call the update_product method. + # result = client.update_product request + # + # # The returned object is of type Google::Cloud::Vision::V1p4beta1::Product. + # p result + # + def update_product request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Vision::V1p4beta1::UpdateProductRequest + + # Converts hash 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_product.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::Vision::V1p4beta1::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_product.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_product.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @product_search_stub.update_product 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 a product and its reference images. + # + # Metadata of the product and all its images will be deleted right away, but + # search queries against ProductSets containing the product may still work + # until all related caches are refreshed. + # + # @overload delete_product(request, options = nil) + # Pass arguments to `delete_product` via a request object, either of type + # {::Google::Cloud::Vision::V1p4beta1::DeleteProductRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Vision::V1p4beta1::DeleteProductRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_product(name: nil) + # Pass arguments to `delete_product` via keyword arguments. Note that at + # least one keyword argument is 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. Resource name of product to delete. + # + # Format is: + # `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID` + # @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/vision/v1p4beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Vision::V1p4beta1::ProductSearch::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Vision::V1p4beta1::DeleteProductRequest.new + # + # # Call the delete_product method. + # result = client.delete_product request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_product request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Vision::V1p4beta1::DeleteProductRequest + + # Converts hash 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_product.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::Vision::V1p4beta1::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_product.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_product.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @product_search_stub.delete_product 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 and returns a new ReferenceImage resource. + # + # The `bounding_poly` field is optional. If `bounding_poly` is not specified, + # the system will try to detect regions of interest in the image that are + # compatible with the product_category on the parent product. If it is + # specified, detection is ALWAYS skipped. The system converts polygons into + # non-rotated rectangles. + # + # Note that the pipeline will resize the image if the image resolution is too + # large to process (above 50MP). + # + # Possible errors: + # + # * Returns INVALID_ARGUMENT if the image_uri is missing or longer than 4096 + # characters. + # * Returns INVALID_ARGUMENT if the product does not exist. + # * Returns INVALID_ARGUMENT if bounding_poly is not provided, and nothing + # compatible with the parent product's product_category is detected. + # * Returns INVALID_ARGUMENT if bounding_poly contains more than 10 polygons. + # + # @overload create_reference_image(request, options = nil) + # Pass arguments to `create_reference_image` via a request object, either of type + # {::Google::Cloud::Vision::V1p4beta1::CreateReferenceImageRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Vision::V1p4beta1::CreateReferenceImageRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_reference_image(parent: nil, reference_image: nil, reference_image_id: nil) + # Pass arguments to `create_reference_image` via keyword arguments. Note that at + # least one keyword argument is 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. Resource name of the product in which to create the reference + # image. + # + # Format is + # `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`. + # @param reference_image [::Google::Cloud::Vision::V1p4beta1::ReferenceImage, ::Hash] + # Required. The reference image to create. + # If an image ID is specified, it is ignored. + # @param reference_image_id [::String] + # A user-supplied resource id for the ReferenceImage to be added. If set, + # the server will attempt to use this value as the resource id. If it is + # already in use, an error is returned with code ALREADY_EXISTS. Must be at + # most 128 characters long. It cannot contain the character `/`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Vision::V1p4beta1::ReferenceImage] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Vision::V1p4beta1::ReferenceImage] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/vision/v1p4beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Vision::V1p4beta1::ProductSearch::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Vision::V1p4beta1::CreateReferenceImageRequest.new + # + # # Call the create_reference_image method. + # result = client.create_reference_image request + # + # # The returned object is of type Google::Cloud::Vision::V1p4beta1::ReferenceImage. + # p result + # + def create_reference_image request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Vision::V1p4beta1::CreateReferenceImageRequest + + # Converts hash 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_reference_image.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::Vision::V1p4beta1::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_reference_image.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_reference_image.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @product_search_stub.create_reference_image 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 a reference image. + # + # The image metadata will be deleted right away, but search queries + # against ProductSets containing the image may still work until all related + # caches are refreshed. + # + # The actual image files are not deleted from Google Cloud Storage. + # + # @overload delete_reference_image(request, options = nil) + # Pass arguments to `delete_reference_image` via a request object, either of type + # {::Google::Cloud::Vision::V1p4beta1::DeleteReferenceImageRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Vision::V1p4beta1::DeleteReferenceImageRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_reference_image(name: nil) + # Pass arguments to `delete_reference_image` via keyword arguments. Note that at + # least one keyword argument is 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 reference image to delete. + # + # Format is: + # + # `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID` + # @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/vision/v1p4beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Vision::V1p4beta1::ProductSearch::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Vision::V1p4beta1::DeleteReferenceImageRequest.new + # + # # Call the delete_reference_image method. + # result = client.delete_reference_image request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_reference_image request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Vision::V1p4beta1::DeleteReferenceImageRequest + + # Converts hash 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_reference_image.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::Vision::V1p4beta1::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_reference_image.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_reference_image.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @product_search_stub.delete_reference_image 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 reference images. + # + # Possible errors: + # + # * Returns NOT_FOUND if the parent product does not exist. + # * Returns INVALID_ARGUMENT if the page_size is greater than 100, or less + # than 1. + # + # @overload list_reference_images(request, options = nil) + # Pass arguments to `list_reference_images` via a request object, either of type + # {::Google::Cloud::Vision::V1p4beta1::ListReferenceImagesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Vision::V1p4beta1::ListReferenceImagesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_reference_images(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_reference_images` via keyword arguments. Note that at + # least one keyword argument is 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. Resource name of the product containing the reference images. + # + # Format is + # `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`. + # @param page_size [::Integer] + # The maximum number of items to return. Default 10, maximum 100. + # @param page_token [::String] + # A token identifying a page of results to be returned. This is the value + # of `nextPageToken` returned in a previous reference image list request. + # + # Defaults to the first page if not specified. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Vision::V1p4beta1::ReferenceImage>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Vision::V1p4beta1::ReferenceImage>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/vision/v1p4beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Vision::V1p4beta1::ProductSearch::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Vision::V1p4beta1::ListReferenceImagesRequest.new + # + # # Call the list_reference_images method. + # result = client.list_reference_images 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::Vision::V1p4beta1::ReferenceImage. + # p item + # end + # + def list_reference_images request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Vision::V1p4beta1::ListReferenceImagesRequest + + # Converts hash 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_reference_images.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::Vision::V1p4beta1::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_reference_images.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_reference_images.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @product_search_stub.list_reference_images request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @product_search_stub, :list_reference_images, "reference_images", 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 information associated with a ReferenceImage. + # + # Possible errors: + # + # * Returns NOT_FOUND if the specified image does not exist. + # + # @overload get_reference_image(request, options = nil) + # Pass arguments to `get_reference_image` via a request object, either of type + # {::Google::Cloud::Vision::V1p4beta1::GetReferenceImageRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Vision::V1p4beta1::GetReferenceImageRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_reference_image(name: nil) + # Pass arguments to `get_reference_image` via keyword arguments. Note that at + # least one keyword argument is 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 ReferenceImage to get. + # + # Format is: + # + # `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Vision::V1p4beta1::ReferenceImage] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Vision::V1p4beta1::ReferenceImage] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/vision/v1p4beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Vision::V1p4beta1::ProductSearch::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Vision::V1p4beta1::GetReferenceImageRequest.new + # + # # Call the get_reference_image method. + # result = client.get_reference_image request + # + # # The returned object is of type Google::Cloud::Vision::V1p4beta1::ReferenceImage. + # p result + # + def get_reference_image request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Vision::V1p4beta1::GetReferenceImageRequest + + # Converts hash 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_reference_image.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::Vision::V1p4beta1::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_reference_image.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_reference_image.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @product_search_stub.get_reference_image 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 + + ## + # Adds a Product to the specified ProductSet. If the Product is already + # present, no change is made. + # + # One Product can be added to at most 100 ProductSets. + # + # Possible errors: + # + # * Returns NOT_FOUND if the Product or the ProductSet doesn't exist. + # + # @overload add_product_to_product_set(request, options = nil) + # Pass arguments to `add_product_to_product_set` via a request object, either of type + # {::Google::Cloud::Vision::V1p4beta1::AddProductToProductSetRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Vision::V1p4beta1::AddProductToProductSetRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload add_product_to_product_set(name: nil, product: nil) + # Pass arguments to `add_product_to_product_set` via keyword arguments. Note that at + # least one keyword argument is 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 for the ProductSet to modify. + # + # Format is: + # `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID` + # @param product [::String] + # Required. The resource name for the Product to be added to this ProductSet. + # + # Format is: + # `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID` + # @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/vision/v1p4beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Vision::V1p4beta1::ProductSearch::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Vision::V1p4beta1::AddProductToProductSetRequest.new + # + # # Call the add_product_to_product_set method. + # result = client.add_product_to_product_set request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def add_product_to_product_set request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Vision::V1p4beta1::AddProductToProductSetRequest + + # Converts hash 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.add_product_to_product_set.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::Vision::V1p4beta1::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.add_product_to_product_set.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.add_product_to_product_set.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @product_search_stub.add_product_to_product_set 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 + + ## + # Removes a Product from the specified ProductSet. + # + # @overload remove_product_from_product_set(request, options = nil) + # Pass arguments to `remove_product_from_product_set` via a request object, either of type + # {::Google::Cloud::Vision::V1p4beta1::RemoveProductFromProductSetRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Vision::V1p4beta1::RemoveProductFromProductSetRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload remove_product_from_product_set(name: nil, product: nil) + # Pass arguments to `remove_product_from_product_set` via keyword arguments. Note that at + # least one keyword argument is 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 for the ProductSet to modify. + # + # Format is: + # `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID` + # @param product [::String] + # Required. The resource name for the Product to be removed from this + # ProductSet. + # + # Format is: + # `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID` + # @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/vision/v1p4beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Vision::V1p4beta1::ProductSearch::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Vision::V1p4beta1::RemoveProductFromProductSetRequest.new + # + # # Call the remove_product_from_product_set method. + # result = client.remove_product_from_product_set request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def remove_product_from_product_set request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Vision::V1p4beta1::RemoveProductFromProductSetRequest + + # Converts hash 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.remove_product_from_product_set.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::Vision::V1p4beta1::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.remove_product_from_product_set.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.remove_product_from_product_set.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @product_search_stub.remove_product_from_product_set 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 the Products in a ProductSet, in an unspecified order. If the + # ProductSet does not exist, the products field of the response will be + # empty. + # + # Possible errors: + # + # * Returns INVALID_ARGUMENT if page_size is greater than 100 or less than 1. + # + # @overload list_products_in_product_set(request, options = nil) + # Pass arguments to `list_products_in_product_set` via a request object, either of type + # {::Google::Cloud::Vision::V1p4beta1::ListProductsInProductSetRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Vision::V1p4beta1::ListProductsInProductSetRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_products_in_product_set(name: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_products_in_product_set` via keyword arguments. Note that at + # least one keyword argument is 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 ProductSet resource for which to retrieve Products. + # + # Format is: + # `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID` + # @param page_size [::Integer] + # The maximum number of items to return. Default 10, maximum 100. + # @param page_token [::String] + # The next_page_token returned from a previous List request, if any. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Vision::V1p4beta1::Product>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Vision::V1p4beta1::Product>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/vision/v1p4beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Vision::V1p4beta1::ProductSearch::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Vision::V1p4beta1::ListProductsInProductSetRequest.new + # + # # Call the list_products_in_product_set method. + # result = client.list_products_in_product_set 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::Vision::V1p4beta1::Product. + # p item + # end + # + def list_products_in_product_set request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Vision::V1p4beta1::ListProductsInProductSetRequest + + # Converts hash 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_products_in_product_set.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::Vision::V1p4beta1::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_products_in_product_set.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_products_in_product_set.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @product_search_stub.list_products_in_product_set request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @product_search_stub, :list_products_in_product_set, "products", 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 + + ## + # Asynchronous API that imports a list of reference images to specified + # product sets based on a list of image information. + # + # The {::Google::Longrunning::Operation google.longrunning.Operation} API can be + # used to keep track of the progress and results of the request. + # `Operation.metadata` contains `BatchOperationMetadata`. (progress) + # `Operation.response` contains `ImportProductSetsResponse`. (results) + # + # The input source of this method is a csv file on Google Cloud Storage. + # For the format of the csv file please see + # {::Google::Cloud::Vision::V1p4beta1::ImportProductSetsGcsSource#csv_file_uri ImportProductSetsGcsSource.csv_file_uri}. + # + # @overload import_product_sets(request, options = nil) + # Pass arguments to `import_product_sets` via a request object, either of type + # {::Google::Cloud::Vision::V1p4beta1::ImportProductSetsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Vision::V1p4beta1::ImportProductSetsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_product_sets(parent: nil, input_config: nil) + # Pass arguments to `import_product_sets` via keyword arguments. Note that at + # least one keyword argument is 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 in which the ProductSets should be imported. + # + # Format is `projects/PROJECT_ID/locations/LOC_ID`. + # @param input_config [::Google::Cloud::Vision::V1p4beta1::ImportProductSetsInputConfig, ::Hash] + # Required. The input content for the list of requests. + # @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/vision/v1p4beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Vision::V1p4beta1::ProductSearch::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Vision::V1p4beta1::ImportProductSetsRequest.new + # + # # Call the import_product_sets method. + # result = client.import_product_sets 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 import_product_sets request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Vision::V1p4beta1::ImportProductSetsRequest + + # Converts hash 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_product_sets.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::Vision::V1p4beta1::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_product_sets.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.import_product_sets.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @product_search_stub.import_product_sets 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 + + ## + # Asynchronous API to delete all Products in a ProductSet or all Products + # that are in no ProductSet. + # + # If a Product is a member of the specified ProductSet in addition to other + # ProductSets, the Product will still be deleted. + # + # It is recommended to not delete the specified ProductSet until after this + # operation has completed. It is also recommended to not add any of the + # Products involved in the batch delete to a new ProductSet while this + # operation is running because those Products may still end up deleted. + # + # It's not possible to undo the PurgeProducts operation. Therefore, it is + # recommended to keep the csv files used in ImportProductSets (if that was + # how you originally built the Product Set) before starting PurgeProducts, in + # case you need to re-import the data after deletion. + # + # If the plan is to purge all of the Products from a ProductSet and then + # re-use the empty ProductSet to re-import new Products into the empty + # ProductSet, you must wait until the PurgeProducts operation has finished + # for that ProductSet. + # + # The {::Google::Longrunning::Operation google.longrunning.Operation} API can be + # used to keep track of the progress and results of the request. + # `Operation.metadata` contains `BatchOperationMetadata`. (progress) + # + # @overload purge_products(request, options = nil) + # Pass arguments to `purge_products` via a request object, either of type + # {::Google::Cloud::Vision::V1p4beta1::PurgeProductsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Vision::V1p4beta1::PurgeProductsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload purge_products(product_set_purge_config: nil, delete_orphan_products: nil, parent: nil, force: nil) + # Pass arguments to `purge_products` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param product_set_purge_config [::Google::Cloud::Vision::V1p4beta1::ProductSetPurgeConfig, ::Hash] + # Specify which ProductSet contains the Products to be deleted. + # + # Note: The following parameters are mutually exclusive: `product_set_purge_config`, `delete_orphan_products`. 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 delete_orphan_products [::Boolean] + # If delete_orphan_products is true, all Products that are not in any + # ProductSet will be deleted. + # + # Note: The following parameters are mutually exclusive: `delete_orphan_products`, `product_set_purge_config`. 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 parent [::String] + # Required. The project and location in which the Products should be deleted. + # + # Format is `projects/PROJECT_ID/locations/LOC_ID`. + # @param force [::Boolean] + # The default value is false. Override this value to true to actually perform + # the purge. + # @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/vision/v1p4beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Vision::V1p4beta1::ProductSearch::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Vision::V1p4beta1::PurgeProductsRequest.new + # + # # Call the purge_products method. + # result = client.purge_products 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 purge_products request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Vision::V1p4beta1::PurgeProductsRequest + + # Converts hash 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.purge_products.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::Vision::V1p4beta1::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.purge_products.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.purge_products.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @product_search_stub.purge_products 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 + + ## + # Configuration class for the ProductSearch REST API. + # + # This class represents the configuration for ProductSearch 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::Vision::V1p4beta1::ProductSearch::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_product_set to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Vision::V1p4beta1::ProductSearch::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.create_product_set.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Vision::V1p4beta1::ProductSearch::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.create_product_set.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 = "vision.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 ProductSearch 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_product_set` + # @return [::Gapic::Config::Method] + # + attr_reader :create_product_set + ## + # RPC-specific configuration for `list_product_sets` + # @return [::Gapic::Config::Method] + # + attr_reader :list_product_sets + ## + # RPC-specific configuration for `get_product_set` + # @return [::Gapic::Config::Method] + # + attr_reader :get_product_set + ## + # RPC-specific configuration for `update_product_set` + # @return [::Gapic::Config::Method] + # + attr_reader :update_product_set + ## + # RPC-specific configuration for `delete_product_set` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_product_set + ## + # RPC-specific configuration for `create_product` + # @return [::Gapic::Config::Method] + # + attr_reader :create_product + ## + # RPC-specific configuration for `list_products` + # @return [::Gapic::Config::Method] + # + attr_reader :list_products + ## + # RPC-specific configuration for `get_product` + # @return [::Gapic::Config::Method] + # + attr_reader :get_product + ## + # RPC-specific configuration for `update_product` + # @return [::Gapic::Config::Method] + # + attr_reader :update_product + ## + # RPC-specific configuration for `delete_product` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_product + ## + # RPC-specific configuration for `create_reference_image` + # @return [::Gapic::Config::Method] + # + attr_reader :create_reference_image + ## + # RPC-specific configuration for `delete_reference_image` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_reference_image + ## + # RPC-specific configuration for `list_reference_images` + # @return [::Gapic::Config::Method] + # + attr_reader :list_reference_images + ## + # RPC-specific configuration for `get_reference_image` + # @return [::Gapic::Config::Method] + # + attr_reader :get_reference_image + ## + # RPC-specific configuration for `add_product_to_product_set` + # @return [::Gapic::Config::Method] + # + attr_reader :add_product_to_product_set + ## + # RPC-specific configuration for `remove_product_from_product_set` + # @return [::Gapic::Config::Method] + # + attr_reader :remove_product_from_product_set + ## + # RPC-specific configuration for `list_products_in_product_set` + # @return [::Gapic::Config::Method] + # + attr_reader :list_products_in_product_set + ## + # RPC-specific configuration for `import_product_sets` + # @return [::Gapic::Config::Method] + # + attr_reader :import_product_sets + ## + # RPC-specific configuration for `purge_products` + # @return [::Gapic::Config::Method] + # + attr_reader :purge_products + + # @private + def initialize parent_rpcs = nil + create_product_set_config = parent_rpcs.create_product_set if parent_rpcs.respond_to? :create_product_set + @create_product_set = ::Gapic::Config::Method.new create_product_set_config + list_product_sets_config = parent_rpcs.list_product_sets if parent_rpcs.respond_to? :list_product_sets + @list_product_sets = ::Gapic::Config::Method.new list_product_sets_config + get_product_set_config = parent_rpcs.get_product_set if parent_rpcs.respond_to? :get_product_set + @get_product_set = ::Gapic::Config::Method.new get_product_set_config + update_product_set_config = parent_rpcs.update_product_set if parent_rpcs.respond_to? :update_product_set + @update_product_set = ::Gapic::Config::Method.new update_product_set_config + delete_product_set_config = parent_rpcs.delete_product_set if parent_rpcs.respond_to? :delete_product_set + @delete_product_set = ::Gapic::Config::Method.new delete_product_set_config + create_product_config = parent_rpcs.create_product if parent_rpcs.respond_to? :create_product + @create_product = ::Gapic::Config::Method.new create_product_config + list_products_config = parent_rpcs.list_products if parent_rpcs.respond_to? :list_products + @list_products = ::Gapic::Config::Method.new list_products_config + get_product_config = parent_rpcs.get_product if parent_rpcs.respond_to? :get_product + @get_product = ::Gapic::Config::Method.new get_product_config + update_product_config = parent_rpcs.update_product if parent_rpcs.respond_to? :update_product + @update_product = ::Gapic::Config::Method.new update_product_config + delete_product_config = parent_rpcs.delete_product if parent_rpcs.respond_to? :delete_product + @delete_product = ::Gapic::Config::Method.new delete_product_config + create_reference_image_config = parent_rpcs.create_reference_image if parent_rpcs.respond_to? :create_reference_image + @create_reference_image = ::Gapic::Config::Method.new create_reference_image_config + delete_reference_image_config = parent_rpcs.delete_reference_image if parent_rpcs.respond_to? :delete_reference_image + @delete_reference_image = ::Gapic::Config::Method.new delete_reference_image_config + list_reference_images_config = parent_rpcs.list_reference_images if parent_rpcs.respond_to? :list_reference_images + @list_reference_images = ::Gapic::Config::Method.new list_reference_images_config + get_reference_image_config = parent_rpcs.get_reference_image if parent_rpcs.respond_to? :get_reference_image + @get_reference_image = ::Gapic::Config::Method.new get_reference_image_config + add_product_to_product_set_config = parent_rpcs.add_product_to_product_set if parent_rpcs.respond_to? :add_product_to_product_set + @add_product_to_product_set = ::Gapic::Config::Method.new add_product_to_product_set_config + remove_product_from_product_set_config = parent_rpcs.remove_product_from_product_set if parent_rpcs.respond_to? :remove_product_from_product_set + @remove_product_from_product_set = ::Gapic::Config::Method.new remove_product_from_product_set_config + list_products_in_product_set_config = parent_rpcs.list_products_in_product_set if parent_rpcs.respond_to? :list_products_in_product_set + @list_products_in_product_set = ::Gapic::Config::Method.new list_products_in_product_set_config + import_product_sets_config = parent_rpcs.import_product_sets if parent_rpcs.respond_to? :import_product_sets + @import_product_sets = ::Gapic::Config::Method.new import_product_sets_config + purge_products_config = parent_rpcs.purge_products if parent_rpcs.respond_to? :purge_products + @purge_products = ::Gapic::Config::Method.new purge_products_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1/product_search/rest/operations.rb b/owl-bot-staging/google-cloud-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1/product_search/rest/operations.rb new file mode 100644 index 000000000000..7aac05d68b97 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1/product_search/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 Vision + module V1p4beta1 + module ProductSearch + module Rest + # Service that implements Longrunning Operations API. + class Operations + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "vision.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :operations_stub + + ## + # Configuration for the ProductSearch 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 ProductSearch 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::Vision::V1p4beta1::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::Vision::V1p4beta1::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::Vision::V1p4beta1::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::Vision::V1p4beta1::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 = "vision.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{^operations(?:/.*)?$}, true] + ] + ) + 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-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1/product_search/rest/service_stub.rb b/owl-bot-staging/google-cloud-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1/product_search/rest/service_stub.rb new file mode 100644 index 000000000000..7c4814833ba5 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1/product_search/rest/service_stub.rb @@ -0,0 +1,1249 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/vision/v1p4beta1/product_search_service_pb" + +module Google + module Cloud + module Vision + module V1p4beta1 + module ProductSearch + module Rest + ## + # REST service stub for the ProductSearch 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_product_set REST call + # + # @param request_pb [::Google::Cloud::Vision::V1p4beta1::CreateProductSetRequest] + # 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::Vision::V1p4beta1::ProductSet] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Vision::V1p4beta1::ProductSet] + # A result object deserialized from the server's reply + def create_product_set request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_product_set_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_product_set", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Vision::V1p4beta1::ProductSet.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_product_sets REST call + # + # @param request_pb [::Google::Cloud::Vision::V1p4beta1::ListProductSetsRequest] + # 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::Vision::V1p4beta1::ListProductSetsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Vision::V1p4beta1::ListProductSetsResponse] + # A result object deserialized from the server's reply + def list_product_sets request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_product_sets_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_product_sets", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Vision::V1p4beta1::ListProductSetsResponse.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_product_set REST call + # + # @param request_pb [::Google::Cloud::Vision::V1p4beta1::GetProductSetRequest] + # 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::Vision::V1p4beta1::ProductSet] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Vision::V1p4beta1::ProductSet] + # A result object deserialized from the server's reply + def get_product_set request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_product_set_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_product_set", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Vision::V1p4beta1::ProductSet.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_product_set REST call + # + # @param request_pb [::Google::Cloud::Vision::V1p4beta1::UpdateProductSetRequest] + # 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::Vision::V1p4beta1::ProductSet] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Vision::V1p4beta1::ProductSet] + # A result object deserialized from the server's reply + def update_product_set request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_product_set_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_product_set", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Vision::V1p4beta1::ProductSet.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_product_set REST call + # + # @param request_pb [::Google::Cloud::Vision::V1p4beta1::DeleteProductSetRequest] + # 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_product_set request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_product_set_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_product_set", + 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 create_product REST call + # + # @param request_pb [::Google::Cloud::Vision::V1p4beta1::CreateProductRequest] + # 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::Vision::V1p4beta1::Product] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Vision::V1p4beta1::Product] + # A result object deserialized from the server's reply + def create_product request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_product_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_product", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Vision::V1p4beta1::Product.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_products REST call + # + # @param request_pb [::Google::Cloud::Vision::V1p4beta1::ListProductsRequest] + # 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::Vision::V1p4beta1::ListProductsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Vision::V1p4beta1::ListProductsResponse] + # A result object deserialized from the server's reply + def list_products request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_products_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_products", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Vision::V1p4beta1::ListProductsResponse.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_product REST call + # + # @param request_pb [::Google::Cloud::Vision::V1p4beta1::GetProductRequest] + # 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::Vision::V1p4beta1::Product] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Vision::V1p4beta1::Product] + # A result object deserialized from the server's reply + def get_product request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_product_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_product", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Vision::V1p4beta1::Product.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_product REST call + # + # @param request_pb [::Google::Cloud::Vision::V1p4beta1::UpdateProductRequest] + # 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::Vision::V1p4beta1::Product] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Vision::V1p4beta1::Product] + # A result object deserialized from the server's reply + def update_product request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_product_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_product", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Vision::V1p4beta1::Product.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_product REST call + # + # @param request_pb [::Google::Cloud::Vision::V1p4beta1::DeleteProductRequest] + # 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_product request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_product_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_product", + 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 create_reference_image REST call + # + # @param request_pb [::Google::Cloud::Vision::V1p4beta1::CreateReferenceImageRequest] + # 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::Vision::V1p4beta1::ReferenceImage] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Vision::V1p4beta1::ReferenceImage] + # A result object deserialized from the server's reply + def create_reference_image request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_reference_image_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_reference_image", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Vision::V1p4beta1::ReferenceImage.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_reference_image REST call + # + # @param request_pb [::Google::Cloud::Vision::V1p4beta1::DeleteReferenceImageRequest] + # 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_reference_image request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_reference_image_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_reference_image", + 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 list_reference_images REST call + # + # @param request_pb [::Google::Cloud::Vision::V1p4beta1::ListReferenceImagesRequest] + # 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::Vision::V1p4beta1::ListReferenceImagesResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Vision::V1p4beta1::ListReferenceImagesResponse] + # A result object deserialized from the server's reply + def list_reference_images request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_reference_images_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_reference_images", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Vision::V1p4beta1::ListReferenceImagesResponse.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_reference_image REST call + # + # @param request_pb [::Google::Cloud::Vision::V1p4beta1::GetReferenceImageRequest] + # 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::Vision::V1p4beta1::ReferenceImage] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Vision::V1p4beta1::ReferenceImage] + # A result object deserialized from the server's reply + def get_reference_image request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_reference_image_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_reference_image", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Vision::V1p4beta1::ReferenceImage.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the add_product_to_product_set REST call + # + # @param request_pb [::Google::Cloud::Vision::V1p4beta1::AddProductToProductSetRequest] + # 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 add_product_to_product_set request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_add_product_to_product_set_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: "add_product_to_product_set", + 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 remove_product_from_product_set REST call + # + # @param request_pb [::Google::Cloud::Vision::V1p4beta1::RemoveProductFromProductSetRequest] + # 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 remove_product_from_product_set request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_remove_product_from_product_set_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: "remove_product_from_product_set", + 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 list_products_in_product_set REST call + # + # @param request_pb [::Google::Cloud::Vision::V1p4beta1::ListProductsInProductSetRequest] + # 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::Vision::V1p4beta1::ListProductsInProductSetResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Vision::V1p4beta1::ListProductsInProductSetResponse] + # A result object deserialized from the server's reply + def list_products_in_product_set request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_products_in_product_set_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_products_in_product_set", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Vision::V1p4beta1::ListProductsInProductSetResponse.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_product_sets REST call + # + # @param request_pb [::Google::Cloud::Vision::V1p4beta1::ImportProductSetsRequest] + # 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 import_product_sets request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_import_product_sets_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_product_sets", + 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 purge_products REST call + # + # @param request_pb [::Google::Cloud::Vision::V1p4beta1::PurgeProductsRequest] + # 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 purge_products request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_purge_products_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: "purge_products", + 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 + + ## + # @private + # + # GRPC transcoding helper method for the create_product_set REST call + # + # @param request_pb [::Google::Cloud::Vision::V1p4beta1::CreateProductSetRequest] + # 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_product_set_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1p4beta1/{parent}/productSets", + body: "product_set", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_product_sets REST call + # + # @param request_pb [::Google::Cloud::Vision::V1p4beta1::ListProductSetsRequest] + # 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_product_sets_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1p4beta1/{parent}/productSets", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_product_set REST call + # + # @param request_pb [::Google::Cloud::Vision::V1p4beta1::GetProductSetRequest] + # 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_product_set_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1p4beta1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/productSets/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_product_set REST call + # + # @param request_pb [::Google::Cloud::Vision::V1p4beta1::UpdateProductSetRequest] + # 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_product_set_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v1p4beta1/{product_set.name}", + body: "product_set", + matches: [ + ["product_set.name", %r{^projects/[^/]+/locations/[^/]+/productSets/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_product_set REST call + # + # @param request_pb [::Google::Cloud::Vision::V1p4beta1::DeleteProductSetRequest] + # 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_product_set_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1p4beta1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/productSets/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_product REST call + # + # @param request_pb [::Google::Cloud::Vision::V1p4beta1::CreateProductRequest] + # 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_product_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1p4beta1/{parent}/products", + body: "product", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_products REST call + # + # @param request_pb [::Google::Cloud::Vision::V1p4beta1::ListProductsRequest] + # 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_products_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1p4beta1/{parent}/products", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_product REST call + # + # @param request_pb [::Google::Cloud::Vision::V1p4beta1::GetProductRequest] + # 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_product_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1p4beta1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/products/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_product REST call + # + # @param request_pb [::Google::Cloud::Vision::V1p4beta1::UpdateProductRequest] + # 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_product_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v1p4beta1/{product.name}", + body: "product", + matches: [ + ["product.name", %r{^projects/[^/]+/locations/[^/]+/products/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_product REST call + # + # @param request_pb [::Google::Cloud::Vision::V1p4beta1::DeleteProductRequest] + # 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_product_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1p4beta1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/products/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_reference_image REST call + # + # @param request_pb [::Google::Cloud::Vision::V1p4beta1::CreateReferenceImageRequest] + # 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_reference_image_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1p4beta1/{parent}/referenceImages", + body: "reference_image", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/products/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_reference_image REST call + # + # @param request_pb [::Google::Cloud::Vision::V1p4beta1::DeleteReferenceImageRequest] + # 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_reference_image_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1p4beta1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/products/[^/]+/referenceImages/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_reference_images REST call + # + # @param request_pb [::Google::Cloud::Vision::V1p4beta1::ListReferenceImagesRequest] + # 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_reference_images_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1p4beta1/{parent}/referenceImages", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/products/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_reference_image REST call + # + # @param request_pb [::Google::Cloud::Vision::V1p4beta1::GetReferenceImageRequest] + # 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_reference_image_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1p4beta1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/products/[^/]+/referenceImages/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the add_product_to_product_set REST call + # + # @param request_pb [::Google::Cloud::Vision::V1p4beta1::AddProductToProductSetRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_add_product_to_product_set_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1p4beta1/{name}:addProduct", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/productSets/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the remove_product_from_product_set REST call + # + # @param request_pb [::Google::Cloud::Vision::V1p4beta1::RemoveProductFromProductSetRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_remove_product_from_product_set_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1p4beta1/{name}:removeProduct", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/productSets/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_products_in_product_set REST call + # + # @param request_pb [::Google::Cloud::Vision::V1p4beta1::ListProductsInProductSetRequest] + # 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_products_in_product_set_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1p4beta1/{name}/products", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/productSets/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the import_product_sets REST call + # + # @param request_pb [::Google::Cloud::Vision::V1p4beta1::ImportProductSetsRequest] + # 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_product_sets_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1p4beta1/{parent}/productSets:import", + body: "*", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the purge_products REST call + # + # @param request_pb [::Google::Cloud::Vision::V1p4beta1::PurgeProductsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_purge_products_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1p4beta1/{parent}/products:purge", + body: "*", + 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-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1/product_search_pb.rb b/owl-bot-staging/google-cloud-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1/product_search_pb.rb new file mode 100644 index 000000000000..09e3001149ae --- /dev/null +++ b/owl-bot-staging/google-cloud-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1/product_search_pb.rb @@ -0,0 +1,30 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/vision/v1p4beta1/product_search.proto + +require 'google/protobuf' + +require 'google/api/resource_pb' +require 'google/cloud/vision/v1p4beta1/geometry_pb' +require 'google/cloud/vision/v1p4beta1/product_search_service_pb' +require 'google/protobuf/timestamp_pb' + + +descriptor_data = "\n2google/cloud/vision/v1p4beta1/product_search.proto\x12\x1dgoogle.cloud.vision.v1p4beta1\x1a\x19google/api/resource.proto\x1a,google/cloud/vision/v1p4beta1/geometry.proto\x1a:google/cloud/vision/v1p4beta1/product_search_service.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xc1\x01\n\x13ProductSearchParams\x12\x42\n\rbounding_poly\x18\t \x01(\x0b\x32+.google.cloud.vision.v1p4beta1.BoundingPoly\x12:\n\x0bproduct_set\x18\x06 \x01(\tB%\xfa\x41\"\n vision.googleapis.com/ProductSet\x12\x1a\n\x12product_categories\x18\x07 \x03(\t\x12\x0e\n\x06\x66ilter\x18\x08 \x01(\t\"\xb2\x05\n\x14ProductSearchResults\x12.\n\nindex_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12K\n\x07results\x18\x05 \x03(\x0b\x32:.google.cloud.vision.v1p4beta1.ProductSearchResults.Result\x12\x62\n\x17product_grouped_results\x18\x06 \x03(\x0b\x32\x41.google.cloud.vision.v1p4beta1.ProductSearchResults.GroupedResult\x1a_\n\x06Result\x12\x37\n\x07product\x18\x01 \x01(\x0b\x32&.google.cloud.vision.v1p4beta1.Product\x12\r\n\x05score\x18\x02 \x01(\x02\x12\r\n\x05image\x18\x03 \x01(\t\x1aS\n\x10ObjectAnnotation\x12\x0b\n\x03mid\x18\x01 \x01(\t\x12\x15\n\rlanguage_code\x18\x02 \x01(\t\x12\x0c\n\x04name\x18\x03 \x01(\t\x12\r\n\x05score\x18\x04 \x01(\x02\x1a\x82\x02\n\rGroupedResult\x12\x42\n\rbounding_poly\x18\x01 \x01(\x0b\x32+.google.cloud.vision.v1p4beta1.BoundingPoly\x12K\n\x07results\x18\x02 \x03(\x0b\x32:.google.cloud.vision.v1p4beta1.ProductSearchResults.Result\x12`\n\x12object_annotations\x18\x03 \x03(\x0b\x32\x44.google.cloud.vision.v1p4beta1.ProductSearchResults.ObjectAnnotationB~\n!com.google.cloud.vision.v1p4beta1B\x12ProductSearchProtoP\x01Z9cloud.google.com/go/vision/apiv1p4beta1/visionpb;visionpb\xf8\x01\x01\xa2\x02\x04GCVNb\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module Vision + module V1p4beta1 + ProductSearchParams = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p4beta1.ProductSearchParams").msgclass + ProductSearchResults = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p4beta1.ProductSearchResults").msgclass + ProductSearchResults::Result = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p4beta1.ProductSearchResults.Result").msgclass + ProductSearchResults::ObjectAnnotation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p4beta1.ProductSearchResults.ObjectAnnotation").msgclass + ProductSearchResults::GroupedResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p4beta1.ProductSearchResults.GroupedResult").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1/product_search_service_pb.rb b/owl-bot-staging/google-cloud-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1/product_search_service_pb.rb new file mode 100644 index 000000000000..9174582ef97d --- /dev/null +++ b/owl-bot-staging/google-cloud-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1/product_search_service_pb.rb @@ -0,0 +1,64 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/vision/v1p4beta1/product_search_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/vision/v1p4beta1/geometry_pb' +require 'google/longrunning/operations_pb' +require 'google/protobuf/empty_pb' +require 'google/protobuf/field_mask_pb' +require 'google/protobuf/timestamp_pb' +require 'google/rpc/status_pb' + + +descriptor_data = "\n:google/cloud/vision/v1p4beta1/product_search_service.proto\x12\x1dgoogle.cloud.vision.v1p4beta1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a,google/cloud/vision/v1p4beta1/geometry.proto\x1a#google/longrunning/operations.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x17google/rpc/status.proto\"\xb2\x02\n\x07Product\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x14\n\x0c\x64isplay_name\x18\x02 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x03 \x01(\t\x12\x1d\n\x10product_category\x18\x04 \x01(\tB\x03\xe0\x41\x05\x12G\n\x0eproduct_labels\x18\x05 \x03(\x0b\x32/.google.cloud.vision.v1p4beta1.Product.KeyValue\x1a&\n\x08KeyValue\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:^\xea\x41[\n\x1dvision.googleapis.com/Product\x12:projects/{project}/locations/{location}/products/{product}\"\xfd\x01\n\nProductSet\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x14\n\x0c\x64isplay_name\x18\x02 \x01(\t\x12\x33\n\nindex_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12,\n\x0bindex_error\x18\x04 \x01(\x0b\x32\x12.google.rpc.StatusB\x03\xe0\x41\x03:h\xea\x41\x65\n vision.googleapis.com/ProductSet\x12\x41projects/{project}/locations/{location}/productSets/{product_set}\"\x85\x02\n\x0eReferenceImage\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x10\n\x03uri\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12H\n\x0e\x62ounding_polys\x18\x03 \x03(\x0b\x32+.google.cloud.vision.v1p4beta1.BoundingPolyB\x03\xe0\x41\x01:\x88\x01\xea\x41\x84\x01\n$vision.googleapis.com/ReferenceImage\x12\\projects/{project}/locations/{location}/products/{product}/referenceImages/{reference_image}\"\xa3\x01\n\x14\x43reateProductRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\x12<\n\x07product\x18\x02 \x01(\x0b\x32&.google.cloud.vision.v1p4beta1.ProductB\x03\xe0\x41\x02\x12\x12\n\nproduct_id\x18\x03 \x01(\t\"w\n\x13ListProductsRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\"i\n\x14ListProductsResponse\x12\x38\n\x08products\x18\x01 \x03(\x0b\x32&.google.cloud.vision.v1p4beta1.Product\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"H\n\x11GetProductRequest\x12\x33\n\x04name\x18\x01 \x01(\tB%\xe0\x41\x02\xfa\x41\x1f\n\x1dvision.googleapis.com/Product\"\x85\x01\n\x14UpdateProductRequest\x12<\n\x07product\x18\x01 \x01(\x0b\x32&.google.cloud.vision.v1p4beta1.ProductB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"K\n\x14\x44\x65leteProductRequest\x12\x33\n\x04name\x18\x01 \x01(\tB%\xe0\x41\x02\xfa\x41\x1f\n\x1dvision.googleapis.com/Product\"\xb1\x01\n\x17\x43reateProductSetRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\x12\x43\n\x0bproduct_set\x18\x02 \x01(\x0b\x32).google.cloud.vision.v1p4beta1.ProductSetB\x03\xe0\x41\x02\x12\x16\n\x0eproduct_set_id\x18\x03 \x01(\t\"z\n\x16ListProductSetsRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\"s\n\x17ListProductSetsResponse\x12?\n\x0cproduct_sets\x18\x01 \x03(\x0b\x32).google.cloud.vision.v1p4beta1.ProductSet\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"N\n\x14GetProductSetRequest\x12\x36\n\x04name\x18\x01 \x01(\tB(\xe0\x41\x02\xfa\x41\"\n vision.googleapis.com/ProductSet\"\x8f\x01\n\x17UpdateProductSetRequest\x12\x43\n\x0bproduct_set\x18\x01 \x01(\x0b\x32).google.cloud.vision.v1p4beta1.ProductSetB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"Q\n\x17\x44\x65leteProductSetRequest\x12\x36\n\x04name\x18\x01 \x01(\tB(\xe0\x41\x02\xfa\x41\"\n vision.googleapis.com/ProductSet\"\xbd\x01\n\x1b\x43reateReferenceImageRequest\x12\x35\n\x06parent\x18\x01 \x01(\tB%\xe0\x41\x02\xfa\x41\x1f\n\x1dvision.googleapis.com/Product\x12K\n\x0freference_image\x18\x02 \x01(\x0b\x32-.google.cloud.vision.v1p4beta1.ReferenceImageB\x03\xe0\x41\x02\x12\x1a\n\x12reference_image_id\x18\x03 \x01(\t\"z\n\x1aListReferenceImagesRequest\x12\x35\n\x06parent\x18\x01 \x01(\tB%\xe0\x41\x02\xfa\x41\x1f\n\x1dvision.googleapis.com/Product\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\"\x92\x01\n\x1bListReferenceImagesResponse\x12G\n\x10reference_images\x18\x01 \x03(\x0b\x32-.google.cloud.vision.v1p4beta1.ReferenceImage\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x17\n\x0fnext_page_token\x18\x03 \x01(\t\"V\n\x18GetReferenceImageRequest\x12:\n\x04name\x18\x01 \x01(\tB,\xe0\x41\x02\xfa\x41&\n$vision.googleapis.com/ReferenceImage\"Y\n\x1b\x44\x65leteReferenceImageRequest\x12:\n\x04name\x18\x01 \x01(\tB,\xe0\x41\x02\xfa\x41&\n$vision.googleapis.com/ReferenceImage\"\x8f\x01\n\x1d\x41\x64\x64ProductToProductSetRequest\x12\x36\n\x04name\x18\x01 \x01(\tB(\xe0\x41\x02\xfa\x41\"\n vision.googleapis.com/ProductSet\x12\x36\n\x07product\x18\x02 \x01(\tB%\xe0\x41\x02\xfa\x41\x1f\n\x1dvision.googleapis.com/Product\"\x94\x01\n\"RemoveProductFromProductSetRequest\x12\x36\n\x04name\x18\x01 \x01(\tB(\xe0\x41\x02\xfa\x41\"\n vision.googleapis.com/ProductSet\x12\x36\n\x07product\x18\x02 \x01(\tB%\xe0\x41\x02\xfa\x41\x1f\n\x1dvision.googleapis.com/Product\"\x80\x01\n\x1fListProductsInProductSetRequest\x12\x36\n\x04name\x18\x01 \x01(\tB(\xe0\x41\x02\xfa\x41\"\n vision.googleapis.com/ProductSet\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\"u\n ListProductsInProductSetResponse\x12\x38\n\x08products\x18\x01 \x03(\x0b\x32&.google.cloud.vision.v1p4beta1.Product\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"2\n\x1aImportProductSetsGcsSource\x12\x14\n\x0c\x63sv_file_uri\x18\x01 \x01(\t\"y\n\x1cImportProductSetsInputConfig\x12O\n\ngcs_source\x18\x01 \x01(\x0b\x32\x39.google.cloud.vision.v1p4beta1.ImportProductSetsGcsSourceH\x00\x42\x08\n\x06source\"\xad\x01\n\x18ImportProductSetsRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\x12V\n\x0cinput_config\x18\x02 \x01(\x0b\x32;.google.cloud.vision.v1p4beta1.ImportProductSetsInputConfigB\x03\xe0\x41\x02\"\x8a\x01\n\x19ImportProductSetsResponse\x12G\n\x10reference_images\x18\x01 \x03(\x0b\x32-.google.cloud.vision.v1p4beta1.ReferenceImage\x12$\n\x08statuses\x18\x02 \x03(\x0b\x32\x12.google.rpc.Status\"\x9e\x02\n\x16\x42\x61tchOperationMetadata\x12J\n\x05state\x18\x01 \x01(\x0e\x32;.google.cloud.vision.v1p4beta1.BatchOperationMetadata.State\x12/\n\x0bsubmit_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12,\n\x08\x65nd_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"Y\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0e\n\nPROCESSING\x10\x01\x12\x0e\n\nSUCCESSFUL\x10\x02\x12\n\n\x06\x46\x41ILED\x10\x03\x12\r\n\tCANCELLED\x10\x04\"/\n\x15ProductSetPurgeConfig\x12\x16\n\x0eproduct_set_id\x18\x01 \x01(\t\"\xe6\x01\n\x14PurgeProductsRequest\x12X\n\x18product_set_purge_config\x18\x02 \x01(\x0b\x32\x34.google.cloud.vision.v1p4beta1.ProductSetPurgeConfigH\x00\x12 \n\x16\x64\x65lete_orphan_products\x18\x03 \x01(\x08H\x00\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\x12\r\n\x05\x66orce\x18\x04 \x01(\x08\x42\x08\n\x06target2\xd2 \n\rProductSearch\x12\xe6\x01\n\x10\x43reateProductSet\x12\x36.google.cloud.vision.v1p4beta1.CreateProductSetRequest\x1a).google.cloud.vision.v1p4beta1.ProductSet\"o\xda\x41!parent,product_set,product_set_id\x82\xd3\xe4\x93\x02\x45\"6/v1p4beta1/{parent=projects/*/locations/*}/productSets:\x0bproduct_set\x12\xc9\x01\n\x0fListProductSets\x12\x35.google.cloud.vision.v1p4beta1.ListProductSetsRequest\x1a\x36.google.cloud.vision.v1p4beta1.ListProductSetsResponse\"G\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x38\x12\x36/v1p4beta1/{parent=projects/*/locations/*}/productSets\x12\xb6\x01\n\rGetProductSet\x12\x33.google.cloud.vision.v1p4beta1.GetProductSetRequest\x1a).google.cloud.vision.v1p4beta1.ProductSet\"E\xda\x41\x04name\x82\xd3\xe4\x93\x02\x38\x12\x36/v1p4beta1/{name=projects/*/locations/*/productSets/*}\x12\xe8\x01\n\x10UpdateProductSet\x12\x36.google.cloud.vision.v1p4beta1.UpdateProductSetRequest\x1a).google.cloud.vision.v1p4beta1.ProductSet\"q\xda\x41\x17product_set,update_mask\x82\xd3\xe4\x93\x02Q2B/v1p4beta1/{product_set.name=projects/*/locations/*/productSets/*}:\x0bproduct_set\x12\xa9\x01\n\x10\x44\x65leteProductSet\x12\x36.google.cloud.vision.v1p4beta1.DeleteProductSetRequest\x1a\x16.google.protobuf.Empty\"E\xda\x41\x04name\x82\xd3\xe4\x93\x02\x38*6/v1p4beta1/{name=projects/*/locations/*/productSets/*}\x12\xce\x01\n\rCreateProduct\x12\x33.google.cloud.vision.v1p4beta1.CreateProductRequest\x1a&.google.cloud.vision.v1p4beta1.Product\"`\xda\x41\x19parent,product,product_id\x82\xd3\xe4\x93\x02>\"3/v1p4beta1/{parent=projects/*/locations/*}/products:\x07product\x12\xbd\x01\n\x0cListProducts\x12\x32.google.cloud.vision.v1p4beta1.ListProductsRequest\x1a\x33.google.cloud.vision.v1p4beta1.ListProductsResponse\"D\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x35\x12\x33/v1p4beta1/{parent=projects/*/locations/*}/products\x12\xaa\x01\n\nGetProduct\x12\x30.google.cloud.vision.v1p4beta1.GetProductRequest\x1a&.google.cloud.vision.v1p4beta1.Product\"B\xda\x41\x04name\x82\xd3\xe4\x93\x02\x35\x12\x33/v1p4beta1/{name=projects/*/locations/*/products/*}\x12\xd0\x01\n\rUpdateProduct\x12\x33.google.cloud.vision.v1p4beta1.UpdateProductRequest\x1a&.google.cloud.vision.v1p4beta1.Product\"b\xda\x41\x13product,update_mask\x82\xd3\xe4\x93\x02\x46\x32;/v1p4beta1/{product.name=projects/*/locations/*/products/*}:\x07product\x12\xa0\x01\n\rDeleteProduct\x12\x33.google.cloud.vision.v1p4beta1.DeleteProductRequest\x1a\x16.google.protobuf.Empty\"B\xda\x41\x04name\x82\xd3\xe4\x93\x02\x35*3/v1p4beta1/{name=projects/*/locations/*/products/*}\x12\x8e\x02\n\x14\x43reateReferenceImage\x12:.google.cloud.vision.v1p4beta1.CreateReferenceImageRequest\x1a-.google.cloud.vision.v1p4beta1.ReferenceImage\"\x8a\x01\xda\x41)parent,reference_image,reference_image_id\x82\xd3\xe4\x93\x02X\"E/v1p4beta1/{parent=projects/*/locations/*/products/*}/referenceImages:\x0freference_image\x12\xc0\x01\n\x14\x44\x65leteReferenceImage\x12:.google.cloud.vision.v1p4beta1.DeleteReferenceImageRequest\x1a\x16.google.protobuf.Empty\"T\xda\x41\x04name\x82\xd3\xe4\x93\x02G*E/v1p4beta1/{name=projects/*/locations/*/products/*/referenceImages/*}\x12\xe4\x01\n\x13ListReferenceImages\x12\x39.google.cloud.vision.v1p4beta1.ListReferenceImagesRequest\x1a:.google.cloud.vision.v1p4beta1.ListReferenceImagesResponse\"V\xda\x41\x06parent\x82\xd3\xe4\x93\x02G\x12\x45/v1p4beta1/{parent=projects/*/locations/*/products/*}/referenceImages\x12\xd1\x01\n\x11GetReferenceImage\x12\x37.google.cloud.vision.v1p4beta1.GetReferenceImageRequest\x1a-.google.cloud.vision.v1p4beta1.ReferenceImage\"T\xda\x41\x04name\x82\xd3\xe4\x93\x02G\x12\x45/v1p4beta1/{name=projects/*/locations/*/products/*/referenceImages/*}\x12\xcb\x01\n\x16\x41\x64\x64ProductToProductSet\x12<.google.cloud.vision.v1p4beta1.AddProductToProductSetRequest\x1a\x16.google.protobuf.Empty\"[\xda\x41\x0cname,product\x82\xd3\xe4\x93\x02\x46\"A/v1p4beta1/{name=projects/*/locations/*/productSets/*}:addProduct:\x01*\x12\xd8\x01\n\x1bRemoveProductFromProductSet\x12\x41.google.cloud.vision.v1p4beta1.RemoveProductFromProductSetRequest\x1a\x16.google.protobuf.Empty\"^\xda\x41\x0cname,product\x82\xd3\xe4\x93\x02I\"D/v1p4beta1/{name=projects/*/locations/*/productSets/*}:removeProduct:\x01*\x12\xeb\x01\n\x18ListProductsInProductSet\x12>.google.cloud.vision.v1p4beta1.ListProductsInProductSetRequest\x1a?.google.cloud.vision.v1p4beta1.ListProductsInProductSetResponse\"N\xda\x41\x04name\x82\xd3\xe4\x93\x02\x41\x12?/v1p4beta1/{name=projects/*/locations/*/productSets/*}/products\x12\x82\x02\n\x11ImportProductSets\x12\x37.google.cloud.vision.v1p4beta1.ImportProductSetsRequest\x1a\x1d.google.longrunning.Operation\"\x94\x01\xca\x41\x33\n\x19ImportProductSetsResponse\x12\x16\x42\x61tchOperationMetadata\xda\x41\x13parent,input_config\x82\xd3\xe4\x93\x02\x42\"=/v1p4beta1/{parent=projects/*/locations/*}/productSets:import:\x01*\x12\xe4\x01\n\rPurgeProducts\x12\x33.google.cloud.vision.v1p4beta1.PurgeProductsRequest\x1a\x1d.google.longrunning.Operation\"\x7f\xca\x41/\n\x15google.protobuf.Empty\x12\x16\x42\x61tchOperationMetadata\xda\x41\x06parent\x82\xd3\xe4\x93\x02>\"9/v1p4beta1/{parent=projects/*/locations/*}/products:purge:\x01*\x1av\xca\x41\x15vision.googleapis.com\xd2\x41[https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/cloud-visionB\x85\x01\n!com.google.cloud.vision.v1p4beta1B\x19ProductSearchServiceProtoP\x01Z9cloud.google.com/go/vision/apiv1p4beta1/visionpb;visionpb\xf8\x01\x01\xa2\x02\x04GCVNb\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module Vision + module V1p4beta1 + Product = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p4beta1.Product").msgclass + Product::KeyValue = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p4beta1.Product.KeyValue").msgclass + ProductSet = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p4beta1.ProductSet").msgclass + ReferenceImage = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p4beta1.ReferenceImage").msgclass + CreateProductRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p4beta1.CreateProductRequest").msgclass + ListProductsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p4beta1.ListProductsRequest").msgclass + ListProductsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p4beta1.ListProductsResponse").msgclass + GetProductRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p4beta1.GetProductRequest").msgclass + UpdateProductRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p4beta1.UpdateProductRequest").msgclass + DeleteProductRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p4beta1.DeleteProductRequest").msgclass + CreateProductSetRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p4beta1.CreateProductSetRequest").msgclass + ListProductSetsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p4beta1.ListProductSetsRequest").msgclass + ListProductSetsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p4beta1.ListProductSetsResponse").msgclass + GetProductSetRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p4beta1.GetProductSetRequest").msgclass + UpdateProductSetRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p4beta1.UpdateProductSetRequest").msgclass + DeleteProductSetRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p4beta1.DeleteProductSetRequest").msgclass + CreateReferenceImageRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p4beta1.CreateReferenceImageRequest").msgclass + ListReferenceImagesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p4beta1.ListReferenceImagesRequest").msgclass + ListReferenceImagesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p4beta1.ListReferenceImagesResponse").msgclass + GetReferenceImageRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p4beta1.GetReferenceImageRequest").msgclass + DeleteReferenceImageRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p4beta1.DeleteReferenceImageRequest").msgclass + AddProductToProductSetRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p4beta1.AddProductToProductSetRequest").msgclass + RemoveProductFromProductSetRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p4beta1.RemoveProductFromProductSetRequest").msgclass + ListProductsInProductSetRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p4beta1.ListProductsInProductSetRequest").msgclass + ListProductsInProductSetResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p4beta1.ListProductsInProductSetResponse").msgclass + ImportProductSetsGcsSource = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p4beta1.ImportProductSetsGcsSource").msgclass + ImportProductSetsInputConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p4beta1.ImportProductSetsInputConfig").msgclass + ImportProductSetsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p4beta1.ImportProductSetsRequest").msgclass + ImportProductSetsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p4beta1.ImportProductSetsResponse").msgclass + BatchOperationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p4beta1.BatchOperationMetadata").msgclass + BatchOperationMetadata::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p4beta1.BatchOperationMetadata.State").enummodule + ProductSetPurgeConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p4beta1.ProductSetPurgeConfig").msgclass + PurgeProductsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p4beta1.PurgeProductsRequest").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1/product_search_service_services_pb.rb b/owl-bot-staging/google-cloud-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1/product_search_service_services_pb.rb new file mode 100644 index 000000000000..9d8e60b47cfc --- /dev/null +++ b/owl-bot-staging/google-cloud-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1/product_search_service_services_pb.rb @@ -0,0 +1,236 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/cloud/vision/v1p4beta1/product_search_service.proto for package 'google.cloud.vision.v1p4beta1' +# 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/vision/v1p4beta1/product_search_service_pb' + +module Google + module Cloud + module Vision + module V1p4beta1 + module ProductSearch + # Manages Products and ProductSets of reference images for use in product + # search. It uses the following resource model: + # + # - The API has a collection of + # [ProductSet][google.cloud.vision.v1p4beta1.ProductSet] resources, named + # `projects/*/locations/*/productSets/*`, which acts as a way to put different + # products into groups to limit identification. + # + # In parallel, + # + # - The API has a collection of + # [Product][google.cloud.vision.v1p4beta1.Product] resources, named + # `projects/*/locations/*/products/*` + # + # - Each [Product][google.cloud.vision.v1p4beta1.Product] has a collection of + # [ReferenceImage][google.cloud.vision.v1p4beta1.ReferenceImage] resources, + # named + # `projects/*/locations/*/products/*/referenceImages/*` + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.cloud.vision.v1p4beta1.ProductSearch' + + # Creates and returns a new ProductSet resource. + # + # Possible errors: + # + # * Returns INVALID_ARGUMENT if display_name is missing, or is longer than + # 4096 characters. + rpc :CreateProductSet, ::Google::Cloud::Vision::V1p4beta1::CreateProductSetRequest, ::Google::Cloud::Vision::V1p4beta1::ProductSet + # Lists ProductSets in an unspecified order. + # + # Possible errors: + # + # * Returns INVALID_ARGUMENT if page_size is greater than 100, or less + # than 1. + rpc :ListProductSets, ::Google::Cloud::Vision::V1p4beta1::ListProductSetsRequest, ::Google::Cloud::Vision::V1p4beta1::ListProductSetsResponse + # Gets information associated with a ProductSet. + # + # Possible errors: + # + # * Returns NOT_FOUND if the ProductSet does not exist. + rpc :GetProductSet, ::Google::Cloud::Vision::V1p4beta1::GetProductSetRequest, ::Google::Cloud::Vision::V1p4beta1::ProductSet + # Makes changes to a ProductSet resource. + # Only display_name can be updated currently. + # + # Possible errors: + # + # * Returns NOT_FOUND if the ProductSet does not exist. + # * Returns INVALID_ARGUMENT if display_name is present in update_mask but + # missing from the request or longer than 4096 characters. + rpc :UpdateProductSet, ::Google::Cloud::Vision::V1p4beta1::UpdateProductSetRequest, ::Google::Cloud::Vision::V1p4beta1::ProductSet + # Permanently deletes a ProductSet. Products and ReferenceImages in the + # ProductSet are not deleted. + # + # The actual image files are not deleted from Google Cloud Storage. + rpc :DeleteProductSet, ::Google::Cloud::Vision::V1p4beta1::DeleteProductSetRequest, ::Google::Protobuf::Empty + # Creates and returns a new product resource. + # + # Possible errors: + # + # * Returns INVALID_ARGUMENT if display_name is missing or longer than 4096 + # characters. + # * Returns INVALID_ARGUMENT if description is longer than 4096 characters. + # * Returns INVALID_ARGUMENT if product_category is missing or invalid. + rpc :CreateProduct, ::Google::Cloud::Vision::V1p4beta1::CreateProductRequest, ::Google::Cloud::Vision::V1p4beta1::Product + # Lists products in an unspecified order. + # + # Possible errors: + # + # * Returns INVALID_ARGUMENT if page_size is greater than 100 or less than 1. + rpc :ListProducts, ::Google::Cloud::Vision::V1p4beta1::ListProductsRequest, ::Google::Cloud::Vision::V1p4beta1::ListProductsResponse + # Gets information associated with a Product. + # + # Possible errors: + # + # * Returns NOT_FOUND if the Product does not exist. + rpc :GetProduct, ::Google::Cloud::Vision::V1p4beta1::GetProductRequest, ::Google::Cloud::Vision::V1p4beta1::Product + # Makes changes to a Product resource. + # Only the `display_name`, `description`, and `labels` fields can be updated + # right now. + # + # If labels are updated, the change will not be reflected in queries until + # the next index time. + # + # Possible errors: + # + # * Returns NOT_FOUND if the Product does not exist. + # * Returns INVALID_ARGUMENT if display_name is present in update_mask but is + # missing from the request or longer than 4096 characters. + # * Returns INVALID_ARGUMENT if description is present in update_mask but is + # longer than 4096 characters. + # * Returns INVALID_ARGUMENT if product_category is present in update_mask. + rpc :UpdateProduct, ::Google::Cloud::Vision::V1p4beta1::UpdateProductRequest, ::Google::Cloud::Vision::V1p4beta1::Product + # Permanently deletes a product and its reference images. + # + # Metadata of the product and all its images will be deleted right away, but + # search queries against ProductSets containing the product may still work + # until all related caches are refreshed. + rpc :DeleteProduct, ::Google::Cloud::Vision::V1p4beta1::DeleteProductRequest, ::Google::Protobuf::Empty + # Creates and returns a new ReferenceImage resource. + # + # The `bounding_poly` field is optional. If `bounding_poly` is not specified, + # the system will try to detect regions of interest in the image that are + # compatible with the product_category on the parent product. If it is + # specified, detection is ALWAYS skipped. The system converts polygons into + # non-rotated rectangles. + # + # Note that the pipeline will resize the image if the image resolution is too + # large to process (above 50MP). + # + # Possible errors: + # + # * Returns INVALID_ARGUMENT if the image_uri is missing or longer than 4096 + # characters. + # * Returns INVALID_ARGUMENT if the product does not exist. + # * Returns INVALID_ARGUMENT if bounding_poly is not provided, and nothing + # compatible with the parent product's product_category is detected. + # * Returns INVALID_ARGUMENT if bounding_poly contains more than 10 polygons. + rpc :CreateReferenceImage, ::Google::Cloud::Vision::V1p4beta1::CreateReferenceImageRequest, ::Google::Cloud::Vision::V1p4beta1::ReferenceImage + # Permanently deletes a reference image. + # + # The image metadata will be deleted right away, but search queries + # against ProductSets containing the image may still work until all related + # caches are refreshed. + # + # The actual image files are not deleted from Google Cloud Storage. + rpc :DeleteReferenceImage, ::Google::Cloud::Vision::V1p4beta1::DeleteReferenceImageRequest, ::Google::Protobuf::Empty + # Lists reference images. + # + # Possible errors: + # + # * Returns NOT_FOUND if the parent product does not exist. + # * Returns INVALID_ARGUMENT if the page_size is greater than 100, or less + # than 1. + rpc :ListReferenceImages, ::Google::Cloud::Vision::V1p4beta1::ListReferenceImagesRequest, ::Google::Cloud::Vision::V1p4beta1::ListReferenceImagesResponse + # Gets information associated with a ReferenceImage. + # + # Possible errors: + # + # * Returns NOT_FOUND if the specified image does not exist. + rpc :GetReferenceImage, ::Google::Cloud::Vision::V1p4beta1::GetReferenceImageRequest, ::Google::Cloud::Vision::V1p4beta1::ReferenceImage + # Adds a Product to the specified ProductSet. If the Product is already + # present, no change is made. + # + # One Product can be added to at most 100 ProductSets. + # + # Possible errors: + # + # * Returns NOT_FOUND if the Product or the ProductSet doesn't exist. + rpc :AddProductToProductSet, ::Google::Cloud::Vision::V1p4beta1::AddProductToProductSetRequest, ::Google::Protobuf::Empty + # Removes a Product from the specified ProductSet. + rpc :RemoveProductFromProductSet, ::Google::Cloud::Vision::V1p4beta1::RemoveProductFromProductSetRequest, ::Google::Protobuf::Empty + # Lists the Products in a ProductSet, in an unspecified order. If the + # ProductSet does not exist, the products field of the response will be + # empty. + # + # Possible errors: + # + # * Returns INVALID_ARGUMENT if page_size is greater than 100 or less than 1. + rpc :ListProductsInProductSet, ::Google::Cloud::Vision::V1p4beta1::ListProductsInProductSetRequest, ::Google::Cloud::Vision::V1p4beta1::ListProductsInProductSetResponse + # Asynchronous API that imports a list of reference images to specified + # product sets based on a list of image information. + # + # The [google.longrunning.Operation][google.longrunning.Operation] API can be + # used to keep track of the progress and results of the request. + # `Operation.metadata` contains `BatchOperationMetadata`. (progress) + # `Operation.response` contains `ImportProductSetsResponse`. (results) + # + # The input source of this method is a csv file on Google Cloud Storage. + # For the format of the csv file please see + # [ImportProductSetsGcsSource.csv_file_uri][google.cloud.vision.v1p4beta1.ImportProductSetsGcsSource.csv_file_uri]. + rpc :ImportProductSets, ::Google::Cloud::Vision::V1p4beta1::ImportProductSetsRequest, ::Google::Longrunning::Operation + # Asynchronous API to delete all Products in a ProductSet or all Products + # that are in no ProductSet. + # + # If a Product is a member of the specified ProductSet in addition to other + # ProductSets, the Product will still be deleted. + # + # It is recommended to not delete the specified ProductSet until after this + # operation has completed. It is also recommended to not add any of the + # Products involved in the batch delete to a new ProductSet while this + # operation is running because those Products may still end up deleted. + # + # It's not possible to undo the PurgeProducts operation. Therefore, it is + # recommended to keep the csv files used in ImportProductSets (if that was + # how you originally built the Product Set) before starting PurgeProducts, in + # case you need to re-import the data after deletion. + # + # If the plan is to purge all of the Products from a ProductSet and then + # re-use the empty ProductSet to re-import new Products into the empty + # ProductSet, you must wait until the PurgeProducts operation has finished + # for that ProductSet. + # + # The [google.longrunning.Operation][google.longrunning.Operation] API can be + # used to keep track of the progress and results of the request. + # `Operation.metadata` contains `BatchOperationMetadata`. (progress) + rpc :PurgeProducts, ::Google::Cloud::Vision::V1p4beta1::PurgeProductsRequest, ::Google::Longrunning::Operation + end + + Stub = Service.rpc_stub_class + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1/rest.rb b/owl-bot-staging/google-cloud-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1/rest.rb new file mode 100644 index 000000000000..e5b113bc93a9 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1/rest.rb @@ -0,0 +1,38 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/vision/v1p4beta1/product_search/rest" +require "google/cloud/vision/v1p4beta1/image_annotator/rest" +require "google/cloud/vision/v1p4beta1/version" + +module Google + module Cloud + module Vision + ## + # To load just the REST part of this package, including all its services, and instantiate a REST client: + # + # @example + # + # require "google/cloud/vision/v1p4beta1/rest" + # client = ::Google::Cloud::Vision::V1p4beta1::ProductSearch::Rest::Client.new + # + module V1p4beta1 + end + end + end +end diff --git a/owl-bot-staging/google-cloud-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1/text_annotation_pb.rb b/owl-bot-staging/google-cloud-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1/text_annotation_pb.rb new file mode 100644 index 000000000000..e94c47e37a44 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1/text_annotation_pb.rb @@ -0,0 +1,33 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/vision/v1p4beta1/text_annotation.proto + +require 'google/protobuf' + +require 'google/cloud/vision/v1p4beta1/geometry_pb' + + +descriptor_data = "\n3google/cloud/vision/v1p4beta1/text_annotation.proto\x12\x1dgoogle.cloud.vision.v1p4beta1\x1a,google/cloud/vision/v1p4beta1/geometry.proto\"\xb2\x04\n\x0eTextAnnotation\x12\x32\n\x05pages\x18\x01 \x03(\x0b\x32#.google.cloud.vision.v1p4beta1.Page\x12\x0c\n\x04text\x18\x02 \x01(\t\x1a=\n\x10\x44\x65tectedLanguage\x12\x15\n\rlanguage_code\x18\x01 \x01(\t\x12\x12\n\nconfidence\x18\x02 \x01(\x02\x1a\xdc\x01\n\rDetectedBreak\x12S\n\x04type\x18\x01 \x01(\x0e\x32\x45.google.cloud.vision.v1p4beta1.TextAnnotation.DetectedBreak.BreakType\x12\x11\n\tis_prefix\x18\x02 \x01(\x08\"c\n\tBreakType\x12\x0b\n\x07UNKNOWN\x10\x00\x12\t\n\x05SPACE\x10\x01\x12\x0e\n\nSURE_SPACE\x10\x02\x12\x12\n\x0e\x45OL_SURE_SPACE\x10\x03\x12\n\n\x06HYPHEN\x10\x04\x12\x0e\n\nLINE_BREAK\x10\x05\x1a\xbf\x01\n\x0cTextProperty\x12Z\n\x12\x64\x65tected_languages\x18\x01 \x03(\x0b\x32>.google.cloud.vision.v1p4beta1.TextAnnotation.DetectedLanguage\x12S\n\x0e\x64\x65tected_break\x18\x02 \x01(\x0b\x32;.google.cloud.vision.v1p4beta1.TextAnnotation.DetectedBreak\"\xbd\x01\n\x04Page\x12L\n\x08property\x18\x01 \x01(\x0b\x32:.google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty\x12\r\n\x05width\x18\x02 \x01(\x05\x12\x0e\n\x06height\x18\x03 \x01(\x05\x12\x34\n\x06\x62locks\x18\x04 \x03(\x0b\x32$.google.cloud.vision.v1p4beta1.Block\x12\x12\n\nconfidence\x18\x05 \x01(\x02\"\x82\x03\n\x05\x42lock\x12L\n\x08property\x18\x01 \x01(\x0b\x32:.google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty\x12\x41\n\x0c\x62ounding_box\x18\x02 \x01(\x0b\x32+.google.cloud.vision.v1p4beta1.BoundingPoly\x12<\n\nparagraphs\x18\x03 \x03(\x0b\x32(.google.cloud.vision.v1p4beta1.Paragraph\x12\x42\n\nblock_type\x18\x04 \x01(\x0e\x32..google.cloud.vision.v1p4beta1.Block.BlockType\x12\x12\n\nconfidence\x18\x05 \x01(\x02\"R\n\tBlockType\x12\x0b\n\x07UNKNOWN\x10\x00\x12\x08\n\x04TEXT\x10\x01\x12\t\n\x05TABLE\x10\x02\x12\x0b\n\x07PICTURE\x10\x03\x12\t\n\x05RULER\x10\x04\x12\x0b\n\x07\x42\x41RCODE\x10\x05\"\xe4\x01\n\tParagraph\x12L\n\x08property\x18\x01 \x01(\x0b\x32:.google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty\x12\x41\n\x0c\x62ounding_box\x18\x02 \x01(\x0b\x32+.google.cloud.vision.v1p4beta1.BoundingPoly\x12\x32\n\x05words\x18\x03 \x03(\x0b\x32#.google.cloud.vision.v1p4beta1.Word\x12\x12\n\nconfidence\x18\x04 \x01(\x02\"\xe3\x01\n\x04Word\x12L\n\x08property\x18\x01 \x01(\x0b\x32:.google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty\x12\x41\n\x0c\x62ounding_box\x18\x02 \x01(\x0b\x32+.google.cloud.vision.v1p4beta1.BoundingPoly\x12\x36\n\x07symbols\x18\x03 \x03(\x0b\x32%.google.cloud.vision.v1p4beta1.Symbol\x12\x12\n\nconfidence\x18\x04 \x01(\x02\"\xbb\x01\n\x06Symbol\x12L\n\x08property\x18\x01 \x01(\x0b\x32:.google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty\x12\x41\n\x0c\x62ounding_box\x18\x02 \x01(\x0b\x32+.google.cloud.vision.v1p4beta1.BoundingPoly\x12\x0c\n\x04text\x18\x03 \x01(\t\x12\x12\n\nconfidence\x18\x04 \x01(\x02\x42\x7f\n!com.google.cloud.vision.v1p4beta1B\x13TextAnnotationProtoP\x01Z9cloud.google.com/go/vision/apiv1p4beta1/visionpb;visionpb\xf8\x01\x01\xa2\x02\x04GCVNb\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module Vision + module V1p4beta1 + TextAnnotation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p4beta1.TextAnnotation").msgclass + TextAnnotation::DetectedLanguage = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p4beta1.TextAnnotation.DetectedLanguage").msgclass + TextAnnotation::DetectedBreak = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p4beta1.TextAnnotation.DetectedBreak").msgclass + TextAnnotation::DetectedBreak::BreakType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p4beta1.TextAnnotation.DetectedBreak.BreakType").enummodule + TextAnnotation::TextProperty = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty").msgclass + Page = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p4beta1.Page").msgclass + Block = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p4beta1.Block").msgclass + Block::BlockType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p4beta1.Block.BlockType").enummodule + Paragraph = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p4beta1.Paragraph").msgclass + Word = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p4beta1.Word").msgclass + Symbol = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p4beta1.Symbol").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1/version.rb b/owl-bot-staging/google-cloud-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1/version.rb new file mode 100644 index 000000000000..8354c32c6ad6 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1/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 Vision + module V1p4beta1 + VERSION = "0.0.1" + end + end + end +end diff --git a/owl-bot-staging/google-cloud-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1/web_detection_pb.rb b/owl-bot-staging/google-cloud-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1/web_detection_pb.rb new file mode 100644 index 000000000000..af43ae9b8064 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1/web_detection_pb.rb @@ -0,0 +1,25 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/vision/v1p4beta1/web_detection.proto + +require 'google/protobuf' + + +descriptor_data = "\n1google/cloud/vision/v1p4beta1/web_detection.proto\x12\x1dgoogle.cloud.vision.v1p4beta1\"\x8c\x07\n\x0cWebDetection\x12K\n\x0cweb_entities\x18\x01 \x03(\x0b\x32\x35.google.cloud.vision.v1p4beta1.WebDetection.WebEntity\x12R\n\x14\x66ull_matching_images\x18\x02 \x03(\x0b\x32\x34.google.cloud.vision.v1p4beta1.WebDetection.WebImage\x12U\n\x17partial_matching_images\x18\x03 \x03(\x0b\x32\x34.google.cloud.vision.v1p4beta1.WebDetection.WebImage\x12W\n\x1apages_with_matching_images\x18\x04 \x03(\x0b\x32\x33.google.cloud.vision.v1p4beta1.WebDetection.WebPage\x12U\n\x17visually_similar_images\x18\x06 \x03(\x0b\x32\x34.google.cloud.vision.v1p4beta1.WebDetection.WebImage\x12O\n\x11\x62\x65st_guess_labels\x18\x08 \x03(\x0b\x32\x34.google.cloud.vision.v1p4beta1.WebDetection.WebLabel\x1a\x42\n\tWebEntity\x12\x11\n\tentity_id\x18\x01 \x01(\t\x12\r\n\x05score\x18\x02 \x01(\x02\x12\x13\n\x0b\x64\x65scription\x18\x03 \x01(\t\x1a&\n\x08WebImage\x12\x0b\n\x03url\x18\x01 \x01(\t\x12\r\n\x05score\x18\x02 \x01(\x02\x1a\xe4\x01\n\x07WebPage\x12\x0b\n\x03url\x18\x01 \x01(\t\x12\r\n\x05score\x18\x02 \x01(\x02\x12\x12\n\npage_title\x18\x03 \x01(\t\x12R\n\x14\x66ull_matching_images\x18\x04 \x03(\x0b\x32\x34.google.cloud.vision.v1p4beta1.WebDetection.WebImage\x12U\n\x17partial_matching_images\x18\x05 \x03(\x0b\x32\x34.google.cloud.vision.v1p4beta1.WebDetection.WebImage\x1a\x30\n\x08WebLabel\x12\r\n\x05label\x18\x01 \x01(\t\x12\x15\n\rlanguage_code\x18\x02 \x01(\tB}\n!com.google.cloud.vision.v1p4beta1B\x11WebDetectionProtoP\x01Z9cloud.google.com/go/vision/apiv1p4beta1/visionpb;visionpb\xf8\x01\x01\xa2\x02\x04GCVNb\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module Vision + module V1p4beta1 + WebDetection = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p4beta1.WebDetection").msgclass + WebDetection::WebEntity = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p4beta1.WebDetection.WebEntity").msgclass + WebDetection::WebImage = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p4beta1.WebDetection.WebImage").msgclass + WebDetection::WebPage = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p4beta1.WebDetection.WebPage").msgclass + WebDetection::WebLabel = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p4beta1.WebDetection.WebLabel").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-vision-v1p4beta1/proto_docs/README.md b/owl-bot-staging/google-cloud-vision-v1p4beta1/proto_docs/README.md new file mode 100644 index 000000000000..33f6816ca582 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision-v1p4beta1/proto_docs/README.md @@ -0,0 +1,4 @@ +# Cloud Vision V1p4beta1 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-vision-v1p4beta1/proto_docs/google/api/client.rb b/owl-bot-staging/google-cloud-vision-v1p4beta1/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..3ab0b096d445 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision-v1p4beta1/proto_docs/google/api/client.rb @@ -0,0 +1,593 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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. + # + # Note: This field should not be used in most cases. + 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: + # library_settings: + # 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. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Php. Clobbers the php_namespace option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.php.package_name" field + # in gapic.yaml. API teams should use the protobuf php_namespace option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # library_settings: + # php_settings: + # library_package: Google\Cloud\PubSub\V1 + 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. + # + # Example: + # + # 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 + # @!attribute [rw] batching + # @return [::Google::Api::BatchingConfigProto] + # Batching configuration for an API method in client libraries. + # + # Example of a YAML configuration: + # + # publishing: + # method_settings: + # - selector: google.example.v1.ExampleService.BatchCreateExample + # batching: + # element_count_threshold: 1000 + # request_byte_threshold: 100000000 + # delay_threshold_millis: 10 + 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. + # + # Note: This feature should not be used in most cases. + # @!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 + + # `BatchingConfigProto` defines the batching configuration for an API method. + # @!attribute [rw] thresholds + # @return [::Google::Api::BatchingSettingsProto] + # The thresholds which trigger a batched request to be sent. + # @!attribute [rw] batch_descriptor + # @return [::Google::Api::BatchingDescriptorProto] + # The request and response fields used in batching. + class BatchingConfigProto + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `BatchingSettingsProto` specifies a set of batching thresholds, each of + # which acts as a trigger to send a batch of messages as a request. At least + # one threshold must be positive nonzero. + # @!attribute [rw] element_count_threshold + # @return [::Integer] + # The number of elements of a field collected into a batch which, if + # exceeded, causes the batch to be sent. + # @!attribute [rw] request_byte_threshold + # @return [::Integer] + # The aggregated size of the batched field which, if exceeded, causes the + # batch to be sent. This size is computed by aggregating the sizes of the + # request field to be batched, not of the entire request message. + # @!attribute [rw] delay_threshold + # @return [::Google::Protobuf::Duration] + # The duration after which a batch should be sent, starting from the addition + # of the first message to that batch. + # @!attribute [rw] element_count_limit + # @return [::Integer] + # The maximum number of elements collected in a batch that could be accepted + # by server. + # @!attribute [rw] request_byte_limit + # @return [::Integer] + # The maximum size of the request that could be accepted by server. + # @!attribute [rw] flow_control_element_limit + # @return [::Integer] + # The maximum number of elements allowed by flow control. + # @!attribute [rw] flow_control_byte_limit + # @return [::Integer] + # The maximum size of data allowed by flow control. + # @!attribute [rw] flow_control_limit_exceeded_behavior + # @return [::Google::Api::FlowControlLimitExceededBehaviorProto] + # The behavior to take when the flow control limit is exceeded. + class BatchingSettingsProto + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `BatchingDescriptorProto` specifies the fields of the request message to be + # used for batching, and, optionally, the fields of the response message to be + # used for demultiplexing. + # @!attribute [rw] batched_field + # @return [::String] + # The repeated field in the request message to be aggregated by batching. + # @!attribute [rw] discriminator_fields + # @return [::Array<::String>] + # A list of the fields in the request message. Two requests will be batched + # together only if the values of every field specified in + # `request_discriminator_fields` is equal between the two requests. + # @!attribute [rw] subresponse_field + # @return [::String] + # Optional. When present, indicates the field in the response message to be + # used to demultiplex the response into multiple response messages, in + # correspondence with the multiple request messages originally batched + # together. + class BatchingDescriptorProto + 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 + + # The behavior to take when the flow control limit is exceeded. + module FlowControlLimitExceededBehaviorProto + # Default behavior, system-defined. + UNSET_BEHAVIOR = 0 + + # Stop operation, raise error. + THROW_EXCEPTION = 1 + + # Pause operation until limit clears. + BLOCK = 2 + + # Continue operation, disregard limit. + IGNORE = 3 + end + end +end diff --git a/owl-bot-staging/google-cloud-vision-v1p4beta1/proto_docs/google/api/field_behavior.rb b/owl-bot-staging/google-cloud-vision-v1p4beta1/proto_docs/google/api/field_behavior.rb new file mode 100644 index 000000000000..582be187d115 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision-v1p4beta1/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-vision-v1p4beta1/proto_docs/google/api/launch_stage.rb b/owl-bot-staging/google-cloud-vision-v1p4beta1/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..9392a413fb1b --- /dev/null +++ b/owl-bot-staging/google-cloud-vision-v1p4beta1/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-vision-v1p4beta1/proto_docs/google/api/resource.rb b/owl-bot-staging/google-cloud-vision-v1p4beta1/proto_docs/google/api/resource.rb new file mode 100644 index 000000000000..25dec4847ac1 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision-v1p4beta1/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-vision-v1p4beta1/proto_docs/google/cloud/vision/v1p4beta1/face.rb b/owl-bot-staging/google-cloud-vision-v1p4beta1/proto_docs/google/cloud/vision/v1p4beta1/face.rb new file mode 100644 index 000000000000..67c8368db2a6 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision-v1p4beta1/proto_docs/google/cloud/vision/v1p4beta1/face.rb @@ -0,0 +1,68 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Vision + module V1p4beta1 + # Parameters for a celebrity recognition request. + # @!attribute [rw] celebrity_set + # @return [::Array<::String>] + # The resource names for one or more + # [CelebritySet][google.cloud.vision.v1p4beta1.CelebritySet]s. A celebrity + # set is preloaded and can be specified as "builtin/default". If this is + # specified, the algorithm will try to match the faces detected in the input + # image to the Celebrities in the CelebritySets. + class FaceRecognitionParams + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A Celebrity is a group of Faces with an identity. + # @!attribute [rw] name + # @return [::String] + # The resource name of the preloaded Celebrity. Has the format + # `builtin/{mid}`. + # @!attribute [rw] display_name + # @return [::String] + # The Celebrity's display name. + # @!attribute [rw] description + # @return [::String] + # The Celebrity's description. + class Celebrity + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Information about a face's identity. + # @!attribute [rw] celebrity + # @return [::Google::Cloud::Vision::V1p4beta1::Celebrity] + # The {::Google::Cloud::Vision::V1p4beta1::Celebrity Celebrity} that this face was + # matched to. + # @!attribute [rw] confidence + # @return [::Float] + # Recognition confidence. Range [0, 1]. + class FaceRecognitionResult + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-vision-v1p4beta1/proto_docs/google/cloud/vision/v1p4beta1/geometry.rb b/owl-bot-staging/google-cloud-vision-v1p4beta1/proto_docs/google/cloud/vision/v1p4beta1/geometry.rb new file mode 100644 index 000000000000..c88392894891 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision-v1p4beta1/proto_docs/google/cloud/vision/v1p4beta1/geometry.rb @@ -0,0 +1,82 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Vision + module V1p4beta1 + # A vertex represents a 2D point in the image. + # NOTE: the vertex coordinates are in the same scale as the original image. + # @!attribute [rw] x + # @return [::Integer] + # X coordinate. + # @!attribute [rw] y + # @return [::Integer] + # Y coordinate. + class Vertex + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A vertex represents a 2D point in the image. + # NOTE: the normalized vertex coordinates are relative to the original image + # and range from 0 to 1. + # @!attribute [rw] x + # @return [::Float] + # X coordinate. + # @!attribute [rw] y + # @return [::Float] + # Y coordinate. + class NormalizedVertex + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A bounding polygon for the detected image annotation. + # @!attribute [rw] vertices + # @return [::Array<::Google::Cloud::Vision::V1p4beta1::Vertex>] + # The bounding polygon vertices. + # @!attribute [rw] normalized_vertices + # @return [::Array<::Google::Cloud::Vision::V1p4beta1::NormalizedVertex>] + # The bounding polygon normalized vertices. + class BoundingPoly + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A 3D position in the image, used primarily for Face detection landmarks. + # A valid Position must have both x and y coordinates. + # The position coordinates are in the same scale as the original image. + # @!attribute [rw] x + # @return [::Float] + # X coordinate. + # @!attribute [rw] y + # @return [::Float] + # Y coordinate. + # @!attribute [rw] z + # @return [::Float] + # Z coordinate (or depth). + class Position + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-vision-v1p4beta1/proto_docs/google/cloud/vision/v1p4beta1/image_annotator.rb b/owl-bot-staging/google-cloud-vision-v1p4beta1/proto_docs/google/cloud/vision/v1p4beta1/image_annotator.rb new file mode 100644 index 000000000000..fa038f2bcdd0 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision-v1p4beta1/proto_docs/google/cloud/vision/v1p4beta1/image_annotator.rb @@ -0,0 +1,994 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Vision + module V1p4beta1 + # The type of Google Cloud Vision API detection to perform, and the maximum + # number of results to return for that type. Multiple `Feature` objects can + # be specified in the `features` list. + # @!attribute [rw] type + # @return [::Google::Cloud::Vision::V1p4beta1::Feature::Type] + # The feature type. + # @!attribute [rw] max_results + # @return [::Integer] + # Maximum number of results of this type. Does not apply to + # `TEXT_DETECTION`, `DOCUMENT_TEXT_DETECTION`, or `CROP_HINTS`. + # @!attribute [rw] model + # @return [::String] + # Model to use for the feature. + # Supported values: "builtin/stable" (the default if unset) and + # "builtin/latest". `DOCUMENT_TEXT_DETECTION` and `TEXT_DETECTION` also + # support "builtin/weekly" for the bleeding edge release updated weekly. + class Feature + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Type of Google Cloud Vision API feature to be extracted. + module Type + # Unspecified feature type. + TYPE_UNSPECIFIED = 0 + + # Run face detection. + FACE_DETECTION = 1 + + # Run landmark detection. + LANDMARK_DETECTION = 2 + + # Run logo detection. + LOGO_DETECTION = 3 + + # Run label detection. + LABEL_DETECTION = 4 + + # Run text detection / optical character recognition (OCR). Text detection + # is optimized for areas of text within a larger image; if the image is + # a document, use `DOCUMENT_TEXT_DETECTION` instead. + TEXT_DETECTION = 5 + + # Run dense text document OCR. Takes precedence when both + # `DOCUMENT_TEXT_DETECTION` and `TEXT_DETECTION` are present. + DOCUMENT_TEXT_DETECTION = 11 + + # Run Safe Search to detect potentially unsafe + # or undesirable content. + SAFE_SEARCH_DETECTION = 6 + + # Compute a set of image properties, such as the + # image's dominant colors. + IMAGE_PROPERTIES = 7 + + # Run crop hints. + CROP_HINTS = 9 + + # Run web detection. + WEB_DETECTION = 10 + + # Run Product Search. + PRODUCT_SEARCH = 12 + + # Run localizer for object detection. + OBJECT_LOCALIZATION = 19 + end + end + + # External image source (Google Cloud Storage or web URL image location). + # @!attribute [rw] gcs_image_uri + # @return [::String] + # **Use `image_uri` instead.** + # + # The Google Cloud Storage URI of the form + # `gs://bucket_name/object_name`. Object versioning is not supported. See + # [Google Cloud Storage Request + # URIs](https://cloud.google.com/storage/docs/reference-uris) for more info. + # @!attribute [rw] image_uri + # @return [::String] + # The URI of the source image. Can be either: + # + # 1. A Google Cloud Storage URI of the form + # `gs://bucket_name/object_name`. Object versioning is not supported. See + # [Google Cloud Storage Request + # URIs](https://cloud.google.com/storage/docs/reference-uris) for more + # info. + # + # 2. A publicly-accessible image HTTP/HTTPS URL. When fetching images from + # HTTP/HTTPS URLs, Google cannot guarantee that the request will be + # completed. Your request may fail if the specified host denies the + # request (e.g. due to request throttling or DOS prevention), or if Google + # throttles requests to the site for abuse prevention. You should not + # depend on externally-hosted images for production applications. + # + # When both `gcs_image_uri` and `image_uri` are specified, `image_uri` takes + # precedence. + class ImageSource + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Client image to perform Google Cloud Vision API tasks over. + # @!attribute [rw] content + # @return [::String] + # Image content, represented as a stream of bytes. + # Note: As with all `bytes` fields, protobuffers use a pure binary + # representation, whereas JSON representations use base64. + # @!attribute [rw] source + # @return [::Google::Cloud::Vision::V1p4beta1::ImageSource] + # Google Cloud Storage image location, or publicly-accessible image + # URL. If both `content` and `source` are provided for an image, `content` + # takes precedence and is used to perform the image annotation request. + class Image + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A face annotation object contains the results of face detection. + # @!attribute [rw] bounding_poly + # @return [::Google::Cloud::Vision::V1p4beta1::BoundingPoly] + # The bounding polygon around the face. The coordinates of the bounding box + # are in the original image's scale. + # The bounding box is computed to "frame" the face in accordance with human + # expectations. It is based on the landmarker results. + # Note that one or more x and/or y coordinates may not be generated in the + # `BoundingPoly` (the polygon will be unbounded) if only a partial face + # appears in the image to be annotated. + # @!attribute [rw] fd_bounding_poly + # @return [::Google::Cloud::Vision::V1p4beta1::BoundingPoly] + # The `fd_bounding_poly` bounding polygon is tighter than the + # `boundingPoly`, and encloses only the skin part of the face. Typically, it + # is used to eliminate the face from any image analysis that detects the + # "amount of skin" visible in an image. It is not based on the + # landmarker results, only on the initial face detection, hence + # the fd (face detection) prefix. + # @!attribute [rw] landmarks + # @return [::Array<::Google::Cloud::Vision::V1p4beta1::FaceAnnotation::Landmark>] + # Detected face landmarks. + # @!attribute [rw] roll_angle + # @return [::Float] + # Roll angle, which indicates the amount of clockwise/anti-clockwise rotation + # of the face relative to the image vertical about the axis perpendicular to + # the face. Range [-180,180]. + # @!attribute [rw] pan_angle + # @return [::Float] + # Yaw angle, which indicates the leftward/rightward angle that the face is + # pointing relative to the vertical plane perpendicular to the image. Range + # [-180,180]. + # @!attribute [rw] tilt_angle + # @return [::Float] + # Pitch angle, which indicates the upwards/downwards angle that the face is + # pointing relative to the image's horizontal plane. Range [-180,180]. + # @!attribute [rw] detection_confidence + # @return [::Float] + # Detection confidence. Range [0, 1]. + # @!attribute [rw] landmarking_confidence + # @return [::Float] + # Face landmarking confidence. Range [0, 1]. + # @!attribute [rw] joy_likelihood + # @return [::Google::Cloud::Vision::V1p4beta1::Likelihood] + # Joy likelihood. + # @!attribute [rw] sorrow_likelihood + # @return [::Google::Cloud::Vision::V1p4beta1::Likelihood] + # Sorrow likelihood. + # @!attribute [rw] anger_likelihood + # @return [::Google::Cloud::Vision::V1p4beta1::Likelihood] + # Anger likelihood. + # @!attribute [rw] surprise_likelihood + # @return [::Google::Cloud::Vision::V1p4beta1::Likelihood] + # Surprise likelihood. + # @!attribute [rw] under_exposed_likelihood + # @return [::Google::Cloud::Vision::V1p4beta1::Likelihood] + # Under-exposed likelihood. + # @!attribute [rw] blurred_likelihood + # @return [::Google::Cloud::Vision::V1p4beta1::Likelihood] + # Blurred likelihood. + # @!attribute [rw] headwear_likelihood + # @return [::Google::Cloud::Vision::V1p4beta1::Likelihood] + # Headwear likelihood. + # @!attribute [rw] recognition_result + # @return [::Array<::Google::Cloud::Vision::V1p4beta1::FaceRecognitionResult>] + # Additional recognition information. Only computed if + # image_context.face_recognition_params is provided, **and** a match is found + # to a {::Google::Cloud::Vision::V1p4beta1::Celebrity Celebrity} in the input + # [CelebritySet][google.cloud.vision.v1p4beta1.CelebritySet]. This field is + # sorted in order of decreasing confidence values. + class FaceAnnotation + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # A face-specific landmark (for example, a face feature). + # @!attribute [rw] type + # @return [::Google::Cloud::Vision::V1p4beta1::FaceAnnotation::Landmark::Type] + # Face landmark type. + # @!attribute [rw] position + # @return [::Google::Cloud::Vision::V1p4beta1::Position] + # Face landmark position. + class Landmark + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Face landmark (feature) type. + # Left and right are defined from the vantage of the viewer of the image + # without considering mirror projections typical of photos. So, `LEFT_EYE`, + # typically, is the person's right eye. + module Type + # Unknown face landmark detected. Should not be filled. + UNKNOWN_LANDMARK = 0 + + # Left eye. + LEFT_EYE = 1 + + # Right eye. + RIGHT_EYE = 2 + + # Left of left eyebrow. + LEFT_OF_LEFT_EYEBROW = 3 + + # Right of left eyebrow. + RIGHT_OF_LEFT_EYEBROW = 4 + + # Left of right eyebrow. + LEFT_OF_RIGHT_EYEBROW = 5 + + # Right of right eyebrow. + RIGHT_OF_RIGHT_EYEBROW = 6 + + # Midpoint between eyes. + MIDPOINT_BETWEEN_EYES = 7 + + # Nose tip. + NOSE_TIP = 8 + + # Upper lip. + UPPER_LIP = 9 + + # Lower lip. + LOWER_LIP = 10 + + # Mouth left. + MOUTH_LEFT = 11 + + # Mouth right. + MOUTH_RIGHT = 12 + + # Mouth center. + MOUTH_CENTER = 13 + + # Nose, bottom right. + NOSE_BOTTOM_RIGHT = 14 + + # Nose, bottom left. + NOSE_BOTTOM_LEFT = 15 + + # Nose, bottom center. + NOSE_BOTTOM_CENTER = 16 + + # Left eye, top boundary. + LEFT_EYE_TOP_BOUNDARY = 17 + + # Left eye, right corner. + LEFT_EYE_RIGHT_CORNER = 18 + + # Left eye, bottom boundary. + LEFT_EYE_BOTTOM_BOUNDARY = 19 + + # Left eye, left corner. + LEFT_EYE_LEFT_CORNER = 20 + + # Right eye, top boundary. + RIGHT_EYE_TOP_BOUNDARY = 21 + + # Right eye, right corner. + RIGHT_EYE_RIGHT_CORNER = 22 + + # Right eye, bottom boundary. + RIGHT_EYE_BOTTOM_BOUNDARY = 23 + + # Right eye, left corner. + RIGHT_EYE_LEFT_CORNER = 24 + + # Left eyebrow, upper midpoint. + LEFT_EYEBROW_UPPER_MIDPOINT = 25 + + # Right eyebrow, upper midpoint. + RIGHT_EYEBROW_UPPER_MIDPOINT = 26 + + # Left ear tragion. + LEFT_EAR_TRAGION = 27 + + # Right ear tragion. + RIGHT_EAR_TRAGION = 28 + + # Left eye pupil. + LEFT_EYE_PUPIL = 29 + + # Right eye pupil. + RIGHT_EYE_PUPIL = 30 + + # Forehead glabella. + FOREHEAD_GLABELLA = 31 + + # Chin gnathion. + CHIN_GNATHION = 32 + + # Chin left gonion. + CHIN_LEFT_GONION = 33 + + # Chin right gonion. + CHIN_RIGHT_GONION = 34 + end + end + end + + # Detected entity location information. + # @!attribute [rw] lat_lng + # @return [::Google::Type::LatLng] + # lat/long location coordinates. + class LocationInfo + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A `Property` consists of a user-supplied name/value pair. + # @!attribute [rw] name + # @return [::String] + # Name of the property. + # @!attribute [rw] value + # @return [::String] + # Value of the property. + # @!attribute [rw] uint64_value + # @return [::Integer] + # Value of numeric properties. + class Property + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Set of detected entity features. + # @!attribute [rw] mid + # @return [::String] + # Opaque entity ID. Some IDs may be available in + # [Google Knowledge Graph Search + # API](https://developers.google.com/knowledge-graph/). + # @!attribute [rw] locale + # @return [::String] + # The language code for the locale in which the entity textual + # `description` is expressed. + # @!attribute [rw] description + # @return [::String] + # Entity textual description, expressed in its `locale` language. + # @!attribute [rw] score + # @return [::Float] + # Overall score of the result. Range [0, 1]. + # @!attribute [rw] confidence + # @deprecated This field is deprecated and may be removed in the next major version update. + # @return [::Float] + # **Deprecated. Use `score` instead.** + # The accuracy of the entity detection in an image. + # For example, for an image in which the "Eiffel Tower" entity is detected, + # this field represents the confidence that there is a tower in the query + # image. Range [0, 1]. + # @!attribute [rw] topicality + # @return [::Float] + # The relevancy of the ICA (Image Content Annotation) label to the + # image. For example, the relevancy of "tower" is likely higher to an image + # containing the detected "Eiffel Tower" than to an image containing a + # detected distant towering building, even though the confidence that + # there is a tower in each image may be the same. Range [0, 1]. + # @!attribute [rw] bounding_poly + # @return [::Google::Cloud::Vision::V1p4beta1::BoundingPoly] + # Image region to which this entity belongs. Not produced + # for `LABEL_DETECTION` features. + # @!attribute [rw] locations + # @return [::Array<::Google::Cloud::Vision::V1p4beta1::LocationInfo>] + # The location information for the detected entity. Multiple + # `LocationInfo` elements can be present because one location may + # indicate the location of the scene in the image, and another location + # may indicate the location of the place where the image was taken. + # Location information is usually present for landmarks. + # @!attribute [rw] properties + # @return [::Array<::Google::Cloud::Vision::V1p4beta1::Property>] + # Some entities may have optional user-supplied `Property` (name/value) + # fields, such a score or string that qualifies the entity. + class EntityAnnotation + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Set of detected objects with bounding boxes. + # @!attribute [rw] mid + # @return [::String] + # Object ID that should align with EntityAnnotation mid. + # @!attribute [rw] language_code + # @return [::String] + # The BCP-47 language code, such as "en-US" or "sr-Latn". For more + # information, see + # http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. + # @!attribute [rw] name + # @return [::String] + # Object name, expressed in its `language_code` language. + # @!attribute [rw] score + # @return [::Float] + # Score of the result. Range [0, 1]. + # @!attribute [rw] bounding_poly + # @return [::Google::Cloud::Vision::V1p4beta1::BoundingPoly] + # Image region to which this object belongs. This must be populated. + class LocalizedObjectAnnotation + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Set of features pertaining to the image, computed by computer vision + # methods over safe-search verticals (for example, adult, spoof, medical, + # violence). + # @!attribute [rw] adult + # @return [::Google::Cloud::Vision::V1p4beta1::Likelihood] + # Represents the adult content likelihood for the image. Adult content may + # contain elements such as nudity, pornographic images or cartoons, or + # sexual activities. + # @!attribute [rw] spoof + # @return [::Google::Cloud::Vision::V1p4beta1::Likelihood] + # Spoof likelihood. The likelihood that an modification + # was made to the image's canonical version to make it appear + # funny or offensive. + # @!attribute [rw] medical + # @return [::Google::Cloud::Vision::V1p4beta1::Likelihood] + # Likelihood that this is a medical image. + # @!attribute [rw] violence + # @return [::Google::Cloud::Vision::V1p4beta1::Likelihood] + # Likelihood that this image contains violent content. + # @!attribute [rw] racy + # @return [::Google::Cloud::Vision::V1p4beta1::Likelihood] + # Likelihood that the request image contains racy content. Racy content may + # include (but is not limited to) skimpy or sheer clothing, strategically + # covered nudity, lewd or provocative poses, or close-ups of sensitive + # body areas. + class SafeSearchAnnotation + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Rectangle determined by min and max `LatLng` pairs. + # @!attribute [rw] min_lat_lng + # @return [::Google::Type::LatLng] + # Min lat/long pair. + # @!attribute [rw] max_lat_lng + # @return [::Google::Type::LatLng] + # Max lat/long pair. + class LatLongRect + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Color information consists of RGB channels, score, and the fraction of + # the image that the color occupies in the image. + # @!attribute [rw] color + # @return [::Google::Type::Color] + # RGB components of the color. + # @!attribute [rw] score + # @return [::Float] + # Image-specific score for this color. Value in range [0, 1]. + # @!attribute [rw] pixel_fraction + # @return [::Float] + # The fraction of pixels the color occupies in the image. + # Value in range [0, 1]. + class ColorInfo + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Set of dominant colors and their corresponding scores. + # @!attribute [rw] colors + # @return [::Array<::Google::Cloud::Vision::V1p4beta1::ColorInfo>] + # RGB color values with their score and pixel fraction. + class DominantColorsAnnotation + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Stores image properties, such as dominant colors. + # @!attribute [rw] dominant_colors + # @return [::Google::Cloud::Vision::V1p4beta1::DominantColorsAnnotation] + # If present, dominant colors completed successfully. + class ImageProperties + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Single crop hint that is used to generate a new crop when serving an image. + # @!attribute [rw] bounding_poly + # @return [::Google::Cloud::Vision::V1p4beta1::BoundingPoly] + # The bounding polygon for the crop region. The coordinates of the bounding + # box are in the original image's scale. + # @!attribute [rw] confidence + # @return [::Float] + # Confidence of this being a salient region. Range [0, 1]. + # @!attribute [rw] importance_fraction + # @return [::Float] + # Fraction of importance of this salient region with respect to the original + # image. + class CropHint + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Set of crop hints that are used to generate new crops when serving images. + # @!attribute [rw] crop_hints + # @return [::Array<::Google::Cloud::Vision::V1p4beta1::CropHint>] + # Crop hint results. + class CropHintsAnnotation + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Parameters for crop hints annotation request. + # @!attribute [rw] aspect_ratios + # @return [::Array<::Float>] + # Aspect ratios in floats, representing the ratio of the width to the height + # of the image. For example, if the desired aspect ratio is 4/3, the + # corresponding float value should be 1.33333. If not specified, the + # best possible crop is returned. The number of provided aspect ratios is + # limited to a maximum of 16; any aspect ratios provided after the 16th are + # ignored. + class CropHintsParams + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Parameters for web detection request. + # @!attribute [rw] include_geo_results + # @return [::Boolean] + # Whether to include results derived from the geo information in the image. + class WebDetectionParams + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Parameters for text detections. This is used to control TEXT_DETECTION and + # DOCUMENT_TEXT_DETECTION features. + # @!attribute [rw] enable_text_detection_confidence_score + # @return [::Boolean] + # By default, Cloud Vision API only includes confidence score for + # DOCUMENT_TEXT_DETECTION result. Set the flag to true to include confidence + # score for TEXT_DETECTION as well. + # @!attribute [rw] advanced_ocr_options + # @return [::Array<::String>] + # A list of advanced OCR options to fine-tune OCR behavior. + class TextDetectionParams + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Image context and/or feature-specific parameters. + # @!attribute [rw] lat_long_rect + # @return [::Google::Cloud::Vision::V1p4beta1::LatLongRect] + # Not used. + # @!attribute [rw] language_hints + # @return [::Array<::String>] + # List of languages to use for TEXT_DETECTION. In most cases, an empty value + # yields the best results since it enables automatic language detection. For + # languages based on the Latin alphabet, setting `language_hints` is not + # needed. In rare cases, when the language of the text in the image is known, + # setting a hint will help get better results (although it will be a + # significant hindrance if the hint is wrong). Text detection returns an + # error if one or more of the specified languages is not one of the + # [supported languages](https://cloud.google.com/vision/docs/languages). + # @!attribute [rw] crop_hints_params + # @return [::Google::Cloud::Vision::V1p4beta1::CropHintsParams] + # Parameters for crop hints annotation request. + # @!attribute [rw] face_recognition_params + # @return [::Google::Cloud::Vision::V1p4beta1::FaceRecognitionParams] + # Parameters for face recognition. + # @!attribute [rw] product_search_params + # @return [::Google::Cloud::Vision::V1p4beta1::ProductSearchParams] + # Parameters for product search. + # @!attribute [rw] web_detection_params + # @return [::Google::Cloud::Vision::V1p4beta1::WebDetectionParams] + # Parameters for web detection. + # @!attribute [rw] text_detection_params + # @return [::Google::Cloud::Vision::V1p4beta1::TextDetectionParams] + # Parameters for text detection and document text detection. + class ImageContext + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request for performing Google Cloud Vision API tasks over a user-provided + # image, with user-requested features, and with context information. + # @!attribute [rw] image + # @return [::Google::Cloud::Vision::V1p4beta1::Image] + # The image to be processed. + # @!attribute [rw] features + # @return [::Array<::Google::Cloud::Vision::V1p4beta1::Feature>] + # Requested features. + # @!attribute [rw] image_context + # @return [::Google::Cloud::Vision::V1p4beta1::ImageContext] + # Additional context that may accompany the image. + class AnnotateImageRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # If an image was produced from a file (e.g. a PDF), this message gives + # information about the source of that image. + # @!attribute [rw] uri + # @return [::String] + # The URI of the file used to produce the image. + # @!attribute [rw] page_number + # @return [::Integer] + # If the file was a PDF or TIFF, this field gives the page number within + # the file used to produce the image. + class ImageAnnotationContext + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response to an image annotation request. + # @!attribute [rw] face_annotations + # @return [::Array<::Google::Cloud::Vision::V1p4beta1::FaceAnnotation>] + # If present, face detection has completed successfully. + # @!attribute [rw] landmark_annotations + # @return [::Array<::Google::Cloud::Vision::V1p4beta1::EntityAnnotation>] + # If present, landmark detection has completed successfully. + # @!attribute [rw] logo_annotations + # @return [::Array<::Google::Cloud::Vision::V1p4beta1::EntityAnnotation>] + # If present, logo detection has completed successfully. + # @!attribute [rw] label_annotations + # @return [::Array<::Google::Cloud::Vision::V1p4beta1::EntityAnnotation>] + # If present, label detection has completed successfully. + # @!attribute [rw] localized_object_annotations + # @return [::Array<::Google::Cloud::Vision::V1p4beta1::LocalizedObjectAnnotation>] + # If present, localized object detection has completed successfully. + # This will be sorted descending by confidence score. + # @!attribute [rw] text_annotations + # @return [::Array<::Google::Cloud::Vision::V1p4beta1::EntityAnnotation>] + # If present, text (OCR) detection has completed successfully. + # @!attribute [rw] full_text_annotation + # @return [::Google::Cloud::Vision::V1p4beta1::TextAnnotation] + # If present, text (OCR) detection or document (OCR) text detection has + # completed successfully. + # This annotation provides the structural hierarchy for the OCR detected + # text. + # @!attribute [rw] safe_search_annotation + # @return [::Google::Cloud::Vision::V1p4beta1::SafeSearchAnnotation] + # If present, safe-search annotation has completed successfully. + # @!attribute [rw] image_properties_annotation + # @return [::Google::Cloud::Vision::V1p4beta1::ImageProperties] + # If present, image properties were extracted successfully. + # @!attribute [rw] crop_hints_annotation + # @return [::Google::Cloud::Vision::V1p4beta1::CropHintsAnnotation] + # If present, crop hints have completed successfully. + # @!attribute [rw] web_detection + # @return [::Google::Cloud::Vision::V1p4beta1::WebDetection] + # If present, web detection has completed successfully. + # @!attribute [rw] product_search_results + # @return [::Google::Cloud::Vision::V1p4beta1::ProductSearchResults] + # If present, product search has completed successfully. + # @!attribute [rw] error + # @return [::Google::Rpc::Status] + # If set, represents the error message for the operation. + # Note that filled-in image annotations are guaranteed to be + # correct, even when `error` is set. + # @!attribute [rw] context + # @return [::Google::Cloud::Vision::V1p4beta1::ImageAnnotationContext] + # If present, contextual information is needed to understand where this image + # comes from. + class AnnotateImageResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Multiple image annotation requests are batched into a single service call. + # @!attribute [rw] requests + # @return [::Array<::Google::Cloud::Vision::V1p4beta1::AnnotateImageRequest>] + # Required. Individual image annotation requests for this batch. + class BatchAnnotateImagesRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response to a batch image annotation request. + # @!attribute [rw] responses + # @return [::Array<::Google::Cloud::Vision::V1p4beta1::AnnotateImageResponse>] + # Individual responses to image annotation requests within the batch. + class BatchAnnotateImagesResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A request to annotate one single file, e.g. a PDF, TIFF or GIF file. + # @!attribute [rw] input_config + # @return [::Google::Cloud::Vision::V1p4beta1::InputConfig] + # Required. Information about the input file. + # @!attribute [rw] features + # @return [::Array<::Google::Cloud::Vision::V1p4beta1::Feature>] + # Required. Requested features. + # @!attribute [rw] image_context + # @return [::Google::Cloud::Vision::V1p4beta1::ImageContext] + # Additional context that may accompany the image(s) in the file. + # @!attribute [rw] pages + # @return [::Array<::Integer>] + # Pages of the file to perform image annotation. + # + # Pages starts from 1, we assume the first page of the file is page 1. + # At most 5 pages are supported per request. Pages can be negative. + # + # Page 1 means the first page. + # Page 2 means the second page. + # Page -1 means the last page. + # Page -2 means the second to the last page. + # + # If the file is GIF instead of PDF or TIFF, page refers to GIF frames. + # + # If this field is empty, by default the service performs image annotation + # for the first 5 pages of the file. + class AnnotateFileRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response to a single file annotation request. A file may contain one or more + # images, which individually have their own responses. + # @!attribute [rw] input_config + # @return [::Google::Cloud::Vision::V1p4beta1::InputConfig] + # Information about the file for which this response is generated. + # @!attribute [rw] responses + # @return [::Array<::Google::Cloud::Vision::V1p4beta1::AnnotateImageResponse>] + # Individual responses to images found within the file. This field will be + # empty if the `error` field is set. + # @!attribute [rw] total_pages + # @return [::Integer] + # This field gives the total number of pages in the file. + # @!attribute [rw] error + # @return [::Google::Rpc::Status] + # If set, represents the error message for the failed request. The + # `responses` field will not be set in this case. + class AnnotateFileResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A list of requests to annotate files using the BatchAnnotateFiles API. + # @!attribute [rw] requests + # @return [::Array<::Google::Cloud::Vision::V1p4beta1::AnnotateFileRequest>] + # Required. The list of file annotation requests. Right now we support only + # one AnnotateFileRequest in BatchAnnotateFilesRequest. + class BatchAnnotateFilesRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A list of file annotation responses. + # @!attribute [rw] responses + # @return [::Array<::Google::Cloud::Vision::V1p4beta1::AnnotateFileResponse>] + # The list of file annotation responses, each response corresponding to each + # AnnotateFileRequest in BatchAnnotateFilesRequest. + class BatchAnnotateFilesResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # An offline file annotation request. + # @!attribute [rw] input_config + # @return [::Google::Cloud::Vision::V1p4beta1::InputConfig] + # Required. Information about the input file. + # @!attribute [rw] features + # @return [::Array<::Google::Cloud::Vision::V1p4beta1::Feature>] + # Required. Requested features. + # @!attribute [rw] image_context + # @return [::Google::Cloud::Vision::V1p4beta1::ImageContext] + # Additional context that may accompany the image(s) in the file. + # @!attribute [rw] output_config + # @return [::Google::Cloud::Vision::V1p4beta1::OutputConfig] + # Required. The desired output location and metadata (e.g. format). + class AsyncAnnotateFileRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The response for a single offline file annotation request. + # @!attribute [rw] output_config + # @return [::Google::Cloud::Vision::V1p4beta1::OutputConfig] + # The output location and metadata from AsyncAnnotateFileRequest. + class AsyncAnnotateFileResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request for async image annotation for a list of images. + # @!attribute [rw] requests + # @return [::Array<::Google::Cloud::Vision::V1p4beta1::AnnotateImageRequest>] + # Required. Individual image annotation requests for this batch. + # @!attribute [rw] output_config + # @return [::Google::Cloud::Vision::V1p4beta1::OutputConfig] + # Required. The desired output location and metadata (e.g. format). + class AsyncBatchAnnotateImagesRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response to an async batch image annotation request. + # @!attribute [rw] output_config + # @return [::Google::Cloud::Vision::V1p4beta1::OutputConfig] + # The output location and metadata from AsyncBatchAnnotateImagesRequest. + class AsyncBatchAnnotateImagesResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Multiple async file annotation requests are batched into a single service + # call. + # @!attribute [rw] requests + # @return [::Array<::Google::Cloud::Vision::V1p4beta1::AsyncAnnotateFileRequest>] + # Required. Individual async file annotation requests for this batch. + class AsyncBatchAnnotateFilesRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response to an async batch file annotation request. + # @!attribute [rw] responses + # @return [::Array<::Google::Cloud::Vision::V1p4beta1::AsyncAnnotateFileResponse>] + # The list of file annotation responses, one for each request in + # AsyncBatchAnnotateFilesRequest. + class AsyncBatchAnnotateFilesResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The desired input location and metadata. + # @!attribute [rw] gcs_source + # @return [::Google::Cloud::Vision::V1p4beta1::GcsSource] + # The Google Cloud Storage location to read the input from. + # @!attribute [rw] content + # @return [::String] + # File content, represented as a stream of bytes. + # Note: As with all `bytes` fields, protobuffers use a pure binary + # representation, whereas JSON representations use base64. + # + # Currently, this field only works for BatchAnnotateFiles requests. It does + # not work for AsyncBatchAnnotateFiles requests. + # @!attribute [rw] mime_type + # @return [::String] + # The type of the file. Currently only "application/pdf", "image/tiff" and + # "image/gif" are supported. Wildcards are not supported. + class InputConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The desired output location and metadata. + # @!attribute [rw] gcs_destination + # @return [::Google::Cloud::Vision::V1p4beta1::GcsDestination] + # The Google Cloud Storage location to write the output(s) to. + # @!attribute [rw] batch_size + # @return [::Integer] + # The max number of response protos to put into each output JSON file on + # Google Cloud Storage. + # The valid range is [1, 100]. If not specified, the default value is 20. + # + # For example, for one pdf file with 100 pages, 100 response protos will + # be generated. If `batch_size` = 20, then 5 json files each + # containing 20 response protos will be written under the prefix + # `gcs_destination`.`uri`. + # + # Currently, batch_size only applies to GcsDestination, with potential future + # support for other output configurations. + class OutputConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The Google Cloud Storage location where the input will be read from. + # @!attribute [rw] uri + # @return [::String] + # Google Cloud Storage URI for the input file. This must only be a + # Google Cloud Storage object. Wildcards are not currently supported. + class GcsSource + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The Google Cloud Storage location where the output will be written to. + # @!attribute [rw] uri + # @return [::String] + # Google Cloud Storage URI prefix where the results will be stored. Results + # will be in JSON format and preceded by its corresponding input URI prefix. + # This field can either represent a gcs file prefix or gcs directory. In + # either case, the uri should be unique because in order to get all of the + # output files, you will need to do a wildcard gcs search on the uri prefix + # you provide. + # + # Examples: + # + # * File Prefix: gs://bucket-name/here/filenameprefix The output files + # will be created in gs://bucket-name/here/ and the names of the + # output files will begin with "filenameprefix". + # + # * Directory Prefix: gs://bucket-name/some/location/ The output files + # will be created in gs://bucket-name/some/location/ and the names of the + # output files could be anything because there was no filename prefix + # specified. + # + # If multiple outputs, each response is still AnnotateFileResponse, each of + # which contains some subset of the full list of AnnotateImageResponse. + # Multiple outputs can happen if, for example, the output JSON is too large + # and overflows into multiple sharded files. + class GcsDestination + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Contains metadata for the BatchAnnotateImages operation. + # @!attribute [rw] state + # @return [::Google::Cloud::Vision::V1p4beta1::OperationMetadata::State] + # Current state of the batch operation. + # @!attribute [rw] create_time + # @return [::Google::Protobuf::Timestamp] + # The time when the batch request was received. + # @!attribute [rw] update_time + # @return [::Google::Protobuf::Timestamp] + # The time when the operation result was last updated. + class OperationMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Batch operation states. + module State + # Invalid. + STATE_UNSPECIFIED = 0 + + # Request is received. + CREATED = 1 + + # Request is actively being processed. + RUNNING = 2 + + # The batch processing is done. + DONE = 3 + + # The batch processing was cancelled. + CANCELLED = 4 + end + end + + # A bucketized representation of likelihood, which is intended to give clients + # highly stable results across model upgrades. + module Likelihood + # Unknown likelihood. + UNKNOWN = 0 + + # It is very unlikely. + VERY_UNLIKELY = 1 + + # It is unlikely. + UNLIKELY = 2 + + # It is possible. + POSSIBLE = 3 + + # It is likely. + LIKELY = 4 + + # It is very likely. + VERY_LIKELY = 5 + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-vision-v1p4beta1/proto_docs/google/cloud/vision/v1p4beta1/product_search.rb b/owl-bot-staging/google-cloud-vision-v1p4beta1/proto_docs/google/cloud/vision/v1p4beta1/product_search.rb new file mode 100644 index 000000000000..55b889f7a52d --- /dev/null +++ b/owl-bot-staging/google-cloud-vision-v1p4beta1/proto_docs/google/cloud/vision/v1p4beta1/product_search.rb @@ -0,0 +1,136 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Vision + module V1p4beta1 + # Parameters for a product search request. + # @!attribute [rw] bounding_poly + # @return [::Google::Cloud::Vision::V1p4beta1::BoundingPoly] + # The bounding polygon around the area of interest in the image. + # If it is not specified, system discretion will be applied. + # @!attribute [rw] product_set + # @return [::String] + # The resource name of a + # {::Google::Cloud::Vision::V1p4beta1::ProductSet ProductSet} to be searched for + # similar images. + # + # Format is: + # `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`. + # @!attribute [rw] product_categories + # @return [::Array<::String>] + # The list of product categories to search in. Currently, we only consider + # the first category, and either "homegoods-v2", "apparel-v2", "toys-v2", + # "packagedgoods-v1", or "general-v1" should be specified. The legacy + # categories "homegoods", "apparel", and "toys" are still supported but will + # be deprecated. For new products, please use "homegoods-v2", "apparel-v2", + # or "toys-v2" for better product search accuracy. It is recommended to + # migrate existing products to these categories as well. + # @!attribute [rw] filter + # @return [::String] + # The filtering expression. This can be used to restrict search results based + # on Product labels. We currently support an AND of OR of key-value + # expressions, where each expression within an OR must have the same key. An + # '=' should be used to connect the key and value. + # + # For example, "(color = red OR color = blue) AND brand = Google" is + # acceptable, but "(color = red OR brand = Google)" is not acceptable. + # "color: red" is not acceptable because it uses a ':' instead of an '='. + class ProductSearchParams + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Results for a product search request. + # @!attribute [rw] index_time + # @return [::Google::Protobuf::Timestamp] + # Timestamp of the index which provided these results. Products added to the + # product set and products removed from the product set after this time are + # not reflected in the current results. + # @!attribute [rw] results + # @return [::Array<::Google::Cloud::Vision::V1p4beta1::ProductSearchResults::Result>] + # List of results, one for each product match. + # @!attribute [rw] product_grouped_results + # @return [::Array<::Google::Cloud::Vision::V1p4beta1::ProductSearchResults::GroupedResult>] + # List of results grouped by products detected in the query image. Each entry + # corresponds to one bounding polygon in the query image, and contains the + # matching products specific to that region. There may be duplicate product + # matches in the union of all the per-product results. + class ProductSearchResults + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Information about a product. + # @!attribute [rw] product + # @return [::Google::Cloud::Vision::V1p4beta1::Product] + # The Product. + # @!attribute [rw] score + # @return [::Float] + # A confidence level on the match, ranging from 0 (no confidence) to + # 1 (full confidence). + # @!attribute [rw] image + # @return [::String] + # The resource name of the image from the product that is the closest match + # to the query. + class Result + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Prediction for what the object in the bounding box is. + # @!attribute [rw] mid + # @return [::String] + # Object ID that should align with EntityAnnotation mid. + # @!attribute [rw] language_code + # @return [::String] + # The BCP-47 language code, such as "en-US" or "sr-Latn". For more + # information, see + # http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. + # @!attribute [rw] name + # @return [::String] + # Object name, expressed in its `language_code` language. + # @!attribute [rw] score + # @return [::Float] + # Score of the result. Range [0, 1]. + class ObjectAnnotation + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Information about the products similar to a single product in a query + # image. + # @!attribute [rw] bounding_poly + # @return [::Google::Cloud::Vision::V1p4beta1::BoundingPoly] + # The bounding polygon around the product detected in the query image. + # @!attribute [rw] results + # @return [::Array<::Google::Cloud::Vision::V1p4beta1::ProductSearchResults::Result>] + # List of results, one for each product match. + # @!attribute [rw] object_annotations + # @return [::Array<::Google::Cloud::Vision::V1p4beta1::ProductSearchResults::ObjectAnnotation>] + # List of generic predictions for the object in the bounding box. + class GroupedResult + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-vision-v1p4beta1/proto_docs/google/cloud/vision/v1p4beta1/product_search_service.rb b/owl-bot-staging/google-cloud-vision-v1p4beta1/proto_docs/google/cloud/vision/v1p4beta1/product_search_service.rb new file mode 100644 index 000000000000..6d0a05fd15a8 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision-v1p4beta1/proto_docs/google/cloud/vision/v1p4beta1/product_search_service.rb @@ -0,0 +1,680 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Vision + module V1p4beta1 + # A Product contains ReferenceImages. + # @!attribute [rw] name + # @return [::String] + # The resource name of the product. + # + # Format is: + # `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`. + # + # This field is ignored when creating a product. + # @!attribute [rw] display_name + # @return [::String] + # The user-provided name for this Product. Must not be empty. Must be at most + # 4096 characters long. + # @!attribute [rw] description + # @return [::String] + # User-provided metadata to be stored with this product. Must be at most 4096 + # characters long. + # @!attribute [rw] product_category + # @return [::String] + # Immutable. The category for the product identified by the reference image. + # This should be either "homegoods-v2", "apparel-v2", or "toys-v2". The + # legacy categories "homegoods", "apparel", and "toys" are still supported, + # but these should not be used for new products. + # @!attribute [rw] product_labels + # @return [::Array<::Google::Cloud::Vision::V1p4beta1::Product::KeyValue>] + # Key-value pairs that can be attached to a product. At query time, + # constraints can be specified based on the product_labels. + # + # Note that integer values can be provided as strings, e.g. "1199". Only + # strings with integer values can match a range-based restriction which is + # to be supported soon. + # + # Multiple values can be assigned to the same key. One product may have up to + # 500 product_labels. + # + # Notice that the total number of distinct product_labels over all products + # in one ProductSet cannot exceed 1M, otherwise the product search pipeline + # will refuse to work for that ProductSet. + class Product + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # A product label represented as a key-value pair. + # @!attribute [rw] key + # @return [::String] + # The key of the label attached to the product. Cannot be empty and cannot + # exceed 128 bytes. + # @!attribute [rw] value + # @return [::String] + # The value of the label attached to the product. Cannot be empty and + # cannot exceed 128 bytes. + class KeyValue + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # A ProductSet contains Products. A ProductSet can contain a maximum of 1 + # million reference images. If the limit is exceeded, periodic indexing will + # fail. + # @!attribute [rw] name + # @return [::String] + # The resource name of the ProductSet. + # + # Format is: + # `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`. + # + # This field is ignored when creating a ProductSet. + # @!attribute [rw] display_name + # @return [::String] + # The user-provided name for this ProductSet. Must not be empty. Must be at + # most 4096 characters long. + # @!attribute [r] index_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time at which this ProductSet was last indexed. Query + # results will reflect all updates before this time. If this ProductSet has + # never been indexed, this timestamp is the default value + # "1970-01-01T00:00:00Z". + # + # This field is ignored when creating a ProductSet. + # @!attribute [r] index_error + # @return [::Google::Rpc::Status] + # Output only. If there was an error with indexing the product set, the field + # is populated. + # + # This field is ignored when creating a ProductSet. + class ProductSet + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A `ReferenceImage` represents a product image and its associated metadata, + # such as bounding boxes. + # @!attribute [rw] name + # @return [::String] + # The resource name of the reference image. + # + # Format is: + # + # `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID`. + # + # This field is ignored when creating a reference image. + # @!attribute [rw] uri + # @return [::String] + # Required. The Google Cloud Storage URI of the reference image. + # + # The URI must start with `gs://`. + # @!attribute [rw] bounding_polys + # @return [::Array<::Google::Cloud::Vision::V1p4beta1::BoundingPoly>] + # Optional. Bounding polygons around the areas of interest in the reference + # image. If this field is empty, the system will try to detect regions of + # interest. At most 10 bounding polygons will be used. + # + # The provided shape is converted into a non-rotated rectangle. Once + # converted, the small edge of the rectangle must be greater than or equal + # to 300 pixels. The aspect ratio must be 1:4 or less (i.e. 1:3 is ok; 1:5 + # is not). + class ReferenceImage + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for the `CreateProduct` method. + # @!attribute [rw] parent + # @return [::String] + # Required. The project in which the Product should be created. + # + # Format is + # `projects/PROJECT_ID/locations/LOC_ID`. + # @!attribute [rw] product + # @return [::Google::Cloud::Vision::V1p4beta1::Product] + # Required. The product to create. + # @!attribute [rw] product_id + # @return [::String] + # A user-supplied resource id for this Product. If set, the server will + # attempt to use this value as the resource id. If it is already in use, an + # error is returned with code ALREADY_EXISTS. Must be at most 128 characters + # long. It cannot contain the character `/`. + class CreateProductRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for the `ListProducts` method. + # @!attribute [rw] parent + # @return [::String] + # Required. The project OR ProductSet from which Products should be listed. + # + # Format: + # `projects/PROJECT_ID/locations/LOC_ID` + # @!attribute [rw] page_size + # @return [::Integer] + # The maximum number of items to return. Default 10, maximum 100. + # @!attribute [rw] page_token + # @return [::String] + # The next_page_token returned from a previous List request, if any. + class ListProductsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for the `ListProducts` method. + # @!attribute [rw] products + # @return [::Array<::Google::Cloud::Vision::V1p4beta1::Product>] + # List of products. + # @!attribute [rw] next_page_token + # @return [::String] + # Token to retrieve the next page of results, or empty if there are no more + # results in the list. + class ListProductsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for the `GetProduct` method. + # @!attribute [rw] name + # @return [::String] + # Required. Resource name of the Product to get. + # + # Format is: + # `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID` + class GetProductRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for the `UpdateProduct` method. + # @!attribute [rw] product + # @return [::Google::Cloud::Vision::V1p4beta1::Product] + # Required. The Product resource which replaces the one on the server. + # product.name is immutable. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # The {::Google::Protobuf::FieldMask FieldMask} that specifies which fields + # to update. + # If update_mask isn't specified, all mutable fields are to be updated. + # Valid mask paths include `product_labels`, `display_name`, and + # `description`. + class UpdateProductRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for the `DeleteProduct` method. + # @!attribute [rw] name + # @return [::String] + # Required. Resource name of product to delete. + # + # Format is: + # `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID` + class DeleteProductRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for the `CreateProductSet` method. + # @!attribute [rw] parent + # @return [::String] + # Required. The project in which the ProductSet should be created. + # + # Format is `projects/PROJECT_ID/locations/LOC_ID`. + # @!attribute [rw] product_set + # @return [::Google::Cloud::Vision::V1p4beta1::ProductSet] + # Required. The ProductSet to create. + # @!attribute [rw] product_set_id + # @return [::String] + # A user-supplied resource id for this ProductSet. If set, the server will + # attempt to use this value as the resource id. If it is already in use, an + # error is returned with code ALREADY_EXISTS. Must be at most 128 characters + # long. It cannot contain the character `/`. + class CreateProductSetRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for the `ListProductSets` method. + # @!attribute [rw] parent + # @return [::String] + # Required. The project from which ProductSets should be listed. + # + # Format is `projects/PROJECT_ID/locations/LOC_ID`. + # @!attribute [rw] page_size + # @return [::Integer] + # The maximum number of items to return. Default 10, maximum 100. + # @!attribute [rw] page_token + # @return [::String] + # The next_page_token returned from a previous List request, if any. + class ListProductSetsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for the `ListProductSets` method. + # @!attribute [rw] product_sets + # @return [::Array<::Google::Cloud::Vision::V1p4beta1::ProductSet>] + # List of ProductSets. + # @!attribute [rw] next_page_token + # @return [::String] + # Token to retrieve the next page of results, or empty if there are no more + # results in the list. + class ListProductSetsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for the `GetProductSet` method. + # @!attribute [rw] name + # @return [::String] + # Required. Resource name of the ProductSet to get. + # + # Format is: + # `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID` + class GetProductSetRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for the `UpdateProductSet` method. + # @!attribute [rw] product_set + # @return [::Google::Cloud::Vision::V1p4beta1::ProductSet] + # Required. The ProductSet resource which replaces the one on the server. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # The {::Google::Protobuf::FieldMask FieldMask} that specifies which fields to + # update. + # If update_mask isn't specified, all mutable fields are to be updated. + # Valid mask path is `display_name`. + class UpdateProductSetRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for the `DeleteProductSet` method. + # @!attribute [rw] name + # @return [::String] + # Required. Resource name of the ProductSet to delete. + # + # Format is: + # `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID` + class DeleteProductSetRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for the `CreateReferenceImage` method. + # @!attribute [rw] parent + # @return [::String] + # Required. Resource name of the product in which to create the reference + # image. + # + # Format is + # `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`. + # @!attribute [rw] reference_image + # @return [::Google::Cloud::Vision::V1p4beta1::ReferenceImage] + # Required. The reference image to create. + # If an image ID is specified, it is ignored. + # @!attribute [rw] reference_image_id + # @return [::String] + # A user-supplied resource id for the ReferenceImage to be added. If set, + # the server will attempt to use this value as the resource id. If it is + # already in use, an error is returned with code ALREADY_EXISTS. Must be at + # most 128 characters long. It cannot contain the character `/`. + class CreateReferenceImageRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for the `ListReferenceImages` method. + # @!attribute [rw] parent + # @return [::String] + # Required. Resource name of the product containing the reference images. + # + # Format is + # `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`. + # @!attribute [rw] page_size + # @return [::Integer] + # The maximum number of items to return. Default 10, maximum 100. + # @!attribute [rw] page_token + # @return [::String] + # A token identifying a page of results to be returned. This is the value + # of `nextPageToken` returned in a previous reference image list request. + # + # Defaults to the first page if not specified. + class ListReferenceImagesRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for the `ListReferenceImages` method. + # @!attribute [rw] reference_images + # @return [::Array<::Google::Cloud::Vision::V1p4beta1::ReferenceImage>] + # The list of reference images. + # @!attribute [rw] page_size + # @return [::Integer] + # The maximum number of items to return. Default 10, maximum 100. + # @!attribute [rw] next_page_token + # @return [::String] + # The next_page_token returned from a previous List request, if any. + class ListReferenceImagesResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for the `GetReferenceImage` method. + # @!attribute [rw] name + # @return [::String] + # Required. The resource name of the ReferenceImage to get. + # + # Format is: + # + # `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID`. + class GetReferenceImageRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for the `DeleteReferenceImage` method. + # @!attribute [rw] name + # @return [::String] + # Required. The resource name of the reference image to delete. + # + # Format is: + # + # `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID` + class DeleteReferenceImageRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for the `AddProductToProductSet` method. + # @!attribute [rw] name + # @return [::String] + # Required. The resource name for the ProductSet to modify. + # + # Format is: + # `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID` + # @!attribute [rw] product + # @return [::String] + # Required. The resource name for the Product to be added to this ProductSet. + # + # Format is: + # `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID` + class AddProductToProductSetRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for the `RemoveProductFromProductSet` method. + # @!attribute [rw] name + # @return [::String] + # Required. The resource name for the ProductSet to modify. + # + # Format is: + # `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID` + # @!attribute [rw] product + # @return [::String] + # Required. The resource name for the Product to be removed from this + # ProductSet. + # + # Format is: + # `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID` + class RemoveProductFromProductSetRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for the `ListProductsInProductSet` method. + # @!attribute [rw] name + # @return [::String] + # Required. The ProductSet resource for which to retrieve Products. + # + # Format is: + # `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID` + # @!attribute [rw] page_size + # @return [::Integer] + # The maximum number of items to return. Default 10, maximum 100. + # @!attribute [rw] page_token + # @return [::String] + # The next_page_token returned from a previous List request, if any. + class ListProductsInProductSetRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for the `ListProductsInProductSet` method. + # @!attribute [rw] products + # @return [::Array<::Google::Cloud::Vision::V1p4beta1::Product>] + # The list of Products. + # @!attribute [rw] next_page_token + # @return [::String] + # Token to retrieve the next page of results, or empty if there are no more + # results in the list. + class ListProductsInProductSetResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The Google Cloud Storage location for a csv file which preserves a list of + # ImportProductSetRequests in each line. + # @!attribute [rw] csv_file_uri + # @return [::String] + # The Google Cloud Storage URI of the input csv file. + # + # The URI must start with `gs://`. + # + # The format of the input csv file should be one image per line. + # In each line, there are 8 columns. + # + # 1. image-uri + # 2. image-id + # 3. product-set-id + # 4. product-id + # 5. product-category + # 6. product-display-name + # 7. labels + # 8. bounding-poly + # + # The `image-uri`, `product-set-id`, `product-id`, and `product-category` + # columns are required. All other columns are optional. + # + # If the `ProductSet` or `Product` specified by the `product-set-id` and + # `product-id` values does not exist, then the system will create a new + # `ProductSet` or `Product` for the image. In this case, the + # `product-display-name` column refers to + # {::Google::Cloud::Vision::V1p4beta1::Product#display_name display_name}, the + # `product-category` column refers to + # {::Google::Cloud::Vision::V1p4beta1::Product#product_category product_category}, + # and the `labels` column refers to + # {::Google::Cloud::Vision::V1p4beta1::Product#product_labels product_labels}. + # + # The `image-id` column is optional but must be unique if provided. If it is + # empty, the system will automatically assign a unique id to the image. + # + # The `product-display-name` column is optional. If it is empty, the system + # sets the {::Google::Cloud::Vision::V1p4beta1::Product#display_name display_name} + # field for the product to a space (" "). You can update the `display_name` + # later by using the API. + # + # If a `Product` with the specified `product-id` already exists, then the + # system ignores the `product-display-name`, `product-category`, and `labels` + # columns. + # + # The `labels` column (optional) is a line containing a list of + # comma-separated key-value pairs, in the following format: + # + # "key_1=value_1,key_2=value_2,...,key_n=value_n" + # + # The `bounding-poly` column (optional) identifies one region of + # interest from the image in the same manner as `CreateReferenceImage`. If + # you do not specify the `bounding-poly` column, then the system will try to + # detect regions of interest automatically. + # + # At most one `bounding-poly` column is allowed per line. If the image + # contains multiple regions of interest, add a line to the CSV file that + # includes the same product information, and the `bounding-poly` values for + # each region of interest. + # + # The `bounding-poly` column must contain an even number of comma-separated + # numbers, in the format "p1_x,p1_y,p2_x,p2_y,...,pn_x,pn_y". Use + # non-negative integers for absolute bounding polygons, and float values + # in [0, 1] for normalized bounding polygons. + # + # The system will resize the image if the image resolution is too + # large to process (larger than 20MP). + class ImportProductSetsGcsSource + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The input content for the `ImportProductSets` method. + # @!attribute [rw] gcs_source + # @return [::Google::Cloud::Vision::V1p4beta1::ImportProductSetsGcsSource] + # The Google Cloud Storage location for a csv file which preserves a list + # of ImportProductSetRequests in each line. + class ImportProductSetsInputConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for the `ImportProductSets` method. + # @!attribute [rw] parent + # @return [::String] + # Required. The project in which the ProductSets should be imported. + # + # Format is `projects/PROJECT_ID/locations/LOC_ID`. + # @!attribute [rw] input_config + # @return [::Google::Cloud::Vision::V1p4beta1::ImportProductSetsInputConfig] + # Required. The input content for the list of requests. + class ImportProductSetsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for the `ImportProductSets` method. + # + # This message is returned by the + # google.longrunning.Operations.GetOperation + # method in the returned + # {::Google::Longrunning::Operation#response google.longrunning.Operation.response} + # field. + # @!attribute [rw] reference_images + # @return [::Array<::Google::Cloud::Vision::V1p4beta1::ReferenceImage>] + # The list of reference_images that are imported successfully. + # @!attribute [rw] statuses + # @return [::Array<::Google::Rpc::Status>] + # The rpc status for each ImportProductSet request, including both successes + # and errors. + # + # The number of statuses here matches the number of lines in the csv file, + # and statuses[i] stores the success or failure status of processing the i-th + # line of the csv, starting from line 0. + class ImportProductSetsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Metadata for the batch operations such as the current state. + # + # This is included in the `metadata` field of the `Operation` returned by the + # `GetOperation` call of the `google::longrunning::Operations` service. + # @!attribute [rw] state + # @return [::Google::Cloud::Vision::V1p4beta1::BatchOperationMetadata::State] + # The current state of the batch operation. + # @!attribute [rw] submit_time + # @return [::Google::Protobuf::Timestamp] + # The time when the batch request was submitted to the server. + # @!attribute [rw] end_time + # @return [::Google::Protobuf::Timestamp] + # The time when the batch request is finished and + # {::Google::Longrunning::Operation#done google.longrunning.Operation.done} is + # set to true. + class BatchOperationMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Enumerates the possible states that the batch request can be in. + module State + # Invalid. + STATE_UNSPECIFIED = 0 + + # Request is actively being processed. + PROCESSING = 1 + + # The request is done and at least one item has been successfully + # processed. + SUCCESSFUL = 2 + + # The request is done and no item has been successfully processed. + FAILED = 3 + + # The request is done after the longrunning.Operations.CancelOperation has + # been called by the user. Any records that were processed before the + # cancel command are output as specified in the request. + CANCELLED = 4 + end + end + + # Config to control which ProductSet contains the Products to be deleted. + # @!attribute [rw] product_set_id + # @return [::String] + # The ProductSet that contains the Products to delete. If a Product is a + # member of product_set_id in addition to other ProductSets, the Product will + # still be deleted. + class ProductSetPurgeConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for the `PurgeProducts` method. + # @!attribute [rw] product_set_purge_config + # @return [::Google::Cloud::Vision::V1p4beta1::ProductSetPurgeConfig] + # Specify which ProductSet contains the Products to be deleted. + # + # Note: The following fields are mutually exclusive: `product_set_purge_config`, `delete_orphan_products`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] delete_orphan_products + # @return [::Boolean] + # If delete_orphan_products is true, all Products that are not in any + # ProductSet will be deleted. + # + # Note: The following fields are mutually exclusive: `delete_orphan_products`, `product_set_purge_config`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] parent + # @return [::String] + # Required. The project and location in which the Products should be deleted. + # + # Format is `projects/PROJECT_ID/locations/LOC_ID`. + # @!attribute [rw] force + # @return [::Boolean] + # The default value is false. Override this value to true to actually perform + # the purge. + class PurgeProductsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-vision-v1p4beta1/proto_docs/google/cloud/vision/v1p4beta1/text_annotation.rb b/owl-bot-staging/google-cloud-vision-v1p4beta1/proto_docs/google/cloud/vision/v1p4beta1/text_annotation.rb new file mode 100644 index 000000000000..197b12ffc815 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision-v1p4beta1/proto_docs/google/cloud/vision/v1p4beta1/text_annotation.rb @@ -0,0 +1,286 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Vision + module V1p4beta1 + # TextAnnotation contains a structured representation of OCR extracted text. + # The hierarchy of an OCR extracted text structure is like this: + # TextAnnotation -> Page -> Block -> Paragraph -> Word -> Symbol + # Each structural component, starting from Page, may further have their own + # properties. Properties describe detected languages, breaks etc.. Please refer + # to the + # {::Google::Cloud::Vision::V1p4beta1::TextAnnotation::TextProperty TextAnnotation.TextProperty} + # message definition below for more detail. + # @!attribute [rw] pages + # @return [::Array<::Google::Cloud::Vision::V1p4beta1::Page>] + # List of pages detected by OCR. + # @!attribute [rw] text + # @return [::String] + # UTF-8 text detected on the pages. + class TextAnnotation + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Detected language for a structural component. + # @!attribute [rw] language_code + # @return [::String] + # The BCP-47 language code, such as "en-US" or "sr-Latn". For more + # information, see + # http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. + # @!attribute [rw] confidence + # @return [::Float] + # Confidence of detected language. Range [0, 1]. + class DetectedLanguage + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Detected start or end of a structural component. + # @!attribute [rw] type + # @return [::Google::Cloud::Vision::V1p4beta1::TextAnnotation::DetectedBreak::BreakType] + # Detected break type. + # @!attribute [rw] is_prefix + # @return [::Boolean] + # True if break prepends the element. + class DetectedBreak + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Enum to denote the type of break found. New line, space etc. + module BreakType + # Unknown break label type. + UNKNOWN = 0 + + # Regular space. + SPACE = 1 + + # Sure space (very wide). + SURE_SPACE = 2 + + # Line-wrapping break. + EOL_SURE_SPACE = 3 + + # End-line hyphen that is not present in text; does not co-occur with + # `SPACE`, `LEADER_SPACE`, or `LINE_BREAK`. + HYPHEN = 4 + + # Line break that ends a paragraph. + LINE_BREAK = 5 + end + end + + # Additional information detected on the structural component. + # @!attribute [rw] detected_languages + # @return [::Array<::Google::Cloud::Vision::V1p4beta1::TextAnnotation::DetectedLanguage>] + # A list of detected languages together with confidence. + # @!attribute [rw] detected_break + # @return [::Google::Cloud::Vision::V1p4beta1::TextAnnotation::DetectedBreak] + # Detected start or end of a text segment. + class TextProperty + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Detected page from OCR. + # @!attribute [rw] property + # @return [::Google::Cloud::Vision::V1p4beta1::TextAnnotation::TextProperty] + # Additional information detected on the page. + # @!attribute [rw] width + # @return [::Integer] + # Page width. For PDFs the unit is points. For images (including + # TIFFs) the unit is pixels. + # @!attribute [rw] height + # @return [::Integer] + # Page height. For PDFs the unit is points. For images (including + # TIFFs) the unit is pixels. + # @!attribute [rw] blocks + # @return [::Array<::Google::Cloud::Vision::V1p4beta1::Block>] + # List of blocks of text, images etc on this page. + # @!attribute [rw] confidence + # @return [::Float] + # Confidence of the OCR results on the page. Range [0, 1]. + class Page + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Logical element on the page. + # @!attribute [rw] property + # @return [::Google::Cloud::Vision::V1p4beta1::TextAnnotation::TextProperty] + # Additional information detected for the block. + # @!attribute [rw] bounding_box + # @return [::Google::Cloud::Vision::V1p4beta1::BoundingPoly] + # The bounding box for the block. + # The vertices are in the order of top-left, top-right, bottom-right, + # bottom-left. When a rotation of the bounding box is detected the rotation + # is represented as around the top-left corner as defined when the text is + # read in the 'natural' orientation. + # For example: + # + # * when the text is horizontal it might look like: + # + # 0----1 + # | | + # 3----2 + # + # * when it's rotated 180 degrees around the top-left corner it becomes: + # + # 2----3 + # | | + # 1----0 + # + # and the vertex order will still be (0, 1, 2, 3). + # @!attribute [rw] paragraphs + # @return [::Array<::Google::Cloud::Vision::V1p4beta1::Paragraph>] + # List of paragraphs in this block (if this blocks is of type text). + # @!attribute [rw] block_type + # @return [::Google::Cloud::Vision::V1p4beta1::Block::BlockType] + # Detected block type (text, image etc) for this block. + # @!attribute [rw] confidence + # @return [::Float] + # Confidence of the OCR results on the block. Range [0, 1]. + class Block + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Type of a block (text, image etc) as identified by OCR. + module BlockType + # Unknown block type. + UNKNOWN = 0 + + # Regular text block. + TEXT = 1 + + # Table block. + TABLE = 2 + + # Image block. + PICTURE = 3 + + # Horizontal/vertical line box. + RULER = 4 + + # Barcode block. + BARCODE = 5 + end + end + + # Structural unit of text representing a number of words in certain order. + # @!attribute [rw] property + # @return [::Google::Cloud::Vision::V1p4beta1::TextAnnotation::TextProperty] + # Additional information detected for the paragraph. + # @!attribute [rw] bounding_box + # @return [::Google::Cloud::Vision::V1p4beta1::BoundingPoly] + # The bounding box for the paragraph. + # The vertices are in the order of top-left, top-right, bottom-right, + # bottom-left. When a rotation of the bounding box is detected the rotation + # is represented as around the top-left corner as defined when the text is + # read in the 'natural' orientation. + # For example: + # * when the text is horizontal it might look like: + # 0----1 + # | | + # 3----2 + # * when it's rotated 180 degrees around the top-left corner it becomes: + # 2----3 + # | | + # 1----0 + # and the vertex order will still be (0, 1, 2, 3). + # @!attribute [rw] words + # @return [::Array<::Google::Cloud::Vision::V1p4beta1::Word>] + # List of all words in this paragraph. + # @!attribute [rw] confidence + # @return [::Float] + # Confidence of the OCR results for the paragraph. Range [0, 1]. + class Paragraph + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A word representation. + # @!attribute [rw] property + # @return [::Google::Cloud::Vision::V1p4beta1::TextAnnotation::TextProperty] + # Additional information detected for the word. + # @!attribute [rw] bounding_box + # @return [::Google::Cloud::Vision::V1p4beta1::BoundingPoly] + # The bounding box for the word. + # The vertices are in the order of top-left, top-right, bottom-right, + # bottom-left. When a rotation of the bounding box is detected the rotation + # is represented as around the top-left corner as defined when the text is + # read in the 'natural' orientation. + # For example: + # * when the text is horizontal it might look like: + # 0----1 + # | | + # 3----2 + # * when it's rotated 180 degrees around the top-left corner it becomes: + # 2----3 + # | | + # 1----0 + # and the vertex order will still be (0, 1, 2, 3). + # @!attribute [rw] symbols + # @return [::Array<::Google::Cloud::Vision::V1p4beta1::Symbol>] + # List of symbols in the word. + # The order of the symbols follows the natural reading order. + # @!attribute [rw] confidence + # @return [::Float] + # Confidence of the OCR results for the word. Range [0, 1]. + class Word + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A single symbol representation. + # @!attribute [rw] property + # @return [::Google::Cloud::Vision::V1p4beta1::TextAnnotation::TextProperty] + # Additional information detected for the symbol. + # @!attribute [rw] bounding_box + # @return [::Google::Cloud::Vision::V1p4beta1::BoundingPoly] + # The bounding box for the symbol. + # The vertices are in the order of top-left, top-right, bottom-right, + # bottom-left. When a rotation of the bounding box is detected the rotation + # is represented as around the top-left corner as defined when the text is + # read in the 'natural' orientation. + # For example: + # * when the text is horizontal it might look like: + # 0----1 + # | | + # 3----2 + # * when it's rotated 180 degrees around the top-left corner it becomes: + # 2----3 + # | | + # 1----0 + # and the vertex order will still be (0, 1, 2, 3). + # @!attribute [rw] text + # @return [::String] + # The actual UTF-8 representation of the symbol. + # @!attribute [rw] confidence + # @return [::Float] + # Confidence of the OCR results for the symbol. Range [0, 1]. + class Symbol + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-vision-v1p4beta1/proto_docs/google/cloud/vision/v1p4beta1/web_detection.rb b/owl-bot-staging/google-cloud-vision-v1p4beta1/proto_docs/google/cloud/vision/v1p4beta1/web_detection.rb new file mode 100644 index 000000000000..963a7f738570 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision-v1p4beta1/proto_docs/google/cloud/vision/v1p4beta1/web_detection.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 Cloud + module Vision + module V1p4beta1 + # Relevant information for the image from the Internet. + # @!attribute [rw] web_entities + # @return [::Array<::Google::Cloud::Vision::V1p4beta1::WebDetection::WebEntity>] + # Deduced entities from similar images on the Internet. + # @!attribute [rw] full_matching_images + # @return [::Array<::Google::Cloud::Vision::V1p4beta1::WebDetection::WebImage>] + # Fully matching images from the Internet. + # Can include resized copies of the query image. + # @!attribute [rw] partial_matching_images + # @return [::Array<::Google::Cloud::Vision::V1p4beta1::WebDetection::WebImage>] + # Partial matching images from the Internet. + # Those images are similar enough to share some key-point features. For + # example an original image will likely have partial matching for its crops. + # @!attribute [rw] pages_with_matching_images + # @return [::Array<::Google::Cloud::Vision::V1p4beta1::WebDetection::WebPage>] + # Web pages containing the matching images from the Internet. + # @!attribute [rw] visually_similar_images + # @return [::Array<::Google::Cloud::Vision::V1p4beta1::WebDetection::WebImage>] + # The visually similar image results. + # @!attribute [rw] best_guess_labels + # @return [::Array<::Google::Cloud::Vision::V1p4beta1::WebDetection::WebLabel>] + # The service's best guess as to the topic of the request image. + # Inferred from similar images on the open web. + class WebDetection + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Entity deduced from similar images on the Internet. + # @!attribute [rw] entity_id + # @return [::String] + # Opaque entity ID. + # @!attribute [rw] score + # @return [::Float] + # Overall relevancy score for the entity. + # Not normalized and not comparable across different image queries. + # @!attribute [rw] description + # @return [::String] + # Canonical description of the entity, in English. + class WebEntity + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Metadata for online images. + # @!attribute [rw] url + # @return [::String] + # The result image URL. + # @!attribute [rw] score + # @return [::Float] + # (Deprecated) Overall relevancy score for the image. + class WebImage + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Metadata for web pages. + # @!attribute [rw] url + # @return [::String] + # The result web page URL. + # @!attribute [rw] score + # @return [::Float] + # (Deprecated) Overall relevancy score for the web page. + # @!attribute [rw] page_title + # @return [::String] + # Title for the web page, may contain HTML markups. + # @!attribute [rw] full_matching_images + # @return [::Array<::Google::Cloud::Vision::V1p4beta1::WebDetection::WebImage>] + # Fully matching images on the page. + # Can include resized copies of the query image. + # @!attribute [rw] partial_matching_images + # @return [::Array<::Google::Cloud::Vision::V1p4beta1::WebDetection::WebImage>] + # Partial matching images on the page. + # Those images are similar enough to share some key-point features. For + # example an original image will likely have partial matching for its + # crops. + class WebPage + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Label to provide extra metadata for the web detection. + # @!attribute [rw] label + # @return [::String] + # Label for extra metadata. + # @!attribute [rw] language_code + # @return [::String] + # The BCP-47 language code for `label`, such as "en-US" or "sr-Latn". + # For more information, see + # http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. + class WebLabel + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-vision-v1p4beta1/proto_docs/google/longrunning/operations.rb b/owl-bot-staging/google-cloud-vision-v1p4beta1/proto_docs/google/longrunning/operations.rb new file mode 100644 index 000000000000..7a757f512165 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision-v1p4beta1/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-vision-v1p4beta1/proto_docs/google/protobuf/any.rb b/owl-bot-staging/google-cloud-vision-v1p4beta1/proto_docs/google/protobuf/any.rb new file mode 100644 index 000000000000..58691995f02e --- /dev/null +++ b/owl-bot-staging/google-cloud-vision-v1p4beta1/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-vision-v1p4beta1/proto_docs/google/protobuf/duration.rb b/owl-bot-staging/google-cloud-vision-v1p4beta1/proto_docs/google/protobuf/duration.rb new file mode 100644 index 000000000000..ea59f1f91daf --- /dev/null +++ b/owl-bot-staging/google-cloud-vision-v1p4beta1/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-vision-v1p4beta1/proto_docs/google/protobuf/empty.rb b/owl-bot-staging/google-cloud-vision-v1p4beta1/proto_docs/google/protobuf/empty.rb new file mode 100644 index 000000000000..83e4481834a6 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision-v1p4beta1/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-vision-v1p4beta1/proto_docs/google/protobuf/field_mask.rb b/owl-bot-staging/google-cloud-vision-v1p4beta1/proto_docs/google/protobuf/field_mask.rb new file mode 100644 index 000000000000..7f3ffc78601a --- /dev/null +++ b/owl-bot-staging/google-cloud-vision-v1p4beta1/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-vision-v1p4beta1/proto_docs/google/protobuf/timestamp.rb b/owl-bot-staging/google-cloud-vision-v1p4beta1/proto_docs/google/protobuf/timestamp.rb new file mode 100644 index 000000000000..74352be9c58c --- /dev/null +++ b/owl-bot-staging/google-cloud-vision-v1p4beta1/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-vision-v1p4beta1/proto_docs/google/protobuf/wrappers.rb b/owl-bot-staging/google-cloud-vision-v1p4beta1/proto_docs/google/protobuf/wrappers.rb new file mode 100644 index 000000000000..9a7c0269fa42 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision-v1p4beta1/proto_docs/google/protobuf/wrappers.rb @@ -0,0 +1,148 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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. + # + # Not recommended for use in new APIs, but still useful for legacy APIs and + # has no plan to be removed. + # @!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. + # + # Not recommended for use in new APIs, but still useful for legacy APIs and + # has no plan to be removed. + # @!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. + # + # Not recommended for use in new APIs, but still useful for legacy APIs and + # has no plan to be removed. + # @!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. + # + # Not recommended for use in new APIs, but still useful for legacy APIs and + # has no plan to be removed. + # @!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. + # + # Not recommended for use in new APIs, but still useful for legacy APIs and + # has no plan to be removed. + # @!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. + # + # Not recommended for use in new APIs, but still useful for legacy APIs and + # has no plan to be removed. + # @!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`. + # + # Not recommended for use in new APIs, but still useful for legacy APIs and + # has no plan to be removed. + # @!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. + # + # Not recommended for use in new APIs, but still useful for legacy APIs and + # has no plan to be removed. + # @!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. + # + # Not recommended for use in new APIs, but still useful for legacy APIs and + # has no plan to be removed. + # @!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-vision-v1p4beta1/proto_docs/google/rpc/status.rb b/owl-bot-staging/google-cloud-vision-v1p4beta1/proto_docs/google/rpc/status.rb new file mode 100644 index 000000000000..c1a1c07eb2db --- /dev/null +++ b/owl-bot-staging/google-cloud-vision-v1p4beta1/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-vision-v1p4beta1/proto_docs/google/type/color.rb b/owl-bot-staging/google-cloud-vision-v1p4beta1/proto_docs/google/type/color.rb new file mode 100644 index 000000000000..5728bc06bc83 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision-v1p4beta1/proto_docs/google/type/color.rb @@ -0,0 +1,173 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 color in the RGBA color space. This representation is designed + # for simplicity of conversion to and from color representations in various + # languages over compactness. For example, the fields of this representation + # can be trivially provided to the constructor of `java.awt.Color` in Java; it + # can also be trivially provided to UIColor's `+colorWithRed:green:blue:alpha` + # method in iOS; and, with just a little work, it can be easily formatted into + # a CSS `rgba()` string in JavaScript. + # + # This reference page doesn't have information about the absolute color + # space that should be used to interpret the RGB value—for example, sRGB, + # Adobe RGB, + # DCI-P3, and BT.2020. By default, applications should assume the sRGB color + # space. + # + # When color equality needs to be decided, implementations, unless documented + # otherwise, treat two colors as equal if all their red, green, blue, and alpha + # values each differ by at most `1e-5`. + # + # Example (Java): + # + # import com.google.type.Color; + # + # // ... + # public static java.awt.Color fromProto(Color protocolor) { + # float alpha = protocolor.hasAlpha() + # ? protocolor.getAlpha().getValue() + # : 1.0; + # + # return new java.awt.Color( + # protocolor.getRed(), + # protocolor.getGreen(), + # protocolor.getBlue(), + # alpha); + # } + # + # public static Color toProto(java.awt.Color color) { + # float red = (float) color.getRed(); + # float green = (float) color.getGreen(); + # float blue = (float) color.getBlue(); + # float denominator = 255.0; + # Color.Builder resultBuilder = + # Color + # .newBuilder() + # .setRed(red / denominator) + # .setGreen(green / denominator) + # .setBlue(blue / denominator); + # int alpha = color.getAlpha(); + # if (alpha != 255) { + # result.setAlpha( + # FloatValue + # .newBuilder() + # .setValue(((float) alpha) / denominator) + # .build()); + # } + # return resultBuilder.build(); + # } + # // ... + # + # Example (iOS / Obj-C): + # + # // ... + # static UIColor* fromProto(Color* protocolor) { + # float red = [protocolor red]; + # float green = [protocolor green]; + # float blue = [protocolor blue]; + # FloatValue* alpha_wrapper = [protocolor alpha]; + # float alpha = 1.0; + # if (alpha_wrapper != nil) { + # alpha = [alpha_wrapper value]; + # } + # return [UIColor colorWithRed:red green:green blue:blue alpha:alpha]; + # } + # + # static Color* toProto(UIColor* color) { + # CGFloat red, green, blue, alpha; + # if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) { + # return nil; + # } + # Color* result = [[Color alloc] init]; + # [result setRed:red]; + # [result setGreen:green]; + # [result setBlue:blue]; + # if (alpha <= 0.9999) { + # [result setAlpha:floatWrapperWithValue(alpha)]; + # } + # [result autorelease]; + # return result; + # } + # // ... + # + # Example (JavaScript): + # + # // ... + # + # var protoToCssColor = function(rgb_color) { + # var redFrac = rgb_color.red || 0.0; + # var greenFrac = rgb_color.green || 0.0; + # var blueFrac = rgb_color.blue || 0.0; + # var red = Math.floor(redFrac * 255); + # var green = Math.floor(greenFrac * 255); + # var blue = Math.floor(blueFrac * 255); + # + # if (!('alpha' in rgb_color)) { + # return rgbToCssColor(red, green, blue); + # } + # + # var alphaFrac = rgb_color.alpha.value || 0.0; + # var rgbParams = [red, green, blue].join(','); + # return ['rgba(', rgbParams, ',', alphaFrac, ')'].join(''); + # }; + # + # var rgbToCssColor = function(red, green, blue) { + # var rgbNumber = new Number((red << 16) | (green << 8) | blue); + # var hexString = rgbNumber.toString(16); + # var missingZeros = 6 - hexString.length; + # var resultBuilder = ['#']; + # for (var i = 0; i < missingZeros; i++) { + # resultBuilder.push('0'); + # } + # resultBuilder.push(hexString); + # return resultBuilder.join(''); + # }; + # + # // ... + # @!attribute [rw] red + # @return [::Float] + # The amount of red in the color as a value in the interval [0, 1]. + # @!attribute [rw] green + # @return [::Float] + # The amount of green in the color as a value in the interval [0, 1]. + # @!attribute [rw] blue + # @return [::Float] + # The amount of blue in the color as a value in the interval [0, 1]. + # @!attribute [rw] alpha + # @return [::Google::Protobuf::FloatValue] + # The fraction of this color that should be applied to the pixel. That is, + # the final pixel color is defined by the equation: + # + # `pixel color = alpha * (this color) + (1.0 - alpha) * (background color)` + # + # This means that a value of 1.0 corresponds to a solid color, whereas + # a value of 0.0 corresponds to a completely transparent color. This + # uses a wrapper message rather than a simple float scalar so that it is + # possible to distinguish between a default value and the value being unset. + # If omitted, this color object is rendered as a solid color + # (as if the alpha value had been explicitly given a value of 1.0). + class Color + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-vision-v1p4beta1/proto_docs/google/type/latlng.rb b/owl-bot-staging/google-cloud-vision-v1p4beta1/proto_docs/google/type/latlng.rb new file mode 100644 index 000000000000..593314b4cde5 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision-v1p4beta1/proto_docs/google/type/latlng.rb @@ -0,0 +1,38 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 + # An object that represents a latitude/longitude pair. This is expressed as a + # pair of doubles to represent degrees latitude and degrees longitude. Unless + # specified otherwise, this object must conform to the + # + # WGS84 standard. Values must be within normalized ranges. + # @!attribute [rw] latitude + # @return [::Float] + # The latitude in degrees. It must be in the range [-90.0, +90.0]. + # @!attribute [rw] longitude + # @return [::Float] + # The longitude in degrees. It must be in the range [-180.0, +180.0]. + class LatLng + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-vision-v1p4beta1/snippets/Gemfile b/owl-bot-staging/google-cloud-vision-v1p4beta1/snippets/Gemfile new file mode 100644 index 000000000000..fa5d3567f418 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision-v1p4beta1/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-vision-v1p4beta1", path: "../" +else + gem "google-cloud-vision-v1p4beta1" +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-vision-v1p4beta1/snippets/image_annotator/async_batch_annotate_files.rb b/owl-bot-staging/google-cloud-vision-v1p4beta1/snippets/image_annotator/async_batch_annotate_files.rb new file mode 100644 index 000000000000..dc14f0d7783a --- /dev/null +++ b/owl-bot-staging/google-cloud-vision-v1p4beta1/snippets/image_annotator/async_batch_annotate_files.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 vision_v1p4beta1_generated_ImageAnnotator_AsyncBatchAnnotateFiles_sync] +require "google/cloud/vision/v1p4beta1" + +## +# Snippet for the async_batch_annotate_files call in the ImageAnnotator 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::Vision::V1p4beta1::ImageAnnotator::Client#async_batch_annotate_files. +# +def async_batch_annotate_files + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Vision::V1p4beta1::ImageAnnotator::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Vision::V1p4beta1::AsyncBatchAnnotateFilesRequest.new + + # Call the async_batch_annotate_files method. + result = client.async_batch_annotate_files 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 vision_v1p4beta1_generated_ImageAnnotator_AsyncBatchAnnotateFiles_sync] diff --git a/owl-bot-staging/google-cloud-vision-v1p4beta1/snippets/image_annotator/async_batch_annotate_images.rb b/owl-bot-staging/google-cloud-vision-v1p4beta1/snippets/image_annotator/async_batch_annotate_images.rb new file mode 100644 index 000000000000..4c982c9e0224 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision-v1p4beta1/snippets/image_annotator/async_batch_annotate_images.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 vision_v1p4beta1_generated_ImageAnnotator_AsyncBatchAnnotateImages_sync] +require "google/cloud/vision/v1p4beta1" + +## +# Snippet for the async_batch_annotate_images call in the ImageAnnotator 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::Vision::V1p4beta1::ImageAnnotator::Client#async_batch_annotate_images. +# +def async_batch_annotate_images + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Vision::V1p4beta1::ImageAnnotator::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Vision::V1p4beta1::AsyncBatchAnnotateImagesRequest.new + + # Call the async_batch_annotate_images method. + result = client.async_batch_annotate_images 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 vision_v1p4beta1_generated_ImageAnnotator_AsyncBatchAnnotateImages_sync] diff --git a/owl-bot-staging/google-cloud-vision-v1p4beta1/snippets/image_annotator/batch_annotate_files.rb b/owl-bot-staging/google-cloud-vision-v1p4beta1/snippets/image_annotator/batch_annotate_files.rb new file mode 100644 index 000000000000..6f60270c3f43 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision-v1p4beta1/snippets/image_annotator/batch_annotate_files.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 vision_v1p4beta1_generated_ImageAnnotator_BatchAnnotateFiles_sync] +require "google/cloud/vision/v1p4beta1" + +## +# Snippet for the batch_annotate_files call in the ImageAnnotator 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::Vision::V1p4beta1::ImageAnnotator::Client#batch_annotate_files. +# +def batch_annotate_files + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Vision::V1p4beta1::ImageAnnotator::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Vision::V1p4beta1::BatchAnnotateFilesRequest.new + + # Call the batch_annotate_files method. + result = client.batch_annotate_files request + + # The returned object is of type Google::Cloud::Vision::V1p4beta1::BatchAnnotateFilesResponse. + p result +end +# [END vision_v1p4beta1_generated_ImageAnnotator_BatchAnnotateFiles_sync] diff --git a/owl-bot-staging/google-cloud-vision-v1p4beta1/snippets/image_annotator/batch_annotate_images.rb b/owl-bot-staging/google-cloud-vision-v1p4beta1/snippets/image_annotator/batch_annotate_images.rb new file mode 100644 index 000000000000..0044519b6e1f --- /dev/null +++ b/owl-bot-staging/google-cloud-vision-v1p4beta1/snippets/image_annotator/batch_annotate_images.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 vision_v1p4beta1_generated_ImageAnnotator_BatchAnnotateImages_sync] +require "google/cloud/vision/v1p4beta1" + +## +# Snippet for the batch_annotate_images call in the ImageAnnotator 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::Vision::V1p4beta1::ImageAnnotator::Client#batch_annotate_images. +# +def batch_annotate_images + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Vision::V1p4beta1::ImageAnnotator::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Vision::V1p4beta1::BatchAnnotateImagesRequest.new + + # Call the batch_annotate_images method. + result = client.batch_annotate_images request + + # The returned object is of type Google::Cloud::Vision::V1p4beta1::BatchAnnotateImagesResponse. + p result +end +# [END vision_v1p4beta1_generated_ImageAnnotator_BatchAnnotateImages_sync] diff --git a/owl-bot-staging/google-cloud-vision-v1p4beta1/snippets/product_search/add_product_to_product_set.rb b/owl-bot-staging/google-cloud-vision-v1p4beta1/snippets/product_search/add_product_to_product_set.rb new file mode 100644 index 000000000000..e06f0695767b --- /dev/null +++ b/owl-bot-staging/google-cloud-vision-v1p4beta1/snippets/product_search/add_product_to_product_set.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 vision_v1p4beta1_generated_ProductSearch_AddProductToProductSet_sync] +require "google/cloud/vision/v1p4beta1" + +## +# Snippet for the add_product_to_product_set call in the ProductSearch 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::Vision::V1p4beta1::ProductSearch::Client#add_product_to_product_set. +# +def add_product_to_product_set + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Vision::V1p4beta1::ProductSearch::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Vision::V1p4beta1::AddProductToProductSetRequest.new + + # Call the add_product_to_product_set method. + result = client.add_product_to_product_set request + + # The returned object is of type Google::Protobuf::Empty. + p result +end +# [END vision_v1p4beta1_generated_ProductSearch_AddProductToProductSet_sync] diff --git a/owl-bot-staging/google-cloud-vision-v1p4beta1/snippets/product_search/create_product.rb b/owl-bot-staging/google-cloud-vision-v1p4beta1/snippets/product_search/create_product.rb new file mode 100644 index 000000000000..158f2bc49f13 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision-v1p4beta1/snippets/product_search/create_product.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 vision_v1p4beta1_generated_ProductSearch_CreateProduct_sync] +require "google/cloud/vision/v1p4beta1" + +## +# Snippet for the create_product call in the ProductSearch 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::Vision::V1p4beta1::ProductSearch::Client#create_product. +# +def create_product + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Vision::V1p4beta1::ProductSearch::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Vision::V1p4beta1::CreateProductRequest.new + + # Call the create_product method. + result = client.create_product request + + # The returned object is of type Google::Cloud::Vision::V1p4beta1::Product. + p result +end +# [END vision_v1p4beta1_generated_ProductSearch_CreateProduct_sync] diff --git a/owl-bot-staging/google-cloud-vision-v1p4beta1/snippets/product_search/create_product_set.rb b/owl-bot-staging/google-cloud-vision-v1p4beta1/snippets/product_search/create_product_set.rb new file mode 100644 index 000000000000..d9f01a876438 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision-v1p4beta1/snippets/product_search/create_product_set.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 vision_v1p4beta1_generated_ProductSearch_CreateProductSet_sync] +require "google/cloud/vision/v1p4beta1" + +## +# Snippet for the create_product_set call in the ProductSearch 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::Vision::V1p4beta1::ProductSearch::Client#create_product_set. +# +def create_product_set + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Vision::V1p4beta1::ProductSearch::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Vision::V1p4beta1::CreateProductSetRequest.new + + # Call the create_product_set method. + result = client.create_product_set request + + # The returned object is of type Google::Cloud::Vision::V1p4beta1::ProductSet. + p result +end +# [END vision_v1p4beta1_generated_ProductSearch_CreateProductSet_sync] diff --git a/owl-bot-staging/google-cloud-vision-v1p4beta1/snippets/product_search/create_reference_image.rb b/owl-bot-staging/google-cloud-vision-v1p4beta1/snippets/product_search/create_reference_image.rb new file mode 100644 index 000000000000..57b2525a94ad --- /dev/null +++ b/owl-bot-staging/google-cloud-vision-v1p4beta1/snippets/product_search/create_reference_image.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 vision_v1p4beta1_generated_ProductSearch_CreateReferenceImage_sync] +require "google/cloud/vision/v1p4beta1" + +## +# Snippet for the create_reference_image call in the ProductSearch 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::Vision::V1p4beta1::ProductSearch::Client#create_reference_image. +# +def create_reference_image + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Vision::V1p4beta1::ProductSearch::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Vision::V1p4beta1::CreateReferenceImageRequest.new + + # Call the create_reference_image method. + result = client.create_reference_image request + + # The returned object is of type Google::Cloud::Vision::V1p4beta1::ReferenceImage. + p result +end +# [END vision_v1p4beta1_generated_ProductSearch_CreateReferenceImage_sync] diff --git a/owl-bot-staging/google-cloud-vision-v1p4beta1/snippets/product_search/delete_product.rb b/owl-bot-staging/google-cloud-vision-v1p4beta1/snippets/product_search/delete_product.rb new file mode 100644 index 000000000000..373d6d22946b --- /dev/null +++ b/owl-bot-staging/google-cloud-vision-v1p4beta1/snippets/product_search/delete_product.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 vision_v1p4beta1_generated_ProductSearch_DeleteProduct_sync] +require "google/cloud/vision/v1p4beta1" + +## +# Snippet for the delete_product call in the ProductSearch 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::Vision::V1p4beta1::ProductSearch::Client#delete_product. +# +def delete_product + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Vision::V1p4beta1::ProductSearch::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Vision::V1p4beta1::DeleteProductRequest.new + + # Call the delete_product method. + result = client.delete_product request + + # The returned object is of type Google::Protobuf::Empty. + p result +end +# [END vision_v1p4beta1_generated_ProductSearch_DeleteProduct_sync] diff --git a/owl-bot-staging/google-cloud-vision-v1p4beta1/snippets/product_search/delete_product_set.rb b/owl-bot-staging/google-cloud-vision-v1p4beta1/snippets/product_search/delete_product_set.rb new file mode 100644 index 000000000000..5e6180d9186d --- /dev/null +++ b/owl-bot-staging/google-cloud-vision-v1p4beta1/snippets/product_search/delete_product_set.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 vision_v1p4beta1_generated_ProductSearch_DeleteProductSet_sync] +require "google/cloud/vision/v1p4beta1" + +## +# Snippet for the delete_product_set call in the ProductSearch 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::Vision::V1p4beta1::ProductSearch::Client#delete_product_set. +# +def delete_product_set + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Vision::V1p4beta1::ProductSearch::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Vision::V1p4beta1::DeleteProductSetRequest.new + + # Call the delete_product_set method. + result = client.delete_product_set request + + # The returned object is of type Google::Protobuf::Empty. + p result +end +# [END vision_v1p4beta1_generated_ProductSearch_DeleteProductSet_sync] diff --git a/owl-bot-staging/google-cloud-vision-v1p4beta1/snippets/product_search/delete_reference_image.rb b/owl-bot-staging/google-cloud-vision-v1p4beta1/snippets/product_search/delete_reference_image.rb new file mode 100644 index 000000000000..4f1669b6aa92 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision-v1p4beta1/snippets/product_search/delete_reference_image.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 vision_v1p4beta1_generated_ProductSearch_DeleteReferenceImage_sync] +require "google/cloud/vision/v1p4beta1" + +## +# Snippet for the delete_reference_image call in the ProductSearch 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::Vision::V1p4beta1::ProductSearch::Client#delete_reference_image. +# +def delete_reference_image + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Vision::V1p4beta1::ProductSearch::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Vision::V1p4beta1::DeleteReferenceImageRequest.new + + # Call the delete_reference_image method. + result = client.delete_reference_image request + + # The returned object is of type Google::Protobuf::Empty. + p result +end +# [END vision_v1p4beta1_generated_ProductSearch_DeleteReferenceImage_sync] diff --git a/owl-bot-staging/google-cloud-vision-v1p4beta1/snippets/product_search/get_product.rb b/owl-bot-staging/google-cloud-vision-v1p4beta1/snippets/product_search/get_product.rb new file mode 100644 index 000000000000..e612a5636102 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision-v1p4beta1/snippets/product_search/get_product.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 vision_v1p4beta1_generated_ProductSearch_GetProduct_sync] +require "google/cloud/vision/v1p4beta1" + +## +# Snippet for the get_product call in the ProductSearch 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::Vision::V1p4beta1::ProductSearch::Client#get_product. +# +def get_product + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Vision::V1p4beta1::ProductSearch::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Vision::V1p4beta1::GetProductRequest.new + + # Call the get_product method. + result = client.get_product request + + # The returned object is of type Google::Cloud::Vision::V1p4beta1::Product. + p result +end +# [END vision_v1p4beta1_generated_ProductSearch_GetProduct_sync] diff --git a/owl-bot-staging/google-cloud-vision-v1p4beta1/snippets/product_search/get_product_set.rb b/owl-bot-staging/google-cloud-vision-v1p4beta1/snippets/product_search/get_product_set.rb new file mode 100644 index 000000000000..7bdc62b0a92a --- /dev/null +++ b/owl-bot-staging/google-cloud-vision-v1p4beta1/snippets/product_search/get_product_set.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 vision_v1p4beta1_generated_ProductSearch_GetProductSet_sync] +require "google/cloud/vision/v1p4beta1" + +## +# Snippet for the get_product_set call in the ProductSearch 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::Vision::V1p4beta1::ProductSearch::Client#get_product_set. +# +def get_product_set + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Vision::V1p4beta1::ProductSearch::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Vision::V1p4beta1::GetProductSetRequest.new + + # Call the get_product_set method. + result = client.get_product_set request + + # The returned object is of type Google::Cloud::Vision::V1p4beta1::ProductSet. + p result +end +# [END vision_v1p4beta1_generated_ProductSearch_GetProductSet_sync] diff --git a/owl-bot-staging/google-cloud-vision-v1p4beta1/snippets/product_search/get_reference_image.rb b/owl-bot-staging/google-cloud-vision-v1p4beta1/snippets/product_search/get_reference_image.rb new file mode 100644 index 000000000000..29a9933a607b --- /dev/null +++ b/owl-bot-staging/google-cloud-vision-v1p4beta1/snippets/product_search/get_reference_image.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 vision_v1p4beta1_generated_ProductSearch_GetReferenceImage_sync] +require "google/cloud/vision/v1p4beta1" + +## +# Snippet for the get_reference_image call in the ProductSearch 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::Vision::V1p4beta1::ProductSearch::Client#get_reference_image. +# +def get_reference_image + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Vision::V1p4beta1::ProductSearch::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Vision::V1p4beta1::GetReferenceImageRequest.new + + # Call the get_reference_image method. + result = client.get_reference_image request + + # The returned object is of type Google::Cloud::Vision::V1p4beta1::ReferenceImage. + p result +end +# [END vision_v1p4beta1_generated_ProductSearch_GetReferenceImage_sync] diff --git a/owl-bot-staging/google-cloud-vision-v1p4beta1/snippets/product_search/import_product_sets.rb b/owl-bot-staging/google-cloud-vision-v1p4beta1/snippets/product_search/import_product_sets.rb new file mode 100644 index 000000000000..b15910ae998f --- /dev/null +++ b/owl-bot-staging/google-cloud-vision-v1p4beta1/snippets/product_search/import_product_sets.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 vision_v1p4beta1_generated_ProductSearch_ImportProductSets_sync] +require "google/cloud/vision/v1p4beta1" + +## +# Snippet for the import_product_sets call in the ProductSearch 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::Vision::V1p4beta1::ProductSearch::Client#import_product_sets. +# +def import_product_sets + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Vision::V1p4beta1::ProductSearch::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Vision::V1p4beta1::ImportProductSetsRequest.new + + # Call the import_product_sets method. + result = client.import_product_sets 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 vision_v1p4beta1_generated_ProductSearch_ImportProductSets_sync] diff --git a/owl-bot-staging/google-cloud-vision-v1p4beta1/snippets/product_search/list_product_sets.rb b/owl-bot-staging/google-cloud-vision-v1p4beta1/snippets/product_search/list_product_sets.rb new file mode 100644 index 000000000000..34f4ca6b2991 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision-v1p4beta1/snippets/product_search/list_product_sets.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 vision_v1p4beta1_generated_ProductSearch_ListProductSets_sync] +require "google/cloud/vision/v1p4beta1" + +## +# Snippet for the list_product_sets call in the ProductSearch 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::Vision::V1p4beta1::ProductSearch::Client#list_product_sets. +# +def list_product_sets + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Vision::V1p4beta1::ProductSearch::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Vision::V1p4beta1::ListProductSetsRequest.new + + # Call the list_product_sets method. + result = client.list_product_sets 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::Vision::V1p4beta1::ProductSet. + p item + end +end +# [END vision_v1p4beta1_generated_ProductSearch_ListProductSets_sync] diff --git a/owl-bot-staging/google-cloud-vision-v1p4beta1/snippets/product_search/list_products.rb b/owl-bot-staging/google-cloud-vision-v1p4beta1/snippets/product_search/list_products.rb new file mode 100644 index 000000000000..e500225203b9 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision-v1p4beta1/snippets/product_search/list_products.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 vision_v1p4beta1_generated_ProductSearch_ListProducts_sync] +require "google/cloud/vision/v1p4beta1" + +## +# Snippet for the list_products call in the ProductSearch 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::Vision::V1p4beta1::ProductSearch::Client#list_products. +# +def list_products + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Vision::V1p4beta1::ProductSearch::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Vision::V1p4beta1::ListProductsRequest.new + + # Call the list_products method. + result = client.list_products 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::Vision::V1p4beta1::Product. + p item + end +end +# [END vision_v1p4beta1_generated_ProductSearch_ListProducts_sync] diff --git a/owl-bot-staging/google-cloud-vision-v1p4beta1/snippets/product_search/list_products_in_product_set.rb b/owl-bot-staging/google-cloud-vision-v1p4beta1/snippets/product_search/list_products_in_product_set.rb new file mode 100644 index 000000000000..fcda8ed986ca --- /dev/null +++ b/owl-bot-staging/google-cloud-vision-v1p4beta1/snippets/product_search/list_products_in_product_set.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 vision_v1p4beta1_generated_ProductSearch_ListProductsInProductSet_sync] +require "google/cloud/vision/v1p4beta1" + +## +# Snippet for the list_products_in_product_set call in the ProductSearch 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::Vision::V1p4beta1::ProductSearch::Client#list_products_in_product_set. +# +def list_products_in_product_set + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Vision::V1p4beta1::ProductSearch::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Vision::V1p4beta1::ListProductsInProductSetRequest.new + + # Call the list_products_in_product_set method. + result = client.list_products_in_product_set 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::Vision::V1p4beta1::Product. + p item + end +end +# [END vision_v1p4beta1_generated_ProductSearch_ListProductsInProductSet_sync] diff --git a/owl-bot-staging/google-cloud-vision-v1p4beta1/snippets/product_search/list_reference_images.rb b/owl-bot-staging/google-cloud-vision-v1p4beta1/snippets/product_search/list_reference_images.rb new file mode 100644 index 000000000000..48069abae603 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision-v1p4beta1/snippets/product_search/list_reference_images.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 vision_v1p4beta1_generated_ProductSearch_ListReferenceImages_sync] +require "google/cloud/vision/v1p4beta1" + +## +# Snippet for the list_reference_images call in the ProductSearch 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::Vision::V1p4beta1::ProductSearch::Client#list_reference_images. +# +def list_reference_images + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Vision::V1p4beta1::ProductSearch::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Vision::V1p4beta1::ListReferenceImagesRequest.new + + # Call the list_reference_images method. + result = client.list_reference_images 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::Vision::V1p4beta1::ReferenceImage. + p item + end +end +# [END vision_v1p4beta1_generated_ProductSearch_ListReferenceImages_sync] diff --git a/owl-bot-staging/google-cloud-vision-v1p4beta1/snippets/product_search/purge_products.rb b/owl-bot-staging/google-cloud-vision-v1p4beta1/snippets/product_search/purge_products.rb new file mode 100644 index 000000000000..4ec390e3f796 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision-v1p4beta1/snippets/product_search/purge_products.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 vision_v1p4beta1_generated_ProductSearch_PurgeProducts_sync] +require "google/cloud/vision/v1p4beta1" + +## +# Snippet for the purge_products call in the ProductSearch 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::Vision::V1p4beta1::ProductSearch::Client#purge_products. +# +def purge_products + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Vision::V1p4beta1::ProductSearch::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Vision::V1p4beta1::PurgeProductsRequest.new + + # Call the purge_products method. + result = client.purge_products 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 vision_v1p4beta1_generated_ProductSearch_PurgeProducts_sync] diff --git a/owl-bot-staging/google-cloud-vision-v1p4beta1/snippets/product_search/remove_product_from_product_set.rb b/owl-bot-staging/google-cloud-vision-v1p4beta1/snippets/product_search/remove_product_from_product_set.rb new file mode 100644 index 000000000000..d36e76723ceb --- /dev/null +++ b/owl-bot-staging/google-cloud-vision-v1p4beta1/snippets/product_search/remove_product_from_product_set.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 vision_v1p4beta1_generated_ProductSearch_RemoveProductFromProductSet_sync] +require "google/cloud/vision/v1p4beta1" + +## +# Snippet for the remove_product_from_product_set call in the ProductSearch 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::Vision::V1p4beta1::ProductSearch::Client#remove_product_from_product_set. +# +def remove_product_from_product_set + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Vision::V1p4beta1::ProductSearch::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Vision::V1p4beta1::RemoveProductFromProductSetRequest.new + + # Call the remove_product_from_product_set method. + result = client.remove_product_from_product_set request + + # The returned object is of type Google::Protobuf::Empty. + p result +end +# [END vision_v1p4beta1_generated_ProductSearch_RemoveProductFromProductSet_sync] diff --git a/owl-bot-staging/google-cloud-vision-v1p4beta1/snippets/product_search/update_product.rb b/owl-bot-staging/google-cloud-vision-v1p4beta1/snippets/product_search/update_product.rb new file mode 100644 index 000000000000..a31096ff5b33 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision-v1p4beta1/snippets/product_search/update_product.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 vision_v1p4beta1_generated_ProductSearch_UpdateProduct_sync] +require "google/cloud/vision/v1p4beta1" + +## +# Snippet for the update_product call in the ProductSearch 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::Vision::V1p4beta1::ProductSearch::Client#update_product. +# +def update_product + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Vision::V1p4beta1::ProductSearch::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Vision::V1p4beta1::UpdateProductRequest.new + + # Call the update_product method. + result = client.update_product request + + # The returned object is of type Google::Cloud::Vision::V1p4beta1::Product. + p result +end +# [END vision_v1p4beta1_generated_ProductSearch_UpdateProduct_sync] diff --git a/owl-bot-staging/google-cloud-vision-v1p4beta1/snippets/product_search/update_product_set.rb b/owl-bot-staging/google-cloud-vision-v1p4beta1/snippets/product_search/update_product_set.rb new file mode 100644 index 000000000000..563efaae0fca --- /dev/null +++ b/owl-bot-staging/google-cloud-vision-v1p4beta1/snippets/product_search/update_product_set.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 vision_v1p4beta1_generated_ProductSearch_UpdateProductSet_sync] +require "google/cloud/vision/v1p4beta1" + +## +# Snippet for the update_product_set call in the ProductSearch 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::Vision::V1p4beta1::ProductSearch::Client#update_product_set. +# +def update_product_set + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Vision::V1p4beta1::ProductSearch::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Vision::V1p4beta1::UpdateProductSetRequest.new + + # Call the update_product_set method. + result = client.update_product_set request + + # The returned object is of type Google::Cloud::Vision::V1p4beta1::ProductSet. + p result +end +# [END vision_v1p4beta1_generated_ProductSearch_UpdateProductSet_sync] diff --git a/owl-bot-staging/google-cloud-vision-v1p4beta1/snippets/snippet_metadata_google.cloud.vision.v1p4beta1.json b/owl-bot-staging/google-cloud-vision-v1p4beta1/snippets/snippet_metadata_google.cloud.vision.v1p4beta1.json new file mode 100644 index 000000000000..0126262b1c05 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision-v1p4beta1/snippets/snippet_metadata_google.cloud.vision.v1p4beta1.json @@ -0,0 +1,935 @@ +{ + "client_library": { + "name": "google-cloud-vision-v1p4beta1", + "version": "", + "language": "RUBY", + "apis": [ + { + "id": "google.cloud.vision.v1p4beta1", + "version": "v1p4beta1" + } + ] + }, + "snippets": [ + { + "region_tag": "vision_v1p4beta1_generated_ProductSearch_CreateProductSet_sync", + "title": "Snippet for the create_product_set call in the ProductSearch service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Vision::V1p4beta1::ProductSearch::Client#create_product_set.", + "file": "product_search/create_product_set.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_product_set", + "full_name": "::Google::Cloud::Vision::V1p4beta1::ProductSearch::Client#create_product_set", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Vision::V1p4beta1::CreateProductSetRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Vision::V1p4beta1::ProductSet", + "client": { + "short_name": "ProductSearch::Client", + "full_name": "::Google::Cloud::Vision::V1p4beta1::ProductSearch::Client" + }, + "method": { + "short_name": "CreateProductSet", + "full_name": "google.cloud.vision.v1p4beta1.ProductSearch.CreateProductSet", + "service": { + "short_name": "ProductSearch", + "full_name": "google.cloud.vision.v1p4beta1.ProductSearch" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "vision_v1p4beta1_generated_ProductSearch_ListProductSets_sync", + "title": "Snippet for the list_product_sets call in the ProductSearch service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Vision::V1p4beta1::ProductSearch::Client#list_product_sets.", + "file": "product_search/list_product_sets.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_product_sets", + "full_name": "::Google::Cloud::Vision::V1p4beta1::ProductSearch::Client#list_product_sets", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Vision::V1p4beta1::ListProductSetsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Vision::V1p4beta1::ListProductSetsResponse", + "client": { + "short_name": "ProductSearch::Client", + "full_name": "::Google::Cloud::Vision::V1p4beta1::ProductSearch::Client" + }, + "method": { + "short_name": "ListProductSets", + "full_name": "google.cloud.vision.v1p4beta1.ProductSearch.ListProductSets", + "service": { + "short_name": "ProductSearch", + "full_name": "google.cloud.vision.v1p4beta1.ProductSearch" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "vision_v1p4beta1_generated_ProductSearch_GetProductSet_sync", + "title": "Snippet for the get_product_set call in the ProductSearch service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Vision::V1p4beta1::ProductSearch::Client#get_product_set.", + "file": "product_search/get_product_set.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_product_set", + "full_name": "::Google::Cloud::Vision::V1p4beta1::ProductSearch::Client#get_product_set", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Vision::V1p4beta1::GetProductSetRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Vision::V1p4beta1::ProductSet", + "client": { + "short_name": "ProductSearch::Client", + "full_name": "::Google::Cloud::Vision::V1p4beta1::ProductSearch::Client" + }, + "method": { + "short_name": "GetProductSet", + "full_name": "google.cloud.vision.v1p4beta1.ProductSearch.GetProductSet", + "service": { + "short_name": "ProductSearch", + "full_name": "google.cloud.vision.v1p4beta1.ProductSearch" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "vision_v1p4beta1_generated_ProductSearch_UpdateProductSet_sync", + "title": "Snippet for the update_product_set call in the ProductSearch service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Vision::V1p4beta1::ProductSearch::Client#update_product_set.", + "file": "product_search/update_product_set.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_product_set", + "full_name": "::Google::Cloud::Vision::V1p4beta1::ProductSearch::Client#update_product_set", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Vision::V1p4beta1::UpdateProductSetRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Vision::V1p4beta1::ProductSet", + "client": { + "short_name": "ProductSearch::Client", + "full_name": "::Google::Cloud::Vision::V1p4beta1::ProductSearch::Client" + }, + "method": { + "short_name": "UpdateProductSet", + "full_name": "google.cloud.vision.v1p4beta1.ProductSearch.UpdateProductSet", + "service": { + "short_name": "ProductSearch", + "full_name": "google.cloud.vision.v1p4beta1.ProductSearch" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "vision_v1p4beta1_generated_ProductSearch_DeleteProductSet_sync", + "title": "Snippet for the delete_product_set call in the ProductSearch service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Vision::V1p4beta1::ProductSearch::Client#delete_product_set.", + "file": "product_search/delete_product_set.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_product_set", + "full_name": "::Google::Cloud::Vision::V1p4beta1::ProductSearch::Client#delete_product_set", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Vision::V1p4beta1::DeleteProductSetRequest", + "name": "request" + } + ], + "result_type": "::Google::Protobuf::Empty", + "client": { + "short_name": "ProductSearch::Client", + "full_name": "::Google::Cloud::Vision::V1p4beta1::ProductSearch::Client" + }, + "method": { + "short_name": "DeleteProductSet", + "full_name": "google.cloud.vision.v1p4beta1.ProductSearch.DeleteProductSet", + "service": { + "short_name": "ProductSearch", + "full_name": "google.cloud.vision.v1p4beta1.ProductSearch" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "vision_v1p4beta1_generated_ProductSearch_CreateProduct_sync", + "title": "Snippet for the create_product call in the ProductSearch service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Vision::V1p4beta1::ProductSearch::Client#create_product.", + "file": "product_search/create_product.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_product", + "full_name": "::Google::Cloud::Vision::V1p4beta1::ProductSearch::Client#create_product", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Vision::V1p4beta1::CreateProductRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Vision::V1p4beta1::Product", + "client": { + "short_name": "ProductSearch::Client", + "full_name": "::Google::Cloud::Vision::V1p4beta1::ProductSearch::Client" + }, + "method": { + "short_name": "CreateProduct", + "full_name": "google.cloud.vision.v1p4beta1.ProductSearch.CreateProduct", + "service": { + "short_name": "ProductSearch", + "full_name": "google.cloud.vision.v1p4beta1.ProductSearch" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "vision_v1p4beta1_generated_ProductSearch_ListProducts_sync", + "title": "Snippet for the list_products call in the ProductSearch service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Vision::V1p4beta1::ProductSearch::Client#list_products.", + "file": "product_search/list_products.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_products", + "full_name": "::Google::Cloud::Vision::V1p4beta1::ProductSearch::Client#list_products", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Vision::V1p4beta1::ListProductsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Vision::V1p4beta1::ListProductsResponse", + "client": { + "short_name": "ProductSearch::Client", + "full_name": "::Google::Cloud::Vision::V1p4beta1::ProductSearch::Client" + }, + "method": { + "short_name": "ListProducts", + "full_name": "google.cloud.vision.v1p4beta1.ProductSearch.ListProducts", + "service": { + "short_name": "ProductSearch", + "full_name": "google.cloud.vision.v1p4beta1.ProductSearch" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "vision_v1p4beta1_generated_ProductSearch_GetProduct_sync", + "title": "Snippet for the get_product call in the ProductSearch service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Vision::V1p4beta1::ProductSearch::Client#get_product.", + "file": "product_search/get_product.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_product", + "full_name": "::Google::Cloud::Vision::V1p4beta1::ProductSearch::Client#get_product", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Vision::V1p4beta1::GetProductRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Vision::V1p4beta1::Product", + "client": { + "short_name": "ProductSearch::Client", + "full_name": "::Google::Cloud::Vision::V1p4beta1::ProductSearch::Client" + }, + "method": { + "short_name": "GetProduct", + "full_name": "google.cloud.vision.v1p4beta1.ProductSearch.GetProduct", + "service": { + "short_name": "ProductSearch", + "full_name": "google.cloud.vision.v1p4beta1.ProductSearch" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "vision_v1p4beta1_generated_ProductSearch_UpdateProduct_sync", + "title": "Snippet for the update_product call in the ProductSearch service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Vision::V1p4beta1::ProductSearch::Client#update_product.", + "file": "product_search/update_product.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_product", + "full_name": "::Google::Cloud::Vision::V1p4beta1::ProductSearch::Client#update_product", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Vision::V1p4beta1::UpdateProductRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Vision::V1p4beta1::Product", + "client": { + "short_name": "ProductSearch::Client", + "full_name": "::Google::Cloud::Vision::V1p4beta1::ProductSearch::Client" + }, + "method": { + "short_name": "UpdateProduct", + "full_name": "google.cloud.vision.v1p4beta1.ProductSearch.UpdateProduct", + "service": { + "short_name": "ProductSearch", + "full_name": "google.cloud.vision.v1p4beta1.ProductSearch" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "vision_v1p4beta1_generated_ProductSearch_DeleteProduct_sync", + "title": "Snippet for the delete_product call in the ProductSearch service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Vision::V1p4beta1::ProductSearch::Client#delete_product.", + "file": "product_search/delete_product.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_product", + "full_name": "::Google::Cloud::Vision::V1p4beta1::ProductSearch::Client#delete_product", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Vision::V1p4beta1::DeleteProductRequest", + "name": "request" + } + ], + "result_type": "::Google::Protobuf::Empty", + "client": { + "short_name": "ProductSearch::Client", + "full_name": "::Google::Cloud::Vision::V1p4beta1::ProductSearch::Client" + }, + "method": { + "short_name": "DeleteProduct", + "full_name": "google.cloud.vision.v1p4beta1.ProductSearch.DeleteProduct", + "service": { + "short_name": "ProductSearch", + "full_name": "google.cloud.vision.v1p4beta1.ProductSearch" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "vision_v1p4beta1_generated_ProductSearch_CreateReferenceImage_sync", + "title": "Snippet for the create_reference_image call in the ProductSearch service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Vision::V1p4beta1::ProductSearch::Client#create_reference_image.", + "file": "product_search/create_reference_image.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_reference_image", + "full_name": "::Google::Cloud::Vision::V1p4beta1::ProductSearch::Client#create_reference_image", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Vision::V1p4beta1::CreateReferenceImageRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Vision::V1p4beta1::ReferenceImage", + "client": { + "short_name": "ProductSearch::Client", + "full_name": "::Google::Cloud::Vision::V1p4beta1::ProductSearch::Client" + }, + "method": { + "short_name": "CreateReferenceImage", + "full_name": "google.cloud.vision.v1p4beta1.ProductSearch.CreateReferenceImage", + "service": { + "short_name": "ProductSearch", + "full_name": "google.cloud.vision.v1p4beta1.ProductSearch" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "vision_v1p4beta1_generated_ProductSearch_DeleteReferenceImage_sync", + "title": "Snippet for the delete_reference_image call in the ProductSearch service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Vision::V1p4beta1::ProductSearch::Client#delete_reference_image.", + "file": "product_search/delete_reference_image.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_reference_image", + "full_name": "::Google::Cloud::Vision::V1p4beta1::ProductSearch::Client#delete_reference_image", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Vision::V1p4beta1::DeleteReferenceImageRequest", + "name": "request" + } + ], + "result_type": "::Google::Protobuf::Empty", + "client": { + "short_name": "ProductSearch::Client", + "full_name": "::Google::Cloud::Vision::V1p4beta1::ProductSearch::Client" + }, + "method": { + "short_name": "DeleteReferenceImage", + "full_name": "google.cloud.vision.v1p4beta1.ProductSearch.DeleteReferenceImage", + "service": { + "short_name": "ProductSearch", + "full_name": "google.cloud.vision.v1p4beta1.ProductSearch" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "vision_v1p4beta1_generated_ProductSearch_ListReferenceImages_sync", + "title": "Snippet for the list_reference_images call in the ProductSearch service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Vision::V1p4beta1::ProductSearch::Client#list_reference_images.", + "file": "product_search/list_reference_images.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_reference_images", + "full_name": "::Google::Cloud::Vision::V1p4beta1::ProductSearch::Client#list_reference_images", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Vision::V1p4beta1::ListReferenceImagesRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Vision::V1p4beta1::ListReferenceImagesResponse", + "client": { + "short_name": "ProductSearch::Client", + "full_name": "::Google::Cloud::Vision::V1p4beta1::ProductSearch::Client" + }, + "method": { + "short_name": "ListReferenceImages", + "full_name": "google.cloud.vision.v1p4beta1.ProductSearch.ListReferenceImages", + "service": { + "short_name": "ProductSearch", + "full_name": "google.cloud.vision.v1p4beta1.ProductSearch" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "vision_v1p4beta1_generated_ProductSearch_GetReferenceImage_sync", + "title": "Snippet for the get_reference_image call in the ProductSearch service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Vision::V1p4beta1::ProductSearch::Client#get_reference_image.", + "file": "product_search/get_reference_image.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_reference_image", + "full_name": "::Google::Cloud::Vision::V1p4beta1::ProductSearch::Client#get_reference_image", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Vision::V1p4beta1::GetReferenceImageRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Vision::V1p4beta1::ReferenceImage", + "client": { + "short_name": "ProductSearch::Client", + "full_name": "::Google::Cloud::Vision::V1p4beta1::ProductSearch::Client" + }, + "method": { + "short_name": "GetReferenceImage", + "full_name": "google.cloud.vision.v1p4beta1.ProductSearch.GetReferenceImage", + "service": { + "short_name": "ProductSearch", + "full_name": "google.cloud.vision.v1p4beta1.ProductSearch" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "vision_v1p4beta1_generated_ProductSearch_AddProductToProductSet_sync", + "title": "Snippet for the add_product_to_product_set call in the ProductSearch service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Vision::V1p4beta1::ProductSearch::Client#add_product_to_product_set.", + "file": "product_search/add_product_to_product_set.rb", + "language": "RUBY", + "client_method": { + "short_name": "add_product_to_product_set", + "full_name": "::Google::Cloud::Vision::V1p4beta1::ProductSearch::Client#add_product_to_product_set", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Vision::V1p4beta1::AddProductToProductSetRequest", + "name": "request" + } + ], + "result_type": "::Google::Protobuf::Empty", + "client": { + "short_name": "ProductSearch::Client", + "full_name": "::Google::Cloud::Vision::V1p4beta1::ProductSearch::Client" + }, + "method": { + "short_name": "AddProductToProductSet", + "full_name": "google.cloud.vision.v1p4beta1.ProductSearch.AddProductToProductSet", + "service": { + "short_name": "ProductSearch", + "full_name": "google.cloud.vision.v1p4beta1.ProductSearch" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "vision_v1p4beta1_generated_ProductSearch_RemoveProductFromProductSet_sync", + "title": "Snippet for the remove_product_from_product_set call in the ProductSearch service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Vision::V1p4beta1::ProductSearch::Client#remove_product_from_product_set.", + "file": "product_search/remove_product_from_product_set.rb", + "language": "RUBY", + "client_method": { + "short_name": "remove_product_from_product_set", + "full_name": "::Google::Cloud::Vision::V1p4beta1::ProductSearch::Client#remove_product_from_product_set", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Vision::V1p4beta1::RemoveProductFromProductSetRequest", + "name": "request" + } + ], + "result_type": "::Google::Protobuf::Empty", + "client": { + "short_name": "ProductSearch::Client", + "full_name": "::Google::Cloud::Vision::V1p4beta1::ProductSearch::Client" + }, + "method": { + "short_name": "RemoveProductFromProductSet", + "full_name": "google.cloud.vision.v1p4beta1.ProductSearch.RemoveProductFromProductSet", + "service": { + "short_name": "ProductSearch", + "full_name": "google.cloud.vision.v1p4beta1.ProductSearch" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "vision_v1p4beta1_generated_ProductSearch_ListProductsInProductSet_sync", + "title": "Snippet for the list_products_in_product_set call in the ProductSearch service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Vision::V1p4beta1::ProductSearch::Client#list_products_in_product_set.", + "file": "product_search/list_products_in_product_set.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_products_in_product_set", + "full_name": "::Google::Cloud::Vision::V1p4beta1::ProductSearch::Client#list_products_in_product_set", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Vision::V1p4beta1::ListProductsInProductSetRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Vision::V1p4beta1::ListProductsInProductSetResponse", + "client": { + "short_name": "ProductSearch::Client", + "full_name": "::Google::Cloud::Vision::V1p4beta1::ProductSearch::Client" + }, + "method": { + "short_name": "ListProductsInProductSet", + "full_name": "google.cloud.vision.v1p4beta1.ProductSearch.ListProductsInProductSet", + "service": { + "short_name": "ProductSearch", + "full_name": "google.cloud.vision.v1p4beta1.ProductSearch" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "vision_v1p4beta1_generated_ProductSearch_ImportProductSets_sync", + "title": "Snippet for the import_product_sets call in the ProductSearch service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Vision::V1p4beta1::ProductSearch::Client#import_product_sets.", + "file": "product_search/import_product_sets.rb", + "language": "RUBY", + "client_method": { + "short_name": "import_product_sets", + "full_name": "::Google::Cloud::Vision::V1p4beta1::ProductSearch::Client#import_product_sets", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Vision::V1p4beta1::ImportProductSetsRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "ProductSearch::Client", + "full_name": "::Google::Cloud::Vision::V1p4beta1::ProductSearch::Client" + }, + "method": { + "short_name": "ImportProductSets", + "full_name": "google.cloud.vision.v1p4beta1.ProductSearch.ImportProductSets", + "service": { + "short_name": "ProductSearch", + "full_name": "google.cloud.vision.v1p4beta1.ProductSearch" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "vision_v1p4beta1_generated_ProductSearch_PurgeProducts_sync", + "title": "Snippet for the purge_products call in the ProductSearch service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Vision::V1p4beta1::ProductSearch::Client#purge_products.", + "file": "product_search/purge_products.rb", + "language": "RUBY", + "client_method": { + "short_name": "purge_products", + "full_name": "::Google::Cloud::Vision::V1p4beta1::ProductSearch::Client#purge_products", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Vision::V1p4beta1::PurgeProductsRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "ProductSearch::Client", + "full_name": "::Google::Cloud::Vision::V1p4beta1::ProductSearch::Client" + }, + "method": { + "short_name": "PurgeProducts", + "full_name": "google.cloud.vision.v1p4beta1.ProductSearch.PurgeProducts", + "service": { + "short_name": "ProductSearch", + "full_name": "google.cloud.vision.v1p4beta1.ProductSearch" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "vision_v1p4beta1_generated_ImageAnnotator_BatchAnnotateImages_sync", + "title": "Snippet for the batch_annotate_images call in the ImageAnnotator service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Vision::V1p4beta1::ImageAnnotator::Client#batch_annotate_images.", + "file": "image_annotator/batch_annotate_images.rb", + "language": "RUBY", + "client_method": { + "short_name": "batch_annotate_images", + "full_name": "::Google::Cloud::Vision::V1p4beta1::ImageAnnotator::Client#batch_annotate_images", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Vision::V1p4beta1::BatchAnnotateImagesRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Vision::V1p4beta1::BatchAnnotateImagesResponse", + "client": { + "short_name": "ImageAnnotator::Client", + "full_name": "::Google::Cloud::Vision::V1p4beta1::ImageAnnotator::Client" + }, + "method": { + "short_name": "BatchAnnotateImages", + "full_name": "google.cloud.vision.v1p4beta1.ImageAnnotator.BatchAnnotateImages", + "service": { + "short_name": "ImageAnnotator", + "full_name": "google.cloud.vision.v1p4beta1.ImageAnnotator" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "vision_v1p4beta1_generated_ImageAnnotator_BatchAnnotateFiles_sync", + "title": "Snippet for the batch_annotate_files call in the ImageAnnotator service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Vision::V1p4beta1::ImageAnnotator::Client#batch_annotate_files.", + "file": "image_annotator/batch_annotate_files.rb", + "language": "RUBY", + "client_method": { + "short_name": "batch_annotate_files", + "full_name": "::Google::Cloud::Vision::V1p4beta1::ImageAnnotator::Client#batch_annotate_files", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Vision::V1p4beta1::BatchAnnotateFilesRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Vision::V1p4beta1::BatchAnnotateFilesResponse", + "client": { + "short_name": "ImageAnnotator::Client", + "full_name": "::Google::Cloud::Vision::V1p4beta1::ImageAnnotator::Client" + }, + "method": { + "short_name": "BatchAnnotateFiles", + "full_name": "google.cloud.vision.v1p4beta1.ImageAnnotator.BatchAnnotateFiles", + "service": { + "short_name": "ImageAnnotator", + "full_name": "google.cloud.vision.v1p4beta1.ImageAnnotator" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "vision_v1p4beta1_generated_ImageAnnotator_AsyncBatchAnnotateImages_sync", + "title": "Snippet for the async_batch_annotate_images call in the ImageAnnotator service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Vision::V1p4beta1::ImageAnnotator::Client#async_batch_annotate_images.", + "file": "image_annotator/async_batch_annotate_images.rb", + "language": "RUBY", + "client_method": { + "short_name": "async_batch_annotate_images", + "full_name": "::Google::Cloud::Vision::V1p4beta1::ImageAnnotator::Client#async_batch_annotate_images", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Vision::V1p4beta1::AsyncBatchAnnotateImagesRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "ImageAnnotator::Client", + "full_name": "::Google::Cloud::Vision::V1p4beta1::ImageAnnotator::Client" + }, + "method": { + "short_name": "AsyncBatchAnnotateImages", + "full_name": "google.cloud.vision.v1p4beta1.ImageAnnotator.AsyncBatchAnnotateImages", + "service": { + "short_name": "ImageAnnotator", + "full_name": "google.cloud.vision.v1p4beta1.ImageAnnotator" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "vision_v1p4beta1_generated_ImageAnnotator_AsyncBatchAnnotateFiles_sync", + "title": "Snippet for the async_batch_annotate_files call in the ImageAnnotator service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Vision::V1p4beta1::ImageAnnotator::Client#async_batch_annotate_files.", + "file": "image_annotator/async_batch_annotate_files.rb", + "language": "RUBY", + "client_method": { + "short_name": "async_batch_annotate_files", + "full_name": "::Google::Cloud::Vision::V1p4beta1::ImageAnnotator::Client#async_batch_annotate_files", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Vision::V1p4beta1::AsyncBatchAnnotateFilesRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "ImageAnnotator::Client", + "full_name": "::Google::Cloud::Vision::V1p4beta1::ImageAnnotator::Client" + }, + "method": { + "short_name": "AsyncBatchAnnotateFiles", + "full_name": "google.cloud.vision.v1p4beta1.ImageAnnotator.AsyncBatchAnnotateFiles", + "service": { + "short_name": "ImageAnnotator", + "full_name": "google.cloud.vision.v1p4beta1.ImageAnnotator" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + } + ] +} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-vision-v1p4beta1/test/google/cloud/vision/v1p4beta1/image_annotator_operations_test.rb b/owl-bot-staging/google-cloud-vision-v1p4beta1/test/google/cloud/vision/v1p4beta1/image_annotator_operations_test.rb new file mode 100644 index 000000000000..330883fe0c3c --- /dev/null +++ b/owl-bot-staging/google-cloud-vision-v1p4beta1/test/google/cloud/vision/v1p4beta1/image_annotator_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/vision/v1p4beta1/image_annotator_pb" +require "google/cloud/vision/v1p4beta1/image_annotator_services_pb" +require "google/cloud/vision/v1p4beta1/image_annotator" + +class ::Google::Cloud::Vision::V1p4beta1::ImageAnnotator::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::Vision::V1p4beta1::ImageAnnotator::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::Vision::V1p4beta1::ImageAnnotator::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::Vision::V1p4beta1::ImageAnnotator::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::Vision::V1p4beta1::ImageAnnotator::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::Vision::V1p4beta1::ImageAnnotator::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::Vision::V1p4beta1::ImageAnnotator::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::Vision::V1p4beta1::ImageAnnotator::Operations::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-vision-v1p4beta1/test/google/cloud/vision/v1p4beta1/image_annotator_paths_test.rb b/owl-bot-staging/google-cloud-vision-v1p4beta1/test/google/cloud/vision/v1p4beta1/image_annotator_paths_test.rb new file mode 100644 index 000000000000..fe6fddbfc65c --- /dev/null +++ b/owl-bot-staging/google-cloud-vision-v1p4beta1/test/google/cloud/vision/v1p4beta1/image_annotator_paths_test.rb @@ -0,0 +1,55 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/vision/v1p4beta1/image_annotator" + +class ::Google::Cloud::Vision::V1p4beta1::ImageAnnotator::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_product_set_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Vision::V1p4beta1::ImageAnnotator::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.product_set_path project: "value0", location: "value1", product_set: "value2" + assert_equal "projects/value0/locations/value1/productSets/value2", path + end + end +end diff --git a/owl-bot-staging/google-cloud-vision-v1p4beta1/test/google/cloud/vision/v1p4beta1/image_annotator_rest_test.rb b/owl-bot-staging/google-cloud-vision-v1p4beta1/test/google/cloud/vision/v1p4beta1/image_annotator_rest_test.rb new file mode 100644 index 000000000000..8334fca2fd3d --- /dev/null +++ b/owl-bot-staging/google-cloud-vision-v1p4beta1/test/google/cloud/vision/v1p4beta1/image_annotator_rest_test.rb @@ -0,0 +1,316 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/vision/v1p4beta1/image_annotator_pb" +require "google/cloud/vision/v1p4beta1/image_annotator/rest" + + +class ::Google::Cloud::Vision::V1p4beta1::ImageAnnotator::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_batch_annotate_images + # Create test objects. + client_result = ::Google::Cloud::Vision::V1p4beta1::BatchAnnotateImagesResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + requests = [{}] + + batch_annotate_images_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::Vision::V1p4beta1::ImageAnnotator::Rest::ServiceStub.stub :transcode_batch_annotate_images_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, batch_annotate_images_client_stub do + # Create client + client = ::Google::Cloud::Vision::V1p4beta1::ImageAnnotator::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.batch_annotate_images({ requests: requests }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.batch_annotate_images requests: requests do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.batch_annotate_images ::Google::Cloud::Vision::V1p4beta1::BatchAnnotateImagesRequest.new(requests: requests) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.batch_annotate_images({ requests: requests }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.batch_annotate_images(::Google::Cloud::Vision::V1p4beta1::BatchAnnotateImagesRequest.new(requests: requests), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, batch_annotate_images_client_stub.call_count + end + end + end + + def test_batch_annotate_files + # Create test objects. + client_result = ::Google::Cloud::Vision::V1p4beta1::BatchAnnotateFilesResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + requests = [{}] + + batch_annotate_files_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::Vision::V1p4beta1::ImageAnnotator::Rest::ServiceStub.stub :transcode_batch_annotate_files_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, batch_annotate_files_client_stub do + # Create client + client = ::Google::Cloud::Vision::V1p4beta1::ImageAnnotator::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.batch_annotate_files({ requests: requests }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.batch_annotate_files requests: requests do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.batch_annotate_files ::Google::Cloud::Vision::V1p4beta1::BatchAnnotateFilesRequest.new(requests: requests) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.batch_annotate_files({ requests: requests }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.batch_annotate_files(::Google::Cloud::Vision::V1p4beta1::BatchAnnotateFilesRequest.new(requests: requests), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, batch_annotate_files_client_stub.call_count + end + end + end + + def test_async_batch_annotate_images + # 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. + requests = [{}] + output_config = {} + + async_batch_annotate_images_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::Vision::V1p4beta1::ImageAnnotator::Rest::ServiceStub.stub :transcode_async_batch_annotate_images_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, async_batch_annotate_images_client_stub do + # Create client + client = ::Google::Cloud::Vision::V1p4beta1::ImageAnnotator::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.async_batch_annotate_images({ requests: requests, output_config: output_config }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.async_batch_annotate_images requests: requests, output_config: output_config do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.async_batch_annotate_images ::Google::Cloud::Vision::V1p4beta1::AsyncBatchAnnotateImagesRequest.new(requests: requests, output_config: output_config) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.async_batch_annotate_images({ requests: requests, output_config: output_config }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.async_batch_annotate_images(::Google::Cloud::Vision::V1p4beta1::AsyncBatchAnnotateImagesRequest.new(requests: requests, output_config: output_config), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, async_batch_annotate_images_client_stub.call_count + end + end + end + + def test_async_batch_annotate_files + # 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. + requests = [{}] + + async_batch_annotate_files_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::Vision::V1p4beta1::ImageAnnotator::Rest::ServiceStub.stub :transcode_async_batch_annotate_files_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, async_batch_annotate_files_client_stub do + # Create client + client = ::Google::Cloud::Vision::V1p4beta1::ImageAnnotator::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.async_batch_annotate_files({ requests: requests }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.async_batch_annotate_files requests: requests do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.async_batch_annotate_files ::Google::Cloud::Vision::V1p4beta1::AsyncBatchAnnotateFilesRequest.new(requests: requests) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.async_batch_annotate_files({ requests: requests }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.async_batch_annotate_files(::Google::Cloud::Vision::V1p4beta1::AsyncBatchAnnotateFilesRequest.new(requests: requests), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, async_batch_annotate_files_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::Vision::V1p4beta1::ImageAnnotator::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::Vision::V1p4beta1::ImageAnnotator::Rest::Client::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-vision-v1p4beta1/test/google/cloud/vision/v1p4beta1/image_annotator_test.rb b/owl-bot-staging/google-cloud-vision-v1p4beta1/test/google/cloud/vision/v1p4beta1/image_annotator_test.rb new file mode 100644 index 000000000000..64029a17a8e2 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision-v1p4beta1/test/google/cloud/vision/v1p4beta1/image_annotator_test.rb @@ -0,0 +1,362 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/vision/v1p4beta1/image_annotator_pb" +require "google/cloud/vision/v1p4beta1/image_annotator" + +class ::Google::Cloud::Vision::V1p4beta1::ImageAnnotator::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_batch_annotate_images + # Create GRPC objects. + grpc_response = ::Google::Cloud::Vision::V1p4beta1::BatchAnnotateImagesResponse.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. + requests = [{}] + + batch_annotate_images_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :batch_annotate_images, name + assert_kind_of ::Google::Cloud::Vision::V1p4beta1::BatchAnnotateImagesRequest, request + assert_kind_of ::Google::Cloud::Vision::V1p4beta1::AnnotateImageRequest, request["requests"].first + refute_nil options + end + + Gapic::ServiceStub.stub :new, batch_annotate_images_client_stub do + # Create client + client = ::Google::Cloud::Vision::V1p4beta1::ImageAnnotator::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.batch_annotate_images({ requests: requests }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.batch_annotate_images requests: requests do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.batch_annotate_images ::Google::Cloud::Vision::V1p4beta1::BatchAnnotateImagesRequest.new(requests: requests) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.batch_annotate_images({ requests: requests }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.batch_annotate_images(::Google::Cloud::Vision::V1p4beta1::BatchAnnotateImagesRequest.new(requests: requests), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, batch_annotate_images_client_stub.call_rpc_count + end + end + + def test_batch_annotate_files + # Create GRPC objects. + grpc_response = ::Google::Cloud::Vision::V1p4beta1::BatchAnnotateFilesResponse.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. + requests = [{}] + + batch_annotate_files_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :batch_annotate_files, name + assert_kind_of ::Google::Cloud::Vision::V1p4beta1::BatchAnnotateFilesRequest, request + assert_kind_of ::Google::Cloud::Vision::V1p4beta1::AnnotateFileRequest, request["requests"].first + refute_nil options + end + + Gapic::ServiceStub.stub :new, batch_annotate_files_client_stub do + # Create client + client = ::Google::Cloud::Vision::V1p4beta1::ImageAnnotator::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.batch_annotate_files({ requests: requests }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.batch_annotate_files requests: requests do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.batch_annotate_files ::Google::Cloud::Vision::V1p4beta1::BatchAnnotateFilesRequest.new(requests: requests) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.batch_annotate_files({ requests: requests }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.batch_annotate_files(::Google::Cloud::Vision::V1p4beta1::BatchAnnotateFilesRequest.new(requests: requests), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, batch_annotate_files_client_stub.call_rpc_count + end + end + + def test_async_batch_annotate_images + # 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. + requests = [{}] + output_config = {} + + async_batch_annotate_images_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :async_batch_annotate_images, name + assert_kind_of ::Google::Cloud::Vision::V1p4beta1::AsyncBatchAnnotateImagesRequest, request + assert_kind_of ::Google::Cloud::Vision::V1p4beta1::AnnotateImageRequest, request["requests"].first + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Vision::V1p4beta1::OutputConfig), request["output_config"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, async_batch_annotate_images_client_stub do + # Create client + client = ::Google::Cloud::Vision::V1p4beta1::ImageAnnotator::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.async_batch_annotate_images({ requests: requests, output_config: output_config }) 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.async_batch_annotate_images requests: requests, output_config: output_config 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.async_batch_annotate_images ::Google::Cloud::Vision::V1p4beta1::AsyncBatchAnnotateImagesRequest.new(requests: requests, output_config: output_config) 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.async_batch_annotate_images({ requests: requests, output_config: output_config }, 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.async_batch_annotate_images(::Google::Cloud::Vision::V1p4beta1::AsyncBatchAnnotateImagesRequest.new(requests: requests, output_config: output_config), 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, async_batch_annotate_images_client_stub.call_rpc_count + end + end + + def test_async_batch_annotate_files + # 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. + requests = [{}] + + async_batch_annotate_files_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :async_batch_annotate_files, name + assert_kind_of ::Google::Cloud::Vision::V1p4beta1::AsyncBatchAnnotateFilesRequest, request + assert_kind_of ::Google::Cloud::Vision::V1p4beta1::AsyncAnnotateFileRequest, request["requests"].first + refute_nil options + end + + Gapic::ServiceStub.stub :new, async_batch_annotate_files_client_stub do + # Create client + client = ::Google::Cloud::Vision::V1p4beta1::ImageAnnotator::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.async_batch_annotate_files({ requests: requests }) 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.async_batch_annotate_files requests: requests 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.async_batch_annotate_files ::Google::Cloud::Vision::V1p4beta1::AsyncBatchAnnotateFilesRequest.new(requests: requests) 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.async_batch_annotate_files({ requests: requests }, 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.async_batch_annotate_files(::Google::Cloud::Vision::V1p4beta1::AsyncBatchAnnotateFilesRequest.new(requests: requests), 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, async_batch_annotate_files_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::Vision::V1p4beta1::ImageAnnotator::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::Vision::V1p4beta1::ImageAnnotator::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::Vision::V1p4beta1::ImageAnnotator::Client.new do |config| + config.credentials = creds + end + assert_kind_of ::Google::Cloud::Vision::V1p4beta1::ImageAnnotator::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::Vision::V1p4beta1::ImageAnnotator::Client.new do |config| + config.credentials = grpc_channel + end + end + + assert_kind_of ::Google::Cloud::Vision::V1p4beta1::ImageAnnotator::Operations, client.operations_client + end +end diff --git a/owl-bot-staging/google-cloud-vision-v1p4beta1/test/google/cloud/vision/v1p4beta1/product_search_operations_test.rb b/owl-bot-staging/google-cloud-vision-v1p4beta1/test/google/cloud/vision/v1p4beta1/product_search_operations_test.rb new file mode 100644 index 000000000000..71071f78046c --- /dev/null +++ b/owl-bot-staging/google-cloud-vision-v1p4beta1/test/google/cloud/vision/v1p4beta1/product_search_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/vision/v1p4beta1/product_search_service_pb" +require "google/cloud/vision/v1p4beta1/product_search_service_services_pb" +require "google/cloud/vision/v1p4beta1/product_search" + +class ::Google::Cloud::Vision::V1p4beta1::ProductSearch::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::Vision::V1p4beta1::ProductSearch::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::Vision::V1p4beta1::ProductSearch::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::Vision::V1p4beta1::ProductSearch::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::Vision::V1p4beta1::ProductSearch::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::Vision::V1p4beta1::ProductSearch::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::Vision::V1p4beta1::ProductSearch::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::Vision::V1p4beta1::ProductSearch::Operations::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-vision-v1p4beta1/test/google/cloud/vision/v1p4beta1/product_search_paths_test.rb b/owl-bot-staging/google-cloud-vision-v1p4beta1/test/google/cloud/vision/v1p4beta1/product_search_paths_test.rb new file mode 100644 index 000000000000..1690b8545f17 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision-v1p4beta1/test/google/cloud/vision/v1p4beta1/product_search_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/vision/v1p4beta1/product_search" + +class ::Google::Cloud::Vision::V1p4beta1::ProductSearch::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::Vision::V1p4beta1::ProductSearch::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_product_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Vision::V1p4beta1::ProductSearch::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.product_path project: "value0", location: "value1", product: "value2" + assert_equal "projects/value0/locations/value1/products/value2", path + end + end + + def test_product_set_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Vision::V1p4beta1::ProductSearch::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.product_set_path project: "value0", location: "value1", product_set: "value2" + assert_equal "projects/value0/locations/value1/productSets/value2", path + end + end + + def test_reference_image_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Vision::V1p4beta1::ProductSearch::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.reference_image_path project: "value0", location: "value1", product: "value2", reference_image: "value3" + assert_equal "projects/value0/locations/value1/products/value2/referenceImages/value3", path + end + end +end diff --git a/owl-bot-staging/google-cloud-vision-v1p4beta1/test/google/cloud/vision/v1p4beta1/product_search_rest_test.rb b/owl-bot-staging/google-cloud-vision-v1p4beta1/test/google/cloud/vision/v1p4beta1/product_search_rest_test.rb new file mode 100644 index 000000000000..38273cf58b6f --- /dev/null +++ b/owl-bot-staging/google-cloud-vision-v1p4beta1/test/google/cloud/vision/v1p4beta1/product_search_rest_test.rb @@ -0,0 +1,1146 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/vision/v1p4beta1/product_search_service_pb" +require "google/cloud/vision/v1p4beta1/product_search/rest" + + +class ::Google::Cloud::Vision::V1p4beta1::ProductSearch::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_product_set + # Create test objects. + client_result = ::Google::Cloud::Vision::V1p4beta1::ProductSet.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + product_set = {} + product_set_id = "hello world" + + create_product_set_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::Vision::V1p4beta1::ProductSearch::Rest::ServiceStub.stub :transcode_create_product_set_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_product_set_client_stub do + # Create client + client = ::Google::Cloud::Vision::V1p4beta1::ProductSearch::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_product_set({ parent: parent, product_set: product_set, product_set_id: product_set_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_product_set parent: parent, product_set: product_set, product_set_id: product_set_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_product_set ::Google::Cloud::Vision::V1p4beta1::CreateProductSetRequest.new(parent: parent, product_set: product_set, product_set_id: product_set_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_product_set({ parent: parent, product_set: product_set, product_set_id: product_set_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_product_set(::Google::Cloud::Vision::V1p4beta1::CreateProductSetRequest.new(parent: parent, product_set: product_set, product_set_id: product_set_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_product_set_client_stub.call_count + end + end + end + + def test_list_product_sets + # Create test objects. + client_result = ::Google::Cloud::Vision::V1p4beta1::ListProductSetsResponse.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_product_sets_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::Vision::V1p4beta1::ProductSearch::Rest::ServiceStub.stub :transcode_list_product_sets_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_product_sets_client_stub do + # Create client + client = ::Google::Cloud::Vision::V1p4beta1::ProductSearch::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_product_sets({ 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_product_sets 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_product_sets ::Google::Cloud::Vision::V1p4beta1::ListProductSetsRequest.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_product_sets({ 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_product_sets(::Google::Cloud::Vision::V1p4beta1::ListProductSetsRequest.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_product_sets_client_stub.call_count + end + end + end + + def test_get_product_set + # Create test objects. + client_result = ::Google::Cloud::Vision::V1p4beta1::ProductSet.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_product_set_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::Vision::V1p4beta1::ProductSearch::Rest::ServiceStub.stub :transcode_get_product_set_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_product_set_client_stub do + # Create client + client = ::Google::Cloud::Vision::V1p4beta1::ProductSearch::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_product_set({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_product_set name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_product_set ::Google::Cloud::Vision::V1p4beta1::GetProductSetRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_product_set({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_product_set(::Google::Cloud::Vision::V1p4beta1::GetProductSetRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_product_set_client_stub.call_count + end + end + end + + def test_update_product_set + # Create test objects. + client_result = ::Google::Cloud::Vision::V1p4beta1::ProductSet.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + product_set = {} + update_mask = {} + + update_product_set_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::Vision::V1p4beta1::ProductSearch::Rest::ServiceStub.stub :transcode_update_product_set_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_product_set_client_stub do + # Create client + client = ::Google::Cloud::Vision::V1p4beta1::ProductSearch::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_product_set({ product_set: product_set, update_mask: update_mask }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_product_set product_set: product_set, update_mask: update_mask do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_product_set ::Google::Cloud::Vision::V1p4beta1::UpdateProductSetRequest.new(product_set: product_set, update_mask: update_mask) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_product_set({ product_set: product_set, update_mask: update_mask }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_product_set(::Google::Cloud::Vision::V1p4beta1::UpdateProductSetRequest.new(product_set: product_set, update_mask: update_mask), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_product_set_client_stub.call_count + end + end + end + + def test_delete_product_set + # 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_product_set_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::Vision::V1p4beta1::ProductSearch::Rest::ServiceStub.stub :transcode_delete_product_set_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_product_set_client_stub do + # Create client + client = ::Google::Cloud::Vision::V1p4beta1::ProductSearch::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_product_set({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_product_set name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_product_set ::Google::Cloud::Vision::V1p4beta1::DeleteProductSetRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_product_set({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_product_set(::Google::Cloud::Vision::V1p4beta1::DeleteProductSetRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_product_set_client_stub.call_count + end + end + end + + def test_create_product + # Create test objects. + client_result = ::Google::Cloud::Vision::V1p4beta1::Product.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + product = {} + product_id = "hello world" + + create_product_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::Vision::V1p4beta1::ProductSearch::Rest::ServiceStub.stub :transcode_create_product_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_product_client_stub do + # Create client + client = ::Google::Cloud::Vision::V1p4beta1::ProductSearch::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_product({ parent: parent, product: product, product_id: product_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_product parent: parent, product: product, product_id: product_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_product ::Google::Cloud::Vision::V1p4beta1::CreateProductRequest.new(parent: parent, product: product, product_id: product_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_product({ parent: parent, product: product, product_id: product_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_product(::Google::Cloud::Vision::V1p4beta1::CreateProductRequest.new(parent: parent, product: product, product_id: product_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_product_client_stub.call_count + end + end + end + + def test_list_products + # Create test objects. + client_result = ::Google::Cloud::Vision::V1p4beta1::ListProductsResponse.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_products_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::Vision::V1p4beta1::ProductSearch::Rest::ServiceStub.stub :transcode_list_products_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_products_client_stub do + # Create client + client = ::Google::Cloud::Vision::V1p4beta1::ProductSearch::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_products({ 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_products 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_products ::Google::Cloud::Vision::V1p4beta1::ListProductsRequest.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_products({ 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_products(::Google::Cloud::Vision::V1p4beta1::ListProductsRequest.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_products_client_stub.call_count + end + end + end + + def test_get_product + # Create test objects. + client_result = ::Google::Cloud::Vision::V1p4beta1::Product.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_product_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::Vision::V1p4beta1::ProductSearch::Rest::ServiceStub.stub :transcode_get_product_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_product_client_stub do + # Create client + client = ::Google::Cloud::Vision::V1p4beta1::ProductSearch::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_product({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_product name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_product ::Google::Cloud::Vision::V1p4beta1::GetProductRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_product({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_product(::Google::Cloud::Vision::V1p4beta1::GetProductRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_product_client_stub.call_count + end + end + end + + def test_update_product + # Create test objects. + client_result = ::Google::Cloud::Vision::V1p4beta1::Product.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + product = {} + update_mask = {} + + update_product_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::Vision::V1p4beta1::ProductSearch::Rest::ServiceStub.stub :transcode_update_product_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_product_client_stub do + # Create client + client = ::Google::Cloud::Vision::V1p4beta1::ProductSearch::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_product({ product: product, update_mask: update_mask }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_product product: product, update_mask: update_mask do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_product ::Google::Cloud::Vision::V1p4beta1::UpdateProductRequest.new(product: product, update_mask: update_mask) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_product({ product: product, update_mask: update_mask }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_product(::Google::Cloud::Vision::V1p4beta1::UpdateProductRequest.new(product: product, update_mask: update_mask), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_product_client_stub.call_count + end + end + end + + def test_delete_product + # 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_product_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::Vision::V1p4beta1::ProductSearch::Rest::ServiceStub.stub :transcode_delete_product_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_product_client_stub do + # Create client + client = ::Google::Cloud::Vision::V1p4beta1::ProductSearch::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_product({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_product name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_product ::Google::Cloud::Vision::V1p4beta1::DeleteProductRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_product({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_product(::Google::Cloud::Vision::V1p4beta1::DeleteProductRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_product_client_stub.call_count + end + end + end + + def test_create_reference_image + # Create test objects. + client_result = ::Google::Cloud::Vision::V1p4beta1::ReferenceImage.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + reference_image = {} + reference_image_id = "hello world" + + create_reference_image_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::Vision::V1p4beta1::ProductSearch::Rest::ServiceStub.stub :transcode_create_reference_image_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_reference_image_client_stub do + # Create client + client = ::Google::Cloud::Vision::V1p4beta1::ProductSearch::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_reference_image({ parent: parent, reference_image: reference_image, reference_image_id: reference_image_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_reference_image parent: parent, reference_image: reference_image, reference_image_id: reference_image_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_reference_image ::Google::Cloud::Vision::V1p4beta1::CreateReferenceImageRequest.new(parent: parent, reference_image: reference_image, reference_image_id: reference_image_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_reference_image({ parent: parent, reference_image: reference_image, reference_image_id: reference_image_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_reference_image(::Google::Cloud::Vision::V1p4beta1::CreateReferenceImageRequest.new(parent: parent, reference_image: reference_image, reference_image_id: reference_image_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_reference_image_client_stub.call_count + end + end + end + + def test_delete_reference_image + # 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_reference_image_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::Vision::V1p4beta1::ProductSearch::Rest::ServiceStub.stub :transcode_delete_reference_image_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_reference_image_client_stub do + # Create client + client = ::Google::Cloud::Vision::V1p4beta1::ProductSearch::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_reference_image({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_reference_image name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_reference_image ::Google::Cloud::Vision::V1p4beta1::DeleteReferenceImageRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_reference_image({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_reference_image(::Google::Cloud::Vision::V1p4beta1::DeleteReferenceImageRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_reference_image_client_stub.call_count + end + end + end + + def test_list_reference_images + # Create test objects. + client_result = ::Google::Cloud::Vision::V1p4beta1::ListReferenceImagesResponse.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_reference_images_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::Vision::V1p4beta1::ProductSearch::Rest::ServiceStub.stub :transcode_list_reference_images_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_reference_images_client_stub do + # Create client + client = ::Google::Cloud::Vision::V1p4beta1::ProductSearch::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_reference_images({ 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_reference_images 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_reference_images ::Google::Cloud::Vision::V1p4beta1::ListReferenceImagesRequest.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_reference_images({ 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_reference_images(::Google::Cloud::Vision::V1p4beta1::ListReferenceImagesRequest.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_reference_images_client_stub.call_count + end + end + end + + def test_get_reference_image + # Create test objects. + client_result = ::Google::Cloud::Vision::V1p4beta1::ReferenceImage.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_reference_image_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::Vision::V1p4beta1::ProductSearch::Rest::ServiceStub.stub :transcode_get_reference_image_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_reference_image_client_stub do + # Create client + client = ::Google::Cloud::Vision::V1p4beta1::ProductSearch::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_reference_image({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_reference_image name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_reference_image ::Google::Cloud::Vision::V1p4beta1::GetReferenceImageRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_reference_image({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_reference_image(::Google::Cloud::Vision::V1p4beta1::GetReferenceImageRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_reference_image_client_stub.call_count + end + end + end + + def test_add_product_to_product_set + # 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" + product = "hello world" + + add_product_to_product_set_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::Vision::V1p4beta1::ProductSearch::Rest::ServiceStub.stub :transcode_add_product_to_product_set_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, add_product_to_product_set_client_stub do + # Create client + client = ::Google::Cloud::Vision::V1p4beta1::ProductSearch::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.add_product_to_product_set({ name: name, product: product }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.add_product_to_product_set name: name, product: product do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.add_product_to_product_set ::Google::Cloud::Vision::V1p4beta1::AddProductToProductSetRequest.new(name: name, product: product) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.add_product_to_product_set({ name: name, product: product }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.add_product_to_product_set(::Google::Cloud::Vision::V1p4beta1::AddProductToProductSetRequest.new(name: name, product: product), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, add_product_to_product_set_client_stub.call_count + end + end + end + + def test_remove_product_from_product_set + # 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" + product = "hello world" + + remove_product_from_product_set_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::Vision::V1p4beta1::ProductSearch::Rest::ServiceStub.stub :transcode_remove_product_from_product_set_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, remove_product_from_product_set_client_stub do + # Create client + client = ::Google::Cloud::Vision::V1p4beta1::ProductSearch::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.remove_product_from_product_set({ name: name, product: product }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.remove_product_from_product_set name: name, product: product do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.remove_product_from_product_set ::Google::Cloud::Vision::V1p4beta1::RemoveProductFromProductSetRequest.new(name: name, product: product) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.remove_product_from_product_set({ name: name, product: product }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.remove_product_from_product_set(::Google::Cloud::Vision::V1p4beta1::RemoveProductFromProductSetRequest.new(name: name, product: product), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, remove_product_from_product_set_client_stub.call_count + end + end + end + + def test_list_products_in_product_set + # Create test objects. + client_result = ::Google::Cloud::Vision::V1p4beta1::ListProductsInProductSetResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + page_size = 42 + page_token = "hello world" + + list_products_in_product_set_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::Vision::V1p4beta1::ProductSearch::Rest::ServiceStub.stub :transcode_list_products_in_product_set_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_products_in_product_set_client_stub do + # Create client + client = ::Google::Cloud::Vision::V1p4beta1::ProductSearch::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_products_in_product_set({ name: name, page_size: page_size, page_token: page_token }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.list_products_in_product_set name: name, page_size: page_size, page_token: page_token do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.list_products_in_product_set ::Google::Cloud::Vision::V1p4beta1::ListProductsInProductSetRequest.new(name: name, 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_products_in_product_set({ name: name, 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_products_in_product_set(::Google::Cloud::Vision::V1p4beta1::ListProductsInProductSetRequest.new(name: name, 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_products_in_product_set_client_stub.call_count + end + end + end + + def test_import_product_sets + # 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" + input_config = {} + + import_product_sets_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::Vision::V1p4beta1::ProductSearch::Rest::ServiceStub.stub :transcode_import_product_sets_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, import_product_sets_client_stub do + # Create client + client = ::Google::Cloud::Vision::V1p4beta1::ProductSearch::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.import_product_sets({ parent: parent, input_config: input_config }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.import_product_sets parent: parent, input_config: input_config do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.import_product_sets ::Google::Cloud::Vision::V1p4beta1::ImportProductSetsRequest.new(parent: parent, input_config: input_config) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.import_product_sets({ parent: parent, input_config: input_config }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.import_product_sets(::Google::Cloud::Vision::V1p4beta1::ImportProductSetsRequest.new(parent: parent, input_config: input_config), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, import_product_sets_client_stub.call_count + end + end + end + + def test_purge_products + # 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. + product_set_purge_config = {} + parent = "hello world" + force = true + + purge_products_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::Vision::V1p4beta1::ProductSearch::Rest::ServiceStub.stub :transcode_purge_products_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, purge_products_client_stub do + # Create client + client = ::Google::Cloud::Vision::V1p4beta1::ProductSearch::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.purge_products({ product_set_purge_config: product_set_purge_config, parent: parent, force: force }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.purge_products product_set_purge_config: product_set_purge_config, parent: parent, force: force do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.purge_products ::Google::Cloud::Vision::V1p4beta1::PurgeProductsRequest.new(product_set_purge_config: product_set_purge_config, parent: parent, force: force) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.purge_products({ product_set_purge_config: product_set_purge_config, parent: parent, force: force }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.purge_products(::Google::Cloud::Vision::V1p4beta1::PurgeProductsRequest.new(product_set_purge_config: product_set_purge_config, parent: parent, force: force), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, purge_products_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::Vision::V1p4beta1::ProductSearch::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::Vision::V1p4beta1::ProductSearch::Rest::Client::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-vision-v1p4beta1/test/google/cloud/vision/v1p4beta1/product_search_test.rb b/owl-bot-staging/google-cloud-vision-v1p4beta1/test/google/cloud/vision/v1p4beta1/product_search_test.rb new file mode 100644 index 000000000000..6fb82bba4ea5 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision-v1p4beta1/test/google/cloud/vision/v1p4beta1/product_search_test.rb @@ -0,0 +1,1293 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/vision/v1p4beta1/product_search_service_pb" +require "google/cloud/vision/v1p4beta1/product_search" + +class ::Google::Cloud::Vision::V1p4beta1::ProductSearch::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_product_set + # Create GRPC objects. + grpc_response = ::Google::Cloud::Vision::V1p4beta1::ProductSet.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" + product_set = {} + product_set_id = "hello world" + + create_product_set_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_product_set, name + assert_kind_of ::Google::Cloud::Vision::V1p4beta1::CreateProductSetRequest, request + assert_equal "hello world", request["parent"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Vision::V1p4beta1::ProductSet), request["product_set"] + assert_equal "hello world", request["product_set_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_product_set_client_stub do + # Create client + client = ::Google::Cloud::Vision::V1p4beta1::ProductSearch::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_product_set({ parent: parent, product_set: product_set, product_set_id: product_set_id }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.create_product_set parent: parent, product_set: product_set, product_set_id: product_set_id do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.create_product_set ::Google::Cloud::Vision::V1p4beta1::CreateProductSetRequest.new(parent: parent, product_set: product_set, product_set_id: product_set_id) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.create_product_set({ parent: parent, product_set: product_set, product_set_id: product_set_id }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.create_product_set(::Google::Cloud::Vision::V1p4beta1::CreateProductSetRequest.new(parent: parent, product_set: product_set, product_set_id: product_set_id), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, create_product_set_client_stub.call_rpc_count + end + end + + def test_list_product_sets + # Create GRPC objects. + grpc_response = ::Google::Cloud::Vision::V1p4beta1::ListProductSetsResponse.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_product_sets_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_product_sets, name + assert_kind_of ::Google::Cloud::Vision::V1p4beta1::ListProductSetsRequest, 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_product_sets_client_stub do + # Create client + client = ::Google::Cloud::Vision::V1p4beta1::ProductSearch::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_product_sets({ 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_product_sets 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_product_sets ::Google::Cloud::Vision::V1p4beta1::ListProductSetsRequest.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_product_sets({ 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_product_sets(::Google::Cloud::Vision::V1p4beta1::ListProductSetsRequest.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_product_sets_client_stub.call_rpc_count + end + end + + def test_get_product_set + # Create GRPC objects. + grpc_response = ::Google::Cloud::Vision::V1p4beta1::ProductSet.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_product_set_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_product_set, name + assert_kind_of ::Google::Cloud::Vision::V1p4beta1::GetProductSetRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_product_set_client_stub do + # Create client + client = ::Google::Cloud::Vision::V1p4beta1::ProductSearch::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_product_set({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_product_set name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_product_set ::Google::Cloud::Vision::V1p4beta1::GetProductSetRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_product_set({ 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_product_set(::Google::Cloud::Vision::V1p4beta1::GetProductSetRequest.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_product_set_client_stub.call_rpc_count + end + end + + def test_update_product_set + # Create GRPC objects. + grpc_response = ::Google::Cloud::Vision::V1p4beta1::ProductSet.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. + product_set = {} + update_mask = {} + + update_product_set_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_product_set, name + assert_kind_of ::Google::Cloud::Vision::V1p4beta1::UpdateProductSetRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Vision::V1p4beta1::ProductSet), request["product_set"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_product_set_client_stub do + # Create client + client = ::Google::Cloud::Vision::V1p4beta1::ProductSearch::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_product_set({ product_set: product_set, update_mask: update_mask }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.update_product_set product_set: product_set, update_mask: update_mask do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.update_product_set ::Google::Cloud::Vision::V1p4beta1::UpdateProductSetRequest.new(product_set: product_set, 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_product_set({ product_set: product_set, 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_product_set(::Google::Cloud::Vision::V1p4beta1::UpdateProductSetRequest.new(product_set: product_set, 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_product_set_client_stub.call_rpc_count + end + end + + def test_delete_product_set + # 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_product_set_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_product_set, name + assert_kind_of ::Google::Cloud::Vision::V1p4beta1::DeleteProductSetRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_product_set_client_stub do + # Create client + client = ::Google::Cloud::Vision::V1p4beta1::ProductSearch::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_product_set({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_product_set name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_product_set ::Google::Cloud::Vision::V1p4beta1::DeleteProductSetRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_product_set({ 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_product_set(::Google::Cloud::Vision::V1p4beta1::DeleteProductSetRequest.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_product_set_client_stub.call_rpc_count + end + end + + def test_create_product + # Create GRPC objects. + grpc_response = ::Google::Cloud::Vision::V1p4beta1::Product.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" + product = {} + product_id = "hello world" + + create_product_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_product, name + assert_kind_of ::Google::Cloud::Vision::V1p4beta1::CreateProductRequest, request + assert_equal "hello world", request["parent"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Vision::V1p4beta1::Product), request["product"] + assert_equal "hello world", request["product_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_product_client_stub do + # Create client + client = ::Google::Cloud::Vision::V1p4beta1::ProductSearch::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_product({ parent: parent, product: product, product_id: product_id }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.create_product parent: parent, product: product, product_id: product_id do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.create_product ::Google::Cloud::Vision::V1p4beta1::CreateProductRequest.new(parent: parent, product: product, product_id: product_id) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.create_product({ parent: parent, product: product, product_id: product_id }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.create_product(::Google::Cloud::Vision::V1p4beta1::CreateProductRequest.new(parent: parent, product: product, product_id: product_id), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, create_product_client_stub.call_rpc_count + end + end + + def test_list_products + # Create GRPC objects. + grpc_response = ::Google::Cloud::Vision::V1p4beta1::ListProductsResponse.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_products_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_products, name + assert_kind_of ::Google::Cloud::Vision::V1p4beta1::ListProductsRequest, 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_products_client_stub do + # Create client + client = ::Google::Cloud::Vision::V1p4beta1::ProductSearch::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_products({ 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_products 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_products ::Google::Cloud::Vision::V1p4beta1::ListProductsRequest.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_products({ 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_products(::Google::Cloud::Vision::V1p4beta1::ListProductsRequest.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_products_client_stub.call_rpc_count + end + end + + def test_get_product + # Create GRPC objects. + grpc_response = ::Google::Cloud::Vision::V1p4beta1::Product.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_product_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_product, name + assert_kind_of ::Google::Cloud::Vision::V1p4beta1::GetProductRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_product_client_stub do + # Create client + client = ::Google::Cloud::Vision::V1p4beta1::ProductSearch::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_product({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_product name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_product ::Google::Cloud::Vision::V1p4beta1::GetProductRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_product({ 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_product(::Google::Cloud::Vision::V1p4beta1::GetProductRequest.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_product_client_stub.call_rpc_count + end + end + + def test_update_product + # Create GRPC objects. + grpc_response = ::Google::Cloud::Vision::V1p4beta1::Product.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. + product = {} + update_mask = {} + + update_product_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_product, name + assert_kind_of ::Google::Cloud::Vision::V1p4beta1::UpdateProductRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Vision::V1p4beta1::Product), request["product"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_product_client_stub do + # Create client + client = ::Google::Cloud::Vision::V1p4beta1::ProductSearch::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_product({ product: product, update_mask: update_mask }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.update_product product: product, update_mask: update_mask do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.update_product ::Google::Cloud::Vision::V1p4beta1::UpdateProductRequest.new(product: product, 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_product({ product: product, 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_product(::Google::Cloud::Vision::V1p4beta1::UpdateProductRequest.new(product: product, 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_product_client_stub.call_rpc_count + end + end + + def test_delete_product + # 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_product_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_product, name + assert_kind_of ::Google::Cloud::Vision::V1p4beta1::DeleteProductRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_product_client_stub do + # Create client + client = ::Google::Cloud::Vision::V1p4beta1::ProductSearch::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_product({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_product name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_product ::Google::Cloud::Vision::V1p4beta1::DeleteProductRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_product({ 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_product(::Google::Cloud::Vision::V1p4beta1::DeleteProductRequest.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_product_client_stub.call_rpc_count + end + end + + def test_create_reference_image + # Create GRPC objects. + grpc_response = ::Google::Cloud::Vision::V1p4beta1::ReferenceImage.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" + reference_image = {} + reference_image_id = "hello world" + + create_reference_image_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_reference_image, name + assert_kind_of ::Google::Cloud::Vision::V1p4beta1::CreateReferenceImageRequest, request + assert_equal "hello world", request["parent"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Vision::V1p4beta1::ReferenceImage), request["reference_image"] + assert_equal "hello world", request["reference_image_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_reference_image_client_stub do + # Create client + client = ::Google::Cloud::Vision::V1p4beta1::ProductSearch::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_reference_image({ parent: parent, reference_image: reference_image, reference_image_id: reference_image_id }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.create_reference_image parent: parent, reference_image: reference_image, reference_image_id: reference_image_id do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.create_reference_image ::Google::Cloud::Vision::V1p4beta1::CreateReferenceImageRequest.new(parent: parent, reference_image: reference_image, reference_image_id: reference_image_id) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.create_reference_image({ parent: parent, reference_image: reference_image, reference_image_id: reference_image_id }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.create_reference_image(::Google::Cloud::Vision::V1p4beta1::CreateReferenceImageRequest.new(parent: parent, reference_image: reference_image, reference_image_id: reference_image_id), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, create_reference_image_client_stub.call_rpc_count + end + end + + def test_delete_reference_image + # 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_reference_image_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_reference_image, name + assert_kind_of ::Google::Cloud::Vision::V1p4beta1::DeleteReferenceImageRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_reference_image_client_stub do + # Create client + client = ::Google::Cloud::Vision::V1p4beta1::ProductSearch::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_reference_image({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_reference_image name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_reference_image ::Google::Cloud::Vision::V1p4beta1::DeleteReferenceImageRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_reference_image({ 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_reference_image(::Google::Cloud::Vision::V1p4beta1::DeleteReferenceImageRequest.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_reference_image_client_stub.call_rpc_count + end + end + + def test_list_reference_images + # Create GRPC objects. + grpc_response = ::Google::Cloud::Vision::V1p4beta1::ListReferenceImagesResponse.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_reference_images_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_reference_images, name + assert_kind_of ::Google::Cloud::Vision::V1p4beta1::ListReferenceImagesRequest, 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_reference_images_client_stub do + # Create client + client = ::Google::Cloud::Vision::V1p4beta1::ProductSearch::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_reference_images({ 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_reference_images 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_reference_images ::Google::Cloud::Vision::V1p4beta1::ListReferenceImagesRequest.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_reference_images({ 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_reference_images(::Google::Cloud::Vision::V1p4beta1::ListReferenceImagesRequest.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_reference_images_client_stub.call_rpc_count + end + end + + def test_get_reference_image + # Create GRPC objects. + grpc_response = ::Google::Cloud::Vision::V1p4beta1::ReferenceImage.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_reference_image_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_reference_image, name + assert_kind_of ::Google::Cloud::Vision::V1p4beta1::GetReferenceImageRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_reference_image_client_stub do + # Create client + client = ::Google::Cloud::Vision::V1p4beta1::ProductSearch::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_reference_image({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_reference_image name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_reference_image ::Google::Cloud::Vision::V1p4beta1::GetReferenceImageRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_reference_image({ 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_reference_image(::Google::Cloud::Vision::V1p4beta1::GetReferenceImageRequest.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_reference_image_client_stub.call_rpc_count + end + end + + def test_add_product_to_product_set + # 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" + product = "hello world" + + add_product_to_product_set_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :add_product_to_product_set, name + assert_kind_of ::Google::Cloud::Vision::V1p4beta1::AddProductToProductSetRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["product"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, add_product_to_product_set_client_stub do + # Create client + client = ::Google::Cloud::Vision::V1p4beta1::ProductSearch::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.add_product_to_product_set({ name: name, product: product }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.add_product_to_product_set name: name, product: product do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.add_product_to_product_set ::Google::Cloud::Vision::V1p4beta1::AddProductToProductSetRequest.new(name: name, product: product) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.add_product_to_product_set({ name: name, product: product }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.add_product_to_product_set(::Google::Cloud::Vision::V1p4beta1::AddProductToProductSetRequest.new(name: name, product: product), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, add_product_to_product_set_client_stub.call_rpc_count + end + end + + def test_remove_product_from_product_set + # 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" + product = "hello world" + + remove_product_from_product_set_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :remove_product_from_product_set, name + assert_kind_of ::Google::Cloud::Vision::V1p4beta1::RemoveProductFromProductSetRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["product"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, remove_product_from_product_set_client_stub do + # Create client + client = ::Google::Cloud::Vision::V1p4beta1::ProductSearch::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.remove_product_from_product_set({ name: name, product: product }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.remove_product_from_product_set name: name, product: product do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.remove_product_from_product_set ::Google::Cloud::Vision::V1p4beta1::RemoveProductFromProductSetRequest.new(name: name, product: product) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.remove_product_from_product_set({ name: name, product: product }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.remove_product_from_product_set(::Google::Cloud::Vision::V1p4beta1::RemoveProductFromProductSetRequest.new(name: name, product: product), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, remove_product_from_product_set_client_stub.call_rpc_count + end + end + + def test_list_products_in_product_set + # Create GRPC objects. + grpc_response = ::Google::Cloud::Vision::V1p4beta1::ListProductsInProductSetResponse.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" + page_size = 42 + page_token = "hello world" + + list_products_in_product_set_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_products_in_product_set, name + assert_kind_of ::Google::Cloud::Vision::V1p4beta1::ListProductsInProductSetRequest, request + assert_equal "hello world", request["name"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_products_in_product_set_client_stub do + # Create client + client = ::Google::Cloud::Vision::V1p4beta1::ProductSearch::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_products_in_product_set({ name: name, 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_products_in_product_set name: name, 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_products_in_product_set ::Google::Cloud::Vision::V1p4beta1::ListProductsInProductSetRequest.new(name: name, 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_products_in_product_set({ name: name, 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_products_in_product_set(::Google::Cloud::Vision::V1p4beta1::ListProductsInProductSetRequest.new(name: name, 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_products_in_product_set_client_stub.call_rpc_count + end + end + + def test_import_product_sets + # 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" + input_config = {} + + import_product_sets_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :import_product_sets, name + assert_kind_of ::Google::Cloud::Vision::V1p4beta1::ImportProductSetsRequest, request + assert_equal "hello world", request["parent"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Vision::V1p4beta1::ImportProductSetsInputConfig), request["input_config"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, import_product_sets_client_stub do + # Create client + client = ::Google::Cloud::Vision::V1p4beta1::ProductSearch::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.import_product_sets({ parent: parent, input_config: input_config }) 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.import_product_sets parent: parent, input_config: input_config 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.import_product_sets ::Google::Cloud::Vision::V1p4beta1::ImportProductSetsRequest.new(parent: parent, input_config: input_config) 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.import_product_sets({ parent: parent, input_config: input_config }, 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.import_product_sets(::Google::Cloud::Vision::V1p4beta1::ImportProductSetsRequest.new(parent: parent, input_config: input_config), 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, import_product_sets_client_stub.call_rpc_count + end + end + + def test_purge_products + # 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. + product_set_purge_config = {} + parent = "hello world" + force = true + + purge_products_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :purge_products, name + assert_kind_of ::Google::Cloud::Vision::V1p4beta1::PurgeProductsRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Vision::V1p4beta1::ProductSetPurgeConfig), request["product_set_purge_config"] + assert_equal :product_set_purge_config, request.target + assert_equal "hello world", request["parent"] + assert_equal true, request["force"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, purge_products_client_stub do + # Create client + client = ::Google::Cloud::Vision::V1p4beta1::ProductSearch::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.purge_products({ product_set_purge_config: product_set_purge_config, parent: parent, force: force }) 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.purge_products product_set_purge_config: product_set_purge_config, parent: parent, force: force 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.purge_products ::Google::Cloud::Vision::V1p4beta1::PurgeProductsRequest.new(product_set_purge_config: product_set_purge_config, parent: parent, force: force) 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.purge_products({ product_set_purge_config: product_set_purge_config, parent: parent, force: force }, 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.purge_products(::Google::Cloud::Vision::V1p4beta1::PurgeProductsRequest.new(product_set_purge_config: product_set_purge_config, parent: parent, force: force), 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, purge_products_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::Vision::V1p4beta1::ProductSearch::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::Vision::V1p4beta1::ProductSearch::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::Vision::V1p4beta1::ProductSearch::Client.new do |config| + config.credentials = creds + end + assert_kind_of ::Google::Cloud::Vision::V1p4beta1::ProductSearch::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::Vision::V1p4beta1::ProductSearch::Client.new do |config| + config.credentials = grpc_channel + end + end + + assert_kind_of ::Google::Cloud::Vision::V1p4beta1::ProductSearch::Operations, client.operations_client + end +end diff --git a/owl-bot-staging/google-cloud-vision-v1p4beta1/test/helper.rb b/owl-bot-staging/google-cloud-vision-v1p4beta1/test/helper.rb new file mode 100644 index 000000000000..672b337030e7 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision-v1p4beta1/test/helper.rb @@ -0,0 +1,26 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/mock" +require "minitest/rg" + +require "grpc" + +require "ostruct" diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/.gitignore b/owl-bot-staging/google-cloud-vision_ai-v1/.gitignore new file mode 100644 index 000000000000..0135b6bc6cfc --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-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-vision_ai-v1/.repo-metadata.json b/owl-bot-staging/google-cloud-vision_ai-v1/.repo-metadata.json new file mode 100644 index 000000000000..05ac4458ba7a --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/.repo-metadata.json @@ -0,0 +1,17 @@ +{ + "api_id": "visionai.googleapis.com", + "api_shortname": "visionai", + "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-vision_ai-v1/latest", + "distribution_name": "google-cloud-vision_ai-v1", + "is_cloud": true, + "language": "ruby", + "name": "visionai", + "name_pretty": "Vision AI V1 API", + "product_documentation": "https://cloud.google.com/vision-ai/docs", + "release_level": "unreleased", + "repo": "googleapis/google-cloud-ruby", + "requires_billing": true, + "ruby-cloud-description": "google-cloud-vision_ai-v1 is the official client library for the Vision AI V1 API. Note that google-cloud-vision_ai-v1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-vision_ai instead. See the readme for more details.", + "ruby-cloud-product-url": "https://cloud.google.com/vision-ai/docs", + "library_type": "GAPIC_AUTO" +} diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/.rubocop.yml b/owl-bot-staging/google-cloud-vision_ai-v1/.rubocop.yml new file mode 100644 index 000000000000..16e71bee558f --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/.rubocop.yml @@ -0,0 +1,33 @@ +inherit_gem: + google-style: google-style.yml + +AllCops: + Exclude: + - "google-cloud-vision_ai-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-vision_ai-v1.rb" diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/.toys.rb b/owl-bot-staging/google-cloud-vision_ai-v1/.toys.rb new file mode 100644 index 000000000000..177e22456e8a --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-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-vision_ai-v1/.yardopts b/owl-bot-staging/google-cloud-vision_ai-v1/.yardopts new file mode 100644 index 000000000000..a32152e31aaf --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/.yardopts @@ -0,0 +1,12 @@ +--no-private +--title="Vision AI 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-vision_ai-v1/AUTHENTICATION.md b/owl-bot-staging/google-cloud-vision_ai-v1/AUTHENTICATION.md new file mode 100644 index 000000000000..f7419a708f89 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/AUTHENTICATION.md @@ -0,0 +1,122 @@ +# Authentication + +The recommended way to authenticate to the google-cloud-vision_ai-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-vision_ai-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/vision_ai/v1" + +client = ::Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client.new do |config| + config.credentials = "path/to/credentialfile.json" +end +``` + +To configure a credentials file globally for all clients: + +```ruby +require "google/cloud/vision_ai/v1" + +::Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client.configure do |config| + config.credentials = "path/to/credentialfile.json" +end + +client = ::Google::Cloud::VisionAI::V1::LiveVideoAnalytics::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-vision_ai-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/vision_ai/v1" + +ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" + +client = ::Google::Cloud::VisionAI::V1::LiveVideoAnalytics::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-vision_ai-v1/CHANGELOG.md b/owl-bot-staging/google-cloud-vision_ai-v1/CHANGELOG.md new file mode 100644 index 000000000000..f88957a62ba2 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/CHANGELOG.md @@ -0,0 +1,2 @@ +# Release History + diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/Gemfile b/owl-bot-staging/google-cloud-vision_ai-v1/Gemfile new file mode 100644 index 000000000000..1d08558908d8 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/Gemfile @@ -0,0 +1,14 @@ +source "https://rubygems.org" + +gemspec + +gem "google-style", "~> 1.32.0" +gem "irb", "~> 1.17" +gem "minitest", "~> 6.0.2" +gem "minitest-focus", "~> 1.4" +gem "minitest-mock", "~> 5.27" +gem "minitest-rg", "~> 5.3" +gem "ostruct", "~> 0.5.5" +gem "rake", ">= 13.0" +gem "redcarpet", "~> 3.6" +gem "yard", "~> 0.9" diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/LICENSE.md b/owl-bot-staging/google-cloud-vision_ai-v1/LICENSE.md new file mode 100644 index 000000000000..c261857ba6ad --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-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-vision_ai-v1/README.md b/owl-bot-staging/google-cloud-vision_ai-v1/README.md new file mode 100644 index 000000000000..1dd8953d2ecb --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/README.md @@ -0,0 +1,154 @@ +# Ruby Client for the Vision AI V1 API + +API Client library for the Vision AI V1 API + +google-cloud-vision_ai-v1 is the official client library for the Vision AI V1 API. + +https://github.com/googleapis/google-cloud-ruby + +This gem is a _versioned_ client. It provides basic client classes for a +specific version of the Vision AI V1 API. Most users should consider using +the main client gem, +[google-cloud-vision_ai](https://rubygems.org/gems/google-cloud-vision_ai). +See the section below titled *Which client should I use?* for more information. + +## Installation + +``` +$ gem install google-cloud-vision_ai-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/visionai.googleapis.com) +1. [Set up authentication.](AUTHENTICATION.md) + +## Quick Start + +```ruby +require "google/cloud/vision_ai/v1" + +client = ::Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client.new +request = ::Google::Cloud::VisionAI::V1::ListPublicOperatorsRequest.new # (request fields as keyword arguments...) +response = client.list_public_operators request +``` + +View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-vision_ai-v1/latest) +for class and method documentation. + +See also the [Product Documentation](https://cloud.google.com/vision-ai/docs) +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/vision_ai/v1" +require "logger" + +client = ::Google::Cloud::VisionAI::V1::LiveVideoAnalytics::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-vision_ai`, +and lower-level _versioned_ client libraries with names such as +`google-cloud-vision_ai-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-vision_ai`. +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-vision_ai-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-vision_ai-v1/Rakefile b/owl-bot-staging/google-cloud-vision_ai-v1/Rakefile new file mode 100644 index 000000000000..604a1a8e81f8 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-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-vision_ai-v1 acceptance tests." +task :acceptance, :project, :keyfile do |t, args| + project = args[:project] + project ||= + ENV["GOOGLE_CLOUD_TEST_PROJECT"] || + ENV["GCLOUD_TEST_PROJECT"] + keyfile = args[:keyfile] + keyfile ||= + ENV["GOOGLE_CLOUD_TEST_KEYFILE"] || + ENV["GCLOUD_TEST_KEYFILE"] + if keyfile + keyfile = File.read keyfile + else + keyfile ||= + ENV["GOOGLE_CLOUD_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 GOOGLE_CLOUD_TEST_PROJECT=test123 GOOGLE_CLOUD_TEST_KEYFILE=/path/to/keyfile.json rake acceptance" + end + require "google/cloud/vision_ai/v1/live_video_analytics/credentials" + ::Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Credentials.env_vars.each do |path| + ENV[path] = nil + end + ENV["GOOGLE_CLOUD_PROJECT"] = project + ENV["GOOGLE_CLOUD_TEST_PROJECT"] = project + ENV["GOOGLE_CLOUD_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-vision_ai-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-vision_ai-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-vision_ai-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-vision_ai-v1 gem does not have doctest tests." +end + +desc "Run the CI build" +task :ci do + header "BUILDING google-cloud-vision_ai-v1" + header "google-cloud-vision_ai-v1 rubocop", "*" + Rake::Task[:rubocop].invoke + header "google-cloud-vision_ai-v1 yard", "*" + Rake::Task[:yard].invoke + header "google-cloud-vision_ai-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-vision_ai-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-vision_ai-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-vision_ai-v1/gapic_metadata.json b/owl-bot-staging/google-cloud-vision_ai-v1/gapic_metadata.json new file mode 100644 index 000000000000..76a1b675ccdf --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/gapic_metadata.json @@ -0,0 +1,748 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "ruby", + "protoPackage": "google.cloud.visionai.v1", + "libraryPackage": "::Google::Cloud::VisionAI::V1", + "services": { + "LiveVideoAnalytics": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client", + "rpcs": { + "ListPublicOperators": { + "methods": [ + "list_public_operators" + ] + }, + "ResolveOperatorInfo": { + "methods": [ + "resolve_operator_info" + ] + }, + "ListOperators": { + "methods": [ + "list_operators" + ] + }, + "GetOperator": { + "methods": [ + "get_operator" + ] + }, + "CreateOperator": { + "methods": [ + "create_operator" + ] + }, + "UpdateOperator": { + "methods": [ + "update_operator" + ] + }, + "DeleteOperator": { + "methods": [ + "delete_operator" + ] + }, + "ListAnalyses": { + "methods": [ + "list_analyses" + ] + }, + "GetAnalysis": { + "methods": [ + "get_analysis" + ] + }, + "CreateAnalysis": { + "methods": [ + "create_analysis" + ] + }, + "UpdateAnalysis": { + "methods": [ + "update_analysis" + ] + }, + "DeleteAnalysis": { + "methods": [ + "delete_analysis" + ] + }, + "ListProcesses": { + "methods": [ + "list_processes" + ] + }, + "GetProcess": { + "methods": [ + "get_process" + ] + }, + "CreateProcess": { + "methods": [ + "create_process" + ] + }, + "UpdateProcess": { + "methods": [ + "update_process" + ] + }, + "DeleteProcess": { + "methods": [ + "delete_process" + ] + }, + "BatchRunProcess": { + "methods": [ + "batch_run_process" + ] + } + } + } + } + }, + "AppPlatform": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::VisionAI::V1::AppPlatform::Client", + "rpcs": { + "ListApplications": { + "methods": [ + "list_applications" + ] + }, + "GetApplication": { + "methods": [ + "get_application" + ] + }, + "CreateApplication": { + "methods": [ + "create_application" + ] + }, + "UpdateApplication": { + "methods": [ + "update_application" + ] + }, + "DeleteApplication": { + "methods": [ + "delete_application" + ] + }, + "DeployApplication": { + "methods": [ + "deploy_application" + ] + }, + "UndeployApplication": { + "methods": [ + "undeploy_application" + ] + }, + "AddApplicationStreamInput": { + "methods": [ + "add_application_stream_input" + ] + }, + "RemoveApplicationStreamInput": { + "methods": [ + "remove_application_stream_input" + ] + }, + "UpdateApplicationStreamInput": { + "methods": [ + "update_application_stream_input" + ] + }, + "ListInstances": { + "methods": [ + "list_instances" + ] + }, + "GetInstance": { + "methods": [ + "get_instance" + ] + }, + "CreateApplicationInstances": { + "methods": [ + "create_application_instances" + ] + }, + "DeleteApplicationInstances": { + "methods": [ + "delete_application_instances" + ] + }, + "UpdateApplicationInstances": { + "methods": [ + "update_application_instances" + ] + }, + "ListDrafts": { + "methods": [ + "list_drafts" + ] + }, + "GetDraft": { + "methods": [ + "get_draft" + ] + }, + "CreateDraft": { + "methods": [ + "create_draft" + ] + }, + "UpdateDraft": { + "methods": [ + "update_draft" + ] + }, + "DeleteDraft": { + "methods": [ + "delete_draft" + ] + }, + "ListProcessors": { + "methods": [ + "list_processors" + ] + }, + "ListPrebuiltProcessors": { + "methods": [ + "list_prebuilt_processors" + ] + }, + "GetProcessor": { + "methods": [ + "get_processor" + ] + }, + "CreateProcessor": { + "methods": [ + "create_processor" + ] + }, + "UpdateProcessor": { + "methods": [ + "update_processor" + ] + }, + "DeleteProcessor": { + "methods": [ + "delete_processor" + ] + } + } + } + } + }, + "StreamingService": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::VisionAI::V1::StreamingService::Client", + "rpcs": { + "SendPackets": { + "methods": [ + "send_packets" + ] + }, + "ReceivePackets": { + "methods": [ + "receive_packets" + ] + }, + "ReceiveEvents": { + "methods": [ + "receive_events" + ] + }, + "AcquireLease": { + "methods": [ + "acquire_lease" + ] + }, + "RenewLease": { + "methods": [ + "renew_lease" + ] + }, + "ReleaseLease": { + "methods": [ + "release_lease" + ] + } + } + } + } + }, + "StreamsService": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::VisionAI::V1::StreamsService::Client", + "rpcs": { + "ListClusters": { + "methods": [ + "list_clusters" + ] + }, + "GetCluster": { + "methods": [ + "get_cluster" + ] + }, + "CreateCluster": { + "methods": [ + "create_cluster" + ] + }, + "UpdateCluster": { + "methods": [ + "update_cluster" + ] + }, + "DeleteCluster": { + "methods": [ + "delete_cluster" + ] + }, + "ListStreams": { + "methods": [ + "list_streams" + ] + }, + "GetStream": { + "methods": [ + "get_stream" + ] + }, + "CreateStream": { + "methods": [ + "create_stream" + ] + }, + "UpdateStream": { + "methods": [ + "update_stream" + ] + }, + "DeleteStream": { + "methods": [ + "delete_stream" + ] + }, + "GetStreamThumbnail": { + "methods": [ + "get_stream_thumbnail" + ] + }, + "GenerateStreamHlsToken": { + "methods": [ + "generate_stream_hls_token" + ] + }, + "ListEvents": { + "methods": [ + "list_events" + ] + }, + "GetEvent": { + "methods": [ + "get_event" + ] + }, + "CreateEvent": { + "methods": [ + "create_event" + ] + }, + "UpdateEvent": { + "methods": [ + "update_event" + ] + }, + "DeleteEvent": { + "methods": [ + "delete_event" + ] + }, + "ListSeries": { + "methods": [ + "list_series" + ] + }, + "GetSeries": { + "methods": [ + "get_series" + ] + }, + "CreateSeries": { + "methods": [ + "create_series" + ] + }, + "UpdateSeries": { + "methods": [ + "update_series" + ] + }, + "DeleteSeries": { + "methods": [ + "delete_series" + ] + }, + "MaterializeChannel": { + "methods": [ + "materialize_channel" + ] + } + } + } + } + }, + "Warehouse": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::VisionAI::V1::Warehouse::Client", + "rpcs": { + "CreateAsset": { + "methods": [ + "create_asset" + ] + }, + "UpdateAsset": { + "methods": [ + "update_asset" + ] + }, + "GetAsset": { + "methods": [ + "get_asset" + ] + }, + "ListAssets": { + "methods": [ + "list_assets" + ] + }, + "DeleteAsset": { + "methods": [ + "delete_asset" + ] + }, + "UploadAsset": { + "methods": [ + "upload_asset" + ] + }, + "GenerateRetrievalUrl": { + "methods": [ + "generate_retrieval_url" + ] + }, + "AnalyzeAsset": { + "methods": [ + "analyze_asset" + ] + }, + "IndexAsset": { + "methods": [ + "index_asset" + ] + }, + "RemoveIndexAsset": { + "methods": [ + "remove_index_asset" + ] + }, + "ViewIndexedAssets": { + "methods": [ + "view_indexed_assets" + ] + }, + "CreateIndex": { + "methods": [ + "create_index" + ] + }, + "UpdateIndex": { + "methods": [ + "update_index" + ] + }, + "GetIndex": { + "methods": [ + "get_index" + ] + }, + "ListIndexes": { + "methods": [ + "list_indexes" + ] + }, + "DeleteIndex": { + "methods": [ + "delete_index" + ] + }, + "CreateCorpus": { + "methods": [ + "create_corpus" + ] + }, + "GetCorpus": { + "methods": [ + "get_corpus" + ] + }, + "UpdateCorpus": { + "methods": [ + "update_corpus" + ] + }, + "ListCorpora": { + "methods": [ + "list_corpora" + ] + }, + "DeleteCorpus": { + "methods": [ + "delete_corpus" + ] + }, + "AnalyzeCorpus": { + "methods": [ + "analyze_corpus" + ] + }, + "CreateDataSchema": { + "methods": [ + "create_data_schema" + ] + }, + "UpdateDataSchema": { + "methods": [ + "update_data_schema" + ] + }, + "GetDataSchema": { + "methods": [ + "get_data_schema" + ] + }, + "DeleteDataSchema": { + "methods": [ + "delete_data_schema" + ] + }, + "ListDataSchemas": { + "methods": [ + "list_data_schemas" + ] + }, + "CreateAnnotation": { + "methods": [ + "create_annotation" + ] + }, + "GetAnnotation": { + "methods": [ + "get_annotation" + ] + }, + "ListAnnotations": { + "methods": [ + "list_annotations" + ] + }, + "UpdateAnnotation": { + "methods": [ + "update_annotation" + ] + }, + "DeleteAnnotation": { + "methods": [ + "delete_annotation" + ] + }, + "IngestAsset": { + "methods": [ + "ingest_asset" + ] + }, + "ClipAsset": { + "methods": [ + "clip_asset" + ] + }, + "GenerateHlsUri": { + "methods": [ + "generate_hls_uri" + ] + }, + "ImportAssets": { + "methods": [ + "import_assets" + ] + }, + "CreateSearchConfig": { + "methods": [ + "create_search_config" + ] + }, + "UpdateSearchConfig": { + "methods": [ + "update_search_config" + ] + }, + "GetSearchConfig": { + "methods": [ + "get_search_config" + ] + }, + "DeleteSearchConfig": { + "methods": [ + "delete_search_config" + ] + }, + "ListSearchConfigs": { + "methods": [ + "list_search_configs" + ] + }, + "CreateSearchHypernym": { + "methods": [ + "create_search_hypernym" + ] + }, + "UpdateSearchHypernym": { + "methods": [ + "update_search_hypernym" + ] + }, + "GetSearchHypernym": { + "methods": [ + "get_search_hypernym" + ] + }, + "DeleteSearchHypernym": { + "methods": [ + "delete_search_hypernym" + ] + }, + "ListSearchHypernyms": { + "methods": [ + "list_search_hypernyms" + ] + }, + "SearchAssets": { + "methods": [ + "search_assets" + ] + }, + "SearchIndexEndpoint": { + "methods": [ + "search_index_endpoint" + ] + }, + "CreateIndexEndpoint": { + "methods": [ + "create_index_endpoint" + ] + }, + "GetIndexEndpoint": { + "methods": [ + "get_index_endpoint" + ] + }, + "ListIndexEndpoints": { + "methods": [ + "list_index_endpoints" + ] + }, + "UpdateIndexEndpoint": { + "methods": [ + "update_index_endpoint" + ] + }, + "DeleteIndexEndpoint": { + "methods": [ + "delete_index_endpoint" + ] + }, + "DeployIndex": { + "methods": [ + "deploy_index" + ] + }, + "UndeployIndex": { + "methods": [ + "undeploy_index" + ] + }, + "CreateCollection": { + "methods": [ + "create_collection" + ] + }, + "DeleteCollection": { + "methods": [ + "delete_collection" + ] + }, + "GetCollection": { + "methods": [ + "get_collection" + ] + }, + "UpdateCollection": { + "methods": [ + "update_collection" + ] + }, + "ListCollections": { + "methods": [ + "list_collections" + ] + }, + "AddCollectionItem": { + "methods": [ + "add_collection_item" + ] + }, + "RemoveCollectionItem": { + "methods": [ + "remove_collection_item" + ] + }, + "ViewCollectionItems": { + "methods": [ + "view_collection_items" + ] + } + } + } + } + }, + "HealthCheckService": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::VisionAI::V1::HealthCheckService::Client", + "rpcs": { + "HealthCheck": { + "methods": [ + "health_check" + ] + } + } + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/google-cloud-vision_ai-v1.gemspec b/owl-bot-staging/google-cloud-vision_ai-v1/google-cloud-vision_ai-v1.gemspec new file mode 100644 index 000000000000..5957dadd3da9 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/google-cloud-vision_ai-v1.gemspec @@ -0,0 +1,30 @@ +# -*- ruby -*- +# encoding: utf-8 + +require File.expand_path("lib/google/cloud/vision_ai/v1/version", __dir__) + +Gem::Specification.new do |gem| + gem.name = "google-cloud-vision_ai-v1" + gem.version = Google::Cloud::VisionAI::V1::VERSION + + gem.authors = ["Google LLC"] + gem.email = "googleapis-packages@google.com" + gem.description = "google-cloud-vision_ai-v1 is the official client library for the Vision AI V1 API. Note that google-cloud-vision_ai-v1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-vision_ai instead. See the readme for more details." + gem.summary = "API Client library for the Vision AI V1 API" + 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.2" + + 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-vision_ai-v1/lib/google-cloud-vision_ai-v1.rb b/owl-bot-staging/google-cloud-vision_ai-v1/lib/google-cloud-vision_ai-v1.rb new file mode 100644 index 000000000000..75eb1d114bb3 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/lib/google-cloud-vision_ai-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/vision_ai/v1" diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1.rb b/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1.rb new file mode 100644 index 000000000000..a4cc7739037e --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1.rb @@ -0,0 +1,50 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/vision_ai/v1/live_video_analytics" +require "google/cloud/vision_ai/v1/app_platform" +require "google/cloud/vision_ai/v1/streaming_service" +require "google/cloud/vision_ai/v1/streams_service" +require "google/cloud/vision_ai/v1/warehouse" +require "google/cloud/vision_ai/v1/health_check_service" +require "google/cloud/vision_ai/v1/version" + +module Google + module Cloud + module VisionAI + ## + # API client module. + # + # @example Load this package, including all its services, and instantiate a gRPC client + # + # require "google/cloud/vision_ai/v1" + # client = ::Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client.new + # + # @example Load this package, including all its services, and instantiate a REST client + # + # require "google/cloud/vision_ai/v1" + # client = ::Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Rest::Client.new + # + module V1 + end + end + end +end + +helper_path = ::File.join __dir__, "v1", "_helpers.rb" +require "google/cloud/vision_ai/v1/_helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/app_platform.rb b/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/app_platform.rb new file mode 100644 index 000000000000..f8c7a42a31d5 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/app_platform.rb @@ -0,0 +1,56 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/vision_ai/v1/version" + +require "google/cloud/vision_ai/v1/app_platform/credentials" +require "google/cloud/vision_ai/v1/app_platform/paths" +require "google/cloud/vision_ai/v1/app_platform/operations" +require "google/cloud/vision_ai/v1/app_platform/client" +require "google/cloud/vision_ai/v1/app_platform/rest" + +module Google + module Cloud + module VisionAI + module V1 + ## + # Service describing handlers for resources + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/vision_ai/v1/app_platform" + # client = ::Google::Cloud::VisionAI::V1::AppPlatform::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/vision_ai/v1/app_platform/rest" + # client = ::Google::Cloud::VisionAI::V1::AppPlatform::Rest::Client.new + # + module AppPlatform + end + end + end + end +end + +helper_path = ::File.join __dir__, "app_platform", "helpers.rb" +require "google/cloud/vision_ai/v1/app_platform/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/app_platform/client.rb b/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/app_platform/client.rb new file mode 100644 index 000000000000..27dcef0fbd95 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/app_platform/client.rb @@ -0,0 +1,3365 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/visionai/v1/platform_pb" +require "google/cloud/location" +require "google/iam/v1" + +module Google + module Cloud + module VisionAI + module V1 + module AppPlatform + ## + # Client for the AppPlatform service. + # + # Service describing handlers for resources + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "visionai.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :app_platform_stub + + ## + # Configure the AppPlatform Client class. + # + # See {::Google::Cloud::VisionAI::V1::AppPlatform::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all AppPlatform clients + # ::Google::Cloud::VisionAI::V1::AppPlatform::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", "VisionAI", "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 + end + yield @configure if block_given? + @configure + end + + ## + # Configure the AppPlatform 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::VisionAI::V1::AppPlatform::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 + @app_platform_stub.universe_domain + end + + ## + # Create a new AppPlatform client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::VisionAI::V1::AppPlatform::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::VisionAI::V1::AppPlatform::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the AppPlatform 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/visionai/v1/platform_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 + + @app_platform_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::VisionAI::V1::AppPlatform::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 + ) + + @app_platform_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 = @app_platform_stub.endpoint + config.universe_domain = @app_platform_stub.universe_domain + config.logger = @app_platform_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 = @app_platform_stub.endpoint + config.universe_domain = @app_platform_stub.universe_domain + config.logger = @app_platform_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::VisionAI::V1::AppPlatform::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 + @app_platform_stub.logger + end + + # Service calls + + ## + # Lists Applications in a given project and location. + # + # @overload list_applications(request, options = nil) + # Pass arguments to `list_applications` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::ListApplicationsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::ListApplicationsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_applications(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) + # Pass arguments to `list_applications` via keyword arguments. Note that at + # least one keyword argument is 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. Parent value for ListApplicationsRequest. + # @param page_size [::Integer] + # Requested page size. Server may return fewer items than requested. + # If unspecified, server will pick an appropriate default. + # @param page_token [::String] + # A token identifying a page of results the server should return. + # @param filter [::String] + # Filtering results. + # @param order_by [::String] + # Hint for how to order the results. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::VisionAI::V1::Application>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::VisionAI::V1::Application>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::AppPlatform::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::ListApplicationsRequest.new + # + # # Call the list_applications method. + # result = client.list_applications 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::VisionAI::V1::Application. + # p item + # end + # + def list_applications request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::ListApplicationsRequest + + # Converts hash 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_applications.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::VisionAI::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_applications.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_applications.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @app_platform_stub.call_rpc :list_applications, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @app_platform_stub, :list_applications, 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 + + ## + # Gets details of a single Application. + # + # @overload get_application(request, options = nil) + # Pass arguments to `get_application` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::GetApplicationRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::GetApplicationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_application(name: nil) + # Pass arguments to `get_application` via keyword arguments. Note that at + # least one keyword argument is 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 resource. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::VisionAI::V1::Application] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::VisionAI::V1::Application] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::AppPlatform::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::GetApplicationRequest.new + # + # # Call the get_application method. + # result = client.get_application request + # + # # The returned object is of type Google::Cloud::VisionAI::V1::Application. + # p result + # + def get_application request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::GetApplicationRequest + + # Converts hash 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_application.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::VisionAI::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_application.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_application.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @app_platform_stub.call_rpc :get_application, 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 Application in a given project and location. + # + # @overload create_application(request, options = nil) + # Pass arguments to `create_application` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::CreateApplicationRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::CreateApplicationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_application(parent: nil, application_id: nil, application: nil, request_id: nil) + # Pass arguments to `create_application` via keyword arguments. Note that at + # least one keyword argument is 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. Value for parent. + # @param application_id [::String] + # Required. Id of the requesting object. + # @param application [::Google::Cloud::VisionAI::V1::Application, ::Hash] + # Required. The resource being created. + # @param request_id [::String] + # Optional. An optional request ID to identify requests. Specify a unique + # request ID so that if you must retry your request, the server will know to + # ignore the request if it has already been completed. The server will + # guarantee that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # + # @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/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::AppPlatform::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::CreateApplicationRequest.new + # + # # Call the create_application method. + # result = client.create_application 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_application request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::CreateApplicationRequest + + # Converts hash 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_application.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::VisionAI::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_application.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_application.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @app_platform_stub.call_rpc :create_application, 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 + + ## + # Updates the parameters of a single Application. + # + # @overload update_application(request, options = nil) + # Pass arguments to `update_application` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::UpdateApplicationRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::UpdateApplicationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_application(update_mask: nil, application: nil, request_id: nil) + # Pass arguments to `update_application` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Optional. Field mask is used to specify the fields to be overwritten in the + # Application resource by the update. + # The fields specified in the update_mask are relative to the resource, not + # the full request. A field will be overwritten if it is in the mask. If the + # user does not provide a mask then all fields will be overwritten. + # @param application [::Google::Cloud::VisionAI::V1::Application, ::Hash] + # Required. The resource being updated. + # @param request_id [::String] + # Optional. An optional request ID to identify requests. Specify a unique + # request ID so that if you must retry your request, the server will know to + # ignore the request if it has already been completed. The server will + # guarantee that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # + # @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/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::AppPlatform::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::UpdateApplicationRequest.new + # + # # Call the update_application method. + # result = client.update_application 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 update_application request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::UpdateApplicationRequest + + # Converts hash 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_application.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::VisionAI::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.application&.name + header_params["application.name"] = request.application.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_application.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_application.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @app_platform_stub.call_rpc :update_application, 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 single Application. + # + # @overload delete_application(request, options = nil) + # Pass arguments to `delete_application` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::DeleteApplicationRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::DeleteApplicationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_application(name: nil, request_id: nil, force: nil) + # Pass arguments to `delete_application` via keyword arguments. Note that at + # least one keyword argument is 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 resource. + # @param request_id [::String] + # Optional. An optional request ID to identify requests. Specify a unique + # request ID so that if you must retry your request, the server will know to + # ignore the request if it has already been completed. The server will + # guarantee that for at least 60 minutes after the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @param force [::Boolean] + # Optional. If set to true, any instances and drafts from this application + # will also be deleted. (Otherwise, the request will only work if the + # application has no instances and drafts.) + # + # @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/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::AppPlatform::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::DeleteApplicationRequest.new + # + # # Call the delete_application method. + # result = client.delete_application 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_application request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::DeleteApplicationRequest + + # Converts hash 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_application.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::VisionAI::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_application.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_application.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @app_platform_stub.call_rpc :delete_application, 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 + + ## + # Deploys a single Application. + # + # @overload deploy_application(request, options = nil) + # Pass arguments to `deploy_application` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::DeployApplicationRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::DeployApplicationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload deploy_application(name: nil, validate_only: nil, request_id: nil, enable_monitoring: nil) + # Pass arguments to `deploy_application` via keyword arguments. Note that at + # least one keyword argument is 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 name of the application to retrieve. + # Format: + # "projects/\\{project}/locations/\\{location}/applications/\\{application}" + # @param validate_only [::Boolean] + # If set, validate the request and preview the application graph, but do not + # actually deploy it. + # @param request_id [::String] + # Optional. An optional request ID to identify requests. Specify a unique + # request ID so that if you must retry your request, the server will know to + # ignore the request if it has already been completed. The server will + # guarantee that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @param enable_monitoring [::Boolean] + # Optional. Whether or not to enable monitoring for the application on + # deployment. + # + # @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/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::AppPlatform::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::DeployApplicationRequest.new + # + # # Call the deploy_application method. + # result = client.deploy_application 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 deploy_application request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::DeployApplicationRequest + + # Converts hash 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.deploy_application.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::VisionAI::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.deploy_application.timeout, + metadata: metadata, + retry_policy: @config.rpcs.deploy_application.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @app_platform_stub.call_rpc :deploy_application, 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 + + ## + # Undeploys a single Application. + # + # @overload undeploy_application(request, options = nil) + # Pass arguments to `undeploy_application` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::UndeployApplicationRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::UndeployApplicationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload undeploy_application(name: nil, request_id: nil) + # Pass arguments to `undeploy_application` via keyword arguments. Note that at + # least one keyword argument is 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 name of the application to retrieve. + # Format: + # "projects/\\{project}/locations/\\{location}/applications/\\{application}" + # @param request_id [::String] + # Optional. An optional request ID to identify requests. Specify a unique + # request ID so that if you must retry your request, the server will know to + # ignore the request if it has already been completed. The server will + # guarantee that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # + # @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/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::AppPlatform::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::UndeployApplicationRequest.new + # + # # Call the undeploy_application method. + # result = client.undeploy_application 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 undeploy_application request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::UndeployApplicationRequest + + # Converts hash 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.undeploy_application.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::VisionAI::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.undeploy_application.timeout, + metadata: metadata, + retry_policy: @config.rpcs.undeploy_application.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @app_platform_stub.call_rpc :undeploy_application, 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 + + ## + # Adds target stream input to the Application. + # If the Application is deployed, the corresponding new Application instance + # will be created. If the stream has already been in the Application, the RPC + # will fail. + # + # @overload add_application_stream_input(request, options = nil) + # Pass arguments to `add_application_stream_input` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::AddApplicationStreamInputRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::AddApplicationStreamInputRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload add_application_stream_input(name: nil, application_stream_inputs: nil, request_id: nil) + # Pass arguments to `add_application_stream_input` via keyword arguments. Note that at + # least one keyword argument is 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 name of the application to retrieve. + # Format: + # "projects/\\{project}/locations/\\{location}/applications/\\{application}" + # @param application_stream_inputs [::Array<::Google::Cloud::VisionAI::V1::ApplicationStreamInput, ::Hash>] + # The stream inputs to add, the stream resource name is the key of each + # StreamInput, and it must be unique within each application. + # @param request_id [::String] + # Optional. An optional request ID to identify requests. Specify a unique + # request ID so that if you must retry your request, the server will know to + # ignore the request if it has already been completed. The server will + # guarantee that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # + # @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/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::AppPlatform::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::AddApplicationStreamInputRequest.new + # + # # Call the add_application_stream_input method. + # result = client.add_application_stream_input 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 add_application_stream_input request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::AddApplicationStreamInputRequest + + # Converts hash 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.add_application_stream_input.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::VisionAI::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.add_application_stream_input.timeout, + metadata: metadata, + retry_policy: @config.rpcs.add_application_stream_input.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @app_platform_stub.call_rpc :add_application_stream_input, 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 + + ## + # Remove target stream input to the Application, if the Application is + # deployed, the corresponding instance based will be deleted. If the stream + # is not in the Application, the RPC will fail. + # + # @overload remove_application_stream_input(request, options = nil) + # Pass arguments to `remove_application_stream_input` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::RemoveApplicationStreamInputRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::RemoveApplicationStreamInputRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload remove_application_stream_input(name: nil, target_stream_inputs: nil, request_id: nil) + # Pass arguments to `remove_application_stream_input` via keyword arguments. Note that at + # least one keyword argument is 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 name of the application to retrieve. + # Format: + # "projects/\\{project}/locations/\\{location}/applications/\\{application}" + # @param target_stream_inputs [::Array<::Google::Cloud::VisionAI::V1::RemoveApplicationStreamInputRequest::TargetStreamInput, ::Hash>] + # The target stream to remove. + # @param request_id [::String] + # Optional. An optional request ID to identify requests. Specify a unique + # request ID so that if you must retry your request, the server will know to + # ignore the request if it has already been completed. The server will + # guarantee that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # + # @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/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::AppPlatform::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::RemoveApplicationStreamInputRequest.new + # + # # Call the remove_application_stream_input method. + # result = client.remove_application_stream_input 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 remove_application_stream_input request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::RemoveApplicationStreamInputRequest + + # Converts hash 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.remove_application_stream_input.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::VisionAI::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.remove_application_stream_input.timeout, + metadata: metadata, + retry_policy: @config.rpcs.remove_application_stream_input.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @app_platform_stub.call_rpc :remove_application_stream_input, 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 + + ## + # Update target stream input to the Application, if the Application is + # deployed, the corresponding instance based will be deployed. For + # CreateOrUpdate behavior, set allow_missing to true. + # + # @overload update_application_stream_input(request, options = nil) + # Pass arguments to `update_application_stream_input` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::UpdateApplicationStreamInputRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::UpdateApplicationStreamInputRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_application_stream_input(name: nil, application_stream_inputs: nil, request_id: nil, allow_missing: nil) + # Pass arguments to `update_application_stream_input` via keyword arguments. Note that at + # least one keyword argument is 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 name of the application to retrieve. + # Format: + # "projects/\\{project}/locations/\\{location}/applications/\\{application}" + # @param application_stream_inputs [::Array<::Google::Cloud::VisionAI::V1::ApplicationStreamInput, ::Hash>] + # The stream inputs to update, the stream resource name is the key of each + # StreamInput, and it must be unique within each application. + # @param request_id [::String] + # Optional. An optional request ID to identify requests. Specify a unique + # request ID so that if you must retry your request, the server will know to + # ignore the request if it has already been completed. The server will + # guarantee that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @param allow_missing [::Boolean] + # If true, UpdateApplicationStreamInput will insert stream input to + # application even if the target stream is not included in the application. + # + # @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/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::AppPlatform::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::UpdateApplicationStreamInputRequest.new + # + # # Call the update_application_stream_input method. + # result = client.update_application_stream_input 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 update_application_stream_input request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::UpdateApplicationStreamInputRequest + + # Converts hash 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_application_stream_input.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::VisionAI::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_application_stream_input.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_application_stream_input.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @app_platform_stub.call_rpc :update_application_stream_input, 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 + + ## + # Lists Instances in a given project and location. + # + # @overload list_instances(request, options = nil) + # Pass arguments to `list_instances` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::ListInstancesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::ListInstancesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_instances(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) + # Pass arguments to `list_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. Parent value for ListInstancesRequest. + # @param page_size [::Integer] + # Requested page size. Server may return fewer items than requested. + # If unspecified, server will pick an appropriate default. + # @param page_token [::String] + # A token identifying a page of results the server should return. + # @param filter [::String] + # Filtering results. + # @param order_by [::String] + # Hint for how to order the results. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::VisionAI::V1::Instance>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::VisionAI::V1::Instance>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::AppPlatform::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::ListInstancesRequest.new + # + # # Call the list_instances method. + # result = client.list_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::VisionAI::V1::Instance. + # p item + # end + # + def list_instances request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::ListInstancesRequest + + # Converts hash 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_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::VisionAI::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_instances.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_instances.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @app_platform_stub.call_rpc :list_instances, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @app_platform_stub, :list_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 + + ## + # Gets details of a single Instance. + # + # @overload get_instance(request, options = nil) + # Pass arguments to `get_instance` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::GetInstanceRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::GetInstanceRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_instance(name: nil) + # Pass arguments to `get_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. Name of the resource. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::VisionAI::V1::Instance] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::VisionAI::V1::Instance] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::AppPlatform::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::GetInstanceRequest.new + # + # # Call the get_instance method. + # result = client.get_instance request + # + # # The returned object is of type Google::Cloud::VisionAI::V1::Instance. + # p result + # + def get_instance request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::GetInstanceRequest + + # Converts hash 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_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::VisionAI::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_instance.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_instance.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @app_platform_stub.call_rpc :get_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 + + ## + # Adds target stream input to the Application. + # If the Application is deployed, the corresponding new Application instance + # will be created. If the stream has already been in the Application, the RPC + # will fail. + # + # @overload create_application_instances(request, options = nil) + # Pass arguments to `create_application_instances` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::CreateApplicationInstancesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::CreateApplicationInstancesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_application_instances(name: nil, application_instances: nil, request_id: nil) + # Pass arguments to `create_application_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 name [::String] + # Required. the name of the application to retrieve. + # Format: + # "projects/\\{project}/locations/\\{location}/applications/\\{application}" + # @param application_instances [::Array<::Google::Cloud::VisionAI::V1::ApplicationInstance, ::Hash>] + # Required. The resources being created. + # @param request_id [::String] + # Optional. An optional request ID to identify requests. Specify a unique + # request ID so that if you must retry your request, the server will know to + # ignore the request if it has already been completed. The server will + # guarantee that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # + # @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/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::AppPlatform::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::CreateApplicationInstancesRequest.new + # + # # Call the create_application_instances method. + # result = client.create_application_instances 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_application_instances request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::CreateApplicationInstancesRequest + + # Converts hash 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_application_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::VisionAI::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.create_application_instances.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_application_instances.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @app_platform_stub.call_rpc :create_application_instances, 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 + + ## + # Remove target stream input to the Application, if the Application is + # deployed, the corresponding instance based will be deleted. If the stream + # is not in the Application, the RPC will fail. + # + # @overload delete_application_instances(request, options = nil) + # Pass arguments to `delete_application_instances` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::DeleteApplicationInstancesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::DeleteApplicationInstancesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_application_instances(name: nil, instance_ids: nil, request_id: nil) + # Pass arguments to `delete_application_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 name [::String] + # Required. the name of the application to retrieve. + # Format: + # "projects/\\{project}/locations/\\{location}/applications/\\{application}" + # @param instance_ids [::Array<::String>] + # Required. Id of the requesting object. + # @param request_id [::String] + # Optional. An optional request ID to identify requests. Specify a unique + # request ID so that if you must retry your request, the server will know to + # ignore the request if it has already been completed. The server will + # guarantee that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # + # @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/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::AppPlatform::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::DeleteApplicationInstancesRequest.new + # + # # Call the delete_application_instances method. + # result = client.delete_application_instances 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_application_instances request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::DeleteApplicationInstancesRequest + + # Converts hash 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_application_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::VisionAI::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_application_instances.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_application_instances.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @app_platform_stub.call_rpc :delete_application_instances, 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 + + ## + # Adds target stream input to the Application. + # If the Application is deployed, the corresponding new Application instance + # will be created. If the stream has already been in the Application, the RPC + # will fail. + # + # @overload update_application_instances(request, options = nil) + # Pass arguments to `update_application_instances` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::UpdateApplicationInstancesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::UpdateApplicationInstancesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_application_instances(name: nil, application_instances: nil, request_id: nil, allow_missing: nil) + # Pass arguments to `update_application_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 name [::String] + # Required. the name of the application to retrieve. + # Format: + # "projects/\\{project}/locations/\\{location}/applications/\\{application}" + # @param application_instances [::Array<::Google::Cloud::VisionAI::V1::UpdateApplicationInstancesRequest::UpdateApplicationInstance, ::Hash>] + # @param request_id [::String] + # Optional. An optional request ID to identify requests. Specify a unique + # request ID so that if you must retry your request, the server will know to + # ignore the request if it has already been completed. The server will + # guarantee that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @param allow_missing [::Boolean] + # If true, Update Request will create one resource if the target resource + # doesn't exist, this time, the field_mask will be ignored. + # + # @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/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::AppPlatform::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::UpdateApplicationInstancesRequest.new + # + # # Call the update_application_instances method. + # result = client.update_application_instances 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 update_application_instances request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::UpdateApplicationInstancesRequest + + # Converts hash 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_application_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::VisionAI::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_application_instances.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_application_instances.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @app_platform_stub.call_rpc :update_application_instances, 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 + + ## + # Lists Drafts in a given project and location. + # + # @overload list_drafts(request, options = nil) + # Pass arguments to `list_drafts` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::ListDraftsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::ListDraftsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_drafts(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) + # Pass arguments to `list_drafts` via keyword arguments. Note that at + # least one keyword argument is 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. Parent value for ListDraftsRequest. + # @param page_size [::Integer] + # Requested page size. Server may return fewer items than requested. + # If unspecified, server will pick an appropriate default. + # @param page_token [::String] + # A token identifying a page of results the server should return. + # @param filter [::String] + # Filtering results. + # @param order_by [::String] + # Hint for how to order the results. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::VisionAI::V1::Draft>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::VisionAI::V1::Draft>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::AppPlatform::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::ListDraftsRequest.new + # + # # Call the list_drafts method. + # result = client.list_drafts 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::VisionAI::V1::Draft. + # p item + # end + # + def list_drafts request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::ListDraftsRequest + + # Converts hash 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_drafts.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::VisionAI::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_drafts.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_drafts.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @app_platform_stub.call_rpc :list_drafts, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @app_platform_stub, :list_drafts, 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 + + ## + # Gets details of a single Draft. + # + # @overload get_draft(request, options = nil) + # Pass arguments to `get_draft` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::GetDraftRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::GetDraftRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_draft(name: nil) + # Pass arguments to `get_draft` via keyword arguments. Note that at + # least one keyword argument is 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 resource. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::VisionAI::V1::Draft] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::VisionAI::V1::Draft] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::AppPlatform::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::GetDraftRequest.new + # + # # Call the get_draft method. + # result = client.get_draft request + # + # # The returned object is of type Google::Cloud::VisionAI::V1::Draft. + # p result + # + def get_draft request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::GetDraftRequest + + # Converts hash 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_draft.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::VisionAI::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_draft.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_draft.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @app_platform_stub.call_rpc :get_draft, 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 Draft in a given project and location. + # + # @overload create_draft(request, options = nil) + # Pass arguments to `create_draft` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::CreateDraftRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::CreateDraftRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_draft(parent: nil, draft_id: nil, draft: nil, request_id: nil) + # Pass arguments to `create_draft` via keyword arguments. Note that at + # least one keyword argument is 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. Value for parent. + # @param draft_id [::String] + # Required. Id of the requesting object. + # @param draft [::Google::Cloud::VisionAI::V1::Draft, ::Hash] + # Required. The resource being created. + # @param request_id [::String] + # Optional. An optional request ID to identify requests. Specify a unique + # request ID so that if you must retry your request, the server will know to + # ignore the request if it has already been completed. The server will + # guarantee that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # + # @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/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::AppPlatform::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::CreateDraftRequest.new + # + # # Call the create_draft method. + # result = client.create_draft 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_draft request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::CreateDraftRequest + + # Converts hash 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_draft.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::VisionAI::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_draft.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_draft.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @app_platform_stub.call_rpc :create_draft, 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 + + ## + # Updates the parameters of a single Draft. + # + # @overload update_draft(request, options = nil) + # Pass arguments to `update_draft` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::UpdateDraftRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::UpdateDraftRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_draft(update_mask: nil, draft: nil, request_id: nil, allow_missing: nil) + # Pass arguments to `update_draft` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Optional. Field mask is used to specify the fields to be overwritten in the + # Draft resource by the update. + # The fields specified in the update_mask are relative to the resource, not + # the full request. A field will be overwritten if it is in the mask. If the + # user does not provide a mask then all fields will be overwritten. + # @param draft [::Google::Cloud::VisionAI::V1::Draft, ::Hash] + # Required. The resource being updated. + # @param request_id [::String] + # Optional. An optional request ID to identify requests. Specify a unique + # request ID so that if you must retry your request, the server will know to + # ignore the request if it has already been completed. The server will + # guarantee that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @param allow_missing [::Boolean] + # If true, UpdateDraftRequest will create one resource if the target resource + # doesn't exist, this time, the field_mask will be ignored. + # + # @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/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::AppPlatform::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::UpdateDraftRequest.new + # + # # Call the update_draft method. + # result = client.update_draft 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 update_draft request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::UpdateDraftRequest + + # Converts hash 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_draft.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::VisionAI::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.draft&.name + header_params["draft.name"] = request.draft.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_draft.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_draft.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @app_platform_stub.call_rpc :update_draft, 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 single Draft. + # + # @overload delete_draft(request, options = nil) + # Pass arguments to `delete_draft` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::DeleteDraftRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::DeleteDraftRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_draft(name: nil, request_id: nil) + # Pass arguments to `delete_draft` via keyword arguments. Note that at + # least one keyword argument is 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 resource. + # @param request_id [::String] + # Optional. An optional request ID to identify requests. Specify a unique + # request ID so that if you must retry your request, the server will know to + # ignore the request if it has already been completed. The server will + # guarantee that for at least 60 minutes after the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # + # @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/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::AppPlatform::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::DeleteDraftRequest.new + # + # # Call the delete_draft method. + # result = client.delete_draft 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_draft request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::DeleteDraftRequest + + # Converts hash 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_draft.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::VisionAI::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_draft.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_draft.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @app_platform_stub.call_rpc :delete_draft, 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 + + ## + # Lists Processors in a given project and location. + # + # @overload list_processors(request, options = nil) + # Pass arguments to `list_processors` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::ListProcessorsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::ListProcessorsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_processors(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) + # Pass arguments to `list_processors` via keyword arguments. Note that at + # least one keyword argument is 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. Parent value for ListProcessorsRequest. + # @param page_size [::Integer] + # Requested page size. Server may return fewer items than requested. + # If unspecified, server will pick an appropriate default. + # @param page_token [::String] + # A token identifying a page of results the server should return. + # @param filter [::String] + # Filtering results. + # @param order_by [::String] + # Hint for how to order the results. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::VisionAI::V1::Processor>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::VisionAI::V1::Processor>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::AppPlatform::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::ListProcessorsRequest.new + # + # # Call the list_processors method. + # result = client.list_processors 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::VisionAI::V1::Processor. + # p item + # end + # + def list_processors request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::ListProcessorsRequest + + # Converts hash 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_processors.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::VisionAI::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_processors.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_processors.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @app_platform_stub.call_rpc :list_processors, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @app_platform_stub, :list_processors, 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 + + ## + # ListPrebuiltProcessors is a custom pass-through verb that Lists Prebuilt + # Processors. + # + # @overload list_prebuilt_processors(request, options = nil) + # Pass arguments to `list_prebuilt_processors` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::ListPrebuiltProcessorsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::ListPrebuiltProcessorsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_prebuilt_processors(parent: nil) + # Pass arguments to `list_prebuilt_processors` via keyword arguments. Note that at + # least one keyword argument is 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. Parent path. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::VisionAI::V1::ListPrebuiltProcessorsResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::VisionAI::V1::ListPrebuiltProcessorsResponse] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::AppPlatform::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::ListPrebuiltProcessorsRequest.new + # + # # Call the list_prebuilt_processors method. + # result = client.list_prebuilt_processors request + # + # # The returned object is of type Google::Cloud::VisionAI::V1::ListPrebuiltProcessorsResponse. + # p result + # + def list_prebuilt_processors request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::ListPrebuiltProcessorsRequest + + # Converts hash 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_prebuilt_processors.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::VisionAI::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_prebuilt_processors.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_prebuilt_processors.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @app_platform_stub.call_rpc :list_prebuilt_processors, 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 + + ## + # Gets details of a single Processor. + # + # @overload get_processor(request, options = nil) + # Pass arguments to `get_processor` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::GetProcessorRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::GetProcessorRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_processor(name: nil) + # Pass arguments to `get_processor` via keyword arguments. Note that at + # least one keyword argument is 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 resource. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::VisionAI::V1::Processor] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::VisionAI::V1::Processor] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::AppPlatform::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::GetProcessorRequest.new + # + # # Call the get_processor method. + # result = client.get_processor request + # + # # The returned object is of type Google::Cloud::VisionAI::V1::Processor. + # p result + # + def get_processor request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::GetProcessorRequest + + # Converts hash 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_processor.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::VisionAI::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_processor.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_processor.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @app_platform_stub.call_rpc :get_processor, 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 Processor in a given project and location. + # + # @overload create_processor(request, options = nil) + # Pass arguments to `create_processor` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::CreateProcessorRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::CreateProcessorRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_processor(parent: nil, processor_id: nil, processor: nil, request_id: nil) + # Pass arguments to `create_processor` via keyword arguments. Note that at + # least one keyword argument is 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. Value for parent. + # @param processor_id [::String] + # Required. Id of the requesting object. + # @param processor [::Google::Cloud::VisionAI::V1::Processor, ::Hash] + # Required. The resource being created. + # @param request_id [::String] + # Optional. An optional request ID to identify requests. Specify a unique + # request ID so that if you must retry your request, the server will know to + # ignore the request if it has already been completed. The server will + # guarantee that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # + # @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/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::AppPlatform::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::CreateProcessorRequest.new + # + # # Call the create_processor method. + # result = client.create_processor 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_processor request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::CreateProcessorRequest + + # Converts hash 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_processor.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::VisionAI::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_processor.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_processor.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @app_platform_stub.call_rpc :create_processor, 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 + + ## + # Updates the parameters of a single Processor. + # + # @overload update_processor(request, options = nil) + # Pass arguments to `update_processor` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::UpdateProcessorRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::UpdateProcessorRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_processor(update_mask: nil, processor: nil, request_id: nil) + # Pass arguments to `update_processor` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Optional. Field mask is used to specify the fields to be overwritten in the + # Processor resource by the update. + # The fields specified in the update_mask are relative to the resource, not + # the full request. A field will be overwritten if it is in the mask. If the + # user does not provide a mask then all fields will be overwritten. + # @param processor [::Google::Cloud::VisionAI::V1::Processor, ::Hash] + # Required. The resource being updated. + # @param request_id [::String] + # Optional. An optional request ID to identify requests. Specify a unique + # request ID so that if you must retry your request, the server will know to + # ignore the request if it has already been completed. The server will + # guarantee that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # + # @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/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::AppPlatform::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::UpdateProcessorRequest.new + # + # # Call the update_processor method. + # result = client.update_processor 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 update_processor request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::UpdateProcessorRequest + + # Converts hash 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_processor.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::VisionAI::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.processor&.name + header_params["processor.name"] = request.processor.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_processor.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_processor.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @app_platform_stub.call_rpc :update_processor, 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 single Processor. + # + # @overload delete_processor(request, options = nil) + # Pass arguments to `delete_processor` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::DeleteProcessorRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::DeleteProcessorRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_processor(name: nil, request_id: nil) + # Pass arguments to `delete_processor` via keyword arguments. Note that at + # least one keyword argument is 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 resource + # @param request_id [::String] + # Optional. An optional request ID to identify requests. Specify a unique + # request ID so that if you must retry your request, the server will know to + # ignore the request if it has already been completed. The server will + # guarantee that for at least 60 minutes after the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # + # @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/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::AppPlatform::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::DeleteProcessorRequest.new + # + # # Call the delete_processor method. + # result = client.delete_processor 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_processor request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::DeleteProcessorRequest + + # Converts hash 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_processor.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::VisionAI::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_processor.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_processor.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @app_platform_stub.call_rpc :delete_processor, 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 AppPlatform API. + # + # This class represents the configuration for AppPlatform, + # 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::VisionAI::V1::AppPlatform::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_applications to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::VisionAI::V1::AppPlatform::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_applications.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::VisionAI::V1::AppPlatform::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_applications.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::VisionAI::V1::AppPlatform::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 = "visionai.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 AppPlatform 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_applications` + # @return [::Gapic::Config::Method] + # + attr_reader :list_applications + ## + # RPC-specific configuration for `get_application` + # @return [::Gapic::Config::Method] + # + attr_reader :get_application + ## + # RPC-specific configuration for `create_application` + # @return [::Gapic::Config::Method] + # + attr_reader :create_application + ## + # RPC-specific configuration for `update_application` + # @return [::Gapic::Config::Method] + # + attr_reader :update_application + ## + # RPC-specific configuration for `delete_application` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_application + ## + # RPC-specific configuration for `deploy_application` + # @return [::Gapic::Config::Method] + # + attr_reader :deploy_application + ## + # RPC-specific configuration for `undeploy_application` + # @return [::Gapic::Config::Method] + # + attr_reader :undeploy_application + ## + # RPC-specific configuration for `add_application_stream_input` + # @return [::Gapic::Config::Method] + # + attr_reader :add_application_stream_input + ## + # RPC-specific configuration for `remove_application_stream_input` + # @return [::Gapic::Config::Method] + # + attr_reader :remove_application_stream_input + ## + # RPC-specific configuration for `update_application_stream_input` + # @return [::Gapic::Config::Method] + # + attr_reader :update_application_stream_input + ## + # RPC-specific configuration for `list_instances` + # @return [::Gapic::Config::Method] + # + attr_reader :list_instances + ## + # RPC-specific configuration for `get_instance` + # @return [::Gapic::Config::Method] + # + attr_reader :get_instance + ## + # RPC-specific configuration for `create_application_instances` + # @return [::Gapic::Config::Method] + # + attr_reader :create_application_instances + ## + # RPC-specific configuration for `delete_application_instances` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_application_instances + ## + # RPC-specific configuration for `update_application_instances` + # @return [::Gapic::Config::Method] + # + attr_reader :update_application_instances + ## + # RPC-specific configuration for `list_drafts` + # @return [::Gapic::Config::Method] + # + attr_reader :list_drafts + ## + # RPC-specific configuration for `get_draft` + # @return [::Gapic::Config::Method] + # + attr_reader :get_draft + ## + # RPC-specific configuration for `create_draft` + # @return [::Gapic::Config::Method] + # + attr_reader :create_draft + ## + # RPC-specific configuration for `update_draft` + # @return [::Gapic::Config::Method] + # + attr_reader :update_draft + ## + # RPC-specific configuration for `delete_draft` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_draft + ## + # RPC-specific configuration for `list_processors` + # @return [::Gapic::Config::Method] + # + attr_reader :list_processors + ## + # RPC-specific configuration for `list_prebuilt_processors` + # @return [::Gapic::Config::Method] + # + attr_reader :list_prebuilt_processors + ## + # RPC-specific configuration for `get_processor` + # @return [::Gapic::Config::Method] + # + attr_reader :get_processor + ## + # RPC-specific configuration for `create_processor` + # @return [::Gapic::Config::Method] + # + attr_reader :create_processor + ## + # RPC-specific configuration for `update_processor` + # @return [::Gapic::Config::Method] + # + attr_reader :update_processor + ## + # RPC-specific configuration for `delete_processor` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_processor + + # @private + def initialize parent_rpcs = nil + list_applications_config = parent_rpcs.list_applications if parent_rpcs.respond_to? :list_applications + @list_applications = ::Gapic::Config::Method.new list_applications_config + get_application_config = parent_rpcs.get_application if parent_rpcs.respond_to? :get_application + @get_application = ::Gapic::Config::Method.new get_application_config + create_application_config = parent_rpcs.create_application if parent_rpcs.respond_to? :create_application + @create_application = ::Gapic::Config::Method.new create_application_config + update_application_config = parent_rpcs.update_application if parent_rpcs.respond_to? :update_application + @update_application = ::Gapic::Config::Method.new update_application_config + delete_application_config = parent_rpcs.delete_application if parent_rpcs.respond_to? :delete_application + @delete_application = ::Gapic::Config::Method.new delete_application_config + deploy_application_config = parent_rpcs.deploy_application if parent_rpcs.respond_to? :deploy_application + @deploy_application = ::Gapic::Config::Method.new deploy_application_config + undeploy_application_config = parent_rpcs.undeploy_application if parent_rpcs.respond_to? :undeploy_application + @undeploy_application = ::Gapic::Config::Method.new undeploy_application_config + add_application_stream_input_config = parent_rpcs.add_application_stream_input if parent_rpcs.respond_to? :add_application_stream_input + @add_application_stream_input = ::Gapic::Config::Method.new add_application_stream_input_config + remove_application_stream_input_config = parent_rpcs.remove_application_stream_input if parent_rpcs.respond_to? :remove_application_stream_input + @remove_application_stream_input = ::Gapic::Config::Method.new remove_application_stream_input_config + update_application_stream_input_config = parent_rpcs.update_application_stream_input if parent_rpcs.respond_to? :update_application_stream_input + @update_application_stream_input = ::Gapic::Config::Method.new update_application_stream_input_config + list_instances_config = parent_rpcs.list_instances if parent_rpcs.respond_to? :list_instances + @list_instances = ::Gapic::Config::Method.new list_instances_config + get_instance_config = parent_rpcs.get_instance if parent_rpcs.respond_to? :get_instance + @get_instance = ::Gapic::Config::Method.new get_instance_config + create_application_instances_config = parent_rpcs.create_application_instances if parent_rpcs.respond_to? :create_application_instances + @create_application_instances = ::Gapic::Config::Method.new create_application_instances_config + delete_application_instances_config = parent_rpcs.delete_application_instances if parent_rpcs.respond_to? :delete_application_instances + @delete_application_instances = ::Gapic::Config::Method.new delete_application_instances_config + update_application_instances_config = parent_rpcs.update_application_instances if parent_rpcs.respond_to? :update_application_instances + @update_application_instances = ::Gapic::Config::Method.new update_application_instances_config + list_drafts_config = parent_rpcs.list_drafts if parent_rpcs.respond_to? :list_drafts + @list_drafts = ::Gapic::Config::Method.new list_drafts_config + get_draft_config = parent_rpcs.get_draft if parent_rpcs.respond_to? :get_draft + @get_draft = ::Gapic::Config::Method.new get_draft_config + create_draft_config = parent_rpcs.create_draft if parent_rpcs.respond_to? :create_draft + @create_draft = ::Gapic::Config::Method.new create_draft_config + update_draft_config = parent_rpcs.update_draft if parent_rpcs.respond_to? :update_draft + @update_draft = ::Gapic::Config::Method.new update_draft_config + delete_draft_config = parent_rpcs.delete_draft if parent_rpcs.respond_to? :delete_draft + @delete_draft = ::Gapic::Config::Method.new delete_draft_config + list_processors_config = parent_rpcs.list_processors if parent_rpcs.respond_to? :list_processors + @list_processors = ::Gapic::Config::Method.new list_processors_config + list_prebuilt_processors_config = parent_rpcs.list_prebuilt_processors if parent_rpcs.respond_to? :list_prebuilt_processors + @list_prebuilt_processors = ::Gapic::Config::Method.new list_prebuilt_processors_config + get_processor_config = parent_rpcs.get_processor if parent_rpcs.respond_to? :get_processor + @get_processor = ::Gapic::Config::Method.new get_processor_config + create_processor_config = parent_rpcs.create_processor if parent_rpcs.respond_to? :create_processor + @create_processor = ::Gapic::Config::Method.new create_processor_config + update_processor_config = parent_rpcs.update_processor if parent_rpcs.respond_to? :update_processor + @update_processor = ::Gapic::Config::Method.new update_processor_config + delete_processor_config = parent_rpcs.delete_processor if parent_rpcs.respond_to? :delete_processor + @delete_processor = ::Gapic::Config::Method.new delete_processor_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/app_platform/credentials.rb b/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/app_platform/credentials.rb new file mode 100644 index 000000000000..a848b5bbc36c --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/app_platform/credentials.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! + +require "googleauth" + +module Google + module Cloud + module VisionAI + module V1 + module AppPlatform + # Credentials for the AppPlatform API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/cloud-platform" + ] + self.env_vars = [ + "GOOGLE_CLOUD_CREDENTIALS", + "GOOGLE_CLOUD_KEYFILE", + "GCLOUD_KEYFILE", + "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-vision_ai-v1/lib/google/cloud/vision_ai/v1/app_platform/operations.rb b/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/app_platform/operations.rb new file mode 100644 index 000000000000..e7ceba645b5e --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/app_platform/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 VisionAI + module V1 + module AppPlatform + # Service that implements Longrunning Operations API. + class Operations + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "visionai.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :operations_stub + + ## + # Configuration for the AppPlatform 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 AppPlatform 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::VisionAI::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::VisionAI::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::VisionAI::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::VisionAI::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::VisionAI::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 = "visionai.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-vision_ai-v1/lib/google/cloud/vision_ai/v1/app_platform/paths.rb b/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/app_platform/paths.rb new file mode 100644 index 000000000000..03999e0934fe --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/app_platform/paths.rb @@ -0,0 +1,151 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 VisionAI + module V1 + module AppPlatform + # Path helper methods for the AppPlatform API. + module Paths + ## + # Create a fully-qualified Application resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/applications/{application}` + # + # @param project [String] + # @param location [String] + # @param application [String] + # + # @return [::String] + def application_path project:, location:, application: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/applications/#{application}" + end + + ## + # Create a fully-qualified Draft resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/applications/{application}/drafts/{draft}` + # + # @param project [String] + # @param location [String] + # @param application [String] + # @param draft [String] + # + # @return [::String] + def draft_path project:, location:, application:, draft: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "application cannot contain /" if application.to_s.include? "/" + + "projects/#{project}/locations/#{location}/applications/#{application}/drafts/#{draft}" + end + + ## + # Create a fully-qualified Instance resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/applications/{application}/instances/{instance}` + # + # @param project [String] + # @param location [String] + # @param application [String] + # @param instance [String] + # + # @return [::String] + def instance_path project:, location:, application:, instance: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "application cannot contain /" if application.to_s.include? "/" + + "projects/#{project}/locations/#{location}/applications/#{application}/instances/#{instance}" + 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 Processor resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/processors/{processor}` + # + # @param project [String] + # @param location [String] + # @param processor [String] + # + # @return [::String] + def processor_path project:, location:, processor: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/processors/#{processor}" + end + + ## + # Create a fully-qualified Stream resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/clusters/{cluster}/streams/{stream}` + # + # @param project [String] + # @param location [String] + # @param cluster [String] + # @param stream [String] + # + # @return [::String] + def stream_path project:, location:, cluster:, stream: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "cluster cannot contain /" if cluster.to_s.include? "/" + + "projects/#{project}/locations/#{location}/clusters/#{cluster}/streams/#{stream}" + end + + extend self + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/app_platform/rest.rb b/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/app_platform/rest.rb new file mode 100644 index 000000000000..b520ce69c50f --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/app_platform/rest.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! + +require "gapic/rest" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/vision_ai/v1/version" +require "google/cloud/vision_ai/v1/bindings_override" + +require "google/cloud/vision_ai/v1/app_platform/credentials" +require "google/cloud/vision_ai/v1/app_platform/paths" +require "google/cloud/vision_ai/v1/app_platform/rest/operations" +require "google/cloud/vision_ai/v1/app_platform/rest/client" + +module Google + module Cloud + module VisionAI + module V1 + ## + # Service describing handlers for resources + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/vision_ai/v1/app_platform/rest" + # client = ::Google::Cloud::VisionAI::V1::AppPlatform::Rest::Client.new + # + module AppPlatform + # Client for the REST transport + module Rest + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "rest", "helpers.rb" +require "google/cloud/vision_ai/v1/app_platform/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/app_platform/rest/client.rb b/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/app_platform/rest/client.rb new file mode 100644 index 000000000000..10aca3e68596 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/app_platform/rest/client.rb @@ -0,0 +1,3148 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/visionai/v1/platform_pb" +require "google/cloud/vision_ai/v1/app_platform/rest/service_stub" +require "google/cloud/location/rest" +require "google/iam/v1/rest" + +module Google + module Cloud + module VisionAI + module V1 + module AppPlatform + module Rest + ## + # REST client for the AppPlatform service. + # + # Service describing handlers for resources + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "visionai.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :app_platform_stub + + ## + # Configure the AppPlatform Client class. + # + # See {::Google::Cloud::VisionAI::V1::AppPlatform::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all AppPlatform clients + # ::Google::Cloud::VisionAI::V1::AppPlatform::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", "VisionAI", "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 + end + yield @configure if block_given? + @configure + end + + ## + # Configure the AppPlatform 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::VisionAI::V1::AppPlatform::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 + @app_platform_stub.universe_domain + end + + ## + # Create a new AppPlatform REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::VisionAI::V1::AppPlatform::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::VisionAI::V1::AppPlatform::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the AppPlatform 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::VisionAI::V1::AppPlatform::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 + + @app_platform_stub = ::Google::Cloud::VisionAI::V1::AppPlatform::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials, + logger: @config.logger + ) + + @app_platform_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 = @app_platform_stub.endpoint + config.universe_domain = @app_platform_stub.universe_domain + config.bindings_override = @config.bindings_override + config.logger = @app_platform_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 = @app_platform_stub.endpoint + config.universe_domain = @app_platform_stub.universe_domain + config.logger = @app_platform_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::VisionAI::V1::AppPlatform::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 + @app_platform_stub.logger + end + + # Service calls + + ## + # Lists Applications in a given project and location. + # + # @overload list_applications(request, options = nil) + # Pass arguments to `list_applications` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::ListApplicationsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::ListApplicationsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_applications(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) + # Pass arguments to `list_applications` via keyword arguments. Note that at + # least one keyword argument is 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. Parent value for ListApplicationsRequest. + # @param page_size [::Integer] + # Requested page size. Server may return fewer items than requested. + # If unspecified, server will pick an appropriate default. + # @param page_token [::String] + # A token identifying a page of results the server should return. + # @param filter [::String] + # Filtering results. + # @param order_by [::String] + # Hint for how to order the results. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::VisionAI::V1::Application>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::VisionAI::V1::Application>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::AppPlatform::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::ListApplicationsRequest.new + # + # # Call the list_applications method. + # result = client.list_applications 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::VisionAI::V1::Application. + # p item + # end + # + def list_applications request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::ListApplicationsRequest + + # Converts hash 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_applications.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::VisionAI::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_applications.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_applications.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @app_platform_stub.list_applications request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @app_platform_stub, :list_applications, "applications", 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 details of a single Application. + # + # @overload get_application(request, options = nil) + # Pass arguments to `get_application` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::GetApplicationRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::GetApplicationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_application(name: nil) + # Pass arguments to `get_application` via keyword arguments. Note that at + # least one keyword argument is 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 resource. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::VisionAI::V1::Application] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::VisionAI::V1::Application] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::AppPlatform::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::GetApplicationRequest.new + # + # # Call the get_application method. + # result = client.get_application request + # + # # The returned object is of type Google::Cloud::VisionAI::V1::Application. + # p result + # + def get_application request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::GetApplicationRequest + + # Converts hash 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_application.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::VisionAI::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_application.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_application.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @app_platform_stub.get_application 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 Application in a given project and location. + # + # @overload create_application(request, options = nil) + # Pass arguments to `create_application` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::CreateApplicationRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::CreateApplicationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_application(parent: nil, application_id: nil, application: nil, request_id: nil) + # Pass arguments to `create_application` via keyword arguments. Note that at + # least one keyword argument is 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. Value for parent. + # @param application_id [::String] + # Required. Id of the requesting object. + # @param application [::Google::Cloud::VisionAI::V1::Application, ::Hash] + # Required. The resource being created. + # @param request_id [::String] + # Optional. An optional request ID to identify requests. Specify a unique + # request ID so that if you must retry your request, the server will know to + # ignore the request if it has already been completed. The server will + # guarantee that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @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/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::AppPlatform::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::CreateApplicationRequest.new + # + # # Call the create_application method. + # result = client.create_application 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_application request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::CreateApplicationRequest + + # Converts hash 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_application.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::VisionAI::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_application.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_application.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @app_platform_stub.create_application 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 + + ## + # Updates the parameters of a single Application. + # + # @overload update_application(request, options = nil) + # Pass arguments to `update_application` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::UpdateApplicationRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::UpdateApplicationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_application(update_mask: nil, application: nil, request_id: nil) + # Pass arguments to `update_application` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Optional. Field mask is used to specify the fields to be overwritten in the + # Application resource by the update. + # The fields specified in the update_mask are relative to the resource, not + # the full request. A field will be overwritten if it is in the mask. If the + # user does not provide a mask then all fields will be overwritten. + # @param application [::Google::Cloud::VisionAI::V1::Application, ::Hash] + # Required. The resource being updated. + # @param request_id [::String] + # Optional. An optional request ID to identify requests. Specify a unique + # request ID so that if you must retry your request, the server will know to + # ignore the request if it has already been completed. The server will + # guarantee that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @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/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::AppPlatform::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::UpdateApplicationRequest.new + # + # # Call the update_application method. + # result = client.update_application 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 update_application request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::UpdateApplicationRequest + + # Converts hash 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_application.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::VisionAI::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_application.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_application.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @app_platform_stub.update_application 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 single Application. + # + # @overload delete_application(request, options = nil) + # Pass arguments to `delete_application` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::DeleteApplicationRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::DeleteApplicationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_application(name: nil, request_id: nil, force: nil) + # Pass arguments to `delete_application` via keyword arguments. Note that at + # least one keyword argument is 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 resource. + # @param request_id [::String] + # Optional. An optional request ID to identify requests. Specify a unique + # request ID so that if you must retry your request, the server will know to + # ignore the request if it has already been completed. The server will + # guarantee that for at least 60 minutes after the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @param force [::Boolean] + # Optional. If set to true, any instances and drafts from this application + # will also be deleted. (Otherwise, the request will only work if the + # application has no instances and drafts.) + # @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/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::AppPlatform::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::DeleteApplicationRequest.new + # + # # Call the delete_application method. + # result = client.delete_application 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_application request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::DeleteApplicationRequest + + # Converts hash 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_application.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::VisionAI::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_application.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_application.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @app_platform_stub.delete_application 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 + + ## + # Deploys a single Application. + # + # @overload deploy_application(request, options = nil) + # Pass arguments to `deploy_application` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::DeployApplicationRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::DeployApplicationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload deploy_application(name: nil, validate_only: nil, request_id: nil, enable_monitoring: nil) + # Pass arguments to `deploy_application` via keyword arguments. Note that at + # least one keyword argument is 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 name of the application to retrieve. + # Format: + # "projects/\\{project}/locations/\\{location}/applications/\\{application}" + # @param validate_only [::Boolean] + # If set, validate the request and preview the application graph, but do not + # actually deploy it. + # @param request_id [::String] + # Optional. An optional request ID to identify requests. Specify a unique + # request ID so that if you must retry your request, the server will know to + # ignore the request if it has already been completed. The server will + # guarantee that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @param enable_monitoring [::Boolean] + # Optional. Whether or not to enable monitoring for the application on + # deployment. + # @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/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::AppPlatform::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::DeployApplicationRequest.new + # + # # Call the deploy_application method. + # result = client.deploy_application 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 deploy_application request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::DeployApplicationRequest + + # Converts hash 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.deploy_application.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::VisionAI::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.deploy_application.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.deploy_application.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @app_platform_stub.deploy_application 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 + + ## + # Undeploys a single Application. + # + # @overload undeploy_application(request, options = nil) + # Pass arguments to `undeploy_application` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::UndeployApplicationRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::UndeployApplicationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload undeploy_application(name: nil, request_id: nil) + # Pass arguments to `undeploy_application` via keyword arguments. Note that at + # least one keyword argument is 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 name of the application to retrieve. + # Format: + # "projects/\\{project}/locations/\\{location}/applications/\\{application}" + # @param request_id [::String] + # Optional. An optional request ID to identify requests. Specify a unique + # request ID so that if you must retry your request, the server will know to + # ignore the request if it has already been completed. The server will + # guarantee that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @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/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::AppPlatform::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::UndeployApplicationRequest.new + # + # # Call the undeploy_application method. + # result = client.undeploy_application 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 undeploy_application request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::UndeployApplicationRequest + + # Converts hash 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.undeploy_application.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::VisionAI::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.undeploy_application.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.undeploy_application.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @app_platform_stub.undeploy_application 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 + + ## + # Adds target stream input to the Application. + # If the Application is deployed, the corresponding new Application instance + # will be created. If the stream has already been in the Application, the RPC + # will fail. + # + # @overload add_application_stream_input(request, options = nil) + # Pass arguments to `add_application_stream_input` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::AddApplicationStreamInputRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::AddApplicationStreamInputRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload add_application_stream_input(name: nil, application_stream_inputs: nil, request_id: nil) + # Pass arguments to `add_application_stream_input` via keyword arguments. Note that at + # least one keyword argument is 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 name of the application to retrieve. + # Format: + # "projects/\\{project}/locations/\\{location}/applications/\\{application}" + # @param application_stream_inputs [::Array<::Google::Cloud::VisionAI::V1::ApplicationStreamInput, ::Hash>] + # The stream inputs to add, the stream resource name is the key of each + # StreamInput, and it must be unique within each application. + # @param request_id [::String] + # Optional. An optional request ID to identify requests. Specify a unique + # request ID so that if you must retry your request, the server will know to + # ignore the request if it has already been completed. The server will + # guarantee that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @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/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::AppPlatform::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::AddApplicationStreamInputRequest.new + # + # # Call the add_application_stream_input method. + # result = client.add_application_stream_input 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 add_application_stream_input request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::AddApplicationStreamInputRequest + + # Converts hash 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.add_application_stream_input.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::VisionAI::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.add_application_stream_input.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.add_application_stream_input.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @app_platform_stub.add_application_stream_input 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 + + ## + # Remove target stream input to the Application, if the Application is + # deployed, the corresponding instance based will be deleted. If the stream + # is not in the Application, the RPC will fail. + # + # @overload remove_application_stream_input(request, options = nil) + # Pass arguments to `remove_application_stream_input` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::RemoveApplicationStreamInputRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::RemoveApplicationStreamInputRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload remove_application_stream_input(name: nil, target_stream_inputs: nil, request_id: nil) + # Pass arguments to `remove_application_stream_input` via keyword arguments. Note that at + # least one keyword argument is 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 name of the application to retrieve. + # Format: + # "projects/\\{project}/locations/\\{location}/applications/\\{application}" + # @param target_stream_inputs [::Array<::Google::Cloud::VisionAI::V1::RemoveApplicationStreamInputRequest::TargetStreamInput, ::Hash>] + # The target stream to remove. + # @param request_id [::String] + # Optional. An optional request ID to identify requests. Specify a unique + # request ID so that if you must retry your request, the server will know to + # ignore the request if it has already been completed. The server will + # guarantee that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @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/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::AppPlatform::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::RemoveApplicationStreamInputRequest.new + # + # # Call the remove_application_stream_input method. + # result = client.remove_application_stream_input 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 remove_application_stream_input request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::RemoveApplicationStreamInputRequest + + # Converts hash 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.remove_application_stream_input.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::VisionAI::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.remove_application_stream_input.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.remove_application_stream_input.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @app_platform_stub.remove_application_stream_input 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 + + ## + # Update target stream input to the Application, if the Application is + # deployed, the corresponding instance based will be deployed. For + # CreateOrUpdate behavior, set allow_missing to true. + # + # @overload update_application_stream_input(request, options = nil) + # Pass arguments to `update_application_stream_input` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::UpdateApplicationStreamInputRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::UpdateApplicationStreamInputRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_application_stream_input(name: nil, application_stream_inputs: nil, request_id: nil, allow_missing: nil) + # Pass arguments to `update_application_stream_input` via keyword arguments. Note that at + # least one keyword argument is 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 name of the application to retrieve. + # Format: + # "projects/\\{project}/locations/\\{location}/applications/\\{application}" + # @param application_stream_inputs [::Array<::Google::Cloud::VisionAI::V1::ApplicationStreamInput, ::Hash>] + # The stream inputs to update, the stream resource name is the key of each + # StreamInput, and it must be unique within each application. + # @param request_id [::String] + # Optional. An optional request ID to identify requests. Specify a unique + # request ID so that if you must retry your request, the server will know to + # ignore the request if it has already been completed. The server will + # guarantee that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @param allow_missing [::Boolean] + # If true, UpdateApplicationStreamInput will insert stream input to + # application even if the target stream is not included in the application. + # @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/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::AppPlatform::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::UpdateApplicationStreamInputRequest.new + # + # # Call the update_application_stream_input method. + # result = client.update_application_stream_input 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 update_application_stream_input request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::UpdateApplicationStreamInputRequest + + # Converts hash 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_application_stream_input.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::VisionAI::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_application_stream_input.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_application_stream_input.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @app_platform_stub.update_application_stream_input 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 + + ## + # Lists Instances in a given project and location. + # + # @overload list_instances(request, options = nil) + # Pass arguments to `list_instances` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::ListInstancesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::ListInstancesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_instances(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) + # Pass arguments to `list_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. Parent value for ListInstancesRequest. + # @param page_size [::Integer] + # Requested page size. Server may return fewer items than requested. + # If unspecified, server will pick an appropriate default. + # @param page_token [::String] + # A token identifying a page of results the server should return. + # @param filter [::String] + # Filtering results. + # @param order_by [::String] + # Hint for how to order the results. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::VisionAI::V1::Instance>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::VisionAI::V1::Instance>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::AppPlatform::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::ListInstancesRequest.new + # + # # Call the list_instances method. + # result = client.list_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::VisionAI::V1::Instance. + # p item + # end + # + def list_instances request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::ListInstancesRequest + + # Converts hash 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_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::VisionAI::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_instances.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_instances.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @app_platform_stub.list_instances request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @app_platform_stub, :list_instances, "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 + + ## + # Gets details of a single Instance. + # + # @overload get_instance(request, options = nil) + # Pass arguments to `get_instance` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::GetInstanceRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::GetInstanceRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_instance(name: nil) + # Pass arguments to `get_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. Name of the resource. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::VisionAI::V1::Instance] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::VisionAI::V1::Instance] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::AppPlatform::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::GetInstanceRequest.new + # + # # Call the get_instance method. + # result = client.get_instance request + # + # # The returned object is of type Google::Cloud::VisionAI::V1::Instance. + # p result + # + def get_instance request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::GetInstanceRequest + + # Converts hash 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_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::VisionAI::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_instance.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_instance.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @app_platform_stub.get_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 + + ## + # Adds target stream input to the Application. + # If the Application is deployed, the corresponding new Application instance + # will be created. If the stream has already been in the Application, the RPC + # will fail. + # + # @overload create_application_instances(request, options = nil) + # Pass arguments to `create_application_instances` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::CreateApplicationInstancesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::CreateApplicationInstancesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_application_instances(name: nil, application_instances: nil, request_id: nil) + # Pass arguments to `create_application_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 name [::String] + # Required. the name of the application to retrieve. + # Format: + # "projects/\\{project}/locations/\\{location}/applications/\\{application}" + # @param application_instances [::Array<::Google::Cloud::VisionAI::V1::ApplicationInstance, ::Hash>] + # Required. The resources being created. + # @param request_id [::String] + # Optional. An optional request ID to identify requests. Specify a unique + # request ID so that if you must retry your request, the server will know to + # ignore the request if it has already been completed. The server will + # guarantee that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @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/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::AppPlatform::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::CreateApplicationInstancesRequest.new + # + # # Call the create_application_instances method. + # result = client.create_application_instances 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_application_instances request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::CreateApplicationInstancesRequest + + # Converts hash 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_application_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::VisionAI::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_application_instances.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_application_instances.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @app_platform_stub.create_application_instances 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 + + ## + # Remove target stream input to the Application, if the Application is + # deployed, the corresponding instance based will be deleted. If the stream + # is not in the Application, the RPC will fail. + # + # @overload delete_application_instances(request, options = nil) + # Pass arguments to `delete_application_instances` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::DeleteApplicationInstancesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::DeleteApplicationInstancesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_application_instances(name: nil, instance_ids: nil, request_id: nil) + # Pass arguments to `delete_application_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 name [::String] + # Required. the name of the application to retrieve. + # Format: + # "projects/\\{project}/locations/\\{location}/applications/\\{application}" + # @param instance_ids [::Array<::String>] + # Required. Id of the requesting object. + # @param request_id [::String] + # Optional. An optional request ID to identify requests. Specify a unique + # request ID so that if you must retry your request, the server will know to + # ignore the request if it has already been completed. The server will + # guarantee that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @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/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::AppPlatform::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::DeleteApplicationInstancesRequest.new + # + # # Call the delete_application_instances method. + # result = client.delete_application_instances 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_application_instances request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::DeleteApplicationInstancesRequest + + # Converts hash 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_application_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::VisionAI::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_application_instances.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_application_instances.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @app_platform_stub.delete_application_instances 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 + + ## + # Adds target stream input to the Application. + # If the Application is deployed, the corresponding new Application instance + # will be created. If the stream has already been in the Application, the RPC + # will fail. + # + # @overload update_application_instances(request, options = nil) + # Pass arguments to `update_application_instances` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::UpdateApplicationInstancesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::UpdateApplicationInstancesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_application_instances(name: nil, application_instances: nil, request_id: nil, allow_missing: nil) + # Pass arguments to `update_application_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 name [::String] + # Required. the name of the application to retrieve. + # Format: + # "projects/\\{project}/locations/\\{location}/applications/\\{application}" + # @param application_instances [::Array<::Google::Cloud::VisionAI::V1::UpdateApplicationInstancesRequest::UpdateApplicationInstance, ::Hash>] + # @param request_id [::String] + # Optional. An optional request ID to identify requests. Specify a unique + # request ID so that if you must retry your request, the server will know to + # ignore the request if it has already been completed. The server will + # guarantee that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @param allow_missing [::Boolean] + # If true, Update Request will create one resource if the target resource + # doesn't exist, this time, the field_mask will be ignored. + # @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/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::AppPlatform::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::UpdateApplicationInstancesRequest.new + # + # # Call the update_application_instances method. + # result = client.update_application_instances 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 update_application_instances request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::UpdateApplicationInstancesRequest + + # Converts hash 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_application_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::VisionAI::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_application_instances.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_application_instances.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @app_platform_stub.update_application_instances 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 + + ## + # Lists Drafts in a given project and location. + # + # @overload list_drafts(request, options = nil) + # Pass arguments to `list_drafts` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::ListDraftsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::ListDraftsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_drafts(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) + # Pass arguments to `list_drafts` via keyword arguments. Note that at + # least one keyword argument is 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. Parent value for ListDraftsRequest. + # @param page_size [::Integer] + # Requested page size. Server may return fewer items than requested. + # If unspecified, server will pick an appropriate default. + # @param page_token [::String] + # A token identifying a page of results the server should return. + # @param filter [::String] + # Filtering results. + # @param order_by [::String] + # Hint for how to order the results. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::VisionAI::V1::Draft>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::VisionAI::V1::Draft>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::AppPlatform::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::ListDraftsRequest.new + # + # # Call the list_drafts method. + # result = client.list_drafts 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::VisionAI::V1::Draft. + # p item + # end + # + def list_drafts request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::ListDraftsRequest + + # Converts hash 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_drafts.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::VisionAI::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_drafts.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_drafts.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @app_platform_stub.list_drafts request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @app_platform_stub, :list_drafts, "drafts", 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 details of a single Draft. + # + # @overload get_draft(request, options = nil) + # Pass arguments to `get_draft` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::GetDraftRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::GetDraftRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_draft(name: nil) + # Pass arguments to `get_draft` via keyword arguments. Note that at + # least one keyword argument is 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 resource. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::VisionAI::V1::Draft] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::VisionAI::V1::Draft] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::AppPlatform::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::GetDraftRequest.new + # + # # Call the get_draft method. + # result = client.get_draft request + # + # # The returned object is of type Google::Cloud::VisionAI::V1::Draft. + # p result + # + def get_draft request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::GetDraftRequest + + # Converts hash 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_draft.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::VisionAI::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_draft.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_draft.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @app_platform_stub.get_draft 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 Draft in a given project and location. + # + # @overload create_draft(request, options = nil) + # Pass arguments to `create_draft` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::CreateDraftRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::CreateDraftRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_draft(parent: nil, draft_id: nil, draft: nil, request_id: nil) + # Pass arguments to `create_draft` via keyword arguments. Note that at + # least one keyword argument is 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. Value for parent. + # @param draft_id [::String] + # Required. Id of the requesting object. + # @param draft [::Google::Cloud::VisionAI::V1::Draft, ::Hash] + # Required. The resource being created. + # @param request_id [::String] + # Optional. An optional request ID to identify requests. Specify a unique + # request ID so that if you must retry your request, the server will know to + # ignore the request if it has already been completed. The server will + # guarantee that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @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/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::AppPlatform::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::CreateDraftRequest.new + # + # # Call the create_draft method. + # result = client.create_draft 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_draft request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::CreateDraftRequest + + # Converts hash 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_draft.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::VisionAI::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_draft.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_draft.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @app_platform_stub.create_draft 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 + + ## + # Updates the parameters of a single Draft. + # + # @overload update_draft(request, options = nil) + # Pass arguments to `update_draft` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::UpdateDraftRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::UpdateDraftRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_draft(update_mask: nil, draft: nil, request_id: nil, allow_missing: nil) + # Pass arguments to `update_draft` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Optional. Field mask is used to specify the fields to be overwritten in the + # Draft resource by the update. + # The fields specified in the update_mask are relative to the resource, not + # the full request. A field will be overwritten if it is in the mask. If the + # user does not provide a mask then all fields will be overwritten. + # @param draft [::Google::Cloud::VisionAI::V1::Draft, ::Hash] + # Required. The resource being updated. + # @param request_id [::String] + # Optional. An optional request ID to identify requests. Specify a unique + # request ID so that if you must retry your request, the server will know to + # ignore the request if it has already been completed. The server will + # guarantee that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @param allow_missing [::Boolean] + # If true, UpdateDraftRequest will create one resource if the target resource + # doesn't exist, this time, the field_mask will be ignored. + # @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/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::AppPlatform::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::UpdateDraftRequest.new + # + # # Call the update_draft method. + # result = client.update_draft 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 update_draft request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::UpdateDraftRequest + + # Converts hash 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_draft.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::VisionAI::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_draft.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_draft.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @app_platform_stub.update_draft 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 single Draft. + # + # @overload delete_draft(request, options = nil) + # Pass arguments to `delete_draft` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::DeleteDraftRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::DeleteDraftRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_draft(name: nil, request_id: nil) + # Pass arguments to `delete_draft` via keyword arguments. Note that at + # least one keyword argument is 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 resource. + # @param request_id [::String] + # Optional. An optional request ID to identify requests. Specify a unique + # request ID so that if you must retry your request, the server will know to + # ignore the request if it has already been completed. The server will + # guarantee that for at least 60 minutes after the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @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/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::AppPlatform::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::DeleteDraftRequest.new + # + # # Call the delete_draft method. + # result = client.delete_draft 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_draft request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::DeleteDraftRequest + + # Converts hash 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_draft.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::VisionAI::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_draft.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_draft.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @app_platform_stub.delete_draft 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 + + ## + # Lists Processors in a given project and location. + # + # @overload list_processors(request, options = nil) + # Pass arguments to `list_processors` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::ListProcessorsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::ListProcessorsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_processors(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) + # Pass arguments to `list_processors` via keyword arguments. Note that at + # least one keyword argument is 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. Parent value for ListProcessorsRequest. + # @param page_size [::Integer] + # Requested page size. Server may return fewer items than requested. + # If unspecified, server will pick an appropriate default. + # @param page_token [::String] + # A token identifying a page of results the server should return. + # @param filter [::String] + # Filtering results. + # @param order_by [::String] + # Hint for how to order the results. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::VisionAI::V1::Processor>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::VisionAI::V1::Processor>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::AppPlatform::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::ListProcessorsRequest.new + # + # # Call the list_processors method. + # result = client.list_processors 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::VisionAI::V1::Processor. + # p item + # end + # + def list_processors request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::ListProcessorsRequest + + # Converts hash 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_processors.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::VisionAI::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_processors.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_processors.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @app_platform_stub.list_processors request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @app_platform_stub, :list_processors, "processors", 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 + + ## + # ListPrebuiltProcessors is a custom pass-through verb that Lists Prebuilt + # Processors. + # + # @overload list_prebuilt_processors(request, options = nil) + # Pass arguments to `list_prebuilt_processors` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::ListPrebuiltProcessorsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::ListPrebuiltProcessorsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_prebuilt_processors(parent: nil) + # Pass arguments to `list_prebuilt_processors` via keyword arguments. Note that at + # least one keyword argument is 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. Parent path. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::VisionAI::V1::ListPrebuiltProcessorsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::VisionAI::V1::ListPrebuiltProcessorsResponse] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::AppPlatform::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::ListPrebuiltProcessorsRequest.new + # + # # Call the list_prebuilt_processors method. + # result = client.list_prebuilt_processors request + # + # # The returned object is of type Google::Cloud::VisionAI::V1::ListPrebuiltProcessorsResponse. + # p result + # + def list_prebuilt_processors request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::ListPrebuiltProcessorsRequest + + # Converts hash 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_prebuilt_processors.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::VisionAI::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_prebuilt_processors.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_prebuilt_processors.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @app_platform_stub.list_prebuilt_processors 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 + + ## + # Gets details of a single Processor. + # + # @overload get_processor(request, options = nil) + # Pass arguments to `get_processor` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::GetProcessorRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::GetProcessorRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_processor(name: nil) + # Pass arguments to `get_processor` via keyword arguments. Note that at + # least one keyword argument is 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 resource. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::VisionAI::V1::Processor] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::VisionAI::V1::Processor] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::AppPlatform::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::GetProcessorRequest.new + # + # # Call the get_processor method. + # result = client.get_processor request + # + # # The returned object is of type Google::Cloud::VisionAI::V1::Processor. + # p result + # + def get_processor request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::GetProcessorRequest + + # Converts hash 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_processor.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::VisionAI::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_processor.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_processor.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @app_platform_stub.get_processor 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 Processor in a given project and location. + # + # @overload create_processor(request, options = nil) + # Pass arguments to `create_processor` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::CreateProcessorRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::CreateProcessorRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_processor(parent: nil, processor_id: nil, processor: nil, request_id: nil) + # Pass arguments to `create_processor` via keyword arguments. Note that at + # least one keyword argument is 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. Value for parent. + # @param processor_id [::String] + # Required. Id of the requesting object. + # @param processor [::Google::Cloud::VisionAI::V1::Processor, ::Hash] + # Required. The resource being created. + # @param request_id [::String] + # Optional. An optional request ID to identify requests. Specify a unique + # request ID so that if you must retry your request, the server will know to + # ignore the request if it has already been completed. The server will + # guarantee that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @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/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::AppPlatform::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::CreateProcessorRequest.new + # + # # Call the create_processor method. + # result = client.create_processor 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_processor request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::CreateProcessorRequest + + # Converts hash 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_processor.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::VisionAI::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_processor.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_processor.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @app_platform_stub.create_processor 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 + + ## + # Updates the parameters of a single Processor. + # + # @overload update_processor(request, options = nil) + # Pass arguments to `update_processor` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::UpdateProcessorRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::UpdateProcessorRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_processor(update_mask: nil, processor: nil, request_id: nil) + # Pass arguments to `update_processor` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Optional. Field mask is used to specify the fields to be overwritten in the + # Processor resource by the update. + # The fields specified in the update_mask are relative to the resource, not + # the full request. A field will be overwritten if it is in the mask. If the + # user does not provide a mask then all fields will be overwritten. + # @param processor [::Google::Cloud::VisionAI::V1::Processor, ::Hash] + # Required. The resource being updated. + # @param request_id [::String] + # Optional. An optional request ID to identify requests. Specify a unique + # request ID so that if you must retry your request, the server will know to + # ignore the request if it has already been completed. The server will + # guarantee that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @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/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::AppPlatform::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::UpdateProcessorRequest.new + # + # # Call the update_processor method. + # result = client.update_processor 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 update_processor request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::UpdateProcessorRequest + + # Converts hash 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_processor.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::VisionAI::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_processor.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_processor.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @app_platform_stub.update_processor 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 single Processor. + # + # @overload delete_processor(request, options = nil) + # Pass arguments to `delete_processor` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::DeleteProcessorRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::DeleteProcessorRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_processor(name: nil, request_id: nil) + # Pass arguments to `delete_processor` via keyword arguments. Note that at + # least one keyword argument is 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 resource + # @param request_id [::String] + # Optional. An optional request ID to identify requests. Specify a unique + # request ID so that if you must retry your request, the server will know to + # ignore the request if it has already been completed. The server will + # guarantee that for at least 60 minutes after the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @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/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::AppPlatform::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::DeleteProcessorRequest.new + # + # # Call the delete_processor method. + # result = client.delete_processor 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_processor request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::DeleteProcessorRequest + + # Converts hash 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_processor.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::VisionAI::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_processor.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_processor.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @app_platform_stub.delete_processor 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 + + ## + # Configuration class for the AppPlatform REST API. + # + # This class represents the configuration for AppPlatform 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::VisionAI::V1::AppPlatform::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_applications to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::VisionAI::V1::AppPlatform::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_applications.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::VisionAI::V1::AppPlatform::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_applications.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 = "visionai.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 AppPlatform 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_applications` + # @return [::Gapic::Config::Method] + # + attr_reader :list_applications + ## + # RPC-specific configuration for `get_application` + # @return [::Gapic::Config::Method] + # + attr_reader :get_application + ## + # RPC-specific configuration for `create_application` + # @return [::Gapic::Config::Method] + # + attr_reader :create_application + ## + # RPC-specific configuration for `update_application` + # @return [::Gapic::Config::Method] + # + attr_reader :update_application + ## + # RPC-specific configuration for `delete_application` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_application + ## + # RPC-specific configuration for `deploy_application` + # @return [::Gapic::Config::Method] + # + attr_reader :deploy_application + ## + # RPC-specific configuration for `undeploy_application` + # @return [::Gapic::Config::Method] + # + attr_reader :undeploy_application + ## + # RPC-specific configuration for `add_application_stream_input` + # @return [::Gapic::Config::Method] + # + attr_reader :add_application_stream_input + ## + # RPC-specific configuration for `remove_application_stream_input` + # @return [::Gapic::Config::Method] + # + attr_reader :remove_application_stream_input + ## + # RPC-specific configuration for `update_application_stream_input` + # @return [::Gapic::Config::Method] + # + attr_reader :update_application_stream_input + ## + # RPC-specific configuration for `list_instances` + # @return [::Gapic::Config::Method] + # + attr_reader :list_instances + ## + # RPC-specific configuration for `get_instance` + # @return [::Gapic::Config::Method] + # + attr_reader :get_instance + ## + # RPC-specific configuration for `create_application_instances` + # @return [::Gapic::Config::Method] + # + attr_reader :create_application_instances + ## + # RPC-specific configuration for `delete_application_instances` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_application_instances + ## + # RPC-specific configuration for `update_application_instances` + # @return [::Gapic::Config::Method] + # + attr_reader :update_application_instances + ## + # RPC-specific configuration for `list_drafts` + # @return [::Gapic::Config::Method] + # + attr_reader :list_drafts + ## + # RPC-specific configuration for `get_draft` + # @return [::Gapic::Config::Method] + # + attr_reader :get_draft + ## + # RPC-specific configuration for `create_draft` + # @return [::Gapic::Config::Method] + # + attr_reader :create_draft + ## + # RPC-specific configuration for `update_draft` + # @return [::Gapic::Config::Method] + # + attr_reader :update_draft + ## + # RPC-specific configuration for `delete_draft` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_draft + ## + # RPC-specific configuration for `list_processors` + # @return [::Gapic::Config::Method] + # + attr_reader :list_processors + ## + # RPC-specific configuration for `list_prebuilt_processors` + # @return [::Gapic::Config::Method] + # + attr_reader :list_prebuilt_processors + ## + # RPC-specific configuration for `get_processor` + # @return [::Gapic::Config::Method] + # + attr_reader :get_processor + ## + # RPC-specific configuration for `create_processor` + # @return [::Gapic::Config::Method] + # + attr_reader :create_processor + ## + # RPC-specific configuration for `update_processor` + # @return [::Gapic::Config::Method] + # + attr_reader :update_processor + ## + # RPC-specific configuration for `delete_processor` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_processor + + # @private + def initialize parent_rpcs = nil + list_applications_config = parent_rpcs.list_applications if parent_rpcs.respond_to? :list_applications + @list_applications = ::Gapic::Config::Method.new list_applications_config + get_application_config = parent_rpcs.get_application if parent_rpcs.respond_to? :get_application + @get_application = ::Gapic::Config::Method.new get_application_config + create_application_config = parent_rpcs.create_application if parent_rpcs.respond_to? :create_application + @create_application = ::Gapic::Config::Method.new create_application_config + update_application_config = parent_rpcs.update_application if parent_rpcs.respond_to? :update_application + @update_application = ::Gapic::Config::Method.new update_application_config + delete_application_config = parent_rpcs.delete_application if parent_rpcs.respond_to? :delete_application + @delete_application = ::Gapic::Config::Method.new delete_application_config + deploy_application_config = parent_rpcs.deploy_application if parent_rpcs.respond_to? :deploy_application + @deploy_application = ::Gapic::Config::Method.new deploy_application_config + undeploy_application_config = parent_rpcs.undeploy_application if parent_rpcs.respond_to? :undeploy_application + @undeploy_application = ::Gapic::Config::Method.new undeploy_application_config + add_application_stream_input_config = parent_rpcs.add_application_stream_input if parent_rpcs.respond_to? :add_application_stream_input + @add_application_stream_input = ::Gapic::Config::Method.new add_application_stream_input_config + remove_application_stream_input_config = parent_rpcs.remove_application_stream_input if parent_rpcs.respond_to? :remove_application_stream_input + @remove_application_stream_input = ::Gapic::Config::Method.new remove_application_stream_input_config + update_application_stream_input_config = parent_rpcs.update_application_stream_input if parent_rpcs.respond_to? :update_application_stream_input + @update_application_stream_input = ::Gapic::Config::Method.new update_application_stream_input_config + list_instances_config = parent_rpcs.list_instances if parent_rpcs.respond_to? :list_instances + @list_instances = ::Gapic::Config::Method.new list_instances_config + get_instance_config = parent_rpcs.get_instance if parent_rpcs.respond_to? :get_instance + @get_instance = ::Gapic::Config::Method.new get_instance_config + create_application_instances_config = parent_rpcs.create_application_instances if parent_rpcs.respond_to? :create_application_instances + @create_application_instances = ::Gapic::Config::Method.new create_application_instances_config + delete_application_instances_config = parent_rpcs.delete_application_instances if parent_rpcs.respond_to? :delete_application_instances + @delete_application_instances = ::Gapic::Config::Method.new delete_application_instances_config + update_application_instances_config = parent_rpcs.update_application_instances if parent_rpcs.respond_to? :update_application_instances + @update_application_instances = ::Gapic::Config::Method.new update_application_instances_config + list_drafts_config = parent_rpcs.list_drafts if parent_rpcs.respond_to? :list_drafts + @list_drafts = ::Gapic::Config::Method.new list_drafts_config + get_draft_config = parent_rpcs.get_draft if parent_rpcs.respond_to? :get_draft + @get_draft = ::Gapic::Config::Method.new get_draft_config + create_draft_config = parent_rpcs.create_draft if parent_rpcs.respond_to? :create_draft + @create_draft = ::Gapic::Config::Method.new create_draft_config + update_draft_config = parent_rpcs.update_draft if parent_rpcs.respond_to? :update_draft + @update_draft = ::Gapic::Config::Method.new update_draft_config + delete_draft_config = parent_rpcs.delete_draft if parent_rpcs.respond_to? :delete_draft + @delete_draft = ::Gapic::Config::Method.new delete_draft_config + list_processors_config = parent_rpcs.list_processors if parent_rpcs.respond_to? :list_processors + @list_processors = ::Gapic::Config::Method.new list_processors_config + list_prebuilt_processors_config = parent_rpcs.list_prebuilt_processors if parent_rpcs.respond_to? :list_prebuilt_processors + @list_prebuilt_processors = ::Gapic::Config::Method.new list_prebuilt_processors_config + get_processor_config = parent_rpcs.get_processor if parent_rpcs.respond_to? :get_processor + @get_processor = ::Gapic::Config::Method.new get_processor_config + create_processor_config = parent_rpcs.create_processor if parent_rpcs.respond_to? :create_processor + @create_processor = ::Gapic::Config::Method.new create_processor_config + update_processor_config = parent_rpcs.update_processor if parent_rpcs.respond_to? :update_processor + @update_processor = ::Gapic::Config::Method.new update_processor_config + delete_processor_config = parent_rpcs.delete_processor if parent_rpcs.respond_to? :delete_processor + @delete_processor = ::Gapic::Config::Method.new delete_processor_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/app_platform/rest/operations.rb b/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/app_platform/rest/operations.rb new file mode 100644 index 000000000000..94d93d0a51a4 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/app_platform/rest/operations.rb @@ -0,0 +1,974 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 VisionAI + module V1 + module AppPlatform + module Rest + # Service that implements Longrunning Operations API. + class Operations + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "visionai.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :operations_stub + + ## + # Configuration for the AppPlatform 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 AppPlatform 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::VisionAI::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::VisionAI::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::VisionAI::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::VisionAI::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 = "visionai.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}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/?$}, 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] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/warehouseOperations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/corpora/[^/]+/assets/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/corpora/[^/]+/collections/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/corpora/[^/]+/imageIndexes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/corpora/[^/]+/indexes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/corpora/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/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{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + 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{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/app_platform/rest/service_stub.rb b/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/app_platform/rest/service_stub.rb new file mode 100644 index 000000000000..f38e0fdfce6d --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/app_platform/rest/service_stub.rb @@ -0,0 +1,1682 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/visionai/v1/platform_pb" + +module Google + module Cloud + module VisionAI + module V1 + module AppPlatform + module Rest + ## + # REST service stub for the AppPlatform 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_applications REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::ListApplicationsRequest] + # 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::VisionAI::V1::ListApplicationsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::VisionAI::V1::ListApplicationsResponse] + # A result object deserialized from the server's reply + def list_applications request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_applications_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_applications", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::VisionAI::V1::ListApplicationsResponse.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_application REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::GetApplicationRequest] + # 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::VisionAI::V1::Application] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::VisionAI::V1::Application] + # A result object deserialized from the server's reply + def get_application request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_application_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_application", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::VisionAI::V1::Application.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_application REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::CreateApplicationRequest] + # 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_application request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_application_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_application", + 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 update_application REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::UpdateApplicationRequest] + # 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 update_application request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_application_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_application", + 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_application REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::DeleteApplicationRequest] + # 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_application request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_application_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_application", + 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 deploy_application REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::DeployApplicationRequest] + # 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 deploy_application request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_deploy_application_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: "deploy_application", + 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 undeploy_application REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::UndeployApplicationRequest] + # 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 undeploy_application request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_undeploy_application_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: "undeploy_application", + 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 add_application_stream_input REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::AddApplicationStreamInputRequest] + # 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 add_application_stream_input request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_add_application_stream_input_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: "add_application_stream_input", + 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 remove_application_stream_input REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::RemoveApplicationStreamInputRequest] + # 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 remove_application_stream_input request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_remove_application_stream_input_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: "remove_application_stream_input", + 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 update_application_stream_input REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::UpdateApplicationStreamInputRequest] + # 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 update_application_stream_input request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_application_stream_input_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_application_stream_input", + 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 list_instances REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::ListInstancesRequest] + # 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::VisionAI::V1::ListInstancesResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::VisionAI::V1::ListInstancesResponse] + # A result object deserialized from the server's reply + def list_instances request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_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_instances", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::VisionAI::V1::ListInstancesResponse.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_instance REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::GetInstanceRequest] + # 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::VisionAI::V1::Instance] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::VisionAI::V1::Instance] + # A result object deserialized from the server's reply + def get_instance request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_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_instance", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::VisionAI::V1::Instance.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_application_instances REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::CreateApplicationInstancesRequest] + # 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_application_instances request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_application_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: "create_application_instances", + 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_application_instances REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::DeleteApplicationInstancesRequest] + # 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_application_instances request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_application_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: "delete_application_instances", + 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 update_application_instances REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::UpdateApplicationInstancesRequest] + # 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 update_application_instances request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_application_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: "update_application_instances", + 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 list_drafts REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::ListDraftsRequest] + # 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::VisionAI::V1::ListDraftsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::VisionAI::V1::ListDraftsResponse] + # A result object deserialized from the server's reply + def list_drafts request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_drafts_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_drafts", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::VisionAI::V1::ListDraftsResponse.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_draft REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::GetDraftRequest] + # 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::VisionAI::V1::Draft] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::VisionAI::V1::Draft] + # A result object deserialized from the server's reply + def get_draft request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_draft_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_draft", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::VisionAI::V1::Draft.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_draft REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::CreateDraftRequest] + # 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_draft request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_draft_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_draft", + 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 update_draft REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::UpdateDraftRequest] + # 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 update_draft request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_draft_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_draft", + 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_draft REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::DeleteDraftRequest] + # 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_draft request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_draft_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_draft", + 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 list_processors REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::ListProcessorsRequest] + # 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::VisionAI::V1::ListProcessorsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::VisionAI::V1::ListProcessorsResponse] + # A result object deserialized from the server's reply + def list_processors request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_processors_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_processors", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::VisionAI::V1::ListProcessorsResponse.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_prebuilt_processors REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::ListPrebuiltProcessorsRequest] + # 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::VisionAI::V1::ListPrebuiltProcessorsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::VisionAI::V1::ListPrebuiltProcessorsResponse] + # A result object deserialized from the server's reply + def list_prebuilt_processors request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_prebuilt_processors_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_prebuilt_processors", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::VisionAI::V1::ListPrebuiltProcessorsResponse.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_processor REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::GetProcessorRequest] + # 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::VisionAI::V1::Processor] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::VisionAI::V1::Processor] + # A result object deserialized from the server's reply + def get_processor request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_processor_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_processor", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::VisionAI::V1::Processor.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_processor REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::CreateProcessorRequest] + # 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_processor request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_processor_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_processor", + 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 update_processor REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::UpdateProcessorRequest] + # 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 update_processor request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_processor_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_processor", + 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_processor REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::DeleteProcessorRequest] + # 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_processor request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_processor_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_processor", + 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 + + ## + # @private + # + # GRPC transcoding helper method for the list_applications REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::ListApplicationsRequest] + # 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_applications_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/applications", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_application REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::GetApplicationRequest] + # 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_application_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/applications/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_application REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::CreateApplicationRequest] + # 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_application_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/applications", + body: "application", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_application REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::UpdateApplicationRequest] + # 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_application_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v1/{application.name}", + body: "application", + matches: [ + ["application.name", %r{^projects/[^/]+/locations/[^/]+/applications/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_application REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::DeleteApplicationRequest] + # 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_application_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/applications/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the deploy_application REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::DeployApplicationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_deploy_application_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:deploy", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/applications/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the undeploy_application REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::UndeployApplicationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_undeploy_application_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:undeploy", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/applications/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the add_application_stream_input REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::AddApplicationStreamInputRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_add_application_stream_input_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:addStreamInput", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/applications/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the remove_application_stream_input REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::RemoveApplicationStreamInputRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_remove_application_stream_input_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:removeStreamInput", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/applications/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_application_stream_input REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::UpdateApplicationStreamInputRequest] + # 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_application_stream_input_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:updateStreamInput", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/applications/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_instances REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::ListInstancesRequest] + # 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_instances_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/instances", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/applications/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_instance REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::GetInstanceRequest] + # 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_instance_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/applications/[^/]+/instances/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_application_instances REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::CreateApplicationInstancesRequest] + # 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_application_instances_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:createApplicationInstances", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/applications/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_application_instances REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::DeleteApplicationInstancesRequest] + # 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_application_instances_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:deleteApplicationInstances", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/applications/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_application_instances REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::UpdateApplicationInstancesRequest] + # 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_application_instances_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:updateApplicationInstances", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/applications/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_drafts REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::ListDraftsRequest] + # 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_drafts_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/drafts", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/applications/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_draft REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::GetDraftRequest] + # 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_draft_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/applications/[^/]+/drafts/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_draft REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::CreateDraftRequest] + # 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_draft_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/drafts", + body: "draft", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/applications/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_draft REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::UpdateDraftRequest] + # 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_draft_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v1/{draft.name}", + body: "draft", + matches: [ + ["draft.name", %r{^projects/[^/]+/locations/[^/]+/applications/[^/]+/drafts/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_draft REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::DeleteDraftRequest] + # 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_draft_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/applications/[^/]+/drafts/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_processors REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::ListProcessorsRequest] + # 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_processors_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/processors", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_prebuilt_processors REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::ListPrebuiltProcessorsRequest] + # 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_prebuilt_processors_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/processors:prebuilt", + body: "*", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_processor REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::GetProcessorRequest] + # 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_processor_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/processors/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_processor REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::CreateProcessorRequest] + # 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_processor_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/processors", + body: "processor", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_processor REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::UpdateProcessorRequest] + # 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_processor_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v1/{processor.name}", + body: "processor", + matches: [ + ["processor.name", %r{^projects/[^/]+/locations/[^/]+/processors/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_processor REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::DeleteProcessorRequest] + # 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_processor_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/processors/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/bindings_override.rb b/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/bindings_override.rb new file mode 100644 index 000000000000..32c29b6758a7 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/bindings_override.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! + +require "gapic/rest" + +module Google + module Cloud + module VisionAI + ## + # @example Loading just the REST part of this package, including all its services, and instantiating a REST client + # + # require "google/cloud/vision_ai/v1/rest" + # client = ::Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Rest::Client.new + # + module V1 + ## + # @private + # Initialize the mixin bindings configuration + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "VisionAI"] + 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 + end + yield @configure if block_given? + @configure + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/health_check_service.rb b/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/health_check_service.rb new file mode 100644 index 000000000000..6f083b643903 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/health_check_service.rb @@ -0,0 +1,56 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/vision_ai/v1/version" + +require "google/cloud/vision_ai/v1/health_check_service/credentials" +require "google/cloud/vision_ai/v1/health_check_service/paths" +require "google/cloud/vision_ai/v1/health_check_service/client" +require "google/cloud/vision_ai/v1/health_check_service/rest" + +module Google + module Cloud + module VisionAI + module V1 + ## + # HealthCheckService provides an interface for Vertex AI Vision Cluster Health + # Check. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/vision_ai/v1/health_check_service" + # client = ::Google::Cloud::VisionAI::V1::HealthCheckService::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/vision_ai/v1/health_check_service/rest" + # client = ::Google::Cloud::VisionAI::V1::HealthCheckService::Rest::Client.new + # + module HealthCheckService + end + end + end + end +end + +helper_path = ::File.join __dir__, "health_check_service", "helpers.rb" +require "google/cloud/vision_ai/v1/health_check_service/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/health_check_service/client.rb b/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/health_check_service/client.rb new file mode 100644 index 000000000000..de5277421a7b --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/health_check_service/client.rb @@ -0,0 +1,507 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/visionai/v1/health_service_pb" +require "google/cloud/location" +require "google/iam/v1" + +module Google + module Cloud + module VisionAI + module V1 + module HealthCheckService + ## + # Client for the HealthCheckService service. + # + # HealthCheckService provides an interface for Vertex AI Vision Cluster Health + # Check. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "visionai.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :health_check_service_stub + + ## + # Configure the HealthCheckService Client class. + # + # See {::Google::Cloud::VisionAI::V1::HealthCheckService::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all HealthCheckService clients + # ::Google::Cloud::VisionAI::V1::HealthCheckService::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", "VisionAI", "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 + end + yield @configure if block_given? + @configure + end + + ## + # Configure the HealthCheckService 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::VisionAI::V1::HealthCheckService::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 + @health_check_service_stub.universe_domain + end + + ## + # Create a new HealthCheckService client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::VisionAI::V1::HealthCheckService::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::VisionAI::V1::HealthCheckService::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the HealthCheckService 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/visionai/v1/health_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 + + @health_check_service_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::VisionAI::V1::HealthCheckService::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 + ) + + @health_check_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 = @health_check_service_stub.endpoint + config.universe_domain = @health_check_service_stub.universe_domain + config.logger = @health_check_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 = @health_check_service_stub.endpoint + config.universe_domain = @health_check_service_stub.universe_domain + config.logger = @health_check_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 + @health_check_service_stub.logger + end + + # Service calls + + ## + # HealthCheck method checks the health status of the cluster. + # + # @overload health_check(request, options = nil) + # Pass arguments to `health_check` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::HealthCheckRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::HealthCheckRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload health_check(cluster: nil) + # Pass arguments to `health_check` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param cluster [::String] + # The parent of the resource. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::VisionAI::V1::HealthCheckResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::VisionAI::V1::HealthCheckResponse] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::HealthCheckService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::HealthCheckRequest.new + # + # # Call the health_check method. + # result = client.health_check request + # + # # The returned object is of type Google::Cloud::VisionAI::V1::HealthCheckResponse. + # p result + # + def health_check request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::HealthCheckRequest + + # Converts hash 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.health_check.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::VisionAI::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.cluster + header_params["cluster"] = request.cluster + 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.health_check.timeout, + metadata: metadata, + retry_policy: @config.rpcs.health_check.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @health_check_service_stub.call_rpc :health_check, 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 HealthCheckService API. + # + # This class represents the configuration for HealthCheckService, + # 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::VisionAI::V1::HealthCheckService::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 + # # health_check to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::VisionAI::V1::HealthCheckService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.health_check.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::VisionAI::V1::HealthCheckService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.health_check.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::VisionAI::V1::HealthCheckService::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 = "visionai.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 HealthCheckService 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 `health_check` + # @return [::Gapic::Config::Method] + # + attr_reader :health_check + + # @private + def initialize parent_rpcs = nil + health_check_config = parent_rpcs.health_check if parent_rpcs.respond_to? :health_check + @health_check = ::Gapic::Config::Method.new health_check_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/health_check_service/credentials.rb b/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/health_check_service/credentials.rb new file mode 100644 index 000000000000..281032fe20a5 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/health_check_service/credentials.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! + +require "googleauth" + +module Google + module Cloud + module VisionAI + module V1 + module HealthCheckService + # Credentials for the HealthCheckService API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/cloud-platform" + ] + self.env_vars = [ + "GOOGLE_CLOUD_CREDENTIALS", + "GOOGLE_CLOUD_KEYFILE", + "GCLOUD_KEYFILE", + "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-vision_ai-v1/lib/google/cloud/vision_ai/v1/health_check_service/paths.rb b/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/health_check_service/paths.rb new file mode 100644 index 000000000000..8baa8c07a953 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/health_check_service/paths.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! + + +module Google + module Cloud + module VisionAI + module V1 + module HealthCheckService + # Path helper methods for the HealthCheckService API. + module Paths + ## + # Create a fully-qualified Cluster resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/clusters/{cluster}` + # + # @param project [String] + # @param location [String] + # @param cluster [String] + # + # @return [::String] + def cluster_path project:, location:, cluster: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/clusters/#{cluster}" + end + + extend self + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/health_check_service/rest.rb b/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/health_check_service/rest.rb new file mode 100644 index 000000000000..8e39a033aae1 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/health_check_service/rest.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! + +require "gapic/rest" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/vision_ai/v1/version" +require "google/cloud/vision_ai/v1/bindings_override" + +require "google/cloud/vision_ai/v1/health_check_service/credentials" +require "google/cloud/vision_ai/v1/health_check_service/paths" +require "google/cloud/vision_ai/v1/health_check_service/rest/client" + +module Google + module Cloud + module VisionAI + module V1 + ## + # HealthCheckService provides an interface for Vertex AI Vision Cluster Health + # Check. + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/vision_ai/v1/health_check_service/rest" + # client = ::Google::Cloud::VisionAI::V1::HealthCheckService::Rest::Client.new + # + module HealthCheckService + # Client for the REST transport + module Rest + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "rest", "helpers.rb" +require "google/cloud/vision_ai/v1/health_check_service/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/health_check_service/rest/client.rb b/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/health_check_service/rest/client.rb new file mode 100644 index 000000000000..b6e0616c6227 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/health_check_service/rest/client.rb @@ -0,0 +1,465 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/visionai/v1/health_service_pb" +require "google/cloud/vision_ai/v1/health_check_service/rest/service_stub" +require "google/cloud/location/rest" +require "google/iam/v1/rest" + +module Google + module Cloud + module VisionAI + module V1 + module HealthCheckService + module Rest + ## + # REST client for the HealthCheckService service. + # + # HealthCheckService provides an interface for Vertex AI Vision Cluster Health + # Check. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "visionai.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :health_check_service_stub + + ## + # Configure the HealthCheckService Client class. + # + # See {::Google::Cloud::VisionAI::V1::HealthCheckService::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all HealthCheckService clients + # ::Google::Cloud::VisionAI::V1::HealthCheckService::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", "VisionAI", "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 + end + yield @configure if block_given? + @configure + end + + ## + # Configure the HealthCheckService 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::VisionAI::V1::HealthCheckService::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 + @health_check_service_stub.universe_domain + end + + ## + # Create a new HealthCheckService REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::VisionAI::V1::HealthCheckService::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::VisionAI::V1::HealthCheckService::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the HealthCheckService 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 + + @health_check_service_stub = ::Google::Cloud::VisionAI::V1::HealthCheckService::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials, + logger: @config.logger + ) + + @health_check_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 = @health_check_service_stub.endpoint + config.universe_domain = @health_check_service_stub.universe_domain + config.bindings_override = @config.bindings_override + config.logger = @health_check_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 = @health_check_service_stub.endpoint + config.universe_domain = @health_check_service_stub.universe_domain + config.logger = @health_check_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 + @health_check_service_stub.logger + end + + # Service calls + + ## + # HealthCheck method checks the health status of the cluster. + # + # @overload health_check(request, options = nil) + # Pass arguments to `health_check` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::HealthCheckRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::HealthCheckRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload health_check(cluster: nil) + # Pass arguments to `health_check` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param cluster [::String] + # The parent of the resource. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::VisionAI::V1::HealthCheckResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::VisionAI::V1::HealthCheckResponse] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::HealthCheckService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::HealthCheckRequest.new + # + # # Call the health_check method. + # result = client.health_check request + # + # # The returned object is of type Google::Cloud::VisionAI::V1::HealthCheckResponse. + # p result + # + def health_check request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::HealthCheckRequest + + # Converts hash 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.health_check.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::VisionAI::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.health_check.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.health_check.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @health_check_service_stub.health_check 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 HealthCheckService REST API. + # + # This class represents the configuration for HealthCheckService 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::VisionAI::V1::HealthCheckService::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 + # # health_check to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::VisionAI::V1::HealthCheckService::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.health_check.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::VisionAI::V1::HealthCheckService::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.health_check.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 = "visionai.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 HealthCheckService 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 `health_check` + # @return [::Gapic::Config::Method] + # + attr_reader :health_check + + # @private + def initialize parent_rpcs = nil + health_check_config = parent_rpcs.health_check if parent_rpcs.respond_to? :health_check + @health_check = ::Gapic::Config::Method.new health_check_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/health_check_service/rest/service_stub.rb b/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/health_check_service/rest/service_stub.rb new file mode 100644 index 000000000000..a9a836a06e63 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/health_check_service/rest/service_stub.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! + +require "google/cloud/visionai/v1/health_service_pb" + +module Google + module Cloud + module VisionAI + module V1 + module HealthCheckService + module Rest + ## + # REST service stub for the HealthCheckService 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 health_check REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::HealthCheckRequest] + # 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::VisionAI::V1::HealthCheckResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::VisionAI::V1::HealthCheckResponse] + # A result object deserialized from the server's reply + def health_check request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_health_check_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: "health_check", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::VisionAI::V1::HealthCheckResponse.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 health_check REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::HealthCheckRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_health_check_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{cluster}:healthCheck", + matches: [ + ["cluster", %r{^projects/[^/]+/locations/[^/]+/clusters/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/live_video_analytics.rb b/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/live_video_analytics.rb new file mode 100644 index 000000000000..3aa518cd3b87 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/live_video_analytics.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/common" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/vision_ai/v1/version" + +require "google/cloud/vision_ai/v1/live_video_analytics/credentials" +require "google/cloud/vision_ai/v1/live_video_analytics/paths" +require "google/cloud/vision_ai/v1/live_video_analytics/operations" +require "google/cloud/vision_ai/v1/live_video_analytics/client" +require "google/cloud/vision_ai/v1/live_video_analytics/rest" + +module Google + module Cloud + module VisionAI + module V1 + ## + # Service describing handlers for resources. The service enables clients to run + # Live Video Analytics (LVA) on the streaming inputs. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/vision_ai/v1/live_video_analytics" + # client = ::Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/vision_ai/v1/live_video_analytics/rest" + # client = ::Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Rest::Client.new + # + module LiveVideoAnalytics + end + end + end + end +end + +helper_path = ::File.join __dir__, "live_video_analytics", "helpers.rb" +require "google/cloud/vision_ai/v1/live_video_analytics/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/live_video_analytics/client.rb b/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/live_video_analytics/client.rb new file mode 100644 index 000000000000..d22cd5cb8b45 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/live_video_analytics/client.rb @@ -0,0 +1,2423 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/visionai/v1/lva_service_pb" +require "google/cloud/location" +require "google/iam/v1" + +module Google + module Cloud + module VisionAI + module V1 + module LiveVideoAnalytics + ## + # Client for the LiveVideoAnalytics service. + # + # Service describing handlers for resources. The service enables clients to run + # Live Video Analytics (LVA) on the streaming inputs. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "visionai.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :live_video_analytics_stub + + ## + # Configure the LiveVideoAnalytics Client class. + # + # See {::Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all LiveVideoAnalytics clients + # ::Google::Cloud::VisionAI::V1::LiveVideoAnalytics::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", "VisionAI", "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.timeout = 60.0 + default_config.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.list_operators.timeout = 60.0 + + default_config.rpcs.get_operator.timeout = 60.0 + + default_config.rpcs.create_operator.timeout = 300.0 + + default_config.rpcs.update_operator.timeout = 60.0 + + default_config.rpcs.delete_operator.timeout = 60.0 + + default_config.rpcs.list_analyses.timeout = 60.0 + + default_config.rpcs.get_analysis.timeout = 60.0 + + default_config.rpcs.create_analysis.timeout = 300.0 + + default_config.rpcs.update_analysis.timeout = 60.0 + + default_config.rpcs.delete_analysis.timeout = 60.0 + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the LiveVideoAnalytics 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::VisionAI::V1::LiveVideoAnalytics::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 + @live_video_analytics_stub.universe_domain + end + + ## + # Create a new LiveVideoAnalytics client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the LiveVideoAnalytics 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/visionai/v1/lva_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 + + @live_video_analytics_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::VisionAI::V1::LiveVideoAnalytics::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 + ) + + @live_video_analytics_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 = @live_video_analytics_stub.endpoint + config.universe_domain = @live_video_analytics_stub.universe_domain + config.logger = @live_video_analytics_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 = @live_video_analytics_stub.endpoint + config.universe_domain = @live_video_analytics_stub.universe_domain + config.logger = @live_video_analytics_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::VisionAI::V1::LiveVideoAnalytics::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 + @live_video_analytics_stub.logger + end + + # Service calls + + ## + # ListPublicOperators returns all the operators in public registry. + # + # @overload list_public_operators(request, options = nil) + # Pass arguments to `list_public_operators` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::ListPublicOperatorsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::ListPublicOperatorsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_public_operators(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) + # Pass arguments to `list_public_operators` via keyword arguments. Note that at + # least one keyword argument is 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. Parent value for ListPublicOperatorsRequest. + # @param page_size [::Integer] + # Requested page size. Server may return fewer items than requested. + # If unspecified, server will pick an appropriate default. + # @param page_token [::String] + # A token identifying a page of results the server should return. + # @param filter [::String] + # Filtering results. + # @param order_by [::String] + # Hint for how to order the results. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::VisionAI::V1::Operator>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::VisionAI::V1::Operator>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::ListPublicOperatorsRequest.new + # + # # Call the list_public_operators method. + # result = client.list_public_operators 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::VisionAI::V1::Operator. + # p item + # end + # + def list_public_operators request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::ListPublicOperatorsRequest + + # Converts hash 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_public_operators.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::VisionAI::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_public_operators.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_public_operators.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @live_video_analytics_stub.call_rpc :list_public_operators, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @live_video_analytics_stub, :list_public_operators, 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 + + ## + # ResolveOperatorInfo returns the operator information based on the request. + # + # @overload resolve_operator_info(request, options = nil) + # Pass arguments to `resolve_operator_info` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::ResolveOperatorInfoRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::ResolveOperatorInfoRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload resolve_operator_info(parent: nil, queries: nil) + # Pass arguments to `resolve_operator_info` via keyword arguments. Note that at + # least one keyword argument is 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. Parent value for ResolveOperatorInfoRequest. + # @param queries [::Array<::Google::Cloud::VisionAI::V1::OperatorQuery, ::Hash>] + # Required. The operator queries. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::VisionAI::V1::ResolveOperatorInfoResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::VisionAI::V1::ResolveOperatorInfoResponse] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::ResolveOperatorInfoRequest.new + # + # # Call the resolve_operator_info method. + # result = client.resolve_operator_info request + # + # # The returned object is of type Google::Cloud::VisionAI::V1::ResolveOperatorInfoResponse. + # p result + # + def resolve_operator_info request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::ResolveOperatorInfoRequest + + # Converts hash 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.resolve_operator_info.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::VisionAI::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.resolve_operator_info.timeout, + metadata: metadata, + retry_policy: @config.rpcs.resolve_operator_info.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @live_video_analytics_stub.call_rpc :resolve_operator_info, 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 Operators in a given project and location. + # + # @overload list_operators(request, options = nil) + # Pass arguments to `list_operators` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::ListOperatorsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::ListOperatorsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_operators(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) + # Pass arguments to `list_operators` via keyword arguments. Note that at + # least one keyword argument is 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. Parent value for ListOperatorsRequest. + # @param page_size [::Integer] + # Requested page size. Server may return fewer items than requested. + # If unspecified, server will pick an appropriate default. + # @param page_token [::String] + # A token identifying a page of results the server should return. + # @param filter [::String] + # Filtering results. + # @param order_by [::String] + # Hint for how to order the results. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::VisionAI::V1::Operator>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::VisionAI::V1::Operator>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::ListOperatorsRequest.new + # + # # Call the list_operators method. + # result = client.list_operators 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::VisionAI::V1::Operator. + # p item + # end + # + def list_operators request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::ListOperatorsRequest + + # Converts hash 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_operators.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::VisionAI::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_operators.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_operators.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @live_video_analytics_stub.call_rpc :list_operators, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @live_video_analytics_stub, :list_operators, 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 + + ## + # Gets details of a single Operator. + # + # @overload get_operator(request, options = nil) + # Pass arguments to `get_operator` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::GetOperatorRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::GetOperatorRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_operator(name: nil) + # Pass arguments to `get_operator` via keyword arguments. Note that at + # least one keyword argument is 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 resource. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::VisionAI::V1::Operator] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::VisionAI::V1::Operator] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::GetOperatorRequest.new + # + # # Call the get_operator method. + # result = client.get_operator request + # + # # The returned object is of type Google::Cloud::VisionAI::V1::Operator. + # p result + # + def get_operator request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::GetOperatorRequest + + # Converts hash 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_operator.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::VisionAI::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_operator.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_operator.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @live_video_analytics_stub.call_rpc :get_operator, 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 Operator in a given project and location. + # + # @overload create_operator(request, options = nil) + # Pass arguments to `create_operator` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::CreateOperatorRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::CreateOperatorRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_operator(parent: nil, operator_id: nil, operator: nil, request_id: nil) + # Pass arguments to `create_operator` via keyword arguments. Note that at + # least one keyword argument is 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. Value for parent. + # @param operator_id [::String] + # Required. Id of the requesting object. + # @param operator [::Google::Cloud::VisionAI::V1::Operator, ::Hash] + # Required. The resource being created. + # @param request_id [::String] + # Optional. An optional request ID to identify requests. Specify a unique + # request ID so that if you must retry your request, the server will know to + # ignore the request if it has already been completed. The server will + # guarantee that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request ID, + # the server can check if original operation with the same request ID was + # received, and if so, will ignore the second request. This prevents clients + # from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # + # @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/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::CreateOperatorRequest.new + # + # # Call the create_operator method. + # result = client.create_operator 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_operator request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::CreateOperatorRequest + + # Converts hash 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_operator.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::VisionAI::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_operator.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_operator.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @live_video_analytics_stub.call_rpc :create_operator, 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 + + ## + # Updates the parameters of a single Operator. + # + # @overload update_operator(request, options = nil) + # Pass arguments to `update_operator` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::UpdateOperatorRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::UpdateOperatorRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_operator(update_mask: nil, operator: nil, request_id: nil) + # Pass arguments to `update_operator` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. Field mask is used to specify the fields to be overwritten in the + # Operator resource by the update. + # The fields specified in the update_mask are relative to the resource, not + # the full request. A field will be overwritten if it is in the mask. If the + # user does not provide a mask then all fields will be overwritten. + # @param operator [::Google::Cloud::VisionAI::V1::Operator, ::Hash] + # Required. The resource being updated + # @param request_id [::String] + # Optional. An optional request ID to identify requests. Specify a unique + # request ID so that if you must retry your request, the server will know to + # ignore the request if it has already been completed. The server will + # guarantee that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request ID, + # the server can check if original operation with the same request ID was + # received, and if so, will ignore the second request. This prevents clients + # from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # + # @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/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::UpdateOperatorRequest.new + # + # # Call the update_operator method. + # result = client.update_operator 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 update_operator request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::UpdateOperatorRequest + + # Converts hash 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_operator.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::VisionAI::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.operator&.name + header_params["operator.name"] = request.operator.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_operator.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_operator.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @live_video_analytics_stub.call_rpc :update_operator, 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 single Operator. + # + # @overload delete_operator(request, options = nil) + # Pass arguments to `delete_operator` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::DeleteOperatorRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::DeleteOperatorRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_operator(name: nil, request_id: nil) + # Pass arguments to `delete_operator` via keyword arguments. Note that at + # least one keyword argument is 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 resource + # @param request_id [::String] + # Optional. An optional request ID to identify requests. Specify a unique + # request ID so that if you must retry your request, the server will know to + # ignore the request if it has already been completed. The server will + # guarantee that for at least 60 minutes after the first request. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request ID, + # the server can check if original operation with the same request ID was + # received, and if so, will ignore the second request. This prevents clients + # from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # + # @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/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::DeleteOperatorRequest.new + # + # # Call the delete_operator method. + # result = client.delete_operator 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_operator request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::DeleteOperatorRequest + + # Converts hash 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_operator.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::VisionAI::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_operator.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_operator.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @live_video_analytics_stub.call_rpc :delete_operator, 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 + + ## + # Lists Analyses in a given project and location. + # + # @overload list_analyses(request, options = nil) + # Pass arguments to `list_analyses` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::ListAnalysesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::ListAnalysesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_analyses(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) + # Pass arguments to `list_analyses` via keyword arguments. Note that at + # least one keyword argument is 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. Parent value for ListAnalysesRequest + # @param page_size [::Integer] + # Requested page size. Server may return fewer items than requested. + # If unspecified, server will pick an appropriate default. + # @param page_token [::String] + # A token identifying a page of results the server should return. + # @param filter [::String] + # Filtering results + # @param order_by [::String] + # Hint for how to order the results + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::VisionAI::V1::Analysis>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::VisionAI::V1::Analysis>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::ListAnalysesRequest.new + # + # # Call the list_analyses method. + # result = client.list_analyses 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::VisionAI::V1::Analysis. + # p item + # end + # + def list_analyses request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::ListAnalysesRequest + + # Converts hash 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_analyses.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::VisionAI::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_analyses.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_analyses.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @live_video_analytics_stub.call_rpc :list_analyses, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @live_video_analytics_stub, :list_analyses, 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 + + ## + # Gets details of a single Analysis. + # + # @overload get_analysis(request, options = nil) + # Pass arguments to `get_analysis` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::GetAnalysisRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::GetAnalysisRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_analysis(name: nil) + # Pass arguments to `get_analysis` via keyword arguments. Note that at + # least one keyword argument is 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 resource. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::VisionAI::V1::Analysis] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::VisionAI::V1::Analysis] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::GetAnalysisRequest.new + # + # # Call the get_analysis method. + # result = client.get_analysis request + # + # # The returned object is of type Google::Cloud::VisionAI::V1::Analysis. + # p result + # + def get_analysis request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::GetAnalysisRequest + + # Converts hash 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_analysis.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::VisionAI::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_analysis.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_analysis.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @live_video_analytics_stub.call_rpc :get_analysis, 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 Analysis in a given project and location. + # + # @overload create_analysis(request, options = nil) + # Pass arguments to `create_analysis` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::CreateAnalysisRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::CreateAnalysisRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_analysis(parent: nil, analysis_id: nil, analysis: nil, request_id: nil) + # Pass arguments to `create_analysis` via keyword arguments. Note that at + # least one keyword argument is 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. Value for parent. + # @param analysis_id [::String] + # Required. Id of the requesting object. + # @param analysis [::Google::Cloud::VisionAI::V1::Analysis, ::Hash] + # Required. The resource being created. + # @param request_id [::String] + # Optional. An optional request ID to identify requests. Specify a unique + # request ID so that if you must retry your request, the server will know to + # ignore the request if it has already been completed. The server will + # guarantee that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request ID, + # the server can check if original operation with the same request ID was + # received, and if so, will ignore the second request. This prevents clients + # from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # + # @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/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::CreateAnalysisRequest.new + # + # # Call the create_analysis method. + # result = client.create_analysis 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_analysis request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::CreateAnalysisRequest + + # Converts hash 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_analysis.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::VisionAI::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_analysis.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_analysis.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @live_video_analytics_stub.call_rpc :create_analysis, 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 + + ## + # Updates the parameters of a single Analysis. + # + # @overload update_analysis(request, options = nil) + # Pass arguments to `update_analysis` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::UpdateAnalysisRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::UpdateAnalysisRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_analysis(update_mask: nil, analysis: nil, request_id: nil) + # Pass arguments to `update_analysis` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. Field mask is used to specify the fields to be overwritten in the + # Analysis resource by the update. + # The fields specified in the update_mask are relative to the resource, not + # the full request. A field will be overwritten if it is in the mask. If the + # user does not provide a mask then all fields will be overwritten. + # @param analysis [::Google::Cloud::VisionAI::V1::Analysis, ::Hash] + # Required. The resource being updated. + # @param request_id [::String] + # Optional. An optional request ID to identify requests. Specify a unique + # request ID so that if you must retry your request, the server will know to + # ignore the request if it has already been completed. The server will + # guarantee that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request ID, + # the server can check if original operation with the same request ID was + # received, and if so, will ignore the second request. This prevents clients + # from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # + # @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/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::UpdateAnalysisRequest.new + # + # # Call the update_analysis method. + # result = client.update_analysis 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 update_analysis request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::UpdateAnalysisRequest + + # Converts hash 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_analysis.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::VisionAI::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.analysis&.name + header_params["analysis.name"] = request.analysis.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_analysis.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_analysis.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @live_video_analytics_stub.call_rpc :update_analysis, 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 single Analysis. + # + # @overload delete_analysis(request, options = nil) + # Pass arguments to `delete_analysis` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::DeleteAnalysisRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::DeleteAnalysisRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_analysis(name: nil, request_id: nil) + # Pass arguments to `delete_analysis` via keyword arguments. Note that at + # least one keyword argument is 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 resource. + # @param request_id [::String] + # Optional. An optional request ID to identify requests. Specify a unique + # request ID so that if you must retry your request, the server will know to + # ignore the request if it has already been completed. The server will + # guarantee that for at least 60 minutes after the first request. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request ID, + # the server can check if original operation with the same request ID was + # received, and if so, will ignore the second request. This prevents clients + # from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # + # @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/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::DeleteAnalysisRequest.new + # + # # Call the delete_analysis method. + # result = client.delete_analysis 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_analysis request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::DeleteAnalysisRequest + + # Converts hash 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_analysis.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::VisionAI::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_analysis.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_analysis.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @live_video_analytics_stub.call_rpc :delete_analysis, 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 + + ## + # Lists Processes in a given project and location. + # + # @overload list_processes(request, options = nil) + # Pass arguments to `list_processes` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::ListProcessesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::ListProcessesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_processes(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) + # Pass arguments to `list_processes` via keyword arguments. Note that at + # least one keyword argument is 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. Parent value for ListProcessesRequest. + # @param page_size [::Integer] + # Requested page size. Server may return fewer items than requested. + # If unspecified, server will pick an appropriate default. + # @param page_token [::String] + # A token identifying a page of results the server should return. + # @param filter [::String] + # Filtering results + # @param order_by [::String] + # Hint for how to order the results + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::VisionAI::V1::Process>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::VisionAI::V1::Process>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::ListProcessesRequest.new + # + # # Call the list_processes method. + # result = client.list_processes 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::VisionAI::V1::Process. + # p item + # end + # + def list_processes request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::ListProcessesRequest + + # Converts hash 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_processes.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::VisionAI::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_processes.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_processes.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @live_video_analytics_stub.call_rpc :list_processes, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @live_video_analytics_stub, :list_processes, 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 + + ## + # Gets details of a single Process. + # + # @overload get_process(request, options = nil) + # Pass arguments to `get_process` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::GetProcessRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::GetProcessRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_process(name: nil) + # Pass arguments to `get_process` via keyword arguments. Note that at + # least one keyword argument is 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 resource. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::VisionAI::V1::Process] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::VisionAI::V1::Process] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::GetProcessRequest.new + # + # # Call the get_process method. + # result = client.get_process request + # + # # The returned object is of type Google::Cloud::VisionAI::V1::Process. + # p result + # + def get_process request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::GetProcessRequest + + # Converts hash 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_process.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::VisionAI::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_process.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_process.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @live_video_analytics_stub.call_rpc :get_process, 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 Process in a given project and location. + # + # @overload create_process(request, options = nil) + # Pass arguments to `create_process` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::CreateProcessRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::CreateProcessRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_process(parent: nil, process_id: nil, process: nil, request_id: nil) + # Pass arguments to `create_process` via keyword arguments. Note that at + # least one keyword argument is 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. Value for parent. + # @param process_id [::String] + # Required. Id of the requesting object. + # @param process [::Google::Cloud::VisionAI::V1::Process, ::Hash] + # Required. The resource being created. + # @param request_id [::String] + # Optional. An optional request ID to identify requests. Specify a unique + # request ID so that if you must retry your request, the server will know to + # ignore the request if it has already been completed. The server will + # guarantee that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request ID, + # the server can check if original operation with the same request ID was + # received, and if so, will ignore the second request. This prevents clients + # from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # + # @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/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::CreateProcessRequest.new + # + # # Call the create_process method. + # result = client.create_process 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_process request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::CreateProcessRequest + + # Converts hash 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_process.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::VisionAI::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_process.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_process.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @live_video_analytics_stub.call_rpc :create_process, 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 + + ## + # Updates the parameters of a single Process. + # + # @overload update_process(request, options = nil) + # Pass arguments to `update_process` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::UpdateProcessRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::UpdateProcessRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_process(update_mask: nil, process: nil, request_id: nil) + # Pass arguments to `update_process` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. Field mask is used to specify the fields to be overwritten in the + # Process resource by the update. + # The fields specified in the update_mask are relative to the resource, not + # the full request. A field will be overwritten if it is in the mask. If the + # user does not provide a mask then all fields will be overwritten. + # @param process [::Google::Cloud::VisionAI::V1::Process, ::Hash] + # Required. The resource being updated. + # @param request_id [::String] + # Optional. An optional request ID to identify requests. Specify a unique + # request ID so that if you must retry your request, the server will know to + # ignore the request if it has already been completed. The server will + # guarantee that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request ID, + # the server can check if original operation with the same request ID was + # received, and if so, will ignore the second request. This prevents clients + # from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # + # @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/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::UpdateProcessRequest.new + # + # # Call the update_process method. + # result = client.update_process 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 update_process request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::UpdateProcessRequest + + # Converts hash 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_process.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::VisionAI::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.process&.name + header_params["process.name"] = request.process.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_process.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_process.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @live_video_analytics_stub.call_rpc :update_process, 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 single Process. + # + # @overload delete_process(request, options = nil) + # Pass arguments to `delete_process` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::DeleteProcessRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::DeleteProcessRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_process(name: nil, request_id: nil) + # Pass arguments to `delete_process` via keyword arguments. Note that at + # least one keyword argument is 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 resource. + # @param request_id [::String] + # Optional. An optional request ID to identify requests. Specify a unique + # request ID so that if you must retry your request, the server will know to + # ignore the request if it has already been completed. The server will + # guarantee that for at least 60 minutes after the first request. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request ID, + # the server can check if original operation with the same request ID was + # received, and if so, will ignore the second request. This prevents clients + # from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # + # @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/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::DeleteProcessRequest.new + # + # # Call the delete_process method. + # result = client.delete_process 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_process request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::DeleteProcessRequest + + # Converts hash 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_process.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::VisionAI::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_process.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_process.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @live_video_analytics_stub.call_rpc :delete_process, 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 + + ## + # Run all of the processes to "completion". Max time for each process is + # the LRO time limit. + # + # @overload batch_run_process(request, options = nil) + # Pass arguments to `batch_run_process` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::BatchRunProcessRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::BatchRunProcessRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload batch_run_process(parent: nil, requests: nil, options: nil) + # Pass arguments to `batch_run_process` via keyword arguments. Note that at + # least one keyword argument is 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 parent resource shared by all processes being created. + # @param requests [::Array<::Google::Cloud::VisionAI::V1::CreateProcessRequest, ::Hash>] + # Required. The create process requests. + # @param options [::Google::Cloud::VisionAI::V1::BatchRunProcessRequest::BatchRunProcessOptions, ::Hash] + # Optional. Options for batch processes. + # + # @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/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::BatchRunProcessRequest.new + # + # # Call the batch_run_process method. + # result = client.batch_run_process 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 batch_run_process request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::BatchRunProcessRequest + + # Converts hash 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.batch_run_process.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::VisionAI::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.batch_run_process.timeout, + metadata: metadata, + retry_policy: @config.rpcs.batch_run_process.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @live_video_analytics_stub.call_rpc :batch_run_process, 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 LiveVideoAnalytics API. + # + # This class represents the configuration for LiveVideoAnalytics, + # 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::VisionAI::V1::LiveVideoAnalytics::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_public_operators to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_public_operators.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_public_operators.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::VisionAI::V1::LiveVideoAnalytics::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 = "visionai.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 LiveVideoAnalytics 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_public_operators` + # @return [::Gapic::Config::Method] + # + attr_reader :list_public_operators + ## + # RPC-specific configuration for `resolve_operator_info` + # @return [::Gapic::Config::Method] + # + attr_reader :resolve_operator_info + ## + # RPC-specific configuration for `list_operators` + # @return [::Gapic::Config::Method] + # + attr_reader :list_operators + ## + # RPC-specific configuration for `get_operator` + # @return [::Gapic::Config::Method] + # + attr_reader :get_operator + ## + # RPC-specific configuration for `create_operator` + # @return [::Gapic::Config::Method] + # + attr_reader :create_operator + ## + # RPC-specific configuration for `update_operator` + # @return [::Gapic::Config::Method] + # + attr_reader :update_operator + ## + # RPC-specific configuration for `delete_operator` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_operator + ## + # RPC-specific configuration for `list_analyses` + # @return [::Gapic::Config::Method] + # + attr_reader :list_analyses + ## + # RPC-specific configuration for `get_analysis` + # @return [::Gapic::Config::Method] + # + attr_reader :get_analysis + ## + # RPC-specific configuration for `create_analysis` + # @return [::Gapic::Config::Method] + # + attr_reader :create_analysis + ## + # RPC-specific configuration for `update_analysis` + # @return [::Gapic::Config::Method] + # + attr_reader :update_analysis + ## + # RPC-specific configuration for `delete_analysis` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_analysis + ## + # RPC-specific configuration for `list_processes` + # @return [::Gapic::Config::Method] + # + attr_reader :list_processes + ## + # RPC-specific configuration for `get_process` + # @return [::Gapic::Config::Method] + # + attr_reader :get_process + ## + # RPC-specific configuration for `create_process` + # @return [::Gapic::Config::Method] + # + attr_reader :create_process + ## + # RPC-specific configuration for `update_process` + # @return [::Gapic::Config::Method] + # + attr_reader :update_process + ## + # RPC-specific configuration for `delete_process` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_process + ## + # RPC-specific configuration for `batch_run_process` + # @return [::Gapic::Config::Method] + # + attr_reader :batch_run_process + + # @private + def initialize parent_rpcs = nil + list_public_operators_config = parent_rpcs.list_public_operators if parent_rpcs.respond_to? :list_public_operators + @list_public_operators = ::Gapic::Config::Method.new list_public_operators_config + resolve_operator_info_config = parent_rpcs.resolve_operator_info if parent_rpcs.respond_to? :resolve_operator_info + @resolve_operator_info = ::Gapic::Config::Method.new resolve_operator_info_config + list_operators_config = parent_rpcs.list_operators if parent_rpcs.respond_to? :list_operators + @list_operators = ::Gapic::Config::Method.new list_operators_config + get_operator_config = parent_rpcs.get_operator if parent_rpcs.respond_to? :get_operator + @get_operator = ::Gapic::Config::Method.new get_operator_config + create_operator_config = parent_rpcs.create_operator if parent_rpcs.respond_to? :create_operator + @create_operator = ::Gapic::Config::Method.new create_operator_config + update_operator_config = parent_rpcs.update_operator if parent_rpcs.respond_to? :update_operator + @update_operator = ::Gapic::Config::Method.new update_operator_config + delete_operator_config = parent_rpcs.delete_operator if parent_rpcs.respond_to? :delete_operator + @delete_operator = ::Gapic::Config::Method.new delete_operator_config + list_analyses_config = parent_rpcs.list_analyses if parent_rpcs.respond_to? :list_analyses + @list_analyses = ::Gapic::Config::Method.new list_analyses_config + get_analysis_config = parent_rpcs.get_analysis if parent_rpcs.respond_to? :get_analysis + @get_analysis = ::Gapic::Config::Method.new get_analysis_config + create_analysis_config = parent_rpcs.create_analysis if parent_rpcs.respond_to? :create_analysis + @create_analysis = ::Gapic::Config::Method.new create_analysis_config + update_analysis_config = parent_rpcs.update_analysis if parent_rpcs.respond_to? :update_analysis + @update_analysis = ::Gapic::Config::Method.new update_analysis_config + delete_analysis_config = parent_rpcs.delete_analysis if parent_rpcs.respond_to? :delete_analysis + @delete_analysis = ::Gapic::Config::Method.new delete_analysis_config + list_processes_config = parent_rpcs.list_processes if parent_rpcs.respond_to? :list_processes + @list_processes = ::Gapic::Config::Method.new list_processes_config + get_process_config = parent_rpcs.get_process if parent_rpcs.respond_to? :get_process + @get_process = ::Gapic::Config::Method.new get_process_config + create_process_config = parent_rpcs.create_process if parent_rpcs.respond_to? :create_process + @create_process = ::Gapic::Config::Method.new create_process_config + update_process_config = parent_rpcs.update_process if parent_rpcs.respond_to? :update_process + @update_process = ::Gapic::Config::Method.new update_process_config + delete_process_config = parent_rpcs.delete_process if parent_rpcs.respond_to? :delete_process + @delete_process = ::Gapic::Config::Method.new delete_process_config + batch_run_process_config = parent_rpcs.batch_run_process if parent_rpcs.respond_to? :batch_run_process + @batch_run_process = ::Gapic::Config::Method.new batch_run_process_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/live_video_analytics/credentials.rb b/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/live_video_analytics/credentials.rb new file mode 100644 index 000000000000..b31bd3fb9b7b --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/live_video_analytics/credentials.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! + +require "googleauth" + +module Google + module Cloud + module VisionAI + module V1 + module LiveVideoAnalytics + # Credentials for the LiveVideoAnalytics API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/cloud-platform" + ] + self.env_vars = [ + "GOOGLE_CLOUD_CREDENTIALS", + "GOOGLE_CLOUD_KEYFILE", + "GCLOUD_KEYFILE", + "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-vision_ai-v1/lib/google/cloud/vision_ai/v1/live_video_analytics/operations.rb b/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/live_video_analytics/operations.rb new file mode 100644 index 000000000000..b82f7a9ba07a --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/live_video_analytics/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 VisionAI + module V1 + module LiveVideoAnalytics + # Service that implements Longrunning Operations API. + class Operations + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "visionai.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :operations_stub + + ## + # Configuration for the LiveVideoAnalytics 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 LiveVideoAnalytics 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::VisionAI::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::VisionAI::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::VisionAI::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::VisionAI::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::VisionAI::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 = "visionai.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-vision_ai-v1/lib/google/cloud/vision_ai/v1/live_video_analytics/paths.rb b/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/live_video_analytics/paths.rb new file mode 100644 index 000000000000..ee3aa6e57557 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/live_video_analytics/paths.rb @@ -0,0 +1,130 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 VisionAI + module V1 + module LiveVideoAnalytics + # Path helper methods for the LiveVideoAnalytics API. + module Paths + ## + # Create a fully-qualified Analysis resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/clusters/{cluster}/analyses/{analysis}` + # + # @param project [String] + # @param location [String] + # @param cluster [String] + # @param analysis [String] + # + # @return [::String] + def analysis_path project:, location:, cluster:, analysis: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "cluster cannot contain /" if cluster.to_s.include? "/" + + "projects/#{project}/locations/#{location}/clusters/#{cluster}/analyses/#{analysis}" + end + + ## + # Create a fully-qualified Cluster resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/clusters/{cluster}` + # + # @param project [String] + # @param location [String] + # @param cluster [String] + # + # @return [::String] + def cluster_path project:, location:, cluster: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/clusters/#{cluster}" + 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 Operator resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/operators/{operator}` + # + # @param project [String] + # @param location [String] + # @param operator [String] + # + # @return [::String] + def operator_path project:, location:, operator: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/operators/#{operator}" + end + + ## + # Create a fully-qualified Process resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/clusters/{cluster}/processes/{process}` + # + # @param project [String] + # @param location [String] + # @param cluster [String] + # @param process [String] + # + # @return [::String] + def process_path project:, location:, cluster:, process: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "cluster cannot contain /" if cluster.to_s.include? "/" + + "projects/#{project}/locations/#{location}/clusters/#{cluster}/processes/#{process}" + end + + extend self + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/live_video_analytics/rest.rb b/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/live_video_analytics/rest.rb new file mode 100644 index 000000000000..6e2749651b4a --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/live_video_analytics/rest.rb @@ -0,0 +1,55 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/vision_ai/v1/version" +require "google/cloud/vision_ai/v1/bindings_override" + +require "google/cloud/vision_ai/v1/live_video_analytics/credentials" +require "google/cloud/vision_ai/v1/live_video_analytics/paths" +require "google/cloud/vision_ai/v1/live_video_analytics/rest/operations" +require "google/cloud/vision_ai/v1/live_video_analytics/rest/client" + +module Google + module Cloud + module VisionAI + module V1 + ## + # Service describing handlers for resources. The service enables clients to run + # Live Video Analytics (LVA) on the streaming inputs. + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/vision_ai/v1/live_video_analytics/rest" + # client = ::Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Rest::Client.new + # + module LiveVideoAnalytics + # Client for the REST transport + module Rest + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "rest", "helpers.rb" +require "google/cloud/vision_ai/v1/live_video_analytics/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/live_video_analytics/rest/client.rb b/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/live_video_analytics/rest/client.rb new file mode 100644 index 000000000000..1cb8ade2dfbc --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/live_video_analytics/rest/client.rb @@ -0,0 +1,2262 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/visionai/v1/lva_service_pb" +require "google/cloud/vision_ai/v1/live_video_analytics/rest/service_stub" +require "google/cloud/location/rest" +require "google/iam/v1/rest" + +module Google + module Cloud + module VisionAI + module V1 + module LiveVideoAnalytics + module Rest + ## + # REST client for the LiveVideoAnalytics service. + # + # Service describing handlers for resources. The service enables clients to run + # Live Video Analytics (LVA) on the streaming inputs. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "visionai.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :live_video_analytics_stub + + ## + # Configure the LiveVideoAnalytics Client class. + # + # See {::Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all LiveVideoAnalytics clients + # ::Google::Cloud::VisionAI::V1::LiveVideoAnalytics::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", "VisionAI", "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.timeout = 60.0 + default_config.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.list_operators.timeout = 60.0 + + default_config.rpcs.get_operator.timeout = 60.0 + + default_config.rpcs.create_operator.timeout = 300.0 + + default_config.rpcs.update_operator.timeout = 60.0 + + default_config.rpcs.delete_operator.timeout = 60.0 + + default_config.rpcs.list_analyses.timeout = 60.0 + + default_config.rpcs.get_analysis.timeout = 60.0 + + default_config.rpcs.create_analysis.timeout = 300.0 + + default_config.rpcs.update_analysis.timeout = 60.0 + + default_config.rpcs.delete_analysis.timeout = 60.0 + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the LiveVideoAnalytics 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::VisionAI::V1::LiveVideoAnalytics::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 + @live_video_analytics_stub.universe_domain + end + + ## + # Create a new LiveVideoAnalytics REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the LiveVideoAnalytics 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::VisionAI::V1::LiveVideoAnalytics::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 + + @live_video_analytics_stub = ::Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials, + logger: @config.logger + ) + + @live_video_analytics_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 = @live_video_analytics_stub.endpoint + config.universe_domain = @live_video_analytics_stub.universe_domain + config.bindings_override = @config.bindings_override + config.logger = @live_video_analytics_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 = @live_video_analytics_stub.endpoint + config.universe_domain = @live_video_analytics_stub.universe_domain + config.logger = @live_video_analytics_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::VisionAI::V1::LiveVideoAnalytics::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 + @live_video_analytics_stub.logger + end + + # Service calls + + ## + # ListPublicOperators returns all the operators in public registry. + # + # @overload list_public_operators(request, options = nil) + # Pass arguments to `list_public_operators` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::ListPublicOperatorsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::ListPublicOperatorsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_public_operators(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) + # Pass arguments to `list_public_operators` via keyword arguments. Note that at + # least one keyword argument is 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. Parent value for ListPublicOperatorsRequest. + # @param page_size [::Integer] + # Requested page size. Server may return fewer items than requested. + # If unspecified, server will pick an appropriate default. + # @param page_token [::String] + # A token identifying a page of results the server should return. + # @param filter [::String] + # Filtering results. + # @param order_by [::String] + # Hint for how to order the results. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::VisionAI::V1::Operator>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::VisionAI::V1::Operator>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::ListPublicOperatorsRequest.new + # + # # Call the list_public_operators method. + # result = client.list_public_operators 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::VisionAI::V1::Operator. + # p item + # end + # + def list_public_operators request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::ListPublicOperatorsRequest + + # Converts hash 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_public_operators.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::VisionAI::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_public_operators.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_public_operators.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @live_video_analytics_stub.list_public_operators request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @live_video_analytics_stub, :list_public_operators, "operators", 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 + + ## + # ResolveOperatorInfo returns the operator information based on the request. + # + # @overload resolve_operator_info(request, options = nil) + # Pass arguments to `resolve_operator_info` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::ResolveOperatorInfoRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::ResolveOperatorInfoRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload resolve_operator_info(parent: nil, queries: nil) + # Pass arguments to `resolve_operator_info` via keyword arguments. Note that at + # least one keyword argument is 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. Parent value for ResolveOperatorInfoRequest. + # @param queries [::Array<::Google::Cloud::VisionAI::V1::OperatorQuery, ::Hash>] + # Required. The operator queries. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::VisionAI::V1::ResolveOperatorInfoResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::VisionAI::V1::ResolveOperatorInfoResponse] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::ResolveOperatorInfoRequest.new + # + # # Call the resolve_operator_info method. + # result = client.resolve_operator_info request + # + # # The returned object is of type Google::Cloud::VisionAI::V1::ResolveOperatorInfoResponse. + # p result + # + def resolve_operator_info request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::ResolveOperatorInfoRequest + + # Converts hash 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.resolve_operator_info.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::VisionAI::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.resolve_operator_info.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.resolve_operator_info.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @live_video_analytics_stub.resolve_operator_info 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 Operators in a given project and location. + # + # @overload list_operators(request, options = nil) + # Pass arguments to `list_operators` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::ListOperatorsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::ListOperatorsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_operators(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) + # Pass arguments to `list_operators` via keyword arguments. Note that at + # least one keyword argument is 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. Parent value for ListOperatorsRequest. + # @param page_size [::Integer] + # Requested page size. Server may return fewer items than requested. + # If unspecified, server will pick an appropriate default. + # @param page_token [::String] + # A token identifying a page of results the server should return. + # @param filter [::String] + # Filtering results. + # @param order_by [::String] + # Hint for how to order the results. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::VisionAI::V1::Operator>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::VisionAI::V1::Operator>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::ListOperatorsRequest.new + # + # # Call the list_operators method. + # result = client.list_operators 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::VisionAI::V1::Operator. + # p item + # end + # + def list_operators request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::ListOperatorsRequest + + # Converts hash 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_operators.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::VisionAI::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_operators.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_operators.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @live_video_analytics_stub.list_operators request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @live_video_analytics_stub, :list_operators, "operators", 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 details of a single Operator. + # + # @overload get_operator(request, options = nil) + # Pass arguments to `get_operator` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::GetOperatorRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::GetOperatorRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_operator(name: nil) + # Pass arguments to `get_operator` via keyword arguments. Note that at + # least one keyword argument is 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 resource. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::VisionAI::V1::Operator] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::VisionAI::V1::Operator] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::GetOperatorRequest.new + # + # # Call the get_operator method. + # result = client.get_operator request + # + # # The returned object is of type Google::Cloud::VisionAI::V1::Operator. + # p result + # + def get_operator request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::GetOperatorRequest + + # Converts hash 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_operator.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::VisionAI::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_operator.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_operator.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @live_video_analytics_stub.get_operator 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 Operator in a given project and location. + # + # @overload create_operator(request, options = nil) + # Pass arguments to `create_operator` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::CreateOperatorRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::CreateOperatorRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_operator(parent: nil, operator_id: nil, operator: nil, request_id: nil) + # Pass arguments to `create_operator` via keyword arguments. Note that at + # least one keyword argument is 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. Value for parent. + # @param operator_id [::String] + # Required. Id of the requesting object. + # @param operator [::Google::Cloud::VisionAI::V1::Operator, ::Hash] + # Required. The resource being created. + # @param request_id [::String] + # Optional. An optional request ID to identify requests. Specify a unique + # request ID so that if you must retry your request, the server will know to + # ignore the request if it has already been completed. The server will + # guarantee that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request ID, + # the server can check if original operation with the same request ID was + # received, and if so, will ignore the second request. This prevents clients + # from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @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/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::CreateOperatorRequest.new + # + # # Call the create_operator method. + # result = client.create_operator 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_operator request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::CreateOperatorRequest + + # Converts hash 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_operator.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::VisionAI::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_operator.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_operator.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @live_video_analytics_stub.create_operator 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 + + ## + # Updates the parameters of a single Operator. + # + # @overload update_operator(request, options = nil) + # Pass arguments to `update_operator` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::UpdateOperatorRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::UpdateOperatorRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_operator(update_mask: nil, operator: nil, request_id: nil) + # Pass arguments to `update_operator` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. Field mask is used to specify the fields to be overwritten in the + # Operator resource by the update. + # The fields specified in the update_mask are relative to the resource, not + # the full request. A field will be overwritten if it is in the mask. If the + # user does not provide a mask then all fields will be overwritten. + # @param operator [::Google::Cloud::VisionAI::V1::Operator, ::Hash] + # Required. The resource being updated + # @param request_id [::String] + # Optional. An optional request ID to identify requests. Specify a unique + # request ID so that if you must retry your request, the server will know to + # ignore the request if it has already been completed. The server will + # guarantee that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request ID, + # the server can check if original operation with the same request ID was + # received, and if so, will ignore the second request. This prevents clients + # from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @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/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::UpdateOperatorRequest.new + # + # # Call the update_operator method. + # result = client.update_operator 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 update_operator request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::UpdateOperatorRequest + + # Converts hash 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_operator.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::VisionAI::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_operator.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_operator.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @live_video_analytics_stub.update_operator 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 single Operator. + # + # @overload delete_operator(request, options = nil) + # Pass arguments to `delete_operator` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::DeleteOperatorRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::DeleteOperatorRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_operator(name: nil, request_id: nil) + # Pass arguments to `delete_operator` via keyword arguments. Note that at + # least one keyword argument is 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 resource + # @param request_id [::String] + # Optional. An optional request ID to identify requests. Specify a unique + # request ID so that if you must retry your request, the server will know to + # ignore the request if it has already been completed. The server will + # guarantee that for at least 60 minutes after the first request. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request ID, + # the server can check if original operation with the same request ID was + # received, and if so, will ignore the second request. This prevents clients + # from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @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/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::DeleteOperatorRequest.new + # + # # Call the delete_operator method. + # result = client.delete_operator 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_operator request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::DeleteOperatorRequest + + # Converts hash 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_operator.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::VisionAI::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_operator.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_operator.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @live_video_analytics_stub.delete_operator 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 + + ## + # Lists Analyses in a given project and location. + # + # @overload list_analyses(request, options = nil) + # Pass arguments to `list_analyses` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::ListAnalysesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::ListAnalysesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_analyses(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) + # Pass arguments to `list_analyses` via keyword arguments. Note that at + # least one keyword argument is 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. Parent value for ListAnalysesRequest + # @param page_size [::Integer] + # Requested page size. Server may return fewer items than requested. + # If unspecified, server will pick an appropriate default. + # @param page_token [::String] + # A token identifying a page of results the server should return. + # @param filter [::String] + # Filtering results + # @param order_by [::String] + # Hint for how to order the results + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::VisionAI::V1::Analysis>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::VisionAI::V1::Analysis>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::ListAnalysesRequest.new + # + # # Call the list_analyses method. + # result = client.list_analyses 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::VisionAI::V1::Analysis. + # p item + # end + # + def list_analyses request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::ListAnalysesRequest + + # Converts hash 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_analyses.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::VisionAI::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_analyses.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_analyses.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @live_video_analytics_stub.list_analyses request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @live_video_analytics_stub, :list_analyses, "analyses", 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 details of a single Analysis. + # + # @overload get_analysis(request, options = nil) + # Pass arguments to `get_analysis` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::GetAnalysisRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::GetAnalysisRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_analysis(name: nil) + # Pass arguments to `get_analysis` via keyword arguments. Note that at + # least one keyword argument is 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 resource. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::VisionAI::V1::Analysis] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::VisionAI::V1::Analysis] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::GetAnalysisRequest.new + # + # # Call the get_analysis method. + # result = client.get_analysis request + # + # # The returned object is of type Google::Cloud::VisionAI::V1::Analysis. + # p result + # + def get_analysis request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::GetAnalysisRequest + + # Converts hash 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_analysis.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::VisionAI::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_analysis.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_analysis.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @live_video_analytics_stub.get_analysis 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 Analysis in a given project and location. + # + # @overload create_analysis(request, options = nil) + # Pass arguments to `create_analysis` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::CreateAnalysisRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::CreateAnalysisRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_analysis(parent: nil, analysis_id: nil, analysis: nil, request_id: nil) + # Pass arguments to `create_analysis` via keyword arguments. Note that at + # least one keyword argument is 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. Value for parent. + # @param analysis_id [::String] + # Required. Id of the requesting object. + # @param analysis [::Google::Cloud::VisionAI::V1::Analysis, ::Hash] + # Required. The resource being created. + # @param request_id [::String] + # Optional. An optional request ID to identify requests. Specify a unique + # request ID so that if you must retry your request, the server will know to + # ignore the request if it has already been completed. The server will + # guarantee that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request ID, + # the server can check if original operation with the same request ID was + # received, and if so, will ignore the second request. This prevents clients + # from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @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/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::CreateAnalysisRequest.new + # + # # Call the create_analysis method. + # result = client.create_analysis 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_analysis request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::CreateAnalysisRequest + + # Converts hash 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_analysis.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::VisionAI::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_analysis.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_analysis.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @live_video_analytics_stub.create_analysis 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 + + ## + # Updates the parameters of a single Analysis. + # + # @overload update_analysis(request, options = nil) + # Pass arguments to `update_analysis` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::UpdateAnalysisRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::UpdateAnalysisRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_analysis(update_mask: nil, analysis: nil, request_id: nil) + # Pass arguments to `update_analysis` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. Field mask is used to specify the fields to be overwritten in the + # Analysis resource by the update. + # The fields specified in the update_mask are relative to the resource, not + # the full request. A field will be overwritten if it is in the mask. If the + # user does not provide a mask then all fields will be overwritten. + # @param analysis [::Google::Cloud::VisionAI::V1::Analysis, ::Hash] + # Required. The resource being updated. + # @param request_id [::String] + # Optional. An optional request ID to identify requests. Specify a unique + # request ID so that if you must retry your request, the server will know to + # ignore the request if it has already been completed. The server will + # guarantee that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request ID, + # the server can check if original operation with the same request ID was + # received, and if so, will ignore the second request. This prevents clients + # from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @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/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::UpdateAnalysisRequest.new + # + # # Call the update_analysis method. + # result = client.update_analysis 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 update_analysis request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::UpdateAnalysisRequest + + # Converts hash 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_analysis.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::VisionAI::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_analysis.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_analysis.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @live_video_analytics_stub.update_analysis 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 single Analysis. + # + # @overload delete_analysis(request, options = nil) + # Pass arguments to `delete_analysis` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::DeleteAnalysisRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::DeleteAnalysisRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_analysis(name: nil, request_id: nil) + # Pass arguments to `delete_analysis` via keyword arguments. Note that at + # least one keyword argument is 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 resource. + # @param request_id [::String] + # Optional. An optional request ID to identify requests. Specify a unique + # request ID so that if you must retry your request, the server will know to + # ignore the request if it has already been completed. The server will + # guarantee that for at least 60 minutes after the first request. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request ID, + # the server can check if original operation with the same request ID was + # received, and if so, will ignore the second request. This prevents clients + # from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @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/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::DeleteAnalysisRequest.new + # + # # Call the delete_analysis method. + # result = client.delete_analysis 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_analysis request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::DeleteAnalysisRequest + + # Converts hash 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_analysis.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::VisionAI::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_analysis.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_analysis.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @live_video_analytics_stub.delete_analysis 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 + + ## + # Lists Processes in a given project and location. + # + # @overload list_processes(request, options = nil) + # Pass arguments to `list_processes` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::ListProcessesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::ListProcessesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_processes(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) + # Pass arguments to `list_processes` via keyword arguments. Note that at + # least one keyword argument is 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. Parent value for ListProcessesRequest. + # @param page_size [::Integer] + # Requested page size. Server may return fewer items than requested. + # If unspecified, server will pick an appropriate default. + # @param page_token [::String] + # A token identifying a page of results the server should return. + # @param filter [::String] + # Filtering results + # @param order_by [::String] + # Hint for how to order the results + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::VisionAI::V1::Process>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::VisionAI::V1::Process>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::ListProcessesRequest.new + # + # # Call the list_processes method. + # result = client.list_processes 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::VisionAI::V1::Process. + # p item + # end + # + def list_processes request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::ListProcessesRequest + + # Converts hash 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_processes.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::VisionAI::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_processes.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_processes.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @live_video_analytics_stub.list_processes request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @live_video_analytics_stub, :list_processes, "processes", 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 details of a single Process. + # + # @overload get_process(request, options = nil) + # Pass arguments to `get_process` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::GetProcessRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::GetProcessRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_process(name: nil) + # Pass arguments to `get_process` via keyword arguments. Note that at + # least one keyword argument is 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 resource. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::VisionAI::V1::Process] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::VisionAI::V1::Process] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::GetProcessRequest.new + # + # # Call the get_process method. + # result = client.get_process request + # + # # The returned object is of type Google::Cloud::VisionAI::V1::Process. + # p result + # + def get_process request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::GetProcessRequest + + # Converts hash 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_process.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::VisionAI::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_process.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_process.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @live_video_analytics_stub.get_process 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 Process in a given project and location. + # + # @overload create_process(request, options = nil) + # Pass arguments to `create_process` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::CreateProcessRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::CreateProcessRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_process(parent: nil, process_id: nil, process: nil, request_id: nil) + # Pass arguments to `create_process` via keyword arguments. Note that at + # least one keyword argument is 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. Value for parent. + # @param process_id [::String] + # Required. Id of the requesting object. + # @param process [::Google::Cloud::VisionAI::V1::Process, ::Hash] + # Required. The resource being created. + # @param request_id [::String] + # Optional. An optional request ID to identify requests. Specify a unique + # request ID so that if you must retry your request, the server will know to + # ignore the request if it has already been completed. The server will + # guarantee that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request ID, + # the server can check if original operation with the same request ID was + # received, and if so, will ignore the second request. This prevents clients + # from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @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/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::CreateProcessRequest.new + # + # # Call the create_process method. + # result = client.create_process 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_process request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::CreateProcessRequest + + # Converts hash 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_process.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::VisionAI::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_process.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_process.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @live_video_analytics_stub.create_process 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 + + ## + # Updates the parameters of a single Process. + # + # @overload update_process(request, options = nil) + # Pass arguments to `update_process` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::UpdateProcessRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::UpdateProcessRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_process(update_mask: nil, process: nil, request_id: nil) + # Pass arguments to `update_process` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. Field mask is used to specify the fields to be overwritten in the + # Process resource by the update. + # The fields specified in the update_mask are relative to the resource, not + # the full request. A field will be overwritten if it is in the mask. If the + # user does not provide a mask then all fields will be overwritten. + # @param process [::Google::Cloud::VisionAI::V1::Process, ::Hash] + # Required. The resource being updated. + # @param request_id [::String] + # Optional. An optional request ID to identify requests. Specify a unique + # request ID so that if you must retry your request, the server will know to + # ignore the request if it has already been completed. The server will + # guarantee that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request ID, + # the server can check if original operation with the same request ID was + # received, and if so, will ignore the second request. This prevents clients + # from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @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/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::UpdateProcessRequest.new + # + # # Call the update_process method. + # result = client.update_process 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 update_process request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::UpdateProcessRequest + + # Converts hash 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_process.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::VisionAI::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_process.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_process.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @live_video_analytics_stub.update_process 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 single Process. + # + # @overload delete_process(request, options = nil) + # Pass arguments to `delete_process` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::DeleteProcessRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::DeleteProcessRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_process(name: nil, request_id: nil) + # Pass arguments to `delete_process` via keyword arguments. Note that at + # least one keyword argument is 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 resource. + # @param request_id [::String] + # Optional. An optional request ID to identify requests. Specify a unique + # request ID so that if you must retry your request, the server will know to + # ignore the request if it has already been completed. The server will + # guarantee that for at least 60 minutes after the first request. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request ID, + # the server can check if original operation with the same request ID was + # received, and if so, will ignore the second request. This prevents clients + # from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @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/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::DeleteProcessRequest.new + # + # # Call the delete_process method. + # result = client.delete_process 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_process request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::DeleteProcessRequest + + # Converts hash 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_process.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::VisionAI::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_process.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_process.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @live_video_analytics_stub.delete_process 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 + + ## + # Run all of the processes to "completion". Max time for each process is + # the LRO time limit. + # + # @overload batch_run_process(request, options = nil) + # Pass arguments to `batch_run_process` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::BatchRunProcessRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::BatchRunProcessRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload batch_run_process(parent: nil, requests: nil, options: nil) + # Pass arguments to `batch_run_process` via keyword arguments. Note that at + # least one keyword argument is 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 parent resource shared by all processes being created. + # @param requests [::Array<::Google::Cloud::VisionAI::V1::CreateProcessRequest, ::Hash>] + # Required. The create process requests. + # @param options [::Google::Cloud::VisionAI::V1::BatchRunProcessRequest::BatchRunProcessOptions, ::Hash] + # Optional. Options for batch processes. + # @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/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::BatchRunProcessRequest.new + # + # # Call the batch_run_process method. + # result = client.batch_run_process 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 batch_run_process request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::BatchRunProcessRequest + + # Converts hash 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.batch_run_process.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::VisionAI::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.batch_run_process.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.batch_run_process.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @live_video_analytics_stub.batch_run_process 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 + + ## + # Configuration class for the LiveVideoAnalytics REST API. + # + # This class represents the configuration for LiveVideoAnalytics 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::VisionAI::V1::LiveVideoAnalytics::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_public_operators to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_public_operators.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_public_operators.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 = "visionai.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 LiveVideoAnalytics 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_public_operators` + # @return [::Gapic::Config::Method] + # + attr_reader :list_public_operators + ## + # RPC-specific configuration for `resolve_operator_info` + # @return [::Gapic::Config::Method] + # + attr_reader :resolve_operator_info + ## + # RPC-specific configuration for `list_operators` + # @return [::Gapic::Config::Method] + # + attr_reader :list_operators + ## + # RPC-specific configuration for `get_operator` + # @return [::Gapic::Config::Method] + # + attr_reader :get_operator + ## + # RPC-specific configuration for `create_operator` + # @return [::Gapic::Config::Method] + # + attr_reader :create_operator + ## + # RPC-specific configuration for `update_operator` + # @return [::Gapic::Config::Method] + # + attr_reader :update_operator + ## + # RPC-specific configuration for `delete_operator` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_operator + ## + # RPC-specific configuration for `list_analyses` + # @return [::Gapic::Config::Method] + # + attr_reader :list_analyses + ## + # RPC-specific configuration for `get_analysis` + # @return [::Gapic::Config::Method] + # + attr_reader :get_analysis + ## + # RPC-specific configuration for `create_analysis` + # @return [::Gapic::Config::Method] + # + attr_reader :create_analysis + ## + # RPC-specific configuration for `update_analysis` + # @return [::Gapic::Config::Method] + # + attr_reader :update_analysis + ## + # RPC-specific configuration for `delete_analysis` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_analysis + ## + # RPC-specific configuration for `list_processes` + # @return [::Gapic::Config::Method] + # + attr_reader :list_processes + ## + # RPC-specific configuration for `get_process` + # @return [::Gapic::Config::Method] + # + attr_reader :get_process + ## + # RPC-specific configuration for `create_process` + # @return [::Gapic::Config::Method] + # + attr_reader :create_process + ## + # RPC-specific configuration for `update_process` + # @return [::Gapic::Config::Method] + # + attr_reader :update_process + ## + # RPC-specific configuration for `delete_process` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_process + ## + # RPC-specific configuration for `batch_run_process` + # @return [::Gapic::Config::Method] + # + attr_reader :batch_run_process + + # @private + def initialize parent_rpcs = nil + list_public_operators_config = parent_rpcs.list_public_operators if parent_rpcs.respond_to? :list_public_operators + @list_public_operators = ::Gapic::Config::Method.new list_public_operators_config + resolve_operator_info_config = parent_rpcs.resolve_operator_info if parent_rpcs.respond_to? :resolve_operator_info + @resolve_operator_info = ::Gapic::Config::Method.new resolve_operator_info_config + list_operators_config = parent_rpcs.list_operators if parent_rpcs.respond_to? :list_operators + @list_operators = ::Gapic::Config::Method.new list_operators_config + get_operator_config = parent_rpcs.get_operator if parent_rpcs.respond_to? :get_operator + @get_operator = ::Gapic::Config::Method.new get_operator_config + create_operator_config = parent_rpcs.create_operator if parent_rpcs.respond_to? :create_operator + @create_operator = ::Gapic::Config::Method.new create_operator_config + update_operator_config = parent_rpcs.update_operator if parent_rpcs.respond_to? :update_operator + @update_operator = ::Gapic::Config::Method.new update_operator_config + delete_operator_config = parent_rpcs.delete_operator if parent_rpcs.respond_to? :delete_operator + @delete_operator = ::Gapic::Config::Method.new delete_operator_config + list_analyses_config = parent_rpcs.list_analyses if parent_rpcs.respond_to? :list_analyses + @list_analyses = ::Gapic::Config::Method.new list_analyses_config + get_analysis_config = parent_rpcs.get_analysis if parent_rpcs.respond_to? :get_analysis + @get_analysis = ::Gapic::Config::Method.new get_analysis_config + create_analysis_config = parent_rpcs.create_analysis if parent_rpcs.respond_to? :create_analysis + @create_analysis = ::Gapic::Config::Method.new create_analysis_config + update_analysis_config = parent_rpcs.update_analysis if parent_rpcs.respond_to? :update_analysis + @update_analysis = ::Gapic::Config::Method.new update_analysis_config + delete_analysis_config = parent_rpcs.delete_analysis if parent_rpcs.respond_to? :delete_analysis + @delete_analysis = ::Gapic::Config::Method.new delete_analysis_config + list_processes_config = parent_rpcs.list_processes if parent_rpcs.respond_to? :list_processes + @list_processes = ::Gapic::Config::Method.new list_processes_config + get_process_config = parent_rpcs.get_process if parent_rpcs.respond_to? :get_process + @get_process = ::Gapic::Config::Method.new get_process_config + create_process_config = parent_rpcs.create_process if parent_rpcs.respond_to? :create_process + @create_process = ::Gapic::Config::Method.new create_process_config + update_process_config = parent_rpcs.update_process if parent_rpcs.respond_to? :update_process + @update_process = ::Gapic::Config::Method.new update_process_config + delete_process_config = parent_rpcs.delete_process if parent_rpcs.respond_to? :delete_process + @delete_process = ::Gapic::Config::Method.new delete_process_config + batch_run_process_config = parent_rpcs.batch_run_process if parent_rpcs.respond_to? :batch_run_process + @batch_run_process = ::Gapic::Config::Method.new batch_run_process_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/live_video_analytics/rest/operations.rb b/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/live_video_analytics/rest/operations.rb new file mode 100644 index 000000000000..8e118e8c0e2f --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/live_video_analytics/rest/operations.rb @@ -0,0 +1,974 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 VisionAI + module V1 + module LiveVideoAnalytics + module Rest + # Service that implements Longrunning Operations API. + class Operations + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "visionai.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :operations_stub + + ## + # Configuration for the LiveVideoAnalytics 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 LiveVideoAnalytics 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::VisionAI::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::VisionAI::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::VisionAI::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::VisionAI::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 = "visionai.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}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/?$}, 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] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/warehouseOperations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/corpora/[^/]+/assets/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/corpora/[^/]+/collections/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/corpora/[^/]+/imageIndexes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/corpora/[^/]+/indexes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/corpora/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/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{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + 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{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/live_video_analytics/rest/service_stub.rb b/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/live_video_analytics/rest/service_stub.rb new file mode 100644 index 000000000000..c44ddb947aa8 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/live_video_analytics/rest/service_stub.rb @@ -0,0 +1,1187 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/visionai/v1/lva_service_pb" + +module Google + module Cloud + module VisionAI + module V1 + module LiveVideoAnalytics + module Rest + ## + # REST service stub for the LiveVideoAnalytics 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_public_operators REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::ListPublicOperatorsRequest] + # 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::VisionAI::V1::ListPublicOperatorsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::VisionAI::V1::ListPublicOperatorsResponse] + # A result object deserialized from the server's reply + def list_public_operators request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_public_operators_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_public_operators", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::VisionAI::V1::ListPublicOperatorsResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the resolve_operator_info REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::ResolveOperatorInfoRequest] + # 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::VisionAI::V1::ResolveOperatorInfoResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::VisionAI::V1::ResolveOperatorInfoResponse] + # A result object deserialized from the server's reply + def resolve_operator_info request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_resolve_operator_info_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: "resolve_operator_info", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::VisionAI::V1::ResolveOperatorInfoResponse.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_operators REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::ListOperatorsRequest] + # 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::VisionAI::V1::ListOperatorsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::VisionAI::V1::ListOperatorsResponse] + # A result object deserialized from the server's reply + def list_operators request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_operators_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_operators", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::VisionAI::V1::ListOperatorsResponse.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_operator REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::GetOperatorRequest] + # 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::VisionAI::V1::Operator] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::VisionAI::V1::Operator] + # A result object deserialized from the server's reply + def get_operator request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_operator_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_operator", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::VisionAI::V1::Operator.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_operator REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::CreateOperatorRequest] + # 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_operator request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_operator_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_operator", + 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 update_operator REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::UpdateOperatorRequest] + # 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 update_operator request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_operator_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_operator", + 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_operator REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::DeleteOperatorRequest] + # 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_operator request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_operator_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_operator", + 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 list_analyses REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::ListAnalysesRequest] + # 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::VisionAI::V1::ListAnalysesResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::VisionAI::V1::ListAnalysesResponse] + # A result object deserialized from the server's reply + def list_analyses request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_analyses_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_analyses", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::VisionAI::V1::ListAnalysesResponse.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_analysis REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::GetAnalysisRequest] + # 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::VisionAI::V1::Analysis] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::VisionAI::V1::Analysis] + # A result object deserialized from the server's reply + def get_analysis request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_analysis_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_analysis", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::VisionAI::V1::Analysis.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_analysis REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::CreateAnalysisRequest] + # 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_analysis request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_analysis_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_analysis", + 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 update_analysis REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::UpdateAnalysisRequest] + # 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 update_analysis request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_analysis_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_analysis", + 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_analysis REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::DeleteAnalysisRequest] + # 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_analysis request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_analysis_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_analysis", + 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 list_processes REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::ListProcessesRequest] + # 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::VisionAI::V1::ListProcessesResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::VisionAI::V1::ListProcessesResponse] + # A result object deserialized from the server's reply + def list_processes request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_processes_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_processes", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::VisionAI::V1::ListProcessesResponse.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_process REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::GetProcessRequest] + # 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::VisionAI::V1::Process] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::VisionAI::V1::Process] + # A result object deserialized from the server's reply + def get_process request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_process_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_process", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::VisionAI::V1::Process.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_process REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::CreateProcessRequest] + # 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_process request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_process_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_process", + 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 update_process REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::UpdateProcessRequest] + # 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 update_process request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_process_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_process", + 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_process REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::DeleteProcessRequest] + # 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_process request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_process_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_process", + 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 batch_run_process REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::BatchRunProcessRequest] + # 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 batch_run_process request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_batch_run_process_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: "batch_run_process", + 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 + + ## + # @private + # + # GRPC transcoding helper method for the list_public_operators REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::ListPublicOperatorsRequest] + # 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_public_operators_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}:listPublicOperators", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the resolve_operator_info REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::ResolveOperatorInfoRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_resolve_operator_info_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}:resolveOperatorInfo", + body: "*", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_operators REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::ListOperatorsRequest] + # 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_operators_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/operators", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_operator REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::GetOperatorRequest] + # 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_operator_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operators/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_operator REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::CreateOperatorRequest] + # 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_operator_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/operators", + body: "operator", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_operator REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::UpdateOperatorRequest] + # 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_operator_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v1/{operator.name}", + body: "operator", + matches: [ + ["operator.name", %r{^projects/[^/]+/locations/[^/]+/operators/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_operator REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::DeleteOperatorRequest] + # 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_operator_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operators/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_analyses REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::ListAnalysesRequest] + # 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_analyses_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/analyses", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/clusters/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_analysis REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::GetAnalysisRequest] + # 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_analysis_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/clusters/[^/]+/analyses/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_analysis REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::CreateAnalysisRequest] + # 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_analysis_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/analyses", + body: "analysis", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/clusters/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_analysis REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::UpdateAnalysisRequest] + # 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_analysis_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v1/{analysis.name}", + body: "analysis", + matches: [ + ["analysis.name", %r{^projects/[^/]+/locations/[^/]+/clusters/[^/]+/analyses/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_analysis REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::DeleteAnalysisRequest] + # 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_analysis_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/clusters/[^/]+/analyses/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_processes REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::ListProcessesRequest] + # 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_processes_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/processes", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/clusters/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_process REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::GetProcessRequest] + # 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_process_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/clusters/[^/]+/processes/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_process REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::CreateProcessRequest] + # 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_process_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/processes", + body: "process", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/clusters/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_process REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::UpdateProcessRequest] + # 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_process_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v1/{process.name}", + body: "process", + matches: [ + ["process.name", %r{^projects/[^/]+/locations/[^/]+/clusters/[^/]+/processes/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_process REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::DeleteProcessRequest] + # 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_process_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/clusters/[^/]+/processes/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the batch_run_process REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::BatchRunProcessRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_batch_run_process_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/processes:batchRun", + body: "*", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/clusters/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/rest.rb b/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/rest.rb new file mode 100644 index 000000000000..3f373fb0a2e0 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/rest.rb @@ -0,0 +1,43 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/vision_ai/v1/live_video_analytics/rest" +require "google/cloud/vision_ai/v1/app_platform/rest" +require "google/cloud/vision_ai/v1/streaming_service/rest" +require "google/cloud/vision_ai/v1/streams_service/rest" +require "google/cloud/vision_ai/v1/warehouse/rest" +require "google/cloud/vision_ai/v1/health_check_service/rest" +require "google/cloud/vision_ai/v1/bindings_override" +require "google/cloud/vision_ai/v1/version" + +module Google + module Cloud + module VisionAI + ## + # To load just the REST part of this package, including all its services, and instantiate a REST client: + # + # @example + # + # require "google/cloud/vision_ai/v1/rest" + # client = ::Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Rest::Client.new + # + module V1 + end + end + end +end diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/streaming_service.rb b/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/streaming_service.rb new file mode 100644 index 000000000000..71b7779b4a6d --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/streaming_service.rb @@ -0,0 +1,55 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/vision_ai/v1/version" + +require "google/cloud/vision_ai/v1/streaming_service/credentials" +require "google/cloud/vision_ai/v1/streaming_service/paths" +require "google/cloud/vision_ai/v1/streaming_service/client" +require "google/cloud/vision_ai/v1/streaming_service/rest" + +module Google + module Cloud + module VisionAI + module V1 + ## + # Streaming service for receiving and sending packets. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/vision_ai/v1/streaming_service" + # client = ::Google::Cloud::VisionAI::V1::StreamingService::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/vision_ai/v1/streaming_service/rest" + # client = ::Google::Cloud::VisionAI::V1::StreamingService::Rest::Client.new + # + module StreamingService + end + end + end + end +end + +helper_path = ::File.join __dir__, "streaming_service", "helpers.rb" +require "google/cloud/vision_ai/v1/streaming_service/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/streaming_service/client.rb b/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/streaming_service/client.rb new file mode 100644 index 000000000000..e525c4c362dc --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/streaming_service/client.rb @@ -0,0 +1,961 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/visionai/v1/streaming_service_pb" +require "google/cloud/location" +require "google/iam/v1" + +module Google + module Cloud + module VisionAI + module V1 + module StreamingService + ## + # Client for the StreamingService service. + # + # Streaming service for receiving and sending packets. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "visionai.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :streaming_service_stub + + ## + # Configure the StreamingService Client class. + # + # See {::Google::Cloud::VisionAI::V1::StreamingService::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all StreamingService clients + # ::Google::Cloud::VisionAI::V1::StreamingService::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", "VisionAI", "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 + end + yield @configure if block_given? + @configure + end + + ## + # Configure the StreamingService 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::VisionAI::V1::StreamingService::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 + @streaming_service_stub.universe_domain + end + + ## + # Create a new StreamingService client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::VisionAI::V1::StreamingService::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::VisionAI::V1::StreamingService::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the StreamingService 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/visionai/v1/streaming_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 + + @streaming_service_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::VisionAI::V1::StreamingService::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 + ) + + @streaming_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 = @streaming_service_stub.endpoint + config.universe_domain = @streaming_service_stub.universe_domain + config.logger = @streaming_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 = @streaming_service_stub.endpoint + config.universe_domain = @streaming_service_stub.universe_domain + config.logger = @streaming_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 + @streaming_service_stub.logger + end + + # Service calls + + ## + # Send packets to the series. + # + # @param request [::Gapic::StreamInput, ::Enumerable<::Google::Cloud::VisionAI::V1::SendPacketsRequest, ::Hash>] + # An enumerable of {::Google::Cloud::VisionAI::V1::SendPacketsRequest} instances. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Enumerable<::Google::Cloud::VisionAI::V1::SendPacketsResponse>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Enumerable<::Google::Cloud::VisionAI::V1::SendPacketsResponse>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::StreamingService::Client.new + # + # # Create an input stream. + # input = Gapic::StreamInput.new + # + # # Call the send_packets method to start streaming. + # output = client.send_packets input + # + # # Send requests on the stream. For each request object, set fields by + # # passing keyword arguments. Be sure to close the stream when done. + # input << Google::Cloud::VisionAI::V1::SendPacketsRequest.new + # input << Google::Cloud::VisionAI::V1::SendPacketsRequest.new + # input.close + # + # # The returned object is a streamed enumerable yielding elements of type + # # ::Google::Cloud::VisionAI::V1::SendPacketsResponse + # output.each do |current_response| + # p current_response + # end + # + def send_packets request, options = nil + unless request.is_a? ::Enumerable + raise ::ArgumentError, "request must be an Enumerable" unless request.respond_to? :to_enum + request = request.to_enum + end + + request = request.lazy.map do |req| + ::Gapic::Protobuf.coerce req, to: ::Google::Cloud::VisionAI::V1::SendPacketsRequest + end + + # Converts hash 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.send_packets.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::VisionAI::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.send_packets.timeout, + metadata: metadata, + retry_policy: @config.rpcs.send_packets.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @streaming_service_stub.call_rpc :send_packets, 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 + + ## + # Receive packets from the series. + # + # @param request [::Gapic::StreamInput, ::Enumerable<::Google::Cloud::VisionAI::V1::ReceivePacketsRequest, ::Hash>] + # An enumerable of {::Google::Cloud::VisionAI::V1::ReceivePacketsRequest} instances. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Enumerable<::Google::Cloud::VisionAI::V1::ReceivePacketsResponse>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Enumerable<::Google::Cloud::VisionAI::V1::ReceivePacketsResponse>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::StreamingService::Client.new + # + # # Create an input stream. + # input = Gapic::StreamInput.new + # + # # Call the receive_packets method to start streaming. + # output = client.receive_packets input + # + # # Send requests on the stream. For each request object, set fields by + # # passing keyword arguments. Be sure to close the stream when done. + # input << Google::Cloud::VisionAI::V1::ReceivePacketsRequest.new + # input << Google::Cloud::VisionAI::V1::ReceivePacketsRequest.new + # input.close + # + # # The returned object is a streamed enumerable yielding elements of type + # # ::Google::Cloud::VisionAI::V1::ReceivePacketsResponse + # output.each do |current_response| + # p current_response + # end + # + def receive_packets request, options = nil + unless request.is_a? ::Enumerable + raise ::ArgumentError, "request must be an Enumerable" unless request.respond_to? :to_enum + request = request.to_enum + end + + request = request.lazy.map do |req| + ::Gapic::Protobuf.coerce req, to: ::Google::Cloud::VisionAI::V1::ReceivePacketsRequest + end + + # Converts hash 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.receive_packets.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::VisionAI::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.receive_packets.timeout, + metadata: metadata, + retry_policy: @config.rpcs.receive_packets.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @streaming_service_stub.call_rpc :receive_packets, 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 + + ## + # Receive events given the stream name. + # + # @param request [::Gapic::StreamInput, ::Enumerable<::Google::Cloud::VisionAI::V1::ReceiveEventsRequest, ::Hash>] + # An enumerable of {::Google::Cloud::VisionAI::V1::ReceiveEventsRequest} instances. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Enumerable<::Google::Cloud::VisionAI::V1::ReceiveEventsResponse>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Enumerable<::Google::Cloud::VisionAI::V1::ReceiveEventsResponse>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::StreamingService::Client.new + # + # # Create an input stream. + # input = Gapic::StreamInput.new + # + # # Call the receive_events method to start streaming. + # output = client.receive_events input + # + # # Send requests on the stream. For each request object, set fields by + # # passing keyword arguments. Be sure to close the stream when done. + # input << Google::Cloud::VisionAI::V1::ReceiveEventsRequest.new + # input << Google::Cloud::VisionAI::V1::ReceiveEventsRequest.new + # input.close + # + # # The returned object is a streamed enumerable yielding elements of type + # # ::Google::Cloud::VisionAI::V1::ReceiveEventsResponse + # output.each do |current_response| + # p current_response + # end + # + def receive_events request, options = nil + unless request.is_a? ::Enumerable + raise ::ArgumentError, "request must be an Enumerable" unless request.respond_to? :to_enum + request = request.to_enum + end + + request = request.lazy.map do |req| + ::Gapic::Protobuf.coerce req, to: ::Google::Cloud::VisionAI::V1::ReceiveEventsRequest + end + + # Converts hash 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.receive_events.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::VisionAI::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.receive_events.timeout, + metadata: metadata, + retry_policy: @config.rpcs.receive_events.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @streaming_service_stub.call_rpc :receive_events, 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 + + ## + # AcquireLease acquires a lease. + # + # @overload acquire_lease(request, options = nil) + # Pass arguments to `acquire_lease` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::AcquireLeaseRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::AcquireLeaseRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload acquire_lease(series: nil, owner: nil, term: nil, lease_type: nil) + # Pass arguments to `acquire_lease` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param series [::String] + # The series name. + # @param owner [::String] + # The owner name. + # @param term [::Google::Protobuf::Duration, ::Hash] + # The lease term. + # @param lease_type [::Google::Cloud::VisionAI::V1::LeaseType] + # The lease type. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::VisionAI::V1::Lease] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::VisionAI::V1::Lease] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::StreamingService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::AcquireLeaseRequest.new + # + # # Call the acquire_lease method. + # result = client.acquire_lease request + # + # # The returned object is of type Google::Cloud::VisionAI::V1::Lease. + # p result + # + def acquire_lease request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::AcquireLeaseRequest + + # Converts hash 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.acquire_lease.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::VisionAI::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.series + header_params["series"] = request.series + 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.acquire_lease.timeout, + metadata: metadata, + retry_policy: @config.rpcs.acquire_lease.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @streaming_service_stub.call_rpc :acquire_lease, 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 + + ## + # RenewLease renews a lease. + # + # @overload renew_lease(request, options = nil) + # Pass arguments to `renew_lease` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::RenewLeaseRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::RenewLeaseRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload renew_lease(id: nil, series: nil, owner: nil, term: nil) + # Pass arguments to `renew_lease` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param id [::String] + # Lease id. + # @param series [::String] + # Series name. + # @param owner [::String] + # Lease owner. + # @param term [::Google::Protobuf::Duration, ::Hash] + # Lease term. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::VisionAI::V1::Lease] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::VisionAI::V1::Lease] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::StreamingService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::RenewLeaseRequest.new + # + # # Call the renew_lease method. + # result = client.renew_lease request + # + # # The returned object is of type Google::Cloud::VisionAI::V1::Lease. + # p result + # + def renew_lease request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::RenewLeaseRequest + + # Converts hash 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.renew_lease.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::VisionAI::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.series + header_params["series"] = request.series + 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.renew_lease.timeout, + metadata: metadata, + retry_policy: @config.rpcs.renew_lease.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @streaming_service_stub.call_rpc :renew_lease, 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 + + ## + # RleaseLease releases a lease. + # + # @overload release_lease(request, options = nil) + # Pass arguments to `release_lease` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::ReleaseLeaseRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::ReleaseLeaseRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload release_lease(id: nil, series: nil, owner: nil) + # Pass arguments to `release_lease` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param id [::String] + # Lease id. + # @param series [::String] + # Series name. + # @param owner [::String] + # Lease owner. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::VisionAI::V1::ReleaseLeaseResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::VisionAI::V1::ReleaseLeaseResponse] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::StreamingService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::ReleaseLeaseRequest.new + # + # # Call the release_lease method. + # result = client.release_lease request + # + # # The returned object is of type Google::Cloud::VisionAI::V1::ReleaseLeaseResponse. + # p result + # + def release_lease request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::ReleaseLeaseRequest + + # Converts hash 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.release_lease.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::VisionAI::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.series + header_params["series"] = request.series + 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.release_lease.timeout, + metadata: metadata, + retry_policy: @config.rpcs.release_lease.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @streaming_service_stub.call_rpc :release_lease, 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 StreamingService API. + # + # This class represents the configuration for StreamingService, + # 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::VisionAI::V1::StreamingService::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 + # # send_packets to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::VisionAI::V1::StreamingService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.send_packets.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::VisionAI::V1::StreamingService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.send_packets.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::VisionAI::V1::StreamingService::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 = "visionai.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 StreamingService 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 `send_packets` + # @return [::Gapic::Config::Method] + # + attr_reader :send_packets + ## + # RPC-specific configuration for `receive_packets` + # @return [::Gapic::Config::Method] + # + attr_reader :receive_packets + ## + # RPC-specific configuration for `receive_events` + # @return [::Gapic::Config::Method] + # + attr_reader :receive_events + ## + # RPC-specific configuration for `acquire_lease` + # @return [::Gapic::Config::Method] + # + attr_reader :acquire_lease + ## + # RPC-specific configuration for `renew_lease` + # @return [::Gapic::Config::Method] + # + attr_reader :renew_lease + ## + # RPC-specific configuration for `release_lease` + # @return [::Gapic::Config::Method] + # + attr_reader :release_lease + + # @private + def initialize parent_rpcs = nil + send_packets_config = parent_rpcs.send_packets if parent_rpcs.respond_to? :send_packets + @send_packets = ::Gapic::Config::Method.new send_packets_config + receive_packets_config = parent_rpcs.receive_packets if parent_rpcs.respond_to? :receive_packets + @receive_packets = ::Gapic::Config::Method.new receive_packets_config + receive_events_config = parent_rpcs.receive_events if parent_rpcs.respond_to? :receive_events + @receive_events = ::Gapic::Config::Method.new receive_events_config + acquire_lease_config = parent_rpcs.acquire_lease if parent_rpcs.respond_to? :acquire_lease + @acquire_lease = ::Gapic::Config::Method.new acquire_lease_config + renew_lease_config = parent_rpcs.renew_lease if parent_rpcs.respond_to? :renew_lease + @renew_lease = ::Gapic::Config::Method.new renew_lease_config + release_lease_config = parent_rpcs.release_lease if parent_rpcs.respond_to? :release_lease + @release_lease = ::Gapic::Config::Method.new release_lease_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/streaming_service/credentials.rb b/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/streaming_service/credentials.rb new file mode 100644 index 000000000000..d185c1307983 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/streaming_service/credentials.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! + +require "googleauth" + +module Google + module Cloud + module VisionAI + module V1 + module StreamingService + # Credentials for the StreamingService API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/cloud-platform" + ] + self.env_vars = [ + "GOOGLE_CLOUD_CREDENTIALS", + "GOOGLE_CLOUD_KEYFILE", + "GCLOUD_KEYFILE", + "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-vision_ai-v1/lib/google/cloud/vision_ai/v1/streaming_service/paths.rb b/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/streaming_service/paths.rb new file mode 100644 index 000000000000..d08b2855cae9 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/streaming_service/paths.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! + + +module Google + module Cloud + module VisionAI + module V1 + module StreamingService + # Path helper methods for the StreamingService API. + module Paths + ## + # Create a fully-qualified Series resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/clusters/{cluster}/series/{series}` + # + # @param project [String] + # @param location [String] + # @param cluster [String] + # @param series [String] + # + # @return [::String] + def series_path project:, location:, cluster:, series: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "cluster cannot contain /" if cluster.to_s.include? "/" + + "projects/#{project}/locations/#{location}/clusters/#{cluster}/series/#{series}" + end + + extend self + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/streaming_service/rest.rb b/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/streaming_service/rest.rb new file mode 100644 index 000000000000..42521a060a3d --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/streaming_service/rest.rb @@ -0,0 +1,53 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/vision_ai/v1/version" +require "google/cloud/vision_ai/v1/bindings_override" + +require "google/cloud/vision_ai/v1/streaming_service/credentials" +require "google/cloud/vision_ai/v1/streaming_service/paths" +require "google/cloud/vision_ai/v1/streaming_service/rest/client" + +module Google + module Cloud + module VisionAI + module V1 + ## + # Streaming service for receiving and sending packets. + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/vision_ai/v1/streaming_service/rest" + # client = ::Google::Cloud::VisionAI::V1::StreamingService::Rest::Client.new + # + module StreamingService + # Client for the REST transport + module Rest + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "rest", "helpers.rb" +require "google/cloud/vision_ai/v1/streaming_service/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/streaming_service/rest/client.rb b/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/streaming_service/rest/client.rb new file mode 100644 index 000000000000..6bae7f94456c --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/streaming_service/rest/client.rb @@ -0,0 +1,650 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/visionai/v1/streaming_service_pb" +require "google/cloud/vision_ai/v1/streaming_service/rest/service_stub" +require "google/cloud/location/rest" +require "google/iam/v1/rest" + +module Google + module Cloud + module VisionAI + module V1 + module StreamingService + module Rest + ## + # REST client for the StreamingService service. + # + # Streaming service for receiving and sending packets. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "visionai.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :streaming_service_stub + + ## + # Configure the StreamingService Client class. + # + # See {::Google::Cloud::VisionAI::V1::StreamingService::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all StreamingService clients + # ::Google::Cloud::VisionAI::V1::StreamingService::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", "VisionAI", "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 + end + yield @configure if block_given? + @configure + end + + ## + # Configure the StreamingService 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::VisionAI::V1::StreamingService::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 + @streaming_service_stub.universe_domain + end + + ## + # Create a new StreamingService REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::VisionAI::V1::StreamingService::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::VisionAI::V1::StreamingService::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the StreamingService 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 + + @streaming_service_stub = ::Google::Cloud::VisionAI::V1::StreamingService::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials, + logger: @config.logger + ) + + @streaming_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 = @streaming_service_stub.endpoint + config.universe_domain = @streaming_service_stub.universe_domain + config.bindings_override = @config.bindings_override + config.logger = @streaming_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 = @streaming_service_stub.endpoint + config.universe_domain = @streaming_service_stub.universe_domain + config.logger = @streaming_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 + @streaming_service_stub.logger + end + + # Service calls + + ## + # AcquireLease acquires a lease. + # + # @overload acquire_lease(request, options = nil) + # Pass arguments to `acquire_lease` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::AcquireLeaseRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::AcquireLeaseRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload acquire_lease(series: nil, owner: nil, term: nil, lease_type: nil) + # Pass arguments to `acquire_lease` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param series [::String] + # The series name. + # @param owner [::String] + # The owner name. + # @param term [::Google::Protobuf::Duration, ::Hash] + # The lease term. + # @param lease_type [::Google::Cloud::VisionAI::V1::LeaseType] + # The lease type. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::VisionAI::V1::Lease] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::VisionAI::V1::Lease] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::StreamingService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::AcquireLeaseRequest.new + # + # # Call the acquire_lease method. + # result = client.acquire_lease request + # + # # The returned object is of type Google::Cloud::VisionAI::V1::Lease. + # p result + # + def acquire_lease request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::AcquireLeaseRequest + + # Converts hash 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.acquire_lease.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::VisionAI::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.acquire_lease.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.acquire_lease.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @streaming_service_stub.acquire_lease 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 + + ## + # RenewLease renews a lease. + # + # @overload renew_lease(request, options = nil) + # Pass arguments to `renew_lease` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::RenewLeaseRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::RenewLeaseRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload renew_lease(id: nil, series: nil, owner: nil, term: nil) + # Pass arguments to `renew_lease` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param id [::String] + # Lease id. + # @param series [::String] + # Series name. + # @param owner [::String] + # Lease owner. + # @param term [::Google::Protobuf::Duration, ::Hash] + # Lease term. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::VisionAI::V1::Lease] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::VisionAI::V1::Lease] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::StreamingService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::RenewLeaseRequest.new + # + # # Call the renew_lease method. + # result = client.renew_lease request + # + # # The returned object is of type Google::Cloud::VisionAI::V1::Lease. + # p result + # + def renew_lease request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::RenewLeaseRequest + + # Converts hash 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.renew_lease.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::VisionAI::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.renew_lease.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.renew_lease.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @streaming_service_stub.renew_lease 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 + + ## + # RleaseLease releases a lease. + # + # @overload release_lease(request, options = nil) + # Pass arguments to `release_lease` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::ReleaseLeaseRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::ReleaseLeaseRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload release_lease(id: nil, series: nil, owner: nil) + # Pass arguments to `release_lease` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param id [::String] + # Lease id. + # @param series [::String] + # Series name. + # @param owner [::String] + # Lease owner. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::VisionAI::V1::ReleaseLeaseResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::VisionAI::V1::ReleaseLeaseResponse] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::StreamingService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::ReleaseLeaseRequest.new + # + # # Call the release_lease method. + # result = client.release_lease request + # + # # The returned object is of type Google::Cloud::VisionAI::V1::ReleaseLeaseResponse. + # p result + # + def release_lease request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::ReleaseLeaseRequest + + # Converts hash 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.release_lease.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::VisionAI::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.release_lease.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.release_lease.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @streaming_service_stub.release_lease 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 StreamingService REST API. + # + # This class represents the configuration for StreamingService 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::VisionAI::V1::StreamingService::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 + # # acquire_lease to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::VisionAI::V1::StreamingService::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.acquire_lease.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::VisionAI::V1::StreamingService::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.acquire_lease.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 = "visionai.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 StreamingService 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 `acquire_lease` + # @return [::Gapic::Config::Method] + # + attr_reader :acquire_lease + ## + # RPC-specific configuration for `renew_lease` + # @return [::Gapic::Config::Method] + # + attr_reader :renew_lease + ## + # RPC-specific configuration for `release_lease` + # @return [::Gapic::Config::Method] + # + attr_reader :release_lease + + # @private + def initialize parent_rpcs = nil + acquire_lease_config = parent_rpcs.acquire_lease if parent_rpcs.respond_to? :acquire_lease + @acquire_lease = ::Gapic::Config::Method.new acquire_lease_config + renew_lease_config = parent_rpcs.renew_lease if parent_rpcs.respond_to? :renew_lease + @renew_lease = ::Gapic::Config::Method.new renew_lease_config + release_lease_config = parent_rpcs.release_lease if parent_rpcs.respond_to? :release_lease + @release_lease = ::Gapic::Config::Method.new release_lease_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/streaming_service/rest/service_stub.rb b/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/streaming_service/rest/service_stub.rb new file mode 100644 index 000000000000..cfebca262a77 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/streaming_service/rest/service_stub.rb @@ -0,0 +1,267 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/visionai/v1/streaming_service_pb" + +module Google + module Cloud + module VisionAI + module V1 + module StreamingService + module Rest + ## + # REST service stub for the StreamingService 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 acquire_lease REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::AcquireLeaseRequest] + # 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::VisionAI::V1::Lease] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::VisionAI::V1::Lease] + # A result object deserialized from the server's reply + def acquire_lease request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_acquire_lease_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: "acquire_lease", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::VisionAI::V1::Lease.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the renew_lease REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::RenewLeaseRequest] + # 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::VisionAI::V1::Lease] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::VisionAI::V1::Lease] + # A result object deserialized from the server's reply + def renew_lease request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_renew_lease_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: "renew_lease", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::VisionAI::V1::Lease.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the release_lease REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::ReleaseLeaseRequest] + # 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::VisionAI::V1::ReleaseLeaseResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::VisionAI::V1::ReleaseLeaseResponse] + # A result object deserialized from the server's reply + def release_lease request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_release_lease_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: "release_lease", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::VisionAI::V1::ReleaseLeaseResponse.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 acquire_lease REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::AcquireLeaseRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_acquire_lease_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{series}:acquireLease", + body: "*", + matches: [ + ["series", %r{^projects/[^/]+/locations/[^/]+/clusters/[^/]+/series/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the renew_lease REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::RenewLeaseRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_renew_lease_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{series}:renewLease", + body: "*", + matches: [ + ["series", %r{^projects/[^/]+/locations/[^/]+/clusters/[^/]+/series/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the release_lease REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::ReleaseLeaseRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_release_lease_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{series}:releaseLease", + body: "*", + matches: [ + ["series", %r{^projects/[^/]+/locations/[^/]+/clusters/[^/]+/series/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/streams_service.rb b/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/streams_service.rb new file mode 100644 index 000000000000..c230200dac0f --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/streams_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/vision_ai/v1/version" + +require "google/cloud/vision_ai/v1/streams_service/credentials" +require "google/cloud/vision_ai/v1/streams_service/paths" +require "google/cloud/vision_ai/v1/streams_service/operations" +require "google/cloud/vision_ai/v1/streams_service/client" +require "google/cloud/vision_ai/v1/streams_service/rest" + +module Google + module Cloud + module VisionAI + module V1 + ## + # Service describing handlers for resources. + # Vision API and Vision AI API are two independent APIs developed by the same + # team. Vision API is for people to annotate their image while Vision AI is an + # e2e solution for customer to build their own computer vision application. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/vision_ai/v1/streams_service" + # client = ::Google::Cloud::VisionAI::V1::StreamsService::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/vision_ai/v1/streams_service/rest" + # client = ::Google::Cloud::VisionAI::V1::StreamsService::Rest::Client.new + # + module StreamsService + end + end + end + end +end + +helper_path = ::File.join __dir__, "streams_service", "helpers.rb" +require "google/cloud/vision_ai/v1/streams_service/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/streams_service/client.rb b/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/streams_service/client.rb new file mode 100644 index 000000000000..b9545358fa30 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/streams_service/client.rb @@ -0,0 +1,2978 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/visionai/v1/streams_service_pb" +require "google/cloud/location" +require "google/iam/v1" + +module Google + module Cloud + module VisionAI + module V1 + module StreamsService + ## + # Client for the StreamsService service. + # + # Service describing handlers for resources. + # Vision API and Vision AI API are two independent APIs developed by the same + # team. Vision API is for people to annotate their image while Vision AI is an + # e2e solution for customer to build their own computer vision application. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "visionai.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :streams_service_stub + + ## + # Configure the StreamsService Client class. + # + # See {::Google::Cloud::VisionAI::V1::StreamsService::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all StreamsService clients + # ::Google::Cloud::VisionAI::V1::StreamsService::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", "VisionAI", "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 + end + yield @configure if block_given? + @configure + end + + ## + # Configure the StreamsService 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::VisionAI::V1::StreamsService::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 + @streams_service_stub.universe_domain + end + + ## + # Create a new StreamsService client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::VisionAI::V1::StreamsService::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::VisionAI::V1::StreamsService::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the StreamsService 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/visionai/v1/streams_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 + + @streams_service_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::VisionAI::V1::StreamsService::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 + ) + + @streams_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 = @streams_service_stub.endpoint + config.universe_domain = @streams_service_stub.universe_domain + config.logger = @streams_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 = @streams_service_stub.endpoint + config.universe_domain = @streams_service_stub.universe_domain + config.logger = @streams_service_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::VisionAI::V1::StreamsService::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 + @streams_service_stub.logger + end + + # Service calls + + ## + # Lists Clusters in a given project and location. + # + # @overload list_clusters(request, options = nil) + # Pass arguments to `list_clusters` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::ListClustersRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::ListClustersRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_clusters(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) + # Pass arguments to `list_clusters` via keyword arguments. Note that at + # least one keyword argument is 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. Parent value for ListClustersRequest. + # @param page_size [::Integer] + # Requested page size. Server may return fewer items than requested. + # If unspecified, server will pick an appropriate default. + # @param page_token [::String] + # A token identifying a page of results the server should return. + # @param filter [::String] + # Filtering results. + # @param order_by [::String] + # Hint for how to order the results. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::VisionAI::V1::Cluster>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::VisionAI::V1::Cluster>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::StreamsService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::ListClustersRequest.new + # + # # Call the list_clusters method. + # result = client.list_clusters 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::VisionAI::V1::Cluster. + # p item + # end + # + def list_clusters request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::ListClustersRequest + + # Converts hash 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_clusters.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::VisionAI::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_clusters.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_clusters.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @streams_service_stub.call_rpc :list_clusters, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @streams_service_stub, :list_clusters, 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 + + ## + # Gets details of a single Cluster. + # + # @overload get_cluster(request, options = nil) + # Pass arguments to `get_cluster` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::GetClusterRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::GetClusterRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_cluster(name: nil) + # Pass arguments to `get_cluster` via keyword arguments. Note that at + # least one keyword argument is 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 resource. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::VisionAI::V1::Cluster] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::VisionAI::V1::Cluster] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::StreamsService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::GetClusterRequest.new + # + # # Call the get_cluster method. + # result = client.get_cluster request + # + # # The returned object is of type Google::Cloud::VisionAI::V1::Cluster. + # p result + # + def get_cluster request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::GetClusterRequest + + # Converts hash 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_cluster.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::VisionAI::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_cluster.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_cluster.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @streams_service_stub.call_rpc :get_cluster, 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 Cluster in a given project and location. + # + # @overload create_cluster(request, options = nil) + # Pass arguments to `create_cluster` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::CreateClusterRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::CreateClusterRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_cluster(parent: nil, cluster_id: nil, cluster: nil, request_id: nil) + # Pass arguments to `create_cluster` via keyword arguments. Note that at + # least one keyword argument is 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. Value for parent. + # @param cluster_id [::String] + # Required. Id of the requesting object. + # @param cluster [::Google::Cloud::VisionAI::V1::Cluster, ::Hash] + # Required. The resource being created. + # @param request_id [::String] + # Optional. An optional request ID to identify requests. Specify a unique + # request ID so that if you must retry your request, the server will know to + # ignore the request if it has already been completed. The server will + # guarantee that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request ID, + # the server can check if original operation with the same request ID was + # received, and if so, will ignore the second request. This prevents clients + # from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # + # @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/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::StreamsService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::CreateClusterRequest.new + # + # # Call the create_cluster method. + # result = client.create_cluster 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_cluster request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::CreateClusterRequest + + # Converts hash 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_cluster.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::VisionAI::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_cluster.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_cluster.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @streams_service_stub.call_rpc :create_cluster, 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 + + ## + # Updates the parameters of a single Cluster. + # + # @overload update_cluster(request, options = nil) + # Pass arguments to `update_cluster` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::UpdateClusterRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::UpdateClusterRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_cluster(update_mask: nil, cluster: nil, request_id: nil) + # Pass arguments to `update_cluster` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. Field mask is used to specify the fields to be overwritten in the + # Cluster resource by the update. + # The fields specified in the update_mask are relative to the resource, not + # the full request. A field will be overwritten if it is in the mask. If the + # user does not provide a mask then all fields will be overwritten. + # @param cluster [::Google::Cloud::VisionAI::V1::Cluster, ::Hash] + # Required. The resource being updated + # @param request_id [::String] + # Optional. An optional request ID to identify requests. Specify a unique + # request ID so that if you must retry your request, the server will know to + # ignore the request if it has already been completed. The server will + # guarantee that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request ID, + # the server can check if original operation with the same request ID was + # received, and if so, will ignore the second request. This prevents clients + # from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # + # @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/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::StreamsService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::UpdateClusterRequest.new + # + # # Call the update_cluster method. + # result = client.update_cluster 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 update_cluster request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::UpdateClusterRequest + + # Converts hash 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_cluster.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::VisionAI::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.cluster&.name + header_params["cluster.name"] = request.cluster.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_cluster.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_cluster.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @streams_service_stub.call_rpc :update_cluster, 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 single Cluster. + # + # @overload delete_cluster(request, options = nil) + # Pass arguments to `delete_cluster` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::DeleteClusterRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::DeleteClusterRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_cluster(name: nil, request_id: nil) + # Pass arguments to `delete_cluster` via keyword arguments. Note that at + # least one keyword argument is 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 resource + # @param request_id [::String] + # Optional. An optional request ID to identify requests. Specify a unique + # request ID so that if you must retry your request, the server will know to + # ignore the request if it has already been completed. The server will + # guarantee that for at least 60 minutes after the first request. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request ID, + # the server can check if original operation with the same request ID was + # received, and if so, will ignore the second request. This prevents clients + # from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # + # @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/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::StreamsService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::DeleteClusterRequest.new + # + # # Call the delete_cluster method. + # result = client.delete_cluster 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_cluster request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::DeleteClusterRequest + + # Converts hash 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_cluster.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::VisionAI::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_cluster.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_cluster.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @streams_service_stub.call_rpc :delete_cluster, 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 + + ## + # Lists Streams in a given project and location. + # + # @overload list_streams(request, options = nil) + # Pass arguments to `list_streams` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::ListStreamsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::ListStreamsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_streams(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) + # Pass arguments to `list_streams` via keyword arguments. Note that at + # least one keyword argument is 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. Parent value for ListStreamsRequest. + # @param page_size [::Integer] + # Requested page size. Server may return fewer items than requested. + # If unspecified, server will pick an appropriate default. + # @param page_token [::String] + # A token identifying a page of results the server should return. + # @param filter [::String] + # Filtering results. + # @param order_by [::String] + # Hint for how to order the results. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::VisionAI::V1::Stream>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::VisionAI::V1::Stream>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::StreamsService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::ListStreamsRequest.new + # + # # Call the list_streams method. + # result = client.list_streams 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::VisionAI::V1::Stream. + # p item + # end + # + def list_streams request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::ListStreamsRequest + + # Converts hash 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_streams.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::VisionAI::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_streams.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_streams.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @streams_service_stub.call_rpc :list_streams, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @streams_service_stub, :list_streams, 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 + + ## + # Gets details of a single Stream. + # + # @overload get_stream(request, options = nil) + # Pass arguments to `get_stream` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::GetStreamRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::GetStreamRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_stream(name: nil) + # Pass arguments to `get_stream` via keyword arguments. Note that at + # least one keyword argument is 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 resource. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::VisionAI::V1::Stream] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::VisionAI::V1::Stream] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::StreamsService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::GetStreamRequest.new + # + # # Call the get_stream method. + # result = client.get_stream request + # + # # The returned object is of type Google::Cloud::VisionAI::V1::Stream. + # p result + # + def get_stream request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::GetStreamRequest + + # Converts hash 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_stream.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::VisionAI::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_stream.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_stream.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @streams_service_stub.call_rpc :get_stream, 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 Stream in a given project and location. + # + # @overload create_stream(request, options = nil) + # Pass arguments to `create_stream` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::CreateStreamRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::CreateStreamRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_stream(parent: nil, stream_id: nil, stream: nil, request_id: nil) + # Pass arguments to `create_stream` via keyword arguments. Note that at + # least one keyword argument is 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. Value for parent. + # @param stream_id [::String] + # Required. Id of the requesting object. + # @param stream [::Google::Cloud::VisionAI::V1::Stream, ::Hash] + # Required. The resource being created. + # @param request_id [::String] + # Optional. An optional request ID to identify requests. Specify a unique + # request ID so that if you must retry your request, the server will know to + # ignore the request if it has already been completed. The server will + # guarantee that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request ID, + # the server can check if original operation with the same request ID was + # received, and if so, will ignore the second request. This prevents clients + # from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # + # @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/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::StreamsService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::CreateStreamRequest.new + # + # # Call the create_stream method. + # result = client.create_stream 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_stream request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::CreateStreamRequest + + # Converts hash 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_stream.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::VisionAI::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_stream.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_stream.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @streams_service_stub.call_rpc :create_stream, 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 + + ## + # Updates the parameters of a single Stream. + # + # @overload update_stream(request, options = nil) + # Pass arguments to `update_stream` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::UpdateStreamRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::UpdateStreamRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_stream(update_mask: nil, stream: nil, request_id: nil) + # Pass arguments to `update_stream` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. Field mask is used to specify the fields to be overwritten in the + # Stream resource by the update. + # The fields specified in the update_mask are relative to the resource, not + # the full request. A field will be overwritten if it is in the mask. If the + # user does not provide a mask then all fields will be overwritten. + # @param stream [::Google::Cloud::VisionAI::V1::Stream, ::Hash] + # Required. The resource being updated. + # @param request_id [::String] + # Optional. An optional request ID to identify requests. Specify a unique + # request ID so that if you must retry your request, the server will know to + # ignore the request if it has already been completed. The server will + # guarantee that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request ID, + # the server can check if original operation with the same request ID was + # received, and if so, will ignore the second request. This prevents clients + # from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # + # @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/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::StreamsService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::UpdateStreamRequest.new + # + # # Call the update_stream method. + # result = client.update_stream 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 update_stream request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::UpdateStreamRequest + + # Converts hash 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_stream.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::VisionAI::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.stream&.name + header_params["stream.name"] = request.stream.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_stream.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_stream.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @streams_service_stub.call_rpc :update_stream, 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 single Stream. + # + # @overload delete_stream(request, options = nil) + # Pass arguments to `delete_stream` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::DeleteStreamRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::DeleteStreamRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_stream(name: nil, request_id: nil) + # Pass arguments to `delete_stream` via keyword arguments. Note that at + # least one keyword argument is 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 resource. + # @param request_id [::String] + # Optional. An optional request ID to identify requests. Specify a unique + # request ID so that if you must retry your request, the server will know to + # ignore the request if it has already been completed. The server will + # guarantee that for at least 60 minutes after the first request. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request ID, + # the server can check if original operation with the same request ID was + # received, and if so, will ignore the second request. This prevents clients + # from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # + # @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/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::StreamsService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::DeleteStreamRequest.new + # + # # Call the delete_stream method. + # result = client.delete_stream 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_stream request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::DeleteStreamRequest + + # Converts hash 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_stream.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::VisionAI::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_stream.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_stream.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @streams_service_stub.call_rpc :delete_stream, 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 + + ## + # Gets the thumbnail (image snapshot) of a single Stream. + # + # @overload get_stream_thumbnail(request, options = nil) + # Pass arguments to `get_stream_thumbnail` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::GetStreamThumbnailRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::GetStreamThumbnailRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_stream_thumbnail(stream: nil, gcs_object_name: nil, event: nil, request_id: nil) + # Pass arguments to `get_stream_thumbnail` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param stream [::String] + # Required. The name of the stream for to get the thumbnail from. + # @param gcs_object_name [::String] + # Required. The name of the GCS object to store the thumbnail image. + # @param event [::String] + # Optional. The name of the event. If unspecified, the thumbnail will be + # retrieved from the latest event. + # @param request_id [::String] + # Optional. An optional request ID to identify the requests. Specify a unique + # request ID so that if you must retry your request, the server will know to + # ignore the request if it has already been completed. The server will + # guarantee that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request ID, + # the server can check if original operation with the same request ID was + # received, and if so, will ignore the second request. This prevents clients + # from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # + # @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/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::StreamsService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::GetStreamThumbnailRequest.new + # + # # Call the get_stream_thumbnail method. + # result = client.get_stream_thumbnail 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_stream_thumbnail request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::GetStreamThumbnailRequest + + # Converts hash 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_stream_thumbnail.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::VisionAI::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.stream + header_params["stream"] = request.stream + 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_stream_thumbnail.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_stream_thumbnail.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @streams_service_stub.call_rpc :get_stream_thumbnail, 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 + + ## + # Generate the JWT auth token required to get the stream HLS contents. + # + # @overload generate_stream_hls_token(request, options = nil) + # Pass arguments to `generate_stream_hls_token` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::GenerateStreamHlsTokenRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::GenerateStreamHlsTokenRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_stream_hls_token(stream: nil) + # Pass arguments to `generate_stream_hls_token` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param stream [::String] + # Required. The name of the stream. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::VisionAI::V1::GenerateStreamHlsTokenResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::VisionAI::V1::GenerateStreamHlsTokenResponse] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::StreamsService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::GenerateStreamHlsTokenRequest.new + # + # # Call the generate_stream_hls_token method. + # result = client.generate_stream_hls_token request + # + # # The returned object is of type Google::Cloud::VisionAI::V1::GenerateStreamHlsTokenResponse. + # p result + # + def generate_stream_hls_token request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::GenerateStreamHlsTokenRequest + + # Converts hash 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_stream_hls_token.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::VisionAI::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.stream + header_params["stream"] = request.stream + 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_stream_hls_token.timeout, + metadata: metadata, + retry_policy: @config.rpcs.generate_stream_hls_token.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @streams_service_stub.call_rpc :generate_stream_hls_token, 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 Events in a given project and location. + # + # @overload list_events(request, options = nil) + # Pass arguments to `list_events` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::ListEventsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::ListEventsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_events(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) + # Pass arguments to `list_events` via keyword arguments. Note that at + # least one keyword argument is 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. Parent value for ListEventsRequest. + # @param page_size [::Integer] + # Requested page size. Server may return fewer items than requested. + # If unspecified, server will pick an appropriate default. + # @param page_token [::String] + # A token identifying a page of results the server should return. + # @param filter [::String] + # Filtering results. + # @param order_by [::String] + # Hint for how to order the results. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::VisionAI::V1::Event>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::VisionAI::V1::Event>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::StreamsService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::ListEventsRequest.new + # + # # Call the list_events method. + # result = client.list_events 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::VisionAI::V1::Event. + # p item + # end + # + def list_events request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::ListEventsRequest + + # Converts hash 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_events.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::VisionAI::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_events.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_events.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @streams_service_stub.call_rpc :list_events, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @streams_service_stub, :list_events, 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 + + ## + # Gets details of a single Event. + # + # @overload get_event(request, options = nil) + # Pass arguments to `get_event` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::GetEventRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::GetEventRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_event(name: nil) + # Pass arguments to `get_event` via keyword arguments. Note that at + # least one keyword argument is 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 resource. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::VisionAI::V1::Event] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::VisionAI::V1::Event] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::StreamsService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::GetEventRequest.new + # + # # Call the get_event method. + # result = client.get_event request + # + # # The returned object is of type Google::Cloud::VisionAI::V1::Event. + # p result + # + def get_event request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::GetEventRequest + + # Converts hash 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_event.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::VisionAI::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_event.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_event.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @streams_service_stub.call_rpc :get_event, 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 Event in a given project and location. + # + # @overload create_event(request, options = nil) + # Pass arguments to `create_event` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::CreateEventRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::CreateEventRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_event(parent: nil, event_id: nil, event: nil, request_id: nil) + # Pass arguments to `create_event` via keyword arguments. Note that at + # least one keyword argument is 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. Value for parent. + # @param event_id [::String] + # Required. Id of the requesting object. + # @param event [::Google::Cloud::VisionAI::V1::Event, ::Hash] + # Required. The resource being created. + # @param request_id [::String] + # Optional. An optional request ID to identify requests. Specify a unique + # request ID so that if you must retry your request, the server will know to + # ignore the request if it has already been completed. The server will + # guarantee that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request ID, + # the server can check if original operation with the same request ID was + # received, and if so, will ignore the second request. This prevents clients + # from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # + # @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/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::StreamsService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::CreateEventRequest.new + # + # # Call the create_event method. + # result = client.create_event 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_event request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::CreateEventRequest + + # Converts hash 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_event.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::VisionAI::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_event.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_event.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @streams_service_stub.call_rpc :create_event, 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 + + ## + # Updates the parameters of a single Event. + # + # @overload update_event(request, options = nil) + # Pass arguments to `update_event` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::UpdateEventRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::UpdateEventRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_event(update_mask: nil, event: nil, request_id: nil) + # Pass arguments to `update_event` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. Field mask is used to specify the fields to be overwritten in the + # Event resource by the update. + # The fields specified in the update_mask are relative to the resource, not + # the full request. A field will be overwritten if it is in the mask. If the + # user does not provide a mask then all fields will be overwritten. + # @param event [::Google::Cloud::VisionAI::V1::Event, ::Hash] + # Required. The resource being updated. + # @param request_id [::String] + # Optional. An optional request ID to identify requests. Specify a unique + # request ID so that if you must retry your request, the server will know to + # ignore the request if it has already been completed. The server will + # guarantee that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request ID, + # the server can check if original operation with the same request ID was + # received, and if so, will ignore the second request. This prevents clients + # from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # + # @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/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::StreamsService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::UpdateEventRequest.new + # + # # Call the update_event method. + # result = client.update_event 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 update_event request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::UpdateEventRequest + + # Converts hash 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_event.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::VisionAI::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.event&.name + header_params["event.name"] = request.event.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_event.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_event.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @streams_service_stub.call_rpc :update_event, 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 single Event. + # + # @overload delete_event(request, options = nil) + # Pass arguments to `delete_event` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::DeleteEventRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::DeleteEventRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_event(name: nil, request_id: nil) + # Pass arguments to `delete_event` via keyword arguments. Note that at + # least one keyword argument is 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 resource. + # @param request_id [::String] + # Optional. An optional request ID to identify requests. Specify a unique + # request ID so that if you must retry your request, the server will know to + # ignore the request if it has already been completed. The server will + # guarantee that for at least 60 minutes after the first request. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request ID, + # the server can check if original operation with the same request ID was + # received, and if so, will ignore the second request. This prevents clients + # from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # + # @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/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::StreamsService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::DeleteEventRequest.new + # + # # Call the delete_event method. + # result = client.delete_event 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_event request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::DeleteEventRequest + + # Converts hash 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_event.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::VisionAI::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_event.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_event.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @streams_service_stub.call_rpc :delete_event, 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 + + ## + # Lists Series in a given project and location. + # + # @overload list_series(request, options = nil) + # Pass arguments to `list_series` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::ListSeriesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::ListSeriesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_series(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) + # Pass arguments to `list_series` via keyword arguments. Note that at + # least one keyword argument is 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. Parent value for ListSeriesRequest. + # @param page_size [::Integer] + # Requested page size. Server may return fewer items than requested. + # If unspecified, server will pick an appropriate default. + # @param page_token [::String] + # A token identifying a page of results the server should return. + # @param filter [::String] + # Filtering results. + # @param order_by [::String] + # Hint for how to order the results. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::VisionAI::V1::Series>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::VisionAI::V1::Series>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::StreamsService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::ListSeriesRequest.new + # + # # Call the list_series method. + # result = client.list_series 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::VisionAI::V1::Series. + # p item + # end + # + def list_series request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::ListSeriesRequest + + # Converts hash 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_series.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::VisionAI::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_series.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_series.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @streams_service_stub.call_rpc :list_series, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @streams_service_stub, :list_series, 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 + + ## + # Gets details of a single Series. + # + # @overload get_series(request, options = nil) + # Pass arguments to `get_series` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::GetSeriesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::GetSeriesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_series(name: nil) + # Pass arguments to `get_series` via keyword arguments. Note that at + # least one keyword argument is 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 resource. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::VisionAI::V1::Series] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::VisionAI::V1::Series] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::StreamsService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::GetSeriesRequest.new + # + # # Call the get_series method. + # result = client.get_series request + # + # # The returned object is of type Google::Cloud::VisionAI::V1::Series. + # p result + # + def get_series request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::GetSeriesRequest + + # Converts hash 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_series.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::VisionAI::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_series.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_series.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @streams_service_stub.call_rpc :get_series, 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 Series in a given project and location. + # + # @overload create_series(request, options = nil) + # Pass arguments to `create_series` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::CreateSeriesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::CreateSeriesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_series(parent: nil, series_id: nil, series: nil, request_id: nil) + # Pass arguments to `create_series` via keyword arguments. Note that at + # least one keyword argument is 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. Value for parent. + # @param series_id [::String] + # Required. Id of the requesting object. + # @param series [::Google::Cloud::VisionAI::V1::Series, ::Hash] + # Required. The resource being created. + # @param request_id [::String] + # Optional. An optional request ID to identify requests. Specify a unique + # request ID so that if you must retry your request, the server will know to + # ignore the request if it has already been completed. The server will + # guarantee that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request ID, + # the server can check if original operation with the same request ID was + # received, and if so, will ignore the second request. This prevents clients + # from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # + # @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/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::StreamsService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::CreateSeriesRequest.new + # + # # Call the create_series method. + # result = client.create_series 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_series request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::CreateSeriesRequest + + # Converts hash 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_series.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::VisionAI::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_series.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_series.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @streams_service_stub.call_rpc :create_series, 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 + + ## + # Updates the parameters of a single Event. + # + # @overload update_series(request, options = nil) + # Pass arguments to `update_series` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::UpdateSeriesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::UpdateSeriesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_series(update_mask: nil, series: nil, request_id: nil) + # Pass arguments to `update_series` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. Field mask is used to specify the fields to be overwritten in the + # Series resource by the update. The fields specified in the update_mask are + # relative to the resource, not the full request. A field will be overwritten + # if it is in the mask. If the user does not provide a mask then all fields + # will be overwritten. + # @param series [::Google::Cloud::VisionAI::V1::Series, ::Hash] + # Required. The resource being updated + # @param request_id [::String] + # Optional. An optional request ID to identify requests. Specify a unique + # request ID so that if you must retry your request, the server will know to + # ignore the request if it has already been completed. The server will + # guarantee that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request ID, + # the server can check if original operation with the same request ID was + # received, and if so, will ignore the second request. This prevents clients + # from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # + # @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/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::StreamsService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::UpdateSeriesRequest.new + # + # # Call the update_series method. + # result = client.update_series 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 update_series request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::UpdateSeriesRequest + + # Converts hash 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_series.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::VisionAI::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.series&.name + header_params["series.name"] = request.series.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_series.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_series.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @streams_service_stub.call_rpc :update_series, 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 single Series. + # + # @overload delete_series(request, options = nil) + # Pass arguments to `delete_series` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::DeleteSeriesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::DeleteSeriesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_series(name: nil, request_id: nil) + # Pass arguments to `delete_series` via keyword arguments. Note that at + # least one keyword argument is 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 resource. + # @param request_id [::String] + # Optional. An optional request ID to identify requests. Specify a unique + # request ID so that if you must retry your request, the server will know to + # ignore the request if it has already been completed. The server will + # guarantee that for at least 60 minutes after the first request. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request ID, + # the server can check if original operation with the same request ID was + # received, and if so, will ignore the second request. This prevents clients + # from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # + # @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/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::StreamsService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::DeleteSeriesRequest.new + # + # # Call the delete_series method. + # result = client.delete_series 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_series request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::DeleteSeriesRequest + + # Converts hash 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_series.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::VisionAI::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_series.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_series.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @streams_service_stub.call_rpc :delete_series, 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 + + ## + # Materialize a channel. + # + # @overload materialize_channel(request, options = nil) + # Pass arguments to `materialize_channel` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::MaterializeChannelRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::MaterializeChannelRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload materialize_channel(parent: nil, channel_id: nil, channel: nil, request_id: nil) + # Pass arguments to `materialize_channel` via keyword arguments. Note that at + # least one keyword argument is 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. Value for parent. + # @param channel_id [::String] + # Required. Id of the channel. + # @param channel [::Google::Cloud::VisionAI::V1::Channel, ::Hash] + # Required. The resource being created. + # @param request_id [::String] + # Optional. An optional request ID to identify requests. Specify a unique + # request ID so that if you must retry your request, the server will know to + # ignore the request if it has already been completed. The server will + # guarantee that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request ID, + # the server can check if original operation with the same request ID was + # received, and if so, will ignore the second request. This prevents clients + # from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # + # @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/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::StreamsService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::MaterializeChannelRequest.new + # + # # Call the materialize_channel method. + # result = client.materialize_channel 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 materialize_channel request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::MaterializeChannelRequest + + # Converts hash 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.materialize_channel.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::VisionAI::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.materialize_channel.timeout, + metadata: metadata, + retry_policy: @config.rpcs.materialize_channel.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @streams_service_stub.call_rpc :materialize_channel, 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 StreamsService API. + # + # This class represents the configuration for StreamsService, + # 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::VisionAI::V1::StreamsService::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_clusters to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::VisionAI::V1::StreamsService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_clusters.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::VisionAI::V1::StreamsService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_clusters.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::VisionAI::V1::StreamsService::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 = "visionai.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 StreamsService 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_clusters` + # @return [::Gapic::Config::Method] + # + attr_reader :list_clusters + ## + # RPC-specific configuration for `get_cluster` + # @return [::Gapic::Config::Method] + # + attr_reader :get_cluster + ## + # RPC-specific configuration for `create_cluster` + # @return [::Gapic::Config::Method] + # + attr_reader :create_cluster + ## + # RPC-specific configuration for `update_cluster` + # @return [::Gapic::Config::Method] + # + attr_reader :update_cluster + ## + # RPC-specific configuration for `delete_cluster` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_cluster + ## + # RPC-specific configuration for `list_streams` + # @return [::Gapic::Config::Method] + # + attr_reader :list_streams + ## + # RPC-specific configuration for `get_stream` + # @return [::Gapic::Config::Method] + # + attr_reader :get_stream + ## + # RPC-specific configuration for `create_stream` + # @return [::Gapic::Config::Method] + # + attr_reader :create_stream + ## + # RPC-specific configuration for `update_stream` + # @return [::Gapic::Config::Method] + # + attr_reader :update_stream + ## + # RPC-specific configuration for `delete_stream` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_stream + ## + # RPC-specific configuration for `get_stream_thumbnail` + # @return [::Gapic::Config::Method] + # + attr_reader :get_stream_thumbnail + ## + # RPC-specific configuration for `generate_stream_hls_token` + # @return [::Gapic::Config::Method] + # + attr_reader :generate_stream_hls_token + ## + # RPC-specific configuration for `list_events` + # @return [::Gapic::Config::Method] + # + attr_reader :list_events + ## + # RPC-specific configuration for `get_event` + # @return [::Gapic::Config::Method] + # + attr_reader :get_event + ## + # RPC-specific configuration for `create_event` + # @return [::Gapic::Config::Method] + # + attr_reader :create_event + ## + # RPC-specific configuration for `update_event` + # @return [::Gapic::Config::Method] + # + attr_reader :update_event + ## + # RPC-specific configuration for `delete_event` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_event + ## + # RPC-specific configuration for `list_series` + # @return [::Gapic::Config::Method] + # + attr_reader :list_series + ## + # RPC-specific configuration for `get_series` + # @return [::Gapic::Config::Method] + # + attr_reader :get_series + ## + # RPC-specific configuration for `create_series` + # @return [::Gapic::Config::Method] + # + attr_reader :create_series + ## + # RPC-specific configuration for `update_series` + # @return [::Gapic::Config::Method] + # + attr_reader :update_series + ## + # RPC-specific configuration for `delete_series` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_series + ## + # RPC-specific configuration for `materialize_channel` + # @return [::Gapic::Config::Method] + # + attr_reader :materialize_channel + + # @private + def initialize parent_rpcs = nil + list_clusters_config = parent_rpcs.list_clusters if parent_rpcs.respond_to? :list_clusters + @list_clusters = ::Gapic::Config::Method.new list_clusters_config + get_cluster_config = parent_rpcs.get_cluster if parent_rpcs.respond_to? :get_cluster + @get_cluster = ::Gapic::Config::Method.new get_cluster_config + create_cluster_config = parent_rpcs.create_cluster if parent_rpcs.respond_to? :create_cluster + @create_cluster = ::Gapic::Config::Method.new create_cluster_config + update_cluster_config = parent_rpcs.update_cluster if parent_rpcs.respond_to? :update_cluster + @update_cluster = ::Gapic::Config::Method.new update_cluster_config + delete_cluster_config = parent_rpcs.delete_cluster if parent_rpcs.respond_to? :delete_cluster + @delete_cluster = ::Gapic::Config::Method.new delete_cluster_config + list_streams_config = parent_rpcs.list_streams if parent_rpcs.respond_to? :list_streams + @list_streams = ::Gapic::Config::Method.new list_streams_config + get_stream_config = parent_rpcs.get_stream if parent_rpcs.respond_to? :get_stream + @get_stream = ::Gapic::Config::Method.new get_stream_config + create_stream_config = parent_rpcs.create_stream if parent_rpcs.respond_to? :create_stream + @create_stream = ::Gapic::Config::Method.new create_stream_config + update_stream_config = parent_rpcs.update_stream if parent_rpcs.respond_to? :update_stream + @update_stream = ::Gapic::Config::Method.new update_stream_config + delete_stream_config = parent_rpcs.delete_stream if parent_rpcs.respond_to? :delete_stream + @delete_stream = ::Gapic::Config::Method.new delete_stream_config + get_stream_thumbnail_config = parent_rpcs.get_stream_thumbnail if parent_rpcs.respond_to? :get_stream_thumbnail + @get_stream_thumbnail = ::Gapic::Config::Method.new get_stream_thumbnail_config + generate_stream_hls_token_config = parent_rpcs.generate_stream_hls_token if parent_rpcs.respond_to? :generate_stream_hls_token + @generate_stream_hls_token = ::Gapic::Config::Method.new generate_stream_hls_token_config + list_events_config = parent_rpcs.list_events if parent_rpcs.respond_to? :list_events + @list_events = ::Gapic::Config::Method.new list_events_config + get_event_config = parent_rpcs.get_event if parent_rpcs.respond_to? :get_event + @get_event = ::Gapic::Config::Method.new get_event_config + create_event_config = parent_rpcs.create_event if parent_rpcs.respond_to? :create_event + @create_event = ::Gapic::Config::Method.new create_event_config + update_event_config = parent_rpcs.update_event if parent_rpcs.respond_to? :update_event + @update_event = ::Gapic::Config::Method.new update_event_config + delete_event_config = parent_rpcs.delete_event if parent_rpcs.respond_to? :delete_event + @delete_event = ::Gapic::Config::Method.new delete_event_config + list_series_config = parent_rpcs.list_series if parent_rpcs.respond_to? :list_series + @list_series = ::Gapic::Config::Method.new list_series_config + get_series_config = parent_rpcs.get_series if parent_rpcs.respond_to? :get_series + @get_series = ::Gapic::Config::Method.new get_series_config + create_series_config = parent_rpcs.create_series if parent_rpcs.respond_to? :create_series + @create_series = ::Gapic::Config::Method.new create_series_config + update_series_config = parent_rpcs.update_series if parent_rpcs.respond_to? :update_series + @update_series = ::Gapic::Config::Method.new update_series_config + delete_series_config = parent_rpcs.delete_series if parent_rpcs.respond_to? :delete_series + @delete_series = ::Gapic::Config::Method.new delete_series_config + materialize_channel_config = parent_rpcs.materialize_channel if parent_rpcs.respond_to? :materialize_channel + @materialize_channel = ::Gapic::Config::Method.new materialize_channel_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/streams_service/credentials.rb b/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/streams_service/credentials.rb new file mode 100644 index 000000000000..cb4a5a1af909 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/streams_service/credentials.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! + +require "googleauth" + +module Google + module Cloud + module VisionAI + module V1 + module StreamsService + # Credentials for the StreamsService API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/cloud-platform" + ] + self.env_vars = [ + "GOOGLE_CLOUD_CREDENTIALS", + "GOOGLE_CLOUD_KEYFILE", + "GCLOUD_KEYFILE", + "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-vision_ai-v1/lib/google/cloud/vision_ai/v1/streams_service/operations.rb b/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/streams_service/operations.rb new file mode 100644 index 000000000000..07ea7e58b0aa --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/streams_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 VisionAI + module V1 + module StreamsService + # Service that implements Longrunning Operations API. + class Operations + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "visionai.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :operations_stub + + ## + # Configuration for the StreamsService 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 StreamsService 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::VisionAI::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::VisionAI::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::VisionAI::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::VisionAI::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::VisionAI::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 = "visionai.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-vision_ai-v1/lib/google/cloud/vision_ai/v1/streams_service/paths.rb b/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/streams_service/paths.rb new file mode 100644 index 000000000000..5420a55803e4 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/streams_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 VisionAI + module V1 + module StreamsService + # Path helper methods for the StreamsService API. + module Paths + ## + # Create a fully-qualified Channel resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/clusters/{cluster}/channels/{channel}` + # + # @param project [String] + # @param location [String] + # @param cluster [String] + # @param channel [String] + # + # @return [::String] + def channel_path project:, location:, cluster:, channel: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "cluster cannot contain /" if cluster.to_s.include? "/" + + "projects/#{project}/locations/#{location}/clusters/#{cluster}/channels/#{channel}" + end + + ## + # Create a fully-qualified Cluster resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/clusters/{cluster}` + # + # @param project [String] + # @param location [String] + # @param cluster [String] + # + # @return [::String] + def cluster_path project:, location:, cluster: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/clusters/#{cluster}" + end + + ## + # Create a fully-qualified Event resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/clusters/{cluster}/events/{event}` + # + # @param project [String] + # @param location [String] + # @param cluster [String] + # @param event [String] + # + # @return [::String] + def event_path project:, location:, cluster:, event: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "cluster cannot contain /" if cluster.to_s.include? "/" + + "projects/#{project}/locations/#{location}/clusters/#{cluster}/events/#{event}" + 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 Series resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/clusters/{cluster}/series/{series}` + # + # @param project [String] + # @param location [String] + # @param cluster [String] + # @param series [String] + # + # @return [::String] + def series_path project:, location:, cluster:, series: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "cluster cannot contain /" if cluster.to_s.include? "/" + + "projects/#{project}/locations/#{location}/clusters/#{cluster}/series/#{series}" + end + + ## + # Create a fully-qualified Stream resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/clusters/{cluster}/streams/{stream}` + # + # @param project [String] + # @param location [String] + # @param cluster [String] + # @param stream [String] + # + # @return [::String] + def stream_path project:, location:, cluster:, stream: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "cluster cannot contain /" if cluster.to_s.include? "/" + + "projects/#{project}/locations/#{location}/clusters/#{cluster}/streams/#{stream}" + end + + extend self + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/streams_service/rest.rb b/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/streams_service/rest.rb new file mode 100644 index 000000000000..757c90bf973e --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/streams_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/vision_ai/v1/version" +require "google/cloud/vision_ai/v1/bindings_override" + +require "google/cloud/vision_ai/v1/streams_service/credentials" +require "google/cloud/vision_ai/v1/streams_service/paths" +require "google/cloud/vision_ai/v1/streams_service/rest/operations" +require "google/cloud/vision_ai/v1/streams_service/rest/client" + +module Google + module Cloud + module VisionAI + module V1 + ## + # Service describing handlers for resources. + # Vision API and Vision AI API are two independent APIs developed by the same + # team. Vision API is for people to annotate their image while Vision AI is an + # e2e solution for customer to build their own computer vision application. + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/vision_ai/v1/streams_service/rest" + # client = ::Google::Cloud::VisionAI::V1::StreamsService::Rest::Client.new + # + module StreamsService + # Client for the REST transport + module Rest + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "rest", "helpers.rb" +require "google/cloud/vision_ai/v1/streams_service/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/streams_service/rest/client.rb b/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/streams_service/rest/client.rb new file mode 100644 index 000000000000..2afb823f4d8c --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/streams_service/rest/client.rb @@ -0,0 +1,2782 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/visionai/v1/streams_service_pb" +require "google/cloud/vision_ai/v1/streams_service/rest/service_stub" +require "google/cloud/location/rest" +require "google/iam/v1/rest" + +module Google + module Cloud + module VisionAI + module V1 + module StreamsService + module Rest + ## + # REST client for the StreamsService service. + # + # Service describing handlers for resources. + # Vision API and Vision AI API are two independent APIs developed by the same + # team. Vision API is for people to annotate their image while Vision AI is an + # e2e solution for customer to build their own computer vision application. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "visionai.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :streams_service_stub + + ## + # Configure the StreamsService Client class. + # + # See {::Google::Cloud::VisionAI::V1::StreamsService::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all StreamsService clients + # ::Google::Cloud::VisionAI::V1::StreamsService::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", "VisionAI", "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 + end + yield @configure if block_given? + @configure + end + + ## + # Configure the StreamsService 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::VisionAI::V1::StreamsService::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 + @streams_service_stub.universe_domain + end + + ## + # Create a new StreamsService REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::VisionAI::V1::StreamsService::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::VisionAI::V1::StreamsService::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the StreamsService 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::VisionAI::V1::StreamsService::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 + + @streams_service_stub = ::Google::Cloud::VisionAI::V1::StreamsService::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials, + logger: @config.logger + ) + + @streams_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 = @streams_service_stub.endpoint + config.universe_domain = @streams_service_stub.universe_domain + config.bindings_override = @config.bindings_override + config.logger = @streams_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 = @streams_service_stub.endpoint + config.universe_domain = @streams_service_stub.universe_domain + config.logger = @streams_service_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::VisionAI::V1::StreamsService::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 + @streams_service_stub.logger + end + + # Service calls + + ## + # Lists Clusters in a given project and location. + # + # @overload list_clusters(request, options = nil) + # Pass arguments to `list_clusters` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::ListClustersRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::ListClustersRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_clusters(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) + # Pass arguments to `list_clusters` via keyword arguments. Note that at + # least one keyword argument is 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. Parent value for ListClustersRequest. + # @param page_size [::Integer] + # Requested page size. Server may return fewer items than requested. + # If unspecified, server will pick an appropriate default. + # @param page_token [::String] + # A token identifying a page of results the server should return. + # @param filter [::String] + # Filtering results. + # @param order_by [::String] + # Hint for how to order the results. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::VisionAI::V1::Cluster>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::VisionAI::V1::Cluster>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::StreamsService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::ListClustersRequest.new + # + # # Call the list_clusters method. + # result = client.list_clusters 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::VisionAI::V1::Cluster. + # p item + # end + # + def list_clusters request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::ListClustersRequest + + # Converts hash 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_clusters.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::VisionAI::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_clusters.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_clusters.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @streams_service_stub.list_clusters request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @streams_service_stub, :list_clusters, "clusters", 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 details of a single Cluster. + # + # @overload get_cluster(request, options = nil) + # Pass arguments to `get_cluster` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::GetClusterRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::GetClusterRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_cluster(name: nil) + # Pass arguments to `get_cluster` via keyword arguments. Note that at + # least one keyword argument is 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 resource. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::VisionAI::V1::Cluster] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::VisionAI::V1::Cluster] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::StreamsService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::GetClusterRequest.new + # + # # Call the get_cluster method. + # result = client.get_cluster request + # + # # The returned object is of type Google::Cloud::VisionAI::V1::Cluster. + # p result + # + def get_cluster request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::GetClusterRequest + + # Converts hash 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_cluster.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::VisionAI::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_cluster.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_cluster.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @streams_service_stub.get_cluster 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 Cluster in a given project and location. + # + # @overload create_cluster(request, options = nil) + # Pass arguments to `create_cluster` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::CreateClusterRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::CreateClusterRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_cluster(parent: nil, cluster_id: nil, cluster: nil, request_id: nil) + # Pass arguments to `create_cluster` via keyword arguments. Note that at + # least one keyword argument is 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. Value for parent. + # @param cluster_id [::String] + # Required. Id of the requesting object. + # @param cluster [::Google::Cloud::VisionAI::V1::Cluster, ::Hash] + # Required. The resource being created. + # @param request_id [::String] + # Optional. An optional request ID to identify requests. Specify a unique + # request ID so that if you must retry your request, the server will know to + # ignore the request if it has already been completed. The server will + # guarantee that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request ID, + # the server can check if original operation with the same request ID was + # received, and if so, will ignore the second request. This prevents clients + # from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @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/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::StreamsService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::CreateClusterRequest.new + # + # # Call the create_cluster method. + # result = client.create_cluster 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_cluster request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::CreateClusterRequest + + # Converts hash 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_cluster.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::VisionAI::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_cluster.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_cluster.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @streams_service_stub.create_cluster 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 + + ## + # Updates the parameters of a single Cluster. + # + # @overload update_cluster(request, options = nil) + # Pass arguments to `update_cluster` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::UpdateClusterRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::UpdateClusterRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_cluster(update_mask: nil, cluster: nil, request_id: nil) + # Pass arguments to `update_cluster` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. Field mask is used to specify the fields to be overwritten in the + # Cluster resource by the update. + # The fields specified in the update_mask are relative to the resource, not + # the full request. A field will be overwritten if it is in the mask. If the + # user does not provide a mask then all fields will be overwritten. + # @param cluster [::Google::Cloud::VisionAI::V1::Cluster, ::Hash] + # Required. The resource being updated + # @param request_id [::String] + # Optional. An optional request ID to identify requests. Specify a unique + # request ID so that if you must retry your request, the server will know to + # ignore the request if it has already been completed. The server will + # guarantee that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request ID, + # the server can check if original operation with the same request ID was + # received, and if so, will ignore the second request. This prevents clients + # from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @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/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::StreamsService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::UpdateClusterRequest.new + # + # # Call the update_cluster method. + # result = client.update_cluster 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 update_cluster request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::UpdateClusterRequest + + # Converts hash 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_cluster.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::VisionAI::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_cluster.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_cluster.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @streams_service_stub.update_cluster 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 single Cluster. + # + # @overload delete_cluster(request, options = nil) + # Pass arguments to `delete_cluster` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::DeleteClusterRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::DeleteClusterRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_cluster(name: nil, request_id: nil) + # Pass arguments to `delete_cluster` via keyword arguments. Note that at + # least one keyword argument is 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 resource + # @param request_id [::String] + # Optional. An optional request ID to identify requests. Specify a unique + # request ID so that if you must retry your request, the server will know to + # ignore the request if it has already been completed. The server will + # guarantee that for at least 60 minutes after the first request. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request ID, + # the server can check if original operation with the same request ID was + # received, and if so, will ignore the second request. This prevents clients + # from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @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/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::StreamsService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::DeleteClusterRequest.new + # + # # Call the delete_cluster method. + # result = client.delete_cluster 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_cluster request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::DeleteClusterRequest + + # Converts hash 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_cluster.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::VisionAI::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_cluster.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_cluster.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @streams_service_stub.delete_cluster 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 + + ## + # Lists Streams in a given project and location. + # + # @overload list_streams(request, options = nil) + # Pass arguments to `list_streams` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::ListStreamsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::ListStreamsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_streams(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) + # Pass arguments to `list_streams` via keyword arguments. Note that at + # least one keyword argument is 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. Parent value for ListStreamsRequest. + # @param page_size [::Integer] + # Requested page size. Server may return fewer items than requested. + # If unspecified, server will pick an appropriate default. + # @param page_token [::String] + # A token identifying a page of results the server should return. + # @param filter [::String] + # Filtering results. + # @param order_by [::String] + # Hint for how to order the results. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::VisionAI::V1::Stream>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::VisionAI::V1::Stream>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::StreamsService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::ListStreamsRequest.new + # + # # Call the list_streams method. + # result = client.list_streams 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::VisionAI::V1::Stream. + # p item + # end + # + def list_streams request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::ListStreamsRequest + + # Converts hash 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_streams.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::VisionAI::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_streams.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_streams.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @streams_service_stub.list_streams request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @streams_service_stub, :list_streams, "streams", 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 details of a single Stream. + # + # @overload get_stream(request, options = nil) + # Pass arguments to `get_stream` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::GetStreamRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::GetStreamRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_stream(name: nil) + # Pass arguments to `get_stream` via keyword arguments. Note that at + # least one keyword argument is 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 resource. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::VisionAI::V1::Stream] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::VisionAI::V1::Stream] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::StreamsService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::GetStreamRequest.new + # + # # Call the get_stream method. + # result = client.get_stream request + # + # # The returned object is of type Google::Cloud::VisionAI::V1::Stream. + # p result + # + def get_stream request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::GetStreamRequest + + # Converts hash 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_stream.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::VisionAI::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_stream.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_stream.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @streams_service_stub.get_stream 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 Stream in a given project and location. + # + # @overload create_stream(request, options = nil) + # Pass arguments to `create_stream` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::CreateStreamRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::CreateStreamRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_stream(parent: nil, stream_id: nil, stream: nil, request_id: nil) + # Pass arguments to `create_stream` via keyword arguments. Note that at + # least one keyword argument is 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. Value for parent. + # @param stream_id [::String] + # Required. Id of the requesting object. + # @param stream [::Google::Cloud::VisionAI::V1::Stream, ::Hash] + # Required. The resource being created. + # @param request_id [::String] + # Optional. An optional request ID to identify requests. Specify a unique + # request ID so that if you must retry your request, the server will know to + # ignore the request if it has already been completed. The server will + # guarantee that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request ID, + # the server can check if original operation with the same request ID was + # received, and if so, will ignore the second request. This prevents clients + # from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @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/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::StreamsService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::CreateStreamRequest.new + # + # # Call the create_stream method. + # result = client.create_stream 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_stream request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::CreateStreamRequest + + # Converts hash 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_stream.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::VisionAI::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_stream.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_stream.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @streams_service_stub.create_stream 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 + + ## + # Updates the parameters of a single Stream. + # + # @overload update_stream(request, options = nil) + # Pass arguments to `update_stream` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::UpdateStreamRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::UpdateStreamRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_stream(update_mask: nil, stream: nil, request_id: nil) + # Pass arguments to `update_stream` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. Field mask is used to specify the fields to be overwritten in the + # Stream resource by the update. + # The fields specified in the update_mask are relative to the resource, not + # the full request. A field will be overwritten if it is in the mask. If the + # user does not provide a mask then all fields will be overwritten. + # @param stream [::Google::Cloud::VisionAI::V1::Stream, ::Hash] + # Required. The resource being updated. + # @param request_id [::String] + # Optional. An optional request ID to identify requests. Specify a unique + # request ID so that if you must retry your request, the server will know to + # ignore the request if it has already been completed. The server will + # guarantee that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request ID, + # the server can check if original operation with the same request ID was + # received, and if so, will ignore the second request. This prevents clients + # from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @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/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::StreamsService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::UpdateStreamRequest.new + # + # # Call the update_stream method. + # result = client.update_stream 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 update_stream request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::UpdateStreamRequest + + # Converts hash 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_stream.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::VisionAI::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_stream.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_stream.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @streams_service_stub.update_stream 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 single Stream. + # + # @overload delete_stream(request, options = nil) + # Pass arguments to `delete_stream` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::DeleteStreamRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::DeleteStreamRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_stream(name: nil, request_id: nil) + # Pass arguments to `delete_stream` via keyword arguments. Note that at + # least one keyword argument is 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 resource. + # @param request_id [::String] + # Optional. An optional request ID to identify requests. Specify a unique + # request ID so that if you must retry your request, the server will know to + # ignore the request if it has already been completed. The server will + # guarantee that for at least 60 minutes after the first request. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request ID, + # the server can check if original operation with the same request ID was + # received, and if so, will ignore the second request. This prevents clients + # from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @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/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::StreamsService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::DeleteStreamRequest.new + # + # # Call the delete_stream method. + # result = client.delete_stream 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_stream request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::DeleteStreamRequest + + # Converts hash 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_stream.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::VisionAI::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_stream.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_stream.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @streams_service_stub.delete_stream 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 + + ## + # Gets the thumbnail (image snapshot) of a single Stream. + # + # @overload get_stream_thumbnail(request, options = nil) + # Pass arguments to `get_stream_thumbnail` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::GetStreamThumbnailRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::GetStreamThumbnailRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_stream_thumbnail(stream: nil, gcs_object_name: nil, event: nil, request_id: nil) + # Pass arguments to `get_stream_thumbnail` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param stream [::String] + # Required. The name of the stream for to get the thumbnail from. + # @param gcs_object_name [::String] + # Required. The name of the GCS object to store the thumbnail image. + # @param event [::String] + # Optional. The name of the event. If unspecified, the thumbnail will be + # retrieved from the latest event. + # @param request_id [::String] + # Optional. An optional request ID to identify the requests. Specify a unique + # request ID so that if you must retry your request, the server will know to + # ignore the request if it has already been completed. The server will + # guarantee that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request ID, + # the server can check if original operation with the same request ID was + # received, and if so, will ignore the second request. This prevents clients + # from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @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/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::StreamsService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::GetStreamThumbnailRequest.new + # + # # Call the get_stream_thumbnail method. + # result = client.get_stream_thumbnail 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_stream_thumbnail request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::GetStreamThumbnailRequest + + # Converts hash 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_stream_thumbnail.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::VisionAI::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_stream_thumbnail.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_stream_thumbnail.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @streams_service_stub.get_stream_thumbnail 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 + + ## + # Generate the JWT auth token required to get the stream HLS contents. + # + # @overload generate_stream_hls_token(request, options = nil) + # Pass arguments to `generate_stream_hls_token` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::GenerateStreamHlsTokenRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::GenerateStreamHlsTokenRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_stream_hls_token(stream: nil) + # Pass arguments to `generate_stream_hls_token` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param stream [::String] + # Required. The name of the stream. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::VisionAI::V1::GenerateStreamHlsTokenResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::VisionAI::V1::GenerateStreamHlsTokenResponse] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::StreamsService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::GenerateStreamHlsTokenRequest.new + # + # # Call the generate_stream_hls_token method. + # result = client.generate_stream_hls_token request + # + # # The returned object is of type Google::Cloud::VisionAI::V1::GenerateStreamHlsTokenResponse. + # p result + # + def generate_stream_hls_token request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::GenerateStreamHlsTokenRequest + + # Converts hash 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_stream_hls_token.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::VisionAI::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_stream_hls_token.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.generate_stream_hls_token.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @streams_service_stub.generate_stream_hls_token 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 Events in a given project and location. + # + # @overload list_events(request, options = nil) + # Pass arguments to `list_events` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::ListEventsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::ListEventsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_events(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) + # Pass arguments to `list_events` via keyword arguments. Note that at + # least one keyword argument is 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. Parent value for ListEventsRequest. + # @param page_size [::Integer] + # Requested page size. Server may return fewer items than requested. + # If unspecified, server will pick an appropriate default. + # @param page_token [::String] + # A token identifying a page of results the server should return. + # @param filter [::String] + # Filtering results. + # @param order_by [::String] + # Hint for how to order the results. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::VisionAI::V1::Event>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::VisionAI::V1::Event>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::StreamsService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::ListEventsRequest.new + # + # # Call the list_events method. + # result = client.list_events 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::VisionAI::V1::Event. + # p item + # end + # + def list_events request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::ListEventsRequest + + # Converts hash 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_events.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::VisionAI::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_events.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_events.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @streams_service_stub.list_events request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @streams_service_stub, :list_events, "events", 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 details of a single Event. + # + # @overload get_event(request, options = nil) + # Pass arguments to `get_event` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::GetEventRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::GetEventRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_event(name: nil) + # Pass arguments to `get_event` via keyword arguments. Note that at + # least one keyword argument is 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 resource. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::VisionAI::V1::Event] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::VisionAI::V1::Event] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::StreamsService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::GetEventRequest.new + # + # # Call the get_event method. + # result = client.get_event request + # + # # The returned object is of type Google::Cloud::VisionAI::V1::Event. + # p result + # + def get_event request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::GetEventRequest + + # Converts hash 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_event.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::VisionAI::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_event.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_event.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @streams_service_stub.get_event 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 Event in a given project and location. + # + # @overload create_event(request, options = nil) + # Pass arguments to `create_event` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::CreateEventRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::CreateEventRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_event(parent: nil, event_id: nil, event: nil, request_id: nil) + # Pass arguments to `create_event` via keyword arguments. Note that at + # least one keyword argument is 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. Value for parent. + # @param event_id [::String] + # Required. Id of the requesting object. + # @param event [::Google::Cloud::VisionAI::V1::Event, ::Hash] + # Required. The resource being created. + # @param request_id [::String] + # Optional. An optional request ID to identify requests. Specify a unique + # request ID so that if you must retry your request, the server will know to + # ignore the request if it has already been completed. The server will + # guarantee that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request ID, + # the server can check if original operation with the same request ID was + # received, and if so, will ignore the second request. This prevents clients + # from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @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/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::StreamsService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::CreateEventRequest.new + # + # # Call the create_event method. + # result = client.create_event 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_event request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::CreateEventRequest + + # Converts hash 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_event.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::VisionAI::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_event.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_event.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @streams_service_stub.create_event 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 + + ## + # Updates the parameters of a single Event. + # + # @overload update_event(request, options = nil) + # Pass arguments to `update_event` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::UpdateEventRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::UpdateEventRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_event(update_mask: nil, event: nil, request_id: nil) + # Pass arguments to `update_event` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. Field mask is used to specify the fields to be overwritten in the + # Event resource by the update. + # The fields specified in the update_mask are relative to the resource, not + # the full request. A field will be overwritten if it is in the mask. If the + # user does not provide a mask then all fields will be overwritten. + # @param event [::Google::Cloud::VisionAI::V1::Event, ::Hash] + # Required. The resource being updated. + # @param request_id [::String] + # Optional. An optional request ID to identify requests. Specify a unique + # request ID so that if you must retry your request, the server will know to + # ignore the request if it has already been completed. The server will + # guarantee that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request ID, + # the server can check if original operation with the same request ID was + # received, and if so, will ignore the second request. This prevents clients + # from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @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/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::StreamsService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::UpdateEventRequest.new + # + # # Call the update_event method. + # result = client.update_event 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 update_event request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::UpdateEventRequest + + # Converts hash 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_event.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::VisionAI::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_event.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_event.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @streams_service_stub.update_event 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 single Event. + # + # @overload delete_event(request, options = nil) + # Pass arguments to `delete_event` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::DeleteEventRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::DeleteEventRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_event(name: nil, request_id: nil) + # Pass arguments to `delete_event` via keyword arguments. Note that at + # least one keyword argument is 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 resource. + # @param request_id [::String] + # Optional. An optional request ID to identify requests. Specify a unique + # request ID so that if you must retry your request, the server will know to + # ignore the request if it has already been completed. The server will + # guarantee that for at least 60 minutes after the first request. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request ID, + # the server can check if original operation with the same request ID was + # received, and if so, will ignore the second request. This prevents clients + # from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @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/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::StreamsService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::DeleteEventRequest.new + # + # # Call the delete_event method. + # result = client.delete_event 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_event request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::DeleteEventRequest + + # Converts hash 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_event.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::VisionAI::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_event.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_event.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @streams_service_stub.delete_event 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 + + ## + # Lists Series in a given project and location. + # + # @overload list_series(request, options = nil) + # Pass arguments to `list_series` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::ListSeriesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::ListSeriesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_series(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) + # Pass arguments to `list_series` via keyword arguments. Note that at + # least one keyword argument is 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. Parent value for ListSeriesRequest. + # @param page_size [::Integer] + # Requested page size. Server may return fewer items than requested. + # If unspecified, server will pick an appropriate default. + # @param page_token [::String] + # A token identifying a page of results the server should return. + # @param filter [::String] + # Filtering results. + # @param order_by [::String] + # Hint for how to order the results. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::VisionAI::V1::Series>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::VisionAI::V1::Series>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::StreamsService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::ListSeriesRequest.new + # + # # Call the list_series method. + # result = client.list_series 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::VisionAI::V1::Series. + # p item + # end + # + def list_series request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::ListSeriesRequest + + # Converts hash 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_series.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::VisionAI::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_series.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_series.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @streams_service_stub.list_series request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @streams_service_stub, :list_series, "series", 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 details of a single Series. + # + # @overload get_series(request, options = nil) + # Pass arguments to `get_series` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::GetSeriesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::GetSeriesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_series(name: nil) + # Pass arguments to `get_series` via keyword arguments. Note that at + # least one keyword argument is 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 resource. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::VisionAI::V1::Series] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::VisionAI::V1::Series] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::StreamsService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::GetSeriesRequest.new + # + # # Call the get_series method. + # result = client.get_series request + # + # # The returned object is of type Google::Cloud::VisionAI::V1::Series. + # p result + # + def get_series request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::GetSeriesRequest + + # Converts hash 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_series.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::VisionAI::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_series.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_series.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @streams_service_stub.get_series 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 Series in a given project and location. + # + # @overload create_series(request, options = nil) + # Pass arguments to `create_series` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::CreateSeriesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::CreateSeriesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_series(parent: nil, series_id: nil, series: nil, request_id: nil) + # Pass arguments to `create_series` via keyword arguments. Note that at + # least one keyword argument is 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. Value for parent. + # @param series_id [::String] + # Required. Id of the requesting object. + # @param series [::Google::Cloud::VisionAI::V1::Series, ::Hash] + # Required. The resource being created. + # @param request_id [::String] + # Optional. An optional request ID to identify requests. Specify a unique + # request ID so that if you must retry your request, the server will know to + # ignore the request if it has already been completed. The server will + # guarantee that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request ID, + # the server can check if original operation with the same request ID was + # received, and if so, will ignore the second request. This prevents clients + # from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @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/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::StreamsService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::CreateSeriesRequest.new + # + # # Call the create_series method. + # result = client.create_series 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_series request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::CreateSeriesRequest + + # Converts hash 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_series.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::VisionAI::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_series.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_series.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @streams_service_stub.create_series 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 + + ## + # Updates the parameters of a single Event. + # + # @overload update_series(request, options = nil) + # Pass arguments to `update_series` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::UpdateSeriesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::UpdateSeriesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_series(update_mask: nil, series: nil, request_id: nil) + # Pass arguments to `update_series` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. Field mask is used to specify the fields to be overwritten in the + # Series resource by the update. The fields specified in the update_mask are + # relative to the resource, not the full request. A field will be overwritten + # if it is in the mask. If the user does not provide a mask then all fields + # will be overwritten. + # @param series [::Google::Cloud::VisionAI::V1::Series, ::Hash] + # Required. The resource being updated + # @param request_id [::String] + # Optional. An optional request ID to identify requests. Specify a unique + # request ID so that if you must retry your request, the server will know to + # ignore the request if it has already been completed. The server will + # guarantee that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request ID, + # the server can check if original operation with the same request ID was + # received, and if so, will ignore the second request. This prevents clients + # from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @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/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::StreamsService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::UpdateSeriesRequest.new + # + # # Call the update_series method. + # result = client.update_series 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 update_series request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::UpdateSeriesRequest + + # Converts hash 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_series.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::VisionAI::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_series.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_series.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @streams_service_stub.update_series 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 single Series. + # + # @overload delete_series(request, options = nil) + # Pass arguments to `delete_series` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::DeleteSeriesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::DeleteSeriesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_series(name: nil, request_id: nil) + # Pass arguments to `delete_series` via keyword arguments. Note that at + # least one keyword argument is 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 resource. + # @param request_id [::String] + # Optional. An optional request ID to identify requests. Specify a unique + # request ID so that if you must retry your request, the server will know to + # ignore the request if it has already been completed. The server will + # guarantee that for at least 60 minutes after the first request. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request ID, + # the server can check if original operation with the same request ID was + # received, and if so, will ignore the second request. This prevents clients + # from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @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/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::StreamsService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::DeleteSeriesRequest.new + # + # # Call the delete_series method. + # result = client.delete_series 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_series request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::DeleteSeriesRequest + + # Converts hash 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_series.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::VisionAI::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_series.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_series.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @streams_service_stub.delete_series 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 + + ## + # Materialize a channel. + # + # @overload materialize_channel(request, options = nil) + # Pass arguments to `materialize_channel` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::MaterializeChannelRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::MaterializeChannelRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload materialize_channel(parent: nil, channel_id: nil, channel: nil, request_id: nil) + # Pass arguments to `materialize_channel` via keyword arguments. Note that at + # least one keyword argument is 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. Value for parent. + # @param channel_id [::String] + # Required. Id of the channel. + # @param channel [::Google::Cloud::VisionAI::V1::Channel, ::Hash] + # Required. The resource being created. + # @param request_id [::String] + # Optional. An optional request ID to identify requests. Specify a unique + # request ID so that if you must retry your request, the server will know to + # ignore the request if it has already been completed. The server will + # guarantee that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request ID, + # the server can check if original operation with the same request ID was + # received, and if so, will ignore the second request. This prevents clients + # from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @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/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::StreamsService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::MaterializeChannelRequest.new + # + # # Call the materialize_channel method. + # result = client.materialize_channel 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 materialize_channel request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::MaterializeChannelRequest + + # Converts hash 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.materialize_channel.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::VisionAI::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.materialize_channel.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.materialize_channel.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @streams_service_stub.materialize_channel 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 + + ## + # Configuration class for the StreamsService REST API. + # + # This class represents the configuration for StreamsService 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::VisionAI::V1::StreamsService::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_clusters to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::VisionAI::V1::StreamsService::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_clusters.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::VisionAI::V1::StreamsService::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_clusters.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 = "visionai.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 StreamsService 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_clusters` + # @return [::Gapic::Config::Method] + # + attr_reader :list_clusters + ## + # RPC-specific configuration for `get_cluster` + # @return [::Gapic::Config::Method] + # + attr_reader :get_cluster + ## + # RPC-specific configuration for `create_cluster` + # @return [::Gapic::Config::Method] + # + attr_reader :create_cluster + ## + # RPC-specific configuration for `update_cluster` + # @return [::Gapic::Config::Method] + # + attr_reader :update_cluster + ## + # RPC-specific configuration for `delete_cluster` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_cluster + ## + # RPC-specific configuration for `list_streams` + # @return [::Gapic::Config::Method] + # + attr_reader :list_streams + ## + # RPC-specific configuration for `get_stream` + # @return [::Gapic::Config::Method] + # + attr_reader :get_stream + ## + # RPC-specific configuration for `create_stream` + # @return [::Gapic::Config::Method] + # + attr_reader :create_stream + ## + # RPC-specific configuration for `update_stream` + # @return [::Gapic::Config::Method] + # + attr_reader :update_stream + ## + # RPC-specific configuration for `delete_stream` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_stream + ## + # RPC-specific configuration for `get_stream_thumbnail` + # @return [::Gapic::Config::Method] + # + attr_reader :get_stream_thumbnail + ## + # RPC-specific configuration for `generate_stream_hls_token` + # @return [::Gapic::Config::Method] + # + attr_reader :generate_stream_hls_token + ## + # RPC-specific configuration for `list_events` + # @return [::Gapic::Config::Method] + # + attr_reader :list_events + ## + # RPC-specific configuration for `get_event` + # @return [::Gapic::Config::Method] + # + attr_reader :get_event + ## + # RPC-specific configuration for `create_event` + # @return [::Gapic::Config::Method] + # + attr_reader :create_event + ## + # RPC-specific configuration for `update_event` + # @return [::Gapic::Config::Method] + # + attr_reader :update_event + ## + # RPC-specific configuration for `delete_event` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_event + ## + # RPC-specific configuration for `list_series` + # @return [::Gapic::Config::Method] + # + attr_reader :list_series + ## + # RPC-specific configuration for `get_series` + # @return [::Gapic::Config::Method] + # + attr_reader :get_series + ## + # RPC-specific configuration for `create_series` + # @return [::Gapic::Config::Method] + # + attr_reader :create_series + ## + # RPC-specific configuration for `update_series` + # @return [::Gapic::Config::Method] + # + attr_reader :update_series + ## + # RPC-specific configuration for `delete_series` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_series + ## + # RPC-specific configuration for `materialize_channel` + # @return [::Gapic::Config::Method] + # + attr_reader :materialize_channel + + # @private + def initialize parent_rpcs = nil + list_clusters_config = parent_rpcs.list_clusters if parent_rpcs.respond_to? :list_clusters + @list_clusters = ::Gapic::Config::Method.new list_clusters_config + get_cluster_config = parent_rpcs.get_cluster if parent_rpcs.respond_to? :get_cluster + @get_cluster = ::Gapic::Config::Method.new get_cluster_config + create_cluster_config = parent_rpcs.create_cluster if parent_rpcs.respond_to? :create_cluster + @create_cluster = ::Gapic::Config::Method.new create_cluster_config + update_cluster_config = parent_rpcs.update_cluster if parent_rpcs.respond_to? :update_cluster + @update_cluster = ::Gapic::Config::Method.new update_cluster_config + delete_cluster_config = parent_rpcs.delete_cluster if parent_rpcs.respond_to? :delete_cluster + @delete_cluster = ::Gapic::Config::Method.new delete_cluster_config + list_streams_config = parent_rpcs.list_streams if parent_rpcs.respond_to? :list_streams + @list_streams = ::Gapic::Config::Method.new list_streams_config + get_stream_config = parent_rpcs.get_stream if parent_rpcs.respond_to? :get_stream + @get_stream = ::Gapic::Config::Method.new get_stream_config + create_stream_config = parent_rpcs.create_stream if parent_rpcs.respond_to? :create_stream + @create_stream = ::Gapic::Config::Method.new create_stream_config + update_stream_config = parent_rpcs.update_stream if parent_rpcs.respond_to? :update_stream + @update_stream = ::Gapic::Config::Method.new update_stream_config + delete_stream_config = parent_rpcs.delete_stream if parent_rpcs.respond_to? :delete_stream + @delete_stream = ::Gapic::Config::Method.new delete_stream_config + get_stream_thumbnail_config = parent_rpcs.get_stream_thumbnail if parent_rpcs.respond_to? :get_stream_thumbnail + @get_stream_thumbnail = ::Gapic::Config::Method.new get_stream_thumbnail_config + generate_stream_hls_token_config = parent_rpcs.generate_stream_hls_token if parent_rpcs.respond_to? :generate_stream_hls_token + @generate_stream_hls_token = ::Gapic::Config::Method.new generate_stream_hls_token_config + list_events_config = parent_rpcs.list_events if parent_rpcs.respond_to? :list_events + @list_events = ::Gapic::Config::Method.new list_events_config + get_event_config = parent_rpcs.get_event if parent_rpcs.respond_to? :get_event + @get_event = ::Gapic::Config::Method.new get_event_config + create_event_config = parent_rpcs.create_event if parent_rpcs.respond_to? :create_event + @create_event = ::Gapic::Config::Method.new create_event_config + update_event_config = parent_rpcs.update_event if parent_rpcs.respond_to? :update_event + @update_event = ::Gapic::Config::Method.new update_event_config + delete_event_config = parent_rpcs.delete_event if parent_rpcs.respond_to? :delete_event + @delete_event = ::Gapic::Config::Method.new delete_event_config + list_series_config = parent_rpcs.list_series if parent_rpcs.respond_to? :list_series + @list_series = ::Gapic::Config::Method.new list_series_config + get_series_config = parent_rpcs.get_series if parent_rpcs.respond_to? :get_series + @get_series = ::Gapic::Config::Method.new get_series_config + create_series_config = parent_rpcs.create_series if parent_rpcs.respond_to? :create_series + @create_series = ::Gapic::Config::Method.new create_series_config + update_series_config = parent_rpcs.update_series if parent_rpcs.respond_to? :update_series + @update_series = ::Gapic::Config::Method.new update_series_config + delete_series_config = parent_rpcs.delete_series if parent_rpcs.respond_to? :delete_series + @delete_series = ::Gapic::Config::Method.new delete_series_config + materialize_channel_config = parent_rpcs.materialize_channel if parent_rpcs.respond_to? :materialize_channel + @materialize_channel = ::Gapic::Config::Method.new materialize_channel_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/streams_service/rest/operations.rb b/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/streams_service/rest/operations.rb new file mode 100644 index 000000000000..55fd98a9f0c3 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/streams_service/rest/operations.rb @@ -0,0 +1,974 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 VisionAI + module V1 + module StreamsService + module Rest + # Service that implements Longrunning Operations API. + class Operations + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "visionai.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :operations_stub + + ## + # Configuration for the StreamsService 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 StreamsService 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::VisionAI::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::VisionAI::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::VisionAI::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::VisionAI::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 = "visionai.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}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/?$}, 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] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/warehouseOperations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/corpora/[^/]+/assets/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/corpora/[^/]+/collections/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/corpora/[^/]+/imageIndexes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/corpora/[^/]+/indexes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/corpora/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/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{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + 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{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/streams_service/rest/service_stub.rb b/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/streams_service/rest/service_stub.rb new file mode 100644 index 000000000000..49d892a53343 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/streams_service/rest/service_stub.rb @@ -0,0 +1,1495 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/visionai/v1/streams_service_pb" + +module Google + module Cloud + module VisionAI + module V1 + module StreamsService + module Rest + ## + # REST service stub for the StreamsService 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_clusters REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::ListClustersRequest] + # 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::VisionAI::V1::ListClustersResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::VisionAI::V1::ListClustersResponse] + # A result object deserialized from the server's reply + def list_clusters request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_clusters_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_clusters", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::VisionAI::V1::ListClustersResponse.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_cluster REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::GetClusterRequest] + # 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::VisionAI::V1::Cluster] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::VisionAI::V1::Cluster] + # A result object deserialized from the server's reply + def get_cluster request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_cluster_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_cluster", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::VisionAI::V1::Cluster.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_cluster REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::CreateClusterRequest] + # 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_cluster request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_cluster_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_cluster", + 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 update_cluster REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::UpdateClusterRequest] + # 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 update_cluster request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_cluster_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_cluster", + 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_cluster REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::DeleteClusterRequest] + # 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_cluster request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_cluster_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_cluster", + 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 list_streams REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::ListStreamsRequest] + # 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::VisionAI::V1::ListStreamsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::VisionAI::V1::ListStreamsResponse] + # A result object deserialized from the server's reply + def list_streams request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_streams_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_streams", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::VisionAI::V1::ListStreamsResponse.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_stream REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::GetStreamRequest] + # 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::VisionAI::V1::Stream] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::VisionAI::V1::Stream] + # A result object deserialized from the server's reply + def get_stream request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_stream_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_stream", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::VisionAI::V1::Stream.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_stream REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::CreateStreamRequest] + # 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_stream request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_stream_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_stream", + 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 update_stream REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::UpdateStreamRequest] + # 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 update_stream request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_stream_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_stream", + 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_stream REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::DeleteStreamRequest] + # 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_stream request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_stream_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_stream", + 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_stream_thumbnail REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::GetStreamThumbnailRequest] + # 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_stream_thumbnail request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_stream_thumbnail_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_stream_thumbnail", + 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 generate_stream_hls_token REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::GenerateStreamHlsTokenRequest] + # 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::VisionAI::V1::GenerateStreamHlsTokenResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::VisionAI::V1::GenerateStreamHlsTokenResponse] + # A result object deserialized from the server's reply + def generate_stream_hls_token request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_generate_stream_hls_token_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_stream_hls_token", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::VisionAI::V1::GenerateStreamHlsTokenResponse.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_events REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::ListEventsRequest] + # 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::VisionAI::V1::ListEventsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::VisionAI::V1::ListEventsResponse] + # A result object deserialized from the server's reply + def list_events request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_events_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_events", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::VisionAI::V1::ListEventsResponse.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_event REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::GetEventRequest] + # 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::VisionAI::V1::Event] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::VisionAI::V1::Event] + # A result object deserialized from the server's reply + def get_event request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_event_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_event", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::VisionAI::V1::Event.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_event REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::CreateEventRequest] + # 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_event request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_event_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_event", + 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 update_event REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::UpdateEventRequest] + # 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 update_event request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_event_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_event", + 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_event REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::DeleteEventRequest] + # 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_event request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_event_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_event", + 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 list_series REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::ListSeriesRequest] + # 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::VisionAI::V1::ListSeriesResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::VisionAI::V1::ListSeriesResponse] + # A result object deserialized from the server's reply + def list_series request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_series_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_series", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::VisionAI::V1::ListSeriesResponse.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_series REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::GetSeriesRequest] + # 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::VisionAI::V1::Series] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::VisionAI::V1::Series] + # A result object deserialized from the server's reply + def get_series request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_series_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_series", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::VisionAI::V1::Series.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_series REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::CreateSeriesRequest] + # 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_series request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_series_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_series", + 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 update_series REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::UpdateSeriesRequest] + # 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 update_series request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_series_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_series", + 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_series REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::DeleteSeriesRequest] + # 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_series request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_series_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_series", + 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 materialize_channel REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::MaterializeChannelRequest] + # 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 materialize_channel request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_materialize_channel_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: "materialize_channel", + 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 + + ## + # @private + # + # GRPC transcoding helper method for the list_clusters REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::ListClustersRequest] + # 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_clusters_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/clusters", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_cluster REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::GetClusterRequest] + # 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_cluster_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/clusters/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_cluster REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::CreateClusterRequest] + # 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_cluster_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/clusters", + body: "cluster", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_cluster REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::UpdateClusterRequest] + # 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_cluster_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v1/{cluster.name}", + body: "cluster", + matches: [ + ["cluster.name", %r{^projects/[^/]+/locations/[^/]+/clusters/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_cluster REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::DeleteClusterRequest] + # 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_cluster_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/clusters/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_streams REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::ListStreamsRequest] + # 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_streams_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/streams", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/clusters/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_stream REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::GetStreamRequest] + # 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_stream_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/clusters/[^/]+/streams/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_stream REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::CreateStreamRequest] + # 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_stream_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/streams", + body: "stream", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/clusters/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_stream REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::UpdateStreamRequest] + # 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_stream_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v1/{stream.name}", + body: "stream", + matches: [ + ["stream.name", %r{^projects/[^/]+/locations/[^/]+/clusters/[^/]+/streams/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_stream REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::DeleteStreamRequest] + # 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_stream_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/clusters/[^/]+/streams/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_stream_thumbnail REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::GetStreamThumbnailRequest] + # 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_stream_thumbnail_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{stream}:getThumbnail", + body: "*", + matches: [ + ["stream", %r{^projects/[^/]+/locations/[^/]+/clusters/[^/]+/streams/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the generate_stream_hls_token REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::GenerateStreamHlsTokenRequest] + # 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_stream_hls_token_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{stream}:generateStreamHlsToken", + body: "*", + matches: [ + ["stream", %r{^projects/[^/]+/locations/[^/]+/clusters/[^/]+/streams/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_events REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::ListEventsRequest] + # 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_events_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/events", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/clusters/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_event REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::GetEventRequest] + # 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_event_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/clusters/[^/]+/events/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_event REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::CreateEventRequest] + # 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_event_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/events", + body: "event", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/clusters/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_event REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::UpdateEventRequest] + # 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_event_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v1/{event.name}", + body: "event", + matches: [ + ["event.name", %r{^projects/[^/]+/locations/[^/]+/clusters/[^/]+/events/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_event REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::DeleteEventRequest] + # 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_event_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/clusters/[^/]+/events/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_series REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::ListSeriesRequest] + # 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_series_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/series", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/clusters/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_series REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::GetSeriesRequest] + # 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_series_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/clusters/[^/]+/series/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_series REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::CreateSeriesRequest] + # 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_series_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/series", + body: "series", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/clusters/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_series REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::UpdateSeriesRequest] + # 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_series_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v1/{series.name}", + body: "series", + matches: [ + ["series.name", %r{^projects/[^/]+/locations/[^/]+/clusters/[^/]+/series/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_series REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::DeleteSeriesRequest] + # 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_series_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/clusters/[^/]+/series/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the materialize_channel REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::MaterializeChannelRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_materialize_channel_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/channels", + body: "channel", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/clusters/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/version.rb b/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/version.rb new file mode 100644 index 000000000000..dd2a2e130b69 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/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 VisionAI + module V1 + VERSION = "0.0.1" + end + end + end +end diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/warehouse.rb b/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/warehouse.rb new file mode 100644 index 000000000000..50fa7e50f9fb --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/warehouse.rb @@ -0,0 +1,56 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/vision_ai/v1/version" + +require "google/cloud/vision_ai/v1/warehouse/credentials" +require "google/cloud/vision_ai/v1/warehouse/paths" +require "google/cloud/vision_ai/v1/warehouse/operations" +require "google/cloud/vision_ai/v1/warehouse/client" +require "google/cloud/vision_ai/v1/warehouse/rest" + +module Google + module Cloud + module VisionAI + module V1 + ## + # Service that manages media content + metadata for streaming. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/vision_ai/v1/warehouse" + # client = ::Google::Cloud::VisionAI::V1::Warehouse::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/vision_ai/v1/warehouse/rest" + # client = ::Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new + # + module Warehouse + end + end + end + end +end + +helper_path = ::File.join __dir__, "warehouse", "helpers.rb" +require "google/cloud/vision_ai/v1/warehouse/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/warehouse/client.rb b/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/warehouse/client.rb new file mode 100644 index 000000000000..9f0a73b90543 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/warehouse/client.rb @@ -0,0 +1,6982 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/visionai/v1/warehouse_pb" +require "google/cloud/location" +require "google/iam/v1" + +module Google + module Cloud + module VisionAI + module V1 + module Warehouse + ## + # Client for the Warehouse service. + # + # Service that manages media content + metadata for streaming. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "warehouse-visionai.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :warehouse_stub + + ## + # Configure the Warehouse Client class. + # + # See {::Google::Cloud::VisionAI::V1::Warehouse::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all Warehouse clients + # ::Google::Cloud::VisionAI::V1::Warehouse::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", "VisionAI", "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.timeout = 60.0 + default_config.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.create_asset.timeout = 120.0 + default_config.rpcs.create_asset.retry_policy = { + initial_delay: 1.0, max_delay: 120.0, multiplier: 2.5, retry_codes: [14] + } + + default_config.rpcs.create_corpus.timeout = 120.0 + default_config.rpcs.create_corpus.retry_policy = { + initial_delay: 1.0, max_delay: 120.0, multiplier: 2.5, retry_codes: [14] + } + + default_config.rpcs.create_data_schema.timeout = 120.0 + default_config.rpcs.create_data_schema.retry_policy = { + initial_delay: 1.0, max_delay: 120.0, multiplier: 2.5, retry_codes: [14] + } + + default_config.rpcs.create_annotation.timeout = 120.0 + default_config.rpcs.create_annotation.retry_policy = { + initial_delay: 1.0, max_delay: 120.0, multiplier: 2.5, retry_codes: [14] + } + + default_config.rpcs.ingest_asset.timeout = 120.0 + default_config.rpcs.ingest_asset.retry_policy = { + initial_delay: 1.0, max_delay: 120.0, multiplier: 2.5, retry_codes: [14] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the Warehouse 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::VisionAI::V1::Warehouse::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 + @warehouse_stub.universe_domain + end + + ## + # Create a new Warehouse client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::VisionAI::V1::Warehouse::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::VisionAI::V1::Warehouse::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Warehouse 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/visionai/v1/warehouse_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 + + @warehouse_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::VisionAI::V1::Warehouse::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 + ) + + @warehouse_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 = @warehouse_stub.endpoint + config.universe_domain = @warehouse_stub.universe_domain + config.logger = @warehouse_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 = @warehouse_stub.endpoint + config.universe_domain = @warehouse_stub.universe_domain + config.logger = @warehouse_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::VisionAI::V1::Warehouse::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 + @warehouse_stub.logger + end + + # Service calls + + ## + # Creates an asset inside corpus. + # + # @overload create_asset(request, options = nil) + # Pass arguments to `create_asset` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::CreateAssetRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::CreateAssetRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_asset(parent: nil, asset: nil, asset_id: nil) + # Pass arguments to `create_asset` via keyword arguments. Note that at + # least one keyword argument is 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 parent resource where this asset will be created. + # Format: + # `projects/{project_number}/locations/{location_id}/corpora/{corpus_id}` + # @param asset [::Google::Cloud::VisionAI::V1::Asset, ::Hash] + # Required. The asset to create. + # @param asset_id [::String] + # Optional. The ID to use for the asset, which will become the final + # component of the asset's resource name if user choose to specify. + # Otherwise, asset id will be generated by system. + # + # This value should be up to 63 characters, and valid characters + # are /[a-z][0-9]-/. The first character must be a letter, the last could be + # a letter or a number. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::VisionAI::V1::Asset] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::VisionAI::V1::Asset] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::Warehouse::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::CreateAssetRequest.new + # + # # Call the create_asset method. + # result = client.create_asset request + # + # # The returned object is of type Google::Cloud::VisionAI::V1::Asset. + # p result + # + def create_asset request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::CreateAssetRequest + + # Converts hash 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_asset.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::VisionAI::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_asset.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_asset.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @warehouse_stub.call_rpc :create_asset, 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 asset inside corpus. + # + # @overload update_asset(request, options = nil) + # Pass arguments to `update_asset` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::UpdateAssetRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::UpdateAssetRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_asset(asset: nil, update_mask: nil) + # Pass arguments to `update_asset` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param asset [::Google::Cloud::VisionAI::V1::Asset, ::Hash] + # Required. The asset to update. + # + # The asset's `name` field is used to identify the asset to be updated. + # Format: + # `projects/{project_number}/locations/{location}/corpora/{corpus}/assets/{asset}` + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # The list of fields to be updated. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::VisionAI::V1::Asset] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::VisionAI::V1::Asset] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::Warehouse::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::UpdateAssetRequest.new + # + # # Call the update_asset method. + # result = client.update_asset request + # + # # The returned object is of type Google::Cloud::VisionAI::V1::Asset. + # p result + # + def update_asset request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::UpdateAssetRequest + + # Converts hash 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_asset.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::VisionAI::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.asset&.name + header_params["asset.name"] = request.asset.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_asset.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_asset.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @warehouse_stub.call_rpc :update_asset, 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 + + ## + # Reads an asset inside corpus. + # + # @overload get_asset(request, options = nil) + # Pass arguments to `get_asset` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::GetAssetRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::GetAssetRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_asset(name: nil) + # Pass arguments to `get_asset` via keyword arguments. Note that at + # least one keyword argument is 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 name of the asset to retrieve. + # Format: + # projects/\\{project_number}/locations/\\{location}/corpora/\\{corpus}/assets/\\{asset} + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::VisionAI::V1::Asset] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::VisionAI::V1::Asset] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::Warehouse::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::GetAssetRequest.new + # + # # Call the get_asset method. + # result = client.get_asset request + # + # # The returned object is of type Google::Cloud::VisionAI::V1::Asset. + # p result + # + def get_asset request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::GetAssetRequest + + # Converts hash 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_asset.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::VisionAI::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_asset.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_asset.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @warehouse_stub.call_rpc :get_asset, 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 an list of assets inside corpus. + # + # @overload list_assets(request, options = nil) + # Pass arguments to `list_assets` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::ListAssetsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::ListAssetsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_assets(parent: nil, page_size: nil, page_token: nil, filter: nil) + # Pass arguments to `list_assets` via keyword arguments. Note that at + # least one keyword argument is 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 parent, which owns this collection of assets. + # Format: + # `projects/{project_number}/locations/{location}/corpora/{corpus}` + # @param page_size [::Integer] + # The maximum number of assets to return. The service may return fewer than + # this value. + # If unspecified, at most 50 assets will be returned. + # The maximum value is 1000; values above 1000 will be coerced to 1000. + # @param page_token [::String] + # A page token, received from a previous `ListAssets` call. + # Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to `ListAssets` must match + # the call that provided the page token. + # @param filter [::String] + # The filter applied to the returned list. + # Only the following filterings are supported: + # "assets_with_contents = true", which returns assets with contents uploaded; + # "assets_with_contents = false", which returns assets without contents. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::VisionAI::V1::Asset>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::VisionAI::V1::Asset>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::Warehouse::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::ListAssetsRequest.new + # + # # Call the list_assets method. + # result = client.list_assets 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::VisionAI::V1::Asset. + # p item + # end + # + def list_assets request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::ListAssetsRequest + + # Converts hash 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_assets.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::VisionAI::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_assets.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_assets.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @warehouse_stub.call_rpc :list_assets, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @warehouse_stub, :list_assets, 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 asset inside corpus. + # + # @overload delete_asset(request, options = nil) + # Pass arguments to `delete_asset` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::DeleteAssetRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::DeleteAssetRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_asset(name: nil) + # Pass arguments to `delete_asset` via keyword arguments. Note that at + # least one keyword argument is 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 name of the asset to delete. + # Format: + # `projects/{project_number}/locations/{location}/corpora/{corpus}/assets/{asset}` + # + # @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/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::Warehouse::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::DeleteAssetRequest.new + # + # # Call the delete_asset method. + # result = client.delete_asset 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_asset request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::DeleteAssetRequest + + # Converts hash 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_asset.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::VisionAI::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_asset.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_asset.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @warehouse_stub.call_rpc :delete_asset, 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 + + ## + # Upload asset by specifing the asset Cloud Storage uri. + # For video warehouse, it requires users who call this API have read access + # to the cloud storage file. Once it is uploaded, it can be retrieved by + # GenerateRetrievalUrl API which by default, only can retrieve cloud storage + # files from the same project of the warehouse. To allow retrieval cloud + # storage files that are in a separate project, it requires to find the + # vision ai service account (Go to IAM, check checkbox to show "Include + # Google-provided role grants", search for "Cloud Vision AI Service Agent") + # and grant the read access of the cloud storage files to that service + # account. + # + # @overload upload_asset(request, options = nil) + # Pass arguments to `upload_asset` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::UploadAssetRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::UploadAssetRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload upload_asset(name: nil, asset_source: nil) + # Pass arguments to `upload_asset` via keyword arguments. Note that at + # least one keyword argument is 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 asset to upload. + # Format: + # `projects/{project_number}/locations/{location_id}/corpora/{corpus_id}/assets/{asset_id}` + # @param asset_source [::Google::Cloud::VisionAI::V1::AssetSource, ::Hash] + # The source of the asset. + # + # @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/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::Warehouse::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::UploadAssetRequest.new + # + # # Call the upload_asset method. + # result = client.upload_asset 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 upload_asset request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::UploadAssetRequest + + # Converts hash 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.upload_asset.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::VisionAI::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.upload_asset.timeout, + metadata: metadata, + retry_policy: @config.rpcs.upload_asset.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @warehouse_stub.call_rpc :upload_asset, 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 + + ## + # Generates a signed url for downloading the asset. + # For video warehouse, please see comment of UploadAsset about how to allow + # retrieval of cloud storage files in a different project. + # + # @overload generate_retrieval_url(request, options = nil) + # Pass arguments to `generate_retrieval_url` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::GenerateRetrievalUrlRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::GenerateRetrievalUrlRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_retrieval_url(name: nil) + # Pass arguments to `generate_retrieval_url` via keyword arguments. Note that at + # least one keyword argument is 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 asset to request signed url for. + # Format: + # `projects/{project_number}/locations/{location_id}/corpora/{corpus_id}/assets/{asset_id}` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::VisionAI::V1::GenerateRetrievalUrlResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::VisionAI::V1::GenerateRetrievalUrlResponse] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::Warehouse::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::GenerateRetrievalUrlRequest.new + # + # # Call the generate_retrieval_url method. + # result = client.generate_retrieval_url request + # + # # The returned object is of type Google::Cloud::VisionAI::V1::GenerateRetrievalUrlResponse. + # p result + # + def generate_retrieval_url request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::GenerateRetrievalUrlRequest + + # Converts hash 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_retrieval_url.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::VisionAI::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.generate_retrieval_url.timeout, + metadata: metadata, + retry_policy: @config.rpcs.generate_retrieval_url.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @warehouse_stub.call_rpc :generate_retrieval_url, 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 + + ## + # Analyze asset to power search capability. + # + # @overload analyze_asset(request, options = nil) + # Pass arguments to `analyze_asset` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::AnalyzeAssetRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::AnalyzeAssetRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload analyze_asset(name: nil) + # Pass arguments to `analyze_asset` via keyword arguments. Note that at + # least one keyword argument is 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 asset to analyze. + # Format: + # `projects/{project_number}/locations/{location_id}/corpora/{corpus_id}/assets/{asset_id}` + # + # @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/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::Warehouse::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::AnalyzeAssetRequest.new + # + # # Call the analyze_asset method. + # result = client.analyze_asset 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 analyze_asset request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::AnalyzeAssetRequest + + # Converts hash 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.analyze_asset.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::VisionAI::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.analyze_asset.timeout, + metadata: metadata, + retry_policy: @config.rpcs.analyze_asset.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @warehouse_stub.call_rpc :analyze_asset, 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 + + ## + # Index one asset for search. + # Supported corpus type: Corpus.Type.VIDEO_ON_DEMAND + # + # @overload index_asset(request, options = nil) + # Pass arguments to `index_asset` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::IndexAssetRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::IndexAssetRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload index_asset(name: nil, index: nil) + # Pass arguments to `index_asset` via keyword arguments. Note that at + # least one keyword argument is 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 asset to index. + # Format: + # `projects/{project_number}/locations/{location_id}/corpora/{corpus_id}/assets/{asset_id}` + # @param index [::String] + # Optional. The name of the index. + # Format: + # `projects/{project_number}/locations/{location}/corpora/{corpus}/indexes/{index}` + # + # @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/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::Warehouse::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::IndexAssetRequest.new + # + # # Call the index_asset method. + # result = client.index_asset 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 index_asset request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::IndexAssetRequest + + # Converts hash 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.index_asset.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::VisionAI::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.index_asset.timeout, + metadata: metadata, + retry_policy: @config.rpcs.index_asset.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @warehouse_stub.call_rpc :index_asset, 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 + + ## + # Remove one asset's index data for search. + # Supported corpus type: Corpus.Type.VIDEO_ON_DEMAND + # + # @overload remove_index_asset(request, options = nil) + # Pass arguments to `remove_index_asset` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::RemoveIndexAssetRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::RemoveIndexAssetRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload remove_index_asset(name: nil, index: nil) + # Pass arguments to `remove_index_asset` via keyword arguments. Note that at + # least one keyword argument is 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 asset to index. + # Format: + # `projects/{project_number}/locations/{location_id}/corpora/{corpus_id}/assets/{asset_id}` + # @param index [::String] + # Optional. The name of the index. + # Format: + # `projects/{project_number}/locations/{location}/corpora/{corpus}/indexes/{index}` + # + # @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/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::Warehouse::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::RemoveIndexAssetRequest.new + # + # # Call the remove_index_asset method. + # result = client.remove_index_asset 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 remove_index_asset request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::RemoveIndexAssetRequest + + # Converts hash 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.remove_index_asset.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::VisionAI::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.remove_index_asset.timeout, + metadata: metadata, + retry_policy: @config.rpcs.remove_index_asset.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @warehouse_stub.call_rpc :remove_index_asset, 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 + + ## + # Lists assets inside an index. + # + # @overload view_indexed_assets(request, options = nil) + # Pass arguments to `view_indexed_assets` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::ViewIndexedAssetsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::ViewIndexedAssetsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload view_indexed_assets(index: nil, page_size: nil, page_token: nil, filter: nil) + # Pass arguments to `view_indexed_assets` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param index [::String] + # Required. The index that owns this collection of assets. + # Format: + # `projects/{project_number}/locations/{location}/corpora/{corpus}/indexes/{index}` + # @param page_size [::Integer] + # The maximum number of assets to return. The service may return fewer than + # this value. + # If unspecified, at most 50 assets will be returned. + # The maximum value is 1000; values above 1000 will be coerced to 1000. + # @param page_token [::String] + # A page token, received from a previous `ViewIndexedAssets` call. + # Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to `ViewIndexedAssets` must + # match the call that provided the page token. + # @param filter [::String] + # The filter applied to the returned list. + # Only the following filterings are supported: + # "asset_id = xxxx", which returns asset with specified id. + # "asset_id = xxxx, yyyy, zzzz", which returns assets with specified ids. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::VisionAI::V1::IndexedAsset>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::VisionAI::V1::IndexedAsset>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::Warehouse::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::ViewIndexedAssetsRequest.new + # + # # Call the view_indexed_assets method. + # result = client.view_indexed_assets 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::VisionAI::V1::IndexedAsset. + # p item + # end + # + def view_indexed_assets request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::ViewIndexedAssetsRequest + + # Converts hash 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.view_indexed_assets.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::VisionAI::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.index + header_params["index"] = request.index + 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.view_indexed_assets.timeout, + metadata: metadata, + retry_policy: @config.rpcs.view_indexed_assets.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @warehouse_stub.call_rpc :view_indexed_assets, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @warehouse_stub, :view_indexed_assets, 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 + + ## + # Creates an Index under the corpus. + # + # @overload create_index(request, options = nil) + # Pass arguments to `create_index` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::CreateIndexRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::CreateIndexRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_index(parent: nil, index_id: nil, index: nil) + # Pass arguments to `create_index` via keyword arguments. Note that at + # least one keyword argument is 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. Value for the parent. The resource name of the Corpus under which + # this index is created. Format: + # `projects/{project_number}/locations/{location_id}/corpora/{corpus_id}` + # @param index_id [::String] + # Optional. The ID for the index. This will become the final resource name + # for the index. If the user does not specify this value, it will be + # generated by system. + # + # This value should be up to 63 characters, and valid characters + # are /[a-z][0-9]-/. The first character must be a letter, the last could be + # a letter or a number. + # @param index [::Google::Cloud::VisionAI::V1::Index, ::Hash] + # Required. The index being created. + # + # @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/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::Warehouse::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::CreateIndexRequest.new + # + # # Call the create_index method. + # result = client.create_index 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_index request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::CreateIndexRequest + + # Converts hash 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_index.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::VisionAI::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_index.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_index.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @warehouse_stub.call_rpc :create_index, 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 + + ## + # Updates an Index under the corpus. + # Users can perform a metadata-only update or trigger a full index rebuild + # with different update_mask values. + # + # @overload update_index(request, options = nil) + # Pass arguments to `update_index` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::UpdateIndexRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::UpdateIndexRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_index(index: nil, update_mask: nil) + # Pass arguments to `update_index` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param index [::Google::Cloud::VisionAI::V1::Index, ::Hash] + # Required. The resource being updated. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. Field mask is used to specify the fields to be overwritten in the + # Index resource by the update. The fields specified in the update_mask are + # relative to the resource, not the full request. A field of the resource + # will be overwritten if it is in the mask. Empty field mask is not allowed. + # If the mask is "*", it triggers a full update of the index, and also a + # whole rebuild of index data. + # + # @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/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::Warehouse::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::UpdateIndexRequest.new + # + # # Call the update_index method. + # result = client.update_index 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 update_index request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::UpdateIndexRequest + + # Converts hash 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_index.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::VisionAI::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.index&.name + header_params["index.name"] = request.index.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_index.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_index.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @warehouse_stub.call_rpc :update_index, 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 + + ## + # Gets the details of a single Index under a Corpus. + # + # @overload get_index(request, options = nil) + # Pass arguments to `get_index` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::GetIndexRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::GetIndexRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_index(name: nil) + # Pass arguments to `get_index` via keyword arguments. Note that at + # least one keyword argument is 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 Index resource. + # Format: + # `projects/{project_number}/locations/{location}/corpora/{corpus}/indexes/{index}` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::VisionAI::V1::Index] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::VisionAI::V1::Index] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::Warehouse::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::GetIndexRequest.new + # + # # Call the get_index method. + # result = client.get_index request + # + # # The returned object is of type Google::Cloud::VisionAI::V1::Index. + # p result + # + def get_index request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::GetIndexRequest + + # Converts hash 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_index.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::VisionAI::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_index.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_index.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @warehouse_stub.call_rpc :get_index, 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 + + ## + # List all Indexes in a given Corpus. + # + # @overload list_indexes(request, options = nil) + # Pass arguments to `list_indexes` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::ListIndexesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::ListIndexesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_indexes(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_indexes` via keyword arguments. Note that at + # least one keyword argument is 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 parent corpus that owns this collection of indexes. + # Format: + # `projects/{project_number}/locations/{location}/corpora/{corpus}` + # @param page_size [::Integer] + # The maximum number of indexes to return. The service may return fewer than + # this value. + # If unspecified, at most 50 indexes will be returned. + # The maximum value is 1000; values above 1000 will be coerced to 1000. + # @param page_token [::String] + # A page token, received from a previous `ListIndexes` call. + # Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to `ListIndexes` must match + # the call that provided the page token. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::VisionAI::V1::Index>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::VisionAI::V1::Index>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::Warehouse::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::ListIndexesRequest.new + # + # # Call the list_indexes method. + # result = client.list_indexes 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::VisionAI::V1::Index. + # p item + # end + # + def list_indexes request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::ListIndexesRequest + + # Converts hash 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_indexes.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::VisionAI::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_indexes.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_indexes.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @warehouse_stub.call_rpc :list_indexes, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @warehouse_stub, :list_indexes, 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 + + ## + # Delete a single Index. In order to delete an index, the caller must + # make sure that it is not deployed to any index endpoint. + # + # @overload delete_index(request, options = nil) + # Pass arguments to `delete_index` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::DeleteIndexRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::DeleteIndexRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_index(name: nil) + # Pass arguments to `delete_index` via keyword arguments. Note that at + # least one keyword argument is 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 name of the index to delete. + # Format: + # `projects/{project_number}/locations/{location}/corpora/{corpus}/indexes/{index}` + # + # @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/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::Warehouse::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::DeleteIndexRequest.new + # + # # Call the delete_index method. + # result = client.delete_index 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_index request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::DeleteIndexRequest + + # Converts hash 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_index.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::VisionAI::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_index.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_index.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @warehouse_stub.call_rpc :delete_index, 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 corpus inside a project. + # + # @overload create_corpus(request, options = nil) + # Pass arguments to `create_corpus` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::CreateCorpusRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::CreateCorpusRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_corpus(parent: nil, corpus: nil) + # Pass arguments to `create_corpus` via keyword arguments. Note that at + # least one keyword argument is 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. Form: `projects/{project_number}/locations/{location_id}` + # @param corpus [::Google::Cloud::VisionAI::V1::Corpus, ::Hash] + # Required. The corpus to be created. + # + # @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/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::Warehouse::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::CreateCorpusRequest.new + # + # # Call the create_corpus method. + # result = client.create_corpus 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_corpus request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::CreateCorpusRequest + + # Converts hash 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_corpus.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::VisionAI::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_corpus.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_corpus.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @warehouse_stub.call_rpc :create_corpus, 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 + + ## + # Gets corpus details inside a project. + # + # @overload get_corpus(request, options = nil) + # Pass arguments to `get_corpus` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::GetCorpusRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::GetCorpusRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_corpus(name: nil) + # Pass arguments to `get_corpus` via keyword arguments. Note that at + # least one keyword argument is 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 corpus to retrieve. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::VisionAI::V1::Corpus] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::VisionAI::V1::Corpus] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::Warehouse::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::GetCorpusRequest.new + # + # # Call the get_corpus method. + # result = client.get_corpus request + # + # # The returned object is of type Google::Cloud::VisionAI::V1::Corpus. + # p result + # + def get_corpus request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::GetCorpusRequest + + # Converts hash 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_corpus.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::VisionAI::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_corpus.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_corpus.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @warehouse_stub.call_rpc :get_corpus, 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 a corpus in a project. + # + # @overload update_corpus(request, options = nil) + # Pass arguments to `update_corpus` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::UpdateCorpusRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::UpdateCorpusRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_corpus(corpus: nil, update_mask: nil) + # Pass arguments to `update_corpus` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param corpus [::Google::Cloud::VisionAI::V1::Corpus, ::Hash] + # Required. The corpus which replaces the resource on the server. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # The list of fields to be updated. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::VisionAI::V1::Corpus] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::VisionAI::V1::Corpus] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::Warehouse::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::UpdateCorpusRequest.new + # + # # Call the update_corpus method. + # result = client.update_corpus request + # + # # The returned object is of type Google::Cloud::VisionAI::V1::Corpus. + # p result + # + def update_corpus request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::UpdateCorpusRequest + + # Converts hash 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_corpus.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::VisionAI::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.corpus&.name + header_params["corpus.name"] = request.corpus.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_corpus.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_corpus.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @warehouse_stub.call_rpc :update_corpus, 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 all corpora in a project. + # + # @overload list_corpora(request, options = nil) + # Pass arguments to `list_corpora` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::ListCorporaRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::ListCorporaRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_corpora(parent: nil, page_size: nil, page_token: nil, filter: nil) + # Pass arguments to `list_corpora` via keyword arguments. Note that at + # least one keyword argument is 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 project from which to list corpora. + # @param page_size [::Integer] + # Requested page size. API may return fewer results than requested. + # If negative, INVALID_ARGUMENT error will be returned. + # If unspecified or 0, API will pick a default size, which is 10. + # If the requested page size is larger than the maximum size, API will pick + # use the maximum size, which is 20. + # @param page_token [::String] + # A token identifying a page of results for the server to return. + # Typically obtained via + # {::Google::Cloud::VisionAI::V1::ListCorporaResponse#next_page_token ListCorporaResponse.next_page_token} + # of the previous + # {::Google::Cloud::VisionAI::V1::Warehouse::Client#list_corpora Warehouse.ListCorpora} + # call. + # @param filter [::String] + # The filter applied to the returned corpora list. + # Only the following restrictions are supported: + # `type=`, + # `type!=`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::VisionAI::V1::Corpus>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::VisionAI::V1::Corpus>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::Warehouse::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::ListCorporaRequest.new + # + # # Call the list_corpora method. + # result = client.list_corpora 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::VisionAI::V1::Corpus. + # p item + # end + # + def list_corpora request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::ListCorporaRequest + + # Converts hash 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_corpora.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::VisionAI::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_corpora.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_corpora.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @warehouse_stub.call_rpc :list_corpora, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @warehouse_stub, :list_corpora, 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 corpus only if its empty. + # Returns empty response. + # + # @overload delete_corpus(request, options = nil) + # Pass arguments to `delete_corpus` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::DeleteCorpusRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::DeleteCorpusRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_corpus(name: nil) + # Pass arguments to `delete_corpus` via keyword arguments. Note that at + # least one keyword argument is 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 corpus 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/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::Warehouse::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::DeleteCorpusRequest.new + # + # # Call the delete_corpus method. + # result = client.delete_corpus request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_corpus request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::DeleteCorpusRequest + + # Converts hash 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_corpus.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::VisionAI::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_corpus.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_corpus.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @warehouse_stub.call_rpc :delete_corpus, 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 + + ## + # Analyzes a corpus. + # + # @overload analyze_corpus(request, options = nil) + # Pass arguments to `analyze_corpus` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::AnalyzeCorpusRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::AnalyzeCorpusRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload analyze_corpus(name: nil) + # Pass arguments to `analyze_corpus` via keyword arguments. Note that at + # least one keyword argument is 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 parent corpus resource where the assets will be analyzed. + # Format: + # `projects/{project_number}/locations/{location_id}/corpora/{corpus_id}` + # + # @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/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::Warehouse::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::AnalyzeCorpusRequest.new + # + # # Call the analyze_corpus method. + # result = client.analyze_corpus 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 analyze_corpus request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::AnalyzeCorpusRequest + + # Converts hash 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.analyze_corpus.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::VisionAI::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.analyze_corpus.timeout, + metadata: metadata, + retry_policy: @config.rpcs.analyze_corpus.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @warehouse_stub.call_rpc :analyze_corpus, 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 data schema inside corpus. + # + # @overload create_data_schema(request, options = nil) + # Pass arguments to `create_data_schema` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::CreateDataSchemaRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::CreateDataSchemaRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_data_schema(parent: nil, data_schema: nil) + # Pass arguments to `create_data_schema` via keyword arguments. Note that at + # least one keyword argument is 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 parent resource where this data schema will be created. + # Format: + # `projects/{project_number}/locations/{location_id}/corpora/{corpus_id}` + # @param data_schema [::Google::Cloud::VisionAI::V1::DataSchema, ::Hash] + # Required. The data schema to create. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::VisionAI::V1::DataSchema] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::VisionAI::V1::DataSchema] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::Warehouse::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::CreateDataSchemaRequest.new + # + # # Call the create_data_schema method. + # result = client.create_data_schema request + # + # # The returned object is of type Google::Cloud::VisionAI::V1::DataSchema. + # p result + # + def create_data_schema request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::CreateDataSchemaRequest + + # Converts hash 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_data_schema.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::VisionAI::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_data_schema.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_data_schema.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @warehouse_stub.call_rpc :create_data_schema, 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 data schema inside corpus. + # + # @overload update_data_schema(request, options = nil) + # Pass arguments to `update_data_schema` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::UpdateDataSchemaRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::UpdateDataSchemaRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_data_schema(data_schema: nil, update_mask: nil) + # Pass arguments to `update_data_schema` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param data_schema [::Google::Cloud::VisionAI::V1::DataSchema, ::Hash] + # Required. The data schema's `name` field is used to identify the data + # schema to be updated. Format: + # `projects/{project_number}/locations/{location}/corpora/{corpus}/dataSchemas/{data_schema}` + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # The list of fields to be updated. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::VisionAI::V1::DataSchema] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::VisionAI::V1::DataSchema] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::Warehouse::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::UpdateDataSchemaRequest.new + # + # # Call the update_data_schema method. + # result = client.update_data_schema request + # + # # The returned object is of type Google::Cloud::VisionAI::V1::DataSchema. + # p result + # + def update_data_schema request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::UpdateDataSchemaRequest + + # Converts hash 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_data_schema.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::VisionAI::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.data_schema&.name + header_params["data_schema.name"] = request.data_schema.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_data_schema.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_data_schema.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @warehouse_stub.call_rpc :update_data_schema, 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 + + ## + # Gets data schema inside corpus. + # + # @overload get_data_schema(request, options = nil) + # Pass arguments to `get_data_schema` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::GetDataSchemaRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::GetDataSchemaRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_data_schema(name: nil) + # Pass arguments to `get_data_schema` via keyword arguments. Note that at + # least one keyword argument is 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 name of the data schema to retrieve. + # Format: + # `projects/{project_number}/locations/{location_id}/corpora/{corpus_id}/dataSchemas/{data_schema_id}` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::VisionAI::V1::DataSchema] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::VisionAI::V1::DataSchema] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::Warehouse::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::GetDataSchemaRequest.new + # + # # Call the get_data_schema method. + # result = client.get_data_schema request + # + # # The returned object is of type Google::Cloud::VisionAI::V1::DataSchema. + # p result + # + def get_data_schema request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::GetDataSchemaRequest + + # Converts hash 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_data_schema.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::VisionAI::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_data_schema.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_data_schema.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @warehouse_stub.call_rpc :get_data_schema, 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 + + ## + # Deletes data schema inside corpus. + # + # @overload delete_data_schema(request, options = nil) + # Pass arguments to `delete_data_schema` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::DeleteDataSchemaRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::DeleteDataSchemaRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_data_schema(name: nil) + # Pass arguments to `delete_data_schema` via keyword arguments. Note that at + # least one keyword argument is 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 name of the data schema to delete. + # Format: + # `projects/{project_number}/locations/{location_id}/corpora/{corpus_id}/dataSchemas/{data_schema_id}` + # + # @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/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::Warehouse::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::DeleteDataSchemaRequest.new + # + # # Call the delete_data_schema method. + # result = client.delete_data_schema request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_data_schema request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::DeleteDataSchemaRequest + + # Converts hash 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_data_schema.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::VisionAI::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_data_schema.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_data_schema.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @warehouse_stub.call_rpc :delete_data_schema, 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 a list of data schemas inside corpus. + # + # @overload list_data_schemas(request, options = nil) + # Pass arguments to `list_data_schemas` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::ListDataSchemasRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::ListDataSchemasRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_data_schemas(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_data_schemas` via keyword arguments. Note that at + # least one keyword argument is 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 parent, which owns this collection of data schemas. + # Format: + # `projects/{project_number}/locations/{location_id}/corpora/{corpus_id}` + # @param page_size [::Integer] + # The maximum number of data schemas to return. The service may return fewer + # than this value. If unspecified, at most 50 data schemas will be returned. + # The maximum value is 1000; values above 1000 will be coerced to 1000. + # @param page_token [::String] + # A page token, received from a previous `ListDataSchemas` call. + # Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to `ListDataSchemas` must + # match the call that provided the page token. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::VisionAI::V1::DataSchema>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::VisionAI::V1::DataSchema>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::Warehouse::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::ListDataSchemasRequest.new + # + # # Call the list_data_schemas method. + # result = client.list_data_schemas 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::VisionAI::V1::DataSchema. + # p item + # end + # + def list_data_schemas request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::ListDataSchemasRequest + + # Converts hash 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_data_schemas.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::VisionAI::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_data_schemas.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_data_schemas.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @warehouse_stub.call_rpc :list_data_schemas, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @warehouse_stub, :list_data_schemas, 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 + + ## + # Creates annotation inside asset. + # + # @overload create_annotation(request, options = nil) + # Pass arguments to `create_annotation` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::CreateAnnotationRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::CreateAnnotationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_annotation(parent: nil, annotation: nil, annotation_id: nil) + # Pass arguments to `create_annotation` via keyword arguments. Note that at + # least one keyword argument is 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 parent resource where this annotation will be created. + # Format: + # `projects/{project_number}/locations/{location_id}/corpora/{corpus_id}/assets/{asset_id}` + # @param annotation [::Google::Cloud::VisionAI::V1::Annotation, ::Hash] + # Required. The annotation to create. + # @param annotation_id [::String] + # Optional. The ID to use for the annotation, which will become the final + # component of the annotation's resource name if user choose to specify. + # Otherwise, annotation id will be generated by system. + # + # This value should be up to 63 characters, and valid characters + # are /[a-z][0-9]-/. The first character must be a letter, the last could be + # a letter or a number. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::VisionAI::V1::Annotation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::VisionAI::V1::Annotation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::Warehouse::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::CreateAnnotationRequest.new + # + # # Call the create_annotation method. + # result = client.create_annotation request + # + # # The returned object is of type Google::Cloud::VisionAI::V1::Annotation. + # p result + # + def create_annotation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::CreateAnnotationRequest + + # Converts hash 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_annotation.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::VisionAI::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_annotation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_annotation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @warehouse_stub.call_rpc :create_annotation, 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 + + ## + # Reads annotation inside asset. + # + # @overload get_annotation(request, options = nil) + # Pass arguments to `get_annotation` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::GetAnnotationRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::GetAnnotationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_annotation(name: nil) + # Pass arguments to `get_annotation` via keyword arguments. Note that at + # least one keyword argument is 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 name of the annotation to retrieve. + # Format: + # `projects/{project_number}/locations/{location}/corpora/{corpus}/assets/{asset}/annotations/{annotation}` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::VisionAI::V1::Annotation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::VisionAI::V1::Annotation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::Warehouse::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::GetAnnotationRequest.new + # + # # Call the get_annotation method. + # result = client.get_annotation request + # + # # The returned object is of type Google::Cloud::VisionAI::V1::Annotation. + # p result + # + def get_annotation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::GetAnnotationRequest + + # Converts hash 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_annotation.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::VisionAI::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_annotation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_annotation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @warehouse_stub.call_rpc :get_annotation, 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 a list of annotations inside asset. + # + # @overload list_annotations(request, options = nil) + # Pass arguments to `list_annotations` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::ListAnnotationsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::ListAnnotationsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_annotations(parent: nil, page_size: nil, page_token: nil, filter: nil) + # Pass arguments to `list_annotations` via keyword arguments. Note that at + # least one keyword argument is 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] + # The parent, which owns this collection of annotations. + # Format: + # `projects/{project_number}/locations/{location}/corpora/{corpus}/assets/{asset}` + # @param page_size [::Integer] + # The maximum number of annotations to return. The service may return fewer + # than this value. If unspecified, at most 50 annotations will be returned. + # The maximum value is 1000; values above 1000 will be coerced to 1000. + # @param page_token [::String] + # A page token, received from a previous `ListAnnotations` call. + # Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to `ListAnnotations` must + # match the call that provided the page token. + # @param filter [::String] + # The filter applied to the returned list. + # We only support filtering for the following fields: + # For corpus of STREAM_VIDEO type: + # `partition.temporal_partition.start_time`, + # `partition.temporal_partition.end_time`, and `key`. + # For corpus of VIDEO_ON_DEMAND type, + # `partition.relative_temporal_partition.start_offset`, + # `partition.relative_temporal_partition.end_offset`, and `key`. + # For corpus of IMAGE type, only `key` is supported. + # Timestamps are specified in the RFC-3339 format, and only one restriction + # may be applied per field, joined by conjunctions. + # Format: + # "partition.temporal_partition.start_time > "2012-04-21T11:30:00-04:00" AND + # partition.temporal_partition.end_time < "2012-04-22T11:30:00-04:00" AND + # key = "example_key"" + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::VisionAI::V1::Annotation>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::VisionAI::V1::Annotation>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::Warehouse::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::ListAnnotationsRequest.new + # + # # Call the list_annotations method. + # result = client.list_annotations 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::VisionAI::V1::Annotation. + # p item + # end + # + def list_annotations request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::ListAnnotationsRequest + + # Converts hash 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_annotations.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::VisionAI::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_annotations.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_annotations.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @warehouse_stub.call_rpc :list_annotations, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @warehouse_stub, :list_annotations, 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 + + ## + # Updates annotation inside asset. + # + # @overload update_annotation(request, options = nil) + # Pass arguments to `update_annotation` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::UpdateAnnotationRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::UpdateAnnotationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_annotation(annotation: nil, update_mask: nil) + # Pass arguments to `update_annotation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param annotation [::Google::Cloud::VisionAI::V1::Annotation, ::Hash] + # Required. The annotation to update. + # The annotation's `name` field is used to identify the annotation to be + # updated. Format: + # `projects/{project_number}/locations/{location}/corpora/{corpus}/assets/{asset}/annotations/{annotation}` + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # The list of fields to be updated. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::VisionAI::V1::Annotation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::VisionAI::V1::Annotation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::Warehouse::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::UpdateAnnotationRequest.new + # + # # Call the update_annotation method. + # result = client.update_annotation request + # + # # The returned object is of type Google::Cloud::VisionAI::V1::Annotation. + # p result + # + def update_annotation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::UpdateAnnotationRequest + + # Converts hash 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_annotation.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::VisionAI::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.annotation&.name + header_params["annotation.name"] = request.annotation.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_annotation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_annotation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @warehouse_stub.call_rpc :update_annotation, 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 + + ## + # Deletes annotation inside asset. + # + # @overload delete_annotation(request, options = nil) + # Pass arguments to `delete_annotation` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::DeleteAnnotationRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::DeleteAnnotationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_annotation(name: nil) + # Pass arguments to `delete_annotation` via keyword arguments. Note that at + # least one keyword argument is 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 name of the annotation to delete. + # Format: + # `projects/{project_number}/locations/{location}/corpora/{corpus}/assets/{asset}/annotations/{annotation}` + # + # @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/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::Warehouse::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::DeleteAnnotationRequest.new + # + # # Call the delete_annotation method. + # result = client.delete_annotation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_annotation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::DeleteAnnotationRequest + + # Converts hash 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_annotation.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::VisionAI::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_annotation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_annotation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @warehouse_stub.call_rpc :delete_annotation, 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 + + ## + # Ingests data for the asset. It is not allowed to ingest a data chunk which + # is already expired according to TTL. + # This method is only available via the gRPC API (not HTTP since + # bi-directional streaming is not supported via HTTP). + # + # @param request [::Gapic::StreamInput, ::Enumerable<::Google::Cloud::VisionAI::V1::IngestAssetRequest, ::Hash>] + # An enumerable of {::Google::Cloud::VisionAI::V1::IngestAssetRequest} instances. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Enumerable<::Google::Cloud::VisionAI::V1::IngestAssetResponse>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Enumerable<::Google::Cloud::VisionAI::V1::IngestAssetResponse>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::Warehouse::Client.new + # + # # Create an input stream. + # input = Gapic::StreamInput.new + # + # # Call the ingest_asset method to start streaming. + # output = client.ingest_asset input + # + # # Send requests on the stream. For each request object, set fields by + # # passing keyword arguments. Be sure to close the stream when done. + # input << Google::Cloud::VisionAI::V1::IngestAssetRequest.new + # input << Google::Cloud::VisionAI::V1::IngestAssetRequest.new + # input.close + # + # # The returned object is a streamed enumerable yielding elements of type + # # ::Google::Cloud::VisionAI::V1::IngestAssetResponse + # output.each do |current_response| + # p current_response + # end + # + def ingest_asset request, options = nil + unless request.is_a? ::Enumerable + raise ::ArgumentError, "request must be an Enumerable" unless request.respond_to? :to_enum + request = request.to_enum + end + + request = request.lazy.map do |req| + ::Gapic::Protobuf.coerce req, to: ::Google::Cloud::VisionAI::V1::IngestAssetRequest + end + + # Converts hash 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.ingest_asset.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::VisionAI::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.ingest_asset.timeout, + metadata: metadata, + retry_policy: @config.rpcs.ingest_asset.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @warehouse_stub.call_rpc :ingest_asset, 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 + + ## + # Supported by STREAM_VIDEO corpus type. + # Generates clips for downloading. The api takes in a time range, and + # generates a clip of the first content available after start_time and + # before end_time, which may overflow beyond these bounds. + # Returned clips are truncated if the total size of the clips are larger + # than 100MB. + # + # @overload clip_asset(request, options = nil) + # Pass arguments to `clip_asset` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::ClipAssetRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::ClipAssetRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload clip_asset(name: nil, temporal_partition: nil) + # Pass arguments to `clip_asset` via keyword arguments. Note that at + # least one keyword argument is 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 asset to request clips for. + # Format: + # `projects/{project_number}/locations/{location_id}/corpora/{corpus_id}/assets/{asset_id}` + # @param temporal_partition [::Google::Cloud::VisionAI::V1::Partition::TemporalPartition, ::Hash] + # Required. The time range to request clips for. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::VisionAI::V1::ClipAssetResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::VisionAI::V1::ClipAssetResponse] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::Warehouse::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::ClipAssetRequest.new + # + # # Call the clip_asset method. + # result = client.clip_asset request + # + # # The returned object is of type Google::Cloud::VisionAI::V1::ClipAssetResponse. + # p result + # + def clip_asset request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::ClipAssetRequest + + # Converts hash 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.clip_asset.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::VisionAI::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.clip_asset.timeout, + metadata: metadata, + retry_policy: @config.rpcs.clip_asset.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @warehouse_stub.call_rpc :clip_asset, 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 + + ## + # Generates a uri for an HLS manifest. The api takes in a collection of time + # ranges, and generates a URI for an HLS manifest that covers all the + # requested time ranges. + # + # @overload generate_hls_uri(request, options = nil) + # Pass arguments to `generate_hls_uri` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::GenerateHlsUriRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::GenerateHlsUriRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_hls_uri(name: nil, temporal_partitions: nil, live_view_enabled: nil) + # Pass arguments to `generate_hls_uri` via keyword arguments. Note that at + # least one keyword argument is 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 asset to request clips for. + # Format: + # `projects/{project_number}/locations/{location_id}/corpora/{corpus_id}/assets/{asset_id}` + # @param temporal_partitions [::Array<::Google::Cloud::VisionAI::V1::Partition::TemporalPartition, ::Hash>] + # The time range to request clips for. Will be ignored if `get_live_view` is + # set to True. The total time range requested should be smaller than 24h. + # @param live_view_enabled [::Boolean] + # Option to exclusively show a livestream of the asset with up to 3 minutes + # of backlog data. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::VisionAI::V1::GenerateHlsUriResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::VisionAI::V1::GenerateHlsUriResponse] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::Warehouse::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::GenerateHlsUriRequest.new + # + # # Call the generate_hls_uri method. + # result = client.generate_hls_uri request + # + # # The returned object is of type Google::Cloud::VisionAI::V1::GenerateHlsUriResponse. + # p result + # + def generate_hls_uri request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::GenerateHlsUriRequest + + # Converts hash 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_hls_uri.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::VisionAI::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.generate_hls_uri.timeout, + metadata: metadata, + retry_policy: @config.rpcs.generate_hls_uri.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @warehouse_stub.call_rpc :generate_hls_uri, 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 + + ## + # Imports assets (images plus annotations) from a meta file on cloud storage. + # Each row in the meta file is corresponding to an image (specified by a + # cloud storage uri) and its annotations. + # + # @overload import_assets(request, options = nil) + # Pass arguments to `import_assets` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::ImportAssetsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::ImportAssetsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_assets(assets_gcs_uri: nil, parent: nil) + # Pass arguments to `import_assets` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param assets_gcs_uri [::String] + # The file contains all assets information to be imported. + # * The file is in JSONL format. + # * Each line corresponding to one asset. + # * Each line will be converted into InputImageAsset proto. + # @param parent [::String] + # Required. The parent corpus resource where the assets will be imported. + # Format: + # `projects/{project_number}/locations/{location_id}/corpora/{corpus_id}` + # + # @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/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::Warehouse::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::ImportAssetsRequest.new + # + # # Call the import_assets method. + # result = client.import_assets 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 import_assets request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::ImportAssetsRequest + + # Converts hash 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_assets.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::VisionAI::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_assets.timeout, + metadata: metadata, + retry_policy: @config.rpcs.import_assets.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @warehouse_stub.call_rpc :import_assets, 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 search configuration inside a corpus. + # + # Please follow the rules below to create a valid CreateSearchConfigRequest. + # --- General Rules --- + # 1. Request.search_config_id must not be associated with an existing + # SearchConfig. + # 2. Request must contain at least one non-empty search_criteria_property or + # facet_property. + # 3. mapped_fields must not be empty, and must map to existing UGA keys. + # 4. All mapped_fields must be of the same type. + # 5. All mapped_fields must share the same granularity. + # 6. All mapped_fields must share the same semantic SearchConfig match + # options. + # For property-specific rules, please reference the comments for + # FacetProperty and SearchCriteriaProperty. + # + # @overload create_search_config(request, options = nil) + # Pass arguments to `create_search_config` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::CreateSearchConfigRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::CreateSearchConfigRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_search_config(parent: nil, search_config: nil, search_config_id: nil) + # Pass arguments to `create_search_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. The parent resource where this search configuration will be + # created. Format: + # `projects/{project_number}/locations/{location_id}/corpora/{corpus_id}` + # @param search_config [::Google::Cloud::VisionAI::V1::SearchConfig, ::Hash] + # Required. The search config to create. + # @param search_config_id [::String] + # Required. ID to use for the new search config. Will become the final + # component of the SearchConfig's resource name. This value should be up to + # 63 characters, and valid characters are /[a-z][0-9]-_/. The first character + # must be a letter, the last could be a letter or a number. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::VisionAI::V1::SearchConfig] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::VisionAI::V1::SearchConfig] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::Warehouse::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::CreateSearchConfigRequest.new + # + # # Call the create_search_config method. + # result = client.create_search_config request + # + # # The returned object is of type Google::Cloud::VisionAI::V1::SearchConfig. + # p result + # + def create_search_config request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::CreateSearchConfigRequest + + # Converts hash 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_search_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::VisionAI::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_search_config.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_search_config.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @warehouse_stub.call_rpc :create_search_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 a search configuration inside a corpus. + # + # Please follow the rules below to create a valid UpdateSearchConfigRequest. + # --- General Rules --- + # 1. Request.search_configuration.name must already exist. + # 2. Request must contain at least one non-empty search_criteria_property or + # facet_property. + # 3. mapped_fields must not be empty, and must map to existing UGA keys. + # 4. All mapped_fields must be of the same type. + # 5. All mapped_fields must share the same granularity. + # 6. All mapped_fields must share the same semantic SearchConfig match + # options. + # For property-specific rules, please reference the comments for + # FacetProperty and SearchCriteriaProperty. + # + # @overload update_search_config(request, options = nil) + # Pass arguments to `update_search_config` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::UpdateSearchConfigRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::UpdateSearchConfigRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_search_config(search_config: nil, update_mask: nil) + # Pass arguments to `update_search_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 search_config [::Google::Cloud::VisionAI::V1::SearchConfig, ::Hash] + # Required. The search configuration to update. + # + # The search configuration's `name` field is used to identify the resource to + # be updated. Format: + # `projects/{project_number}/locations/{location}/corpora/{corpus}/searchConfigs/{search_config}` + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # The list of fields to be updated. If left unset, all field paths will be + # updated/overwritten. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::VisionAI::V1::SearchConfig] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::VisionAI::V1::SearchConfig] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::Warehouse::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::UpdateSearchConfigRequest.new + # + # # Call the update_search_config method. + # result = client.update_search_config request + # + # # The returned object is of type Google::Cloud::VisionAI::V1::SearchConfig. + # p result + # + def update_search_config request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::UpdateSearchConfigRequest + + # Converts hash 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_search_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::VisionAI::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.search_config&.name + header_params["search_config.name"] = request.search_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_search_config.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_search_config.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @warehouse_stub.call_rpc :update_search_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 + + ## + # Gets a search configuration inside a corpus. + # + # @overload get_search_config(request, options = nil) + # Pass arguments to `get_search_config` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::GetSearchConfigRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::GetSearchConfigRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_search_config(name: nil) + # Pass arguments to `get_search_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 name of the search configuration to retrieve. + # Format: + # `projects/{project_number}/locations/{location}/corpora/{corpus}/searchConfigs/{search_config}` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::VisionAI::V1::SearchConfig] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::VisionAI::V1::SearchConfig] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::Warehouse::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::GetSearchConfigRequest.new + # + # # Call the get_search_config method. + # result = client.get_search_config request + # + # # The returned object is of type Google::Cloud::VisionAI::V1::SearchConfig. + # p result + # + def get_search_config request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::GetSearchConfigRequest + + # Converts hash 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_search_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::VisionAI::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_search_config.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_search_config.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @warehouse_stub.call_rpc :get_search_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 + + ## + # Deletes a search configuration inside a corpus. + # + # For a DeleteSearchConfigRequest to be valid, + # Request.search_configuration.name must already exist. + # + # @overload delete_search_config(request, options = nil) + # Pass arguments to `delete_search_config` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::DeleteSearchConfigRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::DeleteSearchConfigRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_search_config(name: nil) + # Pass arguments to `delete_search_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 name of the search configuration to delete. + # Format: + # `projects/{project_number}/locations/{location}/corpora/{corpus}/searchConfigs/{search_config}` + # + # @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/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::Warehouse::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::DeleteSearchConfigRequest.new + # + # # Call the delete_search_config method. + # result = client.delete_search_config request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_search_config request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::DeleteSearchConfigRequest + + # Converts hash 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_search_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::VisionAI::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_search_config.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_search_config.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @warehouse_stub.call_rpc :delete_search_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 + + ## + # Lists all search configurations inside a corpus. + # + # @overload list_search_configs(request, options = nil) + # Pass arguments to `list_search_configs` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::ListSearchConfigsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::ListSearchConfigsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_search_configs(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_search_configs` via keyword arguments. Note that at + # least one keyword argument is 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 parent, which owns this collection of search configurations. + # Format: + # `projects/{project_number}/locations/{location}/corpora/{corpus}` + # @param page_size [::Integer] + # The maximum number of search configurations to return. The service may + # return fewer than this value. If unspecified, a page size of 50 will be + # used. The maximum value is 1000; values above 1000 will be coerced to 1000. + # @param page_token [::String] + # A page token, received from a previous `ListSearchConfigs` call. + # Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to + # `ListSearchConfigs` must match the call that provided the page + # token. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::VisionAI::V1::SearchConfig>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::VisionAI::V1::SearchConfig>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::Warehouse::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::ListSearchConfigsRequest.new + # + # # Call the list_search_configs method. + # result = client.list_search_configs 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::VisionAI::V1::SearchConfig. + # p item + # end + # + def list_search_configs request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::ListSearchConfigsRequest + + # Converts hash 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_search_configs.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::VisionAI::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_search_configs.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_search_configs.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @warehouse_stub.call_rpc :list_search_configs, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @warehouse_stub, :list_search_configs, 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 + + ## + # Creates a SearchHypernym inside a corpus. + # + # @overload create_search_hypernym(request, options = nil) + # Pass arguments to `create_search_hypernym` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::CreateSearchHypernymRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::CreateSearchHypernymRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_search_hypernym(parent: nil, search_hypernym: nil, search_hypernym_id: nil) + # Pass arguments to `create_search_hypernym` via keyword arguments. Note that at + # least one keyword argument is 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 parent resource where this SearchHypernym will be created. + # Format: `projects/{project_number}/locations/{location}/corpora/{corpus}` + # @param search_hypernym [::Google::Cloud::VisionAI::V1::SearchHypernym, ::Hash] + # Required. The SearchHypernym to create. + # @param search_hypernym_id [::String] + # Optional. The search hypernym id. + # If omitted, a random UUID will be generated. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::VisionAI::V1::SearchHypernym] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::VisionAI::V1::SearchHypernym] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::Warehouse::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::CreateSearchHypernymRequest.new + # + # # Call the create_search_hypernym method. + # result = client.create_search_hypernym request + # + # # The returned object is of type Google::Cloud::VisionAI::V1::SearchHypernym. + # p result + # + def create_search_hypernym request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::CreateSearchHypernymRequest + + # Converts hash 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_search_hypernym.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::VisionAI::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_search_hypernym.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_search_hypernym.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @warehouse_stub.call_rpc :create_search_hypernym, 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 a SearchHypernym inside a corpus. + # + # @overload update_search_hypernym(request, options = nil) + # Pass arguments to `update_search_hypernym` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::UpdateSearchHypernymRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::UpdateSearchHypernymRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_search_hypernym(search_hypernym: nil, update_mask: nil) + # Pass arguments to `update_search_hypernym` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param search_hypernym [::Google::Cloud::VisionAI::V1::SearchHypernym, ::Hash] + # Required. The SearchHypernym to update. + # The search hypernym's `name` field is used to identify the search hypernym + # to be updated. Format: + # `projects/{project_number}/locations/{location}/corpora/{corpus}/searchHypernyms/{search_hypernym}` + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # The list of fields to be updated. If left unset, all field paths will be + # updated/overwritten. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::VisionAI::V1::SearchHypernym] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::VisionAI::V1::SearchHypernym] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::Warehouse::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::UpdateSearchHypernymRequest.new + # + # # Call the update_search_hypernym method. + # result = client.update_search_hypernym request + # + # # The returned object is of type Google::Cloud::VisionAI::V1::SearchHypernym. + # p result + # + def update_search_hypernym request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::UpdateSearchHypernymRequest + + # Converts hash 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_search_hypernym.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::VisionAI::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.search_hypernym&.name + header_params["search_hypernym.name"] = request.search_hypernym.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_search_hypernym.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_search_hypernym.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @warehouse_stub.call_rpc :update_search_hypernym, 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 + + ## + # Gets a SearchHypernym inside a corpus. + # + # @overload get_search_hypernym(request, options = nil) + # Pass arguments to `get_search_hypernym` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::GetSearchHypernymRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::GetSearchHypernymRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_search_hypernym(name: nil) + # Pass arguments to `get_search_hypernym` via keyword arguments. Note that at + # least one keyword argument is 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 name of the SearchHypernym to retrieve. + # Format: + # `projects/{project_number}/locations/{location}/corpora/{corpus}/searchHypernyms/{search_hypernym}` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::VisionAI::V1::SearchHypernym] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::VisionAI::V1::SearchHypernym] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::Warehouse::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::GetSearchHypernymRequest.new + # + # # Call the get_search_hypernym method. + # result = client.get_search_hypernym request + # + # # The returned object is of type Google::Cloud::VisionAI::V1::SearchHypernym. + # p result + # + def get_search_hypernym request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::GetSearchHypernymRequest + + # Converts hash 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_search_hypernym.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::VisionAI::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_search_hypernym.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_search_hypernym.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @warehouse_stub.call_rpc :get_search_hypernym, 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 + + ## + # Deletes a SearchHypernym inside a corpus. + # + # @overload delete_search_hypernym(request, options = nil) + # Pass arguments to `delete_search_hypernym` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::DeleteSearchHypernymRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::DeleteSearchHypernymRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_search_hypernym(name: nil) + # Pass arguments to `delete_search_hypernym` via keyword arguments. Note that at + # least one keyword argument is 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 name of the SearchHypernym to delete. + # Format: + # `projects/{project_number}/locations/{location}/corpora/{corpus}/searchHypernyms/{search_hypernym}` + # + # @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/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::Warehouse::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::DeleteSearchHypernymRequest.new + # + # # Call the delete_search_hypernym method. + # result = client.delete_search_hypernym request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_search_hypernym request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::DeleteSearchHypernymRequest + + # Converts hash 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_search_hypernym.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::VisionAI::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_search_hypernym.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_search_hypernym.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @warehouse_stub.call_rpc :delete_search_hypernym, 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 SearchHypernyms inside a corpus. + # + # @overload list_search_hypernyms(request, options = nil) + # Pass arguments to `list_search_hypernyms` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::ListSearchHypernymsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::ListSearchHypernymsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_search_hypernyms(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_search_hypernyms` via keyword arguments. Note that at + # least one keyword argument is 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 parent, which owns this collection of SearchHypernyms. + # Format: + # `projects/{project_number}/locations/{location}/corpora/{corpus}` + # @param page_size [::Integer] + # The maximum number of SearchHypernyms returned. The service may + # return fewer than this value. If unspecified, a page size of 50 will be + # used. The maximum value is 1000; values above 1000 will be coerced to 1000. + # @param page_token [::String] + # A page token, received from a previous `SearchHypernym` call. + # Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to + # `SearchHypernym` must match the call that provided the page + # token. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::VisionAI::V1::SearchHypernym>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::VisionAI::V1::SearchHypernym>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::Warehouse::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::ListSearchHypernymsRequest.new + # + # # Call the list_search_hypernyms method. + # result = client.list_search_hypernyms 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::VisionAI::V1::SearchHypernym. + # p item + # end + # + def list_search_hypernyms request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::ListSearchHypernymsRequest + + # Converts hash 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_search_hypernyms.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::VisionAI::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_search_hypernyms.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_search_hypernyms.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @warehouse_stub.call_rpc :list_search_hypernyms, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @warehouse_stub, :list_search_hypernyms, 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 + + ## + # Search media asset. + # + # @overload search_assets(request, options = nil) + # Pass arguments to `search_assets` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::SearchAssetsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::SearchAssetsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload search_assets(schema_key_sorting_strategy: nil, corpus: nil, page_size: nil, page_token: nil, content_time_ranges: nil, criteria: nil, facet_selections: nil, result_annotation_keys: nil, search_query: nil) + # Pass arguments to `search_assets` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param schema_key_sorting_strategy [::Google::Cloud::VisionAI::V1::SchemaKeySortingStrategy, ::Hash] + # Sort by the value under the data schema key. + # @param corpus [::String] + # Required. The parent corpus to search. + # Format: `projects/{project_id}/locations/{location_id}/corpora/{corpus_id}' + # @param page_size [::Integer] + # The number of results to be returned in this page. If it's 0, the server + # will decide the appropriate page_size. + # @param page_token [::String] + # The continuation token to fetch the next page. If empty, it means it is + # fetching the first page. + # @param content_time_ranges [::Google::Cloud::VisionAI::V1::DateTimeRangeArray, ::Hash] + # Time ranges that matching video content must fall within. If no ranges are + # provided, there will be no time restriction. This field is treated just + # like the criteria below, but defined separately for convenience as it is + # used frequently. Note that if the end_time is in the future, it will be + # clamped to the time the request was received. + # @param criteria [::Array<::Google::Cloud::VisionAI::V1::Criteria, ::Hash>] + # Criteria applied to search results. + # @param facet_selections [::Array<::Google::Cloud::VisionAI::V1::FacetGroup, ::Hash>] + # Stores most recent facet selection state. Only facet groups with user's + # selection will be presented here. Selection state is either selected or + # unselected. Only selected facet buckets will be used as search criteria. + # @param result_annotation_keys [::Array<::String>] + # A list of annotation keys to specify the annotations to be retrieved and + # returned with each search result. + # Annotation granularity must be GRANULARITY_ASSET_LEVEL and its search + # strategy must not be NO_SEARCH. + # @param search_query [::String] + # Global search query. Allows user to search assets without needing to + # specify which field the value belongs to. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::VisionAI::V1::SearchResultItem>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::VisionAI::V1::SearchResultItem>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::Warehouse::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::SearchAssetsRequest.new + # + # # Call the search_assets method. + # result = client.search_assets 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::VisionAI::V1::SearchResultItem. + # p item + # end + # + def search_assets request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::SearchAssetsRequest + + # Converts hash 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.search_assets.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::VisionAI::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.corpus + header_params["corpus"] = request.corpus + 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.search_assets.timeout, + metadata: metadata, + retry_policy: @config.rpcs.search_assets.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @warehouse_stub.call_rpc :search_assets, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @warehouse_stub, :search_assets, 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 + + ## + # Search a deployed index endpoint (IMAGE corpus type only). + # + # @overload search_index_endpoint(request, options = nil) + # Pass arguments to `search_index_endpoint` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::SearchIndexEndpointRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::SearchIndexEndpointRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload search_index_endpoint(image_query: nil, text_query: nil, index_endpoint: nil, criteria: nil, exclusion_criteria: nil, page_size: nil, page_token: nil) + # Pass arguments to `search_index_endpoint` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param image_query [::Google::Cloud::VisionAI::V1::ImageQuery, ::Hash] + # An image-only query. + # + # Note: The following parameters are mutually exclusive: `image_query`, `text_query`. 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 text_query [::String] + # A text-only query. + # + # Note: The following parameters are mutually exclusive: `text_query`, `image_query`. 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 index_endpoint [::String] + # Required. The index endpoint to search. + # Format: + # `projects/{project_id}/locations/{location_id}/indexEndpoints/{index_endpoint_id}' + # @param criteria [::Array<::Google::Cloud::VisionAI::V1::Criteria, ::Hash>] + # Criteria applied to search results. + # @param exclusion_criteria [::Array<::Google::Cloud::VisionAI::V1::Criteria, ::Hash>] + # Criteria to exclude from search results. + # Note that `fetch_matched_annotations` will be ignored. + # @param page_size [::Integer] + # Requested page size. API may return fewer results than requested. + # If negative, INVALID_ARGUMENT error will be returned. + # If unspecified or 0, API will pick a default size, which is 10. + # If the requested page size is larger than the maximum size, API will pick + # the maximum size, which is 200. + # @param page_token [::String] + # The continuation token to fetch the next page. If empty, it means it is + # fetching the first page. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::VisionAI::V1::SearchResultItem>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::VisionAI::V1::SearchResultItem>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::Warehouse::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::SearchIndexEndpointRequest.new + # + # # Call the search_index_endpoint method. + # result = client.search_index_endpoint 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::VisionAI::V1::SearchResultItem. + # p item + # end + # + def search_index_endpoint request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::SearchIndexEndpointRequest + + # Converts hash 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.search_index_endpoint.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::VisionAI::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.index_endpoint + header_params["index_endpoint"] = request.index_endpoint + 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.search_index_endpoint.timeout, + metadata: metadata, + retry_policy: @config.rpcs.search_index_endpoint.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @warehouse_stub.call_rpc :search_index_endpoint, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @warehouse_stub, :search_index_endpoint, 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 + + ## + # Creates an IndexEndpoint. + # + # @overload create_index_endpoint(request, options = nil) + # Pass arguments to `create_index_endpoint` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::CreateIndexEndpointRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::CreateIndexEndpointRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_index_endpoint(parent: nil, index_endpoint_id: nil, index_endpoint: nil) + # Pass arguments to `create_index_endpoint` via keyword arguments. Note that at + # least one keyword argument is 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. Format: `projects/{project}/locations/{location}` + # @param index_endpoint_id [::String] + # Optional. The ID to use for the IndexEndpoint, which will become the final + # component of the IndexEndpoint's resource name if the user specifies it. + # Otherwise, IndexEndpoint id will be autogenerated. + # + # This value should be up to 63 characters, and valid characters + # are a-z, 0-9 and dash (-). The first character must be a letter, the last + # must be a letter or a number. + # @param index_endpoint [::Google::Cloud::VisionAI::V1::IndexEndpoint, ::Hash] + # Required. The resource being created. + # + # @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/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::Warehouse::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::CreateIndexEndpointRequest.new + # + # # Call the create_index_endpoint method. + # result = client.create_index_endpoint 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_index_endpoint request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::CreateIndexEndpointRequest + + # Converts hash 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_index_endpoint.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::VisionAI::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_index_endpoint.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_index_endpoint.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @warehouse_stub.call_rpc :create_index_endpoint, 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 + + ## + # Gets an IndexEndpoint. + # + # @overload get_index_endpoint(request, options = nil) + # Pass arguments to `get_index_endpoint` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::GetIndexEndpointRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::GetIndexEndpointRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_index_endpoint(name: nil) + # Pass arguments to `get_index_endpoint` via keyword arguments. Note that at + # least one keyword argument is 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 IndexEndpoint resource. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::VisionAI::V1::IndexEndpoint] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::VisionAI::V1::IndexEndpoint] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::Warehouse::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::GetIndexEndpointRequest.new + # + # # Call the get_index_endpoint method. + # result = client.get_index_endpoint request + # + # # The returned object is of type Google::Cloud::VisionAI::V1::IndexEndpoint. + # p result + # + def get_index_endpoint request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::GetIndexEndpointRequest + + # Converts hash 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_index_endpoint.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::VisionAI::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_index_endpoint.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_index_endpoint.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @warehouse_stub.call_rpc :get_index_endpoint, 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 all IndexEndpoints in a project. + # + # @overload list_index_endpoints(request, options = nil) + # Pass arguments to `list_index_endpoints` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::ListIndexEndpointsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::ListIndexEndpointsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_index_endpoints(parent: nil, page_size: nil, page_token: nil, filter: nil) + # Pass arguments to `list_index_endpoints` via keyword arguments. Note that at + # least one keyword argument is 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. Format: `projects/{project}/locations/{location}` + # @param page_size [::Integer] + # Optional. Requested page size. Server may return fewer items than + # requested. The service may return fewer than this value. If unspecified, a + # page size of 50 will be used. The maximum value is 1000; values above 1000 + # will be coerced to 1000. + # @param page_token [::String] + # Optional. A token identifying a page of results the server should return. + # @param filter [::String] + # Optional. The filter applied to the returned list. + # We only support filtering for the `deployed_image_index.image_index` field. + # However, to filter by a corpus instead of an image index, simply use + # `deployed_image_index.corpus`, which will return all endpoints with + # `deployed_image_index.image_index` inside of the given corpus. + # A basic filter on image index would look like: + # deployed_image_index.image_index = + # "projects/123/locations/us-central1/corpora/my_corpus/imageIndexes/my_image_index" + # A basic filter on corpus would look like: + # deployed_image_index.corpus = + # "projects/123/locations/us-central1/corpora/my_corpus" + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::VisionAI::V1::IndexEndpoint>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::VisionAI::V1::IndexEndpoint>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::Warehouse::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::ListIndexEndpointsRequest.new + # + # # Call the list_index_endpoints method. + # result = client.list_index_endpoints 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::VisionAI::V1::IndexEndpoint. + # p item + # end + # + def list_index_endpoints request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::ListIndexEndpointsRequest + + # Converts hash 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_index_endpoints.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::VisionAI::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_index_endpoints.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_index_endpoints.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @warehouse_stub.call_rpc :list_index_endpoints, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @warehouse_stub, :list_index_endpoints, 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 + + ## + # Updates an IndexEndpoint. + # + # @overload update_index_endpoint(request, options = nil) + # Pass arguments to `update_index_endpoint` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::UpdateIndexEndpointRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::UpdateIndexEndpointRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_index_endpoint(index_endpoint: nil, update_mask: nil) + # Pass arguments to `update_index_endpoint` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param index_endpoint [::Google::Cloud::VisionAI::V1::IndexEndpoint, ::Hash] + # Required. The resource being updated. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. Field mask is used to specify the fields to be overwritten in the + # IndexEndpoint resource by the update. + # The fields specified in the update_mask are relative to the resource, not + # the full request. + # A field of the resource will be overwritten if it is in the mask. + # Empty field mask is not allowed. + # If the mask is "*", then this is a full replacement of the 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/cloud/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::Warehouse::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::UpdateIndexEndpointRequest.new + # + # # Call the update_index_endpoint method. + # result = client.update_index_endpoint 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 update_index_endpoint request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::UpdateIndexEndpointRequest + + # Converts hash 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_index_endpoint.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::VisionAI::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.index_endpoint&.name + header_params["index_endpoint.name"] = request.index_endpoint.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_index_endpoint.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_index_endpoint.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @warehouse_stub.call_rpc :update_index_endpoint, 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 an IndexEndpoint. + # + # @overload delete_index_endpoint(request, options = nil) + # Pass arguments to `delete_index_endpoint` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::DeleteIndexEndpointRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::DeleteIndexEndpointRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_index_endpoint(name: nil) + # Pass arguments to `delete_index_endpoint` via keyword arguments. Note that at + # least one keyword argument is 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 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/cloud/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::Warehouse::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::DeleteIndexEndpointRequest.new + # + # # Call the delete_index_endpoint method. + # result = client.delete_index_endpoint 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_index_endpoint request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::DeleteIndexEndpointRequest + + # Converts hash 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_index_endpoint.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::VisionAI::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_index_endpoint.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_index_endpoint.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @warehouse_stub.call_rpc :delete_index_endpoint, 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 + + ## + # Deploys an Index to IndexEndpoint. + # + # @overload deploy_index(request, options = nil) + # Pass arguments to `deploy_index` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::DeployIndexRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::DeployIndexRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload deploy_index(index_endpoint: nil, deployed_index: nil) + # Pass arguments to `deploy_index` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param index_endpoint [::String] + # Required. IndexEndpoint the index is deployed to. + # Format: + # `projects/{project}/locations/{location}/indexEndpoints/{index_endpoint}` + # @param deployed_index [::Google::Cloud::VisionAI::V1::DeployedIndex, ::Hash] + # Required. Index to deploy. + # + # @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/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::Warehouse::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::DeployIndexRequest.new + # + # # Call the deploy_index method. + # result = client.deploy_index 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 deploy_index request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::DeployIndexRequest + + # Converts hash 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.deploy_index.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::VisionAI::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.index_endpoint + header_params["index_endpoint"] = request.index_endpoint + 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.deploy_index.timeout, + metadata: metadata, + retry_policy: @config.rpcs.deploy_index.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @warehouse_stub.call_rpc :deploy_index, 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 + + ## + # Undeploys an Index from IndexEndpoint. + # + # @overload undeploy_index(request, options = nil) + # Pass arguments to `undeploy_index` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::UndeployIndexRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::UndeployIndexRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload undeploy_index(index_endpoint: nil) + # Pass arguments to `undeploy_index` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param index_endpoint [::String] + # Required. Resource name of the IndexEndpoint resource on which the + # undeployment will act. Format: + # `projects/{project}/locations/{location}/indexEndpoints/{index_endpoint}` + # + # @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/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::Warehouse::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::UndeployIndexRequest.new + # + # # Call the undeploy_index method. + # result = client.undeploy_index 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 undeploy_index request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::UndeployIndexRequest + + # Converts hash 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.undeploy_index.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::VisionAI::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.index_endpoint + header_params["index_endpoint"] = request.index_endpoint + 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.undeploy_index.timeout, + metadata: metadata, + retry_policy: @config.rpcs.undeploy_index.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @warehouse_stub.call_rpc :undeploy_index, 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 collection. + # + # @overload create_collection(request, options = nil) + # Pass arguments to `create_collection` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::CreateCollectionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::CreateCollectionRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_collection(parent: nil, collection: nil, collection_id: nil) + # Pass arguments to `create_collection` via keyword arguments. Note that at + # least one keyword argument is 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 parent resource where this collection will be created. + # Format: `projects/{project_number}/locations/{location}/corpora/{corpus}` + # @param collection [::Google::Cloud::VisionAI::V1::Collection, ::Hash] + # Required. The collection resource to be created. + # @param collection_id [::String] + # Optional. The ID to use for the collection, which will become the final + # component of the resource name if user choose to specify. Otherwise, + # collection id will be generated by system. + # + # This value should be up to 55 characters, and valid characters + # are /[a-z][0-9]-/. The first character must be a letter, the last could be + # a letter or a number. + # + # @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/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::Warehouse::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::CreateCollectionRequest.new + # + # # Call the create_collection method. + # result = client.create_collection 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_collection request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::CreateCollectionRequest + + # Converts hash 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_collection.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::VisionAI::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_collection.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_collection.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @warehouse_stub.call_rpc :create_collection, 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 collection. + # + # @overload delete_collection(request, options = nil) + # Pass arguments to `delete_collection` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::DeleteCollectionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::DeleteCollectionRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_collection(name: nil) + # Pass arguments to `delete_collection` via keyword arguments. Note that at + # least one keyword argument is 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 name of the collection to delete. Format: + # `projects/{project_number}/locations/{location}/corpora/{corpus}/collections/{collection}` + # + # @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/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::Warehouse::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::DeleteCollectionRequest.new + # + # # Call the delete_collection method. + # result = client.delete_collection 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_collection request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::DeleteCollectionRequest + + # Converts hash 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_collection.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::VisionAI::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_collection.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_collection.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @warehouse_stub.call_rpc :delete_collection, 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 + + ## + # Gets a collection. + # + # @overload get_collection(request, options = nil) + # Pass arguments to `get_collection` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::GetCollectionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::GetCollectionRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_collection(name: nil) + # Pass arguments to `get_collection` via keyword arguments. Note that at + # least one keyword argument is 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 name of the collection to retrieve. Format: + # `projects/{project_number}/locations/{location}/corpora/{corpus}/collections/{collection}` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::VisionAI::V1::Collection] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::VisionAI::V1::Collection] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::Warehouse::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::GetCollectionRequest.new + # + # # Call the get_collection method. + # result = client.get_collection request + # + # # The returned object is of type Google::Cloud::VisionAI::V1::Collection. + # p result + # + def get_collection request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::GetCollectionRequest + + # Converts hash 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_collection.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::VisionAI::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_collection.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_collection.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @warehouse_stub.call_rpc :get_collection, 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 a collection. + # + # @overload update_collection(request, options = nil) + # Pass arguments to `update_collection` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::UpdateCollectionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::UpdateCollectionRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_collection(collection: nil, update_mask: nil) + # Pass arguments to `update_collection` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param collection [::Google::Cloud::VisionAI::V1::Collection, ::Hash] + # Required. The collection to update. + # + # The collection's `name` field is used to identify the collection to be + # updated. Format: + # `projects/{project_number}/locations/{location}/corpora/{corpus}/collections/{collection}` + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # The list of fields to be updated. + # - Unset `update_mask` or set `update_mask` to be a single "*" only will + # update all updatable fields with the value provided in `collection`. + # - To update `display_name` value to empty string, set it in the + # `collection` + # to empty string, and set `update_mask` with "display_name". Same applies + # to other updatable string fields in the `collection`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::VisionAI::V1::Collection] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::VisionAI::V1::Collection] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::Warehouse::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::UpdateCollectionRequest.new + # + # # Call the update_collection method. + # result = client.update_collection request + # + # # The returned object is of type Google::Cloud::VisionAI::V1::Collection. + # p result + # + def update_collection request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::UpdateCollectionRequest + + # Converts hash 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_collection.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::VisionAI::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.collection&.name + header_params["collection.name"] = request.collection.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_collection.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_collection.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @warehouse_stub.call_rpc :update_collection, 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 collections inside a corpus. + # + # @overload list_collections(request, options = nil) + # Pass arguments to `list_collections` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::ListCollectionsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::ListCollectionsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_collections(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_collections` via keyword arguments. Note that at + # least one keyword argument is 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 parent corpus. Format: + # `projects/{project_number}/locations/{location}/corpora/{corpus}` + # @param page_size [::Integer] + # The maximum number of collections to return. The service may return fewer + # than this value. If unspecified, at most 50 collections will be returned. + # The maximum value is 1000; values above 1000 will be coerced to 1000. + # @param page_token [::String] + # A page token, received from a previous `ListCollectionsRequest` call. + # Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to `ListCollectionsRequest` + # must match the call that provided the page token. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::VisionAI::V1::Collection>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::VisionAI::V1::Collection>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::Warehouse::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::ListCollectionsRequest.new + # + # # Call the list_collections method. + # result = client.list_collections 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::VisionAI::V1::Collection. + # p item + # end + # + def list_collections request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::ListCollectionsRequest + + # Converts hash 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_collections.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::VisionAI::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_collections.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_collections.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @warehouse_stub.call_rpc :list_collections, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @warehouse_stub, :list_collections, 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 + + ## + # Adds an item into a Collection. + # + # @overload add_collection_item(request, options = nil) + # Pass arguments to `add_collection_item` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::AddCollectionItemRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::AddCollectionItemRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload add_collection_item(item: nil) + # Pass arguments to `add_collection_item` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param item [::Google::Cloud::VisionAI::V1::CollectionItem, ::Hash] + # Required. The item to be added. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::VisionAI::V1::AddCollectionItemResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::VisionAI::V1::AddCollectionItemResponse] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::Warehouse::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::AddCollectionItemRequest.new + # + # # Call the add_collection_item method. + # result = client.add_collection_item request + # + # # The returned object is of type Google::Cloud::VisionAI::V1::AddCollectionItemResponse. + # p result + # + def add_collection_item request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::AddCollectionItemRequest + + # Converts hash 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.add_collection_item.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::VisionAI::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.item&.collection + header_params["item.collection"] = request.item.collection + 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.add_collection_item.timeout, + metadata: metadata, + retry_policy: @config.rpcs.add_collection_item.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @warehouse_stub.call_rpc :add_collection_item, 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 + + ## + # Removes an item from a collection. + # + # @overload remove_collection_item(request, options = nil) + # Pass arguments to `remove_collection_item` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::RemoveCollectionItemRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::RemoveCollectionItemRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload remove_collection_item(item: nil) + # Pass arguments to `remove_collection_item` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param item [::Google::Cloud::VisionAI::V1::CollectionItem, ::Hash] + # Required. The item to be removed. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::VisionAI::V1::RemoveCollectionItemResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::VisionAI::V1::RemoveCollectionItemResponse] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::Warehouse::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::RemoveCollectionItemRequest.new + # + # # Call the remove_collection_item method. + # result = client.remove_collection_item request + # + # # The returned object is of type Google::Cloud::VisionAI::V1::RemoveCollectionItemResponse. + # p result + # + def remove_collection_item request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::RemoveCollectionItemRequest + + # Converts hash 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.remove_collection_item.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::VisionAI::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.item&.collection + header_params["item.collection"] = request.item.collection + 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.remove_collection_item.timeout, + metadata: metadata, + retry_policy: @config.rpcs.remove_collection_item.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @warehouse_stub.call_rpc :remove_collection_item, 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 + + ## + # View items inside a collection. + # + # @overload view_collection_items(request, options = nil) + # Pass arguments to `view_collection_items` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::ViewCollectionItemsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::ViewCollectionItemsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload view_collection_items(collection: nil, page_size: nil, page_token: nil) + # Pass arguments to `view_collection_items` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param collection [::String] + # Required. The collection to view. Format: + # `projects/{project_number}/locations/{location}/corpora/{corpus}/collections/{collection}` + # @param page_size [::Integer] + # The maximum number of collections to return. The service may return fewer + # than this value. If unspecified, at most 50 collections will be returned. + # The maximum value is 1000; values above 1000 will be coerced to 1000. + # @param page_token [::String] + # A page token, received from a previous `ViewCollectionItemsRequest` call. + # Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to + # `ViewCollectionItemsRequest` must match the call that provided the page + # token. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::VisionAI::V1::CollectionItem>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::VisionAI::V1::CollectionItem>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::Warehouse::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::ViewCollectionItemsRequest.new + # + # # Call the view_collection_items method. + # result = client.view_collection_items 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::VisionAI::V1::CollectionItem. + # p item + # end + # + def view_collection_items request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::ViewCollectionItemsRequest + + # Converts hash 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.view_collection_items.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::VisionAI::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.collection + header_params["collection"] = request.collection + 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.view_collection_items.timeout, + metadata: metadata, + retry_policy: @config.rpcs.view_collection_items.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @warehouse_stub.call_rpc :view_collection_items, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @warehouse_stub, :view_collection_items, 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 Warehouse API. + # + # This class represents the configuration for Warehouse, + # 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::VisionAI::V1::Warehouse::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_asset to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::VisionAI::V1::Warehouse::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.create_asset.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::VisionAI::V1::Warehouse::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.create_asset.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::VisionAI::V1::Warehouse::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 = "warehouse-visionai.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 Warehouse 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_asset` + # @return [::Gapic::Config::Method] + # + attr_reader :create_asset + ## + # RPC-specific configuration for `update_asset` + # @return [::Gapic::Config::Method] + # + attr_reader :update_asset + ## + # RPC-specific configuration for `get_asset` + # @return [::Gapic::Config::Method] + # + attr_reader :get_asset + ## + # RPC-specific configuration for `list_assets` + # @return [::Gapic::Config::Method] + # + attr_reader :list_assets + ## + # RPC-specific configuration for `delete_asset` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_asset + ## + # RPC-specific configuration for `upload_asset` + # @return [::Gapic::Config::Method] + # + attr_reader :upload_asset + ## + # RPC-specific configuration for `generate_retrieval_url` + # @return [::Gapic::Config::Method] + # + attr_reader :generate_retrieval_url + ## + # RPC-specific configuration for `analyze_asset` + # @return [::Gapic::Config::Method] + # + attr_reader :analyze_asset + ## + # RPC-specific configuration for `index_asset` + # @return [::Gapic::Config::Method] + # + attr_reader :index_asset + ## + # RPC-specific configuration for `remove_index_asset` + # @return [::Gapic::Config::Method] + # + attr_reader :remove_index_asset + ## + # RPC-specific configuration for `view_indexed_assets` + # @return [::Gapic::Config::Method] + # + attr_reader :view_indexed_assets + ## + # RPC-specific configuration for `create_index` + # @return [::Gapic::Config::Method] + # + attr_reader :create_index + ## + # RPC-specific configuration for `update_index` + # @return [::Gapic::Config::Method] + # + attr_reader :update_index + ## + # RPC-specific configuration for `get_index` + # @return [::Gapic::Config::Method] + # + attr_reader :get_index + ## + # RPC-specific configuration for `list_indexes` + # @return [::Gapic::Config::Method] + # + attr_reader :list_indexes + ## + # RPC-specific configuration for `delete_index` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_index + ## + # RPC-specific configuration for `create_corpus` + # @return [::Gapic::Config::Method] + # + attr_reader :create_corpus + ## + # RPC-specific configuration for `get_corpus` + # @return [::Gapic::Config::Method] + # + attr_reader :get_corpus + ## + # RPC-specific configuration for `update_corpus` + # @return [::Gapic::Config::Method] + # + attr_reader :update_corpus + ## + # RPC-specific configuration for `list_corpora` + # @return [::Gapic::Config::Method] + # + attr_reader :list_corpora + ## + # RPC-specific configuration for `delete_corpus` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_corpus + ## + # RPC-specific configuration for `analyze_corpus` + # @return [::Gapic::Config::Method] + # + attr_reader :analyze_corpus + ## + # RPC-specific configuration for `create_data_schema` + # @return [::Gapic::Config::Method] + # + attr_reader :create_data_schema + ## + # RPC-specific configuration for `update_data_schema` + # @return [::Gapic::Config::Method] + # + attr_reader :update_data_schema + ## + # RPC-specific configuration for `get_data_schema` + # @return [::Gapic::Config::Method] + # + attr_reader :get_data_schema + ## + # RPC-specific configuration for `delete_data_schema` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_data_schema + ## + # RPC-specific configuration for `list_data_schemas` + # @return [::Gapic::Config::Method] + # + attr_reader :list_data_schemas + ## + # RPC-specific configuration for `create_annotation` + # @return [::Gapic::Config::Method] + # + attr_reader :create_annotation + ## + # RPC-specific configuration for `get_annotation` + # @return [::Gapic::Config::Method] + # + attr_reader :get_annotation + ## + # RPC-specific configuration for `list_annotations` + # @return [::Gapic::Config::Method] + # + attr_reader :list_annotations + ## + # RPC-specific configuration for `update_annotation` + # @return [::Gapic::Config::Method] + # + attr_reader :update_annotation + ## + # RPC-specific configuration for `delete_annotation` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_annotation + ## + # RPC-specific configuration for `ingest_asset` + # @return [::Gapic::Config::Method] + # + attr_reader :ingest_asset + ## + # RPC-specific configuration for `clip_asset` + # @return [::Gapic::Config::Method] + # + attr_reader :clip_asset + ## + # RPC-specific configuration for `generate_hls_uri` + # @return [::Gapic::Config::Method] + # + attr_reader :generate_hls_uri + ## + # RPC-specific configuration for `import_assets` + # @return [::Gapic::Config::Method] + # + attr_reader :import_assets + ## + # RPC-specific configuration for `create_search_config` + # @return [::Gapic::Config::Method] + # + attr_reader :create_search_config + ## + # RPC-specific configuration for `update_search_config` + # @return [::Gapic::Config::Method] + # + attr_reader :update_search_config + ## + # RPC-specific configuration for `get_search_config` + # @return [::Gapic::Config::Method] + # + attr_reader :get_search_config + ## + # RPC-specific configuration for `delete_search_config` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_search_config + ## + # RPC-specific configuration for `list_search_configs` + # @return [::Gapic::Config::Method] + # + attr_reader :list_search_configs + ## + # RPC-specific configuration for `create_search_hypernym` + # @return [::Gapic::Config::Method] + # + attr_reader :create_search_hypernym + ## + # RPC-specific configuration for `update_search_hypernym` + # @return [::Gapic::Config::Method] + # + attr_reader :update_search_hypernym + ## + # RPC-specific configuration for `get_search_hypernym` + # @return [::Gapic::Config::Method] + # + attr_reader :get_search_hypernym + ## + # RPC-specific configuration for `delete_search_hypernym` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_search_hypernym + ## + # RPC-specific configuration for `list_search_hypernyms` + # @return [::Gapic::Config::Method] + # + attr_reader :list_search_hypernyms + ## + # RPC-specific configuration for `search_assets` + # @return [::Gapic::Config::Method] + # + attr_reader :search_assets + ## + # RPC-specific configuration for `search_index_endpoint` + # @return [::Gapic::Config::Method] + # + attr_reader :search_index_endpoint + ## + # RPC-specific configuration for `create_index_endpoint` + # @return [::Gapic::Config::Method] + # + attr_reader :create_index_endpoint + ## + # RPC-specific configuration for `get_index_endpoint` + # @return [::Gapic::Config::Method] + # + attr_reader :get_index_endpoint + ## + # RPC-specific configuration for `list_index_endpoints` + # @return [::Gapic::Config::Method] + # + attr_reader :list_index_endpoints + ## + # RPC-specific configuration for `update_index_endpoint` + # @return [::Gapic::Config::Method] + # + attr_reader :update_index_endpoint + ## + # RPC-specific configuration for `delete_index_endpoint` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_index_endpoint + ## + # RPC-specific configuration for `deploy_index` + # @return [::Gapic::Config::Method] + # + attr_reader :deploy_index + ## + # RPC-specific configuration for `undeploy_index` + # @return [::Gapic::Config::Method] + # + attr_reader :undeploy_index + ## + # RPC-specific configuration for `create_collection` + # @return [::Gapic::Config::Method] + # + attr_reader :create_collection + ## + # RPC-specific configuration for `delete_collection` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_collection + ## + # RPC-specific configuration for `get_collection` + # @return [::Gapic::Config::Method] + # + attr_reader :get_collection + ## + # RPC-specific configuration for `update_collection` + # @return [::Gapic::Config::Method] + # + attr_reader :update_collection + ## + # RPC-specific configuration for `list_collections` + # @return [::Gapic::Config::Method] + # + attr_reader :list_collections + ## + # RPC-specific configuration for `add_collection_item` + # @return [::Gapic::Config::Method] + # + attr_reader :add_collection_item + ## + # RPC-specific configuration for `remove_collection_item` + # @return [::Gapic::Config::Method] + # + attr_reader :remove_collection_item + ## + # RPC-specific configuration for `view_collection_items` + # @return [::Gapic::Config::Method] + # + attr_reader :view_collection_items + + # @private + def initialize parent_rpcs = nil + create_asset_config = parent_rpcs.create_asset if parent_rpcs.respond_to? :create_asset + @create_asset = ::Gapic::Config::Method.new create_asset_config + update_asset_config = parent_rpcs.update_asset if parent_rpcs.respond_to? :update_asset + @update_asset = ::Gapic::Config::Method.new update_asset_config + get_asset_config = parent_rpcs.get_asset if parent_rpcs.respond_to? :get_asset + @get_asset = ::Gapic::Config::Method.new get_asset_config + list_assets_config = parent_rpcs.list_assets if parent_rpcs.respond_to? :list_assets + @list_assets = ::Gapic::Config::Method.new list_assets_config + delete_asset_config = parent_rpcs.delete_asset if parent_rpcs.respond_to? :delete_asset + @delete_asset = ::Gapic::Config::Method.new delete_asset_config + upload_asset_config = parent_rpcs.upload_asset if parent_rpcs.respond_to? :upload_asset + @upload_asset = ::Gapic::Config::Method.new upload_asset_config + generate_retrieval_url_config = parent_rpcs.generate_retrieval_url if parent_rpcs.respond_to? :generate_retrieval_url + @generate_retrieval_url = ::Gapic::Config::Method.new generate_retrieval_url_config + analyze_asset_config = parent_rpcs.analyze_asset if parent_rpcs.respond_to? :analyze_asset + @analyze_asset = ::Gapic::Config::Method.new analyze_asset_config + index_asset_config = parent_rpcs.index_asset if parent_rpcs.respond_to? :index_asset + @index_asset = ::Gapic::Config::Method.new index_asset_config + remove_index_asset_config = parent_rpcs.remove_index_asset if parent_rpcs.respond_to? :remove_index_asset + @remove_index_asset = ::Gapic::Config::Method.new remove_index_asset_config + view_indexed_assets_config = parent_rpcs.view_indexed_assets if parent_rpcs.respond_to? :view_indexed_assets + @view_indexed_assets = ::Gapic::Config::Method.new view_indexed_assets_config + create_index_config = parent_rpcs.create_index if parent_rpcs.respond_to? :create_index + @create_index = ::Gapic::Config::Method.new create_index_config + update_index_config = parent_rpcs.update_index if parent_rpcs.respond_to? :update_index + @update_index = ::Gapic::Config::Method.new update_index_config + get_index_config = parent_rpcs.get_index if parent_rpcs.respond_to? :get_index + @get_index = ::Gapic::Config::Method.new get_index_config + list_indexes_config = parent_rpcs.list_indexes if parent_rpcs.respond_to? :list_indexes + @list_indexes = ::Gapic::Config::Method.new list_indexes_config + delete_index_config = parent_rpcs.delete_index if parent_rpcs.respond_to? :delete_index + @delete_index = ::Gapic::Config::Method.new delete_index_config + create_corpus_config = parent_rpcs.create_corpus if parent_rpcs.respond_to? :create_corpus + @create_corpus = ::Gapic::Config::Method.new create_corpus_config + get_corpus_config = parent_rpcs.get_corpus if parent_rpcs.respond_to? :get_corpus + @get_corpus = ::Gapic::Config::Method.new get_corpus_config + update_corpus_config = parent_rpcs.update_corpus if parent_rpcs.respond_to? :update_corpus + @update_corpus = ::Gapic::Config::Method.new update_corpus_config + list_corpora_config = parent_rpcs.list_corpora if parent_rpcs.respond_to? :list_corpora + @list_corpora = ::Gapic::Config::Method.new list_corpora_config + delete_corpus_config = parent_rpcs.delete_corpus if parent_rpcs.respond_to? :delete_corpus + @delete_corpus = ::Gapic::Config::Method.new delete_corpus_config + analyze_corpus_config = parent_rpcs.analyze_corpus if parent_rpcs.respond_to? :analyze_corpus + @analyze_corpus = ::Gapic::Config::Method.new analyze_corpus_config + create_data_schema_config = parent_rpcs.create_data_schema if parent_rpcs.respond_to? :create_data_schema + @create_data_schema = ::Gapic::Config::Method.new create_data_schema_config + update_data_schema_config = parent_rpcs.update_data_schema if parent_rpcs.respond_to? :update_data_schema + @update_data_schema = ::Gapic::Config::Method.new update_data_schema_config + get_data_schema_config = parent_rpcs.get_data_schema if parent_rpcs.respond_to? :get_data_schema + @get_data_schema = ::Gapic::Config::Method.new get_data_schema_config + delete_data_schema_config = parent_rpcs.delete_data_schema if parent_rpcs.respond_to? :delete_data_schema + @delete_data_schema = ::Gapic::Config::Method.new delete_data_schema_config + list_data_schemas_config = parent_rpcs.list_data_schemas if parent_rpcs.respond_to? :list_data_schemas + @list_data_schemas = ::Gapic::Config::Method.new list_data_schemas_config + create_annotation_config = parent_rpcs.create_annotation if parent_rpcs.respond_to? :create_annotation + @create_annotation = ::Gapic::Config::Method.new create_annotation_config + get_annotation_config = parent_rpcs.get_annotation if parent_rpcs.respond_to? :get_annotation + @get_annotation = ::Gapic::Config::Method.new get_annotation_config + list_annotations_config = parent_rpcs.list_annotations if parent_rpcs.respond_to? :list_annotations + @list_annotations = ::Gapic::Config::Method.new list_annotations_config + update_annotation_config = parent_rpcs.update_annotation if parent_rpcs.respond_to? :update_annotation + @update_annotation = ::Gapic::Config::Method.new update_annotation_config + delete_annotation_config = parent_rpcs.delete_annotation if parent_rpcs.respond_to? :delete_annotation + @delete_annotation = ::Gapic::Config::Method.new delete_annotation_config + ingest_asset_config = parent_rpcs.ingest_asset if parent_rpcs.respond_to? :ingest_asset + @ingest_asset = ::Gapic::Config::Method.new ingest_asset_config + clip_asset_config = parent_rpcs.clip_asset if parent_rpcs.respond_to? :clip_asset + @clip_asset = ::Gapic::Config::Method.new clip_asset_config + generate_hls_uri_config = parent_rpcs.generate_hls_uri if parent_rpcs.respond_to? :generate_hls_uri + @generate_hls_uri = ::Gapic::Config::Method.new generate_hls_uri_config + import_assets_config = parent_rpcs.import_assets if parent_rpcs.respond_to? :import_assets + @import_assets = ::Gapic::Config::Method.new import_assets_config + create_search_config_config = parent_rpcs.create_search_config if parent_rpcs.respond_to? :create_search_config + @create_search_config = ::Gapic::Config::Method.new create_search_config_config + update_search_config_config = parent_rpcs.update_search_config if parent_rpcs.respond_to? :update_search_config + @update_search_config = ::Gapic::Config::Method.new update_search_config_config + get_search_config_config = parent_rpcs.get_search_config if parent_rpcs.respond_to? :get_search_config + @get_search_config = ::Gapic::Config::Method.new get_search_config_config + delete_search_config_config = parent_rpcs.delete_search_config if parent_rpcs.respond_to? :delete_search_config + @delete_search_config = ::Gapic::Config::Method.new delete_search_config_config + list_search_configs_config = parent_rpcs.list_search_configs if parent_rpcs.respond_to? :list_search_configs + @list_search_configs = ::Gapic::Config::Method.new list_search_configs_config + create_search_hypernym_config = parent_rpcs.create_search_hypernym if parent_rpcs.respond_to? :create_search_hypernym + @create_search_hypernym = ::Gapic::Config::Method.new create_search_hypernym_config + update_search_hypernym_config = parent_rpcs.update_search_hypernym if parent_rpcs.respond_to? :update_search_hypernym + @update_search_hypernym = ::Gapic::Config::Method.new update_search_hypernym_config + get_search_hypernym_config = parent_rpcs.get_search_hypernym if parent_rpcs.respond_to? :get_search_hypernym + @get_search_hypernym = ::Gapic::Config::Method.new get_search_hypernym_config + delete_search_hypernym_config = parent_rpcs.delete_search_hypernym if parent_rpcs.respond_to? :delete_search_hypernym + @delete_search_hypernym = ::Gapic::Config::Method.new delete_search_hypernym_config + list_search_hypernyms_config = parent_rpcs.list_search_hypernyms if parent_rpcs.respond_to? :list_search_hypernyms + @list_search_hypernyms = ::Gapic::Config::Method.new list_search_hypernyms_config + search_assets_config = parent_rpcs.search_assets if parent_rpcs.respond_to? :search_assets + @search_assets = ::Gapic::Config::Method.new search_assets_config + search_index_endpoint_config = parent_rpcs.search_index_endpoint if parent_rpcs.respond_to? :search_index_endpoint + @search_index_endpoint = ::Gapic::Config::Method.new search_index_endpoint_config + create_index_endpoint_config = parent_rpcs.create_index_endpoint if parent_rpcs.respond_to? :create_index_endpoint + @create_index_endpoint = ::Gapic::Config::Method.new create_index_endpoint_config + get_index_endpoint_config = parent_rpcs.get_index_endpoint if parent_rpcs.respond_to? :get_index_endpoint + @get_index_endpoint = ::Gapic::Config::Method.new get_index_endpoint_config + list_index_endpoints_config = parent_rpcs.list_index_endpoints if parent_rpcs.respond_to? :list_index_endpoints + @list_index_endpoints = ::Gapic::Config::Method.new list_index_endpoints_config + update_index_endpoint_config = parent_rpcs.update_index_endpoint if parent_rpcs.respond_to? :update_index_endpoint + @update_index_endpoint = ::Gapic::Config::Method.new update_index_endpoint_config + delete_index_endpoint_config = parent_rpcs.delete_index_endpoint if parent_rpcs.respond_to? :delete_index_endpoint + @delete_index_endpoint = ::Gapic::Config::Method.new delete_index_endpoint_config + deploy_index_config = parent_rpcs.deploy_index if parent_rpcs.respond_to? :deploy_index + @deploy_index = ::Gapic::Config::Method.new deploy_index_config + undeploy_index_config = parent_rpcs.undeploy_index if parent_rpcs.respond_to? :undeploy_index + @undeploy_index = ::Gapic::Config::Method.new undeploy_index_config + create_collection_config = parent_rpcs.create_collection if parent_rpcs.respond_to? :create_collection + @create_collection = ::Gapic::Config::Method.new create_collection_config + delete_collection_config = parent_rpcs.delete_collection if parent_rpcs.respond_to? :delete_collection + @delete_collection = ::Gapic::Config::Method.new delete_collection_config + get_collection_config = parent_rpcs.get_collection if parent_rpcs.respond_to? :get_collection + @get_collection = ::Gapic::Config::Method.new get_collection_config + update_collection_config = parent_rpcs.update_collection if parent_rpcs.respond_to? :update_collection + @update_collection = ::Gapic::Config::Method.new update_collection_config + list_collections_config = parent_rpcs.list_collections if parent_rpcs.respond_to? :list_collections + @list_collections = ::Gapic::Config::Method.new list_collections_config + add_collection_item_config = parent_rpcs.add_collection_item if parent_rpcs.respond_to? :add_collection_item + @add_collection_item = ::Gapic::Config::Method.new add_collection_item_config + remove_collection_item_config = parent_rpcs.remove_collection_item if parent_rpcs.respond_to? :remove_collection_item + @remove_collection_item = ::Gapic::Config::Method.new remove_collection_item_config + view_collection_items_config = parent_rpcs.view_collection_items if parent_rpcs.respond_to? :view_collection_items + @view_collection_items = ::Gapic::Config::Method.new view_collection_items_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/warehouse/credentials.rb b/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/warehouse/credentials.rb new file mode 100644 index 000000000000..2af7c965c981 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/warehouse/credentials.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! + +require "googleauth" + +module Google + module Cloud + module VisionAI + module V1 + module Warehouse + # Credentials for the Warehouse API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/cloud-platform" + ] + self.env_vars = [ + "GOOGLE_CLOUD_CREDENTIALS", + "GOOGLE_CLOUD_KEYFILE", + "GCLOUD_KEYFILE", + "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-vision_ai-v1/lib/google/cloud/vision_ai/v1/warehouse/operations.rb b/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/warehouse/operations.rb new file mode 100644 index 000000000000..876bd0a34f02 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/warehouse/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 VisionAI + module V1 + module Warehouse + # Service that implements Longrunning Operations API. + class Operations + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "warehouse-visionai.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :operations_stub + + ## + # Configuration for the Warehouse 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 Warehouse 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::VisionAI::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::VisionAI::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::VisionAI::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::VisionAI::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::VisionAI::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 = "warehouse-visionai.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-vision_ai-v1/lib/google/cloud/vision_ai/v1/warehouse/paths.rb b/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/warehouse/paths.rb new file mode 100644 index 000000000000..bc6b0095d5d0 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/warehouse/paths.rb @@ -0,0 +1,237 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 VisionAI + module V1 + module Warehouse + # Path helper methods for the Warehouse API. + module Paths + ## + # Create a fully-qualified Annotation resource string. + # + # The resource will be in the following format: + # + # `projects/{project_number}/locations/{location}/corpora/{corpus}/assets/{asset}/annotations/{annotation}` + # + # @param project_number [String] + # @param location [String] + # @param corpus [String] + # @param asset [String] + # @param annotation [String] + # + # @return [::String] + def annotation_path project_number:, location:, corpus:, asset:, annotation: + raise ::ArgumentError, "project_number cannot contain /" if project_number.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "corpus cannot contain /" if corpus.to_s.include? "/" + raise ::ArgumentError, "asset cannot contain /" if asset.to_s.include? "/" + + "projects/#{project_number}/locations/#{location}/corpora/#{corpus}/assets/#{asset}/annotations/#{annotation}" + end + + ## + # Create a fully-qualified Asset resource string. + # + # The resource will be in the following format: + # + # `projects/{project_number}/locations/{location}/corpora/{corpus}/assets/{asset}` + # + # @param project_number [String] + # @param location [String] + # @param corpus [String] + # @param asset [String] + # + # @return [::String] + def asset_path project_number:, location:, corpus:, asset: + raise ::ArgumentError, "project_number cannot contain /" if project_number.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "corpus cannot contain /" if corpus.to_s.include? "/" + + "projects/#{project_number}/locations/#{location}/corpora/#{corpus}/assets/#{asset}" + end + + ## + # Create a fully-qualified Collection resource string. + # + # The resource will be in the following format: + # + # `projects/{project_number}/locations/{location}/corpora/{corpus}/collections/{collection}` + # + # @param project_number [String] + # @param location [String] + # @param corpus [String] + # @param collection [String] + # + # @return [::String] + def collection_path project_number:, location:, corpus:, collection: + raise ::ArgumentError, "project_number cannot contain /" if project_number.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "corpus cannot contain /" if corpus.to_s.include? "/" + + "projects/#{project_number}/locations/#{location}/corpora/#{corpus}/collections/#{collection}" + end + + ## + # Create a fully-qualified Corpus resource string. + # + # The resource will be in the following format: + # + # `projects/{project_number}/locations/{location}/corpora/{corpus}` + # + # @param project_number [String] + # @param location [String] + # @param corpus [String] + # + # @return [::String] + def corpus_path project_number:, location:, corpus: + raise ::ArgumentError, "project_number cannot contain /" if project_number.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project_number}/locations/#{location}/corpora/#{corpus}" + end + + ## + # Create a fully-qualified DataSchema resource string. + # + # The resource will be in the following format: + # + # `projects/{project_number}/locations/{location}/corpora/{corpus}/dataSchemas/{data_schema}` + # + # @param project_number [String] + # @param location [String] + # @param corpus [String] + # @param data_schema [String] + # + # @return [::String] + def data_schema_path project_number:, location:, corpus:, data_schema: + raise ::ArgumentError, "project_number cannot contain /" if project_number.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "corpus cannot contain /" if corpus.to_s.include? "/" + + "projects/#{project_number}/locations/#{location}/corpora/#{corpus}/dataSchemas/#{data_schema}" + end + + ## + # Create a fully-qualified Index resource string. + # + # The resource will be in the following format: + # + # `projects/{project_number}/locations/{location}/corpora/{corpus}/indexes/{index}` + # + # @param project_number [String] + # @param location [String] + # @param corpus [String] + # @param index [String] + # + # @return [::String] + def index_path project_number:, location:, corpus:, index: + raise ::ArgumentError, "project_number cannot contain /" if project_number.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "corpus cannot contain /" if corpus.to_s.include? "/" + + "projects/#{project_number}/locations/#{location}/corpora/#{corpus}/indexes/#{index}" + end + + ## + # Create a fully-qualified IndexEndpoint resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/indexEndpoints/{index_endpoint}` + # + # @param project [String] + # @param location [String] + # @param index_endpoint [String] + # + # @return [::String] + def index_endpoint_path project:, location:, index_endpoint: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/indexEndpoints/#{index_endpoint}" + 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 SearchConfig resource string. + # + # The resource will be in the following format: + # + # `projects/{project_number}/locations/{location}/corpora/{corpus}/searchConfigs/{search_config}` + # + # @param project_number [String] + # @param location [String] + # @param corpus [String] + # @param search_config [String] + # + # @return [::String] + def search_config_path project_number:, location:, corpus:, search_config: + raise ::ArgumentError, "project_number cannot contain /" if project_number.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "corpus cannot contain /" if corpus.to_s.include? "/" + + "projects/#{project_number}/locations/#{location}/corpora/#{corpus}/searchConfigs/#{search_config}" + end + + ## + # Create a fully-qualified SearchHypernym resource string. + # + # The resource will be in the following format: + # + # `projects/{project_number}/locations/{location}/corpora/{corpus}/searchHypernyms/{search_hypernym}` + # + # @param project_number [String] + # @param location [String] + # @param corpus [String] + # @param search_hypernym [String] + # + # @return [::String] + def search_hypernym_path project_number:, location:, corpus:, search_hypernym: + raise ::ArgumentError, "project_number cannot contain /" if project_number.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "corpus cannot contain /" if corpus.to_s.include? "/" + + "projects/#{project_number}/locations/#{location}/corpora/#{corpus}/searchHypernyms/#{search_hypernym}" + end + + extend self + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/warehouse/rest.rb b/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/warehouse/rest.rb new file mode 100644 index 000000000000..32d49293c6c4 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/warehouse/rest.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! + +require "gapic/rest" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/vision_ai/v1/version" +require "google/cloud/vision_ai/v1/bindings_override" + +require "google/cloud/vision_ai/v1/warehouse/credentials" +require "google/cloud/vision_ai/v1/warehouse/paths" +require "google/cloud/vision_ai/v1/warehouse/rest/operations" +require "google/cloud/vision_ai/v1/warehouse/rest/client" + +module Google + module Cloud + module VisionAI + module V1 + ## + # Service that manages media content + metadata for streaming. + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/vision_ai/v1/warehouse/rest" + # client = ::Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new + # + module Warehouse + # Client for the REST transport + module Rest + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "rest", "helpers.rb" +require "google/cloud/vision_ai/v1/warehouse/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/warehouse/rest/client.rb b/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/warehouse/rest/client.rb new file mode 100644 index 000000000000..a40fe393ea71 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/warehouse/rest/client.rb @@ -0,0 +1,6420 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/visionai/v1/warehouse_pb" +require "google/cloud/vision_ai/v1/warehouse/rest/service_stub" +require "google/cloud/location/rest" +require "google/iam/v1/rest" + +module Google + module Cloud + module VisionAI + module V1 + module Warehouse + module Rest + ## + # REST client for the Warehouse service. + # + # Service that manages media content + metadata for streaming. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "warehouse-visionai.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :warehouse_stub + + ## + # Configure the Warehouse Client class. + # + # See {::Google::Cloud::VisionAI::V1::Warehouse::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all Warehouse clients + # ::Google::Cloud::VisionAI::V1::Warehouse::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", "VisionAI", "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.timeout = 60.0 + default_config.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.create_asset.timeout = 120.0 + default_config.rpcs.create_asset.retry_policy = { + initial_delay: 1.0, max_delay: 120.0, multiplier: 2.5, retry_codes: [14] + } + + default_config.rpcs.create_corpus.timeout = 120.0 + default_config.rpcs.create_corpus.retry_policy = { + initial_delay: 1.0, max_delay: 120.0, multiplier: 2.5, retry_codes: [14] + } + + default_config.rpcs.create_data_schema.timeout = 120.0 + default_config.rpcs.create_data_schema.retry_policy = { + initial_delay: 1.0, max_delay: 120.0, multiplier: 2.5, retry_codes: [14] + } + + default_config.rpcs.create_annotation.timeout = 120.0 + default_config.rpcs.create_annotation.retry_policy = { + initial_delay: 1.0, max_delay: 120.0, multiplier: 2.5, retry_codes: [14] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the Warehouse 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::VisionAI::V1::Warehouse::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 + @warehouse_stub.universe_domain + end + + ## + # Create a new Warehouse REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Warehouse 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::VisionAI::V1::Warehouse::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 + + @warehouse_stub = ::Google::Cloud::VisionAI::V1::Warehouse::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials, + logger: @config.logger + ) + + @warehouse_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 = @warehouse_stub.endpoint + config.universe_domain = @warehouse_stub.universe_domain + config.bindings_override = @config.bindings_override + config.logger = @warehouse_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 = @warehouse_stub.endpoint + config.universe_domain = @warehouse_stub.universe_domain + config.logger = @warehouse_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::VisionAI::V1::Warehouse::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 + @warehouse_stub.logger + end + + # Service calls + + ## + # Creates an asset inside corpus. + # + # @overload create_asset(request, options = nil) + # Pass arguments to `create_asset` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::CreateAssetRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::CreateAssetRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_asset(parent: nil, asset: nil, asset_id: nil) + # Pass arguments to `create_asset` via keyword arguments. Note that at + # least one keyword argument is 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 parent resource where this asset will be created. + # Format: + # `projects/{project_number}/locations/{location_id}/corpora/{corpus_id}` + # @param asset [::Google::Cloud::VisionAI::V1::Asset, ::Hash] + # Required. The asset to create. + # @param asset_id [::String] + # Optional. The ID to use for the asset, which will become the final + # component of the asset's resource name if user choose to specify. + # Otherwise, asset id will be generated by system. + # + # This value should be up to 63 characters, and valid characters + # are /[a-z][0-9]-/. The first character must be a letter, the last could be + # a letter or a number. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::VisionAI::V1::Asset] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::VisionAI::V1::Asset] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::CreateAssetRequest.new + # + # # Call the create_asset method. + # result = client.create_asset request + # + # # The returned object is of type Google::Cloud::VisionAI::V1::Asset. + # p result + # + def create_asset request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::CreateAssetRequest + + # Converts hash 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_asset.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::VisionAI::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_asset.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_asset.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @warehouse_stub.create_asset 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 asset inside corpus. + # + # @overload update_asset(request, options = nil) + # Pass arguments to `update_asset` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::UpdateAssetRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::UpdateAssetRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_asset(asset: nil, update_mask: nil) + # Pass arguments to `update_asset` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param asset [::Google::Cloud::VisionAI::V1::Asset, ::Hash] + # Required. The asset to update. + # + # The asset's `name` field is used to identify the asset to be updated. + # Format: + # `projects/{project_number}/locations/{location}/corpora/{corpus}/assets/{asset}` + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # The list of fields to be updated. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::VisionAI::V1::Asset] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::VisionAI::V1::Asset] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::UpdateAssetRequest.new + # + # # Call the update_asset method. + # result = client.update_asset request + # + # # The returned object is of type Google::Cloud::VisionAI::V1::Asset. + # p result + # + def update_asset request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::UpdateAssetRequest + + # Converts hash 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_asset.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::VisionAI::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_asset.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_asset.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @warehouse_stub.update_asset 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 + + ## + # Reads an asset inside corpus. + # + # @overload get_asset(request, options = nil) + # Pass arguments to `get_asset` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::GetAssetRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::GetAssetRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_asset(name: nil) + # Pass arguments to `get_asset` via keyword arguments. Note that at + # least one keyword argument is 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 name of the asset to retrieve. + # Format: + # projects/\\{project_number}/locations/\\{location}/corpora/\\{corpus}/assets/\\{asset} + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::VisionAI::V1::Asset] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::VisionAI::V1::Asset] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::GetAssetRequest.new + # + # # Call the get_asset method. + # result = client.get_asset request + # + # # The returned object is of type Google::Cloud::VisionAI::V1::Asset. + # p result + # + def get_asset request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::GetAssetRequest + + # Converts hash 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_asset.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::VisionAI::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_asset.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_asset.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @warehouse_stub.get_asset 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 an list of assets inside corpus. + # + # @overload list_assets(request, options = nil) + # Pass arguments to `list_assets` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::ListAssetsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::ListAssetsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_assets(parent: nil, page_size: nil, page_token: nil, filter: nil) + # Pass arguments to `list_assets` via keyword arguments. Note that at + # least one keyword argument is 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 parent, which owns this collection of assets. + # Format: + # `projects/{project_number}/locations/{location}/corpora/{corpus}` + # @param page_size [::Integer] + # The maximum number of assets to return. The service may return fewer than + # this value. + # If unspecified, at most 50 assets will be returned. + # The maximum value is 1000; values above 1000 will be coerced to 1000. + # @param page_token [::String] + # A page token, received from a previous `ListAssets` call. + # Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to `ListAssets` must match + # the call that provided the page token. + # @param filter [::String] + # The filter applied to the returned list. + # Only the following filterings are supported: + # "assets_with_contents = true", which returns assets with contents uploaded; + # "assets_with_contents = false", which returns assets without contents. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::VisionAI::V1::Asset>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::VisionAI::V1::Asset>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::ListAssetsRequest.new + # + # # Call the list_assets method. + # result = client.list_assets 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::VisionAI::V1::Asset. + # p item + # end + # + def list_assets request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::ListAssetsRequest + + # Converts hash 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_assets.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::VisionAI::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_assets.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_assets.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @warehouse_stub.list_assets request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @warehouse_stub, :list_assets, "assets", 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 asset inside corpus. + # + # @overload delete_asset(request, options = nil) + # Pass arguments to `delete_asset` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::DeleteAssetRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::DeleteAssetRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_asset(name: nil) + # Pass arguments to `delete_asset` via keyword arguments. Note that at + # least one keyword argument is 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 name of the asset to delete. + # Format: + # `projects/{project_number}/locations/{location}/corpora/{corpus}/assets/{asset}` + # @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/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::DeleteAssetRequest.new + # + # # Call the delete_asset method. + # result = client.delete_asset 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_asset request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::DeleteAssetRequest + + # Converts hash 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_asset.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::VisionAI::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_asset.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_asset.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @warehouse_stub.delete_asset 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 + + ## + # Upload asset by specifing the asset Cloud Storage uri. + # For video warehouse, it requires users who call this API have read access + # to the cloud storage file. Once it is uploaded, it can be retrieved by + # GenerateRetrievalUrl API which by default, only can retrieve cloud storage + # files from the same project of the warehouse. To allow retrieval cloud + # storage files that are in a separate project, it requires to find the + # vision ai service account (Go to IAM, check checkbox to show "Include + # Google-provided role grants", search for "Cloud Vision AI Service Agent") + # and grant the read access of the cloud storage files to that service + # account. + # + # @overload upload_asset(request, options = nil) + # Pass arguments to `upload_asset` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::UploadAssetRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::UploadAssetRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload upload_asset(name: nil, asset_source: nil) + # Pass arguments to `upload_asset` via keyword arguments. Note that at + # least one keyword argument is 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 asset to upload. + # Format: + # `projects/{project_number}/locations/{location_id}/corpora/{corpus_id}/assets/{asset_id}` + # @param asset_source [::Google::Cloud::VisionAI::V1::AssetSource, ::Hash] + # The source of the asset. + # @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/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::UploadAssetRequest.new + # + # # Call the upload_asset method. + # result = client.upload_asset 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 upload_asset request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::UploadAssetRequest + + # Converts hash 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.upload_asset.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::VisionAI::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.upload_asset.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.upload_asset.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @warehouse_stub.upload_asset 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 + + ## + # Generates a signed url for downloading the asset. + # For video warehouse, please see comment of UploadAsset about how to allow + # retrieval of cloud storage files in a different project. + # + # @overload generate_retrieval_url(request, options = nil) + # Pass arguments to `generate_retrieval_url` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::GenerateRetrievalUrlRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::GenerateRetrievalUrlRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_retrieval_url(name: nil) + # Pass arguments to `generate_retrieval_url` via keyword arguments. Note that at + # least one keyword argument is 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 asset to request signed url for. + # Format: + # `projects/{project_number}/locations/{location_id}/corpora/{corpus_id}/assets/{asset_id}` + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::VisionAI::V1::GenerateRetrievalUrlResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::VisionAI::V1::GenerateRetrievalUrlResponse] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::GenerateRetrievalUrlRequest.new + # + # # Call the generate_retrieval_url method. + # result = client.generate_retrieval_url request + # + # # The returned object is of type Google::Cloud::VisionAI::V1::GenerateRetrievalUrlResponse. + # p result + # + def generate_retrieval_url request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::GenerateRetrievalUrlRequest + + # Converts hash 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_retrieval_url.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::VisionAI::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_retrieval_url.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.generate_retrieval_url.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @warehouse_stub.generate_retrieval_url 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 + + ## + # Analyze asset to power search capability. + # + # @overload analyze_asset(request, options = nil) + # Pass arguments to `analyze_asset` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::AnalyzeAssetRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::AnalyzeAssetRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload analyze_asset(name: nil) + # Pass arguments to `analyze_asset` via keyword arguments. Note that at + # least one keyword argument is 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 asset to analyze. + # Format: + # `projects/{project_number}/locations/{location_id}/corpora/{corpus_id}/assets/{asset_id}` + # @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/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::AnalyzeAssetRequest.new + # + # # Call the analyze_asset method. + # result = client.analyze_asset 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 analyze_asset request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::AnalyzeAssetRequest + + # Converts hash 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.analyze_asset.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::VisionAI::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.analyze_asset.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.analyze_asset.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @warehouse_stub.analyze_asset 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 + + ## + # Index one asset for search. + # Supported corpus type: Corpus.Type.VIDEO_ON_DEMAND + # + # @overload index_asset(request, options = nil) + # Pass arguments to `index_asset` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::IndexAssetRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::IndexAssetRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload index_asset(name: nil, index: nil) + # Pass arguments to `index_asset` via keyword arguments. Note that at + # least one keyword argument is 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 asset to index. + # Format: + # `projects/{project_number}/locations/{location_id}/corpora/{corpus_id}/assets/{asset_id}` + # @param index [::String] + # Optional. The name of the index. + # Format: + # `projects/{project_number}/locations/{location}/corpora/{corpus}/indexes/{index}` + # @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/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::IndexAssetRequest.new + # + # # Call the index_asset method. + # result = client.index_asset 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 index_asset request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::IndexAssetRequest + + # Converts hash 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.index_asset.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::VisionAI::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.index_asset.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.index_asset.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @warehouse_stub.index_asset 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 + + ## + # Remove one asset's index data for search. + # Supported corpus type: Corpus.Type.VIDEO_ON_DEMAND + # + # @overload remove_index_asset(request, options = nil) + # Pass arguments to `remove_index_asset` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::RemoveIndexAssetRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::RemoveIndexAssetRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload remove_index_asset(name: nil, index: nil) + # Pass arguments to `remove_index_asset` via keyword arguments. Note that at + # least one keyword argument is 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 asset to index. + # Format: + # `projects/{project_number}/locations/{location_id}/corpora/{corpus_id}/assets/{asset_id}` + # @param index [::String] + # Optional. The name of the index. + # Format: + # `projects/{project_number}/locations/{location}/corpora/{corpus}/indexes/{index}` + # @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/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::RemoveIndexAssetRequest.new + # + # # Call the remove_index_asset method. + # result = client.remove_index_asset 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 remove_index_asset request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::RemoveIndexAssetRequest + + # Converts hash 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.remove_index_asset.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::VisionAI::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.remove_index_asset.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.remove_index_asset.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @warehouse_stub.remove_index_asset 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 + + ## + # Lists assets inside an index. + # + # @overload view_indexed_assets(request, options = nil) + # Pass arguments to `view_indexed_assets` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::ViewIndexedAssetsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::ViewIndexedAssetsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload view_indexed_assets(index: nil, page_size: nil, page_token: nil, filter: nil) + # Pass arguments to `view_indexed_assets` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param index [::String] + # Required. The index that owns this collection of assets. + # Format: + # `projects/{project_number}/locations/{location}/corpora/{corpus}/indexes/{index}` + # @param page_size [::Integer] + # The maximum number of assets to return. The service may return fewer than + # this value. + # If unspecified, at most 50 assets will be returned. + # The maximum value is 1000; values above 1000 will be coerced to 1000. + # @param page_token [::String] + # A page token, received from a previous `ViewIndexedAssets` call. + # Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to `ViewIndexedAssets` must + # match the call that provided the page token. + # @param filter [::String] + # The filter applied to the returned list. + # Only the following filterings are supported: + # "asset_id = xxxx", which returns asset with specified id. + # "asset_id = xxxx, yyyy, zzzz", which returns assets with specified ids. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::VisionAI::V1::IndexedAsset>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::VisionAI::V1::IndexedAsset>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::ViewIndexedAssetsRequest.new + # + # # Call the view_indexed_assets method. + # result = client.view_indexed_assets 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::VisionAI::V1::IndexedAsset. + # p item + # end + # + def view_indexed_assets request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::ViewIndexedAssetsRequest + + # Converts hash 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.view_indexed_assets.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::VisionAI::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.view_indexed_assets.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.view_indexed_assets.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @warehouse_stub.view_indexed_assets request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @warehouse_stub, :view_indexed_assets, "indexed_assets", 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 + + ## + # Creates an Index under the corpus. + # + # @overload create_index(request, options = nil) + # Pass arguments to `create_index` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::CreateIndexRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::CreateIndexRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_index(parent: nil, index_id: nil, index: nil) + # Pass arguments to `create_index` via keyword arguments. Note that at + # least one keyword argument is 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. Value for the parent. The resource name of the Corpus under which + # this index is created. Format: + # `projects/{project_number}/locations/{location_id}/corpora/{corpus_id}` + # @param index_id [::String] + # Optional. The ID for the index. This will become the final resource name + # for the index. If the user does not specify this value, it will be + # generated by system. + # + # This value should be up to 63 characters, and valid characters + # are /[a-z][0-9]-/. The first character must be a letter, the last could be + # a letter or a number. + # @param index [::Google::Cloud::VisionAI::V1::Index, ::Hash] + # Required. The index being created. + # @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/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::CreateIndexRequest.new + # + # # Call the create_index method. + # result = client.create_index 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_index request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::CreateIndexRequest + + # Converts hash 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_index.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::VisionAI::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_index.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_index.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @warehouse_stub.create_index 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 + + ## + # Updates an Index under the corpus. + # Users can perform a metadata-only update or trigger a full index rebuild + # with different update_mask values. + # + # @overload update_index(request, options = nil) + # Pass arguments to `update_index` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::UpdateIndexRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::UpdateIndexRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_index(index: nil, update_mask: nil) + # Pass arguments to `update_index` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param index [::Google::Cloud::VisionAI::V1::Index, ::Hash] + # Required. The resource being updated. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. Field mask is used to specify the fields to be overwritten in the + # Index resource by the update. The fields specified in the update_mask are + # relative to the resource, not the full request. A field of the resource + # will be overwritten if it is in the mask. Empty field mask is not allowed. + # If the mask is "*", it triggers a full update of the index, and also a + # whole rebuild of index data. + # @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/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::UpdateIndexRequest.new + # + # # Call the update_index method. + # result = client.update_index 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 update_index request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::UpdateIndexRequest + + # Converts hash 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_index.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::VisionAI::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_index.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_index.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @warehouse_stub.update_index 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 + + ## + # Gets the details of a single Index under a Corpus. + # + # @overload get_index(request, options = nil) + # Pass arguments to `get_index` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::GetIndexRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::GetIndexRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_index(name: nil) + # Pass arguments to `get_index` via keyword arguments. Note that at + # least one keyword argument is 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 Index resource. + # Format: + # `projects/{project_number}/locations/{location}/corpora/{corpus}/indexes/{index}` + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::VisionAI::V1::Index] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::VisionAI::V1::Index] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::GetIndexRequest.new + # + # # Call the get_index method. + # result = client.get_index request + # + # # The returned object is of type Google::Cloud::VisionAI::V1::Index. + # p result + # + def get_index request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::GetIndexRequest + + # Converts hash 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_index.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::VisionAI::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_index.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_index.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @warehouse_stub.get_index 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 + + ## + # List all Indexes in a given Corpus. + # + # @overload list_indexes(request, options = nil) + # Pass arguments to `list_indexes` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::ListIndexesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::ListIndexesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_indexes(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_indexes` via keyword arguments. Note that at + # least one keyword argument is 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 parent corpus that owns this collection of indexes. + # Format: + # `projects/{project_number}/locations/{location}/corpora/{corpus}` + # @param page_size [::Integer] + # The maximum number of indexes to return. The service may return fewer than + # this value. + # If unspecified, at most 50 indexes will be returned. + # The maximum value is 1000; values above 1000 will be coerced to 1000. + # @param page_token [::String] + # A page token, received from a previous `ListIndexes` call. + # Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to `ListIndexes` must match + # the call that provided the page token. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::VisionAI::V1::Index>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::VisionAI::V1::Index>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::ListIndexesRequest.new + # + # # Call the list_indexes method. + # result = client.list_indexes 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::VisionAI::V1::Index. + # p item + # end + # + def list_indexes request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::ListIndexesRequest + + # Converts hash 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_indexes.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::VisionAI::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_indexes.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_indexes.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @warehouse_stub.list_indexes request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @warehouse_stub, :list_indexes, "indexes", 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 + + ## + # Delete a single Index. In order to delete an index, the caller must + # make sure that it is not deployed to any index endpoint. + # + # @overload delete_index(request, options = nil) + # Pass arguments to `delete_index` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::DeleteIndexRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::DeleteIndexRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_index(name: nil) + # Pass arguments to `delete_index` via keyword arguments. Note that at + # least one keyword argument is 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 name of the index to delete. + # Format: + # `projects/{project_number}/locations/{location}/corpora/{corpus}/indexes/{index}` + # @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/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::DeleteIndexRequest.new + # + # # Call the delete_index method. + # result = client.delete_index 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_index request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::DeleteIndexRequest + + # Converts hash 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_index.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::VisionAI::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_index.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_index.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @warehouse_stub.delete_index 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 corpus inside a project. + # + # @overload create_corpus(request, options = nil) + # Pass arguments to `create_corpus` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::CreateCorpusRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::CreateCorpusRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_corpus(parent: nil, corpus: nil) + # Pass arguments to `create_corpus` via keyword arguments. Note that at + # least one keyword argument is 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. Form: `projects/{project_number}/locations/{location_id}` + # @param corpus [::Google::Cloud::VisionAI::V1::Corpus, ::Hash] + # Required. The corpus to be created. + # @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/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::CreateCorpusRequest.new + # + # # Call the create_corpus method. + # result = client.create_corpus 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_corpus request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::CreateCorpusRequest + + # Converts hash 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_corpus.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::VisionAI::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_corpus.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_corpus.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @warehouse_stub.create_corpus 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 + + ## + # Gets corpus details inside a project. + # + # @overload get_corpus(request, options = nil) + # Pass arguments to `get_corpus` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::GetCorpusRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::GetCorpusRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_corpus(name: nil) + # Pass arguments to `get_corpus` via keyword arguments. Note that at + # least one keyword argument is 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 corpus to retrieve. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::VisionAI::V1::Corpus] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::VisionAI::V1::Corpus] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::GetCorpusRequest.new + # + # # Call the get_corpus method. + # result = client.get_corpus request + # + # # The returned object is of type Google::Cloud::VisionAI::V1::Corpus. + # p result + # + def get_corpus request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::GetCorpusRequest + + # Converts hash 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_corpus.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::VisionAI::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_corpus.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_corpus.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @warehouse_stub.get_corpus 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 a corpus in a project. + # + # @overload update_corpus(request, options = nil) + # Pass arguments to `update_corpus` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::UpdateCorpusRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::UpdateCorpusRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_corpus(corpus: nil, update_mask: nil) + # Pass arguments to `update_corpus` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param corpus [::Google::Cloud::VisionAI::V1::Corpus, ::Hash] + # Required. The corpus which replaces the resource on the server. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # The list of fields to be updated. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::VisionAI::V1::Corpus] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::VisionAI::V1::Corpus] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::UpdateCorpusRequest.new + # + # # Call the update_corpus method. + # result = client.update_corpus request + # + # # The returned object is of type Google::Cloud::VisionAI::V1::Corpus. + # p result + # + def update_corpus request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::UpdateCorpusRequest + + # Converts hash 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_corpus.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::VisionAI::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_corpus.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_corpus.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @warehouse_stub.update_corpus 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 all corpora in a project. + # + # @overload list_corpora(request, options = nil) + # Pass arguments to `list_corpora` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::ListCorporaRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::ListCorporaRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_corpora(parent: nil, page_size: nil, page_token: nil, filter: nil) + # Pass arguments to `list_corpora` via keyword arguments. Note that at + # least one keyword argument is 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 project from which to list corpora. + # @param page_size [::Integer] + # Requested page size. API may return fewer results than requested. + # If negative, INVALID_ARGUMENT error will be returned. + # If unspecified or 0, API will pick a default size, which is 10. + # If the requested page size is larger than the maximum size, API will pick + # use the maximum size, which is 20. + # @param page_token [::String] + # A token identifying a page of results for the server to return. + # Typically obtained via + # {::Google::Cloud::VisionAI::V1::ListCorporaResponse#next_page_token ListCorporaResponse.next_page_token} + # of the previous + # {::Google::Cloud::VisionAI::V1::Warehouse::Rest::Client#list_corpora Warehouse.ListCorpora} + # call. + # @param filter [::String] + # The filter applied to the returned corpora list. + # Only the following restrictions are supported: + # `type=`, + # `type!=`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::VisionAI::V1::Corpus>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::VisionAI::V1::Corpus>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::ListCorporaRequest.new + # + # # Call the list_corpora method. + # result = client.list_corpora 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::VisionAI::V1::Corpus. + # p item + # end + # + def list_corpora request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::ListCorporaRequest + + # Converts hash 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_corpora.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::VisionAI::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_corpora.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_corpora.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @warehouse_stub.list_corpora request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @warehouse_stub, :list_corpora, "corpora", 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 corpus only if its empty. + # Returns empty response. + # + # @overload delete_corpus(request, options = nil) + # Pass arguments to `delete_corpus` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::DeleteCorpusRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::DeleteCorpusRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_corpus(name: nil) + # Pass arguments to `delete_corpus` via keyword arguments. Note that at + # least one keyword argument is 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 corpus 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/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::DeleteCorpusRequest.new + # + # # Call the delete_corpus method. + # result = client.delete_corpus request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_corpus request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::DeleteCorpusRequest + + # Converts hash 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_corpus.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::VisionAI::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_corpus.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_corpus.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @warehouse_stub.delete_corpus 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 + + ## + # Analyzes a corpus. + # + # @overload analyze_corpus(request, options = nil) + # Pass arguments to `analyze_corpus` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::AnalyzeCorpusRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::AnalyzeCorpusRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload analyze_corpus(name: nil) + # Pass arguments to `analyze_corpus` via keyword arguments. Note that at + # least one keyword argument is 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 parent corpus resource where the assets will be analyzed. + # Format: + # `projects/{project_number}/locations/{location_id}/corpora/{corpus_id}` + # @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/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::AnalyzeCorpusRequest.new + # + # # Call the analyze_corpus method. + # result = client.analyze_corpus 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 analyze_corpus request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::AnalyzeCorpusRequest + + # Converts hash 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.analyze_corpus.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::VisionAI::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.analyze_corpus.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.analyze_corpus.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @warehouse_stub.analyze_corpus 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 data schema inside corpus. + # + # @overload create_data_schema(request, options = nil) + # Pass arguments to `create_data_schema` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::CreateDataSchemaRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::CreateDataSchemaRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_data_schema(parent: nil, data_schema: nil) + # Pass arguments to `create_data_schema` via keyword arguments. Note that at + # least one keyword argument is 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 parent resource where this data schema will be created. + # Format: + # `projects/{project_number}/locations/{location_id}/corpora/{corpus_id}` + # @param data_schema [::Google::Cloud::VisionAI::V1::DataSchema, ::Hash] + # Required. The data schema to create. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::VisionAI::V1::DataSchema] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::VisionAI::V1::DataSchema] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::CreateDataSchemaRequest.new + # + # # Call the create_data_schema method. + # result = client.create_data_schema request + # + # # The returned object is of type Google::Cloud::VisionAI::V1::DataSchema. + # p result + # + def create_data_schema request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::CreateDataSchemaRequest + + # Converts hash 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_data_schema.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::VisionAI::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_data_schema.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_data_schema.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @warehouse_stub.create_data_schema 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 data schema inside corpus. + # + # @overload update_data_schema(request, options = nil) + # Pass arguments to `update_data_schema` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::UpdateDataSchemaRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::UpdateDataSchemaRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_data_schema(data_schema: nil, update_mask: nil) + # Pass arguments to `update_data_schema` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param data_schema [::Google::Cloud::VisionAI::V1::DataSchema, ::Hash] + # Required. The data schema's `name` field is used to identify the data + # schema to be updated. Format: + # `projects/{project_number}/locations/{location}/corpora/{corpus}/dataSchemas/{data_schema}` + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # The list of fields to be updated. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::VisionAI::V1::DataSchema] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::VisionAI::V1::DataSchema] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::UpdateDataSchemaRequest.new + # + # # Call the update_data_schema method. + # result = client.update_data_schema request + # + # # The returned object is of type Google::Cloud::VisionAI::V1::DataSchema. + # p result + # + def update_data_schema request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::UpdateDataSchemaRequest + + # Converts hash 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_data_schema.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::VisionAI::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_data_schema.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_data_schema.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @warehouse_stub.update_data_schema 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 + + ## + # Gets data schema inside corpus. + # + # @overload get_data_schema(request, options = nil) + # Pass arguments to `get_data_schema` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::GetDataSchemaRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::GetDataSchemaRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_data_schema(name: nil) + # Pass arguments to `get_data_schema` via keyword arguments. Note that at + # least one keyword argument is 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 name of the data schema to retrieve. + # Format: + # `projects/{project_number}/locations/{location_id}/corpora/{corpus_id}/dataSchemas/{data_schema_id}` + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::VisionAI::V1::DataSchema] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::VisionAI::V1::DataSchema] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::GetDataSchemaRequest.new + # + # # Call the get_data_schema method. + # result = client.get_data_schema request + # + # # The returned object is of type Google::Cloud::VisionAI::V1::DataSchema. + # p result + # + def get_data_schema request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::GetDataSchemaRequest + + # Converts hash 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_data_schema.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::VisionAI::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_data_schema.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_data_schema.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @warehouse_stub.get_data_schema 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 + + ## + # Deletes data schema inside corpus. + # + # @overload delete_data_schema(request, options = nil) + # Pass arguments to `delete_data_schema` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::DeleteDataSchemaRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::DeleteDataSchemaRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_data_schema(name: nil) + # Pass arguments to `delete_data_schema` via keyword arguments. Note that at + # least one keyword argument is 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 name of the data schema to delete. + # Format: + # `projects/{project_number}/locations/{location_id}/corpora/{corpus_id}/dataSchemas/{data_schema_id}` + # @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/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::DeleteDataSchemaRequest.new + # + # # Call the delete_data_schema method. + # result = client.delete_data_schema request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_data_schema request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::DeleteDataSchemaRequest + + # Converts hash 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_data_schema.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::VisionAI::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_data_schema.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_data_schema.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @warehouse_stub.delete_data_schema 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 a list of data schemas inside corpus. + # + # @overload list_data_schemas(request, options = nil) + # Pass arguments to `list_data_schemas` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::ListDataSchemasRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::ListDataSchemasRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_data_schemas(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_data_schemas` via keyword arguments. Note that at + # least one keyword argument is 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 parent, which owns this collection of data schemas. + # Format: + # `projects/{project_number}/locations/{location_id}/corpora/{corpus_id}` + # @param page_size [::Integer] + # The maximum number of data schemas to return. The service may return fewer + # than this value. If unspecified, at most 50 data schemas will be returned. + # The maximum value is 1000; values above 1000 will be coerced to 1000. + # @param page_token [::String] + # A page token, received from a previous `ListDataSchemas` call. + # Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to `ListDataSchemas` must + # match the call that provided the page token. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::VisionAI::V1::DataSchema>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::VisionAI::V1::DataSchema>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::ListDataSchemasRequest.new + # + # # Call the list_data_schemas method. + # result = client.list_data_schemas 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::VisionAI::V1::DataSchema. + # p item + # end + # + def list_data_schemas request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::ListDataSchemasRequest + + # Converts hash 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_data_schemas.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::VisionAI::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_data_schemas.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_data_schemas.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @warehouse_stub.list_data_schemas request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @warehouse_stub, :list_data_schemas, "data_schemas", 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 + + ## + # Creates annotation inside asset. + # + # @overload create_annotation(request, options = nil) + # Pass arguments to `create_annotation` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::CreateAnnotationRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::CreateAnnotationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_annotation(parent: nil, annotation: nil, annotation_id: nil) + # Pass arguments to `create_annotation` via keyword arguments. Note that at + # least one keyword argument is 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 parent resource where this annotation will be created. + # Format: + # `projects/{project_number}/locations/{location_id}/corpora/{corpus_id}/assets/{asset_id}` + # @param annotation [::Google::Cloud::VisionAI::V1::Annotation, ::Hash] + # Required. The annotation to create. + # @param annotation_id [::String] + # Optional. The ID to use for the annotation, which will become the final + # component of the annotation's resource name if user choose to specify. + # Otherwise, annotation id will be generated by system. + # + # This value should be up to 63 characters, and valid characters + # are /[a-z][0-9]-/. The first character must be a letter, the last could be + # a letter or a number. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::VisionAI::V1::Annotation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::VisionAI::V1::Annotation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::CreateAnnotationRequest.new + # + # # Call the create_annotation method. + # result = client.create_annotation request + # + # # The returned object is of type Google::Cloud::VisionAI::V1::Annotation. + # p result + # + def create_annotation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::CreateAnnotationRequest + + # Converts hash 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_annotation.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::VisionAI::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_annotation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_annotation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @warehouse_stub.create_annotation 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 + + ## + # Reads annotation inside asset. + # + # @overload get_annotation(request, options = nil) + # Pass arguments to `get_annotation` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::GetAnnotationRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::GetAnnotationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_annotation(name: nil) + # Pass arguments to `get_annotation` via keyword arguments. Note that at + # least one keyword argument is 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 name of the annotation to retrieve. + # Format: + # `projects/{project_number}/locations/{location}/corpora/{corpus}/assets/{asset}/annotations/{annotation}` + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::VisionAI::V1::Annotation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::VisionAI::V1::Annotation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::GetAnnotationRequest.new + # + # # Call the get_annotation method. + # result = client.get_annotation request + # + # # The returned object is of type Google::Cloud::VisionAI::V1::Annotation. + # p result + # + def get_annotation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::GetAnnotationRequest + + # Converts hash 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_annotation.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::VisionAI::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_annotation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_annotation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @warehouse_stub.get_annotation 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 a list of annotations inside asset. + # + # @overload list_annotations(request, options = nil) + # Pass arguments to `list_annotations` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::ListAnnotationsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::ListAnnotationsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_annotations(parent: nil, page_size: nil, page_token: nil, filter: nil) + # Pass arguments to `list_annotations` via keyword arguments. Note that at + # least one keyword argument is 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] + # The parent, which owns this collection of annotations. + # Format: + # `projects/{project_number}/locations/{location}/corpora/{corpus}/assets/{asset}` + # @param page_size [::Integer] + # The maximum number of annotations to return. The service may return fewer + # than this value. If unspecified, at most 50 annotations will be returned. + # The maximum value is 1000; values above 1000 will be coerced to 1000. + # @param page_token [::String] + # A page token, received from a previous `ListAnnotations` call. + # Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to `ListAnnotations` must + # match the call that provided the page token. + # @param filter [::String] + # The filter applied to the returned list. + # We only support filtering for the following fields: + # For corpus of STREAM_VIDEO type: + # `partition.temporal_partition.start_time`, + # `partition.temporal_partition.end_time`, and `key`. + # For corpus of VIDEO_ON_DEMAND type, + # `partition.relative_temporal_partition.start_offset`, + # `partition.relative_temporal_partition.end_offset`, and `key`. + # For corpus of IMAGE type, only `key` is supported. + # Timestamps are specified in the RFC-3339 format, and only one restriction + # may be applied per field, joined by conjunctions. + # Format: + # "partition.temporal_partition.start_time > "2012-04-21T11:30:00-04:00" AND + # partition.temporal_partition.end_time < "2012-04-22T11:30:00-04:00" AND + # key = "example_key"" + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::VisionAI::V1::Annotation>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::VisionAI::V1::Annotation>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::ListAnnotationsRequest.new + # + # # Call the list_annotations method. + # result = client.list_annotations 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::VisionAI::V1::Annotation. + # p item + # end + # + def list_annotations request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::ListAnnotationsRequest + + # Converts hash 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_annotations.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::VisionAI::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_annotations.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_annotations.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @warehouse_stub.list_annotations request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @warehouse_stub, :list_annotations, "annotations", 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 + + ## + # Updates annotation inside asset. + # + # @overload update_annotation(request, options = nil) + # Pass arguments to `update_annotation` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::UpdateAnnotationRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::UpdateAnnotationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_annotation(annotation: nil, update_mask: nil) + # Pass arguments to `update_annotation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param annotation [::Google::Cloud::VisionAI::V1::Annotation, ::Hash] + # Required. The annotation to update. + # The annotation's `name` field is used to identify the annotation to be + # updated. Format: + # `projects/{project_number}/locations/{location}/corpora/{corpus}/assets/{asset}/annotations/{annotation}` + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # The list of fields to be updated. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::VisionAI::V1::Annotation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::VisionAI::V1::Annotation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::UpdateAnnotationRequest.new + # + # # Call the update_annotation method. + # result = client.update_annotation request + # + # # The returned object is of type Google::Cloud::VisionAI::V1::Annotation. + # p result + # + def update_annotation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::UpdateAnnotationRequest + + # Converts hash 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_annotation.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::VisionAI::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_annotation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_annotation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @warehouse_stub.update_annotation 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 + + ## + # Deletes annotation inside asset. + # + # @overload delete_annotation(request, options = nil) + # Pass arguments to `delete_annotation` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::DeleteAnnotationRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::DeleteAnnotationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_annotation(name: nil) + # Pass arguments to `delete_annotation` via keyword arguments. Note that at + # least one keyword argument is 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 name of the annotation to delete. + # Format: + # `projects/{project_number}/locations/{location}/corpora/{corpus}/assets/{asset}/annotations/{annotation}` + # @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/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::DeleteAnnotationRequest.new + # + # # Call the delete_annotation method. + # result = client.delete_annotation request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_annotation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::DeleteAnnotationRequest + + # Converts hash 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_annotation.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::VisionAI::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_annotation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_annotation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @warehouse_stub.delete_annotation 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 + + ## + # Supported by STREAM_VIDEO corpus type. + # Generates clips for downloading. The api takes in a time range, and + # generates a clip of the first content available after start_time and + # before end_time, which may overflow beyond these bounds. + # Returned clips are truncated if the total size of the clips are larger + # than 100MB. + # + # @overload clip_asset(request, options = nil) + # Pass arguments to `clip_asset` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::ClipAssetRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::ClipAssetRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload clip_asset(name: nil, temporal_partition: nil) + # Pass arguments to `clip_asset` via keyword arguments. Note that at + # least one keyword argument is 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 asset to request clips for. + # Format: + # `projects/{project_number}/locations/{location_id}/corpora/{corpus_id}/assets/{asset_id}` + # @param temporal_partition [::Google::Cloud::VisionAI::V1::Partition::TemporalPartition, ::Hash] + # Required. The time range to request clips for. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::VisionAI::V1::ClipAssetResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::VisionAI::V1::ClipAssetResponse] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::ClipAssetRequest.new + # + # # Call the clip_asset method. + # result = client.clip_asset request + # + # # The returned object is of type Google::Cloud::VisionAI::V1::ClipAssetResponse. + # p result + # + def clip_asset request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::ClipAssetRequest + + # Converts hash 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.clip_asset.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::VisionAI::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.clip_asset.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.clip_asset.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @warehouse_stub.clip_asset 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 + + ## + # Generates a uri for an HLS manifest. The api takes in a collection of time + # ranges, and generates a URI for an HLS manifest that covers all the + # requested time ranges. + # + # @overload generate_hls_uri(request, options = nil) + # Pass arguments to `generate_hls_uri` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::GenerateHlsUriRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::GenerateHlsUriRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_hls_uri(name: nil, temporal_partitions: nil, live_view_enabled: nil) + # Pass arguments to `generate_hls_uri` via keyword arguments. Note that at + # least one keyword argument is 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 asset to request clips for. + # Format: + # `projects/{project_number}/locations/{location_id}/corpora/{corpus_id}/assets/{asset_id}` + # @param temporal_partitions [::Array<::Google::Cloud::VisionAI::V1::Partition::TemporalPartition, ::Hash>] + # The time range to request clips for. Will be ignored if `get_live_view` is + # set to True. The total time range requested should be smaller than 24h. + # @param live_view_enabled [::Boolean] + # Option to exclusively show a livestream of the asset with up to 3 minutes + # of backlog data. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::VisionAI::V1::GenerateHlsUriResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::VisionAI::V1::GenerateHlsUriResponse] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::GenerateHlsUriRequest.new + # + # # Call the generate_hls_uri method. + # result = client.generate_hls_uri request + # + # # The returned object is of type Google::Cloud::VisionAI::V1::GenerateHlsUriResponse. + # p result + # + def generate_hls_uri request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::GenerateHlsUriRequest + + # Converts hash 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_hls_uri.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::VisionAI::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_hls_uri.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.generate_hls_uri.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @warehouse_stub.generate_hls_uri 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 + + ## + # Imports assets (images plus annotations) from a meta file on cloud storage. + # Each row in the meta file is corresponding to an image (specified by a + # cloud storage uri) and its annotations. + # + # @overload import_assets(request, options = nil) + # Pass arguments to `import_assets` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::ImportAssetsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::ImportAssetsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_assets(assets_gcs_uri: nil, parent: nil) + # Pass arguments to `import_assets` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param assets_gcs_uri [::String] + # The file contains all assets information to be imported. + # * The file is in JSONL format. + # * Each line corresponding to one asset. + # * Each line will be converted into InputImageAsset proto. + # @param parent [::String] + # Required. The parent corpus resource where the assets will be imported. + # Format: + # `projects/{project_number}/locations/{location_id}/corpora/{corpus_id}` + # @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/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::ImportAssetsRequest.new + # + # # Call the import_assets method. + # result = client.import_assets 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 import_assets request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::ImportAssetsRequest + + # Converts hash 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_assets.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::VisionAI::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_assets.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.import_assets.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @warehouse_stub.import_assets 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 search configuration inside a corpus. + # + # Please follow the rules below to create a valid CreateSearchConfigRequest. + # --- General Rules --- + # 1. Request.search_config_id must not be associated with an existing + # SearchConfig. + # 2. Request must contain at least one non-empty search_criteria_property or + # facet_property. + # 3. mapped_fields must not be empty, and must map to existing UGA keys. + # 4. All mapped_fields must be of the same type. + # 5. All mapped_fields must share the same granularity. + # 6. All mapped_fields must share the same semantic SearchConfig match + # options. + # For property-specific rules, please reference the comments for + # FacetProperty and SearchCriteriaProperty. + # + # @overload create_search_config(request, options = nil) + # Pass arguments to `create_search_config` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::CreateSearchConfigRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::CreateSearchConfigRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_search_config(parent: nil, search_config: nil, search_config_id: nil) + # Pass arguments to `create_search_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. The parent resource where this search configuration will be + # created. Format: + # `projects/{project_number}/locations/{location_id}/corpora/{corpus_id}` + # @param search_config [::Google::Cloud::VisionAI::V1::SearchConfig, ::Hash] + # Required. The search config to create. + # @param search_config_id [::String] + # Required. ID to use for the new search config. Will become the final + # component of the SearchConfig's resource name. This value should be up to + # 63 characters, and valid characters are /[a-z][0-9]-_/. The first character + # must be a letter, the last could be a letter or a number. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::VisionAI::V1::SearchConfig] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::VisionAI::V1::SearchConfig] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::CreateSearchConfigRequest.new + # + # # Call the create_search_config method. + # result = client.create_search_config request + # + # # The returned object is of type Google::Cloud::VisionAI::V1::SearchConfig. + # p result + # + def create_search_config request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::CreateSearchConfigRequest + + # Converts hash 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_search_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::VisionAI::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_search_config.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_search_config.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @warehouse_stub.create_search_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 a search configuration inside a corpus. + # + # Please follow the rules below to create a valid UpdateSearchConfigRequest. + # --- General Rules --- + # 1. Request.search_configuration.name must already exist. + # 2. Request must contain at least one non-empty search_criteria_property or + # facet_property. + # 3. mapped_fields must not be empty, and must map to existing UGA keys. + # 4. All mapped_fields must be of the same type. + # 5. All mapped_fields must share the same granularity. + # 6. All mapped_fields must share the same semantic SearchConfig match + # options. + # For property-specific rules, please reference the comments for + # FacetProperty and SearchCriteriaProperty. + # + # @overload update_search_config(request, options = nil) + # Pass arguments to `update_search_config` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::UpdateSearchConfigRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::UpdateSearchConfigRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_search_config(search_config: nil, update_mask: nil) + # Pass arguments to `update_search_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 search_config [::Google::Cloud::VisionAI::V1::SearchConfig, ::Hash] + # Required. The search configuration to update. + # + # The search configuration's `name` field is used to identify the resource to + # be updated. Format: + # `projects/{project_number}/locations/{location}/corpora/{corpus}/searchConfigs/{search_config}` + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # The list of fields to be updated. If left unset, all field paths will be + # updated/overwritten. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::VisionAI::V1::SearchConfig] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::VisionAI::V1::SearchConfig] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::UpdateSearchConfigRequest.new + # + # # Call the update_search_config method. + # result = client.update_search_config request + # + # # The returned object is of type Google::Cloud::VisionAI::V1::SearchConfig. + # p result + # + def update_search_config request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::UpdateSearchConfigRequest + + # Converts hash 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_search_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::VisionAI::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_search_config.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_search_config.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @warehouse_stub.update_search_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 + + ## + # Gets a search configuration inside a corpus. + # + # @overload get_search_config(request, options = nil) + # Pass arguments to `get_search_config` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::GetSearchConfigRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::GetSearchConfigRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_search_config(name: nil) + # Pass arguments to `get_search_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 name of the search configuration to retrieve. + # Format: + # `projects/{project_number}/locations/{location}/corpora/{corpus}/searchConfigs/{search_config}` + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::VisionAI::V1::SearchConfig] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::VisionAI::V1::SearchConfig] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::GetSearchConfigRequest.new + # + # # Call the get_search_config method. + # result = client.get_search_config request + # + # # The returned object is of type Google::Cloud::VisionAI::V1::SearchConfig. + # p result + # + def get_search_config request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::GetSearchConfigRequest + + # Converts hash 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_search_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::VisionAI::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_search_config.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_search_config.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @warehouse_stub.get_search_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 + + ## + # Deletes a search configuration inside a corpus. + # + # For a DeleteSearchConfigRequest to be valid, + # Request.search_configuration.name must already exist. + # + # @overload delete_search_config(request, options = nil) + # Pass arguments to `delete_search_config` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::DeleteSearchConfigRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::DeleteSearchConfigRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_search_config(name: nil) + # Pass arguments to `delete_search_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 name of the search configuration to delete. + # Format: + # `projects/{project_number}/locations/{location}/corpora/{corpus}/searchConfigs/{search_config}` + # @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/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::DeleteSearchConfigRequest.new + # + # # Call the delete_search_config method. + # result = client.delete_search_config request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_search_config request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::DeleteSearchConfigRequest + + # Converts hash 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_search_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::VisionAI::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_search_config.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_search_config.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @warehouse_stub.delete_search_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 + + ## + # Lists all search configurations inside a corpus. + # + # @overload list_search_configs(request, options = nil) + # Pass arguments to `list_search_configs` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::ListSearchConfigsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::ListSearchConfigsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_search_configs(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_search_configs` via keyword arguments. Note that at + # least one keyword argument is 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 parent, which owns this collection of search configurations. + # Format: + # `projects/{project_number}/locations/{location}/corpora/{corpus}` + # @param page_size [::Integer] + # The maximum number of search configurations to return. The service may + # return fewer than this value. If unspecified, a page size of 50 will be + # used. The maximum value is 1000; values above 1000 will be coerced to 1000. + # @param page_token [::String] + # A page token, received from a previous `ListSearchConfigs` call. + # Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to + # `ListSearchConfigs` must match the call that provided the page + # token. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::VisionAI::V1::SearchConfig>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::VisionAI::V1::SearchConfig>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::ListSearchConfigsRequest.new + # + # # Call the list_search_configs method. + # result = client.list_search_configs 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::VisionAI::V1::SearchConfig. + # p item + # end + # + def list_search_configs request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::ListSearchConfigsRequest + + # Converts hash 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_search_configs.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::VisionAI::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_search_configs.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_search_configs.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @warehouse_stub.list_search_configs request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @warehouse_stub, :list_search_configs, "search_configs", 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 + + ## + # Creates a SearchHypernym inside a corpus. + # + # @overload create_search_hypernym(request, options = nil) + # Pass arguments to `create_search_hypernym` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::CreateSearchHypernymRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::CreateSearchHypernymRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_search_hypernym(parent: nil, search_hypernym: nil, search_hypernym_id: nil) + # Pass arguments to `create_search_hypernym` via keyword arguments. Note that at + # least one keyword argument is 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 parent resource where this SearchHypernym will be created. + # Format: `projects/{project_number}/locations/{location}/corpora/{corpus}` + # @param search_hypernym [::Google::Cloud::VisionAI::V1::SearchHypernym, ::Hash] + # Required. The SearchHypernym to create. + # @param search_hypernym_id [::String] + # Optional. The search hypernym id. + # If omitted, a random UUID will be generated. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::VisionAI::V1::SearchHypernym] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::VisionAI::V1::SearchHypernym] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::CreateSearchHypernymRequest.new + # + # # Call the create_search_hypernym method. + # result = client.create_search_hypernym request + # + # # The returned object is of type Google::Cloud::VisionAI::V1::SearchHypernym. + # p result + # + def create_search_hypernym request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::CreateSearchHypernymRequest + + # Converts hash 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_search_hypernym.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::VisionAI::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_search_hypernym.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_search_hypernym.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @warehouse_stub.create_search_hypernym 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 a SearchHypernym inside a corpus. + # + # @overload update_search_hypernym(request, options = nil) + # Pass arguments to `update_search_hypernym` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::UpdateSearchHypernymRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::UpdateSearchHypernymRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_search_hypernym(search_hypernym: nil, update_mask: nil) + # Pass arguments to `update_search_hypernym` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param search_hypernym [::Google::Cloud::VisionAI::V1::SearchHypernym, ::Hash] + # Required. The SearchHypernym to update. + # The search hypernym's `name` field is used to identify the search hypernym + # to be updated. Format: + # `projects/{project_number}/locations/{location}/corpora/{corpus}/searchHypernyms/{search_hypernym}` + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # The list of fields to be updated. If left unset, all field paths will be + # updated/overwritten. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::VisionAI::V1::SearchHypernym] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::VisionAI::V1::SearchHypernym] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::UpdateSearchHypernymRequest.new + # + # # Call the update_search_hypernym method. + # result = client.update_search_hypernym request + # + # # The returned object is of type Google::Cloud::VisionAI::V1::SearchHypernym. + # p result + # + def update_search_hypernym request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::UpdateSearchHypernymRequest + + # Converts hash 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_search_hypernym.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::VisionAI::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_search_hypernym.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_search_hypernym.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @warehouse_stub.update_search_hypernym 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 + + ## + # Gets a SearchHypernym inside a corpus. + # + # @overload get_search_hypernym(request, options = nil) + # Pass arguments to `get_search_hypernym` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::GetSearchHypernymRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::GetSearchHypernymRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_search_hypernym(name: nil) + # Pass arguments to `get_search_hypernym` via keyword arguments. Note that at + # least one keyword argument is 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 name of the SearchHypernym to retrieve. + # Format: + # `projects/{project_number}/locations/{location}/corpora/{corpus}/searchHypernyms/{search_hypernym}` + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::VisionAI::V1::SearchHypernym] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::VisionAI::V1::SearchHypernym] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::GetSearchHypernymRequest.new + # + # # Call the get_search_hypernym method. + # result = client.get_search_hypernym request + # + # # The returned object is of type Google::Cloud::VisionAI::V1::SearchHypernym. + # p result + # + def get_search_hypernym request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::GetSearchHypernymRequest + + # Converts hash 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_search_hypernym.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::VisionAI::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_search_hypernym.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_search_hypernym.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @warehouse_stub.get_search_hypernym 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 + + ## + # Deletes a SearchHypernym inside a corpus. + # + # @overload delete_search_hypernym(request, options = nil) + # Pass arguments to `delete_search_hypernym` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::DeleteSearchHypernymRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::DeleteSearchHypernymRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_search_hypernym(name: nil) + # Pass arguments to `delete_search_hypernym` via keyword arguments. Note that at + # least one keyword argument is 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 name of the SearchHypernym to delete. + # Format: + # `projects/{project_number}/locations/{location}/corpora/{corpus}/searchHypernyms/{search_hypernym}` + # @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/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::DeleteSearchHypernymRequest.new + # + # # Call the delete_search_hypernym method. + # result = client.delete_search_hypernym request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_search_hypernym request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::DeleteSearchHypernymRequest + + # Converts hash 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_search_hypernym.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::VisionAI::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_search_hypernym.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_search_hypernym.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @warehouse_stub.delete_search_hypernym 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 SearchHypernyms inside a corpus. + # + # @overload list_search_hypernyms(request, options = nil) + # Pass arguments to `list_search_hypernyms` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::ListSearchHypernymsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::ListSearchHypernymsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_search_hypernyms(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_search_hypernyms` via keyword arguments. Note that at + # least one keyword argument is 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 parent, which owns this collection of SearchHypernyms. + # Format: + # `projects/{project_number}/locations/{location}/corpora/{corpus}` + # @param page_size [::Integer] + # The maximum number of SearchHypernyms returned. The service may + # return fewer than this value. If unspecified, a page size of 50 will be + # used. The maximum value is 1000; values above 1000 will be coerced to 1000. + # @param page_token [::String] + # A page token, received from a previous `SearchHypernym` call. + # Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to + # `SearchHypernym` must match the call that provided the page + # token. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::VisionAI::V1::SearchHypernym>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::VisionAI::V1::SearchHypernym>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::ListSearchHypernymsRequest.new + # + # # Call the list_search_hypernyms method. + # result = client.list_search_hypernyms 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::VisionAI::V1::SearchHypernym. + # p item + # end + # + def list_search_hypernyms request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::ListSearchHypernymsRequest + + # Converts hash 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_search_hypernyms.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::VisionAI::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_search_hypernyms.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_search_hypernyms.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @warehouse_stub.list_search_hypernyms request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @warehouse_stub, :list_search_hypernyms, "search_hypernyms", 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 + + ## + # Search media asset. + # + # @overload search_assets(request, options = nil) + # Pass arguments to `search_assets` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::SearchAssetsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::SearchAssetsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload search_assets(schema_key_sorting_strategy: nil, corpus: nil, page_size: nil, page_token: nil, content_time_ranges: nil, criteria: nil, facet_selections: nil, result_annotation_keys: nil, search_query: nil) + # Pass arguments to `search_assets` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param schema_key_sorting_strategy [::Google::Cloud::VisionAI::V1::SchemaKeySortingStrategy, ::Hash] + # Sort by the value under the data schema key. + # @param corpus [::String] + # Required. The parent corpus to search. + # Format: `projects/{project_id}/locations/{location_id}/corpora/{corpus_id}' + # @param page_size [::Integer] + # The number of results to be returned in this page. If it's 0, the server + # will decide the appropriate page_size. + # @param page_token [::String] + # The continuation token to fetch the next page. If empty, it means it is + # fetching the first page. + # @param content_time_ranges [::Google::Cloud::VisionAI::V1::DateTimeRangeArray, ::Hash] + # Time ranges that matching video content must fall within. If no ranges are + # provided, there will be no time restriction. This field is treated just + # like the criteria below, but defined separately for convenience as it is + # used frequently. Note that if the end_time is in the future, it will be + # clamped to the time the request was received. + # @param criteria [::Array<::Google::Cloud::VisionAI::V1::Criteria, ::Hash>] + # Criteria applied to search results. + # @param facet_selections [::Array<::Google::Cloud::VisionAI::V1::FacetGroup, ::Hash>] + # Stores most recent facet selection state. Only facet groups with user's + # selection will be presented here. Selection state is either selected or + # unselected. Only selected facet buckets will be used as search criteria. + # @param result_annotation_keys [::Array<::String>] + # A list of annotation keys to specify the annotations to be retrieved and + # returned with each search result. + # Annotation granularity must be GRANULARITY_ASSET_LEVEL and its search + # strategy must not be NO_SEARCH. + # @param search_query [::String] + # Global search query. Allows user to search assets without needing to + # specify which field the value belongs to. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::VisionAI::V1::SearchResultItem>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::VisionAI::V1::SearchResultItem>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::SearchAssetsRequest.new + # + # # Call the search_assets method. + # result = client.search_assets 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::VisionAI::V1::SearchResultItem. + # p item + # end + # + def search_assets request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::SearchAssetsRequest + + # Converts hash 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.search_assets.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::VisionAI::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.search_assets.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.search_assets.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @warehouse_stub.search_assets request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @warehouse_stub, :search_assets, "search_result_items", 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 + + ## + # Search a deployed index endpoint (IMAGE corpus type only). + # + # @overload search_index_endpoint(request, options = nil) + # Pass arguments to `search_index_endpoint` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::SearchIndexEndpointRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::SearchIndexEndpointRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload search_index_endpoint(image_query: nil, text_query: nil, index_endpoint: nil, criteria: nil, exclusion_criteria: nil, page_size: nil, page_token: nil) + # Pass arguments to `search_index_endpoint` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param image_query [::Google::Cloud::VisionAI::V1::ImageQuery, ::Hash] + # An image-only query. + # + # Note: The following parameters are mutually exclusive: `image_query`, `text_query`. 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 text_query [::String] + # A text-only query. + # + # Note: The following parameters are mutually exclusive: `text_query`, `image_query`. 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 index_endpoint [::String] + # Required. The index endpoint to search. + # Format: + # `projects/{project_id}/locations/{location_id}/indexEndpoints/{index_endpoint_id}' + # @param criteria [::Array<::Google::Cloud::VisionAI::V1::Criteria, ::Hash>] + # Criteria applied to search results. + # @param exclusion_criteria [::Array<::Google::Cloud::VisionAI::V1::Criteria, ::Hash>] + # Criteria to exclude from search results. + # Note that `fetch_matched_annotations` will be ignored. + # @param page_size [::Integer] + # Requested page size. API may return fewer results than requested. + # If negative, INVALID_ARGUMENT error will be returned. + # If unspecified or 0, API will pick a default size, which is 10. + # If the requested page size is larger than the maximum size, API will pick + # the maximum size, which is 200. + # @param page_token [::String] + # The continuation token to fetch the next page. If empty, it means it is + # fetching the first page. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::VisionAI::V1::SearchResultItem>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::VisionAI::V1::SearchResultItem>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::SearchIndexEndpointRequest.new + # + # # Call the search_index_endpoint method. + # result = client.search_index_endpoint 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::VisionAI::V1::SearchResultItem. + # p item + # end + # + def search_index_endpoint request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::SearchIndexEndpointRequest + + # Converts hash 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.search_index_endpoint.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::VisionAI::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.search_index_endpoint.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.search_index_endpoint.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @warehouse_stub.search_index_endpoint request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @warehouse_stub, :search_index_endpoint, "search_result_items", 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 + + ## + # Creates an IndexEndpoint. + # + # @overload create_index_endpoint(request, options = nil) + # Pass arguments to `create_index_endpoint` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::CreateIndexEndpointRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::CreateIndexEndpointRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_index_endpoint(parent: nil, index_endpoint_id: nil, index_endpoint: nil) + # Pass arguments to `create_index_endpoint` via keyword arguments. Note that at + # least one keyword argument is 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. Format: `projects/{project}/locations/{location}` + # @param index_endpoint_id [::String] + # Optional. The ID to use for the IndexEndpoint, which will become the final + # component of the IndexEndpoint's resource name if the user specifies it. + # Otherwise, IndexEndpoint id will be autogenerated. + # + # This value should be up to 63 characters, and valid characters + # are a-z, 0-9 and dash (-). The first character must be a letter, the last + # must be a letter or a number. + # @param index_endpoint [::Google::Cloud::VisionAI::V1::IndexEndpoint, ::Hash] + # Required. The resource being created. + # @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/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::CreateIndexEndpointRequest.new + # + # # Call the create_index_endpoint method. + # result = client.create_index_endpoint 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_index_endpoint request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::CreateIndexEndpointRequest + + # Converts hash 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_index_endpoint.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::VisionAI::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_index_endpoint.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_index_endpoint.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @warehouse_stub.create_index_endpoint 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 + + ## + # Gets an IndexEndpoint. + # + # @overload get_index_endpoint(request, options = nil) + # Pass arguments to `get_index_endpoint` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::GetIndexEndpointRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::GetIndexEndpointRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_index_endpoint(name: nil) + # Pass arguments to `get_index_endpoint` via keyword arguments. Note that at + # least one keyword argument is 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 IndexEndpoint resource. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::VisionAI::V1::IndexEndpoint] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::VisionAI::V1::IndexEndpoint] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::GetIndexEndpointRequest.new + # + # # Call the get_index_endpoint method. + # result = client.get_index_endpoint request + # + # # The returned object is of type Google::Cloud::VisionAI::V1::IndexEndpoint. + # p result + # + def get_index_endpoint request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::GetIndexEndpointRequest + + # Converts hash 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_index_endpoint.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::VisionAI::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_index_endpoint.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_index_endpoint.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @warehouse_stub.get_index_endpoint 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 all IndexEndpoints in a project. + # + # @overload list_index_endpoints(request, options = nil) + # Pass arguments to `list_index_endpoints` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::ListIndexEndpointsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::ListIndexEndpointsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_index_endpoints(parent: nil, page_size: nil, page_token: nil, filter: nil) + # Pass arguments to `list_index_endpoints` via keyword arguments. Note that at + # least one keyword argument is 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. Format: `projects/{project}/locations/{location}` + # @param page_size [::Integer] + # Optional. Requested page size. Server may return fewer items than + # requested. The service may return fewer than this value. If unspecified, a + # page size of 50 will be used. The maximum value is 1000; values above 1000 + # will be coerced to 1000. + # @param page_token [::String] + # Optional. A token identifying a page of results the server should return. + # @param filter [::String] + # Optional. The filter applied to the returned list. + # We only support filtering for the `deployed_image_index.image_index` field. + # However, to filter by a corpus instead of an image index, simply use + # `deployed_image_index.corpus`, which will return all endpoints with + # `deployed_image_index.image_index` inside of the given corpus. + # A basic filter on image index would look like: + # deployed_image_index.image_index = + # "projects/123/locations/us-central1/corpora/my_corpus/imageIndexes/my_image_index" + # A basic filter on corpus would look like: + # deployed_image_index.corpus = + # "projects/123/locations/us-central1/corpora/my_corpus" + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::VisionAI::V1::IndexEndpoint>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::VisionAI::V1::IndexEndpoint>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::ListIndexEndpointsRequest.new + # + # # Call the list_index_endpoints method. + # result = client.list_index_endpoints 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::VisionAI::V1::IndexEndpoint. + # p item + # end + # + def list_index_endpoints request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::ListIndexEndpointsRequest + + # Converts hash 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_index_endpoints.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::VisionAI::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_index_endpoints.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_index_endpoints.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @warehouse_stub.list_index_endpoints request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @warehouse_stub, :list_index_endpoints, "index_endpoints", 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 + + ## + # Updates an IndexEndpoint. + # + # @overload update_index_endpoint(request, options = nil) + # Pass arguments to `update_index_endpoint` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::UpdateIndexEndpointRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::UpdateIndexEndpointRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_index_endpoint(index_endpoint: nil, update_mask: nil) + # Pass arguments to `update_index_endpoint` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param index_endpoint [::Google::Cloud::VisionAI::V1::IndexEndpoint, ::Hash] + # Required. The resource being updated. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. Field mask is used to specify the fields to be overwritten in the + # IndexEndpoint resource by the update. + # The fields specified in the update_mask are relative to the resource, not + # the full request. + # A field of the resource will be overwritten if it is in the mask. + # Empty field mask is not allowed. + # If the mask is "*", then this is a full replacement of the 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/cloud/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::UpdateIndexEndpointRequest.new + # + # # Call the update_index_endpoint method. + # result = client.update_index_endpoint 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 update_index_endpoint request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::UpdateIndexEndpointRequest + + # Converts hash 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_index_endpoint.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::VisionAI::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_index_endpoint.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_index_endpoint.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @warehouse_stub.update_index_endpoint 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 an IndexEndpoint. + # + # @overload delete_index_endpoint(request, options = nil) + # Pass arguments to `delete_index_endpoint` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::DeleteIndexEndpointRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::DeleteIndexEndpointRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_index_endpoint(name: nil) + # Pass arguments to `delete_index_endpoint` via keyword arguments. Note that at + # least one keyword argument is 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 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/cloud/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::DeleteIndexEndpointRequest.new + # + # # Call the delete_index_endpoint method. + # result = client.delete_index_endpoint 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_index_endpoint request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::DeleteIndexEndpointRequest + + # Converts hash 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_index_endpoint.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::VisionAI::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_index_endpoint.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_index_endpoint.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @warehouse_stub.delete_index_endpoint 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 + + ## + # Deploys an Index to IndexEndpoint. + # + # @overload deploy_index(request, options = nil) + # Pass arguments to `deploy_index` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::DeployIndexRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::DeployIndexRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload deploy_index(index_endpoint: nil, deployed_index: nil) + # Pass arguments to `deploy_index` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param index_endpoint [::String] + # Required. IndexEndpoint the index is deployed to. + # Format: + # `projects/{project}/locations/{location}/indexEndpoints/{index_endpoint}` + # @param deployed_index [::Google::Cloud::VisionAI::V1::DeployedIndex, ::Hash] + # Required. Index to deploy. + # @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/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::DeployIndexRequest.new + # + # # Call the deploy_index method. + # result = client.deploy_index 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 deploy_index request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::DeployIndexRequest + + # Converts hash 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.deploy_index.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::VisionAI::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.deploy_index.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.deploy_index.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @warehouse_stub.deploy_index 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 + + ## + # Undeploys an Index from IndexEndpoint. + # + # @overload undeploy_index(request, options = nil) + # Pass arguments to `undeploy_index` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::UndeployIndexRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::UndeployIndexRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload undeploy_index(index_endpoint: nil) + # Pass arguments to `undeploy_index` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param index_endpoint [::String] + # Required. Resource name of the IndexEndpoint resource on which the + # undeployment will act. Format: + # `projects/{project}/locations/{location}/indexEndpoints/{index_endpoint}` + # @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/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::UndeployIndexRequest.new + # + # # Call the undeploy_index method. + # result = client.undeploy_index 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 undeploy_index request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::UndeployIndexRequest + + # Converts hash 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.undeploy_index.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::VisionAI::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.undeploy_index.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.undeploy_index.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @warehouse_stub.undeploy_index 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 collection. + # + # @overload create_collection(request, options = nil) + # Pass arguments to `create_collection` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::CreateCollectionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::CreateCollectionRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_collection(parent: nil, collection: nil, collection_id: nil) + # Pass arguments to `create_collection` via keyword arguments. Note that at + # least one keyword argument is 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 parent resource where this collection will be created. + # Format: `projects/{project_number}/locations/{location}/corpora/{corpus}` + # @param collection [::Google::Cloud::VisionAI::V1::Collection, ::Hash] + # Required. The collection resource to be created. + # @param collection_id [::String] + # Optional. The ID to use for the collection, which will become the final + # component of the resource name if user choose to specify. Otherwise, + # collection id will be generated by system. + # + # This value should be up to 55 characters, and valid characters + # are /[a-z][0-9]-/. The first character must be a letter, the last could be + # a letter or a number. + # @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/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::CreateCollectionRequest.new + # + # # Call the create_collection method. + # result = client.create_collection 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_collection request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::CreateCollectionRequest + + # Converts hash 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_collection.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::VisionAI::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_collection.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_collection.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @warehouse_stub.create_collection 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 collection. + # + # @overload delete_collection(request, options = nil) + # Pass arguments to `delete_collection` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::DeleteCollectionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::DeleteCollectionRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_collection(name: nil) + # Pass arguments to `delete_collection` via keyword arguments. Note that at + # least one keyword argument is 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 name of the collection to delete. Format: + # `projects/{project_number}/locations/{location}/corpora/{corpus}/collections/{collection}` + # @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/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::DeleteCollectionRequest.new + # + # # Call the delete_collection method. + # result = client.delete_collection 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_collection request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::DeleteCollectionRequest + + # Converts hash 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_collection.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::VisionAI::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_collection.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_collection.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @warehouse_stub.delete_collection 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 + + ## + # Gets a collection. + # + # @overload get_collection(request, options = nil) + # Pass arguments to `get_collection` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::GetCollectionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::GetCollectionRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_collection(name: nil) + # Pass arguments to `get_collection` via keyword arguments. Note that at + # least one keyword argument is 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 name of the collection to retrieve. Format: + # `projects/{project_number}/locations/{location}/corpora/{corpus}/collections/{collection}` + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::VisionAI::V1::Collection] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::VisionAI::V1::Collection] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::GetCollectionRequest.new + # + # # Call the get_collection method. + # result = client.get_collection request + # + # # The returned object is of type Google::Cloud::VisionAI::V1::Collection. + # p result + # + def get_collection request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::GetCollectionRequest + + # Converts hash 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_collection.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::VisionAI::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_collection.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_collection.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @warehouse_stub.get_collection 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 a collection. + # + # @overload update_collection(request, options = nil) + # Pass arguments to `update_collection` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::UpdateCollectionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::UpdateCollectionRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_collection(collection: nil, update_mask: nil) + # Pass arguments to `update_collection` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param collection [::Google::Cloud::VisionAI::V1::Collection, ::Hash] + # Required. The collection to update. + # + # The collection's `name` field is used to identify the collection to be + # updated. Format: + # `projects/{project_number}/locations/{location}/corpora/{corpus}/collections/{collection}` + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # The list of fields to be updated. + # - Unset `update_mask` or set `update_mask` to be a single "*" only will + # update all updatable fields with the value provided in `collection`. + # - To update `display_name` value to empty string, set it in the + # `collection` + # to empty string, and set `update_mask` with "display_name". Same applies + # to other updatable string fields in the `collection`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::VisionAI::V1::Collection] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::VisionAI::V1::Collection] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::UpdateCollectionRequest.new + # + # # Call the update_collection method. + # result = client.update_collection request + # + # # The returned object is of type Google::Cloud::VisionAI::V1::Collection. + # p result + # + def update_collection request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::UpdateCollectionRequest + + # Converts hash 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_collection.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::VisionAI::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_collection.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_collection.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @warehouse_stub.update_collection 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 collections inside a corpus. + # + # @overload list_collections(request, options = nil) + # Pass arguments to `list_collections` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::ListCollectionsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::ListCollectionsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_collections(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_collections` via keyword arguments. Note that at + # least one keyword argument is 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 parent corpus. Format: + # `projects/{project_number}/locations/{location}/corpora/{corpus}` + # @param page_size [::Integer] + # The maximum number of collections to return. The service may return fewer + # than this value. If unspecified, at most 50 collections will be returned. + # The maximum value is 1000; values above 1000 will be coerced to 1000. + # @param page_token [::String] + # A page token, received from a previous `ListCollectionsRequest` call. + # Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to `ListCollectionsRequest` + # must match the call that provided the page token. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::VisionAI::V1::Collection>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::VisionAI::V1::Collection>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::ListCollectionsRequest.new + # + # # Call the list_collections method. + # result = client.list_collections 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::VisionAI::V1::Collection. + # p item + # end + # + def list_collections request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::ListCollectionsRequest + + # Converts hash 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_collections.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::VisionAI::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_collections.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_collections.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @warehouse_stub.list_collections request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @warehouse_stub, :list_collections, "collections", 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 + + ## + # Adds an item into a Collection. + # + # @overload add_collection_item(request, options = nil) + # Pass arguments to `add_collection_item` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::AddCollectionItemRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::AddCollectionItemRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload add_collection_item(item: nil) + # Pass arguments to `add_collection_item` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param item [::Google::Cloud::VisionAI::V1::CollectionItem, ::Hash] + # Required. The item to be added. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::VisionAI::V1::AddCollectionItemResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::VisionAI::V1::AddCollectionItemResponse] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::AddCollectionItemRequest.new + # + # # Call the add_collection_item method. + # result = client.add_collection_item request + # + # # The returned object is of type Google::Cloud::VisionAI::V1::AddCollectionItemResponse. + # p result + # + def add_collection_item request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::AddCollectionItemRequest + + # Converts hash 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.add_collection_item.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::VisionAI::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.add_collection_item.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.add_collection_item.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @warehouse_stub.add_collection_item 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 + + ## + # Removes an item from a collection. + # + # @overload remove_collection_item(request, options = nil) + # Pass arguments to `remove_collection_item` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::RemoveCollectionItemRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::RemoveCollectionItemRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload remove_collection_item(item: nil) + # Pass arguments to `remove_collection_item` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param item [::Google::Cloud::VisionAI::V1::CollectionItem, ::Hash] + # Required. The item to be removed. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::VisionAI::V1::RemoveCollectionItemResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::VisionAI::V1::RemoveCollectionItemResponse] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::RemoveCollectionItemRequest.new + # + # # Call the remove_collection_item method. + # result = client.remove_collection_item request + # + # # The returned object is of type Google::Cloud::VisionAI::V1::RemoveCollectionItemResponse. + # p result + # + def remove_collection_item request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::RemoveCollectionItemRequest + + # Converts hash 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.remove_collection_item.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::VisionAI::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.remove_collection_item.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.remove_collection_item.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @warehouse_stub.remove_collection_item 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 + + ## + # View items inside a collection. + # + # @overload view_collection_items(request, options = nil) + # Pass arguments to `view_collection_items` via a request object, either of type + # {::Google::Cloud::VisionAI::V1::ViewCollectionItemsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VisionAI::V1::ViewCollectionItemsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload view_collection_items(collection: nil, page_size: nil, page_token: nil) + # Pass arguments to `view_collection_items` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param collection [::String] + # Required. The collection to view. Format: + # `projects/{project_number}/locations/{location}/corpora/{corpus}/collections/{collection}` + # @param page_size [::Integer] + # The maximum number of collections to return. The service may return fewer + # than this value. If unspecified, at most 50 collections will be returned. + # The maximum value is 1000; values above 1000 will be coerced to 1000. + # @param page_token [::String] + # A page token, received from a previous `ViewCollectionItemsRequest` call. + # Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to + # `ViewCollectionItemsRequest` must match the call that provided the page + # token. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::VisionAI::V1::CollectionItem>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::VisionAI::V1::CollectionItem>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/vision_ai/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VisionAI::V1::ViewCollectionItemsRequest.new + # + # # Call the view_collection_items method. + # result = client.view_collection_items 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::VisionAI::V1::CollectionItem. + # p item + # end + # + def view_collection_items request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::ViewCollectionItemsRequest + + # Converts hash 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.view_collection_items.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::VisionAI::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.view_collection_items.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.view_collection_items.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @warehouse_stub.view_collection_items request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @warehouse_stub, :view_collection_items, "items", 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 Warehouse REST API. + # + # This class represents the configuration for Warehouse 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::VisionAI::V1::Warehouse::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_asset to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.create_asset.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.create_asset.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 = "warehouse-visionai.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 Warehouse 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_asset` + # @return [::Gapic::Config::Method] + # + attr_reader :create_asset + ## + # RPC-specific configuration for `update_asset` + # @return [::Gapic::Config::Method] + # + attr_reader :update_asset + ## + # RPC-specific configuration for `get_asset` + # @return [::Gapic::Config::Method] + # + attr_reader :get_asset + ## + # RPC-specific configuration for `list_assets` + # @return [::Gapic::Config::Method] + # + attr_reader :list_assets + ## + # RPC-specific configuration for `delete_asset` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_asset + ## + # RPC-specific configuration for `upload_asset` + # @return [::Gapic::Config::Method] + # + attr_reader :upload_asset + ## + # RPC-specific configuration for `generate_retrieval_url` + # @return [::Gapic::Config::Method] + # + attr_reader :generate_retrieval_url + ## + # RPC-specific configuration for `analyze_asset` + # @return [::Gapic::Config::Method] + # + attr_reader :analyze_asset + ## + # RPC-specific configuration for `index_asset` + # @return [::Gapic::Config::Method] + # + attr_reader :index_asset + ## + # RPC-specific configuration for `remove_index_asset` + # @return [::Gapic::Config::Method] + # + attr_reader :remove_index_asset + ## + # RPC-specific configuration for `view_indexed_assets` + # @return [::Gapic::Config::Method] + # + attr_reader :view_indexed_assets + ## + # RPC-specific configuration for `create_index` + # @return [::Gapic::Config::Method] + # + attr_reader :create_index + ## + # RPC-specific configuration for `update_index` + # @return [::Gapic::Config::Method] + # + attr_reader :update_index + ## + # RPC-specific configuration for `get_index` + # @return [::Gapic::Config::Method] + # + attr_reader :get_index + ## + # RPC-specific configuration for `list_indexes` + # @return [::Gapic::Config::Method] + # + attr_reader :list_indexes + ## + # RPC-specific configuration for `delete_index` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_index + ## + # RPC-specific configuration for `create_corpus` + # @return [::Gapic::Config::Method] + # + attr_reader :create_corpus + ## + # RPC-specific configuration for `get_corpus` + # @return [::Gapic::Config::Method] + # + attr_reader :get_corpus + ## + # RPC-specific configuration for `update_corpus` + # @return [::Gapic::Config::Method] + # + attr_reader :update_corpus + ## + # RPC-specific configuration for `list_corpora` + # @return [::Gapic::Config::Method] + # + attr_reader :list_corpora + ## + # RPC-specific configuration for `delete_corpus` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_corpus + ## + # RPC-specific configuration for `analyze_corpus` + # @return [::Gapic::Config::Method] + # + attr_reader :analyze_corpus + ## + # RPC-specific configuration for `create_data_schema` + # @return [::Gapic::Config::Method] + # + attr_reader :create_data_schema + ## + # RPC-specific configuration for `update_data_schema` + # @return [::Gapic::Config::Method] + # + attr_reader :update_data_schema + ## + # RPC-specific configuration for `get_data_schema` + # @return [::Gapic::Config::Method] + # + attr_reader :get_data_schema + ## + # RPC-specific configuration for `delete_data_schema` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_data_schema + ## + # RPC-specific configuration for `list_data_schemas` + # @return [::Gapic::Config::Method] + # + attr_reader :list_data_schemas + ## + # RPC-specific configuration for `create_annotation` + # @return [::Gapic::Config::Method] + # + attr_reader :create_annotation + ## + # RPC-specific configuration for `get_annotation` + # @return [::Gapic::Config::Method] + # + attr_reader :get_annotation + ## + # RPC-specific configuration for `list_annotations` + # @return [::Gapic::Config::Method] + # + attr_reader :list_annotations + ## + # RPC-specific configuration for `update_annotation` + # @return [::Gapic::Config::Method] + # + attr_reader :update_annotation + ## + # RPC-specific configuration for `delete_annotation` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_annotation + ## + # RPC-specific configuration for `clip_asset` + # @return [::Gapic::Config::Method] + # + attr_reader :clip_asset + ## + # RPC-specific configuration for `generate_hls_uri` + # @return [::Gapic::Config::Method] + # + attr_reader :generate_hls_uri + ## + # RPC-specific configuration for `import_assets` + # @return [::Gapic::Config::Method] + # + attr_reader :import_assets + ## + # RPC-specific configuration for `create_search_config` + # @return [::Gapic::Config::Method] + # + attr_reader :create_search_config + ## + # RPC-specific configuration for `update_search_config` + # @return [::Gapic::Config::Method] + # + attr_reader :update_search_config + ## + # RPC-specific configuration for `get_search_config` + # @return [::Gapic::Config::Method] + # + attr_reader :get_search_config + ## + # RPC-specific configuration for `delete_search_config` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_search_config + ## + # RPC-specific configuration for `list_search_configs` + # @return [::Gapic::Config::Method] + # + attr_reader :list_search_configs + ## + # RPC-specific configuration for `create_search_hypernym` + # @return [::Gapic::Config::Method] + # + attr_reader :create_search_hypernym + ## + # RPC-specific configuration for `update_search_hypernym` + # @return [::Gapic::Config::Method] + # + attr_reader :update_search_hypernym + ## + # RPC-specific configuration for `get_search_hypernym` + # @return [::Gapic::Config::Method] + # + attr_reader :get_search_hypernym + ## + # RPC-specific configuration for `delete_search_hypernym` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_search_hypernym + ## + # RPC-specific configuration for `list_search_hypernyms` + # @return [::Gapic::Config::Method] + # + attr_reader :list_search_hypernyms + ## + # RPC-specific configuration for `search_assets` + # @return [::Gapic::Config::Method] + # + attr_reader :search_assets + ## + # RPC-specific configuration for `search_index_endpoint` + # @return [::Gapic::Config::Method] + # + attr_reader :search_index_endpoint + ## + # RPC-specific configuration for `create_index_endpoint` + # @return [::Gapic::Config::Method] + # + attr_reader :create_index_endpoint + ## + # RPC-specific configuration for `get_index_endpoint` + # @return [::Gapic::Config::Method] + # + attr_reader :get_index_endpoint + ## + # RPC-specific configuration for `list_index_endpoints` + # @return [::Gapic::Config::Method] + # + attr_reader :list_index_endpoints + ## + # RPC-specific configuration for `update_index_endpoint` + # @return [::Gapic::Config::Method] + # + attr_reader :update_index_endpoint + ## + # RPC-specific configuration for `delete_index_endpoint` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_index_endpoint + ## + # RPC-specific configuration for `deploy_index` + # @return [::Gapic::Config::Method] + # + attr_reader :deploy_index + ## + # RPC-specific configuration for `undeploy_index` + # @return [::Gapic::Config::Method] + # + attr_reader :undeploy_index + ## + # RPC-specific configuration for `create_collection` + # @return [::Gapic::Config::Method] + # + attr_reader :create_collection + ## + # RPC-specific configuration for `delete_collection` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_collection + ## + # RPC-specific configuration for `get_collection` + # @return [::Gapic::Config::Method] + # + attr_reader :get_collection + ## + # RPC-specific configuration for `update_collection` + # @return [::Gapic::Config::Method] + # + attr_reader :update_collection + ## + # RPC-specific configuration for `list_collections` + # @return [::Gapic::Config::Method] + # + attr_reader :list_collections + ## + # RPC-specific configuration for `add_collection_item` + # @return [::Gapic::Config::Method] + # + attr_reader :add_collection_item + ## + # RPC-specific configuration for `remove_collection_item` + # @return [::Gapic::Config::Method] + # + attr_reader :remove_collection_item + ## + # RPC-specific configuration for `view_collection_items` + # @return [::Gapic::Config::Method] + # + attr_reader :view_collection_items + + # @private + def initialize parent_rpcs = nil + create_asset_config = parent_rpcs.create_asset if parent_rpcs.respond_to? :create_asset + @create_asset = ::Gapic::Config::Method.new create_asset_config + update_asset_config = parent_rpcs.update_asset if parent_rpcs.respond_to? :update_asset + @update_asset = ::Gapic::Config::Method.new update_asset_config + get_asset_config = parent_rpcs.get_asset if parent_rpcs.respond_to? :get_asset + @get_asset = ::Gapic::Config::Method.new get_asset_config + list_assets_config = parent_rpcs.list_assets if parent_rpcs.respond_to? :list_assets + @list_assets = ::Gapic::Config::Method.new list_assets_config + delete_asset_config = parent_rpcs.delete_asset if parent_rpcs.respond_to? :delete_asset + @delete_asset = ::Gapic::Config::Method.new delete_asset_config + upload_asset_config = parent_rpcs.upload_asset if parent_rpcs.respond_to? :upload_asset + @upload_asset = ::Gapic::Config::Method.new upload_asset_config + generate_retrieval_url_config = parent_rpcs.generate_retrieval_url if parent_rpcs.respond_to? :generate_retrieval_url + @generate_retrieval_url = ::Gapic::Config::Method.new generate_retrieval_url_config + analyze_asset_config = parent_rpcs.analyze_asset if parent_rpcs.respond_to? :analyze_asset + @analyze_asset = ::Gapic::Config::Method.new analyze_asset_config + index_asset_config = parent_rpcs.index_asset if parent_rpcs.respond_to? :index_asset + @index_asset = ::Gapic::Config::Method.new index_asset_config + remove_index_asset_config = parent_rpcs.remove_index_asset if parent_rpcs.respond_to? :remove_index_asset + @remove_index_asset = ::Gapic::Config::Method.new remove_index_asset_config + view_indexed_assets_config = parent_rpcs.view_indexed_assets if parent_rpcs.respond_to? :view_indexed_assets + @view_indexed_assets = ::Gapic::Config::Method.new view_indexed_assets_config + create_index_config = parent_rpcs.create_index if parent_rpcs.respond_to? :create_index + @create_index = ::Gapic::Config::Method.new create_index_config + update_index_config = parent_rpcs.update_index if parent_rpcs.respond_to? :update_index + @update_index = ::Gapic::Config::Method.new update_index_config + get_index_config = parent_rpcs.get_index if parent_rpcs.respond_to? :get_index + @get_index = ::Gapic::Config::Method.new get_index_config + list_indexes_config = parent_rpcs.list_indexes if parent_rpcs.respond_to? :list_indexes + @list_indexes = ::Gapic::Config::Method.new list_indexes_config + delete_index_config = parent_rpcs.delete_index if parent_rpcs.respond_to? :delete_index + @delete_index = ::Gapic::Config::Method.new delete_index_config + create_corpus_config = parent_rpcs.create_corpus if parent_rpcs.respond_to? :create_corpus + @create_corpus = ::Gapic::Config::Method.new create_corpus_config + get_corpus_config = parent_rpcs.get_corpus if parent_rpcs.respond_to? :get_corpus + @get_corpus = ::Gapic::Config::Method.new get_corpus_config + update_corpus_config = parent_rpcs.update_corpus if parent_rpcs.respond_to? :update_corpus + @update_corpus = ::Gapic::Config::Method.new update_corpus_config + list_corpora_config = parent_rpcs.list_corpora if parent_rpcs.respond_to? :list_corpora + @list_corpora = ::Gapic::Config::Method.new list_corpora_config + delete_corpus_config = parent_rpcs.delete_corpus if parent_rpcs.respond_to? :delete_corpus + @delete_corpus = ::Gapic::Config::Method.new delete_corpus_config + analyze_corpus_config = parent_rpcs.analyze_corpus if parent_rpcs.respond_to? :analyze_corpus + @analyze_corpus = ::Gapic::Config::Method.new analyze_corpus_config + create_data_schema_config = parent_rpcs.create_data_schema if parent_rpcs.respond_to? :create_data_schema + @create_data_schema = ::Gapic::Config::Method.new create_data_schema_config + update_data_schema_config = parent_rpcs.update_data_schema if parent_rpcs.respond_to? :update_data_schema + @update_data_schema = ::Gapic::Config::Method.new update_data_schema_config + get_data_schema_config = parent_rpcs.get_data_schema if parent_rpcs.respond_to? :get_data_schema + @get_data_schema = ::Gapic::Config::Method.new get_data_schema_config + delete_data_schema_config = parent_rpcs.delete_data_schema if parent_rpcs.respond_to? :delete_data_schema + @delete_data_schema = ::Gapic::Config::Method.new delete_data_schema_config + list_data_schemas_config = parent_rpcs.list_data_schemas if parent_rpcs.respond_to? :list_data_schemas + @list_data_schemas = ::Gapic::Config::Method.new list_data_schemas_config + create_annotation_config = parent_rpcs.create_annotation if parent_rpcs.respond_to? :create_annotation + @create_annotation = ::Gapic::Config::Method.new create_annotation_config + get_annotation_config = parent_rpcs.get_annotation if parent_rpcs.respond_to? :get_annotation + @get_annotation = ::Gapic::Config::Method.new get_annotation_config + list_annotations_config = parent_rpcs.list_annotations if parent_rpcs.respond_to? :list_annotations + @list_annotations = ::Gapic::Config::Method.new list_annotations_config + update_annotation_config = parent_rpcs.update_annotation if parent_rpcs.respond_to? :update_annotation + @update_annotation = ::Gapic::Config::Method.new update_annotation_config + delete_annotation_config = parent_rpcs.delete_annotation if parent_rpcs.respond_to? :delete_annotation + @delete_annotation = ::Gapic::Config::Method.new delete_annotation_config + clip_asset_config = parent_rpcs.clip_asset if parent_rpcs.respond_to? :clip_asset + @clip_asset = ::Gapic::Config::Method.new clip_asset_config + generate_hls_uri_config = parent_rpcs.generate_hls_uri if parent_rpcs.respond_to? :generate_hls_uri + @generate_hls_uri = ::Gapic::Config::Method.new generate_hls_uri_config + import_assets_config = parent_rpcs.import_assets if parent_rpcs.respond_to? :import_assets + @import_assets = ::Gapic::Config::Method.new import_assets_config + create_search_config_config = parent_rpcs.create_search_config if parent_rpcs.respond_to? :create_search_config + @create_search_config = ::Gapic::Config::Method.new create_search_config_config + update_search_config_config = parent_rpcs.update_search_config if parent_rpcs.respond_to? :update_search_config + @update_search_config = ::Gapic::Config::Method.new update_search_config_config + get_search_config_config = parent_rpcs.get_search_config if parent_rpcs.respond_to? :get_search_config + @get_search_config = ::Gapic::Config::Method.new get_search_config_config + delete_search_config_config = parent_rpcs.delete_search_config if parent_rpcs.respond_to? :delete_search_config + @delete_search_config = ::Gapic::Config::Method.new delete_search_config_config + list_search_configs_config = parent_rpcs.list_search_configs if parent_rpcs.respond_to? :list_search_configs + @list_search_configs = ::Gapic::Config::Method.new list_search_configs_config + create_search_hypernym_config = parent_rpcs.create_search_hypernym if parent_rpcs.respond_to? :create_search_hypernym + @create_search_hypernym = ::Gapic::Config::Method.new create_search_hypernym_config + update_search_hypernym_config = parent_rpcs.update_search_hypernym if parent_rpcs.respond_to? :update_search_hypernym + @update_search_hypernym = ::Gapic::Config::Method.new update_search_hypernym_config + get_search_hypernym_config = parent_rpcs.get_search_hypernym if parent_rpcs.respond_to? :get_search_hypernym + @get_search_hypernym = ::Gapic::Config::Method.new get_search_hypernym_config + delete_search_hypernym_config = parent_rpcs.delete_search_hypernym if parent_rpcs.respond_to? :delete_search_hypernym + @delete_search_hypernym = ::Gapic::Config::Method.new delete_search_hypernym_config + list_search_hypernyms_config = parent_rpcs.list_search_hypernyms if parent_rpcs.respond_to? :list_search_hypernyms + @list_search_hypernyms = ::Gapic::Config::Method.new list_search_hypernyms_config + search_assets_config = parent_rpcs.search_assets if parent_rpcs.respond_to? :search_assets + @search_assets = ::Gapic::Config::Method.new search_assets_config + search_index_endpoint_config = parent_rpcs.search_index_endpoint if parent_rpcs.respond_to? :search_index_endpoint + @search_index_endpoint = ::Gapic::Config::Method.new search_index_endpoint_config + create_index_endpoint_config = parent_rpcs.create_index_endpoint if parent_rpcs.respond_to? :create_index_endpoint + @create_index_endpoint = ::Gapic::Config::Method.new create_index_endpoint_config + get_index_endpoint_config = parent_rpcs.get_index_endpoint if parent_rpcs.respond_to? :get_index_endpoint + @get_index_endpoint = ::Gapic::Config::Method.new get_index_endpoint_config + list_index_endpoints_config = parent_rpcs.list_index_endpoints if parent_rpcs.respond_to? :list_index_endpoints + @list_index_endpoints = ::Gapic::Config::Method.new list_index_endpoints_config + update_index_endpoint_config = parent_rpcs.update_index_endpoint if parent_rpcs.respond_to? :update_index_endpoint + @update_index_endpoint = ::Gapic::Config::Method.new update_index_endpoint_config + delete_index_endpoint_config = parent_rpcs.delete_index_endpoint if parent_rpcs.respond_to? :delete_index_endpoint + @delete_index_endpoint = ::Gapic::Config::Method.new delete_index_endpoint_config + deploy_index_config = parent_rpcs.deploy_index if parent_rpcs.respond_to? :deploy_index + @deploy_index = ::Gapic::Config::Method.new deploy_index_config + undeploy_index_config = parent_rpcs.undeploy_index if parent_rpcs.respond_to? :undeploy_index + @undeploy_index = ::Gapic::Config::Method.new undeploy_index_config + create_collection_config = parent_rpcs.create_collection if parent_rpcs.respond_to? :create_collection + @create_collection = ::Gapic::Config::Method.new create_collection_config + delete_collection_config = parent_rpcs.delete_collection if parent_rpcs.respond_to? :delete_collection + @delete_collection = ::Gapic::Config::Method.new delete_collection_config + get_collection_config = parent_rpcs.get_collection if parent_rpcs.respond_to? :get_collection + @get_collection = ::Gapic::Config::Method.new get_collection_config + update_collection_config = parent_rpcs.update_collection if parent_rpcs.respond_to? :update_collection + @update_collection = ::Gapic::Config::Method.new update_collection_config + list_collections_config = parent_rpcs.list_collections if parent_rpcs.respond_to? :list_collections + @list_collections = ::Gapic::Config::Method.new list_collections_config + add_collection_item_config = parent_rpcs.add_collection_item if parent_rpcs.respond_to? :add_collection_item + @add_collection_item = ::Gapic::Config::Method.new add_collection_item_config + remove_collection_item_config = parent_rpcs.remove_collection_item if parent_rpcs.respond_to? :remove_collection_item + @remove_collection_item = ::Gapic::Config::Method.new remove_collection_item_config + view_collection_items_config = parent_rpcs.view_collection_items if parent_rpcs.respond_to? :view_collection_items + @view_collection_items = ::Gapic::Config::Method.new view_collection_items_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/warehouse/rest/operations.rb b/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/warehouse/rest/operations.rb new file mode 100644 index 000000000000..3dfa6122bd2d --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/warehouse/rest/operations.rb @@ -0,0 +1,974 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 VisionAI + module V1 + module Warehouse + module Rest + # Service that implements Longrunning Operations API. + class Operations + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "warehouse-visionai.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :operations_stub + + ## + # Configuration for the Warehouse 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 Warehouse 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::VisionAI::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::VisionAI::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::VisionAI::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::VisionAI::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 = "warehouse-visionai.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}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/?$}, 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] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/warehouseOperations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/corpora/[^/]+/assets/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/corpora/[^/]+/collections/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/corpora/[^/]+/imageIndexes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/corpora/[^/]+/indexes/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/corpora/[^/]+/operations/[^/]+/?$}, false] + ] + ) + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/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{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + 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{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/warehouse/rest/service_stub.rb b/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/warehouse/rest/service_stub.rb new file mode 100644 index 000000000000..83933be98d94 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/warehouse/rest/service_stub.rb @@ -0,0 +1,3896 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/visionai/v1/warehouse_pb" + +module Google + module Cloud + module VisionAI + module V1 + module Warehouse + module Rest + ## + # REST service stub for the Warehouse 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_asset REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::CreateAssetRequest] + # 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::VisionAI::V1::Asset] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::VisionAI::V1::Asset] + # A result object deserialized from the server's reply + def create_asset request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_asset_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_asset", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::VisionAI::V1::Asset.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_asset REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::UpdateAssetRequest] + # 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::VisionAI::V1::Asset] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::VisionAI::V1::Asset] + # A result object deserialized from the server's reply + def update_asset request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_asset_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_asset", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::VisionAI::V1::Asset.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_asset REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::GetAssetRequest] + # 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::VisionAI::V1::Asset] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::VisionAI::V1::Asset] + # A result object deserialized from the server's reply + def get_asset request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_asset_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_asset", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::VisionAI::V1::Asset.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_assets REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::ListAssetsRequest] + # 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::VisionAI::V1::ListAssetsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::VisionAI::V1::ListAssetsResponse] + # A result object deserialized from the server's reply + def list_assets request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_assets_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_assets", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::VisionAI::V1::ListAssetsResponse.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_asset REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::DeleteAssetRequest] + # 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_asset request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_asset_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_asset", + 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 upload_asset REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::UploadAssetRequest] + # 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 upload_asset request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_upload_asset_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: "upload_asset", + 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 generate_retrieval_url REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::GenerateRetrievalUrlRequest] + # 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::VisionAI::V1::GenerateRetrievalUrlResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::VisionAI::V1::GenerateRetrievalUrlResponse] + # A result object deserialized from the server's reply + def generate_retrieval_url request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_generate_retrieval_url_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_retrieval_url", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::VisionAI::V1::GenerateRetrievalUrlResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the analyze_asset REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::AnalyzeAssetRequest] + # 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 analyze_asset request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_analyze_asset_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: "analyze_asset", + 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 index_asset REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::IndexAssetRequest] + # 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 index_asset request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_index_asset_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: "index_asset", + 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 remove_index_asset REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::RemoveIndexAssetRequest] + # 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 remove_index_asset request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_remove_index_asset_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: "remove_index_asset", + 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 view_indexed_assets REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::ViewIndexedAssetsRequest] + # 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::VisionAI::V1::ViewIndexedAssetsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::VisionAI::V1::ViewIndexedAssetsResponse] + # A result object deserialized from the server's reply + def view_indexed_assets request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_view_indexed_assets_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: "view_indexed_assets", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::VisionAI::V1::ViewIndexedAssetsResponse.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_index REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::CreateIndexRequest] + # 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_index request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_index_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_index", + 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 update_index REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::UpdateIndexRequest] + # 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 update_index request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_index_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_index", + 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_index REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::GetIndexRequest] + # 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::VisionAI::V1::Index] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::VisionAI::V1::Index] + # A result object deserialized from the server's reply + def get_index request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_index_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_index", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::VisionAI::V1::Index.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_indexes REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::ListIndexesRequest] + # 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::VisionAI::V1::ListIndexesResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::VisionAI::V1::ListIndexesResponse] + # A result object deserialized from the server's reply + def list_indexes request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_indexes_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_indexes", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::VisionAI::V1::ListIndexesResponse.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_index REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::DeleteIndexRequest] + # 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_index request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_index_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_index", + 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_corpus REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::CreateCorpusRequest] + # 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_corpus request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_corpus_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_corpus", + 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_corpus REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::GetCorpusRequest] + # 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::VisionAI::V1::Corpus] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::VisionAI::V1::Corpus] + # A result object deserialized from the server's reply + def get_corpus request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_corpus_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_corpus", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::VisionAI::V1::Corpus.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_corpus REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::UpdateCorpusRequest] + # 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::VisionAI::V1::Corpus] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::VisionAI::V1::Corpus] + # A result object deserialized from the server's reply + def update_corpus request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_corpus_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_corpus", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::VisionAI::V1::Corpus.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_corpora REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::ListCorporaRequest] + # 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::VisionAI::V1::ListCorporaResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::VisionAI::V1::ListCorporaResponse] + # A result object deserialized from the server's reply + def list_corpora request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_corpora_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_corpora", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::VisionAI::V1::ListCorporaResponse.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_corpus REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::DeleteCorpusRequest] + # 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_corpus request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_corpus_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_corpus", + 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 analyze_corpus REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::AnalyzeCorpusRequest] + # 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 analyze_corpus request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_analyze_corpus_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: "analyze_corpus", + 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_data_schema REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::CreateDataSchemaRequest] + # 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::VisionAI::V1::DataSchema] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::VisionAI::V1::DataSchema] + # A result object deserialized from the server's reply + def create_data_schema request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_data_schema_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_data_schema", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::VisionAI::V1::DataSchema.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_data_schema REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::UpdateDataSchemaRequest] + # 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::VisionAI::V1::DataSchema] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::VisionAI::V1::DataSchema] + # A result object deserialized from the server's reply + def update_data_schema request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_data_schema_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_data_schema", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::VisionAI::V1::DataSchema.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_data_schema REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::GetDataSchemaRequest] + # 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::VisionAI::V1::DataSchema] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::VisionAI::V1::DataSchema] + # A result object deserialized from the server's reply + def get_data_schema request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_data_schema_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_data_schema", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::VisionAI::V1::DataSchema.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_data_schema REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::DeleteDataSchemaRequest] + # 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_data_schema request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_data_schema_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_data_schema", + 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 list_data_schemas REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::ListDataSchemasRequest] + # 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::VisionAI::V1::ListDataSchemasResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::VisionAI::V1::ListDataSchemasResponse] + # A result object deserialized from the server's reply + def list_data_schemas request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_data_schemas_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_data_schemas", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::VisionAI::V1::ListDataSchemasResponse.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_annotation REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::CreateAnnotationRequest] + # 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::VisionAI::V1::Annotation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::VisionAI::V1::Annotation] + # A result object deserialized from the server's reply + def create_annotation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_annotation_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_annotation", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::VisionAI::V1::Annotation.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_annotation REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::GetAnnotationRequest] + # 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::VisionAI::V1::Annotation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::VisionAI::V1::Annotation] + # A result object deserialized from the server's reply + def get_annotation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_annotation_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_annotation", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::VisionAI::V1::Annotation.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_annotations REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::ListAnnotationsRequest] + # 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::VisionAI::V1::ListAnnotationsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::VisionAI::V1::ListAnnotationsResponse] + # A result object deserialized from the server's reply + def list_annotations request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_annotations_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_annotations", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::VisionAI::V1::ListAnnotationsResponse.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_annotation REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::UpdateAnnotationRequest] + # 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::VisionAI::V1::Annotation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::VisionAI::V1::Annotation] + # A result object deserialized from the server's reply + def update_annotation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_annotation_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_annotation", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::VisionAI::V1::Annotation.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_annotation REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::DeleteAnnotationRequest] + # 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_annotation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_annotation_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_annotation", + 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 clip_asset REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::ClipAssetRequest] + # 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::VisionAI::V1::ClipAssetResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::VisionAI::V1::ClipAssetResponse] + # A result object deserialized from the server's reply + def clip_asset request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_clip_asset_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: "clip_asset", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::VisionAI::V1::ClipAssetResponse.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_hls_uri REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::GenerateHlsUriRequest] + # 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::VisionAI::V1::GenerateHlsUriResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::VisionAI::V1::GenerateHlsUriResponse] + # A result object deserialized from the server's reply + def generate_hls_uri request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_generate_hls_uri_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_hls_uri", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::VisionAI::V1::GenerateHlsUriResponse.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_assets REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::ImportAssetsRequest] + # 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 import_assets request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_import_assets_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_assets", + 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_search_config REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::CreateSearchConfigRequest] + # 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::VisionAI::V1::SearchConfig] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::VisionAI::V1::SearchConfig] + # A result object deserialized from the server's reply + def create_search_config request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_search_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: "create_search_config", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::VisionAI::V1::SearchConfig.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_search_config REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::UpdateSearchConfigRequest] + # 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::VisionAI::V1::SearchConfig] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::VisionAI::V1::SearchConfig] + # A result object deserialized from the server's reply + def update_search_config request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_search_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_search_config", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::VisionAI::V1::SearchConfig.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_search_config REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::GetSearchConfigRequest] + # 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::VisionAI::V1::SearchConfig] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::VisionAI::V1::SearchConfig] + # A result object deserialized from the server's reply + def get_search_config request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_search_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_search_config", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::VisionAI::V1::SearchConfig.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_search_config REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::DeleteSearchConfigRequest] + # 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_search_config request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_search_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: "delete_search_config", + 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 list_search_configs REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::ListSearchConfigsRequest] + # 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::VisionAI::V1::ListSearchConfigsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::VisionAI::V1::ListSearchConfigsResponse] + # A result object deserialized from the server's reply + def list_search_configs request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_search_configs_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_search_configs", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::VisionAI::V1::ListSearchConfigsResponse.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_search_hypernym REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::CreateSearchHypernymRequest] + # 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::VisionAI::V1::SearchHypernym] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::VisionAI::V1::SearchHypernym] + # A result object deserialized from the server's reply + def create_search_hypernym request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_search_hypernym_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_search_hypernym", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::VisionAI::V1::SearchHypernym.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_search_hypernym REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::UpdateSearchHypernymRequest] + # 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::VisionAI::V1::SearchHypernym] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::VisionAI::V1::SearchHypernym] + # A result object deserialized from the server's reply + def update_search_hypernym request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_search_hypernym_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_search_hypernym", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::VisionAI::V1::SearchHypernym.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_search_hypernym REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::GetSearchHypernymRequest] + # 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::VisionAI::V1::SearchHypernym] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::VisionAI::V1::SearchHypernym] + # A result object deserialized from the server's reply + def get_search_hypernym request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_search_hypernym_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_search_hypernym", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::VisionAI::V1::SearchHypernym.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_search_hypernym REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::DeleteSearchHypernymRequest] + # 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_search_hypernym request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_search_hypernym_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_search_hypernym", + 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 list_search_hypernyms REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::ListSearchHypernymsRequest] + # 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::VisionAI::V1::ListSearchHypernymsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::VisionAI::V1::ListSearchHypernymsResponse] + # A result object deserialized from the server's reply + def list_search_hypernyms request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_search_hypernyms_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_search_hypernyms", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::VisionAI::V1::ListSearchHypernymsResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the search_assets REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::SearchAssetsRequest] + # 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::VisionAI::V1::SearchAssetsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::VisionAI::V1::SearchAssetsResponse] + # A result object deserialized from the server's reply + def search_assets request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_search_assets_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: "search_assets", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::VisionAI::V1::SearchAssetsResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the search_index_endpoint REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::SearchIndexEndpointRequest] + # 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::VisionAI::V1::SearchIndexEndpointResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::VisionAI::V1::SearchIndexEndpointResponse] + # A result object deserialized from the server's reply + def search_index_endpoint request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_search_index_endpoint_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: "search_index_endpoint", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::VisionAI::V1::SearchIndexEndpointResponse.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_index_endpoint REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::CreateIndexEndpointRequest] + # 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_index_endpoint request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_index_endpoint_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_index_endpoint", + 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_index_endpoint REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::GetIndexEndpointRequest] + # 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::VisionAI::V1::IndexEndpoint] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::VisionAI::V1::IndexEndpoint] + # A result object deserialized from the server's reply + def get_index_endpoint request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_index_endpoint_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_index_endpoint", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::VisionAI::V1::IndexEndpoint.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_index_endpoints REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::ListIndexEndpointsRequest] + # 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::VisionAI::V1::ListIndexEndpointsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::VisionAI::V1::ListIndexEndpointsResponse] + # A result object deserialized from the server's reply + def list_index_endpoints request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_index_endpoints_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_index_endpoints", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::VisionAI::V1::ListIndexEndpointsResponse.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_index_endpoint REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::UpdateIndexEndpointRequest] + # 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 update_index_endpoint request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_index_endpoint_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_index_endpoint", + 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_index_endpoint REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::DeleteIndexEndpointRequest] + # 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_index_endpoint request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_index_endpoint_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_index_endpoint", + 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 deploy_index REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::DeployIndexRequest] + # 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 deploy_index request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_deploy_index_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: "deploy_index", + 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 undeploy_index REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::UndeployIndexRequest] + # 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 undeploy_index request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_undeploy_index_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: "undeploy_index", + 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_collection REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::CreateCollectionRequest] + # 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_collection request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_collection_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_collection", + 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_collection REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::DeleteCollectionRequest] + # 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_collection request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_collection_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_collection", + 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_collection REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::GetCollectionRequest] + # 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::VisionAI::V1::Collection] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::VisionAI::V1::Collection] + # A result object deserialized from the server's reply + def get_collection request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_collection_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_collection", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::VisionAI::V1::Collection.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_collection REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::UpdateCollectionRequest] + # 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::VisionAI::V1::Collection] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::VisionAI::V1::Collection] + # A result object deserialized from the server's reply + def update_collection request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_collection_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_collection", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::VisionAI::V1::Collection.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_collections REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::ListCollectionsRequest] + # 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::VisionAI::V1::ListCollectionsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::VisionAI::V1::ListCollectionsResponse] + # A result object deserialized from the server's reply + def list_collections request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_collections_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_collections", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::VisionAI::V1::ListCollectionsResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the add_collection_item REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::AddCollectionItemRequest] + # 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::VisionAI::V1::AddCollectionItemResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::VisionAI::V1::AddCollectionItemResponse] + # A result object deserialized from the server's reply + def add_collection_item request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_add_collection_item_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: "add_collection_item", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::VisionAI::V1::AddCollectionItemResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the remove_collection_item REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::RemoveCollectionItemRequest] + # 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::VisionAI::V1::RemoveCollectionItemResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::VisionAI::V1::RemoveCollectionItemResponse] + # A result object deserialized from the server's reply + def remove_collection_item request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_remove_collection_item_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: "remove_collection_item", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::VisionAI::V1::RemoveCollectionItemResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the view_collection_items REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::ViewCollectionItemsRequest] + # 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::VisionAI::V1::ViewCollectionItemsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::VisionAI::V1::ViewCollectionItemsResponse] + # A result object deserialized from the server's reply + def view_collection_items request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_view_collection_items_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: "view_collection_items", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::VisionAI::V1::ViewCollectionItemsResponse.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_asset REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::CreateAssetRequest] + # 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_asset_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/assets", + body: "asset", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/corpora/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_asset REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::UpdateAssetRequest] + # 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_asset_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v1/{asset.name}", + body: "asset", + matches: [ + ["asset.name", %r{^projects/[^/]+/locations/[^/]+/corpora/[^/]+/assets/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_asset REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::GetAssetRequest] + # 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_asset_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/corpora/[^/]+/assets/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_assets REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::ListAssetsRequest] + # 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_assets_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/assets", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/corpora/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_asset REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::DeleteAssetRequest] + # 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_asset_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/corpora/[^/]+/assets/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the upload_asset REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::UploadAssetRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_upload_asset_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:upload", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/corpora/[^/]+/assets/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the generate_retrieval_url REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::GenerateRetrievalUrlRequest] + # 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_retrieval_url_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:generateRetrievalUrl", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/corpora/[^/]+/assets/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the analyze_asset REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::AnalyzeAssetRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_analyze_asset_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:analyze", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/corpora/[^/]+/assets/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the index_asset REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::IndexAssetRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_index_asset_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:index", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/corpora/[^/]+/assets/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the remove_index_asset REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::RemoveIndexAssetRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_remove_index_asset_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:removeIndex", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/corpora/[^/]+/assets/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the view_indexed_assets REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::ViewIndexedAssetsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_view_indexed_assets_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{index}:viewAssets", + matches: [ + ["index", %r{^projects/[^/]+/locations/[^/]+/corpora/[^/]+/indexes/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_index REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::CreateIndexRequest] + # 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_index_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/indexes", + body: "index", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/corpora/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_index REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::UpdateIndexRequest] + # 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_index_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v1/{index.name}", + body: "index", + matches: [ + ["index.name", %r{^projects/[^/]+/locations/[^/]+/corpora/[^/]+/indexes/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_index REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::GetIndexRequest] + # 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_index_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/corpora/[^/]+/indexes/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_indexes REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::ListIndexesRequest] + # 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_indexes_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/indexes", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/corpora/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_index REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::DeleteIndexRequest] + # 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_index_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/corpora/[^/]+/indexes/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_corpus REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::CreateCorpusRequest] + # 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_corpus_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/corpora", + body: "corpus", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_corpus REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::GetCorpusRequest] + # 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_corpus_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/corpora/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_corpus REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::UpdateCorpusRequest] + # 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_corpus_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v1/{corpus.name}", + body: "corpus", + matches: [ + ["corpus.name", %r{^projects/[^/]+/locations/[^/]+/corpora/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_corpora REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::ListCorporaRequest] + # 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_corpora_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/corpora", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_corpus REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::DeleteCorpusRequest] + # 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_corpus_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/corpora/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the analyze_corpus REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::AnalyzeCorpusRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_analyze_corpus_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:analyze", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/corpora/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_data_schema REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::CreateDataSchemaRequest] + # 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_data_schema_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/dataSchemas", + body: "data_schema", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/corpora/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_data_schema REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::UpdateDataSchemaRequest] + # 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_data_schema_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v1/{data_schema.name}", + body: "data_schema", + matches: [ + ["data_schema.name", %r{^projects/[^/]+/locations/[^/]+/corpora/[^/]+/dataSchemas/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_data_schema REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::GetDataSchemaRequest] + # 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_data_schema_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/corpora/[^/]+/dataSchemas/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_data_schema REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::DeleteDataSchemaRequest] + # 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_data_schema_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/corpora/[^/]+/dataSchemas/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_data_schemas REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::ListDataSchemasRequest] + # 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_data_schemas_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/dataSchemas", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/corpora/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_annotation REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::CreateAnnotationRequest] + # 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_annotation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/annotations", + body: "annotation", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/corpora/[^/]+/assets/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_annotation REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::GetAnnotationRequest] + # 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_annotation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/corpora/[^/]+/assets/[^/]+/annotations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_annotations REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::ListAnnotationsRequest] + # 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_annotations_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/annotations", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/corpora/[^/]+/assets/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_annotation REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::UpdateAnnotationRequest] + # 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_annotation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v1/{annotation.name}", + body: "annotation", + matches: [ + ["annotation.name", %r{^projects/[^/]+/locations/[^/]+/corpora/[^/]+/assets/[^/]+/annotations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_annotation REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::DeleteAnnotationRequest] + # 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_annotation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/corpora/[^/]+/assets/[^/]+/annotations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the clip_asset REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::ClipAssetRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_clip_asset_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:clip", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/corpora/[^/]+/assets/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the generate_hls_uri REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::GenerateHlsUriRequest] + # 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_hls_uri_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:generateHlsUri", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/corpora/[^/]+/assets/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the import_assets REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::ImportAssetsRequest] + # 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_assets_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/assets:import", + body: "*", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/corpora/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_search_config REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::CreateSearchConfigRequest] + # 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_search_config_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/searchConfigs", + body: "search_config", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/corpora/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_search_config REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::UpdateSearchConfigRequest] + # 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_search_config_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v1/{search_config.name}", + body: "search_config", + matches: [ + ["search_config.name", %r{^projects/[^/]+/locations/[^/]+/corpora/[^/]+/searchConfigs/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_search_config REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::GetSearchConfigRequest] + # 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_search_config_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/corpora/[^/]+/searchConfigs/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_search_config REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::DeleteSearchConfigRequest] + # 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_search_config_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/corpora/[^/]+/searchConfigs/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_search_configs REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::ListSearchConfigsRequest] + # 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_search_configs_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/searchConfigs", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/corpora/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_search_hypernym REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::CreateSearchHypernymRequest] + # 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_search_hypernym_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/searchHypernyms", + body: "search_hypernym", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/corpora/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_search_hypernym REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::UpdateSearchHypernymRequest] + # 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_search_hypernym_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v1/{search_hypernym.name}", + body: "search_hypernym", + matches: [ + ["search_hypernym.name", %r{^projects/[^/]+/locations/[^/]+/corpora/[^/]+/searchHypernyms/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_search_hypernym REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::GetSearchHypernymRequest] + # 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_search_hypernym_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/corpora/[^/]+/searchHypernyms/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_search_hypernym REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::DeleteSearchHypernymRequest] + # 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_search_hypernym_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/corpora/[^/]+/searchHypernyms/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_search_hypernyms REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::ListSearchHypernymsRequest] + # 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_search_hypernyms_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/searchHypernyms", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/corpora/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the search_assets REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::SearchAssetsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_search_assets_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{corpus}:searchAssets", + body: "*", + matches: [ + ["corpus", %r{^projects/[^/]+/locations/[^/]+/corpora/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the search_index_endpoint REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::SearchIndexEndpointRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_search_index_endpoint_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{index_endpoint}:searchIndexEndpoint", + body: "*", + matches: [ + ["index_endpoint", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_index_endpoint REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::CreateIndexEndpointRequest] + # 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_index_endpoint_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/indexEndpoints", + body: "index_endpoint", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_index_endpoint REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::GetIndexEndpointRequest] + # 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_index_endpoint_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_index_endpoints REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::ListIndexEndpointsRequest] + # 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_index_endpoints_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/indexEndpoints", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_index_endpoint REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::UpdateIndexEndpointRequest] + # 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_index_endpoint_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v1/{index_endpoint.name}", + body: "index_endpoint", + matches: [ + ["index_endpoint.name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_index_endpoint REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::DeleteIndexEndpointRequest] + # 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_index_endpoint_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the deploy_index REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::DeployIndexRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_deploy_index_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{index_endpoint}:deployIndex", + body: "*", + matches: [ + ["index_endpoint", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the undeploy_index REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::UndeployIndexRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_undeploy_index_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{index_endpoint}:undeployIndex", + body: "*", + matches: [ + ["index_endpoint", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_collection REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::CreateCollectionRequest] + # 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_collection_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/collections", + body: "collection", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/corpora/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_collection REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::DeleteCollectionRequest] + # 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_collection_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/corpora/[^/]+/collections/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_collection REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::GetCollectionRequest] + # 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_collection_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/corpora/[^/]+/collections/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_collection REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::UpdateCollectionRequest] + # 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_collection_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v1/{collection.name}", + body: "collection", + matches: [ + ["collection.name", %r{^projects/[^/]+/locations/[^/]+/corpora/[^/]+/collections/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_collections REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::ListCollectionsRequest] + # 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_collections_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/collections", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/corpora/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the add_collection_item REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::AddCollectionItemRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_add_collection_item_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{item.collection}:addCollectionItem", + body: "*", + matches: [ + ["item.collection", %r{^projects/[^/]+/locations/[^/]+/corpora/[^/]+/collections/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the remove_collection_item REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::RemoveCollectionItemRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_remove_collection_item_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{item.collection}:removeCollectionItem", + body: "*", + matches: [ + ["item.collection", %r{^projects/[^/]+/locations/[^/]+/corpora/[^/]+/collections/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the view_collection_items REST call + # + # @param request_pb [::Google::Cloud::VisionAI::V1::ViewCollectionItemsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_view_collection_items_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{collection}:viewCollectionItems", + matches: [ + ["collection", %r{^projects/[^/]+/locations/[^/]+/corpora/[^/]+/collections/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/visionai/v1/annotations_pb.rb b/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/visionai/v1/annotations_pb.rb new file mode 100644 index 000000000000..1a2ad095f3aa --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/visionai/v1/annotations_pb.rb @@ -0,0 +1,67 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/visionai/v1/annotations.proto + +require 'google/protobuf' + +require 'google/protobuf/struct_pb' +require 'google/protobuf/timestamp_pb' + + +descriptor_data = "\n*google/cloud/visionai/v1/annotations.proto\x12\x18google.cloud.visionai.v1\x1a\x1cgoogle/protobuf/struct.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\x95\r\n*PersonalProtectiveEquipmentDetectionOutput\x12\x30\n\x0c\x63urrent_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12m\n\x10\x64\x65tected_persons\x18\x02 \x03(\x0b\x32S.google.cloud.visionai.v1.PersonalProtectiveEquipmentDetectionOutput.DetectedPerson\x1a(\n\x0cPersonEntity\x12\x18\n\x10person_entity_id\x18\x01 \x01(\x03\x1az\n\tPPEEntity\x12\x14\n\x0cppe_label_id\x18\x01 \x01(\x03\x12\x18\n\x10ppe_label_string\x18\x02 \x01(\t\x12&\n\x1eppe_supercategory_label_string\x18\x03 \x01(\t\x12\x15\n\rppe_entity_id\x18\x04 \x01(\x03\x1aR\n\x15NormalizedBoundingBox\x12\x0c\n\x04xmin\x18\x01 \x01(\x02\x12\x0c\n\x04ymin\x18\x02 \x01(\x02\x12\r\n\x05width\x18\x03 \x01(\x02\x12\x0e\n\x06height\x18\x04 \x01(\x02\x1a\xa6\x02\n\x13PersonIdentifiedBox\x12\x0e\n\x06\x62ox_id\x18\x01 \x01(\x03\x12{\n\x17normalized_bounding_box\x18\x02 \x01(\x0b\x32Z.google.cloud.visionai.v1.PersonalProtectiveEquipmentDetectionOutput.NormalizedBoundingBox\x12\x18\n\x10\x63onfidence_score\x18\x03 \x01(\x02\x12h\n\rperson_entity\x18\x04 \x01(\x0b\x32Q.google.cloud.visionai.v1.PersonalProtectiveEquipmentDetectionOutput.PersonEntity\x1a\x9d\x02\n\x10PPEIdentifiedBox\x12\x0e\n\x06\x62ox_id\x18\x01 \x01(\x03\x12{\n\x17normalized_bounding_box\x18\x02 \x01(\x0b\x32Z.google.cloud.visionai.v1.PersonalProtectiveEquipmentDetectionOutput.NormalizedBoundingBox\x12\x18\n\x10\x63onfidence_score\x18\x03 \x01(\x02\x12\x62\n\nppe_entity\x18\x04 \x01(\x0b\x32N.google.cloud.visionai.v1.PersonalProtectiveEquipmentDetectionOutput.PPEEntity\x1a\x82\x05\n\x0e\x44\x65tectedPerson\x12\x11\n\tperson_id\x18\x01 \x01(\x03\x12\x80\x01\n\x1e\x64\x65tected_person_identified_box\x18\x02 \x01(\x0b\x32X.google.cloud.visionai.v1.PersonalProtectiveEquipmentDetectionOutput.PersonIdentifiedBox\x12|\n\x1d\x64\x65tected_ppe_identified_boxes\x18\x03 \x03(\x0b\x32U.google.cloud.visionai.v1.PersonalProtectiveEquipmentDetectionOutput.PPEIdentifiedBox\x12 \n\x13\x66\x61\x63\x65_coverage_score\x18\x04 \x01(\x02H\x00\x88\x01\x01\x12 \n\x13\x65yes_coverage_score\x18\x05 \x01(\x02H\x01\x88\x01\x01\x12 \n\x13head_coverage_score\x18\x06 \x01(\x02H\x02\x88\x01\x01\x12!\n\x14hands_coverage_score\x18\x07 \x01(\x02H\x03\x88\x01\x01\x12 \n\x13\x62ody_coverage_score\x18\x08 \x01(\x02H\x04\x88\x01\x01\x12 \n\x13\x66\x65\x65t_coverage_score\x18\t \x01(\x02H\x05\x88\x01\x01\x42\x16\n\x14_face_coverage_scoreB\x16\n\x14_eyes_coverage_scoreB\x16\n\x14_head_coverage_scoreB\x17\n\x15_hands_coverage_scoreB\x16\n\x14_body_coverage_scoreB\x16\n\x14_feet_coverage_score\"\xca\x04\n\x1fObjectDetectionPredictionResult\x12\x30\n\x0c\x63urrent_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x61\n\x10identified_boxes\x18\x02 \x03(\x0b\x32G.google.cloud.visionai.v1.ObjectDetectionPredictionResult.IdentifiedBox\x1a\x30\n\x06\x45ntity\x12\x10\n\x08label_id\x18\x01 \x01(\x03\x12\x14\n\x0clabel_string\x18\x02 \x01(\t\x1a\xdf\x02\n\rIdentifiedBox\x12\x0e\n\x06\x62ox_id\x18\x01 \x01(\x03\x12~\n\x17normalized_bounding_box\x18\x02 \x01(\x0b\x32].google.cloud.visionai.v1.ObjectDetectionPredictionResult.IdentifiedBox.NormalizedBoundingBox\x12\x18\n\x10\x63onfidence_score\x18\x03 \x01(\x02\x12P\n\x06\x65ntity\x18\x04 \x01(\x0b\x32@.google.cloud.visionai.v1.ObjectDetectionPredictionResult.Entity\x1aR\n\x15NormalizedBoundingBox\x12\x0c\n\x04xmin\x18\x01 \x01(\x02\x12\x0c\n\x04ymin\x18\x02 \x01(\x02\x12\r\n\x05width\x18\x03 \x01(\x02\x12\x0e\n\x06height\x18\x04 \x01(\x02\"\x8b\x01\n$ImageObjectDetectionPredictionResult\x12\x0b\n\x03ids\x18\x01 \x03(\x03\x12\x15\n\rdisplay_names\x18\x02 \x03(\t\x12\x13\n\x0b\x63onfidences\x18\x03 \x03(\x02\x12*\n\x06\x62\x62oxes\x18\x04 \x03(\x0b\x32\x1a.google.protobuf.ListValue\"Y\n\x1e\x43lassificationPredictionResult\x12\x0b\n\x03ids\x18\x01 \x03(\x03\x12\x15\n\rdisplay_names\x18\x02 \x03(\t\x12\x13\n\x0b\x63onfidences\x18\x03 \x03(\x02\"S\n!ImageSegmentationPredictionResult\x12\x15\n\rcategory_mask\x18\x01 \x01(\t\x12\x17\n\x0f\x63onfidence_mask\x18\x02 \x01(\t\"\xc4\x02\n&VideoActionRecognitionPredictionResult\x12\x36\n\x12segment_start_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x34\n\x10segment_end_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x62\n\x07\x61\x63tions\x18\x03 \x03(\x0b\x32Q.google.cloud.visionai.v1.VideoActionRecognitionPredictionResult.IdentifiedAction\x1aH\n\x10IdentifiedAction\x12\n\n\x02id\x18\x01 \x01(\t\x12\x14\n\x0c\x64isplay_name\x18\x02 \x01(\t\x12\x12\n\nconfidence\x18\x03 \x01(\x02\"\xf9\x03\n#VideoObjectTrackingPredictionResult\x12\x36\n\x12segment_start_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x34\n\x10segment_end_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12]\n\x07objects\x18\x03 \x03(\x0b\x32L.google.cloud.visionai.v1.VideoObjectTrackingPredictionResult.DetectedObject\x1aI\n\x0b\x42oundingBox\x12\r\n\x05x_min\x18\x01 \x01(\x02\x12\r\n\x05x_max\x18\x02 \x01(\x02\x12\r\n\x05y_min\x18\x03 \x01(\x02\x12\r\n\x05y_max\x18\x04 \x01(\x02\x1a\xb9\x01\n\x0e\x44\x65tectedObject\x12\n\n\x02id\x18\x01 \x01(\t\x12\x14\n\x0c\x64isplay_name\x18\x02 \x01(\t\x12_\n\x0c\x62ounding_box\x18\x03 \x01(\x0b\x32I.google.cloud.visionai.v1.VideoObjectTrackingPredictionResult.BoundingBox\x12\x12\n\nconfidence\x18\x04 \x01(\x02\x12\x10\n\x08track_id\x18\x05 \x01(\x03\"\xd6\x02\n#VideoClassificationPredictionResult\x12\x36\n\x12segment_start_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x34\n\x10segment_end_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12o\n\x0f\x63lassifications\x18\x03 \x03(\x0b\x32V.google.cloud.visionai.v1.VideoClassificationPredictionResult.IdentifiedClassification\x1aP\n\x18IdentifiedClassification\x12\n\n\x02id\x18\x01 \x01(\t\x12\x14\n\x0c\x64isplay_name\x18\x02 \x01(\t\x12\x12\n\nconfidence\x18\x03 \x01(\x02\"\xeb\x13\n!OccupancyCountingPredictionResult\x12\x30\n\x0c\x63urrent_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x63\n\x10identified_boxes\x18\x02 \x03(\x0b\x32I.google.cloud.visionai.v1.OccupancyCountingPredictionResult.IdentifiedBox\x12P\n\x05stats\x18\x03 \x01(\x0b\x32\x41.google.cloud.visionai.v1.OccupancyCountingPredictionResult.Stats\x12Y\n\ntrack_info\x18\x04 \x03(\x0b\x32\x45.google.cloud.visionai.v1.OccupancyCountingPredictionResult.TrackInfo\x12\x62\n\x0f\x64well_time_info\x18\x05 \x03(\x0b\x32I.google.cloud.visionai.v1.OccupancyCountingPredictionResult.DwellTimeInfo\x12\x10\n\x03pts\x18\x06 \x01(\x03H\x00\x88\x01\x01\x1a\x30\n\x06\x45ntity\x12\x10\n\x08label_id\x18\x01 \x01(\x03\x12\x14\n\x0clabel_string\x18\x02 \x01(\t\x1a\xeb\x02\n\rIdentifiedBox\x12\x0e\n\x06\x62ox_id\x18\x01 \x01(\x03\x12\x80\x01\n\x17normalized_bounding_box\x18\x02 \x01(\x0b\x32_.google.cloud.visionai.v1.OccupancyCountingPredictionResult.IdentifiedBox.NormalizedBoundingBox\x12\r\n\x05score\x18\x03 \x01(\x02\x12R\n\x06\x65ntity\x18\x04 \x01(\x0b\x32\x42.google.cloud.visionai.v1.OccupancyCountingPredictionResult.Entity\x12\x10\n\x08track_id\x18\x05 \x01(\x03\x1aR\n\x15NormalizedBoundingBox\x12\x0c\n\x04xmin\x18\x01 \x01(\x02\x12\x0c\n\x04ymin\x18\x02 \x01(\x02\x12\r\n\x05width\x18\x03 \x01(\x02\x12\x0e\n\x06height\x18\x04 \x01(\x02\x1a\xf5\n\n\x05Stats\x12g\n\x10\x66ull_frame_count\x18\x01 \x03(\x0b\x32M.google.cloud.visionai.v1.OccupancyCountingPredictionResult.Stats.ObjectCount\x12q\n\x14\x63rossing_line_counts\x18\x02 \x03(\x0b\x32S.google.cloud.visionai.v1.OccupancyCountingPredictionResult.Stats.CrossingLineCount\x12m\n\x12\x61\x63tive_zone_counts\x18\x03 \x03(\x0b\x32Q.google.cloud.visionai.v1.OccupancyCountingPredictionResult.Stats.ActiveZoneCount\x1ap\n\x0bObjectCount\x12R\n\x06\x65ntity\x18\x01 \x01(\x0b\x32\x42.google.cloud.visionai.v1.OccupancyCountingPredictionResult.Entity\x12\r\n\x05\x63ount\x18\x02 \x01(\x05\x1a\xad\x01\n\x16\x41\x63\x63umulatedObjectCount\x12.\n\nstart_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x63\n\x0cobject_count\x18\x02 \x01(\x0b\x32M.google.cloud.visionai.v1.OccupancyCountingPredictionResult.Stats.ObjectCount\x1a\xcb\x04\n\x11\x43rossingLineCount\x12>\n\nannotation\x18\x01 \x01(\x0b\x32*.google.cloud.visionai.v1.StreamAnnotation\x12p\n\x19positive_direction_counts\x18\x02 \x03(\x0b\x32M.google.cloud.visionai.v1.OccupancyCountingPredictionResult.Stats.ObjectCount\x12p\n\x19negative_direction_counts\x18\x03 \x03(\x0b\x32M.google.cloud.visionai.v1.OccupancyCountingPredictionResult.Stats.ObjectCount\x12\x87\x01\n%accumulated_positive_direction_counts\x18\x04 \x03(\x0b\x32X.google.cloud.visionai.v1.OccupancyCountingPredictionResult.Stats.AccumulatedObjectCount\x12\x87\x01\n%accumulated_negative_direction_counts\x18\x05 \x03(\x0b\x32X.google.cloud.visionai.v1.OccupancyCountingPredictionResult.Stats.AccumulatedObjectCount\x1a\xb0\x01\n\x0f\x41\x63tiveZoneCount\x12>\n\nannotation\x18\x01 \x01(\x0b\x32*.google.cloud.visionai.v1.StreamAnnotation\x12]\n\x06\x63ounts\x18\x02 \x03(\x0b\x32M.google.cloud.visionai.v1.OccupancyCountingPredictionResult.Stats.ObjectCount\x1aM\n\tTrackInfo\x12\x10\n\x08track_id\x18\x01 \x01(\t\x12.\n\nstart_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x1a\x9c\x01\n\rDwellTimeInfo\x12\x10\n\x08track_id\x18\x01 \x01(\t\x12\x0f\n\x07zone_id\x18\x02 \x01(\t\x12\x34\n\x10\x64well_start_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x32\n\x0e\x64well_end_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x06\n\x04_pts\"\xaa\x02\n\x10StreamAnnotation\x12\x42\n\x0b\x61\x63tive_zone\x18\x05 \x01(\x0b\x32+.google.cloud.visionai.v1.NormalizedPolygonH\x00\x12\x45\n\rcrossing_line\x18\x06 \x01(\x0b\x32,.google.cloud.visionai.v1.NormalizedPolylineH\x00\x12\n\n\x02id\x18\x01 \x01(\t\x12\x14\n\x0c\x64isplay_name\x18\x02 \x01(\t\x12\x15\n\rsource_stream\x18\x03 \x01(\t\x12<\n\x04type\x18\x04 \x01(\x0e\x32..google.cloud.visionai.v1.StreamAnnotationTypeB\x14\n\x12\x61nnotation_payload\"[\n\x11StreamAnnotations\x12\x46\n\x12stream_annotations\x18\x01 \x03(\x0b\x32*.google.cloud.visionai.v1.StreamAnnotation\"\\\n\x11NormalizedPolygon\x12G\n\x13normalized_vertices\x18\x01 \x03(\x0b\x32*.google.cloud.visionai.v1.NormalizedVertex\"]\n\x12NormalizedPolyline\x12G\n\x13normalized_vertices\x18\x01 \x03(\x0b\x32*.google.cloud.visionai.v1.NormalizedVertex\"(\n\x10NormalizedVertex\x12\t\n\x01x\x18\x01 \x01(\x02\x12\t\n\x01y\x18\x02 \x01(\x02\"`\n\x13\x41ppPlatformMetadata\x12\x13\n\x0b\x61pplication\x18\x01 \x01(\t\x12\x13\n\x0binstance_id\x18\x02 \x01(\t\x12\x0c\n\x04node\x18\x03 \x01(\t\x12\x11\n\tprocessor\x18\x04 \x01(\t\"\xbe\x02\n\x1f\x41ppPlatformCloudFunctionRequest\x12L\n\x15\x61pp_platform_metadata\x18\x01 \x01(\x0b\x32-.google.cloud.visionai.v1.AppPlatformMetadata\x12\x66\n\x0b\x61nnotations\x18\x02 \x03(\x0b\x32Q.google.cloud.visionai.v1.AppPlatformCloudFunctionRequest.StructedInputAnnotation\x1a\x65\n\x17StructedInputAnnotation\x12\x1d\n\x15ingestion_time_micros\x18\x01 \x01(\x03\x12+\n\nannotation\x18\x02 \x01(\x0b\x32\x17.google.protobuf.Struct\"\xb5\x02\n AppPlatformCloudFunctionResponse\x12h\n\x0b\x61nnotations\x18\x02 \x03(\x0b\x32S.google.cloud.visionai.v1.AppPlatformCloudFunctionResponse.StructedOutputAnnotation\x12\x1e\n\x16\x61nnotation_passthrough\x18\x03 \x01(\x08\x12>\n\x06\x65vents\x18\x04 \x03(\x0b\x32..google.cloud.visionai.v1.AppPlatformEventBody\x1aG\n\x18StructedOutputAnnotation\x12+\n\nannotation\x18\x01 \x01(\x0b\x32\x17.google.protobuf.Struct\"i\n\x14\x41ppPlatformEventBody\x12\x15\n\revent_message\x18\x01 \x01(\t\x12(\n\x07payload\x18\x02 \x01(\x0b\x32\x17.google.protobuf.Struct\x12\x10\n\x08\x65vent_id\x18\x03 \x01(\t*\x90\x01\n\x14StreamAnnotationType\x12&\n\"STREAM_ANNOTATION_TYPE_UNSPECIFIED\x10\x00\x12&\n\"STREAM_ANNOTATION_TYPE_ACTIVE_ZONE\x10\x01\x12(\n$STREAM_ANNOTATION_TYPE_CROSSING_LINE\x10\x02\x42\xc0\x01\n\x1c\x63om.google.cloud.visionai.v1B\x10\x41nnotationsProtoP\x01Z8cloud.google.com/go/visionai/apiv1/visionaipb;visionaipb\xaa\x02\x18Google.Cloud.VisionAI.V1\xca\x02\x18Google\\Cloud\\VisionAI\\V1\xea\x02\x1bGoogle::Cloud::VisionAI::V1b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module VisionAI + module V1 + PersonalProtectiveEquipmentDetectionOutput = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.PersonalProtectiveEquipmentDetectionOutput").msgclass + PersonalProtectiveEquipmentDetectionOutput::PersonEntity = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.PersonalProtectiveEquipmentDetectionOutput.PersonEntity").msgclass + PersonalProtectiveEquipmentDetectionOutput::PPEEntity = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.PersonalProtectiveEquipmentDetectionOutput.PPEEntity").msgclass + PersonalProtectiveEquipmentDetectionOutput::NormalizedBoundingBox = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.PersonalProtectiveEquipmentDetectionOutput.NormalizedBoundingBox").msgclass + PersonalProtectiveEquipmentDetectionOutput::PersonIdentifiedBox = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.PersonalProtectiveEquipmentDetectionOutput.PersonIdentifiedBox").msgclass + PersonalProtectiveEquipmentDetectionOutput::PPEIdentifiedBox = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.PersonalProtectiveEquipmentDetectionOutput.PPEIdentifiedBox").msgclass + PersonalProtectiveEquipmentDetectionOutput::DetectedPerson = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.PersonalProtectiveEquipmentDetectionOutput.DetectedPerson").msgclass + ObjectDetectionPredictionResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.ObjectDetectionPredictionResult").msgclass + ObjectDetectionPredictionResult::Entity = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.ObjectDetectionPredictionResult.Entity").msgclass + ObjectDetectionPredictionResult::IdentifiedBox = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.ObjectDetectionPredictionResult.IdentifiedBox").msgclass + ObjectDetectionPredictionResult::IdentifiedBox::NormalizedBoundingBox = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.ObjectDetectionPredictionResult.IdentifiedBox.NormalizedBoundingBox").msgclass + ImageObjectDetectionPredictionResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.ImageObjectDetectionPredictionResult").msgclass + ClassificationPredictionResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.ClassificationPredictionResult").msgclass + ImageSegmentationPredictionResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.ImageSegmentationPredictionResult").msgclass + VideoActionRecognitionPredictionResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.VideoActionRecognitionPredictionResult").msgclass + VideoActionRecognitionPredictionResult::IdentifiedAction = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.VideoActionRecognitionPredictionResult.IdentifiedAction").msgclass + VideoObjectTrackingPredictionResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.VideoObjectTrackingPredictionResult").msgclass + VideoObjectTrackingPredictionResult::BoundingBox = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.VideoObjectTrackingPredictionResult.BoundingBox").msgclass + VideoObjectTrackingPredictionResult::DetectedObject = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.VideoObjectTrackingPredictionResult.DetectedObject").msgclass + VideoClassificationPredictionResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.VideoClassificationPredictionResult").msgclass + VideoClassificationPredictionResult::IdentifiedClassification = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.VideoClassificationPredictionResult.IdentifiedClassification").msgclass + OccupancyCountingPredictionResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.OccupancyCountingPredictionResult").msgclass + OccupancyCountingPredictionResult::Entity = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.OccupancyCountingPredictionResult.Entity").msgclass + OccupancyCountingPredictionResult::IdentifiedBox = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.OccupancyCountingPredictionResult.IdentifiedBox").msgclass + OccupancyCountingPredictionResult::IdentifiedBox::NormalizedBoundingBox = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.OccupancyCountingPredictionResult.IdentifiedBox.NormalizedBoundingBox").msgclass + OccupancyCountingPredictionResult::Stats = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.OccupancyCountingPredictionResult.Stats").msgclass + OccupancyCountingPredictionResult::Stats::ObjectCount = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.OccupancyCountingPredictionResult.Stats.ObjectCount").msgclass + OccupancyCountingPredictionResult::Stats::AccumulatedObjectCount = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.OccupancyCountingPredictionResult.Stats.AccumulatedObjectCount").msgclass + OccupancyCountingPredictionResult::Stats::CrossingLineCount = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.OccupancyCountingPredictionResult.Stats.CrossingLineCount").msgclass + OccupancyCountingPredictionResult::Stats::ActiveZoneCount = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.OccupancyCountingPredictionResult.Stats.ActiveZoneCount").msgclass + OccupancyCountingPredictionResult::TrackInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.OccupancyCountingPredictionResult.TrackInfo").msgclass + OccupancyCountingPredictionResult::DwellTimeInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.OccupancyCountingPredictionResult.DwellTimeInfo").msgclass + StreamAnnotation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.StreamAnnotation").msgclass + StreamAnnotations = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.StreamAnnotations").msgclass + NormalizedPolygon = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.NormalizedPolygon").msgclass + NormalizedPolyline = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.NormalizedPolyline").msgclass + NormalizedVertex = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.NormalizedVertex").msgclass + AppPlatformMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.AppPlatformMetadata").msgclass + AppPlatformCloudFunctionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.AppPlatformCloudFunctionRequest").msgclass + AppPlatformCloudFunctionRequest::StructedInputAnnotation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.AppPlatformCloudFunctionRequest.StructedInputAnnotation").msgclass + AppPlatformCloudFunctionResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.AppPlatformCloudFunctionResponse").msgclass + AppPlatformCloudFunctionResponse::StructedOutputAnnotation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.AppPlatformCloudFunctionResponse.StructedOutputAnnotation").msgclass + AppPlatformEventBody = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.AppPlatformEventBody").msgclass + StreamAnnotationType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.StreamAnnotationType").enummodule + end + end + end +end diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/visionai/v1/common_pb.rb b/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/visionai/v1/common_pb.rb new file mode 100644 index 000000000000..752b9719abc5 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/visionai/v1/common_pb.rb @@ -0,0 +1,28 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/visionai/v1/common.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/protobuf/timestamp_pb' + + +descriptor_data = "\n%google/cloud/visionai/v1/common.proto\x12\x18google.cloud.visionai.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xac\x05\n\x07\x43luster\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\x12\x34\n\x0bupdate_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12=\n\x06labels\x18\x04 \x03(\x0b\x32-.google.cloud.visionai.v1.Cluster.LabelsEntry\x12G\n\x0b\x61nnotations\x18\x05 \x03(\x0b\x32\x32.google.cloud.visionai.v1.Cluster.AnnotationsEntry\x12\'\n\x1a\x64\x61taplane_service_endpoint\x18\x06 \x01(\tB\x03\xe0\x41\x03\x12;\n\x05state\x18\x07 \x01(\x0e\x32\'.google.cloud.visionai.v1.Cluster.StateB\x03\xe0\x41\x03\x12\x17\n\npsc_target\x18\x08 \x01(\tB\x03\xe0\x41\x03\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a\x32\n\x10\x41nnotationsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"V\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x10\n\x0cPROVISIONING\x10\x01\x12\x0b\n\x07RUNNING\x10\x02\x12\x0c\n\x08STOPPING\x10\x03\x12\t\n\x05\x45RROR\x10\x04:`\xea\x41]\n\x1fvisionai.googleapis.com/Cluster\x12:projects/{project}/locations/{location}/clusters/{cluster}\"\x80\x02\n\x11OperationMetadata\x12\x34\n\x0b\x63reate_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x31\n\x08\x65nd_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x13\n\x06target\x18\x03 \x01(\tB\x03\xe0\x41\x03\x12\x11\n\x04verb\x18\x04 \x01(\tB\x03\xe0\x41\x03\x12\x1b\n\x0estatus_message\x18\x05 \x01(\tB\x03\xe0\x41\x03\x12#\n\x16requested_cancellation\x18\x06 \x01(\x08\x42\x03\xe0\x41\x03\x12\x18\n\x0b\x61pi_version\x18\x07 \x01(\tB\x03\xe0\x41\x03\"\x1e\n\tGcsSource\x12\x11\n\x04uris\x18\x01 \x03(\tB\x03\xe0\x41\x02\x42\xbb\x01\n\x1c\x63om.google.cloud.visionai.v1B\x0b\x43ommonProtoP\x01Z8cloud.google.com/go/visionai/apiv1/visionaipb;visionaipb\xaa\x02\x18Google.Cloud.VisionAI.V1\xca\x02\x18Google\\Cloud\\VisionAI\\V1\xea\x02\x1bGoogle::Cloud::VisionAI::V1b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module VisionAI + module V1 + Cluster = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.Cluster").msgclass + Cluster::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.Cluster.State").enummodule + OperationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.OperationMetadata").msgclass + GcsSource = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.GcsSource").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/visionai/v1/health_service_pb.rb b/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/visionai/v1/health_service_pb.rb new file mode 100644 index 000000000000..156efca341ba --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/visionai/v1/health_service_pb.rb @@ -0,0 +1,27 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/visionai/v1/health_service.proto + +require 'google/protobuf' + +require 'google/api/annotations_pb' +require 'google/api/client_pb' +require 'google/api/resource_pb' + + +descriptor_data = "\n-google/cloud/visionai/v1/health_service.proto\x12\x18google.cloud.visionai.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x19google/api/resource.proto\"K\n\x12HealthCheckRequest\x12\x35\n\x07\x63luster\x18\x01 \x01(\tB$\xfa\x41!\n\x1fvisionai.googleapis.com/Cluster\"s\n\x13HealthCheckResponse\x12\x0f\n\x07healthy\x18\x01 \x01(\x08\x12\x0e\n\x06reason\x18\x02 \x01(\t\x12;\n\x0c\x63luster_info\x18\x03 \x01(\x0b\x32%.google.cloud.visionai.v1.ClusterInfo\"=\n\x0b\x43lusterInfo\x12\x15\n\rstreams_count\x18\x01 \x01(\x05\x12\x17\n\x0fprocesses_count\x18\x02 \x01(\x05\x32\x93\x02\n\x12HealthCheckService\x12\xaf\x01\n\x0bHealthCheck\x12,.google.cloud.visionai.v1.HealthCheckRequest\x1a-.google.cloud.visionai.v1.HealthCheckResponse\"C\x82\xd3\xe4\x93\x02=\x12;/v1/{cluster=projects/*/locations/*/clusters/*}:healthCheck\x1aK\xca\x41\x17visionai.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\xc7\x01\n\x1c\x63om.google.cloud.visionai.v1B\x17HealthCheckServiceProtoP\x01Z8cloud.google.com/go/visionai/apiv1/visionaipb;visionaipb\xaa\x02\x18Google.Cloud.VisionAI.V1\xca\x02\x18Google\\Cloud\\VisionAI\\V1\xea\x02\x1bGoogle::Cloud::VisionAI::V1b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module VisionAI + module V1 + HealthCheckRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.HealthCheckRequest").msgclass + HealthCheckResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.HealthCheckResponse").msgclass + ClusterInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.ClusterInfo").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/visionai/v1/health_service_services_pb.rb b/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/visionai/v1/health_service_services_pb.rb new file mode 100644 index 000000000000..f470a270025f --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/visionai/v1/health_service_services_pb.rb @@ -0,0 +1,46 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/cloud/visionai/v1/health_service.proto for package 'Google.Cloud.VisionAI.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/visionai/v1/health_service_pb' + +module Google + module Cloud + module VisionAI + module V1 + module HealthCheckService + # HealthCheckService provides an interface for Vertex AI Vision Cluster Health + # Check. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.cloud.visionai.v1.HealthCheckService' + + # HealthCheck method checks the health status of the cluster. + rpc :HealthCheck, ::Google::Cloud::VisionAI::V1::HealthCheckRequest, ::Google::Cloud::VisionAI::V1::HealthCheckResponse + end + + Stub = Service.rpc_stub_class + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/visionai/v1/lva_pb.rb b/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/visionai/v1/lva_pb.rb new file mode 100644 index 000000000000..3b77f27db668 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/visionai/v1/lva_pb.rb @@ -0,0 +1,33 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/visionai/v1/lva.proto + +require 'google/protobuf' + + +descriptor_data = "\n\"google/cloud/visionai/v1/lva.proto\x12\x18google.cloud.visionai.v1\"\xca\x04\n\x12OperatorDefinition\x12\x10\n\x08operator\x18\x01 \x01(\t\x12S\n\ninput_args\x18\x02 \x03(\x0b\x32?.google.cloud.visionai.v1.OperatorDefinition.ArgumentDefinition\x12T\n\x0boutput_args\x18\x03 \x03(\x0b\x32?.google.cloud.visionai.v1.OperatorDefinition.ArgumentDefinition\x12T\n\nattributes\x18\x04 \x03(\x0b\x32@.google.cloud.visionai.v1.OperatorDefinition.AttributeDefinition\x12\x42\n\tresources\x18\x05 \x01(\x0b\x32/.google.cloud.visionai.v1.ResourceSpecification\x12\x19\n\x11short_description\x18\x06 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x07 \x01(\t\x1a\x34\n\x12\x41rgumentDefinition\x12\x10\n\x08\x61rgument\x18\x01 \x01(\t\x12\x0c\n\x04type\x18\x02 \x01(\t\x1aw\n\x13\x41ttributeDefinition\x12\x11\n\tattribute\x18\x01 \x01(\t\x12\x0c\n\x04type\x18\x02 \x01(\t\x12?\n\rdefault_value\x18\x03 \x01(\x0b\x32(.google.cloud.visionai.v1.AttributeValue\"\x88\x01\n\x15ResourceSpecification\x12\x0b\n\x03\x63pu\x18\x01 \x01(\t\x12\x12\n\ncpu_limits\x18\x05 \x01(\t\x12\x0e\n\x06memory\x18\x02 \x01(\t\x12\x15\n\rmemory_limits\x18\x06 \x01(\t\x12\x0c\n\x04gpus\x18\x03 \x01(\x05\x12\x19\n\x11latency_budget_ms\x18\x04 \x01(\x05\"M\n\x0e\x41ttributeValue\x12\x0b\n\x01i\x18\x01 \x01(\x03H\x00\x12\x0b\n\x01\x66\x18\x02 \x01(\x02H\x00\x12\x0b\n\x01\x62\x18\x03 \x01(\x08H\x00\x12\x0b\n\x01s\x18\x04 \x01(\x0cH\x00\x42\x07\n\x05value\"\xdb\x05\n\x12\x41nalyzerDefinition\x12\x10\n\x08\x61nalyzer\x18\x01 \x01(\t\x12\x10\n\x08operator\x18\x02 \x01(\t\x12H\n\x06inputs\x18\x03 \x03(\x0b\x32\x38.google.cloud.visionai.v1.AnalyzerDefinition.StreamInput\x12\x46\n\x05\x61ttrs\x18\x04 \x03(\x0b\x32\x37.google.cloud.visionai.v1.AnalyzerDefinition.AttrsEntry\x12P\n\rdebug_options\x18\x05 \x01(\x0b\x32\x39.google.cloud.visionai.v1.AnalyzerDefinition.DebugOptions\x12T\n\x0foperator_option\x18\x06 \x01(\x0b\x32;.google.cloud.visionai.v1.AnalyzerDefinition.OperatorOption\x1a\x1c\n\x0bStreamInput\x12\r\n\x05input\x18\x01 \x01(\t\x1a\xbf\x01\n\x0c\x44\x65\x62ugOptions\x12r\n\x15\x65nvironment_variables\x18\x01 \x03(\x0b\x32S.google.cloud.visionai.v1.AnalyzerDefinition.DebugOptions.EnvironmentVariablesEntry\x1a;\n\x19\x45nvironmentVariablesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a/\n\x0eOperatorOption\x12\x0b\n\x03tag\x18\x01 \x01(\t\x12\x10\n\x08registry\x18\x02 \x01(\t\x1aV\n\nAttrsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\x37\n\x05value\x18\x02 \x01(\x0b\x32(.google.cloud.visionai.v1.AttributeValue:\x02\x38\x01\"U\n\x12\x41nalysisDefinition\x12?\n\tanalyzers\x18\x01 \x03(\x0b\x32,.google.cloud.visionai.v1.AnalyzerDefinition\"\xbc\x01\n\tRunStatus\x12\x38\n\x05state\x18\x01 \x01(\x0e\x32).google.cloud.visionai.v1.RunStatus.State\x12\x0e\n\x06reason\x18\x02 \x01(\t\"e\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x10\n\x0cINITIALIZING\x10\x01\x12\x0b\n\x07RUNNING\x10\x02\x12\r\n\tCOMPLETED\x10\x03\x12\n\n\x06\x46\x41ILED\x10\x04\x12\x0b\n\x07PENDING\x10\x05*=\n\x07RunMode\x12\x18\n\x14RUN_MODE_UNSPECIFIED\x10\x00\x12\x08\n\x04LIVE\x10\x01\x12\x0e\n\nSUBMISSION\x10\x02\x42\xb8\x01\n\x1c\x63om.google.cloud.visionai.v1B\x08LvaProtoP\x01Z8cloud.google.com/go/visionai/apiv1/visionaipb;visionaipb\xaa\x02\x18Google.Cloud.VisionAI.V1\xca\x02\x18Google\\Cloud\\VisionAI\\V1\xea\x02\x1bGoogle::Cloud::VisionAI::V1b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module VisionAI + module V1 + OperatorDefinition = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.OperatorDefinition").msgclass + OperatorDefinition::ArgumentDefinition = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.OperatorDefinition.ArgumentDefinition").msgclass + OperatorDefinition::AttributeDefinition = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.OperatorDefinition.AttributeDefinition").msgclass + ResourceSpecification = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.ResourceSpecification").msgclass + AttributeValue = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.AttributeValue").msgclass + AnalyzerDefinition = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.AnalyzerDefinition").msgclass + AnalyzerDefinition::StreamInput = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.AnalyzerDefinition.StreamInput").msgclass + AnalyzerDefinition::DebugOptions = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.AnalyzerDefinition.DebugOptions").msgclass + AnalyzerDefinition::OperatorOption = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.AnalyzerDefinition.OperatorOption").msgclass + AnalysisDefinition = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.AnalysisDefinition").msgclass + RunStatus = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.RunStatus").msgclass + RunStatus::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.RunStatus.State").enummodule + RunMode = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.RunMode").enummodule + end + end + end +end diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/visionai/v1/lva_resources_pb.rb b/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/visionai/v1/lva_resources_pb.rb new file mode 100644 index 000000000000..d210fa877ed6 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/visionai/v1/lva_resources_pb.rb @@ -0,0 +1,28 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/visionai/v1/lva_resources.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/cloud/visionai/v1/lva_pb' +require 'google/protobuf/timestamp_pb' + + +descriptor_data = "\n,google/cloud/visionai/v1/lva_resources.proto\x12\x18google.cloud.visionai.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\"google/cloud/visionai/v1/lva.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xb9\x03\n\x08Operator\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x34\n\x0b\x63reate_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12>\n\x06labels\x18\x04 \x03(\x0b\x32..google.cloud.visionai.v1.Operator.LabelsEntry\x12I\n\x13operator_definition\x18\x05 \x01(\x0b\x32,.google.cloud.visionai.v1.OperatorDefinition\x12\x14\n\x0c\x64ocker_image\x18\x06 \x01(\t\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01:c\xea\x41`\n visionai.googleapis.com/Operator\x12\n\x06labels\x18\x04 \x03(\x0b\x32..google.cloud.visionai.v1.Analysis.LabelsEntry\x12I\n\x13\x61nalysis_definition\x18\x05 \x01(\x0b\x32,.google.cloud.visionai.v1.AnalysisDefinition\x12Z\n\x15input_streams_mapping\x18\x06 \x03(\x0b\x32;.google.cloud.visionai.v1.Analysis.InputStreamsMappingEntry\x12\\\n\x16output_streams_mapping\x18\x07 \x03(\x0b\x32<.google.cloud.visionai.v1.Analysis.OutputStreamsMappingEntry\x12\x1b\n\x13\x64isable_event_watch\x18\x08 \x01(\x08\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a:\n\x18InputStreamsMappingEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a;\n\x19OutputStreamsMappingEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01:u\xea\x41r\n visionai.googleapis.com/Analysis\x12Nprojects/{project}/locations/{location}/clusters/{cluster}/analyses/{analysis}\"\x97\x04\n\x07Process\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x34\n\x0b\x63reate_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12:\n\x08\x61nalysis\x18\x04 \x01(\tB(\xe0\x41\x02\xfa\x41\"\n visionai.googleapis.com/Analysis\x12 \n\x13\x61ttribute_overrides\x18\x05 \x03(\tB\x03\xe0\x41\x01\x12<\n\nrun_status\x18\x06 \x01(\x0b\x32#.google.cloud.visionai.v1.RunStatusB\x03\xe0\x41\x01\x12\x38\n\x08run_mode\x18\x07 \x01(\x0e\x32!.google.cloud.visionai.v1.RunModeB\x03\xe0\x41\x01\x12\x15\n\x08\x65vent_id\x18\x08 \x01(\tB\x03\xe0\x41\x01\x12\x15\n\x08\x62\x61tch_id\x18\t \x01(\tB\x03\xe0\x41\x01\x12\x18\n\x0bretry_count\x18\n \x01(\x05\x42\x03\xe0\x41\x01:t\xea\x41q\n\x1fvisionai.googleapis.com/Process\x12Nprojects/{project}/locations/{location}/clusters/{cluster}/processes/{process}B\xc1\x01\n\x1c\x63om.google.cloud.visionai.v1B\x11LvaResourcesProtoP\x01Z8cloud.google.com/go/visionai/apiv1/visionaipb;visionaipb\xaa\x02\x18Google.Cloud.VisionAI.V1\xca\x02\x18Google\\Cloud\\VisionAI\\V1\xea\x02\x1bGoogle::Cloud::VisionAI::V1b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module VisionAI + module V1 + Operator = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.Operator").msgclass + Analysis = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.Analysis").msgclass + Process = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.Process").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/visionai/v1/lva_service_pb.rb b/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/visionai/v1/lva_service_pb.rb new file mode 100644 index 000000000000..5c2a943b08c2 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/visionai/v1/lva_service_pb.rb @@ -0,0 +1,57 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/visionai/v1/lva_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/visionai/v1/common_pb' +require 'google/cloud/visionai/v1/lva_resources_pb' +require 'google/longrunning/operations_pb' +require 'google/protobuf/empty_pb' +require 'google/protobuf/field_mask_pb' + + +descriptor_data = "\n*google/cloud/visionai/v1/lva_service.proto\x12\x18google.cloud.visionai.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/visionai/v1/common.proto\x1a,google/cloud/visionai/v1/lva_resources.proto\x1a#google/longrunning/operations.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\"\x9a\x01\n\x14ListOperatorsRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\x12\x0e\n\x06\x66ilter\x18\x04 \x01(\t\x12\x10\n\x08order_by\x18\x05 \x01(\t\"|\n\x15ListOperatorsResponse\x12\x35\n\toperators\x18\x01 \x03(\x0b\x32\".google.cloud.visionai.v1.Operator\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x13\n\x0bunreachable\x18\x03 \x03(\t\"L\n\x12GetOperatorRequest\x12\x36\n\x04name\x18\x01 \x01(\tB(\xe0\x41\x02\xfa\x41\"\n visionai.googleapis.com/Operator\"\xc0\x01\n\x15\x43reateOperatorRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\x12\x18\n\x0boperator_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x39\n\x08operator\x18\x03 \x01(\x0b\x32\".google.cloud.visionai.v1.OperatorB\x03\xe0\x41\x02\x12\x17\n\nrequest_id\x18\x04 \x01(\tB\x03\xe0\x41\x01\"\xa1\x01\n\x15UpdateOperatorRequest\x12\x34\n\x0bupdate_mask\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\x12\x39\n\x08operator\x18\x02 \x01(\x0b\x32\".google.cloud.visionai.v1.OperatorB\x03\xe0\x41\x02\x12\x17\n\nrequest_id\x18\x03 \x01(\tB\x03\xe0\x41\x01\"h\n\x15\x44\x65leteOperatorRequest\x12\x36\n\x04name\x18\x01 \x01(\tB(\xe0\x41\x02\xfa\x41\"\n visionai.googleapis.com/Operator\x12\x17\n\nrequest_id\x18\x02 \x01(\tB\x03\xe0\x41\x01\"\x97\x01\n\x13ListAnalysesRequest\x12\x37\n\x06parent\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1fvisionai.googleapis.com/Cluster\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\x12\x0e\n\x06\x66ilter\x18\x04 \x01(\t\x12\x10\n\x08order_by\x18\x05 \x01(\t\"z\n\x14ListAnalysesResponse\x12\x34\n\x08\x61nalyses\x18\x01 \x03(\x0b\x32\".google.cloud.visionai.v1.Analysis\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x13\n\x0bunreachable\x18\x03 \x03(\t\"L\n\x12GetAnalysisRequest\x12\x36\n\x04name\x18\x01 \x01(\tB(\xe0\x41\x02\xfa\x41\"\n visionai.googleapis.com/Analysis\"\xbe\x01\n\x15\x43reateAnalysisRequest\x12\x37\n\x06parent\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1fvisionai.googleapis.com/Cluster\x12\x18\n\x0b\x61nalysis_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x39\n\x08\x61nalysis\x18\x03 \x01(\x0b\x32\".google.cloud.visionai.v1.AnalysisB\x03\xe0\x41\x02\x12\x17\n\nrequest_id\x18\x04 \x01(\tB\x03\xe0\x41\x01\"\xa1\x01\n\x15UpdateAnalysisRequest\x12\x34\n\x0bupdate_mask\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\x12\x39\n\x08\x61nalysis\x18\x02 \x01(\x0b\x32\".google.cloud.visionai.v1.AnalysisB\x03\xe0\x41\x02\x12\x17\n\nrequest_id\x18\x03 \x01(\tB\x03\xe0\x41\x01\"h\n\x15\x44\x65leteAnalysisRequest\x12\x36\n\x04name\x18\x01 \x01(\tB(\xe0\x41\x02\xfa\x41\"\n visionai.googleapis.com/Analysis\x12\x17\n\nrequest_id\x18\x02 \x01(\tB\x03\xe0\x41\x01\"\x98\x01\n\x14ListProcessesRequest\x12\x37\n\x06parent\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1fvisionai.googleapis.com/Cluster\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\x12\x0e\n\x06\x66ilter\x18\x04 \x01(\t\x12\x10\n\x08order_by\x18\x05 \x01(\t\"{\n\x15ListProcessesResponse\x12\x34\n\tprocesses\x18\x01 \x03(\x0b\x32!.google.cloud.visionai.v1.Process\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x13\n\x0bunreachable\x18\x03 \x03(\t\"J\n\x11GetProcessRequest\x12\x35\n\x04name\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1fvisionai.googleapis.com/Process\"\xba\x01\n\x14\x43reateProcessRequest\x12\x37\n\x06parent\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1fvisionai.googleapis.com/Cluster\x12\x17\n\nprocess_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x37\n\x07process\x18\x03 \x01(\x0b\x32!.google.cloud.visionai.v1.ProcessB\x03\xe0\x41\x02\x12\x17\n\nrequest_id\x18\x04 \x01(\tB\x03\xe0\x41\x01\"\x9e\x01\n\x14UpdateProcessRequest\x12\x34\n\x0bupdate_mask\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\x12\x37\n\x07process\x18\x02 \x01(\x0b\x32!.google.cloud.visionai.v1.ProcessB\x03\xe0\x41\x02\x12\x17\n\nrequest_id\x18\x03 \x01(\tB\x03\xe0\x41\x01\"f\n\x14\x44\x65leteProcessRequest\x12\x35\n\x04name\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1fvisionai.googleapis.com/Process\x12\x17\n\nrequest_id\x18\x02 \x01(\tB\x03\xe0\x41\x01\"\xd1\x02\n\x16\x42\x61tchRunProcessRequest\x12\x37\n\x06parent\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1fvisionai.googleapis.com/Cluster\x12\x45\n\x08requests\x18\x02 \x03(\x0b\x32..google.cloud.visionai.v1.CreateProcessRequestB\x03\xe0\x41\x02\x12]\n\x07options\x18\x03 \x01(\x0b\x32G.google.cloud.visionai.v1.BatchRunProcessRequest.BatchRunProcessOptionsB\x03\xe0\x41\x01\x12\x15\n\x08\x62\x61tch_id\x18\x04 \x01(\tB\x03\xe0\x41\x03\x1a\x41\n\x16\x42\x61tchRunProcessOptions\x12\x13\n\x0bretry_count\x18\x01 \x01(\x05\x12\x12\n\nbatch_size\x18\x02 \x01(\x05\"a\n\x17\x42\x61tchRunProcessResponse\x12\x10\n\x08\x62\x61tch_id\x18\x01 \x01(\t\x12\x34\n\tprocesses\x18\x02 \x03(\x0b\x32!.google.cloud.visionai.v1.Process\"\x96\x01\n\x1aResolveOperatorInfoRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\x12=\n\x07queries\x18\x02 \x03(\x0b\x32\'.google.cloud.visionai.v1.OperatorQueryB\x03\xe0\x41\x02\"s\n\rOperatorQuery\x12\x15\n\x08operator\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x10\n\x03tag\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x39\n\x08registry\x18\x03 \x01(\x0e\x32\".google.cloud.visionai.v1.RegistryB\x03\xe0\x41\x01\"T\n\x1bResolveOperatorInfoResponse\x12\x35\n\toperators\x18\x01 \x03(\x0b\x32\".google.cloud.visionai.v1.Operator\"\xa0\x01\n\x1aListPublicOperatorsRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\x12\x0e\n\x06\x66ilter\x18\x04 \x01(\t\x12\x10\n\x08order_by\x18\x05 \x01(\t\"m\n\x1bListPublicOperatorsResponse\x12\x35\n\toperators\x18\x01 \x03(\x0b\x32\".google.cloud.visionai.v1.Operator\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t*=\n\x08Registry\x12\x18\n\x14REGISTRY_UNSPECIFIED\x10\x00\x12\n\n\x06PUBLIC\x10\x01\x12\x0b\n\x07PRIVATE\x10\x02\x32\x8d\x1e\n\x12LiveVideoAnalytics\x12\xcc\x01\n\x13ListPublicOperators\x12\x34.google.cloud.visionai.v1.ListPublicOperatorsRequest\x1a\x35.google.cloud.visionai.v1.ListPublicOperatorsResponse\"H\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x39\x12\x37/v1/{parent=projects/*/locations/*}:listPublicOperators\x12\xd7\x01\n\x13ResolveOperatorInfo\x12\x34.google.cloud.visionai.v1.ResolveOperatorInfoRequest\x1a\x35.google.cloud.visionai.v1.ResolveOperatorInfoResponse\"S\xda\x41\x0eparent,queries\x82\xd3\xe4\x93\x02<\"7/v1/{parent=projects/*/locations/*}:resolveOperatorInfo:\x01*\x12\xb0\x01\n\rListOperators\x12..google.cloud.visionai.v1.ListOperatorsRequest\x1a/.google.cloud.visionai.v1.ListOperatorsResponse\">\xda\x41\x06parent\x82\xd3\xe4\x93\x02/\x12-/v1/{parent=projects/*/locations/*}/operators\x12\x9d\x01\n\x0bGetOperator\x12,.google.cloud.visionai.v1.GetOperatorRequest\x1a\".google.cloud.visionai.v1.Operator\"<\xda\x41\x04name\x82\xd3\xe4\x93\x02/\x12-/v1/{name=projects/*/locations/*/operators/*}\x12\xdf\x01\n\x0e\x43reateOperator\x12/.google.cloud.visionai.v1.CreateOperatorRequest\x1a\x1d.google.longrunning.Operation\"}\xca\x41\x1d\n\x08Operator\x12\x11OperationMetadata\xda\x41\x1bparent,operator,operator_id\x82\xd3\xe4\x93\x02\x39\"-/v1/{parent=projects/*/locations/*}/operators:\x08operator\x12\xe1\x01\n\x0eUpdateOperator\x12/.google.cloud.visionai.v1.UpdateOperatorRequest\x1a\x1d.google.longrunning.Operation\"\x7f\xca\x41\x1d\n\x08Operator\x12\x11OperationMetadata\xda\x41\x14operator,update_mask\x82\xd3\xe4\x93\x02\x42\x32\x36/v1/{operator.name=projects/*/locations/*/operators/*}:\x08operator\x12\xcb\x01\n\x0e\x44\x65leteOperator\x12/.google.cloud.visionai.v1.DeleteOperatorRequest\x1a\x1d.google.longrunning.Operation\"i\xca\x41*\n\x15google.protobuf.Empty\x12\x11OperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02/*-/v1/{name=projects/*/locations/*/operators/*}\x12\xb7\x01\n\x0cListAnalyses\x12-.google.cloud.visionai.v1.ListAnalysesRequest\x1a..google.cloud.visionai.v1.ListAnalysesResponse\"H\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x39\x12\x37/v1/{parent=projects/*/locations/*/clusters/*}/analyses\x12\xa7\x01\n\x0bGetAnalysis\x12,.google.cloud.visionai.v1.GetAnalysisRequest\x1a\".google.cloud.visionai.v1.Analysis\"F\xda\x41\x04name\x82\xd3\xe4\x93\x02\x39\x12\x37/v1/{name=projects/*/locations/*/clusters/*/analyses/*}\x12\xea\x01\n\x0e\x43reateAnalysis\x12/.google.cloud.visionai.v1.CreateAnalysisRequest\x1a\x1d.google.longrunning.Operation\"\x87\x01\xca\x41\x1d\n\x08\x41nalysis\x12\x11OperationMetadata\xda\x41\x1bparent,analysis,analysis_id\x82\xd3\xe4\x93\x02\x43\"7/v1/{parent=projects/*/locations/*/clusters/*}/analyses:\x08\x61nalysis\x12\xec\x01\n\x0eUpdateAnalysis\x12/.google.cloud.visionai.v1.UpdateAnalysisRequest\x1a\x1d.google.longrunning.Operation\"\x89\x01\xca\x41\x1d\n\x08\x41nalysis\x12\x11OperationMetadata\xda\x41\x14\x61nalysis,update_mask\x82\xd3\xe4\x93\x02L2@/v1/{analysis.name=projects/*/locations/*/clusters/*/analyses/*}:\x08\x61nalysis\x12\xd5\x01\n\x0e\x44\x65leteAnalysis\x12/.google.cloud.visionai.v1.DeleteAnalysisRequest\x1a\x1d.google.longrunning.Operation\"s\xca\x41*\n\x15google.protobuf.Empty\x12\x11OperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02\x39*7/v1/{name=projects/*/locations/*/clusters/*/analyses/*}\x12\xbb\x01\n\rListProcesses\x12..google.cloud.visionai.v1.ListProcessesRequest\x1a/.google.cloud.visionai.v1.ListProcessesResponse\"I\xda\x41\x06parent\x82\xd3\xe4\x93\x02:\x12\x38/v1/{parent=projects/*/locations/*/clusters/*}/processes\x12\xa5\x01\n\nGetProcess\x12+.google.cloud.visionai.v1.GetProcessRequest\x1a!.google.cloud.visionai.v1.Process\"G\xda\x41\x04name\x82\xd3\xe4\x93\x02:\x12\x38/v1/{name=projects/*/locations/*/clusters/*/processes/*}\x12\xe5\x01\n\rCreateProcess\x12..google.cloud.visionai.v1.CreateProcessRequest\x1a\x1d.google.longrunning.Operation\"\x84\x01\xca\x41\x1c\n\x07Process\x12\x11OperationMetadata\xda\x41\x19parent,process,process_id\x82\xd3\xe4\x93\x02\x43\"8/v1/{parent=projects/*/locations/*/clusters/*}/processes:\x07process\x12\xe7\x01\n\rUpdateProcess\x12..google.cloud.visionai.v1.UpdateProcessRequest\x1a\x1d.google.longrunning.Operation\"\x86\x01\xca\x41\x1c\n\x07Process\x12\x11OperationMetadata\xda\x41\x13process,update_mask\x82\xd3\xe4\x93\x02K2@/v1/{process.name=projects/*/locations/*/clusters/*/processes/*}:\x07process\x12\xd4\x01\n\rDeleteProcess\x12..google.cloud.visionai.v1.DeleteProcessRequest\x1a\x1d.google.longrunning.Operation\"t\xca\x41*\n\x15google.protobuf.Empty\x12\x11OperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02:*8/v1/{name=projects/*/locations/*/clusters/*/processes/*}\x12\xf2\x01\n\x0f\x42\x61tchRunProcess\x12\x30.google.cloud.visionai.v1.BatchRunProcessRequest\x1a\x1d.google.longrunning.Operation\"\x8d\x01\xca\x41,\n\x17\x42\x61tchRunProcessResponse\x12\x11OperationMetadata\xda\x41\x0fparent,requests\x82\xd3\xe4\x93\x02\x46\"A/v1/{parent=projects/*/locations/*/clusters/*}/processes:batchRun:\x01*\x1aK\xca\x41\x17visionai.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\xbf\x01\n\x1c\x63om.google.cloud.visionai.v1B\x0fLvaServiceProtoP\x01Z8cloud.google.com/go/visionai/apiv1/visionaipb;visionaipb\xaa\x02\x18Google.Cloud.VisionAI.V1\xca\x02\x18Google\\Cloud\\VisionAI\\V1\xea\x02\x1bGoogle::Cloud::VisionAI::V1b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module VisionAI + module V1 + ListOperatorsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.ListOperatorsRequest").msgclass + ListOperatorsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.ListOperatorsResponse").msgclass + GetOperatorRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.GetOperatorRequest").msgclass + CreateOperatorRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.CreateOperatorRequest").msgclass + UpdateOperatorRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.UpdateOperatorRequest").msgclass + DeleteOperatorRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.DeleteOperatorRequest").msgclass + ListAnalysesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.ListAnalysesRequest").msgclass + ListAnalysesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.ListAnalysesResponse").msgclass + GetAnalysisRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.GetAnalysisRequest").msgclass + CreateAnalysisRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.CreateAnalysisRequest").msgclass + UpdateAnalysisRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.UpdateAnalysisRequest").msgclass + DeleteAnalysisRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.DeleteAnalysisRequest").msgclass + ListProcessesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.ListProcessesRequest").msgclass + ListProcessesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.ListProcessesResponse").msgclass + GetProcessRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.GetProcessRequest").msgclass + CreateProcessRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.CreateProcessRequest").msgclass + UpdateProcessRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.UpdateProcessRequest").msgclass + DeleteProcessRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.DeleteProcessRequest").msgclass + BatchRunProcessRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.BatchRunProcessRequest").msgclass + BatchRunProcessRequest::BatchRunProcessOptions = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.BatchRunProcessRequest.BatchRunProcessOptions").msgclass + BatchRunProcessResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.BatchRunProcessResponse").msgclass + ResolveOperatorInfoRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.ResolveOperatorInfoRequest").msgclass + OperatorQuery = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.OperatorQuery").msgclass + ResolveOperatorInfoResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.ResolveOperatorInfoResponse").msgclass + ListPublicOperatorsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.ListPublicOperatorsRequest").msgclass + ListPublicOperatorsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.ListPublicOperatorsResponse").msgclass + Registry = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.Registry").enummodule + end + end + end +end diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/visionai/v1/lva_service_services_pb.rb b/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/visionai/v1/lva_service_services_pb.rb new file mode 100644 index 000000000000..8e46c7a1a22d --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/visionai/v1/lva_service_services_pb.rb @@ -0,0 +1,81 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/cloud/visionai/v1/lva_service.proto for package 'Google.Cloud.VisionAI.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/visionai/v1/lva_service_pb' + +module Google + module Cloud + module VisionAI + module V1 + module LiveVideoAnalytics + # Service describing handlers for resources. The service enables clients to run + # Live Video Analytics (LVA) on the streaming inputs. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.cloud.visionai.v1.LiveVideoAnalytics' + + # ListPublicOperators returns all the operators in public registry. + rpc :ListPublicOperators, ::Google::Cloud::VisionAI::V1::ListPublicOperatorsRequest, ::Google::Cloud::VisionAI::V1::ListPublicOperatorsResponse + # ResolveOperatorInfo returns the operator information based on the request. + rpc :ResolveOperatorInfo, ::Google::Cloud::VisionAI::V1::ResolveOperatorInfoRequest, ::Google::Cloud::VisionAI::V1::ResolveOperatorInfoResponse + # Lists Operators in a given project and location. + rpc :ListOperators, ::Google::Cloud::VisionAI::V1::ListOperatorsRequest, ::Google::Cloud::VisionAI::V1::ListOperatorsResponse + # Gets details of a single Operator. + rpc :GetOperator, ::Google::Cloud::VisionAI::V1::GetOperatorRequest, ::Google::Cloud::VisionAI::V1::Operator + # Creates a new Operator in a given project and location. + rpc :CreateOperator, ::Google::Cloud::VisionAI::V1::CreateOperatorRequest, ::Google::Longrunning::Operation + # Updates the parameters of a single Operator. + rpc :UpdateOperator, ::Google::Cloud::VisionAI::V1::UpdateOperatorRequest, ::Google::Longrunning::Operation + # Deletes a single Operator. + rpc :DeleteOperator, ::Google::Cloud::VisionAI::V1::DeleteOperatorRequest, ::Google::Longrunning::Operation + # Lists Analyses in a given project and location. + rpc :ListAnalyses, ::Google::Cloud::VisionAI::V1::ListAnalysesRequest, ::Google::Cloud::VisionAI::V1::ListAnalysesResponse + # Gets details of a single Analysis. + rpc :GetAnalysis, ::Google::Cloud::VisionAI::V1::GetAnalysisRequest, ::Google::Cloud::VisionAI::V1::Analysis + # Creates a new Analysis in a given project and location. + rpc :CreateAnalysis, ::Google::Cloud::VisionAI::V1::CreateAnalysisRequest, ::Google::Longrunning::Operation + # Updates the parameters of a single Analysis. + rpc :UpdateAnalysis, ::Google::Cloud::VisionAI::V1::UpdateAnalysisRequest, ::Google::Longrunning::Operation + # Deletes a single Analysis. + rpc :DeleteAnalysis, ::Google::Cloud::VisionAI::V1::DeleteAnalysisRequest, ::Google::Longrunning::Operation + # Lists Processes in a given project and location. + rpc :ListProcesses, ::Google::Cloud::VisionAI::V1::ListProcessesRequest, ::Google::Cloud::VisionAI::V1::ListProcessesResponse + # Gets details of a single Process. + rpc :GetProcess, ::Google::Cloud::VisionAI::V1::GetProcessRequest, ::Google::Cloud::VisionAI::V1::Process + # Creates a new Process in a given project and location. + rpc :CreateProcess, ::Google::Cloud::VisionAI::V1::CreateProcessRequest, ::Google::Longrunning::Operation + # Updates the parameters of a single Process. + rpc :UpdateProcess, ::Google::Cloud::VisionAI::V1::UpdateProcessRequest, ::Google::Longrunning::Operation + # Deletes a single Process. + rpc :DeleteProcess, ::Google::Cloud::VisionAI::V1::DeleteProcessRequest, ::Google::Longrunning::Operation + # Run all of the processes to "completion". Max time for each process is + # the LRO time limit. + rpc :BatchRunProcess, ::Google::Cloud::VisionAI::V1::BatchRunProcessRequest, ::Google::Longrunning::Operation + end + + Stub = Service.rpc_stub_class + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/visionai/v1/platform_pb.rb b/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/visionai/v1/platform_pb.rb new file mode 100644 index 000000000000..0e9ac5832d5b --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/visionai/v1/platform_pb.rb @@ -0,0 +1,135 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/visionai/v1/platform.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/visionai/v1/annotations_pb' +require 'google/cloud/visionai/v1/common_pb' +require 'google/longrunning/operations_pb' +require 'google/protobuf/duration_pb' +require 'google/protobuf/empty_pb' +require 'google/protobuf/field_mask_pb' +require 'google/protobuf/struct_pb' +require 'google/protobuf/timestamp_pb' + + +descriptor_data = "\n\'google/cloud/visionai/v1/platform.proto\x12\x18google.cloud.visionai.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/visionai/v1/annotations.proto\x1a%google/cloud/visionai/v1/common.proto\x1a#google/longrunning/operations.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\x1a\x1cgoogle/protobuf/struct.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"$\n\"DeleteApplicationInstancesResponse\"$\n\"CreateApplicationInstancesResponse\"$\n\"UpdateApplicationInstancesResponse\"\xca\x01\n!CreateApplicationInstancesRequest\x12\x39\n\x04name\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\n#visionai.googleapis.com/Application\x12Q\n\x15\x61pplication_instances\x18\x02 \x03(\x0b\x32-.google.cloud.visionai.v1.ApplicationInstanceB\x03\xe0\x41\x02\x12\x17\n\nrequest_id\x18\x04 \x01(\tB\x03\xe0\x41\x01\"\xb7\x01\n!DeleteApplicationInstancesRequest\x12\x39\n\x04name\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\n#visionai.googleapis.com/Application\x12>\n\x0cinstance_ids\x18\x02 \x03(\tB(\xe0\x41\x02\xfa\x41\"\n visionai.googleapis.com/Instance\x12\x17\n\nrequest_id\x18\x03 \x01(\tB\x03\xe0\x41\x01\"\x1b\n\x19\x44\x65ployApplicationResponse\"\x1d\n\x1bUndeployApplicationResponse\"&\n$RemoveApplicationStreamInputResponse\"#\n!AddApplicationStreamInputResponse\"&\n$UpdateApplicationStreamInputResponse\"\x9f\x01\n\x17ListApplicationsRequest\x12;\n\x06parent\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\x12#visionai.googleapis.com/Application\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\x12\x0e\n\x06\x66ilter\x18\x04 \x01(\t\x12\x10\n\x08order_by\x18\x05 \x01(\t\"\x85\x01\n\x18ListApplicationsResponse\x12;\n\x0c\x61pplications\x18\x01 \x03(\x0b\x32%.google.cloud.visionai.v1.Application\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x13\n\x0bunreachable\x18\x03 \x03(\t\"R\n\x15GetApplicationRequest\x12\x39\n\x04name\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\n#visionai.googleapis.com/Application\"\xce\x01\n\x18\x43reateApplicationRequest\x12;\n\x06parent\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\x12#visionai.googleapis.com/Application\x12\x1b\n\x0e\x61pplication_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12?\n\x0b\x61pplication\x18\x03 \x01(\x0b\x32%.google.cloud.visionai.v1.ApplicationB\x03\xe0\x41\x02\x12\x17\n\nrequest_id\x18\x04 \x01(\tB\x03\xe0\x41\x01\"\xaa\x01\n\x18UpdateApplicationRequest\x12\x34\n\x0bupdate_mask\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x01\x12?\n\x0b\x61pplication\x18\x02 \x01(\x0b\x32%.google.cloud.visionai.v1.ApplicationB\x03\xe0\x41\x02\x12\x17\n\nrequest_id\x18\x03 \x01(\tB\x03\xe0\x41\x01\"\x82\x01\n\x18\x44\x65leteApplicationRequest\x12\x39\n\x04name\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\n#visionai.googleapis.com/Application\x12\x17\n\nrequest_id\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x12\n\x05\x66orce\x18\x03 \x01(\x08\x42\x03\xe0\x41\x01\"\xa5\x01\n\x18\x44\x65ployApplicationRequest\x12\x39\n\x04name\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\n#visionai.googleapis.com/Application\x12\x15\n\rvalidate_only\x18\x02 \x01(\x08\x12\x17\n\nrequest_id\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12\x1e\n\x11\x65nable_monitoring\x18\x04 \x01(\x08\x42\x03\xe0\x41\x01\"p\n\x1aUndeployApplicationRequest\x12\x39\n\x04name\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\n#visionai.googleapis.com/Application\x12\x17\n\nrequest_id\x18\x02 \x01(\tB\x03\xe0\x41\x01\"h\n\x16\x41pplicationStreamInput\x12N\n\x16stream_with_annotation\x18\x01 \x01(\x0b\x32..google.cloud.visionai.v1.StreamWithAnnotation\"\xcb\x01\n AddApplicationStreamInputRequest\x12\x39\n\x04name\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\n#visionai.googleapis.com/Application\x12S\n\x19\x61pplication_stream_inputs\x18\x02 \x03(\x0b\x32\x30.google.cloud.visionai.v1.ApplicationStreamInput\x12\x17\n\nrequest_id\x18\x03 \x01(\tB\x03\xe0\x41\x01\"\xe5\x01\n#UpdateApplicationStreamInputRequest\x12\x39\n\x04name\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\n#visionai.googleapis.com/Application\x12S\n\x19\x61pplication_stream_inputs\x18\x02 \x03(\x0b\x32\x30.google.cloud.visionai.v1.ApplicationStreamInput\x12\x17\n\nrequest_id\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12\x15\n\rallow_missing\x18\x04 \x01(\x08\"\xb2\x02\n#RemoveApplicationStreamInputRequest\x12\x39\n\x04name\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\n#visionai.googleapis.com/Application\x12m\n\x14target_stream_inputs\x18\x02 \x03(\x0b\x32O.google.cloud.visionai.v1.RemoveApplicationStreamInputRequest.TargetStreamInput\x12\x17\n\nrequest_id\x18\x03 \x01(\tB\x03\xe0\x41\x01\x1aH\n\x11TargetStreamInput\x12\x33\n\x06stream\x18\x01 \x01(\tB#\xfa\x41 \n\x1evisionai.googleapis.com/Stream\"\x99\x01\n\x14ListInstancesRequest\x12\x38\n\x06parent\x18\x01 \x01(\tB(\xe0\x41\x02\xfa\x41\"\x12 visionai.googleapis.com/Instance\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\x12\x0e\n\x06\x66ilter\x18\x04 \x01(\t\x12\x10\n\x08order_by\x18\x05 \x01(\t\"|\n\x15ListInstancesResponse\x12\x35\n\tinstances\x18\x01 \x03(\x0b\x32\".google.cloud.visionai.v1.Instance\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x13\n\x0bunreachable\x18\x03 \x03(\t\"L\n\x12GetInstanceRequest\x12\x36\n\x04name\x18\x01 \x01(\tB(\xe0\x41\x02\xfa\x41\"\n visionai.googleapis.com/Instance\"\x93\x01\n\x11ListDraftsRequest\x12\x35\n\x06parent\x18\x01 \x01(\tB%\xe0\x41\x02\xfa\x41\x1f\x12\x1dvisionai.googleapis.com/Draft\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\x12\x0e\n\x06\x66ilter\x18\x04 \x01(\t\x12\x10\n\x08order_by\x18\x05 \x01(\t\"s\n\x12ListDraftsResponse\x12/\n\x06\x64rafts\x18\x01 \x03(\x0b\x32\x1f.google.cloud.visionai.v1.Draft\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x13\n\x0bunreachable\x18\x03 \x03(\t\"F\n\x0fGetDraftRequest\x12\x33\n\x04name\x18\x01 \x01(\tB%\xe0\x41\x02\xfa\x41\x1f\n\x1dvisionai.googleapis.com/Draft\"\xb0\x01\n\x12\x43reateDraftRequest\x12\x35\n\x06parent\x18\x01 \x01(\tB%\xe0\x41\x02\xfa\x41\x1f\x12\x1dvisionai.googleapis.com/Draft\x12\x15\n\x08\x64raft_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x33\n\x05\x64raft\x18\x03 \x01(\x0b\x32\x1f.google.cloud.visionai.v1.DraftB\x03\xe0\x41\x02\x12\x17\n\nrequest_id\x18\x04 \x01(\tB\x03\xe0\x41\x01\"\xaf\x01\n\x12UpdateDraftRequest\x12\x34\n\x0bupdate_mask\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x01\x12\x33\n\x05\x64raft\x18\x02 \x01(\x0b\x32\x1f.google.cloud.visionai.v1.DraftB\x03\xe0\x41\x02\x12\x17\n\nrequest_id\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12\x15\n\rallow_missing\x18\x04 \x01(\x08\"\xad\x03\n!UpdateApplicationInstancesRequest\x12\x39\n\x04name\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\n#visionai.googleapis.com/Application\x12t\n\x15\x61pplication_instances\x18\x02 \x03(\x0b\x32U.google.cloud.visionai.v1.UpdateApplicationInstancesRequest.UpdateApplicationInstance\x12\x17\n\nrequest_id\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12\x15\n\rallow_missing\x18\x04 \x01(\x08\x1a\xa6\x01\n\x19UpdateApplicationInstance\x12\x34\n\x0bupdate_mask\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x01\x12\x39\n\x08instance\x18\x02 \x01(\x0b\x32\".google.cloud.visionai.v1.InstanceB\x03\xe0\x41\x02\x12\x18\n\x0binstance_id\x18\x03 \x01(\tB\x03\xe0\x41\x02\"b\n\x12\x44\x65leteDraftRequest\x12\x33\n\x04name\x18\x01 \x01(\tB%\xe0\x41\x02\xfa\x41\x1f\n\x1dvisionai.googleapis.com/Draft\x12\x17\n\nrequest_id\x18\x02 \x01(\tB\x03\xe0\x41\x01\"\x9b\x01\n\x15ListProcessorsRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\x12!visionai.googleapis.com/Processor\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\x12\x0e\n\x06\x66ilter\x18\x04 \x01(\t\x12\x10\n\x08order_by\x18\x05 \x01(\t\"\x7f\n\x16ListProcessorsResponse\x12\x37\n\nprocessors\x18\x01 \x03(\x0b\x32#.google.cloud.visionai.v1.Processor\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x13\n\x0bunreachable\x18\x03 \x03(\t\"Z\n\x1dListPrebuiltProcessorsRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\x12!visionai.googleapis.com/Processor\"Y\n\x1eListPrebuiltProcessorsResponse\x12\x37\n\nprocessors\x18\x01 \x03(\x0b\x32#.google.cloud.visionai.v1.Processor\"N\n\x13GetProcessorRequest\x12\x37\n\x04name\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!visionai.googleapis.com/Processor\"\xc4\x01\n\x16\x43reateProcessorRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\x12!visionai.googleapis.com/Processor\x12\x19\n\x0cprocessor_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12;\n\tprocessor\x18\x03 \x01(\x0b\x32#.google.cloud.visionai.v1.ProcessorB\x03\xe0\x41\x02\x12\x17\n\nrequest_id\x18\x04 \x01(\tB\x03\xe0\x41\x01\"\xa4\x01\n\x16UpdateProcessorRequest\x12\x34\n\x0bupdate_mask\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x01\x12;\n\tprocessor\x18\x02 \x01(\x0b\x32#.google.cloud.visionai.v1.ProcessorB\x03\xe0\x41\x02\x12\x17\n\nrequest_id\x18\x03 \x01(\tB\x03\xe0\x41\x01\"j\n\x16\x44\x65leteProcessorRequest\x12\x37\n\x04name\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!visionai.googleapis.com/Processor\x12\x17\n\nrequest_id\x18\x02 \x01(\tB\x03\xe0\x41\x01\"\xda\n\n\x0b\x41pplication\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x34\n\x0b\x63reate_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x41\n\x06labels\x18\x04 \x03(\x0b\x32\x31.google.cloud.visionai.v1.Application.LabelsEntry\x12\x19\n\x0c\x64isplay_name\x18\x05 \x01(\tB\x03\xe0\x41\x02\x12\x13\n\x0b\x64\x65scription\x18\x06 \x01(\t\x12I\n\x13\x61pplication_configs\x18\x07 \x01(\x0b\x32,.google.cloud.visionai.v1.ApplicationConfigs\x12W\n\x0cruntime_info\x18\x08 \x01(\x0b\x32<.google.cloud.visionai.v1.Application.ApplicationRuntimeInfoB\x03\xe0\x41\x03\x12?\n\x05state\x18\t \x01(\x0e\x32+.google.cloud.visionai.v1.Application.StateB\x03\xe0\x41\x03\x12G\n\x0c\x62illing_mode\x18\x0c \x01(\x0e\x32\x31.google.cloud.visionai.v1.Application.BillingMode\x1a\xa1\x03\n\x16\x41pplicationRuntimeInfo\x12/\n\x0b\x64\x65ploy_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12r\n\x17global_output_resources\x18\x03 \x03(\x0b\x32Q.google.cloud.visionai.v1.Application.ApplicationRuntimeInfo.GlobalOutputResource\x12h\n\x11monitoring_config\x18\x04 \x01(\x0b\x32M.google.cloud.visionai.v1.Application.ApplicationRuntimeInfo.MonitoringConfig\x1aS\n\x14GlobalOutputResource\x12\x17\n\x0foutput_resource\x18\x01 \x01(\t\x12\x15\n\rproducer_node\x18\x02 \x01(\t\x12\x0b\n\x03key\x18\x03 \x01(\t\x1a#\n\x10MonitoringConfig\x12\x0f\n\x07\x65nabled\x18\x01 \x01(\x08\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\xa7\x01\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0b\n\x07\x43REATED\x10\x01\x12\r\n\tDEPLOYING\x10\x02\x12\x0c\n\x08\x44\x45PLOYED\x10\x03\x12\x0f\n\x0bUNDEPLOYING\x10\x04\x12\x0b\n\x07\x44\x45LETED\x10\x05\x12\t\n\x05\x45RROR\x10\x06\x12\x0c\n\x08\x43REATING\x10\x07\x12\x0c\n\x08UPDATING\x10\x08\x12\x0c\n\x08\x44\x45LETING\x10\t\x12\n\n\x06\x46IXING\x10\n\"B\n\x0b\x42illingMode\x12\x1c\n\x18\x42ILLING_MODE_UNSPECIFIED\x10\x00\x12\x08\n\x04PAYG\x10\x01\x12\x0b\n\x07MONTHLY\x10\x02:o\xea\x41l\n#visionai.googleapis.com/Application\x12\x42projects/{project}/locations/{location}/applications/{application}R\x01\x01\"\x8a\x02\n\x12\x41pplicationConfigs\x12-\n\x05nodes\x18\x01 \x03(\x0b\x32\x1e.google.cloud.visionai.v1.Node\x12_\n\x15\x65vent_delivery_config\x18\x03 \x01(\x0b\x32@.google.cloud.visionai.v1.ApplicationConfigs.EventDeliveryConfig\x1a\x64\n\x13\x45ventDeliveryConfig\x12\x0f\n\x07\x63hannel\x18\x01 \x01(\t\x12<\n\x19minimal_delivery_interval\x18\x02 \x01(\x0b\x32\x19.google.protobuf.Duration\"\xe7\x02\n\x04Node\x12.\n$output_all_output_channels_to_stream\x18\x06 \x01(\x08H\x00\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x14\n\x0c\x64isplay_name\x18\x02 \x01(\t\x12>\n\x0bnode_config\x18\x03 \x01(\x0b\x32).google.cloud.visionai.v1.ProcessorConfig\x12\x11\n\tprocessor\x18\x04 \x01(\t\x12\x39\n\x07parents\x18\x05 \x03(\x0b\x32(.google.cloud.visionai.v1.Node.InputEdge\x1a`\n\tInputEdge\x12\x13\n\x0bparent_node\x18\x01 \x01(\t\x12\x1d\n\x15parent_output_channel\x18\x02 \x01(\t\x12\x1f\n\x17\x63onnected_input_channel\x18\x03 \x01(\tB\x16\n\x14stream_output_config\"\xe8\x03\n\x05\x44raft\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x34\n\x0b\x63reate_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12;\n\x06labels\x18\x03 \x03(\x0b\x32+.google.cloud.visionai.v1.Draft.LabelsEntry\x12\x19\n\x0c\x64isplay_name\x18\x04 \x01(\tB\x03\xe0\x41\x02\x12\x13\n\x0b\x64\x65scription\x18\x05 \x01(\t\x12O\n\x19\x64raft_application_configs\x18\x06 \x01(\x0b\x32,.google.cloud.visionai.v1.ApplicationConfigs\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01:x\xea\x41u\n\x1dvisionai.googleapis.com/Draft\x12Qprojects/{project}/locations/{location}/applications/{application}/drafts/{draft}R\x01\x01\"\xd4\x0b\n\x08Instance\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\x12\x34\n\x0bupdate_time\x18\x08 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12>\n\x06labels\x18\x03 \x03(\x0b\x32..google.cloud.visionai.v1.Instance.LabelsEntry\x12\x19\n\x0c\x64isplay_name\x18\x04 \x01(\tB\x03\xe0\x41\x02\x12\x13\n\x0b\x64\x65scription\x18\x05 \x01(\t\x12\x46\n\rinstance_type\x18\n \x01(\x0e\x32/.google.cloud.visionai.v1.Instance.InstanceType\x12I\n\x0finput_resources\x18\x06 \x03(\x0b\x32\x30.google.cloud.visionai.v1.Instance.InputResource\x12K\n\x10output_resources\x18\x07 \x03(\x0b\x32\x31.google.cloud.visionai.v1.Instance.OutputResource\x12\x37\n\x05state\x18\t \x01(\x0e\x32(.google.cloud.visionai.v1.Instance.State\x1a\xc9\x02\n\rInputResource\x12\x18\n\x0einput_resource\x18\x01 \x01(\tH\x00\x12N\n\x10\x61nnotated_stream\x18\x04 \x01(\x0b\x32..google.cloud.visionai.v1.StreamWithAnnotationB\x02\x18\x01H\x00\x12\x35\n\tdata_type\x18\x06 \x01(\x0e\x32\".google.cloud.visionai.v1.DataType\x12\x15\n\rconsumer_node\x18\x02 \x01(\t\x12\x1e\n\x16input_resource_binding\x18\x03 \x01(\t\x12\x42\n\x0b\x61nnotations\x18\x05 \x01(\x0b\x32-.google.cloud.visionai.v1.ResourceAnnotationsB\x1c\n\x1ainput_resource_information\x1a\x92\x01\n\x0eOutputResource\x12\x17\n\x0foutput_resource\x18\x01 \x01(\t\x12\x15\n\rproducer_node\x18\x02 \x01(\t\x12\x1f\n\x17output_resource_binding\x18\x04 \x01(\t\x12\x19\n\x0cis_temporary\x18\x03 \x01(\x08\x42\x03\xe0\x41\x03\x12\x14\n\x07\x61utogen\x18\x05 \x01(\x08\x42\x03\xe0\x41\x03\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"t\n\x0cInstanceType\x12\x1d\n\x19INSTANCE_TYPE_UNSPECIFIED\x10\x00\x12\x18\n\x14STREAMING_PREDICTION\x10\x01\x12\x14\n\x10\x42\x41TCH_PREDICTION\x10\x02\x12\x15\n\x11ONLINE_PREDICTION\x10\x03\"\xb5\x01\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0c\n\x08\x43REATING\x10\x01\x12\x0b\n\x07\x43REATED\x10\x02\x12\r\n\tDEPLOYING\x10\x03\x12\x0c\n\x08\x44\x45PLOYED\x10\x04\x12\x0f\n\x0bUNDEPLOYING\x10\x05\x12\x0b\n\x07\x44\x45LETED\x10\x06\x12\t\n\x05\x45RROR\x10\x07\x12\x0c\n\x08UPDATING\x10\x08\x12\x0c\n\x08\x44\x45LETING\x10\t\x12\n\n\x06\x46IXING\x10\n\x12\x0c\n\x08\x46INISHED\x10\x0b:\x81\x01\xea\x41~\n visionai.googleapis.com/Instance\x12Wprojects/{project}/locations/{location}/applications/{application}/instances/{instance}R\x01\x01\"j\n\x13\x41pplicationInstance\x12\x18\n\x0binstance_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x39\n\x08instance\x18\x02 \x01(\x0b\x32\".google.cloud.visionai.v1.InstanceB\x03\xe0\x41\x02\"\xbc\t\n\tProcessor\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x34\n\x0b\x63reate_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12?\n\x06labels\x18\x04 \x03(\x0b\x32/.google.cloud.visionai.v1.Processor.LabelsEntry\x12\x19\n\x0c\x64isplay_name\x18\x05 \x01(\tB\x03\xe0\x41\x02\x12\x13\n\x0b\x64\x65scription\x18\n \x01(\t\x12N\n\x0eprocessor_type\x18\x06 \x01(\x0e\x32\x31.google.cloud.visionai.v1.Processor.ProcessorTypeB\x03\xe0\x41\x03\x12\x37\n\nmodel_type\x18\r \x01(\x0e\x32#.google.cloud.visionai.v1.ModelType\x12Y\n\x1c\x63ustom_processor_source_info\x18\x07 \x01(\x0b\x32\x33.google.cloud.visionai.v1.CustomProcessorSourceInfo\x12\x46\n\x05state\x18\x08 \x01(\x0e\x32\x32.google.cloud.visionai.v1.Processor.ProcessorStateB\x03\xe0\x41\x03\x12I\n\x11processor_io_spec\x18\x0b \x01(\x0b\x32).google.cloud.visionai.v1.ProcessorIOSpecB\x03\xe0\x41\x03\x12\"\n\x15\x63onfiguration_typeurl\x18\x0e \x01(\tB\x03\xe0\x41\x03\x12W\n\x1asupported_annotation_types\x18\x0f \x03(\x0e\x32..google.cloud.visionai.v1.StreamAnnotationTypeB\x03\xe0\x41\x03\x12 \n\x18supports_post_processing\x18\x11 \x01(\x08\x12Q\n\x18supported_instance_types\x18\x12 \x03(\x0e\x32/.google.cloud.visionai.v1.Instance.InstanceType\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"Z\n\rProcessorType\x12\x1e\n\x1aPROCESSOR_TYPE_UNSPECIFIED\x10\x00\x12\x0e\n\nPRETRAINED\x10\x01\x12\n\n\x06\x43USTOM\x10\x02\x12\r\n\tCONNECTOR\x10\x03\"e\n\x0eProcessorState\x12\x1f\n\x1bPROCESSOR_STATE_UNSPECIFIED\x10\x00\x12\x0c\n\x08\x43REATING\x10\x01\x12\n\n\x06\x41\x43TIVE\x10\x02\x12\x0c\n\x08\x44\x45LETING\x10\x03\x12\n\n\x06\x46\x41ILED\x10\x04:i\xea\x41\x66\n!visionai.googleapis.com/Processor\x12>projects/{project}/locations/{location}/processors/{processor}R\x01\x01\"\xd6\x07\n\x0fProcessorIOSpec\x12\x62\n\x19graph_input_channel_specs\x18\x03 \x03(\x0b\x32?.google.cloud.visionai.v1.ProcessorIOSpec.GraphInputChannelSpec\x12\x64\n\x1agraph_output_channel_specs\x18\x04 \x03(\x0b\x32@.google.cloud.visionai.v1.ProcessorIOSpec.GraphOutputChannelSpec\x12y\n%instance_resource_input_binding_specs\x18\x05 \x03(\x0b\x32J.google.cloud.visionai.v1.ProcessorIOSpec.InstanceResourceInputBindingSpec\x12{\n&instance_resource_output_binding_specs\x18\x06 \x03(\x0b\x32K.google.cloud.visionai.v1.ProcessorIOSpec.InstanceResourceOutputBindingSpec\x1a\xaf\x01\n\x15GraphInputChannelSpec\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x35\n\tdata_type\x18\x02 \x01(\x0e\x32\".google.cloud.visionai.v1.DataType\x12\x1f\n\x17\x61\x63\x63\x65pted_data_type_uris\x18\x05 \x03(\t\x12\x10\n\x08required\x18\x03 \x01(\x08\x12\x1e\n\x16max_connection_allowed\x18\x04 \x01(\x03\x1at\n\x16GraphOutputChannelSpec\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x35\n\tdata_type\x18\x02 \x01(\x0e\x32\".google.cloud.visionai.v1.DataType\x12\x15\n\rdata_type_uri\x18\x03 \x01(\t\x1ay\n InstanceResourceInputBindingSpec\x12\x19\n\x0f\x63onfig_type_uri\x18\x02 \x01(\tH\x00\x12\x1b\n\x11resource_type_uri\x18\x03 \x01(\tH\x00\x12\x0c\n\x04name\x18\x01 \x01(\tB\x0f\n\rresource_type\x1a^\n!InstanceResourceOutputBindingSpec\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x19\n\x11resource_type_uri\x18\x02 \x01(\t\x12\x10\n\x08\x65xplicit\x18\x03 \x01(\x08\"\xa4\x07\n\x19\x43ustomProcessorSourceInfo\x12\x16\n\x0cvertex_model\x18\x02 \x01(\tH\x00\x12t\n\x1bproduct_recognizer_artifact\x18\x03 \x01(\x0b\x32M.google.cloud.visionai.v1.CustomProcessorSourceInfo.ProductRecognizerArtifactH\x00\x12S\n\x0bsource_type\x18\x01 \x01(\x0e\x32>.google.cloud.visionai.v1.CustomProcessorSourceInfo.SourceType\x12\x65\n\x0f\x61\x64\x64itional_info\x18\x04 \x03(\x0b\x32G.google.cloud.visionai.v1.CustomProcessorSourceInfo.AdditionalInfoEntryB\x03\xe0\x41\x03\x12U\n\x0cmodel_schema\x18\x05 \x01(\x0b\x32?.google.cloud.visionai.v1.CustomProcessorSourceInfo.ModelSchema\x1a\x65\n\x19ProductRecognizerArtifact\x12-\n retail_product_recognition_index\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x19\n\x0cvertex_model\x18\x02 \x01(\tB\x03\xe0\x41\x01\x1a\xcd\x01\n\x0bModelSchema\x12=\n\x10instances_schema\x18\x01 \x01(\x0b\x32#.google.cloud.visionai.v1.GcsSource\x12>\n\x11parameters_schema\x18\x02 \x01(\x0b\x32#.google.cloud.visionai.v1.GcsSource\x12?\n\x12predictions_schema\x18\x03 \x01(\x0b\x32#.google.cloud.visionai.v1.GcsSource\x1a\x35\n\x13\x41\x64\x64itionalInfoEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"g\n\nSourceType\x12\x1b\n\x17SOURCE_TYPE_UNSPECIFIED\x10\x00\x12\x11\n\rVERTEX_AUTOML\x10\x01\x12\x11\n\rVERTEX_CUSTOM\x10\x02\x12\x16\n\x12PRODUCT_RECOGNIZER\x10\x03\x42\x0f\n\rartifact_path\"\xd2\x0b\n\x0fProcessorConfig\x12U\n\x19video_stream_input_config\x18\t \x01(\x0b\x32\x30.google.cloud.visionai.v1.VideoStreamInputConfigH\x00\x12`\n\x1f\x61i_enabled_devices_input_config\x18\x14 \x01(\x0b\x32\x35.google.cloud.visionai.v1.AIEnabledDevicesInputConfigH\x00\x12P\n\x16media_warehouse_config\x18\n \x01(\x0b\x32..google.cloud.visionai.v1.MediaWarehouseConfigH\x00\x12H\n\x12person_blur_config\x18\x0b \x01(\x0b\x32*.google.cloud.visionai.v1.PersonBlurConfigH\x00\x12P\n\x16occupancy_count_config\x18\x0c \x01(\x0b\x32..google.cloud.visionai.v1.OccupancyCountConfigH\x00\x12\x61\n\x1fperson_vehicle_detection_config\x18\x0f \x01(\x0b\x32\x36.google.cloud.visionai.v1.PersonVehicleDetectionConfigH\x00\x12Y\n\x1bvertex_automl_vision_config\x18\r \x01(\x0b\x32\x32.google.cloud.visionai.v1.VertexAutoMLVisionConfigH\x00\x12W\n\x1avertex_automl_video_config\x18\x0e \x01(\x0b\x32\x31.google.cloud.visionai.v1.VertexAutoMLVideoConfigH\x00\x12L\n\x14vertex_custom_config\x18\x11 \x01(\x0b\x32,.google.cloud.visionai.v1.VertexCustomConfigH\x00\x12\x61\n\x1fgeneral_object_detection_config\x18\x12 \x01(\x0b\x32\x36.google.cloud.visionai.v1.GeneralObjectDetectionConfigH\x00\x12\x44\n\x10\x62ig_query_config\x18\x13 \x01(\x0b\x32(.google.cloud.visionai.v1.BigQueryConfigH\x00\x12\x46\n\x11gcs_output_config\x18\x1b \x01(\x0b\x32).google.cloud.visionai.v1.GcsOutputConfigH\x00\x12V\n\x19product_recognizer_config\x18\x15 \x01(\x0b\x32\x31.google.cloud.visionai.v1.ProductRecognizerConfigH\x00\x12~\n.personal_protective_equipment_detection_config\x18\x16 \x01(\x0b\x32\x44.google.cloud.visionai.v1.PersonalProtectiveEquipmentDetectionConfigH\x00\x12N\n\x15tag_recognizer_config\x18\x19 \x01(\x0b\x32-.google.cloud.visionai.v1.TagRecognizerConfigH\x00\x12P\n\x16universal_input_config\x18\x1c \x01(\x0b\x32..google.cloud.visionai.v1.UniversalInputConfigH\x00\x12\x34\n\x13\x65xperimental_config\x18\x1a \x01(\x0b\x32\x17.google.protobuf.StructB\x12\n\x10processor_config\"\xd2\x02\n\x14StreamWithAnnotation\x12\x33\n\x06stream\x18\x01 \x01(\tB#\xfa\x41 \n\x1evisionai.googleapis.com/Stream\x12K\n\x17\x61pplication_annotations\x18\x02 \x03(\x0b\x32*.google.cloud.visionai.v1.StreamAnnotation\x12W\n\x10node_annotations\x18\x03 \x03(\x0b\x32=.google.cloud.visionai.v1.StreamWithAnnotation.NodeAnnotation\x1a_\n\x0eNodeAnnotation\x12\x0c\n\x04node\x18\x01 \x01(\t\x12?\n\x0b\x61nnotations\x18\x02 \x03(\x0b\x32*.google.cloud.visionai.v1.StreamAnnotation\"j\n\x19\x41pplicationNodeAnnotation\x12\x0c\n\x04node\x18\x01 \x01(\t\x12?\n\x0b\x61nnotations\x18\x02 \x03(\x0b\x32*.google.cloud.visionai.v1.StreamAnnotation\"\xb1\x01\n\x13ResourceAnnotations\x12K\n\x17\x61pplication_annotations\x18\x01 \x03(\x0b\x32*.google.cloud.visionai.v1.StreamAnnotation\x12M\n\x10node_annotations\x18\x02 \x03(\x0b\x32\x33.google.cloud.visionai.v1.ApplicationNodeAnnotation\"\x82\x01\n\x16VideoStreamInputConfig\x12\x13\n\x07streams\x18\x01 \x03(\tB\x02\x18\x01\x12S\n\x17streams_with_annotation\x18\x02 \x03(\x0b\x32..google.cloud.visionai.v1.StreamWithAnnotationB\x02\x18\x01\"\x1d\n\x1b\x41IEnabledDevicesInputConfig\"b\n\x14MediaWarehouseConfig\x12\x0e\n\x06\x63orpus\x18\x01 \x01(\t\x12\x12\n\x06region\x18\x02 \x01(\tB\x02\x18\x01\x12&\n\x03ttl\x18\x03 \x01(\x0b\x32\x19.google.protobuf.Duration\"\xd5\x01\n\x10PersonBlurConfig\x12S\n\x10person_blur_type\x18\x01 \x01(\x0e\x32\x39.google.cloud.visionai.v1.PersonBlurConfig.PersonBlurType\x12\x12\n\nfaces_only\x18\x02 \x01(\x08\"X\n\x0ePersonBlurType\x12 \n\x1cPERSON_BLUR_TYPE_UNSPECIFIED\x10\x00\x12\x13\n\x0f\x46ULL_OCCULUSION\x10\x01\x12\x0f\n\x0b\x42LUR_FILTER\x10\x02\"~\n\x14OccupancyCountConfig\x12\x1e\n\x16\x65nable_people_counting\x18\x01 \x01(\x08\x12\x1f\n\x17\x65nable_vehicle_counting\x18\x02 \x01(\x08\x12%\n\x1d\x65nable_dwelling_time_tracking\x18\x03 \x01(\x08\"_\n\x1cPersonVehicleDetectionConfig\x12\x1e\n\x16\x65nable_people_counting\x18\x01 \x01(\x08\x12\x1f\n\x17\x65nable_vehicle_counting\x18\x02 \x01(\x08\"\xa5\x01\n*PersonalProtectiveEquipmentDetectionConfig\x12&\n\x1e\x65nable_face_coverage_detection\x18\x01 \x01(\x08\x12&\n\x1e\x65nable_head_coverage_detection\x18\x02 \x01(\x08\x12\'\n\x1f\x65nable_hands_coverage_detection\x18\x03 \x01(\x08\"\x1e\n\x1cGeneralObjectDetectionConfig\"\xec\x01\n\x0e\x42igQueryConfig\x12\r\n\x05table\x18\x01 \x01(\t\x12\x62\n\x16\x63loud_function_mapping\x18\x02 \x03(\x0b\x32\x42.google.cloud.visionai.v1.BigQueryConfig.CloudFunctionMappingEntry\x12*\n\"create_default_table_if_not_exists\x18\x03 \x01(\x08\x1a;\n\x19\x43loudFunctionMappingEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"Q\n\x18VertexAutoMLVisionConfig\x12\x1c\n\x14\x63onfidence_threshold\x18\x01 \x01(\x02\x12\x17\n\x0fmax_predictions\x18\x02 \x01(\x05\"\x89\x01\n\x17VertexAutoMLVideoConfig\x12\x1c\n\x14\x63onfidence_threshold\x18\x01 \x01(\x02\x12\x16\n\x0e\x62locked_labels\x18\x02 \x03(\t\x12\x17\n\x0fmax_predictions\x18\x03 \x01(\x05\x12\x1f\n\x17\x62ounding_box_size_limit\x18\x04 \x01(\x02\"\x95\x02\n\x12VertexCustomConfig\x12\x1a\n\x12max_prediction_fps\x18\x01 \x01(\x05\x12I\n\x13\x64\x65\x64icated_resources\x18\x02 \x01(\x0b\x32,.google.cloud.visionai.v1.DedicatedResources\x12&\n\x1epost_processing_cloud_function\x18\x03 \x01(\t\x12#\n\x1b\x61ttach_application_metadata\x18\x04 \x01(\x08\x12,\n\x1a\x64ynamic_config_input_topic\x18\x06 \x01(\tB\x03\xe0\x41\x01H\x00\x88\x01\x01\x42\x1d\n\x1b_dynamic_config_input_topic\"#\n\x0fGcsOutputConfig\x12\x10\n\x08gcs_path\x18\x01 \x01(\t\"\x16\n\x14UniversalInputConfig\"\x8d\x01\n\x0bMachineSpec\x12\x19\n\x0cmachine_type\x18\x01 \x01(\tB\x03\xe0\x41\x05\x12H\n\x10\x61\x63\x63\x65lerator_type\x18\x02 \x01(\x0e\x32).google.cloud.visionai.v1.AcceleratorTypeB\x03\xe0\x41\x05\x12\x19\n\x11\x61\x63\x63\x65lerator_count\x18\x03 \x01(\x05\"A\n\x15\x41utoscalingMetricSpec\x12\x18\n\x0bmetric_name\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x0e\n\x06target\x18\x02 \x01(\x05\"\xf4\x01\n\x12\x44\x65\x64icatedResources\x12\x43\n\x0cmachine_spec\x18\x01 \x01(\x0b\x32%.google.cloud.visionai.v1.MachineSpecB\x06\xe0\x41\x02\xe0\x41\x05\x12!\n\x11min_replica_count\x18\x02 \x01(\x05\x42\x06\xe0\x41\x02\xe0\x41\x05\x12\x1e\n\x11max_replica_count\x18\x03 \x01(\x05\x42\x03\xe0\x41\x05\x12V\n\x18\x61utoscaling_metric_specs\x18\x04 \x03(\x0b\x32/.google.cloud.visionai.v1.AutoscalingMetricSpecB\x03\xe0\x41\x05\"\\\n\x17ProductRecognizerConfig\x12\x17\n\x0fretail_endpoint\x18\x01 \x01(\t\x12(\n recognition_confidence_threshold\x18\x02 \x01(\x02\"\x8c\x01\n\x13TagRecognizerConfig\x12-\n%entity_detection_confidence_threshold\x18\x01 \x01(\x02\x12\x46\n\x12tag_parsing_config\x18\x02 \x01(\x0b\x32*.google.cloud.visionai.v1.TagParsingConfig\"\xaa\x03\n\x10TagParsingConfig\x12^\n\x16\x65ntity_parsing_configs\x18\x01 \x03(\x0b\x32>.google.cloud.visionai.v1.TagParsingConfig.EntityParsingConfig\x1a\xb5\x02\n\x13\x45ntityParsingConfig\x12\x19\n\x0c\x65ntity_class\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x12\n\x05regex\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12|\n\x18\x65ntity_matching_strategy\x18\x03 \x01(\x0e\x32U.google.cloud.visionai.v1.TagParsingConfig.EntityParsingConfig.EntityMatchingStrategyB\x03\xe0\x41\x01\"q\n\x16\x45ntityMatchingStrategy\x12(\n$ENTITY_MATCHING_STRATEGY_UNSPECIFIED\x10\x00\x12\x17\n\x13MULTI_LINE_MATCHING\x10\x01\x12\x14\n\x10MAX_OVERLAP_AREA\x10\x02*\xa0\x02\n\tModelType\x12\x1a\n\x16MODEL_TYPE_UNSPECIFIED\x10\x00\x12\x18\n\x14IMAGE_CLASSIFICATION\x10\x01\x12\x14\n\x10OBJECT_DETECTION\x10\x02\x12\x18\n\x14VIDEO_CLASSIFICATION\x10\x03\x12\x19\n\x15VIDEO_OBJECT_TRACKING\x10\x04\x12\x1c\n\x18VIDEO_ACTION_RECOGNITION\x10\x05\x12\x16\n\x12OCCUPANCY_COUNTING\x10\x06\x12\x0f\n\x0bPERSON_BLUR\x10\x07\x12\x11\n\rVERTEX_CUSTOM\x10\x08\x12\x16\n\x12PRODUCT_RECOGNIZER\x10\t\x12\x12\n\x0eTAG_RECOGNIZER\x10\n\x12\x0c\n\x08SYNTH_ID\x10\x0f*\xd0\x01\n\x0f\x41\x63\x63\x65leratorType\x12 \n\x1c\x41\x43\x43\x45LERATOR_TYPE_UNSPECIFIED\x10\x00\x12\x14\n\x10NVIDIA_TESLA_K80\x10\x01\x12\x15\n\x11NVIDIA_TESLA_P100\x10\x02\x12\x15\n\x11NVIDIA_TESLA_V100\x10\x03\x12\x13\n\x0fNVIDIA_TESLA_P4\x10\x04\x12\x13\n\x0fNVIDIA_TESLA_T4\x10\x05\x12\x15\n\x11NVIDIA_TESLA_A100\x10\x08\x12\n\n\x06TPU_V2\x10\x06\x12\n\n\x06TPU_V3\x10\x07*W\n\x08\x44\x61taType\x12\x19\n\x15\x44\x41TA_TYPE_UNSPECIFIED\x10\x00\x12\t\n\x05VIDEO\x10\x01\x12\t\n\x05IMAGE\x10\x03\x12\t\n\x05PROTO\x10\x02\x12\x0f\n\x0bPLACEHOLDER\x10\x04\x32\xea-\n\x0b\x41ppPlatform\x12\xbc\x01\n\x10ListApplications\x12\x31.google.cloud.visionai.v1.ListApplicationsRequest\x1a\x32.google.cloud.visionai.v1.ListApplicationsResponse\"A\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x32\x12\x30/v1/{parent=projects/*/locations/*}/applications\x12\xa9\x01\n\x0eGetApplication\x12/.google.cloud.visionai.v1.GetApplicationRequest\x1a%.google.cloud.visionai.v1.Application\"?\xda\x41\x04name\x82\xd3\xe4\x93\x02\x32\x12\x30/v1/{name=projects/*/locations/*/applications/*}\x12\xe5\x01\n\x11\x43reateApplication\x12\x32.google.cloud.visionai.v1.CreateApplicationRequest\x1a\x1d.google.longrunning.Operation\"}\xca\x41 \n\x0b\x41pplication\x12\x11OperationMetadata\xda\x41\x12parent,application\x82\xd3\xe4\x93\x02?\"0/v1/{parent=projects/*/locations/*}/applications:\x0b\x61pplication\x12\xf7\x01\n\x11UpdateApplication\x12\x32.google.cloud.visionai.v1.UpdateApplicationRequest\x1a\x1d.google.longrunning.Operation\"\x8e\x01\xca\x41 \n\x0b\x41pplication\x12\x11OperationMetadata\xda\x41\x17\x61pplication,update_mask\x82\xd3\xe4\x93\x02K2\"9/v1/{name=projects/*/locations/*/applications/*}:undeploy:\x01*\x12\x83\x02\n\x19\x41\x64\x64\x41pplicationStreamInput\x12:.google.cloud.visionai.v1.AddApplicationStreamInputRequest\x1a\x1d.google.longrunning.Operation\"\x8a\x01\xca\x41\x36\n!AddApplicationStreamInputResponse\x12\x11OperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02\x44\"?/v1/{name=projects/*/locations/*/applications/*}:addStreamInput:\x01*\x12\x8f\x02\n\x1cRemoveApplicationStreamInput\x12=.google.cloud.visionai.v1.RemoveApplicationStreamInputRequest\x1a\x1d.google.longrunning.Operation\"\x90\x01\xca\x41\x39\n$RemoveApplicationStreamInputResponse\x12\x11OperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02G\"B/v1/{name=projects/*/locations/*/applications/*}:removeStreamInput:\x01*\x12\x8f\x02\n\x1cUpdateApplicationStreamInput\x12=.google.cloud.visionai.v1.UpdateApplicationStreamInputRequest\x1a\x1d.google.longrunning.Operation\"\x90\x01\xca\x41\x39\n$UpdateApplicationStreamInputResponse\x12\x11OperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02G\"B/v1/{name=projects/*/locations/*/applications/*}:updateStreamInput:\x01*\x12\xbf\x01\n\rListInstances\x12..google.cloud.visionai.v1.ListInstancesRequest\x1a/.google.cloud.visionai.v1.ListInstancesResponse\"M\xda\x41\x06parent\x82\xd3\xe4\x93\x02>\x12\x12\n\x0f\x61lignment_clock\x18\x06 \x01(\x0e\x32%.google.cloud.visionai.v1.Event.Clock\x12/\n\x0cgrace_period\x18\x07 \x01(\x0b\x32\x19.google.protobuf.Duration\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a\x32\n\x10\x41nnotationsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"7\n\x05\x43lock\x12\x15\n\x11\x43LOCK_UNSPECIFIED\x10\x00\x12\x0b\n\x07\x43\x41PTURE\x10\x01\x12\n\n\x06INGEST\x10\x02:m\xea\x41j\n\x1dvisionai.googleapis.com/Event\x12Iprojects/{project}/locations/{location}/clusters/{cluster}/events/{event}\"\xca\x04\n\x06Series\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x34\n\x0b\x63reate_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12<\n\x06labels\x18\x04 \x03(\x0b\x32,.google.cloud.visionai.v1.Series.LabelsEntry\x12\x46\n\x0b\x61nnotations\x18\x05 \x03(\x0b\x32\x31.google.cloud.visionai.v1.Series.AnnotationsEntry\x12\x36\n\x06stream\x18\x06 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1evisionai.googleapis.com/Stream\x12\x34\n\x05\x65vent\x18\x07 \x01(\tB%\xe0\x41\x02\xfa\x41\x1f\n\x1dvisionai.googleapis.com/Event\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a\x32\n\x10\x41nnotationsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01:o\xea\x41l\n\x1evisionai.googleapis.com/Series\x12Jprojects/{project}/locations/{location}/clusters/{cluster}/series/{series}\"\xd1\x04\n\x07\x43hannel\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x34\n\x0b\x63reate_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12=\n\x06labels\x18\x04 \x03(\x0b\x32-.google.cloud.visionai.v1.Channel.LabelsEntry\x12G\n\x0b\x61nnotations\x18\x05 \x03(\x0b\x32\x32.google.cloud.visionai.v1.Channel.AnnotationsEntry\x12\x36\n\x06stream\x18\x06 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1evisionai.googleapis.com/Stream\x12\x34\n\x05\x65vent\x18\x07 \x01(\tB%\xe0\x41\x02\xfa\x41\x1f\n\x1dvisionai.googleapis.com/Event\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a\x32\n\x10\x41nnotationsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01:s\xea\x41p\n\x1fvisionai.googleapis.com/Channel\x12Mprojects/{project}/locations/{location}/clusters/{cluster}/channels/{channel}B\xc5\x01\n\x1c\x63om.google.cloud.visionai.v1B\x15StreamsResourcesProtoP\x01Z8cloud.google.com/go/visionai/apiv1/visionaipb;visionaipb\xaa\x02\x18Google.Cloud.VisionAI.V1\xca\x02\x18Google\\Cloud\\VisionAI\\V1\xea\x02\x1bGoogle::Cloud::VisionAI::V1b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module VisionAI + module V1 + Stream = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.Stream").msgclass + Event = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.Event").msgclass + Event::Clock = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.Event.Clock").enummodule + Series = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.Series").msgclass + Channel = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.Channel").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/visionai/v1/streams_service_pb.rb b/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/visionai/v1/streams_service_pb.rb new file mode 100644 index 000000000000..5d8ae148ada3 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/visionai/v1/streams_service_pb.rb @@ -0,0 +1,60 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/visionai/v1/streams_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/visionai/v1/common_pb' +require 'google/cloud/visionai/v1/streams_resources_pb' +require 'google/longrunning/operations_pb' +require 'google/protobuf/empty_pb' +require 'google/protobuf/field_mask_pb' +require 'google/protobuf/timestamp_pb' + + +descriptor_data = "\n.google/cloud/visionai/v1/streams_service.proto\x12\x18google.cloud.visionai.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/visionai/v1/common.proto\x1a\x30google/cloud/visionai/v1/streams_resources.proto\x1a#google/longrunning/operations.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\x99\x01\n\x13ListClustersRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\x12\x0e\n\x06\x66ilter\x18\x04 \x01(\t\x12\x10\n\x08order_by\x18\x05 \x01(\t\"y\n\x14ListClustersResponse\x12\x33\n\x08\x63lusters\x18\x01 \x03(\x0b\x32!.google.cloud.visionai.v1.Cluster\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x13\n\x0bunreachable\x18\x03 \x03(\t\"J\n\x11GetClusterRequest\x12\x35\n\x04name\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1fvisionai.googleapis.com/Cluster\"\xba\x01\n\x14\x43reateClusterRequest\x12\x37\n\x06parent\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\x12\x1fvisionai.googleapis.com/Cluster\x12\x17\n\ncluster_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x37\n\x07\x63luster\x18\x03 \x01(\x0b\x32!.google.cloud.visionai.v1.ClusterB\x03\xe0\x41\x02\x12\x17\n\nrequest_id\x18\x04 \x01(\tB\x03\xe0\x41\x01\"\x9e\x01\n\x14UpdateClusterRequest\x12\x34\n\x0bupdate_mask\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\x12\x37\n\x07\x63luster\x18\x02 \x01(\x0b\x32!.google.cloud.visionai.v1.ClusterB\x03\xe0\x41\x02\x12\x17\n\nrequest_id\x18\x03 \x01(\tB\x03\xe0\x41\x01\"f\n\x14\x44\x65leteClusterRequest\x12\x35\n\x04name\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1fvisionai.googleapis.com/Cluster\x12\x17\n\nrequest_id\x18\x02 \x01(\tB\x03\xe0\x41\x01\"\x96\x01\n\x12ListStreamsRequest\x12\x37\n\x06parent\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1fvisionai.googleapis.com/Cluster\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\x12\x0e\n\x06\x66ilter\x18\x04 \x01(\t\x12\x10\n\x08order_by\x18\x05 \x01(\t\"v\n\x13ListStreamsResponse\x12\x31\n\x07streams\x18\x01 \x03(\x0b\x32 .google.cloud.visionai.v1.Stream\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x13\n\x0bunreachable\x18\x03 \x03(\t\"H\n\x10GetStreamRequest\x12\x34\n\x04name\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1evisionai.googleapis.com/Stream\"\xb6\x01\n\x13\x43reateStreamRequest\x12\x37\n\x06parent\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1fvisionai.googleapis.com/Cluster\x12\x16\n\tstream_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x35\n\x06stream\x18\x03 \x01(\x0b\x32 .google.cloud.visionai.v1.StreamB\x03\xe0\x41\x02\x12\x17\n\nrequest_id\x18\x04 \x01(\tB\x03\xe0\x41\x01\"\x9b\x01\n\x13UpdateStreamRequest\x12\x34\n\x0bupdate_mask\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\x12\x35\n\x06stream\x18\x02 \x01(\x0b\x32 .google.cloud.visionai.v1.StreamB\x03\xe0\x41\x02\x12\x17\n\nrequest_id\x18\x03 \x01(\tB\x03\xe0\x41\x01\"d\n\x13\x44\x65leteStreamRequest\x12\x34\n\x04name\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1evisionai.googleapis.com/Stream\x12\x17\n\nrequest_id\x18\x02 \x01(\tB\x03\xe0\x41\x01\"{\n\x19GetStreamThumbnailRequest\x12\x13\n\x06stream\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x1c\n\x0fgcs_object_name\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x12\n\x05\x65vent\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12\x17\n\nrequest_id\x18\x04 \x01(\tB\x03\xe0\x41\x01\"\x1c\n\x1aGetStreamThumbnailResponse\"4\n\x1dGenerateStreamHlsTokenRequest\x12\x13\n\x06stream\x18\x01 \x01(\tB\x03\xe0\x41\x02\"d\n\x1eGenerateStreamHlsTokenResponse\x12\r\n\x05token\x18\x01 \x01(\t\x12\x33\n\x0f\x65xpiration_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"\x95\x01\n\x11ListEventsRequest\x12\x37\n\x06parent\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1fvisionai.googleapis.com/Cluster\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\x12\x0e\n\x06\x66ilter\x18\x04 \x01(\t\x12\x10\n\x08order_by\x18\x05 \x01(\t\"s\n\x12ListEventsResponse\x12/\n\x06\x65vents\x18\x01 \x03(\x0b\x32\x1f.google.cloud.visionai.v1.Event\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x13\n\x0bunreachable\x18\x03 \x03(\t\"F\n\x0fGetEventRequest\x12\x33\n\x04name\x18\x01 \x01(\tB%\xe0\x41\x02\xfa\x41\x1f\n\x1dvisionai.googleapis.com/Event\"\xb2\x01\n\x12\x43reateEventRequest\x12\x37\n\x06parent\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1fvisionai.googleapis.com/Cluster\x12\x15\n\x08\x65vent_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x33\n\x05\x65vent\x18\x03 \x01(\x0b\x32\x1f.google.cloud.visionai.v1.EventB\x03\xe0\x41\x02\x12\x17\n\nrequest_id\x18\x04 \x01(\tB\x03\xe0\x41\x01\"\x98\x01\n\x12UpdateEventRequest\x12\x34\n\x0bupdate_mask\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\x12\x33\n\x05\x65vent\x18\x02 \x01(\x0b\x32\x1f.google.cloud.visionai.v1.EventB\x03\xe0\x41\x02\x12\x17\n\nrequest_id\x18\x03 \x01(\tB\x03\xe0\x41\x01\"b\n\x12\x44\x65leteEventRequest\x12\x33\n\x04name\x18\x01 \x01(\tB%\xe0\x41\x02\xfa\x41\x1f\n\x1dvisionai.googleapis.com/Event\x12\x17\n\nrequest_id\x18\x02 \x01(\tB\x03\xe0\x41\x01\"\x95\x01\n\x11ListSeriesRequest\x12\x37\n\x06parent\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1fvisionai.googleapis.com/Cluster\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\x12\x0e\n\x06\x66ilter\x18\x04 \x01(\t\x12\x10\n\x08order_by\x18\x05 \x01(\t\"t\n\x12ListSeriesResponse\x12\x30\n\x06series\x18\x01 \x03(\x0b\x32 .google.cloud.visionai.v1.Series\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x13\n\x0bunreachable\x18\x03 \x03(\t\"H\n\x10GetSeriesRequest\x12\x34\n\x04name\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1evisionai.googleapis.com/Series\"\xb6\x01\n\x13\x43reateSeriesRequest\x12\x37\n\x06parent\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1fvisionai.googleapis.com/Cluster\x12\x16\n\tseries_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x35\n\x06series\x18\x03 \x01(\x0b\x32 .google.cloud.visionai.v1.SeriesB\x03\xe0\x41\x02\x12\x17\n\nrequest_id\x18\x04 \x01(\tB\x03\xe0\x41\x01\"\x9b\x01\n\x13UpdateSeriesRequest\x12\x34\n\x0bupdate_mask\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\x12\x35\n\x06series\x18\x02 \x01(\x0b\x32 .google.cloud.visionai.v1.SeriesB\x03\xe0\x41\x02\x12\x17\n\nrequest_id\x18\x03 \x01(\tB\x03\xe0\x41\x01\"d\n\x13\x44\x65leteSeriesRequest\x12\x34\n\x04name\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1evisionai.googleapis.com/Series\x12\x17\n\nrequest_id\x18\x02 \x01(\tB\x03\xe0\x41\x01\"\xbf\x01\n\x19MaterializeChannelRequest\x12\x37\n\x06parent\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1fvisionai.googleapis.com/Cluster\x12\x17\n\nchannel_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x37\n\x07\x63hannel\x18\x03 \x01(\x0b\x32!.google.cloud.visionai.v1.ChannelB\x03\xe0\x41\x02\x12\x17\n\nrequest_id\x18\x04 \x01(\tB\x03\xe0\x41\x01\x32\xbc%\n\x0eStreamsService\x12\xac\x01\n\x0cListClusters\x12-.google.cloud.visionai.v1.ListClustersRequest\x1a..google.cloud.visionai.v1.ListClustersResponse\"=\xda\x41\x06parent\x82\xd3\xe4\x93\x02.\x12,/v1/{parent=projects/*/locations/*}/clusters\x12\x99\x01\n\nGetCluster\x12+.google.cloud.visionai.v1.GetClusterRequest\x1a!.google.cloud.visionai.v1.Cluster\";\xda\x41\x04name\x82\xd3\xe4\x93\x02.\x12,/v1/{name=projects/*/locations/*/clusters/*}\x12\xd8\x01\n\rCreateCluster\x12..google.cloud.visionai.v1.CreateClusterRequest\x1a\x1d.google.longrunning.Operation\"x\xca\x41\x1c\n\x07\x43luster\x12\x11OperationMetadata\xda\x41\x19parent,cluster,cluster_id\x82\xd3\xe4\x93\x02\x37\",/v1/{parent=projects/*/locations/*}/clusters:\x07\x63luster\x12\xda\x01\n\rUpdateCluster\x12..google.cloud.visionai.v1.UpdateClusterRequest\x1a\x1d.google.longrunning.Operation\"z\xca\x41\x1c\n\x07\x43luster\x12\x11OperationMetadata\xda\x41\x13\x63luster,update_mask\x82\xd3\xe4\x93\x02?24/v1/{cluster.name=projects/*/locations/*/clusters/*}:\x07\x63luster\x12\xc8\x01\n\rDeleteCluster\x12..google.cloud.visionai.v1.DeleteClusterRequest\x1a\x1d.google.longrunning.Operation\"h\xca\x41*\n\x15google.protobuf.Empty\x12\x11OperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02.*,/v1/{name=projects/*/locations/*/clusters/*}\x12\xb3\x01\n\x0bListStreams\x12,.google.cloud.visionai.v1.ListStreamsRequest\x1a-.google.cloud.visionai.v1.ListStreamsResponse\"G\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x38\x12\x36/v1/{parent=projects/*/locations/*/clusters/*}/streams\x12\xa0\x01\n\tGetStream\x12*.google.cloud.visionai.v1.GetStreamRequest\x1a .google.cloud.visionai.v1.Stream\"E\xda\x41\x04name\x82\xd3\xe4\x93\x02\x38\x12\x36/v1/{name=projects/*/locations/*/clusters/*/streams/*}\x12\xdc\x01\n\x0c\x43reateStream\x12-.google.cloud.visionai.v1.CreateStreamRequest\x1a\x1d.google.longrunning.Operation\"~\xca\x41\x1b\n\x06Stream\x12\x11OperationMetadata\xda\x41\x17parent,stream,stream_id\x82\xd3\xe4\x93\x02@\"6/v1/{parent=projects/*/locations/*/clusters/*}/streams:\x06stream\x12\xdf\x01\n\x0cUpdateStream\x12-.google.cloud.visionai.v1.UpdateStreamRequest\x1a\x1d.google.longrunning.Operation\"\x80\x01\xca\x41\x1b\n\x06Stream\x12\x11OperationMetadata\xda\x41\x12stream,update_mask\x82\xd3\xe4\x93\x02G2=/v1/{stream.name=projects/*/locations/*/clusters/*/streams/*}:\x06stream\x12\xd0\x01\n\x0c\x44\x65leteStream\x12-.google.cloud.visionai.v1.DeleteStreamRequest\x1a\x1d.google.longrunning.Operation\"r\xca\x41*\n\x15google.protobuf.Empty\x12\x11OperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02\x38*6/v1/{name=projects/*/locations/*/clusters/*/streams/*}\x12\x86\x02\n\x12GetStreamThumbnail\x12\x33.google.cloud.visionai.v1.GetStreamThumbnailRequest\x1a\x1d.google.longrunning.Operation\"\x9b\x01\xca\x41/\n\x1aGetStreamThumbnailResponse\x12\x11OperationMetadata\xda\x41\x16stream,gcs_object_name\x82\xd3\xe4\x93\x02J\"E/v1/{stream=projects/*/locations/*/clusters/*/streams/*}:getThumbnail:\x01*\x12\xf0\x01\n\x16GenerateStreamHlsToken\x12\x37.google.cloud.visionai.v1.GenerateStreamHlsTokenRequest\x1a\x38.google.cloud.visionai.v1.GenerateStreamHlsTokenResponse\"c\xda\x41\x06stream\x82\xd3\xe4\x93\x02T\"O/v1/{stream=projects/*/locations/*/clusters/*/streams/*}:generateStreamHlsToken:\x01*\x12\xaf\x01\n\nListEvents\x12+.google.cloud.visionai.v1.ListEventsRequest\x1a,.google.cloud.visionai.v1.ListEventsResponse\"F\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x37\x12\x35/v1/{parent=projects/*/locations/*/clusters/*}/events\x12\x9c\x01\n\x08GetEvent\x12).google.cloud.visionai.v1.GetEventRequest\x1a\x1f.google.cloud.visionai.v1.Event\"D\xda\x41\x04name\x82\xd3\xe4\x93\x02\x37\x12\x35/v1/{name=projects/*/locations/*/clusters/*/events/*}\x12\xd5\x01\n\x0b\x43reateEvent\x12,.google.cloud.visionai.v1.CreateEventRequest\x1a\x1d.google.longrunning.Operation\"y\xca\x41\x1a\n\x05\x45vent\x12\x11OperationMetadata\xda\x41\x15parent,event,event_id\x82\xd3\xe4\x93\x02>\"5/v1/{parent=projects/*/locations/*/clusters/*}/events:\x05\x65vent\x12\xd7\x01\n\x0bUpdateEvent\x12,.google.cloud.visionai.v1.UpdateEventRequest\x1a\x1d.google.longrunning.Operation\"{\xca\x41\x1a\n\x05\x45vent\x12\x11OperationMetadata\xda\x41\x11\x65vent,update_mask\x82\xd3\xe4\x93\x02\x44\x32;/v1/{event.name=projects/*/locations/*/clusters/*/events/*}:\x05\x65vent\x12\xcd\x01\n\x0b\x44\x65leteEvent\x12,.google.cloud.visionai.v1.DeleteEventRequest\x1a\x1d.google.longrunning.Operation\"q\xca\x41*\n\x15google.protobuf.Empty\x12\x11OperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02\x37*5/v1/{name=projects/*/locations/*/clusters/*/events/*}\x12\xaf\x01\n\nListSeries\x12+.google.cloud.visionai.v1.ListSeriesRequest\x1a,.google.cloud.visionai.v1.ListSeriesResponse\"F\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x37\x12\x35/v1/{parent=projects/*/locations/*/clusters/*}/series\x12\x9f\x01\n\tGetSeries\x12*.google.cloud.visionai.v1.GetSeriesRequest\x1a .google.cloud.visionai.v1.Series\"D\xda\x41\x04name\x82\xd3\xe4\x93\x02\x37\x12\x35/v1/{name=projects/*/locations/*/clusters/*/series/*}\x12\xdb\x01\n\x0c\x43reateSeries\x12-.google.cloud.visionai.v1.CreateSeriesRequest\x1a\x1d.google.longrunning.Operation\"}\xca\x41\x1b\n\x06Series\x12\x11OperationMetadata\xda\x41\x17parent,series,series_id\x82\xd3\xe4\x93\x02?\"5/v1/{parent=projects/*/locations/*/clusters/*}/series:\x06series\x12\xdd\x01\n\x0cUpdateSeries\x12-.google.cloud.visionai.v1.UpdateSeriesRequest\x1a\x1d.google.longrunning.Operation\"\x7f\xca\x41\x1b\n\x06Series\x12\x11OperationMetadata\xda\x41\x12series,update_mask\x82\xd3\xe4\x93\x02\x46\x32\n\x0eindexed_assets\x18\x01 \x03(\x0b\x32&.google.cloud.visionai.v1.IndexedAsset\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"a\n\x13\x43reateCorpusRequest\x12\x13\n\x06parent\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x35\n\x06\x63orpus\x18\x02 \x01(\x0b\x32 .google.cloud.visionai.v1.CorpusB\x03\xe0\x41\x02\"x\n\x14\x43reateCorpusMetadata\x12/\n\x0b\x63reate_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12/\n\x0bupdate_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"\x85\x01\n\x10SearchCapability\x12=\n\x04type\x18\x01 \x01(\x0e\x32/.google.cloud.visionai.v1.SearchCapability.Type\"2\n\x04Type\x12\x14\n\x10TYPE_UNSPECIFIED\x10\x00\x12\x14\n\x10\x45MBEDDING_SEARCH\x10\x01\"b\n\x17SearchCapabilitySetting\x12G\n\x13search_capabilities\x18\x01 \x03(\x0b\x32*.google.cloud.visionai.v1.SearchCapability\"c\n\x18\x43reateCollectionMetadata\x12G\n\x12operation_metadata\x18\x01 \x01(\x0b\x32+.google.cloud.visionai.v1.OperationMetadata\"\xc3\x01\n\x17\x43reateCollectionRequest\x12\x36\n\x06parent\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1evisionai.googleapis.com/Corpus\x12=\n\ncollection\x18\x02 \x01(\x0b\x32$.google.cloud.visionai.v1.CollectionB\x03\xe0\x41\x02\x12\x1f\n\rcollection_id\x18\x03 \x01(\tB\x03\xe0\x41\x01H\x00\x88\x01\x01\x42\x10\n\x0e_collection_id\"c\n\x18\x44\x65leteCollectionMetadata\x12G\n\x12operation_metadata\x18\x01 \x01(\x0b\x32+.google.cloud.visionai.v1.OperationMetadata\"S\n\x17\x44\x65leteCollectionRequest\x12\x38\n\x04name\x18\x01 \x01(\tB*\xe0\x41\x02\xfa\x41$\n\"visionai.googleapis.com/Collection\"P\n\x14GetCollectionRequest\x12\x38\n\x04name\x18\x01 \x01(\tB*\xe0\x41\x02\xfa\x41$\n\"visionai.googleapis.com/Collection\"\x89\x01\n\x17UpdateCollectionRequest\x12=\n\ncollection\x18\x01 \x01(\x0b\x32$.google.cloud.visionai.v1.CollectionB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"{\n\x16ListCollectionsRequest\x12:\n\x06parent\x18\x01 \x01(\tB*\xe0\x41\x02\xfa\x41$\x12\"visionai.googleapis.com/Collection\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\"m\n\x17ListCollectionsResponse\x12\x39\n\x0b\x63ollections\x18\x01 \x03(\x0b\x32$.google.cloud.visionai.v1.Collection\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"W\n\x18\x41\x64\x64\x43ollectionItemRequest\x12;\n\x04item\x18\x01 \x01(\x0b\x32(.google.cloud.visionai.v1.CollectionItemB\x03\xe0\x41\x02\"S\n\x19\x41\x64\x64\x43ollectionItemResponse\x12\x36\n\x04item\x18\x01 \x01(\x0b\x32(.google.cloud.visionai.v1.CollectionItem\"Z\n\x1bRemoveCollectionItemRequest\x12;\n\x04item\x18\x01 \x01(\x0b\x32(.google.cloud.visionai.v1.CollectionItemB\x03\xe0\x41\x02\"V\n\x1cRemoveCollectionItemResponse\x12\x36\n\x04item\x18\x01 \x01(\x0b\x32(.google.cloud.visionai.v1.CollectionItem\"\x83\x01\n\x1aViewCollectionItemsRequest\x12>\n\ncollection\x18\x01 \x01(\tB*\xe0\x41\x02\xfa\x41$\n\"visionai.googleapis.com/Collection\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\"o\n\x1bViewCollectionItemsResponse\x12\x37\n\x05items\x18\x01 \x03(\x0b\x32(.google.cloud.visionai.v1.CollectionItem\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\xd8\x01\n\nCollection\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x19\n\x0c\x64isplay_name\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x18\n\x0b\x64\x65scription\x18\x03 \x01(\tB\x03\xe0\x41\x01:\x81\x01\xea\x41~\n\"visionai.googleapis.com/Collection\x12Xprojects/{project_number}/locations/{location}/corpora/{corpus}/collections/{collection}\"\xd7\x01\n\x0e\x43ollectionItem\x12>\n\ncollection\x18\x01 \x01(\tB*\xe0\x41\x02\xfa\x41$\n\"visionai.googleapis.com/Collection\x12@\n\x04type\x18\x02 \x01(\x0e\x32-.google.cloud.visionai.v1.CollectionItem.TypeB\x03\xe0\x41\x02\x12\x1a\n\ritem_resource\x18\x03 \x01(\tB\x03\xe0\x41\x02\"\'\n\x04Type\x12\x14\n\x10TYPE_UNSPECIFIED\x10\x00\x12\t\n\x05\x41SSET\x10\x01\"\x98\x01\n\x12\x43reateIndexRequest\x12\x36\n\x06parent\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1evisionai.googleapis.com/Corpus\x12\x15\n\x08index_id\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x33\n\x05index\x18\x03 \x01(\x0b\x32\x1f.google.cloud.visionai.v1.IndexB\x03\xe0\x41\x02\"^\n\x13\x43reateIndexMetadata\x12G\n\x12operation_metadata\x18\x01 \x01(\x0b\x32+.google.cloud.visionai.v1.OperationMetadata\"\x7f\n\x12UpdateIndexRequest\x12\x33\n\x05index\x18\x01 \x01(\x0b\x32\x1f.google.cloud.visionai.v1.IndexB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\"^\n\x13UpdateIndexMetadata\x12G\n\x12operation_metadata\x18\x01 \x01(\x0b\x32+.google.cloud.visionai.v1.OperationMetadata\"F\n\x0fGetIndexRequest\x12\x33\n\x04name\x18\x01 \x01(\tB%\xe0\x41\x02\xfa\x41\x1f\n\x1dvisionai.googleapis.com/Index\"r\n\x12ListIndexesRequest\x12\x35\n\x06parent\x18\x01 \x01(\tB%\xe0\x41\x02\xfa\x41\x1f\x12\x1dvisionai.googleapis.com/Index\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\"`\n\x13ListIndexesResponse\x12\x30\n\x07indexes\x18\x01 \x03(\x0b\x32\x1f.google.cloud.visionai.v1.Index\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"I\n\x12\x44\x65leteIndexRequest\x12\x33\n\x04name\x18\x01 \x01(\tB%\xe0\x41\x02\xfa\x41\x1f\n\x1dvisionai.googleapis.com/Index\"\x15\n\x13\x44\x65leteIndexMetadata\"\x94\x05\n\x05Index\x12\x17\n\rentire_corpus\x18\t \x01(\x08H\x00\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x19\n\x0c\x64isplay_name\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x18\n\x0b\x64\x65scription\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12\x39\n\x05state\x18\x04 \x01(\x0e\x32%.google.cloud.visionai.v1.Index.StateB\x03\xe0\x41\x03\x12\x34\n\x0b\x63reate_time\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12O\n\x10\x64\x65ployed_indexes\x18\x08 \x03(\x0b\x32\x30.google.cloud.visionai.v1.DeployedIndexReferenceB\x03\xe0\x41\x03\x12\x1f\n\rsatisfies_pzs\x18\x0b \x01(\x08\x42\x03\xe0\x41\x03H\x01\x88\x01\x01\x12\x1f\n\rsatisfies_pzi\x18\x0c \x01(\x08\x42\x03\xe0\x41\x03H\x02\x88\x01\x01\"G\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0c\n\x08\x43REATING\x10\x01\x12\x0b\n\x07\x43REATED\x10\x02\x12\x0c\n\x08UPDATING\x10\x03:s\xea\x41p\n\x1dvisionai.googleapis.com/Index\x12Oprojects/{project_number}/locations/{location}/corpora/{corpus}/indexes/{index}B\x0e\n\x0c\x61sset_filterB\x10\n\x0e_satisfies_pzsB\x10\n\x0e_satisfies_pzi\"_\n\x16\x44\x65ployedIndexReference\x12\x45\n\x0eindex_endpoint\x18\x01 \x01(\tB-\xe0\x41\x05\xfa\x41\'\n%visionai.googleapis.com/IndexEndpoint\"\xac\x04\n\x06\x43orpus\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x19\n\x0c\x64isplay_name\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x18\n\x0b\x64\x65scription\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12\x33\n\x0b\x64\x65\x66\x61ult_ttl\x18\x05 \x01(\x0b\x32\x19.google.protobuf.DurationB\x03\xe0\x41\x01\x12\x38\n\x04type\x18\x07 \x01(\x0e\x32%.google.cloud.visionai.v1.Corpus.TypeB\x03\xe0\x41\x01\x12T\n\x19search_capability_setting\x18\x08 \x01(\x0b\x32\x31.google.cloud.visionai.v1.SearchCapabilitySetting\x12\x1f\n\rsatisfies_pzs\x18\x0b \x01(\x08\x42\x03\xe0\x41\x03H\x00\x88\x01\x01\x12\x1f\n\rsatisfies_pzi\x18\x0c \x01(\x08\x42\x03\xe0\x41\x03H\x01\x88\x01\x01\"N\n\x04Type\x12\x14\n\x10TYPE_UNSPECIFIED\x10\x00\x12\x10\n\x0cSTREAM_VIDEO\x10\x01\x12\t\n\x05IMAGE\x10\x02\x12\x13\n\x0fVIDEO_ON_DEMAND\x10\x03:d\xea\x41\x61\n\x1evisionai.googleapis.com/Corpus\x12?projects/{project_number}/locations/{location}/corpora/{corpus}B\x10\n\x0e_satisfies_pzsB\x10\n\x0e_satisfies_pzi\"H\n\x10GetCorpusRequest\x12\x34\n\x04name\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1evisionai.googleapis.com/Corpus\"}\n\x13UpdateCorpusRequest\x12\x35\n\x06\x63orpus\x18\x01 \x01(\x0b\x32 .google.cloud.visionai.v1.CorpusB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"`\n\x12ListCorporaRequest\x12\x13\n\x06parent\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\x12\x0e\n\x06\x66ilter\x18\x05 \x01(\t\"a\n\x13ListCorporaResponse\x12\x31\n\x07\x63orpora\x18\x01 \x03(\x0b\x32 .google.cloud.visionai.v1.Corpus\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"K\n\x13\x44\x65leteCorpusRequest\x12\x34\n\x04name\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1evisionai.googleapis.com/Corpus\"L\n\x14\x41nalyzeCorpusRequest\x12\x34\n\x04name\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1evisionai.googleapis.com/Corpus\"V\n\x15\x41nalyzeCorpusMetadata\x12=\n\x08metadata\x18\x01 \x01(\x0b\x32+.google.cloud.visionai.v1.OperationMetadata\"\x17\n\x15\x41nalyzeCorpusResponse\"\x91\x01\n\x17\x43reateDataSchemaRequest\x12\x36\n\x06parent\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1evisionai.googleapis.com/Corpus\x12>\n\x0b\x64\x61ta_schema\x18\x02 \x01(\x0b\x32$.google.cloud.visionai.v1.DataSchemaB\x03\xe0\x41\x02\"\xf6\x01\n\nDataSchema\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x10\n\x03key\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x43\n\x0eschema_details\x18\x03 \x01(\x0b\x32+.google.cloud.visionai.v1.DataSchemaDetails:\x82\x01\xea\x41\x7f\n\"visionai.googleapis.com/DataSchema\x12Yprojects/{project_number}/locations/{location}/corpora/{corpus}/dataSchemas/{data_schema}\"\xd4\x0c\n\x11\x44\x61taSchemaDetails\x12G\n\x04type\x18\x01 \x01(\x0e\x32\x34.google.cloud.visionai.v1.DataSchemaDetails.DataTypeH\x00\x88\x01\x01\x12T\n\x10proto_any_config\x18\x06 \x01(\x0b\x32:.google.cloud.visionai.v1.DataSchemaDetails.ProtoAnyConfig\x12K\n\x0blist_config\x18\x08 \x01(\x0b\x32\x36.google.cloud.visionai.v1.DataSchemaDetails.ListConfig\x12\x64\n\x18\x63ustomized_struct_config\x18\t \x01(\x0b\x32\x42.google.cloud.visionai.v1.DataSchemaDetails.CustomizedStructConfig\x12Q\n\x0bgranularity\x18\x05 \x01(\x0e\x32\x37.google.cloud.visionai.v1.DataSchemaDetails.GranularityH\x01\x88\x01\x01\x12S\n\x0fsearch_strategy\x18\x07 \x01(\x0b\x32:.google.cloud.visionai.v1.DataSchemaDetails.SearchStrategy\x1a\"\n\x0eProtoAnyConfig\x12\x10\n\x08type_uri\x18\x01 \x01(\t\x1aO\n\nListConfig\x12\x41\n\x0cvalue_schema\x18\x01 \x01(\x0b\x32+.google.cloud.visionai.v1.DataSchemaDetails\x1a\xe7\x01\n\x16\x43ustomizedStructConfig\x12k\n\rfield_schemas\x18\x01 \x03(\x0b\x32T.google.cloud.visionai.v1.DataSchemaDetails.CustomizedStructConfig.FieldSchemasEntry\x1a`\n\x11\x46ieldSchemasEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12:\n\x05value\x18\x02 \x01(\x0b\x32+.google.cloud.visionai.v1.DataSchemaDetails:\x02\x38\x01\x1a\xb7\x03\n\x0eSearchStrategy\x12p\n\x14search_strategy_type\x18\x01 \x01(\x0e\x32M.google.cloud.visionai.v1.DataSchemaDetails.SearchStrategy.SearchStrategyTypeH\x00\x88\x01\x01\x12\x81\x01\n\x1d\x63onfidence_score_index_config\x18\x02 \x01(\x0b\x32U.google.cloud.visionai.v1.DataSchemaDetails.SearchStrategy.ConfidenceScoreIndexConfigB\x03\xe0\x41\x01\x1aM\n\x1a\x43onfidenceScoreIndexConfig\x12\x17\n\nfield_path\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x16\n\tthreshold\x18\x02 \x01(\x02\x42\x03\xe0\x41\x02\"G\n\x12SearchStrategyType\x12\r\n\tNO_SEARCH\x10\x00\x12\x10\n\x0c\x45XACT_SEARCH\x10\x01\x12\x10\n\x0cSMART_SEARCH\x10\x02\x42\x17\n\x15_search_strategy_type\"\xa8\x01\n\x08\x44\x61taType\x12\x19\n\x15\x44\x41TA_TYPE_UNSPECIFIED\x10\x00\x12\x0b\n\x07INTEGER\x10\x01\x12\t\n\x05\x46LOAT\x10\x02\x12\n\n\x06STRING\x10\x03\x12\x0c\n\x08\x44\x41TETIME\x10\x05\x12\x12\n\x0eGEO_COORDINATE\x10\x07\x12\r\n\tPROTO_ANY\x10\x08\x12\x0b\n\x07\x42OOLEAN\x10\t\x12\x08\n\x04LIST\x10\n\x12\x15\n\x11\x43USTOMIZED_STRUCT\x10\x06\"h\n\x0bGranularity\x12\x1b\n\x17GRANULARITY_UNSPECIFIED\x10\x00\x12\x1b\n\x17GRANULARITY_ASSET_LEVEL\x10\x01\x12\x1f\n\x1bGRANULARITY_PARTITION_LEVEL\x10\x02\x42\x07\n\x05_typeB\x0e\n\x0c_granularity\"\x8a\x01\n\x17UpdateDataSchemaRequest\x12>\n\x0b\x64\x61ta_schema\x18\x01 \x01(\x0b\x32$.google.cloud.visionai.v1.DataSchemaB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"P\n\x14GetDataSchemaRequest\x12\x38\n\x04name\x18\x01 \x01(\tB*\xe0\x41\x02\xfa\x41$\n\"visionai.googleapis.com/DataSchema\"S\n\x17\x44\x65leteDataSchemaRequest\x12\x38\n\x04name\x18\x01 \x01(\tB*\xe0\x41\x02\xfa\x41$\n\"visionai.googleapis.com/DataSchema\"{\n\x16ListDataSchemasRequest\x12:\n\x06parent\x18\x01 \x01(\tB*\xe0\x41\x02\xfa\x41$\x12\"visionai.googleapis.com/DataSchema\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\"n\n\x17ListDataSchemasResponse\x12:\n\x0c\x64\x61ta_schemas\x18\x01 \x03(\x0b\x32$.google.cloud.visionai.v1.DataSchema\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\xc2\x01\n\x17\x43reateAnnotationRequest\x12\x35\n\x06parent\x18\x01 \x01(\tB%\xe0\x41\x02\xfa\x41\x1f\n\x1dvisionai.googleapis.com/Asset\x12=\n\nannotation\x18\x02 \x01(\x0b\x32$.google.cloud.visionai.v1.AnnotationB\x03\xe0\x41\x02\x12\x1f\n\rannotation_id\x18\x03 \x01(\tB\x03\xe0\x41\x01H\x00\x88\x01\x01\x42\x10\n\x0e_annotation_id\"\x84\x02\n\nAnnotation\x12\x0c\n\x04name\x18\x01 \x01(\t\x12T\n\x19user_specified_annotation\x18\x02 \x01(\x0b\x32\x31.google.cloud.visionai.v1.UserSpecifiedAnnotation:\x91\x01\xea\x41\x8d\x01\n\"visionai.googleapis.com/Annotation\x12gprojects/{project_number}/locations/{location}/corpora/{corpus}/assets/{asset}/annotations/{annotation}\"\x9d\x01\n\x17UserSpecifiedAnnotation\x12\x10\n\x03key\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x38\n\x05value\x18\x02 \x01(\x0b\x32).google.cloud.visionai.v1.AnnotationValue\x12\x36\n\tpartition\x18\x03 \x01(\x0b\x32#.google.cloud.visionai.v1.Partition\"4\n\rGeoCoordinate\x12\x10\n\x08latitude\x18\x01 \x01(\x01\x12\x11\n\tlongitude\x18\x02 \x01(\x01\"\xd9\x03\n\x0f\x41nnotationValue\x12\x13\n\tint_value\x18\x01 \x01(\x03H\x00\x12\x15\n\x0b\x66loat_value\x18\x02 \x01(\x02H\x00\x12\x13\n\tstr_value\x18\x03 \x01(\tH\x00\x12\x18\n\x0e\x64\x61tetime_value\x18\x05 \x01(\tH\x00\x12\x41\n\x0egeo_coordinate\x18\x07 \x01(\x0b\x32\'.google.cloud.visionai.v1.GeoCoordinateH\x00\x12/\n\x0fproto_any_value\x18\x08 \x01(\x0b\x32\x14.google.protobuf.AnyH\x00\x12\x14\n\nbool_value\x18\t \x01(\x08H\x00\x12?\n\x1c\x63ustomized_struct_data_value\x18\n \x01(\x0b\x32\x17.google.protobuf.StructH\x00\x12>\n\nlist_value\x18\x0b \x01(\x0b\x32(.google.cloud.visionai.v1.AnnotationListH\x00\x12W\n\x17\x63ustomized_struct_value\x18\x06 \x01(\x0b\x32\x34.google.cloud.visionai.v1.AnnotationCustomizedStructH\x00\x42\x07\n\x05value\"K\n\x0e\x41nnotationList\x12\x39\n\x06values\x18\x01 \x03(\x0b\x32).google.cloud.visionai.v1.AnnotationValue\"\xce\x01\n\x1a\x41nnotationCustomizedStruct\x12T\n\x08\x65lements\x18\x02 \x03(\x0b\x32\x42.google.cloud.visionai.v1.AnnotationCustomizedStruct.ElementsEntry\x1aZ\n\rElementsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\x38\n\x05value\x18\x02 \x01(\x0b\x32).google.cloud.visionai.v1.AnnotationValue:\x02\x38\x01\"\x83\x01\n\x16ListAnnotationsRequest\x12\x32\n\x06parent\x18\x01 \x01(\tB\"\xfa\x41\x1f\n\x1dvisionai.googleapis.com/Asset\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\x12\x0e\n\x06\x66ilter\x18\x04 \x01(\t\"m\n\x17ListAnnotationsResponse\x12\x39\n\x0b\x61nnotations\x18\x01 \x03(\x0b\x32$.google.cloud.visionai.v1.Annotation\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"P\n\x14GetAnnotationRequest\x12\x38\n\x04name\x18\x01 \x01(\tB*\xe0\x41\x02\xfa\x41$\n\"visionai.googleapis.com/Annotation\"\x89\x01\n\x17UpdateAnnotationRequest\x12=\n\nannotation\x18\x01 \x01(\x0b\x32$.google.cloud.visionai.v1.AnnotationB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"S\n\x17\x44\x65leteAnnotationRequest\x12\x38\n\x04name\x18\x01 \x01(\tB*\xe0\x41\x02\xfa\x41$\n\"visionai.googleapis.com/Annotation\"q\n\x13ImportAssetsRequest\x12\x18\n\x0e\x61ssets_gcs_uri\x18\x02 \x01(\tH\x00\x12\x36\n\x06parent\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1evisionai.googleapis.com/CorpusB\x08\n\x06source\"\x95\x01\n\x14ImportAssetsMetadata\x12=\n\x08metadata\x18\x01 \x01(\x0b\x32+.google.cloud.visionai.v1.OperationMetadata\x12>\n\x06status\x18\x02 \x01(\x0b\x32..google.cloud.visionai.v1.BatchOperationStatus\"D\n\x14\x42\x61tchOperationStatus\x12\x15\n\rsuccess_count\x18\x01 \x01(\x05\x12\x15\n\rfailure_count\x18\x02 \x01(\x05\"\x16\n\x14ImportAssetsResponse\"\xbc\x01\n\x19\x43reateSearchConfigRequest\x12<\n\x06parent\x18\x01 \x01(\tB,\xe0\x41\x02\xfa\x41&\x12$visionai.googleapis.com/SearchConfig\x12\x42\n\rsearch_config\x18\x02 \x01(\x0b\x32&.google.cloud.visionai.v1.SearchConfigB\x03\xe0\x41\x02\x12\x1d\n\x10search_config_id\x18\x03 \x01(\tB\x03\xe0\x41\x02\"\x90\x01\n\x19UpdateSearchConfigRequest\x12\x42\n\rsearch_config\x18\x01 \x01(\x0b\x32&.google.cloud.visionai.v1.SearchConfigB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"T\n\x16GetSearchConfigRequest\x12:\n\x04name\x18\x01 \x01(\tB,\xe0\x41\x02\xfa\x41&\n$visionai.googleapis.com/SearchConfig\"W\n\x19\x44\x65leteSearchConfigRequest\x12:\n\x04name\x18\x01 \x01(\tB,\xe0\x41\x02\xfa\x41&\n$visionai.googleapis.com/SearchConfig\"\x7f\n\x18ListSearchConfigsRequest\x12<\n\x06parent\x18\x01 \x01(\tB,\xe0\x41\x02\xfa\x41&\x12$visionai.googleapis.com/SearchConfig\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\"t\n\x19ListSearchConfigsResponse\x12>\n\x0esearch_configs\x18\x01 \x03(\x0b\x32&.google.cloud.visionai.v1.SearchConfig\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\xbd\x02\n\x0cSearchConfig\x12\x0c\n\x04name\x18\x01 \x01(\t\x12?\n\x0e\x66\x61\x63\x65t_property\x18\x02 \x01(\x0b\x32\'.google.cloud.visionai.v1.FacetProperty\x12R\n\x18search_criteria_property\x18\x03 \x01(\x0b\x32\x30.google.cloud.visionai.v1.SearchCriteriaProperty:\x89\x01\xea\x41\x85\x01\n$visionai.googleapis.com/SearchConfig\x12]projects/{project_number}/locations/{location}/corpora/{corpus}/searchConfigs/{search_config}\"\xf5\x05\n\rIndexEndpoint\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x19\n\x0c\x64isplay_name\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x18\n\x0b\x64\x65scription\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12\x44\n\x0e\x64\x65ployed_index\x18\t \x01(\x0b\x32\'.google.cloud.visionai.v1.DeployedIndexB\x03\xe0\x41\x03\x12\x41\n\x05state\x18\x05 \x01(\x0e\x32-.google.cloud.visionai.v1.IndexEndpoint.StateB\x03\xe0\x41\x03\x12H\n\x06labels\x18\x06 \x03(\x0b\x32\x33.google.cloud.visionai.v1.IndexEndpoint.LabelsEntryB\x03\xe0\x41\x01\x12\x34\n\x0b\x63reate_time\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x08 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x1f\n\rsatisfies_pzs\x18\n \x01(\x08\x42\x03\xe0\x41\x03H\x00\x88\x01\x01\x12\x1f\n\rsatisfies_pzi\x18\x0b \x01(\x08\x42\x03\xe0\x41\x03H\x01\x88\x01\x01\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"S\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0c\n\x08\x43REATING\x10\x01\x12\x0b\n\x07\x43REATED\x10\x02\x12\x0c\n\x08UPDATING\x10\x03\x12\n\n\x06\x46\x41ILED\x10\x04:s\xea\x41p\n%visionai.googleapis.com/IndexEndpoint\x12Gprojects/{project}/locations/{location}/indexEndpoints/{index_endpoint}B\x10\n\x0e_satisfies_pzsB\x10\n\x0e_satisfies_pzi\"\xbd\x01\n\x1a\x43reateIndexEndpointRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\x12\x1e\n\x11index_endpoint_id\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x44\n\x0eindex_endpoint\x18\x03 \x01(\x0b\x32\'.google.cloud.visionai.v1.IndexEndpointB\x03\xe0\x41\x02\"f\n\x1b\x43reateIndexEndpointMetadata\x12G\n\x12operation_metadata\x18\x01 \x01(\x0b\x32+.google.cloud.visionai.v1.OperationMetadata\"V\n\x17GetIndexEndpointRequest\x12;\n\x04name\x18\x01 \x01(\tB-\xe0\x41\x02\xfa\x41\'\n%visionai.googleapis.com/IndexEndpoint\"\x9c\x01\n\x19ListIndexEndpointsRequest\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\"w\n\x1aListIndexEndpointsResponse\x12@\n\x0findex_endpoints\x18\x01 \x03(\x0b\x32\'.google.cloud.visionai.v1.IndexEndpoint\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\x98\x01\n\x1aUpdateIndexEndpointRequest\x12\x44\n\x0eindex_endpoint\x18\x01 \x01(\x0b\x32\'.google.cloud.visionai.v1.IndexEndpointB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\"f\n\x1bUpdateIndexEndpointMetadata\x12G\n\x12operation_metadata\x18\x01 \x01(\x0b\x32+.google.cloud.visionai.v1.OperationMetadata\"Y\n\x1a\x44\x65leteIndexEndpointRequest\x12;\n\x04name\x18\x01 \x01(\tB-\xe0\x41\x02\xfa\x41\'\n%visionai.googleapis.com/IndexEndpoint\"f\n\x1b\x44\x65leteIndexEndpointMetadata\x12G\n\x12operation_metadata\x18\x01 \x01(\x0b\x32+.google.cloud.visionai.v1.OperationMetadata\"\xa1\x01\n\x12\x44\x65ployIndexRequest\x12\x45\n\x0eindex_endpoint\x18\x01 \x01(\tB-\xe0\x41\x02\xfa\x41\'\n%visionai.googleapis.com/IndexEndpoint\x12\x44\n\x0e\x64\x65ployed_index\x18\x03 \x01(\x0b\x32\'.google.cloud.visionai.v1.DeployedIndexB\x03\xe0\x41\x02\"\x15\n\x13\x44\x65ployIndexResponse\"\x9d\x01\n\x13\x44\x65ployIndexMetadata\x12G\n\x12operation_metadata\x18\x01 \x01(\x0b\x32+.google.cloud.visionai.v1.OperationMetadata\x12=\n\x0e\x64\x65ployed_index\x18\x02 \x01(\tB%\xe0\x41\x03\xfa\x41\x1f\n\x1dvisionai.googleapis.com/Index\"\x9f\x01\n\x15UndeployIndexMetadata\x12G\n\x12operation_metadata\x18\x01 \x01(\x0b\x32+.google.cloud.visionai.v1.OperationMetadata\x12=\n\x0e\x64\x65ployed_index\x18\x02 \x01(\tB%\xe0\x41\x03\xfa\x41\x1f\n\x1dvisionai.googleapis.com/Index\"]\n\x14UndeployIndexRequest\x12\x45\n\x0eindex_endpoint\x18\x01 \x01(\tB-\xe0\x41\x02\xfa\x41\'\n%visionai.googleapis.com/IndexEndpoint\"\x17\n\x15UndeployIndexResponse\"E\n\rDeployedIndex\x12\x34\n\x05index\x18\x01 \x01(\tB%\xe0\x41\x02\xfa\x41\x1f\n\x1dvisionai.googleapis.com/Index\"\x84\x07\n\rFacetProperty\x12_\n\x17\x66ixed_range_bucket_spec\x18\x05 \x01(\x0b\x32<.google.cloud.visionai.v1.FacetProperty.FixedRangeBucketSpecH\x00\x12\x61\n\x18\x63ustom_range_bucket_spec\x18\x06 \x01(\x0b\x32=.google.cloud.visionai.v1.FacetProperty.CustomRangeBucketSpecH\x00\x12Z\n\x14\x64\x61tetime_bucket_spec\x18\x07 \x01(\x0b\x32:.google.cloud.visionai.v1.FacetProperty.DateTimeBucketSpecH\x00\x12\x15\n\rmapped_fields\x18\x01 \x03(\t\x12\x14\n\x0c\x64isplay_name\x18\x02 \x01(\t\x12\x13\n\x0bresult_size\x18\x03 \x01(\x03\x12>\n\x0b\x62ucket_type\x18\x04 \x01(\x0e\x32).google.cloud.visionai.v1.FacetBucketType\x1a\xaa\x01\n\x14\x46ixedRangeBucketSpec\x12:\n\x0c\x62ucket_start\x18\x01 \x01(\x0b\x32$.google.cloud.visionai.v1.FacetValue\x12@\n\x12\x62ucket_granularity\x18\x02 \x01(\x0b\x32$.google.cloud.visionai.v1.FacetValue\x12\x14\n\x0c\x62ucket_count\x18\x03 \x01(\x05\x1aP\n\x15\x43ustomRangeBucketSpec\x12\x37\n\tendpoints\x18\x01 \x03(\x0b\x32$.google.cloud.visionai.v1.FacetValue\x1a\xbb\x01\n\x12\x44\x61teTimeBucketSpec\x12[\n\x0bgranularity\x18\x01 \x01(\x0e\x32\x46.google.cloud.visionai.v1.FacetProperty.DateTimeBucketSpec.Granularity\"H\n\x0bGranularity\x12\x1b\n\x17GRANULARITY_UNSPECIFIED\x10\x00\x12\x08\n\x04YEAR\x10\x01\x12\t\n\x05MONTH\x10\x02\x12\x07\n\x03\x44\x41Y\x10\x03\x42\x14\n\x12range_facet_config\"\xde\x01\n\x0eSearchHypernym\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x15\n\x08hypernym\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x15\n\x08hyponyms\x18\x03 \x03(\tB\x03\xe0\x41\x01:\x8f\x01\xea\x41\x8b\x01\n&visionai.googleapis.com/SearchHypernym\x12\x61projects/{project_number}/locations/{location}/corpora/{corpus}/searchHypernyms/{search_hypernym}\"\xda\x01\n\x1b\x43reateSearchHypernymRequest\x12\x36\n\x06parent\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1evisionai.googleapis.com/Corpus\x12\x46\n\x0fsearch_hypernym\x18\x02 \x01(\x0b\x32(.google.cloud.visionai.v1.SearchHypernymB\x03\xe0\x41\x02\x12$\n\x12search_hypernym_id\x18\x03 \x01(\tB\x03\xe0\x41\x01H\x00\x88\x01\x01\x42\x15\n\x13_search_hypernym_id\"\x96\x01\n\x1bUpdateSearchHypernymRequest\x12\x46\n\x0fsearch_hypernym\x18\x01 \x01(\x0b\x32(.google.cloud.visionai.v1.SearchHypernymB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"X\n\x18GetSearchHypernymRequest\x12<\n\x04name\x18\x01 \x01(\tB.\xe0\x41\x02\xfa\x41(\n&visionai.googleapis.com/SearchHypernym\"[\n\x1b\x44\x65leteSearchHypernymRequest\x12<\n\x04name\x18\x01 \x01(\tB.\xe0\x41\x02\xfa\x41(\n&visionai.googleapis.com/SearchHypernym\"\x83\x01\n\x1aListSearchHypernymsRequest\x12>\n\x06parent\x18\x01 \x01(\tB.\xe0\x41\x02\xfa\x41(\x12&visionai.googleapis.com/SearchHypernym\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\"z\n\x1bListSearchHypernymsResponse\x12\x42\n\x10search_hypernyms\x18\x01 \x03(\x0b\x32(.google.cloud.visionai.v1.SearchHypernym\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"/\n\x16SearchCriteriaProperty\x12\x15\n\rmapped_fields\x18\x01 \x03(\t\"w\n\nFacetValue\x12\x16\n\x0cstring_value\x18\x01 \x01(\tH\x00\x12\x17\n\rinteger_value\x18\x02 \x01(\x03H\x00\x12/\n\x0e\x64\x61tetime_value\x18\x03 \x01(\x0b\x32\x15.google.type.DateTimeH\x00\x42\x07\n\x05value\"\x95\x02\n\x0b\x46\x61\x63\x65tBucket\x12\x35\n\x05value\x18\x02 \x01(\x0b\x32$.google.cloud.visionai.v1.FacetValueH\x00\x12<\n\x05range\x18\x04 \x01(\x0b\x32+.google.cloud.visionai.v1.FacetBucket.RangeH\x00\x12\x10\n\x08selected\x18\x03 \x01(\x08\x1ao\n\x05Range\x12\x33\n\x05start\x18\x01 \x01(\x0b\x32$.google.cloud.visionai.v1.FacetValue\x12\x31\n\x03\x65nd\x18\x02 \x01(\x0b\x32$.google.cloud.visionai.v1.FacetValueB\x0e\n\x0c\x62ucket_value\"\xcf\x01\n\nFacetGroup\x12\x10\n\x08\x66\x61\x63\x65t_id\x18\x01 \x01(\t\x12\x14\n\x0c\x64isplay_name\x18\x02 \x01(\t\x12\x36\n\x07\x62uckets\x18\x03 \x03(\x0b\x32%.google.cloud.visionai.v1.FacetBucket\x12>\n\x0b\x62ucket_type\x18\x04 \x01(\x0e\x32).google.cloud.visionai.v1.FacetBucketType\x12!\n\x19\x66\x65tch_matched_annotations\x18\x05 \x01(\x08\"\xa8\x05\n\x12IngestAssetRequest\x12\x45\n\x06\x63onfig\x18\x01 \x01(\x0b\x32\x33.google.cloud.visionai.v1.IngestAssetRequest.ConfigH\x00\x12Y\n\x11time_indexed_data\x18\x02 \x01(\x0b\x32<.google.cloud.visionai.v1.IngestAssetRequest.TimeIndexedDataH\x00\x1a\xe6\x02\n\x06\x43onfig\x12S\n\nvideo_type\x18\x02 \x01(\x0b\x32=.google.cloud.visionai.v1.IngestAssetRequest.Config.VideoTypeH\x00\x12\x34\n\x05\x61sset\x18\x01 \x01(\tB%\xe0\x41\x02\xfa\x41\x1f\n\x1dvisionai.googleapis.com/Asset\x1a\xc3\x01\n\tVideoType\x12g\n\x10\x63ontainer_format\x18\x01 \x01(\x0e\x32M.google.cloud.visionai.v1.IngestAssetRequest.Config.VideoType.ContainerFormat\"M\n\x0f\x43ontainerFormat\x12 \n\x1c\x43ONTAINER_FORMAT_UNSPECIFIED\x10\x00\x12\x18\n\x14\x43ONTAINER_FORMAT_MP4\x10\x01\x42\x0b\n\tdata_type\x1ar\n\x0fTimeIndexedData\x12\x0c\n\x04\x64\x61ta\x18\x01 \x01(\x0c\x12Q\n\x12temporal_partition\x18\x02 \x01(\x0b\x32\x35.google.cloud.visionai.v1.Partition.TemporalPartitionB\x13\n\x11streaming_request\"u\n\x13IngestAssetResponse\x12^\n\x1fsuccessfully_ingested_partition\x18\x01 \x01(\x0b\x32\x35.google.cloud.visionai.v1.Partition.TemporalPartition\"\x9f\x01\n\x10\x43lipAssetRequest\x12\x33\n\x04name\x18\x01 \x01(\tB%\xe0\x41\x02\xfa\x41\x1f\n\x1dvisionai.googleapis.com/Asset\x12V\n\x12temporal_partition\x18\x02 \x01(\x0b\x32\x35.google.cloud.visionai.v1.Partition.TemporalPartitionB\x03\xe0\x41\x02\"\xdc\x01\n\x11\x43lipAssetResponse\x12U\n\x11time_indexed_uris\x18\x01 \x03(\x0b\x32:.google.cloud.visionai.v1.ClipAssetResponse.TimeIndexedUri\x1ap\n\x0eTimeIndexedUri\x12Q\n\x12temporal_partition\x18\x01 \x01(\x0b\x32\x35.google.cloud.visionai.v1.Partition.TemporalPartition\x12\x0b\n\x03uri\x18\x02 \x01(\t\"\xbb\x01\n\x15GenerateHlsUriRequest\x12\x33\n\x04name\x18\x01 \x01(\tB%\xe0\x41\x02\xfa\x41\x1f\n\x1dvisionai.googleapis.com/Asset\x12R\n\x13temporal_partitions\x18\x02 \x03(\x0b\x32\x35.google.cloud.visionai.v1.Partition.TemporalPartition\x12\x19\n\x11live_view_enabled\x18\x03 \x01(\x08\"y\n\x16GenerateHlsUriResponse\x12\x0b\n\x03uri\x18\x01 \x01(\t\x12R\n\x13temporal_partitions\x18\x02 \x03(\x0b\x32\x35.google.cloud.visionai.v1.Partition.TemporalPartition\"\xd3\x03\n\x13SearchAssetsRequest\x12Y\n\x1bschema_key_sorting_strategy\x18\t \x01(\x0b\x32\x32.google.cloud.visionai.v1.SchemaKeySortingStrategyH\x00\x12\x36\n\x06\x63orpus\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1evisionai.googleapis.com/Corpus\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\x12I\n\x13\x63ontent_time_ranges\x18\x05 \x01(\x0b\x32,.google.cloud.visionai.v1.DateTimeRangeArray\x12\x34\n\x08\x63riteria\x18\x04 \x03(\x0b\x32\".google.cloud.visionai.v1.Criteria\x12>\n\x10\x66\x61\x63\x65t_selections\x18\x06 \x03(\x0b\x32$.google.cloud.visionai.v1.FacetGroup\x12\x1e\n\x16result_annotation_keys\x18\x08 \x03(\t\x12\x14\n\x0csearch_query\x18\n \x01(\tB\x0b\n\tsort_spec\"\xdc\x02\n\x1aSearchIndexEndpointRequest\x12;\n\x0bimage_query\x18\x02 \x01(\x0b\x32$.google.cloud.visionai.v1.ImageQueryH\x00\x12\x14\n\ntext_query\x18\x03 \x01(\tH\x00\x12\x45\n\x0eindex_endpoint\x18\x01 \x01(\tB-\xe0\x41\x02\xfa\x41\'\n%visionai.googleapis.com/IndexEndpoint\x12\x34\n\x08\x63riteria\x18\x04 \x03(\x0b\x32\".google.cloud.visionai.v1.Criteria\x12>\n\x12\x65xclusion_criteria\x18\x07 \x03(\x0b\x32\".google.cloud.visionai.v1.Criteria\x12\x11\n\tpage_size\x18\x05 \x01(\x05\x12\x12\n\npage_token\x18\x06 \x01(\tB\x07\n\x05query\"a\n\nImageQuery\x12\x15\n\x0binput_image\x18\x01 \x01(\x0cH\x00\x12\x33\n\x05\x61sset\x18\x02 \x01(\tB\"\xfa\x41\x1f\n\x1dvisionai.googleapis.com/AssetH\x00\x42\x07\n\x05image\"\x94\x03\n\x18SchemaKeySortingStrategy\x12J\n\x07options\x18\x01 \x03(\x0b\x32\x39.google.cloud.visionai.v1.SchemaKeySortingStrategy.Option\x1a\xab\x02\n\x06Option\x12\x17\n\x0f\x64\x61ta_schema_key\x18\x01 \x01(\t\x12\x17\n\x0fsort_decreasing\x18\x02 \x01(\x08\x12h\n\x10\x61ggregate_method\x18\x03 \x01(\x0e\x32I.google.cloud.visionai.v1.SchemaKeySortingStrategy.Option.AggregateMethodH\x00\x88\x01\x01\"p\n\x0f\x41ggregateMethod\x12 \n\x1c\x41GGREGATE_METHOD_UNSPECIFIED\x10\x00\x12\x1c\n\x18\x41GGREGATE_METHOD_LARGEST\x10\x01\x12\x1d\n\x19\x41GGREGATE_METHOD_SMALLEST\x10\x02\x42\x13\n\x11_aggregate_method\"\x15\n\x13\x44\x65leteAssetMetadata\"\xb7\x01\n\x18\x41nnotationMatchingResult\x12\x34\n\x08\x63riteria\x18\x01 \x01(\x0b\x32\".google.cloud.visionai.v1.Criteria\x12\x41\n\x13matched_annotations\x18\x02 \x03(\x0b\x32$.google.cloud.visionai.v1.Annotation\x12\"\n\x06status\x18\x03 \x01(\x0b\x32\x12.google.rpc.Status\"\xe7\x02\n\x10SearchResultItem\x12\r\n\x05\x61sset\x18\x01 \x01(\t\x12K\n\x08segments\x18\x02 \x03(\x0b\x32\x35.google.cloud.visionai.v1.Partition.TemporalPartitionB\x02\x18\x01\x12\x46\n\x07segment\x18\x05 \x01(\x0b\x32\x35.google.cloud.visionai.v1.Partition.TemporalPartition\x12\x11\n\trelevance\x18\x06 \x01(\x01\x12\x43\n\x15requested_annotations\x18\x03 \x03(\x0b\x32$.google.cloud.visionai.v1.Annotation\x12W\n\x1b\x61nnotation_matching_results\x18\x04 \x03(\x0b\x32\x32.google.cloud.visionai.v1.AnnotationMatchingResult\"\xb5\x01\n\x14SearchAssetsResponse\x12G\n\x13search_result_items\x18\x01 \x03(\x0b\x32*.google.cloud.visionai.v1.SearchResultItem\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12;\n\rfacet_results\x18\x03 \x03(\x0b\x32$.google.cloud.visionai.v1.FacetGroup\"\x7f\n\x1bSearchIndexEndpointResponse\x12G\n\x13search_result_items\x18\x01 \x03(\x0b\x32*.google.cloud.visionai.v1.SearchResultItem\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"B\n\x08IntRange\x12\x12\n\x05start\x18\x01 \x01(\x03H\x00\x88\x01\x01\x12\x10\n\x03\x65nd\x18\x02 \x01(\x03H\x01\x88\x01\x01\x42\x08\n\x06_startB\x06\n\x04_end\"D\n\nFloatRange\x12\x12\n\x05start\x18\x01 \x01(\x02H\x00\x88\x01\x01\x12\x10\n\x03\x65nd\x18\x02 \x01(\x02H\x01\x88\x01\x01\x42\x08\n\x06_startB\x06\n\x04_end\"!\n\x0bStringArray\x12\x12\n\ntxt_values\x18\x01 \x03(\t\"G\n\rIntRangeArray\x12\x36\n\nint_ranges\x18\x01 \x03(\x0b\x32\".google.cloud.visionai.v1.IntRange\"M\n\x0f\x46loatRangeArray\x12:\n\x0c\x66loat_ranges\x18\x01 \x03(\x0b\x32$.google.cloud.visionai.v1.FloatRange\"Y\n\rDateTimeRange\x12$\n\x05start\x18\x01 \x01(\x0b\x32\x15.google.type.DateTime\x12\"\n\x03\x65nd\x18\x02 \x01(\x0b\x32\x15.google.type.DateTime\"W\n\x12\x44\x61teTimeRangeArray\x12\x41\n\x10\x64\x61te_time_ranges\x18\x01 \x03(\x0b\x32\'.google.cloud.visionai.v1.DateTimeRange\"G\n\nCircleArea\x12\x10\n\x08latitude\x18\x01 \x01(\x01\x12\x11\n\tlongitude\x18\x02 \x01(\x01\x12\x14\n\x0cradius_meter\x18\x03 \x01(\x01\"N\n\x10GeoLocationArray\x12:\n\x0c\x63ircle_areas\x18\x01 \x03(\x0b\x32$.google.cloud.visionai.v1.CircleArea\"\x1a\n\tBoolValue\x12\r\n\x05value\x18\x01 \x01(\x08\"\xe2\x03\n\x08\x43riteria\x12;\n\ntext_array\x18\x02 \x01(\x0b\x32%.google.cloud.visionai.v1.StringArrayH\x00\x12\x42\n\x0fint_range_array\x18\x03 \x01(\x0b\x32\'.google.cloud.visionai.v1.IntRangeArrayH\x00\x12\x46\n\x11\x66loat_range_array\x18\x04 \x01(\x0b\x32).google.cloud.visionai.v1.FloatRangeArrayH\x00\x12M\n\x15\x64\x61te_time_range_array\x18\x05 \x01(\x0b\x32,.google.cloud.visionai.v1.DateTimeRangeArrayH\x00\x12H\n\x12geo_location_array\x18\x06 \x01(\x0b\x32*.google.cloud.visionai.v1.GeoLocationArrayH\x00\x12\x39\n\nbool_value\x18\x07 \x01(\x0b\x32#.google.cloud.visionai.v1.BoolValueH\x00\x12\r\n\x05\x66ield\x18\x01 \x01(\t\x12!\n\x19\x66\x65tch_matched_annotations\x18\x08 \x01(\x08\x42\x07\n\x05value\"\x90\x05\n\tPartition\x12Q\n\x12temporal_partition\x18\x01 \x01(\x0b\x32\x35.google.cloud.visionai.v1.Partition.TemporalPartition\x12O\n\x11spatial_partition\x18\x02 \x01(\x0b\x32\x34.google.cloud.visionai.v1.Partition.SpatialPartition\x12\x62\n\x1brelative_temporal_partition\x18\x03 \x01(\x0b\x32=.google.cloud.visionai.v1.Partition.RelativeTemporalPartition\x1aq\n\x11TemporalPartition\x12.\n\nstart_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12,\n\x08\x65nd_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x1a\x8a\x01\n\x10SpatialPartition\x12\x12\n\x05x_min\x18\x01 \x01(\x03H\x00\x88\x01\x01\x12\x12\n\x05y_min\x18\x02 \x01(\x03H\x01\x88\x01\x01\x12\x12\n\x05x_max\x18\x03 \x01(\x03H\x02\x88\x01\x01\x12\x12\n\x05y_max\x18\x04 \x01(\x03H\x03\x88\x01\x01\x42\x08\n\x06_x_minB\x08\n\x06_y_minB\x08\n\x06_x_maxB\x08\n\x06_y_max\x1a{\n\x19RelativeTemporalPartition\x12/\n\x0cstart_offset\x18\x01 \x01(\x0b\x32\x19.google.protobuf.Duration\x12-\n\nend_offset\x18\x02 \x01(\x0b\x32\x19.google.protobuf.Duration*\xb8\x01\n\x0f\x46\x61\x63\x65tBucketType\x12!\n\x1d\x46\x41\x43\x45T_BUCKET_TYPE_UNSPECIFIED\x10\x00\x12\x1b\n\x17\x46\x41\x43\x45T_BUCKET_TYPE_VALUE\x10\x01\x12\x1e\n\x1a\x46\x41\x43\x45T_BUCKET_TYPE_DATETIME\x10\x02\x12!\n\x1d\x46\x41\x43\x45T_BUCKET_TYPE_FIXED_RANGE\x10\x03\x12\"\n\x1e\x46\x41\x43\x45T_BUCKET_TYPE_CUSTOM_RANGE\x10\x04\x32\x9b\x66\n\tWarehouse\x12\xb9\x01\n\x0b\x43reateAsset\x12,.google.cloud.visionai.v1.CreateAssetRequest\x1a\x1f.google.cloud.visionai.v1.Asset\"[\xda\x41\x15parent,asset,asset_id\x82\xd3\xe4\x93\x02=\"4/v1/{parent=projects/*/locations/*/corpora/*}/assets:\x05\x61sset\x12\xbb\x01\n\x0bUpdateAsset\x12,.google.cloud.visionai.v1.UpdateAssetRequest\x1a\x1f.google.cloud.visionai.v1.Asset\"]\xda\x41\x11\x61sset,update_mask\x82\xd3\xe4\x93\x02\x43\x32:/v1/{asset.name=projects/*/locations/*/corpora/*/assets/*}:\x05\x61sset\x12\x9b\x01\n\x08GetAsset\x12).google.cloud.visionai.v1.GetAssetRequest\x1a\x1f.google.cloud.visionai.v1.Asset\"C\xda\x41\x04name\x82\xd3\xe4\x93\x02\x36\x12\x34/v1/{name=projects/*/locations/*/corpora/*/assets/*}\x12\xae\x01\n\nListAssets\x12+.google.cloud.visionai.v1.ListAssetsRequest\x1a,.google.cloud.visionai.v1.ListAssetsResponse\"E\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x36\x12\x34/v1/{parent=projects/*/locations/*/corpora/*}/assets\x12\xce\x01\n\x0b\x44\x65leteAsset\x12,.google.cloud.visionai.v1.DeleteAssetRequest\x1a\x1d.google.longrunning.Operation\"r\xca\x41,\n\x15google.protobuf.Empty\x12\x13\x44\x65leteAssetMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02\x36*4/v1/{name=projects/*/locations/*/corpora/*/assets/*}\x12\xcf\x01\n\x0bUploadAsset\x12,.google.cloud.visionai.v1.UploadAssetRequest\x1a\x1d.google.longrunning.Operation\"s\xca\x41*\n\x13UploadAssetResponse\x12\x13UploadAssetMetadata\x82\xd3\xe4\x93\x02@\";/v1/{name=projects/*/locations/*/corpora/*/assets/*}:upload:\x01*\x12\xdb\x01\n\x14GenerateRetrievalUrl\x12\x35.google.cloud.visionai.v1.GenerateRetrievalUrlRequest\x1a\x36.google.cloud.visionai.v1.GenerateRetrievalUrlResponse\"T\x82\xd3\xe4\x93\x02N\"I/v1/{name=projects/*/locations/*/corpora/*/assets/*}:generateRetrievalUrl:\x01*\x12\xd4\x01\n\x0c\x41nalyzeAsset\x12-.google.cloud.visionai.v1.AnalyzeAssetRequest\x1a\x1d.google.longrunning.Operation\"v\xca\x41,\n\x14\x41nalyzeAssetResponse\x12\x14\x41nalyzeAssetMetadata\x82\xd3\xe4\x93\x02\x41\"\"5/v1/{parent=projects/*/locations/*/corpora/*}/indexes:\x05index\x12\xd9\x01\n\x0bUpdateIndex\x12,.google.cloud.visionai.v1.UpdateIndexRequest\x1a\x1d.google.longrunning.Operation\"}\xca\x41\x1c\n\x05Index\x12\x13UpdateIndexMetadata\xda\x41\x11index,update_mask\x82\xd3\xe4\x93\x02\x44\x32;/v1/{index.name=projects/*/locations/*/corpora/*/indexes/*}:\x05index\x12\x9c\x01\n\x08GetIndex\x12).google.cloud.visionai.v1.GetIndexRequest\x1a\x1f.google.cloud.visionai.v1.Index\"D\xda\x41\x04name\x82\xd3\xe4\x93\x02\x37\x12\x35/v1/{name=projects/*/locations/*/corpora/*/indexes/*}\x12\xb2\x01\n\x0bListIndexes\x12,.google.cloud.visionai.v1.ListIndexesRequest\x1a-.google.cloud.visionai.v1.ListIndexesResponse\"F\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x37\x12\x35/v1/{parent=projects/*/locations/*/corpora/*}/indexes\x12\xcf\x01\n\x0b\x44\x65leteIndex\x12,.google.cloud.visionai.v1.DeleteIndexRequest\x1a\x1d.google.longrunning.Operation\"s\xca\x41,\n\x15google.protobuf.Empty\x12\x13\x44\x65leteIndexMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02\x37*5/v1/{name=projects/*/locations/*/corpora/*/indexes/*}\x12\xca\x01\n\x0c\x43reateCorpus\x12-.google.cloud.visionai.v1.CreateCorpusRequest\x1a\x1d.google.longrunning.Operation\"l\xca\x41\x1e\n\x06\x43orpus\x12\x14\x43reateCorpusMetadata\xda\x41\rparent,corpus\x82\xd3\xe4\x93\x02\x35\"+/v1/{parent=projects/*/locations/*}/corpora:\x06\x63orpus\x12\x95\x01\n\tGetCorpus\x12*.google.cloud.visionai.v1.GetCorpusRequest\x1a .google.cloud.visionai.v1.Corpus\":\xda\x41\x04name\x82\xd3\xe4\x93\x02-\x12+/v1/{name=projects/*/locations/*/corpora/*}\x12\xb8\x01\n\x0cUpdateCorpus\x12-.google.cloud.visionai.v1.UpdateCorpusRequest\x1a .google.cloud.visionai.v1.Corpus\"W\xda\x41\x12\x63orpus,update_mask\x82\xd3\xe4\x93\x02<22/v1/{corpus.name=projects/*/locations/*/corpora/*}:\x06\x63orpus\x12\xa8\x01\n\x0bListCorpora\x12,.google.cloud.visionai.v1.ListCorporaRequest\x1a-.google.cloud.visionai.v1.ListCorporaResponse\"<\xda\x41\x06parent\x82\xd3\xe4\x93\x02-\x12+/v1/{parent=projects/*/locations/*}/corpora\x12\x91\x01\n\x0c\x44\x65leteCorpus\x12-.google.cloud.visionai.v1.DeleteCorpusRequest\x1a\x16.google.protobuf.Empty\":\xda\x41\x04name\x82\xd3\xe4\x93\x02-*+/v1/{name=projects/*/locations/*/corpora/*}\x12\xcf\x01\n\rAnalyzeCorpus\x12..google.cloud.visionai.v1.AnalyzeCorpusRequest\x1a\x1d.google.longrunning.Operation\"o\xca\x41.\n\x15\x41nalyzeCorpusResponse\x12\x15\x41nalyzeCorpusMetadata\x82\xd3\xe4\x93\x02\x38\"3/v1/{name=projects/*/locations/*/corpora/*}:analyze:\x01*\x12\xd0\x01\n\x10\x43reateDataSchema\x12\x31.google.cloud.visionai.v1.CreateDataSchemaRequest\x1a$.google.cloud.visionai.v1.DataSchema\"c\xda\x41\x12parent,data_schema\x82\xd3\xe4\x93\x02H\"9/v1/{parent=projects/*/locations/*/corpora/*}/dataSchemas:\x0b\x64\x61ta_schema\x12\xe1\x01\n\x10UpdateDataSchema\x12\x31.google.cloud.visionai.v1.UpdateDataSchemaRequest\x1a$.google.cloud.visionai.v1.DataSchema\"t\xda\x41\x17\x64\x61ta_schema,update_mask\x82\xd3\xe4\x93\x02T2E/v1/{data_schema.name=projects/*/locations/*/corpora/*/dataSchemas/*}:\x0b\x64\x61ta_schema\x12\xaf\x01\n\rGetDataSchema\x12..google.cloud.visionai.v1.GetDataSchemaRequest\x1a$.google.cloud.visionai.v1.DataSchema\"H\xda\x41\x04name\x82\xd3\xe4\x93\x02;\x12\x39/v1/{name=projects/*/locations/*/corpora/*/dataSchemas/*}\x12\xa7\x01\n\x10\x44\x65leteDataSchema\x12\x31.google.cloud.visionai.v1.DeleteDataSchemaRequest\x1a\x16.google.protobuf.Empty\"H\xda\x41\x04name\x82\xd3\xe4\x93\x02;*9/v1/{name=projects/*/locations/*/corpora/*/dataSchemas/*}\x12\xc2\x01\n\x0fListDataSchemas\x12\x30.google.cloud.visionai.v1.ListDataSchemasRequest\x1a\x31.google.cloud.visionai.v1.ListDataSchemasResponse\"J\xda\x41\x06parent\x82\xd3\xe4\x93\x02;\x12\x39/v1/{parent=projects/*/locations/*/corpora/*}/dataSchemas\x12\xe5\x01\n\x10\x43reateAnnotation\x12\x31.google.cloud.visionai.v1.CreateAnnotationRequest\x1a$.google.cloud.visionai.v1.Annotation\"x\xda\x41\x1fparent,annotation,annotation_id\x82\xd3\xe4\x93\x02P\"B/v1/{parent=projects/*/locations/*/corpora/*/assets/*}/annotations:\nannotation\x12\xb8\x01\n\rGetAnnotation\x12..google.cloud.visionai.v1.GetAnnotationRequest\x1a$.google.cloud.visionai.v1.Annotation\"Q\xda\x41\x04name\x82\xd3\xe4\x93\x02\x44\x12\x42/v1/{name=projects/*/locations/*/corpora/*/assets/*/annotations/*}\x12\xcb\x01\n\x0fListAnnotations\x12\x30.google.cloud.visionai.v1.ListAnnotationsRequest\x1a\x31.google.cloud.visionai.v1.ListAnnotationsResponse\"S\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x44\x12\x42/v1/{parent=projects/*/locations/*/corpora/*/assets/*}/annotations\x12\xe7\x01\n\x10UpdateAnnotation\x12\x31.google.cloud.visionai.v1.UpdateAnnotationRequest\x1a$.google.cloud.visionai.v1.Annotation\"z\xda\x41\x16\x61nnotation,update_mask\x82\xd3\xe4\x93\x02[2M/v1/{annotation.name=projects/*/locations/*/corpora/*/assets/*/annotations/*}:\nannotation\x12\xb0\x01\n\x10\x44\x65leteAnnotation\x12\x31.google.cloud.visionai.v1.DeleteAnnotationRequest\x1a\x16.google.protobuf.Empty\"Q\xda\x41\x04name\x82\xd3\xe4\x93\x02\x44*B/v1/{name=projects/*/locations/*/corpora/*/assets/*/annotations/*}\x12p\n\x0bIngestAsset\x12,.google.cloud.visionai.v1.IngestAssetRequest\x1a-.google.cloud.visionai.v1.IngestAssetResponse\"\x00(\x01\x30\x01\x12\xaa\x01\n\tClipAsset\x12*.google.cloud.visionai.v1.ClipAssetRequest\x1a+.google.cloud.visionai.v1.ClipAssetResponse\"D\x82\xd3\xe4\x93\x02>\"9/v1/{name=projects/*/locations/*/corpora/*/assets/*}:clip:\x01*\x12\xc3\x01\n\x0eGenerateHlsUri\x12/.google.cloud.visionai.v1.GenerateHlsUriRequest\x1a\x30.google.cloud.visionai.v1.GenerateHlsUriResponse\"N\x82\xd3\xe4\x93\x02H\"C/v1/{name=projects/*/locations/*/corpora/*/assets/*}:generateHlsUri:\x01*\x12\xd3\x01\n\x0cImportAssets\x12-.google.cloud.visionai.v1.ImportAssetsRequest\x1a\x1d.google.longrunning.Operation\"u\xca\x41,\n\x14ImportAssetsResponse\x12\x14ImportAssetsMetadata\x82\xd3\xe4\x93\x02@\";/v1/{parent=projects/*/locations/*/corpora/*}/assets:import:\x01*\x12\xed\x01\n\x12\x43reateSearchConfig\x12\x33.google.cloud.visionai.v1.CreateSearchConfigRequest\x1a&.google.cloud.visionai.v1.SearchConfig\"z\xda\x41%parent,search_config,search_config_id\x82\xd3\xe4\x93\x02L\";/v1/{parent=projects/*/locations/*/corpora/*}/searchConfigs:\rsearch_config\x12\xef\x01\n\x12UpdateSearchConfig\x12\x33.google.cloud.visionai.v1.UpdateSearchConfigRequest\x1a&.google.cloud.visionai.v1.SearchConfig\"|\xda\x41\x19search_config,update_mask\x82\xd3\xe4\x93\x02Z2I/v1/{search_config.name=projects/*/locations/*/corpora/*/searchConfigs/*}:\rsearch_config\x12\xb7\x01\n\x0fGetSearchConfig\x12\x30.google.cloud.visionai.v1.GetSearchConfigRequest\x1a&.google.cloud.visionai.v1.SearchConfig\"J\xda\x41\x04name\x82\xd3\xe4\x93\x02=\x12;/v1/{name=projects/*/locations/*/corpora/*/searchConfigs/*}\x12\xad\x01\n\x12\x44\x65leteSearchConfig\x12\x33.google.cloud.visionai.v1.DeleteSearchConfigRequest\x1a\x16.google.protobuf.Empty\"J\xda\x41\x04name\x82\xd3\xe4\x93\x02=*;/v1/{name=projects/*/locations/*/corpora/*/searchConfigs/*}\x12\xca\x01\n\x11ListSearchConfigs\x12\x32.google.cloud.visionai.v1.ListSearchConfigsRequest\x1a\x33.google.cloud.visionai.v1.ListSearchConfigsResponse\"L\xda\x41\x06parent\x82\xd3\xe4\x93\x02=\x12;/v1/{parent=projects/*/locations/*/corpora/*}/searchConfigs\x12\xfc\x01\n\x14\x43reateSearchHypernym\x12\x35.google.cloud.visionai.v1.CreateSearchHypernymRequest\x1a(.google.cloud.visionai.v1.SearchHypernym\"\x82\x01\xda\x41)parent,search_hypernym,search_hypernym_id\x82\xd3\xe4\x93\x02P\"=/v1/{parent=projects/*/locations/*/corpora/*}/searchHypernyms:\x0fsearch_hypernym\x12\xfe\x01\n\x14UpdateSearchHypernym\x12\x35.google.cloud.visionai.v1.UpdateSearchHypernymRequest\x1a(.google.cloud.visionai.v1.SearchHypernym\"\x84\x01\xda\x41\x1bsearch_hypernym,update_mask\x82\xd3\xe4\x93\x02`2M/v1/{search_hypernym.name=projects/*/locations/*/corpora/*/searchHypernyms/*}:\x0fsearch_hypernym\x12\xbf\x01\n\x11GetSearchHypernym\x12\x32.google.cloud.visionai.v1.GetSearchHypernymRequest\x1a(.google.cloud.visionai.v1.SearchHypernym\"L\xda\x41\x04name\x82\xd3\xe4\x93\x02?\x12=/v1/{name=projects/*/locations/*/corpora/*/searchHypernyms/*}\x12\xb3\x01\n\x14\x44\x65leteSearchHypernym\x12\x35.google.cloud.visionai.v1.DeleteSearchHypernymRequest\x1a\x16.google.protobuf.Empty\"L\xda\x41\x04name\x82\xd3\xe4\x93\x02?*=/v1/{name=projects/*/locations/*/corpora/*/searchHypernyms/*}\x12\xd2\x01\n\x13ListSearchHypernyms\x12\x34.google.cloud.visionai.v1.ListSearchHypernymsRequest\x1a\x35.google.cloud.visionai.v1.ListSearchHypernymsResponse\"N\xda\x41\x06parent\x82\xd3\xe4\x93\x02?\x12=/v1/{parent=projects/*/locations/*/corpora/*}/searchHypernyms\x12\xb4\x01\n\x0cSearchAssets\x12-.google.cloud.visionai.v1.SearchAssetsRequest\x1a..google.cloud.visionai.v1.SearchAssetsResponse\"E\x82\xd3\xe4\x93\x02?\":/v1/{corpus=projects/*/locations/*/corpora/*}:searchAssets:\x01*\x12\xdf\x01\n\x13SearchIndexEndpoint\x12\x34.google.cloud.visionai.v1.SearchIndexEndpointRequest\x1a\x35.google.cloud.visionai.v1.SearchIndexEndpointResponse\"[\x82\xd3\xe4\x93\x02U\"P/v1/{index_endpoint=projects/*/locations/*/indexEndpoints/*}:searchIndexEndpoint:\x01*\x12\x90\x02\n\x13\x43reateIndexEndpoint\x12\x34.google.cloud.visionai.v1.CreateIndexEndpointRequest\x1a\x1d.google.longrunning.Operation\"\xa3\x01\xca\x41,\n\rIndexEndpoint\x12\x1b\x43reateIndexEndpointMetadata\xda\x41\'parent,index_endpoint,index_endpoint_id\x82\xd3\xe4\x93\x02\x44\"2/v1/{parent=projects/*/locations/*}/indexEndpoints:\x0eindex_endpoint\x12\xb1\x01\n\x10GetIndexEndpoint\x12\x31.google.cloud.visionai.v1.GetIndexEndpointRequest\x1a\'.google.cloud.visionai.v1.IndexEndpoint\"A\xda\x41\x04name\x82\xd3\xe4\x93\x02\x34\x12\x32/v1/{name=projects/*/locations/*/indexEndpoints/*}\x12\xc4\x01\n\x12ListIndexEndpoints\x12\x33.google.cloud.visionai.v1.ListIndexEndpointsRequest\x1a\x34.google.cloud.visionai.v1.ListIndexEndpointsResponse\"C\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x34\x12\x32/v1/{parent=projects/*/locations/*}/indexEndpoints\x12\x92\x02\n\x13UpdateIndexEndpoint\x12\x34.google.cloud.visionai.v1.UpdateIndexEndpointRequest\x1a\x1d.google.longrunning.Operation\"\xa5\x01\xca\x41,\n\rIndexEndpoint\x12\x1bUpdateIndexEndpointMetadata\xda\x41\x1aindex_endpoint,update_mask\x82\xd3\xe4\x93\x02S2A/v1/{index_endpoint.name=projects/*/locations/*/indexEndpoints/*}:\x0eindex_endpoint\x12\xe4\x01\n\x13\x44\x65leteIndexEndpoint\x12\x34.google.cloud.visionai.v1.DeleteIndexEndpointRequest\x1a\x1d.google.longrunning.Operation\"x\xca\x41\x34\n\x15google.protobuf.Empty\x12\x1b\x44\x65leteIndexEndpointMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02\x34*2/v1/{name=projects/*/locations/*/indexEndpoints/*}\x12\xdd\x01\n\x0b\x44\x65ployIndex\x12,.google.cloud.visionai.v1.DeployIndexRequest\x1a\x1d.google.longrunning.Operation\"\x80\x01\xca\x41*\n\x13\x44\x65ployIndexResponse\x12\x13\x44\x65ployIndexMetadata\x82\xd3\xe4\x93\x02M\"H/v1/{index_endpoint=projects/*/locations/*/indexEndpoints/*}:deployIndex:\x01*\x12\xe7\x01\n\rUndeployIndex\x12..google.cloud.visionai.v1.UndeployIndexRequest\x1a\x1d.google.longrunning.Operation\"\x86\x01\xca\x41.\n\x15UndeployIndexResponse\x12\x15UndeployIndexMetadata\x82\xd3\xe4\x93\x02O\"J/v1/{index_endpoint=projects/*/locations/*/indexEndpoints/*}:undeployIndex:\x01*\x12\xff\x01\n\x10\x43reateCollection\x12\x31.google.cloud.visionai.v1.CreateCollectionRequest\x1a\x1d.google.longrunning.Operation\"\x98\x01\xca\x41&\n\nCollection\x12\x18\x43reateCollectionMetadata\xda\x41\x1fparent,collection,collection_id\x82\xd3\xe4\x93\x02G\"9/v1/{parent=projects/*/locations/*/corpora/*}/collections:\ncollection\x12\xe2\x01\n\x10\x44\x65leteCollection\x12\x31.google.cloud.visionai.v1.DeleteCollectionRequest\x1a\x1d.google.longrunning.Operation\"|\xca\x41\x31\n\x15google.protobuf.Empty\x12\x18\x44\x65leteCollectionMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02;*9/v1/{name=projects/*/locations/*/corpora/*/collections/*}\x12\xaf\x01\n\rGetCollection\x12..google.cloud.visionai.v1.GetCollectionRequest\x1a$.google.cloud.visionai.v1.Collection\"H\xda\x41\x04name\x82\xd3\xe4\x93\x02;\x12\x39/v1/{name=projects/*/locations/*/corpora/*/collections/*}\x12\xde\x01\n\x10UpdateCollection\x12\x31.google.cloud.visionai.v1.UpdateCollectionRequest\x1a$.google.cloud.visionai.v1.Collection\"q\xda\x41\x16\x63ollection,update_mask\x82\xd3\xe4\x93\x02R2D/v1/{collection.name=projects/*/locations/*/corpora/*/collections/*}:\ncollection\x12\xc2\x01\n\x0fListCollections\x12\x30.google.cloud.visionai.v1.ListCollectionsRequest\x1a\x31.google.cloud.visionai.v1.ListCollectionsResponse\"J\xda\x41\x06parent\x82\xd3\xe4\x93\x02;\x12\x39/v1/{parent=projects/*/locations/*/corpora/*}/collections\x12\xe6\x01\n\x11\x41\x64\x64\x43ollectionItem\x12\x32.google.cloud.visionai.v1.AddCollectionItemRequest\x1a\x33.google.cloud.visionai.v1.AddCollectionItemResponse\"h\xda\x41\x04item\x82\xd3\xe4\x93\x02[\"V/v1/{item.collection=projects/*/locations/*/corpora/*/collections/*}:addCollectionItem:\x01*\x12\xf2\x01\n\x14RemoveCollectionItem\x12\x35.google.cloud.visionai.v1.RemoveCollectionItemRequest\x1a\x36.google.cloud.visionai.v1.RemoveCollectionItemResponse\"k\xda\x41\x04item\x82\xd3\xe4\x93\x02^\"Y/v1/{item.collection=projects/*/locations/*/corpora/*/collections/*}:removeCollectionItem:\x01*\x12\xec\x01\n\x13ViewCollectionItems\x12\x34.google.cloud.visionai.v1.ViewCollectionItemsRequest\x1a\x35.google.cloud.visionai.v1.ViewCollectionItemsResponse\"h\xda\x41\ncollection\x82\xd3\xe4\x93\x02U\x12S/v1/{collection=projects/*/locations/*/corpora/*/collections/*}:viewCollectionItems\x1aU\xca\x41!warehouse-visionai.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\xbe\x01\n\x1c\x63om.google.cloud.visionai.v1B\x0eWarehouseProtoP\x01Z8cloud.google.com/go/visionai/apiv1/visionaipb;visionaipb\xaa\x02\x18Google.Cloud.VisionAI.V1\xca\x02\x18Google\\Cloud\\VisionAI\\V1\xea\x02\x1bGoogle::Cloud::VisionAI::V1b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module VisionAI + module V1 + CreateAssetRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.CreateAssetRequest").msgclass + GetAssetRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.GetAssetRequest").msgclass + ListAssetsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.ListAssetsRequest").msgclass + ListAssetsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.ListAssetsResponse").msgclass + UpdateAssetRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.UpdateAssetRequest").msgclass + DeleteAssetRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.DeleteAssetRequest").msgclass + AssetSource = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.AssetSource").msgclass + AssetSource::AssetGcsSource = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.AssetSource.AssetGcsSource").msgclass + AssetSource::AssetContentData = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.AssetSource.AssetContentData").msgclass + UploadAssetRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.UploadAssetRequest").msgclass + UploadAssetResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.UploadAssetResponse").msgclass + UploadAssetMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.UploadAssetMetadata").msgclass + GenerateRetrievalUrlRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.GenerateRetrievalUrlRequest").msgclass + GenerateRetrievalUrlResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.GenerateRetrievalUrlResponse").msgclass + Asset = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.Asset").msgclass + AnalyzeAssetRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.AnalyzeAssetRequest").msgclass + AnalyzeAssetMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.AnalyzeAssetMetadata").msgclass + AnalyzeAssetMetadata::AnalysisStatus = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.AnalyzeAssetMetadata.AnalysisStatus").msgclass + AnalyzeAssetMetadata::AnalysisStatus::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.AnalyzeAssetMetadata.AnalysisStatus.State").enummodule + AnalyzeAssetResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.AnalyzeAssetResponse").msgclass + IndexingStatus = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.IndexingStatus").msgclass + IndexingStatus::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.IndexingStatus.State").enummodule + IndexAssetRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.IndexAssetRequest").msgclass + IndexAssetMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.IndexAssetMetadata").msgclass + IndexAssetResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.IndexAssetResponse").msgclass + RemoveIndexAssetRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.RemoveIndexAssetRequest").msgclass + RemoveIndexAssetMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.RemoveIndexAssetMetadata").msgclass + RemoveIndexAssetResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.RemoveIndexAssetResponse").msgclass + IndexedAsset = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.IndexedAsset").msgclass + ViewIndexedAssetsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.ViewIndexedAssetsRequest").msgclass + ViewIndexedAssetsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.ViewIndexedAssetsResponse").msgclass + CreateCorpusRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.CreateCorpusRequest").msgclass + CreateCorpusMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.CreateCorpusMetadata").msgclass + SearchCapability = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.SearchCapability").msgclass + SearchCapability::Type = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.SearchCapability.Type").enummodule + SearchCapabilitySetting = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.SearchCapabilitySetting").msgclass + CreateCollectionMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.CreateCollectionMetadata").msgclass + CreateCollectionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.CreateCollectionRequest").msgclass + DeleteCollectionMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.DeleteCollectionMetadata").msgclass + DeleteCollectionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.DeleteCollectionRequest").msgclass + GetCollectionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.GetCollectionRequest").msgclass + UpdateCollectionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.UpdateCollectionRequest").msgclass + ListCollectionsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.ListCollectionsRequest").msgclass + ListCollectionsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.ListCollectionsResponse").msgclass + AddCollectionItemRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.AddCollectionItemRequest").msgclass + AddCollectionItemResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.AddCollectionItemResponse").msgclass + RemoveCollectionItemRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.RemoveCollectionItemRequest").msgclass + RemoveCollectionItemResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.RemoveCollectionItemResponse").msgclass + ViewCollectionItemsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.ViewCollectionItemsRequest").msgclass + ViewCollectionItemsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.ViewCollectionItemsResponse").msgclass + Collection = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.Collection").msgclass + CollectionItem = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.CollectionItem").msgclass + CollectionItem::Type = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.CollectionItem.Type").enummodule + CreateIndexRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.CreateIndexRequest").msgclass + CreateIndexMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.CreateIndexMetadata").msgclass + UpdateIndexRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.UpdateIndexRequest").msgclass + UpdateIndexMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.UpdateIndexMetadata").msgclass + GetIndexRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.GetIndexRequest").msgclass + ListIndexesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.ListIndexesRequest").msgclass + ListIndexesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.ListIndexesResponse").msgclass + DeleteIndexRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.DeleteIndexRequest").msgclass + DeleteIndexMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.DeleteIndexMetadata").msgclass + Index = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.Index").msgclass + Index::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.Index.State").enummodule + DeployedIndexReference = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.DeployedIndexReference").msgclass + Corpus = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.Corpus").msgclass + Corpus::Type = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.Corpus.Type").enummodule + GetCorpusRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.GetCorpusRequest").msgclass + UpdateCorpusRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.UpdateCorpusRequest").msgclass + ListCorporaRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.ListCorporaRequest").msgclass + ListCorporaResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.ListCorporaResponse").msgclass + DeleteCorpusRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.DeleteCorpusRequest").msgclass + AnalyzeCorpusRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.AnalyzeCorpusRequest").msgclass + AnalyzeCorpusMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.AnalyzeCorpusMetadata").msgclass + AnalyzeCorpusResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.AnalyzeCorpusResponse").msgclass + CreateDataSchemaRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.CreateDataSchemaRequest").msgclass + DataSchema = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.DataSchema").msgclass + DataSchemaDetails = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.DataSchemaDetails").msgclass + DataSchemaDetails::ProtoAnyConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.DataSchemaDetails.ProtoAnyConfig").msgclass + DataSchemaDetails::ListConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.DataSchemaDetails.ListConfig").msgclass + DataSchemaDetails::CustomizedStructConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.DataSchemaDetails.CustomizedStructConfig").msgclass + DataSchemaDetails::SearchStrategy = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.DataSchemaDetails.SearchStrategy").msgclass + DataSchemaDetails::SearchStrategy::ConfidenceScoreIndexConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.DataSchemaDetails.SearchStrategy.ConfidenceScoreIndexConfig").msgclass + DataSchemaDetails::SearchStrategy::SearchStrategyType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.DataSchemaDetails.SearchStrategy.SearchStrategyType").enummodule + DataSchemaDetails::DataType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.DataSchemaDetails.DataType").enummodule + DataSchemaDetails::Granularity = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.DataSchemaDetails.Granularity").enummodule + UpdateDataSchemaRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.UpdateDataSchemaRequest").msgclass + GetDataSchemaRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.GetDataSchemaRequest").msgclass + DeleteDataSchemaRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.DeleteDataSchemaRequest").msgclass + ListDataSchemasRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.ListDataSchemasRequest").msgclass + ListDataSchemasResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.ListDataSchemasResponse").msgclass + CreateAnnotationRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.CreateAnnotationRequest").msgclass + Annotation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.Annotation").msgclass + UserSpecifiedAnnotation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.UserSpecifiedAnnotation").msgclass + GeoCoordinate = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.GeoCoordinate").msgclass + AnnotationValue = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.AnnotationValue").msgclass + AnnotationList = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.AnnotationList").msgclass + AnnotationCustomizedStruct = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.AnnotationCustomizedStruct").msgclass + ListAnnotationsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.ListAnnotationsRequest").msgclass + ListAnnotationsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.ListAnnotationsResponse").msgclass + GetAnnotationRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.GetAnnotationRequest").msgclass + UpdateAnnotationRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.UpdateAnnotationRequest").msgclass + DeleteAnnotationRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.DeleteAnnotationRequest").msgclass + ImportAssetsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.ImportAssetsRequest").msgclass + ImportAssetsMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.ImportAssetsMetadata").msgclass + BatchOperationStatus = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.BatchOperationStatus").msgclass + ImportAssetsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.ImportAssetsResponse").msgclass + CreateSearchConfigRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.CreateSearchConfigRequest").msgclass + UpdateSearchConfigRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.UpdateSearchConfigRequest").msgclass + GetSearchConfigRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.GetSearchConfigRequest").msgclass + DeleteSearchConfigRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.DeleteSearchConfigRequest").msgclass + ListSearchConfigsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.ListSearchConfigsRequest").msgclass + ListSearchConfigsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.ListSearchConfigsResponse").msgclass + SearchConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.SearchConfig").msgclass + IndexEndpoint = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.IndexEndpoint").msgclass + IndexEndpoint::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.IndexEndpoint.State").enummodule + CreateIndexEndpointRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.CreateIndexEndpointRequest").msgclass + CreateIndexEndpointMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.CreateIndexEndpointMetadata").msgclass + GetIndexEndpointRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.GetIndexEndpointRequest").msgclass + ListIndexEndpointsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.ListIndexEndpointsRequest").msgclass + ListIndexEndpointsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.ListIndexEndpointsResponse").msgclass + UpdateIndexEndpointRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.UpdateIndexEndpointRequest").msgclass + UpdateIndexEndpointMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.UpdateIndexEndpointMetadata").msgclass + DeleteIndexEndpointRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.DeleteIndexEndpointRequest").msgclass + DeleteIndexEndpointMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.DeleteIndexEndpointMetadata").msgclass + DeployIndexRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.DeployIndexRequest").msgclass + DeployIndexResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.DeployIndexResponse").msgclass + DeployIndexMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.DeployIndexMetadata").msgclass + UndeployIndexMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.UndeployIndexMetadata").msgclass + UndeployIndexRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.UndeployIndexRequest").msgclass + UndeployIndexResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.UndeployIndexResponse").msgclass + DeployedIndex = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.DeployedIndex").msgclass + FacetProperty = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.FacetProperty").msgclass + FacetProperty::FixedRangeBucketSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.FacetProperty.FixedRangeBucketSpec").msgclass + FacetProperty::CustomRangeBucketSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.FacetProperty.CustomRangeBucketSpec").msgclass + FacetProperty::DateTimeBucketSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.FacetProperty.DateTimeBucketSpec").msgclass + FacetProperty::DateTimeBucketSpec::Granularity = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.FacetProperty.DateTimeBucketSpec.Granularity").enummodule + SearchHypernym = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.SearchHypernym").msgclass + CreateSearchHypernymRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.CreateSearchHypernymRequest").msgclass + UpdateSearchHypernymRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.UpdateSearchHypernymRequest").msgclass + GetSearchHypernymRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.GetSearchHypernymRequest").msgclass + DeleteSearchHypernymRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.DeleteSearchHypernymRequest").msgclass + ListSearchHypernymsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.ListSearchHypernymsRequest").msgclass + ListSearchHypernymsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.ListSearchHypernymsResponse").msgclass + SearchCriteriaProperty = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.SearchCriteriaProperty").msgclass + FacetValue = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.FacetValue").msgclass + FacetBucket = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.FacetBucket").msgclass + FacetBucket::Range = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.FacetBucket.Range").msgclass + FacetGroup = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.FacetGroup").msgclass + IngestAssetRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.IngestAssetRequest").msgclass + IngestAssetRequest::Config = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.IngestAssetRequest.Config").msgclass + IngestAssetRequest::Config::VideoType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.IngestAssetRequest.Config.VideoType").msgclass + IngestAssetRequest::Config::VideoType::ContainerFormat = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.IngestAssetRequest.Config.VideoType.ContainerFormat").enummodule + IngestAssetRequest::TimeIndexedData = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.IngestAssetRequest.TimeIndexedData").msgclass + IngestAssetResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.IngestAssetResponse").msgclass + ClipAssetRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.ClipAssetRequest").msgclass + ClipAssetResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.ClipAssetResponse").msgclass + ClipAssetResponse::TimeIndexedUri = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.ClipAssetResponse.TimeIndexedUri").msgclass + GenerateHlsUriRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.GenerateHlsUriRequest").msgclass + GenerateHlsUriResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.GenerateHlsUriResponse").msgclass + SearchAssetsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.SearchAssetsRequest").msgclass + SearchIndexEndpointRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.SearchIndexEndpointRequest").msgclass + ImageQuery = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.ImageQuery").msgclass + SchemaKeySortingStrategy = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.SchemaKeySortingStrategy").msgclass + SchemaKeySortingStrategy::Option = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.SchemaKeySortingStrategy.Option").msgclass + SchemaKeySortingStrategy::Option::AggregateMethod = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.SchemaKeySortingStrategy.Option.AggregateMethod").enummodule + DeleteAssetMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.DeleteAssetMetadata").msgclass + AnnotationMatchingResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.AnnotationMatchingResult").msgclass + SearchResultItem = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.SearchResultItem").msgclass + SearchAssetsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.SearchAssetsResponse").msgclass + SearchIndexEndpointResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.SearchIndexEndpointResponse").msgclass + IntRange = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.IntRange").msgclass + FloatRange = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.FloatRange").msgclass + StringArray = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.StringArray").msgclass + IntRangeArray = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.IntRangeArray").msgclass + FloatRangeArray = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.FloatRangeArray").msgclass + DateTimeRange = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.DateTimeRange").msgclass + DateTimeRangeArray = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.DateTimeRangeArray").msgclass + CircleArea = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.CircleArea").msgclass + GeoLocationArray = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.GeoLocationArray").msgclass + BoolValue = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.BoolValue").msgclass + Criteria = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.Criteria").msgclass + Partition = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.Partition").msgclass + Partition::TemporalPartition = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.Partition.TemporalPartition").msgclass + Partition::SpatialPartition = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.Partition.SpatialPartition").msgclass + Partition::RelativeTemporalPartition = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.Partition.RelativeTemporalPartition").msgclass + FacetBucketType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.FacetBucketType").enummodule + end + end + end +end diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/visionai/v1/warehouse_services_pb.rb b/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/visionai/v1/warehouse_services_pb.rb new file mode 100644 index 000000000000..12d4e35d643a --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/visionai/v1/warehouse_services_pb.rb @@ -0,0 +1,228 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/cloud/visionai/v1/warehouse.proto for package 'Google.Cloud.VisionAI.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/visionai/v1/warehouse_pb' + +module Google + module Cloud + module VisionAI + module V1 + module Warehouse + # Service that manages media content + metadata for streaming. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.cloud.visionai.v1.Warehouse' + + # Creates an asset inside corpus. + rpc :CreateAsset, ::Google::Cloud::VisionAI::V1::CreateAssetRequest, ::Google::Cloud::VisionAI::V1::Asset + # Updates an asset inside corpus. + rpc :UpdateAsset, ::Google::Cloud::VisionAI::V1::UpdateAssetRequest, ::Google::Cloud::VisionAI::V1::Asset + # Reads an asset inside corpus. + rpc :GetAsset, ::Google::Cloud::VisionAI::V1::GetAssetRequest, ::Google::Cloud::VisionAI::V1::Asset + # Lists an list of assets inside corpus. + rpc :ListAssets, ::Google::Cloud::VisionAI::V1::ListAssetsRequest, ::Google::Cloud::VisionAI::V1::ListAssetsResponse + # Deletes asset inside corpus. + rpc :DeleteAsset, ::Google::Cloud::VisionAI::V1::DeleteAssetRequest, ::Google::Longrunning::Operation + # Upload asset by specifing the asset Cloud Storage uri. + # For video warehouse, it requires users who call this API have read access + # to the cloud storage file. Once it is uploaded, it can be retrieved by + # GenerateRetrievalUrl API which by default, only can retrieve cloud storage + # files from the same project of the warehouse. To allow retrieval cloud + # storage files that are in a separate project, it requires to find the + # vision ai service account (Go to IAM, check checkbox to show "Include + # Google-provided role grants", search for "Cloud Vision AI Service Agent") + # and grant the read access of the cloud storage files to that service + # account. + rpc :UploadAsset, ::Google::Cloud::VisionAI::V1::UploadAssetRequest, ::Google::Longrunning::Operation + # Generates a signed url for downloading the asset. + # For video warehouse, please see comment of UploadAsset about how to allow + # retrieval of cloud storage files in a different project. + rpc :GenerateRetrievalUrl, ::Google::Cloud::VisionAI::V1::GenerateRetrievalUrlRequest, ::Google::Cloud::VisionAI::V1::GenerateRetrievalUrlResponse + # Analyze asset to power search capability. + rpc :AnalyzeAsset, ::Google::Cloud::VisionAI::V1::AnalyzeAssetRequest, ::Google::Longrunning::Operation + # Index one asset for search. + # Supported corpus type: Corpus.Type.VIDEO_ON_DEMAND + rpc :IndexAsset, ::Google::Cloud::VisionAI::V1::IndexAssetRequest, ::Google::Longrunning::Operation + # Remove one asset's index data for search. + # Supported corpus type: Corpus.Type.VIDEO_ON_DEMAND + rpc :RemoveIndexAsset, ::Google::Cloud::VisionAI::V1::RemoveIndexAssetRequest, ::Google::Longrunning::Operation + # Lists assets inside an index. + rpc :ViewIndexedAssets, ::Google::Cloud::VisionAI::V1::ViewIndexedAssetsRequest, ::Google::Cloud::VisionAI::V1::ViewIndexedAssetsResponse + # Creates an Index under the corpus. + rpc :CreateIndex, ::Google::Cloud::VisionAI::V1::CreateIndexRequest, ::Google::Longrunning::Operation + # Updates an Index under the corpus. + # Users can perform a metadata-only update or trigger a full index rebuild + # with different update_mask values. + rpc :UpdateIndex, ::Google::Cloud::VisionAI::V1::UpdateIndexRequest, ::Google::Longrunning::Operation + # Gets the details of a single Index under a Corpus. + rpc :GetIndex, ::Google::Cloud::VisionAI::V1::GetIndexRequest, ::Google::Cloud::VisionAI::V1::Index + # List all Indexes in a given Corpus. + rpc :ListIndexes, ::Google::Cloud::VisionAI::V1::ListIndexesRequest, ::Google::Cloud::VisionAI::V1::ListIndexesResponse + # Delete a single Index. In order to delete an index, the caller must + # make sure that it is not deployed to any index endpoint. + rpc :DeleteIndex, ::Google::Cloud::VisionAI::V1::DeleteIndexRequest, ::Google::Longrunning::Operation + # Creates a corpus inside a project. + rpc :CreateCorpus, ::Google::Cloud::VisionAI::V1::CreateCorpusRequest, ::Google::Longrunning::Operation + # Gets corpus details inside a project. + rpc :GetCorpus, ::Google::Cloud::VisionAI::V1::GetCorpusRequest, ::Google::Cloud::VisionAI::V1::Corpus + # Updates a corpus in a project. + rpc :UpdateCorpus, ::Google::Cloud::VisionAI::V1::UpdateCorpusRequest, ::Google::Cloud::VisionAI::V1::Corpus + # Lists all corpora in a project. + rpc :ListCorpora, ::Google::Cloud::VisionAI::V1::ListCorporaRequest, ::Google::Cloud::VisionAI::V1::ListCorporaResponse + # Deletes a corpus only if its empty. + # Returns empty response. + rpc :DeleteCorpus, ::Google::Cloud::VisionAI::V1::DeleteCorpusRequest, ::Google::Protobuf::Empty + # Analyzes a corpus. + rpc :AnalyzeCorpus, ::Google::Cloud::VisionAI::V1::AnalyzeCorpusRequest, ::Google::Longrunning::Operation + # Creates data schema inside corpus. + rpc :CreateDataSchema, ::Google::Cloud::VisionAI::V1::CreateDataSchemaRequest, ::Google::Cloud::VisionAI::V1::DataSchema + # Updates data schema inside corpus. + rpc :UpdateDataSchema, ::Google::Cloud::VisionAI::V1::UpdateDataSchemaRequest, ::Google::Cloud::VisionAI::V1::DataSchema + # Gets data schema inside corpus. + rpc :GetDataSchema, ::Google::Cloud::VisionAI::V1::GetDataSchemaRequest, ::Google::Cloud::VisionAI::V1::DataSchema + # Deletes data schema inside corpus. + rpc :DeleteDataSchema, ::Google::Cloud::VisionAI::V1::DeleteDataSchemaRequest, ::Google::Protobuf::Empty + # Lists a list of data schemas inside corpus. + rpc :ListDataSchemas, ::Google::Cloud::VisionAI::V1::ListDataSchemasRequest, ::Google::Cloud::VisionAI::V1::ListDataSchemasResponse + # Creates annotation inside asset. + rpc :CreateAnnotation, ::Google::Cloud::VisionAI::V1::CreateAnnotationRequest, ::Google::Cloud::VisionAI::V1::Annotation + # Reads annotation inside asset. + rpc :GetAnnotation, ::Google::Cloud::VisionAI::V1::GetAnnotationRequest, ::Google::Cloud::VisionAI::V1::Annotation + # Lists a list of annotations inside asset. + rpc :ListAnnotations, ::Google::Cloud::VisionAI::V1::ListAnnotationsRequest, ::Google::Cloud::VisionAI::V1::ListAnnotationsResponse + # Updates annotation inside asset. + rpc :UpdateAnnotation, ::Google::Cloud::VisionAI::V1::UpdateAnnotationRequest, ::Google::Cloud::VisionAI::V1::Annotation + # Deletes annotation inside asset. + rpc :DeleteAnnotation, ::Google::Cloud::VisionAI::V1::DeleteAnnotationRequest, ::Google::Protobuf::Empty + # Ingests data for the asset. It is not allowed to ingest a data chunk which + # is already expired according to TTL. + # This method is only available via the gRPC API (not HTTP since + # bi-directional streaming is not supported via HTTP). + rpc :IngestAsset, stream(::Google::Cloud::VisionAI::V1::IngestAssetRequest), stream(::Google::Cloud::VisionAI::V1::IngestAssetResponse) + # Supported by STREAM_VIDEO corpus type. + # Generates clips for downloading. The api takes in a time range, and + # generates a clip of the first content available after start_time and + # before end_time, which may overflow beyond these bounds. + # Returned clips are truncated if the total size of the clips are larger + # than 100MB. + rpc :ClipAsset, ::Google::Cloud::VisionAI::V1::ClipAssetRequest, ::Google::Cloud::VisionAI::V1::ClipAssetResponse + # Generates a uri for an HLS manifest. The api takes in a collection of time + # ranges, and generates a URI for an HLS manifest that covers all the + # requested time ranges. + rpc :GenerateHlsUri, ::Google::Cloud::VisionAI::V1::GenerateHlsUriRequest, ::Google::Cloud::VisionAI::V1::GenerateHlsUriResponse + # Imports assets (images plus annotations) from a meta file on cloud storage. + # Each row in the meta file is corresponding to an image (specified by a + # cloud storage uri) and its annotations. + rpc :ImportAssets, ::Google::Cloud::VisionAI::V1::ImportAssetsRequest, ::Google::Longrunning::Operation + # Creates a search configuration inside a corpus. + # + # Please follow the rules below to create a valid CreateSearchConfigRequest. + # --- General Rules --- + # 1. Request.search_config_id must not be associated with an existing + # SearchConfig. + # 2. Request must contain at least one non-empty search_criteria_property or + # facet_property. + # 3. mapped_fields must not be empty, and must map to existing UGA keys. + # 4. All mapped_fields must be of the same type. + # 5. All mapped_fields must share the same granularity. + # 6. All mapped_fields must share the same semantic SearchConfig match + # options. + # For property-specific rules, please reference the comments for + # FacetProperty and SearchCriteriaProperty. + rpc :CreateSearchConfig, ::Google::Cloud::VisionAI::V1::CreateSearchConfigRequest, ::Google::Cloud::VisionAI::V1::SearchConfig + # Updates a search configuration inside a corpus. + # + # Please follow the rules below to create a valid UpdateSearchConfigRequest. + # --- General Rules --- + # 1. Request.search_configuration.name must already exist. + # 2. Request must contain at least one non-empty search_criteria_property or + # facet_property. + # 3. mapped_fields must not be empty, and must map to existing UGA keys. + # 4. All mapped_fields must be of the same type. + # 5. All mapped_fields must share the same granularity. + # 6. All mapped_fields must share the same semantic SearchConfig match + # options. + # For property-specific rules, please reference the comments for + # FacetProperty and SearchCriteriaProperty. + rpc :UpdateSearchConfig, ::Google::Cloud::VisionAI::V1::UpdateSearchConfigRequest, ::Google::Cloud::VisionAI::V1::SearchConfig + # Gets a search configuration inside a corpus. + rpc :GetSearchConfig, ::Google::Cloud::VisionAI::V1::GetSearchConfigRequest, ::Google::Cloud::VisionAI::V1::SearchConfig + # Deletes a search configuration inside a corpus. + # + # For a DeleteSearchConfigRequest to be valid, + # Request.search_configuration.name must already exist. + rpc :DeleteSearchConfig, ::Google::Cloud::VisionAI::V1::DeleteSearchConfigRequest, ::Google::Protobuf::Empty + # Lists all search configurations inside a corpus. + rpc :ListSearchConfigs, ::Google::Cloud::VisionAI::V1::ListSearchConfigsRequest, ::Google::Cloud::VisionAI::V1::ListSearchConfigsResponse + # Creates a SearchHypernym inside a corpus. + rpc :CreateSearchHypernym, ::Google::Cloud::VisionAI::V1::CreateSearchHypernymRequest, ::Google::Cloud::VisionAI::V1::SearchHypernym + # Updates a SearchHypernym inside a corpus. + rpc :UpdateSearchHypernym, ::Google::Cloud::VisionAI::V1::UpdateSearchHypernymRequest, ::Google::Cloud::VisionAI::V1::SearchHypernym + # Gets a SearchHypernym inside a corpus. + rpc :GetSearchHypernym, ::Google::Cloud::VisionAI::V1::GetSearchHypernymRequest, ::Google::Cloud::VisionAI::V1::SearchHypernym + # Deletes a SearchHypernym inside a corpus. + rpc :DeleteSearchHypernym, ::Google::Cloud::VisionAI::V1::DeleteSearchHypernymRequest, ::Google::Protobuf::Empty + # Lists SearchHypernyms inside a corpus. + rpc :ListSearchHypernyms, ::Google::Cloud::VisionAI::V1::ListSearchHypernymsRequest, ::Google::Cloud::VisionAI::V1::ListSearchHypernymsResponse + # Search media asset. + rpc :SearchAssets, ::Google::Cloud::VisionAI::V1::SearchAssetsRequest, ::Google::Cloud::VisionAI::V1::SearchAssetsResponse + # Search a deployed index endpoint (IMAGE corpus type only). + rpc :SearchIndexEndpoint, ::Google::Cloud::VisionAI::V1::SearchIndexEndpointRequest, ::Google::Cloud::VisionAI::V1::SearchIndexEndpointResponse + # Creates an IndexEndpoint. + rpc :CreateIndexEndpoint, ::Google::Cloud::VisionAI::V1::CreateIndexEndpointRequest, ::Google::Longrunning::Operation + # Gets an IndexEndpoint. + rpc :GetIndexEndpoint, ::Google::Cloud::VisionAI::V1::GetIndexEndpointRequest, ::Google::Cloud::VisionAI::V1::IndexEndpoint + # Lists all IndexEndpoints in a project. + rpc :ListIndexEndpoints, ::Google::Cloud::VisionAI::V1::ListIndexEndpointsRequest, ::Google::Cloud::VisionAI::V1::ListIndexEndpointsResponse + # Updates an IndexEndpoint. + rpc :UpdateIndexEndpoint, ::Google::Cloud::VisionAI::V1::UpdateIndexEndpointRequest, ::Google::Longrunning::Operation + # Deletes an IndexEndpoint. + rpc :DeleteIndexEndpoint, ::Google::Cloud::VisionAI::V1::DeleteIndexEndpointRequest, ::Google::Longrunning::Operation + # Deploys an Index to IndexEndpoint. + rpc :DeployIndex, ::Google::Cloud::VisionAI::V1::DeployIndexRequest, ::Google::Longrunning::Operation + # Undeploys an Index from IndexEndpoint. + rpc :UndeployIndex, ::Google::Cloud::VisionAI::V1::UndeployIndexRequest, ::Google::Longrunning::Operation + # Creates a collection. + rpc :CreateCollection, ::Google::Cloud::VisionAI::V1::CreateCollectionRequest, ::Google::Longrunning::Operation + # Deletes a collection. + rpc :DeleteCollection, ::Google::Cloud::VisionAI::V1::DeleteCollectionRequest, ::Google::Longrunning::Operation + # Gets a collection. + rpc :GetCollection, ::Google::Cloud::VisionAI::V1::GetCollectionRequest, ::Google::Cloud::VisionAI::V1::Collection + # Updates a collection. + rpc :UpdateCollection, ::Google::Cloud::VisionAI::V1::UpdateCollectionRequest, ::Google::Cloud::VisionAI::V1::Collection + # Lists collections inside a corpus. + rpc :ListCollections, ::Google::Cloud::VisionAI::V1::ListCollectionsRequest, ::Google::Cloud::VisionAI::V1::ListCollectionsResponse + # Adds an item into a Collection. + rpc :AddCollectionItem, ::Google::Cloud::VisionAI::V1::AddCollectionItemRequest, ::Google::Cloud::VisionAI::V1::AddCollectionItemResponse + # Removes an item from a collection. + rpc :RemoveCollectionItem, ::Google::Cloud::VisionAI::V1::RemoveCollectionItemRequest, ::Google::Cloud::VisionAI::V1::RemoveCollectionItemResponse + # View items inside a collection. + rpc :ViewCollectionItems, ::Google::Cloud::VisionAI::V1::ViewCollectionItemsRequest, ::Google::Cloud::VisionAI::V1::ViewCollectionItemsResponse + end + + Stub = Service.rpc_stub_class + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/proto_docs/README.md b/owl-bot-staging/google-cloud-vision_ai-v1/proto_docs/README.md new file mode 100644 index 000000000000..380395ca6cf1 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/proto_docs/README.md @@ -0,0 +1,4 @@ +# Vision AI 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-vision_ai-v1/proto_docs/google/api/client.rb b/owl-bot-staging/google-cloud-vision_ai-v1/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..3ab0b096d445 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/proto_docs/google/api/client.rb @@ -0,0 +1,593 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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. + # + # Note: This field should not be used in most cases. + 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: + # library_settings: + # 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. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Php. Clobbers the php_namespace option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.php.package_name" field + # in gapic.yaml. API teams should use the protobuf php_namespace option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # library_settings: + # php_settings: + # library_package: Google\Cloud\PubSub\V1 + 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. + # + # Example: + # + # 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 + # @!attribute [rw] batching + # @return [::Google::Api::BatchingConfigProto] + # Batching configuration for an API method in client libraries. + # + # Example of a YAML configuration: + # + # publishing: + # method_settings: + # - selector: google.example.v1.ExampleService.BatchCreateExample + # batching: + # element_count_threshold: 1000 + # request_byte_threshold: 100000000 + # delay_threshold_millis: 10 + 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. + # + # Note: This feature should not be used in most cases. + # @!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 + + # `BatchingConfigProto` defines the batching configuration for an API method. + # @!attribute [rw] thresholds + # @return [::Google::Api::BatchingSettingsProto] + # The thresholds which trigger a batched request to be sent. + # @!attribute [rw] batch_descriptor + # @return [::Google::Api::BatchingDescriptorProto] + # The request and response fields used in batching. + class BatchingConfigProto + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `BatchingSettingsProto` specifies a set of batching thresholds, each of + # which acts as a trigger to send a batch of messages as a request. At least + # one threshold must be positive nonzero. + # @!attribute [rw] element_count_threshold + # @return [::Integer] + # The number of elements of a field collected into a batch which, if + # exceeded, causes the batch to be sent. + # @!attribute [rw] request_byte_threshold + # @return [::Integer] + # The aggregated size of the batched field which, if exceeded, causes the + # batch to be sent. This size is computed by aggregating the sizes of the + # request field to be batched, not of the entire request message. + # @!attribute [rw] delay_threshold + # @return [::Google::Protobuf::Duration] + # The duration after which a batch should be sent, starting from the addition + # of the first message to that batch. + # @!attribute [rw] element_count_limit + # @return [::Integer] + # The maximum number of elements collected in a batch that could be accepted + # by server. + # @!attribute [rw] request_byte_limit + # @return [::Integer] + # The maximum size of the request that could be accepted by server. + # @!attribute [rw] flow_control_element_limit + # @return [::Integer] + # The maximum number of elements allowed by flow control. + # @!attribute [rw] flow_control_byte_limit + # @return [::Integer] + # The maximum size of data allowed by flow control. + # @!attribute [rw] flow_control_limit_exceeded_behavior + # @return [::Google::Api::FlowControlLimitExceededBehaviorProto] + # The behavior to take when the flow control limit is exceeded. + class BatchingSettingsProto + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `BatchingDescriptorProto` specifies the fields of the request message to be + # used for batching, and, optionally, the fields of the response message to be + # used for demultiplexing. + # @!attribute [rw] batched_field + # @return [::String] + # The repeated field in the request message to be aggregated by batching. + # @!attribute [rw] discriminator_fields + # @return [::Array<::String>] + # A list of the fields in the request message. Two requests will be batched + # together only if the values of every field specified in + # `request_discriminator_fields` is equal between the two requests. + # @!attribute [rw] subresponse_field + # @return [::String] + # Optional. When present, indicates the field in the response message to be + # used to demultiplex the response into multiple response messages, in + # correspondence with the multiple request messages originally batched + # together. + class BatchingDescriptorProto + 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 + + # The behavior to take when the flow control limit is exceeded. + module FlowControlLimitExceededBehaviorProto + # Default behavior, system-defined. + UNSET_BEHAVIOR = 0 + + # Stop operation, raise error. + THROW_EXCEPTION = 1 + + # Pause operation until limit clears. + BLOCK = 2 + + # Continue operation, disregard limit. + IGNORE = 3 + end + end +end diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/proto_docs/google/api/field_behavior.rb b/owl-bot-staging/google-cloud-vision_ai-v1/proto_docs/google/api/field_behavior.rb new file mode 100644 index 000000000000..582be187d115 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-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-vision_ai-v1/proto_docs/google/api/launch_stage.rb b/owl-bot-staging/google-cloud-vision_ai-v1/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..9392a413fb1b --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-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-vision_ai-v1/proto_docs/google/api/resource.rb b/owl-bot-staging/google-cloud-vision_ai-v1/proto_docs/google/api/resource.rb new file mode 100644 index 000000000000..25dec4847ac1 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-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-vision_ai-v1/proto_docs/google/cloud/visionai/v1/annotations.rb b/owl-bot-staging/google-cloud-vision_ai-v1/proto_docs/google/cloud/visionai/v1/annotations.rb new file mode 100644 index 000000000000..d6d8d90f615b --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/proto_docs/google/cloud/visionai/v1/annotations.rb @@ -0,0 +1,791 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 VisionAI + module V1 + # Output format for Personal Protective Equipment Detection Operator. + # @!attribute [rw] current_time + # @return [::Google::Protobuf::Timestamp] + # Current timestamp. + # @!attribute [rw] detected_persons + # @return [::Array<::Google::Cloud::VisionAI::V1::PersonalProtectiveEquipmentDetectionOutput::DetectedPerson>] + # A list of DetectedPersons. + class PersonalProtectiveEquipmentDetectionOutput + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The entity info for annotations from person detection prediction result. + # @!attribute [rw] person_entity_id + # @return [::Integer] + # Entity id. + class PersonEntity + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The entity info for annotations from PPE detection prediction result. + # @!attribute [rw] ppe_label_id + # @return [::Integer] + # Label id. + # @!attribute [rw] ppe_label_string + # @return [::String] + # Human readable string of the label (Examples: helmet, glove, mask). + # @!attribute [rw] ppe_supercategory_label_string + # @return [::String] + # Human readable string of the super category label (Examples: head_cover, + # hands_cover, face_cover). + # @!attribute [rw] ppe_entity_id + # @return [::Integer] + # Entity id. + class PPEEntity + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Bounding Box in the normalized coordinates. + # @!attribute [rw] xmin + # @return [::Float] + # Min in x coordinate. + # @!attribute [rw] ymin + # @return [::Float] + # Min in y coordinate. + # @!attribute [rw] width + # @return [::Float] + # Width of the bounding box. + # @!attribute [rw] height + # @return [::Float] + # Height of the bounding box. + class NormalizedBoundingBox + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # PersonIdentified box contains the location and the entity info of the + # person. + # @!attribute [rw] box_id + # @return [::Integer] + # An unique id for this box. + # @!attribute [rw] normalized_bounding_box + # @return [::Google::Cloud::VisionAI::V1::PersonalProtectiveEquipmentDetectionOutput::NormalizedBoundingBox] + # Bounding Box in the normalized coordinates. + # @!attribute [rw] confidence_score + # @return [::Float] + # Confidence score associated with this box. + # @!attribute [rw] person_entity + # @return [::Google::Cloud::VisionAI::V1::PersonalProtectiveEquipmentDetectionOutput::PersonEntity] + # Person entity info. + class PersonIdentifiedBox + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # PPEIdentified box contains the location and the entity info of the PPE. + # @!attribute [rw] box_id + # @return [::Integer] + # An unique id for this box. + # @!attribute [rw] normalized_bounding_box + # @return [::Google::Cloud::VisionAI::V1::PersonalProtectiveEquipmentDetectionOutput::NormalizedBoundingBox] + # Bounding Box in the normalized coordinates. + # @!attribute [rw] confidence_score + # @return [::Float] + # Confidence score associated with this box. + # @!attribute [rw] ppe_entity + # @return [::Google::Cloud::VisionAI::V1::PersonalProtectiveEquipmentDetectionOutput::PPEEntity] + # PPE entity info. + class PPEIdentifiedBox + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Detected Person contains the detected person and their associated + # ppes and their protecting information. + # @!attribute [rw] person_id + # @return [::Integer] + # The id of detected person. + # @!attribute [rw] detected_person_identified_box + # @return [::Google::Cloud::VisionAI::V1::PersonalProtectiveEquipmentDetectionOutput::PersonIdentifiedBox] + # The info of detected person identified box. + # @!attribute [rw] detected_ppe_identified_boxes + # @return [::Array<::Google::Cloud::VisionAI::V1::PersonalProtectiveEquipmentDetectionOutput::PPEIdentifiedBox>] + # The info of detected person associated ppe identified boxes. + # @!attribute [rw] face_coverage_score + # @return [::Float] + # Coverage score for each body part. + # Coverage score for face. + # @!attribute [rw] eyes_coverage_score + # @return [::Float] + # Coverage score for eyes. + # @!attribute [rw] head_coverage_score + # @return [::Float] + # Coverage score for head. + # @!attribute [rw] hands_coverage_score + # @return [::Float] + # Coverage score for hands. + # @!attribute [rw] body_coverage_score + # @return [::Float] + # Coverage score for body. + # @!attribute [rw] feet_coverage_score + # @return [::Float] + # Coverage score for feet. + class DetectedPerson + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Prediction output format for Generic Object Detection. + # @!attribute [rw] current_time + # @return [::Google::Protobuf::Timestamp] + # Current timestamp. + # @!attribute [rw] identified_boxes + # @return [::Array<::Google::Cloud::VisionAI::V1::ObjectDetectionPredictionResult::IdentifiedBox>] + # A list of identified boxes. + class ObjectDetectionPredictionResult + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The entity info for annotations from object detection prediction result. + # @!attribute [rw] label_id + # @return [::Integer] + # Label id. + # @!attribute [rw] label_string + # @return [::String] + # Human readable string of the label. + class Entity + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Identified box contains location and the entity of the object. + # @!attribute [rw] box_id + # @return [::Integer] + # An unique id for this box. + # @!attribute [rw] normalized_bounding_box + # @return [::Google::Cloud::VisionAI::V1::ObjectDetectionPredictionResult::IdentifiedBox::NormalizedBoundingBox] + # Bounding Box in the normalized coordinates. + # @!attribute [rw] confidence_score + # @return [::Float] + # Confidence score associated with this box. + # @!attribute [rw] entity + # @return [::Google::Cloud::VisionAI::V1::ObjectDetectionPredictionResult::Entity] + # Entity of this box. + class IdentifiedBox + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Bounding Box in the normalized coordinates. + # @!attribute [rw] xmin + # @return [::Float] + # Min in x coordinate. + # @!attribute [rw] ymin + # @return [::Float] + # Min in y coordinate. + # @!attribute [rw] width + # @return [::Float] + # Width of the bounding box. + # @!attribute [rw] height + # @return [::Float] + # Height of the bounding box. + class NormalizedBoundingBox + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + + # Prediction output format for Image Object Detection. + # @!attribute [rw] ids + # @return [::Array<::Integer>] + # The resource IDs of the AnnotationSpecs that had been identified, ordered + # by the confidence score descendingly. It is the id segment instead of full + # resource name. + # @!attribute [rw] display_names + # @return [::Array<::String>] + # The display names of the AnnotationSpecs that had been identified, order + # matches the IDs. + # @!attribute [rw] confidences + # @return [::Array<::Float>] + # The Model's confidences in correctness of the predicted IDs, higher value + # means higher confidence. Order matches the Ids. + # @!attribute [rw] bboxes + # @return [::Array<::Google::Protobuf::ListValue>] + # Bounding boxes, i.e. the rectangles over the image, that pinpoint + # the found AnnotationSpecs. Given in order that matches the IDs. Each + # bounding box is an array of 4 numbers `xMin`, `xMax`, `yMin`, and + # `yMax`, which represent the extremal coordinates of the box. They are + # relative to the image size, and the point 0,0 is in the top left + # of the image. + class ImageObjectDetectionPredictionResult + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Prediction output format for Image and Text Classification. + # @!attribute [rw] ids + # @return [::Array<::Integer>] + # The resource IDs of the AnnotationSpecs that had been identified. + # @!attribute [rw] display_names + # @return [::Array<::String>] + # The display names of the AnnotationSpecs that had been identified, order + # matches the IDs. + # @!attribute [rw] confidences + # @return [::Array<::Float>] + # The Model's confidences in correctness of the predicted IDs, higher value + # means higher confidence. Order matches the Ids. + class ClassificationPredictionResult + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Prediction output format for Image Segmentation. + # @!attribute [rw] category_mask + # @return [::String] + # A PNG image where each pixel in the mask represents the category in which + # the pixel in the original image was predicted to belong to. The size of + # this image will be the same as the original image. The mapping between the + # AnntoationSpec and the color can be found in model's metadata. The model + # will choose the most likely category and if none of the categories reach + # the confidence threshold, the pixel will be marked as background. + # @!attribute [rw] confidence_mask + # @return [::String] + # A one channel image which is encoded as an 8bit lossless PNG. The size of + # the image will be the same as the original image. For a specific pixel, + # darker color means less confidence in correctness of the cateogry in the + # categoryMask for the corresponding pixel. Black means no confidence and + # white means complete confidence. + class ImageSegmentationPredictionResult + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Prediction output format for Video Action Recognition. + # @!attribute [rw] segment_start_time + # @return [::Google::Protobuf::Timestamp] + # The beginning, inclusive, of the video's time segment in which the + # actions have been identified. + # @!attribute [rw] segment_end_time + # @return [::Google::Protobuf::Timestamp] + # The end, inclusive, of the video's time segment in which the actions have + # been identified. Particularly, if the end is the same as the start, it + # means the identification happens on a specific video frame. + # @!attribute [rw] actions + # @return [::Array<::Google::Cloud::VisionAI::V1::VideoActionRecognitionPredictionResult::IdentifiedAction>] + # All of the actions identified in the time range. + class VideoActionRecognitionPredictionResult + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Each IdentifiedAction is one particular identification of an action + # specified with the AnnotationSpec id, display_name and the associated + # confidence score. + # @!attribute [rw] id + # @return [::String] + # The resource ID of the AnnotationSpec that had been identified. + # @!attribute [rw] display_name + # @return [::String] + # The display name of the AnnotationSpec that had been identified. + # @!attribute [rw] confidence + # @return [::Float] + # The Model's confidence in correction of this identification, higher + # value means higher confidence. + class IdentifiedAction + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Prediction output format for Video Object Tracking. + # @!attribute [rw] segment_start_time + # @return [::Google::Protobuf::Timestamp] + # The beginning, inclusive, of the video's time segment in which the + # current identifications happens. + # @!attribute [rw] segment_end_time + # @return [::Google::Protobuf::Timestamp] + # The end, inclusive, of the video's time segment in which the current + # identifications happen. Particularly, if the end is the same as the start, + # it means the identifications happen on a specific video frame. + # @!attribute [rw] objects + # @return [::Array<::Google::Cloud::VisionAI::V1::VideoObjectTrackingPredictionResult::DetectedObject>] + # All of the objects detected in the specified time range. + class VideoObjectTrackingPredictionResult + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Boundingbox for detected object. I.e. the rectangle over the video frame + # pinpointing the found AnnotationSpec. The coordinates are relative to the + # frame size, and the point 0,0 is in the top left of the frame. + # @!attribute [rw] x_min + # @return [::Float] + # The leftmost coordinate of the bounding box. + # @!attribute [rw] x_max + # @return [::Float] + # The rightmost coordinate of the bounding box. + # @!attribute [rw] y_min + # @return [::Float] + # The topmost coordinate of the bounding box. + # @!attribute [rw] y_max + # @return [::Float] + # The bottommost coordinate of the bounding box. + class BoundingBox + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Each DetectedObject is one particular identification of an object + # specified with the AnnotationSpec id and display_name, the bounding box, + # the associated confidence score and the corresponding track_id. + # @!attribute [rw] id + # @return [::String] + # The resource ID of the AnnotationSpec that had been identified. + # @!attribute [rw] display_name + # @return [::String] + # The display name of the AnnotationSpec that had been identified. + # @!attribute [rw] bounding_box + # @return [::Google::Cloud::VisionAI::V1::VideoObjectTrackingPredictionResult::BoundingBox] + # Boundingbox. + # @!attribute [rw] confidence + # @return [::Float] + # The Model's confidence in correction of this identification, higher + # value means higher confidence. + # @!attribute [rw] track_id + # @return [::Integer] + # The same object may be identified on muitiple frames which are typical + # adjacent. The set of frames where a particular object has been detected + # form a track. This track_id can be used to trace down all frames for an + # detected object. + class DetectedObject + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Prediction output format for Video Classification. + # @!attribute [rw] segment_start_time + # @return [::Google::Protobuf::Timestamp] + # The beginning, inclusive, of the video's time segment in which the + # classifications have been identified. + # @!attribute [rw] segment_end_time + # @return [::Google::Protobuf::Timestamp] + # The end, inclusive, of the video's time segment in which the + # classifications have been identified. Particularly, if the end is the same + # as the start, it means the identification happens on a specific video + # frame. + # @!attribute [rw] classifications + # @return [::Array<::Google::Cloud::VisionAI::V1::VideoClassificationPredictionResult::IdentifiedClassification>] + # All of the classifications identified in the time range. + class VideoClassificationPredictionResult + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Each IdentifiedClassification is one particular identification of an + # classification specified with the AnnotationSpec id and display_name, + # and the associated confidence score. + # @!attribute [rw] id + # @return [::String] + # The resource ID of the AnnotationSpec that had been identified. + # @!attribute [rw] display_name + # @return [::String] + # The display name of the AnnotationSpec that had been identified. + # @!attribute [rw] confidence + # @return [::Float] + # The Model's confidence in correction of this identification, higher + # value means higher confidence. + class IdentifiedClassification + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The prediction result proto for occupancy counting. + # @!attribute [rw] current_time + # @return [::Google::Protobuf::Timestamp] + # Current timestamp. + # @!attribute [rw] identified_boxes + # @return [::Array<::Google::Cloud::VisionAI::V1::OccupancyCountingPredictionResult::IdentifiedBox>] + # A list of identified boxes. + # @!attribute [rw] stats + # @return [::Google::Cloud::VisionAI::V1::OccupancyCountingPredictionResult::Stats] + # Detection statistics. + # @!attribute [rw] track_info + # @return [::Array<::Google::Cloud::VisionAI::V1::OccupancyCountingPredictionResult::TrackInfo>] + # Track related information. All the tracks that are live at this timestamp. + # It only exists if tracking is enabled. + # @!attribute [rw] dwell_time_info + # @return [::Array<::Google::Cloud::VisionAI::V1::OccupancyCountingPredictionResult::DwellTimeInfo>] + # Dwell time related information. All the tracks that are live in a given + # zone with a start and end dwell time timestamp + # @!attribute [rw] pts + # @return [::Integer] + # The presentation timestamp of the frame. + class OccupancyCountingPredictionResult + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The entity info for annotations from occupancy counting operator. + # @!attribute [rw] label_id + # @return [::Integer] + # Label id. + # @!attribute [rw] label_string + # @return [::String] + # Human readable string of the label. + class Entity + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Identified box contains location and the entity of the object. + # @!attribute [rw] box_id + # @return [::Integer] + # An unique id for this box. + # @!attribute [rw] normalized_bounding_box + # @return [::Google::Cloud::VisionAI::V1::OccupancyCountingPredictionResult::IdentifiedBox::NormalizedBoundingBox] + # Bounding Box in the normalized coordinates. + # @!attribute [rw] score + # @return [::Float] + # Confidence score associated with this box. + # @!attribute [rw] entity + # @return [::Google::Cloud::VisionAI::V1::OccupancyCountingPredictionResult::Entity] + # Entity of this box. + # @!attribute [rw] track_id + # @return [::Integer] + # An unique id to identify a track. It should be consistent across frames. + # It only exists if tracking is enabled. + class IdentifiedBox + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Bounding Box in the normalized coordinates. + # @!attribute [rw] xmin + # @return [::Float] + # Min in x coordinate. + # @!attribute [rw] ymin + # @return [::Float] + # Min in y coordinate. + # @!attribute [rw] width + # @return [::Float] + # Width of the bounding box. + # @!attribute [rw] height + # @return [::Float] + # Height of the bounding box. + class NormalizedBoundingBox + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The statistics info for annotations from occupancy counting operator. + # @!attribute [rw] full_frame_count + # @return [::Array<::Google::Cloud::VisionAI::V1::OccupancyCountingPredictionResult::Stats::ObjectCount>] + # Counts of the full frame. + # @!attribute [rw] crossing_line_counts + # @return [::Array<::Google::Cloud::VisionAI::V1::OccupancyCountingPredictionResult::Stats::CrossingLineCount>] + # Crossing line counts. + # @!attribute [rw] active_zone_counts + # @return [::Array<::Google::Cloud::VisionAI::V1::OccupancyCountingPredictionResult::Stats::ActiveZoneCount>] + # Active zone counts. + class Stats + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The object info and instant count for annotations from occupancy counting + # operator. + # @!attribute [rw] entity + # @return [::Google::Cloud::VisionAI::V1::OccupancyCountingPredictionResult::Entity] + # Entity of this object. + # @!attribute [rw] count + # @return [::Integer] + # Count of the object. + class ObjectCount + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The object info and accumulated count for annotations from occupancy + # counting operator. + # @!attribute [rw] start_time + # @return [::Google::Protobuf::Timestamp] + # The start time of the accumulated count. + # @!attribute [rw] object_count + # @return [::Google::Cloud::VisionAI::V1::OccupancyCountingPredictionResult::Stats::ObjectCount] + # The object count for the accumulated count. + class AccumulatedObjectCount + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Message for Crossing line count. + # @!attribute [rw] annotation + # @return [::Google::Cloud::VisionAI::V1::StreamAnnotation] + # Line annotation from the user. + # @!attribute [rw] positive_direction_counts + # @return [::Array<::Google::Cloud::VisionAI::V1::OccupancyCountingPredictionResult::Stats::ObjectCount>] + # The direction that follows the right hand rule. + # @!attribute [rw] negative_direction_counts + # @return [::Array<::Google::Cloud::VisionAI::V1::OccupancyCountingPredictionResult::Stats::ObjectCount>] + # The direction that is opposite to the right hand rule. + # @!attribute [rw] accumulated_positive_direction_counts + # @return [::Array<::Google::Cloud::VisionAI::V1::OccupancyCountingPredictionResult::Stats::AccumulatedObjectCount>] + # The accumulated positive count. + # @!attribute [rw] accumulated_negative_direction_counts + # @return [::Array<::Google::Cloud::VisionAI::V1::OccupancyCountingPredictionResult::Stats::AccumulatedObjectCount>] + # The accumulated negative count. + class CrossingLineCount + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Message for the active zone count. + # @!attribute [rw] annotation + # @return [::Google::Cloud::VisionAI::V1::StreamAnnotation] + # Active zone annotation from the user. + # @!attribute [rw] counts + # @return [::Array<::Google::Cloud::VisionAI::V1::OccupancyCountingPredictionResult::Stats::ObjectCount>] + # Counts in the zone. + class ActiveZoneCount + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The track info for annotations from occupancy counting operator. + # @!attribute [rw] track_id + # @return [::String] + # An unique id to identify a track. It should be consistent across frames. + # @!attribute [rw] start_time + # @return [::Google::Protobuf::Timestamp] + # Start timestamp of this track. + class TrackInfo + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The dwell time info for annotations from occupancy counting operator. + # @!attribute [rw] track_id + # @return [::String] + # An unique id to identify a track. It should be consistent across frames. + # @!attribute [rw] zone_id + # @return [::String] + # The unique id for the zone in which the object is dwelling/waiting. + # @!attribute [rw] dwell_start_time + # @return [::Google::Protobuf::Timestamp] + # The beginning time when a dwelling object has been identified in a zone. + # @!attribute [rw] dwell_end_time + # @return [::Google::Protobuf::Timestamp] + # The end time when a dwelling object has exited in a zone. + class DwellTimeInfo + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # message about annotations about Vision AI stream resource. + # @!attribute [rw] active_zone + # @return [::Google::Cloud::VisionAI::V1::NormalizedPolygon] + # Annotation for type ACTIVE_ZONE + # + # Note: The following fields are mutually exclusive: `active_zone`, `crossing_line`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] crossing_line + # @return [::Google::Cloud::VisionAI::V1::NormalizedPolyline] + # Annotation for type CROSSING_LINE + # + # Note: The following fields are mutually exclusive: `crossing_line`, `active_zone`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] id + # @return [::String] + # ID of the annotation. It must be unique when used in the certain context. + # For example, all the annotations to one input streams of a Vision AI + # application. + # @!attribute [rw] display_name + # @return [::String] + # User-friendly name for the annotation. + # @!attribute [rw] source_stream + # @return [::String] + # The Vision AI stream resource name. + # @!attribute [rw] type + # @return [::Google::Cloud::VisionAI::V1::StreamAnnotationType] + # The actual type of Annotation. + class StreamAnnotation + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A wrapper of repeated StreamAnnotation. + # @!attribute [rw] stream_annotations + # @return [::Array<::Google::Cloud::VisionAI::V1::StreamAnnotation>] + # Multiple annotations. + class StreamAnnotations + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Normalized Polygon. + # @!attribute [rw] normalized_vertices + # @return [::Array<::Google::Cloud::VisionAI::V1::NormalizedVertex>] + # The bounding polygon normalized vertices. Top left corner of the image + # will be [0, 0]. + class NormalizedPolygon + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Normalized Pplyline, which represents a curve consisting of connected + # straight-line segments. + # @!attribute [rw] normalized_vertices + # @return [::Array<::Google::Cloud::VisionAI::V1::NormalizedVertex>] + # A sequence of vertices connected by straight lines. + class NormalizedPolyline + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A vertex represents a 2D point in the image. + # NOTE: the normalized vertex coordinates are relative to the original image + # and range from 0 to 1. + # @!attribute [rw] x + # @return [::Float] + # X coordinate. + # @!attribute [rw] y + # @return [::Float] + # Y coordinate. + class NormalizedVertex + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Message of essential metadata of App Platform. + # This message is usually attached to a certain processor output annotation for + # customer to identify the source of the data. + # @!attribute [rw] application + # @return [::String] + # The application resource name. + # @!attribute [rw] instance_id + # @return [::String] + # The instance resource id. Instance is the nested resource of application + # under collection 'instances'. + # @!attribute [rw] node + # @return [::String] + # The node name of the application graph. + # @!attribute [rw] processor + # @return [::String] + # The referred processor resource name of the application node. + class AppPlatformMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # For any cloud function based customer processing logic, customer's cloud + # function is expected to receive AppPlatformCloudFunctionRequest as request + # and send back AppPlatformCloudFunctionResponse as response. + # Message of request from AppPlatform to Cloud Function. + # @!attribute [rw] app_platform_metadata + # @return [::Google::Cloud::VisionAI::V1::AppPlatformMetadata] + # The metadata of the AppPlatform for customer to identify the source of the + # payload. + # @!attribute [rw] annotations + # @return [::Array<::Google::Cloud::VisionAI::V1::AppPlatformCloudFunctionRequest::StructedInputAnnotation>] + # The actual annotations to be processed by the customized Cloud Function. + class AppPlatformCloudFunctionRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # A general annotation message that uses struct format to represent different + # concrete annotation protobufs. + # @!attribute [rw] ingestion_time_micros + # @return [::Integer] + # The ingestion time of the current annotation. + # @!attribute [rw] annotation + # @return [::Google::Protobuf::Struct] + # The struct format of the actual annotation. + class StructedInputAnnotation + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Message of the response from customer's Cloud Function to AppPlatform. + # @!attribute [rw] annotations + # @return [::Array<::Google::Cloud::VisionAI::V1::AppPlatformCloudFunctionResponse::StructedOutputAnnotation>] + # The modified annotations that is returned back to AppPlatform. + # If the annotations fields are empty, then those annotations will be dropped + # by AppPlatform. + # @!attribute [rw] annotation_passthrough + # @return [::Boolean] + # If set to true, AppPlatform will use original annotations instead of + # dropping them, even if it is empty in the annotations filed. + # @!attribute [rw] events + # @return [::Array<::Google::Cloud::VisionAI::V1::AppPlatformEventBody>] + # The event notifications that is returned back to AppPlatform. Typically it + # will then be configured to be consumed/forwared to a operator that handles + # events, such as Pub/Sub operator. + class AppPlatformCloudFunctionResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # A general annotation message that uses struct format to represent different + # concrete annotation protobufs. + # @!attribute [rw] annotation + # @return [::Google::Protobuf::Struct] + # The struct format of the actual annotation. + class StructedOutputAnnotation + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Message of content of appPlatform event + # @!attribute [rw] event_message + # @return [::String] + # Human readable string of the event like "There are more than 6 people in + # the scene". or "Shelf is empty!". + # @!attribute [rw] payload + # @return [::Google::Protobuf::Struct] + # For the case of Pub/Sub, it will be stored in the message attributes. + # ​​pubsub.proto + # @!attribute [rw] event_id + # @return [::String] + # User defined Event Id, used to classify event, within a delivery interval, + # events from the same application instance with the same id will be + # de-duplicated & only first one will be sent out. Empty event_id will be + # treated as "". + class AppPlatformEventBody + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Enum describing all possible types of a stream annotation. + module StreamAnnotationType + # Type UNSPECIFIED. + STREAM_ANNOTATION_TYPE_UNSPECIFIED = 0 + + # active_zone annotation defines a polygon on top of the content from an + # image/video based stream, following processing will only focus on the + # content inside the active zone. + STREAM_ANNOTATION_TYPE_ACTIVE_ZONE = 1 + + # crossing_line annotation defines a polyline on top of the content from an + # image/video based Vision AI stream, events happening across the line will + # be captured. For example, the counts of people who goes acroos the line + # in Occupancy Analytic Processor. + STREAM_ANNOTATION_TYPE_CROSSING_LINE = 2 + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/proto_docs/google/cloud/visionai/v1/common.rb b/owl-bot-staging/google-cloud-vision_ai-v1/proto_docs/google/cloud/visionai/v1/common.rb new file mode 100644 index 000000000000..2af1e72486bf --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/proto_docs/google/cloud/visionai/v1/common.rb @@ -0,0 +1,134 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 VisionAI + module V1 + # Message describing the Cluster object. + # @!attribute [r] name + # @return [::String] + # Output only. Name of the resource. + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The create timestamp. + # @!attribute [r] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The update timestamp. + # @!attribute [rw] labels + # @return [::Google::Protobuf::Map{::String => ::String}] + # Labels as key value pairs + # @!attribute [rw] annotations + # @return [::Google::Protobuf::Map{::String => ::String}] + # Annotations to allow clients to store small amounts of arbitrary data. + # @!attribute [r] dataplane_service_endpoint + # @return [::String] + # Output only. The DNS name of the data plane service + # @!attribute [r] state + # @return [::Google::Cloud::VisionAI::V1::Cluster::State] + # Output only. The current state of the cluster. + # @!attribute [r] psc_target + # @return [::String] + # Output only. The private service connection service target name. + class Cluster + 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 + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class AnnotationsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The current state of the cluster. + module State + # Not set. + STATE_UNSPECIFIED = 0 + + # The PROVISIONING state indicates the cluster is being created. + PROVISIONING = 1 + + # The RUNNING state indicates the cluster has been created and is fully + # usable. + RUNNING = 2 + + # The STOPPING state indicates the cluster is being deleted. + STOPPING = 3 + + # The ERROR state indicates the cluster is unusable. It will be + # automatically deleted. + ERROR = 4 + end + end + + # Represents the metadata of the long-running operation. + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time the operation was created. + # @!attribute [r] end_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time the operation finished running. + # @!attribute [r] target + # @return [::String] + # Output only. Server-defined resource path for the target of the operation. + # @!attribute [r] verb + # @return [::String] + # Output only. Name of the verb executed by the operation. + # @!attribute [r] status_message + # @return [::String] + # Output only. Human-readable status of the operation, if any. + # @!attribute [r] requested_cancellation + # @return [::Boolean] + # Output only. Identifies whether the user has requested cancellation + # of the operation. Operations that have successfully been cancelled + # have [Operation.error][] value with a + # {::Google::Rpc::Status#code google.rpc.Status.code} of 1, corresponding to + # `Code.CANCELLED`. + # @!attribute [r] api_version + # @return [::String] + # Output only. API version used to start the operation. + class OperationMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The Google Cloud Storage location for the input content. + # @!attribute [rw] uris + # @return [::Array<::String>] + # Required. References to a Google Cloud Storage paths. + class GcsSource + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/proto_docs/google/cloud/visionai/v1/health_service.rb b/owl-bot-staging/google-cloud-vision_ai-v1/proto_docs/google/cloud/visionai/v1/health_service.rb new file mode 100644 index 000000000000..2a2afdedf640 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/proto_docs/google/cloud/visionai/v1/health_service.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 VisionAI + module V1 + # HealthCheckRequest is the request message for Check. + # @!attribute [rw] cluster + # @return [::String] + # The parent of the resource. + class HealthCheckRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # HealthCheckResponse is the response message for Check. + # @!attribute [rw] healthy + # @return [::Boolean] + # Indicates whether the cluster is in healthy state or not. + # @!attribute [rw] reason + # @return [::String] + # Reason of why the cluster is in unhealthy state. + # @!attribute [rw] cluster_info + # @return [::Google::Cloud::VisionAI::V1::ClusterInfo] + # Other information of the cluster client may be interested. + class HealthCheckResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] streams_count + # @return [::Integer] + # The number of active streams in the cluster. + # @!attribute [rw] processes_count + # @return [::Integer] + # The number of active processes in the cluster. + class ClusterInfo + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/proto_docs/google/cloud/visionai/v1/lva.rb b/owl-bot-staging/google-cloud-vision_ai-v1/proto_docs/google/cloud/visionai/v1/lva.rb new file mode 100644 index 000000000000..105bb33e2a19 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/proto_docs/google/cloud/visionai/v1/lva.rb @@ -0,0 +1,353 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 VisionAI + module V1 + # Defines the interface of an Operator. + # + # Arguments to an operator are input/output streams that are getting + # processesed/returned while attributes are fixed configuration parameters. + # @!attribute [rw] operator + # @return [::String] + # The name of this operator. + # + # Tentatively [A-Z][a-zA-Z0-9]*, e.g., BboxCounter, PetDetector, + # PetDetector1. + # @!attribute [rw] input_args + # @return [::Array<::Google::Cloud::VisionAI::V1::OperatorDefinition::ArgumentDefinition>] + # Declares input arguments. + # @!attribute [rw] output_args + # @return [::Array<::Google::Cloud::VisionAI::V1::OperatorDefinition::ArgumentDefinition>] + # Declares output arguments. + # @!attribute [rw] attributes + # @return [::Array<::Google::Cloud::VisionAI::V1::OperatorDefinition::AttributeDefinition>] + # Declares the attributes. + # @!attribute [rw] resources + # @return [::Google::Cloud::VisionAI::V1::ResourceSpecification] + # The resources for running the operator. + # @!attribute [rw] short_description + # @return [::String] + # Short description of the operator. + # @!attribute [rw] description + # @return [::String] + # Full description of the operator. + class OperatorDefinition + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Defines an argument to an operator. + # + # Used for both inputs and outputs. + # @!attribute [rw] argument + # @return [::String] + # The name of the argument. + # + # Tentatively [a-z]([_a-z0-9]*[a-z0-9])?, e.g., video, audio, + # high_fps_frame. + # @!attribute [rw] type + # @return [::String] + # The data type of the argument. + # + # This should match the textual representation of a stream/Packet type. + class ArgumentDefinition + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Defines an attribute of an operator. + # @!attribute [rw] attribute + # @return [::String] + # The name of the attribute. + # + # Tentatively [a-z]([_a-z0-9]*[a-z0-9])?, e.g., max_frames_per_video, + # resize_height. + # @!attribute [rw] type + # @return [::String] + # The type of this attribute. + # + # See attribute_value.proto for possibilities. + # @!attribute [rw] default_value + # @return [::Google::Cloud::VisionAI::V1::AttributeValue] + # The default value for the attribute. + class AttributeDefinition + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # ResourceSpec collects a set of resources that can + # be used to specify requests and requirements. + # + # Note: Highly experimental as this can be runtime dependent. + # Can use the "extras" field to experiment first before trying + # to abstract it. + # @!attribute [rw] cpu + # @return [::String] + # CPU specification. + # + # Examples: + # "100m", "0.5", "1", "2", ... correspond to + # 0.1, half, 1, or 2 cpus. + # + # Leave empty to let the system decide. + # + # Note that this does *not* determine the cpu vender/make, + # or its underlying clock speed and specific SIMD features. + # It is only the amount time it requires in timeslicing. + # @!attribute [rw] cpu_limits + # @return [::String] + # CPU limit. + # + # Examples: + # "100m", "0.5", "1", "2", ... correspond to + # 0.1, half, 1, or 2 cpus. + # + # Leave empty to indicate no limit. + # @!attribute [rw] memory + # @return [::String] + # Memory specification (in bytes). + # + # Examples: + # "128974848", "129e6", "129M", "123Mi", ... correspond to + # 128974848 bytes, 129000000 bytes, 129 mebibytes, 123 megabytes. + # + # Leave empty to let the system decide. + # @!attribute [rw] memory_limits + # @return [::String] + # Memory usage limits. + # + # Examples: + # "128974848", "129e6", "129M", "123Mi", ... correspond to + # 128974848 bytes, 129000000 bytes, 129 mebibytes, 123 megabytes. + # + # Leave empty to indicate no limit. + # @!attribute [rw] gpus + # @return [::Integer] + # Number of gpus. + # @!attribute [rw] latency_budget_ms + # @return [::Integer] + # The maximum latency that this operator may use to process an element. + # + # If non positive, then a system default will be used. + # Operator developers should arrange for the system compute resources to be + # aligned with this latency budget; e.g. if you want a ML model to produce + # results within 500ms, then you should make sure you request enough + # cpu/gpu/memory to achieve that. + class ResourceSpecification + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Represents an actual value of an operator attribute. + # @!attribute [rw] i + # @return [::Integer] + # int. + # + # Note: The following fields are mutually exclusive: `i`, `f`, `b`, `s`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] f + # @return [::Float] + # float. + # + # Note: The following fields are mutually exclusive: `f`, `i`, `b`, `s`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] b + # @return [::Boolean] + # bool. + # + # Note: The following fields are mutually exclusive: `b`, `i`, `f`, `s`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] s + # @return [::String] + # string. + # + # Note: The following fields are mutually exclusive: `s`, `i`, `f`, `b`. If a field in that set is populated, all other fields in the set will automatically be cleared. + class AttributeValue + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Defines an Analyzer. + # + # An analyzer processes data from its input streams using the logic defined in + # the Operator that it represents. Of course, it produces data for the output + # streams declared in the Operator. + # @!attribute [rw] analyzer + # @return [::String] + # The name of this analyzer. + # + # Tentatively [a-z][a-z0-9]*(_[a-z0-9]+)*. + # @!attribute [rw] operator + # @return [::String] + # The name of the operator that this analyzer runs. + # + # Must match the name of a supported operator. + # @!attribute [rw] inputs + # @return [::Array<::Google::Cloud::VisionAI::V1::AnalyzerDefinition::StreamInput>] + # Input streams. + # @!attribute [rw] attrs + # @return [::Google::Protobuf::Map{::String => ::Google::Cloud::VisionAI::V1::AttributeValue}] + # The attribute values that this analyzer applies to the operator. + # + # Supply a mapping between the attribute names and the actual value you wish + # to apply. If an attribute name is omitted, then it will take a + # preconfigured default value. + # @!attribute [rw] debug_options + # @return [::Google::Cloud::VisionAI::V1::AnalyzerDefinition::DebugOptions] + # Debug options. + # @!attribute [rw] operator_option + # @return [::Google::Cloud::VisionAI::V1::AnalyzerDefinition::OperatorOption] + # Operator option. + class AnalyzerDefinition + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The inputs to this analyzer. + # + # We accept input name references of the following form: + # : + # + # Example: + # + # Suppose you had an operator named "SomeOp" that has 2 output + # arguments, the first of which is named "foo" and the second of which is + # named "bar", and an operator named "MyOp" that accepts 2 inputs. + # + # Also suppose that there is an analyzer named "some-analyzer" that is + # running "SomeOp" and another analyzer named "my-analyzer" running "MyOp". + # + # To indicate that "my-analyzer" is to consume "some-analyzer"'s "foo" + # output as its first input and "some-analyzer"'s "bar" output as its + # second input, you can set this field to the following: + # input = ["some-analyzer:foo", "some-analyzer:bar"] + # @!attribute [rw] input + # @return [::String] + # The name of the stream input (as discussed above). + class StreamInput + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Options available for debugging purposes only. + # @!attribute [rw] environment_variables + # @return [::Google::Protobuf::Map{::String => ::String}] + # Environment variables. + class DebugOptions + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class EnvironmentVariablesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Option related to the operator. + # @!attribute [rw] tag + # @return [::String] + # Tag of the operator. + # @!attribute [rw] registry + # @return [::String] + # Registry of the operator. e.g. public, dev. + class OperatorOption + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::Google::Cloud::VisionAI::V1::AttributeValue] + class AttrsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Defines a full analysis. + # + # This is a description of the overall live analytics pipeline. + # You may think of this as an edge list representation of a multigraph. + # + # This may be directly authored by a human in protobuf textformat, or it may be + # generated by a programming API (perhaps Python or JavaScript depending on + # context). + # @!attribute [rw] analyzers + # @return [::Array<::Google::Cloud::VisionAI::V1::AnalyzerDefinition>] + # Analyzer definitions. + class AnalysisDefinition + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Message describing the status of the Process. + # @!attribute [rw] state + # @return [::Google::Cloud::VisionAI::V1::RunStatus::State] + # The state of the Process. + # @!attribute [rw] reason + # @return [::String] + # The reason of becoming the state. + class RunStatus + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # State represents the running status of the Process. + module State + # State is unspecified. + STATE_UNSPECIFIED = 0 + + # INITIALIZING means the Process is scheduled but yet ready to handle + # real traffic. + INITIALIZING = 1 + + # RUNNING means the Process is up running and handling traffic. + RUNNING = 2 + + # COMPLETED means the Process has completed the processing, especially + # for non-streaming use case. + COMPLETED = 3 + + # FAILED means the Process failed to complete the processing. + FAILED = 4 + + # PENDING means the Process is created but yet to be scheduled. + PENDING = 5 + end + end + + # RunMode represents the mode to launch the Process on. + module RunMode + # Mode is unspecified. + RUN_MODE_UNSPECIFIED = 0 + + # Live mode. Meaning the Process is launched to handle live video + # source, and possible packet drops are expected. + LIVE = 1 + + # Submission mode. Meaning the Process is launched to handle bounded video + # files, with no packet drop. Completion status is tracked. + SUBMISSION = 2 + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/proto_docs/google/cloud/visionai/v1/lva_resources.rb b/owl-bot-staging/google-cloud-vision_ai-v1/proto_docs/google/cloud/visionai/v1/lva_resources.rb new file mode 100644 index 000000000000..c6639a717f8b --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/proto_docs/google/cloud/visionai/v1/lva_resources.rb @@ -0,0 +1,167 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 VisionAI + module V1 + # Message describing the Operator object. + # @!attribute [rw] name + # @return [::String] + # Name of the resource. + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The create timestamp. + # @!attribute [r] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The update timestamp. + # @!attribute [rw] labels + # @return [::Google::Protobuf::Map{::String => ::String}] + # Labels as key value pairs. + # @!attribute [rw] operator_definition + # @return [::Google::Cloud::VisionAI::V1::OperatorDefinition] + # The definition of the operator. + # @!attribute [rw] docker_image + # @return [::String] + # The link to the docker image of the operator. + class Operator + 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 + end + + # Message describing the Analysis object. + # @!attribute [rw] name + # @return [::String] + # The name of resource. + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The create timestamp. + # @!attribute [r] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The update timestamp. + # @!attribute [rw] labels + # @return [::Google::Protobuf::Map{::String => ::String}] + # Labels as key value pairs. + # @!attribute [rw] analysis_definition + # @return [::Google::Cloud::VisionAI::V1::AnalysisDefinition] + # The definition of the analysis. + # @!attribute [rw] input_streams_mapping + # @return [::Google::Protobuf::Map{::String => ::String}] + # Map from the input parameter in the definition to the real stream. + # E.g., suppose you had a stream source operator named "input-0" and you try + # to receive from the real stream "stream-0". You can add the following + # mapping: [input-0: stream-0]. + # @!attribute [rw] output_streams_mapping + # @return [::Google::Protobuf::Map{::String => ::String}] + # Map from the output parameter in the definition to the real stream. + # E.g., suppose you had a stream sink operator named "output-0" and you try + # to send to the real stream "stream-0". You can add the following + # mapping: [output-0: stream-0]. + # @!attribute [rw] disable_event_watch + # @return [::Boolean] + # Boolean flag to indicate whether you would like to disable the ability + # to automatically start a Process when new event happening in the input + # Stream. If you would like to start a Process manually, the field needs + # to be set to true. + class Analysis + 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 + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class InputStreamsMappingEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class OutputStreamsMappingEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Message describing the Process object. + # @!attribute [rw] name + # @return [::String] + # The name of resource. + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The create timestamp. + # @!attribute [r] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The update timestamp. + # @!attribute [rw] analysis + # @return [::String] + # Required. Reference to an existing Analysis resource. + # @!attribute [rw] attribute_overrides + # @return [::Array<::String>] + # Optional. Attribute overrides of the Analyzers. + # Format for each single override item: + # "\\{analyzer_name}:\\{attribute_key}=\\{value}" + # @!attribute [rw] run_status + # @return [::Google::Cloud::VisionAI::V1::RunStatus] + # Optional. Status of the Process. + # @!attribute [rw] run_mode + # @return [::Google::Cloud::VisionAI::V1::RunMode] + # Optional. Run mode of the Process. + # @!attribute [rw] event_id + # @return [::String] + # Optional. Event ID of the input/output streams. + # This is useful when you have a StreamSource/StreamSink operator in the + # Analysis, and you want to manually specify the Event to read from/write to. + # @!attribute [rw] batch_id + # @return [::String] + # Optional. Optional: Batch ID of the Process. + # @!attribute [rw] retry_count + # @return [::Integer] + # Optional. Optional: The number of retries for a process in submission mode + # the system should try before declaring failure. By default, no retry will + # be performed. + class Process + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/proto_docs/google/cloud/visionai/v1/lva_service.rb b/owl-bot-staging/google-cloud-vision_ai-v1/proto_docs/google/cloud/visionai/v1/lva_service.rb new file mode 100644 index 000000000000..f7c9c879b595 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/proto_docs/google/cloud/visionai/v1/lva_service.rb @@ -0,0 +1,543 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 VisionAI + module V1 + # Message for requesting list of Operators. + # @!attribute [rw] parent + # @return [::String] + # Required. Parent value for ListOperatorsRequest. + # @!attribute [rw] page_size + # @return [::Integer] + # Requested page size. Server may return fewer items than requested. + # If unspecified, server will pick an appropriate default. + # @!attribute [rw] page_token + # @return [::String] + # A token identifying a page of results the server should return. + # @!attribute [rw] filter + # @return [::String] + # Filtering results. + # @!attribute [rw] order_by + # @return [::String] + # Hint for how to order the results. + class ListOperatorsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Message for response to listing Operators. + # @!attribute [rw] operators + # @return [::Array<::Google::Cloud::VisionAI::V1::Operator>] + # The list of Operator + # @!attribute [rw] next_page_token + # @return [::String] + # A token identifying a page of results the server should return. + # @!attribute [rw] unreachable + # @return [::Array<::String>] + # Locations that could not be reached. + class ListOperatorsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Message for getting a Operator. + # @!attribute [rw] name + # @return [::String] + # Required. Name of the resource. + class GetOperatorRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Message for creating a Operator. + # @!attribute [rw] parent + # @return [::String] + # Required. Value for parent. + # @!attribute [rw] operator_id + # @return [::String] + # Required. Id of the requesting object. + # @!attribute [rw] operator + # @return [::Google::Cloud::VisionAI::V1::Operator] + # Required. The resource being created. + # @!attribute [rw] request_id + # @return [::String] + # Optional. An optional request ID to identify requests. Specify a unique + # request ID so that if you must retry your request, the server will know to + # ignore the request if it has already been completed. The server will + # guarantee that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request ID, + # the server can check if original operation with the same request ID was + # received, and if so, will ignore the second request. This prevents clients + # from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + class CreateOperatorRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Message for updating a Operator. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # Required. Field mask is used to specify the fields to be overwritten in the + # Operator resource by the update. + # The fields specified in the update_mask are relative to the resource, not + # the full request. A field will be overwritten if it is in the mask. If the + # user does not provide a mask then all fields will be overwritten. + # @!attribute [rw] operator + # @return [::Google::Cloud::VisionAI::V1::Operator] + # Required. The resource being updated + # @!attribute [rw] request_id + # @return [::String] + # Optional. An optional request ID to identify requests. Specify a unique + # request ID so that if you must retry your request, the server will know to + # ignore the request if it has already been completed. The server will + # guarantee that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request ID, + # the server can check if original operation with the same request ID was + # received, and if so, will ignore the second request. This prevents clients + # from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + class UpdateOperatorRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Message for deleting a Operator + # @!attribute [rw] name + # @return [::String] + # Required. Name of the resource + # @!attribute [rw] request_id + # @return [::String] + # Optional. An optional request ID to identify requests. Specify a unique + # request ID so that if you must retry your request, the server will know to + # ignore the request if it has already been completed. The server will + # guarantee that for at least 60 minutes after the first request. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request ID, + # the server can check if original operation with the same request ID was + # received, and if so, will ignore the second request. This prevents clients + # from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + class DeleteOperatorRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Message for requesting list of Analyses + # @!attribute [rw] parent + # @return [::String] + # Required. Parent value for ListAnalysesRequest + # @!attribute [rw] page_size + # @return [::Integer] + # Requested page size. Server may return fewer items than requested. + # If unspecified, server will pick an appropriate default. + # @!attribute [rw] page_token + # @return [::String] + # A token identifying a page of results the server should return. + # @!attribute [rw] filter + # @return [::String] + # Filtering results + # @!attribute [rw] order_by + # @return [::String] + # Hint for how to order the results + class ListAnalysesRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Message for response to listing Analyses + # @!attribute [rw] analyses + # @return [::Array<::Google::Cloud::VisionAI::V1::Analysis>] + # The list of Analysis + # @!attribute [rw] next_page_token + # @return [::String] + # A token identifying a page of results the server should return. + # @!attribute [rw] unreachable + # @return [::Array<::String>] + # Locations that could not be reached. + class ListAnalysesResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Message for getting an Analysis. + # @!attribute [rw] name + # @return [::String] + # Required. Name of the resource. + class GetAnalysisRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Message for creating an Analysis. + # @!attribute [rw] parent + # @return [::String] + # Required. Value for parent. + # @!attribute [rw] analysis_id + # @return [::String] + # Required. Id of the requesting object. + # @!attribute [rw] analysis + # @return [::Google::Cloud::VisionAI::V1::Analysis] + # Required. The resource being created. + # @!attribute [rw] request_id + # @return [::String] + # Optional. An optional request ID to identify requests. Specify a unique + # request ID so that if you must retry your request, the server will know to + # ignore the request if it has already been completed. The server will + # guarantee that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request ID, + # the server can check if original operation with the same request ID was + # received, and if so, will ignore the second request. This prevents clients + # from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + class CreateAnalysisRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Message for updating an Analysis. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # Required. Field mask is used to specify the fields to be overwritten in the + # Analysis resource by the update. + # The fields specified in the update_mask are relative to the resource, not + # the full request. A field will be overwritten if it is in the mask. If the + # user does not provide a mask then all fields will be overwritten. + # @!attribute [rw] analysis + # @return [::Google::Cloud::VisionAI::V1::Analysis] + # Required. The resource being updated. + # @!attribute [rw] request_id + # @return [::String] + # Optional. An optional request ID to identify requests. Specify a unique + # request ID so that if you must retry your request, the server will know to + # ignore the request if it has already been completed. The server will + # guarantee that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request ID, + # the server can check if original operation with the same request ID was + # received, and if so, will ignore the second request. This prevents clients + # from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + class UpdateAnalysisRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Message for deleting an Analysis. + # @!attribute [rw] name + # @return [::String] + # Required. Name of the resource. + # @!attribute [rw] request_id + # @return [::String] + # Optional. An optional request ID to identify requests. Specify a unique + # request ID so that if you must retry your request, the server will know to + # ignore the request if it has already been completed. The server will + # guarantee that for at least 60 minutes after the first request. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request ID, + # the server can check if original operation with the same request ID was + # received, and if so, will ignore the second request. This prevents clients + # from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + class DeleteAnalysisRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Message for requesting list of Processes. + # @!attribute [rw] parent + # @return [::String] + # Required. Parent value for ListProcessesRequest. + # @!attribute [rw] page_size + # @return [::Integer] + # Requested page size. Server may return fewer items than requested. + # If unspecified, server will pick an appropriate default. + # @!attribute [rw] page_token + # @return [::String] + # A token identifying a page of results the server should return. + # @!attribute [rw] filter + # @return [::String] + # Filtering results + # @!attribute [rw] order_by + # @return [::String] + # Hint for how to order the results + class ListProcessesRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Message for response to listing Processes. + # @!attribute [rw] processes + # @return [::Array<::Google::Cloud::VisionAI::V1::Process>] + # The list of Processes. + # @!attribute [rw] next_page_token + # @return [::String] + # A token identifying a page of results the server should return. + # @!attribute [rw] unreachable + # @return [::Array<::String>] + # Locations that could not be reached. + class ListProcessesResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Message for getting a Process. + # @!attribute [rw] name + # @return [::String] + # Required. Name of the resource. + class GetProcessRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Message for creating a Process. + # @!attribute [rw] parent + # @return [::String] + # Required. Value for parent. + # @!attribute [rw] process_id + # @return [::String] + # Required. Id of the requesting object. + # @!attribute [rw] process + # @return [::Google::Cloud::VisionAI::V1::Process] + # Required. The resource being created. + # @!attribute [rw] request_id + # @return [::String] + # Optional. An optional request ID to identify requests. Specify a unique + # request ID so that if you must retry your request, the server will know to + # ignore the request if it has already been completed. The server will + # guarantee that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request ID, + # the server can check if original operation with the same request ID was + # received, and if so, will ignore the second request. This prevents clients + # from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + class CreateProcessRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Message for updating a Process. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # Required. Field mask is used to specify the fields to be overwritten in the + # Process resource by the update. + # The fields specified in the update_mask are relative to the resource, not + # the full request. A field will be overwritten if it is in the mask. If the + # user does not provide a mask then all fields will be overwritten. + # @!attribute [rw] process + # @return [::Google::Cloud::VisionAI::V1::Process] + # Required. The resource being updated. + # @!attribute [rw] request_id + # @return [::String] + # Optional. An optional request ID to identify requests. Specify a unique + # request ID so that if you must retry your request, the server will know to + # ignore the request if it has already been completed. The server will + # guarantee that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request ID, + # the server can check if original operation with the same request ID was + # received, and if so, will ignore the second request. This prevents clients + # from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + class UpdateProcessRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Message for deleting a Process. + # @!attribute [rw] name + # @return [::String] + # Required. Name of the resource. + # @!attribute [rw] request_id + # @return [::String] + # Optional. An optional request ID to identify requests. Specify a unique + # request ID so that if you must retry your request, the server will know to + # ignore the request if it has already been completed. The server will + # guarantee that for at least 60 minutes after the first request. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request ID, + # the server can check if original operation with the same request ID was + # received, and if so, will ignore the second request. This prevents clients + # from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + class DeleteProcessRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for running the processes in a batch. + # @!attribute [rw] parent + # @return [::String] + # Required. The parent resource shared by all processes being created. + # @!attribute [rw] requests + # @return [::Array<::Google::Cloud::VisionAI::V1::CreateProcessRequest>] + # Required. The create process requests. + # @!attribute [rw] options + # @return [::Google::Cloud::VisionAI::V1::BatchRunProcessRequest::BatchRunProcessOptions] + # Optional. Options for batch processes. + # @!attribute [r] batch_id + # @return [::String] + # Output only. The batch ID. + class BatchRunProcessRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Options for batch processes. + # @!attribute [rw] retry_count + # @return [::Integer] + # The retry counts per process. Default: 3. + # @!attribute [rw] batch_size + # @return [::Integer] + # The batch size. Default: 5, maximum: 100. + class BatchRunProcessOptions + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Response message for running the processes in a batch. + # @!attribute [rw] batch_id + # @return [::String] + # The batch ID. + # @!attribute [rw] processes + # @return [::Array<::Google::Cloud::VisionAI::V1::Process>] + # Processes created. + class BatchRunProcessResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for querying operator info. + # @!attribute [rw] parent + # @return [::String] + # Required. Parent value for ResolveOperatorInfoRequest. + # @!attribute [rw] queries + # @return [::Array<::Google::Cloud::VisionAI::V1::OperatorQuery>] + # Required. The operator queries. + class ResolveOperatorInfoRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # OperatorQuery represents one query to a Operator. + # @!attribute [rw] operator + # @return [::String] + # Required. The canonical Name of the operator. e.g. OccupancyCounting. + # @!attribute [rw] tag + # @return [::String] + # Optional. Tag of the operator. + # @!attribute [rw] registry + # @return [::Google::Cloud::VisionAI::V1::Registry] + # Optional. Registry of the operator. + class OperatorQuery + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message of ResolveOperatorInfo API. + # @!attribute [rw] operators + # @return [::Array<::Google::Cloud::VisionAI::V1::Operator>] + # Operators with detailed information. + class ResolveOperatorInfoResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message of ListPublicOperatorsRequest API. + # @!attribute [rw] parent + # @return [::String] + # Required. Parent value for ListPublicOperatorsRequest. + # @!attribute [rw] page_size + # @return [::Integer] + # Requested page size. Server may return fewer items than requested. + # If unspecified, server will pick an appropriate default. + # @!attribute [rw] page_token + # @return [::String] + # A token identifying a page of results the server should return. + # @!attribute [rw] filter + # @return [::String] + # Filtering results. + # @!attribute [rw] order_by + # @return [::String] + # Hint for how to order the results. + class ListPublicOperatorsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message of ListPublicOperators API. + # @!attribute [rw] operators + # @return [::Array<::Google::Cloud::VisionAI::V1::Operator>] + # The list of Operator + # @!attribute [rw] next_page_token + # @return [::String] + # A token identifying a page of results the server should return. + class ListPublicOperatorsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The enum of the types of the Registry. + module Registry + # Registry is unspecified. + REGISTRY_UNSPECIFIED = 0 + + # Public Registry containing the public Operators released by Google. + PUBLIC = 1 + + # Private Registry containing the local registered operators. + PRIVATE = 2 + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/proto_docs/google/cloud/visionai/v1/platform.rb b/owl-bot-staging/google-cloud-vision_ai-v1/proto_docs/google/cloud/visionai/v1/platform.rb new file mode 100644 index 000000000000..ebe9fd6f5730 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/proto_docs/google/cloud/visionai/v1/platform.rb @@ -0,0 +1,2272 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 VisionAI + module V1 + # Message for DeleteApplicationInstance Response. + class DeleteApplicationInstancesResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Message for CreateApplicationInstance Response. + class CreateApplicationInstancesResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Message for UpdateApplicationInstances Response. + class UpdateApplicationInstancesResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Message for adding stream input to an Application. + # @!attribute [rw] name + # @return [::String] + # Required. the name of the application to retrieve. + # Format: + # "projects/\\{project}/locations/\\{location}/applications/\\{application}" + # @!attribute [rw] application_instances + # @return [::Array<::Google::Cloud::VisionAI::V1::ApplicationInstance>] + # Required. The resources being created. + # @!attribute [rw] request_id + # @return [::String] + # Optional. An optional request ID to identify requests. Specify a unique + # request ID so that if you must retry your request, the server will know to + # ignore the request if it has already been completed. The server will + # guarantee that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + class CreateApplicationInstancesRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Message for removing stream input from an Application. + # @!attribute [rw] name + # @return [::String] + # Required. the name of the application to retrieve. + # Format: + # "projects/\\{project}/locations/\\{location}/applications/\\{application}" + # @!attribute [rw] instance_ids + # @return [::Array<::String>] + # Required. Id of the requesting object. + # @!attribute [rw] request_id + # @return [::String] + # Optional. An optional request ID to identify requests. Specify a unique + # request ID so that if you must retry your request, the server will know to + # ignore the request if it has already been completed. The server will + # guarantee that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + class DeleteApplicationInstancesRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # RPC Request Messages. + # Message for DeployApplication Response. + class DeployApplicationResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Message for UndeployApplication Response. + class UndeployApplicationResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Message for RemoveApplicationStreamInput Response. + class RemoveApplicationStreamInputResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Message for AddApplicationStreamInput Response. + class AddApplicationStreamInputResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Message for AddApplicationStreamInput Response. + class UpdateApplicationStreamInputResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Message for requesting list of Applications. + # @!attribute [rw] parent + # @return [::String] + # Required. Parent value for ListApplicationsRequest. + # @!attribute [rw] page_size + # @return [::Integer] + # Requested page size. Server may return fewer items than requested. + # If unspecified, server will pick an appropriate default. + # @!attribute [rw] page_token + # @return [::String] + # A token identifying a page of results the server should return. + # @!attribute [rw] filter + # @return [::String] + # Filtering results. + # @!attribute [rw] order_by + # @return [::String] + # Hint for how to order the results. + class ListApplicationsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Message for response to listing Applications. + # @!attribute [rw] applications + # @return [::Array<::Google::Cloud::VisionAI::V1::Application>] + # The list of Application. + # @!attribute [rw] next_page_token + # @return [::String] + # A token identifying a page of results the server should return. + # @!attribute [rw] unreachable + # @return [::Array<::String>] + # Locations that could not be reached. + class ListApplicationsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Message for getting a Application. + # @!attribute [rw] name + # @return [::String] + # Required. Name of the resource. + class GetApplicationRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Message for creating a Application. + # @!attribute [rw] parent + # @return [::String] + # Required. Value for parent. + # @!attribute [rw] application_id + # @return [::String] + # Required. Id of the requesting object. + # @!attribute [rw] application + # @return [::Google::Cloud::VisionAI::V1::Application] + # Required. The resource being created. + # @!attribute [rw] request_id + # @return [::String] + # Optional. An optional request ID to identify requests. Specify a unique + # request ID so that if you must retry your request, the server will know to + # ignore the request if it has already been completed. The server will + # guarantee that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + class CreateApplicationRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Message for updating an Application. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # Optional. Field mask is used to specify the fields to be overwritten in the + # Application resource by the update. + # The fields specified in the update_mask are relative to the resource, not + # the full request. A field will be overwritten if it is in the mask. If the + # user does not provide a mask then all fields will be overwritten. + # @!attribute [rw] application + # @return [::Google::Cloud::VisionAI::V1::Application] + # Required. The resource being updated. + # @!attribute [rw] request_id + # @return [::String] + # Optional. An optional request ID to identify requests. Specify a unique + # request ID so that if you must retry your request, the server will know to + # ignore the request if it has already been completed. The server will + # guarantee that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + class UpdateApplicationRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Message for deleting an Application. + # @!attribute [rw] name + # @return [::String] + # Required. Name of the resource. + # @!attribute [rw] request_id + # @return [::String] + # Optional. An optional request ID to identify requests. Specify a unique + # request ID so that if you must retry your request, the server will know to + # ignore the request if it has already been completed. The server will + # guarantee that for at least 60 minutes after the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @!attribute [rw] force + # @return [::Boolean] + # Optional. If set to true, any instances and drafts from this application + # will also be deleted. (Otherwise, the request will only work if the + # application has no instances and drafts.) + class DeleteApplicationRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Message for deploying an Application. + # @!attribute [rw] name + # @return [::String] + # Required. the name of the application to retrieve. + # Format: + # "projects/\\{project}/locations/\\{location}/applications/\\{application}" + # @!attribute [rw] validate_only + # @return [::Boolean] + # If set, validate the request and preview the application graph, but do not + # actually deploy it. + # @!attribute [rw] request_id + # @return [::String] + # Optional. An optional request ID to identify requests. Specify a unique + # request ID so that if you must retry your request, the server will know to + # ignore the request if it has already been completed. The server will + # guarantee that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @!attribute [rw] enable_monitoring + # @return [::Boolean] + # Optional. Whether or not to enable monitoring for the application on + # deployment. + class DeployApplicationRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Message for undeploying an Application. + # @!attribute [rw] name + # @return [::String] + # Required. the name of the application to retrieve. + # Format: + # "projects/\\{project}/locations/\\{location}/applications/\\{application}" + # @!attribute [rw] request_id + # @return [::String] + # Optional. An optional request ID to identify requests. Specify a unique + # request ID so that if you must retry your request, the server will know to + # ignore the request if it has already been completed. The server will + # guarantee that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + class UndeployApplicationRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Message about a single stream input config. + # @!attribute [rw] stream_with_annotation + # @return [::Google::Cloud::VisionAI::V1::StreamWithAnnotation] + class ApplicationStreamInput + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Message for adding stream input to an Application. + # @!attribute [rw] name + # @return [::String] + # Required. the name of the application to retrieve. + # Format: + # "projects/\\{project}/locations/\\{location}/applications/\\{application}" + # @!attribute [rw] application_stream_inputs + # @return [::Array<::Google::Cloud::VisionAI::V1::ApplicationStreamInput>] + # The stream inputs to add, the stream resource name is the key of each + # StreamInput, and it must be unique within each application. + # @!attribute [rw] request_id + # @return [::String] + # Optional. An optional request ID to identify requests. Specify a unique + # request ID so that if you must retry your request, the server will know to + # ignore the request if it has already been completed. The server will + # guarantee that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + class AddApplicationStreamInputRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Message for updating stream input to an Application. + # @!attribute [rw] name + # @return [::String] + # Required. the name of the application to retrieve. + # Format: + # "projects/\\{project}/locations/\\{location}/applications/\\{application}" + # @!attribute [rw] application_stream_inputs + # @return [::Array<::Google::Cloud::VisionAI::V1::ApplicationStreamInput>] + # The stream inputs to update, the stream resource name is the key of each + # StreamInput, and it must be unique within each application. + # @!attribute [rw] request_id + # @return [::String] + # Optional. An optional request ID to identify requests. Specify a unique + # request ID so that if you must retry your request, the server will know to + # ignore the request if it has already been completed. The server will + # guarantee that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @!attribute [rw] allow_missing + # @return [::Boolean] + # If true, UpdateApplicationStreamInput will insert stream input to + # application even if the target stream is not included in the application. + class UpdateApplicationStreamInputRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Message for removing stream input from an Application. + # @!attribute [rw] name + # @return [::String] + # Required. the name of the application to retrieve. + # Format: + # "projects/\\{project}/locations/\\{location}/applications/\\{application}" + # @!attribute [rw] target_stream_inputs + # @return [::Array<::Google::Cloud::VisionAI::V1::RemoveApplicationStreamInputRequest::TargetStreamInput>] + # The target stream to remove. + # @!attribute [rw] request_id + # @return [::String] + # Optional. An optional request ID to identify requests. Specify a unique + # request ID so that if you must retry your request, the server will know to + # ignore the request if it has already been completed. The server will + # guarantee that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + class RemoveApplicationStreamInputRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Message about target streamInput to remove. + # @!attribute [rw] stream + # @return [::String] + class TargetStreamInput + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Message for requesting list of Instances. + # @!attribute [rw] parent + # @return [::String] + # Required. Parent value for ListInstancesRequest. + # @!attribute [rw] page_size + # @return [::Integer] + # Requested page size. Server may return fewer items than requested. + # If unspecified, server will pick an appropriate default. + # @!attribute [rw] page_token + # @return [::String] + # A token identifying a page of results the server should return. + # @!attribute [rw] filter + # @return [::String] + # Filtering results. + # @!attribute [rw] order_by + # @return [::String] + # Hint for how to order the results. + class ListInstancesRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Message for response to listing Instances. + # @!attribute [rw] instances + # @return [::Array<::Google::Cloud::VisionAI::V1::Instance>] + # The list of Instance. + # @!attribute [rw] next_page_token + # @return [::String] + # A token identifying a page of results the server should return. + # @!attribute [rw] unreachable + # @return [::Array<::String>] + # Locations that could not be reached. + class ListInstancesResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Message for getting a Instance. + # @!attribute [rw] name + # @return [::String] + # Required. Name of the resource. + class GetInstanceRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Message for requesting list of Drafts. + # @!attribute [rw] parent + # @return [::String] + # Required. Parent value for ListDraftsRequest. + # @!attribute [rw] page_size + # @return [::Integer] + # Requested page size. Server may return fewer items than requested. + # If unspecified, server will pick an appropriate default. + # @!attribute [rw] page_token + # @return [::String] + # A token identifying a page of results the server should return. + # @!attribute [rw] filter + # @return [::String] + # Filtering results. + # @!attribute [rw] order_by + # @return [::String] + # Hint for how to order the results. + class ListDraftsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Message for response to listing Drafts. + # @!attribute [rw] drafts + # @return [::Array<::Google::Cloud::VisionAI::V1::Draft>] + # The list of Draft. + # @!attribute [rw] next_page_token + # @return [::String] + # A token identifying a page of results the server should return. + # @!attribute [rw] unreachable + # @return [::Array<::String>] + # Locations that could not be reached. + class ListDraftsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Message for getting a Draft. + # @!attribute [rw] name + # @return [::String] + # Required. Name of the resource. + class GetDraftRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Message for creating a Draft. + # @!attribute [rw] parent + # @return [::String] + # Required. Value for parent. + # @!attribute [rw] draft_id + # @return [::String] + # Required. Id of the requesting object. + # @!attribute [rw] draft + # @return [::Google::Cloud::VisionAI::V1::Draft] + # Required. The resource being created. + # @!attribute [rw] request_id + # @return [::String] + # Optional. An optional request ID to identify requests. Specify a unique + # request ID so that if you must retry your request, the server will know to + # ignore the request if it has already been completed. The server will + # guarantee that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + class CreateDraftRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Message for updating a Draft. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # Optional. Field mask is used to specify the fields to be overwritten in the + # Draft resource by the update. + # The fields specified in the update_mask are relative to the resource, not + # the full request. A field will be overwritten if it is in the mask. If the + # user does not provide a mask then all fields will be overwritten. + # @!attribute [rw] draft + # @return [::Google::Cloud::VisionAI::V1::Draft] + # Required. The resource being updated. + # @!attribute [rw] request_id + # @return [::String] + # Optional. An optional request ID to identify requests. Specify a unique + # request ID so that if you must retry your request, the server will know to + # ignore the request if it has already been completed. The server will + # guarantee that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @!attribute [rw] allow_missing + # @return [::Boolean] + # If true, UpdateDraftRequest will create one resource if the target resource + # doesn't exist, this time, the field_mask will be ignored. + class UpdateDraftRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Message for updating an ApplicationInstance. + # @!attribute [rw] name + # @return [::String] + # Required. the name of the application to retrieve. + # Format: + # "projects/\\{project}/locations/\\{location}/applications/\\{application}" + # @!attribute [rw] application_instances + # @return [::Array<::Google::Cloud::VisionAI::V1::UpdateApplicationInstancesRequest::UpdateApplicationInstance>] + # @!attribute [rw] request_id + # @return [::String] + # Optional. An optional request ID to identify requests. Specify a unique + # request ID so that if you must retry your request, the server will know to + # ignore the request if it has already been completed. The server will + # guarantee that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @!attribute [rw] allow_missing + # @return [::Boolean] + # If true, Update Request will create one resource if the target resource + # doesn't exist, this time, the field_mask will be ignored. + class UpdateApplicationInstancesRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # Optional. Field mask is used to specify the fields to be overwritten in + # the Draft resource by the update. The fields specified in the update_mask + # are relative to the resource, not the full request. A field will be + # overwritten if it is in the mask. If the user does not provide a mask + # then all fields will be overwritten. + # @!attribute [rw] instance + # @return [::Google::Cloud::VisionAI::V1::Instance] + # Required. The resource being updated. + # @!attribute [rw] instance_id + # @return [::String] + # Required. The id of the instance. + class UpdateApplicationInstance + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Message for deleting a Draft. + # @!attribute [rw] name + # @return [::String] + # Required. Name of the resource. + # @!attribute [rw] request_id + # @return [::String] + # Optional. An optional request ID to identify requests. Specify a unique + # request ID so that if you must retry your request, the server will know to + # ignore the request if it has already been completed. The server will + # guarantee that for at least 60 minutes after the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + class DeleteDraftRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Message for requesting list of Processors. + # @!attribute [rw] parent + # @return [::String] + # Required. Parent value for ListProcessorsRequest. + # @!attribute [rw] page_size + # @return [::Integer] + # Requested page size. Server may return fewer items than requested. + # If unspecified, server will pick an appropriate default. + # @!attribute [rw] page_token + # @return [::String] + # A token identifying a page of results the server should return. + # @!attribute [rw] filter + # @return [::String] + # Filtering results. + # @!attribute [rw] order_by + # @return [::String] + # Hint for how to order the results. + class ListProcessorsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Message for response to listing Processors. + # @!attribute [rw] processors + # @return [::Array<::Google::Cloud::VisionAI::V1::Processor>] + # The list of Processor. + # @!attribute [rw] next_page_token + # @return [::String] + # A token identifying a page of results the server should return. + # @!attribute [rw] unreachable + # @return [::Array<::String>] + # Locations that could not be reached. + class ListProcessorsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request Message for listing Prebuilt Processors. + # @!attribute [rw] parent + # @return [::String] + # Required. Parent path. + class ListPrebuiltProcessorsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response Message for listing Prebuilt Processors. + # @!attribute [rw] processors + # @return [::Array<::Google::Cloud::VisionAI::V1::Processor>] + # The list of Processor. + class ListPrebuiltProcessorsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Message for getting a Processor. + # @!attribute [rw] name + # @return [::String] + # Required. Name of the resource. + class GetProcessorRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Message for creating a Processor. + # @!attribute [rw] parent + # @return [::String] + # Required. Value for parent. + # @!attribute [rw] processor_id + # @return [::String] + # Required. Id of the requesting object. + # @!attribute [rw] processor + # @return [::Google::Cloud::VisionAI::V1::Processor] + # Required. The resource being created. + # @!attribute [rw] request_id + # @return [::String] + # Optional. An optional request ID to identify requests. Specify a unique + # request ID so that if you must retry your request, the server will know to + # ignore the request if it has already been completed. The server will + # guarantee that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + class CreateProcessorRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Message for updating a Processor. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # Optional. Field mask is used to specify the fields to be overwritten in the + # Processor resource by the update. + # The fields specified in the update_mask are relative to the resource, not + # the full request. A field will be overwritten if it is in the mask. If the + # user does not provide a mask then all fields will be overwritten. + # @!attribute [rw] processor + # @return [::Google::Cloud::VisionAI::V1::Processor] + # Required. The resource being updated. + # @!attribute [rw] request_id + # @return [::String] + # Optional. An optional request ID to identify requests. Specify a unique + # request ID so that if you must retry your request, the server will know to + # ignore the request if it has already been completed. The server will + # guarantee that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + class UpdateProcessorRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Message for deleting a Processor. + # @!attribute [rw] name + # @return [::String] + # Required. Name of the resource + # @!attribute [rw] request_id + # @return [::String] + # Optional. An optional request ID to identify requests. Specify a unique + # request ID so that if you must retry your request, the server will know to + # ignore the request if it has already been completed. The server will + # guarantee that for at least 60 minutes after the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + class DeleteProcessorRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Message describing Application object + # @!attribute [rw] name + # @return [::String] + # name of resource + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. [Output only] Create timestamp + # @!attribute [r] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. [Output only] Update timestamp + # @!attribute [rw] labels + # @return [::Google::Protobuf::Map{::String => ::String}] + # Labels as key value pairs + # @!attribute [rw] display_name + # @return [::String] + # Required. A user friendly display name for the solution. + # @!attribute [rw] description + # @return [::String] + # A description for this application. + # @!attribute [rw] application_configs + # @return [::Google::Cloud::VisionAI::V1::ApplicationConfigs] + # Application graph configuration. + # @!attribute [r] runtime_info + # @return [::Google::Cloud::VisionAI::V1::Application::ApplicationRuntimeInfo] + # Output only. Application graph runtime info. Only exists when application + # state equals to DEPLOYED. + # @!attribute [r] state + # @return [::Google::Cloud::VisionAI::V1::Application::State] + # Output only. State of the application. + # @!attribute [rw] billing_mode + # @return [::Google::Cloud::VisionAI::V1::Application::BillingMode] + # Billing mode of the application. + class Application + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Message storing the runtime information of the application. + # @!attribute [rw] deploy_time + # @return [::Google::Protobuf::Timestamp] + # Timestamp when the engine be deployed + # @!attribute [rw] global_output_resources + # @return [::Array<::Google::Cloud::VisionAI::V1::Application::ApplicationRuntimeInfo::GlobalOutputResource>] + # Globally created resources like warehouse dataschemas. + # @!attribute [rw] monitoring_config + # @return [::Google::Cloud::VisionAI::V1::Application::ApplicationRuntimeInfo::MonitoringConfig] + # Monitoring-related configuration for this application. + class ApplicationRuntimeInfo + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Message about output resources from application. + # @!attribute [rw] output_resource + # @return [::String] + # The full resource name of the outputted resources. + # @!attribute [rw] producer_node + # @return [::String] + # The name of graph node who produces the output resource name. + # For example: + # output_resource: + # /projects/123/locations/us-central1/corpora/my-corpus/dataSchemas/my-schema + # producer_node: occupancy-count + # @!attribute [rw] key + # @return [::String] + # The key of the output resource, it has to be unique within the same + # producer node. One producer node can output several output resources, + # the key can be used to match corresponding output resources. + class GlobalOutputResource + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Monitoring-related configuration for an application. + # @!attribute [rw] enabled + # @return [::Boolean] + # Whether this application has monitoring enabled. + class MonitoringConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class LabelsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # State of the Application + module State + # The default value. This value is used if the state is omitted. + STATE_UNSPECIFIED = 0 + + # State CREATED. + CREATED = 1 + + # State DEPLOYING. + DEPLOYING = 2 + + # State DEPLOYED. + DEPLOYED = 3 + + # State UNDEPLOYING. + UNDEPLOYING = 4 + + # State DELETED. + DELETED = 5 + + # State ERROR. + ERROR = 6 + + # State CREATING. + CREATING = 7 + + # State Updating. + UPDATING = 8 + + # State Deleting. + DELETING = 9 + + # State Fixing. + FIXING = 10 + end + + # Billing mode of the Application + module BillingMode + # The default value. + BILLING_MODE_UNSPECIFIED = 0 + + # Pay as you go billing mode. + PAYG = 1 + + # Monthly billing mode. + MONTHLY = 2 + end + end + + # Message storing the graph of the application. + # @!attribute [rw] nodes + # @return [::Array<::Google::Cloud::VisionAI::V1::Node>] + # A list of nodes in the application graph. + # @!attribute [rw] event_delivery_config + # @return [::Google::Cloud::VisionAI::V1::ApplicationConfigs::EventDeliveryConfig] + # Event-related configuration for this application. + class ApplicationConfigs + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # message storing the config for event delivery + # @!attribute [rw] channel + # @return [::String] + # The delivery channel for the event notification, only pub/sub topic is + # supported now. + # Example channel: + # [//pubsub.googleapis.com/projects/visionai-testing-stable/topics/test-topic] + # @!attribute [rw] minimal_delivery_interval + # @return [::Google::Protobuf::Duration] + # The expected delivery interval for the same event. The same event won't + # be notified multiple times during this internal event that it is + # happening multiple times during the period of time.The same event is + # identified by . + class EventDeliveryConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Message describing node object. + # @!attribute [rw] output_all_output_channels_to_stream + # @return [::Boolean] + # By default, the output of the node will only be available to downstream + # nodes. To consume the direct output from the application node, the output + # must be sent to Vision AI Streams at first. + # + # By setting output_all_output_channels_to_stream to true, App Platform + # will automatically send all the outputs of the current node to Vision AI + # Stream resources (one stream per output channel). The output stream + # resource will be created by App Platform automatically during deployment + # and deleted after application un-deployment. + # Note that this config applies to all the Application Instances. + # + # The output stream can be override at instance level by + # configuring the `output_resources` section of Instance resource. + # `producer_node` should be current node, `output_resource_binding` should + # be the output channel name (or leave it blank if there is only 1 output + # channel of the processor) and `output_resource` should be the target + # output stream. + # @!attribute [rw] name + # @return [::String] + # Required. A unique name for the node. + # @!attribute [rw] display_name + # @return [::String] + # A user friendly display name for the node. + # @!attribute [rw] node_config + # @return [::Google::Cloud::VisionAI::V1::ProcessorConfig] + # Node config. + # @!attribute [rw] processor + # @return [::String] + # Processor name refer to the chosen processor resource. + # @!attribute [rw] parents + # @return [::Array<::Google::Cloud::VisionAI::V1::Node::InputEdge>] + # Parent node. Input node should not have parent node. For V1 Alpha1/Beta + # only media warehouse node can have multiple parents, other types of nodes + # will only have one parent. + class Node + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Message describing one edge pointing into a node. + # @!attribute [rw] parent_node + # @return [::String] + # The name of the parent node. + # @!attribute [rw] parent_output_channel + # @return [::String] + # The connected output artifact of the parent node. + # It can be omitted if target processor only has 1 output artifact. + # @!attribute [rw] connected_input_channel + # @return [::String] + # The connected input channel of the current node's processor. + # It can be omitted if target processor only has 1 input channel. + class InputEdge + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Message describing Draft object + # @!attribute [rw] name + # @return [::String] + # name of resource + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. [Output only] Create timestamp + # @!attribute [r] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. [Output only] Create timestamp + # @!attribute [rw] labels + # @return [::Google::Protobuf::Map{::String => ::String}] + # Labels as key value pairs + # @!attribute [rw] display_name + # @return [::String] + # Required. A user friendly display name for the solution. + # @!attribute [rw] description + # @return [::String] + # A description for this application. + # @!attribute [rw] draft_application_configs + # @return [::Google::Cloud::VisionAI::V1::ApplicationConfigs] + # The draft application configs which haven't been updated to an application. + class Draft + 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 + end + + # Message describing Instance object + # Next ID: 12 + # @!attribute [r] name + # @return [::String] + # Output only. name of resource + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. [Output only] Create timestamp + # @!attribute [r] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. [Output only] Update timestamp + # @!attribute [rw] labels + # @return [::Google::Protobuf::Map{::String => ::String}] + # Labels as key value pairs + # @!attribute [rw] display_name + # @return [::String] + # Required. A user friendly display name for the solution. + # @!attribute [rw] description + # @return [::String] + # A description for this instance. + # @!attribute [rw] instance_type + # @return [::Google::Cloud::VisionAI::V1::Instance::InstanceType] + # The instance type for the current instance. + # @!attribute [rw] input_resources + # @return [::Array<::Google::Cloud::VisionAI::V1::Instance::InputResource>] + # The input resources for the current application instance. + # For example: + # input_resources: + # visionai.googleapis.com/v1/projects/123/locations/us-central1/clusters/456/streams/stream-a + # @!attribute [rw] output_resources + # @return [::Array<::Google::Cloud::VisionAI::V1::Instance::OutputResource>] + # All the output resources associated to one application instance. + # @!attribute [rw] state + # @return [::Google::Cloud::VisionAI::V1::Instance::State] + # State of the instance. + class Instance + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Message of input resource used in one application instance. + # @!attribute [rw] input_resource + # @return [::String] + # The direct input resource name. + # If the instance type is STREAMING_PREDICTION, the input resource is in + # format of + # "projects/123/locations/us-central1/clusters/456/streams/stream-a". + # If the instance type is BATCH_PREDICTION from Cloud Storage input + # container, the input resource is in format of "gs://bucket-a". + # + # Note: The following fields are mutually exclusive: `input_resource`, `annotated_stream`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] annotated_stream + # @deprecated This field is deprecated and may be removed in the next major version update. + # @return [::Google::Cloud::VisionAI::V1::StreamWithAnnotation] + # If the input resource is VisionAI Stream, the associated annotations + # can be specified using annotated_stream instead. + # + # Note: The following fields are mutually exclusive: `annotated_stream`, `input_resource`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] data_type + # @return [::Google::Cloud::VisionAI::V1::DataType] + # Data type for the current input resource. + # @!attribute [rw] consumer_node + # @return [::String] + # The name of graph node who receives the input resource. + # For example: + # input_resource: + # visionai.googleapis.com/v1/projects/123/locations/us-central1/clusters/456/streams/input-stream-a + # consumer_node: stream-input + # @!attribute [rw] input_resource_binding + # @return [::String] + # The specific input resource binding which will consume the current Input + # Resource, can be ignored is there is only 1 input binding. + # @!attribute [rw] annotations + # @return [::Google::Cloud::VisionAI::V1::ResourceAnnotations] + # Contains resource annotations. + class InputResource + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Message of output resource used in one application instance. + # @!attribute [rw] output_resource + # @return [::String] + # The output resource name for the current application instance. + # @!attribute [rw] producer_node + # @return [::String] + # The name of graph node who produces the output resource name. + # For example: + # output_resource: + # /projects/123/locations/us-central1/clusters/456/streams/output-application-789-stream-a-occupancy-counting + # producer_node: occupancy-counting + # @!attribute [rw] output_resource_binding + # @return [::String] + # The specific output resource binding which produces the current + # OutputResource. + # @!attribute [r] is_temporary + # @return [::Boolean] + # Output only. Whether the output resource is temporary which means the + # resource is generated during the deployment of the application. Temporary + # resource will be deleted during the undeployment of the application. + # @!attribute [r] autogen + # @return [::Boolean] + # Output only. Whether the output resource is created automatically by the + # Vision AI App Platform. + class OutputResource + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class LabelsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # All the supported instance types. + module InstanceType + # Unspecified instance type. + # If the instance type is not specified, the default one is + # STREAMING_PREDICTION. + INSTANCE_TYPE_UNSPECIFIED = 0 + + # Instance type for streaming prediction. + STREAMING_PREDICTION = 1 + + # Instance type for batch prediction. + BATCH_PREDICTION = 2 + + # Instance type for online prediction. + ONLINE_PREDICTION = 3 + end + + # State of the Instance + module State + # The default value. This value is used if the state is omitted. + STATE_UNSPECIFIED = 0 + + # State CREATING. + CREATING = 1 + + # State CREATED. + CREATED = 2 + + # State DEPLOYING. + DEPLOYING = 3 + + # State DEPLOYED. + DEPLOYED = 4 + + # State UNDEPLOYING. + UNDEPLOYING = 5 + + # State DELETED. + DELETED = 6 + + # State ERROR. + ERROR = 7 + + # State Updating + UPDATING = 8 + + # State Deleting. + DELETING = 9 + + # State Fixing. + FIXING = 10 + + # State Finished. + FINISHED = 11 + end + end + + # Message for creating a Instance. + # @!attribute [rw] instance_id + # @return [::String] + # Required. Id of the requesting object. + # @!attribute [rw] instance + # @return [::Google::Cloud::VisionAI::V1::Instance] + # Required. The resource being created. + class ApplicationInstance + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Message describing Processor object. + # Next ID: 19 + # @!attribute [rw] name + # @return [::String] + # name of resource. + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. [Output only] Create timestamp. + # @!attribute [r] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. [Output only] Update timestamp. + # @!attribute [rw] labels + # @return [::Google::Protobuf::Map{::String => ::String}] + # Labels as key value pairs. + # @!attribute [rw] display_name + # @return [::String] + # Required. A user friendly display name for the processor. + # @!attribute [rw] description + # @return [::String] + # Illustrative sentences for describing the functionality of the processor. + # @!attribute [r] processor_type + # @return [::Google::Cloud::VisionAI::V1::Processor::ProcessorType] + # Output only. Processor Type. + # @!attribute [rw] model_type + # @return [::Google::Cloud::VisionAI::V1::ModelType] + # Model Type. + # @!attribute [rw] custom_processor_source_info + # @return [::Google::Cloud::VisionAI::V1::CustomProcessorSourceInfo] + # Source info for customer created processor. + # @!attribute [r] state + # @return [::Google::Cloud::VisionAI::V1::Processor::ProcessorState] + # Output only. State of the Processor. + # @!attribute [r] processor_io_spec + # @return [::Google::Cloud::VisionAI::V1::ProcessorIOSpec] + # Output only. [Output only] The input / output specifications of a + # processor, each type of processor has fixed input / output specs which + # cannot be altered by customer. + # @!attribute [r] configuration_typeurl + # @return [::String] + # Output only. The corresponding configuration can be used in the Application + # to customize the behavior of the processor. + # @!attribute [r] supported_annotation_types + # @return [::Array<::Google::Cloud::VisionAI::V1::StreamAnnotationType>] + # @!attribute [rw] supports_post_processing + # @return [::Boolean] + # Indicates if the processor supports post processing. + # @!attribute [rw] supported_instance_types + # @return [::Array<::Google::Cloud::VisionAI::V1::Instance::InstanceType>] + # Which instance types this processor supports; if empty, this default to + # STREAMING_PREDICTION. + class Processor + 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 + + # Type + module ProcessorType + # Processor Type UNSPECIFIED. + PROCESSOR_TYPE_UNSPECIFIED = 0 + + # Processor Type PRETRAINED. + # Pretrained processor is developed by Vision AI App Platform with + # state-of-the-art vision data processing functionality, like occupancy + # counting or person blur. Pretrained processor is usually publicly + # available. + PRETRAINED = 1 + + # Processor Type CUSTOM. + # Custom processors are specialized processors which are either uploaded by + # customers or imported from other GCP platform (for example Vertex AI). + # Custom processor is only visible to the creator. + CUSTOM = 2 + + # Processor Type CONNECTOR. + # Connector processors are special processors which perform I/O for the + # application, they do not processing the data but either deliver the data + # to other processors or receive data from other processors. + CONNECTOR = 3 + end + + module ProcessorState + # Unspecified Processor state. + PROCESSOR_STATE_UNSPECIFIED = 0 + + # Processor is being created (not ready for use). + CREATING = 1 + + # Processor is and ready for use. + ACTIVE = 2 + + # Processor is being deleted (not ready for use). + DELETING = 3 + + # Processor deleted or creation failed . + FAILED = 4 + end + end + + # Message describing the input / output specifications of a processor. + # @!attribute [rw] graph_input_channel_specs + # @return [::Array<::Google::Cloud::VisionAI::V1::ProcessorIOSpec::GraphInputChannelSpec>] + # For processors with input_channel_specs, the processor must be explicitly + # connected to another processor. + # @!attribute [rw] graph_output_channel_specs + # @return [::Array<::Google::Cloud::VisionAI::V1::ProcessorIOSpec::GraphOutputChannelSpec>] + # The output artifact specifications for the current processor. + # @!attribute [rw] instance_resource_input_binding_specs + # @return [::Array<::Google::Cloud::VisionAI::V1::ProcessorIOSpec::InstanceResourceInputBindingSpec>] + # The input resource that needs to be fed from the application instance. + # @!attribute [rw] instance_resource_output_binding_specs + # @return [::Array<::Google::Cloud::VisionAI::V1::ProcessorIOSpec::InstanceResourceOutputBindingSpec>] + # The output resource that the processor will generate per instance. + # Other than the explicitly listed output bindings here, all the processors' + # GraphOutputChannels can be binded to stream resource. The bind name then is + # the same as the GraphOutputChannel's name. + class ProcessorIOSpec + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Message for input channel specification. + # @!attribute [rw] name + # @return [::String] + # The name of the current input channel. + # @!attribute [rw] data_type + # @return [::Google::Cloud::VisionAI::V1::DataType] + # The data types of the current input channel. + # When this field has more than 1 value, it means this input channel can be + # connected to either of these different data types. + # @!attribute [rw] accepted_data_type_uris + # @return [::Array<::String>] + # If specified, only those detailed data types can be connected to the + # processor. For example, jpeg stream for MEDIA, or PredictionResult proto + # for PROTO type. If unspecified, then any proto is accepted. + # @!attribute [rw] required + # @return [::Boolean] + # Whether the current input channel is required by the processor. + # For example, for a processor with required video input and optional audio + # input, if video input is missing, the application will be rejected while + # the audio input can be missing as long as the video input exists. + # @!attribute [rw] max_connection_allowed + # @return [::Integer] + # How many input edges can be connected to this input channel. 0 means + # unlimited. + class GraphInputChannelSpec + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Message for output channel specification. + # @!attribute [rw] name + # @return [::String] + # The name of the current output channel. + # @!attribute [rw] data_type + # @return [::Google::Cloud::VisionAI::V1::DataType] + # The data type of the current output channel. + # @!attribute [rw] data_type_uri + # @return [::String] + class GraphOutputChannelSpec + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Message for instance resource channel specification. + # External resources are virtual nodes which are not expressed in the + # application graph. Each processor expresses its out-graph spec, so customer + # is able to override the external source or destinations to the + # @!attribute [rw] config_type_uri + # @return [::String] + # The configuration proto that includes the Googleapis resources. I.e. + # type.googleapis.com/google.cloud.vision.v1.StreamWithAnnotation + # + # Note: The following fields are mutually exclusive: `config_type_uri`, `resource_type_uri`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] resource_type_uri + # @return [::String] + # The direct type url of Googleapis resource. i.e. + # type.googleapis.com/google.cloud.vision.v1.Asset + # + # Note: The following fields are mutually exclusive: `resource_type_uri`, `config_type_uri`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] name + # @return [::String] + # Name of the input binding, unique within the processor. + class InstanceResourceInputBindingSpec + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] name + # @return [::String] + # Name of the output binding, unique within the processor. + # @!attribute [rw] resource_type_uri + # @return [::String] + # The resource type uri of the acceptable output resource. + # @!attribute [rw] explicit + # @return [::Boolean] + # Whether the output resource needs to be explicitly set in the instance. + # If it is false, the processor will automatically generate it if required. + class InstanceResourceOutputBindingSpec + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Describes the source info for a custom processor. + # @!attribute [rw] vertex_model + # @return [::String] + # The resource name original model hosted in the vertex AI platform. + # + # Note: The following fields are mutually exclusive: `vertex_model`, `product_recognizer_artifact`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] product_recognizer_artifact + # @return [::Google::Cloud::VisionAI::V1::CustomProcessorSourceInfo::ProductRecognizerArtifact] + # Artifact for product recognizer. + # + # Note: The following fields are mutually exclusive: `product_recognizer_artifact`, `vertex_model`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] source_type + # @return [::Google::Cloud::VisionAI::V1::CustomProcessorSourceInfo::SourceType] + # The original product which holds the custom processor's functionality. + # @!attribute [r] additional_info + # @return [::Google::Protobuf::Map{::String => ::String}] + # Output only. Additional info related to the imported custom processor. + # Data is filled in by app platform during the processor creation. + # @!attribute [rw] model_schema + # @return [::Google::Cloud::VisionAI::V1::CustomProcessorSourceInfo::ModelSchema] + # Model schema files which specifies the signature of the model. + # For VERTEX_CUSTOM models, instances schema is required. + # If instances schema is not specified during the processor creation, + # VisionAI Platform will try to get it from Vertex, if it doesn't exist, the + # creation will fail. + class CustomProcessorSourceInfo + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Message describes product recognizer artifact. + # @!attribute [rw] retail_product_recognition_index + # @return [::String] + # Required. Resource name of RetailProductRecognitionIndex. + # Format is + # 'projects/*/locations/*/retailCatalogs/*/retailProductRecognitionIndexes/*' + # @!attribute [rw] vertex_model + # @return [::String] + # Optional. The resource name of embedding model hosted in Vertex AI + # Platform. + class ProductRecognizerArtifact + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The schema is defined as an OpenAPI 3.0.2 [Schema + # Object](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.2.md#schemaObject). + # @!attribute [rw] instances_schema + # @return [::Google::Cloud::VisionAI::V1::GcsSource] + # Cloud Storage location to a YAML file that defines the format of a single + # instance used in prediction and explanation requests. + # @!attribute [rw] parameters_schema + # @return [::Google::Cloud::VisionAI::V1::GcsSource] + # Cloud Storage location to a YAML file that defines the prediction and + # explanation parameters. + # @!attribute [rw] predictions_schema + # @return [::Google::Cloud::VisionAI::V1::GcsSource] + # Cloud Storage location to a YAML file that defines the format of a single + # prediction or explanation. + class ModelSchema + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class AdditionalInfoEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Source type of the imported custom processor. + module SourceType + # Source type unspecified. + SOURCE_TYPE_UNSPECIFIED = 0 + + # Custom processors coming from Vertex AutoML product. + VERTEX_AUTOML = 1 + + # Custom processors coming from general custom models from Vertex. + VERTEX_CUSTOM = 2 + + # Source for Product Recognizer. + PRODUCT_RECOGNIZER = 3 + end + end + + # Next ID: 35 + # @!attribute [rw] video_stream_input_config + # @return [::Google::Cloud::VisionAI::V1::VideoStreamInputConfig] + # Configs of stream input processor. + # + # Note: The following fields are mutually exclusive: `video_stream_input_config`, `ai_enabled_devices_input_config`, `media_warehouse_config`, `person_blur_config`, `occupancy_count_config`, `person_vehicle_detection_config`, `vertex_automl_vision_config`, `vertex_automl_video_config`, `vertex_custom_config`, `general_object_detection_config`, `big_query_config`, `gcs_output_config`, `product_recognizer_config`, `personal_protective_equipment_detection_config`, `tag_recognizer_config`, `universal_input_config`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] ai_enabled_devices_input_config + # @return [::Google::Cloud::VisionAI::V1::AIEnabledDevicesInputConfig] + # Config of AI-enabled input devices. + # + # Note: The following fields are mutually exclusive: `ai_enabled_devices_input_config`, `video_stream_input_config`, `media_warehouse_config`, `person_blur_config`, `occupancy_count_config`, `person_vehicle_detection_config`, `vertex_automl_vision_config`, `vertex_automl_video_config`, `vertex_custom_config`, `general_object_detection_config`, `big_query_config`, `gcs_output_config`, `product_recognizer_config`, `personal_protective_equipment_detection_config`, `tag_recognizer_config`, `universal_input_config`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] media_warehouse_config + # @return [::Google::Cloud::VisionAI::V1::MediaWarehouseConfig] + # Configs of media warehouse processor. + # + # Note: The following fields are mutually exclusive: `media_warehouse_config`, `video_stream_input_config`, `ai_enabled_devices_input_config`, `person_blur_config`, `occupancy_count_config`, `person_vehicle_detection_config`, `vertex_automl_vision_config`, `vertex_automl_video_config`, `vertex_custom_config`, `general_object_detection_config`, `big_query_config`, `gcs_output_config`, `product_recognizer_config`, `personal_protective_equipment_detection_config`, `tag_recognizer_config`, `universal_input_config`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] person_blur_config + # @return [::Google::Cloud::VisionAI::V1::PersonBlurConfig] + # Configs of person blur processor. + # + # Note: The following fields are mutually exclusive: `person_blur_config`, `video_stream_input_config`, `ai_enabled_devices_input_config`, `media_warehouse_config`, `occupancy_count_config`, `person_vehicle_detection_config`, `vertex_automl_vision_config`, `vertex_automl_video_config`, `vertex_custom_config`, `general_object_detection_config`, `big_query_config`, `gcs_output_config`, `product_recognizer_config`, `personal_protective_equipment_detection_config`, `tag_recognizer_config`, `universal_input_config`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] occupancy_count_config + # @return [::Google::Cloud::VisionAI::V1::OccupancyCountConfig] + # Configs of occupancy count processor. + # + # Note: The following fields are mutually exclusive: `occupancy_count_config`, `video_stream_input_config`, `ai_enabled_devices_input_config`, `media_warehouse_config`, `person_blur_config`, `person_vehicle_detection_config`, `vertex_automl_vision_config`, `vertex_automl_video_config`, `vertex_custom_config`, `general_object_detection_config`, `big_query_config`, `gcs_output_config`, `product_recognizer_config`, `personal_protective_equipment_detection_config`, `tag_recognizer_config`, `universal_input_config`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] person_vehicle_detection_config + # @return [::Google::Cloud::VisionAI::V1::PersonVehicleDetectionConfig] + # Configs of Person Vehicle Detection processor. + # + # Note: The following fields are mutually exclusive: `person_vehicle_detection_config`, `video_stream_input_config`, `ai_enabled_devices_input_config`, `media_warehouse_config`, `person_blur_config`, `occupancy_count_config`, `vertex_automl_vision_config`, `vertex_automl_video_config`, `vertex_custom_config`, `general_object_detection_config`, `big_query_config`, `gcs_output_config`, `product_recognizer_config`, `personal_protective_equipment_detection_config`, `tag_recognizer_config`, `universal_input_config`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] vertex_automl_vision_config + # @return [::Google::Cloud::VisionAI::V1::VertexAutoMLVisionConfig] + # Configs of Vertex AutoML vision processor. + # + # Note: The following fields are mutually exclusive: `vertex_automl_vision_config`, `video_stream_input_config`, `ai_enabled_devices_input_config`, `media_warehouse_config`, `person_blur_config`, `occupancy_count_config`, `person_vehicle_detection_config`, `vertex_automl_video_config`, `vertex_custom_config`, `general_object_detection_config`, `big_query_config`, `gcs_output_config`, `product_recognizer_config`, `personal_protective_equipment_detection_config`, `tag_recognizer_config`, `universal_input_config`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] vertex_automl_video_config + # @return [::Google::Cloud::VisionAI::V1::VertexAutoMLVideoConfig] + # Configs of Vertex AutoML video processor. + # + # Note: The following fields are mutually exclusive: `vertex_automl_video_config`, `video_stream_input_config`, `ai_enabled_devices_input_config`, `media_warehouse_config`, `person_blur_config`, `occupancy_count_config`, `person_vehicle_detection_config`, `vertex_automl_vision_config`, `vertex_custom_config`, `general_object_detection_config`, `big_query_config`, `gcs_output_config`, `product_recognizer_config`, `personal_protective_equipment_detection_config`, `tag_recognizer_config`, `universal_input_config`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] vertex_custom_config + # @return [::Google::Cloud::VisionAI::V1::VertexCustomConfig] + # Configs of Vertex Custom processor. + # + # Note: The following fields are mutually exclusive: `vertex_custom_config`, `video_stream_input_config`, `ai_enabled_devices_input_config`, `media_warehouse_config`, `person_blur_config`, `occupancy_count_config`, `person_vehicle_detection_config`, `vertex_automl_vision_config`, `vertex_automl_video_config`, `general_object_detection_config`, `big_query_config`, `gcs_output_config`, `product_recognizer_config`, `personal_protective_equipment_detection_config`, `tag_recognizer_config`, `universal_input_config`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] general_object_detection_config + # @return [::Google::Cloud::VisionAI::V1::GeneralObjectDetectionConfig] + # Configs of General Object Detection processor. + # + # Note: The following fields are mutually exclusive: `general_object_detection_config`, `video_stream_input_config`, `ai_enabled_devices_input_config`, `media_warehouse_config`, `person_blur_config`, `occupancy_count_config`, `person_vehicle_detection_config`, `vertex_automl_vision_config`, `vertex_automl_video_config`, `vertex_custom_config`, `big_query_config`, `gcs_output_config`, `product_recognizer_config`, `personal_protective_equipment_detection_config`, `tag_recognizer_config`, `universal_input_config`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] big_query_config + # @return [::Google::Cloud::VisionAI::V1::BigQueryConfig] + # Configs of BigQuery processor. + # + # Note: The following fields are mutually exclusive: `big_query_config`, `video_stream_input_config`, `ai_enabled_devices_input_config`, `media_warehouse_config`, `person_blur_config`, `occupancy_count_config`, `person_vehicle_detection_config`, `vertex_automl_vision_config`, `vertex_automl_video_config`, `vertex_custom_config`, `general_object_detection_config`, `gcs_output_config`, `product_recognizer_config`, `personal_protective_equipment_detection_config`, `tag_recognizer_config`, `universal_input_config`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] gcs_output_config + # @return [::Google::Cloud::VisionAI::V1::GcsOutputConfig] + # Configs of Cloud Storage output processor. + # + # Note: The following fields are mutually exclusive: `gcs_output_config`, `video_stream_input_config`, `ai_enabled_devices_input_config`, `media_warehouse_config`, `person_blur_config`, `occupancy_count_config`, `person_vehicle_detection_config`, `vertex_automl_vision_config`, `vertex_automl_video_config`, `vertex_custom_config`, `general_object_detection_config`, `big_query_config`, `product_recognizer_config`, `personal_protective_equipment_detection_config`, `tag_recognizer_config`, `universal_input_config`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] product_recognizer_config + # @return [::Google::Cloud::VisionAI::V1::ProductRecognizerConfig] + # Runtime configs of Product Recognizer processor. + # + # Note: The following fields are mutually exclusive: `product_recognizer_config`, `video_stream_input_config`, `ai_enabled_devices_input_config`, `media_warehouse_config`, `person_blur_config`, `occupancy_count_config`, `person_vehicle_detection_config`, `vertex_automl_vision_config`, `vertex_automl_video_config`, `vertex_custom_config`, `general_object_detection_config`, `big_query_config`, `gcs_output_config`, `personal_protective_equipment_detection_config`, `tag_recognizer_config`, `universal_input_config`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] personal_protective_equipment_detection_config + # @return [::Google::Cloud::VisionAI::V1::PersonalProtectiveEquipmentDetectionConfig] + # Configs of personal_protective_equipment_detection_config + # + # Note: The following fields are mutually exclusive: `personal_protective_equipment_detection_config`, `video_stream_input_config`, `ai_enabled_devices_input_config`, `media_warehouse_config`, `person_blur_config`, `occupancy_count_config`, `person_vehicle_detection_config`, `vertex_automl_vision_config`, `vertex_automl_video_config`, `vertex_custom_config`, `general_object_detection_config`, `big_query_config`, `gcs_output_config`, `product_recognizer_config`, `tag_recognizer_config`, `universal_input_config`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] tag_recognizer_config + # @return [::Google::Cloud::VisionAI::V1::TagRecognizerConfig] + # Runtime configs of Tag Recognizer processor. + # + # Note: The following fields are mutually exclusive: `tag_recognizer_config`, `video_stream_input_config`, `ai_enabled_devices_input_config`, `media_warehouse_config`, `person_blur_config`, `occupancy_count_config`, `person_vehicle_detection_config`, `vertex_automl_vision_config`, `vertex_automl_video_config`, `vertex_custom_config`, `general_object_detection_config`, `big_query_config`, `gcs_output_config`, `product_recognizer_config`, `personal_protective_equipment_detection_config`, `universal_input_config`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] universal_input_config + # @return [::Google::Cloud::VisionAI::V1::UniversalInputConfig] + # Runtime configs of UniversalInput processor. + # + # Note: The following fields are mutually exclusive: `universal_input_config`, `video_stream_input_config`, `ai_enabled_devices_input_config`, `media_warehouse_config`, `person_blur_config`, `occupancy_count_config`, `person_vehicle_detection_config`, `vertex_automl_vision_config`, `vertex_automl_video_config`, `vertex_custom_config`, `general_object_detection_config`, `big_query_config`, `gcs_output_config`, `product_recognizer_config`, `personal_protective_equipment_detection_config`, `tag_recognizer_config`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] experimental_config + # @return [::Google::Protobuf::Struct] + # Experimental configurations. Structured object containing not-yet-stable + # processor parameters. + class ProcessorConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Message describing Vision AI stream with application specific annotations. + # All the StreamAnnotation object inside this message MUST have unique id. + # @!attribute [rw] stream + # @return [::String] + # Vision AI Stream resource name. + # @!attribute [rw] application_annotations + # @return [::Array<::Google::Cloud::VisionAI::V1::StreamAnnotation>] + # Annotations that will be applied to the whole application. + # @!attribute [rw] node_annotations + # @return [::Array<::Google::Cloud::VisionAI::V1::StreamWithAnnotation::NodeAnnotation>] + # Annotations that will be applied to the specific node of the application. + # If the same type of the annotations is applied to both application and + # node, the node annotation will be added in addition to the global + # application one. + # For example, if there is one active zone annotation for the whole + # application and one active zone annotation for the Occupancy Analytic + # processor, then the Occupancy Analytic processor will have two active zones + # defined. + class StreamWithAnnotation + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Message describing annotations specific to application node. + # @!attribute [rw] node + # @return [::String] + # The node name of the application graph. + # @!attribute [rw] annotations + # @return [::Array<::Google::Cloud::VisionAI::V1::StreamAnnotation>] + # The node specific stream annotations. + class NodeAnnotation + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Message describing annotations specific to application node. + # This message is a duplication of StreamWithAnnotation.NodeAnnotation. + # @!attribute [rw] node + # @return [::String] + # The node name of the application graph. + # @!attribute [rw] annotations + # @return [::Array<::Google::Cloud::VisionAI::V1::StreamAnnotation>] + # The node specific stream annotations. + class ApplicationNodeAnnotation + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Message describing general annotation for resources. + # @!attribute [rw] application_annotations + # @return [::Array<::Google::Cloud::VisionAI::V1::StreamAnnotation>] + # Annotations that will be applied to the whole application. + # @!attribute [rw] node_annotations + # @return [::Array<::Google::Cloud::VisionAI::V1::ApplicationNodeAnnotation>] + # Annotations that will be applied to the specific node of the application. + # If the same type of the annotations is applied to both application and + # node, the node annotation will be added in addition to the global + # application one. + # For example, if there is one active zone annotation for the whole + # application and one active zone annotation for the Occupancy Analytic + # processor, then the Occupancy Analytic processor will have two active zones + # defined. + class ResourceAnnotations + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Message describing Video Stream Input Config. + # This message should only be used as a placeholder for builtin:stream-input + # processor, actual stream binding should be specified using corresponding + # API. + # @!attribute [rw] streams + # @deprecated This field is deprecated and may be removed in the next major version update. + # @return [::Array<::String>] + # @!attribute [rw] streams_with_annotation + # @deprecated This field is deprecated and may be removed in the next major version update. + # @return [::Array<::Google::Cloud::VisionAI::V1::StreamWithAnnotation>] + class VideoStreamInputConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Message describing AI-enabled Devices Input Config. + class AIEnabledDevicesInputConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Message describing MediaWarehouseConfig. + # @!attribute [rw] corpus + # @return [::String] + # Resource name of the Media Warehouse corpus. + # Format: + # projects/$\\{project_id}/locations/$\\{location_id}/corpora/$\\{corpus_id} + # @!attribute [rw] region + # @deprecated This field is deprecated and may be removed in the next major version update. + # @return [::String] + # Deprecated. + # @!attribute [rw] ttl + # @return [::Google::Protobuf::Duration] + # The duration for which all media assets, associated metadata, and search + # documents can exist. + class MediaWarehouseConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Message describing FaceBlurConfig. + # @!attribute [rw] person_blur_type + # @return [::Google::Cloud::VisionAI::V1::PersonBlurConfig::PersonBlurType] + # Person blur type. + # @!attribute [rw] faces_only + # @return [::Boolean] + # Whether only blur faces other than the whole object in the processor. + class PersonBlurConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Type of Person Blur + module PersonBlurType + # PersonBlur Type UNSPECIFIED. + PERSON_BLUR_TYPE_UNSPECIFIED = 0 + + # FaceBlur Type full occlusion. + FULL_OCCULUSION = 1 + + # FaceBlur Type blur filter. + BLUR_FILTER = 2 + end + end + + # Message describing OccupancyCountConfig. + # @!attribute [rw] enable_people_counting + # @return [::Boolean] + # Whether to count the appearances of people, output counts have 'people' as + # the key. + # @!attribute [rw] enable_vehicle_counting + # @return [::Boolean] + # Whether to count the appearances of vehicles, output counts will have + # 'vehicle' as the key. + # @!attribute [rw] enable_dwelling_time_tracking + # @return [::Boolean] + # Whether to track each invidual object's loitering time inside the scene or + # specific zone. + class OccupancyCountConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Message describing PersonVehicleDetectionConfig. + # @!attribute [rw] enable_people_counting + # @return [::Boolean] + # At least one of enable_people_counting and enable_vehicle_counting fields + # must be set to true. + # Whether to count the appearances of people, output counts have 'people' as + # the key. + # @!attribute [rw] enable_vehicle_counting + # @return [::Boolean] + # Whether to count the appearances of vehicles, output counts will have + # 'vehicle' as the key. + class PersonVehicleDetectionConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Message describing PersonalProtectiveEquipmentDetectionConfig. + # @!attribute [rw] enable_face_coverage_detection + # @return [::Boolean] + # Whether to enable face coverage detection. + # @!attribute [rw] enable_head_coverage_detection + # @return [::Boolean] + # Whether to enable head coverage detection. + # @!attribute [rw] enable_hands_coverage_detection + # @return [::Boolean] + # Whether to enable hands coverage detection. + class PersonalProtectiveEquipmentDetectionConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Message of configurations for General Object Detection processor. + class GeneralObjectDetectionConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Message of configurations for BigQuery processor. + # @!attribute [rw] table + # @return [::String] + # BigQuery table resource for Vision AI Platform to ingest annotations to. + # @!attribute [rw] cloud_function_mapping + # @return [::Google::Protobuf::Map{::String => ::String}] + # Data Schema + # By default, Vision AI Application will try to write annotations to the + # target BigQuery table using the following schema: + # + # ingestion_time: TIMESTAMP, the ingestion time of the original data. + # + # application: STRING, name of the application which produces the annotation. + # + # instance: STRING, Id of the instance which produces the annotation. + # + # node: STRING, name of the application graph node which produces the + # annotation. + # + # annotation: STRING or JSON, the actual annotation protobuf will be + # converted to json string with bytes field as 64 encoded string. It can be + # written to both String or Json type column. + # + # To forward annotation data to an existing BigQuery table, customer needs to + # make sure the compatibility of the schema. + # The map maps application node name to its corresponding cloud function + # endpoint to transform the annotations directly to the + # google.cloud.bigquery.storage.v1.AppendRowsRequest (only avro_rows or + # proto_rows should be set). If configured, annotations produced by + # corresponding application node will sent to the Cloud Function at first + # before be forwarded to BigQuery. + # + # If the default table schema doesn't fit, customer is able to transform the + # annotation output from Vision AI Application to arbitrary BigQuery table + # schema with CloudFunction. + # * The cloud function will receive AppPlatformCloudFunctionRequest where + # the annotations field will be the json format of Vision AI annotation. + # * The cloud function should return AppPlatformCloudFunctionResponse with + # AppendRowsRequest stored in the annotations field. + # * To drop the annotation, simply clear the annotations field in the + # returned AppPlatformCloudFunctionResponse. + # @!attribute [rw] create_default_table_if_not_exists + # @return [::Boolean] + # If true, App Platform will create the BigQuery DataSet and the + # BigQuery Table with default schema if the specified table doesn't exist. + # This doesn't work if any cloud function customized schema is specified + # since the system doesn't know your desired schema. + # JSON column will be used in the default table created by App Platform. + class BigQueryConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class CloudFunctionMappingEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Message of configurations of Vertex AutoML Vision Processors. + # @!attribute [rw] confidence_threshold + # @return [::Float] + # Only entities with higher score than the threshold will be returned. + # Value 0.0 means to return all the detected entities. + # @!attribute [rw] max_predictions + # @return [::Integer] + # At most this many predictions will be returned per output frame. + # Value 0 means to return all the detected entities. + class VertexAutoMLVisionConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Message describing VertexAutoMLVideoConfig. + # @!attribute [rw] confidence_threshold + # @return [::Float] + # Only entities with higher score than the threshold will be returned. + # Value 0.0 means returns all the detected entities. + # @!attribute [rw] blocked_labels + # @return [::Array<::String>] + # Labels specified in this field won't be returned. + # @!attribute [rw] max_predictions + # @return [::Integer] + # At most this many predictions will be returned per output frame. + # Value 0 means to return all the detected entities. + # @!attribute [rw] bounding_box_size_limit + # @return [::Float] + # Only Bounding Box whose size is larger than this limit will be returned. + # Object Tracking only. + # Value 0.0 means to return all the detected entities. + class VertexAutoMLVideoConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Message describing VertexCustomConfig. + # @!attribute [rw] max_prediction_fps + # @return [::Integer] + # The max prediction frame per second. This attribute sets how fast the + # operator sends prediction requests to Vertex AI endpoint. Default value is + # 0, which means there is no max prediction fps limit. The operator sends + # prediction requests at input fps. + # @!attribute [rw] dedicated_resources + # @return [::Google::Cloud::VisionAI::V1::DedicatedResources] + # A description of resources that are dedicated to the DeployedModel, and + # that need a higher degree of manual configuration. + # @!attribute [rw] post_processing_cloud_function + # @return [::String] + # If not empty, the prediction result will be sent to the specified cloud + # function for post processing. + # * The cloud function will receive AppPlatformCloudFunctionRequest where + # the annotations field will be the json format of proto PredictResponse. + # * The cloud function should return AppPlatformCloudFunctionResponse with + # PredictResponse stored in the annotations field. + # * To drop the prediction output, simply clear the payload field in the + # returned AppPlatformCloudFunctionResponse. + # @!attribute [rw] attach_application_metadata + # @return [::Boolean] + # If true, the prediction request received by custom model will also contain + # metadata with the following schema: + # 'appPlatformMetadata': { + # 'ingestionTime': DOUBLE; (UNIX timestamp) + # 'application': STRING; + # 'instanceId': STRING; + # 'node': STRING; + # 'processor': STRING; + # } + # @!attribute [rw] dynamic_config_input_topic + # @return [::String] + # Optional. By setting the configuration_input_topic, processor will + # subscribe to given topic, only pub/sub topic is supported now. Example + # channel: + # //pubsub.googleapis.com/projects/visionai-testing-stable/topics/test-topic + # message schema should be: + # message Message { + # // The ID of the stream that associates with the application instance. + # string stream_id = 1; + # // The target fps. By default, the custom processor will *not* send any + # data to the Vertex Prediction container. Note that once the + # dynamic_config_input_topic is set, max_prediction_fps will not work and be + # preceded by the fps set inside the topic. + # int32 fps = 2; + # } + class VertexCustomConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Message describing GcsOutputConfig. + # @!attribute [rw] gcs_path + # @return [::String] + # The Cloud Storage path for Vision AI Platform to ingest annotations to. + class GcsOutputConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Message describing UniversalInputConfig. + class UniversalInputConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Specification of a single machine. + # @!attribute [rw] machine_type + # @return [::String] + # Immutable. The type of the machine. + # + # See the [list of machine types supported for + # prediction](https://cloud.google.com/vertex-ai/docs/predictions/configure-compute#machine-types) + # + # See the [list of machine types supported for custom + # training](https://cloud.google.com/vertex-ai/docs/training/configure-compute#machine-types). + # + # For [DeployedModel][] this field is optional, and the default + # value is `n1-standard-2`. For [BatchPredictionJob][] or as part of + # [WorkerPoolSpec][] this field is required. + # @!attribute [rw] accelerator_type + # @return [::Google::Cloud::VisionAI::V1::AcceleratorType] + # Immutable. The type of accelerator(s) that may be attached to the machine + # as per + # {::Google::Cloud::VisionAI::V1::MachineSpec#accelerator_count accelerator_count}. + # @!attribute [rw] accelerator_count + # @return [::Integer] + # The number of accelerators to attach to the machine. + class MachineSpec + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The metric specification that defines the target resource utilization + # (CPU utilization, accelerator's duty cycle, and so on) for calculating the + # desired replica count. + # @!attribute [rw] metric_name + # @return [::String] + # Required. The resource metric name. + # Supported metrics: + # + # * For Online Prediction: + # * `aiplatform.googleapis.com/prediction/online/accelerator/duty_cycle` + # * `aiplatform.googleapis.com/prediction/online/cpu/utilization` + # @!attribute [rw] target + # @return [::Integer] + # The target resource utilization in percentage (1% - 100%) for the given + # metric; once the real usage deviates from the target by a certain + # percentage, the machine replicas change. The default value is 60 + # (representing 60%) if not provided. + class AutoscalingMetricSpec + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A description of resources that are dedicated to a DeployedModel, and + # that need a higher degree of manual configuration. + # @!attribute [rw] machine_spec + # @return [::Google::Cloud::VisionAI::V1::MachineSpec] + # Required. Immutable. The specification of a single machine used by the + # prediction. + # @!attribute [rw] min_replica_count + # @return [::Integer] + # Required. Immutable. The minimum number of machine replicas this + # DeployedModel will be always deployed on. This value must be greater than + # or equal to 1. + # + # If traffic against the DeployedModel increases, it may dynamically be + # deployed onto more replicas, and as traffic decreases, some of these extra + # replicas may be freed. + # @!attribute [rw] max_replica_count + # @return [::Integer] + # Immutable. The maximum number of replicas this DeployedModel may be + # deployed on when the traffic against it increases. If the requested value + # is too large, the deployment will error, but if deployment succeeds then + # the ability to scale the model to that many replicas is guaranteed (barring + # service outages). If traffic against the DeployedModel increases beyond + # what its replicas at maximum may handle, a portion of the traffic will be + # dropped. If this value is not provided, will use + # {::Google::Cloud::VisionAI::V1::DedicatedResources#min_replica_count min_replica_count} + # as the default value. + # + # The value of this field impacts the charge against Vertex CPU and GPU + # quotas. Specifically, you will be charged for max_replica_count * + # number of cores in the selected machine type) and (max_replica_count * + # number of GPUs per replica in the selected machine type). + # @!attribute [rw] autoscaling_metric_specs + # @return [::Array<::Google::Cloud::VisionAI::V1::AutoscalingMetricSpec>] + # Immutable. The metric specifications that overrides a resource + # utilization metric (CPU utilization, accelerator's duty cycle, and so on) + # target value (default to 60 if not set). At most one entry is allowed per + # metric. + # + # If + # {::Google::Cloud::VisionAI::V1::MachineSpec#accelerator_count machine_spec.accelerator_count} + # is above 0, the autoscaling will be based on both CPU utilization and + # accelerator's duty cycle metrics and scale up when either metrics exceeds + # its target value while scale down if both metrics are under their target + # value. The default target value is 60 for both metrics. + # + # If + # {::Google::Cloud::VisionAI::V1::MachineSpec#accelerator_count machine_spec.accelerator_count} + # is 0, the autoscaling will be based on CPU utilization metric only with + # default target value 60 if not explicitly set. + # + # For example, in the case of Online Prediction, if you want to override + # target CPU utilization to 80, you should set + # {::Google::Cloud::VisionAI::V1::AutoscalingMetricSpec#metric_name autoscaling_metric_specs.metric_name} + # to `aiplatform.googleapis.com/prediction/online/cpu/utilization` and + # {::Google::Cloud::VisionAI::V1::AutoscalingMetricSpec#target autoscaling_metric_specs.target} + # to `80`. + class DedicatedResources + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Message describing ProductRecognizerConfig. + # @!attribute [rw] retail_endpoint + # @return [::String] + # The resource name of retail endpoint to use. + # @!attribute [rw] recognition_confidence_threshold + # @return [::Float] + # Confidence threshold to filter detection results. If not set, a system + # default value will be used. + class ProductRecognizerConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Message describing TagRecognizerConfig. + # @!attribute [rw] entity_detection_confidence_threshold + # @return [::Float] + # Confidence threshold to filter detection results. If not set, a system + # default value will be used. + # @!attribute [rw] tag_parsing_config + # @return [::Google::Cloud::VisionAI::V1::TagParsingConfig] + # Configuration to customize how tags are parsed. + class TagRecognizerConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Configuration for tag parsing. + # @!attribute [rw] entity_parsing_configs + # @return [::Array<::Google::Cloud::VisionAI::V1::TagParsingConfig::EntityParsingConfig>] + # Each tag entity class may have an optional EntityParsingConfig which is + # used to help parse the entities of the class. + class TagParsingConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Configuration for parsing a tag entity class. + # @!attribute [rw] entity_class + # @return [::String] + # Required. The tag entity class name. This should match the class name + # produced by the tag entity detection model. + # @!attribute [rw] regex + # @return [::String] + # Optional. An regular expression hint. + # @!attribute [rw] entity_matching_strategy + # @return [::Google::Cloud::VisionAI::V1::TagParsingConfig::EntityParsingConfig::EntityMatchingStrategy] + # Optional. Entity matching strategy. + class EntityParsingConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Type of entity matching strategy. + module EntityMatchingStrategy + # If unspecified, multi-line matching will be used by default. + ENTITY_MATCHING_STRATEGY_UNSPECIFIED = 0 + + # Matches multiple lines of text. + MULTI_LINE_MATCHING = 1 + + # Matches the line with the maximum overlap area with entity bounding + # box. + MAX_OVERLAP_AREA = 2 + end + end + end + + # All the supported model types in Vision AI App Platform. + module ModelType + # Processor Type UNSPECIFIED. + MODEL_TYPE_UNSPECIFIED = 0 + + # Model Type Image Classification. + IMAGE_CLASSIFICATION = 1 + + # Model Type Object Detection. + OBJECT_DETECTION = 2 + + # Model Type Video Classification. + VIDEO_CLASSIFICATION = 3 + + # Model Type Object Tracking. + VIDEO_OBJECT_TRACKING = 4 + + # Model Type Action Recognition. + VIDEO_ACTION_RECOGNITION = 5 + + # Model Type Occupancy Counting. + OCCUPANCY_COUNTING = 6 + + # Model Type Person Blur. + PERSON_BLUR = 7 + + # Model Type Vertex Custom. + VERTEX_CUSTOM = 8 + + # Model Type Product Recognizer. + PRODUCT_RECOGNIZER = 9 + + # Model Type Tag Recognizer. + TAG_RECOGNIZER = 10 + + # Model Type SynthID. + SYNTH_ID = 15 + end + + # Represents a hardware accelerator type. + module AcceleratorType + # Unspecified accelerator type, which means no accelerator. + ACCELERATOR_TYPE_UNSPECIFIED = 0 + + # Nvidia Tesla K80 GPU. + NVIDIA_TESLA_K80 = 1 + + # Nvidia Tesla P100 GPU. + NVIDIA_TESLA_P100 = 2 + + # Nvidia Tesla V100 GPU. + NVIDIA_TESLA_V100 = 3 + + # Nvidia Tesla P4 GPU. + NVIDIA_TESLA_P4 = 4 + + # Nvidia Tesla T4 GPU. + NVIDIA_TESLA_T4 = 5 + + # Nvidia Tesla A100 GPU. + NVIDIA_TESLA_A100 = 8 + + # TPU v2. + TPU_V2 = 6 + + # TPU v3. + TPU_V3 = 7 + end + + # All supported data types. + module DataType + # The default value of DataType. + DATA_TYPE_UNSPECIFIED = 0 + + # Video data type like H264. + VIDEO = 1 + + # Image data type. + IMAGE = 3 + + # Protobuf data type, usually used for general data blob. + PROTO = 2 + + # A placeholder data type, applicable for the universal input processor which + # supports any data type. This will be instantiated and replaced by a + # concrete underlying `DataType` during instance deployment. + PLACEHOLDER = 4 + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/proto_docs/google/cloud/visionai/v1/streaming_resources.rb b/owl-bot-staging/google-cloud-vision_ai-v1/proto_docs/google/cloud/visionai/v1/streaming_resources.rb new file mode 100644 index 000000000000..8d513760f9bf --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/proto_docs/google/cloud/visionai/v1/streaming_resources.rb @@ -0,0 +1,182 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 VisionAI + module V1 + # The descriptor for a gstreamer buffer payload. + # @!attribute [rw] caps_string + # @return [::String] + # The caps string of the payload. + # @!attribute [rw] is_key_frame + # @return [::Boolean] + # Whether the buffer is a key frame. + # @!attribute [rw] pts_time + # @return [::Google::Protobuf::Timestamp] + # PTS of the frame. + # @!attribute [rw] dts_time + # @return [::Google::Protobuf::Timestamp] + # DTS of the frame. + # @!attribute [rw] duration + # @return [::Google::Protobuf::Duration] + # Duration of the frame. + class GstreamerBufferDescriptor + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The descriptor for a raw image. + # @!attribute [rw] format + # @return [::String] + # Raw image format. Its possible values are: "srgb". + # @!attribute [rw] height + # @return [::Integer] + # The height of the image. + # @!attribute [rw] width + # @return [::Integer] + # The width of the image. + class RawImageDescriptor + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The message that represents the data type of a packet. + # @!attribute [rw] type_class + # @return [::String] + # The type class of the packet. Its possible values are: + # "gst", "protobuf", and "string". + # @!attribute [rw] type_descriptor + # @return [::Google::Cloud::VisionAI::V1::PacketType::TypeDescriptor] + # The type descriptor. + class PacketType + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The message that fully specifies the type of the packet. + # @!attribute [rw] gstreamer_buffer_descriptor + # @return [::Google::Cloud::VisionAI::V1::GstreamerBufferDescriptor] + # GstreamerBufferDescriptor is the descriptor for gstreamer buffer type. + # + # Note: The following fields are mutually exclusive: `gstreamer_buffer_descriptor`, `raw_image_descriptor`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] raw_image_descriptor + # @return [::Google::Cloud::VisionAI::V1::RawImageDescriptor] + # RawImageDescriptor is the descriptor for the raw image type. + # + # Note: The following fields are mutually exclusive: `raw_image_descriptor`, `gstreamer_buffer_descriptor`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] type + # @return [::String] + # The type of the packet. Its possible values is codec dependent. + # + # The fully qualified type name is always the concatenation of the + # value in `type_class` together with the value in `type`, separated by a + # '/'. + # + # Note that specific codecs can define their own type hierarchy, and so the + # type string here can in fact be separated by multiple '/'s of its own. + # + # Please see the open source SDK for specific codec documentation. + class TypeDescriptor + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The message that represents server metadata. + # @!attribute [rw] offset + # @return [::Integer] + # The offset position for the packet in its stream. + # @!attribute [rw] ingest_time + # @return [::Google::Protobuf::Timestamp] + # The timestamp at which the stream server receives this packet. This is + # based on the local clock of on the server side. It is guaranteed to be + # monotonically increasing for the packets within each session; however + # this timestamp is not comparable across packets sent to the same stream + # different sessions. Session here refers to one individual gRPC streaming + # request to the stream server. + class ServerMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The message that represents series metadata. + # @!attribute [rw] series + # @return [::String] + # Series name. It's in the format of + # "projects/\\{project}/locations/\\{location}/clusters/\\{cluster}/series/\\{stream}". + class SeriesMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The message that represents packet header. + # @!attribute [rw] capture_time + # @return [::Google::Protobuf::Timestamp] + # Input only. The capture time of the packet. + # @!attribute [rw] type + # @return [::Google::Cloud::VisionAI::V1::PacketType] + # Input only. Immutable. The type of the payload. + # @!attribute [rw] metadata + # @return [::Google::Protobuf::Struct] + # Input only. This field is for users to attach user managed metadata. + # @!attribute [r] server_metadata + # @return [::Google::Cloud::VisionAI::V1::ServerMetadata] + # Output only. Metadata that the server appends to each packet before sending + # it to receivers. You don't need to set a value for this field when sending + # packets. + # @!attribute [rw] series_metadata + # @return [::Google::Cloud::VisionAI::V1::SeriesMetadata] + # Input only. Immutable. Metadata that the server needs to know where to + # write the packets to. It's only required for the first packet. + # @!attribute [rw] flags + # @return [::Integer] + # Immutable. Packet flag set. SDK will set the flag automatically. + # @!attribute [rw] trace_context + # @return [::String] + # Immutable. Header string for tracing across services. It should be set when + # the packet is first arrived in the stream server. + # + # The input format is a lowercase hex string: + # - version_id: 1 byte, currently must be zero - hex encoded (2 characters) + # - trace_id: 16 bytes (opaque blob) - hex encoded (32 characters) + # - span_id: 8 bytes (opaque blob) - hex encoded (16 characters) + # - trace_options: 1 byte (LSB means tracing enabled) - hex encoded (2 + # characters) + # Example: "00-404142434445464748494a4b4c4d4e4f-6162636465666768-01" + # v trace_id span_id options + class PacketHeader + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The quanta of datum that the series accepts. + # @!attribute [rw] header + # @return [::Google::Cloud::VisionAI::V1::PacketHeader] + # The packet header. + # @!attribute [rw] payload + # @return [::String] + # The payload of the packet. + class Packet + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/proto_docs/google/cloud/visionai/v1/streaming_service.rb b/owl-bot-staging/google-cloud-vision_ai-v1/proto_docs/google/cloud/visionai/v1/streaming_service.rb new file mode 100644 index 000000000000..146610b2eb83 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/proto_docs/google/cloud/visionai/v1/streaming_service.rb @@ -0,0 +1,425 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 VisionAI + module V1 + # Request message for ReceiveEvents. + # @!attribute [rw] setup_request + # @return [::Google::Cloud::VisionAI::V1::ReceiveEventsRequest::SetupRequest] + # The setup request to setup the RPC connection. + # + # Note: The following fields are mutually exclusive: `setup_request`, `commit_request`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] commit_request + # @return [::Google::Cloud::VisionAI::V1::CommitRequest] + # This request checkpoints the consumer's read progress. + # + # Note: The following fields are mutually exclusive: `commit_request`, `setup_request`. If a field in that set is populated, all other fields in the set will automatically be cleared. + class ReceiveEventsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # SetupRequest is the first message sent to the service to setup the RPC + # connection. + # @!attribute [rw] cluster + # @return [::String] + # The cluster name. + # @!attribute [rw] stream + # @return [::String] + # The stream name. The service will return the events for the given stream. + # @!attribute [rw] receiver + # @return [::String] + # A name for the receiver to self-identify. + # + # This is used to keep track of a receiver's read progress. + # @!attribute [rw] controlled_mode + # @return [::Google::Cloud::VisionAI::V1::ControlledMode] + # Controller mode configuration for receiving events from the server. + # @!attribute [rw] heartbeat_interval + # @return [::Google::Protobuf::Duration] + # The maximum duration of server silence before the client determines the + # server unreachable. + # + # The client must either receive an `Event` update or a heart beat message + # before this duration expires; otherwise, the client will automatically + # cancel the current connection and retry. + # @!attribute [rw] writes_done_grace_period + # @return [::Google::Protobuf::Duration] + # The grace period after which a `writes_done_request` is issued, that a + # `WritesDone` is expected from the client. + # + # The server is free to cancel the RPC should this expire. + # + # A system default will be chosen if unset. + class SetupRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The event update message. + # @!attribute [rw] stream + # @return [::String] + # The name of the stream that the event is attached to. + # @!attribute [rw] event + # @return [::String] + # The name of the event. + # @!attribute [rw] series + # @return [::String] + # The name of the series. + # @!attribute [rw] update_time + # @return [::Google::Protobuf::Timestamp] + # The timestamp when the Event update happens. + # @!attribute [rw] offset + # @return [::Integer] + # The offset of the message that will be used to acknowledge of the message + # receiving. + class EventUpdate + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Control message for a ReceiveEventsResponse. + # @!attribute [rw] heartbeat + # @return [::Boolean] + # A server heartbeat. + # + # Note: The following fields are mutually exclusive: `heartbeat`, `writes_done_request`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] writes_done_request + # @return [::Boolean] + # A request to the receiver to complete any final writes followed by a + # `WritesDone`; e.g. issue any final `CommitRequest`s. + # + # May be ignored if `WritesDone` has already been issued at any point + # prior to receiving this message. + # + # If `WritesDone` does not get issued, then the server will forcefully + # cancel the connection, and the receiver will likely receive an + # uninformative after `Read` returns `false` and `Finish` is called. + # + # Note: The following fields are mutually exclusive: `writes_done_request`, `heartbeat`. If a field in that set is populated, all other fields in the set will automatically be cleared. + class ReceiveEventsControlResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for the ReceiveEvents. + # @!attribute [rw] event_update + # @return [::Google::Cloud::VisionAI::V1::EventUpdate] + # The event update message. + # + # Note: The following fields are mutually exclusive: `event_update`, `control`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] control + # @return [::Google::Cloud::VisionAI::V1::ReceiveEventsControlResponse] + # A control message from the server. + # + # Note: The following fields are mutually exclusive: `control`, `event_update`. If a field in that set is populated, all other fields in the set will automatically be cleared. + class ReceiveEventsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The lease message. + # @!attribute [rw] id + # @return [::String] + # The lease id. + # @!attribute [rw] series + # @return [::String] + # The series name. + # @!attribute [rw] owner + # @return [::String] + # The owner name. + # @!attribute [rw] expire_time + # @return [::Google::Protobuf::Timestamp] + # The lease expire time. + # @!attribute [rw] lease_type + # @return [::Google::Cloud::VisionAI::V1::LeaseType] + # The lease type. + class Lease + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for acquiring a lease. + # @!attribute [rw] series + # @return [::String] + # The series name. + # @!attribute [rw] owner + # @return [::String] + # The owner name. + # @!attribute [rw] term + # @return [::Google::Protobuf::Duration] + # The lease term. + # @!attribute [rw] lease_type + # @return [::Google::Cloud::VisionAI::V1::LeaseType] + # The lease type. + class AcquireLeaseRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for renewing a lease. + # @!attribute [rw] id + # @return [::String] + # Lease id. + # @!attribute [rw] series + # @return [::String] + # Series name. + # @!attribute [rw] owner + # @return [::String] + # Lease owner. + # @!attribute [rw] term + # @return [::Google::Protobuf::Duration] + # Lease term. + class RenewLeaseRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for releasing lease. + # @!attribute [rw] id + # @return [::String] + # Lease id. + # @!attribute [rw] series + # @return [::String] + # Series name. + # @!attribute [rw] owner + # @return [::String] + # Lease owner. + class ReleaseLeaseRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for release lease. + class ReleaseLeaseResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # RequestMetadata is the metadata message for the request. + # @!attribute [rw] stream + # @return [::String] + # Stream name. + # @!attribute [rw] event + # @return [::String] + # Evevt name. + # @!attribute [rw] series + # @return [::String] + # Series name. + # @!attribute [rw] lease_id + # @return [::String] + # Lease id. + # @!attribute [rw] owner + # @return [::String] + # Owner name. + # @!attribute [rw] lease_term + # @return [::Google::Protobuf::Duration] + # Lease term specifies how long the client wants the session to be maintained + # by the server after the client leaves. If the lease term is not set, the + # server will release the session immediately and the client cannot reconnect + # to the same session later. + class RequestMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for sending packets. + # @!attribute [rw] packet + # @return [::Google::Cloud::VisionAI::V1::Packet] + # Packets sent over the streaming rpc. + # + # Note: The following fields are mutually exclusive: `packet`, `metadata`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] metadata + # @return [::Google::Cloud::VisionAI::V1::RequestMetadata] + # The first message of the streaming rpc including the request metadata. + # + # Note: The following fields are mutually exclusive: `metadata`, `packet`. If a field in that set is populated, all other fields in the set will automatically be cleared. + class SendPacketsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for sending packets. + class SendPacketsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for receiving packets. + # @!attribute [rw] setup_request + # @return [::Google::Cloud::VisionAI::V1::ReceivePacketsRequest::SetupRequest] + # The request to setup the initial state of session. + # + # The client must send and only send this as the first message. + # + # Note: The following fields are mutually exclusive: `setup_request`, `commit_request`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] commit_request + # @return [::Google::Cloud::VisionAI::V1::CommitRequest] + # This request checkpoints the consumer's read progress. + # + # Note: The following fields are mutually exclusive: `commit_request`, `setup_request`. If a field in that set is populated, all other fields in the set will automatically be cleared. + class ReceivePacketsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The message specifying the initial settings for the ReceivePackets session. + # @!attribute [rw] eager_receive_mode + # @return [::Google::Cloud::VisionAI::V1::EagerMode] + # Options for configuring eager mode. + # + # Note: The following fields are mutually exclusive: `eager_receive_mode`, `controlled_receive_mode`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] controlled_receive_mode + # @return [::Google::Cloud::VisionAI::V1::ControlledMode] + # Options for configuring controlled mode. + # + # Note: The following fields are mutually exclusive: `controlled_receive_mode`, `eager_receive_mode`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] metadata + # @return [::Google::Cloud::VisionAI::V1::RequestMetadata] + # The configurations that specify where packets are retrieved. + # @!attribute [rw] receiver + # @return [::String] + # A name for the receiver to self-identify. + # + # This is used to keep track of a receiver's read progress. + # @!attribute [rw] heartbeat_interval + # @return [::Google::Protobuf::Duration] + # The maximum duration of server silence before the client determines the + # server unreachable. + # + # The client must either receive a `Packet` or a heart beat message before + # this duration expires; otherwise, the client will automatically cancel + # the current connection and retry. + # @!attribute [rw] writes_done_grace_period + # @return [::Google::Protobuf::Duration] + # The grace period after which a `writes_done_request` is issued, that a + # `WritesDone` is expected from the client. + # + # The server is free to cancel the RPC should this expire. + # + # A system default will be chosen if unset. + class SetupRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Control message for a ReceivePacketsResponse. + # @!attribute [rw] heartbeat + # @return [::Boolean] + # A server heartbeat. + # + # Note: The following fields are mutually exclusive: `heartbeat`, `writes_done_request`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] writes_done_request + # @return [::Boolean] + # A request to the receiver to complete any final writes followed by a + # `WritesDone`; e.g. issue any final `CommitRequest`s. + # + # May be ignored if `WritesDone` has already been issued at any point + # prior to receiving this message. + # + # If `WritesDone` does not get issued, then the server will forcefully + # cancel the connection, and the receiver will likely receive an + # uninformative after `Read` returns `false` and `Finish` is called. + # + # Note: The following fields are mutually exclusive: `writes_done_request`, `heartbeat`. If a field in that set is populated, all other fields in the set will automatically be cleared. + class ReceivePacketsControlResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message from ReceivePackets. + # @!attribute [rw] packet + # @return [::Google::Cloud::VisionAI::V1::Packet] + # A genuine data payload originating from the sender. + # + # Note: The following fields are mutually exclusive: `packet`, `control`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] control + # @return [::Google::Cloud::VisionAI::V1::ReceivePacketsControlResponse] + # A control message from the server. + # + # Note: The following fields are mutually exclusive: `control`, `packet`. If a field in that set is populated, all other fields in the set will automatically be cleared. + class ReceivePacketsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The options for receiver under the eager mode. + class EagerMode + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The options for receiver under the controlled mode. + # @!attribute [rw] starting_logical_offset + # @return [::String] + # This can be set to the following logical starting points: + # + # "begin": This will read from the earliest available message. + # + # "most-recent": This will read from the latest available message. + # + # "end": This will read only future messages. + # + # "stored": This will resume reads one past the last committed offset. + # It is the only option that resumes progress; all others + # jump unilaterally. + # @!attribute [rw] fallback_starting_offset + # @return [::String] + # This is the logical starting point to fallback upon should the + # specified starting offset be unavailable. + # + # This can be one of the following values: + # + # "begin": This will read from the earliest available message. + # + # "end": This will read only future messages. + class ControlledMode + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The message for explicitly committing the read progress. + # + # This may only be used when `ReceivePacketsControlledMode` is set in the + # initial setup request. + # @!attribute [rw] offset + # @return [::Integer] + # The offset to commit. + class CommitRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The lease type. + module LeaseType + # Lease type unspecified. + LEASE_TYPE_UNSPECIFIED = 0 + + # Lease for stream reader. + LEASE_TYPE_READER = 1 + + # Lease for stream writer. + LEASE_TYPE_WRITER = 2 + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/proto_docs/google/cloud/visionai/v1/streams_resources.rb b/owl-bot-staging/google-cloud-vision_ai-v1/proto_docs/google/cloud/visionai/v1/streams_resources.rb new file mode 100644 index 000000000000..3277a81932f8 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/proto_docs/google/cloud/visionai/v1/streams_resources.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 Cloud + module VisionAI + module V1 + # Message describing the Stream object. The Stream and the Event resources are + # many to many; i.e., each Stream resource can associate to many Event + # resources and each Event resource can associate to many Stream resources. + # @!attribute [rw] name + # @return [::String] + # Name of the resource. + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The create timestamp. + # @!attribute [r] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The update timestamp. + # @!attribute [rw] labels + # @return [::Google::Protobuf::Map{::String => ::String}] + # Labels as key value pairs. + # @!attribute [rw] annotations + # @return [::Google::Protobuf::Map{::String => ::String}] + # Annotations to allow clients to store small amounts of arbitrary data. + # @!attribute [rw] display_name + # @return [::String] + # The display name for the stream resource. + # @!attribute [rw] enable_hls_playback + # @return [::Boolean] + # Whether to enable the HLS playback service on this stream. + # @!attribute [rw] media_warehouse_asset + # @return [::String] + # The name of the media warehouse asset for long term storage of stream data. + # Format: projects/$\\{p_id}/locations/$\\{l_id}/corpora/$\\{c_id}/assets/$\\{a_id} + # Remain empty if the media warehouse storage is not needed for the stream. + class Stream + 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 + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class AnnotationsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Message describing the Event object. + # @!attribute [rw] name + # @return [::String] + # Name of the resource. + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The create timestamp. + # @!attribute [r] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The update timestamp. + # @!attribute [rw] labels + # @return [::Google::Protobuf::Map{::String => ::String}] + # Labels as key value pairs. + # @!attribute [rw] annotations + # @return [::Google::Protobuf::Map{::String => ::String}] + # Annotations to allow clients to store small amounts of arbitrary data. + # @!attribute [rw] alignment_clock + # @return [::Google::Cloud::VisionAI::V1::Event::Clock] + # The clock used for joining streams. + # @!attribute [rw] grace_period + # @return [::Google::Protobuf::Duration] + # Grace period for cleaning up the event. This is the time the controller + # waits for before deleting the event. During this period, if there is any + # active channel on the event. The deletion of the event after grace_period + # will be ignored. + class Event + 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 + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class AnnotationsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Clock that will be used for joining streams. + module Clock + # Clock is not specified. + CLOCK_UNSPECIFIED = 0 + + # Use the timestamp when the data is captured. Clients need to sync the + # clock. + CAPTURE = 1 + + # Use the timestamp when the data is received. + INGEST = 2 + end + end + + # Message describing the Series object. + # @!attribute [rw] name + # @return [::String] + # Name of the resource. + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The create timestamp. + # @!attribute [r] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The update timestamp. + # @!attribute [rw] labels + # @return [::Google::Protobuf::Map{::String => ::String}] + # Labels as key value pairs. + # @!attribute [rw] annotations + # @return [::Google::Protobuf::Map{::String => ::String}] + # Annotations to allow clients to store small amounts of arbitrary data. + # @!attribute [rw] stream + # @return [::String] + # Required. Stream that is associated with this series. + # @!attribute [rw] event + # @return [::String] + # Required. Event that is associated with this series. + class Series + 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 + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class AnnotationsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Message describing the Channel object. + # @!attribute [rw] name + # @return [::String] + # Name of the resource. + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The create timestamp. + # @!attribute [r] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The update timestamp. + # @!attribute [rw] labels + # @return [::Google::Protobuf::Map{::String => ::String}] + # Labels as key value pairs. + # @!attribute [rw] annotations + # @return [::Google::Protobuf::Map{::String => ::String}] + # Annotations to allow clients to store small amounts of arbitrary data. + # @!attribute [rw] stream + # @return [::String] + # Required. Stream that is associated with this series. + # @!attribute [rw] event + # @return [::String] + # Required. Event that is associated with this series. + class Channel + 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 + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class AnnotationsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/proto_docs/google/cloud/visionai/v1/streams_service.rb b/owl-bot-staging/google-cloud-vision_ai-v1/proto_docs/google/cloud/visionai/v1/streams_service.rb new file mode 100644 index 000000000000..8b52b330d685 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/proto_docs/google/cloud/visionai/v1/streams_service.rb @@ -0,0 +1,644 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 VisionAI + module V1 + # Message for requesting list of Clusters. + # @!attribute [rw] parent + # @return [::String] + # Required. Parent value for ListClustersRequest. + # @!attribute [rw] page_size + # @return [::Integer] + # Requested page size. Server may return fewer items than requested. + # If unspecified, server will pick an appropriate default. + # @!attribute [rw] page_token + # @return [::String] + # A token identifying a page of results the server should return. + # @!attribute [rw] filter + # @return [::String] + # Filtering results. + # @!attribute [rw] order_by + # @return [::String] + # Hint for how to order the results. + class ListClustersRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Message for response to listing Clusters. + # @!attribute [rw] clusters + # @return [::Array<::Google::Cloud::VisionAI::V1::Cluster>] + # The list of Cluster. + # @!attribute [rw] next_page_token + # @return [::String] + # A token identifying a page of results the server should return. + # @!attribute [rw] unreachable + # @return [::Array<::String>] + # Locations that could not be reached. + class ListClustersResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Message for getting a Cluster. + # @!attribute [rw] name + # @return [::String] + # Required. Name of the resource. + class GetClusterRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Message for creating a Cluster. + # @!attribute [rw] parent + # @return [::String] + # Required. Value for parent. + # @!attribute [rw] cluster_id + # @return [::String] + # Required. Id of the requesting object. + # @!attribute [rw] cluster + # @return [::Google::Cloud::VisionAI::V1::Cluster] + # Required. The resource being created. + # @!attribute [rw] request_id + # @return [::String] + # Optional. An optional request ID to identify requests. Specify a unique + # request ID so that if you must retry your request, the server will know to + # ignore the request if it has already been completed. The server will + # guarantee that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request ID, + # the server can check if original operation with the same request ID was + # received, and if so, will ignore the second request. This prevents clients + # from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + class CreateClusterRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Message for updating a Cluster. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # Required. Field mask is used to specify the fields to be overwritten in the + # Cluster resource by the update. + # The fields specified in the update_mask are relative to the resource, not + # the full request. A field will be overwritten if it is in the mask. If the + # user does not provide a mask then all fields will be overwritten. + # @!attribute [rw] cluster + # @return [::Google::Cloud::VisionAI::V1::Cluster] + # Required. The resource being updated + # @!attribute [rw] request_id + # @return [::String] + # Optional. An optional request ID to identify requests. Specify a unique + # request ID so that if you must retry your request, the server will know to + # ignore the request if it has already been completed. The server will + # guarantee that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request ID, + # the server can check if original operation with the same request ID was + # received, and if so, will ignore the second request. This prevents clients + # from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + class UpdateClusterRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Message for deleting a Cluster. + # @!attribute [rw] name + # @return [::String] + # Required. Name of the resource + # @!attribute [rw] request_id + # @return [::String] + # Optional. An optional request ID to identify requests. Specify a unique + # request ID so that if you must retry your request, the server will know to + # ignore the request if it has already been completed. The server will + # guarantee that for at least 60 minutes after the first request. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request ID, + # the server can check if original operation with the same request ID was + # received, and if so, will ignore the second request. This prevents clients + # from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + class DeleteClusterRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Message for requesting list of Streams. + # @!attribute [rw] parent + # @return [::String] + # Required. Parent value for ListStreamsRequest. + # @!attribute [rw] page_size + # @return [::Integer] + # Requested page size. Server may return fewer items than requested. + # If unspecified, server will pick an appropriate default. + # @!attribute [rw] page_token + # @return [::String] + # A token identifying a page of results the server should return. + # @!attribute [rw] filter + # @return [::String] + # Filtering results. + # @!attribute [rw] order_by + # @return [::String] + # Hint for how to order the results. + class ListStreamsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Message for response to listing Streams. + # @!attribute [rw] streams + # @return [::Array<::Google::Cloud::VisionAI::V1::Stream>] + # The list of Stream. + # @!attribute [rw] next_page_token + # @return [::String] + # A token identifying a page of results the server should return. + # @!attribute [rw] unreachable + # @return [::Array<::String>] + # Locations that could not be reached. + class ListStreamsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Message for getting a Stream. + # @!attribute [rw] name + # @return [::String] + # Required. Name of the resource. + class GetStreamRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Message for creating a Stream. + # @!attribute [rw] parent + # @return [::String] + # Required. Value for parent. + # @!attribute [rw] stream_id + # @return [::String] + # Required. Id of the requesting object. + # @!attribute [rw] stream + # @return [::Google::Cloud::VisionAI::V1::Stream] + # Required. The resource being created. + # @!attribute [rw] request_id + # @return [::String] + # Optional. An optional request ID to identify requests. Specify a unique + # request ID so that if you must retry your request, the server will know to + # ignore the request if it has already been completed. The server will + # guarantee that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request ID, + # the server can check if original operation with the same request ID was + # received, and if so, will ignore the second request. This prevents clients + # from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + class CreateStreamRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Message for updating a Stream. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # Required. Field mask is used to specify the fields to be overwritten in the + # Stream resource by the update. + # The fields specified in the update_mask are relative to the resource, not + # the full request. A field will be overwritten if it is in the mask. If the + # user does not provide a mask then all fields will be overwritten. + # @!attribute [rw] stream + # @return [::Google::Cloud::VisionAI::V1::Stream] + # Required. The resource being updated. + # @!attribute [rw] request_id + # @return [::String] + # Optional. An optional request ID to identify requests. Specify a unique + # request ID so that if you must retry your request, the server will know to + # ignore the request if it has already been completed. The server will + # guarantee that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request ID, + # the server can check if original operation with the same request ID was + # received, and if so, will ignore the second request. This prevents clients + # from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + class UpdateStreamRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Message for deleting a Stream. + # @!attribute [rw] name + # @return [::String] + # Required. Name of the resource. + # @!attribute [rw] request_id + # @return [::String] + # Optional. An optional request ID to identify requests. Specify a unique + # request ID so that if you must retry your request, the server will know to + # ignore the request if it has already been completed. The server will + # guarantee that for at least 60 minutes after the first request. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request ID, + # the server can check if original operation with the same request ID was + # received, and if so, will ignore the second request. This prevents clients + # from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + class DeleteStreamRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Message for getting the thumbnail of a Stream. + # @!attribute [rw] stream + # @return [::String] + # Required. The name of the stream for to get the thumbnail from. + # @!attribute [rw] gcs_object_name + # @return [::String] + # Required. The name of the GCS object to store the thumbnail image. + # @!attribute [rw] event + # @return [::String] + # Optional. The name of the event. If unspecified, the thumbnail will be + # retrieved from the latest event. + # @!attribute [rw] request_id + # @return [::String] + # Optional. An optional request ID to identify the requests. Specify a unique + # request ID so that if you must retry your request, the server will know to + # ignore the request if it has already been completed. The server will + # guarantee that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request ID, + # the server can check if original operation with the same request ID was + # received, and if so, will ignore the second request. This prevents clients + # from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + class GetStreamThumbnailRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Message for the response of GetStreamThumbnail. The empty response message + # indicates the thumbnail image has been uploaded to GCS successfully. + class GetStreamThumbnailResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for getting the auth token to access the stream HLS contents. + # @!attribute [rw] stream + # @return [::String] + # Required. The name of the stream. + class GenerateStreamHlsTokenRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for GenerateStreamHlsToken. + # @!attribute [rw] token + # @return [::String] + # The generated JWT token. + # + # The caller should insert this token to the authorization header of the HTTP + # requests to get the HLS playlist manifest and the video chunks. + # eg: curl -H "Authorization: Bearer $TOKEN" + # https://domain.com/test-stream.playback/master.m3u8 + # @!attribute [rw] expiration_time + # @return [::Google::Protobuf::Timestamp] + # The expiration time of the token. + class GenerateStreamHlsTokenResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Message for requesting list of Events. + # @!attribute [rw] parent + # @return [::String] + # Required. Parent value for ListEventsRequest. + # @!attribute [rw] page_size + # @return [::Integer] + # Requested page size. Server may return fewer items than requested. + # If unspecified, server will pick an appropriate default. + # @!attribute [rw] page_token + # @return [::String] + # A token identifying a page of results the server should return. + # @!attribute [rw] filter + # @return [::String] + # Filtering results. + # @!attribute [rw] order_by + # @return [::String] + # Hint for how to order the results. + class ListEventsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Message for response to listing Events. + # @!attribute [rw] events + # @return [::Array<::Google::Cloud::VisionAI::V1::Event>] + # The list of Event. + # @!attribute [rw] next_page_token + # @return [::String] + # A token identifying a page of results the server should return. + # @!attribute [rw] unreachable + # @return [::Array<::String>] + # Locations that could not be reached. + class ListEventsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Message for getting a Event. + # @!attribute [rw] name + # @return [::String] + # Required. Name of the resource. + class GetEventRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Message for creating a Event. + # @!attribute [rw] parent + # @return [::String] + # Required. Value for parent. + # @!attribute [rw] event_id + # @return [::String] + # Required. Id of the requesting object. + # @!attribute [rw] event + # @return [::Google::Cloud::VisionAI::V1::Event] + # Required. The resource being created. + # @!attribute [rw] request_id + # @return [::String] + # Optional. An optional request ID to identify requests. Specify a unique + # request ID so that if you must retry your request, the server will know to + # ignore the request if it has already been completed. The server will + # guarantee that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request ID, + # the server can check if original operation with the same request ID was + # received, and if so, will ignore the second request. This prevents clients + # from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + class CreateEventRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Message for updating a Event. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # Required. Field mask is used to specify the fields to be overwritten in the + # Event resource by the update. + # The fields specified in the update_mask are relative to the resource, not + # the full request. A field will be overwritten if it is in the mask. If the + # user does not provide a mask then all fields will be overwritten. + # @!attribute [rw] event + # @return [::Google::Cloud::VisionAI::V1::Event] + # Required. The resource being updated. + # @!attribute [rw] request_id + # @return [::String] + # Optional. An optional request ID to identify requests. Specify a unique + # request ID so that if you must retry your request, the server will know to + # ignore the request if it has already been completed. The server will + # guarantee that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request ID, + # the server can check if original operation with the same request ID was + # received, and if so, will ignore the second request. This prevents clients + # from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + class UpdateEventRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Message for deleting a Event. + # @!attribute [rw] name + # @return [::String] + # Required. Name of the resource. + # @!attribute [rw] request_id + # @return [::String] + # Optional. An optional request ID to identify requests. Specify a unique + # request ID so that if you must retry your request, the server will know to + # ignore the request if it has already been completed. The server will + # guarantee that for at least 60 minutes after the first request. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request ID, + # the server can check if original operation with the same request ID was + # received, and if so, will ignore the second request. This prevents clients + # from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + class DeleteEventRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Message for requesting list of Series. + # @!attribute [rw] parent + # @return [::String] + # Required. Parent value for ListSeriesRequest. + # @!attribute [rw] page_size + # @return [::Integer] + # Requested page size. Server may return fewer items than requested. + # If unspecified, server will pick an appropriate default. + # @!attribute [rw] page_token + # @return [::String] + # A token identifying a page of results the server should return. + # @!attribute [rw] filter + # @return [::String] + # Filtering results. + # @!attribute [rw] order_by + # @return [::String] + # Hint for how to order the results. + class ListSeriesRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Message for response to listing Series. + # @!attribute [rw] series + # @return [::Array<::Google::Cloud::VisionAI::V1::Series>] + # The list of Series. + # @!attribute [rw] next_page_token + # @return [::String] + # A token identifying a page of results the server should return. + # @!attribute [rw] unreachable + # @return [::Array<::String>] + # Locations that could not be reached. + class ListSeriesResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Message for getting a Series. + # @!attribute [rw] name + # @return [::String] + # Required. Name of the resource. + class GetSeriesRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Message for creating a Series. + # @!attribute [rw] parent + # @return [::String] + # Required. Value for parent. + # @!attribute [rw] series_id + # @return [::String] + # Required. Id of the requesting object. + # @!attribute [rw] series + # @return [::Google::Cloud::VisionAI::V1::Series] + # Required. The resource being created. + # @!attribute [rw] request_id + # @return [::String] + # Optional. An optional request ID to identify requests. Specify a unique + # request ID so that if you must retry your request, the server will know to + # ignore the request if it has already been completed. The server will + # guarantee that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request ID, + # the server can check if original operation with the same request ID was + # received, and if so, will ignore the second request. This prevents clients + # from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + class CreateSeriesRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Message for updating a Series. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # Required. Field mask is used to specify the fields to be overwritten in the + # Series resource by the update. The fields specified in the update_mask are + # relative to the resource, not the full request. A field will be overwritten + # if it is in the mask. If the user does not provide a mask then all fields + # will be overwritten. + # @!attribute [rw] series + # @return [::Google::Cloud::VisionAI::V1::Series] + # Required. The resource being updated + # @!attribute [rw] request_id + # @return [::String] + # Optional. An optional request ID to identify requests. Specify a unique + # request ID so that if you must retry your request, the server will know to + # ignore the request if it has already been completed. The server will + # guarantee that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request ID, + # the server can check if original operation with the same request ID was + # received, and if so, will ignore the second request. This prevents clients + # from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + class UpdateSeriesRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Message for deleting a Series. + # @!attribute [rw] name + # @return [::String] + # Required. Name of the resource. + # @!attribute [rw] request_id + # @return [::String] + # Optional. An optional request ID to identify requests. Specify a unique + # request ID so that if you must retry your request, the server will know to + # ignore the request if it has already been completed. The server will + # guarantee that for at least 60 minutes after the first request. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request ID, + # the server can check if original operation with the same request ID was + # received, and if so, will ignore the second request. This prevents clients + # from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + class DeleteSeriesRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Message for materializing a channel. + # @!attribute [rw] parent + # @return [::String] + # Required. Value for parent. + # @!attribute [rw] channel_id + # @return [::String] + # Required. Id of the channel. + # @!attribute [rw] channel + # @return [::Google::Cloud::VisionAI::V1::Channel] + # Required. The resource being created. + # @!attribute [rw] request_id + # @return [::String] + # Optional. An optional request ID to identify requests. Specify a unique + # request ID so that if you must retry your request, the server will know to + # ignore the request if it has already been completed. The server will + # guarantee that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request ID, + # the server can check if original operation with the same request ID was + # received, and if so, will ignore the second request. This prevents clients + # from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + class MaterializeChannelRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/proto_docs/google/cloud/visionai/v1/warehouse.rb b/owl-bot-staging/google-cloud-vision_ai-v1/proto_docs/google/cloud/visionai/v1/warehouse.rb new file mode 100644 index 000000000000..595a71637888 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/proto_docs/google/cloud/visionai/v1/warehouse.rb @@ -0,0 +1,3119 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 VisionAI + module V1 + # Request message for CreateAssetRequest. + # @!attribute [rw] parent + # @return [::String] + # Required. The parent resource where this asset will be created. + # Format: + # `projects/{project_number}/locations/{location_id}/corpora/{corpus_id}` + # @!attribute [rw] asset + # @return [::Google::Cloud::VisionAI::V1::Asset] + # Required. The asset to create. + # @!attribute [rw] asset_id + # @return [::String] + # Optional. The ID to use for the asset, which will become the final + # component of the asset's resource name if user choose to specify. + # Otherwise, asset id will be generated by system. + # + # This value should be up to 63 characters, and valid characters + # are /[a-z][0-9]-/. The first character must be a letter, the last could be + # a letter or a number. + class CreateAssetRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for GetAsset. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the asset to retrieve. + # Format: + # projects/\\{project_number}/locations/\\{location}/corpora/\\{corpus}/assets/\\{asset} + class GetAssetRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for ListAssets. + # @!attribute [rw] parent + # @return [::String] + # Required. The parent, which owns this collection of assets. + # Format: + # `projects/{project_number}/locations/{location}/corpora/{corpus}` + # @!attribute [rw] page_size + # @return [::Integer] + # The maximum number of assets to return. The service may return fewer than + # this value. + # If unspecified, at most 50 assets will be returned. + # The maximum value is 1000; values above 1000 will be coerced to 1000. + # @!attribute [rw] page_token + # @return [::String] + # A page token, received from a previous `ListAssets` call. + # Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to `ListAssets` must match + # the call that provided the page token. + # @!attribute [rw] filter + # @return [::String] + # The filter applied to the returned list. + # Only the following filterings are supported: + # "assets_with_contents = true", which returns assets with contents uploaded; + # "assets_with_contents = false", which returns assets without contents. + class ListAssetsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for ListAssets. + # @!attribute [rw] assets + # @return [::Array<::Google::Cloud::VisionAI::V1::Asset>] + # The assets from the specified corpus. + # @!attribute [rw] next_page_token + # @return [::String] + # A token, which can be sent as `page_token` to retrieve the next page. + # If this field is omitted, there are no subsequent pages. + class ListAssetsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for UpdateAsset. + # @!attribute [rw] asset + # @return [::Google::Cloud::VisionAI::V1::Asset] + # Required. The asset to update. + # + # The asset's `name` field is used to identify the asset to be updated. + # Format: + # `projects/{project_number}/locations/{location}/corpora/{corpus}/assets/{asset}` + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # The list of fields to be updated. + class UpdateAssetRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for DeleteAsset. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the asset to delete. + # Format: + # `projects/{project_number}/locations/{location}/corpora/{corpus}/assets/{asset}` + class DeleteAssetRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The source of the asset. + # @!attribute [rw] asset_gcs_source + # @return [::Google::Cloud::VisionAI::V1::AssetSource::AssetGcsSource] + # The source of the asset is from Cloud Storage. + # + # Note: The following fields are mutually exclusive: `asset_gcs_source`, `asset_content_data`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] asset_content_data + # @return [::Google::Cloud::VisionAI::V1::AssetSource::AssetContentData] + # The source of the asset is from content bytes. + # + # Note: The following fields are mutually exclusive: `asset_content_data`, `asset_gcs_source`. If a field in that set is populated, all other fields in the set will automatically be cleared. + class AssetSource + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The asset source is from Cloud Storage. + # @!attribute [rw] gcs_uri + # @return [::String] + # Cloud storage uri. + class AssetGcsSource + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The content of the asset. + # @!attribute [rw] asset_content_data + # @return [::String] + class AssetContentData + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Request message for UploadAsset. + # @!attribute [rw] name + # @return [::String] + # Required. The resource name of the asset to upload. + # Format: + # `projects/{project_number}/locations/{location_id}/corpora/{corpus_id}/assets/{asset_id}` + # @!attribute [rw] asset_source + # @return [::Google::Cloud::VisionAI::V1::AssetSource] + # The source of the asset. + class UploadAssetRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for UploadAsset. + class UploadAssetResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Metadata for UploadAsset. + # @!attribute [rw] start_time + # @return [::Google::Protobuf::Timestamp] + # The start time of the operation. + # @!attribute [rw] update_time + # @return [::Google::Protobuf::Timestamp] + # The update time of the operation. + class UploadAssetMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for GenerateRetrievalUrl API. + # @!attribute [rw] name + # @return [::String] + # Required. The resource name of the asset to request signed url for. + # Format: + # `projects/{project_number}/locations/{location_id}/corpora/{corpus_id}/assets/{asset_id}` + class GenerateRetrievalUrlRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for GenerateRetrievalUrl API. + # @!attribute [rw] signed_uri + # @return [::String] + # A signed url to download the content of the asset. + class GenerateRetrievalUrlResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # An asset is a resource in corpus. It represents a media object inside corpus, + # contains metadata and another resource annotation. Different feature could be + # applied to the asset to generate annotations. User could specified annotation + # related to the target asset. + # @!attribute [rw] name + # @return [::String] + # Resource name of the asset. + # Format: + # `projects/{project_number}/locations/{location_id}/corpora/{corpus_id}/assets/{asset_id}` + # @!attribute [rw] ttl + # @return [::Google::Protobuf::Duration] + # The duration for which all media assets, associated metadata, and search + # documents can exist. If not set, then it will using the default ttl in the + # parent corpus resource. + # @!attribute [r] asset_gcs_source + # @return [::Google::Cloud::VisionAI::V1::AssetSource::AssetGcsSource] + # Output only. The original cloud storage source uri that is associated with + # this asset. + class Asset + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for AnalyzeAsset. + # @!attribute [rw] name + # @return [::String] + # Required. The resource name of the asset to analyze. + # Format: + # `projects/{project_number}/locations/{location_id}/corpora/{corpus_id}/assets/{asset_id}` + class AnalyzeAssetRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Metadata for AnalyzeAsset. + # @!attribute [rw] analysis_status + # @return [::Array<::Google::Cloud::VisionAI::V1::AnalyzeAssetMetadata::AnalysisStatus>] + # The status of analysis on all search capabilities. + # @!attribute [rw] start_time + # @return [::Google::Protobuf::Timestamp] + # The start time of the operation. + # @!attribute [rw] update_time + # @return [::Google::Protobuf::Timestamp] + # The update time of the operation. + class AnalyzeAssetMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The status of analysis on each search capability. + # @!attribute [rw] state + # @return [::Google::Cloud::VisionAI::V1::AnalyzeAssetMetadata::AnalysisStatus::State] + # @!attribute [rw] status_message + # @return [::String] + # @!attribute [rw] search_capability + # @return [::Google::Cloud::VisionAI::V1::SearchCapability] + # The search capability requested. + class AnalysisStatus + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The state of the search capability. + module State + # The default process state should never happen. + STATE_UNSPECIFIED = 0 + + # The ml model analysis is in progress. + IN_PROGRESS = 1 + + # The ml model analysis is successfully done. + SUCCEEDED = 2 + + # The ml model analysis failed. + FAILED = 3 + end + end + end + + # Response message for AnalyzeAsset. + class AnalyzeAssetResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The status of indexing for the asset. + # @!attribute [r] state + # @return [::Google::Cloud::VisionAI::V1::IndexingStatus::State] + # Output only. State of this asset's indexing. + # @!attribute [rw] status_message + # @return [::String] + # Detailed message describing the state. + class IndexingStatus + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # State enum for this asset's indexing. + module State + # The default process state should never happen. + STATE_UNSPECIFIED = 0 + + # The indexing is in progress. + IN_PROGRESS = 1 + + # The process is successfully done. + SUCCEEDED = 2 + + # The process failed. + FAILED = 3 + end + end + + # Request message for IndexAsset. + # @!attribute [rw] name + # @return [::String] + # Required. The resource name of the asset to index. + # Format: + # `projects/{project_number}/locations/{location_id}/corpora/{corpus_id}/assets/{asset_id}` + # @!attribute [rw] index + # @return [::String] + # Optional. The name of the index. + # Format: + # `projects/{project_number}/locations/{location}/corpora/{corpus}/indexes/{index}` + class IndexAssetRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Metadata for IndexAsset. + # @!attribute [rw] status + # @return [::Google::Cloud::VisionAI::V1::IndexingStatus] + # The status of indexing this asset. + # @!attribute [rw] start_time + # @return [::Google::Protobuf::Timestamp] + # The start time of the operation. + # @!attribute [rw] update_time + # @return [::Google::Protobuf::Timestamp] + # The update time of the operation. + class IndexAssetMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for IndexAsset. + class IndexAssetResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for RemoveIndexAsset. + # @!attribute [rw] name + # @return [::String] + # Required. The resource name of the asset to index. + # Format: + # `projects/{project_number}/locations/{location_id}/corpora/{corpus_id}/assets/{asset_id}` + # @!attribute [rw] index + # @return [::String] + # Optional. The name of the index. + # Format: + # `projects/{project_number}/locations/{location}/corpora/{corpus}/indexes/{index}` + class RemoveIndexAssetRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Metadata for RemoveIndexAsset. + # @!attribute [rw] indexing_status + # @return [::Google::Cloud::VisionAI::V1::IndexingStatus] + # The status of indexing this asset. + # @!attribute [rw] start_time + # @return [::Google::Protobuf::Timestamp] + # The start time of the operation. + # @!attribute [rw] update_time + # @return [::Google::Protobuf::Timestamp] + # The update time of the operation. + class RemoveIndexAssetMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for RemoveIndexAsset. + class RemoveIndexAssetResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # An IndexedAsset is an asset that the index is built upon. + # @!attribute [rw] index + # @return [::String] + # Required. The index that this indexed asset belongs to. + # Format: + # `projects/{project_number}/locations/{location}/corpora/{corpus}/indexes/{index}` + # @!attribute [rw] asset + # @return [::String] + # Required. The resource name of the asset. + # Format: + # `projects/{project_number}/locations/{location_id}/corpora/{corpus_id}/assets/{asset_id}` + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The create timestamp. + # @!attribute [r] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The update timestamp. + class IndexedAsset + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for ViewIndexedAssets. + # @!attribute [rw] index + # @return [::String] + # Required. The index that owns this collection of assets. + # Format: + # `projects/{project_number}/locations/{location}/corpora/{corpus}/indexes/{index}` + # @!attribute [rw] page_size + # @return [::Integer] + # The maximum number of assets to return. The service may return fewer than + # this value. + # If unspecified, at most 50 assets will be returned. + # The maximum value is 1000; values above 1000 will be coerced to 1000. + # @!attribute [rw] page_token + # @return [::String] + # A page token, received from a previous `ViewIndexedAssets` call. + # Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to `ViewIndexedAssets` must + # match the call that provided the page token. + # @!attribute [rw] filter + # @return [::String] + # The filter applied to the returned list. + # Only the following filterings are supported: + # "asset_id = xxxx", which returns asset with specified id. + # "asset_id = xxxx, yyyy, zzzz", which returns assets with specified ids. + class ViewIndexedAssetsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for ViewIndexedAssets. + # @!attribute [rw] indexed_assets + # @return [::Array<::Google::Cloud::VisionAI::V1::IndexedAsset>] + # The assets from the specified index. + # @!attribute [rw] next_page_token + # @return [::String] + # A token, which can be sent as `page_token` to retrieve the next page. + # If this field is omitted, there are no subsequent pages. + class ViewIndexedAssetsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message of CreateCorpus API. + # @!attribute [rw] parent + # @return [::String] + # Required. Form: `projects/{project_number}/locations/{location_id}` + # @!attribute [rw] corpus + # @return [::Google::Cloud::VisionAI::V1::Corpus] + # Required. The corpus to be created. + class CreateCorpusRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Metadata for CreateCorpus API. + # @!attribute [rw] create_time + # @return [::Google::Protobuf::Timestamp] + # The create time of the create corpus operation. + # @!attribute [rw] update_time + # @return [::Google::Protobuf::Timestamp] + # The update time of the create corpus operation. + class CreateCorpusMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The capability and metadata of search capability. + # @!attribute [rw] type + # @return [::Google::Cloud::VisionAI::V1::SearchCapability::Type] + # The search capability to enable. + class SearchCapability + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Capability to perform different search on assets. + module Type + # Unspecified search capability, should never be used. + TYPE_UNSPECIFIED = 0 + + # Embedding search. + EMBEDDING_SEARCH = 1 + end + end + + # Setting for search capability to enable. + # @!attribute [rw] search_capabilities + # @return [::Array<::Google::Cloud::VisionAI::V1::SearchCapability>] + # The metadata of search capability to enable. + class SearchCapabilitySetting + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Metadata message for CreateCollectionRequest + # @!attribute [rw] operation_metadata + # @return [::Google::Cloud::VisionAI::V1::OperationMetadata] + # Common metadata of the long-running operation. + class CreateCollectionMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for CreateCollection. + # @!attribute [rw] parent + # @return [::String] + # Required. The parent resource where this collection will be created. + # Format: `projects/{project_number}/locations/{location}/corpora/{corpus}` + # @!attribute [rw] collection + # @return [::Google::Cloud::VisionAI::V1::Collection] + # Required. The collection resource to be created. + # @!attribute [rw] collection_id + # @return [::String] + # Optional. The ID to use for the collection, which will become the final + # component of the resource name if user choose to specify. Otherwise, + # collection id will be generated by system. + # + # This value should be up to 55 characters, and valid characters + # are /[a-z][0-9]-/. The first character must be a letter, the last could be + # a letter or a number. + class CreateCollectionRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Metadata message for DeleteCollectionRequest + # @!attribute [rw] operation_metadata + # @return [::Google::Cloud::VisionAI::V1::OperationMetadata] + # Common metadata of the long-running operation. + class DeleteCollectionMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for DeleteCollectionRequest. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the collection to delete. Format: + # `projects/{project_number}/locations/{location}/corpora/{corpus}/collections/{collection}` + class DeleteCollectionRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for GetCollectionRequest. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the collection to retrieve. Format: + # `projects/{project_number}/locations/{location}/corpora/{corpus}/collections/{collection}` + class GetCollectionRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for UpdateCollectionRequest. + # @!attribute [rw] collection + # @return [::Google::Cloud::VisionAI::V1::Collection] + # Required. The collection to update. + # + # The collection's `name` field is used to identify the collection to be + # updated. Format: + # `projects/{project_number}/locations/{location}/corpora/{corpus}/collections/{collection}` + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # The list of fields to be updated. + # - Unset `update_mask` or set `update_mask` to be a single "*" only will + # update all updatable fields with the value provided in `collection`. + # - To update `display_name` value to empty string, set it in the + # `collection` + # to empty string, and set `update_mask` with "display_name". Same applies + # to other updatable string fields in the `collection`. + class UpdateCollectionRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for ListCollections. + # @!attribute [rw] parent + # @return [::String] + # Required. The parent corpus. Format: + # `projects/{project_number}/locations/{location}/corpora/{corpus}` + # @!attribute [rw] page_size + # @return [::Integer] + # The maximum number of collections to return. The service may return fewer + # than this value. If unspecified, at most 50 collections will be returned. + # The maximum value is 1000; values above 1000 will be coerced to 1000. + # @!attribute [rw] page_token + # @return [::String] + # A page token, received from a previous `ListCollectionsRequest` call. + # Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to `ListCollectionsRequest` + # must match the call that provided the page token. + class ListCollectionsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for ListCollections. + # @!attribute [rw] collections + # @return [::Array<::Google::Cloud::VisionAI::V1::Collection>] + # The collections from the specified corpus. + # @!attribute [rw] next_page_token + # @return [::String] + # A token, which can be sent as `page_token` to retrieve the next page. + # If this field is omitted, there are no subsequent pages. + class ListCollectionsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for AddCollectionItem. + # @!attribute [rw] item + # @return [::Google::Cloud::VisionAI::V1::CollectionItem] + # Required. The item to be added. + class AddCollectionItemRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for AddCollectionItem. + # @!attribute [rw] item + # @return [::Google::Cloud::VisionAI::V1::CollectionItem] + # The item that has already been added. + class AddCollectionItemResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for RemoveCollectionItem. + # @!attribute [rw] item + # @return [::Google::Cloud::VisionAI::V1::CollectionItem] + # Required. The item to be removed. + class RemoveCollectionItemRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for RemoveCollectionItem. + # @!attribute [rw] item + # @return [::Google::Cloud::VisionAI::V1::CollectionItem] + # The item that has already been removed. + class RemoveCollectionItemResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for ViewCollectionItems. + # @!attribute [rw] collection + # @return [::String] + # Required. The collection to view. Format: + # `projects/{project_number}/locations/{location}/corpora/{corpus}/collections/{collection}` + # @!attribute [rw] page_size + # @return [::Integer] + # The maximum number of collections to return. The service may return fewer + # than this value. If unspecified, at most 50 collections will be returned. + # The maximum value is 1000; values above 1000 will be coerced to 1000. + # @!attribute [rw] page_token + # @return [::String] + # A page token, received from a previous `ViewCollectionItemsRequest` call. + # Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to + # `ViewCollectionItemsRequest` must match the call that provided the page + # token. + class ViewCollectionItemsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for ViewCollectionItems. + # @!attribute [rw] items + # @return [::Array<::Google::Cloud::VisionAI::V1::CollectionItem>] + # The items from the specified collection. + # @!attribute [rw] next_page_token + # @return [::String] + # A token, which can be sent as `page_token` to retrieve the next page. + # If this field is omitted, there are no subsequent pages. + class ViewCollectionItemsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A collection is a resource in a corpus. It serves as a container of + # references to original resources. + # @!attribute [r] name + # @return [::String] + # Output only. Resource name of the collection. Format: + # `projects/{project_number}/locations/{location}/corpora/{corpus}/collections/{collection}` + # @!attribute [rw] display_name + # @return [::String] + # Optional. The collection name for displaying. + # The name can be up to 256 characters long. + # @!attribute [rw] description + # @return [::String] + # Optional. Description of the collection. Can be up to 25000 characters + # long. + class Collection + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A CollectionItem is an item in a collection. + # Each item is a reference to the original resource in a collection. + # @!attribute [rw] collection + # @return [::String] + # Required. The collection name that this item belongs to. Format: + # `projects/{project_number}/locations/{location}/corpora/{corpus}/collections/{collection}` + # @!attribute [rw] type + # @return [::Google::Cloud::VisionAI::V1::CollectionItem::Type] + # Required. The type of item. + # @!attribute [rw] item_resource + # @return [::String] + # Required. The name of the CollectionItem. Its format depends on the `type` + # above. For ASSET: + # `projects/{project_number}/locations/{location}/corpora/{corpus}/assets/{asset}` + class CollectionItem + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # CollectionItem types. + module Type + # The default type of item should never happen. + TYPE_UNSPECIFIED = 0 + + # Asset type item. + ASSET = 1 + end + end + + # Message for creating an Index. + # @!attribute [rw] parent + # @return [::String] + # Required. Value for the parent. The resource name of the Corpus under which + # this index is created. Format: + # `projects/{project_number}/locations/{location_id}/corpora/{corpus_id}` + # @!attribute [rw] index_id + # @return [::String] + # Optional. The ID for the index. This will become the final resource name + # for the index. If the user does not specify this value, it will be + # generated by system. + # + # This value should be up to 63 characters, and valid characters + # are /[a-z][0-9]-/. The first character must be a letter, the last could be + # a letter or a number. + # @!attribute [rw] index + # @return [::Google::Cloud::VisionAI::V1::Index] + # Required. The index being created. + class CreateIndexRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Metadata message for CreateIndexRequest + # @!attribute [rw] operation_metadata + # @return [::Google::Cloud::VisionAI::V1::OperationMetadata] + # Common metadata of the long-running operation. + class CreateIndexMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for UpdateIndex. + # @!attribute [rw] index + # @return [::Google::Cloud::VisionAI::V1::Index] + # Required. The resource being updated. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # Required. Field mask is used to specify the fields to be overwritten in the + # Index resource by the update. The fields specified in the update_mask are + # relative to the resource, not the full request. A field of the resource + # will be overwritten if it is in the mask. Empty field mask is not allowed. + # If the mask is "*", it triggers a full update of the index, and also a + # whole rebuild of index data. + class UpdateIndexRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Metadata message for UpdateIndexRequest + # @!attribute [rw] operation_metadata + # @return [::Google::Cloud::VisionAI::V1::OperationMetadata] + # Common metadata of the long-running operation. + class UpdateIndexMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for getting an Index. + # @!attribute [rw] name + # @return [::String] + # Required. Name of the Index resource. + # Format: + # `projects/{project_number}/locations/{location}/corpora/{corpus}/indexes/{index}` + class GetIndexRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for listing Indexes. + # @!attribute [rw] parent + # @return [::String] + # Required. The parent corpus that owns this collection of indexes. + # Format: + # `projects/{project_number}/locations/{location}/corpora/{corpus}` + # @!attribute [rw] page_size + # @return [::Integer] + # The maximum number of indexes to return. The service may return fewer than + # this value. + # If unspecified, at most 50 indexes will be returned. + # The maximum value is 1000; values above 1000 will be coerced to 1000. + # @!attribute [rw] page_token + # @return [::String] + # A page token, received from a previous `ListIndexes` call. + # Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to `ListIndexes` must match + # the call that provided the page token. + class ListIndexesRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for ListIndexes. + # @!attribute [rw] indexes + # @return [::Array<::Google::Cloud::VisionAI::V1::Index>] + # The indexes under the specified corpus. + # @!attribute [rw] next_page_token + # @return [::String] + # A token, which can be sent as `page_token` to retrieve the next page. + # If this field is omitted, there are no subsequent pages. + class ListIndexesResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for DeleteIndex. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the index to delete. + # Format: + # `projects/{project_number}/locations/{location}/corpora/{corpus}/indexes/{index}` + class DeleteIndexRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Metadata message for DeleteIndexRequest + class DeleteIndexMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # An Index is a resource in Corpus. It contains an indexed version of the + # assets and annotations. When deployed to an endpoint, it will allow users to + # search the Index. + # @!attribute [rw] entire_corpus + # @return [::Boolean] + # Include all assets under the corpus. + # @!attribute [r] name + # @return [::String] + # Output only. Resource name of the Index resource. + # Format: + # `projects/{project_number}/locations/{location_id}/corpora/{corpus_id}/indexes/{index_id}` + # @!attribute [rw] display_name + # @return [::String] + # Optional. Optional user-specified display name of the index. + # @!attribute [rw] description + # @return [::String] + # Optional. Optional description of the index. + # @!attribute [r] state + # @return [::Google::Cloud::VisionAI::V1::Index::State] + # Output only. State of the index. + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The create timestamp. + # @!attribute [r] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The update timestamp. + # @!attribute [r] deployed_indexes + # @return [::Array<::Google::Cloud::VisionAI::V1::DeployedIndexReference>] + # Output only. References to the deployed index instance. + # Index of VIDEO_ON_DEMAND corpus can have at most one deployed index. + # Index of IMAGE corpus can have multiple deployed indexes. + # @!attribute [r] satisfies_pzs + # @return [::Boolean] + # Output only. This boolean field is only set for projects that have Physical + # Zone Separation enabled via an Org Policy constraint. It is set to true + # when the index is a valid zone separated index and false if it isn't. + # @!attribute [r] satisfies_pzi + # @return [::Boolean] + # Output only. This boolean field is only set for projects that have Physical + # Zone Isolation enabled via an Org Policy constraint. It is set to true when + # the index is a valid zone isolated index and false if it isn't. + class Index + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Enum representing the different states through which an Index might cycle + # during its lifetime. + module State + # The default value. Should not be used. + STATE_UNSPECIFIED = 0 + + # State CREATING. + CREATING = 1 + + # State CREATED. + CREATED = 2 + + # State UPDATING. + UPDATING = 3 + end + end + + # Points to a DeployedIndex. + # @!attribute [rw] index_endpoint + # @return [::String] + # Immutable. A resource name of the IndexEndpoint. + class DeployedIndexReference + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Corpus is a set of media contents for management. + # Within a corpus, media shares the same data schema. Search is also restricted + # within a single corpus. + # @!attribute [rw] name + # @return [::String] + # Resource name of the corpus. + # Format: + # `projects/{project_number}/locations/{location_id}/corpora/{corpus_id}` + # @!attribute [rw] display_name + # @return [::String] + # Required. The corpus name to shown in the UI. The name can be up to 32 + # characters long. + # @!attribute [rw] description + # @return [::String] + # Optional. Description of the corpus. Can be up to 25000 characters long. + # @!attribute [rw] default_ttl + # @return [::Google::Protobuf::Duration] + # Optional. The default TTL value for all assets under the corpus without a + # asset level user-defined TTL. For STREAM_VIDEO type corpora, this is + # required and the maximum allowed + # default_ttl is 10 years. + # @!attribute [rw] type + # @return [::Google::Cloud::VisionAI::V1::Corpus::Type] + # Optional. Type of the asset inside corpus. + # @!attribute [rw] search_capability_setting + # @return [::Google::Cloud::VisionAI::V1::SearchCapabilitySetting] + # Default search capability setting on corpus level. + # @!attribute [r] satisfies_pzs + # @return [::Boolean] + # Output only. This boolean field is only set for projects that have Physical + # Zone Separation enabled via an Org Policy constraint. It is set to true + # when the corpus is a valid zone separated corpus and false if it isn't. + # @!attribute [r] satisfies_pzi + # @return [::Boolean] + # Output only. This boolean field is only set for projects that have Physical + # Zone Isolation enabled via an Org Policy constraint. It is set to true when + # the corpus is a valid zone isolated corpus and false if it isn't. + class Corpus + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Type of the asset inside the corpus. + module Type + # The default type, not supposed to be used. If this default type is used, + # the corpus will be created as STREAM_VIDEO corpus. + TYPE_UNSPECIFIED = 0 + + # Asset is a live streaming video. + STREAM_VIDEO = 1 + + # Asset is an image. + IMAGE = 2 + + # Asset is a batch video. + VIDEO_ON_DEMAND = 3 + end + end + + # Request message for GetCorpus. + # @!attribute [rw] name + # @return [::String] + # Required. The resource name of the corpus to retrieve. + class GetCorpusRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for UpdateCorpus. + # @!attribute [rw] corpus + # @return [::Google::Cloud::VisionAI::V1::Corpus] + # Required. The corpus which replaces the resource on the server. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # The list of fields to be updated. + class UpdateCorpusRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for ListCorpora. + # @!attribute [rw] parent + # @return [::String] + # Required. The resource name of the project from which to list corpora. + # @!attribute [rw] page_size + # @return [::Integer] + # Requested page size. API may return fewer results than requested. + # If negative, INVALID_ARGUMENT error will be returned. + # If unspecified or 0, API will pick a default size, which is 10. + # If the requested page size is larger than the maximum size, API will pick + # use the maximum size, which is 20. + # @!attribute [rw] page_token + # @return [::String] + # A token identifying a page of results for the server to return. + # Typically obtained via + # {::Google::Cloud::VisionAI::V1::ListCorporaResponse#next_page_token ListCorporaResponse.next_page_token} + # of the previous + # {::Google::Cloud::VisionAI::V1::Warehouse::Client#list_corpora Warehouse.ListCorpora} + # call. + # @!attribute [rw] filter + # @return [::String] + # The filter applied to the returned corpora list. + # Only the following restrictions are supported: + # `type=`, + # `type!=`. + class ListCorporaRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for ListCorpora. + # @!attribute [rw] corpora + # @return [::Array<::Google::Cloud::VisionAI::V1::Corpus>] + # The corpora in the project. + # @!attribute [rw] next_page_token + # @return [::String] + # A token to retrieve next page of results. + # Pass to + # {::Google::Cloud::VisionAI::V1::ListCorporaRequest#page_token ListCorporaRequest.page_token} + # to obtain that page. + class ListCorporaResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for DeleteCorpus. + # @!attribute [rw] name + # @return [::String] + # Required. The resource name of the corpus to delete. + class DeleteCorpusRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for AnalyzeCorpus. + # @!attribute [rw] name + # @return [::String] + # Required. The parent corpus resource where the assets will be analyzed. + # Format: + # `projects/{project_number}/locations/{location_id}/corpora/{corpus_id}` + class AnalyzeCorpusRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The metadata message for AnalyzeCorpus LRO. + # @!attribute [rw] metadata + # @return [::Google::Cloud::VisionAI::V1::OperationMetadata] + # The metadata of the operation. + class AnalyzeCorpusMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The response message for AnalyzeCorpus LRO. + class AnalyzeCorpusResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for CreateDataSchema. + # @!attribute [rw] parent + # @return [::String] + # Required. The parent resource where this data schema will be created. + # Format: + # `projects/{project_number}/locations/{location_id}/corpora/{corpus_id}` + # @!attribute [rw] data_schema + # @return [::Google::Cloud::VisionAI::V1::DataSchema] + # Required. The data schema to create. + class CreateDataSchemaRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Data schema indicates how the user specified annotation is interpreted in the + # system. + # @!attribute [rw] name + # @return [::String] + # Resource name of the data schema in the form of: + # `projects/{project_number}/locations/{location}/corpora/{corpus}/dataSchemas/{data_schema}` + # where \\{data_schema} part should be the same as the `key` field below. + # @!attribute [rw] key + # @return [::String] + # Required. The key of this data schema. This key should be matching the key + # of user specified annotation and unique inside corpus. This value can be up + # to 63 characters, and valid characters are /[a-z][0-9]-/. The first + # character must be a letter, the last could be a letter or a number. + # @!attribute [rw] schema_details + # @return [::Google::Cloud::VisionAI::V1::DataSchemaDetails] + # The schema details mapping to the key. + class DataSchema + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Data schema details indicates the data type and the data struct corresponding + # to the key of user specified annotation. + # @!attribute [rw] type + # @return [::Google::Cloud::VisionAI::V1::DataSchemaDetails::DataType] + # Type of the annotation. + # @!attribute [rw] proto_any_config + # @return [::Google::Cloud::VisionAI::V1::DataSchemaDetails::ProtoAnyConfig] + # Config for protobuf any type. + # @!attribute [rw] list_config + # @return [::Google::Cloud::VisionAI::V1::DataSchemaDetails::ListConfig] + # Config for List data type. + # @!attribute [rw] customized_struct_config + # @return [::Google::Cloud::VisionAI::V1::DataSchemaDetails::CustomizedStructConfig] + # Config for CustomizedStruct data type. + # @!attribute [rw] granularity + # @return [::Google::Cloud::VisionAI::V1::DataSchemaDetails::Granularity] + # The granularity associated with this DataSchema. + # @!attribute [rw] search_strategy + # @return [::Google::Cloud::VisionAI::V1::DataSchemaDetails::SearchStrategy] + # The search strategy to be applied on the `key` above. + class DataSchemaDetails + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The configuration for `PROTO_ANY` data type. + # @!attribute [rw] type_uri + # @return [::String] + # The type URI of the proto message. + class ProtoAnyConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The configuration for `LIST` data type. + # @!attribute [rw] value_schema + # @return [::Google::Cloud::VisionAI::V1::DataSchemaDetails] + # The value's data schema in the list. + class ListConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The configuration for `CUSTOMIZED_STRUCT` data type. + # @!attribute [rw] field_schemas + # @return [::Google::Protobuf::Map{::String => ::Google::Cloud::VisionAI::V1::DataSchemaDetails}] + # Direct child elements data schemas. + class CustomizedStructConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::Google::Cloud::VisionAI::V1::DataSchemaDetails] + class FieldSchemasEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # The search strategy for annotations value of the `key`. + # @!attribute [rw] search_strategy_type + # @return [::Google::Cloud::VisionAI::V1::DataSchemaDetails::SearchStrategy::SearchStrategyType] + # The type of search strategy to be applied on the `key` above. + # The allowed `search_strategy_type` is different for different data types, + # which is documented in the DataSchemaDetails.DataType. Specifying + # unsupported `search_strategy_type` for data types will result in + # INVALID_ARGUMENT error. + # @!attribute [rw] confidence_score_index_config + # @return [::Google::Cloud::VisionAI::V1::DataSchemaDetails::SearchStrategy::ConfidenceScoreIndexConfig] + # Optional. Configs the path to the confidence score, and the threshold. + # Only if the score is greater than the threshold, current field will be + # built into the index. Only applies to leaf nodes using EXACT_SEARCH or + # SMART_SEARCH. + class SearchStrategy + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Filter on the confidence score. Only adds to index if the confidence + # score is higher than the threshold. + # Example data schema: + # key: "name-confidence-pair" + # type: CUSTOMIZED_STRUCT + # granularity: GRANULARITY_PARTITION_LEVEL + # customized_struct_config { + # field_schemas { + # key: "name" + # type: STRING + # granularity: GRANULARITY_PARTITION_LEVEL + # search_strategy { + # search_strategy_type: SMART_SEARCH + # confidence_score_index_config { + # field_path: "name-confidence-pair.score" + # threshold: 0.6 + # } + # } + # } + # field_schemas { + # key: "score" + # type: FLOAT + # granularity: GRANULARITY_PARTITION_LEVEL + # } + # } + # This means only "name" with score > 0.6 will be indexed. + # @!attribute [rw] field_path + # @return [::String] + # Required. The path to the confidence score field. It is a string that + # concatenates all the data schema keys along the path. See the example + # above. If the data schema contains LIST, use '_ENTRIES' to concatenate. + # Example data schema contains a list: + # "key": "list-name-score", + # "schemaDetails": { + # "type": "LIST", + # "granularity": "GRANULARITY_PARTITION_LEVEL", + # "listConfig": { + # "valueSchema": { + # "type": "CUSTOMIZED_STRUCT", + # "granularity": "GRANULARITY_PARTITION_LEVEL", + # "customizedStructConfig": { + # "fieldSchemas": { + # "name": { + # "type": "STRING", + # "granularity": "GRANULARITY_PARTITION_LEVEL", + # "searchStrategy": { + # "searchStrategyType": "SMART_SEARCH" + # "confidence_score_index_config": { + # "field_path": "list-name-score._ENTRIES.score", + # "threshold": "0.9", + # } + # } + # }, + # "score": { + # "type": "FLOAT", + # "granularity": "GRANULARITY_PARTITION_LEVEL", + # } + # } + # } + # } + # } + # } + # @!attribute [rw] threshold + # @return [::Float] + # Required. The threshold. + class ConfidenceScoreIndexConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The types of search strategies to be applied on the annotation key. + module SearchStrategyType + # Annotatation values of the `key` above will not be searchable. + NO_SEARCH = 0 + + # When searching with `key`, the value must be exactly as the annotation + # value that has been ingested. + EXACT_SEARCH = 1 + + # When searching with `key`, Warehouse will perform broad search based on + # semantic of the annotation value. + SMART_SEARCH = 2 + end + end + + # Data type of the annotation. + module DataType + # Unspecified type. + DATA_TYPE_UNSPECIFIED = 0 + + # Integer type. + # Allowed search strategies: + # - DataSchema.SearchStrategy.NO_SEARCH, + # - DataSchema.SearchStrategy.EXACT_SEARCH. + # Supports query by IntRangeArray. + INTEGER = 1 + + # Float type. + # Allowed search strategies: + # - DataSchema.SearchStrategy.NO_SEARCH, + # - DataSchema.SearchStrategy.EXACT_SEARCH. + # Supports query by FloatRangeArray. + FLOAT = 2 + + # String type. + # Allowed search strategies: + # - DataSchema.SearchStrategy.NO_SEARCH, + # - DataSchema.SearchStrategy.EXACT_SEARCH, + # - DataSchema.SearchStrategy.SMART_SEARCH. + STRING = 3 + + # Supported formats: + # %Y-%m-%dT%H:%M:%E*S%E*z (absl::RFC3339_full) + # %Y-%m-%dT%H:%M:%E*S + # %Y-%m-%dT%H:%M%E*z + # %Y-%m-%dT%H:%M + # %Y-%m-%dT%H%E*z + # %Y-%m-%dT%H + # %Y-%m-%d%E*z + # %Y-%m-%d + # %Y-%m + # %Y + # Allowed search strategies: + # - DataSchema.SearchStrategy.NO_SEARCH, + # - DataSchema.SearchStrategy.EXACT_SEARCH. + # Supports query by DateTimeRangeArray. + DATETIME = 5 + + # Geo coordinate type. + # Allowed search strategies: + # - DataSchema.SearchStrategy.NO_SEARCH, + # - DataSchema.SearchStrategy.EXACT_SEARCH. + # Supports query by GeoLocationArray. + GEO_COORDINATE = 7 + + # Type to pass any proto as available in annotations.proto. Only use + # internally. + # Available proto types and its corresponding search behavior: + # - ImageObjectDetectionPredictionResult, allows SMART_SEARCH on + # display_names and NO_SEARCH. + # - ClassificationPredictionResult, allows SMART_SEARCH on display_names + # and NO_SEARCH. + # - ImageSegmentationPredictionResult, allows NO_SEARCH. + # - VideoActionRecognitionPredictionResult, allows SMART_SEARCH on + # display_name and NO_SEARCH. + # - VideoObjectTrackingPredictionResult, allows SMART_SEARCH on + # display_name and NO_SEARCH. + # - VideoClassificationPredictionResult, allows SMART_SEARCH on + # display_name and NO_SEARCH. + # - OccupancyCountingPredictionResult, allows EXACT_SEARCH on + # stats.full_frame_count.count and NO_SEARCH. + # - ObjectDetectionPredictionResult, allows SMART_SEARCH on + # identified_boxes.entity.label_string and NO_SEARCH. + PROTO_ANY = 8 + + # Boolean type. + # Allowed search strategies: + # - DataSchema.SearchStrategy.NO_SEARCH, + # - DataSchema.SearchStrategy.EXACT_SEARCH. + BOOLEAN = 9 + + # List type. + # - Each element in the list must be of the exact same data schema; + # otherwise, they are invalid arguments. + # - List level cannot set search strategy. Leaf node level can do. + # - Elements cannot be another list (no list of list). + # - Elements can be CUSTOMIZED_STRUCT, and max number of layers is 10. + LIST = 10 + + # Struct type. + # - SearchStrategy: + # * Data Schema that's CUSTOMIZED_STRUCT cannot set search strategy. + # * Leaf-node elements allow setting search strategy based on element's + # SearchStrategy restriction. + # - Nested layer restrictions: + # * Data Schema that's CUSTOMIZED_STRUCT allows its fields to be of + # CUSTOMIZED_STRUCT as well, but the overall layers restriction is 10. + CUSTOMIZED_STRUCT = 6 + end + + # The granularity of annotations under this DataSchema. + module Granularity + # Unspecified granularity. + GRANULARITY_UNSPECIFIED = 0 + + # Asset-level granularity (annotations must not contain partition info). + GRANULARITY_ASSET_LEVEL = 1 + + # Partition-level granularity (annotations must contain partition info). + GRANULARITY_PARTITION_LEVEL = 2 + end + end + + # Request message for UpdateDataSchema. + # @!attribute [rw] data_schema + # @return [::Google::Cloud::VisionAI::V1::DataSchema] + # Required. The data schema's `name` field is used to identify the data + # schema to be updated. Format: + # `projects/{project_number}/locations/{location}/corpora/{corpus}/dataSchemas/{data_schema}` + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # The list of fields to be updated. + class UpdateDataSchemaRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for GetDataSchema. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the data schema to retrieve. + # Format: + # `projects/{project_number}/locations/{location_id}/corpora/{corpus_id}/dataSchemas/{data_schema_id}` + class GetDataSchemaRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for DeleteDataSchema. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the data schema to delete. + # Format: + # `projects/{project_number}/locations/{location_id}/corpora/{corpus_id}/dataSchemas/{data_schema_id}` + class DeleteDataSchemaRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for ListDataSchemas. + # @!attribute [rw] parent + # @return [::String] + # Required. The parent, which owns this collection of data schemas. + # Format: + # `projects/{project_number}/locations/{location_id}/corpora/{corpus_id}` + # @!attribute [rw] page_size + # @return [::Integer] + # The maximum number of data schemas to return. The service may return fewer + # than this value. If unspecified, at most 50 data schemas will be returned. + # The maximum value is 1000; values above 1000 will be coerced to 1000. + # @!attribute [rw] page_token + # @return [::String] + # A page token, received from a previous `ListDataSchemas` call. + # Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to `ListDataSchemas` must + # match the call that provided the page token. + class ListDataSchemasRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for ListDataSchemas. + # @!attribute [rw] data_schemas + # @return [::Array<::Google::Cloud::VisionAI::V1::DataSchema>] + # The data schemas from the specified corpus. + # @!attribute [rw] next_page_token + # @return [::String] + # A token, which can be sent as `page_token` to retrieve the next page. + # If this field is omitted, there are no subsequent pages. + class ListDataSchemasResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for CreateAnnotation. + # @!attribute [rw] parent + # @return [::String] + # Required. The parent resource where this annotation will be created. + # Format: + # `projects/{project_number}/locations/{location_id}/corpora/{corpus_id}/assets/{asset_id}` + # @!attribute [rw] annotation + # @return [::Google::Cloud::VisionAI::V1::Annotation] + # Required. The annotation to create. + # @!attribute [rw] annotation_id + # @return [::String] + # Optional. The ID to use for the annotation, which will become the final + # component of the annotation's resource name if user choose to specify. + # Otherwise, annotation id will be generated by system. + # + # This value should be up to 63 characters, and valid characters + # are /[a-z][0-9]-/. The first character must be a letter, the last could be + # a letter or a number. + class CreateAnnotationRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # An annotation is a resource in asset. It represents a key-value mapping of + # content in asset. + # @!attribute [rw] name + # @return [::String] + # Resource name of the annotation. + # Format: + # `projects/{project_number}/locations/{location}/corpora/{corpus}/assets/{asset}/annotations/{annotation}` + # @!attribute [rw] user_specified_annotation + # @return [::Google::Cloud::VisionAI::V1::UserSpecifiedAnnotation] + # User provided annotation. + class Annotation + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Annotation provided by users. + # @!attribute [rw] key + # @return [::String] + # Required. Key of the annotation. The key must be set with type by + # CreateDataSchema. + # @!attribute [rw] value + # @return [::Google::Cloud::VisionAI::V1::AnnotationValue] + # Value of the annotation. The value must be able to convert + # to the type according to the data schema. + # @!attribute [rw] partition + # @return [::Google::Cloud::VisionAI::V1::Partition] + # Partition information in time and space for the sub-asset level annotation. + class UserSpecifiedAnnotation + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Location Coordinate Representation + # @!attribute [rw] latitude + # @return [::Float] + # Latitude Coordinate. Degrees [-90 .. 90] + # @!attribute [rw] longitude + # @return [::Float] + # Longitude Coordinate. Degrees [-180 .. 180] + class GeoCoordinate + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Value of annotation, including all types available in data schema. + # @!attribute [rw] int_value + # @return [::Integer] + # Value of int type annotation. + # + # Note: The following fields are mutually exclusive: `int_value`, `float_value`, `str_value`, `datetime_value`, `geo_coordinate`, `proto_any_value`, `bool_value`, `customized_struct_data_value`, `list_value`, `customized_struct_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] float_value + # @return [::Float] + # Value of float type annotation. + # + # Note: The following fields are mutually exclusive: `float_value`, `int_value`, `str_value`, `datetime_value`, `geo_coordinate`, `proto_any_value`, `bool_value`, `customized_struct_data_value`, `list_value`, `customized_struct_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] str_value + # @return [::String] + # Value of string type annotation. + # + # Note: The following fields are mutually exclusive: `str_value`, `int_value`, `float_value`, `datetime_value`, `geo_coordinate`, `proto_any_value`, `bool_value`, `customized_struct_data_value`, `list_value`, `customized_struct_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] datetime_value + # @return [::String] + # Value of date time type annotation. + # + # Note: The following fields are mutually exclusive: `datetime_value`, `int_value`, `float_value`, `str_value`, `geo_coordinate`, `proto_any_value`, `bool_value`, `customized_struct_data_value`, `list_value`, `customized_struct_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] geo_coordinate + # @return [::Google::Cloud::VisionAI::V1::GeoCoordinate] + # Value of geo coordinate type annotation. + # + # Note: The following fields are mutually exclusive: `geo_coordinate`, `int_value`, `float_value`, `str_value`, `datetime_value`, `proto_any_value`, `bool_value`, `customized_struct_data_value`, `list_value`, `customized_struct_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] proto_any_value + # @return [::Google::Protobuf::Any] + # Value of any proto value. + # + # Note: The following fields are mutually exclusive: `proto_any_value`, `int_value`, `float_value`, `str_value`, `datetime_value`, `geo_coordinate`, `bool_value`, `customized_struct_data_value`, `list_value`, `customized_struct_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] bool_value + # @return [::Boolean] + # Value of boolean type annotation. + # + # Note: The following fields are mutually exclusive: `bool_value`, `int_value`, `float_value`, `str_value`, `datetime_value`, `geo_coordinate`, `proto_any_value`, `customized_struct_data_value`, `list_value`, `customized_struct_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] customized_struct_data_value + # @return [::Google::Protobuf::Struct] + # Value of customized struct annotation. This field does not have effects. + # Use customized_struct_value instead for customized struct annotation. + # + # Note: The following fields are mutually exclusive: `customized_struct_data_value`, `int_value`, `float_value`, `str_value`, `datetime_value`, `geo_coordinate`, `proto_any_value`, `bool_value`, `list_value`, `customized_struct_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] list_value + # @return [::Google::Cloud::VisionAI::V1::AnnotationList] + # Value of list type annotation. + # + # Note: The following fields are mutually exclusive: `list_value`, `int_value`, `float_value`, `str_value`, `datetime_value`, `geo_coordinate`, `proto_any_value`, `bool_value`, `customized_struct_data_value`, `customized_struct_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] customized_struct_value + # @return [::Google::Cloud::VisionAI::V1::AnnotationCustomizedStruct] + # Value of custom struct type annotation. + # + # Note: The following fields are mutually exclusive: `customized_struct_value`, `int_value`, `float_value`, `str_value`, `datetime_value`, `geo_coordinate`, `proto_any_value`, `bool_value`, `customized_struct_data_value`, `list_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. + class AnnotationValue + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # List representation in annotation. + # @!attribute [rw] values + # @return [::Array<::Google::Cloud::VisionAI::V1::AnnotationValue>] + # The values of `LIST` data type annotation. + class AnnotationList + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Customized struct represnation in annotation. + # @!attribute [rw] elements + # @return [::Google::Protobuf::Map{::String => ::Google::Cloud::VisionAI::V1::AnnotationValue}] + # A map from elements' keys to element's annotation value. + class AnnotationCustomizedStruct + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::Google::Cloud::VisionAI::V1::AnnotationValue] + class ElementsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Request message for GetAnnotation API. + # @!attribute [rw] parent + # @return [::String] + # The parent, which owns this collection of annotations. + # Format: + # `projects/{project_number}/locations/{location}/corpora/{corpus}/assets/{asset}` + # @!attribute [rw] page_size + # @return [::Integer] + # The maximum number of annotations to return. The service may return fewer + # than this value. If unspecified, at most 50 annotations will be returned. + # The maximum value is 1000; values above 1000 will be coerced to 1000. + # @!attribute [rw] page_token + # @return [::String] + # A page token, received from a previous `ListAnnotations` call. + # Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to `ListAnnotations` must + # match the call that provided the page token. + # @!attribute [rw] filter + # @return [::String] + # The filter applied to the returned list. + # We only support filtering for the following fields: + # For corpus of STREAM_VIDEO type: + # `partition.temporal_partition.start_time`, + # `partition.temporal_partition.end_time`, and `key`. + # For corpus of VIDEO_ON_DEMAND type, + # `partition.relative_temporal_partition.start_offset`, + # `partition.relative_temporal_partition.end_offset`, and `key`. + # For corpus of IMAGE type, only `key` is supported. + # Timestamps are specified in the RFC-3339 format, and only one restriction + # may be applied per field, joined by conjunctions. + # Format: + # "partition.temporal_partition.start_time > "2012-04-21T11:30:00-04:00" AND + # partition.temporal_partition.end_time < "2012-04-22T11:30:00-04:00" AND + # key = "example_key"" + class ListAnnotationsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for ListAnnotations API. + # @!attribute [rw] annotations + # @return [::Array<::Google::Cloud::VisionAI::V1::Annotation>] + # The annotations from the specified asset. + # @!attribute [rw] next_page_token + # @return [::String] + # A token, which can be sent as `page_token` to retrieve the next page. + # If this field is omitted, there are no subsequent pages. + class ListAnnotationsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for GetAnnotation API. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the annotation to retrieve. + # Format: + # `projects/{project_number}/locations/{location}/corpora/{corpus}/assets/{asset}/annotations/{annotation}` + class GetAnnotationRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for UpdateAnnotation API. + # @!attribute [rw] annotation + # @return [::Google::Cloud::VisionAI::V1::Annotation] + # Required. The annotation to update. + # The annotation's `name` field is used to identify the annotation to be + # updated. Format: + # `projects/{project_number}/locations/{location}/corpora/{corpus}/assets/{asset}/annotations/{annotation}` + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # The list of fields to be updated. + class UpdateAnnotationRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for DeleteAnnotation API. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the annotation to delete. + # Format: + # `projects/{project_number}/locations/{location}/corpora/{corpus}/assets/{asset}/annotations/{annotation}` + class DeleteAnnotationRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The request message for ImportAssets. + # @!attribute [rw] assets_gcs_uri + # @return [::String] + # The file contains all assets information to be imported. + # * The file is in JSONL format. + # * Each line corresponding to one asset. + # * Each line will be converted into InputImageAsset proto. + # @!attribute [rw] parent + # @return [::String] + # Required. The parent corpus resource where the assets will be imported. + # Format: + # `projects/{project_number}/locations/{location_id}/corpora/{corpus_id}` + class ImportAssetsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The metadata message for ImportAssets LRO. + # @!attribute [rw] metadata + # @return [::Google::Cloud::VisionAI::V1::OperationMetadata] + # The metadata of the operation. + # @!attribute [rw] status + # @return [::Google::Cloud::VisionAI::V1::BatchOperationStatus] + # The importing status including partial failures, if the implementation can + # provide such information during the progress of the ImportAssets. + class ImportAssetsMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The batch operation status. + # @!attribute [rw] success_count + # @return [::Integer] + # The count of assets (together with their annotations if any) successfully + # ingested. + # @!attribute [rw] failure_count + # @return [::Integer] + # The count of assets failed to ingested; it might be due to the annotation + # ingestion error. + class BatchOperationStatus + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The response message for ImportAssets LRO. + class ImportAssetsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for CreateSearchConfig. + # @!attribute [rw] parent + # @return [::String] + # Required. The parent resource where this search configuration will be + # created. Format: + # `projects/{project_number}/locations/{location_id}/corpora/{corpus_id}` + # @!attribute [rw] search_config + # @return [::Google::Cloud::VisionAI::V1::SearchConfig] + # Required. The search config to create. + # @!attribute [rw] search_config_id + # @return [::String] + # Required. ID to use for the new search config. Will become the final + # component of the SearchConfig's resource name. This value should be up to + # 63 characters, and valid characters are /[a-z][0-9]-_/. The first character + # must be a letter, the last could be a letter or a number. + class CreateSearchConfigRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for UpdateSearchConfig. + # @!attribute [rw] search_config + # @return [::Google::Cloud::VisionAI::V1::SearchConfig] + # Required. The search configuration to update. + # + # The search configuration's `name` field is used to identify the resource to + # be updated. Format: + # `projects/{project_number}/locations/{location}/corpora/{corpus}/searchConfigs/{search_config}` + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # The list of fields to be updated. If left unset, all field paths will be + # updated/overwritten. + class UpdateSearchConfigRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for GetSearchConfig. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the search configuration to retrieve. + # Format: + # `projects/{project_number}/locations/{location}/corpora/{corpus}/searchConfigs/{search_config}` + class GetSearchConfigRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for DeleteSearchConfig. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the search configuration to delete. + # Format: + # `projects/{project_number}/locations/{location}/corpora/{corpus}/searchConfigs/{search_config}` + class DeleteSearchConfigRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for ListSearchConfigs. + # @!attribute [rw] parent + # @return [::String] + # Required. The parent, which owns this collection of search configurations. + # Format: + # `projects/{project_number}/locations/{location}/corpora/{corpus}` + # @!attribute [rw] page_size + # @return [::Integer] + # The maximum number of search configurations to return. The service may + # return fewer than this value. If unspecified, a page size of 50 will be + # used. The maximum value is 1000; values above 1000 will be coerced to 1000. + # @!attribute [rw] page_token + # @return [::String] + # A page token, received from a previous `ListSearchConfigs` call. + # Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to + # `ListSearchConfigs` must match the call that provided the page + # token. + class ListSearchConfigsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for ListSearchConfigs. + # @!attribute [rw] search_configs + # @return [::Array<::Google::Cloud::VisionAI::V1::SearchConfig>] + # The search configurations from the specified corpus. + # @!attribute [rw] next_page_token + # @return [::String] + # A token, which can be sent as `page_token` to retrieve the next page. + # If this field is omitted, there are no subsequent pages. + class ListSearchConfigsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # SearchConfig stores different properties that will affect search + # behaviors and search results. + # @!attribute [rw] name + # @return [::String] + # Resource name of the search configuration. + # For CustomSearchCriteria, search_config would be the search + # operator name. For Facets, search_config would be the facet + # dimension name. + # Format: + # `projects/{project_number}/locations/{location}/corpora/{corpus}/searchConfigs/{search_config}` + # @!attribute [rw] facet_property + # @return [::Google::Cloud::VisionAI::V1::FacetProperty] + # Establishes a FacetDimension and associated specifications. + # @!attribute [rw] search_criteria_property + # @return [::Google::Cloud::VisionAI::V1::SearchCriteriaProperty] + # Creates a mapping between a custom SearchCriteria and one or more UGA keys. + class SearchConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Message representing IndexEndpoint resource. Indexes are deployed into it. + # @!attribute [r] name + # @return [::String] + # Output only. Resource name of the IndexEndpoint. + # Format: + # `projects/{project}/locations/{location}/indexEndpoints/{index_endpoint_id}` + # @!attribute [rw] display_name + # @return [::String] + # Optional. Display name of the IndexEndpoint. Can be up to 32 characters + # long. + # @!attribute [rw] description + # @return [::String] + # Optional. Description of the IndexEndpoint. Can be up to 25000 characters + # long. + # @!attribute [r] deployed_index + # @return [::Google::Cloud::VisionAI::V1::DeployedIndex] + # Output only. The Index deployed in this IndexEndpoint. + # @!attribute [r] state + # @return [::Google::Cloud::VisionAI::V1::IndexEndpoint::State] + # Output only. IndexEndpoint state. + # @!attribute [rw] labels + # @return [::Google::Protobuf::Map{::String => ::String}] + # Optional. The labels applied to a resource must meet the following + # requirements: + # + # * Each resource can have multiple labels, up to a maximum of 64. + # * Each label must be a key-value pair. + # * Keys have a minimum length of 1 character and a maximum length of 63 + # characters and cannot be empty. Values can be empty and have a maximum + # length of 63 characters. + # * Keys and values can contain only lowercase letters, numeric characters, + # underscores, and dashes. All characters must use UTF-8 encoding, and + # international characters are allowed. + # * The key portion of a label must be unique. However, you can use the same + # key with multiple resources. + # * Keys must start with a lowercase letter or international character. + # + # See [Google Cloud + # Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements) + # for more details. + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Create timestamp. + # @!attribute [r] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Update timestamp. + # @!attribute [r] satisfies_pzs + # @return [::Boolean] + # Output only. This boolean field is only set for projects that have Physical + # Zone Separation enabled via an Org Policy constraint. It is set to true + # when the index endpoint is a valid zone separated index endpoint and false + # if it isn't. + # @!attribute [r] satisfies_pzi + # @return [::Boolean] + # Output only. This boolean field is only set for projects that have Physical + # Zone Isolation enabled via an Org Policy constraint. It is set to true when + # the index endpoint is a valid zone isolated index endpoint and false if it + # isn't. + class IndexEndpoint + 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 + + # IndexEndpoint stage. + module State + # The default value. Should not be used. + STATE_UNSPECIFIED = 0 + + # State CREATING. + CREATING = 1 + + # State CREATED. + CREATED = 2 + + # State UPDATING. + UPDATING = 3 + + # State FAILED. + FAILED = 4 + end + end + + # Request message for CreateIndexEndpoint. + # @!attribute [rw] parent + # @return [::String] + # Required. Format: `projects/{project}/locations/{location}` + # @!attribute [rw] index_endpoint_id + # @return [::String] + # Optional. The ID to use for the IndexEndpoint, which will become the final + # component of the IndexEndpoint's resource name if the user specifies it. + # Otherwise, IndexEndpoint id will be autogenerated. + # + # This value should be up to 63 characters, and valid characters + # are a-z, 0-9 and dash (-). The first character must be a letter, the last + # must be a letter or a number. + # @!attribute [rw] index_endpoint + # @return [::Google::Cloud::VisionAI::V1::IndexEndpoint] + # Required. The resource being created. + class CreateIndexEndpointRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Metadata message for CreateIndexEndpoint. + # @!attribute [rw] operation_metadata + # @return [::Google::Cloud::VisionAI::V1::OperationMetadata] + # Common metadata of the long-running operation. + class CreateIndexEndpointMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for GetIndexEndpoint. + # @!attribute [rw] name + # @return [::String] + # Required. Name of the IndexEndpoint resource. + class GetIndexEndpointRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for ListIndexEndpoints. + # @!attribute [rw] parent + # @return [::String] + # Required. Format: `projects/{project}/locations/{location}` + # @!attribute [rw] page_size + # @return [::Integer] + # Optional. Requested page size. Server may return fewer items than + # requested. The service may return fewer than this value. If unspecified, a + # page size of 50 will be used. The maximum value is 1000; values above 1000 + # will be coerced to 1000. + # @!attribute [rw] page_token + # @return [::String] + # Optional. A token identifying a page of results the server should return. + # @!attribute [rw] filter + # @return [::String] + # Optional. The filter applied to the returned list. + # We only support filtering for the `deployed_image_index.image_index` field. + # However, to filter by a corpus instead of an image index, simply use + # `deployed_image_index.corpus`, which will return all endpoints with + # `deployed_image_index.image_index` inside of the given corpus. + # A basic filter on image index would look like: + # deployed_image_index.image_index = + # "projects/123/locations/us-central1/corpora/my_corpus/imageIndexes/my_image_index" + # A basic filter on corpus would look like: + # deployed_image_index.corpus = + # "projects/123/locations/us-central1/corpora/my_corpus" + class ListIndexEndpointsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for ListIndexEndpoints. + # @!attribute [rw] index_endpoints + # @return [::Array<::Google::Cloud::VisionAI::V1::IndexEndpoint>] + # The list of IndexEndpoints. + # @!attribute [rw] next_page_token + # @return [::String] + # A token identifying a page of results the server should return. + class ListIndexEndpointsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for UpdateIndexEndpoint. + # @!attribute [rw] index_endpoint + # @return [::Google::Cloud::VisionAI::V1::IndexEndpoint] + # Required. The resource being updated. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # Required. Field mask is used to specify the fields to be overwritten in the + # IndexEndpoint resource by the update. + # The fields specified in the update_mask are relative to the resource, not + # the full request. + # A field of the resource will be overwritten if it is in the mask. + # Empty field mask is not allowed. + # If the mask is "*", then this is a full replacement of the resource. + class UpdateIndexEndpointRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Metadata message for UpdateIndexEndpoint. + # @!attribute [rw] operation_metadata + # @return [::Google::Cloud::VisionAI::V1::OperationMetadata] + # Common metadata of the long-running operation. + class UpdateIndexEndpointMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for DeleteIndexEndpoint. + # @!attribute [rw] name + # @return [::String] + # Required. Name of the resource. + class DeleteIndexEndpointRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Metadata message for DeleteIndexEndpoint. + # @!attribute [rw] operation_metadata + # @return [::Google::Cloud::VisionAI::V1::OperationMetadata] + # Common metadata of the long-running operation. + class DeleteIndexEndpointMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for DeployIndex. + # @!attribute [rw] index_endpoint + # @return [::String] + # Required. IndexEndpoint the index is deployed to. + # Format: + # `projects/{project}/locations/{location}/indexEndpoints/{index_endpoint}` + # @!attribute [rw] deployed_index + # @return [::Google::Cloud::VisionAI::V1::DeployedIndex] + # Required. Index to deploy. + class DeployIndexRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # DeployIndex response once the operation is done. + class DeployIndexResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Metadata message for DeployIndex. + # @!attribute [rw] operation_metadata + # @return [::Google::Cloud::VisionAI::V1::OperationMetadata] + # Common metadata of the long-running operation. + # @!attribute [r] deployed_index + # @return [::String] + # Output only. The index being deployed. + class DeployIndexMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Metadata message for UndeployIndex. + # @!attribute [rw] operation_metadata + # @return [::Google::Cloud::VisionAI::V1::OperationMetadata] + # Common metadata of the long-running operation. + # @!attribute [r] deployed_index + # @return [::String] + # Output only. The index being undeployed. + class UndeployIndexMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for UndeployIndexEndpoint. + # @!attribute [rw] index_endpoint + # @return [::String] + # Required. Resource name of the IndexEndpoint resource on which the + # undeployment will act. Format: + # `projects/{project}/locations/{location}/indexEndpoints/{index_endpoint}` + class UndeployIndexRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # UndeployIndex response once the operation is done. + class UndeployIndexResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A deployment of an Index. + # @!attribute [rw] index + # @return [::String] + # Required. Name of the deployed Index. + # Format: + # `projects/{project_number}/locations/{location_id}/corpora/{corpus_id}/indexes/{index_id}` + class DeployedIndex + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Central configuration for a facet. + # @!attribute [rw] fixed_range_bucket_spec + # @return [::Google::Cloud::VisionAI::V1::FacetProperty::FixedRangeBucketSpec] + # Fixed range facet bucket config. + # + # Note: The following fields are mutually exclusive: `fixed_range_bucket_spec`, `custom_range_bucket_spec`, `datetime_bucket_spec`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] custom_range_bucket_spec + # @return [::Google::Cloud::VisionAI::V1::FacetProperty::CustomRangeBucketSpec] + # Custom range facet bucket config. + # + # Note: The following fields are mutually exclusive: `custom_range_bucket_spec`, `fixed_range_bucket_spec`, `datetime_bucket_spec`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] datetime_bucket_spec + # @return [::Google::Cloud::VisionAI::V1::FacetProperty::DateTimeBucketSpec] + # Datetime range facet bucket config. + # + # Note: The following fields are mutually exclusive: `datetime_bucket_spec`, `fixed_range_bucket_spec`, `custom_range_bucket_spec`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] mapped_fields + # @return [::Array<::String>] + # Name of the facets, which are the dimensions users want to use to refine + # search results. `mapped_fields` will match UserSpecifiedDataSchema keys. + # + # For example, user can add a bunch of UGAs with the same key, such as + # player:adam, player:bob, player:charles. When multiple mapped_fields are + # specified, will merge their value together as final facet value. E.g. + # home_team: a, home_team:b, away_team:a, away_team:c, when facet_field = + # [home_team, away_team], facet_value will be [a, b, c]. + # + # UNLESS this is a 1:1 facet dimension (mapped_fields.size() == 1) AND the + # mapped_field equals the parent SearchConfig.name, the parent must + # also contain a SearchCriteriaProperty that maps to the same fields. + # mapped_fields must not be empty. + # @!attribute [rw] display_name + # @return [::String] + # Display name of the facet. To be used by UI for facet rendering. + # @!attribute [rw] result_size + # @return [::Integer] + # Maximum number of unique bucket to return for one facet. Bucket number can + # be large for high-cardinality facet such as "player". We only return top-n + # most related ones to user. If it's <= 0, the server will decide the + # appropriate result_size. + # @!attribute [rw] bucket_type + # @return [::Google::Cloud::VisionAI::V1::FacetBucketType] + # Facet bucket type e.g. value, range. + class FacetProperty + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # If bucket type is FIXED_RANGE, specify how values are bucketized. Use + # FixedRangeBucketSpec when you want to create multiple buckets with equal + # granularities. Using integer bucket value as an example, when + # bucket_start = 0, bucket_granularity = 10, bucket_count = 5, this facet + # will be aggregated via the following buckets: + # [-inf, 0), [0, 10), [10, 20), [20, 30), [30, inf). + # Notably, bucket_count <= 1 is an invalid spec. + # @!attribute [rw] bucket_start + # @return [::Google::Cloud::VisionAI::V1::FacetValue] + # Lower bound of the bucket. NOTE: Only integer type is currently supported + # for this field. + # @!attribute [rw] bucket_granularity + # @return [::Google::Cloud::VisionAI::V1::FacetValue] + # Bucket granularity. NOTE: Only integer type is currently supported for + # this field. + # @!attribute [rw] bucket_count + # @return [::Integer] + # Total number of buckets. + class FixedRangeBucketSpec + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # If bucket type is CUSTOM_RANGE, specify how values are bucketized. Use + # integer bucket value as an example, when the endpoints are 0, 10, 100, and + # 1000, we will generate the following facets: + # [-inf, 0), [0, 10), [10, 100), [100, 1000), [1000, inf). + # Notably: + # - endpoints must be listed in ascending order. Otherwise, the SearchConfig + # API will reject the facet config. + # - < 1 endpoints is an invalid spec. + # @!attribute [rw] endpoints + # @return [::Array<::Google::Cloud::VisionAI::V1::FacetValue>] + # Currently, only integer type is supported for this field. + class CustomRangeBucketSpec + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # If bucket type is DATE, specify how date values are bucketized. + # @!attribute [rw] granularity + # @return [::Google::Cloud::VisionAI::V1::FacetProperty::DateTimeBucketSpec::Granularity] + # Granularity of date type facet. + class DateTimeBucketSpec + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Granularity enum for the datetime bucket. + module Granularity + # Unspecified granularity. + GRANULARITY_UNSPECIFIED = 0 + + # Granularity is year. + YEAR = 1 + + # Granularity is month. + MONTH = 2 + + # Granularity is day. + DAY = 3 + end + end + end + + # Search resource: SearchHypernym. + # For example, + # { hypernym: "vehicle" + # hyponyms: ["sedan", "truck"] } + # This means in SMART_SEARCH mode, searching for "vehicle" will also return + # results with "sedan" or "truck" as annotations. + # @!attribute [rw] name + # @return [::String] + # Resource name of the SearchHypernym. + # Format: + # `projects/{project_number}/locations/{location}/corpora/{corpus}/searchHypernyms/{search_hypernym}` + # @!attribute [rw] hypernym + # @return [::String] + # Optional. The hypernym. + # @!attribute [rw] hyponyms + # @return [::Array<::String>] + # Optional. Hyponyms that the hypernym is mapped to. + class SearchHypernym + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for creating SearchHypernym. + # @!attribute [rw] parent + # @return [::String] + # Required. The parent resource where this SearchHypernym will be created. + # Format: `projects/{project_number}/locations/{location}/corpora/{corpus}` + # @!attribute [rw] search_hypernym + # @return [::Google::Cloud::VisionAI::V1::SearchHypernym] + # Required. The SearchHypernym to create. + # @!attribute [rw] search_hypernym_id + # @return [::String] + # Optional. The search hypernym id. + # If omitted, a random UUID will be generated. + class CreateSearchHypernymRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for updating SearchHypernym. + # @!attribute [rw] search_hypernym + # @return [::Google::Cloud::VisionAI::V1::SearchHypernym] + # Required. The SearchHypernym to update. + # The search hypernym's `name` field is used to identify the search hypernym + # to be updated. Format: + # `projects/{project_number}/locations/{location}/corpora/{corpus}/searchHypernyms/{search_hypernym}` + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # The list of fields to be updated. If left unset, all field paths will be + # updated/overwritten. + class UpdateSearchHypernymRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for getting SearchHypernym. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the SearchHypernym to retrieve. + # Format: + # `projects/{project_number}/locations/{location}/corpora/{corpus}/searchHypernyms/{search_hypernym}` + class GetSearchHypernymRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for deleting SearchHypernym. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the SearchHypernym to delete. + # Format: + # `projects/{project_number}/locations/{location}/corpora/{corpus}/searchHypernyms/{search_hypernym}` + class DeleteSearchHypernymRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for listing SearchHypernyms. + # @!attribute [rw] parent + # @return [::String] + # Required. The parent, which owns this collection of SearchHypernyms. + # Format: + # `projects/{project_number}/locations/{location}/corpora/{corpus}` + # @!attribute [rw] page_size + # @return [::Integer] + # The maximum number of SearchHypernyms returned. The service may + # return fewer than this value. If unspecified, a page size of 50 will be + # used. The maximum value is 1000; values above 1000 will be coerced to 1000. + # @!attribute [rw] page_token + # @return [::String] + # A page token, received from a previous `SearchHypernym` call. + # Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to + # `SearchHypernym` must match the call that provided the page + # token. + class ListSearchHypernymsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for listing SearchHypernyms. + # @!attribute [rw] search_hypernyms + # @return [::Array<::Google::Cloud::VisionAI::V1::SearchHypernym>] + # The SearchHypernyms from the specified corpus. + # @!attribute [rw] next_page_token + # @return [::String] + # A token, which can be sent as `page_token` to retrieve the next page. + # If this field is omitted, there are no subsequent pages. + class ListSearchHypernymsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Central configuration for custom search criteria. + # @!attribute [rw] mapped_fields + # @return [::Array<::String>] + # Each mapped_field corresponds to a UGA key. To understand how this property + # works, take the following example. In the SearchConfig table, the + # user adds this entry: + # search_config { + # name: "person" + # search_criteria_property { + # mapped_fields: "player" + # mapped_fields: "coach" + # } + # } + # + # Now, when a user issues a query like: + # criteria { + # field: "person" + # text_array { + # txt_values: "Tom Brady" + # txt_values: "Bill Belichick" + # } + # } + # + # MWH search will return search documents where (player=Tom Brady || + # coach=Tom Brady || player=Bill Belichick || coach=Bill Belichick). + class SearchCriteriaProperty + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Definition of a single value with generic type. + # @!attribute [rw] string_value + # @return [::String] + # String type value. + # + # Note: The following fields are mutually exclusive: `string_value`, `integer_value`, `datetime_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] integer_value + # @return [::Integer] + # Integer type value. + # + # Note: The following fields are mutually exclusive: `integer_value`, `string_value`, `datetime_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] datetime_value + # @return [::Google::Type::DateTime] + # Datetime type value. + # + # Note: The following fields are mutually exclusive: `datetime_value`, `string_value`, `integer_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. + class FacetValue + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Holds the facet value, selections state, and metadata. + # @!attribute [rw] value + # @return [::Google::Cloud::VisionAI::V1::FacetValue] + # Singular value. + # + # Note: The following fields are mutually exclusive: `value`, `range`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] range + # @return [::Google::Cloud::VisionAI::V1::FacetBucket::Range] + # Range value. + # + # Note: The following fields are mutually exclusive: `range`, `value`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] selected + # @return [::Boolean] + # Whether one facet bucket is selected. This field represents user's facet + # selection. It is set by frontend in SearchVideosRequest. + class FacetBucket + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The range of values [start, end) for which faceting is applied. + # @!attribute [rw] start + # @return [::Google::Cloud::VisionAI::V1::FacetValue] + # Start of the range. Non-existence indicates some bound (e.g. -inf). + # @!attribute [rw] end + # @return [::Google::Cloud::VisionAI::V1::FacetValue] + # End of the range. Non-existence indicates some bound (e.g. inf). + class Range + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # A group of facet buckets to be passed back and forth between backend & + # frontend. + # @!attribute [rw] facet_id + # @return [::String] + # Unique id of the facet group. + # @!attribute [rw] display_name + # @return [::String] + # Display name of the facet. To be used by UI for facet rendering. + # @!attribute [rw] buckets + # @return [::Array<::Google::Cloud::VisionAI::V1::FacetBucket>] + # Buckets associated with the facet. E.g. for "Team" facet, the bucket + # can be 49ers, patriots, etc. + # @!attribute [rw] bucket_type + # @return [::Google::Cloud::VisionAI::V1::FacetBucketType] + # Facet bucket type. + # @!attribute [rw] fetch_matched_annotations + # @return [::Boolean] + # If true, return query matched annotations for this facet group's selection. + # This option is only applicable for facets based on partition level + # annotations. It supports the following facet values: + # - INTEGER + # - STRING (DataSchema.SearchStrategy.EXACT_SEARCH only) + class FacetGroup + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for IngestAsset API. + # @!attribute [rw] config + # @return [::Google::Cloud::VisionAI::V1::IngestAssetRequest::Config] + # Provides information for the data and the asset resource name that the + # data belongs to. The first `IngestAssetRequest` message must only contain + # a `Config` message. + # + # Note: The following fields are mutually exclusive: `config`, `time_indexed_data`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] time_indexed_data + # @return [::Google::Cloud::VisionAI::V1::IngestAssetRequest::TimeIndexedData] + # Data to be ingested. + # + # Note: The following fields are mutually exclusive: `time_indexed_data`, `config`. If a field in that set is populated, all other fields in the set will automatically be cleared. + class IngestAssetRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Configuration for the data. + # @!attribute [rw] video_type + # @return [::Google::Cloud::VisionAI::V1::IngestAssetRequest::Config::VideoType] + # Type information for video data. + # @!attribute [rw] asset + # @return [::String] + # Required. The resource name of the asset that the ingested data belongs + # to. + class Config + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Type information for video data. + # @!attribute [rw] container_format + # @return [::Google::Cloud::VisionAI::V1::IngestAssetRequest::Config::VideoType::ContainerFormat] + # Container format of the video data. + class VideoType + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Container format of the video. + module ContainerFormat + # The default type, not supposed to be used. + CONTAINER_FORMAT_UNSPECIFIED = 0 + + # Mp4 container format. + CONTAINER_FORMAT_MP4 = 1 + end + end + end + + # Contains the data and the corresponding time range this data is for. + # @!attribute [rw] data + # @return [::String] + # Data to be ingested. + # @!attribute [rw] temporal_partition + # @return [::Google::Cloud::VisionAI::V1::Partition::TemporalPartition] + # Time range of the data. + class TimeIndexedData + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Response message for IngestAsset API. + # @!attribute [rw] successfully_ingested_partition + # @return [::Google::Cloud::VisionAI::V1::Partition::TemporalPartition] + # Time range of the data that has been successfully ingested. + class IngestAssetResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for ClipAsset API. + # @!attribute [rw] name + # @return [::String] + # Required. The resource name of the asset to request clips for. + # Format: + # `projects/{project_number}/locations/{location_id}/corpora/{corpus_id}/assets/{asset_id}` + # @!attribute [rw] temporal_partition + # @return [::Google::Cloud::VisionAI::V1::Partition::TemporalPartition] + # Required. The time range to request clips for. + class ClipAssetRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for ClipAsset API. + # @!attribute [rw] time_indexed_uris + # @return [::Array<::Google::Cloud::VisionAI::V1::ClipAssetResponse::TimeIndexedUri>] + # A list of signed uris to download the video clips that cover the requested + # time range ordered by time. + class ClipAssetResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Signed uri with corresponding time range. + # @!attribute [rw] temporal_partition + # @return [::Google::Cloud::VisionAI::V1::Partition::TemporalPartition] + # Time range of the video that the uri is for. + # @!attribute [rw] uri + # @return [::String] + # Signed uri to download the video clip. + class TimeIndexedUri + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Request message for GenerateHlsUri API. + # @!attribute [rw] name + # @return [::String] + # Required. The resource name of the asset to request clips for. + # Format: + # `projects/{project_number}/locations/{location_id}/corpora/{corpus_id}/assets/{asset_id}` + # @!attribute [rw] temporal_partitions + # @return [::Array<::Google::Cloud::VisionAI::V1::Partition::TemporalPartition>] + # The time range to request clips for. Will be ignored if `get_live_view` is + # set to True. The total time range requested should be smaller than 24h. + # @!attribute [rw] live_view_enabled + # @return [::Boolean] + # Option to exclusively show a livestream of the asset with up to 3 minutes + # of backlog data. + class GenerateHlsUriRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for GenerateHlsUri API. + # @!attribute [rw] uri + # @return [::String] + # A signed uri to download the HLS manifest corresponding to the requested + # times. + # @!attribute [rw] temporal_partitions + # @return [::Array<::Google::Cloud::VisionAI::V1::Partition::TemporalPartition>] + # A list of temporal partitions of the content returned in the order they + # appear in the stream. + class GenerateHlsUriResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for SearchAssets. + # @!attribute [rw] schema_key_sorting_strategy + # @return [::Google::Cloud::VisionAI::V1::SchemaKeySortingStrategy] + # Sort by the value under the data schema key. + # @!attribute [rw] corpus + # @return [::String] + # Required. The parent corpus to search. + # Format: `projects/{project_id}/locations/{location_id}/corpora/{corpus_id}' + # @!attribute [rw] page_size + # @return [::Integer] + # The number of results to be returned in this page. If it's 0, the server + # will decide the appropriate page_size. + # @!attribute [rw] page_token + # @return [::String] + # The continuation token to fetch the next page. If empty, it means it is + # fetching the first page. + # @!attribute [rw] content_time_ranges + # @return [::Google::Cloud::VisionAI::V1::DateTimeRangeArray] + # Time ranges that matching video content must fall within. If no ranges are + # provided, there will be no time restriction. This field is treated just + # like the criteria below, but defined separately for convenience as it is + # used frequently. Note that if the end_time is in the future, it will be + # clamped to the time the request was received. + # @!attribute [rw] criteria + # @return [::Array<::Google::Cloud::VisionAI::V1::Criteria>] + # Criteria applied to search results. + # @!attribute [rw] facet_selections + # @return [::Array<::Google::Cloud::VisionAI::V1::FacetGroup>] + # Stores most recent facet selection state. Only facet groups with user's + # selection will be presented here. Selection state is either selected or + # unselected. Only selected facet buckets will be used as search criteria. + # @!attribute [rw] result_annotation_keys + # @return [::Array<::String>] + # A list of annotation keys to specify the annotations to be retrieved and + # returned with each search result. + # Annotation granularity must be GRANULARITY_ASSET_LEVEL and its search + # strategy must not be NO_SEARCH. + # @!attribute [rw] search_query + # @return [::String] + # Global search query. Allows user to search assets without needing to + # specify which field the value belongs to. + class SearchAssetsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for SearchIndexEndpoint. + # @!attribute [rw] image_query + # @return [::Google::Cloud::VisionAI::V1::ImageQuery] + # An image-only query. + # + # Note: The following fields are mutually exclusive: `image_query`, `text_query`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] text_query + # @return [::String] + # A text-only query. + # + # Note: The following fields are mutually exclusive: `text_query`, `image_query`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] index_endpoint + # @return [::String] + # Required. The index endpoint to search. + # Format: + # `projects/{project_id}/locations/{location_id}/indexEndpoints/{index_endpoint_id}' + # @!attribute [rw] criteria + # @return [::Array<::Google::Cloud::VisionAI::V1::Criteria>] + # Criteria applied to search results. + # @!attribute [rw] exclusion_criteria + # @return [::Array<::Google::Cloud::VisionAI::V1::Criteria>] + # Criteria to exclude from search results. + # Note that `fetch_matched_annotations` will be ignored. + # @!attribute [rw] page_size + # @return [::Integer] + # Requested page size. API may return fewer results than requested. + # If negative, INVALID_ARGUMENT error will be returned. + # If unspecified or 0, API will pick a default size, which is 10. + # If the requested page size is larger than the maximum size, API will pick + # the maximum size, which is 200. + # @!attribute [rw] page_token + # @return [::String] + # The continuation token to fetch the next page. If empty, it means it is + # fetching the first page. + class SearchIndexEndpointRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Image query for search endpoint request. + # @!attribute [rw] input_image + # @return [::String] + # Input image in raw bytes. + # + # Note: The following fields are mutually exclusive: `input_image`, `asset`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] asset + # @return [::String] + # Resource name of the asset. Only supported in IMAGE corpus type. + # Format: + # `projects/{project_number}/locations/{location_id}/corpora/{corpus_id}/assets/{asset_id}` + # + # Note: The following fields are mutually exclusive: `asset`, `input_image`. If a field in that set is populated, all other fields in the set will automatically be cleared. + class ImageQuery + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A strategy to specify how to sort by data schema key. + # @!attribute [rw] options + # @return [::Array<::Google::Cloud::VisionAI::V1::SchemaKeySortingStrategy::Option>] + # Options in the front have high priority than those in the back. + class SchemaKeySortingStrategy + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Option for one data schema key. + # @!attribute [rw] data_schema_key + # @return [::String] + # The data used to sort. + # @!attribute [rw] sort_decreasing + # @return [::Boolean] + # Whether to sort in decreasing order or increasing order. + # By default, results are sorted in incresing order. + # @!attribute [rw] aggregate_method + # @return [::Google::Cloud::VisionAI::V1::SchemaKeySortingStrategy::Option::AggregateMethod] + # Aggregate method for the current data schema key. + class Option + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # When one result has multiple values with the same key, specify + # which value is used to sort. By default, AGGREGATE_METHOD_LARGEST + # is used when results are sorted in decreasing order, + # AGGREGATE_METHOD_SMALLEST is used when results are sorted in + # incresing order. + module AggregateMethod + # The unspecified aggregate method will be overwritten as mentioned + # above. + AGGREGATE_METHOD_UNSPECIFIED = 0 + + # Take the (lexicographical or numerical) largest value to sort. + AGGREGATE_METHOD_LARGEST = 1 + + # Take the (lexicographical or numerical) smallest value to sort. + AGGREGATE_METHOD_SMALLEST = 2 + end + end + end + + # The metadata for DeleteAsset API that embeds in + # {::Google::Longrunning::Operation#metadata metadata} field. + class DeleteAssetMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Stores the criteria-annotation matching results for each search result item. + # @!attribute [rw] criteria + # @return [::Google::Cloud::VisionAI::V1::Criteria] + # The criteria used for matching. It can be an input search criteria or a + # criteria converted from a facet selection. + # @!attribute [rw] matched_annotations + # @return [::Array<::Google::Cloud::VisionAI::V1::Annotation>] + # Matched annotations for the criteria. + # @!attribute [rw] status + # @return [::Google::Rpc::Status] + # Status of the match result. Possible values: + # FAILED_PRECONDITION - the criteria is not eligible for match. + # OK - matching is performed. + class AnnotationMatchingResult + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Search result contains asset name and corresponding time ranges. + # @!attribute [rw] asset + # @return [::String] + # The resource name of the asset. + # Format: + # `projects/{project_number}/locations/{location_id}/corpora/{corpus_id}/assets/{asset_id}` + # @!attribute [rw] segments + # @deprecated This field is deprecated and may be removed in the next major version update. + # @return [::Array<::Google::Cloud::VisionAI::V1::Partition::TemporalPartition>] + # The matched asset segments. + # Deprecated: please use singular `segment` field. + # @!attribute [rw] segment + # @return [::Google::Cloud::VisionAI::V1::Partition::TemporalPartition] + # The matched asset segment. + # @!attribute [rw] relevance + # @return [::Float] + # Available to IMAGE corpus types. + # Relevance of this `SearchResultItem` to user search query (text query or + # image query). + # By default this represents cosine similarity between the query and the + # retrieved media content. The value is in the range of [-1, 1]. + # Note that search ranking is not only decided by this relevance score, but + # also other factors such as the match of annotations. + # @!attribute [rw] requested_annotations + # @return [::Array<::Google::Cloud::VisionAI::V1::Annotation>] + # Search result annotations specified by result_annotation_keys in search + # request. + # @!attribute [rw] annotation_matching_results + # @return [::Array<::Google::Cloud::VisionAI::V1::AnnotationMatchingResult>] + # Criteria or facet-selection based annotation matching results associated to + # this search result item. Only contains results for criteria or + # facet_selections with fetch_matched_annotations=true. + class SearchResultItem + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for SearchAssets. + # @!attribute [rw] search_result_items + # @return [::Array<::Google::Cloud::VisionAI::V1::SearchResultItem>] + # Returned search results. + # @!attribute [rw] next_page_token + # @return [::String] + # The next-page continuation token. + # @!attribute [rw] facet_results + # @return [::Array<::Google::Cloud::VisionAI::V1::FacetGroup>] + # Facet search results of a given query, which contains user's + # already-selected facet values and updated facet search results. + class SearchAssetsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for SearchIndexEndpoint. + # @!attribute [rw] search_result_items + # @return [::Array<::Google::Cloud::VisionAI::V1::SearchResultItem>] + # Returned search results. + # @!attribute [rw] next_page_token + # @return [::String] + # The next-page continuation token. + # If this field is omitted, there are no subsequent pages. + class SearchIndexEndpointResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Integer range type. + # @!attribute [rw] start + # @return [::Integer] + # Start of the int range. + # @!attribute [rw] end + # @return [::Integer] + # End of the int range. + class IntRange + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Float range type. + # @!attribute [rw] start + # @return [::Float] + # Start of the float range. + # @!attribute [rw] end + # @return [::Float] + # End of the float range. + class FloatRange + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A list of string-type values. + # @!attribute [rw] txt_values + # @return [::Array<::String>] + # String type values. + class StringArray + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A list of integer range values. + # @!attribute [rw] int_ranges + # @return [::Array<::Google::Cloud::VisionAI::V1::IntRange>] + # Int range values. + class IntRangeArray + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A list of float range values. + # @!attribute [rw] float_ranges + # @return [::Array<::Google::Cloud::VisionAI::V1::FloatRange>] + # Float range values. + class FloatRangeArray + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Datetime range type. + # @!attribute [rw] start + # @return [::Google::Type::DateTime] + # Start date time. + # @!attribute [rw] end + # @return [::Google::Type::DateTime] + # End data time. + class DateTimeRange + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A list of datetime range values. + # @!attribute [rw] date_time_ranges + # @return [::Array<::Google::Cloud::VisionAI::V1::DateTimeRange>] + # Date time ranges. + class DateTimeRangeArray + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Representation of a circle area. + # @!attribute [rw] latitude + # @return [::Float] + # Latitude of circle area's center. Degrees [-90 .. 90] + # @!attribute [rw] longitude + # @return [::Float] + # Longitude of circle area's center. Degrees [-180 .. 180] + # @!attribute [rw] radius_meter + # @return [::Float] + # Radius of the circle area in meters. + class CircleArea + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A list of locations. + # @!attribute [rw] circle_areas + # @return [::Array<::Google::Cloud::VisionAI::V1::CircleArea>] + # A list of circle areas. + class GeoLocationArray + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] value + # @return [::Boolean] + class BoolValue + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Filter criteria applied to current search results. + # @!attribute [rw] text_array + # @return [::Google::Cloud::VisionAI::V1::StringArray] + # The text values associated with the field. + # + # Note: The following fields are mutually exclusive: `text_array`, `int_range_array`, `float_range_array`, `date_time_range_array`, `geo_location_array`, `bool_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] int_range_array + # @return [::Google::Cloud::VisionAI::V1::IntRangeArray] + # The integer ranges associated with the field. + # + # Note: The following fields are mutually exclusive: `int_range_array`, `text_array`, `float_range_array`, `date_time_range_array`, `geo_location_array`, `bool_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] float_range_array + # @return [::Google::Cloud::VisionAI::V1::FloatRangeArray] + # The float ranges associated with the field. + # + # Note: The following fields are mutually exclusive: `float_range_array`, `text_array`, `int_range_array`, `date_time_range_array`, `geo_location_array`, `bool_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] date_time_range_array + # @return [::Google::Cloud::VisionAI::V1::DateTimeRangeArray] + # The datetime ranges associated with the field. + # + # Note: The following fields are mutually exclusive: `date_time_range_array`, `text_array`, `int_range_array`, `float_range_array`, `geo_location_array`, `bool_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] geo_location_array + # @return [::Google::Cloud::VisionAI::V1::GeoLocationArray] + # Geo Location array. + # + # Note: The following fields are mutually exclusive: `geo_location_array`, `text_array`, `int_range_array`, `float_range_array`, `date_time_range_array`, `bool_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] bool_value + # @return [::Google::Cloud::VisionAI::V1::BoolValue] + # A Boolean value. + # + # Note: The following fields are mutually exclusive: `bool_value`, `text_array`, `int_range_array`, `float_range_array`, `date_time_range_array`, `geo_location_array`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] field + # @return [::String] + # The UGA field or ML field to apply filtering criteria. + # @!attribute [rw] fetch_matched_annotations + # @return [::Boolean] + # If true, return query matched annotations for this criteria. + # This option is only applicable for inclusion criteria, i.e., not exclusion + # criteria, with partition level annotations. It supports the following data + # types: + # - INTEGER + # - FLOAT + # - STRING (DataSchema.SearchStrategy.EXACT_SEARCH only) + # - BOOLEAN + class Criteria + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Partition to specify the partition in time and space for sub-asset level + # annotation. + # @!attribute [rw] temporal_partition + # @return [::Google::Cloud::VisionAI::V1::Partition::TemporalPartition] + # Partition of asset in time. + # @!attribute [rw] spatial_partition + # @return [::Google::Cloud::VisionAI::V1::Partition::SpatialPartition] + # Partition of asset in space. + # @!attribute [rw] relative_temporal_partition + # @return [::Google::Cloud::VisionAI::V1::Partition::RelativeTemporalPartition] + # Partition of asset in time. + class Partition + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Partition of asset in UTC Epoch time. Supported by STREAM_VIDEO corpus + # type. + # @!attribute [rw] start_time + # @return [::Google::Protobuf::Timestamp] + # Start time of the partition. + # @!attribute [rw] end_time + # @return [::Google::Protobuf::Timestamp] + # End time of the partition. + class TemporalPartition + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Partition of asset in space. + # @!attribute [rw] x_min + # @return [::Integer] + # The minimum x coordinate value. + # @!attribute [rw] y_min + # @return [::Integer] + # The minimum y coordinate value. + # @!attribute [rw] x_max + # @return [::Integer] + # The maximum x coordinate value. + # @!attribute [rw] y_max + # @return [::Integer] + # The maximum y coordinate value. + class SpatialPartition + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Partition of asset in relative time. Supported by VIDEO_ON_DEMAND corpus + # type. + # @!attribute [rw] start_offset + # @return [::Google::Protobuf::Duration] + # Start time offset of the partition. + # @!attribute [rw] end_offset + # @return [::Google::Protobuf::Duration] + # End time offset of the partition. + class RelativeTemporalPartition + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Different types for a facet bucket. + module FacetBucketType + # Unspecified type. + FACET_BUCKET_TYPE_UNSPECIFIED = 0 + + # Value type. + FACET_BUCKET_TYPE_VALUE = 1 + + # Datetime type. + FACET_BUCKET_TYPE_DATETIME = 2 + + # Fixed Range type. + FACET_BUCKET_TYPE_FIXED_RANGE = 3 + + # Custom Range type. + FACET_BUCKET_TYPE_CUSTOM_RANGE = 4 + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/proto_docs/google/longrunning/operations.rb b/owl-bot-staging/google-cloud-vision_ai-v1/proto_docs/google/longrunning/operations.rb new file mode 100644 index 000000000000..7a757f512165 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-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-vision_ai-v1/proto_docs/google/protobuf/any.rb b/owl-bot-staging/google-cloud-vision_ai-v1/proto_docs/google/protobuf/any.rb new file mode 100644 index 000000000000..58691995f02e --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-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-vision_ai-v1/proto_docs/google/protobuf/duration.rb b/owl-bot-staging/google-cloud-vision_ai-v1/proto_docs/google/protobuf/duration.rb new file mode 100644 index 000000000000..ea59f1f91daf --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-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-vision_ai-v1/proto_docs/google/protobuf/empty.rb b/owl-bot-staging/google-cloud-vision_ai-v1/proto_docs/google/protobuf/empty.rb new file mode 100644 index 000000000000..83e4481834a6 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-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-vision_ai-v1/proto_docs/google/protobuf/field_mask.rb b/owl-bot-staging/google-cloud-vision_ai-v1/proto_docs/google/protobuf/field_mask.rb new file mode 100644 index 000000000000..7f3ffc78601a --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-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-vision_ai-v1/proto_docs/google/protobuf/struct.rb b/owl-bot-staging/google-cloud-vision_ai-v1/proto_docs/google/protobuf/struct.rb new file mode 100644 index 000000000000..39e1aca868d2 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/proto_docs/google/protobuf/struct.rb @@ -0,0 +1,108 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 + # `Struct` represents a structured data value, consisting of fields + # which map to dynamically typed values. In some languages, `Struct` + # might be supported by a native representation. For example, in + # scripting languages like JS a struct is represented as an + # object. The details of that representation are described together + # with the proto support for the language. + # + # The JSON representation for `Struct` is JSON object. + # @!attribute [rw] fields + # @return [::Google::Protobuf::Map{::String => ::Google::Protobuf::Value}] + # Unordered map of dynamically typed values. + class Struct + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::Google::Protobuf::Value] + class FieldsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # `Value` represents a dynamically typed value which can be either + # null, a number, a string, a boolean, a recursive struct value, or a + # list of values. A producer of value is expected to set one of these + # variants. Absence of any variant indicates an error. + # + # The JSON representation for `Value` is JSON value. + # @!attribute [rw] null_value + # @return [::Google::Protobuf::NullValue] + # Represents a null value. + # + # Note: The following fields are mutually exclusive: `null_value`, `number_value`, `string_value`, `bool_value`, `struct_value`, `list_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] number_value + # @return [::Float] + # Represents a double value. + # + # Note: The following fields are mutually exclusive: `number_value`, `null_value`, `string_value`, `bool_value`, `struct_value`, `list_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] string_value + # @return [::String] + # Represents a string value. + # + # Note: The following fields are mutually exclusive: `string_value`, `null_value`, `number_value`, `bool_value`, `struct_value`, `list_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] bool_value + # @return [::Boolean] + # Represents a boolean value. + # + # Note: The following fields are mutually exclusive: `bool_value`, `null_value`, `number_value`, `string_value`, `struct_value`, `list_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] struct_value + # @return [::Google::Protobuf::Struct] + # Represents a structured value. + # + # Note: The following fields are mutually exclusive: `struct_value`, `null_value`, `number_value`, `string_value`, `bool_value`, `list_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] list_value + # @return [::Google::Protobuf::ListValue] + # Represents a repeated `Value`. + # + # Note: The following fields are mutually exclusive: `list_value`, `null_value`, `number_value`, `string_value`, `bool_value`, `struct_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. + class Value + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `ListValue` is a wrapper around a repeated field of values. + # + # The JSON representation for `ListValue` is JSON array. + # @!attribute [rw] values + # @return [::Array<::Google::Protobuf::Value>] + # Repeated field of dynamically typed values. + class ListValue + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `NullValue` is a singleton enumeration to represent the null value for the + # `Value` type union. + # + # The JSON representation for `NullValue` is JSON `null`. + module NullValue + # Null value. + NULL_VALUE = 0 + end + end +end diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/proto_docs/google/protobuf/timestamp.rb b/owl-bot-staging/google-cloud-vision_ai-v1/proto_docs/google/protobuf/timestamp.rb new file mode 100644 index 000000000000..74352be9c58c --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-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-vision_ai-v1/proto_docs/google/rpc/status.rb b/owl-bot-staging/google-cloud-vision_ai-v1/proto_docs/google/rpc/status.rb new file mode 100644 index 000000000000..c1a1c07eb2db --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-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-vision_ai-v1/proto_docs/google/type/datetime.rb b/owl-bot-staging/google-cloud-vision_ai-v1/proto_docs/google/type/datetime.rb new file mode 100644 index 000000000000..10625864f3dd --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/proto_docs/google/type/datetime.rb @@ -0,0 +1,104 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 civil time (or occasionally physical time). + # + # This type can represent a civil time in one of a few possible ways: + # + # * When utc_offset is set and time_zone is unset: a civil time on a calendar + # day with a particular offset from UTC. + # * When time_zone is set and utc_offset is unset: a civil time on a calendar + # day in a particular time zone. + # * When neither time_zone nor utc_offset is set: a civil time on a calendar + # day in local time. + # + # The date is relative to the Proleptic Gregorian Calendar. + # + # If year, month, or day are 0, the DateTime is considered not to have a + # specific year, month, or day respectively. + # + # This type may also be used to represent a physical time if all the date and + # time fields are set and either case of the `time_offset` oneof is set. + # Consider using `Timestamp` message for physical time instead. If your use + # case also would like to store the user's timezone, that can be done in + # another field. + # + # This type is more flexible than some applications may want. Make sure to + # document and validate your application's limitations. + # @!attribute [rw] year + # @return [::Integer] + # Optional. Year of date. Must be from 1 to 9999, or 0 if specifying a + # datetime without a year. + # @!attribute [rw] month + # @return [::Integer] + # Optional. Month of year. Must be from 1 to 12, or 0 if specifying a + # datetime without a month. + # @!attribute [rw] day + # @return [::Integer] + # Optional. Day of month. Must be from 1 to 31 and valid for the year and + # month, or 0 if specifying a datetime without a day. + # @!attribute [rw] hours + # @return [::Integer] + # Optional. Hours of day in 24 hour format. Should be from 0 to 23, defaults + # to 0 (midnight). An API may choose to allow the value "24:00:00" for + # scenarios like business closing time. + # @!attribute [rw] minutes + # @return [::Integer] + # Optional. Minutes of hour of day. Must be from 0 to 59, defaults to 0. + # @!attribute [rw] seconds + # @return [::Integer] + # Optional. Seconds of minutes of the time. Must normally be from 0 to 59, + # defaults to 0. An API may allow the value 60 if it allows leap-seconds. + # @!attribute [rw] nanos + # @return [::Integer] + # Optional. Fractions of seconds in nanoseconds. Must be from 0 to + # 999,999,999, defaults to 0. + # @!attribute [rw] utc_offset + # @return [::Google::Protobuf::Duration] + # UTC offset. Must be whole seconds, between -18 hours and +18 hours. + # For example, a UTC offset of -4:00 would be represented as + # { seconds: -14400 }. + # + # Note: The following fields are mutually exclusive: `utc_offset`, `time_zone`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] time_zone + # @return [::Google::Type::TimeZone] + # Time zone. + # + # Note: The following fields are mutually exclusive: `time_zone`, `utc_offset`. If a field in that set is populated, all other fields in the set will automatically be cleared. + class DateTime + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Represents a time zone from the + # [IANA Time Zone Database](https://www.iana.org/time-zones). + # @!attribute [rw] id + # @return [::String] + # IANA Time Zone Database time zone. For example "America/New_York". + # @!attribute [rw] version + # @return [::String] + # Optional. IANA Time Zone Database version number. For example "2019a". + class TimeZone + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/proto_docs/google/type/expr.rb b/owl-bot-staging/google-cloud-vision_ai-v1/proto_docs/google/type/expr.rb new file mode 100644 index 000000000000..53e7733b6592 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-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-vision_ai-v1/snippets/Gemfile b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/Gemfile new file mode 100644 index 000000000000..1f7273bfe476 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-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-vision_ai-v1", path: "../" +else + gem "google-cloud-vision_ai-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-vision_ai-v1/snippets/app_platform/add_application_stream_input.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/app_platform/add_application_stream_input.rb new file mode 100644 index 000000000000..cff2b1ac2448 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/app_platform/add_application_stream_input.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 visionai_v1_generated_AppPlatform_AddApplicationStreamInput_sync] +require "google/cloud/vision_ai/v1" + +## +# Snippet for the add_application_stream_input call in the AppPlatform 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::VisionAI::V1::AppPlatform::Client#add_application_stream_input. +# +def add_application_stream_input + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VisionAI::V1::AppPlatform::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VisionAI::V1::AddApplicationStreamInputRequest.new + + # Call the add_application_stream_input method. + result = client.add_application_stream_input 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 visionai_v1_generated_AppPlatform_AddApplicationStreamInput_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/app_platform/create_application.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/app_platform/create_application.rb new file mode 100644 index 000000000000..47a03d65deff --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/app_platform/create_application.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 visionai_v1_generated_AppPlatform_CreateApplication_sync] +require "google/cloud/vision_ai/v1" + +## +# Snippet for the create_application call in the AppPlatform 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::VisionAI::V1::AppPlatform::Client#create_application. +# +def create_application + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VisionAI::V1::AppPlatform::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VisionAI::V1::CreateApplicationRequest.new + + # Call the create_application method. + result = client.create_application 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 visionai_v1_generated_AppPlatform_CreateApplication_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/app_platform/create_application_instances.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/app_platform/create_application_instances.rb new file mode 100644 index 000000000000..70281108dc39 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/app_platform/create_application_instances.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 visionai_v1_generated_AppPlatform_CreateApplicationInstances_sync] +require "google/cloud/vision_ai/v1" + +## +# Snippet for the create_application_instances call in the AppPlatform 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::VisionAI::V1::AppPlatform::Client#create_application_instances. +# +def create_application_instances + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VisionAI::V1::AppPlatform::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VisionAI::V1::CreateApplicationInstancesRequest.new + + # Call the create_application_instances method. + result = client.create_application_instances 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 visionai_v1_generated_AppPlatform_CreateApplicationInstances_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/app_platform/create_draft.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/app_platform/create_draft.rb new file mode 100644 index 000000000000..f1bdc48ea055 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/app_platform/create_draft.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 visionai_v1_generated_AppPlatform_CreateDraft_sync] +require "google/cloud/vision_ai/v1" + +## +# Snippet for the create_draft call in the AppPlatform 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::VisionAI::V1::AppPlatform::Client#create_draft. +# +def create_draft + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VisionAI::V1::AppPlatform::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VisionAI::V1::CreateDraftRequest.new + + # Call the create_draft method. + result = client.create_draft 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 visionai_v1_generated_AppPlatform_CreateDraft_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/app_platform/create_processor.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/app_platform/create_processor.rb new file mode 100644 index 000000000000..3eb4005576c6 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/app_platform/create_processor.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 visionai_v1_generated_AppPlatform_CreateProcessor_sync] +require "google/cloud/vision_ai/v1" + +## +# Snippet for the create_processor call in the AppPlatform 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::VisionAI::V1::AppPlatform::Client#create_processor. +# +def create_processor + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VisionAI::V1::AppPlatform::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VisionAI::V1::CreateProcessorRequest.new + + # Call the create_processor method. + result = client.create_processor 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 visionai_v1_generated_AppPlatform_CreateProcessor_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/app_platform/delete_application.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/app_platform/delete_application.rb new file mode 100644 index 000000000000..a48b8c9beaf1 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/app_platform/delete_application.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 visionai_v1_generated_AppPlatform_DeleteApplication_sync] +require "google/cloud/vision_ai/v1" + +## +# Snippet for the delete_application call in the AppPlatform 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::VisionAI::V1::AppPlatform::Client#delete_application. +# +def delete_application + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VisionAI::V1::AppPlatform::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VisionAI::V1::DeleteApplicationRequest.new + + # Call the delete_application method. + result = client.delete_application 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 visionai_v1_generated_AppPlatform_DeleteApplication_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/app_platform/delete_application_instances.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/app_platform/delete_application_instances.rb new file mode 100644 index 000000000000..e39663a160eb --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/app_platform/delete_application_instances.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 visionai_v1_generated_AppPlatform_DeleteApplicationInstances_sync] +require "google/cloud/vision_ai/v1" + +## +# Snippet for the delete_application_instances call in the AppPlatform 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::VisionAI::V1::AppPlatform::Client#delete_application_instances. +# +def delete_application_instances + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VisionAI::V1::AppPlatform::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VisionAI::V1::DeleteApplicationInstancesRequest.new + + # Call the delete_application_instances method. + result = client.delete_application_instances 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 visionai_v1_generated_AppPlatform_DeleteApplicationInstances_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/app_platform/delete_draft.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/app_platform/delete_draft.rb new file mode 100644 index 000000000000..c4283f226e3a --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/app_platform/delete_draft.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 visionai_v1_generated_AppPlatform_DeleteDraft_sync] +require "google/cloud/vision_ai/v1" + +## +# Snippet for the delete_draft call in the AppPlatform 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::VisionAI::V1::AppPlatform::Client#delete_draft. +# +def delete_draft + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VisionAI::V1::AppPlatform::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VisionAI::V1::DeleteDraftRequest.new + + # Call the delete_draft method. + result = client.delete_draft 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 visionai_v1_generated_AppPlatform_DeleteDraft_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/app_platform/delete_processor.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/app_platform/delete_processor.rb new file mode 100644 index 000000000000..5e1a1ac02268 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/app_platform/delete_processor.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 visionai_v1_generated_AppPlatform_DeleteProcessor_sync] +require "google/cloud/vision_ai/v1" + +## +# Snippet for the delete_processor call in the AppPlatform 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::VisionAI::V1::AppPlatform::Client#delete_processor. +# +def delete_processor + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VisionAI::V1::AppPlatform::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VisionAI::V1::DeleteProcessorRequest.new + + # Call the delete_processor method. + result = client.delete_processor 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 visionai_v1_generated_AppPlatform_DeleteProcessor_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/app_platform/deploy_application.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/app_platform/deploy_application.rb new file mode 100644 index 000000000000..b7f83b961a53 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/app_platform/deploy_application.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 visionai_v1_generated_AppPlatform_DeployApplication_sync] +require "google/cloud/vision_ai/v1" + +## +# Snippet for the deploy_application call in the AppPlatform 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::VisionAI::V1::AppPlatform::Client#deploy_application. +# +def deploy_application + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VisionAI::V1::AppPlatform::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VisionAI::V1::DeployApplicationRequest.new + + # Call the deploy_application method. + result = client.deploy_application 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 visionai_v1_generated_AppPlatform_DeployApplication_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/app_platform/get_application.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/app_platform/get_application.rb new file mode 100644 index 000000000000..8f041c313f10 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/app_platform/get_application.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 visionai_v1_generated_AppPlatform_GetApplication_sync] +require "google/cloud/vision_ai/v1" + +## +# Snippet for the get_application call in the AppPlatform 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::VisionAI::V1::AppPlatform::Client#get_application. +# +def get_application + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VisionAI::V1::AppPlatform::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VisionAI::V1::GetApplicationRequest.new + + # Call the get_application method. + result = client.get_application request + + # The returned object is of type Google::Cloud::VisionAI::V1::Application. + p result +end +# [END visionai_v1_generated_AppPlatform_GetApplication_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/app_platform/get_draft.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/app_platform/get_draft.rb new file mode 100644 index 000000000000..cc311a561e07 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/app_platform/get_draft.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 visionai_v1_generated_AppPlatform_GetDraft_sync] +require "google/cloud/vision_ai/v1" + +## +# Snippet for the get_draft call in the AppPlatform 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::VisionAI::V1::AppPlatform::Client#get_draft. +# +def get_draft + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VisionAI::V1::AppPlatform::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VisionAI::V1::GetDraftRequest.new + + # Call the get_draft method. + result = client.get_draft request + + # The returned object is of type Google::Cloud::VisionAI::V1::Draft. + p result +end +# [END visionai_v1_generated_AppPlatform_GetDraft_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/app_platform/get_instance.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/app_platform/get_instance.rb new file mode 100644 index 000000000000..759c4abd1259 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/app_platform/get_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 visionai_v1_generated_AppPlatform_GetInstance_sync] +require "google/cloud/vision_ai/v1" + +## +# Snippet for the get_instance call in the AppPlatform 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::VisionAI::V1::AppPlatform::Client#get_instance. +# +def get_instance + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VisionAI::V1::AppPlatform::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VisionAI::V1::GetInstanceRequest.new + + # Call the get_instance method. + result = client.get_instance request + + # The returned object is of type Google::Cloud::VisionAI::V1::Instance. + p result +end +# [END visionai_v1_generated_AppPlatform_GetInstance_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/app_platform/get_processor.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/app_platform/get_processor.rb new file mode 100644 index 000000000000..c7df60a5fb04 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/app_platform/get_processor.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 visionai_v1_generated_AppPlatform_GetProcessor_sync] +require "google/cloud/vision_ai/v1" + +## +# Snippet for the get_processor call in the AppPlatform 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::VisionAI::V1::AppPlatform::Client#get_processor. +# +def get_processor + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VisionAI::V1::AppPlatform::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VisionAI::V1::GetProcessorRequest.new + + # Call the get_processor method. + result = client.get_processor request + + # The returned object is of type Google::Cloud::VisionAI::V1::Processor. + p result +end +# [END visionai_v1_generated_AppPlatform_GetProcessor_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/app_platform/list_applications.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/app_platform/list_applications.rb new file mode 100644 index 000000000000..4fa1147ffe1a --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/app_platform/list_applications.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 visionai_v1_generated_AppPlatform_ListApplications_sync] +require "google/cloud/vision_ai/v1" + +## +# Snippet for the list_applications call in the AppPlatform 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::VisionAI::V1::AppPlatform::Client#list_applications. +# +def list_applications + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VisionAI::V1::AppPlatform::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VisionAI::V1::ListApplicationsRequest.new + + # Call the list_applications method. + result = client.list_applications 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::VisionAI::V1::Application. + p item + end +end +# [END visionai_v1_generated_AppPlatform_ListApplications_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/app_platform/list_drafts.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/app_platform/list_drafts.rb new file mode 100644 index 000000000000..948d4d4686ae --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/app_platform/list_drafts.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 visionai_v1_generated_AppPlatform_ListDrafts_sync] +require "google/cloud/vision_ai/v1" + +## +# Snippet for the list_drafts call in the AppPlatform 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::VisionAI::V1::AppPlatform::Client#list_drafts. +# +def list_drafts + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VisionAI::V1::AppPlatform::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VisionAI::V1::ListDraftsRequest.new + + # Call the list_drafts method. + result = client.list_drafts 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::VisionAI::V1::Draft. + p item + end +end +# [END visionai_v1_generated_AppPlatform_ListDrafts_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/app_platform/list_instances.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/app_platform/list_instances.rb new file mode 100644 index 000000000000..ad30667c2e29 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/app_platform/list_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 visionai_v1_generated_AppPlatform_ListInstances_sync] +require "google/cloud/vision_ai/v1" + +## +# Snippet for the list_instances call in the AppPlatform 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::VisionAI::V1::AppPlatform::Client#list_instances. +# +def list_instances + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VisionAI::V1::AppPlatform::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VisionAI::V1::ListInstancesRequest.new + + # Call the list_instances method. + result = client.list_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::VisionAI::V1::Instance. + p item + end +end +# [END visionai_v1_generated_AppPlatform_ListInstances_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/app_platform/list_prebuilt_processors.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/app_platform/list_prebuilt_processors.rb new file mode 100644 index 000000000000..ee3949fa6b38 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/app_platform/list_prebuilt_processors.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 visionai_v1_generated_AppPlatform_ListPrebuiltProcessors_sync] +require "google/cloud/vision_ai/v1" + +## +# Snippet for the list_prebuilt_processors call in the AppPlatform 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::VisionAI::V1::AppPlatform::Client#list_prebuilt_processors. +# +def list_prebuilt_processors + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VisionAI::V1::AppPlatform::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VisionAI::V1::ListPrebuiltProcessorsRequest.new + + # Call the list_prebuilt_processors method. + result = client.list_prebuilt_processors request + + # The returned object is of type Google::Cloud::VisionAI::V1::ListPrebuiltProcessorsResponse. + p result +end +# [END visionai_v1_generated_AppPlatform_ListPrebuiltProcessors_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/app_platform/list_processors.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/app_platform/list_processors.rb new file mode 100644 index 000000000000..f99a9b7a8370 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/app_platform/list_processors.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 visionai_v1_generated_AppPlatform_ListProcessors_sync] +require "google/cloud/vision_ai/v1" + +## +# Snippet for the list_processors call in the AppPlatform 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::VisionAI::V1::AppPlatform::Client#list_processors. +# +def list_processors + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VisionAI::V1::AppPlatform::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VisionAI::V1::ListProcessorsRequest.new + + # Call the list_processors method. + result = client.list_processors 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::VisionAI::V1::Processor. + p item + end +end +# [END visionai_v1_generated_AppPlatform_ListProcessors_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/app_platform/remove_application_stream_input.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/app_platform/remove_application_stream_input.rb new file mode 100644 index 000000000000..7bd4748965f5 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/app_platform/remove_application_stream_input.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 visionai_v1_generated_AppPlatform_RemoveApplicationStreamInput_sync] +require "google/cloud/vision_ai/v1" + +## +# Snippet for the remove_application_stream_input call in the AppPlatform 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::VisionAI::V1::AppPlatform::Client#remove_application_stream_input. +# +def remove_application_stream_input + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VisionAI::V1::AppPlatform::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VisionAI::V1::RemoveApplicationStreamInputRequest.new + + # Call the remove_application_stream_input method. + result = client.remove_application_stream_input 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 visionai_v1_generated_AppPlatform_RemoveApplicationStreamInput_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/app_platform/undeploy_application.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/app_platform/undeploy_application.rb new file mode 100644 index 000000000000..9203bb582196 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/app_platform/undeploy_application.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 visionai_v1_generated_AppPlatform_UndeployApplication_sync] +require "google/cloud/vision_ai/v1" + +## +# Snippet for the undeploy_application call in the AppPlatform 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::VisionAI::V1::AppPlatform::Client#undeploy_application. +# +def undeploy_application + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VisionAI::V1::AppPlatform::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VisionAI::V1::UndeployApplicationRequest.new + + # Call the undeploy_application method. + result = client.undeploy_application 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 visionai_v1_generated_AppPlatform_UndeployApplication_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/app_platform/update_application.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/app_platform/update_application.rb new file mode 100644 index 000000000000..33cdcaa705a3 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/app_platform/update_application.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 visionai_v1_generated_AppPlatform_UpdateApplication_sync] +require "google/cloud/vision_ai/v1" + +## +# Snippet for the update_application call in the AppPlatform 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::VisionAI::V1::AppPlatform::Client#update_application. +# +def update_application + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VisionAI::V1::AppPlatform::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VisionAI::V1::UpdateApplicationRequest.new + + # Call the update_application method. + result = client.update_application 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 visionai_v1_generated_AppPlatform_UpdateApplication_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/app_platform/update_application_instances.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/app_platform/update_application_instances.rb new file mode 100644 index 000000000000..de9dbf28977d --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/app_platform/update_application_instances.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 visionai_v1_generated_AppPlatform_UpdateApplicationInstances_sync] +require "google/cloud/vision_ai/v1" + +## +# Snippet for the update_application_instances call in the AppPlatform 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::VisionAI::V1::AppPlatform::Client#update_application_instances. +# +def update_application_instances + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VisionAI::V1::AppPlatform::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VisionAI::V1::UpdateApplicationInstancesRequest.new + + # Call the update_application_instances method. + result = client.update_application_instances 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 visionai_v1_generated_AppPlatform_UpdateApplicationInstances_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/app_platform/update_application_stream_input.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/app_platform/update_application_stream_input.rb new file mode 100644 index 000000000000..299de2b97c72 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/app_platform/update_application_stream_input.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 visionai_v1_generated_AppPlatform_UpdateApplicationStreamInput_sync] +require "google/cloud/vision_ai/v1" + +## +# Snippet for the update_application_stream_input call in the AppPlatform 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::VisionAI::V1::AppPlatform::Client#update_application_stream_input. +# +def update_application_stream_input + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VisionAI::V1::AppPlatform::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VisionAI::V1::UpdateApplicationStreamInputRequest.new + + # Call the update_application_stream_input method. + result = client.update_application_stream_input 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 visionai_v1_generated_AppPlatform_UpdateApplicationStreamInput_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/app_platform/update_draft.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/app_platform/update_draft.rb new file mode 100644 index 000000000000..079460e32a6f --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/app_platform/update_draft.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 visionai_v1_generated_AppPlatform_UpdateDraft_sync] +require "google/cloud/vision_ai/v1" + +## +# Snippet for the update_draft call in the AppPlatform 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::VisionAI::V1::AppPlatform::Client#update_draft. +# +def update_draft + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VisionAI::V1::AppPlatform::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VisionAI::V1::UpdateDraftRequest.new + + # Call the update_draft method. + result = client.update_draft 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 visionai_v1_generated_AppPlatform_UpdateDraft_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/app_platform/update_processor.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/app_platform/update_processor.rb new file mode 100644 index 000000000000..e4176ac23ed3 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/app_platform/update_processor.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 visionai_v1_generated_AppPlatform_UpdateProcessor_sync] +require "google/cloud/vision_ai/v1" + +## +# Snippet for the update_processor call in the AppPlatform 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::VisionAI::V1::AppPlatform::Client#update_processor. +# +def update_processor + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VisionAI::V1::AppPlatform::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VisionAI::V1::UpdateProcessorRequest.new + + # Call the update_processor method. + result = client.update_processor 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 visionai_v1_generated_AppPlatform_UpdateProcessor_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/health_check_service/health_check.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/health_check_service/health_check.rb new file mode 100644 index 000000000000..d64d81bbd491 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/health_check_service/health_check.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 visionai_v1_generated_HealthCheckService_HealthCheck_sync] +require "google/cloud/vision_ai/v1" + +## +# Snippet for the health_check call in the HealthCheckService 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::VisionAI::V1::HealthCheckService::Client#health_check. +# +def health_check + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VisionAI::V1::HealthCheckService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VisionAI::V1::HealthCheckRequest.new + + # Call the health_check method. + result = client.health_check request + + # The returned object is of type Google::Cloud::VisionAI::V1::HealthCheckResponse. + p result +end +# [END visionai_v1_generated_HealthCheckService_HealthCheck_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/live_video_analytics/batch_run_process.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/live_video_analytics/batch_run_process.rb new file mode 100644 index 000000000000..aa4f4f87f202 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/live_video_analytics/batch_run_process.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 visionai_v1_generated_LiveVideoAnalytics_BatchRunProcess_sync] +require "google/cloud/vision_ai/v1" + +## +# Snippet for the batch_run_process call in the LiveVideoAnalytics 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::VisionAI::V1::LiveVideoAnalytics::Client#batch_run_process. +# +def batch_run_process + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VisionAI::V1::BatchRunProcessRequest.new + + # Call the batch_run_process method. + result = client.batch_run_process 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 visionai_v1_generated_LiveVideoAnalytics_BatchRunProcess_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/live_video_analytics/create_analysis.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/live_video_analytics/create_analysis.rb new file mode 100644 index 000000000000..f7f1700eb4d3 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/live_video_analytics/create_analysis.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 visionai_v1_generated_LiveVideoAnalytics_CreateAnalysis_sync] +require "google/cloud/vision_ai/v1" + +## +# Snippet for the create_analysis call in the LiveVideoAnalytics 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::VisionAI::V1::LiveVideoAnalytics::Client#create_analysis. +# +def create_analysis + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VisionAI::V1::CreateAnalysisRequest.new + + # Call the create_analysis method. + result = client.create_analysis 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 visionai_v1_generated_LiveVideoAnalytics_CreateAnalysis_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/live_video_analytics/create_operator.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/live_video_analytics/create_operator.rb new file mode 100644 index 000000000000..94fe9a947e9f --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/live_video_analytics/create_operator.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 visionai_v1_generated_LiveVideoAnalytics_CreateOperator_sync] +require "google/cloud/vision_ai/v1" + +## +# Snippet for the create_operator call in the LiveVideoAnalytics 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::VisionAI::V1::LiveVideoAnalytics::Client#create_operator. +# +def create_operator + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VisionAI::V1::CreateOperatorRequest.new + + # Call the create_operator method. + result = client.create_operator 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 visionai_v1_generated_LiveVideoAnalytics_CreateOperator_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/live_video_analytics/create_process.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/live_video_analytics/create_process.rb new file mode 100644 index 000000000000..08deac783fa3 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/live_video_analytics/create_process.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 visionai_v1_generated_LiveVideoAnalytics_CreateProcess_sync] +require "google/cloud/vision_ai/v1" + +## +# Snippet for the create_process call in the LiveVideoAnalytics 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::VisionAI::V1::LiveVideoAnalytics::Client#create_process. +# +def create_process + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VisionAI::V1::CreateProcessRequest.new + + # Call the create_process method. + result = client.create_process 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 visionai_v1_generated_LiveVideoAnalytics_CreateProcess_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/live_video_analytics/delete_analysis.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/live_video_analytics/delete_analysis.rb new file mode 100644 index 000000000000..adbcedb7a095 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/live_video_analytics/delete_analysis.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 visionai_v1_generated_LiveVideoAnalytics_DeleteAnalysis_sync] +require "google/cloud/vision_ai/v1" + +## +# Snippet for the delete_analysis call in the LiveVideoAnalytics 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::VisionAI::V1::LiveVideoAnalytics::Client#delete_analysis. +# +def delete_analysis + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VisionAI::V1::DeleteAnalysisRequest.new + + # Call the delete_analysis method. + result = client.delete_analysis 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 visionai_v1_generated_LiveVideoAnalytics_DeleteAnalysis_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/live_video_analytics/delete_operator.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/live_video_analytics/delete_operator.rb new file mode 100644 index 000000000000..553cc77ca231 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/live_video_analytics/delete_operator.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 visionai_v1_generated_LiveVideoAnalytics_DeleteOperator_sync] +require "google/cloud/vision_ai/v1" + +## +# Snippet for the delete_operator call in the LiveVideoAnalytics 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::VisionAI::V1::LiveVideoAnalytics::Client#delete_operator. +# +def delete_operator + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VisionAI::V1::DeleteOperatorRequest.new + + # Call the delete_operator method. + result = client.delete_operator 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 visionai_v1_generated_LiveVideoAnalytics_DeleteOperator_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/live_video_analytics/delete_process.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/live_video_analytics/delete_process.rb new file mode 100644 index 000000000000..d60508365caa --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/live_video_analytics/delete_process.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 visionai_v1_generated_LiveVideoAnalytics_DeleteProcess_sync] +require "google/cloud/vision_ai/v1" + +## +# Snippet for the delete_process call in the LiveVideoAnalytics 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::VisionAI::V1::LiveVideoAnalytics::Client#delete_process. +# +def delete_process + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VisionAI::V1::DeleteProcessRequest.new + + # Call the delete_process method. + result = client.delete_process 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 visionai_v1_generated_LiveVideoAnalytics_DeleteProcess_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/live_video_analytics/get_analysis.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/live_video_analytics/get_analysis.rb new file mode 100644 index 000000000000..6fc2ed9e371f --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/live_video_analytics/get_analysis.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 visionai_v1_generated_LiveVideoAnalytics_GetAnalysis_sync] +require "google/cloud/vision_ai/v1" + +## +# Snippet for the get_analysis call in the LiveVideoAnalytics 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::VisionAI::V1::LiveVideoAnalytics::Client#get_analysis. +# +def get_analysis + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VisionAI::V1::GetAnalysisRequest.new + + # Call the get_analysis method. + result = client.get_analysis request + + # The returned object is of type Google::Cloud::VisionAI::V1::Analysis. + p result +end +# [END visionai_v1_generated_LiveVideoAnalytics_GetAnalysis_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/live_video_analytics/get_operator.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/live_video_analytics/get_operator.rb new file mode 100644 index 000000000000..43482ce03fcf --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/live_video_analytics/get_operator.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 visionai_v1_generated_LiveVideoAnalytics_GetOperator_sync] +require "google/cloud/vision_ai/v1" + +## +# Snippet for the get_operator call in the LiveVideoAnalytics 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::VisionAI::V1::LiveVideoAnalytics::Client#get_operator. +# +def get_operator + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VisionAI::V1::GetOperatorRequest.new + + # Call the get_operator method. + result = client.get_operator request + + # The returned object is of type Google::Cloud::VisionAI::V1::Operator. + p result +end +# [END visionai_v1_generated_LiveVideoAnalytics_GetOperator_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/live_video_analytics/get_process.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/live_video_analytics/get_process.rb new file mode 100644 index 000000000000..762c69901bd3 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/live_video_analytics/get_process.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 visionai_v1_generated_LiveVideoAnalytics_GetProcess_sync] +require "google/cloud/vision_ai/v1" + +## +# Snippet for the get_process call in the LiveVideoAnalytics 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::VisionAI::V1::LiveVideoAnalytics::Client#get_process. +# +def get_process + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VisionAI::V1::GetProcessRequest.new + + # Call the get_process method. + result = client.get_process request + + # The returned object is of type Google::Cloud::VisionAI::V1::Process. + p result +end +# [END visionai_v1_generated_LiveVideoAnalytics_GetProcess_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/live_video_analytics/list_analyses.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/live_video_analytics/list_analyses.rb new file mode 100644 index 000000000000..2e9b43c1ea5d --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/live_video_analytics/list_analyses.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 visionai_v1_generated_LiveVideoAnalytics_ListAnalyses_sync] +require "google/cloud/vision_ai/v1" + +## +# Snippet for the list_analyses call in the LiveVideoAnalytics 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::VisionAI::V1::LiveVideoAnalytics::Client#list_analyses. +# +def list_analyses + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VisionAI::V1::ListAnalysesRequest.new + + # Call the list_analyses method. + result = client.list_analyses 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::VisionAI::V1::Analysis. + p item + end +end +# [END visionai_v1_generated_LiveVideoAnalytics_ListAnalyses_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/live_video_analytics/list_operators.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/live_video_analytics/list_operators.rb new file mode 100644 index 000000000000..4ef18f2fa64e --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/live_video_analytics/list_operators.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 visionai_v1_generated_LiveVideoAnalytics_ListOperators_sync] +require "google/cloud/vision_ai/v1" + +## +# Snippet for the list_operators call in the LiveVideoAnalytics 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::VisionAI::V1::LiveVideoAnalytics::Client#list_operators. +# +def list_operators + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VisionAI::V1::ListOperatorsRequest.new + + # Call the list_operators method. + result = client.list_operators 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::VisionAI::V1::Operator. + p item + end +end +# [END visionai_v1_generated_LiveVideoAnalytics_ListOperators_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/live_video_analytics/list_processes.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/live_video_analytics/list_processes.rb new file mode 100644 index 000000000000..ac2efe0deed8 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/live_video_analytics/list_processes.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 visionai_v1_generated_LiveVideoAnalytics_ListProcesses_sync] +require "google/cloud/vision_ai/v1" + +## +# Snippet for the list_processes call in the LiveVideoAnalytics 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::VisionAI::V1::LiveVideoAnalytics::Client#list_processes. +# +def list_processes + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VisionAI::V1::ListProcessesRequest.new + + # Call the list_processes method. + result = client.list_processes 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::VisionAI::V1::Process. + p item + end +end +# [END visionai_v1_generated_LiveVideoAnalytics_ListProcesses_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/live_video_analytics/list_public_operators.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/live_video_analytics/list_public_operators.rb new file mode 100644 index 000000000000..c5df10beff27 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/live_video_analytics/list_public_operators.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 visionai_v1_generated_LiveVideoAnalytics_ListPublicOperators_sync] +require "google/cloud/vision_ai/v1" + +## +# Snippet for the list_public_operators call in the LiveVideoAnalytics 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::VisionAI::V1::LiveVideoAnalytics::Client#list_public_operators. +# +def list_public_operators + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VisionAI::V1::ListPublicOperatorsRequest.new + + # Call the list_public_operators method. + result = client.list_public_operators 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::VisionAI::V1::Operator. + p item + end +end +# [END visionai_v1_generated_LiveVideoAnalytics_ListPublicOperators_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/live_video_analytics/resolve_operator_info.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/live_video_analytics/resolve_operator_info.rb new file mode 100644 index 000000000000..368dfd43795b --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/live_video_analytics/resolve_operator_info.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 visionai_v1_generated_LiveVideoAnalytics_ResolveOperatorInfo_sync] +require "google/cloud/vision_ai/v1" + +## +# Snippet for the resolve_operator_info call in the LiveVideoAnalytics 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::VisionAI::V1::LiveVideoAnalytics::Client#resolve_operator_info. +# +def resolve_operator_info + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VisionAI::V1::ResolveOperatorInfoRequest.new + + # Call the resolve_operator_info method. + result = client.resolve_operator_info request + + # The returned object is of type Google::Cloud::VisionAI::V1::ResolveOperatorInfoResponse. + p result +end +# [END visionai_v1_generated_LiveVideoAnalytics_ResolveOperatorInfo_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/live_video_analytics/update_analysis.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/live_video_analytics/update_analysis.rb new file mode 100644 index 000000000000..be34d28b3897 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/live_video_analytics/update_analysis.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 visionai_v1_generated_LiveVideoAnalytics_UpdateAnalysis_sync] +require "google/cloud/vision_ai/v1" + +## +# Snippet for the update_analysis call in the LiveVideoAnalytics 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::VisionAI::V1::LiveVideoAnalytics::Client#update_analysis. +# +def update_analysis + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VisionAI::V1::UpdateAnalysisRequest.new + + # Call the update_analysis method. + result = client.update_analysis 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 visionai_v1_generated_LiveVideoAnalytics_UpdateAnalysis_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/live_video_analytics/update_operator.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/live_video_analytics/update_operator.rb new file mode 100644 index 000000000000..3314af94668c --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/live_video_analytics/update_operator.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 visionai_v1_generated_LiveVideoAnalytics_UpdateOperator_sync] +require "google/cloud/vision_ai/v1" + +## +# Snippet for the update_operator call in the LiveVideoAnalytics 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::VisionAI::V1::LiveVideoAnalytics::Client#update_operator. +# +def update_operator + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VisionAI::V1::UpdateOperatorRequest.new + + # Call the update_operator method. + result = client.update_operator 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 visionai_v1_generated_LiveVideoAnalytics_UpdateOperator_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/live_video_analytics/update_process.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/live_video_analytics/update_process.rb new file mode 100644 index 000000000000..588b991e8e20 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/live_video_analytics/update_process.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 visionai_v1_generated_LiveVideoAnalytics_UpdateProcess_sync] +require "google/cloud/vision_ai/v1" + +## +# Snippet for the update_process call in the LiveVideoAnalytics 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::VisionAI::V1::LiveVideoAnalytics::Client#update_process. +# +def update_process + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VisionAI::V1::UpdateProcessRequest.new + + # Call the update_process method. + result = client.update_process 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 visionai_v1_generated_LiveVideoAnalytics_UpdateProcess_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/snippet_metadata_google.cloud.visionai.v1.json b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/snippet_metadata_google.cloud.visionai.v1.json new file mode 100644 index 000000000000..919d69b51a62 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/snippet_metadata_google.cloud.visionai.v1.json @@ -0,0 +1,5495 @@ +{ + "client_library": { + "name": "google-cloud-vision_ai-v1", + "version": "", + "language": "RUBY", + "apis": [ + { + "id": "google.cloud.visionai.v1", + "version": "v1" + } + ] + }, + "snippets": [ + { + "region_tag": "visionai_v1_generated_LiveVideoAnalytics_ListPublicOperators_sync", + "title": "Snippet for the list_public_operators call in the LiveVideoAnalytics service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client#list_public_operators.", + "file": "live_video_analytics/list_public_operators.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_public_operators", + "full_name": "::Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client#list_public_operators", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VisionAI::V1::ListPublicOperatorsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::VisionAI::V1::ListPublicOperatorsResponse", + "client": { + "short_name": "LiveVideoAnalytics::Client", + "full_name": "::Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client" + }, + "method": { + "short_name": "ListPublicOperators", + "full_name": "google.cloud.visionai.v1.LiveVideoAnalytics.ListPublicOperators", + "service": { + "short_name": "LiveVideoAnalytics", + "full_name": "google.cloud.visionai.v1.LiveVideoAnalytics" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "visionai_v1_generated_LiveVideoAnalytics_ResolveOperatorInfo_sync", + "title": "Snippet for the resolve_operator_info call in the LiveVideoAnalytics service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client#resolve_operator_info.", + "file": "live_video_analytics/resolve_operator_info.rb", + "language": "RUBY", + "client_method": { + "short_name": "resolve_operator_info", + "full_name": "::Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client#resolve_operator_info", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VisionAI::V1::ResolveOperatorInfoRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::VisionAI::V1::ResolveOperatorInfoResponse", + "client": { + "short_name": "LiveVideoAnalytics::Client", + "full_name": "::Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client" + }, + "method": { + "short_name": "ResolveOperatorInfo", + "full_name": "google.cloud.visionai.v1.LiveVideoAnalytics.ResolveOperatorInfo", + "service": { + "short_name": "LiveVideoAnalytics", + "full_name": "google.cloud.visionai.v1.LiveVideoAnalytics" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "visionai_v1_generated_LiveVideoAnalytics_ListOperators_sync", + "title": "Snippet for the list_operators call in the LiveVideoAnalytics service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client#list_operators.", + "file": "live_video_analytics/list_operators.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_operators", + "full_name": "::Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client#list_operators", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VisionAI::V1::ListOperatorsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::VisionAI::V1::ListOperatorsResponse", + "client": { + "short_name": "LiveVideoAnalytics::Client", + "full_name": "::Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client" + }, + "method": { + "short_name": "ListOperators", + "full_name": "google.cloud.visionai.v1.LiveVideoAnalytics.ListOperators", + "service": { + "short_name": "LiveVideoAnalytics", + "full_name": "google.cloud.visionai.v1.LiveVideoAnalytics" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "visionai_v1_generated_LiveVideoAnalytics_GetOperator_sync", + "title": "Snippet for the get_operator call in the LiveVideoAnalytics service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client#get_operator.", + "file": "live_video_analytics/get_operator.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_operator", + "full_name": "::Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client#get_operator", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VisionAI::V1::GetOperatorRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::VisionAI::V1::Operator", + "client": { + "short_name": "LiveVideoAnalytics::Client", + "full_name": "::Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client" + }, + "method": { + "short_name": "GetOperator", + "full_name": "google.cloud.visionai.v1.LiveVideoAnalytics.GetOperator", + "service": { + "short_name": "LiveVideoAnalytics", + "full_name": "google.cloud.visionai.v1.LiveVideoAnalytics" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "visionai_v1_generated_LiveVideoAnalytics_CreateOperator_sync", + "title": "Snippet for the create_operator call in the LiveVideoAnalytics service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client#create_operator.", + "file": "live_video_analytics/create_operator.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_operator", + "full_name": "::Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client#create_operator", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VisionAI::V1::CreateOperatorRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "LiveVideoAnalytics::Client", + "full_name": "::Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client" + }, + "method": { + "short_name": "CreateOperator", + "full_name": "google.cloud.visionai.v1.LiveVideoAnalytics.CreateOperator", + "service": { + "short_name": "LiveVideoAnalytics", + "full_name": "google.cloud.visionai.v1.LiveVideoAnalytics" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "visionai_v1_generated_LiveVideoAnalytics_UpdateOperator_sync", + "title": "Snippet for the update_operator call in the LiveVideoAnalytics service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client#update_operator.", + "file": "live_video_analytics/update_operator.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_operator", + "full_name": "::Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client#update_operator", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VisionAI::V1::UpdateOperatorRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "LiveVideoAnalytics::Client", + "full_name": "::Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client" + }, + "method": { + "short_name": "UpdateOperator", + "full_name": "google.cloud.visionai.v1.LiveVideoAnalytics.UpdateOperator", + "service": { + "short_name": "LiveVideoAnalytics", + "full_name": "google.cloud.visionai.v1.LiveVideoAnalytics" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "visionai_v1_generated_LiveVideoAnalytics_DeleteOperator_sync", + "title": "Snippet for the delete_operator call in the LiveVideoAnalytics service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client#delete_operator.", + "file": "live_video_analytics/delete_operator.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_operator", + "full_name": "::Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client#delete_operator", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VisionAI::V1::DeleteOperatorRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "LiveVideoAnalytics::Client", + "full_name": "::Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client" + }, + "method": { + "short_name": "DeleteOperator", + "full_name": "google.cloud.visionai.v1.LiveVideoAnalytics.DeleteOperator", + "service": { + "short_name": "LiveVideoAnalytics", + "full_name": "google.cloud.visionai.v1.LiveVideoAnalytics" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "visionai_v1_generated_LiveVideoAnalytics_ListAnalyses_sync", + "title": "Snippet for the list_analyses call in the LiveVideoAnalytics service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client#list_analyses.", + "file": "live_video_analytics/list_analyses.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_analyses", + "full_name": "::Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client#list_analyses", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VisionAI::V1::ListAnalysesRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::VisionAI::V1::ListAnalysesResponse", + "client": { + "short_name": "LiveVideoAnalytics::Client", + "full_name": "::Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client" + }, + "method": { + "short_name": "ListAnalyses", + "full_name": "google.cloud.visionai.v1.LiveVideoAnalytics.ListAnalyses", + "service": { + "short_name": "LiveVideoAnalytics", + "full_name": "google.cloud.visionai.v1.LiveVideoAnalytics" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "visionai_v1_generated_LiveVideoAnalytics_GetAnalysis_sync", + "title": "Snippet for the get_analysis call in the LiveVideoAnalytics service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client#get_analysis.", + "file": "live_video_analytics/get_analysis.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_analysis", + "full_name": "::Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client#get_analysis", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VisionAI::V1::GetAnalysisRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::VisionAI::V1::Analysis", + "client": { + "short_name": "LiveVideoAnalytics::Client", + "full_name": "::Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client" + }, + "method": { + "short_name": "GetAnalysis", + "full_name": "google.cloud.visionai.v1.LiveVideoAnalytics.GetAnalysis", + "service": { + "short_name": "LiveVideoAnalytics", + "full_name": "google.cloud.visionai.v1.LiveVideoAnalytics" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "visionai_v1_generated_LiveVideoAnalytics_CreateAnalysis_sync", + "title": "Snippet for the create_analysis call in the LiveVideoAnalytics service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client#create_analysis.", + "file": "live_video_analytics/create_analysis.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_analysis", + "full_name": "::Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client#create_analysis", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VisionAI::V1::CreateAnalysisRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "LiveVideoAnalytics::Client", + "full_name": "::Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client" + }, + "method": { + "short_name": "CreateAnalysis", + "full_name": "google.cloud.visionai.v1.LiveVideoAnalytics.CreateAnalysis", + "service": { + "short_name": "LiveVideoAnalytics", + "full_name": "google.cloud.visionai.v1.LiveVideoAnalytics" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "visionai_v1_generated_LiveVideoAnalytics_UpdateAnalysis_sync", + "title": "Snippet for the update_analysis call in the LiveVideoAnalytics service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client#update_analysis.", + "file": "live_video_analytics/update_analysis.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_analysis", + "full_name": "::Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client#update_analysis", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VisionAI::V1::UpdateAnalysisRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "LiveVideoAnalytics::Client", + "full_name": "::Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client" + }, + "method": { + "short_name": "UpdateAnalysis", + "full_name": "google.cloud.visionai.v1.LiveVideoAnalytics.UpdateAnalysis", + "service": { + "short_name": "LiveVideoAnalytics", + "full_name": "google.cloud.visionai.v1.LiveVideoAnalytics" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "visionai_v1_generated_LiveVideoAnalytics_DeleteAnalysis_sync", + "title": "Snippet for the delete_analysis call in the LiveVideoAnalytics service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client#delete_analysis.", + "file": "live_video_analytics/delete_analysis.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_analysis", + "full_name": "::Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client#delete_analysis", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VisionAI::V1::DeleteAnalysisRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "LiveVideoAnalytics::Client", + "full_name": "::Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client" + }, + "method": { + "short_name": "DeleteAnalysis", + "full_name": "google.cloud.visionai.v1.LiveVideoAnalytics.DeleteAnalysis", + "service": { + "short_name": "LiveVideoAnalytics", + "full_name": "google.cloud.visionai.v1.LiveVideoAnalytics" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "visionai_v1_generated_LiveVideoAnalytics_ListProcesses_sync", + "title": "Snippet for the list_processes call in the LiveVideoAnalytics service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client#list_processes.", + "file": "live_video_analytics/list_processes.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_processes", + "full_name": "::Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client#list_processes", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VisionAI::V1::ListProcessesRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::VisionAI::V1::ListProcessesResponse", + "client": { + "short_name": "LiveVideoAnalytics::Client", + "full_name": "::Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client" + }, + "method": { + "short_name": "ListProcesses", + "full_name": "google.cloud.visionai.v1.LiveVideoAnalytics.ListProcesses", + "service": { + "short_name": "LiveVideoAnalytics", + "full_name": "google.cloud.visionai.v1.LiveVideoAnalytics" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "visionai_v1_generated_LiveVideoAnalytics_GetProcess_sync", + "title": "Snippet for the get_process call in the LiveVideoAnalytics service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client#get_process.", + "file": "live_video_analytics/get_process.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_process", + "full_name": "::Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client#get_process", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VisionAI::V1::GetProcessRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::VisionAI::V1::Process", + "client": { + "short_name": "LiveVideoAnalytics::Client", + "full_name": "::Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client" + }, + "method": { + "short_name": "GetProcess", + "full_name": "google.cloud.visionai.v1.LiveVideoAnalytics.GetProcess", + "service": { + "short_name": "LiveVideoAnalytics", + "full_name": "google.cloud.visionai.v1.LiveVideoAnalytics" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "visionai_v1_generated_LiveVideoAnalytics_CreateProcess_sync", + "title": "Snippet for the create_process call in the LiveVideoAnalytics service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client#create_process.", + "file": "live_video_analytics/create_process.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_process", + "full_name": "::Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client#create_process", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VisionAI::V1::CreateProcessRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "LiveVideoAnalytics::Client", + "full_name": "::Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client" + }, + "method": { + "short_name": "CreateProcess", + "full_name": "google.cloud.visionai.v1.LiveVideoAnalytics.CreateProcess", + "service": { + "short_name": "LiveVideoAnalytics", + "full_name": "google.cloud.visionai.v1.LiveVideoAnalytics" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "visionai_v1_generated_LiveVideoAnalytics_UpdateProcess_sync", + "title": "Snippet for the update_process call in the LiveVideoAnalytics service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client#update_process.", + "file": "live_video_analytics/update_process.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_process", + "full_name": "::Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client#update_process", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VisionAI::V1::UpdateProcessRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "LiveVideoAnalytics::Client", + "full_name": "::Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client" + }, + "method": { + "short_name": "UpdateProcess", + "full_name": "google.cloud.visionai.v1.LiveVideoAnalytics.UpdateProcess", + "service": { + "short_name": "LiveVideoAnalytics", + "full_name": "google.cloud.visionai.v1.LiveVideoAnalytics" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "visionai_v1_generated_LiveVideoAnalytics_DeleteProcess_sync", + "title": "Snippet for the delete_process call in the LiveVideoAnalytics service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client#delete_process.", + "file": "live_video_analytics/delete_process.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_process", + "full_name": "::Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client#delete_process", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VisionAI::V1::DeleteProcessRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "LiveVideoAnalytics::Client", + "full_name": "::Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client" + }, + "method": { + "short_name": "DeleteProcess", + "full_name": "google.cloud.visionai.v1.LiveVideoAnalytics.DeleteProcess", + "service": { + "short_name": "LiveVideoAnalytics", + "full_name": "google.cloud.visionai.v1.LiveVideoAnalytics" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "visionai_v1_generated_LiveVideoAnalytics_BatchRunProcess_sync", + "title": "Snippet for the batch_run_process call in the LiveVideoAnalytics service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client#batch_run_process.", + "file": "live_video_analytics/batch_run_process.rb", + "language": "RUBY", + "client_method": { + "short_name": "batch_run_process", + "full_name": "::Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client#batch_run_process", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VisionAI::V1::BatchRunProcessRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "LiveVideoAnalytics::Client", + "full_name": "::Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client" + }, + "method": { + "short_name": "BatchRunProcess", + "full_name": "google.cloud.visionai.v1.LiveVideoAnalytics.BatchRunProcess", + "service": { + "short_name": "LiveVideoAnalytics", + "full_name": "google.cloud.visionai.v1.LiveVideoAnalytics" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "visionai_v1_generated_AppPlatform_ListApplications_sync", + "title": "Snippet for the list_applications call in the AppPlatform service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::AppPlatform::Client#list_applications.", + "file": "app_platform/list_applications.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_applications", + "full_name": "::Google::Cloud::VisionAI::V1::AppPlatform::Client#list_applications", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VisionAI::V1::ListApplicationsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::VisionAI::V1::ListApplicationsResponse", + "client": { + "short_name": "AppPlatform::Client", + "full_name": "::Google::Cloud::VisionAI::V1::AppPlatform::Client" + }, + "method": { + "short_name": "ListApplications", + "full_name": "google.cloud.visionai.v1.AppPlatform.ListApplications", + "service": { + "short_name": "AppPlatform", + "full_name": "google.cloud.visionai.v1.AppPlatform" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "visionai_v1_generated_AppPlatform_GetApplication_sync", + "title": "Snippet for the get_application call in the AppPlatform service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::AppPlatform::Client#get_application.", + "file": "app_platform/get_application.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_application", + "full_name": "::Google::Cloud::VisionAI::V1::AppPlatform::Client#get_application", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VisionAI::V1::GetApplicationRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::VisionAI::V1::Application", + "client": { + "short_name": "AppPlatform::Client", + "full_name": "::Google::Cloud::VisionAI::V1::AppPlatform::Client" + }, + "method": { + "short_name": "GetApplication", + "full_name": "google.cloud.visionai.v1.AppPlatform.GetApplication", + "service": { + "short_name": "AppPlatform", + "full_name": "google.cloud.visionai.v1.AppPlatform" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "visionai_v1_generated_AppPlatform_CreateApplication_sync", + "title": "Snippet for the create_application call in the AppPlatform service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::AppPlatform::Client#create_application.", + "file": "app_platform/create_application.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_application", + "full_name": "::Google::Cloud::VisionAI::V1::AppPlatform::Client#create_application", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VisionAI::V1::CreateApplicationRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "AppPlatform::Client", + "full_name": "::Google::Cloud::VisionAI::V1::AppPlatform::Client" + }, + "method": { + "short_name": "CreateApplication", + "full_name": "google.cloud.visionai.v1.AppPlatform.CreateApplication", + "service": { + "short_name": "AppPlatform", + "full_name": "google.cloud.visionai.v1.AppPlatform" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "visionai_v1_generated_AppPlatform_UpdateApplication_sync", + "title": "Snippet for the update_application call in the AppPlatform service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::AppPlatform::Client#update_application.", + "file": "app_platform/update_application.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_application", + "full_name": "::Google::Cloud::VisionAI::V1::AppPlatform::Client#update_application", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VisionAI::V1::UpdateApplicationRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "AppPlatform::Client", + "full_name": "::Google::Cloud::VisionAI::V1::AppPlatform::Client" + }, + "method": { + "short_name": "UpdateApplication", + "full_name": "google.cloud.visionai.v1.AppPlatform.UpdateApplication", + "service": { + "short_name": "AppPlatform", + "full_name": "google.cloud.visionai.v1.AppPlatform" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "visionai_v1_generated_AppPlatform_DeleteApplication_sync", + "title": "Snippet for the delete_application call in the AppPlatform service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::AppPlatform::Client#delete_application.", + "file": "app_platform/delete_application.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_application", + "full_name": "::Google::Cloud::VisionAI::V1::AppPlatform::Client#delete_application", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VisionAI::V1::DeleteApplicationRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "AppPlatform::Client", + "full_name": "::Google::Cloud::VisionAI::V1::AppPlatform::Client" + }, + "method": { + "short_name": "DeleteApplication", + "full_name": "google.cloud.visionai.v1.AppPlatform.DeleteApplication", + "service": { + "short_name": "AppPlatform", + "full_name": "google.cloud.visionai.v1.AppPlatform" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "visionai_v1_generated_AppPlatform_DeployApplication_sync", + "title": "Snippet for the deploy_application call in the AppPlatform service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::AppPlatform::Client#deploy_application.", + "file": "app_platform/deploy_application.rb", + "language": "RUBY", + "client_method": { + "short_name": "deploy_application", + "full_name": "::Google::Cloud::VisionAI::V1::AppPlatform::Client#deploy_application", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VisionAI::V1::DeployApplicationRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "AppPlatform::Client", + "full_name": "::Google::Cloud::VisionAI::V1::AppPlatform::Client" + }, + "method": { + "short_name": "DeployApplication", + "full_name": "google.cloud.visionai.v1.AppPlatform.DeployApplication", + "service": { + "short_name": "AppPlatform", + "full_name": "google.cloud.visionai.v1.AppPlatform" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "visionai_v1_generated_AppPlatform_UndeployApplication_sync", + "title": "Snippet for the undeploy_application call in the AppPlatform service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::AppPlatform::Client#undeploy_application.", + "file": "app_platform/undeploy_application.rb", + "language": "RUBY", + "client_method": { + "short_name": "undeploy_application", + "full_name": "::Google::Cloud::VisionAI::V1::AppPlatform::Client#undeploy_application", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VisionAI::V1::UndeployApplicationRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "AppPlatform::Client", + "full_name": "::Google::Cloud::VisionAI::V1::AppPlatform::Client" + }, + "method": { + "short_name": "UndeployApplication", + "full_name": "google.cloud.visionai.v1.AppPlatform.UndeployApplication", + "service": { + "short_name": "AppPlatform", + "full_name": "google.cloud.visionai.v1.AppPlatform" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "visionai_v1_generated_AppPlatform_AddApplicationStreamInput_sync", + "title": "Snippet for the add_application_stream_input call in the AppPlatform service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::AppPlatform::Client#add_application_stream_input.", + "file": "app_platform/add_application_stream_input.rb", + "language": "RUBY", + "client_method": { + "short_name": "add_application_stream_input", + "full_name": "::Google::Cloud::VisionAI::V1::AppPlatform::Client#add_application_stream_input", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VisionAI::V1::AddApplicationStreamInputRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "AppPlatform::Client", + "full_name": "::Google::Cloud::VisionAI::V1::AppPlatform::Client" + }, + "method": { + "short_name": "AddApplicationStreamInput", + "full_name": "google.cloud.visionai.v1.AppPlatform.AddApplicationStreamInput", + "service": { + "short_name": "AppPlatform", + "full_name": "google.cloud.visionai.v1.AppPlatform" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "visionai_v1_generated_AppPlatform_RemoveApplicationStreamInput_sync", + "title": "Snippet for the remove_application_stream_input call in the AppPlatform service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::AppPlatform::Client#remove_application_stream_input.", + "file": "app_platform/remove_application_stream_input.rb", + "language": "RUBY", + "client_method": { + "short_name": "remove_application_stream_input", + "full_name": "::Google::Cloud::VisionAI::V1::AppPlatform::Client#remove_application_stream_input", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VisionAI::V1::RemoveApplicationStreamInputRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "AppPlatform::Client", + "full_name": "::Google::Cloud::VisionAI::V1::AppPlatform::Client" + }, + "method": { + "short_name": "RemoveApplicationStreamInput", + "full_name": "google.cloud.visionai.v1.AppPlatform.RemoveApplicationStreamInput", + "service": { + "short_name": "AppPlatform", + "full_name": "google.cloud.visionai.v1.AppPlatform" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "visionai_v1_generated_AppPlatform_UpdateApplicationStreamInput_sync", + "title": "Snippet for the update_application_stream_input call in the AppPlatform service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::AppPlatform::Client#update_application_stream_input.", + "file": "app_platform/update_application_stream_input.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_application_stream_input", + "full_name": "::Google::Cloud::VisionAI::V1::AppPlatform::Client#update_application_stream_input", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VisionAI::V1::UpdateApplicationStreamInputRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "AppPlatform::Client", + "full_name": "::Google::Cloud::VisionAI::V1::AppPlatform::Client" + }, + "method": { + "short_name": "UpdateApplicationStreamInput", + "full_name": "google.cloud.visionai.v1.AppPlatform.UpdateApplicationStreamInput", + "service": { + "short_name": "AppPlatform", + "full_name": "google.cloud.visionai.v1.AppPlatform" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "visionai_v1_generated_AppPlatform_ListInstances_sync", + "title": "Snippet for the list_instances call in the AppPlatform service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::AppPlatform::Client#list_instances.", + "file": "app_platform/list_instances.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_instances", + "full_name": "::Google::Cloud::VisionAI::V1::AppPlatform::Client#list_instances", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VisionAI::V1::ListInstancesRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::VisionAI::V1::ListInstancesResponse", + "client": { + "short_name": "AppPlatform::Client", + "full_name": "::Google::Cloud::VisionAI::V1::AppPlatform::Client" + }, + "method": { + "short_name": "ListInstances", + "full_name": "google.cloud.visionai.v1.AppPlatform.ListInstances", + "service": { + "short_name": "AppPlatform", + "full_name": "google.cloud.visionai.v1.AppPlatform" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "visionai_v1_generated_AppPlatform_GetInstance_sync", + "title": "Snippet for the get_instance call in the AppPlatform service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::AppPlatform::Client#get_instance.", + "file": "app_platform/get_instance.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_instance", + "full_name": "::Google::Cloud::VisionAI::V1::AppPlatform::Client#get_instance", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VisionAI::V1::GetInstanceRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::VisionAI::V1::Instance", + "client": { + "short_name": "AppPlatform::Client", + "full_name": "::Google::Cloud::VisionAI::V1::AppPlatform::Client" + }, + "method": { + "short_name": "GetInstance", + "full_name": "google.cloud.visionai.v1.AppPlatform.GetInstance", + "service": { + "short_name": "AppPlatform", + "full_name": "google.cloud.visionai.v1.AppPlatform" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "visionai_v1_generated_AppPlatform_CreateApplicationInstances_sync", + "title": "Snippet for the create_application_instances call in the AppPlatform service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::AppPlatform::Client#create_application_instances.", + "file": "app_platform/create_application_instances.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_application_instances", + "full_name": "::Google::Cloud::VisionAI::V1::AppPlatform::Client#create_application_instances", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VisionAI::V1::CreateApplicationInstancesRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "AppPlatform::Client", + "full_name": "::Google::Cloud::VisionAI::V1::AppPlatform::Client" + }, + "method": { + "short_name": "CreateApplicationInstances", + "full_name": "google.cloud.visionai.v1.AppPlatform.CreateApplicationInstances", + "service": { + "short_name": "AppPlatform", + "full_name": "google.cloud.visionai.v1.AppPlatform" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "visionai_v1_generated_AppPlatform_DeleteApplicationInstances_sync", + "title": "Snippet for the delete_application_instances call in the AppPlatform service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::AppPlatform::Client#delete_application_instances.", + "file": "app_platform/delete_application_instances.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_application_instances", + "full_name": "::Google::Cloud::VisionAI::V1::AppPlatform::Client#delete_application_instances", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VisionAI::V1::DeleteApplicationInstancesRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "AppPlatform::Client", + "full_name": "::Google::Cloud::VisionAI::V1::AppPlatform::Client" + }, + "method": { + "short_name": "DeleteApplicationInstances", + "full_name": "google.cloud.visionai.v1.AppPlatform.DeleteApplicationInstances", + "service": { + "short_name": "AppPlatform", + "full_name": "google.cloud.visionai.v1.AppPlatform" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "visionai_v1_generated_AppPlatform_UpdateApplicationInstances_sync", + "title": "Snippet for the update_application_instances call in the AppPlatform service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::AppPlatform::Client#update_application_instances.", + "file": "app_platform/update_application_instances.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_application_instances", + "full_name": "::Google::Cloud::VisionAI::V1::AppPlatform::Client#update_application_instances", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VisionAI::V1::UpdateApplicationInstancesRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "AppPlatform::Client", + "full_name": "::Google::Cloud::VisionAI::V1::AppPlatform::Client" + }, + "method": { + "short_name": "UpdateApplicationInstances", + "full_name": "google.cloud.visionai.v1.AppPlatform.UpdateApplicationInstances", + "service": { + "short_name": "AppPlatform", + "full_name": "google.cloud.visionai.v1.AppPlatform" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "visionai_v1_generated_AppPlatform_ListDrafts_sync", + "title": "Snippet for the list_drafts call in the AppPlatform service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::AppPlatform::Client#list_drafts.", + "file": "app_platform/list_drafts.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_drafts", + "full_name": "::Google::Cloud::VisionAI::V1::AppPlatform::Client#list_drafts", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VisionAI::V1::ListDraftsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::VisionAI::V1::ListDraftsResponse", + "client": { + "short_name": "AppPlatform::Client", + "full_name": "::Google::Cloud::VisionAI::V1::AppPlatform::Client" + }, + "method": { + "short_name": "ListDrafts", + "full_name": "google.cloud.visionai.v1.AppPlatform.ListDrafts", + "service": { + "short_name": "AppPlatform", + "full_name": "google.cloud.visionai.v1.AppPlatform" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "visionai_v1_generated_AppPlatform_GetDraft_sync", + "title": "Snippet for the get_draft call in the AppPlatform service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::AppPlatform::Client#get_draft.", + "file": "app_platform/get_draft.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_draft", + "full_name": "::Google::Cloud::VisionAI::V1::AppPlatform::Client#get_draft", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VisionAI::V1::GetDraftRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::VisionAI::V1::Draft", + "client": { + "short_name": "AppPlatform::Client", + "full_name": "::Google::Cloud::VisionAI::V1::AppPlatform::Client" + }, + "method": { + "short_name": "GetDraft", + "full_name": "google.cloud.visionai.v1.AppPlatform.GetDraft", + "service": { + "short_name": "AppPlatform", + "full_name": "google.cloud.visionai.v1.AppPlatform" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "visionai_v1_generated_AppPlatform_CreateDraft_sync", + "title": "Snippet for the create_draft call in the AppPlatform service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::AppPlatform::Client#create_draft.", + "file": "app_platform/create_draft.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_draft", + "full_name": "::Google::Cloud::VisionAI::V1::AppPlatform::Client#create_draft", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VisionAI::V1::CreateDraftRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "AppPlatform::Client", + "full_name": "::Google::Cloud::VisionAI::V1::AppPlatform::Client" + }, + "method": { + "short_name": "CreateDraft", + "full_name": "google.cloud.visionai.v1.AppPlatform.CreateDraft", + "service": { + "short_name": "AppPlatform", + "full_name": "google.cloud.visionai.v1.AppPlatform" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "visionai_v1_generated_AppPlatform_UpdateDraft_sync", + "title": "Snippet for the update_draft call in the AppPlatform service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::AppPlatform::Client#update_draft.", + "file": "app_platform/update_draft.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_draft", + "full_name": "::Google::Cloud::VisionAI::V1::AppPlatform::Client#update_draft", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VisionAI::V1::UpdateDraftRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "AppPlatform::Client", + "full_name": "::Google::Cloud::VisionAI::V1::AppPlatform::Client" + }, + "method": { + "short_name": "UpdateDraft", + "full_name": "google.cloud.visionai.v1.AppPlatform.UpdateDraft", + "service": { + "short_name": "AppPlatform", + "full_name": "google.cloud.visionai.v1.AppPlatform" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "visionai_v1_generated_AppPlatform_DeleteDraft_sync", + "title": "Snippet for the delete_draft call in the AppPlatform service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::AppPlatform::Client#delete_draft.", + "file": "app_platform/delete_draft.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_draft", + "full_name": "::Google::Cloud::VisionAI::V1::AppPlatform::Client#delete_draft", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VisionAI::V1::DeleteDraftRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "AppPlatform::Client", + "full_name": "::Google::Cloud::VisionAI::V1::AppPlatform::Client" + }, + "method": { + "short_name": "DeleteDraft", + "full_name": "google.cloud.visionai.v1.AppPlatform.DeleteDraft", + "service": { + "short_name": "AppPlatform", + "full_name": "google.cloud.visionai.v1.AppPlatform" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "visionai_v1_generated_AppPlatform_ListProcessors_sync", + "title": "Snippet for the list_processors call in the AppPlatform service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::AppPlatform::Client#list_processors.", + "file": "app_platform/list_processors.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_processors", + "full_name": "::Google::Cloud::VisionAI::V1::AppPlatform::Client#list_processors", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VisionAI::V1::ListProcessorsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::VisionAI::V1::ListProcessorsResponse", + "client": { + "short_name": "AppPlatform::Client", + "full_name": "::Google::Cloud::VisionAI::V1::AppPlatform::Client" + }, + "method": { + "short_name": "ListProcessors", + "full_name": "google.cloud.visionai.v1.AppPlatform.ListProcessors", + "service": { + "short_name": "AppPlatform", + "full_name": "google.cloud.visionai.v1.AppPlatform" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "visionai_v1_generated_AppPlatform_ListPrebuiltProcessors_sync", + "title": "Snippet for the list_prebuilt_processors call in the AppPlatform service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::AppPlatform::Client#list_prebuilt_processors.", + "file": "app_platform/list_prebuilt_processors.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_prebuilt_processors", + "full_name": "::Google::Cloud::VisionAI::V1::AppPlatform::Client#list_prebuilt_processors", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VisionAI::V1::ListPrebuiltProcessorsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::VisionAI::V1::ListPrebuiltProcessorsResponse", + "client": { + "short_name": "AppPlatform::Client", + "full_name": "::Google::Cloud::VisionAI::V1::AppPlatform::Client" + }, + "method": { + "short_name": "ListPrebuiltProcessors", + "full_name": "google.cloud.visionai.v1.AppPlatform.ListPrebuiltProcessors", + "service": { + "short_name": "AppPlatform", + "full_name": "google.cloud.visionai.v1.AppPlatform" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "visionai_v1_generated_AppPlatform_GetProcessor_sync", + "title": "Snippet for the get_processor call in the AppPlatform service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::AppPlatform::Client#get_processor.", + "file": "app_platform/get_processor.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_processor", + "full_name": "::Google::Cloud::VisionAI::V1::AppPlatform::Client#get_processor", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VisionAI::V1::GetProcessorRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::VisionAI::V1::Processor", + "client": { + "short_name": "AppPlatform::Client", + "full_name": "::Google::Cloud::VisionAI::V1::AppPlatform::Client" + }, + "method": { + "short_name": "GetProcessor", + "full_name": "google.cloud.visionai.v1.AppPlatform.GetProcessor", + "service": { + "short_name": "AppPlatform", + "full_name": "google.cloud.visionai.v1.AppPlatform" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "visionai_v1_generated_AppPlatform_CreateProcessor_sync", + "title": "Snippet for the create_processor call in the AppPlatform service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::AppPlatform::Client#create_processor.", + "file": "app_platform/create_processor.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_processor", + "full_name": "::Google::Cloud::VisionAI::V1::AppPlatform::Client#create_processor", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VisionAI::V1::CreateProcessorRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "AppPlatform::Client", + "full_name": "::Google::Cloud::VisionAI::V1::AppPlatform::Client" + }, + "method": { + "short_name": "CreateProcessor", + "full_name": "google.cloud.visionai.v1.AppPlatform.CreateProcessor", + "service": { + "short_name": "AppPlatform", + "full_name": "google.cloud.visionai.v1.AppPlatform" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "visionai_v1_generated_AppPlatform_UpdateProcessor_sync", + "title": "Snippet for the update_processor call in the AppPlatform service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::AppPlatform::Client#update_processor.", + "file": "app_platform/update_processor.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_processor", + "full_name": "::Google::Cloud::VisionAI::V1::AppPlatform::Client#update_processor", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VisionAI::V1::UpdateProcessorRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "AppPlatform::Client", + "full_name": "::Google::Cloud::VisionAI::V1::AppPlatform::Client" + }, + "method": { + "short_name": "UpdateProcessor", + "full_name": "google.cloud.visionai.v1.AppPlatform.UpdateProcessor", + "service": { + "short_name": "AppPlatform", + "full_name": "google.cloud.visionai.v1.AppPlatform" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "visionai_v1_generated_AppPlatform_DeleteProcessor_sync", + "title": "Snippet for the delete_processor call in the AppPlatform service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::AppPlatform::Client#delete_processor.", + "file": "app_platform/delete_processor.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_processor", + "full_name": "::Google::Cloud::VisionAI::V1::AppPlatform::Client#delete_processor", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VisionAI::V1::DeleteProcessorRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "AppPlatform::Client", + "full_name": "::Google::Cloud::VisionAI::V1::AppPlatform::Client" + }, + "method": { + "short_name": "DeleteProcessor", + "full_name": "google.cloud.visionai.v1.AppPlatform.DeleteProcessor", + "service": { + "short_name": "AppPlatform", + "full_name": "google.cloud.visionai.v1.AppPlatform" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "visionai_v1_generated_StreamingService_SendPackets_sync", + "title": "Snippet for the send_packets call in the StreamingService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::StreamingService::Client#send_packets.", + "file": "streaming_service/send_packets.rb", + "language": "RUBY", + "client_method": { + "short_name": "send_packets", + "full_name": "::Google::Cloud::VisionAI::V1::StreamingService::Client#send_packets", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VisionAI::V1::SendPacketsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::VisionAI::V1::SendPacketsResponse", + "client": { + "short_name": "StreamingService::Client", + "full_name": "::Google::Cloud::VisionAI::V1::StreamingService::Client" + }, + "method": { + "short_name": "SendPackets", + "full_name": "google.cloud.visionai.v1.StreamingService.SendPackets", + "service": { + "short_name": "StreamingService", + "full_name": "google.cloud.visionai.v1.StreamingService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 55, + "type": "FULL" + } + ] + }, + { + "region_tag": "visionai_v1_generated_StreamingService_ReceivePackets_sync", + "title": "Snippet for the receive_packets call in the StreamingService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::StreamingService::Client#receive_packets.", + "file": "streaming_service/receive_packets.rb", + "language": "RUBY", + "client_method": { + "short_name": "receive_packets", + "full_name": "::Google::Cloud::VisionAI::V1::StreamingService::Client#receive_packets", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VisionAI::V1::ReceivePacketsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::VisionAI::V1::ReceivePacketsResponse", + "client": { + "short_name": "StreamingService::Client", + "full_name": "::Google::Cloud::VisionAI::V1::StreamingService::Client" + }, + "method": { + "short_name": "ReceivePackets", + "full_name": "google.cloud.visionai.v1.StreamingService.ReceivePackets", + "service": { + "short_name": "StreamingService", + "full_name": "google.cloud.visionai.v1.StreamingService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 55, + "type": "FULL" + } + ] + }, + { + "region_tag": "visionai_v1_generated_StreamingService_ReceiveEvents_sync", + "title": "Snippet for the receive_events call in the StreamingService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::StreamingService::Client#receive_events.", + "file": "streaming_service/receive_events.rb", + "language": "RUBY", + "client_method": { + "short_name": "receive_events", + "full_name": "::Google::Cloud::VisionAI::V1::StreamingService::Client#receive_events", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VisionAI::V1::ReceiveEventsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::VisionAI::V1::ReceiveEventsResponse", + "client": { + "short_name": "StreamingService::Client", + "full_name": "::Google::Cloud::VisionAI::V1::StreamingService::Client" + }, + "method": { + "short_name": "ReceiveEvents", + "full_name": "google.cloud.visionai.v1.StreamingService.ReceiveEvents", + "service": { + "short_name": "StreamingService", + "full_name": "google.cloud.visionai.v1.StreamingService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 55, + "type": "FULL" + } + ] + }, + { + "region_tag": "visionai_v1_generated_StreamingService_AcquireLease_sync", + "title": "Snippet for the acquire_lease call in the StreamingService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::StreamingService::Client#acquire_lease.", + "file": "streaming_service/acquire_lease.rb", + "language": "RUBY", + "client_method": { + "short_name": "acquire_lease", + "full_name": "::Google::Cloud::VisionAI::V1::StreamingService::Client#acquire_lease", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VisionAI::V1::AcquireLeaseRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::VisionAI::V1::Lease", + "client": { + "short_name": "StreamingService::Client", + "full_name": "::Google::Cloud::VisionAI::V1::StreamingService::Client" + }, + "method": { + "short_name": "AcquireLease", + "full_name": "google.cloud.visionai.v1.StreamingService.AcquireLease", + "service": { + "short_name": "StreamingService", + "full_name": "google.cloud.visionai.v1.StreamingService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "visionai_v1_generated_StreamingService_RenewLease_sync", + "title": "Snippet for the renew_lease call in the StreamingService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::StreamingService::Client#renew_lease.", + "file": "streaming_service/renew_lease.rb", + "language": "RUBY", + "client_method": { + "short_name": "renew_lease", + "full_name": "::Google::Cloud::VisionAI::V1::StreamingService::Client#renew_lease", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VisionAI::V1::RenewLeaseRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::VisionAI::V1::Lease", + "client": { + "short_name": "StreamingService::Client", + "full_name": "::Google::Cloud::VisionAI::V1::StreamingService::Client" + }, + "method": { + "short_name": "RenewLease", + "full_name": "google.cloud.visionai.v1.StreamingService.RenewLease", + "service": { + "short_name": "StreamingService", + "full_name": "google.cloud.visionai.v1.StreamingService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "visionai_v1_generated_StreamingService_ReleaseLease_sync", + "title": "Snippet for the release_lease call in the StreamingService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::StreamingService::Client#release_lease.", + "file": "streaming_service/release_lease.rb", + "language": "RUBY", + "client_method": { + "short_name": "release_lease", + "full_name": "::Google::Cloud::VisionAI::V1::StreamingService::Client#release_lease", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VisionAI::V1::ReleaseLeaseRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::VisionAI::V1::ReleaseLeaseResponse", + "client": { + "short_name": "StreamingService::Client", + "full_name": "::Google::Cloud::VisionAI::V1::StreamingService::Client" + }, + "method": { + "short_name": "ReleaseLease", + "full_name": "google.cloud.visionai.v1.StreamingService.ReleaseLease", + "service": { + "short_name": "StreamingService", + "full_name": "google.cloud.visionai.v1.StreamingService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "visionai_v1_generated_StreamsService_ListClusters_sync", + "title": "Snippet for the list_clusters call in the StreamsService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::StreamsService::Client#list_clusters.", + "file": "streams_service/list_clusters.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_clusters", + "full_name": "::Google::Cloud::VisionAI::V1::StreamsService::Client#list_clusters", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VisionAI::V1::ListClustersRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::VisionAI::V1::ListClustersResponse", + "client": { + "short_name": "StreamsService::Client", + "full_name": "::Google::Cloud::VisionAI::V1::StreamsService::Client" + }, + "method": { + "short_name": "ListClusters", + "full_name": "google.cloud.visionai.v1.StreamsService.ListClusters", + "service": { + "short_name": "StreamsService", + "full_name": "google.cloud.visionai.v1.StreamsService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "visionai_v1_generated_StreamsService_GetCluster_sync", + "title": "Snippet for the get_cluster call in the StreamsService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::StreamsService::Client#get_cluster.", + "file": "streams_service/get_cluster.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_cluster", + "full_name": "::Google::Cloud::VisionAI::V1::StreamsService::Client#get_cluster", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VisionAI::V1::GetClusterRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::VisionAI::V1::Cluster", + "client": { + "short_name": "StreamsService::Client", + "full_name": "::Google::Cloud::VisionAI::V1::StreamsService::Client" + }, + "method": { + "short_name": "GetCluster", + "full_name": "google.cloud.visionai.v1.StreamsService.GetCluster", + "service": { + "short_name": "StreamsService", + "full_name": "google.cloud.visionai.v1.StreamsService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "visionai_v1_generated_StreamsService_CreateCluster_sync", + "title": "Snippet for the create_cluster call in the StreamsService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::StreamsService::Client#create_cluster.", + "file": "streams_service/create_cluster.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_cluster", + "full_name": "::Google::Cloud::VisionAI::V1::StreamsService::Client#create_cluster", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VisionAI::V1::CreateClusterRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "StreamsService::Client", + "full_name": "::Google::Cloud::VisionAI::V1::StreamsService::Client" + }, + "method": { + "short_name": "CreateCluster", + "full_name": "google.cloud.visionai.v1.StreamsService.CreateCluster", + "service": { + "short_name": "StreamsService", + "full_name": "google.cloud.visionai.v1.StreamsService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "visionai_v1_generated_StreamsService_UpdateCluster_sync", + "title": "Snippet for the update_cluster call in the StreamsService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::StreamsService::Client#update_cluster.", + "file": "streams_service/update_cluster.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_cluster", + "full_name": "::Google::Cloud::VisionAI::V1::StreamsService::Client#update_cluster", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VisionAI::V1::UpdateClusterRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "StreamsService::Client", + "full_name": "::Google::Cloud::VisionAI::V1::StreamsService::Client" + }, + "method": { + "short_name": "UpdateCluster", + "full_name": "google.cloud.visionai.v1.StreamsService.UpdateCluster", + "service": { + "short_name": "StreamsService", + "full_name": "google.cloud.visionai.v1.StreamsService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "visionai_v1_generated_StreamsService_DeleteCluster_sync", + "title": "Snippet for the delete_cluster call in the StreamsService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::StreamsService::Client#delete_cluster.", + "file": "streams_service/delete_cluster.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_cluster", + "full_name": "::Google::Cloud::VisionAI::V1::StreamsService::Client#delete_cluster", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VisionAI::V1::DeleteClusterRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "StreamsService::Client", + "full_name": "::Google::Cloud::VisionAI::V1::StreamsService::Client" + }, + "method": { + "short_name": "DeleteCluster", + "full_name": "google.cloud.visionai.v1.StreamsService.DeleteCluster", + "service": { + "short_name": "StreamsService", + "full_name": "google.cloud.visionai.v1.StreamsService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "visionai_v1_generated_StreamsService_ListStreams_sync", + "title": "Snippet for the list_streams call in the StreamsService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::StreamsService::Client#list_streams.", + "file": "streams_service/list_streams.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_streams", + "full_name": "::Google::Cloud::VisionAI::V1::StreamsService::Client#list_streams", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VisionAI::V1::ListStreamsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::VisionAI::V1::ListStreamsResponse", + "client": { + "short_name": "StreamsService::Client", + "full_name": "::Google::Cloud::VisionAI::V1::StreamsService::Client" + }, + "method": { + "short_name": "ListStreams", + "full_name": "google.cloud.visionai.v1.StreamsService.ListStreams", + "service": { + "short_name": "StreamsService", + "full_name": "google.cloud.visionai.v1.StreamsService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "visionai_v1_generated_StreamsService_GetStream_sync", + "title": "Snippet for the get_stream call in the StreamsService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::StreamsService::Client#get_stream.", + "file": "streams_service/get_stream.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_stream", + "full_name": "::Google::Cloud::VisionAI::V1::StreamsService::Client#get_stream", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VisionAI::V1::GetStreamRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::VisionAI::V1::Stream", + "client": { + "short_name": "StreamsService::Client", + "full_name": "::Google::Cloud::VisionAI::V1::StreamsService::Client" + }, + "method": { + "short_name": "GetStream", + "full_name": "google.cloud.visionai.v1.StreamsService.GetStream", + "service": { + "short_name": "StreamsService", + "full_name": "google.cloud.visionai.v1.StreamsService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "visionai_v1_generated_StreamsService_CreateStream_sync", + "title": "Snippet for the create_stream call in the StreamsService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::StreamsService::Client#create_stream.", + "file": "streams_service/create_stream.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_stream", + "full_name": "::Google::Cloud::VisionAI::V1::StreamsService::Client#create_stream", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VisionAI::V1::CreateStreamRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "StreamsService::Client", + "full_name": "::Google::Cloud::VisionAI::V1::StreamsService::Client" + }, + "method": { + "short_name": "CreateStream", + "full_name": "google.cloud.visionai.v1.StreamsService.CreateStream", + "service": { + "short_name": "StreamsService", + "full_name": "google.cloud.visionai.v1.StreamsService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "visionai_v1_generated_StreamsService_UpdateStream_sync", + "title": "Snippet for the update_stream call in the StreamsService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::StreamsService::Client#update_stream.", + "file": "streams_service/update_stream.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_stream", + "full_name": "::Google::Cloud::VisionAI::V1::StreamsService::Client#update_stream", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VisionAI::V1::UpdateStreamRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "StreamsService::Client", + "full_name": "::Google::Cloud::VisionAI::V1::StreamsService::Client" + }, + "method": { + "short_name": "UpdateStream", + "full_name": "google.cloud.visionai.v1.StreamsService.UpdateStream", + "service": { + "short_name": "StreamsService", + "full_name": "google.cloud.visionai.v1.StreamsService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "visionai_v1_generated_StreamsService_DeleteStream_sync", + "title": "Snippet for the delete_stream call in the StreamsService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::StreamsService::Client#delete_stream.", + "file": "streams_service/delete_stream.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_stream", + "full_name": "::Google::Cloud::VisionAI::V1::StreamsService::Client#delete_stream", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VisionAI::V1::DeleteStreamRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "StreamsService::Client", + "full_name": "::Google::Cloud::VisionAI::V1::StreamsService::Client" + }, + "method": { + "short_name": "DeleteStream", + "full_name": "google.cloud.visionai.v1.StreamsService.DeleteStream", + "service": { + "short_name": "StreamsService", + "full_name": "google.cloud.visionai.v1.StreamsService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "visionai_v1_generated_StreamsService_GetStreamThumbnail_sync", + "title": "Snippet for the get_stream_thumbnail call in the StreamsService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::StreamsService::Client#get_stream_thumbnail.", + "file": "streams_service/get_stream_thumbnail.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_stream_thumbnail", + "full_name": "::Google::Cloud::VisionAI::V1::StreamsService::Client#get_stream_thumbnail", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VisionAI::V1::GetStreamThumbnailRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "StreamsService::Client", + "full_name": "::Google::Cloud::VisionAI::V1::StreamsService::Client" + }, + "method": { + "short_name": "GetStreamThumbnail", + "full_name": "google.cloud.visionai.v1.StreamsService.GetStreamThumbnail", + "service": { + "short_name": "StreamsService", + "full_name": "google.cloud.visionai.v1.StreamsService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "visionai_v1_generated_StreamsService_GenerateStreamHlsToken_sync", + "title": "Snippet for the generate_stream_hls_token call in the StreamsService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::StreamsService::Client#generate_stream_hls_token.", + "file": "streams_service/generate_stream_hls_token.rb", + "language": "RUBY", + "client_method": { + "short_name": "generate_stream_hls_token", + "full_name": "::Google::Cloud::VisionAI::V1::StreamsService::Client#generate_stream_hls_token", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VisionAI::V1::GenerateStreamHlsTokenRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::VisionAI::V1::GenerateStreamHlsTokenResponse", + "client": { + "short_name": "StreamsService::Client", + "full_name": "::Google::Cloud::VisionAI::V1::StreamsService::Client" + }, + "method": { + "short_name": "GenerateStreamHlsToken", + "full_name": "google.cloud.visionai.v1.StreamsService.GenerateStreamHlsToken", + "service": { + "short_name": "StreamsService", + "full_name": "google.cloud.visionai.v1.StreamsService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "visionai_v1_generated_StreamsService_ListEvents_sync", + "title": "Snippet for the list_events call in the StreamsService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::StreamsService::Client#list_events.", + "file": "streams_service/list_events.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_events", + "full_name": "::Google::Cloud::VisionAI::V1::StreamsService::Client#list_events", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VisionAI::V1::ListEventsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::VisionAI::V1::ListEventsResponse", + "client": { + "short_name": "StreamsService::Client", + "full_name": "::Google::Cloud::VisionAI::V1::StreamsService::Client" + }, + "method": { + "short_name": "ListEvents", + "full_name": "google.cloud.visionai.v1.StreamsService.ListEvents", + "service": { + "short_name": "StreamsService", + "full_name": "google.cloud.visionai.v1.StreamsService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "visionai_v1_generated_StreamsService_GetEvent_sync", + "title": "Snippet for the get_event call in the StreamsService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::StreamsService::Client#get_event.", + "file": "streams_service/get_event.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_event", + "full_name": "::Google::Cloud::VisionAI::V1::StreamsService::Client#get_event", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VisionAI::V1::GetEventRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::VisionAI::V1::Event", + "client": { + "short_name": "StreamsService::Client", + "full_name": "::Google::Cloud::VisionAI::V1::StreamsService::Client" + }, + "method": { + "short_name": "GetEvent", + "full_name": "google.cloud.visionai.v1.StreamsService.GetEvent", + "service": { + "short_name": "StreamsService", + "full_name": "google.cloud.visionai.v1.StreamsService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "visionai_v1_generated_StreamsService_CreateEvent_sync", + "title": "Snippet for the create_event call in the StreamsService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::StreamsService::Client#create_event.", + "file": "streams_service/create_event.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_event", + "full_name": "::Google::Cloud::VisionAI::V1::StreamsService::Client#create_event", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VisionAI::V1::CreateEventRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "StreamsService::Client", + "full_name": "::Google::Cloud::VisionAI::V1::StreamsService::Client" + }, + "method": { + "short_name": "CreateEvent", + "full_name": "google.cloud.visionai.v1.StreamsService.CreateEvent", + "service": { + "short_name": "StreamsService", + "full_name": "google.cloud.visionai.v1.StreamsService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "visionai_v1_generated_StreamsService_UpdateEvent_sync", + "title": "Snippet for the update_event call in the StreamsService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::StreamsService::Client#update_event.", + "file": "streams_service/update_event.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_event", + "full_name": "::Google::Cloud::VisionAI::V1::StreamsService::Client#update_event", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VisionAI::V1::UpdateEventRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "StreamsService::Client", + "full_name": "::Google::Cloud::VisionAI::V1::StreamsService::Client" + }, + "method": { + "short_name": "UpdateEvent", + "full_name": "google.cloud.visionai.v1.StreamsService.UpdateEvent", + "service": { + "short_name": "StreamsService", + "full_name": "google.cloud.visionai.v1.StreamsService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "visionai_v1_generated_StreamsService_DeleteEvent_sync", + "title": "Snippet for the delete_event call in the StreamsService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::StreamsService::Client#delete_event.", + "file": "streams_service/delete_event.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_event", + "full_name": "::Google::Cloud::VisionAI::V1::StreamsService::Client#delete_event", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VisionAI::V1::DeleteEventRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "StreamsService::Client", + "full_name": "::Google::Cloud::VisionAI::V1::StreamsService::Client" + }, + "method": { + "short_name": "DeleteEvent", + "full_name": "google.cloud.visionai.v1.StreamsService.DeleteEvent", + "service": { + "short_name": "StreamsService", + "full_name": "google.cloud.visionai.v1.StreamsService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "visionai_v1_generated_StreamsService_ListSeries_sync", + "title": "Snippet for the list_series call in the StreamsService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::StreamsService::Client#list_series.", + "file": "streams_service/list_series.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_series", + "full_name": "::Google::Cloud::VisionAI::V1::StreamsService::Client#list_series", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VisionAI::V1::ListSeriesRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::VisionAI::V1::ListSeriesResponse", + "client": { + "short_name": "StreamsService::Client", + "full_name": "::Google::Cloud::VisionAI::V1::StreamsService::Client" + }, + "method": { + "short_name": "ListSeries", + "full_name": "google.cloud.visionai.v1.StreamsService.ListSeries", + "service": { + "short_name": "StreamsService", + "full_name": "google.cloud.visionai.v1.StreamsService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "visionai_v1_generated_StreamsService_GetSeries_sync", + "title": "Snippet for the get_series call in the StreamsService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::StreamsService::Client#get_series.", + "file": "streams_service/get_series.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_series", + "full_name": "::Google::Cloud::VisionAI::V1::StreamsService::Client#get_series", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VisionAI::V1::GetSeriesRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::VisionAI::V1::Series", + "client": { + "short_name": "StreamsService::Client", + "full_name": "::Google::Cloud::VisionAI::V1::StreamsService::Client" + }, + "method": { + "short_name": "GetSeries", + "full_name": "google.cloud.visionai.v1.StreamsService.GetSeries", + "service": { + "short_name": "StreamsService", + "full_name": "google.cloud.visionai.v1.StreamsService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "visionai_v1_generated_StreamsService_CreateSeries_sync", + "title": "Snippet for the create_series call in the StreamsService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::StreamsService::Client#create_series.", + "file": "streams_service/create_series.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_series", + "full_name": "::Google::Cloud::VisionAI::V1::StreamsService::Client#create_series", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VisionAI::V1::CreateSeriesRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "StreamsService::Client", + "full_name": "::Google::Cloud::VisionAI::V1::StreamsService::Client" + }, + "method": { + "short_name": "CreateSeries", + "full_name": "google.cloud.visionai.v1.StreamsService.CreateSeries", + "service": { + "short_name": "StreamsService", + "full_name": "google.cloud.visionai.v1.StreamsService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "visionai_v1_generated_StreamsService_UpdateSeries_sync", + "title": "Snippet for the update_series call in the StreamsService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::StreamsService::Client#update_series.", + "file": "streams_service/update_series.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_series", + "full_name": "::Google::Cloud::VisionAI::V1::StreamsService::Client#update_series", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VisionAI::V1::UpdateSeriesRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "StreamsService::Client", + "full_name": "::Google::Cloud::VisionAI::V1::StreamsService::Client" + }, + "method": { + "short_name": "UpdateSeries", + "full_name": "google.cloud.visionai.v1.StreamsService.UpdateSeries", + "service": { + "short_name": "StreamsService", + "full_name": "google.cloud.visionai.v1.StreamsService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "visionai_v1_generated_StreamsService_DeleteSeries_sync", + "title": "Snippet for the delete_series call in the StreamsService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::StreamsService::Client#delete_series.", + "file": "streams_service/delete_series.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_series", + "full_name": "::Google::Cloud::VisionAI::V1::StreamsService::Client#delete_series", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VisionAI::V1::DeleteSeriesRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "StreamsService::Client", + "full_name": "::Google::Cloud::VisionAI::V1::StreamsService::Client" + }, + "method": { + "short_name": "DeleteSeries", + "full_name": "google.cloud.visionai.v1.StreamsService.DeleteSeries", + "service": { + "short_name": "StreamsService", + "full_name": "google.cloud.visionai.v1.StreamsService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "visionai_v1_generated_StreamsService_MaterializeChannel_sync", + "title": "Snippet for the materialize_channel call in the StreamsService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::StreamsService::Client#materialize_channel.", + "file": "streams_service/materialize_channel.rb", + "language": "RUBY", + "client_method": { + "short_name": "materialize_channel", + "full_name": "::Google::Cloud::VisionAI::V1::StreamsService::Client#materialize_channel", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VisionAI::V1::MaterializeChannelRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "StreamsService::Client", + "full_name": "::Google::Cloud::VisionAI::V1::StreamsService::Client" + }, + "method": { + "short_name": "MaterializeChannel", + "full_name": "google.cloud.visionai.v1.StreamsService.MaterializeChannel", + "service": { + "short_name": "StreamsService", + "full_name": "google.cloud.visionai.v1.StreamsService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "visionai_v1_generated_Warehouse_CreateAsset_sync", + "title": "Snippet for the create_asset call in the Warehouse service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::Warehouse::Client#create_asset.", + "file": "warehouse/create_asset.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_asset", + "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client#create_asset", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VisionAI::V1::CreateAssetRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::VisionAI::V1::Asset", + "client": { + "short_name": "Warehouse::Client", + "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client" + }, + "method": { + "short_name": "CreateAsset", + "full_name": "google.cloud.visionai.v1.Warehouse.CreateAsset", + "service": { + "short_name": "Warehouse", + "full_name": "google.cloud.visionai.v1.Warehouse" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "visionai_v1_generated_Warehouse_UpdateAsset_sync", + "title": "Snippet for the update_asset call in the Warehouse service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::Warehouse::Client#update_asset.", + "file": "warehouse/update_asset.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_asset", + "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client#update_asset", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VisionAI::V1::UpdateAssetRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::VisionAI::V1::Asset", + "client": { + "short_name": "Warehouse::Client", + "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client" + }, + "method": { + "short_name": "UpdateAsset", + "full_name": "google.cloud.visionai.v1.Warehouse.UpdateAsset", + "service": { + "short_name": "Warehouse", + "full_name": "google.cloud.visionai.v1.Warehouse" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "visionai_v1_generated_Warehouse_GetAsset_sync", + "title": "Snippet for the get_asset call in the Warehouse service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::Warehouse::Client#get_asset.", + "file": "warehouse/get_asset.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_asset", + "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client#get_asset", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VisionAI::V1::GetAssetRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::VisionAI::V1::Asset", + "client": { + "short_name": "Warehouse::Client", + "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client" + }, + "method": { + "short_name": "GetAsset", + "full_name": "google.cloud.visionai.v1.Warehouse.GetAsset", + "service": { + "short_name": "Warehouse", + "full_name": "google.cloud.visionai.v1.Warehouse" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "visionai_v1_generated_Warehouse_ListAssets_sync", + "title": "Snippet for the list_assets call in the Warehouse service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::Warehouse::Client#list_assets.", + "file": "warehouse/list_assets.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_assets", + "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client#list_assets", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VisionAI::V1::ListAssetsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::VisionAI::V1::ListAssetsResponse", + "client": { + "short_name": "Warehouse::Client", + "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client" + }, + "method": { + "short_name": "ListAssets", + "full_name": "google.cloud.visionai.v1.Warehouse.ListAssets", + "service": { + "short_name": "Warehouse", + "full_name": "google.cloud.visionai.v1.Warehouse" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "visionai_v1_generated_Warehouse_DeleteAsset_sync", + "title": "Snippet for the delete_asset call in the Warehouse service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::Warehouse::Client#delete_asset.", + "file": "warehouse/delete_asset.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_asset", + "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client#delete_asset", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VisionAI::V1::DeleteAssetRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "Warehouse::Client", + "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client" + }, + "method": { + "short_name": "DeleteAsset", + "full_name": "google.cloud.visionai.v1.Warehouse.DeleteAsset", + "service": { + "short_name": "Warehouse", + "full_name": "google.cloud.visionai.v1.Warehouse" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "visionai_v1_generated_Warehouse_UploadAsset_sync", + "title": "Snippet for the upload_asset call in the Warehouse service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::Warehouse::Client#upload_asset.", + "file": "warehouse/upload_asset.rb", + "language": "RUBY", + "client_method": { + "short_name": "upload_asset", + "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client#upload_asset", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VisionAI::V1::UploadAssetRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "Warehouse::Client", + "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client" + }, + "method": { + "short_name": "UploadAsset", + "full_name": "google.cloud.visionai.v1.Warehouse.UploadAsset", + "service": { + "short_name": "Warehouse", + "full_name": "google.cloud.visionai.v1.Warehouse" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "visionai_v1_generated_Warehouse_GenerateRetrievalUrl_sync", + "title": "Snippet for the generate_retrieval_url call in the Warehouse service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::Warehouse::Client#generate_retrieval_url.", + "file": "warehouse/generate_retrieval_url.rb", + "language": "RUBY", + "client_method": { + "short_name": "generate_retrieval_url", + "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client#generate_retrieval_url", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VisionAI::V1::GenerateRetrievalUrlRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::VisionAI::V1::GenerateRetrievalUrlResponse", + "client": { + "short_name": "Warehouse::Client", + "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client" + }, + "method": { + "short_name": "GenerateRetrievalUrl", + "full_name": "google.cloud.visionai.v1.Warehouse.GenerateRetrievalUrl", + "service": { + "short_name": "Warehouse", + "full_name": "google.cloud.visionai.v1.Warehouse" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "visionai_v1_generated_Warehouse_AnalyzeAsset_sync", + "title": "Snippet for the analyze_asset call in the Warehouse service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::Warehouse::Client#analyze_asset.", + "file": "warehouse/analyze_asset.rb", + "language": "RUBY", + "client_method": { + "short_name": "analyze_asset", + "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client#analyze_asset", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VisionAI::V1::AnalyzeAssetRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "Warehouse::Client", + "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client" + }, + "method": { + "short_name": "AnalyzeAsset", + "full_name": "google.cloud.visionai.v1.Warehouse.AnalyzeAsset", + "service": { + "short_name": "Warehouse", + "full_name": "google.cloud.visionai.v1.Warehouse" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "visionai_v1_generated_Warehouse_IndexAsset_sync", + "title": "Snippet for the index_asset call in the Warehouse service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::Warehouse::Client#index_asset.", + "file": "warehouse/index_asset.rb", + "language": "RUBY", + "client_method": { + "short_name": "index_asset", + "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client#index_asset", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VisionAI::V1::IndexAssetRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "Warehouse::Client", + "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client" + }, + "method": { + "short_name": "IndexAsset", + "full_name": "google.cloud.visionai.v1.Warehouse.IndexAsset", + "service": { + "short_name": "Warehouse", + "full_name": "google.cloud.visionai.v1.Warehouse" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "visionai_v1_generated_Warehouse_RemoveIndexAsset_sync", + "title": "Snippet for the remove_index_asset call in the Warehouse service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::Warehouse::Client#remove_index_asset.", + "file": "warehouse/remove_index_asset.rb", + "language": "RUBY", + "client_method": { + "short_name": "remove_index_asset", + "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client#remove_index_asset", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VisionAI::V1::RemoveIndexAssetRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "Warehouse::Client", + "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client" + }, + "method": { + "short_name": "RemoveIndexAsset", + "full_name": "google.cloud.visionai.v1.Warehouse.RemoveIndexAsset", + "service": { + "short_name": "Warehouse", + "full_name": "google.cloud.visionai.v1.Warehouse" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "visionai_v1_generated_Warehouse_ViewIndexedAssets_sync", + "title": "Snippet for the view_indexed_assets call in the Warehouse service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::Warehouse::Client#view_indexed_assets.", + "file": "warehouse/view_indexed_assets.rb", + "language": "RUBY", + "client_method": { + "short_name": "view_indexed_assets", + "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client#view_indexed_assets", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VisionAI::V1::ViewIndexedAssetsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::VisionAI::V1::ViewIndexedAssetsResponse", + "client": { + "short_name": "Warehouse::Client", + "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client" + }, + "method": { + "short_name": "ViewIndexedAssets", + "full_name": "google.cloud.visionai.v1.Warehouse.ViewIndexedAssets", + "service": { + "short_name": "Warehouse", + "full_name": "google.cloud.visionai.v1.Warehouse" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "visionai_v1_generated_Warehouse_CreateIndex_sync", + "title": "Snippet for the create_index call in the Warehouse service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::Warehouse::Client#create_index.", + "file": "warehouse/create_index.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_index", + "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client#create_index", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VisionAI::V1::CreateIndexRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "Warehouse::Client", + "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client" + }, + "method": { + "short_name": "CreateIndex", + "full_name": "google.cloud.visionai.v1.Warehouse.CreateIndex", + "service": { + "short_name": "Warehouse", + "full_name": "google.cloud.visionai.v1.Warehouse" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "visionai_v1_generated_Warehouse_UpdateIndex_sync", + "title": "Snippet for the update_index call in the Warehouse service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::Warehouse::Client#update_index.", + "file": "warehouse/update_index.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_index", + "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client#update_index", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VisionAI::V1::UpdateIndexRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "Warehouse::Client", + "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client" + }, + "method": { + "short_name": "UpdateIndex", + "full_name": "google.cloud.visionai.v1.Warehouse.UpdateIndex", + "service": { + "short_name": "Warehouse", + "full_name": "google.cloud.visionai.v1.Warehouse" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "visionai_v1_generated_Warehouse_GetIndex_sync", + "title": "Snippet for the get_index call in the Warehouse service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::Warehouse::Client#get_index.", + "file": "warehouse/get_index.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_index", + "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client#get_index", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VisionAI::V1::GetIndexRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::VisionAI::V1::Index", + "client": { + "short_name": "Warehouse::Client", + "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client" + }, + "method": { + "short_name": "GetIndex", + "full_name": "google.cloud.visionai.v1.Warehouse.GetIndex", + "service": { + "short_name": "Warehouse", + "full_name": "google.cloud.visionai.v1.Warehouse" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "visionai_v1_generated_Warehouse_ListIndexes_sync", + "title": "Snippet for the list_indexes call in the Warehouse service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::Warehouse::Client#list_indexes.", + "file": "warehouse/list_indexes.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_indexes", + "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client#list_indexes", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VisionAI::V1::ListIndexesRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::VisionAI::V1::ListIndexesResponse", + "client": { + "short_name": "Warehouse::Client", + "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client" + }, + "method": { + "short_name": "ListIndexes", + "full_name": "google.cloud.visionai.v1.Warehouse.ListIndexes", + "service": { + "short_name": "Warehouse", + "full_name": "google.cloud.visionai.v1.Warehouse" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "visionai_v1_generated_Warehouse_DeleteIndex_sync", + "title": "Snippet for the delete_index call in the Warehouse service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::Warehouse::Client#delete_index.", + "file": "warehouse/delete_index.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_index", + "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client#delete_index", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VisionAI::V1::DeleteIndexRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "Warehouse::Client", + "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client" + }, + "method": { + "short_name": "DeleteIndex", + "full_name": "google.cloud.visionai.v1.Warehouse.DeleteIndex", + "service": { + "short_name": "Warehouse", + "full_name": "google.cloud.visionai.v1.Warehouse" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "visionai_v1_generated_Warehouse_CreateCorpus_sync", + "title": "Snippet for the create_corpus call in the Warehouse service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::Warehouse::Client#create_corpus.", + "file": "warehouse/create_corpus.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_corpus", + "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client#create_corpus", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VisionAI::V1::CreateCorpusRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "Warehouse::Client", + "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client" + }, + "method": { + "short_name": "CreateCorpus", + "full_name": "google.cloud.visionai.v1.Warehouse.CreateCorpus", + "service": { + "short_name": "Warehouse", + "full_name": "google.cloud.visionai.v1.Warehouse" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "visionai_v1_generated_Warehouse_GetCorpus_sync", + "title": "Snippet for the get_corpus call in the Warehouse service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::Warehouse::Client#get_corpus.", + "file": "warehouse/get_corpus.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_corpus", + "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client#get_corpus", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VisionAI::V1::GetCorpusRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::VisionAI::V1::Corpus", + "client": { + "short_name": "Warehouse::Client", + "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client" + }, + "method": { + "short_name": "GetCorpus", + "full_name": "google.cloud.visionai.v1.Warehouse.GetCorpus", + "service": { + "short_name": "Warehouse", + "full_name": "google.cloud.visionai.v1.Warehouse" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "visionai_v1_generated_Warehouse_UpdateCorpus_sync", + "title": "Snippet for the update_corpus call in the Warehouse service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::Warehouse::Client#update_corpus.", + "file": "warehouse/update_corpus.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_corpus", + "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client#update_corpus", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VisionAI::V1::UpdateCorpusRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::VisionAI::V1::Corpus", + "client": { + "short_name": "Warehouse::Client", + "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client" + }, + "method": { + "short_name": "UpdateCorpus", + "full_name": "google.cloud.visionai.v1.Warehouse.UpdateCorpus", + "service": { + "short_name": "Warehouse", + "full_name": "google.cloud.visionai.v1.Warehouse" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "visionai_v1_generated_Warehouse_ListCorpora_sync", + "title": "Snippet for the list_corpora call in the Warehouse service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::Warehouse::Client#list_corpora.", + "file": "warehouse/list_corpora.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_corpora", + "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client#list_corpora", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VisionAI::V1::ListCorporaRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::VisionAI::V1::ListCorporaResponse", + "client": { + "short_name": "Warehouse::Client", + "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client" + }, + "method": { + "short_name": "ListCorpora", + "full_name": "google.cloud.visionai.v1.Warehouse.ListCorpora", + "service": { + "short_name": "Warehouse", + "full_name": "google.cloud.visionai.v1.Warehouse" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "visionai_v1_generated_Warehouse_DeleteCorpus_sync", + "title": "Snippet for the delete_corpus call in the Warehouse service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::Warehouse::Client#delete_corpus.", + "file": "warehouse/delete_corpus.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_corpus", + "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client#delete_corpus", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VisionAI::V1::DeleteCorpusRequest", + "name": "request" + } + ], + "result_type": "::Google::Protobuf::Empty", + "client": { + "short_name": "Warehouse::Client", + "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client" + }, + "method": { + "short_name": "DeleteCorpus", + "full_name": "google.cloud.visionai.v1.Warehouse.DeleteCorpus", + "service": { + "short_name": "Warehouse", + "full_name": "google.cloud.visionai.v1.Warehouse" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "visionai_v1_generated_Warehouse_AnalyzeCorpus_sync", + "title": "Snippet for the analyze_corpus call in the Warehouse service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::Warehouse::Client#analyze_corpus.", + "file": "warehouse/analyze_corpus.rb", + "language": "RUBY", + "client_method": { + "short_name": "analyze_corpus", + "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client#analyze_corpus", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VisionAI::V1::AnalyzeCorpusRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "Warehouse::Client", + "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client" + }, + "method": { + "short_name": "AnalyzeCorpus", + "full_name": "google.cloud.visionai.v1.Warehouse.AnalyzeCorpus", + "service": { + "short_name": "Warehouse", + "full_name": "google.cloud.visionai.v1.Warehouse" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "visionai_v1_generated_Warehouse_CreateDataSchema_sync", + "title": "Snippet for the create_data_schema call in the Warehouse service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::Warehouse::Client#create_data_schema.", + "file": "warehouse/create_data_schema.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_data_schema", + "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client#create_data_schema", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VisionAI::V1::CreateDataSchemaRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::VisionAI::V1::DataSchema", + "client": { + "short_name": "Warehouse::Client", + "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client" + }, + "method": { + "short_name": "CreateDataSchema", + "full_name": "google.cloud.visionai.v1.Warehouse.CreateDataSchema", + "service": { + "short_name": "Warehouse", + "full_name": "google.cloud.visionai.v1.Warehouse" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "visionai_v1_generated_Warehouse_UpdateDataSchema_sync", + "title": "Snippet for the update_data_schema call in the Warehouse service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::Warehouse::Client#update_data_schema.", + "file": "warehouse/update_data_schema.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_data_schema", + "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client#update_data_schema", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VisionAI::V1::UpdateDataSchemaRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::VisionAI::V1::DataSchema", + "client": { + "short_name": "Warehouse::Client", + "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client" + }, + "method": { + "short_name": "UpdateDataSchema", + "full_name": "google.cloud.visionai.v1.Warehouse.UpdateDataSchema", + "service": { + "short_name": "Warehouse", + "full_name": "google.cloud.visionai.v1.Warehouse" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "visionai_v1_generated_Warehouse_GetDataSchema_sync", + "title": "Snippet for the get_data_schema call in the Warehouse service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::Warehouse::Client#get_data_schema.", + "file": "warehouse/get_data_schema.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_data_schema", + "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client#get_data_schema", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VisionAI::V1::GetDataSchemaRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::VisionAI::V1::DataSchema", + "client": { + "short_name": "Warehouse::Client", + "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client" + }, + "method": { + "short_name": "GetDataSchema", + "full_name": "google.cloud.visionai.v1.Warehouse.GetDataSchema", + "service": { + "short_name": "Warehouse", + "full_name": "google.cloud.visionai.v1.Warehouse" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "visionai_v1_generated_Warehouse_DeleteDataSchema_sync", + "title": "Snippet for the delete_data_schema call in the Warehouse service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::Warehouse::Client#delete_data_schema.", + "file": "warehouse/delete_data_schema.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_data_schema", + "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client#delete_data_schema", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VisionAI::V1::DeleteDataSchemaRequest", + "name": "request" + } + ], + "result_type": "::Google::Protobuf::Empty", + "client": { + "short_name": "Warehouse::Client", + "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client" + }, + "method": { + "short_name": "DeleteDataSchema", + "full_name": "google.cloud.visionai.v1.Warehouse.DeleteDataSchema", + "service": { + "short_name": "Warehouse", + "full_name": "google.cloud.visionai.v1.Warehouse" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "visionai_v1_generated_Warehouse_ListDataSchemas_sync", + "title": "Snippet for the list_data_schemas call in the Warehouse service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::Warehouse::Client#list_data_schemas.", + "file": "warehouse/list_data_schemas.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_data_schemas", + "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client#list_data_schemas", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VisionAI::V1::ListDataSchemasRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::VisionAI::V1::ListDataSchemasResponse", + "client": { + "short_name": "Warehouse::Client", + "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client" + }, + "method": { + "short_name": "ListDataSchemas", + "full_name": "google.cloud.visionai.v1.Warehouse.ListDataSchemas", + "service": { + "short_name": "Warehouse", + "full_name": "google.cloud.visionai.v1.Warehouse" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "visionai_v1_generated_Warehouse_CreateAnnotation_sync", + "title": "Snippet for the create_annotation call in the Warehouse service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::Warehouse::Client#create_annotation.", + "file": "warehouse/create_annotation.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_annotation", + "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client#create_annotation", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VisionAI::V1::CreateAnnotationRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::VisionAI::V1::Annotation", + "client": { + "short_name": "Warehouse::Client", + "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client" + }, + "method": { + "short_name": "CreateAnnotation", + "full_name": "google.cloud.visionai.v1.Warehouse.CreateAnnotation", + "service": { + "short_name": "Warehouse", + "full_name": "google.cloud.visionai.v1.Warehouse" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "visionai_v1_generated_Warehouse_GetAnnotation_sync", + "title": "Snippet for the get_annotation call in the Warehouse service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::Warehouse::Client#get_annotation.", + "file": "warehouse/get_annotation.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_annotation", + "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client#get_annotation", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VisionAI::V1::GetAnnotationRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::VisionAI::V1::Annotation", + "client": { + "short_name": "Warehouse::Client", + "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client" + }, + "method": { + "short_name": "GetAnnotation", + "full_name": "google.cloud.visionai.v1.Warehouse.GetAnnotation", + "service": { + "short_name": "Warehouse", + "full_name": "google.cloud.visionai.v1.Warehouse" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "visionai_v1_generated_Warehouse_ListAnnotations_sync", + "title": "Snippet for the list_annotations call in the Warehouse service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::Warehouse::Client#list_annotations.", + "file": "warehouse/list_annotations.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_annotations", + "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client#list_annotations", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VisionAI::V1::ListAnnotationsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::VisionAI::V1::ListAnnotationsResponse", + "client": { + "short_name": "Warehouse::Client", + "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client" + }, + "method": { + "short_name": "ListAnnotations", + "full_name": "google.cloud.visionai.v1.Warehouse.ListAnnotations", + "service": { + "short_name": "Warehouse", + "full_name": "google.cloud.visionai.v1.Warehouse" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "visionai_v1_generated_Warehouse_UpdateAnnotation_sync", + "title": "Snippet for the update_annotation call in the Warehouse service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::Warehouse::Client#update_annotation.", + "file": "warehouse/update_annotation.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_annotation", + "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client#update_annotation", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VisionAI::V1::UpdateAnnotationRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::VisionAI::V1::Annotation", + "client": { + "short_name": "Warehouse::Client", + "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client" + }, + "method": { + "short_name": "UpdateAnnotation", + "full_name": "google.cloud.visionai.v1.Warehouse.UpdateAnnotation", + "service": { + "short_name": "Warehouse", + "full_name": "google.cloud.visionai.v1.Warehouse" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "visionai_v1_generated_Warehouse_DeleteAnnotation_sync", + "title": "Snippet for the delete_annotation call in the Warehouse service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::Warehouse::Client#delete_annotation.", + "file": "warehouse/delete_annotation.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_annotation", + "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client#delete_annotation", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VisionAI::V1::DeleteAnnotationRequest", + "name": "request" + } + ], + "result_type": "::Google::Protobuf::Empty", + "client": { + "short_name": "Warehouse::Client", + "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client" + }, + "method": { + "short_name": "DeleteAnnotation", + "full_name": "google.cloud.visionai.v1.Warehouse.DeleteAnnotation", + "service": { + "short_name": "Warehouse", + "full_name": "google.cloud.visionai.v1.Warehouse" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "visionai_v1_generated_Warehouse_IngestAsset_sync", + "title": "Snippet for the ingest_asset call in the Warehouse service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::Warehouse::Client#ingest_asset.", + "file": "warehouse/ingest_asset.rb", + "language": "RUBY", + "client_method": { + "short_name": "ingest_asset", + "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client#ingest_asset", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VisionAI::V1::IngestAssetRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::VisionAI::V1::IngestAssetResponse", + "client": { + "short_name": "Warehouse::Client", + "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client" + }, + "method": { + "short_name": "IngestAsset", + "full_name": "google.cloud.visionai.v1.Warehouse.IngestAsset", + "service": { + "short_name": "Warehouse", + "full_name": "google.cloud.visionai.v1.Warehouse" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 55, + "type": "FULL" + } + ] + }, + { + "region_tag": "visionai_v1_generated_Warehouse_ClipAsset_sync", + "title": "Snippet for the clip_asset call in the Warehouse service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::Warehouse::Client#clip_asset.", + "file": "warehouse/clip_asset.rb", + "language": "RUBY", + "client_method": { + "short_name": "clip_asset", + "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client#clip_asset", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VisionAI::V1::ClipAssetRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::VisionAI::V1::ClipAssetResponse", + "client": { + "short_name": "Warehouse::Client", + "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client" + }, + "method": { + "short_name": "ClipAsset", + "full_name": "google.cloud.visionai.v1.Warehouse.ClipAsset", + "service": { + "short_name": "Warehouse", + "full_name": "google.cloud.visionai.v1.Warehouse" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "visionai_v1_generated_Warehouse_GenerateHlsUri_sync", + "title": "Snippet for the generate_hls_uri call in the Warehouse service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::Warehouse::Client#generate_hls_uri.", + "file": "warehouse/generate_hls_uri.rb", + "language": "RUBY", + "client_method": { + "short_name": "generate_hls_uri", + "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client#generate_hls_uri", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VisionAI::V1::GenerateHlsUriRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::VisionAI::V1::GenerateHlsUriResponse", + "client": { + "short_name": "Warehouse::Client", + "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client" + }, + "method": { + "short_name": "GenerateHlsUri", + "full_name": "google.cloud.visionai.v1.Warehouse.GenerateHlsUri", + "service": { + "short_name": "Warehouse", + "full_name": "google.cloud.visionai.v1.Warehouse" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "visionai_v1_generated_Warehouse_ImportAssets_sync", + "title": "Snippet for the import_assets call in the Warehouse service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::Warehouse::Client#import_assets.", + "file": "warehouse/import_assets.rb", + "language": "RUBY", + "client_method": { + "short_name": "import_assets", + "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client#import_assets", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VisionAI::V1::ImportAssetsRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "Warehouse::Client", + "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client" + }, + "method": { + "short_name": "ImportAssets", + "full_name": "google.cloud.visionai.v1.Warehouse.ImportAssets", + "service": { + "short_name": "Warehouse", + "full_name": "google.cloud.visionai.v1.Warehouse" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "visionai_v1_generated_Warehouse_CreateSearchConfig_sync", + "title": "Snippet for the create_search_config call in the Warehouse service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::Warehouse::Client#create_search_config.", + "file": "warehouse/create_search_config.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_search_config", + "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client#create_search_config", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VisionAI::V1::CreateSearchConfigRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::VisionAI::V1::SearchConfig", + "client": { + "short_name": "Warehouse::Client", + "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client" + }, + "method": { + "short_name": "CreateSearchConfig", + "full_name": "google.cloud.visionai.v1.Warehouse.CreateSearchConfig", + "service": { + "short_name": "Warehouse", + "full_name": "google.cloud.visionai.v1.Warehouse" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "visionai_v1_generated_Warehouse_UpdateSearchConfig_sync", + "title": "Snippet for the update_search_config call in the Warehouse service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::Warehouse::Client#update_search_config.", + "file": "warehouse/update_search_config.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_search_config", + "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client#update_search_config", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VisionAI::V1::UpdateSearchConfigRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::VisionAI::V1::SearchConfig", + "client": { + "short_name": "Warehouse::Client", + "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client" + }, + "method": { + "short_name": "UpdateSearchConfig", + "full_name": "google.cloud.visionai.v1.Warehouse.UpdateSearchConfig", + "service": { + "short_name": "Warehouse", + "full_name": "google.cloud.visionai.v1.Warehouse" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "visionai_v1_generated_Warehouse_GetSearchConfig_sync", + "title": "Snippet for the get_search_config call in the Warehouse service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::Warehouse::Client#get_search_config.", + "file": "warehouse/get_search_config.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_search_config", + "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client#get_search_config", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VisionAI::V1::GetSearchConfigRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::VisionAI::V1::SearchConfig", + "client": { + "short_name": "Warehouse::Client", + "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client" + }, + "method": { + "short_name": "GetSearchConfig", + "full_name": "google.cloud.visionai.v1.Warehouse.GetSearchConfig", + "service": { + "short_name": "Warehouse", + "full_name": "google.cloud.visionai.v1.Warehouse" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "visionai_v1_generated_Warehouse_DeleteSearchConfig_sync", + "title": "Snippet for the delete_search_config call in the Warehouse service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::Warehouse::Client#delete_search_config.", + "file": "warehouse/delete_search_config.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_search_config", + "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client#delete_search_config", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VisionAI::V1::DeleteSearchConfigRequest", + "name": "request" + } + ], + "result_type": "::Google::Protobuf::Empty", + "client": { + "short_name": "Warehouse::Client", + "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client" + }, + "method": { + "short_name": "DeleteSearchConfig", + "full_name": "google.cloud.visionai.v1.Warehouse.DeleteSearchConfig", + "service": { + "short_name": "Warehouse", + "full_name": "google.cloud.visionai.v1.Warehouse" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "visionai_v1_generated_Warehouse_ListSearchConfigs_sync", + "title": "Snippet for the list_search_configs call in the Warehouse service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::Warehouse::Client#list_search_configs.", + "file": "warehouse/list_search_configs.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_search_configs", + "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client#list_search_configs", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VisionAI::V1::ListSearchConfigsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::VisionAI::V1::ListSearchConfigsResponse", + "client": { + "short_name": "Warehouse::Client", + "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client" + }, + "method": { + "short_name": "ListSearchConfigs", + "full_name": "google.cloud.visionai.v1.Warehouse.ListSearchConfigs", + "service": { + "short_name": "Warehouse", + "full_name": "google.cloud.visionai.v1.Warehouse" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "visionai_v1_generated_Warehouse_CreateSearchHypernym_sync", + "title": "Snippet for the create_search_hypernym call in the Warehouse service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::Warehouse::Client#create_search_hypernym.", + "file": "warehouse/create_search_hypernym.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_search_hypernym", + "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client#create_search_hypernym", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VisionAI::V1::CreateSearchHypernymRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::VisionAI::V1::SearchHypernym", + "client": { + "short_name": "Warehouse::Client", + "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client" + }, + "method": { + "short_name": "CreateSearchHypernym", + "full_name": "google.cloud.visionai.v1.Warehouse.CreateSearchHypernym", + "service": { + "short_name": "Warehouse", + "full_name": "google.cloud.visionai.v1.Warehouse" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "visionai_v1_generated_Warehouse_UpdateSearchHypernym_sync", + "title": "Snippet for the update_search_hypernym call in the Warehouse service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::Warehouse::Client#update_search_hypernym.", + "file": "warehouse/update_search_hypernym.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_search_hypernym", + "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client#update_search_hypernym", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VisionAI::V1::UpdateSearchHypernymRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::VisionAI::V1::SearchHypernym", + "client": { + "short_name": "Warehouse::Client", + "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client" + }, + "method": { + "short_name": "UpdateSearchHypernym", + "full_name": "google.cloud.visionai.v1.Warehouse.UpdateSearchHypernym", + "service": { + "short_name": "Warehouse", + "full_name": "google.cloud.visionai.v1.Warehouse" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "visionai_v1_generated_Warehouse_GetSearchHypernym_sync", + "title": "Snippet for the get_search_hypernym call in the Warehouse service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::Warehouse::Client#get_search_hypernym.", + "file": "warehouse/get_search_hypernym.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_search_hypernym", + "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client#get_search_hypernym", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VisionAI::V1::GetSearchHypernymRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::VisionAI::V1::SearchHypernym", + "client": { + "short_name": "Warehouse::Client", + "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client" + }, + "method": { + "short_name": "GetSearchHypernym", + "full_name": "google.cloud.visionai.v1.Warehouse.GetSearchHypernym", + "service": { + "short_name": "Warehouse", + "full_name": "google.cloud.visionai.v1.Warehouse" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "visionai_v1_generated_Warehouse_DeleteSearchHypernym_sync", + "title": "Snippet for the delete_search_hypernym call in the Warehouse service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::Warehouse::Client#delete_search_hypernym.", + "file": "warehouse/delete_search_hypernym.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_search_hypernym", + "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client#delete_search_hypernym", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VisionAI::V1::DeleteSearchHypernymRequest", + "name": "request" + } + ], + "result_type": "::Google::Protobuf::Empty", + "client": { + "short_name": "Warehouse::Client", + "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client" + }, + "method": { + "short_name": "DeleteSearchHypernym", + "full_name": "google.cloud.visionai.v1.Warehouse.DeleteSearchHypernym", + "service": { + "short_name": "Warehouse", + "full_name": "google.cloud.visionai.v1.Warehouse" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "visionai_v1_generated_Warehouse_ListSearchHypernyms_sync", + "title": "Snippet for the list_search_hypernyms call in the Warehouse service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::Warehouse::Client#list_search_hypernyms.", + "file": "warehouse/list_search_hypernyms.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_search_hypernyms", + "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client#list_search_hypernyms", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VisionAI::V1::ListSearchHypernymsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::VisionAI::V1::ListSearchHypernymsResponse", + "client": { + "short_name": "Warehouse::Client", + "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client" + }, + "method": { + "short_name": "ListSearchHypernyms", + "full_name": "google.cloud.visionai.v1.Warehouse.ListSearchHypernyms", + "service": { + "short_name": "Warehouse", + "full_name": "google.cloud.visionai.v1.Warehouse" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "visionai_v1_generated_Warehouse_SearchAssets_sync", + "title": "Snippet for the search_assets call in the Warehouse service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::Warehouse::Client#search_assets.", + "file": "warehouse/search_assets.rb", + "language": "RUBY", + "client_method": { + "short_name": "search_assets", + "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client#search_assets", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VisionAI::V1::SearchAssetsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::VisionAI::V1::SearchAssetsResponse", + "client": { + "short_name": "Warehouse::Client", + "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client" + }, + "method": { + "short_name": "SearchAssets", + "full_name": "google.cloud.visionai.v1.Warehouse.SearchAssets", + "service": { + "short_name": "Warehouse", + "full_name": "google.cloud.visionai.v1.Warehouse" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "visionai_v1_generated_Warehouse_SearchIndexEndpoint_sync", + "title": "Snippet for the search_index_endpoint call in the Warehouse service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::Warehouse::Client#search_index_endpoint.", + "file": "warehouse/search_index_endpoint.rb", + "language": "RUBY", + "client_method": { + "short_name": "search_index_endpoint", + "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client#search_index_endpoint", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VisionAI::V1::SearchIndexEndpointRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::VisionAI::V1::SearchIndexEndpointResponse", + "client": { + "short_name": "Warehouse::Client", + "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client" + }, + "method": { + "short_name": "SearchIndexEndpoint", + "full_name": "google.cloud.visionai.v1.Warehouse.SearchIndexEndpoint", + "service": { + "short_name": "Warehouse", + "full_name": "google.cloud.visionai.v1.Warehouse" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "visionai_v1_generated_Warehouse_CreateIndexEndpoint_sync", + "title": "Snippet for the create_index_endpoint call in the Warehouse service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::Warehouse::Client#create_index_endpoint.", + "file": "warehouse/create_index_endpoint.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_index_endpoint", + "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client#create_index_endpoint", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VisionAI::V1::CreateIndexEndpointRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "Warehouse::Client", + "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client" + }, + "method": { + "short_name": "CreateIndexEndpoint", + "full_name": "google.cloud.visionai.v1.Warehouse.CreateIndexEndpoint", + "service": { + "short_name": "Warehouse", + "full_name": "google.cloud.visionai.v1.Warehouse" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "visionai_v1_generated_Warehouse_GetIndexEndpoint_sync", + "title": "Snippet for the get_index_endpoint call in the Warehouse service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::Warehouse::Client#get_index_endpoint.", + "file": "warehouse/get_index_endpoint.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_index_endpoint", + "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client#get_index_endpoint", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VisionAI::V1::GetIndexEndpointRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::VisionAI::V1::IndexEndpoint", + "client": { + "short_name": "Warehouse::Client", + "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client" + }, + "method": { + "short_name": "GetIndexEndpoint", + "full_name": "google.cloud.visionai.v1.Warehouse.GetIndexEndpoint", + "service": { + "short_name": "Warehouse", + "full_name": "google.cloud.visionai.v1.Warehouse" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "visionai_v1_generated_Warehouse_ListIndexEndpoints_sync", + "title": "Snippet for the list_index_endpoints call in the Warehouse service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::Warehouse::Client#list_index_endpoints.", + "file": "warehouse/list_index_endpoints.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_index_endpoints", + "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client#list_index_endpoints", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VisionAI::V1::ListIndexEndpointsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::VisionAI::V1::ListIndexEndpointsResponse", + "client": { + "short_name": "Warehouse::Client", + "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client" + }, + "method": { + "short_name": "ListIndexEndpoints", + "full_name": "google.cloud.visionai.v1.Warehouse.ListIndexEndpoints", + "service": { + "short_name": "Warehouse", + "full_name": "google.cloud.visionai.v1.Warehouse" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "visionai_v1_generated_Warehouse_UpdateIndexEndpoint_sync", + "title": "Snippet for the update_index_endpoint call in the Warehouse service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::Warehouse::Client#update_index_endpoint.", + "file": "warehouse/update_index_endpoint.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_index_endpoint", + "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client#update_index_endpoint", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VisionAI::V1::UpdateIndexEndpointRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "Warehouse::Client", + "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client" + }, + "method": { + "short_name": "UpdateIndexEndpoint", + "full_name": "google.cloud.visionai.v1.Warehouse.UpdateIndexEndpoint", + "service": { + "short_name": "Warehouse", + "full_name": "google.cloud.visionai.v1.Warehouse" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "visionai_v1_generated_Warehouse_DeleteIndexEndpoint_sync", + "title": "Snippet for the delete_index_endpoint call in the Warehouse service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::Warehouse::Client#delete_index_endpoint.", + "file": "warehouse/delete_index_endpoint.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_index_endpoint", + "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client#delete_index_endpoint", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VisionAI::V1::DeleteIndexEndpointRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "Warehouse::Client", + "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client" + }, + "method": { + "short_name": "DeleteIndexEndpoint", + "full_name": "google.cloud.visionai.v1.Warehouse.DeleteIndexEndpoint", + "service": { + "short_name": "Warehouse", + "full_name": "google.cloud.visionai.v1.Warehouse" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "visionai_v1_generated_Warehouse_DeployIndex_sync", + "title": "Snippet for the deploy_index call in the Warehouse service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::Warehouse::Client#deploy_index.", + "file": "warehouse/deploy_index.rb", + "language": "RUBY", + "client_method": { + "short_name": "deploy_index", + "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client#deploy_index", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VisionAI::V1::DeployIndexRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "Warehouse::Client", + "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client" + }, + "method": { + "short_name": "DeployIndex", + "full_name": "google.cloud.visionai.v1.Warehouse.DeployIndex", + "service": { + "short_name": "Warehouse", + "full_name": "google.cloud.visionai.v1.Warehouse" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "visionai_v1_generated_Warehouse_UndeployIndex_sync", + "title": "Snippet for the undeploy_index call in the Warehouse service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::Warehouse::Client#undeploy_index.", + "file": "warehouse/undeploy_index.rb", + "language": "RUBY", + "client_method": { + "short_name": "undeploy_index", + "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client#undeploy_index", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VisionAI::V1::UndeployIndexRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "Warehouse::Client", + "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client" + }, + "method": { + "short_name": "UndeployIndex", + "full_name": "google.cloud.visionai.v1.Warehouse.UndeployIndex", + "service": { + "short_name": "Warehouse", + "full_name": "google.cloud.visionai.v1.Warehouse" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "visionai_v1_generated_Warehouse_CreateCollection_sync", + "title": "Snippet for the create_collection call in the Warehouse service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::Warehouse::Client#create_collection.", + "file": "warehouse/create_collection.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_collection", + "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client#create_collection", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VisionAI::V1::CreateCollectionRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "Warehouse::Client", + "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client" + }, + "method": { + "short_name": "CreateCollection", + "full_name": "google.cloud.visionai.v1.Warehouse.CreateCollection", + "service": { + "short_name": "Warehouse", + "full_name": "google.cloud.visionai.v1.Warehouse" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "visionai_v1_generated_Warehouse_DeleteCollection_sync", + "title": "Snippet for the delete_collection call in the Warehouse service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::Warehouse::Client#delete_collection.", + "file": "warehouse/delete_collection.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_collection", + "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client#delete_collection", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VisionAI::V1::DeleteCollectionRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "Warehouse::Client", + "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client" + }, + "method": { + "short_name": "DeleteCollection", + "full_name": "google.cloud.visionai.v1.Warehouse.DeleteCollection", + "service": { + "short_name": "Warehouse", + "full_name": "google.cloud.visionai.v1.Warehouse" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "visionai_v1_generated_Warehouse_GetCollection_sync", + "title": "Snippet for the get_collection call in the Warehouse service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::Warehouse::Client#get_collection.", + "file": "warehouse/get_collection.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_collection", + "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client#get_collection", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VisionAI::V1::GetCollectionRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::VisionAI::V1::Collection", + "client": { + "short_name": "Warehouse::Client", + "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client" + }, + "method": { + "short_name": "GetCollection", + "full_name": "google.cloud.visionai.v1.Warehouse.GetCollection", + "service": { + "short_name": "Warehouse", + "full_name": "google.cloud.visionai.v1.Warehouse" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "visionai_v1_generated_Warehouse_UpdateCollection_sync", + "title": "Snippet for the update_collection call in the Warehouse service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::Warehouse::Client#update_collection.", + "file": "warehouse/update_collection.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_collection", + "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client#update_collection", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VisionAI::V1::UpdateCollectionRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::VisionAI::V1::Collection", + "client": { + "short_name": "Warehouse::Client", + "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client" + }, + "method": { + "short_name": "UpdateCollection", + "full_name": "google.cloud.visionai.v1.Warehouse.UpdateCollection", + "service": { + "short_name": "Warehouse", + "full_name": "google.cloud.visionai.v1.Warehouse" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "visionai_v1_generated_Warehouse_ListCollections_sync", + "title": "Snippet for the list_collections call in the Warehouse service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::Warehouse::Client#list_collections.", + "file": "warehouse/list_collections.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_collections", + "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client#list_collections", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VisionAI::V1::ListCollectionsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::VisionAI::V1::ListCollectionsResponse", + "client": { + "short_name": "Warehouse::Client", + "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client" + }, + "method": { + "short_name": "ListCollections", + "full_name": "google.cloud.visionai.v1.Warehouse.ListCollections", + "service": { + "short_name": "Warehouse", + "full_name": "google.cloud.visionai.v1.Warehouse" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "visionai_v1_generated_Warehouse_AddCollectionItem_sync", + "title": "Snippet for the add_collection_item call in the Warehouse service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::Warehouse::Client#add_collection_item.", + "file": "warehouse/add_collection_item.rb", + "language": "RUBY", + "client_method": { + "short_name": "add_collection_item", + "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client#add_collection_item", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VisionAI::V1::AddCollectionItemRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::VisionAI::V1::AddCollectionItemResponse", + "client": { + "short_name": "Warehouse::Client", + "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client" + }, + "method": { + "short_name": "AddCollectionItem", + "full_name": "google.cloud.visionai.v1.Warehouse.AddCollectionItem", + "service": { + "short_name": "Warehouse", + "full_name": "google.cloud.visionai.v1.Warehouse" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "visionai_v1_generated_Warehouse_RemoveCollectionItem_sync", + "title": "Snippet for the remove_collection_item call in the Warehouse service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::Warehouse::Client#remove_collection_item.", + "file": "warehouse/remove_collection_item.rb", + "language": "RUBY", + "client_method": { + "short_name": "remove_collection_item", + "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client#remove_collection_item", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VisionAI::V1::RemoveCollectionItemRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::VisionAI::V1::RemoveCollectionItemResponse", + "client": { + "short_name": "Warehouse::Client", + "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client" + }, + "method": { + "short_name": "RemoveCollectionItem", + "full_name": "google.cloud.visionai.v1.Warehouse.RemoveCollectionItem", + "service": { + "short_name": "Warehouse", + "full_name": "google.cloud.visionai.v1.Warehouse" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "visionai_v1_generated_Warehouse_ViewCollectionItems_sync", + "title": "Snippet for the view_collection_items call in the Warehouse service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::Warehouse::Client#view_collection_items.", + "file": "warehouse/view_collection_items.rb", + "language": "RUBY", + "client_method": { + "short_name": "view_collection_items", + "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client#view_collection_items", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VisionAI::V1::ViewCollectionItemsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::VisionAI::V1::ViewCollectionItemsResponse", + "client": { + "short_name": "Warehouse::Client", + "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client" + }, + "method": { + "short_name": "ViewCollectionItems", + "full_name": "google.cloud.visionai.v1.Warehouse.ViewCollectionItems", + "service": { + "short_name": "Warehouse", + "full_name": "google.cloud.visionai.v1.Warehouse" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "visionai_v1_generated_HealthCheckService_HealthCheck_sync", + "title": "Snippet for the health_check call in the HealthCheckService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::HealthCheckService::Client#health_check.", + "file": "health_check_service/health_check.rb", + "language": "RUBY", + "client_method": { + "short_name": "health_check", + "full_name": "::Google::Cloud::VisionAI::V1::HealthCheckService::Client#health_check", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VisionAI::V1::HealthCheckRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::VisionAI::V1::HealthCheckResponse", + "client": { + "short_name": "HealthCheckService::Client", + "full_name": "::Google::Cloud::VisionAI::V1::HealthCheckService::Client" + }, + "method": { + "short_name": "HealthCheck", + "full_name": "google.cloud.visionai.v1.HealthCheckService.HealthCheck", + "service": { + "short_name": "HealthCheckService", + "full_name": "google.cloud.visionai.v1.HealthCheckService" + } + } + }, + "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-vision_ai-v1/snippets/streaming_service/acquire_lease.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/streaming_service/acquire_lease.rb new file mode 100644 index 000000000000..e31c0226534a --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/streaming_service/acquire_lease.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 visionai_v1_generated_StreamingService_AcquireLease_sync] +require "google/cloud/vision_ai/v1" + +## +# Snippet for the acquire_lease call in the StreamingService 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::VisionAI::V1::StreamingService::Client#acquire_lease. +# +def acquire_lease + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VisionAI::V1::StreamingService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VisionAI::V1::AcquireLeaseRequest.new + + # Call the acquire_lease method. + result = client.acquire_lease request + + # The returned object is of type Google::Cloud::VisionAI::V1::Lease. + p result +end +# [END visionai_v1_generated_StreamingService_AcquireLease_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/streaming_service/receive_events.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/streaming_service/receive_events.rb new file mode 100644 index 000000000000..1dbbe3d1ae7d --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/streaming_service/receive_events.rb @@ -0,0 +1,56 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 visionai_v1_generated_StreamingService_ReceiveEvents_sync] +require "google/cloud/vision_ai/v1" + +## +# Snippet for the receive_events call in the StreamingService 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::VisionAI::V1::StreamingService::Client#receive_events. +# +def receive_events + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VisionAI::V1::StreamingService::Client.new + + # Create an input stream. + input = Gapic::StreamInput.new + + # Call the receive_events method to start streaming. + output = client.receive_events input + + # Send requests on the stream. For each request object, set fields by + # passing keyword arguments. Be sure to close the stream when done. + input << Google::Cloud::VisionAI::V1::ReceiveEventsRequest.new + input << Google::Cloud::VisionAI::V1::ReceiveEventsRequest.new + input.close + + # The returned object is a streamed enumerable yielding elements of type + # ::Google::Cloud::VisionAI::V1::ReceiveEventsResponse + output.each do |current_response| + p current_response + end +end +# [END visionai_v1_generated_StreamingService_ReceiveEvents_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/streaming_service/receive_packets.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/streaming_service/receive_packets.rb new file mode 100644 index 000000000000..a2066f31b1fe --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/streaming_service/receive_packets.rb @@ -0,0 +1,56 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 visionai_v1_generated_StreamingService_ReceivePackets_sync] +require "google/cloud/vision_ai/v1" + +## +# Snippet for the receive_packets call in the StreamingService 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::VisionAI::V1::StreamingService::Client#receive_packets. +# +def receive_packets + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VisionAI::V1::StreamingService::Client.new + + # Create an input stream. + input = Gapic::StreamInput.new + + # Call the receive_packets method to start streaming. + output = client.receive_packets input + + # Send requests on the stream. For each request object, set fields by + # passing keyword arguments. Be sure to close the stream when done. + input << Google::Cloud::VisionAI::V1::ReceivePacketsRequest.new + input << Google::Cloud::VisionAI::V1::ReceivePacketsRequest.new + input.close + + # The returned object is a streamed enumerable yielding elements of type + # ::Google::Cloud::VisionAI::V1::ReceivePacketsResponse + output.each do |current_response| + p current_response + end +end +# [END visionai_v1_generated_StreamingService_ReceivePackets_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/streaming_service/release_lease.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/streaming_service/release_lease.rb new file mode 100644 index 000000000000..0a0ac7c37fbc --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/streaming_service/release_lease.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 visionai_v1_generated_StreamingService_ReleaseLease_sync] +require "google/cloud/vision_ai/v1" + +## +# Snippet for the release_lease call in the StreamingService 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::VisionAI::V1::StreamingService::Client#release_lease. +# +def release_lease + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VisionAI::V1::StreamingService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VisionAI::V1::ReleaseLeaseRequest.new + + # Call the release_lease method. + result = client.release_lease request + + # The returned object is of type Google::Cloud::VisionAI::V1::ReleaseLeaseResponse. + p result +end +# [END visionai_v1_generated_StreamingService_ReleaseLease_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/streaming_service/renew_lease.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/streaming_service/renew_lease.rb new file mode 100644 index 000000000000..e02d97d10e9e --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/streaming_service/renew_lease.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 visionai_v1_generated_StreamingService_RenewLease_sync] +require "google/cloud/vision_ai/v1" + +## +# Snippet for the renew_lease call in the StreamingService 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::VisionAI::V1::StreamingService::Client#renew_lease. +# +def renew_lease + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VisionAI::V1::StreamingService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VisionAI::V1::RenewLeaseRequest.new + + # Call the renew_lease method. + result = client.renew_lease request + + # The returned object is of type Google::Cloud::VisionAI::V1::Lease. + p result +end +# [END visionai_v1_generated_StreamingService_RenewLease_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/streaming_service/send_packets.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/streaming_service/send_packets.rb new file mode 100644 index 000000000000..ad93bf715db5 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/streaming_service/send_packets.rb @@ -0,0 +1,56 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 visionai_v1_generated_StreamingService_SendPackets_sync] +require "google/cloud/vision_ai/v1" + +## +# Snippet for the send_packets call in the StreamingService 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::VisionAI::V1::StreamingService::Client#send_packets. +# +def send_packets + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VisionAI::V1::StreamingService::Client.new + + # Create an input stream. + input = Gapic::StreamInput.new + + # Call the send_packets method to start streaming. + output = client.send_packets input + + # Send requests on the stream. For each request object, set fields by + # passing keyword arguments. Be sure to close the stream when done. + input << Google::Cloud::VisionAI::V1::SendPacketsRequest.new + input << Google::Cloud::VisionAI::V1::SendPacketsRequest.new + input.close + + # The returned object is a streamed enumerable yielding elements of type + # ::Google::Cloud::VisionAI::V1::SendPacketsResponse + output.each do |current_response| + p current_response + end +end +# [END visionai_v1_generated_StreamingService_SendPackets_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/streams_service/create_cluster.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/streams_service/create_cluster.rb new file mode 100644 index 000000000000..a459e6a3c502 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/streams_service/create_cluster.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 visionai_v1_generated_StreamsService_CreateCluster_sync] +require "google/cloud/vision_ai/v1" + +## +# Snippet for the create_cluster call in the StreamsService 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::VisionAI::V1::StreamsService::Client#create_cluster. +# +def create_cluster + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VisionAI::V1::StreamsService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VisionAI::V1::CreateClusterRequest.new + + # Call the create_cluster method. + result = client.create_cluster 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 visionai_v1_generated_StreamsService_CreateCluster_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/streams_service/create_event.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/streams_service/create_event.rb new file mode 100644 index 000000000000..09f48f7898c3 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/streams_service/create_event.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 visionai_v1_generated_StreamsService_CreateEvent_sync] +require "google/cloud/vision_ai/v1" + +## +# Snippet for the create_event call in the StreamsService 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::VisionAI::V1::StreamsService::Client#create_event. +# +def create_event + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VisionAI::V1::StreamsService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VisionAI::V1::CreateEventRequest.new + + # Call the create_event method. + result = client.create_event 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 visionai_v1_generated_StreamsService_CreateEvent_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/streams_service/create_series.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/streams_service/create_series.rb new file mode 100644 index 000000000000..8366f5829502 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/streams_service/create_series.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 visionai_v1_generated_StreamsService_CreateSeries_sync] +require "google/cloud/vision_ai/v1" + +## +# Snippet for the create_series call in the StreamsService 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::VisionAI::V1::StreamsService::Client#create_series. +# +def create_series + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VisionAI::V1::StreamsService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VisionAI::V1::CreateSeriesRequest.new + + # Call the create_series method. + result = client.create_series 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 visionai_v1_generated_StreamsService_CreateSeries_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/streams_service/create_stream.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/streams_service/create_stream.rb new file mode 100644 index 000000000000..89fd97681025 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/streams_service/create_stream.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 visionai_v1_generated_StreamsService_CreateStream_sync] +require "google/cloud/vision_ai/v1" + +## +# Snippet for the create_stream call in the StreamsService 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::VisionAI::V1::StreamsService::Client#create_stream. +# +def create_stream + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VisionAI::V1::StreamsService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VisionAI::V1::CreateStreamRequest.new + + # Call the create_stream method. + result = client.create_stream 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 visionai_v1_generated_StreamsService_CreateStream_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/streams_service/delete_cluster.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/streams_service/delete_cluster.rb new file mode 100644 index 000000000000..5b5f84742166 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/streams_service/delete_cluster.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 visionai_v1_generated_StreamsService_DeleteCluster_sync] +require "google/cloud/vision_ai/v1" + +## +# Snippet for the delete_cluster call in the StreamsService 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::VisionAI::V1::StreamsService::Client#delete_cluster. +# +def delete_cluster + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VisionAI::V1::StreamsService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VisionAI::V1::DeleteClusterRequest.new + + # Call the delete_cluster method. + result = client.delete_cluster 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 visionai_v1_generated_StreamsService_DeleteCluster_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/streams_service/delete_event.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/streams_service/delete_event.rb new file mode 100644 index 000000000000..1e1d1873c2dd --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/streams_service/delete_event.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 visionai_v1_generated_StreamsService_DeleteEvent_sync] +require "google/cloud/vision_ai/v1" + +## +# Snippet for the delete_event call in the StreamsService 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::VisionAI::V1::StreamsService::Client#delete_event. +# +def delete_event + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VisionAI::V1::StreamsService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VisionAI::V1::DeleteEventRequest.new + + # Call the delete_event method. + result = client.delete_event 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 visionai_v1_generated_StreamsService_DeleteEvent_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/streams_service/delete_series.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/streams_service/delete_series.rb new file mode 100644 index 000000000000..ba26c57c5f7f --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/streams_service/delete_series.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 visionai_v1_generated_StreamsService_DeleteSeries_sync] +require "google/cloud/vision_ai/v1" + +## +# Snippet for the delete_series call in the StreamsService 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::VisionAI::V1::StreamsService::Client#delete_series. +# +def delete_series + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VisionAI::V1::StreamsService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VisionAI::V1::DeleteSeriesRequest.new + + # Call the delete_series method. + result = client.delete_series 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 visionai_v1_generated_StreamsService_DeleteSeries_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/streams_service/delete_stream.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/streams_service/delete_stream.rb new file mode 100644 index 000000000000..9fdc4d5cbcfa --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/streams_service/delete_stream.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 visionai_v1_generated_StreamsService_DeleteStream_sync] +require "google/cloud/vision_ai/v1" + +## +# Snippet for the delete_stream call in the StreamsService 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::VisionAI::V1::StreamsService::Client#delete_stream. +# +def delete_stream + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VisionAI::V1::StreamsService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VisionAI::V1::DeleteStreamRequest.new + + # Call the delete_stream method. + result = client.delete_stream 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 visionai_v1_generated_StreamsService_DeleteStream_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/streams_service/generate_stream_hls_token.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/streams_service/generate_stream_hls_token.rb new file mode 100644 index 000000000000..397fa47013c2 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/streams_service/generate_stream_hls_token.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 visionai_v1_generated_StreamsService_GenerateStreamHlsToken_sync] +require "google/cloud/vision_ai/v1" + +## +# Snippet for the generate_stream_hls_token call in the StreamsService 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::VisionAI::V1::StreamsService::Client#generate_stream_hls_token. +# +def generate_stream_hls_token + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VisionAI::V1::StreamsService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VisionAI::V1::GenerateStreamHlsTokenRequest.new + + # Call the generate_stream_hls_token method. + result = client.generate_stream_hls_token request + + # The returned object is of type Google::Cloud::VisionAI::V1::GenerateStreamHlsTokenResponse. + p result +end +# [END visionai_v1_generated_StreamsService_GenerateStreamHlsToken_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/streams_service/get_cluster.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/streams_service/get_cluster.rb new file mode 100644 index 000000000000..9a0df18b4b77 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/streams_service/get_cluster.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 visionai_v1_generated_StreamsService_GetCluster_sync] +require "google/cloud/vision_ai/v1" + +## +# Snippet for the get_cluster call in the StreamsService 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::VisionAI::V1::StreamsService::Client#get_cluster. +# +def get_cluster + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VisionAI::V1::StreamsService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VisionAI::V1::GetClusterRequest.new + + # Call the get_cluster method. + result = client.get_cluster request + + # The returned object is of type Google::Cloud::VisionAI::V1::Cluster. + p result +end +# [END visionai_v1_generated_StreamsService_GetCluster_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/streams_service/get_event.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/streams_service/get_event.rb new file mode 100644 index 000000000000..dc7e587b8004 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/streams_service/get_event.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 visionai_v1_generated_StreamsService_GetEvent_sync] +require "google/cloud/vision_ai/v1" + +## +# Snippet for the get_event call in the StreamsService 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::VisionAI::V1::StreamsService::Client#get_event. +# +def get_event + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VisionAI::V1::StreamsService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VisionAI::V1::GetEventRequest.new + + # Call the get_event method. + result = client.get_event request + + # The returned object is of type Google::Cloud::VisionAI::V1::Event. + p result +end +# [END visionai_v1_generated_StreamsService_GetEvent_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/streams_service/get_series.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/streams_service/get_series.rb new file mode 100644 index 000000000000..c5822841aaa8 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/streams_service/get_series.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 visionai_v1_generated_StreamsService_GetSeries_sync] +require "google/cloud/vision_ai/v1" + +## +# Snippet for the get_series call in the StreamsService 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::VisionAI::V1::StreamsService::Client#get_series. +# +def get_series + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VisionAI::V1::StreamsService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VisionAI::V1::GetSeriesRequest.new + + # Call the get_series method. + result = client.get_series request + + # The returned object is of type Google::Cloud::VisionAI::V1::Series. + p result +end +# [END visionai_v1_generated_StreamsService_GetSeries_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/streams_service/get_stream.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/streams_service/get_stream.rb new file mode 100644 index 000000000000..338c34bc457f --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/streams_service/get_stream.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 visionai_v1_generated_StreamsService_GetStream_sync] +require "google/cloud/vision_ai/v1" + +## +# Snippet for the get_stream call in the StreamsService 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::VisionAI::V1::StreamsService::Client#get_stream. +# +def get_stream + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VisionAI::V1::StreamsService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VisionAI::V1::GetStreamRequest.new + + # Call the get_stream method. + result = client.get_stream request + + # The returned object is of type Google::Cloud::VisionAI::V1::Stream. + p result +end +# [END visionai_v1_generated_StreamsService_GetStream_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/streams_service/get_stream_thumbnail.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/streams_service/get_stream_thumbnail.rb new file mode 100644 index 000000000000..3df4d5d427e0 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/streams_service/get_stream_thumbnail.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 visionai_v1_generated_StreamsService_GetStreamThumbnail_sync] +require "google/cloud/vision_ai/v1" + +## +# Snippet for the get_stream_thumbnail call in the StreamsService 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::VisionAI::V1::StreamsService::Client#get_stream_thumbnail. +# +def get_stream_thumbnail + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VisionAI::V1::StreamsService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VisionAI::V1::GetStreamThumbnailRequest.new + + # Call the get_stream_thumbnail method. + result = client.get_stream_thumbnail 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 visionai_v1_generated_StreamsService_GetStreamThumbnail_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/streams_service/list_clusters.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/streams_service/list_clusters.rb new file mode 100644 index 000000000000..bb488a80ce3b --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/streams_service/list_clusters.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 visionai_v1_generated_StreamsService_ListClusters_sync] +require "google/cloud/vision_ai/v1" + +## +# Snippet for the list_clusters call in the StreamsService 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::VisionAI::V1::StreamsService::Client#list_clusters. +# +def list_clusters + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VisionAI::V1::StreamsService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VisionAI::V1::ListClustersRequest.new + + # Call the list_clusters method. + result = client.list_clusters 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::VisionAI::V1::Cluster. + p item + end +end +# [END visionai_v1_generated_StreamsService_ListClusters_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/streams_service/list_events.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/streams_service/list_events.rb new file mode 100644 index 000000000000..ed5c416e8825 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/streams_service/list_events.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 visionai_v1_generated_StreamsService_ListEvents_sync] +require "google/cloud/vision_ai/v1" + +## +# Snippet for the list_events call in the StreamsService 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::VisionAI::V1::StreamsService::Client#list_events. +# +def list_events + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VisionAI::V1::StreamsService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VisionAI::V1::ListEventsRequest.new + + # Call the list_events method. + result = client.list_events 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::VisionAI::V1::Event. + p item + end +end +# [END visionai_v1_generated_StreamsService_ListEvents_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/streams_service/list_series.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/streams_service/list_series.rb new file mode 100644 index 000000000000..b13253651d25 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/streams_service/list_series.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 visionai_v1_generated_StreamsService_ListSeries_sync] +require "google/cloud/vision_ai/v1" + +## +# Snippet for the list_series call in the StreamsService 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::VisionAI::V1::StreamsService::Client#list_series. +# +def list_series + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VisionAI::V1::StreamsService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VisionAI::V1::ListSeriesRequest.new + + # Call the list_series method. + result = client.list_series 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::VisionAI::V1::Series. + p item + end +end +# [END visionai_v1_generated_StreamsService_ListSeries_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/streams_service/list_streams.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/streams_service/list_streams.rb new file mode 100644 index 000000000000..95386372f76b --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/streams_service/list_streams.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 visionai_v1_generated_StreamsService_ListStreams_sync] +require "google/cloud/vision_ai/v1" + +## +# Snippet for the list_streams call in the StreamsService 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::VisionAI::V1::StreamsService::Client#list_streams. +# +def list_streams + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VisionAI::V1::StreamsService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VisionAI::V1::ListStreamsRequest.new + + # Call the list_streams method. + result = client.list_streams 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::VisionAI::V1::Stream. + p item + end +end +# [END visionai_v1_generated_StreamsService_ListStreams_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/streams_service/materialize_channel.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/streams_service/materialize_channel.rb new file mode 100644 index 000000000000..7c98cfcfc234 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/streams_service/materialize_channel.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 visionai_v1_generated_StreamsService_MaterializeChannel_sync] +require "google/cloud/vision_ai/v1" + +## +# Snippet for the materialize_channel call in the StreamsService 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::VisionAI::V1::StreamsService::Client#materialize_channel. +# +def materialize_channel + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VisionAI::V1::StreamsService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VisionAI::V1::MaterializeChannelRequest.new + + # Call the materialize_channel method. + result = client.materialize_channel 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 visionai_v1_generated_StreamsService_MaterializeChannel_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/streams_service/update_cluster.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/streams_service/update_cluster.rb new file mode 100644 index 000000000000..ce056cc5e29e --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/streams_service/update_cluster.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 visionai_v1_generated_StreamsService_UpdateCluster_sync] +require "google/cloud/vision_ai/v1" + +## +# Snippet for the update_cluster call in the StreamsService 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::VisionAI::V1::StreamsService::Client#update_cluster. +# +def update_cluster + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VisionAI::V1::StreamsService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VisionAI::V1::UpdateClusterRequest.new + + # Call the update_cluster method. + result = client.update_cluster 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 visionai_v1_generated_StreamsService_UpdateCluster_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/streams_service/update_event.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/streams_service/update_event.rb new file mode 100644 index 000000000000..d0811f946a30 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/streams_service/update_event.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 visionai_v1_generated_StreamsService_UpdateEvent_sync] +require "google/cloud/vision_ai/v1" + +## +# Snippet for the update_event call in the StreamsService 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::VisionAI::V1::StreamsService::Client#update_event. +# +def update_event + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VisionAI::V1::StreamsService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VisionAI::V1::UpdateEventRequest.new + + # Call the update_event method. + result = client.update_event 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 visionai_v1_generated_StreamsService_UpdateEvent_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/streams_service/update_series.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/streams_service/update_series.rb new file mode 100644 index 000000000000..239f446d2c0b --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/streams_service/update_series.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 visionai_v1_generated_StreamsService_UpdateSeries_sync] +require "google/cloud/vision_ai/v1" + +## +# Snippet for the update_series call in the StreamsService 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::VisionAI::V1::StreamsService::Client#update_series. +# +def update_series + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VisionAI::V1::StreamsService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VisionAI::V1::UpdateSeriesRequest.new + + # Call the update_series method. + result = client.update_series 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 visionai_v1_generated_StreamsService_UpdateSeries_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/streams_service/update_stream.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/streams_service/update_stream.rb new file mode 100644 index 000000000000..35c887431415 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/streams_service/update_stream.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 visionai_v1_generated_StreamsService_UpdateStream_sync] +require "google/cloud/vision_ai/v1" + +## +# Snippet for the update_stream call in the StreamsService 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::VisionAI::V1::StreamsService::Client#update_stream. +# +def update_stream + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VisionAI::V1::StreamsService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VisionAI::V1::UpdateStreamRequest.new + + # Call the update_stream method. + result = client.update_stream 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 visionai_v1_generated_StreamsService_UpdateStream_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/add_collection_item.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/add_collection_item.rb new file mode 100644 index 000000000000..7543d0295185 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/add_collection_item.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 visionai_v1_generated_Warehouse_AddCollectionItem_sync] +require "google/cloud/vision_ai/v1" + +## +# Snippet for the add_collection_item call in the Warehouse 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::VisionAI::V1::Warehouse::Client#add_collection_item. +# +def add_collection_item + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VisionAI::V1::Warehouse::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VisionAI::V1::AddCollectionItemRequest.new + + # Call the add_collection_item method. + result = client.add_collection_item request + + # The returned object is of type Google::Cloud::VisionAI::V1::AddCollectionItemResponse. + p result +end +# [END visionai_v1_generated_Warehouse_AddCollectionItem_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/analyze_asset.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/analyze_asset.rb new file mode 100644 index 000000000000..6759f3c175fd --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/analyze_asset.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 visionai_v1_generated_Warehouse_AnalyzeAsset_sync] +require "google/cloud/vision_ai/v1" + +## +# Snippet for the analyze_asset call in the Warehouse 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::VisionAI::V1::Warehouse::Client#analyze_asset. +# +def analyze_asset + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VisionAI::V1::Warehouse::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VisionAI::V1::AnalyzeAssetRequest.new + + # Call the analyze_asset method. + result = client.analyze_asset 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 visionai_v1_generated_Warehouse_AnalyzeAsset_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/analyze_corpus.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/analyze_corpus.rb new file mode 100644 index 000000000000..56672690156a --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/analyze_corpus.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 visionai_v1_generated_Warehouse_AnalyzeCorpus_sync] +require "google/cloud/vision_ai/v1" + +## +# Snippet for the analyze_corpus call in the Warehouse 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::VisionAI::V1::Warehouse::Client#analyze_corpus. +# +def analyze_corpus + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VisionAI::V1::Warehouse::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VisionAI::V1::AnalyzeCorpusRequest.new + + # Call the analyze_corpus method. + result = client.analyze_corpus 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 visionai_v1_generated_Warehouse_AnalyzeCorpus_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/clip_asset.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/clip_asset.rb new file mode 100644 index 000000000000..fcbd3d39313b --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/clip_asset.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 visionai_v1_generated_Warehouse_ClipAsset_sync] +require "google/cloud/vision_ai/v1" + +## +# Snippet for the clip_asset call in the Warehouse 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::VisionAI::V1::Warehouse::Client#clip_asset. +# +def clip_asset + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VisionAI::V1::Warehouse::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VisionAI::V1::ClipAssetRequest.new + + # Call the clip_asset method. + result = client.clip_asset request + + # The returned object is of type Google::Cloud::VisionAI::V1::ClipAssetResponse. + p result +end +# [END visionai_v1_generated_Warehouse_ClipAsset_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/create_annotation.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/create_annotation.rb new file mode 100644 index 000000000000..a62a765d295e --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/create_annotation.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 visionai_v1_generated_Warehouse_CreateAnnotation_sync] +require "google/cloud/vision_ai/v1" + +## +# Snippet for the create_annotation call in the Warehouse 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::VisionAI::V1::Warehouse::Client#create_annotation. +# +def create_annotation + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VisionAI::V1::Warehouse::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VisionAI::V1::CreateAnnotationRequest.new + + # Call the create_annotation method. + result = client.create_annotation request + + # The returned object is of type Google::Cloud::VisionAI::V1::Annotation. + p result +end +# [END visionai_v1_generated_Warehouse_CreateAnnotation_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/create_asset.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/create_asset.rb new file mode 100644 index 000000000000..61ffc440d3c6 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/create_asset.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 visionai_v1_generated_Warehouse_CreateAsset_sync] +require "google/cloud/vision_ai/v1" + +## +# Snippet for the create_asset call in the Warehouse 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::VisionAI::V1::Warehouse::Client#create_asset. +# +def create_asset + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VisionAI::V1::Warehouse::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VisionAI::V1::CreateAssetRequest.new + + # Call the create_asset method. + result = client.create_asset request + + # The returned object is of type Google::Cloud::VisionAI::V1::Asset. + p result +end +# [END visionai_v1_generated_Warehouse_CreateAsset_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/create_collection.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/create_collection.rb new file mode 100644 index 000000000000..9210da1576e0 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/create_collection.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 visionai_v1_generated_Warehouse_CreateCollection_sync] +require "google/cloud/vision_ai/v1" + +## +# Snippet for the create_collection call in the Warehouse 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::VisionAI::V1::Warehouse::Client#create_collection. +# +def create_collection + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VisionAI::V1::Warehouse::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VisionAI::V1::CreateCollectionRequest.new + + # Call the create_collection method. + result = client.create_collection 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 visionai_v1_generated_Warehouse_CreateCollection_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/create_corpus.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/create_corpus.rb new file mode 100644 index 000000000000..a71363888ee6 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/create_corpus.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 visionai_v1_generated_Warehouse_CreateCorpus_sync] +require "google/cloud/vision_ai/v1" + +## +# Snippet for the create_corpus call in the Warehouse 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::VisionAI::V1::Warehouse::Client#create_corpus. +# +def create_corpus + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VisionAI::V1::Warehouse::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VisionAI::V1::CreateCorpusRequest.new + + # Call the create_corpus method. + result = client.create_corpus 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 visionai_v1_generated_Warehouse_CreateCorpus_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/create_data_schema.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/create_data_schema.rb new file mode 100644 index 000000000000..00fc7e77ffa8 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/create_data_schema.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 visionai_v1_generated_Warehouse_CreateDataSchema_sync] +require "google/cloud/vision_ai/v1" + +## +# Snippet for the create_data_schema call in the Warehouse 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::VisionAI::V1::Warehouse::Client#create_data_schema. +# +def create_data_schema + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VisionAI::V1::Warehouse::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VisionAI::V1::CreateDataSchemaRequest.new + + # Call the create_data_schema method. + result = client.create_data_schema request + + # The returned object is of type Google::Cloud::VisionAI::V1::DataSchema. + p result +end +# [END visionai_v1_generated_Warehouse_CreateDataSchema_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/create_index.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/create_index.rb new file mode 100644 index 000000000000..e2566a698de8 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/create_index.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 visionai_v1_generated_Warehouse_CreateIndex_sync] +require "google/cloud/vision_ai/v1" + +## +# Snippet for the create_index call in the Warehouse 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::VisionAI::V1::Warehouse::Client#create_index. +# +def create_index + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VisionAI::V1::Warehouse::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VisionAI::V1::CreateIndexRequest.new + + # Call the create_index method. + result = client.create_index 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 visionai_v1_generated_Warehouse_CreateIndex_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/create_index_endpoint.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/create_index_endpoint.rb new file mode 100644 index 000000000000..695f24b1fab2 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/create_index_endpoint.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 visionai_v1_generated_Warehouse_CreateIndexEndpoint_sync] +require "google/cloud/vision_ai/v1" + +## +# Snippet for the create_index_endpoint call in the Warehouse 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::VisionAI::V1::Warehouse::Client#create_index_endpoint. +# +def create_index_endpoint + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VisionAI::V1::Warehouse::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VisionAI::V1::CreateIndexEndpointRequest.new + + # Call the create_index_endpoint method. + result = client.create_index_endpoint 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 visionai_v1_generated_Warehouse_CreateIndexEndpoint_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/create_search_config.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/create_search_config.rb new file mode 100644 index 000000000000..957ddb90ee4f --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/create_search_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 visionai_v1_generated_Warehouse_CreateSearchConfig_sync] +require "google/cloud/vision_ai/v1" + +## +# Snippet for the create_search_config call in the Warehouse 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::VisionAI::V1::Warehouse::Client#create_search_config. +# +def create_search_config + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VisionAI::V1::Warehouse::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VisionAI::V1::CreateSearchConfigRequest.new + + # Call the create_search_config method. + result = client.create_search_config request + + # The returned object is of type Google::Cloud::VisionAI::V1::SearchConfig. + p result +end +# [END visionai_v1_generated_Warehouse_CreateSearchConfig_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/create_search_hypernym.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/create_search_hypernym.rb new file mode 100644 index 000000000000..345c8da59d2f --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/create_search_hypernym.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 visionai_v1_generated_Warehouse_CreateSearchHypernym_sync] +require "google/cloud/vision_ai/v1" + +## +# Snippet for the create_search_hypernym call in the Warehouse 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::VisionAI::V1::Warehouse::Client#create_search_hypernym. +# +def create_search_hypernym + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VisionAI::V1::Warehouse::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VisionAI::V1::CreateSearchHypernymRequest.new + + # Call the create_search_hypernym method. + result = client.create_search_hypernym request + + # The returned object is of type Google::Cloud::VisionAI::V1::SearchHypernym. + p result +end +# [END visionai_v1_generated_Warehouse_CreateSearchHypernym_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/delete_annotation.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/delete_annotation.rb new file mode 100644 index 000000000000..f67d2d0c5785 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/delete_annotation.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 visionai_v1_generated_Warehouse_DeleteAnnotation_sync] +require "google/cloud/vision_ai/v1" + +## +# Snippet for the delete_annotation call in the Warehouse 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::VisionAI::V1::Warehouse::Client#delete_annotation. +# +def delete_annotation + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VisionAI::V1::Warehouse::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VisionAI::V1::DeleteAnnotationRequest.new + + # Call the delete_annotation method. + result = client.delete_annotation request + + # The returned object is of type Google::Protobuf::Empty. + p result +end +# [END visionai_v1_generated_Warehouse_DeleteAnnotation_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/delete_asset.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/delete_asset.rb new file mode 100644 index 000000000000..75ea7cad5721 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/delete_asset.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 visionai_v1_generated_Warehouse_DeleteAsset_sync] +require "google/cloud/vision_ai/v1" + +## +# Snippet for the delete_asset call in the Warehouse 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::VisionAI::V1::Warehouse::Client#delete_asset. +# +def delete_asset + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VisionAI::V1::Warehouse::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VisionAI::V1::DeleteAssetRequest.new + + # Call the delete_asset method. + result = client.delete_asset 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 visionai_v1_generated_Warehouse_DeleteAsset_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/delete_collection.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/delete_collection.rb new file mode 100644 index 000000000000..ac1d5a5d0b71 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/delete_collection.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 visionai_v1_generated_Warehouse_DeleteCollection_sync] +require "google/cloud/vision_ai/v1" + +## +# Snippet for the delete_collection call in the Warehouse 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::VisionAI::V1::Warehouse::Client#delete_collection. +# +def delete_collection + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VisionAI::V1::Warehouse::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VisionAI::V1::DeleteCollectionRequest.new + + # Call the delete_collection method. + result = client.delete_collection 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 visionai_v1_generated_Warehouse_DeleteCollection_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/delete_corpus.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/delete_corpus.rb new file mode 100644 index 000000000000..577feab9a30b --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/delete_corpus.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 visionai_v1_generated_Warehouse_DeleteCorpus_sync] +require "google/cloud/vision_ai/v1" + +## +# Snippet for the delete_corpus call in the Warehouse 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::VisionAI::V1::Warehouse::Client#delete_corpus. +# +def delete_corpus + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VisionAI::V1::Warehouse::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VisionAI::V1::DeleteCorpusRequest.new + + # Call the delete_corpus method. + result = client.delete_corpus request + + # The returned object is of type Google::Protobuf::Empty. + p result +end +# [END visionai_v1_generated_Warehouse_DeleteCorpus_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/delete_data_schema.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/delete_data_schema.rb new file mode 100644 index 000000000000..e862ecc39f53 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/delete_data_schema.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 visionai_v1_generated_Warehouse_DeleteDataSchema_sync] +require "google/cloud/vision_ai/v1" + +## +# Snippet for the delete_data_schema call in the Warehouse 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::VisionAI::V1::Warehouse::Client#delete_data_schema. +# +def delete_data_schema + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VisionAI::V1::Warehouse::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VisionAI::V1::DeleteDataSchemaRequest.new + + # Call the delete_data_schema method. + result = client.delete_data_schema request + + # The returned object is of type Google::Protobuf::Empty. + p result +end +# [END visionai_v1_generated_Warehouse_DeleteDataSchema_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/delete_index.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/delete_index.rb new file mode 100644 index 000000000000..a259d1af1f86 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/delete_index.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 visionai_v1_generated_Warehouse_DeleteIndex_sync] +require "google/cloud/vision_ai/v1" + +## +# Snippet for the delete_index call in the Warehouse 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::VisionAI::V1::Warehouse::Client#delete_index. +# +def delete_index + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VisionAI::V1::Warehouse::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VisionAI::V1::DeleteIndexRequest.new + + # Call the delete_index method. + result = client.delete_index 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 visionai_v1_generated_Warehouse_DeleteIndex_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/delete_index_endpoint.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/delete_index_endpoint.rb new file mode 100644 index 000000000000..17d3d327c3d9 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/delete_index_endpoint.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 visionai_v1_generated_Warehouse_DeleteIndexEndpoint_sync] +require "google/cloud/vision_ai/v1" + +## +# Snippet for the delete_index_endpoint call in the Warehouse 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::VisionAI::V1::Warehouse::Client#delete_index_endpoint. +# +def delete_index_endpoint + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VisionAI::V1::Warehouse::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VisionAI::V1::DeleteIndexEndpointRequest.new + + # Call the delete_index_endpoint method. + result = client.delete_index_endpoint 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 visionai_v1_generated_Warehouse_DeleteIndexEndpoint_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/delete_search_config.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/delete_search_config.rb new file mode 100644 index 000000000000..1f71387752d9 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/delete_search_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 visionai_v1_generated_Warehouse_DeleteSearchConfig_sync] +require "google/cloud/vision_ai/v1" + +## +# Snippet for the delete_search_config call in the Warehouse 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::VisionAI::V1::Warehouse::Client#delete_search_config. +# +def delete_search_config + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VisionAI::V1::Warehouse::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VisionAI::V1::DeleteSearchConfigRequest.new + + # Call the delete_search_config method. + result = client.delete_search_config request + + # The returned object is of type Google::Protobuf::Empty. + p result +end +# [END visionai_v1_generated_Warehouse_DeleteSearchConfig_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/delete_search_hypernym.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/delete_search_hypernym.rb new file mode 100644 index 000000000000..56192f4c5cb8 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/delete_search_hypernym.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 visionai_v1_generated_Warehouse_DeleteSearchHypernym_sync] +require "google/cloud/vision_ai/v1" + +## +# Snippet for the delete_search_hypernym call in the Warehouse 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::VisionAI::V1::Warehouse::Client#delete_search_hypernym. +# +def delete_search_hypernym + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VisionAI::V1::Warehouse::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VisionAI::V1::DeleteSearchHypernymRequest.new + + # Call the delete_search_hypernym method. + result = client.delete_search_hypernym request + + # The returned object is of type Google::Protobuf::Empty. + p result +end +# [END visionai_v1_generated_Warehouse_DeleteSearchHypernym_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/deploy_index.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/deploy_index.rb new file mode 100644 index 000000000000..fc231810d759 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/deploy_index.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 visionai_v1_generated_Warehouse_DeployIndex_sync] +require "google/cloud/vision_ai/v1" + +## +# Snippet for the deploy_index call in the Warehouse 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::VisionAI::V1::Warehouse::Client#deploy_index. +# +def deploy_index + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VisionAI::V1::Warehouse::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VisionAI::V1::DeployIndexRequest.new + + # Call the deploy_index method. + result = client.deploy_index 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 visionai_v1_generated_Warehouse_DeployIndex_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/generate_hls_uri.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/generate_hls_uri.rb new file mode 100644 index 000000000000..2186064e5617 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/generate_hls_uri.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 visionai_v1_generated_Warehouse_GenerateHlsUri_sync] +require "google/cloud/vision_ai/v1" + +## +# Snippet for the generate_hls_uri call in the Warehouse 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::VisionAI::V1::Warehouse::Client#generate_hls_uri. +# +def generate_hls_uri + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VisionAI::V1::Warehouse::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VisionAI::V1::GenerateHlsUriRequest.new + + # Call the generate_hls_uri method. + result = client.generate_hls_uri request + + # The returned object is of type Google::Cloud::VisionAI::V1::GenerateHlsUriResponse. + p result +end +# [END visionai_v1_generated_Warehouse_GenerateHlsUri_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/generate_retrieval_url.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/generate_retrieval_url.rb new file mode 100644 index 000000000000..0e226cc39f4b --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/generate_retrieval_url.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 visionai_v1_generated_Warehouse_GenerateRetrievalUrl_sync] +require "google/cloud/vision_ai/v1" + +## +# Snippet for the generate_retrieval_url call in the Warehouse 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::VisionAI::V1::Warehouse::Client#generate_retrieval_url. +# +def generate_retrieval_url + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VisionAI::V1::Warehouse::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VisionAI::V1::GenerateRetrievalUrlRequest.new + + # Call the generate_retrieval_url method. + result = client.generate_retrieval_url request + + # The returned object is of type Google::Cloud::VisionAI::V1::GenerateRetrievalUrlResponse. + p result +end +# [END visionai_v1_generated_Warehouse_GenerateRetrievalUrl_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/get_annotation.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/get_annotation.rb new file mode 100644 index 000000000000..d172d458d07f --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/get_annotation.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 visionai_v1_generated_Warehouse_GetAnnotation_sync] +require "google/cloud/vision_ai/v1" + +## +# Snippet for the get_annotation call in the Warehouse 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::VisionAI::V1::Warehouse::Client#get_annotation. +# +def get_annotation + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VisionAI::V1::Warehouse::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VisionAI::V1::GetAnnotationRequest.new + + # Call the get_annotation method. + result = client.get_annotation request + + # The returned object is of type Google::Cloud::VisionAI::V1::Annotation. + p result +end +# [END visionai_v1_generated_Warehouse_GetAnnotation_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/get_asset.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/get_asset.rb new file mode 100644 index 000000000000..8e9bf93d6c8e --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/get_asset.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 visionai_v1_generated_Warehouse_GetAsset_sync] +require "google/cloud/vision_ai/v1" + +## +# Snippet for the get_asset call in the Warehouse 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::VisionAI::V1::Warehouse::Client#get_asset. +# +def get_asset + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VisionAI::V1::Warehouse::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VisionAI::V1::GetAssetRequest.new + + # Call the get_asset method. + result = client.get_asset request + + # The returned object is of type Google::Cloud::VisionAI::V1::Asset. + p result +end +# [END visionai_v1_generated_Warehouse_GetAsset_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/get_collection.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/get_collection.rb new file mode 100644 index 000000000000..23b92eee4508 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/get_collection.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 visionai_v1_generated_Warehouse_GetCollection_sync] +require "google/cloud/vision_ai/v1" + +## +# Snippet for the get_collection call in the Warehouse 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::VisionAI::V1::Warehouse::Client#get_collection. +# +def get_collection + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VisionAI::V1::Warehouse::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VisionAI::V1::GetCollectionRequest.new + + # Call the get_collection method. + result = client.get_collection request + + # The returned object is of type Google::Cloud::VisionAI::V1::Collection. + p result +end +# [END visionai_v1_generated_Warehouse_GetCollection_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/get_corpus.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/get_corpus.rb new file mode 100644 index 000000000000..6a22887fca28 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/get_corpus.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 visionai_v1_generated_Warehouse_GetCorpus_sync] +require "google/cloud/vision_ai/v1" + +## +# Snippet for the get_corpus call in the Warehouse 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::VisionAI::V1::Warehouse::Client#get_corpus. +# +def get_corpus + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VisionAI::V1::Warehouse::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VisionAI::V1::GetCorpusRequest.new + + # Call the get_corpus method. + result = client.get_corpus request + + # The returned object is of type Google::Cloud::VisionAI::V1::Corpus. + p result +end +# [END visionai_v1_generated_Warehouse_GetCorpus_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/get_data_schema.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/get_data_schema.rb new file mode 100644 index 000000000000..6ea36076a235 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/get_data_schema.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 visionai_v1_generated_Warehouse_GetDataSchema_sync] +require "google/cloud/vision_ai/v1" + +## +# Snippet for the get_data_schema call in the Warehouse 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::VisionAI::V1::Warehouse::Client#get_data_schema. +# +def get_data_schema + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VisionAI::V1::Warehouse::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VisionAI::V1::GetDataSchemaRequest.new + + # Call the get_data_schema method. + result = client.get_data_schema request + + # The returned object is of type Google::Cloud::VisionAI::V1::DataSchema. + p result +end +# [END visionai_v1_generated_Warehouse_GetDataSchema_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/get_index.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/get_index.rb new file mode 100644 index 000000000000..ad2ebb971432 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/get_index.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 visionai_v1_generated_Warehouse_GetIndex_sync] +require "google/cloud/vision_ai/v1" + +## +# Snippet for the get_index call in the Warehouse 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::VisionAI::V1::Warehouse::Client#get_index. +# +def get_index + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VisionAI::V1::Warehouse::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VisionAI::V1::GetIndexRequest.new + + # Call the get_index method. + result = client.get_index request + + # The returned object is of type Google::Cloud::VisionAI::V1::Index. + p result +end +# [END visionai_v1_generated_Warehouse_GetIndex_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/get_index_endpoint.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/get_index_endpoint.rb new file mode 100644 index 000000000000..09ab4efe5e57 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/get_index_endpoint.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 visionai_v1_generated_Warehouse_GetIndexEndpoint_sync] +require "google/cloud/vision_ai/v1" + +## +# Snippet for the get_index_endpoint call in the Warehouse 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::VisionAI::V1::Warehouse::Client#get_index_endpoint. +# +def get_index_endpoint + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VisionAI::V1::Warehouse::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VisionAI::V1::GetIndexEndpointRequest.new + + # Call the get_index_endpoint method. + result = client.get_index_endpoint request + + # The returned object is of type Google::Cloud::VisionAI::V1::IndexEndpoint. + p result +end +# [END visionai_v1_generated_Warehouse_GetIndexEndpoint_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/get_search_config.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/get_search_config.rb new file mode 100644 index 000000000000..1d5d4e3d38e6 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/get_search_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 visionai_v1_generated_Warehouse_GetSearchConfig_sync] +require "google/cloud/vision_ai/v1" + +## +# Snippet for the get_search_config call in the Warehouse 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::VisionAI::V1::Warehouse::Client#get_search_config. +# +def get_search_config + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VisionAI::V1::Warehouse::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VisionAI::V1::GetSearchConfigRequest.new + + # Call the get_search_config method. + result = client.get_search_config request + + # The returned object is of type Google::Cloud::VisionAI::V1::SearchConfig. + p result +end +# [END visionai_v1_generated_Warehouse_GetSearchConfig_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/get_search_hypernym.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/get_search_hypernym.rb new file mode 100644 index 000000000000..e6274e953754 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/get_search_hypernym.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 visionai_v1_generated_Warehouse_GetSearchHypernym_sync] +require "google/cloud/vision_ai/v1" + +## +# Snippet for the get_search_hypernym call in the Warehouse 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::VisionAI::V1::Warehouse::Client#get_search_hypernym. +# +def get_search_hypernym + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VisionAI::V1::Warehouse::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VisionAI::V1::GetSearchHypernymRequest.new + + # Call the get_search_hypernym method. + result = client.get_search_hypernym request + + # The returned object is of type Google::Cloud::VisionAI::V1::SearchHypernym. + p result +end +# [END visionai_v1_generated_Warehouse_GetSearchHypernym_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/import_assets.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/import_assets.rb new file mode 100644 index 000000000000..37a4f97dd04f --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/import_assets.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 visionai_v1_generated_Warehouse_ImportAssets_sync] +require "google/cloud/vision_ai/v1" + +## +# Snippet for the import_assets call in the Warehouse 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::VisionAI::V1::Warehouse::Client#import_assets. +# +def import_assets + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VisionAI::V1::Warehouse::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VisionAI::V1::ImportAssetsRequest.new + + # Call the import_assets method. + result = client.import_assets 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 visionai_v1_generated_Warehouse_ImportAssets_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/index_asset.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/index_asset.rb new file mode 100644 index 000000000000..c60b09267253 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/index_asset.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 visionai_v1_generated_Warehouse_IndexAsset_sync] +require "google/cloud/vision_ai/v1" + +## +# Snippet for the index_asset call in the Warehouse 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::VisionAI::V1::Warehouse::Client#index_asset. +# +def index_asset + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VisionAI::V1::Warehouse::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VisionAI::V1::IndexAssetRequest.new + + # Call the index_asset method. + result = client.index_asset 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 visionai_v1_generated_Warehouse_IndexAsset_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/ingest_asset.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/ingest_asset.rb new file mode 100644 index 000000000000..0788e3149c94 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/ingest_asset.rb @@ -0,0 +1,56 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 visionai_v1_generated_Warehouse_IngestAsset_sync] +require "google/cloud/vision_ai/v1" + +## +# Snippet for the ingest_asset call in the Warehouse 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::VisionAI::V1::Warehouse::Client#ingest_asset. +# +def ingest_asset + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VisionAI::V1::Warehouse::Client.new + + # Create an input stream. + input = Gapic::StreamInput.new + + # Call the ingest_asset method to start streaming. + output = client.ingest_asset input + + # Send requests on the stream. For each request object, set fields by + # passing keyword arguments. Be sure to close the stream when done. + input << Google::Cloud::VisionAI::V1::IngestAssetRequest.new + input << Google::Cloud::VisionAI::V1::IngestAssetRequest.new + input.close + + # The returned object is a streamed enumerable yielding elements of type + # ::Google::Cloud::VisionAI::V1::IngestAssetResponse + output.each do |current_response| + p current_response + end +end +# [END visionai_v1_generated_Warehouse_IngestAsset_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/list_annotations.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/list_annotations.rb new file mode 100644 index 000000000000..5a3bc27d12bf --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/list_annotations.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 visionai_v1_generated_Warehouse_ListAnnotations_sync] +require "google/cloud/vision_ai/v1" + +## +# Snippet for the list_annotations call in the Warehouse 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::VisionAI::V1::Warehouse::Client#list_annotations. +# +def list_annotations + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VisionAI::V1::Warehouse::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VisionAI::V1::ListAnnotationsRequest.new + + # Call the list_annotations method. + result = client.list_annotations 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::VisionAI::V1::Annotation. + p item + end +end +# [END visionai_v1_generated_Warehouse_ListAnnotations_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/list_assets.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/list_assets.rb new file mode 100644 index 000000000000..a101fc07114e --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/list_assets.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 visionai_v1_generated_Warehouse_ListAssets_sync] +require "google/cloud/vision_ai/v1" + +## +# Snippet for the list_assets call in the Warehouse 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::VisionAI::V1::Warehouse::Client#list_assets. +# +def list_assets + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VisionAI::V1::Warehouse::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VisionAI::V1::ListAssetsRequest.new + + # Call the list_assets method. + result = client.list_assets 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::VisionAI::V1::Asset. + p item + end +end +# [END visionai_v1_generated_Warehouse_ListAssets_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/list_collections.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/list_collections.rb new file mode 100644 index 000000000000..4681d06db76d --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/list_collections.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 visionai_v1_generated_Warehouse_ListCollections_sync] +require "google/cloud/vision_ai/v1" + +## +# Snippet for the list_collections call in the Warehouse 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::VisionAI::V1::Warehouse::Client#list_collections. +# +def list_collections + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VisionAI::V1::Warehouse::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VisionAI::V1::ListCollectionsRequest.new + + # Call the list_collections method. + result = client.list_collections 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::VisionAI::V1::Collection. + p item + end +end +# [END visionai_v1_generated_Warehouse_ListCollections_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/list_corpora.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/list_corpora.rb new file mode 100644 index 000000000000..e7c8edd062e1 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/list_corpora.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 visionai_v1_generated_Warehouse_ListCorpora_sync] +require "google/cloud/vision_ai/v1" + +## +# Snippet for the list_corpora call in the Warehouse 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::VisionAI::V1::Warehouse::Client#list_corpora. +# +def list_corpora + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VisionAI::V1::Warehouse::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VisionAI::V1::ListCorporaRequest.new + + # Call the list_corpora method. + result = client.list_corpora 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::VisionAI::V1::Corpus. + p item + end +end +# [END visionai_v1_generated_Warehouse_ListCorpora_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/list_data_schemas.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/list_data_schemas.rb new file mode 100644 index 000000000000..18cd0ad1b0b5 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/list_data_schemas.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 visionai_v1_generated_Warehouse_ListDataSchemas_sync] +require "google/cloud/vision_ai/v1" + +## +# Snippet for the list_data_schemas call in the Warehouse 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::VisionAI::V1::Warehouse::Client#list_data_schemas. +# +def list_data_schemas + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VisionAI::V1::Warehouse::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VisionAI::V1::ListDataSchemasRequest.new + + # Call the list_data_schemas method. + result = client.list_data_schemas 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::VisionAI::V1::DataSchema. + p item + end +end +# [END visionai_v1_generated_Warehouse_ListDataSchemas_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/list_index_endpoints.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/list_index_endpoints.rb new file mode 100644 index 000000000000..274bfabd03a6 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/list_index_endpoints.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 visionai_v1_generated_Warehouse_ListIndexEndpoints_sync] +require "google/cloud/vision_ai/v1" + +## +# Snippet for the list_index_endpoints call in the Warehouse 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::VisionAI::V1::Warehouse::Client#list_index_endpoints. +# +def list_index_endpoints + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VisionAI::V1::Warehouse::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VisionAI::V1::ListIndexEndpointsRequest.new + + # Call the list_index_endpoints method. + result = client.list_index_endpoints 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::VisionAI::V1::IndexEndpoint. + p item + end +end +# [END visionai_v1_generated_Warehouse_ListIndexEndpoints_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/list_indexes.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/list_indexes.rb new file mode 100644 index 000000000000..fe91e984704a --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/list_indexes.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 visionai_v1_generated_Warehouse_ListIndexes_sync] +require "google/cloud/vision_ai/v1" + +## +# Snippet for the list_indexes call in the Warehouse 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::VisionAI::V1::Warehouse::Client#list_indexes. +# +def list_indexes + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VisionAI::V1::Warehouse::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VisionAI::V1::ListIndexesRequest.new + + # Call the list_indexes method. + result = client.list_indexes 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::VisionAI::V1::Index. + p item + end +end +# [END visionai_v1_generated_Warehouse_ListIndexes_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/list_search_configs.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/list_search_configs.rb new file mode 100644 index 000000000000..537e8564796e --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/list_search_configs.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 visionai_v1_generated_Warehouse_ListSearchConfigs_sync] +require "google/cloud/vision_ai/v1" + +## +# Snippet for the list_search_configs call in the Warehouse 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::VisionAI::V1::Warehouse::Client#list_search_configs. +# +def list_search_configs + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VisionAI::V1::Warehouse::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VisionAI::V1::ListSearchConfigsRequest.new + + # Call the list_search_configs method. + result = client.list_search_configs 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::VisionAI::V1::SearchConfig. + p item + end +end +# [END visionai_v1_generated_Warehouse_ListSearchConfigs_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/list_search_hypernyms.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/list_search_hypernyms.rb new file mode 100644 index 000000000000..592ca481c67a --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/list_search_hypernyms.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 visionai_v1_generated_Warehouse_ListSearchHypernyms_sync] +require "google/cloud/vision_ai/v1" + +## +# Snippet for the list_search_hypernyms call in the Warehouse 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::VisionAI::V1::Warehouse::Client#list_search_hypernyms. +# +def list_search_hypernyms + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VisionAI::V1::Warehouse::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VisionAI::V1::ListSearchHypernymsRequest.new + + # Call the list_search_hypernyms method. + result = client.list_search_hypernyms 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::VisionAI::V1::SearchHypernym. + p item + end +end +# [END visionai_v1_generated_Warehouse_ListSearchHypernyms_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/remove_collection_item.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/remove_collection_item.rb new file mode 100644 index 000000000000..f3235f3e1006 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/remove_collection_item.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 visionai_v1_generated_Warehouse_RemoveCollectionItem_sync] +require "google/cloud/vision_ai/v1" + +## +# Snippet for the remove_collection_item call in the Warehouse 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::VisionAI::V1::Warehouse::Client#remove_collection_item. +# +def remove_collection_item + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VisionAI::V1::Warehouse::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VisionAI::V1::RemoveCollectionItemRequest.new + + # Call the remove_collection_item method. + result = client.remove_collection_item request + + # The returned object is of type Google::Cloud::VisionAI::V1::RemoveCollectionItemResponse. + p result +end +# [END visionai_v1_generated_Warehouse_RemoveCollectionItem_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/remove_index_asset.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/remove_index_asset.rb new file mode 100644 index 000000000000..f9746297cbd9 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/remove_index_asset.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 visionai_v1_generated_Warehouse_RemoveIndexAsset_sync] +require "google/cloud/vision_ai/v1" + +## +# Snippet for the remove_index_asset call in the Warehouse 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::VisionAI::V1::Warehouse::Client#remove_index_asset. +# +def remove_index_asset + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VisionAI::V1::Warehouse::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VisionAI::V1::RemoveIndexAssetRequest.new + + # Call the remove_index_asset method. + result = client.remove_index_asset 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 visionai_v1_generated_Warehouse_RemoveIndexAsset_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/search_assets.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/search_assets.rb new file mode 100644 index 000000000000..8e6cbea7eee8 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/search_assets.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 visionai_v1_generated_Warehouse_SearchAssets_sync] +require "google/cloud/vision_ai/v1" + +## +# Snippet for the search_assets call in the Warehouse 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::VisionAI::V1::Warehouse::Client#search_assets. +# +def search_assets + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VisionAI::V1::Warehouse::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VisionAI::V1::SearchAssetsRequest.new + + # Call the search_assets method. + result = client.search_assets 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::VisionAI::V1::SearchResultItem. + p item + end +end +# [END visionai_v1_generated_Warehouse_SearchAssets_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/search_index_endpoint.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/search_index_endpoint.rb new file mode 100644 index 000000000000..e8ab8b2385cc --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/search_index_endpoint.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 visionai_v1_generated_Warehouse_SearchIndexEndpoint_sync] +require "google/cloud/vision_ai/v1" + +## +# Snippet for the search_index_endpoint call in the Warehouse 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::VisionAI::V1::Warehouse::Client#search_index_endpoint. +# +def search_index_endpoint + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VisionAI::V1::Warehouse::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VisionAI::V1::SearchIndexEndpointRequest.new + + # Call the search_index_endpoint method. + result = client.search_index_endpoint 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::VisionAI::V1::SearchResultItem. + p item + end +end +# [END visionai_v1_generated_Warehouse_SearchIndexEndpoint_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/undeploy_index.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/undeploy_index.rb new file mode 100644 index 000000000000..781e146dd029 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/undeploy_index.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 visionai_v1_generated_Warehouse_UndeployIndex_sync] +require "google/cloud/vision_ai/v1" + +## +# Snippet for the undeploy_index call in the Warehouse 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::VisionAI::V1::Warehouse::Client#undeploy_index. +# +def undeploy_index + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VisionAI::V1::Warehouse::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VisionAI::V1::UndeployIndexRequest.new + + # Call the undeploy_index method. + result = client.undeploy_index 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 visionai_v1_generated_Warehouse_UndeployIndex_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/update_annotation.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/update_annotation.rb new file mode 100644 index 000000000000..e1f8ef9eef68 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/update_annotation.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 visionai_v1_generated_Warehouse_UpdateAnnotation_sync] +require "google/cloud/vision_ai/v1" + +## +# Snippet for the update_annotation call in the Warehouse 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::VisionAI::V1::Warehouse::Client#update_annotation. +# +def update_annotation + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VisionAI::V1::Warehouse::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VisionAI::V1::UpdateAnnotationRequest.new + + # Call the update_annotation method. + result = client.update_annotation request + + # The returned object is of type Google::Cloud::VisionAI::V1::Annotation. + p result +end +# [END visionai_v1_generated_Warehouse_UpdateAnnotation_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/update_asset.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/update_asset.rb new file mode 100644 index 000000000000..1aba38e1656c --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/update_asset.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 visionai_v1_generated_Warehouse_UpdateAsset_sync] +require "google/cloud/vision_ai/v1" + +## +# Snippet for the update_asset call in the Warehouse 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::VisionAI::V1::Warehouse::Client#update_asset. +# +def update_asset + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VisionAI::V1::Warehouse::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VisionAI::V1::UpdateAssetRequest.new + + # Call the update_asset method. + result = client.update_asset request + + # The returned object is of type Google::Cloud::VisionAI::V1::Asset. + p result +end +# [END visionai_v1_generated_Warehouse_UpdateAsset_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/update_collection.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/update_collection.rb new file mode 100644 index 000000000000..13d6a1040d9d --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/update_collection.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 visionai_v1_generated_Warehouse_UpdateCollection_sync] +require "google/cloud/vision_ai/v1" + +## +# Snippet for the update_collection call in the Warehouse 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::VisionAI::V1::Warehouse::Client#update_collection. +# +def update_collection + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VisionAI::V1::Warehouse::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VisionAI::V1::UpdateCollectionRequest.new + + # Call the update_collection method. + result = client.update_collection request + + # The returned object is of type Google::Cloud::VisionAI::V1::Collection. + p result +end +# [END visionai_v1_generated_Warehouse_UpdateCollection_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/update_corpus.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/update_corpus.rb new file mode 100644 index 000000000000..4914f1b00e17 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/update_corpus.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 visionai_v1_generated_Warehouse_UpdateCorpus_sync] +require "google/cloud/vision_ai/v1" + +## +# Snippet for the update_corpus call in the Warehouse 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::VisionAI::V1::Warehouse::Client#update_corpus. +# +def update_corpus + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VisionAI::V1::Warehouse::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VisionAI::V1::UpdateCorpusRequest.new + + # Call the update_corpus method. + result = client.update_corpus request + + # The returned object is of type Google::Cloud::VisionAI::V1::Corpus. + p result +end +# [END visionai_v1_generated_Warehouse_UpdateCorpus_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/update_data_schema.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/update_data_schema.rb new file mode 100644 index 000000000000..c517d4d8c7f1 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/update_data_schema.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 visionai_v1_generated_Warehouse_UpdateDataSchema_sync] +require "google/cloud/vision_ai/v1" + +## +# Snippet for the update_data_schema call in the Warehouse 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::VisionAI::V1::Warehouse::Client#update_data_schema. +# +def update_data_schema + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VisionAI::V1::Warehouse::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VisionAI::V1::UpdateDataSchemaRequest.new + + # Call the update_data_schema method. + result = client.update_data_schema request + + # The returned object is of type Google::Cloud::VisionAI::V1::DataSchema. + p result +end +# [END visionai_v1_generated_Warehouse_UpdateDataSchema_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/update_index.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/update_index.rb new file mode 100644 index 000000000000..ba0ab104e62e --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/update_index.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 visionai_v1_generated_Warehouse_UpdateIndex_sync] +require "google/cloud/vision_ai/v1" + +## +# Snippet for the update_index call in the Warehouse 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::VisionAI::V1::Warehouse::Client#update_index. +# +def update_index + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VisionAI::V1::Warehouse::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VisionAI::V1::UpdateIndexRequest.new + + # Call the update_index method. + result = client.update_index 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 visionai_v1_generated_Warehouse_UpdateIndex_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/update_index_endpoint.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/update_index_endpoint.rb new file mode 100644 index 000000000000..d29fe60bfd8c --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/update_index_endpoint.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 visionai_v1_generated_Warehouse_UpdateIndexEndpoint_sync] +require "google/cloud/vision_ai/v1" + +## +# Snippet for the update_index_endpoint call in the Warehouse 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::VisionAI::V1::Warehouse::Client#update_index_endpoint. +# +def update_index_endpoint + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VisionAI::V1::Warehouse::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VisionAI::V1::UpdateIndexEndpointRequest.new + + # Call the update_index_endpoint method. + result = client.update_index_endpoint 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 visionai_v1_generated_Warehouse_UpdateIndexEndpoint_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/update_search_config.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/update_search_config.rb new file mode 100644 index 000000000000..e728c509312a --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/update_search_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 visionai_v1_generated_Warehouse_UpdateSearchConfig_sync] +require "google/cloud/vision_ai/v1" + +## +# Snippet for the update_search_config call in the Warehouse 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::VisionAI::V1::Warehouse::Client#update_search_config. +# +def update_search_config + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VisionAI::V1::Warehouse::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VisionAI::V1::UpdateSearchConfigRequest.new + + # Call the update_search_config method. + result = client.update_search_config request + + # The returned object is of type Google::Cloud::VisionAI::V1::SearchConfig. + p result +end +# [END visionai_v1_generated_Warehouse_UpdateSearchConfig_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/update_search_hypernym.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/update_search_hypernym.rb new file mode 100644 index 000000000000..269d1a7a4150 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/update_search_hypernym.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 visionai_v1_generated_Warehouse_UpdateSearchHypernym_sync] +require "google/cloud/vision_ai/v1" + +## +# Snippet for the update_search_hypernym call in the Warehouse 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::VisionAI::V1::Warehouse::Client#update_search_hypernym. +# +def update_search_hypernym + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VisionAI::V1::Warehouse::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VisionAI::V1::UpdateSearchHypernymRequest.new + + # Call the update_search_hypernym method. + result = client.update_search_hypernym request + + # The returned object is of type Google::Cloud::VisionAI::V1::SearchHypernym. + p result +end +# [END visionai_v1_generated_Warehouse_UpdateSearchHypernym_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/upload_asset.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/upload_asset.rb new file mode 100644 index 000000000000..5be01151eaeb --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/upload_asset.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 visionai_v1_generated_Warehouse_UploadAsset_sync] +require "google/cloud/vision_ai/v1" + +## +# Snippet for the upload_asset call in the Warehouse 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::VisionAI::V1::Warehouse::Client#upload_asset. +# +def upload_asset + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VisionAI::V1::Warehouse::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VisionAI::V1::UploadAssetRequest.new + + # Call the upload_asset method. + result = client.upload_asset 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 visionai_v1_generated_Warehouse_UploadAsset_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/view_collection_items.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/view_collection_items.rb new file mode 100644 index 000000000000..8b1b7f690add --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/view_collection_items.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 visionai_v1_generated_Warehouse_ViewCollectionItems_sync] +require "google/cloud/vision_ai/v1" + +## +# Snippet for the view_collection_items call in the Warehouse 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::VisionAI::V1::Warehouse::Client#view_collection_items. +# +def view_collection_items + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VisionAI::V1::Warehouse::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VisionAI::V1::ViewCollectionItemsRequest.new + + # Call the view_collection_items method. + result = client.view_collection_items 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::VisionAI::V1::CollectionItem. + p item + end +end +# [END visionai_v1_generated_Warehouse_ViewCollectionItems_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/view_indexed_assets.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/view_indexed_assets.rb new file mode 100644 index 000000000000..d806b79f3155 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/view_indexed_assets.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 visionai_v1_generated_Warehouse_ViewIndexedAssets_sync] +require "google/cloud/vision_ai/v1" + +## +# Snippet for the view_indexed_assets call in the Warehouse 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::VisionAI::V1::Warehouse::Client#view_indexed_assets. +# +def view_indexed_assets + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VisionAI::V1::Warehouse::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VisionAI::V1::ViewIndexedAssetsRequest.new + + # Call the view_indexed_assets method. + result = client.view_indexed_assets 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::VisionAI::V1::IndexedAsset. + p item + end +end +# [END visionai_v1_generated_Warehouse_ViewIndexedAssets_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/test/google/cloud/vision_ai/v1/app_platform_operations_test.rb b/owl-bot-staging/google-cloud-vision_ai-v1/test/google/cloud/vision_ai/v1/app_platform_operations_test.rb new file mode 100644 index 000000000000..96119834349a --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/test/google/cloud/vision_ai/v1/app_platform_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/visionai/v1/platform_pb" +require "google/cloud/visionai/v1/platform_services_pb" +require "google/cloud/vision_ai/v1/app_platform" + +class ::Google::Cloud::VisionAI::V1::AppPlatform::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::VisionAI::V1::AppPlatform::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::VisionAI::V1::AppPlatform::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::VisionAI::V1::AppPlatform::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::VisionAI::V1::AppPlatform::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::VisionAI::V1::AppPlatform::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::VisionAI::V1::AppPlatform::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::VisionAI::V1::AppPlatform::Operations::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/test/google/cloud/vision_ai/v1/app_platform_paths_test.rb b/owl-bot-staging/google-cloud-vision_ai-v1/test/google/cloud/vision_ai/v1/app_platform_paths_test.rb new file mode 100644 index 000000000000..0722bae45465 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/test/google/cloud/vision_ai/v1/app_platform_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/vision_ai/v1/app_platform" + +class ::Google::Cloud::VisionAI::V1::AppPlatform::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_application_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::VisionAI::V1::AppPlatform::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.application_path project: "value0", location: "value1", application: "value2" + assert_equal "projects/value0/locations/value1/applications/value2", path + end + end + + def test_draft_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::VisionAI::V1::AppPlatform::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.draft_path project: "value0", location: "value1", application: "value2", draft: "value3" + assert_equal "projects/value0/locations/value1/applications/value2/drafts/value3", path + end + end + + def test_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::VisionAI::V1::AppPlatform::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.instance_path project: "value0", location: "value1", application: "value2", instance: "value3" + assert_equal "projects/value0/locations/value1/applications/value2/instances/value3", 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::VisionAI::V1::AppPlatform::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_processor_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::VisionAI::V1::AppPlatform::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.processor_path project: "value0", location: "value1", processor: "value2" + assert_equal "projects/value0/locations/value1/processors/value2", path + end + end + + def test_stream_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::VisionAI::V1::AppPlatform::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.stream_path project: "value0", location: "value1", cluster: "value2", stream: "value3" + assert_equal "projects/value0/locations/value1/clusters/value2/streams/value3", path + end + end +end diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/test/google/cloud/vision_ai/v1/app_platform_rest_test.rb b/owl-bot-staging/google-cloud-vision_ai-v1/test/google/cloud/vision_ai/v1/app_platform_rest_test.rb new file mode 100644 index 000000000000..edaf23b96d0e --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/test/google/cloud/vision_ai/v1/app_platform_rest_test.rb @@ -0,0 +1,1557 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/visionai/v1/platform_pb" +require "google/cloud/vision_ai/v1/app_platform/rest" + + +class ::Google::Cloud::VisionAI::V1::AppPlatform::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_applications + # Create test objects. + client_result = ::Google::Cloud::VisionAI::V1::ListApplicationsResponse.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_applications_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::VisionAI::V1::AppPlatform::Rest::ServiceStub.stub :transcode_list_applications_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_applications_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::AppPlatform::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_applications({ 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_applications 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_applications ::Google::Cloud::VisionAI::V1::ListApplicationsRequest.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_applications({ 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_applications(::Google::Cloud::VisionAI::V1::ListApplicationsRequest.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_applications_client_stub.call_count + end + end + end + + def test_get_application + # Create test objects. + client_result = ::Google::Cloud::VisionAI::V1::Application.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_application_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::VisionAI::V1::AppPlatform::Rest::ServiceStub.stub :transcode_get_application_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_application_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::AppPlatform::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_application({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_application name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_application ::Google::Cloud::VisionAI::V1::GetApplicationRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_application({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_application(::Google::Cloud::VisionAI::V1::GetApplicationRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_application_client_stub.call_count + end + end + end + + def test_create_application + # 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" + application_id = "hello world" + application = {} + request_id = "hello world" + + create_application_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::VisionAI::V1::AppPlatform::Rest::ServiceStub.stub :transcode_create_application_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_application_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::AppPlatform::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_application({ parent: parent, application_id: application_id, application: application, request_id: request_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_application parent: parent, application_id: application_id, application: application, request_id: request_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_application ::Google::Cloud::VisionAI::V1::CreateApplicationRequest.new(parent: parent, application_id: application_id, application: application, request_id: request_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_application({ parent: parent, application_id: application_id, application: application, request_id: request_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_application(::Google::Cloud::VisionAI::V1::CreateApplicationRequest.new(parent: parent, application_id: application_id, application: application, request_id: request_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_application_client_stub.call_count + end + end + end + + def test_update_application + # 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. + update_mask = {} + application = {} + request_id = "hello world" + + update_application_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::VisionAI::V1::AppPlatform::Rest::ServiceStub.stub :transcode_update_application_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_application_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::AppPlatform::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_application({ update_mask: update_mask, application: application, request_id: request_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_application update_mask: update_mask, application: application, request_id: request_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_application ::Google::Cloud::VisionAI::V1::UpdateApplicationRequest.new(update_mask: update_mask, application: application, request_id: request_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_application({ update_mask: update_mask, application: application, request_id: request_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_application(::Google::Cloud::VisionAI::V1::UpdateApplicationRequest.new(update_mask: update_mask, application: application, request_id: request_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_application_client_stub.call_count + end + end + end + + def test_delete_application + # 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" + request_id = "hello world" + force = true + + delete_application_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::VisionAI::V1::AppPlatform::Rest::ServiceStub.stub :transcode_delete_application_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_application_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::AppPlatform::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_application({ name: name, request_id: request_id, force: force }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_application name: name, request_id: request_id, force: force do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_application ::Google::Cloud::VisionAI::V1::DeleteApplicationRequest.new(name: name, request_id: request_id, force: force) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_application({ name: name, request_id: request_id, force: force }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_application(::Google::Cloud::VisionAI::V1::DeleteApplicationRequest.new(name: name, request_id: request_id, force: force), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_application_client_stub.call_count + end + end + end + + def test_deploy_application + # 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" + validate_only = true + request_id = "hello world" + enable_monitoring = true + + deploy_application_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::VisionAI::V1::AppPlatform::Rest::ServiceStub.stub :transcode_deploy_application_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, deploy_application_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::AppPlatform::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.deploy_application({ name: name, validate_only: validate_only, request_id: request_id, enable_monitoring: enable_monitoring }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.deploy_application name: name, validate_only: validate_only, request_id: request_id, enable_monitoring: enable_monitoring do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.deploy_application ::Google::Cloud::VisionAI::V1::DeployApplicationRequest.new(name: name, validate_only: validate_only, request_id: request_id, enable_monitoring: enable_monitoring) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.deploy_application({ name: name, validate_only: validate_only, request_id: request_id, enable_monitoring: enable_monitoring }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.deploy_application(::Google::Cloud::VisionAI::V1::DeployApplicationRequest.new(name: name, validate_only: validate_only, request_id: request_id, enable_monitoring: enable_monitoring), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, deploy_application_client_stub.call_count + end + end + end + + def test_undeploy_application + # 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" + request_id = "hello world" + + undeploy_application_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::VisionAI::V1::AppPlatform::Rest::ServiceStub.stub :transcode_undeploy_application_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, undeploy_application_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::AppPlatform::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.undeploy_application({ name: name, request_id: request_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.undeploy_application name: name, request_id: request_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.undeploy_application ::Google::Cloud::VisionAI::V1::UndeployApplicationRequest.new(name: name, request_id: request_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.undeploy_application({ name: name, request_id: request_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.undeploy_application(::Google::Cloud::VisionAI::V1::UndeployApplicationRequest.new(name: name, request_id: request_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, undeploy_application_client_stub.call_count + end + end + end + + def test_add_application_stream_input + # 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" + application_stream_inputs = [{}] + request_id = "hello world" + + add_application_stream_input_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::VisionAI::V1::AppPlatform::Rest::ServiceStub.stub :transcode_add_application_stream_input_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, add_application_stream_input_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::AppPlatform::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.add_application_stream_input({ name: name, application_stream_inputs: application_stream_inputs, request_id: request_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.add_application_stream_input name: name, application_stream_inputs: application_stream_inputs, request_id: request_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.add_application_stream_input ::Google::Cloud::VisionAI::V1::AddApplicationStreamInputRequest.new(name: name, application_stream_inputs: application_stream_inputs, request_id: request_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.add_application_stream_input({ name: name, application_stream_inputs: application_stream_inputs, request_id: request_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.add_application_stream_input(::Google::Cloud::VisionAI::V1::AddApplicationStreamInputRequest.new(name: name, application_stream_inputs: application_stream_inputs, request_id: request_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, add_application_stream_input_client_stub.call_count + end + end + end + + def test_remove_application_stream_input + # 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" + target_stream_inputs = [{}] + request_id = "hello world" + + remove_application_stream_input_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::VisionAI::V1::AppPlatform::Rest::ServiceStub.stub :transcode_remove_application_stream_input_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, remove_application_stream_input_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::AppPlatform::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.remove_application_stream_input({ name: name, target_stream_inputs: target_stream_inputs, request_id: request_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.remove_application_stream_input name: name, target_stream_inputs: target_stream_inputs, request_id: request_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.remove_application_stream_input ::Google::Cloud::VisionAI::V1::RemoveApplicationStreamInputRequest.new(name: name, target_stream_inputs: target_stream_inputs, request_id: request_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.remove_application_stream_input({ name: name, target_stream_inputs: target_stream_inputs, request_id: request_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.remove_application_stream_input(::Google::Cloud::VisionAI::V1::RemoveApplicationStreamInputRequest.new(name: name, target_stream_inputs: target_stream_inputs, request_id: request_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, remove_application_stream_input_client_stub.call_count + end + end + end + + def test_update_application_stream_input + # 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" + application_stream_inputs = [{}] + request_id = "hello world" + allow_missing = true + + update_application_stream_input_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::VisionAI::V1::AppPlatform::Rest::ServiceStub.stub :transcode_update_application_stream_input_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_application_stream_input_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::AppPlatform::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_application_stream_input({ name: name, application_stream_inputs: application_stream_inputs, request_id: request_id, allow_missing: allow_missing }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_application_stream_input name: name, application_stream_inputs: application_stream_inputs, request_id: request_id, allow_missing: allow_missing do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_application_stream_input ::Google::Cloud::VisionAI::V1::UpdateApplicationStreamInputRequest.new(name: name, application_stream_inputs: application_stream_inputs, request_id: request_id, allow_missing: allow_missing) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_application_stream_input({ name: name, application_stream_inputs: application_stream_inputs, request_id: request_id, allow_missing: allow_missing }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_application_stream_input(::Google::Cloud::VisionAI::V1::UpdateApplicationStreamInputRequest.new(name: name, application_stream_inputs: application_stream_inputs, request_id: request_id, allow_missing: allow_missing), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_application_stream_input_client_stub.call_count + end + end + end + + def test_list_instances + # Create test objects. + client_result = ::Google::Cloud::VisionAI::V1::ListInstancesResponse.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_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::VisionAI::V1::AppPlatform::Rest::ServiceStub.stub :transcode_list_instances_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_instances_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::AppPlatform::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_instances({ 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_instances 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_instances ::Google::Cloud::VisionAI::V1::ListInstancesRequest.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_instances({ 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_instances(::Google::Cloud::VisionAI::V1::ListInstancesRequest.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_instances_client_stub.call_count + end + end + end + + def test_get_instance + # Create test objects. + client_result = ::Google::Cloud::VisionAI::V1::Instance.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_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::VisionAI::V1::AppPlatform::Rest::ServiceStub.stub :transcode_get_instance_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_instance_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::AppPlatform::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_instance({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_instance name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_instance ::Google::Cloud::VisionAI::V1::GetInstanceRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_instance({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_instance(::Google::Cloud::VisionAI::V1::GetInstanceRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_instance_client_stub.call_count + end + end + end + + def test_create_application_instances + # 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" + application_instances = [{}] + request_id = "hello world" + + create_application_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::VisionAI::V1::AppPlatform::Rest::ServiceStub.stub :transcode_create_application_instances_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_application_instances_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::AppPlatform::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_application_instances({ name: name, application_instances: application_instances, request_id: request_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_application_instances name: name, application_instances: application_instances, request_id: request_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_application_instances ::Google::Cloud::VisionAI::V1::CreateApplicationInstancesRequest.new(name: name, application_instances: application_instances, request_id: request_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_application_instances({ name: name, application_instances: application_instances, request_id: request_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_application_instances(::Google::Cloud::VisionAI::V1::CreateApplicationInstancesRequest.new(name: name, application_instances: application_instances, request_id: request_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_application_instances_client_stub.call_count + end + end + end + + def test_delete_application_instances + # 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" + instance_ids = ["hello world"] + request_id = "hello world" + + delete_application_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::VisionAI::V1::AppPlatform::Rest::ServiceStub.stub :transcode_delete_application_instances_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_application_instances_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::AppPlatform::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_application_instances({ name: name, instance_ids: instance_ids, request_id: request_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_application_instances name: name, instance_ids: instance_ids, request_id: request_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_application_instances ::Google::Cloud::VisionAI::V1::DeleteApplicationInstancesRequest.new(name: name, instance_ids: instance_ids, request_id: request_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_application_instances({ name: name, instance_ids: instance_ids, request_id: request_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_application_instances(::Google::Cloud::VisionAI::V1::DeleteApplicationInstancesRequest.new(name: name, instance_ids: instance_ids, request_id: request_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_application_instances_client_stub.call_count + end + end + end + + def test_update_application_instances + # 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" + application_instances = [{}] + request_id = "hello world" + allow_missing = true + + update_application_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::VisionAI::V1::AppPlatform::Rest::ServiceStub.stub :transcode_update_application_instances_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_application_instances_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::AppPlatform::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_application_instances({ name: name, application_instances: application_instances, request_id: request_id, allow_missing: allow_missing }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_application_instances name: name, application_instances: application_instances, request_id: request_id, allow_missing: allow_missing do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_application_instances ::Google::Cloud::VisionAI::V1::UpdateApplicationInstancesRequest.new(name: name, application_instances: application_instances, request_id: request_id, allow_missing: allow_missing) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_application_instances({ name: name, application_instances: application_instances, request_id: request_id, allow_missing: allow_missing }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_application_instances(::Google::Cloud::VisionAI::V1::UpdateApplicationInstancesRequest.new(name: name, application_instances: application_instances, request_id: request_id, allow_missing: allow_missing), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_application_instances_client_stub.call_count + end + end + end + + def test_list_drafts + # Create test objects. + client_result = ::Google::Cloud::VisionAI::V1::ListDraftsResponse.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_drafts_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::VisionAI::V1::AppPlatform::Rest::ServiceStub.stub :transcode_list_drafts_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_drafts_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::AppPlatform::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_drafts({ 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_drafts 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_drafts ::Google::Cloud::VisionAI::V1::ListDraftsRequest.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_drafts({ 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_drafts(::Google::Cloud::VisionAI::V1::ListDraftsRequest.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_drafts_client_stub.call_count + end + end + end + + def test_get_draft + # Create test objects. + client_result = ::Google::Cloud::VisionAI::V1::Draft.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_draft_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::VisionAI::V1::AppPlatform::Rest::ServiceStub.stub :transcode_get_draft_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_draft_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::AppPlatform::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_draft({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_draft name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_draft ::Google::Cloud::VisionAI::V1::GetDraftRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_draft({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_draft(::Google::Cloud::VisionAI::V1::GetDraftRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_draft_client_stub.call_count + end + end + end + + def test_create_draft + # 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" + draft_id = "hello world" + draft = {} + request_id = "hello world" + + create_draft_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::VisionAI::V1::AppPlatform::Rest::ServiceStub.stub :transcode_create_draft_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_draft_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::AppPlatform::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_draft({ parent: parent, draft_id: draft_id, draft: draft, request_id: request_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_draft parent: parent, draft_id: draft_id, draft: draft, request_id: request_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_draft ::Google::Cloud::VisionAI::V1::CreateDraftRequest.new(parent: parent, draft_id: draft_id, draft: draft, request_id: request_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_draft({ parent: parent, draft_id: draft_id, draft: draft, request_id: request_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_draft(::Google::Cloud::VisionAI::V1::CreateDraftRequest.new(parent: parent, draft_id: draft_id, draft: draft, request_id: request_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_draft_client_stub.call_count + end + end + end + + def test_update_draft + # 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. + update_mask = {} + draft = {} + request_id = "hello world" + allow_missing = true + + update_draft_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::VisionAI::V1::AppPlatform::Rest::ServiceStub.stub :transcode_update_draft_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_draft_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::AppPlatform::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_draft({ update_mask: update_mask, draft: draft, request_id: request_id, allow_missing: allow_missing }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_draft update_mask: update_mask, draft: draft, request_id: request_id, allow_missing: allow_missing do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_draft ::Google::Cloud::VisionAI::V1::UpdateDraftRequest.new(update_mask: update_mask, draft: draft, request_id: request_id, allow_missing: allow_missing) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_draft({ update_mask: update_mask, draft: draft, request_id: request_id, allow_missing: allow_missing }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_draft(::Google::Cloud::VisionAI::V1::UpdateDraftRequest.new(update_mask: update_mask, draft: draft, request_id: request_id, allow_missing: allow_missing), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_draft_client_stub.call_count + end + end + end + + def test_delete_draft + # 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" + request_id = "hello world" + + delete_draft_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::VisionAI::V1::AppPlatform::Rest::ServiceStub.stub :transcode_delete_draft_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_draft_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::AppPlatform::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_draft({ name: name, request_id: request_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_draft name: name, request_id: request_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_draft ::Google::Cloud::VisionAI::V1::DeleteDraftRequest.new(name: name, request_id: request_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_draft({ name: name, request_id: request_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_draft(::Google::Cloud::VisionAI::V1::DeleteDraftRequest.new(name: name, request_id: request_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_draft_client_stub.call_count + end + end + end + + def test_list_processors + # Create test objects. + client_result = ::Google::Cloud::VisionAI::V1::ListProcessorsResponse.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_processors_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::VisionAI::V1::AppPlatform::Rest::ServiceStub.stub :transcode_list_processors_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_processors_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::AppPlatform::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_processors({ 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_processors 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_processors ::Google::Cloud::VisionAI::V1::ListProcessorsRequest.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_processors({ 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_processors(::Google::Cloud::VisionAI::V1::ListProcessorsRequest.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_processors_client_stub.call_count + end + end + end + + def test_list_prebuilt_processors + # Create test objects. + client_result = ::Google::Cloud::VisionAI::V1::ListPrebuiltProcessorsResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + + list_prebuilt_processors_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::VisionAI::V1::AppPlatform::Rest::ServiceStub.stub :transcode_list_prebuilt_processors_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_prebuilt_processors_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::AppPlatform::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_prebuilt_processors({ parent: parent }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.list_prebuilt_processors parent: parent do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.list_prebuilt_processors ::Google::Cloud::VisionAI::V1::ListPrebuiltProcessorsRequest.new(parent: parent) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.list_prebuilt_processors({ parent: parent }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.list_prebuilt_processors(::Google::Cloud::VisionAI::V1::ListPrebuiltProcessorsRequest.new(parent: parent), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, list_prebuilt_processors_client_stub.call_count + end + end + end + + def test_get_processor + # Create test objects. + client_result = ::Google::Cloud::VisionAI::V1::Processor.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_processor_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::VisionAI::V1::AppPlatform::Rest::ServiceStub.stub :transcode_get_processor_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_processor_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::AppPlatform::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_processor({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_processor name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_processor ::Google::Cloud::VisionAI::V1::GetProcessorRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_processor({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_processor(::Google::Cloud::VisionAI::V1::GetProcessorRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_processor_client_stub.call_count + end + end + end + + def test_create_processor + # 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" + processor_id = "hello world" + processor = {} + request_id = "hello world" + + create_processor_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::VisionAI::V1::AppPlatform::Rest::ServiceStub.stub :transcode_create_processor_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_processor_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::AppPlatform::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_processor({ parent: parent, processor_id: processor_id, processor: processor, request_id: request_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_processor parent: parent, processor_id: processor_id, processor: processor, request_id: request_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_processor ::Google::Cloud::VisionAI::V1::CreateProcessorRequest.new(parent: parent, processor_id: processor_id, processor: processor, request_id: request_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_processor({ parent: parent, processor_id: processor_id, processor: processor, request_id: request_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_processor(::Google::Cloud::VisionAI::V1::CreateProcessorRequest.new(parent: parent, processor_id: processor_id, processor: processor, request_id: request_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_processor_client_stub.call_count + end + end + end + + def test_update_processor + # 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. + update_mask = {} + processor = {} + request_id = "hello world" + + update_processor_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::VisionAI::V1::AppPlatform::Rest::ServiceStub.stub :transcode_update_processor_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_processor_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::AppPlatform::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_processor({ update_mask: update_mask, processor: processor, request_id: request_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_processor update_mask: update_mask, processor: processor, request_id: request_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_processor ::Google::Cloud::VisionAI::V1::UpdateProcessorRequest.new(update_mask: update_mask, processor: processor, request_id: request_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_processor({ update_mask: update_mask, processor: processor, request_id: request_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_processor(::Google::Cloud::VisionAI::V1::UpdateProcessorRequest.new(update_mask: update_mask, processor: processor, request_id: request_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_processor_client_stub.call_count + end + end + end + + def test_delete_processor + # 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" + request_id = "hello world" + + delete_processor_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::VisionAI::V1::AppPlatform::Rest::ServiceStub.stub :transcode_delete_processor_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_processor_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::AppPlatform::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_processor({ name: name, request_id: request_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_processor name: name, request_id: request_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_processor ::Google::Cloud::VisionAI::V1::DeleteProcessorRequest.new(name: name, request_id: request_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_processor({ name: name, request_id: request_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_processor(::Google::Cloud::VisionAI::V1::DeleteProcessorRequest.new(name: name, request_id: request_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_processor_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::VisionAI::V1::AppPlatform::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::VisionAI::V1::AppPlatform::Rest::Client::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/test/google/cloud/vision_ai/v1/app_platform_test.rb b/owl-bot-staging/google-cloud-vision_ai-v1/test/google/cloud/vision_ai/v1/app_platform_test.rb new file mode 100644 index 000000000000..b99b3f3a85ab --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/test/google/cloud/vision_ai/v1/app_platform_test.rb @@ -0,0 +1,1839 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/visionai/v1/platform_pb" +require "google/cloud/vision_ai/v1/app_platform" + +class ::Google::Cloud::VisionAI::V1::AppPlatform::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_applications + # Create GRPC objects. + grpc_response = ::Google::Cloud::VisionAI::V1::ListApplicationsResponse.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_applications_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_applications, name + assert_kind_of ::Google::Cloud::VisionAI::V1::ListApplicationsRequest, 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_applications_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::AppPlatform::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_applications({ 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_applications 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_applications ::Google::Cloud::VisionAI::V1::ListApplicationsRequest.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_applications({ 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_applications(::Google::Cloud::VisionAI::V1::ListApplicationsRequest.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_applications_client_stub.call_rpc_count + end + end + + def test_get_application + # Create GRPC objects. + grpc_response = ::Google::Cloud::VisionAI::V1::Application.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_application_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_application, name + assert_kind_of ::Google::Cloud::VisionAI::V1::GetApplicationRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_application_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::AppPlatform::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_application({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_application name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_application ::Google::Cloud::VisionAI::V1::GetApplicationRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_application({ 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_application(::Google::Cloud::VisionAI::V1::GetApplicationRequest.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_application_client_stub.call_rpc_count + end + end + + def test_create_application + # 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" + application_id = "hello world" + application = {} + request_id = "hello world" + + create_application_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_application, name + assert_kind_of ::Google::Cloud::VisionAI::V1::CreateApplicationRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["application_id"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::VisionAI::V1::Application), request["application"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_application_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::AppPlatform::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_application({ parent: parent, application_id: application_id, application: application, request_id: request_id }) 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_application parent: parent, application_id: application_id, application: application, request_id: request_id 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_application ::Google::Cloud::VisionAI::V1::CreateApplicationRequest.new(parent: parent, application_id: application_id, application: application, request_id: request_id) 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_application({ parent: parent, application_id: application_id, application: application, request_id: request_id }, 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_application(::Google::Cloud::VisionAI::V1::CreateApplicationRequest.new(parent: parent, application_id: application_id, application: application, request_id: request_id), 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_application_client_stub.call_rpc_count + end + end + + def test_update_application + # 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. + update_mask = {} + application = {} + request_id = "hello world" + + update_application_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_application, name + assert_kind_of ::Google::Cloud::VisionAI::V1::UpdateApplicationRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::VisionAI::V1::Application), request["application"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_application_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::AppPlatform::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_application({ update_mask: update_mask, application: application, request_id: request_id }) 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.update_application update_mask: update_mask, application: application, request_id: request_id 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.update_application ::Google::Cloud::VisionAI::V1::UpdateApplicationRequest.new(update_mask: update_mask, application: application, request_id: request_id) 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.update_application({ update_mask: update_mask, application: application, request_id: request_id }, 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.update_application(::Google::Cloud::VisionAI::V1::UpdateApplicationRequest.new(update_mask: update_mask, application: application, request_id: request_id), 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, update_application_client_stub.call_rpc_count + end + end + + def test_delete_application + # 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" + request_id = "hello world" + force = true + + delete_application_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_application, name + assert_kind_of ::Google::Cloud::VisionAI::V1::DeleteApplicationRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["request_id"] + assert_equal true, request["force"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_application_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::AppPlatform::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_application({ name: name, request_id: request_id, force: force }) 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_application name: name, request_id: request_id, force: force 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_application ::Google::Cloud::VisionAI::V1::DeleteApplicationRequest.new(name: name, request_id: request_id, force: force) 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_application({ name: name, request_id: request_id, force: force }, 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_application(::Google::Cloud::VisionAI::V1::DeleteApplicationRequest.new(name: name, request_id: request_id, force: force), 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_application_client_stub.call_rpc_count + end + end + + def test_deploy_application + # 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" + validate_only = true + request_id = "hello world" + enable_monitoring = true + + deploy_application_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :deploy_application, name + assert_kind_of ::Google::Cloud::VisionAI::V1::DeployApplicationRequest, request + assert_equal "hello world", request["name"] + assert_equal true, request["validate_only"] + assert_equal "hello world", request["request_id"] + assert_equal true, request["enable_monitoring"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, deploy_application_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::AppPlatform::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.deploy_application({ name: name, validate_only: validate_only, request_id: request_id, enable_monitoring: enable_monitoring }) 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.deploy_application name: name, validate_only: validate_only, request_id: request_id, enable_monitoring: enable_monitoring 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.deploy_application ::Google::Cloud::VisionAI::V1::DeployApplicationRequest.new(name: name, validate_only: validate_only, request_id: request_id, enable_monitoring: enable_monitoring) 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.deploy_application({ name: name, validate_only: validate_only, request_id: request_id, enable_monitoring: enable_monitoring }, 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.deploy_application(::Google::Cloud::VisionAI::V1::DeployApplicationRequest.new(name: name, validate_only: validate_only, request_id: request_id, enable_monitoring: enable_monitoring), 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, deploy_application_client_stub.call_rpc_count + end + end + + def test_undeploy_application + # 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" + request_id = "hello world" + + undeploy_application_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :undeploy_application, name + assert_kind_of ::Google::Cloud::VisionAI::V1::UndeployApplicationRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, undeploy_application_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::AppPlatform::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.undeploy_application({ name: name, request_id: request_id }) 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.undeploy_application name: name, request_id: request_id 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.undeploy_application ::Google::Cloud::VisionAI::V1::UndeployApplicationRequest.new(name: name, request_id: request_id) 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.undeploy_application({ name: name, request_id: request_id }, 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.undeploy_application(::Google::Cloud::VisionAI::V1::UndeployApplicationRequest.new(name: name, request_id: request_id), 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, undeploy_application_client_stub.call_rpc_count + end + end + + def test_add_application_stream_input + # 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" + application_stream_inputs = [{}] + request_id = "hello world" + + add_application_stream_input_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :add_application_stream_input, name + assert_kind_of ::Google::Cloud::VisionAI::V1::AddApplicationStreamInputRequest, request + assert_equal "hello world", request["name"] + assert_kind_of ::Google::Cloud::VisionAI::V1::ApplicationStreamInput, request["application_stream_inputs"].first + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, add_application_stream_input_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::AppPlatform::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.add_application_stream_input({ name: name, application_stream_inputs: application_stream_inputs, request_id: request_id }) 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.add_application_stream_input name: name, application_stream_inputs: application_stream_inputs, request_id: request_id 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.add_application_stream_input ::Google::Cloud::VisionAI::V1::AddApplicationStreamInputRequest.new(name: name, application_stream_inputs: application_stream_inputs, request_id: request_id) 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.add_application_stream_input({ name: name, application_stream_inputs: application_stream_inputs, request_id: request_id }, 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.add_application_stream_input(::Google::Cloud::VisionAI::V1::AddApplicationStreamInputRequest.new(name: name, application_stream_inputs: application_stream_inputs, request_id: request_id), 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, add_application_stream_input_client_stub.call_rpc_count + end + end + + def test_remove_application_stream_input + # 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" + target_stream_inputs = [{}] + request_id = "hello world" + + remove_application_stream_input_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :remove_application_stream_input, name + assert_kind_of ::Google::Cloud::VisionAI::V1::RemoveApplicationStreamInputRequest, request + assert_equal "hello world", request["name"] + assert_kind_of ::Google::Cloud::VisionAI::V1::RemoveApplicationStreamInputRequest::TargetStreamInput, request["target_stream_inputs"].first + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, remove_application_stream_input_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::AppPlatform::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.remove_application_stream_input({ name: name, target_stream_inputs: target_stream_inputs, request_id: request_id }) 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.remove_application_stream_input name: name, target_stream_inputs: target_stream_inputs, request_id: request_id 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.remove_application_stream_input ::Google::Cloud::VisionAI::V1::RemoveApplicationStreamInputRequest.new(name: name, target_stream_inputs: target_stream_inputs, request_id: request_id) 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.remove_application_stream_input({ name: name, target_stream_inputs: target_stream_inputs, request_id: request_id }, 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.remove_application_stream_input(::Google::Cloud::VisionAI::V1::RemoveApplicationStreamInputRequest.new(name: name, target_stream_inputs: target_stream_inputs, request_id: request_id), 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, remove_application_stream_input_client_stub.call_rpc_count + end + end + + def test_update_application_stream_input + # 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" + application_stream_inputs = [{}] + request_id = "hello world" + allow_missing = true + + update_application_stream_input_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_application_stream_input, name + assert_kind_of ::Google::Cloud::VisionAI::V1::UpdateApplicationStreamInputRequest, request + assert_equal "hello world", request["name"] + assert_kind_of ::Google::Cloud::VisionAI::V1::ApplicationStreamInput, request["application_stream_inputs"].first + assert_equal "hello world", request["request_id"] + assert_equal true, request["allow_missing"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_application_stream_input_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::AppPlatform::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_application_stream_input({ name: name, application_stream_inputs: application_stream_inputs, request_id: request_id, allow_missing: allow_missing }) 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.update_application_stream_input name: name, application_stream_inputs: application_stream_inputs, request_id: request_id, allow_missing: allow_missing 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.update_application_stream_input ::Google::Cloud::VisionAI::V1::UpdateApplicationStreamInputRequest.new(name: name, application_stream_inputs: application_stream_inputs, request_id: request_id, allow_missing: allow_missing) 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.update_application_stream_input({ name: name, application_stream_inputs: application_stream_inputs, request_id: request_id, allow_missing: allow_missing }, 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.update_application_stream_input(::Google::Cloud::VisionAI::V1::UpdateApplicationStreamInputRequest.new(name: name, application_stream_inputs: application_stream_inputs, request_id: request_id, allow_missing: allow_missing), 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, update_application_stream_input_client_stub.call_rpc_count + end + end + + def test_list_instances + # Create GRPC objects. + grpc_response = ::Google::Cloud::VisionAI::V1::ListInstancesResponse.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_instances_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_instances, name + assert_kind_of ::Google::Cloud::VisionAI::V1::ListInstancesRequest, 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_instances_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::AppPlatform::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_instances({ 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_instances 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_instances ::Google::Cloud::VisionAI::V1::ListInstancesRequest.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_instances({ 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_instances(::Google::Cloud::VisionAI::V1::ListInstancesRequest.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_instances_client_stub.call_rpc_count + end + end + + def test_get_instance + # Create GRPC objects. + grpc_response = ::Google::Cloud::VisionAI::V1::Instance.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_instance_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_instance, name + assert_kind_of ::Google::Cloud::VisionAI::V1::GetInstanceRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_instance_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::AppPlatform::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_instance({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_instance name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_instance ::Google::Cloud::VisionAI::V1::GetInstanceRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_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_instance(::Google::Cloud::VisionAI::V1::GetInstanceRequest.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_instance_client_stub.call_rpc_count + end + end + + def test_create_application_instances + # 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" + application_instances = [{}] + request_id = "hello world" + + create_application_instances_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_application_instances, name + assert_kind_of ::Google::Cloud::VisionAI::V1::CreateApplicationInstancesRequest, request + assert_equal "hello world", request["name"] + assert_kind_of ::Google::Cloud::VisionAI::V1::ApplicationInstance, request["application_instances"].first + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_application_instances_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::AppPlatform::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_application_instances({ name: name, application_instances: application_instances, request_id: request_id }) 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_application_instances name: name, application_instances: application_instances, request_id: request_id 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_application_instances ::Google::Cloud::VisionAI::V1::CreateApplicationInstancesRequest.new(name: name, application_instances: application_instances, request_id: request_id) 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_application_instances({ name: name, application_instances: application_instances, request_id: request_id }, 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_application_instances(::Google::Cloud::VisionAI::V1::CreateApplicationInstancesRequest.new(name: name, application_instances: application_instances, request_id: request_id), 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_application_instances_client_stub.call_rpc_count + end + end + + def test_delete_application_instances + # 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" + instance_ids = ["hello world"] + request_id = "hello world" + + delete_application_instances_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_application_instances, name + assert_kind_of ::Google::Cloud::VisionAI::V1::DeleteApplicationInstancesRequest, request + assert_equal "hello world", request["name"] + assert_equal ["hello world"], request["instance_ids"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_application_instances_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::AppPlatform::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_application_instances({ name: name, instance_ids: instance_ids, request_id: request_id }) 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_application_instances name: name, instance_ids: instance_ids, request_id: request_id 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_application_instances ::Google::Cloud::VisionAI::V1::DeleteApplicationInstancesRequest.new(name: name, instance_ids: instance_ids, request_id: request_id) 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_application_instances({ name: name, instance_ids: instance_ids, request_id: request_id }, 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_application_instances(::Google::Cloud::VisionAI::V1::DeleteApplicationInstancesRequest.new(name: name, instance_ids: instance_ids, request_id: request_id), 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_application_instances_client_stub.call_rpc_count + end + end + + def test_update_application_instances + # 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" + application_instances = [{}] + request_id = "hello world" + allow_missing = true + + update_application_instances_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_application_instances, name + assert_kind_of ::Google::Cloud::VisionAI::V1::UpdateApplicationInstancesRequest, request + assert_equal "hello world", request["name"] + assert_kind_of ::Google::Cloud::VisionAI::V1::UpdateApplicationInstancesRequest::UpdateApplicationInstance, request["application_instances"].first + assert_equal "hello world", request["request_id"] + assert_equal true, request["allow_missing"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_application_instances_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::AppPlatform::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_application_instances({ name: name, application_instances: application_instances, request_id: request_id, allow_missing: allow_missing }) 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.update_application_instances name: name, application_instances: application_instances, request_id: request_id, allow_missing: allow_missing 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.update_application_instances ::Google::Cloud::VisionAI::V1::UpdateApplicationInstancesRequest.new(name: name, application_instances: application_instances, request_id: request_id, allow_missing: allow_missing) 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.update_application_instances({ name: name, application_instances: application_instances, request_id: request_id, allow_missing: allow_missing }, 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.update_application_instances(::Google::Cloud::VisionAI::V1::UpdateApplicationInstancesRequest.new(name: name, application_instances: application_instances, request_id: request_id, allow_missing: allow_missing), 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, update_application_instances_client_stub.call_rpc_count + end + end + + def test_list_drafts + # Create GRPC objects. + grpc_response = ::Google::Cloud::VisionAI::V1::ListDraftsResponse.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_drafts_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_drafts, name + assert_kind_of ::Google::Cloud::VisionAI::V1::ListDraftsRequest, 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_drafts_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::AppPlatform::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_drafts({ 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_drafts 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_drafts ::Google::Cloud::VisionAI::V1::ListDraftsRequest.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_drafts({ 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_drafts(::Google::Cloud::VisionAI::V1::ListDraftsRequest.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_drafts_client_stub.call_rpc_count + end + end + + def test_get_draft + # Create GRPC objects. + grpc_response = ::Google::Cloud::VisionAI::V1::Draft.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_draft_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_draft, name + assert_kind_of ::Google::Cloud::VisionAI::V1::GetDraftRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_draft_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::AppPlatform::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_draft({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_draft name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_draft ::Google::Cloud::VisionAI::V1::GetDraftRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_draft({ 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_draft(::Google::Cloud::VisionAI::V1::GetDraftRequest.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_draft_client_stub.call_rpc_count + end + end + + def test_create_draft + # 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" + draft_id = "hello world" + draft = {} + request_id = "hello world" + + create_draft_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_draft, name + assert_kind_of ::Google::Cloud::VisionAI::V1::CreateDraftRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["draft_id"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::VisionAI::V1::Draft), request["draft"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_draft_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::AppPlatform::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_draft({ parent: parent, draft_id: draft_id, draft: draft, request_id: request_id }) 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_draft parent: parent, draft_id: draft_id, draft: draft, request_id: request_id 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_draft ::Google::Cloud::VisionAI::V1::CreateDraftRequest.new(parent: parent, draft_id: draft_id, draft: draft, request_id: request_id) 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_draft({ parent: parent, draft_id: draft_id, draft: draft, request_id: request_id }, 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_draft(::Google::Cloud::VisionAI::V1::CreateDraftRequest.new(parent: parent, draft_id: draft_id, draft: draft, request_id: request_id), 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_draft_client_stub.call_rpc_count + end + end + + def test_update_draft + # 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. + update_mask = {} + draft = {} + request_id = "hello world" + allow_missing = true + + update_draft_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_draft, name + assert_kind_of ::Google::Cloud::VisionAI::V1::UpdateDraftRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::VisionAI::V1::Draft), request["draft"] + assert_equal "hello world", request["request_id"] + assert_equal true, request["allow_missing"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_draft_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::AppPlatform::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_draft({ update_mask: update_mask, draft: draft, request_id: request_id, allow_missing: allow_missing }) 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.update_draft update_mask: update_mask, draft: draft, request_id: request_id, allow_missing: allow_missing 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.update_draft ::Google::Cloud::VisionAI::V1::UpdateDraftRequest.new(update_mask: update_mask, draft: draft, request_id: request_id, allow_missing: allow_missing) 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.update_draft({ update_mask: update_mask, draft: draft, request_id: request_id, allow_missing: allow_missing }, 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.update_draft(::Google::Cloud::VisionAI::V1::UpdateDraftRequest.new(update_mask: update_mask, draft: draft, request_id: request_id, allow_missing: allow_missing), 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, update_draft_client_stub.call_rpc_count + end + end + + def test_delete_draft + # 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" + request_id = "hello world" + + delete_draft_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_draft, name + assert_kind_of ::Google::Cloud::VisionAI::V1::DeleteDraftRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_draft_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::AppPlatform::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_draft({ name: name, request_id: request_id }) 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_draft name: name, request_id: request_id 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_draft ::Google::Cloud::VisionAI::V1::DeleteDraftRequest.new(name: name, request_id: request_id) 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_draft({ name: name, request_id: request_id }, 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_draft(::Google::Cloud::VisionAI::V1::DeleteDraftRequest.new(name: name, request_id: request_id), 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_draft_client_stub.call_rpc_count + end + end + + def test_list_processors + # Create GRPC objects. + grpc_response = ::Google::Cloud::VisionAI::V1::ListProcessorsResponse.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_processors_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_processors, name + assert_kind_of ::Google::Cloud::VisionAI::V1::ListProcessorsRequest, 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_processors_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::AppPlatform::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_processors({ 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_processors 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_processors ::Google::Cloud::VisionAI::V1::ListProcessorsRequest.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_processors({ 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_processors(::Google::Cloud::VisionAI::V1::ListProcessorsRequest.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_processors_client_stub.call_rpc_count + end + end + + def test_list_prebuilt_processors + # Create GRPC objects. + grpc_response = ::Google::Cloud::VisionAI::V1::ListPrebuiltProcessorsResponse.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" + + list_prebuilt_processors_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_prebuilt_processors, name + assert_kind_of ::Google::Cloud::VisionAI::V1::ListPrebuiltProcessorsRequest, request + assert_equal "hello world", request["parent"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_prebuilt_processors_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::AppPlatform::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_prebuilt_processors({ parent: parent }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.list_prebuilt_processors parent: parent do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.list_prebuilt_processors ::Google::Cloud::VisionAI::V1::ListPrebuiltProcessorsRequest.new(parent: parent) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.list_prebuilt_processors({ parent: parent }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.list_prebuilt_processors(::Google::Cloud::VisionAI::V1::ListPrebuiltProcessorsRequest.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, list_prebuilt_processors_client_stub.call_rpc_count + end + end + + def test_get_processor + # Create GRPC objects. + grpc_response = ::Google::Cloud::VisionAI::V1::Processor.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_processor_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_processor, name + assert_kind_of ::Google::Cloud::VisionAI::V1::GetProcessorRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_processor_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::AppPlatform::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_processor({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_processor name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_processor ::Google::Cloud::VisionAI::V1::GetProcessorRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_processor({ 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_processor(::Google::Cloud::VisionAI::V1::GetProcessorRequest.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_processor_client_stub.call_rpc_count + end + end + + def test_create_processor + # 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" + processor_id = "hello world" + processor = {} + request_id = "hello world" + + create_processor_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_processor, name + assert_kind_of ::Google::Cloud::VisionAI::V1::CreateProcessorRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["processor_id"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::VisionAI::V1::Processor), request["processor"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_processor_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::AppPlatform::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_processor({ parent: parent, processor_id: processor_id, processor: processor, request_id: request_id }) 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_processor parent: parent, processor_id: processor_id, processor: processor, request_id: request_id 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_processor ::Google::Cloud::VisionAI::V1::CreateProcessorRequest.new(parent: parent, processor_id: processor_id, processor: processor, request_id: request_id) 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_processor({ parent: parent, processor_id: processor_id, processor: processor, request_id: request_id }, 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_processor(::Google::Cloud::VisionAI::V1::CreateProcessorRequest.new(parent: parent, processor_id: processor_id, processor: processor, request_id: request_id), 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_processor_client_stub.call_rpc_count + end + end + + def test_update_processor + # 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. + update_mask = {} + processor = {} + request_id = "hello world" + + update_processor_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_processor, name + assert_kind_of ::Google::Cloud::VisionAI::V1::UpdateProcessorRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::VisionAI::V1::Processor), request["processor"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_processor_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::AppPlatform::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_processor({ update_mask: update_mask, processor: processor, request_id: request_id }) 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.update_processor update_mask: update_mask, processor: processor, request_id: request_id 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.update_processor ::Google::Cloud::VisionAI::V1::UpdateProcessorRequest.new(update_mask: update_mask, processor: processor, request_id: request_id) 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.update_processor({ update_mask: update_mask, processor: processor, request_id: request_id }, 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.update_processor(::Google::Cloud::VisionAI::V1::UpdateProcessorRequest.new(update_mask: update_mask, processor: processor, request_id: request_id), 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, update_processor_client_stub.call_rpc_count + end + end + + def test_delete_processor + # 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" + request_id = "hello world" + + delete_processor_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_processor, name + assert_kind_of ::Google::Cloud::VisionAI::V1::DeleteProcessorRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_processor_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::AppPlatform::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_processor({ name: name, request_id: request_id }) 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_processor name: name, request_id: request_id 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_processor ::Google::Cloud::VisionAI::V1::DeleteProcessorRequest.new(name: name, request_id: request_id) 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_processor({ name: name, request_id: request_id }, 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_processor(::Google::Cloud::VisionAI::V1::DeleteProcessorRequest.new(name: name, request_id: request_id), 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_processor_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::VisionAI::V1::AppPlatform::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::VisionAI::V1::AppPlatform::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::VisionAI::V1::AppPlatform::Client.new do |config| + config.credentials = creds + end + assert_kind_of ::Google::Cloud::VisionAI::V1::AppPlatform::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::VisionAI::V1::AppPlatform::Client.new do |config| + config.credentials = grpc_channel + end + end + + assert_kind_of ::Google::Cloud::VisionAI::V1::AppPlatform::Operations, client.operations_client + end +end diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/test/google/cloud/vision_ai/v1/health_check_service_paths_test.rb b/owl-bot-staging/google-cloud-vision_ai-v1/test/google/cloud/vision_ai/v1/health_check_service_paths_test.rb new file mode 100644 index 000000000000..aa5292b8c2a7 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/test/google/cloud/vision_ai/v1/health_check_service_paths_test.rb @@ -0,0 +1,55 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/vision_ai/v1/health_check_service" + +class ::Google::Cloud::VisionAI::V1::HealthCheckService::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_cluster_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::VisionAI::V1::HealthCheckService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.cluster_path project: "value0", location: "value1", cluster: "value2" + assert_equal "projects/value0/locations/value1/clusters/value2", path + end + end +end diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/test/google/cloud/vision_ai/v1/health_check_service_rest_test.rb b/owl-bot-staging/google-cloud-vision_ai-v1/test/google/cloud/vision_ai/v1/health_check_service_rest_test.rb new file mode 100644 index 000000000000..c65284b162ca --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/test/google/cloud/vision_ai/v1/health_check_service_rest_test.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! + +require "helper" +require "gapic/rest" +require "google/cloud/visionai/v1/health_service_pb" +require "google/cloud/vision_ai/v1/health_check_service/rest" + + +class ::Google::Cloud::VisionAI::V1::HealthCheckService::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_health_check + # Create test objects. + client_result = ::Google::Cloud::VisionAI::V1::HealthCheckResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + cluster = "hello world" + + health_check_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::VisionAI::V1::HealthCheckService::Rest::ServiceStub.stub :transcode_health_check_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, health_check_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::HealthCheckService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.health_check({ cluster: cluster }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.health_check cluster: cluster do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.health_check ::Google::Cloud::VisionAI::V1::HealthCheckRequest.new(cluster: cluster) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.health_check({ cluster: cluster }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.health_check(::Google::Cloud::VisionAI::V1::HealthCheckRequest.new(cluster: cluster), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, health_check_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::VisionAI::V1::HealthCheckService::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::VisionAI::V1::HealthCheckService::Rest::Client::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/test/google/cloud/vision_ai/v1/health_check_service_test.rb b/owl-bot-staging/google-cloud-vision_ai-v1/test/google/cloud/vision_ai/v1/health_check_service_test.rb new file mode 100644 index 000000000000..23fa3b5e6890 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/test/google/cloud/vision_ai/v1/health_check_service_test.rb @@ -0,0 +1,162 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/visionai/v1/health_service_pb" +require "google/cloud/vision_ai/v1/health_check_service" + +class ::Google::Cloud::VisionAI::V1::HealthCheckService::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_health_check + # Create GRPC objects. + grpc_response = ::Google::Cloud::VisionAI::V1::HealthCheckResponse.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. + cluster = "hello world" + + health_check_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :health_check, name + assert_kind_of ::Google::Cloud::VisionAI::V1::HealthCheckRequest, request + assert_equal "hello world", request["cluster"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, health_check_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::HealthCheckService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.health_check({ cluster: cluster }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.health_check cluster: cluster do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.health_check ::Google::Cloud::VisionAI::V1::HealthCheckRequest.new(cluster: cluster) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.health_check({ cluster: cluster }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.health_check(::Google::Cloud::VisionAI::V1::HealthCheckRequest.new(cluster: cluster), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, health_check_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::VisionAI::V1::HealthCheckService::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::VisionAI::V1::HealthCheckService::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::VisionAI::V1::HealthCheckService::Client.new do |config| + config.credentials = creds + end + assert_kind_of ::Google::Cloud::VisionAI::V1::HealthCheckService::Client, client + assert_equal creds, client.configure.credentials + end + end +end diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/test/google/cloud/vision_ai/v1/live_video_analytics_operations_test.rb b/owl-bot-staging/google-cloud-vision_ai-v1/test/google/cloud/vision_ai/v1/live_video_analytics_operations_test.rb new file mode 100644 index 000000000000..ff6b3c5d53f4 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/test/google/cloud/vision_ai/v1/live_video_analytics_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/visionai/v1/lva_service_pb" +require "google/cloud/visionai/v1/lva_service_services_pb" +require "google/cloud/vision_ai/v1/live_video_analytics" + +class ::Google::Cloud::VisionAI::V1::LiveVideoAnalytics::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::VisionAI::V1::LiveVideoAnalytics::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::VisionAI::V1::LiveVideoAnalytics::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::VisionAI::V1::LiveVideoAnalytics::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::VisionAI::V1::LiveVideoAnalytics::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::VisionAI::V1::LiveVideoAnalytics::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::VisionAI::V1::LiveVideoAnalytics::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::VisionAI::V1::LiveVideoAnalytics::Operations::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/test/google/cloud/vision_ai/v1/live_video_analytics_paths_test.rb b/owl-bot-staging/google-cloud-vision_ai-v1/test/google/cloud/vision_ai/v1/live_video_analytics_paths_test.rb new file mode 100644 index 000000000000..42cb1104561f --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/test/google/cloud/vision_ai/v1/live_video_analytics_paths_test.rb @@ -0,0 +1,103 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/vision_ai/v1/live_video_analytics" + +class ::Google::Cloud::VisionAI::V1::LiveVideoAnalytics::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_analysis_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.analysis_path project: "value0", location: "value1", cluster: "value2", analysis: "value3" + assert_equal "projects/value0/locations/value1/clusters/value2/analyses/value3", path + end + end + + def test_cluster_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.cluster_path project: "value0", location: "value1", cluster: "value2" + assert_equal "projects/value0/locations/value1/clusters/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::VisionAI::V1::LiveVideoAnalytics::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_operator_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.operator_path project: "value0", location: "value1", operator: "value2" + assert_equal "projects/value0/locations/value1/operators/value2", path + end + end + + def test_process_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.process_path project: "value0", location: "value1", cluster: "value2", process: "value3" + assert_equal "projects/value0/locations/value1/clusters/value2/processes/value3", path + end + end +end diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/test/google/cloud/vision_ai/v1/live_video_analytics_rest_test.rb b/owl-bot-staging/google-cloud-vision_ai-v1/test/google/cloud/vision_ai/v1/live_video_analytics_rest_test.rb new file mode 100644 index 000000000000..28486f672da7 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/test/google/cloud/vision_ai/v1/live_video_analytics_rest_test.rb @@ -0,0 +1,1109 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/visionai/v1/lva_service_pb" +require "google/cloud/vision_ai/v1/live_video_analytics/rest" + + +class ::Google::Cloud::VisionAI::V1::LiveVideoAnalytics::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_public_operators + # Create test objects. + client_result = ::Google::Cloud::VisionAI::V1::ListPublicOperatorsResponse.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_public_operators_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::VisionAI::V1::LiveVideoAnalytics::Rest::ServiceStub.stub :transcode_list_public_operators_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_public_operators_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_public_operators({ 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_public_operators 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_public_operators ::Google::Cloud::VisionAI::V1::ListPublicOperatorsRequest.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_public_operators({ 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_public_operators(::Google::Cloud::VisionAI::V1::ListPublicOperatorsRequest.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_public_operators_client_stub.call_count + end + end + end + + def test_resolve_operator_info + # Create test objects. + client_result = ::Google::Cloud::VisionAI::V1::ResolveOperatorInfoResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + queries = [{}] + + resolve_operator_info_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::VisionAI::V1::LiveVideoAnalytics::Rest::ServiceStub.stub :transcode_resolve_operator_info_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, resolve_operator_info_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.resolve_operator_info({ parent: parent, queries: queries }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.resolve_operator_info parent: parent, queries: queries do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.resolve_operator_info ::Google::Cloud::VisionAI::V1::ResolveOperatorInfoRequest.new(parent: parent, queries: queries) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.resolve_operator_info({ parent: parent, queries: queries }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.resolve_operator_info(::Google::Cloud::VisionAI::V1::ResolveOperatorInfoRequest.new(parent: parent, queries: queries), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, resolve_operator_info_client_stub.call_count + end + end + end + + def test_list_operators + # Create test objects. + client_result = ::Google::Cloud::VisionAI::V1::ListOperatorsResponse.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_operators_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::VisionAI::V1::LiveVideoAnalytics::Rest::ServiceStub.stub :transcode_list_operators_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_operators_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_operators({ 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_operators 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_operators ::Google::Cloud::VisionAI::V1::ListOperatorsRequest.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_operators({ 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_operators(::Google::Cloud::VisionAI::V1::ListOperatorsRequest.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_operators_client_stub.call_count + end + end + end + + def test_get_operator + # Create test objects. + client_result = ::Google::Cloud::VisionAI::V1::Operator.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_operator_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::VisionAI::V1::LiveVideoAnalytics::Rest::ServiceStub.stub :transcode_get_operator_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_operator_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_operator({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_operator name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_operator ::Google::Cloud::VisionAI::V1::GetOperatorRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_operator({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_operator(::Google::Cloud::VisionAI::V1::GetOperatorRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_operator_client_stub.call_count + end + end + end + + def test_create_operator + # 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" + operator_id = "hello world" + operator = {} + request_id = "hello world" + + create_operator_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::VisionAI::V1::LiveVideoAnalytics::Rest::ServiceStub.stub :transcode_create_operator_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_operator_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_operator({ parent: parent, operator_id: operator_id, operator: operator, request_id: request_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_operator parent: parent, operator_id: operator_id, operator: operator, request_id: request_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_operator ::Google::Cloud::VisionAI::V1::CreateOperatorRequest.new(parent: parent, operator_id: operator_id, operator: operator, request_id: request_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_operator({ parent: parent, operator_id: operator_id, operator: operator, request_id: request_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_operator(::Google::Cloud::VisionAI::V1::CreateOperatorRequest.new(parent: parent, operator_id: operator_id, operator: operator, request_id: request_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_operator_client_stub.call_count + end + end + end + + def test_update_operator + # 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. + update_mask = {} + operator = {} + request_id = "hello world" + + update_operator_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::VisionAI::V1::LiveVideoAnalytics::Rest::ServiceStub.stub :transcode_update_operator_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_operator_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_operator({ update_mask: update_mask, operator: operator, request_id: request_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_operator update_mask: update_mask, operator: operator, request_id: request_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_operator ::Google::Cloud::VisionAI::V1::UpdateOperatorRequest.new(update_mask: update_mask, operator: operator, request_id: request_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_operator({ update_mask: update_mask, operator: operator, request_id: request_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_operator(::Google::Cloud::VisionAI::V1::UpdateOperatorRequest.new(update_mask: update_mask, operator: operator, request_id: request_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_operator_client_stub.call_count + end + end + end + + def test_delete_operator + # 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" + request_id = "hello world" + + delete_operator_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::VisionAI::V1::LiveVideoAnalytics::Rest::ServiceStub.stub :transcode_delete_operator_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_operator_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_operator({ name: name, request_id: request_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_operator name: name, request_id: request_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_operator ::Google::Cloud::VisionAI::V1::DeleteOperatorRequest.new(name: name, request_id: request_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_operator({ name: name, request_id: request_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_operator(::Google::Cloud::VisionAI::V1::DeleteOperatorRequest.new(name: name, request_id: request_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_operator_client_stub.call_count + end + end + end + + def test_list_analyses + # Create test objects. + client_result = ::Google::Cloud::VisionAI::V1::ListAnalysesResponse.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_analyses_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::VisionAI::V1::LiveVideoAnalytics::Rest::ServiceStub.stub :transcode_list_analyses_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_analyses_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_analyses({ 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_analyses 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_analyses ::Google::Cloud::VisionAI::V1::ListAnalysesRequest.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_analyses({ 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_analyses(::Google::Cloud::VisionAI::V1::ListAnalysesRequest.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_analyses_client_stub.call_count + end + end + end + + def test_get_analysis + # Create test objects. + client_result = ::Google::Cloud::VisionAI::V1::Analysis.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_analysis_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::VisionAI::V1::LiveVideoAnalytics::Rest::ServiceStub.stub :transcode_get_analysis_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_analysis_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_analysis({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_analysis name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_analysis ::Google::Cloud::VisionAI::V1::GetAnalysisRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_analysis({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_analysis(::Google::Cloud::VisionAI::V1::GetAnalysisRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_analysis_client_stub.call_count + end + end + end + + def test_create_analysis + # 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" + analysis_id = "hello world" + analysis = {} + request_id = "hello world" + + create_analysis_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::VisionAI::V1::LiveVideoAnalytics::Rest::ServiceStub.stub :transcode_create_analysis_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_analysis_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_analysis({ parent: parent, analysis_id: analysis_id, analysis: analysis, request_id: request_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_analysis parent: parent, analysis_id: analysis_id, analysis: analysis, request_id: request_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_analysis ::Google::Cloud::VisionAI::V1::CreateAnalysisRequest.new(parent: parent, analysis_id: analysis_id, analysis: analysis, request_id: request_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_analysis({ parent: parent, analysis_id: analysis_id, analysis: analysis, request_id: request_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_analysis(::Google::Cloud::VisionAI::V1::CreateAnalysisRequest.new(parent: parent, analysis_id: analysis_id, analysis: analysis, request_id: request_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_analysis_client_stub.call_count + end + end + end + + def test_update_analysis + # 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. + update_mask = {} + analysis = {} + request_id = "hello world" + + update_analysis_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::VisionAI::V1::LiveVideoAnalytics::Rest::ServiceStub.stub :transcode_update_analysis_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_analysis_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_analysis({ update_mask: update_mask, analysis: analysis, request_id: request_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_analysis update_mask: update_mask, analysis: analysis, request_id: request_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_analysis ::Google::Cloud::VisionAI::V1::UpdateAnalysisRequest.new(update_mask: update_mask, analysis: analysis, request_id: request_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_analysis({ update_mask: update_mask, analysis: analysis, request_id: request_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_analysis(::Google::Cloud::VisionAI::V1::UpdateAnalysisRequest.new(update_mask: update_mask, analysis: analysis, request_id: request_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_analysis_client_stub.call_count + end + end + end + + def test_delete_analysis + # 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" + request_id = "hello world" + + delete_analysis_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::VisionAI::V1::LiveVideoAnalytics::Rest::ServiceStub.stub :transcode_delete_analysis_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_analysis_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_analysis({ name: name, request_id: request_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_analysis name: name, request_id: request_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_analysis ::Google::Cloud::VisionAI::V1::DeleteAnalysisRequest.new(name: name, request_id: request_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_analysis({ name: name, request_id: request_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_analysis(::Google::Cloud::VisionAI::V1::DeleteAnalysisRequest.new(name: name, request_id: request_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_analysis_client_stub.call_count + end + end + end + + def test_list_processes + # Create test objects. + client_result = ::Google::Cloud::VisionAI::V1::ListProcessesResponse.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_processes_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::VisionAI::V1::LiveVideoAnalytics::Rest::ServiceStub.stub :transcode_list_processes_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_processes_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_processes({ 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_processes 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_processes ::Google::Cloud::VisionAI::V1::ListProcessesRequest.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_processes({ 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_processes(::Google::Cloud::VisionAI::V1::ListProcessesRequest.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_processes_client_stub.call_count + end + end + end + + def test_get_process + # Create test objects. + client_result = ::Google::Cloud::VisionAI::V1::Process.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_process_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::VisionAI::V1::LiveVideoAnalytics::Rest::ServiceStub.stub :transcode_get_process_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_process_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_process({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_process name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_process ::Google::Cloud::VisionAI::V1::GetProcessRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_process({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_process(::Google::Cloud::VisionAI::V1::GetProcessRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_process_client_stub.call_count + end + end + end + + def test_create_process + # 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" + process_id = "hello world" + process = {} + request_id = "hello world" + + create_process_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::VisionAI::V1::LiveVideoAnalytics::Rest::ServiceStub.stub :transcode_create_process_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_process_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_process({ parent: parent, process_id: process_id, process: process, request_id: request_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_process parent: parent, process_id: process_id, process: process, request_id: request_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_process ::Google::Cloud::VisionAI::V1::CreateProcessRequest.new(parent: parent, process_id: process_id, process: process, request_id: request_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_process({ parent: parent, process_id: process_id, process: process, request_id: request_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_process(::Google::Cloud::VisionAI::V1::CreateProcessRequest.new(parent: parent, process_id: process_id, process: process, request_id: request_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_process_client_stub.call_count + end + end + end + + def test_update_process + # 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. + update_mask = {} + process = {} + request_id = "hello world" + + update_process_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::VisionAI::V1::LiveVideoAnalytics::Rest::ServiceStub.stub :transcode_update_process_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_process_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_process({ update_mask: update_mask, process: process, request_id: request_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_process update_mask: update_mask, process: process, request_id: request_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_process ::Google::Cloud::VisionAI::V1::UpdateProcessRequest.new(update_mask: update_mask, process: process, request_id: request_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_process({ update_mask: update_mask, process: process, request_id: request_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_process(::Google::Cloud::VisionAI::V1::UpdateProcessRequest.new(update_mask: update_mask, process: process, request_id: request_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_process_client_stub.call_count + end + end + end + + def test_delete_process + # 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" + request_id = "hello world" + + delete_process_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::VisionAI::V1::LiveVideoAnalytics::Rest::ServiceStub.stub :transcode_delete_process_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_process_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_process({ name: name, request_id: request_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_process name: name, request_id: request_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_process ::Google::Cloud::VisionAI::V1::DeleteProcessRequest.new(name: name, request_id: request_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_process({ name: name, request_id: request_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_process(::Google::Cloud::VisionAI::V1::DeleteProcessRequest.new(name: name, request_id: request_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_process_client_stub.call_count + end + end + end + + def test_batch_run_process + # 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" + requests = [{}] + options = {} + batch_id = "hello world" + + batch_run_process_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::VisionAI::V1::LiveVideoAnalytics::Rest::ServiceStub.stub :transcode_batch_run_process_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, batch_run_process_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.batch_run_process({ parent: parent, requests: requests, options: options, batch_id: batch_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.batch_run_process parent: parent, requests: requests, options: options, batch_id: batch_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.batch_run_process ::Google::Cloud::VisionAI::V1::BatchRunProcessRequest.new(parent: parent, requests: requests, options: options, batch_id: batch_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.batch_run_process({ parent: parent, requests: requests, options: options, batch_id: batch_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.batch_run_process(::Google::Cloud::VisionAI::V1::BatchRunProcessRequest.new(parent: parent, requests: requests, options: options, batch_id: batch_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, batch_run_process_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::VisionAI::V1::LiveVideoAnalytics::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::VisionAI::V1::LiveVideoAnalytics::Rest::Client::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/test/google/cloud/vision_ai/v1/live_video_analytics_test.rb b/owl-bot-staging/google-cloud-vision_ai-v1/test/google/cloud/vision_ai/v1/live_video_analytics_test.rb new file mode 100644 index 000000000000..df33afa7ecf5 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/test/google/cloud/vision_ai/v1/live_video_analytics_test.rb @@ -0,0 +1,1308 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/visionai/v1/lva_service_pb" +require "google/cloud/vision_ai/v1/live_video_analytics" + +class ::Google::Cloud::VisionAI::V1::LiveVideoAnalytics::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_public_operators + # Create GRPC objects. + grpc_response = ::Google::Cloud::VisionAI::V1::ListPublicOperatorsResponse.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_public_operators_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_public_operators, name + assert_kind_of ::Google::Cloud::VisionAI::V1::ListPublicOperatorsRequest, 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_public_operators_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_public_operators({ 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_public_operators 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_public_operators ::Google::Cloud::VisionAI::V1::ListPublicOperatorsRequest.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_public_operators({ 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_public_operators(::Google::Cloud::VisionAI::V1::ListPublicOperatorsRequest.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_public_operators_client_stub.call_rpc_count + end + end + + def test_resolve_operator_info + # Create GRPC objects. + grpc_response = ::Google::Cloud::VisionAI::V1::ResolveOperatorInfoResponse.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" + queries = [{}] + + resolve_operator_info_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :resolve_operator_info, name + assert_kind_of ::Google::Cloud::VisionAI::V1::ResolveOperatorInfoRequest, request + assert_equal "hello world", request["parent"] + assert_kind_of ::Google::Cloud::VisionAI::V1::OperatorQuery, request["queries"].first + refute_nil options + end + + Gapic::ServiceStub.stub :new, resolve_operator_info_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.resolve_operator_info({ parent: parent, queries: queries }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.resolve_operator_info parent: parent, queries: queries do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.resolve_operator_info ::Google::Cloud::VisionAI::V1::ResolveOperatorInfoRequest.new(parent: parent, queries: queries) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.resolve_operator_info({ parent: parent, queries: queries }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.resolve_operator_info(::Google::Cloud::VisionAI::V1::ResolveOperatorInfoRequest.new(parent: parent, queries: queries), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, resolve_operator_info_client_stub.call_rpc_count + end + end + + def test_list_operators + # Create GRPC objects. + grpc_response = ::Google::Cloud::VisionAI::V1::ListOperatorsResponse.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_operators_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_operators, name + assert_kind_of ::Google::Cloud::VisionAI::V1::ListOperatorsRequest, 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_operators_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_operators({ 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_operators 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_operators ::Google::Cloud::VisionAI::V1::ListOperatorsRequest.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_operators({ 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_operators(::Google::Cloud::VisionAI::V1::ListOperatorsRequest.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_operators_client_stub.call_rpc_count + end + end + + def test_get_operator + # Create GRPC objects. + grpc_response = ::Google::Cloud::VisionAI::V1::Operator.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_operator_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_operator, name + assert_kind_of ::Google::Cloud::VisionAI::V1::GetOperatorRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_operator_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_operator({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_operator name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_operator ::Google::Cloud::VisionAI::V1::GetOperatorRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_operator({ 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_operator(::Google::Cloud::VisionAI::V1::GetOperatorRequest.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_operator_client_stub.call_rpc_count + end + end + + def test_create_operator + # 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" + operator_id = "hello world" + operator = {} + request_id = "hello world" + + create_operator_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_operator, name + assert_kind_of ::Google::Cloud::VisionAI::V1::CreateOperatorRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["operator_id"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::VisionAI::V1::Operator), request["operator"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_operator_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_operator({ parent: parent, operator_id: operator_id, operator: operator, request_id: request_id }) 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_operator parent: parent, operator_id: operator_id, operator: operator, request_id: request_id 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_operator ::Google::Cloud::VisionAI::V1::CreateOperatorRequest.new(parent: parent, operator_id: operator_id, operator: operator, request_id: request_id) 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_operator({ parent: parent, operator_id: operator_id, operator: operator, request_id: request_id }, 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_operator(::Google::Cloud::VisionAI::V1::CreateOperatorRequest.new(parent: parent, operator_id: operator_id, operator: operator, request_id: request_id), 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_operator_client_stub.call_rpc_count + end + end + + def test_update_operator + # 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. + update_mask = {} + operator = {} + request_id = "hello world" + + update_operator_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_operator, name + assert_kind_of ::Google::Cloud::VisionAI::V1::UpdateOperatorRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::VisionAI::V1::Operator), request["operator"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_operator_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_operator({ update_mask: update_mask, operator: operator, request_id: request_id }) 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.update_operator update_mask: update_mask, operator: operator, request_id: request_id 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.update_operator ::Google::Cloud::VisionAI::V1::UpdateOperatorRequest.new(update_mask: update_mask, operator: operator, request_id: request_id) 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.update_operator({ update_mask: update_mask, operator: operator, request_id: request_id }, 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.update_operator(::Google::Cloud::VisionAI::V1::UpdateOperatorRequest.new(update_mask: update_mask, operator: operator, request_id: request_id), 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, update_operator_client_stub.call_rpc_count + end + end + + def test_delete_operator + # 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" + request_id = "hello world" + + delete_operator_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_operator, name + assert_kind_of ::Google::Cloud::VisionAI::V1::DeleteOperatorRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_operator_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_operator({ name: name, request_id: request_id }) 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_operator name: name, request_id: request_id 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_operator ::Google::Cloud::VisionAI::V1::DeleteOperatorRequest.new(name: name, request_id: request_id) 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_operator({ name: name, request_id: request_id }, 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_operator(::Google::Cloud::VisionAI::V1::DeleteOperatorRequest.new(name: name, request_id: request_id), 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_operator_client_stub.call_rpc_count + end + end + + def test_list_analyses + # Create GRPC objects. + grpc_response = ::Google::Cloud::VisionAI::V1::ListAnalysesResponse.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_analyses_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_analyses, name + assert_kind_of ::Google::Cloud::VisionAI::V1::ListAnalysesRequest, 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_analyses_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_analyses({ 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_analyses 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_analyses ::Google::Cloud::VisionAI::V1::ListAnalysesRequest.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_analyses({ 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_analyses(::Google::Cloud::VisionAI::V1::ListAnalysesRequest.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_analyses_client_stub.call_rpc_count + end + end + + def test_get_analysis + # Create GRPC objects. + grpc_response = ::Google::Cloud::VisionAI::V1::Analysis.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_analysis_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_analysis, name + assert_kind_of ::Google::Cloud::VisionAI::V1::GetAnalysisRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_analysis_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_analysis({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_analysis name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_analysis ::Google::Cloud::VisionAI::V1::GetAnalysisRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_analysis({ 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_analysis(::Google::Cloud::VisionAI::V1::GetAnalysisRequest.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_analysis_client_stub.call_rpc_count + end + end + + def test_create_analysis + # 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" + analysis_id = "hello world" + analysis = {} + request_id = "hello world" + + create_analysis_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_analysis, name + assert_kind_of ::Google::Cloud::VisionAI::V1::CreateAnalysisRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["analysis_id"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::VisionAI::V1::Analysis), request["analysis"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_analysis_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_analysis({ parent: parent, analysis_id: analysis_id, analysis: analysis, request_id: request_id }) 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_analysis parent: parent, analysis_id: analysis_id, analysis: analysis, request_id: request_id 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_analysis ::Google::Cloud::VisionAI::V1::CreateAnalysisRequest.new(parent: parent, analysis_id: analysis_id, analysis: analysis, request_id: request_id) 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_analysis({ parent: parent, analysis_id: analysis_id, analysis: analysis, request_id: request_id }, 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_analysis(::Google::Cloud::VisionAI::V1::CreateAnalysisRequest.new(parent: parent, analysis_id: analysis_id, analysis: analysis, request_id: request_id), 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_analysis_client_stub.call_rpc_count + end + end + + def test_update_analysis + # 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. + update_mask = {} + analysis = {} + request_id = "hello world" + + update_analysis_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_analysis, name + assert_kind_of ::Google::Cloud::VisionAI::V1::UpdateAnalysisRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::VisionAI::V1::Analysis), request["analysis"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_analysis_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_analysis({ update_mask: update_mask, analysis: analysis, request_id: request_id }) 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.update_analysis update_mask: update_mask, analysis: analysis, request_id: request_id 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.update_analysis ::Google::Cloud::VisionAI::V1::UpdateAnalysisRequest.new(update_mask: update_mask, analysis: analysis, request_id: request_id) 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.update_analysis({ update_mask: update_mask, analysis: analysis, request_id: request_id }, 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.update_analysis(::Google::Cloud::VisionAI::V1::UpdateAnalysisRequest.new(update_mask: update_mask, analysis: analysis, request_id: request_id), 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, update_analysis_client_stub.call_rpc_count + end + end + + def test_delete_analysis + # 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" + request_id = "hello world" + + delete_analysis_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_analysis, name + assert_kind_of ::Google::Cloud::VisionAI::V1::DeleteAnalysisRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_analysis_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_analysis({ name: name, request_id: request_id }) 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_analysis name: name, request_id: request_id 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_analysis ::Google::Cloud::VisionAI::V1::DeleteAnalysisRequest.new(name: name, request_id: request_id) 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_analysis({ name: name, request_id: request_id }, 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_analysis(::Google::Cloud::VisionAI::V1::DeleteAnalysisRequest.new(name: name, request_id: request_id), 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_analysis_client_stub.call_rpc_count + end + end + + def test_list_processes + # Create GRPC objects. + grpc_response = ::Google::Cloud::VisionAI::V1::ListProcessesResponse.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_processes_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_processes, name + assert_kind_of ::Google::Cloud::VisionAI::V1::ListProcessesRequest, 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_processes_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_processes({ 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_processes 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_processes ::Google::Cloud::VisionAI::V1::ListProcessesRequest.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_processes({ 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_processes(::Google::Cloud::VisionAI::V1::ListProcessesRequest.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_processes_client_stub.call_rpc_count + end + end + + def test_get_process + # Create GRPC objects. + grpc_response = ::Google::Cloud::VisionAI::V1::Process.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_process_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_process, name + assert_kind_of ::Google::Cloud::VisionAI::V1::GetProcessRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_process_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_process({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_process name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_process ::Google::Cloud::VisionAI::V1::GetProcessRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_process({ 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_process(::Google::Cloud::VisionAI::V1::GetProcessRequest.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_process_client_stub.call_rpc_count + end + end + + def test_create_process + # 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" + process_id = "hello world" + process = {} + request_id = "hello world" + + create_process_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_process, name + assert_kind_of ::Google::Cloud::VisionAI::V1::CreateProcessRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["process_id"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::VisionAI::V1::Process), request["process"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_process_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_process({ parent: parent, process_id: process_id, process: process, request_id: request_id }) 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_process parent: parent, process_id: process_id, process: process, request_id: request_id 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_process ::Google::Cloud::VisionAI::V1::CreateProcessRequest.new(parent: parent, process_id: process_id, process: process, request_id: request_id) 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_process({ parent: parent, process_id: process_id, process: process, request_id: request_id }, 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_process(::Google::Cloud::VisionAI::V1::CreateProcessRequest.new(parent: parent, process_id: process_id, process: process, request_id: request_id), 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_process_client_stub.call_rpc_count + end + end + + def test_update_process + # 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. + update_mask = {} + process = {} + request_id = "hello world" + + update_process_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_process, name + assert_kind_of ::Google::Cloud::VisionAI::V1::UpdateProcessRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::VisionAI::V1::Process), request["process"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_process_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_process({ update_mask: update_mask, process: process, request_id: request_id }) 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.update_process update_mask: update_mask, process: process, request_id: request_id 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.update_process ::Google::Cloud::VisionAI::V1::UpdateProcessRequest.new(update_mask: update_mask, process: process, request_id: request_id) 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.update_process({ update_mask: update_mask, process: process, request_id: request_id }, 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.update_process(::Google::Cloud::VisionAI::V1::UpdateProcessRequest.new(update_mask: update_mask, process: process, request_id: request_id), 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, update_process_client_stub.call_rpc_count + end + end + + def test_delete_process + # 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" + request_id = "hello world" + + delete_process_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_process, name + assert_kind_of ::Google::Cloud::VisionAI::V1::DeleteProcessRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_process_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_process({ name: name, request_id: request_id }) 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_process name: name, request_id: request_id 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_process ::Google::Cloud::VisionAI::V1::DeleteProcessRequest.new(name: name, request_id: request_id) 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_process({ name: name, request_id: request_id }, 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_process(::Google::Cloud::VisionAI::V1::DeleteProcessRequest.new(name: name, request_id: request_id), 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_process_client_stub.call_rpc_count + end + end + + def test_batch_run_process + # 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" + requests = [{}] + options = {} + batch_id = "hello world" + + batch_run_process_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :batch_run_process, name + assert_kind_of ::Google::Cloud::VisionAI::V1::BatchRunProcessRequest, request + assert_equal "hello world", request["parent"] + assert_kind_of ::Google::Cloud::VisionAI::V1::CreateProcessRequest, request["requests"].first + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::VisionAI::V1::BatchRunProcessRequest::BatchRunProcessOptions), request["options"] + assert_equal "hello world", request["batch_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, batch_run_process_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.batch_run_process({ parent: parent, requests: requests, options: options, batch_id: batch_id }) 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.batch_run_process parent: parent, requests: requests, options: options, batch_id: batch_id 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.batch_run_process ::Google::Cloud::VisionAI::V1::BatchRunProcessRequest.new(parent: parent, requests: requests, options: options, batch_id: batch_id) 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.batch_run_process({ parent: parent, requests: requests, options: options, batch_id: batch_id }, 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.batch_run_process(::Google::Cloud::VisionAI::V1::BatchRunProcessRequest.new(parent: parent, requests: requests, options: options, batch_id: batch_id), 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, batch_run_process_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::VisionAI::V1::LiveVideoAnalytics::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::VisionAI::V1::LiveVideoAnalytics::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::VisionAI::V1::LiveVideoAnalytics::Client.new do |config| + config.credentials = creds + end + assert_kind_of ::Google::Cloud::VisionAI::V1::LiveVideoAnalytics::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::VisionAI::V1::LiveVideoAnalytics::Client.new do |config| + config.credentials = grpc_channel + end + end + + assert_kind_of ::Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Operations, client.operations_client + end +end diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/test/google/cloud/vision_ai/v1/streaming_service_paths_test.rb b/owl-bot-staging/google-cloud-vision_ai-v1/test/google/cloud/vision_ai/v1/streaming_service_paths_test.rb new file mode 100644 index 000000000000..43fffa383f81 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/test/google/cloud/vision_ai/v1/streaming_service_paths_test.rb @@ -0,0 +1,55 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/vision_ai/v1/streaming_service" + +class ::Google::Cloud::VisionAI::V1::StreamingService::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_series_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::VisionAI::V1::StreamingService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.series_path project: "value0", location: "value1", cluster: "value2", series: "value3" + assert_equal "projects/value0/locations/value1/clusters/value2/series/value3", path + end + end +end diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/test/google/cloud/vision_ai/v1/streaming_service_rest_test.rb b/owl-bot-staging/google-cloud-vision_ai-v1/test/google/cloud/vision_ai/v1/streaming_service_rest_test.rb new file mode 100644 index 000000000000..3a5a2b04ea7f --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/test/google/cloud/vision_ai/v1/streaming_service_rest_test.rb @@ -0,0 +1,269 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/visionai/v1/streaming_service_pb" +require "google/cloud/vision_ai/v1/streaming_service/rest" + + +class ::Google::Cloud::VisionAI::V1::StreamingService::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_acquire_lease + # Create test objects. + client_result = ::Google::Cloud::VisionAI::V1::Lease.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + series = "hello world" + owner = "hello world" + term = {} + lease_type = :LEASE_TYPE_UNSPECIFIED + + acquire_lease_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::VisionAI::V1::StreamingService::Rest::ServiceStub.stub :transcode_acquire_lease_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, acquire_lease_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::StreamingService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.acquire_lease({ series: series, owner: owner, term: term, lease_type: lease_type }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.acquire_lease series: series, owner: owner, term: term, lease_type: lease_type do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.acquire_lease ::Google::Cloud::VisionAI::V1::AcquireLeaseRequest.new(series: series, owner: owner, term: term, lease_type: lease_type) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.acquire_lease({ series: series, owner: owner, term: term, lease_type: lease_type }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.acquire_lease(::Google::Cloud::VisionAI::V1::AcquireLeaseRequest.new(series: series, owner: owner, term: term, lease_type: lease_type), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, acquire_lease_client_stub.call_count + end + end + end + + def test_renew_lease + # Create test objects. + client_result = ::Google::Cloud::VisionAI::V1::Lease.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + id = "hello world" + series = "hello world" + owner = "hello world" + term = {} + + renew_lease_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::VisionAI::V1::StreamingService::Rest::ServiceStub.stub :transcode_renew_lease_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, renew_lease_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::StreamingService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.renew_lease({ id: id, series: series, owner: owner, term: term }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.renew_lease id: id, series: series, owner: owner, term: term do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.renew_lease ::Google::Cloud::VisionAI::V1::RenewLeaseRequest.new(id: id, series: series, owner: owner, term: term) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.renew_lease({ id: id, series: series, owner: owner, term: term }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.renew_lease(::Google::Cloud::VisionAI::V1::RenewLeaseRequest.new(id: id, series: series, owner: owner, term: term), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, renew_lease_client_stub.call_count + end + end + end + + def test_release_lease + # Create test objects. + client_result = ::Google::Cloud::VisionAI::V1::ReleaseLeaseResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + id = "hello world" + series = "hello world" + owner = "hello world" + + release_lease_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::VisionAI::V1::StreamingService::Rest::ServiceStub.stub :transcode_release_lease_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, release_lease_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::StreamingService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.release_lease({ id: id, series: series, owner: owner }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.release_lease id: id, series: series, owner: owner do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.release_lease ::Google::Cloud::VisionAI::V1::ReleaseLeaseRequest.new(id: id, series: series, owner: owner) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.release_lease({ id: id, series: series, owner: owner }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.release_lease(::Google::Cloud::VisionAI::V1::ReleaseLeaseRequest.new(id: id, series: series, owner: owner), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, release_lease_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::VisionAI::V1::StreamingService::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::VisionAI::V1::StreamingService::Rest::Client::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/test/google/cloud/vision_ai/v1/streaming_service_test.rb b/owl-bot-staging/google-cloud-vision_ai-v1/test/google/cloud/vision_ai/v1/streaming_service_test.rb new file mode 100644 index 000000000000..323bb0bfdfd5 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/test/google/cloud/vision_ai/v1/streaming_service_test.rb @@ -0,0 +1,561 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/visionai/v1/streaming_service_pb" +require "google/cloud/vision_ai/v1/streaming_service" + +class ::Google::Cloud::VisionAI::V1::StreamingService::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_send_packets + # Create GRPC objects. + grpc_response = ::Google::Cloud::VisionAI::V1::SendPacketsResponse.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 bidi streaming method. + packet = {} + + send_packets_client_stub = ClientStub.new [grpc_response].to_enum, grpc_operation do |name, request, options:| + assert_equal :send_packets, name + assert_kind_of Enumerable, request + refute_nil options + request + end + + Gapic::ServiceStub.stub :new, send_packets_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::StreamingService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use enumerable object with hash and protobuf object. + request_hash = { packet: packet } + request_proto = ::Google::Cloud::VisionAI::V1::SendPacketsRequest.new packet: packet + enum_input = [request_hash, request_proto].to_enum + client.send_packets enum_input do |response, operation| + assert_kind_of Enumerable, response + response.to_a.each do |r| + assert_kind_of ::Google::Cloud::VisionAI::V1::SendPacketsResponse, r + end + assert_equal grpc_operation, operation + end + + # Use stream input object (from gapic-common). + request_hash = { packet: packet } + request_proto = ::Google::Cloud::VisionAI::V1::SendPacketsRequest.new packet: packet + stream_input = Gapic::StreamInput.new + client.send_packets stream_input do |response, operation| + assert_kind_of Enumerable, response + response.to_a.each do |r| + assert_kind_of ::Google::Cloud::VisionAI::V1::SendPacketsResponse, r + end + assert_equal grpc_operation, operation + end + stream_input << request_hash + stream_input << request_proto + stream_input.close + + # Use enumerable object with hash and protobuf object with options. + request_hash = { packet: packet } + request_proto = ::Google::Cloud::VisionAI::V1::SendPacketsRequest.new packet: packet + enum_input = [request_hash, request_proto].to_enum + client.send_packets enum_input, grpc_options do |response, operation| + assert_kind_of Enumerable, response + response.to_a.each do |r| + assert_kind_of ::Google::Cloud::VisionAI::V1::SendPacketsResponse, r + end + assert_equal grpc_operation, operation + end + + # Use stream input object (from gapic-common) with options. + request_hash = { packet: packet } + request_proto = ::Google::Cloud::VisionAI::V1::SendPacketsRequest.new packet: packet + stream_input = Gapic::StreamInput.new + client.send_packets stream_input, grpc_options do |response, operation| + assert_kind_of Enumerable, response + response.to_a.each do |r| + assert_kind_of ::Google::Cloud::VisionAI::V1::SendPacketsResponse, r + end + assert_equal grpc_operation, operation + end + stream_input << request_hash + stream_input << request_proto + stream_input.close + + # Verify method calls + assert_equal 4, send_packets_client_stub.call_rpc_count + send_packets_client_stub.requests.each do |request| + request.to_a.each do |r| + assert_kind_of ::Google::Cloud::VisionAI::V1::SendPacketsRequest, r + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::VisionAI::V1::Packet), r["packet"] + assert_equal :packet, r.request + end + end + end + end + + def test_receive_packets + # Create GRPC objects. + grpc_response = ::Google::Cloud::VisionAI::V1::ReceivePacketsResponse.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 bidi streaming method. + setup_request = {} + + receive_packets_client_stub = ClientStub.new [grpc_response].to_enum, grpc_operation do |name, request, options:| + assert_equal :receive_packets, name + assert_kind_of Enumerable, request + refute_nil options + request + end + + Gapic::ServiceStub.stub :new, receive_packets_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::StreamingService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use enumerable object with hash and protobuf object. + request_hash = { setup_request: setup_request } + request_proto = ::Google::Cloud::VisionAI::V1::ReceivePacketsRequest.new setup_request: setup_request + enum_input = [request_hash, request_proto].to_enum + client.receive_packets enum_input do |response, operation| + assert_kind_of Enumerable, response + response.to_a.each do |r| + assert_kind_of ::Google::Cloud::VisionAI::V1::ReceivePacketsResponse, r + end + assert_equal grpc_operation, operation + end + + # Use stream input object (from gapic-common). + request_hash = { setup_request: setup_request } + request_proto = ::Google::Cloud::VisionAI::V1::ReceivePacketsRequest.new setup_request: setup_request + stream_input = Gapic::StreamInput.new + client.receive_packets stream_input do |response, operation| + assert_kind_of Enumerable, response + response.to_a.each do |r| + assert_kind_of ::Google::Cloud::VisionAI::V1::ReceivePacketsResponse, r + end + assert_equal grpc_operation, operation + end + stream_input << request_hash + stream_input << request_proto + stream_input.close + + # Use enumerable object with hash and protobuf object with options. + request_hash = { setup_request: setup_request } + request_proto = ::Google::Cloud::VisionAI::V1::ReceivePacketsRequest.new setup_request: setup_request + enum_input = [request_hash, request_proto].to_enum + client.receive_packets enum_input, grpc_options do |response, operation| + assert_kind_of Enumerable, response + response.to_a.each do |r| + assert_kind_of ::Google::Cloud::VisionAI::V1::ReceivePacketsResponse, r + end + assert_equal grpc_operation, operation + end + + # Use stream input object (from gapic-common) with options. + request_hash = { setup_request: setup_request } + request_proto = ::Google::Cloud::VisionAI::V1::ReceivePacketsRequest.new setup_request: setup_request + stream_input = Gapic::StreamInput.new + client.receive_packets stream_input, grpc_options do |response, operation| + assert_kind_of Enumerable, response + response.to_a.each do |r| + assert_kind_of ::Google::Cloud::VisionAI::V1::ReceivePacketsResponse, r + end + assert_equal grpc_operation, operation + end + stream_input << request_hash + stream_input << request_proto + stream_input.close + + # Verify method calls + assert_equal 4, receive_packets_client_stub.call_rpc_count + receive_packets_client_stub.requests.each do |request| + request.to_a.each do |r| + assert_kind_of ::Google::Cloud::VisionAI::V1::ReceivePacketsRequest, r + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::VisionAI::V1::ReceivePacketsRequest::SetupRequest), r["setup_request"] + assert_equal :setup_request, r.request + end + end + end + end + + def test_receive_events + # Create GRPC objects. + grpc_response = ::Google::Cloud::VisionAI::V1::ReceiveEventsResponse.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 bidi streaming method. + setup_request = {} + + receive_events_client_stub = ClientStub.new [grpc_response].to_enum, grpc_operation do |name, request, options:| + assert_equal :receive_events, name + assert_kind_of Enumerable, request + refute_nil options + request + end + + Gapic::ServiceStub.stub :new, receive_events_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::StreamingService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use enumerable object with hash and protobuf object. + request_hash = { setup_request: setup_request } + request_proto = ::Google::Cloud::VisionAI::V1::ReceiveEventsRequest.new setup_request: setup_request + enum_input = [request_hash, request_proto].to_enum + client.receive_events enum_input do |response, operation| + assert_kind_of Enumerable, response + response.to_a.each do |r| + assert_kind_of ::Google::Cloud::VisionAI::V1::ReceiveEventsResponse, r + end + assert_equal grpc_operation, operation + end + + # Use stream input object (from gapic-common). + request_hash = { setup_request: setup_request } + request_proto = ::Google::Cloud::VisionAI::V1::ReceiveEventsRequest.new setup_request: setup_request + stream_input = Gapic::StreamInput.new + client.receive_events stream_input do |response, operation| + assert_kind_of Enumerable, response + response.to_a.each do |r| + assert_kind_of ::Google::Cloud::VisionAI::V1::ReceiveEventsResponse, r + end + assert_equal grpc_operation, operation + end + stream_input << request_hash + stream_input << request_proto + stream_input.close + + # Use enumerable object with hash and protobuf object with options. + request_hash = { setup_request: setup_request } + request_proto = ::Google::Cloud::VisionAI::V1::ReceiveEventsRequest.new setup_request: setup_request + enum_input = [request_hash, request_proto].to_enum + client.receive_events enum_input, grpc_options do |response, operation| + assert_kind_of Enumerable, response + response.to_a.each do |r| + assert_kind_of ::Google::Cloud::VisionAI::V1::ReceiveEventsResponse, r + end + assert_equal grpc_operation, operation + end + + # Use stream input object (from gapic-common) with options. + request_hash = { setup_request: setup_request } + request_proto = ::Google::Cloud::VisionAI::V1::ReceiveEventsRequest.new setup_request: setup_request + stream_input = Gapic::StreamInput.new + client.receive_events stream_input, grpc_options do |response, operation| + assert_kind_of Enumerable, response + response.to_a.each do |r| + assert_kind_of ::Google::Cloud::VisionAI::V1::ReceiveEventsResponse, r + end + assert_equal grpc_operation, operation + end + stream_input << request_hash + stream_input << request_proto + stream_input.close + + # Verify method calls + assert_equal 4, receive_events_client_stub.call_rpc_count + receive_events_client_stub.requests.each do |request| + request.to_a.each do |r| + assert_kind_of ::Google::Cloud::VisionAI::V1::ReceiveEventsRequest, r + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::VisionAI::V1::ReceiveEventsRequest::SetupRequest), r["setup_request"] + assert_equal :setup_request, r.request + end + end + end + end + + def test_acquire_lease + # Create GRPC objects. + grpc_response = ::Google::Cloud::VisionAI::V1::Lease.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. + series = "hello world" + owner = "hello world" + term = {} + lease_type = :LEASE_TYPE_UNSPECIFIED + + acquire_lease_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :acquire_lease, name + assert_kind_of ::Google::Cloud::VisionAI::V1::AcquireLeaseRequest, request + assert_equal "hello world", request["series"] + assert_equal "hello world", request["owner"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Duration), request["term"] + assert_equal :LEASE_TYPE_UNSPECIFIED, request["lease_type"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, acquire_lease_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::StreamingService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.acquire_lease({ series: series, owner: owner, term: term, lease_type: lease_type }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.acquire_lease series: series, owner: owner, term: term, lease_type: lease_type do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.acquire_lease ::Google::Cloud::VisionAI::V1::AcquireLeaseRequest.new(series: series, owner: owner, term: term, lease_type: lease_type) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.acquire_lease({ series: series, owner: owner, term: term, lease_type: lease_type }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.acquire_lease(::Google::Cloud::VisionAI::V1::AcquireLeaseRequest.new(series: series, owner: owner, term: term, lease_type: lease_type), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, acquire_lease_client_stub.call_rpc_count + end + end + + def test_renew_lease + # Create GRPC objects. + grpc_response = ::Google::Cloud::VisionAI::V1::Lease.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. + id = "hello world" + series = "hello world" + owner = "hello world" + term = {} + + renew_lease_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :renew_lease, name + assert_kind_of ::Google::Cloud::VisionAI::V1::RenewLeaseRequest, request + assert_equal "hello world", request["id"] + assert_equal "hello world", request["series"] + assert_equal "hello world", request["owner"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Duration), request["term"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, renew_lease_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::StreamingService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.renew_lease({ id: id, series: series, owner: owner, term: term }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.renew_lease id: id, series: series, owner: owner, term: term do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.renew_lease ::Google::Cloud::VisionAI::V1::RenewLeaseRequest.new(id: id, series: series, owner: owner, term: term) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.renew_lease({ id: id, series: series, owner: owner, term: term }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.renew_lease(::Google::Cloud::VisionAI::V1::RenewLeaseRequest.new(id: id, series: series, owner: owner, term: term), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, renew_lease_client_stub.call_rpc_count + end + end + + def test_release_lease + # Create GRPC objects. + grpc_response = ::Google::Cloud::VisionAI::V1::ReleaseLeaseResponse.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. + id = "hello world" + series = "hello world" + owner = "hello world" + + release_lease_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :release_lease, name + assert_kind_of ::Google::Cloud::VisionAI::V1::ReleaseLeaseRequest, request + assert_equal "hello world", request["id"] + assert_equal "hello world", request["series"] + assert_equal "hello world", request["owner"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, release_lease_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::StreamingService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.release_lease({ id: id, series: series, owner: owner }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.release_lease id: id, series: series, owner: owner do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.release_lease ::Google::Cloud::VisionAI::V1::ReleaseLeaseRequest.new(id: id, series: series, owner: owner) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.release_lease({ id: id, series: series, owner: owner }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.release_lease(::Google::Cloud::VisionAI::V1::ReleaseLeaseRequest.new(id: id, series: series, owner: owner), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, release_lease_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::VisionAI::V1::StreamingService::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::VisionAI::V1::StreamingService::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::VisionAI::V1::StreamingService::Client.new do |config| + config.credentials = creds + end + assert_kind_of ::Google::Cloud::VisionAI::V1::StreamingService::Client, client + assert_equal creds, client.configure.credentials + end + end +end diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/test/google/cloud/vision_ai/v1/streams_service_operations_test.rb b/owl-bot-staging/google-cloud-vision_ai-v1/test/google/cloud/vision_ai/v1/streams_service_operations_test.rb new file mode 100644 index 000000000000..01a34ec6e4b0 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/test/google/cloud/vision_ai/v1/streams_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/visionai/v1/streams_service_pb" +require "google/cloud/visionai/v1/streams_service_services_pb" +require "google/cloud/vision_ai/v1/streams_service" + +class ::Google::Cloud::VisionAI::V1::StreamsService::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::VisionAI::V1::StreamsService::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::VisionAI::V1::StreamsService::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::VisionAI::V1::StreamsService::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::VisionAI::V1::StreamsService::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::VisionAI::V1::StreamsService::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::VisionAI::V1::StreamsService::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::VisionAI::V1::StreamsService::Operations::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/test/google/cloud/vision_ai/v1/streams_service_paths_test.rb b/owl-bot-staging/google-cloud-vision_ai-v1/test/google/cloud/vision_ai/v1/streams_service_paths_test.rb new file mode 100644 index 000000000000..90d31f94d99a --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/test/google/cloud/vision_ai/v1/streams_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/vision_ai/v1/streams_service" + +class ::Google::Cloud::VisionAI::V1::StreamsService::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_channel_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::VisionAI::V1::StreamsService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.channel_path project: "value0", location: "value1", cluster: "value2", channel: "value3" + assert_equal "projects/value0/locations/value1/clusters/value2/channels/value3", path + end + end + + def test_cluster_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::VisionAI::V1::StreamsService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.cluster_path project: "value0", location: "value1", cluster: "value2" + assert_equal "projects/value0/locations/value1/clusters/value2", path + end + end + + def test_event_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::VisionAI::V1::StreamsService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.event_path project: "value0", location: "value1", cluster: "value2", event: "value3" + assert_equal "projects/value0/locations/value1/clusters/value2/events/value3", 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::VisionAI::V1::StreamsService::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_series_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::VisionAI::V1::StreamsService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.series_path project: "value0", location: "value1", cluster: "value2", series: "value3" + assert_equal "projects/value0/locations/value1/clusters/value2/series/value3", path + end + end + + def test_stream_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::VisionAI::V1::StreamsService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.stream_path project: "value0", location: "value1", cluster: "value2", stream: "value3" + assert_equal "projects/value0/locations/value1/clusters/value2/streams/value3", path + end + end +end diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/test/google/cloud/vision_ai/v1/streams_service_rest_test.rb b/owl-bot-staging/google-cloud-vision_ai-v1/test/google/cloud/vision_ai/v1/streams_service_rest_test.rb new file mode 100644 index 000000000000..8fb9c187c413 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/test/google/cloud/vision_ai/v1/streams_service_rest_test.rb @@ -0,0 +1,1387 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/visionai/v1/streams_service_pb" +require "google/cloud/vision_ai/v1/streams_service/rest" + + +class ::Google::Cloud::VisionAI::V1::StreamsService::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_clusters + # Create test objects. + client_result = ::Google::Cloud::VisionAI::V1::ListClustersResponse.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_clusters_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::VisionAI::V1::StreamsService::Rest::ServiceStub.stub :transcode_list_clusters_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_clusters_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::StreamsService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_clusters({ 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_clusters 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_clusters ::Google::Cloud::VisionAI::V1::ListClustersRequest.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_clusters({ 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_clusters(::Google::Cloud::VisionAI::V1::ListClustersRequest.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_clusters_client_stub.call_count + end + end + end + + def test_get_cluster + # Create test objects. + client_result = ::Google::Cloud::VisionAI::V1::Cluster.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_cluster_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::VisionAI::V1::StreamsService::Rest::ServiceStub.stub :transcode_get_cluster_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_cluster_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::StreamsService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_cluster({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_cluster name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_cluster ::Google::Cloud::VisionAI::V1::GetClusterRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_cluster({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_cluster(::Google::Cloud::VisionAI::V1::GetClusterRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_cluster_client_stub.call_count + end + end + end + + def test_create_cluster + # 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" + cluster_id = "hello world" + cluster = {} + request_id = "hello world" + + create_cluster_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::VisionAI::V1::StreamsService::Rest::ServiceStub.stub :transcode_create_cluster_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_cluster_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::StreamsService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_cluster({ parent: parent, cluster_id: cluster_id, cluster: cluster, request_id: request_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_cluster parent: parent, cluster_id: cluster_id, cluster: cluster, request_id: request_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_cluster ::Google::Cloud::VisionAI::V1::CreateClusterRequest.new(parent: parent, cluster_id: cluster_id, cluster: cluster, request_id: request_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_cluster({ parent: parent, cluster_id: cluster_id, cluster: cluster, request_id: request_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_cluster(::Google::Cloud::VisionAI::V1::CreateClusterRequest.new(parent: parent, cluster_id: cluster_id, cluster: cluster, request_id: request_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_cluster_client_stub.call_count + end + end + end + + def test_update_cluster + # 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. + update_mask = {} + cluster = {} + request_id = "hello world" + + update_cluster_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::VisionAI::V1::StreamsService::Rest::ServiceStub.stub :transcode_update_cluster_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_cluster_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::StreamsService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_cluster({ update_mask: update_mask, cluster: cluster, request_id: request_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_cluster update_mask: update_mask, cluster: cluster, request_id: request_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_cluster ::Google::Cloud::VisionAI::V1::UpdateClusterRequest.new(update_mask: update_mask, cluster: cluster, request_id: request_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_cluster({ update_mask: update_mask, cluster: cluster, request_id: request_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_cluster(::Google::Cloud::VisionAI::V1::UpdateClusterRequest.new(update_mask: update_mask, cluster: cluster, request_id: request_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_cluster_client_stub.call_count + end + end + end + + def test_delete_cluster + # 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" + request_id = "hello world" + + delete_cluster_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::VisionAI::V1::StreamsService::Rest::ServiceStub.stub :transcode_delete_cluster_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_cluster_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::StreamsService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_cluster({ name: name, request_id: request_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_cluster name: name, request_id: request_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_cluster ::Google::Cloud::VisionAI::V1::DeleteClusterRequest.new(name: name, request_id: request_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_cluster({ name: name, request_id: request_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_cluster(::Google::Cloud::VisionAI::V1::DeleteClusterRequest.new(name: name, request_id: request_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_cluster_client_stub.call_count + end + end + end + + def test_list_streams + # Create test objects. + client_result = ::Google::Cloud::VisionAI::V1::ListStreamsResponse.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_streams_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::VisionAI::V1::StreamsService::Rest::ServiceStub.stub :transcode_list_streams_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_streams_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::StreamsService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_streams({ 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_streams 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_streams ::Google::Cloud::VisionAI::V1::ListStreamsRequest.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_streams({ 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_streams(::Google::Cloud::VisionAI::V1::ListStreamsRequest.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_streams_client_stub.call_count + end + end + end + + def test_get_stream + # Create test objects. + client_result = ::Google::Cloud::VisionAI::V1::Stream.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_stream_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::VisionAI::V1::StreamsService::Rest::ServiceStub.stub :transcode_get_stream_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_stream_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::StreamsService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_stream({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_stream name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_stream ::Google::Cloud::VisionAI::V1::GetStreamRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_stream({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_stream(::Google::Cloud::VisionAI::V1::GetStreamRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_stream_client_stub.call_count + end + end + end + + def test_create_stream + # 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" + stream_id = "hello world" + stream = {} + request_id = "hello world" + + create_stream_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::VisionAI::V1::StreamsService::Rest::ServiceStub.stub :transcode_create_stream_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_stream_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::StreamsService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_stream({ parent: parent, stream_id: stream_id, stream: stream, request_id: request_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_stream parent: parent, stream_id: stream_id, stream: stream, request_id: request_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_stream ::Google::Cloud::VisionAI::V1::CreateStreamRequest.new(parent: parent, stream_id: stream_id, stream: stream, request_id: request_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_stream({ parent: parent, stream_id: stream_id, stream: stream, request_id: request_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_stream(::Google::Cloud::VisionAI::V1::CreateStreamRequest.new(parent: parent, stream_id: stream_id, stream: stream, request_id: request_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_stream_client_stub.call_count + end + end + end + + def test_update_stream + # 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. + update_mask = {} + stream = {} + request_id = "hello world" + + update_stream_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::VisionAI::V1::StreamsService::Rest::ServiceStub.stub :transcode_update_stream_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_stream_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::StreamsService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_stream({ update_mask: update_mask, stream: stream, request_id: request_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_stream update_mask: update_mask, stream: stream, request_id: request_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_stream ::Google::Cloud::VisionAI::V1::UpdateStreamRequest.new(update_mask: update_mask, stream: stream, request_id: request_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_stream({ update_mask: update_mask, stream: stream, request_id: request_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_stream(::Google::Cloud::VisionAI::V1::UpdateStreamRequest.new(update_mask: update_mask, stream: stream, request_id: request_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_stream_client_stub.call_count + end + end + end + + def test_delete_stream + # 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" + request_id = "hello world" + + delete_stream_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::VisionAI::V1::StreamsService::Rest::ServiceStub.stub :transcode_delete_stream_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_stream_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::StreamsService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_stream({ name: name, request_id: request_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_stream name: name, request_id: request_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_stream ::Google::Cloud::VisionAI::V1::DeleteStreamRequest.new(name: name, request_id: request_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_stream({ name: name, request_id: request_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_stream(::Google::Cloud::VisionAI::V1::DeleteStreamRequest.new(name: name, request_id: request_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_stream_client_stub.call_count + end + end + end + + def test_get_stream_thumbnail + # 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. + stream = "hello world" + gcs_object_name = "hello world" + event = "hello world" + request_id = "hello world" + + get_stream_thumbnail_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::VisionAI::V1::StreamsService::Rest::ServiceStub.stub :transcode_get_stream_thumbnail_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_stream_thumbnail_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::StreamsService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_stream_thumbnail({ stream: stream, gcs_object_name: gcs_object_name, event: event, request_id: request_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_stream_thumbnail stream: stream, gcs_object_name: gcs_object_name, event: event, request_id: request_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_stream_thumbnail ::Google::Cloud::VisionAI::V1::GetStreamThumbnailRequest.new(stream: stream, gcs_object_name: gcs_object_name, event: event, request_id: request_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_stream_thumbnail({ stream: stream, gcs_object_name: gcs_object_name, event: event, request_id: request_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_stream_thumbnail(::Google::Cloud::VisionAI::V1::GetStreamThumbnailRequest.new(stream: stream, gcs_object_name: gcs_object_name, event: event, request_id: request_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_stream_thumbnail_client_stub.call_count + end + end + end + + def test_generate_stream_hls_token + # Create test objects. + client_result = ::Google::Cloud::VisionAI::V1::GenerateStreamHlsTokenResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + stream = "hello world" + + generate_stream_hls_token_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::VisionAI::V1::StreamsService::Rest::ServiceStub.stub :transcode_generate_stream_hls_token_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, generate_stream_hls_token_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::StreamsService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.generate_stream_hls_token({ stream: stream }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.generate_stream_hls_token stream: stream do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.generate_stream_hls_token ::Google::Cloud::VisionAI::V1::GenerateStreamHlsTokenRequest.new(stream: stream) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.generate_stream_hls_token({ stream: stream }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.generate_stream_hls_token(::Google::Cloud::VisionAI::V1::GenerateStreamHlsTokenRequest.new(stream: stream), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, generate_stream_hls_token_client_stub.call_count + end + end + end + + def test_list_events + # Create test objects. + client_result = ::Google::Cloud::VisionAI::V1::ListEventsResponse.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_events_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::VisionAI::V1::StreamsService::Rest::ServiceStub.stub :transcode_list_events_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_events_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::StreamsService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_events({ 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_events 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_events ::Google::Cloud::VisionAI::V1::ListEventsRequest.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_events({ 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_events(::Google::Cloud::VisionAI::V1::ListEventsRequest.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_events_client_stub.call_count + end + end + end + + def test_get_event + # Create test objects. + client_result = ::Google::Cloud::VisionAI::V1::Event.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_event_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::VisionAI::V1::StreamsService::Rest::ServiceStub.stub :transcode_get_event_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_event_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::StreamsService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_event({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_event name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_event ::Google::Cloud::VisionAI::V1::GetEventRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_event({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_event(::Google::Cloud::VisionAI::V1::GetEventRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_event_client_stub.call_count + end + end + end + + def test_create_event + # 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" + event_id = "hello world" + event = {} + request_id = "hello world" + + create_event_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::VisionAI::V1::StreamsService::Rest::ServiceStub.stub :transcode_create_event_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_event_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::StreamsService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_event({ parent: parent, event_id: event_id, event: event, request_id: request_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_event parent: parent, event_id: event_id, event: event, request_id: request_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_event ::Google::Cloud::VisionAI::V1::CreateEventRequest.new(parent: parent, event_id: event_id, event: event, request_id: request_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_event({ parent: parent, event_id: event_id, event: event, request_id: request_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_event(::Google::Cloud::VisionAI::V1::CreateEventRequest.new(parent: parent, event_id: event_id, event: event, request_id: request_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_event_client_stub.call_count + end + end + end + + def test_update_event + # 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. + update_mask = {} + event = {} + request_id = "hello world" + + update_event_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::VisionAI::V1::StreamsService::Rest::ServiceStub.stub :transcode_update_event_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_event_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::StreamsService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_event({ update_mask: update_mask, event: event, request_id: request_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_event update_mask: update_mask, event: event, request_id: request_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_event ::Google::Cloud::VisionAI::V1::UpdateEventRequest.new(update_mask: update_mask, event: event, request_id: request_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_event({ update_mask: update_mask, event: event, request_id: request_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_event(::Google::Cloud::VisionAI::V1::UpdateEventRequest.new(update_mask: update_mask, event: event, request_id: request_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_event_client_stub.call_count + end + end + end + + def test_delete_event + # 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" + request_id = "hello world" + + delete_event_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::VisionAI::V1::StreamsService::Rest::ServiceStub.stub :transcode_delete_event_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_event_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::StreamsService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_event({ name: name, request_id: request_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_event name: name, request_id: request_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_event ::Google::Cloud::VisionAI::V1::DeleteEventRequest.new(name: name, request_id: request_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_event({ name: name, request_id: request_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_event(::Google::Cloud::VisionAI::V1::DeleteEventRequest.new(name: name, request_id: request_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_event_client_stub.call_count + end + end + end + + def test_list_series + # Create test objects. + client_result = ::Google::Cloud::VisionAI::V1::ListSeriesResponse.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_series_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::VisionAI::V1::StreamsService::Rest::ServiceStub.stub :transcode_list_series_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_series_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::StreamsService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_series({ 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_series 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_series ::Google::Cloud::VisionAI::V1::ListSeriesRequest.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_series({ 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_series(::Google::Cloud::VisionAI::V1::ListSeriesRequest.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_series_client_stub.call_count + end + end + end + + def test_get_series + # Create test objects. + client_result = ::Google::Cloud::VisionAI::V1::Series.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_series_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::VisionAI::V1::StreamsService::Rest::ServiceStub.stub :transcode_get_series_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_series_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::StreamsService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_series({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_series name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_series ::Google::Cloud::VisionAI::V1::GetSeriesRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_series({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_series(::Google::Cloud::VisionAI::V1::GetSeriesRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_series_client_stub.call_count + end + end + end + + def test_create_series + # 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" + series_id = "hello world" + series = {} + request_id = "hello world" + + create_series_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::VisionAI::V1::StreamsService::Rest::ServiceStub.stub :transcode_create_series_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_series_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::StreamsService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_series({ parent: parent, series_id: series_id, series: series, request_id: request_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_series parent: parent, series_id: series_id, series: series, request_id: request_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_series ::Google::Cloud::VisionAI::V1::CreateSeriesRequest.new(parent: parent, series_id: series_id, series: series, request_id: request_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_series({ parent: parent, series_id: series_id, series: series, request_id: request_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_series(::Google::Cloud::VisionAI::V1::CreateSeriesRequest.new(parent: parent, series_id: series_id, series: series, request_id: request_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_series_client_stub.call_count + end + end + end + + def test_update_series + # 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. + update_mask = {} + series = {} + request_id = "hello world" + + update_series_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::VisionAI::V1::StreamsService::Rest::ServiceStub.stub :transcode_update_series_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_series_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::StreamsService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_series({ update_mask: update_mask, series: series, request_id: request_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_series update_mask: update_mask, series: series, request_id: request_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_series ::Google::Cloud::VisionAI::V1::UpdateSeriesRequest.new(update_mask: update_mask, series: series, request_id: request_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_series({ update_mask: update_mask, series: series, request_id: request_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_series(::Google::Cloud::VisionAI::V1::UpdateSeriesRequest.new(update_mask: update_mask, series: series, request_id: request_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_series_client_stub.call_count + end + end + end + + def test_delete_series + # 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" + request_id = "hello world" + + delete_series_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::VisionAI::V1::StreamsService::Rest::ServiceStub.stub :transcode_delete_series_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_series_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::StreamsService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_series({ name: name, request_id: request_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_series name: name, request_id: request_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_series ::Google::Cloud::VisionAI::V1::DeleteSeriesRequest.new(name: name, request_id: request_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_series({ name: name, request_id: request_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_series(::Google::Cloud::VisionAI::V1::DeleteSeriesRequest.new(name: name, request_id: request_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_series_client_stub.call_count + end + end + end + + def test_materialize_channel + # 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" + channel_id = "hello world" + channel = {} + request_id = "hello world" + + materialize_channel_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::VisionAI::V1::StreamsService::Rest::ServiceStub.stub :transcode_materialize_channel_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, materialize_channel_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::StreamsService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.materialize_channel({ parent: parent, channel_id: channel_id, channel: channel, request_id: request_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.materialize_channel parent: parent, channel_id: channel_id, channel: channel, request_id: request_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.materialize_channel ::Google::Cloud::VisionAI::V1::MaterializeChannelRequest.new(parent: parent, channel_id: channel_id, channel: channel, request_id: request_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.materialize_channel({ parent: parent, channel_id: channel_id, channel: channel, request_id: request_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.materialize_channel(::Google::Cloud::VisionAI::V1::MaterializeChannelRequest.new(parent: parent, channel_id: channel_id, channel: channel, request_id: request_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, materialize_channel_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::VisionAI::V1::StreamsService::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::VisionAI::V1::StreamsService::Rest::Client::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/test/google/cloud/vision_ai/v1/streams_service_test.rb b/owl-bot-staging/google-cloud-vision_ai-v1/test/google/cloud/vision_ai/v1/streams_service_test.rb new file mode 100644 index 000000000000..1ff94304b96e --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/test/google/cloud/vision_ai/v1/streams_service_test.rb @@ -0,0 +1,1634 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/visionai/v1/streams_service_pb" +require "google/cloud/vision_ai/v1/streams_service" + +class ::Google::Cloud::VisionAI::V1::StreamsService::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_clusters + # Create GRPC objects. + grpc_response = ::Google::Cloud::VisionAI::V1::ListClustersResponse.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_clusters_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_clusters, name + assert_kind_of ::Google::Cloud::VisionAI::V1::ListClustersRequest, 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_clusters_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::StreamsService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_clusters({ 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_clusters 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_clusters ::Google::Cloud::VisionAI::V1::ListClustersRequest.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_clusters({ 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_clusters(::Google::Cloud::VisionAI::V1::ListClustersRequest.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_clusters_client_stub.call_rpc_count + end + end + + def test_get_cluster + # Create GRPC objects. + grpc_response = ::Google::Cloud::VisionAI::V1::Cluster.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_cluster_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_cluster, name + assert_kind_of ::Google::Cloud::VisionAI::V1::GetClusterRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_cluster_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::StreamsService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_cluster({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_cluster name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_cluster ::Google::Cloud::VisionAI::V1::GetClusterRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_cluster({ 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_cluster(::Google::Cloud::VisionAI::V1::GetClusterRequest.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_cluster_client_stub.call_rpc_count + end + end + + def test_create_cluster + # 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" + cluster_id = "hello world" + cluster = {} + request_id = "hello world" + + create_cluster_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_cluster, name + assert_kind_of ::Google::Cloud::VisionAI::V1::CreateClusterRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["cluster_id"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::VisionAI::V1::Cluster), request["cluster"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_cluster_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::StreamsService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_cluster({ parent: parent, cluster_id: cluster_id, cluster: cluster, request_id: request_id }) 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_cluster parent: parent, cluster_id: cluster_id, cluster: cluster, request_id: request_id 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_cluster ::Google::Cloud::VisionAI::V1::CreateClusterRequest.new(parent: parent, cluster_id: cluster_id, cluster: cluster, request_id: request_id) 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_cluster({ parent: parent, cluster_id: cluster_id, cluster: cluster, request_id: request_id }, 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_cluster(::Google::Cloud::VisionAI::V1::CreateClusterRequest.new(parent: parent, cluster_id: cluster_id, cluster: cluster, request_id: request_id), 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_cluster_client_stub.call_rpc_count + end + end + + def test_update_cluster + # 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. + update_mask = {} + cluster = {} + request_id = "hello world" + + update_cluster_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_cluster, name + assert_kind_of ::Google::Cloud::VisionAI::V1::UpdateClusterRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::VisionAI::V1::Cluster), request["cluster"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_cluster_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::StreamsService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_cluster({ update_mask: update_mask, cluster: cluster, request_id: request_id }) 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.update_cluster update_mask: update_mask, cluster: cluster, request_id: request_id 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.update_cluster ::Google::Cloud::VisionAI::V1::UpdateClusterRequest.new(update_mask: update_mask, cluster: cluster, request_id: request_id) 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.update_cluster({ update_mask: update_mask, cluster: cluster, request_id: request_id }, 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.update_cluster(::Google::Cloud::VisionAI::V1::UpdateClusterRequest.new(update_mask: update_mask, cluster: cluster, request_id: request_id), 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, update_cluster_client_stub.call_rpc_count + end + end + + def test_delete_cluster + # 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" + request_id = "hello world" + + delete_cluster_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_cluster, name + assert_kind_of ::Google::Cloud::VisionAI::V1::DeleteClusterRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_cluster_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::StreamsService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_cluster({ name: name, request_id: request_id }) 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_cluster name: name, request_id: request_id 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_cluster ::Google::Cloud::VisionAI::V1::DeleteClusterRequest.new(name: name, request_id: request_id) 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_cluster({ name: name, request_id: request_id }, 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_cluster(::Google::Cloud::VisionAI::V1::DeleteClusterRequest.new(name: name, request_id: request_id), 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_cluster_client_stub.call_rpc_count + end + end + + def test_list_streams + # Create GRPC objects. + grpc_response = ::Google::Cloud::VisionAI::V1::ListStreamsResponse.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_streams_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_streams, name + assert_kind_of ::Google::Cloud::VisionAI::V1::ListStreamsRequest, 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_streams_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::StreamsService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_streams({ 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_streams 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_streams ::Google::Cloud::VisionAI::V1::ListStreamsRequest.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_streams({ 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_streams(::Google::Cloud::VisionAI::V1::ListStreamsRequest.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_streams_client_stub.call_rpc_count + end + end + + def test_get_stream + # Create GRPC objects. + grpc_response = ::Google::Cloud::VisionAI::V1::Stream.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_stream_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_stream, name + assert_kind_of ::Google::Cloud::VisionAI::V1::GetStreamRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_stream_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::StreamsService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_stream({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_stream name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_stream ::Google::Cloud::VisionAI::V1::GetStreamRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_stream({ 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_stream(::Google::Cloud::VisionAI::V1::GetStreamRequest.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_stream_client_stub.call_rpc_count + end + end + + def test_create_stream + # 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" + stream_id = "hello world" + stream = {} + request_id = "hello world" + + create_stream_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_stream, name + assert_kind_of ::Google::Cloud::VisionAI::V1::CreateStreamRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["stream_id"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::VisionAI::V1::Stream), request["stream"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_stream_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::StreamsService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_stream({ parent: parent, stream_id: stream_id, stream: stream, request_id: request_id }) 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_stream parent: parent, stream_id: stream_id, stream: stream, request_id: request_id 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_stream ::Google::Cloud::VisionAI::V1::CreateStreamRequest.new(parent: parent, stream_id: stream_id, stream: stream, request_id: request_id) 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_stream({ parent: parent, stream_id: stream_id, stream: stream, request_id: request_id }, 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_stream(::Google::Cloud::VisionAI::V1::CreateStreamRequest.new(parent: parent, stream_id: stream_id, stream: stream, request_id: request_id), 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_stream_client_stub.call_rpc_count + end + end + + def test_update_stream + # 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. + update_mask = {} + stream = {} + request_id = "hello world" + + update_stream_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_stream, name + assert_kind_of ::Google::Cloud::VisionAI::V1::UpdateStreamRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::VisionAI::V1::Stream), request["stream"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_stream_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::StreamsService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_stream({ update_mask: update_mask, stream: stream, request_id: request_id }) 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.update_stream update_mask: update_mask, stream: stream, request_id: request_id 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.update_stream ::Google::Cloud::VisionAI::V1::UpdateStreamRequest.new(update_mask: update_mask, stream: stream, request_id: request_id) 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.update_stream({ update_mask: update_mask, stream: stream, request_id: request_id }, 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.update_stream(::Google::Cloud::VisionAI::V1::UpdateStreamRequest.new(update_mask: update_mask, stream: stream, request_id: request_id), 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, update_stream_client_stub.call_rpc_count + end + end + + def test_delete_stream + # 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" + request_id = "hello world" + + delete_stream_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_stream, name + assert_kind_of ::Google::Cloud::VisionAI::V1::DeleteStreamRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_stream_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::StreamsService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_stream({ name: name, request_id: request_id }) 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_stream name: name, request_id: request_id 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_stream ::Google::Cloud::VisionAI::V1::DeleteStreamRequest.new(name: name, request_id: request_id) 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_stream({ name: name, request_id: request_id }, 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_stream(::Google::Cloud::VisionAI::V1::DeleteStreamRequest.new(name: name, request_id: request_id), 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_stream_client_stub.call_rpc_count + end + end + + def test_get_stream_thumbnail + # 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. + stream = "hello world" + gcs_object_name = "hello world" + event = "hello world" + request_id = "hello world" + + get_stream_thumbnail_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_stream_thumbnail, name + assert_kind_of ::Google::Cloud::VisionAI::V1::GetStreamThumbnailRequest, request + assert_equal "hello world", request["stream"] + assert_equal "hello world", request["gcs_object_name"] + assert_equal "hello world", request["event"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_stream_thumbnail_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::StreamsService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_stream_thumbnail({ stream: stream, gcs_object_name: gcs_object_name, event: event, request_id: request_id }) 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_stream_thumbnail stream: stream, gcs_object_name: gcs_object_name, event: event, request_id: request_id 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_stream_thumbnail ::Google::Cloud::VisionAI::V1::GetStreamThumbnailRequest.new(stream: stream, gcs_object_name: gcs_object_name, event: event, request_id: request_id) 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_stream_thumbnail({ stream: stream, gcs_object_name: gcs_object_name, event: event, request_id: request_id }, 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_stream_thumbnail(::Google::Cloud::VisionAI::V1::GetStreamThumbnailRequest.new(stream: stream, gcs_object_name: gcs_object_name, event: event, request_id: request_id), 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_stream_thumbnail_client_stub.call_rpc_count + end + end + + def test_generate_stream_hls_token + # Create GRPC objects. + grpc_response = ::Google::Cloud::VisionAI::V1::GenerateStreamHlsTokenResponse.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. + stream = "hello world" + + generate_stream_hls_token_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :generate_stream_hls_token, name + assert_kind_of ::Google::Cloud::VisionAI::V1::GenerateStreamHlsTokenRequest, request + assert_equal "hello world", request["stream"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, generate_stream_hls_token_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::StreamsService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.generate_stream_hls_token({ stream: stream }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.generate_stream_hls_token stream: stream do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.generate_stream_hls_token ::Google::Cloud::VisionAI::V1::GenerateStreamHlsTokenRequest.new(stream: stream) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.generate_stream_hls_token({ stream: stream }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.generate_stream_hls_token(::Google::Cloud::VisionAI::V1::GenerateStreamHlsTokenRequest.new(stream: stream), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, generate_stream_hls_token_client_stub.call_rpc_count + end + end + + def test_list_events + # Create GRPC objects. + grpc_response = ::Google::Cloud::VisionAI::V1::ListEventsResponse.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_events_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_events, name + assert_kind_of ::Google::Cloud::VisionAI::V1::ListEventsRequest, 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_events_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::StreamsService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_events({ 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_events 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_events ::Google::Cloud::VisionAI::V1::ListEventsRequest.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_events({ 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_events(::Google::Cloud::VisionAI::V1::ListEventsRequest.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_events_client_stub.call_rpc_count + end + end + + def test_get_event + # Create GRPC objects. + grpc_response = ::Google::Cloud::VisionAI::V1::Event.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_event_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_event, name + assert_kind_of ::Google::Cloud::VisionAI::V1::GetEventRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_event_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::StreamsService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_event({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_event name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_event ::Google::Cloud::VisionAI::V1::GetEventRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_event({ 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_event(::Google::Cloud::VisionAI::V1::GetEventRequest.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_event_client_stub.call_rpc_count + end + end + + def test_create_event + # 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" + event_id = "hello world" + event = {} + request_id = "hello world" + + create_event_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_event, name + assert_kind_of ::Google::Cloud::VisionAI::V1::CreateEventRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["event_id"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::VisionAI::V1::Event), request["event"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_event_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::StreamsService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_event({ parent: parent, event_id: event_id, event: event, request_id: request_id }) 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_event parent: parent, event_id: event_id, event: event, request_id: request_id 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_event ::Google::Cloud::VisionAI::V1::CreateEventRequest.new(parent: parent, event_id: event_id, event: event, request_id: request_id) 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_event({ parent: parent, event_id: event_id, event: event, request_id: request_id }, 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_event(::Google::Cloud::VisionAI::V1::CreateEventRequest.new(parent: parent, event_id: event_id, event: event, request_id: request_id), 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_event_client_stub.call_rpc_count + end + end + + def test_update_event + # 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. + update_mask = {} + event = {} + request_id = "hello world" + + update_event_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_event, name + assert_kind_of ::Google::Cloud::VisionAI::V1::UpdateEventRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::VisionAI::V1::Event), request["event"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_event_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::StreamsService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_event({ update_mask: update_mask, event: event, request_id: request_id }) 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.update_event update_mask: update_mask, event: event, request_id: request_id 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.update_event ::Google::Cloud::VisionAI::V1::UpdateEventRequest.new(update_mask: update_mask, event: event, request_id: request_id) 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.update_event({ update_mask: update_mask, event: event, request_id: request_id }, 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.update_event(::Google::Cloud::VisionAI::V1::UpdateEventRequest.new(update_mask: update_mask, event: event, request_id: request_id), 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, update_event_client_stub.call_rpc_count + end + end + + def test_delete_event + # 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" + request_id = "hello world" + + delete_event_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_event, name + assert_kind_of ::Google::Cloud::VisionAI::V1::DeleteEventRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_event_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::StreamsService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_event({ name: name, request_id: request_id }) 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_event name: name, request_id: request_id 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_event ::Google::Cloud::VisionAI::V1::DeleteEventRequest.new(name: name, request_id: request_id) 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_event({ name: name, request_id: request_id }, 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_event(::Google::Cloud::VisionAI::V1::DeleteEventRequest.new(name: name, request_id: request_id), 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_event_client_stub.call_rpc_count + end + end + + def test_list_series + # Create GRPC objects. + grpc_response = ::Google::Cloud::VisionAI::V1::ListSeriesResponse.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_series_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_series, name + assert_kind_of ::Google::Cloud::VisionAI::V1::ListSeriesRequest, 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_series_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::StreamsService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_series({ 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_series 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_series ::Google::Cloud::VisionAI::V1::ListSeriesRequest.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_series({ 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_series(::Google::Cloud::VisionAI::V1::ListSeriesRequest.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_series_client_stub.call_rpc_count + end + end + + def test_get_series + # Create GRPC objects. + grpc_response = ::Google::Cloud::VisionAI::V1::Series.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_series_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_series, name + assert_kind_of ::Google::Cloud::VisionAI::V1::GetSeriesRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_series_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::StreamsService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_series({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_series name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_series ::Google::Cloud::VisionAI::V1::GetSeriesRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_series({ 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_series(::Google::Cloud::VisionAI::V1::GetSeriesRequest.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_series_client_stub.call_rpc_count + end + end + + def test_create_series + # 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" + series_id = "hello world" + series = {} + request_id = "hello world" + + create_series_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_series, name + assert_kind_of ::Google::Cloud::VisionAI::V1::CreateSeriesRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["series_id"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::VisionAI::V1::Series), request["series"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_series_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::StreamsService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_series({ parent: parent, series_id: series_id, series: series, request_id: request_id }) 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_series parent: parent, series_id: series_id, series: series, request_id: request_id 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_series ::Google::Cloud::VisionAI::V1::CreateSeriesRequest.new(parent: parent, series_id: series_id, series: series, request_id: request_id) 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_series({ parent: parent, series_id: series_id, series: series, request_id: request_id }, 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_series(::Google::Cloud::VisionAI::V1::CreateSeriesRequest.new(parent: parent, series_id: series_id, series: series, request_id: request_id), 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_series_client_stub.call_rpc_count + end + end + + def test_update_series + # 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. + update_mask = {} + series = {} + request_id = "hello world" + + update_series_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_series, name + assert_kind_of ::Google::Cloud::VisionAI::V1::UpdateSeriesRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::VisionAI::V1::Series), request["series"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_series_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::StreamsService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_series({ update_mask: update_mask, series: series, request_id: request_id }) 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.update_series update_mask: update_mask, series: series, request_id: request_id 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.update_series ::Google::Cloud::VisionAI::V1::UpdateSeriesRequest.new(update_mask: update_mask, series: series, request_id: request_id) 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.update_series({ update_mask: update_mask, series: series, request_id: request_id }, 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.update_series(::Google::Cloud::VisionAI::V1::UpdateSeriesRequest.new(update_mask: update_mask, series: series, request_id: request_id), 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, update_series_client_stub.call_rpc_count + end + end + + def test_delete_series + # 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" + request_id = "hello world" + + delete_series_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_series, name + assert_kind_of ::Google::Cloud::VisionAI::V1::DeleteSeriesRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_series_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::StreamsService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_series({ name: name, request_id: request_id }) 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_series name: name, request_id: request_id 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_series ::Google::Cloud::VisionAI::V1::DeleteSeriesRequest.new(name: name, request_id: request_id) 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_series({ name: name, request_id: request_id }, 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_series(::Google::Cloud::VisionAI::V1::DeleteSeriesRequest.new(name: name, request_id: request_id), 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_series_client_stub.call_rpc_count + end + end + + def test_materialize_channel + # 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" + channel_id = "hello world" + channel = {} + request_id = "hello world" + + materialize_channel_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :materialize_channel, name + assert_kind_of ::Google::Cloud::VisionAI::V1::MaterializeChannelRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["channel_id"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::VisionAI::V1::Channel), request["channel"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, materialize_channel_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::StreamsService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.materialize_channel({ parent: parent, channel_id: channel_id, channel: channel, request_id: request_id }) 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.materialize_channel parent: parent, channel_id: channel_id, channel: channel, request_id: request_id 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.materialize_channel ::Google::Cloud::VisionAI::V1::MaterializeChannelRequest.new(parent: parent, channel_id: channel_id, channel: channel, request_id: request_id) 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.materialize_channel({ parent: parent, channel_id: channel_id, channel: channel, request_id: request_id }, 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.materialize_channel(::Google::Cloud::VisionAI::V1::MaterializeChannelRequest.new(parent: parent, channel_id: channel_id, channel: channel, request_id: request_id), 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, materialize_channel_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::VisionAI::V1::StreamsService::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::VisionAI::V1::StreamsService::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::VisionAI::V1::StreamsService::Client.new do |config| + config.credentials = creds + end + assert_kind_of ::Google::Cloud::VisionAI::V1::StreamsService::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::VisionAI::V1::StreamsService::Client.new do |config| + config.credentials = grpc_channel + end + end + + assert_kind_of ::Google::Cloud::VisionAI::V1::StreamsService::Operations, client.operations_client + end +end diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/test/google/cloud/vision_ai/v1/warehouse_operations_test.rb b/owl-bot-staging/google-cloud-vision_ai-v1/test/google/cloud/vision_ai/v1/warehouse_operations_test.rb new file mode 100644 index 000000000000..7c3e8737b0a0 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/test/google/cloud/vision_ai/v1/warehouse_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/visionai/v1/warehouse_pb" +require "google/cloud/visionai/v1/warehouse_services_pb" +require "google/cloud/vision_ai/v1/warehouse" + +class ::Google::Cloud::VisionAI::V1::Warehouse::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::VisionAI::V1::Warehouse::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::VisionAI::V1::Warehouse::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::VisionAI::V1::Warehouse::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::VisionAI::V1::Warehouse::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::VisionAI::V1::Warehouse::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::VisionAI::V1::Warehouse::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::VisionAI::V1::Warehouse::Operations::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/test/google/cloud/vision_ai/v1/warehouse_paths_test.rb b/owl-bot-staging/google-cloud-vision_ai-v1/test/google/cloud/vision_ai/v1/warehouse_paths_test.rb new file mode 100644 index 000000000000..360f337ee401 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/test/google/cloud/vision_ai/v1/warehouse_paths_test.rb @@ -0,0 +1,163 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/vision_ai/v1/warehouse" + +class ::Google::Cloud::VisionAI::V1::Warehouse::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_annotation_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::VisionAI::V1::Warehouse::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.annotation_path project_number: "value0", location: "value1", corpus: "value2", asset: "value3", annotation: "value4" + assert_equal "projects/value0/locations/value1/corpora/value2/assets/value3/annotations/value4", path + end + end + + def test_asset_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::VisionAI::V1::Warehouse::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.asset_path project_number: "value0", location: "value1", corpus: "value2", asset: "value3" + assert_equal "projects/value0/locations/value1/corpora/value2/assets/value3", path + end + end + + def test_collection_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::VisionAI::V1::Warehouse::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.collection_path project_number: "value0", location: "value1", corpus: "value2", collection: "value3" + assert_equal "projects/value0/locations/value1/corpora/value2/collections/value3", path + end + end + + def test_corpus_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::VisionAI::V1::Warehouse::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.corpus_path project_number: "value0", location: "value1", corpus: "value2" + assert_equal "projects/value0/locations/value1/corpora/value2", path + end + end + + def test_data_schema_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::VisionAI::V1::Warehouse::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.data_schema_path project_number: "value0", location: "value1", corpus: "value2", data_schema: "value3" + assert_equal "projects/value0/locations/value1/corpora/value2/dataSchemas/value3", path + end + end + + def test_index_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::VisionAI::V1::Warehouse::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.index_path project_number: "value0", location: "value1", corpus: "value2", index: "value3" + assert_equal "projects/value0/locations/value1/corpora/value2/indexes/value3", path + end + end + + def test_index_endpoint_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::VisionAI::V1::Warehouse::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.index_endpoint_path project: "value0", location: "value1", index_endpoint: "value2" + assert_equal "projects/value0/locations/value1/indexEndpoints/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::VisionAI::V1::Warehouse::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_search_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::VisionAI::V1::Warehouse::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.search_config_path project_number: "value0", location: "value1", corpus: "value2", search_config: "value3" + assert_equal "projects/value0/locations/value1/corpora/value2/searchConfigs/value3", path + end + end + + def test_search_hypernym_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::VisionAI::V1::Warehouse::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.search_hypernym_path project_number: "value0", location: "value1", corpus: "value2", search_hypernym: "value3" + assert_equal "projects/value0/locations/value1/corpora/value2/searchHypernyms/value3", path + end + end +end diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/test/google/cloud/vision_ai/v1/warehouse_rest_test.rb b/owl-bot-staging/google-cloud-vision_ai-v1/test/google/cloud/vision_ai/v1/warehouse_rest_test.rb new file mode 100644 index 000000000000..3ec5308b7cde --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/test/google/cloud/vision_ai/v1/warehouse_rest_test.rb @@ -0,0 +1,3520 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/visionai/v1/warehouse_pb" +require "google/cloud/vision_ai/v1/warehouse/rest" + + +class ::Google::Cloud::VisionAI::V1::Warehouse::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_asset + # Create test objects. + client_result = ::Google::Cloud::VisionAI::V1::Asset.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + asset = {} + asset_id = "hello world" + + create_asset_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::VisionAI::V1::Warehouse::Rest::ServiceStub.stub :transcode_create_asset_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_asset_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_asset({ parent: parent, asset: asset, asset_id: asset_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_asset parent: parent, asset: asset, asset_id: asset_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_asset ::Google::Cloud::VisionAI::V1::CreateAssetRequest.new(parent: parent, asset: asset, asset_id: asset_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_asset({ parent: parent, asset: asset, asset_id: asset_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_asset(::Google::Cloud::VisionAI::V1::CreateAssetRequest.new(parent: parent, asset: asset, asset_id: asset_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_asset_client_stub.call_count + end + end + end + + def test_update_asset + # Create test objects. + client_result = ::Google::Cloud::VisionAI::V1::Asset.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + asset = {} + update_mask = {} + + update_asset_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::VisionAI::V1::Warehouse::Rest::ServiceStub.stub :transcode_update_asset_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_asset_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_asset({ asset: asset, update_mask: update_mask }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_asset asset: asset, update_mask: update_mask do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_asset ::Google::Cloud::VisionAI::V1::UpdateAssetRequest.new(asset: asset, update_mask: update_mask) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_asset({ asset: asset, update_mask: update_mask }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_asset(::Google::Cloud::VisionAI::V1::UpdateAssetRequest.new(asset: asset, update_mask: update_mask), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_asset_client_stub.call_count + end + end + end + + def test_get_asset + # Create test objects. + client_result = ::Google::Cloud::VisionAI::V1::Asset.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_asset_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::VisionAI::V1::Warehouse::Rest::ServiceStub.stub :transcode_get_asset_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_asset_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_asset({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_asset name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_asset ::Google::Cloud::VisionAI::V1::GetAssetRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_asset({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_asset(::Google::Cloud::VisionAI::V1::GetAssetRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_asset_client_stub.call_count + end + end + end + + def test_list_assets + # Create test objects. + client_result = ::Google::Cloud::VisionAI::V1::ListAssetsResponse.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_assets_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::VisionAI::V1::Warehouse::Rest::ServiceStub.stub :transcode_list_assets_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_assets_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_assets({ 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_assets 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_assets ::Google::Cloud::VisionAI::V1::ListAssetsRequest.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_assets({ 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_assets(::Google::Cloud::VisionAI::V1::ListAssetsRequest.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_assets_client_stub.call_count + end + end + end + + def test_delete_asset + # 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_asset_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::VisionAI::V1::Warehouse::Rest::ServiceStub.stub :transcode_delete_asset_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_asset_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_asset({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_asset name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_asset ::Google::Cloud::VisionAI::V1::DeleteAssetRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_asset({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_asset(::Google::Cloud::VisionAI::V1::DeleteAssetRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_asset_client_stub.call_count + end + end + end + + def test_upload_asset + # 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" + asset_source = {} + + upload_asset_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::VisionAI::V1::Warehouse::Rest::ServiceStub.stub :transcode_upload_asset_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, upload_asset_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.upload_asset({ name: name, asset_source: asset_source }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.upload_asset name: name, asset_source: asset_source do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.upload_asset ::Google::Cloud::VisionAI::V1::UploadAssetRequest.new(name: name, asset_source: asset_source) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.upload_asset({ name: name, asset_source: asset_source }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.upload_asset(::Google::Cloud::VisionAI::V1::UploadAssetRequest.new(name: name, asset_source: asset_source), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, upload_asset_client_stub.call_count + end + end + end + + def test_generate_retrieval_url + # Create test objects. + client_result = ::Google::Cloud::VisionAI::V1::GenerateRetrievalUrlResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + generate_retrieval_url_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::VisionAI::V1::Warehouse::Rest::ServiceStub.stub :transcode_generate_retrieval_url_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, generate_retrieval_url_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.generate_retrieval_url({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.generate_retrieval_url name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.generate_retrieval_url ::Google::Cloud::VisionAI::V1::GenerateRetrievalUrlRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.generate_retrieval_url({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.generate_retrieval_url(::Google::Cloud::VisionAI::V1::GenerateRetrievalUrlRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, generate_retrieval_url_client_stub.call_count + end + end + end + + def test_analyze_asset + # 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" + + analyze_asset_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::VisionAI::V1::Warehouse::Rest::ServiceStub.stub :transcode_analyze_asset_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, analyze_asset_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.analyze_asset({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.analyze_asset name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.analyze_asset ::Google::Cloud::VisionAI::V1::AnalyzeAssetRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.analyze_asset({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.analyze_asset(::Google::Cloud::VisionAI::V1::AnalyzeAssetRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, analyze_asset_client_stub.call_count + end + end + end + + def test_index_asset + # 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" + index = "hello world" + + index_asset_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::VisionAI::V1::Warehouse::Rest::ServiceStub.stub :transcode_index_asset_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, index_asset_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.index_asset({ name: name, index: index }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.index_asset name: name, index: index do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.index_asset ::Google::Cloud::VisionAI::V1::IndexAssetRequest.new(name: name, index: index) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.index_asset({ name: name, index: index }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.index_asset(::Google::Cloud::VisionAI::V1::IndexAssetRequest.new(name: name, index: index), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, index_asset_client_stub.call_count + end + end + end + + def test_remove_index_asset + # 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" + index = "hello world" + + remove_index_asset_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::VisionAI::V1::Warehouse::Rest::ServiceStub.stub :transcode_remove_index_asset_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, remove_index_asset_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.remove_index_asset({ name: name, index: index }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.remove_index_asset name: name, index: index do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.remove_index_asset ::Google::Cloud::VisionAI::V1::RemoveIndexAssetRequest.new(name: name, index: index) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.remove_index_asset({ name: name, index: index }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.remove_index_asset(::Google::Cloud::VisionAI::V1::RemoveIndexAssetRequest.new(name: name, index: index), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, remove_index_asset_client_stub.call_count + end + end + end + + def test_view_indexed_assets + # Create test objects. + client_result = ::Google::Cloud::VisionAI::V1::ViewIndexedAssetsResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + index = "hello world" + page_size = 42 + page_token = "hello world" + filter = "hello world" + + view_indexed_assets_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::VisionAI::V1::Warehouse::Rest::ServiceStub.stub :transcode_view_indexed_assets_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, view_indexed_assets_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.view_indexed_assets({ index: index, 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.view_indexed_assets index: index, 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.view_indexed_assets ::Google::Cloud::VisionAI::V1::ViewIndexedAssetsRequest.new(index: index, 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.view_indexed_assets({ index: index, 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.view_indexed_assets(::Google::Cloud::VisionAI::V1::ViewIndexedAssetsRequest.new(index: index, 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, view_indexed_assets_client_stub.call_count + end + end + end + + def test_create_index + # 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" + index_id = "hello world" + index = {} + + create_index_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::VisionAI::V1::Warehouse::Rest::ServiceStub.stub :transcode_create_index_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_index_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_index({ parent: parent, index_id: index_id, index: index }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_index parent: parent, index_id: index_id, index: index do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_index ::Google::Cloud::VisionAI::V1::CreateIndexRequest.new(parent: parent, index_id: index_id, index: index) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_index({ parent: parent, index_id: index_id, index: index }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_index(::Google::Cloud::VisionAI::V1::CreateIndexRequest.new(parent: parent, index_id: index_id, index: index), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_index_client_stub.call_count + end + end + end + + def test_update_index + # 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. + index = {} + update_mask = {} + + update_index_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::VisionAI::V1::Warehouse::Rest::ServiceStub.stub :transcode_update_index_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_index_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_index({ index: index, update_mask: update_mask }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_index index: index, update_mask: update_mask do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_index ::Google::Cloud::VisionAI::V1::UpdateIndexRequest.new(index: index, update_mask: update_mask) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_index({ index: index, update_mask: update_mask }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_index(::Google::Cloud::VisionAI::V1::UpdateIndexRequest.new(index: index, update_mask: update_mask), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_index_client_stub.call_count + end + end + end + + def test_get_index + # Create test objects. + client_result = ::Google::Cloud::VisionAI::V1::Index.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_index_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::VisionAI::V1::Warehouse::Rest::ServiceStub.stub :transcode_get_index_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_index_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_index({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_index name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_index ::Google::Cloud::VisionAI::V1::GetIndexRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_index({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_index(::Google::Cloud::VisionAI::V1::GetIndexRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_index_client_stub.call_count + end + end + end + + def test_list_indexes + # Create test objects. + client_result = ::Google::Cloud::VisionAI::V1::ListIndexesResponse.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_indexes_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::VisionAI::V1::Warehouse::Rest::ServiceStub.stub :transcode_list_indexes_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_indexes_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_indexes({ 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_indexes 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_indexes ::Google::Cloud::VisionAI::V1::ListIndexesRequest.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_indexes({ 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_indexes(::Google::Cloud::VisionAI::V1::ListIndexesRequest.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_indexes_client_stub.call_count + end + end + end + + def test_delete_index + # 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_index_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::VisionAI::V1::Warehouse::Rest::ServiceStub.stub :transcode_delete_index_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_index_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_index({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_index name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_index ::Google::Cloud::VisionAI::V1::DeleteIndexRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_index({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_index(::Google::Cloud::VisionAI::V1::DeleteIndexRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_index_client_stub.call_count + end + end + end + + def test_create_corpus + # 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" + corpus = {} + + create_corpus_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::VisionAI::V1::Warehouse::Rest::ServiceStub.stub :transcode_create_corpus_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_corpus_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_corpus({ parent: parent, corpus: corpus }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_corpus parent: parent, corpus: corpus do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_corpus ::Google::Cloud::VisionAI::V1::CreateCorpusRequest.new(parent: parent, corpus: corpus) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_corpus({ parent: parent, corpus: corpus }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_corpus(::Google::Cloud::VisionAI::V1::CreateCorpusRequest.new(parent: parent, corpus: corpus), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_corpus_client_stub.call_count + end + end + end + + def test_get_corpus + # Create test objects. + client_result = ::Google::Cloud::VisionAI::V1::Corpus.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_corpus_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::VisionAI::V1::Warehouse::Rest::ServiceStub.stub :transcode_get_corpus_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_corpus_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_corpus({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_corpus name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_corpus ::Google::Cloud::VisionAI::V1::GetCorpusRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_corpus({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_corpus(::Google::Cloud::VisionAI::V1::GetCorpusRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_corpus_client_stub.call_count + end + end + end + + def test_update_corpus + # Create test objects. + client_result = ::Google::Cloud::VisionAI::V1::Corpus.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + corpus = {} + update_mask = {} + + update_corpus_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::VisionAI::V1::Warehouse::Rest::ServiceStub.stub :transcode_update_corpus_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_corpus_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_corpus({ corpus: corpus, update_mask: update_mask }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_corpus corpus: corpus, update_mask: update_mask do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_corpus ::Google::Cloud::VisionAI::V1::UpdateCorpusRequest.new(corpus: corpus, update_mask: update_mask) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_corpus({ corpus: corpus, update_mask: update_mask }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_corpus(::Google::Cloud::VisionAI::V1::UpdateCorpusRequest.new(corpus: corpus, update_mask: update_mask), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_corpus_client_stub.call_count + end + end + end + + def test_list_corpora + # Create test objects. + client_result = ::Google::Cloud::VisionAI::V1::ListCorporaResponse.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_corpora_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::VisionAI::V1::Warehouse::Rest::ServiceStub.stub :transcode_list_corpora_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_corpora_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_corpora({ 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_corpora 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_corpora ::Google::Cloud::VisionAI::V1::ListCorporaRequest.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_corpora({ 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_corpora(::Google::Cloud::VisionAI::V1::ListCorporaRequest.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_corpora_client_stub.call_count + end + end + end + + def test_delete_corpus + # 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_corpus_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::VisionAI::V1::Warehouse::Rest::ServiceStub.stub :transcode_delete_corpus_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_corpus_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_corpus({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_corpus name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_corpus ::Google::Cloud::VisionAI::V1::DeleteCorpusRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_corpus({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_corpus(::Google::Cloud::VisionAI::V1::DeleteCorpusRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_corpus_client_stub.call_count + end + end + end + + def test_analyze_corpus + # 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" + + analyze_corpus_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::VisionAI::V1::Warehouse::Rest::ServiceStub.stub :transcode_analyze_corpus_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, analyze_corpus_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.analyze_corpus({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.analyze_corpus name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.analyze_corpus ::Google::Cloud::VisionAI::V1::AnalyzeCorpusRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.analyze_corpus({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.analyze_corpus(::Google::Cloud::VisionAI::V1::AnalyzeCorpusRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, analyze_corpus_client_stub.call_count + end + end + end + + def test_create_data_schema + # Create test objects. + client_result = ::Google::Cloud::VisionAI::V1::DataSchema.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + data_schema = {} + + create_data_schema_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::VisionAI::V1::Warehouse::Rest::ServiceStub.stub :transcode_create_data_schema_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_data_schema_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_data_schema({ parent: parent, data_schema: data_schema }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_data_schema parent: parent, data_schema: data_schema do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_data_schema ::Google::Cloud::VisionAI::V1::CreateDataSchemaRequest.new(parent: parent, data_schema: data_schema) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_data_schema({ parent: parent, data_schema: data_schema }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_data_schema(::Google::Cloud::VisionAI::V1::CreateDataSchemaRequest.new(parent: parent, data_schema: data_schema), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_data_schema_client_stub.call_count + end + end + end + + def test_update_data_schema + # Create test objects. + client_result = ::Google::Cloud::VisionAI::V1::DataSchema.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + data_schema = {} + update_mask = {} + + update_data_schema_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::VisionAI::V1::Warehouse::Rest::ServiceStub.stub :transcode_update_data_schema_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_data_schema_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_data_schema({ data_schema: data_schema, update_mask: update_mask }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_data_schema data_schema: data_schema, update_mask: update_mask do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_data_schema ::Google::Cloud::VisionAI::V1::UpdateDataSchemaRequest.new(data_schema: data_schema, update_mask: update_mask) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_data_schema({ data_schema: data_schema, update_mask: update_mask }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_data_schema(::Google::Cloud::VisionAI::V1::UpdateDataSchemaRequest.new(data_schema: data_schema, update_mask: update_mask), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_data_schema_client_stub.call_count + end + end + end + + def test_get_data_schema + # Create test objects. + client_result = ::Google::Cloud::VisionAI::V1::DataSchema.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_data_schema_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::VisionAI::V1::Warehouse::Rest::ServiceStub.stub :transcode_get_data_schema_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_data_schema_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_data_schema({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_data_schema name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_data_schema ::Google::Cloud::VisionAI::V1::GetDataSchemaRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_data_schema({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_data_schema(::Google::Cloud::VisionAI::V1::GetDataSchemaRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_data_schema_client_stub.call_count + end + end + end + + def test_delete_data_schema + # 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_data_schema_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::VisionAI::V1::Warehouse::Rest::ServiceStub.stub :transcode_delete_data_schema_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_data_schema_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_data_schema({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_data_schema name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_data_schema ::Google::Cloud::VisionAI::V1::DeleteDataSchemaRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_data_schema({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_data_schema(::Google::Cloud::VisionAI::V1::DeleteDataSchemaRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_data_schema_client_stub.call_count + end + end + end + + def test_list_data_schemas + # Create test objects. + client_result = ::Google::Cloud::VisionAI::V1::ListDataSchemasResponse.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_data_schemas_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::VisionAI::V1::Warehouse::Rest::ServiceStub.stub :transcode_list_data_schemas_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_data_schemas_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_data_schemas({ 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_data_schemas 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_data_schemas ::Google::Cloud::VisionAI::V1::ListDataSchemasRequest.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_data_schemas({ 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_data_schemas(::Google::Cloud::VisionAI::V1::ListDataSchemasRequest.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_data_schemas_client_stub.call_count + end + end + end + + def test_create_annotation + # Create test objects. + client_result = ::Google::Cloud::VisionAI::V1::Annotation.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + annotation = {} + annotation_id = "hello world" + + create_annotation_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::VisionAI::V1::Warehouse::Rest::ServiceStub.stub :transcode_create_annotation_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_annotation_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_annotation({ parent: parent, annotation: annotation, annotation_id: annotation_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_annotation parent: parent, annotation: annotation, annotation_id: annotation_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_annotation ::Google::Cloud::VisionAI::V1::CreateAnnotationRequest.new(parent: parent, annotation: annotation, annotation_id: annotation_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_annotation({ parent: parent, annotation: annotation, annotation_id: annotation_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_annotation(::Google::Cloud::VisionAI::V1::CreateAnnotationRequest.new(parent: parent, annotation: annotation, annotation_id: annotation_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_annotation_client_stub.call_count + end + end + end + + def test_get_annotation + # Create test objects. + client_result = ::Google::Cloud::VisionAI::V1::Annotation.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_annotation_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::VisionAI::V1::Warehouse::Rest::ServiceStub.stub :transcode_get_annotation_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_annotation_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_annotation({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_annotation name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_annotation ::Google::Cloud::VisionAI::V1::GetAnnotationRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_annotation({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_annotation(::Google::Cloud::VisionAI::V1::GetAnnotationRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_annotation_client_stub.call_count + end + end + end + + def test_list_annotations + # Create test objects. + client_result = ::Google::Cloud::VisionAI::V1::ListAnnotationsResponse.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_annotations_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::VisionAI::V1::Warehouse::Rest::ServiceStub.stub :transcode_list_annotations_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_annotations_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_annotations({ 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_annotations 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_annotations ::Google::Cloud::VisionAI::V1::ListAnnotationsRequest.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_annotations({ 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_annotations(::Google::Cloud::VisionAI::V1::ListAnnotationsRequest.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_annotations_client_stub.call_count + end + end + end + + def test_update_annotation + # Create test objects. + client_result = ::Google::Cloud::VisionAI::V1::Annotation.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + annotation = {} + update_mask = {} + + update_annotation_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::VisionAI::V1::Warehouse::Rest::ServiceStub.stub :transcode_update_annotation_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_annotation_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_annotation({ annotation: annotation, update_mask: update_mask }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_annotation annotation: annotation, update_mask: update_mask do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_annotation ::Google::Cloud::VisionAI::V1::UpdateAnnotationRequest.new(annotation: annotation, update_mask: update_mask) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_annotation({ annotation: annotation, update_mask: update_mask }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_annotation(::Google::Cloud::VisionAI::V1::UpdateAnnotationRequest.new(annotation: annotation, update_mask: update_mask), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_annotation_client_stub.call_count + end + end + end + + def test_delete_annotation + # 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_annotation_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::VisionAI::V1::Warehouse::Rest::ServiceStub.stub :transcode_delete_annotation_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_annotation_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_annotation({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_annotation name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_annotation ::Google::Cloud::VisionAI::V1::DeleteAnnotationRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_annotation({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_annotation(::Google::Cloud::VisionAI::V1::DeleteAnnotationRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_annotation_client_stub.call_count + end + end + end + + def test_clip_asset + # Create test objects. + client_result = ::Google::Cloud::VisionAI::V1::ClipAssetResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + temporal_partition = {} + + clip_asset_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::VisionAI::V1::Warehouse::Rest::ServiceStub.stub :transcode_clip_asset_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, clip_asset_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.clip_asset({ name: name, temporal_partition: temporal_partition }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.clip_asset name: name, temporal_partition: temporal_partition do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.clip_asset ::Google::Cloud::VisionAI::V1::ClipAssetRequest.new(name: name, temporal_partition: temporal_partition) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.clip_asset({ name: name, temporal_partition: temporal_partition }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.clip_asset(::Google::Cloud::VisionAI::V1::ClipAssetRequest.new(name: name, temporal_partition: temporal_partition), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, clip_asset_client_stub.call_count + end + end + end + + def test_generate_hls_uri + # Create test objects. + client_result = ::Google::Cloud::VisionAI::V1::GenerateHlsUriResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + temporal_partitions = [{}] + live_view_enabled = true + + generate_hls_uri_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::VisionAI::V1::Warehouse::Rest::ServiceStub.stub :transcode_generate_hls_uri_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, generate_hls_uri_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.generate_hls_uri({ name: name, temporal_partitions: temporal_partitions, live_view_enabled: live_view_enabled }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.generate_hls_uri name: name, temporal_partitions: temporal_partitions, live_view_enabled: live_view_enabled do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.generate_hls_uri ::Google::Cloud::VisionAI::V1::GenerateHlsUriRequest.new(name: name, temporal_partitions: temporal_partitions, live_view_enabled: live_view_enabled) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.generate_hls_uri({ name: name, temporal_partitions: temporal_partitions, live_view_enabled: live_view_enabled }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.generate_hls_uri(::Google::Cloud::VisionAI::V1::GenerateHlsUriRequest.new(name: name, temporal_partitions: temporal_partitions, live_view_enabled: live_view_enabled), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, generate_hls_uri_client_stub.call_count + end + end + end + + def test_import_assets + # 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. + assets_gcs_uri = "hello world" + parent = "hello world" + + import_assets_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::VisionAI::V1::Warehouse::Rest::ServiceStub.stub :transcode_import_assets_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, import_assets_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.import_assets({ assets_gcs_uri: assets_gcs_uri, parent: parent }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.import_assets assets_gcs_uri: assets_gcs_uri, parent: parent do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.import_assets ::Google::Cloud::VisionAI::V1::ImportAssetsRequest.new(assets_gcs_uri: assets_gcs_uri, parent: parent) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.import_assets({ assets_gcs_uri: assets_gcs_uri, parent: parent }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.import_assets(::Google::Cloud::VisionAI::V1::ImportAssetsRequest.new(assets_gcs_uri: assets_gcs_uri, parent: parent), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, import_assets_client_stub.call_count + end + end + end + + def test_create_search_config + # Create test objects. + client_result = ::Google::Cloud::VisionAI::V1::SearchConfig.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + search_config = {} + search_config_id = "hello world" + + create_search_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::VisionAI::V1::Warehouse::Rest::ServiceStub.stub :transcode_create_search_config_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_search_config_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_search_config({ parent: parent, search_config: search_config, search_config_id: search_config_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_search_config parent: parent, search_config: search_config, search_config_id: search_config_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_search_config ::Google::Cloud::VisionAI::V1::CreateSearchConfigRequest.new(parent: parent, search_config: search_config, search_config_id: search_config_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_search_config({ parent: parent, search_config: search_config, search_config_id: search_config_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_search_config(::Google::Cloud::VisionAI::V1::CreateSearchConfigRequest.new(parent: parent, search_config: search_config, search_config_id: search_config_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_search_config_client_stub.call_count + end + end + end + + def test_update_search_config + # Create test objects. + client_result = ::Google::Cloud::VisionAI::V1::SearchConfig.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + search_config = {} + update_mask = {} + + update_search_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::VisionAI::V1::Warehouse::Rest::ServiceStub.stub :transcode_update_search_config_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_search_config_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_search_config({ search_config: search_config, update_mask: update_mask }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_search_config search_config: search_config, update_mask: update_mask do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_search_config ::Google::Cloud::VisionAI::V1::UpdateSearchConfigRequest.new(search_config: search_config, update_mask: update_mask) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_search_config({ search_config: search_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_search_config(::Google::Cloud::VisionAI::V1::UpdateSearchConfigRequest.new(search_config: search_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_search_config_client_stub.call_count + end + end + end + + def test_get_search_config + # Create test objects. + client_result = ::Google::Cloud::VisionAI::V1::SearchConfig.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_search_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::VisionAI::V1::Warehouse::Rest::ServiceStub.stub :transcode_get_search_config_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_search_config_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_search_config({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_search_config name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_search_config ::Google::Cloud::VisionAI::V1::GetSearchConfigRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_search_config({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_search_config(::Google::Cloud::VisionAI::V1::GetSearchConfigRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_search_config_client_stub.call_count + end + end + end + + def test_delete_search_config + # 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_search_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::VisionAI::V1::Warehouse::Rest::ServiceStub.stub :transcode_delete_search_config_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_search_config_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_search_config({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_search_config name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_search_config ::Google::Cloud::VisionAI::V1::DeleteSearchConfigRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_search_config({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_search_config(::Google::Cloud::VisionAI::V1::DeleteSearchConfigRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_search_config_client_stub.call_count + end + end + end + + def test_list_search_configs + # Create test objects. + client_result = ::Google::Cloud::VisionAI::V1::ListSearchConfigsResponse.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_search_configs_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::VisionAI::V1::Warehouse::Rest::ServiceStub.stub :transcode_list_search_configs_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_search_configs_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_search_configs({ 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_search_configs 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_search_configs ::Google::Cloud::VisionAI::V1::ListSearchConfigsRequest.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_search_configs({ 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_search_configs(::Google::Cloud::VisionAI::V1::ListSearchConfigsRequest.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_search_configs_client_stub.call_count + end + end + end + + def test_create_search_hypernym + # Create test objects. + client_result = ::Google::Cloud::VisionAI::V1::SearchHypernym.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + search_hypernym = {} + search_hypernym_id = "hello world" + + create_search_hypernym_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::VisionAI::V1::Warehouse::Rest::ServiceStub.stub :transcode_create_search_hypernym_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_search_hypernym_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_search_hypernym({ parent: parent, search_hypernym: search_hypernym, search_hypernym_id: search_hypernym_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_search_hypernym parent: parent, search_hypernym: search_hypernym, search_hypernym_id: search_hypernym_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_search_hypernym ::Google::Cloud::VisionAI::V1::CreateSearchHypernymRequest.new(parent: parent, search_hypernym: search_hypernym, search_hypernym_id: search_hypernym_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_search_hypernym({ parent: parent, search_hypernym: search_hypernym, search_hypernym_id: search_hypernym_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_search_hypernym(::Google::Cloud::VisionAI::V1::CreateSearchHypernymRequest.new(parent: parent, search_hypernym: search_hypernym, search_hypernym_id: search_hypernym_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_search_hypernym_client_stub.call_count + end + end + end + + def test_update_search_hypernym + # Create test objects. + client_result = ::Google::Cloud::VisionAI::V1::SearchHypernym.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + search_hypernym = {} + update_mask = {} + + update_search_hypernym_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::VisionAI::V1::Warehouse::Rest::ServiceStub.stub :transcode_update_search_hypernym_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_search_hypernym_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_search_hypernym({ search_hypernym: search_hypernym, update_mask: update_mask }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_search_hypernym search_hypernym: search_hypernym, update_mask: update_mask do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_search_hypernym ::Google::Cloud::VisionAI::V1::UpdateSearchHypernymRequest.new(search_hypernym: search_hypernym, update_mask: update_mask) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_search_hypernym({ search_hypernym: search_hypernym, update_mask: update_mask }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_search_hypernym(::Google::Cloud::VisionAI::V1::UpdateSearchHypernymRequest.new(search_hypernym: search_hypernym, update_mask: update_mask), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_search_hypernym_client_stub.call_count + end + end + end + + def test_get_search_hypernym + # Create test objects. + client_result = ::Google::Cloud::VisionAI::V1::SearchHypernym.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_search_hypernym_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::VisionAI::V1::Warehouse::Rest::ServiceStub.stub :transcode_get_search_hypernym_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_search_hypernym_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_search_hypernym({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_search_hypernym name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_search_hypernym ::Google::Cloud::VisionAI::V1::GetSearchHypernymRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_search_hypernym({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_search_hypernym(::Google::Cloud::VisionAI::V1::GetSearchHypernymRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_search_hypernym_client_stub.call_count + end + end + end + + def test_delete_search_hypernym + # 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_search_hypernym_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::VisionAI::V1::Warehouse::Rest::ServiceStub.stub :transcode_delete_search_hypernym_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_search_hypernym_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_search_hypernym({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_search_hypernym name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_search_hypernym ::Google::Cloud::VisionAI::V1::DeleteSearchHypernymRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_search_hypernym({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_search_hypernym(::Google::Cloud::VisionAI::V1::DeleteSearchHypernymRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_search_hypernym_client_stub.call_count + end + end + end + + def test_list_search_hypernyms + # Create test objects. + client_result = ::Google::Cloud::VisionAI::V1::ListSearchHypernymsResponse.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_search_hypernyms_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::VisionAI::V1::Warehouse::Rest::ServiceStub.stub :transcode_list_search_hypernyms_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_search_hypernyms_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_search_hypernyms({ 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_search_hypernyms 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_search_hypernyms ::Google::Cloud::VisionAI::V1::ListSearchHypernymsRequest.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_search_hypernyms({ 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_search_hypernyms(::Google::Cloud::VisionAI::V1::ListSearchHypernymsRequest.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_search_hypernyms_client_stub.call_count + end + end + end + + def test_search_assets + # Create test objects. + client_result = ::Google::Cloud::VisionAI::V1::SearchAssetsResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + schema_key_sorting_strategy = {} + corpus = "hello world" + page_size = 42 + page_token = "hello world" + content_time_ranges = {} + criteria = [{}] + facet_selections = [{}] + result_annotation_keys = ["hello world"] + search_query = "hello world" + + search_assets_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::VisionAI::V1::Warehouse::Rest::ServiceStub.stub :transcode_search_assets_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, search_assets_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.search_assets({ schema_key_sorting_strategy: schema_key_sorting_strategy, corpus: corpus, page_size: page_size, page_token: page_token, content_time_ranges: content_time_ranges, criteria: criteria, facet_selections: facet_selections, result_annotation_keys: result_annotation_keys, search_query: search_query }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.search_assets schema_key_sorting_strategy: schema_key_sorting_strategy, corpus: corpus, page_size: page_size, page_token: page_token, content_time_ranges: content_time_ranges, criteria: criteria, facet_selections: facet_selections, result_annotation_keys: result_annotation_keys, search_query: search_query do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.search_assets ::Google::Cloud::VisionAI::V1::SearchAssetsRequest.new(schema_key_sorting_strategy: schema_key_sorting_strategy, corpus: corpus, page_size: page_size, page_token: page_token, content_time_ranges: content_time_ranges, criteria: criteria, facet_selections: facet_selections, result_annotation_keys: result_annotation_keys, search_query: search_query) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.search_assets({ schema_key_sorting_strategy: schema_key_sorting_strategy, corpus: corpus, page_size: page_size, page_token: page_token, content_time_ranges: content_time_ranges, criteria: criteria, facet_selections: facet_selections, result_annotation_keys: result_annotation_keys, search_query: search_query }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.search_assets(::Google::Cloud::VisionAI::V1::SearchAssetsRequest.new(schema_key_sorting_strategy: schema_key_sorting_strategy, corpus: corpus, page_size: page_size, page_token: page_token, content_time_ranges: content_time_ranges, criteria: criteria, facet_selections: facet_selections, result_annotation_keys: result_annotation_keys, search_query: search_query), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, search_assets_client_stub.call_count + end + end + end + + def test_search_index_endpoint + # Create test objects. + client_result = ::Google::Cloud::VisionAI::V1::SearchIndexEndpointResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + image_query = {} + index_endpoint = "hello world" + criteria = [{}] + exclusion_criteria = [{}] + page_size = 42 + page_token = "hello world" + + search_index_endpoint_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::VisionAI::V1::Warehouse::Rest::ServiceStub.stub :transcode_search_index_endpoint_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, search_index_endpoint_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.search_index_endpoint({ image_query: image_query, index_endpoint: index_endpoint, criteria: criteria, exclusion_criteria: exclusion_criteria, page_size: page_size, page_token: page_token }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.search_index_endpoint image_query: image_query, index_endpoint: index_endpoint, criteria: criteria, exclusion_criteria: exclusion_criteria, page_size: page_size, page_token: page_token do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.search_index_endpoint ::Google::Cloud::VisionAI::V1::SearchIndexEndpointRequest.new(image_query: image_query, index_endpoint: index_endpoint, criteria: criteria, exclusion_criteria: exclusion_criteria, 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.search_index_endpoint({ image_query: image_query, index_endpoint: index_endpoint, criteria: criteria, exclusion_criteria: exclusion_criteria, 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.search_index_endpoint(::Google::Cloud::VisionAI::V1::SearchIndexEndpointRequest.new(image_query: image_query, index_endpoint: index_endpoint, criteria: criteria, exclusion_criteria: exclusion_criteria, 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, search_index_endpoint_client_stub.call_count + end + end + end + + def test_create_index_endpoint + # 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" + index_endpoint_id = "hello world" + index_endpoint = {} + + create_index_endpoint_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::VisionAI::V1::Warehouse::Rest::ServiceStub.stub :transcode_create_index_endpoint_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_index_endpoint_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_index_endpoint({ parent: parent, index_endpoint_id: index_endpoint_id, index_endpoint: index_endpoint }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_index_endpoint parent: parent, index_endpoint_id: index_endpoint_id, index_endpoint: index_endpoint do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_index_endpoint ::Google::Cloud::VisionAI::V1::CreateIndexEndpointRequest.new(parent: parent, index_endpoint_id: index_endpoint_id, index_endpoint: index_endpoint) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_index_endpoint({ parent: parent, index_endpoint_id: index_endpoint_id, index_endpoint: index_endpoint }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_index_endpoint(::Google::Cloud::VisionAI::V1::CreateIndexEndpointRequest.new(parent: parent, index_endpoint_id: index_endpoint_id, index_endpoint: index_endpoint), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_index_endpoint_client_stub.call_count + end + end + end + + def test_get_index_endpoint + # Create test objects. + client_result = ::Google::Cloud::VisionAI::V1::IndexEndpoint.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_index_endpoint_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::VisionAI::V1::Warehouse::Rest::ServiceStub.stub :transcode_get_index_endpoint_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_index_endpoint_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_index_endpoint({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_index_endpoint name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_index_endpoint ::Google::Cloud::VisionAI::V1::GetIndexEndpointRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_index_endpoint({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_index_endpoint(::Google::Cloud::VisionAI::V1::GetIndexEndpointRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_index_endpoint_client_stub.call_count + end + end + end + + def test_list_index_endpoints + # Create test objects. + client_result = ::Google::Cloud::VisionAI::V1::ListIndexEndpointsResponse.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_index_endpoints_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::VisionAI::V1::Warehouse::Rest::ServiceStub.stub :transcode_list_index_endpoints_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_index_endpoints_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_index_endpoints({ 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_index_endpoints 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_index_endpoints ::Google::Cloud::VisionAI::V1::ListIndexEndpointsRequest.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_index_endpoints({ 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_index_endpoints(::Google::Cloud::VisionAI::V1::ListIndexEndpointsRequest.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_index_endpoints_client_stub.call_count + end + end + end + + def test_update_index_endpoint + # 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. + index_endpoint = {} + update_mask = {} + + update_index_endpoint_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::VisionAI::V1::Warehouse::Rest::ServiceStub.stub :transcode_update_index_endpoint_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_index_endpoint_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_index_endpoint({ index_endpoint: index_endpoint, update_mask: update_mask }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_index_endpoint index_endpoint: index_endpoint, update_mask: update_mask do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_index_endpoint ::Google::Cloud::VisionAI::V1::UpdateIndexEndpointRequest.new(index_endpoint: index_endpoint, update_mask: update_mask) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_index_endpoint({ index_endpoint: index_endpoint, update_mask: update_mask }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_index_endpoint(::Google::Cloud::VisionAI::V1::UpdateIndexEndpointRequest.new(index_endpoint: index_endpoint, update_mask: update_mask), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_index_endpoint_client_stub.call_count + end + end + end + + def test_delete_index_endpoint + # 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_index_endpoint_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::VisionAI::V1::Warehouse::Rest::ServiceStub.stub :transcode_delete_index_endpoint_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_index_endpoint_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_index_endpoint({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_index_endpoint name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_index_endpoint ::Google::Cloud::VisionAI::V1::DeleteIndexEndpointRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_index_endpoint({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_index_endpoint(::Google::Cloud::VisionAI::V1::DeleteIndexEndpointRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_index_endpoint_client_stub.call_count + end + end + end + + def test_deploy_index + # 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. + index_endpoint = "hello world" + deployed_index = {} + + deploy_index_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::VisionAI::V1::Warehouse::Rest::ServiceStub.stub :transcode_deploy_index_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, deploy_index_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.deploy_index({ index_endpoint: index_endpoint, deployed_index: deployed_index }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.deploy_index index_endpoint: index_endpoint, deployed_index: deployed_index do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.deploy_index ::Google::Cloud::VisionAI::V1::DeployIndexRequest.new(index_endpoint: index_endpoint, deployed_index: deployed_index) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.deploy_index({ index_endpoint: index_endpoint, deployed_index: deployed_index }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.deploy_index(::Google::Cloud::VisionAI::V1::DeployIndexRequest.new(index_endpoint: index_endpoint, deployed_index: deployed_index), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, deploy_index_client_stub.call_count + end + end + end + + def test_undeploy_index + # 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. + index_endpoint = "hello world" + + undeploy_index_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::VisionAI::V1::Warehouse::Rest::ServiceStub.stub :transcode_undeploy_index_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, undeploy_index_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.undeploy_index({ index_endpoint: index_endpoint }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.undeploy_index index_endpoint: index_endpoint do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.undeploy_index ::Google::Cloud::VisionAI::V1::UndeployIndexRequest.new(index_endpoint: index_endpoint) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.undeploy_index({ index_endpoint: index_endpoint }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.undeploy_index(::Google::Cloud::VisionAI::V1::UndeployIndexRequest.new(index_endpoint: index_endpoint), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, undeploy_index_client_stub.call_count + end + end + end + + def test_create_collection + # 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" + collection = {} + collection_id = "hello world" + + create_collection_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::VisionAI::V1::Warehouse::Rest::ServiceStub.stub :transcode_create_collection_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_collection_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_collection({ parent: parent, collection: collection, collection_id: collection_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_collection parent: parent, collection: collection, collection_id: collection_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_collection ::Google::Cloud::VisionAI::V1::CreateCollectionRequest.new(parent: parent, collection: collection, collection_id: collection_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_collection({ parent: parent, collection: collection, collection_id: collection_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_collection(::Google::Cloud::VisionAI::V1::CreateCollectionRequest.new(parent: parent, collection: collection, collection_id: collection_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_collection_client_stub.call_count + end + end + end + + def test_delete_collection + # 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_collection_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::VisionAI::V1::Warehouse::Rest::ServiceStub.stub :transcode_delete_collection_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_collection_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_collection({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_collection name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_collection ::Google::Cloud::VisionAI::V1::DeleteCollectionRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_collection({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_collection(::Google::Cloud::VisionAI::V1::DeleteCollectionRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_collection_client_stub.call_count + end + end + end + + def test_get_collection + # Create test objects. + client_result = ::Google::Cloud::VisionAI::V1::Collection.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_collection_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::VisionAI::V1::Warehouse::Rest::ServiceStub.stub :transcode_get_collection_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_collection_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_collection({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_collection name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_collection ::Google::Cloud::VisionAI::V1::GetCollectionRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_collection({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_collection(::Google::Cloud::VisionAI::V1::GetCollectionRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_collection_client_stub.call_count + end + end + end + + def test_update_collection + # Create test objects. + client_result = ::Google::Cloud::VisionAI::V1::Collection.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + collection = {} + update_mask = {} + + update_collection_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::VisionAI::V1::Warehouse::Rest::ServiceStub.stub :transcode_update_collection_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_collection_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_collection({ collection: collection, update_mask: update_mask }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_collection collection: collection, update_mask: update_mask do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_collection ::Google::Cloud::VisionAI::V1::UpdateCollectionRequest.new(collection: collection, update_mask: update_mask) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_collection({ collection: collection, update_mask: update_mask }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_collection(::Google::Cloud::VisionAI::V1::UpdateCollectionRequest.new(collection: collection, update_mask: update_mask), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_collection_client_stub.call_count + end + end + end + + def test_list_collections + # Create test objects. + client_result = ::Google::Cloud::VisionAI::V1::ListCollectionsResponse.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_collections_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::VisionAI::V1::Warehouse::Rest::ServiceStub.stub :transcode_list_collections_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_collections_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_collections({ 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_collections 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_collections ::Google::Cloud::VisionAI::V1::ListCollectionsRequest.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_collections({ 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_collections(::Google::Cloud::VisionAI::V1::ListCollectionsRequest.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_collections_client_stub.call_count + end + end + end + + def test_add_collection_item + # Create test objects. + client_result = ::Google::Cloud::VisionAI::V1::AddCollectionItemResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + item = {} + + add_collection_item_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::VisionAI::V1::Warehouse::Rest::ServiceStub.stub :transcode_add_collection_item_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, add_collection_item_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.add_collection_item({ item: item }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.add_collection_item item: item do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.add_collection_item ::Google::Cloud::VisionAI::V1::AddCollectionItemRequest.new(item: item) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.add_collection_item({ item: item }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.add_collection_item(::Google::Cloud::VisionAI::V1::AddCollectionItemRequest.new(item: item), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, add_collection_item_client_stub.call_count + end + end + end + + def test_remove_collection_item + # Create test objects. + client_result = ::Google::Cloud::VisionAI::V1::RemoveCollectionItemResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + item = {} + + remove_collection_item_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::VisionAI::V1::Warehouse::Rest::ServiceStub.stub :transcode_remove_collection_item_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, remove_collection_item_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.remove_collection_item({ item: item }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.remove_collection_item item: item do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.remove_collection_item ::Google::Cloud::VisionAI::V1::RemoveCollectionItemRequest.new(item: item) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.remove_collection_item({ item: item }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.remove_collection_item(::Google::Cloud::VisionAI::V1::RemoveCollectionItemRequest.new(item: item), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, remove_collection_item_client_stub.call_count + end + end + end + + def test_view_collection_items + # Create test objects. + client_result = ::Google::Cloud::VisionAI::V1::ViewCollectionItemsResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + collection = "hello world" + page_size = 42 + page_token = "hello world" + + view_collection_items_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::VisionAI::V1::Warehouse::Rest::ServiceStub.stub :transcode_view_collection_items_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, view_collection_items_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.view_collection_items({ collection: collection, page_size: page_size, page_token: page_token }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.view_collection_items collection: collection, page_size: page_size, page_token: page_token do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.view_collection_items ::Google::Cloud::VisionAI::V1::ViewCollectionItemsRequest.new(collection: collection, 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.view_collection_items({ collection: collection, 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.view_collection_items(::Google::Cloud::VisionAI::V1::ViewCollectionItemsRequest.new(collection: collection, 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, view_collection_items_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::VisionAI::V1::Warehouse::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::VisionAI::V1::Warehouse::Rest::Client::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/test/google/cloud/vision_ai/v1/warehouse_test.rb b/owl-bot-staging/google-cloud-vision_ai-v1/test/google/cloud/vision_ai/v1/warehouse_test.rb new file mode 100644 index 000000000000..d8ace2295146 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/test/google/cloud/vision_ai/v1/warehouse_test.rb @@ -0,0 +1,4111 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/visionai/v1/warehouse_pb" +require "google/cloud/vision_ai/v1/warehouse" + +class ::Google::Cloud::VisionAI::V1::Warehouse::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_asset + # Create GRPC objects. + grpc_response = ::Google::Cloud::VisionAI::V1::Asset.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" + asset = {} + asset_id = "hello world" + + create_asset_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_asset, name + assert_kind_of ::Google::Cloud::VisionAI::V1::CreateAssetRequest, request + assert_equal "hello world", request["parent"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::VisionAI::V1::Asset), request["asset"] + assert_equal "hello world", request["asset_id"] + assert request.has_asset_id? + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_asset_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::Warehouse::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_asset({ parent: parent, asset: asset, asset_id: asset_id }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.create_asset parent: parent, asset: asset, asset_id: asset_id do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.create_asset ::Google::Cloud::VisionAI::V1::CreateAssetRequest.new(parent: parent, asset: asset, asset_id: asset_id) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.create_asset({ parent: parent, asset: asset, asset_id: asset_id }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.create_asset(::Google::Cloud::VisionAI::V1::CreateAssetRequest.new(parent: parent, asset: asset, asset_id: asset_id), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, create_asset_client_stub.call_rpc_count + end + end + + def test_update_asset + # Create GRPC objects. + grpc_response = ::Google::Cloud::VisionAI::V1::Asset.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. + asset = {} + update_mask = {} + + update_asset_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_asset, name + assert_kind_of ::Google::Cloud::VisionAI::V1::UpdateAssetRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::VisionAI::V1::Asset), request["asset"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_asset_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::Warehouse::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_asset({ asset: asset, update_mask: update_mask }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.update_asset asset: asset, update_mask: update_mask do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.update_asset ::Google::Cloud::VisionAI::V1::UpdateAssetRequest.new(asset: asset, 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_asset({ asset: asset, 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_asset(::Google::Cloud::VisionAI::V1::UpdateAssetRequest.new(asset: asset, 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_asset_client_stub.call_rpc_count + end + end + + def test_get_asset + # Create GRPC objects. + grpc_response = ::Google::Cloud::VisionAI::V1::Asset.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_asset_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_asset, name + assert_kind_of ::Google::Cloud::VisionAI::V1::GetAssetRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_asset_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::Warehouse::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_asset({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_asset name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_asset ::Google::Cloud::VisionAI::V1::GetAssetRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_asset({ 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_asset(::Google::Cloud::VisionAI::V1::GetAssetRequest.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_asset_client_stub.call_rpc_count + end + end + + def test_list_assets + # Create GRPC objects. + grpc_response = ::Google::Cloud::VisionAI::V1::ListAssetsResponse.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_assets_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_assets, name + assert_kind_of ::Google::Cloud::VisionAI::V1::ListAssetsRequest, 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_assets_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::Warehouse::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_assets({ 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_assets 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_assets ::Google::Cloud::VisionAI::V1::ListAssetsRequest.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_assets({ 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_assets(::Google::Cloud::VisionAI::V1::ListAssetsRequest.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_assets_client_stub.call_rpc_count + end + end + + def test_delete_asset + # 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_asset_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_asset, name + assert_kind_of ::Google::Cloud::VisionAI::V1::DeleteAssetRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_asset_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::Warehouse::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_asset({ 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_asset 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_asset ::Google::Cloud::VisionAI::V1::DeleteAssetRequest.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_asset({ 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_asset(::Google::Cloud::VisionAI::V1::DeleteAssetRequest.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_asset_client_stub.call_rpc_count + end + end + + def test_upload_asset + # 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" + asset_source = {} + + upload_asset_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :upload_asset, name + assert_kind_of ::Google::Cloud::VisionAI::V1::UploadAssetRequest, request + assert_equal "hello world", request["name"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::VisionAI::V1::AssetSource), request["asset_source"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, upload_asset_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::Warehouse::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.upload_asset({ name: name, asset_source: asset_source }) 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.upload_asset name: name, asset_source: asset_source 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.upload_asset ::Google::Cloud::VisionAI::V1::UploadAssetRequest.new(name: name, asset_source: asset_source) 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.upload_asset({ name: name, asset_source: asset_source }, 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.upload_asset(::Google::Cloud::VisionAI::V1::UploadAssetRequest.new(name: name, asset_source: asset_source), 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, upload_asset_client_stub.call_rpc_count + end + end + + def test_generate_retrieval_url + # Create GRPC objects. + grpc_response = ::Google::Cloud::VisionAI::V1::GenerateRetrievalUrlResponse.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" + + generate_retrieval_url_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :generate_retrieval_url, name + assert_kind_of ::Google::Cloud::VisionAI::V1::GenerateRetrievalUrlRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, generate_retrieval_url_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::Warehouse::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.generate_retrieval_url({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.generate_retrieval_url name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.generate_retrieval_url ::Google::Cloud::VisionAI::V1::GenerateRetrievalUrlRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.generate_retrieval_url({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.generate_retrieval_url(::Google::Cloud::VisionAI::V1::GenerateRetrievalUrlRequest.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, generate_retrieval_url_client_stub.call_rpc_count + end + end + + def test_analyze_asset + # 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" + + analyze_asset_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :analyze_asset, name + assert_kind_of ::Google::Cloud::VisionAI::V1::AnalyzeAssetRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, analyze_asset_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::Warehouse::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.analyze_asset({ 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.analyze_asset 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.analyze_asset ::Google::Cloud::VisionAI::V1::AnalyzeAssetRequest.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.analyze_asset({ 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.analyze_asset(::Google::Cloud::VisionAI::V1::AnalyzeAssetRequest.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, analyze_asset_client_stub.call_rpc_count + end + end + + def test_index_asset + # 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" + index = "hello world" + + index_asset_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :index_asset, name + assert_kind_of ::Google::Cloud::VisionAI::V1::IndexAssetRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["index"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, index_asset_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::Warehouse::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.index_asset({ name: name, index: index }) 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.index_asset name: name, index: index 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.index_asset ::Google::Cloud::VisionAI::V1::IndexAssetRequest.new(name: name, index: index) 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.index_asset({ name: name, index: index }, 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.index_asset(::Google::Cloud::VisionAI::V1::IndexAssetRequest.new(name: name, index: index), 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, index_asset_client_stub.call_rpc_count + end + end + + def test_remove_index_asset + # 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" + index = "hello world" + + remove_index_asset_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :remove_index_asset, name + assert_kind_of ::Google::Cloud::VisionAI::V1::RemoveIndexAssetRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["index"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, remove_index_asset_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::Warehouse::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.remove_index_asset({ name: name, index: index }) 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.remove_index_asset name: name, index: index 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.remove_index_asset ::Google::Cloud::VisionAI::V1::RemoveIndexAssetRequest.new(name: name, index: index) 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.remove_index_asset({ name: name, index: index }, 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.remove_index_asset(::Google::Cloud::VisionAI::V1::RemoveIndexAssetRequest.new(name: name, index: index), 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, remove_index_asset_client_stub.call_rpc_count + end + end + + def test_view_indexed_assets + # Create GRPC objects. + grpc_response = ::Google::Cloud::VisionAI::V1::ViewIndexedAssetsResponse.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. + index = "hello world" + page_size = 42 + page_token = "hello world" + filter = "hello world" + + view_indexed_assets_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :view_indexed_assets, name + assert_kind_of ::Google::Cloud::VisionAI::V1::ViewIndexedAssetsRequest, request + assert_equal "hello world", request["index"] + 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, view_indexed_assets_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::Warehouse::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.view_indexed_assets({ index: index, 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.view_indexed_assets index: index, 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.view_indexed_assets ::Google::Cloud::VisionAI::V1::ViewIndexedAssetsRequest.new(index: index, 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.view_indexed_assets({ index: index, 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.view_indexed_assets(::Google::Cloud::VisionAI::V1::ViewIndexedAssetsRequest.new(index: index, 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, view_indexed_assets_client_stub.call_rpc_count + end + end + + def test_create_index + # 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" + index_id = "hello world" + index = {} + + create_index_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_index, name + assert_kind_of ::Google::Cloud::VisionAI::V1::CreateIndexRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["index_id"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::VisionAI::V1::Index), request["index"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_index_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::Warehouse::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_index({ parent: parent, index_id: index_id, index: index }) 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_index parent: parent, index_id: index_id, index: index 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_index ::Google::Cloud::VisionAI::V1::CreateIndexRequest.new(parent: parent, index_id: index_id, index: index) 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_index({ parent: parent, index_id: index_id, index: index }, 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_index(::Google::Cloud::VisionAI::V1::CreateIndexRequest.new(parent: parent, index_id: index_id, index: index), 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_index_client_stub.call_rpc_count + end + end + + def test_update_index + # 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. + index = {} + update_mask = {} + + update_index_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_index, name + assert_kind_of ::Google::Cloud::VisionAI::V1::UpdateIndexRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::VisionAI::V1::Index), request["index"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_index_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::Warehouse::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_index({ index: index, update_mask: update_mask }) 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.update_index index: index, update_mask: update_mask 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.update_index ::Google::Cloud::VisionAI::V1::UpdateIndexRequest.new(index: index, update_mask: update_mask) 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.update_index({ index: index, update_mask: update_mask }, 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.update_index(::Google::Cloud::VisionAI::V1::UpdateIndexRequest.new(index: index, update_mask: update_mask), 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, update_index_client_stub.call_rpc_count + end + end + + def test_get_index + # Create GRPC objects. + grpc_response = ::Google::Cloud::VisionAI::V1::Index.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_index_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_index, name + assert_kind_of ::Google::Cloud::VisionAI::V1::GetIndexRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_index_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::Warehouse::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_index({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_index name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_index ::Google::Cloud::VisionAI::V1::GetIndexRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_index({ 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_index(::Google::Cloud::VisionAI::V1::GetIndexRequest.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_index_client_stub.call_rpc_count + end + end + + def test_list_indexes + # Create GRPC objects. + grpc_response = ::Google::Cloud::VisionAI::V1::ListIndexesResponse.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_indexes_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_indexes, name + assert_kind_of ::Google::Cloud::VisionAI::V1::ListIndexesRequest, 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_indexes_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::Warehouse::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_indexes({ 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_indexes 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_indexes ::Google::Cloud::VisionAI::V1::ListIndexesRequest.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_indexes({ 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_indexes(::Google::Cloud::VisionAI::V1::ListIndexesRequest.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_indexes_client_stub.call_rpc_count + end + end + + def test_delete_index + # 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_index_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_index, name + assert_kind_of ::Google::Cloud::VisionAI::V1::DeleteIndexRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_index_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::Warehouse::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_index({ 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_index 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_index ::Google::Cloud::VisionAI::V1::DeleteIndexRequest.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_index({ 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_index(::Google::Cloud::VisionAI::V1::DeleteIndexRequest.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_index_client_stub.call_rpc_count + end + end + + def test_create_corpus + # 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" + corpus = {} + + create_corpus_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_corpus, name + assert_kind_of ::Google::Cloud::VisionAI::V1::CreateCorpusRequest, request + assert_equal "hello world", request["parent"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::VisionAI::V1::Corpus), request["corpus"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_corpus_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::Warehouse::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_corpus({ parent: parent, corpus: corpus }) 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_corpus parent: parent, corpus: corpus 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_corpus ::Google::Cloud::VisionAI::V1::CreateCorpusRequest.new(parent: parent, corpus: corpus) 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_corpus({ parent: parent, corpus: corpus }, 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_corpus(::Google::Cloud::VisionAI::V1::CreateCorpusRequest.new(parent: parent, corpus: corpus), 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_corpus_client_stub.call_rpc_count + end + end + + def test_get_corpus + # Create GRPC objects. + grpc_response = ::Google::Cloud::VisionAI::V1::Corpus.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_corpus_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_corpus, name + assert_kind_of ::Google::Cloud::VisionAI::V1::GetCorpusRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_corpus_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::Warehouse::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_corpus({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_corpus name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_corpus ::Google::Cloud::VisionAI::V1::GetCorpusRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_corpus({ 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_corpus(::Google::Cloud::VisionAI::V1::GetCorpusRequest.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_corpus_client_stub.call_rpc_count + end + end + + def test_update_corpus + # Create GRPC objects. + grpc_response = ::Google::Cloud::VisionAI::V1::Corpus.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. + corpus = {} + update_mask = {} + + update_corpus_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_corpus, name + assert_kind_of ::Google::Cloud::VisionAI::V1::UpdateCorpusRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::VisionAI::V1::Corpus), request["corpus"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_corpus_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::Warehouse::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_corpus({ corpus: corpus, update_mask: update_mask }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.update_corpus corpus: corpus, update_mask: update_mask do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.update_corpus ::Google::Cloud::VisionAI::V1::UpdateCorpusRequest.new(corpus: corpus, 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_corpus({ corpus: corpus, 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_corpus(::Google::Cloud::VisionAI::V1::UpdateCorpusRequest.new(corpus: corpus, 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_corpus_client_stub.call_rpc_count + end + end + + def test_list_corpora + # Create GRPC objects. + grpc_response = ::Google::Cloud::VisionAI::V1::ListCorporaResponse.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_corpora_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_corpora, name + assert_kind_of ::Google::Cloud::VisionAI::V1::ListCorporaRequest, 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_corpora_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::Warehouse::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_corpora({ 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_corpora 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_corpora ::Google::Cloud::VisionAI::V1::ListCorporaRequest.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_corpora({ 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_corpora(::Google::Cloud::VisionAI::V1::ListCorporaRequest.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_corpora_client_stub.call_rpc_count + end + end + + def test_delete_corpus + # 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_corpus_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_corpus, name + assert_kind_of ::Google::Cloud::VisionAI::V1::DeleteCorpusRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_corpus_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::Warehouse::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_corpus({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_corpus name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_corpus ::Google::Cloud::VisionAI::V1::DeleteCorpusRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_corpus({ 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_corpus(::Google::Cloud::VisionAI::V1::DeleteCorpusRequest.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_corpus_client_stub.call_rpc_count + end + end + + def test_analyze_corpus + # 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" + + analyze_corpus_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :analyze_corpus, name + assert_kind_of ::Google::Cloud::VisionAI::V1::AnalyzeCorpusRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, analyze_corpus_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::Warehouse::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.analyze_corpus({ 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.analyze_corpus 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.analyze_corpus ::Google::Cloud::VisionAI::V1::AnalyzeCorpusRequest.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.analyze_corpus({ 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.analyze_corpus(::Google::Cloud::VisionAI::V1::AnalyzeCorpusRequest.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, analyze_corpus_client_stub.call_rpc_count + end + end + + def test_create_data_schema + # Create GRPC objects. + grpc_response = ::Google::Cloud::VisionAI::V1::DataSchema.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" + data_schema = {} + + create_data_schema_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_data_schema, name + assert_kind_of ::Google::Cloud::VisionAI::V1::CreateDataSchemaRequest, request + assert_equal "hello world", request["parent"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::VisionAI::V1::DataSchema), request["data_schema"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_data_schema_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::Warehouse::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_data_schema({ parent: parent, data_schema: data_schema }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.create_data_schema parent: parent, data_schema: data_schema do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.create_data_schema ::Google::Cloud::VisionAI::V1::CreateDataSchemaRequest.new(parent: parent, data_schema: data_schema) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.create_data_schema({ parent: parent, data_schema: data_schema }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.create_data_schema(::Google::Cloud::VisionAI::V1::CreateDataSchemaRequest.new(parent: parent, data_schema: data_schema), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, create_data_schema_client_stub.call_rpc_count + end + end + + def test_update_data_schema + # Create GRPC objects. + grpc_response = ::Google::Cloud::VisionAI::V1::DataSchema.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. + data_schema = {} + update_mask = {} + + update_data_schema_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_data_schema, name + assert_kind_of ::Google::Cloud::VisionAI::V1::UpdateDataSchemaRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::VisionAI::V1::DataSchema), request["data_schema"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_data_schema_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::Warehouse::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_data_schema({ data_schema: data_schema, update_mask: update_mask }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.update_data_schema data_schema: data_schema, update_mask: update_mask do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.update_data_schema ::Google::Cloud::VisionAI::V1::UpdateDataSchemaRequest.new(data_schema: data_schema, 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_data_schema({ data_schema: data_schema, 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_data_schema(::Google::Cloud::VisionAI::V1::UpdateDataSchemaRequest.new(data_schema: data_schema, 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_data_schema_client_stub.call_rpc_count + end + end + + def test_get_data_schema + # Create GRPC objects. + grpc_response = ::Google::Cloud::VisionAI::V1::DataSchema.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_data_schema_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_data_schema, name + assert_kind_of ::Google::Cloud::VisionAI::V1::GetDataSchemaRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_data_schema_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::Warehouse::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_data_schema({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_data_schema name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_data_schema ::Google::Cloud::VisionAI::V1::GetDataSchemaRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_data_schema({ 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_data_schema(::Google::Cloud::VisionAI::V1::GetDataSchemaRequest.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_data_schema_client_stub.call_rpc_count + end + end + + def test_delete_data_schema + # 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_data_schema_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_data_schema, name + assert_kind_of ::Google::Cloud::VisionAI::V1::DeleteDataSchemaRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_data_schema_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::Warehouse::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_data_schema({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_data_schema name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_data_schema ::Google::Cloud::VisionAI::V1::DeleteDataSchemaRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_data_schema({ 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_data_schema(::Google::Cloud::VisionAI::V1::DeleteDataSchemaRequest.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_data_schema_client_stub.call_rpc_count + end + end + + def test_list_data_schemas + # Create GRPC objects. + grpc_response = ::Google::Cloud::VisionAI::V1::ListDataSchemasResponse.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_data_schemas_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_data_schemas, name + assert_kind_of ::Google::Cloud::VisionAI::V1::ListDataSchemasRequest, 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_data_schemas_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::Warehouse::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_data_schemas({ 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_data_schemas 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_data_schemas ::Google::Cloud::VisionAI::V1::ListDataSchemasRequest.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_data_schemas({ 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_data_schemas(::Google::Cloud::VisionAI::V1::ListDataSchemasRequest.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_data_schemas_client_stub.call_rpc_count + end + end + + def test_create_annotation + # Create GRPC objects. + grpc_response = ::Google::Cloud::VisionAI::V1::Annotation.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" + annotation = {} + annotation_id = "hello world" + + create_annotation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_annotation, name + assert_kind_of ::Google::Cloud::VisionAI::V1::CreateAnnotationRequest, request + assert_equal "hello world", request["parent"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::VisionAI::V1::Annotation), request["annotation"] + assert_equal "hello world", request["annotation_id"] + assert request.has_annotation_id? + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_annotation_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::Warehouse::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_annotation({ parent: parent, annotation: annotation, annotation_id: annotation_id }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.create_annotation parent: parent, annotation: annotation, annotation_id: annotation_id do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.create_annotation ::Google::Cloud::VisionAI::V1::CreateAnnotationRequest.new(parent: parent, annotation: annotation, annotation_id: annotation_id) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.create_annotation({ parent: parent, annotation: annotation, annotation_id: annotation_id }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.create_annotation(::Google::Cloud::VisionAI::V1::CreateAnnotationRequest.new(parent: parent, annotation: annotation, annotation_id: annotation_id), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, create_annotation_client_stub.call_rpc_count + end + end + + def test_get_annotation + # Create GRPC objects. + grpc_response = ::Google::Cloud::VisionAI::V1::Annotation.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_annotation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_annotation, name + assert_kind_of ::Google::Cloud::VisionAI::V1::GetAnnotationRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_annotation_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::Warehouse::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_annotation({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_annotation name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_annotation ::Google::Cloud::VisionAI::V1::GetAnnotationRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_annotation({ 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_annotation(::Google::Cloud::VisionAI::V1::GetAnnotationRequest.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_annotation_client_stub.call_rpc_count + end + end + + def test_list_annotations + # Create GRPC objects. + grpc_response = ::Google::Cloud::VisionAI::V1::ListAnnotationsResponse.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_annotations_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_annotations, name + assert_kind_of ::Google::Cloud::VisionAI::V1::ListAnnotationsRequest, 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_annotations_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::Warehouse::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_annotations({ 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_annotations 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_annotations ::Google::Cloud::VisionAI::V1::ListAnnotationsRequest.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_annotations({ 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_annotations(::Google::Cloud::VisionAI::V1::ListAnnotationsRequest.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_annotations_client_stub.call_rpc_count + end + end + + def test_update_annotation + # Create GRPC objects. + grpc_response = ::Google::Cloud::VisionAI::V1::Annotation.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. + annotation = {} + update_mask = {} + + update_annotation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_annotation, name + assert_kind_of ::Google::Cloud::VisionAI::V1::UpdateAnnotationRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::VisionAI::V1::Annotation), request["annotation"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_annotation_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::Warehouse::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_annotation({ annotation: annotation, update_mask: update_mask }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.update_annotation annotation: annotation, update_mask: update_mask do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.update_annotation ::Google::Cloud::VisionAI::V1::UpdateAnnotationRequest.new(annotation: annotation, 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_annotation({ annotation: annotation, 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_annotation(::Google::Cloud::VisionAI::V1::UpdateAnnotationRequest.new(annotation: annotation, 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_annotation_client_stub.call_rpc_count + end + end + + def test_delete_annotation + # 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_annotation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_annotation, name + assert_kind_of ::Google::Cloud::VisionAI::V1::DeleteAnnotationRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_annotation_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::Warehouse::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_annotation({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_annotation name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_annotation ::Google::Cloud::VisionAI::V1::DeleteAnnotationRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_annotation({ 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_annotation(::Google::Cloud::VisionAI::V1::DeleteAnnotationRequest.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_annotation_client_stub.call_rpc_count + end + end + + def test_ingest_asset + # Create GRPC objects. + grpc_response = ::Google::Cloud::VisionAI::V1::IngestAssetResponse.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 bidi streaming method. + config = {} + + ingest_asset_client_stub = ClientStub.new [grpc_response].to_enum, grpc_operation do |name, request, options:| + assert_equal :ingest_asset, name + assert_kind_of Enumerable, request + refute_nil options + request + end + + Gapic::ServiceStub.stub :new, ingest_asset_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::Warehouse::Client.new do |config| + config.credentials = grpc_channel + end + + # Use enumerable object with hash and protobuf object. + request_hash = { config: config } + request_proto = ::Google::Cloud::VisionAI::V1::IngestAssetRequest.new config: config + enum_input = [request_hash, request_proto].to_enum + client.ingest_asset enum_input do |response, operation| + assert_kind_of Enumerable, response + response.to_a.each do |r| + assert_kind_of ::Google::Cloud::VisionAI::V1::IngestAssetResponse, r + end + assert_equal grpc_operation, operation + end + + # Use stream input object (from gapic-common). + request_hash = { config: config } + request_proto = ::Google::Cloud::VisionAI::V1::IngestAssetRequest.new config: config + stream_input = Gapic::StreamInput.new + client.ingest_asset stream_input do |response, operation| + assert_kind_of Enumerable, response + response.to_a.each do |r| + assert_kind_of ::Google::Cloud::VisionAI::V1::IngestAssetResponse, r + end + assert_equal grpc_operation, operation + end + stream_input << request_hash + stream_input << request_proto + stream_input.close + + # Use enumerable object with hash and protobuf object with options. + request_hash = { config: config } + request_proto = ::Google::Cloud::VisionAI::V1::IngestAssetRequest.new config: config + enum_input = [request_hash, request_proto].to_enum + client.ingest_asset enum_input, grpc_options do |response, operation| + assert_kind_of Enumerable, response + response.to_a.each do |r| + assert_kind_of ::Google::Cloud::VisionAI::V1::IngestAssetResponse, r + end + assert_equal grpc_operation, operation + end + + # Use stream input object (from gapic-common) with options. + request_hash = { config: config } + request_proto = ::Google::Cloud::VisionAI::V1::IngestAssetRequest.new config: config + stream_input = Gapic::StreamInput.new + client.ingest_asset stream_input, grpc_options do |response, operation| + assert_kind_of Enumerable, response + response.to_a.each do |r| + assert_kind_of ::Google::Cloud::VisionAI::V1::IngestAssetResponse, r + end + assert_equal grpc_operation, operation + end + stream_input << request_hash + stream_input << request_proto + stream_input.close + + # Verify method calls + assert_equal 4, ingest_asset_client_stub.call_rpc_count + ingest_asset_client_stub.requests.each do |request| + request.to_a.each do |r| + assert_kind_of ::Google::Cloud::VisionAI::V1::IngestAssetRequest, r + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::VisionAI::V1::IngestAssetRequest::Config), r["config"] + assert_equal :config, r.streaming_request + end + end + end + end + + def test_clip_asset + # Create GRPC objects. + grpc_response = ::Google::Cloud::VisionAI::V1::ClipAssetResponse.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" + temporal_partition = {} + + clip_asset_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :clip_asset, name + assert_kind_of ::Google::Cloud::VisionAI::V1::ClipAssetRequest, request + assert_equal "hello world", request["name"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::VisionAI::V1::Partition::TemporalPartition), request["temporal_partition"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, clip_asset_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::Warehouse::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.clip_asset({ name: name, temporal_partition: temporal_partition }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.clip_asset name: name, temporal_partition: temporal_partition do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.clip_asset ::Google::Cloud::VisionAI::V1::ClipAssetRequest.new(name: name, temporal_partition: temporal_partition) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.clip_asset({ name: name, temporal_partition: temporal_partition }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.clip_asset(::Google::Cloud::VisionAI::V1::ClipAssetRequest.new(name: name, temporal_partition: temporal_partition), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, clip_asset_client_stub.call_rpc_count + end + end + + def test_generate_hls_uri + # Create GRPC objects. + grpc_response = ::Google::Cloud::VisionAI::V1::GenerateHlsUriResponse.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" + temporal_partitions = [{}] + live_view_enabled = true + + generate_hls_uri_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :generate_hls_uri, name + assert_kind_of ::Google::Cloud::VisionAI::V1::GenerateHlsUriRequest, request + assert_equal "hello world", request["name"] + assert_kind_of ::Google::Cloud::VisionAI::V1::Partition::TemporalPartition, request["temporal_partitions"].first + assert_equal true, request["live_view_enabled"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, generate_hls_uri_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::Warehouse::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.generate_hls_uri({ name: name, temporal_partitions: temporal_partitions, live_view_enabled: live_view_enabled }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.generate_hls_uri name: name, temporal_partitions: temporal_partitions, live_view_enabled: live_view_enabled do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.generate_hls_uri ::Google::Cloud::VisionAI::V1::GenerateHlsUriRequest.new(name: name, temporal_partitions: temporal_partitions, live_view_enabled: live_view_enabled) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.generate_hls_uri({ name: name, temporal_partitions: temporal_partitions, live_view_enabled: live_view_enabled }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.generate_hls_uri(::Google::Cloud::VisionAI::V1::GenerateHlsUriRequest.new(name: name, temporal_partitions: temporal_partitions, live_view_enabled: live_view_enabled), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, generate_hls_uri_client_stub.call_rpc_count + end + end + + def test_import_assets + # 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. + assets_gcs_uri = "hello world" + parent = "hello world" + + import_assets_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :import_assets, name + assert_kind_of ::Google::Cloud::VisionAI::V1::ImportAssetsRequest, request + assert_equal "hello world", request["assets_gcs_uri"] + assert_equal :assets_gcs_uri, request.source + assert_equal "hello world", request["parent"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, import_assets_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::Warehouse::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.import_assets({ assets_gcs_uri: assets_gcs_uri, parent: parent }) 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.import_assets assets_gcs_uri: assets_gcs_uri, parent: parent 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.import_assets ::Google::Cloud::VisionAI::V1::ImportAssetsRequest.new(assets_gcs_uri: assets_gcs_uri, parent: parent) 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.import_assets({ assets_gcs_uri: assets_gcs_uri, parent: parent }, 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.import_assets(::Google::Cloud::VisionAI::V1::ImportAssetsRequest.new(assets_gcs_uri: assets_gcs_uri, parent: parent), 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, import_assets_client_stub.call_rpc_count + end + end + + def test_create_search_config + # Create GRPC objects. + grpc_response = ::Google::Cloud::VisionAI::V1::SearchConfig.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" + search_config = {} + search_config_id = "hello world" + + create_search_config_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_search_config, name + assert_kind_of ::Google::Cloud::VisionAI::V1::CreateSearchConfigRequest, request + assert_equal "hello world", request["parent"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::VisionAI::V1::SearchConfig), request["search_config"] + assert_equal "hello world", request["search_config_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_search_config_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::Warehouse::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_search_config({ parent: parent, search_config: search_config, search_config_id: search_config_id }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.create_search_config parent: parent, search_config: search_config, search_config_id: search_config_id do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.create_search_config ::Google::Cloud::VisionAI::V1::CreateSearchConfigRequest.new(parent: parent, search_config: search_config, search_config_id: search_config_id) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.create_search_config({ parent: parent, search_config: search_config, search_config_id: search_config_id }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.create_search_config(::Google::Cloud::VisionAI::V1::CreateSearchConfigRequest.new(parent: parent, search_config: search_config, search_config_id: search_config_id), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, create_search_config_client_stub.call_rpc_count + end + end + + def test_update_search_config + # Create GRPC objects. + grpc_response = ::Google::Cloud::VisionAI::V1::SearchConfig.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. + search_config = {} + update_mask = {} + + update_search_config_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_search_config, name + assert_kind_of ::Google::Cloud::VisionAI::V1::UpdateSearchConfigRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::VisionAI::V1::SearchConfig), request["search_config"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_search_config_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::Warehouse::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_search_config({ search_config: search_config, update_mask: update_mask }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.update_search_config search_config: search_config, update_mask: update_mask do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.update_search_config ::Google::Cloud::VisionAI::V1::UpdateSearchConfigRequest.new(search_config: search_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_search_config({ search_config: search_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_search_config(::Google::Cloud::VisionAI::V1::UpdateSearchConfigRequest.new(search_config: search_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_search_config_client_stub.call_rpc_count + end + end + + def test_get_search_config + # Create GRPC objects. + grpc_response = ::Google::Cloud::VisionAI::V1::SearchConfig.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_search_config_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_search_config, name + assert_kind_of ::Google::Cloud::VisionAI::V1::GetSearchConfigRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_search_config_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::Warehouse::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_search_config({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_search_config name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_search_config ::Google::Cloud::VisionAI::V1::GetSearchConfigRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_search_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_search_config(::Google::Cloud::VisionAI::V1::GetSearchConfigRequest.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_search_config_client_stub.call_rpc_count + end + end + + def test_delete_search_config + # 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_search_config_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_search_config, name + assert_kind_of ::Google::Cloud::VisionAI::V1::DeleteSearchConfigRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_search_config_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::Warehouse::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_search_config({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_search_config name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_search_config ::Google::Cloud::VisionAI::V1::DeleteSearchConfigRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_search_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.delete_search_config(::Google::Cloud::VisionAI::V1::DeleteSearchConfigRequest.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_search_config_client_stub.call_rpc_count + end + end + + def test_list_search_configs + # Create GRPC objects. + grpc_response = ::Google::Cloud::VisionAI::V1::ListSearchConfigsResponse.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_search_configs_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_search_configs, name + assert_kind_of ::Google::Cloud::VisionAI::V1::ListSearchConfigsRequest, 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_search_configs_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::Warehouse::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_search_configs({ 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_search_configs 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_search_configs ::Google::Cloud::VisionAI::V1::ListSearchConfigsRequest.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_search_configs({ 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_search_configs(::Google::Cloud::VisionAI::V1::ListSearchConfigsRequest.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_search_configs_client_stub.call_rpc_count + end + end + + def test_create_search_hypernym + # Create GRPC objects. + grpc_response = ::Google::Cloud::VisionAI::V1::SearchHypernym.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" + search_hypernym = {} + search_hypernym_id = "hello world" + + create_search_hypernym_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_search_hypernym, name + assert_kind_of ::Google::Cloud::VisionAI::V1::CreateSearchHypernymRequest, request + assert_equal "hello world", request["parent"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::VisionAI::V1::SearchHypernym), request["search_hypernym"] + assert_equal "hello world", request["search_hypernym_id"] + assert request.has_search_hypernym_id? + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_search_hypernym_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::Warehouse::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_search_hypernym({ parent: parent, search_hypernym: search_hypernym, search_hypernym_id: search_hypernym_id }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.create_search_hypernym parent: parent, search_hypernym: search_hypernym, search_hypernym_id: search_hypernym_id do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.create_search_hypernym ::Google::Cloud::VisionAI::V1::CreateSearchHypernymRequest.new(parent: parent, search_hypernym: search_hypernym, search_hypernym_id: search_hypernym_id) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.create_search_hypernym({ parent: parent, search_hypernym: search_hypernym, search_hypernym_id: search_hypernym_id }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.create_search_hypernym(::Google::Cloud::VisionAI::V1::CreateSearchHypernymRequest.new(parent: parent, search_hypernym: search_hypernym, search_hypernym_id: search_hypernym_id), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, create_search_hypernym_client_stub.call_rpc_count + end + end + + def test_update_search_hypernym + # Create GRPC objects. + grpc_response = ::Google::Cloud::VisionAI::V1::SearchHypernym.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. + search_hypernym = {} + update_mask = {} + + update_search_hypernym_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_search_hypernym, name + assert_kind_of ::Google::Cloud::VisionAI::V1::UpdateSearchHypernymRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::VisionAI::V1::SearchHypernym), request["search_hypernym"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_search_hypernym_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::Warehouse::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_search_hypernym({ search_hypernym: search_hypernym, update_mask: update_mask }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.update_search_hypernym search_hypernym: search_hypernym, update_mask: update_mask do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.update_search_hypernym ::Google::Cloud::VisionAI::V1::UpdateSearchHypernymRequest.new(search_hypernym: search_hypernym, 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_search_hypernym({ search_hypernym: search_hypernym, 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_search_hypernym(::Google::Cloud::VisionAI::V1::UpdateSearchHypernymRequest.new(search_hypernym: search_hypernym, 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_search_hypernym_client_stub.call_rpc_count + end + end + + def test_get_search_hypernym + # Create GRPC objects. + grpc_response = ::Google::Cloud::VisionAI::V1::SearchHypernym.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_search_hypernym_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_search_hypernym, name + assert_kind_of ::Google::Cloud::VisionAI::V1::GetSearchHypernymRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_search_hypernym_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::Warehouse::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_search_hypernym({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_search_hypernym name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_search_hypernym ::Google::Cloud::VisionAI::V1::GetSearchHypernymRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_search_hypernym({ 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_search_hypernym(::Google::Cloud::VisionAI::V1::GetSearchHypernymRequest.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_search_hypernym_client_stub.call_rpc_count + end + end + + def test_delete_search_hypernym + # 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_search_hypernym_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_search_hypernym, name + assert_kind_of ::Google::Cloud::VisionAI::V1::DeleteSearchHypernymRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_search_hypernym_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::Warehouse::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_search_hypernym({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_search_hypernym name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_search_hypernym ::Google::Cloud::VisionAI::V1::DeleteSearchHypernymRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_search_hypernym({ 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_search_hypernym(::Google::Cloud::VisionAI::V1::DeleteSearchHypernymRequest.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_search_hypernym_client_stub.call_rpc_count + end + end + + def test_list_search_hypernyms + # Create GRPC objects. + grpc_response = ::Google::Cloud::VisionAI::V1::ListSearchHypernymsResponse.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_search_hypernyms_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_search_hypernyms, name + assert_kind_of ::Google::Cloud::VisionAI::V1::ListSearchHypernymsRequest, 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_search_hypernyms_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::Warehouse::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_search_hypernyms({ 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_search_hypernyms 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_search_hypernyms ::Google::Cloud::VisionAI::V1::ListSearchHypernymsRequest.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_search_hypernyms({ 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_search_hypernyms(::Google::Cloud::VisionAI::V1::ListSearchHypernymsRequest.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_search_hypernyms_client_stub.call_rpc_count + end + end + + def test_search_assets + # Create GRPC objects. + grpc_response = ::Google::Cloud::VisionAI::V1::SearchAssetsResponse.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. + schema_key_sorting_strategy = {} + corpus = "hello world" + page_size = 42 + page_token = "hello world" + content_time_ranges = {} + criteria = [{}] + facet_selections = [{}] + result_annotation_keys = ["hello world"] + search_query = "hello world" + + search_assets_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :search_assets, name + assert_kind_of ::Google::Cloud::VisionAI::V1::SearchAssetsRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::VisionAI::V1::SchemaKeySortingStrategy), request["schema_key_sorting_strategy"] + assert_equal :schema_key_sorting_strategy, request.sort_spec + assert_equal "hello world", request["corpus"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::VisionAI::V1::DateTimeRangeArray), request["content_time_ranges"] + assert_kind_of ::Google::Cloud::VisionAI::V1::Criteria, request["criteria"].first + assert_kind_of ::Google::Cloud::VisionAI::V1::FacetGroup, request["facet_selections"].first + assert_equal ["hello world"], request["result_annotation_keys"] + assert_equal "hello world", request["search_query"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, search_assets_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::Warehouse::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.search_assets({ schema_key_sorting_strategy: schema_key_sorting_strategy, corpus: corpus, page_size: page_size, page_token: page_token, content_time_ranges: content_time_ranges, criteria: criteria, facet_selections: facet_selections, result_annotation_keys: result_annotation_keys, search_query: search_query }) 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.search_assets schema_key_sorting_strategy: schema_key_sorting_strategy, corpus: corpus, page_size: page_size, page_token: page_token, content_time_ranges: content_time_ranges, criteria: criteria, facet_selections: facet_selections, result_annotation_keys: result_annotation_keys, search_query: search_query 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.search_assets ::Google::Cloud::VisionAI::V1::SearchAssetsRequest.new(schema_key_sorting_strategy: schema_key_sorting_strategy, corpus: corpus, page_size: page_size, page_token: page_token, content_time_ranges: content_time_ranges, criteria: criteria, facet_selections: facet_selections, result_annotation_keys: result_annotation_keys, search_query: search_query) 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.search_assets({ schema_key_sorting_strategy: schema_key_sorting_strategy, corpus: corpus, page_size: page_size, page_token: page_token, content_time_ranges: content_time_ranges, criteria: criteria, facet_selections: facet_selections, result_annotation_keys: result_annotation_keys, search_query: search_query }, 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.search_assets(::Google::Cloud::VisionAI::V1::SearchAssetsRequest.new(schema_key_sorting_strategy: schema_key_sorting_strategy, corpus: corpus, page_size: page_size, page_token: page_token, content_time_ranges: content_time_ranges, criteria: criteria, facet_selections: facet_selections, result_annotation_keys: result_annotation_keys, search_query: search_query), 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, search_assets_client_stub.call_rpc_count + end + end + + def test_search_index_endpoint + # Create GRPC objects. + grpc_response = ::Google::Cloud::VisionAI::V1::SearchIndexEndpointResponse.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. + image_query = {} + index_endpoint = "hello world" + criteria = [{}] + exclusion_criteria = [{}] + page_size = 42 + page_token = "hello world" + + search_index_endpoint_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :search_index_endpoint, name + assert_kind_of ::Google::Cloud::VisionAI::V1::SearchIndexEndpointRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::VisionAI::V1::ImageQuery), request["image_query"] + assert_equal :image_query, request.query + assert_equal "hello world", request["index_endpoint"] + assert_kind_of ::Google::Cloud::VisionAI::V1::Criteria, request["criteria"].first + assert_kind_of ::Google::Cloud::VisionAI::V1::Criteria, request["exclusion_criteria"].first + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, search_index_endpoint_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::Warehouse::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.search_index_endpoint({ image_query: image_query, index_endpoint: index_endpoint, criteria: criteria, exclusion_criteria: exclusion_criteria, 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.search_index_endpoint image_query: image_query, index_endpoint: index_endpoint, criteria: criteria, exclusion_criteria: exclusion_criteria, 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.search_index_endpoint ::Google::Cloud::VisionAI::V1::SearchIndexEndpointRequest.new(image_query: image_query, index_endpoint: index_endpoint, criteria: criteria, exclusion_criteria: exclusion_criteria, 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.search_index_endpoint({ image_query: image_query, index_endpoint: index_endpoint, criteria: criteria, exclusion_criteria: exclusion_criteria, 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.search_index_endpoint(::Google::Cloud::VisionAI::V1::SearchIndexEndpointRequest.new(image_query: image_query, index_endpoint: index_endpoint, criteria: criteria, exclusion_criteria: exclusion_criteria, 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, search_index_endpoint_client_stub.call_rpc_count + end + end + + def test_create_index_endpoint + # 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" + index_endpoint_id = "hello world" + index_endpoint = {} + + create_index_endpoint_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_index_endpoint, name + assert_kind_of ::Google::Cloud::VisionAI::V1::CreateIndexEndpointRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["index_endpoint_id"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::VisionAI::V1::IndexEndpoint), request["index_endpoint"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_index_endpoint_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::Warehouse::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_index_endpoint({ parent: parent, index_endpoint_id: index_endpoint_id, index_endpoint: index_endpoint }) 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_index_endpoint parent: parent, index_endpoint_id: index_endpoint_id, index_endpoint: index_endpoint 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_index_endpoint ::Google::Cloud::VisionAI::V1::CreateIndexEndpointRequest.new(parent: parent, index_endpoint_id: index_endpoint_id, index_endpoint: index_endpoint) 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_index_endpoint({ parent: parent, index_endpoint_id: index_endpoint_id, index_endpoint: index_endpoint }, 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_index_endpoint(::Google::Cloud::VisionAI::V1::CreateIndexEndpointRequest.new(parent: parent, index_endpoint_id: index_endpoint_id, index_endpoint: index_endpoint), 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_index_endpoint_client_stub.call_rpc_count + end + end + + def test_get_index_endpoint + # Create GRPC objects. + grpc_response = ::Google::Cloud::VisionAI::V1::IndexEndpoint.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_index_endpoint_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_index_endpoint, name + assert_kind_of ::Google::Cloud::VisionAI::V1::GetIndexEndpointRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_index_endpoint_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::Warehouse::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_index_endpoint({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_index_endpoint name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_index_endpoint ::Google::Cloud::VisionAI::V1::GetIndexEndpointRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_index_endpoint({ 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_index_endpoint(::Google::Cloud::VisionAI::V1::GetIndexEndpointRequest.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_index_endpoint_client_stub.call_rpc_count + end + end + + def test_list_index_endpoints + # Create GRPC objects. + grpc_response = ::Google::Cloud::VisionAI::V1::ListIndexEndpointsResponse.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_index_endpoints_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_index_endpoints, name + assert_kind_of ::Google::Cloud::VisionAI::V1::ListIndexEndpointsRequest, 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_index_endpoints_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::Warehouse::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_index_endpoints({ 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_index_endpoints 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_index_endpoints ::Google::Cloud::VisionAI::V1::ListIndexEndpointsRequest.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_index_endpoints({ 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_index_endpoints(::Google::Cloud::VisionAI::V1::ListIndexEndpointsRequest.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_index_endpoints_client_stub.call_rpc_count + end + end + + def test_update_index_endpoint + # 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. + index_endpoint = {} + update_mask = {} + + update_index_endpoint_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_index_endpoint, name + assert_kind_of ::Google::Cloud::VisionAI::V1::UpdateIndexEndpointRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::VisionAI::V1::IndexEndpoint), request["index_endpoint"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_index_endpoint_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::Warehouse::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_index_endpoint({ index_endpoint: index_endpoint, update_mask: update_mask }) 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.update_index_endpoint index_endpoint: index_endpoint, update_mask: update_mask 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.update_index_endpoint ::Google::Cloud::VisionAI::V1::UpdateIndexEndpointRequest.new(index_endpoint: index_endpoint, update_mask: update_mask) 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.update_index_endpoint({ index_endpoint: index_endpoint, update_mask: update_mask }, 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.update_index_endpoint(::Google::Cloud::VisionAI::V1::UpdateIndexEndpointRequest.new(index_endpoint: index_endpoint, update_mask: update_mask), 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, update_index_endpoint_client_stub.call_rpc_count + end + end + + def test_delete_index_endpoint + # 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_index_endpoint_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_index_endpoint, name + assert_kind_of ::Google::Cloud::VisionAI::V1::DeleteIndexEndpointRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_index_endpoint_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::Warehouse::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_index_endpoint({ 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_index_endpoint 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_index_endpoint ::Google::Cloud::VisionAI::V1::DeleteIndexEndpointRequest.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_index_endpoint({ 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_index_endpoint(::Google::Cloud::VisionAI::V1::DeleteIndexEndpointRequest.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_index_endpoint_client_stub.call_rpc_count + end + end + + def test_deploy_index + # 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. + index_endpoint = "hello world" + deployed_index = {} + + deploy_index_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :deploy_index, name + assert_kind_of ::Google::Cloud::VisionAI::V1::DeployIndexRequest, request + assert_equal "hello world", request["index_endpoint"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::VisionAI::V1::DeployedIndex), request["deployed_index"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, deploy_index_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::Warehouse::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.deploy_index({ index_endpoint: index_endpoint, deployed_index: deployed_index }) 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.deploy_index index_endpoint: index_endpoint, deployed_index: deployed_index 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.deploy_index ::Google::Cloud::VisionAI::V1::DeployIndexRequest.new(index_endpoint: index_endpoint, deployed_index: deployed_index) 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.deploy_index({ index_endpoint: index_endpoint, deployed_index: deployed_index }, 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.deploy_index(::Google::Cloud::VisionAI::V1::DeployIndexRequest.new(index_endpoint: index_endpoint, deployed_index: deployed_index), 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, deploy_index_client_stub.call_rpc_count + end + end + + def test_undeploy_index + # 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. + index_endpoint = "hello world" + + undeploy_index_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :undeploy_index, name + assert_kind_of ::Google::Cloud::VisionAI::V1::UndeployIndexRequest, request + assert_equal "hello world", request["index_endpoint"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, undeploy_index_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::Warehouse::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.undeploy_index({ index_endpoint: index_endpoint }) 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.undeploy_index index_endpoint: index_endpoint 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.undeploy_index ::Google::Cloud::VisionAI::V1::UndeployIndexRequest.new(index_endpoint: index_endpoint) 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.undeploy_index({ index_endpoint: index_endpoint }, 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.undeploy_index(::Google::Cloud::VisionAI::V1::UndeployIndexRequest.new(index_endpoint: index_endpoint), 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, undeploy_index_client_stub.call_rpc_count + end + end + + def test_create_collection + # 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" + collection = {} + collection_id = "hello world" + + create_collection_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_collection, name + assert_kind_of ::Google::Cloud::VisionAI::V1::CreateCollectionRequest, request + assert_equal "hello world", request["parent"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::VisionAI::V1::Collection), request["collection"] + assert_equal "hello world", request["collection_id"] + assert request.has_collection_id? + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_collection_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::Warehouse::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_collection({ parent: parent, collection: collection, collection_id: collection_id }) 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_collection parent: parent, collection: collection, collection_id: collection_id 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_collection ::Google::Cloud::VisionAI::V1::CreateCollectionRequest.new(parent: parent, collection: collection, collection_id: collection_id) 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_collection({ parent: parent, collection: collection, collection_id: collection_id }, 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_collection(::Google::Cloud::VisionAI::V1::CreateCollectionRequest.new(parent: parent, collection: collection, collection_id: collection_id), 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_collection_client_stub.call_rpc_count + end + end + + def test_delete_collection + # 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_collection_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_collection, name + assert_kind_of ::Google::Cloud::VisionAI::V1::DeleteCollectionRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_collection_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::Warehouse::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_collection({ 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_collection 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_collection ::Google::Cloud::VisionAI::V1::DeleteCollectionRequest.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_collection({ 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_collection(::Google::Cloud::VisionAI::V1::DeleteCollectionRequest.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_collection_client_stub.call_rpc_count + end + end + + def test_get_collection + # Create GRPC objects. + grpc_response = ::Google::Cloud::VisionAI::V1::Collection.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_collection_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_collection, name + assert_kind_of ::Google::Cloud::VisionAI::V1::GetCollectionRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_collection_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::Warehouse::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_collection({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_collection name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_collection ::Google::Cloud::VisionAI::V1::GetCollectionRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_collection({ 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_collection(::Google::Cloud::VisionAI::V1::GetCollectionRequest.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_collection_client_stub.call_rpc_count + end + end + + def test_update_collection + # Create GRPC objects. + grpc_response = ::Google::Cloud::VisionAI::V1::Collection.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. + collection = {} + update_mask = {} + + update_collection_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_collection, name + assert_kind_of ::Google::Cloud::VisionAI::V1::UpdateCollectionRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::VisionAI::V1::Collection), request["collection"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_collection_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::Warehouse::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_collection({ collection: collection, update_mask: update_mask }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.update_collection collection: collection, update_mask: update_mask do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.update_collection ::Google::Cloud::VisionAI::V1::UpdateCollectionRequest.new(collection: collection, 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_collection({ collection: collection, 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_collection(::Google::Cloud::VisionAI::V1::UpdateCollectionRequest.new(collection: collection, 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_collection_client_stub.call_rpc_count + end + end + + def test_list_collections + # Create GRPC objects. + grpc_response = ::Google::Cloud::VisionAI::V1::ListCollectionsResponse.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_collections_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_collections, name + assert_kind_of ::Google::Cloud::VisionAI::V1::ListCollectionsRequest, 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_collections_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::Warehouse::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_collections({ 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_collections 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_collections ::Google::Cloud::VisionAI::V1::ListCollectionsRequest.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_collections({ 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_collections(::Google::Cloud::VisionAI::V1::ListCollectionsRequest.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_collections_client_stub.call_rpc_count + end + end + + def test_add_collection_item + # Create GRPC objects. + grpc_response = ::Google::Cloud::VisionAI::V1::AddCollectionItemResponse.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. + item = {} + + add_collection_item_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :add_collection_item, name + assert_kind_of ::Google::Cloud::VisionAI::V1::AddCollectionItemRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::VisionAI::V1::CollectionItem), request["item"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, add_collection_item_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::Warehouse::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.add_collection_item({ item: item }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.add_collection_item item: item do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.add_collection_item ::Google::Cloud::VisionAI::V1::AddCollectionItemRequest.new(item: item) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.add_collection_item({ item: item }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.add_collection_item(::Google::Cloud::VisionAI::V1::AddCollectionItemRequest.new(item: item), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, add_collection_item_client_stub.call_rpc_count + end + end + + def test_remove_collection_item + # Create GRPC objects. + grpc_response = ::Google::Cloud::VisionAI::V1::RemoveCollectionItemResponse.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. + item = {} + + remove_collection_item_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :remove_collection_item, name + assert_kind_of ::Google::Cloud::VisionAI::V1::RemoveCollectionItemRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::VisionAI::V1::CollectionItem), request["item"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, remove_collection_item_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::Warehouse::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.remove_collection_item({ item: item }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.remove_collection_item item: item do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.remove_collection_item ::Google::Cloud::VisionAI::V1::RemoveCollectionItemRequest.new(item: item) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.remove_collection_item({ item: item }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.remove_collection_item(::Google::Cloud::VisionAI::V1::RemoveCollectionItemRequest.new(item: item), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, remove_collection_item_client_stub.call_rpc_count + end + end + + def test_view_collection_items + # Create GRPC objects. + grpc_response = ::Google::Cloud::VisionAI::V1::ViewCollectionItemsResponse.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. + collection = "hello world" + page_size = 42 + page_token = "hello world" + + view_collection_items_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :view_collection_items, name + assert_kind_of ::Google::Cloud::VisionAI::V1::ViewCollectionItemsRequest, request + assert_equal "hello world", request["collection"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, view_collection_items_client_stub do + # Create client + client = ::Google::Cloud::VisionAI::V1::Warehouse::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.view_collection_items({ collection: collection, 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.view_collection_items collection: collection, 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.view_collection_items ::Google::Cloud::VisionAI::V1::ViewCollectionItemsRequest.new(collection: collection, 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.view_collection_items({ collection: collection, 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.view_collection_items(::Google::Cloud::VisionAI::V1::ViewCollectionItemsRequest.new(collection: collection, 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, view_collection_items_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::VisionAI::V1::Warehouse::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::VisionAI::V1::Warehouse::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::VisionAI::V1::Warehouse::Client.new do |config| + config.credentials = creds + end + assert_kind_of ::Google::Cloud::VisionAI::V1::Warehouse::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::VisionAI::V1::Warehouse::Client.new do |config| + config.credentials = grpc_channel + end + end + + assert_kind_of ::Google::Cloud::VisionAI::V1::Warehouse::Operations, client.operations_client + end +end diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/test/helper.rb b/owl-bot-staging/google-cloud-vision_ai-v1/test/helper.rb new file mode 100644 index 000000000000..672b337030e7 --- /dev/null +++ b/owl-bot-staging/google-cloud-vision_ai-v1/test/helper.rb @@ -0,0 +1,26 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/mock" +require "minitest/rg" + +require "grpc" + +require "ostruct" diff --git a/owl-bot-staging/google-cloud-vm_migration-v1/.gitignore b/owl-bot-staging/google-cloud-vm_migration-v1/.gitignore new file mode 100644 index 000000000000..0135b6bc6cfc --- /dev/null +++ b/owl-bot-staging/google-cloud-vm_migration-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-vm_migration-v1/.repo-metadata.json b/owl-bot-staging/google-cloud-vm_migration-v1/.repo-metadata.json new file mode 100644 index 000000000000..e41ca8a989ff --- /dev/null +++ b/owl-bot-staging/google-cloud-vm_migration-v1/.repo-metadata.json @@ -0,0 +1,18 @@ +{ + "api_id": "vmmigration.googleapis.com", + "api_shortname": "vmmigration", + "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-vm_migration-v1/latest", + "distribution_name": "google-cloud-vm_migration-v1", + "is_cloud": true, + "language": "ruby", + "name": "vmmigration", + "name_pretty": "Migrate for Compute Engine V1 API", + "product_documentation": "https://cloud.google.com/migrate/compute-engine/", + "release_level": "unreleased", + "repo": "googleapis/google-cloud-ruby", + "requires_billing": true, + "ruby-cloud-description": "Migrate for Compute Engine enables you to migrate (Lift and Shift) your virtual machines (VMs), with minor automatic modifications, from your source environment to Google Compute Engine. Note that google-cloud-vm_migration-v1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-vm_migration instead. See the readme for more details.", + "ruby-cloud-product-url": "https://cloud.google.com/migrate/compute-engine/", + "ruby-cloud-namespace-override": "VmMigration=VMMigration", + "library_type": "GAPIC_AUTO" +} diff --git a/owl-bot-staging/google-cloud-vm_migration-v1/.rubocop.yml b/owl-bot-staging/google-cloud-vm_migration-v1/.rubocop.yml new file mode 100644 index 000000000000..ed368c04ab68 --- /dev/null +++ b/owl-bot-staging/google-cloud-vm_migration-v1/.rubocop.yml @@ -0,0 +1,33 @@ +inherit_gem: + google-style: google-style.yml + +AllCops: + Exclude: + - "google-cloud-vm_migration-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-vm_migration-v1.rb" diff --git a/owl-bot-staging/google-cloud-vm_migration-v1/.toys.rb b/owl-bot-staging/google-cloud-vm_migration-v1/.toys.rb new file mode 100644 index 000000000000..177e22456e8a --- /dev/null +++ b/owl-bot-staging/google-cloud-vm_migration-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-vm_migration-v1/.yardopts b/owl-bot-staging/google-cloud-vm_migration-v1/.yardopts new file mode 100644 index 000000000000..db8f3461869c --- /dev/null +++ b/owl-bot-staging/google-cloud-vm_migration-v1/.yardopts @@ -0,0 +1,12 @@ +--no-private +--title="Migrate for Compute Engine 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-vm_migration-v1/AUTHENTICATION.md b/owl-bot-staging/google-cloud-vm_migration-v1/AUTHENTICATION.md new file mode 100644 index 000000000000..1b07ac625571 --- /dev/null +++ b/owl-bot-staging/google-cloud-vm_migration-v1/AUTHENTICATION.md @@ -0,0 +1,122 @@ +# Authentication + +The recommended way to authenticate to the google-cloud-vm_migration-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-vm_migration-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/vm_migration/v1" + +client = ::Google::Cloud::VMMigration::V1::VMMigration::Client.new do |config| + config.credentials = "path/to/credentialfile.json" +end +``` + +To configure a credentials file globally for all clients: + +```ruby +require "google/cloud/vm_migration/v1" + +::Google::Cloud::VMMigration::V1::VMMigration::Client.configure do |config| + config.credentials = "path/to/credentialfile.json" +end + +client = ::Google::Cloud::VMMigration::V1::VMMigration::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-vm_migration-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/vm_migration/v1" + +ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" + +client = ::Google::Cloud::VMMigration::V1::VMMigration::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-vm_migration-v1/CHANGELOG.md b/owl-bot-staging/google-cloud-vm_migration-v1/CHANGELOG.md new file mode 100644 index 000000000000..f88957a62ba2 --- /dev/null +++ b/owl-bot-staging/google-cloud-vm_migration-v1/CHANGELOG.md @@ -0,0 +1,2 @@ +# Release History + diff --git a/owl-bot-staging/google-cloud-vm_migration-v1/Gemfile b/owl-bot-staging/google-cloud-vm_migration-v1/Gemfile new file mode 100644 index 000000000000..1d08558908d8 --- /dev/null +++ b/owl-bot-staging/google-cloud-vm_migration-v1/Gemfile @@ -0,0 +1,14 @@ +source "https://rubygems.org" + +gemspec + +gem "google-style", "~> 1.32.0" +gem "irb", "~> 1.17" +gem "minitest", "~> 6.0.2" +gem "minitest-focus", "~> 1.4" +gem "minitest-mock", "~> 5.27" +gem "minitest-rg", "~> 5.3" +gem "ostruct", "~> 0.5.5" +gem "rake", ">= 13.0" +gem "redcarpet", "~> 3.6" +gem "yard", "~> 0.9" diff --git a/owl-bot-staging/google-cloud-vm_migration-v1/LICENSE.md b/owl-bot-staging/google-cloud-vm_migration-v1/LICENSE.md new file mode 100644 index 000000000000..c261857ba6ad --- /dev/null +++ b/owl-bot-staging/google-cloud-vm_migration-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-vm_migration-v1/README.md b/owl-bot-staging/google-cloud-vm_migration-v1/README.md new file mode 100644 index 000000000000..2679aab0cbec --- /dev/null +++ b/owl-bot-staging/google-cloud-vm_migration-v1/README.md @@ -0,0 +1,154 @@ +# Ruby Client for the Migrate for Compute Engine V1 API + +Use the Migrate to Virtual Machines API to programmatically migrate workloads. + +Migrate for Compute Engine enables you to migrate (Lift and Shift) your virtual machines (VMs), with minor automatic modifications, from your source environment to Google Compute Engine. + +https://github.com/googleapis/google-cloud-ruby + +This gem is a _versioned_ client. It provides basic client classes for a +specific version of the Migrate for Compute Engine V1 API. Most users should consider using +the main client gem, +[google-cloud-vm_migration](https://rubygems.org/gems/google-cloud-vm_migration). +See the section below titled *Which client should I use?* for more information. + +## Installation + +``` +$ gem install google-cloud-vm_migration-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/vmmigration.googleapis.com) +1. [Set up authentication.](AUTHENTICATION.md) + +## Quick Start + +```ruby +require "google/cloud/vm_migration/v1" + +client = ::Google::Cloud::VMMigration::V1::VMMigration::Client.new +request = ::Google::Cloud::VMMigration::V1::ListSourcesRequest.new # (request fields as keyword arguments...) +response = client.list_sources request +``` + +View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-vm_migration-v1/latest) +for class and method documentation. + +See also the [Product Documentation](https://cloud.google.com/migrate/compute-engine/) +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/vm_migration/v1" +require "logger" + +client = ::Google::Cloud::VMMigration::V1::VMMigration::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-vm_migration`, +and lower-level _versioned_ client libraries with names such as +`google-cloud-vm_migration-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-vm_migration`. +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-vm_migration-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-vm_migration-v1/Rakefile b/owl-bot-staging/google-cloud-vm_migration-v1/Rakefile new file mode 100644 index 000000000000..cf4bd28134dd --- /dev/null +++ b/owl-bot-staging/google-cloud-vm_migration-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-vm_migration-v1 acceptance tests." +task :acceptance, :project, :keyfile do |t, args| + project = args[:project] + project ||= + ENV["GOOGLE_CLOUD_TEST_PROJECT"] || + ENV["GCLOUD_TEST_PROJECT"] + keyfile = args[:keyfile] + keyfile ||= + ENV["GOOGLE_CLOUD_TEST_KEYFILE"] || + ENV["GCLOUD_TEST_KEYFILE"] + if keyfile + keyfile = File.read keyfile + else + keyfile ||= + ENV["GOOGLE_CLOUD_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 GOOGLE_CLOUD_TEST_PROJECT=test123 GOOGLE_CLOUD_TEST_KEYFILE=/path/to/keyfile.json rake acceptance" + end + require "google/cloud/vm_migration/v1/vm_migration/credentials" + ::Google::Cloud::VMMigration::V1::VMMigration::Credentials.env_vars.each do |path| + ENV[path] = nil + end + ENV["GOOGLE_CLOUD_PROJECT"] = project + ENV["GOOGLE_CLOUD_TEST_PROJECT"] = project + ENV["GOOGLE_CLOUD_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-vm_migration-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-vm_migration-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-vm_migration-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-vm_migration-v1 gem does not have doctest tests." +end + +desc "Run the CI build" +task :ci do + header "BUILDING google-cloud-vm_migration-v1" + header "google-cloud-vm_migration-v1 rubocop", "*" + Rake::Task[:rubocop].invoke + header "google-cloud-vm_migration-v1 yard", "*" + Rake::Task[:yard].invoke + header "google-cloud-vm_migration-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-vm_migration-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-vm_migration-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-vm_migration-v1/gapic_metadata.json b/owl-bot-staging/google-cloud-vm_migration-v1/gapic_metadata.json new file mode 100644 index 000000000000..fca98208a8d8 --- /dev/null +++ b/owl-bot-staging/google-cloud-vm_migration-v1/gapic_metadata.json @@ -0,0 +1,328 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "ruby", + "protoPackage": "google.cloud.vmmigration.v1", + "libraryPackage": "::Google::Cloud::VMMigration::V1", + "services": { + "VmMigration": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::VMMigration::V1::VMMigration::Client", + "rpcs": { + "ListSources": { + "methods": [ + "list_sources" + ] + }, + "GetSource": { + "methods": [ + "get_source" + ] + }, + "CreateSource": { + "methods": [ + "create_source" + ] + }, + "UpdateSource": { + "methods": [ + "update_source" + ] + }, + "DeleteSource": { + "methods": [ + "delete_source" + ] + }, + "FetchInventory": { + "methods": [ + "fetch_inventory" + ] + }, + "FetchStorageInventory": { + "methods": [ + "fetch_storage_inventory" + ] + }, + "ListUtilizationReports": { + "methods": [ + "list_utilization_reports" + ] + }, + "GetUtilizationReport": { + "methods": [ + "get_utilization_report" + ] + }, + "CreateUtilizationReport": { + "methods": [ + "create_utilization_report" + ] + }, + "DeleteUtilizationReport": { + "methods": [ + "delete_utilization_report" + ] + }, + "ListDatacenterConnectors": { + "methods": [ + "list_datacenter_connectors" + ] + }, + "GetDatacenterConnector": { + "methods": [ + "get_datacenter_connector" + ] + }, + "CreateDatacenterConnector": { + "methods": [ + "create_datacenter_connector" + ] + }, + "DeleteDatacenterConnector": { + "methods": [ + "delete_datacenter_connector" + ] + }, + "UpgradeAppliance": { + "methods": [ + "upgrade_appliance" + ] + }, + "CreateMigratingVm": { + "methods": [ + "create_migrating_vm" + ] + }, + "ListMigratingVms": { + "methods": [ + "list_migrating_vms" + ] + }, + "GetMigratingVm": { + "methods": [ + "get_migrating_vm" + ] + }, + "UpdateMigratingVm": { + "methods": [ + "update_migrating_vm" + ] + }, + "DeleteMigratingVm": { + "methods": [ + "delete_migrating_vm" + ] + }, + "StartMigration": { + "methods": [ + "start_migration" + ] + }, + "ResumeMigration": { + "methods": [ + "resume_migration" + ] + }, + "PauseMigration": { + "methods": [ + "pause_migration" + ] + }, + "FinalizeMigration": { + "methods": [ + "finalize_migration" + ] + }, + "ExtendMigration": { + "methods": [ + "extend_migration" + ] + }, + "CreateCloneJob": { + "methods": [ + "create_clone_job" + ] + }, + "CancelCloneJob": { + "methods": [ + "cancel_clone_job" + ] + }, + "ListCloneJobs": { + "methods": [ + "list_clone_jobs" + ] + }, + "GetCloneJob": { + "methods": [ + "get_clone_job" + ] + }, + "CreateCutoverJob": { + "methods": [ + "create_cutover_job" + ] + }, + "CancelCutoverJob": { + "methods": [ + "cancel_cutover_job" + ] + }, + "ListCutoverJobs": { + "methods": [ + "list_cutover_jobs" + ] + }, + "GetCutoverJob": { + "methods": [ + "get_cutover_job" + ] + }, + "ListGroups": { + "methods": [ + "list_groups" + ] + }, + "GetGroup": { + "methods": [ + "get_group" + ] + }, + "CreateGroup": { + "methods": [ + "create_group" + ] + }, + "UpdateGroup": { + "methods": [ + "update_group" + ] + }, + "DeleteGroup": { + "methods": [ + "delete_group" + ] + }, + "AddGroupMigration": { + "methods": [ + "add_group_migration" + ] + }, + "RemoveGroupMigration": { + "methods": [ + "remove_group_migration" + ] + }, + "ListTargetProjects": { + "methods": [ + "list_target_projects" + ] + }, + "GetTargetProject": { + "methods": [ + "get_target_project" + ] + }, + "CreateTargetProject": { + "methods": [ + "create_target_project" + ] + }, + "UpdateTargetProject": { + "methods": [ + "update_target_project" + ] + }, + "DeleteTargetProject": { + "methods": [ + "delete_target_project" + ] + }, + "ListReplicationCycles": { + "methods": [ + "list_replication_cycles" + ] + }, + "GetReplicationCycle": { + "methods": [ + "get_replication_cycle" + ] + }, + "ListImageImports": { + "methods": [ + "list_image_imports" + ] + }, + "GetImageImport": { + "methods": [ + "get_image_import" + ] + }, + "CreateImageImport": { + "methods": [ + "create_image_import" + ] + }, + "DeleteImageImport": { + "methods": [ + "delete_image_import" + ] + }, + "ListImageImportJobs": { + "methods": [ + "list_image_import_jobs" + ] + }, + "GetImageImportJob": { + "methods": [ + "get_image_import_job" + ] + }, + "CancelImageImportJob": { + "methods": [ + "cancel_image_import_job" + ] + }, + "CreateDiskMigrationJob": { + "methods": [ + "create_disk_migration_job" + ] + }, + "ListDiskMigrationJobs": { + "methods": [ + "list_disk_migration_jobs" + ] + }, + "GetDiskMigrationJob": { + "methods": [ + "get_disk_migration_job" + ] + }, + "UpdateDiskMigrationJob": { + "methods": [ + "update_disk_migration_job" + ] + }, + "DeleteDiskMigrationJob": { + "methods": [ + "delete_disk_migration_job" + ] + }, + "RunDiskMigrationJob": { + "methods": [ + "run_disk_migration_job" + ] + }, + "CancelDiskMigrationJob": { + "methods": [ + "cancel_disk_migration_job" + ] + } + } + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-vm_migration-v1/google-cloud-vm_migration-v1.gemspec b/owl-bot-staging/google-cloud-vm_migration-v1/google-cloud-vm_migration-v1.gemspec new file mode 100644 index 000000000000..edd25868427c --- /dev/null +++ b/owl-bot-staging/google-cloud-vm_migration-v1/google-cloud-vm_migration-v1.gemspec @@ -0,0 +1,30 @@ +# -*- ruby -*- +# encoding: utf-8 + +require File.expand_path("lib/google/cloud/vm_migration/v1/version", __dir__) + +Gem::Specification.new do |gem| + gem.name = "google-cloud-vm_migration-v1" + gem.version = Google::Cloud::VMMigration::V1::VERSION + + gem.authors = ["Google LLC"] + gem.email = "googleapis-packages@google.com" + gem.description = "Migrate for Compute Engine enables you to migrate (Lift and Shift) your virtual machines (VMs), with minor automatic modifications, from your source environment to Google Compute Engine. Note that google-cloud-vm_migration-v1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-vm_migration instead. See the readme for more details." + gem.summary = "Use the Migrate to Virtual Machines API to programmatically migrate workloads." + 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.2" + + 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 "grpc-google-iam-v1", "~> 1.11" +end diff --git a/owl-bot-staging/google-cloud-vm_migration-v1/lib/google-cloud-vm_migration-v1.rb b/owl-bot-staging/google-cloud-vm_migration-v1/lib/google-cloud-vm_migration-v1.rb new file mode 100644 index 000000000000..04975c68877a --- /dev/null +++ b/owl-bot-staging/google-cloud-vm_migration-v1/lib/google-cloud-vm_migration-v1.rb @@ -0,0 +1,22 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/vm_migration/v1" +# require "google/iam/v1" diff --git a/owl-bot-staging/google-cloud-vm_migration-v1/lib/google/cloud/vm_migration/v1.rb b/owl-bot-staging/google-cloud-vm_migration-v1/lib/google/cloud/vm_migration/v1.rb new file mode 100644 index 000000000000..b8a6cc16fb6f --- /dev/null +++ b/owl-bot-staging/google-cloud-vm_migration-v1/lib/google/cloud/vm_migration/v1.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/vm_migration/v1/vm_migration" +require "google/cloud/vm_migration/v1/version" + +module Google + module Cloud + module VMMigration + ## + # API client module. + # + # @example Load this package, including all its services, and instantiate a gRPC client + # + # require "google/cloud/vm_migration/v1" + # client = ::Google::Cloud::VMMigration::V1::VMMigration::Client.new + # + # @example Load this package, including all its services, and instantiate a REST client + # + # require "google/cloud/vm_migration/v1" + # client = ::Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new + # + module V1 + end + end + end +end + +helper_path = ::File.join __dir__, "v1", "_helpers.rb" +require "google/cloud/vm_migration/v1/_helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-vm_migration-v1/lib/google/cloud/vm_migration/v1/bindings_override.rb b/owl-bot-staging/google-cloud-vm_migration-v1/lib/google/cloud/vm_migration/v1/bindings_override.rb new file mode 100644 index 000000000000..a2afa26a3b79 --- /dev/null +++ b/owl-bot-staging/google-cloud-vm_migration-v1/lib/google/cloud/vm_migration/v1/bindings_override.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! + +require "gapic/rest" + +module Google + module Cloud + module VMMigration + ## + # @example Loading just the REST part of this package, including all its services, and instantiating a REST client + # + # require "google/cloud/vm_migration/v1/rest" + # client = ::Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new + # + module V1 + ## + # @private + # Initialize the mixin bindings configuration + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "VMMigration"] + 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 + end + yield @configure if block_given? + @configure + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-vm_migration-v1/lib/google/cloud/vm_migration/v1/rest.rb b/owl-bot-staging/google-cloud-vm_migration-v1/lib/google/cloud/vm_migration/v1/rest.rb new file mode 100644 index 000000000000..4685fa902488 --- /dev/null +++ b/owl-bot-staging/google-cloud-vm_migration-v1/lib/google/cloud/vm_migration/v1/rest.rb @@ -0,0 +1,38 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/vm_migration/v1/vm_migration/rest" +require "google/cloud/vm_migration/v1/bindings_override" +require "google/cloud/vm_migration/v1/version" + +module Google + module Cloud + module VMMigration + ## + # To load just the REST part of this package, including all its services, and instantiate a REST client: + # + # @example + # + # require "google/cloud/vm_migration/v1/rest" + # client = ::Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new + # + module V1 + end + end + end +end diff --git a/owl-bot-staging/google-cloud-vm_migration-v1/lib/google/cloud/vm_migration/v1/version.rb b/owl-bot-staging/google-cloud-vm_migration-v1/lib/google/cloud/vm_migration/v1/version.rb new file mode 100644 index 000000000000..a9da1f8b2936 --- /dev/null +++ b/owl-bot-staging/google-cloud-vm_migration-v1/lib/google/cloud/vm_migration/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 VMMigration + module V1 + VERSION = "0.0.1" + end + end + end +end diff --git a/owl-bot-staging/google-cloud-vm_migration-v1/lib/google/cloud/vm_migration/v1/vm_migration.rb b/owl-bot-staging/google-cloud-vm_migration-v1/lib/google/cloud/vm_migration/v1/vm_migration.rb new file mode 100644 index 000000000000..dc908ff6c0cb --- /dev/null +++ b/owl-bot-staging/google-cloud-vm_migration-v1/lib/google/cloud/vm_migration/v1/vm_migration.rb @@ -0,0 +1,56 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/vm_migration/v1/version" + +require "google/cloud/vm_migration/v1/vm_migration/credentials" +require "google/cloud/vm_migration/v1/vm_migration/paths" +require "google/cloud/vm_migration/v1/vm_migration/operations" +require "google/cloud/vm_migration/v1/vm_migration/client" +require "google/cloud/vm_migration/v1/vm_migration/rest" + +module Google + module Cloud + module VMMigration + module V1 + ## + # VM Migration Service + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/vm_migration/v1/vm_migration" + # client = ::Google::Cloud::VMMigration::V1::VMMigration::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/vm_migration/v1/vm_migration/rest" + # client = ::Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new + # + module VMMigration + end + end + end + end +end + +helper_path = ::File.join __dir__, "vm_migration", "helpers.rb" +require "google/cloud/vm_migration/v1/vm_migration/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-vm_migration-v1/lib/google/cloud/vm_migration/v1/vm_migration/client.rb b/owl-bot-staging/google-cloud-vm_migration-v1/lib/google/cloud/vm_migration/v1/vm_migration/client.rb new file mode 100644 index 000000000000..28b07bf0ae98 --- /dev/null +++ b/owl-bot-staging/google-cloud-vm_migration-v1/lib/google/cloud/vm_migration/v1/vm_migration/client.rb @@ -0,0 +1,7173 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/vmmigration/v1/vmmigration_pb" +require "google/cloud/location" + +module Google + module Cloud + module VMMigration + module V1 + module VMMigration + ## + # Client for the VmMigration service. + # + # VM Migration Service + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "vmmigration.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :vm_migration_stub + + ## + # Configure the VmMigration Client class. + # + # See {::Google::Cloud::VMMigration::V1::VMMigration::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all VmMigration clients + # ::Google::Cloud::VMMigration::V1::VMMigration::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", "VMMigration", "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.timeout = 60.0 + + default_config.rpcs.create_source.timeout = 900.0 + + default_config.rpcs.fetch_inventory.timeout = 300.0 + + default_config.rpcs.create_utilization_report.timeout = 300.0 + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the VmMigration 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::VMMigration::V1::VMMigration::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 + @vm_migration_stub.universe_domain + end + + ## + # Create a new VmMigration client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::VMMigration::V1::VMMigration::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::VMMigration::V1::VMMigration::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the VmMigration 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/vmmigration/v1/vmmigration_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 + + @vm_migration_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::VMMigration::V1::VmMigration::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 + ) + + @vm_migration_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 = @vm_migration_stub.endpoint + config.universe_domain = @vm_migration_stub.universe_domain + config.logger = @vm_migration_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::VMMigration::V1::VMMigration::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 + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @vm_migration_stub.logger + end + + # Service calls + + ## + # Lists Sources in a given project and location. + # + # @overload list_sources(request, options = nil) + # Pass arguments to `list_sources` via a request object, either of type + # {::Google::Cloud::VMMigration::V1::ListSourcesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VMMigration::V1::ListSourcesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_sources(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) + # Pass arguments to `list_sources` via keyword arguments. Note that at + # least one keyword argument is 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 parent, which owns this collection of sources. + # @param page_size [::Integer] + # Optional. The maximum number of sources to return. The service may return + # fewer than this value. If unspecified, at most 500 sources will be + # returned. The maximum value is 1000; values above 1000 will be coerced to + # 1000. + # @param page_token [::String] + # Required. A page token, received from a previous `ListSources` call. + # Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to `ListSources` must + # match the call that provided the page token. + # @param filter [::String] + # Optional. The filter request. + # @param order_by [::String] + # Optional. the order by fields for the result. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::VMMigration::V1::Source>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::VMMigration::V1::Source>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/vm_migration/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VMMigration::V1::VMMigration::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VMMigration::V1::ListSourcesRequest.new + # + # # Call the list_sources method. + # result = client.list_sources 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::VMMigration::V1::Source. + # p item + # end + # + def list_sources request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::ListSourcesRequest + + # Converts hash 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_sources.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::VMMigration::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_sources.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_sources.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vm_migration_stub.call_rpc :list_sources, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @vm_migration_stub, :list_sources, 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 + + ## + # Gets details of a single Source. + # + # @overload get_source(request, options = nil) + # Pass arguments to `get_source` via a request object, either of type + # {::Google::Cloud::VMMigration::V1::GetSourceRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VMMigration::V1::GetSourceRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_source(name: nil) + # Pass arguments to `get_source` via keyword arguments. Note that at + # least one keyword argument is 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 Source name. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::VMMigration::V1::Source] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::VMMigration::V1::Source] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/vm_migration/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VMMigration::V1::VMMigration::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VMMigration::V1::GetSourceRequest.new + # + # # Call the get_source method. + # result = client.get_source request + # + # # The returned object is of type Google::Cloud::VMMigration::V1::Source. + # p result + # + def get_source request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::GetSourceRequest + + # Converts hash 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_source.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::VMMigration::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_source.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_source.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vm_migration_stub.call_rpc :get_source, 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 Source in a given project and location. + # + # @overload create_source(request, options = nil) + # Pass arguments to `create_source` via a request object, either of type + # {::Google::Cloud::VMMigration::V1::CreateSourceRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VMMigration::V1::CreateSourceRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_source(parent: nil, source_id: nil, source: nil, request_id: nil) + # Pass arguments to `create_source` via keyword arguments. Note that at + # least one keyword argument is 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 Source's parent. + # @param source_id [::String] + # Required. The source identifier. + # @param source [::Google::Cloud::VMMigration::V1::Source, ::Hash] + # Required. The create request body. + # @param request_id [::String] + # A request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server will guarantee + # that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # + # @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/vm_migration/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VMMigration::V1::VMMigration::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VMMigration::V1::CreateSourceRequest.new + # + # # Call the create_source method. + # result = client.create_source 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_source request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::CreateSourceRequest + + # Converts hash 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_source.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::VMMigration::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_source.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_source.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vm_migration_stub.call_rpc :create_source, 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 + + ## + # Updates the parameters of a single Source. + # + # @overload update_source(request, options = nil) + # Pass arguments to `update_source` via a request object, either of type + # {::Google::Cloud::VMMigration::V1::UpdateSourceRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VMMigration::V1::UpdateSourceRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_source(update_mask: nil, source: nil, request_id: nil) + # Pass arguments to `update_source` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Field mask is used to specify the fields to be overwritten in the + # Source resource by the update. + # The fields specified in the update_mask are relative to the resource, not + # the full request. A field will be overwritten if it is in the mask. If the + # user does not provide a mask then all fields will be overwritten. + # @param source [::Google::Cloud::VMMigration::V1::Source, ::Hash] + # Required. The update request body. + # @param request_id [::String] + # A request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server will guarantee + # that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # + # @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/vm_migration/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VMMigration::V1::VMMigration::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VMMigration::V1::UpdateSourceRequest.new + # + # # Call the update_source method. + # result = client.update_source 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 update_source request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::UpdateSourceRequest + + # Converts hash 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_source.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::VMMigration::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.source&.name + header_params["source.name"] = request.source.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_source.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_source.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vm_migration_stub.call_rpc :update_source, 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 single Source. + # + # @overload delete_source(request, options = nil) + # Pass arguments to `delete_source` via a request object, either of type + # {::Google::Cloud::VMMigration::V1::DeleteSourceRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VMMigration::V1::DeleteSourceRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_source(name: nil, request_id: nil) + # Pass arguments to `delete_source` via keyword arguments. Note that at + # least one keyword argument is 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 Source name. + # @param request_id [::String] + # Optional. A request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server will guarantee + # that for at least 60 minutes after the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # + # @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/vm_migration/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VMMigration::V1::VMMigration::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VMMigration::V1::DeleteSourceRequest.new + # + # # Call the delete_source method. + # result = client.delete_source 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_source request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::DeleteSourceRequest + + # Converts hash 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_source.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::VMMigration::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_source.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_source.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vm_migration_stub.call_rpc :delete_source, 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 + + ## + # List remote source's inventory of VMs. + # The remote source is the onprem vCenter (remote in the sense it's not in + # Compute Engine). The inventory describes the list of existing VMs in that + # source. Note that this operation lists the VMs on the remote source, as + # opposed to listing the MigratingVms resources in the vmmigration service. + # + # @overload fetch_inventory(request, options = nil) + # Pass arguments to `fetch_inventory` via a request object, either of type + # {::Google::Cloud::VMMigration::V1::FetchInventoryRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VMMigration::V1::FetchInventoryRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload fetch_inventory(source: nil, force_refresh: nil) + # Pass arguments to `fetch_inventory` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param source [::String] + # Required. The name of the Source. + # @param force_refresh [::Boolean] + # If this flag is set to true, the source will be queried instead of using + # cached results. Using this flag will make the call slower. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::VMMigration::V1::FetchInventoryResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::VMMigration::V1::FetchInventoryResponse] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/vm_migration/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VMMigration::V1::VMMigration::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VMMigration::V1::FetchInventoryRequest.new + # + # # Call the fetch_inventory method. + # result = client.fetch_inventory request + # + # # The returned object is of type Google::Cloud::VMMigration::V1::FetchInventoryResponse. + # p result + # + def fetch_inventory request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::FetchInventoryRequest + + # Converts hash 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.fetch_inventory.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::VMMigration::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.source + header_params["source"] = request.source + 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.fetch_inventory.timeout, + metadata: metadata, + retry_policy: @config.rpcs.fetch_inventory.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vm_migration_stub.call_rpc :fetch_inventory, 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 + + ## + # List remote source's inventory of storage resources. + # The remote source is another cloud vendor (e.g. AWS, Azure). + # The inventory describes the list of existing storage resources in that + # source. Note that this operation lists the resources on the remote source, + # as opposed to listing the MigratingVms resources in the vmmigration + # service. + # + # @overload fetch_storage_inventory(request, options = nil) + # Pass arguments to `fetch_storage_inventory` via a request object, either of type + # {::Google::Cloud::VMMigration::V1::FetchStorageInventoryRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VMMigration::V1::FetchStorageInventoryRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload fetch_storage_inventory(source: nil, type: nil, force_refresh: nil, page_size: nil, page_token: nil) + # Pass arguments to `fetch_storage_inventory` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param source [::String] + # Required. The name of the Source. + # @param type [::Google::Cloud::VMMigration::V1::FetchStorageInventoryRequest::StorageType] + # Required. The type of the storage inventory to fetch. + # @param force_refresh [::Boolean] + # Optional. If this flag is set to true, the source will be queried instead + # of using cached results. Using this flag will make the call slower. + # @param page_size [::Integer] + # Optional. The maximum number of VMs to return. The service may return + # fewer than this value. + # @param page_token [::String] + # Optional. A page token, received from a previous `FetchStorageInventory` + # call. Provide this to retrieve the subsequent page. When paginating, all + # other parameters provided to `FetchStorageInventory` must match the call + # that provided the page token. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::VMMigration::V1::SourceStorageResource>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::VMMigration::V1::SourceStorageResource>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/vm_migration/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VMMigration::V1::VMMigration::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VMMigration::V1::FetchStorageInventoryRequest.new + # + # # Call the fetch_storage_inventory method. + # result = client.fetch_storage_inventory 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::VMMigration::V1::SourceStorageResource. + # p item + # end + # + def fetch_storage_inventory request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::FetchStorageInventoryRequest + + # Converts hash 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.fetch_storage_inventory.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::VMMigration::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.source + header_params["source"] = request.source + 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.fetch_storage_inventory.timeout, + metadata: metadata, + retry_policy: @config.rpcs.fetch_storage_inventory.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vm_migration_stub.call_rpc :fetch_storage_inventory, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @vm_migration_stub, :fetch_storage_inventory, 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 Utilization Reports of the given Source. + # + # @overload list_utilization_reports(request, options = nil) + # Pass arguments to `list_utilization_reports` via a request object, either of type + # {::Google::Cloud::VMMigration::V1::ListUtilizationReportsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VMMigration::V1::ListUtilizationReportsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_utilization_reports(parent: nil, view: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) + # Pass arguments to `list_utilization_reports` via keyword arguments. Note that at + # least one keyword argument is 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 Utilization Reports parent. + # @param view [::Google::Cloud::VMMigration::V1::UtilizationReportView] + # Optional. The level of details of each report. + # Defaults to BASIC. + # @param page_size [::Integer] + # Optional. The maximum number of reports to return. The service may return + # fewer than this value. If unspecified, at most 500 reports will be + # returned. The maximum value is 1000; values above 1000 will be coerced to + # 1000. + # @param page_token [::String] + # Required. A page token, received from a previous `ListUtilizationReports` + # call. Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to `ListUtilizationReports` + # must match the call that provided the page token. + # @param filter [::String] + # Optional. The filter request. + # @param order_by [::String] + # Optional. the order by fields for the result. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::VMMigration::V1::UtilizationReport>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::VMMigration::V1::UtilizationReport>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/vm_migration/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VMMigration::V1::VMMigration::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VMMigration::V1::ListUtilizationReportsRequest.new + # + # # Call the list_utilization_reports method. + # result = client.list_utilization_reports 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::VMMigration::V1::UtilizationReport. + # p item + # end + # + def list_utilization_reports request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::ListUtilizationReportsRequest + + # Converts hash 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_utilization_reports.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::VMMigration::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_utilization_reports.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_utilization_reports.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vm_migration_stub.call_rpc :list_utilization_reports, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @vm_migration_stub, :list_utilization_reports, 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 + + ## + # Gets a single Utilization Report. + # + # @overload get_utilization_report(request, options = nil) + # Pass arguments to `get_utilization_report` via a request object, either of type + # {::Google::Cloud::VMMigration::V1::GetUtilizationReportRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VMMigration::V1::GetUtilizationReportRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_utilization_report(name: nil, view: nil) + # Pass arguments to `get_utilization_report` via keyword arguments. Note that at + # least one keyword argument is 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 Utilization Report name. + # @param view [::Google::Cloud::VMMigration::V1::UtilizationReportView] + # Optional. The level of details of the report. + # Defaults to FULL + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::VMMigration::V1::UtilizationReport] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::VMMigration::V1::UtilizationReport] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/vm_migration/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VMMigration::V1::VMMigration::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VMMigration::V1::GetUtilizationReportRequest.new + # + # # Call the get_utilization_report method. + # result = client.get_utilization_report request + # + # # The returned object is of type Google::Cloud::VMMigration::V1::UtilizationReport. + # p result + # + def get_utilization_report request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::GetUtilizationReportRequest + + # Converts hash 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_utilization_report.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::VMMigration::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_utilization_report.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_utilization_report.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vm_migration_stub.call_rpc :get_utilization_report, 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 UtilizationReport. + # + # @overload create_utilization_report(request, options = nil) + # Pass arguments to `create_utilization_report` via a request object, either of type + # {::Google::Cloud::VMMigration::V1::CreateUtilizationReportRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VMMigration::V1::CreateUtilizationReportRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_utilization_report(parent: nil, utilization_report: nil, utilization_report_id: nil, request_id: nil) + # Pass arguments to `create_utilization_report` via keyword arguments. Note that at + # least one keyword argument is 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 Utilization Report's parent. + # @param utilization_report [::Google::Cloud::VMMigration::V1::UtilizationReport, ::Hash] + # Required. The report to create. + # @param utilization_report_id [::String] + # Required. The ID to use for the report, which will become the final + # component of the reports's resource name. + # + # This value maximum length is 63 characters, and valid characters + # are /[a-z][0-9]-/. It must start with an english letter and must not + # end with a hyphen. + # @param request_id [::String] + # A request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server will guarantee + # that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # + # @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/vm_migration/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VMMigration::V1::VMMigration::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VMMigration::V1::CreateUtilizationReportRequest.new + # + # # Call the create_utilization_report method. + # result = client.create_utilization_report 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_utilization_report request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::CreateUtilizationReportRequest + + # Converts hash 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_utilization_report.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::VMMigration::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_utilization_report.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_utilization_report.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vm_migration_stub.call_rpc :create_utilization_report, 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 single Utilization Report. + # + # @overload delete_utilization_report(request, options = nil) + # Pass arguments to `delete_utilization_report` via a request object, either of type + # {::Google::Cloud::VMMigration::V1::DeleteUtilizationReportRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VMMigration::V1::DeleteUtilizationReportRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_utilization_report(name: nil, request_id: nil) + # Pass arguments to `delete_utilization_report` via keyword arguments. Note that at + # least one keyword argument is 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 Utilization Report name. + # @param request_id [::String] + # Optional. A request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server will guarantee + # that for at least 60 minutes after the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # + # @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/vm_migration/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VMMigration::V1::VMMigration::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VMMigration::V1::DeleteUtilizationReportRequest.new + # + # # Call the delete_utilization_report method. + # result = client.delete_utilization_report 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_utilization_report request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::DeleteUtilizationReportRequest + + # Converts hash 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_utilization_report.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::VMMigration::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_utilization_report.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_utilization_report.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vm_migration_stub.call_rpc :delete_utilization_report, 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 + + ## + # Lists DatacenterConnectors in a given Source. + # + # @overload list_datacenter_connectors(request, options = nil) + # Pass arguments to `list_datacenter_connectors` via a request object, either of type + # {::Google::Cloud::VMMigration::V1::ListDatacenterConnectorsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VMMigration::V1::ListDatacenterConnectorsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_datacenter_connectors(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) + # Pass arguments to `list_datacenter_connectors` via keyword arguments. Note that at + # least one keyword argument is 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 parent, which owns this collection of connectors. + # @param page_size [::Integer] + # Optional. The maximum number of connectors to return. The service may + # return fewer than this value. If unspecified, at most 500 sources will be + # returned. The maximum value is 1000; values above 1000 will be coerced to + # 1000. + # @param page_token [::String] + # Required. A page token, received from a previous `ListDatacenterConnectors` + # call. Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to + # `ListDatacenterConnectors` must match the call that provided the page + # token. + # @param filter [::String] + # Optional. The filter request. + # @param order_by [::String] + # Optional. the order by fields for the result. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::VMMigration::V1::DatacenterConnector>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::VMMigration::V1::DatacenterConnector>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/vm_migration/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VMMigration::V1::VMMigration::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VMMigration::V1::ListDatacenterConnectorsRequest.new + # + # # Call the list_datacenter_connectors method. + # result = client.list_datacenter_connectors 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::VMMigration::V1::DatacenterConnector. + # p item + # end + # + def list_datacenter_connectors request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::ListDatacenterConnectorsRequest + + # Converts hash 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_datacenter_connectors.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::VMMigration::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_datacenter_connectors.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_datacenter_connectors.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vm_migration_stub.call_rpc :list_datacenter_connectors, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @vm_migration_stub, :list_datacenter_connectors, 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 + + ## + # Gets details of a single DatacenterConnector. + # + # @overload get_datacenter_connector(request, options = nil) + # Pass arguments to `get_datacenter_connector` via a request object, either of type + # {::Google::Cloud::VMMigration::V1::GetDatacenterConnectorRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VMMigration::V1::GetDatacenterConnectorRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_datacenter_connector(name: nil) + # Pass arguments to `get_datacenter_connector` via keyword arguments. Note that at + # least one keyword argument is 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 name of the DatacenterConnector. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::VMMigration::V1::DatacenterConnector] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::VMMigration::V1::DatacenterConnector] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/vm_migration/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VMMigration::V1::VMMigration::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VMMigration::V1::GetDatacenterConnectorRequest.new + # + # # Call the get_datacenter_connector method. + # result = client.get_datacenter_connector request + # + # # The returned object is of type Google::Cloud::VMMigration::V1::DatacenterConnector. + # p result + # + def get_datacenter_connector request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::GetDatacenterConnectorRequest + + # Converts hash 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_datacenter_connector.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::VMMigration::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_datacenter_connector.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_datacenter_connector.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vm_migration_stub.call_rpc :get_datacenter_connector, 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 DatacenterConnector in a given Source. + # + # @overload create_datacenter_connector(request, options = nil) + # Pass arguments to `create_datacenter_connector` via a request object, either of type + # {::Google::Cloud::VMMigration::V1::CreateDatacenterConnectorRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VMMigration::V1::CreateDatacenterConnectorRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_datacenter_connector(parent: nil, datacenter_connector_id: nil, datacenter_connector: nil, request_id: nil) + # Pass arguments to `create_datacenter_connector` via keyword arguments. Note that at + # least one keyword argument is 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 DatacenterConnector's parent. + # Required. The Source in where the new DatacenterConnector will be created. + # For example: + # `projects/my-project/locations/us-central1/sources/my-source` + # @param datacenter_connector_id [::String] + # Required. The datacenterConnector identifier. + # @param datacenter_connector [::Google::Cloud::VMMigration::V1::DatacenterConnector, ::Hash] + # Required. The create request body. + # @param request_id [::String] + # A request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server will guarantee + # that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # + # @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/vm_migration/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VMMigration::V1::VMMigration::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VMMigration::V1::CreateDatacenterConnectorRequest.new + # + # # Call the create_datacenter_connector method. + # result = client.create_datacenter_connector 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_datacenter_connector request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::CreateDatacenterConnectorRequest + + # Converts hash 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_datacenter_connector.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::VMMigration::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_datacenter_connector.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_datacenter_connector.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vm_migration_stub.call_rpc :create_datacenter_connector, 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 single DatacenterConnector. + # + # @overload delete_datacenter_connector(request, options = nil) + # Pass arguments to `delete_datacenter_connector` via a request object, either of type + # {::Google::Cloud::VMMigration::V1::DeleteDatacenterConnectorRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VMMigration::V1::DeleteDatacenterConnectorRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_datacenter_connector(name: nil, request_id: nil) + # Pass arguments to `delete_datacenter_connector` via keyword arguments. Note that at + # least one keyword argument is 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 DatacenterConnector name. + # @param request_id [::String] + # A request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server will guarantee + # that for at least 60 minutes after the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # + # @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/vm_migration/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VMMigration::V1::VMMigration::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VMMigration::V1::DeleteDatacenterConnectorRequest.new + # + # # Call the delete_datacenter_connector method. + # result = client.delete_datacenter_connector 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_datacenter_connector request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::DeleteDatacenterConnectorRequest + + # Converts hash 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_datacenter_connector.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::VMMigration::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_datacenter_connector.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_datacenter_connector.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vm_migration_stub.call_rpc :delete_datacenter_connector, 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 + + ## + # Upgrades the appliance relate to this DatacenterConnector to the in-place + # updateable version. + # + # @overload upgrade_appliance(request, options = nil) + # Pass arguments to `upgrade_appliance` via a request object, either of type + # {::Google::Cloud::VMMigration::V1::UpgradeApplianceRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VMMigration::V1::UpgradeApplianceRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload upgrade_appliance(datacenter_connector: nil, request_id: nil) + # Pass arguments to `upgrade_appliance` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param datacenter_connector [::String] + # Required. The DatacenterConnector name. + # @param request_id [::String] + # A request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server will guarantee + # that for at least 60 minutes after the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # + # @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/vm_migration/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VMMigration::V1::VMMigration::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VMMigration::V1::UpgradeApplianceRequest.new + # + # # Call the upgrade_appliance method. + # result = client.upgrade_appliance 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 upgrade_appliance request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::UpgradeApplianceRequest + + # Converts hash 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.upgrade_appliance.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::VMMigration::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.datacenter_connector + header_params["datacenter_connector"] = request.datacenter_connector + 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.upgrade_appliance.timeout, + metadata: metadata, + retry_policy: @config.rpcs.upgrade_appliance.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vm_migration_stub.call_rpc :upgrade_appliance, 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 MigratingVm in a given Source. + # + # @overload create_migrating_vm(request, options = nil) + # Pass arguments to `create_migrating_vm` via a request object, either of type + # {::Google::Cloud::VMMigration::V1::CreateMigratingVmRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VMMigration::V1::CreateMigratingVmRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_migrating_vm(parent: nil, migrating_vm_id: nil, migrating_vm: nil, request_id: nil) + # Pass arguments to `create_migrating_vm` via keyword arguments. Note that at + # least one keyword argument is 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 MigratingVm's parent. + # @param migrating_vm_id [::String] + # Required. The migratingVm identifier. + # @param migrating_vm [::Google::Cloud::VMMigration::V1::MigratingVm, ::Hash] + # Required. The create request body. + # @param request_id [::String] + # A request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server will guarantee + # that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # + # @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/vm_migration/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VMMigration::V1::VMMigration::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VMMigration::V1::CreateMigratingVmRequest.new + # + # # Call the create_migrating_vm method. + # result = client.create_migrating_vm 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_migrating_vm request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::CreateMigratingVmRequest + + # Converts hash 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_migrating_vm.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::VMMigration::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_migrating_vm.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_migrating_vm.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vm_migration_stub.call_rpc :create_migrating_vm, 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 + + ## + # Lists MigratingVms in a given Source. + # + # @overload list_migrating_vms(request, options = nil) + # Pass arguments to `list_migrating_vms` via a request object, either of type + # {::Google::Cloud::VMMigration::V1::ListMigratingVmsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VMMigration::V1::ListMigratingVmsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_migrating_vms(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil, view: nil) + # Pass arguments to `list_migrating_vms` via keyword arguments. Note that at + # least one keyword argument is 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 parent, which owns this collection of MigratingVms. + # @param page_size [::Integer] + # Optional. The maximum number of migrating VMs to return. The service may + # return fewer than this value. If unspecified, at most 500 migrating VMs + # will be returned. The maximum value is 1000; values above 1000 will be + # coerced to 1000. + # @param page_token [::String] + # Required. A page token, received from a previous `ListMigratingVms` call. + # Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to `ListMigratingVms` + # must match the call that provided the page token. + # @param filter [::String] + # Optional. The filter request. + # @param order_by [::String] + # Optional. the order by fields for the result. + # @param view [::Google::Cloud::VMMigration::V1::MigratingVmView] + # Optional. The level of details of each migrating VM. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::VMMigration::V1::MigratingVm>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::VMMigration::V1::MigratingVm>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/vm_migration/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VMMigration::V1::VMMigration::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VMMigration::V1::ListMigratingVmsRequest.new + # + # # Call the list_migrating_vms method. + # result = client.list_migrating_vms 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::VMMigration::V1::MigratingVm. + # p item + # end + # + def list_migrating_vms request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::ListMigratingVmsRequest + + # Converts hash 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_migrating_vms.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::VMMigration::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_migrating_vms.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_migrating_vms.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vm_migration_stub.call_rpc :list_migrating_vms, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @vm_migration_stub, :list_migrating_vms, 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 + + ## + # Gets details of a single MigratingVm. + # + # @overload get_migrating_vm(request, options = nil) + # Pass arguments to `get_migrating_vm` via a request object, either of type + # {::Google::Cloud::VMMigration::V1::GetMigratingVmRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VMMigration::V1::GetMigratingVmRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_migrating_vm(name: nil, view: nil) + # Pass arguments to `get_migrating_vm` via keyword arguments. Note that at + # least one keyword argument is 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 name of the MigratingVm. + # @param view [::Google::Cloud::VMMigration::V1::MigratingVmView] + # Optional. The level of details of the migrating VM. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::VMMigration::V1::MigratingVm] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::VMMigration::V1::MigratingVm] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/vm_migration/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VMMigration::V1::VMMigration::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VMMigration::V1::GetMigratingVmRequest.new + # + # # Call the get_migrating_vm method. + # result = client.get_migrating_vm request + # + # # The returned object is of type Google::Cloud::VMMigration::V1::MigratingVm. + # p result + # + def get_migrating_vm request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::GetMigratingVmRequest + + # Converts hash 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_migrating_vm.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::VMMigration::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_migrating_vm.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_migrating_vm.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vm_migration_stub.call_rpc :get_migrating_vm, 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 parameters of a single MigratingVm. + # + # @overload update_migrating_vm(request, options = nil) + # Pass arguments to `update_migrating_vm` via a request object, either of type + # {::Google::Cloud::VMMigration::V1::UpdateMigratingVmRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VMMigration::V1::UpdateMigratingVmRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_migrating_vm(update_mask: nil, migrating_vm: nil, request_id: nil) + # Pass arguments to `update_migrating_vm` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Field mask is used to specify the fields to be overwritten in the + # MigratingVm resource by the update. + # The fields specified in the update_mask are relative to the resource, not + # the full request. A field will be overwritten if it is in the mask. If the + # user does not provide a mask then all fields will be overwritten. + # @param migrating_vm [::Google::Cloud::VMMigration::V1::MigratingVm, ::Hash] + # Required. The update request body. + # @param request_id [::String] + # A request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server will guarantee + # that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # + # @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/vm_migration/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VMMigration::V1::VMMigration::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VMMigration::V1::UpdateMigratingVmRequest.new + # + # # Call the update_migrating_vm method. + # result = client.update_migrating_vm 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 update_migrating_vm request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::UpdateMigratingVmRequest + + # Converts hash 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_migrating_vm.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::VMMigration::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.migrating_vm&.name + header_params["migrating_vm.name"] = request.migrating_vm.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_migrating_vm.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_migrating_vm.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vm_migration_stub.call_rpc :update_migrating_vm, 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 single MigratingVm. + # + # @overload delete_migrating_vm(request, options = nil) + # Pass arguments to `delete_migrating_vm` via a request object, either of type + # {::Google::Cloud::VMMigration::V1::DeleteMigratingVmRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VMMigration::V1::DeleteMigratingVmRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_migrating_vm(name: nil) + # Pass arguments to `delete_migrating_vm` via keyword arguments. Note that at + # least one keyword argument is 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 name of the MigratingVm. + # + # @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/vm_migration/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VMMigration::V1::VMMigration::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VMMigration::V1::DeleteMigratingVmRequest.new + # + # # Call the delete_migrating_vm method. + # result = client.delete_migrating_vm 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_migrating_vm request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::DeleteMigratingVmRequest + + # Converts hash 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_migrating_vm.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::VMMigration::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_migrating_vm.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_migrating_vm.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vm_migration_stub.call_rpc :delete_migrating_vm, 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 + + ## + # Starts migration for a VM. Starts the process of uploading + # data and creating snapshots, in replication cycles scheduled by the policy. + # + # @overload start_migration(request, options = nil) + # Pass arguments to `start_migration` via a request object, either of type + # {::Google::Cloud::VMMigration::V1::StartMigrationRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VMMigration::V1::StartMigrationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload start_migration(migrating_vm: nil) + # Pass arguments to `start_migration` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param migrating_vm [::String] + # Required. The name of the MigratingVm. + # + # @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/vm_migration/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VMMigration::V1::VMMigration::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VMMigration::V1::StartMigrationRequest.new + # + # # Call the start_migration method. + # result = client.start_migration 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 start_migration request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::StartMigrationRequest + + # Converts hash 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.start_migration.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::VMMigration::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.migrating_vm + header_params["migrating_vm"] = request.migrating_vm + 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.start_migration.timeout, + metadata: metadata, + retry_policy: @config.rpcs.start_migration.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vm_migration_stub.call_rpc :start_migration, 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 + + ## + # Resumes a migration for a VM. When called on a paused migration, will start + # the process of uploading data and creating snapshots; when called on a + # completed cut-over migration, will update the migration to active state and + # start the process of uploading data and creating snapshots. + # + # @overload resume_migration(request, options = nil) + # Pass arguments to `resume_migration` via a request object, either of type + # {::Google::Cloud::VMMigration::V1::ResumeMigrationRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VMMigration::V1::ResumeMigrationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload resume_migration(migrating_vm: nil) + # Pass arguments to `resume_migration` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param migrating_vm [::String] + # Required. The name of the MigratingVm. + # + # @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/vm_migration/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VMMigration::V1::VMMigration::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VMMigration::V1::ResumeMigrationRequest.new + # + # # Call the resume_migration method. + # result = client.resume_migration 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 resume_migration request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::ResumeMigrationRequest + + # Converts hash 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.resume_migration.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::VMMigration::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.migrating_vm + header_params["migrating_vm"] = request.migrating_vm + 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.resume_migration.timeout, + metadata: metadata, + retry_policy: @config.rpcs.resume_migration.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vm_migration_stub.call_rpc :resume_migration, 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 + + ## + # Pauses a migration for a VM. If cycle tasks are running they will be + # cancelled, preserving source task data. Further replication cycles will not + # be triggered while the VM is paused. + # + # @overload pause_migration(request, options = nil) + # Pass arguments to `pause_migration` via a request object, either of type + # {::Google::Cloud::VMMigration::V1::PauseMigrationRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VMMigration::V1::PauseMigrationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload pause_migration(migrating_vm: nil) + # Pass arguments to `pause_migration` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param migrating_vm [::String] + # Required. The name of the MigratingVm. + # + # @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/vm_migration/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VMMigration::V1::VMMigration::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VMMigration::V1::PauseMigrationRequest.new + # + # # Call the pause_migration method. + # result = client.pause_migration 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 pause_migration request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::PauseMigrationRequest + + # Converts hash 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.pause_migration.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::VMMigration::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.migrating_vm + header_params["migrating_vm"] = request.migrating_vm + 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.pause_migration.timeout, + metadata: metadata, + retry_policy: @config.rpcs.pause_migration.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vm_migration_stub.call_rpc :pause_migration, 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 + + ## + # Marks a migration as completed, deleting migration resources that are no + # longer being used. Only applicable after cutover is done. + # + # @overload finalize_migration(request, options = nil) + # Pass arguments to `finalize_migration` via a request object, either of type + # {::Google::Cloud::VMMigration::V1::FinalizeMigrationRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VMMigration::V1::FinalizeMigrationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload finalize_migration(migrating_vm: nil) + # Pass arguments to `finalize_migration` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param migrating_vm [::String] + # Required. The name of the MigratingVm. + # + # @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/vm_migration/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VMMigration::V1::VMMigration::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VMMigration::V1::FinalizeMigrationRequest.new + # + # # Call the finalize_migration method. + # result = client.finalize_migration 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 finalize_migration request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::FinalizeMigrationRequest + + # Converts hash 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.finalize_migration.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::VMMigration::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.migrating_vm + header_params["migrating_vm"] = request.migrating_vm + 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.finalize_migration.timeout, + metadata: metadata, + retry_policy: @config.rpcs.finalize_migration.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vm_migration_stub.call_rpc :finalize_migration, 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 + + ## + # Extend the migrating VM time to live. + # + # @overload extend_migration(request, options = nil) + # Pass arguments to `extend_migration` via a request object, either of type + # {::Google::Cloud::VMMigration::V1::ExtendMigrationRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VMMigration::V1::ExtendMigrationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload extend_migration(migrating_vm: nil) + # Pass arguments to `extend_migration` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param migrating_vm [::String] + # Required. The name of the MigratingVm. + # + # @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/vm_migration/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VMMigration::V1::VMMigration::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VMMigration::V1::ExtendMigrationRequest.new + # + # # Call the extend_migration method. + # result = client.extend_migration 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 extend_migration request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::ExtendMigrationRequest + + # Converts hash 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.extend_migration.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::VMMigration::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.migrating_vm + header_params["migrating_vm"] = request.migrating_vm + 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.extend_migration.timeout, + metadata: metadata, + retry_policy: @config.rpcs.extend_migration.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vm_migration_stub.call_rpc :extend_migration, 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 + + ## + # Initiates a Clone of a specific migrating VM. + # + # @overload create_clone_job(request, options = nil) + # Pass arguments to `create_clone_job` via a request object, either of type + # {::Google::Cloud::VMMigration::V1::CreateCloneJobRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VMMigration::V1::CreateCloneJobRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_clone_job(parent: nil, clone_job_id: nil, clone_job: nil, request_id: nil) + # Pass arguments to `create_clone_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 Clone's parent. + # @param clone_job_id [::String] + # Required. The clone job identifier. + # @param clone_job [::Google::Cloud::VMMigration::V1::CloneJob, ::Hash] + # Required. The clone request body. + # @param request_id [::String] + # A request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server will guarantee + # that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # + # @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/vm_migration/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VMMigration::V1::VMMigration::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VMMigration::V1::CreateCloneJobRequest.new + # + # # Call the create_clone_job method. + # result = client.create_clone_job 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_clone_job request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::CreateCloneJobRequest + + # Converts hash 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_clone_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::VMMigration::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_clone_job.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_clone_job.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vm_migration_stub.call_rpc :create_clone_job, 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 + + ## + # Initiates the cancellation of a running clone job. + # + # @overload cancel_clone_job(request, options = nil) + # Pass arguments to `cancel_clone_job` via a request object, either of type + # {::Google::Cloud::VMMigration::V1::CancelCloneJobRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VMMigration::V1::CancelCloneJobRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_clone_job(name: nil) + # Pass arguments to `cancel_clone_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 clone job id + # + # @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/vm_migration/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VMMigration::V1::VMMigration::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VMMigration::V1::CancelCloneJobRequest.new + # + # # Call the cancel_clone_job method. + # result = client.cancel_clone_job 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 cancel_clone_job request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::CancelCloneJobRequest + + # Converts hash 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_clone_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::VMMigration::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_clone_job.timeout, + metadata: metadata, + retry_policy: @config.rpcs.cancel_clone_job.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vm_migration_stub.call_rpc :cancel_clone_job, 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 + + ## + # Lists the CloneJobs of a migrating VM. Only 25 most recent CloneJobs are + # listed. + # + # @overload list_clone_jobs(request, options = nil) + # Pass arguments to `list_clone_jobs` via a request object, either of type + # {::Google::Cloud::VMMigration::V1::ListCloneJobsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VMMigration::V1::ListCloneJobsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_clone_jobs(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) + # Pass arguments to `list_clone_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 parent, which owns this collection of source VMs. + # @param page_size [::Integer] + # Optional. The maximum number of clone jobs to return. The service may + # return fewer than this value. If unspecified, at most 500 clone jobs will + # be returned. The maximum value is 1000; values above 1000 will be coerced + # to 1000. + # @param page_token [::String] + # Required. A page token, received from a previous `ListCloneJobs` call. + # Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to `ListCloneJobs` must + # match the call that provided the page token. + # @param filter [::String] + # Optional. The filter request. + # @param order_by [::String] + # Optional. the order by fields for the result. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::VMMigration::V1::CloneJob>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::VMMigration::V1::CloneJob>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/vm_migration/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VMMigration::V1::VMMigration::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VMMigration::V1::ListCloneJobsRequest.new + # + # # Call the list_clone_jobs method. + # result = client.list_clone_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::VMMigration::V1::CloneJob. + # p item + # end + # + def list_clone_jobs request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::ListCloneJobsRequest + + # Converts hash 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_clone_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::VMMigration::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_clone_jobs.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_clone_jobs.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vm_migration_stub.call_rpc :list_clone_jobs, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @vm_migration_stub, :list_clone_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 + + ## + # Gets details of a single CloneJob. + # + # @overload get_clone_job(request, options = nil) + # Pass arguments to `get_clone_job` via a request object, either of type + # {::Google::Cloud::VMMigration::V1::GetCloneJobRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VMMigration::V1::GetCloneJobRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_clone_job(name: nil) + # Pass arguments to `get_clone_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 name of the CloneJob. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::VMMigration::V1::CloneJob] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::VMMigration::V1::CloneJob] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/vm_migration/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VMMigration::V1::VMMigration::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VMMigration::V1::GetCloneJobRequest.new + # + # # Call the get_clone_job method. + # result = client.get_clone_job request + # + # # The returned object is of type Google::Cloud::VMMigration::V1::CloneJob. + # p result + # + def get_clone_job request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::GetCloneJobRequest + + # Converts hash 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_clone_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::VMMigration::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_clone_job.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_clone_job.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vm_migration_stub.call_rpc :get_clone_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 + + ## + # Initiates a Cutover of a specific migrating VM. + # The returned LRO is completed when the cutover job resource is created + # and the job is initiated. + # + # @overload create_cutover_job(request, options = nil) + # Pass arguments to `create_cutover_job` via a request object, either of type + # {::Google::Cloud::VMMigration::V1::CreateCutoverJobRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VMMigration::V1::CreateCutoverJobRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_cutover_job(parent: nil, cutover_job_id: nil, cutover_job: nil, request_id: nil) + # Pass arguments to `create_cutover_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 Cutover's parent. + # @param cutover_job_id [::String] + # Required. The cutover job identifier. + # @param cutover_job [::Google::Cloud::VMMigration::V1::CutoverJob, ::Hash] + # Required. The cutover request body. + # @param request_id [::String] + # A request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server will guarantee + # that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # + # @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/vm_migration/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VMMigration::V1::VMMigration::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VMMigration::V1::CreateCutoverJobRequest.new + # + # # Call the create_cutover_job method. + # result = client.create_cutover_job 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_cutover_job request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::CreateCutoverJobRequest + + # Converts hash 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_cutover_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::VMMigration::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_cutover_job.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_cutover_job.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vm_migration_stub.call_rpc :create_cutover_job, 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 + + ## + # Initiates the cancellation of a running cutover job. + # + # @overload cancel_cutover_job(request, options = nil) + # Pass arguments to `cancel_cutover_job` via a request object, either of type + # {::Google::Cloud::VMMigration::V1::CancelCutoverJobRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VMMigration::V1::CancelCutoverJobRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_cutover_job(name: nil) + # Pass arguments to `cancel_cutover_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 cutover job id + # + # @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/vm_migration/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VMMigration::V1::VMMigration::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VMMigration::V1::CancelCutoverJobRequest.new + # + # # Call the cancel_cutover_job method. + # result = client.cancel_cutover_job 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 cancel_cutover_job request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::CancelCutoverJobRequest + + # Converts hash 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_cutover_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::VMMigration::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_cutover_job.timeout, + metadata: metadata, + retry_policy: @config.rpcs.cancel_cutover_job.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vm_migration_stub.call_rpc :cancel_cutover_job, 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 + + ## + # Lists the CutoverJobs of a migrating VM. Only 25 most recent CutoverJobs + # are listed. + # + # @overload list_cutover_jobs(request, options = nil) + # Pass arguments to `list_cutover_jobs` via a request object, either of type + # {::Google::Cloud::VMMigration::V1::ListCutoverJobsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VMMigration::V1::ListCutoverJobsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_cutover_jobs(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) + # Pass arguments to `list_cutover_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 parent, which owns this collection of migrating VMs. + # @param page_size [::Integer] + # Optional. The maximum number of cutover jobs to return. The service may + # return fewer than this value. If unspecified, at most 500 cutover jobs will + # be returned. The maximum value is 1000; values above 1000 will be coerced + # to 1000. + # @param page_token [::String] + # Required. A page token, received from a previous `ListCutoverJobs` call. + # Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to `ListCutoverJobs` must + # match the call that provided the page token. + # @param filter [::String] + # Optional. The filter request. + # @param order_by [::String] + # Optional. the order by fields for the result. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::VMMigration::V1::CutoverJob>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::VMMigration::V1::CutoverJob>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/vm_migration/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VMMigration::V1::VMMigration::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VMMigration::V1::ListCutoverJobsRequest.new + # + # # Call the list_cutover_jobs method. + # result = client.list_cutover_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::VMMigration::V1::CutoverJob. + # p item + # end + # + def list_cutover_jobs request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::ListCutoverJobsRequest + + # Converts hash 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_cutover_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::VMMigration::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_cutover_jobs.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_cutover_jobs.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vm_migration_stub.call_rpc :list_cutover_jobs, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @vm_migration_stub, :list_cutover_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 + + ## + # Gets details of a single CutoverJob. + # + # @overload get_cutover_job(request, options = nil) + # Pass arguments to `get_cutover_job` via a request object, either of type + # {::Google::Cloud::VMMigration::V1::GetCutoverJobRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VMMigration::V1::GetCutoverJobRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_cutover_job(name: nil) + # Pass arguments to `get_cutover_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 name of the CutoverJob. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::VMMigration::V1::CutoverJob] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::VMMigration::V1::CutoverJob] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/vm_migration/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VMMigration::V1::VMMigration::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VMMigration::V1::GetCutoverJobRequest.new + # + # # Call the get_cutover_job method. + # result = client.get_cutover_job request + # + # # The returned object is of type Google::Cloud::VMMigration::V1::CutoverJob. + # p result + # + def get_cutover_job request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::GetCutoverJobRequest + + # Converts hash 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_cutover_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::VMMigration::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_cutover_job.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_cutover_job.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vm_migration_stub.call_rpc :get_cutover_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 + + ## + # Lists Groups in a given project and location. + # + # @overload list_groups(request, options = nil) + # Pass arguments to `list_groups` via a request object, either of type + # {::Google::Cloud::VMMigration::V1::ListGroupsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VMMigration::V1::ListGroupsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_groups(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) + # Pass arguments to `list_groups` via keyword arguments. Note that at + # least one keyword argument is 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 parent, which owns this collection of groups. + # @param page_size [::Integer] + # Optional. The maximum number of groups to return. The service may return + # fewer than this value. If unspecified, at most 500 groups will be + # returned. The maximum value is 1000; values above 1000 will be coerced to + # 1000. + # @param page_token [::String] + # Required. A page token, received from a previous `ListGroups` call. + # Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to `ListGroups` must + # match the call that provided the page token. + # @param filter [::String] + # Optional. The filter request. + # @param order_by [::String] + # Optional. the order by fields for the result. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::VMMigration::V1::Group>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::VMMigration::V1::Group>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/vm_migration/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VMMigration::V1::VMMigration::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VMMigration::V1::ListGroupsRequest.new + # + # # Call the list_groups method. + # result = client.list_groups 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::VMMigration::V1::Group. + # p item + # end + # + def list_groups request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::ListGroupsRequest + + # Converts hash 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_groups.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::VMMigration::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_groups.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_groups.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vm_migration_stub.call_rpc :list_groups, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @vm_migration_stub, :list_groups, 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 + + ## + # Gets details of a single Group. + # + # @overload get_group(request, options = nil) + # Pass arguments to `get_group` via a request object, either of type + # {::Google::Cloud::VMMigration::V1::GetGroupRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VMMigration::V1::GetGroupRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_group(name: nil) + # Pass arguments to `get_group` via keyword arguments. Note that at + # least one keyword argument is 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 group name. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::VMMigration::V1::Group] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::VMMigration::V1::Group] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/vm_migration/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VMMigration::V1::VMMigration::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VMMigration::V1::GetGroupRequest.new + # + # # Call the get_group method. + # result = client.get_group request + # + # # The returned object is of type Google::Cloud::VMMigration::V1::Group. + # p result + # + def get_group request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::GetGroupRequest + + # Converts hash 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_group.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::VMMigration::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_group.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_group.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vm_migration_stub.call_rpc :get_group, 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 Group in a given project and location. + # + # @overload create_group(request, options = nil) + # Pass arguments to `create_group` via a request object, either of type + # {::Google::Cloud::VMMigration::V1::CreateGroupRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VMMigration::V1::CreateGroupRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_group(parent: nil, group_id: nil, group: nil, request_id: nil) + # Pass arguments to `create_group` via keyword arguments. Note that at + # least one keyword argument is 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 Group's parent. + # @param group_id [::String] + # Required. The group identifier. + # @param group [::Google::Cloud::VMMigration::V1::Group, ::Hash] + # Required. The create request body. + # @param request_id [::String] + # A request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server will guarantee + # that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # + # @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/vm_migration/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VMMigration::V1::VMMigration::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VMMigration::V1::CreateGroupRequest.new + # + # # Call the create_group method. + # result = client.create_group 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_group request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::CreateGroupRequest + + # Converts hash 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_group.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::VMMigration::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_group.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_group.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vm_migration_stub.call_rpc :create_group, 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 + + ## + # Updates the parameters of a single Group. + # + # @overload update_group(request, options = nil) + # Pass arguments to `update_group` via a request object, either of type + # {::Google::Cloud::VMMigration::V1::UpdateGroupRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VMMigration::V1::UpdateGroupRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_group(update_mask: nil, group: nil, request_id: nil) + # Pass arguments to `update_group` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Field mask is used to specify the fields to be overwritten in the + # Group resource by the update. + # The fields specified in the update_mask are relative to the resource, not + # the full request. A field will be overwritten if it is in the mask. If the + # user does not provide a mask then all fields will be overwritten. + # @param group [::Google::Cloud::VMMigration::V1::Group, ::Hash] + # Required. The update request body. + # @param request_id [::String] + # A request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server will guarantee + # that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # + # @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/vm_migration/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VMMigration::V1::VMMigration::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VMMigration::V1::UpdateGroupRequest.new + # + # # Call the update_group method. + # result = client.update_group 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 update_group request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::UpdateGroupRequest + + # Converts hash 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_group.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::VMMigration::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.group&.name + header_params["group.name"] = request.group.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_group.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_group.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vm_migration_stub.call_rpc :update_group, 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 single Group. + # + # @overload delete_group(request, options = nil) + # Pass arguments to `delete_group` via a request object, either of type + # {::Google::Cloud::VMMigration::V1::DeleteGroupRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VMMigration::V1::DeleteGroupRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_group(name: nil, request_id: nil) + # Pass arguments to `delete_group` via keyword arguments. Note that at + # least one keyword argument is 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 Group name. + # @param request_id [::String] + # Optional. A request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server will guarantee + # that for at least 60 minutes after the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # + # @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/vm_migration/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VMMigration::V1::VMMigration::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VMMigration::V1::DeleteGroupRequest.new + # + # # Call the delete_group method. + # result = client.delete_group 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_group request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::DeleteGroupRequest + + # Converts hash 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_group.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::VMMigration::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_group.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_group.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vm_migration_stub.call_rpc :delete_group, 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 + + ## + # Adds a MigratingVm to a Group. + # + # @overload add_group_migration(request, options = nil) + # Pass arguments to `add_group_migration` via a request object, either of type + # {::Google::Cloud::VMMigration::V1::AddGroupMigrationRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VMMigration::V1::AddGroupMigrationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload add_group_migration(group: nil, migrating_vm: nil) + # Pass arguments to `add_group_migration` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param group [::String] + # Required. The full path name of the Group to add to. + # @param migrating_vm [::String] + # The full path name of the MigratingVm to add. + # + # @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/vm_migration/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VMMigration::V1::VMMigration::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VMMigration::V1::AddGroupMigrationRequest.new + # + # # Call the add_group_migration method. + # result = client.add_group_migration 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 add_group_migration request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::AddGroupMigrationRequest + + # Converts hash 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.add_group_migration.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::VMMigration::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.group + header_params["group"] = request.group + 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.add_group_migration.timeout, + metadata: metadata, + retry_policy: @config.rpcs.add_group_migration.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vm_migration_stub.call_rpc :add_group_migration, 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 + + ## + # Removes a MigratingVm from a Group. + # + # @overload remove_group_migration(request, options = nil) + # Pass arguments to `remove_group_migration` via a request object, either of type + # {::Google::Cloud::VMMigration::V1::RemoveGroupMigrationRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VMMigration::V1::RemoveGroupMigrationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload remove_group_migration(group: nil, migrating_vm: nil) + # Pass arguments to `remove_group_migration` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param group [::String] + # Required. The name of the Group. + # @param migrating_vm [::String] + # The MigratingVm to remove. + # + # @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/vm_migration/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VMMigration::V1::VMMigration::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VMMigration::V1::RemoveGroupMigrationRequest.new + # + # # Call the remove_group_migration method. + # result = client.remove_group_migration 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 remove_group_migration request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::RemoveGroupMigrationRequest + + # Converts hash 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.remove_group_migration.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::VMMigration::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.group + header_params["group"] = request.group + 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.remove_group_migration.timeout, + metadata: metadata, + retry_policy: @config.rpcs.remove_group_migration.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vm_migration_stub.call_rpc :remove_group_migration, 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 + + ## + # Lists TargetProjects in a given project. + # + # NOTE: TargetProject is a global resource; hence the only supported value + # for location is `global`. + # + # @overload list_target_projects(request, options = nil) + # Pass arguments to `list_target_projects` via a request object, either of type + # {::Google::Cloud::VMMigration::V1::ListTargetProjectsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VMMigration::V1::ListTargetProjectsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_target_projects(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) + # Pass arguments to `list_target_projects` via keyword arguments. Note that at + # least one keyword argument is 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 parent, which owns this collection of targets. + # @param page_size [::Integer] + # Optional. The maximum number of targets to return. The service may return + # fewer than this value. If unspecified, at most 500 targets will be + # returned. The maximum value is 1000; values above 1000 will be coerced to + # 1000. + # @param page_token [::String] + # Required. A page token, received from a previous `ListTargets` call. + # Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to `ListTargets` must + # match the call that provided the page token. + # @param filter [::String] + # Optional. The filter request. + # @param order_by [::String] + # Optional. the order by fields for the result. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::VMMigration::V1::TargetProject>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::VMMigration::V1::TargetProject>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/vm_migration/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VMMigration::V1::VMMigration::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VMMigration::V1::ListTargetProjectsRequest.new + # + # # Call the list_target_projects method. + # result = client.list_target_projects 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::VMMigration::V1::TargetProject. + # p item + # end + # + def list_target_projects request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::ListTargetProjectsRequest + + # Converts hash 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_target_projects.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::VMMigration::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_target_projects.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_target_projects.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vm_migration_stub.call_rpc :list_target_projects, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @vm_migration_stub, :list_target_projects, 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 + + ## + # Gets details of a single TargetProject. + # + # NOTE: TargetProject is a global resource; hence the only supported value + # for location is `global`. + # + # @overload get_target_project(request, options = nil) + # Pass arguments to `get_target_project` via a request object, either of type + # {::Google::Cloud::VMMigration::V1::GetTargetProjectRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VMMigration::V1::GetTargetProjectRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_target_project(name: nil) + # Pass arguments to `get_target_project` via keyword arguments. Note that at + # least one keyword argument is 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 TargetProject name. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::VMMigration::V1::TargetProject] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::VMMigration::V1::TargetProject] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/vm_migration/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VMMigration::V1::VMMigration::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VMMigration::V1::GetTargetProjectRequest.new + # + # # Call the get_target_project method. + # result = client.get_target_project request + # + # # The returned object is of type Google::Cloud::VMMigration::V1::TargetProject. + # p result + # + def get_target_project request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::GetTargetProjectRequest + + # Converts hash 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_target_project.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::VMMigration::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_target_project.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_target_project.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vm_migration_stub.call_rpc :get_target_project, 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 TargetProject in a given project. + # + # NOTE: TargetProject is a global resource; hence the only supported value + # for location is `global`. + # + # @overload create_target_project(request, options = nil) + # Pass arguments to `create_target_project` via a request object, either of type + # {::Google::Cloud::VMMigration::V1::CreateTargetProjectRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VMMigration::V1::CreateTargetProjectRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_target_project(parent: nil, target_project_id: nil, target_project: nil, request_id: nil) + # Pass arguments to `create_target_project` via keyword arguments. Note that at + # least one keyword argument is 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 TargetProject's parent. + # @param target_project_id [::String] + # Required. The target_project identifier. + # @param target_project [::Google::Cloud::VMMigration::V1::TargetProject, ::Hash] + # Required. The create request body. + # @param request_id [::String] + # A request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server will guarantee + # that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # + # @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/vm_migration/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VMMigration::V1::VMMigration::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VMMigration::V1::CreateTargetProjectRequest.new + # + # # Call the create_target_project method. + # result = client.create_target_project 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_target_project request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::CreateTargetProjectRequest + + # Converts hash 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_target_project.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::VMMigration::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_target_project.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_target_project.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vm_migration_stub.call_rpc :create_target_project, 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 + + ## + # Updates the parameters of a single TargetProject. + # + # NOTE: TargetProject is a global resource; hence the only supported value + # for location is `global`. + # + # @overload update_target_project(request, options = nil) + # Pass arguments to `update_target_project` via a request object, either of type + # {::Google::Cloud::VMMigration::V1::UpdateTargetProjectRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VMMigration::V1::UpdateTargetProjectRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_target_project(update_mask: nil, target_project: nil, request_id: nil) + # Pass arguments to `update_target_project` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Field mask is used to specify the fields to be overwritten in the + # TargetProject resource by the update. + # The fields specified in the update_mask are relative to the resource, not + # the full request. A field will be overwritten if it is in the mask. If the + # user does not provide a mask then all fields will be overwritten. + # @param target_project [::Google::Cloud::VMMigration::V1::TargetProject, ::Hash] + # Required. The update request body. + # @param request_id [::String] + # A request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server will guarantee + # that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # + # @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/vm_migration/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VMMigration::V1::VMMigration::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VMMigration::V1::UpdateTargetProjectRequest.new + # + # # Call the update_target_project method. + # result = client.update_target_project 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 update_target_project request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::UpdateTargetProjectRequest + + # Converts hash 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_target_project.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::VMMigration::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.target_project&.name + header_params["target_project.name"] = request.target_project.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_target_project.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_target_project.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vm_migration_stub.call_rpc :update_target_project, 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 single TargetProject. + # + # NOTE: TargetProject is a global resource; hence the only supported value + # for location is `global`. + # + # @overload delete_target_project(request, options = nil) + # Pass arguments to `delete_target_project` via a request object, either of type + # {::Google::Cloud::VMMigration::V1::DeleteTargetProjectRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VMMigration::V1::DeleteTargetProjectRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_target_project(name: nil, request_id: nil) + # Pass arguments to `delete_target_project` via keyword arguments. Note that at + # least one keyword argument is 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 TargetProject name. + # @param request_id [::String] + # Optional. A request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server will guarantee + # that for at least 60 minutes after the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # + # @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/vm_migration/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VMMigration::V1::VMMigration::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VMMigration::V1::DeleteTargetProjectRequest.new + # + # # Call the delete_target_project method. + # result = client.delete_target_project 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_target_project request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::DeleteTargetProjectRequest + + # Converts hash 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_target_project.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::VMMigration::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_target_project.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_target_project.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vm_migration_stub.call_rpc :delete_target_project, 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 + + ## + # Lists ReplicationCycles in a given MigratingVM. + # + # @overload list_replication_cycles(request, options = nil) + # Pass arguments to `list_replication_cycles` via a request object, either of type + # {::Google::Cloud::VMMigration::V1::ListReplicationCyclesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VMMigration::V1::ListReplicationCyclesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_replication_cycles(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) + # Pass arguments to `list_replication_cycles` via keyword arguments. Note that at + # least one keyword argument is 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 parent, which owns this collection of ReplicationCycles. + # @param page_size [::Integer] + # Optional. The maximum number of replication cycles to return. The service + # may return fewer than this value. If unspecified, at most 100 migrating VMs + # will be returned. The maximum value is 100; values above 100 will be + # coerced to 100. + # @param page_token [::String] + # Required. A page token, received from a previous `ListReplicationCycles` + # call. Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to `ListReplicationCycles` + # must match the call that provided the page token. + # @param filter [::String] + # Optional. The filter request. + # @param order_by [::String] + # Optional. the order by fields for the result. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::VMMigration::V1::ReplicationCycle>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::VMMigration::V1::ReplicationCycle>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/vm_migration/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VMMigration::V1::VMMigration::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VMMigration::V1::ListReplicationCyclesRequest.new + # + # # Call the list_replication_cycles method. + # result = client.list_replication_cycles 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::VMMigration::V1::ReplicationCycle. + # p item + # end + # + def list_replication_cycles request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::ListReplicationCyclesRequest + + # Converts hash 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_replication_cycles.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::VMMigration::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_replication_cycles.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_replication_cycles.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vm_migration_stub.call_rpc :list_replication_cycles, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @vm_migration_stub, :list_replication_cycles, 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 + + ## + # Gets details of a single ReplicationCycle. + # + # @overload get_replication_cycle(request, options = nil) + # Pass arguments to `get_replication_cycle` via a request object, either of type + # {::Google::Cloud::VMMigration::V1::GetReplicationCycleRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VMMigration::V1::GetReplicationCycleRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_replication_cycle(name: nil) + # Pass arguments to `get_replication_cycle` via keyword arguments. Note that at + # least one keyword argument is 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 name of the ReplicationCycle. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::VMMigration::V1::ReplicationCycle] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::VMMigration::V1::ReplicationCycle] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/vm_migration/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VMMigration::V1::VMMigration::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VMMigration::V1::GetReplicationCycleRequest.new + # + # # Call the get_replication_cycle method. + # result = client.get_replication_cycle request + # + # # The returned object is of type Google::Cloud::VMMigration::V1::ReplicationCycle. + # p result + # + def get_replication_cycle request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::GetReplicationCycleRequest + + # Converts hash 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_replication_cycle.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::VMMigration::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_replication_cycle.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_replication_cycle.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vm_migration_stub.call_rpc :get_replication_cycle, 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 ImageImports in a given project. + # + # @overload list_image_imports(request, options = nil) + # Pass arguments to `list_image_imports` via a request object, either of type + # {::Google::Cloud::VMMigration::V1::ListImageImportsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VMMigration::V1::ListImageImportsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_image_imports(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) + # Pass arguments to `list_image_imports` via keyword arguments. Note that at + # least one keyword argument is 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 parent, which owns this collection of targets. + # @param page_size [::Integer] + # Optional. The maximum number of targets to return. The service may return + # fewer than this value. If unspecified, at most 500 targets will be + # returned. The maximum value is 1000; values above 1000 will be coerced to + # 1000. + # @param page_token [::String] + # Optional. A page token, received from a previous `ListImageImports` call. + # Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to `ListImageImports` must + # match the call that provided the page token. + # @param filter [::String] + # Optional. The filter request (according to AIP-160). + # @param order_by [::String] + # Optional. The order by fields for the result (according to AIP-132). + # Currently ordering is only possible by "name" field. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::VMMigration::V1::ImageImport>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::VMMigration::V1::ImageImport>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/vm_migration/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VMMigration::V1::VMMigration::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VMMigration::V1::ListImageImportsRequest.new + # + # # Call the list_image_imports method. + # result = client.list_image_imports 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::VMMigration::V1::ImageImport. + # p item + # end + # + def list_image_imports request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::ListImageImportsRequest + + # Converts hash 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_image_imports.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::VMMigration::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_image_imports.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_image_imports.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vm_migration_stub.call_rpc :list_image_imports, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @vm_migration_stub, :list_image_imports, 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 + + ## + # Gets details of a single ImageImport. + # + # @overload get_image_import(request, options = nil) + # Pass arguments to `get_image_import` via a request object, either of type + # {::Google::Cloud::VMMigration::V1::GetImageImportRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VMMigration::V1::GetImageImportRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_image_import(name: nil) + # Pass arguments to `get_image_import` via keyword arguments. Note that at + # least one keyword argument is 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 ImageImport name. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::VMMigration::V1::ImageImport] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::VMMigration::V1::ImageImport] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/vm_migration/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VMMigration::V1::VMMigration::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VMMigration::V1::GetImageImportRequest.new + # + # # Call the get_image_import method. + # result = client.get_image_import request + # + # # The returned object is of type Google::Cloud::VMMigration::V1::ImageImport. + # p result + # + def get_image_import request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::GetImageImportRequest + + # Converts hash 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_image_import.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::VMMigration::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_image_import.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_image_import.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vm_migration_stub.call_rpc :get_image_import, 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 ImageImport in a given project. + # + # @overload create_image_import(request, options = nil) + # Pass arguments to `create_image_import` via a request object, either of type + # {::Google::Cloud::VMMigration::V1::CreateImageImportRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VMMigration::V1::CreateImageImportRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_image_import(parent: nil, image_import_id: nil, image_import: nil, request_id: nil) + # Pass arguments to `create_image_import` via keyword arguments. Note that at + # least one keyword argument is 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 ImageImport's parent. + # @param image_import_id [::String] + # Required. The image import identifier. + # This value maximum length is 63 characters, and valid characters are + # /[a-z][0-9]-/. It must start with an english letter and must not end with a + # hyphen. + # @param image_import [::Google::Cloud::VMMigration::V1::ImageImport, ::Hash] + # Required. The create request body. + # @param request_id [::String] + # Optional. A request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server will guarantee + # that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # + # @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/vm_migration/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VMMigration::V1::VMMigration::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VMMigration::V1::CreateImageImportRequest.new + # + # # Call the create_image_import method. + # result = client.create_image_import 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_image_import request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::CreateImageImportRequest + + # Converts hash 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_image_import.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::VMMigration::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_image_import.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_image_import.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vm_migration_stub.call_rpc :create_image_import, 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 single ImageImport. + # + # @overload delete_image_import(request, options = nil) + # Pass arguments to `delete_image_import` via a request object, either of type + # {::Google::Cloud::VMMigration::V1::DeleteImageImportRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VMMigration::V1::DeleteImageImportRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_image_import(name: nil, request_id: nil) + # Pass arguments to `delete_image_import` via keyword arguments. Note that at + # least one keyword argument is 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 ImageImport name. + # @param request_id [::String] + # Optional. A request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server will guarantee + # that for at least 60 minutes after the first request. + # + # For example, consider a situation where you make an initial request and t + # he request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # + # @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/vm_migration/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VMMigration::V1::VMMigration::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VMMigration::V1::DeleteImageImportRequest.new + # + # # Call the delete_image_import method. + # result = client.delete_image_import 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_image_import request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::DeleteImageImportRequest + + # Converts hash 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_image_import.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::VMMigration::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_image_import.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_image_import.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vm_migration_stub.call_rpc :delete_image_import, 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 + + ## + # Lists ImageImportJobs in a given project. + # + # @overload list_image_import_jobs(request, options = nil) + # Pass arguments to `list_image_import_jobs` via a request object, either of type + # {::Google::Cloud::VMMigration::V1::ListImageImportJobsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VMMigration::V1::ListImageImportJobsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_image_import_jobs(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) + # Pass arguments to `list_image_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 parent, which owns this collection of targets. + # @param page_size [::Integer] + # Optional. The maximum number of targets to return. The service may return + # fewer than this value. If unspecified, at most 500 targets will be + # returned. The maximum value is 1000; values above 1000 will be coerced to + # 1000. + # @param page_token [::String] + # Optional. A page token, received from a previous `ListImageImportJobs` + # call. Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to `ListImageImportJobs` + # must match the call that provided the page token. + # @param filter [::String] + # Optional. The filter request (according to AIP-160). + # @param order_by [::String] + # Optional. The order by fields for the result (according to AIP-132). + # Currently ordering is only possible by "name" field. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::VMMigration::V1::ImageImportJob>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::VMMigration::V1::ImageImportJob>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/vm_migration/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VMMigration::V1::VMMigration::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VMMigration::V1::ListImageImportJobsRequest.new + # + # # Call the list_image_import_jobs method. + # result = client.list_image_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::VMMigration::V1::ImageImportJob. + # p item + # end + # + def list_image_import_jobs request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::ListImageImportJobsRequest + + # Converts hash 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_image_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::VMMigration::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_image_import_jobs.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_image_import_jobs.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vm_migration_stub.call_rpc :list_image_import_jobs, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @vm_migration_stub, :list_image_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 + + ## + # Gets details of a single ImageImportJob. + # + # @overload get_image_import_job(request, options = nil) + # Pass arguments to `get_image_import_job` via a request object, either of type + # {::Google::Cloud::VMMigration::V1::GetImageImportJobRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VMMigration::V1::GetImageImportJobRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_image_import_job(name: nil) + # Pass arguments to `get_image_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 ImageImportJob name. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::VMMigration::V1::ImageImportJob] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::VMMigration::V1::ImageImportJob] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/vm_migration/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VMMigration::V1::VMMigration::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VMMigration::V1::GetImageImportJobRequest.new + # + # # Call the get_image_import_job method. + # result = client.get_image_import_job request + # + # # The returned object is of type Google::Cloud::VMMigration::V1::ImageImportJob. + # p result + # + def get_image_import_job request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::GetImageImportJobRequest + + # Converts hash 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_image_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::VMMigration::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_image_import_job.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_image_import_job.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vm_migration_stub.call_rpc :get_image_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 + + ## + # Initiates the cancellation of a running ImageImportJob. + # + # @overload cancel_image_import_job(request, options = nil) + # Pass arguments to `cancel_image_import_job` via a request object, either of type + # {::Google::Cloud::VMMigration::V1::CancelImageImportJobRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VMMigration::V1::CancelImageImportJobRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_image_import_job(name: nil) + # Pass arguments to `cancel_image_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 image import job id. + # + # @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/vm_migration/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VMMigration::V1::VMMigration::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VMMigration::V1::CancelImageImportJobRequest.new + # + # # Call the cancel_image_import_job method. + # result = client.cancel_image_import_job 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 cancel_image_import_job request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::CancelImageImportJobRequest + + # Converts hash 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_image_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::VMMigration::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_image_import_job.timeout, + metadata: metadata, + retry_policy: @config.rpcs.cancel_image_import_job.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vm_migration_stub.call_rpc :cancel_image_import_job, 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 disk migration job in a given Source. + # + # @overload create_disk_migration_job(request, options = nil) + # Pass arguments to `create_disk_migration_job` via a request object, either of type + # {::Google::Cloud::VMMigration::V1::CreateDiskMigrationJobRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VMMigration::V1::CreateDiskMigrationJobRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_disk_migration_job(parent: nil, disk_migration_job_id: nil, disk_migration_job: nil, request_id: nil) + # Pass arguments to `create_disk_migration_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 DiskMigrationJob's parent. + # @param disk_migration_job_id [::String] + # Required. The DiskMigrationJob identifier. + # The maximum length of this value is 63 characters. + # Valid characters are lower case Latin letters, digits and hyphen. + # It must start with a Latin letter and must not end with a hyphen. + # @param disk_migration_job [::Google::Cloud::VMMigration::V1::DiskMigrationJob, ::Hash] + # Required. The create request body. + # @param request_id [::String] + # Optional. A request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server will guarantee + # that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request timed out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # + # @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/vm_migration/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VMMigration::V1::VMMigration::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VMMigration::V1::CreateDiskMigrationJobRequest.new + # + # # Call the create_disk_migration_job method. + # result = client.create_disk_migration_job 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_disk_migration_job request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::CreateDiskMigrationJobRequest + + # Converts hash 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_disk_migration_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::VMMigration::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_disk_migration_job.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_disk_migration_job.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vm_migration_stub.call_rpc :create_disk_migration_job, 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 + + ## + # Lists DiskMigrationJobs in a given Source. + # + # @overload list_disk_migration_jobs(request, options = nil) + # Pass arguments to `list_disk_migration_jobs` via a request object, either of type + # {::Google::Cloud::VMMigration::V1::ListDiskMigrationJobsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VMMigration::V1::ListDiskMigrationJobsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_disk_migration_jobs(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) + # Pass arguments to `list_disk_migration_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 parent, which owns this collection of DiskMigrationJobs. + # @param page_size [::Integer] + # Optional. The maximum number of disk migration jobs to return. The service + # may return fewer than this value. If unspecified, at most 500 + # disk migration jobs will be returned. + # The maximum value is 1000; values above 1000 will be coerced to 1000. + # @param page_token [::String] + # Optional. A page token, received from a previous `ListDiskMigrationJobs` + # call. Provide this to retrieve the subsequent page. + # + # When paginating, all parameters provided to `ListDiskMigrationJobs` + # except `page_size` must match the call that provided the page token. + # @param filter [::String] + # Optional. The filter request (according to AIP-160). + # @param order_by [::String] + # Optional. Ordering of the result list. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::VMMigration::V1::DiskMigrationJob>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::VMMigration::V1::DiskMigrationJob>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/vm_migration/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VMMigration::V1::VMMigration::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VMMigration::V1::ListDiskMigrationJobsRequest.new + # + # # Call the list_disk_migration_jobs method. + # result = client.list_disk_migration_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::VMMigration::V1::DiskMigrationJob. + # p item + # end + # + def list_disk_migration_jobs request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::ListDiskMigrationJobsRequest + + # Converts hash 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_disk_migration_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::VMMigration::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_disk_migration_jobs.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_disk_migration_jobs.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vm_migration_stub.call_rpc :list_disk_migration_jobs, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @vm_migration_stub, :list_disk_migration_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 + + ## + # Gets details of a single DiskMigrationJob. + # + # @overload get_disk_migration_job(request, options = nil) + # Pass arguments to `get_disk_migration_job` via a request object, either of type + # {::Google::Cloud::VMMigration::V1::GetDiskMigrationJobRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VMMigration::V1::GetDiskMigrationJobRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_disk_migration_job(name: nil) + # Pass arguments to `get_disk_migration_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 name of the DiskMigrationJob. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::VMMigration::V1::DiskMigrationJob] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::VMMigration::V1::DiskMigrationJob] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/vm_migration/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VMMigration::V1::VMMigration::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VMMigration::V1::GetDiskMigrationJobRequest.new + # + # # Call the get_disk_migration_job method. + # result = client.get_disk_migration_job request + # + # # The returned object is of type Google::Cloud::VMMigration::V1::DiskMigrationJob. + # p result + # + def get_disk_migration_job request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::GetDiskMigrationJobRequest + + # Converts hash 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_disk_migration_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::VMMigration::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_disk_migration_job.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_disk_migration_job.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vm_migration_stub.call_rpc :get_disk_migration_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 + + ## + # Updates the parameters of a single DiskMigrationJob. + # + # @overload update_disk_migration_job(request, options = nil) + # Pass arguments to `update_disk_migration_job` via a request object, either of type + # {::Google::Cloud::VMMigration::V1::UpdateDiskMigrationJobRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VMMigration::V1::UpdateDiskMigrationJobRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_disk_migration_job(update_mask: nil, disk_migration_job: nil, request_id: nil) + # Pass arguments to `update_disk_migration_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 update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Optional. Field mask is used to specify the fields to be overwritten in the + # DiskMigrationJob resource by the update. + # The fields specified in the update_mask are relative to the resource, not + # the full request. A field will be overwritten if it is in the mask. If the + # user does not provide a mask, then a mask equivalent to all fields that are + # populated (have a non-empty value), will be implied. + # @param disk_migration_job [::Google::Cloud::VMMigration::V1::DiskMigrationJob, ::Hash] + # Required. The update request body. + # @param request_id [::String] + # Optional. A request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server will guarantee + # that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request timed out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # + # @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/vm_migration/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VMMigration::V1::VMMigration::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VMMigration::V1::UpdateDiskMigrationJobRequest.new + # + # # Call the update_disk_migration_job method. + # result = client.update_disk_migration_job 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 update_disk_migration_job request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::UpdateDiskMigrationJobRequest + + # Converts hash 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_disk_migration_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::VMMigration::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.disk_migration_job&.name + header_params["disk_migration_job.name"] = request.disk_migration_job.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_disk_migration_job.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_disk_migration_job.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vm_migration_stub.call_rpc :update_disk_migration_job, 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 single DiskMigrationJob. + # + # @overload delete_disk_migration_job(request, options = nil) + # Pass arguments to `delete_disk_migration_job` via a request object, either of type + # {::Google::Cloud::VMMigration::V1::DeleteDiskMigrationJobRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VMMigration::V1::DeleteDiskMigrationJobRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_disk_migration_job(name: nil) + # Pass arguments to `delete_disk_migration_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 name of the DiskMigrationJob. + # + # @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/vm_migration/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VMMigration::V1::VMMigration::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VMMigration::V1::DeleteDiskMigrationJobRequest.new + # + # # Call the delete_disk_migration_job method. + # result = client.delete_disk_migration_job 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_disk_migration_job request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::DeleteDiskMigrationJobRequest + + # Converts hash 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_disk_migration_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::VMMigration::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_disk_migration_job.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_disk_migration_job.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vm_migration_stub.call_rpc :delete_disk_migration_job, 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 + + ## + # Runs the disk migration job. + # + # @overload run_disk_migration_job(request, options = nil) + # Pass arguments to `run_disk_migration_job` via a request object, either of type + # {::Google::Cloud::VMMigration::V1::RunDiskMigrationJobRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VMMigration::V1::RunDiskMigrationJobRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload run_disk_migration_job(name: nil) + # Pass arguments to `run_disk_migration_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 name of the DiskMigrationJob. + # + # @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/vm_migration/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VMMigration::V1::VMMigration::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VMMigration::V1::RunDiskMigrationJobRequest.new + # + # # Call the run_disk_migration_job method. + # result = client.run_disk_migration_job 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 run_disk_migration_job request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::RunDiskMigrationJobRequest + + # Converts hash 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.run_disk_migration_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::VMMigration::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.run_disk_migration_job.timeout, + metadata: metadata, + retry_policy: @config.rpcs.run_disk_migration_job.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vm_migration_stub.call_rpc :run_disk_migration_job, 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 + + ## + # Cancels the disk migration job. + # + # @overload cancel_disk_migration_job(request, options = nil) + # Pass arguments to `cancel_disk_migration_job` via a request object, either of type + # {::Google::Cloud::VMMigration::V1::CancelDiskMigrationJobRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VMMigration::V1::CancelDiskMigrationJobRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_disk_migration_job(name: nil) + # Pass arguments to `cancel_disk_migration_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 name of the DiskMigrationJob. + # + # @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/vm_migration/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VMMigration::V1::VMMigration::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VMMigration::V1::CancelDiskMigrationJobRequest.new + # + # # Call the cancel_disk_migration_job method. + # result = client.cancel_disk_migration_job 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 cancel_disk_migration_job request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::CancelDiskMigrationJobRequest + + # Converts hash 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_disk_migration_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::VMMigration::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_disk_migration_job.timeout, + metadata: metadata, + retry_policy: @config.rpcs.cancel_disk_migration_job.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vm_migration_stub.call_rpc :cancel_disk_migration_job, 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 VmMigration API. + # + # This class represents the configuration for VmMigration, + # 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::VMMigration::V1::VMMigration::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_sources to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::VMMigration::V1::VMMigration::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_sources.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::VMMigration::V1::VMMigration::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_sources.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::VMMigration::V1::VMMigration::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 = "vmmigration.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 VmMigration 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_sources` + # @return [::Gapic::Config::Method] + # + attr_reader :list_sources + ## + # RPC-specific configuration for `get_source` + # @return [::Gapic::Config::Method] + # + attr_reader :get_source + ## + # RPC-specific configuration for `create_source` + # @return [::Gapic::Config::Method] + # + attr_reader :create_source + ## + # RPC-specific configuration for `update_source` + # @return [::Gapic::Config::Method] + # + attr_reader :update_source + ## + # RPC-specific configuration for `delete_source` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_source + ## + # RPC-specific configuration for `fetch_inventory` + # @return [::Gapic::Config::Method] + # + attr_reader :fetch_inventory + ## + # RPC-specific configuration for `fetch_storage_inventory` + # @return [::Gapic::Config::Method] + # + attr_reader :fetch_storage_inventory + ## + # RPC-specific configuration for `list_utilization_reports` + # @return [::Gapic::Config::Method] + # + attr_reader :list_utilization_reports + ## + # RPC-specific configuration for `get_utilization_report` + # @return [::Gapic::Config::Method] + # + attr_reader :get_utilization_report + ## + # RPC-specific configuration for `create_utilization_report` + # @return [::Gapic::Config::Method] + # + attr_reader :create_utilization_report + ## + # RPC-specific configuration for `delete_utilization_report` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_utilization_report + ## + # RPC-specific configuration for `list_datacenter_connectors` + # @return [::Gapic::Config::Method] + # + attr_reader :list_datacenter_connectors + ## + # RPC-specific configuration for `get_datacenter_connector` + # @return [::Gapic::Config::Method] + # + attr_reader :get_datacenter_connector + ## + # RPC-specific configuration for `create_datacenter_connector` + # @return [::Gapic::Config::Method] + # + attr_reader :create_datacenter_connector + ## + # RPC-specific configuration for `delete_datacenter_connector` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_datacenter_connector + ## + # RPC-specific configuration for `upgrade_appliance` + # @return [::Gapic::Config::Method] + # + attr_reader :upgrade_appliance + ## + # RPC-specific configuration for `create_migrating_vm` + # @return [::Gapic::Config::Method] + # + attr_reader :create_migrating_vm + ## + # RPC-specific configuration for `list_migrating_vms` + # @return [::Gapic::Config::Method] + # + attr_reader :list_migrating_vms + ## + # RPC-specific configuration for `get_migrating_vm` + # @return [::Gapic::Config::Method] + # + attr_reader :get_migrating_vm + ## + # RPC-specific configuration for `update_migrating_vm` + # @return [::Gapic::Config::Method] + # + attr_reader :update_migrating_vm + ## + # RPC-specific configuration for `delete_migrating_vm` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_migrating_vm + ## + # RPC-specific configuration for `start_migration` + # @return [::Gapic::Config::Method] + # + attr_reader :start_migration + ## + # RPC-specific configuration for `resume_migration` + # @return [::Gapic::Config::Method] + # + attr_reader :resume_migration + ## + # RPC-specific configuration for `pause_migration` + # @return [::Gapic::Config::Method] + # + attr_reader :pause_migration + ## + # RPC-specific configuration for `finalize_migration` + # @return [::Gapic::Config::Method] + # + attr_reader :finalize_migration + ## + # RPC-specific configuration for `extend_migration` + # @return [::Gapic::Config::Method] + # + attr_reader :extend_migration + ## + # RPC-specific configuration for `create_clone_job` + # @return [::Gapic::Config::Method] + # + attr_reader :create_clone_job + ## + # RPC-specific configuration for `cancel_clone_job` + # @return [::Gapic::Config::Method] + # + attr_reader :cancel_clone_job + ## + # RPC-specific configuration for `list_clone_jobs` + # @return [::Gapic::Config::Method] + # + attr_reader :list_clone_jobs + ## + # RPC-specific configuration for `get_clone_job` + # @return [::Gapic::Config::Method] + # + attr_reader :get_clone_job + ## + # RPC-specific configuration for `create_cutover_job` + # @return [::Gapic::Config::Method] + # + attr_reader :create_cutover_job + ## + # RPC-specific configuration for `cancel_cutover_job` + # @return [::Gapic::Config::Method] + # + attr_reader :cancel_cutover_job + ## + # RPC-specific configuration for `list_cutover_jobs` + # @return [::Gapic::Config::Method] + # + attr_reader :list_cutover_jobs + ## + # RPC-specific configuration for `get_cutover_job` + # @return [::Gapic::Config::Method] + # + attr_reader :get_cutover_job + ## + # RPC-specific configuration for `list_groups` + # @return [::Gapic::Config::Method] + # + attr_reader :list_groups + ## + # RPC-specific configuration for `get_group` + # @return [::Gapic::Config::Method] + # + attr_reader :get_group + ## + # RPC-specific configuration for `create_group` + # @return [::Gapic::Config::Method] + # + attr_reader :create_group + ## + # RPC-specific configuration for `update_group` + # @return [::Gapic::Config::Method] + # + attr_reader :update_group + ## + # RPC-specific configuration for `delete_group` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_group + ## + # RPC-specific configuration for `add_group_migration` + # @return [::Gapic::Config::Method] + # + attr_reader :add_group_migration + ## + # RPC-specific configuration for `remove_group_migration` + # @return [::Gapic::Config::Method] + # + attr_reader :remove_group_migration + ## + # RPC-specific configuration for `list_target_projects` + # @return [::Gapic::Config::Method] + # + attr_reader :list_target_projects + ## + # RPC-specific configuration for `get_target_project` + # @return [::Gapic::Config::Method] + # + attr_reader :get_target_project + ## + # RPC-specific configuration for `create_target_project` + # @return [::Gapic::Config::Method] + # + attr_reader :create_target_project + ## + # RPC-specific configuration for `update_target_project` + # @return [::Gapic::Config::Method] + # + attr_reader :update_target_project + ## + # RPC-specific configuration for `delete_target_project` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_target_project + ## + # RPC-specific configuration for `list_replication_cycles` + # @return [::Gapic::Config::Method] + # + attr_reader :list_replication_cycles + ## + # RPC-specific configuration for `get_replication_cycle` + # @return [::Gapic::Config::Method] + # + attr_reader :get_replication_cycle + ## + # RPC-specific configuration for `list_image_imports` + # @return [::Gapic::Config::Method] + # + attr_reader :list_image_imports + ## + # RPC-specific configuration for `get_image_import` + # @return [::Gapic::Config::Method] + # + attr_reader :get_image_import + ## + # RPC-specific configuration for `create_image_import` + # @return [::Gapic::Config::Method] + # + attr_reader :create_image_import + ## + # RPC-specific configuration for `delete_image_import` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_image_import + ## + # RPC-specific configuration for `list_image_import_jobs` + # @return [::Gapic::Config::Method] + # + attr_reader :list_image_import_jobs + ## + # RPC-specific configuration for `get_image_import_job` + # @return [::Gapic::Config::Method] + # + attr_reader :get_image_import_job + ## + # RPC-specific configuration for `cancel_image_import_job` + # @return [::Gapic::Config::Method] + # + attr_reader :cancel_image_import_job + ## + # RPC-specific configuration for `create_disk_migration_job` + # @return [::Gapic::Config::Method] + # + attr_reader :create_disk_migration_job + ## + # RPC-specific configuration for `list_disk_migration_jobs` + # @return [::Gapic::Config::Method] + # + attr_reader :list_disk_migration_jobs + ## + # RPC-specific configuration for `get_disk_migration_job` + # @return [::Gapic::Config::Method] + # + attr_reader :get_disk_migration_job + ## + # RPC-specific configuration for `update_disk_migration_job` + # @return [::Gapic::Config::Method] + # + attr_reader :update_disk_migration_job + ## + # RPC-specific configuration for `delete_disk_migration_job` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_disk_migration_job + ## + # RPC-specific configuration for `run_disk_migration_job` + # @return [::Gapic::Config::Method] + # + attr_reader :run_disk_migration_job + ## + # RPC-specific configuration for `cancel_disk_migration_job` + # @return [::Gapic::Config::Method] + # + attr_reader :cancel_disk_migration_job + + # @private + def initialize parent_rpcs = nil + list_sources_config = parent_rpcs.list_sources if parent_rpcs.respond_to? :list_sources + @list_sources = ::Gapic::Config::Method.new list_sources_config + get_source_config = parent_rpcs.get_source if parent_rpcs.respond_to? :get_source + @get_source = ::Gapic::Config::Method.new get_source_config + create_source_config = parent_rpcs.create_source if parent_rpcs.respond_to? :create_source + @create_source = ::Gapic::Config::Method.new create_source_config + update_source_config = parent_rpcs.update_source if parent_rpcs.respond_to? :update_source + @update_source = ::Gapic::Config::Method.new update_source_config + delete_source_config = parent_rpcs.delete_source if parent_rpcs.respond_to? :delete_source + @delete_source = ::Gapic::Config::Method.new delete_source_config + fetch_inventory_config = parent_rpcs.fetch_inventory if parent_rpcs.respond_to? :fetch_inventory + @fetch_inventory = ::Gapic::Config::Method.new fetch_inventory_config + fetch_storage_inventory_config = parent_rpcs.fetch_storage_inventory if parent_rpcs.respond_to? :fetch_storage_inventory + @fetch_storage_inventory = ::Gapic::Config::Method.new fetch_storage_inventory_config + list_utilization_reports_config = parent_rpcs.list_utilization_reports if parent_rpcs.respond_to? :list_utilization_reports + @list_utilization_reports = ::Gapic::Config::Method.new list_utilization_reports_config + get_utilization_report_config = parent_rpcs.get_utilization_report if parent_rpcs.respond_to? :get_utilization_report + @get_utilization_report = ::Gapic::Config::Method.new get_utilization_report_config + create_utilization_report_config = parent_rpcs.create_utilization_report if parent_rpcs.respond_to? :create_utilization_report + @create_utilization_report = ::Gapic::Config::Method.new create_utilization_report_config + delete_utilization_report_config = parent_rpcs.delete_utilization_report if parent_rpcs.respond_to? :delete_utilization_report + @delete_utilization_report = ::Gapic::Config::Method.new delete_utilization_report_config + list_datacenter_connectors_config = parent_rpcs.list_datacenter_connectors if parent_rpcs.respond_to? :list_datacenter_connectors + @list_datacenter_connectors = ::Gapic::Config::Method.new list_datacenter_connectors_config + get_datacenter_connector_config = parent_rpcs.get_datacenter_connector if parent_rpcs.respond_to? :get_datacenter_connector + @get_datacenter_connector = ::Gapic::Config::Method.new get_datacenter_connector_config + create_datacenter_connector_config = parent_rpcs.create_datacenter_connector if parent_rpcs.respond_to? :create_datacenter_connector + @create_datacenter_connector = ::Gapic::Config::Method.new create_datacenter_connector_config + delete_datacenter_connector_config = parent_rpcs.delete_datacenter_connector if parent_rpcs.respond_to? :delete_datacenter_connector + @delete_datacenter_connector = ::Gapic::Config::Method.new delete_datacenter_connector_config + upgrade_appliance_config = parent_rpcs.upgrade_appliance if parent_rpcs.respond_to? :upgrade_appliance + @upgrade_appliance = ::Gapic::Config::Method.new upgrade_appliance_config + create_migrating_vm_config = parent_rpcs.create_migrating_vm if parent_rpcs.respond_to? :create_migrating_vm + @create_migrating_vm = ::Gapic::Config::Method.new create_migrating_vm_config + list_migrating_vms_config = parent_rpcs.list_migrating_vms if parent_rpcs.respond_to? :list_migrating_vms + @list_migrating_vms = ::Gapic::Config::Method.new list_migrating_vms_config + get_migrating_vm_config = parent_rpcs.get_migrating_vm if parent_rpcs.respond_to? :get_migrating_vm + @get_migrating_vm = ::Gapic::Config::Method.new get_migrating_vm_config + update_migrating_vm_config = parent_rpcs.update_migrating_vm if parent_rpcs.respond_to? :update_migrating_vm + @update_migrating_vm = ::Gapic::Config::Method.new update_migrating_vm_config + delete_migrating_vm_config = parent_rpcs.delete_migrating_vm if parent_rpcs.respond_to? :delete_migrating_vm + @delete_migrating_vm = ::Gapic::Config::Method.new delete_migrating_vm_config + start_migration_config = parent_rpcs.start_migration if parent_rpcs.respond_to? :start_migration + @start_migration = ::Gapic::Config::Method.new start_migration_config + resume_migration_config = parent_rpcs.resume_migration if parent_rpcs.respond_to? :resume_migration + @resume_migration = ::Gapic::Config::Method.new resume_migration_config + pause_migration_config = parent_rpcs.pause_migration if parent_rpcs.respond_to? :pause_migration + @pause_migration = ::Gapic::Config::Method.new pause_migration_config + finalize_migration_config = parent_rpcs.finalize_migration if parent_rpcs.respond_to? :finalize_migration + @finalize_migration = ::Gapic::Config::Method.new finalize_migration_config + extend_migration_config = parent_rpcs.extend_migration if parent_rpcs.respond_to? :extend_migration + @extend_migration = ::Gapic::Config::Method.new extend_migration_config + create_clone_job_config = parent_rpcs.create_clone_job if parent_rpcs.respond_to? :create_clone_job + @create_clone_job = ::Gapic::Config::Method.new create_clone_job_config + cancel_clone_job_config = parent_rpcs.cancel_clone_job if parent_rpcs.respond_to? :cancel_clone_job + @cancel_clone_job = ::Gapic::Config::Method.new cancel_clone_job_config + list_clone_jobs_config = parent_rpcs.list_clone_jobs if parent_rpcs.respond_to? :list_clone_jobs + @list_clone_jobs = ::Gapic::Config::Method.new list_clone_jobs_config + get_clone_job_config = parent_rpcs.get_clone_job if parent_rpcs.respond_to? :get_clone_job + @get_clone_job = ::Gapic::Config::Method.new get_clone_job_config + create_cutover_job_config = parent_rpcs.create_cutover_job if parent_rpcs.respond_to? :create_cutover_job + @create_cutover_job = ::Gapic::Config::Method.new create_cutover_job_config + cancel_cutover_job_config = parent_rpcs.cancel_cutover_job if parent_rpcs.respond_to? :cancel_cutover_job + @cancel_cutover_job = ::Gapic::Config::Method.new cancel_cutover_job_config + list_cutover_jobs_config = parent_rpcs.list_cutover_jobs if parent_rpcs.respond_to? :list_cutover_jobs + @list_cutover_jobs = ::Gapic::Config::Method.new list_cutover_jobs_config + get_cutover_job_config = parent_rpcs.get_cutover_job if parent_rpcs.respond_to? :get_cutover_job + @get_cutover_job = ::Gapic::Config::Method.new get_cutover_job_config + list_groups_config = parent_rpcs.list_groups if parent_rpcs.respond_to? :list_groups + @list_groups = ::Gapic::Config::Method.new list_groups_config + get_group_config = parent_rpcs.get_group if parent_rpcs.respond_to? :get_group + @get_group = ::Gapic::Config::Method.new get_group_config + create_group_config = parent_rpcs.create_group if parent_rpcs.respond_to? :create_group + @create_group = ::Gapic::Config::Method.new create_group_config + update_group_config = parent_rpcs.update_group if parent_rpcs.respond_to? :update_group + @update_group = ::Gapic::Config::Method.new update_group_config + delete_group_config = parent_rpcs.delete_group if parent_rpcs.respond_to? :delete_group + @delete_group = ::Gapic::Config::Method.new delete_group_config + add_group_migration_config = parent_rpcs.add_group_migration if parent_rpcs.respond_to? :add_group_migration + @add_group_migration = ::Gapic::Config::Method.new add_group_migration_config + remove_group_migration_config = parent_rpcs.remove_group_migration if parent_rpcs.respond_to? :remove_group_migration + @remove_group_migration = ::Gapic::Config::Method.new remove_group_migration_config + list_target_projects_config = parent_rpcs.list_target_projects if parent_rpcs.respond_to? :list_target_projects + @list_target_projects = ::Gapic::Config::Method.new list_target_projects_config + get_target_project_config = parent_rpcs.get_target_project if parent_rpcs.respond_to? :get_target_project + @get_target_project = ::Gapic::Config::Method.new get_target_project_config + create_target_project_config = parent_rpcs.create_target_project if parent_rpcs.respond_to? :create_target_project + @create_target_project = ::Gapic::Config::Method.new create_target_project_config + update_target_project_config = parent_rpcs.update_target_project if parent_rpcs.respond_to? :update_target_project + @update_target_project = ::Gapic::Config::Method.new update_target_project_config + delete_target_project_config = parent_rpcs.delete_target_project if parent_rpcs.respond_to? :delete_target_project + @delete_target_project = ::Gapic::Config::Method.new delete_target_project_config + list_replication_cycles_config = parent_rpcs.list_replication_cycles if parent_rpcs.respond_to? :list_replication_cycles + @list_replication_cycles = ::Gapic::Config::Method.new list_replication_cycles_config + get_replication_cycle_config = parent_rpcs.get_replication_cycle if parent_rpcs.respond_to? :get_replication_cycle + @get_replication_cycle = ::Gapic::Config::Method.new get_replication_cycle_config + list_image_imports_config = parent_rpcs.list_image_imports if parent_rpcs.respond_to? :list_image_imports + @list_image_imports = ::Gapic::Config::Method.new list_image_imports_config + get_image_import_config = parent_rpcs.get_image_import if parent_rpcs.respond_to? :get_image_import + @get_image_import = ::Gapic::Config::Method.new get_image_import_config + create_image_import_config = parent_rpcs.create_image_import if parent_rpcs.respond_to? :create_image_import + @create_image_import = ::Gapic::Config::Method.new create_image_import_config + delete_image_import_config = parent_rpcs.delete_image_import if parent_rpcs.respond_to? :delete_image_import + @delete_image_import = ::Gapic::Config::Method.new delete_image_import_config + list_image_import_jobs_config = parent_rpcs.list_image_import_jobs if parent_rpcs.respond_to? :list_image_import_jobs + @list_image_import_jobs = ::Gapic::Config::Method.new list_image_import_jobs_config + get_image_import_job_config = parent_rpcs.get_image_import_job if parent_rpcs.respond_to? :get_image_import_job + @get_image_import_job = ::Gapic::Config::Method.new get_image_import_job_config + cancel_image_import_job_config = parent_rpcs.cancel_image_import_job if parent_rpcs.respond_to? :cancel_image_import_job + @cancel_image_import_job = ::Gapic::Config::Method.new cancel_image_import_job_config + create_disk_migration_job_config = parent_rpcs.create_disk_migration_job if parent_rpcs.respond_to? :create_disk_migration_job + @create_disk_migration_job = ::Gapic::Config::Method.new create_disk_migration_job_config + list_disk_migration_jobs_config = parent_rpcs.list_disk_migration_jobs if parent_rpcs.respond_to? :list_disk_migration_jobs + @list_disk_migration_jobs = ::Gapic::Config::Method.new list_disk_migration_jobs_config + get_disk_migration_job_config = parent_rpcs.get_disk_migration_job if parent_rpcs.respond_to? :get_disk_migration_job + @get_disk_migration_job = ::Gapic::Config::Method.new get_disk_migration_job_config + update_disk_migration_job_config = parent_rpcs.update_disk_migration_job if parent_rpcs.respond_to? :update_disk_migration_job + @update_disk_migration_job = ::Gapic::Config::Method.new update_disk_migration_job_config + delete_disk_migration_job_config = parent_rpcs.delete_disk_migration_job if parent_rpcs.respond_to? :delete_disk_migration_job + @delete_disk_migration_job = ::Gapic::Config::Method.new delete_disk_migration_job_config + run_disk_migration_job_config = parent_rpcs.run_disk_migration_job if parent_rpcs.respond_to? :run_disk_migration_job + @run_disk_migration_job = ::Gapic::Config::Method.new run_disk_migration_job_config + cancel_disk_migration_job_config = parent_rpcs.cancel_disk_migration_job if parent_rpcs.respond_to? :cancel_disk_migration_job + @cancel_disk_migration_job = ::Gapic::Config::Method.new cancel_disk_migration_job_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-vm_migration-v1/lib/google/cloud/vm_migration/v1/vm_migration/credentials.rb b/owl-bot-staging/google-cloud-vm_migration-v1/lib/google/cloud/vm_migration/v1/vm_migration/credentials.rb new file mode 100644 index 000000000000..a7e66e21fae2 --- /dev/null +++ b/owl-bot-staging/google-cloud-vm_migration-v1/lib/google/cloud/vm_migration/v1/vm_migration/credentials.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! + +require "googleauth" + +module Google + module Cloud + module VMMigration + module V1 + module VMMigration + # Credentials for the VmMigration API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/cloud-platform" + ] + self.env_vars = [ + "GOOGLE_CLOUD_CREDENTIALS", + "GOOGLE_CLOUD_KEYFILE", + "GCLOUD_KEYFILE", + "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-vm_migration-v1/lib/google/cloud/vm_migration/v1/vm_migration/operations.rb b/owl-bot-staging/google-cloud-vm_migration-v1/lib/google/cloud/vm_migration/v1/vm_migration/operations.rb new file mode 100644 index 000000000000..e506697a45da --- /dev/null +++ b/owl-bot-staging/google-cloud-vm_migration-v1/lib/google/cloud/vm_migration/v1/vm_migration/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 VMMigration + module V1 + module VMMigration + # Service that implements Longrunning Operations API. + class Operations + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "vmmigration.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :operations_stub + + ## + # Configuration for the VmMigration 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 VmMigration 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::VMMigration::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::VMMigration::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::VMMigration::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::VMMigration::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::VMMigration::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 = "vmmigration.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-vm_migration-v1/lib/google/cloud/vm_migration/v1/vm_migration/paths.rb b/owl-bot-staging/google-cloud-vm_migration-v1/lib/google/cloud/vm_migration/v1/vm_migration/paths.rb new file mode 100644 index 000000000000..ac9c03a4c553 --- /dev/null +++ b/owl-bot-staging/google-cloud-vm_migration-v1/lib/google/cloud/vm_migration/v1/vm_migration/paths.rb @@ -0,0 +1,355 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 VMMigration + module V1 + module VMMigration + # Path helper methods for the VmMigration API. + module Paths + ## + # Create a fully-qualified CloneJob resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/sources/{source}/migratingVms/{migrating_vm}/cloneJobs/{clone_job}` + # + # @param project [String] + # @param location [String] + # @param source [String] + # @param migrating_vm [String] + # @param clone_job [String] + # + # @return [::String] + def clone_job_path project:, location:, source:, migrating_vm:, clone_job: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "source cannot contain /" if source.to_s.include? "/" + raise ::ArgumentError, "migrating_vm cannot contain /" if migrating_vm.to_s.include? "/" + + "projects/#{project}/locations/#{location}/sources/#{source}/migratingVms/#{migrating_vm}/cloneJobs/#{clone_job}" + end + + ## + # 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 CutoverJob resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/sources/{source}/migratingVms/{migrating_vm}/cutoverJobs/{cutover_job}` + # + # @param project [String] + # @param location [String] + # @param source [String] + # @param migrating_vm [String] + # @param cutover_job [String] + # + # @return [::String] + def cutover_job_path project:, location:, source:, migrating_vm:, cutover_job: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "source cannot contain /" if source.to_s.include? "/" + raise ::ArgumentError, "migrating_vm cannot contain /" if migrating_vm.to_s.include? "/" + + "projects/#{project}/locations/#{location}/sources/#{source}/migratingVms/#{migrating_vm}/cutoverJobs/#{cutover_job}" + end + + ## + # Create a fully-qualified DatacenterConnector resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/sources/{source}/datacenterConnectors/{datacenter_connector}` + # + # @param project [String] + # @param location [String] + # @param source [String] + # @param datacenter_connector [String] + # + # @return [::String] + def datacenter_connector_path project:, location:, source:, datacenter_connector: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "source cannot contain /" if source.to_s.include? "/" + + "projects/#{project}/locations/#{location}/sources/#{source}/datacenterConnectors/#{datacenter_connector}" + end + + ## + # Create a fully-qualified DiskMigrationJob resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/sources/{source}/diskMigrationJobs/{disk_migration_job}` + # + # @param project [String] + # @param location [String] + # @param source [String] + # @param disk_migration_job [String] + # + # @return [::String] + def disk_migration_job_path project:, location:, source:, disk_migration_job: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "source cannot contain /" if source.to_s.include? "/" + + "projects/#{project}/locations/#{location}/sources/#{source}/diskMigrationJobs/#{disk_migration_job}" + end + + ## + # Create a fully-qualified Group resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/groups/{group}` + # + # @param project [String] + # @param location [String] + # @param group [String] + # + # @return [::String] + def group_path project:, location:, group: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/groups/#{group}" + end + + ## + # Create a fully-qualified Image resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/global/images/{image}` + # + # @param project [String] + # @param image [String] + # + # @return [::String] + def image_path project:, image: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + + "projects/#{project}/global/images/#{image}" + end + + ## + # Create a fully-qualified ImageImport resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/imageImports/{job}` + # + # @param project [String] + # @param location [String] + # @param job [String] + # + # @return [::String] + def image_import_path project:, location:, job: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/imageImports/#{job}" + end + + ## + # Create a fully-qualified ImageImportJob resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/imageImports/{job}/imageImportJobs/{result}` + # + # @param project [String] + # @param location [String] + # @param job [String] + # @param result [String] + # + # @return [::String] + def image_import_job_path project:, location:, job:, result: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "job cannot contain /" if job.to_s.include? "/" + + "projects/#{project}/locations/#{location}/imageImports/#{job}/imageImportJobs/#{result}" + 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 MigratingVm resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/sources/{source}/migratingVms/{migrating_vm}` + # + # @param project [String] + # @param location [String] + # @param source [String] + # @param migrating_vm [String] + # + # @return [::String] + def migrating_vm_path project:, location:, source:, migrating_vm: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "source cannot contain /" if source.to_s.include? "/" + + "projects/#{project}/locations/#{location}/sources/#{source}/migratingVms/#{migrating_vm}" + end + + ## + # Create a fully-qualified ReplicationCycle resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/sources/{source}/migratingVms/{migrating_vm}/replicationCycles/{replication_cycle}` + # + # @param project [String] + # @param location [String] + # @param source [String] + # @param migrating_vm [String] + # @param replication_cycle [String] + # + # @return [::String] + def replication_cycle_path project:, location:, source:, migrating_vm:, replication_cycle: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "source cannot contain /" if source.to_s.include? "/" + raise ::ArgumentError, "migrating_vm cannot contain /" if migrating_vm.to_s.include? "/" + + "projects/#{project}/locations/#{location}/sources/#{source}/migratingVms/#{migrating_vm}/replicationCycles/#{replication_cycle}" + end + + ## + # Create a fully-qualified ServiceAccount resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/serviceAccounts/{service_account}` + # + # @param project [String] + # @param service_account [String] + # + # @return [::String] + def service_account_path project:, service_account: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + + "projects/#{project}/serviceAccounts/#{service_account}" + end + + ## + # Create a fully-qualified Source resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/sources/{source}` + # + # @param project [String] + # @param location [String] + # @param source [String] + # + # @return [::String] + def source_path project:, location:, source: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/sources/#{source}" + end + + ## + # Create a fully-qualified TargetProject resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/targetProjects/{target_project}` + # + # @param project [String] + # @param location [String] + # @param target_project [String] + # + # @return [::String] + def target_project_path project:, location:, target_project: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/targetProjects/#{target_project}" + end + + ## + # Create a fully-qualified UtilizationReport resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/sources/{source}/utilizationReports/{utilization_report}` + # + # @param project [String] + # @param location [String] + # @param source [String] + # @param utilization_report [String] + # + # @return [::String] + def utilization_report_path project:, location:, source:, utilization_report: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "source cannot contain /" if source.to_s.include? "/" + + "projects/#{project}/locations/#{location}/sources/#{source}/utilizationReports/#{utilization_report}" + end + + extend self + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-vm_migration-v1/lib/google/cloud/vm_migration/v1/vm_migration/rest.rb b/owl-bot-staging/google-cloud-vm_migration-v1/lib/google/cloud/vm_migration/v1/vm_migration/rest.rb new file mode 100644 index 000000000000..96d212cd440f --- /dev/null +++ b/owl-bot-staging/google-cloud-vm_migration-v1/lib/google/cloud/vm_migration/v1/vm_migration/rest.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! + +require "gapic/rest" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/vm_migration/v1/version" +require "google/cloud/vm_migration/v1/bindings_override" + +require "google/cloud/vm_migration/v1/vm_migration/credentials" +require "google/cloud/vm_migration/v1/vm_migration/paths" +require "google/cloud/vm_migration/v1/vm_migration/rest/operations" +require "google/cloud/vm_migration/v1/vm_migration/rest/client" + +module Google + module Cloud + module VMMigration + module V1 + ## + # VM Migration Service + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/vm_migration/v1/vm_migration/rest" + # client = ::Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new + # + module VMMigration + # Client for the REST transport + module Rest + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "rest", "helpers.rb" +require "google/cloud/vm_migration/v1/vm_migration/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-vm_migration-v1/lib/google/cloud/vm_migration/v1/vm_migration/rest/client.rb b/owl-bot-staging/google-cloud-vm_migration-v1/lib/google/cloud/vm_migration/v1/vm_migration/rest/client.rb new file mode 100644 index 000000000000..3fd2441a1728 --- /dev/null +++ b/owl-bot-staging/google-cloud-vm_migration-v1/lib/google/cloud/vm_migration/v1/vm_migration/rest/client.rb @@ -0,0 +1,6704 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/vmmigration/v1/vmmigration_pb" +require "google/cloud/vm_migration/v1/vm_migration/rest/service_stub" +require "google/cloud/location/rest" + +module Google + module Cloud + module VMMigration + module V1 + module VMMigration + module Rest + ## + # REST client for the VmMigration service. + # + # VM Migration Service + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "vmmigration.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :vm_migration_stub + + ## + # Configure the VmMigration Client class. + # + # See {::Google::Cloud::VMMigration::V1::VMMigration::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all VmMigration clients + # ::Google::Cloud::VMMigration::V1::VMMigration::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", "VMMigration", "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.timeout = 60.0 + + default_config.rpcs.create_source.timeout = 900.0 + + default_config.rpcs.fetch_inventory.timeout = 300.0 + + default_config.rpcs.create_utilization_report.timeout = 300.0 + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the VmMigration 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::VMMigration::V1::VMMigration::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 + @vm_migration_stub.universe_domain + end + + ## + # Create a new VmMigration REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the VmMigration 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::VMMigration::V1::VMMigration::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 + + @vm_migration_stub = ::Google::Cloud::VMMigration::V1::VMMigration::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials, + logger: @config.logger + ) + + @vm_migration_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 = @vm_migration_stub.endpoint + config.universe_domain = @vm_migration_stub.universe_domain + config.bindings_override = @config.bindings_override + config.logger = @vm_migration_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::VMMigration::V1::VMMigration::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 + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @vm_migration_stub.logger + end + + # Service calls + + ## + # Lists Sources in a given project and location. + # + # @overload list_sources(request, options = nil) + # Pass arguments to `list_sources` via a request object, either of type + # {::Google::Cloud::VMMigration::V1::ListSourcesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VMMigration::V1::ListSourcesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_sources(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) + # Pass arguments to `list_sources` via keyword arguments. Note that at + # least one keyword argument is 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 parent, which owns this collection of sources. + # @param page_size [::Integer] + # Optional. The maximum number of sources to return. The service may return + # fewer than this value. If unspecified, at most 500 sources will be + # returned. The maximum value is 1000; values above 1000 will be coerced to + # 1000. + # @param page_token [::String] + # Required. A page token, received from a previous `ListSources` call. + # Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to `ListSources` must + # match the call that provided the page token. + # @param filter [::String] + # Optional. The filter request. + # @param order_by [::String] + # Optional. the order by fields for the result. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::VMMigration::V1::Source>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::VMMigration::V1::Source>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/vm_migration/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VMMigration::V1::ListSourcesRequest.new + # + # # Call the list_sources method. + # result = client.list_sources 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::VMMigration::V1::Source. + # p item + # end + # + def list_sources request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::ListSourcesRequest + + # Converts hash 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_sources.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::VMMigration::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_sources.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_sources.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vm_migration_stub.list_sources request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @vm_migration_stub, :list_sources, "sources", 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 details of a single Source. + # + # @overload get_source(request, options = nil) + # Pass arguments to `get_source` via a request object, either of type + # {::Google::Cloud::VMMigration::V1::GetSourceRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VMMigration::V1::GetSourceRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_source(name: nil) + # Pass arguments to `get_source` via keyword arguments. Note that at + # least one keyword argument is 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 Source name. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::VMMigration::V1::Source] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::VMMigration::V1::Source] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/vm_migration/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VMMigration::V1::GetSourceRequest.new + # + # # Call the get_source method. + # result = client.get_source request + # + # # The returned object is of type Google::Cloud::VMMigration::V1::Source. + # p result + # + def get_source request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::GetSourceRequest + + # Converts hash 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_source.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::VMMigration::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_source.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_source.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vm_migration_stub.get_source 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 Source in a given project and location. + # + # @overload create_source(request, options = nil) + # Pass arguments to `create_source` via a request object, either of type + # {::Google::Cloud::VMMigration::V1::CreateSourceRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VMMigration::V1::CreateSourceRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_source(parent: nil, source_id: nil, source: nil, request_id: nil) + # Pass arguments to `create_source` via keyword arguments. Note that at + # least one keyword argument is 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 Source's parent. + # @param source_id [::String] + # Required. The source identifier. + # @param source [::Google::Cloud::VMMigration::V1::Source, ::Hash] + # Required. The create request body. + # @param request_id [::String] + # A request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server will guarantee + # that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @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/vm_migration/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VMMigration::V1::CreateSourceRequest.new + # + # # Call the create_source method. + # result = client.create_source 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_source request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::CreateSourceRequest + + # Converts hash 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_source.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::VMMigration::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_source.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_source.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vm_migration_stub.create_source 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 + + ## + # Updates the parameters of a single Source. + # + # @overload update_source(request, options = nil) + # Pass arguments to `update_source` via a request object, either of type + # {::Google::Cloud::VMMigration::V1::UpdateSourceRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VMMigration::V1::UpdateSourceRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_source(update_mask: nil, source: nil, request_id: nil) + # Pass arguments to `update_source` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Field mask is used to specify the fields to be overwritten in the + # Source resource by the update. + # The fields specified in the update_mask are relative to the resource, not + # the full request. A field will be overwritten if it is in the mask. If the + # user does not provide a mask then all fields will be overwritten. + # @param source [::Google::Cloud::VMMigration::V1::Source, ::Hash] + # Required. The update request body. + # @param request_id [::String] + # A request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server will guarantee + # that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @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/vm_migration/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VMMigration::V1::UpdateSourceRequest.new + # + # # Call the update_source method. + # result = client.update_source 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 update_source request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::UpdateSourceRequest + + # Converts hash 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_source.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::VMMigration::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_source.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_source.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vm_migration_stub.update_source 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 single Source. + # + # @overload delete_source(request, options = nil) + # Pass arguments to `delete_source` via a request object, either of type + # {::Google::Cloud::VMMigration::V1::DeleteSourceRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VMMigration::V1::DeleteSourceRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_source(name: nil, request_id: nil) + # Pass arguments to `delete_source` via keyword arguments. Note that at + # least one keyword argument is 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 Source name. + # @param request_id [::String] + # Optional. A request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server will guarantee + # that for at least 60 minutes after the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @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/vm_migration/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VMMigration::V1::DeleteSourceRequest.new + # + # # Call the delete_source method. + # result = client.delete_source 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_source request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::DeleteSourceRequest + + # Converts hash 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_source.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::VMMigration::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_source.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_source.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vm_migration_stub.delete_source 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 + + ## + # List remote source's inventory of VMs. + # The remote source is the onprem vCenter (remote in the sense it's not in + # Compute Engine). The inventory describes the list of existing VMs in that + # source. Note that this operation lists the VMs on the remote source, as + # opposed to listing the MigratingVms resources in the vmmigration service. + # + # @overload fetch_inventory(request, options = nil) + # Pass arguments to `fetch_inventory` via a request object, either of type + # {::Google::Cloud::VMMigration::V1::FetchInventoryRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VMMigration::V1::FetchInventoryRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload fetch_inventory(source: nil, force_refresh: nil) + # Pass arguments to `fetch_inventory` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param source [::String] + # Required. The name of the Source. + # @param force_refresh [::Boolean] + # If this flag is set to true, the source will be queried instead of using + # cached results. Using this flag will make the call slower. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::VMMigration::V1::FetchInventoryResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::VMMigration::V1::FetchInventoryResponse] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/vm_migration/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VMMigration::V1::FetchInventoryRequest.new + # + # # Call the fetch_inventory method. + # result = client.fetch_inventory request + # + # # The returned object is of type Google::Cloud::VMMigration::V1::FetchInventoryResponse. + # p result + # + def fetch_inventory request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::FetchInventoryRequest + + # Converts hash 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.fetch_inventory.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::VMMigration::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.fetch_inventory.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.fetch_inventory.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vm_migration_stub.fetch_inventory 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 + + ## + # List remote source's inventory of storage resources. + # The remote source is another cloud vendor (e.g. AWS, Azure). + # The inventory describes the list of existing storage resources in that + # source. Note that this operation lists the resources on the remote source, + # as opposed to listing the MigratingVms resources in the vmmigration + # service. + # + # @overload fetch_storage_inventory(request, options = nil) + # Pass arguments to `fetch_storage_inventory` via a request object, either of type + # {::Google::Cloud::VMMigration::V1::FetchStorageInventoryRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VMMigration::V1::FetchStorageInventoryRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload fetch_storage_inventory(source: nil, type: nil, force_refresh: nil, page_size: nil, page_token: nil) + # Pass arguments to `fetch_storage_inventory` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param source [::String] + # Required. The name of the Source. + # @param type [::Google::Cloud::VMMigration::V1::FetchStorageInventoryRequest::StorageType] + # Required. The type of the storage inventory to fetch. + # @param force_refresh [::Boolean] + # Optional. If this flag is set to true, the source will be queried instead + # of using cached results. Using this flag will make the call slower. + # @param page_size [::Integer] + # Optional. The maximum number of VMs to return. The service may return + # fewer than this value. + # @param page_token [::String] + # Optional. A page token, received from a previous `FetchStorageInventory` + # call. Provide this to retrieve the subsequent page. When paginating, all + # other parameters provided to `FetchStorageInventory` must match the call + # that provided the page token. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::VMMigration::V1::SourceStorageResource>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::VMMigration::V1::SourceStorageResource>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/vm_migration/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VMMigration::V1::FetchStorageInventoryRequest.new + # + # # Call the fetch_storage_inventory method. + # result = client.fetch_storage_inventory 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::VMMigration::V1::SourceStorageResource. + # p item + # end + # + def fetch_storage_inventory request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::FetchStorageInventoryRequest + + # Converts hash 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.fetch_storage_inventory.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::VMMigration::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.fetch_storage_inventory.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.fetch_storage_inventory.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vm_migration_stub.fetch_storage_inventory request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @vm_migration_stub, :fetch_storage_inventory, "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 + + ## + # Lists Utilization Reports of the given Source. + # + # @overload list_utilization_reports(request, options = nil) + # Pass arguments to `list_utilization_reports` via a request object, either of type + # {::Google::Cloud::VMMigration::V1::ListUtilizationReportsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VMMigration::V1::ListUtilizationReportsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_utilization_reports(parent: nil, view: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) + # Pass arguments to `list_utilization_reports` via keyword arguments. Note that at + # least one keyword argument is 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 Utilization Reports parent. + # @param view [::Google::Cloud::VMMigration::V1::UtilizationReportView] + # Optional. The level of details of each report. + # Defaults to BASIC. + # @param page_size [::Integer] + # Optional. The maximum number of reports to return. The service may return + # fewer than this value. If unspecified, at most 500 reports will be + # returned. The maximum value is 1000; values above 1000 will be coerced to + # 1000. + # @param page_token [::String] + # Required. A page token, received from a previous `ListUtilizationReports` + # call. Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to `ListUtilizationReports` + # must match the call that provided the page token. + # @param filter [::String] + # Optional. The filter request. + # @param order_by [::String] + # Optional. the order by fields for the result. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::VMMigration::V1::UtilizationReport>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::VMMigration::V1::UtilizationReport>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/vm_migration/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VMMigration::V1::ListUtilizationReportsRequest.new + # + # # Call the list_utilization_reports method. + # result = client.list_utilization_reports 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::VMMigration::V1::UtilizationReport. + # p item + # end + # + def list_utilization_reports request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::ListUtilizationReportsRequest + + # Converts hash 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_utilization_reports.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::VMMigration::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_utilization_reports.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_utilization_reports.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vm_migration_stub.list_utilization_reports request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @vm_migration_stub, :list_utilization_reports, "utilization_reports", 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 a single Utilization Report. + # + # @overload get_utilization_report(request, options = nil) + # Pass arguments to `get_utilization_report` via a request object, either of type + # {::Google::Cloud::VMMigration::V1::GetUtilizationReportRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VMMigration::V1::GetUtilizationReportRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_utilization_report(name: nil, view: nil) + # Pass arguments to `get_utilization_report` via keyword arguments. Note that at + # least one keyword argument is 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 Utilization Report name. + # @param view [::Google::Cloud::VMMigration::V1::UtilizationReportView] + # Optional. The level of details of the report. + # Defaults to FULL + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::VMMigration::V1::UtilizationReport] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::VMMigration::V1::UtilizationReport] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/vm_migration/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VMMigration::V1::GetUtilizationReportRequest.new + # + # # Call the get_utilization_report method. + # result = client.get_utilization_report request + # + # # The returned object is of type Google::Cloud::VMMigration::V1::UtilizationReport. + # p result + # + def get_utilization_report request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::GetUtilizationReportRequest + + # Converts hash 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_utilization_report.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::VMMigration::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_utilization_report.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_utilization_report.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vm_migration_stub.get_utilization_report 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 UtilizationReport. + # + # @overload create_utilization_report(request, options = nil) + # Pass arguments to `create_utilization_report` via a request object, either of type + # {::Google::Cloud::VMMigration::V1::CreateUtilizationReportRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VMMigration::V1::CreateUtilizationReportRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_utilization_report(parent: nil, utilization_report: nil, utilization_report_id: nil, request_id: nil) + # Pass arguments to `create_utilization_report` via keyword arguments. Note that at + # least one keyword argument is 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 Utilization Report's parent. + # @param utilization_report [::Google::Cloud::VMMigration::V1::UtilizationReport, ::Hash] + # Required. The report to create. + # @param utilization_report_id [::String] + # Required. The ID to use for the report, which will become the final + # component of the reports's resource name. + # + # This value maximum length is 63 characters, and valid characters + # are /[a-z][0-9]-/. It must start with an english letter and must not + # end with a hyphen. + # @param request_id [::String] + # A request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server will guarantee + # that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @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/vm_migration/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VMMigration::V1::CreateUtilizationReportRequest.new + # + # # Call the create_utilization_report method. + # result = client.create_utilization_report 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_utilization_report request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::CreateUtilizationReportRequest + + # Converts hash 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_utilization_report.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::VMMigration::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_utilization_report.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_utilization_report.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vm_migration_stub.create_utilization_report 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 single Utilization Report. + # + # @overload delete_utilization_report(request, options = nil) + # Pass arguments to `delete_utilization_report` via a request object, either of type + # {::Google::Cloud::VMMigration::V1::DeleteUtilizationReportRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VMMigration::V1::DeleteUtilizationReportRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_utilization_report(name: nil, request_id: nil) + # Pass arguments to `delete_utilization_report` via keyword arguments. Note that at + # least one keyword argument is 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 Utilization Report name. + # @param request_id [::String] + # Optional. A request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server will guarantee + # that for at least 60 minutes after the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @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/vm_migration/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VMMigration::V1::DeleteUtilizationReportRequest.new + # + # # Call the delete_utilization_report method. + # result = client.delete_utilization_report 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_utilization_report request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::DeleteUtilizationReportRequest + + # Converts hash 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_utilization_report.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::VMMigration::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_utilization_report.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_utilization_report.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vm_migration_stub.delete_utilization_report 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 + + ## + # Lists DatacenterConnectors in a given Source. + # + # @overload list_datacenter_connectors(request, options = nil) + # Pass arguments to `list_datacenter_connectors` via a request object, either of type + # {::Google::Cloud::VMMigration::V1::ListDatacenterConnectorsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VMMigration::V1::ListDatacenterConnectorsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_datacenter_connectors(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) + # Pass arguments to `list_datacenter_connectors` via keyword arguments. Note that at + # least one keyword argument is 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 parent, which owns this collection of connectors. + # @param page_size [::Integer] + # Optional. The maximum number of connectors to return. The service may + # return fewer than this value. If unspecified, at most 500 sources will be + # returned. The maximum value is 1000; values above 1000 will be coerced to + # 1000. + # @param page_token [::String] + # Required. A page token, received from a previous `ListDatacenterConnectors` + # call. Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to + # `ListDatacenterConnectors` must match the call that provided the page + # token. + # @param filter [::String] + # Optional. The filter request. + # @param order_by [::String] + # Optional. the order by fields for the result. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::VMMigration::V1::DatacenterConnector>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::VMMigration::V1::DatacenterConnector>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/vm_migration/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VMMigration::V1::ListDatacenterConnectorsRequest.new + # + # # Call the list_datacenter_connectors method. + # result = client.list_datacenter_connectors 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::VMMigration::V1::DatacenterConnector. + # p item + # end + # + def list_datacenter_connectors request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::ListDatacenterConnectorsRequest + + # Converts hash 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_datacenter_connectors.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::VMMigration::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_datacenter_connectors.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_datacenter_connectors.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vm_migration_stub.list_datacenter_connectors request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @vm_migration_stub, :list_datacenter_connectors, "datacenter_connectors", 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 details of a single DatacenterConnector. + # + # @overload get_datacenter_connector(request, options = nil) + # Pass arguments to `get_datacenter_connector` via a request object, either of type + # {::Google::Cloud::VMMigration::V1::GetDatacenterConnectorRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VMMigration::V1::GetDatacenterConnectorRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_datacenter_connector(name: nil) + # Pass arguments to `get_datacenter_connector` via keyword arguments. Note that at + # least one keyword argument is 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 name of the DatacenterConnector. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::VMMigration::V1::DatacenterConnector] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::VMMigration::V1::DatacenterConnector] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/vm_migration/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VMMigration::V1::GetDatacenterConnectorRequest.new + # + # # Call the get_datacenter_connector method. + # result = client.get_datacenter_connector request + # + # # The returned object is of type Google::Cloud::VMMigration::V1::DatacenterConnector. + # p result + # + def get_datacenter_connector request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::GetDatacenterConnectorRequest + + # Converts hash 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_datacenter_connector.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::VMMigration::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_datacenter_connector.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_datacenter_connector.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vm_migration_stub.get_datacenter_connector 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 DatacenterConnector in a given Source. + # + # @overload create_datacenter_connector(request, options = nil) + # Pass arguments to `create_datacenter_connector` via a request object, either of type + # {::Google::Cloud::VMMigration::V1::CreateDatacenterConnectorRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VMMigration::V1::CreateDatacenterConnectorRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_datacenter_connector(parent: nil, datacenter_connector_id: nil, datacenter_connector: nil, request_id: nil) + # Pass arguments to `create_datacenter_connector` via keyword arguments. Note that at + # least one keyword argument is 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 DatacenterConnector's parent. + # Required. The Source in where the new DatacenterConnector will be created. + # For example: + # `projects/my-project/locations/us-central1/sources/my-source` + # @param datacenter_connector_id [::String] + # Required. The datacenterConnector identifier. + # @param datacenter_connector [::Google::Cloud::VMMigration::V1::DatacenterConnector, ::Hash] + # Required. The create request body. + # @param request_id [::String] + # A request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server will guarantee + # that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @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/vm_migration/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VMMigration::V1::CreateDatacenterConnectorRequest.new + # + # # Call the create_datacenter_connector method. + # result = client.create_datacenter_connector 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_datacenter_connector request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::CreateDatacenterConnectorRequest + + # Converts hash 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_datacenter_connector.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::VMMigration::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_datacenter_connector.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_datacenter_connector.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vm_migration_stub.create_datacenter_connector 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 single DatacenterConnector. + # + # @overload delete_datacenter_connector(request, options = nil) + # Pass arguments to `delete_datacenter_connector` via a request object, either of type + # {::Google::Cloud::VMMigration::V1::DeleteDatacenterConnectorRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VMMigration::V1::DeleteDatacenterConnectorRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_datacenter_connector(name: nil, request_id: nil) + # Pass arguments to `delete_datacenter_connector` via keyword arguments. Note that at + # least one keyword argument is 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 DatacenterConnector name. + # @param request_id [::String] + # A request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server will guarantee + # that for at least 60 minutes after the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @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/vm_migration/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VMMigration::V1::DeleteDatacenterConnectorRequest.new + # + # # Call the delete_datacenter_connector method. + # result = client.delete_datacenter_connector 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_datacenter_connector request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::DeleteDatacenterConnectorRequest + + # Converts hash 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_datacenter_connector.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::VMMigration::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_datacenter_connector.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_datacenter_connector.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vm_migration_stub.delete_datacenter_connector 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 + + ## + # Upgrades the appliance relate to this DatacenterConnector to the in-place + # updateable version. + # + # @overload upgrade_appliance(request, options = nil) + # Pass arguments to `upgrade_appliance` via a request object, either of type + # {::Google::Cloud::VMMigration::V1::UpgradeApplianceRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VMMigration::V1::UpgradeApplianceRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload upgrade_appliance(datacenter_connector: nil, request_id: nil) + # Pass arguments to `upgrade_appliance` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param datacenter_connector [::String] + # Required. The DatacenterConnector name. + # @param request_id [::String] + # A request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server will guarantee + # that for at least 60 minutes after the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @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/vm_migration/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VMMigration::V1::UpgradeApplianceRequest.new + # + # # Call the upgrade_appliance method. + # result = client.upgrade_appliance 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 upgrade_appliance request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::UpgradeApplianceRequest + + # Converts hash 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.upgrade_appliance.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::VMMigration::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.upgrade_appliance.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.upgrade_appliance.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vm_migration_stub.upgrade_appliance 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 MigratingVm in a given Source. + # + # @overload create_migrating_vm(request, options = nil) + # Pass arguments to `create_migrating_vm` via a request object, either of type + # {::Google::Cloud::VMMigration::V1::CreateMigratingVmRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VMMigration::V1::CreateMigratingVmRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_migrating_vm(parent: nil, migrating_vm_id: nil, migrating_vm: nil, request_id: nil) + # Pass arguments to `create_migrating_vm` via keyword arguments. Note that at + # least one keyword argument is 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 MigratingVm's parent. + # @param migrating_vm_id [::String] + # Required. The migratingVm identifier. + # @param migrating_vm [::Google::Cloud::VMMigration::V1::MigratingVm, ::Hash] + # Required. The create request body. + # @param request_id [::String] + # A request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server will guarantee + # that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @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/vm_migration/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VMMigration::V1::CreateMigratingVmRequest.new + # + # # Call the create_migrating_vm method. + # result = client.create_migrating_vm 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_migrating_vm request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::CreateMigratingVmRequest + + # Converts hash 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_migrating_vm.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::VMMigration::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_migrating_vm.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_migrating_vm.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vm_migration_stub.create_migrating_vm 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 + + ## + # Lists MigratingVms in a given Source. + # + # @overload list_migrating_vms(request, options = nil) + # Pass arguments to `list_migrating_vms` via a request object, either of type + # {::Google::Cloud::VMMigration::V1::ListMigratingVmsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VMMigration::V1::ListMigratingVmsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_migrating_vms(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil, view: nil) + # Pass arguments to `list_migrating_vms` via keyword arguments. Note that at + # least one keyword argument is 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 parent, which owns this collection of MigratingVms. + # @param page_size [::Integer] + # Optional. The maximum number of migrating VMs to return. The service may + # return fewer than this value. If unspecified, at most 500 migrating VMs + # will be returned. The maximum value is 1000; values above 1000 will be + # coerced to 1000. + # @param page_token [::String] + # Required. A page token, received from a previous `ListMigratingVms` call. + # Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to `ListMigratingVms` + # must match the call that provided the page token. + # @param filter [::String] + # Optional. The filter request. + # @param order_by [::String] + # Optional. the order by fields for the result. + # @param view [::Google::Cloud::VMMigration::V1::MigratingVmView] + # Optional. The level of details of each migrating VM. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::VMMigration::V1::MigratingVm>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::VMMigration::V1::MigratingVm>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/vm_migration/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VMMigration::V1::ListMigratingVmsRequest.new + # + # # Call the list_migrating_vms method. + # result = client.list_migrating_vms 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::VMMigration::V1::MigratingVm. + # p item + # end + # + def list_migrating_vms request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::ListMigratingVmsRequest + + # Converts hash 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_migrating_vms.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::VMMigration::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_migrating_vms.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_migrating_vms.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vm_migration_stub.list_migrating_vms request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @vm_migration_stub, :list_migrating_vms, "migrating_vms", 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 details of a single MigratingVm. + # + # @overload get_migrating_vm(request, options = nil) + # Pass arguments to `get_migrating_vm` via a request object, either of type + # {::Google::Cloud::VMMigration::V1::GetMigratingVmRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VMMigration::V1::GetMigratingVmRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_migrating_vm(name: nil, view: nil) + # Pass arguments to `get_migrating_vm` via keyword arguments. Note that at + # least one keyword argument is 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 name of the MigratingVm. + # @param view [::Google::Cloud::VMMigration::V1::MigratingVmView] + # Optional. The level of details of the migrating VM. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::VMMigration::V1::MigratingVm] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::VMMigration::V1::MigratingVm] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/vm_migration/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VMMigration::V1::GetMigratingVmRequest.new + # + # # Call the get_migrating_vm method. + # result = client.get_migrating_vm request + # + # # The returned object is of type Google::Cloud::VMMigration::V1::MigratingVm. + # p result + # + def get_migrating_vm request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::GetMigratingVmRequest + + # Converts hash 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_migrating_vm.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::VMMigration::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_migrating_vm.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_migrating_vm.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vm_migration_stub.get_migrating_vm 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 parameters of a single MigratingVm. + # + # @overload update_migrating_vm(request, options = nil) + # Pass arguments to `update_migrating_vm` via a request object, either of type + # {::Google::Cloud::VMMigration::V1::UpdateMigratingVmRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VMMigration::V1::UpdateMigratingVmRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_migrating_vm(update_mask: nil, migrating_vm: nil, request_id: nil) + # Pass arguments to `update_migrating_vm` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Field mask is used to specify the fields to be overwritten in the + # MigratingVm resource by the update. + # The fields specified in the update_mask are relative to the resource, not + # the full request. A field will be overwritten if it is in the mask. If the + # user does not provide a mask then all fields will be overwritten. + # @param migrating_vm [::Google::Cloud::VMMigration::V1::MigratingVm, ::Hash] + # Required. The update request body. + # @param request_id [::String] + # A request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server will guarantee + # that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @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/vm_migration/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VMMigration::V1::UpdateMigratingVmRequest.new + # + # # Call the update_migrating_vm method. + # result = client.update_migrating_vm 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 update_migrating_vm request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::UpdateMigratingVmRequest + + # Converts hash 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_migrating_vm.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::VMMigration::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_migrating_vm.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_migrating_vm.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vm_migration_stub.update_migrating_vm 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 single MigratingVm. + # + # @overload delete_migrating_vm(request, options = nil) + # Pass arguments to `delete_migrating_vm` via a request object, either of type + # {::Google::Cloud::VMMigration::V1::DeleteMigratingVmRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VMMigration::V1::DeleteMigratingVmRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_migrating_vm(name: nil) + # Pass arguments to `delete_migrating_vm` via keyword arguments. Note that at + # least one keyword argument is 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 name of the MigratingVm. + # @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/vm_migration/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VMMigration::V1::DeleteMigratingVmRequest.new + # + # # Call the delete_migrating_vm method. + # result = client.delete_migrating_vm 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_migrating_vm request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::DeleteMigratingVmRequest + + # Converts hash 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_migrating_vm.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::VMMigration::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_migrating_vm.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_migrating_vm.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vm_migration_stub.delete_migrating_vm 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 + + ## + # Starts migration for a VM. Starts the process of uploading + # data and creating snapshots, in replication cycles scheduled by the policy. + # + # @overload start_migration(request, options = nil) + # Pass arguments to `start_migration` via a request object, either of type + # {::Google::Cloud::VMMigration::V1::StartMigrationRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VMMigration::V1::StartMigrationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload start_migration(migrating_vm: nil) + # Pass arguments to `start_migration` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param migrating_vm [::String] + # Required. The name of the MigratingVm. + # @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/vm_migration/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VMMigration::V1::StartMigrationRequest.new + # + # # Call the start_migration method. + # result = client.start_migration 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 start_migration request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::StartMigrationRequest + + # Converts hash 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.start_migration.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::VMMigration::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.start_migration.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.start_migration.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vm_migration_stub.start_migration 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 + + ## + # Resumes a migration for a VM. When called on a paused migration, will start + # the process of uploading data and creating snapshots; when called on a + # completed cut-over migration, will update the migration to active state and + # start the process of uploading data and creating snapshots. + # + # @overload resume_migration(request, options = nil) + # Pass arguments to `resume_migration` via a request object, either of type + # {::Google::Cloud::VMMigration::V1::ResumeMigrationRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VMMigration::V1::ResumeMigrationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload resume_migration(migrating_vm: nil) + # Pass arguments to `resume_migration` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param migrating_vm [::String] + # Required. The name of the MigratingVm. + # @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/vm_migration/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VMMigration::V1::ResumeMigrationRequest.new + # + # # Call the resume_migration method. + # result = client.resume_migration 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 resume_migration request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::ResumeMigrationRequest + + # Converts hash 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.resume_migration.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::VMMigration::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.resume_migration.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.resume_migration.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vm_migration_stub.resume_migration 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 + + ## + # Pauses a migration for a VM. If cycle tasks are running they will be + # cancelled, preserving source task data. Further replication cycles will not + # be triggered while the VM is paused. + # + # @overload pause_migration(request, options = nil) + # Pass arguments to `pause_migration` via a request object, either of type + # {::Google::Cloud::VMMigration::V1::PauseMigrationRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VMMigration::V1::PauseMigrationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload pause_migration(migrating_vm: nil) + # Pass arguments to `pause_migration` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param migrating_vm [::String] + # Required. The name of the MigratingVm. + # @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/vm_migration/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VMMigration::V1::PauseMigrationRequest.new + # + # # Call the pause_migration method. + # result = client.pause_migration 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 pause_migration request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::PauseMigrationRequest + + # Converts hash 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.pause_migration.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::VMMigration::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.pause_migration.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.pause_migration.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vm_migration_stub.pause_migration 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 + + ## + # Marks a migration as completed, deleting migration resources that are no + # longer being used. Only applicable after cutover is done. + # + # @overload finalize_migration(request, options = nil) + # Pass arguments to `finalize_migration` via a request object, either of type + # {::Google::Cloud::VMMigration::V1::FinalizeMigrationRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VMMigration::V1::FinalizeMigrationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload finalize_migration(migrating_vm: nil) + # Pass arguments to `finalize_migration` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param migrating_vm [::String] + # Required. The name of the MigratingVm. + # @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/vm_migration/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VMMigration::V1::FinalizeMigrationRequest.new + # + # # Call the finalize_migration method. + # result = client.finalize_migration 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 finalize_migration request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::FinalizeMigrationRequest + + # Converts hash 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.finalize_migration.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::VMMigration::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.finalize_migration.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.finalize_migration.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vm_migration_stub.finalize_migration 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 + + ## + # Extend the migrating VM time to live. + # + # @overload extend_migration(request, options = nil) + # Pass arguments to `extend_migration` via a request object, either of type + # {::Google::Cloud::VMMigration::V1::ExtendMigrationRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VMMigration::V1::ExtendMigrationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload extend_migration(migrating_vm: nil) + # Pass arguments to `extend_migration` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param migrating_vm [::String] + # Required. The name of the MigratingVm. + # @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/vm_migration/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VMMigration::V1::ExtendMigrationRequest.new + # + # # Call the extend_migration method. + # result = client.extend_migration 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 extend_migration request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::ExtendMigrationRequest + + # Converts hash 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.extend_migration.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::VMMigration::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.extend_migration.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.extend_migration.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vm_migration_stub.extend_migration 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 + + ## + # Initiates a Clone of a specific migrating VM. + # + # @overload create_clone_job(request, options = nil) + # Pass arguments to `create_clone_job` via a request object, either of type + # {::Google::Cloud::VMMigration::V1::CreateCloneJobRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VMMigration::V1::CreateCloneJobRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_clone_job(parent: nil, clone_job_id: nil, clone_job: nil, request_id: nil) + # Pass arguments to `create_clone_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 Clone's parent. + # @param clone_job_id [::String] + # Required. The clone job identifier. + # @param clone_job [::Google::Cloud::VMMigration::V1::CloneJob, ::Hash] + # Required. The clone request body. + # @param request_id [::String] + # A request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server will guarantee + # that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @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/vm_migration/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VMMigration::V1::CreateCloneJobRequest.new + # + # # Call the create_clone_job method. + # result = client.create_clone_job 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_clone_job request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::CreateCloneJobRequest + + # Converts hash 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_clone_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::VMMigration::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_clone_job.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_clone_job.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vm_migration_stub.create_clone_job 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 + + ## + # Initiates the cancellation of a running clone job. + # + # @overload cancel_clone_job(request, options = nil) + # Pass arguments to `cancel_clone_job` via a request object, either of type + # {::Google::Cloud::VMMigration::V1::CancelCloneJobRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VMMigration::V1::CancelCloneJobRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_clone_job(name: nil) + # Pass arguments to `cancel_clone_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 clone job id + # @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/vm_migration/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VMMigration::V1::CancelCloneJobRequest.new + # + # # Call the cancel_clone_job method. + # result = client.cancel_clone_job 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 cancel_clone_job request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::CancelCloneJobRequest + + # Converts hash 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_clone_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::VMMigration::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_clone_job.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.cancel_clone_job.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vm_migration_stub.cancel_clone_job 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 + + ## + # Lists the CloneJobs of a migrating VM. Only 25 most recent CloneJobs are + # listed. + # + # @overload list_clone_jobs(request, options = nil) + # Pass arguments to `list_clone_jobs` via a request object, either of type + # {::Google::Cloud::VMMigration::V1::ListCloneJobsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VMMigration::V1::ListCloneJobsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_clone_jobs(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) + # Pass arguments to `list_clone_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 parent, which owns this collection of source VMs. + # @param page_size [::Integer] + # Optional. The maximum number of clone jobs to return. The service may + # return fewer than this value. If unspecified, at most 500 clone jobs will + # be returned. The maximum value is 1000; values above 1000 will be coerced + # to 1000. + # @param page_token [::String] + # Required. A page token, received from a previous `ListCloneJobs` call. + # Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to `ListCloneJobs` must + # match the call that provided the page token. + # @param filter [::String] + # Optional. The filter request. + # @param order_by [::String] + # Optional. the order by fields for the result. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::VMMigration::V1::CloneJob>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::VMMigration::V1::CloneJob>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/vm_migration/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VMMigration::V1::ListCloneJobsRequest.new + # + # # Call the list_clone_jobs method. + # result = client.list_clone_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::VMMigration::V1::CloneJob. + # p item + # end + # + def list_clone_jobs request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::ListCloneJobsRequest + + # Converts hash 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_clone_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::VMMigration::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_clone_jobs.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_clone_jobs.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vm_migration_stub.list_clone_jobs request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @vm_migration_stub, :list_clone_jobs, "clone_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 + + ## + # Gets details of a single CloneJob. + # + # @overload get_clone_job(request, options = nil) + # Pass arguments to `get_clone_job` via a request object, either of type + # {::Google::Cloud::VMMigration::V1::GetCloneJobRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VMMigration::V1::GetCloneJobRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_clone_job(name: nil) + # Pass arguments to `get_clone_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 name of the CloneJob. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::VMMigration::V1::CloneJob] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::VMMigration::V1::CloneJob] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/vm_migration/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VMMigration::V1::GetCloneJobRequest.new + # + # # Call the get_clone_job method. + # result = client.get_clone_job request + # + # # The returned object is of type Google::Cloud::VMMigration::V1::CloneJob. + # p result + # + def get_clone_job request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::GetCloneJobRequest + + # Converts hash 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_clone_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::VMMigration::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_clone_job.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_clone_job.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vm_migration_stub.get_clone_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 + + ## + # Initiates a Cutover of a specific migrating VM. + # The returned LRO is completed when the cutover job resource is created + # and the job is initiated. + # + # @overload create_cutover_job(request, options = nil) + # Pass arguments to `create_cutover_job` via a request object, either of type + # {::Google::Cloud::VMMigration::V1::CreateCutoverJobRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VMMigration::V1::CreateCutoverJobRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_cutover_job(parent: nil, cutover_job_id: nil, cutover_job: nil, request_id: nil) + # Pass arguments to `create_cutover_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 Cutover's parent. + # @param cutover_job_id [::String] + # Required. The cutover job identifier. + # @param cutover_job [::Google::Cloud::VMMigration::V1::CutoverJob, ::Hash] + # Required. The cutover request body. + # @param request_id [::String] + # A request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server will guarantee + # that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @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/vm_migration/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VMMigration::V1::CreateCutoverJobRequest.new + # + # # Call the create_cutover_job method. + # result = client.create_cutover_job 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_cutover_job request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::CreateCutoverJobRequest + + # Converts hash 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_cutover_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::VMMigration::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_cutover_job.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_cutover_job.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vm_migration_stub.create_cutover_job 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 + + ## + # Initiates the cancellation of a running cutover job. + # + # @overload cancel_cutover_job(request, options = nil) + # Pass arguments to `cancel_cutover_job` via a request object, either of type + # {::Google::Cloud::VMMigration::V1::CancelCutoverJobRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VMMigration::V1::CancelCutoverJobRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_cutover_job(name: nil) + # Pass arguments to `cancel_cutover_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 cutover job id + # @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/vm_migration/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VMMigration::V1::CancelCutoverJobRequest.new + # + # # Call the cancel_cutover_job method. + # result = client.cancel_cutover_job 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 cancel_cutover_job request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::CancelCutoverJobRequest + + # Converts hash 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_cutover_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::VMMigration::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_cutover_job.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.cancel_cutover_job.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vm_migration_stub.cancel_cutover_job 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 + + ## + # Lists the CutoverJobs of a migrating VM. Only 25 most recent CutoverJobs + # are listed. + # + # @overload list_cutover_jobs(request, options = nil) + # Pass arguments to `list_cutover_jobs` via a request object, either of type + # {::Google::Cloud::VMMigration::V1::ListCutoverJobsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VMMigration::V1::ListCutoverJobsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_cutover_jobs(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) + # Pass arguments to `list_cutover_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 parent, which owns this collection of migrating VMs. + # @param page_size [::Integer] + # Optional. The maximum number of cutover jobs to return. The service may + # return fewer than this value. If unspecified, at most 500 cutover jobs will + # be returned. The maximum value is 1000; values above 1000 will be coerced + # to 1000. + # @param page_token [::String] + # Required. A page token, received from a previous `ListCutoverJobs` call. + # Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to `ListCutoverJobs` must + # match the call that provided the page token. + # @param filter [::String] + # Optional. The filter request. + # @param order_by [::String] + # Optional. the order by fields for the result. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::VMMigration::V1::CutoverJob>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::VMMigration::V1::CutoverJob>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/vm_migration/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VMMigration::V1::ListCutoverJobsRequest.new + # + # # Call the list_cutover_jobs method. + # result = client.list_cutover_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::VMMigration::V1::CutoverJob. + # p item + # end + # + def list_cutover_jobs request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::ListCutoverJobsRequest + + # Converts hash 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_cutover_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::VMMigration::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_cutover_jobs.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_cutover_jobs.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vm_migration_stub.list_cutover_jobs request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @vm_migration_stub, :list_cutover_jobs, "cutover_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 + + ## + # Gets details of a single CutoverJob. + # + # @overload get_cutover_job(request, options = nil) + # Pass arguments to `get_cutover_job` via a request object, either of type + # {::Google::Cloud::VMMigration::V1::GetCutoverJobRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VMMigration::V1::GetCutoverJobRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_cutover_job(name: nil) + # Pass arguments to `get_cutover_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 name of the CutoverJob. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::VMMigration::V1::CutoverJob] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::VMMigration::V1::CutoverJob] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/vm_migration/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VMMigration::V1::GetCutoverJobRequest.new + # + # # Call the get_cutover_job method. + # result = client.get_cutover_job request + # + # # The returned object is of type Google::Cloud::VMMigration::V1::CutoverJob. + # p result + # + def get_cutover_job request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::GetCutoverJobRequest + + # Converts hash 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_cutover_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::VMMigration::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_cutover_job.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_cutover_job.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vm_migration_stub.get_cutover_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 + + ## + # Lists Groups in a given project and location. + # + # @overload list_groups(request, options = nil) + # Pass arguments to `list_groups` via a request object, either of type + # {::Google::Cloud::VMMigration::V1::ListGroupsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VMMigration::V1::ListGroupsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_groups(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) + # Pass arguments to `list_groups` via keyword arguments. Note that at + # least one keyword argument is 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 parent, which owns this collection of groups. + # @param page_size [::Integer] + # Optional. The maximum number of groups to return. The service may return + # fewer than this value. If unspecified, at most 500 groups will be + # returned. The maximum value is 1000; values above 1000 will be coerced to + # 1000. + # @param page_token [::String] + # Required. A page token, received from a previous `ListGroups` call. + # Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to `ListGroups` must + # match the call that provided the page token. + # @param filter [::String] + # Optional. The filter request. + # @param order_by [::String] + # Optional. the order by fields for the result. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::VMMigration::V1::Group>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::VMMigration::V1::Group>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/vm_migration/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VMMigration::V1::ListGroupsRequest.new + # + # # Call the list_groups method. + # result = client.list_groups 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::VMMigration::V1::Group. + # p item + # end + # + def list_groups request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::ListGroupsRequest + + # Converts hash 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_groups.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::VMMigration::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_groups.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_groups.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vm_migration_stub.list_groups request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @vm_migration_stub, :list_groups, "groups", 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 details of a single Group. + # + # @overload get_group(request, options = nil) + # Pass arguments to `get_group` via a request object, either of type + # {::Google::Cloud::VMMigration::V1::GetGroupRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VMMigration::V1::GetGroupRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_group(name: nil) + # Pass arguments to `get_group` via keyword arguments. Note that at + # least one keyword argument is 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 group name. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::VMMigration::V1::Group] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::VMMigration::V1::Group] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/vm_migration/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VMMigration::V1::GetGroupRequest.new + # + # # Call the get_group method. + # result = client.get_group request + # + # # The returned object is of type Google::Cloud::VMMigration::V1::Group. + # p result + # + def get_group request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::GetGroupRequest + + # Converts hash 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_group.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::VMMigration::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_group.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_group.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vm_migration_stub.get_group 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 Group in a given project and location. + # + # @overload create_group(request, options = nil) + # Pass arguments to `create_group` via a request object, either of type + # {::Google::Cloud::VMMigration::V1::CreateGroupRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VMMigration::V1::CreateGroupRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_group(parent: nil, group_id: nil, group: nil, request_id: nil) + # Pass arguments to `create_group` via keyword arguments. Note that at + # least one keyword argument is 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 Group's parent. + # @param group_id [::String] + # Required. The group identifier. + # @param group [::Google::Cloud::VMMigration::V1::Group, ::Hash] + # Required. The create request body. + # @param request_id [::String] + # A request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server will guarantee + # that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @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/vm_migration/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VMMigration::V1::CreateGroupRequest.new + # + # # Call the create_group method. + # result = client.create_group 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_group request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::CreateGroupRequest + + # Converts hash 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_group.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::VMMigration::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_group.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_group.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vm_migration_stub.create_group 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 + + ## + # Updates the parameters of a single Group. + # + # @overload update_group(request, options = nil) + # Pass arguments to `update_group` via a request object, either of type + # {::Google::Cloud::VMMigration::V1::UpdateGroupRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VMMigration::V1::UpdateGroupRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_group(update_mask: nil, group: nil, request_id: nil) + # Pass arguments to `update_group` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Field mask is used to specify the fields to be overwritten in the + # Group resource by the update. + # The fields specified in the update_mask are relative to the resource, not + # the full request. A field will be overwritten if it is in the mask. If the + # user does not provide a mask then all fields will be overwritten. + # @param group [::Google::Cloud::VMMigration::V1::Group, ::Hash] + # Required. The update request body. + # @param request_id [::String] + # A request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server will guarantee + # that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @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/vm_migration/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VMMigration::V1::UpdateGroupRequest.new + # + # # Call the update_group method. + # result = client.update_group 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 update_group request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::UpdateGroupRequest + + # Converts hash 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_group.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::VMMigration::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_group.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_group.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vm_migration_stub.update_group 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 single Group. + # + # @overload delete_group(request, options = nil) + # Pass arguments to `delete_group` via a request object, either of type + # {::Google::Cloud::VMMigration::V1::DeleteGroupRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VMMigration::V1::DeleteGroupRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_group(name: nil, request_id: nil) + # Pass arguments to `delete_group` via keyword arguments. Note that at + # least one keyword argument is 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 Group name. + # @param request_id [::String] + # Optional. A request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server will guarantee + # that for at least 60 minutes after the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @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/vm_migration/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VMMigration::V1::DeleteGroupRequest.new + # + # # Call the delete_group method. + # result = client.delete_group 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_group request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::DeleteGroupRequest + + # Converts hash 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_group.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::VMMigration::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_group.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_group.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vm_migration_stub.delete_group 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 + + ## + # Adds a MigratingVm to a Group. + # + # @overload add_group_migration(request, options = nil) + # Pass arguments to `add_group_migration` via a request object, either of type + # {::Google::Cloud::VMMigration::V1::AddGroupMigrationRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VMMigration::V1::AddGroupMigrationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload add_group_migration(group: nil, migrating_vm: nil) + # Pass arguments to `add_group_migration` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param group [::String] + # Required. The full path name of the Group to add to. + # @param migrating_vm [::String] + # The full path name of the MigratingVm to add. + # @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/vm_migration/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VMMigration::V1::AddGroupMigrationRequest.new + # + # # Call the add_group_migration method. + # result = client.add_group_migration 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 add_group_migration request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::AddGroupMigrationRequest + + # Converts hash 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.add_group_migration.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::VMMigration::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.add_group_migration.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.add_group_migration.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vm_migration_stub.add_group_migration 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 + + ## + # Removes a MigratingVm from a Group. + # + # @overload remove_group_migration(request, options = nil) + # Pass arguments to `remove_group_migration` via a request object, either of type + # {::Google::Cloud::VMMigration::V1::RemoveGroupMigrationRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VMMigration::V1::RemoveGroupMigrationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload remove_group_migration(group: nil, migrating_vm: nil) + # Pass arguments to `remove_group_migration` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param group [::String] + # Required. The name of the Group. + # @param migrating_vm [::String] + # The MigratingVm to remove. + # @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/vm_migration/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VMMigration::V1::RemoveGroupMigrationRequest.new + # + # # Call the remove_group_migration method. + # result = client.remove_group_migration 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 remove_group_migration request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::RemoveGroupMigrationRequest + + # Converts hash 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.remove_group_migration.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::VMMigration::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.remove_group_migration.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.remove_group_migration.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vm_migration_stub.remove_group_migration 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 + + ## + # Lists TargetProjects in a given project. + # + # NOTE: TargetProject is a global resource; hence the only supported value + # for location is `global`. + # + # @overload list_target_projects(request, options = nil) + # Pass arguments to `list_target_projects` via a request object, either of type + # {::Google::Cloud::VMMigration::V1::ListTargetProjectsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VMMigration::V1::ListTargetProjectsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_target_projects(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) + # Pass arguments to `list_target_projects` via keyword arguments. Note that at + # least one keyword argument is 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 parent, which owns this collection of targets. + # @param page_size [::Integer] + # Optional. The maximum number of targets to return. The service may return + # fewer than this value. If unspecified, at most 500 targets will be + # returned. The maximum value is 1000; values above 1000 will be coerced to + # 1000. + # @param page_token [::String] + # Required. A page token, received from a previous `ListTargets` call. + # Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to `ListTargets` must + # match the call that provided the page token. + # @param filter [::String] + # Optional. The filter request. + # @param order_by [::String] + # Optional. the order by fields for the result. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::VMMigration::V1::TargetProject>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::VMMigration::V1::TargetProject>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/vm_migration/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VMMigration::V1::ListTargetProjectsRequest.new + # + # # Call the list_target_projects method. + # result = client.list_target_projects 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::VMMigration::V1::TargetProject. + # p item + # end + # + def list_target_projects request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::ListTargetProjectsRequest + + # Converts hash 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_target_projects.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::VMMigration::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_target_projects.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_target_projects.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vm_migration_stub.list_target_projects request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @vm_migration_stub, :list_target_projects, "target_projects", 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 details of a single TargetProject. + # + # NOTE: TargetProject is a global resource; hence the only supported value + # for location is `global`. + # + # @overload get_target_project(request, options = nil) + # Pass arguments to `get_target_project` via a request object, either of type + # {::Google::Cloud::VMMigration::V1::GetTargetProjectRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VMMigration::V1::GetTargetProjectRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_target_project(name: nil) + # Pass arguments to `get_target_project` via keyword arguments. Note that at + # least one keyword argument is 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 TargetProject name. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::VMMigration::V1::TargetProject] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::VMMigration::V1::TargetProject] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/vm_migration/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VMMigration::V1::GetTargetProjectRequest.new + # + # # Call the get_target_project method. + # result = client.get_target_project request + # + # # The returned object is of type Google::Cloud::VMMigration::V1::TargetProject. + # p result + # + def get_target_project request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::GetTargetProjectRequest + + # Converts hash 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_target_project.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::VMMigration::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_target_project.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_target_project.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vm_migration_stub.get_target_project 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 TargetProject in a given project. + # + # NOTE: TargetProject is a global resource; hence the only supported value + # for location is `global`. + # + # @overload create_target_project(request, options = nil) + # Pass arguments to `create_target_project` via a request object, either of type + # {::Google::Cloud::VMMigration::V1::CreateTargetProjectRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VMMigration::V1::CreateTargetProjectRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_target_project(parent: nil, target_project_id: nil, target_project: nil, request_id: nil) + # Pass arguments to `create_target_project` via keyword arguments. Note that at + # least one keyword argument is 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 TargetProject's parent. + # @param target_project_id [::String] + # Required. The target_project identifier. + # @param target_project [::Google::Cloud::VMMigration::V1::TargetProject, ::Hash] + # Required. The create request body. + # @param request_id [::String] + # A request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server will guarantee + # that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @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/vm_migration/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VMMigration::V1::CreateTargetProjectRequest.new + # + # # Call the create_target_project method. + # result = client.create_target_project 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_target_project request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::CreateTargetProjectRequest + + # Converts hash 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_target_project.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::VMMigration::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_target_project.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_target_project.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vm_migration_stub.create_target_project 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 + + ## + # Updates the parameters of a single TargetProject. + # + # NOTE: TargetProject is a global resource; hence the only supported value + # for location is `global`. + # + # @overload update_target_project(request, options = nil) + # Pass arguments to `update_target_project` via a request object, either of type + # {::Google::Cloud::VMMigration::V1::UpdateTargetProjectRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VMMigration::V1::UpdateTargetProjectRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_target_project(update_mask: nil, target_project: nil, request_id: nil) + # Pass arguments to `update_target_project` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Field mask is used to specify the fields to be overwritten in the + # TargetProject resource by the update. + # The fields specified in the update_mask are relative to the resource, not + # the full request. A field will be overwritten if it is in the mask. If the + # user does not provide a mask then all fields will be overwritten. + # @param target_project [::Google::Cloud::VMMigration::V1::TargetProject, ::Hash] + # Required. The update request body. + # @param request_id [::String] + # A request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server will guarantee + # that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @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/vm_migration/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VMMigration::V1::UpdateTargetProjectRequest.new + # + # # Call the update_target_project method. + # result = client.update_target_project 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 update_target_project request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::UpdateTargetProjectRequest + + # Converts hash 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_target_project.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::VMMigration::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_target_project.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_target_project.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vm_migration_stub.update_target_project 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 single TargetProject. + # + # NOTE: TargetProject is a global resource; hence the only supported value + # for location is `global`. + # + # @overload delete_target_project(request, options = nil) + # Pass arguments to `delete_target_project` via a request object, either of type + # {::Google::Cloud::VMMigration::V1::DeleteTargetProjectRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VMMigration::V1::DeleteTargetProjectRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_target_project(name: nil, request_id: nil) + # Pass arguments to `delete_target_project` via keyword arguments. Note that at + # least one keyword argument is 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 TargetProject name. + # @param request_id [::String] + # Optional. A request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server will guarantee + # that for at least 60 minutes after the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @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/vm_migration/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VMMigration::V1::DeleteTargetProjectRequest.new + # + # # Call the delete_target_project method. + # result = client.delete_target_project 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_target_project request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::DeleteTargetProjectRequest + + # Converts hash 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_target_project.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::VMMigration::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_target_project.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_target_project.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vm_migration_stub.delete_target_project 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 + + ## + # Lists ReplicationCycles in a given MigratingVM. + # + # @overload list_replication_cycles(request, options = nil) + # Pass arguments to `list_replication_cycles` via a request object, either of type + # {::Google::Cloud::VMMigration::V1::ListReplicationCyclesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VMMigration::V1::ListReplicationCyclesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_replication_cycles(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) + # Pass arguments to `list_replication_cycles` via keyword arguments. Note that at + # least one keyword argument is 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 parent, which owns this collection of ReplicationCycles. + # @param page_size [::Integer] + # Optional. The maximum number of replication cycles to return. The service + # may return fewer than this value. If unspecified, at most 100 migrating VMs + # will be returned. The maximum value is 100; values above 100 will be + # coerced to 100. + # @param page_token [::String] + # Required. A page token, received from a previous `ListReplicationCycles` + # call. Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to `ListReplicationCycles` + # must match the call that provided the page token. + # @param filter [::String] + # Optional. The filter request. + # @param order_by [::String] + # Optional. the order by fields for the result. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::VMMigration::V1::ReplicationCycle>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::VMMigration::V1::ReplicationCycle>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/vm_migration/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VMMigration::V1::ListReplicationCyclesRequest.new + # + # # Call the list_replication_cycles method. + # result = client.list_replication_cycles 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::VMMigration::V1::ReplicationCycle. + # p item + # end + # + def list_replication_cycles request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::ListReplicationCyclesRequest + + # Converts hash 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_replication_cycles.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::VMMigration::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_replication_cycles.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_replication_cycles.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vm_migration_stub.list_replication_cycles request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @vm_migration_stub, :list_replication_cycles, "replication_cycles", 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 details of a single ReplicationCycle. + # + # @overload get_replication_cycle(request, options = nil) + # Pass arguments to `get_replication_cycle` via a request object, either of type + # {::Google::Cloud::VMMigration::V1::GetReplicationCycleRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VMMigration::V1::GetReplicationCycleRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_replication_cycle(name: nil) + # Pass arguments to `get_replication_cycle` via keyword arguments. Note that at + # least one keyword argument is 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 name of the ReplicationCycle. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::VMMigration::V1::ReplicationCycle] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::VMMigration::V1::ReplicationCycle] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/vm_migration/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VMMigration::V1::GetReplicationCycleRequest.new + # + # # Call the get_replication_cycle method. + # result = client.get_replication_cycle request + # + # # The returned object is of type Google::Cloud::VMMigration::V1::ReplicationCycle. + # p result + # + def get_replication_cycle request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::GetReplicationCycleRequest + + # Converts hash 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_replication_cycle.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::VMMigration::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_replication_cycle.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_replication_cycle.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vm_migration_stub.get_replication_cycle 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 ImageImports in a given project. + # + # @overload list_image_imports(request, options = nil) + # Pass arguments to `list_image_imports` via a request object, either of type + # {::Google::Cloud::VMMigration::V1::ListImageImportsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VMMigration::V1::ListImageImportsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_image_imports(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) + # Pass arguments to `list_image_imports` via keyword arguments. Note that at + # least one keyword argument is 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 parent, which owns this collection of targets. + # @param page_size [::Integer] + # Optional. The maximum number of targets to return. The service may return + # fewer than this value. If unspecified, at most 500 targets will be + # returned. The maximum value is 1000; values above 1000 will be coerced to + # 1000. + # @param page_token [::String] + # Optional. A page token, received from a previous `ListImageImports` call. + # Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to `ListImageImports` must + # match the call that provided the page token. + # @param filter [::String] + # Optional. The filter request (according to AIP-160). + # @param order_by [::String] + # Optional. The order by fields for the result (according to AIP-132). + # Currently ordering is only possible by "name" field. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::VMMigration::V1::ImageImport>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::VMMigration::V1::ImageImport>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/vm_migration/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VMMigration::V1::ListImageImportsRequest.new + # + # # Call the list_image_imports method. + # result = client.list_image_imports 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::VMMigration::V1::ImageImport. + # p item + # end + # + def list_image_imports request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::ListImageImportsRequest + + # Converts hash 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_image_imports.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::VMMigration::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_image_imports.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_image_imports.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vm_migration_stub.list_image_imports request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @vm_migration_stub, :list_image_imports, "image_imports", 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 details of a single ImageImport. + # + # @overload get_image_import(request, options = nil) + # Pass arguments to `get_image_import` via a request object, either of type + # {::Google::Cloud::VMMigration::V1::GetImageImportRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VMMigration::V1::GetImageImportRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_image_import(name: nil) + # Pass arguments to `get_image_import` via keyword arguments. Note that at + # least one keyword argument is 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 ImageImport name. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::VMMigration::V1::ImageImport] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::VMMigration::V1::ImageImport] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/vm_migration/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VMMigration::V1::GetImageImportRequest.new + # + # # Call the get_image_import method. + # result = client.get_image_import request + # + # # The returned object is of type Google::Cloud::VMMigration::V1::ImageImport. + # p result + # + def get_image_import request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::GetImageImportRequest + + # Converts hash 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_image_import.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::VMMigration::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_image_import.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_image_import.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vm_migration_stub.get_image_import 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 ImageImport in a given project. + # + # @overload create_image_import(request, options = nil) + # Pass arguments to `create_image_import` via a request object, either of type + # {::Google::Cloud::VMMigration::V1::CreateImageImportRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VMMigration::V1::CreateImageImportRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_image_import(parent: nil, image_import_id: nil, image_import: nil, request_id: nil) + # Pass arguments to `create_image_import` via keyword arguments. Note that at + # least one keyword argument is 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 ImageImport's parent. + # @param image_import_id [::String] + # Required. The image import identifier. + # This value maximum length is 63 characters, and valid characters are + # /[a-z][0-9]-/. It must start with an english letter and must not end with a + # hyphen. + # @param image_import [::Google::Cloud::VMMigration::V1::ImageImport, ::Hash] + # Required. The create request body. + # @param request_id [::String] + # Optional. A request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server will guarantee + # that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @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/vm_migration/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VMMigration::V1::CreateImageImportRequest.new + # + # # Call the create_image_import method. + # result = client.create_image_import 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_image_import request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::CreateImageImportRequest + + # Converts hash 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_image_import.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::VMMigration::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_image_import.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_image_import.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vm_migration_stub.create_image_import 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 single ImageImport. + # + # @overload delete_image_import(request, options = nil) + # Pass arguments to `delete_image_import` via a request object, either of type + # {::Google::Cloud::VMMigration::V1::DeleteImageImportRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VMMigration::V1::DeleteImageImportRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_image_import(name: nil, request_id: nil) + # Pass arguments to `delete_image_import` via keyword arguments. Note that at + # least one keyword argument is 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 ImageImport name. + # @param request_id [::String] + # Optional. A request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server will guarantee + # that for at least 60 minutes after the first request. + # + # For example, consider a situation where you make an initial request and t + # he request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @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/vm_migration/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VMMigration::V1::DeleteImageImportRequest.new + # + # # Call the delete_image_import method. + # result = client.delete_image_import 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_image_import request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::DeleteImageImportRequest + + # Converts hash 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_image_import.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::VMMigration::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_image_import.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_image_import.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vm_migration_stub.delete_image_import 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 + + ## + # Lists ImageImportJobs in a given project. + # + # @overload list_image_import_jobs(request, options = nil) + # Pass arguments to `list_image_import_jobs` via a request object, either of type + # {::Google::Cloud::VMMigration::V1::ListImageImportJobsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VMMigration::V1::ListImageImportJobsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_image_import_jobs(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) + # Pass arguments to `list_image_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 parent, which owns this collection of targets. + # @param page_size [::Integer] + # Optional. The maximum number of targets to return. The service may return + # fewer than this value. If unspecified, at most 500 targets will be + # returned. The maximum value is 1000; values above 1000 will be coerced to + # 1000. + # @param page_token [::String] + # Optional. A page token, received from a previous `ListImageImportJobs` + # call. Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to `ListImageImportJobs` + # must match the call that provided the page token. + # @param filter [::String] + # Optional. The filter request (according to AIP-160). + # @param order_by [::String] + # Optional. The order by fields for the result (according to AIP-132). + # Currently ordering is only possible by "name" field. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::VMMigration::V1::ImageImportJob>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::VMMigration::V1::ImageImportJob>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/vm_migration/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VMMigration::V1::ListImageImportJobsRequest.new + # + # # Call the list_image_import_jobs method. + # result = client.list_image_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::VMMigration::V1::ImageImportJob. + # p item + # end + # + def list_image_import_jobs request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::ListImageImportJobsRequest + + # Converts hash 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_image_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::VMMigration::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_image_import_jobs.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_image_import_jobs.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vm_migration_stub.list_image_import_jobs request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @vm_migration_stub, :list_image_import_jobs, "image_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 + + ## + # Gets details of a single ImageImportJob. + # + # @overload get_image_import_job(request, options = nil) + # Pass arguments to `get_image_import_job` via a request object, either of type + # {::Google::Cloud::VMMigration::V1::GetImageImportJobRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VMMigration::V1::GetImageImportJobRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_image_import_job(name: nil) + # Pass arguments to `get_image_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 ImageImportJob name. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::VMMigration::V1::ImageImportJob] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::VMMigration::V1::ImageImportJob] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/vm_migration/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VMMigration::V1::GetImageImportJobRequest.new + # + # # Call the get_image_import_job method. + # result = client.get_image_import_job request + # + # # The returned object is of type Google::Cloud::VMMigration::V1::ImageImportJob. + # p result + # + def get_image_import_job request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::GetImageImportJobRequest + + # Converts hash 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_image_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::VMMigration::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_image_import_job.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_image_import_job.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vm_migration_stub.get_image_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 + + ## + # Initiates the cancellation of a running ImageImportJob. + # + # @overload cancel_image_import_job(request, options = nil) + # Pass arguments to `cancel_image_import_job` via a request object, either of type + # {::Google::Cloud::VMMigration::V1::CancelImageImportJobRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VMMigration::V1::CancelImageImportJobRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_image_import_job(name: nil) + # Pass arguments to `cancel_image_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 image import job id. + # @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/vm_migration/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VMMigration::V1::CancelImageImportJobRequest.new + # + # # Call the cancel_image_import_job method. + # result = client.cancel_image_import_job 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 cancel_image_import_job request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::CancelImageImportJobRequest + + # Converts hash 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_image_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::VMMigration::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_image_import_job.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.cancel_image_import_job.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vm_migration_stub.cancel_image_import_job 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 disk migration job in a given Source. + # + # @overload create_disk_migration_job(request, options = nil) + # Pass arguments to `create_disk_migration_job` via a request object, either of type + # {::Google::Cloud::VMMigration::V1::CreateDiskMigrationJobRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VMMigration::V1::CreateDiskMigrationJobRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_disk_migration_job(parent: nil, disk_migration_job_id: nil, disk_migration_job: nil, request_id: nil) + # Pass arguments to `create_disk_migration_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 DiskMigrationJob's parent. + # @param disk_migration_job_id [::String] + # Required. The DiskMigrationJob identifier. + # The maximum length of this value is 63 characters. + # Valid characters are lower case Latin letters, digits and hyphen. + # It must start with a Latin letter and must not end with a hyphen. + # @param disk_migration_job [::Google::Cloud::VMMigration::V1::DiskMigrationJob, ::Hash] + # Required. The create request body. + # @param request_id [::String] + # Optional. A request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server will guarantee + # that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request timed out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @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/vm_migration/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VMMigration::V1::CreateDiskMigrationJobRequest.new + # + # # Call the create_disk_migration_job method. + # result = client.create_disk_migration_job 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_disk_migration_job request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::CreateDiskMigrationJobRequest + + # Converts hash 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_disk_migration_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::VMMigration::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_disk_migration_job.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_disk_migration_job.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vm_migration_stub.create_disk_migration_job 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 + + ## + # Lists DiskMigrationJobs in a given Source. + # + # @overload list_disk_migration_jobs(request, options = nil) + # Pass arguments to `list_disk_migration_jobs` via a request object, either of type + # {::Google::Cloud::VMMigration::V1::ListDiskMigrationJobsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VMMigration::V1::ListDiskMigrationJobsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_disk_migration_jobs(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) + # Pass arguments to `list_disk_migration_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 parent, which owns this collection of DiskMigrationJobs. + # @param page_size [::Integer] + # Optional. The maximum number of disk migration jobs to return. The service + # may return fewer than this value. If unspecified, at most 500 + # disk migration jobs will be returned. + # The maximum value is 1000; values above 1000 will be coerced to 1000. + # @param page_token [::String] + # Optional. A page token, received from a previous `ListDiskMigrationJobs` + # call. Provide this to retrieve the subsequent page. + # + # When paginating, all parameters provided to `ListDiskMigrationJobs` + # except `page_size` must match the call that provided the page token. + # @param filter [::String] + # Optional. The filter request (according to AIP-160). + # @param order_by [::String] + # Optional. Ordering of the result list. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::VMMigration::V1::DiskMigrationJob>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::VMMigration::V1::DiskMigrationJob>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/vm_migration/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VMMigration::V1::ListDiskMigrationJobsRequest.new + # + # # Call the list_disk_migration_jobs method. + # result = client.list_disk_migration_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::VMMigration::V1::DiskMigrationJob. + # p item + # end + # + def list_disk_migration_jobs request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::ListDiskMigrationJobsRequest + + # Converts hash 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_disk_migration_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::VMMigration::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_disk_migration_jobs.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_disk_migration_jobs.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vm_migration_stub.list_disk_migration_jobs request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @vm_migration_stub, :list_disk_migration_jobs, "disk_migration_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 + + ## + # Gets details of a single DiskMigrationJob. + # + # @overload get_disk_migration_job(request, options = nil) + # Pass arguments to `get_disk_migration_job` via a request object, either of type + # {::Google::Cloud::VMMigration::V1::GetDiskMigrationJobRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VMMigration::V1::GetDiskMigrationJobRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_disk_migration_job(name: nil) + # Pass arguments to `get_disk_migration_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 name of the DiskMigrationJob. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::VMMigration::V1::DiskMigrationJob] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::VMMigration::V1::DiskMigrationJob] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/vm_migration/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VMMigration::V1::GetDiskMigrationJobRequest.new + # + # # Call the get_disk_migration_job method. + # result = client.get_disk_migration_job request + # + # # The returned object is of type Google::Cloud::VMMigration::V1::DiskMigrationJob. + # p result + # + def get_disk_migration_job request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::GetDiskMigrationJobRequest + + # Converts hash 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_disk_migration_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::VMMigration::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_disk_migration_job.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_disk_migration_job.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vm_migration_stub.get_disk_migration_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 + + ## + # Updates the parameters of a single DiskMigrationJob. + # + # @overload update_disk_migration_job(request, options = nil) + # Pass arguments to `update_disk_migration_job` via a request object, either of type + # {::Google::Cloud::VMMigration::V1::UpdateDiskMigrationJobRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VMMigration::V1::UpdateDiskMigrationJobRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_disk_migration_job(update_mask: nil, disk_migration_job: nil, request_id: nil) + # Pass arguments to `update_disk_migration_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 update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Optional. Field mask is used to specify the fields to be overwritten in the + # DiskMigrationJob resource by the update. + # The fields specified in the update_mask are relative to the resource, not + # the full request. A field will be overwritten if it is in the mask. If the + # user does not provide a mask, then a mask equivalent to all fields that are + # populated (have a non-empty value), will be implied. + # @param disk_migration_job [::Google::Cloud::VMMigration::V1::DiskMigrationJob, ::Hash] + # Required. The update request body. + # @param request_id [::String] + # Optional. A request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server will guarantee + # that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request timed out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @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/vm_migration/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VMMigration::V1::UpdateDiskMigrationJobRequest.new + # + # # Call the update_disk_migration_job method. + # result = client.update_disk_migration_job 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 update_disk_migration_job request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::UpdateDiskMigrationJobRequest + + # Converts hash 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_disk_migration_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::VMMigration::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_disk_migration_job.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_disk_migration_job.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vm_migration_stub.update_disk_migration_job 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 single DiskMigrationJob. + # + # @overload delete_disk_migration_job(request, options = nil) + # Pass arguments to `delete_disk_migration_job` via a request object, either of type + # {::Google::Cloud::VMMigration::V1::DeleteDiskMigrationJobRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VMMigration::V1::DeleteDiskMigrationJobRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_disk_migration_job(name: nil) + # Pass arguments to `delete_disk_migration_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 name of the DiskMigrationJob. + # @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/vm_migration/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VMMigration::V1::DeleteDiskMigrationJobRequest.new + # + # # Call the delete_disk_migration_job method. + # result = client.delete_disk_migration_job 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_disk_migration_job request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::DeleteDiskMigrationJobRequest + + # Converts hash 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_disk_migration_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::VMMigration::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_disk_migration_job.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_disk_migration_job.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vm_migration_stub.delete_disk_migration_job 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 + + ## + # Runs the disk migration job. + # + # @overload run_disk_migration_job(request, options = nil) + # Pass arguments to `run_disk_migration_job` via a request object, either of type + # {::Google::Cloud::VMMigration::V1::RunDiskMigrationJobRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VMMigration::V1::RunDiskMigrationJobRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload run_disk_migration_job(name: nil) + # Pass arguments to `run_disk_migration_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 name of the DiskMigrationJob. + # @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/vm_migration/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VMMigration::V1::RunDiskMigrationJobRequest.new + # + # # Call the run_disk_migration_job method. + # result = client.run_disk_migration_job 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 run_disk_migration_job request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::RunDiskMigrationJobRequest + + # Converts hash 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.run_disk_migration_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::VMMigration::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.run_disk_migration_job.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.run_disk_migration_job.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vm_migration_stub.run_disk_migration_job 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 + + ## + # Cancels the disk migration job. + # + # @overload cancel_disk_migration_job(request, options = nil) + # Pass arguments to `cancel_disk_migration_job` via a request object, either of type + # {::Google::Cloud::VMMigration::V1::CancelDiskMigrationJobRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VMMigration::V1::CancelDiskMigrationJobRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_disk_migration_job(name: nil) + # Pass arguments to `cancel_disk_migration_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 name of the DiskMigrationJob. + # @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/vm_migration/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VMMigration::V1::CancelDiskMigrationJobRequest.new + # + # # Call the cancel_disk_migration_job method. + # result = client.cancel_disk_migration_job 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 cancel_disk_migration_job request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::CancelDiskMigrationJobRequest + + # Converts hash 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_disk_migration_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::VMMigration::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_disk_migration_job.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.cancel_disk_migration_job.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vm_migration_stub.cancel_disk_migration_job 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 + + ## + # Configuration class for the VmMigration REST API. + # + # This class represents the configuration for VmMigration 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::VMMigration::V1::VMMigration::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_sources to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_sources.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_sources.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 = "vmmigration.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 VmMigration 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_sources` + # @return [::Gapic::Config::Method] + # + attr_reader :list_sources + ## + # RPC-specific configuration for `get_source` + # @return [::Gapic::Config::Method] + # + attr_reader :get_source + ## + # RPC-specific configuration for `create_source` + # @return [::Gapic::Config::Method] + # + attr_reader :create_source + ## + # RPC-specific configuration for `update_source` + # @return [::Gapic::Config::Method] + # + attr_reader :update_source + ## + # RPC-specific configuration for `delete_source` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_source + ## + # RPC-specific configuration for `fetch_inventory` + # @return [::Gapic::Config::Method] + # + attr_reader :fetch_inventory + ## + # RPC-specific configuration for `fetch_storage_inventory` + # @return [::Gapic::Config::Method] + # + attr_reader :fetch_storage_inventory + ## + # RPC-specific configuration for `list_utilization_reports` + # @return [::Gapic::Config::Method] + # + attr_reader :list_utilization_reports + ## + # RPC-specific configuration for `get_utilization_report` + # @return [::Gapic::Config::Method] + # + attr_reader :get_utilization_report + ## + # RPC-specific configuration for `create_utilization_report` + # @return [::Gapic::Config::Method] + # + attr_reader :create_utilization_report + ## + # RPC-specific configuration for `delete_utilization_report` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_utilization_report + ## + # RPC-specific configuration for `list_datacenter_connectors` + # @return [::Gapic::Config::Method] + # + attr_reader :list_datacenter_connectors + ## + # RPC-specific configuration for `get_datacenter_connector` + # @return [::Gapic::Config::Method] + # + attr_reader :get_datacenter_connector + ## + # RPC-specific configuration for `create_datacenter_connector` + # @return [::Gapic::Config::Method] + # + attr_reader :create_datacenter_connector + ## + # RPC-specific configuration for `delete_datacenter_connector` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_datacenter_connector + ## + # RPC-specific configuration for `upgrade_appliance` + # @return [::Gapic::Config::Method] + # + attr_reader :upgrade_appliance + ## + # RPC-specific configuration for `create_migrating_vm` + # @return [::Gapic::Config::Method] + # + attr_reader :create_migrating_vm + ## + # RPC-specific configuration for `list_migrating_vms` + # @return [::Gapic::Config::Method] + # + attr_reader :list_migrating_vms + ## + # RPC-specific configuration for `get_migrating_vm` + # @return [::Gapic::Config::Method] + # + attr_reader :get_migrating_vm + ## + # RPC-specific configuration for `update_migrating_vm` + # @return [::Gapic::Config::Method] + # + attr_reader :update_migrating_vm + ## + # RPC-specific configuration for `delete_migrating_vm` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_migrating_vm + ## + # RPC-specific configuration for `start_migration` + # @return [::Gapic::Config::Method] + # + attr_reader :start_migration + ## + # RPC-specific configuration for `resume_migration` + # @return [::Gapic::Config::Method] + # + attr_reader :resume_migration + ## + # RPC-specific configuration for `pause_migration` + # @return [::Gapic::Config::Method] + # + attr_reader :pause_migration + ## + # RPC-specific configuration for `finalize_migration` + # @return [::Gapic::Config::Method] + # + attr_reader :finalize_migration + ## + # RPC-specific configuration for `extend_migration` + # @return [::Gapic::Config::Method] + # + attr_reader :extend_migration + ## + # RPC-specific configuration for `create_clone_job` + # @return [::Gapic::Config::Method] + # + attr_reader :create_clone_job + ## + # RPC-specific configuration for `cancel_clone_job` + # @return [::Gapic::Config::Method] + # + attr_reader :cancel_clone_job + ## + # RPC-specific configuration for `list_clone_jobs` + # @return [::Gapic::Config::Method] + # + attr_reader :list_clone_jobs + ## + # RPC-specific configuration for `get_clone_job` + # @return [::Gapic::Config::Method] + # + attr_reader :get_clone_job + ## + # RPC-specific configuration for `create_cutover_job` + # @return [::Gapic::Config::Method] + # + attr_reader :create_cutover_job + ## + # RPC-specific configuration for `cancel_cutover_job` + # @return [::Gapic::Config::Method] + # + attr_reader :cancel_cutover_job + ## + # RPC-specific configuration for `list_cutover_jobs` + # @return [::Gapic::Config::Method] + # + attr_reader :list_cutover_jobs + ## + # RPC-specific configuration for `get_cutover_job` + # @return [::Gapic::Config::Method] + # + attr_reader :get_cutover_job + ## + # RPC-specific configuration for `list_groups` + # @return [::Gapic::Config::Method] + # + attr_reader :list_groups + ## + # RPC-specific configuration for `get_group` + # @return [::Gapic::Config::Method] + # + attr_reader :get_group + ## + # RPC-specific configuration for `create_group` + # @return [::Gapic::Config::Method] + # + attr_reader :create_group + ## + # RPC-specific configuration for `update_group` + # @return [::Gapic::Config::Method] + # + attr_reader :update_group + ## + # RPC-specific configuration for `delete_group` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_group + ## + # RPC-specific configuration for `add_group_migration` + # @return [::Gapic::Config::Method] + # + attr_reader :add_group_migration + ## + # RPC-specific configuration for `remove_group_migration` + # @return [::Gapic::Config::Method] + # + attr_reader :remove_group_migration + ## + # RPC-specific configuration for `list_target_projects` + # @return [::Gapic::Config::Method] + # + attr_reader :list_target_projects + ## + # RPC-specific configuration for `get_target_project` + # @return [::Gapic::Config::Method] + # + attr_reader :get_target_project + ## + # RPC-specific configuration for `create_target_project` + # @return [::Gapic::Config::Method] + # + attr_reader :create_target_project + ## + # RPC-specific configuration for `update_target_project` + # @return [::Gapic::Config::Method] + # + attr_reader :update_target_project + ## + # RPC-specific configuration for `delete_target_project` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_target_project + ## + # RPC-specific configuration for `list_replication_cycles` + # @return [::Gapic::Config::Method] + # + attr_reader :list_replication_cycles + ## + # RPC-specific configuration for `get_replication_cycle` + # @return [::Gapic::Config::Method] + # + attr_reader :get_replication_cycle + ## + # RPC-specific configuration for `list_image_imports` + # @return [::Gapic::Config::Method] + # + attr_reader :list_image_imports + ## + # RPC-specific configuration for `get_image_import` + # @return [::Gapic::Config::Method] + # + attr_reader :get_image_import + ## + # RPC-specific configuration for `create_image_import` + # @return [::Gapic::Config::Method] + # + attr_reader :create_image_import + ## + # RPC-specific configuration for `delete_image_import` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_image_import + ## + # RPC-specific configuration for `list_image_import_jobs` + # @return [::Gapic::Config::Method] + # + attr_reader :list_image_import_jobs + ## + # RPC-specific configuration for `get_image_import_job` + # @return [::Gapic::Config::Method] + # + attr_reader :get_image_import_job + ## + # RPC-specific configuration for `cancel_image_import_job` + # @return [::Gapic::Config::Method] + # + attr_reader :cancel_image_import_job + ## + # RPC-specific configuration for `create_disk_migration_job` + # @return [::Gapic::Config::Method] + # + attr_reader :create_disk_migration_job + ## + # RPC-specific configuration for `list_disk_migration_jobs` + # @return [::Gapic::Config::Method] + # + attr_reader :list_disk_migration_jobs + ## + # RPC-specific configuration for `get_disk_migration_job` + # @return [::Gapic::Config::Method] + # + attr_reader :get_disk_migration_job + ## + # RPC-specific configuration for `update_disk_migration_job` + # @return [::Gapic::Config::Method] + # + attr_reader :update_disk_migration_job + ## + # RPC-specific configuration for `delete_disk_migration_job` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_disk_migration_job + ## + # RPC-specific configuration for `run_disk_migration_job` + # @return [::Gapic::Config::Method] + # + attr_reader :run_disk_migration_job + ## + # RPC-specific configuration for `cancel_disk_migration_job` + # @return [::Gapic::Config::Method] + # + attr_reader :cancel_disk_migration_job + + # @private + def initialize parent_rpcs = nil + list_sources_config = parent_rpcs.list_sources if parent_rpcs.respond_to? :list_sources + @list_sources = ::Gapic::Config::Method.new list_sources_config + get_source_config = parent_rpcs.get_source if parent_rpcs.respond_to? :get_source + @get_source = ::Gapic::Config::Method.new get_source_config + create_source_config = parent_rpcs.create_source if parent_rpcs.respond_to? :create_source + @create_source = ::Gapic::Config::Method.new create_source_config + update_source_config = parent_rpcs.update_source if parent_rpcs.respond_to? :update_source + @update_source = ::Gapic::Config::Method.new update_source_config + delete_source_config = parent_rpcs.delete_source if parent_rpcs.respond_to? :delete_source + @delete_source = ::Gapic::Config::Method.new delete_source_config + fetch_inventory_config = parent_rpcs.fetch_inventory if parent_rpcs.respond_to? :fetch_inventory + @fetch_inventory = ::Gapic::Config::Method.new fetch_inventory_config + fetch_storage_inventory_config = parent_rpcs.fetch_storage_inventory if parent_rpcs.respond_to? :fetch_storage_inventory + @fetch_storage_inventory = ::Gapic::Config::Method.new fetch_storage_inventory_config + list_utilization_reports_config = parent_rpcs.list_utilization_reports if parent_rpcs.respond_to? :list_utilization_reports + @list_utilization_reports = ::Gapic::Config::Method.new list_utilization_reports_config + get_utilization_report_config = parent_rpcs.get_utilization_report if parent_rpcs.respond_to? :get_utilization_report + @get_utilization_report = ::Gapic::Config::Method.new get_utilization_report_config + create_utilization_report_config = parent_rpcs.create_utilization_report if parent_rpcs.respond_to? :create_utilization_report + @create_utilization_report = ::Gapic::Config::Method.new create_utilization_report_config + delete_utilization_report_config = parent_rpcs.delete_utilization_report if parent_rpcs.respond_to? :delete_utilization_report + @delete_utilization_report = ::Gapic::Config::Method.new delete_utilization_report_config + list_datacenter_connectors_config = parent_rpcs.list_datacenter_connectors if parent_rpcs.respond_to? :list_datacenter_connectors + @list_datacenter_connectors = ::Gapic::Config::Method.new list_datacenter_connectors_config + get_datacenter_connector_config = parent_rpcs.get_datacenter_connector if parent_rpcs.respond_to? :get_datacenter_connector + @get_datacenter_connector = ::Gapic::Config::Method.new get_datacenter_connector_config + create_datacenter_connector_config = parent_rpcs.create_datacenter_connector if parent_rpcs.respond_to? :create_datacenter_connector + @create_datacenter_connector = ::Gapic::Config::Method.new create_datacenter_connector_config + delete_datacenter_connector_config = parent_rpcs.delete_datacenter_connector if parent_rpcs.respond_to? :delete_datacenter_connector + @delete_datacenter_connector = ::Gapic::Config::Method.new delete_datacenter_connector_config + upgrade_appliance_config = parent_rpcs.upgrade_appliance if parent_rpcs.respond_to? :upgrade_appliance + @upgrade_appliance = ::Gapic::Config::Method.new upgrade_appliance_config + create_migrating_vm_config = parent_rpcs.create_migrating_vm if parent_rpcs.respond_to? :create_migrating_vm + @create_migrating_vm = ::Gapic::Config::Method.new create_migrating_vm_config + list_migrating_vms_config = parent_rpcs.list_migrating_vms if parent_rpcs.respond_to? :list_migrating_vms + @list_migrating_vms = ::Gapic::Config::Method.new list_migrating_vms_config + get_migrating_vm_config = parent_rpcs.get_migrating_vm if parent_rpcs.respond_to? :get_migrating_vm + @get_migrating_vm = ::Gapic::Config::Method.new get_migrating_vm_config + update_migrating_vm_config = parent_rpcs.update_migrating_vm if parent_rpcs.respond_to? :update_migrating_vm + @update_migrating_vm = ::Gapic::Config::Method.new update_migrating_vm_config + delete_migrating_vm_config = parent_rpcs.delete_migrating_vm if parent_rpcs.respond_to? :delete_migrating_vm + @delete_migrating_vm = ::Gapic::Config::Method.new delete_migrating_vm_config + start_migration_config = parent_rpcs.start_migration if parent_rpcs.respond_to? :start_migration + @start_migration = ::Gapic::Config::Method.new start_migration_config + resume_migration_config = parent_rpcs.resume_migration if parent_rpcs.respond_to? :resume_migration + @resume_migration = ::Gapic::Config::Method.new resume_migration_config + pause_migration_config = parent_rpcs.pause_migration if parent_rpcs.respond_to? :pause_migration + @pause_migration = ::Gapic::Config::Method.new pause_migration_config + finalize_migration_config = parent_rpcs.finalize_migration if parent_rpcs.respond_to? :finalize_migration + @finalize_migration = ::Gapic::Config::Method.new finalize_migration_config + extend_migration_config = parent_rpcs.extend_migration if parent_rpcs.respond_to? :extend_migration + @extend_migration = ::Gapic::Config::Method.new extend_migration_config + create_clone_job_config = parent_rpcs.create_clone_job if parent_rpcs.respond_to? :create_clone_job + @create_clone_job = ::Gapic::Config::Method.new create_clone_job_config + cancel_clone_job_config = parent_rpcs.cancel_clone_job if parent_rpcs.respond_to? :cancel_clone_job + @cancel_clone_job = ::Gapic::Config::Method.new cancel_clone_job_config + list_clone_jobs_config = parent_rpcs.list_clone_jobs if parent_rpcs.respond_to? :list_clone_jobs + @list_clone_jobs = ::Gapic::Config::Method.new list_clone_jobs_config + get_clone_job_config = parent_rpcs.get_clone_job if parent_rpcs.respond_to? :get_clone_job + @get_clone_job = ::Gapic::Config::Method.new get_clone_job_config + create_cutover_job_config = parent_rpcs.create_cutover_job if parent_rpcs.respond_to? :create_cutover_job + @create_cutover_job = ::Gapic::Config::Method.new create_cutover_job_config + cancel_cutover_job_config = parent_rpcs.cancel_cutover_job if parent_rpcs.respond_to? :cancel_cutover_job + @cancel_cutover_job = ::Gapic::Config::Method.new cancel_cutover_job_config + list_cutover_jobs_config = parent_rpcs.list_cutover_jobs if parent_rpcs.respond_to? :list_cutover_jobs + @list_cutover_jobs = ::Gapic::Config::Method.new list_cutover_jobs_config + get_cutover_job_config = parent_rpcs.get_cutover_job if parent_rpcs.respond_to? :get_cutover_job + @get_cutover_job = ::Gapic::Config::Method.new get_cutover_job_config + list_groups_config = parent_rpcs.list_groups if parent_rpcs.respond_to? :list_groups + @list_groups = ::Gapic::Config::Method.new list_groups_config + get_group_config = parent_rpcs.get_group if parent_rpcs.respond_to? :get_group + @get_group = ::Gapic::Config::Method.new get_group_config + create_group_config = parent_rpcs.create_group if parent_rpcs.respond_to? :create_group + @create_group = ::Gapic::Config::Method.new create_group_config + update_group_config = parent_rpcs.update_group if parent_rpcs.respond_to? :update_group + @update_group = ::Gapic::Config::Method.new update_group_config + delete_group_config = parent_rpcs.delete_group if parent_rpcs.respond_to? :delete_group + @delete_group = ::Gapic::Config::Method.new delete_group_config + add_group_migration_config = parent_rpcs.add_group_migration if parent_rpcs.respond_to? :add_group_migration + @add_group_migration = ::Gapic::Config::Method.new add_group_migration_config + remove_group_migration_config = parent_rpcs.remove_group_migration if parent_rpcs.respond_to? :remove_group_migration + @remove_group_migration = ::Gapic::Config::Method.new remove_group_migration_config + list_target_projects_config = parent_rpcs.list_target_projects if parent_rpcs.respond_to? :list_target_projects + @list_target_projects = ::Gapic::Config::Method.new list_target_projects_config + get_target_project_config = parent_rpcs.get_target_project if parent_rpcs.respond_to? :get_target_project + @get_target_project = ::Gapic::Config::Method.new get_target_project_config + create_target_project_config = parent_rpcs.create_target_project if parent_rpcs.respond_to? :create_target_project + @create_target_project = ::Gapic::Config::Method.new create_target_project_config + update_target_project_config = parent_rpcs.update_target_project if parent_rpcs.respond_to? :update_target_project + @update_target_project = ::Gapic::Config::Method.new update_target_project_config + delete_target_project_config = parent_rpcs.delete_target_project if parent_rpcs.respond_to? :delete_target_project + @delete_target_project = ::Gapic::Config::Method.new delete_target_project_config + list_replication_cycles_config = parent_rpcs.list_replication_cycles if parent_rpcs.respond_to? :list_replication_cycles + @list_replication_cycles = ::Gapic::Config::Method.new list_replication_cycles_config + get_replication_cycle_config = parent_rpcs.get_replication_cycle if parent_rpcs.respond_to? :get_replication_cycle + @get_replication_cycle = ::Gapic::Config::Method.new get_replication_cycle_config + list_image_imports_config = parent_rpcs.list_image_imports if parent_rpcs.respond_to? :list_image_imports + @list_image_imports = ::Gapic::Config::Method.new list_image_imports_config + get_image_import_config = parent_rpcs.get_image_import if parent_rpcs.respond_to? :get_image_import + @get_image_import = ::Gapic::Config::Method.new get_image_import_config + create_image_import_config = parent_rpcs.create_image_import if parent_rpcs.respond_to? :create_image_import + @create_image_import = ::Gapic::Config::Method.new create_image_import_config + delete_image_import_config = parent_rpcs.delete_image_import if parent_rpcs.respond_to? :delete_image_import + @delete_image_import = ::Gapic::Config::Method.new delete_image_import_config + list_image_import_jobs_config = parent_rpcs.list_image_import_jobs if parent_rpcs.respond_to? :list_image_import_jobs + @list_image_import_jobs = ::Gapic::Config::Method.new list_image_import_jobs_config + get_image_import_job_config = parent_rpcs.get_image_import_job if parent_rpcs.respond_to? :get_image_import_job + @get_image_import_job = ::Gapic::Config::Method.new get_image_import_job_config + cancel_image_import_job_config = parent_rpcs.cancel_image_import_job if parent_rpcs.respond_to? :cancel_image_import_job + @cancel_image_import_job = ::Gapic::Config::Method.new cancel_image_import_job_config + create_disk_migration_job_config = parent_rpcs.create_disk_migration_job if parent_rpcs.respond_to? :create_disk_migration_job + @create_disk_migration_job = ::Gapic::Config::Method.new create_disk_migration_job_config + list_disk_migration_jobs_config = parent_rpcs.list_disk_migration_jobs if parent_rpcs.respond_to? :list_disk_migration_jobs + @list_disk_migration_jobs = ::Gapic::Config::Method.new list_disk_migration_jobs_config + get_disk_migration_job_config = parent_rpcs.get_disk_migration_job if parent_rpcs.respond_to? :get_disk_migration_job + @get_disk_migration_job = ::Gapic::Config::Method.new get_disk_migration_job_config + update_disk_migration_job_config = parent_rpcs.update_disk_migration_job if parent_rpcs.respond_to? :update_disk_migration_job + @update_disk_migration_job = ::Gapic::Config::Method.new update_disk_migration_job_config + delete_disk_migration_job_config = parent_rpcs.delete_disk_migration_job if parent_rpcs.respond_to? :delete_disk_migration_job + @delete_disk_migration_job = ::Gapic::Config::Method.new delete_disk_migration_job_config + run_disk_migration_job_config = parent_rpcs.run_disk_migration_job if parent_rpcs.respond_to? :run_disk_migration_job + @run_disk_migration_job = ::Gapic::Config::Method.new run_disk_migration_job_config + cancel_disk_migration_job_config = parent_rpcs.cancel_disk_migration_job if parent_rpcs.respond_to? :cancel_disk_migration_job + @cancel_disk_migration_job = ::Gapic::Config::Method.new cancel_disk_migration_job_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-vm_migration-v1/lib/google/cloud/vm_migration/v1/vm_migration/rest/operations.rb b/owl-bot-staging/google-cloud-vm_migration-v1/lib/google/cloud/vm_migration/v1/vm_migration/rest/operations.rb new file mode 100644 index 000000000000..e562fae43b9f --- /dev/null +++ b/owl-bot-staging/google-cloud-vm_migration-v1/lib/google/cloud/vm_migration/v1/vm_migration/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 VMMigration + module V1 + module VMMigration + module Rest + # Service that implements Longrunning Operations API. + class Operations + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "vmmigration.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :operations_stub + + ## + # Configuration for the VmMigration 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 VmMigration 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::VMMigration::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::VMMigration::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::VMMigration::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::VMMigration::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 = "vmmigration.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}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/?$}, 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{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + 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{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-vm_migration-v1/lib/google/cloud/vm_migration/v1/vm_migration/rest/service_stub.rb b/owl-bot-staging/google-cloud-vm_migration-v1/lib/google/cloud/vm_migration/v1/vm_migration/rest/service_stub.rb new file mode 100644 index 000000000000..fd5382c1721f --- /dev/null +++ b/owl-bot-staging/google-cloud-vm_migration-v1/lib/google/cloud/vm_migration/v1/vm_migration/rest/service_stub.rb @@ -0,0 +1,3891 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/vmmigration/v1/vmmigration_pb" + +module Google + module Cloud + module VMMigration + module V1 + module VMMigration + module Rest + ## + # REST service stub for the VmMigration 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_sources REST call + # + # @param request_pb [::Google::Cloud::VMMigration::V1::ListSourcesRequest] + # 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::VMMigration::V1::ListSourcesResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::VMMigration::V1::ListSourcesResponse] + # A result object deserialized from the server's reply + def list_sources request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_sources_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_sources", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::VMMigration::V1::ListSourcesResponse.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_source REST call + # + # @param request_pb [::Google::Cloud::VMMigration::V1::GetSourceRequest] + # 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::VMMigration::V1::Source] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::VMMigration::V1::Source] + # A result object deserialized from the server's reply + def get_source request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_source_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_source", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::VMMigration::V1::Source.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_source REST call + # + # @param request_pb [::Google::Cloud::VMMigration::V1::CreateSourceRequest] + # 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_source request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_source_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_source", + 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 update_source REST call + # + # @param request_pb [::Google::Cloud::VMMigration::V1::UpdateSourceRequest] + # 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 update_source request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_source_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_source", + 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_source REST call + # + # @param request_pb [::Google::Cloud::VMMigration::V1::DeleteSourceRequest] + # 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_source request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_source_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_source", + 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 fetch_inventory REST call + # + # @param request_pb [::Google::Cloud::VMMigration::V1::FetchInventoryRequest] + # 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::VMMigration::V1::FetchInventoryResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::VMMigration::V1::FetchInventoryResponse] + # A result object deserialized from the server's reply + def fetch_inventory request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_fetch_inventory_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: "fetch_inventory", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::VMMigration::V1::FetchInventoryResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the fetch_storage_inventory REST call + # + # @param request_pb [::Google::Cloud::VMMigration::V1::FetchStorageInventoryRequest] + # 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::VMMigration::V1::FetchStorageInventoryResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::VMMigration::V1::FetchStorageInventoryResponse] + # A result object deserialized from the server's reply + def fetch_storage_inventory request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_fetch_storage_inventory_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: "fetch_storage_inventory", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::VMMigration::V1::FetchStorageInventoryResponse.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_utilization_reports REST call + # + # @param request_pb [::Google::Cloud::VMMigration::V1::ListUtilizationReportsRequest] + # 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::VMMigration::V1::ListUtilizationReportsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::VMMigration::V1::ListUtilizationReportsResponse] + # A result object deserialized from the server's reply + def list_utilization_reports request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_utilization_reports_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_utilization_reports", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::VMMigration::V1::ListUtilizationReportsResponse.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_utilization_report REST call + # + # @param request_pb [::Google::Cloud::VMMigration::V1::GetUtilizationReportRequest] + # 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::VMMigration::V1::UtilizationReport] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::VMMigration::V1::UtilizationReport] + # A result object deserialized from the server's reply + def get_utilization_report request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_utilization_report_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_utilization_report", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::VMMigration::V1::UtilizationReport.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_utilization_report REST call + # + # @param request_pb [::Google::Cloud::VMMigration::V1::CreateUtilizationReportRequest] + # 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_utilization_report request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_utilization_report_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_utilization_report", + 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_utilization_report REST call + # + # @param request_pb [::Google::Cloud::VMMigration::V1::DeleteUtilizationReportRequest] + # 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_utilization_report request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_utilization_report_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_utilization_report", + 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 list_datacenter_connectors REST call + # + # @param request_pb [::Google::Cloud::VMMigration::V1::ListDatacenterConnectorsRequest] + # 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::VMMigration::V1::ListDatacenterConnectorsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::VMMigration::V1::ListDatacenterConnectorsResponse] + # A result object deserialized from the server's reply + def list_datacenter_connectors request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_datacenter_connectors_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_datacenter_connectors", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::VMMigration::V1::ListDatacenterConnectorsResponse.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_datacenter_connector REST call + # + # @param request_pb [::Google::Cloud::VMMigration::V1::GetDatacenterConnectorRequest] + # 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::VMMigration::V1::DatacenterConnector] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::VMMigration::V1::DatacenterConnector] + # A result object deserialized from the server's reply + def get_datacenter_connector request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_datacenter_connector_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_datacenter_connector", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::VMMigration::V1::DatacenterConnector.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_datacenter_connector REST call + # + # @param request_pb [::Google::Cloud::VMMigration::V1::CreateDatacenterConnectorRequest] + # 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_datacenter_connector request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_datacenter_connector_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_datacenter_connector", + 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_datacenter_connector REST call + # + # @param request_pb [::Google::Cloud::VMMigration::V1::DeleteDatacenterConnectorRequest] + # 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_datacenter_connector request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_datacenter_connector_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_datacenter_connector", + 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 upgrade_appliance REST call + # + # @param request_pb [::Google::Cloud::VMMigration::V1::UpgradeApplianceRequest] + # 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 upgrade_appliance request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_upgrade_appliance_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: "upgrade_appliance", + 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_migrating_vm REST call + # + # @param request_pb [::Google::Cloud::VMMigration::V1::CreateMigratingVmRequest] + # 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_migrating_vm request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_migrating_vm_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_migrating_vm", + 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 list_migrating_vms REST call + # + # @param request_pb [::Google::Cloud::VMMigration::V1::ListMigratingVmsRequest] + # 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::VMMigration::V1::ListMigratingVmsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::VMMigration::V1::ListMigratingVmsResponse] + # A result object deserialized from the server's reply + def list_migrating_vms request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_migrating_vms_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_migrating_vms", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::VMMigration::V1::ListMigratingVmsResponse.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_migrating_vm REST call + # + # @param request_pb [::Google::Cloud::VMMigration::V1::GetMigratingVmRequest] + # 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::VMMigration::V1::MigratingVm] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::VMMigration::V1::MigratingVm] + # A result object deserialized from the server's reply + def get_migrating_vm request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_migrating_vm_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_migrating_vm", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::VMMigration::V1::MigratingVm.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_migrating_vm REST call + # + # @param request_pb [::Google::Cloud::VMMigration::V1::UpdateMigratingVmRequest] + # 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 update_migrating_vm request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_migrating_vm_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_migrating_vm", + 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_migrating_vm REST call + # + # @param request_pb [::Google::Cloud::VMMigration::V1::DeleteMigratingVmRequest] + # 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_migrating_vm request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_migrating_vm_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_migrating_vm", + 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 start_migration REST call + # + # @param request_pb [::Google::Cloud::VMMigration::V1::StartMigrationRequest] + # 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 start_migration request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_start_migration_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: "start_migration", + 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 resume_migration REST call + # + # @param request_pb [::Google::Cloud::VMMigration::V1::ResumeMigrationRequest] + # 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 resume_migration request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_resume_migration_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: "resume_migration", + 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 pause_migration REST call + # + # @param request_pb [::Google::Cloud::VMMigration::V1::PauseMigrationRequest] + # 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 pause_migration request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_pause_migration_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: "pause_migration", + 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 finalize_migration REST call + # + # @param request_pb [::Google::Cloud::VMMigration::V1::FinalizeMigrationRequest] + # 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 finalize_migration request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_finalize_migration_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: "finalize_migration", + 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 extend_migration REST call + # + # @param request_pb [::Google::Cloud::VMMigration::V1::ExtendMigrationRequest] + # 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 extend_migration request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_extend_migration_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: "extend_migration", + 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_clone_job REST call + # + # @param request_pb [::Google::Cloud::VMMigration::V1::CreateCloneJobRequest] + # 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_clone_job request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_clone_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_clone_job", + 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 cancel_clone_job REST call + # + # @param request_pb [::Google::Cloud::VMMigration::V1::CancelCloneJobRequest] + # 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 cancel_clone_job request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_cancel_clone_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: "cancel_clone_job", + 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 list_clone_jobs REST call + # + # @param request_pb [::Google::Cloud::VMMigration::V1::ListCloneJobsRequest] + # 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::VMMigration::V1::ListCloneJobsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::VMMigration::V1::ListCloneJobsResponse] + # A result object deserialized from the server's reply + def list_clone_jobs request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_clone_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_clone_jobs", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::VMMigration::V1::ListCloneJobsResponse.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_clone_job REST call + # + # @param request_pb [::Google::Cloud::VMMigration::V1::GetCloneJobRequest] + # 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::VMMigration::V1::CloneJob] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::VMMigration::V1::CloneJob] + # A result object deserialized from the server's reply + def get_clone_job request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_clone_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_clone_job", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::VMMigration::V1::CloneJob.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_cutover_job REST call + # + # @param request_pb [::Google::Cloud::VMMigration::V1::CreateCutoverJobRequest] + # 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_cutover_job request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_cutover_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_cutover_job", + 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 cancel_cutover_job REST call + # + # @param request_pb [::Google::Cloud::VMMigration::V1::CancelCutoverJobRequest] + # 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 cancel_cutover_job request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_cancel_cutover_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: "cancel_cutover_job", + 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 list_cutover_jobs REST call + # + # @param request_pb [::Google::Cloud::VMMigration::V1::ListCutoverJobsRequest] + # 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::VMMigration::V1::ListCutoverJobsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::VMMigration::V1::ListCutoverJobsResponse] + # A result object deserialized from the server's reply + def list_cutover_jobs request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_cutover_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_cutover_jobs", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::VMMigration::V1::ListCutoverJobsResponse.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_cutover_job REST call + # + # @param request_pb [::Google::Cloud::VMMigration::V1::GetCutoverJobRequest] + # 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::VMMigration::V1::CutoverJob] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::VMMigration::V1::CutoverJob] + # A result object deserialized from the server's reply + def get_cutover_job request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_cutover_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_cutover_job", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::VMMigration::V1::CutoverJob.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_groups REST call + # + # @param request_pb [::Google::Cloud::VMMigration::V1::ListGroupsRequest] + # 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::VMMigration::V1::ListGroupsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::VMMigration::V1::ListGroupsResponse] + # A result object deserialized from the server's reply + def list_groups request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_groups_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_groups", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::VMMigration::V1::ListGroupsResponse.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_group REST call + # + # @param request_pb [::Google::Cloud::VMMigration::V1::GetGroupRequest] + # 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::VMMigration::V1::Group] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::VMMigration::V1::Group] + # A result object deserialized from the server's reply + def get_group request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_group_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_group", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::VMMigration::V1::Group.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_group REST call + # + # @param request_pb [::Google::Cloud::VMMigration::V1::CreateGroupRequest] + # 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_group request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_group_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_group", + 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 update_group REST call + # + # @param request_pb [::Google::Cloud::VMMigration::V1::UpdateGroupRequest] + # 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 update_group request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_group_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_group", + 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_group REST call + # + # @param request_pb [::Google::Cloud::VMMigration::V1::DeleteGroupRequest] + # 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_group request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_group_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_group", + 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 add_group_migration REST call + # + # @param request_pb [::Google::Cloud::VMMigration::V1::AddGroupMigrationRequest] + # 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 add_group_migration request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_add_group_migration_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: "add_group_migration", + 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 remove_group_migration REST call + # + # @param request_pb [::Google::Cloud::VMMigration::V1::RemoveGroupMigrationRequest] + # 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 remove_group_migration request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_remove_group_migration_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: "remove_group_migration", + 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 list_target_projects REST call + # + # @param request_pb [::Google::Cloud::VMMigration::V1::ListTargetProjectsRequest] + # 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::VMMigration::V1::ListTargetProjectsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::VMMigration::V1::ListTargetProjectsResponse] + # A result object deserialized from the server's reply + def list_target_projects request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_target_projects_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_target_projects", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::VMMigration::V1::ListTargetProjectsResponse.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_target_project REST call + # + # @param request_pb [::Google::Cloud::VMMigration::V1::GetTargetProjectRequest] + # 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::VMMigration::V1::TargetProject] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::VMMigration::V1::TargetProject] + # A result object deserialized from the server's reply + def get_target_project request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_target_project_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_target_project", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::VMMigration::V1::TargetProject.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_target_project REST call + # + # @param request_pb [::Google::Cloud::VMMigration::V1::CreateTargetProjectRequest] + # 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_target_project request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_target_project_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_target_project", + 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 update_target_project REST call + # + # @param request_pb [::Google::Cloud::VMMigration::V1::UpdateTargetProjectRequest] + # 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 update_target_project request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_target_project_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_target_project", + 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_target_project REST call + # + # @param request_pb [::Google::Cloud::VMMigration::V1::DeleteTargetProjectRequest] + # 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_target_project request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_target_project_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_target_project", + 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 list_replication_cycles REST call + # + # @param request_pb [::Google::Cloud::VMMigration::V1::ListReplicationCyclesRequest] + # 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::VMMigration::V1::ListReplicationCyclesResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::VMMigration::V1::ListReplicationCyclesResponse] + # A result object deserialized from the server's reply + def list_replication_cycles request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_replication_cycles_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_replication_cycles", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::VMMigration::V1::ListReplicationCyclesResponse.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_replication_cycle REST call + # + # @param request_pb [::Google::Cloud::VMMigration::V1::GetReplicationCycleRequest] + # 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::VMMigration::V1::ReplicationCycle] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::VMMigration::V1::ReplicationCycle] + # A result object deserialized from the server's reply + def get_replication_cycle request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_replication_cycle_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_replication_cycle", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::VMMigration::V1::ReplicationCycle.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_image_imports REST call + # + # @param request_pb [::Google::Cloud::VMMigration::V1::ListImageImportsRequest] + # 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::VMMigration::V1::ListImageImportsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::VMMigration::V1::ListImageImportsResponse] + # A result object deserialized from the server's reply + def list_image_imports request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_image_imports_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_image_imports", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::VMMigration::V1::ListImageImportsResponse.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_image_import REST call + # + # @param request_pb [::Google::Cloud::VMMigration::V1::GetImageImportRequest] + # 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::VMMigration::V1::ImageImport] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::VMMigration::V1::ImageImport] + # A result object deserialized from the server's reply + def get_image_import request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_image_import_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_image_import", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::VMMigration::V1::ImageImport.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_image_import REST call + # + # @param request_pb [::Google::Cloud::VMMigration::V1::CreateImageImportRequest] + # 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_image_import request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_image_import_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_image_import", + 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_image_import REST call + # + # @param request_pb [::Google::Cloud::VMMigration::V1::DeleteImageImportRequest] + # 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_image_import request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_image_import_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_image_import", + 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 list_image_import_jobs REST call + # + # @param request_pb [::Google::Cloud::VMMigration::V1::ListImageImportJobsRequest] + # 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::VMMigration::V1::ListImageImportJobsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::VMMigration::V1::ListImageImportJobsResponse] + # A result object deserialized from the server's reply + def list_image_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_image_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_image_import_jobs", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::VMMigration::V1::ListImageImportJobsResponse.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_image_import_job REST call + # + # @param request_pb [::Google::Cloud::VMMigration::V1::GetImageImportJobRequest] + # 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::VMMigration::V1::ImageImportJob] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::VMMigration::V1::ImageImportJob] + # A result object deserialized from the server's reply + def get_image_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_image_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_image_import_job", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::VMMigration::V1::ImageImportJob.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_image_import_job REST call + # + # @param request_pb [::Google::Cloud::VMMigration::V1::CancelImageImportJobRequest] + # 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 cancel_image_import_job request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_cancel_image_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: "cancel_image_import_job", + 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_disk_migration_job REST call + # + # @param request_pb [::Google::Cloud::VMMigration::V1::CreateDiskMigrationJobRequest] + # 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_disk_migration_job request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_disk_migration_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_disk_migration_job", + 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 list_disk_migration_jobs REST call + # + # @param request_pb [::Google::Cloud::VMMigration::V1::ListDiskMigrationJobsRequest] + # 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::VMMigration::V1::ListDiskMigrationJobsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::VMMigration::V1::ListDiskMigrationJobsResponse] + # A result object deserialized from the server's reply + def list_disk_migration_jobs request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_disk_migration_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_disk_migration_jobs", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::VMMigration::V1::ListDiskMigrationJobsResponse.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_disk_migration_job REST call + # + # @param request_pb [::Google::Cloud::VMMigration::V1::GetDiskMigrationJobRequest] + # 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::VMMigration::V1::DiskMigrationJob] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::VMMigration::V1::DiskMigrationJob] + # A result object deserialized from the server's reply + def get_disk_migration_job request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_disk_migration_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_disk_migration_job", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::VMMigration::V1::DiskMigrationJob.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_disk_migration_job REST call + # + # @param request_pb [::Google::Cloud::VMMigration::V1::UpdateDiskMigrationJobRequest] + # 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 update_disk_migration_job request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_disk_migration_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: "update_disk_migration_job", + 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_disk_migration_job REST call + # + # @param request_pb [::Google::Cloud::VMMigration::V1::DeleteDiskMigrationJobRequest] + # 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_disk_migration_job request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_disk_migration_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: "delete_disk_migration_job", + 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 run_disk_migration_job REST call + # + # @param request_pb [::Google::Cloud::VMMigration::V1::RunDiskMigrationJobRequest] + # 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 run_disk_migration_job request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_run_disk_migration_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: "run_disk_migration_job", + 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 cancel_disk_migration_job REST call + # + # @param request_pb [::Google::Cloud::VMMigration::V1::CancelDiskMigrationJobRequest] + # 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 cancel_disk_migration_job request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_cancel_disk_migration_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: "cancel_disk_migration_job", + 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 + + ## + # @private + # + # GRPC transcoding helper method for the list_sources REST call + # + # @param request_pb [::Google::Cloud::VMMigration::V1::ListSourcesRequest] + # 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_sources_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/sources", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_source REST call + # + # @param request_pb [::Google::Cloud::VMMigration::V1::GetSourceRequest] + # 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_source_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/sources/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_source REST call + # + # @param request_pb [::Google::Cloud::VMMigration::V1::CreateSourceRequest] + # 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_source_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/sources", + body: "source", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_source REST call + # + # @param request_pb [::Google::Cloud::VMMigration::V1::UpdateSourceRequest] + # 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_source_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v1/{source.name}", + body: "source", + matches: [ + ["source.name", %r{^projects/[^/]+/locations/[^/]+/sources/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_source REST call + # + # @param request_pb [::Google::Cloud::VMMigration::V1::DeleteSourceRequest] + # 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_source_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/sources/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the fetch_inventory REST call + # + # @param request_pb [::Google::Cloud::VMMigration::V1::FetchInventoryRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_fetch_inventory_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{source}:fetchInventory", + matches: [ + ["source", %r{^projects/[^/]+/locations/[^/]+/sources/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the fetch_storage_inventory REST call + # + # @param request_pb [::Google::Cloud::VMMigration::V1::FetchStorageInventoryRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_fetch_storage_inventory_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{source}:fetchStorageInventory", + matches: [ + ["source", %r{^projects/[^/]+/locations/[^/]+/sources/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_utilization_reports REST call + # + # @param request_pb [::Google::Cloud::VMMigration::V1::ListUtilizationReportsRequest] + # 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_utilization_reports_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/utilizationReports", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/sources/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_utilization_report REST call + # + # @param request_pb [::Google::Cloud::VMMigration::V1::GetUtilizationReportRequest] + # 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_utilization_report_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/sources/[^/]+/utilizationReports/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_utilization_report REST call + # + # @param request_pb [::Google::Cloud::VMMigration::V1::CreateUtilizationReportRequest] + # 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_utilization_report_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/utilizationReports", + body: "utilization_report", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/sources/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_utilization_report REST call + # + # @param request_pb [::Google::Cloud::VMMigration::V1::DeleteUtilizationReportRequest] + # 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_utilization_report_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/sources/[^/]+/utilizationReports/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_datacenter_connectors REST call + # + # @param request_pb [::Google::Cloud::VMMigration::V1::ListDatacenterConnectorsRequest] + # 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_datacenter_connectors_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/datacenterConnectors", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/sources/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_datacenter_connector REST call + # + # @param request_pb [::Google::Cloud::VMMigration::V1::GetDatacenterConnectorRequest] + # 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_datacenter_connector_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/sources/[^/]+/datacenterConnectors/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_datacenter_connector REST call + # + # @param request_pb [::Google::Cloud::VMMigration::V1::CreateDatacenterConnectorRequest] + # 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_datacenter_connector_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/datacenterConnectors", + body: "datacenter_connector", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/sources/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_datacenter_connector REST call + # + # @param request_pb [::Google::Cloud::VMMigration::V1::DeleteDatacenterConnectorRequest] + # 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_datacenter_connector_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/sources/[^/]+/datacenterConnectors/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the upgrade_appliance REST call + # + # @param request_pb [::Google::Cloud::VMMigration::V1::UpgradeApplianceRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_upgrade_appliance_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{datacenter_connector}:upgradeAppliance", + body: "*", + matches: [ + ["datacenter_connector", %r{^projects/[^/]+/locations/[^/]+/sources/[^/]+/datacenterConnectors/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_migrating_vm REST call + # + # @param request_pb [::Google::Cloud::VMMigration::V1::CreateMigratingVmRequest] + # 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_migrating_vm_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/migratingVms", + body: "migrating_vm", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/sources/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_migrating_vms REST call + # + # @param request_pb [::Google::Cloud::VMMigration::V1::ListMigratingVmsRequest] + # 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_migrating_vms_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/migratingVms", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/sources/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_migrating_vm REST call + # + # @param request_pb [::Google::Cloud::VMMigration::V1::GetMigratingVmRequest] + # 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_migrating_vm_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/sources/[^/]+/migratingVms/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_migrating_vm REST call + # + # @param request_pb [::Google::Cloud::VMMigration::V1::UpdateMigratingVmRequest] + # 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_migrating_vm_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v1/{migrating_vm.name}", + body: "migrating_vm", + matches: [ + ["migrating_vm.name", %r{^projects/[^/]+/locations/[^/]+/sources/[^/]+/migratingVms/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_migrating_vm REST call + # + # @param request_pb [::Google::Cloud::VMMigration::V1::DeleteMigratingVmRequest] + # 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_migrating_vm_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/sources/[^/]+/migratingVms/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the start_migration REST call + # + # @param request_pb [::Google::Cloud::VMMigration::V1::StartMigrationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_start_migration_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{migrating_vm}:startMigration", + body: "*", + matches: [ + ["migrating_vm", %r{^projects/[^/]+/locations/[^/]+/sources/[^/]+/migratingVms/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the resume_migration REST call + # + # @param request_pb [::Google::Cloud::VMMigration::V1::ResumeMigrationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_resume_migration_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{migrating_vm}:resumeMigration", + body: "*", + matches: [ + ["migrating_vm", %r{^projects/[^/]+/locations/[^/]+/sources/[^/]+/migratingVms/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the pause_migration REST call + # + # @param request_pb [::Google::Cloud::VMMigration::V1::PauseMigrationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_pause_migration_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{migrating_vm}:pauseMigration", + body: "*", + matches: [ + ["migrating_vm", %r{^projects/[^/]+/locations/[^/]+/sources/[^/]+/migratingVms/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the finalize_migration REST call + # + # @param request_pb [::Google::Cloud::VMMigration::V1::FinalizeMigrationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_finalize_migration_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{migrating_vm}:finalizeMigration", + body: "*", + matches: [ + ["migrating_vm", %r{^projects/[^/]+/locations/[^/]+/sources/[^/]+/migratingVms/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the extend_migration REST call + # + # @param request_pb [::Google::Cloud::VMMigration::V1::ExtendMigrationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_extend_migration_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{migrating_vm}:extendMigration", + body: "*", + matches: [ + ["migrating_vm", %r{^projects/[^/]+/locations/[^/]+/sources/[^/]+/migratingVms/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_clone_job REST call + # + # @param request_pb [::Google::Cloud::VMMigration::V1::CreateCloneJobRequest] + # 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_clone_job_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/cloneJobs", + body: "clone_job", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/sources/[^/]+/migratingVms/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the cancel_clone_job REST call + # + # @param request_pb [::Google::Cloud::VMMigration::V1::CancelCloneJobRequest] + # 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_clone_job_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/sources/[^/]+/migratingVms/[^/]+/cloneJobs/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_clone_jobs REST call + # + # @param request_pb [::Google::Cloud::VMMigration::V1::ListCloneJobsRequest] + # 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_clone_jobs_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/cloneJobs", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/sources/[^/]+/migratingVms/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_clone_job REST call + # + # @param request_pb [::Google::Cloud::VMMigration::V1::GetCloneJobRequest] + # 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_clone_job_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/sources/[^/]+/migratingVms/[^/]+/cloneJobs/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_cutover_job REST call + # + # @param request_pb [::Google::Cloud::VMMigration::V1::CreateCutoverJobRequest] + # 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_cutover_job_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/cutoverJobs", + body: "cutover_job", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/sources/[^/]+/migratingVms/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the cancel_cutover_job REST call + # + # @param request_pb [::Google::Cloud::VMMigration::V1::CancelCutoverJobRequest] + # 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_cutover_job_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/sources/[^/]+/migratingVms/[^/]+/cutoverJobs/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_cutover_jobs REST call + # + # @param request_pb [::Google::Cloud::VMMigration::V1::ListCutoverJobsRequest] + # 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_cutover_jobs_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/cutoverJobs", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/sources/[^/]+/migratingVms/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_cutover_job REST call + # + # @param request_pb [::Google::Cloud::VMMigration::V1::GetCutoverJobRequest] + # 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_cutover_job_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/sources/[^/]+/migratingVms/[^/]+/cutoverJobs/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_groups REST call + # + # @param request_pb [::Google::Cloud::VMMigration::V1::ListGroupsRequest] + # 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_groups_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/groups", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_group REST call + # + # @param request_pb [::Google::Cloud::VMMigration::V1::GetGroupRequest] + # 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_group_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/groups/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_group REST call + # + # @param request_pb [::Google::Cloud::VMMigration::V1::CreateGroupRequest] + # 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_group_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/groups", + body: "group", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_group REST call + # + # @param request_pb [::Google::Cloud::VMMigration::V1::UpdateGroupRequest] + # 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_group_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v1/{group.name}", + body: "group", + matches: [ + ["group.name", %r{^projects/[^/]+/locations/[^/]+/groups/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_group REST call + # + # @param request_pb [::Google::Cloud::VMMigration::V1::DeleteGroupRequest] + # 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_group_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/groups/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the add_group_migration REST call + # + # @param request_pb [::Google::Cloud::VMMigration::V1::AddGroupMigrationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_add_group_migration_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{group}:addGroupMigration", + body: "*", + matches: [ + ["group", %r{^projects/[^/]+/locations/[^/]+/groups/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the remove_group_migration REST call + # + # @param request_pb [::Google::Cloud::VMMigration::V1::RemoveGroupMigrationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_remove_group_migration_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{group}:removeGroupMigration", + body: "*", + matches: [ + ["group", %r{^projects/[^/]+/locations/[^/]+/groups/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_target_projects REST call + # + # @param request_pb [::Google::Cloud::VMMigration::V1::ListTargetProjectsRequest] + # 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_target_projects_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/targetProjects", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_target_project REST call + # + # @param request_pb [::Google::Cloud::VMMigration::V1::GetTargetProjectRequest] + # 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_target_project_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/targetProjects/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_target_project REST call + # + # @param request_pb [::Google::Cloud::VMMigration::V1::CreateTargetProjectRequest] + # 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_target_project_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/targetProjects", + body: "target_project", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_target_project REST call + # + # @param request_pb [::Google::Cloud::VMMigration::V1::UpdateTargetProjectRequest] + # 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_target_project_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v1/{target_project.name}", + body: "target_project", + matches: [ + ["target_project.name", %r{^projects/[^/]+/locations/[^/]+/targetProjects/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_target_project REST call + # + # @param request_pb [::Google::Cloud::VMMigration::V1::DeleteTargetProjectRequest] + # 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_target_project_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/targetProjects/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_replication_cycles REST call + # + # @param request_pb [::Google::Cloud::VMMigration::V1::ListReplicationCyclesRequest] + # 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_replication_cycles_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/replicationCycles", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/sources/[^/]+/migratingVms/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_replication_cycle REST call + # + # @param request_pb [::Google::Cloud::VMMigration::V1::GetReplicationCycleRequest] + # 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_replication_cycle_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/sources/[^/]+/migratingVms/[^/]+/replicationCycles/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_image_imports REST call + # + # @param request_pb [::Google::Cloud::VMMigration::V1::ListImageImportsRequest] + # 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_image_imports_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/imageImports", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_image_import REST call + # + # @param request_pb [::Google::Cloud::VMMigration::V1::GetImageImportRequest] + # 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_image_import_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/imageImports/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_image_import REST call + # + # @param request_pb [::Google::Cloud::VMMigration::V1::CreateImageImportRequest] + # 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_image_import_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/imageImports", + body: "image_import", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_image_import REST call + # + # @param request_pb [::Google::Cloud::VMMigration::V1::DeleteImageImportRequest] + # 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_image_import_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/imageImports/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_image_import_jobs REST call + # + # @param request_pb [::Google::Cloud::VMMigration::V1::ListImageImportJobsRequest] + # 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_image_import_jobs_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/imageImportJobs", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/imageImports/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_image_import_job REST call + # + # @param request_pb [::Google::Cloud::VMMigration::V1::GetImageImportJobRequest] + # 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_image_import_job_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/imageImports/[^/]+/imageImportJobs/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the cancel_image_import_job REST call + # + # @param request_pb [::Google::Cloud::VMMigration::V1::CancelImageImportJobRequest] + # 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_image_import_job_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/imageImports/[^/]+/imageImportJobs/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_disk_migration_job REST call + # + # @param request_pb [::Google::Cloud::VMMigration::V1::CreateDiskMigrationJobRequest] + # 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_disk_migration_job_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/diskMigrationJobs", + body: "disk_migration_job", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/sources/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_disk_migration_jobs REST call + # + # @param request_pb [::Google::Cloud::VMMigration::V1::ListDiskMigrationJobsRequest] + # 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_disk_migration_jobs_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/diskMigrationJobs", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/sources/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_disk_migration_job REST call + # + # @param request_pb [::Google::Cloud::VMMigration::V1::GetDiskMigrationJobRequest] + # 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_disk_migration_job_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/sources/[^/]+/diskMigrationJobs/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_disk_migration_job REST call + # + # @param request_pb [::Google::Cloud::VMMigration::V1::UpdateDiskMigrationJobRequest] + # 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_disk_migration_job_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v1/{disk_migration_job.name}", + body: "disk_migration_job", + matches: [ + ["disk_migration_job.name", %r{^projects/[^/]+/locations/[^/]+/sources/[^/]+/diskMigrationJobs/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_disk_migration_job REST call + # + # @param request_pb [::Google::Cloud::VMMigration::V1::DeleteDiskMigrationJobRequest] + # 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_disk_migration_job_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/sources/[^/]+/diskMigrationJobs/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the run_disk_migration_job REST call + # + # @param request_pb [::Google::Cloud::VMMigration::V1::RunDiskMigrationJobRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_run_disk_migration_job_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:run", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/sources/[^/]+/diskMigrationJobs/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the cancel_disk_migration_job REST call + # + # @param request_pb [::Google::Cloud::VMMigration::V1::CancelDiskMigrationJobRequest] + # 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_disk_migration_job_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/sources/[^/]+/diskMigrationJobs/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-vm_migration-v1/lib/google/cloud/vmmigration/v1/vmmigration_pb.rb b/owl-bot-staging/google-cloud-vm_migration-v1/lib/google/cloud/vmmigration/v1/vmmigration_pb.rb new file mode 100644 index 000000000000..d63ea10afb7f --- /dev/null +++ b/owl-bot-staging/google-cloud-vm_migration-v1/lib/google/cloud/vmmigration/v1/vmmigration_pb.rb @@ -0,0 +1,262 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/vmmigration/v1/vmmigration.proto + +require 'google/protobuf' + +require 'google/api/annotations_pb' +require 'google/api/client_pb' +require 'google/api/field_behavior_pb' +require 'google/api/field_info_pb' +require 'google/api/resource_pb' +require 'google/longrunning/operations_pb' +require 'google/protobuf/duration_pb' +require 'google/protobuf/empty_pb' +require 'google/protobuf/field_mask_pb' +require 'google/protobuf/timestamp_pb' +require 'google/rpc/error_details_pb' +require 'google/rpc/status_pb' + + +descriptor_data = "\n-google/cloud/vmmigration/v1/vmmigration.proto\x12\x1bgoogle.cloud.vmmigration.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x1bgoogle/api/field_info.proto\x1a\x19google/api/resource.proto\x1a#google/longrunning/operations.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x1egoogle/rpc/error_details.proto\x1a\x17google/rpc/status.proto\"\xd8\x05\n\x10ReplicationCycle\x12\x0c\n\x04name\x18\r \x01(\t\x12\x14\n\x0c\x63ycle_number\x18\n \x01(\x05\x12.\n\nstart_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12,\n\x08\x65nd_time\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x37\n\x14total_pause_duration\x18\x07 \x01(\x0b\x32\x19.google.protobuf.Duration\x12\x1c\n\x10progress_percent\x18\x05 \x01(\x05\x42\x02\x18\x01\x12\x35\n\x05steps\x18\t \x03(\x0b\x32&.google.cloud.vmmigration.v1.CycleStep\x12\x42\n\x05state\x18\x0b \x01(\x0e\x32\x33.google.cloud.vmmigration.v1.ReplicationCycle.State\x12&\n\x05\x65rror\x18\x0c \x01(\x0b\x32\x12.google.rpc.StatusB\x03\xe0\x41\x03\x12\x44\n\x08warnings\x18\x0e \x03(\x0b\x32-.google.cloud.vmmigration.v1.MigrationWarningB\x03\xe0\x41\x03\"R\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0b\n\x07RUNNING\x10\x01\x12\n\n\x06PAUSED\x10\x02\x12\n\n\x06\x46\x41ILED\x10\x03\x12\r\n\tSUCCEEDED\x10\x04:\xad\x01\xea\x41\xa9\x01\n+vmmigration.googleapis.com/ReplicationCycle\x12zprojects/{project}/locations/{location}/sources/{source}/migratingVms/{migrating_vm}/replicationCycles/{replication_cycle}\"\xe0\x02\n\tCycleStep\x12\\\n\x18initializing_replication\x18\x03 \x01(\x0b\x32\x38.google.cloud.vmmigration.v1.InitializingReplicationStepH\x00\x12\x43\n\x0breplicating\x18\x04 \x01(\x0b\x32,.google.cloud.vmmigration.v1.ReplicatingStepH\x00\x12J\n\x0fpost_processing\x18\x05 \x01(\x0b\x32/.google.cloud.vmmigration.v1.PostProcessingStepH\x00\x12.\n\nstart_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12,\n\x08\x65nd_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x06\n\x04step\"\x1d\n\x1bInitializingReplicationStep\"\xa9\x01\n\x0fReplicatingStep\x12\x13\n\x0btotal_bytes\x18\x01 \x01(\x03\x12\x18\n\x10replicated_bytes\x18\x02 \x01(\x03\x12\x31\n)last_two_minutes_average_bytes_per_second\x18\x03 \x01(\x03\x12\x34\n,last_thirty_minutes_average_bytes_per_second\x18\x04 \x01(\x03\"\x14\n\x12PostProcessingStep\"E\n\x0fReplicationSync\x12\x32\n\x0elast_sync_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"\xd9\x10\n\x0bMigratingVm\x12\x62\n\x1e\x63ompute_engine_target_defaults\x18\x1a \x01(\x0b\x32\x38.google.cloud.vmmigration.v1.ComputeEngineTargetDefaultsH\x00\x12m\n$compute_engine_disks_target_defaults\x18\" \x01(\x0b\x32=.google.cloud.vmmigration.v1.ComputeEngineDisksTargetDefaultsH\x00\x12[\n\x18vmware_source_vm_details\x18\x1c \x01(\x0b\x32\x32.google.cloud.vmmigration.v1.VmwareSourceVmDetailsB\x03\xe0\x41\x03H\x01\x12U\n\x15\x61ws_source_vm_details\x18\x1d \x01(\x0b\x32/.google.cloud.vmmigration.v1.AwsSourceVmDetailsB\x03\xe0\x41\x03H\x01\x12Y\n\x17\x61zure_source_vm_details\x18\x1e \x01(\x0b\x32\x31.google.cloud.vmmigration.v1.AzureSourceVmDetailsB\x03\xe0\x41\x03H\x01\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x14\n\x0csource_vm_id\x18\x02 \x01(\t\x12\x14\n\x0c\x64isplay_name\x18\x12 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x03 \x01(\t\x12;\n\x06policy\x18\x08 \x01(\x0b\x32+.google.cloud.vmmigration.v1.SchedulePolicy\x12\x34\n\x0b\x63reate_time\x18\t \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\n \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x44\n\tlast_sync\x18\x0b \x01(\x0b\x32,.google.cloud.vmmigration.v1.ReplicationSyncB\x03\xe0\x41\x03\x12\x42\n\x05state\x18\x17 \x01(\x0e\x32..google.cloud.vmmigration.v1.MigratingVm.StateB\x03\xe0\x41\x03\x12\x33\n\nstate_time\x18\x16 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12M\n\x11\x63urrent_sync_info\x18\r \x01(\x0b\x32-.google.cloud.vmmigration.v1.ReplicationCycleB\x03\xe0\x41\x03\x12R\n\x16last_replication_cycle\x18 \x01(\x0b\x32-.google.cloud.vmmigration.v1.ReplicationCycleB\x03\xe0\x41\x03\x12\x37\n\x05group\x18\x0f \x01(\tB(\xe0\x41\x03\xfa\x41\"\x12 vmmigration.googleapis.com/Group\x12\x44\n\x06labels\x18\x10 \x03(\x0b\x32\x34.google.cloud.vmmigration.v1.MigratingVm.LabelsEntry\x12\x45\n\x11recent_clone_jobs\x18\x11 \x03(\x0b\x32%.google.cloud.vmmigration.v1.CloneJobB\x03\xe0\x41\x03\x12&\n\x05\x65rror\x18\x13 \x01(\x0b\x32\x12.google.rpc.StatusB\x03\xe0\x41\x03\x12I\n\x13recent_cutover_jobs\x18\x14 \x03(\x0b\x32\'.google.cloud.vmmigration.v1.CutoverJobB\x03\xe0\x41\x03\x12K\n\x10\x63utover_forecast\x18! \x01(\x0b\x32,.google.cloud.vmmigration.v1.CutoverForecastB\x03\xe0\x41\x03\x12L\n\nexpiration\x18% \x01(\x0b\x32\x33.google.cloud.vmmigration.v1.MigratingVm.ExpirationB\x03\xe0\x41\x03\x1ay\n\nExpiration\x12\x34\n\x0b\x65xpire_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x1c\n\x0f\x65xtension_count\x18\x02 \x01(\x05\x42\x03\xe0\x41\x03\x12\x17\n\nextendable\x18\x03 \x01(\x08\x42\x03\xe0\x41\x03\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\xdb\x01\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0b\n\x07PENDING\x10\x01\x12\t\n\x05READY\x10\x02\x12\x0e\n\nFIRST_SYNC\x10\x03\x12\n\n\x06\x41\x43TIVE\x10\x04\x12\x10\n\x0c\x43UTTING_OVER\x10\x07\x12\x0b\n\x07\x43UTOVER\x10\x08\x12\x0e\n\nFINAL_SYNC\x10\t\x12\n\n\x06PAUSED\x10\n\x12\x0e\n\nFINALIZING\x10\x0b\x12\r\n\tFINALIZED\x10\x0c\x12\t\n\x05\x45RROR\x10\r\x12\x0b\n\x07\x45XPIRED\x10\x0e\x12\x15\n\x11\x46INALIZED_EXPIRED\x10\x11:\x81\x01\xea\x41~\n&vmmigration.googleapis.com/MigratingVm\x12Tprojects/{project}/locations/{location}/sources/{source}/migratingVms/{migrating_vm}B\x14\n\x12target_vm_defaultsB\x13\n\x11source_vm_details\"Y\n\x0f\x43utoverForecast\x12\x46\n\x1e\x65stimated_cutover_job_duration\x18\x01 \x01(\x0b\x32\x19.google.protobuf.DurationB\x03\xe0\x41\x03\"\xeb\x06\n\x08\x43loneJob\x12\x65\n\x1d\x63ompute_engine_target_details\x18\x14 \x01(\x0b\x32\x37.google.cloud.vmmigration.v1.ComputeEngineTargetDetailsB\x03\xe0\x41\x03H\x00\x12p\n#compute_engine_disks_target_details\x18\x19 \x01(\x0b\x32<.google.cloud.vmmigration.v1.ComputeEngineDisksTargetDetailsB\x03\xe0\x41\x03H\x00\x12\x34\n\x0b\x63reate_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x31\n\x08\x65nd_time\x18\x16 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x11\n\x04name\x18\x03 \x01(\tB\x03\xe0\x41\x03\x12?\n\x05state\x18\x0c \x01(\x0e\x32+.google.cloud.vmmigration.v1.CloneJob.StateB\x03\xe0\x41\x03\x12\x33\n\nstate_time\x18\x0e \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12&\n\x05\x65rror\x18\x11 \x01(\x0b\x32\x12.google.rpc.StatusB\x03\xe0\x41\x03\x12:\n\x05steps\x18\x17 \x03(\x0b\x32&.google.cloud.vmmigration.v1.CloneStepB\x03\xe0\x41\x03\"\x82\x01\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0b\n\x07PENDING\x10\x01\x12\n\n\x06\x41\x43TIVE\x10\x02\x12\n\n\x06\x46\x41ILED\x10\x03\x12\r\n\tSUCCEEDED\x10\x04\x12\r\n\tCANCELLED\x10\x05\x12\x0e\n\nCANCELLING\x10\x06\x12\x0f\n\x0b\x41\x44\x41PTING_OS\x10\x07:\x95\x01\xea\x41\x91\x01\n#vmmigration.googleapis.com/CloneJob\x12jprojects/{project}/locations/{location}/sources/{source}/migratingVms/{migrating_vm}/cloneJobs/{clone_job}B\x13\n\x11target_vm_details\"\xe5\x02\n\tCloneStep\x12\x42\n\x0b\x61\x64\x61pting_os\x18\x03 \x01(\x0b\x32+.google.cloud.vmmigration.v1.AdaptingOSStepH\x00\x12O\n\x12preparing_vm_disks\x18\x04 \x01(\x0b\x32\x31.google.cloud.vmmigration.v1.PreparingVMDisksStepH\x00\x12]\n\x19instantiating_migrated_vm\x18\x05 \x01(\x0b\x32\x38.google.cloud.vmmigration.v1.InstantiatingMigratedVMStepH\x00\x12.\n\nstart_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12,\n\x08\x65nd_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x06\n\x04step\"\x10\n\x0e\x41\x64\x61ptingOSStep\"\x16\n\x14PreparingVMDisksStep\"\x1d\n\x1bInstantiatingMigratedVMStep\"\xb2\x07\n\nCutoverJob\x12\x65\n\x1d\x63ompute_engine_target_details\x18\x0e \x01(\x0b\x32\x37.google.cloud.vmmigration.v1.ComputeEngineTargetDetailsB\x03\xe0\x41\x03H\x00\x12p\n#compute_engine_disks_target_details\x18\x14 \x01(\x0b\x32<.google.cloud.vmmigration.v1.ComputeEngineDisksTargetDetailsB\x03\xe0\x41\x03H\x00\x12\x34\n\x0b\x63reate_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x31\n\x08\x65nd_time\x18\x10 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x11\n\x04name\x18\x03 \x01(\tB\x03\xe0\x41\x03\x12\x41\n\x05state\x18\x05 \x01(\x0e\x32-.google.cloud.vmmigration.v1.CutoverJob.StateB\x03\xe0\x41\x03\x12\x33\n\nstate_time\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x1d\n\x10progress_percent\x18\r \x01(\x05\x42\x03\xe0\x41\x03\x12&\n\x05\x65rror\x18\t \x01(\x0b\x32\x12.google.rpc.StatusB\x03\xe0\x41\x03\x12\x1a\n\rstate_message\x18\n \x01(\tB\x03\xe0\x41\x03\x12<\n\x05steps\x18\x11 \x03(\x0b\x32(.google.cloud.vmmigration.v1.CutoverStepB\x03\xe0\x41\x03\"\x82\x01\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0b\n\x07PENDING\x10\x01\x12\n\n\x06\x46\x41ILED\x10\x02\x12\r\n\tSUCCEEDED\x10\x03\x12\r\n\tCANCELLED\x10\x04\x12\x0e\n\nCANCELLING\x10\x05\x12\n\n\x06\x41\x43TIVE\x10\x06\x12\x0f\n\x0b\x41\x44\x41PTING_OS\x10\x07:\x9b\x01\xea\x41\x97\x01\n%vmmigration.googleapis.com/CutoverJob\x12nprojects/{project}/locations/{location}/sources/{source}/migratingVms/{migrating_vm}/cutoverJobs/{cutover_job}B\x13\n\x11target_vm_details\"\x97\x04\n\x0b\x43utoverStep\x12S\n\x1aprevious_replication_cycle\x18\x03 \x01(\x0b\x32-.google.cloud.vmmigration.v1.ReplicationCycleH\x00\x12X\n\x17shutting_down_source_vm\x18\x04 \x01(\x0b\x32\x35.google.cloud.vmmigration.v1.ShuttingDownSourceVMStepH\x00\x12\x43\n\nfinal_sync\x18\x05 \x01(\x0b\x32-.google.cloud.vmmigration.v1.ReplicationCycleH\x00\x12O\n\x12preparing_vm_disks\x18\x06 \x01(\x0b\x32\x31.google.cloud.vmmigration.v1.PreparingVMDisksStepH\x00\x12]\n\x19instantiating_migrated_vm\x18\x07 \x01(\x0b\x32\x38.google.cloud.vmmigration.v1.InstantiatingMigratedVMStepH\x00\x12.\n\nstart_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12,\n\x08\x65nd_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x06\n\x04step\"\x1a\n\x18ShuttingDownSourceVMStep\"\xc2\x01\n\x15\x43reateCloneJobRequest\x12;\n\x06parent\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\x12#vmmigration.googleapis.com/CloneJob\x12\x19\n\x0c\x63lone_job_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12=\n\tclone_job\x18\x03 \x01(\x0b\x32%.google.cloud.vmmigration.v1.CloneJobB\x03\xe0\x41\x02\x12\x12\n\nrequest_id\x18\x04 \x01(\t\"R\n\x15\x43\x61ncelCloneJobRequest\x12\x39\n\x04name\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\n#vmmigration.googleapis.com/CloneJob\"\x18\n\x16\x43\x61ncelCloneJobResponse\"\xb0\x01\n\x14ListCloneJobsRequest\x12;\n\x06parent\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\x12#vmmigration.googleapis.com/CloneJob\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\x02\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\x15ListCloneJobsResponse\x12>\n\nclone_jobs\x18\x01 \x03(\x0b\x32%.google.cloud.vmmigration.v1.CloneJobB\x03\xe0\x41\x03\x12\x1c\n\x0fnext_page_token\x18\x02 \x01(\tB\x03\xe0\x41\x03\x12\x18\n\x0bunreachable\x18\x03 \x03(\tB\x03\xe0\x41\x03\"O\n\x12GetCloneJobRequest\x12\x39\n\x04name\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\n#vmmigration.googleapis.com/CloneJob\"\x89\x05\n\x06Source\x12\x42\n\x06vmware\x18\n \x01(\x0b\x32\x30.google.cloud.vmmigration.v1.VmwareSourceDetailsH\x00\x12<\n\x03\x61ws\x18\x0c \x01(\x0b\x32-.google.cloud.vmmigration.v1.AwsSourceDetailsH\x00\x12@\n\x05\x61zure\x18\r \x01(\x0b\x32/.google.cloud.vmmigration.v1.AzureSourceDetailsH\x00\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\x12\x34\n\x0bupdate_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12?\n\x06labels\x18\x04 \x03(\x0b\x32/.google.cloud.vmmigration.v1.Source.LabelsEntry\x12\x13\n\x0b\x64\x65scription\x18\x06 \x01(\t\x12\x43\n\nencryption\x18\x0e \x01(\x0b\x32\'.google.cloud.vmmigration.v1.EncryptionB\x06\xe0\x41\x01\xe0\x41\x05\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01:`\xea\x41]\n!vmmigration.googleapis.com/Source\x12\x38projects/{project}/locations/{location}/sources/{source}B\x10\n\x0esource_details\"H\n\nEncryption\x12:\n\x07kms_key\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!cloudkms.googleapis.com/CryptoKey\"\x85\x01\n\x13VmwareSourceDetails\x12\x10\n\x08username\x18\x01 \x01(\t\x12\x15\n\x08password\x18\x02 \x01(\tB\x03\xe0\x41\x04\x12\x12\n\nvcenter_ip\x18\x03 \x01(\t\x12\x12\n\nthumbprint\x18\x04 \x01(\t\x12\x1d\n\x15resolved_vcenter_host\x18\x05 \x01(\t\"\xb5\x06\n\x10\x41wsSourceDetails\x12^\n\x10\x61\x63\x63\x65ss_key_creds\x18\x0b \x01(\x0b\x32\x42.google.cloud.vmmigration.v1.AwsSourceDetails.AccessKeyCredentialsH\x00\x12\x17\n\naws_region\x18\x03 \x01(\tB\x03\xe0\x41\x05\x12G\n\x05state\x18\x04 \x01(\x0e\x32\x33.google.cloud.vmmigration.v1.AwsSourceDetails.StateB\x03\xe0\x41\x03\x12&\n\x05\x65rror\x18\x05 \x01(\x0b\x32\x12.google.rpc.StatusB\x03\xe0\x41\x03\x12M\n\x12inventory_tag_list\x18\n \x03(\x0b\x32\x31.google.cloud.vmmigration.v1.AwsSourceDetails.Tag\x12&\n\x1einventory_security_group_names\x18\x07 \x03(\t\x12t\n\x1dmigration_resources_user_tags\x18\x08 \x03(\x0b\x32M.google.cloud.vmmigration.v1.AwsSourceDetails.MigrationResourcesUserTagsEntry\x12\x16\n\tpublic_ip\x18\t \x01(\tB\x03\xe0\x41\x03\x1ai\n\x14\x41\x63\x63\x65ssKeyCredentials\x12\x15\n\raccess_key_id\x18\x01 \x01(\t\x12\x1e\n\x11secret_access_key\x18\x02 \x01(\tB\x03\xe0\x41\x04\x12\x1a\n\rsession_token\x18\x03 \x01(\tB\x03\xe0\x41\x04\x1a+\n\x03Tag\x12\x10\n\x03key\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x12\n\x05value\x18\x02 \x01(\tB\x03\xe0\x41\x02\x1a\x41\n\x1fMigrationResourcesUserTagsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"C\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0b\n\x07PENDING\x10\x01\x12\n\n\x06\x46\x41ILED\x10\x02\x12\n\n\x06\x41\x43TIVE\x10\x03\x42\x12\n\x10\x63redentials_type\"\xbb\x05\n\x12\x41zureSourceDetails\x12\x66\n\x13\x63lient_secret_creds\x18\t \x01(\x0b\x32G.google.cloud.vmmigration.v1.AzureSourceDetails.ClientSecretCredentialsH\x00\x12\x1c\n\x0fsubscription_id\x18\x01 \x01(\tB\x03\xe0\x41\x05\x12\x1b\n\x0e\x61zure_location\x18\x05 \x01(\tB\x03\xe0\x41\x05\x12I\n\x05state\x18\x06 \x01(\x0e\x32\x35.google.cloud.vmmigration.v1.AzureSourceDetails.StateB\x03\xe0\x41\x03\x12&\n\x05\x65rror\x18\x07 \x01(\x0b\x32\x12.google.rpc.StatusB\x03\xe0\x41\x03\x12v\n\x1dmigration_resources_user_tags\x18\x08 \x03(\x0b\x32O.google.cloud.vmmigration.v1.AzureSourceDetails.MigrationResourcesUserTagsEntry\x12\x1e\n\x11resource_group_id\x18\n \x01(\tB\x03\xe0\x41\x03\x1a[\n\x17\x43lientSecretCredentials\x12\x11\n\ttenant_id\x18\x01 \x01(\t\x12\x11\n\tclient_id\x18\x02 \x01(\t\x12\x1a\n\rclient_secret\x18\x03 \x01(\tB\x03\xe0\x41\x04\x1a\x41\n\x1fMigrationResourcesUserTagsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"C\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0b\n\x07PENDING\x10\x01\x12\n\n\x06\x46\x41ILED\x10\x02\x12\n\n\x06\x41\x43TIVE\x10\x03\x42\x12\n\x10\x63redentials_type\"\xfa\x06\n\x13\x44\x61tacenterConnector\x12\x34\n\x0b\x63reate_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x11\n\x04name\x18\x03 \x01(\tB\x03\xe0\x41\x03\x12\x1c\n\x0fregistration_id\x18\x0c \x01(\tB\x03\xe0\x41\x05\x12\x17\n\x0fservice_account\x18\x05 \x01(\t\x12\x0f\n\x07version\x18\x06 \x01(\t\x12\x13\n\x06\x62ucket\x18\n \x01(\tB\x03\xe0\x41\x03\x12J\n\x05state\x18\x07 \x01(\x0e\x32\x36.google.cloud.vmmigration.v1.DatacenterConnector.StateB\x03\xe0\x41\x03\x12\x33\n\nstate_time\x18\x08 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12&\n\x05\x65rror\x18\x0b \x01(\x0b\x32\x12.google.rpc.StatusB\x03\xe0\x41\x03\x12-\n appliance_infrastructure_version\x18\r \x01(\tB\x03\xe0\x41\x03\x12\'\n\x1a\x61ppliance_software_version\x18\x0e \x01(\tB\x03\xe0\x41\x03\x12N\n\x12\x61vailable_versions\x18\x0f \x01(\x0b\x32-.google.cloud.vmmigration.v1.AvailableUpdatesB\x03\xe0\x41\x03\x12G\n\x0eupgrade_status\x18\x10 \x01(\x0b\x32*.google.cloud.vmmigration.v1.UpgradeStatusB\x03\xe0\x41\x03\"P\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0b\n\x07PENDING\x10\x01\x12\x0b\n\x07OFFLINE\x10\x02\x12\n\n\x06\x46\x41ILED\x10\x03\x12\n\n\x06\x41\x43TIVE\x10\x04:\x9a\x01\xea\x41\x96\x01\n.vmmigration.googleapis.com/DatacenterConnector\x12\x64projects/{project}/locations/{location}/sources/{source}/datacenterConnectors/{datacenter_connector}\"\x9b\x02\n\rUpgradeStatus\x12\x0f\n\x07version\x18\x01 \x01(\t\x12?\n\x05state\x18\x02 \x01(\x0e\x32\x30.google.cloud.vmmigration.v1.UpgradeStatus.State\x12&\n\x05\x65rror\x18\x03 \x01(\x0b\x32\x12.google.rpc.StatusB\x03\xe0\x41\x03\x12.\n\nstart_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x18\n\x10previous_version\x18\x05 \x01(\t\"F\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0b\n\x07RUNNING\x10\x01\x12\n\n\x06\x46\x41ILED\x10\x02\x12\r\n\tSUCCEEDED\x10\x03\"\xab\x01\n\x10\x41vailableUpdates\x12O\n\x18new_deployable_appliance\x18\x01 \x01(\x0b\x32-.google.cloud.vmmigration.v1.ApplianceVersion\x12\x46\n\x0fin_place_update\x18\x02 \x01(\x0b\x32-.google.cloud.vmmigration.v1.ApplianceVersion\"]\n\x10\x41pplianceVersion\x12\x0f\n\x07version\x18\x01 \x01(\t\x12\x0b\n\x03uri\x18\x02 \x01(\t\x12\x10\n\x08\x63ritical\x18\x03 \x01(\x08\x12\x19\n\x11release_notes_uri\x18\x04 \x01(\t\"\xac\x01\n\x12ListSourcesRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\x12!vmmigration.googleapis.com/Source\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\x02\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\"\x88\x01\n\x13ListSourcesResponse\x12\x39\n\x07sources\x18\x01 \x03(\x0b\x32#.google.cloud.vmmigration.v1.SourceB\x03\xe0\x41\x03\x12\x1c\n\x0fnext_page_token\x18\x02 \x01(\tB\x03\xe0\x41\x03\x12\x18\n\x0bunreachable\x18\x03 \x03(\tB\x03\xe0\x41\x03\"K\n\x10GetSourceRequest\x12\x37\n\x04name\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!vmmigration.googleapis.com/Source\"\xb6\x01\n\x13\x43reateSourceRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\x12!vmmigration.googleapis.com/Source\x12\x16\n\tsource_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x38\n\x06source\x18\x03 \x01(\x0b\x32#.google.cloud.vmmigration.v1.SourceB\x03\xe0\x41\x02\x12\x12\n\nrequest_id\x18\x04 \x01(\t\"\x94\x01\n\x13UpdateSourceRequest\x12/\n\x0bupdate_mask\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\x12\x38\n\x06source\x18\x02 \x01(\x0b\x32#.google.cloud.vmmigration.v1.SourceB\x03\xe0\x41\x02\x12\x12\n\nrequest_id\x18\x03 \x01(\t\"g\n\x13\x44\x65leteSourceRequest\x12\x37\n\x04name\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!vmmigration.googleapis.com/Source\x12\x17\n\nrequest_id\x18\x02 \x01(\tB\x03\xe0\x41\x01\"i\n\x15\x46\x65tchInventoryRequest\x12\x39\n\x06source\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!vmmigration.googleapis.com/Source\x12\x15\n\rforce_refresh\x18\x02 \x01(\x08\"\xde\x05\n\x0fVmwareVmDetails\x12\r\n\x05vm_id\x18\x01 \x01(\t\x12\x15\n\rdatacenter_id\x18\x02 \x01(\t\x12\x1e\n\x16\x64\x61tacenter_description\x18\x03 \x01(\t\x12\x0c\n\x04uuid\x18\x04 \x01(\t\x12\x14\n\x0c\x64isplay_name\x18\x05 \x01(\t\x12L\n\x0bpower_state\x18\x06 \x01(\x0e\x32\x37.google.cloud.vmmigration.v1.VmwareVmDetails.PowerState\x12\x11\n\tcpu_count\x18\x07 \x01(\x05\x12\x11\n\tmemory_mb\x18\x08 \x01(\x05\x12\x12\n\ndisk_count\x18\t \x01(\x05\x12\x1c\n\x14\x63ommitted_storage_mb\x18\x0c \x01(\x03\x12\x19\n\x11guest_description\x18\x0b \x01(\t\x12Q\n\x0b\x62oot_option\x18\r \x01(\x0e\x32\x37.google.cloud.vmmigration.v1.VmwareVmDetails.BootOptionB\x03\xe0\x41\x03\x12V\n\x0c\x61rchitecture\x18\x0e \x01(\x0e\x32;.google.cloud.vmmigration.v1.VmwareVmDetails.VmArchitectureB\x03\xe0\x41\x03\"I\n\nPowerState\x12\x1b\n\x17POWER_STATE_UNSPECIFIED\x10\x00\x12\x06\n\x02ON\x10\x01\x12\x07\n\x03OFF\x10\x02\x12\r\n\tSUSPENDED\x10\x03\"<\n\nBootOption\x12\x1b\n\x17\x42OOT_OPTION_UNSPECIFIED\x10\x00\x12\x07\n\x03\x45\x46I\x10\x01\x12\x08\n\x04\x42IOS\x10\x02\"l\n\x0eVmArchitecture\x12\x1f\n\x1bVM_ARCHITECTURE_UNSPECIFIED\x10\x00\x12\x1e\n\x1aVM_ARCHITECTURE_X86_FAMILY\x10\x01\x12\x19\n\x15VM_ARCHITECTURE_ARM64\x10\x02\"\xef\x08\n\x0c\x41wsVmDetails\x12\r\n\x05vm_id\x18\x01 \x01(\t\x12\x14\n\x0c\x64isplay_name\x18\x02 \x01(\t\x12\x11\n\tsource_id\x18\x03 \x01(\t\x12\x1a\n\x12source_description\x18\x04 \x01(\t\x12N\n\x0bpower_state\x18\x05 \x01(\x0e\x32\x34.google.cloud.vmmigration.v1.AwsVmDetails.PowerStateB\x03\xe0\x41\x03\x12\x11\n\tcpu_count\x18\x06 \x01(\x05\x12\x11\n\tmemory_mb\x18\x07 \x01(\x05\x12\x12\n\ndisk_count\x18\x08 \x01(\x05\x12\x1c\n\x14\x63ommitted_storage_mb\x18\t \x01(\x03\x12\x16\n\x0eos_description\x18\n \x01(\t\x12I\n\x0b\x62oot_option\x18\x0b \x01(\x0e\x32\x34.google.cloud.vmmigration.v1.AwsVmDetails.BootOption\x12\x15\n\rinstance_type\x18\x0c \x01(\t\x12\x0e\n\x06vpc_id\x18\r \x01(\t\x12\x46\n\x0fsecurity_groups\x18\x0e \x03(\x0b\x32-.google.cloud.vmmigration.v1.AwsSecurityGroup\x12\x41\n\x04tags\x18\x0f \x03(\x0b\x32\x33.google.cloud.vmmigration.v1.AwsVmDetails.TagsEntry\x12\x0c\n\x04zone\x18\x10 \x01(\t\x12[\n\x13virtualization_type\x18\x11 \x01(\x0e\x32>.google.cloud.vmmigration.v1.AwsVmDetails.VmVirtualizationType\x12N\n\x0c\x61rchitecture\x18\x12 \x01(\x0e\x32\x38.google.cloud.vmmigration.v1.AwsVmDetails.VmArchitecture\x12\x12\n\nvcpu_count\x18\x13 \x01(\x05\x1a+\n\tTagsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"V\n\nPowerState\x12\x1b\n\x17POWER_STATE_UNSPECIFIED\x10\x00\x12\x06\n\x02ON\x10\x01\x12\x07\n\x03OFF\x10\x02\x12\r\n\tSUSPENDED\x10\x03\x12\x0b\n\x07PENDING\x10\x04\"<\n\nBootOption\x12\x1b\n\x17\x42OOT_OPTION_UNSPECIFIED\x10\x00\x12\x07\n\x03\x45\x46I\x10\x01\x12\x08\n\x04\x42IOS\x10\x02\"X\n\x14VmVirtualizationType\x12&\n\"VM_VIRTUALIZATION_TYPE_UNSPECIFIED\x10\x00\x12\x07\n\x03HVM\x10\x01\x12\x0f\n\x0bPARAVIRTUAL\x10\x02\"b\n\x0eVmArchitecture\x12\x1f\n\x1bVM_ARCHITECTURE_UNSPECIFIED\x10\x00\x12\x08\n\x04I386\x10\x01\x12\n\n\x06X86_64\x10\x02\x12\t\n\x05\x41RM64\x10\x03\x12\x0e\n\nX86_64_MAC\x10\x04\",\n\x10\x41wsSecurityGroup\x12\n\n\x02id\x18\x01 \x01(\t\x12\x0c\n\x04name\x18\x02 \x01(\t\"\xce\t\n\x0e\x41zureVmDetails\x12\r\n\x05vm_id\x18\x01 \x01(\t\x12K\n\x0bpower_state\x18\x02 \x01(\x0e\x32\x36.google.cloud.vmmigration.v1.AzureVmDetails.PowerState\x12\x0f\n\x07vm_size\x18\x03 \x01(\t\x12\x11\n\tcpu_count\x18\x04 \x01(\x05\x12\x11\n\tmemory_mb\x18\x05 \x01(\x05\x12\x12\n\ndisk_count\x18\x06 \x01(\x05\x12\x1c\n\x14\x63ommitted_storage_mb\x18\x07 \x01(\x03\x12\x43\n\x07os_disk\x18\x08 \x01(\x0b\x32\x32.google.cloud.vmmigration.v1.AzureVmDetails.OSDisk\x12?\n\x05\x64isks\x18\t \x03(\x0b\x32\x30.google.cloud.vmmigration.v1.AzureVmDetails.Disk\x12Q\n\x0eos_description\x18\n \x01(\x0b\x32\x39.google.cloud.vmmigration.v1.AzureVmDetails.OSDescription\x12K\n\x0b\x62oot_option\x18\x0b \x01(\x0e\x32\x36.google.cloud.vmmigration.v1.AzureVmDetails.BootOption\x12\x43\n\x04tags\x18\x0c \x03(\x0b\x32\x35.google.cloud.vmmigration.v1.AzureVmDetails.TagsEntry\x12\x15\n\rcomputer_name\x18\r \x01(\t\x12P\n\x0c\x61rchitecture\x18\x0e \x01(\x0e\x32:.google.cloud.vmmigration.v1.AzureVmDetails.VmArchitecture\x1a\x35\n\x06OSDisk\x12\x0c\n\x04type\x18\x01 \x01(\t\x12\x0c\n\x04name\x18\x02 \x01(\t\x12\x0f\n\x07size_gb\x18\x03 \x01(\x05\x1a\x32\n\x04\x44isk\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x0f\n\x07size_gb\x18\x02 \x01(\x05\x12\x0b\n\x03lun\x18\x03 \x01(\x05\x1aM\n\rOSDescription\x12\x0c\n\x04type\x18\x01 \x01(\t\x12\x11\n\tpublisher\x18\x02 \x01(\t\x12\r\n\x05offer\x18\x03 \x01(\t\x12\x0c\n\x04plan\x18\x04 \x01(\t\x1a+\n\tTagsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\x8f\x01\n\nPowerState\x12\x1b\n\x17POWER_STATE_UNSPECIFIED\x10\x00\x12\x0c\n\x08STARTING\x10\x01\x12\x0b\n\x07RUNNING\x10\x02\x12\x0c\n\x08STOPPING\x10\x03\x12\x0b\n\x07STOPPED\x10\x04\x12\x10\n\x0c\x44\x45\x41LLOCATING\x10\x05\x12\x0f\n\x0b\x44\x45\x41LLOCATED\x10\x06\x12\x0b\n\x07UNKNOWN\x10\x07\"<\n\nBootOption\x12\x1b\n\x17\x42OOT_OPTION_UNSPECIFIED\x10\x00\x12\x07\n\x03\x45\x46I\x10\x01\x12\x08\n\x04\x42IOS\x10\x02\"l\n\x0eVmArchitecture\x12\x1f\n\x1bVM_ARCHITECTURE_UNSPECIFIED\x10\x00\x12\x1e\n\x1aVM_ARCHITECTURE_X86_FAMILY\x10\x01\x12\x19\n\x15VM_ARCHITECTURE_ARM64\x10\x02\"Q\n\x10VmwareVmsDetails\x12=\n\x07\x64\x65tails\x18\x01 \x03(\x0b\x32,.google.cloud.vmmigration.v1.VmwareVmDetails\"K\n\rAwsVmsDetails\x12:\n\x07\x64\x65tails\x18\x01 \x03(\x0b\x32).google.cloud.vmmigration.v1.AwsVmDetails\"O\n\x0f\x41zureVmsDetails\x12<\n\x07\x64\x65tails\x18\x01 \x03(\x0b\x32+.google.cloud.vmmigration.v1.AzureVmDetails\"\xa2\x02\n\x16\x46\x65tchInventoryResponse\x12\x43\n\nvmware_vms\x18\x01 \x01(\x0b\x32-.google.cloud.vmmigration.v1.VmwareVmsDetailsH\x00\x12=\n\x07\x61ws_vms\x18\x03 \x01(\x0b\x32*.google.cloud.vmmigration.v1.AwsVmsDetailsH\x00\x12\x41\n\tazure_vms\x18\x05 \x01(\x0b\x32,.google.cloud.vmmigration.v1.AzureVmsDetailsH\x00\x12\x34\n\x0bupdate_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x42\x0b\n\tSourceVms\"\xc7\x02\n\x1c\x46\x65tchStorageInventoryRequest\x12\x39\n\x06source\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!vmmigration.googleapis.com/Source\x12X\n\x04type\x18\x02 \x01(\x0e\x32\x45.google.cloud.vmmigration.v1.FetchStorageInventoryRequest.StorageTypeB\x03\xe0\x41\x02\x12\x1a\n\rforce_refresh\x18\x03 \x01(\x08\x42\x03\xe0\x41\x01\x12\x16\n\tpage_size\x18\x04 \x01(\x05\x42\x03\xe0\x41\x01\x12\x17\n\npage_token\x18\x05 \x01(\tB\x03\xe0\x41\x01\"E\n\x0bStorageType\x12\x1c\n\x18STORAGE_TYPE_UNSPECIFIED\x10\x00\x12\t\n\x05\x44ISKS\x10\x01\x12\r\n\tSNAPSHOTS\x10\x02\"\xba\x01\n\x1d\x46\x65tchStorageInventoryResponse\x12\x45\n\tresources\x18\x01 \x03(\x0b\x32\x32.google.cloud.vmmigration.v1.SourceStorageResource\x12\x34\n\x0bupdate_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x1c\n\x0fnext_page_token\x18\x03 \x01(\tB\x03\xe0\x41\x03\"y\n\x15SourceStorageResource\x12M\n\x10\x61ws_disk_details\x18\x01 \x01(\x0b\x32\x31.google.cloud.vmmigration.v1.AwsSourceDiskDetailsH\x00\x42\x11\n\x0fStorageResource\"\x9c\x06\n\x11UtilizationReport\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x14\n\x0c\x64isplay_name\x18\x02 \x01(\t\x12H\n\x05state\x18\x03 \x01(\x0e\x32\x34.google.cloud.vmmigration.v1.UtilizationReport.StateB\x03\xe0\x41\x03\x12\x33\n\nstate_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12&\n\x05\x65rror\x18\x05 \x01(\x0b\x32\x12.google.rpc.StatusB\x03\xe0\x41\x03\x12\x34\n\x0b\x63reate_time\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12L\n\ntime_frame\x18\x07 \x01(\x0e\x32\x38.google.cloud.vmmigration.v1.UtilizationReport.TimeFrame\x12\x37\n\x0e\x66rame_end_time\x18\x08 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x15\n\x08vm_count\x18\t \x01(\x05\x42\x03\xe0\x41\x03\x12;\n\x03vms\x18\n \x03(\x0b\x32..google.cloud.vmmigration.v1.VmUtilizationInfo\"G\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0c\n\x08\x43REATING\x10\x01\x12\r\n\tSUCCEEDED\x10\x02\x12\n\n\x06\x46\x41ILED\x10\x03\"F\n\tTimeFrame\x12\x1a\n\x16TIME_FRAME_UNSPECIFIED\x10\x00\x12\x08\n\x04WEEK\x10\x01\x12\t\n\x05MONTH\x10\x02\x12\x08\n\x04YEAR\x10\x03:\x94\x01\xea\x41\x90\x01\n,vmmigration.googleapis.com/UtilizationReport\x12`projects/{project}/locations/{location}/sources/{source}/utilizationReports/{utilization_report}\"\xc2\x01\n\x11VmUtilizationInfo\x12I\n\x11vmware_vm_details\x18\x01 \x01(\x0b\x32,.google.cloud.vmmigration.v1.VmwareVmDetailsH\x00\x12\r\n\x05vm_id\x18\x03 \x01(\t\x12\x46\n\x0butilization\x18\x02 \x01(\x0b\x32\x31.google.cloud.vmmigration.v1.VmUtilizationMetricsB\x0b\n\tVmDetails\"\x98\x02\n\x14VmUtilizationMetrics\x12\x17\n\x0f\x63pu_max_percent\x18\t \x01(\x05\x12\x1b\n\x13\x63pu_average_percent\x18\n \x01(\x05\x12\x1a\n\x12memory_max_percent\x18\x0b \x01(\x05\x12\x1e\n\x16memory_average_percent\x18\x0c \x01(\x05\x12\x1d\n\x15\x64isk_io_rate_max_kbps\x18\r \x01(\x03\x12!\n\x19\x64isk_io_rate_average_kbps\x18\x0e \x01(\x03\x12#\n\x1bnetwork_throughput_max_kbps\x18\x0f \x01(\x03\x12\'\n\x1fnetwork_throughput_average_kbps\x18\x10 \x01(\x03\"\x89\x02\n\x1dListUtilizationReportsRequest\x12\x44\n\x06parent\x18\x01 \x01(\tB4\xe0\x41\x02\xfa\x41.\x12,vmmigration.googleapis.com/UtilizationReport\x12\x45\n\x04view\x18\x02 \x01(\x0e\x32\x32.google.cloud.vmmigration.v1.UtilizationReportViewB\x03\xe0\x41\x01\x12\x16\n\tpage_size\x18\x03 \x01(\x05\x42\x03\xe0\x41\x01\x12\x17\n\npage_token\x18\x04 \x01(\tB\x03\xe0\x41\x02\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\"\xaa\x01\n\x1eListUtilizationReportsResponse\x12P\n\x13utilization_reports\x18\x01 \x03(\x0b\x32..google.cloud.vmmigration.v1.UtilizationReportB\x03\xe0\x41\x03\x12\x1c\n\x0fnext_page_token\x18\x02 \x01(\tB\x03\xe0\x41\x03\x12\x18\n\x0bunreachable\x18\x03 \x03(\tB\x03\xe0\x41\x03\"\xa8\x01\n\x1bGetUtilizationReportRequest\x12\x42\n\x04name\x18\x01 \x01(\tB4\xe0\x41\x02\xfa\x41.\n,vmmigration.googleapis.com/UtilizationReport\x12\x45\n\x04view\x18\x02 \x01(\x0e\x32\x32.google.cloud.vmmigration.v1.UtilizationReportViewB\x03\xe0\x41\x01\"\xef\x01\n\x1e\x43reateUtilizationReportRequest\x12\x44\n\x06parent\x18\x01 \x01(\tB4\xe0\x41\x02\xfa\x41.\x12,vmmigration.googleapis.com/UtilizationReport\x12O\n\x12utilization_report\x18\x02 \x01(\x0b\x32..google.cloud.vmmigration.v1.UtilizationReportB\x03\xe0\x41\x02\x12\"\n\x15utilization_report_id\x18\x03 \x01(\tB\x03\xe0\x41\x02\x12\x12\n\nrequest_id\x18\x04 \x01(\t\"}\n\x1e\x44\x65leteUtilizationReportRequest\x12\x42\n\x04name\x18\x01 \x01(\tB4\xe0\x41\x02\xfa\x41.\n,vmmigration.googleapis.com/UtilizationReport\x12\x17\n\nrequest_id\x18\x02 \x01(\tB\x03\xe0\x41\x01\"\xb0\x01\n ListDatacenterConnectorsResponse\x12T\n\x15\x64\x61tacenter_connectors\x18\x01 \x03(\x0b\x32\x30.google.cloud.vmmigration.v1.DatacenterConnectorB\x03\xe0\x41\x03\x12\x1c\n\x0fnext_page_token\x18\x02 \x01(\tB\x03\xe0\x41\x03\x12\x18\n\x0bunreachable\x18\x03 \x03(\tB\x03\xe0\x41\x03\"e\n\x1dGetDatacenterConnectorRequest\x12\x44\n\x04name\x18\x01 \x01(\tB6\xe0\x41\x02\xfa\x41\x30\n.vmmigration.googleapis.com/DatacenterConnector\"\xf9\x01\n CreateDatacenterConnectorRequest\x12\x46\n\x06parent\x18\x01 \x01(\tB6\xe0\x41\x02\xfa\x41\x30\x12.vmmigration.googleapis.com/DatacenterConnector\x12$\n\x17\x64\x61tacenter_connector_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12S\n\x14\x64\x61tacenter_connector\x18\x03 \x01(\x0b\x32\x30.google.cloud.vmmigration.v1.DatacenterConnectorB\x03\xe0\x41\x02\x12\x12\n\nrequest_id\x18\x04 \x01(\t\"|\n DeleteDatacenterConnectorRequest\x12\x44\n\x04name\x18\x01 \x01(\tB6\xe0\x41\x02\xfa\x41\x30\n.vmmigration.googleapis.com/DatacenterConnector\x12\x12\n\nrequest_id\x18\x02 \x01(\t\"\x83\x01\n\x17UpgradeApplianceRequest\x12T\n\x14\x64\x61tacenter_connector\x18\x01 \x01(\tB6\xe0\x41\x02\xfa\x41\x30\n.vmmigration.googleapis.com/DatacenterConnector\x12\x12\n\nrequest_id\x18\x02 \x01(\t\"\x1a\n\x18UpgradeApplianceResponse\"\xc6\x01\n\x1fListDatacenterConnectorsRequest\x12\x46\n\x06parent\x18\x01 \x01(\tB6\xe0\x41\x02\xfa\x41\x30\x12.vmmigration.googleapis.com/DatacenterConnector\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\x02\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\"\xe8\n\n\x1b\x43omputeEngineTargetDefaults\x12\x0f\n\x07vm_name\x18\x01 \x01(\t\x12\x45\n\x0etarget_project\x18\x02 \x01(\tB-\xfa\x41*\n(vmmigration.googleapis.com/TargetProject\x12\x0c\n\x04zone\x18\x03 \x01(\t\x12\x1b\n\x13machine_type_series\x18\x04 \x01(\t\x12\x14\n\x0cmachine_type\x18\x05 \x01(\t\x12\x14\n\x0cnetwork_tags\x18\x06 \x03(\t\x12I\n\x12network_interfaces\x18\x07 \x03(\x0b\x32-.google.cloud.vmmigration.v1.NetworkInterface\x12\x1c\n\x0fservice_account\x18\x08 \x01(\tB\x03\xe0\x41\x01\x12\x45\n\tdisk_type\x18\t \x01(\x0e\x32\x32.google.cloud.vmmigration.v1.ComputeEngineDiskType\x12T\n\x06labels\x18\n \x03(\x0b\x32\x44.google.cloud.vmmigration.v1.ComputeEngineTargetDefaults.LabelsEntry\x12K\n\x0clicense_type\x18\x0b \x01(\x0e\x32\x35.google.cloud.vmmigration.v1.ComputeEngineLicenseType\x12I\n\x0f\x61pplied_license\x18\x0c \x01(\x0b\x32+.google.cloud.vmmigration.v1.AppliedLicenseB\x03\xe0\x41\x03\x12J\n\x12\x63ompute_scheduling\x18\r \x01(\x0b\x32..google.cloud.vmmigration.v1.ComputeScheduling\x12\x13\n\x0bsecure_boot\x18\x0e \x01(\x08\x12\x18\n\x0b\x65nable_vtpm\x18\x15 \x01(\x08\x42\x03\xe0\x41\x01\x12(\n\x1b\x65nable_integrity_monitoring\x18\x16 \x01(\x08\x42\x03\xe0\x41\x01\x12N\n\x0b\x62oot_option\x18\x0f \x01(\x0e\x32\x34.google.cloud.vmmigration.v1.ComputeEngineBootOptionB\x03\xe0\x41\x03\x12X\n\x08metadata\x18\x10 \x03(\x0b\x32\x46.google.cloud.vmmigration.v1.ComputeEngineTargetDefaults.MetadataEntry\x12\x1b\n\x13\x61\x64\x64itional_licenses\x18\x11 \x03(\t\x12\x10\n\x08hostname\x18\x12 \x01(\t\x12\x43\n\nencryption\x18\x13 \x01(\x0b\x32\'.google.cloud.vmmigration.v1.EncryptionB\x06\xe0\x41\x01\xe0\x41\x05\x12I\n\x0f\x62oot_conversion\x18\x14 \x01(\x0e\x32+.google.cloud.vmmigration.v1.BootConversionB\x03\xe0\x41\x01\x12R\n\x14\x61\x64\x61ptation_modifiers\x18\x17 \x03(\x0b\x32/.google.cloud.vmmigration.v1.AdaptationModifierB\x03\xe0\x41\x01\x12\x1f\n\x12\x64isk_replica_zones\x18\x18 \x03(\tB\x03\xe0\x41\x01\x12\x19\n\x0cstorage_pool\x18\x19 \x01(\tB\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\x1a/\n\rMetadataEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"?\n\x12\x41\x64\x61ptationModifier\x12\x15\n\x08modifier\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12\x12\n\x05value\x18\x02 \x01(\tB\x03\xe0\x41\x01\"\x9d\n\n\x1a\x43omputeEngineTargetDetails\x12\x0f\n\x07vm_name\x18\x01 \x01(\t\x12\x0f\n\x07project\x18\x02 \x01(\t\x12\x0c\n\x04zone\x18\x03 \x01(\t\x12\x1b\n\x13machine_type_series\x18\x04 \x01(\t\x12\x14\n\x0cmachine_type\x18\x05 \x01(\t\x12\x14\n\x0cnetwork_tags\x18\x06 \x03(\t\x12I\n\x12network_interfaces\x18\x07 \x03(\x0b\x32-.google.cloud.vmmigration.v1.NetworkInterface\x12\x17\n\x0fservice_account\x18\x08 \x01(\t\x12\x45\n\tdisk_type\x18\t \x01(\x0e\x32\x32.google.cloud.vmmigration.v1.ComputeEngineDiskType\x12S\n\x06labels\x18\n \x03(\x0b\x32\x43.google.cloud.vmmigration.v1.ComputeEngineTargetDetails.LabelsEntry\x12K\n\x0clicense_type\x18\x0b \x01(\x0e\x32\x35.google.cloud.vmmigration.v1.ComputeEngineLicenseType\x12\x44\n\x0f\x61pplied_license\x18\x0c \x01(\x0b\x32+.google.cloud.vmmigration.v1.AppliedLicense\x12J\n\x12\x63ompute_scheduling\x18\r \x01(\x0b\x32..google.cloud.vmmigration.v1.ComputeScheduling\x12\x13\n\x0bsecure_boot\x18\x0e \x01(\x08\x12\x18\n\x0b\x65nable_vtpm\x18\x15 \x01(\x08\x42\x03\xe0\x41\x01\x12(\n\x1b\x65nable_integrity_monitoring\x18\x16 \x01(\x08\x42\x03\xe0\x41\x01\x12I\n\x0b\x62oot_option\x18\x0f \x01(\x0e\x32\x34.google.cloud.vmmigration.v1.ComputeEngineBootOption\x12W\n\x08metadata\x18\x10 \x03(\x0b\x32\x45.google.cloud.vmmigration.v1.ComputeEngineTargetDetails.MetadataEntry\x12\x1b\n\x13\x61\x64\x64itional_licenses\x18\x11 \x03(\t\x12\x10\n\x08hostname\x18\x12 \x01(\t\x12@\n\nencryption\x18\x13 \x01(\x0b\x32\'.google.cloud.vmmigration.v1.EncryptionB\x03\xe0\x41\x01\x12I\n\x0f\x62oot_conversion\x18\x14 \x01(\x0e\x32+.google.cloud.vmmigration.v1.BootConversionB\x03\xe0\x41\x01\x12R\n\x14\x61\x64\x61ptation_modifiers\x18\x17 \x03(\x0b\x32/.google.cloud.vmmigration.v1.AdaptationModifierB\x03\xe0\x41\x01\x12\x1f\n\x12\x64isk_replica_zones\x18\x18 \x03(\tB\x03\xe0\x41\x01\x12\x19\n\x0cstorage_pool\x18\x19 \x01(\tB\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\x1a/\n\rMetadataEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\xc7\x01\n\x10NetworkInterface\x12\x14\n\x07network\x18\x01 \x01(\tB\x03\xe0\x41\x01\x12\x17\n\nsubnetwork\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x18\n\x0binternal_ip\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12\x18\n\x0b\x65xternal_ip\x18\x04 \x01(\tB\x03\xe0\x41\x01\x12P\n\x0cnetwork_tier\x18\x05 \x01(\x0e\x32\x35.google.cloud.vmmigration.v1.ComputeEngineNetworkTierB\x03\xe0\x41\x01\"\xa0\x01\n\x0e\x41ppliedLicense\x12>\n\x04type\x18\x01 \x01(\x0e\x32\x30.google.cloud.vmmigration.v1.AppliedLicense.Type\x12\x12\n\nos_license\x18\x02 \x01(\t\":\n\x04Type\x12\x14\n\x10TYPE_UNSPECIFIED\x10\x00\x12\x08\n\x04NONE\x10\x01\x12\x08\n\x04PAYG\x10\x02\x12\x08\n\x04\x42YOL\x10\x03\"\xbf\x01\n\x16SchedulingNodeAffinity\x12\x0b\n\x03key\x18\x01 \x01(\t\x12N\n\x08operator\x18\x02 \x01(\x0e\x32<.google.cloud.vmmigration.v1.SchedulingNodeAffinity.Operator\x12\x0e\n\x06values\x18\x03 \x03(\t\"8\n\x08Operator\x12\x18\n\x14OPERATOR_UNSPECIFIED\x10\x00\x12\x06\n\x02IN\x10\x01\x12\n\n\x06NOT_IN\x10\x02\"\xdd\x03\n\x11\x43omputeScheduling\x12]\n\x13on_host_maintenance\x18\x01 \x01(\x0e\x32@.google.cloud.vmmigration.v1.ComputeScheduling.OnHostMaintenance\x12P\n\x0crestart_type\x18\x05 \x01(\x0e\x32:.google.cloud.vmmigration.v1.ComputeScheduling.RestartType\x12L\n\x0fnode_affinities\x18\x03 \x03(\x0b\x32\x33.google.cloud.vmmigration.v1.SchedulingNodeAffinity\x12\x15\n\rmin_node_cpus\x18\x04 \x01(\x05\"T\n\x11OnHostMaintenance\x12#\n\x1fON_HOST_MAINTENANCE_UNSPECIFIED\x10\x00\x12\r\n\tTERMINATE\x10\x01\x12\x0b\n\x07MIGRATE\x10\x02\"\\\n\x0bRestartType\x12\x1c\n\x18RESTART_TYPE_UNSPECIFIED\x10\x00\x12\x15\n\x11\x41UTOMATIC_RESTART\x10\x01\x12\x18\n\x14NO_AUTOMATIC_RESTART\x10\x02\"\x92\x03\n ComputeEngineDisksTargetDefaults\x12\x0e\n\x04zone\x18\x02 \x01(\tH\x00\x12_\n\x15\x64isks_target_defaults\x18\x05 \x01(\x0b\x32>.google.cloud.vmmigration.v1.DisksMigrationDisksTargetDefaultsH\x01\x12Y\n\x12vm_target_defaults\x18\x06 \x01(\x0b\x32;.google.cloud.vmmigration.v1.DisksMigrationVmTargetDefaultsH\x01\x12\x45\n\x0etarget_project\x18\x01 \x01(\tB-\xfa\x41*\n(vmmigration.googleapis.com/TargetProject\x12\x42\n\x05\x64isks\x18\x04 \x03(\x0b\x32\x33.google.cloud.vmmigration.v1.PersistentDiskDefaultsB\n\n\x08locationB\x0b\n\tvm_target\"\xcf\x03\n\x16PersistentDiskDefaults\x12\x1f\n\x12source_disk_number\x18\x01 \x01(\x05\x42\x03\xe0\x41\x02\x12\x16\n\tdisk_name\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x45\n\tdisk_type\x18\x03 \x01(\x0e\x32\x32.google.cloud.vmmigration.v1.ComputeEngineDiskType\x12\x64\n\x11\x61\x64\x64itional_labels\x18\x04 \x03(\x0b\x32I.google.cloud.vmmigration.v1.PersistentDiskDefaults.AdditionalLabelsEntry\x12@\n\nencryption\x18\x05 \x01(\x0b\x32\'.google.cloud.vmmigration.v1.EncryptionB\x03\xe0\x41\x01\x12T\n\x15vm_attachment_details\x18\x06 \x01(\x0b\x32\x30.google.cloud.vmmigration.v1.VmAttachmentDetailsB\x03\xe0\x41\x01\x1a\x37\n\x15\x41\x64\x64itionalLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"/\n\x13VmAttachmentDetails\x12\x18\n\x0b\x64\x65vice_name\x18\x01 \x01(\tB\x03\xe0\x41\x01\"#\n!DisksMigrationDisksTargetDefaults\"\x96\x07\n\x1e\x44isksMigrationVmTargetDefaults\x12\x14\n\x07vm_name\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12 \n\x13machine_type_series\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x19\n\x0cmachine_type\x18\x03 \x01(\tB\x03\xe0\x41\x02\x12\x19\n\x0cnetwork_tags\x18\x04 \x03(\tB\x03\xe0\x41\x01\x12N\n\x12network_interfaces\x18\x05 \x03(\x0b\x32-.google.cloud.vmmigration.v1.NetworkInterfaceB\x03\xe0\x41\x01\x12\x1c\n\x0fservice_account\x18\x06 \x01(\tB\x03\xe0\x41\x01\x12O\n\x12\x63ompute_scheduling\x18\x07 \x01(\x0b\x32..google.cloud.vmmigration.v1.ComputeSchedulingB\x03\xe0\x41\x01\x12\x18\n\x0bsecure_boot\x18\x08 \x01(\x08\x42\x03\xe0\x41\x01\x12\x18\n\x0b\x65nable_vtpm\x18\x10 \x01(\x08\x42\x03\xe0\x41\x01\x12(\n\x1b\x65nable_integrity_monitoring\x18\x11 \x01(\x08\x42\x03\xe0\x41\x01\x12`\n\x08metadata\x18\n \x03(\x0b\x32I.google.cloud.vmmigration.v1.DisksMigrationVmTargetDefaults.MetadataEntryB\x03\xe0\x41\x01\x12 \n\x13\x61\x64\x64itional_licenses\x18\x0b \x03(\tB\x03\xe0\x41\x01\x12\x15\n\x08hostname\x18\x0c \x01(\tB\x03\xe0\x41\x01\x12\\\n\x06labels\x18\r \x03(\x0b\x32G.google.cloud.vmmigration.v1.DisksMigrationVmTargetDefaults.LabelsEntryB\x03\xe0\x41\x01\x12N\n\x12\x62oot_disk_defaults\x18\x0e \x01(\x0b\x32-.google.cloud.vmmigration.v1.BootDiskDefaultsB\x03\xe0\x41\x01\x12@\n\nencryption\x18\x0f \x01(\x0b\x32\'.google.cloud.vmmigration.v1.EncryptionB\x03\xe0\x41\x01\x1a/\n\rMetadataEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\xff\x02\n\x10\x42ootDiskDefaults\x12P\n\x05image\x18\x03 \x01(\x0b\x32?.google.cloud.vmmigration.v1.BootDiskDefaults.DiskImageDefaultsH\x00\x12\x16\n\tdisk_name\x18\x01 \x01(\tB\x03\xe0\x41\x01\x12J\n\tdisk_type\x18\x02 \x01(\x0e\x32\x32.google.cloud.vmmigration.v1.ComputeEngineDiskTypeB\x03\xe0\x41\x01\x12\x18\n\x0b\x64\x65vice_name\x18\x04 \x01(\tB\x03\xe0\x41\x01\x12@\n\nencryption\x18\x05 \x01(\x0b\x32\'.google.cloud.vmmigration.v1.EncryptionB\x03\xe0\x41\x01\x1aO\n\x11\x44iskImageDefaults\x12:\n\x0csource_image\x18\x01 \x01(\tB$\xe0\x41\x02\xfa\x41\x1e\n\x1c\x63ompute.googleapis.com/ImageB\x08\n\x06source\"\xa2\x02\n\x1f\x43omputeEngineDisksTargetDetails\x12]\n\x14\x64isks_target_details\x18\x05 \x01(\x0b\x32=.google.cloud.vmmigration.v1.DisksMigrationDisksTargetDetailsH\x00\x12W\n\x11vm_target_details\x18\x06 \x01(\x0b\x32:.google.cloud.vmmigration.v1.DisksMigrationVmTargetDetailsH\x00\x12:\n\x05\x64isks\x18\x01 \x03(\x0b\x32+.google.cloud.vmmigration.v1.PersistentDiskB\x0b\n\tvm_target\">\n\x0ePersistentDisk\x12\x1a\n\x12source_disk_number\x18\x01 \x01(\x05\x12\x10\n\x08\x64isk_uri\x18\x02 \x01(\t\"\"\n DisksMigrationDisksTargetDetails\"4\n\x1d\x44isksMigrationVmTargetDetails\x12\x13\n\x06vm_uri\x18\x01 \x01(\tB\x03\xe0\x41\x03\"^\n\x0eSchedulePolicy\x12\x30\n\ridle_duration\x18\x01 \x01(\x0b\x32\x19.google.protobuf.Duration\x12\x1a\n\x12skip_os_adaptation\x18\x02 \x01(\x08\"\xd1\x01\n\x18\x43reateMigratingVmRequest\x12>\n\x06parent\x18\x01 \x01(\tB.\xe0\x41\x02\xfa\x41(\x12&vmmigration.googleapis.com/MigratingVm\x12\x1c\n\x0fmigrating_vm_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x43\n\x0cmigrating_vm\x18\x03 \x01(\x0b\x32(.google.cloud.vmmigration.v1.MigratingVmB\x03\xe0\x41\x02\x12\x12\n\nrequest_id\x18\x04 \x01(\t\"\xf7\x01\n\x17ListMigratingVmsRequest\x12>\n\x06parent\x18\x01 \x01(\tB.\xe0\x41\x02\xfa\x41(\x12&vmmigration.googleapis.com/MigratingVm\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\x02\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?\n\x04view\x18\x06 \x01(\x0e\x32,.google.cloud.vmmigration.v1.MigratingVmViewB\x03\xe0\x41\x01\"\x98\x01\n\x18ListMigratingVmsResponse\x12\x44\n\rmigrating_vms\x18\x01 \x03(\x0b\x32(.google.cloud.vmmigration.v1.MigratingVmB\x03\xe0\x41\x03\x12\x1c\n\x0fnext_page_token\x18\x02 \x01(\tB\x03\xe0\x41\x03\x12\x18\n\x0bunreachable\x18\x03 \x03(\tB\x03\xe0\x41\x03\"\x96\x01\n\x15GetMigratingVmRequest\x12<\n\x04name\x18\x01 \x01(\tB.\xe0\x41\x02\xfa\x41(\n&vmmigration.googleapis.com/MigratingVm\x12?\n\x04view\x18\x02 \x01(\x0e\x32,.google.cloud.vmmigration.v1.MigratingVmViewB\x03\xe0\x41\x01\"\xa4\x01\n\x18UpdateMigratingVmRequest\x12/\n\x0bupdate_mask\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\x12\x43\n\x0cmigrating_vm\x18\x02 \x01(\x0b\x32(.google.cloud.vmmigration.v1.MigratingVmB\x03\xe0\x41\x02\x12\x12\n\nrequest_id\x18\x03 \x01(\t\"X\n\x18\x44\x65leteMigratingVmRequest\x12<\n\x04name\x18\x01 \x01(\tB.\xe0\x41\x02\xfa\x41(\n&vmmigration.googleapis.com/MigratingVm\"]\n\x15StartMigrationRequest\x12\x44\n\x0cmigrating_vm\x18\x01 \x01(\tB.\xe0\x41\x02\xfa\x41(\n&vmmigration.googleapis.com/MigratingVm\"\x18\n\x16StartMigrationResponse\"]\n\x15PauseMigrationRequest\x12\x44\n\x0cmigrating_vm\x18\x01 \x01(\tB.\xe0\x41\x02\xfa\x41(\n&vmmigration.googleapis.com/MigratingVm\"\x18\n\x16PauseMigrationResponse\"^\n\x16ResumeMigrationRequest\x12\x44\n\x0cmigrating_vm\x18\x01 \x01(\tB.\xe0\x41\x02\xfa\x41(\n&vmmigration.googleapis.com/MigratingVm\"\x19\n\x17ResumeMigrationResponse\"`\n\x18\x46inalizeMigrationRequest\x12\x44\n\x0cmigrating_vm\x18\x01 \x01(\tB.\xe0\x41\x02\xfa\x41(\n&vmmigration.googleapis.com/MigratingVm\"^\n\x16\x45xtendMigrationRequest\x12\x44\n\x0cmigrating_vm\x18\x01 \x01(\tB.\xe0\x41\x02\xfa\x41(\n&vmmigration.googleapis.com/MigratingVm\"\x19\n\x17\x45xtendMigrationResponse\"\x1b\n\x19\x46inalizeMigrationResponse\"\xb1\x02\n\rTargetProject\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x14\n\x07project\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x13\n\x0b\x64\x65scription\x18\x03 \x01(\t\x12\x34\n\x0b\x63reate_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03:v\xea\x41s\n(vmmigration.googleapis.com/TargetProject\x12Gprojects/{project}/locations/{location}/targetProjects/{target_project}\"Y\n\x17GetTargetProjectRequest\x12>\n\x04name\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(vmmigration.googleapis.com/TargetProject\"\xba\x01\n\x19ListTargetProjectsRequest\x12@\n\x06parent\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\x12(vmmigration.googleapis.com/TargetProject\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\x02\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\"\x9e\x01\n\x1aListTargetProjectsResponse\x12H\n\x0ftarget_projects\x18\x01 \x03(\x0b\x32*.google.cloud.vmmigration.v1.TargetProjectB\x03\xe0\x41\x03\x12\x1c\n\x0fnext_page_token\x18\x02 \x01(\tB\x03\xe0\x41\x03\x12\x18\n\x0bunreachable\x18\x03 \x03(\tB\x03\xe0\x41\x03\"\xdb\x01\n\x1a\x43reateTargetProjectRequest\x12@\n\x06parent\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\x12(vmmigration.googleapis.com/TargetProject\x12\x1e\n\x11target_project_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12G\n\x0etarget_project\x18\x03 \x01(\x0b\x32*.google.cloud.vmmigration.v1.TargetProjectB\x03\xe0\x41\x02\x12\x12\n\nrequest_id\x18\x04 \x01(\t\"\xaa\x01\n\x1aUpdateTargetProjectRequest\x12/\n\x0bupdate_mask\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\x12G\n\x0etarget_project\x18\x02 \x01(\x0b\x32*.google.cloud.vmmigration.v1.TargetProjectB\x03\xe0\x41\x02\x12\x12\n\nrequest_id\x18\x03 \x01(\t\"u\n\x1a\x44\x65leteTargetProjectRequest\x12>\n\x04name\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(vmmigration.googleapis.com/TargetProject\x12\x17\n\nrequest_id\x18\x02 \x01(\tB\x03\xe0\x41\x01\"\xea\x03\n\x05Group\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\x12\x34\n\x0bupdate_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x13\n\x0b\x64\x65scription\x18\x04 \x01(\t\x12\x14\n\x0c\x64isplay_name\x18\x05 \x01(\t\x12Z\n\x15migration_target_type\x18\x06 \x01(\x0e\x32\x36.google.cloud.vmmigration.v1.Group.MigrationTargetTypeB\x03\xe0\x41\x05\"|\n\x13MigrationTargetType\x12%\n!MIGRATION_TARGET_TYPE_UNSPECIFIED\x10\x00\x12\x1d\n\x19MIGRATION_TARGET_TYPE_GCE\x10\x01\x12\x1f\n\x1bMIGRATION_TARGET_TYPE_DISKS\x10\x02:]\xea\x41Z\n vmmigration.googleapis.com/Group\x12\x36projects/{project}/locations/{location}/groups/{group}\"\xaa\x01\n\x11ListGroupsRequest\x12\x38\n\x06parent\x18\x01 \x01(\tB(\xe0\x41\x02\xfa\x41\"\x12 vmmigration.googleapis.com/Group\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\x02\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\"\x85\x01\n\x12ListGroupsResponse\x12\x37\n\x06groups\x18\x01 \x03(\x0b\x32\".google.cloud.vmmigration.v1.GroupB\x03\xe0\x41\x03\x12\x1c\n\x0fnext_page_token\x18\x02 \x01(\tB\x03\xe0\x41\x03\x12\x18\n\x0bunreachable\x18\x03 \x03(\tB\x03\xe0\x41\x03\"I\n\x0fGetGroupRequest\x12\x36\n\x04name\x18\x01 \x01(\tB(\xe0\x41\x02\xfa\x41\"\n vmmigration.googleapis.com/Group\"\xb1\x01\n\x12\x43reateGroupRequest\x12\x38\n\x06parent\x18\x01 \x01(\tB(\xe0\x41\x02\xfa\x41\"\x12 vmmigration.googleapis.com/Group\x12\x15\n\x08group_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x36\n\x05group\x18\x03 \x01(\x0b\x32\".google.cloud.vmmigration.v1.GroupB\x03\xe0\x41\x02\x12\x12\n\nrequest_id\x18\x04 \x01(\t\"\x91\x01\n\x12UpdateGroupRequest\x12/\n\x0bupdate_mask\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\x12\x36\n\x05group\x18\x02 \x01(\x0b\x32\".google.cloud.vmmigration.v1.GroupB\x03\xe0\x41\x02\x12\x12\n\nrequest_id\x18\x03 \x01(\t\"e\n\x12\x44\x65leteGroupRequest\x12\x36\n\x04name\x18\x01 \x01(\tB(\xe0\x41\x02\xfa\x41\"\n vmmigration.googleapis.com/Group\x12\x17\n\nrequest_id\x18\x02 \x01(\tB\x03\xe0\x41\x01\"\x96\x01\n\x18\x41\x64\x64GroupMigrationRequest\x12\x37\n\x05group\x18\x01 \x01(\tB(\xe0\x41\x02\xfa\x41\"\n vmmigration.googleapis.com/Group\x12\x41\n\x0cmigrating_vm\x18\x02 \x01(\tB+\xfa\x41(\n&vmmigration.googleapis.com/MigratingVm\"\x1b\n\x19\x41\x64\x64GroupMigrationResponse\"\x99\x01\n\x1bRemoveGroupMigrationRequest\x12\x37\n\x05group\x18\x01 \x01(\tB(\xe0\x41\x02\xfa\x41\"\n vmmigration.googleapis.com/Group\x12\x41\n\x0cmigrating_vm\x18\x02 \x01(\tB+\xfa\x41(\n&vmmigration.googleapis.com/MigratingVm\"\x1e\n\x1cRemoveGroupMigrationResponse\"\xcc\x01\n\x17\x43reateCutoverJobRequest\x12=\n\x06parent\x18\x01 \x01(\tB-\xe0\x41\x02\xfa\x41\'\x12%vmmigration.googleapis.com/CutoverJob\x12\x1b\n\x0e\x63utover_job_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x41\n\x0b\x63utover_job\x18\x03 \x01(\x0b\x32\'.google.cloud.vmmigration.v1.CutoverJobB\x03\xe0\x41\x02\x12\x12\n\nrequest_id\x18\x04 \x01(\t\"V\n\x17\x43\x61ncelCutoverJobRequest\x12;\n\x04name\x18\x01 \x01(\tB-\xe0\x41\x02\xfa\x41\'\n%vmmigration.googleapis.com/CutoverJob\"\x1a\n\x18\x43\x61ncelCutoverJobResponse\"\xb4\x01\n\x16ListCutoverJobsRequest\x12=\n\x06parent\x18\x01 \x01(\tB-\xe0\x41\x02\xfa\x41\'\x12%vmmigration.googleapis.com/CutoverJob\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\x02\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\"\x95\x01\n\x17ListCutoverJobsResponse\x12\x42\n\x0c\x63utover_jobs\x18\x01 \x03(\x0b\x32\'.google.cloud.vmmigration.v1.CutoverJobB\x03\xe0\x41\x03\x12\x1c\n\x0fnext_page_token\x18\x02 \x01(\tB\x03\xe0\x41\x03\x12\x18\n\x0bunreachable\x18\x03 \x03(\tB\x03\xe0\x41\x03\"S\n\x14GetCutoverJobRequest\x12;\n\x04name\x18\x01 \x01(\tB-\xe0\x41\x02\xfa\x41\'\n%vmmigration.googleapis.com/CutoverJob\"\x80\x02\n\x11OperationMetadata\x12\x34\n\x0b\x63reate_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x31\n\x08\x65nd_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x13\n\x06target\x18\x03 \x01(\tB\x03\xe0\x41\x03\x12\x11\n\x04verb\x18\x04 \x01(\tB\x03\xe0\x41\x03\x12\x1b\n\x0estatus_message\x18\x05 \x01(\tB\x03\xe0\x41\x03\x12#\n\x16requested_cancellation\x18\x06 \x01(\x08\x42\x03\xe0\x41\x03\x12\x18\n\x0b\x61pi_version\x18\x07 \x01(\tB\x03\xe0\x41\x03\"\xf1\x04\n\x0eMigrationError\x12H\n\x04\x63ode\x18\x01 \x01(\x0e\x32\x35.google.cloud.vmmigration.v1.MigrationError.ErrorCodeB\x03\xe0\x41\x03\x12\x38\n\rerror_message\x18\x02 \x01(\x0b\x32\x1c.google.rpc.LocalizedMessageB\x03\xe0\x41\x03\x12\x36\n\x0b\x61\x63tion_item\x18\x03 \x01(\x0b\x32\x1c.google.rpc.LocalizedMessageB\x03\xe0\x41\x03\x12.\n\nhelp_links\x18\x04 \x03(\x0b\x32\x15.google.rpc.Help.LinkB\x03\xe0\x41\x03\x12\x33\n\nerror_time\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\"\xbd\x02\n\tErrorCode\x12\x1a\n\x16\x45RROR_CODE_UNSPECIFIED\x10\x00\x12\x11\n\rUNKNOWN_ERROR\x10\x01\x12\x1b\n\x17SOURCE_VALIDATION_ERROR\x10\x02\x12\x1c\n\x18SOURCE_REPLICATION_ERROR\x10\x03\x12\x1c\n\x18TARGET_REPLICATION_ERROR\x10\x04\x12\x17\n\x13OS_ADAPTATION_ERROR\x10\x05\x12\x0f\n\x0b\x43LONE_ERROR\x10\x06\x12\x11\n\rCUTOVER_ERROR\x10\x07\x12\x1c\n\x18UTILIZATION_REPORT_ERROR\x10\x08\x12\x1b\n\x17\x41PPLIANCE_UPGRADE_ERROR\x10\t\x12\x16\n\x12IMAGE_IMPORT_ERROR\x10\n\x12\x18\n\x14\x44ISK_MIGRATION_ERROR\x10\x0b\"\xf6\x02\n\x10MigrationWarning\x12G\n\x04\x63ode\x18\x01 \x01(\x0e\x32\x39.google.cloud.vmmigration.v1.MigrationWarning.WarningCode\x12:\n\x0fwarning_message\x18\x02 \x01(\x0b\x32\x1c.google.rpc.LocalizedMessageB\x03\xe0\x41\x03\x12\x36\n\x0b\x61\x63tion_item\x18\x03 \x01(\x0b\x32\x1c.google.rpc.LocalizedMessageB\x03\xe0\x41\x03\x12.\n\nhelp_links\x18\x04 \x03(\x0b\x32\x15.google.rpc.Help.LinkB\x03\xe0\x41\x03\x12\x30\n\x0cwarning_time\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"C\n\x0bWarningCode\x12\x1c\n\x18WARNING_CODE_UNSPECIFIED\x10\x00\x12\x16\n\x12\x41\x44\x41PTATION_WARNING\x10\x01\"\x95\x04\n\x15VmwareSourceVmDetails\x12R\n\x08\x66irmware\x18\x01 \x01(\x0e\x32;.google.cloud.vmmigration.v1.VmwareSourceVmDetails.FirmwareB\x03\xe0\x41\x03\x12$\n\x17\x63ommitted_storage_bytes\x18\x02 \x01(\x03\x42\x03\xe0\x41\x03\x12X\n\x05\x64isks\x18\x03 \x03(\x0b\x32\x44.google.cloud.vmmigration.v1.VmwareSourceVmDetails.VmwareDiskDetailsB\x03\xe0\x41\x03\x12N\n\x14vm_capabilities_info\x18\x05 \x01(\x0b\x32+.google.cloud.vmmigration.v1.VmCapabilitiesB\x03\xe0\x41\x03\x12\x46\n\x0c\x61rchitecture\x18\x06 \x01(\x0e\x32+.google.cloud.vmmigration.v1.VmArchitectureB\x03\xe0\x41\x03\x1aW\n\x11VmwareDiskDetails\x12\x18\n\x0b\x64isk_number\x18\x01 \x01(\x05\x42\x03\xe0\x41\x03\x12\x14\n\x07size_gb\x18\x02 \x01(\x03\x42\x03\xe0\x41\x03\x12\x12\n\x05label\x18\x03 \x01(\tB\x03\xe0\x41\x03\"7\n\x08\x46irmware\x12\x18\n\x14\x46IRMWARE_UNSPECIFIED\x10\x00\x12\x07\n\x03\x45\x46I\x10\x01\x12\x08\n\x04\x42IOS\x10\x02\"\x8a\x04\n\x12\x41wsSourceVmDetails\x12O\n\x08\x66irmware\x18\x01 \x01(\x0e\x32\x38.google.cloud.vmmigration.v1.AwsSourceVmDetails.FirmwareB\x03\xe0\x41\x03\x12$\n\x17\x63ommitted_storage_bytes\x18\x02 \x01(\x03\x42\x03\xe0\x41\x03\x12R\n\x05\x64isks\x18\x03 \x03(\x0b\x32>.google.cloud.vmmigration.v1.AwsSourceVmDetails.AwsDiskDetailsB\x03\xe0\x41\x03\x12N\n\x14vm_capabilities_info\x18\x05 \x01(\x0b\x32+.google.cloud.vmmigration.v1.VmCapabilitiesB\x03\xe0\x41\x03\x12\x46\n\x0c\x61rchitecture\x18\x06 \x01(\x0e\x32+.google.cloud.vmmigration.v1.VmArchitectureB\x03\xe0\x41\x03\x1aX\n\x0e\x41wsDiskDetails\x12\x18\n\x0b\x64isk_number\x18\x01 \x01(\x05\x42\x03\xe0\x41\x03\x12\x16\n\tvolume_id\x18\x02 \x01(\tB\x03\xe0\x41\x03\x12\x14\n\x07size_gb\x18\x03 \x01(\x03\x42\x03\xe0\x41\x03\"7\n\x08\x46irmware\x12\x18\n\x14\x46IRMWARE_UNSPECIFIED\x10\x00\x12\x07\n\x03\x45\x46I\x10\x01\x12\x08\n\x04\x42IOS\x10\x02\"\x92\x04\n\x14\x41zureSourceVmDetails\x12Q\n\x08\x66irmware\x18\x01 \x01(\x0e\x32:.google.cloud.vmmigration.v1.AzureSourceVmDetails.FirmwareB\x03\xe0\x41\x03\x12$\n\x17\x63ommitted_storage_bytes\x18\x02 \x01(\x03\x42\x03\xe0\x41\x03\x12V\n\x05\x64isks\x18\x03 \x03(\x0b\x32\x42.google.cloud.vmmigration.v1.AzureSourceVmDetails.AzureDiskDetailsB\x03\xe0\x41\x03\x12N\n\x14vm_capabilities_info\x18\x05 \x01(\x0b\x32+.google.cloud.vmmigration.v1.VmCapabilitiesB\x03\xe0\x41\x03\x12\x46\n\x0c\x61rchitecture\x18\x06 \x01(\x0e\x32+.google.cloud.vmmigration.v1.VmArchitectureB\x03\xe0\x41\x03\x1aX\n\x10\x41zureDiskDetails\x12\x18\n\x0b\x64isk_number\x18\x01 \x01(\x05\x42\x03\xe0\x41\x03\x12\x14\n\x07\x64isk_id\x18\x02 \x01(\tB\x03\xe0\x41\x03\x12\x14\n\x07size_gb\x18\x03 \x01(\x03\x42\x03\xe0\x41\x03\"7\n\x08\x46irmware\x12\x18\n\x14\x46IRMWARE_UNSPECIFIED\x10\x00\x12\x07\n\x03\x45\x46I\x10\x01\x12\x08\n\x04\x42IOS\x10\x02\"\xc0\x01\n\x1cListReplicationCyclesRequest\x12\x43\n\x06parent\x18\x01 \x01(\tB3\xe0\x41\x02\xfa\x41-\x12+vmmigration.googleapis.com/ReplicationCycle\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\x02\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\"\xa7\x01\n\x1dListReplicationCyclesResponse\x12N\n\x12replication_cycles\x18\x01 \x03(\x0b\x32-.google.cloud.vmmigration.v1.ReplicationCycleB\x03\xe0\x41\x03\x12\x1c\n\x0fnext_page_token\x18\x02 \x01(\tB\x03\xe0\x41\x03\x12\x18\n\x0bunreachable\x18\x03 \x03(\tB\x03\xe0\x41\x03\"_\n\x1aGetReplicationCycleRequest\x12\x41\n\x04name\x18\x01 \x01(\tB3\xe0\x41\x02\xfa\x41-\n+vmmigration.googleapis.com/ReplicationCycle\"\xa7\x01\n\x0eVmCapabilities\x12J\n\x0fos_capabilities\x18\x01 \x03(\x0e\x32).google.cloud.vmmigration.v1.OsCapabilityB\x06\xe0\x41\x03\xe0\x41\x06\x12I\n last_os_capabilities_update_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\"\xf6\x04\n\x0bImageImport\x12 \n\x11\x63loud_storage_uri\x18\x02 \x01(\tB\x03\xe0\x41\x05H\x00\x12^\n\x1a\x64isk_image_target_defaults\x18\x04 \x01(\x0b\x32\x33.google.cloud.vmmigration.v1.DiskImageTargetDetailsB\x03\xe0\x41\x05H\x01\x12\x64\n\x1dmachine_image_target_defaults\x18\x07 \x01(\x0b\x32\x36.google.cloud.vmmigration.v1.MachineImageTargetDetailsB\x03\xe0\x41\x05H\x01\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x34\n\x0b\x63reate_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12R\n\x18recent_image_import_jobs\x18\x05 \x03(\x0b\x32+.google.cloud.vmmigration.v1.ImageImportJobB\x03\xe0\x41\x03\x12@\n\nencryption\x18\x06 \x01(\x0b\x32\'.google.cloud.vmmigration.v1.EncryptionB\x03\xe0\x41\x05:\x82\x01\xea\x41\x7f\n&vmmigration.googleapis.com/ImageImport\x12:projects/{project}/locations/{location}/imageImports/{job}*\x0cimageImports2\x0bimageImportB\x08\n\x06sourceB\x11\n\x0ftarget_defaults\"\xc2\x07\n\x0eImageImportJob\x12 \n\x11\x63loud_storage_uri\x18\n \x01(\tB\x03\xe0\x41\x03H\x00\x12]\n\x19\x64isk_image_target_details\x18\x03 \x01(\x0b\x32\x33.google.cloud.vmmigration.v1.DiskImageTargetDetailsB\x03\xe0\x41\x03H\x01\x12\x63\n\x1cmachine_image_target_details\x18\x0b \x01(\x0b\x32\x36.google.cloud.vmmigration.v1.MachineImageTargetDetailsB\x03\xe0\x41\x03H\x01\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x1e\n\x11\x63reated_resources\x18\x02 \x03(\tB\x03\xe0\x41\x03\x12\x45\n\x05state\x18\x04 \x01(\x0e\x32\x31.google.cloud.vmmigration.v1.ImageImportJob.StateB\x03\xe0\x41\x03\x12\x34\n\x0b\x63reate_time\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x31\n\x08\x65nd_time\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\'\n\x06\x65rrors\x18\x07 \x03(\x0b\x32\x12.google.rpc.StatusB\x03\xe0\x41\x03\x12\x44\n\x08warnings\x18\x08 \x03(\x0b\x32-.google.cloud.vmmigration.v1.MigrationWarningB\x03\xe0\x41\x03\x12@\n\x05steps\x18\t \x03(\x0b\x32,.google.cloud.vmmigration.v1.ImageImportStepB\x03\xe0\x41\x03\"r\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0b\n\x07PENDING\x10\x01\x12\x0b\n\x07RUNNING\x10\x02\x12\r\n\tSUCCEEDED\x10\x03\x12\n\n\x06\x46\x41ILED\x10\x04\x12\x0e\n\nCANCELLING\x10\x05\x12\r\n\tCANCELLED\x10\x06:\xa5\x01\xea\x41\xa1\x01\n)vmmigration.googleapis.com/ImageImportJob\x12Sprojects/{project}/locations/{location}/imageImports/{job}/imageImportJobs/{result}*\x0fimageImportJobs2\x0eimageImportJobB\x08\n\x06sourceB\x10\n\x0etarget_details\"\xbb\x03\n\x0fImageImportStep\x12P\n\x0cinitializing\x18\x03 \x01(\x0b\x32\x38.google.cloud.vmmigration.v1.InitializingImageImportStepH\x00\x12X\n\x14loading_source_files\x18\x04 \x01(\x0b\x32\x38.google.cloud.vmmigration.v1.LoadingImageSourceFilesStepH\x00\x12\x42\n\x0b\x61\x64\x61pting_os\x18\x05 \x01(\x0b\x32+.google.cloud.vmmigration.v1.AdaptingOSStepH\x00\x12H\n\x0e\x63reating_image\x18\x06 \x01(\x0b\x32..google.cloud.vmmigration.v1.CreatingImageStepH\x00\x12\x33\n\nstart_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x31\n\x08\x65nd_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x42\x06\n\x04step\"\x1d\n\x1bInitializingImageImportStep\"\x1d\n\x1bLoadingImageSourceFilesStep\"\x13\n\x11\x43reatingImageStep\"\x96\x05\n\x16\x44iskImageTargetDetails\x12g\n\x18os_adaptation_parameters\x18\x0b \x01(\x0b\x32>.google.cloud.vmmigration.v1.ImageImportOsAdaptationParametersB\x03\xe0\x41\x01H\x00\x12W\n\x16\x64\x61ta_disk_image_import\x18\x0c \x01(\x0b\x32\x30.google.cloud.vmmigration.v1.DataDiskImageImportB\x03\xe0\x41\x01H\x00\x12\x17\n\nimage_name\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12H\n\x0etarget_project\x18\x02 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(vmmigration.googleapis.com/TargetProject\x12\x18\n\x0b\x64\x65scription\x18\x05 \x01(\tB\x03\xe0\x41\x01\x12\x18\n\x0b\x66\x61mily_name\x18\x06 \x01(\tB\x03\xe0\x41\x01\x12T\n\x06labels\x18\x07 \x03(\x0b\x32?.google.cloud.vmmigration.v1.DiskImageTargetDetails.LabelsEntryB\x03\xe0\x41\x01\x12 \n\x13\x61\x64\x64itional_licenses\x18\x08 \x03(\tB\x03\xe0\x41\x01\x12\"\n\x15single_region_storage\x18\t \x01(\x08\x42\x03\xe0\x41\x01\x12@\n\nencryption\x18\n \x01(\x0b\x32\'.google.cloud.vmmigration.v1.EncryptionB\x03\xe0\x41\x05\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x42\x16\n\x14os_adaptation_config\"\xfc\x07\n\x19MachineImageTargetDetails\x12g\n\x18os_adaptation_parameters\x18\x03 \x01(\x0b\x32>.google.cloud.vmmigration.v1.ImageImportOsAdaptationParametersB\x03\xe0\x41\x01H\x00\x12P\n\x12skip_os_adaptation\x18\x10 \x01(\x0b\x32-.google.cloud.vmmigration.v1.SkipOsAdaptationB\x03\xe0\x41\x01H\x00\x12\x1f\n\x12machine_image_name\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12H\n\x0etarget_project\x18\x02 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(vmmigration.googleapis.com/TargetProject\x12\x18\n\x0b\x64\x65scription\x18\x04 \x01(\tB\x03\xe0\x41\x01\x12\"\n\x15single_region_storage\x18\x05 \x01(\x08\x42\x03\xe0\x41\x01\x12@\n\nencryption\x18\x06 \x01(\x0b\x32\'.google.cloud.vmmigration.v1.EncryptionB\x03\xe0\x41\x05\x12m\n\"machine_image_parameters_overrides\x18\x07 \x01(\x0b\x32<.google.cloud.vmmigration.v1.MachineImageParametersOverridesB\x03\xe0\x41\x01\x12I\n\x0fservice_account\x18\x08 \x01(\x0b\x32+.google.cloud.vmmigration.v1.ServiceAccountB\x03\xe0\x41\x01\x12 \n\x13\x61\x64\x64itional_licenses\x18\t \x03(\tB\x03\xe0\x41\x01\x12W\n\x06labels\x18\n \x03(\x0b\x32\x42.google.cloud.vmmigration.v1.MachineImageTargetDetails.LabelsEntryB\x03\xe0\x41\x01\x12\x11\n\x04tags\x18\x0b \x03(\tB\x03\xe0\x41\x01\x12Z\n\x18shielded_instance_config\x18\x0c \x01(\x0b\x32\x33.google.cloud.vmmigration.v1.ShieldedInstanceConfigB\x03\xe0\x41\x01\x12N\n\x12network_interfaces\x18\r \x03(\x0b\x32-.google.cloud.vmmigration.v1.NetworkInterfaceB\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\x42\x16\n\x14os_adaptation_config\"_\n\x0eServiceAccount\x12\x38\n\x05\x65mail\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!iam.googleapis.com/ServiceAccount\x12\x13\n\x06scopes\x18\x02 \x03(\tB\x03\xe0\x41\x01\"\xf6\x01\n\x16ShieldedInstanceConfig\x12X\n\x0bsecure_boot\x18\x01 \x01(\x0e\x32>.google.cloud.vmmigration.v1.ShieldedInstanceConfig.SecureBootB\x03\xe0\x41\x01\x12\x18\n\x0b\x65nable_vtpm\x18\x02 \x01(\x08\x42\x03\xe0\x41\x01\x12(\n\x1b\x65nable_integrity_monitoring\x18\x03 \x01(\x08\x42\x03\xe0\x41\x01\">\n\nSecureBoot\x12\x1b\n\x17SECURE_BOOT_UNSPECIFIED\x10\x00\x12\x08\n\x04TRUE\x10\x01\x12\t\n\x05\x46\x41LSE\x10\x02\"<\n\x1fMachineImageParametersOverrides\x12\x19\n\x0cmachine_type\x18\x01 \x01(\tB\x03\xe0\x41\x01\"\xad\x02\n!ImageImportOsAdaptationParameters\x12\x17\n\ngeneralize\x18\x01 \x01(\x08\x42\x03\xe0\x41\x01\x12P\n\x0clicense_type\x18\x02 \x01(\x0e\x32\x35.google.cloud.vmmigration.v1.ComputeEngineLicenseTypeB\x03\xe0\x41\x01\x12I\n\x0f\x62oot_conversion\x18\x03 \x01(\x0e\x32+.google.cloud.vmmigration.v1.BootConversionB\x03\xe0\x41\x01\x12R\n\x14\x61\x64\x61ptation_modifiers\x18\x04 \x03(\x0b\x32/.google.cloud.vmmigration.v1.AdaptationModifierB\x03\xe0\x41\x01\"5\n\x13\x44\x61taDiskImageImport\x12\x1e\n\x11guest_os_features\x18\x01 \x03(\tB\x03\xe0\x41\x01\"\x12\n\x10SkipOsAdaptation\"U\n\x15GetImageImportRequest\x12<\n\x04name\x18\x01 \x01(\tB.\xe0\x41\x02\xfa\x41(\n&vmmigration.googleapis.com/ImageImport\"\xb6\x01\n\x17ListImageImportsRequest\x12>\n\x06parent\x18\x01 \x01(\tB.\xe0\x41\x02\xfa\x41(\x12&vmmigration.googleapis.com/ImageImport\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\"\x98\x01\n\x18ListImageImportsResponse\x12\x44\n\rimage_imports\x18\x01 \x03(\x0b\x32(.google.cloud.vmmigration.v1.ImageImportB\x03\xe0\x41\x03\x12\x1c\n\x0fnext_page_token\x18\x02 \x01(\tB\x03\xe0\x41\x03\x12\x18\n\x0bunreachable\x18\x03 \x03(\tB\x03\xe0\x41\x03\"\xd6\x01\n\x18\x43reateImageImportRequest\x12>\n\x06parent\x18\x01 \x01(\tB.\xe0\x41\x02\xfa\x41(\x12&vmmigration.googleapis.com/ImageImport\x12\x1c\n\x0fimage_import_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x43\n\x0cimage_import\x18\x03 \x01(\x0b\x32(.google.cloud.vmmigration.v1.ImageImportB\x03\xe0\x41\x02\x12\x17\n\nrequest_id\x18\x04 \x01(\tB\x03\xe0\x41\x01\"q\n\x18\x44\x65leteImageImportRequest\x12<\n\x04name\x18\x01 \x01(\tB.\xe0\x41\x02\xfa\x41(\n&vmmigration.googleapis.com/ImageImport\x12\x17\n\nrequest_id\x18\x02 \x01(\tB\x03\xe0\x41\x01\"[\n\x18GetImageImportJobRequest\x12?\n\x04name\x18\x01 \x01(\tB1\xe0\x41\x02\xfa\x41+\n)vmmigration.googleapis.com/ImageImportJob\"\xbc\x01\n\x1aListImageImportJobsRequest\x12\x41\n\x06parent\x18\x01 \x01(\tB1\xe0\x41\x02\xfa\x41+\x12)vmmigration.googleapis.com/ImageImportJob\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\"\xa2\x01\n\x1bListImageImportJobsResponse\x12K\n\x11image_import_jobs\x18\x01 \x03(\x0b\x32+.google.cloud.vmmigration.v1.ImageImportJobB\x03\xe0\x41\x03\x12\x1c\n\x0fnext_page_token\x18\x02 \x01(\tB\x03\xe0\x41\x03\x12\x18\n\x0bunreachable\x18\x03 \x03(\tB\x03\xe0\x41\x03\"^\n\x1b\x43\x61ncelImageImportJobRequest\x12?\n\x04name\x18\x01 \x01(\tB1\xe0\x41\x02\xfa\x41+\n)vmmigration.googleapis.com/ImageImportJob\"\x1e\n\x1c\x43\x61ncelImageImportJobResponse\"\xbc\x06\n\x10\x44iskMigrationJob\x12T\n\x17\x61ws_source_disk_details\x18\x02 \x01(\x0b\x32\x31.google.cloud.vmmigration.v1.AwsSourceDiskDetailsH\x00\x12\x14\n\x04name\x18\x01 \x01(\tB\x06\xe0\x41\x08\xe0\x41\x03\x12W\n\x0etarget_details\x18\x03 \x01(\x0b\x32:.google.cloud.vmmigration.v1.DiskMigrationJobTargetDetailsB\x03\xe0\x41\x02\x12\x34\n\x0b\x63reate_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12G\n\x05state\x18\x06 \x01(\x0e\x32\x33.google.cloud.vmmigration.v1.DiskMigrationJob.StateB\x03\xe0\x41\x03\x12\'\n\x06\x65rrors\x18\x07 \x03(\x0b\x32\x12.google.rpc.StatusB\x03\xe0\x41\x03\x12\x42\n\x05steps\x18\x08 \x03(\x0b\x32..google.cloud.vmmigration.v1.DiskMigrationStepB\x03\xe0\x41\x03\"p\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\t\n\x05READY\x10\x01\x12\x0b\n\x07RUNNING\x10\x03\x12\r\n\tSUCCEEDED\x10\x04\x12\x0e\n\nCANCELLING\x10\x05\x12\r\n\tCANCELLED\x10\x06\x12\n\n\x06\x46\x41ILED\x10\x07:\xb7\x01\xea\x41\xb3\x01\n+vmmigration.googleapis.com/DiskMigrationJob\x12_projects/{project}/locations/{location}/sources/{source}/diskMigrationJobs/{disk_migration_job}*\x11\x64iskMigrationJobs2\x10\x64iskMigrationJobB\x15\n\x13source_disk_details\"\x95\x03\n\x1d\x44iskMigrationJobTargetDetails\x12J\n\x0btarget_disk\x18\x08 \x01(\x0b\x32..google.cloud.vmmigration.v1.ComputeEngineDiskB\x03\xe0\x41\x02H\x00\x12H\n\x0etarget_project\x18\x02 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(vmmigration.googleapis.com/TargetProject\x12[\n\x06labels\x18\x06 \x03(\x0b\x32\x46.google.cloud.vmmigration.v1.DiskMigrationJobTargetDetails.LabelsEntryB\x03\xe0\x41\x01\x12@\n\nencryption\x18\x07 \x01(\x0b\x32\'.google.cloud.vmmigration.v1.EncryptionB\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\x42\x10\n\x0etarget_storage\"\xaa\x03\n\x11\x44iskMigrationStep\x12\x64\n\x1d\x63reating_source_disk_snapshot\x18\x03 \x01(\x0b\x32;.google.cloud.vmmigration.v1.CreatingSourceDiskSnapshotStepH\x00\x12\x62\n\x1c\x63opying_source_disk_snapshot\x18\x04 \x01(\x0b\x32:.google.cloud.vmmigration.v1.CopyingSourceDiskSnapshotStepH\x00\x12[\n\x18provisioning_target_disk\x18\x05 \x01(\x0b\x32\x37.google.cloud.vmmigration.v1.ProvisioningTargetDiskStepH\x00\x12\x33\n\nstart_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x31\n\x08\x65nd_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x42\x06\n\x04step\" \n\x1e\x43reatingSourceDiskSnapshotStep\"\x1f\n\x1d\x43opyingSourceDiskSnapshotStep\"\x1c\n\x1aProvisioningTargetDiskStep\"\xf0\x01\n\x11\x43omputeEngineDisk\x12\x14\n\x07\x64isk_id\x18\x01 \x01(\tB\x03\xe0\x41\x01\x12\x37\n\x04zone\x18\x02 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\x12@\n\rreplica_zones\x18\x03 \x03(\tB)\xe0\x41\x01\xfa\x41#\n!locations.googleapis.com/Location\x12J\n\tdisk_type\x18\x04 \x01(\x0e\x32\x32.google.cloud.vmmigration.v1.ComputeEngineDiskTypeB\x03\xe0\x41\x02\"\xfa\x02\n\x14\x41wsSourceDiskDetails\x12\x16\n\tvolume_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x15\n\x08size_gib\x18\x02 \x01(\x03\x42\x03\xe0\x41\x03\x12Q\n\tdisk_type\x18\x03 \x01(\x0e\x32\x36.google.cloud.vmmigration.v1.AwsSourceDiskDetails.TypeB\x06\xe0\x41\x01\xe0\x41\x03\x12Q\n\x04tags\x18\x04 \x03(\x0b\x32;.google.cloud.vmmigration.v1.AwsSourceDiskDetails.TagsEntryB\x06\xe0\x41\x01\xe0\x41\x03\x1a+\n\tTagsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"`\n\x04Type\x12\x14\n\x10TYPE_UNSPECIFIED\x10\x00\x12\x07\n\x03GP2\x10\x01\x12\x07\n\x03GP3\x10\x02\x12\x07\n\x03IO1\x10\x03\x12\x07\n\x03IO2\x10\x04\x12\x07\n\x03ST1\x10\x05\x12\x07\n\x03SC1\x10\x06\x12\x0c\n\x08STANDARD\x10\x07\"\xf9\x01\n\x1d\x43reateDiskMigrationJobRequest\x12\x43\n\x06parent\x18\x01 \x01(\tB3\xe0\x41\x02\xfa\x41-\x12+vmmigration.googleapis.com/DiskMigrationJob\x12\"\n\x15\x64isk_migration_job_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12N\n\x12\x64isk_migration_job\x18\x03 \x01(\x0b\x32-.google.cloud.vmmigration.v1.DiskMigrationJobB\x03\xe0\x41\x02\x12\x1f\n\nrequest_id\x18\x04 \x01(\tB\x0b\xe0\x41\x01\xe2\x8c\xcf\xd7\x08\x02\x08\x01\"\xc0\x01\n\x1cListDiskMigrationJobsRequest\x12\x43\n\x06parent\x18\x01 \x01(\tB3\xe0\x41\x02\xfa\x41-\x12+vmmigration.googleapis.com/DiskMigrationJob\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\"\xd1\x01\n\x1dListDiskMigrationJobsResponse\x12O\n\x13\x64isk_migration_jobs\x18\x01 \x03(\x0b\x32-.google.cloud.vmmigration.v1.DiskMigrationJobB\x03\xe0\x41\x03\x12\x1f\n\x0fnext_page_token\x18\x02 \x01(\tB\x06\xe0\x41\x03\xe0\x41\x01\x12>\n\x0bunreachable\x18\x03 \x03(\tB)\xe0\x41\x03\xfa\x41#\n!locations.googleapis.com/Location\"_\n\x1aGetDiskMigrationJobRequest\x12\x41\n\x04name\x18\x01 \x01(\tB3\xe0\x41\x02\xfa\x41-\n+vmmigration.googleapis.com/DiskMigrationJob\"\xc6\x01\n\x1dUpdateDiskMigrationJobRequest\x12\x34\n\x0bupdate_mask\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x01\x12N\n\x12\x64isk_migration_job\x18\x02 \x01(\x0b\x32-.google.cloud.vmmigration.v1.DiskMigrationJobB\x03\xe0\x41\x02\x12\x1f\n\nrequest_id\x18\x03 \x01(\tB\x0b\xe0\x41\x01\xe2\x8c\xcf\xd7\x08\x02\x08\x01\"b\n\x1d\x44\x65leteDiskMigrationJobRequest\x12\x41\n\x04name\x18\x01 \x01(\tB3\xe0\x41\x02\xfa\x41-\n+vmmigration.googleapis.com/DiskMigrationJob\"_\n\x1aRunDiskMigrationJobRequest\x12\x41\n\x04name\x18\x01 \x01(\tB3\xe0\x41\x02\xfa\x41-\n+vmmigration.googleapis.com/DiskMigrationJob\"\x1d\n\x1bRunDiskMigrationJobResponse\"b\n\x1d\x43\x61ncelDiskMigrationJobRequest\x12\x41\n\x04name\x18\x01 \x01(\tB3\xe0\x41\x02\xfa\x41-\n+vmmigration.googleapis.com/DiskMigrationJob\" \n\x1e\x43\x61ncelDiskMigrationJobResponse*\xe2\x01\n\x15\x43omputeEngineDiskType\x12(\n$COMPUTE_ENGINE_DISK_TYPE_UNSPECIFIED\x10\x00\x12%\n!COMPUTE_ENGINE_DISK_TYPE_STANDARD\x10\x01\x12 \n\x1c\x43OMPUTE_ENGINE_DISK_TYPE_SSD\x10\x02\x12%\n!COMPUTE_ENGINE_DISK_TYPE_BALANCED\x10\x03\x12/\n+COMPUTE_ENGINE_DISK_TYPE_HYPERDISK_BALANCED\x10\x04*\x8f\x01\n\x18\x43omputeEngineLicenseType\x12\'\n#COMPUTE_ENGINE_LICENSE_TYPE_DEFAULT\x10\x00\x12$\n COMPUTE_ENGINE_LICENSE_TYPE_PAYG\x10\x01\x12$\n COMPUTE_ENGINE_LICENSE_TYPE_BYOL\x10\x02*\x8e\x01\n\x17\x43omputeEngineBootOption\x12*\n&COMPUTE_ENGINE_BOOT_OPTION_UNSPECIFIED\x10\x00\x12\"\n\x1e\x43OMPUTE_ENGINE_BOOT_OPTION_EFI\x10\x01\x12#\n\x1f\x43OMPUTE_ENGINE_BOOT_OPTION_BIOS\x10\x02*\xa9\x01\n\x0cOsCapability\x12\x1d\n\x19OS_CAPABILITY_UNSPECIFIED\x10\x00\x12%\n!OS_CAPABILITY_NVME_STORAGE_ACCESS\x10\x01\x12)\n%OS_CAPABILITY_GVNIC_NETWORK_INTERFACE\x10\x02\x12(\n$OS_CAPABILITY_IDPF_NETWORK_INTERFACE\x10\x03*L\n\x0e\x42ootConversion\x12\x1f\n\x1b\x42OOT_CONVERSION_UNSPECIFIED\x10\x00\x12\x08\n\x04NONE\x10\x01\x12\x0f\n\x0b\x42IOS_TO_EFI\x10\x02*U\n\x15UtilizationReportView\x12\'\n#UTILIZATION_REPORT_VIEW_UNSPECIFIED\x10\x00\x12\t\n\x05\x42\x41SIC\x10\x01\x12\x08\n\x04\x46ULL\x10\x02*m\n\x0fMigratingVmView\x12!\n\x1dMIGRATING_VM_VIEW_UNSPECIFIED\x10\x00\x12\x1b\n\x17MIGRATING_VM_VIEW_BASIC\x10\x01\x12\x1a\n\x16MIGRATING_VM_VIEW_FULL\x10\x02*l\n\x0eVmArchitecture\x12\x1f\n\x1bVM_ARCHITECTURE_UNSPECIFIED\x10\x00\x12\x1e\n\x1aVM_ARCHITECTURE_X86_FAMILY\x10\x01\x12\x19\n\x15VM_ARCHITECTURE_ARM64\x10\x02*|\n\x18\x43omputeEngineNetworkTier\x12+\n\'COMPUTE_ENGINE_NETWORK_TIER_UNSPECIFIED\x10\x00\x12\x19\n\x15NETWORK_TIER_STANDARD\x10\x01\x12\x18\n\x14NETWORK_TIER_PREMIUM\x10\x02\x32\xebp\n\x0bVmMigration\x12\xae\x01\n\x0bListSources\x12/.google.cloud.vmmigration.v1.ListSourcesRequest\x1a\x30.google.cloud.vmmigration.v1.ListSourcesResponse\"<\xda\x41\x06parent\x82\xd3\xe4\x93\x02-\x12+/v1/{parent=projects/*/locations/*}/sources\x12\x9b\x01\n\tGetSource\x12-.google.cloud.vmmigration.v1.GetSourceRequest\x1a#.google.cloud.vmmigration.v1.Source\":\xda\x41\x04name\x82\xd3\xe4\x93\x02-\x12+/v1/{name=projects/*/locations/*/sources/*}\x12\xd4\x01\n\x0c\x43reateSource\x12\x30.google.cloud.vmmigration.v1.CreateSourceRequest\x1a\x1d.google.longrunning.Operation\"s\xca\x41\x1b\n\x06Source\x12\x11OperationMetadata\xda\x41\x17parent,source,source_id\x82\xd3\xe4\x93\x02\x35\"+/v1/{parent=projects/*/locations/*}/sources:\x06source\x12\xd6\x01\n\x0cUpdateSource\x12\x30.google.cloud.vmmigration.v1.UpdateSourceRequest\x1a\x1d.google.longrunning.Operation\"u\xca\x41\x1b\n\x06Source\x12\x11OperationMetadata\xda\x41\x12source,update_mask\x82\xd3\xe4\x93\x02<22/v1/{source.name=projects/*/locations/*/sources/*}:\x06source\x12\xc8\x01\n\x0c\x44\x65leteSource\x12\x30.google.cloud.vmmigration.v1.DeleteSourceRequest\x1a\x1d.google.longrunning.Operation\"g\xca\x41*\n\x15google.protobuf.Empty\x12\x11OperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02-*+/v1/{name=projects/*/locations/*/sources/*}\x12\xc8\x01\n\x0e\x46\x65tchInventory\x12\x32.google.cloud.vmmigration.v1.FetchInventoryRequest\x1a\x33.google.cloud.vmmigration.v1.FetchInventoryResponse\"M\xda\x41\x06source\x82\xd3\xe4\x93\x02>\x12 e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets the access control policy for a resource. + # Returns an empty policy if the resource exists and does not have a policy + # set. + # + # @overload get_iam_policy(request, options = nil) + # Pass arguments to `get_iam_policy` via a request object, either of type + # {::Google::Iam::V1::GetIamPolicyRequest} or an equivalent Hash. + # + # @param request [::Google::Iam::V1::GetIamPolicyRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_iam_policy(resource: nil, options: nil) + # Pass arguments to `get_iam_policy` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param resource [::String] + # REQUIRED: The resource for which the policy is being requested. + # See the operation documentation for the appropriate value for this field. + # @param options [::Google::Iam::V1::GetPolicyOptions, ::Hash] + # OPTIONAL: A `GetPolicyOptions` object for specifying options to + # `GetIamPolicy`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Iam::V1::Policy] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Iam::V1::Policy] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/iam/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Iam::V1::IAMPolicy::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Iam::V1::GetIamPolicyRequest.new + # + # # Call the get_iam_policy method. + # result = client.get_iam_policy request + # + # # The returned object is of type Google::Iam::V1::Policy. + # p result + # + def get_iam_policy request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::GetIamPolicyRequest + + # Converts hash 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_iam_policy.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::VMMigration::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.resource + header_params["resource"] = request.resource + 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_iam_policy.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_iam_policy.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @iam_policy_stub.call_rpc :get_iam_policy, 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 permissions that a caller has on the specified resource. + # If the resource does not exist, this will return an empty set of + # permissions, not a `NOT_FOUND` error. + # + # Note: This operation is designed to be used for building permission-aware + # UIs and command-line tools, not for authorization checking. This operation + # may "fail open" without warning. + # + # @overload test_iam_permissions(request, options = nil) + # Pass arguments to `test_iam_permissions` via a request object, either of type + # {::Google::Iam::V1::TestIamPermissionsRequest} or an equivalent Hash. + # + # @param request [::Google::Iam::V1::TestIamPermissionsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload test_iam_permissions(resource: nil, permissions: nil) + # Pass arguments to `test_iam_permissions` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param resource [::String] + # REQUIRED: The resource for which the policy detail is being requested. + # See the operation documentation for the appropriate value for this field. + # @param permissions [::Array<::String>] + # The set of permissions to check for the `resource`. Permissions with + # wildcards (such as '*' or 'storage.*') are not allowed. For more + # information see + # [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Iam::V1::TestIamPermissionsResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Iam::V1::TestIamPermissionsResponse] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/iam/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Iam::V1::IAMPolicy::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Iam::V1::TestIamPermissionsRequest.new + # + # # Call the test_iam_permissions method. + # result = client.test_iam_permissions request + # + # # The returned object is of type Google::Iam::V1::TestIamPermissionsResponse. + # p result + # + def test_iam_permissions request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::TestIamPermissionsRequest + + # Converts hash 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.test_iam_permissions.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::VMMigration::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.resource + header_params["resource"] = request.resource + 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.test_iam_permissions.timeout, + metadata: metadata, + retry_policy: @config.rpcs.test_iam_permissions.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @iam_policy_stub.call_rpc :test_iam_permissions, 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 IAMPolicy API. + # + # This class represents the configuration for IAMPolicy, + # 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::Iam::V1::IAMPolicy::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 + # # set_iam_policy to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Iam::V1::IAMPolicy::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.set_iam_policy.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Iam::V1::IAMPolicy::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.set_iam_policy.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::Iam::V1::IAMPolicy::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 = "iam-meta-api.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 IAMPolicy 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 `set_iam_policy` + # @return [::Gapic::Config::Method] + # + attr_reader :set_iam_policy + ## + # RPC-specific configuration for `get_iam_policy` + # @return [::Gapic::Config::Method] + # + attr_reader :get_iam_policy + ## + # RPC-specific configuration for `test_iam_permissions` + # @return [::Gapic::Config::Method] + # + attr_reader :test_iam_permissions + + # @private + def initialize parent_rpcs = nil + set_iam_policy_config = parent_rpcs.set_iam_policy if parent_rpcs.respond_to? :set_iam_policy + @set_iam_policy = ::Gapic::Config::Method.new set_iam_policy_config + get_iam_policy_config = parent_rpcs.get_iam_policy if parent_rpcs.respond_to? :get_iam_policy + @get_iam_policy = ::Gapic::Config::Method.new get_iam_policy_config + test_iam_permissions_config = parent_rpcs.test_iam_permissions if parent_rpcs.respond_to? :test_iam_permissions + @test_iam_permissions = ::Gapic::Config::Method.new test_iam_permissions_config + + yield self if block_given? + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-vm_migration-v1/lib/google/iam/v1/iam_policy/credentials.rb b/owl-bot-staging/google-cloud-vm_migration-v1/lib/google/iam/v1/iam_policy/credentials.rb new file mode 100644 index 000000000000..ae4df78450b3 --- /dev/null +++ b/owl-bot-staging/google-cloud-vm_migration-v1/lib/google/iam/v1/iam_policy/credentials.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 "googleauth" + +module Google + module Iam + module V1 + module IAMPolicy + # Credentials for the IAMPolicy API. + class Credentials < ::Google::Auth::Credentials + self.env_vars = [ + "GOOGLE_CLOUD_CREDENTIALS", + "GOOGLE_CLOUD_KEYFILE", + "GCLOUD_KEYFILE", + "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 diff --git a/owl-bot-staging/google-cloud-vm_migration-v1/lib/google/iam/v1/iam_policy/rest.rb b/owl-bot-staging/google-cloud-vm_migration-v1/lib/google/iam/v1/iam_policy/rest.rb new file mode 100644 index 000000000000..25a28cce69c7 --- /dev/null +++ b/owl-bot-staging/google-cloud-vm_migration-v1/lib/google/iam/v1/iam_policy/rest.rb @@ -0,0 +1,74 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/vm_migration/v1/version" +require "google/iam/v1/bindings_override" + +require "google/iam/v1/iam_policy/credentials" +require "google/iam/v1/iam_policy/rest/client" + +module Google + module Iam + module V1 + ## + # API Overview + # + # Manages Identity and Access Management (IAM) policies. + # + # Any implementation of an API that offers access control features + # implements the google.iam.v1.IAMPolicy interface. + # + # ## Data model + # + # Access control is applied when a principal (user or service account), takes + # some action on a resource exposed by a service. Resources, identified by + # URI-like names, are the unit of access control specification. Service + # implementations can choose the granularity of access control and the + # supported permissions for their resources. + # For example one database service may allow access control to be + # specified only at the Table level, whereas another might allow access control + # to also be specified at the Column level. + # + # ## Policy Structure + # + # See google.iam.v1.Policy + # + # This is intentionally not a CRUD style API because access control policies + # are created and deleted implicitly with the resources to which they are + # attached. + # + # To load this service and instantiate a REST client: + # + # require "google/iam/v1/iam_policy/rest" + # client = ::Google::Iam::V1::IAMPolicy::Rest::Client.new + # + module IAMPolicy + # Client for the REST transport + module Rest + end + end + end + end +end + +helper_path = ::File.join __dir__, "rest", "helpers.rb" +require "google/iam/v1/iam_policy/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-vm_migration-v1/lib/google/iam/v1/iam_policy/rest/client.rb b/owl-bot-staging/google-cloud-vm_migration-v1/lib/google/iam/v1/iam_policy/rest/client.rb new file mode 100644 index 000000000000..7fd6f1f09943 --- /dev/null +++ b/owl-bot-staging/google-cloud-vm_migration-v1/lib/google/iam/v1/iam_policy/rest/client.rb @@ -0,0 +1,671 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/iam/v1/iam_policy_pb" +require "google/iam/v1/iam_policy/rest/service_stub" +require "google/cloud/location/rest" + +module Google + module Iam + module V1 + module IAMPolicy + module Rest + ## + # REST client for the IAMPolicy service. + # + # API Overview + # + # Manages Identity and Access Management (IAM) policies. + # + # Any implementation of an API that offers access control features + # implements the google.iam.v1.IAMPolicy interface. + # + # ## Data model + # + # Access control is applied when a principal (user or service account), takes + # some action on a resource exposed by a service. Resources, identified by + # URI-like names, are the unit of access control specification. Service + # implementations can choose the granularity of access control and the + # supported permissions for their resources. + # For example one database service may allow access control to be + # specified only at the Table level, whereas another might allow access control + # to also be specified at the Column level. + # + # ## Policy Structure + # + # See google.iam.v1.Policy + # + # This is intentionally not a CRUD style API because access control policies + # are created and deleted implicitly with the resources to which they are + # attached. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "iam-meta-api.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :iam_policy_stub + + ## + # Configure the IAMPolicy Client class. + # + # See {::Google::Iam::V1::IAMPolicy::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all IAMPolicy clients + # ::Google::Iam::V1::IAMPolicy::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", "Iam", "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 + end + yield @configure if block_given? + @configure + end + + ## + # Configure the IAMPolicy 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::Iam::V1::IAMPolicy::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 + @iam_policy_stub.universe_domain + end + + ## + # Create a new IAMPolicy REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Iam::V1::IAMPolicy::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Iam::V1::IAMPolicy::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the IAMPolicy 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 + + @iam_policy_stub = ::Google::Iam::V1::IAMPolicy::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials, + logger: @config.logger + ) + + @iam_policy_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 = @iam_policy_stub.endpoint + config.universe_domain = @iam_policy_stub.universe_domain + config.bindings_override = @config.bindings_override + config.logger = @iam_policy_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 + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @iam_policy_stub.logger + end + + # Service calls + + ## + # Sets the access control policy on the specified resource. Replaces any + # existing policy. + # + # Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` errors. + # + # @overload set_iam_policy(request, options = nil) + # Pass arguments to `set_iam_policy` via a request object, either of type + # {::Google::Iam::V1::SetIamPolicyRequest} or an equivalent Hash. + # + # @param request [::Google::Iam::V1::SetIamPolicyRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload set_iam_policy(resource: nil, policy: nil, update_mask: nil) + # Pass arguments to `set_iam_policy` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param resource [::String] + # REQUIRED: The resource for which the policy is being specified. + # See the operation documentation for the appropriate value for this field. + # @param policy [::Google::Iam::V1::Policy, ::Hash] + # REQUIRED: The complete policy to be applied to the `resource`. The size of + # the policy is limited to a few 10s of KB. An empty policy is a + # valid policy but certain Cloud Platform services (such as Projects) + # might reject them. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only + # the fields in the mask will be modified. If no mask is provided, the + # following default mask is used: + # + # `paths: "bindings, etag"` + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Iam::V1::Policy] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Iam::V1::Policy] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/iam/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Iam::V1::IAMPolicy::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Iam::V1::SetIamPolicyRequest.new + # + # # Call the set_iam_policy method. + # result = client.set_iam_policy request + # + # # The returned object is of type Google::Iam::V1::Policy. + # p result + # + def set_iam_policy request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::SetIamPolicyRequest + + # Converts hash 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.set_iam_policy.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::VMMigration::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.set_iam_policy.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.set_iam_policy.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @iam_policy_stub.set_iam_policy 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 + + ## + # Gets the access control policy for a resource. + # Returns an empty policy if the resource exists and does not have a policy + # set. + # + # @overload get_iam_policy(request, options = nil) + # Pass arguments to `get_iam_policy` via a request object, either of type + # {::Google::Iam::V1::GetIamPolicyRequest} or an equivalent Hash. + # + # @param request [::Google::Iam::V1::GetIamPolicyRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_iam_policy(resource: nil, options: nil) + # Pass arguments to `get_iam_policy` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param resource [::String] + # REQUIRED: The resource for which the policy is being requested. + # See the operation documentation for the appropriate value for this field. + # @param options [::Google::Iam::V1::GetPolicyOptions, ::Hash] + # OPTIONAL: A `GetPolicyOptions` object for specifying options to + # `GetIamPolicy`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Iam::V1::Policy] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Iam::V1::Policy] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/iam/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Iam::V1::IAMPolicy::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Iam::V1::GetIamPolicyRequest.new + # + # # Call the get_iam_policy method. + # result = client.get_iam_policy request + # + # # The returned object is of type Google::Iam::V1::Policy. + # p result + # + def get_iam_policy request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::GetIamPolicyRequest + + # Converts hash 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_iam_policy.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::VMMigration::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_iam_policy.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_iam_policy.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @iam_policy_stub.get_iam_policy 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 permissions that a caller has on the specified resource. + # If the resource does not exist, this will return an empty set of + # permissions, not a `NOT_FOUND` error. + # + # Note: This operation is designed to be used for building permission-aware + # UIs and command-line tools, not for authorization checking. This operation + # may "fail open" without warning. + # + # @overload test_iam_permissions(request, options = nil) + # Pass arguments to `test_iam_permissions` via a request object, either of type + # {::Google::Iam::V1::TestIamPermissionsRequest} or an equivalent Hash. + # + # @param request [::Google::Iam::V1::TestIamPermissionsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload test_iam_permissions(resource: nil, permissions: nil) + # Pass arguments to `test_iam_permissions` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param resource [::String] + # REQUIRED: The resource for which the policy detail is being requested. + # See the operation documentation for the appropriate value for this field. + # @param permissions [::Array<::String>] + # The set of permissions to check for the `resource`. Permissions with + # wildcards (such as '*' or 'storage.*') are not allowed. For more + # information see + # [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Iam::V1::TestIamPermissionsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Iam::V1::TestIamPermissionsResponse] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/iam/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Iam::V1::IAMPolicy::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Iam::V1::TestIamPermissionsRequest.new + # + # # Call the test_iam_permissions method. + # result = client.test_iam_permissions request + # + # # The returned object is of type Google::Iam::V1::TestIamPermissionsResponse. + # p result + # + def test_iam_permissions request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::TestIamPermissionsRequest + + # Converts hash 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.test_iam_permissions.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::VMMigration::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.test_iam_permissions.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.test_iam_permissions.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @iam_policy_stub.test_iam_permissions 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 IAMPolicy REST API. + # + # This class represents the configuration for IAMPolicy 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::Iam::V1::IAMPolicy::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 + # # set_iam_policy to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Iam::V1::IAMPolicy::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.set_iam_policy.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Iam::V1::IAMPolicy::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.set_iam_policy.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 = "iam-meta-api.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 IAMPolicy 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 `set_iam_policy` + # @return [::Gapic::Config::Method] + # + attr_reader :set_iam_policy + ## + # RPC-specific configuration for `get_iam_policy` + # @return [::Gapic::Config::Method] + # + attr_reader :get_iam_policy + ## + # RPC-specific configuration for `test_iam_permissions` + # @return [::Gapic::Config::Method] + # + attr_reader :test_iam_permissions + + # @private + def initialize parent_rpcs = nil + set_iam_policy_config = parent_rpcs.set_iam_policy if parent_rpcs.respond_to? :set_iam_policy + @set_iam_policy = ::Gapic::Config::Method.new set_iam_policy_config + get_iam_policy_config = parent_rpcs.get_iam_policy if parent_rpcs.respond_to? :get_iam_policy + @get_iam_policy = ::Gapic::Config::Method.new get_iam_policy_config + test_iam_permissions_config = parent_rpcs.test_iam_permissions if parent_rpcs.respond_to? :test_iam_permissions + @test_iam_permissions = ::Gapic::Config::Method.new test_iam_permissions_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-vm_migration-v1/lib/google/iam/v1/iam_policy/rest/service_stub.rb b/owl-bot-staging/google-cloud-vm_migration-v1/lib/google/iam/v1/iam_policy/rest/service_stub.rb new file mode 100644 index 000000000000..0a767ec9f84a --- /dev/null +++ b/owl-bot-staging/google-cloud-vm_migration-v1/lib/google/iam/v1/iam_policy/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/iam/v1/iam_policy_pb" + +module Google + module Iam + module V1 + module IAMPolicy + module Rest + ## + # REST service stub for the IAMPolicy 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 set_iam_policy REST call + # + # @param request_pb [::Google::Iam::V1::SetIamPolicyRequest] + # 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::Iam::V1::Policy] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Iam::V1::Policy] + # A result object deserialized from the server's reply + def set_iam_policy request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_set_iam_policy_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: "set_iam_policy", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Iam::V1::Policy.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_iam_policy REST call + # + # @param request_pb [::Google::Iam::V1::GetIamPolicyRequest] + # 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::Iam::V1::Policy] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Iam::V1::Policy] + # A result object deserialized from the server's reply + def get_iam_policy request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_iam_policy_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_iam_policy", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Iam::V1::Policy.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the test_iam_permissions REST call + # + # @param request_pb [::Google::Iam::V1::TestIamPermissionsRequest] + # 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::Iam::V1::TestIamPermissionsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Iam::V1::TestIamPermissionsResponse] + # A result object deserialized from the server's reply + def test_iam_permissions request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_test_iam_permissions_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: "test_iam_permissions", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Iam::V1::TestIamPermissionsResponse.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 set_iam_policy REST call + # + # @param request_pb [::Google::Iam::V1::SetIamPolicyRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_set_iam_policy_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{resource}:setIamPolicy", + body: "*", + matches: [ + ["resource", %r{^.*$}, true] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_iam_policy REST call + # + # @param request_pb [::Google::Iam::V1::GetIamPolicyRequest] + # 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_iam_policy_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{resource}:getIamPolicy", + body: "*", + matches: [ + ["resource", %r{^.*$}, true] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the test_iam_permissions REST call + # + # @param request_pb [::Google::Iam::V1::TestIamPermissionsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_test_iam_permissions_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{resource}:testIamPermissions", + body: "*", + matches: [ + ["resource", %r{^.*$}, true] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-vm_migration-v1/lib/google/iam/v1/rest.rb b/owl-bot-staging/google-cloud-vm_migration-v1/lib/google/iam/v1/rest.rb new file mode 100644 index 000000000000..c43b181b146c --- /dev/null +++ b/owl-bot-staging/google-cloud-vm_migration-v1/lib/google/iam/v1/rest.rb @@ -0,0 +1,36 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/iam/v1/iam_policy/rest" +require "google/iam/v1/bindings_override" +require "google/cloud/vm_migration/v1/version" + +module Google + module Iam + ## + # To load just the REST part of this package, including all its services, and instantiate a REST client: + # + # @example + # + # require "google/iam/v1/rest" + # client = ::Google::Iam::V1::IAMPolicy::Rest::Client.new + # + module V1 + end + end +end diff --git a/owl-bot-staging/google-cloud-vm_migration-v1/proto_docs/README.md b/owl-bot-staging/google-cloud-vm_migration-v1/proto_docs/README.md new file mode 100644 index 000000000000..f5158dc80a37 --- /dev/null +++ b/owl-bot-staging/google-cloud-vm_migration-v1/proto_docs/README.md @@ -0,0 +1,4 @@ +# Migrate for Compute Engine 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-vm_migration-v1/proto_docs/google/api/client.rb b/owl-bot-staging/google-cloud-vm_migration-v1/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..3ab0b096d445 --- /dev/null +++ b/owl-bot-staging/google-cloud-vm_migration-v1/proto_docs/google/api/client.rb @@ -0,0 +1,593 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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. + # + # Note: This field should not be used in most cases. + 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: + # library_settings: + # 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. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Php. Clobbers the php_namespace option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.php.package_name" field + # in gapic.yaml. API teams should use the protobuf php_namespace option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # library_settings: + # php_settings: + # library_package: Google\Cloud\PubSub\V1 + 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. + # + # Example: + # + # 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 + # @!attribute [rw] batching + # @return [::Google::Api::BatchingConfigProto] + # Batching configuration for an API method in client libraries. + # + # Example of a YAML configuration: + # + # publishing: + # method_settings: + # - selector: google.example.v1.ExampleService.BatchCreateExample + # batching: + # element_count_threshold: 1000 + # request_byte_threshold: 100000000 + # delay_threshold_millis: 10 + 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. + # + # Note: This feature should not be used in most cases. + # @!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 + + # `BatchingConfigProto` defines the batching configuration for an API method. + # @!attribute [rw] thresholds + # @return [::Google::Api::BatchingSettingsProto] + # The thresholds which trigger a batched request to be sent. + # @!attribute [rw] batch_descriptor + # @return [::Google::Api::BatchingDescriptorProto] + # The request and response fields used in batching. + class BatchingConfigProto + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `BatchingSettingsProto` specifies a set of batching thresholds, each of + # which acts as a trigger to send a batch of messages as a request. At least + # one threshold must be positive nonzero. + # @!attribute [rw] element_count_threshold + # @return [::Integer] + # The number of elements of a field collected into a batch which, if + # exceeded, causes the batch to be sent. + # @!attribute [rw] request_byte_threshold + # @return [::Integer] + # The aggregated size of the batched field which, if exceeded, causes the + # batch to be sent. This size is computed by aggregating the sizes of the + # request field to be batched, not of the entire request message. + # @!attribute [rw] delay_threshold + # @return [::Google::Protobuf::Duration] + # The duration after which a batch should be sent, starting from the addition + # of the first message to that batch. + # @!attribute [rw] element_count_limit + # @return [::Integer] + # The maximum number of elements collected in a batch that could be accepted + # by server. + # @!attribute [rw] request_byte_limit + # @return [::Integer] + # The maximum size of the request that could be accepted by server. + # @!attribute [rw] flow_control_element_limit + # @return [::Integer] + # The maximum number of elements allowed by flow control. + # @!attribute [rw] flow_control_byte_limit + # @return [::Integer] + # The maximum size of data allowed by flow control. + # @!attribute [rw] flow_control_limit_exceeded_behavior + # @return [::Google::Api::FlowControlLimitExceededBehaviorProto] + # The behavior to take when the flow control limit is exceeded. + class BatchingSettingsProto + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `BatchingDescriptorProto` specifies the fields of the request message to be + # used for batching, and, optionally, the fields of the response message to be + # used for demultiplexing. + # @!attribute [rw] batched_field + # @return [::String] + # The repeated field in the request message to be aggregated by batching. + # @!attribute [rw] discriminator_fields + # @return [::Array<::String>] + # A list of the fields in the request message. Two requests will be batched + # together only if the values of every field specified in + # `request_discriminator_fields` is equal between the two requests. + # @!attribute [rw] subresponse_field + # @return [::String] + # Optional. When present, indicates the field in the response message to be + # used to demultiplex the response into multiple response messages, in + # correspondence with the multiple request messages originally batched + # together. + class BatchingDescriptorProto + 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 + + # The behavior to take when the flow control limit is exceeded. + module FlowControlLimitExceededBehaviorProto + # Default behavior, system-defined. + UNSET_BEHAVIOR = 0 + + # Stop operation, raise error. + THROW_EXCEPTION = 1 + + # Pause operation until limit clears. + BLOCK = 2 + + # Continue operation, disregard limit. + IGNORE = 3 + end + end +end diff --git a/owl-bot-staging/google-cloud-vm_migration-v1/proto_docs/google/api/field_behavior.rb b/owl-bot-staging/google-cloud-vm_migration-v1/proto_docs/google/api/field_behavior.rb new file mode 100644 index 000000000000..582be187d115 --- /dev/null +++ b/owl-bot-staging/google-cloud-vm_migration-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-vm_migration-v1/proto_docs/google/api/field_info.rb b/owl-bot-staging/google-cloud-vm_migration-v1/proto_docs/google/api/field_info.rb new file mode 100644 index 000000000000..0f5acf0a5538 --- /dev/null +++ b/owl-bot-staging/google-cloud-vm_migration-v1/proto_docs/google/api/field_info.rb @@ -0,0 +1,88 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 + # Rich semantic information of an API field beyond basic typing. + # @!attribute [rw] format + # @return [::Google::Api::FieldInfo::Format] + # The standard format of a field value. This does not explicitly configure + # any API consumer, just documents the API's format for the field it is + # applied to. + # @!attribute [rw] referenced_types + # @return [::Array<::Google::Api::TypeReference>] + # The type(s) that the annotated, generic field may represent. + # + # Currently, this must only be used on fields of type `google.protobuf.Any`. + # Supporting other generic types may be considered in the future. + class FieldInfo + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The standard format of a field value. The supported formats are all backed + # by either an RFC defined by the IETF or a Google-defined AIP. + module Format + # Default, unspecified value. + FORMAT_UNSPECIFIED = 0 + + # Universally Unique Identifier, version 4, value as defined by + # https://datatracker.ietf.org/doc/html/rfc4122. The value may be + # normalized to entirely lowercase letters. For example, the value + # `F47AC10B-58CC-0372-8567-0E02B2C3D479` would be normalized to + # `f47ac10b-58cc-0372-8567-0e02b2c3d479`. + UUID4 = 1 + + # Internet Protocol v4 value as defined by [RFC + # 791](https://datatracker.ietf.org/doc/html/rfc791). The value may be + # condensed, with leading zeros in each octet stripped. For example, + # `001.022.233.040` would be condensed to `1.22.233.40`. + IPV4 = 2 + + # Internet Protocol v6 value as defined by [RFC + # 2460](https://datatracker.ietf.org/doc/html/rfc2460). The value may be + # normalized to entirely lowercase letters with zeros compressed, following + # [RFC 5952](https://datatracker.ietf.org/doc/html/rfc5952). For example, + # the value `2001:0DB8:0::0` would be normalized to `2001:db8::`. + IPV6 = 3 + + # An IP address in either v4 or v6 format as described by the individual + # values defined herein. See the comments on the IPV4 and IPV6 types for + # allowed normalizations of each. + IPV4_OR_IPV6 = 4 + end + end + + # A reference to a message type, for use in {::Google::Api::FieldInfo FieldInfo}. + # @!attribute [rw] type_name + # @return [::String] + # The name of the type that the annotated, generic field may represent. + # If the type is in the same protobuf package, the value can be the simple + # message name e.g., `"MyMessage"`. Otherwise, the value must be the + # fully-qualified message name e.g., `"google.library.v1.Book"`. + # + # If the type(s) are unknown to the service (e.g. the field accepts generic + # user input), use the wildcard `"*"` to denote this behavior. + # + # See [AIP-202](https://google.aip.dev/202#type-references) for more details. + class TypeReference + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-vm_migration-v1/proto_docs/google/api/launch_stage.rb b/owl-bot-staging/google-cloud-vm_migration-v1/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..9392a413fb1b --- /dev/null +++ b/owl-bot-staging/google-cloud-vm_migration-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-vm_migration-v1/proto_docs/google/api/resource.rb b/owl-bot-staging/google-cloud-vm_migration-v1/proto_docs/google/api/resource.rb new file mode 100644 index 000000000000..25dec4847ac1 --- /dev/null +++ b/owl-bot-staging/google-cloud-vm_migration-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-vm_migration-v1/proto_docs/google/cloud/vmmigration/v1/vmmigration.rb b/owl-bot-staging/google-cloud-vm_migration-v1/proto_docs/google/cloud/vmmigration/v1/vmmigration.rb new file mode 100644 index 000000000000..3619ed09a8ed --- /dev/null +++ b/owl-bot-staging/google-cloud-vm_migration-v1/proto_docs/google/cloud/vmmigration/v1/vmmigration.rb @@ -0,0 +1,4882 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 VMMigration + module V1 + # ReplicationCycle contains information about the current replication cycle + # status. + # @!attribute [rw] name + # @return [::String] + # The identifier of the ReplicationCycle. + # @!attribute [rw] cycle_number + # @return [::Integer] + # The cycle's ordinal number. + # @!attribute [rw] start_time + # @return [::Google::Protobuf::Timestamp] + # The time the replication cycle has started. + # @!attribute [rw] end_time + # @return [::Google::Protobuf::Timestamp] + # The time the replication cycle has ended. + # @!attribute [rw] total_pause_duration + # @return [::Google::Protobuf::Duration] + # The accumulated duration the replication cycle was paused. + # @!attribute [rw] progress_percent + # @deprecated This field is deprecated and may be removed in the next major version update. + # @return [::Integer] + # The current progress in percentage of this cycle. + # Was replaced by 'steps' field, which breaks down the cycle progression more + # accurately. + # @!attribute [rw] steps + # @return [::Array<::Google::Cloud::VMMigration::V1::CycleStep>] + # The cycle's steps list representing its progress. + # @!attribute [rw] state + # @return [::Google::Cloud::VMMigration::V1::ReplicationCycle::State] + # State of the ReplicationCycle. + # @!attribute [r] error + # @return [::Google::Rpc::Status] + # Output only. Provides details on the state of the cycle in case of an + # error. + # @!attribute [r] warnings + # @return [::Array<::Google::Cloud::VMMigration::V1::MigrationWarning>] + # Output only. Warnings that occurred during the cycle. + class ReplicationCycle + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Possible states of a replication cycle. + module State + # The state is unknown. This is used for API compatibility only and is not + # used by the system. + STATE_UNSPECIFIED = 0 + + # The replication cycle is running. + RUNNING = 1 + + # The replication cycle is paused. + PAUSED = 2 + + # The replication cycle finished with errors. + FAILED = 3 + + # The replication cycle finished successfully. + SUCCEEDED = 4 + end + end + + # CycleStep holds information about a step progress. + # @!attribute [rw] initializing_replication + # @return [::Google::Cloud::VMMigration::V1::InitializingReplicationStep] + # Initializing replication step. + # + # Note: The following fields are mutually exclusive: `initializing_replication`, `replicating`, `post_processing`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] replicating + # @return [::Google::Cloud::VMMigration::V1::ReplicatingStep] + # Replicating step. + # + # Note: The following fields are mutually exclusive: `replicating`, `initializing_replication`, `post_processing`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] post_processing + # @return [::Google::Cloud::VMMigration::V1::PostProcessingStep] + # Post processing step. + # + # Note: The following fields are mutually exclusive: `post_processing`, `initializing_replication`, `replicating`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] start_time + # @return [::Google::Protobuf::Timestamp] + # The time the cycle step has started. + # @!attribute [rw] end_time + # @return [::Google::Protobuf::Timestamp] + # The time the cycle step has ended. + class CycleStep + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # InitializingReplicationStep contains specific step details. + class InitializingReplicationStep + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # ReplicatingStep contains specific step details. + # @!attribute [rw] total_bytes + # @return [::Integer] + # Total bytes to be handled in the step. + # @!attribute [rw] replicated_bytes + # @return [::Integer] + # Replicated bytes in the step. + # @!attribute [rw] last_two_minutes_average_bytes_per_second + # @return [::Integer] + # The source disks replication rate for the last 2 minutes in bytes per + # second. + # @!attribute [rw] last_thirty_minutes_average_bytes_per_second + # @return [::Integer] + # The source disks replication rate for the last 30 minutes in bytes per + # second. + class ReplicatingStep + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # PostProcessingStep contains specific step details. + class PostProcessingStep + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # ReplicationSync contain information about the last replica sync to the cloud. + # @!attribute [rw] last_sync_time + # @return [::Google::Protobuf::Timestamp] + # The most updated snapshot created time in the source that finished + # replication. + class ReplicationSync + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # MigratingVm describes the VM that will be migrated from a Source environment + # and its replication state. + # @!attribute [rw] compute_engine_target_defaults + # @return [::Google::Cloud::VMMigration::V1::ComputeEngineTargetDefaults] + # Details of the target VM in Compute Engine. + # + # Note: The following fields are mutually exclusive: `compute_engine_target_defaults`, `compute_engine_disks_target_defaults`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] compute_engine_disks_target_defaults + # @return [::Google::Cloud::VMMigration::V1::ComputeEngineDisksTargetDefaults] + # Details of the target Persistent Disks in Compute Engine. + # + # Note: The following fields are mutually exclusive: `compute_engine_disks_target_defaults`, `compute_engine_target_defaults`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [r] vmware_source_vm_details + # @return [::Google::Cloud::VMMigration::V1::VmwareSourceVmDetails] + # Output only. Details of the VM from a Vmware source. + # + # Note: The following fields are mutually exclusive: `vmware_source_vm_details`, `aws_source_vm_details`, `azure_source_vm_details`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [r] aws_source_vm_details + # @return [::Google::Cloud::VMMigration::V1::AwsSourceVmDetails] + # Output only. Details of the VM from an AWS source. + # + # Note: The following fields are mutually exclusive: `aws_source_vm_details`, `vmware_source_vm_details`, `azure_source_vm_details`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [r] azure_source_vm_details + # @return [::Google::Cloud::VMMigration::V1::AzureSourceVmDetails] + # Output only. Details of the VM from an Azure source. + # + # Note: The following fields are mutually exclusive: `azure_source_vm_details`, `vmware_source_vm_details`, `aws_source_vm_details`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [r] name + # @return [::String] + # Output only. The identifier of the MigratingVm. + # @!attribute [rw] source_vm_id + # @return [::String] + # The unique ID of the VM in the source. + # The VM's name in vSphere can be changed, so this is not the VM's name but + # rather its moRef id. This id is of the form vm-. + # @!attribute [rw] display_name + # @return [::String] + # The display name attached to the MigratingVm by the user. + # @!attribute [rw] description + # @return [::String] + # The description attached to the migrating VM by the user. + # @!attribute [rw] policy + # @return [::Google::Cloud::VMMigration::V1::SchedulePolicy] + # The replication schedule policy. + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time the migrating VM was created (this refers to this + # resource and not to the time it was installed in the source). + # @!attribute [r] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The last time the migrating VM resource was updated. + # @!attribute [r] last_sync + # @return [::Google::Cloud::VMMigration::V1::ReplicationSync] + # Output only. The most updated snapshot created time in the source that + # finished replication. + # @!attribute [r] state + # @return [::Google::Cloud::VMMigration::V1::MigratingVm::State] + # Output only. State of the MigratingVm. + # @!attribute [r] state_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The last time the migrating VM state was updated. + # @!attribute [r] current_sync_info + # @return [::Google::Cloud::VMMigration::V1::ReplicationCycle] + # Output only. Details of the current running replication cycle. + # @!attribute [r] last_replication_cycle + # @return [::Google::Cloud::VMMigration::V1::ReplicationCycle] + # Output only. Details of the last replication cycle. This will be updated + # whenever a replication cycle is finished and is not to be confused with + # last_sync which is only updated on successful replication cycles. + # @!attribute [r] group + # @return [::String] + # Output only. The group this migrating vm is included in, if any. The group + # is represented by the full path of the appropriate + # {::Google::Cloud::VMMigration::V1::Group Group} resource. + # @!attribute [rw] labels + # @return [::Google::Protobuf::Map{::String => ::String}] + # The labels of the migrating VM. + # @!attribute [r] recent_clone_jobs + # @return [::Array<::Google::Cloud::VMMigration::V1::CloneJob>] + # Output only. The recent {::Google::Cloud::VMMigration::V1::CloneJob clone jobs} + # performed on the migrating VM. This field holds the vm's last completed + # clone job and the vm's running clone job, if one exists. + # Note: To have this field populated you need to explicitly request it via + # the "view" parameter of the Get/List request. + # @!attribute [r] error + # @return [::Google::Rpc::Status] + # Output only. Provides details on the state of the Migrating VM in case of + # an error in replication. + # @!attribute [r] recent_cutover_jobs + # @return [::Array<::Google::Cloud::VMMigration::V1::CutoverJob>] + # Output only. The recent cutover jobs performed on the migrating VM. + # This field holds the vm's last completed cutover job and the vm's + # running cutover job, if one exists. + # Note: To have this field populated you need to explicitly request it via + # the "view" parameter of the Get/List request. + # @!attribute [r] cutover_forecast + # @return [::Google::Cloud::VMMigration::V1::CutoverForecast] + # Output only. Provides details of future CutoverJobs of a MigratingVm. + # Set to empty when cutover forecast is unavailable. + # @!attribute [r] expiration + # @return [::Google::Cloud::VMMigration::V1::MigratingVm::Expiration] + # Output only. Provides details about the expiration state of the migrating + # VM. + class MigratingVm + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Expiration holds information about the expiration of a MigratingVm. + # @!attribute [r] expire_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Timestamp of when this resource is considered expired. + # @!attribute [r] extension_count + # @return [::Integer] + # Output only. The number of times expiration was extended. + # @!attribute [r] extendable + # @return [::Boolean] + # Output only. Describes whether the expiration can be extended. + class Expiration + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class LabelsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The possible values of the state/health of source VM. + module State + # The state was not sampled by the health checks yet. + STATE_UNSPECIFIED = 0 + + # The VM in the source is being verified. + PENDING = 1 + + # The source VM was verified, and it's ready to start replication. + READY = 2 + + # Migration is going through the first sync cycle. + FIRST_SYNC = 3 + + # The replication is active, and it's running or scheduled to run. + ACTIVE = 4 + + # The source VM is being turned off, and a final replication is currently + # running. + CUTTING_OVER = 7 + + # The source VM was stopped and replicated. The replication is currently + # paused. + CUTOVER = 8 + + # A cutover job is active and replication cycle is running the final sync. + FINAL_SYNC = 9 + + # The replication was paused by the user and no cycles are scheduled to + # run. + PAUSED = 10 + + # The migrating VM is being finalized and migration resources are being + # removed. + FINALIZING = 11 + + # The replication process is done. The migrating VM is finalized and no + # longer consumes billable resources. + FINALIZED = 12 + + # The replication process encountered an unrecoverable error and was + # aborted. + ERROR = 13 + + # The migrating VM has passed its expiration date. It might be possible to + # bring it back to "Active" state by updating the TTL field. For more + # information, see the documentation. + EXPIRED = 14 + + # The migrating VM's has been finalized and migration resources have been + # removed. + FINALIZED_EXPIRED = 17 + end + end + + # CutoverForecast holds information about future CutoverJobs of a MigratingVm. + # @!attribute [r] estimated_cutover_job_duration + # @return [::Google::Protobuf::Duration] + # Output only. Estimation of the CutoverJob duration. + class CutoverForecast + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # CloneJob describes the process of creating a clone of a + # {::Google::Cloud::VMMigration::V1::MigratingVm MigratingVM} to the + # requested target based on the latest successful uploaded snapshots. + # While the migration cycles of a MigratingVm take place, it is possible to + # verify the uploaded VM can be started in the cloud, by creating a clone. The + # clone can be created without any downtime, and it is created using the latest + # snapshots which are already in the cloud. The cloneJob is only responsible + # for its work, not its products, which means once it is finished, it will + # never touch the instance it created. It will only delete it in case of the + # CloneJob being cancelled or upon failure to clone. + # @!attribute [r] compute_engine_target_details + # @return [::Google::Cloud::VMMigration::V1::ComputeEngineTargetDetails] + # Output only. Details of the target VM in Compute Engine. + # + # Note: The following fields are mutually exclusive: `compute_engine_target_details`, `compute_engine_disks_target_details`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [r] compute_engine_disks_target_details + # @return [::Google::Cloud::VMMigration::V1::ComputeEngineDisksTargetDetails] + # Output only. Details of the target Persistent Disks in Compute Engine. + # + # Note: The following fields are mutually exclusive: `compute_engine_disks_target_details`, `compute_engine_target_details`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time the clone job was created (as an API call, not when + # it was actually created in the target). + # @!attribute [r] end_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time the clone job was ended. + # @!attribute [r] name + # @return [::String] + # Output only. The name of the clone. + # @!attribute [r] state + # @return [::Google::Cloud::VMMigration::V1::CloneJob::State] + # Output only. State of the clone job. + # @!attribute [r] state_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time the state was last updated. + # @!attribute [r] error + # @return [::Google::Rpc::Status] + # Output only. Provides details for the errors that led to the Clone Job's + # state. + # @!attribute [r] steps + # @return [::Array<::Google::Cloud::VMMigration::V1::CloneStep>] + # Output only. The clone steps list representing its progress. + class CloneJob + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Possible states of the clone job. + module State + # The state is unknown. This is used for API compatibility only and is not + # used by the system. + STATE_UNSPECIFIED = 0 + + # The clone job has not yet started. + PENDING = 1 + + # The clone job is active and running. + ACTIVE = 2 + + # The clone job finished with errors. + FAILED = 3 + + # The clone job finished successfully. + SUCCEEDED = 4 + + # The clone job was cancelled. + CANCELLED = 5 + + # The clone job is being cancelled. + CANCELLING = 6 + + # OS adaptation is running as part of the clone job to generate license. + ADAPTING_OS = 7 + end + end + + # CloneStep holds information about the clone step progress. + # @!attribute [rw] adapting_os + # @return [::Google::Cloud::VMMigration::V1::AdaptingOSStep] + # Adapting OS step. + # + # Note: The following fields are mutually exclusive: `adapting_os`, `preparing_vm_disks`, `instantiating_migrated_vm`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] preparing_vm_disks + # @return [::Google::Cloud::VMMigration::V1::PreparingVMDisksStep] + # Preparing VM disks step. + # + # Note: The following fields are mutually exclusive: `preparing_vm_disks`, `adapting_os`, `instantiating_migrated_vm`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] instantiating_migrated_vm + # @return [::Google::Cloud::VMMigration::V1::InstantiatingMigratedVMStep] + # Instantiating migrated VM step. + # + # Note: The following fields are mutually exclusive: `instantiating_migrated_vm`, `adapting_os`, `preparing_vm_disks`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] start_time + # @return [::Google::Protobuf::Timestamp] + # The time the step has started. + # @!attribute [rw] end_time + # @return [::Google::Protobuf::Timestamp] + # The time the step has ended. + class CloneStep + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # AdaptingOSStep contains specific step details. + class AdaptingOSStep + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # PreparingVMDisksStep contains specific step details. + class PreparingVMDisksStep + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # InstantiatingMigratedVMStep contains specific step details. + class InstantiatingMigratedVMStep + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # CutoverJob message describes a cutover of a migrating VM. The CutoverJob is + # the operation of shutting down the VM, creating a snapshot and + # cloning the VM using the replicated snapshot. + # @!attribute [r] compute_engine_target_details + # @return [::Google::Cloud::VMMigration::V1::ComputeEngineTargetDetails] + # Output only. Details of the target VM in Compute Engine. + # + # Note: The following fields are mutually exclusive: `compute_engine_target_details`, `compute_engine_disks_target_details`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [r] compute_engine_disks_target_details + # @return [::Google::Cloud::VMMigration::V1::ComputeEngineDisksTargetDetails] + # Output only. Details of the target Persistent Disks in Compute Engine. + # + # Note: The following fields are mutually exclusive: `compute_engine_disks_target_details`, `compute_engine_target_details`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time the cutover job was created (as an API call, not when + # it was actually created in the target). + # @!attribute [r] end_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time the cutover job had finished. + # @!attribute [r] name + # @return [::String] + # Output only. The name of the cutover job. + # @!attribute [r] state + # @return [::Google::Cloud::VMMigration::V1::CutoverJob::State] + # Output only. State of the cutover job. + # @!attribute [r] state_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time the state was last updated. + # @!attribute [r] progress_percent + # @return [::Integer] + # Output only. The current progress in percentage of the cutover job. + # @!attribute [r] error + # @return [::Google::Rpc::Status] + # Output only. Provides details for the errors that led to the Cutover Job's + # state. + # @!attribute [r] state_message + # @return [::String] + # Output only. A message providing possible extra details about the current + # state. + # @!attribute [r] steps + # @return [::Array<::Google::Cloud::VMMigration::V1::CutoverStep>] + # Output only. The cutover steps list representing its progress. + class CutoverJob + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Possible states of the cutover job. + module State + # The state is unknown. This is used for API compatibility only and is not + # used by the system. + STATE_UNSPECIFIED = 0 + + # The cutover job has not yet started. + PENDING = 1 + + # The cutover job finished with errors. + FAILED = 2 + + # The cutover job finished successfully. + SUCCEEDED = 3 + + # The cutover job was cancelled. + CANCELLED = 4 + + # The cutover job is being cancelled. + CANCELLING = 5 + + # The cutover job is active and running. + ACTIVE = 6 + + # OS adaptation is running as part of the cutover job to generate license. + ADAPTING_OS = 7 + end + end + + # CutoverStep holds information about the cutover step progress. + # @!attribute [rw] previous_replication_cycle + # @return [::Google::Cloud::VMMigration::V1::ReplicationCycle] + # A replication cycle prior cutover step. + # + # Note: The following fields are mutually exclusive: `previous_replication_cycle`, `shutting_down_source_vm`, `final_sync`, `preparing_vm_disks`, `instantiating_migrated_vm`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] shutting_down_source_vm + # @return [::Google::Cloud::VMMigration::V1::ShuttingDownSourceVMStep] + # Shutting down VM step. + # + # Note: The following fields are mutually exclusive: `shutting_down_source_vm`, `previous_replication_cycle`, `final_sync`, `preparing_vm_disks`, `instantiating_migrated_vm`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] final_sync + # @return [::Google::Cloud::VMMigration::V1::ReplicationCycle] + # Final sync step. + # + # Note: The following fields are mutually exclusive: `final_sync`, `previous_replication_cycle`, `shutting_down_source_vm`, `preparing_vm_disks`, `instantiating_migrated_vm`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] preparing_vm_disks + # @return [::Google::Cloud::VMMigration::V1::PreparingVMDisksStep] + # Preparing VM disks step. + # + # Note: The following fields are mutually exclusive: `preparing_vm_disks`, `previous_replication_cycle`, `shutting_down_source_vm`, `final_sync`, `instantiating_migrated_vm`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] instantiating_migrated_vm + # @return [::Google::Cloud::VMMigration::V1::InstantiatingMigratedVMStep] + # Instantiating migrated VM step. + # + # Note: The following fields are mutually exclusive: `instantiating_migrated_vm`, `previous_replication_cycle`, `shutting_down_source_vm`, `final_sync`, `preparing_vm_disks`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] start_time + # @return [::Google::Protobuf::Timestamp] + # The time the step has started. + # @!attribute [rw] end_time + # @return [::Google::Protobuf::Timestamp] + # The time the step has ended. + class CutoverStep + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # ShuttingDownSourceVMStep contains specific step details. + class ShuttingDownSourceVMStep + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for 'CreateCloneJob' request. + # @!attribute [rw] parent + # @return [::String] + # Required. The Clone's parent. + # @!attribute [rw] clone_job_id + # @return [::String] + # Required. The clone job identifier. + # @!attribute [rw] clone_job + # @return [::Google::Cloud::VMMigration::V1::CloneJob] + # Required. The clone request body. + # @!attribute [rw] request_id + # @return [::String] + # A request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server will guarantee + # that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + class CreateCloneJobRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for 'CancelCloneJob' request. + # @!attribute [rw] name + # @return [::String] + # Required. The clone job id + class CancelCloneJobRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for 'CancelCloneJob' request. + class CancelCloneJobResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for 'ListCloneJobsRequest' request. + # @!attribute [rw] parent + # @return [::String] + # Required. The parent, which owns this collection of source VMs. + # @!attribute [rw] page_size + # @return [::Integer] + # Optional. The maximum number of clone jobs to return. The service may + # return fewer than this value. If unspecified, at most 500 clone jobs will + # be returned. The maximum value is 1000; values above 1000 will be coerced + # to 1000. + # @!attribute [rw] page_token + # @return [::String] + # Required. A page token, received from a previous `ListCloneJobs` call. + # Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to `ListCloneJobs` must + # match the call that provided the page token. + # @!attribute [rw] filter + # @return [::String] + # Optional. The filter request. + # @!attribute [rw] order_by + # @return [::String] + # Optional. the order by fields for the result. + class ListCloneJobsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for 'ListCloneJobs' request. + # @!attribute [r] clone_jobs + # @return [::Array<::Google::Cloud::VMMigration::V1::CloneJob>] + # Output only. The list of clone jobs response. + # @!attribute [r] next_page_token + # @return [::String] + # Output only. A token, which can be sent as `page_token` to retrieve the + # next page. If this field is omitted, there are no subsequent pages. + # @!attribute [r] unreachable + # @return [::Array<::String>] + # Output only. Locations that could not be reached. + class ListCloneJobsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for 'GetCloneJob' request. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the CloneJob. + class GetCloneJobRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Source message describes a specific vm migration Source resource. It contains + # the source environment information. + # @!attribute [rw] vmware + # @return [::Google::Cloud::VMMigration::V1::VmwareSourceDetails] + # Vmware type source details. + # + # Note: The following fields are mutually exclusive: `vmware`, `aws`, `azure`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] aws + # @return [::Google::Cloud::VMMigration::V1::AwsSourceDetails] + # AWS type source details. + # + # Note: The following fields are mutually exclusive: `aws`, `vmware`, `azure`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] azure + # @return [::Google::Cloud::VMMigration::V1::AzureSourceDetails] + # Azure type source details. + # + # Note: The following fields are mutually exclusive: `azure`, `vmware`, `aws`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [r] name + # @return [::String] + # Output only. The Source name. + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The create time timestamp. + # @!attribute [r] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The update time timestamp. + # @!attribute [rw] labels + # @return [::Google::Protobuf::Map{::String => ::String}] + # The labels of the source. + # @!attribute [rw] description + # @return [::String] + # User-provided description of the source. + # @!attribute [rw] encryption + # @return [::Google::Cloud::VMMigration::V1::Encryption] + # Optional. Immutable. The encryption details of the source data stored by + # the service. + class Source + 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 + end + + # Encryption message describes the details of the applied encryption. + # @!attribute [rw] kms_key + # @return [::String] + # Required. The name of the encryption key that is stored in Google Cloud + # KMS. + class Encryption + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # VmwareSourceDetails message describes a specific source details for the + # vmware source type. + # @!attribute [rw] username + # @return [::String] + # The credentials username. + # @!attribute [rw] password + # @return [::String] + # Input only. The credentials password. This is write only and can not be + # read in a GET operation. + # @!attribute [rw] vcenter_ip + # @return [::String] + # The ip address of the vcenter this Source represents. + # @!attribute [rw] thumbprint + # @return [::String] + # The thumbprint representing the certificate for the vcenter. + # @!attribute [rw] resolved_vcenter_host + # @return [::String] + # The hostname of the vcenter. + class VmwareSourceDetails + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # AwsSourceDetails message describes a specific source details for the + # AWS source type. + # @!attribute [rw] access_key_creds + # @return [::Google::Cloud::VMMigration::V1::AwsSourceDetails::AccessKeyCredentials] + # AWS Credentials using access key id and secret. + # @!attribute [rw] aws_region + # @return [::String] + # Immutable. The AWS region that the source VMs will be migrated from. + # @!attribute [r] state + # @return [::Google::Cloud::VMMigration::V1::AwsSourceDetails::State] + # Output only. State of the source as determined by the health check. + # @!attribute [r] error + # @return [::Google::Rpc::Status] + # Output only. Provides details on the state of the Source in case of an + # error. + # @!attribute [rw] inventory_tag_list + # @return [::Array<::Google::Cloud::VMMigration::V1::AwsSourceDetails::Tag>] + # AWS resource tags to limit the scope of the source inventory. + # @!attribute [rw] inventory_security_group_names + # @return [::Array<::String>] + # AWS security group names to limit the scope of the source + # inventory. + # @!attribute [rw] migration_resources_user_tags + # @return [::Google::Protobuf::Map{::String => ::String}] + # User specified tags to add to every M2VM generated resource in AWS. + # These tags will be set in addition to the default tags that are set as part + # of the migration process. The tags must not begin with the reserved prefix + # `m2vm`. + # @!attribute [r] public_ip + # @return [::String] + # Output only. The source's public IP. All communication initiated by this + # source will originate from this IP. + class AwsSourceDetails + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Message describing AWS Credentials using access key id and secret. + # @!attribute [rw] access_key_id + # @return [::String] + # AWS access key ID. + # @!attribute [rw] secret_access_key + # @return [::String] + # Input only. AWS secret access key. + # @!attribute [rw] session_token + # @return [::String] + # Input only. AWS session token. + # Used only when AWS security token service (STS) is responsible for + # creating the temporary credentials. + class AccessKeyCredentials + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Tag is an AWS tag representation. + # @!attribute [rw] key + # @return [::String] + # Required. Key of tag. + # @!attribute [rw] value + # @return [::String] + # Required. Value of tag. + class Tag + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class MigrationResourcesUserTagsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The possible values of the state. + module State + # The state is unknown. This is used for API compatibility only and is not + # used by the system. + STATE_UNSPECIFIED = 0 + + # The state was not sampled by the health checks yet. + PENDING = 1 + + # The source is available but might not be usable yet due to invalid + # credentials or another reason. + # The error message will contain further details. + FAILED = 2 + + # The source exists and its credentials were verified. + ACTIVE = 3 + end + end + + # AzureSourceDetails message describes a specific source details for the + # Azure source type. + # @!attribute [rw] client_secret_creds + # @return [::Google::Cloud::VMMigration::V1::AzureSourceDetails::ClientSecretCredentials] + # Azure Credentials using tenant ID, client ID and secret. + # @!attribute [rw] subscription_id + # @return [::String] + # Immutable. Azure subscription ID. + # @!attribute [rw] azure_location + # @return [::String] + # Immutable. The Azure location (region) that the source VMs will be migrated + # from. + # @!attribute [r] state + # @return [::Google::Cloud::VMMigration::V1::AzureSourceDetails::State] + # Output only. State of the source as determined by the health check. + # @!attribute [r] error + # @return [::Google::Rpc::Status] + # Output only. Provides details on the state of the Source in case of an + # error. + # @!attribute [rw] migration_resources_user_tags + # @return [::Google::Protobuf::Map{::String => ::String}] + # User specified tags to add to every M2VM generated resource in Azure. + # These tags will be set in addition to the default tags that are set as part + # of the migration process. The tags must not begin with the reserved prefix + # `m4ce` or `m2vm`. + # @!attribute [r] resource_group_id + # @return [::String] + # Output only. The ID of the Azure resource group that contains all resources + # related to the migration process of this source. + class AzureSourceDetails + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Message describing Azure Credentials using tenant ID, client ID and secret. + # @!attribute [rw] tenant_id + # @return [::String] + # Azure tenant ID. + # @!attribute [rw] client_id + # @return [::String] + # Azure client ID. + # @!attribute [rw] client_secret + # @return [::String] + # Input only. Azure client secret. + class ClientSecretCredentials + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class MigrationResourcesUserTagsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The possible values of the state. + module State + # The state is unknown. This is used for API compatibility only and is not + # used by the system. + STATE_UNSPECIFIED = 0 + + # The state was not sampled by the health checks yet. + PENDING = 1 + + # The source is available but might not be usable yet due to invalid + # credentials or another reason. + # The error message will contain further details. + FAILED = 2 + + # The source exists and its credentials were verified. + ACTIVE = 3 + end + end + + # DatacenterConnector message describes a connector between the Source and + # Google Cloud, which is installed on a vmware datacenter (an OVA vm installed + # by the user) to connect the Datacenter to Google Cloud and support vm + # migration data transfer. + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time the connector was created (as an API call, not when + # it was actually installed). + # @!attribute [r] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The last time the connector was updated with an API call. + # @!attribute [r] name + # @return [::String] + # Output only. The connector's name. + # @!attribute [rw] registration_id + # @return [::String] + # Immutable. A unique key for this connector. This key is internal to the OVA + # connector and is supplied with its creation during the registration process + # and can not be modified. + # @!attribute [rw] service_account + # @return [::String] + # The service account to use in the connector when communicating with the + # cloud. + # @!attribute [rw] version + # @return [::String] + # The version running in the DatacenterConnector. This is supplied by the OVA + # connector during the registration process and can not be modified. + # @!attribute [r] bucket + # @return [::String] + # Output only. The communication channel between the datacenter connector and + # Google Cloud. + # @!attribute [r] state + # @return [::Google::Cloud::VMMigration::V1::DatacenterConnector::State] + # Output only. State of the DatacenterConnector, as determined by the health + # checks. + # @!attribute [r] state_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time the state was last set. + # @!attribute [r] error + # @return [::Google::Rpc::Status] + # Output only. Provides details on the state of the Datacenter Connector in + # case of an error. + # @!attribute [r] appliance_infrastructure_version + # @return [::String] + # Output only. Appliance OVA version. + # This is the OVA which is manually installed by the user and contains the + # infrastructure for the automatically updatable components on the appliance. + # @!attribute [r] appliance_software_version + # @return [::String] + # Output only. Appliance last installed update bundle version. + # This is the version of the automatically updatable components on the + # appliance. + # @!attribute [r] available_versions + # @return [::Google::Cloud::VMMigration::V1::AvailableUpdates] + # Output only. The available versions for updating this appliance. + # @!attribute [r] upgrade_status + # @return [::Google::Cloud::VMMigration::V1::UpgradeStatus] + # Output only. The status of the current / last upgradeAppliance operation. + class DatacenterConnector + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The possible values of the state. + module State + # The state is unknown. This is used for API compatibility only and is not + # used by the system. + STATE_UNSPECIFIED = 0 + + # The state was not sampled by the health checks yet. + PENDING = 1 + + # The source was sampled by health checks and is not available. + OFFLINE = 2 + + # The source is available but might not be usable yet due to unvalidated + # credentials or another reason. The credentials referred to are the ones + # to the Source. The error message will contain further details. + FAILED = 3 + + # The source exists and its credentials were verified. + ACTIVE = 4 + end + end + + # UpgradeStatus contains information about upgradeAppliance operation. + # @!attribute [rw] version + # @return [::String] + # The version to upgrade to. + # @!attribute [rw] state + # @return [::Google::Cloud::VMMigration::V1::UpgradeStatus::State] + # The state of the upgradeAppliance operation. + # @!attribute [r] error + # @return [::Google::Rpc::Status] + # Output only. Provides details on the state of the upgrade operation in case + # of an error. + # @!attribute [rw] start_time + # @return [::Google::Protobuf::Timestamp] + # The time the operation was started. + # @!attribute [rw] previous_version + # @return [::String] + # The version from which we upgraded. + class UpgradeStatus + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The possible values of the state. + module State + # The state was not sampled by the health checks yet. + STATE_UNSPECIFIED = 0 + + # The upgrade has started. + RUNNING = 1 + + # The upgrade failed. + FAILED = 2 + + # The upgrade finished successfully. + SUCCEEDED = 3 + end + end + + # Holds information about the available versions for upgrade. + # @!attribute [rw] new_deployable_appliance + # @return [::Google::Cloud::VMMigration::V1::ApplianceVersion] + # The newest deployable version of the appliance. + # The current appliance can't be updated into this version, and the owner + # must manually deploy this OVA to a new appliance. + # @!attribute [rw] in_place_update + # @return [::Google::Cloud::VMMigration::V1::ApplianceVersion] + # The latest version for in place update. + # The current appliance can be updated to this version using the API or m4c + # CLI. + class AvailableUpdates + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes an appliance version. + # @!attribute [rw] version + # @return [::String] + # The appliance version. + # @!attribute [rw] uri + # @return [::String] + # A link for downloading the version. + # @!attribute [rw] critical + # @return [::Boolean] + # Determine whether it's critical to upgrade the appliance to this version. + # @!attribute [rw] release_notes_uri + # @return [::String] + # Link to a page that contains the version release notes. + class ApplianceVersion + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for 'ListSources' request. + # @!attribute [rw] parent + # @return [::String] + # Required. The parent, which owns this collection of sources. + # @!attribute [rw] page_size + # @return [::Integer] + # Optional. The maximum number of sources to return. The service may return + # fewer than this value. If unspecified, at most 500 sources will be + # returned. The maximum value is 1000; values above 1000 will be coerced to + # 1000. + # @!attribute [rw] page_token + # @return [::String] + # Required. A page token, received from a previous `ListSources` call. + # Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to `ListSources` must + # match the call that provided the page token. + # @!attribute [rw] filter + # @return [::String] + # Optional. The filter request. + # @!attribute [rw] order_by + # @return [::String] + # Optional. the order by fields for the result. + class ListSourcesRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for 'ListSources' request. + # @!attribute [r] sources + # @return [::Array<::Google::Cloud::VMMigration::V1::Source>] + # Output only. The list of sources response. + # @!attribute [r] next_page_token + # @return [::String] + # Output only. A token, which can be sent as `page_token` to retrieve the + # next page. If this field is omitted, there are no subsequent pages. + # @!attribute [r] unreachable + # @return [::Array<::String>] + # Output only. Locations that could not be reached. + class ListSourcesResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for 'GetSource' request. + # @!attribute [rw] name + # @return [::String] + # Required. The Source name. + class GetSourceRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for 'CreateSource' request. + # @!attribute [rw] parent + # @return [::String] + # Required. The Source's parent. + # @!attribute [rw] source_id + # @return [::String] + # Required. The source identifier. + # @!attribute [rw] source + # @return [::Google::Cloud::VMMigration::V1::Source] + # Required. The create request body. + # @!attribute [rw] request_id + # @return [::String] + # A request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server will guarantee + # that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + class CreateSourceRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Update message for 'UpdateSources' request. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # Field mask is used to specify the fields to be overwritten in the + # Source resource by the update. + # The fields specified in the update_mask are relative to the resource, not + # the full request. A field will be overwritten if it is in the mask. If the + # user does not provide a mask then all fields will be overwritten. + # @!attribute [rw] source + # @return [::Google::Cloud::VMMigration::V1::Source] + # Required. The update request body. + # @!attribute [rw] request_id + # @return [::String] + # A request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server will guarantee + # that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + class UpdateSourceRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for 'DeleteSource' request. + # @!attribute [rw] name + # @return [::String] + # Required. The Source name. + # @!attribute [rw] request_id + # @return [::String] + # Optional. A request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server will guarantee + # that for at least 60 minutes after the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + class DeleteSourceRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::VMMigration::V1::VMMigration::Client#fetch_inventory fetchInventory}. + # @!attribute [rw] source + # @return [::String] + # Required. The name of the Source. + # @!attribute [rw] force_refresh + # @return [::Boolean] + # If this flag is set to true, the source will be queried instead of using + # cached results. Using this flag will make the call slower. + class FetchInventoryRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # VmwareVmDetails describes a VM in vCenter. + # @!attribute [rw] vm_id + # @return [::String] + # The VM's id in the source (note that this is not the MigratingVm's id). + # This is the moref id of the VM. + # @!attribute [rw] datacenter_id + # @return [::String] + # The id of the vCenter's datacenter this VM is contained in. + # @!attribute [rw] datacenter_description + # @return [::String] + # The descriptive name of the vCenter's datacenter this VM is contained in. + # @!attribute [rw] uuid + # @return [::String] + # The unique identifier of the VM in vCenter. + # @!attribute [rw] display_name + # @return [::String] + # The display name of the VM. Note that this is not necessarily unique. + # @!attribute [rw] power_state + # @return [::Google::Cloud::VMMigration::V1::VmwareVmDetails::PowerState] + # The power state of the VM at the moment list was taken. + # @!attribute [rw] cpu_count + # @return [::Integer] + # The number of cpus in the VM. + # @!attribute [rw] memory_mb + # @return [::Integer] + # The size of the memory of the VM in MB. + # @!attribute [rw] disk_count + # @return [::Integer] + # The number of disks the VM has. + # @!attribute [rw] committed_storage_mb + # @return [::Integer] + # The total size of the storage allocated to the VM in MB. + # @!attribute [rw] guest_description + # @return [::String] + # The VM's OS. See for example + # https://vdc-repo.vmware.com/vmwb-repository/dcr-public/da47f910-60ac-438b-8b9b-6122f4d14524/16b7274a-bf8b-4b4c-a05e-746f2aa93c8c/doc/vim.vm.GuestOsDescriptor.GuestOsIdentifier.html + # for types of strings this might hold. + # @!attribute [r] boot_option + # @return [::Google::Cloud::VMMigration::V1::VmwareVmDetails::BootOption] + # Output only. The VM Boot Option. + # @!attribute [r] architecture + # @return [::Google::Cloud::VMMigration::V1::VmwareVmDetails::VmArchitecture] + # Output only. The CPU architecture. + class VmwareVmDetails + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Possible values for the power state of the VM. + module PowerState + # Power state is not specified. + POWER_STATE_UNSPECIFIED = 0 + + # The VM is turned ON. + ON = 1 + + # The VM is turned OFF. + OFF = 2 + + # The VM is suspended. This is similar to hibernation or sleep mode. + SUSPENDED = 3 + end + + # Possible values for vm boot option. + module BootOption + # The boot option is unknown. + BOOT_OPTION_UNSPECIFIED = 0 + + # The boot option is EFI. + EFI = 1 + + # The boot option is BIOS. + BIOS = 2 + end + + # Possible values for the VM architecture. + module VmArchitecture + # The architecture is unknown. + VM_ARCHITECTURE_UNSPECIFIED = 0 + + # The architecture is one of the x86 architectures. + VM_ARCHITECTURE_X86_FAMILY = 1 + + # The architecture is ARM64. + VM_ARCHITECTURE_ARM64 = 2 + end + end + + # AwsVmDetails describes a VM in AWS. + # @!attribute [rw] vm_id + # @return [::String] + # The VM ID in AWS. + # @!attribute [rw] display_name + # @return [::String] + # The display name of the VM. Note that this value is not necessarily unique. + # @!attribute [rw] source_id + # @return [::String] + # The id of the AWS's source this VM is connected to. + # @!attribute [rw] source_description + # @return [::String] + # The descriptive name of the AWS's source this VM is connected to. + # @!attribute [r] power_state + # @return [::Google::Cloud::VMMigration::V1::AwsVmDetails::PowerState] + # Output only. The power state of the VM at the moment list was taken. + # @!attribute [rw] cpu_count + # @return [::Integer] + # The number of CPU cores the VM has. + # @!attribute [rw] memory_mb + # @return [::Integer] + # The memory size of the VM in MB. + # @!attribute [rw] disk_count + # @return [::Integer] + # The number of disks the VM has. + # @!attribute [rw] committed_storage_mb + # @return [::Integer] + # The total size of the storage allocated to the VM in MB. + # @!attribute [rw] os_description + # @return [::String] + # The VM's OS. + # @!attribute [rw] boot_option + # @return [::Google::Cloud::VMMigration::V1::AwsVmDetails::BootOption] + # The VM Boot Option. + # @!attribute [rw] instance_type + # @return [::String] + # The instance type of the VM. + # @!attribute [rw] vpc_id + # @return [::String] + # The VPC ID the VM belongs to. + # @!attribute [rw] security_groups + # @return [::Array<::Google::Cloud::VMMigration::V1::AwsSecurityGroup>] + # The security groups the VM belongs to. + # @!attribute [rw] tags + # @return [::Google::Protobuf::Map{::String => ::String}] + # The tags of the VM. + # @!attribute [rw] zone + # @return [::String] + # The AWS zone of the VM. + # @!attribute [rw] virtualization_type + # @return [::Google::Cloud::VMMigration::V1::AwsVmDetails::VmVirtualizationType] + # The virtualization type. + # @!attribute [rw] architecture + # @return [::Google::Cloud::VMMigration::V1::AwsVmDetails::VmArchitecture] + # The CPU architecture. + # @!attribute [rw] vcpu_count + # @return [::Integer] + # The number of vCPUs the VM has. It is calculated as the + # number of CPU cores * threads per CPU the VM has. + class AwsVmDetails + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class TagsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Possible values for the power state of the VM. + module PowerState + # Power state is not specified. + POWER_STATE_UNSPECIFIED = 0 + + # The VM is turned on. + ON = 1 + + # The VM is turned off. + OFF = 2 + + # The VM is suspended. This is similar to hibernation or sleep + # mode. + SUSPENDED = 3 + + # The VM is starting. + PENDING = 4 + end + + # The possible values for the vm boot option. + module BootOption + # The boot option is unknown. + BOOT_OPTION_UNSPECIFIED = 0 + + # The boot option is UEFI. + EFI = 1 + + # The boot option is LEGACY-BIOS. + BIOS = 2 + end + + # Possible values for the virtualization types of the VM. + module VmVirtualizationType + # The virtualization type is unknown. + VM_VIRTUALIZATION_TYPE_UNSPECIFIED = 0 + + # The virtualziation type is HVM. + HVM = 1 + + # The virtualziation type is PARAVIRTUAL. + PARAVIRTUAL = 2 + end + + # Possible values for the architectures of the VM. + module VmArchitecture + # The architecture is unknown. + VM_ARCHITECTURE_UNSPECIFIED = 0 + + # The architecture is I386. + I386 = 1 + + # The architecture is X86_64. + X86_64 = 2 + + # The architecture is ARM64. + ARM64 = 3 + + # The architecture is X86_64_MAC. + X86_64_MAC = 4 + end + end + + # AwsSecurityGroup describes a security group of an AWS VM. + # @!attribute [rw] id + # @return [::String] + # The AWS security group id. + # @!attribute [rw] name + # @return [::String] + # The AWS security group name. + class AwsSecurityGroup + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # AzureVmDetails describes a VM in Azure. + # @!attribute [rw] vm_id + # @return [::String] + # The VM full path in Azure. + # @!attribute [rw] power_state + # @return [::Google::Cloud::VMMigration::V1::AzureVmDetails::PowerState] + # The power state of the VM at the moment list was taken. + # @!attribute [rw] vm_size + # @return [::String] + # VM size as configured in Azure. Determines the VM's hardware spec. + # @!attribute [rw] cpu_count + # @return [::Integer] + # The number of cpus the VM has. + # @!attribute [rw] memory_mb + # @return [::Integer] + # The memory size of the VM in MB. + # @!attribute [rw] disk_count + # @return [::Integer] + # The number of disks the VM has, including OS disk. + # @!attribute [rw] committed_storage_mb + # @return [::Integer] + # The total size of the storage allocated to the VM in MB. + # @!attribute [rw] os_disk + # @return [::Google::Cloud::VMMigration::V1::AzureVmDetails::OSDisk] + # Description of the OS disk. + # @!attribute [rw] disks + # @return [::Array<::Google::Cloud::VMMigration::V1::AzureVmDetails::Disk>] + # Description of the data disks. + # @!attribute [rw] os_description + # @return [::Google::Cloud::VMMigration::V1::AzureVmDetails::OSDescription] + # Description of the OS. + # @!attribute [rw] boot_option + # @return [::Google::Cloud::VMMigration::V1::AzureVmDetails::BootOption] + # The VM Boot Option. + # @!attribute [rw] tags + # @return [::Google::Protobuf::Map{::String => ::String}] + # The tags of the VM. + # @!attribute [rw] computer_name + # @return [::String] + # The VM's ComputerName. + # @!attribute [rw] architecture + # @return [::Google::Cloud::VMMigration::V1::AzureVmDetails::VmArchitecture] + # The CPU architecture. + class AzureVmDetails + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # A message describing the OS disk. + # @!attribute [rw] type + # @return [::String] + # The disk's type. + # @!attribute [rw] name + # @return [::String] + # The disk's full name. + # @!attribute [rw] size_gb + # @return [::Integer] + # The disk's size in GB. + class OSDisk + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A message describing a data disk. + # @!attribute [rw] name + # @return [::String] + # The disk name. + # @!attribute [rw] size_gb + # @return [::Integer] + # The disk size in GB. + # @!attribute [rw] lun + # @return [::Integer] + # The disk's Logical Unit Number (LUN). + class Disk + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A message describing the VM's OS. Including OS, Publisher, Offer and Plan + # if applicable. + # @!attribute [rw] type + # @return [::String] + # OS type. + # @!attribute [rw] publisher + # @return [::String] + # OS publisher. + # @!attribute [rw] offer + # @return [::String] + # OS offer. + # @!attribute [rw] plan + # @return [::String] + # OS plan. + class OSDescription + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class TagsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Possible values for the power state of the VM. + module PowerState + # Power state is not specified. + POWER_STATE_UNSPECIFIED = 0 + + # The VM is starting. + STARTING = 1 + + # The VM is running. + RUNNING = 2 + + # The VM is stopping. + STOPPING = 3 + + # The VM is stopped. + STOPPED = 4 + + # The VM is deallocating. + DEALLOCATING = 5 + + # The VM is deallocated. + DEALLOCATED = 6 + + # The VM's power state is unknown. + UNKNOWN = 7 + end + + # The possible values for the vm boot option. + module BootOption + # The boot option is unknown. + BOOT_OPTION_UNSPECIFIED = 0 + + # The boot option is UEFI. + EFI = 1 + + # The boot option is BIOS. + BIOS = 2 + end + + # Possible values for the VM architecture. + module VmArchitecture + # The architecture is unknown. + VM_ARCHITECTURE_UNSPECIFIED = 0 + + # The architecture is one of the x86 architectures. + VM_ARCHITECTURE_X86_FAMILY = 1 + + # The architecture is ARM64. + VM_ARCHITECTURE_ARM64 = 2 + end + end + + # VmwareVmsDetails describes VMs in vCenter. + # @!attribute [rw] details + # @return [::Array<::Google::Cloud::VMMigration::V1::VmwareVmDetails>] + # The details of the vmware VMs. + class VmwareVmsDetails + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # AWSVmsDetails describes VMs in AWS. + # @!attribute [rw] details + # @return [::Array<::Google::Cloud::VMMigration::V1::AwsVmDetails>] + # The details of the AWS VMs. + class AwsVmsDetails + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # AzureVmsDetails describes VMs in Azure. + # @!attribute [rw] details + # @return [::Array<::Google::Cloud::VMMigration::V1::AzureVmDetails>] + # The details of the Azure VMs. + class AzureVmsDetails + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for + # {::Google::Cloud::VMMigration::V1::VMMigration::Client#fetch_inventory fetchInventory}. + # @!attribute [rw] vmware_vms + # @return [::Google::Cloud::VMMigration::V1::VmwareVmsDetails] + # The description of the VMs in a Source of type Vmware. + # + # Note: The following fields are mutually exclusive: `vmware_vms`, `aws_vms`, `azure_vms`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] aws_vms + # @return [::Google::Cloud::VMMigration::V1::AwsVmsDetails] + # The description of the VMs in a Source of type AWS. + # + # Note: The following fields are mutually exclusive: `aws_vms`, `vmware_vms`, `azure_vms`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] azure_vms + # @return [::Google::Cloud::VMMigration::V1::AzureVmsDetails] + # The description of the VMs in a Source of type Azure. + # + # Note: The following fields are mutually exclusive: `azure_vms`, `vmware_vms`, `aws_vms`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [r] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The timestamp when the source was last queried (if the result + # is from the cache). + class FetchInventoryResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::VMMigration::V1::VMMigration::Client#fetch_storage_inventory fetchStorageInventory}. + # @!attribute [rw] source + # @return [::String] + # Required. The name of the Source. + # @!attribute [rw] type + # @return [::Google::Cloud::VMMigration::V1::FetchStorageInventoryRequest::StorageType] + # Required. The type of the storage inventory to fetch. + # @!attribute [rw] force_refresh + # @return [::Boolean] + # Optional. If this flag is set to true, the source will be queried instead + # of using cached results. Using this flag will make the call slower. + # @!attribute [rw] page_size + # @return [::Integer] + # Optional. The maximum number of VMs to return. The service may return + # fewer than this value. + # @!attribute [rw] page_token + # @return [::String] + # Optional. A page token, received from a previous `FetchStorageInventory` + # call. Provide this to retrieve the subsequent page. When paginating, all + # other parameters provided to `FetchStorageInventory` must match the call + # that provided the page token. + class FetchStorageInventoryRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The type of the storage inventory to fetch. + module StorageType + # The type is unspecified. + STORAGE_TYPE_UNSPECIFIED = 0 + + # The type is disks. + DISKS = 1 + + # The type is snapshots. + SNAPSHOTS = 2 + end + end + + # Response message for + # {::Google::Cloud::VMMigration::V1::VMMigration::Client#fetch_storage_inventory fetchStorageInventory}. + # @!attribute [rw] resources + # @return [::Array<::Google::Cloud::VMMigration::V1::SourceStorageResource>] + # The list of storage resources in the source. + # @!attribute [r] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The timestamp when the source was last queried (if the result + # is from the cache). + # @!attribute [r] next_page_token + # @return [::String] + # Output only. A token, which can be sent as `page_token` to retrieve the + # next page. If this field is omitted, there are no subsequent pages. + class FetchStorageInventoryResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # SourceStorageResource describes a storage resource in the source. + # @!attribute [rw] aws_disk_details + # @return [::Google::Cloud::VMMigration::V1::AwsSourceDiskDetails] + # Source AWS volume details. + class SourceStorageResource + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Utilization report details the utilization (CPU, memory, etc.) of selected + # source VMs. + # @!attribute [r] name + # @return [::String] + # Output only. The report unique name. + # @!attribute [rw] display_name + # @return [::String] + # The report display name, as assigned by the user. + # @!attribute [r] state + # @return [::Google::Cloud::VMMigration::V1::UtilizationReport::State] + # Output only. Current state of the report. + # @!attribute [r] state_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time the state was last set. + # @!attribute [r] error + # @return [::Google::Rpc::Status] + # Output only. Provides details on the state of the report in case of an + # error. + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time the report was created (this refers to the time of + # the request, not the time the report creation completed). + # @!attribute [rw] time_frame + # @return [::Google::Cloud::VMMigration::V1::UtilizationReport::TimeFrame] + # Time frame of the report. + # @!attribute [r] frame_end_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The point in time when the time frame ends. Notice that the + # time frame is counted backwards. For instance if the "frame_end_time" value + # is 2021/01/20 and the time frame is WEEK then the report covers the week + # between 2021/01/20 and 2021/01/14. + # @!attribute [r] vm_count + # @return [::Integer] + # Output only. Total number of VMs included in the report. + # @!attribute [rw] vms + # @return [::Array<::Google::Cloud::VMMigration::V1::VmUtilizationInfo>] + # List of utilization information per VM. + # When sent as part of the request, the "vm_id" field is used in order to + # specify which VMs to include in the report. In that case all other fields + # are ignored. + class UtilizationReport + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Utilization report state. + module State + # The state is unknown. This value is not in use. + STATE_UNSPECIFIED = 0 + + # The report is in the making. + CREATING = 1 + + # Report creation completed successfully. + SUCCEEDED = 2 + + # Report creation failed. + FAILED = 3 + end + + # Report time frame options. + module TimeFrame + # The time frame was not specified and will default to WEEK. + TIME_FRAME_UNSPECIFIED = 0 + + # One week. + WEEK = 1 + + # One month. + MONTH = 2 + + # One year. + YEAR = 3 + end + end + + # Utilization information of a single VM. + # @!attribute [rw] vmware_vm_details + # @return [::Google::Cloud::VMMigration::V1::VmwareVmDetails] + # The description of the VM in a Source of type Vmware. + # @!attribute [rw] vm_id + # @return [::String] + # The VM's ID in the source. + # @!attribute [rw] utilization + # @return [::Google::Cloud::VMMigration::V1::VmUtilizationMetrics] + # Utilization metrics for this VM. + class VmUtilizationInfo + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Utilization metrics values for a single VM. + # @!attribute [rw] cpu_max_percent + # @return [::Integer] + # Max CPU usage, percent. + # @!attribute [rw] cpu_average_percent + # @return [::Integer] + # Average CPU usage, percent. + # @!attribute [rw] memory_max_percent + # @return [::Integer] + # Max memory usage, percent. + # @!attribute [rw] memory_average_percent + # @return [::Integer] + # Average memory usage, percent. + # @!attribute [rw] disk_io_rate_max_kbps + # @return [::Integer] + # Max disk IO rate, in kilobytes per second. + # @!attribute [rw] disk_io_rate_average_kbps + # @return [::Integer] + # Average disk IO rate, in kilobytes per second. + # @!attribute [rw] network_throughput_max_kbps + # @return [::Integer] + # Max network throughput (combined transmit-rates and receive-rates), in + # kilobytes per second. + # @!attribute [rw] network_throughput_average_kbps + # @return [::Integer] + # Average network throughput (combined transmit-rates and receive-rates), in + # kilobytes per second. + class VmUtilizationMetrics + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for 'ListUtilizationReports' request. + # @!attribute [rw] parent + # @return [::String] + # Required. The Utilization Reports parent. + # @!attribute [rw] view + # @return [::Google::Cloud::VMMigration::V1::UtilizationReportView] + # Optional. The level of details of each report. + # Defaults to BASIC. + # @!attribute [rw] page_size + # @return [::Integer] + # Optional. The maximum number of reports to return. The service may return + # fewer than this value. If unspecified, at most 500 reports will be + # returned. The maximum value is 1000; values above 1000 will be coerced to + # 1000. + # @!attribute [rw] page_token + # @return [::String] + # Required. A page token, received from a previous `ListUtilizationReports` + # call. Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to `ListUtilizationReports` + # must match the call that provided the page token. + # @!attribute [rw] filter + # @return [::String] + # Optional. The filter request. + # @!attribute [rw] order_by + # @return [::String] + # Optional. the order by fields for the result. + class ListUtilizationReportsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for 'ListUtilizationReports' request. + # @!attribute [r] utilization_reports + # @return [::Array<::Google::Cloud::VMMigration::V1::UtilizationReport>] + # Output only. The list of reports. + # @!attribute [r] next_page_token + # @return [::String] + # Output only. A token, which can be sent as `page_token` to retrieve the + # next page. If this field is omitted, there are no subsequent pages. + # @!attribute [r] unreachable + # @return [::Array<::String>] + # Output only. Locations that could not be reached. + class ListUtilizationReportsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for 'GetUtilizationReport' request. + # @!attribute [rw] name + # @return [::String] + # Required. The Utilization Report name. + # @!attribute [rw] view + # @return [::Google::Cloud::VMMigration::V1::UtilizationReportView] + # Optional. The level of details of the report. + # Defaults to FULL + class GetUtilizationReportRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for 'CreateUtilizationReport' request. + # @!attribute [rw] parent + # @return [::String] + # Required. The Utilization Report's parent. + # @!attribute [rw] utilization_report + # @return [::Google::Cloud::VMMigration::V1::UtilizationReport] + # Required. The report to create. + # @!attribute [rw] utilization_report_id + # @return [::String] + # Required. The ID to use for the report, which will become the final + # component of the reports's resource name. + # + # This value maximum length is 63 characters, and valid characters + # are /[a-z][0-9]-/. It must start with an english letter and must not + # end with a hyphen. + # @!attribute [rw] request_id + # @return [::String] + # A request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server will guarantee + # that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + class CreateUtilizationReportRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for 'DeleteUtilizationReport' request. + # @!attribute [rw] name + # @return [::String] + # Required. The Utilization Report name. + # @!attribute [rw] request_id + # @return [::String] + # Optional. A request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server will guarantee + # that for at least 60 minutes after the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + class DeleteUtilizationReportRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for 'ListDatacenterConnectors' request. + # @!attribute [r] datacenter_connectors + # @return [::Array<::Google::Cloud::VMMigration::V1::DatacenterConnector>] + # Output only. The list of sources response. + # @!attribute [r] next_page_token + # @return [::String] + # Output only. A token, which can be sent as `page_token` to retrieve the + # next page. If this field is omitted, there are no subsequent pages. + # @!attribute [r] unreachable + # @return [::Array<::String>] + # Output only. Locations that could not be reached. + class ListDatacenterConnectorsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for 'GetDatacenterConnector' request. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the DatacenterConnector. + class GetDatacenterConnectorRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for 'CreateDatacenterConnector' request. + # @!attribute [rw] parent + # @return [::String] + # Required. The DatacenterConnector's parent. + # Required. The Source in where the new DatacenterConnector will be created. + # For example: + # `projects/my-project/locations/us-central1/sources/my-source` + # @!attribute [rw] datacenter_connector_id + # @return [::String] + # Required. The datacenterConnector identifier. + # @!attribute [rw] datacenter_connector + # @return [::Google::Cloud::VMMigration::V1::DatacenterConnector] + # Required. The create request body. + # @!attribute [rw] request_id + # @return [::String] + # A request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server will guarantee + # that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + class CreateDatacenterConnectorRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for 'DeleteDatacenterConnector' request. + # @!attribute [rw] name + # @return [::String] + # Required. The DatacenterConnector name. + # @!attribute [rw] request_id + # @return [::String] + # A request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server will guarantee + # that for at least 60 minutes after the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + class DeleteDatacenterConnectorRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for 'UpgradeAppliance' request. + # @!attribute [rw] datacenter_connector + # @return [::String] + # Required. The DatacenterConnector name. + # @!attribute [rw] request_id + # @return [::String] + # A request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server will guarantee + # that for at least 60 minutes after the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + class UpgradeApplianceRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for 'UpgradeAppliance' request. + class UpgradeApplianceResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for 'ListDatacenterConnectors' request. + # @!attribute [rw] parent + # @return [::String] + # Required. The parent, which owns this collection of connectors. + # @!attribute [rw] page_size + # @return [::Integer] + # Optional. The maximum number of connectors to return. The service may + # return fewer than this value. If unspecified, at most 500 sources will be + # returned. The maximum value is 1000; values above 1000 will be coerced to + # 1000. + # @!attribute [rw] page_token + # @return [::String] + # Required. A page token, received from a previous `ListDatacenterConnectors` + # call. Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to + # `ListDatacenterConnectors` must match the call that provided the page + # token. + # @!attribute [rw] filter + # @return [::String] + # Optional. The filter request. + # @!attribute [rw] order_by + # @return [::String] + # Optional. the order by fields for the result. + class ListDatacenterConnectorsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # ComputeEngineTargetDefaults is a collection of details for creating a VM in a + # target Compute Engine project. + # @!attribute [rw] vm_name + # @return [::String] + # The name of the VM to create. + # @!attribute [rw] target_project + # @return [::String] + # The full path of the resource of type TargetProject which represents the + # Compute Engine project in which to create this VM. + # @!attribute [rw] zone + # @return [::String] + # The zone in which to create the VM. + # @!attribute [rw] machine_type_series + # @return [::String] + # The machine type series to create the VM with. + # @!attribute [rw] machine_type + # @return [::String] + # The machine type to create the VM with. + # @!attribute [rw] network_tags + # @return [::Array<::String>] + # A list of network tags to associate with the VM. + # @!attribute [rw] network_interfaces + # @return [::Array<::Google::Cloud::VMMigration::V1::NetworkInterface>] + # List of NICs connected to this VM. + # @!attribute [rw] service_account + # @return [::String] + # Optional. The service account to associate the VM with. + # @!attribute [rw] disk_type + # @return [::Google::Cloud::VMMigration::V1::ComputeEngineDiskType] + # The disk type to use in the VM. + # @!attribute [rw] labels + # @return [::Google::Protobuf::Map{::String => ::String}] + # A map of labels to associate with the VM. + # @!attribute [rw] license_type + # @return [::Google::Cloud::VMMigration::V1::ComputeEngineLicenseType] + # The license type to use in OS adaptation. + # @!attribute [r] applied_license + # @return [::Google::Cloud::VMMigration::V1::AppliedLicense] + # Output only. The OS license returned from the adaptation module report. + # @!attribute [rw] compute_scheduling + # @return [::Google::Cloud::VMMigration::V1::ComputeScheduling] + # Compute instance scheduling information (if empty default is used). + # @!attribute [rw] secure_boot + # @return [::Boolean] + # Defines whether the instance has Secure Boot enabled. + # This can be set to true only if the VM boot option is EFI. + # @!attribute [rw] enable_vtpm + # @return [::Boolean] + # Optional. Defines whether the instance has vTPM enabled. + # This can be set to true only if the VM boot option is EFI. + # @!attribute [rw] enable_integrity_monitoring + # @return [::Boolean] + # Optional. Defines whether the instance has integrity monitoring enabled. + # This can be set to true only if the VM boot option is EFI, and vTPM is + # enabled. + # @!attribute [r] boot_option + # @return [::Google::Cloud::VMMigration::V1::ComputeEngineBootOption] + # Output only. The VM Boot Option, as set in the source VM. + # @!attribute [rw] metadata + # @return [::Google::Protobuf::Map{::String => ::String}] + # The metadata key/value pairs to assign to the VM. + # @!attribute [rw] additional_licenses + # @return [::Array<::String>] + # Additional licenses to assign to the VM. + # @!attribute [rw] hostname + # @return [::String] + # The hostname to assign to the VM. + # @!attribute [rw] encryption + # @return [::Google::Cloud::VMMigration::V1::Encryption] + # Optional. Immutable. The encryption to apply to the VM disks. + # @!attribute [rw] boot_conversion + # @return [::Google::Cloud::VMMigration::V1::BootConversion] + # Optional. By default the virtual machine will keep its existing boot + # option. Setting this property will trigger an internal process which will + # convert the virtual machine from using the existing boot option to another. + # @!attribute [rw] adaptation_modifiers + # @return [::Array<::Google::Cloud::VMMigration::V1::AdaptationModifier>] + # Optional. AdaptationModifiers are the set of modifiers used during OS + # adaptation. + # @!attribute [rw] disk_replica_zones + # @return [::Array<::String>] + # Optional. Additional replica zones of the target regional disks. + # If this list is not empty a regional disk will be created. The first + # supported zone would be the one stated in the + # {::Google::Cloud::VMMigration::V1::ComputeEngineTargetDefaults#zone zone} field. + # The rest are taken from this list. Please refer to the [regional disk + # creation + # API](https://cloud.google.com/compute/docs/regions-zones/global-regional-zonal-resources) + # for further details about regional vs zonal disks. If not specified, a + # zonal disk will be created in the same zone the VM is created. + # @!attribute [rw] storage_pool + # @return [::String] + # Optional. If specified this will be the storage pool in which the disk is + # created. This is the full path of the storage pool resource, for example: + # "projects/my-project/zones/us-central1-a/storagePools/my-storage-pool". + # The storage pool must be in the same project and zone as the target disks. + # The storage pool's type must match the disk type. + class ComputeEngineTargetDefaults + 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 + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class MetadataEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # AdaptationModifier a modifier to be used for configuration of the OS + # adaptation process. + # @!attribute [rw] modifier + # @return [::String] + # Optional. The modifier name. + # @!attribute [rw] value + # @return [::String] + # Optional. The value of the modifier. + # The actual value depends on the modifier and can also be empty. + class AdaptationModifier + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # ComputeEngineTargetDetails is a collection of details for creating a VM in a + # target Compute Engine project. + # @!attribute [rw] vm_name + # @return [::String] + # The name of the VM to create. + # @!attribute [rw] project + # @return [::String] + # The Google Cloud target project ID or project name. + # @!attribute [rw] zone + # @return [::String] + # The zone in which to create the VM. + # @!attribute [rw] machine_type_series + # @return [::String] + # The machine type series to create the VM with. + # @!attribute [rw] machine_type + # @return [::String] + # The machine type to create the VM with. + # @!attribute [rw] network_tags + # @return [::Array<::String>] + # A list of network tags to associate with the VM. + # @!attribute [rw] network_interfaces + # @return [::Array<::Google::Cloud::VMMigration::V1::NetworkInterface>] + # List of NICs connected to this VM. + # @!attribute [rw] service_account + # @return [::String] + # The service account to associate the VM with. + # @!attribute [rw] disk_type + # @return [::Google::Cloud::VMMigration::V1::ComputeEngineDiskType] + # The disk type to use in the VM. + # @!attribute [rw] labels + # @return [::Google::Protobuf::Map{::String => ::String}] + # A map of labels to associate with the VM. + # @!attribute [rw] license_type + # @return [::Google::Cloud::VMMigration::V1::ComputeEngineLicenseType] + # The license type to use in OS adaptation. + # @!attribute [rw] applied_license + # @return [::Google::Cloud::VMMigration::V1::AppliedLicense] + # The OS license returned from the adaptation module report. + # @!attribute [rw] compute_scheduling + # @return [::Google::Cloud::VMMigration::V1::ComputeScheduling] + # Compute instance scheduling information (if empty default is used). + # @!attribute [rw] secure_boot + # @return [::Boolean] + # Defines whether the instance has Secure Boot enabled. + # This can be set to true only if the VM boot option is EFI. + # @!attribute [rw] enable_vtpm + # @return [::Boolean] + # Optional. Defines whether the instance has vTPM enabled. + # @!attribute [rw] enable_integrity_monitoring + # @return [::Boolean] + # Optional. Defines whether the instance has integrity monitoring enabled. + # @!attribute [rw] boot_option + # @return [::Google::Cloud::VMMigration::V1::ComputeEngineBootOption] + # The VM Boot Option, as set in the source VM. + # @!attribute [rw] metadata + # @return [::Google::Protobuf::Map{::String => ::String}] + # The metadata key/value pairs to assign to the VM. + # @!attribute [rw] additional_licenses + # @return [::Array<::String>] + # Additional licenses to assign to the VM. + # @!attribute [rw] hostname + # @return [::String] + # The hostname to assign to the VM. + # @!attribute [rw] encryption + # @return [::Google::Cloud::VMMigration::V1::Encryption] + # Optional. The encryption to apply to the VM disks. + # @!attribute [rw] boot_conversion + # @return [::Google::Cloud::VMMigration::V1::BootConversion] + # Optional. By default the virtual machine will keep its existing boot + # option. Setting this property will trigger an internal process which will + # convert the virtual machine from using the existing boot option to another. + # @!attribute [rw] adaptation_modifiers + # @return [::Array<::Google::Cloud::VMMigration::V1::AdaptationModifier>] + # Optional. Modifiers to be used as configuration of the OS adaptation + # process. + # @!attribute [rw] disk_replica_zones + # @return [::Array<::String>] + # Optional. Additional replica zones of the target regional disks. + # If this list is not empty a regional disk will be created. The first + # supported zone would be the one stated in the + # {::Google::Cloud::VMMigration::V1::ComputeEngineTargetDetails#zone zone} field. + # The rest are taken from this list. Please refer to the [regional disk + # creation + # API](https://cloud.google.com/compute/docs/regions-zones/global-regional-zonal-resources) + # for further details about regional vs zonal disks. If not specified, a + # zonal disk will be created in the same zone the VM is created. + # @!attribute [rw] storage_pool + # @return [::String] + # Optional. The storage pool used for the VM disks. + # If specified this will be the storage pool in which the disk is created. + # This is the full path of the storage pool resource, for example: + # "projects/my-project/zones/us-central1-a/storagePools/my-storage-pool". + # The storage pool must be in the same project and zone as the target disks. + # The storage pool's type must match the disk type. + class ComputeEngineTargetDetails + 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 + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class MetadataEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # NetworkInterface represents a NIC of a VM. + # @!attribute [rw] network + # @return [::String] + # Optional. The network to connect the NIC to. + # @!attribute [rw] subnetwork + # @return [::String] + # Optional. The subnetwork to connect the NIC to. + # @!attribute [rw] internal_ip + # @return [::String] + # Optional. The internal IP to define in the NIC. + # The formats accepted are: `ephemeral` \ ipv4 address \ a named address + # resource full path. + # @!attribute [rw] external_ip + # @return [::String] + # Optional. The external IP to define in the NIC. + # @!attribute [rw] network_tier + # @return [::Google::Cloud::VMMigration::V1::ComputeEngineNetworkTier] + # Optional. The networking tier used for optimizing connectivity between + # instances and systems on the internet. Applies only for external ephemeral + # IP addresses. If left empty, will default to PREMIUM. + class NetworkInterface + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # AppliedLicense holds the license data returned by adaptation module report. + # @!attribute [rw] type + # @return [::Google::Cloud::VMMigration::V1::AppliedLicense::Type] + # The license type that was used in OS adaptation. + # @!attribute [rw] os_license + # @return [::String] + # The OS license returned from the adaptation module's report. + class AppliedLicense + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # License types used in OS adaptation. + module Type + # Unspecified license for the OS. + TYPE_UNSPECIFIED = 0 + + # No license available for the OS. + NONE = 1 + + # The license type is Pay As You Go license type. + PAYG = 2 + + # The license type is Bring Your Own License type. + BYOL = 3 + end + end + + # Node Affinity: the configuration of desired nodes onto which this Instance + # could be scheduled. Based on + # https://cloud.google.com/compute/docs/reference/rest/v1/instances/setScheduling + # @!attribute [rw] key + # @return [::String] + # The label key of Node resource to reference. + # @!attribute [rw] operator + # @return [::Google::Cloud::VMMigration::V1::SchedulingNodeAffinity::Operator] + # The operator to use for the node resources specified in the `values` + # parameter. + # @!attribute [rw] values + # @return [::Array<::String>] + # Corresponds to the label values of Node resource. + class SchedulingNodeAffinity + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Possible types of node selection operators. Valid operators are IN for + # affinity and NOT_IN for anti-affinity. + module Operator + # An unknown, unexpected behavior. + OPERATOR_UNSPECIFIED = 0 + + # The node resource group should be in these resources affinity. + IN = 1 + + # The node resource group should not be in these resources affinity. + NOT_IN = 2 + end + end + + # Scheduling information for VM on maintenance/restart behaviour and + # node allocation in sole tenant nodes. + # Options for instance behavior when the host machine undergoes + # maintenance that may temporarily impact instance performance. + # @!attribute [rw] on_host_maintenance + # @return [::Google::Cloud::VMMigration::V1::ComputeScheduling::OnHostMaintenance] + # How the instance should behave when the host machine undergoes + # maintenance that may temporarily impact instance performance. + # @!attribute [rw] restart_type + # @return [::Google::Cloud::VMMigration::V1::ComputeScheduling::RestartType] + # Whether the Instance should be automatically restarted whenever it is + # terminated by Compute Engine (not terminated by user). + # This configuration is identical to `automaticRestart` field in Compute + # Engine create instance under scheduling. + # It was changed to an enum (instead of a boolean) to match the default + # value in Compute Engine which is automatic restart. + # @!attribute [rw] node_affinities + # @return [::Array<::Google::Cloud::VMMigration::V1::SchedulingNodeAffinity>] + # A set of node affinity and anti-affinity configurations for sole tenant + # nodes. + # @!attribute [rw] min_node_cpus + # @return [::Integer] + # The minimum number of virtual CPUs this instance will consume when + # running on a sole-tenant node. Ignored if no node_affinites are + # configured. + class ComputeScheduling + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + module OnHostMaintenance + # An unknown, unexpected behavior. + ON_HOST_MAINTENANCE_UNSPECIFIED = 0 + + # Terminate the instance when the host machine undergoes maintenance. + TERMINATE = 1 + + # Migrate the instance when the host machine undergoes maintenance. + MIGRATE = 2 + end + + # Defines whether the Instance should be automatically restarted whenever + # it is terminated by Compute Engine (not terminated by user). + module RestartType + # Unspecified behavior. This will use the default. + RESTART_TYPE_UNSPECIFIED = 0 + + # The Instance should be automatically restarted whenever it is + # terminated by Compute Engine. + AUTOMATIC_RESTART = 1 + + # The Instance isn't automatically restarted whenever it is + # terminated by Compute Engine. + NO_AUTOMATIC_RESTART = 2 + end + end + + # ComputeEngineDisksTargetDefaults is a collection of details for creating + # Persistent Disks in a target Compute Engine project. + # @!attribute [rw] zone + # @return [::String] + # The zone in which to create the Persistent Disks. + # @!attribute [rw] disks_target_defaults + # @return [::Google::Cloud::VMMigration::V1::DisksMigrationDisksTargetDefaults] + # Details of the disk only migration target. + # + # Note: The following fields are mutually exclusive: `disks_target_defaults`, `vm_target_defaults`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] vm_target_defaults + # @return [::Google::Cloud::VMMigration::V1::DisksMigrationVmTargetDefaults] + # Details of the VM migration target. + # + # Note: The following fields are mutually exclusive: `vm_target_defaults`, `disks_target_defaults`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] target_project + # @return [::String] + # The full path of the resource of type TargetProject which represents the + # Compute Engine project in which to create the Persistent Disks. + # @!attribute [rw] disks + # @return [::Array<::Google::Cloud::VMMigration::V1::PersistentDiskDefaults>] + # The details of each Persistent Disk to create. + class ComputeEngineDisksTargetDefaults + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details for creation of a Persistent Disk. + # @!attribute [rw] source_disk_number + # @return [::Integer] + # Required. The ordinal number of the source VM disk. + # @!attribute [rw] disk_name + # @return [::String] + # Optional. The name of the Persistent Disk to create. + # @!attribute [rw] disk_type + # @return [::Google::Cloud::VMMigration::V1::ComputeEngineDiskType] + # The disk type to use. + # @!attribute [rw] additional_labels + # @return [::Google::Protobuf::Map{::String => ::String}] + # A map of labels to associate with the Persistent Disk. + # @!attribute [rw] encryption + # @return [::Google::Cloud::VMMigration::V1::Encryption] + # Optional. The encryption to apply to the disk. + # @!attribute [rw] vm_attachment_details + # @return [::Google::Cloud::VMMigration::V1::VmAttachmentDetails] + # Optional. Details for attachment of the disk to a VM. + # Used when the disk is set to be attached to a target VM. + class PersistentDiskDefaults + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class AdditionalLabelsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Details for attachment of the disk to a VM. + # @!attribute [rw] device_name + # @return [::String] + # Optional. Specifies a unique device name of your choice that is reflected + # into the /dev/disk/by-id/google-* tree of a Linux operating system running + # within the instance. If not specified, the server chooses a default device + # name to apply to this disk, in the form persistent-disk-x, where x is a + # number assigned by Google Compute Engine. This field is only applicable for + # persistent disks. + class VmAttachmentDetails + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details for a disk only migration. + class DisksMigrationDisksTargetDefaults + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details for creation of a VM that migrated data disks will be attached to. + # @!attribute [rw] vm_name + # @return [::String] + # Required. The name of the VM to create. + # @!attribute [rw] machine_type_series + # @return [::String] + # Optional. The machine type series to create the VM with. + # For presentation only. + # @!attribute [rw] machine_type + # @return [::String] + # Required. The machine type to create the VM with. + # @!attribute [rw] network_tags + # @return [::Array<::String>] + # Optional. A list of network tags to associate with the VM. + # @!attribute [rw] network_interfaces + # @return [::Array<::Google::Cloud::VMMigration::V1::NetworkInterface>] + # Optional. NICs to attach to the VM. + # @!attribute [rw] service_account + # @return [::String] + # Optional. The service account to associate the VM with. + # @!attribute [rw] compute_scheduling + # @return [::Google::Cloud::VMMigration::V1::ComputeScheduling] + # Optional. Compute instance scheduling information (if empty default is + # used). + # @!attribute [rw] secure_boot + # @return [::Boolean] + # Optional. Defines whether the instance has Secure Boot enabled. + # This can be set to true only if the VM boot option is EFI. + # @!attribute [rw] enable_vtpm + # @return [::Boolean] + # Optional. Defines whether the instance has vTPM enabled. + # @!attribute [rw] enable_integrity_monitoring + # @return [::Boolean] + # Optional. Defines whether the instance has integrity monitoring enabled. + # @!attribute [rw] metadata + # @return [::Google::Protobuf::Map{::String => ::String}] + # Optional. The metadata key/value pairs to assign to the VM. + # @!attribute [rw] additional_licenses + # @return [::Array<::String>] + # Optional. Additional licenses to assign to the VM. + # @!attribute [rw] hostname + # @return [::String] + # Optional. The hostname to assign to the VM. + # @!attribute [rw] labels + # @return [::Google::Protobuf::Map{::String => ::String}] + # Optional. A map of labels to associate with the VM. + # @!attribute [rw] boot_disk_defaults + # @return [::Google::Cloud::VMMigration::V1::BootDiskDefaults] + # Optional. Details of the boot disk of the VM. + # @!attribute [rw] encryption + # @return [::Google::Cloud::VMMigration::V1::Encryption] + # Optional. The encryption to apply to the VM. + class DisksMigrationVmTargetDefaults + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class MetadataEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class LabelsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # BootDiskDefaults hold information about the boot disk of a VM. + # @!attribute [rw] image + # @return [::Google::Cloud::VMMigration::V1::BootDiskDefaults::DiskImageDefaults] + # The image to use when creating the disk. + # @!attribute [rw] disk_name + # @return [::String] + # Optional. The name of the disk. + # @!attribute [rw] disk_type + # @return [::Google::Cloud::VMMigration::V1::ComputeEngineDiskType] + # Optional. The type of disk provisioning to use for the VM. + # @!attribute [rw] device_name + # @return [::String] + # Optional. Specifies a unique device name of your choice that is reflected + # into the /dev/disk/by-id/google-* tree of a Linux operating system running + # within the instance. If not specified, the server chooses a default device + # name to apply to this disk, in the form persistent-disk-x, where x is a + # number assigned by Google Compute Engine. This field is only applicable for + # persistent disks. + # @!attribute [rw] encryption + # @return [::Google::Cloud::VMMigration::V1::Encryption] + # Optional. The encryption to apply to the boot disk. + class BootDiskDefaults + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Contains details about the image source used to create the disk. + # @!attribute [rw] source_image + # @return [::String] + # Required. The Image resource used when creating the disk. + class DiskImageDefaults + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # ComputeEngineDisksTargetDetails is a collection of created Persistent Disks + # details. + # @!attribute [rw] disks_target_details + # @return [::Google::Cloud::VMMigration::V1::DisksMigrationDisksTargetDetails] + # Details of the disks-only migration target. + # + # Note: The following fields are mutually exclusive: `disks_target_details`, `vm_target_details`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] vm_target_details + # @return [::Google::Cloud::VMMigration::V1::DisksMigrationVmTargetDetails] + # Details for the VM the migrated data disks are attached to. + # + # Note: The following fields are mutually exclusive: `vm_target_details`, `disks_target_details`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] disks + # @return [::Array<::Google::Cloud::VMMigration::V1::PersistentDisk>] + # The details of each created Persistent Disk. + class ComputeEngineDisksTargetDetails + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details of a created Persistent Disk. + # @!attribute [rw] source_disk_number + # @return [::Integer] + # The ordinal number of the source VM disk. + # @!attribute [rw] disk_uri + # @return [::String] + # The URI of the Persistent Disk. + class PersistentDisk + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details for a disks-only migration. + class DisksMigrationDisksTargetDetails + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Details for the VM created VM as part of disks migration. + # @!attribute [r] vm_uri + # @return [::String] + # Output only. The URI of the Compute Engine VM. + class DisksMigrationVmTargetDetails + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A policy for scheduling replications. + # @!attribute [rw] idle_duration + # @return [::Google::Protobuf::Duration] + # The idle duration between replication stages. + # @!attribute [rw] skip_os_adaptation + # @return [::Boolean] + # A flag to indicate whether to skip OS adaptation during the replication + # sync. OS adaptation is a process where the VM's operating system undergoes + # changes and adaptations to fully function on Compute Engine. + class SchedulePolicy + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for 'CreateMigratingVm' request. + # @!attribute [rw] parent + # @return [::String] + # Required. The MigratingVm's parent. + # @!attribute [rw] migrating_vm_id + # @return [::String] + # Required. The migratingVm identifier. + # @!attribute [rw] migrating_vm + # @return [::Google::Cloud::VMMigration::V1::MigratingVm] + # Required. The create request body. + # @!attribute [rw] request_id + # @return [::String] + # A request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server will guarantee + # that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + class CreateMigratingVmRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for 'LisMigratingVmsRequest' request. + # @!attribute [rw] parent + # @return [::String] + # Required. The parent, which owns this collection of MigratingVms. + # @!attribute [rw] page_size + # @return [::Integer] + # Optional. The maximum number of migrating VMs to return. The service may + # return fewer than this value. If unspecified, at most 500 migrating VMs + # will be returned. The maximum value is 1000; values above 1000 will be + # coerced to 1000. + # @!attribute [rw] page_token + # @return [::String] + # Required. A page token, received from a previous `ListMigratingVms` call. + # Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to `ListMigratingVms` + # must match the call that provided the page token. + # @!attribute [rw] filter + # @return [::String] + # Optional. The filter request. + # @!attribute [rw] order_by + # @return [::String] + # Optional. the order by fields for the result. + # @!attribute [rw] view + # @return [::Google::Cloud::VMMigration::V1::MigratingVmView] + # Optional. The level of details of each migrating VM. + class ListMigratingVmsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for 'ListMigratingVms' request. + # @!attribute [r] migrating_vms + # @return [::Array<::Google::Cloud::VMMigration::V1::MigratingVm>] + # Output only. The list of Migrating VMs response. + # @!attribute [r] next_page_token + # @return [::String] + # Output only. A token, which can be sent as `page_token` to retrieve the + # next page. If this field is omitted, there are no subsequent pages. + # @!attribute [r] unreachable + # @return [::Array<::String>] + # Output only. Locations that could not be reached. + class ListMigratingVmsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for 'GetMigratingVm' request. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the MigratingVm. + # @!attribute [rw] view + # @return [::Google::Cloud::VMMigration::V1::MigratingVmView] + # Optional. The level of details of the migrating VM. + class GetMigratingVmRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for 'UpdateMigratingVm' request. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # Field mask is used to specify the fields to be overwritten in the + # MigratingVm resource by the update. + # The fields specified in the update_mask are relative to the resource, not + # the full request. A field will be overwritten if it is in the mask. If the + # user does not provide a mask then all fields will be overwritten. + # @!attribute [rw] migrating_vm + # @return [::Google::Cloud::VMMigration::V1::MigratingVm] + # Required. The update request body. + # @!attribute [rw] request_id + # @return [::String] + # A request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server will guarantee + # that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + class UpdateMigratingVmRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for 'DeleteMigratingVm' request. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the MigratingVm. + class DeleteMigratingVmRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for 'StartMigrationRequest' request. + # @!attribute [rw] migrating_vm + # @return [::String] + # Required. The name of the MigratingVm. + class StartMigrationRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for 'StartMigration' request. + class StartMigrationResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for 'PauseMigration' request. + # @!attribute [rw] migrating_vm + # @return [::String] + # Required. The name of the MigratingVm. + class PauseMigrationRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for 'PauseMigration' request. + class PauseMigrationResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for 'ResumeMigration' request. + # @!attribute [rw] migrating_vm + # @return [::String] + # Required. The name of the MigratingVm. + class ResumeMigrationRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for 'ResumeMigration' request. + class ResumeMigrationResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for 'FinalizeMigration' request. + # @!attribute [rw] migrating_vm + # @return [::String] + # Required. The name of the MigratingVm. + class FinalizeMigrationRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for 'ExtendMigrationRequest' request. + # @!attribute [rw] migrating_vm + # @return [::String] + # Required. The name of the MigratingVm. + class ExtendMigrationRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for 'ExtendMigration' request. + class ExtendMigrationResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for 'FinalizeMigration' request. + class FinalizeMigrationResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # TargetProject message represents a target Compute Engine project for a + # migration or a clone. + # @!attribute [r] name + # @return [::String] + # Output only. The name of the target project. + # @!attribute [rw] project + # @return [::String] + # Required. The target project ID (number) or project name. + # @!attribute [rw] description + # @return [::String] + # The target project's description. + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time this target project resource was created (not related + # to when the Compute Engine project it points to was created). + # @!attribute [r] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The last time the target project resource was updated. + class TargetProject + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for 'GetTargetProject' call. + # @!attribute [rw] name + # @return [::String] + # Required. The TargetProject name. + class GetTargetProjectRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for 'ListTargetProjects' call. + # @!attribute [rw] parent + # @return [::String] + # Required. The parent, which owns this collection of targets. + # @!attribute [rw] page_size + # @return [::Integer] + # Optional. The maximum number of targets to return. The service may return + # fewer than this value. If unspecified, at most 500 targets will be + # returned. The maximum value is 1000; values above 1000 will be coerced to + # 1000. + # @!attribute [rw] page_token + # @return [::String] + # Required. A page token, received from a previous `ListTargets` call. + # Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to `ListTargets` must + # match the call that provided the page token. + # @!attribute [rw] filter + # @return [::String] + # Optional. The filter request. + # @!attribute [rw] order_by + # @return [::String] + # Optional. the order by fields for the result. + class ListTargetProjectsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for 'ListTargetProjects' call. + # @!attribute [r] target_projects + # @return [::Array<::Google::Cloud::VMMigration::V1::TargetProject>] + # Output only. The list of target response. + # @!attribute [r] next_page_token + # @return [::String] + # Output only. A token, which can be sent as `page_token` to retrieve the + # next page. If this field is omitted, there are no subsequent pages. + # @!attribute [r] unreachable + # @return [::Array<::String>] + # Output only. Locations that could not be reached. + class ListTargetProjectsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for 'CreateTargetProject' request. + # @!attribute [rw] parent + # @return [::String] + # Required. The TargetProject's parent. + # @!attribute [rw] target_project_id + # @return [::String] + # Required. The target_project identifier. + # @!attribute [rw] target_project + # @return [::Google::Cloud::VMMigration::V1::TargetProject] + # Required. The create request body. + # @!attribute [rw] request_id + # @return [::String] + # A request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server will guarantee + # that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + class CreateTargetProjectRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Update message for 'UpdateTargetProject' request. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # Field mask is used to specify the fields to be overwritten in the + # TargetProject resource by the update. + # The fields specified in the update_mask are relative to the resource, not + # the full request. A field will be overwritten if it is in the mask. If the + # user does not provide a mask then all fields will be overwritten. + # @!attribute [rw] target_project + # @return [::Google::Cloud::VMMigration::V1::TargetProject] + # Required. The update request body. + # @!attribute [rw] request_id + # @return [::String] + # A request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server will guarantee + # that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + class UpdateTargetProjectRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for 'DeleteTargetProject' request. + # @!attribute [rw] name + # @return [::String] + # Required. The TargetProject name. + # @!attribute [rw] request_id + # @return [::String] + # Optional. A request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server will guarantee + # that for at least 60 minutes after the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + class DeleteTargetProjectRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes message for 'Group' resource. The Group is a collections of several + # MigratingVms. + # @!attribute [r] name + # @return [::String] + # Output only. The Group name. + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The create time timestamp. + # @!attribute [r] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The update time timestamp. + # @!attribute [rw] description + # @return [::String] + # User-provided description of the group. + # @!attribute [rw] display_name + # @return [::String] + # Display name is a user defined name for this group which can be updated. + # @!attribute [rw] migration_target_type + # @return [::Google::Cloud::VMMigration::V1::Group::MigrationTargetType] + # Immutable. The target type of this group. + class Group + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The possible types of the group. + module MigrationTargetType + # Group type is not specified. This defaults to Compute Engine targets. + MIGRATION_TARGET_TYPE_UNSPECIFIED = 0 + + # All MigratingVMs in the group must have Compute Engine targets. + MIGRATION_TARGET_TYPE_GCE = 1 + + # All MigratingVMs in the group must have Compute Engine Disks targets. + MIGRATION_TARGET_TYPE_DISKS = 2 + end + end + + # Request message for 'ListGroups' request. + # @!attribute [rw] parent + # @return [::String] + # Required. The parent, which owns this collection of groups. + # @!attribute [rw] page_size + # @return [::Integer] + # Optional. The maximum number of groups to return. The service may return + # fewer than this value. If unspecified, at most 500 groups will be + # returned. The maximum value is 1000; values above 1000 will be coerced to + # 1000. + # @!attribute [rw] page_token + # @return [::String] + # Required. A page token, received from a previous `ListGroups` call. + # Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to `ListGroups` must + # match the call that provided the page token. + # @!attribute [rw] filter + # @return [::String] + # Optional. The filter request. + # @!attribute [rw] order_by + # @return [::String] + # Optional. the order by fields for the result. + class ListGroupsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for 'ListGroups' request. + # @!attribute [r] groups + # @return [::Array<::Google::Cloud::VMMigration::V1::Group>] + # Output only. The list of groups response. + # @!attribute [r] next_page_token + # @return [::String] + # Output only. A token, which can be sent as `page_token` to retrieve the + # next page. If this field is omitted, there are no subsequent pages. + # @!attribute [r] unreachable + # @return [::Array<::String>] + # Output only. Locations that could not be reached. + class ListGroupsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for 'GetGroup' request. + # @!attribute [rw] name + # @return [::String] + # Required. The group name. + class GetGroupRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for 'CreateGroup' request. + # @!attribute [rw] parent + # @return [::String] + # Required. The Group's parent. + # @!attribute [rw] group_id + # @return [::String] + # Required. The group identifier. + # @!attribute [rw] group + # @return [::Google::Cloud::VMMigration::V1::Group] + # Required. The create request body. + # @!attribute [rw] request_id + # @return [::String] + # A request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server will guarantee + # that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + class CreateGroupRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Update message for 'UpdateGroups' request. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # Field mask is used to specify the fields to be overwritten in the + # Group resource by the update. + # The fields specified in the update_mask are relative to the resource, not + # the full request. A field will be overwritten if it is in the mask. If the + # user does not provide a mask then all fields will be overwritten. + # @!attribute [rw] group + # @return [::Google::Cloud::VMMigration::V1::Group] + # Required. The update request body. + # @!attribute [rw] request_id + # @return [::String] + # A request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server will guarantee + # that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + class UpdateGroupRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for 'DeleteGroup' request. + # @!attribute [rw] name + # @return [::String] + # Required. The Group name. + # @!attribute [rw] request_id + # @return [::String] + # Optional. A request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server will guarantee + # that for at least 60 minutes after the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + class DeleteGroupRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for 'AddGroupMigration' request. + # @!attribute [rw] group + # @return [::String] + # Required. The full path name of the Group to add to. + # @!attribute [rw] migrating_vm + # @return [::String] + # The full path name of the MigratingVm to add. + class AddGroupMigrationRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for 'AddGroupMigration' request. + class AddGroupMigrationResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for 'RemoveMigration' request. + # @!attribute [rw] group + # @return [::String] + # Required. The name of the Group. + # @!attribute [rw] migrating_vm + # @return [::String] + # The MigratingVm to remove. + class RemoveGroupMigrationRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for 'RemoveMigration' request. + class RemoveGroupMigrationResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for 'CreateCutoverJob' request. + # @!attribute [rw] parent + # @return [::String] + # Required. The Cutover's parent. + # @!attribute [rw] cutover_job_id + # @return [::String] + # Required. The cutover job identifier. + # @!attribute [rw] cutover_job + # @return [::Google::Cloud::VMMigration::V1::CutoverJob] + # Required. The cutover request body. + # @!attribute [rw] request_id + # @return [::String] + # A request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server will guarantee + # that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + class CreateCutoverJobRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for 'CancelCutoverJob' request. + # @!attribute [rw] name + # @return [::String] + # Required. The cutover job id + class CancelCutoverJobRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for 'CancelCutoverJob' request. + class CancelCutoverJobResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for 'ListCutoverJobsRequest' request. + # @!attribute [rw] parent + # @return [::String] + # Required. The parent, which owns this collection of migrating VMs. + # @!attribute [rw] page_size + # @return [::Integer] + # Optional. The maximum number of cutover jobs to return. The service may + # return fewer than this value. If unspecified, at most 500 cutover jobs will + # be returned. The maximum value is 1000; values above 1000 will be coerced + # to 1000. + # @!attribute [rw] page_token + # @return [::String] + # Required. A page token, received from a previous `ListCutoverJobs` call. + # Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to `ListCutoverJobs` must + # match the call that provided the page token. + # @!attribute [rw] filter + # @return [::String] + # Optional. The filter request. + # @!attribute [rw] order_by + # @return [::String] + # Optional. the order by fields for the result. + class ListCutoverJobsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for 'ListCutoverJobs' request. + # @!attribute [r] cutover_jobs + # @return [::Array<::Google::Cloud::VMMigration::V1::CutoverJob>] + # Output only. The list of cutover jobs response. + # @!attribute [r] next_page_token + # @return [::String] + # Output only. A token, which can be sent as `page_token` to retrieve the + # next page. If this field is omitted, there are no subsequent pages. + # @!attribute [r] unreachable + # @return [::Array<::String>] + # Output only. Locations that could not be reached. + class ListCutoverJobsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for 'GetCutoverJob' request. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the CutoverJob. + class GetCutoverJobRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Represents the metadata of the long-running operation. + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time the operation was created. + # @!attribute [r] end_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time the operation finished running. + # @!attribute [r] target + # @return [::String] + # Output only. Server-defined resource path for the target of the operation. + # @!attribute [r] verb + # @return [::String] + # Output only. Name of the verb executed by the operation. + # @!attribute [r] status_message + # @return [::String] + # Output only. Human-readable status of the operation, if any. + # @!attribute [r] requested_cancellation + # @return [::Boolean] + # Output only. Identifies whether the user has requested cancellation + # of the operation. Operations that have successfully been cancelled + # have [Operation.error][] value with a + # {::Google::Rpc::Status#code google.rpc.Status.code} of 1, corresponding to + # `Code.CANCELLED`. + # @!attribute [r] api_version + # @return [::String] + # Output only. API version used to start the operation. + class OperationMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Represents migration resource error information that can be used with + # google.rpc.Status message. MigrationError is used to present the user with + # error information in migration operations. + # @!attribute [r] code + # @return [::Google::Cloud::VMMigration::V1::MigrationError::ErrorCode] + # Output only. The error code. + # @!attribute [r] error_message + # @return [::Google::Rpc::LocalizedMessage] + # Output only. The localized error message. + # @!attribute [r] action_item + # @return [::Google::Rpc::LocalizedMessage] + # Output only. Suggested action for solving the error. + # @!attribute [r] help_links + # @return [::Array<::Google::Rpc::Help::Link>] + # Output only. URL(s) pointing to additional information on handling the + # current error. + # @!attribute [r] error_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time the error occurred. + class MigrationError + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Represents resource error codes. + module ErrorCode + # Default value. This value is not used. + ERROR_CODE_UNSPECIFIED = 0 + + # Migrate to Virtual Machines encountered an unknown error. + UNKNOWN_ERROR = 1 + + # Migrate to Virtual Machines encountered an error while validating + # replication source health. + SOURCE_VALIDATION_ERROR = 2 + + # Migrate to Virtual Machines encountered an error during source data + # operation. + SOURCE_REPLICATION_ERROR = 3 + + # Migrate to Virtual Machines encountered an error during target data + # operation. + TARGET_REPLICATION_ERROR = 4 + + # Migrate to Virtual Machines encountered an error during OS adaptation. + OS_ADAPTATION_ERROR = 5 + + # Migrate to Virtual Machines encountered an error in clone operation. + CLONE_ERROR = 6 + + # Migrate to Virtual Machines encountered an error in cutover operation. + CUTOVER_ERROR = 7 + + # Migrate to Virtual Machines encountered an error during utilization + # report creation. + UTILIZATION_REPORT_ERROR = 8 + + # Migrate to Virtual Machines encountered an error during appliance + # upgrade. + APPLIANCE_UPGRADE_ERROR = 9 + + # Migrate to Virtual Machines encountered an error in image import + # operation. + IMAGE_IMPORT_ERROR = 10 + + # Migrate to Virtual Machines encountered an error in disk migration + # operation. + DISK_MIGRATION_ERROR = 11 + end + end + + # Represents migration resource warning information that can be used with + # google.rpc.Status message. MigrationWarning is used to present the user with + # warning information in migration operations. + # @!attribute [rw] code + # @return [::Google::Cloud::VMMigration::V1::MigrationWarning::WarningCode] + # The warning code. + # @!attribute [r] warning_message + # @return [::Google::Rpc::LocalizedMessage] + # Output only. The localized warning message. + # @!attribute [r] action_item + # @return [::Google::Rpc::LocalizedMessage] + # Output only. Suggested action for solving the warning. + # @!attribute [r] help_links + # @return [::Array<::Google::Rpc::Help::Link>] + # Output only. URL(s) pointing to additional information on handling the + # current warning. + # @!attribute [rw] warning_time + # @return [::Google::Protobuf::Timestamp] + # The time the warning occurred. + class MigrationWarning + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Represents possible warning codes. + module WarningCode + # Default value. This value is not used. + WARNING_CODE_UNSPECIFIED = 0 + + # A warning originated from OS Adaptation. + ADAPTATION_WARNING = 1 + end + end + + # Represent the source Vmware VM details. + # @!attribute [r] firmware + # @return [::Google::Cloud::VMMigration::V1::VmwareSourceVmDetails::Firmware] + # Output only. The firmware type of the source VM. + # @!attribute [r] committed_storage_bytes + # @return [::Integer] + # Output only. The total size of the disks being migrated in bytes. + # @!attribute [r] disks + # @return [::Array<::Google::Cloud::VMMigration::V1::VmwareSourceVmDetails::VmwareDiskDetails>] + # Output only. The disks attached to the source VM. + # @!attribute [r] vm_capabilities_info + # @return [::Google::Cloud::VMMigration::V1::VmCapabilities] + # Output only. Information about VM capabilities needed for some Compute + # Engine features. + # @!attribute [r] architecture + # @return [::Google::Cloud::VMMigration::V1::VmArchitecture] + # Output only. The VM architecture. + class VmwareSourceVmDetails + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The details of a Vmware VM disk. + # @!attribute [r] disk_number + # @return [::Integer] + # Output only. The ordinal number of the disk. + # @!attribute [r] size_gb + # @return [::Integer] + # Output only. Size in GB. + # @!attribute [r] label + # @return [::String] + # Output only. The disk label. + class VmwareDiskDetails + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Possible values for Vmware VM firmware. + module Firmware + # The firmware is unknown. + FIRMWARE_UNSPECIFIED = 0 + + # The firmware is EFI. + EFI = 1 + + # The firmware is BIOS. + BIOS = 2 + end + end + + # Represent the source AWS VM details. + # @!attribute [r] firmware + # @return [::Google::Cloud::VMMigration::V1::AwsSourceVmDetails::Firmware] + # Output only. The firmware type of the source VM. + # @!attribute [r] committed_storage_bytes + # @return [::Integer] + # Output only. The total size of the disks being migrated in bytes. + # @!attribute [r] disks + # @return [::Array<::Google::Cloud::VMMigration::V1::AwsSourceVmDetails::AwsDiskDetails>] + # Output only. The disks attached to the source VM. + # @!attribute [r] vm_capabilities_info + # @return [::Google::Cloud::VMMigration::V1::VmCapabilities] + # Output only. Information about VM capabilities needed for some Compute + # Engine features. + # @!attribute [r] architecture + # @return [::Google::Cloud::VMMigration::V1::VmArchitecture] + # Output only. The VM architecture. + class AwsSourceVmDetails + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The details of an AWS instance disk. + # @!attribute [r] disk_number + # @return [::Integer] + # Output only. The ordinal number of the disk. + # @!attribute [r] volume_id + # @return [::String] + # Output only. AWS volume ID. + # @!attribute [r] size_gb + # @return [::Integer] + # Output only. Size in GB. + class AwsDiskDetails + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Possible values for AWS VM firmware. + module Firmware + # The firmware is unknown. + FIRMWARE_UNSPECIFIED = 0 + + # The firmware is EFI. + EFI = 1 + + # The firmware is BIOS. + BIOS = 2 + end + end + + # Represent the source Azure VM details. + # @!attribute [r] firmware + # @return [::Google::Cloud::VMMigration::V1::AzureSourceVmDetails::Firmware] + # Output only. The firmware type of the source VM. + # @!attribute [r] committed_storage_bytes + # @return [::Integer] + # Output only. The total size of the disks being migrated in bytes. + # @!attribute [r] disks + # @return [::Array<::Google::Cloud::VMMigration::V1::AzureSourceVmDetails::AzureDiskDetails>] + # Output only. The disks attached to the source VM. + # @!attribute [r] vm_capabilities_info + # @return [::Google::Cloud::VMMigration::V1::VmCapabilities] + # Output only. Information about VM capabilities needed for some Compute + # Engine features. + # @!attribute [r] architecture + # @return [::Google::Cloud::VMMigration::V1::VmArchitecture] + # Output only. The VM architecture. + class AzureSourceVmDetails + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The details of an Azure VM disk. + # @!attribute [r] disk_number + # @return [::Integer] + # Output only. The ordinal number of the disk. + # @!attribute [r] disk_id + # @return [::String] + # Output only. Azure disk ID. + # @!attribute [r] size_gb + # @return [::Integer] + # Output only. Size in GB. + class AzureDiskDetails + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Possible values for Azure VM firmware. + module Firmware + # The firmware is unknown. + FIRMWARE_UNSPECIFIED = 0 + + # The firmware is EFI. + EFI = 1 + + # The firmware is BIOS. + BIOS = 2 + end + end + + # Request message for 'LisReplicationCyclesRequest' request. + # @!attribute [rw] parent + # @return [::String] + # Required. The parent, which owns this collection of ReplicationCycles. + # @!attribute [rw] page_size + # @return [::Integer] + # Optional. The maximum number of replication cycles to return. The service + # may return fewer than this value. If unspecified, at most 100 migrating VMs + # will be returned. The maximum value is 100; values above 100 will be + # coerced to 100. + # @!attribute [rw] page_token + # @return [::String] + # Required. A page token, received from a previous `ListReplicationCycles` + # call. Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to `ListReplicationCycles` + # must match the call that provided the page token. + # @!attribute [rw] filter + # @return [::String] + # Optional. The filter request. + # @!attribute [rw] order_by + # @return [::String] + # Optional. the order by fields for the result. + class ListReplicationCyclesRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for 'ListReplicationCycles' request. + # @!attribute [r] replication_cycles + # @return [::Array<::Google::Cloud::VMMigration::V1::ReplicationCycle>] + # Output only. The list of replication cycles response. + # @!attribute [r] next_page_token + # @return [::String] + # Output only. A token, which can be sent as `page_token` to retrieve the + # next page. If this field is omitted, there are no subsequent pages. + # @!attribute [r] unreachable + # @return [::Array<::String>] + # Output only. Locations that could not be reached. + class ListReplicationCyclesResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for 'GetReplicationCycle' request. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the ReplicationCycle. + class GetReplicationCycleRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Migrating VM source information about the VM capabilities needed for some + # Compute Engine features. + # @!attribute [r] os_capabilities + # @return [::Array<::Google::Cloud::VMMigration::V1::OsCapability>] + # Output only. Unordered list. List of certain VM OS capabilities needed for + # some Compute Engine features. + # @!attribute [r] last_os_capabilities_update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The last time OS capabilities list was updated. + class VmCapabilities + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # ImageImport describes the configuration of the image import to run. + # @!attribute [rw] cloud_storage_uri + # @return [::String] + # Immutable. The path to the Cloud Storage file from which the image should + # be imported. + # @!attribute [rw] disk_image_target_defaults + # @return [::Google::Cloud::VMMigration::V1::DiskImageTargetDetails] + # Immutable. Target details for importing a disk image, will be used by + # ImageImportJob. + # + # Note: The following fields are mutually exclusive: `disk_image_target_defaults`, `machine_image_target_defaults`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] machine_image_target_defaults + # @return [::Google::Cloud::VMMigration::V1::MachineImageTargetDetails] + # Immutable. Target details for importing a machine image, will be used by + # ImageImportJob. + # + # Note: The following fields are mutually exclusive: `machine_image_target_defaults`, `disk_image_target_defaults`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [r] name + # @return [::String] + # Output only. The resource path of the ImageImport. + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time the image import was created. + # @!attribute [r] recent_image_import_jobs + # @return [::Array<::Google::Cloud::VMMigration::V1::ImageImportJob>] + # Output only. The result of the most recent runs for this ImageImport. All + # jobs for this ImageImport can be listed via ListImageImportJobs. + # @!attribute [rw] encryption + # @return [::Google::Cloud::VMMigration::V1::Encryption] + # Immutable. The encryption details used by the image import process during + # the image adaptation for Compute Engine. + class ImageImport + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # ImageImportJob describes the progress and result of an image import. + # @!attribute [r] cloud_storage_uri + # @return [::String] + # Output only. The path to the Cloud Storage file from which the image + # should be imported. + # @!attribute [r] disk_image_target_details + # @return [::Google::Cloud::VMMigration::V1::DiskImageTargetDetails] + # Output only. Target details used to import a disk image. + # + # Note: The following fields are mutually exclusive: `disk_image_target_details`, `machine_image_target_details`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [r] machine_image_target_details + # @return [::Google::Cloud::VMMigration::V1::MachineImageTargetDetails] + # Output only. Target details used to import a machine image. + # + # Note: The following fields are mutually exclusive: `machine_image_target_details`, `disk_image_target_details`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [r] name + # @return [::String] + # Output only. The resource path of the ImageImportJob. + # @!attribute [r] created_resources + # @return [::Array<::String>] + # Output only. The resource paths of the resources created by the image + # import job. + # @!attribute [r] state + # @return [::Google::Cloud::VMMigration::V1::ImageImportJob::State] + # Output only. The state of the image import. + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time the image import was created (as an API call, not + # when it was actually created in the target). + # @!attribute [r] end_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time the image import was ended. + # @!attribute [r] errors + # @return [::Array<::Google::Rpc::Status>] + # Output only. Provides details on the error that led to the image import + # state in case of an error. + # @!attribute [r] warnings + # @return [::Array<::Google::Cloud::VMMigration::V1::MigrationWarning>] + # Output only. Warnings that occurred during the image import. + # @!attribute [r] steps + # @return [::Array<::Google::Cloud::VMMigration::V1::ImageImportStep>] + # Output only. The image import steps list representing its progress. + class ImageImportJob + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Possible states of the image import. + module State + # The state is unknown. + STATE_UNSPECIFIED = 0 + + # The image import has not yet started. + PENDING = 1 + + # The image import is active and running. + RUNNING = 2 + + # The image import has finished successfully. + SUCCEEDED = 3 + + # The image import has finished with errors. + FAILED = 4 + + # The image import is being cancelled. + CANCELLING = 5 + + # The image import was cancelled. + CANCELLED = 6 + end + end + + # ImageImportStep holds information about the image import step progress. + # @!attribute [rw] initializing + # @return [::Google::Cloud::VMMigration::V1::InitializingImageImportStep] + # Initializing step. + # + # Note: The following fields are mutually exclusive: `initializing`, `loading_source_files`, `adapting_os`, `creating_image`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] loading_source_files + # @return [::Google::Cloud::VMMigration::V1::LoadingImageSourceFilesStep] + # Loading source files step. + # + # Note: The following fields are mutually exclusive: `loading_source_files`, `initializing`, `adapting_os`, `creating_image`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] adapting_os + # @return [::Google::Cloud::VMMigration::V1::AdaptingOSStep] + # Adapting OS step. + # + # Note: The following fields are mutually exclusive: `adapting_os`, `initializing`, `loading_source_files`, `creating_image`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] creating_image + # @return [::Google::Cloud::VMMigration::V1::CreatingImageStep] + # Creating image step. + # + # Note: The following fields are mutually exclusive: `creating_image`, `initializing`, `loading_source_files`, `adapting_os`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [r] start_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time the step has started. + # @!attribute [r] end_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time the step has ended. + class ImageImportStep + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # InitializingImageImportStep contains specific step details. + class InitializingImageImportStep + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # LoadingImageSourceFilesStep contains specific step details. + class LoadingImageSourceFilesStep + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # CreatingImageStep contains specific step details. + class CreatingImageStep + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The target details of the image resource that will be created by the import + # job. + # @!attribute [rw] os_adaptation_parameters + # @return [::Google::Cloud::VMMigration::V1::ImageImportOsAdaptationParameters] + # Optional. Use to set the parameters relevant for the OS adaptation + # process. + # + # Note: The following fields are mutually exclusive: `os_adaptation_parameters`, `data_disk_image_import`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] data_disk_image_import + # @return [::Google::Cloud::VMMigration::V1::DataDiskImageImport] + # Optional. Use to skip OS adaptation process. + # + # Note: The following fields are mutually exclusive: `data_disk_image_import`, `os_adaptation_parameters`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] image_name + # @return [::String] + # Required. The name of the image to be created. + # @!attribute [rw] target_project + # @return [::String] + # Required. Reference to the TargetProject resource that represents the + # target project in which the imported image will be created. + # @!attribute [rw] description + # @return [::String] + # Optional. An optional description of the image. + # @!attribute [rw] family_name + # @return [::String] + # Optional. The name of the image family to which the new image belongs. + # @!attribute [rw] labels + # @return [::Google::Protobuf::Map{::String => ::String}] + # Optional. A map of labels to associate with the image. + # @!attribute [rw] additional_licenses + # @return [::Array<::String>] + # Optional. Additional licenses to assign to the image. + # Format: + # https://www.googleapis.com/compute/v1/projects/PROJECT_ID/global/licenses/LICENSE_NAME + # Or + # https://www.googleapis.com/compute/beta/projects/PROJECT_ID/global/licenses/LICENSE_NAME + # @!attribute [rw] single_region_storage + # @return [::Boolean] + # Optional. Set to true to set the image storageLocations to the single + # region of the import job. When false, the closest multi-region is selected. + # @!attribute [rw] encryption + # @return [::Google::Cloud::VMMigration::V1::Encryption] + # Immutable. The encryption to apply to the image. + class DiskImageTargetDetails + 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 + end + + # The target details of the machine image resource that will be created by the + # image import job. + # @!attribute [rw] os_adaptation_parameters + # @return [::Google::Cloud::VMMigration::V1::ImageImportOsAdaptationParameters] + # Optional. Use to set the parameters relevant for the OS adaptation + # process. + # + # Note: The following fields are mutually exclusive: `os_adaptation_parameters`, `skip_os_adaptation`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] skip_os_adaptation + # @return [::Google::Cloud::VMMigration::V1::SkipOsAdaptation] + # Optional. Use to skip OS adaptation process. + # + # Note: The following fields are mutually exclusive: `skip_os_adaptation`, `os_adaptation_parameters`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] machine_image_name + # @return [::String] + # Required. The name of the machine image to be created. + # @!attribute [rw] target_project + # @return [::String] + # Required. Reference to the TargetProject resource that represents the + # target project in which the imported machine image will be created. + # @!attribute [rw] description + # @return [::String] + # Optional. An optional description of the machine image. + # @!attribute [rw] single_region_storage + # @return [::Boolean] + # Optional. Set to true to set the machine image storageLocations to the + # single region of the import job. When false, the closest multi-region is + # selected. + # @!attribute [rw] encryption + # @return [::Google::Cloud::VMMigration::V1::Encryption] + # Immutable. The encryption to apply to the machine image. + # If the Image Import resource has an encryption, this field must be set to + # the same encryption key. + # @!attribute [rw] machine_image_parameters_overrides + # @return [::Google::Cloud::VMMigration::V1::MachineImageParametersOverrides] + # Optional. Parameters overriding decisions based on the source machine image + # configurations. + # @!attribute [rw] service_account + # @return [::Google::Cloud::VMMigration::V1::ServiceAccount] + # Optional. The service account to assign to the instance created by the + # machine image. + # @!attribute [rw] additional_licenses + # @return [::Array<::String>] + # Optional. Additional licenses to assign to the instance created by the + # machine image. Format: + # https://www.googleapis.com/compute/v1/projects/PROJECT_ID/global/licenses/LICENSE_NAME + # Or + # https://www.googleapis.com/compute/beta/projects/PROJECT_ID/global/licenses/LICENSE_NAME + # @!attribute [rw] labels + # @return [::Google::Protobuf::Map{::String => ::String}] + # Optional. The labels to apply to the instance created by the machine image. + # @!attribute [rw] tags + # @return [::Array<::String>] + # Optional. The tags to apply to the instance created by the machine image. + # @!attribute [rw] shielded_instance_config + # @return [::Google::Cloud::VMMigration::V1::ShieldedInstanceConfig] + # Optional. Shielded instance configuration. + # @!attribute [rw] network_interfaces + # @return [::Array<::Google::Cloud::VMMigration::V1::NetworkInterface>] + # Optional. The network interfaces to create with the instance created by the + # machine image. Internal and external IP addresses, and network tiers are + # ignored for machine image import. + class MachineImageTargetDetails + 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 + end + + # Service account to assign to the instance created by the machine image. + # @!attribute [rw] email + # @return [::String] + # Required. The email address of the service account. + # @!attribute [rw] scopes + # @return [::Array<::String>] + # Optional. The list of scopes to be made available for this service account. + class ServiceAccount + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Shielded instance configuration. + # @!attribute [rw] secure_boot + # @return [::Google::Cloud::VMMigration::V1::ShieldedInstanceConfig::SecureBoot] + # Optional. Defines whether the instance created by the machine image has + # Secure Boot enabled. This can be set to true only if the image boot option + # is EFI. + # @!attribute [rw] enable_vtpm + # @return [::Boolean] + # Optional. Defines whether the instance created by the machine image has + # vTPM enabled. This can be set to true only if the image boot option is EFI. + # @!attribute [rw] enable_integrity_monitoring + # @return [::Boolean] + # Optional. Defines whether the instance created by the machine image has + # integrity monitoring enabled. This can be set to true only if the image + # boot option is EFI, and vTPM is enabled. + class ShieldedInstanceConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Possible values for secure boot. + module SecureBoot + # No explicit value is selected. Will use the configuration of the source + # (if exists, otherwise the default will be false). + SECURE_BOOT_UNSPECIFIED = 0 + + # Use secure boot. This can be set to true only if the image boot option is + # EFI. + TRUE = 1 + + # Do not use secure boot. + FALSE = 2 + end + end + + # Parameters overriding decisions based on the source machine image + # configurations. + # @!attribute [rw] machine_type + # @return [::String] + # Optional. The machine type to create the MachineImage with. + # If empty, the service will choose a relevant machine type based on the + # information from the source image. + # For more information about machine types, please refer to + # https://cloud.google.com/compute/docs/machine-resource. + class MachineImageParametersOverrides + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Parameters affecting the OS adaptation process. + # @!attribute [rw] generalize + # @return [::Boolean] + # Optional. Set to true in order to generalize the imported image. + # The generalization process enables co-existence of multiple VMs created + # from the same image. + # For Windows, generalizing the image removes computer-specific information + # such as installed drivers and the computer security identifier (SID). + # @!attribute [rw] license_type + # @return [::Google::Cloud::VMMigration::V1::ComputeEngineLicenseType] + # Optional. Choose which type of license to apply to the imported image. + # @!attribute [rw] boot_conversion + # @return [::Google::Cloud::VMMigration::V1::BootConversion] + # Optional. By default the image will keep its existing boot option. Setting + # this property will trigger an internal process which will convert the + # image from using the existing boot option to another. + # The size of the boot disk might be increased to allow the conversion + # @!attribute [rw] adaptation_modifiers + # @return [::Array<::Google::Cloud::VMMigration::V1::AdaptationModifier>] + # Optional. Modifiers to be used as configuration of the OS adaptation + # process. + class ImageImportOsAdaptationParameters + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Used when the image import is not using OS adaptation process. + # @!attribute [rw] guest_os_features + # @return [::Array<::String>] + # Optional. A list of guest OS features to apply to the imported image. These + # features are flags that are used by Compute Engine to enable certain + # capabilities for virtual machine instances that are created from the image. + # + # This field does not change the OS of the image; it only marks the image + # with the specified features. The user must ensure that the OS is + # compatible with the features. + # + # For a list of available features, see + # https://cloud.google.com/compute/docs/images/create-custom#guest-os-features. + class DataDiskImageImport + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Mentions that the machine image import is not using OS adaptation process. + class SkipOsAdaptation + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for 'GetImageImport' call. + # @!attribute [rw] name + # @return [::String] + # Required. The ImageImport name. + class GetImageImportRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for 'ListImageImports' call. + # @!attribute [rw] parent + # @return [::String] + # Required. The parent, which owns this collection of targets. + # @!attribute [rw] page_size + # @return [::Integer] + # Optional. The maximum number of targets to return. The service may return + # fewer than this value. If unspecified, at most 500 targets will be + # returned. The maximum value is 1000; values above 1000 will be coerced to + # 1000. + # @!attribute [rw] page_token + # @return [::String] + # Optional. A page token, received from a previous `ListImageImports` call. + # Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to `ListImageImports` must + # match the call that provided the page token. + # @!attribute [rw] filter + # @return [::String] + # Optional. The filter request (according to AIP-160). + # @!attribute [rw] order_by + # @return [::String] + # Optional. The order by fields for the result (according to AIP-132). + # Currently ordering is only possible by "name" field. + class ListImageImportsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for 'ListImageImports' call. + # @!attribute [r] image_imports + # @return [::Array<::Google::Cloud::VMMigration::V1::ImageImport>] + # Output only. The list of target response. + # @!attribute [r] next_page_token + # @return [::String] + # Output only. A token, which can be sent as `page_token` to retrieve the + # next page. If this field is omitted, there are no subsequent pages. + # @!attribute [r] unreachable + # @return [::Array<::String>] + # Output only. Locations that could not be reached. + class ListImageImportsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for 'CreateImageImport' request. + # @!attribute [rw] parent + # @return [::String] + # Required. The ImageImport's parent. + # @!attribute [rw] image_import_id + # @return [::String] + # Required. The image import identifier. + # This value maximum length is 63 characters, and valid characters are + # /[a-z][0-9]-/. It must start with an english letter and must not end with a + # hyphen. + # @!attribute [rw] image_import + # @return [::Google::Cloud::VMMigration::V1::ImageImport] + # Required. The create request body. + # @!attribute [rw] request_id + # @return [::String] + # Optional. A request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server will guarantee + # that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + class CreateImageImportRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for 'DeleteImageImport' request. + # @!attribute [rw] name + # @return [::String] + # Required. The ImageImport name. + # @!attribute [rw] request_id + # @return [::String] + # Optional. A request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server will guarantee + # that for at least 60 minutes after the first request. + # + # For example, consider a situation where you make an initial request and t + # he request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + class DeleteImageImportRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for 'GetImageImportJob' call. + # @!attribute [rw] name + # @return [::String] + # Required. The ImageImportJob name. + class GetImageImportJobRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for 'ListImageImportJobs' call. + # @!attribute [rw] parent + # @return [::String] + # Required. The parent, which owns this collection of targets. + # @!attribute [rw] page_size + # @return [::Integer] + # Optional. The maximum number of targets to return. The service may return + # fewer than this value. If unspecified, at most 500 targets will be + # returned. The maximum value is 1000; values above 1000 will be coerced to + # 1000. + # @!attribute [rw] page_token + # @return [::String] + # Optional. A page token, received from a previous `ListImageImportJobs` + # call. Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to `ListImageImportJobs` + # must match the call that provided the page token. + # @!attribute [rw] filter + # @return [::String] + # Optional. The filter request (according to AIP-160). + # @!attribute [rw] order_by + # @return [::String] + # Optional. The order by fields for the result (according to AIP-132). + # Currently ordering is only possible by "name" field. + class ListImageImportJobsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for 'ListImageImportJobs' call. + # @!attribute [r] image_import_jobs + # @return [::Array<::Google::Cloud::VMMigration::V1::ImageImportJob>] + # Output only. The list of target response. + # @!attribute [r] next_page_token + # @return [::String] + # Output only. A token, which can be sent as `page_token` to retrieve the + # next page. If this field is omitted, there are no subsequent pages. + # @!attribute [r] unreachable + # @return [::Array<::String>] + # Output only. Locations that could not be reached. + class ListImageImportJobsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for 'CancelImageImportJob' request. + # @!attribute [rw] name + # @return [::String] + # Required. The image import job id. + class CancelImageImportJobRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for 'CancelImageImportJob' request. + class CancelImageImportJobResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes the disk which will be migrated from the source environment. + # The source disk has to be unattached. + # @!attribute [rw] aws_source_disk_details + # @return [::Google::Cloud::VMMigration::V1::AwsSourceDiskDetails] + # Details of the unattached AWS source disk. + # @!attribute [r] name + # @return [::String] + # Output only. Identifier. The identifier of the DiskMigrationJob. + # @!attribute [rw] target_details + # @return [::Google::Cloud::VMMigration::V1::DiskMigrationJobTargetDetails] + # Required. Details of the target Disk in Compute Engine. + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time the DiskMigrationJob resource was created. + # @!attribute [r] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The last time the DiskMigrationJob resource was updated. + # @!attribute [r] state + # @return [::Google::Cloud::VMMigration::V1::DiskMigrationJob::State] + # Output only. State of the DiskMigrationJob. + # @!attribute [r] errors + # @return [::Array<::Google::Rpc::Status>] + # Output only. Provides details on the errors that led to the disk migration + # job's state in case of an error. + # @!attribute [r] steps + # @return [::Array<::Google::Cloud::VMMigration::V1::DiskMigrationStep>] + # Output only. The disk migration steps list representing its progress. + class DiskMigrationJob + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The possible values of the state/health of DiskMigrationJob. + module State + # The state is unspecified. This is not in use. + STATE_UNSPECIFIED = 0 + + # The initial state of the disk migration. + # In this state the customers can update the target details. + READY = 1 + + # The migration is active, and it's running or scheduled to run. + RUNNING = 3 + + # The migration completed successfully. + SUCCEEDED = 4 + + # Migration cancellation was initiated. + CANCELLING = 5 + + # The migration was cancelled. + CANCELLED = 6 + + # The migration process encountered an unrecoverable error and was aborted. + FAILED = 7 + end + end + + # Details of the target disk in Compute Engine. + # @!attribute [rw] target_disk + # @return [::Google::Cloud::VMMigration::V1::ComputeEngineDisk] + # Required. The target disk. + # @!attribute [rw] target_project + # @return [::String] + # Required. The name of the resource of type TargetProject which represents + # the Compute Engine project in which to create the disk. Should be of the + # form: projects/\\{project}/locations/global/targetProjects/\\{target-project} + # @!attribute [rw] labels + # @return [::Google::Protobuf::Map{::String => ::String}] + # Optional. A map of labels to associate with the disk. + # @!attribute [rw] encryption + # @return [::Google::Cloud::VMMigration::V1::Encryption] + # Optional. The encryption to apply to the disk. + # If the DiskMigrationJob parent Source resource has an encryption, this + # field must be set to the same encryption key. + class DiskMigrationJobTargetDetails + 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 + end + + # DiskMigrationStep holds information about the disk migration step progress. + # @!attribute [rw] creating_source_disk_snapshot + # @return [::Google::Cloud::VMMigration::V1::CreatingSourceDiskSnapshotStep] + # Creating source disk snapshot step. + # + # Note: The following fields are mutually exclusive: `creating_source_disk_snapshot`, `copying_source_disk_snapshot`, `provisioning_target_disk`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] copying_source_disk_snapshot + # @return [::Google::Cloud::VMMigration::V1::CopyingSourceDiskSnapshotStep] + # Copying source disk snapshot step. + # + # Note: The following fields are mutually exclusive: `copying_source_disk_snapshot`, `creating_source_disk_snapshot`, `provisioning_target_disk`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] provisioning_target_disk + # @return [::Google::Cloud::VMMigration::V1::ProvisioningTargetDiskStep] + # Creating target disk step. + # + # Note: The following fields are mutually exclusive: `provisioning_target_disk`, `creating_source_disk_snapshot`, `copying_source_disk_snapshot`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [r] start_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time the step has started. + # @!attribute [r] end_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time the step has ended. + class DiskMigrationStep + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # CreatingSourceDiskSnapshotStep contains specific step details. + class CreatingSourceDiskSnapshotStep + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # CopyingSourceDiskSnapshotStep contains specific step details. + class CopyingSourceDiskSnapshotStep + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # ProvisioningTargetDiskStep contains specific step details. + class ProvisioningTargetDiskStep + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Compute Engine disk target details. + # @!attribute [rw] disk_id + # @return [::String] + # Optional. Target Compute Engine Disk ID. + # This is the resource ID segment of the Compute Engine Disk to create. + # In the resource name compute/v1/projects/\\{project}/zones/\\{zone}/disks/disk1 + # "disk1" is the resource ID for the disk. + # @!attribute [rw] zone + # @return [::String] + # Required. The Compute Engine zone in which to create the disk. Should be of + # the form: projects/\\{target-project}/locations/\\{zone} + # @!attribute [rw] replica_zones + # @return [::Array<::String>] + # Optional. Replication zones of the regional disk. Should be of the form: + # projects/\\{target-project}/locations/\\{replica-zone} + # Currently only one replica zone is supported. + # @!attribute [rw] disk_type + # @return [::Google::Cloud::VMMigration::V1::ComputeEngineDiskType] + # Required. The disk type to use. + class ComputeEngineDisk + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Represents the source AWS Disk details. + # @!attribute [rw] volume_id + # @return [::String] + # Required. AWS volume ID. + # @!attribute [r] size_gib + # @return [::Integer] + # Output only. Size in GiB. + # @!attribute [r] disk_type + # @return [::Google::Cloud::VMMigration::V1::AwsSourceDiskDetails::Type] + # Optional. Output only. Disk type. + # @!attribute [r] tags + # @return [::Google::Protobuf::Map{::String => ::String}] + # Optional. Output only. A map of AWS volume tags. + class AwsSourceDiskDetails + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class TagsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Possible values for disk types. + module Type + # Unspecified AWS disk type. Should not be used. + TYPE_UNSPECIFIED = 0 + + # GP2 disk type. + GP2 = 1 + + # GP3 disk type. + GP3 = 2 + + # IO1 disk type. + IO1 = 3 + + # IO2 disk type. + IO2 = 4 + + # ST1 disk type. + ST1 = 5 + + # SC1 disk type. + SC1 = 6 + + # Standard disk type. + STANDARD = 7 + end + end + + # Request message for 'CreateDiskMigrationJob' request. + # @!attribute [rw] parent + # @return [::String] + # Required. The DiskMigrationJob's parent. + # @!attribute [rw] disk_migration_job_id + # @return [::String] + # Required. The DiskMigrationJob identifier. + # The maximum length of this value is 63 characters. + # Valid characters are lower case Latin letters, digits and hyphen. + # It must start with a Latin letter and must not end with a hyphen. + # @!attribute [rw] disk_migration_job + # @return [::Google::Cloud::VMMigration::V1::DiskMigrationJob] + # Required. The create request body. + # @!attribute [rw] request_id + # @return [::String] + # Optional. A request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server will guarantee + # that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request timed out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + class CreateDiskMigrationJobRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for 'ListDiskMigrationJobsRequest' request. + # @!attribute [rw] parent + # @return [::String] + # Required. The parent, which owns this collection of DiskMigrationJobs. + # @!attribute [rw] page_size + # @return [::Integer] + # Optional. The maximum number of disk migration jobs to return. The service + # may return fewer than this value. If unspecified, at most 500 + # disk migration jobs will be returned. + # The maximum value is 1000; values above 1000 will be coerced to 1000. + # @!attribute [rw] page_token + # @return [::String] + # Optional. A page token, received from a previous `ListDiskMigrationJobs` + # call. Provide this to retrieve the subsequent page. + # + # When paginating, all parameters provided to `ListDiskMigrationJobs` + # except `page_size` must match the call that provided the page token. + # @!attribute [rw] filter + # @return [::String] + # Optional. The filter request (according to AIP-160). + # @!attribute [rw] order_by + # @return [::String] + # Optional. Ordering of the result list. + class ListDiskMigrationJobsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for 'ListDiskMigrationJobs' request. + # @!attribute [r] disk_migration_jobs + # @return [::Array<::Google::Cloud::VMMigration::V1::DiskMigrationJob>] + # Output only. The list of the disk migration jobs. + # @!attribute [r] next_page_token + # @return [::String] + # Optional. Output only. A token, which can be sent as `page_token` to + # retrieve the next page. If this field is omitted, there are no subsequent + # pages. + # @!attribute [r] unreachable + # @return [::Array<::String>] + # Output only. Locations that could not be reached. + class ListDiskMigrationJobsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for 'GetDiskMigrationJob' request. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the DiskMigrationJob. + class GetDiskMigrationJobRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for 'UpdateDiskMigrationJob' request. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # Optional. Field mask is used to specify the fields to be overwritten in the + # DiskMigrationJob resource by the update. + # The fields specified in the update_mask are relative to the resource, not + # the full request. A field will be overwritten if it is in the mask. If the + # user does not provide a mask, then a mask equivalent to all fields that are + # populated (have a non-empty value), will be implied. + # @!attribute [rw] disk_migration_job + # @return [::Google::Cloud::VMMigration::V1::DiskMigrationJob] + # Required. The update request body. + # @!attribute [rw] request_id + # @return [::String] + # Optional. A request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server will guarantee + # that for at least 60 minutes since the first request. + # + # For example, consider a situation where you make an initial request and + # the request timed out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + class UpdateDiskMigrationJobRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for 'DeleteDiskMigrationJob' request. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the DiskMigrationJob. + class DeleteDiskMigrationJobRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for 'RunDiskMigrationJobRequest' request. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the DiskMigrationJob. + class RunDiskMigrationJobRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for 'RunDiskMigrationJob' request. + class RunDiskMigrationJobResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for 'CancelDiskMigrationJob' request. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the DiskMigrationJob. + class CancelDiskMigrationJobRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for 'CancelDiskMigrationJob' request. + class CancelDiskMigrationJobResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Types of disks supported for Compute Engine VM. + module ComputeEngineDiskType + # An unspecified disk type. Will be used as STANDARD. + COMPUTE_ENGINE_DISK_TYPE_UNSPECIFIED = 0 + + # A Standard disk type. + COMPUTE_ENGINE_DISK_TYPE_STANDARD = 1 + + # SSD hard disk type. + COMPUTE_ENGINE_DISK_TYPE_SSD = 2 + + # An alternative to SSD persistent disks that balance performance and + # cost. + COMPUTE_ENGINE_DISK_TYPE_BALANCED = 3 + + # Hyperdisk balanced disk type. + COMPUTE_ENGINE_DISK_TYPE_HYPERDISK_BALANCED = 4 + end + + # Types of licenses used in OS adaptation. + module ComputeEngineLicenseType + # The license type is the default for the OS. + COMPUTE_ENGINE_LICENSE_TYPE_DEFAULT = 0 + + # The license type is Pay As You Go license type. + COMPUTE_ENGINE_LICENSE_TYPE_PAYG = 1 + + # The license type is Bring Your Own License type. + COMPUTE_ENGINE_LICENSE_TYPE_BYOL = 2 + end + + # Possible values for vm boot option. + module ComputeEngineBootOption + # The boot option is unknown. + COMPUTE_ENGINE_BOOT_OPTION_UNSPECIFIED = 0 + + # The boot option is EFI. + COMPUTE_ENGINE_BOOT_OPTION_EFI = 1 + + # The boot option is BIOS. + COMPUTE_ENGINE_BOOT_OPTION_BIOS = 2 + end + + # VM operating system (OS) capabilities needed for determining compatibility + # with Compute Engine features supported by the migration. + module OsCapability + # This is for API compatibility only and is not in use. + OS_CAPABILITY_UNSPECIFIED = 0 + + # NVMe driver installed and the VM can use NVMe PD or local SSD. + OS_CAPABILITY_NVME_STORAGE_ACCESS = 1 + + # gVNIC virtual NIC driver supported. + OS_CAPABILITY_GVNIC_NETWORK_INTERFACE = 2 + + # IDPF virtual NIC driver supported. + OS_CAPABILITY_IDPF_NETWORK_INTERFACE = 3 + end + + # Possible boot options conversions. + module BootConversion + # Unspecified conversion type. + BOOT_CONVERSION_UNSPECIFIED = 0 + + # No conversion. + NONE = 1 + + # Convert from BIOS to EFI. + BIOS_TO_EFI = 2 + end + + # Controls the level of details of a Utilization Report. + module UtilizationReportView + # The default / unset value. + # The API will default to FULL on single report request and BASIC for + # multiple reports request. + UTILIZATION_REPORT_VIEW_UNSPECIFIED = 0 + + # Get the report metadata, without the list of VMs and their utilization + # info. + BASIC = 1 + + # Include everything. + FULL = 2 + end + + # Controls the level of details of a Migrating VM. + module MigratingVmView + # View is unspecified. The API will fallback to the default value. + MIGRATING_VM_VIEW_UNSPECIFIED = 0 + + # Get the migrating VM basic details. + # The basic details do not include the recent clone jobs and recent cutover + # jobs lists. + MIGRATING_VM_VIEW_BASIC = 1 + + # Include everything. + MIGRATING_VM_VIEW_FULL = 2 + end + + # Possible values for the VM architecture. + module VmArchitecture + # The architecture is unknown. + VM_ARCHITECTURE_UNSPECIFIED = 0 + + # The architecture is one of the x86 architectures. + VM_ARCHITECTURE_X86_FAMILY = 1 + + # The architecture is ARM64. + VM_ARCHITECTURE_ARM64 = 2 + end + + # Describes the networking tier used for configuring network access + # configuration. + module ComputeEngineNetworkTier + # An unspecified network tier. Will be used as PREMIUM. + COMPUTE_ENGINE_NETWORK_TIER_UNSPECIFIED = 0 + + # A standard network tier. + NETWORK_TIER_STANDARD = 1 + + # A premium network tier. + NETWORK_TIER_PREMIUM = 2 + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-vm_migration-v1/proto_docs/google/iam/v1/iam_policy.rb b/owl-bot-staging/google-cloud-vm_migration-v1/proto_docs/google/iam/v1/iam_policy.rb new file mode 100644 index 000000000000..5445c77f8258 --- /dev/null +++ b/owl-bot-staging/google-cloud-vm_migration-v1/proto_docs/google/iam/v1/iam_policy.rb @@ -0,0 +1,87 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Iam + module V1 + # Request message for `SetIamPolicy` method. + # @!attribute [rw] resource + # @return [::String] + # REQUIRED: The resource for which the policy is being specified. + # See the operation documentation for the appropriate value for this field. + # @!attribute [rw] policy + # @return [::Google::Iam::V1::Policy] + # REQUIRED: The complete policy to be applied to the `resource`. The size of + # the policy is limited to a few 10s of KB. An empty policy is a + # valid policy but certain Cloud Platform services (such as Projects) + # might reject them. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only + # the fields in the mask will be modified. If no mask is provided, the + # following default mask is used: + # + # `paths: "bindings, etag"` + class SetIamPolicyRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for `GetIamPolicy` method. + # @!attribute [rw] resource + # @return [::String] + # REQUIRED: The resource for which the policy is being requested. + # See the operation documentation for the appropriate value for this field. + # @!attribute [rw] options + # @return [::Google::Iam::V1::GetPolicyOptions] + # OPTIONAL: A `GetPolicyOptions` object for specifying options to + # `GetIamPolicy`. + class GetIamPolicyRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for `TestIamPermissions` method. + # @!attribute [rw] resource + # @return [::String] + # REQUIRED: The resource for which the policy detail is being requested. + # See the operation documentation for the appropriate value for this field. + # @!attribute [rw] permissions + # @return [::Array<::String>] + # The set of permissions to check for the `resource`. Permissions with + # wildcards (such as '*' or 'storage.*') are not allowed. For more + # information see + # [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + class TestIamPermissionsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for `TestIamPermissions` method. + # @!attribute [rw] permissions + # @return [::Array<::String>] + # A subset of `TestPermissionsRequest.permissions` that the caller is + # allowed. + class TestIamPermissionsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end +end diff --git a/owl-bot-staging/google-cloud-vm_migration-v1/proto_docs/google/iam/v1/options.rb b/owl-bot-staging/google-cloud-vm_migration-v1/proto_docs/google/iam/v1/options.rb new file mode 100644 index 000000000000..60713d995b86 --- /dev/null +++ b/owl-bot-staging/google-cloud-vm_migration-v1/proto_docs/google/iam/v1/options.rb @@ -0,0 +1,50 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Iam + module V1 + # Encapsulates settings provided to GetIamPolicy. + # @!attribute [rw] requested_policy_version + # @return [::Integer] + # Optional. The maximum policy version that will be used to format the + # policy. + # + # Valid values are 0, 1, and 3. Requests specifying an invalid value will be + # rejected. + # + # Requests for policies with any conditional role bindings must specify + # version 3. Policies with no conditional role bindings may specify any valid + # value or leave the field unset. + # + # The policy in the response might use the policy version that you specified, + # or it might use a lower policy version. For example, if you specify version + # 3, but the policy has no conditional role bindings, the response uses + # version 1. + # + # To learn which resources support conditions in their IAM policies, see the + # [IAM + # documentation](https://cloud.google.com/iam/help/conditions/resource-policies). + class GetPolicyOptions + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end +end diff --git a/owl-bot-staging/google-cloud-vm_migration-v1/proto_docs/google/iam/v1/policy.rb b/owl-bot-staging/google-cloud-vm_migration-v1/proto_docs/google/iam/v1/policy.rb new file mode 100644 index 000000000000..999575b797df --- /dev/null +++ b/owl-bot-staging/google-cloud-vm_migration-v1/proto_docs/google/iam/v1/policy.rb @@ -0,0 +1,426 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Iam + module V1 + # An Identity and Access Management (IAM) policy, which specifies access + # controls for Google Cloud resources. + # + # + # A `Policy` is a collection of `bindings`. A `binding` binds one or more + # `members`, or principals, to a single `role`. Principals can be user + # accounts, service accounts, Google groups, and domains (such as G Suite). A + # `role` is a named list of permissions; each `role` can be an IAM predefined + # role or a user-created custom role. + # + # For some types of Google Cloud resources, a `binding` can also specify a + # `condition`, which is a logical expression that allows access to a resource + # only if the expression evaluates to `true`. A condition can add constraints + # based on attributes of the request, the resource, or both. To learn which + # resources support conditions in their IAM policies, see the + # [IAM + # documentation](https://cloud.google.com/iam/help/conditions/resource-policies). + # + # **JSON example:** + # + # ``` + # { + # "bindings": [ + # { + # "role": "roles/resourcemanager.organizationAdmin", + # "members": [ + # "user:mike@example.com", + # "group:admins@example.com", + # "domain:google.com", + # "serviceAccount:my-project-id@appspot.gserviceaccount.com" + # ] + # }, + # { + # "role": "roles/resourcemanager.organizationViewer", + # "members": [ + # "user:eve@example.com" + # ], + # "condition": { + # "title": "expirable access", + # "description": "Does not grant access after Sep 2020", + # "expression": "request.time < + # timestamp('2020-10-01T00:00:00.000Z')", + # } + # } + # ], + # "etag": "BwWWja0YfJA=", + # "version": 3 + # } + # ``` + # + # **YAML example:** + # + # ``` + # bindings: + # - members: + # - user:mike@example.com + # - group:admins@example.com + # - domain:google.com + # - serviceAccount:my-project-id@appspot.gserviceaccount.com + # role: roles/resourcemanager.organizationAdmin + # - members: + # - user:eve@example.com + # role: roles/resourcemanager.organizationViewer + # condition: + # title: expirable access + # description: Does not grant access after Sep 2020 + # expression: request.time < timestamp('2020-10-01T00:00:00.000Z') + # etag: BwWWja0YfJA= + # version: 3 + # ``` + # + # For a description of IAM and its features, see the + # [IAM documentation](https://cloud.google.com/iam/docs/). + # @!attribute [rw] version + # @return [::Integer] + # Specifies the format of the policy. + # + # Valid values are `0`, `1`, and `3`. Requests that specify an invalid value + # are rejected. + # + # Any operation that affects conditional role bindings must specify version + # `3`. This requirement applies to the following operations: + # + # * Getting a policy that includes a conditional role binding + # * Adding a conditional role binding to a policy + # * Changing a conditional role binding in a policy + # * Removing any role binding, with or without a condition, from a policy + # that includes conditions + # + # **Important:** If you use IAM Conditions, you must include the `etag` field + # whenever you call `setIamPolicy`. If you omit this field, then IAM allows + # you to overwrite a version `3` policy with a version `1` policy, and all of + # the conditions in the version `3` policy are lost. + # + # If a policy does not include any conditions, operations on that policy may + # specify any valid version or leave the field unset. + # + # To learn which resources support conditions in their IAM policies, see the + # [IAM + # documentation](https://cloud.google.com/iam/help/conditions/resource-policies). + # @!attribute [rw] bindings + # @return [::Array<::Google::Iam::V1::Binding>] + # Associates a list of `members`, or principals, with a `role`. Optionally, + # may specify a `condition` that determines how and when the `bindings` are + # applied. Each of the `bindings` must contain at least one principal. + # + # The `bindings` in a `Policy` can refer to up to 1,500 principals; up to 250 + # of these principals can be Google groups. Each occurrence of a principal + # counts towards these limits. For example, if the `bindings` grant 50 + # different roles to `user:alice@example.com`, and not to any other + # principal, then you can add another 1,450 principals to the `bindings` in + # the `Policy`. + # @!attribute [rw] audit_configs + # @return [::Array<::Google::Iam::V1::AuditConfig>] + # Specifies cloud audit logging configuration for this policy. + # @!attribute [rw] etag + # @return [::String] + # `etag` is used for optimistic concurrency control as a way to help + # prevent simultaneous updates of a policy from overwriting each other. + # It is strongly suggested that systems make use of the `etag` in the + # read-modify-write cycle to perform policy updates in order to avoid race + # conditions: An `etag` is returned in the response to `getIamPolicy`, and + # systems are expected to put that etag in the request to `setIamPolicy` to + # ensure that their change will be applied to the same version of the policy. + # + # **Important:** If you use IAM Conditions, you must include the `etag` field + # whenever you call `setIamPolicy`. If you omit this field, then IAM allows + # you to overwrite a version `3` policy with a version `1` policy, and all of + # the conditions in the version `3` policy are lost. + class Policy + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Associates `members`, or principals, with a `role`. + # @!attribute [rw] role + # @return [::String] + # Role that is assigned to the list of `members`, or principals. + # For example, `roles/viewer`, `roles/editor`, or `roles/owner`. + # @!attribute [rw] members + # @return [::Array<::String>] + # Specifies the principals requesting access for a Google Cloud resource. + # `members` can have the following values: + # + # * `allUsers`: A special identifier that represents anyone who is + # on the internet; with or without a Google account. + # + # * `allAuthenticatedUsers`: A special identifier that represents anyone + # who is authenticated with a Google account or a service account. + # + # * `user:{emailid}`: An email address that represents a specific Google + # account. For example, `alice@example.com` . + # + # + # * `serviceAccount:{emailid}`: An email address that represents a service + # account. For example, `my-other-app@appspot.gserviceaccount.com`. + # + # * `group:{emailid}`: An email address that represents a Google group. + # For example, `admins@example.com`. + # + # * `deleted:user:{emailid}?uid={uniqueid}`: An email address (plus unique + # identifier) representing a user that has been recently deleted. For + # example, `alice@example.com?uid=123456789012345678901`. If the user is + # recovered, this value reverts to `user:{emailid}` and the recovered user + # retains the role in the binding. + # + # * `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address (plus + # unique identifier) representing a service account that has been recently + # deleted. For example, + # `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`. + # If the service account is undeleted, this value reverts to + # `serviceAccount:{emailid}` and the undeleted service account retains the + # role in the binding. + # + # * `deleted:group:{emailid}?uid={uniqueid}`: An email address (plus unique + # identifier) representing a Google group that has been recently + # deleted. For example, `admins@example.com?uid=123456789012345678901`. If + # the group is recovered, this value reverts to `group:{emailid}` and the + # recovered group retains the role in the binding. + # + # + # * `domain:{domain}`: The G Suite domain (primary) that represents all the + # users of that domain. For example, `google.com` or `example.com`. + # @!attribute [rw] condition + # @return [::Google::Type::Expr] + # The condition that is associated with this binding. + # + # If the condition evaluates to `true`, then this binding applies to the + # current request. + # + # If the condition evaluates to `false`, then this binding does not apply to + # the current request. However, a different role binding might grant the same + # role to one or more of the principals in this binding. + # + # To learn which resources support conditions in their IAM policies, see the + # [IAM + # documentation](https://cloud.google.com/iam/help/conditions/resource-policies). + class Binding + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Specifies the audit configuration for a service. + # The configuration determines which permission types are logged, and what + # identities, if any, are exempted from logging. + # An AuditConfig must have one or more AuditLogConfigs. + # + # If there are AuditConfigs for both `allServices` and a specific service, + # the union of the two AuditConfigs is used for that service: the log_types + # specified in each AuditConfig are enabled, and the exempted_members in each + # AuditLogConfig are exempted. + # + # Example Policy with multiple AuditConfigs: + # + # { + # "audit_configs": [ + # { + # "service": "allServices", + # "audit_log_configs": [ + # { + # "log_type": "DATA_READ", + # "exempted_members": [ + # "user:jose@example.com" + # ] + # }, + # { + # "log_type": "DATA_WRITE" + # }, + # { + # "log_type": "ADMIN_READ" + # } + # ] + # }, + # { + # "service": "sampleservice.googleapis.com", + # "audit_log_configs": [ + # { + # "log_type": "DATA_READ" + # }, + # { + # "log_type": "DATA_WRITE", + # "exempted_members": [ + # "user:aliya@example.com" + # ] + # } + # ] + # } + # ] + # } + # + # For sampleservice, this policy enables DATA_READ, DATA_WRITE and ADMIN_READ + # logging. It also exempts `jose@example.com` from DATA_READ logging, and + # `aliya@example.com` from DATA_WRITE logging. + # @!attribute [rw] service + # @return [::String] + # Specifies a service that will be enabled for audit logging. + # For example, `storage.googleapis.com`, `cloudsql.googleapis.com`. + # `allServices` is a special value that covers all services. + # @!attribute [rw] audit_log_configs + # @return [::Array<::Google::Iam::V1::AuditLogConfig>] + # The configuration for logging of each type of permission. + class AuditConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Provides the configuration for logging a type of permissions. + # Example: + # + # { + # "audit_log_configs": [ + # { + # "log_type": "DATA_READ", + # "exempted_members": [ + # "user:jose@example.com" + # ] + # }, + # { + # "log_type": "DATA_WRITE" + # } + # ] + # } + # + # This enables 'DATA_READ' and 'DATA_WRITE' logging, while exempting + # jose@example.com from DATA_READ logging. + # @!attribute [rw] log_type + # @return [::Google::Iam::V1::AuditLogConfig::LogType] + # The log type that this config enables. + # @!attribute [rw] exempted_members + # @return [::Array<::String>] + # Specifies the identities that do not cause logging for this type of + # permission. + # Follows the same format of + # [Binding.members][google.iam.v1.Binding.members]. + class AuditLogConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The list of valid permission types for which logging can be configured. + # Admin writes are always logged, and are not configurable. + module LogType + # Default case. Should never be this. + LOG_TYPE_UNSPECIFIED = 0 + + # Admin reads. Example: CloudIAM getIamPolicy + ADMIN_READ = 1 + + # Data writes. Example: CloudSQL Users create + DATA_WRITE = 2 + + # Data reads. Example: CloudSQL Users list + DATA_READ = 3 + end + end + + # The difference delta between two policies. + # @!attribute [rw] binding_deltas + # @return [::Array<::Google::Iam::V1::BindingDelta>] + # The delta for Bindings between two policies. + # @!attribute [rw] audit_config_deltas + # @return [::Array<::Google::Iam::V1::AuditConfigDelta>] + # The delta for AuditConfigs between two policies. + class PolicyDelta + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # One delta entry for Binding. Each individual change (only one member in each + # entry) to a binding will be a separate entry. + # @!attribute [rw] action + # @return [::Google::Iam::V1::BindingDelta::Action] + # The action that was performed on a Binding. + # Required + # @!attribute [rw] role + # @return [::String] + # Role that is assigned to `members`. + # For example, `roles/viewer`, `roles/editor`, or `roles/owner`. + # Required + # @!attribute [rw] member + # @return [::String] + # A single identity requesting access for a Google Cloud resource. + # Follows the same format of Binding.members. + # Required + # @!attribute [rw] condition + # @return [::Google::Type::Expr] + # The condition that is associated with this binding. + class BindingDelta + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The type of action performed on a Binding in a policy. + module Action + # Unspecified. + ACTION_UNSPECIFIED = 0 + + # Addition of a Binding. + ADD = 1 + + # Removal of a Binding. + REMOVE = 2 + end + end + + # One delta entry for AuditConfig. Each individual change (only one + # exempted_member in each entry) to a AuditConfig will be a separate entry. + # @!attribute [rw] action + # @return [::Google::Iam::V1::AuditConfigDelta::Action] + # The action that was performed on an audit configuration in a policy. + # Required + # @!attribute [rw] service + # @return [::String] + # Specifies a service that was configured for Cloud Audit Logging. + # For example, `storage.googleapis.com`, `cloudsql.googleapis.com`. + # `allServices` is a special value that covers all services. + # Required + # @!attribute [rw] exempted_member + # @return [::String] + # A single identity that is exempted from "data access" audit + # logging for the `service` specified above. + # Follows the same format of Binding.members. + # @!attribute [rw] log_type + # @return [::String] + # Specifies the log_type that was be enabled. ADMIN_ACTIVITY is always + # enabled, and cannot be configured. + # Required + class AuditConfigDelta + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The type of action performed on an audit configuration in a policy. + module Action + # Unspecified. + ACTION_UNSPECIFIED = 0 + + # Addition of an audit configuration. + ADD = 1 + + # Removal of an audit configuration. + REMOVE = 2 + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-vm_migration-v1/proto_docs/google/longrunning/operations.rb b/owl-bot-staging/google-cloud-vm_migration-v1/proto_docs/google/longrunning/operations.rb new file mode 100644 index 000000000000..7a757f512165 --- /dev/null +++ b/owl-bot-staging/google-cloud-vm_migration-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-vm_migration-v1/proto_docs/google/protobuf/any.rb b/owl-bot-staging/google-cloud-vm_migration-v1/proto_docs/google/protobuf/any.rb new file mode 100644 index 000000000000..58691995f02e --- /dev/null +++ b/owl-bot-staging/google-cloud-vm_migration-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-vm_migration-v1/proto_docs/google/protobuf/duration.rb b/owl-bot-staging/google-cloud-vm_migration-v1/proto_docs/google/protobuf/duration.rb new file mode 100644 index 000000000000..ea59f1f91daf --- /dev/null +++ b/owl-bot-staging/google-cloud-vm_migration-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-vm_migration-v1/proto_docs/google/protobuf/empty.rb b/owl-bot-staging/google-cloud-vm_migration-v1/proto_docs/google/protobuf/empty.rb new file mode 100644 index 000000000000..83e4481834a6 --- /dev/null +++ b/owl-bot-staging/google-cloud-vm_migration-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-vm_migration-v1/proto_docs/google/protobuf/field_mask.rb b/owl-bot-staging/google-cloud-vm_migration-v1/proto_docs/google/protobuf/field_mask.rb new file mode 100644 index 000000000000..7f3ffc78601a --- /dev/null +++ b/owl-bot-staging/google-cloud-vm_migration-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-vm_migration-v1/proto_docs/google/protobuf/timestamp.rb b/owl-bot-staging/google-cloud-vm_migration-v1/proto_docs/google/protobuf/timestamp.rb new file mode 100644 index 000000000000..74352be9c58c --- /dev/null +++ b/owl-bot-staging/google-cloud-vm_migration-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-vm_migration-v1/proto_docs/google/rpc/error_details.rb b/owl-bot-staging/google-cloud-vm_migration-v1/proto_docs/google/rpc/error_details.rb new file mode 100644 index 000000000000..507d2b54094a --- /dev/null +++ b/owl-bot-staging/google-cloud-vm_migration-v1/proto_docs/google/rpc/error_details.rb @@ -0,0 +1,420 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 + # Describes the cause of the error with structured details. + # + # Example of an error when contacting the "pubsub.googleapis.com" API when it + # is not enabled: + # + # { "reason": "API_DISABLED" + # "domain": "googleapis.com" + # "metadata": { + # "resource": "projects/123", + # "service": "pubsub.googleapis.com" + # } + # } + # + # This response indicates that the pubsub.googleapis.com API is not enabled. + # + # Example of an error that is returned when attempting to create a Spanner + # instance in a region that is out of stock: + # + # { "reason": "STOCKOUT" + # "domain": "spanner.googleapis.com", + # "metadata": { + # "availableRegions": "us-central1,us-east2" + # } + # } + # @!attribute [rw] reason + # @return [::String] + # The reason of the error. This is a constant value that identifies the + # proximate cause of the error. Error reasons are unique within a particular + # domain of errors. This should be at most 63 characters and match a + # regular expression of `[A-Z][A-Z0-9_]+[A-Z0-9]`, which represents + # UPPER_SNAKE_CASE. + # @!attribute [rw] domain + # @return [::String] + # The logical grouping to which the "reason" belongs. The error domain + # is typically the registered service name of the tool or product that + # generates the error. Example: "pubsub.googleapis.com". If the error is + # generated by some common infrastructure, the error domain must be a + # globally unique value that identifies the infrastructure. For Google API + # infrastructure, the error domain is "googleapis.com". + # @!attribute [rw] metadata + # @return [::Google::Protobuf::Map{::String => ::String}] + # Additional structured details about this error. + # + # Keys must match a regular expression of `[a-z][a-zA-Z0-9-_]+` but should + # ideally be lowerCamelCase. Also, they must be limited to 64 characters in + # length. When identifying the current value of an exceeded limit, the units + # should be contained in the key, not the value. For example, rather than + # `{"instanceLimit": "100/request"}`, should be returned as, + # `{"instanceLimitPerRequest": "100"}`, if the client exceeds the number of + # instances that can be created in a single (batch) request. + class ErrorInfo + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class MetadataEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Describes when the clients can retry a failed request. Clients could ignore + # the recommendation here or retry when this information is missing from error + # responses. + # + # It's always recommended that clients should use exponential backoff when + # retrying. + # + # Clients should wait until `retry_delay` amount of time has passed since + # receiving the error response before retrying. If retrying requests also + # fail, clients should use an exponential backoff scheme to gradually increase + # the delay between retries based on `retry_delay`, until either a maximum + # number of retries have been reached or a maximum retry delay cap has been + # reached. + # @!attribute [rw] retry_delay + # @return [::Google::Protobuf::Duration] + # Clients should wait at least this long between retrying the same request. + class RetryInfo + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes additional debugging info. + # @!attribute [rw] stack_entries + # @return [::Array<::String>] + # The stack trace entries indicating where the error occurred. + # @!attribute [rw] detail + # @return [::String] + # Additional debugging information provided by the server. + class DebugInfo + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes how a quota check failed. + # + # For example if a daily limit was exceeded for the calling project, + # a service could respond with a QuotaFailure detail containing the project + # id and the description of the quota limit that was exceeded. If the + # calling project hasn't enabled the service in the developer console, then + # a service could respond with the project id and set `service_disabled` + # to true. + # + # Also see RetryInfo and Help types for other details about handling a + # quota failure. + # @!attribute [rw] violations + # @return [::Array<::Google::Rpc::QuotaFailure::Violation>] + # Describes all quota violations. + class QuotaFailure + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # A message type used to describe a single quota violation. For example, a + # daily quota or a custom quota that was exceeded. + # @!attribute [rw] subject + # @return [::String] + # The subject on which the quota check failed. + # For example, "clientip:" or "project:". + # @!attribute [rw] description + # @return [::String] + # A description of how the quota check failed. Clients can use this + # description to find more about the quota configuration in the service's + # public documentation, or find the relevant quota limit to adjust through + # developer console. + # + # For example: "Service disabled" or "Daily Limit for read operations + # exceeded". + # @!attribute [rw] api_service + # @return [::String] + # The API Service from which the `QuotaFailure.Violation` orginates. In + # some cases, Quota issues originate from an API Service other than the one + # that was called. In other words, a dependency of the called API Service + # could be the cause of the `QuotaFailure`, and this field would have the + # dependency API service name. + # + # For example, if the called API is Kubernetes Engine API + # (container.googleapis.com), and a quota violation occurs in the + # Kubernetes Engine API itself, this field would be + # "container.googleapis.com". On the other hand, if the quota violation + # occurs when the Kubernetes Engine API creates VMs in the Compute Engine + # API (compute.googleapis.com), this field would be + # "compute.googleapis.com". + # @!attribute [rw] quota_metric + # @return [::String] + # The metric of the violated quota. A quota metric is a named counter to + # measure usage, such as API requests or CPUs. When an activity occurs in a + # service, such as Virtual Machine allocation, one or more quota metrics + # may be affected. + # + # For example, "compute.googleapis.com/cpus_per_vm_family", + # "storage.googleapis.com/internet_egress_bandwidth". + # @!attribute [rw] quota_id + # @return [::String] + # The id of the violated quota. Also know as "limit name", this is the + # unique identifier of a quota in the context of an API service. + # + # For example, "CPUS-PER-VM-FAMILY-per-project-region". + # @!attribute [rw] quota_dimensions + # @return [::Google::Protobuf::Map{::String => ::String}] + # The dimensions of the violated quota. Every non-global quota is enforced + # on a set of dimensions. While quota metric defines what to count, the + # dimensions specify for what aspects the counter should be increased. + # + # For example, the quota "CPUs per region per VM family" enforces a limit + # on the metric "compute.googleapis.com/cpus_per_vm_family" on dimensions + # "region" and "vm_family". And if the violation occurred in region + # "us-central1" and for VM family "n1", the quota_dimensions would be, + # + # { + # "region": "us-central1", + # "vm_family": "n1", + # } + # + # When a quota is enforced globally, the quota_dimensions would always be + # empty. + # @!attribute [rw] quota_value + # @return [::Integer] + # The enforced quota value at the time of the `QuotaFailure`. + # + # For example, if the enforced quota value at the time of the + # `QuotaFailure` on the number of CPUs is "10", then the value of this + # field would reflect this quantity. + # @!attribute [rw] future_quota_value + # @return [::Integer] + # The new quota value being rolled out at the time of the violation. At the + # completion of the rollout, this value will be enforced in place of + # quota_value. If no rollout is in progress at the time of the violation, + # this field is not set. + # + # For example, if at the time of the violation a rollout is in progress + # changing the number of CPUs quota from 10 to 20, 20 would be the value of + # this field. + class Violation + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class QuotaDimensionsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + + # Describes what preconditions have failed. + # + # For example, if an RPC failed because it required the Terms of Service to be + # acknowledged, it could list the terms of service violation in the + # PreconditionFailure message. + # @!attribute [rw] violations + # @return [::Array<::Google::Rpc::PreconditionFailure::Violation>] + # Describes all precondition violations. + class PreconditionFailure + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # A message type used to describe a single precondition failure. + # @!attribute [rw] type + # @return [::String] + # The type of PreconditionFailure. We recommend using a service-specific + # enum type to define the supported precondition violation subjects. For + # example, "TOS" for "Terms of Service violation". + # @!attribute [rw] subject + # @return [::String] + # The subject, relative to the type, that failed. + # For example, "google.com/cloud" relative to the "TOS" type would indicate + # which terms of service is being referenced. + # @!attribute [rw] description + # @return [::String] + # A description of how the precondition failed. Developers can use this + # description to understand how to fix the failure. + # + # For example: "Terms of service not accepted". + class Violation + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Describes violations in a client request. This error type focuses on the + # syntactic aspects of the request. + # @!attribute [rw] field_violations + # @return [::Array<::Google::Rpc::BadRequest::FieldViolation>] + # Describes all violations in a client request. + class BadRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # A message type used to describe a single bad request field. + # @!attribute [rw] field + # @return [::String] + # A path that leads to a field in the request body. The value will be a + # sequence of dot-separated identifiers that identify a protocol buffer + # field. + # + # Consider the following: + # + # message CreateContactRequest { + # message EmailAddress { + # enum Type { + # TYPE_UNSPECIFIED = 0; + # HOME = 1; + # WORK = 2; + # } + # + # optional string email = 1; + # repeated EmailType type = 2; + # } + # + # string full_name = 1; + # repeated EmailAddress email_addresses = 2; + # } + # + # In this example, in proto `field` could take one of the following values: + # + # * `full_name` for a violation in the `full_name` value + # * `email_addresses[0].email` for a violation in the `email` field of the + # first `email_addresses` message + # * `email_addresses[2].type[1]` for a violation in the second `type` + # value in the third `email_addresses` message. + # + # In JSON, the same values are represented as: + # + # * `fullName` for a violation in the `fullName` value + # * `emailAddresses[0].email` for a violation in the `email` field of the + # first `emailAddresses` message + # * `emailAddresses[2].type[1]` for a violation in the second `type` + # value in the third `emailAddresses` message. + # @!attribute [rw] description + # @return [::String] + # A description of why the request element is bad. + # @!attribute [rw] reason + # @return [::String] + # The reason of the field-level error. This is a constant value that + # identifies the proximate cause of the field-level error. It should + # uniquely identify the type of the FieldViolation within the scope of the + # google.rpc.ErrorInfo.domain. This should be at most 63 + # characters and match a regular expression of `[A-Z][A-Z0-9_]+[A-Z0-9]`, + # which represents UPPER_SNAKE_CASE. + # @!attribute [rw] localized_message + # @return [::Google::Rpc::LocalizedMessage] + # Provides a localized error message for field-level errors that is safe to + # return to the API consumer. + class FieldViolation + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Contains metadata about the request that clients can attach when filing a bug + # or providing other forms of feedback. + # @!attribute [rw] request_id + # @return [::String] + # An opaque string that should only be interpreted by the service generating + # it. For example, it can be used to identify requests in the service's logs. + # @!attribute [rw] serving_data + # @return [::String] + # Any data that was used to serve this request. For example, an encrypted + # stack trace that can be sent back to the service provider for debugging. + class RequestInfo + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes the resource that is being accessed. + # @!attribute [rw] resource_type + # @return [::String] + # A name for the type of resource being accessed, e.g. "sql table", + # "cloud storage bucket", "file", "Google calendar"; or the type URL + # of the resource: e.g. "type.googleapis.com/google.pubsub.v1.Topic". + # @!attribute [rw] resource_name + # @return [::String] + # The name of the resource being accessed. For example, a shared calendar + # name: "example.com_4fghdhgsrgh@group.calendar.google.com", if the current + # error is + # [google.rpc.Code.PERMISSION_DENIED][google.rpc.Code.PERMISSION_DENIED]. + # @!attribute [rw] owner + # @return [::String] + # The owner of the resource (optional). + # For example, "user:" or "project:". + # @!attribute [rw] description + # @return [::String] + # Describes what error is encountered when accessing this resource. + # For example, updating a cloud project may require the `writer` permission + # on the developer console project. + class ResourceInfo + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Provides links to documentation or for performing an out of band action. + # + # For example, if a quota check failed with an error indicating the calling + # project hasn't enabled the accessed service, this can contain a URL pointing + # directly to the right place in the developer console to flip the bit. + # @!attribute [rw] links + # @return [::Array<::Google::Rpc::Help::Link>] + # URL(s) pointing to additional information on handling the current error. + class Help + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes a URL link. + # @!attribute [rw] description + # @return [::String] + # Describes what the link offers. + # @!attribute [rw] url + # @return [::String] + # The URL of the link. + class Link + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Provides a localized error message that is safe to return to the user + # which can be attached to an RPC error. + # @!attribute [rw] locale + # @return [::String] + # The locale used following the specification defined at + # https://www.rfc-editor.org/rfc/bcp/bcp47.txt. + # Examples are: "en-US", "fr-CH", "es-MX" + # @!attribute [rw] message + # @return [::String] + # The localized error message in the above locale. + class LocalizedMessage + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-vm_migration-v1/proto_docs/google/rpc/status.rb b/owl-bot-staging/google-cloud-vm_migration-v1/proto_docs/google/rpc/status.rb new file mode 100644 index 000000000000..c1a1c07eb2db --- /dev/null +++ b/owl-bot-staging/google-cloud-vm_migration-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-vm_migration-v1/proto_docs/google/type/expr.rb b/owl-bot-staging/google-cloud-vm_migration-v1/proto_docs/google/type/expr.rb new file mode 100644 index 000000000000..53e7733b6592 --- /dev/null +++ b/owl-bot-staging/google-cloud-vm_migration-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-vm_migration-v1/snippets/Gemfile b/owl-bot-staging/google-cloud-vm_migration-v1/snippets/Gemfile new file mode 100644 index 000000000000..02cd5c2e3673 --- /dev/null +++ b/owl-bot-staging/google-cloud-vm_migration-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-vm_migration-v1", path: "../" +else + gem "google-cloud-vm_migration-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-vm_migration-v1/snippets/iam_policy/get_iam_policy.rb b/owl-bot-staging/google-cloud-vm_migration-v1/snippets/iam_policy/get_iam_policy.rb new file mode 100644 index 000000000000..3ebfe81dd14c --- /dev/null +++ b/owl-bot-staging/google-cloud-vm_migration-v1/snippets/iam_policy/get_iam_policy.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 vmmigration_v1_generated_IAMPolicy_GetIamPolicy_sync] +require "google/iam/v1" + +## +# Snippet for the get_iam_policy call in the IAMPolicy 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::Iam::V1::IAMPolicy::Client#get_iam_policy. +# +def get_iam_policy + # Create a client object. The client can be reused for multiple calls. + client = Google::Iam::V1::IAMPolicy::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::V1::GetIamPolicyRequest.new + + # Call the get_iam_policy method. + result = client.get_iam_policy request + + # The returned object is of type Google::Iam::V1::Policy. + p result +end +# [END vmmigration_v1_generated_IAMPolicy_GetIamPolicy_sync] diff --git a/owl-bot-staging/google-cloud-vm_migration-v1/snippets/iam_policy/set_iam_policy.rb b/owl-bot-staging/google-cloud-vm_migration-v1/snippets/iam_policy/set_iam_policy.rb new file mode 100644 index 000000000000..eeeac89c8e95 --- /dev/null +++ b/owl-bot-staging/google-cloud-vm_migration-v1/snippets/iam_policy/set_iam_policy.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 vmmigration_v1_generated_IAMPolicy_SetIamPolicy_sync] +require "google/iam/v1" + +## +# Snippet for the set_iam_policy call in the IAMPolicy 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::Iam::V1::IAMPolicy::Client#set_iam_policy. +# +def set_iam_policy + # Create a client object. The client can be reused for multiple calls. + client = Google::Iam::V1::IAMPolicy::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::V1::SetIamPolicyRequest.new + + # Call the set_iam_policy method. + result = client.set_iam_policy request + + # The returned object is of type Google::Iam::V1::Policy. + p result +end +# [END vmmigration_v1_generated_IAMPolicy_SetIamPolicy_sync] diff --git a/owl-bot-staging/google-cloud-vm_migration-v1/snippets/iam_policy/test_iam_permissions.rb b/owl-bot-staging/google-cloud-vm_migration-v1/snippets/iam_policy/test_iam_permissions.rb new file mode 100644 index 000000000000..ef4eeafad7d0 --- /dev/null +++ b/owl-bot-staging/google-cloud-vm_migration-v1/snippets/iam_policy/test_iam_permissions.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 vmmigration_v1_generated_IAMPolicy_TestIamPermissions_sync] +require "google/iam/v1" + +## +# Snippet for the test_iam_permissions call in the IAMPolicy 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::Iam::V1::IAMPolicy::Client#test_iam_permissions. +# +def test_iam_permissions + # Create a client object. The client can be reused for multiple calls. + client = Google::Iam::V1::IAMPolicy::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::V1::TestIamPermissionsRequest.new + + # Call the test_iam_permissions method. + result = client.test_iam_permissions request + + # The returned object is of type Google::Iam::V1::TestIamPermissionsResponse. + p result +end +# [END vmmigration_v1_generated_IAMPolicy_TestIamPermissions_sync] diff --git a/owl-bot-staging/google-cloud-vm_migration-v1/snippets/snippet_metadata_google.cloud.vmmigration.v1.json b/owl-bot-staging/google-cloud-vm_migration-v1/snippets/snippet_metadata_google.cloud.vmmigration.v1.json new file mode 100644 index 000000000000..8ccbb24bf2d8 --- /dev/null +++ b/owl-bot-staging/google-cloud-vm_migration-v1/snippets/snippet_metadata_google.cloud.vmmigration.v1.json @@ -0,0 +1,2495 @@ +{ + "client_library": { + "name": "google-cloud-vm_migration-v1", + "version": "", + "language": "RUBY", + "apis": [ + { + "id": "google.cloud.vmmigration.v1", + "version": "v1" + } + ] + }, + "snippets": [ + { + "region_tag": "vmmigration_v1_generated_VMMigration_ListSources_sync", + "title": "Snippet for the list_sources call in the VMMigration service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VMMigration::V1::VMMigration::Client#list_sources.", + "file": "vm_migration/list_sources.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_sources", + "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client#list_sources", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VMMigration::V1::ListSourcesRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::VMMigration::V1::ListSourcesResponse", + "client": { + "short_name": "VMMigration::Client", + "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client" + }, + "method": { + "short_name": "ListSources", + "full_name": "google.cloud.vmmigration.v1.VmMigration.ListSources", + "service": { + "short_name": "VmMigration", + "full_name": "google.cloud.vmmigration.v1.VmMigration" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "vmmigration_v1_generated_VMMigration_GetSource_sync", + "title": "Snippet for the get_source call in the VMMigration service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VMMigration::V1::VMMigration::Client#get_source.", + "file": "vm_migration/get_source.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_source", + "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client#get_source", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VMMigration::V1::GetSourceRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::VMMigration::V1::Source", + "client": { + "short_name": "VMMigration::Client", + "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client" + }, + "method": { + "short_name": "GetSource", + "full_name": "google.cloud.vmmigration.v1.VmMigration.GetSource", + "service": { + "short_name": "VmMigration", + "full_name": "google.cloud.vmmigration.v1.VmMigration" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "vmmigration_v1_generated_VMMigration_CreateSource_sync", + "title": "Snippet for the create_source call in the VMMigration service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VMMigration::V1::VMMigration::Client#create_source.", + "file": "vm_migration/create_source.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_source", + "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client#create_source", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VMMigration::V1::CreateSourceRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "VMMigration::Client", + "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client" + }, + "method": { + "short_name": "CreateSource", + "full_name": "google.cloud.vmmigration.v1.VmMigration.CreateSource", + "service": { + "short_name": "VmMigration", + "full_name": "google.cloud.vmmigration.v1.VmMigration" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "vmmigration_v1_generated_VMMigration_UpdateSource_sync", + "title": "Snippet for the update_source call in the VMMigration service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VMMigration::V1::VMMigration::Client#update_source.", + "file": "vm_migration/update_source.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_source", + "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client#update_source", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VMMigration::V1::UpdateSourceRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "VMMigration::Client", + "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client" + }, + "method": { + "short_name": "UpdateSource", + "full_name": "google.cloud.vmmigration.v1.VmMigration.UpdateSource", + "service": { + "short_name": "VmMigration", + "full_name": "google.cloud.vmmigration.v1.VmMigration" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "vmmigration_v1_generated_VMMigration_DeleteSource_sync", + "title": "Snippet for the delete_source call in the VMMigration service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VMMigration::V1::VMMigration::Client#delete_source.", + "file": "vm_migration/delete_source.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_source", + "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client#delete_source", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VMMigration::V1::DeleteSourceRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "VMMigration::Client", + "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client" + }, + "method": { + "short_name": "DeleteSource", + "full_name": "google.cloud.vmmigration.v1.VmMigration.DeleteSource", + "service": { + "short_name": "VmMigration", + "full_name": "google.cloud.vmmigration.v1.VmMigration" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "vmmigration_v1_generated_VMMigration_FetchInventory_sync", + "title": "Snippet for the fetch_inventory call in the VMMigration service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VMMigration::V1::VMMigration::Client#fetch_inventory.", + "file": "vm_migration/fetch_inventory.rb", + "language": "RUBY", + "client_method": { + "short_name": "fetch_inventory", + "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client#fetch_inventory", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VMMigration::V1::FetchInventoryRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::VMMigration::V1::FetchInventoryResponse", + "client": { + "short_name": "VMMigration::Client", + "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client" + }, + "method": { + "short_name": "FetchInventory", + "full_name": "google.cloud.vmmigration.v1.VmMigration.FetchInventory", + "service": { + "short_name": "VmMigration", + "full_name": "google.cloud.vmmigration.v1.VmMigration" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "vmmigration_v1_generated_VMMigration_FetchStorageInventory_sync", + "title": "Snippet for the fetch_storage_inventory call in the VMMigration service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VMMigration::V1::VMMigration::Client#fetch_storage_inventory.", + "file": "vm_migration/fetch_storage_inventory.rb", + "language": "RUBY", + "client_method": { + "short_name": "fetch_storage_inventory", + "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client#fetch_storage_inventory", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VMMigration::V1::FetchStorageInventoryRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::VMMigration::V1::FetchStorageInventoryResponse", + "client": { + "short_name": "VMMigration::Client", + "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client" + }, + "method": { + "short_name": "FetchStorageInventory", + "full_name": "google.cloud.vmmigration.v1.VmMigration.FetchStorageInventory", + "service": { + "short_name": "VmMigration", + "full_name": "google.cloud.vmmigration.v1.VmMigration" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "vmmigration_v1_generated_VMMigration_ListUtilizationReports_sync", + "title": "Snippet for the list_utilization_reports call in the VMMigration service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VMMigration::V1::VMMigration::Client#list_utilization_reports.", + "file": "vm_migration/list_utilization_reports.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_utilization_reports", + "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client#list_utilization_reports", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VMMigration::V1::ListUtilizationReportsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::VMMigration::V1::ListUtilizationReportsResponse", + "client": { + "short_name": "VMMigration::Client", + "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client" + }, + "method": { + "short_name": "ListUtilizationReports", + "full_name": "google.cloud.vmmigration.v1.VmMigration.ListUtilizationReports", + "service": { + "short_name": "VmMigration", + "full_name": "google.cloud.vmmigration.v1.VmMigration" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "vmmigration_v1_generated_VMMigration_GetUtilizationReport_sync", + "title": "Snippet for the get_utilization_report call in the VMMigration service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VMMigration::V1::VMMigration::Client#get_utilization_report.", + "file": "vm_migration/get_utilization_report.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_utilization_report", + "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client#get_utilization_report", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VMMigration::V1::GetUtilizationReportRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::VMMigration::V1::UtilizationReport", + "client": { + "short_name": "VMMigration::Client", + "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client" + }, + "method": { + "short_name": "GetUtilizationReport", + "full_name": "google.cloud.vmmigration.v1.VmMigration.GetUtilizationReport", + "service": { + "short_name": "VmMigration", + "full_name": "google.cloud.vmmigration.v1.VmMigration" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "vmmigration_v1_generated_VMMigration_CreateUtilizationReport_sync", + "title": "Snippet for the create_utilization_report call in the VMMigration service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VMMigration::V1::VMMigration::Client#create_utilization_report.", + "file": "vm_migration/create_utilization_report.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_utilization_report", + "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client#create_utilization_report", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VMMigration::V1::CreateUtilizationReportRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "VMMigration::Client", + "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client" + }, + "method": { + "short_name": "CreateUtilizationReport", + "full_name": "google.cloud.vmmigration.v1.VmMigration.CreateUtilizationReport", + "service": { + "short_name": "VmMigration", + "full_name": "google.cloud.vmmigration.v1.VmMigration" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "vmmigration_v1_generated_VMMigration_DeleteUtilizationReport_sync", + "title": "Snippet for the delete_utilization_report call in the VMMigration service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VMMigration::V1::VMMigration::Client#delete_utilization_report.", + "file": "vm_migration/delete_utilization_report.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_utilization_report", + "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client#delete_utilization_report", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VMMigration::V1::DeleteUtilizationReportRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "VMMigration::Client", + "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client" + }, + "method": { + "short_name": "DeleteUtilizationReport", + "full_name": "google.cloud.vmmigration.v1.VmMigration.DeleteUtilizationReport", + "service": { + "short_name": "VmMigration", + "full_name": "google.cloud.vmmigration.v1.VmMigration" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "vmmigration_v1_generated_VMMigration_ListDatacenterConnectors_sync", + "title": "Snippet for the list_datacenter_connectors call in the VMMigration service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VMMigration::V1::VMMigration::Client#list_datacenter_connectors.", + "file": "vm_migration/list_datacenter_connectors.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_datacenter_connectors", + "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client#list_datacenter_connectors", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VMMigration::V1::ListDatacenterConnectorsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::VMMigration::V1::ListDatacenterConnectorsResponse", + "client": { + "short_name": "VMMigration::Client", + "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client" + }, + "method": { + "short_name": "ListDatacenterConnectors", + "full_name": "google.cloud.vmmigration.v1.VmMigration.ListDatacenterConnectors", + "service": { + "short_name": "VmMigration", + "full_name": "google.cloud.vmmigration.v1.VmMigration" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "vmmigration_v1_generated_VMMigration_GetDatacenterConnector_sync", + "title": "Snippet for the get_datacenter_connector call in the VMMigration service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VMMigration::V1::VMMigration::Client#get_datacenter_connector.", + "file": "vm_migration/get_datacenter_connector.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_datacenter_connector", + "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client#get_datacenter_connector", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VMMigration::V1::GetDatacenterConnectorRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::VMMigration::V1::DatacenterConnector", + "client": { + "short_name": "VMMigration::Client", + "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client" + }, + "method": { + "short_name": "GetDatacenterConnector", + "full_name": "google.cloud.vmmigration.v1.VmMigration.GetDatacenterConnector", + "service": { + "short_name": "VmMigration", + "full_name": "google.cloud.vmmigration.v1.VmMigration" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "vmmigration_v1_generated_VMMigration_CreateDatacenterConnector_sync", + "title": "Snippet for the create_datacenter_connector call in the VMMigration service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VMMigration::V1::VMMigration::Client#create_datacenter_connector.", + "file": "vm_migration/create_datacenter_connector.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_datacenter_connector", + "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client#create_datacenter_connector", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VMMigration::V1::CreateDatacenterConnectorRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "VMMigration::Client", + "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client" + }, + "method": { + "short_name": "CreateDatacenterConnector", + "full_name": "google.cloud.vmmigration.v1.VmMigration.CreateDatacenterConnector", + "service": { + "short_name": "VmMigration", + "full_name": "google.cloud.vmmigration.v1.VmMigration" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "vmmigration_v1_generated_VMMigration_DeleteDatacenterConnector_sync", + "title": "Snippet for the delete_datacenter_connector call in the VMMigration service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VMMigration::V1::VMMigration::Client#delete_datacenter_connector.", + "file": "vm_migration/delete_datacenter_connector.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_datacenter_connector", + "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client#delete_datacenter_connector", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VMMigration::V1::DeleteDatacenterConnectorRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "VMMigration::Client", + "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client" + }, + "method": { + "short_name": "DeleteDatacenterConnector", + "full_name": "google.cloud.vmmigration.v1.VmMigration.DeleteDatacenterConnector", + "service": { + "short_name": "VmMigration", + "full_name": "google.cloud.vmmigration.v1.VmMigration" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "vmmigration_v1_generated_VMMigration_UpgradeAppliance_sync", + "title": "Snippet for the upgrade_appliance call in the VMMigration service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VMMigration::V1::VMMigration::Client#upgrade_appliance.", + "file": "vm_migration/upgrade_appliance.rb", + "language": "RUBY", + "client_method": { + "short_name": "upgrade_appliance", + "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client#upgrade_appliance", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VMMigration::V1::UpgradeApplianceRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "VMMigration::Client", + "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client" + }, + "method": { + "short_name": "UpgradeAppliance", + "full_name": "google.cloud.vmmigration.v1.VmMigration.UpgradeAppliance", + "service": { + "short_name": "VmMigration", + "full_name": "google.cloud.vmmigration.v1.VmMigration" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "vmmigration_v1_generated_VMMigration_CreateMigratingVm_sync", + "title": "Snippet for the create_migrating_vm call in the VMMigration service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VMMigration::V1::VMMigration::Client#create_migrating_vm.", + "file": "vm_migration/create_migrating_vm.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_migrating_vm", + "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client#create_migrating_vm", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VMMigration::V1::CreateMigratingVmRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "VMMigration::Client", + "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client" + }, + "method": { + "short_name": "CreateMigratingVm", + "full_name": "google.cloud.vmmigration.v1.VmMigration.CreateMigratingVm", + "service": { + "short_name": "VmMigration", + "full_name": "google.cloud.vmmigration.v1.VmMigration" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "vmmigration_v1_generated_VMMigration_ListMigratingVms_sync", + "title": "Snippet for the list_migrating_vms call in the VMMigration service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VMMigration::V1::VMMigration::Client#list_migrating_vms.", + "file": "vm_migration/list_migrating_vms.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_migrating_vms", + "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client#list_migrating_vms", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VMMigration::V1::ListMigratingVmsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::VMMigration::V1::ListMigratingVmsResponse", + "client": { + "short_name": "VMMigration::Client", + "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client" + }, + "method": { + "short_name": "ListMigratingVms", + "full_name": "google.cloud.vmmigration.v1.VmMigration.ListMigratingVms", + "service": { + "short_name": "VmMigration", + "full_name": "google.cloud.vmmigration.v1.VmMigration" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "vmmigration_v1_generated_VMMigration_GetMigratingVm_sync", + "title": "Snippet for the get_migrating_vm call in the VMMigration service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VMMigration::V1::VMMigration::Client#get_migrating_vm.", + "file": "vm_migration/get_migrating_vm.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_migrating_vm", + "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client#get_migrating_vm", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VMMigration::V1::GetMigratingVmRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::VMMigration::V1::MigratingVm", + "client": { + "short_name": "VMMigration::Client", + "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client" + }, + "method": { + "short_name": "GetMigratingVm", + "full_name": "google.cloud.vmmigration.v1.VmMigration.GetMigratingVm", + "service": { + "short_name": "VmMigration", + "full_name": "google.cloud.vmmigration.v1.VmMigration" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "vmmigration_v1_generated_VMMigration_UpdateMigratingVm_sync", + "title": "Snippet for the update_migrating_vm call in the VMMigration service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VMMigration::V1::VMMigration::Client#update_migrating_vm.", + "file": "vm_migration/update_migrating_vm.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_migrating_vm", + "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client#update_migrating_vm", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VMMigration::V1::UpdateMigratingVmRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "VMMigration::Client", + "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client" + }, + "method": { + "short_name": "UpdateMigratingVm", + "full_name": "google.cloud.vmmigration.v1.VmMigration.UpdateMigratingVm", + "service": { + "short_name": "VmMigration", + "full_name": "google.cloud.vmmigration.v1.VmMigration" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "vmmigration_v1_generated_VMMigration_DeleteMigratingVm_sync", + "title": "Snippet for the delete_migrating_vm call in the VMMigration service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VMMigration::V1::VMMigration::Client#delete_migrating_vm.", + "file": "vm_migration/delete_migrating_vm.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_migrating_vm", + "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client#delete_migrating_vm", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VMMigration::V1::DeleteMigratingVmRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "VMMigration::Client", + "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client" + }, + "method": { + "short_name": "DeleteMigratingVm", + "full_name": "google.cloud.vmmigration.v1.VmMigration.DeleteMigratingVm", + "service": { + "short_name": "VmMigration", + "full_name": "google.cloud.vmmigration.v1.VmMigration" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "vmmigration_v1_generated_VMMigration_StartMigration_sync", + "title": "Snippet for the start_migration call in the VMMigration service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VMMigration::V1::VMMigration::Client#start_migration.", + "file": "vm_migration/start_migration.rb", + "language": "RUBY", + "client_method": { + "short_name": "start_migration", + "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client#start_migration", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VMMigration::V1::StartMigrationRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "VMMigration::Client", + "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client" + }, + "method": { + "short_name": "StartMigration", + "full_name": "google.cloud.vmmigration.v1.VmMigration.StartMigration", + "service": { + "short_name": "VmMigration", + "full_name": "google.cloud.vmmigration.v1.VmMigration" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "vmmigration_v1_generated_VMMigration_ResumeMigration_sync", + "title": "Snippet for the resume_migration call in the VMMigration service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VMMigration::V1::VMMigration::Client#resume_migration.", + "file": "vm_migration/resume_migration.rb", + "language": "RUBY", + "client_method": { + "short_name": "resume_migration", + "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client#resume_migration", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VMMigration::V1::ResumeMigrationRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "VMMigration::Client", + "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client" + }, + "method": { + "short_name": "ResumeMigration", + "full_name": "google.cloud.vmmigration.v1.VmMigration.ResumeMigration", + "service": { + "short_name": "VmMigration", + "full_name": "google.cloud.vmmigration.v1.VmMigration" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "vmmigration_v1_generated_VMMigration_PauseMigration_sync", + "title": "Snippet for the pause_migration call in the VMMigration service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VMMigration::V1::VMMigration::Client#pause_migration.", + "file": "vm_migration/pause_migration.rb", + "language": "RUBY", + "client_method": { + "short_name": "pause_migration", + "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client#pause_migration", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VMMigration::V1::PauseMigrationRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "VMMigration::Client", + "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client" + }, + "method": { + "short_name": "PauseMigration", + "full_name": "google.cloud.vmmigration.v1.VmMigration.PauseMigration", + "service": { + "short_name": "VmMigration", + "full_name": "google.cloud.vmmigration.v1.VmMigration" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "vmmigration_v1_generated_VMMigration_FinalizeMigration_sync", + "title": "Snippet for the finalize_migration call in the VMMigration service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VMMigration::V1::VMMigration::Client#finalize_migration.", + "file": "vm_migration/finalize_migration.rb", + "language": "RUBY", + "client_method": { + "short_name": "finalize_migration", + "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client#finalize_migration", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VMMigration::V1::FinalizeMigrationRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "VMMigration::Client", + "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client" + }, + "method": { + "short_name": "FinalizeMigration", + "full_name": "google.cloud.vmmigration.v1.VmMigration.FinalizeMigration", + "service": { + "short_name": "VmMigration", + "full_name": "google.cloud.vmmigration.v1.VmMigration" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "vmmigration_v1_generated_VMMigration_ExtendMigration_sync", + "title": "Snippet for the extend_migration call in the VMMigration service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VMMigration::V1::VMMigration::Client#extend_migration.", + "file": "vm_migration/extend_migration.rb", + "language": "RUBY", + "client_method": { + "short_name": "extend_migration", + "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client#extend_migration", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VMMigration::V1::ExtendMigrationRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "VMMigration::Client", + "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client" + }, + "method": { + "short_name": "ExtendMigration", + "full_name": "google.cloud.vmmigration.v1.VmMigration.ExtendMigration", + "service": { + "short_name": "VmMigration", + "full_name": "google.cloud.vmmigration.v1.VmMigration" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "vmmigration_v1_generated_VMMigration_CreateCloneJob_sync", + "title": "Snippet for the create_clone_job call in the VMMigration service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VMMigration::V1::VMMigration::Client#create_clone_job.", + "file": "vm_migration/create_clone_job.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_clone_job", + "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client#create_clone_job", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VMMigration::V1::CreateCloneJobRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "VMMigration::Client", + "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client" + }, + "method": { + "short_name": "CreateCloneJob", + "full_name": "google.cloud.vmmigration.v1.VmMigration.CreateCloneJob", + "service": { + "short_name": "VmMigration", + "full_name": "google.cloud.vmmigration.v1.VmMigration" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "vmmigration_v1_generated_VMMigration_CancelCloneJob_sync", + "title": "Snippet for the cancel_clone_job call in the VMMigration service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VMMigration::V1::VMMigration::Client#cancel_clone_job.", + "file": "vm_migration/cancel_clone_job.rb", + "language": "RUBY", + "client_method": { + "short_name": "cancel_clone_job", + "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client#cancel_clone_job", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VMMigration::V1::CancelCloneJobRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "VMMigration::Client", + "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client" + }, + "method": { + "short_name": "CancelCloneJob", + "full_name": "google.cloud.vmmigration.v1.VmMigration.CancelCloneJob", + "service": { + "short_name": "VmMigration", + "full_name": "google.cloud.vmmigration.v1.VmMigration" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "vmmigration_v1_generated_VMMigration_ListCloneJobs_sync", + "title": "Snippet for the list_clone_jobs call in the VMMigration service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VMMigration::V1::VMMigration::Client#list_clone_jobs.", + "file": "vm_migration/list_clone_jobs.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_clone_jobs", + "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client#list_clone_jobs", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VMMigration::V1::ListCloneJobsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::VMMigration::V1::ListCloneJobsResponse", + "client": { + "short_name": "VMMigration::Client", + "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client" + }, + "method": { + "short_name": "ListCloneJobs", + "full_name": "google.cloud.vmmigration.v1.VmMigration.ListCloneJobs", + "service": { + "short_name": "VmMigration", + "full_name": "google.cloud.vmmigration.v1.VmMigration" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "vmmigration_v1_generated_VMMigration_GetCloneJob_sync", + "title": "Snippet for the get_clone_job call in the VMMigration service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VMMigration::V1::VMMigration::Client#get_clone_job.", + "file": "vm_migration/get_clone_job.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_clone_job", + "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client#get_clone_job", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VMMigration::V1::GetCloneJobRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::VMMigration::V1::CloneJob", + "client": { + "short_name": "VMMigration::Client", + "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client" + }, + "method": { + "short_name": "GetCloneJob", + "full_name": "google.cloud.vmmigration.v1.VmMigration.GetCloneJob", + "service": { + "short_name": "VmMigration", + "full_name": "google.cloud.vmmigration.v1.VmMigration" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "vmmigration_v1_generated_VMMigration_CreateCutoverJob_sync", + "title": "Snippet for the create_cutover_job call in the VMMigration service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VMMigration::V1::VMMigration::Client#create_cutover_job.", + "file": "vm_migration/create_cutover_job.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_cutover_job", + "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client#create_cutover_job", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VMMigration::V1::CreateCutoverJobRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "VMMigration::Client", + "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client" + }, + "method": { + "short_name": "CreateCutoverJob", + "full_name": "google.cloud.vmmigration.v1.VmMigration.CreateCutoverJob", + "service": { + "short_name": "VmMigration", + "full_name": "google.cloud.vmmigration.v1.VmMigration" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "vmmigration_v1_generated_VMMigration_CancelCutoverJob_sync", + "title": "Snippet for the cancel_cutover_job call in the VMMigration service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VMMigration::V1::VMMigration::Client#cancel_cutover_job.", + "file": "vm_migration/cancel_cutover_job.rb", + "language": "RUBY", + "client_method": { + "short_name": "cancel_cutover_job", + "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client#cancel_cutover_job", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VMMigration::V1::CancelCutoverJobRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "VMMigration::Client", + "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client" + }, + "method": { + "short_name": "CancelCutoverJob", + "full_name": "google.cloud.vmmigration.v1.VmMigration.CancelCutoverJob", + "service": { + "short_name": "VmMigration", + "full_name": "google.cloud.vmmigration.v1.VmMigration" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "vmmigration_v1_generated_VMMigration_ListCutoverJobs_sync", + "title": "Snippet for the list_cutover_jobs call in the VMMigration service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VMMigration::V1::VMMigration::Client#list_cutover_jobs.", + "file": "vm_migration/list_cutover_jobs.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_cutover_jobs", + "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client#list_cutover_jobs", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VMMigration::V1::ListCutoverJobsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::VMMigration::V1::ListCutoverJobsResponse", + "client": { + "short_name": "VMMigration::Client", + "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client" + }, + "method": { + "short_name": "ListCutoverJobs", + "full_name": "google.cloud.vmmigration.v1.VmMigration.ListCutoverJobs", + "service": { + "short_name": "VmMigration", + "full_name": "google.cloud.vmmigration.v1.VmMigration" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "vmmigration_v1_generated_VMMigration_GetCutoverJob_sync", + "title": "Snippet for the get_cutover_job call in the VMMigration service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VMMigration::V1::VMMigration::Client#get_cutover_job.", + "file": "vm_migration/get_cutover_job.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_cutover_job", + "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client#get_cutover_job", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VMMigration::V1::GetCutoverJobRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::VMMigration::V1::CutoverJob", + "client": { + "short_name": "VMMigration::Client", + "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client" + }, + "method": { + "short_name": "GetCutoverJob", + "full_name": "google.cloud.vmmigration.v1.VmMigration.GetCutoverJob", + "service": { + "short_name": "VmMigration", + "full_name": "google.cloud.vmmigration.v1.VmMigration" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "vmmigration_v1_generated_VMMigration_ListGroups_sync", + "title": "Snippet for the list_groups call in the VMMigration service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VMMigration::V1::VMMigration::Client#list_groups.", + "file": "vm_migration/list_groups.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_groups", + "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client#list_groups", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VMMigration::V1::ListGroupsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::VMMigration::V1::ListGroupsResponse", + "client": { + "short_name": "VMMigration::Client", + "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client" + }, + "method": { + "short_name": "ListGroups", + "full_name": "google.cloud.vmmigration.v1.VmMigration.ListGroups", + "service": { + "short_name": "VmMigration", + "full_name": "google.cloud.vmmigration.v1.VmMigration" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "vmmigration_v1_generated_VMMigration_GetGroup_sync", + "title": "Snippet for the get_group call in the VMMigration service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VMMigration::V1::VMMigration::Client#get_group.", + "file": "vm_migration/get_group.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_group", + "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client#get_group", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VMMigration::V1::GetGroupRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::VMMigration::V1::Group", + "client": { + "short_name": "VMMigration::Client", + "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client" + }, + "method": { + "short_name": "GetGroup", + "full_name": "google.cloud.vmmigration.v1.VmMigration.GetGroup", + "service": { + "short_name": "VmMigration", + "full_name": "google.cloud.vmmigration.v1.VmMigration" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "vmmigration_v1_generated_VMMigration_CreateGroup_sync", + "title": "Snippet for the create_group call in the VMMigration service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VMMigration::V1::VMMigration::Client#create_group.", + "file": "vm_migration/create_group.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_group", + "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client#create_group", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VMMigration::V1::CreateGroupRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "VMMigration::Client", + "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client" + }, + "method": { + "short_name": "CreateGroup", + "full_name": "google.cloud.vmmigration.v1.VmMigration.CreateGroup", + "service": { + "short_name": "VmMigration", + "full_name": "google.cloud.vmmigration.v1.VmMigration" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "vmmigration_v1_generated_VMMigration_UpdateGroup_sync", + "title": "Snippet for the update_group call in the VMMigration service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VMMigration::V1::VMMigration::Client#update_group.", + "file": "vm_migration/update_group.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_group", + "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client#update_group", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VMMigration::V1::UpdateGroupRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "VMMigration::Client", + "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client" + }, + "method": { + "short_name": "UpdateGroup", + "full_name": "google.cloud.vmmigration.v1.VmMigration.UpdateGroup", + "service": { + "short_name": "VmMigration", + "full_name": "google.cloud.vmmigration.v1.VmMigration" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "vmmigration_v1_generated_VMMigration_DeleteGroup_sync", + "title": "Snippet for the delete_group call in the VMMigration service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VMMigration::V1::VMMigration::Client#delete_group.", + "file": "vm_migration/delete_group.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_group", + "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client#delete_group", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VMMigration::V1::DeleteGroupRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "VMMigration::Client", + "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client" + }, + "method": { + "short_name": "DeleteGroup", + "full_name": "google.cloud.vmmigration.v1.VmMigration.DeleteGroup", + "service": { + "short_name": "VmMigration", + "full_name": "google.cloud.vmmigration.v1.VmMigration" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "vmmigration_v1_generated_VMMigration_AddGroupMigration_sync", + "title": "Snippet for the add_group_migration call in the VMMigration service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VMMigration::V1::VMMigration::Client#add_group_migration.", + "file": "vm_migration/add_group_migration.rb", + "language": "RUBY", + "client_method": { + "short_name": "add_group_migration", + "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client#add_group_migration", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VMMigration::V1::AddGroupMigrationRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "VMMigration::Client", + "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client" + }, + "method": { + "short_name": "AddGroupMigration", + "full_name": "google.cloud.vmmigration.v1.VmMigration.AddGroupMigration", + "service": { + "short_name": "VmMigration", + "full_name": "google.cloud.vmmigration.v1.VmMigration" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "vmmigration_v1_generated_VMMigration_RemoveGroupMigration_sync", + "title": "Snippet for the remove_group_migration call in the VMMigration service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VMMigration::V1::VMMigration::Client#remove_group_migration.", + "file": "vm_migration/remove_group_migration.rb", + "language": "RUBY", + "client_method": { + "short_name": "remove_group_migration", + "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client#remove_group_migration", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VMMigration::V1::RemoveGroupMigrationRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "VMMigration::Client", + "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client" + }, + "method": { + "short_name": "RemoveGroupMigration", + "full_name": "google.cloud.vmmigration.v1.VmMigration.RemoveGroupMigration", + "service": { + "short_name": "VmMigration", + "full_name": "google.cloud.vmmigration.v1.VmMigration" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "vmmigration_v1_generated_VMMigration_ListTargetProjects_sync", + "title": "Snippet for the list_target_projects call in the VMMigration service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VMMigration::V1::VMMigration::Client#list_target_projects.", + "file": "vm_migration/list_target_projects.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_target_projects", + "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client#list_target_projects", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VMMigration::V1::ListTargetProjectsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::VMMigration::V1::ListTargetProjectsResponse", + "client": { + "short_name": "VMMigration::Client", + "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client" + }, + "method": { + "short_name": "ListTargetProjects", + "full_name": "google.cloud.vmmigration.v1.VmMigration.ListTargetProjects", + "service": { + "short_name": "VmMigration", + "full_name": "google.cloud.vmmigration.v1.VmMigration" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "vmmigration_v1_generated_VMMigration_GetTargetProject_sync", + "title": "Snippet for the get_target_project call in the VMMigration service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VMMigration::V1::VMMigration::Client#get_target_project.", + "file": "vm_migration/get_target_project.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_target_project", + "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client#get_target_project", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VMMigration::V1::GetTargetProjectRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::VMMigration::V1::TargetProject", + "client": { + "short_name": "VMMigration::Client", + "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client" + }, + "method": { + "short_name": "GetTargetProject", + "full_name": "google.cloud.vmmigration.v1.VmMigration.GetTargetProject", + "service": { + "short_name": "VmMigration", + "full_name": "google.cloud.vmmigration.v1.VmMigration" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "vmmigration_v1_generated_VMMigration_CreateTargetProject_sync", + "title": "Snippet for the create_target_project call in the VMMigration service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VMMigration::V1::VMMigration::Client#create_target_project.", + "file": "vm_migration/create_target_project.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_target_project", + "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client#create_target_project", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VMMigration::V1::CreateTargetProjectRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "VMMigration::Client", + "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client" + }, + "method": { + "short_name": "CreateTargetProject", + "full_name": "google.cloud.vmmigration.v1.VmMigration.CreateTargetProject", + "service": { + "short_name": "VmMigration", + "full_name": "google.cloud.vmmigration.v1.VmMigration" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "vmmigration_v1_generated_VMMigration_UpdateTargetProject_sync", + "title": "Snippet for the update_target_project call in the VMMigration service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VMMigration::V1::VMMigration::Client#update_target_project.", + "file": "vm_migration/update_target_project.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_target_project", + "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client#update_target_project", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VMMigration::V1::UpdateTargetProjectRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "VMMigration::Client", + "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client" + }, + "method": { + "short_name": "UpdateTargetProject", + "full_name": "google.cloud.vmmigration.v1.VmMigration.UpdateTargetProject", + "service": { + "short_name": "VmMigration", + "full_name": "google.cloud.vmmigration.v1.VmMigration" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "vmmigration_v1_generated_VMMigration_DeleteTargetProject_sync", + "title": "Snippet for the delete_target_project call in the VMMigration service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VMMigration::V1::VMMigration::Client#delete_target_project.", + "file": "vm_migration/delete_target_project.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_target_project", + "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client#delete_target_project", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VMMigration::V1::DeleteTargetProjectRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "VMMigration::Client", + "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client" + }, + "method": { + "short_name": "DeleteTargetProject", + "full_name": "google.cloud.vmmigration.v1.VmMigration.DeleteTargetProject", + "service": { + "short_name": "VmMigration", + "full_name": "google.cloud.vmmigration.v1.VmMigration" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "vmmigration_v1_generated_VMMigration_ListReplicationCycles_sync", + "title": "Snippet for the list_replication_cycles call in the VMMigration service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VMMigration::V1::VMMigration::Client#list_replication_cycles.", + "file": "vm_migration/list_replication_cycles.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_replication_cycles", + "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client#list_replication_cycles", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VMMigration::V1::ListReplicationCyclesRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::VMMigration::V1::ListReplicationCyclesResponse", + "client": { + "short_name": "VMMigration::Client", + "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client" + }, + "method": { + "short_name": "ListReplicationCycles", + "full_name": "google.cloud.vmmigration.v1.VmMigration.ListReplicationCycles", + "service": { + "short_name": "VmMigration", + "full_name": "google.cloud.vmmigration.v1.VmMigration" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "vmmigration_v1_generated_VMMigration_GetReplicationCycle_sync", + "title": "Snippet for the get_replication_cycle call in the VMMigration service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VMMigration::V1::VMMigration::Client#get_replication_cycle.", + "file": "vm_migration/get_replication_cycle.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_replication_cycle", + "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client#get_replication_cycle", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VMMigration::V1::GetReplicationCycleRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::VMMigration::V1::ReplicationCycle", + "client": { + "short_name": "VMMigration::Client", + "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client" + }, + "method": { + "short_name": "GetReplicationCycle", + "full_name": "google.cloud.vmmigration.v1.VmMigration.GetReplicationCycle", + "service": { + "short_name": "VmMigration", + "full_name": "google.cloud.vmmigration.v1.VmMigration" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "vmmigration_v1_generated_VMMigration_ListImageImports_sync", + "title": "Snippet for the list_image_imports call in the VMMigration service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VMMigration::V1::VMMigration::Client#list_image_imports.", + "file": "vm_migration/list_image_imports.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_image_imports", + "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client#list_image_imports", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VMMigration::V1::ListImageImportsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::VMMigration::V1::ListImageImportsResponse", + "client": { + "short_name": "VMMigration::Client", + "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client" + }, + "method": { + "short_name": "ListImageImports", + "full_name": "google.cloud.vmmigration.v1.VmMigration.ListImageImports", + "service": { + "short_name": "VmMigration", + "full_name": "google.cloud.vmmigration.v1.VmMigration" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "vmmigration_v1_generated_VMMigration_GetImageImport_sync", + "title": "Snippet for the get_image_import call in the VMMigration service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VMMigration::V1::VMMigration::Client#get_image_import.", + "file": "vm_migration/get_image_import.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_image_import", + "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client#get_image_import", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VMMigration::V1::GetImageImportRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::VMMigration::V1::ImageImport", + "client": { + "short_name": "VMMigration::Client", + "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client" + }, + "method": { + "short_name": "GetImageImport", + "full_name": "google.cloud.vmmigration.v1.VmMigration.GetImageImport", + "service": { + "short_name": "VmMigration", + "full_name": "google.cloud.vmmigration.v1.VmMigration" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "vmmigration_v1_generated_VMMigration_CreateImageImport_sync", + "title": "Snippet for the create_image_import call in the VMMigration service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VMMigration::V1::VMMigration::Client#create_image_import.", + "file": "vm_migration/create_image_import.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_image_import", + "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client#create_image_import", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VMMigration::V1::CreateImageImportRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "VMMigration::Client", + "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client" + }, + "method": { + "short_name": "CreateImageImport", + "full_name": "google.cloud.vmmigration.v1.VmMigration.CreateImageImport", + "service": { + "short_name": "VmMigration", + "full_name": "google.cloud.vmmigration.v1.VmMigration" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "vmmigration_v1_generated_VMMigration_DeleteImageImport_sync", + "title": "Snippet for the delete_image_import call in the VMMigration service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VMMigration::V1::VMMigration::Client#delete_image_import.", + "file": "vm_migration/delete_image_import.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_image_import", + "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client#delete_image_import", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VMMigration::V1::DeleteImageImportRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "VMMigration::Client", + "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client" + }, + "method": { + "short_name": "DeleteImageImport", + "full_name": "google.cloud.vmmigration.v1.VmMigration.DeleteImageImport", + "service": { + "short_name": "VmMigration", + "full_name": "google.cloud.vmmigration.v1.VmMigration" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "vmmigration_v1_generated_VMMigration_ListImageImportJobs_sync", + "title": "Snippet for the list_image_import_jobs call in the VMMigration service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VMMigration::V1::VMMigration::Client#list_image_import_jobs.", + "file": "vm_migration/list_image_import_jobs.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_image_import_jobs", + "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client#list_image_import_jobs", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VMMigration::V1::ListImageImportJobsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::VMMigration::V1::ListImageImportJobsResponse", + "client": { + "short_name": "VMMigration::Client", + "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client" + }, + "method": { + "short_name": "ListImageImportJobs", + "full_name": "google.cloud.vmmigration.v1.VmMigration.ListImageImportJobs", + "service": { + "short_name": "VmMigration", + "full_name": "google.cloud.vmmigration.v1.VmMigration" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "vmmigration_v1_generated_VMMigration_GetImageImportJob_sync", + "title": "Snippet for the get_image_import_job call in the VMMigration service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VMMigration::V1::VMMigration::Client#get_image_import_job.", + "file": "vm_migration/get_image_import_job.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_image_import_job", + "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client#get_image_import_job", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VMMigration::V1::GetImageImportJobRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::VMMigration::V1::ImageImportJob", + "client": { + "short_name": "VMMigration::Client", + "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client" + }, + "method": { + "short_name": "GetImageImportJob", + "full_name": "google.cloud.vmmigration.v1.VmMigration.GetImageImportJob", + "service": { + "short_name": "VmMigration", + "full_name": "google.cloud.vmmigration.v1.VmMigration" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "vmmigration_v1_generated_VMMigration_CancelImageImportJob_sync", + "title": "Snippet for the cancel_image_import_job call in the VMMigration service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VMMigration::V1::VMMigration::Client#cancel_image_import_job.", + "file": "vm_migration/cancel_image_import_job.rb", + "language": "RUBY", + "client_method": { + "short_name": "cancel_image_import_job", + "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client#cancel_image_import_job", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VMMigration::V1::CancelImageImportJobRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "VMMigration::Client", + "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client" + }, + "method": { + "short_name": "CancelImageImportJob", + "full_name": "google.cloud.vmmigration.v1.VmMigration.CancelImageImportJob", + "service": { + "short_name": "VmMigration", + "full_name": "google.cloud.vmmigration.v1.VmMigration" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "vmmigration_v1_generated_VMMigration_CreateDiskMigrationJob_sync", + "title": "Snippet for the create_disk_migration_job call in the VMMigration service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VMMigration::V1::VMMigration::Client#create_disk_migration_job.", + "file": "vm_migration/create_disk_migration_job.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_disk_migration_job", + "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client#create_disk_migration_job", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VMMigration::V1::CreateDiskMigrationJobRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "VMMigration::Client", + "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client" + }, + "method": { + "short_name": "CreateDiskMigrationJob", + "full_name": "google.cloud.vmmigration.v1.VmMigration.CreateDiskMigrationJob", + "service": { + "short_name": "VmMigration", + "full_name": "google.cloud.vmmigration.v1.VmMigration" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "vmmigration_v1_generated_VMMigration_ListDiskMigrationJobs_sync", + "title": "Snippet for the list_disk_migration_jobs call in the VMMigration service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VMMigration::V1::VMMigration::Client#list_disk_migration_jobs.", + "file": "vm_migration/list_disk_migration_jobs.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_disk_migration_jobs", + "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client#list_disk_migration_jobs", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VMMigration::V1::ListDiskMigrationJobsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::VMMigration::V1::ListDiskMigrationJobsResponse", + "client": { + "short_name": "VMMigration::Client", + "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client" + }, + "method": { + "short_name": "ListDiskMigrationJobs", + "full_name": "google.cloud.vmmigration.v1.VmMigration.ListDiskMigrationJobs", + "service": { + "short_name": "VmMigration", + "full_name": "google.cloud.vmmigration.v1.VmMigration" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "vmmigration_v1_generated_VMMigration_GetDiskMigrationJob_sync", + "title": "Snippet for the get_disk_migration_job call in the VMMigration service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VMMigration::V1::VMMigration::Client#get_disk_migration_job.", + "file": "vm_migration/get_disk_migration_job.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_disk_migration_job", + "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client#get_disk_migration_job", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VMMigration::V1::GetDiskMigrationJobRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::VMMigration::V1::DiskMigrationJob", + "client": { + "short_name": "VMMigration::Client", + "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client" + }, + "method": { + "short_name": "GetDiskMigrationJob", + "full_name": "google.cloud.vmmigration.v1.VmMigration.GetDiskMigrationJob", + "service": { + "short_name": "VmMigration", + "full_name": "google.cloud.vmmigration.v1.VmMigration" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "vmmigration_v1_generated_VMMigration_UpdateDiskMigrationJob_sync", + "title": "Snippet for the update_disk_migration_job call in the VMMigration service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VMMigration::V1::VMMigration::Client#update_disk_migration_job.", + "file": "vm_migration/update_disk_migration_job.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_disk_migration_job", + "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client#update_disk_migration_job", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VMMigration::V1::UpdateDiskMigrationJobRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "VMMigration::Client", + "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client" + }, + "method": { + "short_name": "UpdateDiskMigrationJob", + "full_name": "google.cloud.vmmigration.v1.VmMigration.UpdateDiskMigrationJob", + "service": { + "short_name": "VmMigration", + "full_name": "google.cloud.vmmigration.v1.VmMigration" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "vmmigration_v1_generated_VMMigration_DeleteDiskMigrationJob_sync", + "title": "Snippet for the delete_disk_migration_job call in the VMMigration service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VMMigration::V1::VMMigration::Client#delete_disk_migration_job.", + "file": "vm_migration/delete_disk_migration_job.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_disk_migration_job", + "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client#delete_disk_migration_job", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VMMigration::V1::DeleteDiskMigrationJobRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "VMMigration::Client", + "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client" + }, + "method": { + "short_name": "DeleteDiskMigrationJob", + "full_name": "google.cloud.vmmigration.v1.VmMigration.DeleteDiskMigrationJob", + "service": { + "short_name": "VmMigration", + "full_name": "google.cloud.vmmigration.v1.VmMigration" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "vmmigration_v1_generated_VMMigration_RunDiskMigrationJob_sync", + "title": "Snippet for the run_disk_migration_job call in the VMMigration service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VMMigration::V1::VMMigration::Client#run_disk_migration_job.", + "file": "vm_migration/run_disk_migration_job.rb", + "language": "RUBY", + "client_method": { + "short_name": "run_disk_migration_job", + "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client#run_disk_migration_job", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VMMigration::V1::RunDiskMigrationJobRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "VMMigration::Client", + "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client" + }, + "method": { + "short_name": "RunDiskMigrationJob", + "full_name": "google.cloud.vmmigration.v1.VmMigration.RunDiskMigrationJob", + "service": { + "short_name": "VmMigration", + "full_name": "google.cloud.vmmigration.v1.VmMigration" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "vmmigration_v1_generated_VMMigration_CancelDiskMigrationJob_sync", + "title": "Snippet for the cancel_disk_migration_job call in the VMMigration service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VMMigration::V1::VMMigration::Client#cancel_disk_migration_job.", + "file": "vm_migration/cancel_disk_migration_job.rb", + "language": "RUBY", + "client_method": { + "short_name": "cancel_disk_migration_job", + "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client#cancel_disk_migration_job", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VMMigration::V1::CancelDiskMigrationJobRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "VMMigration::Client", + "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client" + }, + "method": { + "short_name": "CancelDiskMigrationJob", + "full_name": "google.cloud.vmmigration.v1.VmMigration.CancelDiskMigrationJob", + "service": { + "short_name": "VmMigration", + "full_name": "google.cloud.vmmigration.v1.VmMigration" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + } + ] +} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-vm_migration-v1/snippets/snippet_metadata_google.iam.v1.json b/owl-bot-staging/google-cloud-vm_migration-v1/snippets/snippet_metadata_google.iam.v1.json new file mode 100644 index 000000000000..63b1831d7897 --- /dev/null +++ b/owl-bot-staging/google-cloud-vm_migration-v1/snippets/snippet_metadata_google.iam.v1.json @@ -0,0 +1,135 @@ +{ + "client_library": { + "name": "google-cloud-vm_migration-v1", + "version": "", + "language": "RUBY", + "apis": [ + { + "id": "google.iam.v1", + "version": "v1" + } + ] + }, + "snippets": [ + { + "region_tag": "vmmigration_v1_generated_IAMPolicy_SetIamPolicy_sync", + "title": "Snippet for the set_iam_policy call in the IAMPolicy service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Iam::V1::IAMPolicy::Client#set_iam_policy.", + "file": "iam_policy/set_iam_policy.rb", + "language": "RUBY", + "client_method": { + "short_name": "set_iam_policy", + "full_name": "::Google::Iam::V1::IAMPolicy::Client#set_iam_policy", + "async": false, + "parameters": [ + { + "type": "::Google::Iam::V1::SetIamPolicyRequest", + "name": "request" + } + ], + "result_type": "::Google::Iam::V1::Policy", + "client": { + "short_name": "IAMPolicy::Client", + "full_name": "::Google::Iam::V1::IAMPolicy::Client" + }, + "method": { + "short_name": "SetIamPolicy", + "full_name": "google.iam.v1.IAMPolicy.SetIamPolicy", + "service": { + "short_name": "IAMPolicy", + "full_name": "google.iam.v1.IAMPolicy" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "vmmigration_v1_generated_IAMPolicy_GetIamPolicy_sync", + "title": "Snippet for the get_iam_policy call in the IAMPolicy service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Iam::V1::IAMPolicy::Client#get_iam_policy.", + "file": "iam_policy/get_iam_policy.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_iam_policy", + "full_name": "::Google::Iam::V1::IAMPolicy::Client#get_iam_policy", + "async": false, + "parameters": [ + { + "type": "::Google::Iam::V1::GetIamPolicyRequest", + "name": "request" + } + ], + "result_type": "::Google::Iam::V1::Policy", + "client": { + "short_name": "IAMPolicy::Client", + "full_name": "::Google::Iam::V1::IAMPolicy::Client" + }, + "method": { + "short_name": "GetIamPolicy", + "full_name": "google.iam.v1.IAMPolicy.GetIamPolicy", + "service": { + "short_name": "IAMPolicy", + "full_name": "google.iam.v1.IAMPolicy" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "vmmigration_v1_generated_IAMPolicy_TestIamPermissions_sync", + "title": "Snippet for the test_iam_permissions call in the IAMPolicy service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Iam::V1::IAMPolicy::Client#test_iam_permissions.", + "file": "iam_policy/test_iam_permissions.rb", + "language": "RUBY", + "client_method": { + "short_name": "test_iam_permissions", + "full_name": "::Google::Iam::V1::IAMPolicy::Client#test_iam_permissions", + "async": false, + "parameters": [ + { + "type": "::Google::Iam::V1::TestIamPermissionsRequest", + "name": "request" + } + ], + "result_type": "::Google::Iam::V1::TestIamPermissionsResponse", + "client": { + "short_name": "IAMPolicy::Client", + "full_name": "::Google::Iam::V1::IAMPolicy::Client" + }, + "method": { + "short_name": "TestIamPermissions", + "full_name": "google.iam.v1.IAMPolicy.TestIamPermissions", + "service": { + "short_name": "IAMPolicy", + "full_name": "google.iam.v1.IAMPolicy" + } + } + }, + "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-vm_migration-v1/snippets/vm_migration/add_group_migration.rb b/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/add_group_migration.rb new file mode 100644 index 000000000000..bcdab386d788 --- /dev/null +++ b/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/add_group_migration.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 vmmigration_v1_generated_VMMigration_AddGroupMigration_sync] +require "google/cloud/vm_migration/v1" + +## +# Snippet for the add_group_migration call in the VMMigration 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::VMMigration::V1::VMMigration::Client#add_group_migration. +# +def add_group_migration + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VMMigration::V1::VMMigration::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VMMigration::V1::AddGroupMigrationRequest.new + + # Call the add_group_migration method. + result = client.add_group_migration 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 vmmigration_v1_generated_VMMigration_AddGroupMigration_sync] diff --git a/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/cancel_clone_job.rb b/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/cancel_clone_job.rb new file mode 100644 index 000000000000..e793d11e9e04 --- /dev/null +++ b/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/cancel_clone_job.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 vmmigration_v1_generated_VMMigration_CancelCloneJob_sync] +require "google/cloud/vm_migration/v1" + +## +# Snippet for the cancel_clone_job call in the VMMigration 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::VMMigration::V1::VMMigration::Client#cancel_clone_job. +# +def cancel_clone_job + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VMMigration::V1::VMMigration::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VMMigration::V1::CancelCloneJobRequest.new + + # Call the cancel_clone_job method. + result = client.cancel_clone_job 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 vmmigration_v1_generated_VMMigration_CancelCloneJob_sync] diff --git a/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/cancel_cutover_job.rb b/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/cancel_cutover_job.rb new file mode 100644 index 000000000000..0a836e519364 --- /dev/null +++ b/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/cancel_cutover_job.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 vmmigration_v1_generated_VMMigration_CancelCutoverJob_sync] +require "google/cloud/vm_migration/v1" + +## +# Snippet for the cancel_cutover_job call in the VMMigration 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::VMMigration::V1::VMMigration::Client#cancel_cutover_job. +# +def cancel_cutover_job + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VMMigration::V1::VMMigration::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VMMigration::V1::CancelCutoverJobRequest.new + + # Call the cancel_cutover_job method. + result = client.cancel_cutover_job 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 vmmigration_v1_generated_VMMigration_CancelCutoverJob_sync] diff --git a/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/cancel_disk_migration_job.rb b/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/cancel_disk_migration_job.rb new file mode 100644 index 000000000000..557ea30873d5 --- /dev/null +++ b/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/cancel_disk_migration_job.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 vmmigration_v1_generated_VMMigration_CancelDiskMigrationJob_sync] +require "google/cloud/vm_migration/v1" + +## +# Snippet for the cancel_disk_migration_job call in the VMMigration 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::VMMigration::V1::VMMigration::Client#cancel_disk_migration_job. +# +def cancel_disk_migration_job + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VMMigration::V1::VMMigration::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VMMigration::V1::CancelDiskMigrationJobRequest.new + + # Call the cancel_disk_migration_job method. + result = client.cancel_disk_migration_job 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 vmmigration_v1_generated_VMMigration_CancelDiskMigrationJob_sync] diff --git a/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/cancel_image_import_job.rb b/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/cancel_image_import_job.rb new file mode 100644 index 000000000000..7abf2958c3da --- /dev/null +++ b/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/cancel_image_import_job.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 vmmigration_v1_generated_VMMigration_CancelImageImportJob_sync] +require "google/cloud/vm_migration/v1" + +## +# Snippet for the cancel_image_import_job call in the VMMigration 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::VMMigration::V1::VMMigration::Client#cancel_image_import_job. +# +def cancel_image_import_job + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VMMigration::V1::VMMigration::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VMMigration::V1::CancelImageImportJobRequest.new + + # Call the cancel_image_import_job method. + result = client.cancel_image_import_job 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 vmmigration_v1_generated_VMMigration_CancelImageImportJob_sync] diff --git a/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/create_clone_job.rb b/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/create_clone_job.rb new file mode 100644 index 000000000000..c62d263a6f24 --- /dev/null +++ b/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/create_clone_job.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 vmmigration_v1_generated_VMMigration_CreateCloneJob_sync] +require "google/cloud/vm_migration/v1" + +## +# Snippet for the create_clone_job call in the VMMigration 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::VMMigration::V1::VMMigration::Client#create_clone_job. +# +def create_clone_job + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VMMigration::V1::VMMigration::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VMMigration::V1::CreateCloneJobRequest.new + + # Call the create_clone_job method. + result = client.create_clone_job 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 vmmigration_v1_generated_VMMigration_CreateCloneJob_sync] diff --git a/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/create_cutover_job.rb b/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/create_cutover_job.rb new file mode 100644 index 000000000000..d082d0bba831 --- /dev/null +++ b/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/create_cutover_job.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 vmmigration_v1_generated_VMMigration_CreateCutoverJob_sync] +require "google/cloud/vm_migration/v1" + +## +# Snippet for the create_cutover_job call in the VMMigration 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::VMMigration::V1::VMMigration::Client#create_cutover_job. +# +def create_cutover_job + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VMMigration::V1::VMMigration::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VMMigration::V1::CreateCutoverJobRequest.new + + # Call the create_cutover_job method. + result = client.create_cutover_job 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 vmmigration_v1_generated_VMMigration_CreateCutoverJob_sync] diff --git a/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/create_datacenter_connector.rb b/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/create_datacenter_connector.rb new file mode 100644 index 000000000000..a810e989fcb4 --- /dev/null +++ b/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/create_datacenter_connector.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 vmmigration_v1_generated_VMMigration_CreateDatacenterConnector_sync] +require "google/cloud/vm_migration/v1" + +## +# Snippet for the create_datacenter_connector call in the VMMigration 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::VMMigration::V1::VMMigration::Client#create_datacenter_connector. +# +def create_datacenter_connector + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VMMigration::V1::VMMigration::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VMMigration::V1::CreateDatacenterConnectorRequest.new + + # Call the create_datacenter_connector method. + result = client.create_datacenter_connector 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 vmmigration_v1_generated_VMMigration_CreateDatacenterConnector_sync] diff --git a/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/create_disk_migration_job.rb b/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/create_disk_migration_job.rb new file mode 100644 index 000000000000..8e62d6d32b39 --- /dev/null +++ b/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/create_disk_migration_job.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 vmmigration_v1_generated_VMMigration_CreateDiskMigrationJob_sync] +require "google/cloud/vm_migration/v1" + +## +# Snippet for the create_disk_migration_job call in the VMMigration 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::VMMigration::V1::VMMigration::Client#create_disk_migration_job. +# +def create_disk_migration_job + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VMMigration::V1::VMMigration::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VMMigration::V1::CreateDiskMigrationJobRequest.new + + # Call the create_disk_migration_job method. + result = client.create_disk_migration_job 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 vmmigration_v1_generated_VMMigration_CreateDiskMigrationJob_sync] diff --git a/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/create_group.rb b/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/create_group.rb new file mode 100644 index 000000000000..59e62ea9b21e --- /dev/null +++ b/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/create_group.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 vmmigration_v1_generated_VMMigration_CreateGroup_sync] +require "google/cloud/vm_migration/v1" + +## +# Snippet for the create_group call in the VMMigration 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::VMMigration::V1::VMMigration::Client#create_group. +# +def create_group + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VMMigration::V1::VMMigration::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VMMigration::V1::CreateGroupRequest.new + + # Call the create_group method. + result = client.create_group 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 vmmigration_v1_generated_VMMigration_CreateGroup_sync] diff --git a/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/create_image_import.rb b/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/create_image_import.rb new file mode 100644 index 000000000000..f82c328d5019 --- /dev/null +++ b/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/create_image_import.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 vmmigration_v1_generated_VMMigration_CreateImageImport_sync] +require "google/cloud/vm_migration/v1" + +## +# Snippet for the create_image_import call in the VMMigration 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::VMMigration::V1::VMMigration::Client#create_image_import. +# +def create_image_import + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VMMigration::V1::VMMigration::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VMMigration::V1::CreateImageImportRequest.new + + # Call the create_image_import method. + result = client.create_image_import 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 vmmigration_v1_generated_VMMigration_CreateImageImport_sync] diff --git a/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/create_migrating_vm.rb b/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/create_migrating_vm.rb new file mode 100644 index 000000000000..fc9a4416562c --- /dev/null +++ b/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/create_migrating_vm.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 vmmigration_v1_generated_VMMigration_CreateMigratingVm_sync] +require "google/cloud/vm_migration/v1" + +## +# Snippet for the create_migrating_vm call in the VMMigration 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::VMMigration::V1::VMMigration::Client#create_migrating_vm. +# +def create_migrating_vm + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VMMigration::V1::VMMigration::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VMMigration::V1::CreateMigratingVmRequest.new + + # Call the create_migrating_vm method. + result = client.create_migrating_vm 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 vmmigration_v1_generated_VMMigration_CreateMigratingVm_sync] diff --git a/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/create_source.rb b/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/create_source.rb new file mode 100644 index 000000000000..d986b8366a38 --- /dev/null +++ b/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/create_source.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 vmmigration_v1_generated_VMMigration_CreateSource_sync] +require "google/cloud/vm_migration/v1" + +## +# Snippet for the create_source call in the VMMigration 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::VMMigration::V1::VMMigration::Client#create_source. +# +def create_source + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VMMigration::V1::VMMigration::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VMMigration::V1::CreateSourceRequest.new + + # Call the create_source method. + result = client.create_source 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 vmmigration_v1_generated_VMMigration_CreateSource_sync] diff --git a/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/create_target_project.rb b/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/create_target_project.rb new file mode 100644 index 000000000000..9d1cca127852 --- /dev/null +++ b/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/create_target_project.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 vmmigration_v1_generated_VMMigration_CreateTargetProject_sync] +require "google/cloud/vm_migration/v1" + +## +# Snippet for the create_target_project call in the VMMigration 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::VMMigration::V1::VMMigration::Client#create_target_project. +# +def create_target_project + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VMMigration::V1::VMMigration::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VMMigration::V1::CreateTargetProjectRequest.new + + # Call the create_target_project method. + result = client.create_target_project 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 vmmigration_v1_generated_VMMigration_CreateTargetProject_sync] diff --git a/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/create_utilization_report.rb b/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/create_utilization_report.rb new file mode 100644 index 000000000000..009399161a85 --- /dev/null +++ b/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/create_utilization_report.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 vmmigration_v1_generated_VMMigration_CreateUtilizationReport_sync] +require "google/cloud/vm_migration/v1" + +## +# Snippet for the create_utilization_report call in the VMMigration 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::VMMigration::V1::VMMigration::Client#create_utilization_report. +# +def create_utilization_report + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VMMigration::V1::VMMigration::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VMMigration::V1::CreateUtilizationReportRequest.new + + # Call the create_utilization_report method. + result = client.create_utilization_report 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 vmmigration_v1_generated_VMMigration_CreateUtilizationReport_sync] diff --git a/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/delete_datacenter_connector.rb b/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/delete_datacenter_connector.rb new file mode 100644 index 000000000000..463fe61c20dc --- /dev/null +++ b/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/delete_datacenter_connector.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 vmmigration_v1_generated_VMMigration_DeleteDatacenterConnector_sync] +require "google/cloud/vm_migration/v1" + +## +# Snippet for the delete_datacenter_connector call in the VMMigration 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::VMMigration::V1::VMMigration::Client#delete_datacenter_connector. +# +def delete_datacenter_connector + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VMMigration::V1::VMMigration::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VMMigration::V1::DeleteDatacenterConnectorRequest.new + + # Call the delete_datacenter_connector method. + result = client.delete_datacenter_connector 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 vmmigration_v1_generated_VMMigration_DeleteDatacenterConnector_sync] diff --git a/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/delete_disk_migration_job.rb b/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/delete_disk_migration_job.rb new file mode 100644 index 000000000000..d3a9d8adbddc --- /dev/null +++ b/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/delete_disk_migration_job.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 vmmigration_v1_generated_VMMigration_DeleteDiskMigrationJob_sync] +require "google/cloud/vm_migration/v1" + +## +# Snippet for the delete_disk_migration_job call in the VMMigration 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::VMMigration::V1::VMMigration::Client#delete_disk_migration_job. +# +def delete_disk_migration_job + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VMMigration::V1::VMMigration::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VMMigration::V1::DeleteDiskMigrationJobRequest.new + + # Call the delete_disk_migration_job method. + result = client.delete_disk_migration_job 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 vmmigration_v1_generated_VMMigration_DeleteDiskMigrationJob_sync] diff --git a/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/delete_group.rb b/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/delete_group.rb new file mode 100644 index 000000000000..b11d471f8967 --- /dev/null +++ b/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/delete_group.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 vmmigration_v1_generated_VMMigration_DeleteGroup_sync] +require "google/cloud/vm_migration/v1" + +## +# Snippet for the delete_group call in the VMMigration 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::VMMigration::V1::VMMigration::Client#delete_group. +# +def delete_group + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VMMigration::V1::VMMigration::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VMMigration::V1::DeleteGroupRequest.new + + # Call the delete_group method. + result = client.delete_group 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 vmmigration_v1_generated_VMMigration_DeleteGroup_sync] diff --git a/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/delete_image_import.rb b/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/delete_image_import.rb new file mode 100644 index 000000000000..383e4f3c5c83 --- /dev/null +++ b/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/delete_image_import.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 vmmigration_v1_generated_VMMigration_DeleteImageImport_sync] +require "google/cloud/vm_migration/v1" + +## +# Snippet for the delete_image_import call in the VMMigration 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::VMMigration::V1::VMMigration::Client#delete_image_import. +# +def delete_image_import + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VMMigration::V1::VMMigration::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VMMigration::V1::DeleteImageImportRequest.new + + # Call the delete_image_import method. + result = client.delete_image_import 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 vmmigration_v1_generated_VMMigration_DeleteImageImport_sync] diff --git a/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/delete_migrating_vm.rb b/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/delete_migrating_vm.rb new file mode 100644 index 000000000000..21b470d541ed --- /dev/null +++ b/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/delete_migrating_vm.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 vmmigration_v1_generated_VMMigration_DeleteMigratingVm_sync] +require "google/cloud/vm_migration/v1" + +## +# Snippet for the delete_migrating_vm call in the VMMigration 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::VMMigration::V1::VMMigration::Client#delete_migrating_vm. +# +def delete_migrating_vm + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VMMigration::V1::VMMigration::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VMMigration::V1::DeleteMigratingVmRequest.new + + # Call the delete_migrating_vm method. + result = client.delete_migrating_vm 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 vmmigration_v1_generated_VMMigration_DeleteMigratingVm_sync] diff --git a/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/delete_source.rb b/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/delete_source.rb new file mode 100644 index 000000000000..5cb042230fe5 --- /dev/null +++ b/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/delete_source.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 vmmigration_v1_generated_VMMigration_DeleteSource_sync] +require "google/cloud/vm_migration/v1" + +## +# Snippet for the delete_source call in the VMMigration 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::VMMigration::V1::VMMigration::Client#delete_source. +# +def delete_source + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VMMigration::V1::VMMigration::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VMMigration::V1::DeleteSourceRequest.new + + # Call the delete_source method. + result = client.delete_source 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 vmmigration_v1_generated_VMMigration_DeleteSource_sync] diff --git a/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/delete_target_project.rb b/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/delete_target_project.rb new file mode 100644 index 000000000000..6b22965699c2 --- /dev/null +++ b/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/delete_target_project.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 vmmigration_v1_generated_VMMigration_DeleteTargetProject_sync] +require "google/cloud/vm_migration/v1" + +## +# Snippet for the delete_target_project call in the VMMigration 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::VMMigration::V1::VMMigration::Client#delete_target_project. +# +def delete_target_project + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VMMigration::V1::VMMigration::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VMMigration::V1::DeleteTargetProjectRequest.new + + # Call the delete_target_project method. + result = client.delete_target_project 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 vmmigration_v1_generated_VMMigration_DeleteTargetProject_sync] diff --git a/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/delete_utilization_report.rb b/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/delete_utilization_report.rb new file mode 100644 index 000000000000..44307f345d74 --- /dev/null +++ b/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/delete_utilization_report.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 vmmigration_v1_generated_VMMigration_DeleteUtilizationReport_sync] +require "google/cloud/vm_migration/v1" + +## +# Snippet for the delete_utilization_report call in the VMMigration 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::VMMigration::V1::VMMigration::Client#delete_utilization_report. +# +def delete_utilization_report + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VMMigration::V1::VMMigration::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VMMigration::V1::DeleteUtilizationReportRequest.new + + # Call the delete_utilization_report method. + result = client.delete_utilization_report 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 vmmigration_v1_generated_VMMigration_DeleteUtilizationReport_sync] diff --git a/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/extend_migration.rb b/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/extend_migration.rb new file mode 100644 index 000000000000..1bc8e4287a4b --- /dev/null +++ b/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/extend_migration.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 vmmigration_v1_generated_VMMigration_ExtendMigration_sync] +require "google/cloud/vm_migration/v1" + +## +# Snippet for the extend_migration call in the VMMigration 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::VMMigration::V1::VMMigration::Client#extend_migration. +# +def extend_migration + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VMMigration::V1::VMMigration::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VMMigration::V1::ExtendMigrationRequest.new + + # Call the extend_migration method. + result = client.extend_migration 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 vmmigration_v1_generated_VMMigration_ExtendMigration_sync] diff --git a/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/fetch_inventory.rb b/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/fetch_inventory.rb new file mode 100644 index 000000000000..e146b1dcaa6a --- /dev/null +++ b/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/fetch_inventory.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 vmmigration_v1_generated_VMMigration_FetchInventory_sync] +require "google/cloud/vm_migration/v1" + +## +# Snippet for the fetch_inventory call in the VMMigration 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::VMMigration::V1::VMMigration::Client#fetch_inventory. +# +def fetch_inventory + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VMMigration::V1::VMMigration::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VMMigration::V1::FetchInventoryRequest.new + + # Call the fetch_inventory method. + result = client.fetch_inventory request + + # The returned object is of type Google::Cloud::VMMigration::V1::FetchInventoryResponse. + p result +end +# [END vmmigration_v1_generated_VMMigration_FetchInventory_sync] diff --git a/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/fetch_storage_inventory.rb b/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/fetch_storage_inventory.rb new file mode 100644 index 000000000000..8d61792b3235 --- /dev/null +++ b/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/fetch_storage_inventory.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 vmmigration_v1_generated_VMMigration_FetchStorageInventory_sync] +require "google/cloud/vm_migration/v1" + +## +# Snippet for the fetch_storage_inventory call in the VMMigration 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::VMMigration::V1::VMMigration::Client#fetch_storage_inventory. +# +def fetch_storage_inventory + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VMMigration::V1::VMMigration::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VMMigration::V1::FetchStorageInventoryRequest.new + + # Call the fetch_storage_inventory method. + result = client.fetch_storage_inventory 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::VMMigration::V1::SourceStorageResource. + p item + end +end +# [END vmmigration_v1_generated_VMMigration_FetchStorageInventory_sync] diff --git a/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/finalize_migration.rb b/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/finalize_migration.rb new file mode 100644 index 000000000000..de0124a90c4f --- /dev/null +++ b/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/finalize_migration.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 vmmigration_v1_generated_VMMigration_FinalizeMigration_sync] +require "google/cloud/vm_migration/v1" + +## +# Snippet for the finalize_migration call in the VMMigration 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::VMMigration::V1::VMMigration::Client#finalize_migration. +# +def finalize_migration + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VMMigration::V1::VMMigration::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VMMigration::V1::FinalizeMigrationRequest.new + + # Call the finalize_migration method. + result = client.finalize_migration 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 vmmigration_v1_generated_VMMigration_FinalizeMigration_sync] diff --git a/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/get_clone_job.rb b/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/get_clone_job.rb new file mode 100644 index 000000000000..db517389451a --- /dev/null +++ b/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/get_clone_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 vmmigration_v1_generated_VMMigration_GetCloneJob_sync] +require "google/cloud/vm_migration/v1" + +## +# Snippet for the get_clone_job call in the VMMigration 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::VMMigration::V1::VMMigration::Client#get_clone_job. +# +def get_clone_job + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VMMigration::V1::VMMigration::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VMMigration::V1::GetCloneJobRequest.new + + # Call the get_clone_job method. + result = client.get_clone_job request + + # The returned object is of type Google::Cloud::VMMigration::V1::CloneJob. + p result +end +# [END vmmigration_v1_generated_VMMigration_GetCloneJob_sync] diff --git a/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/get_cutover_job.rb b/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/get_cutover_job.rb new file mode 100644 index 000000000000..0cd6af194485 --- /dev/null +++ b/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/get_cutover_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 vmmigration_v1_generated_VMMigration_GetCutoverJob_sync] +require "google/cloud/vm_migration/v1" + +## +# Snippet for the get_cutover_job call in the VMMigration 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::VMMigration::V1::VMMigration::Client#get_cutover_job. +# +def get_cutover_job + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VMMigration::V1::VMMigration::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VMMigration::V1::GetCutoverJobRequest.new + + # Call the get_cutover_job method. + result = client.get_cutover_job request + + # The returned object is of type Google::Cloud::VMMigration::V1::CutoverJob. + p result +end +# [END vmmigration_v1_generated_VMMigration_GetCutoverJob_sync] diff --git a/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/get_datacenter_connector.rb b/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/get_datacenter_connector.rb new file mode 100644 index 000000000000..a31d233c4c6e --- /dev/null +++ b/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/get_datacenter_connector.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 vmmigration_v1_generated_VMMigration_GetDatacenterConnector_sync] +require "google/cloud/vm_migration/v1" + +## +# Snippet for the get_datacenter_connector call in the VMMigration 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::VMMigration::V1::VMMigration::Client#get_datacenter_connector. +# +def get_datacenter_connector + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VMMigration::V1::VMMigration::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VMMigration::V1::GetDatacenterConnectorRequest.new + + # Call the get_datacenter_connector method. + result = client.get_datacenter_connector request + + # The returned object is of type Google::Cloud::VMMigration::V1::DatacenterConnector. + p result +end +# [END vmmigration_v1_generated_VMMigration_GetDatacenterConnector_sync] diff --git a/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/get_disk_migration_job.rb b/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/get_disk_migration_job.rb new file mode 100644 index 000000000000..cbe4542f985f --- /dev/null +++ b/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/get_disk_migration_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 vmmigration_v1_generated_VMMigration_GetDiskMigrationJob_sync] +require "google/cloud/vm_migration/v1" + +## +# Snippet for the get_disk_migration_job call in the VMMigration 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::VMMigration::V1::VMMigration::Client#get_disk_migration_job. +# +def get_disk_migration_job + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VMMigration::V1::VMMigration::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VMMigration::V1::GetDiskMigrationJobRequest.new + + # Call the get_disk_migration_job method. + result = client.get_disk_migration_job request + + # The returned object is of type Google::Cloud::VMMigration::V1::DiskMigrationJob. + p result +end +# [END vmmigration_v1_generated_VMMigration_GetDiskMigrationJob_sync] diff --git a/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/get_group.rb b/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/get_group.rb new file mode 100644 index 000000000000..65e2b20dfb80 --- /dev/null +++ b/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/get_group.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 vmmigration_v1_generated_VMMigration_GetGroup_sync] +require "google/cloud/vm_migration/v1" + +## +# Snippet for the get_group call in the VMMigration 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::VMMigration::V1::VMMigration::Client#get_group. +# +def get_group + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VMMigration::V1::VMMigration::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VMMigration::V1::GetGroupRequest.new + + # Call the get_group method. + result = client.get_group request + + # The returned object is of type Google::Cloud::VMMigration::V1::Group. + p result +end +# [END vmmigration_v1_generated_VMMigration_GetGroup_sync] diff --git a/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/get_image_import.rb b/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/get_image_import.rb new file mode 100644 index 000000000000..e1feb7535061 --- /dev/null +++ b/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/get_image_import.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 vmmigration_v1_generated_VMMigration_GetImageImport_sync] +require "google/cloud/vm_migration/v1" + +## +# Snippet for the get_image_import call in the VMMigration 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::VMMigration::V1::VMMigration::Client#get_image_import. +# +def get_image_import + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VMMigration::V1::VMMigration::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VMMigration::V1::GetImageImportRequest.new + + # Call the get_image_import method. + result = client.get_image_import request + + # The returned object is of type Google::Cloud::VMMigration::V1::ImageImport. + p result +end +# [END vmmigration_v1_generated_VMMigration_GetImageImport_sync] diff --git a/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/get_image_import_job.rb b/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/get_image_import_job.rb new file mode 100644 index 000000000000..ece7476fe926 --- /dev/null +++ b/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/get_image_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 vmmigration_v1_generated_VMMigration_GetImageImportJob_sync] +require "google/cloud/vm_migration/v1" + +## +# Snippet for the get_image_import_job call in the VMMigration 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::VMMigration::V1::VMMigration::Client#get_image_import_job. +# +def get_image_import_job + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VMMigration::V1::VMMigration::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VMMigration::V1::GetImageImportJobRequest.new + + # Call the get_image_import_job method. + result = client.get_image_import_job request + + # The returned object is of type Google::Cloud::VMMigration::V1::ImageImportJob. + p result +end +# [END vmmigration_v1_generated_VMMigration_GetImageImportJob_sync] diff --git a/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/get_migrating_vm.rb b/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/get_migrating_vm.rb new file mode 100644 index 000000000000..859d96d2c15d --- /dev/null +++ b/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/get_migrating_vm.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 vmmigration_v1_generated_VMMigration_GetMigratingVm_sync] +require "google/cloud/vm_migration/v1" + +## +# Snippet for the get_migrating_vm call in the VMMigration 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::VMMigration::V1::VMMigration::Client#get_migrating_vm. +# +def get_migrating_vm + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VMMigration::V1::VMMigration::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VMMigration::V1::GetMigratingVmRequest.new + + # Call the get_migrating_vm method. + result = client.get_migrating_vm request + + # The returned object is of type Google::Cloud::VMMigration::V1::MigratingVm. + p result +end +# [END vmmigration_v1_generated_VMMigration_GetMigratingVm_sync] diff --git a/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/get_replication_cycle.rb b/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/get_replication_cycle.rb new file mode 100644 index 000000000000..dcc435bb380a --- /dev/null +++ b/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/get_replication_cycle.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 vmmigration_v1_generated_VMMigration_GetReplicationCycle_sync] +require "google/cloud/vm_migration/v1" + +## +# Snippet for the get_replication_cycle call in the VMMigration 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::VMMigration::V1::VMMigration::Client#get_replication_cycle. +# +def get_replication_cycle + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VMMigration::V1::VMMigration::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VMMigration::V1::GetReplicationCycleRequest.new + + # Call the get_replication_cycle method. + result = client.get_replication_cycle request + + # The returned object is of type Google::Cloud::VMMigration::V1::ReplicationCycle. + p result +end +# [END vmmigration_v1_generated_VMMigration_GetReplicationCycle_sync] diff --git a/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/get_source.rb b/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/get_source.rb new file mode 100644 index 000000000000..65922a3256be --- /dev/null +++ b/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/get_source.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 vmmigration_v1_generated_VMMigration_GetSource_sync] +require "google/cloud/vm_migration/v1" + +## +# Snippet for the get_source call in the VMMigration 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::VMMigration::V1::VMMigration::Client#get_source. +# +def get_source + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VMMigration::V1::VMMigration::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VMMigration::V1::GetSourceRequest.new + + # Call the get_source method. + result = client.get_source request + + # The returned object is of type Google::Cloud::VMMigration::V1::Source. + p result +end +# [END vmmigration_v1_generated_VMMigration_GetSource_sync] diff --git a/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/get_target_project.rb b/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/get_target_project.rb new file mode 100644 index 000000000000..23f5cdaab240 --- /dev/null +++ b/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/get_target_project.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 vmmigration_v1_generated_VMMigration_GetTargetProject_sync] +require "google/cloud/vm_migration/v1" + +## +# Snippet for the get_target_project call in the VMMigration 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::VMMigration::V1::VMMigration::Client#get_target_project. +# +def get_target_project + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VMMigration::V1::VMMigration::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VMMigration::V1::GetTargetProjectRequest.new + + # Call the get_target_project method. + result = client.get_target_project request + + # The returned object is of type Google::Cloud::VMMigration::V1::TargetProject. + p result +end +# [END vmmigration_v1_generated_VMMigration_GetTargetProject_sync] diff --git a/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/get_utilization_report.rb b/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/get_utilization_report.rb new file mode 100644 index 000000000000..96169dfd79e6 --- /dev/null +++ b/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/get_utilization_report.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 vmmigration_v1_generated_VMMigration_GetUtilizationReport_sync] +require "google/cloud/vm_migration/v1" + +## +# Snippet for the get_utilization_report call in the VMMigration 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::VMMigration::V1::VMMigration::Client#get_utilization_report. +# +def get_utilization_report + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VMMigration::V1::VMMigration::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VMMigration::V1::GetUtilizationReportRequest.new + + # Call the get_utilization_report method. + result = client.get_utilization_report request + + # The returned object is of type Google::Cloud::VMMigration::V1::UtilizationReport. + p result +end +# [END vmmigration_v1_generated_VMMigration_GetUtilizationReport_sync] diff --git a/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/list_clone_jobs.rb b/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/list_clone_jobs.rb new file mode 100644 index 000000000000..fa1aee940d78 --- /dev/null +++ b/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/list_clone_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 vmmigration_v1_generated_VMMigration_ListCloneJobs_sync] +require "google/cloud/vm_migration/v1" + +## +# Snippet for the list_clone_jobs call in the VMMigration 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::VMMigration::V1::VMMigration::Client#list_clone_jobs. +# +def list_clone_jobs + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VMMigration::V1::VMMigration::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VMMigration::V1::ListCloneJobsRequest.new + + # Call the list_clone_jobs method. + result = client.list_clone_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::VMMigration::V1::CloneJob. + p item + end +end +# [END vmmigration_v1_generated_VMMigration_ListCloneJobs_sync] diff --git a/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/list_cutover_jobs.rb b/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/list_cutover_jobs.rb new file mode 100644 index 000000000000..5d4c02a21363 --- /dev/null +++ b/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/list_cutover_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 vmmigration_v1_generated_VMMigration_ListCutoverJobs_sync] +require "google/cloud/vm_migration/v1" + +## +# Snippet for the list_cutover_jobs call in the VMMigration 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::VMMigration::V1::VMMigration::Client#list_cutover_jobs. +# +def list_cutover_jobs + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VMMigration::V1::VMMigration::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VMMigration::V1::ListCutoverJobsRequest.new + + # Call the list_cutover_jobs method. + result = client.list_cutover_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::VMMigration::V1::CutoverJob. + p item + end +end +# [END vmmigration_v1_generated_VMMigration_ListCutoverJobs_sync] diff --git a/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/list_datacenter_connectors.rb b/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/list_datacenter_connectors.rb new file mode 100644 index 000000000000..71a339726c05 --- /dev/null +++ b/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/list_datacenter_connectors.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 vmmigration_v1_generated_VMMigration_ListDatacenterConnectors_sync] +require "google/cloud/vm_migration/v1" + +## +# Snippet for the list_datacenter_connectors call in the VMMigration 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::VMMigration::V1::VMMigration::Client#list_datacenter_connectors. +# +def list_datacenter_connectors + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VMMigration::V1::VMMigration::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VMMigration::V1::ListDatacenterConnectorsRequest.new + + # Call the list_datacenter_connectors method. + result = client.list_datacenter_connectors 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::VMMigration::V1::DatacenterConnector. + p item + end +end +# [END vmmigration_v1_generated_VMMigration_ListDatacenterConnectors_sync] diff --git a/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/list_disk_migration_jobs.rb b/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/list_disk_migration_jobs.rb new file mode 100644 index 000000000000..d64cd963c363 --- /dev/null +++ b/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/list_disk_migration_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 vmmigration_v1_generated_VMMigration_ListDiskMigrationJobs_sync] +require "google/cloud/vm_migration/v1" + +## +# Snippet for the list_disk_migration_jobs call in the VMMigration 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::VMMigration::V1::VMMigration::Client#list_disk_migration_jobs. +# +def list_disk_migration_jobs + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VMMigration::V1::VMMigration::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VMMigration::V1::ListDiskMigrationJobsRequest.new + + # Call the list_disk_migration_jobs method. + result = client.list_disk_migration_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::VMMigration::V1::DiskMigrationJob. + p item + end +end +# [END vmmigration_v1_generated_VMMigration_ListDiskMigrationJobs_sync] diff --git a/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/list_groups.rb b/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/list_groups.rb new file mode 100644 index 000000000000..a7729ec666d8 --- /dev/null +++ b/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/list_groups.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 vmmigration_v1_generated_VMMigration_ListGroups_sync] +require "google/cloud/vm_migration/v1" + +## +# Snippet for the list_groups call in the VMMigration 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::VMMigration::V1::VMMigration::Client#list_groups. +# +def list_groups + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VMMigration::V1::VMMigration::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VMMigration::V1::ListGroupsRequest.new + + # Call the list_groups method. + result = client.list_groups 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::VMMigration::V1::Group. + p item + end +end +# [END vmmigration_v1_generated_VMMigration_ListGroups_sync] diff --git a/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/list_image_import_jobs.rb b/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/list_image_import_jobs.rb new file mode 100644 index 000000000000..96ce3be98fa4 --- /dev/null +++ b/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/list_image_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 vmmigration_v1_generated_VMMigration_ListImageImportJobs_sync] +require "google/cloud/vm_migration/v1" + +## +# Snippet for the list_image_import_jobs call in the VMMigration 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::VMMigration::V1::VMMigration::Client#list_image_import_jobs. +# +def list_image_import_jobs + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VMMigration::V1::VMMigration::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VMMigration::V1::ListImageImportJobsRequest.new + + # Call the list_image_import_jobs method. + result = client.list_image_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::VMMigration::V1::ImageImportJob. + p item + end +end +# [END vmmigration_v1_generated_VMMigration_ListImageImportJobs_sync] diff --git a/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/list_image_imports.rb b/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/list_image_imports.rb new file mode 100644 index 000000000000..905e6270d997 --- /dev/null +++ b/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/list_image_imports.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 vmmigration_v1_generated_VMMigration_ListImageImports_sync] +require "google/cloud/vm_migration/v1" + +## +# Snippet for the list_image_imports call in the VMMigration 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::VMMigration::V1::VMMigration::Client#list_image_imports. +# +def list_image_imports + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VMMigration::V1::VMMigration::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VMMigration::V1::ListImageImportsRequest.new + + # Call the list_image_imports method. + result = client.list_image_imports 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::VMMigration::V1::ImageImport. + p item + end +end +# [END vmmigration_v1_generated_VMMigration_ListImageImports_sync] diff --git a/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/list_migrating_vms.rb b/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/list_migrating_vms.rb new file mode 100644 index 000000000000..ead9293bc12c --- /dev/null +++ b/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/list_migrating_vms.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 vmmigration_v1_generated_VMMigration_ListMigratingVms_sync] +require "google/cloud/vm_migration/v1" + +## +# Snippet for the list_migrating_vms call in the VMMigration 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::VMMigration::V1::VMMigration::Client#list_migrating_vms. +# +def list_migrating_vms + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VMMigration::V1::VMMigration::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VMMigration::V1::ListMigratingVmsRequest.new + + # Call the list_migrating_vms method. + result = client.list_migrating_vms 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::VMMigration::V1::MigratingVm. + p item + end +end +# [END vmmigration_v1_generated_VMMigration_ListMigratingVms_sync] diff --git a/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/list_replication_cycles.rb b/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/list_replication_cycles.rb new file mode 100644 index 000000000000..7637076854bf --- /dev/null +++ b/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/list_replication_cycles.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 vmmigration_v1_generated_VMMigration_ListReplicationCycles_sync] +require "google/cloud/vm_migration/v1" + +## +# Snippet for the list_replication_cycles call in the VMMigration 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::VMMigration::V1::VMMigration::Client#list_replication_cycles. +# +def list_replication_cycles + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VMMigration::V1::VMMigration::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VMMigration::V1::ListReplicationCyclesRequest.new + + # Call the list_replication_cycles method. + result = client.list_replication_cycles 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::VMMigration::V1::ReplicationCycle. + p item + end +end +# [END vmmigration_v1_generated_VMMigration_ListReplicationCycles_sync] diff --git a/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/list_sources.rb b/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/list_sources.rb new file mode 100644 index 000000000000..11ca8fc0fdaf --- /dev/null +++ b/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/list_sources.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 vmmigration_v1_generated_VMMigration_ListSources_sync] +require "google/cloud/vm_migration/v1" + +## +# Snippet for the list_sources call in the VMMigration 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::VMMigration::V1::VMMigration::Client#list_sources. +# +def list_sources + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VMMigration::V1::VMMigration::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VMMigration::V1::ListSourcesRequest.new + + # Call the list_sources method. + result = client.list_sources 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::VMMigration::V1::Source. + p item + end +end +# [END vmmigration_v1_generated_VMMigration_ListSources_sync] diff --git a/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/list_target_projects.rb b/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/list_target_projects.rb new file mode 100644 index 000000000000..2062be038e5c --- /dev/null +++ b/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/list_target_projects.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 vmmigration_v1_generated_VMMigration_ListTargetProjects_sync] +require "google/cloud/vm_migration/v1" + +## +# Snippet for the list_target_projects call in the VMMigration 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::VMMigration::V1::VMMigration::Client#list_target_projects. +# +def list_target_projects + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VMMigration::V1::VMMigration::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VMMigration::V1::ListTargetProjectsRequest.new + + # Call the list_target_projects method. + result = client.list_target_projects 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::VMMigration::V1::TargetProject. + p item + end +end +# [END vmmigration_v1_generated_VMMigration_ListTargetProjects_sync] diff --git a/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/list_utilization_reports.rb b/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/list_utilization_reports.rb new file mode 100644 index 000000000000..600cd348203d --- /dev/null +++ b/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/list_utilization_reports.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 vmmigration_v1_generated_VMMigration_ListUtilizationReports_sync] +require "google/cloud/vm_migration/v1" + +## +# Snippet for the list_utilization_reports call in the VMMigration 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::VMMigration::V1::VMMigration::Client#list_utilization_reports. +# +def list_utilization_reports + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VMMigration::V1::VMMigration::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VMMigration::V1::ListUtilizationReportsRequest.new + + # Call the list_utilization_reports method. + result = client.list_utilization_reports 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::VMMigration::V1::UtilizationReport. + p item + end +end +# [END vmmigration_v1_generated_VMMigration_ListUtilizationReports_sync] diff --git a/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/pause_migration.rb b/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/pause_migration.rb new file mode 100644 index 000000000000..75f9d9040507 --- /dev/null +++ b/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/pause_migration.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 vmmigration_v1_generated_VMMigration_PauseMigration_sync] +require "google/cloud/vm_migration/v1" + +## +# Snippet for the pause_migration call in the VMMigration 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::VMMigration::V1::VMMigration::Client#pause_migration. +# +def pause_migration + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VMMigration::V1::VMMigration::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VMMigration::V1::PauseMigrationRequest.new + + # Call the pause_migration method. + result = client.pause_migration 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 vmmigration_v1_generated_VMMigration_PauseMigration_sync] diff --git a/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/remove_group_migration.rb b/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/remove_group_migration.rb new file mode 100644 index 000000000000..57f34577f8e4 --- /dev/null +++ b/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/remove_group_migration.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 vmmigration_v1_generated_VMMigration_RemoveGroupMigration_sync] +require "google/cloud/vm_migration/v1" + +## +# Snippet for the remove_group_migration call in the VMMigration 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::VMMigration::V1::VMMigration::Client#remove_group_migration. +# +def remove_group_migration + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VMMigration::V1::VMMigration::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VMMigration::V1::RemoveGroupMigrationRequest.new + + # Call the remove_group_migration method. + result = client.remove_group_migration 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 vmmigration_v1_generated_VMMigration_RemoveGroupMigration_sync] diff --git a/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/resume_migration.rb b/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/resume_migration.rb new file mode 100644 index 000000000000..bf0c8f916147 --- /dev/null +++ b/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/resume_migration.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 vmmigration_v1_generated_VMMigration_ResumeMigration_sync] +require "google/cloud/vm_migration/v1" + +## +# Snippet for the resume_migration call in the VMMigration 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::VMMigration::V1::VMMigration::Client#resume_migration. +# +def resume_migration + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VMMigration::V1::VMMigration::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VMMigration::V1::ResumeMigrationRequest.new + + # Call the resume_migration method. + result = client.resume_migration 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 vmmigration_v1_generated_VMMigration_ResumeMigration_sync] diff --git a/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/run_disk_migration_job.rb b/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/run_disk_migration_job.rb new file mode 100644 index 000000000000..eb8896ebb979 --- /dev/null +++ b/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/run_disk_migration_job.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 vmmigration_v1_generated_VMMigration_RunDiskMigrationJob_sync] +require "google/cloud/vm_migration/v1" + +## +# Snippet for the run_disk_migration_job call in the VMMigration 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::VMMigration::V1::VMMigration::Client#run_disk_migration_job. +# +def run_disk_migration_job + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VMMigration::V1::VMMigration::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VMMigration::V1::RunDiskMigrationJobRequest.new + + # Call the run_disk_migration_job method. + result = client.run_disk_migration_job 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 vmmigration_v1_generated_VMMigration_RunDiskMigrationJob_sync] diff --git a/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/start_migration.rb b/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/start_migration.rb new file mode 100644 index 000000000000..a7793e5d81f0 --- /dev/null +++ b/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/start_migration.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 vmmigration_v1_generated_VMMigration_StartMigration_sync] +require "google/cloud/vm_migration/v1" + +## +# Snippet for the start_migration call in the VMMigration 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::VMMigration::V1::VMMigration::Client#start_migration. +# +def start_migration + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VMMigration::V1::VMMigration::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VMMigration::V1::StartMigrationRequest.new + + # Call the start_migration method. + result = client.start_migration 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 vmmigration_v1_generated_VMMigration_StartMigration_sync] diff --git a/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/update_disk_migration_job.rb b/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/update_disk_migration_job.rb new file mode 100644 index 000000000000..91385e19ef0c --- /dev/null +++ b/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/update_disk_migration_job.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 vmmigration_v1_generated_VMMigration_UpdateDiskMigrationJob_sync] +require "google/cloud/vm_migration/v1" + +## +# Snippet for the update_disk_migration_job call in the VMMigration 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::VMMigration::V1::VMMigration::Client#update_disk_migration_job. +# +def update_disk_migration_job + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VMMigration::V1::VMMigration::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VMMigration::V1::UpdateDiskMigrationJobRequest.new + + # Call the update_disk_migration_job method. + result = client.update_disk_migration_job 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 vmmigration_v1_generated_VMMigration_UpdateDiskMigrationJob_sync] diff --git a/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/update_group.rb b/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/update_group.rb new file mode 100644 index 000000000000..0557b00ade9f --- /dev/null +++ b/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/update_group.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 vmmigration_v1_generated_VMMigration_UpdateGroup_sync] +require "google/cloud/vm_migration/v1" + +## +# Snippet for the update_group call in the VMMigration 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::VMMigration::V1::VMMigration::Client#update_group. +# +def update_group + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VMMigration::V1::VMMigration::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VMMigration::V1::UpdateGroupRequest.new + + # Call the update_group method. + result = client.update_group 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 vmmigration_v1_generated_VMMigration_UpdateGroup_sync] diff --git a/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/update_migrating_vm.rb b/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/update_migrating_vm.rb new file mode 100644 index 000000000000..20606fa68627 --- /dev/null +++ b/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/update_migrating_vm.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 vmmigration_v1_generated_VMMigration_UpdateMigratingVm_sync] +require "google/cloud/vm_migration/v1" + +## +# Snippet for the update_migrating_vm call in the VMMigration 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::VMMigration::V1::VMMigration::Client#update_migrating_vm. +# +def update_migrating_vm + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VMMigration::V1::VMMigration::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VMMigration::V1::UpdateMigratingVmRequest.new + + # Call the update_migrating_vm method. + result = client.update_migrating_vm 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 vmmigration_v1_generated_VMMigration_UpdateMigratingVm_sync] diff --git a/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/update_source.rb b/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/update_source.rb new file mode 100644 index 000000000000..dcccdce9407c --- /dev/null +++ b/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/update_source.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 vmmigration_v1_generated_VMMigration_UpdateSource_sync] +require "google/cloud/vm_migration/v1" + +## +# Snippet for the update_source call in the VMMigration 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::VMMigration::V1::VMMigration::Client#update_source. +# +def update_source + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VMMigration::V1::VMMigration::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VMMigration::V1::UpdateSourceRequest.new + + # Call the update_source method. + result = client.update_source 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 vmmigration_v1_generated_VMMigration_UpdateSource_sync] diff --git a/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/update_target_project.rb b/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/update_target_project.rb new file mode 100644 index 000000000000..8d452955f061 --- /dev/null +++ b/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/update_target_project.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 vmmigration_v1_generated_VMMigration_UpdateTargetProject_sync] +require "google/cloud/vm_migration/v1" + +## +# Snippet for the update_target_project call in the VMMigration 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::VMMigration::V1::VMMigration::Client#update_target_project. +# +def update_target_project + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VMMigration::V1::VMMigration::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VMMigration::V1::UpdateTargetProjectRequest.new + + # Call the update_target_project method. + result = client.update_target_project 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 vmmigration_v1_generated_VMMigration_UpdateTargetProject_sync] diff --git a/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/upgrade_appliance.rb b/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/upgrade_appliance.rb new file mode 100644 index 000000000000..a9c4dfa983e0 --- /dev/null +++ b/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/upgrade_appliance.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 vmmigration_v1_generated_VMMigration_UpgradeAppliance_sync] +require "google/cloud/vm_migration/v1" + +## +# Snippet for the upgrade_appliance call in the VMMigration 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::VMMigration::V1::VMMigration::Client#upgrade_appliance. +# +def upgrade_appliance + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VMMigration::V1::VMMigration::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VMMigration::V1::UpgradeApplianceRequest.new + + # Call the upgrade_appliance method. + result = client.upgrade_appliance 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 vmmigration_v1_generated_VMMigration_UpgradeAppliance_sync] diff --git a/owl-bot-staging/google-cloud-vm_migration-v1/test/google/cloud/vm_migration/v1/vm_migration_operations_test.rb b/owl-bot-staging/google-cloud-vm_migration-v1/test/google/cloud/vm_migration/v1/vm_migration_operations_test.rb new file mode 100644 index 000000000000..098a9eb56abb --- /dev/null +++ b/owl-bot-staging/google-cloud-vm_migration-v1/test/google/cloud/vm_migration/v1/vm_migration_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/vmmigration/v1/vmmigration_pb" +require "google/cloud/vmmigration/v1/vmmigration_services_pb" +require "google/cloud/vm_migration/v1/vm_migration" + +class ::Google::Cloud::VMMigration::V1::VMMigration::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::VMMigration::V1::VMMigration::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::VMMigration::V1::VMMigration::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::VMMigration::V1::VMMigration::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::VMMigration::V1::VMMigration::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::VMMigration::V1::VMMigration::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::VMMigration::V1::VMMigration::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::VMMigration::V1::VMMigration::Operations::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-vm_migration-v1/test/google/cloud/vm_migration/v1/vm_migration_paths_test.rb b/owl-bot-staging/google-cloud-vm_migration-v1/test/google/cloud/vm_migration/v1/vm_migration_paths_test.rb new file mode 100644 index 000000000000..8708c9a2d23c --- /dev/null +++ b/owl-bot-staging/google-cloud-vm_migration-v1/test/google/cloud/vm_migration/v1/vm_migration_paths_test.rb @@ -0,0 +1,235 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/vm_migration/v1/vm_migration" + +class ::Google::Cloud::VMMigration::V1::VMMigration::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_clone_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::VMMigration::V1::VMMigration::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.clone_job_path project: "value0", location: "value1", source: "value2", migrating_vm: "value3", clone_job: "value4" + assert_equal "projects/value0/locations/value1/sources/value2/migratingVms/value3/cloneJobs/value4", path + 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::VMMigration::V1::VMMigration::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_cutover_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::VMMigration::V1::VMMigration::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.cutover_job_path project: "value0", location: "value1", source: "value2", migrating_vm: "value3", cutover_job: "value4" + assert_equal "projects/value0/locations/value1/sources/value2/migratingVms/value3/cutoverJobs/value4", path + end + end + + def test_datacenter_connector_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::VMMigration::V1::VMMigration::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.datacenter_connector_path project: "value0", location: "value1", source: "value2", datacenter_connector: "value3" + assert_equal "projects/value0/locations/value1/sources/value2/datacenterConnectors/value3", path + end + end + + def test_disk_migration_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::VMMigration::V1::VMMigration::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.disk_migration_job_path project: "value0", location: "value1", source: "value2", disk_migration_job: "value3" + assert_equal "projects/value0/locations/value1/sources/value2/diskMigrationJobs/value3", path + end + end + + def test_group_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::VMMigration::V1::VMMigration::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.group_path project: "value0", location: "value1", group: "value2" + assert_equal "projects/value0/locations/value1/groups/value2", path + end + end + + def test_image_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::VMMigration::V1::VMMigration::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.image_path project: "value0", image: "value1" + assert_equal "projects/value0/global/images/value1", path + end + end + + def test_image_import_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::VMMigration::V1::VMMigration::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.image_import_path project: "value0", location: "value1", job: "value2" + assert_equal "projects/value0/locations/value1/imageImports/value2", path + end + end + + def test_image_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::VMMigration::V1::VMMigration::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.image_import_job_path project: "value0", location: "value1", job: "value2", result: "value3" + assert_equal "projects/value0/locations/value1/imageImports/value2/imageImportJobs/value3", 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::VMMigration::V1::VMMigration::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_migrating_vm_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::VMMigration::V1::VMMigration::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.migrating_vm_path project: "value0", location: "value1", source: "value2", migrating_vm: "value3" + assert_equal "projects/value0/locations/value1/sources/value2/migratingVms/value3", path + end + end + + def test_replication_cycle_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::VMMigration::V1::VMMigration::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.replication_cycle_path project: "value0", location: "value1", source: "value2", migrating_vm: "value3", replication_cycle: "value4" + assert_equal "projects/value0/locations/value1/sources/value2/migratingVms/value3/replicationCycles/value4", path + end + end + + def test_service_account_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::VMMigration::V1::VMMigration::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.service_account_path project: "value0", service_account: "value1" + assert_equal "projects/value0/serviceAccounts/value1", path + end + end + + def test_source_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::VMMigration::V1::VMMigration::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.source_path project: "value0", location: "value1", source: "value2" + assert_equal "projects/value0/locations/value1/sources/value2", path + end + end + + def test_target_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::VMMigration::V1::VMMigration::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.target_project_path project: "value0", location: "value1", target_project: "value2" + assert_equal "projects/value0/locations/value1/targetProjects/value2", path + end + end + + def test_utilization_report_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::VMMigration::V1::VMMigration::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.utilization_report_path project: "value0", location: "value1", source: "value2", utilization_report: "value3" + assert_equal "projects/value0/locations/value1/sources/value2/utilizationReports/value3", path + end + end +end diff --git a/owl-bot-staging/google-cloud-vm_migration-v1/test/google/cloud/vm_migration/v1/vm_migration_rest_test.rb b/owl-bot-staging/google-cloud-vm_migration-v1/test/google/cloud/vm_migration/v1/vm_migration_rest_test.rb new file mode 100644 index 000000000000..5e96e39d496f --- /dev/null +++ b/owl-bot-staging/google-cloud-vm_migration-v1/test/google/cloud/vm_migration/v1/vm_migration_rest_test.rb @@ -0,0 +1,3553 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/vmmigration/v1/vmmigration_pb" +require "google/cloud/vm_migration/v1/vm_migration/rest" + + +class ::Google::Cloud::VMMigration::V1::VMMigration::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_sources + # Create test objects. + client_result = ::Google::Cloud::VMMigration::V1::ListSourcesResponse.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_sources_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::VMMigration::V1::VMMigration::Rest::ServiceStub.stub :transcode_list_sources_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_sources_client_stub do + # Create client + client = ::Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_sources({ 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_sources 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_sources ::Google::Cloud::VMMigration::V1::ListSourcesRequest.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_sources({ 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_sources(::Google::Cloud::VMMigration::V1::ListSourcesRequest.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_sources_client_stub.call_count + end + end + end + + def test_get_source + # Create test objects. + client_result = ::Google::Cloud::VMMigration::V1::Source.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_source_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::VMMigration::V1::VMMigration::Rest::ServiceStub.stub :transcode_get_source_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_source_client_stub do + # Create client + client = ::Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_source({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_source name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_source ::Google::Cloud::VMMigration::V1::GetSourceRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_source({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_source(::Google::Cloud::VMMigration::V1::GetSourceRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_source_client_stub.call_count + end + end + end + + def test_create_source + # 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" + source_id = "hello world" + source = {} + request_id = "hello world" + + create_source_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::VMMigration::V1::VMMigration::Rest::ServiceStub.stub :transcode_create_source_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_source_client_stub do + # Create client + client = ::Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_source({ parent: parent, source_id: source_id, source: source, request_id: request_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_source parent: parent, source_id: source_id, source: source, request_id: request_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_source ::Google::Cloud::VMMigration::V1::CreateSourceRequest.new(parent: parent, source_id: source_id, source: source, request_id: request_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_source({ parent: parent, source_id: source_id, source: source, request_id: request_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_source(::Google::Cloud::VMMigration::V1::CreateSourceRequest.new(parent: parent, source_id: source_id, source: source, request_id: request_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_source_client_stub.call_count + end + end + end + + def test_update_source + # 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. + update_mask = {} + source = {} + request_id = "hello world" + + update_source_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::VMMigration::V1::VMMigration::Rest::ServiceStub.stub :transcode_update_source_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_source_client_stub do + # Create client + client = ::Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_source({ update_mask: update_mask, source: source, request_id: request_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_source update_mask: update_mask, source: source, request_id: request_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_source ::Google::Cloud::VMMigration::V1::UpdateSourceRequest.new(update_mask: update_mask, source: source, request_id: request_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_source({ update_mask: update_mask, source: source, request_id: request_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_source(::Google::Cloud::VMMigration::V1::UpdateSourceRequest.new(update_mask: update_mask, source: source, request_id: request_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_source_client_stub.call_count + end + end + end + + def test_delete_source + # 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" + request_id = "hello world" + + delete_source_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::VMMigration::V1::VMMigration::Rest::ServiceStub.stub :transcode_delete_source_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_source_client_stub do + # Create client + client = ::Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_source({ name: name, request_id: request_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_source name: name, request_id: request_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_source ::Google::Cloud::VMMigration::V1::DeleteSourceRequest.new(name: name, request_id: request_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_source({ name: name, request_id: request_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_source(::Google::Cloud::VMMigration::V1::DeleteSourceRequest.new(name: name, request_id: request_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_source_client_stub.call_count + end + end + end + + def test_fetch_inventory + # Create test objects. + client_result = ::Google::Cloud::VMMigration::V1::FetchInventoryResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + source = "hello world" + force_refresh = true + + fetch_inventory_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::VMMigration::V1::VMMigration::Rest::ServiceStub.stub :transcode_fetch_inventory_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, fetch_inventory_client_stub do + # Create client + client = ::Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.fetch_inventory({ source: source, force_refresh: force_refresh }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.fetch_inventory source: source, force_refresh: force_refresh do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.fetch_inventory ::Google::Cloud::VMMigration::V1::FetchInventoryRequest.new(source: source, force_refresh: force_refresh) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.fetch_inventory({ source: source, force_refresh: force_refresh }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.fetch_inventory(::Google::Cloud::VMMigration::V1::FetchInventoryRequest.new(source: source, force_refresh: force_refresh), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, fetch_inventory_client_stub.call_count + end + end + end + + def test_fetch_storage_inventory + # Create test objects. + client_result = ::Google::Cloud::VMMigration::V1::FetchStorageInventoryResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + source = "hello world" + type = :STORAGE_TYPE_UNSPECIFIED + force_refresh = true + page_size = 42 + page_token = "hello world" + + fetch_storage_inventory_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::VMMigration::V1::VMMigration::Rest::ServiceStub.stub :transcode_fetch_storage_inventory_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, fetch_storage_inventory_client_stub do + # Create client + client = ::Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.fetch_storage_inventory({ source: source, type: type, force_refresh: force_refresh, page_size: page_size, page_token: page_token }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.fetch_storage_inventory source: source, type: type, force_refresh: force_refresh, page_size: page_size, page_token: page_token do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.fetch_storage_inventory ::Google::Cloud::VMMigration::V1::FetchStorageInventoryRequest.new(source: source, type: type, force_refresh: force_refresh, 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.fetch_storage_inventory({ source: source, type: type, force_refresh: force_refresh, 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.fetch_storage_inventory(::Google::Cloud::VMMigration::V1::FetchStorageInventoryRequest.new(source: source, type: type, force_refresh: force_refresh, 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, fetch_storage_inventory_client_stub.call_count + end + end + end + + def test_list_utilization_reports + # Create test objects. + client_result = ::Google::Cloud::VMMigration::V1::ListUtilizationReportsResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + view = :UTILIZATION_REPORT_VIEW_UNSPECIFIED + page_size = 42 + page_token = "hello world" + filter = "hello world" + order_by = "hello world" + + list_utilization_reports_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::VMMigration::V1::VMMigration::Rest::ServiceStub.stub :transcode_list_utilization_reports_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_utilization_reports_client_stub do + # Create client + client = ::Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_utilization_reports({ parent: parent, view: view, 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_utilization_reports parent: parent, view: view, 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_utilization_reports ::Google::Cloud::VMMigration::V1::ListUtilizationReportsRequest.new(parent: parent, view: view, 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_utilization_reports({ parent: parent, view: view, 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_utilization_reports(::Google::Cloud::VMMigration::V1::ListUtilizationReportsRequest.new(parent: parent, view: view, 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_utilization_reports_client_stub.call_count + end + end + end + + def test_get_utilization_report + # Create test objects. + client_result = ::Google::Cloud::VMMigration::V1::UtilizationReport.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + view = :UTILIZATION_REPORT_VIEW_UNSPECIFIED + + get_utilization_report_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::VMMigration::V1::VMMigration::Rest::ServiceStub.stub :transcode_get_utilization_report_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_utilization_report_client_stub do + # Create client + client = ::Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_utilization_report({ name: name, view: view }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_utilization_report name: name, view: view do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_utilization_report ::Google::Cloud::VMMigration::V1::GetUtilizationReportRequest.new(name: name, view: view) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_utilization_report({ name: name, view: view }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_utilization_report(::Google::Cloud::VMMigration::V1::GetUtilizationReportRequest.new(name: name, view: view), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_utilization_report_client_stub.call_count + end + end + end + + def test_create_utilization_report + # 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" + utilization_report = {} + utilization_report_id = "hello world" + request_id = "hello world" + + create_utilization_report_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::VMMigration::V1::VMMigration::Rest::ServiceStub.stub :transcode_create_utilization_report_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_utilization_report_client_stub do + # Create client + client = ::Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_utilization_report({ parent: parent, utilization_report: utilization_report, utilization_report_id: utilization_report_id, request_id: request_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_utilization_report parent: parent, utilization_report: utilization_report, utilization_report_id: utilization_report_id, request_id: request_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_utilization_report ::Google::Cloud::VMMigration::V1::CreateUtilizationReportRequest.new(parent: parent, utilization_report: utilization_report, utilization_report_id: utilization_report_id, request_id: request_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_utilization_report({ parent: parent, utilization_report: utilization_report, utilization_report_id: utilization_report_id, request_id: request_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_utilization_report(::Google::Cloud::VMMigration::V1::CreateUtilizationReportRequest.new(parent: parent, utilization_report: utilization_report, utilization_report_id: utilization_report_id, request_id: request_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_utilization_report_client_stub.call_count + end + end + end + + def test_delete_utilization_report + # 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" + request_id = "hello world" + + delete_utilization_report_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::VMMigration::V1::VMMigration::Rest::ServiceStub.stub :transcode_delete_utilization_report_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_utilization_report_client_stub do + # Create client + client = ::Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_utilization_report({ name: name, request_id: request_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_utilization_report name: name, request_id: request_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_utilization_report ::Google::Cloud::VMMigration::V1::DeleteUtilizationReportRequest.new(name: name, request_id: request_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_utilization_report({ name: name, request_id: request_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_utilization_report(::Google::Cloud::VMMigration::V1::DeleteUtilizationReportRequest.new(name: name, request_id: request_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_utilization_report_client_stub.call_count + end + end + end + + def test_list_datacenter_connectors + # Create test objects. + client_result = ::Google::Cloud::VMMigration::V1::ListDatacenterConnectorsResponse.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_datacenter_connectors_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::VMMigration::V1::VMMigration::Rest::ServiceStub.stub :transcode_list_datacenter_connectors_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_datacenter_connectors_client_stub do + # Create client + client = ::Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_datacenter_connectors({ 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_datacenter_connectors 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_datacenter_connectors ::Google::Cloud::VMMigration::V1::ListDatacenterConnectorsRequest.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_datacenter_connectors({ 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_datacenter_connectors(::Google::Cloud::VMMigration::V1::ListDatacenterConnectorsRequest.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_datacenter_connectors_client_stub.call_count + end + end + end + + def test_get_datacenter_connector + # Create test objects. + client_result = ::Google::Cloud::VMMigration::V1::DatacenterConnector.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_datacenter_connector_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::VMMigration::V1::VMMigration::Rest::ServiceStub.stub :transcode_get_datacenter_connector_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_datacenter_connector_client_stub do + # Create client + client = ::Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_datacenter_connector({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_datacenter_connector name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_datacenter_connector ::Google::Cloud::VMMigration::V1::GetDatacenterConnectorRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_datacenter_connector({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_datacenter_connector(::Google::Cloud::VMMigration::V1::GetDatacenterConnectorRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_datacenter_connector_client_stub.call_count + end + end + end + + def test_create_datacenter_connector + # 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" + datacenter_connector_id = "hello world" + datacenter_connector = {} + request_id = "hello world" + + create_datacenter_connector_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::VMMigration::V1::VMMigration::Rest::ServiceStub.stub :transcode_create_datacenter_connector_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_datacenter_connector_client_stub do + # Create client + client = ::Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_datacenter_connector({ parent: parent, datacenter_connector_id: datacenter_connector_id, datacenter_connector: datacenter_connector, request_id: request_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_datacenter_connector parent: parent, datacenter_connector_id: datacenter_connector_id, datacenter_connector: datacenter_connector, request_id: request_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_datacenter_connector ::Google::Cloud::VMMigration::V1::CreateDatacenterConnectorRequest.new(parent: parent, datacenter_connector_id: datacenter_connector_id, datacenter_connector: datacenter_connector, request_id: request_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_datacenter_connector({ parent: parent, datacenter_connector_id: datacenter_connector_id, datacenter_connector: datacenter_connector, request_id: request_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_datacenter_connector(::Google::Cloud::VMMigration::V1::CreateDatacenterConnectorRequest.new(parent: parent, datacenter_connector_id: datacenter_connector_id, datacenter_connector: datacenter_connector, request_id: request_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_datacenter_connector_client_stub.call_count + end + end + end + + def test_delete_datacenter_connector + # 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" + request_id = "hello world" + + delete_datacenter_connector_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::VMMigration::V1::VMMigration::Rest::ServiceStub.stub :transcode_delete_datacenter_connector_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_datacenter_connector_client_stub do + # Create client + client = ::Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_datacenter_connector({ name: name, request_id: request_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_datacenter_connector name: name, request_id: request_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_datacenter_connector ::Google::Cloud::VMMigration::V1::DeleteDatacenterConnectorRequest.new(name: name, request_id: request_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_datacenter_connector({ name: name, request_id: request_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_datacenter_connector(::Google::Cloud::VMMigration::V1::DeleteDatacenterConnectorRequest.new(name: name, request_id: request_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_datacenter_connector_client_stub.call_count + end + end + end + + def test_upgrade_appliance + # 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. + datacenter_connector = "hello world" + request_id = "hello world" + + upgrade_appliance_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::VMMigration::V1::VMMigration::Rest::ServiceStub.stub :transcode_upgrade_appliance_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, upgrade_appliance_client_stub do + # Create client + client = ::Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.upgrade_appliance({ datacenter_connector: datacenter_connector, request_id: request_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.upgrade_appliance datacenter_connector: datacenter_connector, request_id: request_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.upgrade_appliance ::Google::Cloud::VMMigration::V1::UpgradeApplianceRequest.new(datacenter_connector: datacenter_connector, request_id: request_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.upgrade_appliance({ datacenter_connector: datacenter_connector, request_id: request_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.upgrade_appliance(::Google::Cloud::VMMigration::V1::UpgradeApplianceRequest.new(datacenter_connector: datacenter_connector, request_id: request_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, upgrade_appliance_client_stub.call_count + end + end + end + + def test_create_migrating_vm + # 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" + migrating_vm_id = "hello world" + migrating_vm = {} + request_id = "hello world" + + create_migrating_vm_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::VMMigration::V1::VMMigration::Rest::ServiceStub.stub :transcode_create_migrating_vm_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_migrating_vm_client_stub do + # Create client + client = ::Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_migrating_vm({ parent: parent, migrating_vm_id: migrating_vm_id, migrating_vm: migrating_vm, request_id: request_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_migrating_vm parent: parent, migrating_vm_id: migrating_vm_id, migrating_vm: migrating_vm, request_id: request_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_migrating_vm ::Google::Cloud::VMMigration::V1::CreateMigratingVmRequest.new(parent: parent, migrating_vm_id: migrating_vm_id, migrating_vm: migrating_vm, request_id: request_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_migrating_vm({ parent: parent, migrating_vm_id: migrating_vm_id, migrating_vm: migrating_vm, request_id: request_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_migrating_vm(::Google::Cloud::VMMigration::V1::CreateMigratingVmRequest.new(parent: parent, migrating_vm_id: migrating_vm_id, migrating_vm: migrating_vm, request_id: request_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_migrating_vm_client_stub.call_count + end + end + end + + def test_list_migrating_vms + # Create test objects. + client_result = ::Google::Cloud::VMMigration::V1::ListMigratingVmsResponse.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" + view = :MIGRATING_VM_VIEW_UNSPECIFIED + + list_migrating_vms_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::VMMigration::V1::VMMigration::Rest::ServiceStub.stub :transcode_list_migrating_vms_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_migrating_vms_client_stub do + # Create client + client = ::Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_migrating_vms({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by, view: view }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.list_migrating_vms parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by, view: view do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.list_migrating_vms ::Google::Cloud::VMMigration::V1::ListMigratingVmsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by, view: view) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.list_migrating_vms({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by, view: view }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.list_migrating_vms(::Google::Cloud::VMMigration::V1::ListMigratingVmsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by, view: view), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, list_migrating_vms_client_stub.call_count + end + end + end + + def test_get_migrating_vm + # Create test objects. + client_result = ::Google::Cloud::VMMigration::V1::MigratingVm.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + view = :MIGRATING_VM_VIEW_UNSPECIFIED + + get_migrating_vm_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::VMMigration::V1::VMMigration::Rest::ServiceStub.stub :transcode_get_migrating_vm_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_migrating_vm_client_stub do + # Create client + client = ::Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_migrating_vm({ name: name, view: view }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_migrating_vm name: name, view: view do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_migrating_vm ::Google::Cloud::VMMigration::V1::GetMigratingVmRequest.new(name: name, view: view) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_migrating_vm({ name: name, view: view }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_migrating_vm(::Google::Cloud::VMMigration::V1::GetMigratingVmRequest.new(name: name, view: view), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_migrating_vm_client_stub.call_count + end + end + end + + def test_update_migrating_vm + # 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. + update_mask = {} + migrating_vm = {} + request_id = "hello world" + + update_migrating_vm_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::VMMigration::V1::VMMigration::Rest::ServiceStub.stub :transcode_update_migrating_vm_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_migrating_vm_client_stub do + # Create client + client = ::Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_migrating_vm({ update_mask: update_mask, migrating_vm: migrating_vm, request_id: request_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_migrating_vm update_mask: update_mask, migrating_vm: migrating_vm, request_id: request_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_migrating_vm ::Google::Cloud::VMMigration::V1::UpdateMigratingVmRequest.new(update_mask: update_mask, migrating_vm: migrating_vm, request_id: request_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_migrating_vm({ update_mask: update_mask, migrating_vm: migrating_vm, request_id: request_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_migrating_vm(::Google::Cloud::VMMigration::V1::UpdateMigratingVmRequest.new(update_mask: update_mask, migrating_vm: migrating_vm, request_id: request_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_migrating_vm_client_stub.call_count + end + end + end + + def test_delete_migrating_vm + # 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_migrating_vm_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::VMMigration::V1::VMMigration::Rest::ServiceStub.stub :transcode_delete_migrating_vm_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_migrating_vm_client_stub do + # Create client + client = ::Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_migrating_vm({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_migrating_vm name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_migrating_vm ::Google::Cloud::VMMigration::V1::DeleteMigratingVmRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_migrating_vm({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_migrating_vm(::Google::Cloud::VMMigration::V1::DeleteMigratingVmRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_migrating_vm_client_stub.call_count + end + end + end + + def test_start_migration + # 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. + migrating_vm = "hello world" + + start_migration_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::VMMigration::V1::VMMigration::Rest::ServiceStub.stub :transcode_start_migration_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, start_migration_client_stub do + # Create client + client = ::Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.start_migration({ migrating_vm: migrating_vm }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.start_migration migrating_vm: migrating_vm do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.start_migration ::Google::Cloud::VMMigration::V1::StartMigrationRequest.new(migrating_vm: migrating_vm) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.start_migration({ migrating_vm: migrating_vm }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.start_migration(::Google::Cloud::VMMigration::V1::StartMigrationRequest.new(migrating_vm: migrating_vm), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, start_migration_client_stub.call_count + end + end + end + + def test_resume_migration + # 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. + migrating_vm = "hello world" + + resume_migration_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::VMMigration::V1::VMMigration::Rest::ServiceStub.stub :transcode_resume_migration_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, resume_migration_client_stub do + # Create client + client = ::Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.resume_migration({ migrating_vm: migrating_vm }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.resume_migration migrating_vm: migrating_vm do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.resume_migration ::Google::Cloud::VMMigration::V1::ResumeMigrationRequest.new(migrating_vm: migrating_vm) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.resume_migration({ migrating_vm: migrating_vm }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.resume_migration(::Google::Cloud::VMMigration::V1::ResumeMigrationRequest.new(migrating_vm: migrating_vm), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, resume_migration_client_stub.call_count + end + end + end + + def test_pause_migration + # 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. + migrating_vm = "hello world" + + pause_migration_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::VMMigration::V1::VMMigration::Rest::ServiceStub.stub :transcode_pause_migration_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, pause_migration_client_stub do + # Create client + client = ::Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.pause_migration({ migrating_vm: migrating_vm }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.pause_migration migrating_vm: migrating_vm do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.pause_migration ::Google::Cloud::VMMigration::V1::PauseMigrationRequest.new(migrating_vm: migrating_vm) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.pause_migration({ migrating_vm: migrating_vm }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.pause_migration(::Google::Cloud::VMMigration::V1::PauseMigrationRequest.new(migrating_vm: migrating_vm), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, pause_migration_client_stub.call_count + end + end + end + + def test_finalize_migration + # 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. + migrating_vm = "hello world" + + finalize_migration_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::VMMigration::V1::VMMigration::Rest::ServiceStub.stub :transcode_finalize_migration_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, finalize_migration_client_stub do + # Create client + client = ::Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.finalize_migration({ migrating_vm: migrating_vm }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.finalize_migration migrating_vm: migrating_vm do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.finalize_migration ::Google::Cloud::VMMigration::V1::FinalizeMigrationRequest.new(migrating_vm: migrating_vm) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.finalize_migration({ migrating_vm: migrating_vm }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.finalize_migration(::Google::Cloud::VMMigration::V1::FinalizeMigrationRequest.new(migrating_vm: migrating_vm), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, finalize_migration_client_stub.call_count + end + end + end + + def test_extend_migration + # 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. + migrating_vm = "hello world" + + extend_migration_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::VMMigration::V1::VMMigration::Rest::ServiceStub.stub :transcode_extend_migration_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, extend_migration_client_stub do + # Create client + client = ::Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.extend_migration({ migrating_vm: migrating_vm }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.extend_migration migrating_vm: migrating_vm do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.extend_migration ::Google::Cloud::VMMigration::V1::ExtendMigrationRequest.new(migrating_vm: migrating_vm) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.extend_migration({ migrating_vm: migrating_vm }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.extend_migration(::Google::Cloud::VMMigration::V1::ExtendMigrationRequest.new(migrating_vm: migrating_vm), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, extend_migration_client_stub.call_count + end + end + end + + def test_create_clone_job + # 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" + clone_job_id = "hello world" + clone_job = {} + request_id = "hello world" + + create_clone_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::VMMigration::V1::VMMigration::Rest::ServiceStub.stub :transcode_create_clone_job_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_clone_job_client_stub do + # Create client + client = ::Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_clone_job({ parent: parent, clone_job_id: clone_job_id, clone_job: clone_job, request_id: request_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_clone_job parent: parent, clone_job_id: clone_job_id, clone_job: clone_job, request_id: request_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_clone_job ::Google::Cloud::VMMigration::V1::CreateCloneJobRequest.new(parent: parent, clone_job_id: clone_job_id, clone_job: clone_job, request_id: request_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_clone_job({ parent: parent, clone_job_id: clone_job_id, clone_job: clone_job, request_id: request_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_clone_job(::Google::Cloud::VMMigration::V1::CreateCloneJobRequest.new(parent: parent, clone_job_id: clone_job_id, clone_job: clone_job, request_id: request_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_clone_job_client_stub.call_count + end + end + end + + def test_cancel_clone_job + # 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" + + cancel_clone_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::VMMigration::V1::VMMigration::Rest::ServiceStub.stub :transcode_cancel_clone_job_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, cancel_clone_job_client_stub do + # Create client + client = ::Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.cancel_clone_job({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.cancel_clone_job name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.cancel_clone_job ::Google::Cloud::VMMigration::V1::CancelCloneJobRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.cancel_clone_job({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.cancel_clone_job(::Google::Cloud::VMMigration::V1::CancelCloneJobRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, cancel_clone_job_client_stub.call_count + end + end + end + + def test_list_clone_jobs + # Create test objects. + client_result = ::Google::Cloud::VMMigration::V1::ListCloneJobsResponse.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_clone_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::VMMigration::V1::VMMigration::Rest::ServiceStub.stub :transcode_list_clone_jobs_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_clone_jobs_client_stub do + # Create client + client = ::Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_clone_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_clone_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_clone_jobs ::Google::Cloud::VMMigration::V1::ListCloneJobsRequest.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_clone_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_clone_jobs(::Google::Cloud::VMMigration::V1::ListCloneJobsRequest.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_clone_jobs_client_stub.call_count + end + end + end + + def test_get_clone_job + # Create test objects. + client_result = ::Google::Cloud::VMMigration::V1::CloneJob.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_clone_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::VMMigration::V1::VMMigration::Rest::ServiceStub.stub :transcode_get_clone_job_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_clone_job_client_stub do + # Create client + client = ::Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_clone_job({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_clone_job name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_clone_job ::Google::Cloud::VMMigration::V1::GetCloneJobRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_clone_job({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_clone_job(::Google::Cloud::VMMigration::V1::GetCloneJobRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_clone_job_client_stub.call_count + end + end + end + + def test_create_cutover_job + # 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" + cutover_job_id = "hello world" + cutover_job = {} + request_id = "hello world" + + create_cutover_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::VMMigration::V1::VMMigration::Rest::ServiceStub.stub :transcode_create_cutover_job_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_cutover_job_client_stub do + # Create client + client = ::Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_cutover_job({ parent: parent, cutover_job_id: cutover_job_id, cutover_job: cutover_job, request_id: request_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_cutover_job parent: parent, cutover_job_id: cutover_job_id, cutover_job: cutover_job, request_id: request_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_cutover_job ::Google::Cloud::VMMigration::V1::CreateCutoverJobRequest.new(parent: parent, cutover_job_id: cutover_job_id, cutover_job: cutover_job, request_id: request_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_cutover_job({ parent: parent, cutover_job_id: cutover_job_id, cutover_job: cutover_job, request_id: request_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_cutover_job(::Google::Cloud::VMMigration::V1::CreateCutoverJobRequest.new(parent: parent, cutover_job_id: cutover_job_id, cutover_job: cutover_job, request_id: request_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_cutover_job_client_stub.call_count + end + end + end + + def test_cancel_cutover_job + # 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" + + cancel_cutover_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::VMMigration::V1::VMMigration::Rest::ServiceStub.stub :transcode_cancel_cutover_job_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, cancel_cutover_job_client_stub do + # Create client + client = ::Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.cancel_cutover_job({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.cancel_cutover_job name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.cancel_cutover_job ::Google::Cloud::VMMigration::V1::CancelCutoverJobRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.cancel_cutover_job({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.cancel_cutover_job(::Google::Cloud::VMMigration::V1::CancelCutoverJobRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, cancel_cutover_job_client_stub.call_count + end + end + end + + def test_list_cutover_jobs + # Create test objects. + client_result = ::Google::Cloud::VMMigration::V1::ListCutoverJobsResponse.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_cutover_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::VMMigration::V1::VMMigration::Rest::ServiceStub.stub :transcode_list_cutover_jobs_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_cutover_jobs_client_stub do + # Create client + client = ::Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_cutover_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_cutover_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_cutover_jobs ::Google::Cloud::VMMigration::V1::ListCutoverJobsRequest.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_cutover_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_cutover_jobs(::Google::Cloud::VMMigration::V1::ListCutoverJobsRequest.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_cutover_jobs_client_stub.call_count + end + end + end + + def test_get_cutover_job + # Create test objects. + client_result = ::Google::Cloud::VMMigration::V1::CutoverJob.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_cutover_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::VMMigration::V1::VMMigration::Rest::ServiceStub.stub :transcode_get_cutover_job_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_cutover_job_client_stub do + # Create client + client = ::Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_cutover_job({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_cutover_job name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_cutover_job ::Google::Cloud::VMMigration::V1::GetCutoverJobRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_cutover_job({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_cutover_job(::Google::Cloud::VMMigration::V1::GetCutoverJobRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_cutover_job_client_stub.call_count + end + end + end + + def test_list_groups + # Create test objects. + client_result = ::Google::Cloud::VMMigration::V1::ListGroupsResponse.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_groups_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::VMMigration::V1::VMMigration::Rest::ServiceStub.stub :transcode_list_groups_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_groups_client_stub do + # Create client + client = ::Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_groups({ 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_groups 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_groups ::Google::Cloud::VMMigration::V1::ListGroupsRequest.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_groups({ 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_groups(::Google::Cloud::VMMigration::V1::ListGroupsRequest.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_groups_client_stub.call_count + end + end + end + + def test_get_group + # Create test objects. + client_result = ::Google::Cloud::VMMigration::V1::Group.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_group_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::VMMigration::V1::VMMigration::Rest::ServiceStub.stub :transcode_get_group_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_group_client_stub do + # Create client + client = ::Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_group({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_group name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_group ::Google::Cloud::VMMigration::V1::GetGroupRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_group({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_group(::Google::Cloud::VMMigration::V1::GetGroupRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_group_client_stub.call_count + end + end + end + + def test_create_group + # 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" + group_id = "hello world" + group = {} + request_id = "hello world" + + create_group_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::VMMigration::V1::VMMigration::Rest::ServiceStub.stub :transcode_create_group_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_group_client_stub do + # Create client + client = ::Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_group({ parent: parent, group_id: group_id, group: group, request_id: request_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_group parent: parent, group_id: group_id, group: group, request_id: request_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_group ::Google::Cloud::VMMigration::V1::CreateGroupRequest.new(parent: parent, group_id: group_id, group: group, request_id: request_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_group({ parent: parent, group_id: group_id, group: group, request_id: request_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_group(::Google::Cloud::VMMigration::V1::CreateGroupRequest.new(parent: parent, group_id: group_id, group: group, request_id: request_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_group_client_stub.call_count + end + end + end + + def test_update_group + # 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. + update_mask = {} + group = {} + request_id = "hello world" + + update_group_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::VMMigration::V1::VMMigration::Rest::ServiceStub.stub :transcode_update_group_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_group_client_stub do + # Create client + client = ::Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_group({ update_mask: update_mask, group: group, request_id: request_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_group update_mask: update_mask, group: group, request_id: request_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_group ::Google::Cloud::VMMigration::V1::UpdateGroupRequest.new(update_mask: update_mask, group: group, request_id: request_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_group({ update_mask: update_mask, group: group, request_id: request_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_group(::Google::Cloud::VMMigration::V1::UpdateGroupRequest.new(update_mask: update_mask, group: group, request_id: request_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_group_client_stub.call_count + end + end + end + + def test_delete_group + # 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" + request_id = "hello world" + + delete_group_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::VMMigration::V1::VMMigration::Rest::ServiceStub.stub :transcode_delete_group_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_group_client_stub do + # Create client + client = ::Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_group({ name: name, request_id: request_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_group name: name, request_id: request_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_group ::Google::Cloud::VMMigration::V1::DeleteGroupRequest.new(name: name, request_id: request_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_group({ name: name, request_id: request_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_group(::Google::Cloud::VMMigration::V1::DeleteGroupRequest.new(name: name, request_id: request_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_group_client_stub.call_count + end + end + end + + def test_add_group_migration + # 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. + group = "hello world" + migrating_vm = "hello world" + + add_group_migration_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::VMMigration::V1::VMMigration::Rest::ServiceStub.stub :transcode_add_group_migration_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, add_group_migration_client_stub do + # Create client + client = ::Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.add_group_migration({ group: group, migrating_vm: migrating_vm }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.add_group_migration group: group, migrating_vm: migrating_vm do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.add_group_migration ::Google::Cloud::VMMigration::V1::AddGroupMigrationRequest.new(group: group, migrating_vm: migrating_vm) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.add_group_migration({ group: group, migrating_vm: migrating_vm }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.add_group_migration(::Google::Cloud::VMMigration::V1::AddGroupMigrationRequest.new(group: group, migrating_vm: migrating_vm), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, add_group_migration_client_stub.call_count + end + end + end + + def test_remove_group_migration + # 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. + group = "hello world" + migrating_vm = "hello world" + + remove_group_migration_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::VMMigration::V1::VMMigration::Rest::ServiceStub.stub :transcode_remove_group_migration_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, remove_group_migration_client_stub do + # Create client + client = ::Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.remove_group_migration({ group: group, migrating_vm: migrating_vm }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.remove_group_migration group: group, migrating_vm: migrating_vm do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.remove_group_migration ::Google::Cloud::VMMigration::V1::RemoveGroupMigrationRequest.new(group: group, migrating_vm: migrating_vm) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.remove_group_migration({ group: group, migrating_vm: migrating_vm }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.remove_group_migration(::Google::Cloud::VMMigration::V1::RemoveGroupMigrationRequest.new(group: group, migrating_vm: migrating_vm), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, remove_group_migration_client_stub.call_count + end + end + end + + def test_list_target_projects + # Create test objects. + client_result = ::Google::Cloud::VMMigration::V1::ListTargetProjectsResponse.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_target_projects_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::VMMigration::V1::VMMigration::Rest::ServiceStub.stub :transcode_list_target_projects_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_target_projects_client_stub do + # Create client + client = ::Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_target_projects({ 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_target_projects 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_target_projects ::Google::Cloud::VMMigration::V1::ListTargetProjectsRequest.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_target_projects({ 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_target_projects(::Google::Cloud::VMMigration::V1::ListTargetProjectsRequest.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_target_projects_client_stub.call_count + end + end + end + + def test_get_target_project + # Create test objects. + client_result = ::Google::Cloud::VMMigration::V1::TargetProject.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_target_project_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::VMMigration::V1::VMMigration::Rest::ServiceStub.stub :transcode_get_target_project_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_target_project_client_stub do + # Create client + client = ::Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_target_project({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_target_project name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_target_project ::Google::Cloud::VMMigration::V1::GetTargetProjectRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_target_project({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_target_project(::Google::Cloud::VMMigration::V1::GetTargetProjectRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_target_project_client_stub.call_count + end + end + end + + def test_create_target_project + # 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" + target_project_id = "hello world" + target_project = {} + request_id = "hello world" + + create_target_project_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::VMMigration::V1::VMMigration::Rest::ServiceStub.stub :transcode_create_target_project_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_target_project_client_stub do + # Create client + client = ::Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_target_project({ parent: parent, target_project_id: target_project_id, target_project: target_project, request_id: request_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_target_project parent: parent, target_project_id: target_project_id, target_project: target_project, request_id: request_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_target_project ::Google::Cloud::VMMigration::V1::CreateTargetProjectRequest.new(parent: parent, target_project_id: target_project_id, target_project: target_project, request_id: request_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_target_project({ parent: parent, target_project_id: target_project_id, target_project: target_project, request_id: request_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_target_project(::Google::Cloud::VMMigration::V1::CreateTargetProjectRequest.new(parent: parent, target_project_id: target_project_id, target_project: target_project, request_id: request_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_target_project_client_stub.call_count + end + end + end + + def test_update_target_project + # 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. + update_mask = {} + target_project = {} + request_id = "hello world" + + update_target_project_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::VMMigration::V1::VMMigration::Rest::ServiceStub.stub :transcode_update_target_project_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_target_project_client_stub do + # Create client + client = ::Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_target_project({ update_mask: update_mask, target_project: target_project, request_id: request_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_target_project update_mask: update_mask, target_project: target_project, request_id: request_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_target_project ::Google::Cloud::VMMigration::V1::UpdateTargetProjectRequest.new(update_mask: update_mask, target_project: target_project, request_id: request_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_target_project({ update_mask: update_mask, target_project: target_project, request_id: request_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_target_project(::Google::Cloud::VMMigration::V1::UpdateTargetProjectRequest.new(update_mask: update_mask, target_project: target_project, request_id: request_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_target_project_client_stub.call_count + end + end + end + + def test_delete_target_project + # 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" + request_id = "hello world" + + delete_target_project_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::VMMigration::V1::VMMigration::Rest::ServiceStub.stub :transcode_delete_target_project_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_target_project_client_stub do + # Create client + client = ::Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_target_project({ name: name, request_id: request_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_target_project name: name, request_id: request_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_target_project ::Google::Cloud::VMMigration::V1::DeleteTargetProjectRequest.new(name: name, request_id: request_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_target_project({ name: name, request_id: request_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_target_project(::Google::Cloud::VMMigration::V1::DeleteTargetProjectRequest.new(name: name, request_id: request_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_target_project_client_stub.call_count + end + end + end + + def test_list_replication_cycles + # Create test objects. + client_result = ::Google::Cloud::VMMigration::V1::ListReplicationCyclesResponse.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_replication_cycles_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::VMMigration::V1::VMMigration::Rest::ServiceStub.stub :transcode_list_replication_cycles_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_replication_cycles_client_stub do + # Create client + client = ::Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_replication_cycles({ 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_replication_cycles 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_replication_cycles ::Google::Cloud::VMMigration::V1::ListReplicationCyclesRequest.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_replication_cycles({ 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_replication_cycles(::Google::Cloud::VMMigration::V1::ListReplicationCyclesRequest.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_replication_cycles_client_stub.call_count + end + end + end + + def test_get_replication_cycle + # Create test objects. + client_result = ::Google::Cloud::VMMigration::V1::ReplicationCycle.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_replication_cycle_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::VMMigration::V1::VMMigration::Rest::ServiceStub.stub :transcode_get_replication_cycle_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_replication_cycle_client_stub do + # Create client + client = ::Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_replication_cycle({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_replication_cycle name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_replication_cycle ::Google::Cloud::VMMigration::V1::GetReplicationCycleRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_replication_cycle({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_replication_cycle(::Google::Cloud::VMMigration::V1::GetReplicationCycleRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_replication_cycle_client_stub.call_count + end + end + end + + def test_list_image_imports + # Create test objects. + client_result = ::Google::Cloud::VMMigration::V1::ListImageImportsResponse.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_image_imports_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::VMMigration::V1::VMMigration::Rest::ServiceStub.stub :transcode_list_image_imports_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_image_imports_client_stub do + # Create client + client = ::Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_image_imports({ 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_image_imports 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_image_imports ::Google::Cloud::VMMigration::V1::ListImageImportsRequest.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_image_imports({ 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_image_imports(::Google::Cloud::VMMigration::V1::ListImageImportsRequest.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_image_imports_client_stub.call_count + end + end + end + + def test_get_image_import + # Create test objects. + client_result = ::Google::Cloud::VMMigration::V1::ImageImport.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_image_import_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::VMMigration::V1::VMMigration::Rest::ServiceStub.stub :transcode_get_image_import_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_image_import_client_stub do + # Create client + client = ::Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_image_import({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_image_import name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_image_import ::Google::Cloud::VMMigration::V1::GetImageImportRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_image_import({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_image_import(::Google::Cloud::VMMigration::V1::GetImageImportRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_image_import_client_stub.call_count + end + end + end + + def test_create_image_import + # 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" + image_import_id = "hello world" + image_import = {} + request_id = "hello world" + + create_image_import_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::VMMigration::V1::VMMigration::Rest::ServiceStub.stub :transcode_create_image_import_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_image_import_client_stub do + # Create client + client = ::Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_image_import({ parent: parent, image_import_id: image_import_id, image_import: image_import, request_id: request_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_image_import parent: parent, image_import_id: image_import_id, image_import: image_import, request_id: request_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_image_import ::Google::Cloud::VMMigration::V1::CreateImageImportRequest.new(parent: parent, image_import_id: image_import_id, image_import: image_import, request_id: request_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_image_import({ parent: parent, image_import_id: image_import_id, image_import: image_import, request_id: request_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_image_import(::Google::Cloud::VMMigration::V1::CreateImageImportRequest.new(parent: parent, image_import_id: image_import_id, image_import: image_import, request_id: request_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_image_import_client_stub.call_count + end + end + end + + def test_delete_image_import + # 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" + request_id = "hello world" + + delete_image_import_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::VMMigration::V1::VMMigration::Rest::ServiceStub.stub :transcode_delete_image_import_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_image_import_client_stub do + # Create client + client = ::Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_image_import({ name: name, request_id: request_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_image_import name: name, request_id: request_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_image_import ::Google::Cloud::VMMigration::V1::DeleteImageImportRequest.new(name: name, request_id: request_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_image_import({ name: name, request_id: request_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_image_import(::Google::Cloud::VMMigration::V1::DeleteImageImportRequest.new(name: name, request_id: request_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_image_import_client_stub.call_count + end + end + end + + def test_list_image_import_jobs + # Create test objects. + client_result = ::Google::Cloud::VMMigration::V1::ListImageImportJobsResponse.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_image_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::VMMigration::V1::VMMigration::Rest::ServiceStub.stub :transcode_list_image_import_jobs_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_image_import_jobs_client_stub do + # Create client + client = ::Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_image_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_image_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_image_import_jobs ::Google::Cloud::VMMigration::V1::ListImageImportJobsRequest.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_image_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_image_import_jobs(::Google::Cloud::VMMigration::V1::ListImageImportJobsRequest.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_image_import_jobs_client_stub.call_count + end + end + end + + def test_get_image_import_job + # Create test objects. + client_result = ::Google::Cloud::VMMigration::V1::ImageImportJob.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_image_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::VMMigration::V1::VMMigration::Rest::ServiceStub.stub :transcode_get_image_import_job_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_image_import_job_client_stub do + # Create client + client = ::Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_image_import_job({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_image_import_job name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_image_import_job ::Google::Cloud::VMMigration::V1::GetImageImportJobRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_image_import_job({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_image_import_job(::Google::Cloud::VMMigration::V1::GetImageImportJobRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_image_import_job_client_stub.call_count + end + end + end + + def test_cancel_image_import_job + # 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" + + cancel_image_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::VMMigration::V1::VMMigration::Rest::ServiceStub.stub :transcode_cancel_image_import_job_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, cancel_image_import_job_client_stub do + # Create client + client = ::Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.cancel_image_import_job({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.cancel_image_import_job name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.cancel_image_import_job ::Google::Cloud::VMMigration::V1::CancelImageImportJobRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.cancel_image_import_job({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.cancel_image_import_job(::Google::Cloud::VMMigration::V1::CancelImageImportJobRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, cancel_image_import_job_client_stub.call_count + end + end + end + + def test_create_disk_migration_job + # 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" + disk_migration_job_id = "hello world" + disk_migration_job = {} + request_id = "hello world" + + create_disk_migration_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::VMMigration::V1::VMMigration::Rest::ServiceStub.stub :transcode_create_disk_migration_job_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_disk_migration_job_client_stub do + # Create client + client = ::Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_disk_migration_job({ parent: parent, disk_migration_job_id: disk_migration_job_id, disk_migration_job: disk_migration_job, request_id: request_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_disk_migration_job parent: parent, disk_migration_job_id: disk_migration_job_id, disk_migration_job: disk_migration_job, request_id: request_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_disk_migration_job ::Google::Cloud::VMMigration::V1::CreateDiskMigrationJobRequest.new(parent: parent, disk_migration_job_id: disk_migration_job_id, disk_migration_job: disk_migration_job, request_id: request_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_disk_migration_job({ parent: parent, disk_migration_job_id: disk_migration_job_id, disk_migration_job: disk_migration_job, request_id: request_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_disk_migration_job(::Google::Cloud::VMMigration::V1::CreateDiskMigrationJobRequest.new(parent: parent, disk_migration_job_id: disk_migration_job_id, disk_migration_job: disk_migration_job, request_id: request_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_disk_migration_job_client_stub.call_count + end + end + end + + def test_list_disk_migration_jobs + # Create test objects. + client_result = ::Google::Cloud::VMMigration::V1::ListDiskMigrationJobsResponse.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_disk_migration_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::VMMigration::V1::VMMigration::Rest::ServiceStub.stub :transcode_list_disk_migration_jobs_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_disk_migration_jobs_client_stub do + # Create client + client = ::Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_disk_migration_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_disk_migration_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_disk_migration_jobs ::Google::Cloud::VMMigration::V1::ListDiskMigrationJobsRequest.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_disk_migration_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_disk_migration_jobs(::Google::Cloud::VMMigration::V1::ListDiskMigrationJobsRequest.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_disk_migration_jobs_client_stub.call_count + end + end + end + + def test_get_disk_migration_job + # Create test objects. + client_result = ::Google::Cloud::VMMigration::V1::DiskMigrationJob.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_disk_migration_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::VMMigration::V1::VMMigration::Rest::ServiceStub.stub :transcode_get_disk_migration_job_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_disk_migration_job_client_stub do + # Create client + client = ::Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_disk_migration_job({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_disk_migration_job name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_disk_migration_job ::Google::Cloud::VMMigration::V1::GetDiskMigrationJobRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_disk_migration_job({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_disk_migration_job(::Google::Cloud::VMMigration::V1::GetDiskMigrationJobRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_disk_migration_job_client_stub.call_count + end + end + end + + def test_update_disk_migration_job + # 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. + update_mask = {} + disk_migration_job = {} + request_id = "hello world" + + update_disk_migration_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::VMMigration::V1::VMMigration::Rest::ServiceStub.stub :transcode_update_disk_migration_job_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_disk_migration_job_client_stub do + # Create client + client = ::Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_disk_migration_job({ update_mask: update_mask, disk_migration_job: disk_migration_job, request_id: request_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_disk_migration_job update_mask: update_mask, disk_migration_job: disk_migration_job, request_id: request_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_disk_migration_job ::Google::Cloud::VMMigration::V1::UpdateDiskMigrationJobRequest.new(update_mask: update_mask, disk_migration_job: disk_migration_job, request_id: request_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_disk_migration_job({ update_mask: update_mask, disk_migration_job: disk_migration_job, request_id: request_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_disk_migration_job(::Google::Cloud::VMMigration::V1::UpdateDiskMigrationJobRequest.new(update_mask: update_mask, disk_migration_job: disk_migration_job, request_id: request_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_disk_migration_job_client_stub.call_count + end + end + end + + def test_delete_disk_migration_job + # 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_disk_migration_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::VMMigration::V1::VMMigration::Rest::ServiceStub.stub :transcode_delete_disk_migration_job_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_disk_migration_job_client_stub do + # Create client + client = ::Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_disk_migration_job({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_disk_migration_job name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_disk_migration_job ::Google::Cloud::VMMigration::V1::DeleteDiskMigrationJobRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_disk_migration_job({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_disk_migration_job(::Google::Cloud::VMMigration::V1::DeleteDiskMigrationJobRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_disk_migration_job_client_stub.call_count + end + end + end + + def test_run_disk_migration_job + # 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" + + run_disk_migration_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::VMMigration::V1::VMMigration::Rest::ServiceStub.stub :transcode_run_disk_migration_job_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, run_disk_migration_job_client_stub do + # Create client + client = ::Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.run_disk_migration_job({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.run_disk_migration_job name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.run_disk_migration_job ::Google::Cloud::VMMigration::V1::RunDiskMigrationJobRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.run_disk_migration_job({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.run_disk_migration_job(::Google::Cloud::VMMigration::V1::RunDiskMigrationJobRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, run_disk_migration_job_client_stub.call_count + end + end + end + + def test_cancel_disk_migration_job + # 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" + + cancel_disk_migration_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::VMMigration::V1::VMMigration::Rest::ServiceStub.stub :transcode_cancel_disk_migration_job_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, cancel_disk_migration_job_client_stub do + # Create client + client = ::Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.cancel_disk_migration_job({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.cancel_disk_migration_job name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.cancel_disk_migration_job ::Google::Cloud::VMMigration::V1::CancelDiskMigrationJobRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.cancel_disk_migration_job({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.cancel_disk_migration_job(::Google::Cloud::VMMigration::V1::CancelDiskMigrationJobRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, cancel_disk_migration_job_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::VMMigration::V1::VMMigration::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::VMMigration::V1::VMMigration::Rest::Client::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-vm_migration-v1/test/google/cloud/vm_migration/v1/vm_migration_test.rb b/owl-bot-staging/google-cloud-vm_migration-v1/test/google/cloud/vm_migration/v1/vm_migration_test.rb new file mode 100644 index 000000000000..944b1448a6ae --- /dev/null +++ b/owl-bot-staging/google-cloud-vm_migration-v1/test/google/cloud/vm_migration/v1/vm_migration_test.rb @@ -0,0 +1,4171 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/vmmigration/v1/vmmigration_pb" +require "google/cloud/vm_migration/v1/vm_migration" + +class ::Google::Cloud::VMMigration::V1::VMMigration::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_sources + # Create GRPC objects. + grpc_response = ::Google::Cloud::VMMigration::V1::ListSourcesResponse.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_sources_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_sources, name + assert_kind_of ::Google::Cloud::VMMigration::V1::ListSourcesRequest, 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_sources_client_stub do + # Create client + client = ::Google::Cloud::VMMigration::V1::VMMigration::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_sources({ 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_sources 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_sources ::Google::Cloud::VMMigration::V1::ListSourcesRequest.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_sources({ 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_sources(::Google::Cloud::VMMigration::V1::ListSourcesRequest.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_sources_client_stub.call_rpc_count + end + end + + def test_get_source + # Create GRPC objects. + grpc_response = ::Google::Cloud::VMMigration::V1::Source.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_source_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_source, name + assert_kind_of ::Google::Cloud::VMMigration::V1::GetSourceRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_source_client_stub do + # Create client + client = ::Google::Cloud::VMMigration::V1::VMMigration::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_source({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_source name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_source ::Google::Cloud::VMMigration::V1::GetSourceRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_source({ 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_source(::Google::Cloud::VMMigration::V1::GetSourceRequest.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_source_client_stub.call_rpc_count + end + end + + def test_create_source + # 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" + source_id = "hello world" + source = {} + request_id = "hello world" + + create_source_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_source, name + assert_kind_of ::Google::Cloud::VMMigration::V1::CreateSourceRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["source_id"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::VMMigration::V1::Source), request["source"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_source_client_stub do + # Create client + client = ::Google::Cloud::VMMigration::V1::VMMigration::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_source({ parent: parent, source_id: source_id, source: source, request_id: request_id }) 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_source parent: parent, source_id: source_id, source: source, request_id: request_id 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_source ::Google::Cloud::VMMigration::V1::CreateSourceRequest.new(parent: parent, source_id: source_id, source: source, request_id: request_id) 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_source({ parent: parent, source_id: source_id, source: source, request_id: request_id }, 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_source(::Google::Cloud::VMMigration::V1::CreateSourceRequest.new(parent: parent, source_id: source_id, source: source, request_id: request_id), 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_source_client_stub.call_rpc_count + end + end + + def test_update_source + # 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. + update_mask = {} + source = {} + request_id = "hello world" + + update_source_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_source, name + assert_kind_of ::Google::Cloud::VMMigration::V1::UpdateSourceRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::VMMigration::V1::Source), request["source"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_source_client_stub do + # Create client + client = ::Google::Cloud::VMMigration::V1::VMMigration::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_source({ update_mask: update_mask, source: source, request_id: request_id }) 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.update_source update_mask: update_mask, source: source, request_id: request_id 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.update_source ::Google::Cloud::VMMigration::V1::UpdateSourceRequest.new(update_mask: update_mask, source: source, request_id: request_id) 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.update_source({ update_mask: update_mask, source: source, request_id: request_id }, 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.update_source(::Google::Cloud::VMMigration::V1::UpdateSourceRequest.new(update_mask: update_mask, source: source, request_id: request_id), 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, update_source_client_stub.call_rpc_count + end + end + + def test_delete_source + # 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" + request_id = "hello world" + + delete_source_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_source, name + assert_kind_of ::Google::Cloud::VMMigration::V1::DeleteSourceRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_source_client_stub do + # Create client + client = ::Google::Cloud::VMMigration::V1::VMMigration::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_source({ name: name, request_id: request_id }) 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_source name: name, request_id: request_id 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_source ::Google::Cloud::VMMigration::V1::DeleteSourceRequest.new(name: name, request_id: request_id) 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_source({ name: name, request_id: request_id }, 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_source(::Google::Cloud::VMMigration::V1::DeleteSourceRequest.new(name: name, request_id: request_id), 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_source_client_stub.call_rpc_count + end + end + + def test_fetch_inventory + # Create GRPC objects. + grpc_response = ::Google::Cloud::VMMigration::V1::FetchInventoryResponse.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. + source = "hello world" + force_refresh = true + + fetch_inventory_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :fetch_inventory, name + assert_kind_of ::Google::Cloud::VMMigration::V1::FetchInventoryRequest, request + assert_equal "hello world", request["source"] + assert_equal true, request["force_refresh"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, fetch_inventory_client_stub do + # Create client + client = ::Google::Cloud::VMMigration::V1::VMMigration::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.fetch_inventory({ source: source, force_refresh: force_refresh }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.fetch_inventory source: source, force_refresh: force_refresh do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.fetch_inventory ::Google::Cloud::VMMigration::V1::FetchInventoryRequest.new(source: source, force_refresh: force_refresh) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.fetch_inventory({ source: source, force_refresh: force_refresh }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.fetch_inventory(::Google::Cloud::VMMigration::V1::FetchInventoryRequest.new(source: source, force_refresh: force_refresh), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, fetch_inventory_client_stub.call_rpc_count + end + end + + def test_fetch_storage_inventory + # Create GRPC objects. + grpc_response = ::Google::Cloud::VMMigration::V1::FetchStorageInventoryResponse.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. + source = "hello world" + type = :STORAGE_TYPE_UNSPECIFIED + force_refresh = true + page_size = 42 + page_token = "hello world" + + fetch_storage_inventory_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :fetch_storage_inventory, name + assert_kind_of ::Google::Cloud::VMMigration::V1::FetchStorageInventoryRequest, request + assert_equal "hello world", request["source"] + assert_equal :STORAGE_TYPE_UNSPECIFIED, request["type"] + assert_equal true, request["force_refresh"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, fetch_storage_inventory_client_stub do + # Create client + client = ::Google::Cloud::VMMigration::V1::VMMigration::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.fetch_storage_inventory({ source: source, type: type, force_refresh: force_refresh, 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.fetch_storage_inventory source: source, type: type, force_refresh: force_refresh, 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.fetch_storage_inventory ::Google::Cloud::VMMigration::V1::FetchStorageInventoryRequest.new(source: source, type: type, force_refresh: force_refresh, 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.fetch_storage_inventory({ source: source, type: type, force_refresh: force_refresh, 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.fetch_storage_inventory(::Google::Cloud::VMMigration::V1::FetchStorageInventoryRequest.new(source: source, type: type, force_refresh: force_refresh, 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, fetch_storage_inventory_client_stub.call_rpc_count + end + end + + def test_list_utilization_reports + # Create GRPC objects. + grpc_response = ::Google::Cloud::VMMigration::V1::ListUtilizationReportsResponse.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" + view = :UTILIZATION_REPORT_VIEW_UNSPECIFIED + page_size = 42 + page_token = "hello world" + filter = "hello world" + order_by = "hello world" + + list_utilization_reports_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_utilization_reports, name + assert_kind_of ::Google::Cloud::VMMigration::V1::ListUtilizationReportsRequest, request + assert_equal "hello world", request["parent"] + assert_equal :UTILIZATION_REPORT_VIEW_UNSPECIFIED, request["view"] + 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_utilization_reports_client_stub do + # Create client + client = ::Google::Cloud::VMMigration::V1::VMMigration::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_utilization_reports({ parent: parent, view: view, 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_utilization_reports parent: parent, view: view, 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_utilization_reports ::Google::Cloud::VMMigration::V1::ListUtilizationReportsRequest.new(parent: parent, view: view, 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_utilization_reports({ parent: parent, view: view, 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_utilization_reports(::Google::Cloud::VMMigration::V1::ListUtilizationReportsRequest.new(parent: parent, view: view, 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_utilization_reports_client_stub.call_rpc_count + end + end + + def test_get_utilization_report + # Create GRPC objects. + grpc_response = ::Google::Cloud::VMMigration::V1::UtilizationReport.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" + view = :UTILIZATION_REPORT_VIEW_UNSPECIFIED + + get_utilization_report_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_utilization_report, name + assert_kind_of ::Google::Cloud::VMMigration::V1::GetUtilizationReportRequest, request + assert_equal "hello world", request["name"] + assert_equal :UTILIZATION_REPORT_VIEW_UNSPECIFIED, request["view"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_utilization_report_client_stub do + # Create client + client = ::Google::Cloud::VMMigration::V1::VMMigration::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_utilization_report({ name: name, view: view }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_utilization_report name: name, view: view do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_utilization_report ::Google::Cloud::VMMigration::V1::GetUtilizationReportRequest.new(name: name, view: view) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_utilization_report({ name: name, view: view }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_utilization_report(::Google::Cloud::VMMigration::V1::GetUtilizationReportRequest.new(name: name, view: view), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_utilization_report_client_stub.call_rpc_count + end + end + + def test_create_utilization_report + # 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" + utilization_report = {} + utilization_report_id = "hello world" + request_id = "hello world" + + create_utilization_report_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_utilization_report, name + assert_kind_of ::Google::Cloud::VMMigration::V1::CreateUtilizationReportRequest, request + assert_equal "hello world", request["parent"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::VMMigration::V1::UtilizationReport), request["utilization_report"] + assert_equal "hello world", request["utilization_report_id"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_utilization_report_client_stub do + # Create client + client = ::Google::Cloud::VMMigration::V1::VMMigration::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_utilization_report({ parent: parent, utilization_report: utilization_report, utilization_report_id: utilization_report_id, request_id: request_id }) 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_utilization_report parent: parent, utilization_report: utilization_report, utilization_report_id: utilization_report_id, request_id: request_id 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_utilization_report ::Google::Cloud::VMMigration::V1::CreateUtilizationReportRequest.new(parent: parent, utilization_report: utilization_report, utilization_report_id: utilization_report_id, request_id: request_id) 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_utilization_report({ parent: parent, utilization_report: utilization_report, utilization_report_id: utilization_report_id, request_id: request_id }, 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_utilization_report(::Google::Cloud::VMMigration::V1::CreateUtilizationReportRequest.new(parent: parent, utilization_report: utilization_report, utilization_report_id: utilization_report_id, request_id: request_id), 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_utilization_report_client_stub.call_rpc_count + end + end + + def test_delete_utilization_report + # 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" + request_id = "hello world" + + delete_utilization_report_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_utilization_report, name + assert_kind_of ::Google::Cloud::VMMigration::V1::DeleteUtilizationReportRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_utilization_report_client_stub do + # Create client + client = ::Google::Cloud::VMMigration::V1::VMMigration::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_utilization_report({ name: name, request_id: request_id }) 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_utilization_report name: name, request_id: request_id 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_utilization_report ::Google::Cloud::VMMigration::V1::DeleteUtilizationReportRequest.new(name: name, request_id: request_id) 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_utilization_report({ name: name, request_id: request_id }, 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_utilization_report(::Google::Cloud::VMMigration::V1::DeleteUtilizationReportRequest.new(name: name, request_id: request_id), 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_utilization_report_client_stub.call_rpc_count + end + end + + def test_list_datacenter_connectors + # Create GRPC objects. + grpc_response = ::Google::Cloud::VMMigration::V1::ListDatacenterConnectorsResponse.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_datacenter_connectors_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_datacenter_connectors, name + assert_kind_of ::Google::Cloud::VMMigration::V1::ListDatacenterConnectorsRequest, 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_datacenter_connectors_client_stub do + # Create client + client = ::Google::Cloud::VMMigration::V1::VMMigration::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_datacenter_connectors({ 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_datacenter_connectors 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_datacenter_connectors ::Google::Cloud::VMMigration::V1::ListDatacenterConnectorsRequest.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_datacenter_connectors({ 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_datacenter_connectors(::Google::Cloud::VMMigration::V1::ListDatacenterConnectorsRequest.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_datacenter_connectors_client_stub.call_rpc_count + end + end + + def test_get_datacenter_connector + # Create GRPC objects. + grpc_response = ::Google::Cloud::VMMigration::V1::DatacenterConnector.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_datacenter_connector_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_datacenter_connector, name + assert_kind_of ::Google::Cloud::VMMigration::V1::GetDatacenterConnectorRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_datacenter_connector_client_stub do + # Create client + client = ::Google::Cloud::VMMigration::V1::VMMigration::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_datacenter_connector({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_datacenter_connector name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_datacenter_connector ::Google::Cloud::VMMigration::V1::GetDatacenterConnectorRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_datacenter_connector({ 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_datacenter_connector(::Google::Cloud::VMMigration::V1::GetDatacenterConnectorRequest.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_datacenter_connector_client_stub.call_rpc_count + end + end + + def test_create_datacenter_connector + # 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" + datacenter_connector_id = "hello world" + datacenter_connector = {} + request_id = "hello world" + + create_datacenter_connector_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_datacenter_connector, name + assert_kind_of ::Google::Cloud::VMMigration::V1::CreateDatacenterConnectorRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["datacenter_connector_id"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::VMMigration::V1::DatacenterConnector), request["datacenter_connector"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_datacenter_connector_client_stub do + # Create client + client = ::Google::Cloud::VMMigration::V1::VMMigration::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_datacenter_connector({ parent: parent, datacenter_connector_id: datacenter_connector_id, datacenter_connector: datacenter_connector, request_id: request_id }) 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_datacenter_connector parent: parent, datacenter_connector_id: datacenter_connector_id, datacenter_connector: datacenter_connector, request_id: request_id 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_datacenter_connector ::Google::Cloud::VMMigration::V1::CreateDatacenterConnectorRequest.new(parent: parent, datacenter_connector_id: datacenter_connector_id, datacenter_connector: datacenter_connector, request_id: request_id) 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_datacenter_connector({ parent: parent, datacenter_connector_id: datacenter_connector_id, datacenter_connector: datacenter_connector, request_id: request_id }, 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_datacenter_connector(::Google::Cloud::VMMigration::V1::CreateDatacenterConnectorRequest.new(parent: parent, datacenter_connector_id: datacenter_connector_id, datacenter_connector: datacenter_connector, request_id: request_id), 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_datacenter_connector_client_stub.call_rpc_count + end + end + + def test_delete_datacenter_connector + # 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" + request_id = "hello world" + + delete_datacenter_connector_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_datacenter_connector, name + assert_kind_of ::Google::Cloud::VMMigration::V1::DeleteDatacenterConnectorRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_datacenter_connector_client_stub do + # Create client + client = ::Google::Cloud::VMMigration::V1::VMMigration::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_datacenter_connector({ name: name, request_id: request_id }) 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_datacenter_connector name: name, request_id: request_id 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_datacenter_connector ::Google::Cloud::VMMigration::V1::DeleteDatacenterConnectorRequest.new(name: name, request_id: request_id) 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_datacenter_connector({ name: name, request_id: request_id }, 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_datacenter_connector(::Google::Cloud::VMMigration::V1::DeleteDatacenterConnectorRequest.new(name: name, request_id: request_id), 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_datacenter_connector_client_stub.call_rpc_count + end + end + + def test_upgrade_appliance + # 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. + datacenter_connector = "hello world" + request_id = "hello world" + + upgrade_appliance_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :upgrade_appliance, name + assert_kind_of ::Google::Cloud::VMMigration::V1::UpgradeApplianceRequest, request + assert_equal "hello world", request["datacenter_connector"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, upgrade_appliance_client_stub do + # Create client + client = ::Google::Cloud::VMMigration::V1::VMMigration::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.upgrade_appliance({ datacenter_connector: datacenter_connector, request_id: request_id }) 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.upgrade_appliance datacenter_connector: datacenter_connector, request_id: request_id 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.upgrade_appliance ::Google::Cloud::VMMigration::V1::UpgradeApplianceRequest.new(datacenter_connector: datacenter_connector, request_id: request_id) 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.upgrade_appliance({ datacenter_connector: datacenter_connector, request_id: request_id }, 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.upgrade_appliance(::Google::Cloud::VMMigration::V1::UpgradeApplianceRequest.new(datacenter_connector: datacenter_connector, request_id: request_id), 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, upgrade_appliance_client_stub.call_rpc_count + end + end + + def test_create_migrating_vm + # 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" + migrating_vm_id = "hello world" + migrating_vm = {} + request_id = "hello world" + + create_migrating_vm_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_migrating_vm, name + assert_kind_of ::Google::Cloud::VMMigration::V1::CreateMigratingVmRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["migrating_vm_id"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::VMMigration::V1::MigratingVm), request["migrating_vm"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_migrating_vm_client_stub do + # Create client + client = ::Google::Cloud::VMMigration::V1::VMMigration::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_migrating_vm({ parent: parent, migrating_vm_id: migrating_vm_id, migrating_vm: migrating_vm, request_id: request_id }) 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_migrating_vm parent: parent, migrating_vm_id: migrating_vm_id, migrating_vm: migrating_vm, request_id: request_id 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_migrating_vm ::Google::Cloud::VMMigration::V1::CreateMigratingVmRequest.new(parent: parent, migrating_vm_id: migrating_vm_id, migrating_vm: migrating_vm, request_id: request_id) 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_migrating_vm({ parent: parent, migrating_vm_id: migrating_vm_id, migrating_vm: migrating_vm, request_id: request_id }, 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_migrating_vm(::Google::Cloud::VMMigration::V1::CreateMigratingVmRequest.new(parent: parent, migrating_vm_id: migrating_vm_id, migrating_vm: migrating_vm, request_id: request_id), 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_migrating_vm_client_stub.call_rpc_count + end + end + + def test_list_migrating_vms + # Create GRPC objects. + grpc_response = ::Google::Cloud::VMMigration::V1::ListMigratingVmsResponse.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" + view = :MIGRATING_VM_VIEW_UNSPECIFIED + + list_migrating_vms_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_migrating_vms, name + assert_kind_of ::Google::Cloud::VMMigration::V1::ListMigratingVmsRequest, 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 :MIGRATING_VM_VIEW_UNSPECIFIED, request["view"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_migrating_vms_client_stub do + # Create client + client = ::Google::Cloud::VMMigration::V1::VMMigration::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_migrating_vms({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by, view: view }) 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_migrating_vms parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by, view: view 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_migrating_vms ::Google::Cloud::VMMigration::V1::ListMigratingVmsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by, view: view) 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_migrating_vms({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by, view: view }, 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_migrating_vms(::Google::Cloud::VMMigration::V1::ListMigratingVmsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by, view: view), 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_migrating_vms_client_stub.call_rpc_count + end + end + + def test_get_migrating_vm + # Create GRPC objects. + grpc_response = ::Google::Cloud::VMMigration::V1::MigratingVm.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" + view = :MIGRATING_VM_VIEW_UNSPECIFIED + + get_migrating_vm_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_migrating_vm, name + assert_kind_of ::Google::Cloud::VMMigration::V1::GetMigratingVmRequest, request + assert_equal "hello world", request["name"] + assert_equal :MIGRATING_VM_VIEW_UNSPECIFIED, request["view"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_migrating_vm_client_stub do + # Create client + client = ::Google::Cloud::VMMigration::V1::VMMigration::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_migrating_vm({ name: name, view: view }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_migrating_vm name: name, view: view do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_migrating_vm ::Google::Cloud::VMMigration::V1::GetMigratingVmRequest.new(name: name, view: view) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_migrating_vm({ name: name, view: view }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_migrating_vm(::Google::Cloud::VMMigration::V1::GetMigratingVmRequest.new(name: name, view: view), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_migrating_vm_client_stub.call_rpc_count + end + end + + def test_update_migrating_vm + # 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. + update_mask = {} + migrating_vm = {} + request_id = "hello world" + + update_migrating_vm_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_migrating_vm, name + assert_kind_of ::Google::Cloud::VMMigration::V1::UpdateMigratingVmRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::VMMigration::V1::MigratingVm), request["migrating_vm"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_migrating_vm_client_stub do + # Create client + client = ::Google::Cloud::VMMigration::V1::VMMigration::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_migrating_vm({ update_mask: update_mask, migrating_vm: migrating_vm, request_id: request_id }) 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.update_migrating_vm update_mask: update_mask, migrating_vm: migrating_vm, request_id: request_id 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.update_migrating_vm ::Google::Cloud::VMMigration::V1::UpdateMigratingVmRequest.new(update_mask: update_mask, migrating_vm: migrating_vm, request_id: request_id) 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.update_migrating_vm({ update_mask: update_mask, migrating_vm: migrating_vm, request_id: request_id }, 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.update_migrating_vm(::Google::Cloud::VMMigration::V1::UpdateMigratingVmRequest.new(update_mask: update_mask, migrating_vm: migrating_vm, request_id: request_id), 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, update_migrating_vm_client_stub.call_rpc_count + end + end + + def test_delete_migrating_vm + # 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_migrating_vm_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_migrating_vm, name + assert_kind_of ::Google::Cloud::VMMigration::V1::DeleteMigratingVmRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_migrating_vm_client_stub do + # Create client + client = ::Google::Cloud::VMMigration::V1::VMMigration::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_migrating_vm({ 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_migrating_vm 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_migrating_vm ::Google::Cloud::VMMigration::V1::DeleteMigratingVmRequest.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_migrating_vm({ 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_migrating_vm(::Google::Cloud::VMMigration::V1::DeleteMigratingVmRequest.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_migrating_vm_client_stub.call_rpc_count + end + end + + def test_start_migration + # 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. + migrating_vm = "hello world" + + start_migration_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :start_migration, name + assert_kind_of ::Google::Cloud::VMMigration::V1::StartMigrationRequest, request + assert_equal "hello world", request["migrating_vm"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, start_migration_client_stub do + # Create client + client = ::Google::Cloud::VMMigration::V1::VMMigration::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.start_migration({ migrating_vm: migrating_vm }) 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.start_migration migrating_vm: migrating_vm 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.start_migration ::Google::Cloud::VMMigration::V1::StartMigrationRequest.new(migrating_vm: migrating_vm) 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.start_migration({ migrating_vm: migrating_vm }, 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.start_migration(::Google::Cloud::VMMigration::V1::StartMigrationRequest.new(migrating_vm: migrating_vm), 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, start_migration_client_stub.call_rpc_count + end + end + + def test_resume_migration + # 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. + migrating_vm = "hello world" + + resume_migration_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :resume_migration, name + assert_kind_of ::Google::Cloud::VMMigration::V1::ResumeMigrationRequest, request + assert_equal "hello world", request["migrating_vm"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, resume_migration_client_stub do + # Create client + client = ::Google::Cloud::VMMigration::V1::VMMigration::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.resume_migration({ migrating_vm: migrating_vm }) 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.resume_migration migrating_vm: migrating_vm 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.resume_migration ::Google::Cloud::VMMigration::V1::ResumeMigrationRequest.new(migrating_vm: migrating_vm) 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.resume_migration({ migrating_vm: migrating_vm }, 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.resume_migration(::Google::Cloud::VMMigration::V1::ResumeMigrationRequest.new(migrating_vm: migrating_vm), 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, resume_migration_client_stub.call_rpc_count + end + end + + def test_pause_migration + # 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. + migrating_vm = "hello world" + + pause_migration_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :pause_migration, name + assert_kind_of ::Google::Cloud::VMMigration::V1::PauseMigrationRequest, request + assert_equal "hello world", request["migrating_vm"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, pause_migration_client_stub do + # Create client + client = ::Google::Cloud::VMMigration::V1::VMMigration::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.pause_migration({ migrating_vm: migrating_vm }) 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.pause_migration migrating_vm: migrating_vm 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.pause_migration ::Google::Cloud::VMMigration::V1::PauseMigrationRequest.new(migrating_vm: migrating_vm) 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.pause_migration({ migrating_vm: migrating_vm }, 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.pause_migration(::Google::Cloud::VMMigration::V1::PauseMigrationRequest.new(migrating_vm: migrating_vm), 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, pause_migration_client_stub.call_rpc_count + end + end + + def test_finalize_migration + # 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. + migrating_vm = "hello world" + + finalize_migration_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :finalize_migration, name + assert_kind_of ::Google::Cloud::VMMigration::V1::FinalizeMigrationRequest, request + assert_equal "hello world", request["migrating_vm"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, finalize_migration_client_stub do + # Create client + client = ::Google::Cloud::VMMigration::V1::VMMigration::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.finalize_migration({ migrating_vm: migrating_vm }) 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.finalize_migration migrating_vm: migrating_vm 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.finalize_migration ::Google::Cloud::VMMigration::V1::FinalizeMigrationRequest.new(migrating_vm: migrating_vm) 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.finalize_migration({ migrating_vm: migrating_vm }, 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.finalize_migration(::Google::Cloud::VMMigration::V1::FinalizeMigrationRequest.new(migrating_vm: migrating_vm), 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, finalize_migration_client_stub.call_rpc_count + end + end + + def test_extend_migration + # 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. + migrating_vm = "hello world" + + extend_migration_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :extend_migration, name + assert_kind_of ::Google::Cloud::VMMigration::V1::ExtendMigrationRequest, request + assert_equal "hello world", request["migrating_vm"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, extend_migration_client_stub do + # Create client + client = ::Google::Cloud::VMMigration::V1::VMMigration::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.extend_migration({ migrating_vm: migrating_vm }) 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.extend_migration migrating_vm: migrating_vm 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.extend_migration ::Google::Cloud::VMMigration::V1::ExtendMigrationRequest.new(migrating_vm: migrating_vm) 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.extend_migration({ migrating_vm: migrating_vm }, 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.extend_migration(::Google::Cloud::VMMigration::V1::ExtendMigrationRequest.new(migrating_vm: migrating_vm), 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, extend_migration_client_stub.call_rpc_count + end + end + + def test_create_clone_job + # 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" + clone_job_id = "hello world" + clone_job = {} + request_id = "hello world" + + create_clone_job_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_clone_job, name + assert_kind_of ::Google::Cloud::VMMigration::V1::CreateCloneJobRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["clone_job_id"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::VMMigration::V1::CloneJob), request["clone_job"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_clone_job_client_stub do + # Create client + client = ::Google::Cloud::VMMigration::V1::VMMigration::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_clone_job({ parent: parent, clone_job_id: clone_job_id, clone_job: clone_job, request_id: request_id }) 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_clone_job parent: parent, clone_job_id: clone_job_id, clone_job: clone_job, request_id: request_id 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_clone_job ::Google::Cloud::VMMigration::V1::CreateCloneJobRequest.new(parent: parent, clone_job_id: clone_job_id, clone_job: clone_job, request_id: request_id) 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_clone_job({ parent: parent, clone_job_id: clone_job_id, clone_job: clone_job, request_id: request_id }, 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_clone_job(::Google::Cloud::VMMigration::V1::CreateCloneJobRequest.new(parent: parent, clone_job_id: clone_job_id, clone_job: clone_job, request_id: request_id), 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_clone_job_client_stub.call_rpc_count + end + end + + def test_cancel_clone_job + # 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" + + cancel_clone_job_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :cancel_clone_job, name + assert_kind_of ::Google::Cloud::VMMigration::V1::CancelCloneJobRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, cancel_clone_job_client_stub do + # Create client + client = ::Google::Cloud::VMMigration::V1::VMMigration::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.cancel_clone_job({ 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.cancel_clone_job 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.cancel_clone_job ::Google::Cloud::VMMigration::V1::CancelCloneJobRequest.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.cancel_clone_job({ 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.cancel_clone_job(::Google::Cloud::VMMigration::V1::CancelCloneJobRequest.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, cancel_clone_job_client_stub.call_rpc_count + end + end + + def test_list_clone_jobs + # Create GRPC objects. + grpc_response = ::Google::Cloud::VMMigration::V1::ListCloneJobsResponse.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_clone_jobs_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_clone_jobs, name + assert_kind_of ::Google::Cloud::VMMigration::V1::ListCloneJobsRequest, 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_clone_jobs_client_stub do + # Create client + client = ::Google::Cloud::VMMigration::V1::VMMigration::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_clone_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_clone_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_clone_jobs ::Google::Cloud::VMMigration::V1::ListCloneJobsRequest.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_clone_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_clone_jobs(::Google::Cloud::VMMigration::V1::ListCloneJobsRequest.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_clone_jobs_client_stub.call_rpc_count + end + end + + def test_get_clone_job + # Create GRPC objects. + grpc_response = ::Google::Cloud::VMMigration::V1::CloneJob.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_clone_job_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_clone_job, name + assert_kind_of ::Google::Cloud::VMMigration::V1::GetCloneJobRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_clone_job_client_stub do + # Create client + client = ::Google::Cloud::VMMigration::V1::VMMigration::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_clone_job({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_clone_job name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_clone_job ::Google::Cloud::VMMigration::V1::GetCloneJobRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_clone_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_clone_job(::Google::Cloud::VMMigration::V1::GetCloneJobRequest.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_clone_job_client_stub.call_rpc_count + end + end + + def test_create_cutover_job + # 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" + cutover_job_id = "hello world" + cutover_job = {} + request_id = "hello world" + + create_cutover_job_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_cutover_job, name + assert_kind_of ::Google::Cloud::VMMigration::V1::CreateCutoverJobRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["cutover_job_id"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::VMMigration::V1::CutoverJob), request["cutover_job"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_cutover_job_client_stub do + # Create client + client = ::Google::Cloud::VMMigration::V1::VMMigration::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_cutover_job({ parent: parent, cutover_job_id: cutover_job_id, cutover_job: cutover_job, request_id: request_id }) 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_cutover_job parent: parent, cutover_job_id: cutover_job_id, cutover_job: cutover_job, request_id: request_id 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_cutover_job ::Google::Cloud::VMMigration::V1::CreateCutoverJobRequest.new(parent: parent, cutover_job_id: cutover_job_id, cutover_job: cutover_job, request_id: request_id) 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_cutover_job({ parent: parent, cutover_job_id: cutover_job_id, cutover_job: cutover_job, request_id: request_id }, 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_cutover_job(::Google::Cloud::VMMigration::V1::CreateCutoverJobRequest.new(parent: parent, cutover_job_id: cutover_job_id, cutover_job: cutover_job, request_id: request_id), 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_cutover_job_client_stub.call_rpc_count + end + end + + def test_cancel_cutover_job + # 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" + + cancel_cutover_job_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :cancel_cutover_job, name + assert_kind_of ::Google::Cloud::VMMigration::V1::CancelCutoverJobRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, cancel_cutover_job_client_stub do + # Create client + client = ::Google::Cloud::VMMigration::V1::VMMigration::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.cancel_cutover_job({ 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.cancel_cutover_job 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.cancel_cutover_job ::Google::Cloud::VMMigration::V1::CancelCutoverJobRequest.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.cancel_cutover_job({ 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.cancel_cutover_job(::Google::Cloud::VMMigration::V1::CancelCutoverJobRequest.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, cancel_cutover_job_client_stub.call_rpc_count + end + end + + def test_list_cutover_jobs + # Create GRPC objects. + grpc_response = ::Google::Cloud::VMMigration::V1::ListCutoverJobsResponse.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_cutover_jobs_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_cutover_jobs, name + assert_kind_of ::Google::Cloud::VMMigration::V1::ListCutoverJobsRequest, 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_cutover_jobs_client_stub do + # Create client + client = ::Google::Cloud::VMMigration::V1::VMMigration::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_cutover_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_cutover_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_cutover_jobs ::Google::Cloud::VMMigration::V1::ListCutoverJobsRequest.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_cutover_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_cutover_jobs(::Google::Cloud::VMMigration::V1::ListCutoverJobsRequest.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_cutover_jobs_client_stub.call_rpc_count + end + end + + def test_get_cutover_job + # Create GRPC objects. + grpc_response = ::Google::Cloud::VMMigration::V1::CutoverJob.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_cutover_job_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_cutover_job, name + assert_kind_of ::Google::Cloud::VMMigration::V1::GetCutoverJobRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_cutover_job_client_stub do + # Create client + client = ::Google::Cloud::VMMigration::V1::VMMigration::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_cutover_job({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_cutover_job name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_cutover_job ::Google::Cloud::VMMigration::V1::GetCutoverJobRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_cutover_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_cutover_job(::Google::Cloud::VMMigration::V1::GetCutoverJobRequest.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_cutover_job_client_stub.call_rpc_count + end + end + + def test_list_groups + # Create GRPC objects. + grpc_response = ::Google::Cloud::VMMigration::V1::ListGroupsResponse.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_groups_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_groups, name + assert_kind_of ::Google::Cloud::VMMigration::V1::ListGroupsRequest, 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_groups_client_stub do + # Create client + client = ::Google::Cloud::VMMigration::V1::VMMigration::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_groups({ 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_groups 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_groups ::Google::Cloud::VMMigration::V1::ListGroupsRequest.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_groups({ 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_groups(::Google::Cloud::VMMigration::V1::ListGroupsRequest.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_groups_client_stub.call_rpc_count + end + end + + def test_get_group + # Create GRPC objects. + grpc_response = ::Google::Cloud::VMMigration::V1::Group.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_group_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_group, name + assert_kind_of ::Google::Cloud::VMMigration::V1::GetGroupRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_group_client_stub do + # Create client + client = ::Google::Cloud::VMMigration::V1::VMMigration::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_group({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_group name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_group ::Google::Cloud::VMMigration::V1::GetGroupRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_group({ 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_group(::Google::Cloud::VMMigration::V1::GetGroupRequest.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_group_client_stub.call_rpc_count + end + end + + def test_create_group + # 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" + group_id = "hello world" + group = {} + request_id = "hello world" + + create_group_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_group, name + assert_kind_of ::Google::Cloud::VMMigration::V1::CreateGroupRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["group_id"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::VMMigration::V1::Group), request["group"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_group_client_stub do + # Create client + client = ::Google::Cloud::VMMigration::V1::VMMigration::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_group({ parent: parent, group_id: group_id, group: group, request_id: request_id }) 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_group parent: parent, group_id: group_id, group: group, request_id: request_id 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_group ::Google::Cloud::VMMigration::V1::CreateGroupRequest.new(parent: parent, group_id: group_id, group: group, request_id: request_id) 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_group({ parent: parent, group_id: group_id, group: group, request_id: request_id }, 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_group(::Google::Cloud::VMMigration::V1::CreateGroupRequest.new(parent: parent, group_id: group_id, group: group, request_id: request_id), 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_group_client_stub.call_rpc_count + end + end + + def test_update_group + # 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. + update_mask = {} + group = {} + request_id = "hello world" + + update_group_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_group, name + assert_kind_of ::Google::Cloud::VMMigration::V1::UpdateGroupRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::VMMigration::V1::Group), request["group"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_group_client_stub do + # Create client + client = ::Google::Cloud::VMMigration::V1::VMMigration::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_group({ update_mask: update_mask, group: group, request_id: request_id }) 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.update_group update_mask: update_mask, group: group, request_id: request_id 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.update_group ::Google::Cloud::VMMigration::V1::UpdateGroupRequest.new(update_mask: update_mask, group: group, request_id: request_id) 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.update_group({ update_mask: update_mask, group: group, request_id: request_id }, 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.update_group(::Google::Cloud::VMMigration::V1::UpdateGroupRequest.new(update_mask: update_mask, group: group, request_id: request_id), 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, update_group_client_stub.call_rpc_count + end + end + + def test_delete_group + # 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" + request_id = "hello world" + + delete_group_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_group, name + assert_kind_of ::Google::Cloud::VMMigration::V1::DeleteGroupRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_group_client_stub do + # Create client + client = ::Google::Cloud::VMMigration::V1::VMMigration::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_group({ name: name, request_id: request_id }) 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_group name: name, request_id: request_id 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_group ::Google::Cloud::VMMigration::V1::DeleteGroupRequest.new(name: name, request_id: request_id) 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_group({ name: name, request_id: request_id }, 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_group(::Google::Cloud::VMMigration::V1::DeleteGroupRequest.new(name: name, request_id: request_id), 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_group_client_stub.call_rpc_count + end + end + + def test_add_group_migration + # 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. + group = "hello world" + migrating_vm = "hello world" + + add_group_migration_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :add_group_migration, name + assert_kind_of ::Google::Cloud::VMMigration::V1::AddGroupMigrationRequest, request + assert_equal "hello world", request["group"] + assert_equal "hello world", request["migrating_vm"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, add_group_migration_client_stub do + # Create client + client = ::Google::Cloud::VMMigration::V1::VMMigration::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.add_group_migration({ group: group, migrating_vm: migrating_vm }) 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.add_group_migration group: group, migrating_vm: migrating_vm 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.add_group_migration ::Google::Cloud::VMMigration::V1::AddGroupMigrationRequest.new(group: group, migrating_vm: migrating_vm) 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.add_group_migration({ group: group, migrating_vm: migrating_vm }, 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.add_group_migration(::Google::Cloud::VMMigration::V1::AddGroupMigrationRequest.new(group: group, migrating_vm: migrating_vm), 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, add_group_migration_client_stub.call_rpc_count + end + end + + def test_remove_group_migration + # 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. + group = "hello world" + migrating_vm = "hello world" + + remove_group_migration_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :remove_group_migration, name + assert_kind_of ::Google::Cloud::VMMigration::V1::RemoveGroupMigrationRequest, request + assert_equal "hello world", request["group"] + assert_equal "hello world", request["migrating_vm"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, remove_group_migration_client_stub do + # Create client + client = ::Google::Cloud::VMMigration::V1::VMMigration::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.remove_group_migration({ group: group, migrating_vm: migrating_vm }) 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.remove_group_migration group: group, migrating_vm: migrating_vm 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.remove_group_migration ::Google::Cloud::VMMigration::V1::RemoveGroupMigrationRequest.new(group: group, migrating_vm: migrating_vm) 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.remove_group_migration({ group: group, migrating_vm: migrating_vm }, 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.remove_group_migration(::Google::Cloud::VMMigration::V1::RemoveGroupMigrationRequest.new(group: group, migrating_vm: migrating_vm), 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, remove_group_migration_client_stub.call_rpc_count + end + end + + def test_list_target_projects + # Create GRPC objects. + grpc_response = ::Google::Cloud::VMMigration::V1::ListTargetProjectsResponse.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_target_projects_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_target_projects, name + assert_kind_of ::Google::Cloud::VMMigration::V1::ListTargetProjectsRequest, 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_target_projects_client_stub do + # Create client + client = ::Google::Cloud::VMMigration::V1::VMMigration::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_target_projects({ 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_target_projects 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_target_projects ::Google::Cloud::VMMigration::V1::ListTargetProjectsRequest.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_target_projects({ 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_target_projects(::Google::Cloud::VMMigration::V1::ListTargetProjectsRequest.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_target_projects_client_stub.call_rpc_count + end + end + + def test_get_target_project + # Create GRPC objects. + grpc_response = ::Google::Cloud::VMMigration::V1::TargetProject.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_target_project_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_target_project, name + assert_kind_of ::Google::Cloud::VMMigration::V1::GetTargetProjectRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_target_project_client_stub do + # Create client + client = ::Google::Cloud::VMMigration::V1::VMMigration::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_target_project({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_target_project name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_target_project ::Google::Cloud::VMMigration::V1::GetTargetProjectRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_target_project({ 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_target_project(::Google::Cloud::VMMigration::V1::GetTargetProjectRequest.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_target_project_client_stub.call_rpc_count + end + end + + def test_create_target_project + # 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" + target_project_id = "hello world" + target_project = {} + request_id = "hello world" + + create_target_project_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_target_project, name + assert_kind_of ::Google::Cloud::VMMigration::V1::CreateTargetProjectRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["target_project_id"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::VMMigration::V1::TargetProject), request["target_project"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_target_project_client_stub do + # Create client + client = ::Google::Cloud::VMMigration::V1::VMMigration::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_target_project({ parent: parent, target_project_id: target_project_id, target_project: target_project, request_id: request_id }) 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_target_project parent: parent, target_project_id: target_project_id, target_project: target_project, request_id: request_id 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_target_project ::Google::Cloud::VMMigration::V1::CreateTargetProjectRequest.new(parent: parent, target_project_id: target_project_id, target_project: target_project, request_id: request_id) 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_target_project({ parent: parent, target_project_id: target_project_id, target_project: target_project, request_id: request_id }, 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_target_project(::Google::Cloud::VMMigration::V1::CreateTargetProjectRequest.new(parent: parent, target_project_id: target_project_id, target_project: target_project, request_id: request_id), 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_target_project_client_stub.call_rpc_count + end + end + + def test_update_target_project + # 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. + update_mask = {} + target_project = {} + request_id = "hello world" + + update_target_project_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_target_project, name + assert_kind_of ::Google::Cloud::VMMigration::V1::UpdateTargetProjectRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::VMMigration::V1::TargetProject), request["target_project"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_target_project_client_stub do + # Create client + client = ::Google::Cloud::VMMigration::V1::VMMigration::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_target_project({ update_mask: update_mask, target_project: target_project, request_id: request_id }) 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.update_target_project update_mask: update_mask, target_project: target_project, request_id: request_id 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.update_target_project ::Google::Cloud::VMMigration::V1::UpdateTargetProjectRequest.new(update_mask: update_mask, target_project: target_project, request_id: request_id) 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.update_target_project({ update_mask: update_mask, target_project: target_project, request_id: request_id }, 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.update_target_project(::Google::Cloud::VMMigration::V1::UpdateTargetProjectRequest.new(update_mask: update_mask, target_project: target_project, request_id: request_id), 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, update_target_project_client_stub.call_rpc_count + end + end + + def test_delete_target_project + # 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" + request_id = "hello world" + + delete_target_project_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_target_project, name + assert_kind_of ::Google::Cloud::VMMigration::V1::DeleteTargetProjectRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_target_project_client_stub do + # Create client + client = ::Google::Cloud::VMMigration::V1::VMMigration::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_target_project({ name: name, request_id: request_id }) 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_target_project name: name, request_id: request_id 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_target_project ::Google::Cloud::VMMigration::V1::DeleteTargetProjectRequest.new(name: name, request_id: request_id) 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_target_project({ name: name, request_id: request_id }, 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_target_project(::Google::Cloud::VMMigration::V1::DeleteTargetProjectRequest.new(name: name, request_id: request_id), 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_target_project_client_stub.call_rpc_count + end + end + + def test_list_replication_cycles + # Create GRPC objects. + grpc_response = ::Google::Cloud::VMMigration::V1::ListReplicationCyclesResponse.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_replication_cycles_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_replication_cycles, name + assert_kind_of ::Google::Cloud::VMMigration::V1::ListReplicationCyclesRequest, 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_replication_cycles_client_stub do + # Create client + client = ::Google::Cloud::VMMigration::V1::VMMigration::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_replication_cycles({ 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_replication_cycles 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_replication_cycles ::Google::Cloud::VMMigration::V1::ListReplicationCyclesRequest.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_replication_cycles({ 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_replication_cycles(::Google::Cloud::VMMigration::V1::ListReplicationCyclesRequest.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_replication_cycles_client_stub.call_rpc_count + end + end + + def test_get_replication_cycle + # Create GRPC objects. + grpc_response = ::Google::Cloud::VMMigration::V1::ReplicationCycle.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_replication_cycle_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_replication_cycle, name + assert_kind_of ::Google::Cloud::VMMigration::V1::GetReplicationCycleRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_replication_cycle_client_stub do + # Create client + client = ::Google::Cloud::VMMigration::V1::VMMigration::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_replication_cycle({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_replication_cycle name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_replication_cycle ::Google::Cloud::VMMigration::V1::GetReplicationCycleRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_replication_cycle({ 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_replication_cycle(::Google::Cloud::VMMigration::V1::GetReplicationCycleRequest.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_replication_cycle_client_stub.call_rpc_count + end + end + + def test_list_image_imports + # Create GRPC objects. + grpc_response = ::Google::Cloud::VMMigration::V1::ListImageImportsResponse.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_image_imports_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_image_imports, name + assert_kind_of ::Google::Cloud::VMMigration::V1::ListImageImportsRequest, 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_image_imports_client_stub do + # Create client + client = ::Google::Cloud::VMMigration::V1::VMMigration::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_image_imports({ 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_image_imports 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_image_imports ::Google::Cloud::VMMigration::V1::ListImageImportsRequest.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_image_imports({ 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_image_imports(::Google::Cloud::VMMigration::V1::ListImageImportsRequest.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_image_imports_client_stub.call_rpc_count + end + end + + def test_get_image_import + # Create GRPC objects. + grpc_response = ::Google::Cloud::VMMigration::V1::ImageImport.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_image_import_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_image_import, name + assert_kind_of ::Google::Cloud::VMMigration::V1::GetImageImportRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_image_import_client_stub do + # Create client + client = ::Google::Cloud::VMMigration::V1::VMMigration::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_image_import({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_image_import name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_image_import ::Google::Cloud::VMMigration::V1::GetImageImportRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_image_import({ 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_image_import(::Google::Cloud::VMMigration::V1::GetImageImportRequest.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_image_import_client_stub.call_rpc_count + end + end + + def test_create_image_import + # 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" + image_import_id = "hello world" + image_import = {} + request_id = "hello world" + + create_image_import_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_image_import, name + assert_kind_of ::Google::Cloud::VMMigration::V1::CreateImageImportRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["image_import_id"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::VMMigration::V1::ImageImport), request["image_import"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_image_import_client_stub do + # Create client + client = ::Google::Cloud::VMMigration::V1::VMMigration::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_image_import({ parent: parent, image_import_id: image_import_id, image_import: image_import, request_id: request_id }) 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_image_import parent: parent, image_import_id: image_import_id, image_import: image_import, request_id: request_id 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_image_import ::Google::Cloud::VMMigration::V1::CreateImageImportRequest.new(parent: parent, image_import_id: image_import_id, image_import: image_import, request_id: request_id) 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_image_import({ parent: parent, image_import_id: image_import_id, image_import: image_import, request_id: request_id }, 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_image_import(::Google::Cloud::VMMigration::V1::CreateImageImportRequest.new(parent: parent, image_import_id: image_import_id, image_import: image_import, request_id: request_id), 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_image_import_client_stub.call_rpc_count + end + end + + def test_delete_image_import + # 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" + request_id = "hello world" + + delete_image_import_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_image_import, name + assert_kind_of ::Google::Cloud::VMMigration::V1::DeleteImageImportRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_image_import_client_stub do + # Create client + client = ::Google::Cloud::VMMigration::V1::VMMigration::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_image_import({ name: name, request_id: request_id }) 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_image_import name: name, request_id: request_id 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_image_import ::Google::Cloud::VMMigration::V1::DeleteImageImportRequest.new(name: name, request_id: request_id) 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_image_import({ name: name, request_id: request_id }, 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_image_import(::Google::Cloud::VMMigration::V1::DeleteImageImportRequest.new(name: name, request_id: request_id), 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_image_import_client_stub.call_rpc_count + end + end + + def test_list_image_import_jobs + # Create GRPC objects. + grpc_response = ::Google::Cloud::VMMigration::V1::ListImageImportJobsResponse.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_image_import_jobs_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_image_import_jobs, name + assert_kind_of ::Google::Cloud::VMMigration::V1::ListImageImportJobsRequest, 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_image_import_jobs_client_stub do + # Create client + client = ::Google::Cloud::VMMigration::V1::VMMigration::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_image_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_image_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_image_import_jobs ::Google::Cloud::VMMigration::V1::ListImageImportJobsRequest.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_image_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_image_import_jobs(::Google::Cloud::VMMigration::V1::ListImageImportJobsRequest.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_image_import_jobs_client_stub.call_rpc_count + end + end + + def test_get_image_import_job + # Create GRPC objects. + grpc_response = ::Google::Cloud::VMMigration::V1::ImageImportJob.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_image_import_job_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_image_import_job, name + assert_kind_of ::Google::Cloud::VMMigration::V1::GetImageImportJobRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_image_import_job_client_stub do + # Create client + client = ::Google::Cloud::VMMigration::V1::VMMigration::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_image_import_job({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_image_import_job name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_image_import_job ::Google::Cloud::VMMigration::V1::GetImageImportJobRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_image_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_image_import_job(::Google::Cloud::VMMigration::V1::GetImageImportJobRequest.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_image_import_job_client_stub.call_rpc_count + end + end + + def test_cancel_image_import_job + # 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" + + cancel_image_import_job_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :cancel_image_import_job, name + assert_kind_of ::Google::Cloud::VMMigration::V1::CancelImageImportJobRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, cancel_image_import_job_client_stub do + # Create client + client = ::Google::Cloud::VMMigration::V1::VMMigration::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.cancel_image_import_job({ 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.cancel_image_import_job 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.cancel_image_import_job ::Google::Cloud::VMMigration::V1::CancelImageImportJobRequest.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.cancel_image_import_job({ 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.cancel_image_import_job(::Google::Cloud::VMMigration::V1::CancelImageImportJobRequest.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, cancel_image_import_job_client_stub.call_rpc_count + end + end + + def test_create_disk_migration_job + # 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" + disk_migration_job_id = "hello world" + disk_migration_job = {} + request_id = "hello world" + + create_disk_migration_job_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_disk_migration_job, name + assert_kind_of ::Google::Cloud::VMMigration::V1::CreateDiskMigrationJobRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["disk_migration_job_id"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::VMMigration::V1::DiskMigrationJob), request["disk_migration_job"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_disk_migration_job_client_stub do + # Create client + client = ::Google::Cloud::VMMigration::V1::VMMigration::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_disk_migration_job({ parent: parent, disk_migration_job_id: disk_migration_job_id, disk_migration_job: disk_migration_job, request_id: request_id }) 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_disk_migration_job parent: parent, disk_migration_job_id: disk_migration_job_id, disk_migration_job: disk_migration_job, request_id: request_id 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_disk_migration_job ::Google::Cloud::VMMigration::V1::CreateDiskMigrationJobRequest.new(parent: parent, disk_migration_job_id: disk_migration_job_id, disk_migration_job: disk_migration_job, request_id: request_id) 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_disk_migration_job({ parent: parent, disk_migration_job_id: disk_migration_job_id, disk_migration_job: disk_migration_job, request_id: request_id }, 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_disk_migration_job(::Google::Cloud::VMMigration::V1::CreateDiskMigrationJobRequest.new(parent: parent, disk_migration_job_id: disk_migration_job_id, disk_migration_job: disk_migration_job, request_id: request_id), 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_disk_migration_job_client_stub.call_rpc_count + end + end + + def test_list_disk_migration_jobs + # Create GRPC objects. + grpc_response = ::Google::Cloud::VMMigration::V1::ListDiskMigrationJobsResponse.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_disk_migration_jobs_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_disk_migration_jobs, name + assert_kind_of ::Google::Cloud::VMMigration::V1::ListDiskMigrationJobsRequest, 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_disk_migration_jobs_client_stub do + # Create client + client = ::Google::Cloud::VMMigration::V1::VMMigration::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_disk_migration_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_disk_migration_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_disk_migration_jobs ::Google::Cloud::VMMigration::V1::ListDiskMigrationJobsRequest.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_disk_migration_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_disk_migration_jobs(::Google::Cloud::VMMigration::V1::ListDiskMigrationJobsRequest.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_disk_migration_jobs_client_stub.call_rpc_count + end + end + + def test_get_disk_migration_job + # Create GRPC objects. + grpc_response = ::Google::Cloud::VMMigration::V1::DiskMigrationJob.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_disk_migration_job_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_disk_migration_job, name + assert_kind_of ::Google::Cloud::VMMigration::V1::GetDiskMigrationJobRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_disk_migration_job_client_stub do + # Create client + client = ::Google::Cloud::VMMigration::V1::VMMigration::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_disk_migration_job({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_disk_migration_job name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_disk_migration_job ::Google::Cloud::VMMigration::V1::GetDiskMigrationJobRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_disk_migration_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_disk_migration_job(::Google::Cloud::VMMigration::V1::GetDiskMigrationJobRequest.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_disk_migration_job_client_stub.call_rpc_count + end + end + + def test_update_disk_migration_job + # 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. + update_mask = {} + disk_migration_job = {} + request_id = "hello world" + + update_disk_migration_job_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_disk_migration_job, name + assert_kind_of ::Google::Cloud::VMMigration::V1::UpdateDiskMigrationJobRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::VMMigration::V1::DiskMigrationJob), request["disk_migration_job"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_disk_migration_job_client_stub do + # Create client + client = ::Google::Cloud::VMMigration::V1::VMMigration::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_disk_migration_job({ update_mask: update_mask, disk_migration_job: disk_migration_job, request_id: request_id }) 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.update_disk_migration_job update_mask: update_mask, disk_migration_job: disk_migration_job, request_id: request_id 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.update_disk_migration_job ::Google::Cloud::VMMigration::V1::UpdateDiskMigrationJobRequest.new(update_mask: update_mask, disk_migration_job: disk_migration_job, request_id: request_id) 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.update_disk_migration_job({ update_mask: update_mask, disk_migration_job: disk_migration_job, request_id: request_id }, 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.update_disk_migration_job(::Google::Cloud::VMMigration::V1::UpdateDiskMigrationJobRequest.new(update_mask: update_mask, disk_migration_job: disk_migration_job, request_id: request_id), 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, update_disk_migration_job_client_stub.call_rpc_count + end + end + + def test_delete_disk_migration_job + # 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_disk_migration_job_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_disk_migration_job, name + assert_kind_of ::Google::Cloud::VMMigration::V1::DeleteDiskMigrationJobRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_disk_migration_job_client_stub do + # Create client + client = ::Google::Cloud::VMMigration::V1::VMMigration::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_disk_migration_job({ 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_disk_migration_job 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_disk_migration_job ::Google::Cloud::VMMigration::V1::DeleteDiskMigrationJobRequest.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_disk_migration_job({ 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_disk_migration_job(::Google::Cloud::VMMigration::V1::DeleteDiskMigrationJobRequest.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_disk_migration_job_client_stub.call_rpc_count + end + end + + def test_run_disk_migration_job + # 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" + + run_disk_migration_job_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :run_disk_migration_job, name + assert_kind_of ::Google::Cloud::VMMigration::V1::RunDiskMigrationJobRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, run_disk_migration_job_client_stub do + # Create client + client = ::Google::Cloud::VMMigration::V1::VMMigration::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.run_disk_migration_job({ 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.run_disk_migration_job 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.run_disk_migration_job ::Google::Cloud::VMMigration::V1::RunDiskMigrationJobRequest.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.run_disk_migration_job({ 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.run_disk_migration_job(::Google::Cloud::VMMigration::V1::RunDiskMigrationJobRequest.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, run_disk_migration_job_client_stub.call_rpc_count + end + end + + def test_cancel_disk_migration_job + # 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" + + cancel_disk_migration_job_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :cancel_disk_migration_job, name + assert_kind_of ::Google::Cloud::VMMigration::V1::CancelDiskMigrationJobRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, cancel_disk_migration_job_client_stub do + # Create client + client = ::Google::Cloud::VMMigration::V1::VMMigration::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.cancel_disk_migration_job({ 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.cancel_disk_migration_job 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.cancel_disk_migration_job ::Google::Cloud::VMMigration::V1::CancelDiskMigrationJobRequest.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.cancel_disk_migration_job({ 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.cancel_disk_migration_job(::Google::Cloud::VMMigration::V1::CancelDiskMigrationJobRequest.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, cancel_disk_migration_job_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::VMMigration::V1::VMMigration::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::VMMigration::V1::VMMigration::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::VMMigration::V1::VMMigration::Client.new do |config| + config.credentials = creds + end + assert_kind_of ::Google::Cloud::VMMigration::V1::VMMigration::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::VMMigration::V1::VMMigration::Client.new do |config| + config.credentials = grpc_channel + end + end + + assert_kind_of ::Google::Cloud::VMMigration::V1::VMMigration::Operations, client.operations_client + end +end diff --git a/owl-bot-staging/google-cloud-vm_migration-v1/test/google/iam/v1/iam_policy_rest_test.rb b/owl-bot-staging/google-cloud-vm_migration-v1/test/google/iam/v1/iam_policy_rest_test.rb new file mode 100644 index 000000000000..5872de89cd6b --- /dev/null +++ b/owl-bot-staging/google-cloud-vm_migration-v1/test/google/iam/v1/iam_policy_rest_test.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 "helper" +require "gapic/rest" +require "google/iam/v1/iam_policy_pb" +require "google/iam/v1/iam_policy/rest" + + +class ::Google::Iam::V1::IAMPolicy::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_set_iam_policy + # Create test objects. + client_result = ::Google::Iam::V1::Policy.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + resource = "hello world" + policy = {} + update_mask = {} + + set_iam_policy_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::Iam::V1::IAMPolicy::Rest::ServiceStub.stub :transcode_set_iam_policy_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, set_iam_policy_client_stub do + # Create client + client = ::Google::Iam::V1::IAMPolicy::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.set_iam_policy({ resource: resource, policy: policy, update_mask: update_mask }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.set_iam_policy resource: resource, policy: policy, update_mask: update_mask do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.set_iam_policy ::Google::Iam::V1::SetIamPolicyRequest.new(resource: resource, policy: policy, update_mask: update_mask) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.set_iam_policy({ resource: resource, policy: policy, update_mask: update_mask }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.set_iam_policy(::Google::Iam::V1::SetIamPolicyRequest.new(resource: resource, policy: policy, update_mask: update_mask), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, set_iam_policy_client_stub.call_count + end + end + end + + def test_get_iam_policy + # Create test objects. + client_result = ::Google::Iam::V1::Policy.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + resource = "hello world" + options = {} + + get_iam_policy_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::Iam::V1::IAMPolicy::Rest::ServiceStub.stub :transcode_get_iam_policy_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_iam_policy_client_stub do + # Create client + client = ::Google::Iam::V1::IAMPolicy::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_iam_policy({ resource: resource, options: options }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_iam_policy resource: resource, options: options do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_iam_policy ::Google::Iam::V1::GetIamPolicyRequest.new(resource: resource, options: options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_iam_policy({ resource: resource, options: options }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_iam_policy(::Google::Iam::V1::GetIamPolicyRequest.new(resource: resource, options: options), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_iam_policy_client_stub.call_count + end + end + end + + def test_test_iam_permissions + # Create test objects. + client_result = ::Google::Iam::V1::TestIamPermissionsResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + resource = "hello world" + permissions = ["hello world"] + + test_iam_permissions_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::Iam::V1::IAMPolicy::Rest::ServiceStub.stub :transcode_test_iam_permissions_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, test_iam_permissions_client_stub do + # Create client + client = ::Google::Iam::V1::IAMPolicy::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.test_iam_permissions({ resource: resource, permissions: permissions }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.test_iam_permissions resource: resource, permissions: permissions do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.test_iam_permissions ::Google::Iam::V1::TestIamPermissionsRequest.new(resource: resource, permissions: permissions) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.test_iam_permissions({ resource: resource, permissions: permissions }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.test_iam_permissions(::Google::Iam::V1::TestIamPermissionsRequest.new(resource: resource, permissions: permissions), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, test_iam_permissions_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::Iam::V1::IAMPolicy::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::Iam::V1::IAMPolicy::Rest::Client::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-vm_migration-v1/test/google/iam/v1/iam_policy_test.rb b/owl-bot-staging/google-cloud-vm_migration-v1/test/google/iam/v1/iam_policy_test.rb new file mode 100644 index 000000000000..fbfb3e8939bd --- /dev/null +++ b/owl-bot-staging/google-cloud-vm_migration-v1/test/google/iam/v1/iam_policy_test.rb @@ -0,0 +1,286 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/iam/v1/iam_policy_pb" +require "google/iam/v1/iam_policy" + +class ::Google::Iam::V1::IAMPolicy::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_set_iam_policy + # Create GRPC objects. + grpc_response = ::Google::Iam::V1::Policy.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. + resource = "hello world" + policy = {} + update_mask = {} + + set_iam_policy_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :set_iam_policy, name + assert_kind_of ::Google::Iam::V1::SetIamPolicyRequest, request + assert_equal "hello world", request["resource"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Iam::V1::Policy), request["policy"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, set_iam_policy_client_stub do + # Create client + client = ::Google::Iam::V1::IAMPolicy::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.set_iam_policy({ resource: resource, policy: policy, update_mask: update_mask }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.set_iam_policy resource: resource, policy: policy, update_mask: update_mask do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.set_iam_policy ::Google::Iam::V1::SetIamPolicyRequest.new(resource: resource, policy: policy, update_mask: update_mask) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.set_iam_policy({ resource: resource, policy: policy, 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.set_iam_policy(::Google::Iam::V1::SetIamPolicyRequest.new(resource: resource, policy: policy, 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, set_iam_policy_client_stub.call_rpc_count + end + end + + def test_get_iam_policy + # Create GRPC objects. + grpc_response = ::Google::Iam::V1::Policy.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. + resource = "hello world" + options = {} + + get_iam_policy_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_iam_policy, name + assert_kind_of ::Google::Iam::V1::GetIamPolicyRequest, request + assert_equal "hello world", request["resource"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Iam::V1::GetPolicyOptions), request["options"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_iam_policy_client_stub do + # Create client + client = ::Google::Iam::V1::IAMPolicy::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_iam_policy({ resource: resource, options: options }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_iam_policy resource: resource, options: options do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_iam_policy ::Google::Iam::V1::GetIamPolicyRequest.new(resource: resource, options: options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_iam_policy({ resource: resource, options: options }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_iam_policy(::Google::Iam::V1::GetIamPolicyRequest.new(resource: resource, options: options), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_iam_policy_client_stub.call_rpc_count + end + end + + def test_test_iam_permissions + # Create GRPC objects. + grpc_response = ::Google::Iam::V1::TestIamPermissionsResponse.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. + resource = "hello world" + permissions = ["hello world"] + + test_iam_permissions_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :test_iam_permissions, name + assert_kind_of ::Google::Iam::V1::TestIamPermissionsRequest, request + assert_equal "hello world", request["resource"] + assert_equal ["hello world"], request["permissions"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, test_iam_permissions_client_stub do + # Create client + client = ::Google::Iam::V1::IAMPolicy::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.test_iam_permissions({ resource: resource, permissions: permissions }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.test_iam_permissions resource: resource, permissions: permissions do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.test_iam_permissions ::Google::Iam::V1::TestIamPermissionsRequest.new(resource: resource, permissions: permissions) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.test_iam_permissions({ resource: resource, permissions: permissions }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.test_iam_permissions(::Google::Iam::V1::TestIamPermissionsRequest.new(resource: resource, permissions: permissions), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, test_iam_permissions_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::Iam::V1::IAMPolicy::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::Iam::V1::IAMPolicy::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::Iam::V1::IAMPolicy::Client.new do |config| + config.credentials = creds + end + assert_kind_of ::Google::Iam::V1::IAMPolicy::Client, client + assert_equal creds, client.configure.credentials + end + end +end diff --git a/owl-bot-staging/google-cloud-vm_migration-v1/test/helper.rb b/owl-bot-staging/google-cloud-vm_migration-v1/test/helper.rb new file mode 100644 index 000000000000..672b337030e7 --- /dev/null +++ b/owl-bot-staging/google-cloud-vm_migration-v1/test/helper.rb @@ -0,0 +1,26 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/mock" +require "minitest/rg" + +require "grpc" + +require "ostruct" diff --git a/owl-bot-staging/google-cloud-vmware_engine-v1/.gitignore b/owl-bot-staging/google-cloud-vmware_engine-v1/.gitignore new file mode 100644 index 000000000000..0135b6bc6cfc --- /dev/null +++ b/owl-bot-staging/google-cloud-vmware_engine-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-vmware_engine-v1/.repo-metadata.json b/owl-bot-staging/google-cloud-vmware_engine-v1/.repo-metadata.json new file mode 100644 index 000000000000..d8fd8229f9bc --- /dev/null +++ b/owl-bot-staging/google-cloud-vmware_engine-v1/.repo-metadata.json @@ -0,0 +1,17 @@ +{ + "api_id": "vmwareengine.googleapis.com", + "api_shortname": "vmwareengine", + "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-vmware_engine-v1/latest", + "distribution_name": "google-cloud-vmware_engine-v1", + "is_cloud": true, + "language": "ruby", + "name": "vmwareengine", + "name_pretty": "Google Cloud VMware Engine V1 API", + "product_documentation": "https://cloud.google.com/vmware-engine/", + "release_level": "unreleased", + "repo": "googleapis/google-cloud-ruby", + "requires_billing": true, + "ruby-cloud-description": "Google Cloud VMware Engine is a fully managed service that lets you run the VMware platform in Google Cloud. VMware Engine provides you with VMware operational continuity so you can benefit from a cloud consumption model and lower your total cost of ownership. VMware Engine also offers on-demand provisioning, pay-as-you-grow, and capacity optimization. Note that google-cloud-vmware_engine-v1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-vmware_engine instead. See the readme for more details.", + "ruby-cloud-product-url": "https://cloud.google.com/vmware-engine/", + "library_type": "GAPIC_AUTO" +} diff --git a/owl-bot-staging/google-cloud-vmware_engine-v1/.rubocop.yml b/owl-bot-staging/google-cloud-vmware_engine-v1/.rubocop.yml new file mode 100644 index 000000000000..a4fe906d500e --- /dev/null +++ b/owl-bot-staging/google-cloud-vmware_engine-v1/.rubocop.yml @@ -0,0 +1,33 @@ +inherit_gem: + google-style: google-style.yml + +AllCops: + Exclude: + - "google-cloud-vmware_engine-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-vmware_engine-v1.rb" diff --git a/owl-bot-staging/google-cloud-vmware_engine-v1/.toys.rb b/owl-bot-staging/google-cloud-vmware_engine-v1/.toys.rb new file mode 100644 index 000000000000..177e22456e8a --- /dev/null +++ b/owl-bot-staging/google-cloud-vmware_engine-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-vmware_engine-v1/.yardopts b/owl-bot-staging/google-cloud-vmware_engine-v1/.yardopts new file mode 100644 index 000000000000..6d00e01349e8 --- /dev/null +++ b/owl-bot-staging/google-cloud-vmware_engine-v1/.yardopts @@ -0,0 +1,12 @@ +--no-private +--title="Google Cloud VMware Engine 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-vmware_engine-v1/AUTHENTICATION.md b/owl-bot-staging/google-cloud-vmware_engine-v1/AUTHENTICATION.md new file mode 100644 index 000000000000..f30fd6722b36 --- /dev/null +++ b/owl-bot-staging/google-cloud-vmware_engine-v1/AUTHENTICATION.md @@ -0,0 +1,122 @@ +# Authentication + +The recommended way to authenticate to the google-cloud-vmware_engine-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-vmware_engine-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/vmware_engine/v1" + +client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new do |config| + config.credentials = "path/to/credentialfile.json" +end +``` + +To configure a credentials file globally for all clients: + +```ruby +require "google/cloud/vmware_engine/v1" + +::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.configure do |config| + config.credentials = "path/to/credentialfile.json" +end + +client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::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-vmware_engine-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/vmware_engine/v1" + +ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" + +client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::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-vmware_engine-v1/CHANGELOG.md b/owl-bot-staging/google-cloud-vmware_engine-v1/CHANGELOG.md new file mode 100644 index 000000000000..f88957a62ba2 --- /dev/null +++ b/owl-bot-staging/google-cloud-vmware_engine-v1/CHANGELOG.md @@ -0,0 +1,2 @@ +# Release History + diff --git a/owl-bot-staging/google-cloud-vmware_engine-v1/Gemfile b/owl-bot-staging/google-cloud-vmware_engine-v1/Gemfile new file mode 100644 index 000000000000..1d08558908d8 --- /dev/null +++ b/owl-bot-staging/google-cloud-vmware_engine-v1/Gemfile @@ -0,0 +1,14 @@ +source "https://rubygems.org" + +gemspec + +gem "google-style", "~> 1.32.0" +gem "irb", "~> 1.17" +gem "minitest", "~> 6.0.2" +gem "minitest-focus", "~> 1.4" +gem "minitest-mock", "~> 5.27" +gem "minitest-rg", "~> 5.3" +gem "ostruct", "~> 0.5.5" +gem "rake", ">= 13.0" +gem "redcarpet", "~> 3.6" +gem "yard", "~> 0.9" diff --git a/owl-bot-staging/google-cloud-vmware_engine-v1/LICENSE.md b/owl-bot-staging/google-cloud-vmware_engine-v1/LICENSE.md new file mode 100644 index 000000000000..c261857ba6ad --- /dev/null +++ b/owl-bot-staging/google-cloud-vmware_engine-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-vmware_engine-v1/README.md b/owl-bot-staging/google-cloud-vmware_engine-v1/README.md new file mode 100644 index 000000000000..92d3fb6249c6 --- /dev/null +++ b/owl-bot-staging/google-cloud-vmware_engine-v1/README.md @@ -0,0 +1,154 @@ +# Ruby Client for the Google Cloud VMware Engine V1 API + +The Google VMware Engine API lets you programmatically manage VMware environments. + +Google Cloud VMware Engine is a fully managed service that lets you run the VMware platform in Google Cloud. VMware Engine provides you with VMware operational continuity so you can benefit from a cloud consumption model and lower your total cost of ownership. VMware Engine also offers on-demand provisioning, pay-as-you-grow, and capacity optimization. + +https://github.com/googleapis/google-cloud-ruby + +This gem is a _versioned_ client. It provides basic client classes for a +specific version of the Google Cloud VMware Engine V1 API. Most users should consider using +the main client gem, +[google-cloud-vmware_engine](https://rubygems.org/gems/google-cloud-vmware_engine). +See the section below titled *Which client should I use?* for more information. + +## Installation + +``` +$ gem install google-cloud-vmware_engine-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/vmwareengine.googleapis.com) +1. [Set up authentication.](AUTHENTICATION.md) + +## Quick Start + +```ruby +require "google/cloud/vmware_engine/v1" + +client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new +request = ::Google::Cloud::VmwareEngine::V1::ListPrivateCloudsRequest.new # (request fields as keyword arguments...) +response = client.list_private_clouds request +``` + +View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-vmware_engine-v1/latest) +for class and method documentation. + +See also the [Product Documentation](https://cloud.google.com/vmware-engine/) +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/vmware_engine/v1" +require "logger" + +client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::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-vmware_engine`, +and lower-level _versioned_ client libraries with names such as +`google-cloud-vmware_engine-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-vmware_engine`. +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-vmware_engine-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-vmware_engine-v1/Rakefile b/owl-bot-staging/google-cloud-vmware_engine-v1/Rakefile new file mode 100644 index 000000000000..a494aa71fb5a --- /dev/null +++ b/owl-bot-staging/google-cloud-vmware_engine-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-vmware_engine-v1 acceptance tests." +task :acceptance, :project, :keyfile do |t, args| + project = args[:project] + project ||= + ENV["GOOGLE_CLOUD_TEST_PROJECT"] || + ENV["GCLOUD_TEST_PROJECT"] + keyfile = args[:keyfile] + keyfile ||= + ENV["GOOGLE_CLOUD_TEST_KEYFILE"] || + ENV["GCLOUD_TEST_KEYFILE"] + if keyfile + keyfile = File.read keyfile + else + keyfile ||= + ENV["GOOGLE_CLOUD_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 GOOGLE_CLOUD_TEST_PROJECT=test123 GOOGLE_CLOUD_TEST_KEYFILE=/path/to/keyfile.json rake acceptance" + end + require "google/cloud/vmware_engine/v1/vmware_engine/credentials" + ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Credentials.env_vars.each do |path| + ENV[path] = nil + end + ENV["GOOGLE_CLOUD_PROJECT"] = project + ENV["GOOGLE_CLOUD_TEST_PROJECT"] = project + ENV["GOOGLE_CLOUD_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-vmware_engine-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-vmware_engine-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-vmware_engine-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-vmware_engine-v1 gem does not have doctest tests." +end + +desc "Run the CI build" +task :ci do + header "BUILDING google-cloud-vmware_engine-v1" + header "google-cloud-vmware_engine-v1 rubocop", "*" + Rake::Task[:rubocop].invoke + header "google-cloud-vmware_engine-v1 yard", "*" + Rake::Task[:yard].invoke + header "google-cloud-vmware_engine-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-vmware_engine-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-vmware_engine-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-vmware_engine-v1/gapic_metadata.json b/owl-bot-staging/google-cloud-vmware_engine-v1/gapic_metadata.json new file mode 100644 index 000000000000..f4a1a19554a2 --- /dev/null +++ b/owl-bot-staging/google-cloud-vmware_engine-v1/gapic_metadata.json @@ -0,0 +1,388 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "ruby", + "protoPackage": "google.cloud.vmwareengine.v1", + "libraryPackage": "::Google::Cloud::VmwareEngine::V1", + "services": { + "VmwareEngine": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client", + "rpcs": { + "ListPrivateClouds": { + "methods": [ + "list_private_clouds" + ] + }, + "GetPrivateCloud": { + "methods": [ + "get_private_cloud" + ] + }, + "CreatePrivateCloud": { + "methods": [ + "create_private_cloud" + ] + }, + "UpdatePrivateCloud": { + "methods": [ + "update_private_cloud" + ] + }, + "DeletePrivateCloud": { + "methods": [ + "delete_private_cloud" + ] + }, + "UndeletePrivateCloud": { + "methods": [ + "undelete_private_cloud" + ] + }, + "ListClusters": { + "methods": [ + "list_clusters" + ] + }, + "GetCluster": { + "methods": [ + "get_cluster" + ] + }, + "CreateCluster": { + "methods": [ + "create_cluster" + ] + }, + "UpdateCluster": { + "methods": [ + "update_cluster" + ] + }, + "DeleteCluster": { + "methods": [ + "delete_cluster" + ] + }, + "ListNodes": { + "methods": [ + "list_nodes" + ] + }, + "GetNode": { + "methods": [ + "get_node" + ] + }, + "ListExternalAddresses": { + "methods": [ + "list_external_addresses" + ] + }, + "FetchNetworkPolicyExternalAddresses": { + "methods": [ + "fetch_network_policy_external_addresses" + ] + }, + "GetExternalAddress": { + "methods": [ + "get_external_address" + ] + }, + "CreateExternalAddress": { + "methods": [ + "create_external_address" + ] + }, + "UpdateExternalAddress": { + "methods": [ + "update_external_address" + ] + }, + "DeleteExternalAddress": { + "methods": [ + "delete_external_address" + ] + }, + "ListSubnets": { + "methods": [ + "list_subnets" + ] + }, + "GetSubnet": { + "methods": [ + "get_subnet" + ] + }, + "UpdateSubnet": { + "methods": [ + "update_subnet" + ] + }, + "ListExternalAccessRules": { + "methods": [ + "list_external_access_rules" + ] + }, + "GetExternalAccessRule": { + "methods": [ + "get_external_access_rule" + ] + }, + "CreateExternalAccessRule": { + "methods": [ + "create_external_access_rule" + ] + }, + "UpdateExternalAccessRule": { + "methods": [ + "update_external_access_rule" + ] + }, + "DeleteExternalAccessRule": { + "methods": [ + "delete_external_access_rule" + ] + }, + "ListLoggingServers": { + "methods": [ + "list_logging_servers" + ] + }, + "GetLoggingServer": { + "methods": [ + "get_logging_server" + ] + }, + "CreateLoggingServer": { + "methods": [ + "create_logging_server" + ] + }, + "UpdateLoggingServer": { + "methods": [ + "update_logging_server" + ] + }, + "DeleteLoggingServer": { + "methods": [ + "delete_logging_server" + ] + }, + "ListNodeTypes": { + "methods": [ + "list_node_types" + ] + }, + "GetNodeType": { + "methods": [ + "get_node_type" + ] + }, + "ShowNsxCredentials": { + "methods": [ + "show_nsx_credentials" + ] + }, + "ShowVcenterCredentials": { + "methods": [ + "show_vcenter_credentials" + ] + }, + "ResetNsxCredentials": { + "methods": [ + "reset_nsx_credentials" + ] + }, + "ResetVcenterCredentials": { + "methods": [ + "reset_vcenter_credentials" + ] + }, + "GetDnsForwarding": { + "methods": [ + "get_dns_forwarding" + ] + }, + "UpdateDnsForwarding": { + "methods": [ + "update_dns_forwarding" + ] + }, + "GetNetworkPeering": { + "methods": [ + "get_network_peering" + ] + }, + "ListNetworkPeerings": { + "methods": [ + "list_network_peerings" + ] + }, + "CreateNetworkPeering": { + "methods": [ + "create_network_peering" + ] + }, + "DeleteNetworkPeering": { + "methods": [ + "delete_network_peering" + ] + }, + "UpdateNetworkPeering": { + "methods": [ + "update_network_peering" + ] + }, + "ListPeeringRoutes": { + "methods": [ + "list_peering_routes" + ] + }, + "CreateHcxActivationKey": { + "methods": [ + "create_hcx_activation_key" + ] + }, + "ListHcxActivationKeys": { + "methods": [ + "list_hcx_activation_keys" + ] + }, + "GetHcxActivationKey": { + "methods": [ + "get_hcx_activation_key" + ] + }, + "GetNetworkPolicy": { + "methods": [ + "get_network_policy" + ] + }, + "ListNetworkPolicies": { + "methods": [ + "list_network_policies" + ] + }, + "CreateNetworkPolicy": { + "methods": [ + "create_network_policy" + ] + }, + "UpdateNetworkPolicy": { + "methods": [ + "update_network_policy" + ] + }, + "DeleteNetworkPolicy": { + "methods": [ + "delete_network_policy" + ] + }, + "ListManagementDnsZoneBindings": { + "methods": [ + "list_management_dns_zone_bindings" + ] + }, + "GetManagementDnsZoneBinding": { + "methods": [ + "get_management_dns_zone_binding" + ] + }, + "CreateManagementDnsZoneBinding": { + "methods": [ + "create_management_dns_zone_binding" + ] + }, + "UpdateManagementDnsZoneBinding": { + "methods": [ + "update_management_dns_zone_binding" + ] + }, + "DeleteManagementDnsZoneBinding": { + "methods": [ + "delete_management_dns_zone_binding" + ] + }, + "RepairManagementDnsZoneBinding": { + "methods": [ + "repair_management_dns_zone_binding" + ] + }, + "CreateVmwareEngineNetwork": { + "methods": [ + "create_vmware_engine_network" + ] + }, + "UpdateVmwareEngineNetwork": { + "methods": [ + "update_vmware_engine_network" + ] + }, + "DeleteVmwareEngineNetwork": { + "methods": [ + "delete_vmware_engine_network" + ] + }, + "GetVmwareEngineNetwork": { + "methods": [ + "get_vmware_engine_network" + ] + }, + "ListVmwareEngineNetworks": { + "methods": [ + "list_vmware_engine_networks" + ] + }, + "CreatePrivateConnection": { + "methods": [ + "create_private_connection" + ] + }, + "GetPrivateConnection": { + "methods": [ + "get_private_connection" + ] + }, + "ListPrivateConnections": { + "methods": [ + "list_private_connections" + ] + }, + "UpdatePrivateConnection": { + "methods": [ + "update_private_connection" + ] + }, + "DeletePrivateConnection": { + "methods": [ + "delete_private_connection" + ] + }, + "ListPrivateConnectionPeeringRoutes": { + "methods": [ + "list_private_connection_peering_routes" + ] + }, + "GrantDnsBindPermission": { + "methods": [ + "grant_dns_bind_permission" + ] + }, + "GetDnsBindPermission": { + "methods": [ + "get_dns_bind_permission" + ] + }, + "RevokeDnsBindPermission": { + "methods": [ + "revoke_dns_bind_permission" + ] + } + } + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-vmware_engine-v1/google-cloud-vmware_engine-v1.gemspec b/owl-bot-staging/google-cloud-vmware_engine-v1/google-cloud-vmware_engine-v1.gemspec new file mode 100644 index 000000000000..202574bb1ae1 --- /dev/null +++ b/owl-bot-staging/google-cloud-vmware_engine-v1/google-cloud-vmware_engine-v1.gemspec @@ -0,0 +1,30 @@ +# -*- ruby -*- +# encoding: utf-8 + +require File.expand_path("lib/google/cloud/vmware_engine/v1/version", __dir__) + +Gem::Specification.new do |gem| + gem.name = "google-cloud-vmware_engine-v1" + gem.version = Google::Cloud::VmwareEngine::V1::VERSION + + gem.authors = ["Google LLC"] + gem.email = "googleapis-packages@google.com" + gem.description = "Google Cloud VMware Engine is a fully managed service that lets you run the VMware platform in Google Cloud. VMware Engine provides you with VMware operational continuity so you can benefit from a cloud consumption model and lower your total cost of ownership. VMware Engine also offers on-demand provisioning, pay-as-you-grow, and capacity optimization. Note that google-cloud-vmware_engine-v1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-vmware_engine instead. See the readme for more details." + gem.summary = "The Google VMware Engine API lets you programmatically manage VMware environments." + 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.2" + + 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-vmware_engine-v1/lib/google-cloud-vmware_engine-v1.rb b/owl-bot-staging/google-cloud-vmware_engine-v1/lib/google-cloud-vmware_engine-v1.rb new file mode 100644 index 000000000000..98be00c68860 --- /dev/null +++ b/owl-bot-staging/google-cloud-vmware_engine-v1/lib/google-cloud-vmware_engine-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/vmware_engine/v1" diff --git a/owl-bot-staging/google-cloud-vmware_engine-v1/lib/google/cloud/vmware_engine/v1.rb b/owl-bot-staging/google-cloud-vmware_engine-v1/lib/google/cloud/vmware_engine/v1.rb new file mode 100644 index 000000000000..accd8b68428a --- /dev/null +++ b/owl-bot-staging/google-cloud-vmware_engine-v1/lib/google/cloud/vmware_engine/v1.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/vmware_engine/v1/vmware_engine" +require "google/cloud/vmware_engine/v1/version" + +module Google + module Cloud + module VmwareEngine + ## + # API client module. + # + # @example Load this package, including all its services, and instantiate a gRPC client + # + # require "google/cloud/vmware_engine/v1" + # client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new + # + # @example Load this package, including all its services, and instantiate a REST client + # + # require "google/cloud/vmware_engine/v1" + # client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new + # + module V1 + end + end + end +end + +helper_path = ::File.join __dir__, "v1", "_helpers.rb" +require "google/cloud/vmware_engine/v1/_helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-vmware_engine-v1/lib/google/cloud/vmware_engine/v1/bindings_override.rb b/owl-bot-staging/google-cloud-vmware_engine-v1/lib/google/cloud/vmware_engine/v1/bindings_override.rb new file mode 100644 index 000000000000..865c8a08b7c0 --- /dev/null +++ b/owl-bot-staging/google-cloud-vmware_engine-v1/lib/google/cloud/vmware_engine/v1/bindings_override.rb @@ -0,0 +1,156 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 VmwareEngine + ## + # @example Loading just the REST part of this package, including all its services, and instantiating a REST client + # + # require "google/cloud/vmware_engine/v1/rest" + # client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new + # + module V1 + ## + # @private + # Initialize the mixin bindings configuration + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "VmwareEngine"] + 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/[^/]+/privateClouds/[^/]+/?$}, false] + ], + body: nil + ), + Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( + uri_method: :get, + uri_template: "/v1/{resource}:getIamPolicy", + matches: [ + ["resource", %r{^projects/[^/]+/locations/[^/]+/privateClouds/[^/]+/clusters/[^/]+/?$}, false] + ], + body: nil + ), + Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( + uri_method: :get, + uri_template: "/v1/{resource}:getIamPolicy", + matches: [ + ["resource", %r{^projects/[^/]+/locations/[^/]+/privateClouds/[^/]+/hcxActivationKeys/[^/]+/?$}, 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/[^/]+/privateClouds/[^/]+/?$}, false] + ], + body: "*" + ), + Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( + uri_method: :post, + uri_template: "/v1/{resource}:setIamPolicy", + matches: [ + ["resource", %r{^projects/[^/]+/locations/[^/]+/privateClouds/[^/]+/clusters/[^/]+/?$}, false] + ], + body: "*" + ), + Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( + uri_method: :post, + uri_template: "/v1/{resource}:setIamPolicy", + matches: [ + ["resource", %r{^projects/[^/]+/locations/[^/]+/privateClouds/[^/]+/hcxActivationKeys/[^/]+/?$}, 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/[^/]+/privateClouds/[^/]+/?$}, false] + ], + body: "*" + ), + Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( + uri_method: :post, + uri_template: "/v1/{resource}:testIamPermissions", + matches: [ + ["resource", %r{^projects/[^/]+/locations/[^/]+/privateClouds/[^/]+/clusters/[^/]+/?$}, false] + ], + body: "*" + ), + Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( + uri_method: :post, + uri_template: "/v1/{resource}:testIamPermissions", + matches: [ + ["resource", %r{^projects/[^/]+/locations/[^/]+/privateClouds/[^/]+/hcxActivationKeys/[^/]+/?$}, false] + ], + body: "*" + ) + ] + default_config + end + yield @configure if block_given? + @configure + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-vmware_engine-v1/lib/google/cloud/vmware_engine/v1/rest.rb b/owl-bot-staging/google-cloud-vmware_engine-v1/lib/google/cloud/vmware_engine/v1/rest.rb new file mode 100644 index 000000000000..858b1670df46 --- /dev/null +++ b/owl-bot-staging/google-cloud-vmware_engine-v1/lib/google/cloud/vmware_engine/v1/rest.rb @@ -0,0 +1,38 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/vmware_engine/v1/vmware_engine/rest" +require "google/cloud/vmware_engine/v1/bindings_override" +require "google/cloud/vmware_engine/v1/version" + +module Google + module Cloud + module VmwareEngine + ## + # To load just the REST part of this package, including all its services, and instantiate a REST client: + # + # @example + # + # require "google/cloud/vmware_engine/v1/rest" + # client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new + # + module V1 + end + end + end +end diff --git a/owl-bot-staging/google-cloud-vmware_engine-v1/lib/google/cloud/vmware_engine/v1/version.rb b/owl-bot-staging/google-cloud-vmware_engine-v1/lib/google/cloud/vmware_engine/v1/version.rb new file mode 100644 index 000000000000..378acc320ce6 --- /dev/null +++ b/owl-bot-staging/google-cloud-vmware_engine-v1/lib/google/cloud/vmware_engine/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 VmwareEngine + module V1 + VERSION = "0.0.1" + end + end + end +end diff --git a/owl-bot-staging/google-cloud-vmware_engine-v1/lib/google/cloud/vmware_engine/v1/vmware_engine.rb b/owl-bot-staging/google-cloud-vmware_engine-v1/lib/google/cloud/vmware_engine/v1/vmware_engine.rb new file mode 100644 index 000000000000..5b51604741d6 --- /dev/null +++ b/owl-bot-staging/google-cloud-vmware_engine-v1/lib/google/cloud/vmware_engine/v1/vmware_engine.rb @@ -0,0 +1,56 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/vmware_engine/v1/version" + +require "google/cloud/vmware_engine/v1/vmware_engine/credentials" +require "google/cloud/vmware_engine/v1/vmware_engine/paths" +require "google/cloud/vmware_engine/v1/vmware_engine/operations" +require "google/cloud/vmware_engine/v1/vmware_engine/client" +require "google/cloud/vmware_engine/v1/vmware_engine/rest" + +module Google + module Cloud + module VmwareEngine + module V1 + ## + # VMwareEngine manages VMware's private clusters in the Cloud. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/vmware_engine/v1/vmware_engine" + # client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/vmware_engine/v1/vmware_engine/rest" + # client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new + # + module VmwareEngine + end + end + end + end +end + +helper_path = ::File.join __dir__, "vmware_engine", "helpers.rb" +require "google/cloud/vmware_engine/v1/vmware_engine/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-vmware_engine-v1/lib/google/cloud/vmware_engine/v1/vmware_engine/client.rb b/owl-bot-staging/google-cloud-vmware_engine-v1/lib/google/cloud/vmware_engine/v1/vmware_engine/client.rb new file mode 100644 index 000000000000..fd7b76579e68 --- /dev/null +++ b/owl-bot-staging/google-cloud-vmware_engine-v1/lib/google/cloud/vmware_engine/v1/vmware_engine/client.rb @@ -0,0 +1,9555 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/vmwareengine/v1/vmwareengine_pb" +require "google/cloud/location" +require "google/iam/v1" + +module Google + module Cloud + module VmwareEngine + module V1 + module VmwareEngine + ## + # Client for the VmwareEngine service. + # + # VMwareEngine manages VMware's private clusters in the Cloud. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "vmwareengine.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :vmware_engine_stub + + ## + # Configure the VmwareEngine Client class. + # + # See {::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all VmwareEngine clients + # ::Google::Cloud::VmwareEngine::V1::VmwareEngine::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", "VmwareEngine", "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.timeout = 120.0 + + default_config.rpcs.list_private_clouds.timeout = 120.0 + default_config.rpcs.list_private_clouds.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.get_private_cloud.timeout = 120.0 + default_config.rpcs.get_private_cloud.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.list_clusters.timeout = 120.0 + default_config.rpcs.list_clusters.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.get_cluster.timeout = 120.0 + default_config.rpcs.get_cluster.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.list_nodes.timeout = 120.0 + default_config.rpcs.list_nodes.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.get_node.timeout = 120.0 + default_config.rpcs.get_node.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.list_external_addresses.timeout = 120.0 + default_config.rpcs.list_external_addresses.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.get_external_address.timeout = 120.0 + default_config.rpcs.get_external_address.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.list_subnets.timeout = 120.0 + default_config.rpcs.list_subnets.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.get_subnet.timeout = 120.0 + default_config.rpcs.get_subnet.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.update_subnet.timeout = 60.0 + + default_config.rpcs.list_external_access_rules.timeout = 120.0 + default_config.rpcs.list_external_access_rules.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.get_external_access_rule.timeout = 120.0 + default_config.rpcs.get_external_access_rule.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.list_logging_servers.timeout = 120.0 + default_config.rpcs.list_logging_servers.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.get_logging_server.timeout = 120.0 + default_config.rpcs.get_logging_server.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.list_node_types.timeout = 120.0 + default_config.rpcs.list_node_types.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.get_node_type.timeout = 120.0 + default_config.rpcs.get_node_type.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.show_nsx_credentials.timeout = 120.0 + default_config.rpcs.show_nsx_credentials.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.show_vcenter_credentials.timeout = 120.0 + default_config.rpcs.show_vcenter_credentials.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.get_dns_forwarding.timeout = 120.0 + default_config.rpcs.get_dns_forwarding.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.get_network_peering.timeout = 120.0 + default_config.rpcs.get_network_peering.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.list_network_peerings.timeout = 120.0 + default_config.rpcs.list_network_peerings.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.list_peering_routes.timeout = 120.0 + default_config.rpcs.list_peering_routes.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.list_hcx_activation_keys.timeout = 120.0 + default_config.rpcs.list_hcx_activation_keys.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.get_hcx_activation_key.timeout = 120.0 + default_config.rpcs.get_hcx_activation_key.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.get_network_policy.timeout = 120.0 + default_config.rpcs.get_network_policy.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.list_network_policies.timeout = 120.0 + default_config.rpcs.list_network_policies.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.list_management_dns_zone_bindings.timeout = 120.0 + default_config.rpcs.list_management_dns_zone_bindings.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.get_management_dns_zone_binding.timeout = 120.0 + default_config.rpcs.get_management_dns_zone_binding.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.get_vmware_engine_network.timeout = 120.0 + default_config.rpcs.get_vmware_engine_network.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.list_vmware_engine_networks.timeout = 120.0 + default_config.rpcs.list_vmware_engine_networks.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.get_private_connection.timeout = 120.0 + default_config.rpcs.get_private_connection.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.list_private_connections.timeout = 120.0 + default_config.rpcs.list_private_connections.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.list_private_connection_peering_routes.timeout = 120.0 + default_config.rpcs.list_private_connection_peering_routes.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.get_dns_bind_permission.timeout = 120.0 + default_config.rpcs.get_dns_bind_permission.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the VmwareEngine 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::VmwareEngine::V1::VmwareEngine::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 + @vmware_engine_stub.universe_domain + end + + ## + # Create a new VmwareEngine client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the VmwareEngine 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/vmwareengine/v1/vmwareengine_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 + + @vmware_engine_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::VmwareEngine::V1::VmwareEngine::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 + ) + + @vmware_engine_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 = @vmware_engine_stub.endpoint + config.universe_domain = @vmware_engine_stub.universe_domain + config.logger = @vmware_engine_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 = @vmware_engine_stub.endpoint + config.universe_domain = @vmware_engine_stub.universe_domain + config.logger = @vmware_engine_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::VmwareEngine::V1::VmwareEngine::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 + @vmware_engine_stub.logger + end + + # Service calls + + ## + # Lists `PrivateCloud` resources in a given project and location. + # + # @overload list_private_clouds(request, options = nil) + # Pass arguments to `list_private_clouds` via a request object, either of type + # {::Google::Cloud::VmwareEngine::V1::ListPrivateCloudsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VmwareEngine::V1::ListPrivateCloudsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_private_clouds(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) + # Pass arguments to `list_private_clouds` via keyword arguments. Note that at + # least one keyword argument is 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 private cloud to be queried for + # clusters. Resource names are schemeless URIs that follow the conventions in + # https://cloud.google.com/apis/design/resource_names. + # For example: + # `projects/my-project/locations/us-central1-a` + # @param page_size [::Integer] + # The maximum number of private clouds to return in one page. + # The service may return fewer than this value. + # The maximum value is coerced to 1000. + # The default value of this field is 500. + # @param page_token [::String] + # A page token, received from a previous `ListPrivateClouds` call. + # Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to `ListPrivateClouds` must + # match the call that provided the page token. + # @param filter [::String] + # A filter expression that matches resources returned in the response. + # The expression must specify the field name, a comparison operator, and the + # value that you want to use for filtering. The value must be a string, a + # number, or a boolean. The comparison operator must be `=`, `!=`, `>`, or + # `<`. + # + # For example, if you are filtering a list of private clouds, you can exclude + # the ones named `example-pc` by specifying `name != "example-pc"`. + # + # You can also filter nested fields. For example, you could specify + # `networkConfig.managementCidr = "192.168.0.0/24"` to include private clouds + # only if they have a matching address in their network configuration. + # + # To filter on multiple expressions, provide each separate expression within + # parentheses. For example: + # ``` + # (name = "example-pc") + # (createTime > "2021-04-12T08:15:10.40Z") + # ``` + # + # By default, each expression is an `AND` expression. However, you can + # include `AND` and `OR` expressions explicitly. For example: + # ``` + # (name = "private-cloud-1") AND + # (createTime > "2021-04-12T08:15:10.40Z") OR + # (name = "private-cloud-2") + # ``` + # @param order_by [::String] + # Sorts list results by a certain order. By default, returned results are + # ordered by `name` in ascending order. You can also sort results in + # descending order based on the `name` value using `orderBy="name desc"`. + # Currently, only ordering by `name` is supported. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::VmwareEngine::V1::PrivateCloud>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::VmwareEngine::V1::PrivateCloud>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/vmware_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VmwareEngine::V1::ListPrivateCloudsRequest.new + # + # # Call the list_private_clouds method. + # result = client.list_private_clouds 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::VmwareEngine::V1::PrivateCloud. + # p item + # end + # + def list_private_clouds request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::ListPrivateCloudsRequest + + # Converts hash 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_private_clouds.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::VmwareEngine::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_private_clouds.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_private_clouds.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vmware_engine_stub.call_rpc :list_private_clouds, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @vmware_engine_stub, :list_private_clouds, 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 + + ## + # Retrieves a `PrivateCloud` resource by its resource name. + # + # @overload get_private_cloud(request, options = nil) + # Pass arguments to `get_private_cloud` via a request object, either of type + # {::Google::Cloud::VmwareEngine::V1::GetPrivateCloudRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VmwareEngine::V1::GetPrivateCloudRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_private_cloud(name: nil) + # Pass arguments to `get_private_cloud` via keyword arguments. Note that at + # least one keyword argument is 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 private cloud to retrieve. + # Resource names are schemeless URIs that follow the conventions in + # https://cloud.google.com/apis/design/resource_names. + # For example: + # `projects/my-project/locations/us-central1-a/privateClouds/my-cloud` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::VmwareEngine::V1::PrivateCloud] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::VmwareEngine::V1::PrivateCloud] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/vmware_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VmwareEngine::V1::GetPrivateCloudRequest.new + # + # # Call the get_private_cloud method. + # result = client.get_private_cloud request + # + # # The returned object is of type Google::Cloud::VmwareEngine::V1::PrivateCloud. + # p result + # + def get_private_cloud request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::GetPrivateCloudRequest + + # Converts hash 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_private_cloud.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::VmwareEngine::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_private_cloud.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_private_cloud.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vmware_engine_stub.call_rpc :get_private_cloud, 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 `PrivateCloud` resource in a given project and location. + # Private clouds of type `STANDARD` and + # `TIME_LIMITED` are zonal resources, `STRETCHED` private clouds are + # regional. + # Creating a private cloud also creates a [management + # cluster](https://cloud.google.com/vmware-engine/docs/concepts-vmware-components) + # for that private cloud. + # + # @overload create_private_cloud(request, options = nil) + # Pass arguments to `create_private_cloud` via a request object, either of type + # {::Google::Cloud::VmwareEngine::V1::CreatePrivateCloudRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VmwareEngine::V1::CreatePrivateCloudRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_private_cloud(parent: nil, private_cloud_id: nil, private_cloud: nil, request_id: nil, validate_only: nil) + # Pass arguments to `create_private_cloud` via keyword arguments. Note that at + # least one keyword argument is 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 to create the new + # private cloud in. Resource names are schemeless URIs that follow the + # conventions in https://cloud.google.com/apis/design/resource_names. + # For example: + # `projects/my-project/locations/us-central1-a` + # @param private_cloud_id [::String] + # Required. The user-provided identifier of the private cloud to be created. + # This identifier must be unique among each `PrivateCloud` within the parent + # and becomes the final token in the name URI. + # The identifier must meet the following requirements: + # + # * Only contains 1-63 alphanumeric characters and hyphens + # * Begins with an alphabetical character + # * Ends with a non-hyphen character + # * Not formatted as a UUID + # * Complies with [RFC 1034](https://datatracker.ietf.org/doc/html/rfc1034) + # (section 3.5) + # @param private_cloud [::Google::Cloud::VmwareEngine::V1::PrivateCloud, ::Hash] + # Required. The initial description of the new private cloud. + # @param request_id [::String] + # Optional. The request ID must be a valid UUID with the exception that zero + # UUID is not supported (00000000-0000-0000-0000-000000000000). + # @param validate_only [::Boolean] + # Optional. True if you want the request to be validated and not executed; + # false otherwise. + # + # @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/vmware_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VmwareEngine::V1::CreatePrivateCloudRequest.new + # + # # Call the create_private_cloud method. + # result = client.create_private_cloud 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_private_cloud request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::CreatePrivateCloudRequest + + # Converts hash 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_private_cloud.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::VmwareEngine::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_private_cloud.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_private_cloud.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vmware_engine_stub.call_rpc :create_private_cloud, 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 + + ## + # Modifies a `PrivateCloud` resource. Only the following fields can be + # updated: `description`. + # Only fields specified in `updateMask` are applied. + # + # During operation processing, the resource is temporarily in the `ACTIVE` + # state before the operation fully completes. For that period of time, you + # can't update the resource. Use the operation status to determine when the + # processing fully completes. + # + # @overload update_private_cloud(request, options = nil) + # Pass arguments to `update_private_cloud` via a request object, either of type + # {::Google::Cloud::VmwareEngine::V1::UpdatePrivateCloudRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VmwareEngine::V1::UpdatePrivateCloudRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_private_cloud(private_cloud: nil, update_mask: nil, request_id: nil) + # Pass arguments to `update_private_cloud` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param private_cloud [::Google::Cloud::VmwareEngine::V1::PrivateCloud, ::Hash] + # Required. Private cloud description. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. Field mask is used to specify the fields to be overwritten in the + # `PrivateCloud` resource by the update. The fields specified in `updateMask` + # are relative to the resource, not the full request. A field will be + # overwritten if it is in the mask. If the user does not provide a mask then + # all fields will be overwritten. + # @param request_id [::String] + # Optional. The request ID must be a valid UUID with the exception that zero + # UUID is not supported (00000000-0000-0000-0000-000000000000). + # + # @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/vmware_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VmwareEngine::V1::UpdatePrivateCloudRequest.new + # + # # Call the update_private_cloud method. + # result = client.update_private_cloud 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 update_private_cloud request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::UpdatePrivateCloudRequest + + # Converts hash 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_private_cloud.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::VmwareEngine::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.private_cloud&.name + header_params["private_cloud.name"] = request.private_cloud.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_private_cloud.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_private_cloud.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vmware_engine_stub.call_rpc :update_private_cloud, 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 + + ## + # Schedules a `PrivateCloud` resource for deletion. + # + # A `PrivateCloud` resource scheduled for deletion has `PrivateCloud.state` + # set to `DELETED` and `expireTime` set to the time when deletion is final + # and can no longer be reversed. The delete operation is marked as done + # as soon as the `PrivateCloud` is successfully scheduled for deletion + # (this also applies when `delayHours` is set to zero), and the operation is + # not kept in pending state until `PrivateCloud` is purged. + # `PrivateCloud` can be restored using `UndeletePrivateCloud` method before + # the `expireTime` elapses. When `expireTime` is reached, deletion is final + # and all private cloud resources are irreversibly removed and billing stops. + # During the final removal process, `PrivateCloud.state` is set to `PURGING`. + # `PrivateCloud` can be polled using standard `GET` method for the whole + # period of deletion and purging. It will not be returned only + # when it is completely purged. + # + # @overload delete_private_cloud(request, options = nil) + # Pass arguments to `delete_private_cloud` via a request object, either of type + # {::Google::Cloud::VmwareEngine::V1::DeletePrivateCloudRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VmwareEngine::V1::DeletePrivateCloudRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_private_cloud(name: nil, request_id: nil, force: nil, delay_hours: nil) + # Pass arguments to `delete_private_cloud` via keyword arguments. Note that at + # least one keyword argument is 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 private cloud to delete. + # Resource names are schemeless URIs that follow the conventions in + # https://cloud.google.com/apis/design/resource_names. + # For example: + # `projects/my-project/locations/us-central1-a/privateClouds/my-cloud` + # @param request_id [::String] + # Optional. The request ID must be a valid UUID with the exception that zero + # UUID is not supported (00000000-0000-0000-0000-000000000000). + # @param force [::Boolean] + # Optional. If set to true, cascade delete is enabled and all children of + # this private cloud resource are also deleted. When this flag is set to + # false, the private cloud will not be deleted if there are any children + # other than the management cluster. The management cluster is always + # deleted. + # @param delay_hours [::Integer] + # Optional. Time delay of the deletion specified in hours. The default value + # is `3`. Specifying a non-zero value for this field changes the value of + # `PrivateCloud.state` to `DELETED` and sets `expire_time` to the planned + # deletion time. Deletion can be cancelled before `expire_time` elapses using + # {::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#undelete_private_cloud VmwareEngine.UndeletePrivateCloud}. + # Specifying a value of `0` for this field instead begins the deletion + # process and ceases billing immediately. During the final deletion process, + # the value of `PrivateCloud.state` becomes `PURGING`. + # + # @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/vmware_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VmwareEngine::V1::DeletePrivateCloudRequest.new + # + # # Call the delete_private_cloud method. + # result = client.delete_private_cloud 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_private_cloud request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::DeletePrivateCloudRequest + + # Converts hash 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_private_cloud.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::VmwareEngine::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_private_cloud.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_private_cloud.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vmware_engine_stub.call_rpc :delete_private_cloud, 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 + + ## + # Restores a private cloud that was previously scheduled for deletion by + # `DeletePrivateCloud`. A `PrivateCloud` resource scheduled for deletion has + # `PrivateCloud.state` set to `DELETED` and `PrivateCloud.expireTime` set to + # the time when deletion can no longer be reversed. + # + # @overload undelete_private_cloud(request, options = nil) + # Pass arguments to `undelete_private_cloud` via a request object, either of type + # {::Google::Cloud::VmwareEngine::V1::UndeletePrivateCloudRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VmwareEngine::V1::UndeletePrivateCloudRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload undelete_private_cloud(name: nil, request_id: nil) + # Pass arguments to `undelete_private_cloud` via keyword arguments. Note that at + # least one keyword argument is 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 private cloud scheduled for deletion. + # Resource names are schemeless URIs that follow the conventions in + # https://cloud.google.com/apis/design/resource_names. + # For example: + # `projects/my-project/locations/us-central1-a/privateClouds/my-cloud` + # @param request_id [::String] + # Optional. The request ID must be a valid UUID with the exception that zero + # UUID is not supported (00000000-0000-0000-0000-000000000000). + # + # @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/vmware_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VmwareEngine::V1::UndeletePrivateCloudRequest.new + # + # # Call the undelete_private_cloud method. + # result = client.undelete_private_cloud 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 undelete_private_cloud request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::UndeletePrivateCloudRequest + + # Converts hash 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.undelete_private_cloud.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::VmwareEngine::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.undelete_private_cloud.timeout, + metadata: metadata, + retry_policy: @config.rpcs.undelete_private_cloud.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vmware_engine_stub.call_rpc :undelete_private_cloud, 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 + + ## + # Lists `Cluster` resources in a given private cloud. + # + # @overload list_clusters(request, options = nil) + # Pass arguments to `list_clusters` via a request object, either of type + # {::Google::Cloud::VmwareEngine::V1::ListClustersRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VmwareEngine::V1::ListClustersRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_clusters(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) + # Pass arguments to `list_clusters` via keyword arguments. Note that at + # least one keyword argument is 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 private cloud to query for clusters. + # Resource names are schemeless URIs that follow the conventions in + # https://cloud.google.com/apis/design/resource_names. + # For example: + # `projects/my-project/locations/us-central1-a/privateClouds/my-cloud` + # @param page_size [::Integer] + # The maximum number of clusters to return in one page. + # The service may return fewer than this value. + # The maximum value is coerced to 1000. + # The default value of this field is 500. + # @param page_token [::String] + # A page token, received from a previous `ListClusters` call. + # Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to `ListClusters` + # must match the call that provided the page token. + # @param filter [::String] + # To filter on multiple expressions, provide each separate expression within + # parentheses. For example: + # ``` + # (name = "example-cluster") + # (nodeCount = "3") + # ``` + # + # By default, each expression is an `AND` expression. However, you can + # include `AND` and `OR` expressions explicitly. For example: + # ``` + # (name = "example-cluster-1") AND + # (createTime > "2021-04-12T08:15:10.40Z") OR + # (name = "example-cluster-2") + # ``` + # @param order_by [::String] + # Sorts list results by a certain order. By default, returned results are + # ordered by `name` in ascending order. You can also sort results in + # descending order based on the `name` value using `orderBy="name desc"`. + # Currently, only ordering by `name` is supported. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::VmwareEngine::V1::Cluster>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::VmwareEngine::V1::Cluster>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/vmware_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VmwareEngine::V1::ListClustersRequest.new + # + # # Call the list_clusters method. + # result = client.list_clusters 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::VmwareEngine::V1::Cluster. + # p item + # end + # + def list_clusters request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::ListClustersRequest + + # Converts hash 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_clusters.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::VmwareEngine::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_clusters.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_clusters.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vmware_engine_stub.call_rpc :list_clusters, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @vmware_engine_stub, :list_clusters, 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 + + ## + # Retrieves a `Cluster` resource by its resource name. + # + # @overload get_cluster(request, options = nil) + # Pass arguments to `get_cluster` via a request object, either of type + # {::Google::Cloud::VmwareEngine::V1::GetClusterRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VmwareEngine::V1::GetClusterRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_cluster(name: nil) + # Pass arguments to `get_cluster` via keyword arguments. Note that at + # least one keyword argument is 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 cluster resource name to retrieve. + # Resource names are schemeless URIs that follow the conventions in + # https://cloud.google.com/apis/design/resource_names. + # For example: + # `projects/my-project/locations/us-central1-a/privateClouds/my-cloud/clusters/my-cluster` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::VmwareEngine::V1::Cluster] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::VmwareEngine::V1::Cluster] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/vmware_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VmwareEngine::V1::GetClusterRequest.new + # + # # Call the get_cluster method. + # result = client.get_cluster request + # + # # The returned object is of type Google::Cloud::VmwareEngine::V1::Cluster. + # p result + # + def get_cluster request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::GetClusterRequest + + # Converts hash 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_cluster.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::VmwareEngine::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_cluster.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_cluster.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vmware_engine_stub.call_rpc :get_cluster, 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 cluster in a given private cloud. + # Creating a new cluster provides additional nodes for + # use in the parent private cloud and requires sufficient [node + # quota](https://cloud.google.com/vmware-engine/quotas). + # + # @overload create_cluster(request, options = nil) + # Pass arguments to `create_cluster` via a request object, either of type + # {::Google::Cloud::VmwareEngine::V1::CreateClusterRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VmwareEngine::V1::CreateClusterRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_cluster(parent: nil, cluster_id: nil, cluster: nil, request_id: nil, validate_only: nil) + # Pass arguments to `create_cluster` via keyword arguments. Note that at + # least one keyword argument is 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 private cloud to create a new cluster + # in. Resource names are schemeless URIs that follow the conventions in + # https://cloud.google.com/apis/design/resource_names. + # For example: + # `projects/my-project/locations/us-central1-a/privateClouds/my-cloud` + # @param cluster_id [::String] + # Required. The user-provided identifier of the new `Cluster`. + # This identifier must be unique among clusters within the parent and becomes + # the final token in the name URI. + # The identifier must meet the following requirements: + # + # * Only contains 1-63 alphanumeric characters and hyphens + # * Begins with an alphabetical character + # * Ends with a non-hyphen character + # * Not formatted as a UUID + # * Complies with [RFC 1034](https://datatracker.ietf.org/doc/html/rfc1034) + # (section 3.5) + # @param cluster [::Google::Cloud::VmwareEngine::V1::Cluster, ::Hash] + # Required. The initial description of the new cluster. + # @param request_id [::String] + # Optional. The request ID must be a valid UUID with the exception that zero + # UUID is not supported (00000000-0000-0000-0000-000000000000). + # @param validate_only [::Boolean] + # Optional. True if you want the request to be validated and not executed; + # false otherwise. + # + # @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/vmware_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VmwareEngine::V1::CreateClusterRequest.new + # + # # Call the create_cluster method. + # result = client.create_cluster 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_cluster request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::CreateClusterRequest + + # Converts hash 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_cluster.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::VmwareEngine::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_cluster.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_cluster.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vmware_engine_stub.call_rpc :create_cluster, 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 + + ## + # Modifies a `Cluster` resource. Only fields specified in `updateMask` are + # applied. + # + # During operation processing, the resource is temporarily in the `ACTIVE` + # state before the operation fully completes. For that period of time, you + # can't update the resource. Use the operation status to determine when the + # processing fully completes. + # + # @overload update_cluster(request, options = nil) + # Pass arguments to `update_cluster` via a request object, either of type + # {::Google::Cloud::VmwareEngine::V1::UpdateClusterRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VmwareEngine::V1::UpdateClusterRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_cluster(update_mask: nil, cluster: nil, request_id: nil, validate_only: nil) + # Pass arguments to `update_cluster` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. Field mask is used to specify the fields to be overwritten in the + # `Cluster` resource by the update. The fields specified in the `updateMask` + # are relative to the resource, not the full request. A field will be + # overwritten if it is in the mask. If the user does not provide a mask then + # all fields will be overwritten. + # @param cluster [::Google::Cloud::VmwareEngine::V1::Cluster, ::Hash] + # Required. The description of the cluster. + # @param request_id [::String] + # Optional. The request ID must be a valid UUID with the exception that + # zero UUID is not supported (00000000-0000-0000-0000-000000000000). + # @param validate_only [::Boolean] + # Optional. True if you want the request to be validated and not executed; + # false otherwise. + # + # @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/vmware_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VmwareEngine::V1::UpdateClusterRequest.new + # + # # Call the update_cluster method. + # result = client.update_cluster 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 update_cluster request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::UpdateClusterRequest + + # Converts hash 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_cluster.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::VmwareEngine::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.cluster&.name + header_params["cluster.name"] = request.cluster.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_cluster.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_cluster.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vmware_engine_stub.call_rpc :update_cluster, 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 `Cluster` resource. To avoid unintended data loss, migrate or + # gracefully shut down any workloads running on the cluster before deletion. + # You cannot delete the management cluster of a private cloud using this + # method. + # + # @overload delete_cluster(request, options = nil) + # Pass arguments to `delete_cluster` via a request object, either of type + # {::Google::Cloud::VmwareEngine::V1::DeleteClusterRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VmwareEngine::V1::DeleteClusterRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_cluster(name: nil, request_id: nil) + # Pass arguments to `delete_cluster` via keyword arguments. Note that at + # least one keyword argument is 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 cluster to delete. + # Resource names are schemeless URIs that follow the conventions in + # https://cloud.google.com/apis/design/resource_names. + # For example: + # `projects/my-project/locations/us-central1-a/privateClouds/my-cloud/clusters/my-cluster` + # @param request_id [::String] + # Optional. The request ID must be a valid UUID with the exception that zero + # UUID is not supported (00000000-0000-0000-0000-000000000000). + # + # @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/vmware_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VmwareEngine::V1::DeleteClusterRequest.new + # + # # Call the delete_cluster method. + # result = client.delete_cluster 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_cluster request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::DeleteClusterRequest + + # Converts hash 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_cluster.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::VmwareEngine::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_cluster.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_cluster.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vmware_engine_stub.call_rpc :delete_cluster, 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 + + ## + # Lists nodes in a given cluster. + # + # @overload list_nodes(request, options = nil) + # Pass arguments to `list_nodes` via a request object, either of type + # {::Google::Cloud::VmwareEngine::V1::ListNodesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VmwareEngine::V1::ListNodesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_nodes(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_nodes` via keyword arguments. Note that at + # least one keyword argument is 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 cluster to be queried for nodes. + # Resource names are schemeless URIs that follow the conventions in + # https://cloud.google.com/apis/design/resource_names. + # For example: + # `projects/my-project/locations/us-central1-a/privateClouds/my-cloud/clusters/my-cluster` + # @param page_size [::Integer] + # The maximum number of nodes to return in one page. + # The service may return fewer than this value. + # The maximum value is coerced to 1000. + # The default value of this field is 500. + # @param page_token [::String] + # A page token, received from a previous `ListNodes` call. + # Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to + # `ListNodes` must match the call that provided the page + # token. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::VmwareEngine::V1::Node>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::VmwareEngine::V1::Node>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/vmware_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VmwareEngine::V1::ListNodesRequest.new + # + # # Call the list_nodes method. + # result = client.list_nodes 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::VmwareEngine::V1::Node. + # p item + # end + # + def list_nodes request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::ListNodesRequest + + # Converts hash 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_nodes.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::VmwareEngine::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_nodes.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_nodes.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vmware_engine_stub.call_rpc :list_nodes, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @vmware_engine_stub, :list_nodes, 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 + + ## + # Gets details of a single node. + # + # @overload get_node(request, options = nil) + # Pass arguments to `get_node` via a request object, either of type + # {::Google::Cloud::VmwareEngine::V1::GetNodeRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VmwareEngine::V1::GetNodeRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_node(name: nil) + # Pass arguments to `get_node` via keyword arguments. Note that at + # least one keyword argument is 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 node to retrieve. + # For example: + # `projects/{project}/locations/{location}/privateClouds/{private_cloud}/clusters/{cluster}/nodes/{node}` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::VmwareEngine::V1::Node] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::VmwareEngine::V1::Node] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/vmware_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VmwareEngine::V1::GetNodeRequest.new + # + # # Call the get_node method. + # result = client.get_node request + # + # # The returned object is of type Google::Cloud::VmwareEngine::V1::Node. + # p result + # + def get_node request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::GetNodeRequest + + # Converts hash 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_node.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::VmwareEngine::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_node.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_node.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vmware_engine_stub.call_rpc :get_node, 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 external IP addresses assigned to VMware workload VMs in a given + # private cloud. + # + # @overload list_external_addresses(request, options = nil) + # Pass arguments to `list_external_addresses` via a request object, either of type + # {::Google::Cloud::VmwareEngine::V1::ListExternalAddressesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VmwareEngine::V1::ListExternalAddressesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_external_addresses(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) + # Pass arguments to `list_external_addresses` via keyword arguments. Note that at + # least one keyword argument is 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 private cloud to be queried for + # external IP addresses. + # Resource names are schemeless URIs that follow the conventions in + # https://cloud.google.com/apis/design/resource_names. + # For example: + # `projects/my-project/locations/us-central1-a/privateClouds/my-cloud` + # @param page_size [::Integer] + # The maximum number of external IP addresses to return in one page. + # The service may return fewer than this value. + # The maximum value is coerced to 1000. + # The default value of this field is 500. + # @param page_token [::String] + # A page token, received from a previous `ListExternalAddresses` call. + # Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to + # `ListExternalAddresses` must match the call that provided the page token. + # @param filter [::String] + # A filter expression that matches resources returned in the response. + # The expression must specify the field name, a comparison + # operator, and the value that you want to use for filtering. The value + # must be a string, a number, or a boolean. The comparison operator + # must be `=`, `!=`, `>`, or `<`. + # + # For example, if you are filtering a list of IP addresses, you can + # exclude the ones named `example-ip` by specifying + # `name != "example-ip"`. + # + # To filter on multiple expressions, provide each separate expression within + # parentheses. For example: + # ``` + # (name = "example-ip") + # (createTime > "2021-04-12T08:15:10.40Z") + # ``` + # + # By default, each expression is an `AND` expression. However, you + # can include `AND` and `OR` expressions explicitly. + # For example: + # ``` + # (name = "example-ip-1") AND + # (createTime > "2021-04-12T08:15:10.40Z") OR + # (name = "example-ip-2") + # ``` + # @param order_by [::String] + # Sorts list results by a certain order. By default, returned results + # are ordered by `name` in ascending order. + # You can also sort results in descending order based on the `name` value + # using `orderBy="name desc"`. + # Currently, only ordering by `name` is supported. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::VmwareEngine::V1::ExternalAddress>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::VmwareEngine::V1::ExternalAddress>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/vmware_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VmwareEngine::V1::ListExternalAddressesRequest.new + # + # # Call the list_external_addresses method. + # result = client.list_external_addresses 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::VmwareEngine::V1::ExternalAddress. + # p item + # end + # + def list_external_addresses request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::ListExternalAddressesRequest + + # Converts hash 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_external_addresses.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::VmwareEngine::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_external_addresses.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_external_addresses.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vmware_engine_stub.call_rpc :list_external_addresses, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @vmware_engine_stub, :list_external_addresses, 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 external IP addresses assigned to VMware workload VMs within the + # scope of the given network policy. + # + # @overload fetch_network_policy_external_addresses(request, options = nil) + # Pass arguments to `fetch_network_policy_external_addresses` via a request object, either of type + # {::Google::Cloud::VmwareEngine::V1::FetchNetworkPolicyExternalAddressesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VmwareEngine::V1::FetchNetworkPolicyExternalAddressesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload fetch_network_policy_external_addresses(network_policy: nil, page_size: nil, page_token: nil) + # Pass arguments to `fetch_network_policy_external_addresses` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param network_policy [::String] + # Required. The resource name of the network policy to query for assigned + # external IP addresses. Resource names are schemeless URIs that follow the + # conventions in https://cloud.google.com/apis/design/resource_names. For + # example: + # `projects/my-project/locations/us-central1/networkPolicies/my-policy` + # @param page_size [::Integer] + # The maximum number of external IP addresses to return in one page. + # The service may return fewer than this value. + # The maximum value is coerced to 1000. + # The default value of this field is 500. + # @param page_token [::String] + # A page token, received from a previous + # `FetchNetworkPolicyExternalAddresses` call. Provide this to retrieve the + # subsequent page. + # + # When paginating, all parameters provided to + # `FetchNetworkPolicyExternalAddresses`, except for `page_size` and + # `page_token`, must match the call that provided the page token. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::VmwareEngine::V1::ExternalAddress>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::VmwareEngine::V1::ExternalAddress>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/vmware_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VmwareEngine::V1::FetchNetworkPolicyExternalAddressesRequest.new + # + # # Call the fetch_network_policy_external_addresses method. + # result = client.fetch_network_policy_external_addresses 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::VmwareEngine::V1::ExternalAddress. + # p item + # end + # + def fetch_network_policy_external_addresses request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::FetchNetworkPolicyExternalAddressesRequest + + # Converts hash 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.fetch_network_policy_external_addresses.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::VmwareEngine::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.network_policy + header_params["network_policy"] = request.network_policy + 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.fetch_network_policy_external_addresses.timeout, + metadata: metadata, + retry_policy: @config.rpcs.fetch_network_policy_external_addresses.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vmware_engine_stub.call_rpc :fetch_network_policy_external_addresses, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @vmware_engine_stub, :fetch_network_policy_external_addresses, 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 + + ## + # Gets details of a single external IP address. + # + # @overload get_external_address(request, options = nil) + # Pass arguments to `get_external_address` via a request object, either of type + # {::Google::Cloud::VmwareEngine::V1::GetExternalAddressRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VmwareEngine::V1::GetExternalAddressRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_external_address(name: nil) + # Pass arguments to `get_external_address` via keyword arguments. Note that at + # least one keyword argument is 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 external IP address to retrieve. + # Resource names are schemeless URIs that follow the conventions in + # https://cloud.google.com/apis/design/resource_names. + # For example: + # `projects/my-project/locations/us-central1-a/privateClouds/my-cloud/externalAddresses/my-ip` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::VmwareEngine::V1::ExternalAddress] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::VmwareEngine::V1::ExternalAddress] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/vmware_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VmwareEngine::V1::GetExternalAddressRequest.new + # + # # Call the get_external_address method. + # result = client.get_external_address request + # + # # The returned object is of type Google::Cloud::VmwareEngine::V1::ExternalAddress. + # p result + # + def get_external_address request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::GetExternalAddressRequest + + # Converts hash 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_external_address.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::VmwareEngine::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_external_address.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_external_address.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vmware_engine_stub.call_rpc :get_external_address, 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 `ExternalAddress` resource in a given private cloud. The + # network policy that corresponds to the private cloud must have the external + # IP address network service enabled (`NetworkPolicy.external_ip`). + # + # @overload create_external_address(request, options = nil) + # Pass arguments to `create_external_address` via a request object, either of type + # {::Google::Cloud::VmwareEngine::V1::CreateExternalAddressRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VmwareEngine::V1::CreateExternalAddressRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_external_address(parent: nil, external_address: nil, external_address_id: nil, request_id: nil) + # Pass arguments to `create_external_address` via keyword arguments. Note that at + # least one keyword argument is 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 private cloud + # to create a new external IP address in. + # Resource names are schemeless URIs that follow the conventions in + # https://cloud.google.com/apis/design/resource_names. + # For example: + # `projects/my-project/locations/us-central1-a/privateClouds/my-cloud` + # @param external_address [::Google::Cloud::VmwareEngine::V1::ExternalAddress, ::Hash] + # Required. The initial description of a new external IP address. + # @param external_address_id [::String] + # Required. The user-provided identifier of the `ExternalAddress` to be + # created. This identifier must be unique among `ExternalAddress` resources + # within the parent and becomes the final token in the name URI. The + # identifier must meet the following requirements: + # + # * Only contains 1-63 alphanumeric characters and hyphens + # * Begins with an alphabetical character + # * Ends with a non-hyphen character + # * Not formatted as a UUID + # * Complies with [RFC 1034](https://datatracker.ietf.org/doc/html/rfc1034) + # (section 3.5) + # @param request_id [::String] + # Optional. A request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server guarantees that a + # request doesn't result in creation of duplicate commitments for at least 60 + # minutes. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request ID, + # the server can check if the original operation with the same request ID was + # received, and if so, will ignore the second request. This prevents clients + # from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # + # @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/vmware_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VmwareEngine::V1::CreateExternalAddressRequest.new + # + # # Call the create_external_address method. + # result = client.create_external_address 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_external_address request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::CreateExternalAddressRequest + + # Converts hash 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_external_address.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::VmwareEngine::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_external_address.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_external_address.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vmware_engine_stub.call_rpc :create_external_address, 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 + + ## + # Updates the parameters of a single external IP address. + # Only fields specified in `update_mask` are applied. + # + # During operation processing, the resource is temporarily in the `ACTIVE` + # state before the operation fully completes. For that period of time, you + # can't update the resource. Use the operation status to determine when the + # processing fully completes. + # + # @overload update_external_address(request, options = nil) + # Pass arguments to `update_external_address` via a request object, either of type + # {::Google::Cloud::VmwareEngine::V1::UpdateExternalAddressRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VmwareEngine::V1::UpdateExternalAddressRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_external_address(update_mask: nil, external_address: nil, request_id: nil) + # Pass arguments to `update_external_address` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. Field mask is used to specify the fields to be overwritten in the + # `ExternalAddress` resource by the update. + # The fields specified in the `update_mask` are relative to the resource, not + # the full request. A field will be overwritten if it is in the mask. If the + # user does not provide a mask then all fields will be overwritten. + # @param external_address [::Google::Cloud::VmwareEngine::V1::ExternalAddress, ::Hash] + # Required. External IP address description. + # @param request_id [::String] + # Optional. A request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server guarantees that a + # request doesn't result in creation of duplicate commitments for at least 60 + # minutes. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request ID, + # the server can check if the original operation with the same request ID was + # received, and if so, will ignore the second request. This prevents clients + # from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # + # @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/vmware_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VmwareEngine::V1::UpdateExternalAddressRequest.new + # + # # Call the update_external_address method. + # result = client.update_external_address 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 update_external_address request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::UpdateExternalAddressRequest + + # Converts hash 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_external_address.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::VmwareEngine::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.external_address&.name + header_params["external_address.name"] = request.external_address.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_external_address.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_external_address.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vmware_engine_stub.call_rpc :update_external_address, 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 single external IP address. When you delete an external IP + # address, connectivity between the external IP address and the corresponding + # internal IP address is lost. + # + # @overload delete_external_address(request, options = nil) + # Pass arguments to `delete_external_address` via a request object, either of type + # {::Google::Cloud::VmwareEngine::V1::DeleteExternalAddressRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VmwareEngine::V1::DeleteExternalAddressRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_external_address(name: nil, request_id: nil) + # Pass arguments to `delete_external_address` via keyword arguments. Note that at + # least one keyword argument is 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 external IP address to delete. + # Resource names are schemeless URIs that follow the conventions in + # https://cloud.google.com/apis/design/resource_names. + # For example: + # `projects/my-project/locations/us-central1-a/privateClouds/my-cloud/externalAddresses/my-ip` + # @param request_id [::String] + # Optional. A request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server guarantees that a + # request doesn't result in creation of duplicate commitments for at least 60 + # minutes. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request + # ID, the server can check if the original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # + # @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/vmware_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VmwareEngine::V1::DeleteExternalAddressRequest.new + # + # # Call the delete_external_address method. + # result = client.delete_external_address 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_external_address request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::DeleteExternalAddressRequest + + # Converts hash 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_external_address.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::VmwareEngine::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_external_address.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_external_address.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vmware_engine_stub.call_rpc :delete_external_address, 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 + + ## + # Lists subnets in a given private cloud. + # + # @overload list_subnets(request, options = nil) + # Pass arguments to `list_subnets` via a request object, either of type + # {::Google::Cloud::VmwareEngine::V1::ListSubnetsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VmwareEngine::V1::ListSubnetsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_subnets(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_subnets` via keyword arguments. Note that at + # least one keyword argument is 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 private cloud to be queried for + # subnets. + # Resource names are schemeless URIs that follow the conventions in + # https://cloud.google.com/apis/design/resource_names. + # For example: + # `projects/my-project/locations/us-central1-a/privateClouds/my-cloud` + # @param page_size [::Integer] + # The maximum number of subnets to return in one page. + # The service may return fewer than this value. + # The maximum value is coerced to 1000. + # The default value of this field is 500. + # @param page_token [::String] + # A page token, received from a previous `ListSubnetsRequest` call. + # Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to + # `ListSubnetsRequest` must match the call that provided the page token. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::VmwareEngine::V1::Subnet>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::VmwareEngine::V1::Subnet>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/vmware_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VmwareEngine::V1::ListSubnetsRequest.new + # + # # Call the list_subnets method. + # result = client.list_subnets 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::VmwareEngine::V1::Subnet. + # p item + # end + # + def list_subnets request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::ListSubnetsRequest + + # Converts hash 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_subnets.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::VmwareEngine::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_subnets.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_subnets.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vmware_engine_stub.call_rpc :list_subnets, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @vmware_engine_stub, :list_subnets, 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 + + ## + # Gets details of a single subnet. + # + # @overload get_subnet(request, options = nil) + # Pass arguments to `get_subnet` via a request object, either of type + # {::Google::Cloud::VmwareEngine::V1::GetSubnetRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VmwareEngine::V1::GetSubnetRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_subnet(name: nil) + # Pass arguments to `get_subnet` via keyword arguments. Note that at + # least one keyword argument is 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 subnet to retrieve. + # Resource names are schemeless URIs that follow the conventions in + # https://cloud.google.com/apis/design/resource_names. + # For example: + # `projects/my-project/locations/us-central1-a/privateClouds/my-cloud/subnets/my-subnet` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::VmwareEngine::V1::Subnet] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::VmwareEngine::V1::Subnet] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/vmware_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VmwareEngine::V1::GetSubnetRequest.new + # + # # Call the get_subnet method. + # result = client.get_subnet request + # + # # The returned object is of type Google::Cloud::VmwareEngine::V1::Subnet. + # p result + # + def get_subnet request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::GetSubnetRequest + + # Converts hash 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_subnet.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::VmwareEngine::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_subnet.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_subnet.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vmware_engine_stub.call_rpc :get_subnet, 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 parameters of a single subnet. Only fields specified in + # `update_mask` are applied. + # + # *Note*: This API is synchronous and always returns a successful + # `google.longrunning.Operation` (LRO). The returned LRO will only have + # `done` and `response` fields. + # + # @overload update_subnet(request, options = nil) + # Pass arguments to `update_subnet` via a request object, either of type + # {::Google::Cloud::VmwareEngine::V1::UpdateSubnetRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VmwareEngine::V1::UpdateSubnetRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_subnet(update_mask: nil, subnet: nil) + # Pass arguments to `update_subnet` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. Field mask is used to specify the fields to be overwritten in the + # `Subnet` resource by the update. + # The fields specified in the `update_mask` are relative to the resource, not + # the full request. A field will be overwritten if it is in the mask. If the + # user does not provide a mask then all fields will be overwritten. + # @param subnet [::Google::Cloud::VmwareEngine::V1::Subnet, ::Hash] + # Required. Subnet description. + # + # @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/vmware_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VmwareEngine::V1::UpdateSubnetRequest.new + # + # # Call the update_subnet method. + # result = client.update_subnet 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 update_subnet request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::UpdateSubnetRequest + + # Converts hash 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_subnet.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::VmwareEngine::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.subnet&.name + header_params["subnet.name"] = request.subnet.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_subnet.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_subnet.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vmware_engine_stub.call_rpc :update_subnet, 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 + + ## + # Lists `ExternalAccessRule` resources in the specified network policy. + # + # @overload list_external_access_rules(request, options = nil) + # Pass arguments to `list_external_access_rules` via a request object, either of type + # {::Google::Cloud::VmwareEngine::V1::ListExternalAccessRulesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VmwareEngine::V1::ListExternalAccessRulesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_external_access_rules(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) + # Pass arguments to `list_external_access_rules` via keyword arguments. Note that at + # least one keyword argument is 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 network policy to query for external + # access firewall rules. Resource names are schemeless URIs that follow the + # conventions in https://cloud.google.com/apis/design/resource_names. For + # example: + # `projects/my-project/locations/us-central1/networkPolicies/my-policy` + # @param page_size [::Integer] + # The maximum number of external access rules to return in one page. + # The service may return fewer than this value. + # The maximum value is coerced to 1000. + # The default value of this field is 500. + # @param page_token [::String] + # A page token, received from a previous `ListExternalAccessRulesRequest` + # call. Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to + # `ListExternalAccessRulesRequest` must match the call that provided the page + # token. + # @param filter [::String] + # A filter expression that matches resources returned in the response. + # The expression must specify the field name, a comparison + # operator, and the value that you want to use for filtering. The value + # must be a string, a number, or a boolean. The comparison operator + # must be `=`, `!=`, `>`, or `<`. + # + # For example, if you are filtering a list of external access rules, you can + # exclude the ones named `example-rule` by specifying + # `name != "example-rule"`. + # + # To filter on multiple expressions, provide each separate expression within + # parentheses. For example: + # ``` + # (name = "example-rule") + # (createTime > "2021-04-12T08:15:10.40Z") + # ``` + # + # By default, each expression is an `AND` expression. However, you + # can include `AND` and `OR` expressions explicitly. + # For example: + # ``` + # (name = "example-rule-1") AND + # (createTime > "2021-04-12T08:15:10.40Z") OR + # (name = "example-rule-2") + # ``` + # @param order_by [::String] + # Sorts list results by a certain order. By default, returned results + # are ordered by `name` in ascending order. + # You can also sort results in descending order based on the `name` value + # using `orderBy="name desc"`. + # Currently, only ordering by `name` is supported. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::VmwareEngine::V1::ExternalAccessRule>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::VmwareEngine::V1::ExternalAccessRule>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/vmware_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VmwareEngine::V1::ListExternalAccessRulesRequest.new + # + # # Call the list_external_access_rules method. + # result = client.list_external_access_rules 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::VmwareEngine::V1::ExternalAccessRule. + # p item + # end + # + def list_external_access_rules request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::ListExternalAccessRulesRequest + + # Converts hash 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_external_access_rules.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::VmwareEngine::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_external_access_rules.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_external_access_rules.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vmware_engine_stub.call_rpc :list_external_access_rules, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @vmware_engine_stub, :list_external_access_rules, 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 + + ## + # Gets details of a single external access rule. + # + # @overload get_external_access_rule(request, options = nil) + # Pass arguments to `get_external_access_rule` via a request object, either of type + # {::Google::Cloud::VmwareEngine::V1::GetExternalAccessRuleRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VmwareEngine::V1::GetExternalAccessRuleRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_external_access_rule(name: nil) + # Pass arguments to `get_external_access_rule` via keyword arguments. Note that at + # least one keyword argument is 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 external access firewall rule to + # retrieve. Resource names are schemeless URIs that follow the conventions in + # https://cloud.google.com/apis/design/resource_names. + # For example: + # `projects/my-project/locations/us-central1/networkPolicies/my-policy/externalAccessRules/my-rule` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::VmwareEngine::V1::ExternalAccessRule] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::VmwareEngine::V1::ExternalAccessRule] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/vmware_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VmwareEngine::V1::GetExternalAccessRuleRequest.new + # + # # Call the get_external_access_rule method. + # result = client.get_external_access_rule request + # + # # The returned object is of type Google::Cloud::VmwareEngine::V1::ExternalAccessRule. + # p result + # + def get_external_access_rule request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::GetExternalAccessRuleRequest + + # Converts hash 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_external_access_rule.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::VmwareEngine::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_external_access_rule.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_external_access_rule.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vmware_engine_stub.call_rpc :get_external_access_rule, 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 external access rule in a given network policy. + # + # @overload create_external_access_rule(request, options = nil) + # Pass arguments to `create_external_access_rule` via a request object, either of type + # {::Google::Cloud::VmwareEngine::V1::CreateExternalAccessRuleRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VmwareEngine::V1::CreateExternalAccessRuleRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_external_access_rule(parent: nil, external_access_rule: nil, external_access_rule_id: nil, request_id: nil) + # Pass arguments to `create_external_access_rule` via keyword arguments. Note that at + # least one keyword argument is 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 network policy + # to create a new external access firewall rule in. + # Resource names are schemeless URIs that follow the conventions in + # https://cloud.google.com/apis/design/resource_names. + # For example: + # `projects/my-project/locations/us-central1/networkPolicies/my-policy` + # @param external_access_rule [::Google::Cloud::VmwareEngine::V1::ExternalAccessRule, ::Hash] + # Required. The initial description of a new external access rule. + # @param external_access_rule_id [::String] + # Required. The user-provided identifier of the `ExternalAccessRule` to be + # created. This identifier must be unique among `ExternalAccessRule` + # resources within the parent and becomes the final token in the name URI. + # The identifier must meet the following requirements: + # + # * Only contains 1-63 alphanumeric characters and hyphens + # * Begins with an alphabetical character + # * Ends with a non-hyphen character + # * Not formatted as a UUID + # * Complies with [RFC 1034](https://datatracker.ietf.org/doc/html/rfc1034) + # (section 3.5) + # @param request_id [::String] + # A request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server guarantees that a + # request doesn't result in creation of duplicate commitments for at least 60 + # minutes. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request ID, + # the server can check if the original operation with the same request ID was + # received, and if so, will ignore the second request. This prevents clients + # from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # + # @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/vmware_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VmwareEngine::V1::CreateExternalAccessRuleRequest.new + # + # # Call the create_external_access_rule method. + # result = client.create_external_access_rule 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_external_access_rule request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::CreateExternalAccessRuleRequest + + # Converts hash 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_external_access_rule.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::VmwareEngine::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_external_access_rule.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_external_access_rule.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vmware_engine_stub.call_rpc :create_external_access_rule, 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 + + ## + # Updates the parameters of a single external access rule. + # Only fields specified in `update_mask` are applied. + # + # @overload update_external_access_rule(request, options = nil) + # Pass arguments to `update_external_access_rule` via a request object, either of type + # {::Google::Cloud::VmwareEngine::V1::UpdateExternalAccessRuleRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VmwareEngine::V1::UpdateExternalAccessRuleRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_external_access_rule(update_mask: nil, external_access_rule: nil, request_id: nil) + # Pass arguments to `update_external_access_rule` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. Field mask is used to specify the fields to be overwritten in the + # `ExternalAccessRule` resource by the update. + # The fields specified in the `update_mask` are relative to the resource, not + # the full request. A field will be overwritten if it is in the mask. If the + # user does not provide a mask then all fields will be overwritten. + # @param external_access_rule [::Google::Cloud::VmwareEngine::V1::ExternalAccessRule, ::Hash] + # Required. Description of the external access rule. + # @param request_id [::String] + # Optional. A request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server guarantees that a + # request doesn't result in creation of duplicate commitments for at least 60 + # minutes. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request ID, + # the server can check if the original operation with the same request ID was + # received, and if so, will ignore the second request. This prevents clients + # from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # + # @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/vmware_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VmwareEngine::V1::UpdateExternalAccessRuleRequest.new + # + # # Call the update_external_access_rule method. + # result = client.update_external_access_rule 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 update_external_access_rule request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::UpdateExternalAccessRuleRequest + + # Converts hash 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_external_access_rule.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::VmwareEngine::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.external_access_rule&.name + header_params["external_access_rule.name"] = request.external_access_rule.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_external_access_rule.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_external_access_rule.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vmware_engine_stub.call_rpc :update_external_access_rule, 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 single external access rule. + # + # @overload delete_external_access_rule(request, options = nil) + # Pass arguments to `delete_external_access_rule` via a request object, either of type + # {::Google::Cloud::VmwareEngine::V1::DeleteExternalAccessRuleRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VmwareEngine::V1::DeleteExternalAccessRuleRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_external_access_rule(name: nil, request_id: nil) + # Pass arguments to `delete_external_access_rule` via keyword arguments. Note that at + # least one keyword argument is 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 external access firewall rule to delete. + # Resource names are schemeless URIs that follow the conventions in + # https://cloud.google.com/apis/design/resource_names. + # For example: + # `projects/my-project/locations/us-central1/networkPolicies/my-policy/externalAccessRules/my-rule` + # @param request_id [::String] + # Optional. A request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server guarantees that a + # request doesn't result in creation of duplicate commitments for at least 60 + # minutes. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request + # ID, the server can check if the original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # + # @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/vmware_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VmwareEngine::V1::DeleteExternalAccessRuleRequest.new + # + # # Call the delete_external_access_rule method. + # result = client.delete_external_access_rule 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_external_access_rule request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::DeleteExternalAccessRuleRequest + + # Converts hash 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_external_access_rule.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::VmwareEngine::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_external_access_rule.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_external_access_rule.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vmware_engine_stub.call_rpc :delete_external_access_rule, 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 + + ## + # Lists logging servers configured for a given private + # cloud. + # + # @overload list_logging_servers(request, options = nil) + # Pass arguments to `list_logging_servers` via a request object, either of type + # {::Google::Cloud::VmwareEngine::V1::ListLoggingServersRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VmwareEngine::V1::ListLoggingServersRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_logging_servers(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) + # Pass arguments to `list_logging_servers` via keyword arguments. Note that at + # least one keyword argument is 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 private cloud to be queried for + # logging servers. + # Resource names are schemeless URIs that follow the conventions in + # https://cloud.google.com/apis/design/resource_names. + # For example: + # `projects/my-project/locations/us-central1-a/privateClouds/my-cloud` + # @param page_size [::Integer] + # The maximum number of logging servers to return in one page. + # The service may return fewer than this value. + # The maximum value is coerced to 1000. + # The default value of this field is 500. + # @param page_token [::String] + # A page token, received from a previous `ListLoggingServersRequest` call. + # Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to + # `ListLoggingServersRequest` must match the call that provided the page + # token. + # @param filter [::String] + # A filter expression that matches resources returned in the response. + # The expression must specify the field name, a comparison + # operator, and the value that you want to use for filtering. The value + # must be a string, a number, or a boolean. The comparison operator + # must be `=`, `!=`, `>`, or `<`. + # + # For example, if you are filtering a list of logging servers, you can + # exclude the ones named `example-server` by specifying + # `name != "example-server"`. + # + # To filter on multiple expressions, provide each separate expression within + # parentheses. For example: + # ``` + # (name = "example-server") + # (createTime > "2021-04-12T08:15:10.40Z") + # ``` + # + # By default, each expression is an `AND` expression. However, you + # can include `AND` and `OR` expressions explicitly. + # For example: + # ``` + # (name = "example-server-1") AND + # (createTime > "2021-04-12T08:15:10.40Z") OR + # (name = "example-server-2") + # ``` + # @param order_by [::String] + # Sorts list results by a certain order. By default, returned results + # are ordered by `name` in ascending order. + # You can also sort results in descending order based on the `name` value + # using `orderBy="name desc"`. + # Currently, only ordering by `name` is supported. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::VmwareEngine::V1::LoggingServer>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::VmwareEngine::V1::LoggingServer>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/vmware_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VmwareEngine::V1::ListLoggingServersRequest.new + # + # # Call the list_logging_servers method. + # result = client.list_logging_servers 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::VmwareEngine::V1::LoggingServer. + # p item + # end + # + def list_logging_servers request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::ListLoggingServersRequest + + # Converts hash 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_logging_servers.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::VmwareEngine::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_logging_servers.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_logging_servers.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vmware_engine_stub.call_rpc :list_logging_servers, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @vmware_engine_stub, :list_logging_servers, 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 + + ## + # Gets details of a logging server. + # + # @overload get_logging_server(request, options = nil) + # Pass arguments to `get_logging_server` via a request object, either of type + # {::Google::Cloud::VmwareEngine::V1::GetLoggingServerRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VmwareEngine::V1::GetLoggingServerRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_logging_server(name: nil) + # Pass arguments to `get_logging_server` via keyword arguments. Note that at + # least one keyword argument is 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 Logging Server to retrieve. + # Resource names are schemeless URIs that follow the conventions in + # https://cloud.google.com/apis/design/resource_names. + # For example: + # `projects/my-project/locations/us-central1-a/privateClouds/my-cloud/loggingServers/my-logging-server` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::VmwareEngine::V1::LoggingServer] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::VmwareEngine::V1::LoggingServer] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/vmware_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VmwareEngine::V1::GetLoggingServerRequest.new + # + # # Call the get_logging_server method. + # result = client.get_logging_server request + # + # # The returned object is of type Google::Cloud::VmwareEngine::V1::LoggingServer. + # p result + # + def get_logging_server request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::GetLoggingServerRequest + + # Converts hash 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_logging_server.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::VmwareEngine::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_logging_server.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_logging_server.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vmware_engine_stub.call_rpc :get_logging_server, 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 logging server for a given private cloud. + # + # @overload create_logging_server(request, options = nil) + # Pass arguments to `create_logging_server` via a request object, either of type + # {::Google::Cloud::VmwareEngine::V1::CreateLoggingServerRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VmwareEngine::V1::CreateLoggingServerRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_logging_server(parent: nil, logging_server: nil, logging_server_id: nil, request_id: nil) + # Pass arguments to `create_logging_server` via keyword arguments. Note that at + # least one keyword argument is 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 private cloud + # to create a new Logging Server in. + # Resource names are schemeless URIs that follow the conventions in + # https://cloud.google.com/apis/design/resource_names. + # For example: + # `projects/my-project/locations/us-central1-a/privateClouds/my-cloud` + # @param logging_server [::Google::Cloud::VmwareEngine::V1::LoggingServer, ::Hash] + # Required. The initial description of a new logging server. + # @param logging_server_id [::String] + # Required. The user-provided identifier of the `LoggingServer` to be + # created. This identifier must be unique among `LoggingServer` resources + # within the parent and becomes the final token in the name URI. + # The identifier must meet the following requirements: + # + # * Only contains 1-63 alphanumeric characters and hyphens + # * Begins with an alphabetical character + # * Ends with a non-hyphen character + # * Not formatted as a UUID + # * Complies with [RFC 1034](https://datatracker.ietf.org/doc/html/rfc1034) + # (section 3.5) + # @param request_id [::String] + # Optional. A request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server guarantees that a + # request doesn't result in creation of duplicate commitments for at least 60 + # minutes. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request ID, + # the server can check if original operation with the same request ID was + # received, and if so, will ignore the second request. This prevents clients + # from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # + # @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/vmware_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VmwareEngine::V1::CreateLoggingServerRequest.new + # + # # Call the create_logging_server method. + # result = client.create_logging_server 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_logging_server request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::CreateLoggingServerRequest + + # Converts hash 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_logging_server.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::VmwareEngine::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_logging_server.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_logging_server.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vmware_engine_stub.call_rpc :create_logging_server, 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 + + ## + # Updates the parameters of a single logging server. + # Only fields specified in `update_mask` are applied. + # + # @overload update_logging_server(request, options = nil) + # Pass arguments to `update_logging_server` via a request object, either of type + # {::Google::Cloud::VmwareEngine::V1::UpdateLoggingServerRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VmwareEngine::V1::UpdateLoggingServerRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_logging_server(update_mask: nil, logging_server: nil, request_id: nil) + # Pass arguments to `update_logging_server` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. Field mask is used to specify the fields to be overwritten in the + # `LoggingServer` resource by the update. + # The fields specified in the `update_mask` are relative to the resource, not + # the full request. A field will be overwritten if it is in the mask. If the + # user does not provide a mask then all fields will be overwritten. + # @param logging_server [::Google::Cloud::VmwareEngine::V1::LoggingServer, ::Hash] + # Required. Logging server description. + # @param request_id [::String] + # Optional. A request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server guarantees that a + # request doesn't result in creation of duplicate commitments for at least 60 + # minutes. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request ID, + # the server can check if original operation with the same request ID was + # received, and if so, will ignore the second request. This prevents clients + # from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # + # @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/vmware_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VmwareEngine::V1::UpdateLoggingServerRequest.new + # + # # Call the update_logging_server method. + # result = client.update_logging_server 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 update_logging_server request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::UpdateLoggingServerRequest + + # Converts hash 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_logging_server.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::VmwareEngine::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.logging_server&.name + header_params["logging_server.name"] = request.logging_server.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_logging_server.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_logging_server.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vmware_engine_stub.call_rpc :update_logging_server, 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 single logging server. + # + # @overload delete_logging_server(request, options = nil) + # Pass arguments to `delete_logging_server` via a request object, either of type + # {::Google::Cloud::VmwareEngine::V1::DeleteLoggingServerRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VmwareEngine::V1::DeleteLoggingServerRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_logging_server(name: nil, request_id: nil) + # Pass arguments to `delete_logging_server` via keyword arguments. Note that at + # least one keyword argument is 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 logging server to delete. + # Resource names are schemeless URIs that follow the conventions in + # https://cloud.google.com/apis/design/resource_names. + # For example: + # `projects/my-project/locations/us-central1-a/privateClouds/my-cloud/loggingServers/my-logging-server` + # @param request_id [::String] + # Optional. A request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server guarantees that a + # request doesn't result in creation of duplicate commitments for at least 60 + # minutes. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # + # @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/vmware_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VmwareEngine::V1::DeleteLoggingServerRequest.new + # + # # Call the delete_logging_server method. + # result = client.delete_logging_server 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_logging_server request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::DeleteLoggingServerRequest + + # Converts hash 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_logging_server.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::VmwareEngine::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_logging_server.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_logging_server.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vmware_engine_stub.call_rpc :delete_logging_server, 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 + + ## + # Lists node types + # + # @overload list_node_types(request, options = nil) + # Pass arguments to `list_node_types` via a request object, either of type + # {::Google::Cloud::VmwareEngine::V1::ListNodeTypesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VmwareEngine::V1::ListNodeTypesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_node_types(parent: nil, page_size: nil, page_token: nil, filter: nil) + # Pass arguments to `list_node_types` via keyword arguments. Note that at + # least one keyword argument is 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 to be queried for node types. + # Resource names are schemeless URIs that follow the conventions in + # https://cloud.google.com/apis/design/resource_names. + # For example: + # `projects/my-project/locations/us-central1-a` + # @param page_size [::Integer] + # The maximum number of node types to return in one page. + # The service may return fewer than this value. + # The maximum value is coerced to 1000. + # The default value of this field is 500. + # @param page_token [::String] + # A page token, received from a previous `ListNodeTypes` call. + # Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to + # `ListNodeTypes` must match the call that provided the page token. + # @param filter [::String] + # A filter expression that matches resources returned in the response. + # The expression must specify the field name, a comparison + # operator, and the value that you want to use for filtering. The value + # must be a string, a number, or a boolean. The comparison operator + # must be `=`, `!=`, `>`, or `<`. + # + # For example, if you are filtering a list of node types, you can + # exclude the ones named `standard-72` by specifying + # `name != "standard-72"`. + # + # To filter on multiple expressions, provide each separate expression within + # parentheses. For example: + # ``` + # (name = "standard-72") + # (virtual_cpu_count > 2) + # ``` + # + # By default, each expression is an `AND` expression. However, you + # can include `AND` and `OR` expressions explicitly. + # For example: + # ``` + # (name = "standard-96") AND + # (virtual_cpu_count > 2) OR + # (name = "standard-72") + # ``` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::VmwareEngine::V1::NodeType>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::VmwareEngine::V1::NodeType>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/vmware_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VmwareEngine::V1::ListNodeTypesRequest.new + # + # # Call the list_node_types method. + # result = client.list_node_types 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::VmwareEngine::V1::NodeType. + # p item + # end + # + def list_node_types request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::ListNodeTypesRequest + + # Converts hash 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_node_types.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::VmwareEngine::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_node_types.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_node_types.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vmware_engine_stub.call_rpc :list_node_types, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @vmware_engine_stub, :list_node_types, 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 + + ## + # Gets details of a single `NodeType`. + # + # @overload get_node_type(request, options = nil) + # Pass arguments to `get_node_type` via a request object, either of type + # {::Google::Cloud::VmwareEngine::V1::GetNodeTypeRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VmwareEngine::V1::GetNodeTypeRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_node_type(name: nil) + # Pass arguments to `get_node_type` via keyword arguments. Note that at + # least one keyword argument is 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 node type to retrieve. + # Resource names are schemeless URIs that follow the conventions in + # https://cloud.google.com/apis/design/resource_names. + # For example: + # `projects/my-proj/locations/us-central1-a/nodeTypes/standard-72` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::VmwareEngine::V1::NodeType] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::VmwareEngine::V1::NodeType] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/vmware_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VmwareEngine::V1::GetNodeTypeRequest.new + # + # # Call the get_node_type method. + # result = client.get_node_type request + # + # # The returned object is of type Google::Cloud::VmwareEngine::V1::NodeType. + # p result + # + def get_node_type request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::GetNodeTypeRequest + + # Converts hash 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_node_type.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::VmwareEngine::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_node_type.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_node_type.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vmware_engine_stub.call_rpc :get_node_type, 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 + + ## + # Gets details of credentials for NSX appliance. + # + # @overload show_nsx_credentials(request, options = nil) + # Pass arguments to `show_nsx_credentials` via a request object, either of type + # {::Google::Cloud::VmwareEngine::V1::ShowNsxCredentialsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VmwareEngine::V1::ShowNsxCredentialsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_nsx_credentials(private_cloud: nil) + # Pass arguments to `show_nsx_credentials` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param private_cloud [::String] + # Required. The resource name of the private cloud + # to be queried for credentials. + # Resource names are schemeless URIs that follow the conventions in + # https://cloud.google.com/apis/design/resource_names. + # For example: + # `projects/my-project/locations/us-central1-a/privateClouds/my-cloud` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::VmwareEngine::V1::Credentials] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::VmwareEngine::V1::Credentials] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/vmware_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VmwareEngine::V1::ShowNsxCredentialsRequest.new + # + # # Call the show_nsx_credentials method. + # result = client.show_nsx_credentials request + # + # # The returned object is of type Google::Cloud::VmwareEngine::V1::Credentials. + # p result + # + def show_nsx_credentials request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::ShowNsxCredentialsRequest + + # Converts hash 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_nsx_credentials.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::VmwareEngine::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.private_cloud + header_params["private_cloud"] = request.private_cloud + 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_nsx_credentials.timeout, + metadata: metadata, + retry_policy: @config.rpcs.show_nsx_credentials.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vmware_engine_stub.call_rpc :show_nsx_credentials, 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 + + ## + # Gets details of credentials for Vcenter appliance. + # + # @overload show_vcenter_credentials(request, options = nil) + # Pass arguments to `show_vcenter_credentials` via a request object, either of type + # {::Google::Cloud::VmwareEngine::V1::ShowVcenterCredentialsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VmwareEngine::V1::ShowVcenterCredentialsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_vcenter_credentials(private_cloud: nil, username: nil) + # Pass arguments to `show_vcenter_credentials` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param private_cloud [::String] + # Required. The resource name of the private cloud + # to be queried for credentials. + # Resource names are schemeless URIs that follow the conventions in + # https://cloud.google.com/apis/design/resource_names. + # For example: + # `projects/my-project/locations/us-central1-a/privateClouds/my-cloud` + # @param username [::String] + # Optional. The username of the user to be queried for credentials. + # The default value of this field is CloudOwner@gve.local. + # The provided value must be one of the following: + # CloudOwner@gve.local, + # solution-user-01@gve.local, + # solution-user-02@gve.local, + # solution-user-03@gve.local, + # solution-user-04@gve.local, + # solution-user-05@gve.local, + # zertoadmin@gve.local. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::VmwareEngine::V1::Credentials] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::VmwareEngine::V1::Credentials] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/vmware_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VmwareEngine::V1::ShowVcenterCredentialsRequest.new + # + # # Call the show_vcenter_credentials method. + # result = client.show_vcenter_credentials request + # + # # The returned object is of type Google::Cloud::VmwareEngine::V1::Credentials. + # p result + # + def show_vcenter_credentials request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::ShowVcenterCredentialsRequest + + # Converts hash 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_vcenter_credentials.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::VmwareEngine::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.private_cloud + header_params["private_cloud"] = request.private_cloud + 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_vcenter_credentials.timeout, + metadata: metadata, + retry_policy: @config.rpcs.show_vcenter_credentials.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vmware_engine_stub.call_rpc :show_vcenter_credentials, 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 + + ## + # Resets credentials of the NSX appliance. + # + # @overload reset_nsx_credentials(request, options = nil) + # Pass arguments to `reset_nsx_credentials` via a request object, either of type + # {::Google::Cloud::VmwareEngine::V1::ResetNsxCredentialsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VmwareEngine::V1::ResetNsxCredentialsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload reset_nsx_credentials(private_cloud: nil, request_id: nil) + # Pass arguments to `reset_nsx_credentials` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param private_cloud [::String] + # Required. The resource name of the private cloud + # to reset credentials for. + # Resource names are schemeless URIs that follow the conventions in + # https://cloud.google.com/apis/design/resource_names. + # For example: + # `projects/my-project/locations/us-central1-a/privateClouds/my-cloud` + # @param request_id [::String] + # Optional. A request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server guarantees that a + # request doesn't result in creation of duplicate commitments for at least 60 + # minutes. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # + # @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/vmware_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VmwareEngine::V1::ResetNsxCredentialsRequest.new + # + # # Call the reset_nsx_credentials method. + # result = client.reset_nsx_credentials 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 reset_nsx_credentials request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::ResetNsxCredentialsRequest + + # Converts hash 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.reset_nsx_credentials.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::VmwareEngine::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.private_cloud + header_params["private_cloud"] = request.private_cloud + 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.reset_nsx_credentials.timeout, + metadata: metadata, + retry_policy: @config.rpcs.reset_nsx_credentials.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vmware_engine_stub.call_rpc :reset_nsx_credentials, 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 + + ## + # Resets credentials of the Vcenter appliance. + # + # @overload reset_vcenter_credentials(request, options = nil) + # Pass arguments to `reset_vcenter_credentials` via a request object, either of type + # {::Google::Cloud::VmwareEngine::V1::ResetVcenterCredentialsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VmwareEngine::V1::ResetVcenterCredentialsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload reset_vcenter_credentials(private_cloud: nil, request_id: nil, username: nil) + # Pass arguments to `reset_vcenter_credentials` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param private_cloud [::String] + # Required. The resource name of the private cloud + # to reset credentials for. + # Resource names are schemeless URIs that follow the conventions in + # https://cloud.google.com/apis/design/resource_names. + # For example: + # `projects/my-project/locations/us-central1-a/privateClouds/my-cloud` + # @param request_id [::String] + # Optional. A request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server guarantees that a + # request doesn't result in creation of duplicate commitments for at least 60 + # minutes. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @param username [::String] + # Optional. The username of the user to be to reset the credentials. + # The default value of this field is CloudOwner@gve.local. + # The provided value should be one of the following: + # solution-user-01@gve.local, + # solution-user-02@gve.local, + # solution-user-03@gve.local, + # solution-user-04@gve.local, + # solution-user-05@gve.local, + # zertoadmin@gve.local. + # + # @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/vmware_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VmwareEngine::V1::ResetVcenterCredentialsRequest.new + # + # # Call the reset_vcenter_credentials method. + # result = client.reset_vcenter_credentials 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 reset_vcenter_credentials request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::ResetVcenterCredentialsRequest + + # Converts hash 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.reset_vcenter_credentials.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::VmwareEngine::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.private_cloud + header_params["private_cloud"] = request.private_cloud + 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.reset_vcenter_credentials.timeout, + metadata: metadata, + retry_policy: @config.rpcs.reset_vcenter_credentials.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vmware_engine_stub.call_rpc :reset_vcenter_credentials, 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 + + ## + # Gets details of the `DnsForwarding` config. + # + # @overload get_dns_forwarding(request, options = nil) + # Pass arguments to `get_dns_forwarding` via a request object, either of type + # {::Google::Cloud::VmwareEngine::V1::GetDnsForwardingRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VmwareEngine::V1::GetDnsForwardingRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_dns_forwarding(name: nil) + # Pass arguments to `get_dns_forwarding` via keyword arguments. Note that at + # least one keyword argument is 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 a `DnsForwarding` to retrieve. + # Resource names are schemeless URIs that follow the conventions in + # https://cloud.google.com/apis/design/resource_names. + # For example: + # `projects/my-project/locations/us-central1-a/privateClouds/my-cloud/dnsForwarding` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::VmwareEngine::V1::DnsForwarding] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::VmwareEngine::V1::DnsForwarding] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/vmware_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VmwareEngine::V1::GetDnsForwardingRequest.new + # + # # Call the get_dns_forwarding method. + # result = client.get_dns_forwarding request + # + # # The returned object is of type Google::Cloud::VmwareEngine::V1::DnsForwarding. + # p result + # + def get_dns_forwarding request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::GetDnsForwardingRequest + + # Converts hash 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_dns_forwarding.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::VmwareEngine::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_dns_forwarding.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_dns_forwarding.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vmware_engine_stub.call_rpc :get_dns_forwarding, 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 parameters of the `DnsForwarding` config, like associated + # domains. Only fields specified in `update_mask` are applied. + # + # @overload update_dns_forwarding(request, options = nil) + # Pass arguments to `update_dns_forwarding` via a request object, either of type + # {::Google::Cloud::VmwareEngine::V1::UpdateDnsForwardingRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VmwareEngine::V1::UpdateDnsForwardingRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_dns_forwarding(dns_forwarding: nil, update_mask: nil, request_id: nil) + # Pass arguments to `update_dns_forwarding` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param dns_forwarding [::Google::Cloud::VmwareEngine::V1::DnsForwarding, ::Hash] + # Required. DnsForwarding config details. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. Field mask is used to specify the fields to be overwritten in the + # `DnsForwarding` resource by the update. + # The fields specified in the `update_mask` are relative to the resource, not + # the full request. A field will be overwritten if it is in the mask. If the + # user does not provide a mask then all fields will be overwritten. + # @param request_id [::String] + # Optional. A request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server guarantees that a + # request doesn't result in creation of duplicate commitments for at least 60 + # minutes. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request ID, + # the server can check if original operation with the same request ID was + # received, and if so, will ignore the second request. This prevents clients + # from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # + # @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/vmware_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VmwareEngine::V1::UpdateDnsForwardingRequest.new + # + # # Call the update_dns_forwarding method. + # result = client.update_dns_forwarding 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 update_dns_forwarding request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::UpdateDnsForwardingRequest + + # Converts hash 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_dns_forwarding.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::VmwareEngine::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.dns_forwarding&.name + header_params["dns_forwarding.name"] = request.dns_forwarding.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_dns_forwarding.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_dns_forwarding.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vmware_engine_stub.call_rpc :update_dns_forwarding, 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 + + ## + # Retrieves a `NetworkPeering` resource by its resource name. The resource + # contains details of the network peering, such as peered + # networks, import and export custom route configurations, and peering state. + # NetworkPeering is a global resource and location can only be global. + # + # @overload get_network_peering(request, options = nil) + # Pass arguments to `get_network_peering` via a request object, either of type + # {::Google::Cloud::VmwareEngine::V1::GetNetworkPeeringRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VmwareEngine::V1::GetNetworkPeeringRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_network_peering(name: nil) + # Pass arguments to `get_network_peering` via keyword arguments. Note that at + # least one keyword argument is 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 network peering to retrieve. + # Resource names are schemeless URIs that follow the conventions in + # https://cloud.google.com/apis/design/resource_names. + # For example: + # `projects/my-project/locations/global/networkPeerings/my-peering` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::VmwareEngine::V1::NetworkPeering] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::VmwareEngine::V1::NetworkPeering] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/vmware_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VmwareEngine::V1::GetNetworkPeeringRequest.new + # + # # Call the get_network_peering method. + # result = client.get_network_peering request + # + # # The returned object is of type Google::Cloud::VmwareEngine::V1::NetworkPeering. + # p result + # + def get_network_peering request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::GetNetworkPeeringRequest + + # Converts hash 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_network_peering.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::VmwareEngine::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_network_peering.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_network_peering.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vmware_engine_stub.call_rpc :get_network_peering, 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 `NetworkPeering` resources in a given project. NetworkPeering is a + # global resource and location can only be global. + # + # @overload list_network_peerings(request, options = nil) + # Pass arguments to `list_network_peerings` via a request object, either of type + # {::Google::Cloud::VmwareEngine::V1::ListNetworkPeeringsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VmwareEngine::V1::ListNetworkPeeringsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_network_peerings(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) + # Pass arguments to `list_network_peerings` via keyword arguments. Note that at + # least one keyword argument is 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 (global) to query for + # network peerings. Resource names are schemeless URIs that follow the + # conventions in https://cloud.google.com/apis/design/resource_names. For + # example: `projects/my-project/locations/global` + # @param page_size [::Integer] + # The maximum number of network peerings to return in one page. + # The maximum value is coerced to 1000. + # The default value of this field is 500. + # @param page_token [::String] + # A page token, received from a previous `ListNetworkPeerings` call. + # Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to + # `ListNetworkPeerings` must match the call that provided the page + # token. + # @param filter [::String] + # A filter expression that matches resources returned in the response. + # The expression must specify the field name, a comparison + # operator, and the value that you want to use for filtering. The value + # must be a string, a number, or a boolean. The comparison operator + # must be `=`, `!=`, `>`, or `<`. + # + # For example, if you are filtering a list of network peerings, you can + # exclude the ones named `example-peering` by specifying + # `name != "example-peering"`. + # + # To filter on multiple expressions, provide each separate expression within + # parentheses. For example: + # ``` + # (name = "example-peering") + # (createTime > "2021-04-12T08:15:10.40Z") + # ``` + # + # By default, each expression is an `AND` expression. However, you + # can include `AND` and `OR` expressions explicitly. + # For example: + # ``` + # (name = "example-peering-1") AND + # (createTime > "2021-04-12T08:15:10.40Z") OR + # (name = "example-peering-2") + # ``` + # @param order_by [::String] + # Sorts list results by a certain order. By default, returned results + # are ordered by `name` in ascending order. + # You can also sort results in descending order based on the `name` value + # using `orderBy="name desc"`. + # Currently, only ordering by `name` is supported. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::VmwareEngine::V1::NetworkPeering>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::VmwareEngine::V1::NetworkPeering>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/vmware_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VmwareEngine::V1::ListNetworkPeeringsRequest.new + # + # # Call the list_network_peerings method. + # result = client.list_network_peerings 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::VmwareEngine::V1::NetworkPeering. + # p item + # end + # + def list_network_peerings request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::ListNetworkPeeringsRequest + + # Converts hash 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_network_peerings.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::VmwareEngine::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_network_peerings.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_network_peerings.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vmware_engine_stub.call_rpc :list_network_peerings, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @vmware_engine_stub, :list_network_peerings, 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 + + ## + # Creates a new network peering between the peer network and VMware Engine + # network provided in a `NetworkPeering` resource. NetworkPeering is a + # global resource and location can only be global. + # + # @overload create_network_peering(request, options = nil) + # Pass arguments to `create_network_peering` via a request object, either of type + # {::Google::Cloud::VmwareEngine::V1::CreateNetworkPeeringRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VmwareEngine::V1::CreateNetworkPeeringRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_network_peering(parent: nil, network_peering_id: nil, network_peering: nil, request_id: nil) + # Pass arguments to `create_network_peering` via keyword arguments. Note that at + # least one keyword argument is 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 to create the new network + # peering in. This value is always `global`, because `NetworkPeering` is a + # global resource. Resource names are schemeless URIs that follow the + # conventions in https://cloud.google.com/apis/design/resource_names. For + # example: `projects/my-project/locations/global` + # @param network_peering_id [::String] + # Required. The user-provided identifier of the new `NetworkPeering`. + # This identifier must be unique among `NetworkPeering` resources within the + # parent and becomes the final token in the name URI. + # The identifier must meet the following requirements: + # + # * Only contains 1-63 alphanumeric characters and hyphens + # * Begins with an alphabetical character + # * Ends with a non-hyphen character + # * Not formatted as a UUID + # * Complies with [RFC 1034](https://datatracker.ietf.org/doc/html/rfc1034) + # (section 3.5) + # @param network_peering [::Google::Cloud::VmwareEngine::V1::NetworkPeering, ::Hash] + # Required. The initial description of the new network peering. + # @param request_id [::String] + # Optional. A request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server guarantees that a + # request doesn't result in creation of duplicate commitments for at least 60 + # minutes. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # + # @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/vmware_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VmwareEngine::V1::CreateNetworkPeeringRequest.new + # + # # Call the create_network_peering method. + # result = client.create_network_peering 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_network_peering request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::CreateNetworkPeeringRequest + + # Converts hash 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_network_peering.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::VmwareEngine::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_network_peering.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_network_peering.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vmware_engine_stub.call_rpc :create_network_peering, 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 `NetworkPeering` resource. When a network peering is deleted for + # a VMware Engine network, the peer network becomes inaccessible to that + # VMware Engine network. NetworkPeering is a global resource and location can + # only be global. + # + # @overload delete_network_peering(request, options = nil) + # Pass arguments to `delete_network_peering` via a request object, either of type + # {::Google::Cloud::VmwareEngine::V1::DeleteNetworkPeeringRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VmwareEngine::V1::DeleteNetworkPeeringRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_network_peering(name: nil, request_id: nil) + # Pass arguments to `delete_network_peering` via keyword arguments. Note that at + # least one keyword argument is 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 network peering to be deleted. + # Resource names are schemeless URIs that follow the conventions in + # https://cloud.google.com/apis/design/resource_names. + # For example: + # `projects/my-project/locations/global/networkPeerings/my-peering` + # @param request_id [::String] + # Optional. A request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server guarantees that a + # request doesn't result in creation of duplicate commitments for at least 60 + # minutes. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # + # @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/vmware_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VmwareEngine::V1::DeleteNetworkPeeringRequest.new + # + # # Call the delete_network_peering method. + # result = client.delete_network_peering 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_network_peering request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::DeleteNetworkPeeringRequest + + # Converts hash 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_network_peering.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::VmwareEngine::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_network_peering.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_network_peering.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vmware_engine_stub.call_rpc :delete_network_peering, 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 + + ## + # Modifies a `NetworkPeering` resource. Only the `description` field can be + # updated. Only fields specified in `updateMask` are applied. NetworkPeering + # is a global resource and location can only be global. + # + # @overload update_network_peering(request, options = nil) + # Pass arguments to `update_network_peering` via a request object, either of type + # {::Google::Cloud::VmwareEngine::V1::UpdateNetworkPeeringRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VmwareEngine::V1::UpdateNetworkPeeringRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_network_peering(network_peering: nil, update_mask: nil, request_id: nil) + # Pass arguments to `update_network_peering` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param network_peering [::Google::Cloud::VmwareEngine::V1::NetworkPeering, ::Hash] + # Required. Network peering description. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. Field mask is used to specify the fields to be overwritten in the + # `NetworkPeering` resource by the update. + # The fields specified in the `update_mask` are relative to the resource, not + # the full request. A field will be overwritten if it is in the mask. If the + # user does not provide a mask then all fields will be overwritten. + # @param request_id [::String] + # Optional. A request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server guarantees that a + # request doesn't result in creation of duplicate commitments for at least 60 + # minutes. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # + # @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/vmware_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VmwareEngine::V1::UpdateNetworkPeeringRequest.new + # + # # Call the update_network_peering method. + # result = client.update_network_peering 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 update_network_peering request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::UpdateNetworkPeeringRequest + + # Converts hash 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_network_peering.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::VmwareEngine::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.network_peering&.name + header_params["network_peering.name"] = request.network_peering.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_network_peering.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_network_peering.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vmware_engine_stub.call_rpc :update_network_peering, 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 + + ## + # Lists the network peering routes exchanged over a peering connection. + # NetworkPeering is a global resource and location can only be global. + # + # @overload list_peering_routes(request, options = nil) + # Pass arguments to `list_peering_routes` via a request object, either of type + # {::Google::Cloud::VmwareEngine::V1::ListPeeringRoutesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VmwareEngine::V1::ListPeeringRoutesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_peering_routes(parent: nil, page_size: nil, page_token: nil, filter: nil) + # Pass arguments to `list_peering_routes` via keyword arguments. Note that at + # least one keyword argument is 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 network peering to retrieve peering + # routes from. Resource names are schemeless URIs that follow the conventions + # in https://cloud.google.com/apis/design/resource_names. For example: + # `projects/my-project/locations/global/networkPeerings/my-peering` + # @param page_size [::Integer] + # The maximum number of peering routes to return in one page. + # The service may return fewer than this value. + # The maximum value is coerced to 1000. + # The default value of this field is 500. + # @param page_token [::String] + # A page token, received from a previous `ListPeeringRoutes` call. + # Provide this to retrieve the subsequent page. + # When paginating, all other parameters provided to `ListPeeringRoutes` must + # match the call that provided the page token. + # @param filter [::String] + # A filter expression that matches resources returned in the response. + # Currently, only filtering on the `direction` field is supported. To return + # routes imported from the peer network, provide "direction=INCOMING". To + # return routes exported from the VMware Engine network, provide + # "direction=OUTGOING". Other filter expressions return an error. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::VmwareEngine::V1::PeeringRoute>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::VmwareEngine::V1::PeeringRoute>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/vmware_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VmwareEngine::V1::ListPeeringRoutesRequest.new + # + # # Call the list_peering_routes method. + # result = client.list_peering_routes 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::VmwareEngine::V1::PeeringRoute. + # p item + # end + # + def list_peering_routes request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::ListPeeringRoutesRequest + + # Converts hash 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_peering_routes.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::VmwareEngine::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_peering_routes.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_peering_routes.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vmware_engine_stub.call_rpc :list_peering_routes, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @vmware_engine_stub, :list_peering_routes, 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 + + ## + # Creates a new HCX activation key in a given private cloud. + # + # @overload create_hcx_activation_key(request, options = nil) + # Pass arguments to `create_hcx_activation_key` via a request object, either of type + # {::Google::Cloud::VmwareEngine::V1::CreateHcxActivationKeyRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VmwareEngine::V1::CreateHcxActivationKeyRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_hcx_activation_key(parent: nil, hcx_activation_key: nil, hcx_activation_key_id: nil, request_id: nil) + # Pass arguments to `create_hcx_activation_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 resource name of the private cloud to create the key for. + # Resource names are schemeless URIs that follow the conventions in + # https://cloud.google.com/apis/design/resource_names. + # For example: + # `projects/my-project/locations/us-central1/privateClouds/my-cloud` + # @param hcx_activation_key [::Google::Cloud::VmwareEngine::V1::HcxActivationKey, ::Hash] + # Required. The initial description of a new HCX activation key. When + # creating a new key, this field must be an empty object. + # @param hcx_activation_key_id [::String] + # Required. The user-provided identifier of the `HcxActivationKey` to be + # created. This identifier must be unique among `HcxActivationKey` resources + # within the parent and becomes the final token in the name URI. + # The identifier must meet the following requirements: + # + # * Only contains 1-63 alphanumeric characters and hyphens + # * Begins with an alphabetical character + # * Ends with a non-hyphen character + # * Not formatted as a UUID + # * Complies with [RFC 1034](https://datatracker.ietf.org/doc/html/rfc1034) + # (section 3.5) + # @param request_id [::String] + # A request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server guarantees that a + # request doesn't result in creation of duplicate commitments for at least 60 + # minutes. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request ID, + # the server can check if original operation with the same request ID was + # received, and if so, will ignore the second request. This prevents clients + # from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # + # @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/vmware_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VmwareEngine::V1::CreateHcxActivationKeyRequest.new + # + # # Call the create_hcx_activation_key method. + # result = client.create_hcx_activation_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 create_hcx_activation_key request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::CreateHcxActivationKeyRequest + + # Converts hash 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_hcx_activation_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::VmwareEngine::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_hcx_activation_key.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_hcx_activation_key.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vmware_engine_stub.call_rpc :create_hcx_activation_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 + + ## + # Lists `HcxActivationKey` resources in a given private cloud. + # + # @overload list_hcx_activation_keys(request, options = nil) + # Pass arguments to `list_hcx_activation_keys` via a request object, either of type + # {::Google::Cloud::VmwareEngine::V1::ListHcxActivationKeysRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VmwareEngine::V1::ListHcxActivationKeysRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_hcx_activation_keys(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_hcx_activation_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 private cloud + # to be queried for HCX activation keys. + # Resource names are schemeless URIs that follow the conventions in + # https://cloud.google.com/apis/design/resource_names. + # For example: + # `projects/my-project/locations/us-central1/privateClouds/my-cloud` + # @param page_size [::Integer] + # The maximum number of HCX activation keys to return in one page. + # The service may return fewer than this value. + # The maximum value is coerced to 1000. + # The default value of this field is 500. + # @param page_token [::String] + # A page token, received from a previous `ListHcxActivationKeys` call. + # Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to + # `ListHcxActivationKeys` must match the call that provided the page + # token. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::VmwareEngine::V1::HcxActivationKey>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::VmwareEngine::V1::HcxActivationKey>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/vmware_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VmwareEngine::V1::ListHcxActivationKeysRequest.new + # + # # Call the list_hcx_activation_keys method. + # result = client.list_hcx_activation_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::VmwareEngine::V1::HcxActivationKey. + # p item + # end + # + def list_hcx_activation_keys request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::ListHcxActivationKeysRequest + + # Converts hash 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_hcx_activation_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::VmwareEngine::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_hcx_activation_keys.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_hcx_activation_keys.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vmware_engine_stub.call_rpc :list_hcx_activation_keys, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @vmware_engine_stub, :list_hcx_activation_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 + + ## + # Retrieves a `HcxActivationKey` resource by its resource name. + # + # @overload get_hcx_activation_key(request, options = nil) + # Pass arguments to `get_hcx_activation_key` via a request object, either of type + # {::Google::Cloud::VmwareEngine::V1::GetHcxActivationKeyRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VmwareEngine::V1::GetHcxActivationKeyRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_hcx_activation_key(name: nil) + # Pass arguments to `get_hcx_activation_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 resource name of the HCX activation key to retrieve. + # Resource names are schemeless URIs that follow the conventions in + # https://cloud.google.com/apis/design/resource_names. + # For example: + # `projects/my-project/locations/us-central1/privateClouds/my-cloud/hcxActivationKeys/my-key` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::VmwareEngine::V1::HcxActivationKey] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::VmwareEngine::V1::HcxActivationKey] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/vmware_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VmwareEngine::V1::GetHcxActivationKeyRequest.new + # + # # Call the get_hcx_activation_key method. + # result = client.get_hcx_activation_key request + # + # # The returned object is of type Google::Cloud::VmwareEngine::V1::HcxActivationKey. + # p result + # + def get_hcx_activation_key request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::GetHcxActivationKeyRequest + + # Converts hash 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_hcx_activation_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::VmwareEngine::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_hcx_activation_key.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_hcx_activation_key.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vmware_engine_stub.call_rpc :get_hcx_activation_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 + + ## + # Retrieves a `NetworkPolicy` resource by its resource name. + # + # @overload get_network_policy(request, options = nil) + # Pass arguments to `get_network_policy` via a request object, either of type + # {::Google::Cloud::VmwareEngine::V1::GetNetworkPolicyRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VmwareEngine::V1::GetNetworkPolicyRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_network_policy(name: nil) + # Pass arguments to `get_network_policy` via keyword arguments. Note that at + # least one keyword argument is 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 network policy to retrieve. + # Resource names are schemeless URIs that follow the conventions in + # https://cloud.google.com/apis/design/resource_names. + # For example: + # `projects/my-project/locations/us-central1/networkPolicies/my-network-policy` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::VmwareEngine::V1::NetworkPolicy] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::VmwareEngine::V1::NetworkPolicy] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/vmware_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VmwareEngine::V1::GetNetworkPolicyRequest.new + # + # # Call the get_network_policy method. + # result = client.get_network_policy request + # + # # The returned object is of type Google::Cloud::VmwareEngine::V1::NetworkPolicy. + # p result + # + def get_network_policy request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::GetNetworkPolicyRequest + + # Converts hash 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_network_policy.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::VmwareEngine::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_network_policy.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_network_policy.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vmware_engine_stub.call_rpc :get_network_policy, 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 `NetworkPolicy` resources in a specified project and location. + # + # @overload list_network_policies(request, options = nil) + # Pass arguments to `list_network_policies` via a request object, either of type + # {::Google::Cloud::VmwareEngine::V1::ListNetworkPoliciesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VmwareEngine::V1::ListNetworkPoliciesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_network_policies(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) + # Pass arguments to `list_network_policies` via keyword arguments. Note that at + # least one keyword argument is 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 (region) to query for + # network policies. Resource names are schemeless URIs that follow the + # conventions in https://cloud.google.com/apis/design/resource_names. For + # example: `projects/my-project/locations/us-central1` + # @param page_size [::Integer] + # The maximum number of network policies to return in one page. + # The service may return fewer than this value. + # The maximum value is coerced to 1000. + # The default value of this field is 500. + # @param page_token [::String] + # A page token, received from a previous `ListNetworkPolicies` call. + # Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to + # `ListNetworkPolicies` must match the call that provided the page + # token. + # @param filter [::String] + # A filter expression that matches resources returned in the response. + # The expression must specify the field name, a comparison + # operator, and the value that you want to use for filtering. The value + # must be a string, a number, or a boolean. The comparison operator + # must be `=`, `!=`, `>`, or `<`. + # + # For example, if you are filtering a list of network policies, you can + # exclude the ones named `example-policy` by specifying + # `name != "example-policy"`. + # + # To filter on multiple expressions, provide each separate expression within + # parentheses. For example: + # ``` + # (name = "example-policy") + # (createTime > "2021-04-12T08:15:10.40Z") + # ``` + # + # By default, each expression is an `AND` expression. However, you + # can include `AND` and `OR` expressions explicitly. + # For example: + # ``` + # (name = "example-policy-1") AND + # (createTime > "2021-04-12T08:15:10.40Z") OR + # (name = "example-policy-2") + # ``` + # @param order_by [::String] + # Sorts list results by a certain order. By default, returned results + # are ordered by `name` in ascending order. + # You can also sort results in descending order based on the `name` value + # using `orderBy="name desc"`. + # Currently, only ordering by `name` is supported. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::VmwareEngine::V1::NetworkPolicy>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::VmwareEngine::V1::NetworkPolicy>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/vmware_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VmwareEngine::V1::ListNetworkPoliciesRequest.new + # + # # Call the list_network_policies method. + # result = client.list_network_policies 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::VmwareEngine::V1::NetworkPolicy. + # p item + # end + # + def list_network_policies request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::ListNetworkPoliciesRequest + + # Converts hash 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_network_policies.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::VmwareEngine::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_network_policies.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_network_policies.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vmware_engine_stub.call_rpc :list_network_policies, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @vmware_engine_stub, :list_network_policies, 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 + + ## + # Creates a new network policy in a given VMware Engine network of a + # project and location (region). A new network policy cannot be created if + # another network policy already exists in the same scope. + # + # @overload create_network_policy(request, options = nil) + # Pass arguments to `create_network_policy` via a request object, either of type + # {::Google::Cloud::VmwareEngine::V1::CreateNetworkPolicyRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VmwareEngine::V1::CreateNetworkPolicyRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_network_policy(parent: nil, network_policy_id: nil, network_policy: nil, request_id: nil) + # Pass arguments to `create_network_policy` via keyword arguments. Note that at + # least one keyword argument is 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 (region) + # to create the new network policy in. + # Resource names are schemeless URIs that follow the conventions in + # https://cloud.google.com/apis/design/resource_names. + # For example: + # `projects/my-project/locations/us-central1` + # @param network_policy_id [::String] + # Required. The user-provided identifier of the network policy to be created. + # This identifier must be unique within parent + # `projects/{my-project}/locations/{us-central1}/networkPolicies` and becomes + # the final token in the name URI. + # The identifier must meet the following requirements: + # + # * Only contains 1-63 alphanumeric characters and hyphens + # * Begins with an alphabetical character + # * Ends with a non-hyphen character + # * Not formatted as a UUID + # * Complies with [RFC 1034](https://datatracker.ietf.org/doc/html/rfc1034) + # (section 3.5) + # @param network_policy [::Google::Cloud::VmwareEngine::V1::NetworkPolicy, ::Hash] + # Required. The network policy configuration to use in the request. + # @param request_id [::String] + # Optional. A request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server guarantees that a + # request doesn't result in creation of duplicate commitments for at least 60 + # minutes. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # + # @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/vmware_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VmwareEngine::V1::CreateNetworkPolicyRequest.new + # + # # Call the create_network_policy method. + # result = client.create_network_policy 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_network_policy request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::CreateNetworkPolicyRequest + + # Converts hash 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_network_policy.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::VmwareEngine::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_network_policy.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_network_policy.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vmware_engine_stub.call_rpc :create_network_policy, 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 + + ## + # Modifies a `NetworkPolicy` resource. Only the following fields can be + # updated: `internet_access`, `external_ip`, `edge_services_cidr`. + # Only fields specified in `updateMask` are applied. When updating a network + # policy, the external IP network service can only be disabled if there are + # no external IP addresses present in the scope of the policy. Also, a + # `NetworkService` cannot be updated when `NetworkService.state` is set + # to `RECONCILING`. + # + # During operation processing, the resource is temporarily in the `ACTIVE` + # state before the operation fully completes. For that period of time, you + # can't update the resource. Use the operation status to determine when the + # processing fully completes. + # + # @overload update_network_policy(request, options = nil) + # Pass arguments to `update_network_policy` via a request object, either of type + # {::Google::Cloud::VmwareEngine::V1::UpdateNetworkPolicyRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VmwareEngine::V1::UpdateNetworkPolicyRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_network_policy(network_policy: nil, update_mask: nil, request_id: nil) + # Pass arguments to `update_network_policy` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param network_policy [::Google::Cloud::VmwareEngine::V1::NetworkPolicy, ::Hash] + # Required. Network policy description. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. Field mask is used to specify the fields to be overwritten in the + # `NetworkPolicy` resource by the update. + # The fields specified in the `update_mask` are relative to the resource, not + # the full request. A field will be overwritten if it is in the mask. If the + # user does not provide a mask then all fields will be overwritten. + # @param request_id [::String] + # Optional. A request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server guarantees that a + # request doesn't result in creation of duplicate commitments for at least 60 + # minutes. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # + # @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/vmware_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VmwareEngine::V1::UpdateNetworkPolicyRequest.new + # + # # Call the update_network_policy method. + # result = client.update_network_policy 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 update_network_policy request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::UpdateNetworkPolicyRequest + + # Converts hash 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_network_policy.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::VmwareEngine::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.network_policy&.name + header_params["network_policy.name"] = request.network_policy.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_network_policy.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_network_policy.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vmware_engine_stub.call_rpc :update_network_policy, 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 `NetworkPolicy` resource. A network policy cannot be deleted + # when `NetworkService.state` is set to `RECONCILING` for either its external + # IP or internet access service. + # + # @overload delete_network_policy(request, options = nil) + # Pass arguments to `delete_network_policy` via a request object, either of type + # {::Google::Cloud::VmwareEngine::V1::DeleteNetworkPolicyRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VmwareEngine::V1::DeleteNetworkPolicyRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_network_policy(name: nil, request_id: nil) + # Pass arguments to `delete_network_policy` via keyword arguments. Note that at + # least one keyword argument is 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 network policy to delete. + # Resource names are schemeless URIs that follow the conventions in + # https://cloud.google.com/apis/design/resource_names. + # For example: + # `projects/my-project/locations/us-central1/networkPolicies/my-network-policy` + # @param request_id [::String] + # Optional. A request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server guarantees that a + # request doesn't result in creation of duplicate commitments for at least 60 + # minutes. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # + # @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/vmware_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VmwareEngine::V1::DeleteNetworkPolicyRequest.new + # + # # Call the delete_network_policy method. + # result = client.delete_network_policy 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_network_policy request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::DeleteNetworkPolicyRequest + + # Converts hash 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_network_policy.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::VmwareEngine::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_network_policy.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_network_policy.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vmware_engine_stub.call_rpc :delete_network_policy, 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 + + ## + # Lists Consumer VPCs bound to Management DNS Zone of a given private cloud. + # + # @overload list_management_dns_zone_bindings(request, options = nil) + # Pass arguments to `list_management_dns_zone_bindings` via a request object, either of type + # {::Google::Cloud::VmwareEngine::V1::ListManagementDnsZoneBindingsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VmwareEngine::V1::ListManagementDnsZoneBindingsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_management_dns_zone_bindings(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) + # Pass arguments to `list_management_dns_zone_bindings` via keyword arguments. Note that at + # least one keyword argument is 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 private cloud to be queried for + # management DNS zone bindings. + # Resource names are schemeless URIs that follow the conventions in + # https://cloud.google.com/apis/design/resource_names. + # For example: + # `projects/my-project/locations/us-central1-a/privateClouds/my-cloud` + # @param page_size [::Integer] + # The maximum number of management DNS zone bindings to return in one page. + # The service may return fewer than this value. + # The maximum value is coerced to 1000. + # The default value of this field is 500. + # @param page_token [::String] + # A page token, received from a previous `ListManagementDnsZoneBindings` + # call. Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to + # `ListManagementDnsZoneBindings` must match the call that provided the page + # token. + # @param filter [::String] + # A filter expression that matches resources returned in the response. + # The expression must specify the field name, a comparison + # operator, and the value that you want to use for filtering. The value + # must be a string, a number, or a boolean. The comparison operator + # must be `=`, `!=`, `>`, or `<`. + # + # For example, if you are filtering a list of Management DNS Zone Bindings, + # you can exclude the ones named `example-management-dns-zone-binding` by + # specifying `name != "example-management-dns-zone-binding"`. + # + # To filter on multiple expressions, provide each separate expression within + # parentheses. For example: + # ``` + # (name = "example-management-dns-zone-binding") + # (createTime > "2021-04-12T08:15:10.40Z") + # ``` + # + # By default, each expression is an `AND` expression. However, you + # can include `AND` and `OR` expressions explicitly. + # For example: + # ``` + # (name = "example-management-dns-zone-binding-1") AND + # (createTime > "2021-04-12T08:15:10.40Z") OR + # (name = "example-management-dns-zone-binding-2") + # ``` + # @param order_by [::String] + # Sorts list results by a certain order. By default, returned results + # are ordered by `name` in ascending order. + # You can also sort results in descending order based on the `name` value + # using `orderBy="name desc"`. + # Currently, only ordering by `name` is supported. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::VmwareEngine::V1::ManagementDnsZoneBinding>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::VmwareEngine::V1::ManagementDnsZoneBinding>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/vmware_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VmwareEngine::V1::ListManagementDnsZoneBindingsRequest.new + # + # # Call the list_management_dns_zone_bindings method. + # result = client.list_management_dns_zone_bindings 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::VmwareEngine::V1::ManagementDnsZoneBinding. + # p item + # end + # + def list_management_dns_zone_bindings request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::ListManagementDnsZoneBindingsRequest + + # Converts hash 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_management_dns_zone_bindings.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::VmwareEngine::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_management_dns_zone_bindings.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_management_dns_zone_bindings.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vmware_engine_stub.call_rpc :list_management_dns_zone_bindings, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @vmware_engine_stub, :list_management_dns_zone_bindings, 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 + + ## + # Retrieves a 'ManagementDnsZoneBinding' resource by its resource name. + # + # @overload get_management_dns_zone_binding(request, options = nil) + # Pass arguments to `get_management_dns_zone_binding` via a request object, either of type + # {::Google::Cloud::VmwareEngine::V1::GetManagementDnsZoneBindingRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VmwareEngine::V1::GetManagementDnsZoneBindingRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_management_dns_zone_binding(name: nil) + # Pass arguments to `get_management_dns_zone_binding` via keyword arguments. Note that at + # least one keyword argument is 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 management DNS zone binding to + # retrieve. Resource names are schemeless URIs that follow the conventions in + # https://cloud.google.com/apis/design/resource_names. + # For example: + # `projects/my-project/locations/us-central1-a/privateClouds/my-cloud/managementDnsZoneBindings/my-management-dns-zone-binding` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::VmwareEngine::V1::ManagementDnsZoneBinding] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::VmwareEngine::V1::ManagementDnsZoneBinding] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/vmware_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VmwareEngine::V1::GetManagementDnsZoneBindingRequest.new + # + # # Call the get_management_dns_zone_binding method. + # result = client.get_management_dns_zone_binding request + # + # # The returned object is of type Google::Cloud::VmwareEngine::V1::ManagementDnsZoneBinding. + # p result + # + def get_management_dns_zone_binding request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::GetManagementDnsZoneBindingRequest + + # Converts hash 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_management_dns_zone_binding.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::VmwareEngine::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_management_dns_zone_binding.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_management_dns_zone_binding.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vmware_engine_stub.call_rpc :get_management_dns_zone_binding, 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 `ManagementDnsZoneBinding` resource in a private cloud. + # This RPC creates the DNS binding and the resource that represents the + # DNS binding of the consumer VPC network to the management DNS zone. A + # management DNS zone is the Cloud DNS cross-project binding zone that + # VMware Engine creates for each private cloud. It contains FQDNs and + # corresponding IP addresses for the private cloud's ESXi hosts and + # management VM appliances like vCenter and NSX Manager. + # + # @overload create_management_dns_zone_binding(request, options = nil) + # Pass arguments to `create_management_dns_zone_binding` via a request object, either of type + # {::Google::Cloud::VmwareEngine::V1::CreateManagementDnsZoneBindingRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VmwareEngine::V1::CreateManagementDnsZoneBindingRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_management_dns_zone_binding(parent: nil, management_dns_zone_binding: nil, management_dns_zone_binding_id: nil, request_id: nil) + # Pass arguments to `create_management_dns_zone_binding` via keyword arguments. Note that at + # least one keyword argument is 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 private cloud + # to create a new management DNS zone binding for. + # Resource names are schemeless URIs that follow the conventions in + # https://cloud.google.com/apis/design/resource_names. + # For example: + # `projects/my-project/locations/us-central1-a/privateClouds/my-cloud` + # @param management_dns_zone_binding [::Google::Cloud::VmwareEngine::V1::ManagementDnsZoneBinding, ::Hash] + # Required. The initial values for a new management DNS zone binding. + # @param management_dns_zone_binding_id [::String] + # Required. The user-provided identifier of the `ManagementDnsZoneBinding` + # resource to be created. This identifier must be unique among + # `ManagementDnsZoneBinding` resources within the parent and becomes the + # final token in the name URI. The identifier must meet the following + # requirements: + # + # * Only contains 1-63 alphanumeric characters and hyphens + # * Begins with an alphabetical character + # * Ends with a non-hyphen character + # * Not formatted as a UUID + # * Complies with [RFC 1034](https://datatracker.ietf.org/doc/html/rfc1034) + # (section 3.5) + # @param request_id [::String] + # Optional. A request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server guarantees that a + # request doesn't result in creation of duplicate commitments for at least 60 + # minutes. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request ID, + # the server can check if the original operation with the same request ID was + # received, and if so, will ignore the second request. This prevents clients + # from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # + # @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/vmware_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VmwareEngine::V1::CreateManagementDnsZoneBindingRequest.new + # + # # Call the create_management_dns_zone_binding method. + # result = client.create_management_dns_zone_binding 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_management_dns_zone_binding request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::CreateManagementDnsZoneBindingRequest + + # Converts hash 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_management_dns_zone_binding.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::VmwareEngine::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_management_dns_zone_binding.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_management_dns_zone_binding.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vmware_engine_stub.call_rpc :create_management_dns_zone_binding, 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 + + ## + # Updates a `ManagementDnsZoneBinding` resource. + # Only fields specified in `update_mask` are applied. + # + # @overload update_management_dns_zone_binding(request, options = nil) + # Pass arguments to `update_management_dns_zone_binding` via a request object, either of type + # {::Google::Cloud::VmwareEngine::V1::UpdateManagementDnsZoneBindingRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VmwareEngine::V1::UpdateManagementDnsZoneBindingRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_management_dns_zone_binding(update_mask: nil, management_dns_zone_binding: nil, request_id: nil) + # Pass arguments to `update_management_dns_zone_binding` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. Field mask is used to specify the fields to be overwritten in the + # `ManagementDnsZoneBinding` resource by the update. + # The fields specified in the `update_mask` are relative to the resource, not + # the full request. A field will be overwritten if it is in the mask. If the + # user does not provide a mask then all fields will be overwritten. + # @param management_dns_zone_binding [::Google::Cloud::VmwareEngine::V1::ManagementDnsZoneBinding, ::Hash] + # Required. New values to update the management DNS zone binding with. + # @param request_id [::String] + # Optional. A request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server guarantees that a + # request doesn't result in creation of duplicate commitments for at least 60 + # minutes. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request ID, + # the server can check if the original operation with the same request ID was + # received, and if so, will ignore the second request. This prevents clients + # from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # + # @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/vmware_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VmwareEngine::V1::UpdateManagementDnsZoneBindingRequest.new + # + # # Call the update_management_dns_zone_binding method. + # result = client.update_management_dns_zone_binding 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 update_management_dns_zone_binding request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::UpdateManagementDnsZoneBindingRequest + + # Converts hash 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_management_dns_zone_binding.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::VmwareEngine::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.management_dns_zone_binding&.name + header_params["management_dns_zone_binding.name"] = request.management_dns_zone_binding.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_management_dns_zone_binding.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_management_dns_zone_binding.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vmware_engine_stub.call_rpc :update_management_dns_zone_binding, 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 `ManagementDnsZoneBinding` resource. When a management DNS zone + # binding is deleted, the corresponding consumer VPC network is no longer + # bound to the management DNS zone. + # + # @overload delete_management_dns_zone_binding(request, options = nil) + # Pass arguments to `delete_management_dns_zone_binding` via a request object, either of type + # {::Google::Cloud::VmwareEngine::V1::DeleteManagementDnsZoneBindingRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VmwareEngine::V1::DeleteManagementDnsZoneBindingRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_management_dns_zone_binding(name: nil, request_id: nil) + # Pass arguments to `delete_management_dns_zone_binding` via keyword arguments. Note that at + # least one keyword argument is 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 management DNS zone binding to delete. + # Resource names are schemeless URIs that follow the conventions in + # https://cloud.google.com/apis/design/resource_names. + # For example: + # `projects/my-project/locations/us-central1-a/privateClouds/my-cloud/managementDnsZoneBindings/my-management-dns-zone-binding` + # @param request_id [::String] + # Optional. A request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server guarantees that a + # request doesn't result in creation of duplicate commitments for at least 60 + # minutes. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request + # ID, the server can check if the original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # + # @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/vmware_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VmwareEngine::V1::DeleteManagementDnsZoneBindingRequest.new + # + # # Call the delete_management_dns_zone_binding method. + # result = client.delete_management_dns_zone_binding 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_management_dns_zone_binding request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::DeleteManagementDnsZoneBindingRequest + + # Converts hash 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_management_dns_zone_binding.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::VmwareEngine::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_management_dns_zone_binding.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_management_dns_zone_binding.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vmware_engine_stub.call_rpc :delete_management_dns_zone_binding, 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 + + ## + # Retries to create a `ManagementDnsZoneBinding` resource that is + # in failed state. + # + # @overload repair_management_dns_zone_binding(request, options = nil) + # Pass arguments to `repair_management_dns_zone_binding` via a request object, either of type + # {::Google::Cloud::VmwareEngine::V1::RepairManagementDnsZoneBindingRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VmwareEngine::V1::RepairManagementDnsZoneBindingRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload repair_management_dns_zone_binding(name: nil, request_id: nil) + # Pass arguments to `repair_management_dns_zone_binding` via keyword arguments. Note that at + # least one keyword argument is 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 management DNS zone binding to repair. + # Resource names are schemeless URIs that follow the conventions in + # https://cloud.google.com/apis/design/resource_names. + # For example: + # `projects/my-project/locations/us-central1-a/privateClouds/my-cloud/managementDnsZoneBindings/my-management-dns-zone-binding` + # @param request_id [::String] + # Optional. A request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server guarantees that a + # request doesn't result in creation of duplicate commitments for at least 60 + # minutes. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request ID, + # the server can check if the original operation with the same request ID was + # received, and if so, will ignore the second request. This prevents clients + # from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # + # @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/vmware_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VmwareEngine::V1::RepairManagementDnsZoneBindingRequest.new + # + # # Call the repair_management_dns_zone_binding method. + # result = client.repair_management_dns_zone_binding 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 repair_management_dns_zone_binding request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::RepairManagementDnsZoneBindingRequest + + # Converts hash 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.repair_management_dns_zone_binding.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::VmwareEngine::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.repair_management_dns_zone_binding.timeout, + metadata: metadata, + retry_policy: @config.rpcs.repair_management_dns_zone_binding.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vmware_engine_stub.call_rpc :repair_management_dns_zone_binding, 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 VMware Engine network that can be used by a private cloud. + # + # @overload create_vmware_engine_network(request, options = nil) + # Pass arguments to `create_vmware_engine_network` via a request object, either of type + # {::Google::Cloud::VmwareEngine::V1::CreateVmwareEngineNetworkRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VmwareEngine::V1::CreateVmwareEngineNetworkRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_vmware_engine_network(parent: nil, vmware_engine_network_id: nil, vmware_engine_network: nil, request_id: nil) + # Pass arguments to `create_vmware_engine_network` via keyword arguments. Note that at + # least one keyword argument is 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 to create the new VMware Engine + # network in. A VMware Engine network of type + # `LEGACY` is a regional resource, and a VMware + # Engine network of type `STANDARD` is a global resource. + # Resource names are schemeless URIs that follow the conventions in + # https://cloud.google.com/apis/design/resource_names. For example: + # `projects/my-project/locations/global` + # @param vmware_engine_network_id [::String] + # Required. The user-provided identifier of the new VMware Engine network. + # This identifier must be unique among VMware Engine network resources + # within the parent and becomes the final token in the name URI. The + # identifier must meet the following requirements: + # + # * For networks of type LEGACY, adheres to the format: + # `{region-id}-default`. Replace `{region-id}` with the region where you want + # to create the VMware Engine network. For example, "us-central1-default". + # * Only contains 1-63 alphanumeric characters and hyphens + # * Begins with an alphabetical character + # * Ends with a non-hyphen character + # * Not formatted as a UUID + # * Complies with [RFC 1034](https://datatracker.ietf.org/doc/html/rfc1034) + # (section 3.5) + # @param vmware_engine_network [::Google::Cloud::VmwareEngine::V1::VmwareEngineNetwork, ::Hash] + # Required. The initial description of the new VMware Engine network. + # @param request_id [::String] + # Optional. A request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server guarantees that a + # request doesn't result in creation of duplicate commitments for at least 60 + # minutes. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # + # @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/vmware_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VmwareEngine::V1::CreateVmwareEngineNetworkRequest.new + # + # # Call the create_vmware_engine_network method. + # result = client.create_vmware_engine_network 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_vmware_engine_network request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::CreateVmwareEngineNetworkRequest + + # Converts hash 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_vmware_engine_network.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::VmwareEngine::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_vmware_engine_network.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_vmware_engine_network.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vmware_engine_stub.call_rpc :create_vmware_engine_network, 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 + + ## + # Modifies a VMware Engine network resource. Only the following fields can be + # updated: `description`. Only fields specified in `updateMask` are + # applied. + # + # @overload update_vmware_engine_network(request, options = nil) + # Pass arguments to `update_vmware_engine_network` via a request object, either of type + # {::Google::Cloud::VmwareEngine::V1::UpdateVmwareEngineNetworkRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VmwareEngine::V1::UpdateVmwareEngineNetworkRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_vmware_engine_network(vmware_engine_network: nil, update_mask: nil, request_id: nil) + # Pass arguments to `update_vmware_engine_network` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param vmware_engine_network [::Google::Cloud::VmwareEngine::V1::VmwareEngineNetwork, ::Hash] + # Required. VMware Engine network description. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. Field mask is used to specify the fields to be overwritten in the + # VMware Engine network resource by the update. + # The fields specified in the `update_mask` are relative to the resource, not + # the full request. A field will be overwritten if it is in the mask. If the + # user does not provide a mask then all fields will be overwritten. Only the + # following fields can be updated: `description`. + # @param request_id [::String] + # Optional. A request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server guarantees that a + # request doesn't result in creation of duplicate commitments for at least 60 + # minutes. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # + # @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/vmware_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VmwareEngine::V1::UpdateVmwareEngineNetworkRequest.new + # + # # Call the update_vmware_engine_network method. + # result = client.update_vmware_engine_network 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 update_vmware_engine_network request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::UpdateVmwareEngineNetworkRequest + + # Converts hash 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_vmware_engine_network.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::VmwareEngine::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.vmware_engine_network&.name + header_params["vmware_engine_network.name"] = request.vmware_engine_network.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_vmware_engine_network.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_vmware_engine_network.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vmware_engine_stub.call_rpc :update_vmware_engine_network, 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 `VmwareEngineNetwork` resource. You can only delete a VMware + # Engine network after all resources that refer to it are deleted. For + # example, a private cloud, a network peering, and a network policy can all + # refer to the same VMware Engine network. + # + # @overload delete_vmware_engine_network(request, options = nil) + # Pass arguments to `delete_vmware_engine_network` via a request object, either of type + # {::Google::Cloud::VmwareEngine::V1::DeleteVmwareEngineNetworkRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VmwareEngine::V1::DeleteVmwareEngineNetworkRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_vmware_engine_network(name: nil, request_id: nil, etag: nil) + # Pass arguments to `delete_vmware_engine_network` via keyword arguments. Note that at + # least one keyword argument is 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 VMware Engine network to be deleted. + # Resource names are schemeless URIs that follow the conventions in + # https://cloud.google.com/apis/design/resource_names. + # For example: + # `projects/my-project/locations/global/vmwareEngineNetworks/my-network` + # @param request_id [::String] + # Optional. A request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server guarantees that a + # request doesn't result in creation of duplicate commitments for at least 60 + # minutes. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @param etag [::String] + # Optional. Checksum used to ensure that the user-provided value is up to + # date before the server processes the request. The server compares provided + # checksum with the current checksum of the resource. If the user-provided + # value is out of date, this request returns an `ABORTED` error. + # + # @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/vmware_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VmwareEngine::V1::DeleteVmwareEngineNetworkRequest.new + # + # # Call the delete_vmware_engine_network method. + # result = client.delete_vmware_engine_network 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_vmware_engine_network request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::DeleteVmwareEngineNetworkRequest + + # Converts hash 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_vmware_engine_network.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::VmwareEngine::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_vmware_engine_network.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_vmware_engine_network.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vmware_engine_stub.call_rpc :delete_vmware_engine_network, 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 + + ## + # Retrieves a `VmwareEngineNetwork` resource by its resource name. The + # resource contains details of the VMware Engine network, such as its VMware + # Engine network type, peered networks in a service project, and state + # (for example, `CREATING`, `ACTIVE`, `DELETING`). + # + # @overload get_vmware_engine_network(request, options = nil) + # Pass arguments to `get_vmware_engine_network` via a request object, either of type + # {::Google::Cloud::VmwareEngine::V1::GetVmwareEngineNetworkRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VmwareEngine::V1::GetVmwareEngineNetworkRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_vmware_engine_network(name: nil) + # Pass arguments to `get_vmware_engine_network` via keyword arguments. Note that at + # least one keyword argument is 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 VMware Engine network to retrieve. + # Resource names are schemeless URIs that follow the conventions in + # https://cloud.google.com/apis/design/resource_names. + # For example: + # `projects/my-project/locations/global/vmwareEngineNetworks/my-network` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::VmwareEngine::V1::VmwareEngineNetwork] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::VmwareEngine::V1::VmwareEngineNetwork] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/vmware_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VmwareEngine::V1::GetVmwareEngineNetworkRequest.new + # + # # Call the get_vmware_engine_network method. + # result = client.get_vmware_engine_network request + # + # # The returned object is of type Google::Cloud::VmwareEngine::V1::VmwareEngineNetwork. + # p result + # + def get_vmware_engine_network request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::GetVmwareEngineNetworkRequest + + # Converts hash 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_vmware_engine_network.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::VmwareEngine::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_vmware_engine_network.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_vmware_engine_network.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vmware_engine_stub.call_rpc :get_vmware_engine_network, 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 `VmwareEngineNetwork` resources in a given project and location. + # + # @overload list_vmware_engine_networks(request, options = nil) + # Pass arguments to `list_vmware_engine_networks` via a request object, either of type + # {::Google::Cloud::VmwareEngine::V1::ListVmwareEngineNetworksRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VmwareEngine::V1::ListVmwareEngineNetworksRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_vmware_engine_networks(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) + # Pass arguments to `list_vmware_engine_networks` via keyword arguments. Note that at + # least one keyword argument is 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 to query for + # VMware Engine networks. Resource names are schemeless URIs that follow the + # conventions in https://cloud.google.com/apis/design/resource_names. For + # example: `projects/my-project/locations/global` + # @param page_size [::Integer] + # The maximum number of results to return in one page. + # The maximum value is coerced to 1000. + # The default value of this field is 500. + # @param page_token [::String] + # A page token, received from a previous `ListVmwareEngineNetworks` call. + # Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to + # `ListVmwareEngineNetworks` must match the call that provided the page + # token. + # @param filter [::String] + # A filter expression that matches resources returned in the response. + # The expression must specify the field name, a comparison + # operator, and the value that you want to use for filtering. The value + # must be a string, a number, or a boolean. The comparison operator + # must be `=`, `!=`, `>`, or `<`. + # + # For example, if you are filtering a list of network peerings, you can + # exclude the ones named `example-network` by specifying + # `name != "example-network"`. + # + # To filter on multiple expressions, provide each separate expression within + # parentheses. For example: + # ``` + # (name = "example-network") + # (createTime > "2021-04-12T08:15:10.40Z") + # ``` + # + # By default, each expression is an `AND` expression. However, you + # can include `AND` and `OR` expressions explicitly. + # For example: + # ``` + # (name = "example-network-1") AND + # (createTime > "2021-04-12T08:15:10.40Z") OR + # (name = "example-network-2") + # ``` + # @param order_by [::String] + # Sorts list results by a certain order. By default, returned results + # are ordered by `name` in ascending order. + # You can also sort results in descending order based on the `name` value + # using `orderBy="name desc"`. + # Currently, only ordering by `name` is supported. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::VmwareEngine::V1::VmwareEngineNetwork>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::VmwareEngine::V1::VmwareEngineNetwork>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/vmware_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VmwareEngine::V1::ListVmwareEngineNetworksRequest.new + # + # # Call the list_vmware_engine_networks method. + # result = client.list_vmware_engine_networks 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::VmwareEngine::V1::VmwareEngineNetwork. + # p item + # end + # + def list_vmware_engine_networks request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::ListVmwareEngineNetworksRequest + + # Converts hash 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_vmware_engine_networks.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::VmwareEngine::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_vmware_engine_networks.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_vmware_engine_networks.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vmware_engine_stub.call_rpc :list_vmware_engine_networks, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @vmware_engine_stub, :list_vmware_engine_networks, 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 + + ## + # Creates a new private connection that can be used for accessing private + # Clouds. + # + # @overload create_private_connection(request, options = nil) + # Pass arguments to `create_private_connection` via a request object, either of type + # {::Google::Cloud::VmwareEngine::V1::CreatePrivateConnectionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VmwareEngine::V1::CreatePrivateConnectionRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_private_connection(parent: nil, private_connection_id: nil, private_connection: nil, request_id: nil) + # Pass arguments to `create_private_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 to create the new private + # connection in. Private connection is a regional resource. + # Resource names are schemeless URIs that follow the conventions in + # https://cloud.google.com/apis/design/resource_names. For example: + # `projects/my-project/locations/us-central1` + # @param private_connection_id [::String] + # Required. The user-provided identifier of the new private connection. + # This identifier must be unique among private connection resources + # within the parent and becomes the final token in the name URI. The + # identifier must meet the following requirements: + # + # * Only contains 1-63 alphanumeric characters and hyphens + # * Begins with an alphabetical character + # * Ends with a non-hyphen character + # * Not formatted as a UUID + # * Complies with [RFC 1034](https://datatracker.ietf.org/doc/html/rfc1034) + # (section 3.5) + # @param private_connection [::Google::Cloud::VmwareEngine::V1::PrivateConnection, ::Hash] + # Required. The initial description of the new private connection. + # @param request_id [::String] + # Optional. A request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server guarantees that a + # request doesn't result in creation of duplicate commitments for at least 60 + # minutes. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # + # @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/vmware_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VmwareEngine::V1::CreatePrivateConnectionRequest.new + # + # # Call the create_private_connection method. + # result = client.create_private_connection 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_private_connection request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::CreatePrivateConnectionRequest + + # Converts hash 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_private_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::VmwareEngine::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_private_connection.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_private_connection.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vmware_engine_stub.call_rpc :create_private_connection, 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 + + ## + # Retrieves a `PrivateConnection` resource by its resource name. The resource + # contains details of the private connection, such as connected + # network, routing mode and state. + # + # @overload get_private_connection(request, options = nil) + # Pass arguments to `get_private_connection` via a request object, either of type + # {::Google::Cloud::VmwareEngine::V1::GetPrivateConnectionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VmwareEngine::V1::GetPrivateConnectionRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_private_connection(name: nil) + # Pass arguments to `get_private_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 resource name of the private connection to retrieve. + # Resource names are schemeless URIs that follow the conventions in + # https://cloud.google.com/apis/design/resource_names. + # For example: + # `projects/my-project/locations/us-central1/privateConnections/my-connection` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::VmwareEngine::V1::PrivateConnection] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::VmwareEngine::V1::PrivateConnection] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/vmware_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VmwareEngine::V1::GetPrivateConnectionRequest.new + # + # # Call the get_private_connection method. + # result = client.get_private_connection request + # + # # The returned object is of type Google::Cloud::VmwareEngine::V1::PrivateConnection. + # p result + # + def get_private_connection request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::GetPrivateConnectionRequest + + # Converts hash 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_private_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::VmwareEngine::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_private_connection.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_private_connection.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vmware_engine_stub.call_rpc :get_private_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 + + ## + # Lists `PrivateConnection` resources in a given project and location. + # + # @overload list_private_connections(request, options = nil) + # Pass arguments to `list_private_connections` via a request object, either of type + # {::Google::Cloud::VmwareEngine::V1::ListPrivateConnectionsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VmwareEngine::V1::ListPrivateConnectionsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_private_connections(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) + # Pass arguments to `list_private_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 to query for + # private connections. Resource names are schemeless URIs that follow the + # conventions in https://cloud.google.com/apis/design/resource_names. For + # example: `projects/my-project/locations/us-central1` + # @param page_size [::Integer] + # The maximum number of private connections to return in one page. + # The maximum value is coerced to 1000. + # The default value of this field is 500. + # @param page_token [::String] + # A page token, received from a previous `ListPrivateConnections` call. + # Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to + # `ListPrivateConnections` must match the call that provided the page + # token. + # @param filter [::String] + # A filter expression that matches resources returned in the response. + # The expression must specify the field name, a comparison + # operator, and the value that you want to use for filtering. The value + # must be a string, a number, or a boolean. The comparison operator + # must be `=`, `!=`, `>`, or `<`. + # + # For example, if you are filtering a list of private connections, you can + # exclude the ones named `example-connection` by specifying + # `name != "example-connection"`. + # + # To filter on multiple expressions, provide each separate expression within + # parentheses. For example: + # ``` + # (name = "example-connection") + # (createTime > "2022-09-22T08:15:10.40Z") + # ``` + # + # By default, each expression is an `AND` expression. However, you + # can include `AND` and `OR` expressions explicitly. + # For example: + # ``` + # (name = "example-connection-1") AND + # (createTime > "2021-04-12T08:15:10.40Z") OR + # (name = "example-connection-2") + # ``` + # @param order_by [::String] + # Sorts list results by a certain order. By default, returned results + # are ordered by `name` in ascending order. + # You can also sort results in descending order based on the `name` value + # using `orderBy="name desc"`. + # Currently, only ordering by `name` is supported. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::VmwareEngine::V1::PrivateConnection>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::VmwareEngine::V1::PrivateConnection>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/vmware_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VmwareEngine::V1::ListPrivateConnectionsRequest.new + # + # # Call the list_private_connections method. + # result = client.list_private_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::VmwareEngine::V1::PrivateConnection. + # p item + # end + # + def list_private_connections request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::ListPrivateConnectionsRequest + + # Converts hash 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_private_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::VmwareEngine::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_private_connections.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_private_connections.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vmware_engine_stub.call_rpc :list_private_connections, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @vmware_engine_stub, :list_private_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 + + ## + # Modifies a `PrivateConnection` resource. Only `description` and + # `routing_mode` fields can be updated. Only fields specified in `updateMask` + # are applied. + # + # @overload update_private_connection(request, options = nil) + # Pass arguments to `update_private_connection` via a request object, either of type + # {::Google::Cloud::VmwareEngine::V1::UpdatePrivateConnectionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VmwareEngine::V1::UpdatePrivateConnectionRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_private_connection(private_connection: nil, update_mask: nil, request_id: nil) + # Pass arguments to `update_private_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 private_connection [::Google::Cloud::VmwareEngine::V1::PrivateConnection, ::Hash] + # Required. Private connection description. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. Field mask is used to specify the fields to be overwritten in the + # `PrivateConnection` resource by the update. + # The fields specified in the `update_mask` are relative to the resource, not + # the full request. A field will be overwritten if it is in the mask. If the + # user does not provide a mask then all fields will be overwritten. + # @param request_id [::String] + # Optional. A request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server guarantees that a + # request doesn't result in creation of duplicate commitments for at least 60 + # minutes. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # + # @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/vmware_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VmwareEngine::V1::UpdatePrivateConnectionRequest.new + # + # # Call the update_private_connection method. + # result = client.update_private_connection 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 update_private_connection request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::UpdatePrivateConnectionRequest + + # Converts hash 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_private_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::VmwareEngine::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.private_connection&.name + header_params["private_connection.name"] = request.private_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_private_connection.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_private_connection.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vmware_engine_stub.call_rpc :update_private_connection, 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 `PrivateConnection` resource. When a private connection is + # deleted for a VMware Engine network, the connected network becomes + # inaccessible to that VMware Engine network. + # + # @overload delete_private_connection(request, options = nil) + # Pass arguments to `delete_private_connection` via a request object, either of type + # {::Google::Cloud::VmwareEngine::V1::DeletePrivateConnectionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VmwareEngine::V1::DeletePrivateConnectionRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_private_connection(name: nil, request_id: nil) + # Pass arguments to `delete_private_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 resource name of the private connection to be deleted. + # Resource names are schemeless URIs that follow the conventions in + # https://cloud.google.com/apis/design/resource_names. + # For example: + # `projects/my-project/locations/us-central1/privateConnections/my-connection` + # @param request_id [::String] + # Optional. A request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server guarantees that a + # request doesn't result in creation of duplicate commitments for at least 60 + # minutes. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # + # @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/vmware_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VmwareEngine::V1::DeletePrivateConnectionRequest.new + # + # # Call the delete_private_connection method. + # result = client.delete_private_connection 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_private_connection request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::DeletePrivateConnectionRequest + + # Converts hash 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_private_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::VmwareEngine::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_private_connection.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_private_connection.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vmware_engine_stub.call_rpc :delete_private_connection, 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 + + ## + # Lists the private connection routes exchanged over a peering connection. + # + # @overload list_private_connection_peering_routes(request, options = nil) + # Pass arguments to `list_private_connection_peering_routes` via a request object, either of type + # {::Google::Cloud::VmwareEngine::V1::ListPrivateConnectionPeeringRoutesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VmwareEngine::V1::ListPrivateConnectionPeeringRoutesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_private_connection_peering_routes(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_private_connection_peering_routes` via keyword arguments. Note that at + # least one keyword argument is 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 private connection to retrieve peering + # routes from. Resource names are schemeless URIs that follow the conventions + # in https://cloud.google.com/apis/design/resource_names. For example: + # `projects/my-project/locations/us-west1/privateConnections/my-connection` + # @param page_size [::Integer] + # The maximum number of peering routes to return in one page. + # The service may return fewer than this value. + # The maximum value is coerced to 1000. + # The default value of this field is 500. + # @param page_token [::String] + # A page token, received from a previous `ListPrivateConnectionPeeringRoutes` + # call. Provide this to retrieve the subsequent page. When paginating, all + # other parameters provided to `ListPrivateConnectionPeeringRoutes` must + # match the call that provided the page token. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::VmwareEngine::V1::PeeringRoute>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::VmwareEngine::V1::PeeringRoute>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/vmware_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VmwareEngine::V1::ListPrivateConnectionPeeringRoutesRequest.new + # + # # Call the list_private_connection_peering_routes method. + # result = client.list_private_connection_peering_routes 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::VmwareEngine::V1::PeeringRoute. + # p item + # end + # + def list_private_connection_peering_routes request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::ListPrivateConnectionPeeringRoutesRequest + + # Converts hash 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_private_connection_peering_routes.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::VmwareEngine::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_private_connection_peering_routes.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_private_connection_peering_routes.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vmware_engine_stub.call_rpc :list_private_connection_peering_routes, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @vmware_engine_stub, :list_private_connection_peering_routes, 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 + + ## + # Grants the bind permission to the customer provided principal(user / + # service account) to bind their DNS zone with the intranet VPC associated + # with the project. DnsBindPermission is a global resource and location can + # only be global. + # + # @overload grant_dns_bind_permission(request, options = nil) + # Pass arguments to `grant_dns_bind_permission` via a request object, either of type + # {::Google::Cloud::VmwareEngine::V1::GrantDnsBindPermissionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VmwareEngine::V1::GrantDnsBindPermissionRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload grant_dns_bind_permission(name: nil, principal: nil, request_id: nil) + # Pass arguments to `grant_dns_bind_permission` via keyword arguments. Note that at + # least one keyword argument is 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 name of the resource which stores the users/service accounts + # having the permission to bind to the corresponding intranet VPC of the + # consumer project. DnsBindPermission is a global resource. Resource names + # are schemeless URIs that follow the conventions in + # https://cloud.google.com/apis/design/resource_names. For example: + # `projects/my-project/locations/global/dnsBindPermission` + # @param principal [::Google::Cloud::VmwareEngine::V1::Principal, ::Hash] + # Required. The consumer provided user/service account which needs to be + # granted permission to bind with the intranet VPC corresponding to the + # consumer project. + # @param request_id [::String] + # Optional. A request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server guarantees that a + # request doesn't result in creation of duplicate commitments for at least 60 + # minutes. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # + # @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/vmware_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VmwareEngine::V1::GrantDnsBindPermissionRequest.new + # + # # Call the grant_dns_bind_permission method. + # result = client.grant_dns_bind_permission 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 grant_dns_bind_permission request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::GrantDnsBindPermissionRequest + + # Converts hash 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.grant_dns_bind_permission.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::VmwareEngine::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.grant_dns_bind_permission.timeout, + metadata: metadata, + retry_policy: @config.rpcs.grant_dns_bind_permission.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vmware_engine_stub.call_rpc :grant_dns_bind_permission, 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 + + ## + # Gets all the principals having bind permission on the intranet VPC + # associated with the consumer project granted by the Grant API. + # DnsBindPermission is a global resource and location can only be global. + # + # @overload get_dns_bind_permission(request, options = nil) + # Pass arguments to `get_dns_bind_permission` via a request object, either of type + # {::Google::Cloud::VmwareEngine::V1::GetDnsBindPermissionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VmwareEngine::V1::GetDnsBindPermissionRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_dns_bind_permission(name: nil) + # Pass arguments to `get_dns_bind_permission` via keyword arguments. Note that at + # least one keyword argument is 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 name of the resource which stores the users/service accounts + # having the permission to bind to the corresponding intranet VPC of the + # consumer project. DnsBindPermission is a global resource. Resource names + # are schemeless URIs that follow the conventions in + # https://cloud.google.com/apis/design/resource_names. For example: + # `projects/my-project/locations/global/dnsBindPermission` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::VmwareEngine::V1::DnsBindPermission] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::VmwareEngine::V1::DnsBindPermission] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/vmware_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VmwareEngine::V1::GetDnsBindPermissionRequest.new + # + # # Call the get_dns_bind_permission method. + # result = client.get_dns_bind_permission request + # + # # The returned object is of type Google::Cloud::VmwareEngine::V1::DnsBindPermission. + # p result + # + def get_dns_bind_permission request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::GetDnsBindPermissionRequest + + # Converts hash 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_dns_bind_permission.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::VmwareEngine::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_dns_bind_permission.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_dns_bind_permission.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vmware_engine_stub.call_rpc :get_dns_bind_permission, 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 + + ## + # Revokes the bind permission from the customer provided principal(user / + # service account) on the intranet VPC associated with the consumer project. + # DnsBindPermission is a global resource and location can only be global. + # + # @overload revoke_dns_bind_permission(request, options = nil) + # Pass arguments to `revoke_dns_bind_permission` via a request object, either of type + # {::Google::Cloud::VmwareEngine::V1::RevokeDnsBindPermissionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VmwareEngine::V1::RevokeDnsBindPermissionRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload revoke_dns_bind_permission(name: nil, principal: nil, request_id: nil) + # Pass arguments to `revoke_dns_bind_permission` via keyword arguments. Note that at + # least one keyword argument is 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 name of the resource which stores the users/service accounts + # having the permission to bind to the corresponding intranet VPC of the + # consumer project. DnsBindPermission is a global resource. Resource names + # are schemeless URIs that follow the conventions in + # https://cloud.google.com/apis/design/resource_names. For example: + # `projects/my-project/locations/global/dnsBindPermission` + # @param principal [::Google::Cloud::VmwareEngine::V1::Principal, ::Hash] + # Required. The consumer provided user/service account which needs to be + # granted permission to bind with the intranet VPC corresponding to the + # consumer project. + # @param request_id [::String] + # Optional. A request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server guarantees that a + # request doesn't result in creation of duplicate commitments for at least 60 + # minutes. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # + # @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/vmware_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VmwareEngine::V1::RevokeDnsBindPermissionRequest.new + # + # # Call the revoke_dns_bind_permission method. + # result = client.revoke_dns_bind_permission 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 revoke_dns_bind_permission request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::RevokeDnsBindPermissionRequest + + # Converts hash 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.revoke_dns_bind_permission.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::VmwareEngine::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.revoke_dns_bind_permission.timeout, + metadata: metadata, + retry_policy: @config.rpcs.revoke_dns_bind_permission.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vmware_engine_stub.call_rpc :revoke_dns_bind_permission, 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 VmwareEngine API. + # + # This class represents the configuration for VmwareEngine, + # 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::VmwareEngine::V1::VmwareEngine::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_private_clouds to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_private_clouds.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_private_clouds.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::VmwareEngine::V1::VmwareEngine::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 = "vmwareengine.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 VmwareEngine 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_private_clouds` + # @return [::Gapic::Config::Method] + # + attr_reader :list_private_clouds + ## + # RPC-specific configuration for `get_private_cloud` + # @return [::Gapic::Config::Method] + # + attr_reader :get_private_cloud + ## + # RPC-specific configuration for `create_private_cloud` + # @return [::Gapic::Config::Method] + # + attr_reader :create_private_cloud + ## + # RPC-specific configuration for `update_private_cloud` + # @return [::Gapic::Config::Method] + # + attr_reader :update_private_cloud + ## + # RPC-specific configuration for `delete_private_cloud` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_private_cloud + ## + # RPC-specific configuration for `undelete_private_cloud` + # @return [::Gapic::Config::Method] + # + attr_reader :undelete_private_cloud + ## + # RPC-specific configuration for `list_clusters` + # @return [::Gapic::Config::Method] + # + attr_reader :list_clusters + ## + # RPC-specific configuration for `get_cluster` + # @return [::Gapic::Config::Method] + # + attr_reader :get_cluster + ## + # RPC-specific configuration for `create_cluster` + # @return [::Gapic::Config::Method] + # + attr_reader :create_cluster + ## + # RPC-specific configuration for `update_cluster` + # @return [::Gapic::Config::Method] + # + attr_reader :update_cluster + ## + # RPC-specific configuration for `delete_cluster` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_cluster + ## + # RPC-specific configuration for `list_nodes` + # @return [::Gapic::Config::Method] + # + attr_reader :list_nodes + ## + # RPC-specific configuration for `get_node` + # @return [::Gapic::Config::Method] + # + attr_reader :get_node + ## + # RPC-specific configuration for `list_external_addresses` + # @return [::Gapic::Config::Method] + # + attr_reader :list_external_addresses + ## + # RPC-specific configuration for `fetch_network_policy_external_addresses` + # @return [::Gapic::Config::Method] + # + attr_reader :fetch_network_policy_external_addresses + ## + # RPC-specific configuration for `get_external_address` + # @return [::Gapic::Config::Method] + # + attr_reader :get_external_address + ## + # RPC-specific configuration for `create_external_address` + # @return [::Gapic::Config::Method] + # + attr_reader :create_external_address + ## + # RPC-specific configuration for `update_external_address` + # @return [::Gapic::Config::Method] + # + attr_reader :update_external_address + ## + # RPC-specific configuration for `delete_external_address` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_external_address + ## + # RPC-specific configuration for `list_subnets` + # @return [::Gapic::Config::Method] + # + attr_reader :list_subnets + ## + # RPC-specific configuration for `get_subnet` + # @return [::Gapic::Config::Method] + # + attr_reader :get_subnet + ## + # RPC-specific configuration for `update_subnet` + # @return [::Gapic::Config::Method] + # + attr_reader :update_subnet + ## + # RPC-specific configuration for `list_external_access_rules` + # @return [::Gapic::Config::Method] + # + attr_reader :list_external_access_rules + ## + # RPC-specific configuration for `get_external_access_rule` + # @return [::Gapic::Config::Method] + # + attr_reader :get_external_access_rule + ## + # RPC-specific configuration for `create_external_access_rule` + # @return [::Gapic::Config::Method] + # + attr_reader :create_external_access_rule + ## + # RPC-specific configuration for `update_external_access_rule` + # @return [::Gapic::Config::Method] + # + attr_reader :update_external_access_rule + ## + # RPC-specific configuration for `delete_external_access_rule` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_external_access_rule + ## + # RPC-specific configuration for `list_logging_servers` + # @return [::Gapic::Config::Method] + # + attr_reader :list_logging_servers + ## + # RPC-specific configuration for `get_logging_server` + # @return [::Gapic::Config::Method] + # + attr_reader :get_logging_server + ## + # RPC-specific configuration for `create_logging_server` + # @return [::Gapic::Config::Method] + # + attr_reader :create_logging_server + ## + # RPC-specific configuration for `update_logging_server` + # @return [::Gapic::Config::Method] + # + attr_reader :update_logging_server + ## + # RPC-specific configuration for `delete_logging_server` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_logging_server + ## + # RPC-specific configuration for `list_node_types` + # @return [::Gapic::Config::Method] + # + attr_reader :list_node_types + ## + # RPC-specific configuration for `get_node_type` + # @return [::Gapic::Config::Method] + # + attr_reader :get_node_type + ## + # RPC-specific configuration for `show_nsx_credentials` + # @return [::Gapic::Config::Method] + # + attr_reader :show_nsx_credentials + ## + # RPC-specific configuration for `show_vcenter_credentials` + # @return [::Gapic::Config::Method] + # + attr_reader :show_vcenter_credentials + ## + # RPC-specific configuration for `reset_nsx_credentials` + # @return [::Gapic::Config::Method] + # + attr_reader :reset_nsx_credentials + ## + # RPC-specific configuration for `reset_vcenter_credentials` + # @return [::Gapic::Config::Method] + # + attr_reader :reset_vcenter_credentials + ## + # RPC-specific configuration for `get_dns_forwarding` + # @return [::Gapic::Config::Method] + # + attr_reader :get_dns_forwarding + ## + # RPC-specific configuration for `update_dns_forwarding` + # @return [::Gapic::Config::Method] + # + attr_reader :update_dns_forwarding + ## + # RPC-specific configuration for `get_network_peering` + # @return [::Gapic::Config::Method] + # + attr_reader :get_network_peering + ## + # RPC-specific configuration for `list_network_peerings` + # @return [::Gapic::Config::Method] + # + attr_reader :list_network_peerings + ## + # RPC-specific configuration for `create_network_peering` + # @return [::Gapic::Config::Method] + # + attr_reader :create_network_peering + ## + # RPC-specific configuration for `delete_network_peering` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_network_peering + ## + # RPC-specific configuration for `update_network_peering` + # @return [::Gapic::Config::Method] + # + attr_reader :update_network_peering + ## + # RPC-specific configuration for `list_peering_routes` + # @return [::Gapic::Config::Method] + # + attr_reader :list_peering_routes + ## + # RPC-specific configuration for `create_hcx_activation_key` + # @return [::Gapic::Config::Method] + # + attr_reader :create_hcx_activation_key + ## + # RPC-specific configuration for `list_hcx_activation_keys` + # @return [::Gapic::Config::Method] + # + attr_reader :list_hcx_activation_keys + ## + # RPC-specific configuration for `get_hcx_activation_key` + # @return [::Gapic::Config::Method] + # + attr_reader :get_hcx_activation_key + ## + # RPC-specific configuration for `get_network_policy` + # @return [::Gapic::Config::Method] + # + attr_reader :get_network_policy + ## + # RPC-specific configuration for `list_network_policies` + # @return [::Gapic::Config::Method] + # + attr_reader :list_network_policies + ## + # RPC-specific configuration for `create_network_policy` + # @return [::Gapic::Config::Method] + # + attr_reader :create_network_policy + ## + # RPC-specific configuration for `update_network_policy` + # @return [::Gapic::Config::Method] + # + attr_reader :update_network_policy + ## + # RPC-specific configuration for `delete_network_policy` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_network_policy + ## + # RPC-specific configuration for `list_management_dns_zone_bindings` + # @return [::Gapic::Config::Method] + # + attr_reader :list_management_dns_zone_bindings + ## + # RPC-specific configuration for `get_management_dns_zone_binding` + # @return [::Gapic::Config::Method] + # + attr_reader :get_management_dns_zone_binding + ## + # RPC-specific configuration for `create_management_dns_zone_binding` + # @return [::Gapic::Config::Method] + # + attr_reader :create_management_dns_zone_binding + ## + # RPC-specific configuration for `update_management_dns_zone_binding` + # @return [::Gapic::Config::Method] + # + attr_reader :update_management_dns_zone_binding + ## + # RPC-specific configuration for `delete_management_dns_zone_binding` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_management_dns_zone_binding + ## + # RPC-specific configuration for `repair_management_dns_zone_binding` + # @return [::Gapic::Config::Method] + # + attr_reader :repair_management_dns_zone_binding + ## + # RPC-specific configuration for `create_vmware_engine_network` + # @return [::Gapic::Config::Method] + # + attr_reader :create_vmware_engine_network + ## + # RPC-specific configuration for `update_vmware_engine_network` + # @return [::Gapic::Config::Method] + # + attr_reader :update_vmware_engine_network + ## + # RPC-specific configuration for `delete_vmware_engine_network` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_vmware_engine_network + ## + # RPC-specific configuration for `get_vmware_engine_network` + # @return [::Gapic::Config::Method] + # + attr_reader :get_vmware_engine_network + ## + # RPC-specific configuration for `list_vmware_engine_networks` + # @return [::Gapic::Config::Method] + # + attr_reader :list_vmware_engine_networks + ## + # RPC-specific configuration for `create_private_connection` + # @return [::Gapic::Config::Method] + # + attr_reader :create_private_connection + ## + # RPC-specific configuration for `get_private_connection` + # @return [::Gapic::Config::Method] + # + attr_reader :get_private_connection + ## + # RPC-specific configuration for `list_private_connections` + # @return [::Gapic::Config::Method] + # + attr_reader :list_private_connections + ## + # RPC-specific configuration for `update_private_connection` + # @return [::Gapic::Config::Method] + # + attr_reader :update_private_connection + ## + # RPC-specific configuration for `delete_private_connection` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_private_connection + ## + # RPC-specific configuration for `list_private_connection_peering_routes` + # @return [::Gapic::Config::Method] + # + attr_reader :list_private_connection_peering_routes + ## + # RPC-specific configuration for `grant_dns_bind_permission` + # @return [::Gapic::Config::Method] + # + attr_reader :grant_dns_bind_permission + ## + # RPC-specific configuration for `get_dns_bind_permission` + # @return [::Gapic::Config::Method] + # + attr_reader :get_dns_bind_permission + ## + # RPC-specific configuration for `revoke_dns_bind_permission` + # @return [::Gapic::Config::Method] + # + attr_reader :revoke_dns_bind_permission + + # @private + def initialize parent_rpcs = nil + list_private_clouds_config = parent_rpcs.list_private_clouds if parent_rpcs.respond_to? :list_private_clouds + @list_private_clouds = ::Gapic::Config::Method.new list_private_clouds_config + get_private_cloud_config = parent_rpcs.get_private_cloud if parent_rpcs.respond_to? :get_private_cloud + @get_private_cloud = ::Gapic::Config::Method.new get_private_cloud_config + create_private_cloud_config = parent_rpcs.create_private_cloud if parent_rpcs.respond_to? :create_private_cloud + @create_private_cloud = ::Gapic::Config::Method.new create_private_cloud_config + update_private_cloud_config = parent_rpcs.update_private_cloud if parent_rpcs.respond_to? :update_private_cloud + @update_private_cloud = ::Gapic::Config::Method.new update_private_cloud_config + delete_private_cloud_config = parent_rpcs.delete_private_cloud if parent_rpcs.respond_to? :delete_private_cloud + @delete_private_cloud = ::Gapic::Config::Method.new delete_private_cloud_config + undelete_private_cloud_config = parent_rpcs.undelete_private_cloud if parent_rpcs.respond_to? :undelete_private_cloud + @undelete_private_cloud = ::Gapic::Config::Method.new undelete_private_cloud_config + list_clusters_config = parent_rpcs.list_clusters if parent_rpcs.respond_to? :list_clusters + @list_clusters = ::Gapic::Config::Method.new list_clusters_config + get_cluster_config = parent_rpcs.get_cluster if parent_rpcs.respond_to? :get_cluster + @get_cluster = ::Gapic::Config::Method.new get_cluster_config + create_cluster_config = parent_rpcs.create_cluster if parent_rpcs.respond_to? :create_cluster + @create_cluster = ::Gapic::Config::Method.new create_cluster_config + update_cluster_config = parent_rpcs.update_cluster if parent_rpcs.respond_to? :update_cluster + @update_cluster = ::Gapic::Config::Method.new update_cluster_config + delete_cluster_config = parent_rpcs.delete_cluster if parent_rpcs.respond_to? :delete_cluster + @delete_cluster = ::Gapic::Config::Method.new delete_cluster_config + list_nodes_config = parent_rpcs.list_nodes if parent_rpcs.respond_to? :list_nodes + @list_nodes = ::Gapic::Config::Method.new list_nodes_config + get_node_config = parent_rpcs.get_node if parent_rpcs.respond_to? :get_node + @get_node = ::Gapic::Config::Method.new get_node_config + list_external_addresses_config = parent_rpcs.list_external_addresses if parent_rpcs.respond_to? :list_external_addresses + @list_external_addresses = ::Gapic::Config::Method.new list_external_addresses_config + fetch_network_policy_external_addresses_config = parent_rpcs.fetch_network_policy_external_addresses if parent_rpcs.respond_to? :fetch_network_policy_external_addresses + @fetch_network_policy_external_addresses = ::Gapic::Config::Method.new fetch_network_policy_external_addresses_config + get_external_address_config = parent_rpcs.get_external_address if parent_rpcs.respond_to? :get_external_address + @get_external_address = ::Gapic::Config::Method.new get_external_address_config + create_external_address_config = parent_rpcs.create_external_address if parent_rpcs.respond_to? :create_external_address + @create_external_address = ::Gapic::Config::Method.new create_external_address_config + update_external_address_config = parent_rpcs.update_external_address if parent_rpcs.respond_to? :update_external_address + @update_external_address = ::Gapic::Config::Method.new update_external_address_config + delete_external_address_config = parent_rpcs.delete_external_address if parent_rpcs.respond_to? :delete_external_address + @delete_external_address = ::Gapic::Config::Method.new delete_external_address_config + list_subnets_config = parent_rpcs.list_subnets if parent_rpcs.respond_to? :list_subnets + @list_subnets = ::Gapic::Config::Method.new list_subnets_config + get_subnet_config = parent_rpcs.get_subnet if parent_rpcs.respond_to? :get_subnet + @get_subnet = ::Gapic::Config::Method.new get_subnet_config + update_subnet_config = parent_rpcs.update_subnet if parent_rpcs.respond_to? :update_subnet + @update_subnet = ::Gapic::Config::Method.new update_subnet_config + list_external_access_rules_config = parent_rpcs.list_external_access_rules if parent_rpcs.respond_to? :list_external_access_rules + @list_external_access_rules = ::Gapic::Config::Method.new list_external_access_rules_config + get_external_access_rule_config = parent_rpcs.get_external_access_rule if parent_rpcs.respond_to? :get_external_access_rule + @get_external_access_rule = ::Gapic::Config::Method.new get_external_access_rule_config + create_external_access_rule_config = parent_rpcs.create_external_access_rule if parent_rpcs.respond_to? :create_external_access_rule + @create_external_access_rule = ::Gapic::Config::Method.new create_external_access_rule_config + update_external_access_rule_config = parent_rpcs.update_external_access_rule if parent_rpcs.respond_to? :update_external_access_rule + @update_external_access_rule = ::Gapic::Config::Method.new update_external_access_rule_config + delete_external_access_rule_config = parent_rpcs.delete_external_access_rule if parent_rpcs.respond_to? :delete_external_access_rule + @delete_external_access_rule = ::Gapic::Config::Method.new delete_external_access_rule_config + list_logging_servers_config = parent_rpcs.list_logging_servers if parent_rpcs.respond_to? :list_logging_servers + @list_logging_servers = ::Gapic::Config::Method.new list_logging_servers_config + get_logging_server_config = parent_rpcs.get_logging_server if parent_rpcs.respond_to? :get_logging_server + @get_logging_server = ::Gapic::Config::Method.new get_logging_server_config + create_logging_server_config = parent_rpcs.create_logging_server if parent_rpcs.respond_to? :create_logging_server + @create_logging_server = ::Gapic::Config::Method.new create_logging_server_config + update_logging_server_config = parent_rpcs.update_logging_server if parent_rpcs.respond_to? :update_logging_server + @update_logging_server = ::Gapic::Config::Method.new update_logging_server_config + delete_logging_server_config = parent_rpcs.delete_logging_server if parent_rpcs.respond_to? :delete_logging_server + @delete_logging_server = ::Gapic::Config::Method.new delete_logging_server_config + list_node_types_config = parent_rpcs.list_node_types if parent_rpcs.respond_to? :list_node_types + @list_node_types = ::Gapic::Config::Method.new list_node_types_config + get_node_type_config = parent_rpcs.get_node_type if parent_rpcs.respond_to? :get_node_type + @get_node_type = ::Gapic::Config::Method.new get_node_type_config + show_nsx_credentials_config = parent_rpcs.show_nsx_credentials if parent_rpcs.respond_to? :show_nsx_credentials + @show_nsx_credentials = ::Gapic::Config::Method.new show_nsx_credentials_config + show_vcenter_credentials_config = parent_rpcs.show_vcenter_credentials if parent_rpcs.respond_to? :show_vcenter_credentials + @show_vcenter_credentials = ::Gapic::Config::Method.new show_vcenter_credentials_config + reset_nsx_credentials_config = parent_rpcs.reset_nsx_credentials if parent_rpcs.respond_to? :reset_nsx_credentials + @reset_nsx_credentials = ::Gapic::Config::Method.new reset_nsx_credentials_config + reset_vcenter_credentials_config = parent_rpcs.reset_vcenter_credentials if parent_rpcs.respond_to? :reset_vcenter_credentials + @reset_vcenter_credentials = ::Gapic::Config::Method.new reset_vcenter_credentials_config + get_dns_forwarding_config = parent_rpcs.get_dns_forwarding if parent_rpcs.respond_to? :get_dns_forwarding + @get_dns_forwarding = ::Gapic::Config::Method.new get_dns_forwarding_config + update_dns_forwarding_config = parent_rpcs.update_dns_forwarding if parent_rpcs.respond_to? :update_dns_forwarding + @update_dns_forwarding = ::Gapic::Config::Method.new update_dns_forwarding_config + get_network_peering_config = parent_rpcs.get_network_peering if parent_rpcs.respond_to? :get_network_peering + @get_network_peering = ::Gapic::Config::Method.new get_network_peering_config + list_network_peerings_config = parent_rpcs.list_network_peerings if parent_rpcs.respond_to? :list_network_peerings + @list_network_peerings = ::Gapic::Config::Method.new list_network_peerings_config + create_network_peering_config = parent_rpcs.create_network_peering if parent_rpcs.respond_to? :create_network_peering + @create_network_peering = ::Gapic::Config::Method.new create_network_peering_config + delete_network_peering_config = parent_rpcs.delete_network_peering if parent_rpcs.respond_to? :delete_network_peering + @delete_network_peering = ::Gapic::Config::Method.new delete_network_peering_config + update_network_peering_config = parent_rpcs.update_network_peering if parent_rpcs.respond_to? :update_network_peering + @update_network_peering = ::Gapic::Config::Method.new update_network_peering_config + list_peering_routes_config = parent_rpcs.list_peering_routes if parent_rpcs.respond_to? :list_peering_routes + @list_peering_routes = ::Gapic::Config::Method.new list_peering_routes_config + create_hcx_activation_key_config = parent_rpcs.create_hcx_activation_key if parent_rpcs.respond_to? :create_hcx_activation_key + @create_hcx_activation_key = ::Gapic::Config::Method.new create_hcx_activation_key_config + list_hcx_activation_keys_config = parent_rpcs.list_hcx_activation_keys if parent_rpcs.respond_to? :list_hcx_activation_keys + @list_hcx_activation_keys = ::Gapic::Config::Method.new list_hcx_activation_keys_config + get_hcx_activation_key_config = parent_rpcs.get_hcx_activation_key if parent_rpcs.respond_to? :get_hcx_activation_key + @get_hcx_activation_key = ::Gapic::Config::Method.new get_hcx_activation_key_config + get_network_policy_config = parent_rpcs.get_network_policy if parent_rpcs.respond_to? :get_network_policy + @get_network_policy = ::Gapic::Config::Method.new get_network_policy_config + list_network_policies_config = parent_rpcs.list_network_policies if parent_rpcs.respond_to? :list_network_policies + @list_network_policies = ::Gapic::Config::Method.new list_network_policies_config + create_network_policy_config = parent_rpcs.create_network_policy if parent_rpcs.respond_to? :create_network_policy + @create_network_policy = ::Gapic::Config::Method.new create_network_policy_config + update_network_policy_config = parent_rpcs.update_network_policy if parent_rpcs.respond_to? :update_network_policy + @update_network_policy = ::Gapic::Config::Method.new update_network_policy_config + delete_network_policy_config = parent_rpcs.delete_network_policy if parent_rpcs.respond_to? :delete_network_policy + @delete_network_policy = ::Gapic::Config::Method.new delete_network_policy_config + list_management_dns_zone_bindings_config = parent_rpcs.list_management_dns_zone_bindings if parent_rpcs.respond_to? :list_management_dns_zone_bindings + @list_management_dns_zone_bindings = ::Gapic::Config::Method.new list_management_dns_zone_bindings_config + get_management_dns_zone_binding_config = parent_rpcs.get_management_dns_zone_binding if parent_rpcs.respond_to? :get_management_dns_zone_binding + @get_management_dns_zone_binding = ::Gapic::Config::Method.new get_management_dns_zone_binding_config + create_management_dns_zone_binding_config = parent_rpcs.create_management_dns_zone_binding if parent_rpcs.respond_to? :create_management_dns_zone_binding + @create_management_dns_zone_binding = ::Gapic::Config::Method.new create_management_dns_zone_binding_config + update_management_dns_zone_binding_config = parent_rpcs.update_management_dns_zone_binding if parent_rpcs.respond_to? :update_management_dns_zone_binding + @update_management_dns_zone_binding = ::Gapic::Config::Method.new update_management_dns_zone_binding_config + delete_management_dns_zone_binding_config = parent_rpcs.delete_management_dns_zone_binding if parent_rpcs.respond_to? :delete_management_dns_zone_binding + @delete_management_dns_zone_binding = ::Gapic::Config::Method.new delete_management_dns_zone_binding_config + repair_management_dns_zone_binding_config = parent_rpcs.repair_management_dns_zone_binding if parent_rpcs.respond_to? :repair_management_dns_zone_binding + @repair_management_dns_zone_binding = ::Gapic::Config::Method.new repair_management_dns_zone_binding_config + create_vmware_engine_network_config = parent_rpcs.create_vmware_engine_network if parent_rpcs.respond_to? :create_vmware_engine_network + @create_vmware_engine_network = ::Gapic::Config::Method.new create_vmware_engine_network_config + update_vmware_engine_network_config = parent_rpcs.update_vmware_engine_network if parent_rpcs.respond_to? :update_vmware_engine_network + @update_vmware_engine_network = ::Gapic::Config::Method.new update_vmware_engine_network_config + delete_vmware_engine_network_config = parent_rpcs.delete_vmware_engine_network if parent_rpcs.respond_to? :delete_vmware_engine_network + @delete_vmware_engine_network = ::Gapic::Config::Method.new delete_vmware_engine_network_config + get_vmware_engine_network_config = parent_rpcs.get_vmware_engine_network if parent_rpcs.respond_to? :get_vmware_engine_network + @get_vmware_engine_network = ::Gapic::Config::Method.new get_vmware_engine_network_config + list_vmware_engine_networks_config = parent_rpcs.list_vmware_engine_networks if parent_rpcs.respond_to? :list_vmware_engine_networks + @list_vmware_engine_networks = ::Gapic::Config::Method.new list_vmware_engine_networks_config + create_private_connection_config = parent_rpcs.create_private_connection if parent_rpcs.respond_to? :create_private_connection + @create_private_connection = ::Gapic::Config::Method.new create_private_connection_config + get_private_connection_config = parent_rpcs.get_private_connection if parent_rpcs.respond_to? :get_private_connection + @get_private_connection = ::Gapic::Config::Method.new get_private_connection_config + list_private_connections_config = parent_rpcs.list_private_connections if parent_rpcs.respond_to? :list_private_connections + @list_private_connections = ::Gapic::Config::Method.new list_private_connections_config + update_private_connection_config = parent_rpcs.update_private_connection if parent_rpcs.respond_to? :update_private_connection + @update_private_connection = ::Gapic::Config::Method.new update_private_connection_config + delete_private_connection_config = parent_rpcs.delete_private_connection if parent_rpcs.respond_to? :delete_private_connection + @delete_private_connection = ::Gapic::Config::Method.new delete_private_connection_config + list_private_connection_peering_routes_config = parent_rpcs.list_private_connection_peering_routes if parent_rpcs.respond_to? :list_private_connection_peering_routes + @list_private_connection_peering_routes = ::Gapic::Config::Method.new list_private_connection_peering_routes_config + grant_dns_bind_permission_config = parent_rpcs.grant_dns_bind_permission if parent_rpcs.respond_to? :grant_dns_bind_permission + @grant_dns_bind_permission = ::Gapic::Config::Method.new grant_dns_bind_permission_config + get_dns_bind_permission_config = parent_rpcs.get_dns_bind_permission if parent_rpcs.respond_to? :get_dns_bind_permission + @get_dns_bind_permission = ::Gapic::Config::Method.new get_dns_bind_permission_config + revoke_dns_bind_permission_config = parent_rpcs.revoke_dns_bind_permission if parent_rpcs.respond_to? :revoke_dns_bind_permission + @revoke_dns_bind_permission = ::Gapic::Config::Method.new revoke_dns_bind_permission_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-vmware_engine-v1/lib/google/cloud/vmware_engine/v1/vmware_engine/credentials.rb b/owl-bot-staging/google-cloud-vmware_engine-v1/lib/google/cloud/vmware_engine/v1/vmware_engine/credentials.rb new file mode 100644 index 000000000000..3315e3ee7355 --- /dev/null +++ b/owl-bot-staging/google-cloud-vmware_engine-v1/lib/google/cloud/vmware_engine/v1/vmware_engine/credentials.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! + +require "googleauth" + +module Google + module Cloud + module VmwareEngine + module V1 + module VmwareEngine + # Credentials for the VmwareEngine API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/cloud-platform" + ] + self.env_vars = [ + "GOOGLE_CLOUD_CREDENTIALS", + "GOOGLE_CLOUD_KEYFILE", + "GCLOUD_KEYFILE", + "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-vmware_engine-v1/lib/google/cloud/vmware_engine/v1/vmware_engine/operations.rb b/owl-bot-staging/google-cloud-vmware_engine-v1/lib/google/cloud/vmware_engine/v1/vmware_engine/operations.rb new file mode 100644 index 000000000000..d8e3a093e6d2 --- /dev/null +++ b/owl-bot-staging/google-cloud-vmware_engine-v1/lib/google/cloud/vmware_engine/v1/vmware_engine/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 VmwareEngine + module V1 + module VmwareEngine + # Service that implements Longrunning Operations API. + class Operations + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "vmwareengine.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :operations_stub + + ## + # Configuration for the VmwareEngine 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 VmwareEngine 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::VmwareEngine::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::VmwareEngine::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::VmwareEngine::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::VmwareEngine::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::VmwareEngine::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 = "vmwareengine.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-vmware_engine-v1/lib/google/cloud/vmware_engine/v1/vmware_engine/paths.rb b/owl-bot-staging/google-cloud-vmware_engine-v1/lib/google/cloud/vmware_engine/v1/vmware_engine/paths.rb new file mode 100644 index 000000000000..230fafe081b5 --- /dev/null +++ b/owl-bot-staging/google-cloud-vmware_engine-v1/lib/google/cloud/vmware_engine/v1/vmware_engine/paths.rb @@ -0,0 +1,387 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 VmwareEngine + module V1 + module VmwareEngine + # Path helper methods for the VmwareEngine API. + module Paths + ## + # Create a fully-qualified Cluster resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/privateClouds/{private_cloud}/clusters/{cluster}` + # + # @param project [String] + # @param location [String] + # @param private_cloud [String] + # @param cluster [String] + # + # @return [::String] + def cluster_path project:, location:, private_cloud:, cluster: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "private_cloud cannot contain /" if private_cloud.to_s.include? "/" + + "projects/#{project}/locations/#{location}/privateClouds/#{private_cloud}/clusters/#{cluster}" + end + + ## + # Create a fully-qualified DnsBindPermission resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/dnsBindPermission` + # + # @param project [String] + # @param location [String] + # + # @return [::String] + def dns_bind_permission_path project:, location: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + + "projects/#{project}/locations/#{location}/dnsBindPermission" + end + + ## + # Create a fully-qualified DnsForwarding resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/privateClouds/{private_cloud}/dnsForwarding` + # + # @param project [String] + # @param location [String] + # @param private_cloud [String] + # + # @return [::String] + def dns_forwarding_path project:, location:, private_cloud: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/privateClouds/#{private_cloud}/dnsForwarding" + end + + ## + # Create a fully-qualified ExternalAccessRule resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/networkPolicies/{network_policy}/externalAccessRules/{external_access_rule}` + # + # @param project [String] + # @param location [String] + # @param network_policy [String] + # @param external_access_rule [String] + # + # @return [::String] + def external_access_rule_path project:, location:, network_policy:, external_access_rule: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "network_policy cannot contain /" if network_policy.to_s.include? "/" + + "projects/#{project}/locations/#{location}/networkPolicies/#{network_policy}/externalAccessRules/#{external_access_rule}" + end + + ## + # Create a fully-qualified ExternalAddress resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/privateClouds/{private_cloud}/externalAddresses/{external_address}` + # + # @param project [String] + # @param location [String] + # @param private_cloud [String] + # @param external_address [String] + # + # @return [::String] + def external_address_path project:, location:, private_cloud:, external_address: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "private_cloud cannot contain /" if private_cloud.to_s.include? "/" + + "projects/#{project}/locations/#{location}/privateClouds/#{private_cloud}/externalAddresses/#{external_address}" + end + + ## + # Create a fully-qualified HcxActivationKey resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/privateClouds/{private_cloud}/hcxActivationKeys/{hcx_activation_key}` + # + # @param project [String] + # @param location [String] + # @param private_cloud [String] + # @param hcx_activation_key [String] + # + # @return [::String] + def hcx_activation_key_path project:, location:, private_cloud:, hcx_activation_key: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "private_cloud cannot contain /" if private_cloud.to_s.include? "/" + + "projects/#{project}/locations/#{location}/privateClouds/#{private_cloud}/hcxActivationKeys/#{hcx_activation_key}" + 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 LoggingServer resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/privateClouds/{private_cloud}/loggingServers/{logging_server}` + # + # @param project [String] + # @param location [String] + # @param private_cloud [String] + # @param logging_server [String] + # + # @return [::String] + def logging_server_path project:, location:, private_cloud:, logging_server: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "private_cloud cannot contain /" if private_cloud.to_s.include? "/" + + "projects/#{project}/locations/#{location}/privateClouds/#{private_cloud}/loggingServers/#{logging_server}" + end + + ## + # Create a fully-qualified ManagementDnsZoneBinding resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/privateClouds/{private_cloud}/managementDnsZoneBindings/{management_dns_zone_binding}` + # + # @param project [String] + # @param location [String] + # @param private_cloud [String] + # @param management_dns_zone_binding [String] + # + # @return [::String] + def management_dns_zone_binding_path project:, location:, private_cloud:, management_dns_zone_binding: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "private_cloud cannot contain /" if private_cloud.to_s.include? "/" + + "projects/#{project}/locations/#{location}/privateClouds/#{private_cloud}/managementDnsZoneBindings/#{management_dns_zone_binding}" + end + + ## + # Create a fully-qualified Network resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/global/networks/{network}` + # + # @param project [String] + # @param network [String] + # + # @return [::String] + def network_path project:, network: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + + "projects/#{project}/global/networks/#{network}" + end + + ## + # Create a fully-qualified NetworkPeering resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/networkPeerings/{network_peering}` + # + # @param project [String] + # @param location [String] + # @param network_peering [String] + # + # @return [::String] + def network_peering_path project:, location:, network_peering: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/networkPeerings/#{network_peering}" + end + + ## + # Create a fully-qualified NetworkPolicy resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/networkPolicies/{network_policy}` + # + # @param project [String] + # @param location [String] + # @param network_policy [String] + # + # @return [::String] + def network_policy_path project:, location:, network_policy: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/networkPolicies/#{network_policy}" + end + + ## + # Create a fully-qualified Node resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/privateClouds/{private_cloud}/clusters/{cluster}/nodes/{node}` + # + # @param project [String] + # @param location [String] + # @param private_cloud [String] + # @param cluster [String] + # @param node [String] + # + # @return [::String] + def node_path project:, location:, private_cloud:, cluster:, node: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "private_cloud cannot contain /" if private_cloud.to_s.include? "/" + raise ::ArgumentError, "cluster cannot contain /" if cluster.to_s.include? "/" + + "projects/#{project}/locations/#{location}/privateClouds/#{private_cloud}/clusters/#{cluster}/nodes/#{node}" + end + + ## + # Create a fully-qualified NodeType resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/nodeTypes/{node_type}` + # + # @param project [String] + # @param location [String] + # @param node_type [String] + # + # @return [::String] + def node_type_path project:, location:, node_type: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/nodeTypes/#{node_type}" + end + + ## + # Create a fully-qualified PrivateCloud resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/privateClouds/{private_cloud}` + # + # @param project [String] + # @param location [String] + # @param private_cloud [String] + # + # @return [::String] + def private_cloud_path project:, location:, private_cloud: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/privateClouds/#{private_cloud}" + end + + ## + # Create a fully-qualified PrivateConnection resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/privateConnections/{private_connection}` + # + # @param project [String] + # @param location [String] + # @param private_connection [String] + # + # @return [::String] + def private_connection_path project:, location:, private_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}/privateConnections/#{private_connection}" + end + + ## + # Create a fully-qualified Subnet resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/privateClouds/{private_cloud}/subnets/{subnet}` + # + # @param project [String] + # @param location [String] + # @param private_cloud [String] + # @param subnet [String] + # + # @return [::String] + def subnet_path project:, location:, private_cloud:, subnet: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "private_cloud cannot contain /" if private_cloud.to_s.include? "/" + + "projects/#{project}/locations/#{location}/privateClouds/#{private_cloud}/subnets/#{subnet}" + end + + ## + # Create a fully-qualified VmwareEngineNetwork resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/vmwareEngineNetworks/{vmware_engine_network}` + # + # @param project [String] + # @param location [String] + # @param vmware_engine_network [String] + # + # @return [::String] + def vmware_engine_network_path project:, location:, vmware_engine_network: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/vmwareEngineNetworks/#{vmware_engine_network}" + end + + extend self + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-vmware_engine-v1/lib/google/cloud/vmware_engine/v1/vmware_engine/rest.rb b/owl-bot-staging/google-cloud-vmware_engine-v1/lib/google/cloud/vmware_engine/v1/vmware_engine/rest.rb new file mode 100644 index 000000000000..9fde2076af48 --- /dev/null +++ b/owl-bot-staging/google-cloud-vmware_engine-v1/lib/google/cloud/vmware_engine/v1/vmware_engine/rest.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! + +require "gapic/rest" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/vmware_engine/v1/version" +require "google/cloud/vmware_engine/v1/bindings_override" + +require "google/cloud/vmware_engine/v1/vmware_engine/credentials" +require "google/cloud/vmware_engine/v1/vmware_engine/paths" +require "google/cloud/vmware_engine/v1/vmware_engine/rest/operations" +require "google/cloud/vmware_engine/v1/vmware_engine/rest/client" + +module Google + module Cloud + module VmwareEngine + module V1 + ## + # VMwareEngine manages VMware's private clusters in the Cloud. + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/vmware_engine/v1/vmware_engine/rest" + # client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new + # + module VmwareEngine + # Client for the REST transport + module Rest + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "rest", "helpers.rb" +require "google/cloud/vmware_engine/v1/vmware_engine/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-vmware_engine-v1/lib/google/cloud/vmware_engine/v1/vmware_engine/rest/client.rb b/owl-bot-staging/google-cloud-vmware_engine-v1/lib/google/cloud/vmware_engine/v1/vmware_engine/rest/client.rb new file mode 100644 index 000000000000..00b805fa8c3c --- /dev/null +++ b/owl-bot-staging/google-cloud-vmware_engine-v1/lib/google/cloud/vmware_engine/v1/vmware_engine/rest/client.rb @@ -0,0 +1,9003 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/vmwareengine/v1/vmwareengine_pb" +require "google/cloud/vmware_engine/v1/vmware_engine/rest/service_stub" +require "google/cloud/location/rest" +require "google/iam/v1/rest" + +module Google + module Cloud + module VmwareEngine + module V1 + module VmwareEngine + module Rest + ## + # REST client for the VmwareEngine service. + # + # VMwareEngine manages VMware's private clusters in the Cloud. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "vmwareengine.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :vmware_engine_stub + + ## + # Configure the VmwareEngine Client class. + # + # See {::Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all VmwareEngine clients + # ::Google::Cloud::VmwareEngine::V1::VmwareEngine::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", "VmwareEngine", "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.timeout = 120.0 + + default_config.rpcs.list_private_clouds.timeout = 120.0 + default_config.rpcs.list_private_clouds.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.get_private_cloud.timeout = 120.0 + default_config.rpcs.get_private_cloud.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.list_clusters.timeout = 120.0 + default_config.rpcs.list_clusters.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.get_cluster.timeout = 120.0 + default_config.rpcs.get_cluster.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.list_nodes.timeout = 120.0 + default_config.rpcs.list_nodes.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.get_node.timeout = 120.0 + default_config.rpcs.get_node.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.list_external_addresses.timeout = 120.0 + default_config.rpcs.list_external_addresses.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.get_external_address.timeout = 120.0 + default_config.rpcs.get_external_address.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.list_subnets.timeout = 120.0 + default_config.rpcs.list_subnets.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.get_subnet.timeout = 120.0 + default_config.rpcs.get_subnet.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.update_subnet.timeout = 60.0 + + default_config.rpcs.list_external_access_rules.timeout = 120.0 + default_config.rpcs.list_external_access_rules.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.get_external_access_rule.timeout = 120.0 + default_config.rpcs.get_external_access_rule.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.list_logging_servers.timeout = 120.0 + default_config.rpcs.list_logging_servers.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.get_logging_server.timeout = 120.0 + default_config.rpcs.get_logging_server.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.list_node_types.timeout = 120.0 + default_config.rpcs.list_node_types.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.get_node_type.timeout = 120.0 + default_config.rpcs.get_node_type.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.show_nsx_credentials.timeout = 120.0 + default_config.rpcs.show_nsx_credentials.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.show_vcenter_credentials.timeout = 120.0 + default_config.rpcs.show_vcenter_credentials.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.get_dns_forwarding.timeout = 120.0 + default_config.rpcs.get_dns_forwarding.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.get_network_peering.timeout = 120.0 + default_config.rpcs.get_network_peering.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.list_network_peerings.timeout = 120.0 + default_config.rpcs.list_network_peerings.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.list_peering_routes.timeout = 120.0 + default_config.rpcs.list_peering_routes.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.list_hcx_activation_keys.timeout = 120.0 + default_config.rpcs.list_hcx_activation_keys.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.get_hcx_activation_key.timeout = 120.0 + default_config.rpcs.get_hcx_activation_key.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.get_network_policy.timeout = 120.0 + default_config.rpcs.get_network_policy.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.list_network_policies.timeout = 120.0 + default_config.rpcs.list_network_policies.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.list_management_dns_zone_bindings.timeout = 120.0 + default_config.rpcs.list_management_dns_zone_bindings.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.get_management_dns_zone_binding.timeout = 120.0 + default_config.rpcs.get_management_dns_zone_binding.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.get_vmware_engine_network.timeout = 120.0 + default_config.rpcs.get_vmware_engine_network.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.list_vmware_engine_networks.timeout = 120.0 + default_config.rpcs.list_vmware_engine_networks.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.get_private_connection.timeout = 120.0 + default_config.rpcs.get_private_connection.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.list_private_connections.timeout = 120.0 + default_config.rpcs.list_private_connections.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.list_private_connection_peering_routes.timeout = 120.0 + default_config.rpcs.list_private_connection_peering_routes.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.get_dns_bind_permission.timeout = 120.0 + default_config.rpcs.get_dns_bind_permission.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the VmwareEngine 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::VmwareEngine::V1::VmwareEngine::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 + @vmware_engine_stub.universe_domain + end + + ## + # Create a new VmwareEngine REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the VmwareEngine 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::VmwareEngine::V1::VmwareEngine::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 + + @vmware_engine_stub = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials, + logger: @config.logger + ) + + @vmware_engine_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 = @vmware_engine_stub.endpoint + config.universe_domain = @vmware_engine_stub.universe_domain + config.bindings_override = @config.bindings_override + config.logger = @vmware_engine_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 = @vmware_engine_stub.endpoint + config.universe_domain = @vmware_engine_stub.universe_domain + config.bindings_override = @config.bindings_override + config.logger = @vmware_engine_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::VmwareEngine::V1::VmwareEngine::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 + @vmware_engine_stub.logger + end + + # Service calls + + ## + # Lists `PrivateCloud` resources in a given project and location. + # + # @overload list_private_clouds(request, options = nil) + # Pass arguments to `list_private_clouds` via a request object, either of type + # {::Google::Cloud::VmwareEngine::V1::ListPrivateCloudsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VmwareEngine::V1::ListPrivateCloudsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_private_clouds(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) + # Pass arguments to `list_private_clouds` via keyword arguments. Note that at + # least one keyword argument is 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 private cloud to be queried for + # clusters. Resource names are schemeless URIs that follow the conventions in + # https://cloud.google.com/apis/design/resource_names. + # For example: + # `projects/my-project/locations/us-central1-a` + # @param page_size [::Integer] + # The maximum number of private clouds to return in one page. + # The service may return fewer than this value. + # The maximum value is coerced to 1000. + # The default value of this field is 500. + # @param page_token [::String] + # A page token, received from a previous `ListPrivateClouds` call. + # Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to `ListPrivateClouds` must + # match the call that provided the page token. + # @param filter [::String] + # A filter expression that matches resources returned in the response. + # The expression must specify the field name, a comparison operator, and the + # value that you want to use for filtering. The value must be a string, a + # number, or a boolean. The comparison operator must be `=`, `!=`, `>`, or + # `<`. + # + # For example, if you are filtering a list of private clouds, you can exclude + # the ones named `example-pc` by specifying `name != "example-pc"`. + # + # You can also filter nested fields. For example, you could specify + # `networkConfig.managementCidr = "192.168.0.0/24"` to include private clouds + # only if they have a matching address in their network configuration. + # + # To filter on multiple expressions, provide each separate expression within + # parentheses. For example: + # ``` + # (name = "example-pc") + # (createTime > "2021-04-12T08:15:10.40Z") + # ``` + # + # By default, each expression is an `AND` expression. However, you can + # include `AND` and `OR` expressions explicitly. For example: + # ``` + # (name = "private-cloud-1") AND + # (createTime > "2021-04-12T08:15:10.40Z") OR + # (name = "private-cloud-2") + # ``` + # @param order_by [::String] + # Sorts list results by a certain order. By default, returned results are + # ordered by `name` in ascending order. You can also sort results in + # descending order based on the `name` value using `orderBy="name desc"`. + # Currently, only ordering by `name` is supported. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::VmwareEngine::V1::PrivateCloud>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::VmwareEngine::V1::PrivateCloud>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/vmware_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VmwareEngine::V1::ListPrivateCloudsRequest.new + # + # # Call the list_private_clouds method. + # result = client.list_private_clouds 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::VmwareEngine::V1::PrivateCloud. + # p item + # end + # + def list_private_clouds request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::ListPrivateCloudsRequest + + # Converts hash 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_private_clouds.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::VmwareEngine::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_private_clouds.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_private_clouds.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vmware_engine_stub.list_private_clouds request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @vmware_engine_stub, :list_private_clouds, "private_clouds", 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 + + ## + # Retrieves a `PrivateCloud` resource by its resource name. + # + # @overload get_private_cloud(request, options = nil) + # Pass arguments to `get_private_cloud` via a request object, either of type + # {::Google::Cloud::VmwareEngine::V1::GetPrivateCloudRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VmwareEngine::V1::GetPrivateCloudRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_private_cloud(name: nil) + # Pass arguments to `get_private_cloud` via keyword arguments. Note that at + # least one keyword argument is 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 private cloud to retrieve. + # Resource names are schemeless URIs that follow the conventions in + # https://cloud.google.com/apis/design/resource_names. + # For example: + # `projects/my-project/locations/us-central1-a/privateClouds/my-cloud` + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::VmwareEngine::V1::PrivateCloud] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::VmwareEngine::V1::PrivateCloud] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/vmware_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VmwareEngine::V1::GetPrivateCloudRequest.new + # + # # Call the get_private_cloud method. + # result = client.get_private_cloud request + # + # # The returned object is of type Google::Cloud::VmwareEngine::V1::PrivateCloud. + # p result + # + def get_private_cloud request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::GetPrivateCloudRequest + + # Converts hash 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_private_cloud.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::VmwareEngine::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_private_cloud.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_private_cloud.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vmware_engine_stub.get_private_cloud 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 `PrivateCloud` resource in a given project and location. + # Private clouds of type `STANDARD` and + # `TIME_LIMITED` are zonal resources, `STRETCHED` private clouds are + # regional. + # Creating a private cloud also creates a [management + # cluster](https://cloud.google.com/vmware-engine/docs/concepts-vmware-components) + # for that private cloud. + # + # @overload create_private_cloud(request, options = nil) + # Pass arguments to `create_private_cloud` via a request object, either of type + # {::Google::Cloud::VmwareEngine::V1::CreatePrivateCloudRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VmwareEngine::V1::CreatePrivateCloudRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_private_cloud(parent: nil, private_cloud_id: nil, private_cloud: nil, request_id: nil, validate_only: nil) + # Pass arguments to `create_private_cloud` via keyword arguments. Note that at + # least one keyword argument is 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 to create the new + # private cloud in. Resource names are schemeless URIs that follow the + # conventions in https://cloud.google.com/apis/design/resource_names. + # For example: + # `projects/my-project/locations/us-central1-a` + # @param private_cloud_id [::String] + # Required. The user-provided identifier of the private cloud to be created. + # This identifier must be unique among each `PrivateCloud` within the parent + # and becomes the final token in the name URI. + # The identifier must meet the following requirements: + # + # * Only contains 1-63 alphanumeric characters and hyphens + # * Begins with an alphabetical character + # * Ends with a non-hyphen character + # * Not formatted as a UUID + # * Complies with [RFC 1034](https://datatracker.ietf.org/doc/html/rfc1034) + # (section 3.5) + # @param private_cloud [::Google::Cloud::VmwareEngine::V1::PrivateCloud, ::Hash] + # Required. The initial description of the new private cloud. + # @param request_id [::String] + # Optional. The request ID must be a valid UUID with the exception that zero + # UUID is not supported (00000000-0000-0000-0000-000000000000). + # @param validate_only [::Boolean] + # Optional. True if you want the request to be validated and not executed; + # false otherwise. + # @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/vmware_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VmwareEngine::V1::CreatePrivateCloudRequest.new + # + # # Call the create_private_cloud method. + # result = client.create_private_cloud 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_private_cloud request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::CreatePrivateCloudRequest + + # Converts hash 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_private_cloud.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::VmwareEngine::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_private_cloud.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_private_cloud.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vmware_engine_stub.create_private_cloud 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 + + ## + # Modifies a `PrivateCloud` resource. Only the following fields can be + # updated: `description`. + # Only fields specified in `updateMask` are applied. + # + # During operation processing, the resource is temporarily in the `ACTIVE` + # state before the operation fully completes. For that period of time, you + # can't update the resource. Use the operation status to determine when the + # processing fully completes. + # + # @overload update_private_cloud(request, options = nil) + # Pass arguments to `update_private_cloud` via a request object, either of type + # {::Google::Cloud::VmwareEngine::V1::UpdatePrivateCloudRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VmwareEngine::V1::UpdatePrivateCloudRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_private_cloud(private_cloud: nil, update_mask: nil, request_id: nil) + # Pass arguments to `update_private_cloud` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param private_cloud [::Google::Cloud::VmwareEngine::V1::PrivateCloud, ::Hash] + # Required. Private cloud description. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. Field mask is used to specify the fields to be overwritten in the + # `PrivateCloud` resource by the update. The fields specified in `updateMask` + # are relative to the resource, not the full request. A field will be + # overwritten if it is in the mask. If the user does not provide a mask then + # all fields will be overwritten. + # @param request_id [::String] + # Optional. The request ID must be a valid UUID with the exception that zero + # UUID is not supported (00000000-0000-0000-0000-000000000000). + # @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/vmware_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VmwareEngine::V1::UpdatePrivateCloudRequest.new + # + # # Call the update_private_cloud method. + # result = client.update_private_cloud 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 update_private_cloud request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::UpdatePrivateCloudRequest + + # Converts hash 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_private_cloud.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::VmwareEngine::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_private_cloud.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_private_cloud.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vmware_engine_stub.update_private_cloud 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 + + ## + # Schedules a `PrivateCloud` resource for deletion. + # + # A `PrivateCloud` resource scheduled for deletion has `PrivateCloud.state` + # set to `DELETED` and `expireTime` set to the time when deletion is final + # and can no longer be reversed. The delete operation is marked as done + # as soon as the `PrivateCloud` is successfully scheduled for deletion + # (this also applies when `delayHours` is set to zero), and the operation is + # not kept in pending state until `PrivateCloud` is purged. + # `PrivateCloud` can be restored using `UndeletePrivateCloud` method before + # the `expireTime` elapses. When `expireTime` is reached, deletion is final + # and all private cloud resources are irreversibly removed and billing stops. + # During the final removal process, `PrivateCloud.state` is set to `PURGING`. + # `PrivateCloud` can be polled using standard `GET` method for the whole + # period of deletion and purging. It will not be returned only + # when it is completely purged. + # + # @overload delete_private_cloud(request, options = nil) + # Pass arguments to `delete_private_cloud` via a request object, either of type + # {::Google::Cloud::VmwareEngine::V1::DeletePrivateCloudRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VmwareEngine::V1::DeletePrivateCloudRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_private_cloud(name: nil, request_id: nil, force: nil, delay_hours: nil) + # Pass arguments to `delete_private_cloud` via keyword arguments. Note that at + # least one keyword argument is 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 private cloud to delete. + # Resource names are schemeless URIs that follow the conventions in + # https://cloud.google.com/apis/design/resource_names. + # For example: + # `projects/my-project/locations/us-central1-a/privateClouds/my-cloud` + # @param request_id [::String] + # Optional. The request ID must be a valid UUID with the exception that zero + # UUID is not supported (00000000-0000-0000-0000-000000000000). + # @param force [::Boolean] + # Optional. If set to true, cascade delete is enabled and all children of + # this private cloud resource are also deleted. When this flag is set to + # false, the private cloud will not be deleted if there are any children + # other than the management cluster. The management cluster is always + # deleted. + # @param delay_hours [::Integer] + # Optional. Time delay of the deletion specified in hours. The default value + # is `3`. Specifying a non-zero value for this field changes the value of + # `PrivateCloud.state` to `DELETED` and sets `expire_time` to the planned + # deletion time. Deletion can be cancelled before `expire_time` elapses using + # {::Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client#undelete_private_cloud VmwareEngine.UndeletePrivateCloud}. + # Specifying a value of `0` for this field instead begins the deletion + # process and ceases billing immediately. During the final deletion process, + # the value of `PrivateCloud.state` becomes `PURGING`. + # @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/vmware_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VmwareEngine::V1::DeletePrivateCloudRequest.new + # + # # Call the delete_private_cloud method. + # result = client.delete_private_cloud 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_private_cloud request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::DeletePrivateCloudRequest + + # Converts hash 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_private_cloud.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::VmwareEngine::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_private_cloud.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_private_cloud.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vmware_engine_stub.delete_private_cloud 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 + + ## + # Restores a private cloud that was previously scheduled for deletion by + # `DeletePrivateCloud`. A `PrivateCloud` resource scheduled for deletion has + # `PrivateCloud.state` set to `DELETED` and `PrivateCloud.expireTime` set to + # the time when deletion can no longer be reversed. + # + # @overload undelete_private_cloud(request, options = nil) + # Pass arguments to `undelete_private_cloud` via a request object, either of type + # {::Google::Cloud::VmwareEngine::V1::UndeletePrivateCloudRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VmwareEngine::V1::UndeletePrivateCloudRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload undelete_private_cloud(name: nil, request_id: nil) + # Pass arguments to `undelete_private_cloud` via keyword arguments. Note that at + # least one keyword argument is 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 private cloud scheduled for deletion. + # Resource names are schemeless URIs that follow the conventions in + # https://cloud.google.com/apis/design/resource_names. + # For example: + # `projects/my-project/locations/us-central1-a/privateClouds/my-cloud` + # @param request_id [::String] + # Optional. The request ID must be a valid UUID with the exception that zero + # UUID is not supported (00000000-0000-0000-0000-000000000000). + # @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/vmware_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VmwareEngine::V1::UndeletePrivateCloudRequest.new + # + # # Call the undelete_private_cloud method. + # result = client.undelete_private_cloud 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 undelete_private_cloud request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::UndeletePrivateCloudRequest + + # Converts hash 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.undelete_private_cloud.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::VmwareEngine::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.undelete_private_cloud.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.undelete_private_cloud.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vmware_engine_stub.undelete_private_cloud 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 + + ## + # Lists `Cluster` resources in a given private cloud. + # + # @overload list_clusters(request, options = nil) + # Pass arguments to `list_clusters` via a request object, either of type + # {::Google::Cloud::VmwareEngine::V1::ListClustersRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VmwareEngine::V1::ListClustersRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_clusters(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) + # Pass arguments to `list_clusters` via keyword arguments. Note that at + # least one keyword argument is 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 private cloud to query for clusters. + # Resource names are schemeless URIs that follow the conventions in + # https://cloud.google.com/apis/design/resource_names. + # For example: + # `projects/my-project/locations/us-central1-a/privateClouds/my-cloud` + # @param page_size [::Integer] + # The maximum number of clusters to return in one page. + # The service may return fewer than this value. + # The maximum value is coerced to 1000. + # The default value of this field is 500. + # @param page_token [::String] + # A page token, received from a previous `ListClusters` call. + # Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to `ListClusters` + # must match the call that provided the page token. + # @param filter [::String] + # To filter on multiple expressions, provide each separate expression within + # parentheses. For example: + # ``` + # (name = "example-cluster") + # (nodeCount = "3") + # ``` + # + # By default, each expression is an `AND` expression. However, you can + # include `AND` and `OR` expressions explicitly. For example: + # ``` + # (name = "example-cluster-1") AND + # (createTime > "2021-04-12T08:15:10.40Z") OR + # (name = "example-cluster-2") + # ``` + # @param order_by [::String] + # Sorts list results by a certain order. By default, returned results are + # ordered by `name` in ascending order. You can also sort results in + # descending order based on the `name` value using `orderBy="name desc"`. + # Currently, only ordering by `name` is supported. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::VmwareEngine::V1::Cluster>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::VmwareEngine::V1::Cluster>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/vmware_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VmwareEngine::V1::ListClustersRequest.new + # + # # Call the list_clusters method. + # result = client.list_clusters 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::VmwareEngine::V1::Cluster. + # p item + # end + # + def list_clusters request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::ListClustersRequest + + # Converts hash 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_clusters.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::VmwareEngine::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_clusters.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_clusters.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vmware_engine_stub.list_clusters request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @vmware_engine_stub, :list_clusters, "clusters", 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 + + ## + # Retrieves a `Cluster` resource by its resource name. + # + # @overload get_cluster(request, options = nil) + # Pass arguments to `get_cluster` via a request object, either of type + # {::Google::Cloud::VmwareEngine::V1::GetClusterRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VmwareEngine::V1::GetClusterRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_cluster(name: nil) + # Pass arguments to `get_cluster` via keyword arguments. Note that at + # least one keyword argument is 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 cluster resource name to retrieve. + # Resource names are schemeless URIs that follow the conventions in + # https://cloud.google.com/apis/design/resource_names. + # For example: + # `projects/my-project/locations/us-central1-a/privateClouds/my-cloud/clusters/my-cluster` + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::VmwareEngine::V1::Cluster] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::VmwareEngine::V1::Cluster] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/vmware_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VmwareEngine::V1::GetClusterRequest.new + # + # # Call the get_cluster method. + # result = client.get_cluster request + # + # # The returned object is of type Google::Cloud::VmwareEngine::V1::Cluster. + # p result + # + def get_cluster request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::GetClusterRequest + + # Converts hash 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_cluster.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::VmwareEngine::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_cluster.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_cluster.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vmware_engine_stub.get_cluster 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 cluster in a given private cloud. + # Creating a new cluster provides additional nodes for + # use in the parent private cloud and requires sufficient [node + # quota](https://cloud.google.com/vmware-engine/quotas). + # + # @overload create_cluster(request, options = nil) + # Pass arguments to `create_cluster` via a request object, either of type + # {::Google::Cloud::VmwareEngine::V1::CreateClusterRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VmwareEngine::V1::CreateClusterRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_cluster(parent: nil, cluster_id: nil, cluster: nil, request_id: nil, validate_only: nil) + # Pass arguments to `create_cluster` via keyword arguments. Note that at + # least one keyword argument is 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 private cloud to create a new cluster + # in. Resource names are schemeless URIs that follow the conventions in + # https://cloud.google.com/apis/design/resource_names. + # For example: + # `projects/my-project/locations/us-central1-a/privateClouds/my-cloud` + # @param cluster_id [::String] + # Required. The user-provided identifier of the new `Cluster`. + # This identifier must be unique among clusters within the parent and becomes + # the final token in the name URI. + # The identifier must meet the following requirements: + # + # * Only contains 1-63 alphanumeric characters and hyphens + # * Begins with an alphabetical character + # * Ends with a non-hyphen character + # * Not formatted as a UUID + # * Complies with [RFC 1034](https://datatracker.ietf.org/doc/html/rfc1034) + # (section 3.5) + # @param cluster [::Google::Cloud::VmwareEngine::V1::Cluster, ::Hash] + # Required. The initial description of the new cluster. + # @param request_id [::String] + # Optional. The request ID must be a valid UUID with the exception that zero + # UUID is not supported (00000000-0000-0000-0000-000000000000). + # @param validate_only [::Boolean] + # Optional. True if you want the request to be validated and not executed; + # false otherwise. + # @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/vmware_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VmwareEngine::V1::CreateClusterRequest.new + # + # # Call the create_cluster method. + # result = client.create_cluster 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_cluster request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::CreateClusterRequest + + # Converts hash 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_cluster.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::VmwareEngine::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_cluster.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_cluster.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vmware_engine_stub.create_cluster 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 + + ## + # Modifies a `Cluster` resource. Only fields specified in `updateMask` are + # applied. + # + # During operation processing, the resource is temporarily in the `ACTIVE` + # state before the operation fully completes. For that period of time, you + # can't update the resource. Use the operation status to determine when the + # processing fully completes. + # + # @overload update_cluster(request, options = nil) + # Pass arguments to `update_cluster` via a request object, either of type + # {::Google::Cloud::VmwareEngine::V1::UpdateClusterRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VmwareEngine::V1::UpdateClusterRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_cluster(update_mask: nil, cluster: nil, request_id: nil, validate_only: nil) + # Pass arguments to `update_cluster` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. Field mask is used to specify the fields to be overwritten in the + # `Cluster` resource by the update. The fields specified in the `updateMask` + # are relative to the resource, not the full request. A field will be + # overwritten if it is in the mask. If the user does not provide a mask then + # all fields will be overwritten. + # @param cluster [::Google::Cloud::VmwareEngine::V1::Cluster, ::Hash] + # Required. The description of the cluster. + # @param request_id [::String] + # Optional. The request ID must be a valid UUID with the exception that + # zero UUID is not supported (00000000-0000-0000-0000-000000000000). + # @param validate_only [::Boolean] + # Optional. True if you want the request to be validated and not executed; + # false otherwise. + # @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/vmware_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VmwareEngine::V1::UpdateClusterRequest.new + # + # # Call the update_cluster method. + # result = client.update_cluster 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 update_cluster request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::UpdateClusterRequest + + # Converts hash 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_cluster.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::VmwareEngine::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_cluster.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_cluster.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vmware_engine_stub.update_cluster 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 `Cluster` resource. To avoid unintended data loss, migrate or + # gracefully shut down any workloads running on the cluster before deletion. + # You cannot delete the management cluster of a private cloud using this + # method. + # + # @overload delete_cluster(request, options = nil) + # Pass arguments to `delete_cluster` via a request object, either of type + # {::Google::Cloud::VmwareEngine::V1::DeleteClusterRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VmwareEngine::V1::DeleteClusterRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_cluster(name: nil, request_id: nil) + # Pass arguments to `delete_cluster` via keyword arguments. Note that at + # least one keyword argument is 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 cluster to delete. + # Resource names are schemeless URIs that follow the conventions in + # https://cloud.google.com/apis/design/resource_names. + # For example: + # `projects/my-project/locations/us-central1-a/privateClouds/my-cloud/clusters/my-cluster` + # @param request_id [::String] + # Optional. The request ID must be a valid UUID with the exception that zero + # UUID is not supported (00000000-0000-0000-0000-000000000000). + # @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/vmware_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VmwareEngine::V1::DeleteClusterRequest.new + # + # # Call the delete_cluster method. + # result = client.delete_cluster 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_cluster request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::DeleteClusterRequest + + # Converts hash 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_cluster.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::VmwareEngine::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_cluster.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_cluster.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vmware_engine_stub.delete_cluster 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 + + ## + # Lists nodes in a given cluster. + # + # @overload list_nodes(request, options = nil) + # Pass arguments to `list_nodes` via a request object, either of type + # {::Google::Cloud::VmwareEngine::V1::ListNodesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VmwareEngine::V1::ListNodesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_nodes(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_nodes` via keyword arguments. Note that at + # least one keyword argument is 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 cluster to be queried for nodes. + # Resource names are schemeless URIs that follow the conventions in + # https://cloud.google.com/apis/design/resource_names. + # For example: + # `projects/my-project/locations/us-central1-a/privateClouds/my-cloud/clusters/my-cluster` + # @param page_size [::Integer] + # The maximum number of nodes to return in one page. + # The service may return fewer than this value. + # The maximum value is coerced to 1000. + # The default value of this field is 500. + # @param page_token [::String] + # A page token, received from a previous `ListNodes` call. + # Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to + # `ListNodes` must match the call that provided the page + # token. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::VmwareEngine::V1::Node>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::VmwareEngine::V1::Node>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/vmware_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VmwareEngine::V1::ListNodesRequest.new + # + # # Call the list_nodes method. + # result = client.list_nodes 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::VmwareEngine::V1::Node. + # p item + # end + # + def list_nodes request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::ListNodesRequest + + # Converts hash 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_nodes.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::VmwareEngine::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_nodes.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_nodes.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vmware_engine_stub.list_nodes request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @vmware_engine_stub, :list_nodes, "nodes", 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 details of a single node. + # + # @overload get_node(request, options = nil) + # Pass arguments to `get_node` via a request object, either of type + # {::Google::Cloud::VmwareEngine::V1::GetNodeRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VmwareEngine::V1::GetNodeRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_node(name: nil) + # Pass arguments to `get_node` via keyword arguments. Note that at + # least one keyword argument is 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 node to retrieve. + # For example: + # `projects/{project}/locations/{location}/privateClouds/{private_cloud}/clusters/{cluster}/nodes/{node}` + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::VmwareEngine::V1::Node] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::VmwareEngine::V1::Node] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/vmware_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VmwareEngine::V1::GetNodeRequest.new + # + # # Call the get_node method. + # result = client.get_node request + # + # # The returned object is of type Google::Cloud::VmwareEngine::V1::Node. + # p result + # + def get_node request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::GetNodeRequest + + # Converts hash 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_node.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::VmwareEngine::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_node.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_node.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vmware_engine_stub.get_node 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 external IP addresses assigned to VMware workload VMs in a given + # private cloud. + # + # @overload list_external_addresses(request, options = nil) + # Pass arguments to `list_external_addresses` via a request object, either of type + # {::Google::Cloud::VmwareEngine::V1::ListExternalAddressesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VmwareEngine::V1::ListExternalAddressesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_external_addresses(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) + # Pass arguments to `list_external_addresses` via keyword arguments. Note that at + # least one keyword argument is 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 private cloud to be queried for + # external IP addresses. + # Resource names are schemeless URIs that follow the conventions in + # https://cloud.google.com/apis/design/resource_names. + # For example: + # `projects/my-project/locations/us-central1-a/privateClouds/my-cloud` + # @param page_size [::Integer] + # The maximum number of external IP addresses to return in one page. + # The service may return fewer than this value. + # The maximum value is coerced to 1000. + # The default value of this field is 500. + # @param page_token [::String] + # A page token, received from a previous `ListExternalAddresses` call. + # Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to + # `ListExternalAddresses` must match the call that provided the page token. + # @param filter [::String] + # A filter expression that matches resources returned in the response. + # The expression must specify the field name, a comparison + # operator, and the value that you want to use for filtering. The value + # must be a string, a number, or a boolean. The comparison operator + # must be `=`, `!=`, `>`, or `<`. + # + # For example, if you are filtering a list of IP addresses, you can + # exclude the ones named `example-ip` by specifying + # `name != "example-ip"`. + # + # To filter on multiple expressions, provide each separate expression within + # parentheses. For example: + # ``` + # (name = "example-ip") + # (createTime > "2021-04-12T08:15:10.40Z") + # ``` + # + # By default, each expression is an `AND` expression. However, you + # can include `AND` and `OR` expressions explicitly. + # For example: + # ``` + # (name = "example-ip-1") AND + # (createTime > "2021-04-12T08:15:10.40Z") OR + # (name = "example-ip-2") + # ``` + # @param order_by [::String] + # Sorts list results by a certain order. By default, returned results + # are ordered by `name` in ascending order. + # You can also sort results in descending order based on the `name` value + # using `orderBy="name desc"`. + # Currently, only ordering by `name` is supported. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::VmwareEngine::V1::ExternalAddress>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::VmwareEngine::V1::ExternalAddress>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/vmware_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VmwareEngine::V1::ListExternalAddressesRequest.new + # + # # Call the list_external_addresses method. + # result = client.list_external_addresses 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::VmwareEngine::V1::ExternalAddress. + # p item + # end + # + def list_external_addresses request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::ListExternalAddressesRequest + + # Converts hash 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_external_addresses.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::VmwareEngine::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_external_addresses.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_external_addresses.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vmware_engine_stub.list_external_addresses request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @vmware_engine_stub, :list_external_addresses, "external_addresses", 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 external IP addresses assigned to VMware workload VMs within the + # scope of the given network policy. + # + # @overload fetch_network_policy_external_addresses(request, options = nil) + # Pass arguments to `fetch_network_policy_external_addresses` via a request object, either of type + # {::Google::Cloud::VmwareEngine::V1::FetchNetworkPolicyExternalAddressesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VmwareEngine::V1::FetchNetworkPolicyExternalAddressesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload fetch_network_policy_external_addresses(network_policy: nil, page_size: nil, page_token: nil) + # Pass arguments to `fetch_network_policy_external_addresses` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param network_policy [::String] + # Required. The resource name of the network policy to query for assigned + # external IP addresses. Resource names are schemeless URIs that follow the + # conventions in https://cloud.google.com/apis/design/resource_names. For + # example: + # `projects/my-project/locations/us-central1/networkPolicies/my-policy` + # @param page_size [::Integer] + # The maximum number of external IP addresses to return in one page. + # The service may return fewer than this value. + # The maximum value is coerced to 1000. + # The default value of this field is 500. + # @param page_token [::String] + # A page token, received from a previous + # `FetchNetworkPolicyExternalAddresses` call. Provide this to retrieve the + # subsequent page. + # + # When paginating, all parameters provided to + # `FetchNetworkPolicyExternalAddresses`, except for `page_size` and + # `page_token`, must match the call that provided the page token. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::VmwareEngine::V1::ExternalAddress>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::VmwareEngine::V1::ExternalAddress>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/vmware_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VmwareEngine::V1::FetchNetworkPolicyExternalAddressesRequest.new + # + # # Call the fetch_network_policy_external_addresses method. + # result = client.fetch_network_policy_external_addresses 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::VmwareEngine::V1::ExternalAddress. + # p item + # end + # + def fetch_network_policy_external_addresses request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::FetchNetworkPolicyExternalAddressesRequest + + # Converts hash 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.fetch_network_policy_external_addresses.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::VmwareEngine::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.fetch_network_policy_external_addresses.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.fetch_network_policy_external_addresses.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vmware_engine_stub.fetch_network_policy_external_addresses request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @vmware_engine_stub, :fetch_network_policy_external_addresses, "external_addresses", 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 details of a single external IP address. + # + # @overload get_external_address(request, options = nil) + # Pass arguments to `get_external_address` via a request object, either of type + # {::Google::Cloud::VmwareEngine::V1::GetExternalAddressRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VmwareEngine::V1::GetExternalAddressRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_external_address(name: nil) + # Pass arguments to `get_external_address` via keyword arguments. Note that at + # least one keyword argument is 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 external IP address to retrieve. + # Resource names are schemeless URIs that follow the conventions in + # https://cloud.google.com/apis/design/resource_names. + # For example: + # `projects/my-project/locations/us-central1-a/privateClouds/my-cloud/externalAddresses/my-ip` + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::VmwareEngine::V1::ExternalAddress] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::VmwareEngine::V1::ExternalAddress] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/vmware_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VmwareEngine::V1::GetExternalAddressRequest.new + # + # # Call the get_external_address method. + # result = client.get_external_address request + # + # # The returned object is of type Google::Cloud::VmwareEngine::V1::ExternalAddress. + # p result + # + def get_external_address request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::GetExternalAddressRequest + + # Converts hash 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_external_address.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::VmwareEngine::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_external_address.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_external_address.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vmware_engine_stub.get_external_address 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 `ExternalAddress` resource in a given private cloud. The + # network policy that corresponds to the private cloud must have the external + # IP address network service enabled (`NetworkPolicy.external_ip`). + # + # @overload create_external_address(request, options = nil) + # Pass arguments to `create_external_address` via a request object, either of type + # {::Google::Cloud::VmwareEngine::V1::CreateExternalAddressRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VmwareEngine::V1::CreateExternalAddressRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_external_address(parent: nil, external_address: nil, external_address_id: nil, request_id: nil) + # Pass arguments to `create_external_address` via keyword arguments. Note that at + # least one keyword argument is 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 private cloud + # to create a new external IP address in. + # Resource names are schemeless URIs that follow the conventions in + # https://cloud.google.com/apis/design/resource_names. + # For example: + # `projects/my-project/locations/us-central1-a/privateClouds/my-cloud` + # @param external_address [::Google::Cloud::VmwareEngine::V1::ExternalAddress, ::Hash] + # Required. The initial description of a new external IP address. + # @param external_address_id [::String] + # Required. The user-provided identifier of the `ExternalAddress` to be + # created. This identifier must be unique among `ExternalAddress` resources + # within the parent and becomes the final token in the name URI. The + # identifier must meet the following requirements: + # + # * Only contains 1-63 alphanumeric characters and hyphens + # * Begins with an alphabetical character + # * Ends with a non-hyphen character + # * Not formatted as a UUID + # * Complies with [RFC 1034](https://datatracker.ietf.org/doc/html/rfc1034) + # (section 3.5) + # @param request_id [::String] + # Optional. A request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server guarantees that a + # request doesn't result in creation of duplicate commitments for at least 60 + # minutes. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request ID, + # the server can check if the original operation with the same request ID was + # received, and if so, will ignore the second request. This prevents clients + # from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @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/vmware_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VmwareEngine::V1::CreateExternalAddressRequest.new + # + # # Call the create_external_address method. + # result = client.create_external_address 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_external_address request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::CreateExternalAddressRequest + + # Converts hash 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_external_address.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::VmwareEngine::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_external_address.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_external_address.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vmware_engine_stub.create_external_address 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 + + ## + # Updates the parameters of a single external IP address. + # Only fields specified in `update_mask` are applied. + # + # During operation processing, the resource is temporarily in the `ACTIVE` + # state before the operation fully completes. For that period of time, you + # can't update the resource. Use the operation status to determine when the + # processing fully completes. + # + # @overload update_external_address(request, options = nil) + # Pass arguments to `update_external_address` via a request object, either of type + # {::Google::Cloud::VmwareEngine::V1::UpdateExternalAddressRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VmwareEngine::V1::UpdateExternalAddressRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_external_address(update_mask: nil, external_address: nil, request_id: nil) + # Pass arguments to `update_external_address` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. Field mask is used to specify the fields to be overwritten in the + # `ExternalAddress` resource by the update. + # The fields specified in the `update_mask` are relative to the resource, not + # the full request. A field will be overwritten if it is in the mask. If the + # user does not provide a mask then all fields will be overwritten. + # @param external_address [::Google::Cloud::VmwareEngine::V1::ExternalAddress, ::Hash] + # Required. External IP address description. + # @param request_id [::String] + # Optional. A request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server guarantees that a + # request doesn't result in creation of duplicate commitments for at least 60 + # minutes. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request ID, + # the server can check if the original operation with the same request ID was + # received, and if so, will ignore the second request. This prevents clients + # from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @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/vmware_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VmwareEngine::V1::UpdateExternalAddressRequest.new + # + # # Call the update_external_address method. + # result = client.update_external_address 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 update_external_address request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::UpdateExternalAddressRequest + + # Converts hash 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_external_address.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::VmwareEngine::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_external_address.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_external_address.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vmware_engine_stub.update_external_address 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 single external IP address. When you delete an external IP + # address, connectivity between the external IP address and the corresponding + # internal IP address is lost. + # + # @overload delete_external_address(request, options = nil) + # Pass arguments to `delete_external_address` via a request object, either of type + # {::Google::Cloud::VmwareEngine::V1::DeleteExternalAddressRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VmwareEngine::V1::DeleteExternalAddressRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_external_address(name: nil, request_id: nil) + # Pass arguments to `delete_external_address` via keyword arguments. Note that at + # least one keyword argument is 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 external IP address to delete. + # Resource names are schemeless URIs that follow the conventions in + # https://cloud.google.com/apis/design/resource_names. + # For example: + # `projects/my-project/locations/us-central1-a/privateClouds/my-cloud/externalAddresses/my-ip` + # @param request_id [::String] + # Optional. A request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server guarantees that a + # request doesn't result in creation of duplicate commitments for at least 60 + # minutes. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request + # ID, the server can check if the original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @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/vmware_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VmwareEngine::V1::DeleteExternalAddressRequest.new + # + # # Call the delete_external_address method. + # result = client.delete_external_address 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_external_address request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::DeleteExternalAddressRequest + + # Converts hash 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_external_address.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::VmwareEngine::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_external_address.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_external_address.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vmware_engine_stub.delete_external_address 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 + + ## + # Lists subnets in a given private cloud. + # + # @overload list_subnets(request, options = nil) + # Pass arguments to `list_subnets` via a request object, either of type + # {::Google::Cloud::VmwareEngine::V1::ListSubnetsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VmwareEngine::V1::ListSubnetsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_subnets(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_subnets` via keyword arguments. Note that at + # least one keyword argument is 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 private cloud to be queried for + # subnets. + # Resource names are schemeless URIs that follow the conventions in + # https://cloud.google.com/apis/design/resource_names. + # For example: + # `projects/my-project/locations/us-central1-a/privateClouds/my-cloud` + # @param page_size [::Integer] + # The maximum number of subnets to return in one page. + # The service may return fewer than this value. + # The maximum value is coerced to 1000. + # The default value of this field is 500. + # @param page_token [::String] + # A page token, received from a previous `ListSubnetsRequest` call. + # Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to + # `ListSubnetsRequest` must match the call that provided the page token. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::VmwareEngine::V1::Subnet>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::VmwareEngine::V1::Subnet>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/vmware_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VmwareEngine::V1::ListSubnetsRequest.new + # + # # Call the list_subnets method. + # result = client.list_subnets 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::VmwareEngine::V1::Subnet. + # p item + # end + # + def list_subnets request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::ListSubnetsRequest + + # Converts hash 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_subnets.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::VmwareEngine::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_subnets.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_subnets.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vmware_engine_stub.list_subnets request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @vmware_engine_stub, :list_subnets, "subnets", 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 details of a single subnet. + # + # @overload get_subnet(request, options = nil) + # Pass arguments to `get_subnet` via a request object, either of type + # {::Google::Cloud::VmwareEngine::V1::GetSubnetRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VmwareEngine::V1::GetSubnetRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_subnet(name: nil) + # Pass arguments to `get_subnet` via keyword arguments. Note that at + # least one keyword argument is 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 subnet to retrieve. + # Resource names are schemeless URIs that follow the conventions in + # https://cloud.google.com/apis/design/resource_names. + # For example: + # `projects/my-project/locations/us-central1-a/privateClouds/my-cloud/subnets/my-subnet` + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::VmwareEngine::V1::Subnet] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::VmwareEngine::V1::Subnet] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/vmware_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VmwareEngine::V1::GetSubnetRequest.new + # + # # Call the get_subnet method. + # result = client.get_subnet request + # + # # The returned object is of type Google::Cloud::VmwareEngine::V1::Subnet. + # p result + # + def get_subnet request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::GetSubnetRequest + + # Converts hash 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_subnet.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::VmwareEngine::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_subnet.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_subnet.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vmware_engine_stub.get_subnet 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 parameters of a single subnet. Only fields specified in + # `update_mask` are applied. + # + # *Note*: This API is synchronous and always returns a successful + # `google.longrunning.Operation` (LRO). The returned LRO will only have + # `done` and `response` fields. + # + # @overload update_subnet(request, options = nil) + # Pass arguments to `update_subnet` via a request object, either of type + # {::Google::Cloud::VmwareEngine::V1::UpdateSubnetRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VmwareEngine::V1::UpdateSubnetRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_subnet(update_mask: nil, subnet: nil) + # Pass arguments to `update_subnet` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. Field mask is used to specify the fields to be overwritten in the + # `Subnet` resource by the update. + # The fields specified in the `update_mask` are relative to the resource, not + # the full request. A field will be overwritten if it is in the mask. If the + # user does not provide a mask then all fields will be overwritten. + # @param subnet [::Google::Cloud::VmwareEngine::V1::Subnet, ::Hash] + # Required. Subnet description. + # @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/vmware_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VmwareEngine::V1::UpdateSubnetRequest.new + # + # # Call the update_subnet method. + # result = client.update_subnet 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 update_subnet request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::UpdateSubnetRequest + + # Converts hash 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_subnet.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::VmwareEngine::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_subnet.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_subnet.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vmware_engine_stub.update_subnet 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 + + ## + # Lists `ExternalAccessRule` resources in the specified network policy. + # + # @overload list_external_access_rules(request, options = nil) + # Pass arguments to `list_external_access_rules` via a request object, either of type + # {::Google::Cloud::VmwareEngine::V1::ListExternalAccessRulesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VmwareEngine::V1::ListExternalAccessRulesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_external_access_rules(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) + # Pass arguments to `list_external_access_rules` via keyword arguments. Note that at + # least one keyword argument is 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 network policy to query for external + # access firewall rules. Resource names are schemeless URIs that follow the + # conventions in https://cloud.google.com/apis/design/resource_names. For + # example: + # `projects/my-project/locations/us-central1/networkPolicies/my-policy` + # @param page_size [::Integer] + # The maximum number of external access rules to return in one page. + # The service may return fewer than this value. + # The maximum value is coerced to 1000. + # The default value of this field is 500. + # @param page_token [::String] + # A page token, received from a previous `ListExternalAccessRulesRequest` + # call. Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to + # `ListExternalAccessRulesRequest` must match the call that provided the page + # token. + # @param filter [::String] + # A filter expression that matches resources returned in the response. + # The expression must specify the field name, a comparison + # operator, and the value that you want to use for filtering. The value + # must be a string, a number, or a boolean. The comparison operator + # must be `=`, `!=`, `>`, or `<`. + # + # For example, if you are filtering a list of external access rules, you can + # exclude the ones named `example-rule` by specifying + # `name != "example-rule"`. + # + # To filter on multiple expressions, provide each separate expression within + # parentheses. For example: + # ``` + # (name = "example-rule") + # (createTime > "2021-04-12T08:15:10.40Z") + # ``` + # + # By default, each expression is an `AND` expression. However, you + # can include `AND` and `OR` expressions explicitly. + # For example: + # ``` + # (name = "example-rule-1") AND + # (createTime > "2021-04-12T08:15:10.40Z") OR + # (name = "example-rule-2") + # ``` + # @param order_by [::String] + # Sorts list results by a certain order. By default, returned results + # are ordered by `name` in ascending order. + # You can also sort results in descending order based on the `name` value + # using `orderBy="name desc"`. + # Currently, only ordering by `name` is supported. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::VmwareEngine::V1::ExternalAccessRule>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::VmwareEngine::V1::ExternalAccessRule>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/vmware_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VmwareEngine::V1::ListExternalAccessRulesRequest.new + # + # # Call the list_external_access_rules method. + # result = client.list_external_access_rules 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::VmwareEngine::V1::ExternalAccessRule. + # p item + # end + # + def list_external_access_rules request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::ListExternalAccessRulesRequest + + # Converts hash 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_external_access_rules.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::VmwareEngine::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_external_access_rules.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_external_access_rules.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vmware_engine_stub.list_external_access_rules request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @vmware_engine_stub, :list_external_access_rules, "external_access_rules", 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 details of a single external access rule. + # + # @overload get_external_access_rule(request, options = nil) + # Pass arguments to `get_external_access_rule` via a request object, either of type + # {::Google::Cloud::VmwareEngine::V1::GetExternalAccessRuleRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VmwareEngine::V1::GetExternalAccessRuleRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_external_access_rule(name: nil) + # Pass arguments to `get_external_access_rule` via keyword arguments. Note that at + # least one keyword argument is 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 external access firewall rule to + # retrieve. Resource names are schemeless URIs that follow the conventions in + # https://cloud.google.com/apis/design/resource_names. + # For example: + # `projects/my-project/locations/us-central1/networkPolicies/my-policy/externalAccessRules/my-rule` + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::VmwareEngine::V1::ExternalAccessRule] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::VmwareEngine::V1::ExternalAccessRule] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/vmware_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VmwareEngine::V1::GetExternalAccessRuleRequest.new + # + # # Call the get_external_access_rule method. + # result = client.get_external_access_rule request + # + # # The returned object is of type Google::Cloud::VmwareEngine::V1::ExternalAccessRule. + # p result + # + def get_external_access_rule request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::GetExternalAccessRuleRequest + + # Converts hash 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_external_access_rule.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::VmwareEngine::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_external_access_rule.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_external_access_rule.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vmware_engine_stub.get_external_access_rule 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 external access rule in a given network policy. + # + # @overload create_external_access_rule(request, options = nil) + # Pass arguments to `create_external_access_rule` via a request object, either of type + # {::Google::Cloud::VmwareEngine::V1::CreateExternalAccessRuleRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VmwareEngine::V1::CreateExternalAccessRuleRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_external_access_rule(parent: nil, external_access_rule: nil, external_access_rule_id: nil, request_id: nil) + # Pass arguments to `create_external_access_rule` via keyword arguments. Note that at + # least one keyword argument is 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 network policy + # to create a new external access firewall rule in. + # Resource names are schemeless URIs that follow the conventions in + # https://cloud.google.com/apis/design/resource_names. + # For example: + # `projects/my-project/locations/us-central1/networkPolicies/my-policy` + # @param external_access_rule [::Google::Cloud::VmwareEngine::V1::ExternalAccessRule, ::Hash] + # Required. The initial description of a new external access rule. + # @param external_access_rule_id [::String] + # Required. The user-provided identifier of the `ExternalAccessRule` to be + # created. This identifier must be unique among `ExternalAccessRule` + # resources within the parent and becomes the final token in the name URI. + # The identifier must meet the following requirements: + # + # * Only contains 1-63 alphanumeric characters and hyphens + # * Begins with an alphabetical character + # * Ends with a non-hyphen character + # * Not formatted as a UUID + # * Complies with [RFC 1034](https://datatracker.ietf.org/doc/html/rfc1034) + # (section 3.5) + # @param request_id [::String] + # A request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server guarantees that a + # request doesn't result in creation of duplicate commitments for at least 60 + # minutes. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request ID, + # the server can check if the original operation with the same request ID was + # received, and if so, will ignore the second request. This prevents clients + # from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @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/vmware_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VmwareEngine::V1::CreateExternalAccessRuleRequest.new + # + # # Call the create_external_access_rule method. + # result = client.create_external_access_rule 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_external_access_rule request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::CreateExternalAccessRuleRequest + + # Converts hash 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_external_access_rule.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::VmwareEngine::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_external_access_rule.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_external_access_rule.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vmware_engine_stub.create_external_access_rule 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 + + ## + # Updates the parameters of a single external access rule. + # Only fields specified in `update_mask` are applied. + # + # @overload update_external_access_rule(request, options = nil) + # Pass arguments to `update_external_access_rule` via a request object, either of type + # {::Google::Cloud::VmwareEngine::V1::UpdateExternalAccessRuleRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VmwareEngine::V1::UpdateExternalAccessRuleRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_external_access_rule(update_mask: nil, external_access_rule: nil, request_id: nil) + # Pass arguments to `update_external_access_rule` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. Field mask is used to specify the fields to be overwritten in the + # `ExternalAccessRule` resource by the update. + # The fields specified in the `update_mask` are relative to the resource, not + # the full request. A field will be overwritten if it is in the mask. If the + # user does not provide a mask then all fields will be overwritten. + # @param external_access_rule [::Google::Cloud::VmwareEngine::V1::ExternalAccessRule, ::Hash] + # Required. Description of the external access rule. + # @param request_id [::String] + # Optional. A request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server guarantees that a + # request doesn't result in creation of duplicate commitments for at least 60 + # minutes. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request ID, + # the server can check if the original operation with the same request ID was + # received, and if so, will ignore the second request. This prevents clients + # from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @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/vmware_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VmwareEngine::V1::UpdateExternalAccessRuleRequest.new + # + # # Call the update_external_access_rule method. + # result = client.update_external_access_rule 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 update_external_access_rule request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::UpdateExternalAccessRuleRequest + + # Converts hash 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_external_access_rule.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::VmwareEngine::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_external_access_rule.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_external_access_rule.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vmware_engine_stub.update_external_access_rule 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 single external access rule. + # + # @overload delete_external_access_rule(request, options = nil) + # Pass arguments to `delete_external_access_rule` via a request object, either of type + # {::Google::Cloud::VmwareEngine::V1::DeleteExternalAccessRuleRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VmwareEngine::V1::DeleteExternalAccessRuleRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_external_access_rule(name: nil, request_id: nil) + # Pass arguments to `delete_external_access_rule` via keyword arguments. Note that at + # least one keyword argument is 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 external access firewall rule to delete. + # Resource names are schemeless URIs that follow the conventions in + # https://cloud.google.com/apis/design/resource_names. + # For example: + # `projects/my-project/locations/us-central1/networkPolicies/my-policy/externalAccessRules/my-rule` + # @param request_id [::String] + # Optional. A request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server guarantees that a + # request doesn't result in creation of duplicate commitments for at least 60 + # minutes. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request + # ID, the server can check if the original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @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/vmware_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VmwareEngine::V1::DeleteExternalAccessRuleRequest.new + # + # # Call the delete_external_access_rule method. + # result = client.delete_external_access_rule 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_external_access_rule request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::DeleteExternalAccessRuleRequest + + # Converts hash 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_external_access_rule.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::VmwareEngine::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_external_access_rule.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_external_access_rule.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vmware_engine_stub.delete_external_access_rule 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 + + ## + # Lists logging servers configured for a given private + # cloud. + # + # @overload list_logging_servers(request, options = nil) + # Pass arguments to `list_logging_servers` via a request object, either of type + # {::Google::Cloud::VmwareEngine::V1::ListLoggingServersRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VmwareEngine::V1::ListLoggingServersRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_logging_servers(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) + # Pass arguments to `list_logging_servers` via keyword arguments. Note that at + # least one keyword argument is 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 private cloud to be queried for + # logging servers. + # Resource names are schemeless URIs that follow the conventions in + # https://cloud.google.com/apis/design/resource_names. + # For example: + # `projects/my-project/locations/us-central1-a/privateClouds/my-cloud` + # @param page_size [::Integer] + # The maximum number of logging servers to return in one page. + # The service may return fewer than this value. + # The maximum value is coerced to 1000. + # The default value of this field is 500. + # @param page_token [::String] + # A page token, received from a previous `ListLoggingServersRequest` call. + # Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to + # `ListLoggingServersRequest` must match the call that provided the page + # token. + # @param filter [::String] + # A filter expression that matches resources returned in the response. + # The expression must specify the field name, a comparison + # operator, and the value that you want to use for filtering. The value + # must be a string, a number, or a boolean. The comparison operator + # must be `=`, `!=`, `>`, or `<`. + # + # For example, if you are filtering a list of logging servers, you can + # exclude the ones named `example-server` by specifying + # `name != "example-server"`. + # + # To filter on multiple expressions, provide each separate expression within + # parentheses. For example: + # ``` + # (name = "example-server") + # (createTime > "2021-04-12T08:15:10.40Z") + # ``` + # + # By default, each expression is an `AND` expression. However, you + # can include `AND` and `OR` expressions explicitly. + # For example: + # ``` + # (name = "example-server-1") AND + # (createTime > "2021-04-12T08:15:10.40Z") OR + # (name = "example-server-2") + # ``` + # @param order_by [::String] + # Sorts list results by a certain order. By default, returned results + # are ordered by `name` in ascending order. + # You can also sort results in descending order based on the `name` value + # using `orderBy="name desc"`. + # Currently, only ordering by `name` is supported. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::VmwareEngine::V1::LoggingServer>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::VmwareEngine::V1::LoggingServer>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/vmware_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VmwareEngine::V1::ListLoggingServersRequest.new + # + # # Call the list_logging_servers method. + # result = client.list_logging_servers 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::VmwareEngine::V1::LoggingServer. + # p item + # end + # + def list_logging_servers request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::ListLoggingServersRequest + + # Converts hash 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_logging_servers.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::VmwareEngine::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_logging_servers.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_logging_servers.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vmware_engine_stub.list_logging_servers request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @vmware_engine_stub, :list_logging_servers, "logging_servers", 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 details of a logging server. + # + # @overload get_logging_server(request, options = nil) + # Pass arguments to `get_logging_server` via a request object, either of type + # {::Google::Cloud::VmwareEngine::V1::GetLoggingServerRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VmwareEngine::V1::GetLoggingServerRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_logging_server(name: nil) + # Pass arguments to `get_logging_server` via keyword arguments. Note that at + # least one keyword argument is 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 Logging Server to retrieve. + # Resource names are schemeless URIs that follow the conventions in + # https://cloud.google.com/apis/design/resource_names. + # For example: + # `projects/my-project/locations/us-central1-a/privateClouds/my-cloud/loggingServers/my-logging-server` + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::VmwareEngine::V1::LoggingServer] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::VmwareEngine::V1::LoggingServer] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/vmware_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VmwareEngine::V1::GetLoggingServerRequest.new + # + # # Call the get_logging_server method. + # result = client.get_logging_server request + # + # # The returned object is of type Google::Cloud::VmwareEngine::V1::LoggingServer. + # p result + # + def get_logging_server request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::GetLoggingServerRequest + + # Converts hash 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_logging_server.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::VmwareEngine::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_logging_server.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_logging_server.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vmware_engine_stub.get_logging_server 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 logging server for a given private cloud. + # + # @overload create_logging_server(request, options = nil) + # Pass arguments to `create_logging_server` via a request object, either of type + # {::Google::Cloud::VmwareEngine::V1::CreateLoggingServerRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VmwareEngine::V1::CreateLoggingServerRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_logging_server(parent: nil, logging_server: nil, logging_server_id: nil, request_id: nil) + # Pass arguments to `create_logging_server` via keyword arguments. Note that at + # least one keyword argument is 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 private cloud + # to create a new Logging Server in. + # Resource names are schemeless URIs that follow the conventions in + # https://cloud.google.com/apis/design/resource_names. + # For example: + # `projects/my-project/locations/us-central1-a/privateClouds/my-cloud` + # @param logging_server [::Google::Cloud::VmwareEngine::V1::LoggingServer, ::Hash] + # Required. The initial description of a new logging server. + # @param logging_server_id [::String] + # Required. The user-provided identifier of the `LoggingServer` to be + # created. This identifier must be unique among `LoggingServer` resources + # within the parent and becomes the final token in the name URI. + # The identifier must meet the following requirements: + # + # * Only contains 1-63 alphanumeric characters and hyphens + # * Begins with an alphabetical character + # * Ends with a non-hyphen character + # * Not formatted as a UUID + # * Complies with [RFC 1034](https://datatracker.ietf.org/doc/html/rfc1034) + # (section 3.5) + # @param request_id [::String] + # Optional. A request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server guarantees that a + # request doesn't result in creation of duplicate commitments for at least 60 + # minutes. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request ID, + # the server can check if original operation with the same request ID was + # received, and if so, will ignore the second request. This prevents clients + # from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @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/vmware_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VmwareEngine::V1::CreateLoggingServerRequest.new + # + # # Call the create_logging_server method. + # result = client.create_logging_server 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_logging_server request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::CreateLoggingServerRequest + + # Converts hash 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_logging_server.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::VmwareEngine::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_logging_server.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_logging_server.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vmware_engine_stub.create_logging_server 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 + + ## + # Updates the parameters of a single logging server. + # Only fields specified in `update_mask` are applied. + # + # @overload update_logging_server(request, options = nil) + # Pass arguments to `update_logging_server` via a request object, either of type + # {::Google::Cloud::VmwareEngine::V1::UpdateLoggingServerRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VmwareEngine::V1::UpdateLoggingServerRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_logging_server(update_mask: nil, logging_server: nil, request_id: nil) + # Pass arguments to `update_logging_server` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. Field mask is used to specify the fields to be overwritten in the + # `LoggingServer` resource by the update. + # The fields specified in the `update_mask` are relative to the resource, not + # the full request. A field will be overwritten if it is in the mask. If the + # user does not provide a mask then all fields will be overwritten. + # @param logging_server [::Google::Cloud::VmwareEngine::V1::LoggingServer, ::Hash] + # Required. Logging server description. + # @param request_id [::String] + # Optional. A request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server guarantees that a + # request doesn't result in creation of duplicate commitments for at least 60 + # minutes. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request ID, + # the server can check if original operation with the same request ID was + # received, and if so, will ignore the second request. This prevents clients + # from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @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/vmware_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VmwareEngine::V1::UpdateLoggingServerRequest.new + # + # # Call the update_logging_server method. + # result = client.update_logging_server 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 update_logging_server request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::UpdateLoggingServerRequest + + # Converts hash 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_logging_server.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::VmwareEngine::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_logging_server.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_logging_server.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vmware_engine_stub.update_logging_server 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 single logging server. + # + # @overload delete_logging_server(request, options = nil) + # Pass arguments to `delete_logging_server` via a request object, either of type + # {::Google::Cloud::VmwareEngine::V1::DeleteLoggingServerRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VmwareEngine::V1::DeleteLoggingServerRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_logging_server(name: nil, request_id: nil) + # Pass arguments to `delete_logging_server` via keyword arguments. Note that at + # least one keyword argument is 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 logging server to delete. + # Resource names are schemeless URIs that follow the conventions in + # https://cloud.google.com/apis/design/resource_names. + # For example: + # `projects/my-project/locations/us-central1-a/privateClouds/my-cloud/loggingServers/my-logging-server` + # @param request_id [::String] + # Optional. A request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server guarantees that a + # request doesn't result in creation of duplicate commitments for at least 60 + # minutes. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @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/vmware_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VmwareEngine::V1::DeleteLoggingServerRequest.new + # + # # Call the delete_logging_server method. + # result = client.delete_logging_server 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_logging_server request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::DeleteLoggingServerRequest + + # Converts hash 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_logging_server.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::VmwareEngine::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_logging_server.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_logging_server.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vmware_engine_stub.delete_logging_server 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 + + ## + # Lists node types + # + # @overload list_node_types(request, options = nil) + # Pass arguments to `list_node_types` via a request object, either of type + # {::Google::Cloud::VmwareEngine::V1::ListNodeTypesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VmwareEngine::V1::ListNodeTypesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_node_types(parent: nil, page_size: nil, page_token: nil, filter: nil) + # Pass arguments to `list_node_types` via keyword arguments. Note that at + # least one keyword argument is 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 to be queried for node types. + # Resource names are schemeless URIs that follow the conventions in + # https://cloud.google.com/apis/design/resource_names. + # For example: + # `projects/my-project/locations/us-central1-a` + # @param page_size [::Integer] + # The maximum number of node types to return in one page. + # The service may return fewer than this value. + # The maximum value is coerced to 1000. + # The default value of this field is 500. + # @param page_token [::String] + # A page token, received from a previous `ListNodeTypes` call. + # Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to + # `ListNodeTypes` must match the call that provided the page token. + # @param filter [::String] + # A filter expression that matches resources returned in the response. + # The expression must specify the field name, a comparison + # operator, and the value that you want to use for filtering. The value + # must be a string, a number, or a boolean. The comparison operator + # must be `=`, `!=`, `>`, or `<`. + # + # For example, if you are filtering a list of node types, you can + # exclude the ones named `standard-72` by specifying + # `name != "standard-72"`. + # + # To filter on multiple expressions, provide each separate expression within + # parentheses. For example: + # ``` + # (name = "standard-72") + # (virtual_cpu_count > 2) + # ``` + # + # By default, each expression is an `AND` expression. However, you + # can include `AND` and `OR` expressions explicitly. + # For example: + # ``` + # (name = "standard-96") AND + # (virtual_cpu_count > 2) OR + # (name = "standard-72") + # ``` + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::VmwareEngine::V1::NodeType>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::VmwareEngine::V1::NodeType>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/vmware_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VmwareEngine::V1::ListNodeTypesRequest.new + # + # # Call the list_node_types method. + # result = client.list_node_types 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::VmwareEngine::V1::NodeType. + # p item + # end + # + def list_node_types request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::ListNodeTypesRequest + + # Converts hash 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_node_types.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::VmwareEngine::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_node_types.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_node_types.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vmware_engine_stub.list_node_types request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @vmware_engine_stub, :list_node_types, "node_types", 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 details of a single `NodeType`. + # + # @overload get_node_type(request, options = nil) + # Pass arguments to `get_node_type` via a request object, either of type + # {::Google::Cloud::VmwareEngine::V1::GetNodeTypeRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VmwareEngine::V1::GetNodeTypeRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_node_type(name: nil) + # Pass arguments to `get_node_type` via keyword arguments. Note that at + # least one keyword argument is 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 node type to retrieve. + # Resource names are schemeless URIs that follow the conventions in + # https://cloud.google.com/apis/design/resource_names. + # For example: + # `projects/my-proj/locations/us-central1-a/nodeTypes/standard-72` + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::VmwareEngine::V1::NodeType] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::VmwareEngine::V1::NodeType] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/vmware_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VmwareEngine::V1::GetNodeTypeRequest.new + # + # # Call the get_node_type method. + # result = client.get_node_type request + # + # # The returned object is of type Google::Cloud::VmwareEngine::V1::NodeType. + # p result + # + def get_node_type request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::GetNodeTypeRequest + + # Converts hash 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_node_type.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::VmwareEngine::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_node_type.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_node_type.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vmware_engine_stub.get_node_type 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 + + ## + # Gets details of credentials for NSX appliance. + # + # @overload show_nsx_credentials(request, options = nil) + # Pass arguments to `show_nsx_credentials` via a request object, either of type + # {::Google::Cloud::VmwareEngine::V1::ShowNsxCredentialsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VmwareEngine::V1::ShowNsxCredentialsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_nsx_credentials(private_cloud: nil) + # Pass arguments to `show_nsx_credentials` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param private_cloud [::String] + # Required. The resource name of the private cloud + # to be queried for credentials. + # Resource names are schemeless URIs that follow the conventions in + # https://cloud.google.com/apis/design/resource_names. + # For example: + # `projects/my-project/locations/us-central1-a/privateClouds/my-cloud` + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::VmwareEngine::V1::Credentials] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::VmwareEngine::V1::Credentials] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/vmware_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VmwareEngine::V1::ShowNsxCredentialsRequest.new + # + # # Call the show_nsx_credentials method. + # result = client.show_nsx_credentials request + # + # # The returned object is of type Google::Cloud::VmwareEngine::V1::Credentials. + # p result + # + def show_nsx_credentials request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::ShowNsxCredentialsRequest + + # Converts hash 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_nsx_credentials.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::VmwareEngine::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_nsx_credentials.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.show_nsx_credentials.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vmware_engine_stub.show_nsx_credentials 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 + + ## + # Gets details of credentials for Vcenter appliance. + # + # @overload show_vcenter_credentials(request, options = nil) + # Pass arguments to `show_vcenter_credentials` via a request object, either of type + # {::Google::Cloud::VmwareEngine::V1::ShowVcenterCredentialsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VmwareEngine::V1::ShowVcenterCredentialsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_vcenter_credentials(private_cloud: nil, username: nil) + # Pass arguments to `show_vcenter_credentials` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param private_cloud [::String] + # Required. The resource name of the private cloud + # to be queried for credentials. + # Resource names are schemeless URIs that follow the conventions in + # https://cloud.google.com/apis/design/resource_names. + # For example: + # `projects/my-project/locations/us-central1-a/privateClouds/my-cloud` + # @param username [::String] + # Optional. The username of the user to be queried for credentials. + # The default value of this field is CloudOwner@gve.local. + # The provided value must be one of the following: + # CloudOwner@gve.local, + # solution-user-01@gve.local, + # solution-user-02@gve.local, + # solution-user-03@gve.local, + # solution-user-04@gve.local, + # solution-user-05@gve.local, + # zertoadmin@gve.local. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::VmwareEngine::V1::Credentials] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::VmwareEngine::V1::Credentials] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/vmware_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VmwareEngine::V1::ShowVcenterCredentialsRequest.new + # + # # Call the show_vcenter_credentials method. + # result = client.show_vcenter_credentials request + # + # # The returned object is of type Google::Cloud::VmwareEngine::V1::Credentials. + # p result + # + def show_vcenter_credentials request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::ShowVcenterCredentialsRequest + + # Converts hash 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_vcenter_credentials.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::VmwareEngine::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_vcenter_credentials.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.show_vcenter_credentials.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vmware_engine_stub.show_vcenter_credentials 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 + + ## + # Resets credentials of the NSX appliance. + # + # @overload reset_nsx_credentials(request, options = nil) + # Pass arguments to `reset_nsx_credentials` via a request object, either of type + # {::Google::Cloud::VmwareEngine::V1::ResetNsxCredentialsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VmwareEngine::V1::ResetNsxCredentialsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload reset_nsx_credentials(private_cloud: nil, request_id: nil) + # Pass arguments to `reset_nsx_credentials` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param private_cloud [::String] + # Required. The resource name of the private cloud + # to reset credentials for. + # Resource names are schemeless URIs that follow the conventions in + # https://cloud.google.com/apis/design/resource_names. + # For example: + # `projects/my-project/locations/us-central1-a/privateClouds/my-cloud` + # @param request_id [::String] + # Optional. A request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server guarantees that a + # request doesn't result in creation of duplicate commitments for at least 60 + # minutes. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @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/vmware_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VmwareEngine::V1::ResetNsxCredentialsRequest.new + # + # # Call the reset_nsx_credentials method. + # result = client.reset_nsx_credentials 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 reset_nsx_credentials request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::ResetNsxCredentialsRequest + + # Converts hash 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.reset_nsx_credentials.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::VmwareEngine::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.reset_nsx_credentials.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.reset_nsx_credentials.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vmware_engine_stub.reset_nsx_credentials 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 + + ## + # Resets credentials of the Vcenter appliance. + # + # @overload reset_vcenter_credentials(request, options = nil) + # Pass arguments to `reset_vcenter_credentials` via a request object, either of type + # {::Google::Cloud::VmwareEngine::V1::ResetVcenterCredentialsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VmwareEngine::V1::ResetVcenterCredentialsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload reset_vcenter_credentials(private_cloud: nil, request_id: nil, username: nil) + # Pass arguments to `reset_vcenter_credentials` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param private_cloud [::String] + # Required. The resource name of the private cloud + # to reset credentials for. + # Resource names are schemeless URIs that follow the conventions in + # https://cloud.google.com/apis/design/resource_names. + # For example: + # `projects/my-project/locations/us-central1-a/privateClouds/my-cloud` + # @param request_id [::String] + # Optional. A request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server guarantees that a + # request doesn't result in creation of duplicate commitments for at least 60 + # minutes. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @param username [::String] + # Optional. The username of the user to be to reset the credentials. + # The default value of this field is CloudOwner@gve.local. + # The provided value should be one of the following: + # solution-user-01@gve.local, + # solution-user-02@gve.local, + # solution-user-03@gve.local, + # solution-user-04@gve.local, + # solution-user-05@gve.local, + # zertoadmin@gve.local. + # @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/vmware_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VmwareEngine::V1::ResetVcenterCredentialsRequest.new + # + # # Call the reset_vcenter_credentials method. + # result = client.reset_vcenter_credentials 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 reset_vcenter_credentials request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::ResetVcenterCredentialsRequest + + # Converts hash 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.reset_vcenter_credentials.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::VmwareEngine::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.reset_vcenter_credentials.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.reset_vcenter_credentials.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vmware_engine_stub.reset_vcenter_credentials 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 + + ## + # Gets details of the `DnsForwarding` config. + # + # @overload get_dns_forwarding(request, options = nil) + # Pass arguments to `get_dns_forwarding` via a request object, either of type + # {::Google::Cloud::VmwareEngine::V1::GetDnsForwardingRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VmwareEngine::V1::GetDnsForwardingRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_dns_forwarding(name: nil) + # Pass arguments to `get_dns_forwarding` via keyword arguments. Note that at + # least one keyword argument is 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 a `DnsForwarding` to retrieve. + # Resource names are schemeless URIs that follow the conventions in + # https://cloud.google.com/apis/design/resource_names. + # For example: + # `projects/my-project/locations/us-central1-a/privateClouds/my-cloud/dnsForwarding` + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::VmwareEngine::V1::DnsForwarding] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::VmwareEngine::V1::DnsForwarding] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/vmware_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VmwareEngine::V1::GetDnsForwardingRequest.new + # + # # Call the get_dns_forwarding method. + # result = client.get_dns_forwarding request + # + # # The returned object is of type Google::Cloud::VmwareEngine::V1::DnsForwarding. + # p result + # + def get_dns_forwarding request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::GetDnsForwardingRequest + + # Converts hash 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_dns_forwarding.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::VmwareEngine::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_dns_forwarding.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_dns_forwarding.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vmware_engine_stub.get_dns_forwarding 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 parameters of the `DnsForwarding` config, like associated + # domains. Only fields specified in `update_mask` are applied. + # + # @overload update_dns_forwarding(request, options = nil) + # Pass arguments to `update_dns_forwarding` via a request object, either of type + # {::Google::Cloud::VmwareEngine::V1::UpdateDnsForwardingRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VmwareEngine::V1::UpdateDnsForwardingRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_dns_forwarding(dns_forwarding: nil, update_mask: nil, request_id: nil) + # Pass arguments to `update_dns_forwarding` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param dns_forwarding [::Google::Cloud::VmwareEngine::V1::DnsForwarding, ::Hash] + # Required. DnsForwarding config details. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. Field mask is used to specify the fields to be overwritten in the + # `DnsForwarding` resource by the update. + # The fields specified in the `update_mask` are relative to the resource, not + # the full request. A field will be overwritten if it is in the mask. If the + # user does not provide a mask then all fields will be overwritten. + # @param request_id [::String] + # Optional. A request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server guarantees that a + # request doesn't result in creation of duplicate commitments for at least 60 + # minutes. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request ID, + # the server can check if original operation with the same request ID was + # received, and if so, will ignore the second request. This prevents clients + # from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @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/vmware_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VmwareEngine::V1::UpdateDnsForwardingRequest.new + # + # # Call the update_dns_forwarding method. + # result = client.update_dns_forwarding 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 update_dns_forwarding request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::UpdateDnsForwardingRequest + + # Converts hash 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_dns_forwarding.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::VmwareEngine::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_dns_forwarding.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_dns_forwarding.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vmware_engine_stub.update_dns_forwarding 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 + + ## + # Retrieves a `NetworkPeering` resource by its resource name. The resource + # contains details of the network peering, such as peered + # networks, import and export custom route configurations, and peering state. + # NetworkPeering is a global resource and location can only be global. + # + # @overload get_network_peering(request, options = nil) + # Pass arguments to `get_network_peering` via a request object, either of type + # {::Google::Cloud::VmwareEngine::V1::GetNetworkPeeringRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VmwareEngine::V1::GetNetworkPeeringRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_network_peering(name: nil) + # Pass arguments to `get_network_peering` via keyword arguments. Note that at + # least one keyword argument is 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 network peering to retrieve. + # Resource names are schemeless URIs that follow the conventions in + # https://cloud.google.com/apis/design/resource_names. + # For example: + # `projects/my-project/locations/global/networkPeerings/my-peering` + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::VmwareEngine::V1::NetworkPeering] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::VmwareEngine::V1::NetworkPeering] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/vmware_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VmwareEngine::V1::GetNetworkPeeringRequest.new + # + # # Call the get_network_peering method. + # result = client.get_network_peering request + # + # # The returned object is of type Google::Cloud::VmwareEngine::V1::NetworkPeering. + # p result + # + def get_network_peering request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::GetNetworkPeeringRequest + + # Converts hash 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_network_peering.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::VmwareEngine::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_network_peering.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_network_peering.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vmware_engine_stub.get_network_peering 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 `NetworkPeering` resources in a given project. NetworkPeering is a + # global resource and location can only be global. + # + # @overload list_network_peerings(request, options = nil) + # Pass arguments to `list_network_peerings` via a request object, either of type + # {::Google::Cloud::VmwareEngine::V1::ListNetworkPeeringsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VmwareEngine::V1::ListNetworkPeeringsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_network_peerings(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) + # Pass arguments to `list_network_peerings` via keyword arguments. Note that at + # least one keyword argument is 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 (global) to query for + # network peerings. Resource names are schemeless URIs that follow the + # conventions in https://cloud.google.com/apis/design/resource_names. For + # example: `projects/my-project/locations/global` + # @param page_size [::Integer] + # The maximum number of network peerings to return in one page. + # The maximum value is coerced to 1000. + # The default value of this field is 500. + # @param page_token [::String] + # A page token, received from a previous `ListNetworkPeerings` call. + # Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to + # `ListNetworkPeerings` must match the call that provided the page + # token. + # @param filter [::String] + # A filter expression that matches resources returned in the response. + # The expression must specify the field name, a comparison + # operator, and the value that you want to use for filtering. The value + # must be a string, a number, or a boolean. The comparison operator + # must be `=`, `!=`, `>`, or `<`. + # + # For example, if you are filtering a list of network peerings, you can + # exclude the ones named `example-peering` by specifying + # `name != "example-peering"`. + # + # To filter on multiple expressions, provide each separate expression within + # parentheses. For example: + # ``` + # (name = "example-peering") + # (createTime > "2021-04-12T08:15:10.40Z") + # ``` + # + # By default, each expression is an `AND` expression. However, you + # can include `AND` and `OR` expressions explicitly. + # For example: + # ``` + # (name = "example-peering-1") AND + # (createTime > "2021-04-12T08:15:10.40Z") OR + # (name = "example-peering-2") + # ``` + # @param order_by [::String] + # Sorts list results by a certain order. By default, returned results + # are ordered by `name` in ascending order. + # You can also sort results in descending order based on the `name` value + # using `orderBy="name desc"`. + # Currently, only ordering by `name` is supported. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::VmwareEngine::V1::NetworkPeering>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::VmwareEngine::V1::NetworkPeering>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/vmware_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VmwareEngine::V1::ListNetworkPeeringsRequest.new + # + # # Call the list_network_peerings method. + # result = client.list_network_peerings 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::VmwareEngine::V1::NetworkPeering. + # p item + # end + # + def list_network_peerings request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::ListNetworkPeeringsRequest + + # Converts hash 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_network_peerings.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::VmwareEngine::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_network_peerings.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_network_peerings.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vmware_engine_stub.list_network_peerings request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @vmware_engine_stub, :list_network_peerings, "network_peerings", 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 + + ## + # Creates a new network peering between the peer network and VMware Engine + # network provided in a `NetworkPeering` resource. NetworkPeering is a + # global resource and location can only be global. + # + # @overload create_network_peering(request, options = nil) + # Pass arguments to `create_network_peering` via a request object, either of type + # {::Google::Cloud::VmwareEngine::V1::CreateNetworkPeeringRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VmwareEngine::V1::CreateNetworkPeeringRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_network_peering(parent: nil, network_peering_id: nil, network_peering: nil, request_id: nil) + # Pass arguments to `create_network_peering` via keyword arguments. Note that at + # least one keyword argument is 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 to create the new network + # peering in. This value is always `global`, because `NetworkPeering` is a + # global resource. Resource names are schemeless URIs that follow the + # conventions in https://cloud.google.com/apis/design/resource_names. For + # example: `projects/my-project/locations/global` + # @param network_peering_id [::String] + # Required. The user-provided identifier of the new `NetworkPeering`. + # This identifier must be unique among `NetworkPeering` resources within the + # parent and becomes the final token in the name URI. + # The identifier must meet the following requirements: + # + # * Only contains 1-63 alphanumeric characters and hyphens + # * Begins with an alphabetical character + # * Ends with a non-hyphen character + # * Not formatted as a UUID + # * Complies with [RFC 1034](https://datatracker.ietf.org/doc/html/rfc1034) + # (section 3.5) + # @param network_peering [::Google::Cloud::VmwareEngine::V1::NetworkPeering, ::Hash] + # Required. The initial description of the new network peering. + # @param request_id [::String] + # Optional. A request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server guarantees that a + # request doesn't result in creation of duplicate commitments for at least 60 + # minutes. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @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/vmware_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VmwareEngine::V1::CreateNetworkPeeringRequest.new + # + # # Call the create_network_peering method. + # result = client.create_network_peering 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_network_peering request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::CreateNetworkPeeringRequest + + # Converts hash 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_network_peering.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::VmwareEngine::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_network_peering.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_network_peering.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vmware_engine_stub.create_network_peering 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 `NetworkPeering` resource. When a network peering is deleted for + # a VMware Engine network, the peer network becomes inaccessible to that + # VMware Engine network. NetworkPeering is a global resource and location can + # only be global. + # + # @overload delete_network_peering(request, options = nil) + # Pass arguments to `delete_network_peering` via a request object, either of type + # {::Google::Cloud::VmwareEngine::V1::DeleteNetworkPeeringRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VmwareEngine::V1::DeleteNetworkPeeringRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_network_peering(name: nil, request_id: nil) + # Pass arguments to `delete_network_peering` via keyword arguments. Note that at + # least one keyword argument is 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 network peering to be deleted. + # Resource names are schemeless URIs that follow the conventions in + # https://cloud.google.com/apis/design/resource_names. + # For example: + # `projects/my-project/locations/global/networkPeerings/my-peering` + # @param request_id [::String] + # Optional. A request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server guarantees that a + # request doesn't result in creation of duplicate commitments for at least 60 + # minutes. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @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/vmware_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VmwareEngine::V1::DeleteNetworkPeeringRequest.new + # + # # Call the delete_network_peering method. + # result = client.delete_network_peering 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_network_peering request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::DeleteNetworkPeeringRequest + + # Converts hash 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_network_peering.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::VmwareEngine::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_network_peering.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_network_peering.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vmware_engine_stub.delete_network_peering 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 + + ## + # Modifies a `NetworkPeering` resource. Only the `description` field can be + # updated. Only fields specified in `updateMask` are applied. NetworkPeering + # is a global resource and location can only be global. + # + # @overload update_network_peering(request, options = nil) + # Pass arguments to `update_network_peering` via a request object, either of type + # {::Google::Cloud::VmwareEngine::V1::UpdateNetworkPeeringRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VmwareEngine::V1::UpdateNetworkPeeringRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_network_peering(network_peering: nil, update_mask: nil, request_id: nil) + # Pass arguments to `update_network_peering` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param network_peering [::Google::Cloud::VmwareEngine::V1::NetworkPeering, ::Hash] + # Required. Network peering description. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. Field mask is used to specify the fields to be overwritten in the + # `NetworkPeering` resource by the update. + # The fields specified in the `update_mask` are relative to the resource, not + # the full request. A field will be overwritten if it is in the mask. If the + # user does not provide a mask then all fields will be overwritten. + # @param request_id [::String] + # Optional. A request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server guarantees that a + # request doesn't result in creation of duplicate commitments for at least 60 + # minutes. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @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/vmware_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VmwareEngine::V1::UpdateNetworkPeeringRequest.new + # + # # Call the update_network_peering method. + # result = client.update_network_peering 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 update_network_peering request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::UpdateNetworkPeeringRequest + + # Converts hash 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_network_peering.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::VmwareEngine::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_network_peering.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_network_peering.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vmware_engine_stub.update_network_peering 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 + + ## + # Lists the network peering routes exchanged over a peering connection. + # NetworkPeering is a global resource and location can only be global. + # + # @overload list_peering_routes(request, options = nil) + # Pass arguments to `list_peering_routes` via a request object, either of type + # {::Google::Cloud::VmwareEngine::V1::ListPeeringRoutesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VmwareEngine::V1::ListPeeringRoutesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_peering_routes(parent: nil, page_size: nil, page_token: nil, filter: nil) + # Pass arguments to `list_peering_routes` via keyword arguments. Note that at + # least one keyword argument is 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 network peering to retrieve peering + # routes from. Resource names are schemeless URIs that follow the conventions + # in https://cloud.google.com/apis/design/resource_names. For example: + # `projects/my-project/locations/global/networkPeerings/my-peering` + # @param page_size [::Integer] + # The maximum number of peering routes to return in one page. + # The service may return fewer than this value. + # The maximum value is coerced to 1000. + # The default value of this field is 500. + # @param page_token [::String] + # A page token, received from a previous `ListPeeringRoutes` call. + # Provide this to retrieve the subsequent page. + # When paginating, all other parameters provided to `ListPeeringRoutes` must + # match the call that provided the page token. + # @param filter [::String] + # A filter expression that matches resources returned in the response. + # Currently, only filtering on the `direction` field is supported. To return + # routes imported from the peer network, provide "direction=INCOMING". To + # return routes exported from the VMware Engine network, provide + # "direction=OUTGOING". Other filter expressions return an error. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::VmwareEngine::V1::PeeringRoute>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::VmwareEngine::V1::PeeringRoute>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/vmware_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VmwareEngine::V1::ListPeeringRoutesRequest.new + # + # # Call the list_peering_routes method. + # result = client.list_peering_routes 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::VmwareEngine::V1::PeeringRoute. + # p item + # end + # + def list_peering_routes request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::ListPeeringRoutesRequest + + # Converts hash 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_peering_routes.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::VmwareEngine::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_peering_routes.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_peering_routes.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vmware_engine_stub.list_peering_routes request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @vmware_engine_stub, :list_peering_routes, "peering_routes", 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 + + ## + # Creates a new HCX activation key in a given private cloud. + # + # @overload create_hcx_activation_key(request, options = nil) + # Pass arguments to `create_hcx_activation_key` via a request object, either of type + # {::Google::Cloud::VmwareEngine::V1::CreateHcxActivationKeyRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VmwareEngine::V1::CreateHcxActivationKeyRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_hcx_activation_key(parent: nil, hcx_activation_key: nil, hcx_activation_key_id: nil, request_id: nil) + # Pass arguments to `create_hcx_activation_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 resource name of the private cloud to create the key for. + # Resource names are schemeless URIs that follow the conventions in + # https://cloud.google.com/apis/design/resource_names. + # For example: + # `projects/my-project/locations/us-central1/privateClouds/my-cloud` + # @param hcx_activation_key [::Google::Cloud::VmwareEngine::V1::HcxActivationKey, ::Hash] + # Required. The initial description of a new HCX activation key. When + # creating a new key, this field must be an empty object. + # @param hcx_activation_key_id [::String] + # Required. The user-provided identifier of the `HcxActivationKey` to be + # created. This identifier must be unique among `HcxActivationKey` resources + # within the parent and becomes the final token in the name URI. + # The identifier must meet the following requirements: + # + # * Only contains 1-63 alphanumeric characters and hyphens + # * Begins with an alphabetical character + # * Ends with a non-hyphen character + # * Not formatted as a UUID + # * Complies with [RFC 1034](https://datatracker.ietf.org/doc/html/rfc1034) + # (section 3.5) + # @param request_id [::String] + # A request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server guarantees that a + # request doesn't result in creation of duplicate commitments for at least 60 + # minutes. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request ID, + # the server can check if original operation with the same request ID was + # received, and if so, will ignore the second request. This prevents clients + # from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @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/vmware_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VmwareEngine::V1::CreateHcxActivationKeyRequest.new + # + # # Call the create_hcx_activation_key method. + # result = client.create_hcx_activation_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 create_hcx_activation_key request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::CreateHcxActivationKeyRequest + + # Converts hash 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_hcx_activation_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::VmwareEngine::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_hcx_activation_key.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_hcx_activation_key.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vmware_engine_stub.create_hcx_activation_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 + + ## + # Lists `HcxActivationKey` resources in a given private cloud. + # + # @overload list_hcx_activation_keys(request, options = nil) + # Pass arguments to `list_hcx_activation_keys` via a request object, either of type + # {::Google::Cloud::VmwareEngine::V1::ListHcxActivationKeysRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VmwareEngine::V1::ListHcxActivationKeysRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_hcx_activation_keys(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_hcx_activation_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 private cloud + # to be queried for HCX activation keys. + # Resource names are schemeless URIs that follow the conventions in + # https://cloud.google.com/apis/design/resource_names. + # For example: + # `projects/my-project/locations/us-central1/privateClouds/my-cloud` + # @param page_size [::Integer] + # The maximum number of HCX activation keys to return in one page. + # The service may return fewer than this value. + # The maximum value is coerced to 1000. + # The default value of this field is 500. + # @param page_token [::String] + # A page token, received from a previous `ListHcxActivationKeys` call. + # Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to + # `ListHcxActivationKeys` must match the call that provided the page + # token. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::VmwareEngine::V1::HcxActivationKey>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::VmwareEngine::V1::HcxActivationKey>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/vmware_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VmwareEngine::V1::ListHcxActivationKeysRequest.new + # + # # Call the list_hcx_activation_keys method. + # result = client.list_hcx_activation_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::VmwareEngine::V1::HcxActivationKey. + # p item + # end + # + def list_hcx_activation_keys request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::ListHcxActivationKeysRequest + + # Converts hash 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_hcx_activation_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::VmwareEngine::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_hcx_activation_keys.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_hcx_activation_keys.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vmware_engine_stub.list_hcx_activation_keys request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @vmware_engine_stub, :list_hcx_activation_keys, "hcx_activation_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 + + ## + # Retrieves a `HcxActivationKey` resource by its resource name. + # + # @overload get_hcx_activation_key(request, options = nil) + # Pass arguments to `get_hcx_activation_key` via a request object, either of type + # {::Google::Cloud::VmwareEngine::V1::GetHcxActivationKeyRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VmwareEngine::V1::GetHcxActivationKeyRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_hcx_activation_key(name: nil) + # Pass arguments to `get_hcx_activation_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 resource name of the HCX activation key to retrieve. + # Resource names are schemeless URIs that follow the conventions in + # https://cloud.google.com/apis/design/resource_names. + # For example: + # `projects/my-project/locations/us-central1/privateClouds/my-cloud/hcxActivationKeys/my-key` + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::VmwareEngine::V1::HcxActivationKey] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::VmwareEngine::V1::HcxActivationKey] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/vmware_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VmwareEngine::V1::GetHcxActivationKeyRequest.new + # + # # Call the get_hcx_activation_key method. + # result = client.get_hcx_activation_key request + # + # # The returned object is of type Google::Cloud::VmwareEngine::V1::HcxActivationKey. + # p result + # + def get_hcx_activation_key request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::GetHcxActivationKeyRequest + + # Converts hash 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_hcx_activation_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::VmwareEngine::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_hcx_activation_key.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_hcx_activation_key.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vmware_engine_stub.get_hcx_activation_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 + + ## + # Retrieves a `NetworkPolicy` resource by its resource name. + # + # @overload get_network_policy(request, options = nil) + # Pass arguments to `get_network_policy` via a request object, either of type + # {::Google::Cloud::VmwareEngine::V1::GetNetworkPolicyRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VmwareEngine::V1::GetNetworkPolicyRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_network_policy(name: nil) + # Pass arguments to `get_network_policy` via keyword arguments. Note that at + # least one keyword argument is 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 network policy to retrieve. + # Resource names are schemeless URIs that follow the conventions in + # https://cloud.google.com/apis/design/resource_names. + # For example: + # `projects/my-project/locations/us-central1/networkPolicies/my-network-policy` + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::VmwareEngine::V1::NetworkPolicy] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::VmwareEngine::V1::NetworkPolicy] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/vmware_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VmwareEngine::V1::GetNetworkPolicyRequest.new + # + # # Call the get_network_policy method. + # result = client.get_network_policy request + # + # # The returned object is of type Google::Cloud::VmwareEngine::V1::NetworkPolicy. + # p result + # + def get_network_policy request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::GetNetworkPolicyRequest + + # Converts hash 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_network_policy.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::VmwareEngine::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_network_policy.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_network_policy.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vmware_engine_stub.get_network_policy 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 `NetworkPolicy` resources in a specified project and location. + # + # @overload list_network_policies(request, options = nil) + # Pass arguments to `list_network_policies` via a request object, either of type + # {::Google::Cloud::VmwareEngine::V1::ListNetworkPoliciesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VmwareEngine::V1::ListNetworkPoliciesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_network_policies(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) + # Pass arguments to `list_network_policies` via keyword arguments. Note that at + # least one keyword argument is 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 (region) to query for + # network policies. Resource names are schemeless URIs that follow the + # conventions in https://cloud.google.com/apis/design/resource_names. For + # example: `projects/my-project/locations/us-central1` + # @param page_size [::Integer] + # The maximum number of network policies to return in one page. + # The service may return fewer than this value. + # The maximum value is coerced to 1000. + # The default value of this field is 500. + # @param page_token [::String] + # A page token, received from a previous `ListNetworkPolicies` call. + # Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to + # `ListNetworkPolicies` must match the call that provided the page + # token. + # @param filter [::String] + # A filter expression that matches resources returned in the response. + # The expression must specify the field name, a comparison + # operator, and the value that you want to use for filtering. The value + # must be a string, a number, or a boolean. The comparison operator + # must be `=`, `!=`, `>`, or `<`. + # + # For example, if you are filtering a list of network policies, you can + # exclude the ones named `example-policy` by specifying + # `name != "example-policy"`. + # + # To filter on multiple expressions, provide each separate expression within + # parentheses. For example: + # ``` + # (name = "example-policy") + # (createTime > "2021-04-12T08:15:10.40Z") + # ``` + # + # By default, each expression is an `AND` expression. However, you + # can include `AND` and `OR` expressions explicitly. + # For example: + # ``` + # (name = "example-policy-1") AND + # (createTime > "2021-04-12T08:15:10.40Z") OR + # (name = "example-policy-2") + # ``` + # @param order_by [::String] + # Sorts list results by a certain order. By default, returned results + # are ordered by `name` in ascending order. + # You can also sort results in descending order based on the `name` value + # using `orderBy="name desc"`. + # Currently, only ordering by `name` is supported. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::VmwareEngine::V1::NetworkPolicy>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::VmwareEngine::V1::NetworkPolicy>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/vmware_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VmwareEngine::V1::ListNetworkPoliciesRequest.new + # + # # Call the list_network_policies method. + # result = client.list_network_policies 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::VmwareEngine::V1::NetworkPolicy. + # p item + # end + # + def list_network_policies request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::ListNetworkPoliciesRequest + + # Converts hash 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_network_policies.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::VmwareEngine::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_network_policies.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_network_policies.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vmware_engine_stub.list_network_policies request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @vmware_engine_stub, :list_network_policies, "network_policies", 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 + + ## + # Creates a new network policy in a given VMware Engine network of a + # project and location (region). A new network policy cannot be created if + # another network policy already exists in the same scope. + # + # @overload create_network_policy(request, options = nil) + # Pass arguments to `create_network_policy` via a request object, either of type + # {::Google::Cloud::VmwareEngine::V1::CreateNetworkPolicyRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VmwareEngine::V1::CreateNetworkPolicyRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_network_policy(parent: nil, network_policy_id: nil, network_policy: nil, request_id: nil) + # Pass arguments to `create_network_policy` via keyword arguments. Note that at + # least one keyword argument is 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 (region) + # to create the new network policy in. + # Resource names are schemeless URIs that follow the conventions in + # https://cloud.google.com/apis/design/resource_names. + # For example: + # `projects/my-project/locations/us-central1` + # @param network_policy_id [::String] + # Required. The user-provided identifier of the network policy to be created. + # This identifier must be unique within parent + # `projects/{my-project}/locations/{us-central1}/networkPolicies` and becomes + # the final token in the name URI. + # The identifier must meet the following requirements: + # + # * Only contains 1-63 alphanumeric characters and hyphens + # * Begins with an alphabetical character + # * Ends with a non-hyphen character + # * Not formatted as a UUID + # * Complies with [RFC 1034](https://datatracker.ietf.org/doc/html/rfc1034) + # (section 3.5) + # @param network_policy [::Google::Cloud::VmwareEngine::V1::NetworkPolicy, ::Hash] + # Required. The network policy configuration to use in the request. + # @param request_id [::String] + # Optional. A request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server guarantees that a + # request doesn't result in creation of duplicate commitments for at least 60 + # minutes. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @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/vmware_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VmwareEngine::V1::CreateNetworkPolicyRequest.new + # + # # Call the create_network_policy method. + # result = client.create_network_policy 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_network_policy request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::CreateNetworkPolicyRequest + + # Converts hash 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_network_policy.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::VmwareEngine::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_network_policy.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_network_policy.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vmware_engine_stub.create_network_policy 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 + + ## + # Modifies a `NetworkPolicy` resource. Only the following fields can be + # updated: `internet_access`, `external_ip`, `edge_services_cidr`. + # Only fields specified in `updateMask` are applied. When updating a network + # policy, the external IP network service can only be disabled if there are + # no external IP addresses present in the scope of the policy. Also, a + # `NetworkService` cannot be updated when `NetworkService.state` is set + # to `RECONCILING`. + # + # During operation processing, the resource is temporarily in the `ACTIVE` + # state before the operation fully completes. For that period of time, you + # can't update the resource. Use the operation status to determine when the + # processing fully completes. + # + # @overload update_network_policy(request, options = nil) + # Pass arguments to `update_network_policy` via a request object, either of type + # {::Google::Cloud::VmwareEngine::V1::UpdateNetworkPolicyRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VmwareEngine::V1::UpdateNetworkPolicyRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_network_policy(network_policy: nil, update_mask: nil, request_id: nil) + # Pass arguments to `update_network_policy` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param network_policy [::Google::Cloud::VmwareEngine::V1::NetworkPolicy, ::Hash] + # Required. Network policy description. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. Field mask is used to specify the fields to be overwritten in the + # `NetworkPolicy` resource by the update. + # The fields specified in the `update_mask` are relative to the resource, not + # the full request. A field will be overwritten if it is in the mask. If the + # user does not provide a mask then all fields will be overwritten. + # @param request_id [::String] + # Optional. A request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server guarantees that a + # request doesn't result in creation of duplicate commitments for at least 60 + # minutes. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @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/vmware_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VmwareEngine::V1::UpdateNetworkPolicyRequest.new + # + # # Call the update_network_policy method. + # result = client.update_network_policy 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 update_network_policy request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::UpdateNetworkPolicyRequest + + # Converts hash 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_network_policy.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::VmwareEngine::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_network_policy.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_network_policy.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vmware_engine_stub.update_network_policy 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 `NetworkPolicy` resource. A network policy cannot be deleted + # when `NetworkService.state` is set to `RECONCILING` for either its external + # IP or internet access service. + # + # @overload delete_network_policy(request, options = nil) + # Pass arguments to `delete_network_policy` via a request object, either of type + # {::Google::Cloud::VmwareEngine::V1::DeleteNetworkPolicyRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VmwareEngine::V1::DeleteNetworkPolicyRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_network_policy(name: nil, request_id: nil) + # Pass arguments to `delete_network_policy` via keyword arguments. Note that at + # least one keyword argument is 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 network policy to delete. + # Resource names are schemeless URIs that follow the conventions in + # https://cloud.google.com/apis/design/resource_names. + # For example: + # `projects/my-project/locations/us-central1/networkPolicies/my-network-policy` + # @param request_id [::String] + # Optional. A request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server guarantees that a + # request doesn't result in creation of duplicate commitments for at least 60 + # minutes. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @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/vmware_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VmwareEngine::V1::DeleteNetworkPolicyRequest.new + # + # # Call the delete_network_policy method. + # result = client.delete_network_policy 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_network_policy request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::DeleteNetworkPolicyRequest + + # Converts hash 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_network_policy.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::VmwareEngine::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_network_policy.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_network_policy.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vmware_engine_stub.delete_network_policy 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 + + ## + # Lists Consumer VPCs bound to Management DNS Zone of a given private cloud. + # + # @overload list_management_dns_zone_bindings(request, options = nil) + # Pass arguments to `list_management_dns_zone_bindings` via a request object, either of type + # {::Google::Cloud::VmwareEngine::V1::ListManagementDnsZoneBindingsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VmwareEngine::V1::ListManagementDnsZoneBindingsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_management_dns_zone_bindings(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) + # Pass arguments to `list_management_dns_zone_bindings` via keyword arguments. Note that at + # least one keyword argument is 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 private cloud to be queried for + # management DNS zone bindings. + # Resource names are schemeless URIs that follow the conventions in + # https://cloud.google.com/apis/design/resource_names. + # For example: + # `projects/my-project/locations/us-central1-a/privateClouds/my-cloud` + # @param page_size [::Integer] + # The maximum number of management DNS zone bindings to return in one page. + # The service may return fewer than this value. + # The maximum value is coerced to 1000. + # The default value of this field is 500. + # @param page_token [::String] + # A page token, received from a previous `ListManagementDnsZoneBindings` + # call. Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to + # `ListManagementDnsZoneBindings` must match the call that provided the page + # token. + # @param filter [::String] + # A filter expression that matches resources returned in the response. + # The expression must specify the field name, a comparison + # operator, and the value that you want to use for filtering. The value + # must be a string, a number, or a boolean. The comparison operator + # must be `=`, `!=`, `>`, or `<`. + # + # For example, if you are filtering a list of Management DNS Zone Bindings, + # you can exclude the ones named `example-management-dns-zone-binding` by + # specifying `name != "example-management-dns-zone-binding"`. + # + # To filter on multiple expressions, provide each separate expression within + # parentheses. For example: + # ``` + # (name = "example-management-dns-zone-binding") + # (createTime > "2021-04-12T08:15:10.40Z") + # ``` + # + # By default, each expression is an `AND` expression. However, you + # can include `AND` and `OR` expressions explicitly. + # For example: + # ``` + # (name = "example-management-dns-zone-binding-1") AND + # (createTime > "2021-04-12T08:15:10.40Z") OR + # (name = "example-management-dns-zone-binding-2") + # ``` + # @param order_by [::String] + # Sorts list results by a certain order. By default, returned results + # are ordered by `name` in ascending order. + # You can also sort results in descending order based on the `name` value + # using `orderBy="name desc"`. + # Currently, only ordering by `name` is supported. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::VmwareEngine::V1::ManagementDnsZoneBinding>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::VmwareEngine::V1::ManagementDnsZoneBinding>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/vmware_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VmwareEngine::V1::ListManagementDnsZoneBindingsRequest.new + # + # # Call the list_management_dns_zone_bindings method. + # result = client.list_management_dns_zone_bindings 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::VmwareEngine::V1::ManagementDnsZoneBinding. + # p item + # end + # + def list_management_dns_zone_bindings request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::ListManagementDnsZoneBindingsRequest + + # Converts hash 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_management_dns_zone_bindings.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::VmwareEngine::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_management_dns_zone_bindings.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_management_dns_zone_bindings.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vmware_engine_stub.list_management_dns_zone_bindings request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @vmware_engine_stub, :list_management_dns_zone_bindings, "management_dns_zone_bindings", 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 + + ## + # Retrieves a 'ManagementDnsZoneBinding' resource by its resource name. + # + # @overload get_management_dns_zone_binding(request, options = nil) + # Pass arguments to `get_management_dns_zone_binding` via a request object, either of type + # {::Google::Cloud::VmwareEngine::V1::GetManagementDnsZoneBindingRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VmwareEngine::V1::GetManagementDnsZoneBindingRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_management_dns_zone_binding(name: nil) + # Pass arguments to `get_management_dns_zone_binding` via keyword arguments. Note that at + # least one keyword argument is 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 management DNS zone binding to + # retrieve. Resource names are schemeless URIs that follow the conventions in + # https://cloud.google.com/apis/design/resource_names. + # For example: + # `projects/my-project/locations/us-central1-a/privateClouds/my-cloud/managementDnsZoneBindings/my-management-dns-zone-binding` + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::VmwareEngine::V1::ManagementDnsZoneBinding] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::VmwareEngine::V1::ManagementDnsZoneBinding] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/vmware_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VmwareEngine::V1::GetManagementDnsZoneBindingRequest.new + # + # # Call the get_management_dns_zone_binding method. + # result = client.get_management_dns_zone_binding request + # + # # The returned object is of type Google::Cloud::VmwareEngine::V1::ManagementDnsZoneBinding. + # p result + # + def get_management_dns_zone_binding request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::GetManagementDnsZoneBindingRequest + + # Converts hash 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_management_dns_zone_binding.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::VmwareEngine::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_management_dns_zone_binding.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_management_dns_zone_binding.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vmware_engine_stub.get_management_dns_zone_binding 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 `ManagementDnsZoneBinding` resource in a private cloud. + # This RPC creates the DNS binding and the resource that represents the + # DNS binding of the consumer VPC network to the management DNS zone. A + # management DNS zone is the Cloud DNS cross-project binding zone that + # VMware Engine creates for each private cloud. It contains FQDNs and + # corresponding IP addresses for the private cloud's ESXi hosts and + # management VM appliances like vCenter and NSX Manager. + # + # @overload create_management_dns_zone_binding(request, options = nil) + # Pass arguments to `create_management_dns_zone_binding` via a request object, either of type + # {::Google::Cloud::VmwareEngine::V1::CreateManagementDnsZoneBindingRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VmwareEngine::V1::CreateManagementDnsZoneBindingRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_management_dns_zone_binding(parent: nil, management_dns_zone_binding: nil, management_dns_zone_binding_id: nil, request_id: nil) + # Pass arguments to `create_management_dns_zone_binding` via keyword arguments. Note that at + # least one keyword argument is 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 private cloud + # to create a new management DNS zone binding for. + # Resource names are schemeless URIs that follow the conventions in + # https://cloud.google.com/apis/design/resource_names. + # For example: + # `projects/my-project/locations/us-central1-a/privateClouds/my-cloud` + # @param management_dns_zone_binding [::Google::Cloud::VmwareEngine::V1::ManagementDnsZoneBinding, ::Hash] + # Required. The initial values for a new management DNS zone binding. + # @param management_dns_zone_binding_id [::String] + # Required. The user-provided identifier of the `ManagementDnsZoneBinding` + # resource to be created. This identifier must be unique among + # `ManagementDnsZoneBinding` resources within the parent and becomes the + # final token in the name URI. The identifier must meet the following + # requirements: + # + # * Only contains 1-63 alphanumeric characters and hyphens + # * Begins with an alphabetical character + # * Ends with a non-hyphen character + # * Not formatted as a UUID + # * Complies with [RFC 1034](https://datatracker.ietf.org/doc/html/rfc1034) + # (section 3.5) + # @param request_id [::String] + # Optional. A request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server guarantees that a + # request doesn't result in creation of duplicate commitments for at least 60 + # minutes. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request ID, + # the server can check if the original operation with the same request ID was + # received, and if so, will ignore the second request. This prevents clients + # from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @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/vmware_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VmwareEngine::V1::CreateManagementDnsZoneBindingRequest.new + # + # # Call the create_management_dns_zone_binding method. + # result = client.create_management_dns_zone_binding 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_management_dns_zone_binding request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::CreateManagementDnsZoneBindingRequest + + # Converts hash 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_management_dns_zone_binding.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::VmwareEngine::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_management_dns_zone_binding.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_management_dns_zone_binding.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vmware_engine_stub.create_management_dns_zone_binding 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 + + ## + # Updates a `ManagementDnsZoneBinding` resource. + # Only fields specified in `update_mask` are applied. + # + # @overload update_management_dns_zone_binding(request, options = nil) + # Pass arguments to `update_management_dns_zone_binding` via a request object, either of type + # {::Google::Cloud::VmwareEngine::V1::UpdateManagementDnsZoneBindingRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VmwareEngine::V1::UpdateManagementDnsZoneBindingRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_management_dns_zone_binding(update_mask: nil, management_dns_zone_binding: nil, request_id: nil) + # Pass arguments to `update_management_dns_zone_binding` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. Field mask is used to specify the fields to be overwritten in the + # `ManagementDnsZoneBinding` resource by the update. + # The fields specified in the `update_mask` are relative to the resource, not + # the full request. A field will be overwritten if it is in the mask. If the + # user does not provide a mask then all fields will be overwritten. + # @param management_dns_zone_binding [::Google::Cloud::VmwareEngine::V1::ManagementDnsZoneBinding, ::Hash] + # Required. New values to update the management DNS zone binding with. + # @param request_id [::String] + # Optional. A request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server guarantees that a + # request doesn't result in creation of duplicate commitments for at least 60 + # minutes. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request ID, + # the server can check if the original operation with the same request ID was + # received, and if so, will ignore the second request. This prevents clients + # from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @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/vmware_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VmwareEngine::V1::UpdateManagementDnsZoneBindingRequest.new + # + # # Call the update_management_dns_zone_binding method. + # result = client.update_management_dns_zone_binding 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 update_management_dns_zone_binding request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::UpdateManagementDnsZoneBindingRequest + + # Converts hash 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_management_dns_zone_binding.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::VmwareEngine::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_management_dns_zone_binding.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_management_dns_zone_binding.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vmware_engine_stub.update_management_dns_zone_binding 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 `ManagementDnsZoneBinding` resource. When a management DNS zone + # binding is deleted, the corresponding consumer VPC network is no longer + # bound to the management DNS zone. + # + # @overload delete_management_dns_zone_binding(request, options = nil) + # Pass arguments to `delete_management_dns_zone_binding` via a request object, either of type + # {::Google::Cloud::VmwareEngine::V1::DeleteManagementDnsZoneBindingRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VmwareEngine::V1::DeleteManagementDnsZoneBindingRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_management_dns_zone_binding(name: nil, request_id: nil) + # Pass arguments to `delete_management_dns_zone_binding` via keyword arguments. Note that at + # least one keyword argument is 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 management DNS zone binding to delete. + # Resource names are schemeless URIs that follow the conventions in + # https://cloud.google.com/apis/design/resource_names. + # For example: + # `projects/my-project/locations/us-central1-a/privateClouds/my-cloud/managementDnsZoneBindings/my-management-dns-zone-binding` + # @param request_id [::String] + # Optional. A request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server guarantees that a + # request doesn't result in creation of duplicate commitments for at least 60 + # minutes. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request + # ID, the server can check if the original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @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/vmware_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VmwareEngine::V1::DeleteManagementDnsZoneBindingRequest.new + # + # # Call the delete_management_dns_zone_binding method. + # result = client.delete_management_dns_zone_binding 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_management_dns_zone_binding request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::DeleteManagementDnsZoneBindingRequest + + # Converts hash 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_management_dns_zone_binding.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::VmwareEngine::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_management_dns_zone_binding.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_management_dns_zone_binding.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vmware_engine_stub.delete_management_dns_zone_binding 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 + + ## + # Retries to create a `ManagementDnsZoneBinding` resource that is + # in failed state. + # + # @overload repair_management_dns_zone_binding(request, options = nil) + # Pass arguments to `repair_management_dns_zone_binding` via a request object, either of type + # {::Google::Cloud::VmwareEngine::V1::RepairManagementDnsZoneBindingRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VmwareEngine::V1::RepairManagementDnsZoneBindingRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload repair_management_dns_zone_binding(name: nil, request_id: nil) + # Pass arguments to `repair_management_dns_zone_binding` via keyword arguments. Note that at + # least one keyword argument is 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 management DNS zone binding to repair. + # Resource names are schemeless URIs that follow the conventions in + # https://cloud.google.com/apis/design/resource_names. + # For example: + # `projects/my-project/locations/us-central1-a/privateClouds/my-cloud/managementDnsZoneBindings/my-management-dns-zone-binding` + # @param request_id [::String] + # Optional. A request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server guarantees that a + # request doesn't result in creation of duplicate commitments for at least 60 + # minutes. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request ID, + # the server can check if the original operation with the same request ID was + # received, and if so, will ignore the second request. This prevents clients + # from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @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/vmware_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VmwareEngine::V1::RepairManagementDnsZoneBindingRequest.new + # + # # Call the repair_management_dns_zone_binding method. + # result = client.repair_management_dns_zone_binding 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 repair_management_dns_zone_binding request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::RepairManagementDnsZoneBindingRequest + + # Converts hash 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.repair_management_dns_zone_binding.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::VmwareEngine::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.repair_management_dns_zone_binding.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.repair_management_dns_zone_binding.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vmware_engine_stub.repair_management_dns_zone_binding 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 VMware Engine network that can be used by a private cloud. + # + # @overload create_vmware_engine_network(request, options = nil) + # Pass arguments to `create_vmware_engine_network` via a request object, either of type + # {::Google::Cloud::VmwareEngine::V1::CreateVmwareEngineNetworkRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VmwareEngine::V1::CreateVmwareEngineNetworkRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_vmware_engine_network(parent: nil, vmware_engine_network_id: nil, vmware_engine_network: nil, request_id: nil) + # Pass arguments to `create_vmware_engine_network` via keyword arguments. Note that at + # least one keyword argument is 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 to create the new VMware Engine + # network in. A VMware Engine network of type + # `LEGACY` is a regional resource, and a VMware + # Engine network of type `STANDARD` is a global resource. + # Resource names are schemeless URIs that follow the conventions in + # https://cloud.google.com/apis/design/resource_names. For example: + # `projects/my-project/locations/global` + # @param vmware_engine_network_id [::String] + # Required. The user-provided identifier of the new VMware Engine network. + # This identifier must be unique among VMware Engine network resources + # within the parent and becomes the final token in the name URI. The + # identifier must meet the following requirements: + # + # * For networks of type LEGACY, adheres to the format: + # `{region-id}-default`. Replace `{region-id}` with the region where you want + # to create the VMware Engine network. For example, "us-central1-default". + # * Only contains 1-63 alphanumeric characters and hyphens + # * Begins with an alphabetical character + # * Ends with a non-hyphen character + # * Not formatted as a UUID + # * Complies with [RFC 1034](https://datatracker.ietf.org/doc/html/rfc1034) + # (section 3.5) + # @param vmware_engine_network [::Google::Cloud::VmwareEngine::V1::VmwareEngineNetwork, ::Hash] + # Required. The initial description of the new VMware Engine network. + # @param request_id [::String] + # Optional. A request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server guarantees that a + # request doesn't result in creation of duplicate commitments for at least 60 + # minutes. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @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/vmware_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VmwareEngine::V1::CreateVmwareEngineNetworkRequest.new + # + # # Call the create_vmware_engine_network method. + # result = client.create_vmware_engine_network 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_vmware_engine_network request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::CreateVmwareEngineNetworkRequest + + # Converts hash 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_vmware_engine_network.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::VmwareEngine::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_vmware_engine_network.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_vmware_engine_network.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vmware_engine_stub.create_vmware_engine_network 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 + + ## + # Modifies a VMware Engine network resource. Only the following fields can be + # updated: `description`. Only fields specified in `updateMask` are + # applied. + # + # @overload update_vmware_engine_network(request, options = nil) + # Pass arguments to `update_vmware_engine_network` via a request object, either of type + # {::Google::Cloud::VmwareEngine::V1::UpdateVmwareEngineNetworkRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VmwareEngine::V1::UpdateVmwareEngineNetworkRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_vmware_engine_network(vmware_engine_network: nil, update_mask: nil, request_id: nil) + # Pass arguments to `update_vmware_engine_network` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param vmware_engine_network [::Google::Cloud::VmwareEngine::V1::VmwareEngineNetwork, ::Hash] + # Required. VMware Engine network description. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. Field mask is used to specify the fields to be overwritten in the + # VMware Engine network resource by the update. + # The fields specified in the `update_mask` are relative to the resource, not + # the full request. A field will be overwritten if it is in the mask. If the + # user does not provide a mask then all fields will be overwritten. Only the + # following fields can be updated: `description`. + # @param request_id [::String] + # Optional. A request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server guarantees that a + # request doesn't result in creation of duplicate commitments for at least 60 + # minutes. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @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/vmware_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VmwareEngine::V1::UpdateVmwareEngineNetworkRequest.new + # + # # Call the update_vmware_engine_network method. + # result = client.update_vmware_engine_network 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 update_vmware_engine_network request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::UpdateVmwareEngineNetworkRequest + + # Converts hash 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_vmware_engine_network.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::VmwareEngine::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_vmware_engine_network.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_vmware_engine_network.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vmware_engine_stub.update_vmware_engine_network 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 `VmwareEngineNetwork` resource. You can only delete a VMware + # Engine network after all resources that refer to it are deleted. For + # example, a private cloud, a network peering, and a network policy can all + # refer to the same VMware Engine network. + # + # @overload delete_vmware_engine_network(request, options = nil) + # Pass arguments to `delete_vmware_engine_network` via a request object, either of type + # {::Google::Cloud::VmwareEngine::V1::DeleteVmwareEngineNetworkRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VmwareEngine::V1::DeleteVmwareEngineNetworkRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_vmware_engine_network(name: nil, request_id: nil, etag: nil) + # Pass arguments to `delete_vmware_engine_network` via keyword arguments. Note that at + # least one keyword argument is 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 VMware Engine network to be deleted. + # Resource names are schemeless URIs that follow the conventions in + # https://cloud.google.com/apis/design/resource_names. + # For example: + # `projects/my-project/locations/global/vmwareEngineNetworks/my-network` + # @param request_id [::String] + # Optional. A request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server guarantees that a + # request doesn't result in creation of duplicate commitments for at least 60 + # minutes. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @param etag [::String] + # Optional. Checksum used to ensure that the user-provided value is up to + # date before the server processes the request. The server compares provided + # checksum with the current checksum of the resource. If the user-provided + # value is out of date, this request returns an `ABORTED` error. + # @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/vmware_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VmwareEngine::V1::DeleteVmwareEngineNetworkRequest.new + # + # # Call the delete_vmware_engine_network method. + # result = client.delete_vmware_engine_network 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_vmware_engine_network request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::DeleteVmwareEngineNetworkRequest + + # Converts hash 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_vmware_engine_network.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::VmwareEngine::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_vmware_engine_network.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_vmware_engine_network.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vmware_engine_stub.delete_vmware_engine_network 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 + + ## + # Retrieves a `VmwareEngineNetwork` resource by its resource name. The + # resource contains details of the VMware Engine network, such as its VMware + # Engine network type, peered networks in a service project, and state + # (for example, `CREATING`, `ACTIVE`, `DELETING`). + # + # @overload get_vmware_engine_network(request, options = nil) + # Pass arguments to `get_vmware_engine_network` via a request object, either of type + # {::Google::Cloud::VmwareEngine::V1::GetVmwareEngineNetworkRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VmwareEngine::V1::GetVmwareEngineNetworkRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_vmware_engine_network(name: nil) + # Pass arguments to `get_vmware_engine_network` via keyword arguments. Note that at + # least one keyword argument is 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 VMware Engine network to retrieve. + # Resource names are schemeless URIs that follow the conventions in + # https://cloud.google.com/apis/design/resource_names. + # For example: + # `projects/my-project/locations/global/vmwareEngineNetworks/my-network` + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::VmwareEngine::V1::VmwareEngineNetwork] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::VmwareEngine::V1::VmwareEngineNetwork] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/vmware_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VmwareEngine::V1::GetVmwareEngineNetworkRequest.new + # + # # Call the get_vmware_engine_network method. + # result = client.get_vmware_engine_network request + # + # # The returned object is of type Google::Cloud::VmwareEngine::V1::VmwareEngineNetwork. + # p result + # + def get_vmware_engine_network request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::GetVmwareEngineNetworkRequest + + # Converts hash 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_vmware_engine_network.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::VmwareEngine::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_vmware_engine_network.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_vmware_engine_network.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vmware_engine_stub.get_vmware_engine_network 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 `VmwareEngineNetwork` resources in a given project and location. + # + # @overload list_vmware_engine_networks(request, options = nil) + # Pass arguments to `list_vmware_engine_networks` via a request object, either of type + # {::Google::Cloud::VmwareEngine::V1::ListVmwareEngineNetworksRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VmwareEngine::V1::ListVmwareEngineNetworksRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_vmware_engine_networks(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) + # Pass arguments to `list_vmware_engine_networks` via keyword arguments. Note that at + # least one keyword argument is 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 to query for + # VMware Engine networks. Resource names are schemeless URIs that follow the + # conventions in https://cloud.google.com/apis/design/resource_names. For + # example: `projects/my-project/locations/global` + # @param page_size [::Integer] + # The maximum number of results to return in one page. + # The maximum value is coerced to 1000. + # The default value of this field is 500. + # @param page_token [::String] + # A page token, received from a previous `ListVmwareEngineNetworks` call. + # Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to + # `ListVmwareEngineNetworks` must match the call that provided the page + # token. + # @param filter [::String] + # A filter expression that matches resources returned in the response. + # The expression must specify the field name, a comparison + # operator, and the value that you want to use for filtering. The value + # must be a string, a number, or a boolean. The comparison operator + # must be `=`, `!=`, `>`, or `<`. + # + # For example, if you are filtering a list of network peerings, you can + # exclude the ones named `example-network` by specifying + # `name != "example-network"`. + # + # To filter on multiple expressions, provide each separate expression within + # parentheses. For example: + # ``` + # (name = "example-network") + # (createTime > "2021-04-12T08:15:10.40Z") + # ``` + # + # By default, each expression is an `AND` expression. However, you + # can include `AND` and `OR` expressions explicitly. + # For example: + # ``` + # (name = "example-network-1") AND + # (createTime > "2021-04-12T08:15:10.40Z") OR + # (name = "example-network-2") + # ``` + # @param order_by [::String] + # Sorts list results by a certain order. By default, returned results + # are ordered by `name` in ascending order. + # You can also sort results in descending order based on the `name` value + # using `orderBy="name desc"`. + # Currently, only ordering by `name` is supported. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::VmwareEngine::V1::VmwareEngineNetwork>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::VmwareEngine::V1::VmwareEngineNetwork>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/vmware_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VmwareEngine::V1::ListVmwareEngineNetworksRequest.new + # + # # Call the list_vmware_engine_networks method. + # result = client.list_vmware_engine_networks 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::VmwareEngine::V1::VmwareEngineNetwork. + # p item + # end + # + def list_vmware_engine_networks request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::ListVmwareEngineNetworksRequest + + # Converts hash 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_vmware_engine_networks.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::VmwareEngine::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_vmware_engine_networks.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_vmware_engine_networks.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vmware_engine_stub.list_vmware_engine_networks request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @vmware_engine_stub, :list_vmware_engine_networks, "vmware_engine_networks", 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 + + ## + # Creates a new private connection that can be used for accessing private + # Clouds. + # + # @overload create_private_connection(request, options = nil) + # Pass arguments to `create_private_connection` via a request object, either of type + # {::Google::Cloud::VmwareEngine::V1::CreatePrivateConnectionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VmwareEngine::V1::CreatePrivateConnectionRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_private_connection(parent: nil, private_connection_id: nil, private_connection: nil, request_id: nil) + # Pass arguments to `create_private_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 to create the new private + # connection in. Private connection is a regional resource. + # Resource names are schemeless URIs that follow the conventions in + # https://cloud.google.com/apis/design/resource_names. For example: + # `projects/my-project/locations/us-central1` + # @param private_connection_id [::String] + # Required. The user-provided identifier of the new private connection. + # This identifier must be unique among private connection resources + # within the parent and becomes the final token in the name URI. The + # identifier must meet the following requirements: + # + # * Only contains 1-63 alphanumeric characters and hyphens + # * Begins with an alphabetical character + # * Ends with a non-hyphen character + # * Not formatted as a UUID + # * Complies with [RFC 1034](https://datatracker.ietf.org/doc/html/rfc1034) + # (section 3.5) + # @param private_connection [::Google::Cloud::VmwareEngine::V1::PrivateConnection, ::Hash] + # Required. The initial description of the new private connection. + # @param request_id [::String] + # Optional. A request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server guarantees that a + # request doesn't result in creation of duplicate commitments for at least 60 + # minutes. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @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/vmware_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VmwareEngine::V1::CreatePrivateConnectionRequest.new + # + # # Call the create_private_connection method. + # result = client.create_private_connection 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_private_connection request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::CreatePrivateConnectionRequest + + # Converts hash 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_private_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::VmwareEngine::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_private_connection.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_private_connection.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vmware_engine_stub.create_private_connection 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 + + ## + # Retrieves a `PrivateConnection` resource by its resource name. The resource + # contains details of the private connection, such as connected + # network, routing mode and state. + # + # @overload get_private_connection(request, options = nil) + # Pass arguments to `get_private_connection` via a request object, either of type + # {::Google::Cloud::VmwareEngine::V1::GetPrivateConnectionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VmwareEngine::V1::GetPrivateConnectionRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_private_connection(name: nil) + # Pass arguments to `get_private_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 resource name of the private connection to retrieve. + # Resource names are schemeless URIs that follow the conventions in + # https://cloud.google.com/apis/design/resource_names. + # For example: + # `projects/my-project/locations/us-central1/privateConnections/my-connection` + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::VmwareEngine::V1::PrivateConnection] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::VmwareEngine::V1::PrivateConnection] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/vmware_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VmwareEngine::V1::GetPrivateConnectionRequest.new + # + # # Call the get_private_connection method. + # result = client.get_private_connection request + # + # # The returned object is of type Google::Cloud::VmwareEngine::V1::PrivateConnection. + # p result + # + def get_private_connection request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::GetPrivateConnectionRequest + + # Converts hash 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_private_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::VmwareEngine::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_private_connection.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_private_connection.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vmware_engine_stub.get_private_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 + + ## + # Lists `PrivateConnection` resources in a given project and location. + # + # @overload list_private_connections(request, options = nil) + # Pass arguments to `list_private_connections` via a request object, either of type + # {::Google::Cloud::VmwareEngine::V1::ListPrivateConnectionsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VmwareEngine::V1::ListPrivateConnectionsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_private_connections(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) + # Pass arguments to `list_private_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 to query for + # private connections. Resource names are schemeless URIs that follow the + # conventions in https://cloud.google.com/apis/design/resource_names. For + # example: `projects/my-project/locations/us-central1` + # @param page_size [::Integer] + # The maximum number of private connections to return in one page. + # The maximum value is coerced to 1000. + # The default value of this field is 500. + # @param page_token [::String] + # A page token, received from a previous `ListPrivateConnections` call. + # Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to + # `ListPrivateConnections` must match the call that provided the page + # token. + # @param filter [::String] + # A filter expression that matches resources returned in the response. + # The expression must specify the field name, a comparison + # operator, and the value that you want to use for filtering. The value + # must be a string, a number, or a boolean. The comparison operator + # must be `=`, `!=`, `>`, or `<`. + # + # For example, if you are filtering a list of private connections, you can + # exclude the ones named `example-connection` by specifying + # `name != "example-connection"`. + # + # To filter on multiple expressions, provide each separate expression within + # parentheses. For example: + # ``` + # (name = "example-connection") + # (createTime > "2022-09-22T08:15:10.40Z") + # ``` + # + # By default, each expression is an `AND` expression. However, you + # can include `AND` and `OR` expressions explicitly. + # For example: + # ``` + # (name = "example-connection-1") AND + # (createTime > "2021-04-12T08:15:10.40Z") OR + # (name = "example-connection-2") + # ``` + # @param order_by [::String] + # Sorts list results by a certain order. By default, returned results + # are ordered by `name` in ascending order. + # You can also sort results in descending order based on the `name` value + # using `orderBy="name desc"`. + # Currently, only ordering by `name` is supported. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::VmwareEngine::V1::PrivateConnection>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::VmwareEngine::V1::PrivateConnection>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/vmware_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VmwareEngine::V1::ListPrivateConnectionsRequest.new + # + # # Call the list_private_connections method. + # result = client.list_private_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::VmwareEngine::V1::PrivateConnection. + # p item + # end + # + def list_private_connections request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::ListPrivateConnectionsRequest + + # Converts hash 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_private_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::VmwareEngine::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_private_connections.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_private_connections.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vmware_engine_stub.list_private_connections request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @vmware_engine_stub, :list_private_connections, "private_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 + + ## + # Modifies a `PrivateConnection` resource. Only `description` and + # `routing_mode` fields can be updated. Only fields specified in `updateMask` + # are applied. + # + # @overload update_private_connection(request, options = nil) + # Pass arguments to `update_private_connection` via a request object, either of type + # {::Google::Cloud::VmwareEngine::V1::UpdatePrivateConnectionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VmwareEngine::V1::UpdatePrivateConnectionRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_private_connection(private_connection: nil, update_mask: nil, request_id: nil) + # Pass arguments to `update_private_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 private_connection [::Google::Cloud::VmwareEngine::V1::PrivateConnection, ::Hash] + # Required. Private connection description. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. Field mask is used to specify the fields to be overwritten in the + # `PrivateConnection` resource by the update. + # The fields specified in the `update_mask` are relative to the resource, not + # the full request. A field will be overwritten if it is in the mask. If the + # user does not provide a mask then all fields will be overwritten. + # @param request_id [::String] + # Optional. A request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server guarantees that a + # request doesn't result in creation of duplicate commitments for at least 60 + # minutes. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @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/vmware_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VmwareEngine::V1::UpdatePrivateConnectionRequest.new + # + # # Call the update_private_connection method. + # result = client.update_private_connection 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 update_private_connection request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::UpdatePrivateConnectionRequest + + # Converts hash 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_private_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::VmwareEngine::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_private_connection.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_private_connection.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vmware_engine_stub.update_private_connection 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 `PrivateConnection` resource. When a private connection is + # deleted for a VMware Engine network, the connected network becomes + # inaccessible to that VMware Engine network. + # + # @overload delete_private_connection(request, options = nil) + # Pass arguments to `delete_private_connection` via a request object, either of type + # {::Google::Cloud::VmwareEngine::V1::DeletePrivateConnectionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VmwareEngine::V1::DeletePrivateConnectionRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_private_connection(name: nil, request_id: nil) + # Pass arguments to `delete_private_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 resource name of the private connection to be deleted. + # Resource names are schemeless URIs that follow the conventions in + # https://cloud.google.com/apis/design/resource_names. + # For example: + # `projects/my-project/locations/us-central1/privateConnections/my-connection` + # @param request_id [::String] + # Optional. A request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server guarantees that a + # request doesn't result in creation of duplicate commitments for at least 60 + # minutes. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @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/vmware_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VmwareEngine::V1::DeletePrivateConnectionRequest.new + # + # # Call the delete_private_connection method. + # result = client.delete_private_connection 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_private_connection request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::DeletePrivateConnectionRequest + + # Converts hash 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_private_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::VmwareEngine::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_private_connection.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_private_connection.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vmware_engine_stub.delete_private_connection 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 + + ## + # Lists the private connection routes exchanged over a peering connection. + # + # @overload list_private_connection_peering_routes(request, options = nil) + # Pass arguments to `list_private_connection_peering_routes` via a request object, either of type + # {::Google::Cloud::VmwareEngine::V1::ListPrivateConnectionPeeringRoutesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VmwareEngine::V1::ListPrivateConnectionPeeringRoutesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_private_connection_peering_routes(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_private_connection_peering_routes` via keyword arguments. Note that at + # least one keyword argument is 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 private connection to retrieve peering + # routes from. Resource names are schemeless URIs that follow the conventions + # in https://cloud.google.com/apis/design/resource_names. For example: + # `projects/my-project/locations/us-west1/privateConnections/my-connection` + # @param page_size [::Integer] + # The maximum number of peering routes to return in one page. + # The service may return fewer than this value. + # The maximum value is coerced to 1000. + # The default value of this field is 500. + # @param page_token [::String] + # A page token, received from a previous `ListPrivateConnectionPeeringRoutes` + # call. Provide this to retrieve the subsequent page. When paginating, all + # other parameters provided to `ListPrivateConnectionPeeringRoutes` must + # match the call that provided the page token. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::VmwareEngine::V1::PeeringRoute>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::VmwareEngine::V1::PeeringRoute>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/vmware_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VmwareEngine::V1::ListPrivateConnectionPeeringRoutesRequest.new + # + # # Call the list_private_connection_peering_routes method. + # result = client.list_private_connection_peering_routes 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::VmwareEngine::V1::PeeringRoute. + # p item + # end + # + def list_private_connection_peering_routes request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::ListPrivateConnectionPeeringRoutesRequest + + # Converts hash 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_private_connection_peering_routes.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::VmwareEngine::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_private_connection_peering_routes.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_private_connection_peering_routes.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vmware_engine_stub.list_private_connection_peering_routes request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @vmware_engine_stub, :list_private_connection_peering_routes, "peering_routes", 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 + + ## + # Grants the bind permission to the customer provided principal(user / + # service account) to bind their DNS zone with the intranet VPC associated + # with the project. DnsBindPermission is a global resource and location can + # only be global. + # + # @overload grant_dns_bind_permission(request, options = nil) + # Pass arguments to `grant_dns_bind_permission` via a request object, either of type + # {::Google::Cloud::VmwareEngine::V1::GrantDnsBindPermissionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VmwareEngine::V1::GrantDnsBindPermissionRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload grant_dns_bind_permission(name: nil, principal: nil, request_id: nil) + # Pass arguments to `grant_dns_bind_permission` via keyword arguments. Note that at + # least one keyword argument is 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 name of the resource which stores the users/service accounts + # having the permission to bind to the corresponding intranet VPC of the + # consumer project. DnsBindPermission is a global resource. Resource names + # are schemeless URIs that follow the conventions in + # https://cloud.google.com/apis/design/resource_names. For example: + # `projects/my-project/locations/global/dnsBindPermission` + # @param principal [::Google::Cloud::VmwareEngine::V1::Principal, ::Hash] + # Required. The consumer provided user/service account which needs to be + # granted permission to bind with the intranet VPC corresponding to the + # consumer project. + # @param request_id [::String] + # Optional. A request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server guarantees that a + # request doesn't result in creation of duplicate commitments for at least 60 + # minutes. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @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/vmware_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VmwareEngine::V1::GrantDnsBindPermissionRequest.new + # + # # Call the grant_dns_bind_permission method. + # result = client.grant_dns_bind_permission 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 grant_dns_bind_permission request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::GrantDnsBindPermissionRequest + + # Converts hash 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.grant_dns_bind_permission.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::VmwareEngine::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.grant_dns_bind_permission.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.grant_dns_bind_permission.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vmware_engine_stub.grant_dns_bind_permission 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 + + ## + # Gets all the principals having bind permission on the intranet VPC + # associated with the consumer project granted by the Grant API. + # DnsBindPermission is a global resource and location can only be global. + # + # @overload get_dns_bind_permission(request, options = nil) + # Pass arguments to `get_dns_bind_permission` via a request object, either of type + # {::Google::Cloud::VmwareEngine::V1::GetDnsBindPermissionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VmwareEngine::V1::GetDnsBindPermissionRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_dns_bind_permission(name: nil) + # Pass arguments to `get_dns_bind_permission` via keyword arguments. Note that at + # least one keyword argument is 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 name of the resource which stores the users/service accounts + # having the permission to bind to the corresponding intranet VPC of the + # consumer project. DnsBindPermission is a global resource. Resource names + # are schemeless URIs that follow the conventions in + # https://cloud.google.com/apis/design/resource_names. For example: + # `projects/my-project/locations/global/dnsBindPermission` + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::VmwareEngine::V1::DnsBindPermission] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::VmwareEngine::V1::DnsBindPermission] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/vmware_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VmwareEngine::V1::GetDnsBindPermissionRequest.new + # + # # Call the get_dns_bind_permission method. + # result = client.get_dns_bind_permission request + # + # # The returned object is of type Google::Cloud::VmwareEngine::V1::DnsBindPermission. + # p result + # + def get_dns_bind_permission request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::GetDnsBindPermissionRequest + + # Converts hash 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_dns_bind_permission.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::VmwareEngine::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_dns_bind_permission.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_dns_bind_permission.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vmware_engine_stub.get_dns_bind_permission 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 + + ## + # Revokes the bind permission from the customer provided principal(user / + # service account) on the intranet VPC associated with the consumer project. + # DnsBindPermission is a global resource and location can only be global. + # + # @overload revoke_dns_bind_permission(request, options = nil) + # Pass arguments to `revoke_dns_bind_permission` via a request object, either of type + # {::Google::Cloud::VmwareEngine::V1::RevokeDnsBindPermissionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VmwareEngine::V1::RevokeDnsBindPermissionRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload revoke_dns_bind_permission(name: nil, principal: nil, request_id: nil) + # Pass arguments to `revoke_dns_bind_permission` via keyword arguments. Note that at + # least one keyword argument is 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 name of the resource which stores the users/service accounts + # having the permission to bind to the corresponding intranet VPC of the + # consumer project. DnsBindPermission is a global resource. Resource names + # are schemeless URIs that follow the conventions in + # https://cloud.google.com/apis/design/resource_names. For example: + # `projects/my-project/locations/global/dnsBindPermission` + # @param principal [::Google::Cloud::VmwareEngine::V1::Principal, ::Hash] + # Required. The consumer provided user/service account which needs to be + # granted permission to bind with the intranet VPC corresponding to the + # consumer project. + # @param request_id [::String] + # Optional. A request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server guarantees that a + # request doesn't result in creation of duplicate commitments for at least 60 + # minutes. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @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/vmware_engine/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VmwareEngine::V1::RevokeDnsBindPermissionRequest.new + # + # # Call the revoke_dns_bind_permission method. + # result = client.revoke_dns_bind_permission 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 revoke_dns_bind_permission request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::RevokeDnsBindPermissionRequest + + # Converts hash 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.revoke_dns_bind_permission.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::VmwareEngine::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.revoke_dns_bind_permission.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.revoke_dns_bind_permission.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vmware_engine_stub.revoke_dns_bind_permission 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 + + ## + # Configuration class for the VmwareEngine REST API. + # + # This class represents the configuration for VmwareEngine 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::VmwareEngine::V1::VmwareEngine::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_private_clouds to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_private_clouds.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_private_clouds.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 = "vmwareengine.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 VmwareEngine 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_private_clouds` + # @return [::Gapic::Config::Method] + # + attr_reader :list_private_clouds + ## + # RPC-specific configuration for `get_private_cloud` + # @return [::Gapic::Config::Method] + # + attr_reader :get_private_cloud + ## + # RPC-specific configuration for `create_private_cloud` + # @return [::Gapic::Config::Method] + # + attr_reader :create_private_cloud + ## + # RPC-specific configuration for `update_private_cloud` + # @return [::Gapic::Config::Method] + # + attr_reader :update_private_cloud + ## + # RPC-specific configuration for `delete_private_cloud` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_private_cloud + ## + # RPC-specific configuration for `undelete_private_cloud` + # @return [::Gapic::Config::Method] + # + attr_reader :undelete_private_cloud + ## + # RPC-specific configuration for `list_clusters` + # @return [::Gapic::Config::Method] + # + attr_reader :list_clusters + ## + # RPC-specific configuration for `get_cluster` + # @return [::Gapic::Config::Method] + # + attr_reader :get_cluster + ## + # RPC-specific configuration for `create_cluster` + # @return [::Gapic::Config::Method] + # + attr_reader :create_cluster + ## + # RPC-specific configuration for `update_cluster` + # @return [::Gapic::Config::Method] + # + attr_reader :update_cluster + ## + # RPC-specific configuration for `delete_cluster` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_cluster + ## + # RPC-specific configuration for `list_nodes` + # @return [::Gapic::Config::Method] + # + attr_reader :list_nodes + ## + # RPC-specific configuration for `get_node` + # @return [::Gapic::Config::Method] + # + attr_reader :get_node + ## + # RPC-specific configuration for `list_external_addresses` + # @return [::Gapic::Config::Method] + # + attr_reader :list_external_addresses + ## + # RPC-specific configuration for `fetch_network_policy_external_addresses` + # @return [::Gapic::Config::Method] + # + attr_reader :fetch_network_policy_external_addresses + ## + # RPC-specific configuration for `get_external_address` + # @return [::Gapic::Config::Method] + # + attr_reader :get_external_address + ## + # RPC-specific configuration for `create_external_address` + # @return [::Gapic::Config::Method] + # + attr_reader :create_external_address + ## + # RPC-specific configuration for `update_external_address` + # @return [::Gapic::Config::Method] + # + attr_reader :update_external_address + ## + # RPC-specific configuration for `delete_external_address` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_external_address + ## + # RPC-specific configuration for `list_subnets` + # @return [::Gapic::Config::Method] + # + attr_reader :list_subnets + ## + # RPC-specific configuration for `get_subnet` + # @return [::Gapic::Config::Method] + # + attr_reader :get_subnet + ## + # RPC-specific configuration for `update_subnet` + # @return [::Gapic::Config::Method] + # + attr_reader :update_subnet + ## + # RPC-specific configuration for `list_external_access_rules` + # @return [::Gapic::Config::Method] + # + attr_reader :list_external_access_rules + ## + # RPC-specific configuration for `get_external_access_rule` + # @return [::Gapic::Config::Method] + # + attr_reader :get_external_access_rule + ## + # RPC-specific configuration for `create_external_access_rule` + # @return [::Gapic::Config::Method] + # + attr_reader :create_external_access_rule + ## + # RPC-specific configuration for `update_external_access_rule` + # @return [::Gapic::Config::Method] + # + attr_reader :update_external_access_rule + ## + # RPC-specific configuration for `delete_external_access_rule` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_external_access_rule + ## + # RPC-specific configuration for `list_logging_servers` + # @return [::Gapic::Config::Method] + # + attr_reader :list_logging_servers + ## + # RPC-specific configuration for `get_logging_server` + # @return [::Gapic::Config::Method] + # + attr_reader :get_logging_server + ## + # RPC-specific configuration for `create_logging_server` + # @return [::Gapic::Config::Method] + # + attr_reader :create_logging_server + ## + # RPC-specific configuration for `update_logging_server` + # @return [::Gapic::Config::Method] + # + attr_reader :update_logging_server + ## + # RPC-specific configuration for `delete_logging_server` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_logging_server + ## + # RPC-specific configuration for `list_node_types` + # @return [::Gapic::Config::Method] + # + attr_reader :list_node_types + ## + # RPC-specific configuration for `get_node_type` + # @return [::Gapic::Config::Method] + # + attr_reader :get_node_type + ## + # RPC-specific configuration for `show_nsx_credentials` + # @return [::Gapic::Config::Method] + # + attr_reader :show_nsx_credentials + ## + # RPC-specific configuration for `show_vcenter_credentials` + # @return [::Gapic::Config::Method] + # + attr_reader :show_vcenter_credentials + ## + # RPC-specific configuration for `reset_nsx_credentials` + # @return [::Gapic::Config::Method] + # + attr_reader :reset_nsx_credentials + ## + # RPC-specific configuration for `reset_vcenter_credentials` + # @return [::Gapic::Config::Method] + # + attr_reader :reset_vcenter_credentials + ## + # RPC-specific configuration for `get_dns_forwarding` + # @return [::Gapic::Config::Method] + # + attr_reader :get_dns_forwarding + ## + # RPC-specific configuration for `update_dns_forwarding` + # @return [::Gapic::Config::Method] + # + attr_reader :update_dns_forwarding + ## + # RPC-specific configuration for `get_network_peering` + # @return [::Gapic::Config::Method] + # + attr_reader :get_network_peering + ## + # RPC-specific configuration for `list_network_peerings` + # @return [::Gapic::Config::Method] + # + attr_reader :list_network_peerings + ## + # RPC-specific configuration for `create_network_peering` + # @return [::Gapic::Config::Method] + # + attr_reader :create_network_peering + ## + # RPC-specific configuration for `delete_network_peering` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_network_peering + ## + # RPC-specific configuration for `update_network_peering` + # @return [::Gapic::Config::Method] + # + attr_reader :update_network_peering + ## + # RPC-specific configuration for `list_peering_routes` + # @return [::Gapic::Config::Method] + # + attr_reader :list_peering_routes + ## + # RPC-specific configuration for `create_hcx_activation_key` + # @return [::Gapic::Config::Method] + # + attr_reader :create_hcx_activation_key + ## + # RPC-specific configuration for `list_hcx_activation_keys` + # @return [::Gapic::Config::Method] + # + attr_reader :list_hcx_activation_keys + ## + # RPC-specific configuration for `get_hcx_activation_key` + # @return [::Gapic::Config::Method] + # + attr_reader :get_hcx_activation_key + ## + # RPC-specific configuration for `get_network_policy` + # @return [::Gapic::Config::Method] + # + attr_reader :get_network_policy + ## + # RPC-specific configuration for `list_network_policies` + # @return [::Gapic::Config::Method] + # + attr_reader :list_network_policies + ## + # RPC-specific configuration for `create_network_policy` + # @return [::Gapic::Config::Method] + # + attr_reader :create_network_policy + ## + # RPC-specific configuration for `update_network_policy` + # @return [::Gapic::Config::Method] + # + attr_reader :update_network_policy + ## + # RPC-specific configuration for `delete_network_policy` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_network_policy + ## + # RPC-specific configuration for `list_management_dns_zone_bindings` + # @return [::Gapic::Config::Method] + # + attr_reader :list_management_dns_zone_bindings + ## + # RPC-specific configuration for `get_management_dns_zone_binding` + # @return [::Gapic::Config::Method] + # + attr_reader :get_management_dns_zone_binding + ## + # RPC-specific configuration for `create_management_dns_zone_binding` + # @return [::Gapic::Config::Method] + # + attr_reader :create_management_dns_zone_binding + ## + # RPC-specific configuration for `update_management_dns_zone_binding` + # @return [::Gapic::Config::Method] + # + attr_reader :update_management_dns_zone_binding + ## + # RPC-specific configuration for `delete_management_dns_zone_binding` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_management_dns_zone_binding + ## + # RPC-specific configuration for `repair_management_dns_zone_binding` + # @return [::Gapic::Config::Method] + # + attr_reader :repair_management_dns_zone_binding + ## + # RPC-specific configuration for `create_vmware_engine_network` + # @return [::Gapic::Config::Method] + # + attr_reader :create_vmware_engine_network + ## + # RPC-specific configuration for `update_vmware_engine_network` + # @return [::Gapic::Config::Method] + # + attr_reader :update_vmware_engine_network + ## + # RPC-specific configuration for `delete_vmware_engine_network` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_vmware_engine_network + ## + # RPC-specific configuration for `get_vmware_engine_network` + # @return [::Gapic::Config::Method] + # + attr_reader :get_vmware_engine_network + ## + # RPC-specific configuration for `list_vmware_engine_networks` + # @return [::Gapic::Config::Method] + # + attr_reader :list_vmware_engine_networks + ## + # RPC-specific configuration for `create_private_connection` + # @return [::Gapic::Config::Method] + # + attr_reader :create_private_connection + ## + # RPC-specific configuration for `get_private_connection` + # @return [::Gapic::Config::Method] + # + attr_reader :get_private_connection + ## + # RPC-specific configuration for `list_private_connections` + # @return [::Gapic::Config::Method] + # + attr_reader :list_private_connections + ## + # RPC-specific configuration for `update_private_connection` + # @return [::Gapic::Config::Method] + # + attr_reader :update_private_connection + ## + # RPC-specific configuration for `delete_private_connection` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_private_connection + ## + # RPC-specific configuration for `list_private_connection_peering_routes` + # @return [::Gapic::Config::Method] + # + attr_reader :list_private_connection_peering_routes + ## + # RPC-specific configuration for `grant_dns_bind_permission` + # @return [::Gapic::Config::Method] + # + attr_reader :grant_dns_bind_permission + ## + # RPC-specific configuration for `get_dns_bind_permission` + # @return [::Gapic::Config::Method] + # + attr_reader :get_dns_bind_permission + ## + # RPC-specific configuration for `revoke_dns_bind_permission` + # @return [::Gapic::Config::Method] + # + attr_reader :revoke_dns_bind_permission + + # @private + def initialize parent_rpcs = nil + list_private_clouds_config = parent_rpcs.list_private_clouds if parent_rpcs.respond_to? :list_private_clouds + @list_private_clouds = ::Gapic::Config::Method.new list_private_clouds_config + get_private_cloud_config = parent_rpcs.get_private_cloud if parent_rpcs.respond_to? :get_private_cloud + @get_private_cloud = ::Gapic::Config::Method.new get_private_cloud_config + create_private_cloud_config = parent_rpcs.create_private_cloud if parent_rpcs.respond_to? :create_private_cloud + @create_private_cloud = ::Gapic::Config::Method.new create_private_cloud_config + update_private_cloud_config = parent_rpcs.update_private_cloud if parent_rpcs.respond_to? :update_private_cloud + @update_private_cloud = ::Gapic::Config::Method.new update_private_cloud_config + delete_private_cloud_config = parent_rpcs.delete_private_cloud if parent_rpcs.respond_to? :delete_private_cloud + @delete_private_cloud = ::Gapic::Config::Method.new delete_private_cloud_config + undelete_private_cloud_config = parent_rpcs.undelete_private_cloud if parent_rpcs.respond_to? :undelete_private_cloud + @undelete_private_cloud = ::Gapic::Config::Method.new undelete_private_cloud_config + list_clusters_config = parent_rpcs.list_clusters if parent_rpcs.respond_to? :list_clusters + @list_clusters = ::Gapic::Config::Method.new list_clusters_config + get_cluster_config = parent_rpcs.get_cluster if parent_rpcs.respond_to? :get_cluster + @get_cluster = ::Gapic::Config::Method.new get_cluster_config + create_cluster_config = parent_rpcs.create_cluster if parent_rpcs.respond_to? :create_cluster + @create_cluster = ::Gapic::Config::Method.new create_cluster_config + update_cluster_config = parent_rpcs.update_cluster if parent_rpcs.respond_to? :update_cluster + @update_cluster = ::Gapic::Config::Method.new update_cluster_config + delete_cluster_config = parent_rpcs.delete_cluster if parent_rpcs.respond_to? :delete_cluster + @delete_cluster = ::Gapic::Config::Method.new delete_cluster_config + list_nodes_config = parent_rpcs.list_nodes if parent_rpcs.respond_to? :list_nodes + @list_nodes = ::Gapic::Config::Method.new list_nodes_config + get_node_config = parent_rpcs.get_node if parent_rpcs.respond_to? :get_node + @get_node = ::Gapic::Config::Method.new get_node_config + list_external_addresses_config = parent_rpcs.list_external_addresses if parent_rpcs.respond_to? :list_external_addresses + @list_external_addresses = ::Gapic::Config::Method.new list_external_addresses_config + fetch_network_policy_external_addresses_config = parent_rpcs.fetch_network_policy_external_addresses if parent_rpcs.respond_to? :fetch_network_policy_external_addresses + @fetch_network_policy_external_addresses = ::Gapic::Config::Method.new fetch_network_policy_external_addresses_config + get_external_address_config = parent_rpcs.get_external_address if parent_rpcs.respond_to? :get_external_address + @get_external_address = ::Gapic::Config::Method.new get_external_address_config + create_external_address_config = parent_rpcs.create_external_address if parent_rpcs.respond_to? :create_external_address + @create_external_address = ::Gapic::Config::Method.new create_external_address_config + update_external_address_config = parent_rpcs.update_external_address if parent_rpcs.respond_to? :update_external_address + @update_external_address = ::Gapic::Config::Method.new update_external_address_config + delete_external_address_config = parent_rpcs.delete_external_address if parent_rpcs.respond_to? :delete_external_address + @delete_external_address = ::Gapic::Config::Method.new delete_external_address_config + list_subnets_config = parent_rpcs.list_subnets if parent_rpcs.respond_to? :list_subnets + @list_subnets = ::Gapic::Config::Method.new list_subnets_config + get_subnet_config = parent_rpcs.get_subnet if parent_rpcs.respond_to? :get_subnet + @get_subnet = ::Gapic::Config::Method.new get_subnet_config + update_subnet_config = parent_rpcs.update_subnet if parent_rpcs.respond_to? :update_subnet + @update_subnet = ::Gapic::Config::Method.new update_subnet_config + list_external_access_rules_config = parent_rpcs.list_external_access_rules if parent_rpcs.respond_to? :list_external_access_rules + @list_external_access_rules = ::Gapic::Config::Method.new list_external_access_rules_config + get_external_access_rule_config = parent_rpcs.get_external_access_rule if parent_rpcs.respond_to? :get_external_access_rule + @get_external_access_rule = ::Gapic::Config::Method.new get_external_access_rule_config + create_external_access_rule_config = parent_rpcs.create_external_access_rule if parent_rpcs.respond_to? :create_external_access_rule + @create_external_access_rule = ::Gapic::Config::Method.new create_external_access_rule_config + update_external_access_rule_config = parent_rpcs.update_external_access_rule if parent_rpcs.respond_to? :update_external_access_rule + @update_external_access_rule = ::Gapic::Config::Method.new update_external_access_rule_config + delete_external_access_rule_config = parent_rpcs.delete_external_access_rule if parent_rpcs.respond_to? :delete_external_access_rule + @delete_external_access_rule = ::Gapic::Config::Method.new delete_external_access_rule_config + list_logging_servers_config = parent_rpcs.list_logging_servers if parent_rpcs.respond_to? :list_logging_servers + @list_logging_servers = ::Gapic::Config::Method.new list_logging_servers_config + get_logging_server_config = parent_rpcs.get_logging_server if parent_rpcs.respond_to? :get_logging_server + @get_logging_server = ::Gapic::Config::Method.new get_logging_server_config + create_logging_server_config = parent_rpcs.create_logging_server if parent_rpcs.respond_to? :create_logging_server + @create_logging_server = ::Gapic::Config::Method.new create_logging_server_config + update_logging_server_config = parent_rpcs.update_logging_server if parent_rpcs.respond_to? :update_logging_server + @update_logging_server = ::Gapic::Config::Method.new update_logging_server_config + delete_logging_server_config = parent_rpcs.delete_logging_server if parent_rpcs.respond_to? :delete_logging_server + @delete_logging_server = ::Gapic::Config::Method.new delete_logging_server_config + list_node_types_config = parent_rpcs.list_node_types if parent_rpcs.respond_to? :list_node_types + @list_node_types = ::Gapic::Config::Method.new list_node_types_config + get_node_type_config = parent_rpcs.get_node_type if parent_rpcs.respond_to? :get_node_type + @get_node_type = ::Gapic::Config::Method.new get_node_type_config + show_nsx_credentials_config = parent_rpcs.show_nsx_credentials if parent_rpcs.respond_to? :show_nsx_credentials + @show_nsx_credentials = ::Gapic::Config::Method.new show_nsx_credentials_config + show_vcenter_credentials_config = parent_rpcs.show_vcenter_credentials if parent_rpcs.respond_to? :show_vcenter_credentials + @show_vcenter_credentials = ::Gapic::Config::Method.new show_vcenter_credentials_config + reset_nsx_credentials_config = parent_rpcs.reset_nsx_credentials if parent_rpcs.respond_to? :reset_nsx_credentials + @reset_nsx_credentials = ::Gapic::Config::Method.new reset_nsx_credentials_config + reset_vcenter_credentials_config = parent_rpcs.reset_vcenter_credentials if parent_rpcs.respond_to? :reset_vcenter_credentials + @reset_vcenter_credentials = ::Gapic::Config::Method.new reset_vcenter_credentials_config + get_dns_forwarding_config = parent_rpcs.get_dns_forwarding if parent_rpcs.respond_to? :get_dns_forwarding + @get_dns_forwarding = ::Gapic::Config::Method.new get_dns_forwarding_config + update_dns_forwarding_config = parent_rpcs.update_dns_forwarding if parent_rpcs.respond_to? :update_dns_forwarding + @update_dns_forwarding = ::Gapic::Config::Method.new update_dns_forwarding_config + get_network_peering_config = parent_rpcs.get_network_peering if parent_rpcs.respond_to? :get_network_peering + @get_network_peering = ::Gapic::Config::Method.new get_network_peering_config + list_network_peerings_config = parent_rpcs.list_network_peerings if parent_rpcs.respond_to? :list_network_peerings + @list_network_peerings = ::Gapic::Config::Method.new list_network_peerings_config + create_network_peering_config = parent_rpcs.create_network_peering if parent_rpcs.respond_to? :create_network_peering + @create_network_peering = ::Gapic::Config::Method.new create_network_peering_config + delete_network_peering_config = parent_rpcs.delete_network_peering if parent_rpcs.respond_to? :delete_network_peering + @delete_network_peering = ::Gapic::Config::Method.new delete_network_peering_config + update_network_peering_config = parent_rpcs.update_network_peering if parent_rpcs.respond_to? :update_network_peering + @update_network_peering = ::Gapic::Config::Method.new update_network_peering_config + list_peering_routes_config = parent_rpcs.list_peering_routes if parent_rpcs.respond_to? :list_peering_routes + @list_peering_routes = ::Gapic::Config::Method.new list_peering_routes_config + create_hcx_activation_key_config = parent_rpcs.create_hcx_activation_key if parent_rpcs.respond_to? :create_hcx_activation_key + @create_hcx_activation_key = ::Gapic::Config::Method.new create_hcx_activation_key_config + list_hcx_activation_keys_config = parent_rpcs.list_hcx_activation_keys if parent_rpcs.respond_to? :list_hcx_activation_keys + @list_hcx_activation_keys = ::Gapic::Config::Method.new list_hcx_activation_keys_config + get_hcx_activation_key_config = parent_rpcs.get_hcx_activation_key if parent_rpcs.respond_to? :get_hcx_activation_key + @get_hcx_activation_key = ::Gapic::Config::Method.new get_hcx_activation_key_config + get_network_policy_config = parent_rpcs.get_network_policy if parent_rpcs.respond_to? :get_network_policy + @get_network_policy = ::Gapic::Config::Method.new get_network_policy_config + list_network_policies_config = parent_rpcs.list_network_policies if parent_rpcs.respond_to? :list_network_policies + @list_network_policies = ::Gapic::Config::Method.new list_network_policies_config + create_network_policy_config = parent_rpcs.create_network_policy if parent_rpcs.respond_to? :create_network_policy + @create_network_policy = ::Gapic::Config::Method.new create_network_policy_config + update_network_policy_config = parent_rpcs.update_network_policy if parent_rpcs.respond_to? :update_network_policy + @update_network_policy = ::Gapic::Config::Method.new update_network_policy_config + delete_network_policy_config = parent_rpcs.delete_network_policy if parent_rpcs.respond_to? :delete_network_policy + @delete_network_policy = ::Gapic::Config::Method.new delete_network_policy_config + list_management_dns_zone_bindings_config = parent_rpcs.list_management_dns_zone_bindings if parent_rpcs.respond_to? :list_management_dns_zone_bindings + @list_management_dns_zone_bindings = ::Gapic::Config::Method.new list_management_dns_zone_bindings_config + get_management_dns_zone_binding_config = parent_rpcs.get_management_dns_zone_binding if parent_rpcs.respond_to? :get_management_dns_zone_binding + @get_management_dns_zone_binding = ::Gapic::Config::Method.new get_management_dns_zone_binding_config + create_management_dns_zone_binding_config = parent_rpcs.create_management_dns_zone_binding if parent_rpcs.respond_to? :create_management_dns_zone_binding + @create_management_dns_zone_binding = ::Gapic::Config::Method.new create_management_dns_zone_binding_config + update_management_dns_zone_binding_config = parent_rpcs.update_management_dns_zone_binding if parent_rpcs.respond_to? :update_management_dns_zone_binding + @update_management_dns_zone_binding = ::Gapic::Config::Method.new update_management_dns_zone_binding_config + delete_management_dns_zone_binding_config = parent_rpcs.delete_management_dns_zone_binding if parent_rpcs.respond_to? :delete_management_dns_zone_binding + @delete_management_dns_zone_binding = ::Gapic::Config::Method.new delete_management_dns_zone_binding_config + repair_management_dns_zone_binding_config = parent_rpcs.repair_management_dns_zone_binding if parent_rpcs.respond_to? :repair_management_dns_zone_binding + @repair_management_dns_zone_binding = ::Gapic::Config::Method.new repair_management_dns_zone_binding_config + create_vmware_engine_network_config = parent_rpcs.create_vmware_engine_network if parent_rpcs.respond_to? :create_vmware_engine_network + @create_vmware_engine_network = ::Gapic::Config::Method.new create_vmware_engine_network_config + update_vmware_engine_network_config = parent_rpcs.update_vmware_engine_network if parent_rpcs.respond_to? :update_vmware_engine_network + @update_vmware_engine_network = ::Gapic::Config::Method.new update_vmware_engine_network_config + delete_vmware_engine_network_config = parent_rpcs.delete_vmware_engine_network if parent_rpcs.respond_to? :delete_vmware_engine_network + @delete_vmware_engine_network = ::Gapic::Config::Method.new delete_vmware_engine_network_config + get_vmware_engine_network_config = parent_rpcs.get_vmware_engine_network if parent_rpcs.respond_to? :get_vmware_engine_network + @get_vmware_engine_network = ::Gapic::Config::Method.new get_vmware_engine_network_config + list_vmware_engine_networks_config = parent_rpcs.list_vmware_engine_networks if parent_rpcs.respond_to? :list_vmware_engine_networks + @list_vmware_engine_networks = ::Gapic::Config::Method.new list_vmware_engine_networks_config + create_private_connection_config = parent_rpcs.create_private_connection if parent_rpcs.respond_to? :create_private_connection + @create_private_connection = ::Gapic::Config::Method.new create_private_connection_config + get_private_connection_config = parent_rpcs.get_private_connection if parent_rpcs.respond_to? :get_private_connection + @get_private_connection = ::Gapic::Config::Method.new get_private_connection_config + list_private_connections_config = parent_rpcs.list_private_connections if parent_rpcs.respond_to? :list_private_connections + @list_private_connections = ::Gapic::Config::Method.new list_private_connections_config + update_private_connection_config = parent_rpcs.update_private_connection if parent_rpcs.respond_to? :update_private_connection + @update_private_connection = ::Gapic::Config::Method.new update_private_connection_config + delete_private_connection_config = parent_rpcs.delete_private_connection if parent_rpcs.respond_to? :delete_private_connection + @delete_private_connection = ::Gapic::Config::Method.new delete_private_connection_config + list_private_connection_peering_routes_config = parent_rpcs.list_private_connection_peering_routes if parent_rpcs.respond_to? :list_private_connection_peering_routes + @list_private_connection_peering_routes = ::Gapic::Config::Method.new list_private_connection_peering_routes_config + grant_dns_bind_permission_config = parent_rpcs.grant_dns_bind_permission if parent_rpcs.respond_to? :grant_dns_bind_permission + @grant_dns_bind_permission = ::Gapic::Config::Method.new grant_dns_bind_permission_config + get_dns_bind_permission_config = parent_rpcs.get_dns_bind_permission if parent_rpcs.respond_to? :get_dns_bind_permission + @get_dns_bind_permission = ::Gapic::Config::Method.new get_dns_bind_permission_config + revoke_dns_bind_permission_config = parent_rpcs.revoke_dns_bind_permission if parent_rpcs.respond_to? :revoke_dns_bind_permission + @revoke_dns_bind_permission = ::Gapic::Config::Method.new revoke_dns_bind_permission_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-vmware_engine-v1/lib/google/cloud/vmware_engine/v1/vmware_engine/rest/operations.rb b/owl-bot-staging/google-cloud-vmware_engine-v1/lib/google/cloud/vmware_engine/v1/vmware_engine/rest/operations.rb new file mode 100644 index 000000000000..81efa22fb432 --- /dev/null +++ b/owl-bot-staging/google-cloud-vmware_engine-v1/lib/google/cloud/vmware_engine/v1/vmware_engine/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 VmwareEngine + module V1 + module VmwareEngine + module Rest + # Service that implements Longrunning Operations API. + class Operations + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "vmwareengine.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :operations_stub + + ## + # Configuration for the VmwareEngine 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 VmwareEngine 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::VmwareEngine::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::VmwareEngine::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::VmwareEngine::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::VmwareEngine::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 = "vmwareengine.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}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/?$}, 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{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + 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-vmware_engine-v1/lib/google/cloud/vmware_engine/v1/vmware_engine/rest/service_stub.rb b/owl-bot-staging/google-cloud-vmware_engine-v1/lib/google/cloud/vmware_engine/v1/vmware_engine/rest/service_stub.rb new file mode 100644 index 000000000000..90096c6693c3 --- /dev/null +++ b/owl-bot-staging/google-cloud-vmware_engine-v1/lib/google/cloud/vmware_engine/v1/vmware_engine/rest/service_stub.rb @@ -0,0 +1,4624 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/vmwareengine/v1/vmwareengine_pb" + +module Google + module Cloud + module VmwareEngine + module V1 + module VmwareEngine + module Rest + ## + # REST service stub for the VmwareEngine 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_private_clouds REST call + # + # @param request_pb [::Google::Cloud::VmwareEngine::V1::ListPrivateCloudsRequest] + # 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::VmwareEngine::V1::ListPrivateCloudsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::VmwareEngine::V1::ListPrivateCloudsResponse] + # A result object deserialized from the server's reply + def list_private_clouds request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_private_clouds_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_private_clouds", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::VmwareEngine::V1::ListPrivateCloudsResponse.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_private_cloud REST call + # + # @param request_pb [::Google::Cloud::VmwareEngine::V1::GetPrivateCloudRequest] + # 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::VmwareEngine::V1::PrivateCloud] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::VmwareEngine::V1::PrivateCloud] + # A result object deserialized from the server's reply + def get_private_cloud request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_private_cloud_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_private_cloud", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::VmwareEngine::V1::PrivateCloud.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_private_cloud REST call + # + # @param request_pb [::Google::Cloud::VmwareEngine::V1::CreatePrivateCloudRequest] + # 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_private_cloud request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_private_cloud_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_private_cloud", + 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 update_private_cloud REST call + # + # @param request_pb [::Google::Cloud::VmwareEngine::V1::UpdatePrivateCloudRequest] + # 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 update_private_cloud request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_private_cloud_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_private_cloud", + 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_private_cloud REST call + # + # @param request_pb [::Google::Cloud::VmwareEngine::V1::DeletePrivateCloudRequest] + # 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_private_cloud request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_private_cloud_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_private_cloud", + 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 undelete_private_cloud REST call + # + # @param request_pb [::Google::Cloud::VmwareEngine::V1::UndeletePrivateCloudRequest] + # 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 undelete_private_cloud request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_undelete_private_cloud_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: "undelete_private_cloud", + 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 list_clusters REST call + # + # @param request_pb [::Google::Cloud::VmwareEngine::V1::ListClustersRequest] + # 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::VmwareEngine::V1::ListClustersResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::VmwareEngine::V1::ListClustersResponse] + # A result object deserialized from the server's reply + def list_clusters request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_clusters_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_clusters", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::VmwareEngine::V1::ListClustersResponse.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_cluster REST call + # + # @param request_pb [::Google::Cloud::VmwareEngine::V1::GetClusterRequest] + # 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::VmwareEngine::V1::Cluster] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::VmwareEngine::V1::Cluster] + # A result object deserialized from the server's reply + def get_cluster request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_cluster_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_cluster", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::VmwareEngine::V1::Cluster.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_cluster REST call + # + # @param request_pb [::Google::Cloud::VmwareEngine::V1::CreateClusterRequest] + # 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_cluster request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_cluster_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_cluster", + 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 update_cluster REST call + # + # @param request_pb [::Google::Cloud::VmwareEngine::V1::UpdateClusterRequest] + # 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 update_cluster request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_cluster_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_cluster", + 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_cluster REST call + # + # @param request_pb [::Google::Cloud::VmwareEngine::V1::DeleteClusterRequest] + # 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_cluster request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_cluster_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_cluster", + 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 list_nodes REST call + # + # @param request_pb [::Google::Cloud::VmwareEngine::V1::ListNodesRequest] + # 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::VmwareEngine::V1::ListNodesResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::VmwareEngine::V1::ListNodesResponse] + # A result object deserialized from the server's reply + def list_nodes request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_nodes_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_nodes", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::VmwareEngine::V1::ListNodesResponse.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_node REST call + # + # @param request_pb [::Google::Cloud::VmwareEngine::V1::GetNodeRequest] + # 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::VmwareEngine::V1::Node] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::VmwareEngine::V1::Node] + # A result object deserialized from the server's reply + def get_node request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_node_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_node", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::VmwareEngine::V1::Node.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_external_addresses REST call + # + # @param request_pb [::Google::Cloud::VmwareEngine::V1::ListExternalAddressesRequest] + # 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::VmwareEngine::V1::ListExternalAddressesResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::VmwareEngine::V1::ListExternalAddressesResponse] + # A result object deserialized from the server's reply + def list_external_addresses request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_external_addresses_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_external_addresses", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::VmwareEngine::V1::ListExternalAddressesResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the fetch_network_policy_external_addresses REST call + # + # @param request_pb [::Google::Cloud::VmwareEngine::V1::FetchNetworkPolicyExternalAddressesRequest] + # 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::VmwareEngine::V1::FetchNetworkPolicyExternalAddressesResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::VmwareEngine::V1::FetchNetworkPolicyExternalAddressesResponse] + # A result object deserialized from the server's reply + def fetch_network_policy_external_addresses request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_fetch_network_policy_external_addresses_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: "fetch_network_policy_external_addresses", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::VmwareEngine::V1::FetchNetworkPolicyExternalAddressesResponse.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_external_address REST call + # + # @param request_pb [::Google::Cloud::VmwareEngine::V1::GetExternalAddressRequest] + # 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::VmwareEngine::V1::ExternalAddress] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::VmwareEngine::V1::ExternalAddress] + # A result object deserialized from the server's reply + def get_external_address request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_external_address_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_external_address", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::VmwareEngine::V1::ExternalAddress.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_external_address REST call + # + # @param request_pb [::Google::Cloud::VmwareEngine::V1::CreateExternalAddressRequest] + # 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_external_address request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_external_address_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_external_address", + 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 update_external_address REST call + # + # @param request_pb [::Google::Cloud::VmwareEngine::V1::UpdateExternalAddressRequest] + # 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 update_external_address request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_external_address_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_external_address", + 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_external_address REST call + # + # @param request_pb [::Google::Cloud::VmwareEngine::V1::DeleteExternalAddressRequest] + # 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_external_address request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_external_address_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_external_address", + 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 list_subnets REST call + # + # @param request_pb [::Google::Cloud::VmwareEngine::V1::ListSubnetsRequest] + # 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::VmwareEngine::V1::ListSubnetsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::VmwareEngine::V1::ListSubnetsResponse] + # A result object deserialized from the server's reply + def list_subnets request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_subnets_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_subnets", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::VmwareEngine::V1::ListSubnetsResponse.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_subnet REST call + # + # @param request_pb [::Google::Cloud::VmwareEngine::V1::GetSubnetRequest] + # 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::VmwareEngine::V1::Subnet] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::VmwareEngine::V1::Subnet] + # A result object deserialized from the server's reply + def get_subnet request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_subnet_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_subnet", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::VmwareEngine::V1::Subnet.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_subnet REST call + # + # @param request_pb [::Google::Cloud::VmwareEngine::V1::UpdateSubnetRequest] + # 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 update_subnet request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_subnet_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_subnet", + 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 list_external_access_rules REST call + # + # @param request_pb [::Google::Cloud::VmwareEngine::V1::ListExternalAccessRulesRequest] + # 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::VmwareEngine::V1::ListExternalAccessRulesResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::VmwareEngine::V1::ListExternalAccessRulesResponse] + # A result object deserialized from the server's reply + def list_external_access_rules request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_external_access_rules_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_external_access_rules", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::VmwareEngine::V1::ListExternalAccessRulesResponse.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_external_access_rule REST call + # + # @param request_pb [::Google::Cloud::VmwareEngine::V1::GetExternalAccessRuleRequest] + # 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::VmwareEngine::V1::ExternalAccessRule] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::VmwareEngine::V1::ExternalAccessRule] + # A result object deserialized from the server's reply + def get_external_access_rule request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_external_access_rule_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_external_access_rule", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::VmwareEngine::V1::ExternalAccessRule.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_external_access_rule REST call + # + # @param request_pb [::Google::Cloud::VmwareEngine::V1::CreateExternalAccessRuleRequest] + # 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_external_access_rule request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_external_access_rule_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_external_access_rule", + 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 update_external_access_rule REST call + # + # @param request_pb [::Google::Cloud::VmwareEngine::V1::UpdateExternalAccessRuleRequest] + # 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 update_external_access_rule request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_external_access_rule_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_external_access_rule", + 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_external_access_rule REST call + # + # @param request_pb [::Google::Cloud::VmwareEngine::V1::DeleteExternalAccessRuleRequest] + # 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_external_access_rule request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_external_access_rule_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_external_access_rule", + 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 list_logging_servers REST call + # + # @param request_pb [::Google::Cloud::VmwareEngine::V1::ListLoggingServersRequest] + # 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::VmwareEngine::V1::ListLoggingServersResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::VmwareEngine::V1::ListLoggingServersResponse] + # A result object deserialized from the server's reply + def list_logging_servers request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_logging_servers_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_logging_servers", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::VmwareEngine::V1::ListLoggingServersResponse.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_logging_server REST call + # + # @param request_pb [::Google::Cloud::VmwareEngine::V1::GetLoggingServerRequest] + # 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::VmwareEngine::V1::LoggingServer] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::VmwareEngine::V1::LoggingServer] + # A result object deserialized from the server's reply + def get_logging_server request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_logging_server_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_logging_server", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::VmwareEngine::V1::LoggingServer.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_logging_server REST call + # + # @param request_pb [::Google::Cloud::VmwareEngine::V1::CreateLoggingServerRequest] + # 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_logging_server request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_logging_server_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_logging_server", + 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 update_logging_server REST call + # + # @param request_pb [::Google::Cloud::VmwareEngine::V1::UpdateLoggingServerRequest] + # 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 update_logging_server request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_logging_server_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_logging_server", + 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_logging_server REST call + # + # @param request_pb [::Google::Cloud::VmwareEngine::V1::DeleteLoggingServerRequest] + # 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_logging_server request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_logging_server_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_logging_server", + 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 list_node_types REST call + # + # @param request_pb [::Google::Cloud::VmwareEngine::V1::ListNodeTypesRequest] + # 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::VmwareEngine::V1::ListNodeTypesResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::VmwareEngine::V1::ListNodeTypesResponse] + # A result object deserialized from the server's reply + def list_node_types request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_node_types_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_node_types", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::VmwareEngine::V1::ListNodeTypesResponse.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_node_type REST call + # + # @param request_pb [::Google::Cloud::VmwareEngine::V1::GetNodeTypeRequest] + # 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::VmwareEngine::V1::NodeType] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::VmwareEngine::V1::NodeType] + # A result object deserialized from the server's reply + def get_node_type request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_node_type_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_node_type", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::VmwareEngine::V1::NodeType.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_nsx_credentials REST call + # + # @param request_pb [::Google::Cloud::VmwareEngine::V1::ShowNsxCredentialsRequest] + # 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::VmwareEngine::V1::Credentials] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::VmwareEngine::V1::Credentials] + # A result object deserialized from the server's reply + def show_nsx_credentials request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_show_nsx_credentials_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_nsx_credentials", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::VmwareEngine::V1::Credentials.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_vcenter_credentials REST call + # + # @param request_pb [::Google::Cloud::VmwareEngine::V1::ShowVcenterCredentialsRequest] + # 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::VmwareEngine::V1::Credentials] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::VmwareEngine::V1::Credentials] + # A result object deserialized from the server's reply + def show_vcenter_credentials request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_show_vcenter_credentials_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_vcenter_credentials", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::VmwareEngine::V1::Credentials.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the reset_nsx_credentials REST call + # + # @param request_pb [::Google::Cloud::VmwareEngine::V1::ResetNsxCredentialsRequest] + # 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 reset_nsx_credentials request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_reset_nsx_credentials_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: "reset_nsx_credentials", + 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 reset_vcenter_credentials REST call + # + # @param request_pb [::Google::Cloud::VmwareEngine::V1::ResetVcenterCredentialsRequest] + # 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 reset_vcenter_credentials request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_reset_vcenter_credentials_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: "reset_vcenter_credentials", + 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_dns_forwarding REST call + # + # @param request_pb [::Google::Cloud::VmwareEngine::V1::GetDnsForwardingRequest] + # 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::VmwareEngine::V1::DnsForwarding] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::VmwareEngine::V1::DnsForwarding] + # A result object deserialized from the server's reply + def get_dns_forwarding request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_dns_forwarding_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_dns_forwarding", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::VmwareEngine::V1::DnsForwarding.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_dns_forwarding REST call + # + # @param request_pb [::Google::Cloud::VmwareEngine::V1::UpdateDnsForwardingRequest] + # 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 update_dns_forwarding request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_dns_forwarding_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_dns_forwarding", + 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_network_peering REST call + # + # @param request_pb [::Google::Cloud::VmwareEngine::V1::GetNetworkPeeringRequest] + # 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::VmwareEngine::V1::NetworkPeering] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::VmwareEngine::V1::NetworkPeering] + # A result object deserialized from the server's reply + def get_network_peering request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_network_peering_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_network_peering", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::VmwareEngine::V1::NetworkPeering.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_network_peerings REST call + # + # @param request_pb [::Google::Cloud::VmwareEngine::V1::ListNetworkPeeringsRequest] + # 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::VmwareEngine::V1::ListNetworkPeeringsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::VmwareEngine::V1::ListNetworkPeeringsResponse] + # A result object deserialized from the server's reply + def list_network_peerings request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_network_peerings_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_network_peerings", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::VmwareEngine::V1::ListNetworkPeeringsResponse.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_network_peering REST call + # + # @param request_pb [::Google::Cloud::VmwareEngine::V1::CreateNetworkPeeringRequest] + # 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_network_peering request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_network_peering_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_network_peering", + 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_network_peering REST call + # + # @param request_pb [::Google::Cloud::VmwareEngine::V1::DeleteNetworkPeeringRequest] + # 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_network_peering request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_network_peering_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_network_peering", + 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 update_network_peering REST call + # + # @param request_pb [::Google::Cloud::VmwareEngine::V1::UpdateNetworkPeeringRequest] + # 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 update_network_peering request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_network_peering_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_network_peering", + 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 list_peering_routes REST call + # + # @param request_pb [::Google::Cloud::VmwareEngine::V1::ListPeeringRoutesRequest] + # 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::VmwareEngine::V1::ListPeeringRoutesResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::VmwareEngine::V1::ListPeeringRoutesResponse] + # A result object deserialized from the server's reply + def list_peering_routes request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_peering_routes_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_peering_routes", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::VmwareEngine::V1::ListPeeringRoutesResponse.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_hcx_activation_key REST call + # + # @param request_pb [::Google::Cloud::VmwareEngine::V1::CreateHcxActivationKeyRequest] + # 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_hcx_activation_key request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_hcx_activation_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_hcx_activation_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 list_hcx_activation_keys REST call + # + # @param request_pb [::Google::Cloud::VmwareEngine::V1::ListHcxActivationKeysRequest] + # 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::VmwareEngine::V1::ListHcxActivationKeysResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::VmwareEngine::V1::ListHcxActivationKeysResponse] + # A result object deserialized from the server's reply + def list_hcx_activation_keys request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_hcx_activation_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_hcx_activation_keys", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::VmwareEngine::V1::ListHcxActivationKeysResponse.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_hcx_activation_key REST call + # + # @param request_pb [::Google::Cloud::VmwareEngine::V1::GetHcxActivationKeyRequest] + # 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::VmwareEngine::V1::HcxActivationKey] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::VmwareEngine::V1::HcxActivationKey] + # A result object deserialized from the server's reply + def get_hcx_activation_key request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_hcx_activation_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_hcx_activation_key", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::VmwareEngine::V1::HcxActivationKey.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_network_policy REST call + # + # @param request_pb [::Google::Cloud::VmwareEngine::V1::GetNetworkPolicyRequest] + # 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::VmwareEngine::V1::NetworkPolicy] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::VmwareEngine::V1::NetworkPolicy] + # A result object deserialized from the server's reply + def get_network_policy request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_network_policy_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_network_policy", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::VmwareEngine::V1::NetworkPolicy.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_network_policies REST call + # + # @param request_pb [::Google::Cloud::VmwareEngine::V1::ListNetworkPoliciesRequest] + # 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::VmwareEngine::V1::ListNetworkPoliciesResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::VmwareEngine::V1::ListNetworkPoliciesResponse] + # A result object deserialized from the server's reply + def list_network_policies request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_network_policies_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_network_policies", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::VmwareEngine::V1::ListNetworkPoliciesResponse.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_network_policy REST call + # + # @param request_pb [::Google::Cloud::VmwareEngine::V1::CreateNetworkPolicyRequest] + # 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_network_policy request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_network_policy_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_network_policy", + 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 update_network_policy REST call + # + # @param request_pb [::Google::Cloud::VmwareEngine::V1::UpdateNetworkPolicyRequest] + # 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 update_network_policy request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_network_policy_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_network_policy", + 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_network_policy REST call + # + # @param request_pb [::Google::Cloud::VmwareEngine::V1::DeleteNetworkPolicyRequest] + # 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_network_policy request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_network_policy_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_network_policy", + 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 list_management_dns_zone_bindings REST call + # + # @param request_pb [::Google::Cloud::VmwareEngine::V1::ListManagementDnsZoneBindingsRequest] + # 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::VmwareEngine::V1::ListManagementDnsZoneBindingsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::VmwareEngine::V1::ListManagementDnsZoneBindingsResponse] + # A result object deserialized from the server's reply + def list_management_dns_zone_bindings request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_management_dns_zone_bindings_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_management_dns_zone_bindings", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::VmwareEngine::V1::ListManagementDnsZoneBindingsResponse.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_management_dns_zone_binding REST call + # + # @param request_pb [::Google::Cloud::VmwareEngine::V1::GetManagementDnsZoneBindingRequest] + # 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::VmwareEngine::V1::ManagementDnsZoneBinding] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::VmwareEngine::V1::ManagementDnsZoneBinding] + # A result object deserialized from the server's reply + def get_management_dns_zone_binding request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_management_dns_zone_binding_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_management_dns_zone_binding", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::VmwareEngine::V1::ManagementDnsZoneBinding.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_management_dns_zone_binding REST call + # + # @param request_pb [::Google::Cloud::VmwareEngine::V1::CreateManagementDnsZoneBindingRequest] + # 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_management_dns_zone_binding request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_management_dns_zone_binding_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_management_dns_zone_binding", + 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 update_management_dns_zone_binding REST call + # + # @param request_pb [::Google::Cloud::VmwareEngine::V1::UpdateManagementDnsZoneBindingRequest] + # 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 update_management_dns_zone_binding request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_management_dns_zone_binding_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_management_dns_zone_binding", + 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_management_dns_zone_binding REST call + # + # @param request_pb [::Google::Cloud::VmwareEngine::V1::DeleteManagementDnsZoneBindingRequest] + # 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_management_dns_zone_binding request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_management_dns_zone_binding_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_management_dns_zone_binding", + 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 repair_management_dns_zone_binding REST call + # + # @param request_pb [::Google::Cloud::VmwareEngine::V1::RepairManagementDnsZoneBindingRequest] + # 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 repair_management_dns_zone_binding request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_repair_management_dns_zone_binding_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: "repair_management_dns_zone_binding", + 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_vmware_engine_network REST call + # + # @param request_pb [::Google::Cloud::VmwareEngine::V1::CreateVmwareEngineNetworkRequest] + # 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_vmware_engine_network request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_vmware_engine_network_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_vmware_engine_network", + 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 update_vmware_engine_network REST call + # + # @param request_pb [::Google::Cloud::VmwareEngine::V1::UpdateVmwareEngineNetworkRequest] + # 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 update_vmware_engine_network request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_vmware_engine_network_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_vmware_engine_network", + 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_vmware_engine_network REST call + # + # @param request_pb [::Google::Cloud::VmwareEngine::V1::DeleteVmwareEngineNetworkRequest] + # 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_vmware_engine_network request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_vmware_engine_network_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_vmware_engine_network", + 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_vmware_engine_network REST call + # + # @param request_pb [::Google::Cloud::VmwareEngine::V1::GetVmwareEngineNetworkRequest] + # 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::VmwareEngine::V1::VmwareEngineNetwork] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::VmwareEngine::V1::VmwareEngineNetwork] + # A result object deserialized from the server's reply + def get_vmware_engine_network request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_vmware_engine_network_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_vmware_engine_network", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::VmwareEngine::V1::VmwareEngineNetwork.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_vmware_engine_networks REST call + # + # @param request_pb [::Google::Cloud::VmwareEngine::V1::ListVmwareEngineNetworksRequest] + # 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::VmwareEngine::V1::ListVmwareEngineNetworksResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::VmwareEngine::V1::ListVmwareEngineNetworksResponse] + # A result object deserialized from the server's reply + def list_vmware_engine_networks request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_vmware_engine_networks_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_vmware_engine_networks", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::VmwareEngine::V1::ListVmwareEngineNetworksResponse.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_private_connection REST call + # + # @param request_pb [::Google::Cloud::VmwareEngine::V1::CreatePrivateConnectionRequest] + # 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_private_connection request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_private_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_private_connection", + 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_private_connection REST call + # + # @param request_pb [::Google::Cloud::VmwareEngine::V1::GetPrivateConnectionRequest] + # 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::VmwareEngine::V1::PrivateConnection] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::VmwareEngine::V1::PrivateConnection] + # A result object deserialized from the server's reply + def get_private_connection request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_private_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_private_connection", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::VmwareEngine::V1::PrivateConnection.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_private_connections REST call + # + # @param request_pb [::Google::Cloud::VmwareEngine::V1::ListPrivateConnectionsRequest] + # 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::VmwareEngine::V1::ListPrivateConnectionsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::VmwareEngine::V1::ListPrivateConnectionsResponse] + # A result object deserialized from the server's reply + def list_private_connections request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_private_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_private_connections", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::VmwareEngine::V1::ListPrivateConnectionsResponse.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_private_connection REST call + # + # @param request_pb [::Google::Cloud::VmwareEngine::V1::UpdatePrivateConnectionRequest] + # 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 update_private_connection request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_private_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_private_connection", + 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_private_connection REST call + # + # @param request_pb [::Google::Cloud::VmwareEngine::V1::DeletePrivateConnectionRequest] + # 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_private_connection request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_private_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: "delete_private_connection", + 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 list_private_connection_peering_routes REST call + # + # @param request_pb [::Google::Cloud::VmwareEngine::V1::ListPrivateConnectionPeeringRoutesRequest] + # 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::VmwareEngine::V1::ListPrivateConnectionPeeringRoutesResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::VmwareEngine::V1::ListPrivateConnectionPeeringRoutesResponse] + # A result object deserialized from the server's reply + def list_private_connection_peering_routes request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_private_connection_peering_routes_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_private_connection_peering_routes", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::VmwareEngine::V1::ListPrivateConnectionPeeringRoutesResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the grant_dns_bind_permission REST call + # + # @param request_pb [::Google::Cloud::VmwareEngine::V1::GrantDnsBindPermissionRequest] + # 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 grant_dns_bind_permission request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_grant_dns_bind_permission_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: "grant_dns_bind_permission", + 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_dns_bind_permission REST call + # + # @param request_pb [::Google::Cloud::VmwareEngine::V1::GetDnsBindPermissionRequest] + # 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::VmwareEngine::V1::DnsBindPermission] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::VmwareEngine::V1::DnsBindPermission] + # A result object deserialized from the server's reply + def get_dns_bind_permission request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_dns_bind_permission_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_dns_bind_permission", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::VmwareEngine::V1::DnsBindPermission.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the revoke_dns_bind_permission REST call + # + # @param request_pb [::Google::Cloud::VmwareEngine::V1::RevokeDnsBindPermissionRequest] + # 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 revoke_dns_bind_permission request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_revoke_dns_bind_permission_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: "revoke_dns_bind_permission", + 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 + + ## + # @private + # + # GRPC transcoding helper method for the list_private_clouds REST call + # + # @param request_pb [::Google::Cloud::VmwareEngine::V1::ListPrivateCloudsRequest] + # 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_private_clouds_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/privateClouds", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_private_cloud REST call + # + # @param request_pb [::Google::Cloud::VmwareEngine::V1::GetPrivateCloudRequest] + # 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_private_cloud_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/privateClouds/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_private_cloud REST call + # + # @param request_pb [::Google::Cloud::VmwareEngine::V1::CreatePrivateCloudRequest] + # 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_private_cloud_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/privateClouds", + body: "private_cloud", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_private_cloud REST call + # + # @param request_pb [::Google::Cloud::VmwareEngine::V1::UpdatePrivateCloudRequest] + # 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_private_cloud_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v1/{private_cloud.name}", + body: "private_cloud", + matches: [ + ["private_cloud.name", %r{^projects/[^/]+/locations/[^/]+/privateClouds/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_private_cloud REST call + # + # @param request_pb [::Google::Cloud::VmwareEngine::V1::DeletePrivateCloudRequest] + # 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_private_cloud_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/privateClouds/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the undelete_private_cloud REST call + # + # @param request_pb [::Google::Cloud::VmwareEngine::V1::UndeletePrivateCloudRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_undelete_private_cloud_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:undelete", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/privateClouds/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_clusters REST call + # + # @param request_pb [::Google::Cloud::VmwareEngine::V1::ListClustersRequest] + # 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_clusters_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/clusters", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/privateClouds/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_cluster REST call + # + # @param request_pb [::Google::Cloud::VmwareEngine::V1::GetClusterRequest] + # 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_cluster_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/privateClouds/[^/]+/clusters/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_cluster REST call + # + # @param request_pb [::Google::Cloud::VmwareEngine::V1::CreateClusterRequest] + # 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_cluster_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/clusters", + body: "cluster", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/privateClouds/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_cluster REST call + # + # @param request_pb [::Google::Cloud::VmwareEngine::V1::UpdateClusterRequest] + # 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_cluster_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v1/{cluster.name}", + body: "cluster", + matches: [ + ["cluster.name", %r{^projects/[^/]+/locations/[^/]+/privateClouds/[^/]+/clusters/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_cluster REST call + # + # @param request_pb [::Google::Cloud::VmwareEngine::V1::DeleteClusterRequest] + # 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_cluster_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/privateClouds/[^/]+/clusters/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_nodes REST call + # + # @param request_pb [::Google::Cloud::VmwareEngine::V1::ListNodesRequest] + # 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_nodes_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/nodes", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/privateClouds/[^/]+/clusters/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_node REST call + # + # @param request_pb [::Google::Cloud::VmwareEngine::V1::GetNodeRequest] + # 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_node_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/privateClouds/[^/]+/clusters/[^/]+/nodes/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_external_addresses REST call + # + # @param request_pb [::Google::Cloud::VmwareEngine::V1::ListExternalAddressesRequest] + # 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_external_addresses_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/externalAddresses", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/privateClouds/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the fetch_network_policy_external_addresses REST call + # + # @param request_pb [::Google::Cloud::VmwareEngine::V1::FetchNetworkPolicyExternalAddressesRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_fetch_network_policy_external_addresses_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{network_policy}:fetchExternalAddresses", + matches: [ + ["network_policy", %r{^projects/[^/]+/locations/[^/]+/networkPolicies/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_external_address REST call + # + # @param request_pb [::Google::Cloud::VmwareEngine::V1::GetExternalAddressRequest] + # 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_external_address_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/privateClouds/[^/]+/externalAddresses/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_external_address REST call + # + # @param request_pb [::Google::Cloud::VmwareEngine::V1::CreateExternalAddressRequest] + # 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_external_address_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/externalAddresses", + body: "external_address", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/privateClouds/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_external_address REST call + # + # @param request_pb [::Google::Cloud::VmwareEngine::V1::UpdateExternalAddressRequest] + # 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_external_address_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v1/{external_address.name}", + body: "external_address", + matches: [ + ["external_address.name", %r{^projects/[^/]+/locations/[^/]+/privateClouds/[^/]+/externalAddresses/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_external_address REST call + # + # @param request_pb [::Google::Cloud::VmwareEngine::V1::DeleteExternalAddressRequest] + # 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_external_address_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/privateClouds/[^/]+/externalAddresses/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_subnets REST call + # + # @param request_pb [::Google::Cloud::VmwareEngine::V1::ListSubnetsRequest] + # 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_subnets_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/subnets", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/privateClouds/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_subnet REST call + # + # @param request_pb [::Google::Cloud::VmwareEngine::V1::GetSubnetRequest] + # 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_subnet_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/privateClouds/[^/]+/subnets/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_subnet REST call + # + # @param request_pb [::Google::Cloud::VmwareEngine::V1::UpdateSubnetRequest] + # 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_subnet_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v1/{subnet.name}", + body: "subnet", + matches: [ + ["subnet.name", %r{^projects/[^/]+/locations/[^/]+/privateClouds/[^/]+/subnets/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_external_access_rules REST call + # + # @param request_pb [::Google::Cloud::VmwareEngine::V1::ListExternalAccessRulesRequest] + # 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_external_access_rules_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/externalAccessRules", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/networkPolicies/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_external_access_rule REST call + # + # @param request_pb [::Google::Cloud::VmwareEngine::V1::GetExternalAccessRuleRequest] + # 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_external_access_rule_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/networkPolicies/[^/]+/externalAccessRules/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_external_access_rule REST call + # + # @param request_pb [::Google::Cloud::VmwareEngine::V1::CreateExternalAccessRuleRequest] + # 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_external_access_rule_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/externalAccessRules", + body: "external_access_rule", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/networkPolicies/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_external_access_rule REST call + # + # @param request_pb [::Google::Cloud::VmwareEngine::V1::UpdateExternalAccessRuleRequest] + # 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_external_access_rule_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v1/{external_access_rule.name}", + body: "external_access_rule", + matches: [ + ["external_access_rule.name", %r{^projects/[^/]+/locations/[^/]+/networkPolicies/[^/]+/externalAccessRules/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_external_access_rule REST call + # + # @param request_pb [::Google::Cloud::VmwareEngine::V1::DeleteExternalAccessRuleRequest] + # 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_external_access_rule_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/networkPolicies/[^/]+/externalAccessRules/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_logging_servers REST call + # + # @param request_pb [::Google::Cloud::VmwareEngine::V1::ListLoggingServersRequest] + # 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_logging_servers_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/loggingServers", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/privateClouds/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_logging_server REST call + # + # @param request_pb [::Google::Cloud::VmwareEngine::V1::GetLoggingServerRequest] + # 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_logging_server_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/privateClouds/[^/]+/loggingServers/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_logging_server REST call + # + # @param request_pb [::Google::Cloud::VmwareEngine::V1::CreateLoggingServerRequest] + # 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_logging_server_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/loggingServers", + body: "logging_server", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/privateClouds/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_logging_server REST call + # + # @param request_pb [::Google::Cloud::VmwareEngine::V1::UpdateLoggingServerRequest] + # 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_logging_server_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v1/{logging_server.name}", + body: "logging_server", + matches: [ + ["logging_server.name", %r{^projects/[^/]+/locations/[^/]+/privateClouds/[^/]+/loggingServers/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_logging_server REST call + # + # @param request_pb [::Google::Cloud::VmwareEngine::V1::DeleteLoggingServerRequest] + # 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_logging_server_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/privateClouds/[^/]+/loggingServers/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_node_types REST call + # + # @param request_pb [::Google::Cloud::VmwareEngine::V1::ListNodeTypesRequest] + # 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_node_types_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/nodeTypes", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_node_type REST call + # + # @param request_pb [::Google::Cloud::VmwareEngine::V1::GetNodeTypeRequest] + # 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_node_type_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/nodeTypes/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the show_nsx_credentials REST call + # + # @param request_pb [::Google::Cloud::VmwareEngine::V1::ShowNsxCredentialsRequest] + # 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_nsx_credentials_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{private_cloud}:showNsxCredentials", + matches: [ + ["private_cloud", %r{^projects/[^/]+/locations/[^/]+/privateClouds/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the show_vcenter_credentials REST call + # + # @param request_pb [::Google::Cloud::VmwareEngine::V1::ShowVcenterCredentialsRequest] + # 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_vcenter_credentials_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{private_cloud}:showVcenterCredentials", + matches: [ + ["private_cloud", %r{^projects/[^/]+/locations/[^/]+/privateClouds/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the reset_nsx_credentials REST call + # + # @param request_pb [::Google::Cloud::VmwareEngine::V1::ResetNsxCredentialsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_reset_nsx_credentials_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{private_cloud}:resetNsxCredentials", + body: "*", + matches: [ + ["private_cloud", %r{^projects/[^/]+/locations/[^/]+/privateClouds/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the reset_vcenter_credentials REST call + # + # @param request_pb [::Google::Cloud::VmwareEngine::V1::ResetVcenterCredentialsRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_reset_vcenter_credentials_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{private_cloud}:resetVcenterCredentials", + body: "*", + matches: [ + ["private_cloud", %r{^projects/[^/]+/locations/[^/]+/privateClouds/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_dns_forwarding REST call + # + # @param request_pb [::Google::Cloud::VmwareEngine::V1::GetDnsForwardingRequest] + # 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_dns_forwarding_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/privateClouds/[^/]+/dnsForwarding/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_dns_forwarding REST call + # + # @param request_pb [::Google::Cloud::VmwareEngine::V1::UpdateDnsForwardingRequest] + # 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_dns_forwarding_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v1/{dns_forwarding.name}", + body: "dns_forwarding", + matches: [ + ["dns_forwarding.name", %r{^projects/[^/]+/locations/[^/]+/privateClouds/[^/]+/dnsForwarding/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_network_peering REST call + # + # @param request_pb [::Google::Cloud::VmwareEngine::V1::GetNetworkPeeringRequest] + # 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_network_peering_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/networkPeerings/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_network_peerings REST call + # + # @param request_pb [::Google::Cloud::VmwareEngine::V1::ListNetworkPeeringsRequest] + # 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_network_peerings_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/networkPeerings", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_network_peering REST call + # + # @param request_pb [::Google::Cloud::VmwareEngine::V1::CreateNetworkPeeringRequest] + # 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_network_peering_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/networkPeerings", + body: "network_peering", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_network_peering REST call + # + # @param request_pb [::Google::Cloud::VmwareEngine::V1::DeleteNetworkPeeringRequest] + # 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_network_peering_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/networkPeerings/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_network_peering REST call + # + # @param request_pb [::Google::Cloud::VmwareEngine::V1::UpdateNetworkPeeringRequest] + # 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_network_peering_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v1/{network_peering.name}", + body: "network_peering", + matches: [ + ["network_peering.name", %r{^projects/[^/]+/locations/[^/]+/networkPeerings/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_peering_routes REST call + # + # @param request_pb [::Google::Cloud::VmwareEngine::V1::ListPeeringRoutesRequest] + # 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_peering_routes_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/peeringRoutes", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/networkPeerings/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_hcx_activation_key REST call + # + # @param request_pb [::Google::Cloud::VmwareEngine::V1::CreateHcxActivationKeyRequest] + # 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_hcx_activation_key_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/hcxActivationKeys", + body: "hcx_activation_key", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/privateClouds/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_hcx_activation_keys REST call + # + # @param request_pb [::Google::Cloud::VmwareEngine::V1::ListHcxActivationKeysRequest] + # 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_hcx_activation_keys_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/hcxActivationKeys", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/privateClouds/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_hcx_activation_key REST call + # + # @param request_pb [::Google::Cloud::VmwareEngine::V1::GetHcxActivationKeyRequest] + # 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_hcx_activation_key_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/privateClouds/[^/]+/hcxActivationKeys/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_network_policy REST call + # + # @param request_pb [::Google::Cloud::VmwareEngine::V1::GetNetworkPolicyRequest] + # 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_network_policy_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/networkPolicies/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_network_policies REST call + # + # @param request_pb [::Google::Cloud::VmwareEngine::V1::ListNetworkPoliciesRequest] + # 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_network_policies_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/networkPolicies", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_network_policy REST call + # + # @param request_pb [::Google::Cloud::VmwareEngine::V1::CreateNetworkPolicyRequest] + # 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_network_policy_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/networkPolicies", + body: "network_policy", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_network_policy REST call + # + # @param request_pb [::Google::Cloud::VmwareEngine::V1::UpdateNetworkPolicyRequest] + # 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_network_policy_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v1/{network_policy.name}", + body: "network_policy", + matches: [ + ["network_policy.name", %r{^projects/[^/]+/locations/[^/]+/networkPolicies/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_network_policy REST call + # + # @param request_pb [::Google::Cloud::VmwareEngine::V1::DeleteNetworkPolicyRequest] + # 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_network_policy_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/networkPolicies/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_management_dns_zone_bindings REST call + # + # @param request_pb [::Google::Cloud::VmwareEngine::V1::ListManagementDnsZoneBindingsRequest] + # 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_management_dns_zone_bindings_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/managementDnsZoneBindings", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/privateClouds/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_management_dns_zone_binding REST call + # + # @param request_pb [::Google::Cloud::VmwareEngine::V1::GetManagementDnsZoneBindingRequest] + # 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_management_dns_zone_binding_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/privateClouds/[^/]+/managementDnsZoneBindings/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_management_dns_zone_binding REST call + # + # @param request_pb [::Google::Cloud::VmwareEngine::V1::CreateManagementDnsZoneBindingRequest] + # 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_management_dns_zone_binding_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/managementDnsZoneBindings", + body: "management_dns_zone_binding", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/privateClouds/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_management_dns_zone_binding REST call + # + # @param request_pb [::Google::Cloud::VmwareEngine::V1::UpdateManagementDnsZoneBindingRequest] + # 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_management_dns_zone_binding_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v1/{management_dns_zone_binding.name}", + body: "management_dns_zone_binding", + matches: [ + ["management_dns_zone_binding.name", %r{^projects/[^/]+/locations/[^/]+/privateClouds/[^/]+/managementDnsZoneBindings/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_management_dns_zone_binding REST call + # + # @param request_pb [::Google::Cloud::VmwareEngine::V1::DeleteManagementDnsZoneBindingRequest] + # 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_management_dns_zone_binding_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/privateClouds/[^/]+/managementDnsZoneBindings/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the repair_management_dns_zone_binding REST call + # + # @param request_pb [::Google::Cloud::VmwareEngine::V1::RepairManagementDnsZoneBindingRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_repair_management_dns_zone_binding_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:repair", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/privateClouds/[^/]+/managementDnsZoneBindings/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_vmware_engine_network REST call + # + # @param request_pb [::Google::Cloud::VmwareEngine::V1::CreateVmwareEngineNetworkRequest] + # 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_vmware_engine_network_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/vmwareEngineNetworks", + body: "vmware_engine_network", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_vmware_engine_network REST call + # + # @param request_pb [::Google::Cloud::VmwareEngine::V1::UpdateVmwareEngineNetworkRequest] + # 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_vmware_engine_network_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v1/{vmware_engine_network.name}", + body: "vmware_engine_network", + matches: [ + ["vmware_engine_network.name", %r{^projects/[^/]+/locations/[^/]+/vmwareEngineNetworks/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_vmware_engine_network REST call + # + # @param request_pb [::Google::Cloud::VmwareEngine::V1::DeleteVmwareEngineNetworkRequest] + # 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_vmware_engine_network_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/vmwareEngineNetworks/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_vmware_engine_network REST call + # + # @param request_pb [::Google::Cloud::VmwareEngine::V1::GetVmwareEngineNetworkRequest] + # 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_vmware_engine_network_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/vmwareEngineNetworks/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_vmware_engine_networks REST call + # + # @param request_pb [::Google::Cloud::VmwareEngine::V1::ListVmwareEngineNetworksRequest] + # 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_vmware_engine_networks_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/vmwareEngineNetworks", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_private_connection REST call + # + # @param request_pb [::Google::Cloud::VmwareEngine::V1::CreatePrivateConnectionRequest] + # 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_private_connection_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/privateConnections", + body: "private_connection", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_private_connection REST call + # + # @param request_pb [::Google::Cloud::VmwareEngine::V1::GetPrivateConnectionRequest] + # 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_private_connection_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/privateConnections/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_private_connections REST call + # + # @param request_pb [::Google::Cloud::VmwareEngine::V1::ListPrivateConnectionsRequest] + # 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_private_connections_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/privateConnections", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_private_connection REST call + # + # @param request_pb [::Google::Cloud::VmwareEngine::V1::UpdatePrivateConnectionRequest] + # 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_private_connection_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v1/{private_connection.name}", + body: "private_connection", + matches: [ + ["private_connection.name", %r{^projects/[^/]+/locations/[^/]+/privateConnections/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_private_connection REST call + # + # @param request_pb [::Google::Cloud::VmwareEngine::V1::DeletePrivateConnectionRequest] + # 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_private_connection_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/privateConnections/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_private_connection_peering_routes REST call + # + # @param request_pb [::Google::Cloud::VmwareEngine::V1::ListPrivateConnectionPeeringRoutesRequest] + # 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_private_connection_peering_routes_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/peeringRoutes", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/privateConnections/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the grant_dns_bind_permission REST call + # + # @param request_pb [::Google::Cloud::VmwareEngine::V1::GrantDnsBindPermissionRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_grant_dns_bind_permission_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:grant", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dnsBindPermission/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_dns_bind_permission REST call + # + # @param request_pb [::Google::Cloud::VmwareEngine::V1::GetDnsBindPermissionRequest] + # 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_dns_bind_permission_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dnsBindPermission/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the revoke_dns_bind_permission REST call + # + # @param request_pb [::Google::Cloud::VmwareEngine::V1::RevokeDnsBindPermissionRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_revoke_dns_bind_permission_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:revoke", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/dnsBindPermission/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-vmware_engine-v1/lib/google/cloud/vmwareengine/v1/vmwareengine_pb.rb b/owl-bot-staging/google-cloud-vmware_engine-v1/lib/google/cloud/vmwareengine/v1/vmwareengine_pb.rb new file mode 100644 index 000000000000..4fae75039dc3 --- /dev/null +++ b/owl-bot-staging/google-cloud-vmware_engine-v1/lib/google/cloud/vmwareengine/v1/vmwareengine_pb.rb @@ -0,0 +1,123 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/vmwareengine/v1/vmwareengine.proto + +require 'google/protobuf' + +require 'google/api/annotations_pb' +require 'google/api/client_pb' +require 'google/api/field_behavior_pb' +require 'google/api/field_info_pb' +require 'google/api/resource_pb' +require 'google/cloud/vmwareengine/v1/vmwareengine_resources_pb' +require 'google/longrunning/operations_pb' +require 'google/protobuf/empty_pb' +require 'google/protobuf/field_mask_pb' +require 'google/protobuf/timestamp_pb' + + +descriptor_data = "\n/google/cloud/vmwareengine/v1/vmwareengine.proto\x12\x1cgoogle.cloud.vmwareengine.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x1bgoogle/api/field_info.proto\x1a\x19google/api/resource.proto\x1a\x39google/cloud/vmwareengine/v1/vmwareengine_resources.proto\x1a#google/longrunning/operations.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\x9e\x01\n\x18ListPrivateCloudsRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\x12\x0e\n\x06\x66ilter\x18\x04 \x01(\t\x12\x10\n\x08order_by\x18\x05 \x01(\t\"\x8d\x01\n\x19ListPrivateCloudsResponse\x12\x42\n\x0eprivate_clouds\x18\x01 \x03(\x0b\x32*.google.cloud.vmwareengine.v1.PrivateCloud\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x13\n\x0bunreachable\x18\x03 \x03(\t\"X\n\x16GetPrivateCloudRequest\x12>\n\x04name\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(vmwareengine.googleapis.com/PrivateCloud\"\xf2\x01\n\x19\x43reatePrivateCloudRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\x12\x1d\n\x10private_cloud_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x46\n\rprivate_cloud\x18\x03 \x01(\x0b\x32*.google.cloud.vmwareengine.v1.PrivateCloudB\x03\xe0\x41\x02\x12\x17\n\nrequest_id\x18\x04 \x01(\tB\x03\xe0\x41\x01\x12\x1a\n\rvalidate_only\x18\x05 \x01(\x08\x42\x03\xe0\x41\x01\"\xb2\x01\n\x19UpdatePrivateCloudRequest\x12\x46\n\rprivate_cloud\x18\x01 \x01(\x0b\x32*.google.cloud.vmwareengine.v1.PrivateCloudB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\x12\x17\n\nrequest_id\x18\x03 \x01(\tB\x03\xe0\x41\x01\"\xb7\x01\n\x19\x44\x65letePrivateCloudRequest\x12>\n\x04name\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(vmwareengine.googleapis.com/PrivateCloud\x12\x17\n\nrequest_id\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x12\n\x05\x66orce\x18\x03 \x01(\x08\x42\x03\xe0\x41\x01\x12\x1d\n\x0b\x64\x65lay_hours\x18\x04 \x01(\x05\x42\x03\xe0\x41\x01H\x00\x88\x01\x01\x42\x0e\n\x0c_delay_hours\"v\n\x1bUndeletePrivateCloudRequest\x12>\n\x04name\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(vmwareengine.googleapis.com/PrivateCloud\x12\x17\n\nrequest_id\x18\x02 \x01(\tB\x03\xe0\x41\x01\"\xa0\x01\n\x13ListClustersRequest\x12@\n\x06parent\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(vmwareengine.googleapis.com/PrivateCloud\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\x12\x0e\n\x06\x66ilter\x18\x04 \x01(\t\x12\x10\n\x08order_by\x18\x05 \x01(\t\"}\n\x14ListClustersResponse\x12\x37\n\x08\x63lusters\x18\x01 \x03(\x0b\x32%.google.cloud.vmwareengine.v1.Cluster\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x13\n\x0bunreachable\x18\x03 \x03(\t\"N\n\x11GetClusterRequest\x12\x39\n\x04name\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\n#vmwareengine.googleapis.com/Cluster\"\xe3\x01\n\x14\x43reateClusterRequest\x12@\n\x06parent\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(vmwareengine.googleapis.com/PrivateCloud\x12\x17\n\ncluster_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12;\n\x07\x63luster\x18\x03 \x01(\x0b\x32%.google.cloud.vmwareengine.v1.ClusterB\x03\xe0\x41\x02\x12\x17\n\nrequest_id\x18\x04 \x01(\tB\x03\xe0\x41\x01\x12\x1a\n\rvalidate_only\x18\x05 \x01(\x08\x42\x03\xe0\x41\x01\"\xbe\x01\n\x14UpdateClusterRequest\x12\x34\n\x0bupdate_mask\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\x12;\n\x07\x63luster\x18\x02 \x01(\x0b\x32%.google.cloud.vmwareengine.v1.ClusterB\x03\xe0\x41\x02\x12\x17\n\nrequest_id\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12\x1a\n\rvalidate_only\x18\x04 \x01(\x08\x42\x03\xe0\x41\x01\"j\n\x14\x44\x65leteClusterRequest\x12\x39\n\x04name\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\n#vmwareengine.googleapis.com/Cluster\x12\x17\n\nrequest_id\x18\x02 \x01(\tB\x03\xe0\x41\x01\"v\n\x10ListNodesRequest\x12;\n\x06parent\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\n#vmwareengine.googleapis.com/Cluster\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\"_\n\x11ListNodesResponse\x12\x31\n\x05nodes\x18\x01 \x03(\x0b\x32\".google.cloud.vmwareengine.v1.Node\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"H\n\x0eGetNodeRequest\x12\x36\n\x04name\x18\x01 \x01(\tB(\xe0\x41\x02\xfa\x41\"\n vmwareengine.googleapis.com/Node\"\xa9\x01\n\x1cListExternalAddressesRequest\x12@\n\x06parent\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(vmwareengine.googleapis.com/PrivateCloud\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\x12\x0e\n\x06\x66ilter\x18\x04 \x01(\t\x12\x10\n\x08order_by\x18\x05 \x01(\t\"\x98\x01\n\x1dListExternalAddressesResponse\x12I\n\x12\x65xternal_addresses\x18\x01 \x03(\x0b\x32-.google.cloud.vmwareengine.v1.ExternalAddress\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x13\n\x0bunreachable\x18\x03 \x03(\t\"\x9e\x01\n*FetchNetworkPolicyExternalAddressesRequest\x12I\n\x0enetwork_policy\x18\x01 \x01(\tB1\xe0\x41\x02\xfa\x41+\n)vmwareengine.googleapis.com/NetworkPolicy\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\"\x91\x01\n+FetchNetworkPolicyExternalAddressesResponse\x12I\n\x12\x65xternal_addresses\x18\x01 \x03(\x0b\x32-.google.cloud.vmwareengine.v1.ExternalAddress\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"^\n\x19GetExternalAddressRequest\x12\x41\n\x04name\x18\x01 \x01(\tB3\xe0\x41\x02\xfa\x41-\n+vmwareengine.googleapis.com/ExternalAddress\"\xe9\x01\n\x1c\x43reateExternalAddressRequest\x12@\n\x06parent\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(vmwareengine.googleapis.com/PrivateCloud\x12L\n\x10\x65xternal_address\x18\x02 \x01(\x0b\x32-.google.cloud.vmwareengine.v1.ExternalAddressB\x03\xe0\x41\x02\x12 \n\x13\x65xternal_address_id\x18\x03 \x01(\tB\x03\xe0\x41\x02\x12\x17\n\nrequest_id\x18\x04 \x01(\tB\x03\xe0\x41\x01\"\xbb\x01\n\x1cUpdateExternalAddressRequest\x12\x34\n\x0bupdate_mask\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\x12L\n\x10\x65xternal_address\x18\x02 \x01(\x0b\x32-.google.cloud.vmwareengine.v1.ExternalAddressB\x03\xe0\x41\x02\x12\x17\n\nrequest_id\x18\x03 \x01(\tB\x03\xe0\x41\x01\"z\n\x1c\x44\x65leteExternalAddressRequest\x12\x41\n\x04name\x18\x01 \x01(\tB3\xe0\x41\x02\xfa\x41-\n+vmwareengine.googleapis.com/ExternalAddress\x12\x17\n\nrequest_id\x18\x02 \x01(\tB\x03\xe0\x41\x01\"}\n\x12ListSubnetsRequest\x12@\n\x06parent\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(vmwareengine.googleapis.com/PrivateCloud\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\"z\n\x13ListSubnetsResponse\x12\x35\n\x07subnets\x18\x01 \x03(\x0b\x32$.google.cloud.vmwareengine.v1.Subnet\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x13\n\x0bunreachable\x18\x03 \x03(\t\"L\n\x10GetSubnetRequest\x12\x38\n\x04name\x18\x01 \x01(\tB*\xe0\x41\x02\xfa\x41$\n\"vmwareengine.googleapis.com/Subnet\"\x86\x01\n\x13UpdateSubnetRequest\x12\x34\n\x0bupdate_mask\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\x12\x39\n\x06subnet\x18\x02 \x01(\x0b\x32$.google.cloud.vmwareengine.v1.SubnetB\x03\xe0\x41\x02\"\xac\x01\n\x1eListExternalAccessRulesRequest\x12\x41\n\x06parent\x18\x01 \x01(\tB1\xe0\x41\x02\xfa\x41+\n)vmwareengine.googleapis.com/NetworkPolicy\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\x12\x0e\n\x06\x66ilter\x18\x04 \x01(\t\x12\x10\n\x08order_by\x18\x05 \x01(\t\"\xa0\x01\n\x1fListExternalAccessRulesResponse\x12O\n\x15\x65xternal_access_rules\x18\x01 \x03(\x0b\x32\x30.google.cloud.vmwareengine.v1.ExternalAccessRule\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x13\n\x0bunreachable\x18\x03 \x03(\t\"d\n\x1cGetExternalAccessRuleRequest\x12\x44\n\x04name\x18\x01 \x01(\tB6\xe0\x41\x02\xfa\x41\x30\n.vmwareengine.googleapis.com/ExternalAccessRule\"\xf3\x01\n\x1f\x43reateExternalAccessRuleRequest\x12\x41\n\x06parent\x18\x01 \x01(\tB1\xe0\x41\x02\xfa\x41+\n)vmwareengine.googleapis.com/NetworkPolicy\x12S\n\x14\x65xternal_access_rule\x18\x02 \x01(\x0b\x32\x30.google.cloud.vmwareengine.v1.ExternalAccessRuleB\x03\xe0\x41\x02\x12$\n\x17\x65xternal_access_rule_id\x18\x03 \x01(\tB\x03\xe0\x41\x02\x12\x12\n\nrequest_id\x18\x04 \x01(\t\"\xc5\x01\n\x1fUpdateExternalAccessRuleRequest\x12\x34\n\x0bupdate_mask\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\x12S\n\x14\x65xternal_access_rule\x18\x02 \x01(\x0b\x32\x30.google.cloud.vmwareengine.v1.ExternalAccessRuleB\x03\xe0\x41\x02\x12\x17\n\nrequest_id\x18\x03 \x01(\tB\x03\xe0\x41\x01\"\x80\x01\n\x1f\x44\x65leteExternalAccessRuleRequest\x12\x44\n\x04name\x18\x01 \x01(\tB6\xe0\x41\x02\xfa\x41\x30\n.vmwareengine.googleapis.com/ExternalAccessRule\x12\x17\n\nrequest_id\x18\x02 \x01(\tB\x03\xe0\x41\x01\"\xa6\x01\n\x19ListLoggingServersRequest\x12@\n\x06parent\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(vmwareengine.googleapis.com/PrivateCloud\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\x12\x0e\n\x06\x66ilter\x18\x04 \x01(\t\x12\x10\n\x08order_by\x18\x05 \x01(\t\"\x90\x01\n\x1aListLoggingServersResponse\x12\x44\n\x0flogging_servers\x18\x01 \x03(\x0b\x32+.google.cloud.vmwareengine.v1.LoggingServer\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x13\n\x0bunreachable\x18\x03 \x03(\t\"Z\n\x17GetLoggingServerRequest\x12?\n\x04name\x18\x01 \x01(\tB1\xe0\x41\x02\xfa\x41+\n)vmwareengine.googleapis.com/LoggingServer\"\xe1\x01\n\x1a\x43reateLoggingServerRequest\x12@\n\x06parent\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(vmwareengine.googleapis.com/PrivateCloud\x12H\n\x0elogging_server\x18\x02 \x01(\x0b\x32+.google.cloud.vmwareengine.v1.LoggingServerB\x03\xe0\x41\x02\x12\x1e\n\x11logging_server_id\x18\x03 \x01(\tB\x03\xe0\x41\x02\x12\x17\n\nrequest_id\x18\x04 \x01(\tB\x03\xe0\x41\x01\"\xb5\x01\n\x1aUpdateLoggingServerRequest\x12\x34\n\x0bupdate_mask\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\x12H\n\x0elogging_server\x18\x02 \x01(\x0b\x32+.google.cloud.vmwareengine.v1.LoggingServerB\x03\xe0\x41\x02\x12\x17\n\nrequest_id\x18\x03 \x01(\tB\x03\xe0\x41\x01\"v\n\x1a\x44\x65leteLoggingServerRequest\x12?\n\x04name\x18\x01 \x01(\tB1\xe0\x41\x02\xfa\x41+\n)vmwareengine.googleapis.com/LoggingServer\x12\x17\n\nrequest_id\x18\x02 \x01(\tB\x03\xe0\x41\x01\"\x80\x02\n\x11OperationMetadata\x12\x34\n\x0b\x63reate_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x31\n\x08\x65nd_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x13\n\x06target\x18\x03 \x01(\tB\x03\xe0\x41\x03\x12\x11\n\x04verb\x18\x04 \x01(\tB\x03\xe0\x41\x03\x12\x1b\n\x0estatus_message\x18\x05 \x01(\tB\x03\xe0\x41\x03\x12#\n\x16requested_cancellation\x18\x06 \x01(\x08\x42\x03\xe0\x41\x03\x12\x18\n\x0b\x61pi_version\x18\x07 \x01(\tB\x03\xe0\x41\x03\"\x88\x01\n\x14ListNodeTypesRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\x12\x0e\n\x06\x66ilter\x18\x04 \x01(\t\"\x81\x01\n\x15ListNodeTypesResponse\x12:\n\nnode_types\x18\x01 \x03(\x0b\x32&.google.cloud.vmwareengine.v1.NodeType\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x13\n\x0bunreachable\x18\x03 \x03(\t\"P\n\x12GetNodeTypeRequest\x12:\n\x04name\x18\x01 \x01(\tB,\xe0\x41\x02\xfa\x41&\n$vmwareengine.googleapis.com/NodeType\"d\n\x19ShowNsxCredentialsRequest\x12G\n\rprivate_cloud\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(vmwareengine.googleapis.com/PrivateCloud\"\x7f\n\x1dShowVcenterCredentialsRequest\x12G\n\rprivate_cloud\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(vmwareengine.googleapis.com/PrivateCloud\x12\x15\n\x08username\x18\x02 \x01(\tB\x03\xe0\x41\x01\"~\n\x1aResetNsxCredentialsRequest\x12G\n\rprivate_cloud\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(vmwareengine.googleapis.com/PrivateCloud\x12\x17\n\nrequest_id\x18\x02 \x01(\tB\x03\xe0\x41\x01\"\x99\x01\n\x1eResetVcenterCredentialsRequest\x12G\n\rprivate_cloud\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(vmwareengine.googleapis.com/PrivateCloud\x12\x17\n\nrequest_id\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x15\n\x08username\x18\x03 \x01(\tB\x03\xe0\x41\x01\"\x9a\x01\n\x1dListHcxActivationKeysResponse\x12K\n\x13hcx_activation_keys\x18\x01 \x03(\x0b\x32..google.cloud.vmwareengine.v1.HcxActivationKey\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x13\n\x0bunreachable\x18\x03 \x03(\t\"\x87\x01\n\x1cListHcxActivationKeysRequest\x12@\n\x06parent\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(vmwareengine.googleapis.com/PrivateCloud\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\"`\n\x1aGetHcxActivationKeyRequest\x12\x42\n\x04name\x18\x01 \x01(\tB4\xe0\x41\x02\xfa\x41.\n,vmwareengine.googleapis.com/HcxActivationKey\"\xea\x01\n\x1d\x43reateHcxActivationKeyRequest\x12@\n\x06parent\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(vmwareengine.googleapis.com/PrivateCloud\x12O\n\x12hcx_activation_key\x18\x02 \x01(\x0b\x32..google.cloud.vmwareengine.v1.HcxActivationKeyB\x03\xe0\x41\x02\x12\"\n\x15hcx_activation_key_id\x18\x03 \x01(\tB\x03\xe0\x41\x02\x12\x12\n\nrequest_id\x18\x04 \x01(\t\"Z\n\x17GetDnsForwardingRequest\x12?\n\x04name\x18\x01 \x01(\tB1\xe0\x41\x02\xfa\x41+\n)vmwareengine.googleapis.com/DnsForwarding\"\xb5\x01\n\x1aUpdateDnsForwardingRequest\x12H\n\x0e\x64ns_forwarding\x18\x01 \x01(\x0b\x32+.google.cloud.vmwareengine.v1.DnsForwardingB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\x12\x17\n\nrequest_id\x18\x03 \x01(\tB\x03\xe0\x41\x01\"\xde\x01\n\x1b\x43reateNetworkPeeringRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\x12\x1f\n\x12network_peering_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12J\n\x0fnetwork_peering\x18\x03 \x01(\x0b\x32,.google.cloud.vmwareengine.v1.NetworkPeeringB\x03\xe0\x41\x02\x12\x17\n\nrequest_id\x18\x04 \x01(\tB\x03\xe0\x41\x01\"x\n\x1b\x44\x65leteNetworkPeeringRequest\x12@\n\x04name\x18\x01 \x01(\tB2\xe0\x41\x02\xfa\x41,\n*vmwareengine.googleapis.com/NetworkPeering\x12\x17\n\nrequest_id\x18\x02 \x01(\tB\x03\xe0\x41\x01\"\\\n\x18GetNetworkPeeringRequest\x12@\n\x04name\x18\x01 \x01(\tB2\xe0\x41\x02\xfa\x41,\n*vmwareengine.googleapis.com/NetworkPeering\"\xa9\x01\n\x1aListNetworkPeeringsRequest\x12\x42\n\x06parent\x18\x01 \x01(\tB2\xe0\x41\x02\xfa\x41,\x12*vmwareengine.googleapis.com/NetworkPeering\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\x12\x0e\n\x06\x66ilter\x18\x04 \x01(\t\x12\x10\n\x08order_by\x18\x05 \x01(\t\"\xb8\x01\n\x1bUpdateNetworkPeeringRequest\x12J\n\x0fnetwork_peering\x18\x01 \x01(\x0b\x32,.google.cloud.vmwareengine.v1.NetworkPeeringB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\x12\x17\n\nrequest_id\x18\x03 \x01(\tB\x03\xe0\x41\x01\"\x93\x01\n\x1bListNetworkPeeringsResponse\x12\x46\n\x10network_peerings\x18\x01 \x03(\x0b\x32,.google.cloud.vmwareengine.v1.NetworkPeering\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x13\n\x0bunreachable\x18\x03 \x03(\t\"\x95\x01\n\x18ListPeeringRoutesRequest\x12\x42\n\x06parent\x18\x01 \x01(\tB2\xe0\x41\x02\xfa\x41,\n*vmwareengine.googleapis.com/NetworkPeering\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\x12\x0e\n\x06\x66ilter\x18\x06 \x01(\t\"x\n\x19ListPeeringRoutesResponse\x12\x42\n\x0epeering_routes\x18\x01 \x03(\x0b\x32*.google.cloud.vmwareengine.v1.PeeringRoute\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\xa8\x01\n\x1aListNetworkPoliciesRequest\x12\x41\n\x06parent\x18\x01 \x01(\tB1\xe0\x41\x02\xfa\x41+\x12)vmwareengine.googleapis.com/NetworkPolicy\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\x12\x0e\n\x06\x66ilter\x18\x04 \x01(\t\x12\x10\n\x08order_by\x18\x05 \x01(\t\"\x92\x01\n\x1bListNetworkPoliciesResponse\x12\x45\n\x10network_policies\x18\x01 \x03(\x0b\x32+.google.cloud.vmwareengine.v1.NetworkPolicy\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x13\n\x0bunreachable\x18\x03 \x03(\t\"Z\n\x17GetNetworkPolicyRequest\x12?\n\x04name\x18\x01 \x01(\tB1\xe0\x41\x02\xfa\x41+\n)vmwareengine.googleapis.com/NetworkPolicy\"\xb5\x01\n\x1aUpdateNetworkPolicyRequest\x12H\n\x0enetwork_policy\x18\x01 \x01(\x0b\x32+.google.cloud.vmwareengine.v1.NetworkPolicyB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\x12\x17\n\nrequest_id\x18\x03 \x01(\tB\x03\xe0\x41\x01\"\xe2\x01\n\x1a\x43reateNetworkPolicyRequest\x12\x41\n\x06parent\x18\x01 \x01(\tB1\xe0\x41\x02\xfa\x41+\x12)vmwareengine.googleapis.com/NetworkPolicy\x12\x1e\n\x11network_policy_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12H\n\x0enetwork_policy\x18\x03 \x01(\x0b\x32+.google.cloud.vmwareengine.v1.NetworkPolicyB\x03\xe0\x41\x02\x12\x17\n\nrequest_id\x18\x04 \x01(\tB\x03\xe0\x41\x01\"v\n\x1a\x44\x65leteNetworkPolicyRequest\x12?\n\x04name\x18\x01 \x01(\tB1\xe0\x41\x02\xfa\x41+\n)vmwareengine.googleapis.com/NetworkPolicy\x12\x17\n\nrequest_id\x18\x02 \x01(\tB\x03\xe0\x41\x01\"\xb1\x01\n$ListManagementDnsZoneBindingsRequest\x12@\n\x06parent\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(vmwareengine.googleapis.com/PrivateCloud\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\x12\x0e\n\x06\x66ilter\x18\x04 \x01(\t\x12\x10\n\x08order_by\x18\x05 \x01(\t\"\xb3\x01\n%ListManagementDnsZoneBindingsResponse\x12\\\n\x1cmanagement_dns_zone_bindings\x18\x01 \x03(\x0b\x32\x36.google.cloud.vmwareengine.v1.ManagementDnsZoneBinding\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x13\n\x0bunreachable\x18\x03 \x03(\t\"p\n\"GetManagementDnsZoneBindingRequest\x12J\n\x04name\x18\x01 \x01(\tB<\xe0\x41\x02\xfa\x41\x36\n4vmwareengine.googleapis.com/ManagementDnsZoneBinding\"\x91\x02\n%CreateManagementDnsZoneBindingRequest\x12@\n\x06parent\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(vmwareengine.googleapis.com/PrivateCloud\x12`\n\x1bmanagement_dns_zone_binding\x18\x02 \x01(\x0b\x32\x36.google.cloud.vmwareengine.v1.ManagementDnsZoneBindingB\x03\xe0\x41\x02\x12+\n\x1emanagement_dns_zone_binding_id\x18\x03 \x01(\tB\x03\xe0\x41\x02\x12\x17\n\nrequest_id\x18\x04 \x01(\tB\x03\xe0\x41\x01\"\xd8\x01\n%UpdateManagementDnsZoneBindingRequest\x12\x34\n\x0bupdate_mask\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\x12`\n\x1bmanagement_dns_zone_binding\x18\x02 \x01(\x0b\x32\x36.google.cloud.vmwareengine.v1.ManagementDnsZoneBindingB\x03\xe0\x41\x02\x12\x17\n\nrequest_id\x18\x03 \x01(\tB\x03\xe0\x41\x01\"\x8c\x01\n%DeleteManagementDnsZoneBindingRequest\x12J\n\x04name\x18\x01 \x01(\tB<\xe0\x41\x02\xfa\x41\x36\n4vmwareengine.googleapis.com/ManagementDnsZoneBinding\x12\x17\n\nrequest_id\x18\x02 \x01(\tB\x03\xe0\x41\x01\"\x8c\x01\n%RepairManagementDnsZoneBindingRequest\x12J\n\x04name\x18\x01 \x01(\tB<\xe0\x41\x02\xfa\x41\x36\n4vmwareengine.googleapis.com/ManagementDnsZoneBinding\x12\x17\n\nrequest_id\x18\x02 \x01(\tB\x03\xe0\x41\x01\"\x82\x02\n CreateVmwareEngineNetworkRequest\x12G\n\x06parent\x18\x01 \x01(\tB7\xe0\x41\x02\xfa\x41\x31\x12/vmwareengine.googleapis.com/VmwareEngineNetwork\x12%\n\x18vmware_engine_network_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12U\n\x15vmware_engine_network\x18\x03 \x01(\x0b\x32\x31.google.cloud.vmwareengine.v1.VmwareEngineNetworkB\x03\xe0\x41\x02\x12\x17\n\nrequest_id\x18\x04 \x01(\tB\x03\xe0\x41\x01\"\xc8\x01\n UpdateVmwareEngineNetworkRequest\x12U\n\x15vmware_engine_network\x18\x01 \x01(\x0b\x32\x31.google.cloud.vmwareengine.v1.VmwareEngineNetworkB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\x12\x17\n\nrequest_id\x18\x03 \x01(\tB\x03\xe0\x41\x01\"\x95\x01\n DeleteVmwareEngineNetworkRequest\x12\x45\n\x04name\x18\x01 \x01(\tB7\xe0\x41\x02\xfa\x41\x31\n/vmwareengine.googleapis.com/VmwareEngineNetwork\x12\x17\n\nrequest_id\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x11\n\x04\x65tag\x18\x03 \x01(\tB\x03\xe0\x41\x01\"f\n\x1dGetVmwareEngineNetworkRequest\x12\x45\n\x04name\x18\x01 \x01(\tB7\xe0\x41\x02\xfa\x41\x31\n/vmwareengine.googleapis.com/VmwareEngineNetwork\"\xa5\x01\n\x1fListVmwareEngineNetworksRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\x12\x0e\n\x06\x66ilter\x18\x04 \x01(\t\x12\x10\n\x08order_by\x18\x05 \x01(\t\"\xa3\x01\n ListVmwareEngineNetworksResponse\x12Q\n\x16vmware_engine_networks\x18\x01 \x03(\x0b\x32\x31.google.cloud.vmwareengine.v1.VmwareEngineNetwork\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x13\n\x0bunreachable\x18\x03 \x03(\t\"\xf6\x01\n\x1e\x43reatePrivateConnectionRequest\x12\x45\n\x06parent\x18\x01 \x01(\tB5\xe0\x41\x02\xfa\x41/\x12-vmwareengine.googleapis.com/PrivateConnection\x12\"\n\x15private_connection_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12P\n\x12private_connection\x18\x03 \x01(\x0b\x32/.google.cloud.vmwareengine.v1.PrivateConnectionB\x03\xe0\x41\x02\x12\x17\n\nrequest_id\x18\x04 \x01(\tB\x03\xe0\x41\x01\"b\n\x1bGetPrivateConnectionRequest\x12\x43\n\x04name\x18\x01 \x01(\tB5\xe0\x41\x02\xfa\x41/\n-vmwareengine.googleapis.com/PrivateConnection\"\xaf\x01\n\x1dListPrivateConnectionsRequest\x12\x45\n\x06parent\x18\x01 \x01(\tB5\xe0\x41\x02\xfa\x41/\x12-vmwareengine.googleapis.com/PrivateConnection\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\x12\x0e\n\x06\x66ilter\x18\x04 \x01(\t\x12\x10\n\x08order_by\x18\x05 \x01(\t\"\x9c\x01\n\x1eListPrivateConnectionsResponse\x12L\n\x13private_connections\x18\x01 \x03(\x0b\x32/.google.cloud.vmwareengine.v1.PrivateConnection\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x13\n\x0bunreachable\x18\x03 \x03(\t\"\xc1\x01\n\x1eUpdatePrivateConnectionRequest\x12P\n\x12private_connection\x18\x01 \x01(\x0b\x32/.google.cloud.vmwareengine.v1.PrivateConnectionB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\x12\x17\n\nrequest_id\x18\x03 \x01(\tB\x03\xe0\x41\x01\"~\n\x1e\x44\x65letePrivateConnectionRequest\x12\x43\n\x04name\x18\x01 \x01(\tB5\xe0\x41\x02\xfa\x41/\n-vmwareengine.googleapis.com/PrivateConnection\x12\x17\n\nrequest_id\x18\x02 \x01(\tB\x03\xe0\x41\x01\"\x99\x01\n)ListPrivateConnectionPeeringRoutesRequest\x12\x45\n\x06parent\x18\x01 \x01(\tB5\xe0\x41\x02\xfa\x41/\n-vmwareengine.googleapis.com/PrivateConnection\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\"\x89\x01\n*ListPrivateConnectionPeeringRoutesResponse\x12\x42\n\x0epeering_routes\x18\x01 \x03(\x0b\x32*.google.cloud.vmwareengine.v1.PeeringRoute\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\xbe\x01\n\x1dGrantDnsBindPermissionRequest\x12\x43\n\x04name\x18\x01 \x01(\tB5\xe0\x41\x02\xfa\x41/\n-vmwareengine.googleapis.com/DnsBindPermission\x12?\n\tprincipal\x18\x02 \x01(\x0b\x32\'.google.cloud.vmwareengine.v1.PrincipalB\x03\xe0\x41\x02\x12\x17\n\nrequest_id\x18\x03 \x01(\tB\x03\xe0\x41\x01\"\xbf\x01\n\x1eRevokeDnsBindPermissionRequest\x12\x43\n\x04name\x18\x01 \x01(\tB5\xe0\x41\x02\xfa\x41/\n-vmwareengine.googleapis.com/DnsBindPermission\x12?\n\tprincipal\x18\x02 \x01(\x0b\x32\'.google.cloud.vmwareengine.v1.PrincipalB\x03\xe0\x41\x02\x12\x17\n\nrequest_id\x18\x03 \x01(\tB\x03\xe0\x41\x01\"b\n\x1bGetDnsBindPermissionRequest\x12\x43\n\x04name\x18\x01 \x01(\tB5\xe0\x41\x02\xfa\x41/\n-vmwareengine.googleapis.com/DnsBindPermission2\xdc\x8e\x01\n\x0cVmwareEngine\x12\xc8\x01\n\x11ListPrivateClouds\x12\x36.google.cloud.vmwareengine.v1.ListPrivateCloudsRequest\x1a\x37.google.cloud.vmwareengine.v1.ListPrivateCloudsResponse\"B\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x33\x12\x31/v1/{parent=projects/*/locations/*}/privateClouds\x12\xb5\x01\n\x0fGetPrivateCloud\x12\x34.google.cloud.vmwareengine.v1.GetPrivateCloudRequest\x1a*.google.cloud.vmwareengine.v1.PrivateCloud\"@\xda\x41\x04name\x82\xd3\xe4\x93\x02\x33\x12\x31/v1/{name=projects/*/locations/*/privateClouds/*}\x12\x83\x02\n\x12\x43reatePrivateCloud\x12\x37.google.cloud.vmwareengine.v1.CreatePrivateCloudRequest\x1a\x1d.google.longrunning.Operation\"\x94\x01\xca\x41!\n\x0cPrivateCloud\x12\x11OperationMetadata\xda\x41%parent,private_cloud,private_cloud_id\x82\xd3\xe4\x93\x02\x42\"1/v1/{parent=projects/*/locations/*}/privateClouds:\rprivate_cloud\x12\x85\x02\n\x12UpdatePrivateCloud\x12\x37.google.cloud.vmwareengine.v1.UpdatePrivateCloudRequest\x1a\x1d.google.longrunning.Operation\"\x96\x01\xca\x41!\n\x0cPrivateCloud\x12\x11OperationMetadata\xda\x41\x19private_cloud,update_mask\x82\xd3\xe4\x93\x02P2?/v1/{private_cloud.name=projects/*/locations/*/privateClouds/*}:\rprivate_cloud\x12\xd2\x01\n\x12\x44\x65letePrivateCloud\x12\x37.google.cloud.vmwareengine.v1.DeletePrivateCloudRequest\x1a\x1d.google.longrunning.Operation\"d\xca\x41!\n\x0cPrivateCloud\x12\x11OperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02\x33*1/v1/{name=projects/*/locations/*/privateClouds/*}\x12\xe2\x01\n\x14UndeletePrivateCloud\x12\x39.google.cloud.vmwareengine.v1.UndeletePrivateCloudRequest\x1a\x1d.google.longrunning.Operation\"p\xca\x41!\n\x0cPrivateCloud\x12\x11OperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02?\":/v1/{name=projects/*/locations/*/privateClouds/*}:undelete:\x01*\x12\xc4\x01\n\x0cListClusters\x12\x31.google.cloud.vmwareengine.v1.ListClustersRequest\x1a\x32.google.cloud.vmwareengine.v1.ListClustersResponse\"M\xda\x41\x06parent\x82\xd3\xe4\x93\x02>\x12\x12*\xda\x41\x06parent\x82\xd3\xe4\x93\x02/\x12-/v1/{parent=projects/*/locations/*}/nodeTypes\x12\xa5\x01\n\x0bGetNodeType\x12\x30.google.cloud.vmwareengine.v1.GetNodeTypeRequest\x1a&.google.cloud.vmwareengine.v1.NodeType\"<\xda\x41\x04name\x82\xd3\xe4\x93\x02/\x12-/v1/{name=projects/*/locations/*/nodeTypes/*}\x12\xdf\x01\n\x12ShowNsxCredentials\x12\x37.google.cloud.vmwareengine.v1.ShowNsxCredentialsRequest\x1a).google.cloud.vmwareengine.v1.Credentials\"e\xda\x41\rprivate_cloud\x82\xd3\xe4\x93\x02O\x12M/v1/{private_cloud=projects/*/locations/*/privateClouds/*}:showNsxCredentials\x12\xeb\x01\n\x16ShowVcenterCredentials\x12;.google.cloud.vmwareengine.v1.ShowVcenterCredentialsRequest\x1a).google.cloud.vmwareengine.v1.Credentials\"i\xda\x41\rprivate_cloud\x82\xd3\xe4\x93\x02S\x12Q/v1/{private_cloud=projects/*/locations/*/privateClouds/*}:showVcenterCredentials\x12\xfe\x01\n\x13ResetNsxCredentials\x12\x38.google.cloud.vmwareengine.v1.ResetNsxCredentialsRequest\x1a\x1d.google.longrunning.Operation\"\x8d\x01\xca\x41!\n\x0cPrivateCloud\x12\x11OperationMetadata\xda\x41\rprivate_cloud\x82\xd3\xe4\x93\x02S\"N/v1/{private_cloud=projects/*/locations/*/privateClouds/*}:resetNsxCredentials:\x01*\x12\x8a\x02\n\x17ResetVcenterCredentials\x12<.google.cloud.vmwareengine.v1.ResetVcenterCredentialsRequest\x1a\x1d.google.longrunning.Operation\"\x91\x01\xca\x41!\n\x0cPrivateCloud\x12\x11OperationMetadata\xda\x41\rprivate_cloud\x82\xd3\xe4\x93\x02W\"R/v1/{private_cloud=projects/*/locations/*/privateClouds/*}:resetVcenterCredentials:\x01*\x12\xc6\x01\n\x10GetDnsForwarding\x12\x35.google.cloud.vmwareengine.v1.GetDnsForwardingRequest\x1a+.google.cloud.vmwareengine.v1.DnsForwarding\"N\xda\x41\x04name\x82\xd3\xe4\x93\x02\x41\x12?/v1/{name=projects/*/locations/*/privateClouds/*/dnsForwarding}\x12\x99\x02\n\x13UpdateDnsForwarding\x12\x38.google.cloud.vmwareengine.v1.UpdateDnsForwardingRequest\x1a\x1d.google.longrunning.Operation\"\xa8\x01\xca\x41\"\n\rDnsForwarding\x12\x11OperationMetadata\xda\x41\x1a\x64ns_forwarding,update_mask\x82\xd3\xe4\x93\x02`2N/v1/{dns_forwarding.name=projects/*/locations/*/privateClouds/*/dnsForwarding}:\x0e\x64ns_forwarding\x12\xbd\x01\n\x11GetNetworkPeering\x12\x36.google.cloud.vmwareengine.v1.GetNetworkPeeringRequest\x1a,.google.cloud.vmwareengine.v1.NetworkPeering\"B\xda\x41\x04name\x82\xd3\xe4\x93\x02\x35\x12\x33/v1/{name=projects/*/locations/*/networkPeerings/*}\x12\xd0\x01\n\x13ListNetworkPeerings\x12\x38.google.cloud.vmwareengine.v1.ListNetworkPeeringsRequest\x1a\x39.google.cloud.vmwareengine.v1.ListNetworkPeeringsResponse\"D\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x35\x12\x33/v1/{parent=projects/*/locations/*}/networkPeerings\x12\x91\x02\n\x14\x43reateNetworkPeering\x12\x39.google.cloud.vmwareengine.v1.CreateNetworkPeeringRequest\x1a\x1d.google.longrunning.Operation\"\x9e\x01\xca\x41#\n\x0eNetworkPeering\x12\x11OperationMetadata\xda\x41)parent,network_peering,network_peering_id\x82\xd3\xe4\x93\x02\x46\"3/v1/{parent=projects/*/locations/*}/networkPeerings:\x0fnetwork_peering\x12\xe1\x01\n\x14\x44\x65leteNetworkPeering\x12\x39.google.cloud.vmwareengine.v1.DeleteNetworkPeeringRequest\x1a\x1d.google.longrunning.Operation\"o\xca\x41*\n\x15google.protobuf.Empty\x12\x11OperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02\x35*3/v1/{name=projects/*/locations/*/networkPeerings/*}\x12\x93\x02\n\x14UpdateNetworkPeering\x12\x39.google.cloud.vmwareengine.v1.UpdateNetworkPeeringRequest\x1a\x1d.google.longrunning.Operation\"\xa0\x01\xca\x41#\n\x0eNetworkPeering\x12\x11OperationMetadata\xda\x41\x1bnetwork_peering,update_mask\x82\xd3\xe4\x93\x02V2C/v1/{network_peering.name=projects/*/locations/*/networkPeerings/*}:\x0fnetwork_peering\x12\xda\x01\n\x11ListPeeringRoutes\x12\x36.google.cloud.vmwareengine.v1.ListPeeringRoutesRequest\x1a\x37.google.cloud.vmwareengine.v1.ListPeeringRoutesResponse\"T\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x45\x12\x43/v1/{parent=projects/*/locations/*/networkPeerings/*}/peeringRoutes\x12\xb2\x02\n\x16\x43reateHcxActivationKey\x12;.google.cloud.vmwareengine.v1.CreateHcxActivationKeyRequest\x1a\x1d.google.longrunning.Operation\"\xbb\x01\xca\x41%\n\x10HcxActivationKey\x12\x11OperationMetadata\xda\x41/parent,hcx_activation_key,hcx_activation_key_id\x82\xd3\xe4\x93\x02[\"E/v1/{parent=projects/*/locations/*/privateClouds/*}/hcxActivationKeys:\x12hcx_activation_key\x12\xe8\x01\n\x15ListHcxActivationKeys\x12:.google.cloud.vmwareengine.v1.ListHcxActivationKeysRequest\x1a;.google.cloud.vmwareengine.v1.ListHcxActivationKeysResponse\"V\xda\x41\x06parent\x82\xd3\xe4\x93\x02G\x12\x45/v1/{parent=projects/*/locations/*/privateClouds/*}/hcxActivationKeys\x12\xd5\x01\n\x13GetHcxActivationKey\x12\x38.google.cloud.vmwareengine.v1.GetHcxActivationKeyRequest\x1a..google.cloud.vmwareengine.v1.HcxActivationKey\"T\xda\x41\x04name\x82\xd3\xe4\x93\x02G\x12\x45/v1/{name=projects/*/locations/*/privateClouds/*/hcxActivationKeys/*}\x12\xba\x01\n\x10GetNetworkPolicy\x12\x35.google.cloud.vmwareengine.v1.GetNetworkPolicyRequest\x1a+.google.cloud.vmwareengine.v1.NetworkPolicy\"B\xda\x41\x04name\x82\xd3\xe4\x93\x02\x35\x12\x33/v1/{name=projects/*/locations/*/networkPolicies/*}\x12\xd0\x01\n\x13ListNetworkPolicies\x12\x38.google.cloud.vmwareengine.v1.ListNetworkPoliciesRequest\x1a\x39.google.cloud.vmwareengine.v1.ListNetworkPoliciesResponse\"D\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x35\x12\x33/v1/{parent=projects/*/locations/*}/networkPolicies\x12\x8b\x02\n\x13\x43reateNetworkPolicy\x12\x38.google.cloud.vmwareengine.v1.CreateNetworkPolicyRequest\x1a\x1d.google.longrunning.Operation\"\x9a\x01\xca\x41\"\n\rNetworkPolicy\x12\x11OperationMetadata\xda\x41\'parent,network_policy,network_policy_id\x82\xd3\xe4\x93\x02\x45\"3/v1/{parent=projects/*/locations/*}/networkPolicies:\x0enetwork_policy\x12\x8d\x02\n\x13UpdateNetworkPolicy\x12\x38.google.cloud.vmwareengine.v1.UpdateNetworkPolicyRequest\x1a\x1d.google.longrunning.Operation\"\x9c\x01\xca\x41\"\n\rNetworkPolicy\x12\x11OperationMetadata\xda\x41\x1anetwork_policy,update_mask\x82\xd3\xe4\x93\x02T2B/v1/{network_policy.name=projects/*/locations/*/networkPolicies/*}:\x0enetwork_policy\x12\xdf\x01\n\x13\x44\x65leteNetworkPolicy\x12\x38.google.cloud.vmwareengine.v1.DeleteNetworkPolicyRequest\x1a\x1d.google.longrunning.Operation\"o\xca\x41*\n\x15google.protobuf.Empty\x12\x11OperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02\x35*3/v1/{name=projects/*/locations/*/networkPolicies/*}\x12\x88\x02\n\x1dListManagementDnsZoneBindings\x12\x42.google.cloud.vmwareengine.v1.ListManagementDnsZoneBindingsRequest\x1a\x43.google.cloud.vmwareengine.v1.ListManagementDnsZoneBindingsResponse\"^\xda\x41\x06parent\x82\xd3\xe4\x93\x02O\x12M/v1/{parent=projects/*/locations/*/privateClouds/*}/managementDnsZoneBindings\x12\xf5\x01\n\x1bGetManagementDnsZoneBinding\x12@.google.cloud.vmwareengine.v1.GetManagementDnsZoneBindingRequest\x1a\x36.google.cloud.vmwareengine.v1.ManagementDnsZoneBinding\"\\\xda\x41\x04name\x82\xd3\xe4\x93\x02O\x12M/v1/{name=projects/*/locations/*/privateClouds/*/managementDnsZoneBindings/*}\x12\xed\x02\n\x1e\x43reateManagementDnsZoneBinding\x12\x43.google.cloud.vmwareengine.v1.CreateManagementDnsZoneBindingRequest\x1a\x1d.google.longrunning.Operation\"\xe6\x01\xca\x41-\n\x18ManagementDnsZoneBinding\x12\x11OperationMetadata\xda\x41\x41parent,management_dns_zone_binding,management_dns_zone_binding_id\x82\xd3\xe4\x93\x02l\"M/v1/{parent=projects/*/locations/*/privateClouds/*}/managementDnsZoneBindings:\x1bmanagement_dns_zone_binding\x12\xf0\x02\n\x1eUpdateManagementDnsZoneBinding\x12\x43.google.cloud.vmwareengine.v1.UpdateManagementDnsZoneBindingRequest\x1a\x1d.google.longrunning.Operation\"\xe9\x01\xca\x41-\n\x18ManagementDnsZoneBinding\x12\x11OperationMetadata\xda\x41\'management_dns_zone_binding,update_mask\x82\xd3\xe4\x93\x02\x88\x01\x32i/v1/{management_dns_zone_binding.name=projects/*/locations/*/privateClouds/*/managementDnsZoneBindings/*}:\x1bmanagement_dns_zone_binding\x12\x90\x02\n\x1e\x44\x65leteManagementDnsZoneBinding\x12\x43.google.cloud.vmwareengine.v1.DeleteManagementDnsZoneBindingRequest\x1a\x1d.google.longrunning.Operation\"\x89\x01\xca\x41*\n\x15google.protobuf.Empty\x12\x11OperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02O*M/v1/{name=projects/*/locations/*/privateClouds/*/managementDnsZoneBindings/*}\x12\x9d\x02\n\x1eRepairManagementDnsZoneBinding\x12\x43.google.cloud.vmwareengine.v1.RepairManagementDnsZoneBindingRequest\x1a\x1d.google.longrunning.Operation\"\x96\x01\xca\x41-\n\x18ManagementDnsZoneBinding\x12\x11OperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02Y\"T/v1/{name=projects/*/locations/*/privateClouds/*/managementDnsZoneBindings/*}:repair:\x01*\x12\xb7\x02\n\x19\x43reateVmwareEngineNetwork\x12>.google.cloud.vmwareengine.v1.CreateVmwareEngineNetworkRequest\x1a\x1d.google.longrunning.Operation\"\xba\x01\xca\x41(\n\x13VmwareEngineNetwork\x12\x11OperationMetadata\xda\x41\x35parent,vmware_engine_network,vmware_engine_network_id\x82\xd3\xe4\x93\x02Q\"8/v1/{parent=projects/*/locations/*}/vmwareEngineNetworks:\x15vmware_engine_network\x12\xb9\x02\n\x19UpdateVmwareEngineNetwork\x12>.google.cloud.vmwareengine.v1.UpdateVmwareEngineNetworkRequest\x1a\x1d.google.longrunning.Operation\"\xbc\x01\xca\x41(\n\x13VmwareEngineNetwork\x12\x11OperationMetadata\xda\x41!vmware_engine_network,update_mask\x82\xd3\xe4\x93\x02g2N/v1/{vmware_engine_network.name=projects/*/locations/*/vmwareEngineNetworks/*}:\x15vmware_engine_network\x12\xf0\x01\n\x19\x44\x65leteVmwareEngineNetwork\x12>.google.cloud.vmwareengine.v1.DeleteVmwareEngineNetworkRequest\x1a\x1d.google.longrunning.Operation\"t\xca\x41*\n\x15google.protobuf.Empty\x12\x11OperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02:*8/v1/{name=projects/*/locations/*/vmwareEngineNetworks/*}\x12\xd1\x01\n\x16GetVmwareEngineNetwork\x12;.google.cloud.vmwareengine.v1.GetVmwareEngineNetworkRequest\x1a\x31.google.cloud.vmwareengine.v1.VmwareEngineNetwork\"G\xda\x41\x04name\x82\xd3\xe4\x93\x02:\x12\x38/v1/{name=projects/*/locations/*/vmwareEngineNetworks/*}\x12\xe4\x01\n\x18ListVmwareEngineNetworks\x12=.google.cloud.vmwareengine.v1.ListVmwareEngineNetworksRequest\x1a>.google.cloud.vmwareengine.v1.ListVmwareEngineNetworksResponse\"I\xda\x41\x06parent\x82\xd3\xe4\x93\x02:\x12\x38/v1/{parent=projects/*/locations/*}/vmwareEngineNetworks\x12\xa6\x02\n\x17\x43reatePrivateConnection\x12<.google.cloud.vmwareengine.v1.CreatePrivateConnectionRequest\x1a\x1d.google.longrunning.Operation\"\xad\x01\xca\x41&\n\x11PrivateConnection\x12\x11OperationMetadata\xda\x41/parent,private_connection,private_connection_id\x82\xd3\xe4\x93\x02L\"6/v1/{parent=projects/*/locations/*}/privateConnections:\x12private_connection\x12\xc9\x01\n\x14GetPrivateConnection\x12\x39.google.cloud.vmwareengine.v1.GetPrivateConnectionRequest\x1a/.google.cloud.vmwareengine.v1.PrivateConnection\"E\xda\x41\x04name\x82\xd3\xe4\x93\x02\x38\x12\x36/v1/{name=projects/*/locations/*/privateConnections/*}\x12\xdc\x01\n\x16ListPrivateConnections\x12;.google.cloud.vmwareengine.v1.ListPrivateConnectionsRequest\x1a<.google.cloud.vmwareengine.v1.ListPrivateConnectionsResponse\"G\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x38\x12\x36/v1/{parent=projects/*/locations/*}/privateConnections\x12\xa8\x02\n\x17UpdatePrivateConnection\x12<.google.cloud.vmwareengine.v1.UpdatePrivateConnectionRequest\x1a\x1d.google.longrunning.Operation\"\xaf\x01\xca\x41&\n\x11PrivateConnection\x12\x11OperationMetadata\xda\x41\x1eprivate_connection,update_mask\x82\xd3\xe4\x93\x02_2I/v1/{private_connection.name=projects/*/locations/*/privateConnections/*}:\x12private_connection\x12\xea\x01\n\x17\x44\x65letePrivateConnection\x12<.google.cloud.vmwareengine.v1.DeletePrivateConnectionRequest\x1a\x1d.google.longrunning.Operation\"r\xca\x41*\n\x15google.protobuf.Empty\x12\x11OperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02\x38*6/v1/{name=projects/*/locations/*/privateConnections/*}\x12\x90\x02\n\"ListPrivateConnectionPeeringRoutes\x12G.google.cloud.vmwareengine.v1.ListPrivateConnectionPeeringRoutesRequest\x1aH.google.cloud.vmwareengine.v1.ListPrivateConnectionPeeringRoutesResponse\"W\xda\x41\x06parent\x82\xd3\xe4\x93\x02H\x12\x46/v1/{parent=projects/*/locations/*/privateConnections/*}/peeringRoutes\x12\xf4\x01\n\x16GrantDnsBindPermission\x12;.google.cloud.vmwareengine.v1.GrantDnsBindPermissionRequest\x1a\x1d.google.longrunning.Operation\"~\xca\x41&\n\x11\x44nsBindPermission\x12\x11OperationMetadata\xda\x41\x0ename,principal\x82\xd3\xe4\x93\x02>\"9/v1/{name=projects/*/locations/*/dnsBindPermission}:grant:\x01*\x12\xc6\x01\n\x14GetDnsBindPermission\x12\x39.google.cloud.vmwareengine.v1.GetDnsBindPermissionRequest\x1a/.google.cloud.vmwareengine.v1.DnsBindPermission\"B\xda\x41\x04name\x82\xd3\xe4\x93\x02\x35\x12\x33/v1/{name=projects/*/locations/*/dnsBindPermission}\x12\xf7\x01\n\x17RevokeDnsBindPermission\x12<.google.cloud.vmwareengine.v1.RevokeDnsBindPermissionRequest\x1a\x1d.google.longrunning.Operation\"\x7f\xca\x41&\n\x11\x44nsBindPermission\x12\x11OperationMetadata\xda\x41\x0ename,principal\x82\xd3\xe4\x93\x02?\":/v1/{name=projects/*/locations/*/dnsBindPermission}:revoke:\x01*\x1aO\xca\x41\x1bvmwareengine.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\xae\x02\n com.google.cloud.vmwareengine.v1B\x11VmwareengineProtoP\x01ZDcloud.google.com/go/vmwareengine/apiv1/vmwareenginepb;vmwareenginepb\xaa\x02\x1cGoogle.Cloud.VmwareEngine.V1\xca\x02\x1cGoogle\\Cloud\\VmwareEngine\\V1\xea\x02\x1fGoogle::Cloud::VmwareEngine::V1\xea\x41N\n\x1e\x63ompute.googleapis.com/Network\x12,projects/{project}/global/networks/{network}b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module VmwareEngine + module V1 + ListPrivateCloudsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.ListPrivateCloudsRequest").msgclass + ListPrivateCloudsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.ListPrivateCloudsResponse").msgclass + GetPrivateCloudRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.GetPrivateCloudRequest").msgclass + CreatePrivateCloudRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.CreatePrivateCloudRequest").msgclass + UpdatePrivateCloudRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.UpdatePrivateCloudRequest").msgclass + DeletePrivateCloudRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.DeletePrivateCloudRequest").msgclass + UndeletePrivateCloudRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.UndeletePrivateCloudRequest").msgclass + ListClustersRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.ListClustersRequest").msgclass + ListClustersResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.ListClustersResponse").msgclass + GetClusterRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.GetClusterRequest").msgclass + CreateClusterRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.CreateClusterRequest").msgclass + UpdateClusterRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.UpdateClusterRequest").msgclass + DeleteClusterRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.DeleteClusterRequest").msgclass + ListNodesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.ListNodesRequest").msgclass + ListNodesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.ListNodesResponse").msgclass + GetNodeRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.GetNodeRequest").msgclass + ListExternalAddressesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.ListExternalAddressesRequest").msgclass + ListExternalAddressesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.ListExternalAddressesResponse").msgclass + FetchNetworkPolicyExternalAddressesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.FetchNetworkPolicyExternalAddressesRequest").msgclass + FetchNetworkPolicyExternalAddressesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.FetchNetworkPolicyExternalAddressesResponse").msgclass + GetExternalAddressRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.GetExternalAddressRequest").msgclass + CreateExternalAddressRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.CreateExternalAddressRequest").msgclass + UpdateExternalAddressRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.UpdateExternalAddressRequest").msgclass + DeleteExternalAddressRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.DeleteExternalAddressRequest").msgclass + ListSubnetsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.ListSubnetsRequest").msgclass + ListSubnetsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.ListSubnetsResponse").msgclass + GetSubnetRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.GetSubnetRequest").msgclass + UpdateSubnetRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.UpdateSubnetRequest").msgclass + ListExternalAccessRulesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.ListExternalAccessRulesRequest").msgclass + ListExternalAccessRulesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.ListExternalAccessRulesResponse").msgclass + GetExternalAccessRuleRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.GetExternalAccessRuleRequest").msgclass + CreateExternalAccessRuleRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.CreateExternalAccessRuleRequest").msgclass + UpdateExternalAccessRuleRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.UpdateExternalAccessRuleRequest").msgclass + DeleteExternalAccessRuleRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.DeleteExternalAccessRuleRequest").msgclass + ListLoggingServersRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.ListLoggingServersRequest").msgclass + ListLoggingServersResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.ListLoggingServersResponse").msgclass + GetLoggingServerRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.GetLoggingServerRequest").msgclass + CreateLoggingServerRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.CreateLoggingServerRequest").msgclass + UpdateLoggingServerRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.UpdateLoggingServerRequest").msgclass + DeleteLoggingServerRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.DeleteLoggingServerRequest").msgclass + OperationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.OperationMetadata").msgclass + ListNodeTypesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.ListNodeTypesRequest").msgclass + ListNodeTypesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.ListNodeTypesResponse").msgclass + GetNodeTypeRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.GetNodeTypeRequest").msgclass + ShowNsxCredentialsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.ShowNsxCredentialsRequest").msgclass + ShowVcenterCredentialsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.ShowVcenterCredentialsRequest").msgclass + ResetNsxCredentialsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.ResetNsxCredentialsRequest").msgclass + ResetVcenterCredentialsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.ResetVcenterCredentialsRequest").msgclass + ListHcxActivationKeysResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.ListHcxActivationKeysResponse").msgclass + ListHcxActivationKeysRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.ListHcxActivationKeysRequest").msgclass + GetHcxActivationKeyRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.GetHcxActivationKeyRequest").msgclass + CreateHcxActivationKeyRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.CreateHcxActivationKeyRequest").msgclass + GetDnsForwardingRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.GetDnsForwardingRequest").msgclass + UpdateDnsForwardingRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.UpdateDnsForwardingRequest").msgclass + CreateNetworkPeeringRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.CreateNetworkPeeringRequest").msgclass + DeleteNetworkPeeringRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.DeleteNetworkPeeringRequest").msgclass + GetNetworkPeeringRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.GetNetworkPeeringRequest").msgclass + ListNetworkPeeringsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.ListNetworkPeeringsRequest").msgclass + UpdateNetworkPeeringRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.UpdateNetworkPeeringRequest").msgclass + ListNetworkPeeringsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.ListNetworkPeeringsResponse").msgclass + ListPeeringRoutesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.ListPeeringRoutesRequest").msgclass + ListPeeringRoutesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.ListPeeringRoutesResponse").msgclass + ListNetworkPoliciesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.ListNetworkPoliciesRequest").msgclass + ListNetworkPoliciesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.ListNetworkPoliciesResponse").msgclass + GetNetworkPolicyRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.GetNetworkPolicyRequest").msgclass + UpdateNetworkPolicyRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.UpdateNetworkPolicyRequest").msgclass + CreateNetworkPolicyRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.CreateNetworkPolicyRequest").msgclass + DeleteNetworkPolicyRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.DeleteNetworkPolicyRequest").msgclass + ListManagementDnsZoneBindingsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.ListManagementDnsZoneBindingsRequest").msgclass + ListManagementDnsZoneBindingsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.ListManagementDnsZoneBindingsResponse").msgclass + GetManagementDnsZoneBindingRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.GetManagementDnsZoneBindingRequest").msgclass + CreateManagementDnsZoneBindingRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.CreateManagementDnsZoneBindingRequest").msgclass + UpdateManagementDnsZoneBindingRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.UpdateManagementDnsZoneBindingRequest").msgclass + DeleteManagementDnsZoneBindingRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.DeleteManagementDnsZoneBindingRequest").msgclass + RepairManagementDnsZoneBindingRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.RepairManagementDnsZoneBindingRequest").msgclass + CreateVmwareEngineNetworkRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.CreateVmwareEngineNetworkRequest").msgclass + UpdateVmwareEngineNetworkRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.UpdateVmwareEngineNetworkRequest").msgclass + DeleteVmwareEngineNetworkRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.DeleteVmwareEngineNetworkRequest").msgclass + GetVmwareEngineNetworkRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.GetVmwareEngineNetworkRequest").msgclass + ListVmwareEngineNetworksRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.ListVmwareEngineNetworksRequest").msgclass + ListVmwareEngineNetworksResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.ListVmwareEngineNetworksResponse").msgclass + CreatePrivateConnectionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.CreatePrivateConnectionRequest").msgclass + GetPrivateConnectionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.GetPrivateConnectionRequest").msgclass + ListPrivateConnectionsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.ListPrivateConnectionsRequest").msgclass + ListPrivateConnectionsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.ListPrivateConnectionsResponse").msgclass + UpdatePrivateConnectionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.UpdatePrivateConnectionRequest").msgclass + DeletePrivateConnectionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.DeletePrivateConnectionRequest").msgclass + ListPrivateConnectionPeeringRoutesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.ListPrivateConnectionPeeringRoutesRequest").msgclass + ListPrivateConnectionPeeringRoutesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.ListPrivateConnectionPeeringRoutesResponse").msgclass + GrantDnsBindPermissionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.GrantDnsBindPermissionRequest").msgclass + RevokeDnsBindPermissionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.RevokeDnsBindPermissionRequest").msgclass + GetDnsBindPermissionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.GetDnsBindPermissionRequest").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-vmware_engine-v1/lib/google/cloud/vmwareengine/v1/vmwareengine_resources_pb.rb b/owl-bot-staging/google-cloud-vmware_engine-v1/lib/google/cloud/vmwareengine/v1/vmwareengine_resources_pb.rb new file mode 100644 index 000000000000..dfe653fa01c6 --- /dev/null +++ b/owl-bot-staging/google-cloud-vmware_engine-v1/lib/google/cloud/vmwareengine/v1/vmwareengine_resources_pb.rb @@ -0,0 +1,90 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/vmwareengine/v1/vmwareengine_resources.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/field_info_pb' +require 'google/api/resource_pb' +require 'google/protobuf/duration_pb' +require 'google/protobuf/timestamp_pb' + + +descriptor_data = "\n9google/cloud/vmwareengine/v1/vmwareengine_resources.proto\x12\x1cgoogle.cloud.vmwareengine.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x1bgoogle/api/field_info.proto\x1a\x19google/api/resource.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xb6\x02\n\rNetworkConfig\x12\x1c\n\x0fmanagement_cidr\x18\x04 \x01(\tB\x03\xe0\x41\x02\x12V\n\x15vmware_engine_network\x18\x05 \x01(\tB7\xe0\x41\x01\xfa\x41\x31\n/vmwareengine.googleapis.com/VmwareEngineNetwork\x12`\n\x1fvmware_engine_network_canonical\x18\x06 \x01(\tB7\xe0\x41\x03\xfa\x41\x31\n/vmwareengine.googleapis.com/VmwareEngineNetwork\x12\x31\n$management_ip_address_layout_version\x18\x08 \x01(\x05\x42\x03\xe0\x41\x03\x12\x1a\n\rdns_server_ip\x18\t \x01(\tB\x03\xe0\x41\x03\"I\n\x0eNodeTypeConfig\x12\x17\n\nnode_count\x18\x01 \x01(\x05\x42\x03\xe0\x41\x02\x12\x1e\n\x11\x63ustom_core_count\x18\x02 \x01(\x05\x42\x03\xe0\x41\x01\"\xa6\x01\n\x16StretchedClusterConfig\x12\x45\n\x12preferred_location\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\x12\x45\n\x12secondary_location\x18\x02 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\"\xfd\n\n\x0cPrivateCloud\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\x12\x34\n\x0bupdate_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0b\x64\x65lete_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\x44\n\x05state\x18\x08 \x01(\x0e\x32\x30.google.cloud.vmwareengine.v1.PrivateCloud.StateB\x03\xe0\x41\x03\x12H\n\x0enetwork_config\x18\t \x01(\x0b\x32+.google.cloud.vmwareengine.v1.NetworkConfigB\x03\xe0\x41\x02\x12`\n\x12management_cluster\x18\n \x01(\x0b\x32<.google.cloud.vmwareengine.v1.PrivateCloud.ManagementClusterB\x06\xe0\x41\x04\xe0\x41\x02\x12\x13\n\x0b\x64\x65scription\x18\x0b \x01(\t\x12\x33\n\x03hcx\x18\x11 \x01(\x0b\x32!.google.cloud.vmwareengine.v1.HcxB\x03\xe0\x41\x03\x12\x33\n\x03nsx\x18\x12 \x01(\x0b\x32!.google.cloud.vmwareengine.v1.NsxB\x03\xe0\x41\x03\x12;\n\x07vcenter\x18\x13 \x01(\x0b\x32%.google.cloud.vmwareengine.v1.VcenterB\x03\xe0\x41\x03\x12\x10\n\x03uid\x18\x14 \x01(\tB\x03\xe0\x41\x03\x12\x42\n\x04type\x18\x16 \x01(\x0e\x32/.google.cloud.vmwareengine.v1.PrivateCloud.TypeB\x03\xe0\x41\x01\x1a\xe2\x02\n\x11ManagementCluster\x12\x17\n\ncluster_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12q\n\x11node_type_configs\x18\x07 \x03(\x0b\x32Q.google.cloud.vmwareengine.v1.PrivateCloud.ManagementCluster.NodeTypeConfigsEntryB\x03\xe0\x41\x02\x12[\n\x18stretched_cluster_config\x18\x08 \x01(\x0b\x32\x34.google.cloud.vmwareengine.v1.StretchedClusterConfigB\x03\xe0\x41\x01\x1a\x64\n\x14NodeTypeConfigsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12;\n\x05value\x18\x02 \x01(\x0b\x32,.google.cloud.vmwareengine.v1.NodeTypeConfig:\x02\x38\x01\"l\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\n\n\x06\x41\x43TIVE\x10\x01\x12\x0c\n\x08\x43REATING\x10\x02\x12\x0c\n\x08UPDATING\x10\x03\x12\n\n\x06\x46\x41ILED\x10\x05\x12\x0b\n\x07\x44\x45LETED\x10\x06\x12\x0b\n\x07PURGING\x10\x07\"5\n\x04Type\x12\x0c\n\x08STANDARD\x10\x00\x12\x10\n\x0cTIME_LIMITED\x10\x01\x12\r\n\tSTRETCHED\x10\x02:t\xea\x41q\n(vmwareengine.googleapis.com/PrivateCloud\x12\x45projects/{project}/locations/{location}/privateClouds/{private_cloud}\"\xd3\x06\n\x07\x43luster\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\x12\x34\n\x0bupdate_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12?\n\x05state\x18\x06 \x01(\x0e\x32+.google.cloud.vmwareengine.v1.Cluster.StateB\x03\xe0\x41\x03\x12\x17\n\nmanagement\x18\x07 \x01(\x08\x42\x03\xe0\x41\x03\x12T\n\x14\x61utoscaling_settings\x18\x12 \x01(\x0b\x32\x31.google.cloud.vmwareengine.v1.AutoscalingSettingsB\x03\xe0\x41\x01\x12\x10\n\x03uid\x18\x0e \x01(\tB\x03\xe0\x41\x03\x12Z\n\x11node_type_configs\x18\x10 \x03(\x0b\x32:.google.cloud.vmwareengine.v1.Cluster.NodeTypeConfigsEntryB\x03\xe0\x41\x02\x12[\n\x18stretched_cluster_config\x18\x11 \x01(\x0b\x32\x34.google.cloud.vmwareengine.v1.StretchedClusterConfigB\x03\xe0\x41\x01\x1a\x64\n\x14NodeTypeConfigsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12;\n\x05value\x18\x02 \x01(\x0b\x32,.google.cloud.vmwareengine.v1.NodeTypeConfig:\x02\x38\x01\"c\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\n\n\x06\x41\x43TIVE\x10\x01\x12\x0c\n\x08\x43REATING\x10\x02\x12\x0c\n\x08UPDATING\x10\x03\x12\x0c\n\x08\x44\x45LETING\x10\x04\x12\r\n\tREPAIRING\x10\x05:\x82\x01\xea\x41\x7f\n#vmwareengine.googleapis.com/Cluster\x12Xprojects/{project}/locations/{location}/privateClouds/{private_cloud}/clusters/{cluster}\"\xba\x03\n\x04Node\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x11\n\x04\x66qdn\x18\x02 \x01(\tB\x03\xe0\x41\x03\x12\x18\n\x0binternal_ip\x18\x03 \x01(\tB\x03\xe0\x41\x03\x12\x19\n\x0cnode_type_id\x18\x04 \x01(\tB\x03\xe0\x41\x03\x12\x14\n\x07version\x18\x05 \x01(\tB\x03\xe0\x41\x03\x12\x1e\n\x11\x63ustom_core_count\x18\x06 \x01(\x03\x42\x03\xe0\x41\x03\x12<\n\x05state\x18\x07 \x01(\x0e\x32(.google.cloud.vmwareengine.v1.Node.StateB\x03\xe0\x41\x03\"S\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\n\n\x06\x41\x43TIVE\x10\x01\x12\x0c\n\x08\x43REATING\x10\x02\x12\n\n\x06\x46\x41ILED\x10\x03\x12\r\n\tUPGRADING\x10\x04:\x8d\x01\xea\x41\x89\x01\n vmwareengine.googleapis.com/Node\x12\x65projects/{project}/locations/{location}/privateClouds/{private_cloud}/clusters/{cluster}/nodes/{node}\"\xa5\x04\n\x0f\x45xternalAddress\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\x12\x34\n\x0bupdate_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x13\n\x0binternal_ip\x18\x06 \x01(\t\x12\x18\n\x0b\x65xternal_ip\x18\x07 \x01(\tB\x03\xe0\x41\x03\x12G\n\x05state\x18\x08 \x01(\x0e\x32\x33.google.cloud.vmwareengine.v1.ExternalAddress.StateB\x03\xe0\x41\x03\x12\x10\n\x03uid\x18\t \x01(\tB\x03\xe0\x41\x03\x12\x13\n\x0b\x64\x65scription\x18\x0b \x01(\t\"T\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\n\n\x06\x41\x43TIVE\x10\x01\x12\x0c\n\x08\x43REATING\x10\x02\x12\x0c\n\x08UPDATING\x10\x03\x12\x0c\n\x08\x44\x45LETING\x10\x04:\x9d\x01\xea\x41\x99\x01\n+vmwareengine.googleapis.com/ExternalAddress\x12jprojects/{project}/locations/{location}/privateClouds/{private_cloud}/externalAddresses/{external_address}\"\xa3\x03\n\x06Subnet\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x15\n\rip_cidr_range\x18\x07 \x01(\t\x12\x12\n\ngateway_ip\x18\x08 \x01(\t\x12\x11\n\x04type\x18\x0b \x01(\tB\x03\xe0\x41\x03\x12>\n\x05state\x18\r \x01(\x0e\x32*.google.cloud.vmwareengine.v1.Subnet.StateB\x03\xe0\x41\x03\x12\x14\n\x07vlan_id\x18\x10 \x01(\x05\x42\x03\xe0\x41\x03\"q\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\n\n\x06\x41\x43TIVE\x10\x01\x12\x0c\n\x08\x43REATING\x10\x02\x12\x0c\n\x08UPDATING\x10\x03\x12\x0c\n\x08\x44\x45LETING\x10\x04\x12\x0f\n\x0bRECONCILING\x10\x05\x12\n\n\x06\x46\x41ILED\x10\x06:\x7f\xea\x41|\n\"vmwareengine.googleapis.com/Subnet\x12Vprojects/{project}/locations/{location}/privateClouds/{private_cloud}/subnets/{subnet}\"\xa5\x08\n\x12\x45xternalAccessRule\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\x12\x34\n\x0bupdate_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x13\n\x0b\x64\x65scription\x18\x05 \x01(\t\x12\x10\n\x08priority\x18\x06 \x01(\x05\x12G\n\x06\x61\x63tion\x18\x07 \x01(\x0e\x32\x37.google.cloud.vmwareengine.v1.ExternalAccessRule.Action\x12\x13\n\x0bip_protocol\x18\x08 \x01(\t\x12R\n\x10source_ip_ranges\x18\t \x03(\x0b\x32\x38.google.cloud.vmwareengine.v1.ExternalAccessRule.IpRange\x12\x14\n\x0csource_ports\x18\n \x03(\t\x12W\n\x15\x64\x65stination_ip_ranges\x18\x0b \x03(\x0b\x32\x38.google.cloud.vmwareengine.v1.ExternalAccessRule.IpRange\x12\x19\n\x11\x64\x65stination_ports\x18\x0c \x03(\t\x12J\n\x05state\x18\r \x01(\x0e\x32\x36.google.cloud.vmwareengine.v1.ExternalAccessRule.StateB\x03\xe0\x41\x03\x12\x10\n\x03uid\x18\x0e \x01(\tB\x03\xe0\x41\x03\x1a\x95\x01\n\x07IpRange\x12\x14\n\nip_address\x18\x01 \x01(\tH\x00\x12\x1a\n\x10ip_address_range\x18\x02 \x01(\tH\x00\x12L\n\x10\x65xternal_address\x18\x03 \x01(\tB0\xfa\x41-\n+vmwareengine.googleapis.com/ExternalAddressH\x00\x42\n\n\x08ip_range\"5\n\x06\x41\x63tion\x12\x16\n\x12\x41\x43TION_UNSPECIFIED\x10\x00\x12\t\n\x05\x41LLOW\x10\x01\x12\x08\n\x04\x44\x45NY\x10\x02\"T\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\n\n\x06\x41\x43TIVE\x10\x01\x12\x0c\n\x08\x43REATING\x10\x02\x12\x0c\n\x08UPDATING\x10\x03\x12\x0c\n\x08\x44\x45LETING\x10\x04:\xa9\x01\xea\x41\xa5\x01\n.vmwareengine.googleapis.com/ExternalAccessRule\x12sprojects/{project}/locations/{location}/networkPolicies/{network_policy}/externalAccessRules/{external_access_rule}\"\x95\x05\n\rLoggingServer\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\x12\x34\n\x0bupdate_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x15\n\x08hostname\x18\x05 \x01(\tB\x03\xe0\x41\x02\x12\x11\n\x04port\x18\x07 \x01(\x05\x42\x03\xe0\x41\x02\x12K\n\x08protocol\x18\x06 \x01(\x0e\x32\x34.google.cloud.vmwareengine.v1.LoggingServer.ProtocolB\x03\xe0\x41\x02\x12P\n\x0bsource_type\x18\n \x01(\x0e\x32\x36.google.cloud.vmwareengine.v1.LoggingServer.SourceTypeB\x03\xe0\x41\x02\x12\x10\n\x03uid\x18\x08 \x01(\tB\x03\xe0\x41\x03\"R\n\x08Protocol\x12\x18\n\x14PROTOCOL_UNSPECIFIED\x10\x00\x12\x07\n\x03UDP\x10\x01\x12\x07\n\x03TCP\x10\x02\x12\x07\n\x03TLS\x10\x03\x12\x07\n\x03SSL\x10\x04\x12\x08\n\x04RELP\x10\x05\"=\n\nSourceType\x12\x1b\n\x17SOURCE_TYPE_UNSPECIFIED\x10\x00\x12\x08\n\x04\x45SXI\x10\x01\x12\x08\n\x04VCSA\x10\x02:\x96\x01\xea\x41\x92\x01\n)vmwareengine.googleapis.com/LoggingServer\x12\x65projects/{project}/locations/{location}/privateClouds/{private_cloud}/loggingServers/{logging_server}\"\xff\x04\n\x08NodeType\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x19\n\x0cnode_type_id\x18\x02 \x01(\tB\x03\xe0\x41\x03\x12\x19\n\x0c\x64isplay_name\x18\x03 \x01(\tB\x03\xe0\x41\x03\x12\x1e\n\x11virtual_cpu_count\x18\x04 \x01(\x05\x42\x03\xe0\x41\x03\x12\x1d\n\x10total_core_count\x18\x05 \x01(\x05\x42\x03\xe0\x41\x03\x12\x16\n\tmemory_gb\x18\x07 \x01(\x05\x42\x03\xe0\x41\x03\x12\x19\n\x0c\x64isk_size_gb\x18\x08 \x01(\x05\x42\x03\xe0\x41\x03\x12)\n\x1c\x61vailable_custom_core_counts\x18\x0b \x03(\x05\x42\x03\xe0\x41\x03\x12>\n\x04kind\x18\x0c \x01(\x0e\x32+.google.cloud.vmwareengine.v1.NodeType.KindB\x03\xe0\x41\x03\x12\x15\n\x08\x66\x61milies\x18\r \x03(\tB\x03\xe0\x41\x03\x12L\n\x0c\x63\x61pabilities\x18\x0e \x03(\x0e\x32\x31.google.cloud.vmwareengine.v1.NodeType.CapabilityB\x03\xe0\x41\x03\"<\n\x04Kind\x12\x14\n\x10KIND_UNSPECIFIED\x10\x00\x12\x0c\n\x08STANDARD\x10\x01\x12\x10\n\x0cSTORAGE_ONLY\x10\x02\"@\n\nCapability\x12\x1a\n\x16\x43\x41PABILITY_UNSPECIFIED\x10\x00\x12\x16\n\x12STRETCHED_CLUSTERS\x10\x01:h\xea\x41\x65\n$vmwareengine.googleapis.com/NodeType\x12=projects/{project}/locations/{location}/nodeTypes/{node_type}\"1\n\x0b\x43redentials\x12\x10\n\x08username\x18\x01 \x01(\t\x12\x10\n\x08password\x18\x02 \x01(\t\"\xc2\x03\n\x10HcxActivationKey\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\x12H\n\x05state\x18\x03 \x01(\x0e\x32\x34.google.cloud.vmwareengine.v1.HcxActivationKey.StateB\x03\xe0\x41\x03\x12\x1b\n\x0e\x61\x63tivation_key\x18\x04 \x01(\tB\x03\xe0\x41\x03\x12\x10\n\x03uid\x18\x05 \x01(\tB\x03\xe0\x41\x03\"I\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\r\n\tAVAILABLE\x10\x01\x12\x0c\n\x08\x43ONSUMED\x10\x02\x12\x0c\n\x08\x43REATING\x10\x03:\xa0\x01\xea\x41\x9c\x01\n,vmwareengine.googleapis.com/HcxActivationKey\x12lprojects/{project}/locations/{location}/privateClouds/{private_cloud}/hcxActivationKeys/{hcx_activation_key}\"\xc0\x01\n\x03Hcx\x12\x13\n\x0binternal_ip\x18\x02 \x01(\t\x12\x0f\n\x07version\x18\x04 \x01(\t\x12;\n\x05state\x18\x05 \x01(\x0e\x32\'.google.cloud.vmwareengine.v1.Hcx.StateB\x03\xe0\x41\x03\x12\x0c\n\x04\x66qdn\x18\x06 \x01(\t\"H\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\n\n\x06\x41\x43TIVE\x10\x01\x12\x0c\n\x08\x43REATING\x10\x02\x12\x0e\n\nACTIVATING\x10\x03\"\xb0\x01\n\x03Nsx\x12\x13\n\x0binternal_ip\x18\x02 \x01(\t\x12\x0f\n\x07version\x18\x04 \x01(\t\x12;\n\x05state\x18\x05 \x01(\x0e\x32\'.google.cloud.vmwareengine.v1.Nsx.StateB\x03\xe0\x41\x03\x12\x0c\n\x04\x66qdn\x18\x06 \x01(\t\"8\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\n\n\x06\x41\x43TIVE\x10\x01\x12\x0c\n\x08\x43REATING\x10\x02\"\xb8\x01\n\x07Vcenter\x12\x13\n\x0binternal_ip\x18\x02 \x01(\t\x12\x0f\n\x07version\x18\x04 \x01(\t\x12?\n\x05state\x18\x05 \x01(\x0e\x32+.google.cloud.vmwareengine.v1.Vcenter.StateB\x03\xe0\x41\x03\x12\x0c\n\x04\x66qdn\x18\x06 \x01(\t\"8\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\n\n\x06\x41\x43TIVE\x10\x01\x12\x0c\n\x08\x43REATING\x10\x02\"\x9b\x07\n\x13\x41utoscalingSettings\x12m\n\x14\x61utoscaling_policies\x18\x01 \x03(\x0b\x32J.google.cloud.vmwareengine.v1.AutoscalingSettings.AutoscalingPoliciesEntryB\x03\xe0\x41\x02\x12#\n\x16min_cluster_node_count\x18\x02 \x01(\x05\x42\x03\xe0\x41\x01\x12#\n\x16max_cluster_node_count\x18\x03 \x01(\x05\x42\x03\xe0\x41\x01\x12\x38\n\x10\x63ool_down_period\x18\x04 \x01(\x0b\x32\x19.google.protobuf.DurationB\x03\xe0\x41\x01\x1a;\n\nThresholds\x12\x16\n\tscale_out\x18\x01 \x01(\x05\x42\x03\xe0\x41\x02\x12\x15\n\x08scale_in\x18\x02 \x01(\x05\x42\x03\xe0\x41\x02\x1a\xd2\x03\n\x11\x41utoscalingPolicy\x12\x19\n\x0cnode_type_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x1b\n\x0escale_out_size\x18\x02 \x01(\x05\x42\x03\xe0\x41\x02\x12Y\n\x0e\x63pu_thresholds\x18\x0b \x01(\x0b\x32<.google.cloud.vmwareengine.v1.AutoscalingSettings.ThresholdsB\x03\xe0\x41\x01\x12\x64\n\x19granted_memory_thresholds\x18\x0c \x01(\x0b\x32<.google.cloud.vmwareengine.v1.AutoscalingSettings.ThresholdsB\x03\xe0\x41\x01\x12\x65\n\x1a\x63onsumed_memory_thresholds\x18\r \x01(\x0b\x32<.google.cloud.vmwareengine.v1.AutoscalingSettings.ThresholdsB\x03\xe0\x41\x01\x12]\n\x12storage_thresholds\x18\x0e \x01(\x0b\x32<.google.cloud.vmwareengine.v1.AutoscalingSettings.ThresholdsB\x03\xe0\x41\x01\x1a\x7f\n\x18\x41utoscalingPoliciesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12R\n\x05value\x18\x02 \x01(\x0b\x32\x43.google.cloud.vmwareengine.v1.AutoscalingSettings.AutoscalingPolicy:\x02\x38\x01\"\xb2\x03\n\rDnsForwarding\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\x12\x34\n\x0bupdate_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12Y\n\x10\x66orwarding_rules\x18\x04 \x03(\x0b\x32:.google.cloud.vmwareengine.v1.DnsForwarding.ForwardingRuleB\x03\xe0\x41\x02\x1a@\n\x0e\x46orwardingRule\x12\x13\n\x06\x64omain\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x19\n\x0cname_servers\x18\x02 \x03(\tB\x03\xe0\x41\x02:\x84\x01\xea\x41\x80\x01\n)vmwareengine.googleapis.com/DnsForwarding\x12Sprojects/{project}/locations/{location}/privateClouds/{private_cloud}/dnsForwarding\"\xc4\n\n\x0eNetworkPeering\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\x12\x34\n\x0bupdate_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x19\n\x0cpeer_network\x18\x05 \x01(\tB\x03\xe0\x41\x02\x12&\n\x14\x65xport_custom_routes\x18\x08 \x01(\x08\x42\x03\xe0\x41\x01H\x00\x88\x01\x01\x12&\n\x14import_custom_routes\x18\t \x01(\x08\x42\x03\xe0\x41\x01H\x01\x88\x01\x01\x12(\n\x16\x65xchange_subnet_routes\x18\n \x01(\x08\x42\x03\xe0\x41\x01H\x02\x88\x01\x01\x12\x35\n#export_custom_routes_with_public_ip\x18\x0b \x01(\x08\x42\x03\xe0\x41\x01H\x03\x88\x01\x01\x12\x35\n#import_custom_routes_with_public_ip\x18\x0c \x01(\x08\x42\x03\xe0\x41\x01H\x04\x88\x01\x01\x12\x46\n\x05state\x18\r \x01(\x0e\x32\x32.google.cloud.vmwareengine.v1.NetworkPeering.StateB\x03\xe0\x41\x03\x12\x1a\n\rstate_details\x18\x07 \x01(\tB\x03\xe0\x41\x03\x12\x15\n\x08peer_mtu\x18\x0e \x01(\x05\x42\x03\xe0\x41\x01\x12\\\n\x11peer_network_type\x18\x10 \x01(\x0e\x32<.google.cloud.vmwareengine.v1.NetworkPeering.PeerNetworkTypeB\x03\xe0\x41\x02\x12\x10\n\x03uid\x18\x11 \x01(\tB\x03\xe0\x41\x03\x12V\n\x15vmware_engine_network\x18\x14 \x01(\tB7\xe0\x41\x02\xfa\x41\x31\n/vmwareengine.googleapis.com/VmwareEngineNetwork\x12\x18\n\x0b\x64\x65scription\x18\x15 \x01(\tB\x03\xe0\x41\x01\"T\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0c\n\x08INACTIVE\x10\x01\x12\n\n\x06\x41\x43TIVE\x10\x02\x12\x0c\n\x08\x43REATING\x10\x03\x12\x0c\n\x08\x44\x45LETING\x10\x04\"\xe3\x01\n\x0fPeerNetworkType\x12!\n\x1dPEER_NETWORK_TYPE_UNSPECIFIED\x10\x00\x12\x0c\n\x08STANDARD\x10\x01\x12\x19\n\x15VMWARE_ENGINE_NETWORK\x10\x02\x12\x1b\n\x17PRIVATE_SERVICES_ACCESS\x10\x03\x12\x18\n\x14NETAPP_CLOUD_VOLUMES\x10\x04\x12\x17\n\x13THIRD_PARTY_SERVICE\x10\x05\x12\x13\n\x0f\x44\x45LL_POWERSCALE\x10\x06\x12\x1f\n\x1bGOOGLE_CLOUD_NETAPP_VOLUMES\x10\x07:z\xea\x41w\n*vmwareengine.googleapis.com/NetworkPeering\x12Iprojects/{project}/locations/{location}/networkPeerings/{network_peering}B\x17\n\x15_export_custom_routesB\x17\n\x15_import_custom_routesB\x19\n\x17_exchange_subnet_routesB&\n$_export_custom_routes_with_public_ipB&\n$_import_custom_routes_with_public_ip\"\xb6\x03\n\x0cPeeringRoute\x12\x17\n\ndest_range\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x42\n\x04type\x18\x02 \x01(\x0e\x32/.google.cloud.vmwareengine.v1.PeeringRoute.TypeB\x03\xe0\x41\x03\x12\x1c\n\x0fnext_hop_region\x18\x03 \x01(\tB\x03\xe0\x41\x03\x12\x15\n\x08priority\x18\x04 \x01(\x03\x42\x03\xe0\x41\x03\x12\x15\n\x08imported\x18\x05 \x01(\x08\x42\x03\xe0\x41\x03\x12L\n\tdirection\x18\x06 \x01(\x0e\x32\x34.google.cloud.vmwareengine.v1.PeeringRoute.DirectionB\x03\xe0\x41\x03\"k\n\x04Type\x12\x14\n\x10TYPE_UNSPECIFIED\x10\x00\x12\x19\n\x15\x44YNAMIC_PEERING_ROUTE\x10\x01\x12\x18\n\x14STATIC_PEERING_ROUTE\x10\x02\x12\x18\n\x14SUBNET_PEERING_ROUTE\x10\x03\"B\n\tDirection\x12\x19\n\x15\x44IRECTION_UNSPECIFIED\x10\x00\x12\x0c\n\x08INCOMING\x10\x01\x12\x0c\n\x08OUTGOING\x10\x02\"\xff\x06\n\rNetworkPolicy\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\x12\x34\n\x0bupdate_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12S\n\x0finternet_access\x18\x06 \x01(\x0b\x32:.google.cloud.vmwareengine.v1.NetworkPolicy.NetworkService\x12O\n\x0b\x65xternal_ip\x18\x07 \x01(\x0b\x32:.google.cloud.vmwareengine.v1.NetworkPolicy.NetworkService\x12\x1f\n\x12\x65\x64ge_services_cidr\x18\t \x01(\tB\x03\xe0\x41\x02\x12\x10\n\x03uid\x18\n \x01(\tB\x03\xe0\x41\x03\x12V\n\x15vmware_engine_network\x18\x0c \x01(\tB7\xe0\x41\x01\xfa\x41\x31\n/vmwareengine.googleapis.com/VmwareEngineNetwork\x12\x18\n\x0b\x64\x65scription\x18\r \x01(\tB\x03\xe0\x41\x01\x12`\n\x1fvmware_engine_network_canonical\x18\x0e \x01(\tB7\xe0\x41\x03\xfa\x41\x31\n/vmwareengine.googleapis.com/VmwareEngineNetwork\x1a\xc7\x01\n\x0eNetworkService\x12\x0f\n\x07\x65nabled\x18\x01 \x01(\x08\x12T\n\x05state\x18\x02 \x01(\x0e\x32@.google.cloud.vmwareengine.v1.NetworkPolicy.NetworkService.StateB\x03\xe0\x41\x03\"N\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x11\n\rUNPROVISIONED\x10\x01\x12\x0f\n\x0bRECONCILING\x10\x02\x12\n\n\x06\x41\x43TIVE\x10\x03:x\xea\x41u\n)vmwareengine.googleapis.com/NetworkPolicy\x12Hprojects/{project}/locations/{location}/networkPolicies/{network_policy}\"\xd3\x05\n\x18ManagementDnsZoneBinding\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\x12\x34\n\x0bupdate_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12P\n\x05state\x18\x08 \x01(\x0e\x32<.google.cloud.vmwareengine.v1.ManagementDnsZoneBinding.StateB\x03\xe0\x41\x03\x12\x13\n\x0b\x64\x65scription\x18\r \x01(\t\x12:\n\x0bvpc_network\x18\x0e \x01(\tB#\xfa\x41 \n\x1e\x63ompute.googleapis.com/NetworkH\x00\x12U\n\x15vmware_engine_network\x18\x0f \x01(\tB4\xfa\x41\x31\n/vmwareengine.googleapis.com/VmwareEngineNetworkH\x00\x12\x10\n\x03uid\x18\t \x01(\tB\x03\xe0\x41\x03\"`\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\n\n\x06\x41\x43TIVE\x10\x01\x12\x0c\n\x08\x43REATING\x10\x02\x12\x0c\n\x08UPDATING\x10\x03\x12\x0c\n\x08\x44\x45LETING\x10\x04\x12\n\n\x06\x46\x41ILED\x10\x05:\xb9\x01\xea\x41\xb5\x01\n4vmwareengine.googleapis.com/ManagementDnsZoneBinding\x12}projects/{project}/locations/{location}/privateClouds/{private_cloud}/managementDnsZoneBindings/{management_dns_zone_binding}B\x0e\n\x0c\x62ind_network\"\xc0\x07\n\x13VmwareEngineNetwork\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\x12\x34\n\x0bupdate_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x13\n\x0b\x64\x65scription\x18\x05 \x01(\t\x12W\n\x0cvpc_networks\x18\x06 \x03(\x0b\x32<.google.cloud.vmwareengine.v1.VmwareEngineNetwork.VpcNetworkB\x03\xe0\x41\x03\x12K\n\x05state\x18\x07 \x01(\x0e\x32\x37.google.cloud.vmwareengine.v1.VmwareEngineNetwork.StateB\x03\xe0\x41\x03\x12I\n\x04type\x18\x08 \x01(\x0e\x32\x36.google.cloud.vmwareengine.v1.VmwareEngineNetwork.TypeB\x03\xe0\x41\x02\x12\x10\n\x03uid\x18\t \x01(\tB\x03\xe0\x41\x03\x12\x0c\n\x04\x65tag\x18\n \x01(\t\x1a\xe7\x01\n\nVpcNetwork\x12T\n\x04type\x18\x01 \x01(\x0e\x32\x41.google.cloud.vmwareengine.v1.VmwareEngineNetwork.VpcNetwork.TypeB\x03\xe0\x41\x03\x12\x37\n\x07network\x18\x02 \x01(\tB&\xe0\x41\x03\xfa\x41 \n\x1e\x63ompute.googleapis.com/Network\"J\n\x04Type\x12\x14\n\x10TYPE_UNSPECIFIED\x10\x00\x12\x0c\n\x08INTRANET\x10\x01\x12\x0c\n\x08INTERNET\x10\x02\x12\x10\n\x0cGOOGLE_CLOUD\x10\x03\"T\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0c\n\x08\x43REATING\x10\x01\x12\n\n\x06\x41\x43TIVE\x10\x02\x12\x0c\n\x08UPDATING\x10\x03\x12\x0c\n\x08\x44\x45LETING\x10\x04\"6\n\x04Type\x12\x14\n\x10TYPE_UNSPECIFIED\x10\x00\x12\n\n\x06LEGACY\x10\x01\x12\x0c\n\x08STANDARD\x10\x02:\x8b\x01\xea\x41\x87\x01\n/vmwareengine.googleapis.com/VmwareEngineNetwork\x12Tprojects/{project}/locations/{location}/vmwareEngineNetworks/{vmware_engine_network}\"\xb7\n\n\x11PrivateConnection\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\x12\x34\n\x0bupdate_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x18\n\x0b\x64\x65scription\x18\x04 \x01(\tB\x03\xe0\x41\x01\x12I\n\x05state\x18\x05 \x01(\x0e\x32\x35.google.cloud.vmwareengine.v1.PrivateConnection.StateB\x03\xe0\x41\x03\x12V\n\x15vmware_engine_network\x18\x08 \x01(\tB7\xe0\x41\x02\xfa\x41\x31\n/vmwareengine.googleapis.com/VmwareEngineNetwork\x12`\n\x1fvmware_engine_network_canonical\x18\t \x01(\tB7\xe0\x41\x03\xfa\x41\x31\n/vmwareengine.googleapis.com/VmwareEngineNetwork\x12G\n\x04type\x18\n \x01(\x0e\x32\x34.google.cloud.vmwareengine.v1.PrivateConnection.TypeB\x03\xe0\x41\x02\x12\x17\n\npeering_id\x18\x0c \x01(\tB\x03\xe0\x41\x03\x12V\n\x0crouting_mode\x18\r \x01(\x0e\x32;.google.cloud.vmwareengine.v1.PrivateConnection.RoutingModeB\x03\xe0\x41\x01\x12\x10\n\x03uid\x18\x0e \x01(\tB\x03\xe0\x41\x03\x12?\n\x0fservice_network\x18\x10 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1e\x63ompute.googleapis.com/Network\x12X\n\rpeering_state\x18\x11 \x01(\x0e\x32<.google.cloud.vmwareengine.v1.PrivateConnection.PeeringStateB\x03\xe0\x41\x03\"s\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0c\n\x08\x43REATING\x10\x01\x12\n\n\x06\x41\x43TIVE\x10\x02\x12\x0c\n\x08UPDATING\x10\x03\x12\x0c\n\x08\x44\x45LETING\x10\x04\x12\x11\n\rUNPROVISIONED\x10\x05\x12\n\n\x06\x46\x41ILED\x10\x06\"\x80\x01\n\x04Type\x12\x14\n\x10TYPE_UNSPECIFIED\x10\x00\x12\x1a\n\x16PRIVATE_SERVICE_ACCESS\x10\x01\x12\x18\n\x14NETAPP_CLOUD_VOLUMES\x10\x02\x12\x13\n\x0f\x44\x45LL_POWERSCALE\x10\x03\x12\x17\n\x13THIRD_PARTY_SERVICE\x10\x04\"E\n\x0bRoutingMode\x12\x1c\n\x18ROUTING_MODE_UNSPECIFIED\x10\x00\x12\n\n\x06GLOBAL\x10\x01\x12\x0c\n\x08REGIONAL\x10\x02\"W\n\x0cPeeringState\x12\x1d\n\x19PEERING_STATE_UNSPECIFIED\x10\x00\x12\x12\n\x0ePEERING_ACTIVE\x10\x01\x12\x14\n\x10PEERING_INACTIVE\x10\x02:\x84\x01\xea\x41\x80\x01\n-vmwareengine.googleapis.com/PrivateConnection\x12Oprojects/{project}/locations/{location}/privateConnections/{private_connection}\"\xaa\x01\n\x10LocationMetadata\x12T\n\x0c\x63\x61pabilities\x18\x01 \x03(\x0e\x32\x39.google.cloud.vmwareengine.v1.LocationMetadata.CapabilityB\x03\xe0\x41\x03\"@\n\nCapability\x12\x1a\n\x16\x43\x41PABILITY_UNSPECIFIED\x10\x00\x12\x16\n\x12STRETCHED_CLUSTERS\x10\x01\"\xd7\x01\n\x11\x44nsBindPermission\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12@\n\nprincipals\x18\x02 \x03(\x0b\x32\'.google.cloud.vmwareengine.v1.PrincipalB\x03\xe0\x41\x03:m\xea\x41j\n-vmwareengine.googleapis.com/DnsBindPermission\x12\x39projects/{project}/locations/{location}/dnsBindPermission\"C\n\tPrincipal\x12\x0e\n\x04user\x18\x01 \x01(\tH\x00\x12\x19\n\x0fservice_account\x18\x02 \x01(\tH\x00\x42\x0b\n\tprincipalB\xe6\x01\n com.google.cloud.vmwareengine.v1B\x1aVmwareengineResourcesProtoP\x01ZDcloud.google.com/go/vmwareengine/apiv1/vmwareenginepb;vmwareenginepb\xaa\x02\x1cGoogle.Cloud.VmwareEngine.V1\xca\x02\x1cGoogle\\Cloud\\VmwareEngine\\V1\xea\x02\x1fGoogle::Cloud::VmwareEngine::V1b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module VmwareEngine + module V1 + NetworkConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.NetworkConfig").msgclass + NodeTypeConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.NodeTypeConfig").msgclass + StretchedClusterConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.StretchedClusterConfig").msgclass + PrivateCloud = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.PrivateCloud").msgclass + PrivateCloud::ManagementCluster = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.PrivateCloud.ManagementCluster").msgclass + PrivateCloud::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.PrivateCloud.State").enummodule + PrivateCloud::Type = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.PrivateCloud.Type").enummodule + Cluster = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.Cluster").msgclass + Cluster::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.Cluster.State").enummodule + Node = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.Node").msgclass + Node::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.Node.State").enummodule + ExternalAddress = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.ExternalAddress").msgclass + ExternalAddress::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.ExternalAddress.State").enummodule + Subnet = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.Subnet").msgclass + Subnet::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.Subnet.State").enummodule + ExternalAccessRule = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.ExternalAccessRule").msgclass + ExternalAccessRule::IpRange = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.ExternalAccessRule.IpRange").msgclass + ExternalAccessRule::Action = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.ExternalAccessRule.Action").enummodule + ExternalAccessRule::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.ExternalAccessRule.State").enummodule + LoggingServer = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.LoggingServer").msgclass + LoggingServer::Protocol = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.LoggingServer.Protocol").enummodule + LoggingServer::SourceType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.LoggingServer.SourceType").enummodule + NodeType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.NodeType").msgclass + NodeType::Kind = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.NodeType.Kind").enummodule + NodeType::Capability = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.NodeType.Capability").enummodule + Credentials = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.Credentials").msgclass + HcxActivationKey = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.HcxActivationKey").msgclass + HcxActivationKey::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.HcxActivationKey.State").enummodule + Hcx = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.Hcx").msgclass + Hcx::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.Hcx.State").enummodule + Nsx = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.Nsx").msgclass + Nsx::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.Nsx.State").enummodule + Vcenter = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.Vcenter").msgclass + Vcenter::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.Vcenter.State").enummodule + AutoscalingSettings = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.AutoscalingSettings").msgclass + AutoscalingSettings::Thresholds = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.AutoscalingSettings.Thresholds").msgclass + AutoscalingSettings::AutoscalingPolicy = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.AutoscalingSettings.AutoscalingPolicy").msgclass + DnsForwarding = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.DnsForwarding").msgclass + DnsForwarding::ForwardingRule = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.DnsForwarding.ForwardingRule").msgclass + NetworkPeering = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.NetworkPeering").msgclass + NetworkPeering::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.NetworkPeering.State").enummodule + NetworkPeering::PeerNetworkType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.NetworkPeering.PeerNetworkType").enummodule + PeeringRoute = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.PeeringRoute").msgclass + PeeringRoute::Type = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.PeeringRoute.Type").enummodule + PeeringRoute::Direction = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.PeeringRoute.Direction").enummodule + NetworkPolicy = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.NetworkPolicy").msgclass + NetworkPolicy::NetworkService = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.NetworkPolicy.NetworkService").msgclass + NetworkPolicy::NetworkService::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.NetworkPolicy.NetworkService.State").enummodule + ManagementDnsZoneBinding = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.ManagementDnsZoneBinding").msgclass + ManagementDnsZoneBinding::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.ManagementDnsZoneBinding.State").enummodule + VmwareEngineNetwork = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.VmwareEngineNetwork").msgclass + VmwareEngineNetwork::VpcNetwork = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.VmwareEngineNetwork.VpcNetwork").msgclass + VmwareEngineNetwork::VpcNetwork::Type = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.VmwareEngineNetwork.VpcNetwork.Type").enummodule + VmwareEngineNetwork::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.VmwareEngineNetwork.State").enummodule + VmwareEngineNetwork::Type = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.VmwareEngineNetwork.Type").enummodule + PrivateConnection = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.PrivateConnection").msgclass + PrivateConnection::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.PrivateConnection.State").enummodule + PrivateConnection::Type = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.PrivateConnection.Type").enummodule + PrivateConnection::RoutingMode = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.PrivateConnection.RoutingMode").enummodule + PrivateConnection::PeeringState = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.PrivateConnection.PeeringState").enummodule + LocationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.LocationMetadata").msgclass + LocationMetadata::Capability = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.LocationMetadata.Capability").enummodule + DnsBindPermission = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.DnsBindPermission").msgclass + Principal = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.Principal").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-vmware_engine-v1/lib/google/cloud/vmwareengine/v1/vmwareengine_services_pb.rb b/owl-bot-staging/google-cloud-vmware_engine-v1/lib/google/cloud/vmwareengine/v1/vmwareengine_services_pb.rb new file mode 100644 index 000000000000..b9f2781df554 --- /dev/null +++ b/owl-bot-staging/google-cloud-vmware_engine-v1/lib/google/cloud/vmwareengine/v1/vmwareengine_services_pb.rb @@ -0,0 +1,313 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/cloud/vmwareengine/v1/vmwareengine.proto for package 'Google.Cloud.VmwareEngine.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/vmwareengine/v1/vmwareengine_pb' + +module Google + module Cloud + module VmwareEngine + module V1 + module VmwareEngine + # VMwareEngine manages VMware's private clusters in the Cloud. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.cloud.vmwareengine.v1.VmwareEngine' + + # Lists `PrivateCloud` resources in a given project and location. + rpc :ListPrivateClouds, ::Google::Cloud::VmwareEngine::V1::ListPrivateCloudsRequest, ::Google::Cloud::VmwareEngine::V1::ListPrivateCloudsResponse + # Retrieves a `PrivateCloud` resource by its resource name. + rpc :GetPrivateCloud, ::Google::Cloud::VmwareEngine::V1::GetPrivateCloudRequest, ::Google::Cloud::VmwareEngine::V1::PrivateCloud + # Creates a new `PrivateCloud` resource in a given project and location. + # Private clouds of type `STANDARD` and + # `TIME_LIMITED` are zonal resources, `STRETCHED` private clouds are + # regional. + # Creating a private cloud also creates a [management + # cluster](https://cloud.google.com/vmware-engine/docs/concepts-vmware-components) + # for that private cloud. + rpc :CreatePrivateCloud, ::Google::Cloud::VmwareEngine::V1::CreatePrivateCloudRequest, ::Google::Longrunning::Operation + # Modifies a `PrivateCloud` resource. Only the following fields can be + # updated: `description`. + # Only fields specified in `updateMask` are applied. + # + # During operation processing, the resource is temporarily in the `ACTIVE` + # state before the operation fully completes. For that period of time, you + # can't update the resource. Use the operation status to determine when the + # processing fully completes. + rpc :UpdatePrivateCloud, ::Google::Cloud::VmwareEngine::V1::UpdatePrivateCloudRequest, ::Google::Longrunning::Operation + # Schedules a `PrivateCloud` resource for deletion. + # + # A `PrivateCloud` resource scheduled for deletion has `PrivateCloud.state` + # set to `DELETED` and `expireTime` set to the time when deletion is final + # and can no longer be reversed. The delete operation is marked as done + # as soon as the `PrivateCloud` is successfully scheduled for deletion + # (this also applies when `delayHours` is set to zero), and the operation is + # not kept in pending state until `PrivateCloud` is purged. + # `PrivateCloud` can be restored using `UndeletePrivateCloud` method before + # the `expireTime` elapses. When `expireTime` is reached, deletion is final + # and all private cloud resources are irreversibly removed and billing stops. + # During the final removal process, `PrivateCloud.state` is set to `PURGING`. + # `PrivateCloud` can be polled using standard `GET` method for the whole + # period of deletion and purging. It will not be returned only + # when it is completely purged. + rpc :DeletePrivateCloud, ::Google::Cloud::VmwareEngine::V1::DeletePrivateCloudRequest, ::Google::Longrunning::Operation + # Restores a private cloud that was previously scheduled for deletion by + # `DeletePrivateCloud`. A `PrivateCloud` resource scheduled for deletion has + # `PrivateCloud.state` set to `DELETED` and `PrivateCloud.expireTime` set to + # the time when deletion can no longer be reversed. + rpc :UndeletePrivateCloud, ::Google::Cloud::VmwareEngine::V1::UndeletePrivateCloudRequest, ::Google::Longrunning::Operation + # Lists `Cluster` resources in a given private cloud. + rpc :ListClusters, ::Google::Cloud::VmwareEngine::V1::ListClustersRequest, ::Google::Cloud::VmwareEngine::V1::ListClustersResponse + # Retrieves a `Cluster` resource by its resource name. + rpc :GetCluster, ::Google::Cloud::VmwareEngine::V1::GetClusterRequest, ::Google::Cloud::VmwareEngine::V1::Cluster + # Creates a new cluster in a given private cloud. + # Creating a new cluster provides additional nodes for + # use in the parent private cloud and requires sufficient [node + # quota](https://cloud.google.com/vmware-engine/quotas). + rpc :CreateCluster, ::Google::Cloud::VmwareEngine::V1::CreateClusterRequest, ::Google::Longrunning::Operation + # Modifies a `Cluster` resource. Only fields specified in `updateMask` are + # applied. + # + # During operation processing, the resource is temporarily in the `ACTIVE` + # state before the operation fully completes. For that period of time, you + # can't update the resource. Use the operation status to determine when the + # processing fully completes. + rpc :UpdateCluster, ::Google::Cloud::VmwareEngine::V1::UpdateClusterRequest, ::Google::Longrunning::Operation + # Deletes a `Cluster` resource. To avoid unintended data loss, migrate or + # gracefully shut down any workloads running on the cluster before deletion. + # You cannot delete the management cluster of a private cloud using this + # method. + rpc :DeleteCluster, ::Google::Cloud::VmwareEngine::V1::DeleteClusterRequest, ::Google::Longrunning::Operation + # Lists nodes in a given cluster. + rpc :ListNodes, ::Google::Cloud::VmwareEngine::V1::ListNodesRequest, ::Google::Cloud::VmwareEngine::V1::ListNodesResponse + # Gets details of a single node. + rpc :GetNode, ::Google::Cloud::VmwareEngine::V1::GetNodeRequest, ::Google::Cloud::VmwareEngine::V1::Node + # Lists external IP addresses assigned to VMware workload VMs in a given + # private cloud. + rpc :ListExternalAddresses, ::Google::Cloud::VmwareEngine::V1::ListExternalAddressesRequest, ::Google::Cloud::VmwareEngine::V1::ListExternalAddressesResponse + # Lists external IP addresses assigned to VMware workload VMs within the + # scope of the given network policy. + rpc :FetchNetworkPolicyExternalAddresses, ::Google::Cloud::VmwareEngine::V1::FetchNetworkPolicyExternalAddressesRequest, ::Google::Cloud::VmwareEngine::V1::FetchNetworkPolicyExternalAddressesResponse + # Gets details of a single external IP address. + rpc :GetExternalAddress, ::Google::Cloud::VmwareEngine::V1::GetExternalAddressRequest, ::Google::Cloud::VmwareEngine::V1::ExternalAddress + # Creates a new `ExternalAddress` resource in a given private cloud. The + # network policy that corresponds to the private cloud must have the external + # IP address network service enabled (`NetworkPolicy.external_ip`). + rpc :CreateExternalAddress, ::Google::Cloud::VmwareEngine::V1::CreateExternalAddressRequest, ::Google::Longrunning::Operation + # Updates the parameters of a single external IP address. + # Only fields specified in `update_mask` are applied. + # + # During operation processing, the resource is temporarily in the `ACTIVE` + # state before the operation fully completes. For that period of time, you + # can't update the resource. Use the operation status to determine when the + # processing fully completes. + rpc :UpdateExternalAddress, ::Google::Cloud::VmwareEngine::V1::UpdateExternalAddressRequest, ::Google::Longrunning::Operation + # Deletes a single external IP address. When you delete an external IP + # address, connectivity between the external IP address and the corresponding + # internal IP address is lost. + rpc :DeleteExternalAddress, ::Google::Cloud::VmwareEngine::V1::DeleteExternalAddressRequest, ::Google::Longrunning::Operation + # Lists subnets in a given private cloud. + rpc :ListSubnets, ::Google::Cloud::VmwareEngine::V1::ListSubnetsRequest, ::Google::Cloud::VmwareEngine::V1::ListSubnetsResponse + # Gets details of a single subnet. + rpc :GetSubnet, ::Google::Cloud::VmwareEngine::V1::GetSubnetRequest, ::Google::Cloud::VmwareEngine::V1::Subnet + # Updates the parameters of a single subnet. Only fields specified in + # `update_mask` are applied. + # + # *Note*: This API is synchronous and always returns a successful + # `google.longrunning.Operation` (LRO). The returned LRO will only have + # `done` and `response` fields. + rpc :UpdateSubnet, ::Google::Cloud::VmwareEngine::V1::UpdateSubnetRequest, ::Google::Longrunning::Operation + # Lists `ExternalAccessRule` resources in the specified network policy. + rpc :ListExternalAccessRules, ::Google::Cloud::VmwareEngine::V1::ListExternalAccessRulesRequest, ::Google::Cloud::VmwareEngine::V1::ListExternalAccessRulesResponse + # Gets details of a single external access rule. + rpc :GetExternalAccessRule, ::Google::Cloud::VmwareEngine::V1::GetExternalAccessRuleRequest, ::Google::Cloud::VmwareEngine::V1::ExternalAccessRule + # Creates a new external access rule in a given network policy. + rpc :CreateExternalAccessRule, ::Google::Cloud::VmwareEngine::V1::CreateExternalAccessRuleRequest, ::Google::Longrunning::Operation + # Updates the parameters of a single external access rule. + # Only fields specified in `update_mask` are applied. + rpc :UpdateExternalAccessRule, ::Google::Cloud::VmwareEngine::V1::UpdateExternalAccessRuleRequest, ::Google::Longrunning::Operation + # Deletes a single external access rule. + rpc :DeleteExternalAccessRule, ::Google::Cloud::VmwareEngine::V1::DeleteExternalAccessRuleRequest, ::Google::Longrunning::Operation + # Lists logging servers configured for a given private + # cloud. + rpc :ListLoggingServers, ::Google::Cloud::VmwareEngine::V1::ListLoggingServersRequest, ::Google::Cloud::VmwareEngine::V1::ListLoggingServersResponse + # Gets details of a logging server. + rpc :GetLoggingServer, ::Google::Cloud::VmwareEngine::V1::GetLoggingServerRequest, ::Google::Cloud::VmwareEngine::V1::LoggingServer + # Create a new logging server for a given private cloud. + rpc :CreateLoggingServer, ::Google::Cloud::VmwareEngine::V1::CreateLoggingServerRequest, ::Google::Longrunning::Operation + # Updates the parameters of a single logging server. + # Only fields specified in `update_mask` are applied. + rpc :UpdateLoggingServer, ::Google::Cloud::VmwareEngine::V1::UpdateLoggingServerRequest, ::Google::Longrunning::Operation + # Deletes a single logging server. + rpc :DeleteLoggingServer, ::Google::Cloud::VmwareEngine::V1::DeleteLoggingServerRequest, ::Google::Longrunning::Operation + # Lists node types + rpc :ListNodeTypes, ::Google::Cloud::VmwareEngine::V1::ListNodeTypesRequest, ::Google::Cloud::VmwareEngine::V1::ListNodeTypesResponse + # Gets details of a single `NodeType`. + rpc :GetNodeType, ::Google::Cloud::VmwareEngine::V1::GetNodeTypeRequest, ::Google::Cloud::VmwareEngine::V1::NodeType + # Gets details of credentials for NSX appliance. + rpc :ShowNsxCredentials, ::Google::Cloud::VmwareEngine::V1::ShowNsxCredentialsRequest, ::Google::Cloud::VmwareEngine::V1::Credentials + # Gets details of credentials for Vcenter appliance. + rpc :ShowVcenterCredentials, ::Google::Cloud::VmwareEngine::V1::ShowVcenterCredentialsRequest, ::Google::Cloud::VmwareEngine::V1::Credentials + # Resets credentials of the NSX appliance. + rpc :ResetNsxCredentials, ::Google::Cloud::VmwareEngine::V1::ResetNsxCredentialsRequest, ::Google::Longrunning::Operation + # Resets credentials of the Vcenter appliance. + rpc :ResetVcenterCredentials, ::Google::Cloud::VmwareEngine::V1::ResetVcenterCredentialsRequest, ::Google::Longrunning::Operation + # Gets details of the `DnsForwarding` config. + rpc :GetDnsForwarding, ::Google::Cloud::VmwareEngine::V1::GetDnsForwardingRequest, ::Google::Cloud::VmwareEngine::V1::DnsForwarding + # Updates the parameters of the `DnsForwarding` config, like associated + # domains. Only fields specified in `update_mask` are applied. + rpc :UpdateDnsForwarding, ::Google::Cloud::VmwareEngine::V1::UpdateDnsForwardingRequest, ::Google::Longrunning::Operation + # Retrieves a `NetworkPeering` resource by its resource name. The resource + # contains details of the network peering, such as peered + # networks, import and export custom route configurations, and peering state. + # NetworkPeering is a global resource and location can only be global. + rpc :GetNetworkPeering, ::Google::Cloud::VmwareEngine::V1::GetNetworkPeeringRequest, ::Google::Cloud::VmwareEngine::V1::NetworkPeering + # Lists `NetworkPeering` resources in a given project. NetworkPeering is a + # global resource and location can only be global. + rpc :ListNetworkPeerings, ::Google::Cloud::VmwareEngine::V1::ListNetworkPeeringsRequest, ::Google::Cloud::VmwareEngine::V1::ListNetworkPeeringsResponse + # Creates a new network peering between the peer network and VMware Engine + # network provided in a `NetworkPeering` resource. NetworkPeering is a + # global resource and location can only be global. + rpc :CreateNetworkPeering, ::Google::Cloud::VmwareEngine::V1::CreateNetworkPeeringRequest, ::Google::Longrunning::Operation + # Deletes a `NetworkPeering` resource. When a network peering is deleted for + # a VMware Engine network, the peer network becomes inaccessible to that + # VMware Engine network. NetworkPeering is a global resource and location can + # only be global. + rpc :DeleteNetworkPeering, ::Google::Cloud::VmwareEngine::V1::DeleteNetworkPeeringRequest, ::Google::Longrunning::Operation + # Modifies a `NetworkPeering` resource. Only the `description` field can be + # updated. Only fields specified in `updateMask` are applied. NetworkPeering + # is a global resource and location can only be global. + rpc :UpdateNetworkPeering, ::Google::Cloud::VmwareEngine::V1::UpdateNetworkPeeringRequest, ::Google::Longrunning::Operation + # Lists the network peering routes exchanged over a peering connection. + # NetworkPeering is a global resource and location can only be global. + rpc :ListPeeringRoutes, ::Google::Cloud::VmwareEngine::V1::ListPeeringRoutesRequest, ::Google::Cloud::VmwareEngine::V1::ListPeeringRoutesResponse + # Creates a new HCX activation key in a given private cloud. + rpc :CreateHcxActivationKey, ::Google::Cloud::VmwareEngine::V1::CreateHcxActivationKeyRequest, ::Google::Longrunning::Operation + # Lists `HcxActivationKey` resources in a given private cloud. + rpc :ListHcxActivationKeys, ::Google::Cloud::VmwareEngine::V1::ListHcxActivationKeysRequest, ::Google::Cloud::VmwareEngine::V1::ListHcxActivationKeysResponse + # Retrieves a `HcxActivationKey` resource by its resource name. + rpc :GetHcxActivationKey, ::Google::Cloud::VmwareEngine::V1::GetHcxActivationKeyRequest, ::Google::Cloud::VmwareEngine::V1::HcxActivationKey + # Retrieves a `NetworkPolicy` resource by its resource name. + rpc :GetNetworkPolicy, ::Google::Cloud::VmwareEngine::V1::GetNetworkPolicyRequest, ::Google::Cloud::VmwareEngine::V1::NetworkPolicy + # Lists `NetworkPolicy` resources in a specified project and location. + rpc :ListNetworkPolicies, ::Google::Cloud::VmwareEngine::V1::ListNetworkPoliciesRequest, ::Google::Cloud::VmwareEngine::V1::ListNetworkPoliciesResponse + # Creates a new network policy in a given VMware Engine network of a + # project and location (region). A new network policy cannot be created if + # another network policy already exists in the same scope. + rpc :CreateNetworkPolicy, ::Google::Cloud::VmwareEngine::V1::CreateNetworkPolicyRequest, ::Google::Longrunning::Operation + # Modifies a `NetworkPolicy` resource. Only the following fields can be + # updated: `internet_access`, `external_ip`, `edge_services_cidr`. + # Only fields specified in `updateMask` are applied. When updating a network + # policy, the external IP network service can only be disabled if there are + # no external IP addresses present in the scope of the policy. Also, a + # `NetworkService` cannot be updated when `NetworkService.state` is set + # to `RECONCILING`. + # + # During operation processing, the resource is temporarily in the `ACTIVE` + # state before the operation fully completes. For that period of time, you + # can't update the resource. Use the operation status to determine when the + # processing fully completes. + rpc :UpdateNetworkPolicy, ::Google::Cloud::VmwareEngine::V1::UpdateNetworkPolicyRequest, ::Google::Longrunning::Operation + # Deletes a `NetworkPolicy` resource. A network policy cannot be deleted + # when `NetworkService.state` is set to `RECONCILING` for either its external + # IP or internet access service. + rpc :DeleteNetworkPolicy, ::Google::Cloud::VmwareEngine::V1::DeleteNetworkPolicyRequest, ::Google::Longrunning::Operation + # Lists Consumer VPCs bound to Management DNS Zone of a given private cloud. + rpc :ListManagementDnsZoneBindings, ::Google::Cloud::VmwareEngine::V1::ListManagementDnsZoneBindingsRequest, ::Google::Cloud::VmwareEngine::V1::ListManagementDnsZoneBindingsResponse + # Retrieves a 'ManagementDnsZoneBinding' resource by its resource name. + rpc :GetManagementDnsZoneBinding, ::Google::Cloud::VmwareEngine::V1::GetManagementDnsZoneBindingRequest, ::Google::Cloud::VmwareEngine::V1::ManagementDnsZoneBinding + # Creates a new `ManagementDnsZoneBinding` resource in a private cloud. + # This RPC creates the DNS binding and the resource that represents the + # DNS binding of the consumer VPC network to the management DNS zone. A + # management DNS zone is the Cloud DNS cross-project binding zone that + # VMware Engine creates for each private cloud. It contains FQDNs and + # corresponding IP addresses for the private cloud's ESXi hosts and + # management VM appliances like vCenter and NSX Manager. + rpc :CreateManagementDnsZoneBinding, ::Google::Cloud::VmwareEngine::V1::CreateManagementDnsZoneBindingRequest, ::Google::Longrunning::Operation + # Updates a `ManagementDnsZoneBinding` resource. + # Only fields specified in `update_mask` are applied. + rpc :UpdateManagementDnsZoneBinding, ::Google::Cloud::VmwareEngine::V1::UpdateManagementDnsZoneBindingRequest, ::Google::Longrunning::Operation + # Deletes a `ManagementDnsZoneBinding` resource. When a management DNS zone + # binding is deleted, the corresponding consumer VPC network is no longer + # bound to the management DNS zone. + rpc :DeleteManagementDnsZoneBinding, ::Google::Cloud::VmwareEngine::V1::DeleteManagementDnsZoneBindingRequest, ::Google::Longrunning::Operation + # Retries to create a `ManagementDnsZoneBinding` resource that is + # in failed state. + rpc :RepairManagementDnsZoneBinding, ::Google::Cloud::VmwareEngine::V1::RepairManagementDnsZoneBindingRequest, ::Google::Longrunning::Operation + # Creates a new VMware Engine network that can be used by a private cloud. + rpc :CreateVmwareEngineNetwork, ::Google::Cloud::VmwareEngine::V1::CreateVmwareEngineNetworkRequest, ::Google::Longrunning::Operation + # Modifies a VMware Engine network resource. Only the following fields can be + # updated: `description`. Only fields specified in `updateMask` are + # applied. + rpc :UpdateVmwareEngineNetwork, ::Google::Cloud::VmwareEngine::V1::UpdateVmwareEngineNetworkRequest, ::Google::Longrunning::Operation + # Deletes a `VmwareEngineNetwork` resource. You can only delete a VMware + # Engine network after all resources that refer to it are deleted. For + # example, a private cloud, a network peering, and a network policy can all + # refer to the same VMware Engine network. + rpc :DeleteVmwareEngineNetwork, ::Google::Cloud::VmwareEngine::V1::DeleteVmwareEngineNetworkRequest, ::Google::Longrunning::Operation + # Retrieves a `VmwareEngineNetwork` resource by its resource name. The + # resource contains details of the VMware Engine network, such as its VMware + # Engine network type, peered networks in a service project, and state + # (for example, `CREATING`, `ACTIVE`, `DELETING`). + rpc :GetVmwareEngineNetwork, ::Google::Cloud::VmwareEngine::V1::GetVmwareEngineNetworkRequest, ::Google::Cloud::VmwareEngine::V1::VmwareEngineNetwork + # Lists `VmwareEngineNetwork` resources in a given project and location. + rpc :ListVmwareEngineNetworks, ::Google::Cloud::VmwareEngine::V1::ListVmwareEngineNetworksRequest, ::Google::Cloud::VmwareEngine::V1::ListVmwareEngineNetworksResponse + # Creates a new private connection that can be used for accessing private + # Clouds. + rpc :CreatePrivateConnection, ::Google::Cloud::VmwareEngine::V1::CreatePrivateConnectionRequest, ::Google::Longrunning::Operation + # Retrieves a `PrivateConnection` resource by its resource name. The resource + # contains details of the private connection, such as connected + # network, routing mode and state. + rpc :GetPrivateConnection, ::Google::Cloud::VmwareEngine::V1::GetPrivateConnectionRequest, ::Google::Cloud::VmwareEngine::V1::PrivateConnection + # Lists `PrivateConnection` resources in a given project and location. + rpc :ListPrivateConnections, ::Google::Cloud::VmwareEngine::V1::ListPrivateConnectionsRequest, ::Google::Cloud::VmwareEngine::V1::ListPrivateConnectionsResponse + # Modifies a `PrivateConnection` resource. Only `description` and + # `routing_mode` fields can be updated. Only fields specified in `updateMask` + # are applied. + rpc :UpdatePrivateConnection, ::Google::Cloud::VmwareEngine::V1::UpdatePrivateConnectionRequest, ::Google::Longrunning::Operation + # Deletes a `PrivateConnection` resource. When a private connection is + # deleted for a VMware Engine network, the connected network becomes + # inaccessible to that VMware Engine network. + rpc :DeletePrivateConnection, ::Google::Cloud::VmwareEngine::V1::DeletePrivateConnectionRequest, ::Google::Longrunning::Operation + # Lists the private connection routes exchanged over a peering connection. + rpc :ListPrivateConnectionPeeringRoutes, ::Google::Cloud::VmwareEngine::V1::ListPrivateConnectionPeeringRoutesRequest, ::Google::Cloud::VmwareEngine::V1::ListPrivateConnectionPeeringRoutesResponse + # Grants the bind permission to the customer provided principal(user / + # service account) to bind their DNS zone with the intranet VPC associated + # with the project. DnsBindPermission is a global resource and location can + # only be global. + rpc :GrantDnsBindPermission, ::Google::Cloud::VmwareEngine::V1::GrantDnsBindPermissionRequest, ::Google::Longrunning::Operation + # Gets all the principals having bind permission on the intranet VPC + # associated with the consumer project granted by the Grant API. + # DnsBindPermission is a global resource and location can only be global. + rpc :GetDnsBindPermission, ::Google::Cloud::VmwareEngine::V1::GetDnsBindPermissionRequest, ::Google::Cloud::VmwareEngine::V1::DnsBindPermission + # Revokes the bind permission from the customer provided principal(user / + # service account) on the intranet VPC associated with the consumer project. + # DnsBindPermission is a global resource and location can only be global. + rpc :RevokeDnsBindPermission, ::Google::Cloud::VmwareEngine::V1::RevokeDnsBindPermissionRequest, ::Google::Longrunning::Operation + end + + Stub = Service.rpc_stub_class + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-vmware_engine-v1/proto_docs/README.md b/owl-bot-staging/google-cloud-vmware_engine-v1/proto_docs/README.md new file mode 100644 index 000000000000..14206f5cd85e --- /dev/null +++ b/owl-bot-staging/google-cloud-vmware_engine-v1/proto_docs/README.md @@ -0,0 +1,4 @@ +# Google Cloud VMware Engine 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-vmware_engine-v1/proto_docs/google/api/client.rb b/owl-bot-staging/google-cloud-vmware_engine-v1/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..3ab0b096d445 --- /dev/null +++ b/owl-bot-staging/google-cloud-vmware_engine-v1/proto_docs/google/api/client.rb @@ -0,0 +1,593 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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. + # + # Note: This field should not be used in most cases. + 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: + # library_settings: + # 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. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Php. Clobbers the php_namespace option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.php.package_name" field + # in gapic.yaml. API teams should use the protobuf php_namespace option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # library_settings: + # php_settings: + # library_package: Google\Cloud\PubSub\V1 + 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. + # + # Example: + # + # 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 + # @!attribute [rw] batching + # @return [::Google::Api::BatchingConfigProto] + # Batching configuration for an API method in client libraries. + # + # Example of a YAML configuration: + # + # publishing: + # method_settings: + # - selector: google.example.v1.ExampleService.BatchCreateExample + # batching: + # element_count_threshold: 1000 + # request_byte_threshold: 100000000 + # delay_threshold_millis: 10 + 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. + # + # Note: This feature should not be used in most cases. + # @!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 + + # `BatchingConfigProto` defines the batching configuration for an API method. + # @!attribute [rw] thresholds + # @return [::Google::Api::BatchingSettingsProto] + # The thresholds which trigger a batched request to be sent. + # @!attribute [rw] batch_descriptor + # @return [::Google::Api::BatchingDescriptorProto] + # The request and response fields used in batching. + class BatchingConfigProto + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `BatchingSettingsProto` specifies a set of batching thresholds, each of + # which acts as a trigger to send a batch of messages as a request. At least + # one threshold must be positive nonzero. + # @!attribute [rw] element_count_threshold + # @return [::Integer] + # The number of elements of a field collected into a batch which, if + # exceeded, causes the batch to be sent. + # @!attribute [rw] request_byte_threshold + # @return [::Integer] + # The aggregated size of the batched field which, if exceeded, causes the + # batch to be sent. This size is computed by aggregating the sizes of the + # request field to be batched, not of the entire request message. + # @!attribute [rw] delay_threshold + # @return [::Google::Protobuf::Duration] + # The duration after which a batch should be sent, starting from the addition + # of the first message to that batch. + # @!attribute [rw] element_count_limit + # @return [::Integer] + # The maximum number of elements collected in a batch that could be accepted + # by server. + # @!attribute [rw] request_byte_limit + # @return [::Integer] + # The maximum size of the request that could be accepted by server. + # @!attribute [rw] flow_control_element_limit + # @return [::Integer] + # The maximum number of elements allowed by flow control. + # @!attribute [rw] flow_control_byte_limit + # @return [::Integer] + # The maximum size of data allowed by flow control. + # @!attribute [rw] flow_control_limit_exceeded_behavior + # @return [::Google::Api::FlowControlLimitExceededBehaviorProto] + # The behavior to take when the flow control limit is exceeded. + class BatchingSettingsProto + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `BatchingDescriptorProto` specifies the fields of the request message to be + # used for batching, and, optionally, the fields of the response message to be + # used for demultiplexing. + # @!attribute [rw] batched_field + # @return [::String] + # The repeated field in the request message to be aggregated by batching. + # @!attribute [rw] discriminator_fields + # @return [::Array<::String>] + # A list of the fields in the request message. Two requests will be batched + # together only if the values of every field specified in + # `request_discriminator_fields` is equal between the two requests. + # @!attribute [rw] subresponse_field + # @return [::String] + # Optional. When present, indicates the field in the response message to be + # used to demultiplex the response into multiple response messages, in + # correspondence with the multiple request messages originally batched + # together. + class BatchingDescriptorProto + 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 + + # The behavior to take when the flow control limit is exceeded. + module FlowControlLimitExceededBehaviorProto + # Default behavior, system-defined. + UNSET_BEHAVIOR = 0 + + # Stop operation, raise error. + THROW_EXCEPTION = 1 + + # Pause operation until limit clears. + BLOCK = 2 + + # Continue operation, disregard limit. + IGNORE = 3 + end + end +end diff --git a/owl-bot-staging/google-cloud-vmware_engine-v1/proto_docs/google/api/field_behavior.rb b/owl-bot-staging/google-cloud-vmware_engine-v1/proto_docs/google/api/field_behavior.rb new file mode 100644 index 000000000000..582be187d115 --- /dev/null +++ b/owl-bot-staging/google-cloud-vmware_engine-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-vmware_engine-v1/proto_docs/google/api/field_info.rb b/owl-bot-staging/google-cloud-vmware_engine-v1/proto_docs/google/api/field_info.rb new file mode 100644 index 000000000000..0f5acf0a5538 --- /dev/null +++ b/owl-bot-staging/google-cloud-vmware_engine-v1/proto_docs/google/api/field_info.rb @@ -0,0 +1,88 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 + # Rich semantic information of an API field beyond basic typing. + # @!attribute [rw] format + # @return [::Google::Api::FieldInfo::Format] + # The standard format of a field value. This does not explicitly configure + # any API consumer, just documents the API's format for the field it is + # applied to. + # @!attribute [rw] referenced_types + # @return [::Array<::Google::Api::TypeReference>] + # The type(s) that the annotated, generic field may represent. + # + # Currently, this must only be used on fields of type `google.protobuf.Any`. + # Supporting other generic types may be considered in the future. + class FieldInfo + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The standard format of a field value. The supported formats are all backed + # by either an RFC defined by the IETF or a Google-defined AIP. + module Format + # Default, unspecified value. + FORMAT_UNSPECIFIED = 0 + + # Universally Unique Identifier, version 4, value as defined by + # https://datatracker.ietf.org/doc/html/rfc4122. The value may be + # normalized to entirely lowercase letters. For example, the value + # `F47AC10B-58CC-0372-8567-0E02B2C3D479` would be normalized to + # `f47ac10b-58cc-0372-8567-0e02b2c3d479`. + UUID4 = 1 + + # Internet Protocol v4 value as defined by [RFC + # 791](https://datatracker.ietf.org/doc/html/rfc791). The value may be + # condensed, with leading zeros in each octet stripped. For example, + # `001.022.233.040` would be condensed to `1.22.233.40`. + IPV4 = 2 + + # Internet Protocol v6 value as defined by [RFC + # 2460](https://datatracker.ietf.org/doc/html/rfc2460). The value may be + # normalized to entirely lowercase letters with zeros compressed, following + # [RFC 5952](https://datatracker.ietf.org/doc/html/rfc5952). For example, + # the value `2001:0DB8:0::0` would be normalized to `2001:db8::`. + IPV6 = 3 + + # An IP address in either v4 or v6 format as described by the individual + # values defined herein. See the comments on the IPV4 and IPV6 types for + # allowed normalizations of each. + IPV4_OR_IPV6 = 4 + end + end + + # A reference to a message type, for use in {::Google::Api::FieldInfo FieldInfo}. + # @!attribute [rw] type_name + # @return [::String] + # The name of the type that the annotated, generic field may represent. + # If the type is in the same protobuf package, the value can be the simple + # message name e.g., `"MyMessage"`. Otherwise, the value must be the + # fully-qualified message name e.g., `"google.library.v1.Book"`. + # + # If the type(s) are unknown to the service (e.g. the field accepts generic + # user input), use the wildcard `"*"` to denote this behavior. + # + # See [AIP-202](https://google.aip.dev/202#type-references) for more details. + class TypeReference + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end +end diff --git a/owl-bot-staging/google-cloud-vmware_engine-v1/proto_docs/google/api/launch_stage.rb b/owl-bot-staging/google-cloud-vmware_engine-v1/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..9392a413fb1b --- /dev/null +++ b/owl-bot-staging/google-cloud-vmware_engine-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-vmware_engine-v1/proto_docs/google/api/resource.rb b/owl-bot-staging/google-cloud-vmware_engine-v1/proto_docs/google/api/resource.rb new file mode 100644 index 000000000000..25dec4847ac1 --- /dev/null +++ b/owl-bot-staging/google-cloud-vmware_engine-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-vmware_engine-v1/proto_docs/google/cloud/vmwareengine/v1/vmwareengine.rb b/owl-bot-staging/google-cloud-vmware_engine-v1/proto_docs/google/cloud/vmwareengine/v1/vmwareengine.rb new file mode 100644 index 000000000000..8a6e3f9ee9d2 --- /dev/null +++ b/owl-bot-staging/google-cloud-vmware_engine-v1/proto_docs/google/cloud/vmwareengine/v1/vmwareengine.rb @@ -0,0 +1,2791 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 VmwareEngine + module V1 + # Request message for + # {::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#list_private_clouds VmwareEngine.ListPrivateClouds} + # @!attribute [rw] parent + # @return [::String] + # Required. The resource name of the private cloud to be queried for + # clusters. Resource names are schemeless URIs that follow the conventions in + # https://cloud.google.com/apis/design/resource_names. + # For example: + # `projects/my-project/locations/us-central1-a` + # @!attribute [rw] page_size + # @return [::Integer] + # The maximum number of private clouds to return in one page. + # The service may return fewer than this value. + # The maximum value is coerced to 1000. + # The default value of this field is 500. + # @!attribute [rw] page_token + # @return [::String] + # A page token, received from a previous `ListPrivateClouds` call. + # Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to `ListPrivateClouds` must + # match the call that provided the page token. + # @!attribute [rw] filter + # @return [::String] + # A filter expression that matches resources returned in the response. + # The expression must specify the field name, a comparison operator, and the + # value that you want to use for filtering. The value must be a string, a + # number, or a boolean. The comparison operator must be `=`, `!=`, `>`, or + # `<`. + # + # For example, if you are filtering a list of private clouds, you can exclude + # the ones named `example-pc` by specifying `name != "example-pc"`. + # + # You can also filter nested fields. For example, you could specify + # `networkConfig.managementCidr = "192.168.0.0/24"` to include private clouds + # only if they have a matching address in their network configuration. + # + # To filter on multiple expressions, provide each separate expression within + # parentheses. For example: + # ``` + # (name = "example-pc") + # (createTime > "2021-04-12T08:15:10.40Z") + # ``` + # + # By default, each expression is an `AND` expression. However, you can + # include `AND` and `OR` expressions explicitly. For example: + # ``` + # (name = "private-cloud-1") AND + # (createTime > "2021-04-12T08:15:10.40Z") OR + # (name = "private-cloud-2") + # ``` + # @!attribute [rw] order_by + # @return [::String] + # Sorts list results by a certain order. By default, returned results are + # ordered by `name` in ascending order. You can also sort results in + # descending order based on the `name` value using `orderBy="name desc"`. + # Currently, only ordering by `name` is supported. + class ListPrivateCloudsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for + # {::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#list_private_clouds VmwareEngine.ListPrivateClouds} + # @!attribute [rw] private_clouds + # @return [::Array<::Google::Cloud::VmwareEngine::V1::PrivateCloud>] + # A list of private clouds. + # @!attribute [rw] next_page_token + # @return [::String] + # A token, which can be sent as `page_token` to retrieve the next page. + # If this field is omitted, there are no subsequent pages. + # @!attribute [rw] unreachable + # @return [::Array<::String>] + # Locations that could not be reached when making an aggregated query using + # wildcards. + class ListPrivateCloudsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#get_private_cloud VmwareEngine.GetPrivateCloud} + # @!attribute [rw] name + # @return [::String] + # Required. The resource name of the private cloud to retrieve. + # Resource names are schemeless URIs that follow the conventions in + # https://cloud.google.com/apis/design/resource_names. + # For example: + # `projects/my-project/locations/us-central1-a/privateClouds/my-cloud` + class GetPrivateCloudRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#create_private_cloud VmwareEngine.CreatePrivateCloud} + # @!attribute [rw] parent + # @return [::String] + # Required. The resource name of the location to create the new + # private cloud in. Resource names are schemeless URIs that follow the + # conventions in https://cloud.google.com/apis/design/resource_names. + # For example: + # `projects/my-project/locations/us-central1-a` + # @!attribute [rw] private_cloud_id + # @return [::String] + # Required. The user-provided identifier of the private cloud to be created. + # This identifier must be unique among each `PrivateCloud` within the parent + # and becomes the final token in the name URI. + # The identifier must meet the following requirements: + # + # * Only contains 1-63 alphanumeric characters and hyphens + # * Begins with an alphabetical character + # * Ends with a non-hyphen character + # * Not formatted as a UUID + # * Complies with [RFC 1034](https://datatracker.ietf.org/doc/html/rfc1034) + # (section 3.5) + # @!attribute [rw] private_cloud + # @return [::Google::Cloud::VmwareEngine::V1::PrivateCloud] + # Required. The initial description of the new private cloud. + # @!attribute [rw] request_id + # @return [::String] + # Optional. The request ID must be a valid UUID with the exception that zero + # UUID is not supported (00000000-0000-0000-0000-000000000000). + # @!attribute [rw] validate_only + # @return [::Boolean] + # Optional. True if you want the request to be validated and not executed; + # false otherwise. + class CreatePrivateCloudRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#update_private_cloud VmwareEngine.UpdatePrivateCloud} + # @!attribute [rw] private_cloud + # @return [::Google::Cloud::VmwareEngine::V1::PrivateCloud] + # Required. Private cloud description. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # Required. Field mask is used to specify the fields to be overwritten in the + # `PrivateCloud` resource by the update. The fields specified in `updateMask` + # are relative to the resource, not the full request. A field will be + # overwritten if it is in the mask. If the user does not provide a mask then + # all fields will be overwritten. + # @!attribute [rw] request_id + # @return [::String] + # Optional. The request ID must be a valid UUID with the exception that zero + # UUID is not supported (00000000-0000-0000-0000-000000000000). + class UpdatePrivateCloudRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#delete_private_cloud VmwareEngine.DeletePrivateCloud} + # @!attribute [rw] name + # @return [::String] + # Required. The resource name of the private cloud to delete. + # Resource names are schemeless URIs that follow the conventions in + # https://cloud.google.com/apis/design/resource_names. + # For example: + # `projects/my-project/locations/us-central1-a/privateClouds/my-cloud` + # @!attribute [rw] request_id + # @return [::String] + # Optional. The request ID must be a valid UUID with the exception that zero + # UUID is not supported (00000000-0000-0000-0000-000000000000). + # @!attribute [rw] force + # @return [::Boolean] + # Optional. If set to true, cascade delete is enabled and all children of + # this private cloud resource are also deleted. When this flag is set to + # false, the private cloud will not be deleted if there are any children + # other than the management cluster. The management cluster is always + # deleted. + # @!attribute [rw] delay_hours + # @return [::Integer] + # Optional. Time delay of the deletion specified in hours. The default value + # is `3`. Specifying a non-zero value for this field changes the value of + # `PrivateCloud.state` to `DELETED` and sets `expire_time` to the planned + # deletion time. Deletion can be cancelled before `expire_time` elapses using + # {::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#undelete_private_cloud VmwareEngine.UndeletePrivateCloud}. + # Specifying a value of `0` for this field instead begins the deletion + # process and ceases billing immediately. During the final deletion process, + # the value of `PrivateCloud.state` becomes `PURGING`. + class DeletePrivateCloudRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#undelete_private_cloud VmwareEngine.UndeletePrivateCloud} + # @!attribute [rw] name + # @return [::String] + # Required. The resource name of the private cloud scheduled for deletion. + # Resource names are schemeless URIs that follow the conventions in + # https://cloud.google.com/apis/design/resource_names. + # For example: + # `projects/my-project/locations/us-central1-a/privateClouds/my-cloud` + # @!attribute [rw] request_id + # @return [::String] + # Optional. The request ID must be a valid UUID with the exception that zero + # UUID is not supported (00000000-0000-0000-0000-000000000000). + class UndeletePrivateCloudRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#list_clusters VmwareEngine.ListClusters} + # @!attribute [rw] parent + # @return [::String] + # Required. The resource name of the private cloud to query for clusters. + # Resource names are schemeless URIs that follow the conventions in + # https://cloud.google.com/apis/design/resource_names. + # For example: + # `projects/my-project/locations/us-central1-a/privateClouds/my-cloud` + # @!attribute [rw] page_size + # @return [::Integer] + # The maximum number of clusters to return in one page. + # The service may return fewer than this value. + # The maximum value is coerced to 1000. + # The default value of this field is 500. + # @!attribute [rw] page_token + # @return [::String] + # A page token, received from a previous `ListClusters` call. + # Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to `ListClusters` + # must match the call that provided the page token. + # @!attribute [rw] filter + # @return [::String] + # To filter on multiple expressions, provide each separate expression within + # parentheses. For example: + # ``` + # (name = "example-cluster") + # (nodeCount = "3") + # ``` + # + # By default, each expression is an `AND` expression. However, you can + # include `AND` and `OR` expressions explicitly. For example: + # ``` + # (name = "example-cluster-1") AND + # (createTime > "2021-04-12T08:15:10.40Z") OR + # (name = "example-cluster-2") + # ``` + # @!attribute [rw] order_by + # @return [::String] + # Sorts list results by a certain order. By default, returned results are + # ordered by `name` in ascending order. You can also sort results in + # descending order based on the `name` value using `orderBy="name desc"`. + # Currently, only ordering by `name` is supported. + class ListClustersRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for + # {::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#list_clusters VmwareEngine.ListClusters} + # @!attribute [rw] clusters + # @return [::Array<::Google::Cloud::VmwareEngine::V1::Cluster>] + # A list of private cloud clusters. + # @!attribute [rw] next_page_token + # @return [::String] + # A token, which can be sent as `page_token` to retrieve the next page. + # If this field is omitted, there are no subsequent pages. + # @!attribute [rw] unreachable + # @return [::Array<::String>] + # Locations that could not be reached when making an aggregated query using + # wildcards. + class ListClustersResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#get_cluster VmwareEngine.GetCluster} + # @!attribute [rw] name + # @return [::String] + # Required. The cluster resource name to retrieve. + # Resource names are schemeless URIs that follow the conventions in + # https://cloud.google.com/apis/design/resource_names. + # For example: + # `projects/my-project/locations/us-central1-a/privateClouds/my-cloud/clusters/my-cluster` + class GetClusterRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#create_cluster VmwareEngine.CreateCluster} + # @!attribute [rw] parent + # @return [::String] + # Required. The resource name of the private cloud to create a new cluster + # in. Resource names are schemeless URIs that follow the conventions in + # https://cloud.google.com/apis/design/resource_names. + # For example: + # `projects/my-project/locations/us-central1-a/privateClouds/my-cloud` + # @!attribute [rw] cluster_id + # @return [::String] + # Required. The user-provided identifier of the new `Cluster`. + # This identifier must be unique among clusters within the parent and becomes + # the final token in the name URI. + # The identifier must meet the following requirements: + # + # * Only contains 1-63 alphanumeric characters and hyphens + # * Begins with an alphabetical character + # * Ends with a non-hyphen character + # * Not formatted as a UUID + # * Complies with [RFC 1034](https://datatracker.ietf.org/doc/html/rfc1034) + # (section 3.5) + # @!attribute [rw] cluster + # @return [::Google::Cloud::VmwareEngine::V1::Cluster] + # Required. The initial description of the new cluster. + # @!attribute [rw] request_id + # @return [::String] + # Optional. The request ID must be a valid UUID with the exception that zero + # UUID is not supported (00000000-0000-0000-0000-000000000000). + # @!attribute [rw] validate_only + # @return [::Boolean] + # Optional. True if you want the request to be validated and not executed; + # false otherwise. + class CreateClusterRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#update_cluster VmwareEngine.UpdateCluster} + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # Required. Field mask is used to specify the fields to be overwritten in the + # `Cluster` resource by the update. The fields specified in the `updateMask` + # are relative to the resource, not the full request. A field will be + # overwritten if it is in the mask. If the user does not provide a mask then + # all fields will be overwritten. + # @!attribute [rw] cluster + # @return [::Google::Cloud::VmwareEngine::V1::Cluster] + # Required. The description of the cluster. + # @!attribute [rw] request_id + # @return [::String] + # Optional. The request ID must be a valid UUID with the exception that + # zero UUID is not supported (00000000-0000-0000-0000-000000000000). + # @!attribute [rw] validate_only + # @return [::Boolean] + # Optional. True if you want the request to be validated and not executed; + # false otherwise. + class UpdateClusterRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#delete_cluster VmwareEngine.DeleteCluster} + # @!attribute [rw] name + # @return [::String] + # Required. The resource name of the cluster to delete. + # Resource names are schemeless URIs that follow the conventions in + # https://cloud.google.com/apis/design/resource_names. + # For example: + # `projects/my-project/locations/us-central1-a/privateClouds/my-cloud/clusters/my-cluster` + # @!attribute [rw] request_id + # @return [::String] + # Optional. The request ID must be a valid UUID with the exception that zero + # UUID is not supported (00000000-0000-0000-0000-000000000000). + class DeleteClusterRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#list_nodes VmwareEngine.ListNodes} + # @!attribute [rw] parent + # @return [::String] + # Required. The resource name of the cluster to be queried for nodes. + # Resource names are schemeless URIs that follow the conventions in + # https://cloud.google.com/apis/design/resource_names. + # For example: + # `projects/my-project/locations/us-central1-a/privateClouds/my-cloud/clusters/my-cluster` + # @!attribute [rw] page_size + # @return [::Integer] + # The maximum number of nodes to return in one page. + # The service may return fewer than this value. + # The maximum value is coerced to 1000. + # The default value of this field is 500. + # @!attribute [rw] page_token + # @return [::String] + # A page token, received from a previous `ListNodes` call. + # Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to + # `ListNodes` must match the call that provided the page + # token. + class ListNodesRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for + # {::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#list_nodes VmwareEngine.ListNodes} + # @!attribute [rw] nodes + # @return [::Array<::Google::Cloud::VmwareEngine::V1::Node>] + # The nodes. + # @!attribute [rw] next_page_token + # @return [::String] + # A token, which can be sent as `page_token` to retrieve the next page. + # If this field is omitted, there are no subsequent pages. + class ListNodesResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#get_node VmwareEngine.GetNode} + # @!attribute [rw] name + # @return [::String] + # Required. The resource name of the node to retrieve. + # For example: + # `projects/{project}/locations/{location}/privateClouds/{private_cloud}/clusters/{cluster}/nodes/{node}` + class GetNodeRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#list_external_addresses VmwareEngine.ListExternalAddresses} + # @!attribute [rw] parent + # @return [::String] + # Required. The resource name of the private cloud to be queried for + # external IP addresses. + # Resource names are schemeless URIs that follow the conventions in + # https://cloud.google.com/apis/design/resource_names. + # For example: + # `projects/my-project/locations/us-central1-a/privateClouds/my-cloud` + # @!attribute [rw] page_size + # @return [::Integer] + # The maximum number of external IP addresses to return in one page. + # The service may return fewer than this value. + # The maximum value is coerced to 1000. + # The default value of this field is 500. + # @!attribute [rw] page_token + # @return [::String] + # A page token, received from a previous `ListExternalAddresses` call. + # Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to + # `ListExternalAddresses` must match the call that provided the page token. + # @!attribute [rw] filter + # @return [::String] + # A filter expression that matches resources returned in the response. + # The expression must specify the field name, a comparison + # operator, and the value that you want to use for filtering. The value + # must be a string, a number, or a boolean. The comparison operator + # must be `=`, `!=`, `>`, or `<`. + # + # For example, if you are filtering a list of IP addresses, you can + # exclude the ones named `example-ip` by specifying + # `name != "example-ip"`. + # + # To filter on multiple expressions, provide each separate expression within + # parentheses. For example: + # ``` + # (name = "example-ip") + # (createTime > "2021-04-12T08:15:10.40Z") + # ``` + # + # By default, each expression is an `AND` expression. However, you + # can include `AND` and `OR` expressions explicitly. + # For example: + # ``` + # (name = "example-ip-1") AND + # (createTime > "2021-04-12T08:15:10.40Z") OR + # (name = "example-ip-2") + # ``` + # @!attribute [rw] order_by + # @return [::String] + # Sorts list results by a certain order. By default, returned results + # are ordered by `name` in ascending order. + # You can also sort results in descending order based on the `name` value + # using `orderBy="name desc"`. + # Currently, only ordering by `name` is supported. + class ListExternalAddressesRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for + # {::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#list_external_addresses VmwareEngine.ListExternalAddresses} + # @!attribute [rw] external_addresses + # @return [::Array<::Google::Cloud::VmwareEngine::V1::ExternalAddress>] + # A list of external IP addresses. + # @!attribute [rw] next_page_token + # @return [::String] + # A token, which can be sent as `page_token` to retrieve the next page. + # If this field is omitted, there are no subsequent pages. + # @!attribute [rw] unreachable + # @return [::Array<::String>] + # Locations that could not be reached when making an aggregated query using + # wildcards. + class ListExternalAddressesResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#fetch_network_policy_external_addresses VmwareEngine.FetchNetworkPolicyExternalAddresses} + # @!attribute [rw] network_policy + # @return [::String] + # Required. The resource name of the network policy to query for assigned + # external IP addresses. Resource names are schemeless URIs that follow the + # conventions in https://cloud.google.com/apis/design/resource_names. For + # example: + # `projects/my-project/locations/us-central1/networkPolicies/my-policy` + # @!attribute [rw] page_size + # @return [::Integer] + # The maximum number of external IP addresses to return in one page. + # The service may return fewer than this value. + # The maximum value is coerced to 1000. + # The default value of this field is 500. + # @!attribute [rw] page_token + # @return [::String] + # A page token, received from a previous + # `FetchNetworkPolicyExternalAddresses` call. Provide this to retrieve the + # subsequent page. + # + # When paginating, all parameters provided to + # `FetchNetworkPolicyExternalAddresses`, except for `page_size` and + # `page_token`, must match the call that provided the page token. + class FetchNetworkPolicyExternalAddressesRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for + # {::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#fetch_network_policy_external_addresses VmwareEngine.FetchNetworkPolicyExternalAddresses} + # @!attribute [rw] external_addresses + # @return [::Array<::Google::Cloud::VmwareEngine::V1::ExternalAddress>] + # A list of external IP addresses assigned to VMware workload VMs within the + # scope of the given network policy. + # @!attribute [rw] next_page_token + # @return [::String] + # A token, which can be sent as `page_token` to retrieve the next page. + # If this field is omitted, there are no subsequent pages. + class FetchNetworkPolicyExternalAddressesResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#get_external_address VmwareEngine.GetExternalAddress} + # @!attribute [rw] name + # @return [::String] + # Required. The resource name of the external IP address to retrieve. + # Resource names are schemeless URIs that follow the conventions in + # https://cloud.google.com/apis/design/resource_names. + # For example: + # `projects/my-project/locations/us-central1-a/privateClouds/my-cloud/externalAddresses/my-ip` + class GetExternalAddressRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#create_external_address VmwareEngine.CreateExternalAddress} + # @!attribute [rw] parent + # @return [::String] + # Required. The resource name of the private cloud + # to create a new external IP address in. + # Resource names are schemeless URIs that follow the conventions in + # https://cloud.google.com/apis/design/resource_names. + # For example: + # `projects/my-project/locations/us-central1-a/privateClouds/my-cloud` + # @!attribute [rw] external_address + # @return [::Google::Cloud::VmwareEngine::V1::ExternalAddress] + # Required. The initial description of a new external IP address. + # @!attribute [rw] external_address_id + # @return [::String] + # Required. The user-provided identifier of the `ExternalAddress` to be + # created. This identifier must be unique among `ExternalAddress` resources + # within the parent and becomes the final token in the name URI. The + # identifier must meet the following requirements: + # + # * Only contains 1-63 alphanumeric characters and hyphens + # * Begins with an alphabetical character + # * Ends with a non-hyphen character + # * Not formatted as a UUID + # * Complies with [RFC 1034](https://datatracker.ietf.org/doc/html/rfc1034) + # (section 3.5) + # @!attribute [rw] request_id + # @return [::String] + # Optional. A request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server guarantees that a + # request doesn't result in creation of duplicate commitments for at least 60 + # minutes. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request ID, + # the server can check if the original operation with the same request ID was + # received, and if so, will ignore the second request. This prevents clients + # from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + class CreateExternalAddressRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#update_external_address VmwareEngine.UpdateExternalAddress} + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # Required. Field mask is used to specify the fields to be overwritten in the + # `ExternalAddress` resource by the update. + # The fields specified in the `update_mask` are relative to the resource, not + # the full request. A field will be overwritten if it is in the mask. If the + # user does not provide a mask then all fields will be overwritten. + # @!attribute [rw] external_address + # @return [::Google::Cloud::VmwareEngine::V1::ExternalAddress] + # Required. External IP address description. + # @!attribute [rw] request_id + # @return [::String] + # Optional. A request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server guarantees that a + # request doesn't result in creation of duplicate commitments for at least 60 + # minutes. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request ID, + # the server can check if the original operation with the same request ID was + # received, and if so, will ignore the second request. This prevents clients + # from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + class UpdateExternalAddressRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#delete_external_address VmwareEngine.DeleteExternalAddress} + # @!attribute [rw] name + # @return [::String] + # Required. The resource name of the external IP address to delete. + # Resource names are schemeless URIs that follow the conventions in + # https://cloud.google.com/apis/design/resource_names. + # For example: + # `projects/my-project/locations/us-central1-a/privateClouds/my-cloud/externalAddresses/my-ip` + # @!attribute [rw] request_id + # @return [::String] + # Optional. A request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server guarantees that a + # request doesn't result in creation of duplicate commitments for at least 60 + # minutes. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request + # ID, the server can check if the original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + class DeleteExternalAddressRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#list_subnets VmwareEngine.ListSubnets} + # @!attribute [rw] parent + # @return [::String] + # Required. The resource name of the private cloud to be queried for + # subnets. + # Resource names are schemeless URIs that follow the conventions in + # https://cloud.google.com/apis/design/resource_names. + # For example: + # `projects/my-project/locations/us-central1-a/privateClouds/my-cloud` + # @!attribute [rw] page_size + # @return [::Integer] + # The maximum number of subnets to return in one page. + # The service may return fewer than this value. + # The maximum value is coerced to 1000. + # The default value of this field is 500. + # @!attribute [rw] page_token + # @return [::String] + # A page token, received from a previous `ListSubnetsRequest` call. + # Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to + # `ListSubnetsRequest` must match the call that provided the page token. + class ListSubnetsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for + # {::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#list_subnets VmwareEngine.ListSubnets} + # @!attribute [rw] subnets + # @return [::Array<::Google::Cloud::VmwareEngine::V1::Subnet>] + # A list of subnets. + # @!attribute [rw] next_page_token + # @return [::String] + # A token, which can be sent as `page_token` to retrieve the next page. + # If this field is omitted, there are no subsequent pages. + # @!attribute [rw] unreachable + # @return [::Array<::String>] + # Locations that could not be reached when making an aggregated query using + # wildcards. + class ListSubnetsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#get_subnet VmwareEngine.GetSubnet} + # @!attribute [rw] name + # @return [::String] + # Required. The resource name of the subnet to retrieve. + # Resource names are schemeless URIs that follow the conventions in + # https://cloud.google.com/apis/design/resource_names. + # For example: + # `projects/my-project/locations/us-central1-a/privateClouds/my-cloud/subnets/my-subnet` + class GetSubnetRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#update_subnet VmwareEngine.UpdateSubnet} + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # Required. Field mask is used to specify the fields to be overwritten in the + # `Subnet` resource by the update. + # The fields specified in the `update_mask` are relative to the resource, not + # the full request. A field will be overwritten if it is in the mask. If the + # user does not provide a mask then all fields will be overwritten. + # @!attribute [rw] subnet + # @return [::Google::Cloud::VmwareEngine::V1::Subnet] + # Required. Subnet description. + class UpdateSubnetRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#list_external_access_rules VmwareEngine.ListExternalAccessRules} + # @!attribute [rw] parent + # @return [::String] + # Required. The resource name of the network policy to query for external + # access firewall rules. Resource names are schemeless URIs that follow the + # conventions in https://cloud.google.com/apis/design/resource_names. For + # example: + # `projects/my-project/locations/us-central1/networkPolicies/my-policy` + # @!attribute [rw] page_size + # @return [::Integer] + # The maximum number of external access rules to return in one page. + # The service may return fewer than this value. + # The maximum value is coerced to 1000. + # The default value of this field is 500. + # @!attribute [rw] page_token + # @return [::String] + # A page token, received from a previous `ListExternalAccessRulesRequest` + # call. Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to + # `ListExternalAccessRulesRequest` must match the call that provided the page + # token. + # @!attribute [rw] filter + # @return [::String] + # A filter expression that matches resources returned in the response. + # The expression must specify the field name, a comparison + # operator, and the value that you want to use for filtering. The value + # must be a string, a number, or a boolean. The comparison operator + # must be `=`, `!=`, `>`, or `<`. + # + # For example, if you are filtering a list of external access rules, you can + # exclude the ones named `example-rule` by specifying + # `name != "example-rule"`. + # + # To filter on multiple expressions, provide each separate expression within + # parentheses. For example: + # ``` + # (name = "example-rule") + # (createTime > "2021-04-12T08:15:10.40Z") + # ``` + # + # By default, each expression is an `AND` expression. However, you + # can include `AND` and `OR` expressions explicitly. + # For example: + # ``` + # (name = "example-rule-1") AND + # (createTime > "2021-04-12T08:15:10.40Z") OR + # (name = "example-rule-2") + # ``` + # @!attribute [rw] order_by + # @return [::String] + # Sorts list results by a certain order. By default, returned results + # are ordered by `name` in ascending order. + # You can also sort results in descending order based on the `name` value + # using `orderBy="name desc"`. + # Currently, only ordering by `name` is supported. + class ListExternalAccessRulesRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for + # {::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#list_external_access_rules VmwareEngine.ListExternalAccessRules} + # @!attribute [rw] external_access_rules + # @return [::Array<::Google::Cloud::VmwareEngine::V1::ExternalAccessRule>] + # A list of external access firewall rules. + # @!attribute [rw] next_page_token + # @return [::String] + # A token, which can be sent as `page_token` to retrieve the next page. + # If this field is omitted, there are no subsequent pages. + # @!attribute [rw] unreachable + # @return [::Array<::String>] + # Locations that could not be reached when making an aggregated query using + # wildcards. + class ListExternalAccessRulesResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#get_external_access_rule VmwareEngine.GetExternalAccessRule} + # @!attribute [rw] name + # @return [::String] + # Required. The resource name of the external access firewall rule to + # retrieve. Resource names are schemeless URIs that follow the conventions in + # https://cloud.google.com/apis/design/resource_names. + # For example: + # `projects/my-project/locations/us-central1/networkPolicies/my-policy/externalAccessRules/my-rule` + class GetExternalAccessRuleRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#create_external_access_rule VmwareEngine.CreateExternalAccessRule} + # @!attribute [rw] parent + # @return [::String] + # Required. The resource name of the network policy + # to create a new external access firewall rule in. + # Resource names are schemeless URIs that follow the conventions in + # https://cloud.google.com/apis/design/resource_names. + # For example: + # `projects/my-project/locations/us-central1/networkPolicies/my-policy` + # @!attribute [rw] external_access_rule + # @return [::Google::Cloud::VmwareEngine::V1::ExternalAccessRule] + # Required. The initial description of a new external access rule. + # @!attribute [rw] external_access_rule_id + # @return [::String] + # Required. The user-provided identifier of the `ExternalAccessRule` to be + # created. This identifier must be unique among `ExternalAccessRule` + # resources within the parent and becomes the final token in the name URI. + # The identifier must meet the following requirements: + # + # * Only contains 1-63 alphanumeric characters and hyphens + # * Begins with an alphabetical character + # * Ends with a non-hyphen character + # * Not formatted as a UUID + # * Complies with [RFC 1034](https://datatracker.ietf.org/doc/html/rfc1034) + # (section 3.5) + # @!attribute [rw] request_id + # @return [::String] + # A request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server guarantees that a + # request doesn't result in creation of duplicate commitments for at least 60 + # minutes. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request ID, + # the server can check if the original operation with the same request ID was + # received, and if so, will ignore the second request. This prevents clients + # from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + class CreateExternalAccessRuleRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#update_external_access_rule VmwareEngine.UpdateExternalAccessRule} + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # Required. Field mask is used to specify the fields to be overwritten in the + # `ExternalAccessRule` resource by the update. + # The fields specified in the `update_mask` are relative to the resource, not + # the full request. A field will be overwritten if it is in the mask. If the + # user does not provide a mask then all fields will be overwritten. + # @!attribute [rw] external_access_rule + # @return [::Google::Cloud::VmwareEngine::V1::ExternalAccessRule] + # Required. Description of the external access rule. + # @!attribute [rw] request_id + # @return [::String] + # Optional. A request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server guarantees that a + # request doesn't result in creation of duplicate commitments for at least 60 + # minutes. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request ID, + # the server can check if the original operation with the same request ID was + # received, and if so, will ignore the second request. This prevents clients + # from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + class UpdateExternalAccessRuleRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#delete_external_access_rule VmwareEngine.DeleteExternalAccessRule} + # @!attribute [rw] name + # @return [::String] + # Required. The resource name of the external access firewall rule to delete. + # Resource names are schemeless URIs that follow the conventions in + # https://cloud.google.com/apis/design/resource_names. + # For example: + # `projects/my-project/locations/us-central1/networkPolicies/my-policy/externalAccessRules/my-rule` + # @!attribute [rw] request_id + # @return [::String] + # Optional. A request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server guarantees that a + # request doesn't result in creation of duplicate commitments for at least 60 + # minutes. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request + # ID, the server can check if the original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + class DeleteExternalAccessRuleRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#list_logging_servers VmwareEngine.ListLoggingServers} + # @!attribute [rw] parent + # @return [::String] + # Required. The resource name of the private cloud to be queried for + # logging servers. + # Resource names are schemeless URIs that follow the conventions in + # https://cloud.google.com/apis/design/resource_names. + # For example: + # `projects/my-project/locations/us-central1-a/privateClouds/my-cloud` + # @!attribute [rw] page_size + # @return [::Integer] + # The maximum number of logging servers to return in one page. + # The service may return fewer than this value. + # The maximum value is coerced to 1000. + # The default value of this field is 500. + # @!attribute [rw] page_token + # @return [::String] + # A page token, received from a previous `ListLoggingServersRequest` call. + # Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to + # `ListLoggingServersRequest` must match the call that provided the page + # token. + # @!attribute [rw] filter + # @return [::String] + # A filter expression that matches resources returned in the response. + # The expression must specify the field name, a comparison + # operator, and the value that you want to use for filtering. The value + # must be a string, a number, or a boolean. The comparison operator + # must be `=`, `!=`, `>`, or `<`. + # + # For example, if you are filtering a list of logging servers, you can + # exclude the ones named `example-server` by specifying + # `name != "example-server"`. + # + # To filter on multiple expressions, provide each separate expression within + # parentheses. For example: + # ``` + # (name = "example-server") + # (createTime > "2021-04-12T08:15:10.40Z") + # ``` + # + # By default, each expression is an `AND` expression. However, you + # can include `AND` and `OR` expressions explicitly. + # For example: + # ``` + # (name = "example-server-1") AND + # (createTime > "2021-04-12T08:15:10.40Z") OR + # (name = "example-server-2") + # ``` + # @!attribute [rw] order_by + # @return [::String] + # Sorts list results by a certain order. By default, returned results + # are ordered by `name` in ascending order. + # You can also sort results in descending order based on the `name` value + # using `orderBy="name desc"`. + # Currently, only ordering by `name` is supported. + class ListLoggingServersRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for + # {::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#list_logging_servers VmwareEngine.ListLoggingServers} + # @!attribute [rw] logging_servers + # @return [::Array<::Google::Cloud::VmwareEngine::V1::LoggingServer>] + # A list of Logging Servers. + # @!attribute [rw] next_page_token + # @return [::String] + # A token, which can be send as `page_token` to retrieve the next page. + # If this field is omitted, there are no subsequent pages. + # @!attribute [rw] unreachable + # @return [::Array<::String>] + # Locations that could not be reached when making an aggregated query using + # wildcards. + class ListLoggingServersResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#get_logging_server VmwareEngine.GetLoggingServer} + # @!attribute [rw] name + # @return [::String] + # Required. The resource name of the Logging Server to retrieve. + # Resource names are schemeless URIs that follow the conventions in + # https://cloud.google.com/apis/design/resource_names. + # For example: + # `projects/my-project/locations/us-central1-a/privateClouds/my-cloud/loggingServers/my-logging-server` + class GetLoggingServerRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#create_logging_server VmwareEngine.CreateLoggingServer} + # @!attribute [rw] parent + # @return [::String] + # Required. The resource name of the private cloud + # to create a new Logging Server in. + # Resource names are schemeless URIs that follow the conventions in + # https://cloud.google.com/apis/design/resource_names. + # For example: + # `projects/my-project/locations/us-central1-a/privateClouds/my-cloud` + # @!attribute [rw] logging_server + # @return [::Google::Cloud::VmwareEngine::V1::LoggingServer] + # Required. The initial description of a new logging server. + # @!attribute [rw] logging_server_id + # @return [::String] + # Required. The user-provided identifier of the `LoggingServer` to be + # created. This identifier must be unique among `LoggingServer` resources + # within the parent and becomes the final token in the name URI. + # The identifier must meet the following requirements: + # + # * Only contains 1-63 alphanumeric characters and hyphens + # * Begins with an alphabetical character + # * Ends with a non-hyphen character + # * Not formatted as a UUID + # * Complies with [RFC 1034](https://datatracker.ietf.org/doc/html/rfc1034) + # (section 3.5) + # @!attribute [rw] request_id + # @return [::String] + # Optional. A request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server guarantees that a + # request doesn't result in creation of duplicate commitments for at least 60 + # minutes. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request ID, + # the server can check if original operation with the same request ID was + # received, and if so, will ignore the second request. This prevents clients + # from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + class CreateLoggingServerRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#update_logging_server VmwareEngine.UpdateLoggingServer} + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # Required. Field mask is used to specify the fields to be overwritten in the + # `LoggingServer` resource by the update. + # The fields specified in the `update_mask` are relative to the resource, not + # the full request. A field will be overwritten if it is in the mask. If the + # user does not provide a mask then all fields will be overwritten. + # @!attribute [rw] logging_server + # @return [::Google::Cloud::VmwareEngine::V1::LoggingServer] + # Required. Logging server description. + # @!attribute [rw] request_id + # @return [::String] + # Optional. A request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server guarantees that a + # request doesn't result in creation of duplicate commitments for at least 60 + # minutes. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request ID, + # the server can check if original operation with the same request ID was + # received, and if so, will ignore the second request. This prevents clients + # from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + class UpdateLoggingServerRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#delete_logging_server VmwareEngine.DeleteLoggingServer} + # @!attribute [rw] name + # @return [::String] + # Required. The resource name of the logging server to delete. + # Resource names are schemeless URIs that follow the conventions in + # https://cloud.google.com/apis/design/resource_names. + # For example: + # `projects/my-project/locations/us-central1-a/privateClouds/my-cloud/loggingServers/my-logging-server` + # @!attribute [rw] request_id + # @return [::String] + # Optional. A request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server guarantees that a + # request doesn't result in creation of duplicate commitments for at least 60 + # minutes. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + class DeleteLoggingServerRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Represents the metadata of the long-running operation. + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time the operation was created. + # @!attribute [r] end_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time the operation finished running. + # @!attribute [r] target + # @return [::String] + # Output only. Server-defined resource path for the target of the operation. + # @!attribute [r] verb + # @return [::String] + # Output only. Name of the verb executed by the operation. + # @!attribute [r] status_message + # @return [::String] + # Output only. Human-readable status of the operation, if any. + # @!attribute [r] requested_cancellation + # @return [::Boolean] + # Output only. True if the user has requested cancellation + # of the operation; false otherwise. + # Operations that have successfully been cancelled + # have [Operation.error][] value with a + # {::Google::Rpc::Status#code google.rpc.Status.code} of 1, corresponding to + # `Code.CANCELLED`. + # @!attribute [r] api_version + # @return [::String] + # Output only. API version used to start the operation. + class OperationMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#list_node_types VmwareEngine.ListNodeTypes} + # @!attribute [rw] parent + # @return [::String] + # Required. The resource name of the location to be queried for node types. + # Resource names are schemeless URIs that follow the conventions in + # https://cloud.google.com/apis/design/resource_names. + # For example: + # `projects/my-project/locations/us-central1-a` + # @!attribute [rw] page_size + # @return [::Integer] + # The maximum number of node types to return in one page. + # The service may return fewer than this value. + # The maximum value is coerced to 1000. + # The default value of this field is 500. + # @!attribute [rw] page_token + # @return [::String] + # A page token, received from a previous `ListNodeTypes` call. + # Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to + # `ListNodeTypes` must match the call that provided the page token. + # @!attribute [rw] filter + # @return [::String] + # A filter expression that matches resources returned in the response. + # The expression must specify the field name, a comparison + # operator, and the value that you want to use for filtering. The value + # must be a string, a number, or a boolean. The comparison operator + # must be `=`, `!=`, `>`, or `<`. + # + # For example, if you are filtering a list of node types, you can + # exclude the ones named `standard-72` by specifying + # `name != "standard-72"`. + # + # To filter on multiple expressions, provide each separate expression within + # parentheses. For example: + # ``` + # (name = "standard-72") + # (virtual_cpu_count > 2) + # ``` + # + # By default, each expression is an `AND` expression. However, you + # can include `AND` and `OR` expressions explicitly. + # For example: + # ``` + # (name = "standard-96") AND + # (virtual_cpu_count > 2) OR + # (name = "standard-72") + # ``` + class ListNodeTypesRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for + # {::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#list_node_types VmwareEngine.ListNodeTypes} + # @!attribute [rw] node_types + # @return [::Array<::Google::Cloud::VmwareEngine::V1::NodeType>] + # A list of Node Types. + # @!attribute [rw] next_page_token + # @return [::String] + # A token, which can be sent as `page_token` to retrieve the next page. + # If this field is omitted, there are no subsequent pages. + # @!attribute [rw] unreachable + # @return [::Array<::String>] + # Locations that could not be reached when making an aggregated query using + # wildcards. + class ListNodeTypesResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#get_node_type VmwareEngine.GetNodeType} + # @!attribute [rw] name + # @return [::String] + # Required. The resource name of the node type to retrieve. + # Resource names are schemeless URIs that follow the conventions in + # https://cloud.google.com/apis/design/resource_names. + # For example: + # `projects/my-proj/locations/us-central1-a/nodeTypes/standard-72` + class GetNodeTypeRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#show_nsx_credentials VmwareEngine.ShowNsxCredentials} + # @!attribute [rw] private_cloud + # @return [::String] + # Required. The resource name of the private cloud + # to be queried for credentials. + # Resource names are schemeless URIs that follow the conventions in + # https://cloud.google.com/apis/design/resource_names. + # For example: + # `projects/my-project/locations/us-central1-a/privateClouds/my-cloud` + class ShowNsxCredentialsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#show_vcenter_credentials VmwareEngine.ShowVcenterCredentials} + # @!attribute [rw] private_cloud + # @return [::String] + # Required. The resource name of the private cloud + # to be queried for credentials. + # Resource names are schemeless URIs that follow the conventions in + # https://cloud.google.com/apis/design/resource_names. + # For example: + # `projects/my-project/locations/us-central1-a/privateClouds/my-cloud` + # @!attribute [rw] username + # @return [::String] + # Optional. The username of the user to be queried for credentials. + # The default value of this field is CloudOwner@gve.local. + # The provided value must be one of the following: + # CloudOwner@gve.local, + # solution-user-01@gve.local, + # solution-user-02@gve.local, + # solution-user-03@gve.local, + # solution-user-04@gve.local, + # solution-user-05@gve.local, + # zertoadmin@gve.local. + class ShowVcenterCredentialsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#reset_nsx_credentials VmwareEngine.ResetNsxCredentials} + # @!attribute [rw] private_cloud + # @return [::String] + # Required. The resource name of the private cloud + # to reset credentials for. + # Resource names are schemeless URIs that follow the conventions in + # https://cloud.google.com/apis/design/resource_names. + # For example: + # `projects/my-project/locations/us-central1-a/privateClouds/my-cloud` + # @!attribute [rw] request_id + # @return [::String] + # Optional. A request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server guarantees that a + # request doesn't result in creation of duplicate commitments for at least 60 + # minutes. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + class ResetNsxCredentialsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#reset_vcenter_credentials VmwareEngine.ResetVcenterCredentials} + # @!attribute [rw] private_cloud + # @return [::String] + # Required. The resource name of the private cloud + # to reset credentials for. + # Resource names are schemeless URIs that follow the conventions in + # https://cloud.google.com/apis/design/resource_names. + # For example: + # `projects/my-project/locations/us-central1-a/privateClouds/my-cloud` + # @!attribute [rw] request_id + # @return [::String] + # Optional. A request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server guarantees that a + # request doesn't result in creation of duplicate commitments for at least 60 + # minutes. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @!attribute [rw] username + # @return [::String] + # Optional. The username of the user to be to reset the credentials. + # The default value of this field is CloudOwner@gve.local. + # The provided value should be one of the following: + # solution-user-01@gve.local, + # solution-user-02@gve.local, + # solution-user-03@gve.local, + # solution-user-04@gve.local, + # solution-user-05@gve.local, + # zertoadmin@gve.local. + class ResetVcenterCredentialsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for + # {::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#list_hcx_activation_keys VmwareEngine.ListHcxActivationKeys} + # @!attribute [rw] hcx_activation_keys + # @return [::Array<::Google::Cloud::VmwareEngine::V1::HcxActivationKey>] + # List of HCX activation keys. + # @!attribute [rw] next_page_token + # @return [::String] + # A token, which can be sent as `page_token` to retrieve the next page. + # If this field is omitted, there are no subsequent pages. + # @!attribute [rw] unreachable + # @return [::Array<::String>] + # Locations that could not be reached when making an aggregated query using + # wildcards. + class ListHcxActivationKeysResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#list_hcx_activation_keys VmwareEngine.ListHcxActivationKeys} + # @!attribute [rw] parent + # @return [::String] + # Required. The resource name of the private cloud + # to be queried for HCX activation keys. + # Resource names are schemeless URIs that follow the conventions in + # https://cloud.google.com/apis/design/resource_names. + # For example: + # `projects/my-project/locations/us-central1/privateClouds/my-cloud` + # @!attribute [rw] page_size + # @return [::Integer] + # The maximum number of HCX activation keys to return in one page. + # The service may return fewer than this value. + # The maximum value is coerced to 1000. + # The default value of this field is 500. + # @!attribute [rw] page_token + # @return [::String] + # A page token, received from a previous `ListHcxActivationKeys` call. + # Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to + # `ListHcxActivationKeys` must match the call that provided the page + # token. + class ListHcxActivationKeysRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for [VmwareEngine.GetHcxActivationKeys][] + # @!attribute [rw] name + # @return [::String] + # Required. The resource name of the HCX activation key to retrieve. + # Resource names are schemeless URIs that follow the conventions in + # https://cloud.google.com/apis/design/resource_names. + # For example: + # `projects/my-project/locations/us-central1/privateClouds/my-cloud/hcxActivationKeys/my-key` + class GetHcxActivationKeyRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#create_hcx_activation_key VmwareEngine.CreateHcxActivationKey} + # @!attribute [rw] parent + # @return [::String] + # Required. The resource name of the private cloud to create the key for. + # Resource names are schemeless URIs that follow the conventions in + # https://cloud.google.com/apis/design/resource_names. + # For example: + # `projects/my-project/locations/us-central1/privateClouds/my-cloud` + # @!attribute [rw] hcx_activation_key + # @return [::Google::Cloud::VmwareEngine::V1::HcxActivationKey] + # Required. The initial description of a new HCX activation key. When + # creating a new key, this field must be an empty object. + # @!attribute [rw] hcx_activation_key_id + # @return [::String] + # Required. The user-provided identifier of the `HcxActivationKey` to be + # created. This identifier must be unique among `HcxActivationKey` resources + # within the parent and becomes the final token in the name URI. + # The identifier must meet the following requirements: + # + # * Only contains 1-63 alphanumeric characters and hyphens + # * Begins with an alphabetical character + # * Ends with a non-hyphen character + # * Not formatted as a UUID + # * Complies with [RFC 1034](https://datatracker.ietf.org/doc/html/rfc1034) + # (section 3.5) + # @!attribute [rw] request_id + # @return [::String] + # A request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server guarantees that a + # request doesn't result in creation of duplicate commitments for at least 60 + # minutes. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request ID, + # the server can check if original operation with the same request ID was + # received, and if so, will ignore the second request. This prevents clients + # from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + class CreateHcxActivationKeyRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#get_dns_forwarding VmwareEngine.GetDnsForwarding} + # @!attribute [rw] name + # @return [::String] + # Required. The resource name of a `DnsForwarding` to retrieve. + # Resource names are schemeless URIs that follow the conventions in + # https://cloud.google.com/apis/design/resource_names. + # For example: + # `projects/my-project/locations/us-central1-a/privateClouds/my-cloud/dnsForwarding` + class GetDnsForwardingRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#update_dns_forwarding VmwareEngine.UpdateDnsForwarding} + # @!attribute [rw] dns_forwarding + # @return [::Google::Cloud::VmwareEngine::V1::DnsForwarding] + # Required. DnsForwarding config details. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # Required. Field mask is used to specify the fields to be overwritten in the + # `DnsForwarding` resource by the update. + # The fields specified in the `update_mask` are relative to the resource, not + # the full request. A field will be overwritten if it is in the mask. If the + # user does not provide a mask then all fields will be overwritten. + # @!attribute [rw] request_id + # @return [::String] + # Optional. A request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server guarantees that a + # request doesn't result in creation of duplicate commitments for at least 60 + # minutes. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request ID, + # the server can check if original operation with the same request ID was + # received, and if so, will ignore the second request. This prevents clients + # from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + class UpdateDnsForwardingRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#create_network_peering VmwareEngine.CreateNetworkPeering} + # @!attribute [rw] parent + # @return [::String] + # Required. The resource name of the location to create the new network + # peering in. This value is always `global`, because `NetworkPeering` is a + # global resource. Resource names are schemeless URIs that follow the + # conventions in https://cloud.google.com/apis/design/resource_names. For + # example: `projects/my-project/locations/global` + # @!attribute [rw] network_peering_id + # @return [::String] + # Required. The user-provided identifier of the new `NetworkPeering`. + # This identifier must be unique among `NetworkPeering` resources within the + # parent and becomes the final token in the name URI. + # The identifier must meet the following requirements: + # + # * Only contains 1-63 alphanumeric characters and hyphens + # * Begins with an alphabetical character + # * Ends with a non-hyphen character + # * Not formatted as a UUID + # * Complies with [RFC 1034](https://datatracker.ietf.org/doc/html/rfc1034) + # (section 3.5) + # @!attribute [rw] network_peering + # @return [::Google::Cloud::VmwareEngine::V1::NetworkPeering] + # Required. The initial description of the new network peering. + # @!attribute [rw] request_id + # @return [::String] + # Optional. A request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server guarantees that a + # request doesn't result in creation of duplicate commitments for at least 60 + # minutes. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + class CreateNetworkPeeringRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#delete_network_peering VmwareEngine.DeleteNetworkPeering} + # @!attribute [rw] name + # @return [::String] + # Required. The resource name of the network peering to be deleted. + # Resource names are schemeless URIs that follow the conventions in + # https://cloud.google.com/apis/design/resource_names. + # For example: + # `projects/my-project/locations/global/networkPeerings/my-peering` + # @!attribute [rw] request_id + # @return [::String] + # Optional. A request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server guarantees that a + # request doesn't result in creation of duplicate commitments for at least 60 + # minutes. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + class DeleteNetworkPeeringRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#get_network_peering VmwareEngine.GetNetworkPeering} + # @!attribute [rw] name + # @return [::String] + # Required. The resource name of the network peering to retrieve. + # Resource names are schemeless URIs that follow the conventions in + # https://cloud.google.com/apis/design/resource_names. + # For example: + # `projects/my-project/locations/global/networkPeerings/my-peering` + class GetNetworkPeeringRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#list_network_peerings VmwareEngine.ListNetworkPeerings} + # @!attribute [rw] parent + # @return [::String] + # Required. The resource name of the location (global) to query for + # network peerings. Resource names are schemeless URIs that follow the + # conventions in https://cloud.google.com/apis/design/resource_names. For + # example: `projects/my-project/locations/global` + # @!attribute [rw] page_size + # @return [::Integer] + # The maximum number of network peerings to return in one page. + # The maximum value is coerced to 1000. + # The default value of this field is 500. + # @!attribute [rw] page_token + # @return [::String] + # A page token, received from a previous `ListNetworkPeerings` call. + # Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to + # `ListNetworkPeerings` must match the call that provided the page + # token. + # @!attribute [rw] filter + # @return [::String] + # A filter expression that matches resources returned in the response. + # The expression must specify the field name, a comparison + # operator, and the value that you want to use for filtering. The value + # must be a string, a number, or a boolean. The comparison operator + # must be `=`, `!=`, `>`, or `<`. + # + # For example, if you are filtering a list of network peerings, you can + # exclude the ones named `example-peering` by specifying + # `name != "example-peering"`. + # + # To filter on multiple expressions, provide each separate expression within + # parentheses. For example: + # ``` + # (name = "example-peering") + # (createTime > "2021-04-12T08:15:10.40Z") + # ``` + # + # By default, each expression is an `AND` expression. However, you + # can include `AND` and `OR` expressions explicitly. + # For example: + # ``` + # (name = "example-peering-1") AND + # (createTime > "2021-04-12T08:15:10.40Z") OR + # (name = "example-peering-2") + # ``` + # @!attribute [rw] order_by + # @return [::String] + # Sorts list results by a certain order. By default, returned results + # are ordered by `name` in ascending order. + # You can also sort results in descending order based on the `name` value + # using `orderBy="name desc"`. + # Currently, only ordering by `name` is supported. + class ListNetworkPeeringsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#update_network_peering VmwareEngine.UpdateNetworkPeering} + # @!attribute [rw] network_peering + # @return [::Google::Cloud::VmwareEngine::V1::NetworkPeering] + # Required. Network peering description. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # Required. Field mask is used to specify the fields to be overwritten in the + # `NetworkPeering` resource by the update. + # The fields specified in the `update_mask` are relative to the resource, not + # the full request. A field will be overwritten if it is in the mask. If the + # user does not provide a mask then all fields will be overwritten. + # @!attribute [rw] request_id + # @return [::String] + # Optional. A request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server guarantees that a + # request doesn't result in creation of duplicate commitments for at least 60 + # minutes. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + class UpdateNetworkPeeringRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for + # {::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#list_network_peerings VmwareEngine.ListNetworkPeerings} + # @!attribute [rw] network_peerings + # @return [::Array<::Google::Cloud::VmwareEngine::V1::NetworkPeering>] + # A list of network peerings. + # @!attribute [rw] next_page_token + # @return [::String] + # A token, which can be sent as `page_token` to retrieve the next page. + # If this field is omitted, there are no subsequent pages. + # @!attribute [rw] unreachable + # @return [::Array<::String>] + # Unreachable resources. + class ListNetworkPeeringsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#list_peering_routes VmwareEngine.ListPeeringRoutes} + # @!attribute [rw] parent + # @return [::String] + # Required. The resource name of the network peering to retrieve peering + # routes from. Resource names are schemeless URIs that follow the conventions + # in https://cloud.google.com/apis/design/resource_names. For example: + # `projects/my-project/locations/global/networkPeerings/my-peering` + # @!attribute [rw] page_size + # @return [::Integer] + # The maximum number of peering routes to return in one page. + # The service may return fewer than this value. + # The maximum value is coerced to 1000. + # The default value of this field is 500. + # @!attribute [rw] page_token + # @return [::String] + # A page token, received from a previous `ListPeeringRoutes` call. + # Provide this to retrieve the subsequent page. + # When paginating, all other parameters provided to `ListPeeringRoutes` must + # match the call that provided the page token. + # @!attribute [rw] filter + # @return [::String] + # A filter expression that matches resources returned in the response. + # Currently, only filtering on the `direction` field is supported. To return + # routes imported from the peer network, provide "direction=INCOMING". To + # return routes exported from the VMware Engine network, provide + # "direction=OUTGOING". Other filter expressions return an error. + class ListPeeringRoutesRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for + # {::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#list_peering_routes VmwareEngine.ListPeeringRoutes} + # @!attribute [rw] peering_routes + # @return [::Array<::Google::Cloud::VmwareEngine::V1::PeeringRoute>] + # A list of peering routes. + # @!attribute [rw] next_page_token + # @return [::String] + # A token, which can be sent as `page_token` to retrieve the next page. + # If this field is omitted, there are no subsequent pages. + class ListPeeringRoutesResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#list_network_policies VmwareEngine.ListNetworkPolicies} + # @!attribute [rw] parent + # @return [::String] + # Required. The resource name of the location (region) to query for + # network policies. Resource names are schemeless URIs that follow the + # conventions in https://cloud.google.com/apis/design/resource_names. For + # example: `projects/my-project/locations/us-central1` + # @!attribute [rw] page_size + # @return [::Integer] + # The maximum number of network policies to return in one page. + # The service may return fewer than this value. + # The maximum value is coerced to 1000. + # The default value of this field is 500. + # @!attribute [rw] page_token + # @return [::String] + # A page token, received from a previous `ListNetworkPolicies` call. + # Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to + # `ListNetworkPolicies` must match the call that provided the page + # token. + # @!attribute [rw] filter + # @return [::String] + # A filter expression that matches resources returned in the response. + # The expression must specify the field name, a comparison + # operator, and the value that you want to use for filtering. The value + # must be a string, a number, or a boolean. The comparison operator + # must be `=`, `!=`, `>`, or `<`. + # + # For example, if you are filtering a list of network policies, you can + # exclude the ones named `example-policy` by specifying + # `name != "example-policy"`. + # + # To filter on multiple expressions, provide each separate expression within + # parentheses. For example: + # ``` + # (name = "example-policy") + # (createTime > "2021-04-12T08:15:10.40Z") + # ``` + # + # By default, each expression is an `AND` expression. However, you + # can include `AND` and `OR` expressions explicitly. + # For example: + # ``` + # (name = "example-policy-1") AND + # (createTime > "2021-04-12T08:15:10.40Z") OR + # (name = "example-policy-2") + # ``` + # @!attribute [rw] order_by + # @return [::String] + # Sorts list results by a certain order. By default, returned results + # are ordered by `name` in ascending order. + # You can also sort results in descending order based on the `name` value + # using `orderBy="name desc"`. + # Currently, only ordering by `name` is supported. + class ListNetworkPoliciesRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for + # {::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#list_network_policies VmwareEngine.ListNetworkPolicies} + # @!attribute [rw] network_policies + # @return [::Array<::Google::Cloud::VmwareEngine::V1::NetworkPolicy>] + # A list of network policies. + # @!attribute [rw] next_page_token + # @return [::String] + # A token, which can be send as `page_token` to retrieve the next page. + # If this field is omitted, there are no subsequent pages. + # @!attribute [rw] unreachable + # @return [::Array<::String>] + # Locations that could not be reached when making an aggregated query using + # wildcards. + class ListNetworkPoliciesResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#get_network_policy VmwareEngine.GetNetworkPolicy} + # @!attribute [rw] name + # @return [::String] + # Required. The resource name of the network policy to retrieve. + # Resource names are schemeless URIs that follow the conventions in + # https://cloud.google.com/apis/design/resource_names. + # For example: + # `projects/my-project/locations/us-central1/networkPolicies/my-network-policy` + class GetNetworkPolicyRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#update_network_policy VmwareEngine.UpdateNetworkPolicy} + # @!attribute [rw] network_policy + # @return [::Google::Cloud::VmwareEngine::V1::NetworkPolicy] + # Required. Network policy description. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # Required. Field mask is used to specify the fields to be overwritten in the + # `NetworkPolicy` resource by the update. + # The fields specified in the `update_mask` are relative to the resource, not + # the full request. A field will be overwritten if it is in the mask. If the + # user does not provide a mask then all fields will be overwritten. + # @!attribute [rw] request_id + # @return [::String] + # Optional. A request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server guarantees that a + # request doesn't result in creation of duplicate commitments for at least 60 + # minutes. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + class UpdateNetworkPolicyRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#create_network_policy VmwareEngine.CreateNetworkPolicy} + # @!attribute [rw] parent + # @return [::String] + # Required. The resource name of the location (region) + # to create the new network policy in. + # Resource names are schemeless URIs that follow the conventions in + # https://cloud.google.com/apis/design/resource_names. + # For example: + # `projects/my-project/locations/us-central1` + # @!attribute [rw] network_policy_id + # @return [::String] + # Required. The user-provided identifier of the network policy to be created. + # This identifier must be unique within parent + # `projects/{my-project}/locations/{us-central1}/networkPolicies` and becomes + # the final token in the name URI. + # The identifier must meet the following requirements: + # + # * Only contains 1-63 alphanumeric characters and hyphens + # * Begins with an alphabetical character + # * Ends with a non-hyphen character + # * Not formatted as a UUID + # * Complies with [RFC 1034](https://datatracker.ietf.org/doc/html/rfc1034) + # (section 3.5) + # @!attribute [rw] network_policy + # @return [::Google::Cloud::VmwareEngine::V1::NetworkPolicy] + # Required. The network policy configuration to use in the request. + # @!attribute [rw] request_id + # @return [::String] + # Optional. A request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server guarantees that a + # request doesn't result in creation of duplicate commitments for at least 60 + # minutes. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + class CreateNetworkPolicyRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#delete_network_policy VmwareEngine.DeleteNetworkPolicy} + # @!attribute [rw] name + # @return [::String] + # Required. The resource name of the network policy to delete. + # Resource names are schemeless URIs that follow the conventions in + # https://cloud.google.com/apis/design/resource_names. + # For example: + # `projects/my-project/locations/us-central1/networkPolicies/my-network-policy` + # @!attribute [rw] request_id + # @return [::String] + # Optional. A request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server guarantees that a + # request doesn't result in creation of duplicate commitments for at least 60 + # minutes. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + class DeleteNetworkPolicyRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#list_management_dns_zone_bindings VmwareEngine.ListManagementDnsZoneBindings} + # @!attribute [rw] parent + # @return [::String] + # Required. The resource name of the private cloud to be queried for + # management DNS zone bindings. + # Resource names are schemeless URIs that follow the conventions in + # https://cloud.google.com/apis/design/resource_names. + # For example: + # `projects/my-project/locations/us-central1-a/privateClouds/my-cloud` + # @!attribute [rw] page_size + # @return [::Integer] + # The maximum number of management DNS zone bindings to return in one page. + # The service may return fewer than this value. + # The maximum value is coerced to 1000. + # The default value of this field is 500. + # @!attribute [rw] page_token + # @return [::String] + # A page token, received from a previous `ListManagementDnsZoneBindings` + # call. Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to + # `ListManagementDnsZoneBindings` must match the call that provided the page + # token. + # @!attribute [rw] filter + # @return [::String] + # A filter expression that matches resources returned in the response. + # The expression must specify the field name, a comparison + # operator, and the value that you want to use for filtering. The value + # must be a string, a number, or a boolean. The comparison operator + # must be `=`, `!=`, `>`, or `<`. + # + # For example, if you are filtering a list of Management DNS Zone Bindings, + # you can exclude the ones named `example-management-dns-zone-binding` by + # specifying `name != "example-management-dns-zone-binding"`. + # + # To filter on multiple expressions, provide each separate expression within + # parentheses. For example: + # ``` + # (name = "example-management-dns-zone-binding") + # (createTime > "2021-04-12T08:15:10.40Z") + # ``` + # + # By default, each expression is an `AND` expression. However, you + # can include `AND` and `OR` expressions explicitly. + # For example: + # ``` + # (name = "example-management-dns-zone-binding-1") AND + # (createTime > "2021-04-12T08:15:10.40Z") OR + # (name = "example-management-dns-zone-binding-2") + # ``` + # @!attribute [rw] order_by + # @return [::String] + # Sorts list results by a certain order. By default, returned results + # are ordered by `name` in ascending order. + # You can also sort results in descending order based on the `name` value + # using `orderBy="name desc"`. + # Currently, only ordering by `name` is supported. + class ListManagementDnsZoneBindingsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for + # {::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#list_management_dns_zone_bindings VmwareEngine.ListManagementDnsZoneBindings} + # @!attribute [rw] management_dns_zone_bindings + # @return [::Array<::Google::Cloud::VmwareEngine::V1::ManagementDnsZoneBinding>] + # A list of management DNS zone bindings. + # @!attribute [rw] next_page_token + # @return [::String] + # A token, which can be sent as `page_token` to retrieve the next page. + # If this field is omitted, there are no subsequent pages. + # @!attribute [rw] unreachable + # @return [::Array<::String>] + # Locations that could not be reached when making an aggregated query using + # wildcards. + class ListManagementDnsZoneBindingsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#get_management_dns_zone_binding VmwareEngine.GetManagementDnsZoneBinding} + # @!attribute [rw] name + # @return [::String] + # Required. The resource name of the management DNS zone binding to + # retrieve. Resource names are schemeless URIs that follow the conventions in + # https://cloud.google.com/apis/design/resource_names. + # For example: + # `projects/my-project/locations/us-central1-a/privateClouds/my-cloud/managementDnsZoneBindings/my-management-dns-zone-binding` + class GetManagementDnsZoneBindingRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for [VmwareEngine.CreateManagementDnsZoneBindings][] + # @!attribute [rw] parent + # @return [::String] + # Required. The resource name of the private cloud + # to create a new management DNS zone binding for. + # Resource names are schemeless URIs that follow the conventions in + # https://cloud.google.com/apis/design/resource_names. + # For example: + # `projects/my-project/locations/us-central1-a/privateClouds/my-cloud` + # @!attribute [rw] management_dns_zone_binding + # @return [::Google::Cloud::VmwareEngine::V1::ManagementDnsZoneBinding] + # Required. The initial values for a new management DNS zone binding. + # @!attribute [rw] management_dns_zone_binding_id + # @return [::String] + # Required. The user-provided identifier of the `ManagementDnsZoneBinding` + # resource to be created. This identifier must be unique among + # `ManagementDnsZoneBinding` resources within the parent and becomes the + # final token in the name URI. The identifier must meet the following + # requirements: + # + # * Only contains 1-63 alphanumeric characters and hyphens + # * Begins with an alphabetical character + # * Ends with a non-hyphen character + # * Not formatted as a UUID + # * Complies with [RFC 1034](https://datatracker.ietf.org/doc/html/rfc1034) + # (section 3.5) + # @!attribute [rw] request_id + # @return [::String] + # Optional. A request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server guarantees that a + # request doesn't result in creation of duplicate commitments for at least 60 + # minutes. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request ID, + # the server can check if the original operation with the same request ID was + # received, and if so, will ignore the second request. This prevents clients + # from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + class CreateManagementDnsZoneBindingRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#update_management_dns_zone_binding VmwareEngine.UpdateManagementDnsZoneBinding} + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # Required. Field mask is used to specify the fields to be overwritten in the + # `ManagementDnsZoneBinding` resource by the update. + # The fields specified in the `update_mask` are relative to the resource, not + # the full request. A field will be overwritten if it is in the mask. If the + # user does not provide a mask then all fields will be overwritten. + # @!attribute [rw] management_dns_zone_binding + # @return [::Google::Cloud::VmwareEngine::V1::ManagementDnsZoneBinding] + # Required. New values to update the management DNS zone binding with. + # @!attribute [rw] request_id + # @return [::String] + # Optional. A request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server guarantees that a + # request doesn't result in creation of duplicate commitments for at least 60 + # minutes. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request ID, + # the server can check if the original operation with the same request ID was + # received, and if so, will ignore the second request. This prevents clients + # from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + class UpdateManagementDnsZoneBindingRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#delete_management_dns_zone_binding VmwareEngine.DeleteManagementDnsZoneBinding} + # @!attribute [rw] name + # @return [::String] + # Required. The resource name of the management DNS zone binding to delete. + # Resource names are schemeless URIs that follow the conventions in + # https://cloud.google.com/apis/design/resource_names. + # For example: + # `projects/my-project/locations/us-central1-a/privateClouds/my-cloud/managementDnsZoneBindings/my-management-dns-zone-binding` + # @!attribute [rw] request_id + # @return [::String] + # Optional. A request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server guarantees that a + # request doesn't result in creation of duplicate commitments for at least 60 + # minutes. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request + # ID, the server can check if the original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + class DeleteManagementDnsZoneBindingRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for [VmwareEngine.RepairManagementDnsZoneBindings][] + # @!attribute [rw] name + # @return [::String] + # Required. The resource name of the management DNS zone binding to repair. + # Resource names are schemeless URIs that follow the conventions in + # https://cloud.google.com/apis/design/resource_names. + # For example: + # `projects/my-project/locations/us-central1-a/privateClouds/my-cloud/managementDnsZoneBindings/my-management-dns-zone-binding` + # @!attribute [rw] request_id + # @return [::String] + # Optional. A request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server guarantees that a + # request doesn't result in creation of duplicate commitments for at least 60 + # minutes. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request ID, + # the server can check if the original operation with the same request ID was + # received, and if so, will ignore the second request. This prevents clients + # from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + class RepairManagementDnsZoneBindingRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#create_vmware_engine_network VmwareEngine.CreateVmwareEngineNetwork} + # @!attribute [rw] parent + # @return [::String] + # Required. The resource name of the location to create the new VMware Engine + # network in. A VMware Engine network of type + # `LEGACY` is a regional resource, and a VMware + # Engine network of type `STANDARD` is a global resource. + # Resource names are schemeless URIs that follow the conventions in + # https://cloud.google.com/apis/design/resource_names. For example: + # `projects/my-project/locations/global` + # @!attribute [rw] vmware_engine_network_id + # @return [::String] + # Required. The user-provided identifier of the new VMware Engine network. + # This identifier must be unique among VMware Engine network resources + # within the parent and becomes the final token in the name URI. The + # identifier must meet the following requirements: + # + # * For networks of type LEGACY, adheres to the format: + # `{region-id}-default`. Replace `{region-id}` with the region where you want + # to create the VMware Engine network. For example, "us-central1-default". + # * Only contains 1-63 alphanumeric characters and hyphens + # * Begins with an alphabetical character + # * Ends with a non-hyphen character + # * Not formatted as a UUID + # * Complies with [RFC 1034](https://datatracker.ietf.org/doc/html/rfc1034) + # (section 3.5) + # @!attribute [rw] vmware_engine_network + # @return [::Google::Cloud::VmwareEngine::V1::VmwareEngineNetwork] + # Required. The initial description of the new VMware Engine network. + # @!attribute [rw] request_id + # @return [::String] + # Optional. A request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server guarantees that a + # request doesn't result in creation of duplicate commitments for at least 60 + # minutes. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + class CreateVmwareEngineNetworkRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#update_vmware_engine_network VmwareEngine.UpdateVmwareEngineNetwork} + # @!attribute [rw] vmware_engine_network + # @return [::Google::Cloud::VmwareEngine::V1::VmwareEngineNetwork] + # Required. VMware Engine network description. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # Required. Field mask is used to specify the fields to be overwritten in the + # VMware Engine network resource by the update. + # The fields specified in the `update_mask` are relative to the resource, not + # the full request. A field will be overwritten if it is in the mask. If the + # user does not provide a mask then all fields will be overwritten. Only the + # following fields can be updated: `description`. + # @!attribute [rw] request_id + # @return [::String] + # Optional. A request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server guarantees that a + # request doesn't result in creation of duplicate commitments for at least 60 + # minutes. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + class UpdateVmwareEngineNetworkRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#delete_vmware_engine_network VmwareEngine.DeleteVmwareEngineNetwork} + # @!attribute [rw] name + # @return [::String] + # Required. The resource name of the VMware Engine network to be deleted. + # Resource names are schemeless URIs that follow the conventions in + # https://cloud.google.com/apis/design/resource_names. + # For example: + # `projects/my-project/locations/global/vmwareEngineNetworks/my-network` + # @!attribute [rw] request_id + # @return [::String] + # Optional. A request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server guarantees that a + # request doesn't result in creation of duplicate commitments for at least 60 + # minutes. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + # @!attribute [rw] etag + # @return [::String] + # Optional. Checksum used to ensure that the user-provided value is up to + # date before the server processes the request. The server compares provided + # checksum with the current checksum of the resource. If the user-provided + # value is out of date, this request returns an `ABORTED` error. + class DeleteVmwareEngineNetworkRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#get_vmware_engine_network VmwareEngine.GetVmwareEngineNetwork} + # @!attribute [rw] name + # @return [::String] + # Required. The resource name of the VMware Engine network to retrieve. + # Resource names are schemeless URIs that follow the conventions in + # https://cloud.google.com/apis/design/resource_names. + # For example: + # `projects/my-project/locations/global/vmwareEngineNetworks/my-network` + class GetVmwareEngineNetworkRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#list_vmware_engine_networks VmwareEngine.ListVmwareEngineNetworks} + # @!attribute [rw] parent + # @return [::String] + # Required. The resource name of the location to query for + # VMware Engine networks. Resource names are schemeless URIs that follow the + # conventions in https://cloud.google.com/apis/design/resource_names. For + # example: `projects/my-project/locations/global` + # @!attribute [rw] page_size + # @return [::Integer] + # The maximum number of results to return in one page. + # The maximum value is coerced to 1000. + # The default value of this field is 500. + # @!attribute [rw] page_token + # @return [::String] + # A page token, received from a previous `ListVmwareEngineNetworks` call. + # Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to + # `ListVmwareEngineNetworks` must match the call that provided the page + # token. + # @!attribute [rw] filter + # @return [::String] + # A filter expression that matches resources returned in the response. + # The expression must specify the field name, a comparison + # operator, and the value that you want to use for filtering. The value + # must be a string, a number, or a boolean. The comparison operator + # must be `=`, `!=`, `>`, or `<`. + # + # For example, if you are filtering a list of network peerings, you can + # exclude the ones named `example-network` by specifying + # `name != "example-network"`. + # + # To filter on multiple expressions, provide each separate expression within + # parentheses. For example: + # ``` + # (name = "example-network") + # (createTime > "2021-04-12T08:15:10.40Z") + # ``` + # + # By default, each expression is an `AND` expression. However, you + # can include `AND` and `OR` expressions explicitly. + # For example: + # ``` + # (name = "example-network-1") AND + # (createTime > "2021-04-12T08:15:10.40Z") OR + # (name = "example-network-2") + # ``` + # @!attribute [rw] order_by + # @return [::String] + # Sorts list results by a certain order. By default, returned results + # are ordered by `name` in ascending order. + # You can also sort results in descending order based on the `name` value + # using `orderBy="name desc"`. + # Currently, only ordering by `name` is supported. + class ListVmwareEngineNetworksRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for + # {::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#list_vmware_engine_networks VmwareEngine.ListVmwareEngineNetworks} + # @!attribute [rw] vmware_engine_networks + # @return [::Array<::Google::Cloud::VmwareEngine::V1::VmwareEngineNetwork>] + # A list of VMware Engine networks. + # @!attribute [rw] next_page_token + # @return [::String] + # A token, which can be sent as `page_token` to retrieve the next page. + # If this field is omitted, there are no subsequent pages. + # @!attribute [rw] unreachable + # @return [::Array<::String>] + # Unreachable resources. + class ListVmwareEngineNetworksResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#create_private_connection VmwareEngine.CreatePrivateConnection} + # @!attribute [rw] parent + # @return [::String] + # Required. The resource name of the location to create the new private + # connection in. Private connection is a regional resource. + # Resource names are schemeless URIs that follow the conventions in + # https://cloud.google.com/apis/design/resource_names. For example: + # `projects/my-project/locations/us-central1` + # @!attribute [rw] private_connection_id + # @return [::String] + # Required. The user-provided identifier of the new private connection. + # This identifier must be unique among private connection resources + # within the parent and becomes the final token in the name URI. The + # identifier must meet the following requirements: + # + # * Only contains 1-63 alphanumeric characters and hyphens + # * Begins with an alphabetical character + # * Ends with a non-hyphen character + # * Not formatted as a UUID + # * Complies with [RFC 1034](https://datatracker.ietf.org/doc/html/rfc1034) + # (section 3.5) + # @!attribute [rw] private_connection + # @return [::Google::Cloud::VmwareEngine::V1::PrivateConnection] + # Required. The initial description of the new private connection. + # @!attribute [rw] request_id + # @return [::String] + # Optional. A request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server guarantees that a + # request doesn't result in creation of duplicate commitments for at least 60 + # minutes. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + class CreatePrivateConnectionRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#get_private_connection VmwareEngine.GetPrivateConnection} + # @!attribute [rw] name + # @return [::String] + # Required. The resource name of the private connection to retrieve. + # Resource names are schemeless URIs that follow the conventions in + # https://cloud.google.com/apis/design/resource_names. + # For example: + # `projects/my-project/locations/us-central1/privateConnections/my-connection` + class GetPrivateConnectionRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#list_private_connections VmwareEngine.ListPrivateConnections} + # @!attribute [rw] parent + # @return [::String] + # Required. The resource name of the location to query for + # private connections. Resource names are schemeless URIs that follow the + # conventions in https://cloud.google.com/apis/design/resource_names. For + # example: `projects/my-project/locations/us-central1` + # @!attribute [rw] page_size + # @return [::Integer] + # The maximum number of private connections to return in one page. + # The maximum value is coerced to 1000. + # The default value of this field is 500. + # @!attribute [rw] page_token + # @return [::String] + # A page token, received from a previous `ListPrivateConnections` call. + # Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to + # `ListPrivateConnections` must match the call that provided the page + # token. + # @!attribute [rw] filter + # @return [::String] + # A filter expression that matches resources returned in the response. + # The expression must specify the field name, a comparison + # operator, and the value that you want to use for filtering. The value + # must be a string, a number, or a boolean. The comparison operator + # must be `=`, `!=`, `>`, or `<`. + # + # For example, if you are filtering a list of private connections, you can + # exclude the ones named `example-connection` by specifying + # `name != "example-connection"`. + # + # To filter on multiple expressions, provide each separate expression within + # parentheses. For example: + # ``` + # (name = "example-connection") + # (createTime > "2022-09-22T08:15:10.40Z") + # ``` + # + # By default, each expression is an `AND` expression. However, you + # can include `AND` and `OR` expressions explicitly. + # For example: + # ``` + # (name = "example-connection-1") AND + # (createTime > "2021-04-12T08:15:10.40Z") OR + # (name = "example-connection-2") + # ``` + # @!attribute [rw] order_by + # @return [::String] + # Sorts list results by a certain order. By default, returned results + # are ordered by `name` in ascending order. + # You can also sort results in descending order based on the `name` value + # using `orderBy="name desc"`. + # Currently, only ordering by `name` is supported. + class ListPrivateConnectionsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for + # {::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#list_private_connections VmwareEngine.ListPrivateConnections} + # @!attribute [rw] private_connections + # @return [::Array<::Google::Cloud::VmwareEngine::V1::PrivateConnection>] + # A list of private connections. + # @!attribute [rw] next_page_token + # @return [::String] + # A token, which can be sent as `page_token` to retrieve the next page. + # If this field is omitted, there are no subsequent pages. + # @!attribute [rw] unreachable + # @return [::Array<::String>] + # Unreachable resources. + class ListPrivateConnectionsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#update_private_connection VmwareEngine.UpdatePrivateConnection} + # @!attribute [rw] private_connection + # @return [::Google::Cloud::VmwareEngine::V1::PrivateConnection] + # Required. Private connection description. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # Required. Field mask is used to specify the fields to be overwritten in the + # `PrivateConnection` resource by the update. + # The fields specified in the `update_mask` are relative to the resource, not + # the full request. A field will be overwritten if it is in the mask. If the + # user does not provide a mask then all fields will be overwritten. + # @!attribute [rw] request_id + # @return [::String] + # Optional. A request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server guarantees that a + # request doesn't result in creation of duplicate commitments for at least 60 + # minutes. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + class UpdatePrivateConnectionRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#delete_private_connection VmwareEngine.DeletePrivateConnection} + # @!attribute [rw] name + # @return [::String] + # Required. The resource name of the private connection to be deleted. + # Resource names are schemeless URIs that follow the conventions in + # https://cloud.google.com/apis/design/resource_names. + # For example: + # `projects/my-project/locations/us-central1/privateConnections/my-connection` + # @!attribute [rw] request_id + # @return [::String] + # Optional. A request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server guarantees that a + # request doesn't result in creation of duplicate commitments for at least 60 + # minutes. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + class DeletePrivateConnectionRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#list_private_connection_peering_routes VmwareEngine.ListPrivateConnectionPeeringRoutes} + # @!attribute [rw] parent + # @return [::String] + # Required. The resource name of the private connection to retrieve peering + # routes from. Resource names are schemeless URIs that follow the conventions + # in https://cloud.google.com/apis/design/resource_names. For example: + # `projects/my-project/locations/us-west1/privateConnections/my-connection` + # @!attribute [rw] page_size + # @return [::Integer] + # The maximum number of peering routes to return in one page. + # The service may return fewer than this value. + # The maximum value is coerced to 1000. + # The default value of this field is 500. + # @!attribute [rw] page_token + # @return [::String] + # A page token, received from a previous `ListPrivateConnectionPeeringRoutes` + # call. Provide this to retrieve the subsequent page. When paginating, all + # other parameters provided to `ListPrivateConnectionPeeringRoutes` must + # match the call that provided the page token. + class ListPrivateConnectionPeeringRoutesRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for + # {::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#list_private_connection_peering_routes VmwareEngine.ListPrivateConnectionPeeringRoutes} + # @!attribute [rw] peering_routes + # @return [::Array<::Google::Cloud::VmwareEngine::V1::PeeringRoute>] + # A list of peering routes. + # @!attribute [rw] next_page_token + # @return [::String] + # A token, which can be sent as `page_token` to retrieve the next page. + # If this field is omitted, there are no subsequent pages. + class ListPrivateConnectionPeeringRoutesResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#grant_dns_bind_permission VmwareEngine.GrantDnsBindPermission} + # @!attribute [rw] name + # @return [::String] + # Required. The name of the resource which stores the users/service accounts + # having the permission to bind to the corresponding intranet VPC of the + # consumer project. DnsBindPermission is a global resource. Resource names + # are schemeless URIs that follow the conventions in + # https://cloud.google.com/apis/design/resource_names. For example: + # `projects/my-project/locations/global/dnsBindPermission` + # @!attribute [rw] principal + # @return [::Google::Cloud::VmwareEngine::V1::Principal] + # Required. The consumer provided user/service account which needs to be + # granted permission to bind with the intranet VPC corresponding to the + # consumer project. + # @!attribute [rw] request_id + # @return [::String] + # Optional. A request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server guarantees that a + # request doesn't result in creation of duplicate commitments for at least 60 + # minutes. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + class GrantDnsBindPermissionRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#revoke_dns_bind_permission VmwareEngine.RevokeDnsBindPermission} + # @!attribute [rw] name + # @return [::String] + # Required. The name of the resource which stores the users/service accounts + # having the permission to bind to the corresponding intranet VPC of the + # consumer project. DnsBindPermission is a global resource. Resource names + # are schemeless URIs that follow the conventions in + # https://cloud.google.com/apis/design/resource_names. For example: + # `projects/my-project/locations/global/dnsBindPermission` + # @!attribute [rw] principal + # @return [::Google::Cloud::VmwareEngine::V1::Principal] + # Required. The consumer provided user/service account which needs to be + # granted permission to bind with the intranet VPC corresponding to the + # consumer project. + # @!attribute [rw] request_id + # @return [::String] + # Optional. A request ID to identify requests. Specify a unique request ID + # so that if you must retry your request, the server will know to ignore + # the request if it has already been completed. The server guarantees that a + # request doesn't result in creation of duplicate commitments for at least 60 + # minutes. + # + # For example, consider a situation where you make an initial request and the + # request times out. If you make the request again with the same request + # ID, the server can check if original operation with the same request ID + # was received, and if so, will ignore the second request. This prevents + # clients from accidentally creating duplicate commitments. + # + # The request ID must be a valid UUID with the exception that zero UUID is + # not supported (00000000-0000-0000-0000-000000000000). + class RevokeDnsBindPermissionRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for + # {::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#get_dns_bind_permission VmwareEngine.GetDnsBindPermission} + # @!attribute [rw] name + # @return [::String] + # Required. The name of the resource which stores the users/service accounts + # having the permission to bind to the corresponding intranet VPC of the + # consumer project. DnsBindPermission is a global resource. Resource names + # are schemeless URIs that follow the conventions in + # https://cloud.google.com/apis/design/resource_names. For example: + # `projects/my-project/locations/global/dnsBindPermission` + class GetDnsBindPermissionRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-vmware_engine-v1/proto_docs/google/cloud/vmwareengine/v1/vmwareengine_resources.rb b/owl-bot-staging/google-cloud-vmware_engine-v1/proto_docs/google/cloud/vmwareengine/v1/vmwareengine_resources.rb new file mode 100644 index 000000000000..a9c4dd2b03ab --- /dev/null +++ b/owl-bot-staging/google-cloud-vmware_engine-v1/proto_docs/google/cloud/vmwareengine/v1/vmwareengine_resources.rb @@ -0,0 +1,1690 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 VmwareEngine + module V1 + # Network configuration in the consumer project + # with which the peering has to be done. + # @!attribute [rw] management_cidr + # @return [::String] + # Required. Management CIDR used by VMware management appliances. + # @!attribute [rw] vmware_engine_network + # @return [::String] + # Optional. The relative resource name of the VMware Engine network attached + # to the private cloud. Specify the name in the following form: + # `projects/{project}/locations/{location}/vmwareEngineNetworks/{vmware_engine_network_id}` + # where `{project}` can either be a project number or a project ID. + # @!attribute [r] vmware_engine_network_canonical + # @return [::String] + # Output only. The canonical name of the VMware Engine network in the form: + # `projects/{project_number}/locations/{location}/vmwareEngineNetworks/{vmware_engine_network_id}` + # @!attribute [r] management_ip_address_layout_version + # @return [::Integer] + # Output only. The IP address layout version of the management IP address + # range. Possible versions include: + # * `managementIpAddressLayoutVersion=1`: Indicates the legacy IP address + # layout used by some existing private clouds. This is no longer supported + # for new private clouds as it does not support all features. + # * `managementIpAddressLayoutVersion=2`: Indicates the latest IP address + # layout used by all newly created private clouds. This version supports all + # current features. + # @!attribute [r] dns_server_ip + # @return [::String] + # Output only. DNS Server IP of the Private Cloud. + # All DNS queries can be forwarded to this address for name resolution of + # Private Cloud's management entities like vCenter, NSX-T Manager and + # ESXi hosts. + class NetworkConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Information about the type and number of nodes associated with the cluster. + # @!attribute [rw] node_count + # @return [::Integer] + # Required. The number of nodes of this type in the cluster + # @!attribute [rw] custom_core_count + # @return [::Integer] + # Optional. Customized number of cores available to each node of the type. + # This number must always be one of `nodeType.availableCustomCoreCounts`. + # If zero is provided max value from `nodeType.availableCustomCoreCounts` + # will be used. + class NodeTypeConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Configuration of a stretched cluster. + # @!attribute [rw] preferred_location + # @return [::String] + # Required. Zone that will remain operational when connection between the two + # zones is lost. Specify the resource name of a zone that belongs to the + # region of the private cloud. For example: + # `projects/{project}/locations/europe-west3-a` where `{project}` can either + # be a project number or a project ID. + # @!attribute [rw] secondary_location + # @return [::String] + # Required. Additional zone for a higher level of availability and load + # balancing. Specify the resource name of a zone that belongs to the region + # of the private cloud. For example: + # `projects/{project}/locations/europe-west3-b` where `{project}` can either + # be a project number or a project ID. + class StretchedClusterConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Represents a private cloud resource. Private clouds of type `STANDARD` and + # `TIME_LIMITED` are zonal resources, `STRETCHED` private clouds are + # regional. + # @!attribute [r] name + # @return [::String] + # Output only. The resource name of this private cloud. + # Resource names are schemeless URIs that follow the conventions in + # https://cloud.google.com/apis/design/resource_names. + # For example: + # `projects/my-project/locations/us-central1-a/privateClouds/my-cloud` + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Creation time of this resource. + # @!attribute [r] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Last update time of this resource. + # @!attribute [r] delete_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Time when the resource was scheduled for deletion. + # @!attribute [r] expire_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Time when the resource will be irreversibly deleted. + # @!attribute [r] state + # @return [::Google::Cloud::VmwareEngine::V1::PrivateCloud::State] + # Output only. State of the resource. New values may be added to this enum + # when appropriate. + # @!attribute [rw] network_config + # @return [::Google::Cloud::VmwareEngine::V1::NetworkConfig] + # Required. Network configuration of the private cloud. + # @!attribute [rw] management_cluster + # @return [::Google::Cloud::VmwareEngine::V1::PrivateCloud::ManagementCluster] + # Required. Input only. The management cluster for this private cloud. + # This field is required during creation of the private cloud to provide + # details for the default cluster. + # + # The following fields can't be changed after private cloud creation: + # `ManagementCluster.clusterId`, `ManagementCluster.nodeTypeId`. + # @!attribute [rw] description + # @return [::String] + # User-provided description for this private cloud. + # @!attribute [r] hcx + # @return [::Google::Cloud::VmwareEngine::V1::Hcx] + # Output only. HCX appliance. + # @!attribute [r] nsx + # @return [::Google::Cloud::VmwareEngine::V1::Nsx] + # Output only. NSX appliance. + # @!attribute [r] vcenter + # @return [::Google::Cloud::VmwareEngine::V1::Vcenter] + # Output only. Vcenter appliance. + # @!attribute [r] uid + # @return [::String] + # Output only. System-generated unique identifier for the resource. + # @!attribute [rw] type + # @return [::Google::Cloud::VmwareEngine::V1::PrivateCloud::Type] + # Optional. Type of the private cloud. Defaults to STANDARD. + class PrivateCloud + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Management cluster configuration. + # @!attribute [rw] cluster_id + # @return [::String] + # Required. The user-provided identifier of the new `Cluster`. + # The identifier must meet the following requirements: + # + # * Only contains 1-63 alphanumeric characters and hyphens + # * Begins with an alphabetical character + # * Ends with a non-hyphen character + # * Not formatted as a UUID + # * Complies with [RFC + # 1034](https://datatracker.ietf.org/doc/html/rfc1034) (section 3.5) + # @!attribute [rw] node_type_configs + # @return [::Google::Protobuf::Map{::String => ::Google::Cloud::VmwareEngine::V1::NodeTypeConfig}] + # Required. The map of cluster node types in this cluster, where the key is + # canonical identifier of the node type (corresponds to the `NodeType`). + # @!attribute [rw] stretched_cluster_config + # @return [::Google::Cloud::VmwareEngine::V1::StretchedClusterConfig] + # Optional. Configuration of a stretched cluster. Required for STRETCHED + # private clouds. + class ManagementCluster + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::Google::Cloud::VmwareEngine::V1::NodeTypeConfig] + class NodeTypeConfigsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Enum State defines possible states of private clouds. + module State + # The default value. This value should never be used. + STATE_UNSPECIFIED = 0 + + # The private cloud is ready. + ACTIVE = 1 + + # The private cloud is being created. + CREATING = 2 + + # The private cloud is being updated. + UPDATING = 3 + + # The private cloud is in failed state. + FAILED = 5 + + # The private cloud is scheduled for deletion. The deletion process can be + # cancelled by using the corresponding undelete method. + DELETED = 6 + + # The private cloud is irreversibly deleted and is being removed from the + # system. + PURGING = 7 + end + + # Enum Type defines private cloud type. + module Type + # Standard private is a zonal resource, with 3+ nodes. Default type. + STANDARD = 0 + + # Time limited private cloud is a zonal resource, can have only 1 node and + # has limited life span. Will be deleted after defined period of time, + # can be converted into standard private cloud by expanding it up to 3 + # or more nodes. + TIME_LIMITED = 1 + + # Stretched private cloud is a regional resource with redundancy, + # with a minimum of 6 nodes, nodes count has to be even. + STRETCHED = 2 + end + end + + # A cluster in a private cloud. + # @!attribute [r] name + # @return [::String] + # Output only. The resource name of this cluster. + # Resource names are schemeless URIs that follow the conventions in + # https://cloud.google.com/apis/design/resource_names. + # For example: + # `projects/my-project/locations/us-central1-a/privateClouds/my-cloud/clusters/my-cluster` + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Creation time of this resource. + # @!attribute [r] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Last update time of this resource. + # @!attribute [r] state + # @return [::Google::Cloud::VmwareEngine::V1::Cluster::State] + # Output only. State of the resource. + # @!attribute [r] management + # @return [::Boolean] + # Output only. True if the cluster is a management cluster; false otherwise. + # There can only be one management cluster in a private cloud + # and it has to be the first one. + # @!attribute [rw] autoscaling_settings + # @return [::Google::Cloud::VmwareEngine::V1::AutoscalingSettings] + # Optional. Configuration of the autoscaling applied to this cluster. + # @!attribute [r] uid + # @return [::String] + # Output only. System-generated unique identifier for the resource. + # @!attribute [rw] node_type_configs + # @return [::Google::Protobuf::Map{::String => ::Google::Cloud::VmwareEngine::V1::NodeTypeConfig}] + # Required. The map of cluster node types in this cluster, where the key is + # canonical identifier of the node type (corresponds to the `NodeType`). + # @!attribute [rw] stretched_cluster_config + # @return [::Google::Cloud::VmwareEngine::V1::StretchedClusterConfig] + # Optional. Configuration of a stretched cluster. Required for clusters that + # belong to a STRETCHED private cloud. + class Cluster + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::Google::Cloud::VmwareEngine::V1::NodeTypeConfig] + class NodeTypeConfigsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Enum State defines possible states of private cloud clusters. + module State + # The default value. This value should never be used. + STATE_UNSPECIFIED = 0 + + # The Cluster is operational and can be used by the user. + ACTIVE = 1 + + # The Cluster is being deployed. + CREATING = 2 + + # Adding or removing of a node to the cluster, any other cluster specific + # updates. + UPDATING = 3 + + # The Cluster is being deleted. + DELETING = 4 + + # The Cluster is undergoing maintenance, for example: a failed node is + # getting replaced. + REPAIRING = 5 + end + end + + # Node in a cluster. + # @!attribute [r] name + # @return [::String] + # Output only. The resource name of this node. + # Resource names are schemeless URIs that follow the conventions in + # https://cloud.google.com/apis/design/resource_names. + # For example: + # projects/my-project/locations/us-central1-a/privateClouds/my-cloud/clusters/my-cluster/nodes/my-node + # @!attribute [r] fqdn + # @return [::String] + # Output only. Fully qualified domain name of the node. + # @!attribute [r] internal_ip + # @return [::String] + # Output only. Internal IP address of the node. + # @!attribute [r] node_type_id + # @return [::String] + # Output only. The canonical identifier of the node type (corresponds to the + # `NodeType`). + # For example: standard-72. + # @!attribute [r] version + # @return [::String] + # Output only. The version number of the VMware ESXi + # management component in this cluster. + # @!attribute [r] custom_core_count + # @return [::Integer] + # Output only. Customized number of cores + # @!attribute [r] state + # @return [::Google::Cloud::VmwareEngine::V1::Node::State] + # Output only. The state of the appliance. + class Node + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Enum State defines possible states of a node in a cluster. + module State + # The default value. This value should never be used. + STATE_UNSPECIFIED = 0 + + # Node is operational and can be used by the user. + ACTIVE = 1 + + # Node is being provisioned. + CREATING = 2 + + # Node is in a failed state. + FAILED = 3 + + # Node is undergoing maintenance, e.g.: during private cloud upgrade. + UPGRADING = 4 + end + end + + # Represents an allocated external IP address and its corresponding internal IP + # address in a private cloud. + # @!attribute [r] name + # @return [::String] + # Output only. The resource name of this external IP address. + # Resource names are schemeless URIs that follow the conventions in + # https://cloud.google.com/apis/design/resource_names. + # For example: + # `projects/my-project/locations/us-central1-a/privateClouds/my-cloud/externalAddresses/my-address` + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Creation time of this resource. + # @!attribute [r] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Last update time of this resource. + # @!attribute [rw] internal_ip + # @return [::String] + # The internal IP address of a workload VM. + # @!attribute [r] external_ip + # @return [::String] + # Output only. The external IP address of a workload VM. + # @!attribute [r] state + # @return [::Google::Cloud::VmwareEngine::V1::ExternalAddress::State] + # Output only. The state of the resource. + # @!attribute [r] uid + # @return [::String] + # Output only. System-generated unique identifier for the resource. + # @!attribute [rw] description + # @return [::String] + # User-provided description for this resource. + class ExternalAddress + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Enum State defines possible states of external addresses. + module State + # The default value. This value should never be used. + STATE_UNSPECIFIED = 0 + + # The address is ready. + ACTIVE = 1 + + # The address is being created. + CREATING = 2 + + # The address is being updated. + UPDATING = 3 + + # The address is being deleted. + DELETING = 4 + end + end + + # Subnet in a private cloud. Either `management` subnets (such as vMotion) that + # are read-only, or `userDefined`, which can also be updated. + # @!attribute [r] name + # @return [::String] + # Output only. The resource name of this subnet. + # Resource names are schemeless URIs that follow the conventions in + # https://cloud.google.com/apis/design/resource_names. + # For example: + # `projects/my-project/locations/us-central1-a/privateClouds/my-cloud/subnets/my-subnet` + # @!attribute [rw] ip_cidr_range + # @return [::String] + # The IP address range of the subnet in CIDR format '10.0.0.0/24'. + # @!attribute [rw] gateway_ip + # @return [::String] + # The IP address of the gateway of this subnet. + # Must fall within the IP prefix defined above. + # @!attribute [r] type + # @return [::String] + # Output only. The type of the subnet. For example "management" or + # "userDefined". + # @!attribute [r] state + # @return [::Google::Cloud::VmwareEngine::V1::Subnet::State] + # Output only. The state of the resource. + # @!attribute [r] vlan_id + # @return [::Integer] + # Output only. VLAN ID of the VLAN on which the subnet is configured + class Subnet + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Defines possible states of subnets. + module State + # The default value. This value should never be used. + STATE_UNSPECIFIED = 0 + + # The subnet is ready. + ACTIVE = 1 + + # The subnet is being created. + CREATING = 2 + + # The subnet is being updated. + UPDATING = 3 + + # The subnet is being deleted. + DELETING = 4 + + # Changes requested in the last operation are being propagated. + RECONCILING = 5 + + # Last operation on the subnet did not succeed. Subnet's payload is + # reverted back to its most recent working state. + FAILED = 6 + end + end + + # External access firewall rules for filtering incoming traffic destined to + # `ExternalAddress` resources. + # @!attribute [r] name + # @return [::String] + # Output only. The resource name of this external access rule. + # Resource names are schemeless URIs that follow the conventions in + # https://cloud.google.com/apis/design/resource_names. + # For example: + # `projects/my-project/locations/us-central1/networkPolicies/my-policy/externalAccessRules/my-rule` + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Creation time of this resource. + # @!attribute [r] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Last update time of this resource. + # @!attribute [rw] description + # @return [::String] + # User-provided description for this external access rule. + # @!attribute [rw] priority + # @return [::Integer] + # External access rule priority, which determines the external access rule to + # use when multiple rules apply. If multiple rules have the same priority, + # their ordering is non-deterministic. If specific ordering is required, + # assign unique priorities to enforce such ordering. The external access rule + # priority is an integer from 100 to 4096, both inclusive. Lower integers + # indicate higher precedence. For example, a rule with priority `100` has + # higher precedence than a rule with priority `101`. + # @!attribute [rw] action + # @return [::Google::Cloud::VmwareEngine::V1::ExternalAccessRule::Action] + # The action that the external access rule performs. + # @!attribute [rw] ip_protocol + # @return [::String] + # The IP protocol to which the external access rule applies. This value can + # be one of the following three protocol strings (not case-sensitive): + # `tcp`, `udp`, or `icmp`. + # @!attribute [rw] source_ip_ranges + # @return [::Array<::Google::Cloud::VmwareEngine::V1::ExternalAccessRule::IpRange>] + # If source ranges are specified, the external access rule applies only to + # traffic that has a source IP address in these ranges. These ranges can + # either be expressed in the CIDR format or as an IP address. As only inbound + # rules are supported, `ExternalAddress` resources cannot be the source IP + # addresses of an external access rule. To match all source addresses, + # specify `0.0.0.0/0`. + # @!attribute [rw] source_ports + # @return [::Array<::String>] + # A list of source ports to which the external access rule applies. This + # field is only applicable for the UDP or TCP protocol. + # Each entry must be either an integer or a range. For example: `["22"]`, + # `["80","443"]`, or `["12345-12349"]`. To match all source ports, specify + # `["0-65535"]`. + # @!attribute [rw] destination_ip_ranges + # @return [::Array<::Google::Cloud::VmwareEngine::V1::ExternalAccessRule::IpRange>] + # If destination ranges are specified, the external access rule applies only + # to the traffic that has a destination IP address in these ranges. The + # specified IP addresses must have reserved external IP addresses in the + # scope of the parent network policy. To match all external IP addresses in + # the scope of the parent network policy, specify `0.0.0.0/0`. To match a + # specific external IP address, specify it using the + # `IpRange.external_address` property. + # @!attribute [rw] destination_ports + # @return [::Array<::String>] + # A list of destination ports to which the external access rule applies. This + # field is only applicable for the UDP or TCP protocol. + # Each entry must be either an integer or a range. For example: `["22"]`, + # `["80","443"]`, or `["12345-12349"]`. To match all destination ports, + # specify `["0-65535"]`. + # @!attribute [r] state + # @return [::Google::Cloud::VmwareEngine::V1::ExternalAccessRule::State] + # Output only. The state of the resource. + # @!attribute [r] uid + # @return [::String] + # Output only. System-generated unique identifier for the resource. + class ExternalAccessRule + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # An IP range provided in any one of the supported formats. + # @!attribute [rw] ip_address + # @return [::String] + # A single IP address. For example: `10.0.0.5`. + # + # Note: The following fields are mutually exclusive: `ip_address`, `ip_address_range`, `external_address`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] ip_address_range + # @return [::String] + # An IP address range in the CIDR format. For example: `10.0.0.0/24`. + # + # Note: The following fields are mutually exclusive: `ip_address_range`, `ip_address`, `external_address`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] external_address + # @return [::String] + # The name of an `ExternalAddress` resource. The external address must + # have been reserved in the scope of this external access rule's parent + # network policy. Provide the external address name in the form of + # `projects/{project}/locations/{location}/privateClouds/{private_cloud}/externalAddresses/{external_address}`. + # For example: + # `projects/my-project/locations/us-central1-a/privateClouds/my-cloud/externalAddresses/my-address`. + # + # Note: The following fields are mutually exclusive: `external_address`, `ip_address`, `ip_address_range`. If a field in that set is populated, all other fields in the set will automatically be cleared. + class IpRange + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Action determines whether the external access rule permits or blocks + # traffic, subject to the other components of the rule matching the traffic. + module Action + # Defaults to allow. + ACTION_UNSPECIFIED = 0 + + # Allows connections that match the other specified components. + ALLOW = 1 + + # Blocks connections that match the other specified components. + DENY = 2 + end + + # Defines possible states of external access firewall rules. + module State + # The default value. This value is used if the state is omitted. + STATE_UNSPECIFIED = 0 + + # The rule is ready. + ACTIVE = 1 + + # The rule is being created. + CREATING = 2 + + # The rule is being updated. + UPDATING = 3 + + # The rule is being deleted. + DELETING = 4 + end + end + + # Logging server to receive vCenter or ESXi logs. + # @!attribute [r] name + # @return [::String] + # Output only. The resource name of this logging server. + # Resource names are schemeless URIs that follow the conventions in + # https://cloud.google.com/apis/design/resource_names. + # For example: + # `projects/my-project/locations/us-central1-a/privateClouds/my-cloud/loggingServers/my-logging-server` + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Creation time of this resource. + # @!attribute [r] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Last update time of this resource. + # @!attribute [rw] hostname + # @return [::String] + # Required. Fully-qualified domain name (FQDN) or IP Address of the logging + # server. + # @!attribute [rw] port + # @return [::Integer] + # Required. Port number at which the logging server receives logs. + # @!attribute [rw] protocol + # @return [::Google::Cloud::VmwareEngine::V1::LoggingServer::Protocol] + # Required. Protocol used by vCenter to send logs to a logging server. + # @!attribute [rw] source_type + # @return [::Google::Cloud::VmwareEngine::V1::LoggingServer::SourceType] + # Required. The type of component that produces logs that will be forwarded + # to this logging server. + # @!attribute [r] uid + # @return [::String] + # Output only. System-generated unique identifier for the resource. + class LoggingServer + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Defines possible protocols used to send logs to + # a logging server. + module Protocol + # Unspecified communications protocol. This is the default value. + PROTOCOL_UNSPECIFIED = 0 + + # UDP + UDP = 1 + + # TCP + TCP = 2 + + # TLS + TLS = 3 + + # SSL + SSL = 4 + + # RELP + RELP = 5 + end + + # Defines possible types of component that produces logs. + module SourceType + # The default value. This value should never be used. + SOURCE_TYPE_UNSPECIFIED = 0 + + # Logs produced by ESXI hosts + ESXI = 1 + + # Logs produced by vCenter server + VCSA = 2 + end + end + + # Describes node type. + # @!attribute [r] name + # @return [::String] + # Output only. The resource name of this node type. + # Resource names are schemeless URIs that follow the conventions in + # https://cloud.google.com/apis/design/resource_names. + # For example: + # `projects/my-proj/locations/us-central1-a/nodeTypes/standard-72` + # @!attribute [r] node_type_id + # @return [::String] + # Output only. The canonical identifier of the node type + # (corresponds to the `NodeType`). For example: standard-72. + # @!attribute [r] display_name + # @return [::String] + # Output only. The friendly name for this node type. + # For example: ve1-standard-72 + # @!attribute [r] virtual_cpu_count + # @return [::Integer] + # Output only. The total number of virtual CPUs in a single node. + # @!attribute [r] total_core_count + # @return [::Integer] + # Output only. The total number of CPU cores in a single node. + # @!attribute [r] memory_gb + # @return [::Integer] + # Output only. The amount of physical memory available, defined in GB. + # @!attribute [r] disk_size_gb + # @return [::Integer] + # Output only. The amount of storage available, defined in GB. + # @!attribute [r] available_custom_core_counts + # @return [::Array<::Integer>] + # Output only. List of possible values of custom core count. + # @!attribute [r] kind + # @return [::Google::Cloud::VmwareEngine::V1::NodeType::Kind] + # Output only. The type of the resource. + # @!attribute [r] families + # @return [::Array<::String>] + # Output only. Families of the node type. + # For node types to be in the same cluster + # they must share at least one element in the `families`. + # @!attribute [r] capabilities + # @return [::Array<::Google::Cloud::VmwareEngine::V1::NodeType::Capability>] + # Output only. Capabilities of this node type. + class NodeType + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Enum Kind defines possible types of a NodeType. + module Kind + # The default value. This value should never be used. + KIND_UNSPECIFIED = 0 + + # Standard HCI node. + STANDARD = 1 + + # Storage only Node. + STORAGE_ONLY = 2 + end + + # Capability of a node type. + module Capability + # The default value. This value is used if the capability is omitted or + # unknown. + CAPABILITY_UNSPECIFIED = 0 + + # This node type supports stretch clusters. + STRETCHED_CLUSTERS = 1 + end + end + + # Credentials for a private cloud. + # @!attribute [rw] username + # @return [::String] + # Initial username. + # @!attribute [rw] password + # @return [::String] + # Initial password. + class Credentials + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # HCX activation key. A default key is created during + # private cloud provisioning, but this behavior is subject to change + # and you should always verify active keys. + # Use + # {::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#list_hcx_activation_keys VmwareEngine.ListHcxActivationKeys} + # to retrieve existing keys and + # {::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#create_hcx_activation_key VmwareEngine.CreateHcxActivationKey} + # to create new ones. + # @!attribute [r] name + # @return [::String] + # Output only. The resource name of this HcxActivationKey. + # Resource names are schemeless URIs that follow the conventions in + # https://cloud.google.com/apis/design/resource_names. + # For example: + # `projects/my-project/locations/us-central1/privateClouds/my-cloud/hcxActivationKeys/my-key` + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Creation time of HCX activation key. + # @!attribute [r] state + # @return [::Google::Cloud::VmwareEngine::V1::HcxActivationKey::State] + # Output only. State of HCX activation key. + # @!attribute [r] activation_key + # @return [::String] + # Output only. HCX activation key. + # @!attribute [r] uid + # @return [::String] + # Output only. System-generated unique identifier for the resource. + class HcxActivationKey + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # State of HCX activation key + module State + # Unspecified state. + STATE_UNSPECIFIED = 0 + + # State of a newly generated activation key. + AVAILABLE = 1 + + # State of key when it has been used to activate HCX appliance. + CONSUMED = 2 + + # State of key when it is being created. + CREATING = 3 + end + end + + # Details about a HCX Cloud Manager appliance. + # @!attribute [rw] internal_ip + # @return [::String] + # Internal IP address of the appliance. + # @!attribute [rw] version + # @return [::String] + # Version of the appliance. + # @!attribute [r] state + # @return [::Google::Cloud::VmwareEngine::V1::Hcx::State] + # Output only. The state of the appliance. + # @!attribute [rw] fqdn + # @return [::String] + # Fully qualified domain name of the appliance. + class Hcx + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # State of the appliance + module State + # Unspecified appliance state. This is the default value. + STATE_UNSPECIFIED = 0 + + # The appliance is operational and can be used. + ACTIVE = 1 + + # The appliance is being deployed. + CREATING = 2 + + # The appliance is being activated. + ACTIVATING = 3 + end + end + + # Details about a NSX Manager appliance. + # @!attribute [rw] internal_ip + # @return [::String] + # Internal IP address of the appliance. + # @!attribute [rw] version + # @return [::String] + # Version of the appliance. + # @!attribute [r] state + # @return [::Google::Cloud::VmwareEngine::V1::Nsx::State] + # Output only. The state of the appliance. + # @!attribute [rw] fqdn + # @return [::String] + # Fully qualified domain name of the appliance. + class Nsx + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # State of the appliance + module State + # Unspecified appliance state. This is the default value. + STATE_UNSPECIFIED = 0 + + # The appliance is operational and can be used. + ACTIVE = 1 + + # The appliance is being deployed. + CREATING = 2 + end + end + + # Details about a vCenter Server management appliance. + # @!attribute [rw] internal_ip + # @return [::String] + # Internal IP address of the appliance. + # @!attribute [rw] version + # @return [::String] + # Version of the appliance. + # @!attribute [r] state + # @return [::Google::Cloud::VmwareEngine::V1::Vcenter::State] + # Output only. The state of the appliance. + # @!attribute [rw] fqdn + # @return [::String] + # Fully qualified domain name of the appliance. + class Vcenter + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # State of the appliance + module State + # Unspecified appliance state. This is the default value. + STATE_UNSPECIFIED = 0 + + # The appliance is operational and can be used. + ACTIVE = 1 + + # The appliance is being deployed. + CREATING = 2 + end + end + + # Autoscaling settings define the rules used by VMware Engine to + # automatically scale-out and scale-in the clusters in a private cloud. + # @!attribute [rw] autoscaling_policies + # @return [::Google::Protobuf::Map{::String => ::Google::Cloud::VmwareEngine::V1::AutoscalingSettings::AutoscalingPolicy}] + # Required. The map with autoscaling policies applied to the cluster. + # The key is the identifier of the policy. + # It must meet the following requirements: + # + # * Only contains 1-63 alphanumeric characters and hyphens + # * Begins with an alphabetical character + # * Ends with a non-hyphen character + # * Not formatted as a UUID + # * Complies with [RFC + # 1034](https://datatracker.ietf.org/doc/html/rfc1034) (section 3.5) + # + # Currently there map must contain only one element + # that describes the autoscaling policy for compute nodes. + # @!attribute [rw] min_cluster_node_count + # @return [::Integer] + # Optional. Minimum number of nodes of any type in a cluster. + # If not specified the default limits apply. + # @!attribute [rw] max_cluster_node_count + # @return [::Integer] + # Optional. Maximum number of nodes of any type in a cluster. + # If not specified the default limits apply. + # @!attribute [rw] cool_down_period + # @return [::Google::Protobuf::Duration] + # Optional. The minimum duration between consecutive autoscale operations. + # It starts once addition or removal of nodes is fully completed. + # Defaults to 30 minutes if not specified. Cool down period must be in whole + # minutes (for example, 30, 31, 50, 180 minutes). + class AutoscalingSettings + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Thresholds define the utilization of resources triggering + # scale-out and scale-in operations. + # @!attribute [rw] scale_out + # @return [::Integer] + # Required. The utilization triggering the scale-out operation in percent. + # @!attribute [rw] scale_in + # @return [::Integer] + # Required. The utilization triggering the scale-in operation in percent. + class Thresholds + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Autoscaling policy describes the behavior of the autoscaling + # with respect to the resource utilization. + # The scale-out operation is initiated if the utilization + # exceeds ANY of the respective thresholds. + # The scale-in operation is initiated if the utilization + # is below ALL of the respective thresholds. + # @!attribute [rw] node_type_id + # @return [::String] + # Required. The canonical identifier of the node type to add or remove. + # Corresponds to the `NodeType`. + # @!attribute [rw] scale_out_size + # @return [::Integer] + # Required. Number of nodes to add to a cluster during a scale-out + # operation. Must be divisible by 2 for stretched clusters. During a + # scale-in operation only one node (or 2 for stretched clusters) are + # removed in a single iteration. + # @!attribute [rw] cpu_thresholds + # @return [::Google::Cloud::VmwareEngine::V1::AutoscalingSettings::Thresholds] + # Optional. Utilization thresholds pertaining to CPU utilization. + # @!attribute [rw] granted_memory_thresholds + # @return [::Google::Cloud::VmwareEngine::V1::AutoscalingSettings::Thresholds] + # Optional. Utilization thresholds pertaining to amount of granted memory. + # @!attribute [rw] consumed_memory_thresholds + # @return [::Google::Cloud::VmwareEngine::V1::AutoscalingSettings::Thresholds] + # Optional. Utilization thresholds pertaining to amount of consumed memory. + # @!attribute [rw] storage_thresholds + # @return [::Google::Cloud::VmwareEngine::V1::AutoscalingSettings::Thresholds] + # Optional. Utilization thresholds pertaining to amount of consumed + # storage. + class AutoscalingPolicy + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::Google::Cloud::VmwareEngine::V1::AutoscalingSettings::AutoscalingPolicy] + class AutoscalingPoliciesEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # DNS forwarding config. + # This config defines a list of domain to name server mappings, + # and is attached to the private cloud for custom domain resolution. + # @!attribute [r] name + # @return [::String] + # Output only. The resource name of this DNS profile. + # Resource names are schemeless URIs that follow the conventions in + # https://cloud.google.com/apis/design/resource_names. + # For example: + # `projects/my-project/locations/us-central1-a/privateClouds/my-cloud/dnsForwarding` + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Creation time of this resource. + # @!attribute [r] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Last update time of this resource. + # @!attribute [rw] forwarding_rules + # @return [::Array<::Google::Cloud::VmwareEngine::V1::DnsForwarding::ForwardingRule>] + # Required. List of domain mappings to configure + class DnsForwarding + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # A forwarding rule is a mapping of a `domain` to `name_servers`. + # This mapping allows VMware Engine to resolve domains for attached private + # clouds by forwarding DNS requests for a given domain to the specified + # nameservers. + # @!attribute [rw] domain + # @return [::String] + # Required. Domain used to resolve a `name_servers` list. + # @!attribute [rw] name_servers + # @return [::Array<::String>] + # Required. List of DNS servers to use for domain resolution + class ForwardingRule + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Details of a network peering. + # @!attribute [r] name + # @return [::String] + # Output only. The resource name of the network peering. NetworkPeering is a + # global resource and location can only be global. Resource names are + # scheme-less URIs that follow the conventions in + # https://cloud.google.com/apis/design/resource_names. + # For example: + # `projects/my-project/locations/global/networkPeerings/my-peering` + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Creation time of this resource. + # @!attribute [r] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Last update time of this resource. + # @!attribute [rw] peer_network + # @return [::String] + # Required. The relative resource name of the network to peer with + # a standard VMware Engine network. The provided network can be a + # consumer VPC network or another standard VMware Engine network. If the + # `peer_network_type` is VMWARE_ENGINE_NETWORK, specify the name in the form: + # `projects/{project}/locations/global/vmwareEngineNetworks/{vmware_engine_network_id}`. + # Otherwise specify the name in the form: + # `projects/{project}/global/networks/{network_id}`, where + # `{project}` can either be a project number or a project ID. + # @!attribute [rw] export_custom_routes + # @return [::Boolean] + # Optional. True if custom routes are exported to the peered network; + # false otherwise. The default value is true. + # @!attribute [rw] import_custom_routes + # @return [::Boolean] + # Optional. True if custom routes are imported from the peered network; + # false otherwise. The default value is true. + # @!attribute [rw] exchange_subnet_routes + # @return [::Boolean] + # Optional. True if full mesh connectivity is created and managed + # automatically between peered networks; false otherwise. Currently this + # field is always true because Google Compute Engine automatically creates + # and manages subnetwork routes between two VPC networks when peering state + # is 'ACTIVE'. + # @!attribute [rw] export_custom_routes_with_public_ip + # @return [::Boolean] + # Optional. True if all subnet routes with a public IP address range are + # exported; false otherwise. The default value is true. IPv4 special-use + # ranges (https://en.wikipedia.org/wiki/IPv4#Special_addresses) are always + # exported to peers and are not controlled by this field. + # @!attribute [rw] import_custom_routes_with_public_ip + # @return [::Boolean] + # Optional. True if all subnet routes with public IP address range are + # imported; false otherwise. The default value is true. IPv4 special-use + # ranges (https://en.wikipedia.org/wiki/IPv4#Special_addresses) are always + # imported to peers and are not controlled by this field. + # @!attribute [r] state + # @return [::Google::Cloud::VmwareEngine::V1::NetworkPeering::State] + # Output only. State of the network peering. This field + # has a value of 'ACTIVE' when there's a matching configuration in the peer + # network. New values may be added to this enum when appropriate. + # @!attribute [r] state_details + # @return [::String] + # Output only. Output Only. Details about the current state of the network + # peering. + # @!attribute [rw] peer_mtu + # @return [::Integer] + # Optional. Maximum transmission unit (MTU) in bytes. + # The default value is `1500`. If a value of `0` is provided for this field, + # VMware Engine uses the default value instead. + # @!attribute [rw] peer_network_type + # @return [::Google::Cloud::VmwareEngine::V1::NetworkPeering::PeerNetworkType] + # Required. The type of the network to peer with the VMware Engine network. + # @!attribute [r] uid + # @return [::String] + # Output only. System-generated unique identifier for the resource. + # @!attribute [rw] vmware_engine_network + # @return [::String] + # Required. The relative resource name of the VMware Engine network. + # Specify the name in the following form: + # `projects/{project}/locations/{location}/vmwareEngineNetworks/{vmware_engine_network_id}` + # where `{project}` can either be a project number or a project ID. + # @!attribute [rw] description + # @return [::String] + # Optional. User-provided description for this network peering. + class NetworkPeering + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Possible states of a network peering. + module State + # Unspecified network peering state. This is the default value. + STATE_UNSPECIFIED = 0 + + # The peering is not active. + INACTIVE = 1 + + # The peering is active. + ACTIVE = 2 + + # The peering is being created. + CREATING = 3 + + # The peering is being deleted. + DELETING = 4 + end + + # Type or purpose of the network peering connection. + module PeerNetworkType + # Unspecified + PEER_NETWORK_TYPE_UNSPECIFIED = 0 + + # Peering connection used for connecting to another VPC network established + # by the same user. For example, a peering connection to another VPC + # network in the same project or to an on-premises network. + STANDARD = 1 + + # Peering connection used for connecting to another VMware Engine network. + VMWARE_ENGINE_NETWORK = 2 + + # Peering connection used for establishing [private services + # access](https://cloud.google.com/vpc/docs/private-services-access). + PRIVATE_SERVICES_ACCESS = 3 + + # Peering connection used for connecting to NetApp Cloud Volumes. + NETAPP_CLOUD_VOLUMES = 4 + + # Peering connection used for connecting to third-party services. Most + # third-party services require manual setup of reverse peering on the VPC + # network associated with the third-party service. + THIRD_PARTY_SERVICE = 5 + + # Peering connection used for connecting to Dell PowerScale Filers + DELL_POWERSCALE = 6 + + # Peering connection used for connecting to Google Cloud NetApp Volumes. + GOOGLE_CLOUD_NETAPP_VOLUMES = 7 + end + end + + # Exchanged network peering route. + # @!attribute [r] dest_range + # @return [::String] + # Output only. Destination range of the peering route in CIDR notation. + # @!attribute [r] type + # @return [::Google::Cloud::VmwareEngine::V1::PeeringRoute::Type] + # Output only. Type of the route in the peer VPC network. + # @!attribute [r] next_hop_region + # @return [::String] + # Output only. Region containing the next hop of the peering route. This + # field only applies to dynamic routes in the peer VPC network. + # @!attribute [r] priority + # @return [::Integer] + # Output only. The priority of the peering route. + # @!attribute [r] imported + # @return [::Boolean] + # Output only. True if the peering route has been imported from a peered + # VPC network; false otherwise. The import happens if the field + # `NetworkPeering.importCustomRoutes` is true for this network, + # `NetworkPeering.exportCustomRoutes` is true for the peer VPC network, and + # the import does not result in a route conflict. + # @!attribute [r] direction + # @return [::Google::Cloud::VmwareEngine::V1::PeeringRoute::Direction] + # Output only. Direction of the routes exchanged with the peer network, from + # the VMware Engine network perspective: + # + # * Routes of direction `INCOMING` are imported from the peer network. + # * Routes of direction `OUTGOING` are exported from the intranet VPC network + # of the VMware Engine network. + class PeeringRoute + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The type of the peering route. + module Type + # Unspecified peering route type. This is the default value. + TYPE_UNSPECIFIED = 0 + + # Dynamic routes in the peer network. + DYNAMIC_PEERING_ROUTE = 1 + + # Static routes in the peer network. + STATIC_PEERING_ROUTE = 2 + + # Created, updated, and removed automatically by Google Cloud when subnets + # are created, modified, or deleted in the peer network. + SUBNET_PEERING_ROUTE = 3 + end + + # The direction of the exchanged routes. + module Direction + # Unspecified exchanged routes direction. This is default. + DIRECTION_UNSPECIFIED = 0 + + # Routes imported from the peer network. + INCOMING = 1 + + # Routes exported to the peer network. + OUTGOING = 2 + end + end + + # Represents a network policy resource. Network policies are regional + # resources. You can use a network policy to enable or disable internet access + # and external IP access. Network policies are associated with a VMware Engine + # network, which might span across regions. For a given region, a network + # policy applies to all private clouds in the VMware Engine network associated + # with the policy. + # @!attribute [r] name + # @return [::String] + # Output only. The resource name of this network policy. + # Resource names are schemeless URIs that follow the conventions in + # https://cloud.google.com/apis/design/resource_names. + # For example: + # `projects/my-project/locations/us-central1/networkPolicies/my-network-policy` + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Creation time of this resource. + # @!attribute [r] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Last update time of this resource. + # @!attribute [rw] internet_access + # @return [::Google::Cloud::VmwareEngine::V1::NetworkPolicy::NetworkService] + # Network service that allows VMware workloads to access the internet. + # @!attribute [rw] external_ip + # @return [::Google::Cloud::VmwareEngine::V1::NetworkPolicy::NetworkService] + # Network service that allows External IP addresses to be assigned to VMware + # workloads. This service can only be enabled when `internet_access` is also + # enabled. + # @!attribute [rw] edge_services_cidr + # @return [::String] + # Required. IP address range in CIDR notation used to create internet access + # and external IP access. An RFC 1918 CIDR block, with a "/26" prefix, is + # required. The range cannot overlap with any prefixes either in the consumer + # VPC network or in use by the private clouds attached to that VPC network. + # @!attribute [r] uid + # @return [::String] + # Output only. System-generated unique identifier for the resource. + # @!attribute [rw] vmware_engine_network + # @return [::String] + # Optional. The relative resource name of the VMware Engine network. + # Specify the name in the following form: + # `projects/{project}/locations/{location}/vmwareEngineNetworks/{vmware_engine_network_id}` + # where `{project}` can either be a project number or a project ID. + # @!attribute [rw] description + # @return [::String] + # Optional. User-provided description for this network policy. + # @!attribute [r] vmware_engine_network_canonical + # @return [::String] + # Output only. The canonical name of the VMware Engine network in the form: + # `projects/{project_number}/locations/{location}/vmwareEngineNetworks/{vmware_engine_network_id}` + class NetworkPolicy + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Represents a network service that is managed by a `NetworkPolicy` resource. + # A network service provides a way to control an aspect of external access to + # VMware workloads. For example, whether the VMware workloads in the + # private clouds governed by a network policy can access or be accessed from + # the internet. + # @!attribute [rw] enabled + # @return [::Boolean] + # True if the service is enabled; false otherwise. + # @!attribute [r] state + # @return [::Google::Cloud::VmwareEngine::V1::NetworkPolicy::NetworkService::State] + # Output only. State of the service. New values may be added to this enum + # when appropriate. + class NetworkService + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Enum State defines possible states of a network policy controlled + # service. + module State + # Unspecified service state. This is the default value. + STATE_UNSPECIFIED = 0 + + # Service is not provisioned. + UNPROVISIONED = 1 + + # Service is in the process of being provisioned/deprovisioned. + RECONCILING = 2 + + # Service is active. + ACTIVE = 3 + end + end + end + + # Represents a binding between a network and the management DNS zone. + # A management DNS zone is the Cloud DNS cross-project binding zone that + # VMware Engine creates for each private cloud. It contains FQDNs and + # corresponding IP addresses for the private cloud's ESXi hosts and management + # VM appliances like vCenter and NSX Manager. + # @!attribute [r] name + # @return [::String] + # Output only. The resource name of this binding. + # Resource names are schemeless URIs that follow the conventions in + # https://cloud.google.com/apis/design/resource_names. + # For example: + # `projects/my-project/locations/us-central1-a/privateClouds/my-cloud/managementDnsZoneBindings/my-management-dns-zone-binding` + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Creation time of this resource. + # @!attribute [r] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Last update time of this resource. + # @!attribute [r] state + # @return [::Google::Cloud::VmwareEngine::V1::ManagementDnsZoneBinding::State] + # Output only. The state of the resource. + # @!attribute [rw] description + # @return [::String] + # User-provided description for this resource. + # @!attribute [rw] vpc_network + # @return [::String] + # Network to bind is a standard consumer VPC. + # Specify the name in the following form for consumer + # VPC network: `projects/{project}/global/networks/{network_id}`. + # `{project}` can either be a project number or a project ID. + # + # Note: The following fields are mutually exclusive: `vpc_network`, `vmware_engine_network`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] vmware_engine_network + # @return [::String] + # Network to bind is a VMware Engine network. + # Specify the name in the following form for VMware engine network: + # `projects/{project}/locations/global/vmwareEngineNetworks/{vmware_engine_network_id}`. + # `{project}` can either be a project number or a project ID. + # + # Note: The following fields are mutually exclusive: `vmware_engine_network`, `vpc_network`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [r] uid + # @return [::String] + # Output only. System-generated unique identifier for the resource. + class ManagementDnsZoneBinding + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Enum State defines possible states of binding between the consumer VPC + # network and the management DNS zone. + module State + # The default value. This value should never be used. + STATE_UNSPECIFIED = 0 + + # The binding is ready. + ACTIVE = 1 + + # The binding is being created. + CREATING = 2 + + # The binding is being updated. + UPDATING = 3 + + # The binding is being deleted. + DELETING = 4 + + # The binding has failed. + FAILED = 5 + end + end + + # VMware Engine network resource that provides connectivity for VMware Engine + # private clouds. + # @!attribute [r] name + # @return [::String] + # Output only. The resource name of the VMware Engine network. + # Resource names are schemeless URIs that follow the conventions in + # https://cloud.google.com/apis/design/resource_names. + # For example: + # `projects/my-project/locations/global/vmwareEngineNetworks/my-network` + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Creation time of this resource. + # @!attribute [r] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Last update time of this resource. + # @!attribute [rw] description + # @return [::String] + # User-provided description for this VMware Engine network. + # @!attribute [r] vpc_networks + # @return [::Array<::Google::Cloud::VmwareEngine::V1::VmwareEngineNetwork::VpcNetwork>] + # Output only. VMware Engine service VPC networks that provide connectivity + # from a private cloud to customer projects, the internet, and other Google + # Cloud services. + # @!attribute [r] state + # @return [::Google::Cloud::VmwareEngine::V1::VmwareEngineNetwork::State] + # Output only. State of the VMware Engine network. + # @!attribute [rw] type + # @return [::Google::Cloud::VmwareEngine::V1::VmwareEngineNetwork::Type] + # Required. VMware Engine network type. + # @!attribute [r] uid + # @return [::String] + # Output only. System-generated unique identifier for the resource. + # @!attribute [rw] etag + # @return [::String] + # Checksum that may be sent on update and delete requests to ensure that the + # user-provided value is up to date before the server processes a request. + # The server computes checksums based on the value of other fields in the + # request. + class VmwareEngineNetwork + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Represents a VMware Engine VPC network that is managed by a + # VMware Engine network resource. + # @!attribute [r] type + # @return [::Google::Cloud::VmwareEngine::V1::VmwareEngineNetwork::VpcNetwork::Type] + # Output only. Type of VPC network (INTRANET, INTERNET, or + # GOOGLE_CLOUD) + # @!attribute [r] network + # @return [::String] + # Output only. The relative resource name of the service VPC network this + # VMware Engine network is attached to. For example: + # `projects/123123/global/networks/my-network` + class VpcNetwork + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Enum Type defines possible types of a VMware Engine network controlled + # service. + module Type + # The default value. This value should never be used. + TYPE_UNSPECIFIED = 0 + + # VPC network that will be peered with a consumer VPC network or the + # intranet VPC of another VMware Engine network. Access a private cloud + # through Compute Engine VMs on a peered VPC network or an on-premises + # resource connected to a peered consumer VPC network. + INTRANET = 1 + + # VPC network used for internet access to and from a private cloud. + INTERNET = 2 + + # VPC network used for access to Google Cloud services like + # Cloud Storage. + GOOGLE_CLOUD = 3 + end + end + + # Enum State defines possible states of VMware Engine network. + module State + # The default value. This value is used if the state is omitted. + STATE_UNSPECIFIED = 0 + + # The VMware Engine network is being created. + CREATING = 1 + + # The VMware Engine network is ready. + ACTIVE = 2 + + # The VMware Engine network is being updated. + UPDATING = 3 + + # The VMware Engine network is being deleted. + DELETING = 4 + end + + # Enum Type defines possible types of VMware Engine network. + module Type + # The default value. This value should never be used. + TYPE_UNSPECIFIED = 0 + + # Network type used by private clouds created in projects without a network + # of type `STANDARD`. This network type is no longer used for new VMware + # Engine private cloud deployments. + LEGACY = 1 + + # Standard network type used for private cloud connectivity. + STANDARD = 2 + end + end + + # Private connection resource that provides connectivity for VMware Engine + # private clouds. + # @!attribute [r] name + # @return [::String] + # Output only. The resource name of the private connection. + # Resource names are schemeless URIs that follow the conventions in + # https://cloud.google.com/apis/design/resource_names. + # For example: + # `projects/my-project/locations/us-central1/privateConnections/my-connection` + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Creation time of this resource. + # @!attribute [r] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Last update time of this resource. + # @!attribute [rw] description + # @return [::String] + # Optional. User-provided description for this private connection. + # @!attribute [r] state + # @return [::Google::Cloud::VmwareEngine::V1::PrivateConnection::State] + # Output only. State of the private connection. + # @!attribute [rw] vmware_engine_network + # @return [::String] + # Required. The relative resource name of Legacy VMware Engine network. + # Specify the name in the following form: + # `projects/{project}/locations/{location}/vmwareEngineNetworks/{vmware_engine_network_id}` + # where `{project}`, `{location}` will be same as specified in private + # connection resource name and `{vmware_engine_network_id}` will be in the + # form of `{location}`-default e.g. + # projects/project/locations/us-central1/vmwareEngineNetworks/us-central1-default. + # @!attribute [r] vmware_engine_network_canonical + # @return [::String] + # Output only. The canonical name of the VMware Engine network in the form: + # `projects/{project_number}/locations/{location}/vmwareEngineNetworks/{vmware_engine_network_id}` + # @!attribute [rw] type + # @return [::Google::Cloud::VmwareEngine::V1::PrivateConnection::Type] + # Required. Private connection type. + # @!attribute [r] peering_id + # @return [::String] + # Output only. VPC network peering id between given network VPC and + # VMwareEngineNetwork. + # @!attribute [rw] routing_mode + # @return [::Google::Cloud::VmwareEngine::V1::PrivateConnection::RoutingMode] + # Optional. Routing Mode. + # Default value is set to GLOBAL. + # For type = PRIVATE_SERVICE_ACCESS, this field can be set to GLOBAL or + # REGIONAL, for other types only GLOBAL is supported. + # @!attribute [r] uid + # @return [::String] + # Output only. System-generated unique identifier for the resource. + # @!attribute [rw] service_network + # @return [::String] + # Required. Service network to create private connection. + # Specify the name in the following form: + # `projects/{project}/global/networks/{network_id}` + # For type = PRIVATE_SERVICE_ACCESS, this field represents servicenetworking + # VPC, e.g. projects/project-tp/global/networks/servicenetworking. + # For type = NETAPP_CLOUD_VOLUME, this field represents NetApp service VPC, + # e.g. projects/project-tp/global/networks/netapp-tenant-vpc. + # For type = DELL_POWERSCALE, this field represent Dell service VPC, e.g. + # projects/project-tp/global/networks/dell-tenant-vpc. + # For type= THIRD_PARTY_SERVICE, this field could represent a consumer VPC or + # any other producer VPC to which the VMware Engine Network needs to be + # connected, e.g. projects/project/global/networks/vpc. + # @!attribute [r] peering_state + # @return [::Google::Cloud::VmwareEngine::V1::PrivateConnection::PeeringState] + # Output only. Peering state between service network and VMware Engine + # network. + class PrivateConnection + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Enum State defines possible states of private connection. + module State + # The default value. This value is used if the state is omitted. + STATE_UNSPECIFIED = 0 + + # The private connection is being created. + CREATING = 1 + + # The private connection is ready. + ACTIVE = 2 + + # The private connection is being updated. + UPDATING = 3 + + # The private connection is being deleted. + DELETING = 4 + + # The private connection is not provisioned, since no private cloud is + # present for which this private connection is needed. + UNPROVISIONED = 5 + + # The private connection is in failed state. + FAILED = 6 + end + + # Enum Type defines possible types of private connection. + module Type + # The default value. This value should never be used. + TYPE_UNSPECIFIED = 0 + + # Connection used for establishing [private services + # access](https://cloud.google.com/vpc/docs/private-services-access). + PRIVATE_SERVICE_ACCESS = 1 + + # Connection used for connecting to NetApp Cloud Volumes. + NETAPP_CLOUD_VOLUMES = 2 + + # Connection used for connecting to Dell PowerScale. + DELL_POWERSCALE = 3 + + # Connection used for connecting to third-party services. + THIRD_PARTY_SERVICE = 4 + end + + # Possible types for RoutingMode + module RoutingMode + # The default value. This value should never be used. + ROUTING_MODE_UNSPECIFIED = 0 + + # Global Routing Mode + GLOBAL = 1 + + # Regional Routing Mode + REGIONAL = 2 + end + + # Enum PeeringState defines the possible states of peering between service + # network and the vpc network peered to service network + module PeeringState + # The default value. This value is used if the peering state is omitted or + # unknown. + PEERING_STATE_UNSPECIFIED = 0 + + # The peering is in active state. + PEERING_ACTIVE = 1 + + # The peering is in inactive state. + PEERING_INACTIVE = 2 + end + end + + # VmwareEngine specific metadata for the given + # [google.cloud.location.Location][google.cloud.location.Location]. It is + # returned as a content of the `google.cloud.location.Location.metadata` field. + # @!attribute [r] capabilities + # @return [::Array<::Google::Cloud::VmwareEngine::V1::LocationMetadata::Capability>] + # Output only. Capabilities of this location. + class LocationMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Capability of a location. + module Capability + # The default value. This value is used if the capability is omitted or + # unknown. + CAPABILITY_UNSPECIFIED = 0 + + # Stretch clusters are supported in this location. + STRETCHED_CLUSTERS = 1 + end + end + + # DnsBindPermission resource that contains the accounts having the consumer DNS + # bind permission on the corresponding intranet VPC of the consumer project. + # @!attribute [r] name + # @return [::String] + # Required. Output only. The name of the resource which stores the + # users/service accounts having the permission to bind to the corresponding + # intranet VPC of the consumer project. DnsBindPermission is a global + # resource and location can only be global. Resource names are schemeless + # URIs that follow the conventions in + # https://cloud.google.com/apis/design/resource_names. For example: + # `projects/my-project/locations/global/dnsBindPermission` + # @!attribute [r] principals + # @return [::Array<::Google::Cloud::VmwareEngine::V1::Principal>] + # Output only. Users/Service accounts which have access for binding on the + # intranet VPC project corresponding to the consumer project. + class DnsBindPermission + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Users/Service accounts which have access for DNS binding on the intranet + # VPC corresponding to the consumer project. + # @!attribute [rw] user + # @return [::String] + # The user who needs to be granted permission. + # + # Note: The following fields are mutually exclusive: `user`, `service_account`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] service_account + # @return [::String] + # The service account which needs to be granted the permission. + # + # Note: The following fields are mutually exclusive: `service_account`, `user`. If a field in that set is populated, all other fields in the set will automatically be cleared. + class Principal + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-vmware_engine-v1/proto_docs/google/longrunning/operations.rb b/owl-bot-staging/google-cloud-vmware_engine-v1/proto_docs/google/longrunning/operations.rb new file mode 100644 index 000000000000..7a757f512165 --- /dev/null +++ b/owl-bot-staging/google-cloud-vmware_engine-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-vmware_engine-v1/proto_docs/google/protobuf/any.rb b/owl-bot-staging/google-cloud-vmware_engine-v1/proto_docs/google/protobuf/any.rb new file mode 100644 index 000000000000..58691995f02e --- /dev/null +++ b/owl-bot-staging/google-cloud-vmware_engine-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-vmware_engine-v1/proto_docs/google/protobuf/duration.rb b/owl-bot-staging/google-cloud-vmware_engine-v1/proto_docs/google/protobuf/duration.rb new file mode 100644 index 000000000000..ea59f1f91daf --- /dev/null +++ b/owl-bot-staging/google-cloud-vmware_engine-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-vmware_engine-v1/proto_docs/google/protobuf/empty.rb b/owl-bot-staging/google-cloud-vmware_engine-v1/proto_docs/google/protobuf/empty.rb new file mode 100644 index 000000000000..83e4481834a6 --- /dev/null +++ b/owl-bot-staging/google-cloud-vmware_engine-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-vmware_engine-v1/proto_docs/google/protobuf/field_mask.rb b/owl-bot-staging/google-cloud-vmware_engine-v1/proto_docs/google/protobuf/field_mask.rb new file mode 100644 index 000000000000..7f3ffc78601a --- /dev/null +++ b/owl-bot-staging/google-cloud-vmware_engine-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-vmware_engine-v1/proto_docs/google/protobuf/timestamp.rb b/owl-bot-staging/google-cloud-vmware_engine-v1/proto_docs/google/protobuf/timestamp.rb new file mode 100644 index 000000000000..74352be9c58c --- /dev/null +++ b/owl-bot-staging/google-cloud-vmware_engine-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-vmware_engine-v1/proto_docs/google/rpc/status.rb b/owl-bot-staging/google-cloud-vmware_engine-v1/proto_docs/google/rpc/status.rb new file mode 100644 index 000000000000..c1a1c07eb2db --- /dev/null +++ b/owl-bot-staging/google-cloud-vmware_engine-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-vmware_engine-v1/proto_docs/google/type/expr.rb b/owl-bot-staging/google-cloud-vmware_engine-v1/proto_docs/google/type/expr.rb new file mode 100644 index 000000000000..53e7733b6592 --- /dev/null +++ b/owl-bot-staging/google-cloud-vmware_engine-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-vmware_engine-v1/snippets/Gemfile b/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/Gemfile new file mode 100644 index 000000000000..2e62d5506757 --- /dev/null +++ b/owl-bot-staging/google-cloud-vmware_engine-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-vmware_engine-v1", path: "../" +else + gem "google-cloud-vmware_engine-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-vmware_engine-v1/snippets/snippet_metadata_google.cloud.vmwareengine.v1.json b/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/snippet_metadata_google.cloud.vmwareengine.v1.json new file mode 100644 index 000000000000..9515e08a2d2e --- /dev/null +++ b/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/snippet_metadata_google.cloud.vmwareengine.v1.json @@ -0,0 +1,2975 @@ +{ + "client_library": { + "name": "google-cloud-vmware_engine-v1", + "version": "", + "language": "RUBY", + "apis": [ + { + "id": "google.cloud.vmwareengine.v1", + "version": "v1" + } + ] + }, + "snippets": [ + { + "region_tag": "vmwareengine_v1_generated_VmwareEngine_ListPrivateClouds_sync", + "title": "Snippet for the list_private_clouds call in the VmwareEngine service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#list_private_clouds.", + "file": "vmware_engine/list_private_clouds.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_private_clouds", + "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#list_private_clouds", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VmwareEngine::V1::ListPrivateCloudsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::VmwareEngine::V1::ListPrivateCloudsResponse", + "client": { + "short_name": "VmwareEngine::Client", + "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client" + }, + "method": { + "short_name": "ListPrivateClouds", + "full_name": "google.cloud.vmwareengine.v1.VmwareEngine.ListPrivateClouds", + "service": { + "short_name": "VmwareEngine", + "full_name": "google.cloud.vmwareengine.v1.VmwareEngine" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "vmwareengine_v1_generated_VmwareEngine_GetPrivateCloud_sync", + "title": "Snippet for the get_private_cloud call in the VmwareEngine service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#get_private_cloud.", + "file": "vmware_engine/get_private_cloud.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_private_cloud", + "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#get_private_cloud", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VmwareEngine::V1::GetPrivateCloudRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::VmwareEngine::V1::PrivateCloud", + "client": { + "short_name": "VmwareEngine::Client", + "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client" + }, + "method": { + "short_name": "GetPrivateCloud", + "full_name": "google.cloud.vmwareengine.v1.VmwareEngine.GetPrivateCloud", + "service": { + "short_name": "VmwareEngine", + "full_name": "google.cloud.vmwareengine.v1.VmwareEngine" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "vmwareengine_v1_generated_VmwareEngine_CreatePrivateCloud_sync", + "title": "Snippet for the create_private_cloud call in the VmwareEngine service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#create_private_cloud.", + "file": "vmware_engine/create_private_cloud.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_private_cloud", + "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#create_private_cloud", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VmwareEngine::V1::CreatePrivateCloudRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "VmwareEngine::Client", + "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client" + }, + "method": { + "short_name": "CreatePrivateCloud", + "full_name": "google.cloud.vmwareengine.v1.VmwareEngine.CreatePrivateCloud", + "service": { + "short_name": "VmwareEngine", + "full_name": "google.cloud.vmwareengine.v1.VmwareEngine" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "vmwareengine_v1_generated_VmwareEngine_UpdatePrivateCloud_sync", + "title": "Snippet for the update_private_cloud call in the VmwareEngine service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#update_private_cloud.", + "file": "vmware_engine/update_private_cloud.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_private_cloud", + "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#update_private_cloud", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VmwareEngine::V1::UpdatePrivateCloudRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "VmwareEngine::Client", + "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client" + }, + "method": { + "short_name": "UpdatePrivateCloud", + "full_name": "google.cloud.vmwareengine.v1.VmwareEngine.UpdatePrivateCloud", + "service": { + "short_name": "VmwareEngine", + "full_name": "google.cloud.vmwareengine.v1.VmwareEngine" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "vmwareengine_v1_generated_VmwareEngine_DeletePrivateCloud_sync", + "title": "Snippet for the delete_private_cloud call in the VmwareEngine service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#delete_private_cloud.", + "file": "vmware_engine/delete_private_cloud.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_private_cloud", + "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#delete_private_cloud", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VmwareEngine::V1::DeletePrivateCloudRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "VmwareEngine::Client", + "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client" + }, + "method": { + "short_name": "DeletePrivateCloud", + "full_name": "google.cloud.vmwareengine.v1.VmwareEngine.DeletePrivateCloud", + "service": { + "short_name": "VmwareEngine", + "full_name": "google.cloud.vmwareengine.v1.VmwareEngine" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "vmwareengine_v1_generated_VmwareEngine_UndeletePrivateCloud_sync", + "title": "Snippet for the undelete_private_cloud call in the VmwareEngine service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#undelete_private_cloud.", + "file": "vmware_engine/undelete_private_cloud.rb", + "language": "RUBY", + "client_method": { + "short_name": "undelete_private_cloud", + "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#undelete_private_cloud", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VmwareEngine::V1::UndeletePrivateCloudRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "VmwareEngine::Client", + "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client" + }, + "method": { + "short_name": "UndeletePrivateCloud", + "full_name": "google.cloud.vmwareengine.v1.VmwareEngine.UndeletePrivateCloud", + "service": { + "short_name": "VmwareEngine", + "full_name": "google.cloud.vmwareengine.v1.VmwareEngine" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "vmwareengine_v1_generated_VmwareEngine_ListClusters_sync", + "title": "Snippet for the list_clusters call in the VmwareEngine service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#list_clusters.", + "file": "vmware_engine/list_clusters.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_clusters", + "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#list_clusters", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VmwareEngine::V1::ListClustersRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::VmwareEngine::V1::ListClustersResponse", + "client": { + "short_name": "VmwareEngine::Client", + "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client" + }, + "method": { + "short_name": "ListClusters", + "full_name": "google.cloud.vmwareengine.v1.VmwareEngine.ListClusters", + "service": { + "short_name": "VmwareEngine", + "full_name": "google.cloud.vmwareengine.v1.VmwareEngine" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "vmwareengine_v1_generated_VmwareEngine_GetCluster_sync", + "title": "Snippet for the get_cluster call in the VmwareEngine service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#get_cluster.", + "file": "vmware_engine/get_cluster.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_cluster", + "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#get_cluster", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VmwareEngine::V1::GetClusterRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::VmwareEngine::V1::Cluster", + "client": { + "short_name": "VmwareEngine::Client", + "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client" + }, + "method": { + "short_name": "GetCluster", + "full_name": "google.cloud.vmwareengine.v1.VmwareEngine.GetCluster", + "service": { + "short_name": "VmwareEngine", + "full_name": "google.cloud.vmwareengine.v1.VmwareEngine" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "vmwareengine_v1_generated_VmwareEngine_CreateCluster_sync", + "title": "Snippet for the create_cluster call in the VmwareEngine service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#create_cluster.", + "file": "vmware_engine/create_cluster.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_cluster", + "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#create_cluster", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VmwareEngine::V1::CreateClusterRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "VmwareEngine::Client", + "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client" + }, + "method": { + "short_name": "CreateCluster", + "full_name": "google.cloud.vmwareengine.v1.VmwareEngine.CreateCluster", + "service": { + "short_name": "VmwareEngine", + "full_name": "google.cloud.vmwareengine.v1.VmwareEngine" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "vmwareengine_v1_generated_VmwareEngine_UpdateCluster_sync", + "title": "Snippet for the update_cluster call in the VmwareEngine service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#update_cluster.", + "file": "vmware_engine/update_cluster.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_cluster", + "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#update_cluster", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VmwareEngine::V1::UpdateClusterRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "VmwareEngine::Client", + "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client" + }, + "method": { + "short_name": "UpdateCluster", + "full_name": "google.cloud.vmwareengine.v1.VmwareEngine.UpdateCluster", + "service": { + "short_name": "VmwareEngine", + "full_name": "google.cloud.vmwareengine.v1.VmwareEngine" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "vmwareengine_v1_generated_VmwareEngine_DeleteCluster_sync", + "title": "Snippet for the delete_cluster call in the VmwareEngine service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#delete_cluster.", + "file": "vmware_engine/delete_cluster.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_cluster", + "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#delete_cluster", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VmwareEngine::V1::DeleteClusterRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "VmwareEngine::Client", + "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client" + }, + "method": { + "short_name": "DeleteCluster", + "full_name": "google.cloud.vmwareengine.v1.VmwareEngine.DeleteCluster", + "service": { + "short_name": "VmwareEngine", + "full_name": "google.cloud.vmwareengine.v1.VmwareEngine" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "vmwareengine_v1_generated_VmwareEngine_ListNodes_sync", + "title": "Snippet for the list_nodes call in the VmwareEngine service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#list_nodes.", + "file": "vmware_engine/list_nodes.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_nodes", + "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#list_nodes", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VmwareEngine::V1::ListNodesRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::VmwareEngine::V1::ListNodesResponse", + "client": { + "short_name": "VmwareEngine::Client", + "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client" + }, + "method": { + "short_name": "ListNodes", + "full_name": "google.cloud.vmwareengine.v1.VmwareEngine.ListNodes", + "service": { + "short_name": "VmwareEngine", + "full_name": "google.cloud.vmwareengine.v1.VmwareEngine" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "vmwareengine_v1_generated_VmwareEngine_GetNode_sync", + "title": "Snippet for the get_node call in the VmwareEngine service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#get_node.", + "file": "vmware_engine/get_node.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_node", + "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#get_node", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VmwareEngine::V1::GetNodeRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::VmwareEngine::V1::Node", + "client": { + "short_name": "VmwareEngine::Client", + "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client" + }, + "method": { + "short_name": "GetNode", + "full_name": "google.cloud.vmwareengine.v1.VmwareEngine.GetNode", + "service": { + "short_name": "VmwareEngine", + "full_name": "google.cloud.vmwareengine.v1.VmwareEngine" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "vmwareengine_v1_generated_VmwareEngine_ListExternalAddresses_sync", + "title": "Snippet for the list_external_addresses call in the VmwareEngine service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#list_external_addresses.", + "file": "vmware_engine/list_external_addresses.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_external_addresses", + "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#list_external_addresses", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VmwareEngine::V1::ListExternalAddressesRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::VmwareEngine::V1::ListExternalAddressesResponse", + "client": { + "short_name": "VmwareEngine::Client", + "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client" + }, + "method": { + "short_name": "ListExternalAddresses", + "full_name": "google.cloud.vmwareengine.v1.VmwareEngine.ListExternalAddresses", + "service": { + "short_name": "VmwareEngine", + "full_name": "google.cloud.vmwareengine.v1.VmwareEngine" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "vmwareengine_v1_generated_VmwareEngine_FetchNetworkPolicyExternalAddresses_sync", + "title": "Snippet for the fetch_network_policy_external_addresses call in the VmwareEngine service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#fetch_network_policy_external_addresses.", + "file": "vmware_engine/fetch_network_policy_external_addresses.rb", + "language": "RUBY", + "client_method": { + "short_name": "fetch_network_policy_external_addresses", + "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#fetch_network_policy_external_addresses", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VmwareEngine::V1::FetchNetworkPolicyExternalAddressesRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::VmwareEngine::V1::FetchNetworkPolicyExternalAddressesResponse", + "client": { + "short_name": "VmwareEngine::Client", + "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client" + }, + "method": { + "short_name": "FetchNetworkPolicyExternalAddresses", + "full_name": "google.cloud.vmwareengine.v1.VmwareEngine.FetchNetworkPolicyExternalAddresses", + "service": { + "short_name": "VmwareEngine", + "full_name": "google.cloud.vmwareengine.v1.VmwareEngine" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "vmwareengine_v1_generated_VmwareEngine_GetExternalAddress_sync", + "title": "Snippet for the get_external_address call in the VmwareEngine service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#get_external_address.", + "file": "vmware_engine/get_external_address.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_external_address", + "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#get_external_address", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VmwareEngine::V1::GetExternalAddressRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::VmwareEngine::V1::ExternalAddress", + "client": { + "short_name": "VmwareEngine::Client", + "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client" + }, + "method": { + "short_name": "GetExternalAddress", + "full_name": "google.cloud.vmwareengine.v1.VmwareEngine.GetExternalAddress", + "service": { + "short_name": "VmwareEngine", + "full_name": "google.cloud.vmwareengine.v1.VmwareEngine" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "vmwareengine_v1_generated_VmwareEngine_CreateExternalAddress_sync", + "title": "Snippet for the create_external_address call in the VmwareEngine service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#create_external_address.", + "file": "vmware_engine/create_external_address.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_external_address", + "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#create_external_address", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VmwareEngine::V1::CreateExternalAddressRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "VmwareEngine::Client", + "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client" + }, + "method": { + "short_name": "CreateExternalAddress", + "full_name": "google.cloud.vmwareengine.v1.VmwareEngine.CreateExternalAddress", + "service": { + "short_name": "VmwareEngine", + "full_name": "google.cloud.vmwareengine.v1.VmwareEngine" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "vmwareengine_v1_generated_VmwareEngine_UpdateExternalAddress_sync", + "title": "Snippet for the update_external_address call in the VmwareEngine service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#update_external_address.", + "file": "vmware_engine/update_external_address.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_external_address", + "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#update_external_address", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VmwareEngine::V1::UpdateExternalAddressRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "VmwareEngine::Client", + "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client" + }, + "method": { + "short_name": "UpdateExternalAddress", + "full_name": "google.cloud.vmwareengine.v1.VmwareEngine.UpdateExternalAddress", + "service": { + "short_name": "VmwareEngine", + "full_name": "google.cloud.vmwareengine.v1.VmwareEngine" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "vmwareengine_v1_generated_VmwareEngine_DeleteExternalAddress_sync", + "title": "Snippet for the delete_external_address call in the VmwareEngine service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#delete_external_address.", + "file": "vmware_engine/delete_external_address.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_external_address", + "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#delete_external_address", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VmwareEngine::V1::DeleteExternalAddressRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "VmwareEngine::Client", + "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client" + }, + "method": { + "short_name": "DeleteExternalAddress", + "full_name": "google.cloud.vmwareengine.v1.VmwareEngine.DeleteExternalAddress", + "service": { + "short_name": "VmwareEngine", + "full_name": "google.cloud.vmwareengine.v1.VmwareEngine" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "vmwareengine_v1_generated_VmwareEngine_ListSubnets_sync", + "title": "Snippet for the list_subnets call in the VmwareEngine service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#list_subnets.", + "file": "vmware_engine/list_subnets.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_subnets", + "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#list_subnets", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VmwareEngine::V1::ListSubnetsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::VmwareEngine::V1::ListSubnetsResponse", + "client": { + "short_name": "VmwareEngine::Client", + "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client" + }, + "method": { + "short_name": "ListSubnets", + "full_name": "google.cloud.vmwareengine.v1.VmwareEngine.ListSubnets", + "service": { + "short_name": "VmwareEngine", + "full_name": "google.cloud.vmwareengine.v1.VmwareEngine" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "vmwareengine_v1_generated_VmwareEngine_GetSubnet_sync", + "title": "Snippet for the get_subnet call in the VmwareEngine service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#get_subnet.", + "file": "vmware_engine/get_subnet.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_subnet", + "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#get_subnet", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VmwareEngine::V1::GetSubnetRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::VmwareEngine::V1::Subnet", + "client": { + "short_name": "VmwareEngine::Client", + "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client" + }, + "method": { + "short_name": "GetSubnet", + "full_name": "google.cloud.vmwareengine.v1.VmwareEngine.GetSubnet", + "service": { + "short_name": "VmwareEngine", + "full_name": "google.cloud.vmwareengine.v1.VmwareEngine" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "vmwareengine_v1_generated_VmwareEngine_UpdateSubnet_sync", + "title": "Snippet for the update_subnet call in the VmwareEngine service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#update_subnet.", + "file": "vmware_engine/update_subnet.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_subnet", + "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#update_subnet", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VmwareEngine::V1::UpdateSubnetRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "VmwareEngine::Client", + "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client" + }, + "method": { + "short_name": "UpdateSubnet", + "full_name": "google.cloud.vmwareengine.v1.VmwareEngine.UpdateSubnet", + "service": { + "short_name": "VmwareEngine", + "full_name": "google.cloud.vmwareengine.v1.VmwareEngine" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "vmwareengine_v1_generated_VmwareEngine_ListExternalAccessRules_sync", + "title": "Snippet for the list_external_access_rules call in the VmwareEngine service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#list_external_access_rules.", + "file": "vmware_engine/list_external_access_rules.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_external_access_rules", + "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#list_external_access_rules", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VmwareEngine::V1::ListExternalAccessRulesRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::VmwareEngine::V1::ListExternalAccessRulesResponse", + "client": { + "short_name": "VmwareEngine::Client", + "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client" + }, + "method": { + "short_name": "ListExternalAccessRules", + "full_name": "google.cloud.vmwareengine.v1.VmwareEngine.ListExternalAccessRules", + "service": { + "short_name": "VmwareEngine", + "full_name": "google.cloud.vmwareengine.v1.VmwareEngine" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "vmwareengine_v1_generated_VmwareEngine_GetExternalAccessRule_sync", + "title": "Snippet for the get_external_access_rule call in the VmwareEngine service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#get_external_access_rule.", + "file": "vmware_engine/get_external_access_rule.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_external_access_rule", + "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#get_external_access_rule", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VmwareEngine::V1::GetExternalAccessRuleRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::VmwareEngine::V1::ExternalAccessRule", + "client": { + "short_name": "VmwareEngine::Client", + "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client" + }, + "method": { + "short_name": "GetExternalAccessRule", + "full_name": "google.cloud.vmwareengine.v1.VmwareEngine.GetExternalAccessRule", + "service": { + "short_name": "VmwareEngine", + "full_name": "google.cloud.vmwareengine.v1.VmwareEngine" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "vmwareengine_v1_generated_VmwareEngine_CreateExternalAccessRule_sync", + "title": "Snippet for the create_external_access_rule call in the VmwareEngine service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#create_external_access_rule.", + "file": "vmware_engine/create_external_access_rule.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_external_access_rule", + "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#create_external_access_rule", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VmwareEngine::V1::CreateExternalAccessRuleRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "VmwareEngine::Client", + "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client" + }, + "method": { + "short_name": "CreateExternalAccessRule", + "full_name": "google.cloud.vmwareengine.v1.VmwareEngine.CreateExternalAccessRule", + "service": { + "short_name": "VmwareEngine", + "full_name": "google.cloud.vmwareengine.v1.VmwareEngine" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "vmwareengine_v1_generated_VmwareEngine_UpdateExternalAccessRule_sync", + "title": "Snippet for the update_external_access_rule call in the VmwareEngine service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#update_external_access_rule.", + "file": "vmware_engine/update_external_access_rule.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_external_access_rule", + "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#update_external_access_rule", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VmwareEngine::V1::UpdateExternalAccessRuleRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "VmwareEngine::Client", + "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client" + }, + "method": { + "short_name": "UpdateExternalAccessRule", + "full_name": "google.cloud.vmwareengine.v1.VmwareEngine.UpdateExternalAccessRule", + "service": { + "short_name": "VmwareEngine", + "full_name": "google.cloud.vmwareengine.v1.VmwareEngine" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "vmwareengine_v1_generated_VmwareEngine_DeleteExternalAccessRule_sync", + "title": "Snippet for the delete_external_access_rule call in the VmwareEngine service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#delete_external_access_rule.", + "file": "vmware_engine/delete_external_access_rule.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_external_access_rule", + "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#delete_external_access_rule", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VmwareEngine::V1::DeleteExternalAccessRuleRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "VmwareEngine::Client", + "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client" + }, + "method": { + "short_name": "DeleteExternalAccessRule", + "full_name": "google.cloud.vmwareengine.v1.VmwareEngine.DeleteExternalAccessRule", + "service": { + "short_name": "VmwareEngine", + "full_name": "google.cloud.vmwareengine.v1.VmwareEngine" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "vmwareengine_v1_generated_VmwareEngine_ListLoggingServers_sync", + "title": "Snippet for the list_logging_servers call in the VmwareEngine service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#list_logging_servers.", + "file": "vmware_engine/list_logging_servers.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_logging_servers", + "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#list_logging_servers", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VmwareEngine::V1::ListLoggingServersRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::VmwareEngine::V1::ListLoggingServersResponse", + "client": { + "short_name": "VmwareEngine::Client", + "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client" + }, + "method": { + "short_name": "ListLoggingServers", + "full_name": "google.cloud.vmwareengine.v1.VmwareEngine.ListLoggingServers", + "service": { + "short_name": "VmwareEngine", + "full_name": "google.cloud.vmwareengine.v1.VmwareEngine" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "vmwareengine_v1_generated_VmwareEngine_GetLoggingServer_sync", + "title": "Snippet for the get_logging_server call in the VmwareEngine service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#get_logging_server.", + "file": "vmware_engine/get_logging_server.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_logging_server", + "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#get_logging_server", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VmwareEngine::V1::GetLoggingServerRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::VmwareEngine::V1::LoggingServer", + "client": { + "short_name": "VmwareEngine::Client", + "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client" + }, + "method": { + "short_name": "GetLoggingServer", + "full_name": "google.cloud.vmwareengine.v1.VmwareEngine.GetLoggingServer", + "service": { + "short_name": "VmwareEngine", + "full_name": "google.cloud.vmwareengine.v1.VmwareEngine" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "vmwareengine_v1_generated_VmwareEngine_CreateLoggingServer_sync", + "title": "Snippet for the create_logging_server call in the VmwareEngine service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#create_logging_server.", + "file": "vmware_engine/create_logging_server.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_logging_server", + "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#create_logging_server", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VmwareEngine::V1::CreateLoggingServerRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "VmwareEngine::Client", + "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client" + }, + "method": { + "short_name": "CreateLoggingServer", + "full_name": "google.cloud.vmwareengine.v1.VmwareEngine.CreateLoggingServer", + "service": { + "short_name": "VmwareEngine", + "full_name": "google.cloud.vmwareengine.v1.VmwareEngine" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "vmwareengine_v1_generated_VmwareEngine_UpdateLoggingServer_sync", + "title": "Snippet for the update_logging_server call in the VmwareEngine service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#update_logging_server.", + "file": "vmware_engine/update_logging_server.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_logging_server", + "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#update_logging_server", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VmwareEngine::V1::UpdateLoggingServerRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "VmwareEngine::Client", + "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client" + }, + "method": { + "short_name": "UpdateLoggingServer", + "full_name": "google.cloud.vmwareengine.v1.VmwareEngine.UpdateLoggingServer", + "service": { + "short_name": "VmwareEngine", + "full_name": "google.cloud.vmwareengine.v1.VmwareEngine" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "vmwareengine_v1_generated_VmwareEngine_DeleteLoggingServer_sync", + "title": "Snippet for the delete_logging_server call in the VmwareEngine service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#delete_logging_server.", + "file": "vmware_engine/delete_logging_server.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_logging_server", + "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#delete_logging_server", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VmwareEngine::V1::DeleteLoggingServerRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "VmwareEngine::Client", + "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client" + }, + "method": { + "short_name": "DeleteLoggingServer", + "full_name": "google.cloud.vmwareengine.v1.VmwareEngine.DeleteLoggingServer", + "service": { + "short_name": "VmwareEngine", + "full_name": "google.cloud.vmwareengine.v1.VmwareEngine" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "vmwareengine_v1_generated_VmwareEngine_ListNodeTypes_sync", + "title": "Snippet for the list_node_types call in the VmwareEngine service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#list_node_types.", + "file": "vmware_engine/list_node_types.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_node_types", + "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#list_node_types", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VmwareEngine::V1::ListNodeTypesRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::VmwareEngine::V1::ListNodeTypesResponse", + "client": { + "short_name": "VmwareEngine::Client", + "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client" + }, + "method": { + "short_name": "ListNodeTypes", + "full_name": "google.cloud.vmwareengine.v1.VmwareEngine.ListNodeTypes", + "service": { + "short_name": "VmwareEngine", + "full_name": "google.cloud.vmwareengine.v1.VmwareEngine" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "vmwareengine_v1_generated_VmwareEngine_GetNodeType_sync", + "title": "Snippet for the get_node_type call in the VmwareEngine service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#get_node_type.", + "file": "vmware_engine/get_node_type.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_node_type", + "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#get_node_type", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VmwareEngine::V1::GetNodeTypeRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::VmwareEngine::V1::NodeType", + "client": { + "short_name": "VmwareEngine::Client", + "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client" + }, + "method": { + "short_name": "GetNodeType", + "full_name": "google.cloud.vmwareengine.v1.VmwareEngine.GetNodeType", + "service": { + "short_name": "VmwareEngine", + "full_name": "google.cloud.vmwareengine.v1.VmwareEngine" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "vmwareengine_v1_generated_VmwareEngine_ShowNsxCredentials_sync", + "title": "Snippet for the show_nsx_credentials call in the VmwareEngine service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#show_nsx_credentials.", + "file": "vmware_engine/show_nsx_credentials.rb", + "language": "RUBY", + "client_method": { + "short_name": "show_nsx_credentials", + "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#show_nsx_credentials", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VmwareEngine::V1::ShowNsxCredentialsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::VmwareEngine::V1::Credentials", + "client": { + "short_name": "VmwareEngine::Client", + "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client" + }, + "method": { + "short_name": "ShowNsxCredentials", + "full_name": "google.cloud.vmwareengine.v1.VmwareEngine.ShowNsxCredentials", + "service": { + "short_name": "VmwareEngine", + "full_name": "google.cloud.vmwareengine.v1.VmwareEngine" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "vmwareengine_v1_generated_VmwareEngine_ShowVcenterCredentials_sync", + "title": "Snippet for the show_vcenter_credentials call in the VmwareEngine service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#show_vcenter_credentials.", + "file": "vmware_engine/show_vcenter_credentials.rb", + "language": "RUBY", + "client_method": { + "short_name": "show_vcenter_credentials", + "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#show_vcenter_credentials", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VmwareEngine::V1::ShowVcenterCredentialsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::VmwareEngine::V1::Credentials", + "client": { + "short_name": "VmwareEngine::Client", + "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client" + }, + "method": { + "short_name": "ShowVcenterCredentials", + "full_name": "google.cloud.vmwareengine.v1.VmwareEngine.ShowVcenterCredentials", + "service": { + "short_name": "VmwareEngine", + "full_name": "google.cloud.vmwareengine.v1.VmwareEngine" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "vmwareengine_v1_generated_VmwareEngine_ResetNsxCredentials_sync", + "title": "Snippet for the reset_nsx_credentials call in the VmwareEngine service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#reset_nsx_credentials.", + "file": "vmware_engine/reset_nsx_credentials.rb", + "language": "RUBY", + "client_method": { + "short_name": "reset_nsx_credentials", + "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#reset_nsx_credentials", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VmwareEngine::V1::ResetNsxCredentialsRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "VmwareEngine::Client", + "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client" + }, + "method": { + "short_name": "ResetNsxCredentials", + "full_name": "google.cloud.vmwareengine.v1.VmwareEngine.ResetNsxCredentials", + "service": { + "short_name": "VmwareEngine", + "full_name": "google.cloud.vmwareengine.v1.VmwareEngine" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "vmwareengine_v1_generated_VmwareEngine_ResetVcenterCredentials_sync", + "title": "Snippet for the reset_vcenter_credentials call in the VmwareEngine service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#reset_vcenter_credentials.", + "file": "vmware_engine/reset_vcenter_credentials.rb", + "language": "RUBY", + "client_method": { + "short_name": "reset_vcenter_credentials", + "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#reset_vcenter_credentials", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VmwareEngine::V1::ResetVcenterCredentialsRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "VmwareEngine::Client", + "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client" + }, + "method": { + "short_name": "ResetVcenterCredentials", + "full_name": "google.cloud.vmwareengine.v1.VmwareEngine.ResetVcenterCredentials", + "service": { + "short_name": "VmwareEngine", + "full_name": "google.cloud.vmwareengine.v1.VmwareEngine" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "vmwareengine_v1_generated_VmwareEngine_GetDnsForwarding_sync", + "title": "Snippet for the get_dns_forwarding call in the VmwareEngine service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#get_dns_forwarding.", + "file": "vmware_engine/get_dns_forwarding.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_dns_forwarding", + "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#get_dns_forwarding", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VmwareEngine::V1::GetDnsForwardingRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::VmwareEngine::V1::DnsForwarding", + "client": { + "short_name": "VmwareEngine::Client", + "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client" + }, + "method": { + "short_name": "GetDnsForwarding", + "full_name": "google.cloud.vmwareengine.v1.VmwareEngine.GetDnsForwarding", + "service": { + "short_name": "VmwareEngine", + "full_name": "google.cloud.vmwareengine.v1.VmwareEngine" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "vmwareengine_v1_generated_VmwareEngine_UpdateDnsForwarding_sync", + "title": "Snippet for the update_dns_forwarding call in the VmwareEngine service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#update_dns_forwarding.", + "file": "vmware_engine/update_dns_forwarding.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_dns_forwarding", + "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#update_dns_forwarding", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VmwareEngine::V1::UpdateDnsForwardingRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "VmwareEngine::Client", + "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client" + }, + "method": { + "short_name": "UpdateDnsForwarding", + "full_name": "google.cloud.vmwareengine.v1.VmwareEngine.UpdateDnsForwarding", + "service": { + "short_name": "VmwareEngine", + "full_name": "google.cloud.vmwareengine.v1.VmwareEngine" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "vmwareengine_v1_generated_VmwareEngine_GetNetworkPeering_sync", + "title": "Snippet for the get_network_peering call in the VmwareEngine service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#get_network_peering.", + "file": "vmware_engine/get_network_peering.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_network_peering", + "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#get_network_peering", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VmwareEngine::V1::GetNetworkPeeringRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::VmwareEngine::V1::NetworkPeering", + "client": { + "short_name": "VmwareEngine::Client", + "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client" + }, + "method": { + "short_name": "GetNetworkPeering", + "full_name": "google.cloud.vmwareengine.v1.VmwareEngine.GetNetworkPeering", + "service": { + "short_name": "VmwareEngine", + "full_name": "google.cloud.vmwareengine.v1.VmwareEngine" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "vmwareengine_v1_generated_VmwareEngine_ListNetworkPeerings_sync", + "title": "Snippet for the list_network_peerings call in the VmwareEngine service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#list_network_peerings.", + "file": "vmware_engine/list_network_peerings.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_network_peerings", + "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#list_network_peerings", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VmwareEngine::V1::ListNetworkPeeringsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::VmwareEngine::V1::ListNetworkPeeringsResponse", + "client": { + "short_name": "VmwareEngine::Client", + "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client" + }, + "method": { + "short_name": "ListNetworkPeerings", + "full_name": "google.cloud.vmwareengine.v1.VmwareEngine.ListNetworkPeerings", + "service": { + "short_name": "VmwareEngine", + "full_name": "google.cloud.vmwareengine.v1.VmwareEngine" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "vmwareengine_v1_generated_VmwareEngine_CreateNetworkPeering_sync", + "title": "Snippet for the create_network_peering call in the VmwareEngine service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#create_network_peering.", + "file": "vmware_engine/create_network_peering.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_network_peering", + "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#create_network_peering", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VmwareEngine::V1::CreateNetworkPeeringRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "VmwareEngine::Client", + "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client" + }, + "method": { + "short_name": "CreateNetworkPeering", + "full_name": "google.cloud.vmwareengine.v1.VmwareEngine.CreateNetworkPeering", + "service": { + "short_name": "VmwareEngine", + "full_name": "google.cloud.vmwareengine.v1.VmwareEngine" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "vmwareengine_v1_generated_VmwareEngine_DeleteNetworkPeering_sync", + "title": "Snippet for the delete_network_peering call in the VmwareEngine service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#delete_network_peering.", + "file": "vmware_engine/delete_network_peering.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_network_peering", + "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#delete_network_peering", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VmwareEngine::V1::DeleteNetworkPeeringRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "VmwareEngine::Client", + "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client" + }, + "method": { + "short_name": "DeleteNetworkPeering", + "full_name": "google.cloud.vmwareengine.v1.VmwareEngine.DeleteNetworkPeering", + "service": { + "short_name": "VmwareEngine", + "full_name": "google.cloud.vmwareengine.v1.VmwareEngine" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "vmwareengine_v1_generated_VmwareEngine_UpdateNetworkPeering_sync", + "title": "Snippet for the update_network_peering call in the VmwareEngine service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#update_network_peering.", + "file": "vmware_engine/update_network_peering.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_network_peering", + "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#update_network_peering", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VmwareEngine::V1::UpdateNetworkPeeringRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "VmwareEngine::Client", + "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client" + }, + "method": { + "short_name": "UpdateNetworkPeering", + "full_name": "google.cloud.vmwareengine.v1.VmwareEngine.UpdateNetworkPeering", + "service": { + "short_name": "VmwareEngine", + "full_name": "google.cloud.vmwareengine.v1.VmwareEngine" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "vmwareengine_v1_generated_VmwareEngine_ListPeeringRoutes_sync", + "title": "Snippet for the list_peering_routes call in the VmwareEngine service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#list_peering_routes.", + "file": "vmware_engine/list_peering_routes.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_peering_routes", + "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#list_peering_routes", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VmwareEngine::V1::ListPeeringRoutesRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::VmwareEngine::V1::ListPeeringRoutesResponse", + "client": { + "short_name": "VmwareEngine::Client", + "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client" + }, + "method": { + "short_name": "ListPeeringRoutes", + "full_name": "google.cloud.vmwareengine.v1.VmwareEngine.ListPeeringRoutes", + "service": { + "short_name": "VmwareEngine", + "full_name": "google.cloud.vmwareengine.v1.VmwareEngine" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "vmwareengine_v1_generated_VmwareEngine_CreateHcxActivationKey_sync", + "title": "Snippet for the create_hcx_activation_key call in the VmwareEngine service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#create_hcx_activation_key.", + "file": "vmware_engine/create_hcx_activation_key.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_hcx_activation_key", + "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#create_hcx_activation_key", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VmwareEngine::V1::CreateHcxActivationKeyRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "VmwareEngine::Client", + "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client" + }, + "method": { + "short_name": "CreateHcxActivationKey", + "full_name": "google.cloud.vmwareengine.v1.VmwareEngine.CreateHcxActivationKey", + "service": { + "short_name": "VmwareEngine", + "full_name": "google.cloud.vmwareengine.v1.VmwareEngine" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "vmwareengine_v1_generated_VmwareEngine_ListHcxActivationKeys_sync", + "title": "Snippet for the list_hcx_activation_keys call in the VmwareEngine service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#list_hcx_activation_keys.", + "file": "vmware_engine/list_hcx_activation_keys.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_hcx_activation_keys", + "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#list_hcx_activation_keys", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VmwareEngine::V1::ListHcxActivationKeysRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::VmwareEngine::V1::ListHcxActivationKeysResponse", + "client": { + "short_name": "VmwareEngine::Client", + "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client" + }, + "method": { + "short_name": "ListHcxActivationKeys", + "full_name": "google.cloud.vmwareengine.v1.VmwareEngine.ListHcxActivationKeys", + "service": { + "short_name": "VmwareEngine", + "full_name": "google.cloud.vmwareengine.v1.VmwareEngine" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "vmwareengine_v1_generated_VmwareEngine_GetHcxActivationKey_sync", + "title": "Snippet for the get_hcx_activation_key call in the VmwareEngine service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#get_hcx_activation_key.", + "file": "vmware_engine/get_hcx_activation_key.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_hcx_activation_key", + "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#get_hcx_activation_key", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VmwareEngine::V1::GetHcxActivationKeyRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::VmwareEngine::V1::HcxActivationKey", + "client": { + "short_name": "VmwareEngine::Client", + "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client" + }, + "method": { + "short_name": "GetHcxActivationKey", + "full_name": "google.cloud.vmwareengine.v1.VmwareEngine.GetHcxActivationKey", + "service": { + "short_name": "VmwareEngine", + "full_name": "google.cloud.vmwareengine.v1.VmwareEngine" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "vmwareengine_v1_generated_VmwareEngine_GetNetworkPolicy_sync", + "title": "Snippet for the get_network_policy call in the VmwareEngine service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#get_network_policy.", + "file": "vmware_engine/get_network_policy.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_network_policy", + "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#get_network_policy", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VmwareEngine::V1::GetNetworkPolicyRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::VmwareEngine::V1::NetworkPolicy", + "client": { + "short_name": "VmwareEngine::Client", + "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client" + }, + "method": { + "short_name": "GetNetworkPolicy", + "full_name": "google.cloud.vmwareengine.v1.VmwareEngine.GetNetworkPolicy", + "service": { + "short_name": "VmwareEngine", + "full_name": "google.cloud.vmwareengine.v1.VmwareEngine" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "vmwareengine_v1_generated_VmwareEngine_ListNetworkPolicies_sync", + "title": "Snippet for the list_network_policies call in the VmwareEngine service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#list_network_policies.", + "file": "vmware_engine/list_network_policies.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_network_policies", + "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#list_network_policies", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VmwareEngine::V1::ListNetworkPoliciesRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::VmwareEngine::V1::ListNetworkPoliciesResponse", + "client": { + "short_name": "VmwareEngine::Client", + "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client" + }, + "method": { + "short_name": "ListNetworkPolicies", + "full_name": "google.cloud.vmwareengine.v1.VmwareEngine.ListNetworkPolicies", + "service": { + "short_name": "VmwareEngine", + "full_name": "google.cloud.vmwareengine.v1.VmwareEngine" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "vmwareengine_v1_generated_VmwareEngine_CreateNetworkPolicy_sync", + "title": "Snippet for the create_network_policy call in the VmwareEngine service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#create_network_policy.", + "file": "vmware_engine/create_network_policy.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_network_policy", + "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#create_network_policy", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VmwareEngine::V1::CreateNetworkPolicyRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "VmwareEngine::Client", + "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client" + }, + "method": { + "short_name": "CreateNetworkPolicy", + "full_name": "google.cloud.vmwareengine.v1.VmwareEngine.CreateNetworkPolicy", + "service": { + "short_name": "VmwareEngine", + "full_name": "google.cloud.vmwareengine.v1.VmwareEngine" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "vmwareengine_v1_generated_VmwareEngine_UpdateNetworkPolicy_sync", + "title": "Snippet for the update_network_policy call in the VmwareEngine service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#update_network_policy.", + "file": "vmware_engine/update_network_policy.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_network_policy", + "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#update_network_policy", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VmwareEngine::V1::UpdateNetworkPolicyRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "VmwareEngine::Client", + "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client" + }, + "method": { + "short_name": "UpdateNetworkPolicy", + "full_name": "google.cloud.vmwareengine.v1.VmwareEngine.UpdateNetworkPolicy", + "service": { + "short_name": "VmwareEngine", + "full_name": "google.cloud.vmwareengine.v1.VmwareEngine" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "vmwareengine_v1_generated_VmwareEngine_DeleteNetworkPolicy_sync", + "title": "Snippet for the delete_network_policy call in the VmwareEngine service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#delete_network_policy.", + "file": "vmware_engine/delete_network_policy.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_network_policy", + "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#delete_network_policy", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VmwareEngine::V1::DeleteNetworkPolicyRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "VmwareEngine::Client", + "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client" + }, + "method": { + "short_name": "DeleteNetworkPolicy", + "full_name": "google.cloud.vmwareengine.v1.VmwareEngine.DeleteNetworkPolicy", + "service": { + "short_name": "VmwareEngine", + "full_name": "google.cloud.vmwareengine.v1.VmwareEngine" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "vmwareengine_v1_generated_VmwareEngine_ListManagementDnsZoneBindings_sync", + "title": "Snippet for the list_management_dns_zone_bindings call in the VmwareEngine service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#list_management_dns_zone_bindings.", + "file": "vmware_engine/list_management_dns_zone_bindings.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_management_dns_zone_bindings", + "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#list_management_dns_zone_bindings", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VmwareEngine::V1::ListManagementDnsZoneBindingsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::VmwareEngine::V1::ListManagementDnsZoneBindingsResponse", + "client": { + "short_name": "VmwareEngine::Client", + "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client" + }, + "method": { + "short_name": "ListManagementDnsZoneBindings", + "full_name": "google.cloud.vmwareengine.v1.VmwareEngine.ListManagementDnsZoneBindings", + "service": { + "short_name": "VmwareEngine", + "full_name": "google.cloud.vmwareengine.v1.VmwareEngine" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "vmwareengine_v1_generated_VmwareEngine_GetManagementDnsZoneBinding_sync", + "title": "Snippet for the get_management_dns_zone_binding call in the VmwareEngine service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#get_management_dns_zone_binding.", + "file": "vmware_engine/get_management_dns_zone_binding.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_management_dns_zone_binding", + "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#get_management_dns_zone_binding", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VmwareEngine::V1::GetManagementDnsZoneBindingRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::VmwareEngine::V1::ManagementDnsZoneBinding", + "client": { + "short_name": "VmwareEngine::Client", + "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client" + }, + "method": { + "short_name": "GetManagementDnsZoneBinding", + "full_name": "google.cloud.vmwareengine.v1.VmwareEngine.GetManagementDnsZoneBinding", + "service": { + "short_name": "VmwareEngine", + "full_name": "google.cloud.vmwareengine.v1.VmwareEngine" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "vmwareengine_v1_generated_VmwareEngine_CreateManagementDnsZoneBinding_sync", + "title": "Snippet for the create_management_dns_zone_binding call in the VmwareEngine service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#create_management_dns_zone_binding.", + "file": "vmware_engine/create_management_dns_zone_binding.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_management_dns_zone_binding", + "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#create_management_dns_zone_binding", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VmwareEngine::V1::CreateManagementDnsZoneBindingRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "VmwareEngine::Client", + "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client" + }, + "method": { + "short_name": "CreateManagementDnsZoneBinding", + "full_name": "google.cloud.vmwareengine.v1.VmwareEngine.CreateManagementDnsZoneBinding", + "service": { + "short_name": "VmwareEngine", + "full_name": "google.cloud.vmwareengine.v1.VmwareEngine" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "vmwareengine_v1_generated_VmwareEngine_UpdateManagementDnsZoneBinding_sync", + "title": "Snippet for the update_management_dns_zone_binding call in the VmwareEngine service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#update_management_dns_zone_binding.", + "file": "vmware_engine/update_management_dns_zone_binding.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_management_dns_zone_binding", + "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#update_management_dns_zone_binding", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VmwareEngine::V1::UpdateManagementDnsZoneBindingRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "VmwareEngine::Client", + "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client" + }, + "method": { + "short_name": "UpdateManagementDnsZoneBinding", + "full_name": "google.cloud.vmwareengine.v1.VmwareEngine.UpdateManagementDnsZoneBinding", + "service": { + "short_name": "VmwareEngine", + "full_name": "google.cloud.vmwareengine.v1.VmwareEngine" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "vmwareengine_v1_generated_VmwareEngine_DeleteManagementDnsZoneBinding_sync", + "title": "Snippet for the delete_management_dns_zone_binding call in the VmwareEngine service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#delete_management_dns_zone_binding.", + "file": "vmware_engine/delete_management_dns_zone_binding.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_management_dns_zone_binding", + "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#delete_management_dns_zone_binding", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VmwareEngine::V1::DeleteManagementDnsZoneBindingRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "VmwareEngine::Client", + "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client" + }, + "method": { + "short_name": "DeleteManagementDnsZoneBinding", + "full_name": "google.cloud.vmwareengine.v1.VmwareEngine.DeleteManagementDnsZoneBinding", + "service": { + "short_name": "VmwareEngine", + "full_name": "google.cloud.vmwareengine.v1.VmwareEngine" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "vmwareengine_v1_generated_VmwareEngine_RepairManagementDnsZoneBinding_sync", + "title": "Snippet for the repair_management_dns_zone_binding call in the VmwareEngine service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#repair_management_dns_zone_binding.", + "file": "vmware_engine/repair_management_dns_zone_binding.rb", + "language": "RUBY", + "client_method": { + "short_name": "repair_management_dns_zone_binding", + "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#repair_management_dns_zone_binding", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VmwareEngine::V1::RepairManagementDnsZoneBindingRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "VmwareEngine::Client", + "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client" + }, + "method": { + "short_name": "RepairManagementDnsZoneBinding", + "full_name": "google.cloud.vmwareengine.v1.VmwareEngine.RepairManagementDnsZoneBinding", + "service": { + "short_name": "VmwareEngine", + "full_name": "google.cloud.vmwareengine.v1.VmwareEngine" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "vmwareengine_v1_generated_VmwareEngine_CreateVmwareEngineNetwork_sync", + "title": "Snippet for the create_vmware_engine_network call in the VmwareEngine service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#create_vmware_engine_network.", + "file": "vmware_engine/create_vmware_engine_network.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_vmware_engine_network", + "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#create_vmware_engine_network", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VmwareEngine::V1::CreateVmwareEngineNetworkRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "VmwareEngine::Client", + "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client" + }, + "method": { + "short_name": "CreateVmwareEngineNetwork", + "full_name": "google.cloud.vmwareengine.v1.VmwareEngine.CreateVmwareEngineNetwork", + "service": { + "short_name": "VmwareEngine", + "full_name": "google.cloud.vmwareengine.v1.VmwareEngine" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "vmwareengine_v1_generated_VmwareEngine_UpdateVmwareEngineNetwork_sync", + "title": "Snippet for the update_vmware_engine_network call in the VmwareEngine service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#update_vmware_engine_network.", + "file": "vmware_engine/update_vmware_engine_network.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_vmware_engine_network", + "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#update_vmware_engine_network", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VmwareEngine::V1::UpdateVmwareEngineNetworkRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "VmwareEngine::Client", + "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client" + }, + "method": { + "short_name": "UpdateVmwareEngineNetwork", + "full_name": "google.cloud.vmwareengine.v1.VmwareEngine.UpdateVmwareEngineNetwork", + "service": { + "short_name": "VmwareEngine", + "full_name": "google.cloud.vmwareengine.v1.VmwareEngine" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "vmwareengine_v1_generated_VmwareEngine_DeleteVmwareEngineNetwork_sync", + "title": "Snippet for the delete_vmware_engine_network call in the VmwareEngine service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#delete_vmware_engine_network.", + "file": "vmware_engine/delete_vmware_engine_network.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_vmware_engine_network", + "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#delete_vmware_engine_network", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VmwareEngine::V1::DeleteVmwareEngineNetworkRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "VmwareEngine::Client", + "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client" + }, + "method": { + "short_name": "DeleteVmwareEngineNetwork", + "full_name": "google.cloud.vmwareengine.v1.VmwareEngine.DeleteVmwareEngineNetwork", + "service": { + "short_name": "VmwareEngine", + "full_name": "google.cloud.vmwareengine.v1.VmwareEngine" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "vmwareengine_v1_generated_VmwareEngine_GetVmwareEngineNetwork_sync", + "title": "Snippet for the get_vmware_engine_network call in the VmwareEngine service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#get_vmware_engine_network.", + "file": "vmware_engine/get_vmware_engine_network.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_vmware_engine_network", + "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#get_vmware_engine_network", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VmwareEngine::V1::GetVmwareEngineNetworkRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::VmwareEngine::V1::VmwareEngineNetwork", + "client": { + "short_name": "VmwareEngine::Client", + "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client" + }, + "method": { + "short_name": "GetVmwareEngineNetwork", + "full_name": "google.cloud.vmwareengine.v1.VmwareEngine.GetVmwareEngineNetwork", + "service": { + "short_name": "VmwareEngine", + "full_name": "google.cloud.vmwareengine.v1.VmwareEngine" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "vmwareengine_v1_generated_VmwareEngine_ListVmwareEngineNetworks_sync", + "title": "Snippet for the list_vmware_engine_networks call in the VmwareEngine service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#list_vmware_engine_networks.", + "file": "vmware_engine/list_vmware_engine_networks.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_vmware_engine_networks", + "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#list_vmware_engine_networks", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VmwareEngine::V1::ListVmwareEngineNetworksRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::VmwareEngine::V1::ListVmwareEngineNetworksResponse", + "client": { + "short_name": "VmwareEngine::Client", + "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client" + }, + "method": { + "short_name": "ListVmwareEngineNetworks", + "full_name": "google.cloud.vmwareengine.v1.VmwareEngine.ListVmwareEngineNetworks", + "service": { + "short_name": "VmwareEngine", + "full_name": "google.cloud.vmwareengine.v1.VmwareEngine" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "vmwareengine_v1_generated_VmwareEngine_CreatePrivateConnection_sync", + "title": "Snippet for the create_private_connection call in the VmwareEngine service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#create_private_connection.", + "file": "vmware_engine/create_private_connection.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_private_connection", + "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#create_private_connection", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VmwareEngine::V1::CreatePrivateConnectionRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "VmwareEngine::Client", + "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client" + }, + "method": { + "short_name": "CreatePrivateConnection", + "full_name": "google.cloud.vmwareengine.v1.VmwareEngine.CreatePrivateConnection", + "service": { + "short_name": "VmwareEngine", + "full_name": "google.cloud.vmwareengine.v1.VmwareEngine" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "vmwareengine_v1_generated_VmwareEngine_GetPrivateConnection_sync", + "title": "Snippet for the get_private_connection call in the VmwareEngine service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#get_private_connection.", + "file": "vmware_engine/get_private_connection.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_private_connection", + "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#get_private_connection", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VmwareEngine::V1::GetPrivateConnectionRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::VmwareEngine::V1::PrivateConnection", + "client": { + "short_name": "VmwareEngine::Client", + "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client" + }, + "method": { + "short_name": "GetPrivateConnection", + "full_name": "google.cloud.vmwareengine.v1.VmwareEngine.GetPrivateConnection", + "service": { + "short_name": "VmwareEngine", + "full_name": "google.cloud.vmwareengine.v1.VmwareEngine" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "vmwareengine_v1_generated_VmwareEngine_ListPrivateConnections_sync", + "title": "Snippet for the list_private_connections call in the VmwareEngine service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#list_private_connections.", + "file": "vmware_engine/list_private_connections.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_private_connections", + "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#list_private_connections", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VmwareEngine::V1::ListPrivateConnectionsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::VmwareEngine::V1::ListPrivateConnectionsResponse", + "client": { + "short_name": "VmwareEngine::Client", + "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client" + }, + "method": { + "short_name": "ListPrivateConnections", + "full_name": "google.cloud.vmwareengine.v1.VmwareEngine.ListPrivateConnections", + "service": { + "short_name": "VmwareEngine", + "full_name": "google.cloud.vmwareengine.v1.VmwareEngine" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "vmwareengine_v1_generated_VmwareEngine_UpdatePrivateConnection_sync", + "title": "Snippet for the update_private_connection call in the VmwareEngine service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#update_private_connection.", + "file": "vmware_engine/update_private_connection.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_private_connection", + "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#update_private_connection", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VmwareEngine::V1::UpdatePrivateConnectionRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "VmwareEngine::Client", + "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client" + }, + "method": { + "short_name": "UpdatePrivateConnection", + "full_name": "google.cloud.vmwareengine.v1.VmwareEngine.UpdatePrivateConnection", + "service": { + "short_name": "VmwareEngine", + "full_name": "google.cloud.vmwareengine.v1.VmwareEngine" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "vmwareengine_v1_generated_VmwareEngine_DeletePrivateConnection_sync", + "title": "Snippet for the delete_private_connection call in the VmwareEngine service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#delete_private_connection.", + "file": "vmware_engine/delete_private_connection.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_private_connection", + "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#delete_private_connection", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VmwareEngine::V1::DeletePrivateConnectionRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "VmwareEngine::Client", + "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client" + }, + "method": { + "short_name": "DeletePrivateConnection", + "full_name": "google.cloud.vmwareengine.v1.VmwareEngine.DeletePrivateConnection", + "service": { + "short_name": "VmwareEngine", + "full_name": "google.cloud.vmwareengine.v1.VmwareEngine" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "vmwareengine_v1_generated_VmwareEngine_ListPrivateConnectionPeeringRoutes_sync", + "title": "Snippet for the list_private_connection_peering_routes call in the VmwareEngine service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#list_private_connection_peering_routes.", + "file": "vmware_engine/list_private_connection_peering_routes.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_private_connection_peering_routes", + "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#list_private_connection_peering_routes", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VmwareEngine::V1::ListPrivateConnectionPeeringRoutesRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::VmwareEngine::V1::ListPrivateConnectionPeeringRoutesResponse", + "client": { + "short_name": "VmwareEngine::Client", + "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client" + }, + "method": { + "short_name": "ListPrivateConnectionPeeringRoutes", + "full_name": "google.cloud.vmwareengine.v1.VmwareEngine.ListPrivateConnectionPeeringRoutes", + "service": { + "short_name": "VmwareEngine", + "full_name": "google.cloud.vmwareengine.v1.VmwareEngine" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "vmwareengine_v1_generated_VmwareEngine_GrantDnsBindPermission_sync", + "title": "Snippet for the grant_dns_bind_permission call in the VmwareEngine service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#grant_dns_bind_permission.", + "file": "vmware_engine/grant_dns_bind_permission.rb", + "language": "RUBY", + "client_method": { + "short_name": "grant_dns_bind_permission", + "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#grant_dns_bind_permission", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VmwareEngine::V1::GrantDnsBindPermissionRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "VmwareEngine::Client", + "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client" + }, + "method": { + "short_name": "GrantDnsBindPermission", + "full_name": "google.cloud.vmwareengine.v1.VmwareEngine.GrantDnsBindPermission", + "service": { + "short_name": "VmwareEngine", + "full_name": "google.cloud.vmwareengine.v1.VmwareEngine" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "vmwareengine_v1_generated_VmwareEngine_GetDnsBindPermission_sync", + "title": "Snippet for the get_dns_bind_permission call in the VmwareEngine service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#get_dns_bind_permission.", + "file": "vmware_engine/get_dns_bind_permission.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_dns_bind_permission", + "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#get_dns_bind_permission", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VmwareEngine::V1::GetDnsBindPermissionRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::VmwareEngine::V1::DnsBindPermission", + "client": { + "short_name": "VmwareEngine::Client", + "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client" + }, + "method": { + "short_name": "GetDnsBindPermission", + "full_name": "google.cloud.vmwareengine.v1.VmwareEngine.GetDnsBindPermission", + "service": { + "short_name": "VmwareEngine", + "full_name": "google.cloud.vmwareengine.v1.VmwareEngine" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "vmwareengine_v1_generated_VmwareEngine_RevokeDnsBindPermission_sync", + "title": "Snippet for the revoke_dns_bind_permission call in the VmwareEngine service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#revoke_dns_bind_permission.", + "file": "vmware_engine/revoke_dns_bind_permission.rb", + "language": "RUBY", + "client_method": { + "short_name": "revoke_dns_bind_permission", + "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#revoke_dns_bind_permission", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VmwareEngine::V1::RevokeDnsBindPermissionRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "VmwareEngine::Client", + "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client" + }, + "method": { + "short_name": "RevokeDnsBindPermission", + "full_name": "google.cloud.vmwareengine.v1.VmwareEngine.RevokeDnsBindPermission", + "service": { + "short_name": "VmwareEngine", + "full_name": "google.cloud.vmwareengine.v1.VmwareEngine" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + } + ] +} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/create_cluster.rb b/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/create_cluster.rb new file mode 100644 index 000000000000..c1d3b448c05c --- /dev/null +++ b/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/create_cluster.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 vmwareengine_v1_generated_VmwareEngine_CreateCluster_sync] +require "google/cloud/vmware_engine/v1" + +## +# Snippet for the create_cluster call in the VmwareEngine 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::VmwareEngine::V1::VmwareEngine::Client#create_cluster. +# +def create_cluster + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VmwareEngine::V1::CreateClusterRequest.new + + # Call the create_cluster method. + result = client.create_cluster 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 vmwareengine_v1_generated_VmwareEngine_CreateCluster_sync] diff --git a/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/create_external_access_rule.rb b/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/create_external_access_rule.rb new file mode 100644 index 000000000000..8ee5aac97ef9 --- /dev/null +++ b/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/create_external_access_rule.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 vmwareengine_v1_generated_VmwareEngine_CreateExternalAccessRule_sync] +require "google/cloud/vmware_engine/v1" + +## +# Snippet for the create_external_access_rule call in the VmwareEngine 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::VmwareEngine::V1::VmwareEngine::Client#create_external_access_rule. +# +def create_external_access_rule + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VmwareEngine::V1::CreateExternalAccessRuleRequest.new + + # Call the create_external_access_rule method. + result = client.create_external_access_rule 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 vmwareengine_v1_generated_VmwareEngine_CreateExternalAccessRule_sync] diff --git a/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/create_external_address.rb b/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/create_external_address.rb new file mode 100644 index 000000000000..40b8e4135dff --- /dev/null +++ b/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/create_external_address.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 vmwareengine_v1_generated_VmwareEngine_CreateExternalAddress_sync] +require "google/cloud/vmware_engine/v1" + +## +# Snippet for the create_external_address call in the VmwareEngine 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::VmwareEngine::V1::VmwareEngine::Client#create_external_address. +# +def create_external_address + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VmwareEngine::V1::CreateExternalAddressRequest.new + + # Call the create_external_address method. + result = client.create_external_address 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 vmwareengine_v1_generated_VmwareEngine_CreateExternalAddress_sync] diff --git a/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/create_hcx_activation_key.rb b/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/create_hcx_activation_key.rb new file mode 100644 index 000000000000..ccfa0e7407e3 --- /dev/null +++ b/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/create_hcx_activation_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 vmwareengine_v1_generated_VmwareEngine_CreateHcxActivationKey_sync] +require "google/cloud/vmware_engine/v1" + +## +# Snippet for the create_hcx_activation_key call in the VmwareEngine 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::VmwareEngine::V1::VmwareEngine::Client#create_hcx_activation_key. +# +def create_hcx_activation_key + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VmwareEngine::V1::CreateHcxActivationKeyRequest.new + + # Call the create_hcx_activation_key method. + result = client.create_hcx_activation_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 vmwareengine_v1_generated_VmwareEngine_CreateHcxActivationKey_sync] diff --git a/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/create_logging_server.rb b/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/create_logging_server.rb new file mode 100644 index 000000000000..6f0b22a73980 --- /dev/null +++ b/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/create_logging_server.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 vmwareengine_v1_generated_VmwareEngine_CreateLoggingServer_sync] +require "google/cloud/vmware_engine/v1" + +## +# Snippet for the create_logging_server call in the VmwareEngine 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::VmwareEngine::V1::VmwareEngine::Client#create_logging_server. +# +def create_logging_server + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VmwareEngine::V1::CreateLoggingServerRequest.new + + # Call the create_logging_server method. + result = client.create_logging_server 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 vmwareengine_v1_generated_VmwareEngine_CreateLoggingServer_sync] diff --git a/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/create_management_dns_zone_binding.rb b/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/create_management_dns_zone_binding.rb new file mode 100644 index 000000000000..705320379d75 --- /dev/null +++ b/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/create_management_dns_zone_binding.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 vmwareengine_v1_generated_VmwareEngine_CreateManagementDnsZoneBinding_sync] +require "google/cloud/vmware_engine/v1" + +## +# Snippet for the create_management_dns_zone_binding call in the VmwareEngine 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::VmwareEngine::V1::VmwareEngine::Client#create_management_dns_zone_binding. +# +def create_management_dns_zone_binding + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VmwareEngine::V1::CreateManagementDnsZoneBindingRequest.new + + # Call the create_management_dns_zone_binding method. + result = client.create_management_dns_zone_binding 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 vmwareengine_v1_generated_VmwareEngine_CreateManagementDnsZoneBinding_sync] diff --git a/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/create_network_peering.rb b/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/create_network_peering.rb new file mode 100644 index 000000000000..7547d9392753 --- /dev/null +++ b/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/create_network_peering.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 vmwareengine_v1_generated_VmwareEngine_CreateNetworkPeering_sync] +require "google/cloud/vmware_engine/v1" + +## +# Snippet for the create_network_peering call in the VmwareEngine 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::VmwareEngine::V1::VmwareEngine::Client#create_network_peering. +# +def create_network_peering + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VmwareEngine::V1::CreateNetworkPeeringRequest.new + + # Call the create_network_peering method. + result = client.create_network_peering 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 vmwareengine_v1_generated_VmwareEngine_CreateNetworkPeering_sync] diff --git a/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/create_network_policy.rb b/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/create_network_policy.rb new file mode 100644 index 000000000000..86f1818e50be --- /dev/null +++ b/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/create_network_policy.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 vmwareengine_v1_generated_VmwareEngine_CreateNetworkPolicy_sync] +require "google/cloud/vmware_engine/v1" + +## +# Snippet for the create_network_policy call in the VmwareEngine 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::VmwareEngine::V1::VmwareEngine::Client#create_network_policy. +# +def create_network_policy + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VmwareEngine::V1::CreateNetworkPolicyRequest.new + + # Call the create_network_policy method. + result = client.create_network_policy 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 vmwareengine_v1_generated_VmwareEngine_CreateNetworkPolicy_sync] diff --git a/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/create_private_cloud.rb b/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/create_private_cloud.rb new file mode 100644 index 000000000000..894c286acc03 --- /dev/null +++ b/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/create_private_cloud.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 vmwareengine_v1_generated_VmwareEngine_CreatePrivateCloud_sync] +require "google/cloud/vmware_engine/v1" + +## +# Snippet for the create_private_cloud call in the VmwareEngine 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::VmwareEngine::V1::VmwareEngine::Client#create_private_cloud. +# +def create_private_cloud + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VmwareEngine::V1::CreatePrivateCloudRequest.new + + # Call the create_private_cloud method. + result = client.create_private_cloud 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 vmwareengine_v1_generated_VmwareEngine_CreatePrivateCloud_sync] diff --git a/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/create_private_connection.rb b/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/create_private_connection.rb new file mode 100644 index 000000000000..9d5ce8c5422b --- /dev/null +++ b/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/create_private_connection.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 vmwareengine_v1_generated_VmwareEngine_CreatePrivateConnection_sync] +require "google/cloud/vmware_engine/v1" + +## +# Snippet for the create_private_connection call in the VmwareEngine 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::VmwareEngine::V1::VmwareEngine::Client#create_private_connection. +# +def create_private_connection + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VmwareEngine::V1::CreatePrivateConnectionRequest.new + + # Call the create_private_connection method. + result = client.create_private_connection 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 vmwareengine_v1_generated_VmwareEngine_CreatePrivateConnection_sync] diff --git a/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/create_vmware_engine_network.rb b/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/create_vmware_engine_network.rb new file mode 100644 index 000000000000..c1866d22fd37 --- /dev/null +++ b/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/create_vmware_engine_network.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 vmwareengine_v1_generated_VmwareEngine_CreateVmwareEngineNetwork_sync] +require "google/cloud/vmware_engine/v1" + +## +# Snippet for the create_vmware_engine_network call in the VmwareEngine 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::VmwareEngine::V1::VmwareEngine::Client#create_vmware_engine_network. +# +def create_vmware_engine_network + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VmwareEngine::V1::CreateVmwareEngineNetworkRequest.new + + # Call the create_vmware_engine_network method. + result = client.create_vmware_engine_network 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 vmwareengine_v1_generated_VmwareEngine_CreateVmwareEngineNetwork_sync] diff --git a/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/delete_cluster.rb b/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/delete_cluster.rb new file mode 100644 index 000000000000..1e33f442bf74 --- /dev/null +++ b/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/delete_cluster.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 vmwareengine_v1_generated_VmwareEngine_DeleteCluster_sync] +require "google/cloud/vmware_engine/v1" + +## +# Snippet for the delete_cluster call in the VmwareEngine 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::VmwareEngine::V1::VmwareEngine::Client#delete_cluster. +# +def delete_cluster + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VmwareEngine::V1::DeleteClusterRequest.new + + # Call the delete_cluster method. + result = client.delete_cluster 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 vmwareengine_v1_generated_VmwareEngine_DeleteCluster_sync] diff --git a/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/delete_external_access_rule.rb b/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/delete_external_access_rule.rb new file mode 100644 index 000000000000..0dfb467dae50 --- /dev/null +++ b/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/delete_external_access_rule.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 vmwareengine_v1_generated_VmwareEngine_DeleteExternalAccessRule_sync] +require "google/cloud/vmware_engine/v1" + +## +# Snippet for the delete_external_access_rule call in the VmwareEngine 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::VmwareEngine::V1::VmwareEngine::Client#delete_external_access_rule. +# +def delete_external_access_rule + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VmwareEngine::V1::DeleteExternalAccessRuleRequest.new + + # Call the delete_external_access_rule method. + result = client.delete_external_access_rule 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 vmwareengine_v1_generated_VmwareEngine_DeleteExternalAccessRule_sync] diff --git a/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/delete_external_address.rb b/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/delete_external_address.rb new file mode 100644 index 000000000000..502564662bc7 --- /dev/null +++ b/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/delete_external_address.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 vmwareengine_v1_generated_VmwareEngine_DeleteExternalAddress_sync] +require "google/cloud/vmware_engine/v1" + +## +# Snippet for the delete_external_address call in the VmwareEngine 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::VmwareEngine::V1::VmwareEngine::Client#delete_external_address. +# +def delete_external_address + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VmwareEngine::V1::DeleteExternalAddressRequest.new + + # Call the delete_external_address method. + result = client.delete_external_address 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 vmwareengine_v1_generated_VmwareEngine_DeleteExternalAddress_sync] diff --git a/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/delete_logging_server.rb b/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/delete_logging_server.rb new file mode 100644 index 000000000000..08a25d05493c --- /dev/null +++ b/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/delete_logging_server.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 vmwareengine_v1_generated_VmwareEngine_DeleteLoggingServer_sync] +require "google/cloud/vmware_engine/v1" + +## +# Snippet for the delete_logging_server call in the VmwareEngine 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::VmwareEngine::V1::VmwareEngine::Client#delete_logging_server. +# +def delete_logging_server + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VmwareEngine::V1::DeleteLoggingServerRequest.new + + # Call the delete_logging_server method. + result = client.delete_logging_server 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 vmwareengine_v1_generated_VmwareEngine_DeleteLoggingServer_sync] diff --git a/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/delete_management_dns_zone_binding.rb b/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/delete_management_dns_zone_binding.rb new file mode 100644 index 000000000000..2a8869d82c59 --- /dev/null +++ b/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/delete_management_dns_zone_binding.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 vmwareengine_v1_generated_VmwareEngine_DeleteManagementDnsZoneBinding_sync] +require "google/cloud/vmware_engine/v1" + +## +# Snippet for the delete_management_dns_zone_binding call in the VmwareEngine 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::VmwareEngine::V1::VmwareEngine::Client#delete_management_dns_zone_binding. +# +def delete_management_dns_zone_binding + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VmwareEngine::V1::DeleteManagementDnsZoneBindingRequest.new + + # Call the delete_management_dns_zone_binding method. + result = client.delete_management_dns_zone_binding 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 vmwareengine_v1_generated_VmwareEngine_DeleteManagementDnsZoneBinding_sync] diff --git a/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/delete_network_peering.rb b/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/delete_network_peering.rb new file mode 100644 index 000000000000..9bbf47b03d87 --- /dev/null +++ b/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/delete_network_peering.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 vmwareengine_v1_generated_VmwareEngine_DeleteNetworkPeering_sync] +require "google/cloud/vmware_engine/v1" + +## +# Snippet for the delete_network_peering call in the VmwareEngine 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::VmwareEngine::V1::VmwareEngine::Client#delete_network_peering. +# +def delete_network_peering + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VmwareEngine::V1::DeleteNetworkPeeringRequest.new + + # Call the delete_network_peering method. + result = client.delete_network_peering 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 vmwareengine_v1_generated_VmwareEngine_DeleteNetworkPeering_sync] diff --git a/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/delete_network_policy.rb b/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/delete_network_policy.rb new file mode 100644 index 000000000000..290a6046b537 --- /dev/null +++ b/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/delete_network_policy.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 vmwareengine_v1_generated_VmwareEngine_DeleteNetworkPolicy_sync] +require "google/cloud/vmware_engine/v1" + +## +# Snippet for the delete_network_policy call in the VmwareEngine 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::VmwareEngine::V1::VmwareEngine::Client#delete_network_policy. +# +def delete_network_policy + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VmwareEngine::V1::DeleteNetworkPolicyRequest.new + + # Call the delete_network_policy method. + result = client.delete_network_policy 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 vmwareengine_v1_generated_VmwareEngine_DeleteNetworkPolicy_sync] diff --git a/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/delete_private_cloud.rb b/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/delete_private_cloud.rb new file mode 100644 index 000000000000..da468a8decca --- /dev/null +++ b/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/delete_private_cloud.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 vmwareengine_v1_generated_VmwareEngine_DeletePrivateCloud_sync] +require "google/cloud/vmware_engine/v1" + +## +# Snippet for the delete_private_cloud call in the VmwareEngine 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::VmwareEngine::V1::VmwareEngine::Client#delete_private_cloud. +# +def delete_private_cloud + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VmwareEngine::V1::DeletePrivateCloudRequest.new + + # Call the delete_private_cloud method. + result = client.delete_private_cloud 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 vmwareengine_v1_generated_VmwareEngine_DeletePrivateCloud_sync] diff --git a/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/delete_private_connection.rb b/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/delete_private_connection.rb new file mode 100644 index 000000000000..02677b314501 --- /dev/null +++ b/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/delete_private_connection.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 vmwareengine_v1_generated_VmwareEngine_DeletePrivateConnection_sync] +require "google/cloud/vmware_engine/v1" + +## +# Snippet for the delete_private_connection call in the VmwareEngine 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::VmwareEngine::V1::VmwareEngine::Client#delete_private_connection. +# +def delete_private_connection + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VmwareEngine::V1::DeletePrivateConnectionRequest.new + + # Call the delete_private_connection method. + result = client.delete_private_connection 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 vmwareengine_v1_generated_VmwareEngine_DeletePrivateConnection_sync] diff --git a/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/delete_vmware_engine_network.rb b/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/delete_vmware_engine_network.rb new file mode 100644 index 000000000000..db97d515645b --- /dev/null +++ b/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/delete_vmware_engine_network.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 vmwareengine_v1_generated_VmwareEngine_DeleteVmwareEngineNetwork_sync] +require "google/cloud/vmware_engine/v1" + +## +# Snippet for the delete_vmware_engine_network call in the VmwareEngine 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::VmwareEngine::V1::VmwareEngine::Client#delete_vmware_engine_network. +# +def delete_vmware_engine_network + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VmwareEngine::V1::DeleteVmwareEngineNetworkRequest.new + + # Call the delete_vmware_engine_network method. + result = client.delete_vmware_engine_network 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 vmwareengine_v1_generated_VmwareEngine_DeleteVmwareEngineNetwork_sync] diff --git a/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/fetch_network_policy_external_addresses.rb b/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/fetch_network_policy_external_addresses.rb new file mode 100644 index 000000000000..a684ee02bf9c --- /dev/null +++ b/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/fetch_network_policy_external_addresses.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 vmwareengine_v1_generated_VmwareEngine_FetchNetworkPolicyExternalAddresses_sync] +require "google/cloud/vmware_engine/v1" + +## +# Snippet for the fetch_network_policy_external_addresses call in the VmwareEngine 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::VmwareEngine::V1::VmwareEngine::Client#fetch_network_policy_external_addresses. +# +def fetch_network_policy_external_addresses + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VmwareEngine::V1::FetchNetworkPolicyExternalAddressesRequest.new + + # Call the fetch_network_policy_external_addresses method. + result = client.fetch_network_policy_external_addresses 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::VmwareEngine::V1::ExternalAddress. + p item + end +end +# [END vmwareengine_v1_generated_VmwareEngine_FetchNetworkPolicyExternalAddresses_sync] diff --git a/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/get_cluster.rb b/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/get_cluster.rb new file mode 100644 index 000000000000..6abc99ffb6a0 --- /dev/null +++ b/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/get_cluster.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 vmwareengine_v1_generated_VmwareEngine_GetCluster_sync] +require "google/cloud/vmware_engine/v1" + +## +# Snippet for the get_cluster call in the VmwareEngine 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::VmwareEngine::V1::VmwareEngine::Client#get_cluster. +# +def get_cluster + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VmwareEngine::V1::GetClusterRequest.new + + # Call the get_cluster method. + result = client.get_cluster request + + # The returned object is of type Google::Cloud::VmwareEngine::V1::Cluster. + p result +end +# [END vmwareengine_v1_generated_VmwareEngine_GetCluster_sync] diff --git a/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/get_dns_bind_permission.rb b/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/get_dns_bind_permission.rb new file mode 100644 index 000000000000..60679492c7dc --- /dev/null +++ b/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/get_dns_bind_permission.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 vmwareengine_v1_generated_VmwareEngine_GetDnsBindPermission_sync] +require "google/cloud/vmware_engine/v1" + +## +# Snippet for the get_dns_bind_permission call in the VmwareEngine 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::VmwareEngine::V1::VmwareEngine::Client#get_dns_bind_permission. +# +def get_dns_bind_permission + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VmwareEngine::V1::GetDnsBindPermissionRequest.new + + # Call the get_dns_bind_permission method. + result = client.get_dns_bind_permission request + + # The returned object is of type Google::Cloud::VmwareEngine::V1::DnsBindPermission. + p result +end +# [END vmwareengine_v1_generated_VmwareEngine_GetDnsBindPermission_sync] diff --git a/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/get_dns_forwarding.rb b/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/get_dns_forwarding.rb new file mode 100644 index 000000000000..1f3200ffbbfd --- /dev/null +++ b/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/get_dns_forwarding.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 vmwareengine_v1_generated_VmwareEngine_GetDnsForwarding_sync] +require "google/cloud/vmware_engine/v1" + +## +# Snippet for the get_dns_forwarding call in the VmwareEngine 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::VmwareEngine::V1::VmwareEngine::Client#get_dns_forwarding. +# +def get_dns_forwarding + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VmwareEngine::V1::GetDnsForwardingRequest.new + + # Call the get_dns_forwarding method. + result = client.get_dns_forwarding request + + # The returned object is of type Google::Cloud::VmwareEngine::V1::DnsForwarding. + p result +end +# [END vmwareengine_v1_generated_VmwareEngine_GetDnsForwarding_sync] diff --git a/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/get_external_access_rule.rb b/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/get_external_access_rule.rb new file mode 100644 index 000000000000..5c8da5284071 --- /dev/null +++ b/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/get_external_access_rule.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 vmwareengine_v1_generated_VmwareEngine_GetExternalAccessRule_sync] +require "google/cloud/vmware_engine/v1" + +## +# Snippet for the get_external_access_rule call in the VmwareEngine 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::VmwareEngine::V1::VmwareEngine::Client#get_external_access_rule. +# +def get_external_access_rule + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VmwareEngine::V1::GetExternalAccessRuleRequest.new + + # Call the get_external_access_rule method. + result = client.get_external_access_rule request + + # The returned object is of type Google::Cloud::VmwareEngine::V1::ExternalAccessRule. + p result +end +# [END vmwareengine_v1_generated_VmwareEngine_GetExternalAccessRule_sync] diff --git a/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/get_external_address.rb b/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/get_external_address.rb new file mode 100644 index 000000000000..d6a0f6b95f53 --- /dev/null +++ b/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/get_external_address.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 vmwareengine_v1_generated_VmwareEngine_GetExternalAddress_sync] +require "google/cloud/vmware_engine/v1" + +## +# Snippet for the get_external_address call in the VmwareEngine 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::VmwareEngine::V1::VmwareEngine::Client#get_external_address. +# +def get_external_address + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VmwareEngine::V1::GetExternalAddressRequest.new + + # Call the get_external_address method. + result = client.get_external_address request + + # The returned object is of type Google::Cloud::VmwareEngine::V1::ExternalAddress. + p result +end +# [END vmwareengine_v1_generated_VmwareEngine_GetExternalAddress_sync] diff --git a/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/get_hcx_activation_key.rb b/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/get_hcx_activation_key.rb new file mode 100644 index 000000000000..b10579599794 --- /dev/null +++ b/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/get_hcx_activation_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 vmwareengine_v1_generated_VmwareEngine_GetHcxActivationKey_sync] +require "google/cloud/vmware_engine/v1" + +## +# Snippet for the get_hcx_activation_key call in the VmwareEngine 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::VmwareEngine::V1::VmwareEngine::Client#get_hcx_activation_key. +# +def get_hcx_activation_key + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VmwareEngine::V1::GetHcxActivationKeyRequest.new + + # Call the get_hcx_activation_key method. + result = client.get_hcx_activation_key request + + # The returned object is of type Google::Cloud::VmwareEngine::V1::HcxActivationKey. + p result +end +# [END vmwareengine_v1_generated_VmwareEngine_GetHcxActivationKey_sync] diff --git a/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/get_logging_server.rb b/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/get_logging_server.rb new file mode 100644 index 000000000000..a7ee3f508b4d --- /dev/null +++ b/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/get_logging_server.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 vmwareengine_v1_generated_VmwareEngine_GetLoggingServer_sync] +require "google/cloud/vmware_engine/v1" + +## +# Snippet for the get_logging_server call in the VmwareEngine 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::VmwareEngine::V1::VmwareEngine::Client#get_logging_server. +# +def get_logging_server + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VmwareEngine::V1::GetLoggingServerRequest.new + + # Call the get_logging_server method. + result = client.get_logging_server request + + # The returned object is of type Google::Cloud::VmwareEngine::V1::LoggingServer. + p result +end +# [END vmwareengine_v1_generated_VmwareEngine_GetLoggingServer_sync] diff --git a/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/get_management_dns_zone_binding.rb b/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/get_management_dns_zone_binding.rb new file mode 100644 index 000000000000..6eb63dd0d81d --- /dev/null +++ b/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/get_management_dns_zone_binding.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 vmwareengine_v1_generated_VmwareEngine_GetManagementDnsZoneBinding_sync] +require "google/cloud/vmware_engine/v1" + +## +# Snippet for the get_management_dns_zone_binding call in the VmwareEngine 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::VmwareEngine::V1::VmwareEngine::Client#get_management_dns_zone_binding. +# +def get_management_dns_zone_binding + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VmwareEngine::V1::GetManagementDnsZoneBindingRequest.new + + # Call the get_management_dns_zone_binding method. + result = client.get_management_dns_zone_binding request + + # The returned object is of type Google::Cloud::VmwareEngine::V1::ManagementDnsZoneBinding. + p result +end +# [END vmwareengine_v1_generated_VmwareEngine_GetManagementDnsZoneBinding_sync] diff --git a/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/get_network_peering.rb b/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/get_network_peering.rb new file mode 100644 index 000000000000..811421641e9f --- /dev/null +++ b/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/get_network_peering.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 vmwareengine_v1_generated_VmwareEngine_GetNetworkPeering_sync] +require "google/cloud/vmware_engine/v1" + +## +# Snippet for the get_network_peering call in the VmwareEngine 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::VmwareEngine::V1::VmwareEngine::Client#get_network_peering. +# +def get_network_peering + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VmwareEngine::V1::GetNetworkPeeringRequest.new + + # Call the get_network_peering method. + result = client.get_network_peering request + + # The returned object is of type Google::Cloud::VmwareEngine::V1::NetworkPeering. + p result +end +# [END vmwareengine_v1_generated_VmwareEngine_GetNetworkPeering_sync] diff --git a/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/get_network_policy.rb b/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/get_network_policy.rb new file mode 100644 index 000000000000..72d4fcb4e2a5 --- /dev/null +++ b/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/get_network_policy.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 vmwareengine_v1_generated_VmwareEngine_GetNetworkPolicy_sync] +require "google/cloud/vmware_engine/v1" + +## +# Snippet for the get_network_policy call in the VmwareEngine 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::VmwareEngine::V1::VmwareEngine::Client#get_network_policy. +# +def get_network_policy + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VmwareEngine::V1::GetNetworkPolicyRequest.new + + # Call the get_network_policy method. + result = client.get_network_policy request + + # The returned object is of type Google::Cloud::VmwareEngine::V1::NetworkPolicy. + p result +end +# [END vmwareengine_v1_generated_VmwareEngine_GetNetworkPolicy_sync] diff --git a/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/get_node.rb b/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/get_node.rb new file mode 100644 index 000000000000..7e1f1af0378b --- /dev/null +++ b/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/get_node.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 vmwareengine_v1_generated_VmwareEngine_GetNode_sync] +require "google/cloud/vmware_engine/v1" + +## +# Snippet for the get_node call in the VmwareEngine 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::VmwareEngine::V1::VmwareEngine::Client#get_node. +# +def get_node + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VmwareEngine::V1::GetNodeRequest.new + + # Call the get_node method. + result = client.get_node request + + # The returned object is of type Google::Cloud::VmwareEngine::V1::Node. + p result +end +# [END vmwareengine_v1_generated_VmwareEngine_GetNode_sync] diff --git a/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/get_node_type.rb b/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/get_node_type.rb new file mode 100644 index 000000000000..0a56485917ff --- /dev/null +++ b/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/get_node_type.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 vmwareengine_v1_generated_VmwareEngine_GetNodeType_sync] +require "google/cloud/vmware_engine/v1" + +## +# Snippet for the get_node_type call in the VmwareEngine 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::VmwareEngine::V1::VmwareEngine::Client#get_node_type. +# +def get_node_type + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VmwareEngine::V1::GetNodeTypeRequest.new + + # Call the get_node_type method. + result = client.get_node_type request + + # The returned object is of type Google::Cloud::VmwareEngine::V1::NodeType. + p result +end +# [END vmwareengine_v1_generated_VmwareEngine_GetNodeType_sync] diff --git a/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/get_private_cloud.rb b/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/get_private_cloud.rb new file mode 100644 index 000000000000..0f387793c62a --- /dev/null +++ b/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/get_private_cloud.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 vmwareengine_v1_generated_VmwareEngine_GetPrivateCloud_sync] +require "google/cloud/vmware_engine/v1" + +## +# Snippet for the get_private_cloud call in the VmwareEngine 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::VmwareEngine::V1::VmwareEngine::Client#get_private_cloud. +# +def get_private_cloud + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VmwareEngine::V1::GetPrivateCloudRequest.new + + # Call the get_private_cloud method. + result = client.get_private_cloud request + + # The returned object is of type Google::Cloud::VmwareEngine::V1::PrivateCloud. + p result +end +# [END vmwareengine_v1_generated_VmwareEngine_GetPrivateCloud_sync] diff --git a/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/get_private_connection.rb b/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/get_private_connection.rb new file mode 100644 index 000000000000..663702bf7df3 --- /dev/null +++ b/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/get_private_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 vmwareengine_v1_generated_VmwareEngine_GetPrivateConnection_sync] +require "google/cloud/vmware_engine/v1" + +## +# Snippet for the get_private_connection call in the VmwareEngine 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::VmwareEngine::V1::VmwareEngine::Client#get_private_connection. +# +def get_private_connection + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VmwareEngine::V1::GetPrivateConnectionRequest.new + + # Call the get_private_connection method. + result = client.get_private_connection request + + # The returned object is of type Google::Cloud::VmwareEngine::V1::PrivateConnection. + p result +end +# [END vmwareengine_v1_generated_VmwareEngine_GetPrivateConnection_sync] diff --git a/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/get_subnet.rb b/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/get_subnet.rb new file mode 100644 index 000000000000..994eefdd422d --- /dev/null +++ b/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/get_subnet.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 vmwareengine_v1_generated_VmwareEngine_GetSubnet_sync] +require "google/cloud/vmware_engine/v1" + +## +# Snippet for the get_subnet call in the VmwareEngine 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::VmwareEngine::V1::VmwareEngine::Client#get_subnet. +# +def get_subnet + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VmwareEngine::V1::GetSubnetRequest.new + + # Call the get_subnet method. + result = client.get_subnet request + + # The returned object is of type Google::Cloud::VmwareEngine::V1::Subnet. + p result +end +# [END vmwareengine_v1_generated_VmwareEngine_GetSubnet_sync] diff --git a/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/get_vmware_engine_network.rb b/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/get_vmware_engine_network.rb new file mode 100644 index 000000000000..f7b1a8dfa0fe --- /dev/null +++ b/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/get_vmware_engine_network.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 vmwareengine_v1_generated_VmwareEngine_GetVmwareEngineNetwork_sync] +require "google/cloud/vmware_engine/v1" + +## +# Snippet for the get_vmware_engine_network call in the VmwareEngine 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::VmwareEngine::V1::VmwareEngine::Client#get_vmware_engine_network. +# +def get_vmware_engine_network + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VmwareEngine::V1::GetVmwareEngineNetworkRequest.new + + # Call the get_vmware_engine_network method. + result = client.get_vmware_engine_network request + + # The returned object is of type Google::Cloud::VmwareEngine::V1::VmwareEngineNetwork. + p result +end +# [END vmwareengine_v1_generated_VmwareEngine_GetVmwareEngineNetwork_sync] diff --git a/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/grant_dns_bind_permission.rb b/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/grant_dns_bind_permission.rb new file mode 100644 index 000000000000..cd8f39bf2e04 --- /dev/null +++ b/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/grant_dns_bind_permission.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 vmwareengine_v1_generated_VmwareEngine_GrantDnsBindPermission_sync] +require "google/cloud/vmware_engine/v1" + +## +# Snippet for the grant_dns_bind_permission call in the VmwareEngine 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::VmwareEngine::V1::VmwareEngine::Client#grant_dns_bind_permission. +# +def grant_dns_bind_permission + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VmwareEngine::V1::GrantDnsBindPermissionRequest.new + + # Call the grant_dns_bind_permission method. + result = client.grant_dns_bind_permission 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 vmwareengine_v1_generated_VmwareEngine_GrantDnsBindPermission_sync] diff --git a/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/list_clusters.rb b/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/list_clusters.rb new file mode 100644 index 000000000000..76733bf18bce --- /dev/null +++ b/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/list_clusters.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 vmwareengine_v1_generated_VmwareEngine_ListClusters_sync] +require "google/cloud/vmware_engine/v1" + +## +# Snippet for the list_clusters call in the VmwareEngine 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::VmwareEngine::V1::VmwareEngine::Client#list_clusters. +# +def list_clusters + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VmwareEngine::V1::ListClustersRequest.new + + # Call the list_clusters method. + result = client.list_clusters 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::VmwareEngine::V1::Cluster. + p item + end +end +# [END vmwareengine_v1_generated_VmwareEngine_ListClusters_sync] diff --git a/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/list_external_access_rules.rb b/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/list_external_access_rules.rb new file mode 100644 index 000000000000..2267ce286f6f --- /dev/null +++ b/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/list_external_access_rules.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 vmwareengine_v1_generated_VmwareEngine_ListExternalAccessRules_sync] +require "google/cloud/vmware_engine/v1" + +## +# Snippet for the list_external_access_rules call in the VmwareEngine 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::VmwareEngine::V1::VmwareEngine::Client#list_external_access_rules. +# +def list_external_access_rules + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VmwareEngine::V1::ListExternalAccessRulesRequest.new + + # Call the list_external_access_rules method. + result = client.list_external_access_rules 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::VmwareEngine::V1::ExternalAccessRule. + p item + end +end +# [END vmwareengine_v1_generated_VmwareEngine_ListExternalAccessRules_sync] diff --git a/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/list_external_addresses.rb b/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/list_external_addresses.rb new file mode 100644 index 000000000000..363ec3743256 --- /dev/null +++ b/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/list_external_addresses.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 vmwareengine_v1_generated_VmwareEngine_ListExternalAddresses_sync] +require "google/cloud/vmware_engine/v1" + +## +# Snippet for the list_external_addresses call in the VmwareEngine 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::VmwareEngine::V1::VmwareEngine::Client#list_external_addresses. +# +def list_external_addresses + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VmwareEngine::V1::ListExternalAddressesRequest.new + + # Call the list_external_addresses method. + result = client.list_external_addresses 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::VmwareEngine::V1::ExternalAddress. + p item + end +end +# [END vmwareengine_v1_generated_VmwareEngine_ListExternalAddresses_sync] diff --git a/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/list_hcx_activation_keys.rb b/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/list_hcx_activation_keys.rb new file mode 100644 index 000000000000..56576409e6c4 --- /dev/null +++ b/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/list_hcx_activation_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 vmwareengine_v1_generated_VmwareEngine_ListHcxActivationKeys_sync] +require "google/cloud/vmware_engine/v1" + +## +# Snippet for the list_hcx_activation_keys call in the VmwareEngine 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::VmwareEngine::V1::VmwareEngine::Client#list_hcx_activation_keys. +# +def list_hcx_activation_keys + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VmwareEngine::V1::ListHcxActivationKeysRequest.new + + # Call the list_hcx_activation_keys method. + result = client.list_hcx_activation_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::VmwareEngine::V1::HcxActivationKey. + p item + end +end +# [END vmwareengine_v1_generated_VmwareEngine_ListHcxActivationKeys_sync] diff --git a/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/list_logging_servers.rb b/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/list_logging_servers.rb new file mode 100644 index 000000000000..96abe00561a5 --- /dev/null +++ b/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/list_logging_servers.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 vmwareengine_v1_generated_VmwareEngine_ListLoggingServers_sync] +require "google/cloud/vmware_engine/v1" + +## +# Snippet for the list_logging_servers call in the VmwareEngine 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::VmwareEngine::V1::VmwareEngine::Client#list_logging_servers. +# +def list_logging_servers + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VmwareEngine::V1::ListLoggingServersRequest.new + + # Call the list_logging_servers method. + result = client.list_logging_servers 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::VmwareEngine::V1::LoggingServer. + p item + end +end +# [END vmwareengine_v1_generated_VmwareEngine_ListLoggingServers_sync] diff --git a/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/list_management_dns_zone_bindings.rb b/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/list_management_dns_zone_bindings.rb new file mode 100644 index 000000000000..9183d165c8ec --- /dev/null +++ b/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/list_management_dns_zone_bindings.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 vmwareengine_v1_generated_VmwareEngine_ListManagementDnsZoneBindings_sync] +require "google/cloud/vmware_engine/v1" + +## +# Snippet for the list_management_dns_zone_bindings call in the VmwareEngine 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::VmwareEngine::V1::VmwareEngine::Client#list_management_dns_zone_bindings. +# +def list_management_dns_zone_bindings + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VmwareEngine::V1::ListManagementDnsZoneBindingsRequest.new + + # Call the list_management_dns_zone_bindings method. + result = client.list_management_dns_zone_bindings 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::VmwareEngine::V1::ManagementDnsZoneBinding. + p item + end +end +# [END vmwareengine_v1_generated_VmwareEngine_ListManagementDnsZoneBindings_sync] diff --git a/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/list_network_peerings.rb b/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/list_network_peerings.rb new file mode 100644 index 000000000000..150bb1c12485 --- /dev/null +++ b/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/list_network_peerings.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 vmwareengine_v1_generated_VmwareEngine_ListNetworkPeerings_sync] +require "google/cloud/vmware_engine/v1" + +## +# Snippet for the list_network_peerings call in the VmwareEngine 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::VmwareEngine::V1::VmwareEngine::Client#list_network_peerings. +# +def list_network_peerings + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VmwareEngine::V1::ListNetworkPeeringsRequest.new + + # Call the list_network_peerings method. + result = client.list_network_peerings 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::VmwareEngine::V1::NetworkPeering. + p item + end +end +# [END vmwareengine_v1_generated_VmwareEngine_ListNetworkPeerings_sync] diff --git a/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/list_network_policies.rb b/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/list_network_policies.rb new file mode 100644 index 000000000000..2aceb11e3161 --- /dev/null +++ b/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/list_network_policies.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 vmwareengine_v1_generated_VmwareEngine_ListNetworkPolicies_sync] +require "google/cloud/vmware_engine/v1" + +## +# Snippet for the list_network_policies call in the VmwareEngine 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::VmwareEngine::V1::VmwareEngine::Client#list_network_policies. +# +def list_network_policies + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VmwareEngine::V1::ListNetworkPoliciesRequest.new + + # Call the list_network_policies method. + result = client.list_network_policies 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::VmwareEngine::V1::NetworkPolicy. + p item + end +end +# [END vmwareengine_v1_generated_VmwareEngine_ListNetworkPolicies_sync] diff --git a/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/list_node_types.rb b/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/list_node_types.rb new file mode 100644 index 000000000000..89c4b160b77d --- /dev/null +++ b/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/list_node_types.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 vmwareengine_v1_generated_VmwareEngine_ListNodeTypes_sync] +require "google/cloud/vmware_engine/v1" + +## +# Snippet for the list_node_types call in the VmwareEngine 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::VmwareEngine::V1::VmwareEngine::Client#list_node_types. +# +def list_node_types + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VmwareEngine::V1::ListNodeTypesRequest.new + + # Call the list_node_types method. + result = client.list_node_types 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::VmwareEngine::V1::NodeType. + p item + end +end +# [END vmwareengine_v1_generated_VmwareEngine_ListNodeTypes_sync] diff --git a/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/list_nodes.rb b/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/list_nodes.rb new file mode 100644 index 000000000000..feba4cc45e28 --- /dev/null +++ b/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/list_nodes.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 vmwareengine_v1_generated_VmwareEngine_ListNodes_sync] +require "google/cloud/vmware_engine/v1" + +## +# Snippet for the list_nodes call in the VmwareEngine 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::VmwareEngine::V1::VmwareEngine::Client#list_nodes. +# +def list_nodes + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VmwareEngine::V1::ListNodesRequest.new + + # Call the list_nodes method. + result = client.list_nodes 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::VmwareEngine::V1::Node. + p item + end +end +# [END vmwareengine_v1_generated_VmwareEngine_ListNodes_sync] diff --git a/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/list_peering_routes.rb b/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/list_peering_routes.rb new file mode 100644 index 000000000000..f645bfbba771 --- /dev/null +++ b/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/list_peering_routes.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 vmwareengine_v1_generated_VmwareEngine_ListPeeringRoutes_sync] +require "google/cloud/vmware_engine/v1" + +## +# Snippet for the list_peering_routes call in the VmwareEngine 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::VmwareEngine::V1::VmwareEngine::Client#list_peering_routes. +# +def list_peering_routes + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VmwareEngine::V1::ListPeeringRoutesRequest.new + + # Call the list_peering_routes method. + result = client.list_peering_routes 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::VmwareEngine::V1::PeeringRoute. + p item + end +end +# [END vmwareengine_v1_generated_VmwareEngine_ListPeeringRoutes_sync] diff --git a/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/list_private_clouds.rb b/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/list_private_clouds.rb new file mode 100644 index 000000000000..eeb2216d2366 --- /dev/null +++ b/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/list_private_clouds.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 vmwareengine_v1_generated_VmwareEngine_ListPrivateClouds_sync] +require "google/cloud/vmware_engine/v1" + +## +# Snippet for the list_private_clouds call in the VmwareEngine 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::VmwareEngine::V1::VmwareEngine::Client#list_private_clouds. +# +def list_private_clouds + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VmwareEngine::V1::ListPrivateCloudsRequest.new + + # Call the list_private_clouds method. + result = client.list_private_clouds 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::VmwareEngine::V1::PrivateCloud. + p item + end +end +# [END vmwareengine_v1_generated_VmwareEngine_ListPrivateClouds_sync] diff --git a/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/list_private_connection_peering_routes.rb b/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/list_private_connection_peering_routes.rb new file mode 100644 index 000000000000..49d5011f9a8f --- /dev/null +++ b/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/list_private_connection_peering_routes.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 vmwareengine_v1_generated_VmwareEngine_ListPrivateConnectionPeeringRoutes_sync] +require "google/cloud/vmware_engine/v1" + +## +# Snippet for the list_private_connection_peering_routes call in the VmwareEngine 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::VmwareEngine::V1::VmwareEngine::Client#list_private_connection_peering_routes. +# +def list_private_connection_peering_routes + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VmwareEngine::V1::ListPrivateConnectionPeeringRoutesRequest.new + + # Call the list_private_connection_peering_routes method. + result = client.list_private_connection_peering_routes 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::VmwareEngine::V1::PeeringRoute. + p item + end +end +# [END vmwareengine_v1_generated_VmwareEngine_ListPrivateConnectionPeeringRoutes_sync] diff --git a/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/list_private_connections.rb b/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/list_private_connections.rb new file mode 100644 index 000000000000..af827ee6ed71 --- /dev/null +++ b/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/list_private_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 vmwareengine_v1_generated_VmwareEngine_ListPrivateConnections_sync] +require "google/cloud/vmware_engine/v1" + +## +# Snippet for the list_private_connections call in the VmwareEngine 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::VmwareEngine::V1::VmwareEngine::Client#list_private_connections. +# +def list_private_connections + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VmwareEngine::V1::ListPrivateConnectionsRequest.new + + # Call the list_private_connections method. + result = client.list_private_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::VmwareEngine::V1::PrivateConnection. + p item + end +end +# [END vmwareengine_v1_generated_VmwareEngine_ListPrivateConnections_sync] diff --git a/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/list_subnets.rb b/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/list_subnets.rb new file mode 100644 index 000000000000..1e189f43ebf6 --- /dev/null +++ b/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/list_subnets.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 vmwareengine_v1_generated_VmwareEngine_ListSubnets_sync] +require "google/cloud/vmware_engine/v1" + +## +# Snippet for the list_subnets call in the VmwareEngine 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::VmwareEngine::V1::VmwareEngine::Client#list_subnets. +# +def list_subnets + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VmwareEngine::V1::ListSubnetsRequest.new + + # Call the list_subnets method. + result = client.list_subnets 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::VmwareEngine::V1::Subnet. + p item + end +end +# [END vmwareengine_v1_generated_VmwareEngine_ListSubnets_sync] diff --git a/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/list_vmware_engine_networks.rb b/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/list_vmware_engine_networks.rb new file mode 100644 index 000000000000..143d875b947c --- /dev/null +++ b/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/list_vmware_engine_networks.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 vmwareengine_v1_generated_VmwareEngine_ListVmwareEngineNetworks_sync] +require "google/cloud/vmware_engine/v1" + +## +# Snippet for the list_vmware_engine_networks call in the VmwareEngine 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::VmwareEngine::V1::VmwareEngine::Client#list_vmware_engine_networks. +# +def list_vmware_engine_networks + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VmwareEngine::V1::ListVmwareEngineNetworksRequest.new + + # Call the list_vmware_engine_networks method. + result = client.list_vmware_engine_networks 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::VmwareEngine::V1::VmwareEngineNetwork. + p item + end +end +# [END vmwareengine_v1_generated_VmwareEngine_ListVmwareEngineNetworks_sync] diff --git a/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/repair_management_dns_zone_binding.rb b/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/repair_management_dns_zone_binding.rb new file mode 100644 index 000000000000..4d6b6e44c1e8 --- /dev/null +++ b/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/repair_management_dns_zone_binding.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 vmwareengine_v1_generated_VmwareEngine_RepairManagementDnsZoneBinding_sync] +require "google/cloud/vmware_engine/v1" + +## +# Snippet for the repair_management_dns_zone_binding call in the VmwareEngine 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::VmwareEngine::V1::VmwareEngine::Client#repair_management_dns_zone_binding. +# +def repair_management_dns_zone_binding + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VmwareEngine::V1::RepairManagementDnsZoneBindingRequest.new + + # Call the repair_management_dns_zone_binding method. + result = client.repair_management_dns_zone_binding 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 vmwareengine_v1_generated_VmwareEngine_RepairManagementDnsZoneBinding_sync] diff --git a/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/reset_nsx_credentials.rb b/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/reset_nsx_credentials.rb new file mode 100644 index 000000000000..11bc2e6fd0e3 --- /dev/null +++ b/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/reset_nsx_credentials.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 vmwareengine_v1_generated_VmwareEngine_ResetNsxCredentials_sync] +require "google/cloud/vmware_engine/v1" + +## +# Snippet for the reset_nsx_credentials call in the VmwareEngine 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::VmwareEngine::V1::VmwareEngine::Client#reset_nsx_credentials. +# +def reset_nsx_credentials + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VmwareEngine::V1::ResetNsxCredentialsRequest.new + + # Call the reset_nsx_credentials method. + result = client.reset_nsx_credentials 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 vmwareengine_v1_generated_VmwareEngine_ResetNsxCredentials_sync] diff --git a/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/reset_vcenter_credentials.rb b/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/reset_vcenter_credentials.rb new file mode 100644 index 000000000000..ceab7a4dce15 --- /dev/null +++ b/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/reset_vcenter_credentials.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 vmwareengine_v1_generated_VmwareEngine_ResetVcenterCredentials_sync] +require "google/cloud/vmware_engine/v1" + +## +# Snippet for the reset_vcenter_credentials call in the VmwareEngine 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::VmwareEngine::V1::VmwareEngine::Client#reset_vcenter_credentials. +# +def reset_vcenter_credentials + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VmwareEngine::V1::ResetVcenterCredentialsRequest.new + + # Call the reset_vcenter_credentials method. + result = client.reset_vcenter_credentials 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 vmwareengine_v1_generated_VmwareEngine_ResetVcenterCredentials_sync] diff --git a/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/revoke_dns_bind_permission.rb b/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/revoke_dns_bind_permission.rb new file mode 100644 index 000000000000..cde973c17390 --- /dev/null +++ b/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/revoke_dns_bind_permission.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 vmwareengine_v1_generated_VmwareEngine_RevokeDnsBindPermission_sync] +require "google/cloud/vmware_engine/v1" + +## +# Snippet for the revoke_dns_bind_permission call in the VmwareEngine 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::VmwareEngine::V1::VmwareEngine::Client#revoke_dns_bind_permission. +# +def revoke_dns_bind_permission + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VmwareEngine::V1::RevokeDnsBindPermissionRequest.new + + # Call the revoke_dns_bind_permission method. + result = client.revoke_dns_bind_permission 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 vmwareengine_v1_generated_VmwareEngine_RevokeDnsBindPermission_sync] diff --git a/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/show_nsx_credentials.rb b/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/show_nsx_credentials.rb new file mode 100644 index 000000000000..53f526a4b605 --- /dev/null +++ b/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/show_nsx_credentials.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 vmwareengine_v1_generated_VmwareEngine_ShowNsxCredentials_sync] +require "google/cloud/vmware_engine/v1" + +## +# Snippet for the show_nsx_credentials call in the VmwareEngine 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::VmwareEngine::V1::VmwareEngine::Client#show_nsx_credentials. +# +def show_nsx_credentials + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VmwareEngine::V1::ShowNsxCredentialsRequest.new + + # Call the show_nsx_credentials method. + result = client.show_nsx_credentials request + + # The returned object is of type Google::Cloud::VmwareEngine::V1::Credentials. + p result +end +# [END vmwareengine_v1_generated_VmwareEngine_ShowNsxCredentials_sync] diff --git a/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/show_vcenter_credentials.rb b/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/show_vcenter_credentials.rb new file mode 100644 index 000000000000..cae36f6ea2d5 --- /dev/null +++ b/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/show_vcenter_credentials.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 vmwareengine_v1_generated_VmwareEngine_ShowVcenterCredentials_sync] +require "google/cloud/vmware_engine/v1" + +## +# Snippet for the show_vcenter_credentials call in the VmwareEngine 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::VmwareEngine::V1::VmwareEngine::Client#show_vcenter_credentials. +# +def show_vcenter_credentials + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VmwareEngine::V1::ShowVcenterCredentialsRequest.new + + # Call the show_vcenter_credentials method. + result = client.show_vcenter_credentials request + + # The returned object is of type Google::Cloud::VmwareEngine::V1::Credentials. + p result +end +# [END vmwareengine_v1_generated_VmwareEngine_ShowVcenterCredentials_sync] diff --git a/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/undelete_private_cloud.rb b/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/undelete_private_cloud.rb new file mode 100644 index 000000000000..7425b33d28eb --- /dev/null +++ b/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/undelete_private_cloud.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 vmwareengine_v1_generated_VmwareEngine_UndeletePrivateCloud_sync] +require "google/cloud/vmware_engine/v1" + +## +# Snippet for the undelete_private_cloud call in the VmwareEngine 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::VmwareEngine::V1::VmwareEngine::Client#undelete_private_cloud. +# +def undelete_private_cloud + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VmwareEngine::V1::UndeletePrivateCloudRequest.new + + # Call the undelete_private_cloud method. + result = client.undelete_private_cloud 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 vmwareengine_v1_generated_VmwareEngine_UndeletePrivateCloud_sync] diff --git a/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/update_cluster.rb b/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/update_cluster.rb new file mode 100644 index 000000000000..38b7e52760c4 --- /dev/null +++ b/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/update_cluster.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 vmwareengine_v1_generated_VmwareEngine_UpdateCluster_sync] +require "google/cloud/vmware_engine/v1" + +## +# Snippet for the update_cluster call in the VmwareEngine 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::VmwareEngine::V1::VmwareEngine::Client#update_cluster. +# +def update_cluster + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VmwareEngine::V1::UpdateClusterRequest.new + + # Call the update_cluster method. + result = client.update_cluster 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 vmwareengine_v1_generated_VmwareEngine_UpdateCluster_sync] diff --git a/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/update_dns_forwarding.rb b/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/update_dns_forwarding.rb new file mode 100644 index 000000000000..0ad70f87133b --- /dev/null +++ b/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/update_dns_forwarding.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 vmwareengine_v1_generated_VmwareEngine_UpdateDnsForwarding_sync] +require "google/cloud/vmware_engine/v1" + +## +# Snippet for the update_dns_forwarding call in the VmwareEngine 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::VmwareEngine::V1::VmwareEngine::Client#update_dns_forwarding. +# +def update_dns_forwarding + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VmwareEngine::V1::UpdateDnsForwardingRequest.new + + # Call the update_dns_forwarding method. + result = client.update_dns_forwarding 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 vmwareengine_v1_generated_VmwareEngine_UpdateDnsForwarding_sync] diff --git a/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/update_external_access_rule.rb b/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/update_external_access_rule.rb new file mode 100644 index 000000000000..899f50154332 --- /dev/null +++ b/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/update_external_access_rule.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 vmwareengine_v1_generated_VmwareEngine_UpdateExternalAccessRule_sync] +require "google/cloud/vmware_engine/v1" + +## +# Snippet for the update_external_access_rule call in the VmwareEngine 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::VmwareEngine::V1::VmwareEngine::Client#update_external_access_rule. +# +def update_external_access_rule + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VmwareEngine::V1::UpdateExternalAccessRuleRequest.new + + # Call the update_external_access_rule method. + result = client.update_external_access_rule 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 vmwareengine_v1_generated_VmwareEngine_UpdateExternalAccessRule_sync] diff --git a/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/update_external_address.rb b/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/update_external_address.rb new file mode 100644 index 000000000000..90d96464fa2d --- /dev/null +++ b/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/update_external_address.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 vmwareengine_v1_generated_VmwareEngine_UpdateExternalAddress_sync] +require "google/cloud/vmware_engine/v1" + +## +# Snippet for the update_external_address call in the VmwareEngine 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::VmwareEngine::V1::VmwareEngine::Client#update_external_address. +# +def update_external_address + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VmwareEngine::V1::UpdateExternalAddressRequest.new + + # Call the update_external_address method. + result = client.update_external_address 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 vmwareengine_v1_generated_VmwareEngine_UpdateExternalAddress_sync] diff --git a/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/update_logging_server.rb b/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/update_logging_server.rb new file mode 100644 index 000000000000..911eeb0de84b --- /dev/null +++ b/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/update_logging_server.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 vmwareengine_v1_generated_VmwareEngine_UpdateLoggingServer_sync] +require "google/cloud/vmware_engine/v1" + +## +# Snippet for the update_logging_server call in the VmwareEngine 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::VmwareEngine::V1::VmwareEngine::Client#update_logging_server. +# +def update_logging_server + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VmwareEngine::V1::UpdateLoggingServerRequest.new + + # Call the update_logging_server method. + result = client.update_logging_server 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 vmwareengine_v1_generated_VmwareEngine_UpdateLoggingServer_sync] diff --git a/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/update_management_dns_zone_binding.rb b/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/update_management_dns_zone_binding.rb new file mode 100644 index 000000000000..7665aa045b97 --- /dev/null +++ b/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/update_management_dns_zone_binding.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 vmwareengine_v1_generated_VmwareEngine_UpdateManagementDnsZoneBinding_sync] +require "google/cloud/vmware_engine/v1" + +## +# Snippet for the update_management_dns_zone_binding call in the VmwareEngine 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::VmwareEngine::V1::VmwareEngine::Client#update_management_dns_zone_binding. +# +def update_management_dns_zone_binding + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VmwareEngine::V1::UpdateManagementDnsZoneBindingRequest.new + + # Call the update_management_dns_zone_binding method. + result = client.update_management_dns_zone_binding 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 vmwareengine_v1_generated_VmwareEngine_UpdateManagementDnsZoneBinding_sync] diff --git a/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/update_network_peering.rb b/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/update_network_peering.rb new file mode 100644 index 000000000000..09c5ea08042e --- /dev/null +++ b/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/update_network_peering.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 vmwareengine_v1_generated_VmwareEngine_UpdateNetworkPeering_sync] +require "google/cloud/vmware_engine/v1" + +## +# Snippet for the update_network_peering call in the VmwareEngine 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::VmwareEngine::V1::VmwareEngine::Client#update_network_peering. +# +def update_network_peering + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VmwareEngine::V1::UpdateNetworkPeeringRequest.new + + # Call the update_network_peering method. + result = client.update_network_peering 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 vmwareengine_v1_generated_VmwareEngine_UpdateNetworkPeering_sync] diff --git a/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/update_network_policy.rb b/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/update_network_policy.rb new file mode 100644 index 000000000000..a4360cd07ab0 --- /dev/null +++ b/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/update_network_policy.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 vmwareengine_v1_generated_VmwareEngine_UpdateNetworkPolicy_sync] +require "google/cloud/vmware_engine/v1" + +## +# Snippet for the update_network_policy call in the VmwareEngine 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::VmwareEngine::V1::VmwareEngine::Client#update_network_policy. +# +def update_network_policy + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VmwareEngine::V1::UpdateNetworkPolicyRequest.new + + # Call the update_network_policy method. + result = client.update_network_policy 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 vmwareengine_v1_generated_VmwareEngine_UpdateNetworkPolicy_sync] diff --git a/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/update_private_cloud.rb b/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/update_private_cloud.rb new file mode 100644 index 000000000000..04389ad9d673 --- /dev/null +++ b/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/update_private_cloud.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 vmwareengine_v1_generated_VmwareEngine_UpdatePrivateCloud_sync] +require "google/cloud/vmware_engine/v1" + +## +# Snippet for the update_private_cloud call in the VmwareEngine 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::VmwareEngine::V1::VmwareEngine::Client#update_private_cloud. +# +def update_private_cloud + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VmwareEngine::V1::UpdatePrivateCloudRequest.new + + # Call the update_private_cloud method. + result = client.update_private_cloud 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 vmwareengine_v1_generated_VmwareEngine_UpdatePrivateCloud_sync] diff --git a/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/update_private_connection.rb b/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/update_private_connection.rb new file mode 100644 index 000000000000..3b3f4109f00e --- /dev/null +++ b/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/update_private_connection.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 vmwareengine_v1_generated_VmwareEngine_UpdatePrivateConnection_sync] +require "google/cloud/vmware_engine/v1" + +## +# Snippet for the update_private_connection call in the VmwareEngine 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::VmwareEngine::V1::VmwareEngine::Client#update_private_connection. +# +def update_private_connection + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VmwareEngine::V1::UpdatePrivateConnectionRequest.new + + # Call the update_private_connection method. + result = client.update_private_connection 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 vmwareengine_v1_generated_VmwareEngine_UpdatePrivateConnection_sync] diff --git a/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/update_subnet.rb b/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/update_subnet.rb new file mode 100644 index 000000000000..6178fa50930b --- /dev/null +++ b/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/update_subnet.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 vmwareengine_v1_generated_VmwareEngine_UpdateSubnet_sync] +require "google/cloud/vmware_engine/v1" + +## +# Snippet for the update_subnet call in the VmwareEngine 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::VmwareEngine::V1::VmwareEngine::Client#update_subnet. +# +def update_subnet + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VmwareEngine::V1::UpdateSubnetRequest.new + + # Call the update_subnet method. + result = client.update_subnet 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 vmwareengine_v1_generated_VmwareEngine_UpdateSubnet_sync] diff --git a/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/update_vmware_engine_network.rb b/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/update_vmware_engine_network.rb new file mode 100644 index 000000000000..75c548dd649a --- /dev/null +++ b/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/update_vmware_engine_network.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 vmwareengine_v1_generated_VmwareEngine_UpdateVmwareEngineNetwork_sync] +require "google/cloud/vmware_engine/v1" + +## +# Snippet for the update_vmware_engine_network call in the VmwareEngine 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::VmwareEngine::V1::VmwareEngine::Client#update_vmware_engine_network. +# +def update_vmware_engine_network + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VmwareEngine::V1::UpdateVmwareEngineNetworkRequest.new + + # Call the update_vmware_engine_network method. + result = client.update_vmware_engine_network 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 vmwareengine_v1_generated_VmwareEngine_UpdateVmwareEngineNetwork_sync] diff --git a/owl-bot-staging/google-cloud-vmware_engine-v1/test/google/cloud/vmware_engine/v1/vmware_engine_operations_test.rb b/owl-bot-staging/google-cloud-vmware_engine-v1/test/google/cloud/vmware_engine/v1/vmware_engine_operations_test.rb new file mode 100644 index 000000000000..dc60dddb354f --- /dev/null +++ b/owl-bot-staging/google-cloud-vmware_engine-v1/test/google/cloud/vmware_engine/v1/vmware_engine_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/vmwareengine/v1/vmwareengine_pb" +require "google/cloud/vmwareengine/v1/vmwareengine_services_pb" +require "google/cloud/vmware_engine/v1/vmware_engine" + +class ::Google::Cloud::VmwareEngine::V1::VmwareEngine::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::VmwareEngine::V1::VmwareEngine::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::VmwareEngine::V1::VmwareEngine::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::VmwareEngine::V1::VmwareEngine::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::VmwareEngine::V1::VmwareEngine::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::VmwareEngine::V1::VmwareEngine::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::VmwareEngine::V1::VmwareEngine::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::VmwareEngine::V1::VmwareEngine::Operations::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-vmware_engine-v1/test/google/cloud/vmware_engine/v1/vmware_engine_paths_test.rb b/owl-bot-staging/google-cloud-vmware_engine-v1/test/google/cloud/vmware_engine/v1/vmware_engine_paths_test.rb new file mode 100644 index 000000000000..5e079f9a19f2 --- /dev/null +++ b/owl-bot-staging/google-cloud-vmware_engine-v1/test/google/cloud/vmware_engine/v1/vmware_engine_paths_test.rb @@ -0,0 +1,259 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/vmware_engine/v1/vmware_engine" + +class ::Google::Cloud::VmwareEngine::V1::VmwareEngine::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_cluster_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.cluster_path project: "value0", location: "value1", private_cloud: "value2", cluster: "value3" + assert_equal "projects/value0/locations/value1/privateClouds/value2/clusters/value3", path + end + end + + def test_dns_bind_permission_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.dns_bind_permission_path project: "value0", location: "value1" + assert_equal "projects/value0/locations/value1/dnsBindPermission", path + end + end + + def test_dns_forwarding_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.dns_forwarding_path project: "value0", location: "value1", private_cloud: "value2" + assert_equal "projects/value0/locations/value1/privateClouds/value2/dnsForwarding", path + end + end + + def test_external_access_rule_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.external_access_rule_path project: "value0", location: "value1", network_policy: "value2", external_access_rule: "value3" + assert_equal "projects/value0/locations/value1/networkPolicies/value2/externalAccessRules/value3", path + end + end + + def test_external_address_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.external_address_path project: "value0", location: "value1", private_cloud: "value2", external_address: "value3" + assert_equal "projects/value0/locations/value1/privateClouds/value2/externalAddresses/value3", path + end + end + + def test_hcx_activation_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::VmwareEngine::V1::VmwareEngine::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.hcx_activation_key_path project: "value0", location: "value1", private_cloud: "value2", hcx_activation_key: "value3" + assert_equal "projects/value0/locations/value1/privateClouds/value2/hcxActivationKeys/value3", 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::VmwareEngine::V1::VmwareEngine::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_logging_server_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.logging_server_path project: "value0", location: "value1", private_cloud: "value2", logging_server: "value3" + assert_equal "projects/value0/locations/value1/privateClouds/value2/loggingServers/value3", path + end + end + + def test_management_dns_zone_binding_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.management_dns_zone_binding_path project: "value0", location: "value1", private_cloud: "value2", management_dns_zone_binding: "value3" + assert_equal "projects/value0/locations/value1/privateClouds/value2/managementDnsZoneBindings/value3", path + end + end + + def test_network_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.network_path project: "value0", network: "value1" + assert_equal "projects/value0/global/networks/value1", path + end + end + + def test_network_peering_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.network_peering_path project: "value0", location: "value1", network_peering: "value2" + assert_equal "projects/value0/locations/value1/networkPeerings/value2", path + end + end + + def test_network_policy_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.network_policy_path project: "value0", location: "value1", network_policy: "value2" + assert_equal "projects/value0/locations/value1/networkPolicies/value2", path + end + end + + def test_node_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.node_path project: "value0", location: "value1", private_cloud: "value2", cluster: "value3", node: "value4" + assert_equal "projects/value0/locations/value1/privateClouds/value2/clusters/value3/nodes/value4", path + end + end + + def test_node_type_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.node_type_path project: "value0", location: "value1", node_type: "value2" + assert_equal "projects/value0/locations/value1/nodeTypes/value2", path + end + end + + def test_private_cloud_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.private_cloud_path project: "value0", location: "value1", private_cloud: "value2" + assert_equal "projects/value0/locations/value1/privateClouds/value2", path + end + end + + def test_private_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::VmwareEngine::V1::VmwareEngine::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.private_connection_path project: "value0", location: "value1", private_connection: "value2" + assert_equal "projects/value0/locations/value1/privateConnections/value2", path + end + end + + def test_subnet_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.subnet_path project: "value0", location: "value1", private_cloud: "value2", subnet: "value3" + assert_equal "projects/value0/locations/value1/privateClouds/value2/subnets/value3", path + end + end + + def test_vmware_engine_network_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.vmware_engine_network_path project: "value0", location: "value1", vmware_engine_network: "value2" + assert_equal "projects/value0/locations/value1/vmwareEngineNetworks/value2", path + end + end +end diff --git a/owl-bot-staging/google-cloud-vmware_engine-v1/test/google/cloud/vmware_engine/v1/vmware_engine_rest_test.rb b/owl-bot-staging/google-cloud-vmware_engine-v1/test/google/cloud/vmware_engine/v1/vmware_engine_rest_test.rb new file mode 100644 index 000000000000..f6e8df4f3a3a --- /dev/null +++ b/owl-bot-staging/google-cloud-vmware_engine-v1/test/google/cloud/vmware_engine/v1/vmware_engine_rest_test.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 "helper" +require "gapic/rest" +require "google/cloud/vmwareengine/v1/vmwareengine_pb" +require "google/cloud/vmware_engine/v1/vmware_engine/rest" + + +class ::Google::Cloud::VmwareEngine::V1::VmwareEngine::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_private_clouds + # Create test objects. + client_result = ::Google::Cloud::VmwareEngine::V1::ListPrivateCloudsResponse.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_private_clouds_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::VmwareEngine::V1::VmwareEngine::Rest::ServiceStub.stub :transcode_list_private_clouds_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_private_clouds_client_stub do + # Create client + client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_private_clouds({ 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_private_clouds 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_private_clouds ::Google::Cloud::VmwareEngine::V1::ListPrivateCloudsRequest.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_private_clouds({ 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_private_clouds(::Google::Cloud::VmwareEngine::V1::ListPrivateCloudsRequest.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_private_clouds_client_stub.call_count + end + end + end + + def test_get_private_cloud + # Create test objects. + client_result = ::Google::Cloud::VmwareEngine::V1::PrivateCloud.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_private_cloud_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::VmwareEngine::V1::VmwareEngine::Rest::ServiceStub.stub :transcode_get_private_cloud_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_private_cloud_client_stub do + # Create client + client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_private_cloud({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_private_cloud name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_private_cloud ::Google::Cloud::VmwareEngine::V1::GetPrivateCloudRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_private_cloud({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_private_cloud(::Google::Cloud::VmwareEngine::V1::GetPrivateCloudRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_private_cloud_client_stub.call_count + end + end + end + + def test_create_private_cloud + # 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" + private_cloud_id = "hello world" + private_cloud = {} + request_id = "hello world" + validate_only = true + + create_private_cloud_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::VmwareEngine::V1::VmwareEngine::Rest::ServiceStub.stub :transcode_create_private_cloud_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_private_cloud_client_stub do + # Create client + client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_private_cloud({ parent: parent, private_cloud_id: private_cloud_id, private_cloud: private_cloud, request_id: request_id, validate_only: validate_only }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_private_cloud parent: parent, private_cloud_id: private_cloud_id, private_cloud: private_cloud, request_id: request_id, validate_only: validate_only do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_private_cloud ::Google::Cloud::VmwareEngine::V1::CreatePrivateCloudRequest.new(parent: parent, private_cloud_id: private_cloud_id, private_cloud: private_cloud, request_id: request_id, validate_only: validate_only) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_private_cloud({ parent: parent, private_cloud_id: private_cloud_id, private_cloud: private_cloud, request_id: request_id, validate_only: validate_only }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_private_cloud(::Google::Cloud::VmwareEngine::V1::CreatePrivateCloudRequest.new(parent: parent, private_cloud_id: private_cloud_id, private_cloud: private_cloud, request_id: request_id, validate_only: validate_only), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_private_cloud_client_stub.call_count + end + end + end + + def test_update_private_cloud + # 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. + private_cloud = {} + update_mask = {} + request_id = "hello world" + + update_private_cloud_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::VmwareEngine::V1::VmwareEngine::Rest::ServiceStub.stub :transcode_update_private_cloud_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_private_cloud_client_stub do + # Create client + client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_private_cloud({ private_cloud: private_cloud, update_mask: update_mask, request_id: request_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_private_cloud private_cloud: private_cloud, update_mask: update_mask, request_id: request_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_private_cloud ::Google::Cloud::VmwareEngine::V1::UpdatePrivateCloudRequest.new(private_cloud: private_cloud, update_mask: update_mask, request_id: request_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_private_cloud({ private_cloud: private_cloud, update_mask: update_mask, request_id: request_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_private_cloud(::Google::Cloud::VmwareEngine::V1::UpdatePrivateCloudRequest.new(private_cloud: private_cloud, update_mask: update_mask, request_id: request_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_private_cloud_client_stub.call_count + end + end + end + + def test_delete_private_cloud + # 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" + request_id = "hello world" + force = true + delay_hours = 42 + + delete_private_cloud_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::VmwareEngine::V1::VmwareEngine::Rest::ServiceStub.stub :transcode_delete_private_cloud_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_private_cloud_client_stub do + # Create client + client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_private_cloud({ name: name, request_id: request_id, force: force, delay_hours: delay_hours }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_private_cloud name: name, request_id: request_id, force: force, delay_hours: delay_hours do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_private_cloud ::Google::Cloud::VmwareEngine::V1::DeletePrivateCloudRequest.new(name: name, request_id: request_id, force: force, delay_hours: delay_hours) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_private_cloud({ name: name, request_id: request_id, force: force, delay_hours: delay_hours }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_private_cloud(::Google::Cloud::VmwareEngine::V1::DeletePrivateCloudRequest.new(name: name, request_id: request_id, force: force, delay_hours: delay_hours), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_private_cloud_client_stub.call_count + end + end + end + + def test_undelete_private_cloud + # 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" + request_id = "hello world" + + undelete_private_cloud_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::VmwareEngine::V1::VmwareEngine::Rest::ServiceStub.stub :transcode_undelete_private_cloud_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, undelete_private_cloud_client_stub do + # Create client + client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.undelete_private_cloud({ name: name, request_id: request_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.undelete_private_cloud name: name, request_id: request_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.undelete_private_cloud ::Google::Cloud::VmwareEngine::V1::UndeletePrivateCloudRequest.new(name: name, request_id: request_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.undelete_private_cloud({ name: name, request_id: request_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.undelete_private_cloud(::Google::Cloud::VmwareEngine::V1::UndeletePrivateCloudRequest.new(name: name, request_id: request_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, undelete_private_cloud_client_stub.call_count + end + end + end + + def test_list_clusters + # Create test objects. + client_result = ::Google::Cloud::VmwareEngine::V1::ListClustersResponse.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_clusters_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::VmwareEngine::V1::VmwareEngine::Rest::ServiceStub.stub :transcode_list_clusters_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_clusters_client_stub do + # Create client + client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_clusters({ 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_clusters 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_clusters ::Google::Cloud::VmwareEngine::V1::ListClustersRequest.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_clusters({ 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_clusters(::Google::Cloud::VmwareEngine::V1::ListClustersRequest.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_clusters_client_stub.call_count + end + end + end + + def test_get_cluster + # Create test objects. + client_result = ::Google::Cloud::VmwareEngine::V1::Cluster.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_cluster_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::VmwareEngine::V1::VmwareEngine::Rest::ServiceStub.stub :transcode_get_cluster_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_cluster_client_stub do + # Create client + client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_cluster({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_cluster name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_cluster ::Google::Cloud::VmwareEngine::V1::GetClusterRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_cluster({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_cluster(::Google::Cloud::VmwareEngine::V1::GetClusterRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_cluster_client_stub.call_count + end + end + end + + def test_create_cluster + # 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" + cluster_id = "hello world" + cluster = {} + request_id = "hello world" + validate_only = true + + create_cluster_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::VmwareEngine::V1::VmwareEngine::Rest::ServiceStub.stub :transcode_create_cluster_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_cluster_client_stub do + # Create client + client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_cluster({ parent: parent, cluster_id: cluster_id, cluster: cluster, request_id: request_id, validate_only: validate_only }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_cluster parent: parent, cluster_id: cluster_id, cluster: cluster, request_id: request_id, validate_only: validate_only do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_cluster ::Google::Cloud::VmwareEngine::V1::CreateClusterRequest.new(parent: parent, cluster_id: cluster_id, cluster: cluster, request_id: request_id, validate_only: validate_only) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_cluster({ parent: parent, cluster_id: cluster_id, cluster: cluster, request_id: request_id, validate_only: validate_only }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_cluster(::Google::Cloud::VmwareEngine::V1::CreateClusterRequest.new(parent: parent, cluster_id: cluster_id, cluster: cluster, request_id: request_id, validate_only: validate_only), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_cluster_client_stub.call_count + end + end + end + + def test_update_cluster + # 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. + update_mask = {} + cluster = {} + request_id = "hello world" + validate_only = true + + update_cluster_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::VmwareEngine::V1::VmwareEngine::Rest::ServiceStub.stub :transcode_update_cluster_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_cluster_client_stub do + # Create client + client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_cluster({ update_mask: update_mask, cluster: cluster, request_id: request_id, validate_only: validate_only }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_cluster update_mask: update_mask, cluster: cluster, request_id: request_id, validate_only: validate_only do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_cluster ::Google::Cloud::VmwareEngine::V1::UpdateClusterRequest.new(update_mask: update_mask, cluster: cluster, request_id: request_id, validate_only: validate_only) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_cluster({ update_mask: update_mask, cluster: cluster, request_id: request_id, validate_only: validate_only }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_cluster(::Google::Cloud::VmwareEngine::V1::UpdateClusterRequest.new(update_mask: update_mask, cluster: cluster, request_id: request_id, validate_only: validate_only), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_cluster_client_stub.call_count + end + end + end + + def test_delete_cluster + # 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" + request_id = "hello world" + + delete_cluster_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::VmwareEngine::V1::VmwareEngine::Rest::ServiceStub.stub :transcode_delete_cluster_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_cluster_client_stub do + # Create client + client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_cluster({ name: name, request_id: request_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_cluster name: name, request_id: request_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_cluster ::Google::Cloud::VmwareEngine::V1::DeleteClusterRequest.new(name: name, request_id: request_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_cluster({ name: name, request_id: request_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_cluster(::Google::Cloud::VmwareEngine::V1::DeleteClusterRequest.new(name: name, request_id: request_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_cluster_client_stub.call_count + end + end + end + + def test_list_nodes + # Create test objects. + client_result = ::Google::Cloud::VmwareEngine::V1::ListNodesResponse.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_nodes_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::VmwareEngine::V1::VmwareEngine::Rest::ServiceStub.stub :transcode_list_nodes_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_nodes_client_stub do + # Create client + client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_nodes({ 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_nodes 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_nodes ::Google::Cloud::VmwareEngine::V1::ListNodesRequest.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_nodes({ 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_nodes(::Google::Cloud::VmwareEngine::V1::ListNodesRequest.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_nodes_client_stub.call_count + end + end + end + + def test_get_node + # Create test objects. + client_result = ::Google::Cloud::VmwareEngine::V1::Node.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_node_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::VmwareEngine::V1::VmwareEngine::Rest::ServiceStub.stub :transcode_get_node_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_node_client_stub do + # Create client + client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_node({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_node name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_node ::Google::Cloud::VmwareEngine::V1::GetNodeRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_node({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_node(::Google::Cloud::VmwareEngine::V1::GetNodeRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_node_client_stub.call_count + end + end + end + + def test_list_external_addresses + # Create test objects. + client_result = ::Google::Cloud::VmwareEngine::V1::ListExternalAddressesResponse.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_external_addresses_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::VmwareEngine::V1::VmwareEngine::Rest::ServiceStub.stub :transcode_list_external_addresses_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_external_addresses_client_stub do + # Create client + client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_external_addresses({ 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_external_addresses 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_external_addresses ::Google::Cloud::VmwareEngine::V1::ListExternalAddressesRequest.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_external_addresses({ 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_external_addresses(::Google::Cloud::VmwareEngine::V1::ListExternalAddressesRequest.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_external_addresses_client_stub.call_count + end + end + end + + def test_fetch_network_policy_external_addresses + # Create test objects. + client_result = ::Google::Cloud::VmwareEngine::V1::FetchNetworkPolicyExternalAddressesResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + network_policy = "hello world" + page_size = 42 + page_token = "hello world" + + fetch_network_policy_external_addresses_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::VmwareEngine::V1::VmwareEngine::Rest::ServiceStub.stub :transcode_fetch_network_policy_external_addresses_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, fetch_network_policy_external_addresses_client_stub do + # Create client + client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.fetch_network_policy_external_addresses({ network_policy: network_policy, page_size: page_size, page_token: page_token }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.fetch_network_policy_external_addresses network_policy: network_policy, page_size: page_size, page_token: page_token do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.fetch_network_policy_external_addresses ::Google::Cloud::VmwareEngine::V1::FetchNetworkPolicyExternalAddressesRequest.new(network_policy: network_policy, 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.fetch_network_policy_external_addresses({ network_policy: network_policy, 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.fetch_network_policy_external_addresses(::Google::Cloud::VmwareEngine::V1::FetchNetworkPolicyExternalAddressesRequest.new(network_policy: network_policy, 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, fetch_network_policy_external_addresses_client_stub.call_count + end + end + end + + def test_get_external_address + # Create test objects. + client_result = ::Google::Cloud::VmwareEngine::V1::ExternalAddress.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_external_address_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::VmwareEngine::V1::VmwareEngine::Rest::ServiceStub.stub :transcode_get_external_address_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_external_address_client_stub do + # Create client + client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_external_address({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_external_address name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_external_address ::Google::Cloud::VmwareEngine::V1::GetExternalAddressRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_external_address({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_external_address(::Google::Cloud::VmwareEngine::V1::GetExternalAddressRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_external_address_client_stub.call_count + end + end + end + + def test_create_external_address + # 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" + external_address = {} + external_address_id = "hello world" + request_id = "hello world" + + create_external_address_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::VmwareEngine::V1::VmwareEngine::Rest::ServiceStub.stub :transcode_create_external_address_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_external_address_client_stub do + # Create client + client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_external_address({ parent: parent, external_address: external_address, external_address_id: external_address_id, request_id: request_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_external_address parent: parent, external_address: external_address, external_address_id: external_address_id, request_id: request_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_external_address ::Google::Cloud::VmwareEngine::V1::CreateExternalAddressRequest.new(parent: parent, external_address: external_address, external_address_id: external_address_id, request_id: request_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_external_address({ parent: parent, external_address: external_address, external_address_id: external_address_id, request_id: request_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_external_address(::Google::Cloud::VmwareEngine::V1::CreateExternalAddressRequest.new(parent: parent, external_address: external_address, external_address_id: external_address_id, request_id: request_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_external_address_client_stub.call_count + end + end + end + + def test_update_external_address + # 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. + update_mask = {} + external_address = {} + request_id = "hello world" + + update_external_address_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::VmwareEngine::V1::VmwareEngine::Rest::ServiceStub.stub :transcode_update_external_address_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_external_address_client_stub do + # Create client + client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_external_address({ update_mask: update_mask, external_address: external_address, request_id: request_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_external_address update_mask: update_mask, external_address: external_address, request_id: request_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_external_address ::Google::Cloud::VmwareEngine::V1::UpdateExternalAddressRequest.new(update_mask: update_mask, external_address: external_address, request_id: request_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_external_address({ update_mask: update_mask, external_address: external_address, request_id: request_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_external_address(::Google::Cloud::VmwareEngine::V1::UpdateExternalAddressRequest.new(update_mask: update_mask, external_address: external_address, request_id: request_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_external_address_client_stub.call_count + end + end + end + + def test_delete_external_address + # 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" + request_id = "hello world" + + delete_external_address_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::VmwareEngine::V1::VmwareEngine::Rest::ServiceStub.stub :transcode_delete_external_address_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_external_address_client_stub do + # Create client + client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_external_address({ name: name, request_id: request_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_external_address name: name, request_id: request_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_external_address ::Google::Cloud::VmwareEngine::V1::DeleteExternalAddressRequest.new(name: name, request_id: request_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_external_address({ name: name, request_id: request_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_external_address(::Google::Cloud::VmwareEngine::V1::DeleteExternalAddressRequest.new(name: name, request_id: request_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_external_address_client_stub.call_count + end + end + end + + def test_list_subnets + # Create test objects. + client_result = ::Google::Cloud::VmwareEngine::V1::ListSubnetsResponse.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_subnets_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::VmwareEngine::V1::VmwareEngine::Rest::ServiceStub.stub :transcode_list_subnets_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_subnets_client_stub do + # Create client + client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_subnets({ 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_subnets 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_subnets ::Google::Cloud::VmwareEngine::V1::ListSubnetsRequest.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_subnets({ 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_subnets(::Google::Cloud::VmwareEngine::V1::ListSubnetsRequest.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_subnets_client_stub.call_count + end + end + end + + def test_get_subnet + # Create test objects. + client_result = ::Google::Cloud::VmwareEngine::V1::Subnet.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_subnet_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::VmwareEngine::V1::VmwareEngine::Rest::ServiceStub.stub :transcode_get_subnet_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_subnet_client_stub do + # Create client + client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_subnet({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_subnet name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_subnet ::Google::Cloud::VmwareEngine::V1::GetSubnetRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_subnet({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_subnet(::Google::Cloud::VmwareEngine::V1::GetSubnetRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_subnet_client_stub.call_count + end + end + end + + def test_update_subnet + # 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. + update_mask = {} + subnet = {} + + update_subnet_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::VmwareEngine::V1::VmwareEngine::Rest::ServiceStub.stub :transcode_update_subnet_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_subnet_client_stub do + # Create client + client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_subnet({ update_mask: update_mask, subnet: subnet }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_subnet update_mask: update_mask, subnet: subnet do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_subnet ::Google::Cloud::VmwareEngine::V1::UpdateSubnetRequest.new(update_mask: update_mask, subnet: subnet) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_subnet({ update_mask: update_mask, subnet: subnet }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_subnet(::Google::Cloud::VmwareEngine::V1::UpdateSubnetRequest.new(update_mask: update_mask, subnet: subnet), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_subnet_client_stub.call_count + end + end + end + + def test_list_external_access_rules + # Create test objects. + client_result = ::Google::Cloud::VmwareEngine::V1::ListExternalAccessRulesResponse.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_external_access_rules_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::VmwareEngine::V1::VmwareEngine::Rest::ServiceStub.stub :transcode_list_external_access_rules_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_external_access_rules_client_stub do + # Create client + client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_external_access_rules({ 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_external_access_rules 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_external_access_rules ::Google::Cloud::VmwareEngine::V1::ListExternalAccessRulesRequest.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_external_access_rules({ 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_external_access_rules(::Google::Cloud::VmwareEngine::V1::ListExternalAccessRulesRequest.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_external_access_rules_client_stub.call_count + end + end + end + + def test_get_external_access_rule + # Create test objects. + client_result = ::Google::Cloud::VmwareEngine::V1::ExternalAccessRule.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_external_access_rule_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::VmwareEngine::V1::VmwareEngine::Rest::ServiceStub.stub :transcode_get_external_access_rule_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_external_access_rule_client_stub do + # Create client + client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_external_access_rule({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_external_access_rule name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_external_access_rule ::Google::Cloud::VmwareEngine::V1::GetExternalAccessRuleRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_external_access_rule({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_external_access_rule(::Google::Cloud::VmwareEngine::V1::GetExternalAccessRuleRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_external_access_rule_client_stub.call_count + end + end + end + + def test_create_external_access_rule + # 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" + external_access_rule = {} + external_access_rule_id = "hello world" + request_id = "hello world" + + create_external_access_rule_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::VmwareEngine::V1::VmwareEngine::Rest::ServiceStub.stub :transcode_create_external_access_rule_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_external_access_rule_client_stub do + # Create client + client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_external_access_rule({ parent: parent, external_access_rule: external_access_rule, external_access_rule_id: external_access_rule_id, request_id: request_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_external_access_rule parent: parent, external_access_rule: external_access_rule, external_access_rule_id: external_access_rule_id, request_id: request_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_external_access_rule ::Google::Cloud::VmwareEngine::V1::CreateExternalAccessRuleRequest.new(parent: parent, external_access_rule: external_access_rule, external_access_rule_id: external_access_rule_id, request_id: request_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_external_access_rule({ parent: parent, external_access_rule: external_access_rule, external_access_rule_id: external_access_rule_id, request_id: request_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_external_access_rule(::Google::Cloud::VmwareEngine::V1::CreateExternalAccessRuleRequest.new(parent: parent, external_access_rule: external_access_rule, external_access_rule_id: external_access_rule_id, request_id: request_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_external_access_rule_client_stub.call_count + end + end + end + + def test_update_external_access_rule + # 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. + update_mask = {} + external_access_rule = {} + request_id = "hello world" + + update_external_access_rule_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::VmwareEngine::V1::VmwareEngine::Rest::ServiceStub.stub :transcode_update_external_access_rule_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_external_access_rule_client_stub do + # Create client + client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_external_access_rule({ update_mask: update_mask, external_access_rule: external_access_rule, request_id: request_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_external_access_rule update_mask: update_mask, external_access_rule: external_access_rule, request_id: request_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_external_access_rule ::Google::Cloud::VmwareEngine::V1::UpdateExternalAccessRuleRequest.new(update_mask: update_mask, external_access_rule: external_access_rule, request_id: request_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_external_access_rule({ update_mask: update_mask, external_access_rule: external_access_rule, request_id: request_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_external_access_rule(::Google::Cloud::VmwareEngine::V1::UpdateExternalAccessRuleRequest.new(update_mask: update_mask, external_access_rule: external_access_rule, request_id: request_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_external_access_rule_client_stub.call_count + end + end + end + + def test_delete_external_access_rule + # 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" + request_id = "hello world" + + delete_external_access_rule_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::VmwareEngine::V1::VmwareEngine::Rest::ServiceStub.stub :transcode_delete_external_access_rule_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_external_access_rule_client_stub do + # Create client + client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_external_access_rule({ name: name, request_id: request_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_external_access_rule name: name, request_id: request_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_external_access_rule ::Google::Cloud::VmwareEngine::V1::DeleteExternalAccessRuleRequest.new(name: name, request_id: request_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_external_access_rule({ name: name, request_id: request_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_external_access_rule(::Google::Cloud::VmwareEngine::V1::DeleteExternalAccessRuleRequest.new(name: name, request_id: request_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_external_access_rule_client_stub.call_count + end + end + end + + def test_list_logging_servers + # Create test objects. + client_result = ::Google::Cloud::VmwareEngine::V1::ListLoggingServersResponse.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_logging_servers_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::VmwareEngine::V1::VmwareEngine::Rest::ServiceStub.stub :transcode_list_logging_servers_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_logging_servers_client_stub do + # Create client + client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_logging_servers({ 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_logging_servers 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_logging_servers ::Google::Cloud::VmwareEngine::V1::ListLoggingServersRequest.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_logging_servers({ 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_logging_servers(::Google::Cloud::VmwareEngine::V1::ListLoggingServersRequest.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_logging_servers_client_stub.call_count + end + end + end + + def test_get_logging_server + # Create test objects. + client_result = ::Google::Cloud::VmwareEngine::V1::LoggingServer.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_logging_server_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::VmwareEngine::V1::VmwareEngine::Rest::ServiceStub.stub :transcode_get_logging_server_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_logging_server_client_stub do + # Create client + client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_logging_server({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_logging_server name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_logging_server ::Google::Cloud::VmwareEngine::V1::GetLoggingServerRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_logging_server({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_logging_server(::Google::Cloud::VmwareEngine::V1::GetLoggingServerRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_logging_server_client_stub.call_count + end + end + end + + def test_create_logging_server + # 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" + logging_server = {} + logging_server_id = "hello world" + request_id = "hello world" + + create_logging_server_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::VmwareEngine::V1::VmwareEngine::Rest::ServiceStub.stub :transcode_create_logging_server_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_logging_server_client_stub do + # Create client + client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_logging_server({ parent: parent, logging_server: logging_server, logging_server_id: logging_server_id, request_id: request_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_logging_server parent: parent, logging_server: logging_server, logging_server_id: logging_server_id, request_id: request_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_logging_server ::Google::Cloud::VmwareEngine::V1::CreateLoggingServerRequest.new(parent: parent, logging_server: logging_server, logging_server_id: logging_server_id, request_id: request_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_logging_server({ parent: parent, logging_server: logging_server, logging_server_id: logging_server_id, request_id: request_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_logging_server(::Google::Cloud::VmwareEngine::V1::CreateLoggingServerRequest.new(parent: parent, logging_server: logging_server, logging_server_id: logging_server_id, request_id: request_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_logging_server_client_stub.call_count + end + end + end + + def test_update_logging_server + # 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. + update_mask = {} + logging_server = {} + request_id = "hello world" + + update_logging_server_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::VmwareEngine::V1::VmwareEngine::Rest::ServiceStub.stub :transcode_update_logging_server_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_logging_server_client_stub do + # Create client + client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_logging_server({ update_mask: update_mask, logging_server: logging_server, request_id: request_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_logging_server update_mask: update_mask, logging_server: logging_server, request_id: request_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_logging_server ::Google::Cloud::VmwareEngine::V1::UpdateLoggingServerRequest.new(update_mask: update_mask, logging_server: logging_server, request_id: request_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_logging_server({ update_mask: update_mask, logging_server: logging_server, request_id: request_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_logging_server(::Google::Cloud::VmwareEngine::V1::UpdateLoggingServerRequest.new(update_mask: update_mask, logging_server: logging_server, request_id: request_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_logging_server_client_stub.call_count + end + end + end + + def test_delete_logging_server + # 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" + request_id = "hello world" + + delete_logging_server_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::VmwareEngine::V1::VmwareEngine::Rest::ServiceStub.stub :transcode_delete_logging_server_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_logging_server_client_stub do + # Create client + client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_logging_server({ name: name, request_id: request_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_logging_server name: name, request_id: request_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_logging_server ::Google::Cloud::VmwareEngine::V1::DeleteLoggingServerRequest.new(name: name, request_id: request_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_logging_server({ name: name, request_id: request_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_logging_server(::Google::Cloud::VmwareEngine::V1::DeleteLoggingServerRequest.new(name: name, request_id: request_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_logging_server_client_stub.call_count + end + end + end + + def test_list_node_types + # Create test objects. + client_result = ::Google::Cloud::VmwareEngine::V1::ListNodeTypesResponse.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_node_types_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::VmwareEngine::V1::VmwareEngine::Rest::ServiceStub.stub :transcode_list_node_types_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_node_types_client_stub do + # Create client + client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_node_types({ 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_node_types 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_node_types ::Google::Cloud::VmwareEngine::V1::ListNodeTypesRequest.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_node_types({ 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_node_types(::Google::Cloud::VmwareEngine::V1::ListNodeTypesRequest.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_node_types_client_stub.call_count + end + end + end + + def test_get_node_type + # Create test objects. + client_result = ::Google::Cloud::VmwareEngine::V1::NodeType.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_node_type_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::VmwareEngine::V1::VmwareEngine::Rest::ServiceStub.stub :transcode_get_node_type_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_node_type_client_stub do + # Create client + client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_node_type({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_node_type name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_node_type ::Google::Cloud::VmwareEngine::V1::GetNodeTypeRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_node_type({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_node_type(::Google::Cloud::VmwareEngine::V1::GetNodeTypeRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_node_type_client_stub.call_count + end + end + end + + def test_show_nsx_credentials + # Create test objects. + client_result = ::Google::Cloud::VmwareEngine::V1::Credentials.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + private_cloud = "hello world" + + show_nsx_credentials_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::VmwareEngine::V1::VmwareEngine::Rest::ServiceStub.stub :transcode_show_nsx_credentials_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, show_nsx_credentials_client_stub do + # Create client + client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.show_nsx_credentials({ private_cloud: private_cloud }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.show_nsx_credentials private_cloud: private_cloud do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.show_nsx_credentials ::Google::Cloud::VmwareEngine::V1::ShowNsxCredentialsRequest.new(private_cloud: private_cloud) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.show_nsx_credentials({ private_cloud: private_cloud }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.show_nsx_credentials(::Google::Cloud::VmwareEngine::V1::ShowNsxCredentialsRequest.new(private_cloud: private_cloud), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, show_nsx_credentials_client_stub.call_count + end + end + end + + def test_show_vcenter_credentials + # Create test objects. + client_result = ::Google::Cloud::VmwareEngine::V1::Credentials.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + private_cloud = "hello world" + username = "hello world" + + show_vcenter_credentials_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::VmwareEngine::V1::VmwareEngine::Rest::ServiceStub.stub :transcode_show_vcenter_credentials_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, show_vcenter_credentials_client_stub do + # Create client + client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.show_vcenter_credentials({ private_cloud: private_cloud, username: username }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.show_vcenter_credentials private_cloud: private_cloud, username: username do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.show_vcenter_credentials ::Google::Cloud::VmwareEngine::V1::ShowVcenterCredentialsRequest.new(private_cloud: private_cloud, username: username) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.show_vcenter_credentials({ private_cloud: private_cloud, username: username }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.show_vcenter_credentials(::Google::Cloud::VmwareEngine::V1::ShowVcenterCredentialsRequest.new(private_cloud: private_cloud, username: username), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, show_vcenter_credentials_client_stub.call_count + end + end + end + + def test_reset_nsx_credentials + # 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. + private_cloud = "hello world" + request_id = "hello world" + + reset_nsx_credentials_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::VmwareEngine::V1::VmwareEngine::Rest::ServiceStub.stub :transcode_reset_nsx_credentials_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, reset_nsx_credentials_client_stub do + # Create client + client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.reset_nsx_credentials({ private_cloud: private_cloud, request_id: request_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.reset_nsx_credentials private_cloud: private_cloud, request_id: request_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.reset_nsx_credentials ::Google::Cloud::VmwareEngine::V1::ResetNsxCredentialsRequest.new(private_cloud: private_cloud, request_id: request_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.reset_nsx_credentials({ private_cloud: private_cloud, request_id: request_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.reset_nsx_credentials(::Google::Cloud::VmwareEngine::V1::ResetNsxCredentialsRequest.new(private_cloud: private_cloud, request_id: request_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, reset_nsx_credentials_client_stub.call_count + end + end + end + + def test_reset_vcenter_credentials + # 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. + private_cloud = "hello world" + request_id = "hello world" + username = "hello world" + + reset_vcenter_credentials_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::VmwareEngine::V1::VmwareEngine::Rest::ServiceStub.stub :transcode_reset_vcenter_credentials_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, reset_vcenter_credentials_client_stub do + # Create client + client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.reset_vcenter_credentials({ private_cloud: private_cloud, request_id: request_id, username: username }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.reset_vcenter_credentials private_cloud: private_cloud, request_id: request_id, username: username do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.reset_vcenter_credentials ::Google::Cloud::VmwareEngine::V1::ResetVcenterCredentialsRequest.new(private_cloud: private_cloud, request_id: request_id, username: username) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.reset_vcenter_credentials({ private_cloud: private_cloud, request_id: request_id, username: username }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.reset_vcenter_credentials(::Google::Cloud::VmwareEngine::V1::ResetVcenterCredentialsRequest.new(private_cloud: private_cloud, request_id: request_id, username: username), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, reset_vcenter_credentials_client_stub.call_count + end + end + end + + def test_get_dns_forwarding + # Create test objects. + client_result = ::Google::Cloud::VmwareEngine::V1::DnsForwarding.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_dns_forwarding_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::VmwareEngine::V1::VmwareEngine::Rest::ServiceStub.stub :transcode_get_dns_forwarding_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_dns_forwarding_client_stub do + # Create client + client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_dns_forwarding({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_dns_forwarding name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_dns_forwarding ::Google::Cloud::VmwareEngine::V1::GetDnsForwardingRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_dns_forwarding({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_dns_forwarding(::Google::Cloud::VmwareEngine::V1::GetDnsForwardingRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_dns_forwarding_client_stub.call_count + end + end + end + + def test_update_dns_forwarding + # 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. + dns_forwarding = {} + update_mask = {} + request_id = "hello world" + + update_dns_forwarding_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::VmwareEngine::V1::VmwareEngine::Rest::ServiceStub.stub :transcode_update_dns_forwarding_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_dns_forwarding_client_stub do + # Create client + client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_dns_forwarding({ dns_forwarding: dns_forwarding, update_mask: update_mask, request_id: request_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_dns_forwarding dns_forwarding: dns_forwarding, update_mask: update_mask, request_id: request_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_dns_forwarding ::Google::Cloud::VmwareEngine::V1::UpdateDnsForwardingRequest.new(dns_forwarding: dns_forwarding, update_mask: update_mask, request_id: request_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_dns_forwarding({ dns_forwarding: dns_forwarding, update_mask: update_mask, request_id: request_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_dns_forwarding(::Google::Cloud::VmwareEngine::V1::UpdateDnsForwardingRequest.new(dns_forwarding: dns_forwarding, update_mask: update_mask, request_id: request_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_dns_forwarding_client_stub.call_count + end + end + end + + def test_get_network_peering + # Create test objects. + client_result = ::Google::Cloud::VmwareEngine::V1::NetworkPeering.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_network_peering_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::VmwareEngine::V1::VmwareEngine::Rest::ServiceStub.stub :transcode_get_network_peering_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_network_peering_client_stub do + # Create client + client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_network_peering({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_network_peering name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_network_peering ::Google::Cloud::VmwareEngine::V1::GetNetworkPeeringRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_network_peering({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_network_peering(::Google::Cloud::VmwareEngine::V1::GetNetworkPeeringRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_network_peering_client_stub.call_count + end + end + end + + def test_list_network_peerings + # Create test objects. + client_result = ::Google::Cloud::VmwareEngine::V1::ListNetworkPeeringsResponse.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_network_peerings_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::VmwareEngine::V1::VmwareEngine::Rest::ServiceStub.stub :transcode_list_network_peerings_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_network_peerings_client_stub do + # Create client + client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_network_peerings({ 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_network_peerings 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_network_peerings ::Google::Cloud::VmwareEngine::V1::ListNetworkPeeringsRequest.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_network_peerings({ 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_network_peerings(::Google::Cloud::VmwareEngine::V1::ListNetworkPeeringsRequest.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_network_peerings_client_stub.call_count + end + end + end + + def test_create_network_peering + # 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" + network_peering_id = "hello world" + network_peering = {} + request_id = "hello world" + + create_network_peering_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::VmwareEngine::V1::VmwareEngine::Rest::ServiceStub.stub :transcode_create_network_peering_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_network_peering_client_stub do + # Create client + client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_network_peering({ parent: parent, network_peering_id: network_peering_id, network_peering: network_peering, request_id: request_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_network_peering parent: parent, network_peering_id: network_peering_id, network_peering: network_peering, request_id: request_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_network_peering ::Google::Cloud::VmwareEngine::V1::CreateNetworkPeeringRequest.new(parent: parent, network_peering_id: network_peering_id, network_peering: network_peering, request_id: request_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_network_peering({ parent: parent, network_peering_id: network_peering_id, network_peering: network_peering, request_id: request_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_network_peering(::Google::Cloud::VmwareEngine::V1::CreateNetworkPeeringRequest.new(parent: parent, network_peering_id: network_peering_id, network_peering: network_peering, request_id: request_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_network_peering_client_stub.call_count + end + end + end + + def test_delete_network_peering + # 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" + request_id = "hello world" + + delete_network_peering_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::VmwareEngine::V1::VmwareEngine::Rest::ServiceStub.stub :transcode_delete_network_peering_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_network_peering_client_stub do + # Create client + client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_network_peering({ name: name, request_id: request_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_network_peering name: name, request_id: request_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_network_peering ::Google::Cloud::VmwareEngine::V1::DeleteNetworkPeeringRequest.new(name: name, request_id: request_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_network_peering({ name: name, request_id: request_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_network_peering(::Google::Cloud::VmwareEngine::V1::DeleteNetworkPeeringRequest.new(name: name, request_id: request_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_network_peering_client_stub.call_count + end + end + end + + def test_update_network_peering + # 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. + network_peering = {} + update_mask = {} + request_id = "hello world" + + update_network_peering_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::VmwareEngine::V1::VmwareEngine::Rest::ServiceStub.stub :transcode_update_network_peering_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_network_peering_client_stub do + # Create client + client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_network_peering({ network_peering: network_peering, update_mask: update_mask, request_id: request_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_network_peering network_peering: network_peering, update_mask: update_mask, request_id: request_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_network_peering ::Google::Cloud::VmwareEngine::V1::UpdateNetworkPeeringRequest.new(network_peering: network_peering, update_mask: update_mask, request_id: request_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_network_peering({ network_peering: network_peering, update_mask: update_mask, request_id: request_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_network_peering(::Google::Cloud::VmwareEngine::V1::UpdateNetworkPeeringRequest.new(network_peering: network_peering, update_mask: update_mask, request_id: request_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_network_peering_client_stub.call_count + end + end + end + + def test_list_peering_routes + # Create test objects. + client_result = ::Google::Cloud::VmwareEngine::V1::ListPeeringRoutesResponse.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_peering_routes_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::VmwareEngine::V1::VmwareEngine::Rest::ServiceStub.stub :transcode_list_peering_routes_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_peering_routes_client_stub do + # Create client + client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_peering_routes({ 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_peering_routes 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_peering_routes ::Google::Cloud::VmwareEngine::V1::ListPeeringRoutesRequest.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_peering_routes({ 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_peering_routes(::Google::Cloud::VmwareEngine::V1::ListPeeringRoutesRequest.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_peering_routes_client_stub.call_count + end + end + end + + def test_create_hcx_activation_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. + parent = "hello world" + hcx_activation_key = {} + hcx_activation_key_id = "hello world" + request_id = "hello world" + + create_hcx_activation_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::VmwareEngine::V1::VmwareEngine::Rest::ServiceStub.stub :transcode_create_hcx_activation_key_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_hcx_activation_key_client_stub do + # Create client + client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_hcx_activation_key({ parent: parent, hcx_activation_key: hcx_activation_key, hcx_activation_key_id: hcx_activation_key_id, request_id: request_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_hcx_activation_key parent: parent, hcx_activation_key: hcx_activation_key, hcx_activation_key_id: hcx_activation_key_id, request_id: request_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_hcx_activation_key ::Google::Cloud::VmwareEngine::V1::CreateHcxActivationKeyRequest.new(parent: parent, hcx_activation_key: hcx_activation_key, hcx_activation_key_id: hcx_activation_key_id, request_id: request_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_hcx_activation_key({ parent: parent, hcx_activation_key: hcx_activation_key, hcx_activation_key_id: hcx_activation_key_id, request_id: request_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_hcx_activation_key(::Google::Cloud::VmwareEngine::V1::CreateHcxActivationKeyRequest.new(parent: parent, hcx_activation_key: hcx_activation_key, hcx_activation_key_id: hcx_activation_key_id, request_id: request_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_hcx_activation_key_client_stub.call_count + end + end + end + + def test_list_hcx_activation_keys + # Create test objects. + client_result = ::Google::Cloud::VmwareEngine::V1::ListHcxActivationKeysResponse.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_hcx_activation_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::VmwareEngine::V1::VmwareEngine::Rest::ServiceStub.stub :transcode_list_hcx_activation_keys_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_hcx_activation_keys_client_stub do + # Create client + client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_hcx_activation_keys({ 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_hcx_activation_keys 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_hcx_activation_keys ::Google::Cloud::VmwareEngine::V1::ListHcxActivationKeysRequest.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_hcx_activation_keys({ 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_hcx_activation_keys(::Google::Cloud::VmwareEngine::V1::ListHcxActivationKeysRequest.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_hcx_activation_keys_client_stub.call_count + end + end + end + + def test_get_hcx_activation_key + # Create test objects. + client_result = ::Google::Cloud::VmwareEngine::V1::HcxActivationKey.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_hcx_activation_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::VmwareEngine::V1::VmwareEngine::Rest::ServiceStub.stub :transcode_get_hcx_activation_key_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_hcx_activation_key_client_stub do + # Create client + client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_hcx_activation_key({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_hcx_activation_key name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_hcx_activation_key ::Google::Cloud::VmwareEngine::V1::GetHcxActivationKeyRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_hcx_activation_key({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_hcx_activation_key(::Google::Cloud::VmwareEngine::V1::GetHcxActivationKeyRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_hcx_activation_key_client_stub.call_count + end + end + end + + def test_get_network_policy + # Create test objects. + client_result = ::Google::Cloud::VmwareEngine::V1::NetworkPolicy.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_network_policy_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::VmwareEngine::V1::VmwareEngine::Rest::ServiceStub.stub :transcode_get_network_policy_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_network_policy_client_stub do + # Create client + client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_network_policy({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_network_policy name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_network_policy ::Google::Cloud::VmwareEngine::V1::GetNetworkPolicyRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_network_policy({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_network_policy(::Google::Cloud::VmwareEngine::V1::GetNetworkPolicyRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_network_policy_client_stub.call_count + end + end + end + + def test_list_network_policies + # Create test objects. + client_result = ::Google::Cloud::VmwareEngine::V1::ListNetworkPoliciesResponse.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_network_policies_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::VmwareEngine::V1::VmwareEngine::Rest::ServiceStub.stub :transcode_list_network_policies_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_network_policies_client_stub do + # Create client + client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_network_policies({ 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_network_policies 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_network_policies ::Google::Cloud::VmwareEngine::V1::ListNetworkPoliciesRequest.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_network_policies({ 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_network_policies(::Google::Cloud::VmwareEngine::V1::ListNetworkPoliciesRequest.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_network_policies_client_stub.call_count + end + end + end + + def test_create_network_policy + # 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" + network_policy_id = "hello world" + network_policy = {} + request_id = "hello world" + + create_network_policy_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::VmwareEngine::V1::VmwareEngine::Rest::ServiceStub.stub :transcode_create_network_policy_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_network_policy_client_stub do + # Create client + client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_network_policy({ parent: parent, network_policy_id: network_policy_id, network_policy: network_policy, request_id: request_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_network_policy parent: parent, network_policy_id: network_policy_id, network_policy: network_policy, request_id: request_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_network_policy ::Google::Cloud::VmwareEngine::V1::CreateNetworkPolicyRequest.new(parent: parent, network_policy_id: network_policy_id, network_policy: network_policy, request_id: request_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_network_policy({ parent: parent, network_policy_id: network_policy_id, network_policy: network_policy, request_id: request_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_network_policy(::Google::Cloud::VmwareEngine::V1::CreateNetworkPolicyRequest.new(parent: parent, network_policy_id: network_policy_id, network_policy: network_policy, request_id: request_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_network_policy_client_stub.call_count + end + end + end + + def test_update_network_policy + # 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. + network_policy = {} + update_mask = {} + request_id = "hello world" + + update_network_policy_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::VmwareEngine::V1::VmwareEngine::Rest::ServiceStub.stub :transcode_update_network_policy_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_network_policy_client_stub do + # Create client + client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_network_policy({ network_policy: network_policy, update_mask: update_mask, request_id: request_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_network_policy network_policy: network_policy, update_mask: update_mask, request_id: request_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_network_policy ::Google::Cloud::VmwareEngine::V1::UpdateNetworkPolicyRequest.new(network_policy: network_policy, update_mask: update_mask, request_id: request_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_network_policy({ network_policy: network_policy, update_mask: update_mask, request_id: request_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_network_policy(::Google::Cloud::VmwareEngine::V1::UpdateNetworkPolicyRequest.new(network_policy: network_policy, update_mask: update_mask, request_id: request_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_network_policy_client_stub.call_count + end + end + end + + def test_delete_network_policy + # 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" + request_id = "hello world" + + delete_network_policy_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::VmwareEngine::V1::VmwareEngine::Rest::ServiceStub.stub :transcode_delete_network_policy_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_network_policy_client_stub do + # Create client + client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_network_policy({ name: name, request_id: request_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_network_policy name: name, request_id: request_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_network_policy ::Google::Cloud::VmwareEngine::V1::DeleteNetworkPolicyRequest.new(name: name, request_id: request_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_network_policy({ name: name, request_id: request_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_network_policy(::Google::Cloud::VmwareEngine::V1::DeleteNetworkPolicyRequest.new(name: name, request_id: request_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_network_policy_client_stub.call_count + end + end + end + + def test_list_management_dns_zone_bindings + # Create test objects. + client_result = ::Google::Cloud::VmwareEngine::V1::ListManagementDnsZoneBindingsResponse.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_management_dns_zone_bindings_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::VmwareEngine::V1::VmwareEngine::Rest::ServiceStub.stub :transcode_list_management_dns_zone_bindings_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_management_dns_zone_bindings_client_stub do + # Create client + client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_management_dns_zone_bindings({ 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_management_dns_zone_bindings 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_management_dns_zone_bindings ::Google::Cloud::VmwareEngine::V1::ListManagementDnsZoneBindingsRequest.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_management_dns_zone_bindings({ 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_management_dns_zone_bindings(::Google::Cloud::VmwareEngine::V1::ListManagementDnsZoneBindingsRequest.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_management_dns_zone_bindings_client_stub.call_count + end + end + end + + def test_get_management_dns_zone_binding + # Create test objects. + client_result = ::Google::Cloud::VmwareEngine::V1::ManagementDnsZoneBinding.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_management_dns_zone_binding_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::VmwareEngine::V1::VmwareEngine::Rest::ServiceStub.stub :transcode_get_management_dns_zone_binding_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_management_dns_zone_binding_client_stub do + # Create client + client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_management_dns_zone_binding({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_management_dns_zone_binding name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_management_dns_zone_binding ::Google::Cloud::VmwareEngine::V1::GetManagementDnsZoneBindingRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_management_dns_zone_binding({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_management_dns_zone_binding(::Google::Cloud::VmwareEngine::V1::GetManagementDnsZoneBindingRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_management_dns_zone_binding_client_stub.call_count + end + end + end + + def test_create_management_dns_zone_binding + # 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" + management_dns_zone_binding = {} + management_dns_zone_binding_id = "hello world" + request_id = "hello world" + + create_management_dns_zone_binding_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::VmwareEngine::V1::VmwareEngine::Rest::ServiceStub.stub :transcode_create_management_dns_zone_binding_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_management_dns_zone_binding_client_stub do + # Create client + client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_management_dns_zone_binding({ parent: parent, management_dns_zone_binding: management_dns_zone_binding, management_dns_zone_binding_id: management_dns_zone_binding_id, request_id: request_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_management_dns_zone_binding parent: parent, management_dns_zone_binding: management_dns_zone_binding, management_dns_zone_binding_id: management_dns_zone_binding_id, request_id: request_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_management_dns_zone_binding ::Google::Cloud::VmwareEngine::V1::CreateManagementDnsZoneBindingRequest.new(parent: parent, management_dns_zone_binding: management_dns_zone_binding, management_dns_zone_binding_id: management_dns_zone_binding_id, request_id: request_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_management_dns_zone_binding({ parent: parent, management_dns_zone_binding: management_dns_zone_binding, management_dns_zone_binding_id: management_dns_zone_binding_id, request_id: request_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_management_dns_zone_binding(::Google::Cloud::VmwareEngine::V1::CreateManagementDnsZoneBindingRequest.new(parent: parent, management_dns_zone_binding: management_dns_zone_binding, management_dns_zone_binding_id: management_dns_zone_binding_id, request_id: request_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_management_dns_zone_binding_client_stub.call_count + end + end + end + + def test_update_management_dns_zone_binding + # 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. + update_mask = {} + management_dns_zone_binding = {} + request_id = "hello world" + + update_management_dns_zone_binding_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::VmwareEngine::V1::VmwareEngine::Rest::ServiceStub.stub :transcode_update_management_dns_zone_binding_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_management_dns_zone_binding_client_stub do + # Create client + client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_management_dns_zone_binding({ update_mask: update_mask, management_dns_zone_binding: management_dns_zone_binding, request_id: request_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_management_dns_zone_binding update_mask: update_mask, management_dns_zone_binding: management_dns_zone_binding, request_id: request_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_management_dns_zone_binding ::Google::Cloud::VmwareEngine::V1::UpdateManagementDnsZoneBindingRequest.new(update_mask: update_mask, management_dns_zone_binding: management_dns_zone_binding, request_id: request_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_management_dns_zone_binding({ update_mask: update_mask, management_dns_zone_binding: management_dns_zone_binding, request_id: request_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_management_dns_zone_binding(::Google::Cloud::VmwareEngine::V1::UpdateManagementDnsZoneBindingRequest.new(update_mask: update_mask, management_dns_zone_binding: management_dns_zone_binding, request_id: request_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_management_dns_zone_binding_client_stub.call_count + end + end + end + + def test_delete_management_dns_zone_binding + # 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" + request_id = "hello world" + + delete_management_dns_zone_binding_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::VmwareEngine::V1::VmwareEngine::Rest::ServiceStub.stub :transcode_delete_management_dns_zone_binding_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_management_dns_zone_binding_client_stub do + # Create client + client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_management_dns_zone_binding({ name: name, request_id: request_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_management_dns_zone_binding name: name, request_id: request_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_management_dns_zone_binding ::Google::Cloud::VmwareEngine::V1::DeleteManagementDnsZoneBindingRequest.new(name: name, request_id: request_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_management_dns_zone_binding({ name: name, request_id: request_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_management_dns_zone_binding(::Google::Cloud::VmwareEngine::V1::DeleteManagementDnsZoneBindingRequest.new(name: name, request_id: request_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_management_dns_zone_binding_client_stub.call_count + end + end + end + + def test_repair_management_dns_zone_binding + # 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" + request_id = "hello world" + + repair_management_dns_zone_binding_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::VmwareEngine::V1::VmwareEngine::Rest::ServiceStub.stub :transcode_repair_management_dns_zone_binding_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, repair_management_dns_zone_binding_client_stub do + # Create client + client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.repair_management_dns_zone_binding({ name: name, request_id: request_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.repair_management_dns_zone_binding name: name, request_id: request_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.repair_management_dns_zone_binding ::Google::Cloud::VmwareEngine::V1::RepairManagementDnsZoneBindingRequest.new(name: name, request_id: request_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.repair_management_dns_zone_binding({ name: name, request_id: request_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.repair_management_dns_zone_binding(::Google::Cloud::VmwareEngine::V1::RepairManagementDnsZoneBindingRequest.new(name: name, request_id: request_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, repair_management_dns_zone_binding_client_stub.call_count + end + end + end + + def test_create_vmware_engine_network + # 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" + vmware_engine_network_id = "hello world" + vmware_engine_network = {} + request_id = "hello world" + + create_vmware_engine_network_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::VmwareEngine::V1::VmwareEngine::Rest::ServiceStub.stub :transcode_create_vmware_engine_network_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_vmware_engine_network_client_stub do + # Create client + client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_vmware_engine_network({ parent: parent, vmware_engine_network_id: vmware_engine_network_id, vmware_engine_network: vmware_engine_network, request_id: request_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_vmware_engine_network parent: parent, vmware_engine_network_id: vmware_engine_network_id, vmware_engine_network: vmware_engine_network, request_id: request_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_vmware_engine_network ::Google::Cloud::VmwareEngine::V1::CreateVmwareEngineNetworkRequest.new(parent: parent, vmware_engine_network_id: vmware_engine_network_id, vmware_engine_network: vmware_engine_network, request_id: request_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_vmware_engine_network({ parent: parent, vmware_engine_network_id: vmware_engine_network_id, vmware_engine_network: vmware_engine_network, request_id: request_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_vmware_engine_network(::Google::Cloud::VmwareEngine::V1::CreateVmwareEngineNetworkRequest.new(parent: parent, vmware_engine_network_id: vmware_engine_network_id, vmware_engine_network: vmware_engine_network, request_id: request_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_vmware_engine_network_client_stub.call_count + end + end + end + + def test_update_vmware_engine_network + # 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. + vmware_engine_network = {} + update_mask = {} + request_id = "hello world" + + update_vmware_engine_network_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::VmwareEngine::V1::VmwareEngine::Rest::ServiceStub.stub :transcode_update_vmware_engine_network_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_vmware_engine_network_client_stub do + # Create client + client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_vmware_engine_network({ vmware_engine_network: vmware_engine_network, update_mask: update_mask, request_id: request_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_vmware_engine_network vmware_engine_network: vmware_engine_network, update_mask: update_mask, request_id: request_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_vmware_engine_network ::Google::Cloud::VmwareEngine::V1::UpdateVmwareEngineNetworkRequest.new(vmware_engine_network: vmware_engine_network, update_mask: update_mask, request_id: request_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_vmware_engine_network({ vmware_engine_network: vmware_engine_network, update_mask: update_mask, request_id: request_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_vmware_engine_network(::Google::Cloud::VmwareEngine::V1::UpdateVmwareEngineNetworkRequest.new(vmware_engine_network: vmware_engine_network, update_mask: update_mask, request_id: request_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_vmware_engine_network_client_stub.call_count + end + end + end + + def test_delete_vmware_engine_network + # 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" + request_id = "hello world" + etag = "hello world" + + delete_vmware_engine_network_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::VmwareEngine::V1::VmwareEngine::Rest::ServiceStub.stub :transcode_delete_vmware_engine_network_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_vmware_engine_network_client_stub do + # Create client + client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_vmware_engine_network({ name: name, request_id: request_id, etag: etag }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_vmware_engine_network name: name, request_id: request_id, etag: etag do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_vmware_engine_network ::Google::Cloud::VmwareEngine::V1::DeleteVmwareEngineNetworkRequest.new(name: name, request_id: request_id, etag: etag) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_vmware_engine_network({ name: name, request_id: request_id, etag: etag }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_vmware_engine_network(::Google::Cloud::VmwareEngine::V1::DeleteVmwareEngineNetworkRequest.new(name: name, request_id: request_id, etag: etag), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_vmware_engine_network_client_stub.call_count + end + end + end + + def test_get_vmware_engine_network + # Create test objects. + client_result = ::Google::Cloud::VmwareEngine::V1::VmwareEngineNetwork.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_vmware_engine_network_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::VmwareEngine::V1::VmwareEngine::Rest::ServiceStub.stub :transcode_get_vmware_engine_network_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_vmware_engine_network_client_stub do + # Create client + client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_vmware_engine_network({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_vmware_engine_network name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_vmware_engine_network ::Google::Cloud::VmwareEngine::V1::GetVmwareEngineNetworkRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_vmware_engine_network({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_vmware_engine_network(::Google::Cloud::VmwareEngine::V1::GetVmwareEngineNetworkRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_vmware_engine_network_client_stub.call_count + end + end + end + + def test_list_vmware_engine_networks + # Create test objects. + client_result = ::Google::Cloud::VmwareEngine::V1::ListVmwareEngineNetworksResponse.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_vmware_engine_networks_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::VmwareEngine::V1::VmwareEngine::Rest::ServiceStub.stub :transcode_list_vmware_engine_networks_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_vmware_engine_networks_client_stub do + # Create client + client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_vmware_engine_networks({ 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_vmware_engine_networks 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_vmware_engine_networks ::Google::Cloud::VmwareEngine::V1::ListVmwareEngineNetworksRequest.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_vmware_engine_networks({ 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_vmware_engine_networks(::Google::Cloud::VmwareEngine::V1::ListVmwareEngineNetworksRequest.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_vmware_engine_networks_client_stub.call_count + end + end + end + + def test_create_private_connection + # 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" + private_connection_id = "hello world" + private_connection = {} + request_id = "hello world" + + create_private_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::VmwareEngine::V1::VmwareEngine::Rest::ServiceStub.stub :transcode_create_private_connection_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_private_connection_client_stub do + # Create client + client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_private_connection({ parent: parent, private_connection_id: private_connection_id, private_connection: private_connection, request_id: request_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_private_connection parent: parent, private_connection_id: private_connection_id, private_connection: private_connection, request_id: request_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_private_connection ::Google::Cloud::VmwareEngine::V1::CreatePrivateConnectionRequest.new(parent: parent, private_connection_id: private_connection_id, private_connection: private_connection, request_id: request_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_private_connection({ parent: parent, private_connection_id: private_connection_id, private_connection: private_connection, request_id: request_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_private_connection(::Google::Cloud::VmwareEngine::V1::CreatePrivateConnectionRequest.new(parent: parent, private_connection_id: private_connection_id, private_connection: private_connection, request_id: request_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_private_connection_client_stub.call_count + end + end + end + + def test_get_private_connection + # Create test objects. + client_result = ::Google::Cloud::VmwareEngine::V1::PrivateConnection.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_private_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::VmwareEngine::V1::VmwareEngine::Rest::ServiceStub.stub :transcode_get_private_connection_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_private_connection_client_stub do + # Create client + client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_private_connection({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_private_connection name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_private_connection ::Google::Cloud::VmwareEngine::V1::GetPrivateConnectionRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_private_connection({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_private_connection(::Google::Cloud::VmwareEngine::V1::GetPrivateConnectionRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_private_connection_client_stub.call_count + end + end + end + + def test_list_private_connections + # Create test objects. + client_result = ::Google::Cloud::VmwareEngine::V1::ListPrivateConnectionsResponse.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_private_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::VmwareEngine::V1::VmwareEngine::Rest::ServiceStub.stub :transcode_list_private_connections_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_private_connections_client_stub do + # Create client + client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_private_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_private_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_private_connections ::Google::Cloud::VmwareEngine::V1::ListPrivateConnectionsRequest.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_private_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_private_connections(::Google::Cloud::VmwareEngine::V1::ListPrivateConnectionsRequest.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_private_connections_client_stub.call_count + end + end + end + + def test_update_private_connection + # 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. + private_connection = {} + update_mask = {} + request_id = "hello world" + + update_private_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::VmwareEngine::V1::VmwareEngine::Rest::ServiceStub.stub :transcode_update_private_connection_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_private_connection_client_stub do + # Create client + client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_private_connection({ private_connection: private_connection, update_mask: update_mask, request_id: request_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_private_connection private_connection: private_connection, update_mask: update_mask, request_id: request_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_private_connection ::Google::Cloud::VmwareEngine::V1::UpdatePrivateConnectionRequest.new(private_connection: private_connection, update_mask: update_mask, request_id: request_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_private_connection({ private_connection: private_connection, update_mask: update_mask, request_id: request_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_private_connection(::Google::Cloud::VmwareEngine::V1::UpdatePrivateConnectionRequest.new(private_connection: private_connection, update_mask: update_mask, request_id: request_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_private_connection_client_stub.call_count + end + end + end + + def test_delete_private_connection + # 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" + request_id = "hello world" + + delete_private_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::VmwareEngine::V1::VmwareEngine::Rest::ServiceStub.stub :transcode_delete_private_connection_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_private_connection_client_stub do + # Create client + client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_private_connection({ name: name, request_id: request_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_private_connection name: name, request_id: request_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_private_connection ::Google::Cloud::VmwareEngine::V1::DeletePrivateConnectionRequest.new(name: name, request_id: request_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_private_connection({ name: name, request_id: request_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_private_connection(::Google::Cloud::VmwareEngine::V1::DeletePrivateConnectionRequest.new(name: name, request_id: request_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_private_connection_client_stub.call_count + end + end + end + + def test_list_private_connection_peering_routes + # Create test objects. + client_result = ::Google::Cloud::VmwareEngine::V1::ListPrivateConnectionPeeringRoutesResponse.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_private_connection_peering_routes_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::VmwareEngine::V1::VmwareEngine::Rest::ServiceStub.stub :transcode_list_private_connection_peering_routes_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_private_connection_peering_routes_client_stub do + # Create client + client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_private_connection_peering_routes({ 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_private_connection_peering_routes 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_private_connection_peering_routes ::Google::Cloud::VmwareEngine::V1::ListPrivateConnectionPeeringRoutesRequest.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_private_connection_peering_routes({ 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_private_connection_peering_routes(::Google::Cloud::VmwareEngine::V1::ListPrivateConnectionPeeringRoutesRequest.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_private_connection_peering_routes_client_stub.call_count + end + end + end + + def test_grant_dns_bind_permission + # 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" + principal = {} + request_id = "hello world" + + grant_dns_bind_permission_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::VmwareEngine::V1::VmwareEngine::Rest::ServiceStub.stub :transcode_grant_dns_bind_permission_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, grant_dns_bind_permission_client_stub do + # Create client + client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.grant_dns_bind_permission({ name: name, principal: principal, request_id: request_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.grant_dns_bind_permission name: name, principal: principal, request_id: request_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.grant_dns_bind_permission ::Google::Cloud::VmwareEngine::V1::GrantDnsBindPermissionRequest.new(name: name, principal: principal, request_id: request_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.grant_dns_bind_permission({ name: name, principal: principal, request_id: request_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.grant_dns_bind_permission(::Google::Cloud::VmwareEngine::V1::GrantDnsBindPermissionRequest.new(name: name, principal: principal, request_id: request_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, grant_dns_bind_permission_client_stub.call_count + end + end + end + + def test_get_dns_bind_permission + # Create test objects. + client_result = ::Google::Cloud::VmwareEngine::V1::DnsBindPermission.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_dns_bind_permission_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::VmwareEngine::V1::VmwareEngine::Rest::ServiceStub.stub :transcode_get_dns_bind_permission_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_dns_bind_permission_client_stub do + # Create client + client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_dns_bind_permission({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_dns_bind_permission name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_dns_bind_permission ::Google::Cloud::VmwareEngine::V1::GetDnsBindPermissionRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_dns_bind_permission({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_dns_bind_permission(::Google::Cloud::VmwareEngine::V1::GetDnsBindPermissionRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_dns_bind_permission_client_stub.call_count + end + end + end + + def test_revoke_dns_bind_permission + # 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" + principal = {} + request_id = "hello world" + + revoke_dns_bind_permission_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::VmwareEngine::V1::VmwareEngine::Rest::ServiceStub.stub :transcode_revoke_dns_bind_permission_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, revoke_dns_bind_permission_client_stub do + # Create client + client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.revoke_dns_bind_permission({ name: name, principal: principal, request_id: request_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.revoke_dns_bind_permission name: name, principal: principal, request_id: request_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.revoke_dns_bind_permission ::Google::Cloud::VmwareEngine::V1::RevokeDnsBindPermissionRequest.new(name: name, principal: principal, request_id: request_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.revoke_dns_bind_permission({ name: name, principal: principal, request_id: request_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.revoke_dns_bind_permission(::Google::Cloud::VmwareEngine::V1::RevokeDnsBindPermissionRequest.new(name: name, principal: principal, request_id: request_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, revoke_dns_bind_permission_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::VmwareEngine::V1::VmwareEngine::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::VmwareEngine::V1::VmwareEngine::Rest::Client::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-vmware_engine-v1/test/google/cloud/vmware_engine/v1/vmware_engine_test.rb b/owl-bot-staging/google-cloud-vmware_engine-v1/test/google/cloud/vmware_engine/v1/vmware_engine_test.rb new file mode 100644 index 000000000000..354662f546d4 --- /dev/null +++ b/owl-bot-staging/google-cloud-vmware_engine-v1/test/google/cloud/vmware_engine/v1/vmware_engine_test.rb @@ -0,0 +1,4967 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/vmwareengine/v1/vmwareengine_pb" +require "google/cloud/vmware_engine/v1/vmware_engine" + +class ::Google::Cloud::VmwareEngine::V1::VmwareEngine::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_private_clouds + # Create GRPC objects. + grpc_response = ::Google::Cloud::VmwareEngine::V1::ListPrivateCloudsResponse.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_private_clouds_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_private_clouds, name + assert_kind_of ::Google::Cloud::VmwareEngine::V1::ListPrivateCloudsRequest, 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_private_clouds_client_stub do + # Create client + client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_private_clouds({ 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_private_clouds 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_private_clouds ::Google::Cloud::VmwareEngine::V1::ListPrivateCloudsRequest.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_private_clouds({ 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_private_clouds(::Google::Cloud::VmwareEngine::V1::ListPrivateCloudsRequest.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_private_clouds_client_stub.call_rpc_count + end + end + + def test_get_private_cloud + # Create GRPC objects. + grpc_response = ::Google::Cloud::VmwareEngine::V1::PrivateCloud.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_private_cloud_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_private_cloud, name + assert_kind_of ::Google::Cloud::VmwareEngine::V1::GetPrivateCloudRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_private_cloud_client_stub do + # Create client + client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_private_cloud({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_private_cloud name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_private_cloud ::Google::Cloud::VmwareEngine::V1::GetPrivateCloudRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_private_cloud({ 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_private_cloud(::Google::Cloud::VmwareEngine::V1::GetPrivateCloudRequest.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_private_cloud_client_stub.call_rpc_count + end + end + + def test_create_private_cloud + # 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" + private_cloud_id = "hello world" + private_cloud = {} + request_id = "hello world" + validate_only = true + + create_private_cloud_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_private_cloud, name + assert_kind_of ::Google::Cloud::VmwareEngine::V1::CreatePrivateCloudRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["private_cloud_id"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::VmwareEngine::V1::PrivateCloud), request["private_cloud"] + assert_equal "hello world", request["request_id"] + assert_equal true, request["validate_only"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_private_cloud_client_stub do + # Create client + client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_private_cloud({ parent: parent, private_cloud_id: private_cloud_id, private_cloud: private_cloud, request_id: request_id, validate_only: validate_only }) 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_private_cloud parent: parent, private_cloud_id: private_cloud_id, private_cloud: private_cloud, request_id: request_id, validate_only: validate_only 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_private_cloud ::Google::Cloud::VmwareEngine::V1::CreatePrivateCloudRequest.new(parent: parent, private_cloud_id: private_cloud_id, private_cloud: private_cloud, request_id: request_id, validate_only: validate_only) 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_private_cloud({ parent: parent, private_cloud_id: private_cloud_id, private_cloud: private_cloud, request_id: request_id, validate_only: validate_only }, 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_private_cloud(::Google::Cloud::VmwareEngine::V1::CreatePrivateCloudRequest.new(parent: parent, private_cloud_id: private_cloud_id, private_cloud: private_cloud, request_id: request_id, validate_only: validate_only), 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_private_cloud_client_stub.call_rpc_count + end + end + + def test_update_private_cloud + # 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. + private_cloud = {} + update_mask = {} + request_id = "hello world" + + update_private_cloud_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_private_cloud, name + assert_kind_of ::Google::Cloud::VmwareEngine::V1::UpdatePrivateCloudRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::VmwareEngine::V1::PrivateCloud), request["private_cloud"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_private_cloud_client_stub do + # Create client + client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_private_cloud({ private_cloud: private_cloud, update_mask: update_mask, request_id: request_id }) 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.update_private_cloud private_cloud: private_cloud, update_mask: update_mask, request_id: request_id 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.update_private_cloud ::Google::Cloud::VmwareEngine::V1::UpdatePrivateCloudRequest.new(private_cloud: private_cloud, update_mask: update_mask, request_id: request_id) 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.update_private_cloud({ private_cloud: private_cloud, update_mask: update_mask, request_id: request_id }, 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.update_private_cloud(::Google::Cloud::VmwareEngine::V1::UpdatePrivateCloudRequest.new(private_cloud: private_cloud, update_mask: update_mask, request_id: request_id), 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, update_private_cloud_client_stub.call_rpc_count + end + end + + def test_delete_private_cloud + # 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" + request_id = "hello world" + force = true + delay_hours = 42 + + delete_private_cloud_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_private_cloud, name + assert_kind_of ::Google::Cloud::VmwareEngine::V1::DeletePrivateCloudRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["request_id"] + assert_equal true, request["force"] + assert_equal 42, request["delay_hours"] + assert request.has_delay_hours? + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_private_cloud_client_stub do + # Create client + client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_private_cloud({ name: name, request_id: request_id, force: force, delay_hours: delay_hours }) 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_private_cloud name: name, request_id: request_id, force: force, delay_hours: delay_hours 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_private_cloud ::Google::Cloud::VmwareEngine::V1::DeletePrivateCloudRequest.new(name: name, request_id: request_id, force: force, delay_hours: delay_hours) 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_private_cloud({ name: name, request_id: request_id, force: force, delay_hours: delay_hours }, 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_private_cloud(::Google::Cloud::VmwareEngine::V1::DeletePrivateCloudRequest.new(name: name, request_id: request_id, force: force, delay_hours: delay_hours), 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_private_cloud_client_stub.call_rpc_count + end + end + + def test_undelete_private_cloud + # 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" + request_id = "hello world" + + undelete_private_cloud_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :undelete_private_cloud, name + assert_kind_of ::Google::Cloud::VmwareEngine::V1::UndeletePrivateCloudRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, undelete_private_cloud_client_stub do + # Create client + client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.undelete_private_cloud({ name: name, request_id: request_id }) 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.undelete_private_cloud name: name, request_id: request_id 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.undelete_private_cloud ::Google::Cloud::VmwareEngine::V1::UndeletePrivateCloudRequest.new(name: name, request_id: request_id) 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.undelete_private_cloud({ name: name, request_id: request_id }, 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.undelete_private_cloud(::Google::Cloud::VmwareEngine::V1::UndeletePrivateCloudRequest.new(name: name, request_id: request_id), 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, undelete_private_cloud_client_stub.call_rpc_count + end + end + + def test_list_clusters + # Create GRPC objects. + grpc_response = ::Google::Cloud::VmwareEngine::V1::ListClustersResponse.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_clusters_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_clusters, name + assert_kind_of ::Google::Cloud::VmwareEngine::V1::ListClustersRequest, 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_clusters_client_stub do + # Create client + client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_clusters({ 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_clusters 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_clusters ::Google::Cloud::VmwareEngine::V1::ListClustersRequest.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_clusters({ 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_clusters(::Google::Cloud::VmwareEngine::V1::ListClustersRequest.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_clusters_client_stub.call_rpc_count + end + end + + def test_get_cluster + # Create GRPC objects. + grpc_response = ::Google::Cloud::VmwareEngine::V1::Cluster.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_cluster_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_cluster, name + assert_kind_of ::Google::Cloud::VmwareEngine::V1::GetClusterRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_cluster_client_stub do + # Create client + client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_cluster({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_cluster name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_cluster ::Google::Cloud::VmwareEngine::V1::GetClusterRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_cluster({ 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_cluster(::Google::Cloud::VmwareEngine::V1::GetClusterRequest.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_cluster_client_stub.call_rpc_count + end + end + + def test_create_cluster + # 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" + cluster_id = "hello world" + cluster = {} + request_id = "hello world" + validate_only = true + + create_cluster_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_cluster, name + assert_kind_of ::Google::Cloud::VmwareEngine::V1::CreateClusterRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["cluster_id"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::VmwareEngine::V1::Cluster), request["cluster"] + assert_equal "hello world", request["request_id"] + assert_equal true, request["validate_only"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_cluster_client_stub do + # Create client + client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_cluster({ parent: parent, cluster_id: cluster_id, cluster: cluster, request_id: request_id, validate_only: validate_only }) 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_cluster parent: parent, cluster_id: cluster_id, cluster: cluster, request_id: request_id, validate_only: validate_only 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_cluster ::Google::Cloud::VmwareEngine::V1::CreateClusterRequest.new(parent: parent, cluster_id: cluster_id, cluster: cluster, request_id: request_id, validate_only: validate_only) 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_cluster({ parent: parent, cluster_id: cluster_id, cluster: cluster, request_id: request_id, validate_only: validate_only }, 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_cluster(::Google::Cloud::VmwareEngine::V1::CreateClusterRequest.new(parent: parent, cluster_id: cluster_id, cluster: cluster, request_id: request_id, validate_only: validate_only), 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_cluster_client_stub.call_rpc_count + end + end + + def test_update_cluster + # 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. + update_mask = {} + cluster = {} + request_id = "hello world" + validate_only = true + + update_cluster_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_cluster, name + assert_kind_of ::Google::Cloud::VmwareEngine::V1::UpdateClusterRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::VmwareEngine::V1::Cluster), request["cluster"] + assert_equal "hello world", request["request_id"] + assert_equal true, request["validate_only"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_cluster_client_stub do + # Create client + client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_cluster({ update_mask: update_mask, cluster: cluster, request_id: request_id, validate_only: validate_only }) 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.update_cluster update_mask: update_mask, cluster: cluster, request_id: request_id, validate_only: validate_only 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.update_cluster ::Google::Cloud::VmwareEngine::V1::UpdateClusterRequest.new(update_mask: update_mask, cluster: cluster, request_id: request_id, validate_only: validate_only) 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.update_cluster({ update_mask: update_mask, cluster: cluster, request_id: request_id, validate_only: validate_only }, 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.update_cluster(::Google::Cloud::VmwareEngine::V1::UpdateClusterRequest.new(update_mask: update_mask, cluster: cluster, request_id: request_id, validate_only: validate_only), 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, update_cluster_client_stub.call_rpc_count + end + end + + def test_delete_cluster + # 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" + request_id = "hello world" + + delete_cluster_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_cluster, name + assert_kind_of ::Google::Cloud::VmwareEngine::V1::DeleteClusterRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_cluster_client_stub do + # Create client + client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_cluster({ name: name, request_id: request_id }) 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_cluster name: name, request_id: request_id 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_cluster ::Google::Cloud::VmwareEngine::V1::DeleteClusterRequest.new(name: name, request_id: request_id) 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_cluster({ name: name, request_id: request_id }, 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_cluster(::Google::Cloud::VmwareEngine::V1::DeleteClusterRequest.new(name: name, request_id: request_id), 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_cluster_client_stub.call_rpc_count + end + end + + def test_list_nodes + # Create GRPC objects. + grpc_response = ::Google::Cloud::VmwareEngine::V1::ListNodesResponse.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_nodes_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_nodes, name + assert_kind_of ::Google::Cloud::VmwareEngine::V1::ListNodesRequest, 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_nodes_client_stub do + # Create client + client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_nodes({ 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_nodes 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_nodes ::Google::Cloud::VmwareEngine::V1::ListNodesRequest.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_nodes({ 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_nodes(::Google::Cloud::VmwareEngine::V1::ListNodesRequest.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_nodes_client_stub.call_rpc_count + end + end + + def test_get_node + # Create GRPC objects. + grpc_response = ::Google::Cloud::VmwareEngine::V1::Node.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_node_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_node, name + assert_kind_of ::Google::Cloud::VmwareEngine::V1::GetNodeRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_node_client_stub do + # Create client + client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_node({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_node name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_node ::Google::Cloud::VmwareEngine::V1::GetNodeRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_node({ 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_node(::Google::Cloud::VmwareEngine::V1::GetNodeRequest.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_node_client_stub.call_rpc_count + end + end + + def test_list_external_addresses + # Create GRPC objects. + grpc_response = ::Google::Cloud::VmwareEngine::V1::ListExternalAddressesResponse.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_external_addresses_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_external_addresses, name + assert_kind_of ::Google::Cloud::VmwareEngine::V1::ListExternalAddressesRequest, 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_external_addresses_client_stub do + # Create client + client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_external_addresses({ 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_external_addresses 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_external_addresses ::Google::Cloud::VmwareEngine::V1::ListExternalAddressesRequest.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_external_addresses({ 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_external_addresses(::Google::Cloud::VmwareEngine::V1::ListExternalAddressesRequest.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_external_addresses_client_stub.call_rpc_count + end + end + + def test_fetch_network_policy_external_addresses + # Create GRPC objects. + grpc_response = ::Google::Cloud::VmwareEngine::V1::FetchNetworkPolicyExternalAddressesResponse.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. + network_policy = "hello world" + page_size = 42 + page_token = "hello world" + + fetch_network_policy_external_addresses_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :fetch_network_policy_external_addresses, name + assert_kind_of ::Google::Cloud::VmwareEngine::V1::FetchNetworkPolicyExternalAddressesRequest, request + assert_equal "hello world", request["network_policy"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, fetch_network_policy_external_addresses_client_stub do + # Create client + client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.fetch_network_policy_external_addresses({ network_policy: network_policy, 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.fetch_network_policy_external_addresses network_policy: network_policy, 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.fetch_network_policy_external_addresses ::Google::Cloud::VmwareEngine::V1::FetchNetworkPolicyExternalAddressesRequest.new(network_policy: network_policy, 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.fetch_network_policy_external_addresses({ network_policy: network_policy, 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.fetch_network_policy_external_addresses(::Google::Cloud::VmwareEngine::V1::FetchNetworkPolicyExternalAddressesRequest.new(network_policy: network_policy, 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, fetch_network_policy_external_addresses_client_stub.call_rpc_count + end + end + + def test_get_external_address + # Create GRPC objects. + grpc_response = ::Google::Cloud::VmwareEngine::V1::ExternalAddress.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_external_address_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_external_address, name + assert_kind_of ::Google::Cloud::VmwareEngine::V1::GetExternalAddressRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_external_address_client_stub do + # Create client + client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_external_address({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_external_address name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_external_address ::Google::Cloud::VmwareEngine::V1::GetExternalAddressRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_external_address({ 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_external_address(::Google::Cloud::VmwareEngine::V1::GetExternalAddressRequest.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_external_address_client_stub.call_rpc_count + end + end + + def test_create_external_address + # 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" + external_address = {} + external_address_id = "hello world" + request_id = "hello world" + + create_external_address_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_external_address, name + assert_kind_of ::Google::Cloud::VmwareEngine::V1::CreateExternalAddressRequest, request + assert_equal "hello world", request["parent"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::VmwareEngine::V1::ExternalAddress), request["external_address"] + assert_equal "hello world", request["external_address_id"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_external_address_client_stub do + # Create client + client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_external_address({ parent: parent, external_address: external_address, external_address_id: external_address_id, request_id: request_id }) 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_external_address parent: parent, external_address: external_address, external_address_id: external_address_id, request_id: request_id 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_external_address ::Google::Cloud::VmwareEngine::V1::CreateExternalAddressRequest.new(parent: parent, external_address: external_address, external_address_id: external_address_id, request_id: request_id) 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_external_address({ parent: parent, external_address: external_address, external_address_id: external_address_id, request_id: request_id }, 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_external_address(::Google::Cloud::VmwareEngine::V1::CreateExternalAddressRequest.new(parent: parent, external_address: external_address, external_address_id: external_address_id, request_id: request_id), 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_external_address_client_stub.call_rpc_count + end + end + + def test_update_external_address + # 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. + update_mask = {} + external_address = {} + request_id = "hello world" + + update_external_address_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_external_address, name + assert_kind_of ::Google::Cloud::VmwareEngine::V1::UpdateExternalAddressRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::VmwareEngine::V1::ExternalAddress), request["external_address"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_external_address_client_stub do + # Create client + client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_external_address({ update_mask: update_mask, external_address: external_address, request_id: request_id }) 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.update_external_address update_mask: update_mask, external_address: external_address, request_id: request_id 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.update_external_address ::Google::Cloud::VmwareEngine::V1::UpdateExternalAddressRequest.new(update_mask: update_mask, external_address: external_address, request_id: request_id) 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.update_external_address({ update_mask: update_mask, external_address: external_address, request_id: request_id }, 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.update_external_address(::Google::Cloud::VmwareEngine::V1::UpdateExternalAddressRequest.new(update_mask: update_mask, external_address: external_address, request_id: request_id), 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, update_external_address_client_stub.call_rpc_count + end + end + + def test_delete_external_address + # 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" + request_id = "hello world" + + delete_external_address_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_external_address, name + assert_kind_of ::Google::Cloud::VmwareEngine::V1::DeleteExternalAddressRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_external_address_client_stub do + # Create client + client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_external_address({ name: name, request_id: request_id }) 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_external_address name: name, request_id: request_id 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_external_address ::Google::Cloud::VmwareEngine::V1::DeleteExternalAddressRequest.new(name: name, request_id: request_id) 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_external_address({ name: name, request_id: request_id }, 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_external_address(::Google::Cloud::VmwareEngine::V1::DeleteExternalAddressRequest.new(name: name, request_id: request_id), 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_external_address_client_stub.call_rpc_count + end + end + + def test_list_subnets + # Create GRPC objects. + grpc_response = ::Google::Cloud::VmwareEngine::V1::ListSubnetsResponse.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_subnets_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_subnets, name + assert_kind_of ::Google::Cloud::VmwareEngine::V1::ListSubnetsRequest, 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_subnets_client_stub do + # Create client + client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_subnets({ 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_subnets 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_subnets ::Google::Cloud::VmwareEngine::V1::ListSubnetsRequest.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_subnets({ 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_subnets(::Google::Cloud::VmwareEngine::V1::ListSubnetsRequest.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_subnets_client_stub.call_rpc_count + end + end + + def test_get_subnet + # Create GRPC objects. + grpc_response = ::Google::Cloud::VmwareEngine::V1::Subnet.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_subnet_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_subnet, name + assert_kind_of ::Google::Cloud::VmwareEngine::V1::GetSubnetRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_subnet_client_stub do + # Create client + client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_subnet({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_subnet name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_subnet ::Google::Cloud::VmwareEngine::V1::GetSubnetRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_subnet({ 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_subnet(::Google::Cloud::VmwareEngine::V1::GetSubnetRequest.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_subnet_client_stub.call_rpc_count + end + end + + def test_update_subnet + # 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. + update_mask = {} + subnet = {} + + update_subnet_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_subnet, name + assert_kind_of ::Google::Cloud::VmwareEngine::V1::UpdateSubnetRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::VmwareEngine::V1::Subnet), request["subnet"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_subnet_client_stub do + # Create client + client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_subnet({ update_mask: update_mask, subnet: subnet }) 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.update_subnet update_mask: update_mask, subnet: subnet 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.update_subnet ::Google::Cloud::VmwareEngine::V1::UpdateSubnetRequest.new(update_mask: update_mask, subnet: subnet) 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.update_subnet({ update_mask: update_mask, subnet: subnet }, 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.update_subnet(::Google::Cloud::VmwareEngine::V1::UpdateSubnetRequest.new(update_mask: update_mask, subnet: subnet), 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, update_subnet_client_stub.call_rpc_count + end + end + + def test_list_external_access_rules + # Create GRPC objects. + grpc_response = ::Google::Cloud::VmwareEngine::V1::ListExternalAccessRulesResponse.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_external_access_rules_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_external_access_rules, name + assert_kind_of ::Google::Cloud::VmwareEngine::V1::ListExternalAccessRulesRequest, 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_external_access_rules_client_stub do + # Create client + client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_external_access_rules({ 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_external_access_rules 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_external_access_rules ::Google::Cloud::VmwareEngine::V1::ListExternalAccessRulesRequest.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_external_access_rules({ 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_external_access_rules(::Google::Cloud::VmwareEngine::V1::ListExternalAccessRulesRequest.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_external_access_rules_client_stub.call_rpc_count + end + end + + def test_get_external_access_rule + # Create GRPC objects. + grpc_response = ::Google::Cloud::VmwareEngine::V1::ExternalAccessRule.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_external_access_rule_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_external_access_rule, name + assert_kind_of ::Google::Cloud::VmwareEngine::V1::GetExternalAccessRuleRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_external_access_rule_client_stub do + # Create client + client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_external_access_rule({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_external_access_rule name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_external_access_rule ::Google::Cloud::VmwareEngine::V1::GetExternalAccessRuleRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_external_access_rule({ 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_external_access_rule(::Google::Cloud::VmwareEngine::V1::GetExternalAccessRuleRequest.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_external_access_rule_client_stub.call_rpc_count + end + end + + def test_create_external_access_rule + # 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" + external_access_rule = {} + external_access_rule_id = "hello world" + request_id = "hello world" + + create_external_access_rule_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_external_access_rule, name + assert_kind_of ::Google::Cloud::VmwareEngine::V1::CreateExternalAccessRuleRequest, request + assert_equal "hello world", request["parent"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::VmwareEngine::V1::ExternalAccessRule), request["external_access_rule"] + assert_equal "hello world", request["external_access_rule_id"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_external_access_rule_client_stub do + # Create client + client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_external_access_rule({ parent: parent, external_access_rule: external_access_rule, external_access_rule_id: external_access_rule_id, request_id: request_id }) 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_external_access_rule parent: parent, external_access_rule: external_access_rule, external_access_rule_id: external_access_rule_id, request_id: request_id 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_external_access_rule ::Google::Cloud::VmwareEngine::V1::CreateExternalAccessRuleRequest.new(parent: parent, external_access_rule: external_access_rule, external_access_rule_id: external_access_rule_id, request_id: request_id) 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_external_access_rule({ parent: parent, external_access_rule: external_access_rule, external_access_rule_id: external_access_rule_id, request_id: request_id }, 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_external_access_rule(::Google::Cloud::VmwareEngine::V1::CreateExternalAccessRuleRequest.new(parent: parent, external_access_rule: external_access_rule, external_access_rule_id: external_access_rule_id, request_id: request_id), 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_external_access_rule_client_stub.call_rpc_count + end + end + + def test_update_external_access_rule + # 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. + update_mask = {} + external_access_rule = {} + request_id = "hello world" + + update_external_access_rule_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_external_access_rule, name + assert_kind_of ::Google::Cloud::VmwareEngine::V1::UpdateExternalAccessRuleRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::VmwareEngine::V1::ExternalAccessRule), request["external_access_rule"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_external_access_rule_client_stub do + # Create client + client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_external_access_rule({ update_mask: update_mask, external_access_rule: external_access_rule, request_id: request_id }) 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.update_external_access_rule update_mask: update_mask, external_access_rule: external_access_rule, request_id: request_id 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.update_external_access_rule ::Google::Cloud::VmwareEngine::V1::UpdateExternalAccessRuleRequest.new(update_mask: update_mask, external_access_rule: external_access_rule, request_id: request_id) 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.update_external_access_rule({ update_mask: update_mask, external_access_rule: external_access_rule, request_id: request_id }, 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.update_external_access_rule(::Google::Cloud::VmwareEngine::V1::UpdateExternalAccessRuleRequest.new(update_mask: update_mask, external_access_rule: external_access_rule, request_id: request_id), 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, update_external_access_rule_client_stub.call_rpc_count + end + end + + def test_delete_external_access_rule + # 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" + request_id = "hello world" + + delete_external_access_rule_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_external_access_rule, name + assert_kind_of ::Google::Cloud::VmwareEngine::V1::DeleteExternalAccessRuleRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_external_access_rule_client_stub do + # Create client + client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_external_access_rule({ name: name, request_id: request_id }) 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_external_access_rule name: name, request_id: request_id 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_external_access_rule ::Google::Cloud::VmwareEngine::V1::DeleteExternalAccessRuleRequest.new(name: name, request_id: request_id) 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_external_access_rule({ name: name, request_id: request_id }, 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_external_access_rule(::Google::Cloud::VmwareEngine::V1::DeleteExternalAccessRuleRequest.new(name: name, request_id: request_id), 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_external_access_rule_client_stub.call_rpc_count + end + end + + def test_list_logging_servers + # Create GRPC objects. + grpc_response = ::Google::Cloud::VmwareEngine::V1::ListLoggingServersResponse.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_logging_servers_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_logging_servers, name + assert_kind_of ::Google::Cloud::VmwareEngine::V1::ListLoggingServersRequest, 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_logging_servers_client_stub do + # Create client + client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_logging_servers({ 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_logging_servers 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_logging_servers ::Google::Cloud::VmwareEngine::V1::ListLoggingServersRequest.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_logging_servers({ 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_logging_servers(::Google::Cloud::VmwareEngine::V1::ListLoggingServersRequest.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_logging_servers_client_stub.call_rpc_count + end + end + + def test_get_logging_server + # Create GRPC objects. + grpc_response = ::Google::Cloud::VmwareEngine::V1::LoggingServer.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_logging_server_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_logging_server, name + assert_kind_of ::Google::Cloud::VmwareEngine::V1::GetLoggingServerRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_logging_server_client_stub do + # Create client + client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_logging_server({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_logging_server name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_logging_server ::Google::Cloud::VmwareEngine::V1::GetLoggingServerRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_logging_server({ 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_logging_server(::Google::Cloud::VmwareEngine::V1::GetLoggingServerRequest.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_logging_server_client_stub.call_rpc_count + end + end + + def test_create_logging_server + # 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" + logging_server = {} + logging_server_id = "hello world" + request_id = "hello world" + + create_logging_server_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_logging_server, name + assert_kind_of ::Google::Cloud::VmwareEngine::V1::CreateLoggingServerRequest, request + assert_equal "hello world", request["parent"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::VmwareEngine::V1::LoggingServer), request["logging_server"] + assert_equal "hello world", request["logging_server_id"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_logging_server_client_stub do + # Create client + client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_logging_server({ parent: parent, logging_server: logging_server, logging_server_id: logging_server_id, request_id: request_id }) 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_logging_server parent: parent, logging_server: logging_server, logging_server_id: logging_server_id, request_id: request_id 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_logging_server ::Google::Cloud::VmwareEngine::V1::CreateLoggingServerRequest.new(parent: parent, logging_server: logging_server, logging_server_id: logging_server_id, request_id: request_id) 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_logging_server({ parent: parent, logging_server: logging_server, logging_server_id: logging_server_id, request_id: request_id }, 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_logging_server(::Google::Cloud::VmwareEngine::V1::CreateLoggingServerRequest.new(parent: parent, logging_server: logging_server, logging_server_id: logging_server_id, request_id: request_id), 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_logging_server_client_stub.call_rpc_count + end + end + + def test_update_logging_server + # 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. + update_mask = {} + logging_server = {} + request_id = "hello world" + + update_logging_server_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_logging_server, name + assert_kind_of ::Google::Cloud::VmwareEngine::V1::UpdateLoggingServerRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::VmwareEngine::V1::LoggingServer), request["logging_server"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_logging_server_client_stub do + # Create client + client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_logging_server({ update_mask: update_mask, logging_server: logging_server, request_id: request_id }) 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.update_logging_server update_mask: update_mask, logging_server: logging_server, request_id: request_id 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.update_logging_server ::Google::Cloud::VmwareEngine::V1::UpdateLoggingServerRequest.new(update_mask: update_mask, logging_server: logging_server, request_id: request_id) 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.update_logging_server({ update_mask: update_mask, logging_server: logging_server, request_id: request_id }, 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.update_logging_server(::Google::Cloud::VmwareEngine::V1::UpdateLoggingServerRequest.new(update_mask: update_mask, logging_server: logging_server, request_id: request_id), 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, update_logging_server_client_stub.call_rpc_count + end + end + + def test_delete_logging_server + # 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" + request_id = "hello world" + + delete_logging_server_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_logging_server, name + assert_kind_of ::Google::Cloud::VmwareEngine::V1::DeleteLoggingServerRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_logging_server_client_stub do + # Create client + client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_logging_server({ name: name, request_id: request_id }) 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_logging_server name: name, request_id: request_id 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_logging_server ::Google::Cloud::VmwareEngine::V1::DeleteLoggingServerRequest.new(name: name, request_id: request_id) 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_logging_server({ name: name, request_id: request_id }, 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_logging_server(::Google::Cloud::VmwareEngine::V1::DeleteLoggingServerRequest.new(name: name, request_id: request_id), 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_logging_server_client_stub.call_rpc_count + end + end + + def test_list_node_types + # Create GRPC objects. + grpc_response = ::Google::Cloud::VmwareEngine::V1::ListNodeTypesResponse.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_node_types_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_node_types, name + assert_kind_of ::Google::Cloud::VmwareEngine::V1::ListNodeTypesRequest, 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_node_types_client_stub do + # Create client + client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_node_types({ 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_node_types 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_node_types ::Google::Cloud::VmwareEngine::V1::ListNodeTypesRequest.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_node_types({ 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_node_types(::Google::Cloud::VmwareEngine::V1::ListNodeTypesRequest.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_node_types_client_stub.call_rpc_count + end + end + + def test_get_node_type + # Create GRPC objects. + grpc_response = ::Google::Cloud::VmwareEngine::V1::NodeType.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_node_type_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_node_type, name + assert_kind_of ::Google::Cloud::VmwareEngine::V1::GetNodeTypeRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_node_type_client_stub do + # Create client + client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_node_type({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_node_type name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_node_type ::Google::Cloud::VmwareEngine::V1::GetNodeTypeRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_node_type({ 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_node_type(::Google::Cloud::VmwareEngine::V1::GetNodeTypeRequest.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_node_type_client_stub.call_rpc_count + end + end + + def test_show_nsx_credentials + # Create GRPC objects. + grpc_response = ::Google::Cloud::VmwareEngine::V1::Credentials.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. + private_cloud = "hello world" + + show_nsx_credentials_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :show_nsx_credentials, name + assert_kind_of ::Google::Cloud::VmwareEngine::V1::ShowNsxCredentialsRequest, request + assert_equal "hello world", request["private_cloud"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, show_nsx_credentials_client_stub do + # Create client + client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.show_nsx_credentials({ private_cloud: private_cloud }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.show_nsx_credentials private_cloud: private_cloud do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.show_nsx_credentials ::Google::Cloud::VmwareEngine::V1::ShowNsxCredentialsRequest.new(private_cloud: private_cloud) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.show_nsx_credentials({ private_cloud: private_cloud }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.show_nsx_credentials(::Google::Cloud::VmwareEngine::V1::ShowNsxCredentialsRequest.new(private_cloud: private_cloud), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, show_nsx_credentials_client_stub.call_rpc_count + end + end + + def test_show_vcenter_credentials + # Create GRPC objects. + grpc_response = ::Google::Cloud::VmwareEngine::V1::Credentials.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. + private_cloud = "hello world" + username = "hello world" + + show_vcenter_credentials_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :show_vcenter_credentials, name + assert_kind_of ::Google::Cloud::VmwareEngine::V1::ShowVcenterCredentialsRequest, request + assert_equal "hello world", request["private_cloud"] + assert_equal "hello world", request["username"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, show_vcenter_credentials_client_stub do + # Create client + client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.show_vcenter_credentials({ private_cloud: private_cloud, username: username }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.show_vcenter_credentials private_cloud: private_cloud, username: username do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.show_vcenter_credentials ::Google::Cloud::VmwareEngine::V1::ShowVcenterCredentialsRequest.new(private_cloud: private_cloud, username: username) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.show_vcenter_credentials({ private_cloud: private_cloud, username: username }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.show_vcenter_credentials(::Google::Cloud::VmwareEngine::V1::ShowVcenterCredentialsRequest.new(private_cloud: private_cloud, username: username), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, show_vcenter_credentials_client_stub.call_rpc_count + end + end + + def test_reset_nsx_credentials + # 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. + private_cloud = "hello world" + request_id = "hello world" + + reset_nsx_credentials_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :reset_nsx_credentials, name + assert_kind_of ::Google::Cloud::VmwareEngine::V1::ResetNsxCredentialsRequest, request + assert_equal "hello world", request["private_cloud"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, reset_nsx_credentials_client_stub do + # Create client + client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.reset_nsx_credentials({ private_cloud: private_cloud, request_id: request_id }) 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.reset_nsx_credentials private_cloud: private_cloud, request_id: request_id 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.reset_nsx_credentials ::Google::Cloud::VmwareEngine::V1::ResetNsxCredentialsRequest.new(private_cloud: private_cloud, request_id: request_id) 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.reset_nsx_credentials({ private_cloud: private_cloud, request_id: request_id }, 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.reset_nsx_credentials(::Google::Cloud::VmwareEngine::V1::ResetNsxCredentialsRequest.new(private_cloud: private_cloud, request_id: request_id), 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, reset_nsx_credentials_client_stub.call_rpc_count + end + end + + def test_reset_vcenter_credentials + # 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. + private_cloud = "hello world" + request_id = "hello world" + username = "hello world" + + reset_vcenter_credentials_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :reset_vcenter_credentials, name + assert_kind_of ::Google::Cloud::VmwareEngine::V1::ResetVcenterCredentialsRequest, request + assert_equal "hello world", request["private_cloud"] + assert_equal "hello world", request["request_id"] + assert_equal "hello world", request["username"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, reset_vcenter_credentials_client_stub do + # Create client + client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.reset_vcenter_credentials({ private_cloud: private_cloud, request_id: request_id, username: username }) 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.reset_vcenter_credentials private_cloud: private_cloud, request_id: request_id, username: username 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.reset_vcenter_credentials ::Google::Cloud::VmwareEngine::V1::ResetVcenterCredentialsRequest.new(private_cloud: private_cloud, request_id: request_id, username: username) 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.reset_vcenter_credentials({ private_cloud: private_cloud, request_id: request_id, username: username }, 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.reset_vcenter_credentials(::Google::Cloud::VmwareEngine::V1::ResetVcenterCredentialsRequest.new(private_cloud: private_cloud, request_id: request_id, username: username), 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, reset_vcenter_credentials_client_stub.call_rpc_count + end + end + + def test_get_dns_forwarding + # Create GRPC objects. + grpc_response = ::Google::Cloud::VmwareEngine::V1::DnsForwarding.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_dns_forwarding_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_dns_forwarding, name + assert_kind_of ::Google::Cloud::VmwareEngine::V1::GetDnsForwardingRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_dns_forwarding_client_stub do + # Create client + client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_dns_forwarding({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_dns_forwarding name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_dns_forwarding ::Google::Cloud::VmwareEngine::V1::GetDnsForwardingRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_dns_forwarding({ 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_dns_forwarding(::Google::Cloud::VmwareEngine::V1::GetDnsForwardingRequest.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_dns_forwarding_client_stub.call_rpc_count + end + end + + def test_update_dns_forwarding + # 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. + dns_forwarding = {} + update_mask = {} + request_id = "hello world" + + update_dns_forwarding_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_dns_forwarding, name + assert_kind_of ::Google::Cloud::VmwareEngine::V1::UpdateDnsForwardingRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::VmwareEngine::V1::DnsForwarding), request["dns_forwarding"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_dns_forwarding_client_stub do + # Create client + client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_dns_forwarding({ dns_forwarding: dns_forwarding, update_mask: update_mask, request_id: request_id }) 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.update_dns_forwarding dns_forwarding: dns_forwarding, update_mask: update_mask, request_id: request_id 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.update_dns_forwarding ::Google::Cloud::VmwareEngine::V1::UpdateDnsForwardingRequest.new(dns_forwarding: dns_forwarding, update_mask: update_mask, request_id: request_id) 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.update_dns_forwarding({ dns_forwarding: dns_forwarding, update_mask: update_mask, request_id: request_id }, 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.update_dns_forwarding(::Google::Cloud::VmwareEngine::V1::UpdateDnsForwardingRequest.new(dns_forwarding: dns_forwarding, update_mask: update_mask, request_id: request_id), 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, update_dns_forwarding_client_stub.call_rpc_count + end + end + + def test_get_network_peering + # Create GRPC objects. + grpc_response = ::Google::Cloud::VmwareEngine::V1::NetworkPeering.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_network_peering_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_network_peering, name + assert_kind_of ::Google::Cloud::VmwareEngine::V1::GetNetworkPeeringRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_network_peering_client_stub do + # Create client + client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_network_peering({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_network_peering name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_network_peering ::Google::Cloud::VmwareEngine::V1::GetNetworkPeeringRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_network_peering({ 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_network_peering(::Google::Cloud::VmwareEngine::V1::GetNetworkPeeringRequest.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_network_peering_client_stub.call_rpc_count + end + end + + def test_list_network_peerings + # Create GRPC objects. + grpc_response = ::Google::Cloud::VmwareEngine::V1::ListNetworkPeeringsResponse.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_network_peerings_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_network_peerings, name + assert_kind_of ::Google::Cloud::VmwareEngine::V1::ListNetworkPeeringsRequest, 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_network_peerings_client_stub do + # Create client + client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_network_peerings({ 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_network_peerings 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_network_peerings ::Google::Cloud::VmwareEngine::V1::ListNetworkPeeringsRequest.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_network_peerings({ 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_network_peerings(::Google::Cloud::VmwareEngine::V1::ListNetworkPeeringsRequest.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_network_peerings_client_stub.call_rpc_count + end + end + + def test_create_network_peering + # 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" + network_peering_id = "hello world" + network_peering = {} + request_id = "hello world" + + create_network_peering_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_network_peering, name + assert_kind_of ::Google::Cloud::VmwareEngine::V1::CreateNetworkPeeringRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["network_peering_id"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::VmwareEngine::V1::NetworkPeering), request["network_peering"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_network_peering_client_stub do + # Create client + client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_network_peering({ parent: parent, network_peering_id: network_peering_id, network_peering: network_peering, request_id: request_id }) 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_network_peering parent: parent, network_peering_id: network_peering_id, network_peering: network_peering, request_id: request_id 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_network_peering ::Google::Cloud::VmwareEngine::V1::CreateNetworkPeeringRequest.new(parent: parent, network_peering_id: network_peering_id, network_peering: network_peering, request_id: request_id) 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_network_peering({ parent: parent, network_peering_id: network_peering_id, network_peering: network_peering, request_id: request_id }, 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_network_peering(::Google::Cloud::VmwareEngine::V1::CreateNetworkPeeringRequest.new(parent: parent, network_peering_id: network_peering_id, network_peering: network_peering, request_id: request_id), 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_network_peering_client_stub.call_rpc_count + end + end + + def test_delete_network_peering + # 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" + request_id = "hello world" + + delete_network_peering_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_network_peering, name + assert_kind_of ::Google::Cloud::VmwareEngine::V1::DeleteNetworkPeeringRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_network_peering_client_stub do + # Create client + client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_network_peering({ name: name, request_id: request_id }) 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_network_peering name: name, request_id: request_id 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_network_peering ::Google::Cloud::VmwareEngine::V1::DeleteNetworkPeeringRequest.new(name: name, request_id: request_id) 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_network_peering({ name: name, request_id: request_id }, 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_network_peering(::Google::Cloud::VmwareEngine::V1::DeleteNetworkPeeringRequest.new(name: name, request_id: request_id), 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_network_peering_client_stub.call_rpc_count + end + end + + def test_update_network_peering + # 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. + network_peering = {} + update_mask = {} + request_id = "hello world" + + update_network_peering_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_network_peering, name + assert_kind_of ::Google::Cloud::VmwareEngine::V1::UpdateNetworkPeeringRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::VmwareEngine::V1::NetworkPeering), request["network_peering"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_network_peering_client_stub do + # Create client + client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_network_peering({ network_peering: network_peering, update_mask: update_mask, request_id: request_id }) 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.update_network_peering network_peering: network_peering, update_mask: update_mask, request_id: request_id 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.update_network_peering ::Google::Cloud::VmwareEngine::V1::UpdateNetworkPeeringRequest.new(network_peering: network_peering, update_mask: update_mask, request_id: request_id) 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.update_network_peering({ network_peering: network_peering, update_mask: update_mask, request_id: request_id }, 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.update_network_peering(::Google::Cloud::VmwareEngine::V1::UpdateNetworkPeeringRequest.new(network_peering: network_peering, update_mask: update_mask, request_id: request_id), 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, update_network_peering_client_stub.call_rpc_count + end + end + + def test_list_peering_routes + # Create GRPC objects. + grpc_response = ::Google::Cloud::VmwareEngine::V1::ListPeeringRoutesResponse.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_peering_routes_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_peering_routes, name + assert_kind_of ::Google::Cloud::VmwareEngine::V1::ListPeeringRoutesRequest, 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_peering_routes_client_stub do + # Create client + client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_peering_routes({ 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_peering_routes 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_peering_routes ::Google::Cloud::VmwareEngine::V1::ListPeeringRoutesRequest.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_peering_routes({ 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_peering_routes(::Google::Cloud::VmwareEngine::V1::ListPeeringRoutesRequest.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_peering_routes_client_stub.call_rpc_count + end + end + + def test_create_hcx_activation_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. + parent = "hello world" + hcx_activation_key = {} + hcx_activation_key_id = "hello world" + request_id = "hello world" + + create_hcx_activation_key_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_hcx_activation_key, name + assert_kind_of ::Google::Cloud::VmwareEngine::V1::CreateHcxActivationKeyRequest, request + assert_equal "hello world", request["parent"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::VmwareEngine::V1::HcxActivationKey), request["hcx_activation_key"] + assert_equal "hello world", request["hcx_activation_key_id"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_hcx_activation_key_client_stub do + # Create client + client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_hcx_activation_key({ parent: parent, hcx_activation_key: hcx_activation_key, hcx_activation_key_id: hcx_activation_key_id, request_id: request_id }) 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_hcx_activation_key parent: parent, hcx_activation_key: hcx_activation_key, hcx_activation_key_id: hcx_activation_key_id, request_id: request_id 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_hcx_activation_key ::Google::Cloud::VmwareEngine::V1::CreateHcxActivationKeyRequest.new(parent: parent, hcx_activation_key: hcx_activation_key, hcx_activation_key_id: hcx_activation_key_id, request_id: request_id) 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_hcx_activation_key({ parent: parent, hcx_activation_key: hcx_activation_key, hcx_activation_key_id: hcx_activation_key_id, request_id: request_id }, 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_hcx_activation_key(::Google::Cloud::VmwareEngine::V1::CreateHcxActivationKeyRequest.new(parent: parent, hcx_activation_key: hcx_activation_key, hcx_activation_key_id: hcx_activation_key_id, request_id: request_id), 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_hcx_activation_key_client_stub.call_rpc_count + end + end + + def test_list_hcx_activation_keys + # Create GRPC objects. + grpc_response = ::Google::Cloud::VmwareEngine::V1::ListHcxActivationKeysResponse.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_hcx_activation_keys_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_hcx_activation_keys, name + assert_kind_of ::Google::Cloud::VmwareEngine::V1::ListHcxActivationKeysRequest, 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_hcx_activation_keys_client_stub do + # Create client + client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_hcx_activation_keys({ 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_hcx_activation_keys 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_hcx_activation_keys ::Google::Cloud::VmwareEngine::V1::ListHcxActivationKeysRequest.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_hcx_activation_keys({ 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_hcx_activation_keys(::Google::Cloud::VmwareEngine::V1::ListHcxActivationKeysRequest.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_hcx_activation_keys_client_stub.call_rpc_count + end + end + + def test_get_hcx_activation_key + # Create GRPC objects. + grpc_response = ::Google::Cloud::VmwareEngine::V1::HcxActivationKey.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_hcx_activation_key_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_hcx_activation_key, name + assert_kind_of ::Google::Cloud::VmwareEngine::V1::GetHcxActivationKeyRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_hcx_activation_key_client_stub do + # Create client + client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_hcx_activation_key({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_hcx_activation_key name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_hcx_activation_key ::Google::Cloud::VmwareEngine::V1::GetHcxActivationKeyRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_hcx_activation_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_hcx_activation_key(::Google::Cloud::VmwareEngine::V1::GetHcxActivationKeyRequest.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_hcx_activation_key_client_stub.call_rpc_count + end + end + + def test_get_network_policy + # Create GRPC objects. + grpc_response = ::Google::Cloud::VmwareEngine::V1::NetworkPolicy.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_network_policy_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_network_policy, name + assert_kind_of ::Google::Cloud::VmwareEngine::V1::GetNetworkPolicyRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_network_policy_client_stub do + # Create client + client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_network_policy({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_network_policy name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_network_policy ::Google::Cloud::VmwareEngine::V1::GetNetworkPolicyRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_network_policy({ 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_network_policy(::Google::Cloud::VmwareEngine::V1::GetNetworkPolicyRequest.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_network_policy_client_stub.call_rpc_count + end + end + + def test_list_network_policies + # Create GRPC objects. + grpc_response = ::Google::Cloud::VmwareEngine::V1::ListNetworkPoliciesResponse.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_network_policies_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_network_policies, name + assert_kind_of ::Google::Cloud::VmwareEngine::V1::ListNetworkPoliciesRequest, 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_network_policies_client_stub do + # Create client + client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_network_policies({ 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_network_policies 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_network_policies ::Google::Cloud::VmwareEngine::V1::ListNetworkPoliciesRequest.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_network_policies({ 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_network_policies(::Google::Cloud::VmwareEngine::V1::ListNetworkPoliciesRequest.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_network_policies_client_stub.call_rpc_count + end + end + + def test_create_network_policy + # 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" + network_policy_id = "hello world" + network_policy = {} + request_id = "hello world" + + create_network_policy_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_network_policy, name + assert_kind_of ::Google::Cloud::VmwareEngine::V1::CreateNetworkPolicyRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["network_policy_id"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::VmwareEngine::V1::NetworkPolicy), request["network_policy"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_network_policy_client_stub do + # Create client + client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_network_policy({ parent: parent, network_policy_id: network_policy_id, network_policy: network_policy, request_id: request_id }) 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_network_policy parent: parent, network_policy_id: network_policy_id, network_policy: network_policy, request_id: request_id 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_network_policy ::Google::Cloud::VmwareEngine::V1::CreateNetworkPolicyRequest.new(parent: parent, network_policy_id: network_policy_id, network_policy: network_policy, request_id: request_id) 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_network_policy({ parent: parent, network_policy_id: network_policy_id, network_policy: network_policy, request_id: request_id }, 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_network_policy(::Google::Cloud::VmwareEngine::V1::CreateNetworkPolicyRequest.new(parent: parent, network_policy_id: network_policy_id, network_policy: network_policy, request_id: request_id), 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_network_policy_client_stub.call_rpc_count + end + end + + def test_update_network_policy + # 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. + network_policy = {} + update_mask = {} + request_id = "hello world" + + update_network_policy_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_network_policy, name + assert_kind_of ::Google::Cloud::VmwareEngine::V1::UpdateNetworkPolicyRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::VmwareEngine::V1::NetworkPolicy), request["network_policy"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_network_policy_client_stub do + # Create client + client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_network_policy({ network_policy: network_policy, update_mask: update_mask, request_id: request_id }) 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.update_network_policy network_policy: network_policy, update_mask: update_mask, request_id: request_id 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.update_network_policy ::Google::Cloud::VmwareEngine::V1::UpdateNetworkPolicyRequest.new(network_policy: network_policy, update_mask: update_mask, request_id: request_id) 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.update_network_policy({ network_policy: network_policy, update_mask: update_mask, request_id: request_id }, 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.update_network_policy(::Google::Cloud::VmwareEngine::V1::UpdateNetworkPolicyRequest.new(network_policy: network_policy, update_mask: update_mask, request_id: request_id), 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, update_network_policy_client_stub.call_rpc_count + end + end + + def test_delete_network_policy + # 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" + request_id = "hello world" + + delete_network_policy_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_network_policy, name + assert_kind_of ::Google::Cloud::VmwareEngine::V1::DeleteNetworkPolicyRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_network_policy_client_stub do + # Create client + client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_network_policy({ name: name, request_id: request_id }) 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_network_policy name: name, request_id: request_id 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_network_policy ::Google::Cloud::VmwareEngine::V1::DeleteNetworkPolicyRequest.new(name: name, request_id: request_id) 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_network_policy({ name: name, request_id: request_id }, 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_network_policy(::Google::Cloud::VmwareEngine::V1::DeleteNetworkPolicyRequest.new(name: name, request_id: request_id), 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_network_policy_client_stub.call_rpc_count + end + end + + def test_list_management_dns_zone_bindings + # Create GRPC objects. + grpc_response = ::Google::Cloud::VmwareEngine::V1::ListManagementDnsZoneBindingsResponse.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_management_dns_zone_bindings_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_management_dns_zone_bindings, name + assert_kind_of ::Google::Cloud::VmwareEngine::V1::ListManagementDnsZoneBindingsRequest, 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_management_dns_zone_bindings_client_stub do + # Create client + client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_management_dns_zone_bindings({ 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_management_dns_zone_bindings 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_management_dns_zone_bindings ::Google::Cloud::VmwareEngine::V1::ListManagementDnsZoneBindingsRequest.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_management_dns_zone_bindings({ 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_management_dns_zone_bindings(::Google::Cloud::VmwareEngine::V1::ListManagementDnsZoneBindingsRequest.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_management_dns_zone_bindings_client_stub.call_rpc_count + end + end + + def test_get_management_dns_zone_binding + # Create GRPC objects. + grpc_response = ::Google::Cloud::VmwareEngine::V1::ManagementDnsZoneBinding.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_management_dns_zone_binding_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_management_dns_zone_binding, name + assert_kind_of ::Google::Cloud::VmwareEngine::V1::GetManagementDnsZoneBindingRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_management_dns_zone_binding_client_stub do + # Create client + client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_management_dns_zone_binding({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_management_dns_zone_binding name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_management_dns_zone_binding ::Google::Cloud::VmwareEngine::V1::GetManagementDnsZoneBindingRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_management_dns_zone_binding({ 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_management_dns_zone_binding(::Google::Cloud::VmwareEngine::V1::GetManagementDnsZoneBindingRequest.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_management_dns_zone_binding_client_stub.call_rpc_count + end + end + + def test_create_management_dns_zone_binding + # 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" + management_dns_zone_binding = {} + management_dns_zone_binding_id = "hello world" + request_id = "hello world" + + create_management_dns_zone_binding_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_management_dns_zone_binding, name + assert_kind_of ::Google::Cloud::VmwareEngine::V1::CreateManagementDnsZoneBindingRequest, request + assert_equal "hello world", request["parent"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::VmwareEngine::V1::ManagementDnsZoneBinding), request["management_dns_zone_binding"] + assert_equal "hello world", request["management_dns_zone_binding_id"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_management_dns_zone_binding_client_stub do + # Create client + client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_management_dns_zone_binding({ parent: parent, management_dns_zone_binding: management_dns_zone_binding, management_dns_zone_binding_id: management_dns_zone_binding_id, request_id: request_id }) 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_management_dns_zone_binding parent: parent, management_dns_zone_binding: management_dns_zone_binding, management_dns_zone_binding_id: management_dns_zone_binding_id, request_id: request_id 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_management_dns_zone_binding ::Google::Cloud::VmwareEngine::V1::CreateManagementDnsZoneBindingRequest.new(parent: parent, management_dns_zone_binding: management_dns_zone_binding, management_dns_zone_binding_id: management_dns_zone_binding_id, request_id: request_id) 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_management_dns_zone_binding({ parent: parent, management_dns_zone_binding: management_dns_zone_binding, management_dns_zone_binding_id: management_dns_zone_binding_id, request_id: request_id }, 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_management_dns_zone_binding(::Google::Cloud::VmwareEngine::V1::CreateManagementDnsZoneBindingRequest.new(parent: parent, management_dns_zone_binding: management_dns_zone_binding, management_dns_zone_binding_id: management_dns_zone_binding_id, request_id: request_id), 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_management_dns_zone_binding_client_stub.call_rpc_count + end + end + + def test_update_management_dns_zone_binding + # 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. + update_mask = {} + management_dns_zone_binding = {} + request_id = "hello world" + + update_management_dns_zone_binding_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_management_dns_zone_binding, name + assert_kind_of ::Google::Cloud::VmwareEngine::V1::UpdateManagementDnsZoneBindingRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::VmwareEngine::V1::ManagementDnsZoneBinding), request["management_dns_zone_binding"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_management_dns_zone_binding_client_stub do + # Create client + client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_management_dns_zone_binding({ update_mask: update_mask, management_dns_zone_binding: management_dns_zone_binding, request_id: request_id }) 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.update_management_dns_zone_binding update_mask: update_mask, management_dns_zone_binding: management_dns_zone_binding, request_id: request_id 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.update_management_dns_zone_binding ::Google::Cloud::VmwareEngine::V1::UpdateManagementDnsZoneBindingRequest.new(update_mask: update_mask, management_dns_zone_binding: management_dns_zone_binding, request_id: request_id) 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.update_management_dns_zone_binding({ update_mask: update_mask, management_dns_zone_binding: management_dns_zone_binding, request_id: request_id }, 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.update_management_dns_zone_binding(::Google::Cloud::VmwareEngine::V1::UpdateManagementDnsZoneBindingRequest.new(update_mask: update_mask, management_dns_zone_binding: management_dns_zone_binding, request_id: request_id), 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, update_management_dns_zone_binding_client_stub.call_rpc_count + end + end + + def test_delete_management_dns_zone_binding + # 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" + request_id = "hello world" + + delete_management_dns_zone_binding_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_management_dns_zone_binding, name + assert_kind_of ::Google::Cloud::VmwareEngine::V1::DeleteManagementDnsZoneBindingRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_management_dns_zone_binding_client_stub do + # Create client + client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_management_dns_zone_binding({ name: name, request_id: request_id }) 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_management_dns_zone_binding name: name, request_id: request_id 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_management_dns_zone_binding ::Google::Cloud::VmwareEngine::V1::DeleteManagementDnsZoneBindingRequest.new(name: name, request_id: request_id) 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_management_dns_zone_binding({ name: name, request_id: request_id }, 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_management_dns_zone_binding(::Google::Cloud::VmwareEngine::V1::DeleteManagementDnsZoneBindingRequest.new(name: name, request_id: request_id), 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_management_dns_zone_binding_client_stub.call_rpc_count + end + end + + def test_repair_management_dns_zone_binding + # 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" + request_id = "hello world" + + repair_management_dns_zone_binding_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :repair_management_dns_zone_binding, name + assert_kind_of ::Google::Cloud::VmwareEngine::V1::RepairManagementDnsZoneBindingRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, repair_management_dns_zone_binding_client_stub do + # Create client + client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.repair_management_dns_zone_binding({ name: name, request_id: request_id }) 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.repair_management_dns_zone_binding name: name, request_id: request_id 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.repair_management_dns_zone_binding ::Google::Cloud::VmwareEngine::V1::RepairManagementDnsZoneBindingRequest.new(name: name, request_id: request_id) 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.repair_management_dns_zone_binding({ name: name, request_id: request_id }, 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.repair_management_dns_zone_binding(::Google::Cloud::VmwareEngine::V1::RepairManagementDnsZoneBindingRequest.new(name: name, request_id: request_id), 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, repair_management_dns_zone_binding_client_stub.call_rpc_count + end + end + + def test_create_vmware_engine_network + # 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" + vmware_engine_network_id = "hello world" + vmware_engine_network = {} + request_id = "hello world" + + create_vmware_engine_network_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_vmware_engine_network, name + assert_kind_of ::Google::Cloud::VmwareEngine::V1::CreateVmwareEngineNetworkRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["vmware_engine_network_id"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::VmwareEngine::V1::VmwareEngineNetwork), request["vmware_engine_network"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_vmware_engine_network_client_stub do + # Create client + client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_vmware_engine_network({ parent: parent, vmware_engine_network_id: vmware_engine_network_id, vmware_engine_network: vmware_engine_network, request_id: request_id }) 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_vmware_engine_network parent: parent, vmware_engine_network_id: vmware_engine_network_id, vmware_engine_network: vmware_engine_network, request_id: request_id 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_vmware_engine_network ::Google::Cloud::VmwareEngine::V1::CreateVmwareEngineNetworkRequest.new(parent: parent, vmware_engine_network_id: vmware_engine_network_id, vmware_engine_network: vmware_engine_network, request_id: request_id) 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_vmware_engine_network({ parent: parent, vmware_engine_network_id: vmware_engine_network_id, vmware_engine_network: vmware_engine_network, request_id: request_id }, 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_vmware_engine_network(::Google::Cloud::VmwareEngine::V1::CreateVmwareEngineNetworkRequest.new(parent: parent, vmware_engine_network_id: vmware_engine_network_id, vmware_engine_network: vmware_engine_network, request_id: request_id), 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_vmware_engine_network_client_stub.call_rpc_count + end + end + + def test_update_vmware_engine_network + # 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. + vmware_engine_network = {} + update_mask = {} + request_id = "hello world" + + update_vmware_engine_network_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_vmware_engine_network, name + assert_kind_of ::Google::Cloud::VmwareEngine::V1::UpdateVmwareEngineNetworkRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::VmwareEngine::V1::VmwareEngineNetwork), request["vmware_engine_network"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_vmware_engine_network_client_stub do + # Create client + client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_vmware_engine_network({ vmware_engine_network: vmware_engine_network, update_mask: update_mask, request_id: request_id }) 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.update_vmware_engine_network vmware_engine_network: vmware_engine_network, update_mask: update_mask, request_id: request_id 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.update_vmware_engine_network ::Google::Cloud::VmwareEngine::V1::UpdateVmwareEngineNetworkRequest.new(vmware_engine_network: vmware_engine_network, update_mask: update_mask, request_id: request_id) 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.update_vmware_engine_network({ vmware_engine_network: vmware_engine_network, update_mask: update_mask, request_id: request_id }, 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.update_vmware_engine_network(::Google::Cloud::VmwareEngine::V1::UpdateVmwareEngineNetworkRequest.new(vmware_engine_network: vmware_engine_network, update_mask: update_mask, request_id: request_id), 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, update_vmware_engine_network_client_stub.call_rpc_count + end + end + + def test_delete_vmware_engine_network + # 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" + request_id = "hello world" + etag = "hello world" + + delete_vmware_engine_network_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_vmware_engine_network, name + assert_kind_of ::Google::Cloud::VmwareEngine::V1::DeleteVmwareEngineNetworkRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["request_id"] + assert_equal "hello world", request["etag"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_vmware_engine_network_client_stub do + # Create client + client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_vmware_engine_network({ name: name, request_id: request_id, etag: etag }) 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_vmware_engine_network name: name, request_id: request_id, etag: etag 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_vmware_engine_network ::Google::Cloud::VmwareEngine::V1::DeleteVmwareEngineNetworkRequest.new(name: name, request_id: request_id, etag: etag) 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_vmware_engine_network({ name: name, request_id: request_id, etag: etag }, 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_vmware_engine_network(::Google::Cloud::VmwareEngine::V1::DeleteVmwareEngineNetworkRequest.new(name: name, request_id: request_id, etag: etag), 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_vmware_engine_network_client_stub.call_rpc_count + end + end + + def test_get_vmware_engine_network + # Create GRPC objects. + grpc_response = ::Google::Cloud::VmwareEngine::V1::VmwareEngineNetwork.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_vmware_engine_network_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_vmware_engine_network, name + assert_kind_of ::Google::Cloud::VmwareEngine::V1::GetVmwareEngineNetworkRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_vmware_engine_network_client_stub do + # Create client + client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_vmware_engine_network({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_vmware_engine_network name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_vmware_engine_network ::Google::Cloud::VmwareEngine::V1::GetVmwareEngineNetworkRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_vmware_engine_network({ 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_vmware_engine_network(::Google::Cloud::VmwareEngine::V1::GetVmwareEngineNetworkRequest.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_vmware_engine_network_client_stub.call_rpc_count + end + end + + def test_list_vmware_engine_networks + # Create GRPC objects. + grpc_response = ::Google::Cloud::VmwareEngine::V1::ListVmwareEngineNetworksResponse.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_vmware_engine_networks_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_vmware_engine_networks, name + assert_kind_of ::Google::Cloud::VmwareEngine::V1::ListVmwareEngineNetworksRequest, 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_vmware_engine_networks_client_stub do + # Create client + client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_vmware_engine_networks({ 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_vmware_engine_networks 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_vmware_engine_networks ::Google::Cloud::VmwareEngine::V1::ListVmwareEngineNetworksRequest.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_vmware_engine_networks({ 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_vmware_engine_networks(::Google::Cloud::VmwareEngine::V1::ListVmwareEngineNetworksRequest.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_vmware_engine_networks_client_stub.call_rpc_count + end + end + + def test_create_private_connection + # 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" + private_connection_id = "hello world" + private_connection = {} + request_id = "hello world" + + create_private_connection_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_private_connection, name + assert_kind_of ::Google::Cloud::VmwareEngine::V1::CreatePrivateConnectionRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["private_connection_id"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::VmwareEngine::V1::PrivateConnection), request["private_connection"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_private_connection_client_stub do + # Create client + client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_private_connection({ parent: parent, private_connection_id: private_connection_id, private_connection: private_connection, request_id: request_id }) 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_private_connection parent: parent, private_connection_id: private_connection_id, private_connection: private_connection, request_id: request_id 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_private_connection ::Google::Cloud::VmwareEngine::V1::CreatePrivateConnectionRequest.new(parent: parent, private_connection_id: private_connection_id, private_connection: private_connection, request_id: request_id) 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_private_connection({ parent: parent, private_connection_id: private_connection_id, private_connection: private_connection, request_id: request_id }, 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_private_connection(::Google::Cloud::VmwareEngine::V1::CreatePrivateConnectionRequest.new(parent: parent, private_connection_id: private_connection_id, private_connection: private_connection, request_id: request_id), 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_private_connection_client_stub.call_rpc_count + end + end + + def test_get_private_connection + # Create GRPC objects. + grpc_response = ::Google::Cloud::VmwareEngine::V1::PrivateConnection.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_private_connection_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_private_connection, name + assert_kind_of ::Google::Cloud::VmwareEngine::V1::GetPrivateConnectionRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_private_connection_client_stub do + # Create client + client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_private_connection({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_private_connection name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_private_connection ::Google::Cloud::VmwareEngine::V1::GetPrivateConnectionRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_private_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_private_connection(::Google::Cloud::VmwareEngine::V1::GetPrivateConnectionRequest.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_private_connection_client_stub.call_rpc_count + end + end + + def test_list_private_connections + # Create GRPC objects. + grpc_response = ::Google::Cloud::VmwareEngine::V1::ListPrivateConnectionsResponse.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_private_connections_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_private_connections, name + assert_kind_of ::Google::Cloud::VmwareEngine::V1::ListPrivateConnectionsRequest, 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_private_connections_client_stub do + # Create client + client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_private_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_private_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_private_connections ::Google::Cloud::VmwareEngine::V1::ListPrivateConnectionsRequest.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_private_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_private_connections(::Google::Cloud::VmwareEngine::V1::ListPrivateConnectionsRequest.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_private_connections_client_stub.call_rpc_count + end + end + + def test_update_private_connection + # 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. + private_connection = {} + update_mask = {} + request_id = "hello world" + + update_private_connection_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_private_connection, name + assert_kind_of ::Google::Cloud::VmwareEngine::V1::UpdatePrivateConnectionRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::VmwareEngine::V1::PrivateConnection), request["private_connection"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_private_connection_client_stub do + # Create client + client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_private_connection({ private_connection: private_connection, update_mask: update_mask, request_id: request_id }) 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.update_private_connection private_connection: private_connection, update_mask: update_mask, request_id: request_id 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.update_private_connection ::Google::Cloud::VmwareEngine::V1::UpdatePrivateConnectionRequest.new(private_connection: private_connection, update_mask: update_mask, request_id: request_id) 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.update_private_connection({ private_connection: private_connection, update_mask: update_mask, request_id: request_id }, 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.update_private_connection(::Google::Cloud::VmwareEngine::V1::UpdatePrivateConnectionRequest.new(private_connection: private_connection, update_mask: update_mask, request_id: request_id), 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, update_private_connection_client_stub.call_rpc_count + end + end + + def test_delete_private_connection + # 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" + request_id = "hello world" + + delete_private_connection_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_private_connection, name + assert_kind_of ::Google::Cloud::VmwareEngine::V1::DeletePrivateConnectionRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_private_connection_client_stub do + # Create client + client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_private_connection({ name: name, request_id: request_id }) 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_private_connection name: name, request_id: request_id 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_private_connection ::Google::Cloud::VmwareEngine::V1::DeletePrivateConnectionRequest.new(name: name, request_id: request_id) 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_private_connection({ name: name, request_id: request_id }, 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_private_connection(::Google::Cloud::VmwareEngine::V1::DeletePrivateConnectionRequest.new(name: name, request_id: request_id), 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_private_connection_client_stub.call_rpc_count + end + end + + def test_list_private_connection_peering_routes + # Create GRPC objects. + grpc_response = ::Google::Cloud::VmwareEngine::V1::ListPrivateConnectionPeeringRoutesResponse.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_private_connection_peering_routes_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_private_connection_peering_routes, name + assert_kind_of ::Google::Cloud::VmwareEngine::V1::ListPrivateConnectionPeeringRoutesRequest, 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_private_connection_peering_routes_client_stub do + # Create client + client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_private_connection_peering_routes({ 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_private_connection_peering_routes 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_private_connection_peering_routes ::Google::Cloud::VmwareEngine::V1::ListPrivateConnectionPeeringRoutesRequest.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_private_connection_peering_routes({ 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_private_connection_peering_routes(::Google::Cloud::VmwareEngine::V1::ListPrivateConnectionPeeringRoutesRequest.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_private_connection_peering_routes_client_stub.call_rpc_count + end + end + + def test_grant_dns_bind_permission + # 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" + principal = {} + request_id = "hello world" + + grant_dns_bind_permission_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :grant_dns_bind_permission, name + assert_kind_of ::Google::Cloud::VmwareEngine::V1::GrantDnsBindPermissionRequest, request + assert_equal "hello world", request["name"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::VmwareEngine::V1::Principal), request["principal"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, grant_dns_bind_permission_client_stub do + # Create client + client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.grant_dns_bind_permission({ name: name, principal: principal, request_id: request_id }) 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.grant_dns_bind_permission name: name, principal: principal, request_id: request_id 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.grant_dns_bind_permission ::Google::Cloud::VmwareEngine::V1::GrantDnsBindPermissionRequest.new(name: name, principal: principal, request_id: request_id) 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.grant_dns_bind_permission({ name: name, principal: principal, request_id: request_id }, 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.grant_dns_bind_permission(::Google::Cloud::VmwareEngine::V1::GrantDnsBindPermissionRequest.new(name: name, principal: principal, request_id: request_id), 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, grant_dns_bind_permission_client_stub.call_rpc_count + end + end + + def test_get_dns_bind_permission + # Create GRPC objects. + grpc_response = ::Google::Cloud::VmwareEngine::V1::DnsBindPermission.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_dns_bind_permission_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_dns_bind_permission, name + assert_kind_of ::Google::Cloud::VmwareEngine::V1::GetDnsBindPermissionRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_dns_bind_permission_client_stub do + # Create client + client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_dns_bind_permission({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_dns_bind_permission name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_dns_bind_permission ::Google::Cloud::VmwareEngine::V1::GetDnsBindPermissionRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_dns_bind_permission({ 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_dns_bind_permission(::Google::Cloud::VmwareEngine::V1::GetDnsBindPermissionRequest.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_dns_bind_permission_client_stub.call_rpc_count + end + end + + def test_revoke_dns_bind_permission + # 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" + principal = {} + request_id = "hello world" + + revoke_dns_bind_permission_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :revoke_dns_bind_permission, name + assert_kind_of ::Google::Cloud::VmwareEngine::V1::RevokeDnsBindPermissionRequest, request + assert_equal "hello world", request["name"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::VmwareEngine::V1::Principal), request["principal"] + assert_equal "hello world", request["request_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, revoke_dns_bind_permission_client_stub do + # Create client + client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.revoke_dns_bind_permission({ name: name, principal: principal, request_id: request_id }) 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.revoke_dns_bind_permission name: name, principal: principal, request_id: request_id 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.revoke_dns_bind_permission ::Google::Cloud::VmwareEngine::V1::RevokeDnsBindPermissionRequest.new(name: name, principal: principal, request_id: request_id) 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.revoke_dns_bind_permission({ name: name, principal: principal, request_id: request_id }, 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.revoke_dns_bind_permission(::Google::Cloud::VmwareEngine::V1::RevokeDnsBindPermissionRequest.new(name: name, principal: principal, request_id: request_id), 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, revoke_dns_bind_permission_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::VmwareEngine::V1::VmwareEngine::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::VmwareEngine::V1::VmwareEngine::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::VmwareEngine::V1::VmwareEngine::Client.new do |config| + config.credentials = creds + end + assert_kind_of ::Google::Cloud::VmwareEngine::V1::VmwareEngine::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::VmwareEngine::V1::VmwareEngine::Client.new do |config| + config.credentials = grpc_channel + end + end + + assert_kind_of ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Operations, client.operations_client + end +end diff --git a/owl-bot-staging/google-cloud-vmware_engine-v1/test/helper.rb b/owl-bot-staging/google-cloud-vmware_engine-v1/test/helper.rb new file mode 100644 index 000000000000..672b337030e7 --- /dev/null +++ b/owl-bot-staging/google-cloud-vmware_engine-v1/test/helper.rb @@ -0,0 +1,26 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/mock" +require "minitest/rg" + +require "grpc" + +require "ostruct" diff --git a/owl-bot-staging/google-cloud-vpc_access-v1/.gitignore b/owl-bot-staging/google-cloud-vpc_access-v1/.gitignore new file mode 100644 index 000000000000..0135b6bc6cfc --- /dev/null +++ b/owl-bot-staging/google-cloud-vpc_access-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-vpc_access-v1/.repo-metadata.json b/owl-bot-staging/google-cloud-vpc_access-v1/.repo-metadata.json new file mode 100644 index 000000000000..555203aea0e8 --- /dev/null +++ b/owl-bot-staging/google-cloud-vpc_access-v1/.repo-metadata.json @@ -0,0 +1,18 @@ +{ + "api_id": "vpcaccess.googleapis.com", + "api_shortname": "vpcaccess", + "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-vpc_access-v1/latest", + "distribution_name": "google-cloud-vpc_access-v1", + "is_cloud": true, + "language": "ruby", + "name": "vpcaccess", + "name_pretty": "Serverless VPC Access V1 API", + "product_documentation": "https://cloud.google.com/vpc/docs/serverless-vpc-access", + "release_level": "unreleased", + "repo": "googleapis/google-cloud-ruby", + "requires_billing": true, + "ruby-cloud-description": "Serverless VPC Access enables you to connect from a serverless environment on Google Cloud (Cloud Run, Cloud Functions, or the App Engine standard environment) directly to your VPC network. This connection makes it possible for your serverless environment to access Compute Engine VM instances, Memorystore instances, and any other resources with an internal IP address. Note that google-cloud-vpc_access-v1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-vpc_access instead. See the readme for more details.", + "ruby-cloud-env-prefix": "VPC_ACCESS", + "ruby-cloud-product-url": "https://cloud.google.com/vpc/docs/serverless-vpc-access", + "library_type": "GAPIC_AUTO" +} diff --git a/owl-bot-staging/google-cloud-vpc_access-v1/.rubocop.yml b/owl-bot-staging/google-cloud-vpc_access-v1/.rubocop.yml new file mode 100644 index 000000000000..5d9ab3a8534f --- /dev/null +++ b/owl-bot-staging/google-cloud-vpc_access-v1/.rubocop.yml @@ -0,0 +1,33 @@ +inherit_gem: + google-style: google-style.yml + +AllCops: + Exclude: + - "google-cloud-vpc_access-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-vpc_access-v1.rb" diff --git a/owl-bot-staging/google-cloud-vpc_access-v1/.toys.rb b/owl-bot-staging/google-cloud-vpc_access-v1/.toys.rb new file mode 100644 index 000000000000..177e22456e8a --- /dev/null +++ b/owl-bot-staging/google-cloud-vpc_access-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-vpc_access-v1/.yardopts b/owl-bot-staging/google-cloud-vpc_access-v1/.yardopts new file mode 100644 index 000000000000..18b7b8796058 --- /dev/null +++ b/owl-bot-staging/google-cloud-vpc_access-v1/.yardopts @@ -0,0 +1,12 @@ +--no-private +--title="Serverless VPC Access 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-vpc_access-v1/AUTHENTICATION.md b/owl-bot-staging/google-cloud-vpc_access-v1/AUTHENTICATION.md new file mode 100644 index 000000000000..0a3414fbad29 --- /dev/null +++ b/owl-bot-staging/google-cloud-vpc_access-v1/AUTHENTICATION.md @@ -0,0 +1,122 @@ +# Authentication + +The recommended way to authenticate to the google-cloud-vpc_access-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-vpc_access-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/vpc_access/v1" + +client = ::Google::Cloud::VpcAccess::V1::VpcAccessService::Client.new do |config| + config.credentials = "path/to/credentialfile.json" +end +``` + +To configure a credentials file globally for all clients: + +```ruby +require "google/cloud/vpc_access/v1" + +::Google::Cloud::VpcAccess::V1::VpcAccessService::Client.configure do |config| + config.credentials = "path/to/credentialfile.json" +end + +client = ::Google::Cloud::VpcAccess::V1::VpcAccessService::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-vpc_access-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/vpc_access/v1" + +ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" + +client = ::Google::Cloud::VpcAccess::V1::VpcAccessService::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-vpc_access-v1/CHANGELOG.md b/owl-bot-staging/google-cloud-vpc_access-v1/CHANGELOG.md new file mode 100644 index 000000000000..f88957a62ba2 --- /dev/null +++ b/owl-bot-staging/google-cloud-vpc_access-v1/CHANGELOG.md @@ -0,0 +1,2 @@ +# Release History + diff --git a/owl-bot-staging/google-cloud-vpc_access-v1/Gemfile b/owl-bot-staging/google-cloud-vpc_access-v1/Gemfile new file mode 100644 index 000000000000..1d08558908d8 --- /dev/null +++ b/owl-bot-staging/google-cloud-vpc_access-v1/Gemfile @@ -0,0 +1,14 @@ +source "https://rubygems.org" + +gemspec + +gem "google-style", "~> 1.32.0" +gem "irb", "~> 1.17" +gem "minitest", "~> 6.0.2" +gem "minitest-focus", "~> 1.4" +gem "minitest-mock", "~> 5.27" +gem "minitest-rg", "~> 5.3" +gem "ostruct", "~> 0.5.5" +gem "rake", ">= 13.0" +gem "redcarpet", "~> 3.6" +gem "yard", "~> 0.9" diff --git a/owl-bot-staging/google-cloud-vpc_access-v1/LICENSE.md b/owl-bot-staging/google-cloud-vpc_access-v1/LICENSE.md new file mode 100644 index 000000000000..c261857ba6ad --- /dev/null +++ b/owl-bot-staging/google-cloud-vpc_access-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-vpc_access-v1/README.md b/owl-bot-staging/google-cloud-vpc_access-v1/README.md new file mode 100644 index 000000000000..f3ab3b89c390 --- /dev/null +++ b/owl-bot-staging/google-cloud-vpc_access-v1/README.md @@ -0,0 +1,154 @@ +# Ruby Client for the Serverless VPC Access V1 API + +API for managing VPC access connectors. + +Serverless VPC Access enables you to connect from a serverless environment on Google Cloud (Cloud Run, Cloud Functions, or the App Engine standard environment) directly to your VPC network. This connection makes it possible for your serverless environment to access Compute Engine VM instances, Memorystore instances, and any other resources with an internal IP address. + +https://github.com/googleapis/google-cloud-ruby + +This gem is a _versioned_ client. It provides basic client classes for a +specific version of the Serverless VPC Access V1 API. Most users should consider using +the main client gem, +[google-cloud-vpc_access](https://rubygems.org/gems/google-cloud-vpc_access). +See the section below titled *Which client should I use?* for more information. + +## Installation + +``` +$ gem install google-cloud-vpc_access-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/vpcaccess.googleapis.com) +1. [Set up authentication.](AUTHENTICATION.md) + +## Quick Start + +```ruby +require "google/cloud/vpc_access/v1" + +client = ::Google::Cloud::VpcAccess::V1::VpcAccessService::Client.new +request = ::Google::Cloud::VpcAccess::V1::CreateConnectorRequest.new # (request fields as keyword arguments...) +response = client.create_connector request +``` + +View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-vpc_access-v1/latest) +for class and method documentation. + +See also the [Product Documentation](https://cloud.google.com/vpc/docs/serverless-vpc-access) +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/vpc_access/v1" +require "logger" + +client = ::Google::Cloud::VpcAccess::V1::VpcAccessService::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-vpc_access`, +and lower-level _versioned_ client libraries with names such as +`google-cloud-vpc_access-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-vpc_access`. +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-vpc_access-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-vpc_access-v1/Rakefile b/owl-bot-staging/google-cloud-vpc_access-v1/Rakefile new file mode 100644 index 000000000000..e8bc005d5a03 --- /dev/null +++ b/owl-bot-staging/google-cloud-vpc_access-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-vpc_access-v1 acceptance tests." +task :acceptance, :project, :keyfile do |t, args| + project = args[:project] + project ||= + ENV["VPC_ACCESS_TEST_PROJECT"] || + ENV["GCLOUD_TEST_PROJECT"] + keyfile = args[:keyfile] + keyfile ||= + ENV["VPC_ACCESS_TEST_KEYFILE"] || + ENV["GCLOUD_TEST_KEYFILE"] + if keyfile + keyfile = File.read keyfile + else + keyfile ||= + ENV["VPC_ACCESS_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 VPC_ACCESS_TEST_PROJECT=test123 VPC_ACCESS_TEST_KEYFILE=/path/to/keyfile.json rake acceptance" + end + require "google/cloud/vpc_access/v1/vpc_access_service/credentials" + ::Google::Cloud::VpcAccess::V1::VpcAccessService::Credentials.env_vars.each do |path| + ENV[path] = nil + end + ENV["VPC_ACCESS_PROJECT"] = project + ENV["VPC_ACCESS_TEST_PROJECT"] = project + ENV["VPC_ACCESS_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-vpc_access-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-vpc_access-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-vpc_access-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-vpc_access-v1 gem does not have doctest tests." +end + +desc "Run the CI build" +task :ci do + header "BUILDING google-cloud-vpc_access-v1" + header "google-cloud-vpc_access-v1 rubocop", "*" + Rake::Task[:rubocop].invoke + header "google-cloud-vpc_access-v1 yard", "*" + Rake::Task[:yard].invoke + header "google-cloud-vpc_access-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-vpc_access-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-vpc_access-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-vpc_access-v1/gapic_metadata.json b/owl-bot-staging/google-cloud-vpc_access-v1/gapic_metadata.json new file mode 100644 index 000000000000..2dae0b91baaf --- /dev/null +++ b/owl-bot-staging/google-cloud-vpc_access-v1/gapic_metadata.json @@ -0,0 +1,38 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "ruby", + "protoPackage": "google.cloud.vpcaccess.v1", + "libraryPackage": "::Google::Cloud::VpcAccess::V1", + "services": { + "VpcAccessService": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::VpcAccess::V1::VpcAccessService::Client", + "rpcs": { + "CreateConnector": { + "methods": [ + "create_connector" + ] + }, + "GetConnector": { + "methods": [ + "get_connector" + ] + }, + "ListConnectors": { + "methods": [ + "list_connectors" + ] + }, + "DeleteConnector": { + "methods": [ + "delete_connector" + ] + } + } + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-vpc_access-v1/google-cloud-vpc_access-v1.gemspec b/owl-bot-staging/google-cloud-vpc_access-v1/google-cloud-vpc_access-v1.gemspec new file mode 100644 index 000000000000..6f98e60fcf08 --- /dev/null +++ b/owl-bot-staging/google-cloud-vpc_access-v1/google-cloud-vpc_access-v1.gemspec @@ -0,0 +1,29 @@ +# -*- ruby -*- +# encoding: utf-8 + +require File.expand_path("lib/google/cloud/vpc_access/v1/version", __dir__) + +Gem::Specification.new do |gem| + gem.name = "google-cloud-vpc_access-v1" + gem.version = Google::Cloud::VpcAccess::V1::VERSION + + gem.authors = ["Google LLC"] + gem.email = "googleapis-packages@google.com" + gem.description = "Serverless VPC Access enables you to connect from a serverless environment on Google Cloud (Cloud Run, Cloud Functions, or the App Engine standard environment) directly to your VPC network. This connection makes it possible for your serverless environment to access Compute Engine VM instances, Memorystore instances, and any other resources with an internal IP address. Note that google-cloud-vpc_access-v1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-vpc_access instead. See the readme for more details." + gem.summary = "API for managing VPC access connectors." + 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.2" + + gem.add_dependency "gapic-common", "~> 1.2" + gem.add_dependency "google-cloud-errors", "~> 1.0" + gem.add_dependency "google-cloud-location", "~> 1.0" +end diff --git a/owl-bot-staging/google-cloud-vpc_access-v1/lib/google-cloud-vpc_access-v1.rb b/owl-bot-staging/google-cloud-vpc_access-v1/lib/google-cloud-vpc_access-v1.rb new file mode 100644 index 000000000000..dd22501e9404 --- /dev/null +++ b/owl-bot-staging/google-cloud-vpc_access-v1/lib/google-cloud-vpc_access-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/vpc_access/v1" diff --git a/owl-bot-staging/google-cloud-vpc_access-v1/lib/google/cloud/vpc_access/v1.rb b/owl-bot-staging/google-cloud-vpc_access-v1/lib/google/cloud/vpc_access/v1.rb new file mode 100644 index 000000000000..927136b99d80 --- /dev/null +++ b/owl-bot-staging/google-cloud-vpc_access-v1/lib/google/cloud/vpc_access/v1.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/vpc_access/v1/vpc_access_service" +require "google/cloud/vpc_access/v1/version" + +module Google + module Cloud + module VpcAccess + ## + # API client module. + # + # @example Load this package, including all its services, and instantiate a gRPC client + # + # require "google/cloud/vpc_access/v1" + # client = ::Google::Cloud::VpcAccess::V1::VpcAccessService::Client.new + # + # @example Load this package, including all its services, and instantiate a REST client + # + # require "google/cloud/vpc_access/v1" + # client = ::Google::Cloud::VpcAccess::V1::VpcAccessService::Rest::Client.new + # + module V1 + end + end + end +end + +helper_path = ::File.join __dir__, "v1", "_helpers.rb" +require "google/cloud/vpc_access/v1/_helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-vpc_access-v1/lib/google/cloud/vpc_access/v1/bindings_override.rb b/owl-bot-staging/google-cloud-vpc_access-v1/lib/google/cloud/vpc_access/v1/bindings_override.rb new file mode 100644 index 000000000000..3da4e39390e9 --- /dev/null +++ b/owl-bot-staging/google-cloud-vpc_access-v1/lib/google/cloud/vpc_access/v1/bindings_override.rb @@ -0,0 +1,64 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 VpcAccess + ## + # @example Loading just the REST part of this package, including all its services, and instantiating a REST client + # + # require "google/cloud/vpc_access/v1/rest" + # client = ::Google::Cloud::VpcAccess::V1::VpcAccessService::Rest::Client.new + # + module V1 + ## + # @private + # Initialize the mixin bindings configuration + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "VpcAccess"] + 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.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 + end + yield @configure if block_given? + @configure + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-vpc_access-v1/lib/google/cloud/vpc_access/v1/rest.rb b/owl-bot-staging/google-cloud-vpc_access-v1/lib/google/cloud/vpc_access/v1/rest.rb new file mode 100644 index 000000000000..998323ec2725 --- /dev/null +++ b/owl-bot-staging/google-cloud-vpc_access-v1/lib/google/cloud/vpc_access/v1/rest.rb @@ -0,0 +1,38 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/vpc_access/v1/vpc_access_service/rest" +require "google/cloud/vpc_access/v1/bindings_override" +require "google/cloud/vpc_access/v1/version" + +module Google + module Cloud + module VpcAccess + ## + # To load just the REST part of this package, including all its services, and instantiate a REST client: + # + # @example + # + # require "google/cloud/vpc_access/v1/rest" + # client = ::Google::Cloud::VpcAccess::V1::VpcAccessService::Rest::Client.new + # + module V1 + end + end + end +end diff --git a/owl-bot-staging/google-cloud-vpc_access-v1/lib/google/cloud/vpc_access/v1/version.rb b/owl-bot-staging/google-cloud-vpc_access-v1/lib/google/cloud/vpc_access/v1/version.rb new file mode 100644 index 000000000000..3348f75044ad --- /dev/null +++ b/owl-bot-staging/google-cloud-vpc_access-v1/lib/google/cloud/vpc_access/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 VpcAccess + module V1 + VERSION = "0.0.1" + end + end + end +end diff --git a/owl-bot-staging/google-cloud-vpc_access-v1/lib/google/cloud/vpc_access/v1/vpc_access_service.rb b/owl-bot-staging/google-cloud-vpc_access-v1/lib/google/cloud/vpc_access/v1/vpc_access_service.rb new file mode 100644 index 000000000000..b1274c5f41a2 --- /dev/null +++ b/owl-bot-staging/google-cloud-vpc_access-v1/lib/google/cloud/vpc_access/v1/vpc_access_service.rb @@ -0,0 +1,58 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/vpc_access/v1/version" + +require "google/cloud/vpc_access/v1/vpc_access_service/credentials" +require "google/cloud/vpc_access/v1/vpc_access_service/paths" +require "google/cloud/vpc_access/v1/vpc_access_service/operations" +require "google/cloud/vpc_access/v1/vpc_access_service/client" +require "google/cloud/vpc_access/v1/vpc_access_service/rest" + +module Google + module Cloud + module VpcAccess + module V1 + ## + # Serverless VPC Access API allows users to create and manage connectors for + # App Engine, Cloud Functions and Cloud Run to have internal connections to + # Virtual Private Cloud networks. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/vpc_access/v1/vpc_access_service" + # client = ::Google::Cloud::VpcAccess::V1::VpcAccessService::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/vpc_access/v1/vpc_access_service/rest" + # client = ::Google::Cloud::VpcAccess::V1::VpcAccessService::Rest::Client.new + # + module VpcAccessService + end + end + end + end +end + +helper_path = ::File.join __dir__, "vpc_access_service", "helpers.rb" +require "google/cloud/vpc_access/v1/vpc_access_service/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-vpc_access-v1/lib/google/cloud/vpc_access/v1/vpc_access_service/client.rb b/owl-bot-staging/google-cloud-vpc_access-v1/lib/google/cloud/vpc_access/v1/vpc_access_service/client.rb new file mode 100644 index 000000000000..3ec4e8d43b00 --- /dev/null +++ b/owl-bot-staging/google-cloud-vpc_access-v1/lib/google/cloud/vpc_access/v1/vpc_access_service/client.rb @@ -0,0 +1,830 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/vpcaccess/v1/vpc_access_pb" +require "google/cloud/location" + +module Google + module Cloud + module VpcAccess + module V1 + module VpcAccessService + ## + # Client for the VpcAccessService service. + # + # Serverless VPC Access API allows users to create and manage connectors for + # App Engine, Cloud Functions and Cloud Run to have internal connections to + # Virtual Private Cloud networks. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "vpcaccess.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :vpc_access_service_stub + + ## + # Configure the VpcAccessService Client class. + # + # See {::Google::Cloud::VpcAccess::V1::VpcAccessService::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all VpcAccessService clients + # ::Google::Cloud::VpcAccess::V1::VpcAccessService::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", "VpcAccess", "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.timeout = 60.0 + default_config.retry_policy = { + initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 2] + } + + default_config.rpcs.create_connector.timeout = 60.0 + + default_config.rpcs.get_connector.timeout = 60.0 + + default_config.rpcs.list_connectors.timeout = 60.0 + + default_config.rpcs.delete_connector.timeout = 60.0 + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the VpcAccessService 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::VpcAccess::V1::VpcAccessService::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 + @vpc_access_service_stub.universe_domain + end + + ## + # Create a new VpcAccessService client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::VpcAccess::V1::VpcAccessService::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::VpcAccess::V1::VpcAccessService::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the VpcAccessService 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/vpcaccess/v1/vpc_access_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 + + @vpc_access_service_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::VpcAccess::V1::VpcAccessService::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 + ) + + @vpc_access_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 = @vpc_access_service_stub.endpoint + config.universe_domain = @vpc_access_service_stub.universe_domain + config.logger = @vpc_access_service_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::VpcAccess::V1::VpcAccessService::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 + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @vpc_access_service_stub.logger + end + + # Service calls + + ## + # Creates a Serverless VPC Access connector, returns an operation. + # + # @overload create_connector(request, options = nil) + # Pass arguments to `create_connector` via a request object, either of type + # {::Google::Cloud::VpcAccess::V1::CreateConnectorRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VpcAccess::V1::CreateConnectorRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_connector(parent: nil, connector_id: nil, connector: nil) + # Pass arguments to `create_connector` via keyword arguments. Note that at + # least one keyword argument is 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 and location in which the configuration should be created, + # specified in the format `projects/*/locations/*`. + # @param connector_id [::String] + # Required. The ID to use for this connector. + # @param connector [::Google::Cloud::VpcAccess::V1::Connector, ::Hash] + # Required. Resource 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/vpc_access/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VpcAccess::V1::VpcAccessService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VpcAccess::V1::CreateConnectorRequest.new + # + # # Call the create_connector method. + # result = client.create_connector 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_connector request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VpcAccess::V1::CreateConnectorRequest + + # Converts hash 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_connector.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::VpcAccess::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_connector.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_connector.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vpc_access_service_stub.call_rpc :create_connector, 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 + + ## + # Gets a Serverless VPC Access connector. Returns NOT_FOUND if the resource + # does not exist. + # + # @overload get_connector(request, options = nil) + # Pass arguments to `get_connector` via a request object, either of type + # {::Google::Cloud::VpcAccess::V1::GetConnectorRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VpcAccess::V1::GetConnectorRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_connector(name: nil) + # Pass arguments to `get_connector` via keyword arguments. Note that at + # least one keyword argument is 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 a Serverless VPC Access connector to get. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::VpcAccess::V1::Connector] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::VpcAccess::V1::Connector] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/vpc_access/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VpcAccess::V1::VpcAccessService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VpcAccess::V1::GetConnectorRequest.new + # + # # Call the get_connector method. + # result = client.get_connector request + # + # # The returned object is of type Google::Cloud::VpcAccess::V1::Connector. + # p result + # + def get_connector request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VpcAccess::V1::GetConnectorRequest + + # Converts hash 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_connector.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::VpcAccess::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_connector.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_connector.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vpc_access_service_stub.call_rpc :get_connector, 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 Serverless VPC Access connectors. + # + # @overload list_connectors(request, options = nil) + # Pass arguments to `list_connectors` via a request object, either of type + # {::Google::Cloud::VpcAccess::V1::ListConnectorsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VpcAccess::V1::ListConnectorsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_connectors(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_connectors` via keyword arguments. Note that at + # least one keyword argument is 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 and location from which the routes should be listed. + # @param page_size [::Integer] + # Maximum number of functions to return per call. + # @param page_token [::String] + # Continuation token. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::VpcAccess::V1::Connector>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::VpcAccess::V1::Connector>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/vpc_access/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VpcAccess::V1::VpcAccessService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VpcAccess::V1::ListConnectorsRequest.new + # + # # Call the list_connectors method. + # result = client.list_connectors 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::VpcAccess::V1::Connector. + # p item + # end + # + def list_connectors request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VpcAccess::V1::ListConnectorsRequest + + # Converts hash 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_connectors.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::VpcAccess::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_connectors.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_connectors.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vpc_access_service_stub.call_rpc :list_connectors, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @vpc_access_service_stub, :list_connectors, 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 Serverless VPC Access connector. Returns NOT_FOUND if the + # resource does not exist. + # + # @overload delete_connector(request, options = nil) + # Pass arguments to `delete_connector` via a request object, either of type + # {::Google::Cloud::VpcAccess::V1::DeleteConnectorRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VpcAccess::V1::DeleteConnectorRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_connector(name: nil) + # Pass arguments to `delete_connector` via keyword arguments. Note that at + # least one keyword argument is 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 a Serverless VPC Access connector 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/vpc_access/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VpcAccess::V1::VpcAccessService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VpcAccess::V1::DeleteConnectorRequest.new + # + # # Call the delete_connector method. + # result = client.delete_connector 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_connector request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VpcAccess::V1::DeleteConnectorRequest + + # Converts hash 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_connector.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::VpcAccess::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_connector.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_connector.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vpc_access_service_stub.call_rpc :delete_connector, 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 VpcAccessService API. + # + # This class represents the configuration for VpcAccessService, + # 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::VpcAccess::V1::VpcAccessService::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_connector to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::VpcAccess::V1::VpcAccessService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.create_connector.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::VpcAccess::V1::VpcAccessService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.create_connector.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::VpcAccess::V1::VpcAccessService::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 = "vpcaccess.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 VpcAccessService 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_connector` + # @return [::Gapic::Config::Method] + # + attr_reader :create_connector + ## + # RPC-specific configuration for `get_connector` + # @return [::Gapic::Config::Method] + # + attr_reader :get_connector + ## + # RPC-specific configuration for `list_connectors` + # @return [::Gapic::Config::Method] + # + attr_reader :list_connectors + ## + # RPC-specific configuration for `delete_connector` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_connector + + # @private + def initialize parent_rpcs = nil + create_connector_config = parent_rpcs.create_connector if parent_rpcs.respond_to? :create_connector + @create_connector = ::Gapic::Config::Method.new create_connector_config + get_connector_config = parent_rpcs.get_connector if parent_rpcs.respond_to? :get_connector + @get_connector = ::Gapic::Config::Method.new get_connector_config + list_connectors_config = parent_rpcs.list_connectors if parent_rpcs.respond_to? :list_connectors + @list_connectors = ::Gapic::Config::Method.new list_connectors_config + delete_connector_config = parent_rpcs.delete_connector if parent_rpcs.respond_to? :delete_connector + @delete_connector = ::Gapic::Config::Method.new delete_connector_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-vpc_access-v1/lib/google/cloud/vpc_access/v1/vpc_access_service/credentials.rb b/owl-bot-staging/google-cloud-vpc_access-v1/lib/google/cloud/vpc_access/v1/vpc_access_service/credentials.rb new file mode 100644 index 000000000000..cb40b03f48ad --- /dev/null +++ b/owl-bot-staging/google-cloud-vpc_access-v1/lib/google/cloud/vpc_access/v1/vpc_access_service/credentials.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! + +require "googleauth" + +module Google + module Cloud + module VpcAccess + module V1 + module VpcAccessService + # Credentials for the VpcAccessService API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/cloud-platform" + ] + self.env_vars = [ + "VPC_ACCESS_CREDENTIALS", + "VPC_ACCESS_KEYFILE", + "GOOGLE_CLOUD_CREDENTIALS", + "GOOGLE_CLOUD_KEYFILE", + "GCLOUD_KEYFILE", + "VPC_ACCESS_CREDENTIALS_JSON", + "VPC_ACCESS_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-vpc_access-v1/lib/google/cloud/vpc_access/v1/vpc_access_service/operations.rb b/owl-bot-staging/google-cloud-vpc_access-v1/lib/google/cloud/vpc_access/v1/vpc_access_service/operations.rb new file mode 100644 index 000000000000..0680a1f755d1 --- /dev/null +++ b/owl-bot-staging/google-cloud-vpc_access-v1/lib/google/cloud/vpc_access/v1/vpc_access_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 VpcAccess + module V1 + module VpcAccessService + # Service that implements Longrunning Operations API. + class Operations + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "vpcaccess.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :operations_stub + + ## + # Configuration for the VpcAccessService 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 VpcAccessService 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::VpcAccess::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::VpcAccess::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::VpcAccess::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::VpcAccess::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::VpcAccess::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 = "vpcaccess.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-vpc_access-v1/lib/google/cloud/vpc_access/v1/vpc_access_service/paths.rb b/owl-bot-staging/google-cloud-vpc_access-v1/lib/google/cloud/vpc_access/v1/vpc_access_service/paths.rb new file mode 100644 index 000000000000..83b10fa7cd6a --- /dev/null +++ b/owl-bot-staging/google-cloud-vpc_access-v1/lib/google/cloud/vpc_access/v1/vpc_access_service/paths.rb @@ -0,0 +1,69 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 VpcAccess + module V1 + module VpcAccessService + # Path helper methods for the VpcAccessService API. + module Paths + ## + # Create a fully-qualified Connector resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/connectors/{connector}` + # + # @param project [String] + # @param location [String] + # @param connector [String] + # + # @return [::String] + def connector_path project:, location:, connector: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/connectors/#{connector}" + 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-vpc_access-v1/lib/google/cloud/vpc_access/v1/vpc_access_service/rest.rb b/owl-bot-staging/google-cloud-vpc_access-v1/lib/google/cloud/vpc_access/v1/vpc_access_service/rest.rb new file mode 100644 index 000000000000..4ab07e129b6a --- /dev/null +++ b/owl-bot-staging/google-cloud-vpc_access-v1/lib/google/cloud/vpc_access/v1/vpc_access_service/rest.rb @@ -0,0 +1,56 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/vpc_access/v1/version" +require "google/cloud/vpc_access/v1/bindings_override" + +require "google/cloud/vpc_access/v1/vpc_access_service/credentials" +require "google/cloud/vpc_access/v1/vpc_access_service/paths" +require "google/cloud/vpc_access/v1/vpc_access_service/rest/operations" +require "google/cloud/vpc_access/v1/vpc_access_service/rest/client" + +module Google + module Cloud + module VpcAccess + module V1 + ## + # Serverless VPC Access API allows users to create and manage connectors for + # App Engine, Cloud Functions and Cloud Run to have internal connections to + # Virtual Private Cloud networks. + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/vpc_access/v1/vpc_access_service/rest" + # client = ::Google::Cloud::VpcAccess::V1::VpcAccessService::Rest::Client.new + # + module VpcAccessService + # Client for the REST transport + module Rest + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "rest", "helpers.rb" +require "google/cloud/vpc_access/v1/vpc_access_service/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-vpc_access-v1/lib/google/cloud/vpc_access/v1/vpc_access_service/rest/client.rb b/owl-bot-staging/google-cloud-vpc_access-v1/lib/google/cloud/vpc_access/v1/vpc_access_service/rest/client.rb new file mode 100644 index 000000000000..461527c82fd1 --- /dev/null +++ b/owl-bot-staging/google-cloud-vpc_access-v1/lib/google/cloud/vpc_access/v1/vpc_access_service/rest/client.rb @@ -0,0 +1,767 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/vpcaccess/v1/vpc_access_pb" +require "google/cloud/vpc_access/v1/vpc_access_service/rest/service_stub" +require "google/cloud/location/rest" + +module Google + module Cloud + module VpcAccess + module V1 + module VpcAccessService + module Rest + ## + # REST client for the VpcAccessService service. + # + # Serverless VPC Access API allows users to create and manage connectors for + # App Engine, Cloud Functions and Cloud Run to have internal connections to + # Virtual Private Cloud networks. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "vpcaccess.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :vpc_access_service_stub + + ## + # Configure the VpcAccessService Client class. + # + # See {::Google::Cloud::VpcAccess::V1::VpcAccessService::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all VpcAccessService clients + # ::Google::Cloud::VpcAccess::V1::VpcAccessService::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", "VpcAccess", "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.timeout = 60.0 + default_config.retry_policy = { + initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 2] + } + + default_config.rpcs.create_connector.timeout = 60.0 + + default_config.rpcs.get_connector.timeout = 60.0 + + default_config.rpcs.list_connectors.timeout = 60.0 + + default_config.rpcs.delete_connector.timeout = 60.0 + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the VpcAccessService 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::VpcAccess::V1::VpcAccessService::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 + @vpc_access_service_stub.universe_domain + end + + ## + # Create a new VpcAccessService REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::VpcAccess::V1::VpcAccessService::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::VpcAccess::V1::VpcAccessService::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the VpcAccessService 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::VpcAccess::V1::VpcAccessService::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 + + @vpc_access_service_stub = ::Google::Cloud::VpcAccess::V1::VpcAccessService::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials, + logger: @config.logger + ) + + @vpc_access_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 = @vpc_access_service_stub.endpoint + config.universe_domain = @vpc_access_service_stub.universe_domain + config.bindings_override = @config.bindings_override + config.logger = @vpc_access_service_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::VpcAccess::V1::VpcAccessService::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 + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @vpc_access_service_stub.logger + end + + # Service calls + + ## + # Creates a Serverless VPC Access connector, returns an operation. + # + # @overload create_connector(request, options = nil) + # Pass arguments to `create_connector` via a request object, either of type + # {::Google::Cloud::VpcAccess::V1::CreateConnectorRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VpcAccess::V1::CreateConnectorRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_connector(parent: nil, connector_id: nil, connector: nil) + # Pass arguments to `create_connector` via keyword arguments. Note that at + # least one keyword argument is 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 and location in which the configuration should be created, + # specified in the format `projects/*/locations/*`. + # @param connector_id [::String] + # Required. The ID to use for this connector. + # @param connector [::Google::Cloud::VpcAccess::V1::Connector, ::Hash] + # Required. Resource 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/vpc_access/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VpcAccess::V1::VpcAccessService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VpcAccess::V1::CreateConnectorRequest.new + # + # # Call the create_connector method. + # result = client.create_connector 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_connector request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VpcAccess::V1::CreateConnectorRequest + + # Converts hash 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_connector.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::VpcAccess::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_connector.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_connector.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vpc_access_service_stub.create_connector 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 + + ## + # Gets a Serverless VPC Access connector. Returns NOT_FOUND if the resource + # does not exist. + # + # @overload get_connector(request, options = nil) + # Pass arguments to `get_connector` via a request object, either of type + # {::Google::Cloud::VpcAccess::V1::GetConnectorRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VpcAccess::V1::GetConnectorRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_connector(name: nil) + # Pass arguments to `get_connector` via keyword arguments. Note that at + # least one keyword argument is 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 a Serverless VPC Access connector to get. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::VpcAccess::V1::Connector] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::VpcAccess::V1::Connector] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/vpc_access/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VpcAccess::V1::VpcAccessService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VpcAccess::V1::GetConnectorRequest.new + # + # # Call the get_connector method. + # result = client.get_connector request + # + # # The returned object is of type Google::Cloud::VpcAccess::V1::Connector. + # p result + # + def get_connector request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VpcAccess::V1::GetConnectorRequest + + # Converts hash 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_connector.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::VpcAccess::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_connector.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_connector.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vpc_access_service_stub.get_connector 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 Serverless VPC Access connectors. + # + # @overload list_connectors(request, options = nil) + # Pass arguments to `list_connectors` via a request object, either of type + # {::Google::Cloud::VpcAccess::V1::ListConnectorsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VpcAccess::V1::ListConnectorsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_connectors(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_connectors` via keyword arguments. Note that at + # least one keyword argument is 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 and location from which the routes should be listed. + # @param page_size [::Integer] + # Maximum number of functions to return per call. + # @param page_token [::String] + # Continuation token. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::VpcAccess::V1::Connector>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::VpcAccess::V1::Connector>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/vpc_access/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VpcAccess::V1::VpcAccessService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VpcAccess::V1::ListConnectorsRequest.new + # + # # Call the list_connectors method. + # result = client.list_connectors 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::VpcAccess::V1::Connector. + # p item + # end + # + def list_connectors request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VpcAccess::V1::ListConnectorsRequest + + # Converts hash 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_connectors.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::VpcAccess::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_connectors.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_connectors.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vpc_access_service_stub.list_connectors request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @vpc_access_service_stub, :list_connectors, "connectors", 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 Serverless VPC Access connector. Returns NOT_FOUND if the + # resource does not exist. + # + # @overload delete_connector(request, options = nil) + # Pass arguments to `delete_connector` via a request object, either of type + # {::Google::Cloud::VpcAccess::V1::DeleteConnectorRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::VpcAccess::V1::DeleteConnectorRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_connector(name: nil) + # Pass arguments to `delete_connector` via keyword arguments. Note that at + # least one keyword argument is 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 a Serverless VPC Access connector 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/vpc_access/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::VpcAccess::V1::VpcAccessService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::VpcAccess::V1::DeleteConnectorRequest.new + # + # # Call the delete_connector method. + # result = client.delete_connector 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_connector request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VpcAccess::V1::DeleteConnectorRequest + + # Converts hash 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_connector.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::VpcAccess::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_connector.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_connector.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @vpc_access_service_stub.delete_connector 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 + + ## + # Configuration class for the VpcAccessService REST API. + # + # This class represents the configuration for VpcAccessService 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::VpcAccess::V1::VpcAccessService::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_connector to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::VpcAccess::V1::VpcAccessService::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.create_connector.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::VpcAccess::V1::VpcAccessService::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.create_connector.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 = "vpcaccess.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 VpcAccessService 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_connector` + # @return [::Gapic::Config::Method] + # + attr_reader :create_connector + ## + # RPC-specific configuration for `get_connector` + # @return [::Gapic::Config::Method] + # + attr_reader :get_connector + ## + # RPC-specific configuration for `list_connectors` + # @return [::Gapic::Config::Method] + # + attr_reader :list_connectors + ## + # RPC-specific configuration for `delete_connector` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_connector + + # @private + def initialize parent_rpcs = nil + create_connector_config = parent_rpcs.create_connector if parent_rpcs.respond_to? :create_connector + @create_connector = ::Gapic::Config::Method.new create_connector_config + get_connector_config = parent_rpcs.get_connector if parent_rpcs.respond_to? :get_connector + @get_connector = ::Gapic::Config::Method.new get_connector_config + list_connectors_config = parent_rpcs.list_connectors if parent_rpcs.respond_to? :list_connectors + @list_connectors = ::Gapic::Config::Method.new list_connectors_config + delete_connector_config = parent_rpcs.delete_connector if parent_rpcs.respond_to? :delete_connector + @delete_connector = ::Gapic::Config::Method.new delete_connector_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-vpc_access-v1/lib/google/cloud/vpc_access/v1/vpc_access_service/rest/operations.rb b/owl-bot-staging/google-cloud-vpc_access-v1/lib/google/cloud/vpc_access/v1/vpc_access_service/rest/operations.rb new file mode 100644 index 000000000000..55477e7f6600 --- /dev/null +++ b/owl-bot-staging/google-cloud-vpc_access-v1/lib/google/cloud/vpc_access/v1/vpc_access_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 VpcAccess + module V1 + module VpcAccessService + module Rest + # Service that implements Longrunning Operations API. + class Operations + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "vpcaccess.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :operations_stub + + ## + # Configuration for the VpcAccessService 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 VpcAccessService 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::VpcAccess::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::VpcAccess::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::VpcAccess::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::VpcAccess::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 = "vpcaccess.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}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/?$}, 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-vpc_access-v1/lib/google/cloud/vpc_access/v1/vpc_access_service/rest/service_stub.rb b/owl-bot-staging/google-cloud-vpc_access-v1/lib/google/cloud/vpc_access/v1/vpc_access_service/rest/service_stub.rb new file mode 100644 index 000000000000..e7aeac787a8c --- /dev/null +++ b/owl-bot-staging/google-cloud-vpc_access-v1/lib/google/cloud/vpc_access/v1/vpc_access_service/rest/service_stub.rb @@ -0,0 +1,326 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/vpcaccess/v1/vpc_access_pb" + +module Google + module Cloud + module VpcAccess + module V1 + module VpcAccessService + module Rest + ## + # REST service stub for the VpcAccessService 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_connector REST call + # + # @param request_pb [::Google::Cloud::VpcAccess::V1::CreateConnectorRequest] + # 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_connector request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_connector_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_connector", + 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_connector REST call + # + # @param request_pb [::Google::Cloud::VpcAccess::V1::GetConnectorRequest] + # 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::VpcAccess::V1::Connector] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::VpcAccess::V1::Connector] + # A result object deserialized from the server's reply + def get_connector request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_connector_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_connector", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::VpcAccess::V1::Connector.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_connectors REST call + # + # @param request_pb [::Google::Cloud::VpcAccess::V1::ListConnectorsRequest] + # 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::VpcAccess::V1::ListConnectorsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::VpcAccess::V1::ListConnectorsResponse] + # A result object deserialized from the server's reply + def list_connectors request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_connectors_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_connectors", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::VpcAccess::V1::ListConnectorsResponse.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_connector REST call + # + # @param request_pb [::Google::Cloud::VpcAccess::V1::DeleteConnectorRequest] + # 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_connector request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_connector_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_connector", + 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 + + ## + # @private + # + # GRPC transcoding helper method for the create_connector REST call + # + # @param request_pb [::Google::Cloud::VpcAccess::V1::CreateConnectorRequest] + # 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_connector_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/connectors", + body: "connector", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_connector REST call + # + # @param request_pb [::Google::Cloud::VpcAccess::V1::GetConnectorRequest] + # 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_connector_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/connectors/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_connectors REST call + # + # @param request_pb [::Google::Cloud::VpcAccess::V1::ListConnectorsRequest] + # 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_connectors_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/connectors", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_connector REST call + # + # @param request_pb [::Google::Cloud::VpcAccess::V1::DeleteConnectorRequest] + # 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_connector_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/connectors/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-vpc_access-v1/lib/google/cloud/vpcaccess/v1/vpc_access_pb.rb b/owl-bot-staging/google-cloud-vpc_access-v1/lib/google/cloud/vpcaccess/v1/vpc_access_pb.rb new file mode 100644 index 000000000000..b39bea6a1825 --- /dev/null +++ b/owl-bot-staging/google-cloud-vpc_access-v1/lib/google/cloud/vpcaccess/v1/vpc_access_pb.rb @@ -0,0 +1,36 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/vpcaccess/v1/vpc_access.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/timestamp_pb' + + +descriptor_data = "\n*google/cloud/vpcaccess/v1/vpc_access.proto\x12\x19google.cloud.vpcaccess.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\x1fgoogle/protobuf/timestamp.proto\"\xc8\x04\n\tConnector\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x0f\n\x07network\x18\x02 \x01(\t\x12\x15\n\rip_cidr_range\x18\x03 \x01(\t\x12>\n\x05state\x18\x04 \x01(\x0e\x32*.google.cloud.vpcaccess.v1.Connector.StateB\x03\xe0\x41\x03\x12\x16\n\x0emin_throughput\x18\x05 \x01(\x05\x12\x16\n\x0emax_throughput\x18\x06 \x01(\x05\x12\x1f\n\x12\x63onnected_projects\x18\x07 \x03(\tB\x03\xe0\x41\x03\x12;\n\x06subnet\x18\x08 \x01(\x0b\x32+.google.cloud.vpcaccess.v1.Connector.Subnet\x12\x14\n\x0cmachine_type\x18\n \x01(\t\x12\x15\n\rmin_instances\x18\x0b \x01(\x05\x12\x15\n\rmax_instances\x18\x0c \x01(\x05\x1a*\n\x06Subnet\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x12\n\nproject_id\x18\x02 \x01(\t\"^\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\t\n\x05READY\x10\x01\x12\x0c\n\x08\x43REATING\x10\x02\x12\x0c\n\x08\x44\x45LETING\x10\x03\x12\t\n\x05\x45RROR\x10\x04\x12\x0c\n\x08UPDATING\x10\x05:g\xea\x41\x64\n\"vpcaccess.googleapis.com/Connector\x12>projects/{project}/locations/{location}/connectors/{connector}\"\xac\x01\n\x16\x43reateConnectorRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\x12\x19\n\x0c\x63onnector_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12<\n\tconnector\x18\x03 \x01(\x0b\x32$.google.cloud.vpcaccess.v1.ConnectorB\x03\xe0\x41\x02\"O\n\x13GetConnectorRequest\x12\x38\n\x04name\x18\x01 \x01(\tB*\xe0\x41\x02\xfa\x41$\n\"vpcaccess.googleapis.com/Connector\"y\n\x15ListConnectorsRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\"k\n\x16ListConnectorsResponse\x12\x38\n\nconnectors\x18\x01 \x03(\x0b\x32$.google.cloud.vpcaccess.v1.Connector\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"R\n\x16\x44\x65leteConnectorRequest\x12\x38\n\x04name\x18\x01 \x01(\tB*\xe0\x41\x02\xfa\x41$\n\"vpcaccess.googleapis.com/Connector\"\xcd\x01\n\x11OperationMetadata\x12\x13\n\x06method\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\x12\x31\n\x08\x65nd_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12:\n\x06target\x18\x05 \x01(\tB*\xe0\x41\x03\xfa\x41$\n\"vpcaccess.googleapis.com/Connector2\xfc\x06\n\x10VpcAccessService\x12\xe8\x01\n\x0f\x43reateConnector\x12\x31.google.cloud.vpcaccess.v1.CreateConnectorRequest\x1a\x1d.google.longrunning.Operation\"\x82\x01\xca\x41\x1e\n\tConnector\x12\x11OperationMetadata\xda\x41\x1dparent,connector_id,connector\x82\xd3\xe4\x93\x02;\"./v1/{parent=projects/*/locations/*}/connectors:\tconnector\x12\xa3\x01\n\x0cGetConnector\x12..google.cloud.vpcaccess.v1.GetConnectorRequest\x1a$.google.cloud.vpcaccess.v1.Connector\"=\xda\x41\x04name\x82\xd3\xe4\x93\x02\x30\x12./v1/{name=projects/*/locations/*/connectors/*}\x12\xb6\x01\n\x0eListConnectors\x12\x30.google.cloud.vpcaccess.v1.ListConnectorsRequest\x1a\x31.google.cloud.vpcaccess.v1.ListConnectorsResponse\"?\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x30\x12./v1/{parent=projects/*/locations/*}/connectors\x12\xcf\x01\n\x0f\x44\x65leteConnector\x12\x31.google.cloud.vpcaccess.v1.DeleteConnectorRequest\x1a\x1d.google.longrunning.Operation\"j\xca\x41*\n\x15google.protobuf.Empty\x12\x11OperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02\x30*./v1/{name=projects/*/locations/*/connectors/*}\x1aL\xca\x41\x18vpcaccess.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\xc5\x01\n\x1d\x63om.google.cloud.vpcaccess.v1B\x0eVpcAccessProtoP\x01Z;cloud.google.com/go/vpcaccess/apiv1/vpcaccesspb;vpcaccesspb\xaa\x02\x19Google.Cloud.VpcAccess.V1\xca\x02\x19Google\\Cloud\\VpcAccess\\V1\xea\x02\x1cGoogle::Cloud::VpcAccess::V1b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module VpcAccess + module V1 + Connector = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vpcaccess.v1.Connector").msgclass + Connector::Subnet = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vpcaccess.v1.Connector.Subnet").msgclass + Connector::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vpcaccess.v1.Connector.State").enummodule + CreateConnectorRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vpcaccess.v1.CreateConnectorRequest").msgclass + GetConnectorRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vpcaccess.v1.GetConnectorRequest").msgclass + ListConnectorsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vpcaccess.v1.ListConnectorsRequest").msgclass + ListConnectorsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vpcaccess.v1.ListConnectorsResponse").msgclass + DeleteConnectorRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vpcaccess.v1.DeleteConnectorRequest").msgclass + OperationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vpcaccess.v1.OperationMetadata").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-vpc_access-v1/lib/google/cloud/vpcaccess/v1/vpc_access_services_pb.rb b/owl-bot-staging/google-cloud-vpc_access-v1/lib/google/cloud/vpcaccess/v1/vpc_access_services_pb.rb new file mode 100644 index 000000000000..f53da11be9ff --- /dev/null +++ b/owl-bot-staging/google-cloud-vpc_access-v1/lib/google/cloud/vpcaccess/v1/vpc_access_services_pb.rb @@ -0,0 +1,55 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/cloud/vpcaccess/v1/vpc_access.proto for package 'Google.Cloud.VpcAccess.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/vpcaccess/v1/vpc_access_pb' + +module Google + module Cloud + module VpcAccess + module V1 + module VpcAccessService + # Serverless VPC Access API allows users to create and manage connectors for + # App Engine, Cloud Functions and Cloud Run to have internal connections to + # Virtual Private Cloud networks. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.cloud.vpcaccess.v1.VpcAccessService' + + # Creates a Serverless VPC Access connector, returns an operation. + rpc :CreateConnector, ::Google::Cloud::VpcAccess::V1::CreateConnectorRequest, ::Google::Longrunning::Operation + # Gets a Serverless VPC Access connector. Returns NOT_FOUND if the resource + # does not exist. + rpc :GetConnector, ::Google::Cloud::VpcAccess::V1::GetConnectorRequest, ::Google::Cloud::VpcAccess::V1::Connector + # Lists Serverless VPC Access connectors. + rpc :ListConnectors, ::Google::Cloud::VpcAccess::V1::ListConnectorsRequest, ::Google::Cloud::VpcAccess::V1::ListConnectorsResponse + # Deletes a Serverless VPC Access connector. Returns NOT_FOUND if the + # resource does not exist. + rpc :DeleteConnector, ::Google::Cloud::VpcAccess::V1::DeleteConnectorRequest, ::Google::Longrunning::Operation + end + + Stub = Service.rpc_stub_class + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-vpc_access-v1/proto_docs/README.md b/owl-bot-staging/google-cloud-vpc_access-v1/proto_docs/README.md new file mode 100644 index 000000000000..9bc43f1e670f --- /dev/null +++ b/owl-bot-staging/google-cloud-vpc_access-v1/proto_docs/README.md @@ -0,0 +1,4 @@ +# Serverless VPC Access 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-vpc_access-v1/proto_docs/google/api/client.rb b/owl-bot-staging/google-cloud-vpc_access-v1/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..3ab0b096d445 --- /dev/null +++ b/owl-bot-staging/google-cloud-vpc_access-v1/proto_docs/google/api/client.rb @@ -0,0 +1,593 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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. + # + # Note: This field should not be used in most cases. + 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: + # library_settings: + # 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. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Php. Clobbers the php_namespace option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.php.package_name" field + # in gapic.yaml. API teams should use the protobuf php_namespace option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # library_settings: + # php_settings: + # library_package: Google\Cloud\PubSub\V1 + 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. + # + # Example: + # + # 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 + # @!attribute [rw] batching + # @return [::Google::Api::BatchingConfigProto] + # Batching configuration for an API method in client libraries. + # + # Example of a YAML configuration: + # + # publishing: + # method_settings: + # - selector: google.example.v1.ExampleService.BatchCreateExample + # batching: + # element_count_threshold: 1000 + # request_byte_threshold: 100000000 + # delay_threshold_millis: 10 + 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. + # + # Note: This feature should not be used in most cases. + # @!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 + + # `BatchingConfigProto` defines the batching configuration for an API method. + # @!attribute [rw] thresholds + # @return [::Google::Api::BatchingSettingsProto] + # The thresholds which trigger a batched request to be sent. + # @!attribute [rw] batch_descriptor + # @return [::Google::Api::BatchingDescriptorProto] + # The request and response fields used in batching. + class BatchingConfigProto + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `BatchingSettingsProto` specifies a set of batching thresholds, each of + # which acts as a trigger to send a batch of messages as a request. At least + # one threshold must be positive nonzero. + # @!attribute [rw] element_count_threshold + # @return [::Integer] + # The number of elements of a field collected into a batch which, if + # exceeded, causes the batch to be sent. + # @!attribute [rw] request_byte_threshold + # @return [::Integer] + # The aggregated size of the batched field which, if exceeded, causes the + # batch to be sent. This size is computed by aggregating the sizes of the + # request field to be batched, not of the entire request message. + # @!attribute [rw] delay_threshold + # @return [::Google::Protobuf::Duration] + # The duration after which a batch should be sent, starting from the addition + # of the first message to that batch. + # @!attribute [rw] element_count_limit + # @return [::Integer] + # The maximum number of elements collected in a batch that could be accepted + # by server. + # @!attribute [rw] request_byte_limit + # @return [::Integer] + # The maximum size of the request that could be accepted by server. + # @!attribute [rw] flow_control_element_limit + # @return [::Integer] + # The maximum number of elements allowed by flow control. + # @!attribute [rw] flow_control_byte_limit + # @return [::Integer] + # The maximum size of data allowed by flow control. + # @!attribute [rw] flow_control_limit_exceeded_behavior + # @return [::Google::Api::FlowControlLimitExceededBehaviorProto] + # The behavior to take when the flow control limit is exceeded. + class BatchingSettingsProto + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `BatchingDescriptorProto` specifies the fields of the request message to be + # used for batching, and, optionally, the fields of the response message to be + # used for demultiplexing. + # @!attribute [rw] batched_field + # @return [::String] + # The repeated field in the request message to be aggregated by batching. + # @!attribute [rw] discriminator_fields + # @return [::Array<::String>] + # A list of the fields in the request message. Two requests will be batched + # together only if the values of every field specified in + # `request_discriminator_fields` is equal between the two requests. + # @!attribute [rw] subresponse_field + # @return [::String] + # Optional. When present, indicates the field in the response message to be + # used to demultiplex the response into multiple response messages, in + # correspondence with the multiple request messages originally batched + # together. + class BatchingDescriptorProto + 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 + + # The behavior to take when the flow control limit is exceeded. + module FlowControlLimitExceededBehaviorProto + # Default behavior, system-defined. + UNSET_BEHAVIOR = 0 + + # Stop operation, raise error. + THROW_EXCEPTION = 1 + + # Pause operation until limit clears. + BLOCK = 2 + + # Continue operation, disregard limit. + IGNORE = 3 + end + end +end diff --git a/owl-bot-staging/google-cloud-vpc_access-v1/proto_docs/google/api/field_behavior.rb b/owl-bot-staging/google-cloud-vpc_access-v1/proto_docs/google/api/field_behavior.rb new file mode 100644 index 000000000000..582be187d115 --- /dev/null +++ b/owl-bot-staging/google-cloud-vpc_access-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-vpc_access-v1/proto_docs/google/api/launch_stage.rb b/owl-bot-staging/google-cloud-vpc_access-v1/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..9392a413fb1b --- /dev/null +++ b/owl-bot-staging/google-cloud-vpc_access-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-vpc_access-v1/proto_docs/google/api/resource.rb b/owl-bot-staging/google-cloud-vpc_access-v1/proto_docs/google/api/resource.rb new file mode 100644 index 000000000000..25dec4847ac1 --- /dev/null +++ b/owl-bot-staging/google-cloud-vpc_access-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-vpc_access-v1/proto_docs/google/cloud/vpcaccess/v1/vpc_access.rb b/owl-bot-staging/google-cloud-vpc_access-v1/proto_docs/google/cloud/vpcaccess/v1/vpc_access.rb new file mode 100644 index 000000000000..c0249c575e05 --- /dev/null +++ b/owl-bot-staging/google-cloud-vpc_access-v1/proto_docs/google/cloud/vpcaccess/v1/vpc_access.rb @@ -0,0 +1,185 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 VpcAccess + module V1 + # Definition of a Serverless VPC Access connector. + # @!attribute [rw] name + # @return [::String] + # The resource name in the format `projects/*/locations/*/connectors/*`. + # @!attribute [rw] network + # @return [::String] + # Name of a VPC network. + # @!attribute [rw] ip_cidr_range + # @return [::String] + # The range of internal addresses that follows RFC 4632 notation. + # Example: `10.132.0.0/28`. + # @!attribute [r] state + # @return [::Google::Cloud::VpcAccess::V1::Connector::State] + # Output only. State of the VPC access connector. + # @!attribute [rw] min_throughput + # @return [::Integer] + # Minimum throughput of the connector in Mbps. Default and min is 200. + # @!attribute [rw] max_throughput + # @return [::Integer] + # Maximum throughput of the connector in Mbps. Default is 300, max is 1000. + # @!attribute [r] connected_projects + # @return [::Array<::String>] + # Output only. List of projects using the connector. + # @!attribute [rw] subnet + # @return [::Google::Cloud::VpcAccess::V1::Connector::Subnet] + # The subnet in which to house the VPC Access Connector. + # @!attribute [rw] machine_type + # @return [::String] + # Machine type of VM Instance underlying connector. Default is e2-micro + # @!attribute [rw] min_instances + # @return [::Integer] + # Minimum value of instances in autoscaling group underlying the connector. + # @!attribute [rw] max_instances + # @return [::Integer] + # Maximum value of instances in autoscaling group underlying the connector. + class Connector + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The subnet in which to house the connector + # @!attribute [rw] name + # @return [::String] + # Subnet name (relative, not fully qualified). + # E.g. if the full subnet selfLink is + # https://compute.googleapis.com/compute/v1/projects/\\{project}/regions/\\{region}/subnetworks/\\{subnetName} + # the correct input for this field would be \\{subnetName} + # @!attribute [rw] project_id + # @return [::String] + # Project in which the subnet exists. + # If not set, this project is assumed to be the project for which + # the connector create request was issued. + class Subnet + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # State of a connector. + module State + # Invalid state. + STATE_UNSPECIFIED = 0 + + # Connector is deployed and ready to receive traffic. + READY = 1 + + # An Insert operation is in progress. Transient condition. + CREATING = 2 + + # A Delete operation is in progress. Transient condition. + DELETING = 3 + + # Connector is in a bad state, manual deletion recommended. + ERROR = 4 + + # The connector is being updated. + UPDATING = 5 + end + end + + # Request for creating a Serverless VPC Access connector. + # @!attribute [rw] parent + # @return [::String] + # Required. The project and location in which the configuration should be created, + # specified in the format `projects/*/locations/*`. + # @!attribute [rw] connector_id + # @return [::String] + # Required. The ID to use for this connector. + # @!attribute [rw] connector + # @return [::Google::Cloud::VpcAccess::V1::Connector] + # Required. Resource to create. + class CreateConnectorRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request for getting a Serverless VPC Access connector. + # @!attribute [rw] name + # @return [::String] + # Required. Name of a Serverless VPC Access connector to get. + class GetConnectorRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request for listing Serverless VPC Access connectors in a location. + # @!attribute [rw] parent + # @return [::String] + # Required. The project and location from which the routes should be listed. + # @!attribute [rw] page_size + # @return [::Integer] + # Maximum number of functions to return per call. + # @!attribute [rw] page_token + # @return [::String] + # Continuation token. + class ListConnectorsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response for listing Serverless VPC Access connectors. + # @!attribute [rw] connectors + # @return [::Array<::Google::Cloud::VpcAccess::V1::Connector>] + # List of Serverless VPC Access connectors. + # @!attribute [rw] next_page_token + # @return [::String] + # Continuation token. + class ListConnectorsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request for deleting a Serverless VPC Access connector. + # @!attribute [rw] name + # @return [::String] + # Required. Name of a Serverless VPC Access connector to delete. + class DeleteConnectorRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Metadata for google.longrunning.Operation. + # @!attribute [r] method + # @return [::String] + # Output only. Method that initiated the operation e.g. + # google.cloud.vpcaccess.v1.Connectors.CreateConnector. + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Time when the operation was created. + # @!attribute [r] end_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Time when the operation completed. + # @!attribute [r] target + # @return [::String] + # Output only. Name of the resource that this operation is acting on e.g. + # projects/my-project/locations/us-central1/connectors/v1. + class OperationMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-vpc_access-v1/proto_docs/google/longrunning/operations.rb b/owl-bot-staging/google-cloud-vpc_access-v1/proto_docs/google/longrunning/operations.rb new file mode 100644 index 000000000000..7a757f512165 --- /dev/null +++ b/owl-bot-staging/google-cloud-vpc_access-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-vpc_access-v1/proto_docs/google/protobuf/any.rb b/owl-bot-staging/google-cloud-vpc_access-v1/proto_docs/google/protobuf/any.rb new file mode 100644 index 000000000000..58691995f02e --- /dev/null +++ b/owl-bot-staging/google-cloud-vpc_access-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-vpc_access-v1/proto_docs/google/protobuf/duration.rb b/owl-bot-staging/google-cloud-vpc_access-v1/proto_docs/google/protobuf/duration.rb new file mode 100644 index 000000000000..ea59f1f91daf --- /dev/null +++ b/owl-bot-staging/google-cloud-vpc_access-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-vpc_access-v1/proto_docs/google/protobuf/empty.rb b/owl-bot-staging/google-cloud-vpc_access-v1/proto_docs/google/protobuf/empty.rb new file mode 100644 index 000000000000..83e4481834a6 --- /dev/null +++ b/owl-bot-staging/google-cloud-vpc_access-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-vpc_access-v1/proto_docs/google/protobuf/timestamp.rb b/owl-bot-staging/google-cloud-vpc_access-v1/proto_docs/google/protobuf/timestamp.rb new file mode 100644 index 000000000000..74352be9c58c --- /dev/null +++ b/owl-bot-staging/google-cloud-vpc_access-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-vpc_access-v1/proto_docs/google/rpc/status.rb b/owl-bot-staging/google-cloud-vpc_access-v1/proto_docs/google/rpc/status.rb new file mode 100644 index 000000000000..c1a1c07eb2db --- /dev/null +++ b/owl-bot-staging/google-cloud-vpc_access-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-vpc_access-v1/snippets/Gemfile b/owl-bot-staging/google-cloud-vpc_access-v1/snippets/Gemfile new file mode 100644 index 000000000000..2797ddedd3b9 --- /dev/null +++ b/owl-bot-staging/google-cloud-vpc_access-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-vpc_access-v1", path: "../" +else + gem "google-cloud-vpc_access-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-vpc_access-v1/snippets/snippet_metadata_google.cloud.vpcaccess.v1.json b/owl-bot-staging/google-cloud-vpc_access-v1/snippets/snippet_metadata_google.cloud.vpcaccess.v1.json new file mode 100644 index 000000000000..fe9e53321b02 --- /dev/null +++ b/owl-bot-staging/google-cloud-vpc_access-v1/snippets/snippet_metadata_google.cloud.vpcaccess.v1.json @@ -0,0 +1,175 @@ +{ + "client_library": { + "name": "google-cloud-vpc_access-v1", + "version": "", + "language": "RUBY", + "apis": [ + { + "id": "google.cloud.vpcaccess.v1", + "version": "v1" + } + ] + }, + "snippets": [ + { + "region_tag": "vpcaccess_v1_generated_VpcAccessService_CreateConnector_sync", + "title": "Snippet for the create_connector call in the VpcAccessService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VpcAccess::V1::VpcAccessService::Client#create_connector.", + "file": "vpc_access_service/create_connector.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_connector", + "full_name": "::Google::Cloud::VpcAccess::V1::VpcAccessService::Client#create_connector", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VpcAccess::V1::CreateConnectorRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "VpcAccessService::Client", + "full_name": "::Google::Cloud::VpcAccess::V1::VpcAccessService::Client" + }, + "method": { + "short_name": "CreateConnector", + "full_name": "google.cloud.vpcaccess.v1.VpcAccessService.CreateConnector", + "service": { + "short_name": "VpcAccessService", + "full_name": "google.cloud.vpcaccess.v1.VpcAccessService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "vpcaccess_v1_generated_VpcAccessService_GetConnector_sync", + "title": "Snippet for the get_connector call in the VpcAccessService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VpcAccess::V1::VpcAccessService::Client#get_connector.", + "file": "vpc_access_service/get_connector.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_connector", + "full_name": "::Google::Cloud::VpcAccess::V1::VpcAccessService::Client#get_connector", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VpcAccess::V1::GetConnectorRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::VpcAccess::V1::Connector", + "client": { + "short_name": "VpcAccessService::Client", + "full_name": "::Google::Cloud::VpcAccess::V1::VpcAccessService::Client" + }, + "method": { + "short_name": "GetConnector", + "full_name": "google.cloud.vpcaccess.v1.VpcAccessService.GetConnector", + "service": { + "short_name": "VpcAccessService", + "full_name": "google.cloud.vpcaccess.v1.VpcAccessService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "vpcaccess_v1_generated_VpcAccessService_ListConnectors_sync", + "title": "Snippet for the list_connectors call in the VpcAccessService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VpcAccess::V1::VpcAccessService::Client#list_connectors.", + "file": "vpc_access_service/list_connectors.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_connectors", + "full_name": "::Google::Cloud::VpcAccess::V1::VpcAccessService::Client#list_connectors", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VpcAccess::V1::ListConnectorsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::VpcAccess::V1::ListConnectorsResponse", + "client": { + "short_name": "VpcAccessService::Client", + "full_name": "::Google::Cloud::VpcAccess::V1::VpcAccessService::Client" + }, + "method": { + "short_name": "ListConnectors", + "full_name": "google.cloud.vpcaccess.v1.VpcAccessService.ListConnectors", + "service": { + "short_name": "VpcAccessService", + "full_name": "google.cloud.vpcaccess.v1.VpcAccessService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "vpcaccess_v1_generated_VpcAccessService_DeleteConnector_sync", + "title": "Snippet for the delete_connector call in the VpcAccessService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VpcAccess::V1::VpcAccessService::Client#delete_connector.", + "file": "vpc_access_service/delete_connector.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_connector", + "full_name": "::Google::Cloud::VpcAccess::V1::VpcAccessService::Client#delete_connector", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::VpcAccess::V1::DeleteConnectorRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "VpcAccessService::Client", + "full_name": "::Google::Cloud::VpcAccess::V1::VpcAccessService::Client" + }, + "method": { + "short_name": "DeleteConnector", + "full_name": "google.cloud.vpcaccess.v1.VpcAccessService.DeleteConnector", + "service": { + "short_name": "VpcAccessService", + "full_name": "google.cloud.vpcaccess.v1.VpcAccessService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + } + ] +} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-vpc_access-v1/snippets/vpc_access_service/create_connector.rb b/owl-bot-staging/google-cloud-vpc_access-v1/snippets/vpc_access_service/create_connector.rb new file mode 100644 index 000000000000..9d4b5a326409 --- /dev/null +++ b/owl-bot-staging/google-cloud-vpc_access-v1/snippets/vpc_access_service/create_connector.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 vpcaccess_v1_generated_VpcAccessService_CreateConnector_sync] +require "google/cloud/vpc_access/v1" + +## +# Snippet for the create_connector call in the VpcAccessService 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::VpcAccess::V1::VpcAccessService::Client#create_connector. +# +def create_connector + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VpcAccess::V1::VpcAccessService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VpcAccess::V1::CreateConnectorRequest.new + + # Call the create_connector method. + result = client.create_connector 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 vpcaccess_v1_generated_VpcAccessService_CreateConnector_sync] diff --git a/owl-bot-staging/google-cloud-vpc_access-v1/snippets/vpc_access_service/delete_connector.rb b/owl-bot-staging/google-cloud-vpc_access-v1/snippets/vpc_access_service/delete_connector.rb new file mode 100644 index 000000000000..7f7359c63908 --- /dev/null +++ b/owl-bot-staging/google-cloud-vpc_access-v1/snippets/vpc_access_service/delete_connector.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 vpcaccess_v1_generated_VpcAccessService_DeleteConnector_sync] +require "google/cloud/vpc_access/v1" + +## +# Snippet for the delete_connector call in the VpcAccessService 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::VpcAccess::V1::VpcAccessService::Client#delete_connector. +# +def delete_connector + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VpcAccess::V1::VpcAccessService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VpcAccess::V1::DeleteConnectorRequest.new + + # Call the delete_connector method. + result = client.delete_connector 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 vpcaccess_v1_generated_VpcAccessService_DeleteConnector_sync] diff --git a/owl-bot-staging/google-cloud-vpc_access-v1/snippets/vpc_access_service/get_connector.rb b/owl-bot-staging/google-cloud-vpc_access-v1/snippets/vpc_access_service/get_connector.rb new file mode 100644 index 000000000000..6f68789450d6 --- /dev/null +++ b/owl-bot-staging/google-cloud-vpc_access-v1/snippets/vpc_access_service/get_connector.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 vpcaccess_v1_generated_VpcAccessService_GetConnector_sync] +require "google/cloud/vpc_access/v1" + +## +# Snippet for the get_connector call in the VpcAccessService 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::VpcAccess::V1::VpcAccessService::Client#get_connector. +# +def get_connector + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VpcAccess::V1::VpcAccessService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VpcAccess::V1::GetConnectorRequest.new + + # Call the get_connector method. + result = client.get_connector request + + # The returned object is of type Google::Cloud::VpcAccess::V1::Connector. + p result +end +# [END vpcaccess_v1_generated_VpcAccessService_GetConnector_sync] diff --git a/owl-bot-staging/google-cloud-vpc_access-v1/snippets/vpc_access_service/list_connectors.rb b/owl-bot-staging/google-cloud-vpc_access-v1/snippets/vpc_access_service/list_connectors.rb new file mode 100644 index 000000000000..0d7049d755ab --- /dev/null +++ b/owl-bot-staging/google-cloud-vpc_access-v1/snippets/vpc_access_service/list_connectors.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 vpcaccess_v1_generated_VpcAccessService_ListConnectors_sync] +require "google/cloud/vpc_access/v1" + +## +# Snippet for the list_connectors call in the VpcAccessService 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::VpcAccess::V1::VpcAccessService::Client#list_connectors. +# +def list_connectors + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::VpcAccess::V1::VpcAccessService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::VpcAccess::V1::ListConnectorsRequest.new + + # Call the list_connectors method. + result = client.list_connectors 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::VpcAccess::V1::Connector. + p item + end +end +# [END vpcaccess_v1_generated_VpcAccessService_ListConnectors_sync] diff --git a/owl-bot-staging/google-cloud-vpc_access-v1/test/google/cloud/vpc_access/v1/vpc_access_service_operations_test.rb b/owl-bot-staging/google-cloud-vpc_access-v1/test/google/cloud/vpc_access/v1/vpc_access_service_operations_test.rb new file mode 100644 index 000000000000..6f68f498f052 --- /dev/null +++ b/owl-bot-staging/google-cloud-vpc_access-v1/test/google/cloud/vpc_access/v1/vpc_access_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/vpcaccess/v1/vpc_access_pb" +require "google/cloud/vpcaccess/v1/vpc_access_services_pb" +require "google/cloud/vpc_access/v1/vpc_access_service" + +class ::Google::Cloud::VpcAccess::V1::VpcAccessService::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::VpcAccess::V1::VpcAccessService::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::VpcAccess::V1::VpcAccessService::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::VpcAccess::V1::VpcAccessService::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::VpcAccess::V1::VpcAccessService::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::VpcAccess::V1::VpcAccessService::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::VpcAccess::V1::VpcAccessService::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::VpcAccess::V1::VpcAccessService::Operations::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-vpc_access-v1/test/google/cloud/vpc_access/v1/vpc_access_service_paths_test.rb b/owl-bot-staging/google-cloud-vpc_access-v1/test/google/cloud/vpc_access/v1/vpc_access_service_paths_test.rb new file mode 100644 index 000000000000..9ba18e2eb3d5 --- /dev/null +++ b/owl-bot-staging/google-cloud-vpc_access-v1/test/google/cloud/vpc_access/v1/vpc_access_service_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/vpc_access/v1/vpc_access_service" + +class ::Google::Cloud::VpcAccess::V1::VpcAccessService::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_connector_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::VpcAccess::V1::VpcAccessService::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.connector_path project: "value0", location: "value1", connector: "value2" + assert_equal "projects/value0/locations/value1/connectors/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::VpcAccess::V1::VpcAccessService::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-vpc_access-v1/test/google/cloud/vpc_access/v1/vpc_access_service_rest_test.rb b/owl-bot-staging/google-cloud-vpc_access-v1/test/google/cloud/vpc_access/v1/vpc_access_service_rest_test.rb new file mode 100644 index 000000000000..6b6f716024fe --- /dev/null +++ b/owl-bot-staging/google-cloud-vpc_access-v1/test/google/cloud/vpc_access/v1/vpc_access_service_rest_test.rb @@ -0,0 +1,319 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/vpcaccess/v1/vpc_access_pb" +require "google/cloud/vpc_access/v1/vpc_access_service/rest" + + +class ::Google::Cloud::VpcAccess::V1::VpcAccessService::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_connector + # 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" + connector_id = "hello world" + connector = {} + + create_connector_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::VpcAccess::V1::VpcAccessService::Rest::ServiceStub.stub :transcode_create_connector_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_connector_client_stub do + # Create client + client = ::Google::Cloud::VpcAccess::V1::VpcAccessService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_connector({ parent: parent, connector_id: connector_id, connector: connector }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_connector parent: parent, connector_id: connector_id, connector: connector do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_connector ::Google::Cloud::VpcAccess::V1::CreateConnectorRequest.new(parent: parent, connector_id: connector_id, connector: connector) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_connector({ parent: parent, connector_id: connector_id, connector: connector }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_connector(::Google::Cloud::VpcAccess::V1::CreateConnectorRequest.new(parent: parent, connector_id: connector_id, connector: connector), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_connector_client_stub.call_count + end + end + end + + def test_get_connector + # Create test objects. + client_result = ::Google::Cloud::VpcAccess::V1::Connector.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_connector_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::VpcAccess::V1::VpcAccessService::Rest::ServiceStub.stub :transcode_get_connector_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_connector_client_stub do + # Create client + client = ::Google::Cloud::VpcAccess::V1::VpcAccessService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_connector({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_connector name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_connector ::Google::Cloud::VpcAccess::V1::GetConnectorRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_connector({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_connector(::Google::Cloud::VpcAccess::V1::GetConnectorRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_connector_client_stub.call_count + end + end + end + + def test_list_connectors + # Create test objects. + client_result = ::Google::Cloud::VpcAccess::V1::ListConnectorsResponse.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_connectors_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::VpcAccess::V1::VpcAccessService::Rest::ServiceStub.stub :transcode_list_connectors_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_connectors_client_stub do + # Create client + client = ::Google::Cloud::VpcAccess::V1::VpcAccessService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_connectors({ 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_connectors 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_connectors ::Google::Cloud::VpcAccess::V1::ListConnectorsRequest.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_connectors({ 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_connectors(::Google::Cloud::VpcAccess::V1::ListConnectorsRequest.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_connectors_client_stub.call_count + end + end + end + + def test_delete_connector + # 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_connector_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::VpcAccess::V1::VpcAccessService::Rest::ServiceStub.stub :transcode_delete_connector_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_connector_client_stub do + # Create client + client = ::Google::Cloud::VpcAccess::V1::VpcAccessService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_connector({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_connector name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_connector ::Google::Cloud::VpcAccess::V1::DeleteConnectorRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_connector({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_connector(::Google::Cloud::VpcAccess::V1::DeleteConnectorRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_connector_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::VpcAccess::V1::VpcAccessService::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::VpcAccess::V1::VpcAccessService::Rest::Client::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-vpc_access-v1/test/google/cloud/vpc_access/v1/vpc_access_service_test.rb b/owl-bot-staging/google-cloud-vpc_access-v1/test/google/cloud/vpc_access/v1/vpc_access_service_test.rb new file mode 100644 index 000000000000..2c8083f3cb82 --- /dev/null +++ b/owl-bot-staging/google-cloud-vpc_access-v1/test/google/cloud/vpc_access/v1/vpc_access_service_test.rb @@ -0,0 +1,373 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/vpcaccess/v1/vpc_access_pb" +require "google/cloud/vpc_access/v1/vpc_access_service" + +class ::Google::Cloud::VpcAccess::V1::VpcAccessService::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_connector + # 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" + connector_id = "hello world" + connector = {} + + create_connector_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_connector, name + assert_kind_of ::Google::Cloud::VpcAccess::V1::CreateConnectorRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["connector_id"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::VpcAccess::V1::Connector), request["connector"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_connector_client_stub do + # Create client + client = ::Google::Cloud::VpcAccess::V1::VpcAccessService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_connector({ parent: parent, connector_id: connector_id, connector: connector }) 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_connector parent: parent, connector_id: connector_id, connector: connector 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_connector ::Google::Cloud::VpcAccess::V1::CreateConnectorRequest.new(parent: parent, connector_id: connector_id, connector: connector) 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_connector({ parent: parent, connector_id: connector_id, connector: connector }, 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_connector(::Google::Cloud::VpcAccess::V1::CreateConnectorRequest.new(parent: parent, connector_id: connector_id, connector: connector), 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_connector_client_stub.call_rpc_count + end + end + + def test_get_connector + # Create GRPC objects. + grpc_response = ::Google::Cloud::VpcAccess::V1::Connector.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_connector_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_connector, name + assert_kind_of ::Google::Cloud::VpcAccess::V1::GetConnectorRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_connector_client_stub do + # Create client + client = ::Google::Cloud::VpcAccess::V1::VpcAccessService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_connector({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_connector name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_connector ::Google::Cloud::VpcAccess::V1::GetConnectorRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_connector({ 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_connector(::Google::Cloud::VpcAccess::V1::GetConnectorRequest.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_connector_client_stub.call_rpc_count + end + end + + def test_list_connectors + # Create GRPC objects. + grpc_response = ::Google::Cloud::VpcAccess::V1::ListConnectorsResponse.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_connectors_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_connectors, name + assert_kind_of ::Google::Cloud::VpcAccess::V1::ListConnectorsRequest, 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_connectors_client_stub do + # Create client + client = ::Google::Cloud::VpcAccess::V1::VpcAccessService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_connectors({ 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_connectors 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_connectors ::Google::Cloud::VpcAccess::V1::ListConnectorsRequest.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_connectors({ 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_connectors(::Google::Cloud::VpcAccess::V1::ListConnectorsRequest.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_connectors_client_stub.call_rpc_count + end + end + + def test_delete_connector + # 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_connector_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_connector, name + assert_kind_of ::Google::Cloud::VpcAccess::V1::DeleteConnectorRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_connector_client_stub do + # Create client + client = ::Google::Cloud::VpcAccess::V1::VpcAccessService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_connector({ 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_connector 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_connector ::Google::Cloud::VpcAccess::V1::DeleteConnectorRequest.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_connector({ 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_connector(::Google::Cloud::VpcAccess::V1::DeleteConnectorRequest.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_connector_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::VpcAccess::V1::VpcAccessService::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::VpcAccess::V1::VpcAccessService::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::VpcAccess::V1::VpcAccessService::Client.new do |config| + config.credentials = creds + end + assert_kind_of ::Google::Cloud::VpcAccess::V1::VpcAccessService::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::VpcAccess::V1::VpcAccessService::Client.new do |config| + config.credentials = grpc_channel + end + end + + assert_kind_of ::Google::Cloud::VpcAccess::V1::VpcAccessService::Operations, client.operations_client + end +end diff --git a/owl-bot-staging/google-cloud-vpc_access-v1/test/helper.rb b/owl-bot-staging/google-cloud-vpc_access-v1/test/helper.rb new file mode 100644 index 000000000000..672b337030e7 --- /dev/null +++ b/owl-bot-staging/google-cloud-vpc_access-v1/test/helper.rb @@ -0,0 +1,26 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/mock" +require "minitest/rg" + +require "grpc" + +require "ostruct" diff --git a/owl-bot-staging/google-cloud-web_risk-v1/.gitignore b/owl-bot-staging/google-cloud-web_risk-v1/.gitignore new file mode 100644 index 000000000000..0135b6bc6cfc --- /dev/null +++ b/owl-bot-staging/google-cloud-web_risk-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-web_risk-v1/.repo-metadata.json b/owl-bot-staging/google-cloud-web_risk-v1/.repo-metadata.json new file mode 100644 index 000000000000..643cdaf4e9c4 --- /dev/null +++ b/owl-bot-staging/google-cloud-web_risk-v1/.repo-metadata.json @@ -0,0 +1,18 @@ +{ + "api_id": "webrisk.googleapis.com", + "api_shortname": "webrisk", + "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-web_risk-v1/latest", + "distribution_name": "google-cloud-web_risk-v1", + "is_cloud": true, + "language": "ruby", + "name": "webrisk", + "name_pretty": "Web Risk V1 API", + "product_documentation": "https://cloud.google.com/web-risk", + "release_level": "unreleased", + "repo": "googleapis/google-cloud-ruby", + "requires_billing": true, + "ruby-cloud-description": "Web Risk is an enterprise security product that lets your client applications check URLs against Google's constantly updated lists of unsafe web resources. Note that google-cloud-web_risk-v1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-web_risk instead. See the readme for more details.", + "ruby-cloud-env-prefix": "WEBRISK", + "ruby-cloud-product-url": "https://cloud.google.com/web-risk", + "library_type": "GAPIC_AUTO" +} diff --git a/owl-bot-staging/google-cloud-web_risk-v1/.rubocop.yml b/owl-bot-staging/google-cloud-web_risk-v1/.rubocop.yml new file mode 100644 index 000000000000..8f9201883964 --- /dev/null +++ b/owl-bot-staging/google-cloud-web_risk-v1/.rubocop.yml @@ -0,0 +1,33 @@ +inherit_gem: + google-style: google-style.yml + +AllCops: + Exclude: + - "google-cloud-web_risk-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-web_risk-v1.rb" diff --git a/owl-bot-staging/google-cloud-web_risk-v1/.toys.rb b/owl-bot-staging/google-cloud-web_risk-v1/.toys.rb new file mode 100644 index 000000000000..177e22456e8a --- /dev/null +++ b/owl-bot-staging/google-cloud-web_risk-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-web_risk-v1/.yardopts b/owl-bot-staging/google-cloud-web_risk-v1/.yardopts new file mode 100644 index 000000000000..ec02341dae2a --- /dev/null +++ b/owl-bot-staging/google-cloud-web_risk-v1/.yardopts @@ -0,0 +1,12 @@ +--no-private +--title="Web Risk 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-web_risk-v1/AUTHENTICATION.md b/owl-bot-staging/google-cloud-web_risk-v1/AUTHENTICATION.md new file mode 100644 index 000000000000..5cc149dffad2 --- /dev/null +++ b/owl-bot-staging/google-cloud-web_risk-v1/AUTHENTICATION.md @@ -0,0 +1,122 @@ +# Authentication + +The recommended way to authenticate to the google-cloud-web_risk-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-web_risk-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/web_risk/v1" + +client = ::Google::Cloud::WebRisk::V1::WebRiskService::Client.new do |config| + config.credentials = "path/to/credentialfile.json" +end +``` + +To configure a credentials file globally for all clients: + +```ruby +require "google/cloud/web_risk/v1" + +::Google::Cloud::WebRisk::V1::WebRiskService::Client.configure do |config| + config.credentials = "path/to/credentialfile.json" +end + +client = ::Google::Cloud::WebRisk::V1::WebRiskService::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-web_risk-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/web_risk/v1" + +ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" + +client = ::Google::Cloud::WebRisk::V1::WebRiskService::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-web_risk-v1/CHANGELOG.md b/owl-bot-staging/google-cloud-web_risk-v1/CHANGELOG.md new file mode 100644 index 000000000000..f88957a62ba2 --- /dev/null +++ b/owl-bot-staging/google-cloud-web_risk-v1/CHANGELOG.md @@ -0,0 +1,2 @@ +# Release History + diff --git a/owl-bot-staging/google-cloud-web_risk-v1/Gemfile b/owl-bot-staging/google-cloud-web_risk-v1/Gemfile new file mode 100644 index 000000000000..1d08558908d8 --- /dev/null +++ b/owl-bot-staging/google-cloud-web_risk-v1/Gemfile @@ -0,0 +1,14 @@ +source "https://rubygems.org" + +gemspec + +gem "google-style", "~> 1.32.0" +gem "irb", "~> 1.17" +gem "minitest", "~> 6.0.2" +gem "minitest-focus", "~> 1.4" +gem "minitest-mock", "~> 5.27" +gem "minitest-rg", "~> 5.3" +gem "ostruct", "~> 0.5.5" +gem "rake", ">= 13.0" +gem "redcarpet", "~> 3.6" +gem "yard", "~> 0.9" diff --git a/owl-bot-staging/google-cloud-web_risk-v1/LICENSE.md b/owl-bot-staging/google-cloud-web_risk-v1/LICENSE.md new file mode 100644 index 000000000000..c261857ba6ad --- /dev/null +++ b/owl-bot-staging/google-cloud-web_risk-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-web_risk-v1/README.md b/owl-bot-staging/google-cloud-web_risk-v1/README.md new file mode 100644 index 000000000000..b372abe1f580 --- /dev/null +++ b/owl-bot-staging/google-cloud-web_risk-v1/README.md @@ -0,0 +1,154 @@ +# Ruby Client for the Web Risk V1 API + +API Client library for the Web Risk V1 API + +Web Risk is an enterprise security product that lets your client applications check URLs against Google's constantly updated lists of unsafe web resources. + +https://github.com/googleapis/google-cloud-ruby + +This gem is a _versioned_ client. It provides basic client classes for a +specific version of the Web Risk V1 API. Most users should consider using +the main client gem, +[google-cloud-web_risk](https://rubygems.org/gems/google-cloud-web_risk). +See the section below titled *Which client should I use?* for more information. + +## Installation + +``` +$ gem install google-cloud-web_risk-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/webrisk.googleapis.com) +1. [Set up authentication.](AUTHENTICATION.md) + +## Quick Start + +```ruby +require "google/cloud/web_risk/v1" + +client = ::Google::Cloud::WebRisk::V1::WebRiskService::Client.new +request = ::Google::Cloud::WebRisk::V1::ComputeThreatListDiffRequest.new # (request fields as keyword arguments...) +response = client.compute_threat_list_diff request +``` + +View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-web_risk-v1/latest) +for class and method documentation. + +See also the [Product Documentation](https://cloud.google.com/web-risk) +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/web_risk/v1" +require "logger" + +client = ::Google::Cloud::WebRisk::V1::WebRiskService::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-web_risk`, +and lower-level _versioned_ client libraries with names such as +`google-cloud-web_risk-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-web_risk`. +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-web_risk-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-web_risk-v1/Rakefile b/owl-bot-staging/google-cloud-web_risk-v1/Rakefile new file mode 100644 index 000000000000..1b6fd789ed60 --- /dev/null +++ b/owl-bot-staging/google-cloud-web_risk-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-web_risk-v1 acceptance tests." +task :acceptance, :project, :keyfile do |t, args| + project = args[:project] + project ||= + ENV["WEBRISK_TEST_PROJECT"] || + ENV["GCLOUD_TEST_PROJECT"] + keyfile = args[:keyfile] + keyfile ||= + ENV["WEBRISK_TEST_KEYFILE"] || + ENV["GCLOUD_TEST_KEYFILE"] + if keyfile + keyfile = File.read keyfile + else + keyfile ||= + ENV["WEBRISK_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 WEBRISK_TEST_PROJECT=test123 WEBRISK_TEST_KEYFILE=/path/to/keyfile.json rake acceptance" + end + require "google/cloud/web_risk/v1/web_risk_service/credentials" + ::Google::Cloud::WebRisk::V1::WebRiskService::Credentials.env_vars.each do |path| + ENV[path] = nil + end + ENV["WEBRISK_PROJECT"] = project + ENV["WEBRISK_TEST_PROJECT"] = project + ENV["WEBRISK_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-web_risk-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-web_risk-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-web_risk-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-web_risk-v1 gem does not have doctest tests." +end + +desc "Run the CI build" +task :ci do + header "BUILDING google-cloud-web_risk-v1" + header "google-cloud-web_risk-v1 rubocop", "*" + Rake::Task[:rubocop].invoke + header "google-cloud-web_risk-v1 yard", "*" + Rake::Task[:yard].invoke + header "google-cloud-web_risk-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-web_risk-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-web_risk-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-web_risk-v1/gapic_metadata.json b/owl-bot-staging/google-cloud-web_risk-v1/gapic_metadata.json new file mode 100644 index 000000000000..2a721b8d290c --- /dev/null +++ b/owl-bot-staging/google-cloud-web_risk-v1/gapic_metadata.json @@ -0,0 +1,43 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "ruby", + "protoPackage": "google.cloud.webrisk.v1", + "libraryPackage": "::Google::Cloud::WebRisk::V1", + "services": { + "WebRiskService": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::WebRisk::V1::WebRiskService::Client", + "rpcs": { + "ComputeThreatListDiff": { + "methods": [ + "compute_threat_list_diff" + ] + }, + "SearchUris": { + "methods": [ + "search_uris" + ] + }, + "SearchHashes": { + "methods": [ + "search_hashes" + ] + }, + "CreateSubmission": { + "methods": [ + "create_submission" + ] + }, + "SubmitUri": { + "methods": [ + "submit_uri" + ] + } + } + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-web_risk-v1/google-cloud-web_risk-v1.gemspec b/owl-bot-staging/google-cloud-web_risk-v1/google-cloud-web_risk-v1.gemspec new file mode 100644 index 000000000000..8e819e3122b0 --- /dev/null +++ b/owl-bot-staging/google-cloud-web_risk-v1/google-cloud-web_risk-v1.gemspec @@ -0,0 +1,28 @@ +# -*- ruby -*- +# encoding: utf-8 + +require File.expand_path("lib/google/cloud/web_risk/v1/version", __dir__) + +Gem::Specification.new do |gem| + gem.name = "google-cloud-web_risk-v1" + gem.version = Google::Cloud::WebRisk::V1::VERSION + + gem.authors = ["Google LLC"] + gem.email = "googleapis-packages@google.com" + gem.description = "Web Risk is an enterprise security product that lets your client applications check URLs against Google's constantly updated lists of unsafe web resources. Note that google-cloud-web_risk-v1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-web_risk instead. See the readme for more details." + gem.summary = "API Client library for the Web Risk V1 API" + 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.2" + + gem.add_dependency "gapic-common", "~> 1.2" + gem.add_dependency "google-cloud-errors", "~> 1.0" +end diff --git a/owl-bot-staging/google-cloud-web_risk-v1/lib/google-cloud-web_risk-v1.rb b/owl-bot-staging/google-cloud-web_risk-v1/lib/google-cloud-web_risk-v1.rb new file mode 100644 index 000000000000..e475a4250097 --- /dev/null +++ b/owl-bot-staging/google-cloud-web_risk-v1/lib/google-cloud-web_risk-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/web_risk/v1" diff --git a/owl-bot-staging/google-cloud-web_risk-v1/lib/google/cloud/web_risk/v1.rb b/owl-bot-staging/google-cloud-web_risk-v1/lib/google/cloud/web_risk/v1.rb new file mode 100644 index 000000000000..ad12e150fde4 --- /dev/null +++ b/owl-bot-staging/google-cloud-web_risk-v1/lib/google/cloud/web_risk/v1.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/web_risk/v1/web_risk_service" +require "google/cloud/web_risk/v1/version" + +module Google + module Cloud + module WebRisk + ## + # API client module. + # + # @example Load this package, including all its services, and instantiate a gRPC client + # + # require "google/cloud/web_risk/v1" + # client = ::Google::Cloud::WebRisk::V1::WebRiskService::Client.new + # + # @example Load this package, including all its services, and instantiate a REST client + # + # require "google/cloud/web_risk/v1" + # client = ::Google::Cloud::WebRisk::V1::WebRiskService::Rest::Client.new + # + module V1 + end + end + end +end + +helper_path = ::File.join __dir__, "v1", "_helpers.rb" +require "google/cloud/web_risk/v1/_helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-web_risk-v1/lib/google/cloud/web_risk/v1/rest.rb b/owl-bot-staging/google-cloud-web_risk-v1/lib/google/cloud/web_risk/v1/rest.rb new file mode 100644 index 000000000000..5b0f7ea9f037 --- /dev/null +++ b/owl-bot-staging/google-cloud-web_risk-v1/lib/google/cloud/web_risk/v1/rest.rb @@ -0,0 +1,37 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/web_risk/v1/web_risk_service/rest" +require "google/cloud/web_risk/v1/version" + +module Google + module Cloud + module WebRisk + ## + # To load just the REST part of this package, including all its services, and instantiate a REST client: + # + # @example + # + # require "google/cloud/web_risk/v1/rest" + # client = ::Google::Cloud::WebRisk::V1::WebRiskService::Rest::Client.new + # + module V1 + end + end + end +end diff --git a/owl-bot-staging/google-cloud-web_risk-v1/lib/google/cloud/web_risk/v1/version.rb b/owl-bot-staging/google-cloud-web_risk-v1/lib/google/cloud/web_risk/v1/version.rb new file mode 100644 index 000000000000..0cb886f79570 --- /dev/null +++ b/owl-bot-staging/google-cloud-web_risk-v1/lib/google/cloud/web_risk/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 WebRisk + module V1 + VERSION = "0.0.1" + end + end + end +end diff --git a/owl-bot-staging/google-cloud-web_risk-v1/lib/google/cloud/web_risk/v1/web_risk_service.rb b/owl-bot-staging/google-cloud-web_risk-v1/lib/google/cloud/web_risk/v1/web_risk_service.rb new file mode 100644 index 000000000000..02e972cd1c09 --- /dev/null +++ b/owl-bot-staging/google-cloud-web_risk-v1/lib/google/cloud/web_risk/v1/web_risk_service.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/common" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/web_risk/v1/version" + +require "google/cloud/web_risk/v1/web_risk_service/credentials" +require "google/cloud/web_risk/v1/web_risk_service/paths" +require "google/cloud/web_risk/v1/web_risk_service/operations" +require "google/cloud/web_risk/v1/web_risk_service/client" +require "google/cloud/web_risk/v1/web_risk_service/rest" + +module Google + module Cloud + module WebRisk + module V1 + ## + # Web Risk API defines an interface to detect malicious URLs on your + # website and in client applications. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/web_risk/v1/web_risk_service" + # client = ::Google::Cloud::WebRisk::V1::WebRiskService::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/web_risk/v1/web_risk_service/rest" + # client = ::Google::Cloud::WebRisk::V1::WebRiskService::Rest::Client.new + # + module WebRiskService + end + end + end + end +end + +helper_path = ::File.join __dir__, "web_risk_service", "helpers.rb" +require "google/cloud/web_risk/v1/web_risk_service/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-web_risk-v1/lib/google/cloud/web_risk/v1/web_risk_service/client.rb b/owl-bot-staging/google-cloud-web_risk-v1/lib/google/cloud/web_risk/v1/web_risk_service/client.rb new file mode 100644 index 000000000000..b0f4624a8848 --- /dev/null +++ b/owl-bot-staging/google-cloud-web_risk-v1/lib/google/cloud/web_risk/v1/web_risk_service/client.rb @@ -0,0 +1,916 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/webrisk/v1/webrisk_pb" + +module Google + module Cloud + module WebRisk + module V1 + module WebRiskService + ## + # Client for the WebRiskService service. + # + # Web Risk API defines an interface to detect malicious URLs on your + # website and in client applications. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "webrisk.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :web_risk_service_stub + + ## + # Configure the WebRiskService Client class. + # + # See {::Google::Cloud::WebRisk::V1::WebRiskService::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all WebRiskService clients + # ::Google::Cloud::WebRisk::V1::WebRiskService::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", "WebRisk", "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.compute_threat_list_diff.timeout = 600.0 + default_config.rpcs.compute_threat_list_diff.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.search_uris.timeout = 600.0 + default_config.rpcs.search_uris.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.search_hashes.timeout = 600.0 + default_config.rpcs.search_hashes.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.create_submission.timeout = 600.0 + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the WebRiskService 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::WebRisk::V1::WebRiskService::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 + @web_risk_service_stub.universe_domain + end + + ## + # Create a new WebRiskService client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::WebRisk::V1::WebRiskService::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::WebRisk::V1::WebRiskService::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the WebRiskService 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/webrisk/v1/webrisk_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 + + @web_risk_service_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::WebRisk::V1::WebRiskService::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 + ) + + @web_risk_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 + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::WebRisk::V1::WebRiskService::Operations] + # + attr_reader :operations_client + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @web_risk_service_stub.logger + end + + # Service calls + + ## + # Gets the most recent threat list diffs. These diffs should be applied to + # a local database of hashes to keep it up-to-date. If the local database is + # empty or excessively out-of-date, a complete snapshot of the database will + # be returned. This Method only updates a single ThreatList at a time. To + # update multiple ThreatList databases, this method needs to be called once + # for each list. + # + # @overload compute_threat_list_diff(request, options = nil) + # Pass arguments to `compute_threat_list_diff` via a request object, either of type + # {::Google::Cloud::WebRisk::V1::ComputeThreatListDiffRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::WebRisk::V1::ComputeThreatListDiffRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload compute_threat_list_diff(threat_type: nil, version_token: nil, constraints: nil) + # Pass arguments to `compute_threat_list_diff` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param threat_type [::Google::Cloud::WebRisk::V1::ThreatType] + # Required. The threat list to update. Only a single ThreatType should be + # specified per request. If you want to handle multiple ThreatTypes, you must + # make one request per ThreatType. + # @param version_token [::String] + # The current version token of the client for the requested list (the + # client version that was received from the last successful diff). + # If the client does not have a version token (this is the first time calling + # ComputeThreatListDiff), this may be left empty and a full database + # snapshot will be returned. + # @param constraints [::Google::Cloud::WebRisk::V1::ComputeThreatListDiffRequest::Constraints, ::Hash] + # Required. The constraints associated with this request. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::WebRisk::V1::ComputeThreatListDiffResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::WebRisk::V1::ComputeThreatListDiffResponse] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/web_risk/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::WebRisk::V1::WebRiskService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::WebRisk::V1::ComputeThreatListDiffRequest.new + # + # # Call the compute_threat_list_diff method. + # result = client.compute_threat_list_diff request + # + # # The returned object is of type Google::Cloud::WebRisk::V1::ComputeThreatListDiffResponse. + # p result + # + def compute_threat_list_diff request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::WebRisk::V1::ComputeThreatListDiffRequest + + # Converts hash 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.compute_threat_list_diff.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::WebRisk::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.compute_threat_list_diff.timeout, + metadata: metadata, + retry_policy: @config.rpcs.compute_threat_list_diff.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @web_risk_service_stub.call_rpc :compute_threat_list_diff, 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 + + ## + # This method is used to check whether a URI is on a given threatList. + # Multiple threatLists may be searched in a single query. + # The response will list all requested threatLists the URI was found to + # match. If the URI is not found on any of the requested ThreatList an + # empty response will be returned. + # + # @overload search_uris(request, options = nil) + # Pass arguments to `search_uris` via a request object, either of type + # {::Google::Cloud::WebRisk::V1::SearchUrisRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::WebRisk::V1::SearchUrisRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload search_uris(uri: nil, threat_types: nil) + # Pass arguments to `search_uris` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param uri [::String] + # Required. The URI to be checked for matches. + # @param threat_types [::Array<::Google::Cloud::WebRisk::V1::ThreatType>] + # Required. The ThreatLists to search in. Multiple ThreatLists may be + # specified. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::WebRisk::V1::SearchUrisResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::WebRisk::V1::SearchUrisResponse] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/web_risk/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::WebRisk::V1::WebRiskService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::WebRisk::V1::SearchUrisRequest.new + # + # # Call the search_uris method. + # result = client.search_uris request + # + # # The returned object is of type Google::Cloud::WebRisk::V1::SearchUrisResponse. + # p result + # + def search_uris request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::WebRisk::V1::SearchUrisRequest + + # Converts hash 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.search_uris.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::WebRisk::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.search_uris.timeout, + metadata: metadata, + retry_policy: @config.rpcs.search_uris.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @web_risk_service_stub.call_rpc :search_uris, 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 + + ## + # Gets the full hashes that match the requested hash prefix. + # This is used after a hash prefix is looked up in a threatList + # and there is a match. The client side threatList only holds partial hashes + # so the client must query this method to determine if there is a full + # hash match of a threat. + # + # @overload search_hashes(request, options = nil) + # Pass arguments to `search_hashes` via a request object, either of type + # {::Google::Cloud::WebRisk::V1::SearchHashesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::WebRisk::V1::SearchHashesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload search_hashes(hash_prefix: nil, threat_types: nil) + # Pass arguments to `search_hashes` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param hash_prefix [::String] + # A hash prefix, consisting of the most significant 4-32 bytes of a SHA256 + # hash. For JSON requests, this field is base64-encoded. + # Note that if this parameter is provided by a URI, it must be encoded using + # the web safe base64 variant (RFC 4648). + # @param threat_types [::Array<::Google::Cloud::WebRisk::V1::ThreatType>] + # Required. The ThreatLists to search in. Multiple ThreatLists may be + # specified. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::WebRisk::V1::SearchHashesResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::WebRisk::V1::SearchHashesResponse] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/web_risk/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::WebRisk::V1::WebRiskService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::WebRisk::V1::SearchHashesRequest.new + # + # # Call the search_hashes method. + # result = client.search_hashes request + # + # # The returned object is of type Google::Cloud::WebRisk::V1::SearchHashesResponse. + # p result + # + def search_hashes request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::WebRisk::V1::SearchHashesRequest + + # Converts hash 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.search_hashes.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::WebRisk::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.search_hashes.timeout, + metadata: metadata, + retry_policy: @config.rpcs.search_hashes.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @web_risk_service_stub.call_rpc :search_hashes, 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 Submission of a URI suspected of containing phishing content to + # be reviewed. If the result verifies the existence of malicious phishing + # content, the site will be added to the [Google's Social Engineering + # lists](https://support.google.com/webmasters/answer/6350487/) in order to + # protect users that could get exposed to this threat in the future. Only + # allowlisted projects can use this method during Early Access. Please reach + # out to Sales or your customer engineer to obtain access. + # + # @overload create_submission(request, options = nil) + # Pass arguments to `create_submission` via a request object, either of type + # {::Google::Cloud::WebRisk::V1::CreateSubmissionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::WebRisk::V1::CreateSubmissionRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_submission(parent: nil, submission: nil) + # Pass arguments to `create_submission` via keyword arguments. Note that at + # least one keyword argument is 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 name of the project that is making the submission. This + # string is in the format "projects/\\{project_number}". + # @param submission [::Google::Cloud::WebRisk::V1::Submission, ::Hash] + # Required. The submission that contains the content of the phishing report. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::WebRisk::V1::Submission] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::WebRisk::V1::Submission] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/web_risk/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::WebRisk::V1::WebRiskService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::WebRisk::V1::CreateSubmissionRequest.new + # + # # Call the create_submission method. + # result = client.create_submission request + # + # # The returned object is of type Google::Cloud::WebRisk::V1::Submission. + # p result + # + def create_submission request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::WebRisk::V1::CreateSubmissionRequest + + # Converts hash 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_submission.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::WebRisk::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_submission.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_submission.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @web_risk_service_stub.call_rpc :create_submission, 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 + + ## + # Submits a URI suspected of containing malicious content to be reviewed. + # Returns a google.longrunning.Operation which, once the review is complete, + # is updated with its result. You can use the [Pub/Sub API] + # (https://cloud.google.com/pubsub) to receive notifications for the returned + # Operation. If the result verifies the existence of malicious content, the + # site will be added to the [Google's Social Engineering lists] + # (https://support.google.com/webmasters/answer/6350487/) in order to + # protect users that could get exposed to this threat in the future. Only + # allowlisted projects can use this method during Early Access. Please reach + # out to Sales or your customer engineer to obtain access. + # + # @overload submit_uri(request, options = nil) + # Pass arguments to `submit_uri` via a request object, either of type + # {::Google::Cloud::WebRisk::V1::SubmitUriRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::WebRisk::V1::SubmitUriRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload submit_uri(parent: nil, submission: nil, threat_info: nil, threat_discovery: nil) + # Pass arguments to `submit_uri` via keyword arguments. Note that at + # least one keyword argument is 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 name of the project that is making the submission. This + # string is in the format "projects/\\{project_number}". + # @param submission [::Google::Cloud::WebRisk::V1::Submission, ::Hash] + # Required. The submission that contains the URI to be scanned. + # @param threat_info [::Google::Cloud::WebRisk::V1::ThreatInfo, ::Hash] + # Provides additional information about the submission. + # @param threat_discovery [::Google::Cloud::WebRisk::V1::ThreatDiscovery, ::Hash] + # Provides additional information about how the submission was discovered. + # + # @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/web_risk/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::WebRisk::V1::WebRiskService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::WebRisk::V1::SubmitUriRequest.new + # + # # Call the submit_uri method. + # result = client.submit_uri 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 submit_uri request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::WebRisk::V1::SubmitUriRequest + + # Converts hash 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.submit_uri.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::WebRisk::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.submit_uri.timeout, + metadata: metadata, + retry_policy: @config.rpcs.submit_uri.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @web_risk_service_stub.call_rpc :submit_uri, 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 WebRiskService API. + # + # This class represents the configuration for WebRiskService, + # 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::WebRisk::V1::WebRiskService::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 + # # compute_threat_list_diff to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::WebRisk::V1::WebRiskService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.compute_threat_list_diff.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::WebRisk::V1::WebRiskService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.compute_threat_list_diff.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::WebRisk::V1::WebRiskService::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 = "webrisk.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 WebRiskService 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 `compute_threat_list_diff` + # @return [::Gapic::Config::Method] + # + attr_reader :compute_threat_list_diff + ## + # RPC-specific configuration for `search_uris` + # @return [::Gapic::Config::Method] + # + attr_reader :search_uris + ## + # RPC-specific configuration for `search_hashes` + # @return [::Gapic::Config::Method] + # + attr_reader :search_hashes + ## + # RPC-specific configuration for `create_submission` + # @return [::Gapic::Config::Method] + # + attr_reader :create_submission + ## + # RPC-specific configuration for `submit_uri` + # @return [::Gapic::Config::Method] + # + attr_reader :submit_uri + + # @private + def initialize parent_rpcs = nil + compute_threat_list_diff_config = parent_rpcs.compute_threat_list_diff if parent_rpcs.respond_to? :compute_threat_list_diff + @compute_threat_list_diff = ::Gapic::Config::Method.new compute_threat_list_diff_config + search_uris_config = parent_rpcs.search_uris if parent_rpcs.respond_to? :search_uris + @search_uris = ::Gapic::Config::Method.new search_uris_config + search_hashes_config = parent_rpcs.search_hashes if parent_rpcs.respond_to? :search_hashes + @search_hashes = ::Gapic::Config::Method.new search_hashes_config + create_submission_config = parent_rpcs.create_submission if parent_rpcs.respond_to? :create_submission + @create_submission = ::Gapic::Config::Method.new create_submission_config + submit_uri_config = parent_rpcs.submit_uri if parent_rpcs.respond_to? :submit_uri + @submit_uri = ::Gapic::Config::Method.new submit_uri_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-web_risk-v1/lib/google/cloud/web_risk/v1/web_risk_service/credentials.rb b/owl-bot-staging/google-cloud-web_risk-v1/lib/google/cloud/web_risk/v1/web_risk_service/credentials.rb new file mode 100644 index 000000000000..dbc56f07610b --- /dev/null +++ b/owl-bot-staging/google-cloud-web_risk-v1/lib/google/cloud/web_risk/v1/web_risk_service/credentials.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! + +require "googleauth" + +module Google + module Cloud + module WebRisk + module V1 + module WebRiskService + # Credentials for the WebRiskService API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/cloud-platform" + ] + self.env_vars = [ + "WEBRISK_CREDENTIALS", + "WEBRISK_KEYFILE", + "GOOGLE_CLOUD_CREDENTIALS", + "GOOGLE_CLOUD_KEYFILE", + "GCLOUD_KEYFILE", + "WEBRISK_CREDENTIALS_JSON", + "WEBRISK_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-web_risk-v1/lib/google/cloud/web_risk/v1/web_risk_service/operations.rb b/owl-bot-staging/google-cloud-web_risk-v1/lib/google/cloud/web_risk/v1/web_risk_service/operations.rb new file mode 100644 index 000000000000..0c9945f420ed --- /dev/null +++ b/owl-bot-staging/google-cloud-web_risk-v1/lib/google/cloud/web_risk/v1/web_risk_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 WebRisk + module V1 + module WebRiskService + # Service that implements Longrunning Operations API. + class Operations + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "webrisk.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :operations_stub + + ## + # Configuration for the WebRiskService 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 WebRiskService 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::WebRisk::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::WebRisk::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::WebRisk::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::WebRisk::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::WebRisk::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 = "webrisk.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-web_risk-v1/lib/google/cloud/web_risk/v1/web_risk_service/paths.rb b/owl-bot-staging/google-cloud-web_risk-v1/lib/google/cloud/web_risk/v1/web_risk_service/paths.rb new file mode 100644 index 000000000000..b788c51e20cd --- /dev/null +++ b/owl-bot-staging/google-cloud-web_risk-v1/lib/google/cloud/web_risk/v1/web_risk_service/paths.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! + + +module Google + module Cloud + module WebRisk + module V1 + module WebRiskService + # Path helper methods for the WebRiskService API. + module Paths + ## + # 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-web_risk-v1/lib/google/cloud/web_risk/v1/web_risk_service/rest.rb b/owl-bot-staging/google-cloud-web_risk-v1/lib/google/cloud/web_risk/v1/web_risk_service/rest.rb new file mode 100644 index 000000000000..0c1cf72ecccb --- /dev/null +++ b/owl-bot-staging/google-cloud-web_risk-v1/lib/google/cloud/web_risk/v1/web_risk_service/rest.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! + +require "gapic/rest" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/web_risk/v1/version" + +require "google/cloud/web_risk/v1/web_risk_service/credentials" +require "google/cloud/web_risk/v1/web_risk_service/paths" +require "google/cloud/web_risk/v1/web_risk_service/rest/operations" +require "google/cloud/web_risk/v1/web_risk_service/rest/client" + +module Google + module Cloud + module WebRisk + module V1 + ## + # Web Risk API defines an interface to detect malicious URLs on your + # website and in client applications. + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/web_risk/v1/web_risk_service/rest" + # client = ::Google::Cloud::WebRisk::V1::WebRiskService::Rest::Client.new + # + module WebRiskService + # Client for the REST transport + module Rest + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "rest", "helpers.rb" +require "google/cloud/web_risk/v1/web_risk_service/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-web_risk-v1/lib/google/cloud/web_risk/v1/web_risk_service/rest/client.rb b/owl-bot-staging/google-cloud-web_risk-v1/lib/google/cloud/web_risk/v1/web_risk_service/rest/client.rb new file mode 100644 index 000000000000..ee5ae8088b9d --- /dev/null +++ b/owl-bot-staging/google-cloud-web_risk-v1/lib/google/cloud/web_risk/v1/web_risk_service/rest/client.rb @@ -0,0 +1,862 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/webrisk/v1/webrisk_pb" +require "google/cloud/web_risk/v1/web_risk_service/rest/service_stub" + +module Google + module Cloud + module WebRisk + module V1 + module WebRiskService + module Rest + ## + # REST client for the WebRiskService service. + # + # Web Risk API defines an interface to detect malicious URLs on your + # website and in client applications. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "webrisk.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :web_risk_service_stub + + ## + # Configure the WebRiskService Client class. + # + # See {::Google::Cloud::WebRisk::V1::WebRiskService::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all WebRiskService clients + # ::Google::Cloud::WebRisk::V1::WebRiskService::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", "WebRisk", "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.compute_threat_list_diff.timeout = 600.0 + default_config.rpcs.compute_threat_list_diff.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.search_uris.timeout = 600.0 + default_config.rpcs.search_uris.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.search_hashes.timeout = 600.0 + default_config.rpcs.search_hashes.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.create_submission.timeout = 600.0 + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the WebRiskService 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::WebRisk::V1::WebRiskService::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 + @web_risk_service_stub.universe_domain + end + + ## + # Create a new WebRiskService REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::WebRisk::V1::WebRiskService::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::WebRisk::V1::WebRiskService::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the WebRiskService 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::WebRisk::V1::WebRiskService::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 + + @web_risk_service_stub = ::Google::Cloud::WebRisk::V1::WebRiskService::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials, + logger: @config.logger + ) + + @web_risk_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 + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::WebRisk::V1::WebRiskService::Rest::Operations] + # + attr_reader :operations_client + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @web_risk_service_stub.logger + end + + # Service calls + + ## + # Gets the most recent threat list diffs. These diffs should be applied to + # a local database of hashes to keep it up-to-date. If the local database is + # empty or excessively out-of-date, a complete snapshot of the database will + # be returned. This Method only updates a single ThreatList at a time. To + # update multiple ThreatList databases, this method needs to be called once + # for each list. + # + # @overload compute_threat_list_diff(request, options = nil) + # Pass arguments to `compute_threat_list_diff` via a request object, either of type + # {::Google::Cloud::WebRisk::V1::ComputeThreatListDiffRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::WebRisk::V1::ComputeThreatListDiffRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload compute_threat_list_diff(threat_type: nil, version_token: nil, constraints: nil) + # Pass arguments to `compute_threat_list_diff` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param threat_type [::Google::Cloud::WebRisk::V1::ThreatType] + # Required. The threat list to update. Only a single ThreatType should be + # specified per request. If you want to handle multiple ThreatTypes, you must + # make one request per ThreatType. + # @param version_token [::String] + # The current version token of the client for the requested list (the + # client version that was received from the last successful diff). + # If the client does not have a version token (this is the first time calling + # ComputeThreatListDiff), this may be left empty and a full database + # snapshot will be returned. + # @param constraints [::Google::Cloud::WebRisk::V1::ComputeThreatListDiffRequest::Constraints, ::Hash] + # Required. The constraints associated with this request. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::WebRisk::V1::ComputeThreatListDiffResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::WebRisk::V1::ComputeThreatListDiffResponse] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/web_risk/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::WebRisk::V1::WebRiskService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::WebRisk::V1::ComputeThreatListDiffRequest.new + # + # # Call the compute_threat_list_diff method. + # result = client.compute_threat_list_diff request + # + # # The returned object is of type Google::Cloud::WebRisk::V1::ComputeThreatListDiffResponse. + # p result + # + def compute_threat_list_diff request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::WebRisk::V1::ComputeThreatListDiffRequest + + # Converts hash 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.compute_threat_list_diff.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::WebRisk::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.compute_threat_list_diff.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.compute_threat_list_diff.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @web_risk_service_stub.compute_threat_list_diff 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 + + ## + # This method is used to check whether a URI is on a given threatList. + # Multiple threatLists may be searched in a single query. + # The response will list all requested threatLists the URI was found to + # match. If the URI is not found on any of the requested ThreatList an + # empty response will be returned. + # + # @overload search_uris(request, options = nil) + # Pass arguments to `search_uris` via a request object, either of type + # {::Google::Cloud::WebRisk::V1::SearchUrisRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::WebRisk::V1::SearchUrisRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload search_uris(uri: nil, threat_types: nil) + # Pass arguments to `search_uris` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param uri [::String] + # Required. The URI to be checked for matches. + # @param threat_types [::Array<::Google::Cloud::WebRisk::V1::ThreatType>] + # Required. The ThreatLists to search in. Multiple ThreatLists may be + # specified. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::WebRisk::V1::SearchUrisResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::WebRisk::V1::SearchUrisResponse] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/web_risk/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::WebRisk::V1::WebRiskService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::WebRisk::V1::SearchUrisRequest.new + # + # # Call the search_uris method. + # result = client.search_uris request + # + # # The returned object is of type Google::Cloud::WebRisk::V1::SearchUrisResponse. + # p result + # + def search_uris request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::WebRisk::V1::SearchUrisRequest + + # Converts hash 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.search_uris.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::WebRisk::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.search_uris.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.search_uris.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @web_risk_service_stub.search_uris 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 + + ## + # Gets the full hashes that match the requested hash prefix. + # This is used after a hash prefix is looked up in a threatList + # and there is a match. The client side threatList only holds partial hashes + # so the client must query this method to determine if there is a full + # hash match of a threat. + # + # @overload search_hashes(request, options = nil) + # Pass arguments to `search_hashes` via a request object, either of type + # {::Google::Cloud::WebRisk::V1::SearchHashesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::WebRisk::V1::SearchHashesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload search_hashes(hash_prefix: nil, threat_types: nil) + # Pass arguments to `search_hashes` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param hash_prefix [::String] + # A hash prefix, consisting of the most significant 4-32 bytes of a SHA256 + # hash. For JSON requests, this field is base64-encoded. + # Note that if this parameter is provided by a URI, it must be encoded using + # the web safe base64 variant (RFC 4648). + # @param threat_types [::Array<::Google::Cloud::WebRisk::V1::ThreatType>] + # Required. The ThreatLists to search in. Multiple ThreatLists may be + # specified. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::WebRisk::V1::SearchHashesResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::WebRisk::V1::SearchHashesResponse] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/web_risk/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::WebRisk::V1::WebRiskService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::WebRisk::V1::SearchHashesRequest.new + # + # # Call the search_hashes method. + # result = client.search_hashes request + # + # # The returned object is of type Google::Cloud::WebRisk::V1::SearchHashesResponse. + # p result + # + def search_hashes request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::WebRisk::V1::SearchHashesRequest + + # Converts hash 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.search_hashes.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::WebRisk::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.search_hashes.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.search_hashes.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @web_risk_service_stub.search_hashes 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 Submission of a URI suspected of containing phishing content to + # be reviewed. If the result verifies the existence of malicious phishing + # content, the site will be added to the [Google's Social Engineering + # lists](https://support.google.com/webmasters/answer/6350487/) in order to + # protect users that could get exposed to this threat in the future. Only + # allowlisted projects can use this method during Early Access. Please reach + # out to Sales or your customer engineer to obtain access. + # + # @overload create_submission(request, options = nil) + # Pass arguments to `create_submission` via a request object, either of type + # {::Google::Cloud::WebRisk::V1::CreateSubmissionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::WebRisk::V1::CreateSubmissionRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_submission(parent: nil, submission: nil) + # Pass arguments to `create_submission` via keyword arguments. Note that at + # least one keyword argument is 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 name of the project that is making the submission. This + # string is in the format "projects/\\{project_number}". + # @param submission [::Google::Cloud::WebRisk::V1::Submission, ::Hash] + # Required. The submission that contains the content of the phishing report. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::WebRisk::V1::Submission] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::WebRisk::V1::Submission] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/web_risk/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::WebRisk::V1::WebRiskService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::WebRisk::V1::CreateSubmissionRequest.new + # + # # Call the create_submission method. + # result = client.create_submission request + # + # # The returned object is of type Google::Cloud::WebRisk::V1::Submission. + # p result + # + def create_submission request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::WebRisk::V1::CreateSubmissionRequest + + # Converts hash 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_submission.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::WebRisk::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_submission.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_submission.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @web_risk_service_stub.create_submission 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 + + ## + # Submits a URI suspected of containing malicious content to be reviewed. + # Returns a google.longrunning.Operation which, once the review is complete, + # is updated with its result. You can use the [Pub/Sub API] + # (https://cloud.google.com/pubsub) to receive notifications for the returned + # Operation. If the result verifies the existence of malicious content, the + # site will be added to the [Google's Social Engineering lists] + # (https://support.google.com/webmasters/answer/6350487/) in order to + # protect users that could get exposed to this threat in the future. Only + # allowlisted projects can use this method during Early Access. Please reach + # out to Sales or your customer engineer to obtain access. + # + # @overload submit_uri(request, options = nil) + # Pass arguments to `submit_uri` via a request object, either of type + # {::Google::Cloud::WebRisk::V1::SubmitUriRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::WebRisk::V1::SubmitUriRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload submit_uri(parent: nil, submission: nil, threat_info: nil, threat_discovery: nil) + # Pass arguments to `submit_uri` via keyword arguments. Note that at + # least one keyword argument is 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 name of the project that is making the submission. This + # string is in the format "projects/\\{project_number}". + # @param submission [::Google::Cloud::WebRisk::V1::Submission, ::Hash] + # Required. The submission that contains the URI to be scanned. + # @param threat_info [::Google::Cloud::WebRisk::V1::ThreatInfo, ::Hash] + # Provides additional information about the submission. + # @param threat_discovery [::Google::Cloud::WebRisk::V1::ThreatDiscovery, ::Hash] + # Provides additional information about how the submission was discovered. + # @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/web_risk/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::WebRisk::V1::WebRiskService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::WebRisk::V1::SubmitUriRequest.new + # + # # Call the submit_uri method. + # result = client.submit_uri 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 submit_uri request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::WebRisk::V1::SubmitUriRequest + + # Converts hash 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.submit_uri.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::WebRisk::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.submit_uri.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.submit_uri.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @web_risk_service_stub.submit_uri 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 + + ## + # Configuration class for the WebRiskService REST API. + # + # This class represents the configuration for WebRiskService 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::WebRisk::V1::WebRiskService::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 + # # compute_threat_list_diff to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::WebRisk::V1::WebRiskService::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.compute_threat_list_diff.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::WebRisk::V1::WebRiskService::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.compute_threat_list_diff.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 = "webrisk.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 WebRiskService 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 `compute_threat_list_diff` + # @return [::Gapic::Config::Method] + # + attr_reader :compute_threat_list_diff + ## + # RPC-specific configuration for `search_uris` + # @return [::Gapic::Config::Method] + # + attr_reader :search_uris + ## + # RPC-specific configuration for `search_hashes` + # @return [::Gapic::Config::Method] + # + attr_reader :search_hashes + ## + # RPC-specific configuration for `create_submission` + # @return [::Gapic::Config::Method] + # + attr_reader :create_submission + ## + # RPC-specific configuration for `submit_uri` + # @return [::Gapic::Config::Method] + # + attr_reader :submit_uri + + # @private + def initialize parent_rpcs = nil + compute_threat_list_diff_config = parent_rpcs.compute_threat_list_diff if parent_rpcs.respond_to? :compute_threat_list_diff + @compute_threat_list_diff = ::Gapic::Config::Method.new compute_threat_list_diff_config + search_uris_config = parent_rpcs.search_uris if parent_rpcs.respond_to? :search_uris + @search_uris = ::Gapic::Config::Method.new search_uris_config + search_hashes_config = parent_rpcs.search_hashes if parent_rpcs.respond_to? :search_hashes + @search_hashes = ::Gapic::Config::Method.new search_hashes_config + create_submission_config = parent_rpcs.create_submission if parent_rpcs.respond_to? :create_submission + @create_submission = ::Gapic::Config::Method.new create_submission_config + submit_uri_config = parent_rpcs.submit_uri if parent_rpcs.respond_to? :submit_uri + @submit_uri = ::Gapic::Config::Method.new submit_uri_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-web_risk-v1/lib/google/cloud/web_risk/v1/web_risk_service/rest/operations.rb b/owl-bot-staging/google-cloud-web_risk-v1/lib/google/cloud/web_risk/v1/web_risk_service/rest/operations.rb new file mode 100644 index 000000000000..1c9a2c9901a1 --- /dev/null +++ b/owl-bot-staging/google-cloud-web_risk-v1/lib/google/cloud/web_risk/v1/web_risk_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 WebRisk + module V1 + module WebRiskService + module Rest + # Service that implements Longrunning Operations API. + class Operations + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "webrisk.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :operations_stub + + ## + # Configuration for the WebRiskService 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 WebRiskService 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::WebRisk::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::WebRisk::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::WebRisk::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::WebRisk::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 = "webrisk.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}/operations", + matches: [ + ["name", %r{^projects/[^/]+/?$}, 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/[^/]+/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{^projects/[^/]+/operations/[^/]+/?$}, false] + ] + ) + 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{^projects/[^/]+/operations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-web_risk-v1/lib/google/cloud/web_risk/v1/web_risk_service/rest/service_stub.rb b/owl-bot-staging/google-cloud-web_risk-v1/lib/google/cloud/web_risk/v1/web_risk_service/rest/service_stub.rb new file mode 100644 index 000000000000..f1c555943374 --- /dev/null +++ b/owl-bot-staging/google-cloud-web_risk-v1/lib/google/cloud/web_risk/v1/web_risk_service/rest/service_stub.rb @@ -0,0 +1,382 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/webrisk/v1/webrisk_pb" + +module Google + module Cloud + module WebRisk + module V1 + module WebRiskService + module Rest + ## + # REST service stub for the WebRiskService 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 compute_threat_list_diff REST call + # + # @param request_pb [::Google::Cloud::WebRisk::V1::ComputeThreatListDiffRequest] + # 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::WebRisk::V1::ComputeThreatListDiffResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::WebRisk::V1::ComputeThreatListDiffResponse] + # A result object deserialized from the server's reply + def compute_threat_list_diff request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_compute_threat_list_diff_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: "compute_threat_list_diff", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::WebRisk::V1::ComputeThreatListDiffResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the search_uris REST call + # + # @param request_pb [::Google::Cloud::WebRisk::V1::SearchUrisRequest] + # 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::WebRisk::V1::SearchUrisResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::WebRisk::V1::SearchUrisResponse] + # A result object deserialized from the server's reply + def search_uris request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_search_uris_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: "search_uris", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::WebRisk::V1::SearchUrisResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the search_hashes REST call + # + # @param request_pb [::Google::Cloud::WebRisk::V1::SearchHashesRequest] + # 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::WebRisk::V1::SearchHashesResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::WebRisk::V1::SearchHashesResponse] + # A result object deserialized from the server's reply + def search_hashes request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_search_hashes_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: "search_hashes", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::WebRisk::V1::SearchHashesResponse.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_submission REST call + # + # @param request_pb [::Google::Cloud::WebRisk::V1::CreateSubmissionRequest] + # 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::WebRisk::V1::Submission] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::WebRisk::V1::Submission] + # A result object deserialized from the server's reply + def create_submission request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_submission_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_submission", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::WebRisk::V1::Submission.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the submit_uri REST call + # + # @param request_pb [::Google::Cloud::WebRisk::V1::SubmitUriRequest] + # 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 submit_uri request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_submit_uri_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: "submit_uri", + 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 + + ## + # @private + # + # GRPC transcoding helper method for the compute_threat_list_diff REST call + # + # @param request_pb [::Google::Cloud::WebRisk::V1::ComputeThreatListDiffRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_compute_threat_list_diff_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/threatLists:computeDiff", + matches: [] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the search_uris REST call + # + # @param request_pb [::Google::Cloud::WebRisk::V1::SearchUrisRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_search_uris_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/uris:search", + matches: [] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the search_hashes REST call + # + # @param request_pb [::Google::Cloud::WebRisk::V1::SearchHashesRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_search_hashes_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/hashes:search", + matches: [] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_submission REST call + # + # @param request_pb [::Google::Cloud::WebRisk::V1::CreateSubmissionRequest] + # 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_submission_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/submissions", + body: "submission", + matches: [ + ["parent", %r{^projects/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the submit_uri REST call + # + # @param request_pb [::Google::Cloud::WebRisk::V1::SubmitUriRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_submit_uri_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/uris:submit", + body: "*", + 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-web_risk-v1/lib/google/cloud/webrisk/v1/webrisk_pb.rb b/owl-bot-staging/google-cloud-web_risk-v1/lib/google/cloud/webrisk/v1/webrisk_pb.rb new file mode 100644 index 000000000000..bcf892102ed2 --- /dev/null +++ b/owl-bot-staging/google-cloud-web_risk-v1/lib/google/cloud/webrisk/v1/webrisk_pb.rb @@ -0,0 +1,58 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/webrisk/v1/webrisk.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/timestamp_pb' + + +descriptor_data = "\n%google/cloud/webrisk/v1/webrisk.proto\x12\x17google.cloud.webrisk.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\x1fgoogle/protobuf/timestamp.proto\"\xe3\x02\n\x1c\x43omputeThreatListDiffRequest\x12=\n\x0bthreat_type\x18\x01 \x01(\x0e\x32#.google.cloud.webrisk.v1.ThreatTypeB\x03\xe0\x41\x02\x12\x15\n\rversion_token\x18\x02 \x01(\x0c\x12[\n\x0b\x63onstraints\x18\x03 \x01(\x0b\x32\x41.google.cloud.webrisk.v1.ComputeThreatListDiffRequest.ConstraintsB\x03\xe0\x41\x02\x1a\x8f\x01\n\x0b\x43onstraints\x12\x18\n\x10max_diff_entries\x18\x01 \x01(\x05\x12\x1c\n\x14max_database_entries\x18\x02 \x01(\x05\x12H\n\x16supported_compressions\x18\x03 \x03(\x0e\x32(.google.cloud.webrisk.v1.CompressionType\"\x86\x04\n\x1d\x43omputeThreatListDiffResponse\x12Z\n\rresponse_type\x18\x04 \x01(\x0e\x32\x43.google.cloud.webrisk.v1.ComputeThreatListDiffResponse.ResponseType\x12@\n\tadditions\x18\x05 \x01(\x0b\x32-.google.cloud.webrisk.v1.ThreatEntryAdditions\x12>\n\x08removals\x18\x06 \x01(\x0b\x32,.google.cloud.webrisk.v1.ThreatEntryRemovals\x12\x19\n\x11new_version_token\x18\x07 \x01(\x0c\x12Q\n\x08\x63hecksum\x18\x08 \x01(\x0b\x32?.google.cloud.webrisk.v1.ComputeThreatListDiffResponse.Checksum\x12\x39\n\x15recommended_next_diff\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x1a\x1a\n\x08\x43hecksum\x12\x0e\n\x06sha256\x18\x01 \x01(\x0c\"B\n\x0cResponseType\x12\x1d\n\x19RESPONSE_TYPE_UNSPECIFIED\x10\x00\x12\x08\n\x04\x44IFF\x10\x01\x12\t\n\x05RESET\x10\x02\"e\n\x11SearchUrisRequest\x12\x10\n\x03uri\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12>\n\x0cthreat_types\x18\x02 \x03(\x0e\x32#.google.cloud.webrisk.v1.ThreatTypeB\x03\xe0\x41\x02\"\xd4\x01\n\x12SearchUrisResponse\x12\x45\n\x06threat\x18\x01 \x01(\x0b\x32\x35.google.cloud.webrisk.v1.SearchUrisResponse.ThreatUri\x1aw\n\tThreatUri\x12\x39\n\x0cthreat_types\x18\x01 \x03(\x0e\x32#.google.cloud.webrisk.v1.ThreatType\x12/\n\x0b\x65xpire_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"j\n\x13SearchHashesRequest\x12\x13\n\x0bhash_prefix\x18\x01 \x01(\x0c\x12>\n\x0cthreat_types\x18\x02 \x03(\x0e\x32#.google.cloud.webrisk.v1.ThreatTypeB\x03\xe0\x41\x02\"\xa4\x02\n\x14SearchHashesResponse\x12I\n\x07threats\x18\x01 \x03(\x0b\x32\x38.google.cloud.webrisk.v1.SearchHashesResponse.ThreatHash\x12\x38\n\x14negative_expire_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x1a\x86\x01\n\nThreatHash\x12\x39\n\x0cthreat_types\x18\x01 \x03(\x0e\x32#.google.cloud.webrisk.v1.ThreatType\x12\x0c\n\x04hash\x18\x02 \x01(\x0c\x12/\n\x0b\x65xpire_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"\x8f\x01\n\x14ThreatEntryAdditions\x12\x36\n\nraw_hashes\x18\x01 \x03(\x0b\x32\".google.cloud.webrisk.v1.RawHashes\x12?\n\x0brice_hashes\x18\x02 \x01(\x0b\x32*.google.cloud.webrisk.v1.RiceDeltaEncoding\"\x91\x01\n\x13ThreatEntryRemovals\x12\x38\n\x0braw_indices\x18\x01 \x01(\x0b\x32#.google.cloud.webrisk.v1.RawIndices\x12@\n\x0crice_indices\x18\x02 \x01(\x0b\x32*.google.cloud.webrisk.v1.RiceDeltaEncoding\"\x1d\n\nRawIndices\x12\x0f\n\x07indices\x18\x01 \x03(\x05\"4\n\tRawHashes\x12\x13\n\x0bprefix_size\x18\x01 \x01(\x05\x12\x12\n\nraw_hashes\x18\x02 \x01(\x0c\"k\n\x11RiceDeltaEncoding\x12\x13\n\x0b\x66irst_value\x18\x01 \x01(\x03\x12\x16\n\x0erice_parameter\x18\x02 \x01(\x05\x12\x13\n\x0b\x65ntry_count\x18\x03 \x01(\x05\x12\x14\n\x0c\x65ncoded_data\x18\x04 \x01(\x0c\"^\n\nSubmission\x12\x10\n\x03uri\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12>\n\x0cthreat_types\x18\x02 \x03(\x0e\x32#.google.cloud.webrisk.v1.ThreatTypeB\x03\xe0\x41\x03\"\xa5\x06\n\nThreatInfo\x12\x41\n\nabuse_type\x18\x01 \x01(\x0e\x32-.google.cloud.webrisk.v1.ThreatInfo.AbuseType\x12I\n\x11threat_confidence\x18\x02 \x01(\x0b\x32..google.cloud.webrisk.v1.ThreatInfo.Confidence\x12U\n\x14threat_justification\x18\x03 \x01(\x0b\x32\x37.google.cloud.webrisk.v1.ThreatInfo.ThreatJustification\x1a\xcb\x01\n\nConfidence\x12\x0f\n\x05score\x18\x01 \x01(\x02H\x00\x12O\n\x05level\x18\x02 \x01(\x0e\x32>.google.cloud.webrisk.v1.ThreatInfo.Confidence.ConfidenceLevelH\x00\"R\n\x0f\x43onfidenceLevel\x12 \n\x1c\x43ONFIDENCE_LEVEL_UNSPECIFIED\x10\x00\x12\x07\n\x03LOW\x10\x01\x12\n\n\x06MEDIUM\x10\x02\x12\x08\n\x04HIGH\x10\x03\x42\x07\n\x05value\x1a\xfe\x01\n\x13ThreatJustification\x12Z\n\x06labels\x18\x01 \x03(\x0e\x32J.google.cloud.webrisk.v1.ThreatInfo.ThreatJustification.JustificationLabel\x12\x10\n\x08\x63omments\x18\x02 \x03(\t\"y\n\x12JustificationLabel\x12#\n\x1fJUSTIFICATION_LABEL_UNSPECIFIED\x10\x00\x12\x17\n\x13MANUAL_VERIFICATION\x10\x01\x12\x0f\n\x0bUSER_REPORT\x10\x02\x12\x14\n\x10\x41UTOMATED_REPORT\x10\x03\"c\n\tAbuseType\x12\x1a\n\x16\x41\x42USE_TYPE_UNSPECIFIED\x10\x00\x12\x0b\n\x07MALWARE\x10\x01\x12\x16\n\x12SOCIAL_ENGINEERING\x10\x02\x12\x15\n\x11UNWANTED_SOFTWARE\x10\x03\"\xc0\x01\n\x0fThreatDiscovery\x12\x43\n\x08platform\x18\x01 \x01(\x0e\x32\x31.google.cloud.webrisk.v1.ThreatDiscovery.Platform\x12\x14\n\x0cregion_codes\x18\x02 \x03(\t\"R\n\x08Platform\x12\x18\n\x14PLATFORM_UNSPECIFIED\x10\x00\x12\x0b\n\x07\x41NDROID\x10\x01\x12\x07\n\x03IOS\x10\x02\x12\t\n\x05MACOS\x10\x03\x12\x0b\n\x07WINDOWS\x10\x04\"\x9c\x01\n\x17\x43reateSubmissionRequest\x12\x43\n\x06parent\x18\x01 \x01(\tB3\xe0\x41\x02\xfa\x41-\n+cloudresourcemanager.googleapis.com/Project\x12<\n\nsubmission\x18\x02 \x01(\x0b\x32#.google.cloud.webrisk.v1.SubmissionB\x03\xe0\x41\x02\"\x93\x02\n\x10SubmitUriRequest\x12\x43\n\x06parent\x18\x01 \x01(\tB3\xe0\x41\x02\xfa\x41-\n+cloudresourcemanager.googleapis.com/Project\x12<\n\nsubmission\x18\x02 \x01(\x0b\x32#.google.cloud.webrisk.v1.SubmissionB\x03\xe0\x41\x02\x12\x38\n\x0bthreat_info\x18\x03 \x01(\x0b\x32#.google.cloud.webrisk.v1.ThreatInfo\x12\x42\n\x10threat_discovery\x18\x04 \x01(\x0b\x32(.google.cloud.webrisk.v1.ThreatDiscovery\"\x99\x02\n\x11SubmitUriMetadata\x12?\n\x05state\x18\x01 \x01(\x0e\x32\x30.google.cloud.webrisk.v1.SubmitUriMetadata.State\x12/\n\x0b\x63reate_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12/\n\x0bupdate_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"a\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0b\n\x07RUNNING\x10\x01\x12\r\n\tSUCCEEDED\x10\x02\x12\r\n\tCANCELLED\x10\x03\x12\n\n\x06\x46\x41ILED\x10\x04\x12\n\n\x06\x43LOSED\x10\x05*\x8f\x01\n\nThreatType\x12\x1b\n\x17THREAT_TYPE_UNSPECIFIED\x10\x00\x12\x0b\n\x07MALWARE\x10\x01\x12\x16\n\x12SOCIAL_ENGINEERING\x10\x02\x12\x15\n\x11UNWANTED_SOFTWARE\x10\x03\x12(\n$SOCIAL_ENGINEERING_EXTENDED_COVERAGE\x10\x04*F\n\x0f\x43ompressionType\x12 \n\x1c\x43OMPRESSION_TYPE_UNSPECIFIED\x10\x00\x12\x07\n\x03RAW\x10\x01\x12\x08\n\x04RICE\x10\x02\x32\xe1\x07\n\x0eWebRiskService\x12\xd3\x01\n\x15\x43omputeThreatListDiff\x12\x35.google.cloud.webrisk.v1.ComputeThreatListDiffRequest\x1a\x36.google.cloud.webrisk.v1.ComputeThreatListDiffResponse\"K\xda\x41%threat_type,version_token,constraints\x82\xd3\xe4\x93\x02\x1d\x12\x1b/v1/threatLists:computeDiff\x12\x91\x01\n\nSearchUris\x12*.google.cloud.webrisk.v1.SearchUrisRequest\x1a+.google.cloud.webrisk.v1.SearchUrisResponse\"*\xda\x41\x10uri,threat_types\x82\xd3\xe4\x93\x02\x11\x12\x0f/v1/uris:search\x12\xa1\x01\n\x0cSearchHashes\x12,.google.cloud.webrisk.v1.SearchHashesRequest\x1a-.google.cloud.webrisk.v1.SearchHashesResponse\"4\xda\x41\x18hash_prefix,threat_types\x82\xd3\xe4\x93\x02\x13\x12\x11/v1/hashes:search\x12\xb6\x01\n\x10\x43reateSubmission\x12\x30.google.cloud.webrisk.v1.CreateSubmissionRequest\x1a#.google.cloud.webrisk.v1.Submission\"K\xda\x41\x11parent,submission\x82\xd3\xe4\x93\x02\x31\"#/v1/{parent=projects/*}/submissions:\nsubmission\x12\xbb\x01\n\tSubmitUri\x12).google.cloud.webrisk.v1.SubmitUriRequest\x1a\x1d.google.longrunning.Operation\"d\xca\x41\x1f\n\nSubmission\x12\x11SubmitUriMetadata\xda\x41\x11parent,submission\x82\xd3\xe4\x93\x02(\"#/v1/{parent=projects/*}/uris:submit:\x01*\x1aJ\xca\x41\x16webrisk.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\xb6\x01\n\x15\x63om.google.webrisk.v1B\x0cWebRiskProtoP\x01Z5cloud.google.com/go/webrisk/apiv1/webriskpb;webriskpb\xa2\x02\x04GCWR\xaa\x02\x17Google.Cloud.WebRisk.V1\xca\x02\x17Google\\Cloud\\WebRisk\\V1\xea\x02\x1aGoogle::Cloud::WebRisk::V1b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module WebRisk + module V1 + ComputeThreatListDiffRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.webrisk.v1.ComputeThreatListDiffRequest").msgclass + ComputeThreatListDiffRequest::Constraints = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.webrisk.v1.ComputeThreatListDiffRequest.Constraints").msgclass + ComputeThreatListDiffResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.webrisk.v1.ComputeThreatListDiffResponse").msgclass + ComputeThreatListDiffResponse::Checksum = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.webrisk.v1.ComputeThreatListDiffResponse.Checksum").msgclass + ComputeThreatListDiffResponse::ResponseType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.webrisk.v1.ComputeThreatListDiffResponse.ResponseType").enummodule + SearchUrisRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.webrisk.v1.SearchUrisRequest").msgclass + SearchUrisResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.webrisk.v1.SearchUrisResponse").msgclass + SearchUrisResponse::ThreatUri = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.webrisk.v1.SearchUrisResponse.ThreatUri").msgclass + SearchHashesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.webrisk.v1.SearchHashesRequest").msgclass + SearchHashesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.webrisk.v1.SearchHashesResponse").msgclass + SearchHashesResponse::ThreatHash = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.webrisk.v1.SearchHashesResponse.ThreatHash").msgclass + ThreatEntryAdditions = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.webrisk.v1.ThreatEntryAdditions").msgclass + ThreatEntryRemovals = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.webrisk.v1.ThreatEntryRemovals").msgclass + RawIndices = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.webrisk.v1.RawIndices").msgclass + RawHashes = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.webrisk.v1.RawHashes").msgclass + RiceDeltaEncoding = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.webrisk.v1.RiceDeltaEncoding").msgclass + Submission = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.webrisk.v1.Submission").msgclass + ThreatInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.webrisk.v1.ThreatInfo").msgclass + ThreatInfo::Confidence = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.webrisk.v1.ThreatInfo.Confidence").msgclass + ThreatInfo::Confidence::ConfidenceLevel = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.webrisk.v1.ThreatInfo.Confidence.ConfidenceLevel").enummodule + ThreatInfo::ThreatJustification = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.webrisk.v1.ThreatInfo.ThreatJustification").msgclass + ThreatInfo::ThreatJustification::JustificationLabel = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.webrisk.v1.ThreatInfo.ThreatJustification.JustificationLabel").enummodule + ThreatInfo::AbuseType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.webrisk.v1.ThreatInfo.AbuseType").enummodule + ThreatDiscovery = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.webrisk.v1.ThreatDiscovery").msgclass + ThreatDiscovery::Platform = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.webrisk.v1.ThreatDiscovery.Platform").enummodule + CreateSubmissionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.webrisk.v1.CreateSubmissionRequest").msgclass + SubmitUriRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.webrisk.v1.SubmitUriRequest").msgclass + SubmitUriMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.webrisk.v1.SubmitUriMetadata").msgclass + SubmitUriMetadata::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.webrisk.v1.SubmitUriMetadata.State").enummodule + ThreatType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.webrisk.v1.ThreatType").enummodule + CompressionType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.webrisk.v1.CompressionType").enummodule + end + end + end +end diff --git a/owl-bot-staging/google-cloud-web_risk-v1/lib/google/cloud/webrisk/v1/webrisk_services_pb.rb b/owl-bot-staging/google-cloud-web_risk-v1/lib/google/cloud/webrisk/v1/webrisk_services_pb.rb new file mode 100644 index 000000000000..c3a55b60711c --- /dev/null +++ b/owl-bot-staging/google-cloud-web_risk-v1/lib/google/cloud/webrisk/v1/webrisk_services_pb.rb @@ -0,0 +1,82 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/cloud/webrisk/v1/webrisk.proto for package 'Google.Cloud.WebRisk.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/webrisk/v1/webrisk_pb' + +module Google + module Cloud + module WebRisk + module V1 + module WebRiskService + # Web Risk API defines an interface to detect malicious URLs on your + # website and in client applications. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.cloud.webrisk.v1.WebRiskService' + + # Gets the most recent threat list diffs. These diffs should be applied to + # a local database of hashes to keep it up-to-date. If the local database is + # empty or excessively out-of-date, a complete snapshot of the database will + # be returned. This Method only updates a single ThreatList at a time. To + # update multiple ThreatList databases, this method needs to be called once + # for each list. + rpc :ComputeThreatListDiff, ::Google::Cloud::WebRisk::V1::ComputeThreatListDiffRequest, ::Google::Cloud::WebRisk::V1::ComputeThreatListDiffResponse + # This method is used to check whether a URI is on a given threatList. + # Multiple threatLists may be searched in a single query. + # The response will list all requested threatLists the URI was found to + # match. If the URI is not found on any of the requested ThreatList an + # empty response will be returned. + rpc :SearchUris, ::Google::Cloud::WebRisk::V1::SearchUrisRequest, ::Google::Cloud::WebRisk::V1::SearchUrisResponse + # Gets the full hashes that match the requested hash prefix. + # This is used after a hash prefix is looked up in a threatList + # and there is a match. The client side threatList only holds partial hashes + # so the client must query this method to determine if there is a full + # hash match of a threat. + rpc :SearchHashes, ::Google::Cloud::WebRisk::V1::SearchHashesRequest, ::Google::Cloud::WebRisk::V1::SearchHashesResponse + # Creates a Submission of a URI suspected of containing phishing content to + # be reviewed. If the result verifies the existence of malicious phishing + # content, the site will be added to the [Google's Social Engineering + # lists](https://support.google.com/webmasters/answer/6350487/) in order to + # protect users that could get exposed to this threat in the future. Only + # allowlisted projects can use this method during Early Access. Please reach + # out to Sales or your customer engineer to obtain access. + rpc :CreateSubmission, ::Google::Cloud::WebRisk::V1::CreateSubmissionRequest, ::Google::Cloud::WebRisk::V1::Submission + # Submits a URI suspected of containing malicious content to be reviewed. + # Returns a google.longrunning.Operation which, once the review is complete, + # is updated with its result. You can use the [Pub/Sub API] + # (https://cloud.google.com/pubsub) to receive notifications for the returned + # Operation. If the result verifies the existence of malicious content, the + # site will be added to the [Google's Social Engineering lists] + # (https://support.google.com/webmasters/answer/6350487/) in order to + # protect users that could get exposed to this threat in the future. Only + # allowlisted projects can use this method during Early Access. Please reach + # out to Sales or your customer engineer to obtain access. + rpc :SubmitUri, ::Google::Cloud::WebRisk::V1::SubmitUriRequest, ::Google::Longrunning::Operation + end + + Stub = Service.rpc_stub_class + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-web_risk-v1/proto_docs/README.md b/owl-bot-staging/google-cloud-web_risk-v1/proto_docs/README.md new file mode 100644 index 000000000000..3b26f78c15d7 --- /dev/null +++ b/owl-bot-staging/google-cloud-web_risk-v1/proto_docs/README.md @@ -0,0 +1,4 @@ +# Web Risk 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-web_risk-v1/proto_docs/google/api/client.rb b/owl-bot-staging/google-cloud-web_risk-v1/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..3ab0b096d445 --- /dev/null +++ b/owl-bot-staging/google-cloud-web_risk-v1/proto_docs/google/api/client.rb @@ -0,0 +1,593 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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. + # + # Note: This field should not be used in most cases. + 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: + # library_settings: + # 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. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Php. Clobbers the php_namespace option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.php.package_name" field + # in gapic.yaml. API teams should use the protobuf php_namespace option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # library_settings: + # php_settings: + # library_package: Google\Cloud\PubSub\V1 + 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. + # + # Example: + # + # 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 + # @!attribute [rw] batching + # @return [::Google::Api::BatchingConfigProto] + # Batching configuration for an API method in client libraries. + # + # Example of a YAML configuration: + # + # publishing: + # method_settings: + # - selector: google.example.v1.ExampleService.BatchCreateExample + # batching: + # element_count_threshold: 1000 + # request_byte_threshold: 100000000 + # delay_threshold_millis: 10 + 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. + # + # Note: This feature should not be used in most cases. + # @!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 + + # `BatchingConfigProto` defines the batching configuration for an API method. + # @!attribute [rw] thresholds + # @return [::Google::Api::BatchingSettingsProto] + # The thresholds which trigger a batched request to be sent. + # @!attribute [rw] batch_descriptor + # @return [::Google::Api::BatchingDescriptorProto] + # The request and response fields used in batching. + class BatchingConfigProto + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `BatchingSettingsProto` specifies a set of batching thresholds, each of + # which acts as a trigger to send a batch of messages as a request. At least + # one threshold must be positive nonzero. + # @!attribute [rw] element_count_threshold + # @return [::Integer] + # The number of elements of a field collected into a batch which, if + # exceeded, causes the batch to be sent. + # @!attribute [rw] request_byte_threshold + # @return [::Integer] + # The aggregated size of the batched field which, if exceeded, causes the + # batch to be sent. This size is computed by aggregating the sizes of the + # request field to be batched, not of the entire request message. + # @!attribute [rw] delay_threshold + # @return [::Google::Protobuf::Duration] + # The duration after which a batch should be sent, starting from the addition + # of the first message to that batch. + # @!attribute [rw] element_count_limit + # @return [::Integer] + # The maximum number of elements collected in a batch that could be accepted + # by server. + # @!attribute [rw] request_byte_limit + # @return [::Integer] + # The maximum size of the request that could be accepted by server. + # @!attribute [rw] flow_control_element_limit + # @return [::Integer] + # The maximum number of elements allowed by flow control. + # @!attribute [rw] flow_control_byte_limit + # @return [::Integer] + # The maximum size of data allowed by flow control. + # @!attribute [rw] flow_control_limit_exceeded_behavior + # @return [::Google::Api::FlowControlLimitExceededBehaviorProto] + # The behavior to take when the flow control limit is exceeded. + class BatchingSettingsProto + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `BatchingDescriptorProto` specifies the fields of the request message to be + # used for batching, and, optionally, the fields of the response message to be + # used for demultiplexing. + # @!attribute [rw] batched_field + # @return [::String] + # The repeated field in the request message to be aggregated by batching. + # @!attribute [rw] discriminator_fields + # @return [::Array<::String>] + # A list of the fields in the request message. Two requests will be batched + # together only if the values of every field specified in + # `request_discriminator_fields` is equal between the two requests. + # @!attribute [rw] subresponse_field + # @return [::String] + # Optional. When present, indicates the field in the response message to be + # used to demultiplex the response into multiple response messages, in + # correspondence with the multiple request messages originally batched + # together. + class BatchingDescriptorProto + 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 + + # The behavior to take when the flow control limit is exceeded. + module FlowControlLimitExceededBehaviorProto + # Default behavior, system-defined. + UNSET_BEHAVIOR = 0 + + # Stop operation, raise error. + THROW_EXCEPTION = 1 + + # Pause operation until limit clears. + BLOCK = 2 + + # Continue operation, disregard limit. + IGNORE = 3 + end + end +end diff --git a/owl-bot-staging/google-cloud-web_risk-v1/proto_docs/google/api/field_behavior.rb b/owl-bot-staging/google-cloud-web_risk-v1/proto_docs/google/api/field_behavior.rb new file mode 100644 index 000000000000..582be187d115 --- /dev/null +++ b/owl-bot-staging/google-cloud-web_risk-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-web_risk-v1/proto_docs/google/api/launch_stage.rb b/owl-bot-staging/google-cloud-web_risk-v1/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..9392a413fb1b --- /dev/null +++ b/owl-bot-staging/google-cloud-web_risk-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-web_risk-v1/proto_docs/google/api/resource.rb b/owl-bot-staging/google-cloud-web_risk-v1/proto_docs/google/api/resource.rb new file mode 100644 index 000000000000..25dec4847ac1 --- /dev/null +++ b/owl-bot-staging/google-cloud-web_risk-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-web_risk-v1/proto_docs/google/cloud/webrisk/v1/webrisk.rb b/owl-bot-staging/google-cloud-web_risk-v1/proto_docs/google/cloud/webrisk/v1/webrisk.rb new file mode 100644 index 000000000000..bf4b11141acb --- /dev/null +++ b/owl-bot-staging/google-cloud-web_risk-v1/proto_docs/google/cloud/webrisk/v1/webrisk.rb @@ -0,0 +1,528 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 WebRisk + module V1 + # Describes an API diff request. + # @!attribute [rw] threat_type + # @return [::Google::Cloud::WebRisk::V1::ThreatType] + # Required. The threat list to update. Only a single ThreatType should be + # specified per request. If you want to handle multiple ThreatTypes, you must + # make one request per ThreatType. + # @!attribute [rw] version_token + # @return [::String] + # The current version token of the client for the requested list (the + # client version that was received from the last successful diff). + # If the client does not have a version token (this is the first time calling + # ComputeThreatListDiff), this may be left empty and a full database + # snapshot will be returned. + # @!attribute [rw] constraints + # @return [::Google::Cloud::WebRisk::V1::ComputeThreatListDiffRequest::Constraints] + # Required. The constraints associated with this request. + class ComputeThreatListDiffRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The constraints for this diff. + # @!attribute [rw] max_diff_entries + # @return [::Integer] + # The maximum size in number of entries. The diff will not contain more + # entries than this value. This should be a power of 2 between 2**10 and + # 2**20. If zero, no diff size limit is set. + # @!attribute [rw] max_database_entries + # @return [::Integer] + # Sets the maximum number of entries that the client is willing to have + # in the local database. This should be a power of 2 between 2**10 and + # 2**20. If zero, no database size limit is set. + # @!attribute [rw] supported_compressions + # @return [::Array<::Google::Cloud::WebRisk::V1::CompressionType>] + # The compression types supported by the client. + class Constraints + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # @!attribute [rw] response_type + # @return [::Google::Cloud::WebRisk::V1::ComputeThreatListDiffResponse::ResponseType] + # The type of response. This may indicate that an action must be taken by the + # client when the response is received. + # @!attribute [rw] additions + # @return [::Google::Cloud::WebRisk::V1::ThreatEntryAdditions] + # A set of entries to add to a local threat type's list. + # @!attribute [rw] removals + # @return [::Google::Cloud::WebRisk::V1::ThreatEntryRemovals] + # A set of entries to remove from a local threat type's list. + # This field may be empty. + # @!attribute [rw] new_version_token + # @return [::String] + # The new opaque client version token. This should be retained by the client + # and passed into the next call of ComputeThreatListDiff as 'version_token'. + # A separate version token should be stored and used for each threatList. + # @!attribute [rw] checksum + # @return [::Google::Cloud::WebRisk::V1::ComputeThreatListDiffResponse::Checksum] + # The expected SHA256 hash of the client state; that is, of the sorted list + # of all hashes present in the database after applying the provided diff. + # If the client state doesn't match the expected state, the client must + # discard this diff and retry later. + # @!attribute [rw] recommended_next_diff + # @return [::Google::Protobuf::Timestamp] + # The soonest the client should wait before issuing any diff + # request. Querying sooner is unlikely to produce a meaningful diff. + # Waiting longer is acceptable considering the use case. + # If this field is not set clients may update as soon as they want. + class ComputeThreatListDiffResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The expected state of a client's local database. + # @!attribute [rw] sha256 + # @return [::String] + # The SHA256 hash of the client state; that is, of the sorted list of all + # hashes present in the database. + class Checksum + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The type of response sent to the client. + module ResponseType + # Unknown. + RESPONSE_TYPE_UNSPECIFIED = 0 + + # Partial updates are applied to the client's existing local database. + DIFF = 1 + + # Full updates resets the client's entire local database. This means + # that either the client had no state, was seriously out-of-date, + # or the client is believed to be corrupt. + RESET = 2 + end + end + + # Request to check URI entries against threatLists. + # @!attribute [rw] uri + # @return [::String] + # Required. The URI to be checked for matches. + # @!attribute [rw] threat_types + # @return [::Array<::Google::Cloud::WebRisk::V1::ThreatType>] + # Required. The ThreatLists to search in. Multiple ThreatLists may be + # specified. + class SearchUrisRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] threat + # @return [::Google::Cloud::WebRisk::V1::SearchUrisResponse::ThreatUri] + # The threat list matches. This might be empty if the URI is on no list. + class SearchUrisResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Contains threat information on a matching uri. + # @!attribute [rw] threat_types + # @return [::Array<::Google::Cloud::WebRisk::V1::ThreatType>] + # The ThreatList this threat belongs to. + # @!attribute [rw] expire_time + # @return [::Google::Protobuf::Timestamp] + # The cache lifetime for the returned match. Clients must not cache this + # response past this timestamp to avoid false positives. + class ThreatUri + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Request to return full hashes matched by the provided hash prefixes. + # @!attribute [rw] hash_prefix + # @return [::String] + # A hash prefix, consisting of the most significant 4-32 bytes of a SHA256 + # hash. For JSON requests, this field is base64-encoded. + # Note that if this parameter is provided by a URI, it must be encoded using + # the web safe base64 variant (RFC 4648). + # @!attribute [rw] threat_types + # @return [::Array<::Google::Cloud::WebRisk::V1::ThreatType>] + # Required. The ThreatLists to search in. Multiple ThreatLists may be + # specified. + class SearchHashesRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] threats + # @return [::Array<::Google::Cloud::WebRisk::V1::SearchHashesResponse::ThreatHash>] + # The full hashes that matched the requested prefixes. + # The hash will be populated in the key. + # @!attribute [rw] negative_expire_time + # @return [::Google::Protobuf::Timestamp] + # For requested entities that did not match the threat list, how long to + # cache the response until. + class SearchHashesResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Contains threat information on a matching hash. + # @!attribute [rw] threat_types + # @return [::Array<::Google::Cloud::WebRisk::V1::ThreatType>] + # The ThreatList this threat belongs to. + # This must contain at least one entry. + # @!attribute [rw] hash + # @return [::String] + # A 32 byte SHA256 hash. This field is in binary format. For JSON + # requests, hashes are base64-encoded. + # @!attribute [rw] expire_time + # @return [::Google::Protobuf::Timestamp] + # The cache lifetime for the returned match. Clients must not cache this + # response past this timestamp to avoid false positives. + class ThreatHash + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Contains the set of entries to add to a local database. + # May contain a combination of compressed and raw data in a single response. + # @!attribute [rw] raw_hashes + # @return [::Array<::Google::Cloud::WebRisk::V1::RawHashes>] + # The raw SHA256-formatted entries. + # Repeated to allow returning sets of hashes with different prefix sizes. + # @!attribute [rw] rice_hashes + # @return [::Google::Cloud::WebRisk::V1::RiceDeltaEncoding] + # The encoded 4-byte prefixes of SHA256-formatted entries, using a + # Golomb-Rice encoding. The hashes are converted to uint32, sorted in + # ascending order, then delta encoded and stored as encoded_data. + class ThreatEntryAdditions + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Contains the set of entries to remove from a local database. + # @!attribute [rw] raw_indices + # @return [::Google::Cloud::WebRisk::V1::RawIndices] + # The raw removal indices for a local list. + # @!attribute [rw] rice_indices + # @return [::Google::Cloud::WebRisk::V1::RiceDeltaEncoding] + # The encoded local, lexicographically-sorted list indices, using a + # Golomb-Rice encoding. Used for sending compressed removal indices. The + # removal indices (uint32) are sorted in ascending order, then delta encoded + # and stored as encoded_data. + class ThreatEntryRemovals + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A set of raw indices to remove from a local list. + # @!attribute [rw] indices + # @return [::Array<::Integer>] + # The indices to remove from a lexicographically-sorted local list. + class RawIndices + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The uncompressed threat entries in hash format. + # Hashes can be anywhere from 4 to 32 bytes in size. A large majority are 4 + # bytes, but some hashes are lengthened if they collide with the hash of a + # popular URI. + # + # Used for sending ThreatEntryAdditons to clients that do not support + # compression, or when sending non-4-byte hashes to clients that do support + # compression. + # @!attribute [rw] prefix_size + # @return [::Integer] + # The number of bytes for each prefix encoded below. This field can be + # anywhere from 4 (shortest prefix) to 32 (full SHA256 hash). + # In practice this is almost always 4, except in exceptional circumstances. + # @!attribute [rw] raw_hashes + # @return [::String] + # The hashes, in binary format, concatenated into one long string. Hashes are + # sorted in lexicographic order. For JSON API users, hashes are + # base64-encoded. + class RawHashes + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The Rice-Golomb encoded data. Used for sending compressed 4-byte hashes or + # compressed removal indices. + # @!attribute [rw] first_value + # @return [::Integer] + # The offset of the first entry in the encoded data, or, if only a single + # integer was encoded, that single integer's value. If the field is empty or + # missing, assume zero. + # @!attribute [rw] rice_parameter + # @return [::Integer] + # The Golomb-Rice parameter, which is a number between 2 and 28. This field + # is missing (that is, zero) if `num_entries` is zero. + # @!attribute [rw] entry_count + # @return [::Integer] + # The number of entries that are delta encoded in the encoded data. If only a + # single integer was encoded, this will be zero and the single value will be + # stored in `first_value`. + # @!attribute [rw] encoded_data + # @return [::String] + # The encoded deltas that are encoded using the Golomb-Rice coder. + class RiceDeltaEncoding + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Wraps a URI that might be displaying malicious content. + # @!attribute [rw] uri + # @return [::String] + # Required. The URI that is being reported for malicious content to be + # analyzed. + # @!attribute [r] threat_types + # @return [::Array<::Google::Cloud::WebRisk::V1::ThreatType>] + # Output only. ThreatTypes found to be associated with the submitted URI + # after reviewing it. This might be empty if the URI was not added to any + # list. + class Submission + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Context about the submission including the type of abuse found on the URI and + # supporting details. + # @!attribute [rw] abuse_type + # @return [::Google::Cloud::WebRisk::V1::ThreatInfo::AbuseType] + # The type of abuse. + # @!attribute [rw] threat_confidence + # @return [::Google::Cloud::WebRisk::V1::ThreatInfo::Confidence] + # Confidence that the URI is unsafe. + # @!attribute [rw] threat_justification + # @return [::Google::Cloud::WebRisk::V1::ThreatInfo::ThreatJustification] + # Context about why the URI is unsafe. + class ThreatInfo + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Confidence that a URI is unsafe. + # @!attribute [rw] score + # @return [::Float] + # A decimal representation of confidence in the range of 0 + # to 1 where 0 indicates no confidence and 1 indicates + # complete confidence. + # + # Note: The following fields are mutually exclusive: `score`, `level`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] level + # @return [::Google::Cloud::WebRisk::V1::ThreatInfo::Confidence::ConfidenceLevel] + # Enum representation of confidence. + # + # Note: The following fields are mutually exclusive: `level`, `score`. If a field in that set is populated, all other fields in the set will automatically be cleared. + class Confidence + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Enum representation of confidence. + module ConfidenceLevel + # Default. + CONFIDENCE_LEVEL_UNSPECIFIED = 0 + + # Less than 60% confidence that the URI is unsafe. + LOW = 1 + + # Between 60% and 80% confidence that the URI is unsafe. + MEDIUM = 2 + + # Greater than 80% confidence that the URI is unsafe. + HIGH = 3 + end + end + + # Context about why the URI is unsafe. + # @!attribute [rw] labels + # @return [::Array<::Google::Cloud::WebRisk::V1::ThreatInfo::ThreatJustification::JustificationLabel>] + # Labels associated with this URI that explain how it was classified. + # @!attribute [rw] comments + # @return [::Array<::String>] + # Free-form context on why this URI is unsafe. + class ThreatJustification + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Labels that explain how the URI was classified. + module JustificationLabel + # Default. + JUSTIFICATION_LABEL_UNSPECIFIED = 0 + + # The submitter manually verified that the submission is unsafe. + MANUAL_VERIFICATION = 1 + + # The submitter received the submission from an end user. + USER_REPORT = 2 + + # The submitter received the submission from an automated system. + AUTOMATED_REPORT = 3 + end + end + + # The abuse type found on the URI. + module AbuseType + # Default. + ABUSE_TYPE_UNSPECIFIED = 0 + + # The URI contains malware. + MALWARE = 1 + + # The URI contains social engineering. + SOCIAL_ENGINEERING = 2 + + # The URI contains unwanted software. + UNWANTED_SOFTWARE = 3 + end + end + + # Details about how the threat was discovered. + # @!attribute [rw] platform + # @return [::Google::Cloud::WebRisk::V1::ThreatDiscovery::Platform] + # Platform on which the threat was discovered. + # @!attribute [rw] region_codes + # @return [::Array<::String>] + # CLDR region code of the countries/regions the URI poses a threat ordered + # from most impact to least impact. Example: "US" for United States. + class ThreatDiscovery + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Platform types. + module Platform + # Default. + PLATFORM_UNSPECIFIED = 0 + + # General Android platform. + ANDROID = 1 + + # General iOS platform. + IOS = 2 + + # General macOS platform. + MACOS = 3 + + # General Windows platform. + WINDOWS = 4 + end + end + + # Request to send a potentially phishy URI to WebRisk. + # @!attribute [rw] parent + # @return [::String] + # Required. The name of the project that is making the submission. This + # string is in the format "projects/\\{project_number}". + # @!attribute [rw] submission + # @return [::Google::Cloud::WebRisk::V1::Submission] + # Required. The submission that contains the content of the phishing report. + class CreateSubmissionRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request to send a potentially malicious URI to WebRisk. + # @!attribute [rw] parent + # @return [::String] + # Required. The name of the project that is making the submission. This + # string is in the format "projects/\\{project_number}". + # @!attribute [rw] submission + # @return [::Google::Cloud::WebRisk::V1::Submission] + # Required. The submission that contains the URI to be scanned. + # @!attribute [rw] threat_info + # @return [::Google::Cloud::WebRisk::V1::ThreatInfo] + # Provides additional information about the submission. + # @!attribute [rw] threat_discovery + # @return [::Google::Cloud::WebRisk::V1::ThreatDiscovery] + # Provides additional information about how the submission was discovered. + class SubmitUriRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Metadata for the Submit URI long-running operation. + # @!attribute [rw] state + # @return [::Google::Cloud::WebRisk::V1::SubmitUriMetadata::State] + # The state of the operation. + # @!attribute [rw] create_time + # @return [::Google::Protobuf::Timestamp] + # Creation time of the operation. + # @!attribute [rw] update_time + # @return [::Google::Protobuf::Timestamp] + # Latest update time of the operation. + class SubmitUriMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Enum that represents the state of the long-running operation. + module State + # Default unspecified state. + STATE_UNSPECIFIED = 0 + + # The operation is currently running. + RUNNING = 1 + + # The operation finished with a success status. + SUCCEEDED = 2 + + # The operation was cancelled. + CANCELLED = 3 + + # The operation finished with a failure status. + FAILED = 4 + + # The operation was closed with no action taken. + CLOSED = 5 + end + end + + # The type of threat. This maps directly to the threat list a threat may + # belong to. + module ThreatType + # No entries should match this threat type. This threat type is unused. + THREAT_TYPE_UNSPECIFIED = 0 + + # Malware targeting any platform. + MALWARE = 1 + + # Social engineering targeting any platform. + SOCIAL_ENGINEERING = 2 + + # Unwanted software targeting any platform. + UNWANTED_SOFTWARE = 3 + + # A list of extended coverage social engineering URIs targeting any + # platform. + SOCIAL_ENGINEERING_EXTENDED_COVERAGE = 4 + end + + # The ways in which threat entry sets can be compressed. + module CompressionType + # Unknown. + COMPRESSION_TYPE_UNSPECIFIED = 0 + + # Raw, uncompressed data. + RAW = 1 + + # Rice-Golomb encoded data. + RICE = 2 + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-web_risk-v1/proto_docs/google/longrunning/operations.rb b/owl-bot-staging/google-cloud-web_risk-v1/proto_docs/google/longrunning/operations.rb new file mode 100644 index 000000000000..7a757f512165 --- /dev/null +++ b/owl-bot-staging/google-cloud-web_risk-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-web_risk-v1/proto_docs/google/protobuf/any.rb b/owl-bot-staging/google-cloud-web_risk-v1/proto_docs/google/protobuf/any.rb new file mode 100644 index 000000000000..58691995f02e --- /dev/null +++ b/owl-bot-staging/google-cloud-web_risk-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-web_risk-v1/proto_docs/google/protobuf/duration.rb b/owl-bot-staging/google-cloud-web_risk-v1/proto_docs/google/protobuf/duration.rb new file mode 100644 index 000000000000..ea59f1f91daf --- /dev/null +++ b/owl-bot-staging/google-cloud-web_risk-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-web_risk-v1/proto_docs/google/protobuf/empty.rb b/owl-bot-staging/google-cloud-web_risk-v1/proto_docs/google/protobuf/empty.rb new file mode 100644 index 000000000000..83e4481834a6 --- /dev/null +++ b/owl-bot-staging/google-cloud-web_risk-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-web_risk-v1/proto_docs/google/protobuf/timestamp.rb b/owl-bot-staging/google-cloud-web_risk-v1/proto_docs/google/protobuf/timestamp.rb new file mode 100644 index 000000000000..74352be9c58c --- /dev/null +++ b/owl-bot-staging/google-cloud-web_risk-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-web_risk-v1/proto_docs/google/rpc/status.rb b/owl-bot-staging/google-cloud-web_risk-v1/proto_docs/google/rpc/status.rb new file mode 100644 index 000000000000..c1a1c07eb2db --- /dev/null +++ b/owl-bot-staging/google-cloud-web_risk-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-web_risk-v1/snippets/Gemfile b/owl-bot-staging/google-cloud-web_risk-v1/snippets/Gemfile new file mode 100644 index 000000000000..6a085ad32072 --- /dev/null +++ b/owl-bot-staging/google-cloud-web_risk-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-web_risk-v1", path: "../" +else + gem "google-cloud-web_risk-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-web_risk-v1/snippets/snippet_metadata_google.cloud.webrisk.v1.json b/owl-bot-staging/google-cloud-web_risk-v1/snippets/snippet_metadata_google.cloud.webrisk.v1.json new file mode 100644 index 000000000000..b80bf1f12e06 --- /dev/null +++ b/owl-bot-staging/google-cloud-web_risk-v1/snippets/snippet_metadata_google.cloud.webrisk.v1.json @@ -0,0 +1,215 @@ +{ + "client_library": { + "name": "google-cloud-web_risk-v1", + "version": "", + "language": "RUBY", + "apis": [ + { + "id": "google.cloud.webrisk.v1", + "version": "v1" + } + ] + }, + "snippets": [ + { + "region_tag": "webrisk_v1_generated_WebRiskService_ComputeThreatListDiff_sync", + "title": "Snippet for the compute_threat_list_diff call in the WebRiskService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::WebRisk::V1::WebRiskService::Client#compute_threat_list_diff.", + "file": "web_risk_service/compute_threat_list_diff.rb", + "language": "RUBY", + "client_method": { + "short_name": "compute_threat_list_diff", + "full_name": "::Google::Cloud::WebRisk::V1::WebRiskService::Client#compute_threat_list_diff", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::WebRisk::V1::ComputeThreatListDiffRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::WebRisk::V1::ComputeThreatListDiffResponse", + "client": { + "short_name": "WebRiskService::Client", + "full_name": "::Google::Cloud::WebRisk::V1::WebRiskService::Client" + }, + "method": { + "short_name": "ComputeThreatListDiff", + "full_name": "google.cloud.webrisk.v1.WebRiskService.ComputeThreatListDiff", + "service": { + "short_name": "WebRiskService", + "full_name": "google.cloud.webrisk.v1.WebRiskService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "webrisk_v1_generated_WebRiskService_SearchUris_sync", + "title": "Snippet for the search_uris call in the WebRiskService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::WebRisk::V1::WebRiskService::Client#search_uris.", + "file": "web_risk_service/search_uris.rb", + "language": "RUBY", + "client_method": { + "short_name": "search_uris", + "full_name": "::Google::Cloud::WebRisk::V1::WebRiskService::Client#search_uris", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::WebRisk::V1::SearchUrisRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::WebRisk::V1::SearchUrisResponse", + "client": { + "short_name": "WebRiskService::Client", + "full_name": "::Google::Cloud::WebRisk::V1::WebRiskService::Client" + }, + "method": { + "short_name": "SearchUris", + "full_name": "google.cloud.webrisk.v1.WebRiskService.SearchUris", + "service": { + "short_name": "WebRiskService", + "full_name": "google.cloud.webrisk.v1.WebRiskService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "webrisk_v1_generated_WebRiskService_SearchHashes_sync", + "title": "Snippet for the search_hashes call in the WebRiskService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::WebRisk::V1::WebRiskService::Client#search_hashes.", + "file": "web_risk_service/search_hashes.rb", + "language": "RUBY", + "client_method": { + "short_name": "search_hashes", + "full_name": "::Google::Cloud::WebRisk::V1::WebRiskService::Client#search_hashes", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::WebRisk::V1::SearchHashesRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::WebRisk::V1::SearchHashesResponse", + "client": { + "short_name": "WebRiskService::Client", + "full_name": "::Google::Cloud::WebRisk::V1::WebRiskService::Client" + }, + "method": { + "short_name": "SearchHashes", + "full_name": "google.cloud.webrisk.v1.WebRiskService.SearchHashes", + "service": { + "short_name": "WebRiskService", + "full_name": "google.cloud.webrisk.v1.WebRiskService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "webrisk_v1_generated_WebRiskService_CreateSubmission_sync", + "title": "Snippet for the create_submission call in the WebRiskService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::WebRisk::V1::WebRiskService::Client#create_submission.", + "file": "web_risk_service/create_submission.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_submission", + "full_name": "::Google::Cloud::WebRisk::V1::WebRiskService::Client#create_submission", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::WebRisk::V1::CreateSubmissionRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::WebRisk::V1::Submission", + "client": { + "short_name": "WebRiskService::Client", + "full_name": "::Google::Cloud::WebRisk::V1::WebRiskService::Client" + }, + "method": { + "short_name": "CreateSubmission", + "full_name": "google.cloud.webrisk.v1.WebRiskService.CreateSubmission", + "service": { + "short_name": "WebRiskService", + "full_name": "google.cloud.webrisk.v1.WebRiskService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "webrisk_v1_generated_WebRiskService_SubmitUri_sync", + "title": "Snippet for the submit_uri call in the WebRiskService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::WebRisk::V1::WebRiskService::Client#submit_uri.", + "file": "web_risk_service/submit_uri.rb", + "language": "RUBY", + "client_method": { + "short_name": "submit_uri", + "full_name": "::Google::Cloud::WebRisk::V1::WebRiskService::Client#submit_uri", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::WebRisk::V1::SubmitUriRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "WebRiskService::Client", + "full_name": "::Google::Cloud::WebRisk::V1::WebRiskService::Client" + }, + "method": { + "short_name": "SubmitUri", + "full_name": "google.cloud.webrisk.v1.WebRiskService.SubmitUri", + "service": { + "short_name": "WebRiskService", + "full_name": "google.cloud.webrisk.v1.WebRiskService" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + } + ] +} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-web_risk-v1/snippets/web_risk_service/compute_threat_list_diff.rb b/owl-bot-staging/google-cloud-web_risk-v1/snippets/web_risk_service/compute_threat_list_diff.rb new file mode 100644 index 000000000000..7f5a53f82d9a --- /dev/null +++ b/owl-bot-staging/google-cloud-web_risk-v1/snippets/web_risk_service/compute_threat_list_diff.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 webrisk_v1_generated_WebRiskService_ComputeThreatListDiff_sync] +require "google/cloud/web_risk/v1" + +## +# Snippet for the compute_threat_list_diff call in the WebRiskService 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::WebRisk::V1::WebRiskService::Client#compute_threat_list_diff. +# +def compute_threat_list_diff + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::WebRisk::V1::WebRiskService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::WebRisk::V1::ComputeThreatListDiffRequest.new + + # Call the compute_threat_list_diff method. + result = client.compute_threat_list_diff request + + # The returned object is of type Google::Cloud::WebRisk::V1::ComputeThreatListDiffResponse. + p result +end +# [END webrisk_v1_generated_WebRiskService_ComputeThreatListDiff_sync] diff --git a/owl-bot-staging/google-cloud-web_risk-v1/snippets/web_risk_service/create_submission.rb b/owl-bot-staging/google-cloud-web_risk-v1/snippets/web_risk_service/create_submission.rb new file mode 100644 index 000000000000..df7d3813ecdc --- /dev/null +++ b/owl-bot-staging/google-cloud-web_risk-v1/snippets/web_risk_service/create_submission.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 webrisk_v1_generated_WebRiskService_CreateSubmission_sync] +require "google/cloud/web_risk/v1" + +## +# Snippet for the create_submission call in the WebRiskService 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::WebRisk::V1::WebRiskService::Client#create_submission. +# +def create_submission + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::WebRisk::V1::WebRiskService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::WebRisk::V1::CreateSubmissionRequest.new + + # Call the create_submission method. + result = client.create_submission request + + # The returned object is of type Google::Cloud::WebRisk::V1::Submission. + p result +end +# [END webrisk_v1_generated_WebRiskService_CreateSubmission_sync] diff --git a/owl-bot-staging/google-cloud-web_risk-v1/snippets/web_risk_service/search_hashes.rb b/owl-bot-staging/google-cloud-web_risk-v1/snippets/web_risk_service/search_hashes.rb new file mode 100644 index 000000000000..dd666b618ada --- /dev/null +++ b/owl-bot-staging/google-cloud-web_risk-v1/snippets/web_risk_service/search_hashes.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 webrisk_v1_generated_WebRiskService_SearchHashes_sync] +require "google/cloud/web_risk/v1" + +## +# Snippet for the search_hashes call in the WebRiskService 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::WebRisk::V1::WebRiskService::Client#search_hashes. +# +def search_hashes + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::WebRisk::V1::WebRiskService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::WebRisk::V1::SearchHashesRequest.new + + # Call the search_hashes method. + result = client.search_hashes request + + # The returned object is of type Google::Cloud::WebRisk::V1::SearchHashesResponse. + p result +end +# [END webrisk_v1_generated_WebRiskService_SearchHashes_sync] diff --git a/owl-bot-staging/google-cloud-web_risk-v1/snippets/web_risk_service/search_uris.rb b/owl-bot-staging/google-cloud-web_risk-v1/snippets/web_risk_service/search_uris.rb new file mode 100644 index 000000000000..f9689a938b35 --- /dev/null +++ b/owl-bot-staging/google-cloud-web_risk-v1/snippets/web_risk_service/search_uris.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 webrisk_v1_generated_WebRiskService_SearchUris_sync] +require "google/cloud/web_risk/v1" + +## +# Snippet for the search_uris call in the WebRiskService 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::WebRisk::V1::WebRiskService::Client#search_uris. +# +def search_uris + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::WebRisk::V1::WebRiskService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::WebRisk::V1::SearchUrisRequest.new + + # Call the search_uris method. + result = client.search_uris request + + # The returned object is of type Google::Cloud::WebRisk::V1::SearchUrisResponse. + p result +end +# [END webrisk_v1_generated_WebRiskService_SearchUris_sync] diff --git a/owl-bot-staging/google-cloud-web_risk-v1/snippets/web_risk_service/submit_uri.rb b/owl-bot-staging/google-cloud-web_risk-v1/snippets/web_risk_service/submit_uri.rb new file mode 100644 index 000000000000..e9576276d743 --- /dev/null +++ b/owl-bot-staging/google-cloud-web_risk-v1/snippets/web_risk_service/submit_uri.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 webrisk_v1_generated_WebRiskService_SubmitUri_sync] +require "google/cloud/web_risk/v1" + +## +# Snippet for the submit_uri call in the WebRiskService 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::WebRisk::V1::WebRiskService::Client#submit_uri. +# +def submit_uri + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::WebRisk::V1::WebRiskService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::WebRisk::V1::SubmitUriRequest.new + + # Call the submit_uri method. + result = client.submit_uri 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 webrisk_v1_generated_WebRiskService_SubmitUri_sync] diff --git a/owl-bot-staging/google-cloud-web_risk-v1/test/google/cloud/web_risk/v1/web_risk_service_operations_test.rb b/owl-bot-staging/google-cloud-web_risk-v1/test/google/cloud/web_risk/v1/web_risk_service_operations_test.rb new file mode 100644 index 000000000000..2dbc348b4d90 --- /dev/null +++ b/owl-bot-staging/google-cloud-web_risk-v1/test/google/cloud/web_risk/v1/web_risk_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/webrisk/v1/webrisk_pb" +require "google/cloud/webrisk/v1/webrisk_services_pb" +require "google/cloud/web_risk/v1/web_risk_service" + +class ::Google::Cloud::WebRisk::V1::WebRiskService::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::WebRisk::V1::WebRiskService::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::WebRisk::V1::WebRiskService::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::WebRisk::V1::WebRiskService::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::WebRisk::V1::WebRiskService::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::WebRisk::V1::WebRiskService::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::WebRisk::V1::WebRiskService::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::WebRisk::V1::WebRiskService::Operations::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-web_risk-v1/test/google/cloud/web_risk/v1/web_risk_service_paths_test.rb b/owl-bot-staging/google-cloud-web_risk-v1/test/google/cloud/web_risk/v1/web_risk_service_paths_test.rb new file mode 100644 index 000000000000..4611e7b7e506 --- /dev/null +++ b/owl-bot-staging/google-cloud-web_risk-v1/test/google/cloud/web_risk/v1/web_risk_service_paths_test.rb @@ -0,0 +1,55 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/web_risk/v1/web_risk_service" + +class ::Google::Cloud::WebRisk::V1::WebRiskService::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_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::WebRisk::V1::WebRiskService::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-web_risk-v1/test/google/cloud/web_risk/v1/web_risk_service_rest_test.rb b/owl-bot-staging/google-cloud-web_risk-v1/test/google/cloud/web_risk/v1/web_risk_service_rest_test.rb new file mode 100644 index 000000000000..a4b46ebc0c22 --- /dev/null +++ b/owl-bot-staging/google-cloud-web_risk-v1/test/google/cloud/web_risk/v1/web_risk_service_rest_test.rb @@ -0,0 +1,377 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/webrisk/v1/webrisk_pb" +require "google/cloud/web_risk/v1/web_risk_service/rest" + + +class ::Google::Cloud::WebRisk::V1::WebRiskService::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_compute_threat_list_diff + # Create test objects. + client_result = ::Google::Cloud::WebRisk::V1::ComputeThreatListDiffResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + threat_type = :THREAT_TYPE_UNSPECIFIED + version_token = "hello world" + constraints = {} + + compute_threat_list_diff_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::WebRisk::V1::WebRiskService::Rest::ServiceStub.stub :transcode_compute_threat_list_diff_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, compute_threat_list_diff_client_stub do + # Create client + client = ::Google::Cloud::WebRisk::V1::WebRiskService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.compute_threat_list_diff({ threat_type: threat_type, version_token: version_token, constraints: constraints }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.compute_threat_list_diff threat_type: threat_type, version_token: version_token, constraints: constraints do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.compute_threat_list_diff ::Google::Cloud::WebRisk::V1::ComputeThreatListDiffRequest.new(threat_type: threat_type, version_token: version_token, constraints: constraints) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.compute_threat_list_diff({ threat_type: threat_type, version_token: version_token, constraints: constraints }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.compute_threat_list_diff(::Google::Cloud::WebRisk::V1::ComputeThreatListDiffRequest.new(threat_type: threat_type, version_token: version_token, constraints: constraints), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, compute_threat_list_diff_client_stub.call_count + end + end + end + + def test_search_uris + # Create test objects. + client_result = ::Google::Cloud::WebRisk::V1::SearchUrisResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + uri = "hello world" + threat_types = [:THREAT_TYPE_UNSPECIFIED] + + search_uris_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::WebRisk::V1::WebRiskService::Rest::ServiceStub.stub :transcode_search_uris_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, search_uris_client_stub do + # Create client + client = ::Google::Cloud::WebRisk::V1::WebRiskService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.search_uris({ uri: uri, threat_types: threat_types }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.search_uris uri: uri, threat_types: threat_types do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.search_uris ::Google::Cloud::WebRisk::V1::SearchUrisRequest.new(uri: uri, threat_types: threat_types) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.search_uris({ uri: uri, threat_types: threat_types }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.search_uris(::Google::Cloud::WebRisk::V1::SearchUrisRequest.new(uri: uri, threat_types: threat_types), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, search_uris_client_stub.call_count + end + end + end + + def test_search_hashes + # Create test objects. + client_result = ::Google::Cloud::WebRisk::V1::SearchHashesResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + hash_prefix = "hello world" + threat_types = [:THREAT_TYPE_UNSPECIFIED] + + search_hashes_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::WebRisk::V1::WebRiskService::Rest::ServiceStub.stub :transcode_search_hashes_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, search_hashes_client_stub do + # Create client + client = ::Google::Cloud::WebRisk::V1::WebRiskService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.search_hashes({ hash_prefix: hash_prefix, threat_types: threat_types }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.search_hashes hash_prefix: hash_prefix, threat_types: threat_types do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.search_hashes ::Google::Cloud::WebRisk::V1::SearchHashesRequest.new(hash_prefix: hash_prefix, threat_types: threat_types) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.search_hashes({ hash_prefix: hash_prefix, threat_types: threat_types }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.search_hashes(::Google::Cloud::WebRisk::V1::SearchHashesRequest.new(hash_prefix: hash_prefix, threat_types: threat_types), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, search_hashes_client_stub.call_count + end + end + end + + def test_create_submission + # Create test objects. + client_result = ::Google::Cloud::WebRisk::V1::Submission.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + submission = {} + + create_submission_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::WebRisk::V1::WebRiskService::Rest::ServiceStub.stub :transcode_create_submission_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_submission_client_stub do + # Create client + client = ::Google::Cloud::WebRisk::V1::WebRiskService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_submission({ parent: parent, submission: submission }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_submission parent: parent, submission: submission do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_submission ::Google::Cloud::WebRisk::V1::CreateSubmissionRequest.new(parent: parent, submission: submission) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_submission({ parent: parent, submission: submission }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_submission(::Google::Cloud::WebRisk::V1::CreateSubmissionRequest.new(parent: parent, submission: submission), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_submission_client_stub.call_count + end + end + end + + def test_submit_uri + # 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" + submission = {} + threat_info = {} + threat_discovery = {} + + submit_uri_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::WebRisk::V1::WebRiskService::Rest::ServiceStub.stub :transcode_submit_uri_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, submit_uri_client_stub do + # Create client + client = ::Google::Cloud::WebRisk::V1::WebRiskService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.submit_uri({ parent: parent, submission: submission, threat_info: threat_info, threat_discovery: threat_discovery }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.submit_uri parent: parent, submission: submission, threat_info: threat_info, threat_discovery: threat_discovery do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.submit_uri ::Google::Cloud::WebRisk::V1::SubmitUriRequest.new(parent: parent, submission: submission, threat_info: threat_info, threat_discovery: threat_discovery) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.submit_uri({ parent: parent, submission: submission, threat_info: threat_info, threat_discovery: threat_discovery }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.submit_uri(::Google::Cloud::WebRisk::V1::SubmitUriRequest.new(parent: parent, submission: submission, threat_info: threat_info, threat_discovery: threat_discovery), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, submit_uri_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::WebRisk::V1::WebRiskService::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::WebRisk::V1::WebRiskService::Rest::Client::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-web_risk-v1/test/google/cloud/web_risk/v1/web_risk_service_test.rb b/owl-bot-staging/google-cloud-web_risk-v1/test/google/cloud/web_risk/v1/web_risk_service_test.rb new file mode 100644 index 000000000000..1d3301dd6810 --- /dev/null +++ b/owl-bot-staging/google-cloud-web_risk-v1/test/google/cloud/web_risk/v1/web_risk_service_test.rb @@ -0,0 +1,429 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/webrisk/v1/webrisk_pb" +require "google/cloud/web_risk/v1/web_risk_service" + +class ::Google::Cloud::WebRisk::V1::WebRiskService::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_compute_threat_list_diff + # Create GRPC objects. + grpc_response = ::Google::Cloud::WebRisk::V1::ComputeThreatListDiffResponse.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. + threat_type = :THREAT_TYPE_UNSPECIFIED + version_token = "hello world" + constraints = {} + + compute_threat_list_diff_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :compute_threat_list_diff, name + assert_kind_of ::Google::Cloud::WebRisk::V1::ComputeThreatListDiffRequest, request + assert_equal :THREAT_TYPE_UNSPECIFIED, request["threat_type"] + assert_equal "hello world", request["version_token"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::WebRisk::V1::ComputeThreatListDiffRequest::Constraints), request["constraints"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, compute_threat_list_diff_client_stub do + # Create client + client = ::Google::Cloud::WebRisk::V1::WebRiskService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.compute_threat_list_diff({ threat_type: threat_type, version_token: version_token, constraints: constraints }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.compute_threat_list_diff threat_type: threat_type, version_token: version_token, constraints: constraints do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.compute_threat_list_diff ::Google::Cloud::WebRisk::V1::ComputeThreatListDiffRequest.new(threat_type: threat_type, version_token: version_token, constraints: constraints) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.compute_threat_list_diff({ threat_type: threat_type, version_token: version_token, constraints: constraints }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.compute_threat_list_diff(::Google::Cloud::WebRisk::V1::ComputeThreatListDiffRequest.new(threat_type: threat_type, version_token: version_token, constraints: constraints), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, compute_threat_list_diff_client_stub.call_rpc_count + end + end + + def test_search_uris + # Create GRPC objects. + grpc_response = ::Google::Cloud::WebRisk::V1::SearchUrisResponse.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. + uri = "hello world" + threat_types = [:THREAT_TYPE_UNSPECIFIED] + + search_uris_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :search_uris, name + assert_kind_of ::Google::Cloud::WebRisk::V1::SearchUrisRequest, request + assert_equal "hello world", request["uri"] + assert_equal [:THREAT_TYPE_UNSPECIFIED], request["threat_types"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, search_uris_client_stub do + # Create client + client = ::Google::Cloud::WebRisk::V1::WebRiskService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.search_uris({ uri: uri, threat_types: threat_types }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.search_uris uri: uri, threat_types: threat_types do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.search_uris ::Google::Cloud::WebRisk::V1::SearchUrisRequest.new(uri: uri, threat_types: threat_types) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.search_uris({ uri: uri, threat_types: threat_types }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.search_uris(::Google::Cloud::WebRisk::V1::SearchUrisRequest.new(uri: uri, threat_types: threat_types), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, search_uris_client_stub.call_rpc_count + end + end + + def test_search_hashes + # Create GRPC objects. + grpc_response = ::Google::Cloud::WebRisk::V1::SearchHashesResponse.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. + hash_prefix = "hello world" + threat_types = [:THREAT_TYPE_UNSPECIFIED] + + search_hashes_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :search_hashes, name + assert_kind_of ::Google::Cloud::WebRisk::V1::SearchHashesRequest, request + assert_equal "hello world", request["hash_prefix"] + assert_equal [:THREAT_TYPE_UNSPECIFIED], request["threat_types"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, search_hashes_client_stub do + # Create client + client = ::Google::Cloud::WebRisk::V1::WebRiskService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.search_hashes({ hash_prefix: hash_prefix, threat_types: threat_types }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.search_hashes hash_prefix: hash_prefix, threat_types: threat_types do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.search_hashes ::Google::Cloud::WebRisk::V1::SearchHashesRequest.new(hash_prefix: hash_prefix, threat_types: threat_types) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.search_hashes({ hash_prefix: hash_prefix, threat_types: threat_types }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.search_hashes(::Google::Cloud::WebRisk::V1::SearchHashesRequest.new(hash_prefix: hash_prefix, threat_types: threat_types), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, search_hashes_client_stub.call_rpc_count + end + end + + def test_create_submission + # Create GRPC objects. + grpc_response = ::Google::Cloud::WebRisk::V1::Submission.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" + submission = {} + + create_submission_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_submission, name + assert_kind_of ::Google::Cloud::WebRisk::V1::CreateSubmissionRequest, request + assert_equal "hello world", request["parent"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::WebRisk::V1::Submission), request["submission"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_submission_client_stub do + # Create client + client = ::Google::Cloud::WebRisk::V1::WebRiskService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_submission({ parent: parent, submission: submission }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.create_submission parent: parent, submission: submission do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.create_submission ::Google::Cloud::WebRisk::V1::CreateSubmissionRequest.new(parent: parent, submission: submission) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.create_submission({ parent: parent, submission: submission }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.create_submission(::Google::Cloud::WebRisk::V1::CreateSubmissionRequest.new(parent: parent, submission: submission), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, create_submission_client_stub.call_rpc_count + end + end + + def test_submit_uri + # 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" + submission = {} + threat_info = {} + threat_discovery = {} + + submit_uri_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :submit_uri, name + assert_kind_of ::Google::Cloud::WebRisk::V1::SubmitUriRequest, request + assert_equal "hello world", request["parent"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::WebRisk::V1::Submission), request["submission"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::WebRisk::V1::ThreatInfo), request["threat_info"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::WebRisk::V1::ThreatDiscovery), request["threat_discovery"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, submit_uri_client_stub do + # Create client + client = ::Google::Cloud::WebRisk::V1::WebRiskService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.submit_uri({ parent: parent, submission: submission, threat_info: threat_info, threat_discovery: threat_discovery }) 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.submit_uri parent: parent, submission: submission, threat_info: threat_info, threat_discovery: threat_discovery 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.submit_uri ::Google::Cloud::WebRisk::V1::SubmitUriRequest.new(parent: parent, submission: submission, threat_info: threat_info, threat_discovery: threat_discovery) 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.submit_uri({ parent: parent, submission: submission, threat_info: threat_info, threat_discovery: threat_discovery }, 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.submit_uri(::Google::Cloud::WebRisk::V1::SubmitUriRequest.new(parent: parent, submission: submission, threat_info: threat_info, threat_discovery: threat_discovery), 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, submit_uri_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::WebRisk::V1::WebRiskService::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::WebRisk::V1::WebRiskService::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::WebRisk::V1::WebRiskService::Client.new do |config| + config.credentials = creds + end + assert_kind_of ::Google::Cloud::WebRisk::V1::WebRiskService::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::WebRisk::V1::WebRiskService::Client.new do |config| + config.credentials = grpc_channel + end + end + + assert_kind_of ::Google::Cloud::WebRisk::V1::WebRiskService::Operations, client.operations_client + end +end diff --git a/owl-bot-staging/google-cloud-web_risk-v1/test/helper.rb b/owl-bot-staging/google-cloud-web_risk-v1/test/helper.rb new file mode 100644 index 000000000000..672b337030e7 --- /dev/null +++ b/owl-bot-staging/google-cloud-web_risk-v1/test/helper.rb @@ -0,0 +1,26 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/mock" +require "minitest/rg" + +require "grpc" + +require "ostruct" diff --git a/owl-bot-staging/google-cloud-web_risk-v1beta1/.gitignore b/owl-bot-staging/google-cloud-web_risk-v1beta1/.gitignore new file mode 100644 index 000000000000..0135b6bc6cfc --- /dev/null +++ b/owl-bot-staging/google-cloud-web_risk-v1beta1/.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-web_risk-v1beta1/.repo-metadata.json b/owl-bot-staging/google-cloud-web_risk-v1beta1/.repo-metadata.json new file mode 100644 index 000000000000..fe30af6aa1ab --- /dev/null +++ b/owl-bot-staging/google-cloud-web_risk-v1beta1/.repo-metadata.json @@ -0,0 +1,19 @@ +{ + "api_id": "webrisk.googleapis.com", + "api_shortname": "webrisk", + "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-web_risk-v1beta1/latest", + "distribution_name": "google-cloud-web_risk-v1beta1", + "is_cloud": true, + "language": "ruby", + "name": "webrisk", + "name_pretty": "Web Risk V1beta1 API", + "product_documentation": "https://cloud.google.com/web-risk", + "release_level": "unreleased", + "repo": "googleapis/google-cloud-ruby", + "requires_billing": true, + "ruby-cloud-description": "Web Risk is an enterprise security product that lets your client applications check URLs against Google's constantly updated lists of unsafe web resources. Note that google-cloud-web_risk-v1beta1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-web_risk instead. See the readme for more details.", + "ruby-cloud-env-prefix": "WEBRISK", + "ruby-cloud-product-url": "https://cloud.google.com/web-risk", + "ruby-cloud-service-override": "WebRiskServiceV1Beta1=WebRiskService", + "library_type": "GAPIC_AUTO" +} diff --git a/owl-bot-staging/google-cloud-web_risk-v1beta1/.rubocop.yml b/owl-bot-staging/google-cloud-web_risk-v1beta1/.rubocop.yml new file mode 100644 index 000000000000..259ed15aa523 --- /dev/null +++ b/owl-bot-staging/google-cloud-web_risk-v1beta1/.rubocop.yml @@ -0,0 +1,33 @@ +inherit_gem: + google-style: google-style.yml + +AllCops: + Exclude: + - "google-cloud-web_risk-v1beta1.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-web_risk-v1beta1.rb" diff --git a/owl-bot-staging/google-cloud-web_risk-v1beta1/.toys.rb b/owl-bot-staging/google-cloud-web_risk-v1beta1/.toys.rb new file mode 100644 index 000000000000..177e22456e8a --- /dev/null +++ b/owl-bot-staging/google-cloud-web_risk-v1beta1/.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-web_risk-v1beta1/.yardopts b/owl-bot-staging/google-cloud-web_risk-v1beta1/.yardopts new file mode 100644 index 000000000000..70af59b70236 --- /dev/null +++ b/owl-bot-staging/google-cloud-web_risk-v1beta1/.yardopts @@ -0,0 +1,12 @@ +--no-private +--title="Web Risk V1beta1 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-web_risk-v1beta1/AUTHENTICATION.md b/owl-bot-staging/google-cloud-web_risk-v1beta1/AUTHENTICATION.md new file mode 100644 index 000000000000..402db6205842 --- /dev/null +++ b/owl-bot-staging/google-cloud-web_risk-v1beta1/AUTHENTICATION.md @@ -0,0 +1,122 @@ +# Authentication + +The recommended way to authenticate to the google-cloud-web_risk-v1beta1 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-web_risk-v1beta1 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/web_risk/v1beta1" + +client = ::Google::Cloud::WebRisk::V1beta1::WebRiskService::Client.new do |config| + config.credentials = "path/to/credentialfile.json" +end +``` + +To configure a credentials file globally for all clients: + +```ruby +require "google/cloud/web_risk/v1beta1" + +::Google::Cloud::WebRisk::V1beta1::WebRiskService::Client.configure do |config| + config.credentials = "path/to/credentialfile.json" +end + +client = ::Google::Cloud::WebRisk::V1beta1::WebRiskService::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-web_risk-v1beta1 +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/web_risk/v1beta1" + +ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" + +client = ::Google::Cloud::WebRisk::V1beta1::WebRiskService::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-web_risk-v1beta1/CHANGELOG.md b/owl-bot-staging/google-cloud-web_risk-v1beta1/CHANGELOG.md new file mode 100644 index 000000000000..f88957a62ba2 --- /dev/null +++ b/owl-bot-staging/google-cloud-web_risk-v1beta1/CHANGELOG.md @@ -0,0 +1,2 @@ +# Release History + diff --git a/owl-bot-staging/google-cloud-web_risk-v1beta1/Gemfile b/owl-bot-staging/google-cloud-web_risk-v1beta1/Gemfile new file mode 100644 index 000000000000..1d08558908d8 --- /dev/null +++ b/owl-bot-staging/google-cloud-web_risk-v1beta1/Gemfile @@ -0,0 +1,14 @@ +source "https://rubygems.org" + +gemspec + +gem "google-style", "~> 1.32.0" +gem "irb", "~> 1.17" +gem "minitest", "~> 6.0.2" +gem "minitest-focus", "~> 1.4" +gem "minitest-mock", "~> 5.27" +gem "minitest-rg", "~> 5.3" +gem "ostruct", "~> 0.5.5" +gem "rake", ">= 13.0" +gem "redcarpet", "~> 3.6" +gem "yard", "~> 0.9" diff --git a/owl-bot-staging/google-cloud-web_risk-v1beta1/LICENSE.md b/owl-bot-staging/google-cloud-web_risk-v1beta1/LICENSE.md new file mode 100644 index 000000000000..c261857ba6ad --- /dev/null +++ b/owl-bot-staging/google-cloud-web_risk-v1beta1/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-web_risk-v1beta1/README.md b/owl-bot-staging/google-cloud-web_risk-v1beta1/README.md new file mode 100644 index 000000000000..523339a7d4ad --- /dev/null +++ b/owl-bot-staging/google-cloud-web_risk-v1beta1/README.md @@ -0,0 +1,154 @@ +# Ruby Client for the Web Risk V1beta1 API + +API Client library for the Web Risk V1beta1 API + +Web Risk is an enterprise security product that lets your client applications check URLs against Google's constantly updated lists of unsafe web resources. + +https://github.com/googleapis/google-cloud-ruby + +This gem is a _versioned_ client. It provides basic client classes for a +specific version of the Web Risk V1beta1 API. Most users should consider using +the main client gem, +[google-cloud-web_risk](https://rubygems.org/gems/google-cloud-web_risk). +See the section below titled *Which client should I use?* for more information. + +## Installation + +``` +$ gem install google-cloud-web_risk-v1beta1 +``` + +## 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/webrisk.googleapis.com) +1. [Set up authentication.](AUTHENTICATION.md) + +## Quick Start + +```ruby +require "google/cloud/web_risk/v1beta1" + +client = ::Google::Cloud::WebRisk::V1beta1::WebRiskService::Client.new +request = ::Google::Cloud::WebRisk::V1beta1::ComputeThreatListDiffRequest.new # (request fields as keyword arguments...) +response = client.compute_threat_list_diff request +``` + +View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-web_risk-v1beta1/latest) +for class and method documentation. + +See also the [Product Documentation](https://cloud.google.com/web-risk) +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/web_risk/v1beta1" +require "logger" + +client = ::Google::Cloud::WebRisk::V1beta1::WebRiskService::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-web_risk`, +and lower-level _versioned_ client libraries with names such as +`google-cloud-web_risk-v1beta1`. +_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-web_risk`. +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-web_risk-v1beta1`. + +### 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-web_risk-v1beta1/Rakefile b/owl-bot-staging/google-cloud-web_risk-v1beta1/Rakefile new file mode 100644 index 000000000000..c9ba69740a31 --- /dev/null +++ b/owl-bot-staging/google-cloud-web_risk-v1beta1/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-web_risk-v1beta1 acceptance tests." +task :acceptance, :project, :keyfile do |t, args| + project = args[:project] + project ||= + ENV["WEBRISK_TEST_PROJECT"] || + ENV["GCLOUD_TEST_PROJECT"] + keyfile = args[:keyfile] + keyfile ||= + ENV["WEBRISK_TEST_KEYFILE"] || + ENV["GCLOUD_TEST_KEYFILE"] + if keyfile + keyfile = File.read keyfile + else + keyfile ||= + ENV["WEBRISK_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 WEBRISK_TEST_PROJECT=test123 WEBRISK_TEST_KEYFILE=/path/to/keyfile.json rake acceptance" + end + require "google/cloud/web_risk/v1beta1/web_risk_service/credentials" + ::Google::Cloud::WebRisk::V1beta1::WebRiskService::Credentials.env_vars.each do |path| + ENV[path] = nil + end + ENV["WEBRISK_PROJECT"] = project + ENV["WEBRISK_TEST_PROJECT"] = project + ENV["WEBRISK_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-web_risk-v1beta1 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-web_risk-v1beta1 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-web_risk-v1beta1 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-web_risk-v1beta1 gem does not have doctest tests." +end + +desc "Run the CI build" +task :ci do + header "BUILDING google-cloud-web_risk-v1beta1" + header "google-cloud-web_risk-v1beta1 rubocop", "*" + Rake::Task[:rubocop].invoke + header "google-cloud-web_risk-v1beta1 yard", "*" + Rake::Task[:yard].invoke + header "google-cloud-web_risk-v1beta1 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-web_risk-v1beta1 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-web_risk-v1beta1 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-web_risk-v1beta1/gapic_metadata.json b/owl-bot-staging/google-cloud-web_risk-v1beta1/gapic_metadata.json new file mode 100644 index 000000000000..5c1de79e5f6d --- /dev/null +++ b/owl-bot-staging/google-cloud-web_risk-v1beta1/gapic_metadata.json @@ -0,0 +1,33 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "ruby", + "protoPackage": "google.cloud.webrisk.v1beta1", + "libraryPackage": "::Google::Cloud::WebRisk::V1beta1", + "services": { + "WebRiskServiceV1Beta1": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::WebRisk::V1beta1::WebRiskService::Client", + "rpcs": { + "ComputeThreatListDiff": { + "methods": [ + "compute_threat_list_diff" + ] + }, + "SearchUris": { + "methods": [ + "search_uris" + ] + }, + "SearchHashes": { + "methods": [ + "search_hashes" + ] + } + } + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-web_risk-v1beta1/google-cloud-web_risk-v1beta1.gemspec b/owl-bot-staging/google-cloud-web_risk-v1beta1/google-cloud-web_risk-v1beta1.gemspec new file mode 100644 index 000000000000..4d0becba1eff --- /dev/null +++ b/owl-bot-staging/google-cloud-web_risk-v1beta1/google-cloud-web_risk-v1beta1.gemspec @@ -0,0 +1,28 @@ +# -*- ruby -*- +# encoding: utf-8 + +require File.expand_path("lib/google/cloud/web_risk/v1beta1/version", __dir__) + +Gem::Specification.new do |gem| + gem.name = "google-cloud-web_risk-v1beta1" + gem.version = Google::Cloud::WebRisk::V1beta1::VERSION + + gem.authors = ["Google LLC"] + gem.email = "googleapis-packages@google.com" + gem.description = "Web Risk is an enterprise security product that lets your client applications check URLs against Google's constantly updated lists of unsafe web resources. Note that google-cloud-web_risk-v1beta1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-web_risk instead. See the readme for more details." + gem.summary = "API Client library for the Web Risk V1beta1 API" + 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.2" + + gem.add_dependency "gapic-common", "~> 1.2" + gem.add_dependency "google-cloud-errors", "~> 1.0" +end diff --git a/owl-bot-staging/google-cloud-web_risk-v1beta1/lib/google-cloud-web_risk-v1beta1.rb b/owl-bot-staging/google-cloud-web_risk-v1beta1/lib/google-cloud-web_risk-v1beta1.rb new file mode 100644 index 000000000000..c49ea8ac5445 --- /dev/null +++ b/owl-bot-staging/google-cloud-web_risk-v1beta1/lib/google-cloud-web_risk-v1beta1.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/web_risk/v1beta1" diff --git a/owl-bot-staging/google-cloud-web_risk-v1beta1/lib/google/cloud/web_risk/v1beta1.rb b/owl-bot-staging/google-cloud-web_risk-v1beta1/lib/google/cloud/web_risk/v1beta1.rb new file mode 100644 index 000000000000..05c5ff6acfc4 --- /dev/null +++ b/owl-bot-staging/google-cloud-web_risk-v1beta1/lib/google/cloud/web_risk/v1beta1.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/web_risk/v1beta1/web_risk_service" +require "google/cloud/web_risk/v1beta1/version" + +module Google + module Cloud + module WebRisk + ## + # API client module. + # + # @example Load this package, including all its services, and instantiate a gRPC client + # + # require "google/cloud/web_risk/v1beta1" + # client = ::Google::Cloud::WebRisk::V1beta1::WebRiskService::Client.new + # + # @example Load this package, including all its services, and instantiate a REST client + # + # require "google/cloud/web_risk/v1beta1" + # client = ::Google::Cloud::WebRisk::V1beta1::WebRiskService::Rest::Client.new + # + module V1beta1 + end + end + end +end + +helper_path = ::File.join __dir__, "v1beta1", "_helpers.rb" +require "google/cloud/web_risk/v1beta1/_helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-web_risk-v1beta1/lib/google/cloud/web_risk/v1beta1/rest.rb b/owl-bot-staging/google-cloud-web_risk-v1beta1/lib/google/cloud/web_risk/v1beta1/rest.rb new file mode 100644 index 000000000000..ee8a517b8f9c --- /dev/null +++ b/owl-bot-staging/google-cloud-web_risk-v1beta1/lib/google/cloud/web_risk/v1beta1/rest.rb @@ -0,0 +1,37 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/web_risk/v1beta1/web_risk_service/rest" +require "google/cloud/web_risk/v1beta1/version" + +module Google + module Cloud + module WebRisk + ## + # To load just the REST part of this package, including all its services, and instantiate a REST client: + # + # @example + # + # require "google/cloud/web_risk/v1beta1/rest" + # client = ::Google::Cloud::WebRisk::V1beta1::WebRiskService::Rest::Client.new + # + module V1beta1 + end + end + end +end diff --git a/owl-bot-staging/google-cloud-web_risk-v1beta1/lib/google/cloud/web_risk/v1beta1/version.rb b/owl-bot-staging/google-cloud-web_risk-v1beta1/lib/google/cloud/web_risk/v1beta1/version.rb new file mode 100644 index 000000000000..8cfd7d301ca1 --- /dev/null +++ b/owl-bot-staging/google-cloud-web_risk-v1beta1/lib/google/cloud/web_risk/v1beta1/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 WebRisk + module V1beta1 + VERSION = "0.0.1" + end + end + end +end diff --git a/owl-bot-staging/google-cloud-web_risk-v1beta1/lib/google/cloud/web_risk/v1beta1/web_risk_service.rb b/owl-bot-staging/google-cloud-web_risk-v1beta1/lib/google/cloud/web_risk/v1beta1/web_risk_service.rb new file mode 100644 index 000000000000..738b01841c1a --- /dev/null +++ b/owl-bot-staging/google-cloud-web_risk-v1beta1/lib/google/cloud/web_risk/v1beta1/web_risk_service.rb @@ -0,0 +1,55 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/web_risk/v1beta1/version" + +require "google/cloud/web_risk/v1beta1/web_risk_service/credentials" +require "google/cloud/web_risk/v1beta1/web_risk_service/client" +require "google/cloud/web_risk/v1beta1/web_risk_service/rest" + +module Google + module Cloud + module WebRisk + module V1beta1 + ## + # Web Risk v1beta1 API defines an interface to detect malicious URLs on your + # website and in client applications. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/web_risk/v1beta1/web_risk_service" + # client = ::Google::Cloud::WebRisk::V1beta1::WebRiskService::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/web_risk/v1beta1/web_risk_service/rest" + # client = ::Google::Cloud::WebRisk::V1beta1::WebRiskService::Rest::Client.new + # + module WebRiskService + end + end + end + end +end + +helper_path = ::File.join __dir__, "web_risk_service", "helpers.rb" +require "google/cloud/web_risk/v1beta1/web_risk_service/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-web_risk-v1beta1/lib/google/cloud/web_risk/v1beta1/web_risk_service/client.rb b/owl-bot-staging/google-cloud-web_risk-v1beta1/lib/google/cloud/web_risk/v1beta1/web_risk_service/client.rb new file mode 100644 index 000000000000..88d026e5d188 --- /dev/null +++ b/owl-bot-staging/google-cloud-web_risk-v1beta1/lib/google/cloud/web_risk/v1beta1/web_risk_service/client.rb @@ -0,0 +1,662 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/webrisk/v1beta1/webrisk_pb" + +module Google + module Cloud + module WebRisk + module V1beta1 + module WebRiskService + ## + # Client for the WebRiskService service. + # + # Web Risk v1beta1 API defines an interface to detect malicious URLs on your + # website and in client applications. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "webrisk.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :web_risk_service_stub + + ## + # Configure the WebRiskService Client class. + # + # See {::Google::Cloud::WebRisk::V1beta1::WebRiskService::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all WebRiskService clients + # ::Google::Cloud::WebRisk::V1beta1::WebRiskService::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", "WebRisk", "V1beta1"] + 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.compute_threat_list_diff.timeout = 600.0 + default_config.rpcs.compute_threat_list_diff.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.search_uris.timeout = 600.0 + default_config.rpcs.search_uris.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.search_hashes.timeout = 600.0 + default_config.rpcs.search_hashes.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the WebRiskService 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::WebRisk::V1beta1::WebRiskService::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 + @web_risk_service_stub.universe_domain + end + + ## + # Create a new WebRiskService client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::WebRisk::V1beta1::WebRiskService::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::WebRisk::V1beta1::WebRiskService::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the WebRiskService 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/webrisk/v1beta1/webrisk_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 + + @web_risk_service_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::WebRisk::V1beta1::WebRiskServiceV1Beta1::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 + ) + + @web_risk_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 + end + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @web_risk_service_stub.logger + end + + # Service calls + + ## + # Gets the most recent threat list diffs. + # + # @overload compute_threat_list_diff(request, options = nil) + # Pass arguments to `compute_threat_list_diff` via a request object, either of type + # {::Google::Cloud::WebRisk::V1beta1::ComputeThreatListDiffRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::WebRisk::V1beta1::ComputeThreatListDiffRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload compute_threat_list_diff(threat_type: nil, version_token: nil, constraints: nil) + # Pass arguments to `compute_threat_list_diff` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param threat_type [::Google::Cloud::WebRisk::V1beta1::ThreatType] + # The ThreatList to update. + # @param version_token [::String] + # The current version token of the client for the requested list (the + # client version that was received from the last successful diff). + # @param constraints [::Google::Cloud::WebRisk::V1beta1::ComputeThreatListDiffRequest::Constraints, ::Hash] + # Required. The constraints associated with this request. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::WebRisk::V1beta1::ComputeThreatListDiffResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::WebRisk::V1beta1::ComputeThreatListDiffResponse] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/web_risk/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::WebRisk::V1beta1::WebRiskService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::WebRisk::V1beta1::ComputeThreatListDiffRequest.new + # + # # Call the compute_threat_list_diff method. + # result = client.compute_threat_list_diff request + # + # # The returned object is of type Google::Cloud::WebRisk::V1beta1::ComputeThreatListDiffResponse. + # p result + # + def compute_threat_list_diff request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::WebRisk::V1beta1::ComputeThreatListDiffRequest + + # Converts hash 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.compute_threat_list_diff.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::WebRisk::V1beta1::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.compute_threat_list_diff.timeout, + metadata: metadata, + retry_policy: @config.rpcs.compute_threat_list_diff.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @web_risk_service_stub.call_rpc :compute_threat_list_diff, 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 + + ## + # This method is used to check whether a URI is on a given threatList. + # + # @overload search_uris(request, options = nil) + # Pass arguments to `search_uris` via a request object, either of type + # {::Google::Cloud::WebRisk::V1beta1::SearchUrisRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::WebRisk::V1beta1::SearchUrisRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload search_uris(uri: nil, threat_types: nil) + # Pass arguments to `search_uris` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param uri [::String] + # Required. The URI to be checked for matches. + # @param threat_types [::Array<::Google::Cloud::WebRisk::V1beta1::ThreatType>] + # Required. The ThreatLists to search in. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::WebRisk::V1beta1::SearchUrisResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::WebRisk::V1beta1::SearchUrisResponse] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/web_risk/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::WebRisk::V1beta1::WebRiskService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::WebRisk::V1beta1::SearchUrisRequest.new + # + # # Call the search_uris method. + # result = client.search_uris request + # + # # The returned object is of type Google::Cloud::WebRisk::V1beta1::SearchUrisResponse. + # p result + # + def search_uris request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::WebRisk::V1beta1::SearchUrisRequest + + # Converts hash 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.search_uris.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::WebRisk::V1beta1::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.search_uris.timeout, + metadata: metadata, + retry_policy: @config.rpcs.search_uris.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @web_risk_service_stub.call_rpc :search_uris, 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 + + ## + # Gets the full hashes that match the requested hash prefix. + # This is used after a hash prefix is looked up in a threatList + # and there is a match. The client side threatList only holds partial hashes + # so the client must query this method to determine if there is a full + # hash match of a threat. + # + # @overload search_hashes(request, options = nil) + # Pass arguments to `search_hashes` via a request object, either of type + # {::Google::Cloud::WebRisk::V1beta1::SearchHashesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::WebRisk::V1beta1::SearchHashesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload search_hashes(hash_prefix: nil, threat_types: nil) + # Pass arguments to `search_hashes` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param hash_prefix [::String] + # A hash prefix, consisting of the most significant 4-32 bytes of a SHA256 + # hash. For JSON requests, this field is base64-encoded. + # @param threat_types [::Array<::Google::Cloud::WebRisk::V1beta1::ThreatType>] + # Required. The ThreatLists to search in. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::WebRisk::V1beta1::SearchHashesResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::WebRisk::V1beta1::SearchHashesResponse] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/web_risk/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::WebRisk::V1beta1::WebRiskService::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::WebRisk::V1beta1::SearchHashesRequest.new + # + # # Call the search_hashes method. + # result = client.search_hashes request + # + # # The returned object is of type Google::Cloud::WebRisk::V1beta1::SearchHashesResponse. + # p result + # + def search_hashes request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::WebRisk::V1beta1::SearchHashesRequest + + # Converts hash 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.search_hashes.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::WebRisk::V1beta1::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.search_hashes.timeout, + metadata: metadata, + retry_policy: @config.rpcs.search_hashes.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @web_risk_service_stub.call_rpc :search_hashes, 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 WebRiskService API. + # + # This class represents the configuration for WebRiskService, + # 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::WebRisk::V1beta1::WebRiskService::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 + # # compute_threat_list_diff to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::WebRisk::V1beta1::WebRiskService::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.compute_threat_list_diff.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::WebRisk::V1beta1::WebRiskService::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.compute_threat_list_diff.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::WebRisk::V1beta1::WebRiskService::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 = "webrisk.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 WebRiskService 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 `compute_threat_list_diff` + # @return [::Gapic::Config::Method] + # + attr_reader :compute_threat_list_diff + ## + # RPC-specific configuration for `search_uris` + # @return [::Gapic::Config::Method] + # + attr_reader :search_uris + ## + # RPC-specific configuration for `search_hashes` + # @return [::Gapic::Config::Method] + # + attr_reader :search_hashes + + # @private + def initialize parent_rpcs = nil + compute_threat_list_diff_config = parent_rpcs.compute_threat_list_diff if parent_rpcs.respond_to? :compute_threat_list_diff + @compute_threat_list_diff = ::Gapic::Config::Method.new compute_threat_list_diff_config + search_uris_config = parent_rpcs.search_uris if parent_rpcs.respond_to? :search_uris + @search_uris = ::Gapic::Config::Method.new search_uris_config + search_hashes_config = parent_rpcs.search_hashes if parent_rpcs.respond_to? :search_hashes + @search_hashes = ::Gapic::Config::Method.new search_hashes_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-web_risk-v1beta1/lib/google/cloud/web_risk/v1beta1/web_risk_service/credentials.rb b/owl-bot-staging/google-cloud-web_risk-v1beta1/lib/google/cloud/web_risk/v1beta1/web_risk_service/credentials.rb new file mode 100644 index 000000000000..36e4e8d572dc --- /dev/null +++ b/owl-bot-staging/google-cloud-web_risk-v1beta1/lib/google/cloud/web_risk/v1beta1/web_risk_service/credentials.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! + +require "googleauth" + +module Google + module Cloud + module WebRisk + module V1beta1 + module WebRiskService + # Credentials for the WebRiskService API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/cloud-platform" + ] + self.env_vars = [ + "WEBRISK_CREDENTIALS", + "WEBRISK_KEYFILE", + "GOOGLE_CLOUD_CREDENTIALS", + "GOOGLE_CLOUD_KEYFILE", + "GCLOUD_KEYFILE", + "WEBRISK_CREDENTIALS_JSON", + "WEBRISK_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-web_risk-v1beta1/lib/google/cloud/web_risk/v1beta1/web_risk_service/rest.rb b/owl-bot-staging/google-cloud-web_risk-v1beta1/lib/google/cloud/web_risk/v1beta1/web_risk_service/rest.rb new file mode 100644 index 000000000000..641b01af11e5 --- /dev/null +++ b/owl-bot-staging/google-cloud-web_risk-v1beta1/lib/google/cloud/web_risk/v1beta1/web_risk_service/rest.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 "gapic/rest" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/web_risk/v1beta1/version" + +require "google/cloud/web_risk/v1beta1/web_risk_service/credentials" +require "google/cloud/web_risk/v1beta1/web_risk_service/rest/client" + +module Google + module Cloud + module WebRisk + module V1beta1 + ## + # Web Risk v1beta1 API defines an interface to detect malicious URLs on your + # website and in client applications. + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/web_risk/v1beta1/web_risk_service/rest" + # client = ::Google::Cloud::WebRisk::V1beta1::WebRiskService::Rest::Client.new + # + module WebRiskService + # Client for the REST transport + module Rest + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "rest", "helpers.rb" +require "google/cloud/web_risk/v1beta1/web_risk_service/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-web_risk-v1beta1/lib/google/cloud/web_risk/v1beta1/web_risk_service/rest/client.rb b/owl-bot-staging/google-cloud-web_risk-v1beta1/lib/google/cloud/web_risk/v1beta1/web_risk_service/rest/client.rb new file mode 100644 index 000000000000..1709cfcb3b5f --- /dev/null +++ b/owl-bot-staging/google-cloud-web_risk-v1beta1/lib/google/cloud/web_risk/v1beta1/web_risk_service/rest/client.rb @@ -0,0 +1,622 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/webrisk/v1beta1/webrisk_pb" +require "google/cloud/web_risk/v1beta1/web_risk_service/rest/service_stub" + +module Google + module Cloud + module WebRisk + module V1beta1 + module WebRiskService + module Rest + ## + # REST client for the WebRiskService service. + # + # Web Risk v1beta1 API defines an interface to detect malicious URLs on your + # website and in client applications. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "webrisk.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :web_risk_service_stub + + ## + # Configure the WebRiskService Client class. + # + # See {::Google::Cloud::WebRisk::V1beta1::WebRiskService::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all WebRiskService clients + # ::Google::Cloud::WebRisk::V1beta1::WebRiskService::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", "WebRisk", "V1beta1"] + 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.compute_threat_list_diff.timeout = 600.0 + default_config.rpcs.compute_threat_list_diff.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.search_uris.timeout = 600.0 + default_config.rpcs.search_uris.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.search_hashes.timeout = 600.0 + default_config.rpcs.search_hashes.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the WebRiskService 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::WebRisk::V1beta1::WebRiskService::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 + @web_risk_service_stub.universe_domain + end + + ## + # Create a new WebRiskService REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::WebRisk::V1beta1::WebRiskService::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::WebRisk::V1beta1::WebRiskService::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the WebRiskService 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 + + @web_risk_service_stub = ::Google::Cloud::WebRisk::V1beta1::WebRiskService::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials, + logger: @config.logger + ) + + @web_risk_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 + end + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @web_risk_service_stub.logger + end + + # Service calls + + ## + # Gets the most recent threat list diffs. + # + # @overload compute_threat_list_diff(request, options = nil) + # Pass arguments to `compute_threat_list_diff` via a request object, either of type + # {::Google::Cloud::WebRisk::V1beta1::ComputeThreatListDiffRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::WebRisk::V1beta1::ComputeThreatListDiffRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload compute_threat_list_diff(threat_type: nil, version_token: nil, constraints: nil) + # Pass arguments to `compute_threat_list_diff` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param threat_type [::Google::Cloud::WebRisk::V1beta1::ThreatType] + # The ThreatList to update. + # @param version_token [::String] + # The current version token of the client for the requested list (the + # client version that was received from the last successful diff). + # @param constraints [::Google::Cloud::WebRisk::V1beta1::ComputeThreatListDiffRequest::Constraints, ::Hash] + # Required. The constraints associated with this request. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::WebRisk::V1beta1::ComputeThreatListDiffResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::WebRisk::V1beta1::ComputeThreatListDiffResponse] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/web_risk/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::WebRisk::V1beta1::WebRiskService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::WebRisk::V1beta1::ComputeThreatListDiffRequest.new + # + # # Call the compute_threat_list_diff method. + # result = client.compute_threat_list_diff request + # + # # The returned object is of type Google::Cloud::WebRisk::V1beta1::ComputeThreatListDiffResponse. + # p result + # + def compute_threat_list_diff request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::WebRisk::V1beta1::ComputeThreatListDiffRequest + + # Converts hash 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.compute_threat_list_diff.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::WebRisk::V1beta1::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.compute_threat_list_diff.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.compute_threat_list_diff.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @web_risk_service_stub.compute_threat_list_diff 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 + + ## + # This method is used to check whether a URI is on a given threatList. + # + # @overload search_uris(request, options = nil) + # Pass arguments to `search_uris` via a request object, either of type + # {::Google::Cloud::WebRisk::V1beta1::SearchUrisRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::WebRisk::V1beta1::SearchUrisRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload search_uris(uri: nil, threat_types: nil) + # Pass arguments to `search_uris` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param uri [::String] + # Required. The URI to be checked for matches. + # @param threat_types [::Array<::Google::Cloud::WebRisk::V1beta1::ThreatType>] + # Required. The ThreatLists to search in. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::WebRisk::V1beta1::SearchUrisResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::WebRisk::V1beta1::SearchUrisResponse] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/web_risk/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::WebRisk::V1beta1::WebRiskService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::WebRisk::V1beta1::SearchUrisRequest.new + # + # # Call the search_uris method. + # result = client.search_uris request + # + # # The returned object is of type Google::Cloud::WebRisk::V1beta1::SearchUrisResponse. + # p result + # + def search_uris request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::WebRisk::V1beta1::SearchUrisRequest + + # Converts hash 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.search_uris.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::WebRisk::V1beta1::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.search_uris.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.search_uris.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @web_risk_service_stub.search_uris 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 + + ## + # Gets the full hashes that match the requested hash prefix. + # This is used after a hash prefix is looked up in a threatList + # and there is a match. The client side threatList only holds partial hashes + # so the client must query this method to determine if there is a full + # hash match of a threat. + # + # @overload search_hashes(request, options = nil) + # Pass arguments to `search_hashes` via a request object, either of type + # {::Google::Cloud::WebRisk::V1beta1::SearchHashesRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::WebRisk::V1beta1::SearchHashesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload search_hashes(hash_prefix: nil, threat_types: nil) + # Pass arguments to `search_hashes` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param hash_prefix [::String] + # A hash prefix, consisting of the most significant 4-32 bytes of a SHA256 + # hash. For JSON requests, this field is base64-encoded. + # @param threat_types [::Array<::Google::Cloud::WebRisk::V1beta1::ThreatType>] + # Required. The ThreatLists to search in. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::WebRisk::V1beta1::SearchHashesResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::WebRisk::V1beta1::SearchHashesResponse] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/web_risk/v1beta1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::WebRisk::V1beta1::WebRiskService::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::WebRisk::V1beta1::SearchHashesRequest.new + # + # # Call the search_hashes method. + # result = client.search_hashes request + # + # # The returned object is of type Google::Cloud::WebRisk::V1beta1::SearchHashesResponse. + # p result + # + def search_hashes request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::WebRisk::V1beta1::SearchHashesRequest + + # Converts hash 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.search_hashes.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::WebRisk::V1beta1::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.search_hashes.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.search_hashes.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @web_risk_service_stub.search_hashes 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 WebRiskService REST API. + # + # This class represents the configuration for WebRiskService 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::WebRisk::V1beta1::WebRiskService::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 + # # compute_threat_list_diff to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::WebRisk::V1beta1::WebRiskService::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.compute_threat_list_diff.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::WebRisk::V1beta1::WebRiskService::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.compute_threat_list_diff.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 = "webrisk.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 WebRiskService 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 `compute_threat_list_diff` + # @return [::Gapic::Config::Method] + # + attr_reader :compute_threat_list_diff + ## + # RPC-specific configuration for `search_uris` + # @return [::Gapic::Config::Method] + # + attr_reader :search_uris + ## + # RPC-specific configuration for `search_hashes` + # @return [::Gapic::Config::Method] + # + attr_reader :search_hashes + + # @private + def initialize parent_rpcs = nil + compute_threat_list_diff_config = parent_rpcs.compute_threat_list_diff if parent_rpcs.respond_to? :compute_threat_list_diff + @compute_threat_list_diff = ::Gapic::Config::Method.new compute_threat_list_diff_config + search_uris_config = parent_rpcs.search_uris if parent_rpcs.respond_to? :search_uris + @search_uris = ::Gapic::Config::Method.new search_uris_config + search_hashes_config = parent_rpcs.search_hashes if parent_rpcs.respond_to? :search_hashes + @search_hashes = ::Gapic::Config::Method.new search_hashes_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-web_risk-v1beta1/lib/google/cloud/web_risk/v1beta1/web_risk_service/rest/service_stub.rb b/owl-bot-staging/google-cloud-web_risk-v1beta1/lib/google/cloud/web_risk/v1beta1/web_risk_service/rest/service_stub.rb new file mode 100644 index 000000000000..6138c60c8d86 --- /dev/null +++ b/owl-bot-staging/google-cloud-web_risk-v1beta1/lib/google/cloud/web_risk/v1beta1/web_risk_service/rest/service_stub.rb @@ -0,0 +1,258 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/webrisk/v1beta1/webrisk_pb" + +module Google + module Cloud + module WebRisk + module V1beta1 + module WebRiskService + module Rest + ## + # REST service stub for the WebRiskService 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 compute_threat_list_diff REST call + # + # @param request_pb [::Google::Cloud::WebRisk::V1beta1::ComputeThreatListDiffRequest] + # 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::WebRisk::V1beta1::ComputeThreatListDiffResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::WebRisk::V1beta1::ComputeThreatListDiffResponse] + # A result object deserialized from the server's reply + def compute_threat_list_diff request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_compute_threat_list_diff_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: "compute_threat_list_diff", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::WebRisk::V1beta1::ComputeThreatListDiffResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the search_uris REST call + # + # @param request_pb [::Google::Cloud::WebRisk::V1beta1::SearchUrisRequest] + # 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::WebRisk::V1beta1::SearchUrisResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::WebRisk::V1beta1::SearchUrisResponse] + # A result object deserialized from the server's reply + def search_uris request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_search_uris_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: "search_uris", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::WebRisk::V1beta1::SearchUrisResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the search_hashes REST call + # + # @param request_pb [::Google::Cloud::WebRisk::V1beta1::SearchHashesRequest] + # 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::WebRisk::V1beta1::SearchHashesResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::WebRisk::V1beta1::SearchHashesResponse] + # A result object deserialized from the server's reply + def search_hashes request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_search_hashes_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: "search_hashes", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::WebRisk::V1beta1::SearchHashesResponse.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 compute_threat_list_diff REST call + # + # @param request_pb [::Google::Cloud::WebRisk::V1beta1::ComputeThreatListDiffRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_compute_threat_list_diff_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1beta1/threatLists:computeDiff", + matches: [] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the search_uris REST call + # + # @param request_pb [::Google::Cloud::WebRisk::V1beta1::SearchUrisRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_search_uris_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1beta1/uris:search", + matches: [] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the search_hashes REST call + # + # @param request_pb [::Google::Cloud::WebRisk::V1beta1::SearchHashesRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_search_hashes_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1beta1/hashes:search", + matches: [] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-web_risk-v1beta1/lib/google/cloud/webrisk/v1beta1/webrisk_pb.rb b/owl-bot-staging/google-cloud-web_risk-v1beta1/lib/google/cloud/webrisk/v1beta1/webrisk_pb.rb new file mode 100644 index 000000000000..e3a312629374 --- /dev/null +++ b/owl-bot-staging/google-cloud-web_risk-v1beta1/lib/google/cloud/webrisk/v1beta1/webrisk_pb.rb @@ -0,0 +1,43 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/webrisk/v1beta1/webrisk.proto + +require 'google/protobuf' + +require 'google/api/annotations_pb' +require 'google/api/client_pb' +require 'google/api/field_behavior_pb' +require 'google/protobuf/timestamp_pb' + + +descriptor_data = "\n*google/cloud/webrisk/v1beta1/webrisk.proto\x12\x1cgoogle.cloud.webrisk.v1beta1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xf2\x02\n\x1c\x43omputeThreatListDiffRequest\x12\x42\n\x0bthreat_type\x18\x01 \x01(\x0e\x32(.google.cloud.webrisk.v1beta1.ThreatTypeB\x03\xe0\x41\x02\x12\x15\n\rversion_token\x18\x02 \x01(\x0c\x12`\n\x0b\x63onstraints\x18\x03 \x01(\x0b\x32\x46.google.cloud.webrisk.v1beta1.ComputeThreatListDiffRequest.ConstraintsB\x03\xe0\x41\x02\x1a\x94\x01\n\x0b\x43onstraints\x12\x18\n\x10max_diff_entries\x18\x01 \x01(\x05\x12\x1c\n\x14max_database_entries\x18\x02 \x01(\x05\x12M\n\x16supported_compressions\x18\x03 \x03(\x0e\x32-.google.cloud.webrisk.v1beta1.CompressionType\"\x9a\x04\n\x1d\x43omputeThreatListDiffResponse\x12_\n\rresponse_type\x18\x04 \x01(\x0e\x32H.google.cloud.webrisk.v1beta1.ComputeThreatListDiffResponse.ResponseType\x12\x45\n\tadditions\x18\x05 \x01(\x0b\x32\x32.google.cloud.webrisk.v1beta1.ThreatEntryAdditions\x12\x43\n\x08removals\x18\x06 \x01(\x0b\x32\x31.google.cloud.webrisk.v1beta1.ThreatEntryRemovals\x12\x19\n\x11new_version_token\x18\x07 \x01(\x0c\x12V\n\x08\x63hecksum\x18\x08 \x01(\x0b\x32\x44.google.cloud.webrisk.v1beta1.ComputeThreatListDiffResponse.Checksum\x12\x39\n\x15recommended_next_diff\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x1a\x1a\n\x08\x43hecksum\x12\x0e\n\x06sha256\x18\x01 \x01(\x0c\"B\n\x0cResponseType\x12\x1d\n\x19RESPONSE_TYPE_UNSPECIFIED\x10\x00\x12\x08\n\x04\x44IFF\x10\x01\x12\t\n\x05RESET\x10\x02\"j\n\x11SearchUrisRequest\x12\x10\n\x03uri\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x43\n\x0cthreat_types\x18\x02 \x03(\x0e\x32(.google.cloud.webrisk.v1beta1.ThreatTypeB\x03\xe0\x41\x02\"\xde\x01\n\x12SearchUrisResponse\x12J\n\x06threat\x18\x01 \x01(\x0b\x32:.google.cloud.webrisk.v1beta1.SearchUrisResponse.ThreatUri\x1a|\n\tThreatUri\x12>\n\x0cthreat_types\x18\x01 \x03(\x0e\x32(.google.cloud.webrisk.v1beta1.ThreatType\x12/\n\x0b\x65xpire_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"o\n\x13SearchHashesRequest\x12\x13\n\x0bhash_prefix\x18\x01 \x01(\x0c\x12\x43\n\x0cthreat_types\x18\x02 \x03(\x0e\x32(.google.cloud.webrisk.v1beta1.ThreatTypeB\x03\xe0\x41\x02\"\xae\x02\n\x14SearchHashesResponse\x12N\n\x07threats\x18\x01 \x03(\x0b\x32=.google.cloud.webrisk.v1beta1.SearchHashesResponse.ThreatHash\x12\x38\n\x14negative_expire_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x1a\x8b\x01\n\nThreatHash\x12>\n\x0cthreat_types\x18\x01 \x03(\x0e\x32(.google.cloud.webrisk.v1beta1.ThreatType\x12\x0c\n\x04hash\x18\x02 \x01(\x0c\x12/\n\x0b\x65xpire_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"\x99\x01\n\x14ThreatEntryAdditions\x12;\n\nraw_hashes\x18\x01 \x03(\x0b\x32\'.google.cloud.webrisk.v1beta1.RawHashes\x12\x44\n\x0brice_hashes\x18\x02 \x01(\x0b\x32/.google.cloud.webrisk.v1beta1.RiceDeltaEncoding\"\x9b\x01\n\x13ThreatEntryRemovals\x12=\n\x0braw_indices\x18\x01 \x01(\x0b\x32(.google.cloud.webrisk.v1beta1.RawIndices\x12\x45\n\x0crice_indices\x18\x02 \x01(\x0b\x32/.google.cloud.webrisk.v1beta1.RiceDeltaEncoding\"\x1d\n\nRawIndices\x12\x0f\n\x07indices\x18\x01 \x03(\x05\"4\n\tRawHashes\x12\x13\n\x0bprefix_size\x18\x01 \x01(\x05\x12\x12\n\nraw_hashes\x18\x02 \x01(\x0c\"k\n\x11RiceDeltaEncoding\x12\x13\n\x0b\x66irst_value\x18\x01 \x01(\x03\x12\x16\n\x0erice_parameter\x18\x02 \x01(\x05\x12\x13\n\x0b\x65ntry_count\x18\x03 \x01(\x05\x12\x14\n\x0c\x65ncoded_data\x18\x04 \x01(\x0c*e\n\nThreatType\x12\x1b\n\x17THREAT_TYPE_UNSPECIFIED\x10\x00\x12\x0b\n\x07MALWARE\x10\x01\x12\x16\n\x12SOCIAL_ENGINEERING\x10\x02\x12\x15\n\x11UNWANTED_SOFTWARE\x10\x03*F\n\x0f\x43ompressionType\x12 \n\x1c\x43OMPRESSION_TYPE_UNSPECIFIED\x10\x00\x12\x07\n\x03RAW\x10\x01\x12\x08\n\x04RICE\x10\x02\x32\x9e\x05\n\x15WebRiskServiceV1Beta1\x12\xe2\x01\n\x15\x43omputeThreatListDiff\x12:.google.cloud.webrisk.v1beta1.ComputeThreatListDiffRequest\x1a;.google.cloud.webrisk.v1beta1.ComputeThreatListDiffResponse\"P\xda\x41%threat_type,version_token,constraints\x82\xd3\xe4\x93\x02\"\x12 /v1beta1/threatLists:computeDiff\x12\xa0\x01\n\nSearchUris\x12/.google.cloud.webrisk.v1beta1.SearchUrisRequest\x1a\x30.google.cloud.webrisk.v1beta1.SearchUrisResponse\"/\xda\x41\x10uri,threat_types\x82\xd3\xe4\x93\x02\x16\x12\x14/v1beta1/uris:search\x12\xb0\x01\n\x0cSearchHashes\x12\x31.google.cloud.webrisk.v1beta1.SearchHashesRequest\x1a\x32.google.cloud.webrisk.v1beta1.SearchHashesResponse\"9\xda\x41\x18hash_prefix,threat_types\x82\xd3\xe4\x93\x02\x18\x12\x16/v1beta1/hashes:search\x1aJ\xca\x41\x16webrisk.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\xcf\x01\n\x1a\x63om.google.webrisk.v1beta1B\x0cWebRiskProtoP\x01Z:cloud.google.com/go/webrisk/apiv1beta1/webriskpb;webriskpb\xa2\x02\x04GCWR\xaa\x02\x1cGoogle.Cloud.WebRisk.V1Beta1\xca\x02\x1cGoogle\\Cloud\\WebRisk\\V1beta1\xea\x02\x1fGoogle::Cloud::WebRisk::V1beta1b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module WebRisk + module V1beta1 + ComputeThreatListDiffRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.webrisk.v1beta1.ComputeThreatListDiffRequest").msgclass + ComputeThreatListDiffRequest::Constraints = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.webrisk.v1beta1.ComputeThreatListDiffRequest.Constraints").msgclass + ComputeThreatListDiffResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.webrisk.v1beta1.ComputeThreatListDiffResponse").msgclass + ComputeThreatListDiffResponse::Checksum = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.webrisk.v1beta1.ComputeThreatListDiffResponse.Checksum").msgclass + ComputeThreatListDiffResponse::ResponseType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.webrisk.v1beta1.ComputeThreatListDiffResponse.ResponseType").enummodule + SearchUrisRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.webrisk.v1beta1.SearchUrisRequest").msgclass + SearchUrisResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.webrisk.v1beta1.SearchUrisResponse").msgclass + SearchUrisResponse::ThreatUri = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.webrisk.v1beta1.SearchUrisResponse.ThreatUri").msgclass + SearchHashesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.webrisk.v1beta1.SearchHashesRequest").msgclass + SearchHashesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.webrisk.v1beta1.SearchHashesResponse").msgclass + SearchHashesResponse::ThreatHash = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.webrisk.v1beta1.SearchHashesResponse.ThreatHash").msgclass + ThreatEntryAdditions = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.webrisk.v1beta1.ThreatEntryAdditions").msgclass + ThreatEntryRemovals = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.webrisk.v1beta1.ThreatEntryRemovals").msgclass + RawIndices = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.webrisk.v1beta1.RawIndices").msgclass + RawHashes = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.webrisk.v1beta1.RawHashes").msgclass + RiceDeltaEncoding = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.webrisk.v1beta1.RiceDeltaEncoding").msgclass + ThreatType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.webrisk.v1beta1.ThreatType").enummodule + CompressionType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.webrisk.v1beta1.CompressionType").enummodule + end + end + end +end diff --git a/owl-bot-staging/google-cloud-web_risk-v1beta1/lib/google/cloud/webrisk/v1beta1/webrisk_services_pb.rb b/owl-bot-staging/google-cloud-web_risk-v1beta1/lib/google/cloud/webrisk/v1beta1/webrisk_services_pb.rb new file mode 100644 index 000000000000..660324d80adb --- /dev/null +++ b/owl-bot-staging/google-cloud-web_risk-v1beta1/lib/google/cloud/webrisk/v1beta1/webrisk_services_pb.rb @@ -0,0 +1,55 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/cloud/webrisk/v1beta1/webrisk.proto for package 'Google.Cloud.WebRisk.V1beta1' +# 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/webrisk/v1beta1/webrisk_pb' + +module Google + module Cloud + module WebRisk + module V1beta1 + module WebRiskServiceV1Beta1 + # Web Risk v1beta1 API defines an interface to detect malicious URLs on your + # website and in client applications. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.cloud.webrisk.v1beta1.WebRiskServiceV1Beta1' + + # Gets the most recent threat list diffs. + rpc :ComputeThreatListDiff, ::Google::Cloud::WebRisk::V1beta1::ComputeThreatListDiffRequest, ::Google::Cloud::WebRisk::V1beta1::ComputeThreatListDiffResponse + # This method is used to check whether a URI is on a given threatList. + rpc :SearchUris, ::Google::Cloud::WebRisk::V1beta1::SearchUrisRequest, ::Google::Cloud::WebRisk::V1beta1::SearchUrisResponse + # Gets the full hashes that match the requested hash prefix. + # This is used after a hash prefix is looked up in a threatList + # and there is a match. The client side threatList only holds partial hashes + # so the client must query this method to determine if there is a full + # hash match of a threat. + rpc :SearchHashes, ::Google::Cloud::WebRisk::V1beta1::SearchHashesRequest, ::Google::Cloud::WebRisk::V1beta1::SearchHashesResponse + end + + Stub = Service.rpc_stub_class + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-web_risk-v1beta1/proto_docs/README.md b/owl-bot-staging/google-cloud-web_risk-v1beta1/proto_docs/README.md new file mode 100644 index 000000000000..a908c3711de1 --- /dev/null +++ b/owl-bot-staging/google-cloud-web_risk-v1beta1/proto_docs/README.md @@ -0,0 +1,4 @@ +# Web Risk V1beta1 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-web_risk-v1beta1/proto_docs/google/api/client.rb b/owl-bot-staging/google-cloud-web_risk-v1beta1/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..3ab0b096d445 --- /dev/null +++ b/owl-bot-staging/google-cloud-web_risk-v1beta1/proto_docs/google/api/client.rb @@ -0,0 +1,593 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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. + # + # Note: This field should not be used in most cases. + 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: + # library_settings: + # 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. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Php. Clobbers the php_namespace option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.php.package_name" field + # in gapic.yaml. API teams should use the protobuf php_namespace option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # library_settings: + # php_settings: + # library_package: Google\Cloud\PubSub\V1 + 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. + # + # Example: + # + # 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 + # @!attribute [rw] batching + # @return [::Google::Api::BatchingConfigProto] + # Batching configuration for an API method in client libraries. + # + # Example of a YAML configuration: + # + # publishing: + # method_settings: + # - selector: google.example.v1.ExampleService.BatchCreateExample + # batching: + # element_count_threshold: 1000 + # request_byte_threshold: 100000000 + # delay_threshold_millis: 10 + 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. + # + # Note: This feature should not be used in most cases. + # @!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 + + # `BatchingConfigProto` defines the batching configuration for an API method. + # @!attribute [rw] thresholds + # @return [::Google::Api::BatchingSettingsProto] + # The thresholds which trigger a batched request to be sent. + # @!attribute [rw] batch_descriptor + # @return [::Google::Api::BatchingDescriptorProto] + # The request and response fields used in batching. + class BatchingConfigProto + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `BatchingSettingsProto` specifies a set of batching thresholds, each of + # which acts as a trigger to send a batch of messages as a request. At least + # one threshold must be positive nonzero. + # @!attribute [rw] element_count_threshold + # @return [::Integer] + # The number of elements of a field collected into a batch which, if + # exceeded, causes the batch to be sent. + # @!attribute [rw] request_byte_threshold + # @return [::Integer] + # The aggregated size of the batched field which, if exceeded, causes the + # batch to be sent. This size is computed by aggregating the sizes of the + # request field to be batched, not of the entire request message. + # @!attribute [rw] delay_threshold + # @return [::Google::Protobuf::Duration] + # The duration after which a batch should be sent, starting from the addition + # of the first message to that batch. + # @!attribute [rw] element_count_limit + # @return [::Integer] + # The maximum number of elements collected in a batch that could be accepted + # by server. + # @!attribute [rw] request_byte_limit + # @return [::Integer] + # The maximum size of the request that could be accepted by server. + # @!attribute [rw] flow_control_element_limit + # @return [::Integer] + # The maximum number of elements allowed by flow control. + # @!attribute [rw] flow_control_byte_limit + # @return [::Integer] + # The maximum size of data allowed by flow control. + # @!attribute [rw] flow_control_limit_exceeded_behavior + # @return [::Google::Api::FlowControlLimitExceededBehaviorProto] + # The behavior to take when the flow control limit is exceeded. + class BatchingSettingsProto + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `BatchingDescriptorProto` specifies the fields of the request message to be + # used for batching, and, optionally, the fields of the response message to be + # used for demultiplexing. + # @!attribute [rw] batched_field + # @return [::String] + # The repeated field in the request message to be aggregated by batching. + # @!attribute [rw] discriminator_fields + # @return [::Array<::String>] + # A list of the fields in the request message. Two requests will be batched + # together only if the values of every field specified in + # `request_discriminator_fields` is equal between the two requests. + # @!attribute [rw] subresponse_field + # @return [::String] + # Optional. When present, indicates the field in the response message to be + # used to demultiplex the response into multiple response messages, in + # correspondence with the multiple request messages originally batched + # together. + class BatchingDescriptorProto + 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 + + # The behavior to take when the flow control limit is exceeded. + module FlowControlLimitExceededBehaviorProto + # Default behavior, system-defined. + UNSET_BEHAVIOR = 0 + + # Stop operation, raise error. + THROW_EXCEPTION = 1 + + # Pause operation until limit clears. + BLOCK = 2 + + # Continue operation, disregard limit. + IGNORE = 3 + end + end +end diff --git a/owl-bot-staging/google-cloud-web_risk-v1beta1/proto_docs/google/api/field_behavior.rb b/owl-bot-staging/google-cloud-web_risk-v1beta1/proto_docs/google/api/field_behavior.rb new file mode 100644 index 000000000000..582be187d115 --- /dev/null +++ b/owl-bot-staging/google-cloud-web_risk-v1beta1/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-web_risk-v1beta1/proto_docs/google/api/launch_stage.rb b/owl-bot-staging/google-cloud-web_risk-v1beta1/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..9392a413fb1b --- /dev/null +++ b/owl-bot-staging/google-cloud-web_risk-v1beta1/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-web_risk-v1beta1/proto_docs/google/api/resource.rb b/owl-bot-staging/google-cloud-web_risk-v1beta1/proto_docs/google/api/resource.rb new file mode 100644 index 000000000000..25dec4847ac1 --- /dev/null +++ b/owl-bot-staging/google-cloud-web_risk-v1beta1/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-web_risk-v1beta1/proto_docs/google/cloud/webrisk/v1beta1/webrisk.rb b/owl-bot-staging/google-cloud-web_risk-v1beta1/proto_docs/google/cloud/webrisk/v1beta1/webrisk.rb new file mode 100644 index 000000000000..c8e4013b59f2 --- /dev/null +++ b/owl-bot-staging/google-cloud-web_risk-v1beta1/proto_docs/google/cloud/webrisk/v1beta1/webrisk.rb @@ -0,0 +1,307 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 WebRisk + module V1beta1 + # Describes an API diff request. + # @!attribute [rw] threat_type + # @return [::Google::Cloud::WebRisk::V1beta1::ThreatType] + # The ThreatList to update. + # @!attribute [rw] version_token + # @return [::String] + # The current version token of the client for the requested list (the + # client version that was received from the last successful diff). + # @!attribute [rw] constraints + # @return [::Google::Cloud::WebRisk::V1beta1::ComputeThreatListDiffRequest::Constraints] + # Required. The constraints associated with this request. + class ComputeThreatListDiffRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The constraints for this diff. + # @!attribute [rw] max_diff_entries + # @return [::Integer] + # The maximum size in number of entries. The diff will not contain more + # entries than this value. This should be a power of 2 between 2**10 and + # 2**20. If zero, no diff size limit is set. + # @!attribute [rw] max_database_entries + # @return [::Integer] + # Sets the maximum number of entries that the client is willing to have + # in the local database. This should be a power of 2 between 2**10 and + # 2**20. If zero, no database size limit is set. + # @!attribute [rw] supported_compressions + # @return [::Array<::Google::Cloud::WebRisk::V1beta1::CompressionType>] + # The compression types supported by the client. + class Constraints + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # @!attribute [rw] response_type + # @return [::Google::Cloud::WebRisk::V1beta1::ComputeThreatListDiffResponse::ResponseType] + # The type of response. This may indicate that an action must be taken by the + # client when the response is received. + # @!attribute [rw] additions + # @return [::Google::Cloud::WebRisk::V1beta1::ThreatEntryAdditions] + # A set of entries to add to a local threat type's list. + # @!attribute [rw] removals + # @return [::Google::Cloud::WebRisk::V1beta1::ThreatEntryRemovals] + # A set of entries to remove from a local threat type's list. + # This field may be empty. + # @!attribute [rw] new_version_token + # @return [::String] + # The new opaque client version token. + # @!attribute [rw] checksum + # @return [::Google::Cloud::WebRisk::V1beta1::ComputeThreatListDiffResponse::Checksum] + # The expected SHA256 hash of the client state; that is, of the sorted list + # of all hashes present in the database after applying the provided diff. + # If the client state doesn't match the expected state, the client must + # disregard this diff and retry later. + # @!attribute [rw] recommended_next_diff + # @return [::Google::Protobuf::Timestamp] + # The soonest the client should wait before issuing any diff + # request. Querying sooner is unlikely to produce a meaningful diff. + # Waiting longer is acceptable considering the use case. + # If this field is not set clients may update as soon as they want. + class ComputeThreatListDiffResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The expected state of a client's local database. + # @!attribute [rw] sha256 + # @return [::String] + # The SHA256 hash of the client state; that is, of the sorted list of all + # hashes present in the database. + class Checksum + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The type of response sent to the client. + module ResponseType + # Unknown. + RESPONSE_TYPE_UNSPECIFIED = 0 + + # Partial updates are applied to the client's existing local database. + DIFF = 1 + + # Full updates resets the client's entire local database. This means + # that either the client had no state, was seriously out-of-date, + # or the client is believed to be corrupt. + RESET = 2 + end + end + + # Request to check URI entries against threatLists. + # @!attribute [rw] uri + # @return [::String] + # Required. The URI to be checked for matches. + # @!attribute [rw] threat_types + # @return [::Array<::Google::Cloud::WebRisk::V1beta1::ThreatType>] + # Required. The ThreatLists to search in. + class SearchUrisRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] threat + # @return [::Google::Cloud::WebRisk::V1beta1::SearchUrisResponse::ThreatUri] + # The threat list matches. This may be empty if the URI is on no list. + class SearchUrisResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Contains threat information on a matching uri. + # @!attribute [rw] threat_types + # @return [::Array<::Google::Cloud::WebRisk::V1beta1::ThreatType>] + # The ThreatList this threat belongs to. + # @!attribute [rw] expire_time + # @return [::Google::Protobuf::Timestamp] + # The cache lifetime for the returned match. Clients must not cache this + # response past this timestamp to avoid false positives. + class ThreatUri + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Request to return full hashes matched by the provided hash prefixes. + # @!attribute [rw] hash_prefix + # @return [::String] + # A hash prefix, consisting of the most significant 4-32 bytes of a SHA256 + # hash. For JSON requests, this field is base64-encoded. + # @!attribute [rw] threat_types + # @return [::Array<::Google::Cloud::WebRisk::V1beta1::ThreatType>] + # Required. The ThreatLists to search in. + class SearchHashesRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] threats + # @return [::Array<::Google::Cloud::WebRisk::V1beta1::SearchHashesResponse::ThreatHash>] + # The full hashes that matched the requested prefixes. + # The hash will be populated in the key. + # @!attribute [rw] negative_expire_time + # @return [::Google::Protobuf::Timestamp] + # For requested entities that did not match the threat list, how long to + # cache the response until. + class SearchHashesResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Contains threat information on a matching hash. + # @!attribute [rw] threat_types + # @return [::Array<::Google::Cloud::WebRisk::V1beta1::ThreatType>] + # The ThreatList this threat belongs to. + # This must contain at least one entry. + # @!attribute [rw] hash + # @return [::String] + # A 32 byte SHA256 hash. This field is in binary format. For JSON + # requests, hashes are base64-encoded. + # @!attribute [rw] expire_time + # @return [::Google::Protobuf::Timestamp] + # The cache lifetime for the returned match. Clients must not cache this + # response past this timestamp to avoid false positives. + class ThreatHash + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Contains the set of entries to add to a local database. + # May contain a combination of compressed and raw data in a single response. + # @!attribute [rw] raw_hashes + # @return [::Array<::Google::Cloud::WebRisk::V1beta1::RawHashes>] + # The raw SHA256-formatted entries. + # Repeated to allow returning sets of hashes with different prefix sizes. + # @!attribute [rw] rice_hashes + # @return [::Google::Cloud::WebRisk::V1beta1::RiceDeltaEncoding] + # The encoded 4-byte prefixes of SHA256-formatted entries, using a + # Golomb-Rice encoding. The hashes are converted to uint32, sorted in + # ascending order, then delta encoded and stored as encoded_data. + class ThreatEntryAdditions + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Contains the set of entries to remove from a local database. + # @!attribute [rw] raw_indices + # @return [::Google::Cloud::WebRisk::V1beta1::RawIndices] + # The raw removal indices for a local list. + # @!attribute [rw] rice_indices + # @return [::Google::Cloud::WebRisk::V1beta1::RiceDeltaEncoding] + # The encoded local, lexicographically-sorted list indices, using a + # Golomb-Rice encoding. Used for sending compressed removal indices. The + # removal indices (uint32) are sorted in ascending order, then delta encoded + # and stored as encoded_data. + class ThreatEntryRemovals + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A set of raw indices to remove from a local list. + # @!attribute [rw] indices + # @return [::Array<::Integer>] + # The indices to remove from a lexicographically-sorted local list. + class RawIndices + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The uncompressed threat entries in hash format. + # Hashes can be anywhere from 4 to 32 bytes in size. A large majority are 4 + # bytes, but some hashes are lengthened if they collide with the hash of a + # popular URI. + # + # Used for sending ThreatEntryAdditons to clients that do not support + # compression, or when sending non-4-byte hashes to clients that do support + # compression. + # @!attribute [rw] prefix_size + # @return [::Integer] + # The number of bytes for each prefix encoded below. This field can be + # anywhere from 4 (shortest prefix) to 32 (full SHA256 hash). + # @!attribute [rw] raw_hashes + # @return [::String] + # The hashes, in binary format, concatenated into one long string. Hashes are + # sorted in lexicographic order. For JSON API users, hashes are + # base64-encoded. + class RawHashes + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The Rice-Golomb encoded data. Used for sending compressed 4-byte hashes or + # compressed removal indices. + # @!attribute [rw] first_value + # @return [::Integer] + # The offset of the first entry in the encoded data, or, if only a single + # integer was encoded, that single integer's value. If the field is empty or + # missing, assume zero. + # @!attribute [rw] rice_parameter + # @return [::Integer] + # The Golomb-Rice parameter, which is a number between 2 and 28. This field + # is missing (that is, zero) if `num_entries` is zero. + # @!attribute [rw] entry_count + # @return [::Integer] + # The number of entries that are delta encoded in the encoded data. If only a + # single integer was encoded, this will be zero and the single value will be + # stored in `first_value`. + # @!attribute [rw] encoded_data + # @return [::String] + # The encoded deltas that are encoded using the Golomb-Rice coder. + class RiceDeltaEncoding + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The type of threat. This maps dirrectly to the threat list a threat may + # belong to. + module ThreatType + # Unknown. + THREAT_TYPE_UNSPECIFIED = 0 + + # Malware targeting any platform. + MALWARE = 1 + + # Social engineering targeting any platform. + SOCIAL_ENGINEERING = 2 + + # Unwanted software targeting any platform. + UNWANTED_SOFTWARE = 3 + end + + # The ways in which threat entry sets can be compressed. + module CompressionType + # Unknown. + COMPRESSION_TYPE_UNSPECIFIED = 0 + + # Raw, uncompressed data. + RAW = 1 + + # Rice-Golomb encoded data. + RICE = 2 + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-web_risk-v1beta1/proto_docs/google/protobuf/duration.rb b/owl-bot-staging/google-cloud-web_risk-v1beta1/proto_docs/google/protobuf/duration.rb new file mode 100644 index 000000000000..ea59f1f91daf --- /dev/null +++ b/owl-bot-staging/google-cloud-web_risk-v1beta1/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-web_risk-v1beta1/proto_docs/google/protobuf/timestamp.rb b/owl-bot-staging/google-cloud-web_risk-v1beta1/proto_docs/google/protobuf/timestamp.rb new file mode 100644 index 000000000000..74352be9c58c --- /dev/null +++ b/owl-bot-staging/google-cloud-web_risk-v1beta1/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-web_risk-v1beta1/snippets/Gemfile b/owl-bot-staging/google-cloud-web_risk-v1beta1/snippets/Gemfile new file mode 100644 index 000000000000..9e1e8937a0c4 --- /dev/null +++ b/owl-bot-staging/google-cloud-web_risk-v1beta1/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-web_risk-v1beta1", path: "../" +else + gem "google-cloud-web_risk-v1beta1" +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-web_risk-v1beta1/snippets/snippet_metadata_google.cloud.webrisk.v1beta1.json b/owl-bot-staging/google-cloud-web_risk-v1beta1/snippets/snippet_metadata_google.cloud.webrisk.v1beta1.json new file mode 100644 index 000000000000..5fc454a190f6 --- /dev/null +++ b/owl-bot-staging/google-cloud-web_risk-v1beta1/snippets/snippet_metadata_google.cloud.webrisk.v1beta1.json @@ -0,0 +1,135 @@ +{ + "client_library": { + "name": "google-cloud-web_risk-v1beta1", + "version": "", + "language": "RUBY", + "apis": [ + { + "id": "google.cloud.webrisk.v1beta1", + "version": "v1beta1" + } + ] + }, + "snippets": [ + { + "region_tag": "webrisk_v1beta1_generated_WebRiskService_ComputeThreatListDiff_sync", + "title": "Snippet for the compute_threat_list_diff call in the WebRiskService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::WebRisk::V1beta1::WebRiskService::Client#compute_threat_list_diff.", + "file": "web_risk_service/compute_threat_list_diff.rb", + "language": "RUBY", + "client_method": { + "short_name": "compute_threat_list_diff", + "full_name": "::Google::Cloud::WebRisk::V1beta1::WebRiskService::Client#compute_threat_list_diff", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::WebRisk::V1beta1::ComputeThreatListDiffRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::WebRisk::V1beta1::ComputeThreatListDiffResponse", + "client": { + "short_name": "WebRiskService::Client", + "full_name": "::Google::Cloud::WebRisk::V1beta1::WebRiskService::Client" + }, + "method": { + "short_name": "ComputeThreatListDiff", + "full_name": "google.cloud.webrisk.v1beta1.WebRiskServiceV1Beta1.ComputeThreatListDiff", + "service": { + "short_name": "WebRiskService", + "full_name": "google.cloud.webrisk.v1beta1.WebRiskServiceV1Beta1" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "webrisk_v1beta1_generated_WebRiskService_SearchUris_sync", + "title": "Snippet for the search_uris call in the WebRiskService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::WebRisk::V1beta1::WebRiskService::Client#search_uris.", + "file": "web_risk_service/search_uris.rb", + "language": "RUBY", + "client_method": { + "short_name": "search_uris", + "full_name": "::Google::Cloud::WebRisk::V1beta1::WebRiskService::Client#search_uris", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::WebRisk::V1beta1::SearchUrisRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::WebRisk::V1beta1::SearchUrisResponse", + "client": { + "short_name": "WebRiskService::Client", + "full_name": "::Google::Cloud::WebRisk::V1beta1::WebRiskService::Client" + }, + "method": { + "short_name": "SearchUris", + "full_name": "google.cloud.webrisk.v1beta1.WebRiskServiceV1Beta1.SearchUris", + "service": { + "short_name": "WebRiskService", + "full_name": "google.cloud.webrisk.v1beta1.WebRiskServiceV1Beta1" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "webrisk_v1beta1_generated_WebRiskService_SearchHashes_sync", + "title": "Snippet for the search_hashes call in the WebRiskService service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::WebRisk::V1beta1::WebRiskService::Client#search_hashes.", + "file": "web_risk_service/search_hashes.rb", + "language": "RUBY", + "client_method": { + "short_name": "search_hashes", + "full_name": "::Google::Cloud::WebRisk::V1beta1::WebRiskService::Client#search_hashes", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::WebRisk::V1beta1::SearchHashesRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::WebRisk::V1beta1::SearchHashesResponse", + "client": { + "short_name": "WebRiskService::Client", + "full_name": "::Google::Cloud::WebRisk::V1beta1::WebRiskService::Client" + }, + "method": { + "short_name": "SearchHashes", + "full_name": "google.cloud.webrisk.v1beta1.WebRiskServiceV1Beta1.SearchHashes", + "service": { + "short_name": "WebRiskService", + "full_name": "google.cloud.webrisk.v1beta1.WebRiskServiceV1Beta1" + } + } + }, + "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-web_risk-v1beta1/snippets/web_risk_service/compute_threat_list_diff.rb b/owl-bot-staging/google-cloud-web_risk-v1beta1/snippets/web_risk_service/compute_threat_list_diff.rb new file mode 100644 index 000000000000..317d12f0e694 --- /dev/null +++ b/owl-bot-staging/google-cloud-web_risk-v1beta1/snippets/web_risk_service/compute_threat_list_diff.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 webrisk_v1beta1_generated_WebRiskService_ComputeThreatListDiff_sync] +require "google/cloud/web_risk/v1beta1" + +## +# Snippet for the compute_threat_list_diff call in the WebRiskService 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::WebRisk::V1beta1::WebRiskService::Client#compute_threat_list_diff. +# +def compute_threat_list_diff + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::WebRisk::V1beta1::WebRiskService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::WebRisk::V1beta1::ComputeThreatListDiffRequest.new + + # Call the compute_threat_list_diff method. + result = client.compute_threat_list_diff request + + # The returned object is of type Google::Cloud::WebRisk::V1beta1::ComputeThreatListDiffResponse. + p result +end +# [END webrisk_v1beta1_generated_WebRiskService_ComputeThreatListDiff_sync] diff --git a/owl-bot-staging/google-cloud-web_risk-v1beta1/snippets/web_risk_service/search_hashes.rb b/owl-bot-staging/google-cloud-web_risk-v1beta1/snippets/web_risk_service/search_hashes.rb new file mode 100644 index 000000000000..49e9992e8e2a --- /dev/null +++ b/owl-bot-staging/google-cloud-web_risk-v1beta1/snippets/web_risk_service/search_hashes.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 webrisk_v1beta1_generated_WebRiskService_SearchHashes_sync] +require "google/cloud/web_risk/v1beta1" + +## +# Snippet for the search_hashes call in the WebRiskService 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::WebRisk::V1beta1::WebRiskService::Client#search_hashes. +# +def search_hashes + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::WebRisk::V1beta1::WebRiskService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::WebRisk::V1beta1::SearchHashesRequest.new + + # Call the search_hashes method. + result = client.search_hashes request + + # The returned object is of type Google::Cloud::WebRisk::V1beta1::SearchHashesResponse. + p result +end +# [END webrisk_v1beta1_generated_WebRiskService_SearchHashes_sync] diff --git a/owl-bot-staging/google-cloud-web_risk-v1beta1/snippets/web_risk_service/search_uris.rb b/owl-bot-staging/google-cloud-web_risk-v1beta1/snippets/web_risk_service/search_uris.rb new file mode 100644 index 000000000000..096ea0fa663b --- /dev/null +++ b/owl-bot-staging/google-cloud-web_risk-v1beta1/snippets/web_risk_service/search_uris.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 webrisk_v1beta1_generated_WebRiskService_SearchUris_sync] +require "google/cloud/web_risk/v1beta1" + +## +# Snippet for the search_uris call in the WebRiskService 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::WebRisk::V1beta1::WebRiskService::Client#search_uris. +# +def search_uris + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::WebRisk::V1beta1::WebRiskService::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::WebRisk::V1beta1::SearchUrisRequest.new + + # Call the search_uris method. + result = client.search_uris request + + # The returned object is of type Google::Cloud::WebRisk::V1beta1::SearchUrisResponse. + p result +end +# [END webrisk_v1beta1_generated_WebRiskService_SearchUris_sync] diff --git a/owl-bot-staging/google-cloud-web_risk-v1beta1/test/google/cloud/web_risk/v1beta1/web_risk_service_rest_test.rb b/owl-bot-staging/google-cloud-web_risk-v1beta1/test/google/cloud/web_risk/v1beta1/web_risk_service_rest_test.rb new file mode 100644 index 000000000000..7c9f01b165dd --- /dev/null +++ b/owl-bot-staging/google-cloud-web_risk-v1beta1/test/google/cloud/web_risk/v1beta1/web_risk_service_rest_test.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 "helper" +require "gapic/rest" +require "google/cloud/webrisk/v1beta1/webrisk_pb" +require "google/cloud/web_risk/v1beta1/web_risk_service/rest" + + +class ::Google::Cloud::WebRisk::V1beta1::WebRiskService::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_compute_threat_list_diff + # Create test objects. + client_result = ::Google::Cloud::WebRisk::V1beta1::ComputeThreatListDiffResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + threat_type = :THREAT_TYPE_UNSPECIFIED + version_token = "hello world" + constraints = {} + + compute_threat_list_diff_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::WebRisk::V1beta1::WebRiskService::Rest::ServiceStub.stub :transcode_compute_threat_list_diff_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, compute_threat_list_diff_client_stub do + # Create client + client = ::Google::Cloud::WebRisk::V1beta1::WebRiskService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.compute_threat_list_diff({ threat_type: threat_type, version_token: version_token, constraints: constraints }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.compute_threat_list_diff threat_type: threat_type, version_token: version_token, constraints: constraints do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.compute_threat_list_diff ::Google::Cloud::WebRisk::V1beta1::ComputeThreatListDiffRequest.new(threat_type: threat_type, version_token: version_token, constraints: constraints) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.compute_threat_list_diff({ threat_type: threat_type, version_token: version_token, constraints: constraints }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.compute_threat_list_diff(::Google::Cloud::WebRisk::V1beta1::ComputeThreatListDiffRequest.new(threat_type: threat_type, version_token: version_token, constraints: constraints), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, compute_threat_list_diff_client_stub.call_count + end + end + end + + def test_search_uris + # Create test objects. + client_result = ::Google::Cloud::WebRisk::V1beta1::SearchUrisResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + uri = "hello world" + threat_types = [:THREAT_TYPE_UNSPECIFIED] + + search_uris_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::WebRisk::V1beta1::WebRiskService::Rest::ServiceStub.stub :transcode_search_uris_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, search_uris_client_stub do + # Create client + client = ::Google::Cloud::WebRisk::V1beta1::WebRiskService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.search_uris({ uri: uri, threat_types: threat_types }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.search_uris uri: uri, threat_types: threat_types do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.search_uris ::Google::Cloud::WebRisk::V1beta1::SearchUrisRequest.new(uri: uri, threat_types: threat_types) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.search_uris({ uri: uri, threat_types: threat_types }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.search_uris(::Google::Cloud::WebRisk::V1beta1::SearchUrisRequest.new(uri: uri, threat_types: threat_types), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, search_uris_client_stub.call_count + end + end + end + + def test_search_hashes + # Create test objects. + client_result = ::Google::Cloud::WebRisk::V1beta1::SearchHashesResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + hash_prefix = "hello world" + threat_types = [:THREAT_TYPE_UNSPECIFIED] + + search_hashes_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::WebRisk::V1beta1::WebRiskService::Rest::ServiceStub.stub :transcode_search_hashes_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, search_hashes_client_stub do + # Create client + client = ::Google::Cloud::WebRisk::V1beta1::WebRiskService::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.search_hashes({ hash_prefix: hash_prefix, threat_types: threat_types }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.search_hashes hash_prefix: hash_prefix, threat_types: threat_types do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.search_hashes ::Google::Cloud::WebRisk::V1beta1::SearchHashesRequest.new(hash_prefix: hash_prefix, threat_types: threat_types) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.search_hashes({ hash_prefix: hash_prefix, threat_types: threat_types }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.search_hashes(::Google::Cloud::WebRisk::V1beta1::SearchHashesRequest.new(hash_prefix: hash_prefix, threat_types: threat_types), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, search_hashes_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::WebRisk::V1beta1::WebRiskService::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::WebRisk::V1beta1::WebRiskService::Rest::Client::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-web_risk-v1beta1/test/google/cloud/web_risk/v1beta1/web_risk_service_test.rb b/owl-bot-staging/google-cloud-web_risk-v1beta1/test/google/cloud/web_risk/v1beta1/web_risk_service_test.rb new file mode 100644 index 000000000000..51da0e186f5b --- /dev/null +++ b/owl-bot-staging/google-cloud-web_risk-v1beta1/test/google/cloud/web_risk/v1beta1/web_risk_service_test.rb @@ -0,0 +1,286 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/webrisk/v1beta1/webrisk_pb" +require "google/cloud/web_risk/v1beta1/web_risk_service" + +class ::Google::Cloud::WebRisk::V1beta1::WebRiskService::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_compute_threat_list_diff + # Create GRPC objects. + grpc_response = ::Google::Cloud::WebRisk::V1beta1::ComputeThreatListDiffResponse.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. + threat_type = :THREAT_TYPE_UNSPECIFIED + version_token = "hello world" + constraints = {} + + compute_threat_list_diff_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :compute_threat_list_diff, name + assert_kind_of ::Google::Cloud::WebRisk::V1beta1::ComputeThreatListDiffRequest, request + assert_equal :THREAT_TYPE_UNSPECIFIED, request["threat_type"] + assert_equal "hello world", request["version_token"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::WebRisk::V1beta1::ComputeThreatListDiffRequest::Constraints), request["constraints"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, compute_threat_list_diff_client_stub do + # Create client + client = ::Google::Cloud::WebRisk::V1beta1::WebRiskService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.compute_threat_list_diff({ threat_type: threat_type, version_token: version_token, constraints: constraints }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.compute_threat_list_diff threat_type: threat_type, version_token: version_token, constraints: constraints do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.compute_threat_list_diff ::Google::Cloud::WebRisk::V1beta1::ComputeThreatListDiffRequest.new(threat_type: threat_type, version_token: version_token, constraints: constraints) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.compute_threat_list_diff({ threat_type: threat_type, version_token: version_token, constraints: constraints }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.compute_threat_list_diff(::Google::Cloud::WebRisk::V1beta1::ComputeThreatListDiffRequest.new(threat_type: threat_type, version_token: version_token, constraints: constraints), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, compute_threat_list_diff_client_stub.call_rpc_count + end + end + + def test_search_uris + # Create GRPC objects. + grpc_response = ::Google::Cloud::WebRisk::V1beta1::SearchUrisResponse.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. + uri = "hello world" + threat_types = [:THREAT_TYPE_UNSPECIFIED] + + search_uris_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :search_uris, name + assert_kind_of ::Google::Cloud::WebRisk::V1beta1::SearchUrisRequest, request + assert_equal "hello world", request["uri"] + assert_equal [:THREAT_TYPE_UNSPECIFIED], request["threat_types"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, search_uris_client_stub do + # Create client + client = ::Google::Cloud::WebRisk::V1beta1::WebRiskService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.search_uris({ uri: uri, threat_types: threat_types }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.search_uris uri: uri, threat_types: threat_types do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.search_uris ::Google::Cloud::WebRisk::V1beta1::SearchUrisRequest.new(uri: uri, threat_types: threat_types) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.search_uris({ uri: uri, threat_types: threat_types }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.search_uris(::Google::Cloud::WebRisk::V1beta1::SearchUrisRequest.new(uri: uri, threat_types: threat_types), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, search_uris_client_stub.call_rpc_count + end + end + + def test_search_hashes + # Create GRPC objects. + grpc_response = ::Google::Cloud::WebRisk::V1beta1::SearchHashesResponse.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. + hash_prefix = "hello world" + threat_types = [:THREAT_TYPE_UNSPECIFIED] + + search_hashes_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :search_hashes, name + assert_kind_of ::Google::Cloud::WebRisk::V1beta1::SearchHashesRequest, request + assert_equal "hello world", request["hash_prefix"] + assert_equal [:THREAT_TYPE_UNSPECIFIED], request["threat_types"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, search_hashes_client_stub do + # Create client + client = ::Google::Cloud::WebRisk::V1beta1::WebRiskService::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.search_hashes({ hash_prefix: hash_prefix, threat_types: threat_types }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.search_hashes hash_prefix: hash_prefix, threat_types: threat_types do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.search_hashes ::Google::Cloud::WebRisk::V1beta1::SearchHashesRequest.new(hash_prefix: hash_prefix, threat_types: threat_types) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.search_hashes({ hash_prefix: hash_prefix, threat_types: threat_types }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.search_hashes(::Google::Cloud::WebRisk::V1beta1::SearchHashesRequest.new(hash_prefix: hash_prefix, threat_types: threat_types), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, search_hashes_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::WebRisk::V1beta1::WebRiskService::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::WebRisk::V1beta1::WebRiskService::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::WebRisk::V1beta1::WebRiskService::Client.new do |config| + config.credentials = creds + end + assert_kind_of ::Google::Cloud::WebRisk::V1beta1::WebRiskService::Client, client + assert_equal creds, client.configure.credentials + end + end +end diff --git a/owl-bot-staging/google-cloud-web_risk-v1beta1/test/helper.rb b/owl-bot-staging/google-cloud-web_risk-v1beta1/test/helper.rb new file mode 100644 index 000000000000..672b337030e7 --- /dev/null +++ b/owl-bot-staging/google-cloud-web_risk-v1beta1/test/helper.rb @@ -0,0 +1,26 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/mock" +require "minitest/rg" + +require "grpc" + +require "ostruct" diff --git a/owl-bot-staging/google-cloud-web_security_scanner-v1/.gitignore b/owl-bot-staging/google-cloud-web_security_scanner-v1/.gitignore new file mode 100644 index 000000000000..0135b6bc6cfc --- /dev/null +++ b/owl-bot-staging/google-cloud-web_security_scanner-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-web_security_scanner-v1/.repo-metadata.json b/owl-bot-staging/google-cloud-web_security_scanner-v1/.repo-metadata.json new file mode 100644 index 000000000000..ff1da57a74a2 --- /dev/null +++ b/owl-bot-staging/google-cloud-web_security_scanner-v1/.repo-metadata.json @@ -0,0 +1,18 @@ +{ + "api_id": "websecurityscanner.googleapis.com", + "api_shortname": "websecurityscanner", + "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-web_security_scanner-v1/latest", + "distribution_name": "google-cloud-web_security_scanner-v1", + "is_cloud": true, + "language": "ruby", + "name": "websecurityscanner", + "name_pretty": "Web Security Scanner V1 API", + "product_documentation": "https://cloud.google.com/security-command-center/docs/concepts-web-security-scanner-overview/", + "release_level": "unreleased", + "repo": "googleapis/google-cloud-ruby", + "requires_billing": true, + "ruby-cloud-description": "Web Security Scanner scans your Compute and App Engine apps for common web vulnerabilities. Note that google-cloud-web_security_scanner-v1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-web_security_scanner instead. See the readme for more details.", + "ruby-cloud-env-prefix": "WEB_SECURITY_SCANNER", + "ruby-cloud-product-url": "https://cloud.google.com/security-command-center/docs/concepts-web-security-scanner-overview/", + "library_type": "GAPIC_AUTO" +} diff --git a/owl-bot-staging/google-cloud-web_security_scanner-v1/.rubocop.yml b/owl-bot-staging/google-cloud-web_security_scanner-v1/.rubocop.yml new file mode 100644 index 000000000000..d1aa57a60d61 --- /dev/null +++ b/owl-bot-staging/google-cloud-web_security_scanner-v1/.rubocop.yml @@ -0,0 +1,33 @@ +inherit_gem: + google-style: google-style.yml + +AllCops: + Exclude: + - "google-cloud-web_security_scanner-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-web_security_scanner-v1.rb" diff --git a/owl-bot-staging/google-cloud-web_security_scanner-v1/.toys.rb b/owl-bot-staging/google-cloud-web_security_scanner-v1/.toys.rb new file mode 100644 index 000000000000..177e22456e8a --- /dev/null +++ b/owl-bot-staging/google-cloud-web_security_scanner-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-web_security_scanner-v1/.yardopts b/owl-bot-staging/google-cloud-web_security_scanner-v1/.yardopts new file mode 100644 index 000000000000..826dfac587d4 --- /dev/null +++ b/owl-bot-staging/google-cloud-web_security_scanner-v1/.yardopts @@ -0,0 +1,12 @@ +--no-private +--title="Web Security Scanner 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-web_security_scanner-v1/AUTHENTICATION.md b/owl-bot-staging/google-cloud-web_security_scanner-v1/AUTHENTICATION.md new file mode 100644 index 000000000000..840d2d274ade --- /dev/null +++ b/owl-bot-staging/google-cloud-web_security_scanner-v1/AUTHENTICATION.md @@ -0,0 +1,122 @@ +# Authentication + +The recommended way to authenticate to the google-cloud-web_security_scanner-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-web_security_scanner-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/web_security_scanner/v1" + +client = ::Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client.new do |config| + config.credentials = "path/to/credentialfile.json" +end +``` + +To configure a credentials file globally for all clients: + +```ruby +require "google/cloud/web_security_scanner/v1" + +::Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client.configure do |config| + config.credentials = "path/to/credentialfile.json" +end + +client = ::Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::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-web_security_scanner-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/web_security_scanner/v1" + +ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" + +client = ::Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::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-web_security_scanner-v1/CHANGELOG.md b/owl-bot-staging/google-cloud-web_security_scanner-v1/CHANGELOG.md new file mode 100644 index 000000000000..f88957a62ba2 --- /dev/null +++ b/owl-bot-staging/google-cloud-web_security_scanner-v1/CHANGELOG.md @@ -0,0 +1,2 @@ +# Release History + diff --git a/owl-bot-staging/google-cloud-web_security_scanner-v1/Gemfile b/owl-bot-staging/google-cloud-web_security_scanner-v1/Gemfile new file mode 100644 index 000000000000..1d08558908d8 --- /dev/null +++ b/owl-bot-staging/google-cloud-web_security_scanner-v1/Gemfile @@ -0,0 +1,14 @@ +source "https://rubygems.org" + +gemspec + +gem "google-style", "~> 1.32.0" +gem "irb", "~> 1.17" +gem "minitest", "~> 6.0.2" +gem "minitest-focus", "~> 1.4" +gem "minitest-mock", "~> 5.27" +gem "minitest-rg", "~> 5.3" +gem "ostruct", "~> 0.5.5" +gem "rake", ">= 13.0" +gem "redcarpet", "~> 3.6" +gem "yard", "~> 0.9" diff --git a/owl-bot-staging/google-cloud-web_security_scanner-v1/LICENSE.md b/owl-bot-staging/google-cloud-web_security_scanner-v1/LICENSE.md new file mode 100644 index 000000000000..c261857ba6ad --- /dev/null +++ b/owl-bot-staging/google-cloud-web_security_scanner-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-web_security_scanner-v1/README.md b/owl-bot-staging/google-cloud-web_security_scanner-v1/README.md new file mode 100644 index 000000000000..58219b923452 --- /dev/null +++ b/owl-bot-staging/google-cloud-web_security_scanner-v1/README.md @@ -0,0 +1,154 @@ +# Ruby Client for the Web Security Scanner V1 API + +Scans your Compute and App Engine apps for common web vulnerabilities. + +Web Security Scanner scans your Compute and App Engine apps for common web vulnerabilities. + +https://github.com/googleapis/google-cloud-ruby + +This gem is a _versioned_ client. It provides basic client classes for a +specific version of the Web Security Scanner V1 API. Most users should consider using +the main client gem, +[google-cloud-web_security_scanner](https://rubygems.org/gems/google-cloud-web_security_scanner). +See the section below titled *Which client should I use?* for more information. + +## Installation + +``` +$ gem install google-cloud-web_security_scanner-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/websecurityscanner.googleapis.com) +1. [Set up authentication.](AUTHENTICATION.md) + +## Quick Start + +```ruby +require "google/cloud/web_security_scanner/v1" + +client = ::Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client.new +request = ::Google::Cloud::WebSecurityScanner::V1::CreateScanConfigRequest.new # (request fields as keyword arguments...) +response = client.create_scan_config request +``` + +View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-web_security_scanner-v1/latest) +for class and method documentation. + +See also the [Product Documentation](https://cloud.google.com/security-command-center/docs/concepts-web-security-scanner-overview/) +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/web_security_scanner/v1" +require "logger" + +client = ::Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::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-web_security_scanner`, +and lower-level _versioned_ client libraries with names such as +`google-cloud-web_security_scanner-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-web_security_scanner`. +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-web_security_scanner-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-web_security_scanner-v1/Rakefile b/owl-bot-staging/google-cloud-web_security_scanner-v1/Rakefile new file mode 100644 index 000000000000..4216b0dd6f74 --- /dev/null +++ b/owl-bot-staging/google-cloud-web_security_scanner-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-web_security_scanner-v1 acceptance tests." +task :acceptance, :project, :keyfile do |t, args| + project = args[:project] + project ||= + ENV["WEB_SECURITY_SCANNER_TEST_PROJECT"] || + ENV["GCLOUD_TEST_PROJECT"] + keyfile = args[:keyfile] + keyfile ||= + ENV["WEB_SECURITY_SCANNER_TEST_KEYFILE"] || + ENV["GCLOUD_TEST_KEYFILE"] + if keyfile + keyfile = File.read keyfile + else + keyfile ||= + ENV["WEB_SECURITY_SCANNER_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 WEB_SECURITY_SCANNER_TEST_PROJECT=test123 WEB_SECURITY_SCANNER_TEST_KEYFILE=/path/to/keyfile.json rake acceptance" + end + require "google/cloud/web_security_scanner/v1/web_security_scanner/credentials" + ::Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Credentials.env_vars.each do |path| + ENV[path] = nil + end + ENV["WEB_SECURITY_SCANNER_PROJECT"] = project + ENV["WEB_SECURITY_SCANNER_TEST_PROJECT"] = project + ENV["WEB_SECURITY_SCANNER_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-web_security_scanner-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-web_security_scanner-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-web_security_scanner-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-web_security_scanner-v1 gem does not have doctest tests." +end + +desc "Run the CI build" +task :ci do + header "BUILDING google-cloud-web_security_scanner-v1" + header "google-cloud-web_security_scanner-v1 rubocop", "*" + Rake::Task[:rubocop].invoke + header "google-cloud-web_security_scanner-v1 yard", "*" + Rake::Task[:yard].invoke + header "google-cloud-web_security_scanner-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-web_security_scanner-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-web_security_scanner-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-web_security_scanner-v1/gapic_metadata.json b/owl-bot-staging/google-cloud-web_security_scanner-v1/gapic_metadata.json new file mode 100644 index 000000000000..bc19a64a2036 --- /dev/null +++ b/owl-bot-staging/google-cloud-web_security_scanner-v1/gapic_metadata.json @@ -0,0 +1,83 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "ruby", + "protoPackage": "google.cloud.websecurityscanner.v1", + "libraryPackage": "::Google::Cloud::WebSecurityScanner::V1", + "services": { + "WebSecurityScanner": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client", + "rpcs": { + "CreateScanConfig": { + "methods": [ + "create_scan_config" + ] + }, + "DeleteScanConfig": { + "methods": [ + "delete_scan_config" + ] + }, + "GetScanConfig": { + "methods": [ + "get_scan_config" + ] + }, + "ListScanConfigs": { + "methods": [ + "list_scan_configs" + ] + }, + "UpdateScanConfig": { + "methods": [ + "update_scan_config" + ] + }, + "StartScanRun": { + "methods": [ + "start_scan_run" + ] + }, + "GetScanRun": { + "methods": [ + "get_scan_run" + ] + }, + "ListScanRuns": { + "methods": [ + "list_scan_runs" + ] + }, + "StopScanRun": { + "methods": [ + "stop_scan_run" + ] + }, + "ListCrawledUrls": { + "methods": [ + "list_crawled_urls" + ] + }, + "GetFinding": { + "methods": [ + "get_finding" + ] + }, + "ListFindings": { + "methods": [ + "list_findings" + ] + }, + "ListFindingTypeStats": { + "methods": [ + "list_finding_type_stats" + ] + } + } + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-web_security_scanner-v1/google-cloud-web_security_scanner-v1.gemspec b/owl-bot-staging/google-cloud-web_security_scanner-v1/google-cloud-web_security_scanner-v1.gemspec new file mode 100644 index 000000000000..6040a958dbd4 --- /dev/null +++ b/owl-bot-staging/google-cloud-web_security_scanner-v1/google-cloud-web_security_scanner-v1.gemspec @@ -0,0 +1,28 @@ +# -*- ruby -*- +# encoding: utf-8 + +require File.expand_path("lib/google/cloud/web_security_scanner/v1/version", __dir__) + +Gem::Specification.new do |gem| + gem.name = "google-cloud-web_security_scanner-v1" + gem.version = Google::Cloud::WebSecurityScanner::V1::VERSION + + gem.authors = ["Google LLC"] + gem.email = "googleapis-packages@google.com" + gem.description = "Web Security Scanner scans your Compute and App Engine apps for common web vulnerabilities. Note that google-cloud-web_security_scanner-v1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-web_security_scanner instead. See the readme for more details." + gem.summary = "Scans your Compute and App Engine apps for common web vulnerabilities." + 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.2" + + gem.add_dependency "gapic-common", "~> 1.2" + gem.add_dependency "google-cloud-errors", "~> 1.0" +end diff --git a/owl-bot-staging/google-cloud-web_security_scanner-v1/lib/google-cloud-web_security_scanner-v1.rb b/owl-bot-staging/google-cloud-web_security_scanner-v1/lib/google-cloud-web_security_scanner-v1.rb new file mode 100644 index 000000000000..364764ba9da8 --- /dev/null +++ b/owl-bot-staging/google-cloud-web_security_scanner-v1/lib/google-cloud-web_security_scanner-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/web_security_scanner/v1" diff --git a/owl-bot-staging/google-cloud-web_security_scanner-v1/lib/google/cloud/web_security_scanner/v1.rb b/owl-bot-staging/google-cloud-web_security_scanner-v1/lib/google/cloud/web_security_scanner/v1.rb new file mode 100644 index 000000000000..4ddf0087078f --- /dev/null +++ b/owl-bot-staging/google-cloud-web_security_scanner-v1/lib/google/cloud/web_security_scanner/v1.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/web_security_scanner/v1/web_security_scanner" +require "google/cloud/web_security_scanner/v1/version" + +module Google + module Cloud + module WebSecurityScanner + ## + # API client module. + # + # @example Load this package, including all its services, and instantiate a gRPC client + # + # require "google/cloud/web_security_scanner/v1" + # client = ::Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client.new + # + # @example Load this package, including all its services, and instantiate a REST client + # + # require "google/cloud/web_security_scanner/v1" + # client = ::Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Rest::Client.new + # + module V1 + end + end + end +end + +helper_path = ::File.join __dir__, "v1", "_helpers.rb" +require "google/cloud/web_security_scanner/v1/_helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-web_security_scanner-v1/lib/google/cloud/web_security_scanner/v1/rest.rb b/owl-bot-staging/google-cloud-web_security_scanner-v1/lib/google/cloud/web_security_scanner/v1/rest.rb new file mode 100644 index 000000000000..7b9965314561 --- /dev/null +++ b/owl-bot-staging/google-cloud-web_security_scanner-v1/lib/google/cloud/web_security_scanner/v1/rest.rb @@ -0,0 +1,37 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/web_security_scanner/v1/web_security_scanner/rest" +require "google/cloud/web_security_scanner/v1/version" + +module Google + module Cloud + module WebSecurityScanner + ## + # To load just the REST part of this package, including all its services, and instantiate a REST client: + # + # @example + # + # require "google/cloud/web_security_scanner/v1/rest" + # client = ::Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Rest::Client.new + # + module V1 + end + end + end +end diff --git a/owl-bot-staging/google-cloud-web_security_scanner-v1/lib/google/cloud/web_security_scanner/v1/version.rb b/owl-bot-staging/google-cloud-web_security_scanner-v1/lib/google/cloud/web_security_scanner/v1/version.rb new file mode 100644 index 000000000000..d7cb02f682fa --- /dev/null +++ b/owl-bot-staging/google-cloud-web_security_scanner-v1/lib/google/cloud/web_security_scanner/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 WebSecurityScanner + module V1 + VERSION = "0.0.1" + end + end + end +end diff --git a/owl-bot-staging/google-cloud-web_security_scanner-v1/lib/google/cloud/web_security_scanner/v1/web_security_scanner.rb b/owl-bot-staging/google-cloud-web_security_scanner-v1/lib/google/cloud/web_security_scanner/v1/web_security_scanner.rb new file mode 100644 index 000000000000..2f4a9b948057 --- /dev/null +++ b/owl-bot-staging/google-cloud-web_security_scanner-v1/lib/google/cloud/web_security_scanner/v1/web_security_scanner.rb @@ -0,0 +1,56 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/web_security_scanner/v1/version" + +require "google/cloud/web_security_scanner/v1/web_security_scanner/credentials" +require "google/cloud/web_security_scanner/v1/web_security_scanner/client" +require "google/cloud/web_security_scanner/v1/web_security_scanner/rest" + +module Google + module Cloud + module WebSecurityScanner + module V1 + ## + # Web Security Scanner Service identifies security vulnerabilities in web + # applications hosted on Google Cloud. It crawls your application, and + # attempts to exercise as many user inputs and event handlers as possible. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/web_security_scanner/v1/web_security_scanner" + # client = ::Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/web_security_scanner/v1/web_security_scanner/rest" + # client = ::Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Rest::Client.new + # + module WebSecurityScanner + end + end + end + end +end + +helper_path = ::File.join __dir__, "web_security_scanner", "helpers.rb" +require "google/cloud/web_security_scanner/v1/web_security_scanner/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-web_security_scanner-v1/lib/google/cloud/web_security_scanner/v1/web_security_scanner/client.rb b/owl-bot-staging/google-cloud-web_security_scanner-v1/lib/google/cloud/web_security_scanner/v1/web_security_scanner/client.rb new file mode 100644 index 000000000000..ff36744057f1 --- /dev/null +++ b/owl-bot-staging/google-cloud-web_security_scanner-v1/lib/google/cloud/web_security_scanner/v1/web_security_scanner/client.rb @@ -0,0 +1,1719 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/websecurityscanner/v1/web_security_scanner_pb" + +module Google + module Cloud + module WebSecurityScanner + module V1 + module WebSecurityScanner + ## + # Client for the WebSecurityScanner service. + # + # Web Security Scanner Service identifies security vulnerabilities in web + # applications hosted on Google Cloud. It crawls your application, and + # attempts to exercise as many user inputs and event handlers as possible. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "websecurityscanner.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :web_security_scanner_stub + + ## + # Configure the WebSecurityScanner Client class. + # + # See {::Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all WebSecurityScanner clients + # ::Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::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", "WebSecurityScanner", "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_scan_config.timeout = 600.0 + + default_config.rpcs.delete_scan_config.timeout = 600.0 + default_config.rpcs.delete_scan_config.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.get_scan_config.timeout = 600.0 + default_config.rpcs.get_scan_config.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.list_scan_configs.timeout = 600.0 + default_config.rpcs.list_scan_configs.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.update_scan_config.timeout = 600.0 + + default_config.rpcs.start_scan_run.timeout = 600.0 + + default_config.rpcs.get_scan_run.timeout = 600.0 + default_config.rpcs.get_scan_run.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.list_scan_runs.timeout = 600.0 + default_config.rpcs.list_scan_runs.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.stop_scan_run.timeout = 600.0 + + default_config.rpcs.list_crawled_urls.timeout = 600.0 + default_config.rpcs.list_crawled_urls.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.get_finding.timeout = 600.0 + default_config.rpcs.get_finding.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.list_findings.timeout = 600.0 + default_config.rpcs.list_findings.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.list_finding_type_stats.timeout = 600.0 + default_config.rpcs.list_finding_type_stats.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the WebSecurityScanner 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::WebSecurityScanner::V1::WebSecurityScanner::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 + @web_security_scanner_stub.universe_domain + end + + ## + # Create a new WebSecurityScanner client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the WebSecurityScanner 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/websecurityscanner/v1/web_security_scanner_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 + + @web_security_scanner_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::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 + ) + + @web_security_scanner_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 + end + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @web_security_scanner_stub.logger + end + + # Service calls + + ## + # Creates a new ScanConfig. + # + # @overload create_scan_config(request, options = nil) + # Pass arguments to `create_scan_config` via a request object, either of type + # {::Google::Cloud::WebSecurityScanner::V1::CreateScanConfigRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::WebSecurityScanner::V1::CreateScanConfigRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_scan_config(parent: nil, scan_config: nil) + # Pass arguments to `create_scan_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. The parent resource name where the scan is created, which should be a + # project resource name in the format 'projects/\\{projectId}'. + # @param scan_config [::Google::Cloud::WebSecurityScanner::V1::ScanConfig, ::Hash] + # Required. The ScanConfig to be created. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::WebSecurityScanner::V1::ScanConfig] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::WebSecurityScanner::V1::ScanConfig] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/web_security_scanner/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::WebSecurityScanner::V1::CreateScanConfigRequest.new + # + # # Call the create_scan_config method. + # result = client.create_scan_config request + # + # # The returned object is of type Google::Cloud::WebSecurityScanner::V1::ScanConfig. + # p result + # + def create_scan_config request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::WebSecurityScanner::V1::CreateScanConfigRequest + + # Converts hash 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_scan_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::WebSecurityScanner::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_scan_config.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_scan_config.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @web_security_scanner_stub.call_rpc :create_scan_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 + + ## + # Deletes an existing ScanConfig and its child resources. + # + # @overload delete_scan_config(request, options = nil) + # Pass arguments to `delete_scan_config` via a request object, either of type + # {::Google::Cloud::WebSecurityScanner::V1::DeleteScanConfigRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::WebSecurityScanner::V1::DeleteScanConfigRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_scan_config(name: nil) + # Pass arguments to `delete_scan_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 resource name of the ScanConfig to be deleted. The name follows the + # format of 'projects/\\{projectId}/scanConfigs/\\{scanConfigId}'. + # + # @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/web_security_scanner/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::WebSecurityScanner::V1::DeleteScanConfigRequest.new + # + # # Call the delete_scan_config method. + # result = client.delete_scan_config request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_scan_config request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::WebSecurityScanner::V1::DeleteScanConfigRequest + + # Converts hash 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_scan_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::WebSecurityScanner::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_scan_config.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_scan_config.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @web_security_scanner_stub.call_rpc :delete_scan_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 + + ## + # Gets a ScanConfig. + # + # @overload get_scan_config(request, options = nil) + # Pass arguments to `get_scan_config` via a request object, either of type + # {::Google::Cloud::WebSecurityScanner::V1::GetScanConfigRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::WebSecurityScanner::V1::GetScanConfigRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_scan_config(name: nil) + # Pass arguments to `get_scan_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 resource name of the ScanConfig to be returned. The name follows the + # format of 'projects/\\{projectId}/scanConfigs/\\{scanConfigId}'. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::WebSecurityScanner::V1::ScanConfig] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::WebSecurityScanner::V1::ScanConfig] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/web_security_scanner/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::WebSecurityScanner::V1::GetScanConfigRequest.new + # + # # Call the get_scan_config method. + # result = client.get_scan_config request + # + # # The returned object is of type Google::Cloud::WebSecurityScanner::V1::ScanConfig. + # p result + # + def get_scan_config request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::WebSecurityScanner::V1::GetScanConfigRequest + + # Converts hash 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_scan_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::WebSecurityScanner::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_scan_config.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_scan_config.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @web_security_scanner_stub.call_rpc :get_scan_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 + + ## + # Lists ScanConfigs under a given project. + # + # @overload list_scan_configs(request, options = nil) + # Pass arguments to `list_scan_configs` via a request object, either of type + # {::Google::Cloud::WebSecurityScanner::V1::ListScanConfigsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::WebSecurityScanner::V1::ListScanConfigsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_scan_configs(parent: nil, page_token: nil, page_size: nil) + # Pass arguments to `list_scan_configs` via keyword arguments. Note that at + # least one keyword argument is 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 parent resource name, which should be a project resource name in the + # format 'projects/\\{projectId}'. + # @param page_token [::String] + # A token identifying a page of results to be returned. This should be a + # `next_page_token` value returned from a previous List request. + # If unspecified, the first page of results is returned. + # @param page_size [::Integer] + # The maximum number of ScanConfigs to return, can be limited by server. + # If not specified or not positive, the implementation will select a + # reasonable value. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::WebSecurityScanner::V1::ScanConfig>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::WebSecurityScanner::V1::ScanConfig>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/web_security_scanner/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::WebSecurityScanner::V1::ListScanConfigsRequest.new + # + # # Call the list_scan_configs method. + # result = client.list_scan_configs 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::WebSecurityScanner::V1::ScanConfig. + # p item + # end + # + def list_scan_configs request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::WebSecurityScanner::V1::ListScanConfigsRequest + + # Converts hash 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_scan_configs.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::WebSecurityScanner::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_scan_configs.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_scan_configs.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @web_security_scanner_stub.call_rpc :list_scan_configs, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @web_security_scanner_stub, :list_scan_configs, 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 + + ## + # Updates a ScanConfig. This method support partial update of a ScanConfig. + # + # @overload update_scan_config(request, options = nil) + # Pass arguments to `update_scan_config` via a request object, either of type + # {::Google::Cloud::WebSecurityScanner::V1::UpdateScanConfigRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::WebSecurityScanner::V1::UpdateScanConfigRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_scan_config(scan_config: nil, update_mask: nil) + # Pass arguments to `update_scan_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 scan_config [::Google::Cloud::WebSecurityScanner::V1::ScanConfig, ::Hash] + # Required. The ScanConfig to be updated. The name field must be set to identify the + # resource to be updated. The values of fields not covered by the mask + # will be ignored. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. The update mask applies to the resource. For the `FieldMask` definition, + # see + # https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::WebSecurityScanner::V1::ScanConfig] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::WebSecurityScanner::V1::ScanConfig] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/web_security_scanner/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::WebSecurityScanner::V1::UpdateScanConfigRequest.new + # + # # Call the update_scan_config method. + # result = client.update_scan_config request + # + # # The returned object is of type Google::Cloud::WebSecurityScanner::V1::ScanConfig. + # p result + # + def update_scan_config request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::WebSecurityScanner::V1::UpdateScanConfigRequest + + # Converts hash 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_scan_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::WebSecurityScanner::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.scan_config&.name + header_params["scan_config.name"] = request.scan_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_scan_config.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_scan_config.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @web_security_scanner_stub.call_rpc :update_scan_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 + + ## + # Start a ScanRun according to the given ScanConfig. + # + # @overload start_scan_run(request, options = nil) + # Pass arguments to `start_scan_run` via a request object, either of type + # {::Google::Cloud::WebSecurityScanner::V1::StartScanRunRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::WebSecurityScanner::V1::StartScanRunRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload start_scan_run(name: nil) + # Pass arguments to `start_scan_run` via keyword arguments. Note that at + # least one keyword argument is 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 ScanConfig to be used. The name follows the + # format of 'projects/\\{projectId}/scanConfigs/\\{scanConfigId}'. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::WebSecurityScanner::V1::ScanRun] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::WebSecurityScanner::V1::ScanRun] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/web_security_scanner/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::WebSecurityScanner::V1::StartScanRunRequest.new + # + # # Call the start_scan_run method. + # result = client.start_scan_run request + # + # # The returned object is of type Google::Cloud::WebSecurityScanner::V1::ScanRun. + # p result + # + def start_scan_run request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::WebSecurityScanner::V1::StartScanRunRequest + + # Converts hash 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.start_scan_run.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::WebSecurityScanner::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.start_scan_run.timeout, + metadata: metadata, + retry_policy: @config.rpcs.start_scan_run.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @web_security_scanner_stub.call_rpc :start_scan_run, 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 + + ## + # Gets a ScanRun. + # + # @overload get_scan_run(request, options = nil) + # Pass arguments to `get_scan_run` via a request object, either of type + # {::Google::Cloud::WebSecurityScanner::V1::GetScanRunRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::WebSecurityScanner::V1::GetScanRunRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_scan_run(name: nil) + # Pass arguments to `get_scan_run` via keyword arguments. Note that at + # least one keyword argument is 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 ScanRun to be returned. The name follows the + # format of + # 'projects/\\{projectId}/scanConfigs/\\{scanConfigId}/scanRuns/\\{scanRunId}'. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::WebSecurityScanner::V1::ScanRun] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::WebSecurityScanner::V1::ScanRun] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/web_security_scanner/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::WebSecurityScanner::V1::GetScanRunRequest.new + # + # # Call the get_scan_run method. + # result = client.get_scan_run request + # + # # The returned object is of type Google::Cloud::WebSecurityScanner::V1::ScanRun. + # p result + # + def get_scan_run request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::WebSecurityScanner::V1::GetScanRunRequest + + # Converts hash 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_scan_run.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::WebSecurityScanner::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_scan_run.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_scan_run.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @web_security_scanner_stub.call_rpc :get_scan_run, 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 ScanRuns under a given ScanConfig, in descending order of ScanRun + # stop time. + # + # @overload list_scan_runs(request, options = nil) + # Pass arguments to `list_scan_runs` via a request object, either of type + # {::Google::Cloud::WebSecurityScanner::V1::ListScanRunsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::WebSecurityScanner::V1::ListScanRunsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_scan_runs(parent: nil, page_token: nil, page_size: nil) + # Pass arguments to `list_scan_runs` via keyword arguments. Note that at + # least one keyword argument is 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 parent resource name, which should be a scan resource name in the + # format 'projects/\\{projectId}/scanConfigs/\\{scanConfigId}'. + # @param page_token [::String] + # A token identifying a page of results to be returned. This should be a + # `next_page_token` value returned from a previous List request. + # If unspecified, the first page of results is returned. + # @param page_size [::Integer] + # The maximum number of ScanRuns to return, can be limited by server. + # If not specified or not positive, the implementation will select a + # reasonable value. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::WebSecurityScanner::V1::ScanRun>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::WebSecurityScanner::V1::ScanRun>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/web_security_scanner/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::WebSecurityScanner::V1::ListScanRunsRequest.new + # + # # Call the list_scan_runs method. + # result = client.list_scan_runs 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::WebSecurityScanner::V1::ScanRun. + # p item + # end + # + def list_scan_runs request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::WebSecurityScanner::V1::ListScanRunsRequest + + # Converts hash 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_scan_runs.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::WebSecurityScanner::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_scan_runs.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_scan_runs.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @web_security_scanner_stub.call_rpc :list_scan_runs, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @web_security_scanner_stub, :list_scan_runs, 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 + + ## + # Stops a ScanRun. The stopped ScanRun is returned. + # + # @overload stop_scan_run(request, options = nil) + # Pass arguments to `stop_scan_run` via a request object, either of type + # {::Google::Cloud::WebSecurityScanner::V1::StopScanRunRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::WebSecurityScanner::V1::StopScanRunRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload stop_scan_run(name: nil) + # Pass arguments to `stop_scan_run` via keyword arguments. Note that at + # least one keyword argument is 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 ScanRun to be stopped. The name follows the + # format of + # 'projects/\\{projectId}/scanConfigs/\\{scanConfigId}/scanRuns/\\{scanRunId}'. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::WebSecurityScanner::V1::ScanRun] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::WebSecurityScanner::V1::ScanRun] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/web_security_scanner/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::WebSecurityScanner::V1::StopScanRunRequest.new + # + # # Call the stop_scan_run method. + # result = client.stop_scan_run request + # + # # The returned object is of type Google::Cloud::WebSecurityScanner::V1::ScanRun. + # p result + # + def stop_scan_run request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::WebSecurityScanner::V1::StopScanRunRequest + + # Converts hash 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.stop_scan_run.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::WebSecurityScanner::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.stop_scan_run.timeout, + metadata: metadata, + retry_policy: @config.rpcs.stop_scan_run.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @web_security_scanner_stub.call_rpc :stop_scan_run, 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 + + ## + # List CrawledUrls under a given ScanRun. + # + # @overload list_crawled_urls(request, options = nil) + # Pass arguments to `list_crawled_urls` via a request object, either of type + # {::Google::Cloud::WebSecurityScanner::V1::ListCrawledUrlsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::WebSecurityScanner::V1::ListCrawledUrlsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_crawled_urls(parent: nil, page_token: nil, page_size: nil) + # Pass arguments to `list_crawled_urls` via keyword arguments. Note that at + # least one keyword argument is 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 parent resource name, which should be a scan run resource name in the + # format + # 'projects/\\{projectId}/scanConfigs/\\{scanConfigId}/scanRuns/\\{scanRunId}'. + # @param page_token [::String] + # A token identifying a page of results to be returned. This should be a + # `next_page_token` value returned from a previous List request. + # If unspecified, the first page of results is returned. + # @param page_size [::Integer] + # The maximum number of CrawledUrls to return, can be limited by server. + # If not specified or not positive, the implementation will select a + # reasonable value. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::WebSecurityScanner::V1::CrawledUrl>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::WebSecurityScanner::V1::CrawledUrl>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/web_security_scanner/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::WebSecurityScanner::V1::ListCrawledUrlsRequest.new + # + # # Call the list_crawled_urls method. + # result = client.list_crawled_urls 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::WebSecurityScanner::V1::CrawledUrl. + # p item + # end + # + def list_crawled_urls request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::WebSecurityScanner::V1::ListCrawledUrlsRequest + + # Converts hash 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_crawled_urls.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::WebSecurityScanner::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_crawled_urls.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_crawled_urls.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @web_security_scanner_stub.call_rpc :list_crawled_urls, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @web_security_scanner_stub, :list_crawled_urls, 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 + + ## + # Gets a Finding. + # + # @overload get_finding(request, options = nil) + # Pass arguments to `get_finding` via a request object, either of type + # {::Google::Cloud::WebSecurityScanner::V1::GetFindingRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::WebSecurityScanner::V1::GetFindingRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_finding(name: nil) + # Pass arguments to `get_finding` via keyword arguments. Note that at + # least one keyword argument is 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 Finding to be returned. The name follows the + # format of + # 'projects/\\{projectId}/scanConfigs/\\{scanConfigId}/scanRuns/\\{scanRunId}/findings/\\{findingId}'. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::WebSecurityScanner::V1::Finding] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::WebSecurityScanner::V1::Finding] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/web_security_scanner/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::WebSecurityScanner::V1::GetFindingRequest.new + # + # # Call the get_finding method. + # result = client.get_finding request + # + # # The returned object is of type Google::Cloud::WebSecurityScanner::V1::Finding. + # p result + # + def get_finding request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::WebSecurityScanner::V1::GetFindingRequest + + # Converts hash 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_finding.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::WebSecurityScanner::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_finding.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_finding.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @web_security_scanner_stub.call_rpc :get_finding, 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 + + ## + # List Findings under a given ScanRun. + # + # @overload list_findings(request, options = nil) + # Pass arguments to `list_findings` via a request object, either of type + # {::Google::Cloud::WebSecurityScanner::V1::ListFindingsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::WebSecurityScanner::V1::ListFindingsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_findings(parent: nil, filter: nil, page_token: nil, page_size: nil) + # Pass arguments to `list_findings` via keyword arguments. Note that at + # least one keyword argument is 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 parent resource name, which should be a scan run resource name in the + # format + # 'projects/\\{projectId}/scanConfigs/\\{scanConfigId}/scanRuns/\\{scanRunId}'. + # @param filter [::String] + # The filter expression. The expression must be in the format: + # . + # Supported field: 'finding_type'. + # Supported operator: '='. + # @param page_token [::String] + # A token identifying a page of results to be returned. This should be a + # `next_page_token` value returned from a previous List request. + # If unspecified, the first page of results is returned. + # @param page_size [::Integer] + # The maximum number of Findings to return, can be limited by server. + # If not specified or not positive, the implementation will select a + # reasonable value. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::WebSecurityScanner::V1::Finding>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::WebSecurityScanner::V1::Finding>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/web_security_scanner/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::WebSecurityScanner::V1::ListFindingsRequest.new + # + # # Call the list_findings method. + # result = client.list_findings 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::WebSecurityScanner::V1::Finding. + # p item + # end + # + def list_findings request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::WebSecurityScanner::V1::ListFindingsRequest + + # Converts hash 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_findings.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::WebSecurityScanner::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_findings.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_findings.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @web_security_scanner_stub.call_rpc :list_findings, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @web_security_scanner_stub, :list_findings, 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 + + ## + # List all FindingTypeStats under a given ScanRun. + # + # @overload list_finding_type_stats(request, options = nil) + # Pass arguments to `list_finding_type_stats` via a request object, either of type + # {::Google::Cloud::WebSecurityScanner::V1::ListFindingTypeStatsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::WebSecurityScanner::V1::ListFindingTypeStatsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_finding_type_stats(parent: nil) + # Pass arguments to `list_finding_type_stats` via keyword arguments. Note that at + # least one keyword argument is 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 parent resource name, which should be a scan run resource name in the + # format + # 'projects/\\{projectId}/scanConfigs/\\{scanConfigId}/scanRuns/\\{scanRunId}'. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::WebSecurityScanner::V1::ListFindingTypeStatsResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::WebSecurityScanner::V1::ListFindingTypeStatsResponse] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/web_security_scanner/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::WebSecurityScanner::V1::ListFindingTypeStatsRequest.new + # + # # Call the list_finding_type_stats method. + # result = client.list_finding_type_stats request + # + # # The returned object is of type Google::Cloud::WebSecurityScanner::V1::ListFindingTypeStatsResponse. + # p result + # + def list_finding_type_stats request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::WebSecurityScanner::V1::ListFindingTypeStatsRequest + + # Converts hash 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_finding_type_stats.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::WebSecurityScanner::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_finding_type_stats.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_finding_type_stats.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @web_security_scanner_stub.call_rpc :list_finding_type_stats, 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 WebSecurityScanner API. + # + # This class represents the configuration for WebSecurityScanner, + # 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::WebSecurityScanner::V1::WebSecurityScanner::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_scan_config to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.create_scan_config.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.create_scan_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::WebSecurityScanner::V1::WebSecurityScanner::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 = "websecurityscanner.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 WebSecurityScanner 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_scan_config` + # @return [::Gapic::Config::Method] + # + attr_reader :create_scan_config + ## + # RPC-specific configuration for `delete_scan_config` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_scan_config + ## + # RPC-specific configuration for `get_scan_config` + # @return [::Gapic::Config::Method] + # + attr_reader :get_scan_config + ## + # RPC-specific configuration for `list_scan_configs` + # @return [::Gapic::Config::Method] + # + attr_reader :list_scan_configs + ## + # RPC-specific configuration for `update_scan_config` + # @return [::Gapic::Config::Method] + # + attr_reader :update_scan_config + ## + # RPC-specific configuration for `start_scan_run` + # @return [::Gapic::Config::Method] + # + attr_reader :start_scan_run + ## + # RPC-specific configuration for `get_scan_run` + # @return [::Gapic::Config::Method] + # + attr_reader :get_scan_run + ## + # RPC-specific configuration for `list_scan_runs` + # @return [::Gapic::Config::Method] + # + attr_reader :list_scan_runs + ## + # RPC-specific configuration for `stop_scan_run` + # @return [::Gapic::Config::Method] + # + attr_reader :stop_scan_run + ## + # RPC-specific configuration for `list_crawled_urls` + # @return [::Gapic::Config::Method] + # + attr_reader :list_crawled_urls + ## + # RPC-specific configuration for `get_finding` + # @return [::Gapic::Config::Method] + # + attr_reader :get_finding + ## + # RPC-specific configuration for `list_findings` + # @return [::Gapic::Config::Method] + # + attr_reader :list_findings + ## + # RPC-specific configuration for `list_finding_type_stats` + # @return [::Gapic::Config::Method] + # + attr_reader :list_finding_type_stats + + # @private + def initialize parent_rpcs = nil + create_scan_config_config = parent_rpcs.create_scan_config if parent_rpcs.respond_to? :create_scan_config + @create_scan_config = ::Gapic::Config::Method.new create_scan_config_config + delete_scan_config_config = parent_rpcs.delete_scan_config if parent_rpcs.respond_to? :delete_scan_config + @delete_scan_config = ::Gapic::Config::Method.new delete_scan_config_config + get_scan_config_config = parent_rpcs.get_scan_config if parent_rpcs.respond_to? :get_scan_config + @get_scan_config = ::Gapic::Config::Method.new get_scan_config_config + list_scan_configs_config = parent_rpcs.list_scan_configs if parent_rpcs.respond_to? :list_scan_configs + @list_scan_configs = ::Gapic::Config::Method.new list_scan_configs_config + update_scan_config_config = parent_rpcs.update_scan_config if parent_rpcs.respond_to? :update_scan_config + @update_scan_config = ::Gapic::Config::Method.new update_scan_config_config + start_scan_run_config = parent_rpcs.start_scan_run if parent_rpcs.respond_to? :start_scan_run + @start_scan_run = ::Gapic::Config::Method.new start_scan_run_config + get_scan_run_config = parent_rpcs.get_scan_run if parent_rpcs.respond_to? :get_scan_run + @get_scan_run = ::Gapic::Config::Method.new get_scan_run_config + list_scan_runs_config = parent_rpcs.list_scan_runs if parent_rpcs.respond_to? :list_scan_runs + @list_scan_runs = ::Gapic::Config::Method.new list_scan_runs_config + stop_scan_run_config = parent_rpcs.stop_scan_run if parent_rpcs.respond_to? :stop_scan_run + @stop_scan_run = ::Gapic::Config::Method.new stop_scan_run_config + list_crawled_urls_config = parent_rpcs.list_crawled_urls if parent_rpcs.respond_to? :list_crawled_urls + @list_crawled_urls = ::Gapic::Config::Method.new list_crawled_urls_config + get_finding_config = parent_rpcs.get_finding if parent_rpcs.respond_to? :get_finding + @get_finding = ::Gapic::Config::Method.new get_finding_config + list_findings_config = parent_rpcs.list_findings if parent_rpcs.respond_to? :list_findings + @list_findings = ::Gapic::Config::Method.new list_findings_config + list_finding_type_stats_config = parent_rpcs.list_finding_type_stats if parent_rpcs.respond_to? :list_finding_type_stats + @list_finding_type_stats = ::Gapic::Config::Method.new list_finding_type_stats_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-web_security_scanner-v1/lib/google/cloud/web_security_scanner/v1/web_security_scanner/credentials.rb b/owl-bot-staging/google-cloud-web_security_scanner-v1/lib/google/cloud/web_security_scanner/v1/web_security_scanner/credentials.rb new file mode 100644 index 000000000000..2112c835a5a7 --- /dev/null +++ b/owl-bot-staging/google-cloud-web_security_scanner-v1/lib/google/cloud/web_security_scanner/v1/web_security_scanner/credentials.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! + +require "googleauth" + +module Google + module Cloud + module WebSecurityScanner + module V1 + module WebSecurityScanner + # Credentials for the WebSecurityScanner API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/cloud-platform" + ] + self.env_vars = [ + "WEB_SECURITY_SCANNER_CREDENTIALS", + "WEB_SECURITY_SCANNER_KEYFILE", + "GOOGLE_CLOUD_CREDENTIALS", + "GOOGLE_CLOUD_KEYFILE", + "GCLOUD_KEYFILE", + "WEB_SECURITY_SCANNER_CREDENTIALS_JSON", + "WEB_SECURITY_SCANNER_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-web_security_scanner-v1/lib/google/cloud/web_security_scanner/v1/web_security_scanner/rest.rb b/owl-bot-staging/google-cloud-web_security_scanner-v1/lib/google/cloud/web_security_scanner/v1/web_security_scanner/rest.rb new file mode 100644 index 000000000000..f23009d99847 --- /dev/null +++ b/owl-bot-staging/google-cloud-web_security_scanner-v1/lib/google/cloud/web_security_scanner/v1/web_security_scanner/rest.rb @@ -0,0 +1,53 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/web_security_scanner/v1/version" + +require "google/cloud/web_security_scanner/v1/web_security_scanner/credentials" +require "google/cloud/web_security_scanner/v1/web_security_scanner/rest/client" + +module Google + module Cloud + module WebSecurityScanner + module V1 + ## + # Web Security Scanner Service identifies security vulnerabilities in web + # applications hosted on Google Cloud. It crawls your application, and + # attempts to exercise as many user inputs and event handlers as possible. + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/web_security_scanner/v1/web_security_scanner/rest" + # client = ::Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Rest::Client.new + # + module WebSecurityScanner + # Client for the REST transport + module Rest + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "rest", "helpers.rb" +require "google/cloud/web_security_scanner/v1/web_security_scanner/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-web_security_scanner-v1/lib/google/cloud/web_security_scanner/v1/web_security_scanner/rest/client.rb b/owl-bot-staging/google-cloud-web_security_scanner-v1/lib/google/cloud/web_security_scanner/v1/web_security_scanner/rest/client.rb new file mode 100644 index 000000000000..34f66942801b --- /dev/null +++ b/owl-bot-staging/google-cloud-web_security_scanner-v1/lib/google/cloud/web_security_scanner/v1/web_security_scanner/rest/client.rb @@ -0,0 +1,1585 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/websecurityscanner/v1/web_security_scanner_pb" +require "google/cloud/web_security_scanner/v1/web_security_scanner/rest/service_stub" + +module Google + module Cloud + module WebSecurityScanner + module V1 + module WebSecurityScanner + module Rest + ## + # REST client for the WebSecurityScanner service. + # + # Web Security Scanner Service identifies security vulnerabilities in web + # applications hosted on Google Cloud. It crawls your application, and + # attempts to exercise as many user inputs and event handlers as possible. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "websecurityscanner.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :web_security_scanner_stub + + ## + # Configure the WebSecurityScanner Client class. + # + # See {::Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all WebSecurityScanner clients + # ::Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::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", "WebSecurityScanner", "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_scan_config.timeout = 600.0 + + default_config.rpcs.delete_scan_config.timeout = 600.0 + default_config.rpcs.delete_scan_config.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.get_scan_config.timeout = 600.0 + default_config.rpcs.get_scan_config.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.list_scan_configs.timeout = 600.0 + default_config.rpcs.list_scan_configs.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.update_scan_config.timeout = 600.0 + + default_config.rpcs.start_scan_run.timeout = 600.0 + + default_config.rpcs.get_scan_run.timeout = 600.0 + default_config.rpcs.get_scan_run.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.list_scan_runs.timeout = 600.0 + default_config.rpcs.list_scan_runs.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.stop_scan_run.timeout = 600.0 + + default_config.rpcs.list_crawled_urls.timeout = 600.0 + default_config.rpcs.list_crawled_urls.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.get_finding.timeout = 600.0 + default_config.rpcs.get_finding.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.list_findings.timeout = 600.0 + default_config.rpcs.list_findings.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.list_finding_type_stats.timeout = 600.0 + default_config.rpcs.list_finding_type_stats.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the WebSecurityScanner 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::WebSecurityScanner::V1::WebSecurityScanner::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 + @web_security_scanner_stub.universe_domain + end + + ## + # Create a new WebSecurityScanner REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the WebSecurityScanner 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 + + @web_security_scanner_stub = ::Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials, + logger: @config.logger + ) + + @web_security_scanner_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 + end + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @web_security_scanner_stub.logger + end + + # Service calls + + ## + # Creates a new ScanConfig. + # + # @overload create_scan_config(request, options = nil) + # Pass arguments to `create_scan_config` via a request object, either of type + # {::Google::Cloud::WebSecurityScanner::V1::CreateScanConfigRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::WebSecurityScanner::V1::CreateScanConfigRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_scan_config(parent: nil, scan_config: nil) + # Pass arguments to `create_scan_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. The parent resource name where the scan is created, which should be a + # project resource name in the format 'projects/\\{projectId}'. + # @param scan_config [::Google::Cloud::WebSecurityScanner::V1::ScanConfig, ::Hash] + # Required. The ScanConfig to be created. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::WebSecurityScanner::V1::ScanConfig] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::WebSecurityScanner::V1::ScanConfig] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/web_security_scanner/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::WebSecurityScanner::V1::CreateScanConfigRequest.new + # + # # Call the create_scan_config method. + # result = client.create_scan_config request + # + # # The returned object is of type Google::Cloud::WebSecurityScanner::V1::ScanConfig. + # p result + # + def create_scan_config request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::WebSecurityScanner::V1::CreateScanConfigRequest + + # Converts hash 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_scan_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::WebSecurityScanner::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_scan_config.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_scan_config.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @web_security_scanner_stub.create_scan_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 + + ## + # Deletes an existing ScanConfig and its child resources. + # + # @overload delete_scan_config(request, options = nil) + # Pass arguments to `delete_scan_config` via a request object, either of type + # {::Google::Cloud::WebSecurityScanner::V1::DeleteScanConfigRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::WebSecurityScanner::V1::DeleteScanConfigRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_scan_config(name: nil) + # Pass arguments to `delete_scan_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 resource name of the ScanConfig to be deleted. The name follows the + # format of 'projects/\\{projectId}/scanConfigs/\\{scanConfigId}'. + # @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/web_security_scanner/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::WebSecurityScanner::V1::DeleteScanConfigRequest.new + # + # # Call the delete_scan_config method. + # result = client.delete_scan_config request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_scan_config request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::WebSecurityScanner::V1::DeleteScanConfigRequest + + # Converts hash 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_scan_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::WebSecurityScanner::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_scan_config.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_scan_config.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @web_security_scanner_stub.delete_scan_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 + + ## + # Gets a ScanConfig. + # + # @overload get_scan_config(request, options = nil) + # Pass arguments to `get_scan_config` via a request object, either of type + # {::Google::Cloud::WebSecurityScanner::V1::GetScanConfigRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::WebSecurityScanner::V1::GetScanConfigRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_scan_config(name: nil) + # Pass arguments to `get_scan_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 resource name of the ScanConfig to be returned. The name follows the + # format of 'projects/\\{projectId}/scanConfigs/\\{scanConfigId}'. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::WebSecurityScanner::V1::ScanConfig] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::WebSecurityScanner::V1::ScanConfig] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/web_security_scanner/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::WebSecurityScanner::V1::GetScanConfigRequest.new + # + # # Call the get_scan_config method. + # result = client.get_scan_config request + # + # # The returned object is of type Google::Cloud::WebSecurityScanner::V1::ScanConfig. + # p result + # + def get_scan_config request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::WebSecurityScanner::V1::GetScanConfigRequest + + # Converts hash 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_scan_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::WebSecurityScanner::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_scan_config.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_scan_config.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @web_security_scanner_stub.get_scan_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 + + ## + # Lists ScanConfigs under a given project. + # + # @overload list_scan_configs(request, options = nil) + # Pass arguments to `list_scan_configs` via a request object, either of type + # {::Google::Cloud::WebSecurityScanner::V1::ListScanConfigsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::WebSecurityScanner::V1::ListScanConfigsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_scan_configs(parent: nil, page_token: nil, page_size: nil) + # Pass arguments to `list_scan_configs` via keyword arguments. Note that at + # least one keyword argument is 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 parent resource name, which should be a project resource name in the + # format 'projects/\\{projectId}'. + # @param page_token [::String] + # A token identifying a page of results to be returned. This should be a + # `next_page_token` value returned from a previous List request. + # If unspecified, the first page of results is returned. + # @param page_size [::Integer] + # The maximum number of ScanConfigs to return, can be limited by server. + # If not specified or not positive, the implementation will select a + # reasonable value. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::WebSecurityScanner::V1::ScanConfig>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::WebSecurityScanner::V1::ScanConfig>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/web_security_scanner/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::WebSecurityScanner::V1::ListScanConfigsRequest.new + # + # # Call the list_scan_configs method. + # result = client.list_scan_configs 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::WebSecurityScanner::V1::ScanConfig. + # p item + # end + # + def list_scan_configs request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::WebSecurityScanner::V1::ListScanConfigsRequest + + # Converts hash 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_scan_configs.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::WebSecurityScanner::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_scan_configs.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_scan_configs.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @web_security_scanner_stub.list_scan_configs request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @web_security_scanner_stub, :list_scan_configs, "scan_configs", 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 + + ## + # Updates a ScanConfig. This method support partial update of a ScanConfig. + # + # @overload update_scan_config(request, options = nil) + # Pass arguments to `update_scan_config` via a request object, either of type + # {::Google::Cloud::WebSecurityScanner::V1::UpdateScanConfigRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::WebSecurityScanner::V1::UpdateScanConfigRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_scan_config(scan_config: nil, update_mask: nil) + # Pass arguments to `update_scan_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 scan_config [::Google::Cloud::WebSecurityScanner::V1::ScanConfig, ::Hash] + # Required. The ScanConfig to be updated. The name field must be set to identify the + # resource to be updated. The values of fields not covered by the mask + # will be ignored. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. The update mask applies to the resource. For the `FieldMask` definition, + # see + # https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::WebSecurityScanner::V1::ScanConfig] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::WebSecurityScanner::V1::ScanConfig] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/web_security_scanner/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::WebSecurityScanner::V1::UpdateScanConfigRequest.new + # + # # Call the update_scan_config method. + # result = client.update_scan_config request + # + # # The returned object is of type Google::Cloud::WebSecurityScanner::V1::ScanConfig. + # p result + # + def update_scan_config request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::WebSecurityScanner::V1::UpdateScanConfigRequest + + # Converts hash 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_scan_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::WebSecurityScanner::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_scan_config.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_scan_config.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @web_security_scanner_stub.update_scan_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 + + ## + # Start a ScanRun according to the given ScanConfig. + # + # @overload start_scan_run(request, options = nil) + # Pass arguments to `start_scan_run` via a request object, either of type + # {::Google::Cloud::WebSecurityScanner::V1::StartScanRunRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::WebSecurityScanner::V1::StartScanRunRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload start_scan_run(name: nil) + # Pass arguments to `start_scan_run` via keyword arguments. Note that at + # least one keyword argument is 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 ScanConfig to be used. The name follows the + # format of 'projects/\\{projectId}/scanConfigs/\\{scanConfigId}'. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::WebSecurityScanner::V1::ScanRun] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::WebSecurityScanner::V1::ScanRun] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/web_security_scanner/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::WebSecurityScanner::V1::StartScanRunRequest.new + # + # # Call the start_scan_run method. + # result = client.start_scan_run request + # + # # The returned object is of type Google::Cloud::WebSecurityScanner::V1::ScanRun. + # p result + # + def start_scan_run request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::WebSecurityScanner::V1::StartScanRunRequest + + # Converts hash 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.start_scan_run.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::WebSecurityScanner::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.start_scan_run.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.start_scan_run.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @web_security_scanner_stub.start_scan_run 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 + + ## + # Gets a ScanRun. + # + # @overload get_scan_run(request, options = nil) + # Pass arguments to `get_scan_run` via a request object, either of type + # {::Google::Cloud::WebSecurityScanner::V1::GetScanRunRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::WebSecurityScanner::V1::GetScanRunRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_scan_run(name: nil) + # Pass arguments to `get_scan_run` via keyword arguments. Note that at + # least one keyword argument is 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 ScanRun to be returned. The name follows the + # format of + # 'projects/\\{projectId}/scanConfigs/\\{scanConfigId}/scanRuns/\\{scanRunId}'. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::WebSecurityScanner::V1::ScanRun] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::WebSecurityScanner::V1::ScanRun] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/web_security_scanner/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::WebSecurityScanner::V1::GetScanRunRequest.new + # + # # Call the get_scan_run method. + # result = client.get_scan_run request + # + # # The returned object is of type Google::Cloud::WebSecurityScanner::V1::ScanRun. + # p result + # + def get_scan_run request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::WebSecurityScanner::V1::GetScanRunRequest + + # Converts hash 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_scan_run.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::WebSecurityScanner::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_scan_run.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_scan_run.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @web_security_scanner_stub.get_scan_run 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 ScanRuns under a given ScanConfig, in descending order of ScanRun + # stop time. + # + # @overload list_scan_runs(request, options = nil) + # Pass arguments to `list_scan_runs` via a request object, either of type + # {::Google::Cloud::WebSecurityScanner::V1::ListScanRunsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::WebSecurityScanner::V1::ListScanRunsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_scan_runs(parent: nil, page_token: nil, page_size: nil) + # Pass arguments to `list_scan_runs` via keyword arguments. Note that at + # least one keyword argument is 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 parent resource name, which should be a scan resource name in the + # format 'projects/\\{projectId}/scanConfigs/\\{scanConfigId}'. + # @param page_token [::String] + # A token identifying a page of results to be returned. This should be a + # `next_page_token` value returned from a previous List request. + # If unspecified, the first page of results is returned. + # @param page_size [::Integer] + # The maximum number of ScanRuns to return, can be limited by server. + # If not specified or not positive, the implementation will select a + # reasonable value. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::WebSecurityScanner::V1::ScanRun>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::WebSecurityScanner::V1::ScanRun>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/web_security_scanner/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::WebSecurityScanner::V1::ListScanRunsRequest.new + # + # # Call the list_scan_runs method. + # result = client.list_scan_runs 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::WebSecurityScanner::V1::ScanRun. + # p item + # end + # + def list_scan_runs request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::WebSecurityScanner::V1::ListScanRunsRequest + + # Converts hash 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_scan_runs.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::WebSecurityScanner::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_scan_runs.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_scan_runs.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @web_security_scanner_stub.list_scan_runs request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @web_security_scanner_stub, :list_scan_runs, "scan_runs", 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 + + ## + # Stops a ScanRun. The stopped ScanRun is returned. + # + # @overload stop_scan_run(request, options = nil) + # Pass arguments to `stop_scan_run` via a request object, either of type + # {::Google::Cloud::WebSecurityScanner::V1::StopScanRunRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::WebSecurityScanner::V1::StopScanRunRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload stop_scan_run(name: nil) + # Pass arguments to `stop_scan_run` via keyword arguments. Note that at + # least one keyword argument is 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 ScanRun to be stopped. The name follows the + # format of + # 'projects/\\{projectId}/scanConfigs/\\{scanConfigId}/scanRuns/\\{scanRunId}'. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::WebSecurityScanner::V1::ScanRun] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::WebSecurityScanner::V1::ScanRun] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/web_security_scanner/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::WebSecurityScanner::V1::StopScanRunRequest.new + # + # # Call the stop_scan_run method. + # result = client.stop_scan_run request + # + # # The returned object is of type Google::Cloud::WebSecurityScanner::V1::ScanRun. + # p result + # + def stop_scan_run request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::WebSecurityScanner::V1::StopScanRunRequest + + # Converts hash 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.stop_scan_run.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::WebSecurityScanner::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.stop_scan_run.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.stop_scan_run.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @web_security_scanner_stub.stop_scan_run 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 + + ## + # List CrawledUrls under a given ScanRun. + # + # @overload list_crawled_urls(request, options = nil) + # Pass arguments to `list_crawled_urls` via a request object, either of type + # {::Google::Cloud::WebSecurityScanner::V1::ListCrawledUrlsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::WebSecurityScanner::V1::ListCrawledUrlsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_crawled_urls(parent: nil, page_token: nil, page_size: nil) + # Pass arguments to `list_crawled_urls` via keyword arguments. Note that at + # least one keyword argument is 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 parent resource name, which should be a scan run resource name in the + # format + # 'projects/\\{projectId}/scanConfigs/\\{scanConfigId}/scanRuns/\\{scanRunId}'. + # @param page_token [::String] + # A token identifying a page of results to be returned. This should be a + # `next_page_token` value returned from a previous List request. + # If unspecified, the first page of results is returned. + # @param page_size [::Integer] + # The maximum number of CrawledUrls to return, can be limited by server. + # If not specified or not positive, the implementation will select a + # reasonable value. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::WebSecurityScanner::V1::CrawledUrl>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::WebSecurityScanner::V1::CrawledUrl>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/web_security_scanner/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::WebSecurityScanner::V1::ListCrawledUrlsRequest.new + # + # # Call the list_crawled_urls method. + # result = client.list_crawled_urls 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::WebSecurityScanner::V1::CrawledUrl. + # p item + # end + # + def list_crawled_urls request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::WebSecurityScanner::V1::ListCrawledUrlsRequest + + # Converts hash 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_crawled_urls.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::WebSecurityScanner::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_crawled_urls.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_crawled_urls.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @web_security_scanner_stub.list_crawled_urls request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @web_security_scanner_stub, :list_crawled_urls, "crawled_urls", 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 a Finding. + # + # @overload get_finding(request, options = nil) + # Pass arguments to `get_finding` via a request object, either of type + # {::Google::Cloud::WebSecurityScanner::V1::GetFindingRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::WebSecurityScanner::V1::GetFindingRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_finding(name: nil) + # Pass arguments to `get_finding` via keyword arguments. Note that at + # least one keyword argument is 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 Finding to be returned. The name follows the + # format of + # 'projects/\\{projectId}/scanConfigs/\\{scanConfigId}/scanRuns/\\{scanRunId}/findings/\\{findingId}'. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::WebSecurityScanner::V1::Finding] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::WebSecurityScanner::V1::Finding] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/web_security_scanner/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::WebSecurityScanner::V1::GetFindingRequest.new + # + # # Call the get_finding method. + # result = client.get_finding request + # + # # The returned object is of type Google::Cloud::WebSecurityScanner::V1::Finding. + # p result + # + def get_finding request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::WebSecurityScanner::V1::GetFindingRequest + + # Converts hash 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_finding.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::WebSecurityScanner::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_finding.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_finding.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @web_security_scanner_stub.get_finding 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 + + ## + # List Findings under a given ScanRun. + # + # @overload list_findings(request, options = nil) + # Pass arguments to `list_findings` via a request object, either of type + # {::Google::Cloud::WebSecurityScanner::V1::ListFindingsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::WebSecurityScanner::V1::ListFindingsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_findings(parent: nil, filter: nil, page_token: nil, page_size: nil) + # Pass arguments to `list_findings` via keyword arguments. Note that at + # least one keyword argument is 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 parent resource name, which should be a scan run resource name in the + # format + # 'projects/\\{projectId}/scanConfigs/\\{scanConfigId}/scanRuns/\\{scanRunId}'. + # @param filter [::String] + # The filter expression. The expression must be in the format: + # . + # Supported field: 'finding_type'. + # Supported operator: '='. + # @param page_token [::String] + # A token identifying a page of results to be returned. This should be a + # `next_page_token` value returned from a previous List request. + # If unspecified, the first page of results is returned. + # @param page_size [::Integer] + # The maximum number of Findings to return, can be limited by server. + # If not specified or not positive, the implementation will select a + # reasonable value. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::WebSecurityScanner::V1::Finding>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::WebSecurityScanner::V1::Finding>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/web_security_scanner/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::WebSecurityScanner::V1::ListFindingsRequest.new + # + # # Call the list_findings method. + # result = client.list_findings 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::WebSecurityScanner::V1::Finding. + # p item + # end + # + def list_findings request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::WebSecurityScanner::V1::ListFindingsRequest + + # Converts hash 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_findings.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::WebSecurityScanner::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_findings.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_findings.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @web_security_scanner_stub.list_findings request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @web_security_scanner_stub, :list_findings, "findings", 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 + + ## + # List all FindingTypeStats under a given ScanRun. + # + # @overload list_finding_type_stats(request, options = nil) + # Pass arguments to `list_finding_type_stats` via a request object, either of type + # {::Google::Cloud::WebSecurityScanner::V1::ListFindingTypeStatsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::WebSecurityScanner::V1::ListFindingTypeStatsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_finding_type_stats(parent: nil) + # Pass arguments to `list_finding_type_stats` via keyword arguments. Note that at + # least one keyword argument is 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 parent resource name, which should be a scan run resource name in the + # format + # 'projects/\\{projectId}/scanConfigs/\\{scanConfigId}/scanRuns/\\{scanRunId}'. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::WebSecurityScanner::V1::ListFindingTypeStatsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::WebSecurityScanner::V1::ListFindingTypeStatsResponse] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/web_security_scanner/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::WebSecurityScanner::V1::ListFindingTypeStatsRequest.new + # + # # Call the list_finding_type_stats method. + # result = client.list_finding_type_stats request + # + # # The returned object is of type Google::Cloud::WebSecurityScanner::V1::ListFindingTypeStatsResponse. + # p result + # + def list_finding_type_stats request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::WebSecurityScanner::V1::ListFindingTypeStatsRequest + + # Converts hash 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_finding_type_stats.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::WebSecurityScanner::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_finding_type_stats.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_finding_type_stats.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @web_security_scanner_stub.list_finding_type_stats 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 WebSecurityScanner REST API. + # + # This class represents the configuration for WebSecurityScanner 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::WebSecurityScanner::V1::WebSecurityScanner::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_scan_config to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.create_scan_config.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.create_scan_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 = "websecurityscanner.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 WebSecurityScanner 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_scan_config` + # @return [::Gapic::Config::Method] + # + attr_reader :create_scan_config + ## + # RPC-specific configuration for `delete_scan_config` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_scan_config + ## + # RPC-specific configuration for `get_scan_config` + # @return [::Gapic::Config::Method] + # + attr_reader :get_scan_config + ## + # RPC-specific configuration for `list_scan_configs` + # @return [::Gapic::Config::Method] + # + attr_reader :list_scan_configs + ## + # RPC-specific configuration for `update_scan_config` + # @return [::Gapic::Config::Method] + # + attr_reader :update_scan_config + ## + # RPC-specific configuration for `start_scan_run` + # @return [::Gapic::Config::Method] + # + attr_reader :start_scan_run + ## + # RPC-specific configuration for `get_scan_run` + # @return [::Gapic::Config::Method] + # + attr_reader :get_scan_run + ## + # RPC-specific configuration for `list_scan_runs` + # @return [::Gapic::Config::Method] + # + attr_reader :list_scan_runs + ## + # RPC-specific configuration for `stop_scan_run` + # @return [::Gapic::Config::Method] + # + attr_reader :stop_scan_run + ## + # RPC-specific configuration for `list_crawled_urls` + # @return [::Gapic::Config::Method] + # + attr_reader :list_crawled_urls + ## + # RPC-specific configuration for `get_finding` + # @return [::Gapic::Config::Method] + # + attr_reader :get_finding + ## + # RPC-specific configuration for `list_findings` + # @return [::Gapic::Config::Method] + # + attr_reader :list_findings + ## + # RPC-specific configuration for `list_finding_type_stats` + # @return [::Gapic::Config::Method] + # + attr_reader :list_finding_type_stats + + # @private + def initialize parent_rpcs = nil + create_scan_config_config = parent_rpcs.create_scan_config if parent_rpcs.respond_to? :create_scan_config + @create_scan_config = ::Gapic::Config::Method.new create_scan_config_config + delete_scan_config_config = parent_rpcs.delete_scan_config if parent_rpcs.respond_to? :delete_scan_config + @delete_scan_config = ::Gapic::Config::Method.new delete_scan_config_config + get_scan_config_config = parent_rpcs.get_scan_config if parent_rpcs.respond_to? :get_scan_config + @get_scan_config = ::Gapic::Config::Method.new get_scan_config_config + list_scan_configs_config = parent_rpcs.list_scan_configs if parent_rpcs.respond_to? :list_scan_configs + @list_scan_configs = ::Gapic::Config::Method.new list_scan_configs_config + update_scan_config_config = parent_rpcs.update_scan_config if parent_rpcs.respond_to? :update_scan_config + @update_scan_config = ::Gapic::Config::Method.new update_scan_config_config + start_scan_run_config = parent_rpcs.start_scan_run if parent_rpcs.respond_to? :start_scan_run + @start_scan_run = ::Gapic::Config::Method.new start_scan_run_config + get_scan_run_config = parent_rpcs.get_scan_run if parent_rpcs.respond_to? :get_scan_run + @get_scan_run = ::Gapic::Config::Method.new get_scan_run_config + list_scan_runs_config = parent_rpcs.list_scan_runs if parent_rpcs.respond_to? :list_scan_runs + @list_scan_runs = ::Gapic::Config::Method.new list_scan_runs_config + stop_scan_run_config = parent_rpcs.stop_scan_run if parent_rpcs.respond_to? :stop_scan_run + @stop_scan_run = ::Gapic::Config::Method.new stop_scan_run_config + list_crawled_urls_config = parent_rpcs.list_crawled_urls if parent_rpcs.respond_to? :list_crawled_urls + @list_crawled_urls = ::Gapic::Config::Method.new list_crawled_urls_config + get_finding_config = parent_rpcs.get_finding if parent_rpcs.respond_to? :get_finding + @get_finding = ::Gapic::Config::Method.new get_finding_config + list_findings_config = parent_rpcs.list_findings if parent_rpcs.respond_to? :list_findings + @list_findings = ::Gapic::Config::Method.new list_findings_config + list_finding_type_stats_config = parent_rpcs.list_finding_type_stats if parent_rpcs.respond_to? :list_finding_type_stats + @list_finding_type_stats = ::Gapic::Config::Method.new list_finding_type_stats_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-web_security_scanner-v1/lib/google/cloud/web_security_scanner/v1/web_security_scanner/rest/service_stub.rb b/owl-bot-staging/google-cloud-web_security_scanner-v1/lib/google/cloud/web_security_scanner/v1/web_security_scanner/rest/service_stub.rb new file mode 100644 index 000000000000..e6edf6a664f0 --- /dev/null +++ b/owl-bot-staging/google-cloud-web_security_scanner-v1/lib/google/cloud/web_security_scanner/v1/web_security_scanner/rest/service_stub.rb @@ -0,0 +1,878 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/websecurityscanner/v1/web_security_scanner_pb" + +module Google + module Cloud + module WebSecurityScanner + module V1 + module WebSecurityScanner + module Rest + ## + # REST service stub for the WebSecurityScanner 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_scan_config REST call + # + # @param request_pb [::Google::Cloud::WebSecurityScanner::V1::CreateScanConfigRequest] + # 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::WebSecurityScanner::V1::ScanConfig] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::WebSecurityScanner::V1::ScanConfig] + # A result object deserialized from the server's reply + def create_scan_config request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_scan_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: "create_scan_config", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::WebSecurityScanner::V1::ScanConfig.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_scan_config REST call + # + # @param request_pb [::Google::Cloud::WebSecurityScanner::V1::DeleteScanConfigRequest] + # 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_scan_config request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_scan_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: "delete_scan_config", + 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 get_scan_config REST call + # + # @param request_pb [::Google::Cloud::WebSecurityScanner::V1::GetScanConfigRequest] + # 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::WebSecurityScanner::V1::ScanConfig] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::WebSecurityScanner::V1::ScanConfig] + # A result object deserialized from the server's reply + def get_scan_config request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_scan_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_scan_config", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::WebSecurityScanner::V1::ScanConfig.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_scan_configs REST call + # + # @param request_pb [::Google::Cloud::WebSecurityScanner::V1::ListScanConfigsRequest] + # 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::WebSecurityScanner::V1::ListScanConfigsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::WebSecurityScanner::V1::ListScanConfigsResponse] + # A result object deserialized from the server's reply + def list_scan_configs request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_scan_configs_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_scan_configs", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::WebSecurityScanner::V1::ListScanConfigsResponse.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_scan_config REST call + # + # @param request_pb [::Google::Cloud::WebSecurityScanner::V1::UpdateScanConfigRequest] + # 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::WebSecurityScanner::V1::ScanConfig] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::WebSecurityScanner::V1::ScanConfig] + # A result object deserialized from the server's reply + def update_scan_config request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_scan_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_scan_config", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::WebSecurityScanner::V1::ScanConfig.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the start_scan_run REST call + # + # @param request_pb [::Google::Cloud::WebSecurityScanner::V1::StartScanRunRequest] + # 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::WebSecurityScanner::V1::ScanRun] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::WebSecurityScanner::V1::ScanRun] + # A result object deserialized from the server's reply + def start_scan_run request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_start_scan_run_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: "start_scan_run", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::WebSecurityScanner::V1::ScanRun.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_scan_run REST call + # + # @param request_pb [::Google::Cloud::WebSecurityScanner::V1::GetScanRunRequest] + # 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::WebSecurityScanner::V1::ScanRun] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::WebSecurityScanner::V1::ScanRun] + # A result object deserialized from the server's reply + def get_scan_run request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_scan_run_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_scan_run", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::WebSecurityScanner::V1::ScanRun.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_scan_runs REST call + # + # @param request_pb [::Google::Cloud::WebSecurityScanner::V1::ListScanRunsRequest] + # 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::WebSecurityScanner::V1::ListScanRunsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::WebSecurityScanner::V1::ListScanRunsResponse] + # A result object deserialized from the server's reply + def list_scan_runs request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_scan_runs_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_scan_runs", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::WebSecurityScanner::V1::ListScanRunsResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the stop_scan_run REST call + # + # @param request_pb [::Google::Cloud::WebSecurityScanner::V1::StopScanRunRequest] + # 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::WebSecurityScanner::V1::ScanRun] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::WebSecurityScanner::V1::ScanRun] + # A result object deserialized from the server's reply + def stop_scan_run request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_stop_scan_run_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: "stop_scan_run", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::WebSecurityScanner::V1::ScanRun.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_crawled_urls REST call + # + # @param request_pb [::Google::Cloud::WebSecurityScanner::V1::ListCrawledUrlsRequest] + # 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::WebSecurityScanner::V1::ListCrawledUrlsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::WebSecurityScanner::V1::ListCrawledUrlsResponse] + # A result object deserialized from the server's reply + def list_crawled_urls request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_crawled_urls_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_crawled_urls", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::WebSecurityScanner::V1::ListCrawledUrlsResponse.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_finding REST call + # + # @param request_pb [::Google::Cloud::WebSecurityScanner::V1::GetFindingRequest] + # 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::WebSecurityScanner::V1::Finding] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::WebSecurityScanner::V1::Finding] + # A result object deserialized from the server's reply + def get_finding request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_finding_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_finding", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::WebSecurityScanner::V1::Finding.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_findings REST call + # + # @param request_pb [::Google::Cloud::WebSecurityScanner::V1::ListFindingsRequest] + # 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::WebSecurityScanner::V1::ListFindingsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::WebSecurityScanner::V1::ListFindingsResponse] + # A result object deserialized from the server's reply + def list_findings request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_findings_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_findings", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::WebSecurityScanner::V1::ListFindingsResponse.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_finding_type_stats REST call + # + # @param request_pb [::Google::Cloud::WebSecurityScanner::V1::ListFindingTypeStatsRequest] + # 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::WebSecurityScanner::V1::ListFindingTypeStatsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::WebSecurityScanner::V1::ListFindingTypeStatsResponse] + # A result object deserialized from the server's reply + def list_finding_type_stats request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_finding_type_stats_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_finding_type_stats", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::WebSecurityScanner::V1::ListFindingTypeStatsResponse.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_scan_config REST call + # + # @param request_pb [::Google::Cloud::WebSecurityScanner::V1::CreateScanConfigRequest] + # 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_scan_config_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/scanConfigs", + body: "scan_config", + matches: [ + ["parent", %r{^projects/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_scan_config REST call + # + # @param request_pb [::Google::Cloud::WebSecurityScanner::V1::DeleteScanConfigRequest] + # 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_scan_config_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/scanConfigs/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_scan_config REST call + # + # @param request_pb [::Google::Cloud::WebSecurityScanner::V1::GetScanConfigRequest] + # 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_scan_config_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/scanConfigs/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_scan_configs REST call + # + # @param request_pb [::Google::Cloud::WebSecurityScanner::V1::ListScanConfigsRequest] + # 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_scan_configs_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/scanConfigs", + matches: [ + ["parent", %r{^projects/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_scan_config REST call + # + # @param request_pb [::Google::Cloud::WebSecurityScanner::V1::UpdateScanConfigRequest] + # 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_scan_config_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v1/{scan_config.name}", + body: "scan_config", + matches: [ + ["scan_config.name", %r{^projects/[^/]+/scanConfigs/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the start_scan_run REST call + # + # @param request_pb [::Google::Cloud::WebSecurityScanner::V1::StartScanRunRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_start_scan_run_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:start", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/scanConfigs/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_scan_run REST call + # + # @param request_pb [::Google::Cloud::WebSecurityScanner::V1::GetScanRunRequest] + # 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_scan_run_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/scanConfigs/[^/]+/scanRuns/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_scan_runs REST call + # + # @param request_pb [::Google::Cloud::WebSecurityScanner::V1::ListScanRunsRequest] + # 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_scan_runs_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/scanRuns", + matches: [ + ["parent", %r{^projects/[^/]+/scanConfigs/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the stop_scan_run REST call + # + # @param request_pb [::Google::Cloud::WebSecurityScanner::V1::StopScanRunRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_stop_scan_run_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:stop", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/scanConfigs/[^/]+/scanRuns/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_crawled_urls REST call + # + # @param request_pb [::Google::Cloud::WebSecurityScanner::V1::ListCrawledUrlsRequest] + # 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_crawled_urls_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/crawledUrls", + matches: [ + ["parent", %r{^projects/[^/]+/scanConfigs/[^/]+/scanRuns/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_finding REST call + # + # @param request_pb [::Google::Cloud::WebSecurityScanner::V1::GetFindingRequest] + # 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_finding_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/scanConfigs/[^/]+/scanRuns/[^/]+/findings/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_findings REST call + # + # @param request_pb [::Google::Cloud::WebSecurityScanner::V1::ListFindingsRequest] + # 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_findings_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/findings", + matches: [ + ["parent", %r{^projects/[^/]+/scanConfigs/[^/]+/scanRuns/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_finding_type_stats REST call + # + # @param request_pb [::Google::Cloud::WebSecurityScanner::V1::ListFindingTypeStatsRequest] + # 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_finding_type_stats_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/findingTypeStats", + matches: [ + ["parent", %r{^projects/[^/]+/scanConfigs/[^/]+/scanRuns/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-web_security_scanner-v1/lib/google/cloud/websecurityscanner/v1/crawled_url_pb.rb b/owl-bot-staging/google-cloud-web_security_scanner-v1/lib/google/cloud/websecurityscanner/v1/crawled_url_pb.rb new file mode 100644 index 000000000000..f69c82a54319 --- /dev/null +++ b/owl-bot-staging/google-cloud-web_security_scanner-v1/lib/google/cloud/websecurityscanner/v1/crawled_url_pb.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/websecurityscanner/v1/crawled_url.proto + +require 'google/protobuf' + + +descriptor_data = "\n4google/cloud/websecurityscanner/v1/crawled_url.proto\x12\"google.cloud.websecurityscanner.v1\"<\n\nCrawledUrl\x12\x13\n\x0bhttp_method\x18\x01 \x01(\t\x12\x0b\n\x03url\x18\x02 \x01(\t\x12\x0c\n\x04\x62ody\x18\x03 \x01(\tB\x85\x02\n&com.google.cloud.websecurityscanner.v1B\x0f\x43rawledUrlProtoP\x01ZVcloud.google.com/go/websecurityscanner/apiv1/websecurityscannerpb;websecurityscannerpb\xaa\x02\"Google.Cloud.WebSecurityScanner.V1\xca\x02\"Google\\Cloud\\WebSecurityScanner\\V1\xea\x02%Google::Cloud::WebSecurityScanner::V1b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module WebSecurityScanner + module V1 + CrawledUrl = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.websecurityscanner.v1.CrawledUrl").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-web_security_scanner-v1/lib/google/cloud/websecurityscanner/v1/finding_addon_pb.rb b/owl-bot-staging/google-cloud-web_security_scanner-v1/lib/google/cloud/websecurityscanner/v1/finding_addon_pb.rb new file mode 100644 index 000000000000..f4877154eb19 --- /dev/null +++ b/owl-bot-staging/google-cloud-web_security_scanner-v1/lib/google/cloud/websecurityscanner/v1/finding_addon_pb.rb @@ -0,0 +1,30 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/websecurityscanner/v1/finding_addon.proto + +require 'google/protobuf' + + +descriptor_data = "\n6google/cloud/websecurityscanner/v1/finding_addon.proto\x12\"google.cloud.websecurityscanner.v1\"*\n\x04\x46orm\x12\x12\n\naction_uri\x18\x01 \x01(\t\x12\x0e\n\x06\x66ields\x18\x02 \x03(\t\"Q\n\x0fOutdatedLibrary\x12\x14\n\x0clibrary_name\x18\x01 \x01(\t\x12\x0f\n\x07version\x18\x02 \x01(\t\x12\x17\n\x0flearn_more_urls\x18\x03 \x03(\t\"?\n\x11ViolatingResource\x12\x14\n\x0c\x63ontent_type\x18\x01 \x01(\t\x12\x14\n\x0cresource_url\x18\x02 \x01(\t\"/\n\x14VulnerableParameters\x12\x17\n\x0fparameter_names\x18\x01 \x03(\t\"\xe0\x01\n\x11VulnerableHeaders\x12M\n\x07headers\x18\x01 \x03(\x0b\x32<.google.cloud.websecurityscanner.v1.VulnerableHeaders.Header\x12U\n\x0fmissing_headers\x18\x02 \x03(\x0b\x32<.google.cloud.websecurityscanner.v1.VulnerableHeaders.Header\x1a%\n\x06Header\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t\"\xdb\x03\n\x03Xss\x12\x14\n\x0cstack_traces\x18\x01 \x03(\t\x12\x15\n\rerror_message\x18\x02 \x01(\t\x12K\n\rattack_vector\x18\x03 \x01(\x0e\x32\x34.google.cloud.websecurityscanner.v1.Xss.AttackVector\x12\x1e\n\x16stored_xss_seeding_url\x18\x04 \x01(\t\"\xb9\x02\n\x0c\x41ttackVector\x12\x1d\n\x19\x41TTACK_VECTOR_UNSPECIFIED\x10\x00\x12\x11\n\rLOCAL_STORAGE\x10\x01\x12\x13\n\x0fSESSION_STORAGE\x10\x02\x12\x0f\n\x0bWINDOW_NAME\x10\x03\x12\x0c\n\x08REFERRER\x10\x04\x12\x0e\n\nFORM_INPUT\x10\x05\x12\n\n\x06\x43OOKIE\x10\x06\x12\x10\n\x0cPOST_MESSAGE\x10\x07\x12\x12\n\x0eGET_PARAMETERS\x10\x08\x12\x10\n\x0cURL_FRAGMENT\x10\t\x12\x10\n\x0cHTML_COMMENT\x10\n\x12\x13\n\x0fPOST_PARAMETERS\x10\x0b\x12\x0c\n\x08PROTOCOL\x10\x0c\x12\x0e\n\nSTORED_XSS\x10\r\x12\x0f\n\x0bSAME_ORIGIN\x10\x0e\x12\x19\n\x15USER_CONTROLLABLE_URL\x10\x0f\"\xa9\x01\n\x03Xxe\x12\x15\n\rpayload_value\x18\x01 \x01(\t\x12J\n\x10payload_location\x18\x02 \x01(\x0e\x32\x30.google.cloud.websecurityscanner.v1.Xxe.Location\"?\n\x08Location\x12\x18\n\x14LOCATION_UNSPECIFIED\x10\x00\x12\x19\n\x15\x43OMPLETE_REQUEST_BODY\x10\x01\x42\x87\x02\n&com.google.cloud.websecurityscanner.v1B\x11\x46indingAddonProtoP\x01ZVcloud.google.com/go/websecurityscanner/apiv1/websecurityscannerpb;websecurityscannerpb\xaa\x02\"Google.Cloud.WebSecurityScanner.V1\xca\x02\"Google\\Cloud\\WebSecurityScanner\\V1\xea\x02%Google::Cloud::WebSecurityScanner::V1b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module WebSecurityScanner + module V1 + Form = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.websecurityscanner.v1.Form").msgclass + OutdatedLibrary = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.websecurityscanner.v1.OutdatedLibrary").msgclass + ViolatingResource = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.websecurityscanner.v1.ViolatingResource").msgclass + VulnerableParameters = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.websecurityscanner.v1.VulnerableParameters").msgclass + VulnerableHeaders = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.websecurityscanner.v1.VulnerableHeaders").msgclass + VulnerableHeaders::Header = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.websecurityscanner.v1.VulnerableHeaders.Header").msgclass + Xss = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.websecurityscanner.v1.Xss").msgclass + Xss::AttackVector = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.websecurityscanner.v1.Xss.AttackVector").enummodule + Xxe = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.websecurityscanner.v1.Xxe").msgclass + Xxe::Location = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.websecurityscanner.v1.Xxe.Location").enummodule + end + end + end +end diff --git a/owl-bot-staging/google-cloud-web_security_scanner-v1/lib/google/cloud/websecurityscanner/v1/finding_pb.rb b/owl-bot-staging/google-cloud-web_security_scanner-v1/lib/google/cloud/websecurityscanner/v1/finding_pb.rb new file mode 100644 index 000000000000..2c1b16a36903 --- /dev/null +++ b/owl-bot-staging/google-cloud-web_security_scanner-v1/lib/google/cloud/websecurityscanner/v1/finding_pb.rb @@ -0,0 +1,26 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/websecurityscanner/v1/finding.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/cloud/websecurityscanner/v1/finding_addon_pb' + + +descriptor_data = "\n0google/cloud/websecurityscanner/v1/finding.proto\x12\"google.cloud.websecurityscanner.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x36google/cloud/websecurityscanner/v1/finding_addon.proto\"\xec\x07\n\x07\x46inding\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x14\n\x0c\x66inding_type\x18\x02 \x01(\t\x12K\n\x08severity\x18\x11 \x01(\x0e\x32\x34.google.cloud.websecurityscanner.v1.Finding.SeverityB\x03\xe0\x41\x03\x12\x13\n\x0bhttp_method\x18\x03 \x01(\t\x12\x12\n\nfuzzed_url\x18\x04 \x01(\t\x12\x0c\n\x04\x62ody\x18\x05 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x06 \x01(\t\x12\x18\n\x10reproduction_url\x18\x07 \x01(\t\x12\x11\n\tframe_url\x18\x08 \x01(\t\x12\x11\n\tfinal_url\x18\t \x01(\t\x12\x13\n\x0btracking_id\x18\n \x01(\t\x12\x36\n\x04\x66orm\x18\x10 \x01(\x0b\x32(.google.cloud.websecurityscanner.v1.Form\x12M\n\x10outdated_library\x18\x0b \x01(\x0b\x32\x33.google.cloud.websecurityscanner.v1.OutdatedLibrary\x12Q\n\x12violating_resource\x18\x0c \x01(\x0b\x32\x35.google.cloud.websecurityscanner.v1.ViolatingResource\x12Q\n\x12vulnerable_headers\x18\x0f \x01(\x0b\x32\x35.google.cloud.websecurityscanner.v1.VulnerableHeaders\x12W\n\x15vulnerable_parameters\x18\r \x01(\x0b\x32\x38.google.cloud.websecurityscanner.v1.VulnerableParameters\x12\x34\n\x03xss\x18\x0e \x01(\x0b\x32\'.google.cloud.websecurityscanner.v1.Xss\x12\x39\n\x03xxe\x18\x12 \x01(\x0b\x32\'.google.cloud.websecurityscanner.v1.XxeB\x03\xe0\x41\x03\"Q\n\x08Severity\x12\x18\n\x14SEVERITY_UNSPECIFIED\x10\x00\x12\x0c\n\x08\x43RITICAL\x10\x01\x12\x08\n\x04HIGH\x10\x02\x12\n\n\x06MEDIUM\x10\x03\x12\x07\n\x03LOW\x10\x04:\x84\x01\xea\x41\x80\x01\n)websecurityscanner.googleapis.com/Finding\x12Sprojects/{project}/scanConfigs/{scan_config}/scanRuns/{scan_run}/findings/{finding}B\x82\x02\n&com.google.cloud.websecurityscanner.v1B\x0c\x46indingProtoP\x01ZVcloud.google.com/go/websecurityscanner/apiv1/websecurityscannerpb;websecurityscannerpb\xaa\x02\"Google.Cloud.WebSecurityScanner.V1\xca\x02\"Google\\Cloud\\WebSecurityScanner\\V1\xea\x02%Google::Cloud::WebSecurityScanner::V1b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module WebSecurityScanner + module V1 + Finding = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.websecurityscanner.v1.Finding").msgclass + Finding::Severity = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.websecurityscanner.v1.Finding.Severity").enummodule + end + end + end +end diff --git a/owl-bot-staging/google-cloud-web_security_scanner-v1/lib/google/cloud/websecurityscanner/v1/finding_type_stats_pb.rb b/owl-bot-staging/google-cloud-web_security_scanner-v1/lib/google/cloud/websecurityscanner/v1/finding_type_stats_pb.rb new file mode 100644 index 000000000000..5c44c6e3e782 --- /dev/null +++ b/owl-bot-staging/google-cloud-web_security_scanner-v1/lib/google/cloud/websecurityscanner/v1/finding_type_stats_pb.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/websecurityscanner/v1/finding_type_stats.proto + +require 'google/protobuf' + + +descriptor_data = "\n;google/cloud/websecurityscanner/v1/finding_type_stats.proto\x12\"google.cloud.websecurityscanner.v1\"?\n\x10\x46indingTypeStats\x12\x14\n\x0c\x66inding_type\x18\x01 \x01(\t\x12\x15\n\rfinding_count\x18\x02 \x01(\x05\x42\x8b\x02\n&com.google.cloud.websecurityscanner.v1B\x15\x46indingTypeStatsProtoP\x01ZVcloud.google.com/go/websecurityscanner/apiv1/websecurityscannerpb;websecurityscannerpb\xaa\x02\"Google.Cloud.WebSecurityScanner.V1\xca\x02\"Google\\Cloud\\WebSecurityScanner\\V1\xea\x02%Google::Cloud::WebSecurityScanner::V1b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module WebSecurityScanner + module V1 + FindingTypeStats = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.websecurityscanner.v1.FindingTypeStats").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-web_security_scanner-v1/lib/google/cloud/websecurityscanner/v1/scan_config_error_pb.rb b/owl-bot-staging/google-cloud-web_security_scanner-v1/lib/google/cloud/websecurityscanner/v1/scan_config_error_pb.rb new file mode 100644 index 000000000000..efdc1a76b2a3 --- /dev/null +++ b/owl-bot-staging/google-cloud-web_security_scanner-v1/lib/google/cloud/websecurityscanner/v1/scan_config_error_pb.rb @@ -0,0 +1,22 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/websecurityscanner/v1/scan_config_error.proto + +require 'google/protobuf' + + +descriptor_data = "\n:google/cloud/websecurityscanner/v1/scan_config_error.proto\x12\"google.cloud.websecurityscanner.v1\"\xe9\x0b\n\x0fScanConfigError\x12\x46\n\x04\x63ode\x18\x01 \x01(\x0e\x32\x38.google.cloud.websecurityscanner.v1.ScanConfigError.Code\x12\x12\n\nfield_name\x18\x02 \x01(\t\"\xf9\n\n\x04\x43ode\x12\x14\n\x10\x43ODE_UNSPECIFIED\x10\x00\x12\x06\n\x02OK\x10\x00\x12\x12\n\x0eINTERNAL_ERROR\x10\x01\x12\x1f\n\x1b\x41PPENGINE_API_BACKEND_ERROR\x10\x02\x12 \n\x1c\x41PPENGINE_API_NOT_ACCESSIBLE\x10\x03\x12\"\n\x1e\x41PPENGINE_DEFAULT_HOST_MISSING\x10\x04\x12!\n\x1d\x43\x41NNOT_USE_GOOGLE_COM_ACCOUNT\x10\x06\x12\x1c\n\x18\x43\x41NNOT_USE_OWNER_ACCOUNT\x10\x07\x12\x1d\n\x19\x43OMPUTE_API_BACKEND_ERROR\x10\x08\x12\x1e\n\x1a\x43OMPUTE_API_NOT_ACCESSIBLE\x10\t\x12\x37\n3CUSTOM_LOGIN_URL_DOES_NOT_BELONG_TO_CURRENT_PROJECT\x10\n\x12\x1e\n\x1a\x43USTOM_LOGIN_URL_MALFORMED\x10\x0b\x12\x33\n/CUSTOM_LOGIN_URL_MAPPED_TO_NON_ROUTABLE_ADDRESS\x10\x0c\x12\x31\n-CUSTOM_LOGIN_URL_MAPPED_TO_UNRESERVED_ADDRESS\x10\r\x12\x30\n,CUSTOM_LOGIN_URL_HAS_NON_ROUTABLE_IP_ADDRESS\x10\x0e\x12.\n*CUSTOM_LOGIN_URL_HAS_UNRESERVED_IP_ADDRESS\x10\x0f\x12\x17\n\x13\x44UPLICATE_SCAN_NAME\x10\x10\x12\x17\n\x13INVALID_FIELD_VALUE\x10\x12\x12$\n FAILED_TO_AUTHENTICATE_TO_TARGET\x10\x13\x12\x1c\n\x18\x46INDING_TYPE_UNSPECIFIED\x10\x14\x12\x1d\n\x19\x46ORBIDDEN_TO_SCAN_COMPUTE\x10\x15\x12$\n FORBIDDEN_UPDATE_TO_MANAGED_SCAN\x10+\x12\x14\n\x10MALFORMED_FILTER\x10\x16\x12\x1b\n\x17MALFORMED_RESOURCE_NAME\x10\x17\x12\x14\n\x10PROJECT_INACTIVE\x10\x18\x12\x12\n\x0eREQUIRED_FIELD\x10\x19\x12\x1e\n\x1aRESOURCE_NAME_INCONSISTENT\x10\x1a\x12\x18\n\x14SCAN_ALREADY_RUNNING\x10\x1b\x12\x14\n\x10SCAN_NOT_RUNNING\x10\x1c\x12/\n+SEED_URL_DOES_NOT_BELONG_TO_CURRENT_PROJECT\x10\x1d\x12\x16\n\x12SEED_URL_MALFORMED\x10\x1e\x12+\n\'SEED_URL_MAPPED_TO_NON_ROUTABLE_ADDRESS\x10\x1f\x12)\n%SEED_URL_MAPPED_TO_UNRESERVED_ADDRESS\x10 \x12(\n$SEED_URL_HAS_NON_ROUTABLE_IP_ADDRESS\x10!\x12&\n\"SEED_URL_HAS_UNRESERVED_IP_ADDRESS\x10#\x12\"\n\x1eSERVICE_ACCOUNT_NOT_CONFIGURED\x10$\x12\x12\n\x0eTOO_MANY_SCANS\x10%\x12\"\n\x1eUNABLE_TO_RESOLVE_PROJECT_INFO\x10&\x12(\n$UNSUPPORTED_BLACKLIST_PATTERN_FORMAT\x10\'\x12\x16\n\x12UNSUPPORTED_FILTER\x10(\x12\x1c\n\x18UNSUPPORTED_FINDING_TYPE\x10)\x12\x1a\n\x16UNSUPPORTED_URL_SCHEME\x10*\x1a\x02\x10\x01\x42\x8a\x02\n&com.google.cloud.websecurityscanner.v1B\x14ScanConfigErrorProtoP\x01ZVcloud.google.com/go/websecurityscanner/apiv1/websecurityscannerpb;websecurityscannerpb\xaa\x02\"Google.Cloud.WebSecurityScanner.V1\xca\x02\"Google\\Cloud\\WebSecurityScanner\\V1\xea\x02%Google::Cloud::WebSecurityScanner::V1b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module WebSecurityScanner + module V1 + ScanConfigError = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.websecurityscanner.v1.ScanConfigError").msgclass + ScanConfigError::Code = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.websecurityscanner.v1.ScanConfigError.Code").enummodule + end + end + end +end diff --git a/owl-bot-staging/google-cloud-web_security_scanner-v1/lib/google/cloud/websecurityscanner/v1/scan_config_pb.rb b/owl-bot-staging/google-cloud-web_security_scanner-v1/lib/google/cloud/websecurityscanner/v1/scan_config_pb.rb new file mode 100644 index 000000000000..3100fd42944d --- /dev/null +++ b/owl-bot-staging/google-cloud-web_security_scanner-v1/lib/google/cloud/websecurityscanner/v1/scan_config_pb.rb @@ -0,0 +1,33 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/websecurityscanner/v1/scan_config.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/protobuf/timestamp_pb' + + +descriptor_data = "\n4google/cloud/websecurityscanner/v1/scan_config.proto\x12\"google.cloud.websecurityscanner.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xc4\r\n\nScanConfig\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x14\n\x0c\x64isplay_name\x18\x02 \x01(\t\x12\x0f\n\x07max_qps\x18\x03 \x01(\x05\x12\x15\n\rstarting_urls\x18\x04 \x03(\t\x12U\n\x0e\x61uthentication\x18\x05 \x01(\x0b\x32=.google.cloud.websecurityscanner.v1.ScanConfig.Authentication\x12L\n\nuser_agent\x18\x06 \x01(\x0e\x32\x38.google.cloud.websecurityscanner.v1.ScanConfig.UserAgent\x12\x1a\n\x12\x62lacklist_patterns\x18\x07 \x03(\t\x12I\n\x08schedule\x18\x08 \x01(\x0b\x32\x37.google.cloud.websecurityscanner.v1.ScanConfig.Schedule\x12w\n!export_to_security_command_center\x18\n \x01(\x0e\x32L.google.cloud.websecurityscanner.v1.ScanConfig.ExportToSecurityCommandCenter\x12L\n\nrisk_level\x18\x0c \x01(\x0e\x32\x38.google.cloud.websecurityscanner.v1.ScanConfig.RiskLevel\x12\x14\n\x0cmanaged_scan\x18\r \x01(\x08\x12\x16\n\x0estatic_ip_scan\x18\x0e \x01(\x08\x12!\n\x19ignore_http_status_errors\x18\x0f \x01(\x08\x1a\xd7\x05\n\x0e\x41uthentication\x12i\n\x0egoogle_account\x18\x01 \x01(\x0b\x32K.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.GoogleAccountB\x02\x18\x01H\x00\x12\x65\n\x0e\x63ustom_account\x18\x02 \x01(\x0b\x32K.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.CustomAccountH\x00\x12\x65\n\x0eiap_credential\x18\x04 \x01(\x0b\x32K.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredentialH\x00\x1a\x37\n\rGoogleAccount\x12\x10\n\x08username\x18\x01 \x01(\t\x12\x10\n\x08password\x18\x02 \x01(\t:\x02\x18\x01\x1a\x46\n\rCustomAccount\x12\x10\n\x08username\x18\x01 \x01(\t\x12\x10\n\x08password\x18\x02 \x01(\t\x12\x11\n\tlogin_url\x18\x03 \x01(\t\x1a\xf8\x01\n\rIapCredential\x12\x8e\x01\n\x1diap_test_service_account_info\x18\x01 \x01(\x0b\x32\x65.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential.IapTestServiceAccountInfoH\x00\x1a\x43\n\x19IapTestServiceAccountInfo\x12&\n\x19target_audience_client_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x42\x11\n\x0fiap_credentialsB\x10\n\x0e\x61uthentication\x1a]\n\x08Schedule\x12\x31\n\rschedule_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x1e\n\x16interval_duration_days\x18\x02 \x01(\x05\"`\n\tUserAgent\x12\x1a\n\x16USER_AGENT_UNSPECIFIED\x10\x00\x12\x10\n\x0c\x43HROME_LINUX\x10\x01\x12\x12\n\x0e\x43HROME_ANDROID\x10\x02\x12\x11\n\rSAFARI_IPHONE\x10\x03\"<\n\tRiskLevel\x12\x1a\n\x16RISK_LEVEL_UNSPECIFIED\x10\x00\x12\n\n\x06NORMAL\x10\x01\x12\x07\n\x03LOW\x10\x02\"m\n\x1d\x45xportToSecurityCommandCenter\x12\x31\n-EXPORT_TO_SECURITY_COMMAND_CENTER_UNSPECIFIED\x10\x00\x12\x0b\n\x07\x45NABLED\x10\x01\x12\x0c\n\x08\x44ISABLED\x10\x02\x42\x85\x02\n&com.google.cloud.websecurityscanner.v1B\x0fScanConfigProtoP\x01ZVcloud.google.com/go/websecurityscanner/apiv1/websecurityscannerpb;websecurityscannerpb\xaa\x02\"Google.Cloud.WebSecurityScanner.V1\xca\x02\"Google\\Cloud\\WebSecurityScanner\\V1\xea\x02%Google::Cloud::WebSecurityScanner::V1b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module WebSecurityScanner + module V1 + ScanConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.websecurityscanner.v1.ScanConfig").msgclass + ScanConfig::Authentication = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.websecurityscanner.v1.ScanConfig.Authentication").msgclass + ScanConfig::Authentication::GoogleAccount = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.websecurityscanner.v1.ScanConfig.Authentication.GoogleAccount").msgclass + ScanConfig::Authentication::CustomAccount = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.websecurityscanner.v1.ScanConfig.Authentication.CustomAccount").msgclass + ScanConfig::Authentication::IapCredential = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential").msgclass + ScanConfig::Authentication::IapCredential::IapTestServiceAccountInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential.IapTestServiceAccountInfo").msgclass + ScanConfig::Schedule = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.websecurityscanner.v1.ScanConfig.Schedule").msgclass + ScanConfig::UserAgent = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.websecurityscanner.v1.ScanConfig.UserAgent").enummodule + ScanConfig::RiskLevel = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.websecurityscanner.v1.ScanConfig.RiskLevel").enummodule + ScanConfig::ExportToSecurityCommandCenter = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.websecurityscanner.v1.ScanConfig.ExportToSecurityCommandCenter").enummodule + end + end + end +end diff --git a/owl-bot-staging/google-cloud-web_security_scanner-v1/lib/google/cloud/websecurityscanner/v1/scan_run_error_trace_pb.rb b/owl-bot-staging/google-cloud-web_security_scanner-v1/lib/google/cloud/websecurityscanner/v1/scan_run_error_trace_pb.rb new file mode 100644 index 000000000000..8d9034e3ced3 --- /dev/null +++ b/owl-bot-staging/google-cloud-web_security_scanner-v1/lib/google/cloud/websecurityscanner/v1/scan_run_error_trace_pb.rb @@ -0,0 +1,24 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/websecurityscanner/v1/scan_run_error_trace.proto + +require 'google/protobuf' + +require 'google/cloud/websecurityscanner/v1/scan_config_error_pb' + + +descriptor_data = "\n=google/cloud/websecurityscanner/v1/scan_run_error_trace.proto\x12\"google.cloud.websecurityscanner.v1\x1a:google/cloud/websecurityscanner/v1/scan_config_error.proto\"\x8d\x03\n\x11ScanRunErrorTrace\x12H\n\x04\x63ode\x18\x01 \x01(\x0e\x32:.google.cloud.websecurityscanner.v1.ScanRunErrorTrace.Code\x12N\n\x11scan_config_error\x18\x02 \x01(\x0b\x32\x33.google.cloud.websecurityscanner.v1.ScanConfigError\x12#\n\x1bmost_common_http_error_code\x18\x03 \x01(\x05\"\xb8\x01\n\x04\x43ode\x12\x14\n\x10\x43ODE_UNSPECIFIED\x10\x00\x12\x12\n\x0eINTERNAL_ERROR\x10\x01\x12\x15\n\x11SCAN_CONFIG_ISSUE\x10\x02\x12\x1f\n\x1b\x41UTHENTICATION_CONFIG_ISSUE\x10\x03\x12\x1c\n\x18TIMED_OUT_WHILE_SCANNING\x10\x04\x12\x16\n\x12TOO_MANY_REDIRECTS\x10\x05\x12\x18\n\x14TOO_MANY_HTTP_ERRORS\x10\x06\x42\x8c\x02\n&com.google.cloud.websecurityscanner.v1B\x16ScanRunErrorTraceProtoP\x01ZVcloud.google.com/go/websecurityscanner/apiv1/websecurityscannerpb;websecurityscannerpb\xaa\x02\"Google.Cloud.WebSecurityScanner.V1\xca\x02\"Google\\Cloud\\WebSecurityScanner\\V1\xea\x02%Google::Cloud::WebSecurityScanner::V1b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module WebSecurityScanner + module V1 + ScanRunErrorTrace = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.websecurityscanner.v1.ScanRunErrorTrace").msgclass + ScanRunErrorTrace::Code = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.websecurityscanner.v1.ScanRunErrorTrace.Code").enummodule + end + end + end +end diff --git a/owl-bot-staging/google-cloud-web_security_scanner-v1/lib/google/cloud/websecurityscanner/v1/scan_run_log_pb.rb b/owl-bot-staging/google-cloud-web_security_scanner-v1/lib/google/cloud/websecurityscanner/v1/scan_run_log_pb.rb new file mode 100644 index 000000000000..e20e60f2cc2e --- /dev/null +++ b/owl-bot-staging/google-cloud-web_security_scanner-v1/lib/google/cloud/websecurityscanner/v1/scan_run_log_pb.rb @@ -0,0 +1,24 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/websecurityscanner/v1/scan_run_log.proto + +require 'google/protobuf' + +require 'google/cloud/websecurityscanner/v1/scan_run_pb' +require 'google/cloud/websecurityscanner/v1/scan_run_error_trace_pb' + + +descriptor_data = "\n5google/cloud/websecurityscanner/v1/scan_run_log.proto\x12\"google.cloud.websecurityscanner.v1\x1a\x31google/cloud/websecurityscanner/v1/scan_run.proto\x1a=google/cloud/websecurityscanner/v1/scan_run_error_trace.proto\"\xe8\x02\n\nScanRunLog\x12\x0f\n\x07summary\x18\x01 \x01(\t\x12\x0c\n\x04name\x18\x02 \x01(\t\x12S\n\x0f\x65xecution_state\x18\x03 \x01(\x0e\x32:.google.cloud.websecurityscanner.v1.ScanRun.ExecutionState\x12M\n\x0cresult_state\x18\x04 \x01(\x0e\x32\x37.google.cloud.websecurityscanner.v1.ScanRun.ResultState\x12\x1a\n\x12urls_crawled_count\x18\x05 \x01(\x03\x12\x19\n\x11urls_tested_count\x18\x06 \x01(\x03\x12\x14\n\x0chas_findings\x18\x07 \x01(\x08\x12J\n\x0b\x65rror_trace\x18\x08 \x01(\x0b\x32\x35.google.cloud.websecurityscanner.v1.ScanRunErrorTraceB\x85\x02\n&com.google.cloud.websecurityscanner.v1B\x0fScanRunLogProtoP\x01ZVcloud.google.com/go/websecurityscanner/apiv1/websecurityscannerpb;websecurityscannerpb\xaa\x02\"Google.Cloud.WebSecurityScanner.V1\xca\x02\"Google\\Cloud\\WebSecurityScanner\\V1\xea\x02%Google::Cloud::WebSecurityScanner::V1b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module WebSecurityScanner + module V1 + ScanRunLog = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.websecurityscanner.v1.ScanRunLog").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-web_security_scanner-v1/lib/google/cloud/websecurityscanner/v1/scan_run_pb.rb b/owl-bot-staging/google-cloud-web_security_scanner-v1/lib/google/cloud/websecurityscanner/v1/scan_run_pb.rb new file mode 100644 index 000000000000..3c4d5aca5f5d --- /dev/null +++ b/owl-bot-staging/google-cloud-web_security_scanner-v1/lib/google/cloud/websecurityscanner/v1/scan_run_pb.rb @@ -0,0 +1,27 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/websecurityscanner/v1/scan_run.proto + +require 'google/protobuf' + +require 'google/cloud/websecurityscanner/v1/scan_run_error_trace_pb' +require 'google/cloud/websecurityscanner/v1/scan_run_warning_trace_pb' +require 'google/protobuf/timestamp_pb' + + +descriptor_data = "\n1google/cloud/websecurityscanner/v1/scan_run.proto\x12\"google.cloud.websecurityscanner.v1\x1a=google/cloud/websecurityscanner/v1/scan_run_error_trace.proto\x1a?google/cloud/websecurityscanner/v1/scan_run_warning_trace.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xd0\x05\n\x07ScanRun\x12\x0c\n\x04name\x18\x01 \x01(\t\x12S\n\x0f\x65xecution_state\x18\x02 \x01(\x0e\x32:.google.cloud.websecurityscanner.v1.ScanRun.ExecutionState\x12M\n\x0cresult_state\x18\x03 \x01(\x0e\x32\x37.google.cloud.websecurityscanner.v1.ScanRun.ResultState\x12.\n\nstart_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12,\n\x08\x65nd_time\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x1a\n\x12urls_crawled_count\x18\x06 \x01(\x03\x12\x19\n\x11urls_tested_count\x18\x07 \x01(\x03\x12\x1b\n\x13has_vulnerabilities\x18\x08 \x01(\x08\x12\x18\n\x10progress_percent\x18\t \x01(\x05\x12J\n\x0b\x65rror_trace\x18\n \x01(\x0b\x32\x35.google.cloud.websecurityscanner.v1.ScanRunErrorTrace\x12O\n\x0ewarning_traces\x18\x0b \x03(\x0b\x32\x37.google.cloud.websecurityscanner.v1.ScanRunWarningTrace\"Y\n\x0e\x45xecutionState\x12\x1f\n\x1b\x45XECUTION_STATE_UNSPECIFIED\x10\x00\x12\n\n\x06QUEUED\x10\x01\x12\x0c\n\x08SCANNING\x10\x02\x12\x0c\n\x08\x46INISHED\x10\x03\"O\n\x0bResultState\x12\x1c\n\x18RESULT_STATE_UNSPECIFIED\x10\x00\x12\x0b\n\x07SUCCESS\x10\x01\x12\t\n\x05\x45RROR\x10\x02\x12\n\n\x06KILLED\x10\x03\x42\x82\x02\n&com.google.cloud.websecurityscanner.v1B\x0cScanRunProtoP\x01ZVcloud.google.com/go/websecurityscanner/apiv1/websecurityscannerpb;websecurityscannerpb\xaa\x02\"Google.Cloud.WebSecurityScanner.V1\xca\x02\"Google\\Cloud\\WebSecurityScanner\\V1\xea\x02%Google::Cloud::WebSecurityScanner::V1b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module WebSecurityScanner + module V1 + ScanRun = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.websecurityscanner.v1.ScanRun").msgclass + ScanRun::ExecutionState = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.websecurityscanner.v1.ScanRun.ExecutionState").enummodule + ScanRun::ResultState = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.websecurityscanner.v1.ScanRun.ResultState").enummodule + end + end + end +end diff --git a/owl-bot-staging/google-cloud-web_security_scanner-v1/lib/google/cloud/websecurityscanner/v1/scan_run_warning_trace_pb.rb b/owl-bot-staging/google-cloud-web_security_scanner-v1/lib/google/cloud/websecurityscanner/v1/scan_run_warning_trace_pb.rb new file mode 100644 index 000000000000..d66c3872bc73 --- /dev/null +++ b/owl-bot-staging/google-cloud-web_security_scanner-v1/lib/google/cloud/websecurityscanner/v1/scan_run_warning_trace_pb.rb @@ -0,0 +1,22 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/websecurityscanner/v1/scan_run_warning_trace.proto + +require 'google/protobuf' + + +descriptor_data = "\n?google/cloud/websecurityscanner/v1/scan_run_warning_trace.proto\x12\"google.cloud.websecurityscanner.v1\"\x95\x02\n\x13ScanRunWarningTrace\x12J\n\x04\x63ode\x18\x01 \x01(\x0e\x32<.google.cloud.websecurityscanner.v1.ScanRunWarningTrace.Code\"\xb1\x01\n\x04\x43ode\x12\x14\n\x10\x43ODE_UNSPECIFIED\x10\x00\x12\x1e\n\x1aINSUFFICIENT_CRAWL_RESULTS\x10\x01\x12\x1a\n\x16TOO_MANY_CRAWL_RESULTS\x10\x02\x12\x17\n\x13TOO_MANY_FUZZ_TASKS\x10\x03\x12\x12\n\x0e\x42LOCKED_BY_IAP\x10\x04\x12*\n&NO_STARTING_URL_FOUND_FOR_MANAGED_SCAN\x10\x05\x42\x8e\x02\n&com.google.cloud.websecurityscanner.v1B\x18ScanRunWarningTraceProtoP\x01ZVcloud.google.com/go/websecurityscanner/apiv1/websecurityscannerpb;websecurityscannerpb\xaa\x02\"Google.Cloud.WebSecurityScanner.V1\xca\x02\"Google\\Cloud\\WebSecurityScanner\\V1\xea\x02%Google::Cloud::WebSecurityScanner::V1b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module WebSecurityScanner + module V1 + ScanRunWarningTrace = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.websecurityscanner.v1.ScanRunWarningTrace").msgclass + ScanRunWarningTrace::Code = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.websecurityscanner.v1.ScanRunWarningTrace.Code").enummodule + end + end + end +end diff --git a/owl-bot-staging/google-cloud-web_security_scanner-v1/lib/google/cloud/websecurityscanner/v1/web_security_scanner_pb.rb b/owl-bot-staging/google-cloud-web_security_scanner-v1/lib/google/cloud/websecurityscanner/v1/web_security_scanner_pb.rb new file mode 100644 index 000000000000..46ad835a2559 --- /dev/null +++ b/owl-bot-staging/google-cloud-web_security_scanner-v1/lib/google/cloud/websecurityscanner/v1/web_security_scanner_pb.rb @@ -0,0 +1,48 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/websecurityscanner/v1/web_security_scanner.proto + +require 'google/protobuf' + +require 'google/api/annotations_pb' +require 'google/api/client_pb' +require 'google/cloud/websecurityscanner/v1/crawled_url_pb' +require 'google/cloud/websecurityscanner/v1/finding_pb' +require 'google/cloud/websecurityscanner/v1/finding_type_stats_pb' +require 'google/cloud/websecurityscanner/v1/scan_config_pb' +require 'google/cloud/websecurityscanner/v1/scan_run_pb' +require 'google/protobuf/empty_pb' +require 'google/protobuf/field_mask_pb' + + +descriptor_data = "\n=google/cloud/websecurityscanner/v1/web_security_scanner.proto\x12\"google.cloud.websecurityscanner.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x34google/cloud/websecurityscanner/v1/crawled_url.proto\x1a\x30google/cloud/websecurityscanner/v1/finding.proto\x1a;google/cloud/websecurityscanner/v1/finding_type_stats.proto\x1a\x34google/cloud/websecurityscanner/v1/scan_config.proto\x1a\x31google/cloud/websecurityscanner/v1/scan_run.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\"n\n\x17\x43reateScanConfigRequest\x12\x0e\n\x06parent\x18\x01 \x01(\t\x12\x43\n\x0bscan_config\x18\x02 \x01(\x0b\x32..google.cloud.websecurityscanner.v1.ScanConfig\"\'\n\x17\x44\x65leteScanConfigRequest\x12\x0c\n\x04name\x18\x01 \x01(\t\"$\n\x14GetScanConfigRequest\x12\x0c\n\x04name\x18\x01 \x01(\t\"O\n\x16ListScanConfigsRequest\x12\x0e\n\x06parent\x18\x01 \x01(\t\x12\x12\n\npage_token\x18\x02 \x01(\t\x12\x11\n\tpage_size\x18\x03 \x01(\x05\"\x8f\x01\n\x17UpdateScanConfigRequest\x12\x43\n\x0bscan_config\x18\x02 \x01(\x0b\x32..google.cloud.websecurityscanner.v1.ScanConfig\x12/\n\x0bupdate_mask\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"x\n\x17ListScanConfigsResponse\x12\x44\n\x0cscan_configs\x18\x01 \x03(\x0b\x32..google.cloud.websecurityscanner.v1.ScanConfig\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"#\n\x13StartScanRunRequest\x12\x0c\n\x04name\x18\x01 \x01(\t\"!\n\x11GetScanRunRequest\x12\x0c\n\x04name\x18\x01 \x01(\t\"L\n\x13ListScanRunsRequest\x12\x0e\n\x06parent\x18\x01 \x01(\t\x12\x12\n\npage_token\x18\x02 \x01(\t\x12\x11\n\tpage_size\x18\x03 \x01(\x05\"o\n\x14ListScanRunsResponse\x12>\n\tscan_runs\x18\x01 \x03(\x0b\x32+.google.cloud.websecurityscanner.v1.ScanRun\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\"\n\x12StopScanRunRequest\x12\x0c\n\x04name\x18\x01 \x01(\t\"O\n\x16ListCrawledUrlsRequest\x12\x0e\n\x06parent\x18\x01 \x01(\t\x12\x12\n\npage_token\x18\x02 \x01(\t\x12\x11\n\tpage_size\x18\x03 \x01(\x05\"x\n\x17ListCrawledUrlsResponse\x12\x44\n\x0c\x63rawled_urls\x18\x01 \x03(\x0b\x32..google.cloud.websecurityscanner.v1.CrawledUrl\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"!\n\x11GetFindingRequest\x12\x0c\n\x04name\x18\x01 \x01(\t\"\\\n\x13ListFindingsRequest\x12\x0e\n\x06parent\x18\x01 \x01(\t\x12\x0e\n\x06\x66ilter\x18\x02 \x01(\t\x12\x12\n\npage_token\x18\x03 \x01(\t\x12\x11\n\tpage_size\x18\x04 \x01(\x05\"n\n\x14ListFindingsResponse\x12=\n\x08\x66indings\x18\x01 \x03(\x0b\x32+.google.cloud.websecurityscanner.v1.Finding\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"-\n\x1bListFindingTypeStatsRequest\x12\x0e\n\x06parent\x18\x01 \x01(\t\"p\n\x1cListFindingTypeStatsResponse\x12P\n\x12\x66inding_type_stats\x18\x01 \x03(\x0b\x32\x34.google.cloud.websecurityscanner.v1.FindingTypeStats2\xe9\x13\n\x12WebSecurityScanner\x12\xb9\x01\n\x10\x43reateScanConfig\x12;.google.cloud.websecurityscanner.v1.CreateScanConfigRequest\x1a..google.cloud.websecurityscanner.v1.ScanConfig\"8\x82\xd3\xe4\x93\x02\x32\"#/v1/{parent=projects/*}/scanConfigs:\x0bscan_config\x12\x94\x01\n\x10\x44\x65leteScanConfig\x12;.google.cloud.websecurityscanner.v1.DeleteScanConfigRequest\x1a\x16.google.protobuf.Empty\"+\x82\xd3\xe4\x93\x02%*#/v1/{name=projects/*/scanConfigs/*}\x12\xa6\x01\n\rGetScanConfig\x12\x38.google.cloud.websecurityscanner.v1.GetScanConfigRequest\x1a..google.cloud.websecurityscanner.v1.ScanConfig\"+\x82\xd3\xe4\x93\x02%\x12#/v1/{name=projects/*/scanConfigs/*}\x12\xb7\x01\n\x0fListScanConfigs\x12:.google.cloud.websecurityscanner.v1.ListScanConfigsRequest\x1a;.google.cloud.websecurityscanner.v1.ListScanConfigsResponse\"+\x82\xd3\xe4\x93\x02%\x12#/v1/{parent=projects/*}/scanConfigs\x12\xc5\x01\n\x10UpdateScanConfig\x12;.google.cloud.websecurityscanner.v1.UpdateScanConfigRequest\x1a..google.cloud.websecurityscanner.v1.ScanConfig\"D\x82\xd3\xe4\x93\x02>2//v1/{scan_config.name=projects/*/scanConfigs/*}:\x0bscan_config\x12\xaa\x01\n\x0cStartScanRun\x12\x37.google.cloud.websecurityscanner.v1.StartScanRunRequest\x1a+.google.cloud.websecurityscanner.v1.ScanRun\"4\x82\xd3\xe4\x93\x02.\")/v1/{name=projects/*/scanConfigs/*}:start:\x01*\x12\xa8\x01\n\nGetScanRun\x12\x35.google.cloud.websecurityscanner.v1.GetScanRunRequest\x1a+.google.cloud.websecurityscanner.v1.ScanRun\"6\x82\xd3\xe4\x93\x02\x30\x12./v1/{name=projects/*/scanConfigs/*/scanRuns/*}\x12\xb9\x01\n\x0cListScanRuns\x12\x37.google.cloud.websecurityscanner.v1.ListScanRunsRequest\x1a\x38.google.cloud.websecurityscanner.v1.ListScanRunsResponse\"6\x82\xd3\xe4\x93\x02\x30\x12./v1/{parent=projects/*/scanConfigs/*}/scanRuns\x12\xb2\x01\n\x0bStopScanRun\x12\x36.google.cloud.websecurityscanner.v1.StopScanRunRequest\x1a+.google.cloud.websecurityscanner.v1.ScanRun\">\x82\xd3\xe4\x93\x02\x38\"3/v1/{name=projects/*/scanConfigs/*/scanRuns/*}:stop:\x01*\x12\xd0\x01\n\x0fListCrawledUrls\x12:.google.cloud.websecurityscanner.v1.ListCrawledUrlsRequest\x1a;.google.cloud.websecurityscanner.v1.ListCrawledUrlsResponse\"D\x82\xd3\xe4\x93\x02>\x12] + # 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. + # + # Note: This field should not be used in most cases. + 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: + # library_settings: + # 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. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Php. Clobbers the php_namespace option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.php.package_name" field + # in gapic.yaml. API teams should use the protobuf php_namespace option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # library_settings: + # php_settings: + # library_package: Google\Cloud\PubSub\V1 + 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. + # + # Example: + # + # 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 + # @!attribute [rw] batching + # @return [::Google::Api::BatchingConfigProto] + # Batching configuration for an API method in client libraries. + # + # Example of a YAML configuration: + # + # publishing: + # method_settings: + # - selector: google.example.v1.ExampleService.BatchCreateExample + # batching: + # element_count_threshold: 1000 + # request_byte_threshold: 100000000 + # delay_threshold_millis: 10 + 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. + # + # Note: This feature should not be used in most cases. + # @!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 + + # `BatchingConfigProto` defines the batching configuration for an API method. + # @!attribute [rw] thresholds + # @return [::Google::Api::BatchingSettingsProto] + # The thresholds which trigger a batched request to be sent. + # @!attribute [rw] batch_descriptor + # @return [::Google::Api::BatchingDescriptorProto] + # The request and response fields used in batching. + class BatchingConfigProto + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `BatchingSettingsProto` specifies a set of batching thresholds, each of + # which acts as a trigger to send a batch of messages as a request. At least + # one threshold must be positive nonzero. + # @!attribute [rw] element_count_threshold + # @return [::Integer] + # The number of elements of a field collected into a batch which, if + # exceeded, causes the batch to be sent. + # @!attribute [rw] request_byte_threshold + # @return [::Integer] + # The aggregated size of the batched field which, if exceeded, causes the + # batch to be sent. This size is computed by aggregating the sizes of the + # request field to be batched, not of the entire request message. + # @!attribute [rw] delay_threshold + # @return [::Google::Protobuf::Duration] + # The duration after which a batch should be sent, starting from the addition + # of the first message to that batch. + # @!attribute [rw] element_count_limit + # @return [::Integer] + # The maximum number of elements collected in a batch that could be accepted + # by server. + # @!attribute [rw] request_byte_limit + # @return [::Integer] + # The maximum size of the request that could be accepted by server. + # @!attribute [rw] flow_control_element_limit + # @return [::Integer] + # The maximum number of elements allowed by flow control. + # @!attribute [rw] flow_control_byte_limit + # @return [::Integer] + # The maximum size of data allowed by flow control. + # @!attribute [rw] flow_control_limit_exceeded_behavior + # @return [::Google::Api::FlowControlLimitExceededBehaviorProto] + # The behavior to take when the flow control limit is exceeded. + class BatchingSettingsProto + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `BatchingDescriptorProto` specifies the fields of the request message to be + # used for batching, and, optionally, the fields of the response message to be + # used for demultiplexing. + # @!attribute [rw] batched_field + # @return [::String] + # The repeated field in the request message to be aggregated by batching. + # @!attribute [rw] discriminator_fields + # @return [::Array<::String>] + # A list of the fields in the request message. Two requests will be batched + # together only if the values of every field specified in + # `request_discriminator_fields` is equal between the two requests. + # @!attribute [rw] subresponse_field + # @return [::String] + # Optional. When present, indicates the field in the response message to be + # used to demultiplex the response into multiple response messages, in + # correspondence with the multiple request messages originally batched + # together. + class BatchingDescriptorProto + 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 + + # The behavior to take when the flow control limit is exceeded. + module FlowControlLimitExceededBehaviorProto + # Default behavior, system-defined. + UNSET_BEHAVIOR = 0 + + # Stop operation, raise error. + THROW_EXCEPTION = 1 + + # Pause operation until limit clears. + BLOCK = 2 + + # Continue operation, disregard limit. + IGNORE = 3 + end + end +end diff --git a/owl-bot-staging/google-cloud-web_security_scanner-v1/proto_docs/google/api/field_behavior.rb b/owl-bot-staging/google-cloud-web_security_scanner-v1/proto_docs/google/api/field_behavior.rb new file mode 100644 index 000000000000..582be187d115 --- /dev/null +++ b/owl-bot-staging/google-cloud-web_security_scanner-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-web_security_scanner-v1/proto_docs/google/api/launch_stage.rb b/owl-bot-staging/google-cloud-web_security_scanner-v1/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..9392a413fb1b --- /dev/null +++ b/owl-bot-staging/google-cloud-web_security_scanner-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-web_security_scanner-v1/proto_docs/google/api/resource.rb b/owl-bot-staging/google-cloud-web_security_scanner-v1/proto_docs/google/api/resource.rb new file mode 100644 index 000000000000..25dec4847ac1 --- /dev/null +++ b/owl-bot-staging/google-cloud-web_security_scanner-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-web_security_scanner-v1/proto_docs/google/cloud/websecurityscanner/v1/crawled_url.rb b/owl-bot-staging/google-cloud-web_security_scanner-v1/proto_docs/google/cloud/websecurityscanner/v1/crawled_url.rb new file mode 100644 index 000000000000..8a90e045f7c6 --- /dev/null +++ b/owl-bot-staging/google-cloud-web_security_scanner-v1/proto_docs/google/cloud/websecurityscanner/v1/crawled_url.rb @@ -0,0 +1,44 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 WebSecurityScanner + module V1 + # A CrawledUrl resource represents a URL that was crawled during a ScanRun. Web + # Security Scanner Service crawls the web applications, following all links + # within the scope of sites, to find the URLs to test against. + # @!attribute [rw] http_method + # @return [::String] + # Output only. The http method of the request that was used to visit the URL, in + # uppercase. + # @!attribute [rw] url + # @return [::String] + # Output only. The URL that was crawled. + # @!attribute [rw] body + # @return [::String] + # Output only. The body of the request that was used to visit the URL. + class CrawledUrl + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-web_security_scanner-v1/proto_docs/google/cloud/websecurityscanner/v1/finding.rb b/owl-bot-staging/google-cloud-web_security_scanner-v1/proto_docs/google/cloud/websecurityscanner/v1/finding.rb new file mode 100644 index 000000000000..a2ddddfdd390 --- /dev/null +++ b/owl-bot-staging/google-cloud-web_security_scanner-v1/proto_docs/google/cloud/websecurityscanner/v1/finding.rb @@ -0,0 +1,117 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 WebSecurityScanner + module V1 + # A Finding resource represents a vulnerability instance identified during a + # ScanRun. + # @!attribute [rw] name + # @return [::String] + # Output only. The resource name of the Finding. The name follows the format of + # 'projects/\\{projectId}/scanConfigs/\\{scanConfigId}/scanruns/\\{scanRunId}/findings/\\{findingId}'. + # The finding IDs are generated by the system. + # @!attribute [rw] finding_type + # @return [::String] + # Output only. The type of the Finding. + # Detailed and up-to-date information on findings can be found here: + # https://cloud.google.com/security-command-center/docs/how-to-remediate-web-security-scanner-findings + # @!attribute [r] severity + # @return [::Google::Cloud::WebSecurityScanner::V1::Finding::Severity] + # Output only. The severity level of the reported vulnerability. + # @!attribute [rw] http_method + # @return [::String] + # Output only. The http method of the request that triggered the vulnerability, in + # uppercase. + # @!attribute [rw] fuzzed_url + # @return [::String] + # Output only. The URL produced by the server-side fuzzer and used in the request that + # triggered the vulnerability. + # @!attribute [rw] body + # @return [::String] + # Output only. The body of the request that triggered the vulnerability. + # @!attribute [rw] description + # @return [::String] + # Output only. The description of the vulnerability. + # @!attribute [rw] reproduction_url + # @return [::String] + # Output only. The URL containing human-readable payload that user can leverage to + # reproduce the vulnerability. + # @!attribute [rw] frame_url + # @return [::String] + # Output only. If the vulnerability was originated from nested IFrame, the immediate + # parent IFrame is reported. + # @!attribute [rw] final_url + # @return [::String] + # Output only. The URL where the browser lands when the vulnerability is detected. + # @!attribute [rw] tracking_id + # @return [::String] + # Output only. The tracking ID uniquely identifies a vulnerability instance across + # multiple ScanRuns. + # @!attribute [rw] form + # @return [::Google::Cloud::WebSecurityScanner::V1::Form] + # Output only. An addon containing information reported for a vulnerability with an HTML + # form, if any. + # @!attribute [rw] outdated_library + # @return [::Google::Cloud::WebSecurityScanner::V1::OutdatedLibrary] + # Output only. An addon containing information about outdated libraries. + # @!attribute [rw] violating_resource + # @return [::Google::Cloud::WebSecurityScanner::V1::ViolatingResource] + # Output only. An addon containing detailed information regarding any resource causing the + # vulnerability such as JavaScript sources, image, audio files, etc. + # @!attribute [rw] vulnerable_headers + # @return [::Google::Cloud::WebSecurityScanner::V1::VulnerableHeaders] + # Output only. An addon containing information about vulnerable or missing HTTP headers. + # @!attribute [rw] vulnerable_parameters + # @return [::Google::Cloud::WebSecurityScanner::V1::VulnerableParameters] + # Output only. An addon containing information about request parameters which were found + # to be vulnerable. + # @!attribute [rw] xss + # @return [::Google::Cloud::WebSecurityScanner::V1::Xss] + # Output only. An addon containing information reported for an XSS, if any. + # @!attribute [r] xxe + # @return [::Google::Cloud::WebSecurityScanner::V1::Xxe] + # Output only. An addon containing information reported for an XXE, if any. + class Finding + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The severity level of a vulnerability. + module Severity + # No severity specified. The default value. + SEVERITY_UNSPECIFIED = 0 + + # Critical severity. + CRITICAL = 1 + + # High severity. + HIGH = 2 + + # Medium severity. + MEDIUM = 3 + + # Low severity. + LOW = 4 + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-web_security_scanner-v1/proto_docs/google/cloud/websecurityscanner/v1/finding_addon.rb b/owl-bot-staging/google-cloud-web_security_scanner-v1/proto_docs/google/cloud/websecurityscanner/v1/finding_addon.rb new file mode 100644 index 000000000000..dbd7c7de4641 --- /dev/null +++ b/owl-bot-staging/google-cloud-web_security_scanner-v1/proto_docs/google/cloud/websecurityscanner/v1/finding_addon.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 Cloud + module WebSecurityScanner + module V1 + # ! Information about a vulnerability with an HTML. + # @!attribute [rw] action_uri + # @return [::String] + # ! The URI where to send the form when it's submitted. + # @!attribute [rw] fields + # @return [::Array<::String>] + # ! The names of form fields related to the vulnerability. + class Form + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Information reported for an outdated library. + # @!attribute [rw] library_name + # @return [::String] + # The name of the outdated library. + # @!attribute [rw] version + # @return [::String] + # The version number. + # @!attribute [rw] learn_more_urls + # @return [::Array<::String>] + # URLs to learn more information about the vulnerabilities in the library. + class OutdatedLibrary + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Information regarding any resource causing the vulnerability such + # as JavaScript sources, image, audio files, etc. + # @!attribute [rw] content_type + # @return [::String] + # The MIME type of this resource. + # @!attribute [rw] resource_url + # @return [::String] + # URL of this violating resource. + class ViolatingResource + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Information about vulnerable request parameters. + # @!attribute [rw] parameter_names + # @return [::Array<::String>] + # The vulnerable parameter names. + class VulnerableParameters + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Information about vulnerable or missing HTTP Headers. + # @!attribute [rw] headers + # @return [::Array<::Google::Cloud::WebSecurityScanner::V1::VulnerableHeaders::Header>] + # List of vulnerable headers. + # @!attribute [rw] missing_headers + # @return [::Array<::Google::Cloud::WebSecurityScanner::V1::VulnerableHeaders::Header>] + # List of missing headers. + class VulnerableHeaders + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes a HTTP Header. + # @!attribute [rw] name + # @return [::String] + # Header name. + # @!attribute [rw] value + # @return [::String] + # Header value. + class Header + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Information reported for an XSS. + # @!attribute [rw] stack_traces + # @return [::Array<::String>] + # Stack traces leading to the point where the XSS occurred. + # @!attribute [rw] error_message + # @return [::String] + # An error message generated by a javascript breakage. + # @!attribute [rw] attack_vector + # @return [::Google::Cloud::WebSecurityScanner::V1::Xss::AttackVector] + # The attack vector of the payload triggering this XSS. + # @!attribute [rw] stored_xss_seeding_url + # @return [::String] + # The reproduction url for the seeding POST request of a Stored XSS. + class Xss + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Types of XSS attack vector. + module AttackVector + # Unknown attack vector. + ATTACK_VECTOR_UNSPECIFIED = 0 + + # The attack comes from fuzzing the browser's localStorage. + LOCAL_STORAGE = 1 + + # The attack comes from fuzzing the browser's sessionStorage. + SESSION_STORAGE = 2 + + # The attack comes from fuzzing the window's name property. + WINDOW_NAME = 3 + + # The attack comes from fuzzing the referrer property. + REFERRER = 4 + + # The attack comes from fuzzing an input element. + FORM_INPUT = 5 + + # The attack comes from fuzzing the browser's cookies. + COOKIE = 6 + + # The attack comes from hijacking the post messaging mechanism. + POST_MESSAGE = 7 + + # The attack comes from fuzzing parameters in the url. + GET_PARAMETERS = 8 + + # The attack comes from fuzzing the fragment in the url. + URL_FRAGMENT = 9 + + # The attack comes from fuzzing the HTML comments. + HTML_COMMENT = 10 + + # The attack comes from fuzzing the POST parameters. + POST_PARAMETERS = 11 + + # The attack comes from fuzzing the protocol. + PROTOCOL = 12 + + # The attack comes from the server side and is stored. + STORED_XSS = 13 + + # The attack is a Same-Origin Method Execution attack via a GET parameter. + SAME_ORIGIN = 14 + + # The attack payload is received from a third-party host via a URL that is + # user-controllable + USER_CONTROLLABLE_URL = 15 + end + end + + # Information reported for an XXE. + # @!attribute [rw] payload_value + # @return [::String] + # The XML string that triggered the XXE vulnerability. Non-payload values + # might be redacted. + # @!attribute [rw] payload_location + # @return [::Google::Cloud::WebSecurityScanner::V1::Xxe::Location] + # Location within the request where the payload was placed. + class Xxe + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Locations within a request where XML was substituted. + module Location + # Unknown Location. + LOCATION_UNSPECIFIED = 0 + + # The XML payload replaced the complete request body. + COMPLETE_REQUEST_BODY = 1 + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-web_security_scanner-v1/proto_docs/google/cloud/websecurityscanner/v1/finding_type_stats.rb b/owl-bot-staging/google-cloud-web_security_scanner-v1/proto_docs/google/cloud/websecurityscanner/v1/finding_type_stats.rb new file mode 100644 index 000000000000..d7c9d4981c94 --- /dev/null +++ b/owl-bot-staging/google-cloud-web_security_scanner-v1/proto_docs/google/cloud/websecurityscanner/v1/finding_type_stats.rb @@ -0,0 +1,39 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 WebSecurityScanner + module V1 + # A FindingTypeStats resource represents stats regarding a specific FindingType + # of Findings under a given ScanRun. + # @!attribute [rw] finding_type + # @return [::String] + # Output only. The finding type associated with the stats. + # @!attribute [rw] finding_count + # @return [::Integer] + # Output only. The count of findings belonging to this finding type. + class FindingTypeStats + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-web_security_scanner-v1/proto_docs/google/cloud/websecurityscanner/v1/scan_config.rb b/owl-bot-staging/google-cloud-web_security_scanner-v1/proto_docs/google/cloud/websecurityscanner/v1/scan_config.rb new file mode 100644 index 000000000000..b09c2e974d3b --- /dev/null +++ b/owl-bot-staging/google-cloud-web_security_scanner-v1/proto_docs/google/cloud/websecurityscanner/v1/scan_config.rb @@ -0,0 +1,211 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 WebSecurityScanner + module V1 + # A ScanConfig resource contains the configurations to launch a scan. + # @!attribute [rw] name + # @return [::String] + # The resource name of the ScanConfig. The name follows the format of + # 'projects/\\{projectId}/scanConfigs/\\{scanConfigId}'. The ScanConfig IDs are + # generated by the system. + # @!attribute [rw] display_name + # @return [::String] + # Required. The user provided display name of the ScanConfig. + # @!attribute [rw] max_qps + # @return [::Integer] + # The maximum QPS during scanning. A valid value ranges from 5 to 20 + # inclusively. If the field is unspecified or its value is set 0, server will + # default to 15. Other values outside of [5, 20] range will be rejected with + # INVALID_ARGUMENT error. + # @!attribute [rw] starting_urls + # @return [::Array<::String>] + # Required. The starting URLs from which the scanner finds site pages. + # @!attribute [rw] authentication + # @return [::Google::Cloud::WebSecurityScanner::V1::ScanConfig::Authentication] + # The authentication configuration. If specified, service will use the + # authentication configuration during scanning. + # @!attribute [rw] user_agent + # @return [::Google::Cloud::WebSecurityScanner::V1::ScanConfig::UserAgent] + # The user agent used during scanning. + # @!attribute [rw] blacklist_patterns + # @return [::Array<::String>] + # The excluded URL patterns as described in + # https://cloud.google.com/security-command-center/docs/how-to-use-web-security-scanner#excluding_urls + # @!attribute [rw] schedule + # @return [::Google::Cloud::WebSecurityScanner::V1::ScanConfig::Schedule] + # The schedule of the ScanConfig. + # @!attribute [rw] export_to_security_command_center + # @return [::Google::Cloud::WebSecurityScanner::V1::ScanConfig::ExportToSecurityCommandCenter] + # Controls export of scan configurations and results to Security + # Command Center. + # @!attribute [rw] risk_level + # @return [::Google::Cloud::WebSecurityScanner::V1::ScanConfig::RiskLevel] + # The risk level selected for the scan + # @!attribute [rw] managed_scan + # @return [::Boolean] + # Whether the scan config is managed by Web Security Scanner, output + # only. + # @!attribute [rw] static_ip_scan + # @return [::Boolean] + # Whether the scan configuration has enabled static IP address scan feature. + # If enabled, the scanner will access applications from static IP addresses. + # @!attribute [rw] ignore_http_status_errors + # @return [::Boolean] + # Whether to keep scanning even if most requests return HTTP error codes. + class ScanConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Scan authentication configuration. + # @!attribute [rw] google_account + # @deprecated This field is deprecated and may be removed in the next major version update. + # @return [::Google::Cloud::WebSecurityScanner::V1::ScanConfig::Authentication::GoogleAccount] + # Authentication using a Google account. + # + # Note: The following fields are mutually exclusive: `google_account`, `custom_account`, `iap_credential`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] custom_account + # @return [::Google::Cloud::WebSecurityScanner::V1::ScanConfig::Authentication::CustomAccount] + # Authentication using a custom account. + # + # Note: The following fields are mutually exclusive: `custom_account`, `google_account`, `iap_credential`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] iap_credential + # @return [::Google::Cloud::WebSecurityScanner::V1::ScanConfig::Authentication::IapCredential] + # Authentication using Identity-Aware-Proxy (IAP). + # + # Note: The following fields are mutually exclusive: `iap_credential`, `google_account`, `custom_account`. If a field in that set is populated, all other fields in the set will automatically be cleared. + class Authentication + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes authentication configuration that uses a Google account. + # @deprecated This message is deprecated and may be removed in the next major version update. + # @!attribute [rw] username + # @return [::String] + # Required. The user name of the Google account. + # @!attribute [rw] password + # @return [::String] + # Required. Input only. The password of the Google account. The credential is stored encrypted + # and not returned in any response nor included in audit logs. + class GoogleAccount + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes authentication configuration that uses a custom account. + # @!attribute [rw] username + # @return [::String] + # Required. The user name of the custom account. + # @!attribute [rw] password + # @return [::String] + # Required. Input only. The password of the custom account. The credential is stored encrypted + # and not returned in any response nor included in audit logs. + # @!attribute [rw] login_url + # @return [::String] + # Required. The login form URL of the website. + class CustomAccount + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes authentication configuration for Identity-Aware-Proxy (IAP). + # @!attribute [rw] iap_test_service_account_info + # @return [::Google::Cloud::WebSecurityScanner::V1::ScanConfig::Authentication::IapCredential::IapTestServiceAccountInfo] + # Authentication configuration when Web-Security-Scanner service + # account is added in Identity-Aware-Proxy (IAP) access policies. + class IapCredential + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes authentication configuration when Web-Security-Scanner + # service account is added in Identity-Aware-Proxy (IAP) access policies. + # @!attribute [rw] target_audience_client_id + # @return [::String] + # Required. Describes OAuth2 client id of resources protected by + # Identity-Aware-Proxy (IAP). + class IapTestServiceAccountInfo + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + + # Scan schedule configuration. + # @!attribute [rw] schedule_time + # @return [::Google::Protobuf::Timestamp] + # A timestamp indicates when the next run will be scheduled. The value is + # refreshed by the server after each run. If unspecified, it will default + # to current server time, which means the scan will be scheduled to start + # immediately. + # @!attribute [rw] interval_duration_days + # @return [::Integer] + # Required. The duration of time between executions in days. + class Schedule + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Type of user agents used for scanning. + module UserAgent + # The user agent is unknown. Service will default to CHROME_LINUX. + USER_AGENT_UNSPECIFIED = 0 + + # Chrome on Linux. This is the service default if unspecified. + CHROME_LINUX = 1 + + # Chrome on Android. + CHROME_ANDROID = 2 + + # Safari on IPhone. + SAFARI_IPHONE = 3 + end + + # Scan risk levels supported by Web Security Scanner. LOW impact + # scanning will minimize requests with the potential to modify data. To + # achieve the maximum scan coverage, NORMAL risk level is recommended. + module RiskLevel + # Use default, which is NORMAL. + RISK_LEVEL_UNSPECIFIED = 0 + + # Normal scanning (Recommended) + NORMAL = 1 + + # Lower impact scanning + LOW = 2 + end + + # Controls export of scan configurations and results to Security + # Command Center. + module ExportToSecurityCommandCenter + # Use default, which is ENABLED. + EXPORT_TO_SECURITY_COMMAND_CENTER_UNSPECIFIED = 0 + + # Export results of this scan to Security Command Center. + ENABLED = 1 + + # Do not export results of this scan to Security Command Center. + DISABLED = 2 + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-web_security_scanner-v1/proto_docs/google/cloud/websecurityscanner/v1/scan_config_error.rb b/owl-bot-staging/google-cloud-web_security_scanner-v1/proto_docs/google/cloud/websecurityscanner/v1/scan_config_error.rb new file mode 100644 index 000000000000..d8e3b62c7efe --- /dev/null +++ b/owl-bot-staging/google-cloud-web_security_scanner-v1/proto_docs/google/cloud/websecurityscanner/v1/scan_config_error.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 Cloud + module WebSecurityScanner + module V1 + # Defines a custom error message used by CreateScanConfig and UpdateScanConfig + # APIs when scan configuration validation fails. It is also reported as part of + # a ScanRunErrorTrace message if scan validation fails due to a scan + # configuration error. + # @!attribute [rw] code + # @return [::Google::Cloud::WebSecurityScanner::V1::ScanConfigError::Code] + # Output only. Indicates the reason code for a configuration failure. + # @!attribute [rw] field_name + # @return [::String] + # Output only. Indicates the full name of the ScanConfig field that triggers this error, + # for example "scan_config.max_qps". This field is provided for + # troubleshooting purposes only and its actual value can change in the + # future. + class ScanConfigError + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Output only. + # Defines an error reason code. + # Next id: 44 + module Code + # There is no error. + CODE_UNSPECIFIED = 0 + + # There is no error. + OK = 0 + + # Indicates an internal server error. + # Please DO NOT USE THIS ERROR CODE unless the root cause is truly unknown. + INTERNAL_ERROR = 1 + + # One of the seed URLs is an App Engine URL but we cannot validate the scan + # settings due to an App Engine API backend error. + APPENGINE_API_BACKEND_ERROR = 2 + + # One of the seed URLs is an App Engine URL but we cannot access the + # App Engine API to validate scan settings. + APPENGINE_API_NOT_ACCESSIBLE = 3 + + # One of the seed URLs is an App Engine URL but the Default Host of the + # App Engine is not set. + APPENGINE_DEFAULT_HOST_MISSING = 4 + + # Google corporate accounts can not be used for scanning. + CANNOT_USE_GOOGLE_COM_ACCOUNT = 6 + + # The account of the scan creator can not be used for scanning. + CANNOT_USE_OWNER_ACCOUNT = 7 + + # This scan targets Compute Engine, but we cannot validate scan settings + # due to a Compute Engine API backend error. + COMPUTE_API_BACKEND_ERROR = 8 + + # This scan targets Compute Engine, but we cannot access the Compute Engine + # API to validate the scan settings. + COMPUTE_API_NOT_ACCESSIBLE = 9 + + # The Custom Login URL does not belong to the current project. + CUSTOM_LOGIN_URL_DOES_NOT_BELONG_TO_CURRENT_PROJECT = 10 + + # The Custom Login URL is malformed (can not be parsed). + CUSTOM_LOGIN_URL_MALFORMED = 11 + + # The Custom Login URL is mapped to a non-routable IP address in DNS. + CUSTOM_LOGIN_URL_MAPPED_TO_NON_ROUTABLE_ADDRESS = 12 + + # The Custom Login URL is mapped to an IP address which is not reserved for + # the current project. + CUSTOM_LOGIN_URL_MAPPED_TO_UNRESERVED_ADDRESS = 13 + + # The Custom Login URL has a non-routable IP address. + CUSTOM_LOGIN_URL_HAS_NON_ROUTABLE_IP_ADDRESS = 14 + + # The Custom Login URL has an IP address which is not reserved for the + # current project. + CUSTOM_LOGIN_URL_HAS_UNRESERVED_IP_ADDRESS = 15 + + # Another scan with the same name (case-sensitive) already exists. + DUPLICATE_SCAN_NAME = 16 + + # A field is set to an invalid value. + INVALID_FIELD_VALUE = 18 + + # There was an error trying to authenticate to the scan target. + FAILED_TO_AUTHENTICATE_TO_TARGET = 19 + + # Finding type value is not specified in the list findings request. + FINDING_TYPE_UNSPECIFIED = 20 + + # Scan targets Compute Engine, yet current project was not whitelisted for + # Google Compute Engine Scanning Alpha access. + FORBIDDEN_TO_SCAN_COMPUTE = 21 + + # User tries to update managed scan + FORBIDDEN_UPDATE_TO_MANAGED_SCAN = 43 + + # The supplied filter is malformed. For example, it can not be parsed, does + # not have a filter type in expression, or the same filter type appears + # more than once. + MALFORMED_FILTER = 22 + + # The supplied resource name is malformed (can not be parsed). + MALFORMED_RESOURCE_NAME = 23 + + # The current project is not in an active state. + PROJECT_INACTIVE = 24 + + # A required field is not set. + REQUIRED_FIELD = 25 + + # Project id, scanconfig id, scanrun id, or finding id are not consistent + # with each other in resource name. + RESOURCE_NAME_INCONSISTENT = 26 + + # The scan being requested to start is already running. + SCAN_ALREADY_RUNNING = 27 + + # The scan that was requested to be stopped is not running. + SCAN_NOT_RUNNING = 28 + + # One of the seed URLs does not belong to the current project. + SEED_URL_DOES_NOT_BELONG_TO_CURRENT_PROJECT = 29 + + # One of the seed URLs is malformed (can not be parsed). + SEED_URL_MALFORMED = 30 + + # One of the seed URLs is mapped to a non-routable IP address in DNS. + SEED_URL_MAPPED_TO_NON_ROUTABLE_ADDRESS = 31 + + # One of the seed URLs is mapped to an IP address which is not reserved + # for the current project. + SEED_URL_MAPPED_TO_UNRESERVED_ADDRESS = 32 + + # One of the seed URLs has on-routable IP address. + SEED_URL_HAS_NON_ROUTABLE_IP_ADDRESS = 33 + + # One of the seed URLs has an IP address that is not reserved + # for the current project. + SEED_URL_HAS_UNRESERVED_IP_ADDRESS = 35 + + # The Web Security Scanner service account is not configured under the + # project. + SERVICE_ACCOUNT_NOT_CONFIGURED = 36 + + # A project has reached the maximum number of scans. + TOO_MANY_SCANS = 37 + + # Resolving the details of the current project fails. + UNABLE_TO_RESOLVE_PROJECT_INFO = 38 + + # One or more blacklist patterns were in the wrong format. + UNSUPPORTED_BLACKLIST_PATTERN_FORMAT = 39 + + # The supplied filter is not supported. + UNSUPPORTED_FILTER = 40 + + # The supplied finding type is not supported. For example, we do not + # provide findings of the given finding type. + UNSUPPORTED_FINDING_TYPE = 41 + + # The URL scheme of one or more of the supplied URLs is not supported. + UNSUPPORTED_URL_SCHEME = 42 + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-web_security_scanner-v1/proto_docs/google/cloud/websecurityscanner/v1/scan_run.rb b/owl-bot-staging/google-cloud-web_security_scanner-v1/proto_docs/google/cloud/websecurityscanner/v1/scan_run.rb new file mode 100644 index 000000000000..a7b461044a50 --- /dev/null +++ b/owl-bot-staging/google-cloud-web_security_scanner-v1/proto_docs/google/cloud/websecurityscanner/v1/scan_run.rb @@ -0,0 +1,110 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 WebSecurityScanner + module V1 + # A ScanRun is a output-only resource representing an actual run of the scan. + # Next id: 12 + # @!attribute [rw] name + # @return [::String] + # Output only. The resource name of the ScanRun. The name follows the format of + # 'projects/\\{projectId}/scanConfigs/\\{scanConfigId}/scanRuns/\\{scanRunId}'. + # The ScanRun IDs are generated by the system. + # @!attribute [rw] execution_state + # @return [::Google::Cloud::WebSecurityScanner::V1::ScanRun::ExecutionState] + # Output only. The execution state of the ScanRun. + # @!attribute [rw] result_state + # @return [::Google::Cloud::WebSecurityScanner::V1::ScanRun::ResultState] + # Output only. The result state of the ScanRun. This field is only available after the + # execution state reaches "FINISHED". + # @!attribute [rw] start_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time at which the ScanRun started. + # @!attribute [rw] end_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time at which the ScanRun reached termination state - that the ScanRun + # is either finished or stopped by user. + # @!attribute [rw] urls_crawled_count + # @return [::Integer] + # Output only. The number of URLs crawled during this ScanRun. If the scan is in progress, + # the value represents the number of URLs crawled up to now. + # @!attribute [rw] urls_tested_count + # @return [::Integer] + # Output only. The number of URLs tested during this ScanRun. If the scan is in progress, + # the value represents the number of URLs tested up to now. The number of + # URLs tested is usually larger than the number URLS crawled because + # typically a crawled URL is tested with multiple test payloads. + # @!attribute [rw] has_vulnerabilities + # @return [::Boolean] + # Output only. Whether the scan run has found any vulnerabilities. + # @!attribute [rw] progress_percent + # @return [::Integer] + # Output only. The percentage of total completion ranging from 0 to 100. + # If the scan is in queue, the value is 0. + # If the scan is running, the value ranges from 0 to 100. + # If the scan is finished, the value is 100. + # @!attribute [rw] error_trace + # @return [::Google::Cloud::WebSecurityScanner::V1::ScanRunErrorTrace] + # Output only. If result_state is an ERROR, this field provides the primary reason for + # scan's termination and more details, if such are available. + # @!attribute [rw] warning_traces + # @return [::Array<::Google::Cloud::WebSecurityScanner::V1::ScanRunWarningTrace>] + # Output only. A list of warnings, if such are encountered during this scan run. + class ScanRun + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Types of ScanRun execution state. + module ExecutionState + # Represents an invalid state caused by internal server error. This value + # should never be returned. + EXECUTION_STATE_UNSPECIFIED = 0 + + # The scan is waiting in the queue. + QUEUED = 1 + + # The scan is in progress. + SCANNING = 2 + + # The scan is either finished or stopped by user. + FINISHED = 3 + end + + # Types of ScanRun result state. + module ResultState + # Default value. This value is returned when the ScanRun is not yet + # finished. + RESULT_STATE_UNSPECIFIED = 0 + + # The scan finished without errors. + SUCCESS = 1 + + # The scan finished with errors. + ERROR = 2 + + # The scan was terminated by user. + KILLED = 3 + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-web_security_scanner-v1/proto_docs/google/cloud/websecurityscanner/v1/scan_run_error_trace.rb b/owl-bot-staging/google-cloud-web_security_scanner-v1/proto_docs/google/cloud/websecurityscanner/v1/scan_run_error_trace.rb new file mode 100644 index 000000000000..c5e493b73771 --- /dev/null +++ b/owl-bot-staging/google-cloud-web_security_scanner-v1/proto_docs/google/cloud/websecurityscanner/v1/scan_run_error_trace.rb @@ -0,0 +1,77 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 WebSecurityScanner + module V1 + # Output only. + # Defines an error trace message for a ScanRun. + # @!attribute [rw] code + # @return [::Google::Cloud::WebSecurityScanner::V1::ScanRunErrorTrace::Code] + # Output only. Indicates the error reason code. + # @!attribute [rw] scan_config_error + # @return [::Google::Cloud::WebSecurityScanner::V1::ScanConfigError] + # Output only. If the scan encounters SCAN_CONFIG_ISSUE error, this field has the error + # message encountered during scan configuration validation that is performed + # before each scan run. + # @!attribute [rw] most_common_http_error_code + # @return [::Integer] + # Output only. If the scan encounters TOO_MANY_HTTP_ERRORS, this field indicates the most + # common HTTP error code, if such is available. For example, if this code is + # 404, the scan has encountered too many NOT_FOUND responses. + class ScanRunErrorTrace + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Output only. + # Defines an error reason code. + # Next id: 8 + module Code + # Default value is never used. + CODE_UNSPECIFIED = 0 + + # Indicates that the scan run failed due to an internal server error. + INTERNAL_ERROR = 1 + + # Indicates a scan configuration error, usually due to outdated ScanConfig + # settings, such as starting_urls or the DNS configuration. + SCAN_CONFIG_ISSUE = 2 + + # Indicates an authentication error, usually due to outdated ScanConfig + # authentication settings. + AUTHENTICATION_CONFIG_ISSUE = 3 + + # Indicates a scan operation timeout, usually caused by a very large site. + TIMED_OUT_WHILE_SCANNING = 4 + + # Indicates that a scan encountered excessive redirects, either to + # authentication or some other page outside of the scan scope. + TOO_MANY_REDIRECTS = 5 + + # Indicates that a scan encountered numerous errors from the web site + # pages. When available, most_common_http_error_code field indicates the + # most common HTTP error code encountered during the scan. + TOO_MANY_HTTP_ERRORS = 6 + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-web_security_scanner-v1/proto_docs/google/cloud/websecurityscanner/v1/scan_run_log.rb b/owl-bot-staging/google-cloud-web_security_scanner-v1/proto_docs/google/cloud/websecurityscanner/v1/scan_run_log.rb new file mode 100644 index 000000000000..dcf836b52240 --- /dev/null +++ b/owl-bot-staging/google-cloud-web_security_scanner-v1/proto_docs/google/cloud/websecurityscanner/v1/scan_run_log.rb @@ -0,0 +1,56 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 WebSecurityScanner + module V1 + # A ScanRunLog is an output-only proto used for Stackdriver customer logging. + # It is used for logs covering the start and end of scan pipelines. + # Other than an added summary, this is a subset of the ScanRun. + # Representation in logs is either a proto Struct, or converted to JSON. + # Next id: 9 + # @!attribute [rw] summary + # @return [::String] + # Human friendly message about the event. + # @!attribute [rw] name + # @return [::String] + # The resource name of the ScanRun being logged. + # @!attribute [rw] execution_state + # @return [::Google::Cloud::WebSecurityScanner::V1::ScanRun::ExecutionState] + # The execution state of the ScanRun. + # @!attribute [rw] result_state + # @return [::Google::Cloud::WebSecurityScanner::V1::ScanRun::ResultState] + # The result state of the ScanRun. + # @!attribute [rw] urls_crawled_count + # @return [::Integer] + # @!attribute [rw] urls_tested_count + # @return [::Integer] + # @!attribute [rw] has_findings + # @return [::Boolean] + # @!attribute [rw] error_trace + # @return [::Google::Cloud::WebSecurityScanner::V1::ScanRunErrorTrace] + class ScanRunLog + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-web_security_scanner-v1/proto_docs/google/cloud/websecurityscanner/v1/scan_run_warning_trace.rb b/owl-bot-staging/google-cloud-web_security_scanner-v1/proto_docs/google/cloud/websecurityscanner/v1/scan_run_warning_trace.rb new file mode 100644 index 000000000000..c6d38093f5ee --- /dev/null +++ b/owl-bot-staging/google-cloud-web_security_scanner-v1/proto_docs/google/cloud/websecurityscanner/v1/scan_run_warning_trace.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! + + +module Google + module Cloud + module WebSecurityScanner + module V1 + # Output only. + # Defines a warning trace message for ScanRun. Warning traces provide customers + # with useful information that helps make the scanning process more effective. + # @!attribute [rw] code + # @return [::Google::Cloud::WebSecurityScanner::V1::ScanRunWarningTrace::Code] + # Output only. Indicates the warning code. + class ScanRunWarningTrace + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Output only. + # Defines a warning message code. + # Next id: 6 + module Code + # Default value is never used. + CODE_UNSPECIFIED = 0 + + # Indicates that a scan discovered an unexpectedly low number of URLs. This + # is sometimes caused by complex navigation features or by using a single + # URL for numerous pages. + INSUFFICIENT_CRAWL_RESULTS = 1 + + # Indicates that a scan discovered too many URLs to test, or excessive + # redundant URLs. + TOO_MANY_CRAWL_RESULTS = 2 + + # Indicates that too many tests have been generated for the scan. Customer + # should try reducing the number of starting URLs, increasing the QPS rate, + # or narrowing down the scope of the scan using the excluded patterns. + TOO_MANY_FUZZ_TASKS = 3 + + # Indicates that a scan is blocked by IAP. + BLOCKED_BY_IAP = 4 + + # Indicates that no seeds is found for a scan + NO_STARTING_URL_FOUND_FOR_MANAGED_SCAN = 5 + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-web_security_scanner-v1/proto_docs/google/cloud/websecurityscanner/v1/web_security_scanner.rb b/owl-bot-staging/google-cloud-web_security_scanner-v1/proto_docs/google/cloud/websecurityscanner/v1/web_security_scanner.rb new file mode 100644 index 000000000000..218897aed41e --- /dev/null +++ b/owl-bot-staging/google-cloud-web_security_scanner-v1/proto_docs/google/cloud/websecurityscanner/v1/web_security_scanner.rb @@ -0,0 +1,278 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 WebSecurityScanner + module V1 + # Request for the `CreateScanConfig` method. + # @!attribute [rw] parent + # @return [::String] + # Required. The parent resource name where the scan is created, which should be a + # project resource name in the format 'projects/\\{projectId}'. + # @!attribute [rw] scan_config + # @return [::Google::Cloud::WebSecurityScanner::V1::ScanConfig] + # Required. The ScanConfig to be created. + class CreateScanConfigRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request for the `DeleteScanConfig` method. + # @!attribute [rw] name + # @return [::String] + # Required. The resource name of the ScanConfig to be deleted. The name follows the + # format of 'projects/\\{projectId}/scanConfigs/\\{scanConfigId}'. + class DeleteScanConfigRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request for the `GetScanConfig` method. + # @!attribute [rw] name + # @return [::String] + # Required. The resource name of the ScanConfig to be returned. The name follows the + # format of 'projects/\\{projectId}/scanConfigs/\\{scanConfigId}'. + class GetScanConfigRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request for the `ListScanConfigs` method. + # @!attribute [rw] parent + # @return [::String] + # Required. The parent resource name, which should be a project resource name in the + # format 'projects/\\{projectId}'. + # @!attribute [rw] page_token + # @return [::String] + # A token identifying a page of results to be returned. This should be a + # `next_page_token` value returned from a previous List request. + # If unspecified, the first page of results is returned. + # @!attribute [rw] page_size + # @return [::Integer] + # The maximum number of ScanConfigs to return, can be limited by server. + # If not specified or not positive, the implementation will select a + # reasonable value. + class ListScanConfigsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request for the `UpdateScanConfigRequest` method. + # @!attribute [rw] scan_config + # @return [::Google::Cloud::WebSecurityScanner::V1::ScanConfig] + # Required. The ScanConfig to be updated. The name field must be set to identify the + # resource to be updated. The values of fields not covered by the mask + # will be ignored. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # Required. The update mask applies to the resource. For the `FieldMask` definition, + # see + # https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask + class UpdateScanConfigRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response for the `ListScanConfigs` method. + # @!attribute [rw] scan_configs + # @return [::Array<::Google::Cloud::WebSecurityScanner::V1::ScanConfig>] + # The list of ScanConfigs returned. + # @!attribute [rw] next_page_token + # @return [::String] + # Token to retrieve the next page of results, or empty if there are no + # more results in the list. + class ListScanConfigsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request for the `StartScanRun` method. + # @!attribute [rw] name + # @return [::String] + # Required. The resource name of the ScanConfig to be used. The name follows the + # format of 'projects/\\{projectId}/scanConfigs/\\{scanConfigId}'. + class StartScanRunRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request for the `GetScanRun` method. + # @!attribute [rw] name + # @return [::String] + # Required. The resource name of the ScanRun to be returned. The name follows the + # format of + # 'projects/\\{projectId}/scanConfigs/\\{scanConfigId}/scanRuns/\\{scanRunId}'. + class GetScanRunRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request for the `ListScanRuns` method. + # @!attribute [rw] parent + # @return [::String] + # Required. The parent resource name, which should be a scan resource name in the + # format 'projects/\\{projectId}/scanConfigs/\\{scanConfigId}'. + # @!attribute [rw] page_token + # @return [::String] + # A token identifying a page of results to be returned. This should be a + # `next_page_token` value returned from a previous List request. + # If unspecified, the first page of results is returned. + # @!attribute [rw] page_size + # @return [::Integer] + # The maximum number of ScanRuns to return, can be limited by server. + # If not specified or not positive, the implementation will select a + # reasonable value. + class ListScanRunsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response for the `ListScanRuns` method. + # @!attribute [rw] scan_runs + # @return [::Array<::Google::Cloud::WebSecurityScanner::V1::ScanRun>] + # The list of ScanRuns returned. + # @!attribute [rw] next_page_token + # @return [::String] + # Token to retrieve the next page of results, or empty if there are no + # more results in the list. + class ListScanRunsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request for the `StopScanRun` method. + # @!attribute [rw] name + # @return [::String] + # Required. The resource name of the ScanRun to be stopped. The name follows the + # format of + # 'projects/\\{projectId}/scanConfigs/\\{scanConfigId}/scanRuns/\\{scanRunId}'. + class StopScanRunRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request for the `ListCrawledUrls` method. + # @!attribute [rw] parent + # @return [::String] + # Required. The parent resource name, which should be a scan run resource name in the + # format + # 'projects/\\{projectId}/scanConfigs/\\{scanConfigId}/scanRuns/\\{scanRunId}'. + # @!attribute [rw] page_token + # @return [::String] + # A token identifying a page of results to be returned. This should be a + # `next_page_token` value returned from a previous List request. + # If unspecified, the first page of results is returned. + # @!attribute [rw] page_size + # @return [::Integer] + # The maximum number of CrawledUrls to return, can be limited by server. + # If not specified or not positive, the implementation will select a + # reasonable value. + class ListCrawledUrlsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response for the `ListCrawledUrls` method. + # @!attribute [rw] crawled_urls + # @return [::Array<::Google::Cloud::WebSecurityScanner::V1::CrawledUrl>] + # The list of CrawledUrls returned. + # @!attribute [rw] next_page_token + # @return [::String] + # Token to retrieve the next page of results, or empty if there are no + # more results in the list. + class ListCrawledUrlsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request for the `GetFinding` method. + # @!attribute [rw] name + # @return [::String] + # Required. The resource name of the Finding to be returned. The name follows the + # format of + # 'projects/\\{projectId}/scanConfigs/\\{scanConfigId}/scanRuns/\\{scanRunId}/findings/\\{findingId}'. + class GetFindingRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request for the `ListFindings` method. + # @!attribute [rw] parent + # @return [::String] + # Required. The parent resource name, which should be a scan run resource name in the + # format + # 'projects/\\{projectId}/scanConfigs/\\{scanConfigId}/scanRuns/\\{scanRunId}'. + # @!attribute [rw] filter + # @return [::String] + # The filter expression. The expression must be in the format: + # . + # Supported field: 'finding_type'. + # Supported operator: '='. + # @!attribute [rw] page_token + # @return [::String] + # A token identifying a page of results to be returned. This should be a + # `next_page_token` value returned from a previous List request. + # If unspecified, the first page of results is returned. + # @!attribute [rw] page_size + # @return [::Integer] + # The maximum number of Findings to return, can be limited by server. + # If not specified or not positive, the implementation will select a + # reasonable value. + class ListFindingsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response for the `ListFindings` method. + # @!attribute [rw] findings + # @return [::Array<::Google::Cloud::WebSecurityScanner::V1::Finding>] + # The list of Findings returned. + # @!attribute [rw] next_page_token + # @return [::String] + # Token to retrieve the next page of results, or empty if there are no + # more results in the list. + class ListFindingsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request for the `ListFindingTypeStats` method. + # @!attribute [rw] parent + # @return [::String] + # Required. The parent resource name, which should be a scan run resource name in the + # format + # 'projects/\\{projectId}/scanConfigs/\\{scanConfigId}/scanRuns/\\{scanRunId}'. + class ListFindingTypeStatsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response for the `ListFindingTypeStats` method. + # @!attribute [rw] finding_type_stats + # @return [::Array<::Google::Cloud::WebSecurityScanner::V1::FindingTypeStats>] + # The list of FindingTypeStats returned. + class ListFindingTypeStatsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-web_security_scanner-v1/proto_docs/google/protobuf/duration.rb b/owl-bot-staging/google-cloud-web_security_scanner-v1/proto_docs/google/protobuf/duration.rb new file mode 100644 index 000000000000..ea59f1f91daf --- /dev/null +++ b/owl-bot-staging/google-cloud-web_security_scanner-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-web_security_scanner-v1/proto_docs/google/protobuf/empty.rb b/owl-bot-staging/google-cloud-web_security_scanner-v1/proto_docs/google/protobuf/empty.rb new file mode 100644 index 000000000000..83e4481834a6 --- /dev/null +++ b/owl-bot-staging/google-cloud-web_security_scanner-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-web_security_scanner-v1/proto_docs/google/protobuf/field_mask.rb b/owl-bot-staging/google-cloud-web_security_scanner-v1/proto_docs/google/protobuf/field_mask.rb new file mode 100644 index 000000000000..7f3ffc78601a --- /dev/null +++ b/owl-bot-staging/google-cloud-web_security_scanner-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-web_security_scanner-v1/proto_docs/google/protobuf/timestamp.rb b/owl-bot-staging/google-cloud-web_security_scanner-v1/proto_docs/google/protobuf/timestamp.rb new file mode 100644 index 000000000000..74352be9c58c --- /dev/null +++ b/owl-bot-staging/google-cloud-web_security_scanner-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-web_security_scanner-v1/snippets/Gemfile b/owl-bot-staging/google-cloud-web_security_scanner-v1/snippets/Gemfile new file mode 100644 index 000000000000..9c79128c7f82 --- /dev/null +++ b/owl-bot-staging/google-cloud-web_security_scanner-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-web_security_scanner-v1", path: "../" +else + gem "google-cloud-web_security_scanner-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-web_security_scanner-v1/snippets/snippet_metadata_google.cloud.websecurityscanner.v1.json b/owl-bot-staging/google-cloud-web_security_scanner-v1/snippets/snippet_metadata_google.cloud.websecurityscanner.v1.json new file mode 100644 index 000000000000..ff90b544b895 --- /dev/null +++ b/owl-bot-staging/google-cloud-web_security_scanner-v1/snippets/snippet_metadata_google.cloud.websecurityscanner.v1.json @@ -0,0 +1,535 @@ +{ + "client_library": { + "name": "google-cloud-web_security_scanner-v1", + "version": "", + "language": "RUBY", + "apis": [ + { + "id": "google.cloud.websecurityscanner.v1", + "version": "v1" + } + ] + }, + "snippets": [ + { + "region_tag": "websecurityscanner_v1_generated_WebSecurityScanner_CreateScanConfig_sync", + "title": "Snippet for the create_scan_config call in the WebSecurityScanner service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client#create_scan_config.", + "file": "web_security_scanner/create_scan_config.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_scan_config", + "full_name": "::Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client#create_scan_config", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::WebSecurityScanner::V1::CreateScanConfigRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::WebSecurityScanner::V1::ScanConfig", + "client": { + "short_name": "WebSecurityScanner::Client", + "full_name": "::Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client" + }, + "method": { + "short_name": "CreateScanConfig", + "full_name": "google.cloud.websecurityscanner.v1.WebSecurityScanner.CreateScanConfig", + "service": { + "short_name": "WebSecurityScanner", + "full_name": "google.cloud.websecurityscanner.v1.WebSecurityScanner" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "websecurityscanner_v1_generated_WebSecurityScanner_DeleteScanConfig_sync", + "title": "Snippet for the delete_scan_config call in the WebSecurityScanner service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client#delete_scan_config.", + "file": "web_security_scanner/delete_scan_config.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_scan_config", + "full_name": "::Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client#delete_scan_config", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::WebSecurityScanner::V1::DeleteScanConfigRequest", + "name": "request" + } + ], + "result_type": "::Google::Protobuf::Empty", + "client": { + "short_name": "WebSecurityScanner::Client", + "full_name": "::Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client" + }, + "method": { + "short_name": "DeleteScanConfig", + "full_name": "google.cloud.websecurityscanner.v1.WebSecurityScanner.DeleteScanConfig", + "service": { + "short_name": "WebSecurityScanner", + "full_name": "google.cloud.websecurityscanner.v1.WebSecurityScanner" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "websecurityscanner_v1_generated_WebSecurityScanner_GetScanConfig_sync", + "title": "Snippet for the get_scan_config call in the WebSecurityScanner service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client#get_scan_config.", + "file": "web_security_scanner/get_scan_config.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_scan_config", + "full_name": "::Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client#get_scan_config", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::WebSecurityScanner::V1::GetScanConfigRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::WebSecurityScanner::V1::ScanConfig", + "client": { + "short_name": "WebSecurityScanner::Client", + "full_name": "::Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client" + }, + "method": { + "short_name": "GetScanConfig", + "full_name": "google.cloud.websecurityscanner.v1.WebSecurityScanner.GetScanConfig", + "service": { + "short_name": "WebSecurityScanner", + "full_name": "google.cloud.websecurityscanner.v1.WebSecurityScanner" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "websecurityscanner_v1_generated_WebSecurityScanner_ListScanConfigs_sync", + "title": "Snippet for the list_scan_configs call in the WebSecurityScanner service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client#list_scan_configs.", + "file": "web_security_scanner/list_scan_configs.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_scan_configs", + "full_name": "::Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client#list_scan_configs", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::WebSecurityScanner::V1::ListScanConfigsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::WebSecurityScanner::V1::ListScanConfigsResponse", + "client": { + "short_name": "WebSecurityScanner::Client", + "full_name": "::Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client" + }, + "method": { + "short_name": "ListScanConfigs", + "full_name": "google.cloud.websecurityscanner.v1.WebSecurityScanner.ListScanConfigs", + "service": { + "short_name": "WebSecurityScanner", + "full_name": "google.cloud.websecurityscanner.v1.WebSecurityScanner" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "websecurityscanner_v1_generated_WebSecurityScanner_UpdateScanConfig_sync", + "title": "Snippet for the update_scan_config call in the WebSecurityScanner service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client#update_scan_config.", + "file": "web_security_scanner/update_scan_config.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_scan_config", + "full_name": "::Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client#update_scan_config", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::WebSecurityScanner::V1::UpdateScanConfigRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::WebSecurityScanner::V1::ScanConfig", + "client": { + "short_name": "WebSecurityScanner::Client", + "full_name": "::Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client" + }, + "method": { + "short_name": "UpdateScanConfig", + "full_name": "google.cloud.websecurityscanner.v1.WebSecurityScanner.UpdateScanConfig", + "service": { + "short_name": "WebSecurityScanner", + "full_name": "google.cloud.websecurityscanner.v1.WebSecurityScanner" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "websecurityscanner_v1_generated_WebSecurityScanner_StartScanRun_sync", + "title": "Snippet for the start_scan_run call in the WebSecurityScanner service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client#start_scan_run.", + "file": "web_security_scanner/start_scan_run.rb", + "language": "RUBY", + "client_method": { + "short_name": "start_scan_run", + "full_name": "::Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client#start_scan_run", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::WebSecurityScanner::V1::StartScanRunRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::WebSecurityScanner::V1::ScanRun", + "client": { + "short_name": "WebSecurityScanner::Client", + "full_name": "::Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client" + }, + "method": { + "short_name": "StartScanRun", + "full_name": "google.cloud.websecurityscanner.v1.WebSecurityScanner.StartScanRun", + "service": { + "short_name": "WebSecurityScanner", + "full_name": "google.cloud.websecurityscanner.v1.WebSecurityScanner" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "websecurityscanner_v1_generated_WebSecurityScanner_GetScanRun_sync", + "title": "Snippet for the get_scan_run call in the WebSecurityScanner service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client#get_scan_run.", + "file": "web_security_scanner/get_scan_run.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_scan_run", + "full_name": "::Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client#get_scan_run", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::WebSecurityScanner::V1::GetScanRunRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::WebSecurityScanner::V1::ScanRun", + "client": { + "short_name": "WebSecurityScanner::Client", + "full_name": "::Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client" + }, + "method": { + "short_name": "GetScanRun", + "full_name": "google.cloud.websecurityscanner.v1.WebSecurityScanner.GetScanRun", + "service": { + "short_name": "WebSecurityScanner", + "full_name": "google.cloud.websecurityscanner.v1.WebSecurityScanner" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "websecurityscanner_v1_generated_WebSecurityScanner_ListScanRuns_sync", + "title": "Snippet for the list_scan_runs call in the WebSecurityScanner service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client#list_scan_runs.", + "file": "web_security_scanner/list_scan_runs.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_scan_runs", + "full_name": "::Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client#list_scan_runs", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::WebSecurityScanner::V1::ListScanRunsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::WebSecurityScanner::V1::ListScanRunsResponse", + "client": { + "short_name": "WebSecurityScanner::Client", + "full_name": "::Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client" + }, + "method": { + "short_name": "ListScanRuns", + "full_name": "google.cloud.websecurityscanner.v1.WebSecurityScanner.ListScanRuns", + "service": { + "short_name": "WebSecurityScanner", + "full_name": "google.cloud.websecurityscanner.v1.WebSecurityScanner" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "websecurityscanner_v1_generated_WebSecurityScanner_StopScanRun_sync", + "title": "Snippet for the stop_scan_run call in the WebSecurityScanner service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client#stop_scan_run.", + "file": "web_security_scanner/stop_scan_run.rb", + "language": "RUBY", + "client_method": { + "short_name": "stop_scan_run", + "full_name": "::Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client#stop_scan_run", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::WebSecurityScanner::V1::StopScanRunRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::WebSecurityScanner::V1::ScanRun", + "client": { + "short_name": "WebSecurityScanner::Client", + "full_name": "::Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client" + }, + "method": { + "short_name": "StopScanRun", + "full_name": "google.cloud.websecurityscanner.v1.WebSecurityScanner.StopScanRun", + "service": { + "short_name": "WebSecurityScanner", + "full_name": "google.cloud.websecurityscanner.v1.WebSecurityScanner" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "websecurityscanner_v1_generated_WebSecurityScanner_ListCrawledUrls_sync", + "title": "Snippet for the list_crawled_urls call in the WebSecurityScanner service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client#list_crawled_urls.", + "file": "web_security_scanner/list_crawled_urls.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_crawled_urls", + "full_name": "::Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client#list_crawled_urls", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::WebSecurityScanner::V1::ListCrawledUrlsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::WebSecurityScanner::V1::ListCrawledUrlsResponse", + "client": { + "short_name": "WebSecurityScanner::Client", + "full_name": "::Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client" + }, + "method": { + "short_name": "ListCrawledUrls", + "full_name": "google.cloud.websecurityscanner.v1.WebSecurityScanner.ListCrawledUrls", + "service": { + "short_name": "WebSecurityScanner", + "full_name": "google.cloud.websecurityscanner.v1.WebSecurityScanner" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "websecurityscanner_v1_generated_WebSecurityScanner_GetFinding_sync", + "title": "Snippet for the get_finding call in the WebSecurityScanner service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client#get_finding.", + "file": "web_security_scanner/get_finding.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_finding", + "full_name": "::Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client#get_finding", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::WebSecurityScanner::V1::GetFindingRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::WebSecurityScanner::V1::Finding", + "client": { + "short_name": "WebSecurityScanner::Client", + "full_name": "::Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client" + }, + "method": { + "short_name": "GetFinding", + "full_name": "google.cloud.websecurityscanner.v1.WebSecurityScanner.GetFinding", + "service": { + "short_name": "WebSecurityScanner", + "full_name": "google.cloud.websecurityscanner.v1.WebSecurityScanner" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "websecurityscanner_v1_generated_WebSecurityScanner_ListFindings_sync", + "title": "Snippet for the list_findings call in the WebSecurityScanner service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client#list_findings.", + "file": "web_security_scanner/list_findings.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_findings", + "full_name": "::Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client#list_findings", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::WebSecurityScanner::V1::ListFindingsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::WebSecurityScanner::V1::ListFindingsResponse", + "client": { + "short_name": "WebSecurityScanner::Client", + "full_name": "::Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client" + }, + "method": { + "short_name": "ListFindings", + "full_name": "google.cloud.websecurityscanner.v1.WebSecurityScanner.ListFindings", + "service": { + "short_name": "WebSecurityScanner", + "full_name": "google.cloud.websecurityscanner.v1.WebSecurityScanner" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "websecurityscanner_v1_generated_WebSecurityScanner_ListFindingTypeStats_sync", + "title": "Snippet for the list_finding_type_stats call in the WebSecurityScanner service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client#list_finding_type_stats.", + "file": "web_security_scanner/list_finding_type_stats.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_finding_type_stats", + "full_name": "::Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client#list_finding_type_stats", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::WebSecurityScanner::V1::ListFindingTypeStatsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::WebSecurityScanner::V1::ListFindingTypeStatsResponse", + "client": { + "short_name": "WebSecurityScanner::Client", + "full_name": "::Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client" + }, + "method": { + "short_name": "ListFindingTypeStats", + "full_name": "google.cloud.websecurityscanner.v1.WebSecurityScanner.ListFindingTypeStats", + "service": { + "short_name": "WebSecurityScanner", + "full_name": "google.cloud.websecurityscanner.v1.WebSecurityScanner" + } + } + }, + "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-web_security_scanner-v1/snippets/web_security_scanner/create_scan_config.rb b/owl-bot-staging/google-cloud-web_security_scanner-v1/snippets/web_security_scanner/create_scan_config.rb new file mode 100644 index 000000000000..3411dbe3c686 --- /dev/null +++ b/owl-bot-staging/google-cloud-web_security_scanner-v1/snippets/web_security_scanner/create_scan_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 websecurityscanner_v1_generated_WebSecurityScanner_CreateScanConfig_sync] +require "google/cloud/web_security_scanner/v1" + +## +# Snippet for the create_scan_config call in the WebSecurityScanner 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::WebSecurityScanner::V1::WebSecurityScanner::Client#create_scan_config. +# +def create_scan_config + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::WebSecurityScanner::V1::CreateScanConfigRequest.new + + # Call the create_scan_config method. + result = client.create_scan_config request + + # The returned object is of type Google::Cloud::WebSecurityScanner::V1::ScanConfig. + p result +end +# [END websecurityscanner_v1_generated_WebSecurityScanner_CreateScanConfig_sync] diff --git a/owl-bot-staging/google-cloud-web_security_scanner-v1/snippets/web_security_scanner/delete_scan_config.rb b/owl-bot-staging/google-cloud-web_security_scanner-v1/snippets/web_security_scanner/delete_scan_config.rb new file mode 100644 index 000000000000..3c3c38833327 --- /dev/null +++ b/owl-bot-staging/google-cloud-web_security_scanner-v1/snippets/web_security_scanner/delete_scan_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 websecurityscanner_v1_generated_WebSecurityScanner_DeleteScanConfig_sync] +require "google/cloud/web_security_scanner/v1" + +## +# Snippet for the delete_scan_config call in the WebSecurityScanner 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::WebSecurityScanner::V1::WebSecurityScanner::Client#delete_scan_config. +# +def delete_scan_config + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::WebSecurityScanner::V1::DeleteScanConfigRequest.new + + # Call the delete_scan_config method. + result = client.delete_scan_config request + + # The returned object is of type Google::Protobuf::Empty. + p result +end +# [END websecurityscanner_v1_generated_WebSecurityScanner_DeleteScanConfig_sync] diff --git a/owl-bot-staging/google-cloud-web_security_scanner-v1/snippets/web_security_scanner/get_finding.rb b/owl-bot-staging/google-cloud-web_security_scanner-v1/snippets/web_security_scanner/get_finding.rb new file mode 100644 index 000000000000..7264a0da4ec4 --- /dev/null +++ b/owl-bot-staging/google-cloud-web_security_scanner-v1/snippets/web_security_scanner/get_finding.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 websecurityscanner_v1_generated_WebSecurityScanner_GetFinding_sync] +require "google/cloud/web_security_scanner/v1" + +## +# Snippet for the get_finding call in the WebSecurityScanner 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::WebSecurityScanner::V1::WebSecurityScanner::Client#get_finding. +# +def get_finding + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::WebSecurityScanner::V1::GetFindingRequest.new + + # Call the get_finding method. + result = client.get_finding request + + # The returned object is of type Google::Cloud::WebSecurityScanner::V1::Finding. + p result +end +# [END websecurityscanner_v1_generated_WebSecurityScanner_GetFinding_sync] diff --git a/owl-bot-staging/google-cloud-web_security_scanner-v1/snippets/web_security_scanner/get_scan_config.rb b/owl-bot-staging/google-cloud-web_security_scanner-v1/snippets/web_security_scanner/get_scan_config.rb new file mode 100644 index 000000000000..e98d311e44c2 --- /dev/null +++ b/owl-bot-staging/google-cloud-web_security_scanner-v1/snippets/web_security_scanner/get_scan_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 websecurityscanner_v1_generated_WebSecurityScanner_GetScanConfig_sync] +require "google/cloud/web_security_scanner/v1" + +## +# Snippet for the get_scan_config call in the WebSecurityScanner 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::WebSecurityScanner::V1::WebSecurityScanner::Client#get_scan_config. +# +def get_scan_config + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::WebSecurityScanner::V1::GetScanConfigRequest.new + + # Call the get_scan_config method. + result = client.get_scan_config request + + # The returned object is of type Google::Cloud::WebSecurityScanner::V1::ScanConfig. + p result +end +# [END websecurityscanner_v1_generated_WebSecurityScanner_GetScanConfig_sync] diff --git a/owl-bot-staging/google-cloud-web_security_scanner-v1/snippets/web_security_scanner/get_scan_run.rb b/owl-bot-staging/google-cloud-web_security_scanner-v1/snippets/web_security_scanner/get_scan_run.rb new file mode 100644 index 000000000000..81e3f63c8ea6 --- /dev/null +++ b/owl-bot-staging/google-cloud-web_security_scanner-v1/snippets/web_security_scanner/get_scan_run.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 websecurityscanner_v1_generated_WebSecurityScanner_GetScanRun_sync] +require "google/cloud/web_security_scanner/v1" + +## +# Snippet for the get_scan_run call in the WebSecurityScanner 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::WebSecurityScanner::V1::WebSecurityScanner::Client#get_scan_run. +# +def get_scan_run + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::WebSecurityScanner::V1::GetScanRunRequest.new + + # Call the get_scan_run method. + result = client.get_scan_run request + + # The returned object is of type Google::Cloud::WebSecurityScanner::V1::ScanRun. + p result +end +# [END websecurityscanner_v1_generated_WebSecurityScanner_GetScanRun_sync] diff --git a/owl-bot-staging/google-cloud-web_security_scanner-v1/snippets/web_security_scanner/list_crawled_urls.rb b/owl-bot-staging/google-cloud-web_security_scanner-v1/snippets/web_security_scanner/list_crawled_urls.rb new file mode 100644 index 000000000000..c168ec342ee5 --- /dev/null +++ b/owl-bot-staging/google-cloud-web_security_scanner-v1/snippets/web_security_scanner/list_crawled_urls.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 websecurityscanner_v1_generated_WebSecurityScanner_ListCrawledUrls_sync] +require "google/cloud/web_security_scanner/v1" + +## +# Snippet for the list_crawled_urls call in the WebSecurityScanner 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::WebSecurityScanner::V1::WebSecurityScanner::Client#list_crawled_urls. +# +def list_crawled_urls + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::WebSecurityScanner::V1::ListCrawledUrlsRequest.new + + # Call the list_crawled_urls method. + result = client.list_crawled_urls 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::WebSecurityScanner::V1::CrawledUrl. + p item + end +end +# [END websecurityscanner_v1_generated_WebSecurityScanner_ListCrawledUrls_sync] diff --git a/owl-bot-staging/google-cloud-web_security_scanner-v1/snippets/web_security_scanner/list_finding_type_stats.rb b/owl-bot-staging/google-cloud-web_security_scanner-v1/snippets/web_security_scanner/list_finding_type_stats.rb new file mode 100644 index 000000000000..b86e8985075e --- /dev/null +++ b/owl-bot-staging/google-cloud-web_security_scanner-v1/snippets/web_security_scanner/list_finding_type_stats.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 websecurityscanner_v1_generated_WebSecurityScanner_ListFindingTypeStats_sync] +require "google/cloud/web_security_scanner/v1" + +## +# Snippet for the list_finding_type_stats call in the WebSecurityScanner 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::WebSecurityScanner::V1::WebSecurityScanner::Client#list_finding_type_stats. +# +def list_finding_type_stats + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::WebSecurityScanner::V1::ListFindingTypeStatsRequest.new + + # Call the list_finding_type_stats method. + result = client.list_finding_type_stats request + + # The returned object is of type Google::Cloud::WebSecurityScanner::V1::ListFindingTypeStatsResponse. + p result +end +# [END websecurityscanner_v1_generated_WebSecurityScanner_ListFindingTypeStats_sync] diff --git a/owl-bot-staging/google-cloud-web_security_scanner-v1/snippets/web_security_scanner/list_findings.rb b/owl-bot-staging/google-cloud-web_security_scanner-v1/snippets/web_security_scanner/list_findings.rb new file mode 100644 index 000000000000..cfc4dc3cb5fb --- /dev/null +++ b/owl-bot-staging/google-cloud-web_security_scanner-v1/snippets/web_security_scanner/list_findings.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 websecurityscanner_v1_generated_WebSecurityScanner_ListFindings_sync] +require "google/cloud/web_security_scanner/v1" + +## +# Snippet for the list_findings call in the WebSecurityScanner 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::WebSecurityScanner::V1::WebSecurityScanner::Client#list_findings. +# +def list_findings + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::WebSecurityScanner::V1::ListFindingsRequest.new + + # Call the list_findings method. + result = client.list_findings 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::WebSecurityScanner::V1::Finding. + p item + end +end +# [END websecurityscanner_v1_generated_WebSecurityScanner_ListFindings_sync] diff --git a/owl-bot-staging/google-cloud-web_security_scanner-v1/snippets/web_security_scanner/list_scan_configs.rb b/owl-bot-staging/google-cloud-web_security_scanner-v1/snippets/web_security_scanner/list_scan_configs.rb new file mode 100644 index 000000000000..fa3fbb15c6b2 --- /dev/null +++ b/owl-bot-staging/google-cloud-web_security_scanner-v1/snippets/web_security_scanner/list_scan_configs.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 websecurityscanner_v1_generated_WebSecurityScanner_ListScanConfigs_sync] +require "google/cloud/web_security_scanner/v1" + +## +# Snippet for the list_scan_configs call in the WebSecurityScanner 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::WebSecurityScanner::V1::WebSecurityScanner::Client#list_scan_configs. +# +def list_scan_configs + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::WebSecurityScanner::V1::ListScanConfigsRequest.new + + # Call the list_scan_configs method. + result = client.list_scan_configs 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::WebSecurityScanner::V1::ScanConfig. + p item + end +end +# [END websecurityscanner_v1_generated_WebSecurityScanner_ListScanConfigs_sync] diff --git a/owl-bot-staging/google-cloud-web_security_scanner-v1/snippets/web_security_scanner/list_scan_runs.rb b/owl-bot-staging/google-cloud-web_security_scanner-v1/snippets/web_security_scanner/list_scan_runs.rb new file mode 100644 index 000000000000..57fa3759c1f3 --- /dev/null +++ b/owl-bot-staging/google-cloud-web_security_scanner-v1/snippets/web_security_scanner/list_scan_runs.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 websecurityscanner_v1_generated_WebSecurityScanner_ListScanRuns_sync] +require "google/cloud/web_security_scanner/v1" + +## +# Snippet for the list_scan_runs call in the WebSecurityScanner 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::WebSecurityScanner::V1::WebSecurityScanner::Client#list_scan_runs. +# +def list_scan_runs + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::WebSecurityScanner::V1::ListScanRunsRequest.new + + # Call the list_scan_runs method. + result = client.list_scan_runs 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::WebSecurityScanner::V1::ScanRun. + p item + end +end +# [END websecurityscanner_v1_generated_WebSecurityScanner_ListScanRuns_sync] diff --git a/owl-bot-staging/google-cloud-web_security_scanner-v1/snippets/web_security_scanner/start_scan_run.rb b/owl-bot-staging/google-cloud-web_security_scanner-v1/snippets/web_security_scanner/start_scan_run.rb new file mode 100644 index 000000000000..4ec4ae4d692e --- /dev/null +++ b/owl-bot-staging/google-cloud-web_security_scanner-v1/snippets/web_security_scanner/start_scan_run.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 websecurityscanner_v1_generated_WebSecurityScanner_StartScanRun_sync] +require "google/cloud/web_security_scanner/v1" + +## +# Snippet for the start_scan_run call in the WebSecurityScanner 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::WebSecurityScanner::V1::WebSecurityScanner::Client#start_scan_run. +# +def start_scan_run + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::WebSecurityScanner::V1::StartScanRunRequest.new + + # Call the start_scan_run method. + result = client.start_scan_run request + + # The returned object is of type Google::Cloud::WebSecurityScanner::V1::ScanRun. + p result +end +# [END websecurityscanner_v1_generated_WebSecurityScanner_StartScanRun_sync] diff --git a/owl-bot-staging/google-cloud-web_security_scanner-v1/snippets/web_security_scanner/stop_scan_run.rb b/owl-bot-staging/google-cloud-web_security_scanner-v1/snippets/web_security_scanner/stop_scan_run.rb new file mode 100644 index 000000000000..4c9a5b9df3ef --- /dev/null +++ b/owl-bot-staging/google-cloud-web_security_scanner-v1/snippets/web_security_scanner/stop_scan_run.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 websecurityscanner_v1_generated_WebSecurityScanner_StopScanRun_sync] +require "google/cloud/web_security_scanner/v1" + +## +# Snippet for the stop_scan_run call in the WebSecurityScanner 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::WebSecurityScanner::V1::WebSecurityScanner::Client#stop_scan_run. +# +def stop_scan_run + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::WebSecurityScanner::V1::StopScanRunRequest.new + + # Call the stop_scan_run method. + result = client.stop_scan_run request + + # The returned object is of type Google::Cloud::WebSecurityScanner::V1::ScanRun. + p result +end +# [END websecurityscanner_v1_generated_WebSecurityScanner_StopScanRun_sync] diff --git a/owl-bot-staging/google-cloud-web_security_scanner-v1/snippets/web_security_scanner/update_scan_config.rb b/owl-bot-staging/google-cloud-web_security_scanner-v1/snippets/web_security_scanner/update_scan_config.rb new file mode 100644 index 000000000000..69d927b6d8f7 --- /dev/null +++ b/owl-bot-staging/google-cloud-web_security_scanner-v1/snippets/web_security_scanner/update_scan_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 websecurityscanner_v1_generated_WebSecurityScanner_UpdateScanConfig_sync] +require "google/cloud/web_security_scanner/v1" + +## +# Snippet for the update_scan_config call in the WebSecurityScanner 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::WebSecurityScanner::V1::WebSecurityScanner::Client#update_scan_config. +# +def update_scan_config + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::WebSecurityScanner::V1::UpdateScanConfigRequest.new + + # Call the update_scan_config method. + result = client.update_scan_config request + + # The returned object is of type Google::Cloud::WebSecurityScanner::V1::ScanConfig. + p result +end +# [END websecurityscanner_v1_generated_WebSecurityScanner_UpdateScanConfig_sync] diff --git a/owl-bot-staging/google-cloud-web_security_scanner-v1/test/google/cloud/web_security_scanner/v1/web_security_scanner_rest_test.rb b/owl-bot-staging/google-cloud-web_security_scanner-v1/test/google/cloud/web_security_scanner/v1/web_security_scanner_rest_test.rb new file mode 100644 index 000000000000..53d4f0c97247 --- /dev/null +++ b/owl-bot-staging/google-cloud-web_security_scanner-v1/test/google/cloud/web_security_scanner/v1/web_security_scanner_rest_test.rb @@ -0,0 +1,812 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/websecurityscanner/v1/web_security_scanner_pb" +require "google/cloud/web_security_scanner/v1/web_security_scanner/rest" + + +class ::Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::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_scan_config + # Create test objects. + client_result = ::Google::Cloud::WebSecurityScanner::V1::ScanConfig.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + scan_config = {} + + create_scan_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::WebSecurityScanner::V1::WebSecurityScanner::Rest::ServiceStub.stub :transcode_create_scan_config_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_scan_config_client_stub do + # Create client + client = ::Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_scan_config({ parent: parent, scan_config: scan_config }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_scan_config parent: parent, scan_config: scan_config do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_scan_config ::Google::Cloud::WebSecurityScanner::V1::CreateScanConfigRequest.new(parent: parent, scan_config: scan_config) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_scan_config({ parent: parent, scan_config: scan_config }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_scan_config(::Google::Cloud::WebSecurityScanner::V1::CreateScanConfigRequest.new(parent: parent, scan_config: scan_config), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_scan_config_client_stub.call_count + end + end + end + + def test_delete_scan_config + # 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_scan_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::WebSecurityScanner::V1::WebSecurityScanner::Rest::ServiceStub.stub :transcode_delete_scan_config_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_scan_config_client_stub do + # Create client + client = ::Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_scan_config({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_scan_config name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_scan_config ::Google::Cloud::WebSecurityScanner::V1::DeleteScanConfigRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_scan_config({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_scan_config(::Google::Cloud::WebSecurityScanner::V1::DeleteScanConfigRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_scan_config_client_stub.call_count + end + end + end + + def test_get_scan_config + # Create test objects. + client_result = ::Google::Cloud::WebSecurityScanner::V1::ScanConfig.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_scan_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::WebSecurityScanner::V1::WebSecurityScanner::Rest::ServiceStub.stub :transcode_get_scan_config_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_scan_config_client_stub do + # Create client + client = ::Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_scan_config({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_scan_config name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_scan_config ::Google::Cloud::WebSecurityScanner::V1::GetScanConfigRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_scan_config({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_scan_config(::Google::Cloud::WebSecurityScanner::V1::GetScanConfigRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_scan_config_client_stub.call_count + end + end + end + + def test_list_scan_configs + # Create test objects. + client_result = ::Google::Cloud::WebSecurityScanner::V1::ListScanConfigsResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + page_token = "hello world" + page_size = 42 + + list_scan_configs_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::WebSecurityScanner::V1::WebSecurityScanner::Rest::ServiceStub.stub :transcode_list_scan_configs_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_scan_configs_client_stub do + # Create client + client = ::Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_scan_configs({ parent: parent, page_token: page_token, page_size: page_size }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.list_scan_configs parent: parent, page_token: page_token, page_size: page_size do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.list_scan_configs ::Google::Cloud::WebSecurityScanner::V1::ListScanConfigsRequest.new(parent: parent, page_token: page_token, page_size: page_size) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.list_scan_configs({ parent: parent, page_token: page_token, page_size: page_size }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.list_scan_configs(::Google::Cloud::WebSecurityScanner::V1::ListScanConfigsRequest.new(parent: parent, page_token: page_token, page_size: page_size), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, list_scan_configs_client_stub.call_count + end + end + end + + def test_update_scan_config + # Create test objects. + client_result = ::Google::Cloud::WebSecurityScanner::V1::ScanConfig.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + scan_config = {} + update_mask = {} + + update_scan_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::WebSecurityScanner::V1::WebSecurityScanner::Rest::ServiceStub.stub :transcode_update_scan_config_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_scan_config_client_stub do + # Create client + client = ::Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_scan_config({ scan_config: scan_config, update_mask: update_mask }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_scan_config scan_config: scan_config, update_mask: update_mask do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_scan_config ::Google::Cloud::WebSecurityScanner::V1::UpdateScanConfigRequest.new(scan_config: scan_config, update_mask: update_mask) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_scan_config({ scan_config: scan_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_scan_config(::Google::Cloud::WebSecurityScanner::V1::UpdateScanConfigRequest.new(scan_config: scan_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_scan_config_client_stub.call_count + end + end + end + + def test_start_scan_run + # Create test objects. + client_result = ::Google::Cloud::WebSecurityScanner::V1::ScanRun.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + start_scan_run_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::WebSecurityScanner::V1::WebSecurityScanner::Rest::ServiceStub.stub :transcode_start_scan_run_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, start_scan_run_client_stub do + # Create client + client = ::Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.start_scan_run({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.start_scan_run name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.start_scan_run ::Google::Cloud::WebSecurityScanner::V1::StartScanRunRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.start_scan_run({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.start_scan_run(::Google::Cloud::WebSecurityScanner::V1::StartScanRunRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, start_scan_run_client_stub.call_count + end + end + end + + def test_get_scan_run + # Create test objects. + client_result = ::Google::Cloud::WebSecurityScanner::V1::ScanRun.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_scan_run_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::WebSecurityScanner::V1::WebSecurityScanner::Rest::ServiceStub.stub :transcode_get_scan_run_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_scan_run_client_stub do + # Create client + client = ::Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_scan_run({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_scan_run name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_scan_run ::Google::Cloud::WebSecurityScanner::V1::GetScanRunRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_scan_run({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_scan_run(::Google::Cloud::WebSecurityScanner::V1::GetScanRunRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_scan_run_client_stub.call_count + end + end + end + + def test_list_scan_runs + # Create test objects. + client_result = ::Google::Cloud::WebSecurityScanner::V1::ListScanRunsResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + page_token = "hello world" + page_size = 42 + + list_scan_runs_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::WebSecurityScanner::V1::WebSecurityScanner::Rest::ServiceStub.stub :transcode_list_scan_runs_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_scan_runs_client_stub do + # Create client + client = ::Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_scan_runs({ parent: parent, page_token: page_token, page_size: page_size }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.list_scan_runs parent: parent, page_token: page_token, page_size: page_size do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.list_scan_runs ::Google::Cloud::WebSecurityScanner::V1::ListScanRunsRequest.new(parent: parent, page_token: page_token, page_size: page_size) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.list_scan_runs({ parent: parent, page_token: page_token, page_size: page_size }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.list_scan_runs(::Google::Cloud::WebSecurityScanner::V1::ListScanRunsRequest.new(parent: parent, page_token: page_token, page_size: page_size), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, list_scan_runs_client_stub.call_count + end + end + end + + def test_stop_scan_run + # Create test objects. + client_result = ::Google::Cloud::WebSecurityScanner::V1::ScanRun.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + stop_scan_run_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::WebSecurityScanner::V1::WebSecurityScanner::Rest::ServiceStub.stub :transcode_stop_scan_run_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, stop_scan_run_client_stub do + # Create client + client = ::Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.stop_scan_run({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.stop_scan_run name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.stop_scan_run ::Google::Cloud::WebSecurityScanner::V1::StopScanRunRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.stop_scan_run({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.stop_scan_run(::Google::Cloud::WebSecurityScanner::V1::StopScanRunRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, stop_scan_run_client_stub.call_count + end + end + end + + def test_list_crawled_urls + # Create test objects. + client_result = ::Google::Cloud::WebSecurityScanner::V1::ListCrawledUrlsResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + page_token = "hello world" + page_size = 42 + + list_crawled_urls_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::WebSecurityScanner::V1::WebSecurityScanner::Rest::ServiceStub.stub :transcode_list_crawled_urls_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_crawled_urls_client_stub do + # Create client + client = ::Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_crawled_urls({ parent: parent, page_token: page_token, page_size: page_size }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.list_crawled_urls parent: parent, page_token: page_token, page_size: page_size do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.list_crawled_urls ::Google::Cloud::WebSecurityScanner::V1::ListCrawledUrlsRequest.new(parent: parent, page_token: page_token, page_size: page_size) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.list_crawled_urls({ parent: parent, page_token: page_token, page_size: page_size }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.list_crawled_urls(::Google::Cloud::WebSecurityScanner::V1::ListCrawledUrlsRequest.new(parent: parent, page_token: page_token, page_size: page_size), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, list_crawled_urls_client_stub.call_count + end + end + end + + def test_get_finding + # Create test objects. + client_result = ::Google::Cloud::WebSecurityScanner::V1::Finding.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_finding_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::WebSecurityScanner::V1::WebSecurityScanner::Rest::ServiceStub.stub :transcode_get_finding_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_finding_client_stub do + # Create client + client = ::Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_finding({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_finding name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_finding ::Google::Cloud::WebSecurityScanner::V1::GetFindingRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_finding({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_finding(::Google::Cloud::WebSecurityScanner::V1::GetFindingRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_finding_client_stub.call_count + end + end + end + + def test_list_findings + # Create test objects. + client_result = ::Google::Cloud::WebSecurityScanner::V1::ListFindingsResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + filter = "hello world" + page_token = "hello world" + page_size = 42 + + list_findings_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::WebSecurityScanner::V1::WebSecurityScanner::Rest::ServiceStub.stub :transcode_list_findings_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_findings_client_stub do + # Create client + client = ::Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_findings({ parent: parent, filter: filter, page_token: page_token, page_size: page_size }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.list_findings parent: parent, filter: filter, page_token: page_token, page_size: page_size do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.list_findings ::Google::Cloud::WebSecurityScanner::V1::ListFindingsRequest.new(parent: parent, filter: filter, page_token: page_token, page_size: page_size) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.list_findings({ parent: parent, filter: filter, page_token: page_token, page_size: page_size }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.list_findings(::Google::Cloud::WebSecurityScanner::V1::ListFindingsRequest.new(parent: parent, filter: filter, page_token: page_token, page_size: page_size), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, list_findings_client_stub.call_count + end + end + end + + def test_list_finding_type_stats + # Create test objects. + client_result = ::Google::Cloud::WebSecurityScanner::V1::ListFindingTypeStatsResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + + list_finding_type_stats_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::WebSecurityScanner::V1::WebSecurityScanner::Rest::ServiceStub.stub :transcode_list_finding_type_stats_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_finding_type_stats_client_stub do + # Create client + client = ::Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_finding_type_stats({ parent: parent }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.list_finding_type_stats parent: parent do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.list_finding_type_stats ::Google::Cloud::WebSecurityScanner::V1::ListFindingTypeStatsRequest.new(parent: parent) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.list_finding_type_stats({ parent: parent }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.list_finding_type_stats(::Google::Cloud::WebSecurityScanner::V1::ListFindingTypeStatsRequest.new(parent: parent), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, list_finding_type_stats_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::WebSecurityScanner::V1::WebSecurityScanner::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::WebSecurityScanner::V1::WebSecurityScanner::Rest::Client::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-web_security_scanner-v1/test/google/cloud/web_security_scanner/v1/web_security_scanner_test.rb b/owl-bot-staging/google-cloud-web_security_scanner-v1/test/google/cloud/web_security_scanner/v1/web_security_scanner_test.rb new file mode 100644 index 000000000000..c27970e14144 --- /dev/null +++ b/owl-bot-staging/google-cloud-web_security_scanner-v1/test/google/cloud/web_security_scanner/v1/web_security_scanner_test.rb @@ -0,0 +1,900 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/websecurityscanner/v1/web_security_scanner_pb" +require "google/cloud/web_security_scanner/v1/web_security_scanner" + +class ::Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::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_scan_config + # Create GRPC objects. + grpc_response = ::Google::Cloud::WebSecurityScanner::V1::ScanConfig.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" + scan_config = {} + + create_scan_config_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_scan_config, name + assert_kind_of ::Google::Cloud::WebSecurityScanner::V1::CreateScanConfigRequest, request + assert_equal "hello world", request["parent"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::WebSecurityScanner::V1::ScanConfig), request["scan_config"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_scan_config_client_stub do + # Create client + client = ::Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_scan_config({ parent: parent, scan_config: scan_config }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.create_scan_config parent: parent, scan_config: scan_config do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.create_scan_config ::Google::Cloud::WebSecurityScanner::V1::CreateScanConfigRequest.new(parent: parent, scan_config: scan_config) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.create_scan_config({ parent: parent, scan_config: scan_config }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.create_scan_config(::Google::Cloud::WebSecurityScanner::V1::CreateScanConfigRequest.new(parent: parent, scan_config: scan_config), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, create_scan_config_client_stub.call_rpc_count + end + end + + def test_delete_scan_config + # 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_scan_config_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_scan_config, name + assert_kind_of ::Google::Cloud::WebSecurityScanner::V1::DeleteScanConfigRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_scan_config_client_stub do + # Create client + client = ::Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_scan_config({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_scan_config name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_scan_config ::Google::Cloud::WebSecurityScanner::V1::DeleteScanConfigRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_scan_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.delete_scan_config(::Google::Cloud::WebSecurityScanner::V1::DeleteScanConfigRequest.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_scan_config_client_stub.call_rpc_count + end + end + + def test_get_scan_config + # Create GRPC objects. + grpc_response = ::Google::Cloud::WebSecurityScanner::V1::ScanConfig.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_scan_config_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_scan_config, name + assert_kind_of ::Google::Cloud::WebSecurityScanner::V1::GetScanConfigRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_scan_config_client_stub do + # Create client + client = ::Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_scan_config({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_scan_config name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_scan_config ::Google::Cloud::WebSecurityScanner::V1::GetScanConfigRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_scan_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_scan_config(::Google::Cloud::WebSecurityScanner::V1::GetScanConfigRequest.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_scan_config_client_stub.call_rpc_count + end + end + + def test_list_scan_configs + # Create GRPC objects. + grpc_response = ::Google::Cloud::WebSecurityScanner::V1::ListScanConfigsResponse.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_token = "hello world" + page_size = 42 + + list_scan_configs_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_scan_configs, name + assert_kind_of ::Google::Cloud::WebSecurityScanner::V1::ListScanConfigsRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["page_token"] + assert_equal 42, request["page_size"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_scan_configs_client_stub do + # Create client + client = ::Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_scan_configs({ parent: parent, page_token: page_token, page_size: page_size }) 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_scan_configs parent: parent, page_token: page_token, page_size: page_size 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_scan_configs ::Google::Cloud::WebSecurityScanner::V1::ListScanConfigsRequest.new(parent: parent, page_token: page_token, page_size: page_size) 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_scan_configs({ parent: parent, page_token: page_token, page_size: page_size }, 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_scan_configs(::Google::Cloud::WebSecurityScanner::V1::ListScanConfigsRequest.new(parent: parent, page_token: page_token, page_size: page_size), 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_scan_configs_client_stub.call_rpc_count + end + end + + def test_update_scan_config + # Create GRPC objects. + grpc_response = ::Google::Cloud::WebSecurityScanner::V1::ScanConfig.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. + scan_config = {} + update_mask = {} + + update_scan_config_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_scan_config, name + assert_kind_of ::Google::Cloud::WebSecurityScanner::V1::UpdateScanConfigRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::WebSecurityScanner::V1::ScanConfig), request["scan_config"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_scan_config_client_stub do + # Create client + client = ::Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_scan_config({ scan_config: scan_config, update_mask: update_mask }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.update_scan_config scan_config: scan_config, update_mask: update_mask do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.update_scan_config ::Google::Cloud::WebSecurityScanner::V1::UpdateScanConfigRequest.new(scan_config: scan_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_scan_config({ scan_config: scan_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_scan_config(::Google::Cloud::WebSecurityScanner::V1::UpdateScanConfigRequest.new(scan_config: scan_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_scan_config_client_stub.call_rpc_count + end + end + + def test_start_scan_run + # Create GRPC objects. + grpc_response = ::Google::Cloud::WebSecurityScanner::V1::ScanRun.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" + + start_scan_run_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :start_scan_run, name + assert_kind_of ::Google::Cloud::WebSecurityScanner::V1::StartScanRunRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, start_scan_run_client_stub do + # Create client + client = ::Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.start_scan_run({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.start_scan_run name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.start_scan_run ::Google::Cloud::WebSecurityScanner::V1::StartScanRunRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.start_scan_run({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.start_scan_run(::Google::Cloud::WebSecurityScanner::V1::StartScanRunRequest.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, start_scan_run_client_stub.call_rpc_count + end + end + + def test_get_scan_run + # Create GRPC objects. + grpc_response = ::Google::Cloud::WebSecurityScanner::V1::ScanRun.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_scan_run_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_scan_run, name + assert_kind_of ::Google::Cloud::WebSecurityScanner::V1::GetScanRunRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_scan_run_client_stub do + # Create client + client = ::Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_scan_run({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_scan_run name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_scan_run ::Google::Cloud::WebSecurityScanner::V1::GetScanRunRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_scan_run({ 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_scan_run(::Google::Cloud::WebSecurityScanner::V1::GetScanRunRequest.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_scan_run_client_stub.call_rpc_count + end + end + + def test_list_scan_runs + # Create GRPC objects. + grpc_response = ::Google::Cloud::WebSecurityScanner::V1::ListScanRunsResponse.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_token = "hello world" + page_size = 42 + + list_scan_runs_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_scan_runs, name + assert_kind_of ::Google::Cloud::WebSecurityScanner::V1::ListScanRunsRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["page_token"] + assert_equal 42, request["page_size"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_scan_runs_client_stub do + # Create client + client = ::Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_scan_runs({ parent: parent, page_token: page_token, page_size: page_size }) 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_scan_runs parent: parent, page_token: page_token, page_size: page_size 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_scan_runs ::Google::Cloud::WebSecurityScanner::V1::ListScanRunsRequest.new(parent: parent, page_token: page_token, page_size: page_size) 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_scan_runs({ parent: parent, page_token: page_token, page_size: page_size }, 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_scan_runs(::Google::Cloud::WebSecurityScanner::V1::ListScanRunsRequest.new(parent: parent, page_token: page_token, page_size: page_size), 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_scan_runs_client_stub.call_rpc_count + end + end + + def test_stop_scan_run + # Create GRPC objects. + grpc_response = ::Google::Cloud::WebSecurityScanner::V1::ScanRun.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" + + stop_scan_run_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :stop_scan_run, name + assert_kind_of ::Google::Cloud::WebSecurityScanner::V1::StopScanRunRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, stop_scan_run_client_stub do + # Create client + client = ::Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.stop_scan_run({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.stop_scan_run name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.stop_scan_run ::Google::Cloud::WebSecurityScanner::V1::StopScanRunRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.stop_scan_run({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.stop_scan_run(::Google::Cloud::WebSecurityScanner::V1::StopScanRunRequest.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, stop_scan_run_client_stub.call_rpc_count + end + end + + def test_list_crawled_urls + # Create GRPC objects. + grpc_response = ::Google::Cloud::WebSecurityScanner::V1::ListCrawledUrlsResponse.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_token = "hello world" + page_size = 42 + + list_crawled_urls_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_crawled_urls, name + assert_kind_of ::Google::Cloud::WebSecurityScanner::V1::ListCrawledUrlsRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["page_token"] + assert_equal 42, request["page_size"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_crawled_urls_client_stub do + # Create client + client = ::Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_crawled_urls({ parent: parent, page_token: page_token, page_size: page_size }) 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_crawled_urls parent: parent, page_token: page_token, page_size: page_size 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_crawled_urls ::Google::Cloud::WebSecurityScanner::V1::ListCrawledUrlsRequest.new(parent: parent, page_token: page_token, page_size: page_size) 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_crawled_urls({ parent: parent, page_token: page_token, page_size: page_size }, 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_crawled_urls(::Google::Cloud::WebSecurityScanner::V1::ListCrawledUrlsRequest.new(parent: parent, page_token: page_token, page_size: page_size), 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_crawled_urls_client_stub.call_rpc_count + end + end + + def test_get_finding + # Create GRPC objects. + grpc_response = ::Google::Cloud::WebSecurityScanner::V1::Finding.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_finding_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_finding, name + assert_kind_of ::Google::Cloud::WebSecurityScanner::V1::GetFindingRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_finding_client_stub do + # Create client + client = ::Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_finding({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_finding name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_finding ::Google::Cloud::WebSecurityScanner::V1::GetFindingRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_finding({ 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_finding(::Google::Cloud::WebSecurityScanner::V1::GetFindingRequest.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_finding_client_stub.call_rpc_count + end + end + + def test_list_findings + # Create GRPC objects. + grpc_response = ::Google::Cloud::WebSecurityScanner::V1::ListFindingsResponse.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" + filter = "hello world" + page_token = "hello world" + page_size = 42 + + list_findings_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_findings, name + assert_kind_of ::Google::Cloud::WebSecurityScanner::V1::ListFindingsRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["filter"] + assert_equal "hello world", request["page_token"] + assert_equal 42, request["page_size"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_findings_client_stub do + # Create client + client = ::Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_findings({ parent: parent, filter: filter, page_token: page_token, page_size: page_size }) 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_findings parent: parent, filter: filter, page_token: page_token, page_size: page_size 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_findings ::Google::Cloud::WebSecurityScanner::V1::ListFindingsRequest.new(parent: parent, filter: filter, page_token: page_token, page_size: page_size) 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_findings({ parent: parent, filter: filter, page_token: page_token, page_size: page_size }, 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_findings(::Google::Cloud::WebSecurityScanner::V1::ListFindingsRequest.new(parent: parent, filter: filter, page_token: page_token, page_size: page_size), 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_findings_client_stub.call_rpc_count + end + end + + def test_list_finding_type_stats + # Create GRPC objects. + grpc_response = ::Google::Cloud::WebSecurityScanner::V1::ListFindingTypeStatsResponse.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" + + list_finding_type_stats_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_finding_type_stats, name + assert_kind_of ::Google::Cloud::WebSecurityScanner::V1::ListFindingTypeStatsRequest, request + assert_equal "hello world", request["parent"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_finding_type_stats_client_stub do + # Create client + client = ::Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_finding_type_stats({ parent: parent }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.list_finding_type_stats parent: parent do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.list_finding_type_stats ::Google::Cloud::WebSecurityScanner::V1::ListFindingTypeStatsRequest.new(parent: parent) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.list_finding_type_stats({ parent: parent }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.list_finding_type_stats(::Google::Cloud::WebSecurityScanner::V1::ListFindingTypeStatsRequest.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, list_finding_type_stats_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::WebSecurityScanner::V1::WebSecurityScanner::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::WebSecurityScanner::V1::WebSecurityScanner::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::WebSecurityScanner::V1::WebSecurityScanner::Client.new do |config| + config.credentials = creds + end + assert_kind_of ::Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client, client + assert_equal creds, client.configure.credentials + end + end +end diff --git a/owl-bot-staging/google-cloud-web_security_scanner-v1/test/helper.rb b/owl-bot-staging/google-cloud-web_security_scanner-v1/test/helper.rb new file mode 100644 index 000000000000..672b337030e7 --- /dev/null +++ b/owl-bot-staging/google-cloud-web_security_scanner-v1/test/helper.rb @@ -0,0 +1,26 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/mock" +require "minitest/rg" + +require "grpc" + +require "ostruct" diff --git a/owl-bot-staging/google-cloud-web_security_scanner-v1beta/.gitignore b/owl-bot-staging/google-cloud-web_security_scanner-v1beta/.gitignore new file mode 100644 index 000000000000..0135b6bc6cfc --- /dev/null +++ b/owl-bot-staging/google-cloud-web_security_scanner-v1beta/.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-web_security_scanner-v1beta/.repo-metadata.json b/owl-bot-staging/google-cloud-web_security_scanner-v1beta/.repo-metadata.json new file mode 100644 index 000000000000..080aad677a51 --- /dev/null +++ b/owl-bot-staging/google-cloud-web_security_scanner-v1beta/.repo-metadata.json @@ -0,0 +1,18 @@ +{ + "api_id": "websecurityscanner.googleapis.com", + "api_shortname": "websecurityscanner", + "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-web_security_scanner-v1beta/latest", + "distribution_name": "google-cloud-web_security_scanner-v1beta", + "is_cloud": true, + "language": "ruby", + "name": "websecurityscanner", + "name_pretty": "Web Security Scanner V1beta API", + "product_documentation": "https://cloud.google.com/security-command-center/docs/concepts-web-security-scanner-overview/", + "release_level": "unreleased", + "repo": "googleapis/google-cloud-ruby", + "requires_billing": true, + "ruby-cloud-description": "Web Security Scanner scans your Compute and App Engine apps for common web vulnerabilities. Note that google-cloud-web_security_scanner-v1beta is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-web_security_scanner instead. See the readme for more details.", + "ruby-cloud-env-prefix": "WEB_SECURITY_SCANNER", + "ruby-cloud-product-url": "https://cloud.google.com/security-command-center/docs/concepts-web-security-scanner-overview/", + "library_type": "GAPIC_AUTO" +} diff --git a/owl-bot-staging/google-cloud-web_security_scanner-v1beta/.rubocop.yml b/owl-bot-staging/google-cloud-web_security_scanner-v1beta/.rubocop.yml new file mode 100644 index 000000000000..e051a212551a --- /dev/null +++ b/owl-bot-staging/google-cloud-web_security_scanner-v1beta/.rubocop.yml @@ -0,0 +1,33 @@ +inherit_gem: + google-style: google-style.yml + +AllCops: + Exclude: + - "google-cloud-web_security_scanner-v1beta.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-web_security_scanner-v1beta.rb" diff --git a/owl-bot-staging/google-cloud-web_security_scanner-v1beta/.toys.rb b/owl-bot-staging/google-cloud-web_security_scanner-v1beta/.toys.rb new file mode 100644 index 000000000000..177e22456e8a --- /dev/null +++ b/owl-bot-staging/google-cloud-web_security_scanner-v1beta/.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-web_security_scanner-v1beta/.yardopts b/owl-bot-staging/google-cloud-web_security_scanner-v1beta/.yardopts new file mode 100644 index 000000000000..a098711b250d --- /dev/null +++ b/owl-bot-staging/google-cloud-web_security_scanner-v1beta/.yardopts @@ -0,0 +1,12 @@ +--no-private +--title="Web Security Scanner V1beta 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-web_security_scanner-v1beta/AUTHENTICATION.md b/owl-bot-staging/google-cloud-web_security_scanner-v1beta/AUTHENTICATION.md new file mode 100644 index 000000000000..e955035f32bf --- /dev/null +++ b/owl-bot-staging/google-cloud-web_security_scanner-v1beta/AUTHENTICATION.md @@ -0,0 +1,122 @@ +# Authentication + +The recommended way to authenticate to the google-cloud-web_security_scanner-v1beta 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-web_security_scanner-v1beta 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/web_security_scanner/v1beta" + +client = ::Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Client.new do |config| + config.credentials = "path/to/credentialfile.json" +end +``` + +To configure a credentials file globally for all clients: + +```ruby +require "google/cloud/web_security_scanner/v1beta" + +::Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Client.configure do |config| + config.credentials = "path/to/credentialfile.json" +end + +client = ::Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::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-web_security_scanner-v1beta +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/web_security_scanner/v1beta" + +ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" + +client = ::Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::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-web_security_scanner-v1beta/CHANGELOG.md b/owl-bot-staging/google-cloud-web_security_scanner-v1beta/CHANGELOG.md new file mode 100644 index 000000000000..f88957a62ba2 --- /dev/null +++ b/owl-bot-staging/google-cloud-web_security_scanner-v1beta/CHANGELOG.md @@ -0,0 +1,2 @@ +# Release History + diff --git a/owl-bot-staging/google-cloud-web_security_scanner-v1beta/Gemfile b/owl-bot-staging/google-cloud-web_security_scanner-v1beta/Gemfile new file mode 100644 index 000000000000..1d08558908d8 --- /dev/null +++ b/owl-bot-staging/google-cloud-web_security_scanner-v1beta/Gemfile @@ -0,0 +1,14 @@ +source "https://rubygems.org" + +gemspec + +gem "google-style", "~> 1.32.0" +gem "irb", "~> 1.17" +gem "minitest", "~> 6.0.2" +gem "minitest-focus", "~> 1.4" +gem "minitest-mock", "~> 5.27" +gem "minitest-rg", "~> 5.3" +gem "ostruct", "~> 0.5.5" +gem "rake", ">= 13.0" +gem "redcarpet", "~> 3.6" +gem "yard", "~> 0.9" diff --git a/owl-bot-staging/google-cloud-web_security_scanner-v1beta/LICENSE.md b/owl-bot-staging/google-cloud-web_security_scanner-v1beta/LICENSE.md new file mode 100644 index 000000000000..c261857ba6ad --- /dev/null +++ b/owl-bot-staging/google-cloud-web_security_scanner-v1beta/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-web_security_scanner-v1beta/README.md b/owl-bot-staging/google-cloud-web_security_scanner-v1beta/README.md new file mode 100644 index 000000000000..a908e25d8d6d --- /dev/null +++ b/owl-bot-staging/google-cloud-web_security_scanner-v1beta/README.md @@ -0,0 +1,154 @@ +# Ruby Client for the Web Security Scanner V1beta API + +Scans your Compute and App Engine apps for common web vulnerabilities. + +Web Security Scanner scans your Compute and App Engine apps for common web vulnerabilities. + +https://github.com/googleapis/google-cloud-ruby + +This gem is a _versioned_ client. It provides basic client classes for a +specific version of the Web Security Scanner V1beta API. Most users should consider using +the main client gem, +[google-cloud-web_security_scanner](https://rubygems.org/gems/google-cloud-web_security_scanner). +See the section below titled *Which client should I use?* for more information. + +## Installation + +``` +$ gem install google-cloud-web_security_scanner-v1beta +``` + +## 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/websecurityscanner.googleapis.com) +1. [Set up authentication.](AUTHENTICATION.md) + +## Quick Start + +```ruby +require "google/cloud/web_security_scanner/v1beta" + +client = ::Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Client.new +request = ::Google::Cloud::WebSecurityScanner::V1beta::CreateScanConfigRequest.new # (request fields as keyword arguments...) +response = client.create_scan_config request +``` + +View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-web_security_scanner-v1beta/latest) +for class and method documentation. + +See also the [Product Documentation](https://cloud.google.com/security-command-center/docs/concepts-web-security-scanner-overview/) +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/web_security_scanner/v1beta" +require "logger" + +client = ::Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::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-web_security_scanner`, +and lower-level _versioned_ client libraries with names such as +`google-cloud-web_security_scanner-v1beta`. +_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-web_security_scanner`. +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-web_security_scanner-v1beta`. + +### 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-web_security_scanner-v1beta/Rakefile b/owl-bot-staging/google-cloud-web_security_scanner-v1beta/Rakefile new file mode 100644 index 000000000000..32e97681638d --- /dev/null +++ b/owl-bot-staging/google-cloud-web_security_scanner-v1beta/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-web_security_scanner-v1beta acceptance tests." +task :acceptance, :project, :keyfile do |t, args| + project = args[:project] + project ||= + ENV["WEB_SECURITY_SCANNER_TEST_PROJECT"] || + ENV["GCLOUD_TEST_PROJECT"] + keyfile = args[:keyfile] + keyfile ||= + ENV["WEB_SECURITY_SCANNER_TEST_KEYFILE"] || + ENV["GCLOUD_TEST_KEYFILE"] + if keyfile + keyfile = File.read keyfile + else + keyfile ||= + ENV["WEB_SECURITY_SCANNER_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 WEB_SECURITY_SCANNER_TEST_PROJECT=test123 WEB_SECURITY_SCANNER_TEST_KEYFILE=/path/to/keyfile.json rake acceptance" + end + require "google/cloud/web_security_scanner/v1beta/web_security_scanner/credentials" + ::Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Credentials.env_vars.each do |path| + ENV[path] = nil + end + ENV["WEB_SECURITY_SCANNER_PROJECT"] = project + ENV["WEB_SECURITY_SCANNER_TEST_PROJECT"] = project + ENV["WEB_SECURITY_SCANNER_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-web_security_scanner-v1beta 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-web_security_scanner-v1beta 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-web_security_scanner-v1beta 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-web_security_scanner-v1beta gem does not have doctest tests." +end + +desc "Run the CI build" +task :ci do + header "BUILDING google-cloud-web_security_scanner-v1beta" + header "google-cloud-web_security_scanner-v1beta rubocop", "*" + Rake::Task[:rubocop].invoke + header "google-cloud-web_security_scanner-v1beta yard", "*" + Rake::Task[:yard].invoke + header "google-cloud-web_security_scanner-v1beta 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-web_security_scanner-v1beta 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-web_security_scanner-v1beta 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-web_security_scanner-v1beta/gapic_metadata.json b/owl-bot-staging/google-cloud-web_security_scanner-v1beta/gapic_metadata.json new file mode 100644 index 000000000000..c625db81d1c2 --- /dev/null +++ b/owl-bot-staging/google-cloud-web_security_scanner-v1beta/gapic_metadata.json @@ -0,0 +1,83 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "ruby", + "protoPackage": "google.cloud.websecurityscanner.v1beta", + "libraryPackage": "::Google::Cloud::WebSecurityScanner::V1beta", + "services": { + "WebSecurityScanner": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Client", + "rpcs": { + "CreateScanConfig": { + "methods": [ + "create_scan_config" + ] + }, + "DeleteScanConfig": { + "methods": [ + "delete_scan_config" + ] + }, + "GetScanConfig": { + "methods": [ + "get_scan_config" + ] + }, + "ListScanConfigs": { + "methods": [ + "list_scan_configs" + ] + }, + "UpdateScanConfig": { + "methods": [ + "update_scan_config" + ] + }, + "StartScanRun": { + "methods": [ + "start_scan_run" + ] + }, + "GetScanRun": { + "methods": [ + "get_scan_run" + ] + }, + "ListScanRuns": { + "methods": [ + "list_scan_runs" + ] + }, + "StopScanRun": { + "methods": [ + "stop_scan_run" + ] + }, + "ListCrawledUrls": { + "methods": [ + "list_crawled_urls" + ] + }, + "GetFinding": { + "methods": [ + "get_finding" + ] + }, + "ListFindings": { + "methods": [ + "list_findings" + ] + }, + "ListFindingTypeStats": { + "methods": [ + "list_finding_type_stats" + ] + } + } + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-web_security_scanner-v1beta/google-cloud-web_security_scanner-v1beta.gemspec b/owl-bot-staging/google-cloud-web_security_scanner-v1beta/google-cloud-web_security_scanner-v1beta.gemspec new file mode 100644 index 000000000000..aa2408b30a97 --- /dev/null +++ b/owl-bot-staging/google-cloud-web_security_scanner-v1beta/google-cloud-web_security_scanner-v1beta.gemspec @@ -0,0 +1,28 @@ +# -*- ruby -*- +# encoding: utf-8 + +require File.expand_path("lib/google/cloud/web_security_scanner/v1beta/version", __dir__) + +Gem::Specification.new do |gem| + gem.name = "google-cloud-web_security_scanner-v1beta" + gem.version = Google::Cloud::WebSecurityScanner::V1beta::VERSION + + gem.authors = ["Google LLC"] + gem.email = "googleapis-packages@google.com" + gem.description = "Web Security Scanner scans your Compute and App Engine apps for common web vulnerabilities. Note that google-cloud-web_security_scanner-v1beta is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-web_security_scanner instead. See the readme for more details." + gem.summary = "Scans your Compute and App Engine apps for common web vulnerabilities." + 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.2" + + gem.add_dependency "gapic-common", "~> 1.2" + gem.add_dependency "google-cloud-errors", "~> 1.0" +end diff --git a/owl-bot-staging/google-cloud-web_security_scanner-v1beta/lib/google-cloud-web_security_scanner-v1beta.rb b/owl-bot-staging/google-cloud-web_security_scanner-v1beta/lib/google-cloud-web_security_scanner-v1beta.rb new file mode 100644 index 000000000000..aa99555f2dd3 --- /dev/null +++ b/owl-bot-staging/google-cloud-web_security_scanner-v1beta/lib/google-cloud-web_security_scanner-v1beta.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/web_security_scanner/v1beta" diff --git a/owl-bot-staging/google-cloud-web_security_scanner-v1beta/lib/google/cloud/web_security_scanner/v1beta.rb b/owl-bot-staging/google-cloud-web_security_scanner-v1beta/lib/google/cloud/web_security_scanner/v1beta.rb new file mode 100644 index 000000000000..42ef3ae8aa7c --- /dev/null +++ b/owl-bot-staging/google-cloud-web_security_scanner-v1beta/lib/google/cloud/web_security_scanner/v1beta.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/web_security_scanner/v1beta/web_security_scanner" +require "google/cloud/web_security_scanner/v1beta/version" + +module Google + module Cloud + module WebSecurityScanner + ## + # API client module. + # + # @example Load this package, including all its services, and instantiate a gRPC client + # + # require "google/cloud/web_security_scanner/v1beta" + # client = ::Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Client.new + # + # @example Load this package, including all its services, and instantiate a REST client + # + # require "google/cloud/web_security_scanner/v1beta" + # client = ::Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Rest::Client.new + # + module V1beta + end + end + end +end + +helper_path = ::File.join __dir__, "v1beta", "_helpers.rb" +require "google/cloud/web_security_scanner/v1beta/_helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-web_security_scanner-v1beta/lib/google/cloud/web_security_scanner/v1beta/rest.rb b/owl-bot-staging/google-cloud-web_security_scanner-v1beta/lib/google/cloud/web_security_scanner/v1beta/rest.rb new file mode 100644 index 000000000000..3c7b745ca0ac --- /dev/null +++ b/owl-bot-staging/google-cloud-web_security_scanner-v1beta/lib/google/cloud/web_security_scanner/v1beta/rest.rb @@ -0,0 +1,37 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/web_security_scanner/v1beta/web_security_scanner/rest" +require "google/cloud/web_security_scanner/v1beta/version" + +module Google + module Cloud + module WebSecurityScanner + ## + # To load just the REST part of this package, including all its services, and instantiate a REST client: + # + # @example + # + # require "google/cloud/web_security_scanner/v1beta/rest" + # client = ::Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Rest::Client.new + # + module V1beta + end + end + end +end diff --git a/owl-bot-staging/google-cloud-web_security_scanner-v1beta/lib/google/cloud/web_security_scanner/v1beta/version.rb b/owl-bot-staging/google-cloud-web_security_scanner-v1beta/lib/google/cloud/web_security_scanner/v1beta/version.rb new file mode 100644 index 000000000000..f0209dccfca1 --- /dev/null +++ b/owl-bot-staging/google-cloud-web_security_scanner-v1beta/lib/google/cloud/web_security_scanner/v1beta/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 WebSecurityScanner + module V1beta + VERSION = "0.0.1" + end + end + end +end diff --git a/owl-bot-staging/google-cloud-web_security_scanner-v1beta/lib/google/cloud/web_security_scanner/v1beta/web_security_scanner.rb b/owl-bot-staging/google-cloud-web_security_scanner-v1beta/lib/google/cloud/web_security_scanner/v1beta/web_security_scanner.rb new file mode 100644 index 000000000000..e4d014ad6c61 --- /dev/null +++ b/owl-bot-staging/google-cloud-web_security_scanner-v1beta/lib/google/cloud/web_security_scanner/v1beta/web_security_scanner.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/common" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/web_security_scanner/v1beta/version" + +require "google/cloud/web_security_scanner/v1beta/web_security_scanner/credentials" +require "google/cloud/web_security_scanner/v1beta/web_security_scanner/paths" +require "google/cloud/web_security_scanner/v1beta/web_security_scanner/client" +require "google/cloud/web_security_scanner/v1beta/web_security_scanner/rest" + +module Google + module Cloud + module WebSecurityScanner + module V1beta + ## + # Cloud Web Security Scanner Service identifies security vulnerabilities in web + # applications hosted on Google Cloud Platform. It crawls your application, and + # attempts to exercise as many user inputs and event handlers as possible. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/web_security_scanner/v1beta/web_security_scanner" + # client = ::Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/web_security_scanner/v1beta/web_security_scanner/rest" + # client = ::Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Rest::Client.new + # + module WebSecurityScanner + end + end + end + end +end + +helper_path = ::File.join __dir__, "web_security_scanner", "helpers.rb" +require "google/cloud/web_security_scanner/v1beta/web_security_scanner/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-web_security_scanner-v1beta/lib/google/cloud/web_security_scanner/v1beta/web_security_scanner/client.rb b/owl-bot-staging/google-cloud-web_security_scanner-v1beta/lib/google/cloud/web_security_scanner/v1beta/web_security_scanner/client.rb new file mode 100644 index 000000000000..05285d2d540c --- /dev/null +++ b/owl-bot-staging/google-cloud-web_security_scanner-v1beta/lib/google/cloud/web_security_scanner/v1beta/web_security_scanner/client.rb @@ -0,0 +1,1721 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/websecurityscanner/v1beta/web_security_scanner_pb" + +module Google + module Cloud + module WebSecurityScanner + module V1beta + module WebSecurityScanner + ## + # Client for the WebSecurityScanner service. + # + # Cloud Web Security Scanner Service identifies security vulnerabilities in web + # applications hosted on Google Cloud Platform. It crawls your application, and + # attempts to exercise as many user inputs and event handlers as possible. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "websecurityscanner.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :web_security_scanner_stub + + ## + # Configure the WebSecurityScanner Client class. + # + # See {::Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all WebSecurityScanner clients + # ::Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::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", "WebSecurityScanner", "V1beta"] + 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_scan_config.timeout = 600.0 + + default_config.rpcs.delete_scan_config.timeout = 600.0 + default_config.rpcs.delete_scan_config.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.get_scan_config.timeout = 600.0 + default_config.rpcs.get_scan_config.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.list_scan_configs.timeout = 600.0 + default_config.rpcs.list_scan_configs.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.update_scan_config.timeout = 600.0 + + default_config.rpcs.start_scan_run.timeout = 600.0 + + default_config.rpcs.get_scan_run.timeout = 600.0 + default_config.rpcs.get_scan_run.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.list_scan_runs.timeout = 600.0 + default_config.rpcs.list_scan_runs.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.stop_scan_run.timeout = 600.0 + + default_config.rpcs.list_crawled_urls.timeout = 600.0 + default_config.rpcs.list_crawled_urls.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.get_finding.timeout = 600.0 + default_config.rpcs.get_finding.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.list_findings.timeout = 600.0 + default_config.rpcs.list_findings.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.list_finding_type_stats.timeout = 600.0 + default_config.rpcs.list_finding_type_stats.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the WebSecurityScanner 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::WebSecurityScanner::V1beta::WebSecurityScanner::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 + @web_security_scanner_stub.universe_domain + end + + ## + # Create a new WebSecurityScanner client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the WebSecurityScanner 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/websecurityscanner/v1beta/web_security_scanner_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 + + @web_security_scanner_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::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 + ) + + @web_security_scanner_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 + end + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @web_security_scanner_stub.logger + end + + # Service calls + + ## + # Creates a new ScanConfig. + # + # @overload create_scan_config(request, options = nil) + # Pass arguments to `create_scan_config` via a request object, either of type + # {::Google::Cloud::WebSecurityScanner::V1beta::CreateScanConfigRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::WebSecurityScanner::V1beta::CreateScanConfigRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_scan_config(parent: nil, scan_config: nil) + # Pass arguments to `create_scan_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. The parent resource name where the scan is created, which should be a + # project resource name in the format 'projects/\\{projectId}'. + # @param scan_config [::Google::Cloud::WebSecurityScanner::V1beta::ScanConfig, ::Hash] + # Required. The ScanConfig to be created. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::WebSecurityScanner::V1beta::ScanConfig] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::WebSecurityScanner::V1beta::ScanConfig] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/web_security_scanner/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::WebSecurityScanner::V1beta::CreateScanConfigRequest.new + # + # # Call the create_scan_config method. + # result = client.create_scan_config request + # + # # The returned object is of type Google::Cloud::WebSecurityScanner::V1beta::ScanConfig. + # p result + # + def create_scan_config request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::WebSecurityScanner::V1beta::CreateScanConfigRequest + + # Converts hash 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_scan_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::WebSecurityScanner::V1beta::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_scan_config.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_scan_config.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @web_security_scanner_stub.call_rpc :create_scan_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 + + ## + # Deletes an existing ScanConfig and its child resources. + # + # @overload delete_scan_config(request, options = nil) + # Pass arguments to `delete_scan_config` via a request object, either of type + # {::Google::Cloud::WebSecurityScanner::V1beta::DeleteScanConfigRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::WebSecurityScanner::V1beta::DeleteScanConfigRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_scan_config(name: nil) + # Pass arguments to `delete_scan_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 resource name of the ScanConfig to be deleted. The name follows the + # format of 'projects/\\{projectId}/scanConfigs/\\{scanConfigId}'. + # + # @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/web_security_scanner/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::WebSecurityScanner::V1beta::DeleteScanConfigRequest.new + # + # # Call the delete_scan_config method. + # result = client.delete_scan_config request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_scan_config request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::WebSecurityScanner::V1beta::DeleteScanConfigRequest + + # Converts hash 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_scan_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::WebSecurityScanner::V1beta::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_scan_config.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_scan_config.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @web_security_scanner_stub.call_rpc :delete_scan_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 + + ## + # Gets a ScanConfig. + # + # @overload get_scan_config(request, options = nil) + # Pass arguments to `get_scan_config` via a request object, either of type + # {::Google::Cloud::WebSecurityScanner::V1beta::GetScanConfigRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::WebSecurityScanner::V1beta::GetScanConfigRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_scan_config(name: nil) + # Pass arguments to `get_scan_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 resource name of the ScanConfig to be returned. The name follows the + # format of 'projects/\\{projectId}/scanConfigs/\\{scanConfigId}'. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::WebSecurityScanner::V1beta::ScanConfig] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::WebSecurityScanner::V1beta::ScanConfig] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/web_security_scanner/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::WebSecurityScanner::V1beta::GetScanConfigRequest.new + # + # # Call the get_scan_config method. + # result = client.get_scan_config request + # + # # The returned object is of type Google::Cloud::WebSecurityScanner::V1beta::ScanConfig. + # p result + # + def get_scan_config request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::WebSecurityScanner::V1beta::GetScanConfigRequest + + # Converts hash 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_scan_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::WebSecurityScanner::V1beta::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_scan_config.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_scan_config.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @web_security_scanner_stub.call_rpc :get_scan_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 + + ## + # Lists ScanConfigs under a given project. + # + # @overload list_scan_configs(request, options = nil) + # Pass arguments to `list_scan_configs` via a request object, either of type + # {::Google::Cloud::WebSecurityScanner::V1beta::ListScanConfigsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::WebSecurityScanner::V1beta::ListScanConfigsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_scan_configs(parent: nil, page_token: nil, page_size: nil) + # Pass arguments to `list_scan_configs` via keyword arguments. Note that at + # least one keyword argument is 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 parent resource name, which should be a project resource name in the + # format 'projects/\\{projectId}'. + # @param page_token [::String] + # A token identifying a page of results to be returned. This should be a + # `next_page_token` value returned from a previous List request. + # If unspecified, the first page of results is returned. + # @param page_size [::Integer] + # The maximum number of ScanConfigs to return, can be limited by server. + # If not specified or not positive, the implementation will select a + # reasonable value. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::WebSecurityScanner::V1beta::ScanConfig>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::WebSecurityScanner::V1beta::ScanConfig>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/web_security_scanner/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::WebSecurityScanner::V1beta::ListScanConfigsRequest.new + # + # # Call the list_scan_configs method. + # result = client.list_scan_configs 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::WebSecurityScanner::V1beta::ScanConfig. + # p item + # end + # + def list_scan_configs request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::WebSecurityScanner::V1beta::ListScanConfigsRequest + + # Converts hash 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_scan_configs.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::WebSecurityScanner::V1beta::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_scan_configs.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_scan_configs.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @web_security_scanner_stub.call_rpc :list_scan_configs, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @web_security_scanner_stub, :list_scan_configs, 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 + + ## + # Updates a ScanConfig. This method support partial update of a ScanConfig. + # + # @overload update_scan_config(request, options = nil) + # Pass arguments to `update_scan_config` via a request object, either of type + # {::Google::Cloud::WebSecurityScanner::V1beta::UpdateScanConfigRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::WebSecurityScanner::V1beta::UpdateScanConfigRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_scan_config(scan_config: nil, update_mask: nil) + # Pass arguments to `update_scan_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 scan_config [::Google::Cloud::WebSecurityScanner::V1beta::ScanConfig, ::Hash] + # Required. The ScanConfig to be updated. The name field must be set to identify the + # resource to be updated. The values of fields not covered by the mask + # will be ignored. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. The update mask applies to the resource. For the `FieldMask` definition, + # see + # https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::WebSecurityScanner::V1beta::ScanConfig] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::WebSecurityScanner::V1beta::ScanConfig] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/web_security_scanner/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::WebSecurityScanner::V1beta::UpdateScanConfigRequest.new + # + # # Call the update_scan_config method. + # result = client.update_scan_config request + # + # # The returned object is of type Google::Cloud::WebSecurityScanner::V1beta::ScanConfig. + # p result + # + def update_scan_config request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::WebSecurityScanner::V1beta::UpdateScanConfigRequest + + # Converts hash 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_scan_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::WebSecurityScanner::V1beta::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.scan_config&.name + header_params["scan_config.name"] = request.scan_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_scan_config.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_scan_config.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @web_security_scanner_stub.call_rpc :update_scan_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 + + ## + # Start a ScanRun according to the given ScanConfig. + # + # @overload start_scan_run(request, options = nil) + # Pass arguments to `start_scan_run` via a request object, either of type + # {::Google::Cloud::WebSecurityScanner::V1beta::StartScanRunRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::WebSecurityScanner::V1beta::StartScanRunRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload start_scan_run(name: nil) + # Pass arguments to `start_scan_run` via keyword arguments. Note that at + # least one keyword argument is 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 ScanConfig to be used. The name follows the + # format of 'projects/\\{projectId}/scanConfigs/\\{scanConfigId}'. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::WebSecurityScanner::V1beta::ScanRun] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::WebSecurityScanner::V1beta::ScanRun] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/web_security_scanner/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::WebSecurityScanner::V1beta::StartScanRunRequest.new + # + # # Call the start_scan_run method. + # result = client.start_scan_run request + # + # # The returned object is of type Google::Cloud::WebSecurityScanner::V1beta::ScanRun. + # p result + # + def start_scan_run request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::WebSecurityScanner::V1beta::StartScanRunRequest + + # Converts hash 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.start_scan_run.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::WebSecurityScanner::V1beta::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.start_scan_run.timeout, + metadata: metadata, + retry_policy: @config.rpcs.start_scan_run.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @web_security_scanner_stub.call_rpc :start_scan_run, 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 + + ## + # Gets a ScanRun. + # + # @overload get_scan_run(request, options = nil) + # Pass arguments to `get_scan_run` via a request object, either of type + # {::Google::Cloud::WebSecurityScanner::V1beta::GetScanRunRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::WebSecurityScanner::V1beta::GetScanRunRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_scan_run(name: nil) + # Pass arguments to `get_scan_run` via keyword arguments. Note that at + # least one keyword argument is 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 ScanRun to be returned. The name follows the + # format of + # 'projects/\\{projectId}/scanConfigs/\\{scanConfigId}/scanRuns/\\{scanRunId}'. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::WebSecurityScanner::V1beta::ScanRun] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::WebSecurityScanner::V1beta::ScanRun] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/web_security_scanner/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::WebSecurityScanner::V1beta::GetScanRunRequest.new + # + # # Call the get_scan_run method. + # result = client.get_scan_run request + # + # # The returned object is of type Google::Cloud::WebSecurityScanner::V1beta::ScanRun. + # p result + # + def get_scan_run request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::WebSecurityScanner::V1beta::GetScanRunRequest + + # Converts hash 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_scan_run.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::WebSecurityScanner::V1beta::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_scan_run.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_scan_run.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @web_security_scanner_stub.call_rpc :get_scan_run, 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 ScanRuns under a given ScanConfig, in descending order of ScanRun + # stop time. + # + # @overload list_scan_runs(request, options = nil) + # Pass arguments to `list_scan_runs` via a request object, either of type + # {::Google::Cloud::WebSecurityScanner::V1beta::ListScanRunsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::WebSecurityScanner::V1beta::ListScanRunsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_scan_runs(parent: nil, page_token: nil, page_size: nil) + # Pass arguments to `list_scan_runs` via keyword arguments. Note that at + # least one keyword argument is 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 parent resource name, which should be a scan resource name in the + # format 'projects/\\{projectId}/scanConfigs/\\{scanConfigId}'. + # @param page_token [::String] + # A token identifying a page of results to be returned. This should be a + # `next_page_token` value returned from a previous List request. + # If unspecified, the first page of results is returned. + # @param page_size [::Integer] + # The maximum number of ScanRuns to return, can be limited by server. + # If not specified or not positive, the implementation will select a + # reasonable value. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::WebSecurityScanner::V1beta::ScanRun>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::WebSecurityScanner::V1beta::ScanRun>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/web_security_scanner/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::WebSecurityScanner::V1beta::ListScanRunsRequest.new + # + # # Call the list_scan_runs method. + # result = client.list_scan_runs 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::WebSecurityScanner::V1beta::ScanRun. + # p item + # end + # + def list_scan_runs request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::WebSecurityScanner::V1beta::ListScanRunsRequest + + # Converts hash 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_scan_runs.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::WebSecurityScanner::V1beta::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_scan_runs.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_scan_runs.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @web_security_scanner_stub.call_rpc :list_scan_runs, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @web_security_scanner_stub, :list_scan_runs, 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 + + ## + # Stops a ScanRun. The stopped ScanRun is returned. + # + # @overload stop_scan_run(request, options = nil) + # Pass arguments to `stop_scan_run` via a request object, either of type + # {::Google::Cloud::WebSecurityScanner::V1beta::StopScanRunRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::WebSecurityScanner::V1beta::StopScanRunRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload stop_scan_run(name: nil) + # Pass arguments to `stop_scan_run` via keyword arguments. Note that at + # least one keyword argument is 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 ScanRun to be stopped. The name follows the + # format of + # 'projects/\\{projectId}/scanConfigs/\\{scanConfigId}/scanRuns/\\{scanRunId}'. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::WebSecurityScanner::V1beta::ScanRun] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::WebSecurityScanner::V1beta::ScanRun] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/web_security_scanner/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::WebSecurityScanner::V1beta::StopScanRunRequest.new + # + # # Call the stop_scan_run method. + # result = client.stop_scan_run request + # + # # The returned object is of type Google::Cloud::WebSecurityScanner::V1beta::ScanRun. + # p result + # + def stop_scan_run request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::WebSecurityScanner::V1beta::StopScanRunRequest + + # Converts hash 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.stop_scan_run.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::WebSecurityScanner::V1beta::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.stop_scan_run.timeout, + metadata: metadata, + retry_policy: @config.rpcs.stop_scan_run.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @web_security_scanner_stub.call_rpc :stop_scan_run, 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 + + ## + # List CrawledUrls under a given ScanRun. + # + # @overload list_crawled_urls(request, options = nil) + # Pass arguments to `list_crawled_urls` via a request object, either of type + # {::Google::Cloud::WebSecurityScanner::V1beta::ListCrawledUrlsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::WebSecurityScanner::V1beta::ListCrawledUrlsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_crawled_urls(parent: nil, page_token: nil, page_size: nil) + # Pass arguments to `list_crawled_urls` via keyword arguments. Note that at + # least one keyword argument is 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 parent resource name, which should be a scan run resource name in the + # format + # 'projects/\\{projectId}/scanConfigs/\\{scanConfigId}/scanRuns/\\{scanRunId}'. + # @param page_token [::String] + # A token identifying a page of results to be returned. This should be a + # `next_page_token` value returned from a previous List request. + # If unspecified, the first page of results is returned. + # @param page_size [::Integer] + # The maximum number of CrawledUrls to return, can be limited by server. + # If not specified or not positive, the implementation will select a + # reasonable value. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::WebSecurityScanner::V1beta::CrawledUrl>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::WebSecurityScanner::V1beta::CrawledUrl>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/web_security_scanner/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::WebSecurityScanner::V1beta::ListCrawledUrlsRequest.new + # + # # Call the list_crawled_urls method. + # result = client.list_crawled_urls 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::WebSecurityScanner::V1beta::CrawledUrl. + # p item + # end + # + def list_crawled_urls request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::WebSecurityScanner::V1beta::ListCrawledUrlsRequest + + # Converts hash 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_crawled_urls.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::WebSecurityScanner::V1beta::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_crawled_urls.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_crawled_urls.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @web_security_scanner_stub.call_rpc :list_crawled_urls, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @web_security_scanner_stub, :list_crawled_urls, 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 + + ## + # Gets a Finding. + # + # @overload get_finding(request, options = nil) + # Pass arguments to `get_finding` via a request object, either of type + # {::Google::Cloud::WebSecurityScanner::V1beta::GetFindingRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::WebSecurityScanner::V1beta::GetFindingRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_finding(name: nil) + # Pass arguments to `get_finding` via keyword arguments. Note that at + # least one keyword argument is 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 Finding to be returned. The name follows the + # format of + # 'projects/\\{projectId}/scanConfigs/\\{scanConfigId}/scanRuns/\\{scanRunId}/findings/\\{findingId}'. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::WebSecurityScanner::V1beta::Finding] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::WebSecurityScanner::V1beta::Finding] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/web_security_scanner/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::WebSecurityScanner::V1beta::GetFindingRequest.new + # + # # Call the get_finding method. + # result = client.get_finding request + # + # # The returned object is of type Google::Cloud::WebSecurityScanner::V1beta::Finding. + # p result + # + def get_finding request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::WebSecurityScanner::V1beta::GetFindingRequest + + # Converts hash 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_finding.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::WebSecurityScanner::V1beta::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_finding.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_finding.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @web_security_scanner_stub.call_rpc :get_finding, 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 + + ## + # List Findings under a given ScanRun. + # + # @overload list_findings(request, options = nil) + # Pass arguments to `list_findings` via a request object, either of type + # {::Google::Cloud::WebSecurityScanner::V1beta::ListFindingsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::WebSecurityScanner::V1beta::ListFindingsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_findings(parent: nil, filter: nil, page_token: nil, page_size: nil) + # Pass arguments to `list_findings` via keyword arguments. Note that at + # least one keyword argument is 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 parent resource name, which should be a scan run resource name in the + # format + # 'projects/\\{projectId}/scanConfigs/\\{scanConfigId}/scanRuns/\\{scanRunId}'. + # @param filter [::String] + # Required. The filter expression. The expression must be in the format: + # . + # Supported field: 'finding_type'. + # Supported operator: '='. + # @param page_token [::String] + # A token identifying a page of results to be returned. This should be a + # `next_page_token` value returned from a previous List request. + # If unspecified, the first page of results is returned. + # @param page_size [::Integer] + # The maximum number of Findings to return, can be limited by server. + # If not specified or not positive, the implementation will select a + # reasonable value. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::WebSecurityScanner::V1beta::Finding>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::WebSecurityScanner::V1beta::Finding>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/web_security_scanner/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::WebSecurityScanner::V1beta::ListFindingsRequest.new + # + # # Call the list_findings method. + # result = client.list_findings 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::WebSecurityScanner::V1beta::Finding. + # p item + # end + # + def list_findings request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::WebSecurityScanner::V1beta::ListFindingsRequest + + # Converts hash 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_findings.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::WebSecurityScanner::V1beta::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_findings.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_findings.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @web_security_scanner_stub.call_rpc :list_findings, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @web_security_scanner_stub, :list_findings, 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 + + ## + # List all FindingTypeStats under a given ScanRun. + # + # @overload list_finding_type_stats(request, options = nil) + # Pass arguments to `list_finding_type_stats` via a request object, either of type + # {::Google::Cloud::WebSecurityScanner::V1beta::ListFindingTypeStatsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::WebSecurityScanner::V1beta::ListFindingTypeStatsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_finding_type_stats(parent: nil) + # Pass arguments to `list_finding_type_stats` via keyword arguments. Note that at + # least one keyword argument is 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 parent resource name, which should be a scan run resource name in the + # format + # 'projects/\\{projectId}/scanConfigs/\\{scanConfigId}/scanRuns/\\{scanRunId}'. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::WebSecurityScanner::V1beta::ListFindingTypeStatsResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::WebSecurityScanner::V1beta::ListFindingTypeStatsResponse] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/web_security_scanner/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::WebSecurityScanner::V1beta::ListFindingTypeStatsRequest.new + # + # # Call the list_finding_type_stats method. + # result = client.list_finding_type_stats request + # + # # The returned object is of type Google::Cloud::WebSecurityScanner::V1beta::ListFindingTypeStatsResponse. + # p result + # + def list_finding_type_stats request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::WebSecurityScanner::V1beta::ListFindingTypeStatsRequest + + # Converts hash 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_finding_type_stats.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::WebSecurityScanner::V1beta::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_finding_type_stats.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_finding_type_stats.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @web_security_scanner_stub.call_rpc :list_finding_type_stats, 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 WebSecurityScanner API. + # + # This class represents the configuration for WebSecurityScanner, + # 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::WebSecurityScanner::V1beta::WebSecurityScanner::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_scan_config to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.create_scan_config.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.create_scan_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::WebSecurityScanner::V1beta::WebSecurityScanner::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 = "websecurityscanner.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 WebSecurityScanner 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_scan_config` + # @return [::Gapic::Config::Method] + # + attr_reader :create_scan_config + ## + # RPC-specific configuration for `delete_scan_config` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_scan_config + ## + # RPC-specific configuration for `get_scan_config` + # @return [::Gapic::Config::Method] + # + attr_reader :get_scan_config + ## + # RPC-specific configuration for `list_scan_configs` + # @return [::Gapic::Config::Method] + # + attr_reader :list_scan_configs + ## + # RPC-specific configuration for `update_scan_config` + # @return [::Gapic::Config::Method] + # + attr_reader :update_scan_config + ## + # RPC-specific configuration for `start_scan_run` + # @return [::Gapic::Config::Method] + # + attr_reader :start_scan_run + ## + # RPC-specific configuration for `get_scan_run` + # @return [::Gapic::Config::Method] + # + attr_reader :get_scan_run + ## + # RPC-specific configuration for `list_scan_runs` + # @return [::Gapic::Config::Method] + # + attr_reader :list_scan_runs + ## + # RPC-specific configuration for `stop_scan_run` + # @return [::Gapic::Config::Method] + # + attr_reader :stop_scan_run + ## + # RPC-specific configuration for `list_crawled_urls` + # @return [::Gapic::Config::Method] + # + attr_reader :list_crawled_urls + ## + # RPC-specific configuration for `get_finding` + # @return [::Gapic::Config::Method] + # + attr_reader :get_finding + ## + # RPC-specific configuration for `list_findings` + # @return [::Gapic::Config::Method] + # + attr_reader :list_findings + ## + # RPC-specific configuration for `list_finding_type_stats` + # @return [::Gapic::Config::Method] + # + attr_reader :list_finding_type_stats + + # @private + def initialize parent_rpcs = nil + create_scan_config_config = parent_rpcs.create_scan_config if parent_rpcs.respond_to? :create_scan_config + @create_scan_config = ::Gapic::Config::Method.new create_scan_config_config + delete_scan_config_config = parent_rpcs.delete_scan_config if parent_rpcs.respond_to? :delete_scan_config + @delete_scan_config = ::Gapic::Config::Method.new delete_scan_config_config + get_scan_config_config = parent_rpcs.get_scan_config if parent_rpcs.respond_to? :get_scan_config + @get_scan_config = ::Gapic::Config::Method.new get_scan_config_config + list_scan_configs_config = parent_rpcs.list_scan_configs if parent_rpcs.respond_to? :list_scan_configs + @list_scan_configs = ::Gapic::Config::Method.new list_scan_configs_config + update_scan_config_config = parent_rpcs.update_scan_config if parent_rpcs.respond_to? :update_scan_config + @update_scan_config = ::Gapic::Config::Method.new update_scan_config_config + start_scan_run_config = parent_rpcs.start_scan_run if parent_rpcs.respond_to? :start_scan_run + @start_scan_run = ::Gapic::Config::Method.new start_scan_run_config + get_scan_run_config = parent_rpcs.get_scan_run if parent_rpcs.respond_to? :get_scan_run + @get_scan_run = ::Gapic::Config::Method.new get_scan_run_config + list_scan_runs_config = parent_rpcs.list_scan_runs if parent_rpcs.respond_to? :list_scan_runs + @list_scan_runs = ::Gapic::Config::Method.new list_scan_runs_config + stop_scan_run_config = parent_rpcs.stop_scan_run if parent_rpcs.respond_to? :stop_scan_run + @stop_scan_run = ::Gapic::Config::Method.new stop_scan_run_config + list_crawled_urls_config = parent_rpcs.list_crawled_urls if parent_rpcs.respond_to? :list_crawled_urls + @list_crawled_urls = ::Gapic::Config::Method.new list_crawled_urls_config + get_finding_config = parent_rpcs.get_finding if parent_rpcs.respond_to? :get_finding + @get_finding = ::Gapic::Config::Method.new get_finding_config + list_findings_config = parent_rpcs.list_findings if parent_rpcs.respond_to? :list_findings + @list_findings = ::Gapic::Config::Method.new list_findings_config + list_finding_type_stats_config = parent_rpcs.list_finding_type_stats if parent_rpcs.respond_to? :list_finding_type_stats + @list_finding_type_stats = ::Gapic::Config::Method.new list_finding_type_stats_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-web_security_scanner-v1beta/lib/google/cloud/web_security_scanner/v1beta/web_security_scanner/credentials.rb b/owl-bot-staging/google-cloud-web_security_scanner-v1beta/lib/google/cloud/web_security_scanner/v1beta/web_security_scanner/credentials.rb new file mode 100644 index 000000000000..9237239dac26 --- /dev/null +++ b/owl-bot-staging/google-cloud-web_security_scanner-v1beta/lib/google/cloud/web_security_scanner/v1beta/web_security_scanner/credentials.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! + +require "googleauth" + +module Google + module Cloud + module WebSecurityScanner + module V1beta + module WebSecurityScanner + # Credentials for the WebSecurityScanner API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/cloud-platform" + ] + self.env_vars = [ + "WEB_SECURITY_SCANNER_CREDENTIALS", + "WEB_SECURITY_SCANNER_KEYFILE", + "GOOGLE_CLOUD_CREDENTIALS", + "GOOGLE_CLOUD_KEYFILE", + "GCLOUD_KEYFILE", + "WEB_SECURITY_SCANNER_CREDENTIALS_JSON", + "WEB_SECURITY_SCANNER_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-web_security_scanner-v1beta/lib/google/cloud/web_security_scanner/v1beta/web_security_scanner/paths.rb b/owl-bot-staging/google-cloud-web_security_scanner-v1beta/lib/google/cloud/web_security_scanner/v1beta/web_security_scanner/paths.rb new file mode 100644 index 000000000000..035cb9ea1502 --- /dev/null +++ b/owl-bot-staging/google-cloud-web_security_scanner-v1beta/lib/google/cloud/web_security_scanner/v1beta/web_security_scanner/paths.rb @@ -0,0 +1,104 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 WebSecurityScanner + module V1beta + module WebSecurityScanner + # Path helper methods for the WebSecurityScanner API. + module Paths + ## + # Create a fully-qualified Finding resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/scanConfigs/{scan_config}/scanRuns/{scan_run}/findings/{finding}` + # + # @param project [String] + # @param scan_config [String] + # @param scan_run [String] + # @param finding [String] + # + # @return [::String] + def finding_path project:, scan_config:, scan_run:, finding: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "scan_config cannot contain /" if scan_config.to_s.include? "/" + raise ::ArgumentError, "scan_run cannot contain /" if scan_run.to_s.include? "/" + + "projects/#{project}/scanConfigs/#{scan_config}/scanRuns/#{scan_run}/findings/#{finding}" + 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 + + ## + # Create a fully-qualified ScanConfig resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/scanConfigs/{scan_config}` + # + # @param project [String] + # @param scan_config [String] + # + # @return [::String] + def scan_config_path project:, scan_config: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + + "projects/#{project}/scanConfigs/#{scan_config}" + end + + ## + # Create a fully-qualified ScanRun resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/scanConfigs/{scan_config}/scanRuns/{scan_run}` + # + # @param project [String] + # @param scan_config [String] + # @param scan_run [String] + # + # @return [::String] + def scan_run_path project:, scan_config:, scan_run: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "scan_config cannot contain /" if scan_config.to_s.include? "/" + + "projects/#{project}/scanConfigs/#{scan_config}/scanRuns/#{scan_run}" + end + + extend self + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-web_security_scanner-v1beta/lib/google/cloud/web_security_scanner/v1beta/web_security_scanner/rest.rb b/owl-bot-staging/google-cloud-web_security_scanner-v1beta/lib/google/cloud/web_security_scanner/v1beta/web_security_scanner/rest.rb new file mode 100644 index 000000000000..cc7e1c7d1fdd --- /dev/null +++ b/owl-bot-staging/google-cloud-web_security_scanner-v1beta/lib/google/cloud/web_security_scanner/v1beta/web_security_scanner/rest.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! + +require "gapic/rest" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/web_security_scanner/v1beta/version" + +require "google/cloud/web_security_scanner/v1beta/web_security_scanner/credentials" +require "google/cloud/web_security_scanner/v1beta/web_security_scanner/paths" +require "google/cloud/web_security_scanner/v1beta/web_security_scanner/rest/client" + +module Google + module Cloud + module WebSecurityScanner + module V1beta + ## + # Cloud Web Security Scanner Service identifies security vulnerabilities in web + # applications hosted on Google Cloud Platform. It crawls your application, and + # attempts to exercise as many user inputs and event handlers as possible. + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/web_security_scanner/v1beta/web_security_scanner/rest" + # client = ::Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Rest::Client.new + # + module WebSecurityScanner + # Client for the REST transport + module Rest + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "rest", "helpers.rb" +require "google/cloud/web_security_scanner/v1beta/web_security_scanner/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-web_security_scanner-v1beta/lib/google/cloud/web_security_scanner/v1beta/web_security_scanner/rest/client.rb b/owl-bot-staging/google-cloud-web_security_scanner-v1beta/lib/google/cloud/web_security_scanner/v1beta/web_security_scanner/rest/client.rb new file mode 100644 index 000000000000..ffa4a9d484b1 --- /dev/null +++ b/owl-bot-staging/google-cloud-web_security_scanner-v1beta/lib/google/cloud/web_security_scanner/v1beta/web_security_scanner/rest/client.rb @@ -0,0 +1,1587 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/websecurityscanner/v1beta/web_security_scanner_pb" +require "google/cloud/web_security_scanner/v1beta/web_security_scanner/rest/service_stub" + +module Google + module Cloud + module WebSecurityScanner + module V1beta + module WebSecurityScanner + module Rest + ## + # REST client for the WebSecurityScanner service. + # + # Cloud Web Security Scanner Service identifies security vulnerabilities in web + # applications hosted on Google Cloud Platform. It crawls your application, and + # attempts to exercise as many user inputs and event handlers as possible. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "websecurityscanner.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :web_security_scanner_stub + + ## + # Configure the WebSecurityScanner Client class. + # + # See {::Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all WebSecurityScanner clients + # ::Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::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", "WebSecurityScanner", "V1beta"] + 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_scan_config.timeout = 600.0 + + default_config.rpcs.delete_scan_config.timeout = 600.0 + default_config.rpcs.delete_scan_config.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.get_scan_config.timeout = 600.0 + default_config.rpcs.get_scan_config.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.list_scan_configs.timeout = 600.0 + default_config.rpcs.list_scan_configs.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.update_scan_config.timeout = 600.0 + + default_config.rpcs.start_scan_run.timeout = 600.0 + + default_config.rpcs.get_scan_run.timeout = 600.0 + default_config.rpcs.get_scan_run.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.list_scan_runs.timeout = 600.0 + default_config.rpcs.list_scan_runs.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.stop_scan_run.timeout = 600.0 + + default_config.rpcs.list_crawled_urls.timeout = 600.0 + default_config.rpcs.list_crawled_urls.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.get_finding.timeout = 600.0 + default_config.rpcs.get_finding.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.list_findings.timeout = 600.0 + default_config.rpcs.list_findings.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config.rpcs.list_finding_type_stats.timeout = 600.0 + default_config.rpcs.list_finding_type_stats.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the WebSecurityScanner 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::WebSecurityScanner::V1beta::WebSecurityScanner::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 + @web_security_scanner_stub.universe_domain + end + + ## + # Create a new WebSecurityScanner REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the WebSecurityScanner 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 + + @web_security_scanner_stub = ::Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials, + logger: @config.logger + ) + + @web_security_scanner_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 + end + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @web_security_scanner_stub.logger + end + + # Service calls + + ## + # Creates a new ScanConfig. + # + # @overload create_scan_config(request, options = nil) + # Pass arguments to `create_scan_config` via a request object, either of type + # {::Google::Cloud::WebSecurityScanner::V1beta::CreateScanConfigRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::WebSecurityScanner::V1beta::CreateScanConfigRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_scan_config(parent: nil, scan_config: nil) + # Pass arguments to `create_scan_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. The parent resource name where the scan is created, which should be a + # project resource name in the format 'projects/\\{projectId}'. + # @param scan_config [::Google::Cloud::WebSecurityScanner::V1beta::ScanConfig, ::Hash] + # Required. The ScanConfig to be created. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::WebSecurityScanner::V1beta::ScanConfig] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::WebSecurityScanner::V1beta::ScanConfig] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/web_security_scanner/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::WebSecurityScanner::V1beta::CreateScanConfigRequest.new + # + # # Call the create_scan_config method. + # result = client.create_scan_config request + # + # # The returned object is of type Google::Cloud::WebSecurityScanner::V1beta::ScanConfig. + # p result + # + def create_scan_config request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::WebSecurityScanner::V1beta::CreateScanConfigRequest + + # Converts hash 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_scan_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::WebSecurityScanner::V1beta::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_scan_config.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_scan_config.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @web_security_scanner_stub.create_scan_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 + + ## + # Deletes an existing ScanConfig and its child resources. + # + # @overload delete_scan_config(request, options = nil) + # Pass arguments to `delete_scan_config` via a request object, either of type + # {::Google::Cloud::WebSecurityScanner::V1beta::DeleteScanConfigRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::WebSecurityScanner::V1beta::DeleteScanConfigRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_scan_config(name: nil) + # Pass arguments to `delete_scan_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 resource name of the ScanConfig to be deleted. The name follows the + # format of 'projects/\\{projectId}/scanConfigs/\\{scanConfigId}'. + # @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/web_security_scanner/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::WebSecurityScanner::V1beta::DeleteScanConfigRequest.new + # + # # Call the delete_scan_config method. + # result = client.delete_scan_config request + # + # # The returned object is of type Google::Protobuf::Empty. + # p result + # + def delete_scan_config request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::WebSecurityScanner::V1beta::DeleteScanConfigRequest + + # Converts hash 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_scan_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::WebSecurityScanner::V1beta::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_scan_config.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_scan_config.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @web_security_scanner_stub.delete_scan_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 + + ## + # Gets a ScanConfig. + # + # @overload get_scan_config(request, options = nil) + # Pass arguments to `get_scan_config` via a request object, either of type + # {::Google::Cloud::WebSecurityScanner::V1beta::GetScanConfigRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::WebSecurityScanner::V1beta::GetScanConfigRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_scan_config(name: nil) + # Pass arguments to `get_scan_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 resource name of the ScanConfig to be returned. The name follows the + # format of 'projects/\\{projectId}/scanConfigs/\\{scanConfigId}'. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::WebSecurityScanner::V1beta::ScanConfig] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::WebSecurityScanner::V1beta::ScanConfig] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/web_security_scanner/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::WebSecurityScanner::V1beta::GetScanConfigRequest.new + # + # # Call the get_scan_config method. + # result = client.get_scan_config request + # + # # The returned object is of type Google::Cloud::WebSecurityScanner::V1beta::ScanConfig. + # p result + # + def get_scan_config request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::WebSecurityScanner::V1beta::GetScanConfigRequest + + # Converts hash 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_scan_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::WebSecurityScanner::V1beta::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_scan_config.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_scan_config.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @web_security_scanner_stub.get_scan_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 + + ## + # Lists ScanConfigs under a given project. + # + # @overload list_scan_configs(request, options = nil) + # Pass arguments to `list_scan_configs` via a request object, either of type + # {::Google::Cloud::WebSecurityScanner::V1beta::ListScanConfigsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::WebSecurityScanner::V1beta::ListScanConfigsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_scan_configs(parent: nil, page_token: nil, page_size: nil) + # Pass arguments to `list_scan_configs` via keyword arguments. Note that at + # least one keyword argument is 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 parent resource name, which should be a project resource name in the + # format 'projects/\\{projectId}'. + # @param page_token [::String] + # A token identifying a page of results to be returned. This should be a + # `next_page_token` value returned from a previous List request. + # If unspecified, the first page of results is returned. + # @param page_size [::Integer] + # The maximum number of ScanConfigs to return, can be limited by server. + # If not specified or not positive, the implementation will select a + # reasonable value. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::WebSecurityScanner::V1beta::ScanConfig>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::WebSecurityScanner::V1beta::ScanConfig>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/web_security_scanner/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::WebSecurityScanner::V1beta::ListScanConfigsRequest.new + # + # # Call the list_scan_configs method. + # result = client.list_scan_configs 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::WebSecurityScanner::V1beta::ScanConfig. + # p item + # end + # + def list_scan_configs request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::WebSecurityScanner::V1beta::ListScanConfigsRequest + + # Converts hash 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_scan_configs.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::WebSecurityScanner::V1beta::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_scan_configs.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_scan_configs.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @web_security_scanner_stub.list_scan_configs request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @web_security_scanner_stub, :list_scan_configs, "scan_configs", 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 + + ## + # Updates a ScanConfig. This method support partial update of a ScanConfig. + # + # @overload update_scan_config(request, options = nil) + # Pass arguments to `update_scan_config` via a request object, either of type + # {::Google::Cloud::WebSecurityScanner::V1beta::UpdateScanConfigRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::WebSecurityScanner::V1beta::UpdateScanConfigRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_scan_config(scan_config: nil, update_mask: nil) + # Pass arguments to `update_scan_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 scan_config [::Google::Cloud::WebSecurityScanner::V1beta::ScanConfig, ::Hash] + # Required. The ScanConfig to be updated. The name field must be set to identify the + # resource to be updated. The values of fields not covered by the mask + # will be ignored. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. The update mask applies to the resource. For the `FieldMask` definition, + # see + # https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::WebSecurityScanner::V1beta::ScanConfig] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::WebSecurityScanner::V1beta::ScanConfig] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/web_security_scanner/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::WebSecurityScanner::V1beta::UpdateScanConfigRequest.new + # + # # Call the update_scan_config method. + # result = client.update_scan_config request + # + # # The returned object is of type Google::Cloud::WebSecurityScanner::V1beta::ScanConfig. + # p result + # + def update_scan_config request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::WebSecurityScanner::V1beta::UpdateScanConfigRequest + + # Converts hash 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_scan_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::WebSecurityScanner::V1beta::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_scan_config.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_scan_config.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @web_security_scanner_stub.update_scan_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 + + ## + # Start a ScanRun according to the given ScanConfig. + # + # @overload start_scan_run(request, options = nil) + # Pass arguments to `start_scan_run` via a request object, either of type + # {::Google::Cloud::WebSecurityScanner::V1beta::StartScanRunRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::WebSecurityScanner::V1beta::StartScanRunRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload start_scan_run(name: nil) + # Pass arguments to `start_scan_run` via keyword arguments. Note that at + # least one keyword argument is 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 ScanConfig to be used. The name follows the + # format of 'projects/\\{projectId}/scanConfigs/\\{scanConfigId}'. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::WebSecurityScanner::V1beta::ScanRun] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::WebSecurityScanner::V1beta::ScanRun] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/web_security_scanner/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::WebSecurityScanner::V1beta::StartScanRunRequest.new + # + # # Call the start_scan_run method. + # result = client.start_scan_run request + # + # # The returned object is of type Google::Cloud::WebSecurityScanner::V1beta::ScanRun. + # p result + # + def start_scan_run request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::WebSecurityScanner::V1beta::StartScanRunRequest + + # Converts hash 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.start_scan_run.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::WebSecurityScanner::V1beta::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.start_scan_run.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.start_scan_run.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @web_security_scanner_stub.start_scan_run 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 + + ## + # Gets a ScanRun. + # + # @overload get_scan_run(request, options = nil) + # Pass arguments to `get_scan_run` via a request object, either of type + # {::Google::Cloud::WebSecurityScanner::V1beta::GetScanRunRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::WebSecurityScanner::V1beta::GetScanRunRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_scan_run(name: nil) + # Pass arguments to `get_scan_run` via keyword arguments. Note that at + # least one keyword argument is 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 ScanRun to be returned. The name follows the + # format of + # 'projects/\\{projectId}/scanConfigs/\\{scanConfigId}/scanRuns/\\{scanRunId}'. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::WebSecurityScanner::V1beta::ScanRun] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::WebSecurityScanner::V1beta::ScanRun] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/web_security_scanner/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::WebSecurityScanner::V1beta::GetScanRunRequest.new + # + # # Call the get_scan_run method. + # result = client.get_scan_run request + # + # # The returned object is of type Google::Cloud::WebSecurityScanner::V1beta::ScanRun. + # p result + # + def get_scan_run request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::WebSecurityScanner::V1beta::GetScanRunRequest + + # Converts hash 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_scan_run.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::WebSecurityScanner::V1beta::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_scan_run.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_scan_run.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @web_security_scanner_stub.get_scan_run 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 ScanRuns under a given ScanConfig, in descending order of ScanRun + # stop time. + # + # @overload list_scan_runs(request, options = nil) + # Pass arguments to `list_scan_runs` via a request object, either of type + # {::Google::Cloud::WebSecurityScanner::V1beta::ListScanRunsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::WebSecurityScanner::V1beta::ListScanRunsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_scan_runs(parent: nil, page_token: nil, page_size: nil) + # Pass arguments to `list_scan_runs` via keyword arguments. Note that at + # least one keyword argument is 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 parent resource name, which should be a scan resource name in the + # format 'projects/\\{projectId}/scanConfigs/\\{scanConfigId}'. + # @param page_token [::String] + # A token identifying a page of results to be returned. This should be a + # `next_page_token` value returned from a previous List request. + # If unspecified, the first page of results is returned. + # @param page_size [::Integer] + # The maximum number of ScanRuns to return, can be limited by server. + # If not specified or not positive, the implementation will select a + # reasonable value. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::WebSecurityScanner::V1beta::ScanRun>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::WebSecurityScanner::V1beta::ScanRun>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/web_security_scanner/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::WebSecurityScanner::V1beta::ListScanRunsRequest.new + # + # # Call the list_scan_runs method. + # result = client.list_scan_runs 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::WebSecurityScanner::V1beta::ScanRun. + # p item + # end + # + def list_scan_runs request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::WebSecurityScanner::V1beta::ListScanRunsRequest + + # Converts hash 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_scan_runs.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::WebSecurityScanner::V1beta::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_scan_runs.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_scan_runs.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @web_security_scanner_stub.list_scan_runs request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @web_security_scanner_stub, :list_scan_runs, "scan_runs", 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 + + ## + # Stops a ScanRun. The stopped ScanRun is returned. + # + # @overload stop_scan_run(request, options = nil) + # Pass arguments to `stop_scan_run` via a request object, either of type + # {::Google::Cloud::WebSecurityScanner::V1beta::StopScanRunRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::WebSecurityScanner::V1beta::StopScanRunRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload stop_scan_run(name: nil) + # Pass arguments to `stop_scan_run` via keyword arguments. Note that at + # least one keyword argument is 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 ScanRun to be stopped. The name follows the + # format of + # 'projects/\\{projectId}/scanConfigs/\\{scanConfigId}/scanRuns/\\{scanRunId}'. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::WebSecurityScanner::V1beta::ScanRun] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::WebSecurityScanner::V1beta::ScanRun] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/web_security_scanner/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::WebSecurityScanner::V1beta::StopScanRunRequest.new + # + # # Call the stop_scan_run method. + # result = client.stop_scan_run request + # + # # The returned object is of type Google::Cloud::WebSecurityScanner::V1beta::ScanRun. + # p result + # + def stop_scan_run request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::WebSecurityScanner::V1beta::StopScanRunRequest + + # Converts hash 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.stop_scan_run.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::WebSecurityScanner::V1beta::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.stop_scan_run.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.stop_scan_run.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @web_security_scanner_stub.stop_scan_run 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 + + ## + # List CrawledUrls under a given ScanRun. + # + # @overload list_crawled_urls(request, options = nil) + # Pass arguments to `list_crawled_urls` via a request object, either of type + # {::Google::Cloud::WebSecurityScanner::V1beta::ListCrawledUrlsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::WebSecurityScanner::V1beta::ListCrawledUrlsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_crawled_urls(parent: nil, page_token: nil, page_size: nil) + # Pass arguments to `list_crawled_urls` via keyword arguments. Note that at + # least one keyword argument is 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 parent resource name, which should be a scan run resource name in the + # format + # 'projects/\\{projectId}/scanConfigs/\\{scanConfigId}/scanRuns/\\{scanRunId}'. + # @param page_token [::String] + # A token identifying a page of results to be returned. This should be a + # `next_page_token` value returned from a previous List request. + # If unspecified, the first page of results is returned. + # @param page_size [::Integer] + # The maximum number of CrawledUrls to return, can be limited by server. + # If not specified or not positive, the implementation will select a + # reasonable value. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::WebSecurityScanner::V1beta::CrawledUrl>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::WebSecurityScanner::V1beta::CrawledUrl>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/web_security_scanner/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::WebSecurityScanner::V1beta::ListCrawledUrlsRequest.new + # + # # Call the list_crawled_urls method. + # result = client.list_crawled_urls 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::WebSecurityScanner::V1beta::CrawledUrl. + # p item + # end + # + def list_crawled_urls request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::WebSecurityScanner::V1beta::ListCrawledUrlsRequest + + # Converts hash 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_crawled_urls.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::WebSecurityScanner::V1beta::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_crawled_urls.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_crawled_urls.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @web_security_scanner_stub.list_crawled_urls request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @web_security_scanner_stub, :list_crawled_urls, "crawled_urls", 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 a Finding. + # + # @overload get_finding(request, options = nil) + # Pass arguments to `get_finding` via a request object, either of type + # {::Google::Cloud::WebSecurityScanner::V1beta::GetFindingRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::WebSecurityScanner::V1beta::GetFindingRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_finding(name: nil) + # Pass arguments to `get_finding` via keyword arguments. Note that at + # least one keyword argument is 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 Finding to be returned. The name follows the + # format of + # 'projects/\\{projectId}/scanConfigs/\\{scanConfigId}/scanRuns/\\{scanRunId}/findings/\\{findingId}'. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::WebSecurityScanner::V1beta::Finding] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::WebSecurityScanner::V1beta::Finding] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/web_security_scanner/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::WebSecurityScanner::V1beta::GetFindingRequest.new + # + # # Call the get_finding method. + # result = client.get_finding request + # + # # The returned object is of type Google::Cloud::WebSecurityScanner::V1beta::Finding. + # p result + # + def get_finding request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::WebSecurityScanner::V1beta::GetFindingRequest + + # Converts hash 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_finding.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::WebSecurityScanner::V1beta::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_finding.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_finding.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @web_security_scanner_stub.get_finding 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 + + ## + # List Findings under a given ScanRun. + # + # @overload list_findings(request, options = nil) + # Pass arguments to `list_findings` via a request object, either of type + # {::Google::Cloud::WebSecurityScanner::V1beta::ListFindingsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::WebSecurityScanner::V1beta::ListFindingsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_findings(parent: nil, filter: nil, page_token: nil, page_size: nil) + # Pass arguments to `list_findings` via keyword arguments. Note that at + # least one keyword argument is 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 parent resource name, which should be a scan run resource name in the + # format + # 'projects/\\{projectId}/scanConfigs/\\{scanConfigId}/scanRuns/\\{scanRunId}'. + # @param filter [::String] + # Required. The filter expression. The expression must be in the format: + # . + # Supported field: 'finding_type'. + # Supported operator: '='. + # @param page_token [::String] + # A token identifying a page of results to be returned. This should be a + # `next_page_token` value returned from a previous List request. + # If unspecified, the first page of results is returned. + # @param page_size [::Integer] + # The maximum number of Findings to return, can be limited by server. + # If not specified or not positive, the implementation will select a + # reasonable value. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::WebSecurityScanner::V1beta::Finding>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::WebSecurityScanner::V1beta::Finding>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/web_security_scanner/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::WebSecurityScanner::V1beta::ListFindingsRequest.new + # + # # Call the list_findings method. + # result = client.list_findings 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::WebSecurityScanner::V1beta::Finding. + # p item + # end + # + def list_findings request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::WebSecurityScanner::V1beta::ListFindingsRequest + + # Converts hash 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_findings.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::WebSecurityScanner::V1beta::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_findings.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_findings.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @web_security_scanner_stub.list_findings request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @web_security_scanner_stub, :list_findings, "findings", 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 + + ## + # List all FindingTypeStats under a given ScanRun. + # + # @overload list_finding_type_stats(request, options = nil) + # Pass arguments to `list_finding_type_stats` via a request object, either of type + # {::Google::Cloud::WebSecurityScanner::V1beta::ListFindingTypeStatsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::WebSecurityScanner::V1beta::ListFindingTypeStatsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_finding_type_stats(parent: nil) + # Pass arguments to `list_finding_type_stats` via keyword arguments. Note that at + # least one keyword argument is 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 parent resource name, which should be a scan run resource name in the + # format + # 'projects/\\{projectId}/scanConfigs/\\{scanConfigId}/scanRuns/\\{scanRunId}'. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::WebSecurityScanner::V1beta::ListFindingTypeStatsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::WebSecurityScanner::V1beta::ListFindingTypeStatsResponse] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/web_security_scanner/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::WebSecurityScanner::V1beta::ListFindingTypeStatsRequest.new + # + # # Call the list_finding_type_stats method. + # result = client.list_finding_type_stats request + # + # # The returned object is of type Google::Cloud::WebSecurityScanner::V1beta::ListFindingTypeStatsResponse. + # p result + # + def list_finding_type_stats request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::WebSecurityScanner::V1beta::ListFindingTypeStatsRequest + + # Converts hash 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_finding_type_stats.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::WebSecurityScanner::V1beta::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_finding_type_stats.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_finding_type_stats.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @web_security_scanner_stub.list_finding_type_stats 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 WebSecurityScanner REST API. + # + # This class represents the configuration for WebSecurityScanner 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::WebSecurityScanner::V1beta::WebSecurityScanner::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_scan_config to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.create_scan_config.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.create_scan_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 = "websecurityscanner.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 WebSecurityScanner 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_scan_config` + # @return [::Gapic::Config::Method] + # + attr_reader :create_scan_config + ## + # RPC-specific configuration for `delete_scan_config` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_scan_config + ## + # RPC-specific configuration for `get_scan_config` + # @return [::Gapic::Config::Method] + # + attr_reader :get_scan_config + ## + # RPC-specific configuration for `list_scan_configs` + # @return [::Gapic::Config::Method] + # + attr_reader :list_scan_configs + ## + # RPC-specific configuration for `update_scan_config` + # @return [::Gapic::Config::Method] + # + attr_reader :update_scan_config + ## + # RPC-specific configuration for `start_scan_run` + # @return [::Gapic::Config::Method] + # + attr_reader :start_scan_run + ## + # RPC-specific configuration for `get_scan_run` + # @return [::Gapic::Config::Method] + # + attr_reader :get_scan_run + ## + # RPC-specific configuration for `list_scan_runs` + # @return [::Gapic::Config::Method] + # + attr_reader :list_scan_runs + ## + # RPC-specific configuration for `stop_scan_run` + # @return [::Gapic::Config::Method] + # + attr_reader :stop_scan_run + ## + # RPC-specific configuration for `list_crawled_urls` + # @return [::Gapic::Config::Method] + # + attr_reader :list_crawled_urls + ## + # RPC-specific configuration for `get_finding` + # @return [::Gapic::Config::Method] + # + attr_reader :get_finding + ## + # RPC-specific configuration for `list_findings` + # @return [::Gapic::Config::Method] + # + attr_reader :list_findings + ## + # RPC-specific configuration for `list_finding_type_stats` + # @return [::Gapic::Config::Method] + # + attr_reader :list_finding_type_stats + + # @private + def initialize parent_rpcs = nil + create_scan_config_config = parent_rpcs.create_scan_config if parent_rpcs.respond_to? :create_scan_config + @create_scan_config = ::Gapic::Config::Method.new create_scan_config_config + delete_scan_config_config = parent_rpcs.delete_scan_config if parent_rpcs.respond_to? :delete_scan_config + @delete_scan_config = ::Gapic::Config::Method.new delete_scan_config_config + get_scan_config_config = parent_rpcs.get_scan_config if parent_rpcs.respond_to? :get_scan_config + @get_scan_config = ::Gapic::Config::Method.new get_scan_config_config + list_scan_configs_config = parent_rpcs.list_scan_configs if parent_rpcs.respond_to? :list_scan_configs + @list_scan_configs = ::Gapic::Config::Method.new list_scan_configs_config + update_scan_config_config = parent_rpcs.update_scan_config if parent_rpcs.respond_to? :update_scan_config + @update_scan_config = ::Gapic::Config::Method.new update_scan_config_config + start_scan_run_config = parent_rpcs.start_scan_run if parent_rpcs.respond_to? :start_scan_run + @start_scan_run = ::Gapic::Config::Method.new start_scan_run_config + get_scan_run_config = parent_rpcs.get_scan_run if parent_rpcs.respond_to? :get_scan_run + @get_scan_run = ::Gapic::Config::Method.new get_scan_run_config + list_scan_runs_config = parent_rpcs.list_scan_runs if parent_rpcs.respond_to? :list_scan_runs + @list_scan_runs = ::Gapic::Config::Method.new list_scan_runs_config + stop_scan_run_config = parent_rpcs.stop_scan_run if parent_rpcs.respond_to? :stop_scan_run + @stop_scan_run = ::Gapic::Config::Method.new stop_scan_run_config + list_crawled_urls_config = parent_rpcs.list_crawled_urls if parent_rpcs.respond_to? :list_crawled_urls + @list_crawled_urls = ::Gapic::Config::Method.new list_crawled_urls_config + get_finding_config = parent_rpcs.get_finding if parent_rpcs.respond_to? :get_finding + @get_finding = ::Gapic::Config::Method.new get_finding_config + list_findings_config = parent_rpcs.list_findings if parent_rpcs.respond_to? :list_findings + @list_findings = ::Gapic::Config::Method.new list_findings_config + list_finding_type_stats_config = parent_rpcs.list_finding_type_stats if parent_rpcs.respond_to? :list_finding_type_stats + @list_finding_type_stats = ::Gapic::Config::Method.new list_finding_type_stats_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-web_security_scanner-v1beta/lib/google/cloud/web_security_scanner/v1beta/web_security_scanner/rest/service_stub.rb b/owl-bot-staging/google-cloud-web_security_scanner-v1beta/lib/google/cloud/web_security_scanner/v1beta/web_security_scanner/rest/service_stub.rb new file mode 100644 index 000000000000..bcd26bf90ea5 --- /dev/null +++ b/owl-bot-staging/google-cloud-web_security_scanner-v1beta/lib/google/cloud/web_security_scanner/v1beta/web_security_scanner/rest/service_stub.rb @@ -0,0 +1,878 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/websecurityscanner/v1beta/web_security_scanner_pb" + +module Google + module Cloud + module WebSecurityScanner + module V1beta + module WebSecurityScanner + module Rest + ## + # REST service stub for the WebSecurityScanner 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_scan_config REST call + # + # @param request_pb [::Google::Cloud::WebSecurityScanner::V1beta::CreateScanConfigRequest] + # 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::WebSecurityScanner::V1beta::ScanConfig] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::WebSecurityScanner::V1beta::ScanConfig] + # A result object deserialized from the server's reply + def create_scan_config request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_scan_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: "create_scan_config", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::WebSecurityScanner::V1beta::ScanConfig.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_scan_config REST call + # + # @param request_pb [::Google::Cloud::WebSecurityScanner::V1beta::DeleteScanConfigRequest] + # 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_scan_config request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_scan_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: "delete_scan_config", + 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 get_scan_config REST call + # + # @param request_pb [::Google::Cloud::WebSecurityScanner::V1beta::GetScanConfigRequest] + # 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::WebSecurityScanner::V1beta::ScanConfig] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::WebSecurityScanner::V1beta::ScanConfig] + # A result object deserialized from the server's reply + def get_scan_config request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_scan_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_scan_config", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::WebSecurityScanner::V1beta::ScanConfig.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_scan_configs REST call + # + # @param request_pb [::Google::Cloud::WebSecurityScanner::V1beta::ListScanConfigsRequest] + # 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::WebSecurityScanner::V1beta::ListScanConfigsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::WebSecurityScanner::V1beta::ListScanConfigsResponse] + # A result object deserialized from the server's reply + def list_scan_configs request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_scan_configs_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_scan_configs", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::WebSecurityScanner::V1beta::ListScanConfigsResponse.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_scan_config REST call + # + # @param request_pb [::Google::Cloud::WebSecurityScanner::V1beta::UpdateScanConfigRequest] + # 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::WebSecurityScanner::V1beta::ScanConfig] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::WebSecurityScanner::V1beta::ScanConfig] + # A result object deserialized from the server's reply + def update_scan_config request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_scan_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_scan_config", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::WebSecurityScanner::V1beta::ScanConfig.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the start_scan_run REST call + # + # @param request_pb [::Google::Cloud::WebSecurityScanner::V1beta::StartScanRunRequest] + # 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::WebSecurityScanner::V1beta::ScanRun] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::WebSecurityScanner::V1beta::ScanRun] + # A result object deserialized from the server's reply + def start_scan_run request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_start_scan_run_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: "start_scan_run", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::WebSecurityScanner::V1beta::ScanRun.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_scan_run REST call + # + # @param request_pb [::Google::Cloud::WebSecurityScanner::V1beta::GetScanRunRequest] + # 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::WebSecurityScanner::V1beta::ScanRun] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::WebSecurityScanner::V1beta::ScanRun] + # A result object deserialized from the server's reply + def get_scan_run request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_scan_run_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_scan_run", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::WebSecurityScanner::V1beta::ScanRun.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_scan_runs REST call + # + # @param request_pb [::Google::Cloud::WebSecurityScanner::V1beta::ListScanRunsRequest] + # 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::WebSecurityScanner::V1beta::ListScanRunsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::WebSecurityScanner::V1beta::ListScanRunsResponse] + # A result object deserialized from the server's reply + def list_scan_runs request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_scan_runs_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_scan_runs", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::WebSecurityScanner::V1beta::ListScanRunsResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the stop_scan_run REST call + # + # @param request_pb [::Google::Cloud::WebSecurityScanner::V1beta::StopScanRunRequest] + # 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::WebSecurityScanner::V1beta::ScanRun] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::WebSecurityScanner::V1beta::ScanRun] + # A result object deserialized from the server's reply + def stop_scan_run request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_stop_scan_run_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: "stop_scan_run", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::WebSecurityScanner::V1beta::ScanRun.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_crawled_urls REST call + # + # @param request_pb [::Google::Cloud::WebSecurityScanner::V1beta::ListCrawledUrlsRequest] + # 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::WebSecurityScanner::V1beta::ListCrawledUrlsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::WebSecurityScanner::V1beta::ListCrawledUrlsResponse] + # A result object deserialized from the server's reply + def list_crawled_urls request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_crawled_urls_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_crawled_urls", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::WebSecurityScanner::V1beta::ListCrawledUrlsResponse.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_finding REST call + # + # @param request_pb [::Google::Cloud::WebSecurityScanner::V1beta::GetFindingRequest] + # 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::WebSecurityScanner::V1beta::Finding] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::WebSecurityScanner::V1beta::Finding] + # A result object deserialized from the server's reply + def get_finding request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_finding_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_finding", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::WebSecurityScanner::V1beta::Finding.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_findings REST call + # + # @param request_pb [::Google::Cloud::WebSecurityScanner::V1beta::ListFindingsRequest] + # 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::WebSecurityScanner::V1beta::ListFindingsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::WebSecurityScanner::V1beta::ListFindingsResponse] + # A result object deserialized from the server's reply + def list_findings request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_findings_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_findings", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::WebSecurityScanner::V1beta::ListFindingsResponse.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_finding_type_stats REST call + # + # @param request_pb [::Google::Cloud::WebSecurityScanner::V1beta::ListFindingTypeStatsRequest] + # 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::WebSecurityScanner::V1beta::ListFindingTypeStatsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::WebSecurityScanner::V1beta::ListFindingTypeStatsResponse] + # A result object deserialized from the server's reply + def list_finding_type_stats request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_finding_type_stats_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_finding_type_stats", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::WebSecurityScanner::V1beta::ListFindingTypeStatsResponse.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_scan_config REST call + # + # @param request_pb [::Google::Cloud::WebSecurityScanner::V1beta::CreateScanConfigRequest] + # 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_scan_config_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1beta/{parent}/scanConfigs", + body: "scan_config", + matches: [ + ["parent", %r{^projects/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_scan_config REST call + # + # @param request_pb [::Google::Cloud::WebSecurityScanner::V1beta::DeleteScanConfigRequest] + # 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_scan_config_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1beta/{name}", + matches: [ + ["name", %r{^projects/[^/]+/scanConfigs/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_scan_config REST call + # + # @param request_pb [::Google::Cloud::WebSecurityScanner::V1beta::GetScanConfigRequest] + # 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_scan_config_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1beta/{name}", + matches: [ + ["name", %r{^projects/[^/]+/scanConfigs/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_scan_configs REST call + # + # @param request_pb [::Google::Cloud::WebSecurityScanner::V1beta::ListScanConfigsRequest] + # 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_scan_configs_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1beta/{parent}/scanConfigs", + matches: [ + ["parent", %r{^projects/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_scan_config REST call + # + # @param request_pb [::Google::Cloud::WebSecurityScanner::V1beta::UpdateScanConfigRequest] + # 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_scan_config_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v1beta/{scan_config.name}", + body: "scan_config", + matches: [ + ["scan_config.name", %r{^projects/[^/]+/scanConfigs/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the start_scan_run REST call + # + # @param request_pb [::Google::Cloud::WebSecurityScanner::V1beta::StartScanRunRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_start_scan_run_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1beta/{name}:start", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/scanConfigs/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_scan_run REST call + # + # @param request_pb [::Google::Cloud::WebSecurityScanner::V1beta::GetScanRunRequest] + # 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_scan_run_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1beta/{name}", + matches: [ + ["name", %r{^projects/[^/]+/scanConfigs/[^/]+/scanRuns/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_scan_runs REST call + # + # @param request_pb [::Google::Cloud::WebSecurityScanner::V1beta::ListScanRunsRequest] + # 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_scan_runs_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1beta/{parent}/scanRuns", + matches: [ + ["parent", %r{^projects/[^/]+/scanConfigs/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the stop_scan_run REST call + # + # @param request_pb [::Google::Cloud::WebSecurityScanner::V1beta::StopScanRunRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_stop_scan_run_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1beta/{name}:stop", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/scanConfigs/[^/]+/scanRuns/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_crawled_urls REST call + # + # @param request_pb [::Google::Cloud::WebSecurityScanner::V1beta::ListCrawledUrlsRequest] + # 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_crawled_urls_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1beta/{parent}/crawledUrls", + matches: [ + ["parent", %r{^projects/[^/]+/scanConfigs/[^/]+/scanRuns/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_finding REST call + # + # @param request_pb [::Google::Cloud::WebSecurityScanner::V1beta::GetFindingRequest] + # 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_finding_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1beta/{name}", + matches: [ + ["name", %r{^projects/[^/]+/scanConfigs/[^/]+/scanRuns/[^/]+/findings/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_findings REST call + # + # @param request_pb [::Google::Cloud::WebSecurityScanner::V1beta::ListFindingsRequest] + # 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_findings_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1beta/{parent}/findings", + matches: [ + ["parent", %r{^projects/[^/]+/scanConfigs/[^/]+/scanRuns/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_finding_type_stats REST call + # + # @param request_pb [::Google::Cloud::WebSecurityScanner::V1beta::ListFindingTypeStatsRequest] + # 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_finding_type_stats_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1beta/{parent}/findingTypeStats", + matches: [ + ["parent", %r{^projects/[^/]+/scanConfigs/[^/]+/scanRuns/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-web_security_scanner-v1beta/lib/google/cloud/websecurityscanner/v1beta/crawled_url_pb.rb b/owl-bot-staging/google-cloud-web_security_scanner-v1beta/lib/google/cloud/websecurityscanner/v1beta/crawled_url_pb.rb new file mode 100644 index 000000000000..300dbef56aa1 --- /dev/null +++ b/owl-bot-staging/google-cloud-web_security_scanner-v1beta/lib/google/cloud/websecurityscanner/v1beta/crawled_url_pb.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/websecurityscanner/v1beta/crawled_url.proto + +require 'google/protobuf' + + +descriptor_data = "\n8google/cloud/websecurityscanner/v1beta/crawled_url.proto\x12&google.cloud.websecurityscanner.v1beta\"<\n\nCrawledUrl\x12\x13\n\x0bhttp_method\x18\x01 \x01(\t\x12\x0b\n\x03url\x18\x02 \x01(\t\x12\x0c\n\x04\x62ody\x18\x03 \x01(\tB\x99\x02\n*com.google.cloud.websecurityscanner.v1betaB\x0f\x43rawledUrlProtoP\x01ZZcloud.google.com/go/websecurityscanner/apiv1beta/websecurityscannerpb;websecurityscannerpb\xaa\x02&Google.Cloud.WebSecurityScanner.V1Beta\xca\x02&Google\\Cloud\\WebSecurityScanner\\V1beta\xea\x02)Google::Cloud::WebSecurityScanner::V1betab\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module WebSecurityScanner + module V1beta + CrawledUrl = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.websecurityscanner.v1beta.CrawledUrl").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-web_security_scanner-v1beta/lib/google/cloud/websecurityscanner/v1beta/finding_addon_pb.rb b/owl-bot-staging/google-cloud-web_security_scanner-v1beta/lib/google/cloud/websecurityscanner/v1beta/finding_addon_pb.rb new file mode 100644 index 000000000000..d039df3934ca --- /dev/null +++ b/owl-bot-staging/google-cloud-web_security_scanner-v1beta/lib/google/cloud/websecurityscanner/v1beta/finding_addon_pb.rb @@ -0,0 +1,27 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/websecurityscanner/v1beta/finding_addon.proto + +require 'google/protobuf' + + +descriptor_data = "\n:google/cloud/websecurityscanner/v1beta/finding_addon.proto\x12&google.cloud.websecurityscanner.v1beta\"*\n\x04\x46orm\x12\x12\n\naction_uri\x18\x01 \x01(\t\x12\x0e\n\x06\x66ields\x18\x02 \x03(\t\"Q\n\x0fOutdatedLibrary\x12\x14\n\x0clibrary_name\x18\x01 \x01(\t\x12\x0f\n\x07version\x18\x02 \x01(\t\x12\x17\n\x0flearn_more_urls\x18\x03 \x03(\t\"?\n\x11ViolatingResource\x12\x14\n\x0c\x63ontent_type\x18\x01 \x01(\t\x12\x14\n\x0cresource_url\x18\x02 \x01(\t\"/\n\x14VulnerableParameters\x12\x17\n\x0fparameter_names\x18\x01 \x03(\t\"\xe8\x01\n\x11VulnerableHeaders\x12Q\n\x07headers\x18\x01 \x03(\x0b\x32@.google.cloud.websecurityscanner.v1beta.VulnerableHeaders.Header\x12Y\n\x0fmissing_headers\x18\x02 \x03(\x0b\x32@.google.cloud.websecurityscanner.v1beta.VulnerableHeaders.Header\x1a%\n\x06Header\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t\"2\n\x03Xss\x12\x14\n\x0cstack_traces\x18\x01 \x03(\t\x12\x15\n\rerror_message\x18\x02 \x01(\tB\x9b\x02\n*com.google.cloud.websecurityscanner.v1betaB\x11\x46indingAddonProtoP\x01ZZcloud.google.com/go/websecurityscanner/apiv1beta/websecurityscannerpb;websecurityscannerpb\xaa\x02&Google.Cloud.WebSecurityScanner.V1Beta\xca\x02&Google\\Cloud\\WebSecurityScanner\\V1beta\xea\x02)Google::Cloud::WebSecurityScanner::V1betab\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module WebSecurityScanner + module V1beta + Form = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.websecurityscanner.v1beta.Form").msgclass + OutdatedLibrary = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.websecurityscanner.v1beta.OutdatedLibrary").msgclass + ViolatingResource = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.websecurityscanner.v1beta.ViolatingResource").msgclass + VulnerableParameters = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.websecurityscanner.v1beta.VulnerableParameters").msgclass + VulnerableHeaders = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.websecurityscanner.v1beta.VulnerableHeaders").msgclass + VulnerableHeaders::Header = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.websecurityscanner.v1beta.VulnerableHeaders.Header").msgclass + Xss = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.websecurityscanner.v1beta.Xss").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-web_security_scanner-v1beta/lib/google/cloud/websecurityscanner/v1beta/finding_pb.rb b/owl-bot-staging/google-cloud-web_security_scanner-v1beta/lib/google/cloud/websecurityscanner/v1beta/finding_pb.rb new file mode 100644 index 000000000000..1a3b0059d4ea --- /dev/null +++ b/owl-bot-staging/google-cloud-web_security_scanner-v1beta/lib/google/cloud/websecurityscanner/v1beta/finding_pb.rb @@ -0,0 +1,24 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/websecurityscanner/v1beta/finding.proto + +require 'google/protobuf' + +require 'google/api/resource_pb' +require 'google/cloud/websecurityscanner/v1beta/finding_addon_pb' + + +descriptor_data = "\n4google/cloud/websecurityscanner/v1beta/finding.proto\x12&google.cloud.websecurityscanner.v1beta\x1a\x19google/api/resource.proto\x1a:google/cloud/websecurityscanner/v1beta/finding_addon.proto\"\xa9\x06\n\x07\x46inding\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x14\n\x0c\x66inding_type\x18\x02 \x01(\t\x12\x13\n\x0bhttp_method\x18\x03 \x01(\t\x12\x12\n\nfuzzed_url\x18\x04 \x01(\t\x12\x0c\n\x04\x62ody\x18\x05 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x06 \x01(\t\x12\x18\n\x10reproduction_url\x18\x07 \x01(\t\x12\x11\n\tframe_url\x18\x08 \x01(\t\x12\x11\n\tfinal_url\x18\t \x01(\t\x12\x13\n\x0btracking_id\x18\n \x01(\t\x12:\n\x04\x66orm\x18\x10 \x01(\x0b\x32,.google.cloud.websecurityscanner.v1beta.Form\x12Q\n\x10outdated_library\x18\x0b \x01(\x0b\x32\x37.google.cloud.websecurityscanner.v1beta.OutdatedLibrary\x12U\n\x12violating_resource\x18\x0c \x01(\x0b\x32\x39.google.cloud.websecurityscanner.v1beta.ViolatingResource\x12U\n\x12vulnerable_headers\x18\x0f \x01(\x0b\x32\x39.google.cloud.websecurityscanner.v1beta.VulnerableHeaders\x12[\n\x15vulnerable_parameters\x18\r \x01(\x0b\x32<.google.cloud.websecurityscanner.v1beta.VulnerableParameters\x12\x38\n\x03xss\x18\x0e \x01(\x0b\x32+.google.cloud.websecurityscanner.v1beta.Xss:\x84\x01\xea\x41\x80\x01\n)websecurityscanner.googleapis.com/Finding\x12Sprojects/{project}/scanConfigs/{scan_config}/scanRuns/{scan_run}/findings/{finding}B\x96\x02\n*com.google.cloud.websecurityscanner.v1betaB\x0c\x46indingProtoP\x01ZZcloud.google.com/go/websecurityscanner/apiv1beta/websecurityscannerpb;websecurityscannerpb\xaa\x02&Google.Cloud.WebSecurityScanner.V1Beta\xca\x02&Google\\Cloud\\WebSecurityScanner\\V1beta\xea\x02)Google::Cloud::WebSecurityScanner::V1betab\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module WebSecurityScanner + module V1beta + Finding = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.websecurityscanner.v1beta.Finding").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-web_security_scanner-v1beta/lib/google/cloud/websecurityscanner/v1beta/finding_type_stats_pb.rb b/owl-bot-staging/google-cloud-web_security_scanner-v1beta/lib/google/cloud/websecurityscanner/v1beta/finding_type_stats_pb.rb new file mode 100644 index 000000000000..136678f8b4cc --- /dev/null +++ b/owl-bot-staging/google-cloud-web_security_scanner-v1beta/lib/google/cloud/websecurityscanner/v1beta/finding_type_stats_pb.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/websecurityscanner/v1beta/finding_type_stats.proto + +require 'google/protobuf' + + +descriptor_data = "\n?google/cloud/websecurityscanner/v1beta/finding_type_stats.proto\x12&google.cloud.websecurityscanner.v1beta\"?\n\x10\x46indingTypeStats\x12\x14\n\x0c\x66inding_type\x18\x01 \x01(\t\x12\x15\n\rfinding_count\x18\x02 \x01(\x05\x42\x9f\x02\n*com.google.cloud.websecurityscanner.v1betaB\x15\x46indingTypeStatsProtoP\x01ZZcloud.google.com/go/websecurityscanner/apiv1beta/websecurityscannerpb;websecurityscannerpb\xaa\x02&Google.Cloud.WebSecurityScanner.V1Beta\xca\x02&Google\\Cloud\\WebSecurityScanner\\V1beta\xea\x02)Google::Cloud::WebSecurityScanner::V1betab\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module WebSecurityScanner + module V1beta + FindingTypeStats = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.websecurityscanner.v1beta.FindingTypeStats").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-web_security_scanner-v1beta/lib/google/cloud/websecurityscanner/v1beta/scan_config_error_pb.rb b/owl-bot-staging/google-cloud-web_security_scanner-v1beta/lib/google/cloud/websecurityscanner/v1beta/scan_config_error_pb.rb new file mode 100644 index 000000000000..56270c4fa739 --- /dev/null +++ b/owl-bot-staging/google-cloud-web_security_scanner-v1beta/lib/google/cloud/websecurityscanner/v1beta/scan_config_error_pb.rb @@ -0,0 +1,22 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/websecurityscanner/v1beta/scan_config_error.proto + +require 'google/protobuf' + + +descriptor_data = "\n>google/cloud/websecurityscanner/v1beta/scan_config_error.proto\x12&google.cloud.websecurityscanner.v1beta\"\xed\x0b\n\x0fScanConfigError\x12J\n\x04\x63ode\x18\x01 \x01(\x0e\x32<.google.cloud.websecurityscanner.v1beta.ScanConfigError.Code\x12\x12\n\nfield_name\x18\x02 \x01(\t\"\xf9\n\n\x04\x43ode\x12\x14\n\x10\x43ODE_UNSPECIFIED\x10\x00\x12\x06\n\x02OK\x10\x00\x12\x12\n\x0eINTERNAL_ERROR\x10\x01\x12\x1f\n\x1b\x41PPENGINE_API_BACKEND_ERROR\x10\x02\x12 \n\x1c\x41PPENGINE_API_NOT_ACCESSIBLE\x10\x03\x12\"\n\x1e\x41PPENGINE_DEFAULT_HOST_MISSING\x10\x04\x12!\n\x1d\x43\x41NNOT_USE_GOOGLE_COM_ACCOUNT\x10\x06\x12\x1c\n\x18\x43\x41NNOT_USE_OWNER_ACCOUNT\x10\x07\x12\x1d\n\x19\x43OMPUTE_API_BACKEND_ERROR\x10\x08\x12\x1e\n\x1a\x43OMPUTE_API_NOT_ACCESSIBLE\x10\t\x12\x37\n3CUSTOM_LOGIN_URL_DOES_NOT_BELONG_TO_CURRENT_PROJECT\x10\n\x12\x1e\n\x1a\x43USTOM_LOGIN_URL_MALFORMED\x10\x0b\x12\x33\n/CUSTOM_LOGIN_URL_MAPPED_TO_NON_ROUTABLE_ADDRESS\x10\x0c\x12\x31\n-CUSTOM_LOGIN_URL_MAPPED_TO_UNRESERVED_ADDRESS\x10\r\x12\x30\n,CUSTOM_LOGIN_URL_HAS_NON_ROUTABLE_IP_ADDRESS\x10\x0e\x12.\n*CUSTOM_LOGIN_URL_HAS_UNRESERVED_IP_ADDRESS\x10\x0f\x12\x17\n\x13\x44UPLICATE_SCAN_NAME\x10\x10\x12\x17\n\x13INVALID_FIELD_VALUE\x10\x12\x12$\n FAILED_TO_AUTHENTICATE_TO_TARGET\x10\x13\x12\x1c\n\x18\x46INDING_TYPE_UNSPECIFIED\x10\x14\x12\x1d\n\x19\x46ORBIDDEN_TO_SCAN_COMPUTE\x10\x15\x12$\n FORBIDDEN_UPDATE_TO_MANAGED_SCAN\x10+\x12\x14\n\x10MALFORMED_FILTER\x10\x16\x12\x1b\n\x17MALFORMED_RESOURCE_NAME\x10\x17\x12\x14\n\x10PROJECT_INACTIVE\x10\x18\x12\x12\n\x0eREQUIRED_FIELD\x10\x19\x12\x1e\n\x1aRESOURCE_NAME_INCONSISTENT\x10\x1a\x12\x18\n\x14SCAN_ALREADY_RUNNING\x10\x1b\x12\x14\n\x10SCAN_NOT_RUNNING\x10\x1c\x12/\n+SEED_URL_DOES_NOT_BELONG_TO_CURRENT_PROJECT\x10\x1d\x12\x16\n\x12SEED_URL_MALFORMED\x10\x1e\x12+\n\'SEED_URL_MAPPED_TO_NON_ROUTABLE_ADDRESS\x10\x1f\x12)\n%SEED_URL_MAPPED_TO_UNRESERVED_ADDRESS\x10 \x12(\n$SEED_URL_HAS_NON_ROUTABLE_IP_ADDRESS\x10!\x12&\n\"SEED_URL_HAS_UNRESERVED_IP_ADDRESS\x10#\x12\"\n\x1eSERVICE_ACCOUNT_NOT_CONFIGURED\x10$\x12\x12\n\x0eTOO_MANY_SCANS\x10%\x12\"\n\x1eUNABLE_TO_RESOLVE_PROJECT_INFO\x10&\x12(\n$UNSUPPORTED_BLACKLIST_PATTERN_FORMAT\x10\'\x12\x16\n\x12UNSUPPORTED_FILTER\x10(\x12\x1c\n\x18UNSUPPORTED_FINDING_TYPE\x10)\x12\x1a\n\x16UNSUPPORTED_URL_SCHEME\x10*\x1a\x02\x10\x01\x42\x9e\x02\n*com.google.cloud.websecurityscanner.v1betaB\x14ScanConfigErrorProtoP\x01ZZcloud.google.com/go/websecurityscanner/apiv1beta/websecurityscannerpb;websecurityscannerpb\xaa\x02&Google.Cloud.WebSecurityScanner.V1Beta\xca\x02&Google\\Cloud\\WebSecurityScanner\\V1beta\xea\x02)Google::Cloud::WebSecurityScanner::V1betab\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module WebSecurityScanner + module V1beta + ScanConfigError = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.websecurityscanner.v1beta.ScanConfigError").msgclass + ScanConfigError::Code = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.websecurityscanner.v1beta.ScanConfigError.Code").enummodule + end + end + end +end diff --git a/owl-bot-staging/google-cloud-web_security_scanner-v1beta/lib/google/cloud/websecurityscanner/v1beta/scan_config_pb.rb b/owl-bot-staging/google-cloud-web_security_scanner-v1beta/lib/google/cloud/websecurityscanner/v1beta/scan_config_pb.rb new file mode 100644 index 000000000000..c5a7d84f453f --- /dev/null +++ b/owl-bot-staging/google-cloud-web_security_scanner-v1beta/lib/google/cloud/websecurityscanner/v1beta/scan_config_pb.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/websecurityscanner/v1beta/scan_config.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' +require 'google/api/resource_pb' +require 'google/cloud/websecurityscanner/v1beta/scan_run_pb' +require 'google/protobuf/timestamp_pb' + + +descriptor_data = "\n8google/cloud/websecurityscanner/v1beta/scan_config.proto\x12&google.cloud.websecurityscanner.v1beta\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x35google/cloud/websecurityscanner/v1beta/scan_run.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xa6\r\n\nScanConfig\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x19\n\x0c\x64isplay_name\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x0f\n\x07max_qps\x18\x03 \x01(\x05\x12\x1a\n\rstarting_urls\x18\x04 \x03(\tB\x03\xe0\x41\x02\x12Y\n\x0e\x61uthentication\x18\x05 \x01(\x0b\x32\x41.google.cloud.websecurityscanner.v1beta.ScanConfig.Authentication\x12P\n\nuser_agent\x18\x06 \x01(\x0e\x32<.google.cloud.websecurityscanner.v1beta.ScanConfig.UserAgent\x12\x1a\n\x12\x62lacklist_patterns\x18\x07 \x03(\t\x12M\n\x08schedule\x18\x08 \x01(\x0b\x32;.google.cloud.websecurityscanner.v1beta.ScanConfig.Schedule\x12[\n\x10target_platforms\x18\t \x03(\x0e\x32\x41.google.cloud.websecurityscanner.v1beta.ScanConfig.TargetPlatform\x12{\n!export_to_security_command_center\x18\n \x01(\x0e\x32P.google.cloud.websecurityscanner.v1beta.ScanConfig.ExportToSecurityCommandCenter\x12\x43\n\nlatest_run\x18\x0b \x01(\x0b\x32/.google.cloud.websecurityscanner.v1beta.ScanRun\x12P\n\nrisk_level\x18\x0c \x01(\x0e\x32<.google.cloud.websecurityscanner.v1beta.ScanConfig.RiskLevel\x1a\x94\x03\n\x0e\x41uthentication\x12i\n\x0egoogle_account\x18\x01 \x01(\x0b\x32O.google.cloud.websecurityscanner.v1beta.ScanConfig.Authentication.GoogleAccountH\x00\x12i\n\x0e\x63ustom_account\x18\x02 \x01(\x0b\x32O.google.cloud.websecurityscanner.v1beta.ScanConfig.Authentication.CustomAccountH\x00\x1a@\n\rGoogleAccount\x12\x15\n\x08username\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x18\n\x08password\x18\x02 \x01(\tB\x06\xe0\x41\x02\xe0\x41\x04\x1aX\n\rCustomAccount\x12\x15\n\x08username\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x18\n\x08password\x18\x02 \x01(\tB\x06\xe0\x41\x02\xe0\x41\x04\x12\x16\n\tlogin_url\x18\x03 \x01(\tB\x03\xe0\x41\x02\x42\x10\n\x0e\x61uthentication\x1a\x62\n\x08Schedule\x12\x31\n\rschedule_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12#\n\x16interval_duration_days\x18\x02 \x01(\x05\x42\x03\xe0\x41\x02\"`\n\tUserAgent\x12\x1a\n\x16USER_AGENT_UNSPECIFIED\x10\x00\x12\x10\n\x0c\x43HROME_LINUX\x10\x01\x12\x12\n\x0e\x43HROME_ANDROID\x10\x02\x12\x11\n\rSAFARI_IPHONE\x10\x03\"N\n\x0eTargetPlatform\x12\x1f\n\x1bTARGET_PLATFORM_UNSPECIFIED\x10\x00\x12\x0e\n\nAPP_ENGINE\x10\x01\x12\x0b\n\x07\x43OMPUTE\x10\x02\"<\n\tRiskLevel\x12\x1a\n\x16RISK_LEVEL_UNSPECIFIED\x10\x00\x12\n\n\x06NORMAL\x10\x01\x12\x07\n\x03LOW\x10\x02\"m\n\x1d\x45xportToSecurityCommandCenter\x12\x31\n-EXPORT_TO_SECURITY_COMMAND_CENTER_UNSPECIFIED\x10\x00\x12\x0b\n\x07\x45NABLED\x10\x01\x12\x0c\n\x08\x44ISABLED\x10\x02:_\xea\x41\\\n,websecurityscanner.googleapis.com/ScanConfig\x12,projects/{project}/scanConfigs/{scan_config}B\x99\x02\n*com.google.cloud.websecurityscanner.v1betaB\x0fScanConfigProtoP\x01ZZcloud.google.com/go/websecurityscanner/apiv1beta/websecurityscannerpb;websecurityscannerpb\xaa\x02&Google.Cloud.WebSecurityScanner.V1Beta\xca\x02&Google\\Cloud\\WebSecurityScanner\\V1beta\xea\x02)Google::Cloud::WebSecurityScanner::V1betab\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module WebSecurityScanner + module V1beta + ScanConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.websecurityscanner.v1beta.ScanConfig").msgclass + ScanConfig::Authentication = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.websecurityscanner.v1beta.ScanConfig.Authentication").msgclass + ScanConfig::Authentication::GoogleAccount = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.websecurityscanner.v1beta.ScanConfig.Authentication.GoogleAccount").msgclass + ScanConfig::Authentication::CustomAccount = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.websecurityscanner.v1beta.ScanConfig.Authentication.CustomAccount").msgclass + ScanConfig::Schedule = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.websecurityscanner.v1beta.ScanConfig.Schedule").msgclass + ScanConfig::UserAgent = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.websecurityscanner.v1beta.ScanConfig.UserAgent").enummodule + ScanConfig::TargetPlatform = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.websecurityscanner.v1beta.ScanConfig.TargetPlatform").enummodule + ScanConfig::RiskLevel = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.websecurityscanner.v1beta.ScanConfig.RiskLevel").enummodule + ScanConfig::ExportToSecurityCommandCenter = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.websecurityscanner.v1beta.ScanConfig.ExportToSecurityCommandCenter").enummodule + end + end + end +end diff --git a/owl-bot-staging/google-cloud-web_security_scanner-v1beta/lib/google/cloud/websecurityscanner/v1beta/scan_run_error_trace_pb.rb b/owl-bot-staging/google-cloud-web_security_scanner-v1beta/lib/google/cloud/websecurityscanner/v1beta/scan_run_error_trace_pb.rb new file mode 100644 index 000000000000..08dfdde3eaf9 --- /dev/null +++ b/owl-bot-staging/google-cloud-web_security_scanner-v1beta/lib/google/cloud/websecurityscanner/v1beta/scan_run_error_trace_pb.rb @@ -0,0 +1,24 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/websecurityscanner/v1beta/scan_run_error_trace.proto + +require 'google/protobuf' + +require 'google/cloud/websecurityscanner/v1beta/scan_config_error_pb' + + +descriptor_data = "\nAgoogle/cloud/websecurityscanner/v1beta/scan_run_error_trace.proto\x12&google.cloud.websecurityscanner.v1beta\x1a>google/cloud/websecurityscanner/v1beta/scan_config_error.proto\"\x95\x03\n\x11ScanRunErrorTrace\x12L\n\x04\x63ode\x18\x01 \x01(\x0e\x32>.google.cloud.websecurityscanner.v1beta.ScanRunErrorTrace.Code\x12R\n\x11scan_config_error\x18\x02 \x01(\x0b\x32\x37.google.cloud.websecurityscanner.v1beta.ScanConfigError\x12#\n\x1bmost_common_http_error_code\x18\x03 \x01(\x05\"\xb8\x01\n\x04\x43ode\x12\x14\n\x10\x43ODE_UNSPECIFIED\x10\x00\x12\x12\n\x0eINTERNAL_ERROR\x10\x01\x12\x15\n\x11SCAN_CONFIG_ISSUE\x10\x02\x12\x1f\n\x1b\x41UTHENTICATION_CONFIG_ISSUE\x10\x03\x12\x1c\n\x18TIMED_OUT_WHILE_SCANNING\x10\x04\x12\x16\n\x12TOO_MANY_REDIRECTS\x10\x05\x12\x18\n\x14TOO_MANY_HTTP_ERRORS\x10\x06\x42\xa0\x02\n*com.google.cloud.websecurityscanner.v1betaB\x16ScanRunErrorTraceProtoP\x01ZZcloud.google.com/go/websecurityscanner/apiv1beta/websecurityscannerpb;websecurityscannerpb\xaa\x02&Google.Cloud.WebSecurityScanner.V1Beta\xca\x02&Google\\Cloud\\WebSecurityScanner\\V1beta\xea\x02)Google::Cloud::WebSecurityScanner::V1betab\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module WebSecurityScanner + module V1beta + ScanRunErrorTrace = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.websecurityscanner.v1beta.ScanRunErrorTrace").msgclass + ScanRunErrorTrace::Code = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.websecurityscanner.v1beta.ScanRunErrorTrace.Code").enummodule + end + end + end +end diff --git a/owl-bot-staging/google-cloud-web_security_scanner-v1beta/lib/google/cloud/websecurityscanner/v1beta/scan_run_pb.rb b/owl-bot-staging/google-cloud-web_security_scanner-v1beta/lib/google/cloud/websecurityscanner/v1beta/scan_run_pb.rb new file mode 100644 index 000000000000..d0c56927e4c0 --- /dev/null +++ b/owl-bot-staging/google-cloud-web_security_scanner-v1beta/lib/google/cloud/websecurityscanner/v1beta/scan_run_pb.rb @@ -0,0 +1,28 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/websecurityscanner/v1beta/scan_run.proto + +require 'google/protobuf' + +require 'google/api/resource_pb' +require 'google/cloud/websecurityscanner/v1beta/scan_run_error_trace_pb' +require 'google/cloud/websecurityscanner/v1beta/scan_run_warning_trace_pb' +require 'google/protobuf/timestamp_pb' + + +descriptor_data = "\n5google/cloud/websecurityscanner/v1beta/scan_run.proto\x12&google.cloud.websecurityscanner.v1beta\x1a\x19google/api/resource.proto\x1a\x41google/cloud/websecurityscanner/v1beta/scan_run_error_trace.proto\x1a\x43google/cloud/websecurityscanner/v1beta/scan_run_warning_trace.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xd2\x06\n\x07ScanRun\x12\x0c\n\x04name\x18\x01 \x01(\t\x12W\n\x0f\x65xecution_state\x18\x02 \x01(\x0e\x32>.google.cloud.websecurityscanner.v1beta.ScanRun.ExecutionState\x12Q\n\x0cresult_state\x18\x03 \x01(\x0e\x32;.google.cloud.websecurityscanner.v1beta.ScanRun.ResultState\x12.\n\nstart_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12,\n\x08\x65nd_time\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x1a\n\x12urls_crawled_count\x18\x06 \x01(\x03\x12\x19\n\x11urls_tested_count\x18\x07 \x01(\x03\x12\x1b\n\x13has_vulnerabilities\x18\x08 \x01(\x08\x12\x18\n\x10progress_percent\x18\t \x01(\x05\x12N\n\x0b\x65rror_trace\x18\n \x01(\x0b\x32\x39.google.cloud.websecurityscanner.v1beta.ScanRunErrorTrace\x12S\n\x0ewarning_traces\x18\x0b \x03(\x0b\x32;.google.cloud.websecurityscanner.v1beta.ScanRunWarningTrace\"Y\n\x0e\x45xecutionState\x12\x1f\n\x1b\x45XECUTION_STATE_UNSPECIFIED\x10\x00\x12\n\n\x06QUEUED\x10\x01\x12\x0c\n\x08SCANNING\x10\x02\x12\x0c\n\x08\x46INISHED\x10\x03\"O\n\x0bResultState\x12\x1c\n\x18RESULT_STATE_UNSPECIFIED\x10\x00\x12\x0b\n\x07SUCCESS\x10\x01\x12\t\n\x05\x45RROR\x10\x02\x12\n\n\x06KILLED\x10\x03:p\xea\x41m\n)websecurityscanner.googleapis.com/ScanRun\x12@projects/{project}/scanConfigs/{scan_config}/scanRuns/{scan_run}B\x96\x02\n*com.google.cloud.websecurityscanner.v1betaB\x0cScanRunProtoP\x01ZZcloud.google.com/go/websecurityscanner/apiv1beta/websecurityscannerpb;websecurityscannerpb\xaa\x02&Google.Cloud.WebSecurityScanner.V1Beta\xca\x02&Google\\Cloud\\WebSecurityScanner\\V1beta\xea\x02)Google::Cloud::WebSecurityScanner::V1betab\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module WebSecurityScanner + module V1beta + ScanRun = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.websecurityscanner.v1beta.ScanRun").msgclass + ScanRun::ExecutionState = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.websecurityscanner.v1beta.ScanRun.ExecutionState").enummodule + ScanRun::ResultState = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.websecurityscanner.v1beta.ScanRun.ResultState").enummodule + end + end + end +end diff --git a/owl-bot-staging/google-cloud-web_security_scanner-v1beta/lib/google/cloud/websecurityscanner/v1beta/scan_run_warning_trace_pb.rb b/owl-bot-staging/google-cloud-web_security_scanner-v1beta/lib/google/cloud/websecurityscanner/v1beta/scan_run_warning_trace_pb.rb new file mode 100644 index 000000000000..98c499519688 --- /dev/null +++ b/owl-bot-staging/google-cloud-web_security_scanner-v1beta/lib/google/cloud/websecurityscanner/v1beta/scan_run_warning_trace_pb.rb @@ -0,0 +1,22 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/websecurityscanner/v1beta/scan_run_warning_trace.proto + +require 'google/protobuf' + + +descriptor_data = "\nCgoogle/cloud/websecurityscanner/v1beta/scan_run_warning_trace.proto\x12&google.cloud.websecurityscanner.v1beta\"\xed\x01\n\x13ScanRunWarningTrace\x12N\n\x04\x63ode\x18\x01 \x01(\x0e\x32@.google.cloud.websecurityscanner.v1beta.ScanRunWarningTrace.Code\"\x85\x01\n\x04\x43ode\x12\x14\n\x10\x43ODE_UNSPECIFIED\x10\x00\x12\x1e\n\x1aINSUFFICIENT_CRAWL_RESULTS\x10\x01\x12\x1a\n\x16TOO_MANY_CRAWL_RESULTS\x10\x02\x12\x17\n\x13TOO_MANY_FUZZ_TASKS\x10\x03\x12\x12\n\x0e\x42LOCKED_BY_IAP\x10\x04\x42\xa2\x02\n*com.google.cloud.websecurityscanner.v1betaB\x18ScanRunWarningTraceProtoP\x01ZZcloud.google.com/go/websecurityscanner/apiv1beta/websecurityscannerpb;websecurityscannerpb\xaa\x02&Google.Cloud.WebSecurityScanner.V1Beta\xca\x02&Google\\Cloud\\WebSecurityScanner\\V1beta\xea\x02)Google::Cloud::WebSecurityScanner::V1betab\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module WebSecurityScanner + module V1beta + ScanRunWarningTrace = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.websecurityscanner.v1beta.ScanRunWarningTrace").msgclass + ScanRunWarningTrace::Code = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.websecurityscanner.v1beta.ScanRunWarningTrace.Code").enummodule + end + end + end +end diff --git a/owl-bot-staging/google-cloud-web_security_scanner-v1beta/lib/google/cloud/websecurityscanner/v1beta/web_security_scanner_pb.rb b/owl-bot-staging/google-cloud-web_security_scanner-v1beta/lib/google/cloud/websecurityscanner/v1beta/web_security_scanner_pb.rb new file mode 100644 index 000000000000..1c1b2e5600fd --- /dev/null +++ b/owl-bot-staging/google-cloud-web_security_scanner-v1beta/lib/google/cloud/websecurityscanner/v1beta/web_security_scanner_pb.rb @@ -0,0 +1,50 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/websecurityscanner/v1beta/web_security_scanner.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/websecurityscanner/v1beta/crawled_url_pb' +require 'google/cloud/websecurityscanner/v1beta/finding_pb' +require 'google/cloud/websecurityscanner/v1beta/finding_type_stats_pb' +require 'google/cloud/websecurityscanner/v1beta/scan_config_pb' +require 'google/cloud/websecurityscanner/v1beta/scan_run_pb' +require 'google/protobuf/empty_pb' +require 'google/protobuf/field_mask_pb' + + +descriptor_data = "\nAgoogle/cloud/websecurityscanner/v1beta/web_security_scanner.proto\x12&google.cloud.websecurityscanner.v1beta\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x38google/cloud/websecurityscanner/v1beta/crawled_url.proto\x1a\x34google/cloud/websecurityscanner/v1beta/finding.proto\x1a?google/cloud/websecurityscanner/v1beta/finding_type_stats.proto\x1a\x38google/cloud/websecurityscanner/v1beta/scan_config.proto\x1a\x35google/cloud/websecurityscanner/v1beta/scan_run.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\"\xac\x01\n\x17\x43reateScanConfigRequest\x12\x43\n\x06parent\x18\x01 \x01(\tB3\xe0\x41\x02\xfa\x41-\n+cloudresourcemanager.googleapis.com/Project\x12L\n\x0bscan_config\x18\x02 \x01(\x0b\x32\x32.google.cloud.websecurityscanner.v1beta.ScanConfigB\x03\xe0\x41\x02\"]\n\x17\x44\x65leteScanConfigRequest\x12\x42\n\x04name\x18\x01 \x01(\tB4\xe0\x41\x02\xfa\x41.\n,websecurityscanner.googleapis.com/ScanConfig\"Z\n\x14GetScanConfigRequest\x12\x42\n\x04name\x18\x01 \x01(\tB4\xe0\x41\x02\xfa\x41.\n,websecurityscanner.googleapis.com/ScanConfig\"\x84\x01\n\x16ListScanConfigsRequest\x12\x43\n\x06parent\x18\x01 \x01(\tB3\xe0\x41\x02\xfa\x41-\n+cloudresourcemanager.googleapis.com/Project\x12\x12\n\npage_token\x18\x02 \x01(\t\x12\x11\n\tpage_size\x18\x03 \x01(\x05\"\x9d\x01\n\x17UpdateScanConfigRequest\x12L\n\x0bscan_config\x18\x02 \x01(\x0b\x32\x32.google.cloud.websecurityscanner.v1beta.ScanConfigB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\"|\n\x17ListScanConfigsResponse\x12H\n\x0cscan_configs\x18\x01 \x03(\x0b\x32\x32.google.cloud.websecurityscanner.v1beta.ScanConfig\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"Y\n\x13StartScanRunRequest\x12\x42\n\x04name\x18\x01 \x01(\tB4\xe0\x41\x02\xfa\x41.\n,websecurityscanner.googleapis.com/ScanConfig\"T\n\x11GetScanRunRequest\x12?\n\x04name\x18\x01 \x01(\tB1\xe0\x41\x02\xfa\x41+\n)websecurityscanner.googleapis.com/ScanRun\"\x82\x01\n\x13ListScanRunsRequest\x12\x44\n\x06parent\x18\x01 \x01(\tB4\xe0\x41\x02\xfa\x41.\n,websecurityscanner.googleapis.com/ScanConfig\x12\x12\n\npage_token\x18\x02 \x01(\t\x12\x11\n\tpage_size\x18\x03 \x01(\x05\"s\n\x14ListScanRunsResponse\x12\x42\n\tscan_runs\x18\x01 \x03(\x0b\x32/.google.cloud.websecurityscanner.v1beta.ScanRun\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"U\n\x12StopScanRunRequest\x12?\n\x04name\x18\x01 \x01(\tB1\xe0\x41\x02\xfa\x41+\n)websecurityscanner.googleapis.com/ScanRun\"\x82\x01\n\x16ListCrawledUrlsRequest\x12\x41\n\x06parent\x18\x01 \x01(\tB1\xe0\x41\x02\xfa\x41+\n)websecurityscanner.googleapis.com/ScanRun\x12\x12\n\npage_token\x18\x02 \x01(\t\x12\x11\n\tpage_size\x18\x03 \x01(\x05\"|\n\x17ListCrawledUrlsResponse\x12H\n\x0c\x63rawled_urls\x18\x01 \x03(\x0b\x32\x32.google.cloud.websecurityscanner.v1beta.CrawledUrl\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"T\n\x11GetFindingRequest\x12?\n\x04name\x18\x01 \x01(\tB1\xe0\x41\x02\xfa\x41+\n)websecurityscanner.googleapis.com/Finding\"\x94\x01\n\x13ListFindingsRequest\x12\x41\n\x06parent\x18\x01 \x01(\tB1\xe0\x41\x02\xfa\x41+\n)websecurityscanner.googleapis.com/ScanRun\x12\x13\n\x06\x66ilter\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x12\n\npage_token\x18\x03 \x01(\t\x12\x11\n\tpage_size\x18\x04 \x01(\x05\"r\n\x14ListFindingsResponse\x12\x41\n\x08\x66indings\x18\x01 \x03(\x0b\x32/.google.cloud.websecurityscanner.v1beta.Finding\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"`\n\x1bListFindingTypeStatsRequest\x12\x41\n\x06parent\x18\x01 \x01(\tB1\xe0\x41\x02\xfa\x41+\n)websecurityscanner.googleapis.com/ScanRun\"t\n\x1cListFindingTypeStatsResponse\x12T\n\x12\x66inding_type_stats\x18\x01 \x03(\x0b\x32\x38.google.cloud.websecurityscanner.v1beta.FindingTypeStats2\x8e\x16\n\x12WebSecurityScanner\x12\xda\x01\n\x10\x43reateScanConfig\x12?.google.cloud.websecurityscanner.v1beta.CreateScanConfigRequest\x1a\x32.google.cloud.websecurityscanner.v1beta.ScanConfig\"Q\xda\x41\x12parent,scan_config\x82\xd3\xe4\x93\x02\x36\"\'/v1beta/{parent=projects/*}/scanConfigs:\x0bscan_config\x12\xa3\x01\n\x10\x44\x65leteScanConfig\x12?.google.cloud.websecurityscanner.v1beta.DeleteScanConfigRequest\x1a\x16.google.protobuf.Empty\"6\xda\x41\x04name\x82\xd3\xe4\x93\x02)*\'/v1beta/{name=projects/*/scanConfigs/*}\x12\xb9\x01\n\rGetScanConfig\x12<.google.cloud.websecurityscanner.v1beta.GetScanConfigRequest\x1a\x32.google.cloud.websecurityscanner.v1beta.ScanConfig\"6\xda\x41\x04name\x82\xd3\xe4\x93\x02)\x12\'/v1beta/{name=projects/*/scanConfigs/*}\x12\xcc\x01\n\x0fListScanConfigs\x12>.google.cloud.websecurityscanner.v1beta.ListScanConfigsRequest\x1a?.google.cloud.websecurityscanner.v1beta.ListScanConfigsResponse\"8\xda\x41\x06parent\x82\xd3\xe4\x93\x02)\x12\'/v1beta/{parent=projects/*}/scanConfigs\x12\xeb\x01\n\x10UpdateScanConfig\x12?.google.cloud.websecurityscanner.v1beta.UpdateScanConfigRequest\x1a\x32.google.cloud.websecurityscanner.v1beta.ScanConfig\"b\xda\x41\x17scan_config,update_mask\x82\xd3\xe4\x93\x02\x42\x32\x33/v1beta/{scan_config.name=projects/*/scanConfigs/*}:\x0bscan_config\x12\xbd\x01\n\x0cStartScanRun\x12;.google.cloud.websecurityscanner.v1beta.StartScanRunRequest\x1a/.google.cloud.websecurityscanner.v1beta.ScanRun\"?\xda\x41\x04name\x82\xd3\xe4\x93\x02\x32\"-/v1beta/{name=projects/*/scanConfigs/*}:start:\x01*\x12\xbb\x01\n\nGetScanRun\x12\x39.google.cloud.websecurityscanner.v1beta.GetScanRunRequest\x1a/.google.cloud.websecurityscanner.v1beta.ScanRun\"A\xda\x41\x04name\x82\xd3\xe4\x93\x02\x34\x12\x32/v1beta/{name=projects/*/scanConfigs/*/scanRuns/*}\x12\xce\x01\n\x0cListScanRuns\x12;.google.cloud.websecurityscanner.v1beta.ListScanRunsRequest\x1a<.google.cloud.websecurityscanner.v1beta.ListScanRunsResponse\"C\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x34\x12\x32/v1beta/{parent=projects/*/scanConfigs/*}/scanRuns\x12\xc5\x01\n\x0bStopScanRun\x12:.google.cloud.websecurityscanner.v1beta.StopScanRunRequest\x1a/.google.cloud.websecurityscanner.v1beta.ScanRun\"I\xda\x41\x04name\x82\xd3\xe4\x93\x02<\"7/v1beta/{name=projects/*/scanConfigs/*/scanRuns/*}:stop:\x01*\x12\xe5\x01\n\x0fListCrawledUrls\x12>.google.cloud.websecurityscanner.v1beta.ListCrawledUrlsRequest\x1a?.google.cloud.websecurityscanner.v1beta.ListCrawledUrlsResponse\"Q\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x42\x12@/v1beta/{parent=projects/*/scanConfigs/*/scanRuns/*}/crawledUrls\x12\xc6\x01\n\nGetFinding\x12\x39.google.cloud.websecurityscanner.v1beta.GetFindingRequest\x1a/.google.cloud.websecurityscanner.v1beta.Finding\"L\xda\x41\x04name\x82\xd3\xe4\x93\x02?\x12=/v1beta/{name=projects/*/scanConfigs/*/scanRuns/*/findings/*}\x12\xe0\x01\n\x0cListFindings\x12;.google.cloud.websecurityscanner.v1beta.ListFindingsRequest\x1a<.google.cloud.websecurityscanner.v1beta.ListFindingsResponse\"U\xda\x41\rparent,filter\x82\xd3\xe4\x93\x02?\x12=/v1beta/{parent=projects/*/scanConfigs/*/scanRuns/*}/findings\x12\xf9\x01\n\x14ListFindingTypeStats\x12\x43.google.cloud.websecurityscanner.v1beta.ListFindingTypeStatsRequest\x1a\x44.google.cloud.websecurityscanner.v1beta.ListFindingTypeStatsResponse\"V\xda\x41\x06parent\x82\xd3\xe4\x93\x02G\x12\x45/v1beta/{parent=projects/*/scanConfigs/*/scanRuns/*}/findingTypeStats\x1aU\xca\x41!websecurityscanner.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\xa1\x02\n*com.google.cloud.websecurityscanner.v1betaB\x17WebSecurityScannerProtoP\x01ZZcloud.google.com/go/websecurityscanner/apiv1beta/websecurityscannerpb;websecurityscannerpb\xaa\x02&Google.Cloud.WebSecurityScanner.V1Beta\xca\x02&Google\\Cloud\\WebSecurityScanner\\V1beta\xea\x02)Google::Cloud::WebSecurityScanner::V1betab\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module WebSecurityScanner + module V1beta + CreateScanConfigRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.websecurityscanner.v1beta.CreateScanConfigRequest").msgclass + DeleteScanConfigRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.websecurityscanner.v1beta.DeleteScanConfigRequest").msgclass + GetScanConfigRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.websecurityscanner.v1beta.GetScanConfigRequest").msgclass + ListScanConfigsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.websecurityscanner.v1beta.ListScanConfigsRequest").msgclass + UpdateScanConfigRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.websecurityscanner.v1beta.UpdateScanConfigRequest").msgclass + ListScanConfigsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.websecurityscanner.v1beta.ListScanConfigsResponse").msgclass + StartScanRunRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.websecurityscanner.v1beta.StartScanRunRequest").msgclass + GetScanRunRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.websecurityscanner.v1beta.GetScanRunRequest").msgclass + ListScanRunsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.websecurityscanner.v1beta.ListScanRunsRequest").msgclass + ListScanRunsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.websecurityscanner.v1beta.ListScanRunsResponse").msgclass + StopScanRunRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.websecurityscanner.v1beta.StopScanRunRequest").msgclass + ListCrawledUrlsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.websecurityscanner.v1beta.ListCrawledUrlsRequest").msgclass + ListCrawledUrlsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.websecurityscanner.v1beta.ListCrawledUrlsResponse").msgclass + GetFindingRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.websecurityscanner.v1beta.GetFindingRequest").msgclass + ListFindingsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.websecurityscanner.v1beta.ListFindingsRequest").msgclass + ListFindingsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.websecurityscanner.v1beta.ListFindingsResponse").msgclass + ListFindingTypeStatsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.websecurityscanner.v1beta.ListFindingTypeStatsRequest").msgclass + ListFindingTypeStatsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.websecurityscanner.v1beta.ListFindingTypeStatsResponse").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-web_security_scanner-v1beta/lib/google/cloud/websecurityscanner/v1beta/web_security_scanner_services_pb.rb b/owl-bot-staging/google-cloud-web_security_scanner-v1beta/lib/google/cloud/websecurityscanner/v1beta/web_security_scanner_services_pb.rb new file mode 100644 index 000000000000..d1cdbdcd623f --- /dev/null +++ b/owl-bot-staging/google-cloud-web_security_scanner-v1beta/lib/google/cloud/websecurityscanner/v1beta/web_security_scanner_services_pb.rb @@ -0,0 +1,73 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/cloud/websecurityscanner/v1beta/web_security_scanner.proto for package 'Google.Cloud.WebSecurityScanner.V1beta' +# 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/websecurityscanner/v1beta/web_security_scanner_pb' + +module Google + module Cloud + module WebSecurityScanner + module V1beta + module WebSecurityScanner + # Cloud Web Security Scanner Service identifies security vulnerabilities in web + # applications hosted on Google Cloud Platform. It crawls your application, and + # attempts to exercise as many user inputs and event handlers as possible. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.cloud.websecurityscanner.v1beta.WebSecurityScanner' + + # Creates a new ScanConfig. + rpc :CreateScanConfig, ::Google::Cloud::WebSecurityScanner::V1beta::CreateScanConfigRequest, ::Google::Cloud::WebSecurityScanner::V1beta::ScanConfig + # Deletes an existing ScanConfig and its child resources. + rpc :DeleteScanConfig, ::Google::Cloud::WebSecurityScanner::V1beta::DeleteScanConfigRequest, ::Google::Protobuf::Empty + # Gets a ScanConfig. + rpc :GetScanConfig, ::Google::Cloud::WebSecurityScanner::V1beta::GetScanConfigRequest, ::Google::Cloud::WebSecurityScanner::V1beta::ScanConfig + # Lists ScanConfigs under a given project. + rpc :ListScanConfigs, ::Google::Cloud::WebSecurityScanner::V1beta::ListScanConfigsRequest, ::Google::Cloud::WebSecurityScanner::V1beta::ListScanConfigsResponse + # Updates a ScanConfig. This method support partial update of a ScanConfig. + rpc :UpdateScanConfig, ::Google::Cloud::WebSecurityScanner::V1beta::UpdateScanConfigRequest, ::Google::Cloud::WebSecurityScanner::V1beta::ScanConfig + # Start a ScanRun according to the given ScanConfig. + rpc :StartScanRun, ::Google::Cloud::WebSecurityScanner::V1beta::StartScanRunRequest, ::Google::Cloud::WebSecurityScanner::V1beta::ScanRun + # Gets a ScanRun. + rpc :GetScanRun, ::Google::Cloud::WebSecurityScanner::V1beta::GetScanRunRequest, ::Google::Cloud::WebSecurityScanner::V1beta::ScanRun + # Lists ScanRuns under a given ScanConfig, in descending order of ScanRun + # stop time. + rpc :ListScanRuns, ::Google::Cloud::WebSecurityScanner::V1beta::ListScanRunsRequest, ::Google::Cloud::WebSecurityScanner::V1beta::ListScanRunsResponse + # Stops a ScanRun. The stopped ScanRun is returned. + rpc :StopScanRun, ::Google::Cloud::WebSecurityScanner::V1beta::StopScanRunRequest, ::Google::Cloud::WebSecurityScanner::V1beta::ScanRun + # List CrawledUrls under a given ScanRun. + rpc :ListCrawledUrls, ::Google::Cloud::WebSecurityScanner::V1beta::ListCrawledUrlsRequest, ::Google::Cloud::WebSecurityScanner::V1beta::ListCrawledUrlsResponse + # Gets a Finding. + rpc :GetFinding, ::Google::Cloud::WebSecurityScanner::V1beta::GetFindingRequest, ::Google::Cloud::WebSecurityScanner::V1beta::Finding + # List Findings under a given ScanRun. + rpc :ListFindings, ::Google::Cloud::WebSecurityScanner::V1beta::ListFindingsRequest, ::Google::Cloud::WebSecurityScanner::V1beta::ListFindingsResponse + # List all FindingTypeStats under a given ScanRun. + rpc :ListFindingTypeStats, ::Google::Cloud::WebSecurityScanner::V1beta::ListFindingTypeStatsRequest, ::Google::Cloud::WebSecurityScanner::V1beta::ListFindingTypeStatsResponse + end + + Stub = Service.rpc_stub_class + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-web_security_scanner-v1beta/proto_docs/README.md b/owl-bot-staging/google-cloud-web_security_scanner-v1beta/proto_docs/README.md new file mode 100644 index 000000000000..c39a919c1cab --- /dev/null +++ b/owl-bot-staging/google-cloud-web_security_scanner-v1beta/proto_docs/README.md @@ -0,0 +1,4 @@ +# Web Security Scanner V1beta 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-web_security_scanner-v1beta/proto_docs/google/api/client.rb b/owl-bot-staging/google-cloud-web_security_scanner-v1beta/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..3ab0b096d445 --- /dev/null +++ b/owl-bot-staging/google-cloud-web_security_scanner-v1beta/proto_docs/google/api/client.rb @@ -0,0 +1,593 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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. + # + # Note: This field should not be used in most cases. + 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: + # library_settings: + # 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. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Php. Clobbers the php_namespace option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.php.package_name" field + # in gapic.yaml. API teams should use the protobuf php_namespace option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # library_settings: + # php_settings: + # library_package: Google\Cloud\PubSub\V1 + 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. + # + # Example: + # + # 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 + # @!attribute [rw] batching + # @return [::Google::Api::BatchingConfigProto] + # Batching configuration for an API method in client libraries. + # + # Example of a YAML configuration: + # + # publishing: + # method_settings: + # - selector: google.example.v1.ExampleService.BatchCreateExample + # batching: + # element_count_threshold: 1000 + # request_byte_threshold: 100000000 + # delay_threshold_millis: 10 + 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. + # + # Note: This feature should not be used in most cases. + # @!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 + + # `BatchingConfigProto` defines the batching configuration for an API method. + # @!attribute [rw] thresholds + # @return [::Google::Api::BatchingSettingsProto] + # The thresholds which trigger a batched request to be sent. + # @!attribute [rw] batch_descriptor + # @return [::Google::Api::BatchingDescriptorProto] + # The request and response fields used in batching. + class BatchingConfigProto + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `BatchingSettingsProto` specifies a set of batching thresholds, each of + # which acts as a trigger to send a batch of messages as a request. At least + # one threshold must be positive nonzero. + # @!attribute [rw] element_count_threshold + # @return [::Integer] + # The number of elements of a field collected into a batch which, if + # exceeded, causes the batch to be sent. + # @!attribute [rw] request_byte_threshold + # @return [::Integer] + # The aggregated size of the batched field which, if exceeded, causes the + # batch to be sent. This size is computed by aggregating the sizes of the + # request field to be batched, not of the entire request message. + # @!attribute [rw] delay_threshold + # @return [::Google::Protobuf::Duration] + # The duration after which a batch should be sent, starting from the addition + # of the first message to that batch. + # @!attribute [rw] element_count_limit + # @return [::Integer] + # The maximum number of elements collected in a batch that could be accepted + # by server. + # @!attribute [rw] request_byte_limit + # @return [::Integer] + # The maximum size of the request that could be accepted by server. + # @!attribute [rw] flow_control_element_limit + # @return [::Integer] + # The maximum number of elements allowed by flow control. + # @!attribute [rw] flow_control_byte_limit + # @return [::Integer] + # The maximum size of data allowed by flow control. + # @!attribute [rw] flow_control_limit_exceeded_behavior + # @return [::Google::Api::FlowControlLimitExceededBehaviorProto] + # The behavior to take when the flow control limit is exceeded. + class BatchingSettingsProto + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `BatchingDescriptorProto` specifies the fields of the request message to be + # used for batching, and, optionally, the fields of the response message to be + # used for demultiplexing. + # @!attribute [rw] batched_field + # @return [::String] + # The repeated field in the request message to be aggregated by batching. + # @!attribute [rw] discriminator_fields + # @return [::Array<::String>] + # A list of the fields in the request message. Two requests will be batched + # together only if the values of every field specified in + # `request_discriminator_fields` is equal between the two requests. + # @!attribute [rw] subresponse_field + # @return [::String] + # Optional. When present, indicates the field in the response message to be + # used to demultiplex the response into multiple response messages, in + # correspondence with the multiple request messages originally batched + # together. + class BatchingDescriptorProto + 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 + + # The behavior to take when the flow control limit is exceeded. + module FlowControlLimitExceededBehaviorProto + # Default behavior, system-defined. + UNSET_BEHAVIOR = 0 + + # Stop operation, raise error. + THROW_EXCEPTION = 1 + + # Pause operation until limit clears. + BLOCK = 2 + + # Continue operation, disregard limit. + IGNORE = 3 + end + end +end diff --git a/owl-bot-staging/google-cloud-web_security_scanner-v1beta/proto_docs/google/api/field_behavior.rb b/owl-bot-staging/google-cloud-web_security_scanner-v1beta/proto_docs/google/api/field_behavior.rb new file mode 100644 index 000000000000..582be187d115 --- /dev/null +++ b/owl-bot-staging/google-cloud-web_security_scanner-v1beta/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-web_security_scanner-v1beta/proto_docs/google/api/launch_stage.rb b/owl-bot-staging/google-cloud-web_security_scanner-v1beta/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..9392a413fb1b --- /dev/null +++ b/owl-bot-staging/google-cloud-web_security_scanner-v1beta/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-web_security_scanner-v1beta/proto_docs/google/api/resource.rb b/owl-bot-staging/google-cloud-web_security_scanner-v1beta/proto_docs/google/api/resource.rb new file mode 100644 index 000000000000..25dec4847ac1 --- /dev/null +++ b/owl-bot-staging/google-cloud-web_security_scanner-v1beta/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-web_security_scanner-v1beta/proto_docs/google/cloud/websecurityscanner/v1beta/crawled_url.rb b/owl-bot-staging/google-cloud-web_security_scanner-v1beta/proto_docs/google/cloud/websecurityscanner/v1beta/crawled_url.rb new file mode 100644 index 000000000000..16a4684b0a87 --- /dev/null +++ b/owl-bot-staging/google-cloud-web_security_scanner-v1beta/proto_docs/google/cloud/websecurityscanner/v1beta/crawled_url.rb @@ -0,0 +1,44 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 WebSecurityScanner + module V1beta + # A CrawledUrl resource represents a URL that was crawled during a ScanRun. Web + # Security Scanner Service crawls the web applications, following all links + # within the scope of sites, to find the URLs to test against. + # @!attribute [rw] http_method + # @return [::String] + # The http method of the request that was used to visit the URL, in + # uppercase. + # @!attribute [rw] url + # @return [::String] + # The URL that was crawled. + # @!attribute [rw] body + # @return [::String] + # The body of the request that was used to visit the URL. + class CrawledUrl + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-web_security_scanner-v1beta/proto_docs/google/cloud/websecurityscanner/v1beta/finding.rb b/owl-bot-staging/google-cloud-web_security_scanner-v1beta/proto_docs/google/cloud/websecurityscanner/v1beta/finding.rb new file mode 100644 index 000000000000..b6d583c7a7df --- /dev/null +++ b/owl-bot-staging/google-cloud-web_security_scanner-v1beta/proto_docs/google/cloud/websecurityscanner/v1beta/finding.rb @@ -0,0 +1,93 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 WebSecurityScanner + module V1beta + # A Finding resource represents a vulnerability instance identified during a + # ScanRun. + # @!attribute [rw] name + # @return [::String] + # The resource name of the Finding. The name follows the format of + # 'projects/\\{projectId}/scanConfigs/\\{scanConfigId}/scanruns/\\{scanRunId}/findings/\\{findingId}'. + # The finding IDs are generated by the system. + # @!attribute [rw] finding_type + # @return [::String] + # The type of the Finding. + # Detailed and up-to-date information on findings can be found here: + # https://cloud.google.com/security-scanner/docs/scan-result-details + # @!attribute [rw] http_method + # @return [::String] + # The http method of the request that triggered the vulnerability, in + # uppercase. + # @!attribute [rw] fuzzed_url + # @return [::String] + # The URL produced by the server-side fuzzer and used in the request that + # triggered the vulnerability. + # @!attribute [rw] body + # @return [::String] + # The body of the request that triggered the vulnerability. + # @!attribute [rw] description + # @return [::String] + # The description of the vulnerability. + # @!attribute [rw] reproduction_url + # @return [::String] + # The URL containing human-readable payload that user can leverage to + # reproduce the vulnerability. + # @!attribute [rw] frame_url + # @return [::String] + # If the vulnerability was originated from nested IFrame, the immediate + # parent IFrame is reported. + # @!attribute [rw] final_url + # @return [::String] + # The URL where the browser lands when the vulnerability is detected. + # @!attribute [rw] tracking_id + # @return [::String] + # The tracking ID uniquely identifies a vulnerability instance across + # multiple ScanRuns. + # @!attribute [rw] form + # @return [::Google::Cloud::WebSecurityScanner::V1beta::Form] + # An addon containing information reported for a vulnerability with an HTML + # form, if any. + # @!attribute [rw] outdated_library + # @return [::Google::Cloud::WebSecurityScanner::V1beta::OutdatedLibrary] + # An addon containing information about outdated libraries. + # @!attribute [rw] violating_resource + # @return [::Google::Cloud::WebSecurityScanner::V1beta::ViolatingResource] + # An addon containing detailed information regarding any resource causing the + # vulnerability such as JavaScript sources, image, audio files, etc. + # @!attribute [rw] vulnerable_headers + # @return [::Google::Cloud::WebSecurityScanner::V1beta::VulnerableHeaders] + # An addon containing information about vulnerable or missing HTTP headers. + # @!attribute [rw] vulnerable_parameters + # @return [::Google::Cloud::WebSecurityScanner::V1beta::VulnerableParameters] + # An addon containing information about request parameters which were found + # to be vulnerable. + # @!attribute [rw] xss + # @return [::Google::Cloud::WebSecurityScanner::V1beta::Xss] + # An addon containing information reported for an XSS, if any. + class Finding + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-web_security_scanner-v1beta/proto_docs/google/cloud/websecurityscanner/v1beta/finding_addon.rb b/owl-bot-staging/google-cloud-web_security_scanner-v1beta/proto_docs/google/cloud/websecurityscanner/v1beta/finding_addon.rb new file mode 100644 index 000000000000..950dc9db788a --- /dev/null +++ b/owl-bot-staging/google-cloud-web_security_scanner-v1beta/proto_docs/google/cloud/websecurityscanner/v1beta/finding_addon.rb @@ -0,0 +1,111 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 WebSecurityScanner + module V1beta + # ! Information about a vulnerability with an HTML. + # @!attribute [rw] action_uri + # @return [::String] + # ! The URI where to send the form when it's submitted. + # @!attribute [rw] fields + # @return [::Array<::String>] + # ! The names of form fields related to the vulnerability. + class Form + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Information reported for an outdated library. + # @!attribute [rw] library_name + # @return [::String] + # The name of the outdated library. + # @!attribute [rw] version + # @return [::String] + # The version number. + # @!attribute [rw] learn_more_urls + # @return [::Array<::String>] + # URLs to learn more information about the vulnerabilities in the library. + class OutdatedLibrary + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Information regarding any resource causing the vulnerability such + # as JavaScript sources, image, audio files, etc. + # @!attribute [rw] content_type + # @return [::String] + # The MIME type of this resource. + # @!attribute [rw] resource_url + # @return [::String] + # URL of this violating resource. + class ViolatingResource + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Information about vulnerable request parameters. + # @!attribute [rw] parameter_names + # @return [::Array<::String>] + # The vulnerable parameter names. + class VulnerableParameters + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Information about vulnerable or missing HTTP Headers. + # @!attribute [rw] headers + # @return [::Array<::Google::Cloud::WebSecurityScanner::V1beta::VulnerableHeaders::Header>] + # List of vulnerable headers. + # @!attribute [rw] missing_headers + # @return [::Array<::Google::Cloud::WebSecurityScanner::V1beta::VulnerableHeaders::Header>] + # List of missing headers. + class VulnerableHeaders + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes a HTTP Header. + # @!attribute [rw] name + # @return [::String] + # Header name. + # @!attribute [rw] value + # @return [::String] + # Header value. + class Header + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Information reported for an XSS. + # @!attribute [rw] stack_traces + # @return [::Array<::String>] + # Stack traces leading to the point where the XSS occurred. + # @!attribute [rw] error_message + # @return [::String] + # An error message generated by a javascript breakage. + class Xss + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-web_security_scanner-v1beta/proto_docs/google/cloud/websecurityscanner/v1beta/finding_type_stats.rb b/owl-bot-staging/google-cloud-web_security_scanner-v1beta/proto_docs/google/cloud/websecurityscanner/v1beta/finding_type_stats.rb new file mode 100644 index 000000000000..a04437f47106 --- /dev/null +++ b/owl-bot-staging/google-cloud-web_security_scanner-v1beta/proto_docs/google/cloud/websecurityscanner/v1beta/finding_type_stats.rb @@ -0,0 +1,39 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 WebSecurityScanner + module V1beta + # A FindingTypeStats resource represents stats regarding a specific FindingType + # of Findings under a given ScanRun. + # @!attribute [rw] finding_type + # @return [::String] + # The finding type associated with the stats. + # @!attribute [rw] finding_count + # @return [::Integer] + # The count of findings belonging to this finding type. + class FindingTypeStats + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-web_security_scanner-v1beta/proto_docs/google/cloud/websecurityscanner/v1beta/scan_config.rb b/owl-bot-staging/google-cloud-web_security_scanner-v1beta/proto_docs/google/cloud/websecurityscanner/v1beta/scan_config.rb new file mode 100644 index 000000000000..b814049f15c4 --- /dev/null +++ b/owl-bot-staging/google-cloud-web_security_scanner-v1beta/proto_docs/google/cloud/websecurityscanner/v1beta/scan_config.rb @@ -0,0 +1,192 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 WebSecurityScanner + module V1beta + # A ScanConfig resource contains the configurations to launch a scan. + # @!attribute [rw] name + # @return [::String] + # The resource name of the ScanConfig. The name follows the format of + # 'projects/\\{projectId}/scanConfigs/\\{scanConfigId}'. The ScanConfig IDs are + # generated by the system. + # @!attribute [rw] display_name + # @return [::String] + # Required. The user provided display name of the ScanConfig. + # @!attribute [rw] max_qps + # @return [::Integer] + # The maximum QPS during scanning. A valid value ranges from 5 to 20 + # inclusively. If the field is unspecified or its value is set 0, server will + # default to 15. Other values outside of [5, 20] range will be rejected with + # INVALID_ARGUMENT error. + # @!attribute [rw] starting_urls + # @return [::Array<::String>] + # Required. The starting URLs from which the scanner finds site pages. + # @!attribute [rw] authentication + # @return [::Google::Cloud::WebSecurityScanner::V1beta::ScanConfig::Authentication] + # The authentication configuration. If specified, service will use the + # authentication configuration during scanning. + # @!attribute [rw] user_agent + # @return [::Google::Cloud::WebSecurityScanner::V1beta::ScanConfig::UserAgent] + # The user agent used during scanning. + # @!attribute [rw] blacklist_patterns + # @return [::Array<::String>] + # The blacklist URL patterns as described in + # https://cloud.google.com/security-scanner/docs/excluded-urls + # @!attribute [rw] schedule + # @return [::Google::Cloud::WebSecurityScanner::V1beta::ScanConfig::Schedule] + # The schedule of the ScanConfig. + # @!attribute [rw] target_platforms + # @return [::Array<::Google::Cloud::WebSecurityScanner::V1beta::ScanConfig::TargetPlatform>] + # Set of Cloud Platforms targeted by the scan. If empty, APP_ENGINE will be + # used as a default. + # @!attribute [rw] export_to_security_command_center + # @return [::Google::Cloud::WebSecurityScanner::V1beta::ScanConfig::ExportToSecurityCommandCenter] + # Controls export of scan configurations and results to Cloud Security + # Command Center. + # @!attribute [rw] latest_run + # @return [::Google::Cloud::WebSecurityScanner::V1beta::ScanRun] + # Latest ScanRun if available. + # @!attribute [rw] risk_level + # @return [::Google::Cloud::WebSecurityScanner::V1beta::ScanConfig::RiskLevel] + # The risk level selected for the scan + class ScanConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Scan authentication configuration. + # @!attribute [rw] google_account + # @return [::Google::Cloud::WebSecurityScanner::V1beta::ScanConfig::Authentication::GoogleAccount] + # Authentication using a Google account. + # + # Note: The following fields are mutually exclusive: `google_account`, `custom_account`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] custom_account + # @return [::Google::Cloud::WebSecurityScanner::V1beta::ScanConfig::Authentication::CustomAccount] + # Authentication using a custom account. + # + # Note: The following fields are mutually exclusive: `custom_account`, `google_account`. If a field in that set is populated, all other fields in the set will automatically be cleared. + class Authentication + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes authentication configuration that uses a Google account. + # @!attribute [rw] username + # @return [::String] + # Required. The user name of the Google account. + # @!attribute [rw] password + # @return [::String] + # Required. Input only. The password of the Google account. The credential is stored encrypted + # and not returned in any response nor included in audit logs. + class GoogleAccount + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes authentication configuration that uses a custom account. + # @!attribute [rw] username + # @return [::String] + # Required. The user name of the custom account. + # @!attribute [rw] password + # @return [::String] + # Required. Input only. The password of the custom account. The credential is stored encrypted + # and not returned in any response nor included in audit logs. + # @!attribute [rw] login_url + # @return [::String] + # Required. The login form URL of the website. + class CustomAccount + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Scan schedule configuration. + # @!attribute [rw] schedule_time + # @return [::Google::Protobuf::Timestamp] + # A timestamp indicates when the next run will be scheduled. The value is + # refreshed by the server after each run. If unspecified, it will default + # to current server time, which means the scan will be scheduled to start + # immediately. + # @!attribute [rw] interval_duration_days + # @return [::Integer] + # Required. The duration of time between executions in days. + class Schedule + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Type of user agents used for scanning. + module UserAgent + # The user agent is unknown. Service will default to CHROME_LINUX. + USER_AGENT_UNSPECIFIED = 0 + + # Chrome on Linux. This is the service default if unspecified. + CHROME_LINUX = 1 + + # Chrome on Android. + CHROME_ANDROID = 2 + + # Safari on IPhone. + SAFARI_IPHONE = 3 + end + + # Cloud platforms supported by Cloud Web Security Scanner. + module TargetPlatform + # The target platform is unknown. Requests with this enum value will be + # rejected with INVALID_ARGUMENT error. + TARGET_PLATFORM_UNSPECIFIED = 0 + + # Google App Engine service. + APP_ENGINE = 1 + + # Google Compute Engine service. + COMPUTE = 2 + end + + # Scan risk levels supported by Cloud Web Security Scanner. LOW impact + # scanning will minimize requests with the potential to modify data. To + # achieve the maximum scan coverage, NORMAL risk level is recommended. + module RiskLevel + # Use default, which is NORMAL. + RISK_LEVEL_UNSPECIFIED = 0 + + # Normal scanning (Recommended) + NORMAL = 1 + + # Lower impact scanning + LOW = 2 + end + + # Controls export of scan configurations and results to Cloud Security + # Command Center. + module ExportToSecurityCommandCenter + # Use default, which is ENABLED. + EXPORT_TO_SECURITY_COMMAND_CENTER_UNSPECIFIED = 0 + + # Export results of this scan to Cloud Security Command Center. + ENABLED = 1 + + # Do not export results of this scan to Cloud Security Command Center. + DISABLED = 2 + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-web_security_scanner-v1beta/proto_docs/google/cloud/websecurityscanner/v1beta/scan_config_error.rb b/owl-bot-staging/google-cloud-web_security_scanner-v1beta/proto_docs/google/cloud/websecurityscanner/v1beta/scan_config_error.rb new file mode 100644 index 000000000000..35cbd2e7b0f4 --- /dev/null +++ b/owl-bot-staging/google-cloud-web_security_scanner-v1beta/proto_docs/google/cloud/websecurityscanner/v1beta/scan_config_error.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 Cloud + module WebSecurityScanner + module V1beta + # Defines a custom error message used by CreateScanConfig and UpdateScanConfig + # APIs when scan configuration validation fails. It is also reported as part of + # a ScanRunErrorTrace message if scan validation fails due to a scan + # configuration error. + # @!attribute [rw] code + # @return [::Google::Cloud::WebSecurityScanner::V1beta::ScanConfigError::Code] + # Indicates the reason code for a configuration failure. + # @!attribute [rw] field_name + # @return [::String] + # Indicates the full name of the ScanConfig field that triggers this error, + # for example "scan_config.max_qps". This field is provided for + # troubleshooting purposes only and its actual value can change in the + # future. + class ScanConfigError + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Output only. + # Defines an error reason code. + # Next id: 44 + module Code + # There is no error. + CODE_UNSPECIFIED = 0 + + # There is no error. + OK = 0 + + # Indicates an internal server error. + # Please DO NOT USE THIS ERROR CODE unless the root cause is truly unknown. + INTERNAL_ERROR = 1 + + # One of the seed URLs is an App Engine URL but we cannot validate the scan + # settings due to an App Engine API backend error. + APPENGINE_API_BACKEND_ERROR = 2 + + # One of the seed URLs is an App Engine URL but we cannot access the + # App Engine API to validate scan settings. + APPENGINE_API_NOT_ACCESSIBLE = 3 + + # One of the seed URLs is an App Engine URL but the Default Host of the + # App Engine is not set. + APPENGINE_DEFAULT_HOST_MISSING = 4 + + # Google corporate accounts can not be used for scanning. + CANNOT_USE_GOOGLE_COM_ACCOUNT = 6 + + # The account of the scan creator can not be used for scanning. + CANNOT_USE_OWNER_ACCOUNT = 7 + + # This scan targets Compute Engine, but we cannot validate scan settings + # due to a Compute Engine API backend error. + COMPUTE_API_BACKEND_ERROR = 8 + + # This scan targets Compute Engine, but we cannot access the Compute Engine + # API to validate the scan settings. + COMPUTE_API_NOT_ACCESSIBLE = 9 + + # The Custom Login URL does not belong to the current project. + CUSTOM_LOGIN_URL_DOES_NOT_BELONG_TO_CURRENT_PROJECT = 10 + + # The Custom Login URL is malformed (can not be parsed). + CUSTOM_LOGIN_URL_MALFORMED = 11 + + # The Custom Login URL is mapped to a non-routable IP address in DNS. + CUSTOM_LOGIN_URL_MAPPED_TO_NON_ROUTABLE_ADDRESS = 12 + + # The Custom Login URL is mapped to an IP address which is not reserved for + # the current project. + CUSTOM_LOGIN_URL_MAPPED_TO_UNRESERVED_ADDRESS = 13 + + # The Custom Login URL has a non-routable IP address. + CUSTOM_LOGIN_URL_HAS_NON_ROUTABLE_IP_ADDRESS = 14 + + # The Custom Login URL has an IP address which is not reserved for the + # current project. + CUSTOM_LOGIN_URL_HAS_UNRESERVED_IP_ADDRESS = 15 + + # Another scan with the same name (case-sensitive) already exists. + DUPLICATE_SCAN_NAME = 16 + + # A field is set to an invalid value. + INVALID_FIELD_VALUE = 18 + + # There was an error trying to authenticate to the scan target. + FAILED_TO_AUTHENTICATE_TO_TARGET = 19 + + # Finding type value is not specified in the list findings request. + FINDING_TYPE_UNSPECIFIED = 20 + + # Scan targets Compute Engine, yet current project was not whitelisted for + # Google Compute Engine Scanning Alpha access. + FORBIDDEN_TO_SCAN_COMPUTE = 21 + + # User tries to update managed scan + FORBIDDEN_UPDATE_TO_MANAGED_SCAN = 43 + + # The supplied filter is malformed. For example, it can not be parsed, does + # not have a filter type in expression, or the same filter type appears + # more than once. + MALFORMED_FILTER = 22 + + # The supplied resource name is malformed (can not be parsed). + MALFORMED_RESOURCE_NAME = 23 + + # The current project is not in an active state. + PROJECT_INACTIVE = 24 + + # A required field is not set. + REQUIRED_FIELD = 25 + + # Project id, scanconfig id, scanrun id, or finding id are not consistent + # with each other in resource name. + RESOURCE_NAME_INCONSISTENT = 26 + + # The scan being requested to start is already running. + SCAN_ALREADY_RUNNING = 27 + + # The scan that was requested to be stopped is not running. + SCAN_NOT_RUNNING = 28 + + # One of the seed URLs does not belong to the current project. + SEED_URL_DOES_NOT_BELONG_TO_CURRENT_PROJECT = 29 + + # One of the seed URLs is malformed (can not be parsed). + SEED_URL_MALFORMED = 30 + + # One of the seed URLs is mapped to a non-routable IP address in DNS. + SEED_URL_MAPPED_TO_NON_ROUTABLE_ADDRESS = 31 + + # One of the seed URLs is mapped to an IP address which is not reserved + # for the current project. + SEED_URL_MAPPED_TO_UNRESERVED_ADDRESS = 32 + + # One of the seed URLs has on-routable IP address. + SEED_URL_HAS_NON_ROUTABLE_IP_ADDRESS = 33 + + # One of the seed URLs has an IP address that is not reserved + # for the current project. + SEED_URL_HAS_UNRESERVED_IP_ADDRESS = 35 + + # The Cloud Security Scanner service account is not configured under the + # project. + SERVICE_ACCOUNT_NOT_CONFIGURED = 36 + + # A project has reached the maximum number of scans. + TOO_MANY_SCANS = 37 + + # Resolving the details of the current project fails. + UNABLE_TO_RESOLVE_PROJECT_INFO = 38 + + # One or more blacklist patterns were in the wrong format. + UNSUPPORTED_BLACKLIST_PATTERN_FORMAT = 39 + + # The supplied filter is not supported. + UNSUPPORTED_FILTER = 40 + + # The supplied finding type is not supported. For example, we do not + # provide findings of the given finding type. + UNSUPPORTED_FINDING_TYPE = 41 + + # The URL scheme of one or more of the supplied URLs is not supported. + UNSUPPORTED_URL_SCHEME = 42 + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-web_security_scanner-v1beta/proto_docs/google/cloud/websecurityscanner/v1beta/scan_run.rb b/owl-bot-staging/google-cloud-web_security_scanner-v1beta/proto_docs/google/cloud/websecurityscanner/v1beta/scan_run.rb new file mode 100644 index 000000000000..2ee0a0f3dc7b --- /dev/null +++ b/owl-bot-staging/google-cloud-web_security_scanner-v1beta/proto_docs/google/cloud/websecurityscanner/v1beta/scan_run.rb @@ -0,0 +1,110 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 WebSecurityScanner + module V1beta + # A ScanRun is a output-only resource representing an actual run of the scan. + # Next id: 12 + # @!attribute [rw] name + # @return [::String] + # The resource name of the ScanRun. The name follows the format of + # 'projects/\\{projectId}/scanConfigs/\\{scanConfigId}/scanRuns/\\{scanRunId}'. + # The ScanRun IDs are generated by the system. + # @!attribute [rw] execution_state + # @return [::Google::Cloud::WebSecurityScanner::V1beta::ScanRun::ExecutionState] + # The execution state of the ScanRun. + # @!attribute [rw] result_state + # @return [::Google::Cloud::WebSecurityScanner::V1beta::ScanRun::ResultState] + # The result state of the ScanRun. This field is only available after the + # execution state reaches "FINISHED". + # @!attribute [rw] start_time + # @return [::Google::Protobuf::Timestamp] + # The time at which the ScanRun started. + # @!attribute [rw] end_time + # @return [::Google::Protobuf::Timestamp] + # The time at which the ScanRun reached termination state - that the ScanRun + # is either finished or stopped by user. + # @!attribute [rw] urls_crawled_count + # @return [::Integer] + # The number of URLs crawled during this ScanRun. If the scan is in progress, + # the value represents the number of URLs crawled up to now. + # @!attribute [rw] urls_tested_count + # @return [::Integer] + # The number of URLs tested during this ScanRun. If the scan is in progress, + # the value represents the number of URLs tested up to now. The number of + # URLs tested is usually larger than the number URLS crawled because + # typically a crawled URL is tested with multiple test payloads. + # @!attribute [rw] has_vulnerabilities + # @return [::Boolean] + # Whether the scan run has found any vulnerabilities. + # @!attribute [rw] progress_percent + # @return [::Integer] + # The percentage of total completion ranging from 0 to 100. + # If the scan is in queue, the value is 0. + # If the scan is running, the value ranges from 0 to 100. + # If the scan is finished, the value is 100. + # @!attribute [rw] error_trace + # @return [::Google::Cloud::WebSecurityScanner::V1beta::ScanRunErrorTrace] + # If result_state is an ERROR, this field provides the primary reason for + # scan's termination and more details, if such are available. + # @!attribute [rw] warning_traces + # @return [::Array<::Google::Cloud::WebSecurityScanner::V1beta::ScanRunWarningTrace>] + # A list of warnings, if such are encountered during this scan run. + class ScanRun + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Types of ScanRun execution state. + module ExecutionState + # Represents an invalid state caused by internal server error. This value + # should never be returned. + EXECUTION_STATE_UNSPECIFIED = 0 + + # The scan is waiting in the queue. + QUEUED = 1 + + # The scan is in progress. + SCANNING = 2 + + # The scan is either finished or stopped by user. + FINISHED = 3 + end + + # Types of ScanRun result state. + module ResultState + # Default value. This value is returned when the ScanRun is not yet + # finished. + RESULT_STATE_UNSPECIFIED = 0 + + # The scan finished without errors. + SUCCESS = 1 + + # The scan finished with errors. + ERROR = 2 + + # The scan was terminated by user. + KILLED = 3 + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-web_security_scanner-v1beta/proto_docs/google/cloud/websecurityscanner/v1beta/scan_run_error_trace.rb b/owl-bot-staging/google-cloud-web_security_scanner-v1beta/proto_docs/google/cloud/websecurityscanner/v1beta/scan_run_error_trace.rb new file mode 100644 index 000000000000..9a4290f473e2 --- /dev/null +++ b/owl-bot-staging/google-cloud-web_security_scanner-v1beta/proto_docs/google/cloud/websecurityscanner/v1beta/scan_run_error_trace.rb @@ -0,0 +1,77 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 WebSecurityScanner + module V1beta + # Output only. + # Defines an error trace message for a ScanRun. + # @!attribute [rw] code + # @return [::Google::Cloud::WebSecurityScanner::V1beta::ScanRunErrorTrace::Code] + # Indicates the error reason code. + # @!attribute [rw] scan_config_error + # @return [::Google::Cloud::WebSecurityScanner::V1beta::ScanConfigError] + # If the scan encounters SCAN_CONFIG_ISSUE error, this field has the error + # message encountered during scan configuration validation that is performed + # before each scan run. + # @!attribute [rw] most_common_http_error_code + # @return [::Integer] + # If the scan encounters TOO_MANY_HTTP_ERRORS, this field indicates the most + # common HTTP error code, if such is available. For example, if this code is + # 404, the scan has encountered too many NOT_FOUND responses. + class ScanRunErrorTrace + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Output only. + # Defines an error reason code. + # Next id: 7 + module Code + # Default value is never used. + CODE_UNSPECIFIED = 0 + + # Indicates that the scan run failed due to an internal server error. + INTERNAL_ERROR = 1 + + # Indicates a scan configuration error, usually due to outdated ScanConfig + # settings, such as starting_urls or the DNS configuration. + SCAN_CONFIG_ISSUE = 2 + + # Indicates an authentication error, usually due to outdated ScanConfig + # authentication settings. + AUTHENTICATION_CONFIG_ISSUE = 3 + + # Indicates a scan operation timeout, usually caused by a very large site. + TIMED_OUT_WHILE_SCANNING = 4 + + # Indicates that a scan encountered excessive redirects, either to + # authentication or some other page outside of the scan scope. + TOO_MANY_REDIRECTS = 5 + + # Indicates that a scan encountered numerous errors from the web site + # pages. When available, most_common_http_error_code field indicates the + # most common HTTP error code encountered during the scan. + TOO_MANY_HTTP_ERRORS = 6 + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-web_security_scanner-v1beta/proto_docs/google/cloud/websecurityscanner/v1beta/scan_run_warning_trace.rb b/owl-bot-staging/google-cloud-web_security_scanner-v1beta/proto_docs/google/cloud/websecurityscanner/v1beta/scan_run_warning_trace.rb new file mode 100644 index 000000000000..14ef8134f765 --- /dev/null +++ b/owl-bot-staging/google-cloud-web_security_scanner-v1beta/proto_docs/google/cloud/websecurityscanner/v1beta/scan_run_warning_trace.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! + + +module Google + module Cloud + module WebSecurityScanner + module V1beta + # Output only. + # Defines a warning trace message for ScanRun. Warning traces provide customers + # with useful information that helps make the scanning process more effective. + # @!attribute [rw] code + # @return [::Google::Cloud::WebSecurityScanner::V1beta::ScanRunWarningTrace::Code] + # Indicates the warning code. + class ScanRunWarningTrace + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Output only. + # Defines a warning message code. + # Next id: 6 + module Code + # Default value is never used. + CODE_UNSPECIFIED = 0 + + # Indicates that a scan discovered an unexpectedly low number of URLs. This + # is sometimes caused by complex navigation features or by using a single + # URL for numerous pages. + INSUFFICIENT_CRAWL_RESULTS = 1 + + # Indicates that a scan discovered too many URLs to test, or excessive + # redundant URLs. + TOO_MANY_CRAWL_RESULTS = 2 + + # Indicates that too many tests have been generated for the scan. Customer + # should try reducing the number of starting URLs, increasing the QPS rate, + # or narrowing down the scope of the scan using the excluded patterns. + TOO_MANY_FUZZ_TASKS = 3 + + # Indicates that a scan is blocked by IAP. + BLOCKED_BY_IAP = 4 + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-web_security_scanner-v1beta/proto_docs/google/cloud/websecurityscanner/v1beta/web_security_scanner.rb b/owl-bot-staging/google-cloud-web_security_scanner-v1beta/proto_docs/google/cloud/websecurityscanner/v1beta/web_security_scanner.rb new file mode 100644 index 000000000000..5c0a8825ce30 --- /dev/null +++ b/owl-bot-staging/google-cloud-web_security_scanner-v1beta/proto_docs/google/cloud/websecurityscanner/v1beta/web_security_scanner.rb @@ -0,0 +1,278 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 WebSecurityScanner + module V1beta + # Request for the `CreateScanConfig` method. + # @!attribute [rw] parent + # @return [::String] + # Required. The parent resource name where the scan is created, which should be a + # project resource name in the format 'projects/\\{projectId}'. + # @!attribute [rw] scan_config + # @return [::Google::Cloud::WebSecurityScanner::V1beta::ScanConfig] + # Required. The ScanConfig to be created. + class CreateScanConfigRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request for the `DeleteScanConfig` method. + # @!attribute [rw] name + # @return [::String] + # Required. The resource name of the ScanConfig to be deleted. The name follows the + # format of 'projects/\\{projectId}/scanConfigs/\\{scanConfigId}'. + class DeleteScanConfigRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request for the `GetScanConfig` method. + # @!attribute [rw] name + # @return [::String] + # Required. The resource name of the ScanConfig to be returned. The name follows the + # format of 'projects/\\{projectId}/scanConfigs/\\{scanConfigId}'. + class GetScanConfigRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request for the `ListScanConfigs` method. + # @!attribute [rw] parent + # @return [::String] + # Required. The parent resource name, which should be a project resource name in the + # format 'projects/\\{projectId}'. + # @!attribute [rw] page_token + # @return [::String] + # A token identifying a page of results to be returned. This should be a + # `next_page_token` value returned from a previous List request. + # If unspecified, the first page of results is returned. + # @!attribute [rw] page_size + # @return [::Integer] + # The maximum number of ScanConfigs to return, can be limited by server. + # If not specified or not positive, the implementation will select a + # reasonable value. + class ListScanConfigsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request for the `UpdateScanConfigRequest` method. + # @!attribute [rw] scan_config + # @return [::Google::Cloud::WebSecurityScanner::V1beta::ScanConfig] + # Required. The ScanConfig to be updated. The name field must be set to identify the + # resource to be updated. The values of fields not covered by the mask + # will be ignored. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # Required. The update mask applies to the resource. For the `FieldMask` definition, + # see + # https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask + class UpdateScanConfigRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response for the `ListScanConfigs` method. + # @!attribute [rw] scan_configs + # @return [::Array<::Google::Cloud::WebSecurityScanner::V1beta::ScanConfig>] + # The list of ScanConfigs returned. + # @!attribute [rw] next_page_token + # @return [::String] + # Token to retrieve the next page of results, or empty if there are no + # more results in the list. + class ListScanConfigsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request for the `StartScanRun` method. + # @!attribute [rw] name + # @return [::String] + # Required. The resource name of the ScanConfig to be used. The name follows the + # format of 'projects/\\{projectId}/scanConfigs/\\{scanConfigId}'. + class StartScanRunRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request for the `GetScanRun` method. + # @!attribute [rw] name + # @return [::String] + # Required. The resource name of the ScanRun to be returned. The name follows the + # format of + # 'projects/\\{projectId}/scanConfigs/\\{scanConfigId}/scanRuns/\\{scanRunId}'. + class GetScanRunRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request for the `ListScanRuns` method. + # @!attribute [rw] parent + # @return [::String] + # Required. The parent resource name, which should be a scan resource name in the + # format 'projects/\\{projectId}/scanConfigs/\\{scanConfigId}'. + # @!attribute [rw] page_token + # @return [::String] + # A token identifying a page of results to be returned. This should be a + # `next_page_token` value returned from a previous List request. + # If unspecified, the first page of results is returned. + # @!attribute [rw] page_size + # @return [::Integer] + # The maximum number of ScanRuns to return, can be limited by server. + # If not specified or not positive, the implementation will select a + # reasonable value. + class ListScanRunsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response for the `ListScanRuns` method. + # @!attribute [rw] scan_runs + # @return [::Array<::Google::Cloud::WebSecurityScanner::V1beta::ScanRun>] + # The list of ScanRuns returned. + # @!attribute [rw] next_page_token + # @return [::String] + # Token to retrieve the next page of results, or empty if there are no + # more results in the list. + class ListScanRunsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request for the `StopScanRun` method. + # @!attribute [rw] name + # @return [::String] + # Required. The resource name of the ScanRun to be stopped. The name follows the + # format of + # 'projects/\\{projectId}/scanConfigs/\\{scanConfigId}/scanRuns/\\{scanRunId}'. + class StopScanRunRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request for the `ListCrawledUrls` method. + # @!attribute [rw] parent + # @return [::String] + # Required. The parent resource name, which should be a scan run resource name in the + # format + # 'projects/\\{projectId}/scanConfigs/\\{scanConfigId}/scanRuns/\\{scanRunId}'. + # @!attribute [rw] page_token + # @return [::String] + # A token identifying a page of results to be returned. This should be a + # `next_page_token` value returned from a previous List request. + # If unspecified, the first page of results is returned. + # @!attribute [rw] page_size + # @return [::Integer] + # The maximum number of CrawledUrls to return, can be limited by server. + # If not specified or not positive, the implementation will select a + # reasonable value. + class ListCrawledUrlsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response for the `ListCrawledUrls` method. + # @!attribute [rw] crawled_urls + # @return [::Array<::Google::Cloud::WebSecurityScanner::V1beta::CrawledUrl>] + # The list of CrawledUrls returned. + # @!attribute [rw] next_page_token + # @return [::String] + # Token to retrieve the next page of results, or empty if there are no + # more results in the list. + class ListCrawledUrlsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request for the `GetFinding` method. + # @!attribute [rw] name + # @return [::String] + # Required. The resource name of the Finding to be returned. The name follows the + # format of + # 'projects/\\{projectId}/scanConfigs/\\{scanConfigId}/scanRuns/\\{scanRunId}/findings/\\{findingId}'. + class GetFindingRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request for the `ListFindings` method. + # @!attribute [rw] parent + # @return [::String] + # Required. The parent resource name, which should be a scan run resource name in the + # format + # 'projects/\\{projectId}/scanConfigs/\\{scanConfigId}/scanRuns/\\{scanRunId}'. + # @!attribute [rw] filter + # @return [::String] + # Required. The filter expression. The expression must be in the format: + # . + # Supported field: 'finding_type'. + # Supported operator: '='. + # @!attribute [rw] page_token + # @return [::String] + # A token identifying a page of results to be returned. This should be a + # `next_page_token` value returned from a previous List request. + # If unspecified, the first page of results is returned. + # @!attribute [rw] page_size + # @return [::Integer] + # The maximum number of Findings to return, can be limited by server. + # If not specified or not positive, the implementation will select a + # reasonable value. + class ListFindingsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response for the `ListFindings` method. + # @!attribute [rw] findings + # @return [::Array<::Google::Cloud::WebSecurityScanner::V1beta::Finding>] + # The list of Findings returned. + # @!attribute [rw] next_page_token + # @return [::String] + # Token to retrieve the next page of results, or empty if there are no + # more results in the list. + class ListFindingsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request for the `ListFindingTypeStats` method. + # @!attribute [rw] parent + # @return [::String] + # Required. The parent resource name, which should be a scan run resource name in the + # format + # 'projects/\\{projectId}/scanConfigs/\\{scanConfigId}/scanRuns/\\{scanRunId}'. + class ListFindingTypeStatsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response for the `ListFindingTypeStats` method. + # @!attribute [rw] finding_type_stats + # @return [::Array<::Google::Cloud::WebSecurityScanner::V1beta::FindingTypeStats>] + # The list of FindingTypeStats returned. + class ListFindingTypeStatsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-web_security_scanner-v1beta/proto_docs/google/protobuf/duration.rb b/owl-bot-staging/google-cloud-web_security_scanner-v1beta/proto_docs/google/protobuf/duration.rb new file mode 100644 index 000000000000..ea59f1f91daf --- /dev/null +++ b/owl-bot-staging/google-cloud-web_security_scanner-v1beta/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-web_security_scanner-v1beta/proto_docs/google/protobuf/empty.rb b/owl-bot-staging/google-cloud-web_security_scanner-v1beta/proto_docs/google/protobuf/empty.rb new file mode 100644 index 000000000000..83e4481834a6 --- /dev/null +++ b/owl-bot-staging/google-cloud-web_security_scanner-v1beta/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-web_security_scanner-v1beta/proto_docs/google/protobuf/field_mask.rb b/owl-bot-staging/google-cloud-web_security_scanner-v1beta/proto_docs/google/protobuf/field_mask.rb new file mode 100644 index 000000000000..7f3ffc78601a --- /dev/null +++ b/owl-bot-staging/google-cloud-web_security_scanner-v1beta/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-web_security_scanner-v1beta/proto_docs/google/protobuf/timestamp.rb b/owl-bot-staging/google-cloud-web_security_scanner-v1beta/proto_docs/google/protobuf/timestamp.rb new file mode 100644 index 000000000000..74352be9c58c --- /dev/null +++ b/owl-bot-staging/google-cloud-web_security_scanner-v1beta/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-web_security_scanner-v1beta/snippets/Gemfile b/owl-bot-staging/google-cloud-web_security_scanner-v1beta/snippets/Gemfile new file mode 100644 index 000000000000..2cf622627fe6 --- /dev/null +++ b/owl-bot-staging/google-cloud-web_security_scanner-v1beta/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-web_security_scanner-v1beta", path: "../" +else + gem "google-cloud-web_security_scanner-v1beta" +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-web_security_scanner-v1beta/snippets/snippet_metadata_google.cloud.websecurityscanner.v1beta.json b/owl-bot-staging/google-cloud-web_security_scanner-v1beta/snippets/snippet_metadata_google.cloud.websecurityscanner.v1beta.json new file mode 100644 index 000000000000..3f5379593bc8 --- /dev/null +++ b/owl-bot-staging/google-cloud-web_security_scanner-v1beta/snippets/snippet_metadata_google.cloud.websecurityscanner.v1beta.json @@ -0,0 +1,535 @@ +{ + "client_library": { + "name": "google-cloud-web_security_scanner-v1beta", + "version": "", + "language": "RUBY", + "apis": [ + { + "id": "google.cloud.websecurityscanner.v1beta", + "version": "v1beta" + } + ] + }, + "snippets": [ + { + "region_tag": "websecurityscanner_v1beta_generated_WebSecurityScanner_CreateScanConfig_sync", + "title": "Snippet for the create_scan_config call in the WebSecurityScanner service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Client#create_scan_config.", + "file": "web_security_scanner/create_scan_config.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_scan_config", + "full_name": "::Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Client#create_scan_config", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::WebSecurityScanner::V1beta::CreateScanConfigRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::WebSecurityScanner::V1beta::ScanConfig", + "client": { + "short_name": "WebSecurityScanner::Client", + "full_name": "::Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Client" + }, + "method": { + "short_name": "CreateScanConfig", + "full_name": "google.cloud.websecurityscanner.v1beta.WebSecurityScanner.CreateScanConfig", + "service": { + "short_name": "WebSecurityScanner", + "full_name": "google.cloud.websecurityscanner.v1beta.WebSecurityScanner" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "websecurityscanner_v1beta_generated_WebSecurityScanner_DeleteScanConfig_sync", + "title": "Snippet for the delete_scan_config call in the WebSecurityScanner service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Client#delete_scan_config.", + "file": "web_security_scanner/delete_scan_config.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_scan_config", + "full_name": "::Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Client#delete_scan_config", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::WebSecurityScanner::V1beta::DeleteScanConfigRequest", + "name": "request" + } + ], + "result_type": "::Google::Protobuf::Empty", + "client": { + "short_name": "WebSecurityScanner::Client", + "full_name": "::Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Client" + }, + "method": { + "short_name": "DeleteScanConfig", + "full_name": "google.cloud.websecurityscanner.v1beta.WebSecurityScanner.DeleteScanConfig", + "service": { + "short_name": "WebSecurityScanner", + "full_name": "google.cloud.websecurityscanner.v1beta.WebSecurityScanner" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "websecurityscanner_v1beta_generated_WebSecurityScanner_GetScanConfig_sync", + "title": "Snippet for the get_scan_config call in the WebSecurityScanner service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Client#get_scan_config.", + "file": "web_security_scanner/get_scan_config.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_scan_config", + "full_name": "::Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Client#get_scan_config", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::WebSecurityScanner::V1beta::GetScanConfigRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::WebSecurityScanner::V1beta::ScanConfig", + "client": { + "short_name": "WebSecurityScanner::Client", + "full_name": "::Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Client" + }, + "method": { + "short_name": "GetScanConfig", + "full_name": "google.cloud.websecurityscanner.v1beta.WebSecurityScanner.GetScanConfig", + "service": { + "short_name": "WebSecurityScanner", + "full_name": "google.cloud.websecurityscanner.v1beta.WebSecurityScanner" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "websecurityscanner_v1beta_generated_WebSecurityScanner_ListScanConfigs_sync", + "title": "Snippet for the list_scan_configs call in the WebSecurityScanner service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Client#list_scan_configs.", + "file": "web_security_scanner/list_scan_configs.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_scan_configs", + "full_name": "::Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Client#list_scan_configs", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::WebSecurityScanner::V1beta::ListScanConfigsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::WebSecurityScanner::V1beta::ListScanConfigsResponse", + "client": { + "short_name": "WebSecurityScanner::Client", + "full_name": "::Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Client" + }, + "method": { + "short_name": "ListScanConfigs", + "full_name": "google.cloud.websecurityscanner.v1beta.WebSecurityScanner.ListScanConfigs", + "service": { + "short_name": "WebSecurityScanner", + "full_name": "google.cloud.websecurityscanner.v1beta.WebSecurityScanner" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "websecurityscanner_v1beta_generated_WebSecurityScanner_UpdateScanConfig_sync", + "title": "Snippet for the update_scan_config call in the WebSecurityScanner service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Client#update_scan_config.", + "file": "web_security_scanner/update_scan_config.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_scan_config", + "full_name": "::Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Client#update_scan_config", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::WebSecurityScanner::V1beta::UpdateScanConfigRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::WebSecurityScanner::V1beta::ScanConfig", + "client": { + "short_name": "WebSecurityScanner::Client", + "full_name": "::Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Client" + }, + "method": { + "short_name": "UpdateScanConfig", + "full_name": "google.cloud.websecurityscanner.v1beta.WebSecurityScanner.UpdateScanConfig", + "service": { + "short_name": "WebSecurityScanner", + "full_name": "google.cloud.websecurityscanner.v1beta.WebSecurityScanner" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "websecurityscanner_v1beta_generated_WebSecurityScanner_StartScanRun_sync", + "title": "Snippet for the start_scan_run call in the WebSecurityScanner service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Client#start_scan_run.", + "file": "web_security_scanner/start_scan_run.rb", + "language": "RUBY", + "client_method": { + "short_name": "start_scan_run", + "full_name": "::Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Client#start_scan_run", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::WebSecurityScanner::V1beta::StartScanRunRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::WebSecurityScanner::V1beta::ScanRun", + "client": { + "short_name": "WebSecurityScanner::Client", + "full_name": "::Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Client" + }, + "method": { + "short_name": "StartScanRun", + "full_name": "google.cloud.websecurityscanner.v1beta.WebSecurityScanner.StartScanRun", + "service": { + "short_name": "WebSecurityScanner", + "full_name": "google.cloud.websecurityscanner.v1beta.WebSecurityScanner" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "websecurityscanner_v1beta_generated_WebSecurityScanner_GetScanRun_sync", + "title": "Snippet for the get_scan_run call in the WebSecurityScanner service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Client#get_scan_run.", + "file": "web_security_scanner/get_scan_run.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_scan_run", + "full_name": "::Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Client#get_scan_run", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::WebSecurityScanner::V1beta::GetScanRunRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::WebSecurityScanner::V1beta::ScanRun", + "client": { + "short_name": "WebSecurityScanner::Client", + "full_name": "::Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Client" + }, + "method": { + "short_name": "GetScanRun", + "full_name": "google.cloud.websecurityscanner.v1beta.WebSecurityScanner.GetScanRun", + "service": { + "short_name": "WebSecurityScanner", + "full_name": "google.cloud.websecurityscanner.v1beta.WebSecurityScanner" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "websecurityscanner_v1beta_generated_WebSecurityScanner_ListScanRuns_sync", + "title": "Snippet for the list_scan_runs call in the WebSecurityScanner service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Client#list_scan_runs.", + "file": "web_security_scanner/list_scan_runs.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_scan_runs", + "full_name": "::Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Client#list_scan_runs", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::WebSecurityScanner::V1beta::ListScanRunsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::WebSecurityScanner::V1beta::ListScanRunsResponse", + "client": { + "short_name": "WebSecurityScanner::Client", + "full_name": "::Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Client" + }, + "method": { + "short_name": "ListScanRuns", + "full_name": "google.cloud.websecurityscanner.v1beta.WebSecurityScanner.ListScanRuns", + "service": { + "short_name": "WebSecurityScanner", + "full_name": "google.cloud.websecurityscanner.v1beta.WebSecurityScanner" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "websecurityscanner_v1beta_generated_WebSecurityScanner_StopScanRun_sync", + "title": "Snippet for the stop_scan_run call in the WebSecurityScanner service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Client#stop_scan_run.", + "file": "web_security_scanner/stop_scan_run.rb", + "language": "RUBY", + "client_method": { + "short_name": "stop_scan_run", + "full_name": "::Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Client#stop_scan_run", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::WebSecurityScanner::V1beta::StopScanRunRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::WebSecurityScanner::V1beta::ScanRun", + "client": { + "short_name": "WebSecurityScanner::Client", + "full_name": "::Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Client" + }, + "method": { + "short_name": "StopScanRun", + "full_name": "google.cloud.websecurityscanner.v1beta.WebSecurityScanner.StopScanRun", + "service": { + "short_name": "WebSecurityScanner", + "full_name": "google.cloud.websecurityscanner.v1beta.WebSecurityScanner" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "websecurityscanner_v1beta_generated_WebSecurityScanner_ListCrawledUrls_sync", + "title": "Snippet for the list_crawled_urls call in the WebSecurityScanner service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Client#list_crawled_urls.", + "file": "web_security_scanner/list_crawled_urls.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_crawled_urls", + "full_name": "::Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Client#list_crawled_urls", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::WebSecurityScanner::V1beta::ListCrawledUrlsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::WebSecurityScanner::V1beta::ListCrawledUrlsResponse", + "client": { + "short_name": "WebSecurityScanner::Client", + "full_name": "::Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Client" + }, + "method": { + "short_name": "ListCrawledUrls", + "full_name": "google.cloud.websecurityscanner.v1beta.WebSecurityScanner.ListCrawledUrls", + "service": { + "short_name": "WebSecurityScanner", + "full_name": "google.cloud.websecurityscanner.v1beta.WebSecurityScanner" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "websecurityscanner_v1beta_generated_WebSecurityScanner_GetFinding_sync", + "title": "Snippet for the get_finding call in the WebSecurityScanner service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Client#get_finding.", + "file": "web_security_scanner/get_finding.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_finding", + "full_name": "::Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Client#get_finding", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::WebSecurityScanner::V1beta::GetFindingRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::WebSecurityScanner::V1beta::Finding", + "client": { + "short_name": "WebSecurityScanner::Client", + "full_name": "::Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Client" + }, + "method": { + "short_name": "GetFinding", + "full_name": "google.cloud.websecurityscanner.v1beta.WebSecurityScanner.GetFinding", + "service": { + "short_name": "WebSecurityScanner", + "full_name": "google.cloud.websecurityscanner.v1beta.WebSecurityScanner" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "websecurityscanner_v1beta_generated_WebSecurityScanner_ListFindings_sync", + "title": "Snippet for the list_findings call in the WebSecurityScanner service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Client#list_findings.", + "file": "web_security_scanner/list_findings.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_findings", + "full_name": "::Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Client#list_findings", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::WebSecurityScanner::V1beta::ListFindingsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::WebSecurityScanner::V1beta::ListFindingsResponse", + "client": { + "short_name": "WebSecurityScanner::Client", + "full_name": "::Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Client" + }, + "method": { + "short_name": "ListFindings", + "full_name": "google.cloud.websecurityscanner.v1beta.WebSecurityScanner.ListFindings", + "service": { + "short_name": "WebSecurityScanner", + "full_name": "google.cloud.websecurityscanner.v1beta.WebSecurityScanner" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "websecurityscanner_v1beta_generated_WebSecurityScanner_ListFindingTypeStats_sync", + "title": "Snippet for the list_finding_type_stats call in the WebSecurityScanner service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Client#list_finding_type_stats.", + "file": "web_security_scanner/list_finding_type_stats.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_finding_type_stats", + "full_name": "::Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Client#list_finding_type_stats", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::WebSecurityScanner::V1beta::ListFindingTypeStatsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::WebSecurityScanner::V1beta::ListFindingTypeStatsResponse", + "client": { + "short_name": "WebSecurityScanner::Client", + "full_name": "::Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Client" + }, + "method": { + "short_name": "ListFindingTypeStats", + "full_name": "google.cloud.websecurityscanner.v1beta.WebSecurityScanner.ListFindingTypeStats", + "service": { + "short_name": "WebSecurityScanner", + "full_name": "google.cloud.websecurityscanner.v1beta.WebSecurityScanner" + } + } + }, + "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-web_security_scanner-v1beta/snippets/web_security_scanner/create_scan_config.rb b/owl-bot-staging/google-cloud-web_security_scanner-v1beta/snippets/web_security_scanner/create_scan_config.rb new file mode 100644 index 000000000000..72531ba34f7c --- /dev/null +++ b/owl-bot-staging/google-cloud-web_security_scanner-v1beta/snippets/web_security_scanner/create_scan_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 websecurityscanner_v1beta_generated_WebSecurityScanner_CreateScanConfig_sync] +require "google/cloud/web_security_scanner/v1beta" + +## +# Snippet for the create_scan_config call in the WebSecurityScanner 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::WebSecurityScanner::V1beta::WebSecurityScanner::Client#create_scan_config. +# +def create_scan_config + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::WebSecurityScanner::V1beta::CreateScanConfigRequest.new + + # Call the create_scan_config method. + result = client.create_scan_config request + + # The returned object is of type Google::Cloud::WebSecurityScanner::V1beta::ScanConfig. + p result +end +# [END websecurityscanner_v1beta_generated_WebSecurityScanner_CreateScanConfig_sync] diff --git a/owl-bot-staging/google-cloud-web_security_scanner-v1beta/snippets/web_security_scanner/delete_scan_config.rb b/owl-bot-staging/google-cloud-web_security_scanner-v1beta/snippets/web_security_scanner/delete_scan_config.rb new file mode 100644 index 000000000000..4edf65f51798 --- /dev/null +++ b/owl-bot-staging/google-cloud-web_security_scanner-v1beta/snippets/web_security_scanner/delete_scan_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 websecurityscanner_v1beta_generated_WebSecurityScanner_DeleteScanConfig_sync] +require "google/cloud/web_security_scanner/v1beta" + +## +# Snippet for the delete_scan_config call in the WebSecurityScanner 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::WebSecurityScanner::V1beta::WebSecurityScanner::Client#delete_scan_config. +# +def delete_scan_config + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::WebSecurityScanner::V1beta::DeleteScanConfigRequest.new + + # Call the delete_scan_config method. + result = client.delete_scan_config request + + # The returned object is of type Google::Protobuf::Empty. + p result +end +# [END websecurityscanner_v1beta_generated_WebSecurityScanner_DeleteScanConfig_sync] diff --git a/owl-bot-staging/google-cloud-web_security_scanner-v1beta/snippets/web_security_scanner/get_finding.rb b/owl-bot-staging/google-cloud-web_security_scanner-v1beta/snippets/web_security_scanner/get_finding.rb new file mode 100644 index 000000000000..31b8a781be9a --- /dev/null +++ b/owl-bot-staging/google-cloud-web_security_scanner-v1beta/snippets/web_security_scanner/get_finding.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 websecurityscanner_v1beta_generated_WebSecurityScanner_GetFinding_sync] +require "google/cloud/web_security_scanner/v1beta" + +## +# Snippet for the get_finding call in the WebSecurityScanner 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::WebSecurityScanner::V1beta::WebSecurityScanner::Client#get_finding. +# +def get_finding + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::WebSecurityScanner::V1beta::GetFindingRequest.new + + # Call the get_finding method. + result = client.get_finding request + + # The returned object is of type Google::Cloud::WebSecurityScanner::V1beta::Finding. + p result +end +# [END websecurityscanner_v1beta_generated_WebSecurityScanner_GetFinding_sync] diff --git a/owl-bot-staging/google-cloud-web_security_scanner-v1beta/snippets/web_security_scanner/get_scan_config.rb b/owl-bot-staging/google-cloud-web_security_scanner-v1beta/snippets/web_security_scanner/get_scan_config.rb new file mode 100644 index 000000000000..54d205419154 --- /dev/null +++ b/owl-bot-staging/google-cloud-web_security_scanner-v1beta/snippets/web_security_scanner/get_scan_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 websecurityscanner_v1beta_generated_WebSecurityScanner_GetScanConfig_sync] +require "google/cloud/web_security_scanner/v1beta" + +## +# Snippet for the get_scan_config call in the WebSecurityScanner 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::WebSecurityScanner::V1beta::WebSecurityScanner::Client#get_scan_config. +# +def get_scan_config + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::WebSecurityScanner::V1beta::GetScanConfigRequest.new + + # Call the get_scan_config method. + result = client.get_scan_config request + + # The returned object is of type Google::Cloud::WebSecurityScanner::V1beta::ScanConfig. + p result +end +# [END websecurityscanner_v1beta_generated_WebSecurityScanner_GetScanConfig_sync] diff --git a/owl-bot-staging/google-cloud-web_security_scanner-v1beta/snippets/web_security_scanner/get_scan_run.rb b/owl-bot-staging/google-cloud-web_security_scanner-v1beta/snippets/web_security_scanner/get_scan_run.rb new file mode 100644 index 000000000000..849242e39e6a --- /dev/null +++ b/owl-bot-staging/google-cloud-web_security_scanner-v1beta/snippets/web_security_scanner/get_scan_run.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 websecurityscanner_v1beta_generated_WebSecurityScanner_GetScanRun_sync] +require "google/cloud/web_security_scanner/v1beta" + +## +# Snippet for the get_scan_run call in the WebSecurityScanner 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::WebSecurityScanner::V1beta::WebSecurityScanner::Client#get_scan_run. +# +def get_scan_run + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::WebSecurityScanner::V1beta::GetScanRunRequest.new + + # Call the get_scan_run method. + result = client.get_scan_run request + + # The returned object is of type Google::Cloud::WebSecurityScanner::V1beta::ScanRun. + p result +end +# [END websecurityscanner_v1beta_generated_WebSecurityScanner_GetScanRun_sync] diff --git a/owl-bot-staging/google-cloud-web_security_scanner-v1beta/snippets/web_security_scanner/list_crawled_urls.rb b/owl-bot-staging/google-cloud-web_security_scanner-v1beta/snippets/web_security_scanner/list_crawled_urls.rb new file mode 100644 index 000000000000..5909d290f3fe --- /dev/null +++ b/owl-bot-staging/google-cloud-web_security_scanner-v1beta/snippets/web_security_scanner/list_crawled_urls.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 websecurityscanner_v1beta_generated_WebSecurityScanner_ListCrawledUrls_sync] +require "google/cloud/web_security_scanner/v1beta" + +## +# Snippet for the list_crawled_urls call in the WebSecurityScanner 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::WebSecurityScanner::V1beta::WebSecurityScanner::Client#list_crawled_urls. +# +def list_crawled_urls + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::WebSecurityScanner::V1beta::ListCrawledUrlsRequest.new + + # Call the list_crawled_urls method. + result = client.list_crawled_urls 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::WebSecurityScanner::V1beta::CrawledUrl. + p item + end +end +# [END websecurityscanner_v1beta_generated_WebSecurityScanner_ListCrawledUrls_sync] diff --git a/owl-bot-staging/google-cloud-web_security_scanner-v1beta/snippets/web_security_scanner/list_finding_type_stats.rb b/owl-bot-staging/google-cloud-web_security_scanner-v1beta/snippets/web_security_scanner/list_finding_type_stats.rb new file mode 100644 index 000000000000..c3c3e83e332a --- /dev/null +++ b/owl-bot-staging/google-cloud-web_security_scanner-v1beta/snippets/web_security_scanner/list_finding_type_stats.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 websecurityscanner_v1beta_generated_WebSecurityScanner_ListFindingTypeStats_sync] +require "google/cloud/web_security_scanner/v1beta" + +## +# Snippet for the list_finding_type_stats call in the WebSecurityScanner 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::WebSecurityScanner::V1beta::WebSecurityScanner::Client#list_finding_type_stats. +# +def list_finding_type_stats + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::WebSecurityScanner::V1beta::ListFindingTypeStatsRequest.new + + # Call the list_finding_type_stats method. + result = client.list_finding_type_stats request + + # The returned object is of type Google::Cloud::WebSecurityScanner::V1beta::ListFindingTypeStatsResponse. + p result +end +# [END websecurityscanner_v1beta_generated_WebSecurityScanner_ListFindingTypeStats_sync] diff --git a/owl-bot-staging/google-cloud-web_security_scanner-v1beta/snippets/web_security_scanner/list_findings.rb b/owl-bot-staging/google-cloud-web_security_scanner-v1beta/snippets/web_security_scanner/list_findings.rb new file mode 100644 index 000000000000..942fcec7e55d --- /dev/null +++ b/owl-bot-staging/google-cloud-web_security_scanner-v1beta/snippets/web_security_scanner/list_findings.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 websecurityscanner_v1beta_generated_WebSecurityScanner_ListFindings_sync] +require "google/cloud/web_security_scanner/v1beta" + +## +# Snippet for the list_findings call in the WebSecurityScanner 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::WebSecurityScanner::V1beta::WebSecurityScanner::Client#list_findings. +# +def list_findings + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::WebSecurityScanner::V1beta::ListFindingsRequest.new + + # Call the list_findings method. + result = client.list_findings 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::WebSecurityScanner::V1beta::Finding. + p item + end +end +# [END websecurityscanner_v1beta_generated_WebSecurityScanner_ListFindings_sync] diff --git a/owl-bot-staging/google-cloud-web_security_scanner-v1beta/snippets/web_security_scanner/list_scan_configs.rb b/owl-bot-staging/google-cloud-web_security_scanner-v1beta/snippets/web_security_scanner/list_scan_configs.rb new file mode 100644 index 000000000000..654d77988f2c --- /dev/null +++ b/owl-bot-staging/google-cloud-web_security_scanner-v1beta/snippets/web_security_scanner/list_scan_configs.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 websecurityscanner_v1beta_generated_WebSecurityScanner_ListScanConfigs_sync] +require "google/cloud/web_security_scanner/v1beta" + +## +# Snippet for the list_scan_configs call in the WebSecurityScanner 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::WebSecurityScanner::V1beta::WebSecurityScanner::Client#list_scan_configs. +# +def list_scan_configs + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::WebSecurityScanner::V1beta::ListScanConfigsRequest.new + + # Call the list_scan_configs method. + result = client.list_scan_configs 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::WebSecurityScanner::V1beta::ScanConfig. + p item + end +end +# [END websecurityscanner_v1beta_generated_WebSecurityScanner_ListScanConfigs_sync] diff --git a/owl-bot-staging/google-cloud-web_security_scanner-v1beta/snippets/web_security_scanner/list_scan_runs.rb b/owl-bot-staging/google-cloud-web_security_scanner-v1beta/snippets/web_security_scanner/list_scan_runs.rb new file mode 100644 index 000000000000..37835b22f132 --- /dev/null +++ b/owl-bot-staging/google-cloud-web_security_scanner-v1beta/snippets/web_security_scanner/list_scan_runs.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 websecurityscanner_v1beta_generated_WebSecurityScanner_ListScanRuns_sync] +require "google/cloud/web_security_scanner/v1beta" + +## +# Snippet for the list_scan_runs call in the WebSecurityScanner 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::WebSecurityScanner::V1beta::WebSecurityScanner::Client#list_scan_runs. +# +def list_scan_runs + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::WebSecurityScanner::V1beta::ListScanRunsRequest.new + + # Call the list_scan_runs method. + result = client.list_scan_runs 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::WebSecurityScanner::V1beta::ScanRun. + p item + end +end +# [END websecurityscanner_v1beta_generated_WebSecurityScanner_ListScanRuns_sync] diff --git a/owl-bot-staging/google-cloud-web_security_scanner-v1beta/snippets/web_security_scanner/start_scan_run.rb b/owl-bot-staging/google-cloud-web_security_scanner-v1beta/snippets/web_security_scanner/start_scan_run.rb new file mode 100644 index 000000000000..645b424b6b29 --- /dev/null +++ b/owl-bot-staging/google-cloud-web_security_scanner-v1beta/snippets/web_security_scanner/start_scan_run.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 websecurityscanner_v1beta_generated_WebSecurityScanner_StartScanRun_sync] +require "google/cloud/web_security_scanner/v1beta" + +## +# Snippet for the start_scan_run call in the WebSecurityScanner 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::WebSecurityScanner::V1beta::WebSecurityScanner::Client#start_scan_run. +# +def start_scan_run + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::WebSecurityScanner::V1beta::StartScanRunRequest.new + + # Call the start_scan_run method. + result = client.start_scan_run request + + # The returned object is of type Google::Cloud::WebSecurityScanner::V1beta::ScanRun. + p result +end +# [END websecurityscanner_v1beta_generated_WebSecurityScanner_StartScanRun_sync] diff --git a/owl-bot-staging/google-cloud-web_security_scanner-v1beta/snippets/web_security_scanner/stop_scan_run.rb b/owl-bot-staging/google-cloud-web_security_scanner-v1beta/snippets/web_security_scanner/stop_scan_run.rb new file mode 100644 index 000000000000..894d270fec3b --- /dev/null +++ b/owl-bot-staging/google-cloud-web_security_scanner-v1beta/snippets/web_security_scanner/stop_scan_run.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 websecurityscanner_v1beta_generated_WebSecurityScanner_StopScanRun_sync] +require "google/cloud/web_security_scanner/v1beta" + +## +# Snippet for the stop_scan_run call in the WebSecurityScanner 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::WebSecurityScanner::V1beta::WebSecurityScanner::Client#stop_scan_run. +# +def stop_scan_run + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::WebSecurityScanner::V1beta::StopScanRunRequest.new + + # Call the stop_scan_run method. + result = client.stop_scan_run request + + # The returned object is of type Google::Cloud::WebSecurityScanner::V1beta::ScanRun. + p result +end +# [END websecurityscanner_v1beta_generated_WebSecurityScanner_StopScanRun_sync] diff --git a/owl-bot-staging/google-cloud-web_security_scanner-v1beta/snippets/web_security_scanner/update_scan_config.rb b/owl-bot-staging/google-cloud-web_security_scanner-v1beta/snippets/web_security_scanner/update_scan_config.rb new file mode 100644 index 000000000000..7803724b8906 --- /dev/null +++ b/owl-bot-staging/google-cloud-web_security_scanner-v1beta/snippets/web_security_scanner/update_scan_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 websecurityscanner_v1beta_generated_WebSecurityScanner_UpdateScanConfig_sync] +require "google/cloud/web_security_scanner/v1beta" + +## +# Snippet for the update_scan_config call in the WebSecurityScanner 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::WebSecurityScanner::V1beta::WebSecurityScanner::Client#update_scan_config. +# +def update_scan_config + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::WebSecurityScanner::V1beta::UpdateScanConfigRequest.new + + # Call the update_scan_config method. + result = client.update_scan_config request + + # The returned object is of type Google::Cloud::WebSecurityScanner::V1beta::ScanConfig. + p result +end +# [END websecurityscanner_v1beta_generated_WebSecurityScanner_UpdateScanConfig_sync] diff --git a/owl-bot-staging/google-cloud-web_security_scanner-v1beta/test/google/cloud/web_security_scanner/v1beta/web_security_scanner_paths_test.rb b/owl-bot-staging/google-cloud-web_security_scanner-v1beta/test/google/cloud/web_security_scanner/v1beta/web_security_scanner_paths_test.rb new file mode 100644 index 000000000000..8b06894bb244 --- /dev/null +++ b/owl-bot-staging/google-cloud-web_security_scanner-v1beta/test/google/cloud/web_security_scanner/v1beta/web_security_scanner_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/web_security_scanner/v1beta/web_security_scanner" + +class ::Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::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_finding_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.finding_path project: "value0", scan_config: "value1", scan_run: "value2", finding: "value3" + assert_equal "projects/value0/scanConfigs/value1/scanRuns/value2/findings/value3", 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::WebSecurityScanner::V1beta::WebSecurityScanner::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.project_path project: "value0" + assert_equal "projects/value0", path + end + end + + def test_scan_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::WebSecurityScanner::V1beta::WebSecurityScanner::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.scan_config_path project: "value0", scan_config: "value1" + assert_equal "projects/value0/scanConfigs/value1", path + end + end + + def test_scan_run_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.scan_run_path project: "value0", scan_config: "value1", scan_run: "value2" + assert_equal "projects/value0/scanConfigs/value1/scanRuns/value2", path + end + end +end diff --git a/owl-bot-staging/google-cloud-web_security_scanner-v1beta/test/google/cloud/web_security_scanner/v1beta/web_security_scanner_rest_test.rb b/owl-bot-staging/google-cloud-web_security_scanner-v1beta/test/google/cloud/web_security_scanner/v1beta/web_security_scanner_rest_test.rb new file mode 100644 index 000000000000..2fe56ab000a3 --- /dev/null +++ b/owl-bot-staging/google-cloud-web_security_scanner-v1beta/test/google/cloud/web_security_scanner/v1beta/web_security_scanner_rest_test.rb @@ -0,0 +1,812 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/websecurityscanner/v1beta/web_security_scanner_pb" +require "google/cloud/web_security_scanner/v1beta/web_security_scanner/rest" + + +class ::Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::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_scan_config + # Create test objects. + client_result = ::Google::Cloud::WebSecurityScanner::V1beta::ScanConfig.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + scan_config = {} + + create_scan_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::WebSecurityScanner::V1beta::WebSecurityScanner::Rest::ServiceStub.stub :transcode_create_scan_config_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_scan_config_client_stub do + # Create client + client = ::Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_scan_config({ parent: parent, scan_config: scan_config }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_scan_config parent: parent, scan_config: scan_config do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_scan_config ::Google::Cloud::WebSecurityScanner::V1beta::CreateScanConfigRequest.new(parent: parent, scan_config: scan_config) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_scan_config({ parent: parent, scan_config: scan_config }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_scan_config(::Google::Cloud::WebSecurityScanner::V1beta::CreateScanConfigRequest.new(parent: parent, scan_config: scan_config), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_scan_config_client_stub.call_count + end + end + end + + def test_delete_scan_config + # 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_scan_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::WebSecurityScanner::V1beta::WebSecurityScanner::Rest::ServiceStub.stub :transcode_delete_scan_config_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_scan_config_client_stub do + # Create client + client = ::Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_scan_config({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_scan_config name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_scan_config ::Google::Cloud::WebSecurityScanner::V1beta::DeleteScanConfigRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_scan_config({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_scan_config(::Google::Cloud::WebSecurityScanner::V1beta::DeleteScanConfigRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_scan_config_client_stub.call_count + end + end + end + + def test_get_scan_config + # Create test objects. + client_result = ::Google::Cloud::WebSecurityScanner::V1beta::ScanConfig.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_scan_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::WebSecurityScanner::V1beta::WebSecurityScanner::Rest::ServiceStub.stub :transcode_get_scan_config_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_scan_config_client_stub do + # Create client + client = ::Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_scan_config({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_scan_config name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_scan_config ::Google::Cloud::WebSecurityScanner::V1beta::GetScanConfigRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_scan_config({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_scan_config(::Google::Cloud::WebSecurityScanner::V1beta::GetScanConfigRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_scan_config_client_stub.call_count + end + end + end + + def test_list_scan_configs + # Create test objects. + client_result = ::Google::Cloud::WebSecurityScanner::V1beta::ListScanConfigsResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + page_token = "hello world" + page_size = 42 + + list_scan_configs_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::WebSecurityScanner::V1beta::WebSecurityScanner::Rest::ServiceStub.stub :transcode_list_scan_configs_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_scan_configs_client_stub do + # Create client + client = ::Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_scan_configs({ parent: parent, page_token: page_token, page_size: page_size }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.list_scan_configs parent: parent, page_token: page_token, page_size: page_size do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.list_scan_configs ::Google::Cloud::WebSecurityScanner::V1beta::ListScanConfigsRequest.new(parent: parent, page_token: page_token, page_size: page_size) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.list_scan_configs({ parent: parent, page_token: page_token, page_size: page_size }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.list_scan_configs(::Google::Cloud::WebSecurityScanner::V1beta::ListScanConfigsRequest.new(parent: parent, page_token: page_token, page_size: page_size), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, list_scan_configs_client_stub.call_count + end + end + end + + def test_update_scan_config + # Create test objects. + client_result = ::Google::Cloud::WebSecurityScanner::V1beta::ScanConfig.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + scan_config = {} + update_mask = {} + + update_scan_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::WebSecurityScanner::V1beta::WebSecurityScanner::Rest::ServiceStub.stub :transcode_update_scan_config_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_scan_config_client_stub do + # Create client + client = ::Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_scan_config({ scan_config: scan_config, update_mask: update_mask }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_scan_config scan_config: scan_config, update_mask: update_mask do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_scan_config ::Google::Cloud::WebSecurityScanner::V1beta::UpdateScanConfigRequest.new(scan_config: scan_config, update_mask: update_mask) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_scan_config({ scan_config: scan_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_scan_config(::Google::Cloud::WebSecurityScanner::V1beta::UpdateScanConfigRequest.new(scan_config: scan_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_scan_config_client_stub.call_count + end + end + end + + def test_start_scan_run + # Create test objects. + client_result = ::Google::Cloud::WebSecurityScanner::V1beta::ScanRun.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + start_scan_run_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::WebSecurityScanner::V1beta::WebSecurityScanner::Rest::ServiceStub.stub :transcode_start_scan_run_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, start_scan_run_client_stub do + # Create client + client = ::Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.start_scan_run({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.start_scan_run name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.start_scan_run ::Google::Cloud::WebSecurityScanner::V1beta::StartScanRunRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.start_scan_run({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.start_scan_run(::Google::Cloud::WebSecurityScanner::V1beta::StartScanRunRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, start_scan_run_client_stub.call_count + end + end + end + + def test_get_scan_run + # Create test objects. + client_result = ::Google::Cloud::WebSecurityScanner::V1beta::ScanRun.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_scan_run_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::WebSecurityScanner::V1beta::WebSecurityScanner::Rest::ServiceStub.stub :transcode_get_scan_run_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_scan_run_client_stub do + # Create client + client = ::Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_scan_run({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_scan_run name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_scan_run ::Google::Cloud::WebSecurityScanner::V1beta::GetScanRunRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_scan_run({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_scan_run(::Google::Cloud::WebSecurityScanner::V1beta::GetScanRunRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_scan_run_client_stub.call_count + end + end + end + + def test_list_scan_runs + # Create test objects. + client_result = ::Google::Cloud::WebSecurityScanner::V1beta::ListScanRunsResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + page_token = "hello world" + page_size = 42 + + list_scan_runs_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::WebSecurityScanner::V1beta::WebSecurityScanner::Rest::ServiceStub.stub :transcode_list_scan_runs_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_scan_runs_client_stub do + # Create client + client = ::Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_scan_runs({ parent: parent, page_token: page_token, page_size: page_size }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.list_scan_runs parent: parent, page_token: page_token, page_size: page_size do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.list_scan_runs ::Google::Cloud::WebSecurityScanner::V1beta::ListScanRunsRequest.new(parent: parent, page_token: page_token, page_size: page_size) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.list_scan_runs({ parent: parent, page_token: page_token, page_size: page_size }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.list_scan_runs(::Google::Cloud::WebSecurityScanner::V1beta::ListScanRunsRequest.new(parent: parent, page_token: page_token, page_size: page_size), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, list_scan_runs_client_stub.call_count + end + end + end + + def test_stop_scan_run + # Create test objects. + client_result = ::Google::Cloud::WebSecurityScanner::V1beta::ScanRun.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + stop_scan_run_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::WebSecurityScanner::V1beta::WebSecurityScanner::Rest::ServiceStub.stub :transcode_stop_scan_run_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, stop_scan_run_client_stub do + # Create client + client = ::Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.stop_scan_run({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.stop_scan_run name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.stop_scan_run ::Google::Cloud::WebSecurityScanner::V1beta::StopScanRunRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.stop_scan_run({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.stop_scan_run(::Google::Cloud::WebSecurityScanner::V1beta::StopScanRunRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, stop_scan_run_client_stub.call_count + end + end + end + + def test_list_crawled_urls + # Create test objects. + client_result = ::Google::Cloud::WebSecurityScanner::V1beta::ListCrawledUrlsResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + page_token = "hello world" + page_size = 42 + + list_crawled_urls_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::WebSecurityScanner::V1beta::WebSecurityScanner::Rest::ServiceStub.stub :transcode_list_crawled_urls_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_crawled_urls_client_stub do + # Create client + client = ::Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_crawled_urls({ parent: parent, page_token: page_token, page_size: page_size }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.list_crawled_urls parent: parent, page_token: page_token, page_size: page_size do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.list_crawled_urls ::Google::Cloud::WebSecurityScanner::V1beta::ListCrawledUrlsRequest.new(parent: parent, page_token: page_token, page_size: page_size) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.list_crawled_urls({ parent: parent, page_token: page_token, page_size: page_size }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.list_crawled_urls(::Google::Cloud::WebSecurityScanner::V1beta::ListCrawledUrlsRequest.new(parent: parent, page_token: page_token, page_size: page_size), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, list_crawled_urls_client_stub.call_count + end + end + end + + def test_get_finding + # Create test objects. + client_result = ::Google::Cloud::WebSecurityScanner::V1beta::Finding.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_finding_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::WebSecurityScanner::V1beta::WebSecurityScanner::Rest::ServiceStub.stub :transcode_get_finding_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_finding_client_stub do + # Create client + client = ::Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_finding({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_finding name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_finding ::Google::Cloud::WebSecurityScanner::V1beta::GetFindingRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_finding({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_finding(::Google::Cloud::WebSecurityScanner::V1beta::GetFindingRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_finding_client_stub.call_count + end + end + end + + def test_list_findings + # Create test objects. + client_result = ::Google::Cloud::WebSecurityScanner::V1beta::ListFindingsResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + filter = "hello world" + page_token = "hello world" + page_size = 42 + + list_findings_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::WebSecurityScanner::V1beta::WebSecurityScanner::Rest::ServiceStub.stub :transcode_list_findings_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_findings_client_stub do + # Create client + client = ::Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_findings({ parent: parent, filter: filter, page_token: page_token, page_size: page_size }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.list_findings parent: parent, filter: filter, page_token: page_token, page_size: page_size do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.list_findings ::Google::Cloud::WebSecurityScanner::V1beta::ListFindingsRequest.new(parent: parent, filter: filter, page_token: page_token, page_size: page_size) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.list_findings({ parent: parent, filter: filter, page_token: page_token, page_size: page_size }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.list_findings(::Google::Cloud::WebSecurityScanner::V1beta::ListFindingsRequest.new(parent: parent, filter: filter, page_token: page_token, page_size: page_size), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, list_findings_client_stub.call_count + end + end + end + + def test_list_finding_type_stats + # Create test objects. + client_result = ::Google::Cloud::WebSecurityScanner::V1beta::ListFindingTypeStatsResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + + list_finding_type_stats_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::WebSecurityScanner::V1beta::WebSecurityScanner::Rest::ServiceStub.stub :transcode_list_finding_type_stats_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_finding_type_stats_client_stub do + # Create client + client = ::Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_finding_type_stats({ parent: parent }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.list_finding_type_stats parent: parent do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.list_finding_type_stats ::Google::Cloud::WebSecurityScanner::V1beta::ListFindingTypeStatsRequest.new(parent: parent) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.list_finding_type_stats({ parent: parent }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.list_finding_type_stats(::Google::Cloud::WebSecurityScanner::V1beta::ListFindingTypeStatsRequest.new(parent: parent), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, list_finding_type_stats_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::WebSecurityScanner::V1beta::WebSecurityScanner::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::WebSecurityScanner::V1beta::WebSecurityScanner::Rest::Client::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-web_security_scanner-v1beta/test/google/cloud/web_security_scanner/v1beta/web_security_scanner_test.rb b/owl-bot-staging/google-cloud-web_security_scanner-v1beta/test/google/cloud/web_security_scanner/v1beta/web_security_scanner_test.rb new file mode 100644 index 000000000000..25a2ab5f9477 --- /dev/null +++ b/owl-bot-staging/google-cloud-web_security_scanner-v1beta/test/google/cloud/web_security_scanner/v1beta/web_security_scanner_test.rb @@ -0,0 +1,900 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/websecurityscanner/v1beta/web_security_scanner_pb" +require "google/cloud/web_security_scanner/v1beta/web_security_scanner" + +class ::Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::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_scan_config + # Create GRPC objects. + grpc_response = ::Google::Cloud::WebSecurityScanner::V1beta::ScanConfig.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" + scan_config = {} + + create_scan_config_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_scan_config, name + assert_kind_of ::Google::Cloud::WebSecurityScanner::V1beta::CreateScanConfigRequest, request + assert_equal "hello world", request["parent"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::WebSecurityScanner::V1beta::ScanConfig), request["scan_config"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_scan_config_client_stub do + # Create client + client = ::Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_scan_config({ parent: parent, scan_config: scan_config }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.create_scan_config parent: parent, scan_config: scan_config do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.create_scan_config ::Google::Cloud::WebSecurityScanner::V1beta::CreateScanConfigRequest.new(parent: parent, scan_config: scan_config) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.create_scan_config({ parent: parent, scan_config: scan_config }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.create_scan_config(::Google::Cloud::WebSecurityScanner::V1beta::CreateScanConfigRequest.new(parent: parent, scan_config: scan_config), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, create_scan_config_client_stub.call_rpc_count + end + end + + def test_delete_scan_config + # 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_scan_config_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_scan_config, name + assert_kind_of ::Google::Cloud::WebSecurityScanner::V1beta::DeleteScanConfigRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_scan_config_client_stub do + # Create client + client = ::Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_scan_config({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.delete_scan_config name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.delete_scan_config ::Google::Cloud::WebSecurityScanner::V1beta::DeleteScanConfigRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.delete_scan_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.delete_scan_config(::Google::Cloud::WebSecurityScanner::V1beta::DeleteScanConfigRequest.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_scan_config_client_stub.call_rpc_count + end + end + + def test_get_scan_config + # Create GRPC objects. + grpc_response = ::Google::Cloud::WebSecurityScanner::V1beta::ScanConfig.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_scan_config_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_scan_config, name + assert_kind_of ::Google::Cloud::WebSecurityScanner::V1beta::GetScanConfigRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_scan_config_client_stub do + # Create client + client = ::Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_scan_config({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_scan_config name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_scan_config ::Google::Cloud::WebSecurityScanner::V1beta::GetScanConfigRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_scan_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_scan_config(::Google::Cloud::WebSecurityScanner::V1beta::GetScanConfigRequest.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_scan_config_client_stub.call_rpc_count + end + end + + def test_list_scan_configs + # Create GRPC objects. + grpc_response = ::Google::Cloud::WebSecurityScanner::V1beta::ListScanConfigsResponse.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_token = "hello world" + page_size = 42 + + list_scan_configs_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_scan_configs, name + assert_kind_of ::Google::Cloud::WebSecurityScanner::V1beta::ListScanConfigsRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["page_token"] + assert_equal 42, request["page_size"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_scan_configs_client_stub do + # Create client + client = ::Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_scan_configs({ parent: parent, page_token: page_token, page_size: page_size }) 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_scan_configs parent: parent, page_token: page_token, page_size: page_size 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_scan_configs ::Google::Cloud::WebSecurityScanner::V1beta::ListScanConfigsRequest.new(parent: parent, page_token: page_token, page_size: page_size) 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_scan_configs({ parent: parent, page_token: page_token, page_size: page_size }, 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_scan_configs(::Google::Cloud::WebSecurityScanner::V1beta::ListScanConfigsRequest.new(parent: parent, page_token: page_token, page_size: page_size), 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_scan_configs_client_stub.call_rpc_count + end + end + + def test_update_scan_config + # Create GRPC objects. + grpc_response = ::Google::Cloud::WebSecurityScanner::V1beta::ScanConfig.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. + scan_config = {} + update_mask = {} + + update_scan_config_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_scan_config, name + assert_kind_of ::Google::Cloud::WebSecurityScanner::V1beta::UpdateScanConfigRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::WebSecurityScanner::V1beta::ScanConfig), request["scan_config"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_scan_config_client_stub do + # Create client + client = ::Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_scan_config({ scan_config: scan_config, update_mask: update_mask }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.update_scan_config scan_config: scan_config, update_mask: update_mask do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.update_scan_config ::Google::Cloud::WebSecurityScanner::V1beta::UpdateScanConfigRequest.new(scan_config: scan_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_scan_config({ scan_config: scan_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_scan_config(::Google::Cloud::WebSecurityScanner::V1beta::UpdateScanConfigRequest.new(scan_config: scan_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_scan_config_client_stub.call_rpc_count + end + end + + def test_start_scan_run + # Create GRPC objects. + grpc_response = ::Google::Cloud::WebSecurityScanner::V1beta::ScanRun.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" + + start_scan_run_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :start_scan_run, name + assert_kind_of ::Google::Cloud::WebSecurityScanner::V1beta::StartScanRunRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, start_scan_run_client_stub do + # Create client + client = ::Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.start_scan_run({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.start_scan_run name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.start_scan_run ::Google::Cloud::WebSecurityScanner::V1beta::StartScanRunRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.start_scan_run({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.start_scan_run(::Google::Cloud::WebSecurityScanner::V1beta::StartScanRunRequest.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, start_scan_run_client_stub.call_rpc_count + end + end + + def test_get_scan_run + # Create GRPC objects. + grpc_response = ::Google::Cloud::WebSecurityScanner::V1beta::ScanRun.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_scan_run_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_scan_run, name + assert_kind_of ::Google::Cloud::WebSecurityScanner::V1beta::GetScanRunRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_scan_run_client_stub do + # Create client + client = ::Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_scan_run({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_scan_run name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_scan_run ::Google::Cloud::WebSecurityScanner::V1beta::GetScanRunRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_scan_run({ 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_scan_run(::Google::Cloud::WebSecurityScanner::V1beta::GetScanRunRequest.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_scan_run_client_stub.call_rpc_count + end + end + + def test_list_scan_runs + # Create GRPC objects. + grpc_response = ::Google::Cloud::WebSecurityScanner::V1beta::ListScanRunsResponse.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_token = "hello world" + page_size = 42 + + list_scan_runs_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_scan_runs, name + assert_kind_of ::Google::Cloud::WebSecurityScanner::V1beta::ListScanRunsRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["page_token"] + assert_equal 42, request["page_size"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_scan_runs_client_stub do + # Create client + client = ::Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_scan_runs({ parent: parent, page_token: page_token, page_size: page_size }) 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_scan_runs parent: parent, page_token: page_token, page_size: page_size 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_scan_runs ::Google::Cloud::WebSecurityScanner::V1beta::ListScanRunsRequest.new(parent: parent, page_token: page_token, page_size: page_size) 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_scan_runs({ parent: parent, page_token: page_token, page_size: page_size }, 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_scan_runs(::Google::Cloud::WebSecurityScanner::V1beta::ListScanRunsRequest.new(parent: parent, page_token: page_token, page_size: page_size), 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_scan_runs_client_stub.call_rpc_count + end + end + + def test_stop_scan_run + # Create GRPC objects. + grpc_response = ::Google::Cloud::WebSecurityScanner::V1beta::ScanRun.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" + + stop_scan_run_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :stop_scan_run, name + assert_kind_of ::Google::Cloud::WebSecurityScanner::V1beta::StopScanRunRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, stop_scan_run_client_stub do + # Create client + client = ::Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.stop_scan_run({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.stop_scan_run name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.stop_scan_run ::Google::Cloud::WebSecurityScanner::V1beta::StopScanRunRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.stop_scan_run({ name: name }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.stop_scan_run(::Google::Cloud::WebSecurityScanner::V1beta::StopScanRunRequest.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, stop_scan_run_client_stub.call_rpc_count + end + end + + def test_list_crawled_urls + # Create GRPC objects. + grpc_response = ::Google::Cloud::WebSecurityScanner::V1beta::ListCrawledUrlsResponse.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_token = "hello world" + page_size = 42 + + list_crawled_urls_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_crawled_urls, name + assert_kind_of ::Google::Cloud::WebSecurityScanner::V1beta::ListCrawledUrlsRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["page_token"] + assert_equal 42, request["page_size"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_crawled_urls_client_stub do + # Create client + client = ::Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_crawled_urls({ parent: parent, page_token: page_token, page_size: page_size }) 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_crawled_urls parent: parent, page_token: page_token, page_size: page_size 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_crawled_urls ::Google::Cloud::WebSecurityScanner::V1beta::ListCrawledUrlsRequest.new(parent: parent, page_token: page_token, page_size: page_size) 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_crawled_urls({ parent: parent, page_token: page_token, page_size: page_size }, 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_crawled_urls(::Google::Cloud::WebSecurityScanner::V1beta::ListCrawledUrlsRequest.new(parent: parent, page_token: page_token, page_size: page_size), 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_crawled_urls_client_stub.call_rpc_count + end + end + + def test_get_finding + # Create GRPC objects. + grpc_response = ::Google::Cloud::WebSecurityScanner::V1beta::Finding.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_finding_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_finding, name + assert_kind_of ::Google::Cloud::WebSecurityScanner::V1beta::GetFindingRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_finding_client_stub do + # Create client + client = ::Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_finding({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_finding name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_finding ::Google::Cloud::WebSecurityScanner::V1beta::GetFindingRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_finding({ 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_finding(::Google::Cloud::WebSecurityScanner::V1beta::GetFindingRequest.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_finding_client_stub.call_rpc_count + end + end + + def test_list_findings + # Create GRPC objects. + grpc_response = ::Google::Cloud::WebSecurityScanner::V1beta::ListFindingsResponse.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" + filter = "hello world" + page_token = "hello world" + page_size = 42 + + list_findings_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_findings, name + assert_kind_of ::Google::Cloud::WebSecurityScanner::V1beta::ListFindingsRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["filter"] + assert_equal "hello world", request["page_token"] + assert_equal 42, request["page_size"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_findings_client_stub do + # Create client + client = ::Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_findings({ parent: parent, filter: filter, page_token: page_token, page_size: page_size }) 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_findings parent: parent, filter: filter, page_token: page_token, page_size: page_size 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_findings ::Google::Cloud::WebSecurityScanner::V1beta::ListFindingsRequest.new(parent: parent, filter: filter, page_token: page_token, page_size: page_size) 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_findings({ parent: parent, filter: filter, page_token: page_token, page_size: page_size }, 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_findings(::Google::Cloud::WebSecurityScanner::V1beta::ListFindingsRequest.new(parent: parent, filter: filter, page_token: page_token, page_size: page_size), 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_findings_client_stub.call_rpc_count + end + end + + def test_list_finding_type_stats + # Create GRPC objects. + grpc_response = ::Google::Cloud::WebSecurityScanner::V1beta::ListFindingTypeStatsResponse.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" + + list_finding_type_stats_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_finding_type_stats, name + assert_kind_of ::Google::Cloud::WebSecurityScanner::V1beta::ListFindingTypeStatsRequest, request + assert_equal "hello world", request["parent"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_finding_type_stats_client_stub do + # Create client + client = ::Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_finding_type_stats({ parent: parent }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.list_finding_type_stats parent: parent do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.list_finding_type_stats ::Google::Cloud::WebSecurityScanner::V1beta::ListFindingTypeStatsRequest.new(parent: parent) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.list_finding_type_stats({ parent: parent }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.list_finding_type_stats(::Google::Cloud::WebSecurityScanner::V1beta::ListFindingTypeStatsRequest.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, list_finding_type_stats_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::WebSecurityScanner::V1beta::WebSecurityScanner::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::WebSecurityScanner::V1beta::WebSecurityScanner::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::WebSecurityScanner::V1beta::WebSecurityScanner::Client.new do |config| + config.credentials = creds + end + assert_kind_of ::Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Client, client + assert_equal creds, client.configure.credentials + end + end +end diff --git a/owl-bot-staging/google-cloud-web_security_scanner-v1beta/test/helper.rb b/owl-bot-staging/google-cloud-web_security_scanner-v1beta/test/helper.rb new file mode 100644 index 000000000000..672b337030e7 --- /dev/null +++ b/owl-bot-staging/google-cloud-web_security_scanner-v1beta/test/helper.rb @@ -0,0 +1,26 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/mock" +require "minitest/rg" + +require "grpc" + +require "ostruct" diff --git a/owl-bot-staging/google-cloud-workflows-executions-v1/.gitignore b/owl-bot-staging/google-cloud-workflows-executions-v1/.gitignore new file mode 100644 index 000000000000..0135b6bc6cfc --- /dev/null +++ b/owl-bot-staging/google-cloud-workflows-executions-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-workflows-executions-v1/.repo-metadata.json b/owl-bot-staging/google-cloud-workflows-executions-v1/.repo-metadata.json new file mode 100644 index 000000000000..29631f032d47 --- /dev/null +++ b/owl-bot-staging/google-cloud-workflows-executions-v1/.repo-metadata.json @@ -0,0 +1,18 @@ +{ + "api_id": "workflowexecutions.googleapis.com", + "api_shortname": "workflowexecutions", + "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-workflows-executions-v1/latest", + "distribution_name": "google-cloud-workflows-executions-v1", + "is_cloud": true, + "language": "ruby", + "name": "workflowexecutions", + "name_pretty": "Workflows Executions V1 API", + "product_documentation": "https://cloud.google.com/workflows/", + "release_level": "unreleased", + "repo": "googleapis/google-cloud-ruby", + "requires_billing": true, + "ruby-cloud-description": "Workflows link series of serverless tasks together in an order you define. Combine the power of Google Cloud's APIs, serverless products like Cloud Functions and Cloud Run, and calls to external APIs to create flexible serverless applications. Workflows requires no infrastructure management and scales seamlessly with demand, including scaling down to zero.. Note that google-cloud-workflows-executions-v1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-workflows instead. See the readme for more details.", + "ruby-cloud-env-prefix": "WORKFLOWS", + "ruby-cloud-product-url": "https://cloud.google.com/workflows/", + "library_type": "GAPIC_AUTO" +} diff --git a/owl-bot-staging/google-cloud-workflows-executions-v1/.rubocop.yml b/owl-bot-staging/google-cloud-workflows-executions-v1/.rubocop.yml new file mode 100644 index 000000000000..ba04c515e3d9 --- /dev/null +++ b/owl-bot-staging/google-cloud-workflows-executions-v1/.rubocop.yml @@ -0,0 +1,33 @@ +inherit_gem: + google-style: google-style.yml + +AllCops: + Exclude: + - "google-cloud-workflows-executions-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-workflows-executions-v1.rb" diff --git a/owl-bot-staging/google-cloud-workflows-executions-v1/.toys.rb b/owl-bot-staging/google-cloud-workflows-executions-v1/.toys.rb new file mode 100644 index 000000000000..177e22456e8a --- /dev/null +++ b/owl-bot-staging/google-cloud-workflows-executions-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-workflows-executions-v1/.yardopts b/owl-bot-staging/google-cloud-workflows-executions-v1/.yardopts new file mode 100644 index 000000000000..f0b454dc3245 --- /dev/null +++ b/owl-bot-staging/google-cloud-workflows-executions-v1/.yardopts @@ -0,0 +1,12 @@ +--no-private +--title="Workflows Executions 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-workflows-executions-v1/AUTHENTICATION.md b/owl-bot-staging/google-cloud-workflows-executions-v1/AUTHENTICATION.md new file mode 100644 index 000000000000..73a695e2f97f --- /dev/null +++ b/owl-bot-staging/google-cloud-workflows-executions-v1/AUTHENTICATION.md @@ -0,0 +1,122 @@ +# Authentication + +The recommended way to authenticate to the google-cloud-workflows-executions-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-workflows-executions-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/workflows/executions/v1" + +client = ::Google::Cloud::Workflows::Executions::V1::Executions::Client.new do |config| + config.credentials = "path/to/credentialfile.json" +end +``` + +To configure a credentials file globally for all clients: + +```ruby +require "google/cloud/workflows/executions/v1" + +::Google::Cloud::Workflows::Executions::V1::Executions::Client.configure do |config| + config.credentials = "path/to/credentialfile.json" +end + +client = ::Google::Cloud::Workflows::Executions::V1::Executions::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-workflows-executions-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/workflows/executions/v1" + +ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" + +client = ::Google::Cloud::Workflows::Executions::V1::Executions::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-workflows-executions-v1/CHANGELOG.md b/owl-bot-staging/google-cloud-workflows-executions-v1/CHANGELOG.md new file mode 100644 index 000000000000..f88957a62ba2 --- /dev/null +++ b/owl-bot-staging/google-cloud-workflows-executions-v1/CHANGELOG.md @@ -0,0 +1,2 @@ +# Release History + diff --git a/owl-bot-staging/google-cloud-workflows-executions-v1/Gemfile b/owl-bot-staging/google-cloud-workflows-executions-v1/Gemfile new file mode 100644 index 000000000000..1d08558908d8 --- /dev/null +++ b/owl-bot-staging/google-cloud-workflows-executions-v1/Gemfile @@ -0,0 +1,14 @@ +source "https://rubygems.org" + +gemspec + +gem "google-style", "~> 1.32.0" +gem "irb", "~> 1.17" +gem "minitest", "~> 6.0.2" +gem "minitest-focus", "~> 1.4" +gem "minitest-mock", "~> 5.27" +gem "minitest-rg", "~> 5.3" +gem "ostruct", "~> 0.5.5" +gem "rake", ">= 13.0" +gem "redcarpet", "~> 3.6" +gem "yard", "~> 0.9" diff --git a/owl-bot-staging/google-cloud-workflows-executions-v1/LICENSE.md b/owl-bot-staging/google-cloud-workflows-executions-v1/LICENSE.md new file mode 100644 index 000000000000..c261857ba6ad --- /dev/null +++ b/owl-bot-staging/google-cloud-workflows-executions-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-workflows-executions-v1/README.md b/owl-bot-staging/google-cloud-workflows-executions-v1/README.md new file mode 100644 index 000000000000..1fad0660e45e --- /dev/null +++ b/owl-bot-staging/google-cloud-workflows-executions-v1/README.md @@ -0,0 +1,154 @@ +# Ruby Client for the Workflows Executions V1 API + +Execute workflows created with Workflows API. + +Workflows link series of serverless tasks together in an order you define. Combine the power of Google Cloud's APIs, serverless products like Cloud Functions and Cloud Run, and calls to external APIs to create flexible serverless applications. Workflows requires no infrastructure management and scales seamlessly with demand, including scaling down to zero.. + +https://github.com/googleapis/google-cloud-ruby + +This gem is a _versioned_ client. It provides basic client classes for a +specific version of the Workflows Executions V1 API. Most users should consider using +the main client gem, +[google-cloud-workflows](https://rubygems.org/gems/google-cloud-workflows). +See the section below titled *Which client should I use?* for more information. + +## Installation + +``` +$ gem install google-cloud-workflows-executions-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/workflowexecutions.googleapis.com) +1. [Set up authentication.](AUTHENTICATION.md) + +## Quick Start + +```ruby +require "google/cloud/workflows/executions/v1" + +client = ::Google::Cloud::Workflows::Executions::V1::Executions::Client.new +request = ::Google::Cloud::Workflows::Executions::V1::ListExecutionsRequest.new # (request fields as keyword arguments...) +response = client.list_executions request +``` + +View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-workflows-executions-v1/latest) +for class and method documentation. + +See also the [Product Documentation](https://cloud.google.com/workflows/) +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/workflows/executions/v1" +require "logger" + +client = ::Google::Cloud::Workflows::Executions::V1::Executions::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-workflows`, +and lower-level _versioned_ client libraries with names such as +`google-cloud-workflows-executions-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-workflows`. +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-workflows-executions-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-workflows-executions-v1/Rakefile b/owl-bot-staging/google-cloud-workflows-executions-v1/Rakefile new file mode 100644 index 000000000000..44509fa79f79 --- /dev/null +++ b/owl-bot-staging/google-cloud-workflows-executions-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-workflows-executions-v1 acceptance tests." +task :acceptance, :project, :keyfile do |t, args| + project = args[:project] + project ||= + ENV["WORKFLOWS_TEST_PROJECT"] || + ENV["GCLOUD_TEST_PROJECT"] + keyfile = args[:keyfile] + keyfile ||= + ENV["WORKFLOWS_TEST_KEYFILE"] || + ENV["GCLOUD_TEST_KEYFILE"] + if keyfile + keyfile = File.read keyfile + else + keyfile ||= + ENV["WORKFLOWS_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 WORKFLOWS_TEST_PROJECT=test123 WORKFLOWS_TEST_KEYFILE=/path/to/keyfile.json rake acceptance" + end + require "google/cloud/workflows/executions/v1/executions/credentials" + ::Google::Cloud::Workflows::Executions::V1::Executions::Credentials.env_vars.each do |path| + ENV[path] = nil + end + ENV["WORKFLOWS_PROJECT"] = project + ENV["WORKFLOWS_TEST_PROJECT"] = project + ENV["WORKFLOWS_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-workflows-executions-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-workflows-executions-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-workflows-executions-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-workflows-executions-v1 gem does not have doctest tests." +end + +desc "Run the CI build" +task :ci do + header "BUILDING google-cloud-workflows-executions-v1" + header "google-cloud-workflows-executions-v1 rubocop", "*" + Rake::Task[:rubocop].invoke + header "google-cloud-workflows-executions-v1 yard", "*" + Rake::Task[:yard].invoke + header "google-cloud-workflows-executions-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-workflows-executions-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-workflows-executions-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-workflows-executions-v1/gapic_metadata.json b/owl-bot-staging/google-cloud-workflows-executions-v1/gapic_metadata.json new file mode 100644 index 000000000000..7c61feeebf2d --- /dev/null +++ b/owl-bot-staging/google-cloud-workflows-executions-v1/gapic_metadata.json @@ -0,0 +1,38 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "ruby", + "protoPackage": "google.cloud.workflows.executions.v1", + "libraryPackage": "::Google::Cloud::Workflows::Executions::V1", + "services": { + "Executions": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::Workflows::Executions::V1::Executions::Client", + "rpcs": { + "ListExecutions": { + "methods": [ + "list_executions" + ] + }, + "CreateExecution": { + "methods": [ + "create_execution" + ] + }, + "GetExecution": { + "methods": [ + "get_execution" + ] + }, + "CancelExecution": { + "methods": [ + "cancel_execution" + ] + } + } + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-workflows-executions-v1/google-cloud-workflows-executions-v1.gemspec b/owl-bot-staging/google-cloud-workflows-executions-v1/google-cloud-workflows-executions-v1.gemspec new file mode 100644 index 000000000000..c95047a2fea6 --- /dev/null +++ b/owl-bot-staging/google-cloud-workflows-executions-v1/google-cloud-workflows-executions-v1.gemspec @@ -0,0 +1,28 @@ +# -*- ruby -*- +# encoding: utf-8 + +require File.expand_path("lib/google/cloud/workflows/executions/v1/version", __dir__) + +Gem::Specification.new do |gem| + gem.name = "google-cloud-workflows-executions-v1" + gem.version = Google::Cloud::Workflows::Executions::V1::VERSION + + gem.authors = ["Google LLC"] + gem.email = "googleapis-packages@google.com" + gem.description = "Workflows link series of serverless tasks together in an order you define. Combine the power of Google Cloud's APIs, serverless products like Cloud Functions and Cloud Run, and calls to external APIs to create flexible serverless applications. Workflows requires no infrastructure management and scales seamlessly with demand, including scaling down to zero.. Note that google-cloud-workflows-executions-v1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-workflows instead. See the readme for more details." + gem.summary = "Execute workflows created with Workflows API." + 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.2" + + gem.add_dependency "gapic-common", "~> 1.2" + gem.add_dependency "google-cloud-errors", "~> 1.0" +end diff --git a/owl-bot-staging/google-cloud-workflows-executions-v1/lib/google-cloud-workflows-executions-v1.rb b/owl-bot-staging/google-cloud-workflows-executions-v1/lib/google-cloud-workflows-executions-v1.rb new file mode 100644 index 000000000000..fc4b162a318b --- /dev/null +++ b/owl-bot-staging/google-cloud-workflows-executions-v1/lib/google-cloud-workflows-executions-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/workflows/executions/v1" diff --git a/owl-bot-staging/google-cloud-workflows-executions-v1/lib/google/cloud/workflows/executions/v1.rb b/owl-bot-staging/google-cloud-workflows-executions-v1/lib/google/cloud/workflows/executions/v1.rb new file mode 100644 index 000000000000..3c540505d083 --- /dev/null +++ b/owl-bot-staging/google-cloud-workflows-executions-v1/lib/google/cloud/workflows/executions/v1.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! + +require "google/cloud/workflows/executions/v1/executions" +require "google/cloud/workflows/executions/v1/version" + +module Google + module Cloud + module Workflows + module Executions + ## + # API client module. + # + # @example Load this package, including all its services, and instantiate a gRPC client + # + # require "google/cloud/workflows/executions/v1" + # client = ::Google::Cloud::Workflows::Executions::V1::Executions::Client.new + # + # @example Load this package, including all its services, and instantiate a REST client + # + # require "google/cloud/workflows/executions/v1" + # client = ::Google::Cloud::Workflows::Executions::V1::Executions::Rest::Client.new + # + module V1 + end + end + end + end +end + +helper_path = ::File.join __dir__, "v1", "_helpers.rb" +require "google/cloud/workflows/executions/v1/_helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-workflows-executions-v1/lib/google/cloud/workflows/executions/v1/executions.rb b/owl-bot-staging/google-cloud-workflows-executions-v1/lib/google/cloud/workflows/executions/v1/executions.rb new file mode 100644 index 000000000000..b39a54aa895b --- /dev/null +++ b/owl-bot-staging/google-cloud-workflows-executions-v1/lib/google/cloud/workflows/executions/v1/executions.rb @@ -0,0 +1,58 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/workflows/executions/v1/version" + +require "google/cloud/workflows/executions/v1/executions/credentials" +require "google/cloud/workflows/executions/v1/executions/paths" +require "google/cloud/workflows/executions/v1/executions/client" +require "google/cloud/workflows/executions/v1/executions/rest" + +module Google + module Cloud + module Workflows + module Executions + module V1 + ## + # Executions is used to start and manage running instances of + # [Workflows][google.cloud.workflows.v1.Workflow] called executions. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/workflows/executions/v1/executions" + # client = ::Google::Cloud::Workflows::Executions::V1::Executions::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/workflows/executions/v1/executions/rest" + # client = ::Google::Cloud::Workflows::Executions::V1::Executions::Rest::Client.new + # + module Executions + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "executions", "helpers.rb" +require "google/cloud/workflows/executions/v1/executions/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-workflows-executions-v1/lib/google/cloud/workflows/executions/v1/executions/client.rb b/owl-bot-staging/google-cloud-workflows-executions-v1/lib/google/cloud/workflows/executions/v1/executions/client.rb new file mode 100644 index 000000000000..96f7f1a299d5 --- /dev/null +++ b/owl-bot-staging/google-cloud-workflows-executions-v1/lib/google/cloud/workflows/executions/v1/executions/client.rb @@ -0,0 +1,802 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/workflows/executions/v1/executions_pb" + +module Google + module Cloud + module Workflows + module Executions + module V1 + module Executions + ## + # Client for the Executions service. + # + # Executions is used to start and manage running instances of + # [Workflows][google.cloud.workflows.v1.Workflow] called executions. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "workflowexecutions.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :executions_stub + + ## + # Configure the Executions Client class. + # + # See {::Google::Cloud::Workflows::Executions::V1::Executions::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all Executions clients + # ::Google::Cloud::Workflows::Executions::V1::Executions::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", "Workflows", "Executions", "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 + end + yield @configure if block_given? + @configure + end + + ## + # Configure the Executions 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::Workflows::Executions::V1::Executions::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 + @executions_stub.universe_domain + end + + ## + # Create a new Executions client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Workflows::Executions::V1::Executions::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Workflows::Executions::V1::Executions::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Executions 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/workflows/executions/v1/executions_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 + + @executions_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::Workflows::Executions::V1::Executions::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 + ) + + @executions_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 + end + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @executions_stub.logger + end + + # Service calls + + ## + # Returns a list of executions which belong to the workflow with + # the given name. The method returns executions of all workflow + # revisions. Returned executions are ordered by their start time (newest + # first). + # + # @overload list_executions(request, options = nil) + # Pass arguments to `list_executions` via a request object, either of type + # {::Google::Cloud::Workflows::Executions::V1::ListExecutionsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Workflows::Executions::V1::ListExecutionsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_executions(parent: nil, page_size: nil, page_token: nil, view: nil, filter: nil, order_by: nil) + # Pass arguments to `list_executions` via keyword arguments. Note that at + # least one keyword argument is 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 workflow for which the executions should be listed. + # Format: projects/\\{project}/locations/\\{location}/workflows/\\{workflow} + # @param page_size [::Integer] + # Maximum number of executions to return per call. + # Max supported value depends on the selected Execution view: it's 1000 for + # BASIC and 100 for FULL. The default value used if the field is not + # specified is 100, regardless of the selected view. Values greater than + # the max value will be coerced down to it. + # @param page_token [::String] + # A page token, received from a previous `ListExecutions` call. + # Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to `ListExecutions` must + # match the call that provided the page token. + # + # Note that pagination is applied to dynamic data. The list of executions + # returned can change between page requests. + # @param view [::Google::Cloud::Workflows::Executions::V1::ExecutionView] + # Optional. A view defining which fields should be filled in the returned + # executions. The API will default to the BASIC view. + # @param filter [::String] + # Optional. Filters applied to the [Executions.ListExecutions] results. + # The following fields are supported for filtering: + # executionID, state, startTime, endTime, duration, workflowRevisionID, + # stepName, and label. + # @param order_by [::String] + # Optional. The ordering applied to the [Executions.ListExecutions] results. + # By default the ordering is based on descending start time. + # The following fields are supported for order by: + # executionID, startTime, endTime, duration, state, and workflowRevisionID. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Workflows::Executions::V1::Execution>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::Workflows::Executions::V1::Execution>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/workflows/executions/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Workflows::Executions::V1::Executions::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Workflows::Executions::V1::ListExecutionsRequest.new + # + # # Call the list_executions method. + # result = client.list_executions 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::Workflows::Executions::V1::Execution. + # p item + # end + # + def list_executions request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workflows::Executions::V1::ListExecutionsRequest + + # Converts hash 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_executions.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::Workflows::Executions::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_executions.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_executions.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @executions_stub.call_rpc :list_executions, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @executions_stub, :list_executions, 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 + + ## + # Creates a new execution using the latest revision of the given workflow. + # + # @overload create_execution(request, options = nil) + # Pass arguments to `create_execution` via a request object, either of type + # {::Google::Cloud::Workflows::Executions::V1::CreateExecutionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Workflows::Executions::V1::CreateExecutionRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_execution(parent: nil, execution: nil) + # Pass arguments to `create_execution` via keyword arguments. Note that at + # least one keyword argument is 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 workflow for which an execution should be created. + # Format: projects/\\{project}/locations/\\{location}/workflows/\\{workflow} + # The latest revision of the workflow will be used. + # @param execution [::Google::Cloud::Workflows::Executions::V1::Execution, ::Hash] + # Required. Execution to be created. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Workflows::Executions::V1::Execution] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Workflows::Executions::V1::Execution] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/workflows/executions/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Workflows::Executions::V1::Executions::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Workflows::Executions::V1::CreateExecutionRequest.new + # + # # Call the create_execution method. + # result = client.create_execution request + # + # # The returned object is of type Google::Cloud::Workflows::Executions::V1::Execution. + # p result + # + def create_execution request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workflows::Executions::V1::CreateExecutionRequest + + # Converts hash 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_execution.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::Workflows::Executions::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_execution.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_execution.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @executions_stub.call_rpc :create_execution, 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 an execution of the given name. + # + # @overload get_execution(request, options = nil) + # Pass arguments to `get_execution` via a request object, either of type + # {::Google::Cloud::Workflows::Executions::V1::GetExecutionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Workflows::Executions::V1::GetExecutionRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_execution(name: nil, view: nil) + # Pass arguments to `get_execution` via keyword arguments. Note that at + # least one keyword argument is 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 execution to be retrieved. + # Format: + # projects/\\{project}/locations/\\{location}/workflows/\\{workflow}/executions/\\{execution} + # @param view [::Google::Cloud::Workflows::Executions::V1::ExecutionView] + # Optional. A view defining which fields should be filled in the returned + # execution. The API will default to the FULL view. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Workflows::Executions::V1::Execution] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Workflows::Executions::V1::Execution] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/workflows/executions/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Workflows::Executions::V1::Executions::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Workflows::Executions::V1::GetExecutionRequest.new + # + # # Call the get_execution method. + # result = client.get_execution request + # + # # The returned object is of type Google::Cloud::Workflows::Executions::V1::Execution. + # p result + # + def get_execution request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workflows::Executions::V1::GetExecutionRequest + + # Converts hash 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_execution.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::Workflows::Executions::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_execution.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_execution.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @executions_stub.call_rpc :get_execution, 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 + + ## + # Cancels an execution of the given name. + # + # @overload cancel_execution(request, options = nil) + # Pass arguments to `cancel_execution` via a request object, either of type + # {::Google::Cloud::Workflows::Executions::V1::CancelExecutionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Workflows::Executions::V1::CancelExecutionRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_execution(name: nil) + # Pass arguments to `cancel_execution` via keyword arguments. Note that at + # least one keyword argument is 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 execution to be cancelled. + # Format: + # projects/\\{project}/locations/\\{location}/workflows/\\{workflow}/executions/\\{execution} + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Workflows::Executions::V1::Execution] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Workflows::Executions::V1::Execution] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/workflows/executions/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Workflows::Executions::V1::Executions::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Workflows::Executions::V1::CancelExecutionRequest.new + # + # # Call the cancel_execution method. + # result = client.cancel_execution request + # + # # The returned object is of type Google::Cloud::Workflows::Executions::V1::Execution. + # p result + # + def cancel_execution request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workflows::Executions::V1::CancelExecutionRequest + + # Converts hash 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_execution.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::Workflows::Executions::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_execution.timeout, + metadata: metadata, + retry_policy: @config.rpcs.cancel_execution.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @executions_stub.call_rpc :cancel_execution, 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 Executions API. + # + # This class represents the configuration for Executions, + # 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::Workflows::Executions::V1::Executions::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_executions to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Workflows::Executions::V1::Executions::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_executions.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Workflows::Executions::V1::Executions::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_executions.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::Workflows::Executions::V1::Executions::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 = "workflowexecutions.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 Executions 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_executions` + # @return [::Gapic::Config::Method] + # + attr_reader :list_executions + ## + # RPC-specific configuration for `create_execution` + # @return [::Gapic::Config::Method] + # + attr_reader :create_execution + ## + # RPC-specific configuration for `get_execution` + # @return [::Gapic::Config::Method] + # + attr_reader :get_execution + ## + # RPC-specific configuration for `cancel_execution` + # @return [::Gapic::Config::Method] + # + attr_reader :cancel_execution + + # @private + def initialize parent_rpcs = nil + list_executions_config = parent_rpcs.list_executions if parent_rpcs.respond_to? :list_executions + @list_executions = ::Gapic::Config::Method.new list_executions_config + create_execution_config = parent_rpcs.create_execution if parent_rpcs.respond_to? :create_execution + @create_execution = ::Gapic::Config::Method.new create_execution_config + get_execution_config = parent_rpcs.get_execution if parent_rpcs.respond_to? :get_execution + @get_execution = ::Gapic::Config::Method.new get_execution_config + cancel_execution_config = parent_rpcs.cancel_execution if parent_rpcs.respond_to? :cancel_execution + @cancel_execution = ::Gapic::Config::Method.new cancel_execution_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-workflows-executions-v1/lib/google/cloud/workflows/executions/v1/executions/credentials.rb b/owl-bot-staging/google-cloud-workflows-executions-v1/lib/google/cloud/workflows/executions/v1/executions/credentials.rb new file mode 100644 index 000000000000..6a4511ebd935 --- /dev/null +++ b/owl-bot-staging/google-cloud-workflows-executions-v1/lib/google/cloud/workflows/executions/v1/executions/credentials.rb @@ -0,0 +1,53 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Workflows + module Executions + module V1 + module Executions + # Credentials for the Executions API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/cloud-platform" + ] + self.env_vars = [ + "WORKFLOWS_CREDENTIALS", + "WORKFLOWS_KEYFILE", + "GOOGLE_CLOUD_CREDENTIALS", + "GOOGLE_CLOUD_KEYFILE", + "GCLOUD_KEYFILE", + "WORKFLOWS_CREDENTIALS_JSON", + "WORKFLOWS_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 +end diff --git a/owl-bot-staging/google-cloud-workflows-executions-v1/lib/google/cloud/workflows/executions/v1/executions/paths.rb b/owl-bot-staging/google-cloud-workflows-executions-v1/lib/google/cloud/workflows/executions/v1/executions/paths.rb new file mode 100644 index 000000000000..4cbadc66f285 --- /dev/null +++ b/owl-bot-staging/google-cloud-workflows-executions-v1/lib/google/cloud/workflows/executions/v1/executions/paths.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 Cloud + module Workflows + module Executions + module V1 + module Executions + # Path helper methods for the Executions API. + module Paths + ## + # Create a fully-qualified Execution resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/workflows/{workflow}/executions/{execution}` + # + # @param project [String] + # @param location [String] + # @param workflow [String] + # @param execution [String] + # + # @return [::String] + def execution_path project:, location:, workflow:, execution: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "workflow cannot contain /" if workflow.to_s.include? "/" + + "projects/#{project}/locations/#{location}/workflows/#{workflow}/executions/#{execution}" + end + + ## + # Create a fully-qualified Workflow resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/workflows/{workflow}` + # + # @param project [String] + # @param location [String] + # @param workflow [String] + # + # @return [::String] + def workflow_path project:, location:, workflow: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/workflows/#{workflow}" + end + + extend self + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-workflows-executions-v1/lib/google/cloud/workflows/executions/v1/executions/rest.rb b/owl-bot-staging/google-cloud-workflows-executions-v1/lib/google/cloud/workflows/executions/v1/executions/rest.rb new file mode 100644 index 000000000000..46394ec79f74 --- /dev/null +++ b/owl-bot-staging/google-cloud-workflows-executions-v1/lib/google/cloud/workflows/executions/v1/executions/rest.rb @@ -0,0 +1,55 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/workflows/executions/v1/version" + +require "google/cloud/workflows/executions/v1/executions/credentials" +require "google/cloud/workflows/executions/v1/executions/paths" +require "google/cloud/workflows/executions/v1/executions/rest/client" + +module Google + module Cloud + module Workflows + module Executions + module V1 + ## + # Executions is used to start and manage running instances of + # [Workflows][google.cloud.workflows.v1.Workflow] called executions. + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/workflows/executions/v1/executions/rest" + # client = ::Google::Cloud::Workflows::Executions::V1::Executions::Rest::Client.new + # + module Executions + # Client for the REST transport + module Rest + end + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "rest", "helpers.rb" +require "google/cloud/workflows/executions/v1/executions/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-workflows-executions-v1/lib/google/cloud/workflows/executions/v1/executions/rest/client.rb b/owl-bot-staging/google-cloud-workflows-executions-v1/lib/google/cloud/workflows/executions/v1/executions/rest/client.rb new file mode 100644 index 000000000000..7fc0368a6891 --- /dev/null +++ b/owl-bot-staging/google-cloud-workflows-executions-v1/lib/google/cloud/workflows/executions/v1/executions/rest/client.rb @@ -0,0 +1,731 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/workflows/executions/v1/executions_pb" +require "google/cloud/workflows/executions/v1/executions/rest/service_stub" + +module Google + module Cloud + module Workflows + module Executions + module V1 + module Executions + module Rest + ## + # REST client for the Executions service. + # + # Executions is used to start and manage running instances of + # [Workflows][google.cloud.workflows.v1.Workflow] called executions. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "workflowexecutions.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :executions_stub + + ## + # Configure the Executions Client class. + # + # See {::Google::Cloud::Workflows::Executions::V1::Executions::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all Executions clients + # ::Google::Cloud::Workflows::Executions::V1::Executions::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", "Workflows", "Executions", "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 + end + yield @configure if block_given? + @configure + end + + ## + # Configure the Executions 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::Workflows::Executions::V1::Executions::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 + @executions_stub.universe_domain + end + + ## + # Create a new Executions REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Workflows::Executions::V1::Executions::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Workflows::Executions::V1::Executions::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Executions 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 + + @executions_stub = ::Google::Cloud::Workflows::Executions::V1::Executions::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials, + logger: @config.logger + ) + + @executions_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 + end + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @executions_stub.logger + end + + # Service calls + + ## + # Returns a list of executions which belong to the workflow with + # the given name. The method returns executions of all workflow + # revisions. Returned executions are ordered by their start time (newest + # first). + # + # @overload list_executions(request, options = nil) + # Pass arguments to `list_executions` via a request object, either of type + # {::Google::Cloud::Workflows::Executions::V1::ListExecutionsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Workflows::Executions::V1::ListExecutionsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_executions(parent: nil, page_size: nil, page_token: nil, view: nil, filter: nil, order_by: nil) + # Pass arguments to `list_executions` via keyword arguments. Note that at + # least one keyword argument is 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 workflow for which the executions should be listed. + # Format: projects/\\{project}/locations/\\{location}/workflows/\\{workflow} + # @param page_size [::Integer] + # Maximum number of executions to return per call. + # Max supported value depends on the selected Execution view: it's 1000 for + # BASIC and 100 for FULL. The default value used if the field is not + # specified is 100, regardless of the selected view. Values greater than + # the max value will be coerced down to it. + # @param page_token [::String] + # A page token, received from a previous `ListExecutions` call. + # Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to `ListExecutions` must + # match the call that provided the page token. + # + # Note that pagination is applied to dynamic data. The list of executions + # returned can change between page requests. + # @param view [::Google::Cloud::Workflows::Executions::V1::ExecutionView] + # Optional. A view defining which fields should be filled in the returned + # executions. The API will default to the BASIC view. + # @param filter [::String] + # Optional. Filters applied to the [Executions.ListExecutions] results. + # The following fields are supported for filtering: + # executionID, state, startTime, endTime, duration, workflowRevisionID, + # stepName, and label. + # @param order_by [::String] + # Optional. The ordering applied to the [Executions.ListExecutions] results. + # By default the ordering is based on descending start time. + # The following fields are supported for order by: + # executionID, startTime, endTime, duration, state, and workflowRevisionID. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Workflows::Executions::V1::Execution>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Workflows::Executions::V1::Execution>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/workflows/executions/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Workflows::Executions::V1::Executions::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Workflows::Executions::V1::ListExecutionsRequest.new + # + # # Call the list_executions method. + # result = client.list_executions 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::Workflows::Executions::V1::Execution. + # p item + # end + # + def list_executions request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workflows::Executions::V1::ListExecutionsRequest + + # Converts hash 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_executions.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::Workflows::Executions::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_executions.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_executions.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @executions_stub.list_executions request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @executions_stub, :list_executions, "executions", 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 + + ## + # Creates a new execution using the latest revision of the given workflow. + # + # @overload create_execution(request, options = nil) + # Pass arguments to `create_execution` via a request object, either of type + # {::Google::Cloud::Workflows::Executions::V1::CreateExecutionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Workflows::Executions::V1::CreateExecutionRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_execution(parent: nil, execution: nil) + # Pass arguments to `create_execution` via keyword arguments. Note that at + # least one keyword argument is 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 workflow for which an execution should be created. + # Format: projects/\\{project}/locations/\\{location}/workflows/\\{workflow} + # The latest revision of the workflow will be used. + # @param execution [::Google::Cloud::Workflows::Executions::V1::Execution, ::Hash] + # Required. Execution to be created. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Workflows::Executions::V1::Execution] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Workflows::Executions::V1::Execution] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/workflows/executions/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Workflows::Executions::V1::Executions::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Workflows::Executions::V1::CreateExecutionRequest.new + # + # # Call the create_execution method. + # result = client.create_execution request + # + # # The returned object is of type Google::Cloud::Workflows::Executions::V1::Execution. + # p result + # + def create_execution request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workflows::Executions::V1::CreateExecutionRequest + + # Converts hash 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_execution.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::Workflows::Executions::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_execution.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_execution.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @executions_stub.create_execution 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 an execution of the given name. + # + # @overload get_execution(request, options = nil) + # Pass arguments to `get_execution` via a request object, either of type + # {::Google::Cloud::Workflows::Executions::V1::GetExecutionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Workflows::Executions::V1::GetExecutionRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_execution(name: nil, view: nil) + # Pass arguments to `get_execution` via keyword arguments. Note that at + # least one keyword argument is 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 execution to be retrieved. + # Format: + # projects/\\{project}/locations/\\{location}/workflows/\\{workflow}/executions/\\{execution} + # @param view [::Google::Cloud::Workflows::Executions::V1::ExecutionView] + # Optional. A view defining which fields should be filled in the returned + # execution. The API will default to the FULL view. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Workflows::Executions::V1::Execution] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Workflows::Executions::V1::Execution] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/workflows/executions/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Workflows::Executions::V1::Executions::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Workflows::Executions::V1::GetExecutionRequest.new + # + # # Call the get_execution method. + # result = client.get_execution request + # + # # The returned object is of type Google::Cloud::Workflows::Executions::V1::Execution. + # p result + # + def get_execution request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workflows::Executions::V1::GetExecutionRequest + + # Converts hash 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_execution.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::Workflows::Executions::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_execution.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_execution.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @executions_stub.get_execution 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 + + ## + # Cancels an execution of the given name. + # + # @overload cancel_execution(request, options = nil) + # Pass arguments to `cancel_execution` via a request object, either of type + # {::Google::Cloud::Workflows::Executions::V1::CancelExecutionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Workflows::Executions::V1::CancelExecutionRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_execution(name: nil) + # Pass arguments to `cancel_execution` via keyword arguments. Note that at + # least one keyword argument is 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 execution to be cancelled. + # Format: + # projects/\\{project}/locations/\\{location}/workflows/\\{workflow}/executions/\\{execution} + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Workflows::Executions::V1::Execution] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Workflows::Executions::V1::Execution] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/workflows/executions/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Workflows::Executions::V1::Executions::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Workflows::Executions::V1::CancelExecutionRequest.new + # + # # Call the cancel_execution method. + # result = client.cancel_execution request + # + # # The returned object is of type Google::Cloud::Workflows::Executions::V1::Execution. + # p result + # + def cancel_execution request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workflows::Executions::V1::CancelExecutionRequest + + # Converts hash 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_execution.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::Workflows::Executions::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_execution.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.cancel_execution.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @executions_stub.cancel_execution 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 Executions REST API. + # + # This class represents the configuration for Executions 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::Workflows::Executions::V1::Executions::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_executions to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Workflows::Executions::V1::Executions::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_executions.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Workflows::Executions::V1::Executions::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_executions.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 = "workflowexecutions.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 Executions 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_executions` + # @return [::Gapic::Config::Method] + # + attr_reader :list_executions + ## + # RPC-specific configuration for `create_execution` + # @return [::Gapic::Config::Method] + # + attr_reader :create_execution + ## + # RPC-specific configuration for `get_execution` + # @return [::Gapic::Config::Method] + # + attr_reader :get_execution + ## + # RPC-specific configuration for `cancel_execution` + # @return [::Gapic::Config::Method] + # + attr_reader :cancel_execution + + # @private + def initialize parent_rpcs = nil + list_executions_config = parent_rpcs.list_executions if parent_rpcs.respond_to? :list_executions + @list_executions = ::Gapic::Config::Method.new list_executions_config + create_execution_config = parent_rpcs.create_execution if parent_rpcs.respond_to? :create_execution + @create_execution = ::Gapic::Config::Method.new create_execution_config + get_execution_config = parent_rpcs.get_execution if parent_rpcs.respond_to? :get_execution + @get_execution = ::Gapic::Config::Method.new get_execution_config + cancel_execution_config = parent_rpcs.cancel_execution if parent_rpcs.respond_to? :cancel_execution + @cancel_execution = ::Gapic::Config::Method.new cancel_execution_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-workflows-executions-v1/lib/google/cloud/workflows/executions/v1/executions/rest/service_stub.rb b/owl-bot-staging/google-cloud-workflows-executions-v1/lib/google/cloud/workflows/executions/v1/executions/rest/service_stub.rb new file mode 100644 index 000000000000..5c82daaa16de --- /dev/null +++ b/owl-bot-staging/google-cloud-workflows-executions-v1/lib/google/cloud/workflows/executions/v1/executions/rest/service_stub.rb @@ -0,0 +1,329 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/workflows/executions/v1/executions_pb" + +module Google + module Cloud + module Workflows + module Executions + module V1 + module Executions + module Rest + ## + # REST service stub for the Executions 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: false, + 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_executions REST call + # + # @param request_pb [::Google::Cloud::Workflows::Executions::V1::ListExecutionsRequest] + # 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::Workflows::Executions::V1::ListExecutionsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Workflows::Executions::V1::ListExecutionsResponse] + # A result object deserialized from the server's reply + def list_executions request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_executions_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_executions", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Workflows::Executions::V1::ListExecutionsResponse.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_execution REST call + # + # @param request_pb [::Google::Cloud::Workflows::Executions::V1::CreateExecutionRequest] + # 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::Workflows::Executions::V1::Execution] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Workflows::Executions::V1::Execution] + # A result object deserialized from the server's reply + def create_execution request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_execution_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_execution", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Workflows::Executions::V1::Execution.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_execution REST call + # + # @param request_pb [::Google::Cloud::Workflows::Executions::V1::GetExecutionRequest] + # 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::Workflows::Executions::V1::Execution] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Workflows::Executions::V1::Execution] + # A result object deserialized from the server's reply + def get_execution request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_execution_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_execution", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Workflows::Executions::V1::Execution.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_execution REST call + # + # @param request_pb [::Google::Cloud::Workflows::Executions::V1::CancelExecutionRequest] + # 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::Workflows::Executions::V1::Execution] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Workflows::Executions::V1::Execution] + # A result object deserialized from the server's reply + def cancel_execution request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_cancel_execution_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_execution", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Workflows::Executions::V1::Execution.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_executions REST call + # + # @param request_pb [::Google::Cloud::Workflows::Executions::V1::ListExecutionsRequest] + # 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_executions_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/executions", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/workflows/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_execution REST call + # + # @param request_pb [::Google::Cloud::Workflows::Executions::V1::CreateExecutionRequest] + # 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_execution_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/executions", + body: "execution", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/workflows/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_execution REST call + # + # @param request_pb [::Google::Cloud::Workflows::Executions::V1::GetExecutionRequest] + # 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_execution_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/workflows/[^/]+/executions/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the cancel_execution REST call + # + # @param request_pb [::Google::Cloud::Workflows::Executions::V1::CancelExecutionRequest] + # 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_execution_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:cancel", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/workflows/[^/]+/executions/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-workflows-executions-v1/lib/google/cloud/workflows/executions/v1/executions_pb.rb b/owl-bot-staging/google-cloud-workflows-executions-v1/lib/google/cloud/workflows/executions/v1/executions_pb.rb new file mode 100644 index 000000000000..58e6055652da --- /dev/null +++ b/owl-bot-staging/google-cloud-workflows-executions-v1/lib/google/cloud/workflows/executions/v1/executions_pb.rb @@ -0,0 +1,46 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/workflows/executions/v1/executions.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/duration_pb' +require 'google/protobuf/timestamp_pb' + + +descriptor_data = "\n5google/cloud/workflows/executions/v1/executions.proto\x12$google.cloud.workflows.executions.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xbd\x0e\n\tExecution\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x33\n\nstart_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x31\n\x08\x65nd_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x30\n\x08\x64uration\x18\x0c \x01(\x0b\x32\x19.google.protobuf.DurationB\x03\xe0\x41\x03\x12I\n\x05state\x18\x04 \x01(\x0e\x32\x35.google.cloud.workflows.executions.v1.Execution.StateB\x03\xe0\x41\x03\x12\x10\n\x08\x61rgument\x18\x05 \x01(\t\x12\x13\n\x06result\x18\x06 \x01(\tB\x03\xe0\x41\x03\x12I\n\x05\x65rror\x18\x07 \x01(\x0b\x32\x35.google.cloud.workflows.executions.v1.Execution.ErrorB\x03\xe0\x41\x03\x12!\n\x14workflow_revision_id\x18\x08 \x01(\tB\x03\xe0\x41\x03\x12T\n\x0e\x63\x61ll_log_level\x18\t \x01(\x0e\x32<.google.cloud.workflows.executions.v1.Execution.CallLogLevel\x12K\n\x06status\x18\n \x01(\x0b\x32\x36.google.cloud.workflows.executions.v1.Execution.StatusB\x03\xe0\x41\x03\x12K\n\x06labels\x18\x0b \x03(\x0b\x32;.google.cloud.workflows.executions.v1.Execution.LabelsEntry\x12T\n\x0bstate_error\x18\r \x01(\x0b\x32:.google.cloud.workflows.executions.v1.Execution.StateErrorB\x03\xe0\x41\x03\x1a\xca\x01\n\x11StackTraceElement\x12\x0c\n\x04step\x18\x01 \x01(\t\x12\x0f\n\x07routine\x18\x02 \x01(\t\x12\\\n\x08position\x18\x03 \x01(\x0b\x32J.google.cloud.workflows.executions.v1.Execution.StackTraceElement.Position\x1a\x38\n\x08Position\x12\x0c\n\x04line\x18\x01 \x01(\x03\x12\x0e\n\x06\x63olumn\x18\x02 \x01(\x03\x12\x0e\n\x06length\x18\x03 \x01(\x03\x1a\x61\n\nStackTrace\x12S\n\x08\x65lements\x18\x01 \x03(\x0b\x32\x41.google.cloud.workflows.executions.v1.Execution.StackTraceElement\x1az\n\x05\x45rror\x12\x0f\n\x07payload\x18\x01 \x01(\t\x12\x0f\n\x07\x63ontext\x18\x02 \x01(\t\x12O\n\x0bstack_trace\x18\x03 \x01(\x0b\x32:.google.cloud.workflows.executions.v1.Execution.StackTrace\x1a\x83\x01\n\x06Status\x12R\n\rcurrent_steps\x18\x01 \x03(\x0b\x32;.google.cloud.workflows.executions.v1.Execution.Status.Step\x1a%\n\x04Step\x12\x0f\n\x07routine\x18\x01 \x01(\t\x12\x0c\n\x04step\x18\x02 \x01(\t\x1a\x99\x01\n\nStateError\x12\x0f\n\x07\x64\x65tails\x18\x01 \x01(\t\x12M\n\x04type\x18\x02 \x01(\x0e\x32?.google.cloud.workflows.executions.v1.Execution.StateError.Type\"+\n\x04Type\x12\x14\n\x10TYPE_UNSPECIFIED\x10\x00\x12\r\n\tKMS_ERROR\x10\x01\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"q\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\n\n\x06\x41\x43TIVE\x10\x01\x12\r\n\tSUCCEEDED\x10\x02\x12\n\n\x06\x46\x41ILED\x10\x03\x12\r\n\tCANCELLED\x10\x04\x12\x0f\n\x0bUNAVAILABLE\x10\x05\x12\n\n\x06QUEUED\x10\x06\"d\n\x0c\x43\x61llLogLevel\x12\x1e\n\x1a\x43\x41LL_LOG_LEVEL_UNSPECIFIED\x10\x00\x12\x11\n\rLOG_ALL_CALLS\x10\x01\x12\x13\n\x0fLOG_ERRORS_ONLY\x10\x02\x12\x0c\n\x08LOG_NONE\x10\x03:\x86\x01\xea\x41\x82\x01\n+workflowexecutions.googleapis.com/Execution\x12Sprojects/{project}/locations/{location}/workflows/{workflow}/executions/{execution}\"\xed\x01\n\x15ListExecutionsRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!workflows.googleapis.com/Workflow\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\x12\x46\n\x04view\x18\x04 \x01(\x0e\x32\x33.google.cloud.workflows.executions.v1.ExecutionViewB\x03\xe0\x41\x01\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\"v\n\x16ListExecutionsResponse\x12\x43\n\nexecutions\x18\x01 \x03(\x0b\x32/.google.cloud.workflows.executions.v1.Execution\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\x9c\x01\n\x16\x43reateExecutionRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!workflows.googleapis.com/Workflow\x12G\n\texecution\x18\x02 \x01(\x0b\x32/.google.cloud.workflows.executions.v1.ExecutionB\x03\xe0\x41\x02\"\xa0\x01\n\x13GetExecutionRequest\x12\x41\n\x04name\x18\x01 \x01(\tB3\xe0\x41\x02\xfa\x41-\n+workflowexecutions.googleapis.com/Execution\x12\x46\n\x04view\x18\x02 \x01(\x0e\x32\x33.google.cloud.workflows.executions.v1.ExecutionViewB\x03\xe0\x41\x01\"[\n\x16\x43\x61ncelExecutionRequest\x12\x41\n\x04name\x18\x01 \x01(\tB3\xe0\x41\x02\xfa\x41-\n+workflowexecutions.googleapis.com/Execution*D\n\rExecutionView\x12\x1e\n\x1a\x45XECUTION_VIEW_UNSPECIFIED\x10\x00\x12\t\n\x05\x42\x41SIC\x10\x01\x12\x08\n\x04\x46ULL\x10\x02\x32\xc3\x07\n\nExecutions\x12\xd8\x01\n\x0eListExecutions\x12;.google.cloud.workflows.executions.v1.ListExecutionsRequest\x1a<.google.cloud.workflows.executions.v1.ListExecutionsResponse\"K\xda\x41\x06parent\x82\xd3\xe4\x93\x02<\x12:/v1/{parent=projects/*/locations/*/workflows/*}/executions\x12\xe2\x01\n\x0f\x43reateExecution\x12<.google.cloud.workflows.executions.v1.CreateExecutionRequest\x1a/.google.cloud.workflows.executions.v1.Execution\"`\xda\x41\x10parent,execution\x82\xd3\xe4\x93\x02G\":/v1/{parent=projects/*/locations/*/workflows/*}/executions:\texecution\x12\xc5\x01\n\x0cGetExecution\x12\x39.google.cloud.workflows.executions.v1.GetExecutionRequest\x1a/.google.cloud.workflows.executions.v1.Execution\"I\xda\x41\x04name\x82\xd3\xe4\x93\x02<\x12:/v1/{name=projects/*/locations/*/workflows/*/executions/*}\x12\xd5\x01\n\x0f\x43\x61ncelExecution\x12<.google.cloud.workflows.executions.v1.CancelExecutionRequest\x1a/.google.cloud.workflows.executions.v1.Execution\"S\xda\x41\x04name\x82\xd3\xe4\x93\x02\x46\"A/v1/{name=projects/*/locations/*/workflows/*/executions/*}:cancel:\x01*\x1aU\xca\x41!workflowexecutions.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\xeb\x01\n(com.google.cloud.workflows.executions.v1B\x0f\x45xecutionsProtoP\x01ZHcloud.google.com/go/workflows/executions/apiv1/executionspb;executionspb\xea\x41\x61\n!workflows.googleapis.com/Workflow\x12] + # 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. + # + # Note: This field should not be used in most cases. + 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: + # library_settings: + # 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. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Php. Clobbers the php_namespace option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.php.package_name" field + # in gapic.yaml. API teams should use the protobuf php_namespace option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # library_settings: + # php_settings: + # library_package: Google\Cloud\PubSub\V1 + 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. + # + # Example: + # + # 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 + # @!attribute [rw] batching + # @return [::Google::Api::BatchingConfigProto] + # Batching configuration for an API method in client libraries. + # + # Example of a YAML configuration: + # + # publishing: + # method_settings: + # - selector: google.example.v1.ExampleService.BatchCreateExample + # batching: + # element_count_threshold: 1000 + # request_byte_threshold: 100000000 + # delay_threshold_millis: 10 + 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. + # + # Note: This feature should not be used in most cases. + # @!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 + + # `BatchingConfigProto` defines the batching configuration for an API method. + # @!attribute [rw] thresholds + # @return [::Google::Api::BatchingSettingsProto] + # The thresholds which trigger a batched request to be sent. + # @!attribute [rw] batch_descriptor + # @return [::Google::Api::BatchingDescriptorProto] + # The request and response fields used in batching. + class BatchingConfigProto + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `BatchingSettingsProto` specifies a set of batching thresholds, each of + # which acts as a trigger to send a batch of messages as a request. At least + # one threshold must be positive nonzero. + # @!attribute [rw] element_count_threshold + # @return [::Integer] + # The number of elements of a field collected into a batch which, if + # exceeded, causes the batch to be sent. + # @!attribute [rw] request_byte_threshold + # @return [::Integer] + # The aggregated size of the batched field which, if exceeded, causes the + # batch to be sent. This size is computed by aggregating the sizes of the + # request field to be batched, not of the entire request message. + # @!attribute [rw] delay_threshold + # @return [::Google::Protobuf::Duration] + # The duration after which a batch should be sent, starting from the addition + # of the first message to that batch. + # @!attribute [rw] element_count_limit + # @return [::Integer] + # The maximum number of elements collected in a batch that could be accepted + # by server. + # @!attribute [rw] request_byte_limit + # @return [::Integer] + # The maximum size of the request that could be accepted by server. + # @!attribute [rw] flow_control_element_limit + # @return [::Integer] + # The maximum number of elements allowed by flow control. + # @!attribute [rw] flow_control_byte_limit + # @return [::Integer] + # The maximum size of data allowed by flow control. + # @!attribute [rw] flow_control_limit_exceeded_behavior + # @return [::Google::Api::FlowControlLimitExceededBehaviorProto] + # The behavior to take when the flow control limit is exceeded. + class BatchingSettingsProto + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `BatchingDescriptorProto` specifies the fields of the request message to be + # used for batching, and, optionally, the fields of the response message to be + # used for demultiplexing. + # @!attribute [rw] batched_field + # @return [::String] + # The repeated field in the request message to be aggregated by batching. + # @!attribute [rw] discriminator_fields + # @return [::Array<::String>] + # A list of the fields in the request message. Two requests will be batched + # together only if the values of every field specified in + # `request_discriminator_fields` is equal between the two requests. + # @!attribute [rw] subresponse_field + # @return [::String] + # Optional. When present, indicates the field in the response message to be + # used to demultiplex the response into multiple response messages, in + # correspondence with the multiple request messages originally batched + # together. + class BatchingDescriptorProto + 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 + + # The behavior to take when the flow control limit is exceeded. + module FlowControlLimitExceededBehaviorProto + # Default behavior, system-defined. + UNSET_BEHAVIOR = 0 + + # Stop operation, raise error. + THROW_EXCEPTION = 1 + + # Pause operation until limit clears. + BLOCK = 2 + + # Continue operation, disregard limit. + IGNORE = 3 + end + end +end diff --git a/owl-bot-staging/google-cloud-workflows-executions-v1/proto_docs/google/api/field_behavior.rb b/owl-bot-staging/google-cloud-workflows-executions-v1/proto_docs/google/api/field_behavior.rb new file mode 100644 index 000000000000..582be187d115 --- /dev/null +++ b/owl-bot-staging/google-cloud-workflows-executions-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-workflows-executions-v1/proto_docs/google/api/launch_stage.rb b/owl-bot-staging/google-cloud-workflows-executions-v1/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..9392a413fb1b --- /dev/null +++ b/owl-bot-staging/google-cloud-workflows-executions-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-workflows-executions-v1/proto_docs/google/api/resource.rb b/owl-bot-staging/google-cloud-workflows-executions-v1/proto_docs/google/api/resource.rb new file mode 100644 index 000000000000..25dec4847ac1 --- /dev/null +++ b/owl-bot-staging/google-cloud-workflows-executions-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-workflows-executions-v1/proto_docs/google/cloud/workflows/executions/v1/executions.rb b/owl-bot-staging/google-cloud-workflows-executions-v1/proto_docs/google/cloud/workflows/executions/v1/executions.rb new file mode 100644 index 000000000000..857f5d110040 --- /dev/null +++ b/owl-bot-staging/google-cloud-workflows-executions-v1/proto_docs/google/cloud/workflows/executions/v1/executions.rb @@ -0,0 +1,369 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Workflows + module Executions + module V1 + # A running instance of a + # [Workflow](/workflows/docs/reference/rest/v1/projects.locations.workflows). + # @!attribute [r] name + # @return [::String] + # Output only. The resource name of the execution. + # Format: + # projects/\\{project}/locations/\\{location}/workflows/\\{workflow}/executions/\\{execution} + # @!attribute [r] start_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Marks the beginning of execution. + # @!attribute [r] end_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Marks the end of execution, successful or not. + # @!attribute [r] duration + # @return [::Google::Protobuf::Duration] + # Output only. Measures the duration of the execution. + # @!attribute [r] state + # @return [::Google::Cloud::Workflows::Executions::V1::Execution::State] + # Output only. Current state of the execution. + # @!attribute [rw] argument + # @return [::String] + # Input parameters of the execution represented as a JSON string. + # The size limit is 32KB. + # + # *Note*: If you are using the REST API directly to run your workflow, you + # must escape any JSON string value of `argument`. Example: + # `'{"argument":"{\"firstName\":\"FIRST\",\"lastName\":\"LAST\"}"}'` + # @!attribute [r] result + # @return [::String] + # Output only. Output of the execution represented as a JSON string. The + # value can only be present if the execution's state is `SUCCEEDED`. + # @!attribute [r] error + # @return [::Google::Cloud::Workflows::Executions::V1::Execution::Error] + # Output only. The error which caused the execution to finish prematurely. + # The value is only present if the execution's state is `FAILED` + # or `CANCELLED`. + # @!attribute [r] workflow_revision_id + # @return [::String] + # Output only. Revision of the workflow this execution is using. + # @!attribute [rw] call_log_level + # @return [::Google::Cloud::Workflows::Executions::V1::Execution::CallLogLevel] + # The call logging level associated to this execution. + # @!attribute [r] status + # @return [::Google::Cloud::Workflows::Executions::V1::Execution::Status] + # Output only. Status tracks the current steps and progress data of this + # execution. + # @!attribute [rw] labels + # @return [::Google::Protobuf::Map{::String => ::String}] + # Labels associated with this execution. + # Labels can contain at most 64 entries. Keys and values can be no longer + # than 63 characters and can only contain lowercase letters, numeric + # characters, underscores, and dashes. Label keys must start with a letter. + # International characters are allowed. + # By default, labels are inherited from the workflow but are overridden by + # any labels associated with the execution. + # @!attribute [r] state_error + # @return [::Google::Cloud::Workflows::Executions::V1::Execution::StateError] + # Output only. Error regarding the state of the Execution resource. For + # example, this field will have error details if the execution data is + # unavailable due to revoked KMS key permissions. + class Execution + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # A single stack element (frame) where an error occurred. + # @!attribute [rw] step + # @return [::String] + # The step the error occurred at. + # @!attribute [rw] routine + # @return [::String] + # The routine where the error occurred. + # @!attribute [rw] position + # @return [::Google::Cloud::Workflows::Executions::V1::Execution::StackTraceElement::Position] + # The source position information of the stack trace element. + class StackTraceElement + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Position contains source position information about the stack trace + # element such as line number, column number and length of the code block + # in bytes. + # @!attribute [rw] line + # @return [::Integer] + # The source code line number the current instruction was generated from. + # @!attribute [rw] column + # @return [::Integer] + # The source code column position (of the line) the current instruction + # was generated from. + # @!attribute [rw] length + # @return [::Integer] + # The number of bytes of source code making up this stack trace element. + class Position + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # A collection of stack elements (frames) where an error occurred. + # @!attribute [rw] elements + # @return [::Array<::Google::Cloud::Workflows::Executions::V1::Execution::StackTraceElement>] + # An array of stack elements. + class StackTrace + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Error describes why the execution was abnormally terminated. + # @!attribute [rw] payload + # @return [::String] + # Error message and data returned represented as a JSON string. + # @!attribute [rw] context + # @return [::String] + # Human-readable stack trace string. + # @!attribute [rw] stack_trace + # @return [::Google::Cloud::Workflows::Executions::V1::Execution::StackTrace] + # Stack trace with detailed information of where error was generated. + class Error + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Represents the current status of this execution. + # @!attribute [rw] current_steps + # @return [::Array<::Google::Cloud::Workflows::Executions::V1::Execution::Status::Step>] + # A list of currently executing or last executed step names for the + # workflow execution currently running. If the workflow has succeeded or + # failed, this is the last attempted or executed step. Presently, if the + # current step is inside a subworkflow, the list only includes that step. + # In the future, the list will contain items for each step in the call + # stack, starting with the outermost step in the `main` subworkflow, and + # ending with the most deeply nested step. + class Status + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Represents a step of the workflow this execution is running. + # @!attribute [rw] routine + # @return [::String] + # Name of a routine within the workflow. + # @!attribute [rw] step + # @return [::String] + # Name of a step within the routine. + class Step + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # Describes an error related to the current state of the Execution resource. + # @!attribute [rw] details + # @return [::String] + # Provides specifics about the error. + # @!attribute [rw] type + # @return [::Google::Cloud::Workflows::Executions::V1::Execution::StateError::Type] + # The type of this state error. + class StateError + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes the possible types of a state error. + module Type + # No type specified. + TYPE_UNSPECIFIED = 0 + + # Caused by an issue with KMS. + KMS_ERROR = 1 + end + end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class LabelsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes the current state of the execution. More states might be added + # in the future. + module State + # Invalid state. + STATE_UNSPECIFIED = 0 + + # The execution is in progress. + ACTIVE = 1 + + # The execution finished successfully. + SUCCEEDED = 2 + + # The execution failed with an error. + FAILED = 3 + + # The execution was stopped intentionally. + CANCELLED = 4 + + # Execution data is unavailable. See the `state_error` field. + UNAVAILABLE = 5 + + # Request has been placed in the backlog for processing at a later time. + QUEUED = 6 + end + + # Describes the level of platform logging to apply to calls and call + # responses during workflow executions. + module CallLogLevel + # No call logging level specified. + CALL_LOG_LEVEL_UNSPECIFIED = 0 + + # Log all call steps within workflows, all call returns, and all exceptions + # raised. + LOG_ALL_CALLS = 1 + + # Log only exceptions that are raised from call steps within workflows. + LOG_ERRORS_ONLY = 2 + + # Explicitly log nothing. + LOG_NONE = 3 + end + end + + # Request for the + # [ListExecutions][] + # method. + # @!attribute [rw] parent + # @return [::String] + # Required. Name of the workflow for which the executions should be listed. + # Format: projects/\\{project}/locations/\\{location}/workflows/\\{workflow} + # @!attribute [rw] page_size + # @return [::Integer] + # Maximum number of executions to return per call. + # Max supported value depends on the selected Execution view: it's 1000 for + # BASIC and 100 for FULL. The default value used if the field is not + # specified is 100, regardless of the selected view. Values greater than + # the max value will be coerced down to it. + # @!attribute [rw] page_token + # @return [::String] + # A page token, received from a previous `ListExecutions` call. + # Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to `ListExecutions` must + # match the call that provided the page token. + # + # Note that pagination is applied to dynamic data. The list of executions + # returned can change between page requests. + # @!attribute [rw] view + # @return [::Google::Cloud::Workflows::Executions::V1::ExecutionView] + # Optional. A view defining which fields should be filled in the returned + # executions. The API will default to the BASIC view. + # @!attribute [rw] filter + # @return [::String] + # Optional. Filters applied to the [Executions.ListExecutions] results. + # The following fields are supported for filtering: + # executionID, state, startTime, endTime, duration, workflowRevisionID, + # stepName, and label. + # @!attribute [rw] order_by + # @return [::String] + # Optional. The ordering applied to the [Executions.ListExecutions] results. + # By default the ordering is based on descending start time. + # The following fields are supported for order by: + # executionID, startTime, endTime, duration, state, and workflowRevisionID. + class ListExecutionsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response for the + # {::Google::Cloud::Workflows::Executions::V1::Executions::Client#list_executions ListExecutions} + # method. + # @!attribute [rw] executions + # @return [::Array<::Google::Cloud::Workflows::Executions::V1::Execution>] + # The executions which match the request. + # @!attribute [rw] next_page_token + # @return [::String] + # A token, which can be sent as `page_token` to retrieve the next page. + # If this field is omitted, there are no subsequent pages. + class ListExecutionsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request for the + # {::Google::Cloud::Workflows::Executions::V1::Executions::Client#create_execution CreateExecution} + # method. + # @!attribute [rw] parent + # @return [::String] + # Required. Name of the workflow for which an execution should be created. + # Format: projects/\\{project}/locations/\\{location}/workflows/\\{workflow} + # The latest revision of the workflow will be used. + # @!attribute [rw] execution + # @return [::Google::Cloud::Workflows::Executions::V1::Execution] + # Required. Execution to be created. + class CreateExecutionRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request for the + # {::Google::Cloud::Workflows::Executions::V1::Executions::Client#get_execution GetExecution} + # method. + # @!attribute [rw] name + # @return [::String] + # Required. Name of the execution to be retrieved. + # Format: + # projects/\\{project}/locations/\\{location}/workflows/\\{workflow}/executions/\\{execution} + # @!attribute [rw] view + # @return [::Google::Cloud::Workflows::Executions::V1::ExecutionView] + # Optional. A view defining which fields should be filled in the returned + # execution. The API will default to the FULL view. + class GetExecutionRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request for the + # {::Google::Cloud::Workflows::Executions::V1::Executions::Client#cancel_execution CancelExecution} + # method. + # @!attribute [rw] name + # @return [::String] + # Required. Name of the execution to be cancelled. + # Format: + # projects/\\{project}/locations/\\{location}/workflows/\\{workflow}/executions/\\{execution} + class CancelExecutionRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Defines possible views for execution resource. + module ExecutionView + # The default / unset value. + EXECUTION_VIEW_UNSPECIFIED = 0 + + # Includes only basic metadata about the execution. + # The following fields are returned: name, start_time, end_time, duration, + # state, and workflow_revision_id. + BASIC = 1 + + # Includes all data. + FULL = 2 + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-workflows-executions-v1/proto_docs/google/protobuf/duration.rb b/owl-bot-staging/google-cloud-workflows-executions-v1/proto_docs/google/protobuf/duration.rb new file mode 100644 index 000000000000..ea59f1f91daf --- /dev/null +++ b/owl-bot-staging/google-cloud-workflows-executions-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-workflows-executions-v1/proto_docs/google/protobuf/timestamp.rb b/owl-bot-staging/google-cloud-workflows-executions-v1/proto_docs/google/protobuf/timestamp.rb new file mode 100644 index 000000000000..74352be9c58c --- /dev/null +++ b/owl-bot-staging/google-cloud-workflows-executions-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-workflows-executions-v1/snippets/Gemfile b/owl-bot-staging/google-cloud-workflows-executions-v1/snippets/Gemfile new file mode 100644 index 000000000000..7daeaea34a37 --- /dev/null +++ b/owl-bot-staging/google-cloud-workflows-executions-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-workflows-executions-v1", path: "../" +else + gem "google-cloud-workflows-executions-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-workflows-executions-v1/snippets/executions/cancel_execution.rb b/owl-bot-staging/google-cloud-workflows-executions-v1/snippets/executions/cancel_execution.rb new file mode 100644 index 000000000000..62751576d96a --- /dev/null +++ b/owl-bot-staging/google-cloud-workflows-executions-v1/snippets/executions/cancel_execution.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 workflowexecutions_v1_generated_Executions_CancelExecution_sync] +require "google/cloud/workflows/executions/v1" + +## +# Snippet for the cancel_execution call in the Executions 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::Workflows::Executions::V1::Executions::Client#cancel_execution. +# +def cancel_execution + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Workflows::Executions::V1::Executions::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Workflows::Executions::V1::CancelExecutionRequest.new + + # Call the cancel_execution method. + result = client.cancel_execution request + + # The returned object is of type Google::Cloud::Workflows::Executions::V1::Execution. + p result +end +# [END workflowexecutions_v1_generated_Executions_CancelExecution_sync] diff --git a/owl-bot-staging/google-cloud-workflows-executions-v1/snippets/executions/create_execution.rb b/owl-bot-staging/google-cloud-workflows-executions-v1/snippets/executions/create_execution.rb new file mode 100644 index 000000000000..e18a26220cc7 --- /dev/null +++ b/owl-bot-staging/google-cloud-workflows-executions-v1/snippets/executions/create_execution.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 workflowexecutions_v1_generated_Executions_CreateExecution_sync] +require "google/cloud/workflows/executions/v1" + +## +# Snippet for the create_execution call in the Executions 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::Workflows::Executions::V1::Executions::Client#create_execution. +# +def create_execution + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Workflows::Executions::V1::Executions::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Workflows::Executions::V1::CreateExecutionRequest.new + + # Call the create_execution method. + result = client.create_execution request + + # The returned object is of type Google::Cloud::Workflows::Executions::V1::Execution. + p result +end +# [END workflowexecutions_v1_generated_Executions_CreateExecution_sync] diff --git a/owl-bot-staging/google-cloud-workflows-executions-v1/snippets/executions/get_execution.rb b/owl-bot-staging/google-cloud-workflows-executions-v1/snippets/executions/get_execution.rb new file mode 100644 index 000000000000..606f5d673467 --- /dev/null +++ b/owl-bot-staging/google-cloud-workflows-executions-v1/snippets/executions/get_execution.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 workflowexecutions_v1_generated_Executions_GetExecution_sync] +require "google/cloud/workflows/executions/v1" + +## +# Snippet for the get_execution call in the Executions 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::Workflows::Executions::V1::Executions::Client#get_execution. +# +def get_execution + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Workflows::Executions::V1::Executions::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Workflows::Executions::V1::GetExecutionRequest.new + + # Call the get_execution method. + result = client.get_execution request + + # The returned object is of type Google::Cloud::Workflows::Executions::V1::Execution. + p result +end +# [END workflowexecutions_v1_generated_Executions_GetExecution_sync] diff --git a/owl-bot-staging/google-cloud-workflows-executions-v1/snippets/executions/list_executions.rb b/owl-bot-staging/google-cloud-workflows-executions-v1/snippets/executions/list_executions.rb new file mode 100644 index 000000000000..71b5474a1300 --- /dev/null +++ b/owl-bot-staging/google-cloud-workflows-executions-v1/snippets/executions/list_executions.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 workflowexecutions_v1_generated_Executions_ListExecutions_sync] +require "google/cloud/workflows/executions/v1" + +## +# Snippet for the list_executions call in the Executions 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::Workflows::Executions::V1::Executions::Client#list_executions. +# +def list_executions + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Workflows::Executions::V1::Executions::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Workflows::Executions::V1::ListExecutionsRequest.new + + # Call the list_executions method. + result = client.list_executions 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::Workflows::Executions::V1::Execution. + p item + end +end +# [END workflowexecutions_v1_generated_Executions_ListExecutions_sync] diff --git a/owl-bot-staging/google-cloud-workflows-executions-v1/snippets/snippet_metadata_google.cloud.workflows.executions.v1.json b/owl-bot-staging/google-cloud-workflows-executions-v1/snippets/snippet_metadata_google.cloud.workflows.executions.v1.json new file mode 100644 index 000000000000..8484d092b98b --- /dev/null +++ b/owl-bot-staging/google-cloud-workflows-executions-v1/snippets/snippet_metadata_google.cloud.workflows.executions.v1.json @@ -0,0 +1,175 @@ +{ + "client_library": { + "name": "google-cloud-workflows-executions-v1", + "version": "", + "language": "RUBY", + "apis": [ + { + "id": "google.cloud.workflows.executions.v1", + "version": "v1" + } + ] + }, + "snippets": [ + { + "region_tag": "workflowexecutions_v1_generated_Executions_ListExecutions_sync", + "title": "Snippet for the list_executions call in the Executions service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Workflows::Executions::V1::Executions::Client#list_executions.", + "file": "executions/list_executions.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_executions", + "full_name": "::Google::Cloud::Workflows::Executions::V1::Executions::Client#list_executions", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Workflows::Executions::V1::ListExecutionsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Workflows::Executions::V1::ListExecutionsResponse", + "client": { + "short_name": "Executions::Client", + "full_name": "::Google::Cloud::Workflows::Executions::V1::Executions::Client" + }, + "method": { + "short_name": "ListExecutions", + "full_name": "google.cloud.workflows.executions.v1.Executions.ListExecutions", + "service": { + "short_name": "Executions", + "full_name": "google.cloud.workflows.executions.v1.Executions" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "workflowexecutions_v1_generated_Executions_CreateExecution_sync", + "title": "Snippet for the create_execution call in the Executions service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Workflows::Executions::V1::Executions::Client#create_execution.", + "file": "executions/create_execution.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_execution", + "full_name": "::Google::Cloud::Workflows::Executions::V1::Executions::Client#create_execution", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Workflows::Executions::V1::CreateExecutionRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Workflows::Executions::V1::Execution", + "client": { + "short_name": "Executions::Client", + "full_name": "::Google::Cloud::Workflows::Executions::V1::Executions::Client" + }, + "method": { + "short_name": "CreateExecution", + "full_name": "google.cloud.workflows.executions.v1.Executions.CreateExecution", + "service": { + "short_name": "Executions", + "full_name": "google.cloud.workflows.executions.v1.Executions" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "workflowexecutions_v1_generated_Executions_GetExecution_sync", + "title": "Snippet for the get_execution call in the Executions service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Workflows::Executions::V1::Executions::Client#get_execution.", + "file": "executions/get_execution.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_execution", + "full_name": "::Google::Cloud::Workflows::Executions::V1::Executions::Client#get_execution", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Workflows::Executions::V1::GetExecutionRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Workflows::Executions::V1::Execution", + "client": { + "short_name": "Executions::Client", + "full_name": "::Google::Cloud::Workflows::Executions::V1::Executions::Client" + }, + "method": { + "short_name": "GetExecution", + "full_name": "google.cloud.workflows.executions.v1.Executions.GetExecution", + "service": { + "short_name": "Executions", + "full_name": "google.cloud.workflows.executions.v1.Executions" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "workflowexecutions_v1_generated_Executions_CancelExecution_sync", + "title": "Snippet for the cancel_execution call in the Executions service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Workflows::Executions::V1::Executions::Client#cancel_execution.", + "file": "executions/cancel_execution.rb", + "language": "RUBY", + "client_method": { + "short_name": "cancel_execution", + "full_name": "::Google::Cloud::Workflows::Executions::V1::Executions::Client#cancel_execution", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Workflows::Executions::V1::CancelExecutionRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Workflows::Executions::V1::Execution", + "client": { + "short_name": "Executions::Client", + "full_name": "::Google::Cloud::Workflows::Executions::V1::Executions::Client" + }, + "method": { + "short_name": "CancelExecution", + "full_name": "google.cloud.workflows.executions.v1.Executions.CancelExecution", + "service": { + "short_name": "Executions", + "full_name": "google.cloud.workflows.executions.v1.Executions" + } + } + }, + "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-workflows-executions-v1/test/google/cloud/workflows/executions/v1/executions_paths_test.rb b/owl-bot-staging/google-cloud-workflows-executions-v1/test/google/cloud/workflows/executions/v1/executions_paths_test.rb new file mode 100644 index 000000000000..72a7af7dcf6e --- /dev/null +++ b/owl-bot-staging/google-cloud-workflows-executions-v1/test/google/cloud/workflows/executions/v1/executions_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/workflows/executions/v1/executions" + +class ::Google::Cloud::Workflows::Executions::V1::Executions::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_execution_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Workflows::Executions::V1::Executions::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.execution_path project: "value0", location: "value1", workflow: "value2", execution: "value3" + assert_equal "projects/value0/locations/value1/workflows/value2/executions/value3", path + end + end + + def test_workflow_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Workflows::Executions::V1::Executions::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.workflow_path project: "value0", location: "value1", workflow: "value2" + assert_equal "projects/value0/locations/value1/workflows/value2", path + end + end +end diff --git a/owl-bot-staging/google-cloud-workflows-executions-v1/test/google/cloud/workflows/executions/v1/executions_rest_test.rb b/owl-bot-staging/google-cloud-workflows-executions-v1/test/google/cloud/workflows/executions/v1/executions_rest_test.rb new file mode 100644 index 000000000000..999aa8c8b372 --- /dev/null +++ b/owl-bot-staging/google-cloud-workflows-executions-v1/test/google/cloud/workflows/executions/v1/executions_rest_test.rb @@ -0,0 +1,322 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/workflows/executions/v1/executions_pb" +require "google/cloud/workflows/executions/v1/executions/rest" + + +class ::Google::Cloud::Workflows::Executions::V1::Executions::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_executions + # Create test objects. + client_result = ::Google::Cloud::Workflows::Executions::V1::ListExecutionsResponse.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 = :EXECUTION_VIEW_UNSPECIFIED + filter = "hello world" + order_by = "hello world" + + list_executions_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::Workflows::Executions::V1::Executions::Rest::ServiceStub.stub :transcode_list_executions_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_executions_client_stub do + # Create client + client = ::Google::Cloud::Workflows::Executions::V1::Executions::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_executions({ 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_executions 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_executions ::Google::Cloud::Workflows::Executions::V1::ListExecutionsRequest.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_executions({ 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_executions(::Google::Cloud::Workflows::Executions::V1::ListExecutionsRequest.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_executions_client_stub.call_count + end + end + end + + def test_create_execution + # Create test objects. + client_result = ::Google::Cloud::Workflows::Executions::V1::Execution.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + parent = "hello world" + execution = {} + + create_execution_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::Workflows::Executions::V1::Executions::Rest::ServiceStub.stub :transcode_create_execution_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_execution_client_stub do + # Create client + client = ::Google::Cloud::Workflows::Executions::V1::Executions::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_execution({ parent: parent, execution: execution }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_execution parent: parent, execution: execution do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_execution ::Google::Cloud::Workflows::Executions::V1::CreateExecutionRequest.new(parent: parent, execution: execution) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_execution({ parent: parent, execution: execution }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_execution(::Google::Cloud::Workflows::Executions::V1::CreateExecutionRequest.new(parent: parent, execution: execution), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_execution_client_stub.call_count + end + end + end + + def test_get_execution + # Create test objects. + client_result = ::Google::Cloud::Workflows::Executions::V1::Execution.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + view = :EXECUTION_VIEW_UNSPECIFIED + + get_execution_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::Workflows::Executions::V1::Executions::Rest::ServiceStub.stub :transcode_get_execution_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_execution_client_stub do + # Create client + client = ::Google::Cloud::Workflows::Executions::V1::Executions::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_execution({ name: name, view: view }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_execution name: name, view: view do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_execution ::Google::Cloud::Workflows::Executions::V1::GetExecutionRequest.new(name: name, view: view) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_execution({ name: name, view: view }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_execution(::Google::Cloud::Workflows::Executions::V1::GetExecutionRequest.new(name: name, view: view), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_execution_client_stub.call_count + end + end + end + + def test_cancel_execution + # Create test objects. + client_result = ::Google::Cloud::Workflows::Executions::V1::Execution.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + cancel_execution_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::Workflows::Executions::V1::Executions::Rest::ServiceStub.stub :transcode_cancel_execution_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, cancel_execution_client_stub do + # Create client + client = ::Google::Cloud::Workflows::Executions::V1::Executions::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.cancel_execution({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.cancel_execution name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.cancel_execution ::Google::Cloud::Workflows::Executions::V1::CancelExecutionRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.cancel_execution({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.cancel_execution(::Google::Cloud::Workflows::Executions::V1::CancelExecutionRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, cancel_execution_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::Workflows::Executions::V1::Executions::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::Workflows::Executions::V1::Executions::Rest::Client::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-workflows-executions-v1/test/google/cloud/workflows/executions/v1/executions_test.rb b/owl-bot-staging/google-cloud-workflows-executions-v1/test/google/cloud/workflows/executions/v1/executions_test.rb new file mode 100644 index 000000000000..ea4afdcca877 --- /dev/null +++ b/owl-bot-staging/google-cloud-workflows-executions-v1/test/google/cloud/workflows/executions/v1/executions_test.rb @@ -0,0 +1,355 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/workflows/executions/v1/executions_pb" +require "google/cloud/workflows/executions/v1/executions" + +class ::Google::Cloud::Workflows::Executions::V1::Executions::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_executions + # Create GRPC objects. + grpc_response = ::Google::Cloud::Workflows::Executions::V1::ListExecutionsResponse.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 = :EXECUTION_VIEW_UNSPECIFIED + filter = "hello world" + order_by = "hello world" + + list_executions_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_executions, name + assert_kind_of ::Google::Cloud::Workflows::Executions::V1::ListExecutionsRequest, request + assert_equal "hello world", request["parent"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + assert_equal :EXECUTION_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_executions_client_stub do + # Create client + client = ::Google::Cloud::Workflows::Executions::V1::Executions::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_executions({ 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_executions 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_executions ::Google::Cloud::Workflows::Executions::V1::ListExecutionsRequest.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_executions({ 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_executions(::Google::Cloud::Workflows::Executions::V1::ListExecutionsRequest.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_executions_client_stub.call_rpc_count + end + end + + def test_create_execution + # Create GRPC objects. + grpc_response = ::Google::Cloud::Workflows::Executions::V1::Execution.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" + execution = {} + + create_execution_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_execution, name + assert_kind_of ::Google::Cloud::Workflows::Executions::V1::CreateExecutionRequest, request + assert_equal "hello world", request["parent"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Workflows::Executions::V1::Execution), request["execution"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_execution_client_stub do + # Create client + client = ::Google::Cloud::Workflows::Executions::V1::Executions::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_execution({ parent: parent, execution: execution }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.create_execution parent: parent, execution: execution do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.create_execution ::Google::Cloud::Workflows::Executions::V1::CreateExecutionRequest.new(parent: parent, execution: execution) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.create_execution({ parent: parent, execution: execution }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.create_execution(::Google::Cloud::Workflows::Executions::V1::CreateExecutionRequest.new(parent: parent, execution: execution), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, create_execution_client_stub.call_rpc_count + end + end + + def test_get_execution + # Create GRPC objects. + grpc_response = ::Google::Cloud::Workflows::Executions::V1::Execution.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" + view = :EXECUTION_VIEW_UNSPECIFIED + + get_execution_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_execution, name + assert_kind_of ::Google::Cloud::Workflows::Executions::V1::GetExecutionRequest, request + assert_equal "hello world", request["name"] + assert_equal :EXECUTION_VIEW_UNSPECIFIED, request["view"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_execution_client_stub do + # Create client + client = ::Google::Cloud::Workflows::Executions::V1::Executions::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_execution({ name: name, view: view }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_execution name: name, view: view do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_execution ::Google::Cloud::Workflows::Executions::V1::GetExecutionRequest.new(name: name, view: view) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_execution({ name: name, view: view }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_execution(::Google::Cloud::Workflows::Executions::V1::GetExecutionRequest.new(name: name, view: view), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_execution_client_stub.call_rpc_count + end + end + + def test_cancel_execution + # Create GRPC objects. + grpc_response = ::Google::Cloud::Workflows::Executions::V1::Execution.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_execution_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :cancel_execution, name + assert_kind_of ::Google::Cloud::Workflows::Executions::V1::CancelExecutionRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, cancel_execution_client_stub do + # Create client + client = ::Google::Cloud::Workflows::Executions::V1::Executions::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.cancel_execution({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.cancel_execution name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.cancel_execution ::Google::Cloud::Workflows::Executions::V1::CancelExecutionRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.cancel_execution({ 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_execution(::Google::Cloud::Workflows::Executions::V1::CancelExecutionRequest.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_execution_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::Workflows::Executions::V1::Executions::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::Workflows::Executions::V1::Executions::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::Workflows::Executions::V1::Executions::Client.new do |config| + config.credentials = creds + end + assert_kind_of ::Google::Cloud::Workflows::Executions::V1::Executions::Client, client + assert_equal creds, client.configure.credentials + end + end +end diff --git a/owl-bot-staging/google-cloud-workflows-executions-v1/test/helper.rb b/owl-bot-staging/google-cloud-workflows-executions-v1/test/helper.rb new file mode 100644 index 000000000000..672b337030e7 --- /dev/null +++ b/owl-bot-staging/google-cloud-workflows-executions-v1/test/helper.rb @@ -0,0 +1,26 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/mock" +require "minitest/rg" + +require "grpc" + +require "ostruct" diff --git a/owl-bot-staging/google-cloud-workflows-executions-v1beta/.gitignore b/owl-bot-staging/google-cloud-workflows-executions-v1beta/.gitignore new file mode 100644 index 000000000000..0135b6bc6cfc --- /dev/null +++ b/owl-bot-staging/google-cloud-workflows-executions-v1beta/.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-workflows-executions-v1beta/.repo-metadata.json b/owl-bot-staging/google-cloud-workflows-executions-v1beta/.repo-metadata.json new file mode 100644 index 000000000000..e81c837b52ed --- /dev/null +++ b/owl-bot-staging/google-cloud-workflows-executions-v1beta/.repo-metadata.json @@ -0,0 +1,18 @@ +{ + "api_id": "workflowexecutions.googleapis.com", + "api_shortname": "workflowexecutions", + "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-workflows-executions-v1beta/latest", + "distribution_name": "google-cloud-workflows-executions-v1beta", + "is_cloud": true, + "language": "ruby", + "name": "workflowexecutions", + "name_pretty": "Workflows Executions V1beta API", + "product_documentation": "https://cloud.google.com/workflows/", + "release_level": "unreleased", + "repo": "googleapis/google-cloud-ruby", + "requires_billing": true, + "ruby-cloud-description": "Workflows link series of serverless tasks together in an order you define. Combine the power of Google Cloud's APIs, serverless products like Cloud Functions and Cloud Run, and calls to external APIs to create flexible serverless applications. Workflows requires no infrastructure management and scales seamlessly with demand, including scaling down to zero.. Note that google-cloud-workflows-executions-v1beta is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-workflows instead. See the readme for more details.", + "ruby-cloud-env-prefix": "WORKFLOWS", + "ruby-cloud-product-url": "https://cloud.google.com/workflows/", + "library_type": "GAPIC_AUTO" +} diff --git a/owl-bot-staging/google-cloud-workflows-executions-v1beta/.rubocop.yml b/owl-bot-staging/google-cloud-workflows-executions-v1beta/.rubocop.yml new file mode 100644 index 000000000000..307c124f8568 --- /dev/null +++ b/owl-bot-staging/google-cloud-workflows-executions-v1beta/.rubocop.yml @@ -0,0 +1,33 @@ +inherit_gem: + google-style: google-style.yml + +AllCops: + Exclude: + - "google-cloud-workflows-executions-v1beta.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-workflows-executions-v1beta.rb" diff --git a/owl-bot-staging/google-cloud-workflows-executions-v1beta/.toys.rb b/owl-bot-staging/google-cloud-workflows-executions-v1beta/.toys.rb new file mode 100644 index 000000000000..177e22456e8a --- /dev/null +++ b/owl-bot-staging/google-cloud-workflows-executions-v1beta/.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-workflows-executions-v1beta/.yardopts b/owl-bot-staging/google-cloud-workflows-executions-v1beta/.yardopts new file mode 100644 index 000000000000..59f0a9e09511 --- /dev/null +++ b/owl-bot-staging/google-cloud-workflows-executions-v1beta/.yardopts @@ -0,0 +1,12 @@ +--no-private +--title="Workflows Executions V1beta 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-workflows-executions-v1beta/AUTHENTICATION.md b/owl-bot-staging/google-cloud-workflows-executions-v1beta/AUTHENTICATION.md new file mode 100644 index 000000000000..4d061343a486 --- /dev/null +++ b/owl-bot-staging/google-cloud-workflows-executions-v1beta/AUTHENTICATION.md @@ -0,0 +1,122 @@ +# Authentication + +The recommended way to authenticate to the google-cloud-workflows-executions-v1beta 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-workflows-executions-v1beta 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/workflows/executions/v1beta" + +client = ::Google::Cloud::Workflows::Executions::V1beta::Executions::Client.new do |config| + config.credentials = "path/to/credentialfile.json" +end +``` + +To configure a credentials file globally for all clients: + +```ruby +require "google/cloud/workflows/executions/v1beta" + +::Google::Cloud::Workflows::Executions::V1beta::Executions::Client.configure do |config| + config.credentials = "path/to/credentialfile.json" +end + +client = ::Google::Cloud::Workflows::Executions::V1beta::Executions::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-workflows-executions-v1beta +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/workflows/executions/v1beta" + +ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" + +client = ::Google::Cloud::Workflows::Executions::V1beta::Executions::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-workflows-executions-v1beta/CHANGELOG.md b/owl-bot-staging/google-cloud-workflows-executions-v1beta/CHANGELOG.md new file mode 100644 index 000000000000..f88957a62ba2 --- /dev/null +++ b/owl-bot-staging/google-cloud-workflows-executions-v1beta/CHANGELOG.md @@ -0,0 +1,2 @@ +# Release History + diff --git a/owl-bot-staging/google-cloud-workflows-executions-v1beta/Gemfile b/owl-bot-staging/google-cloud-workflows-executions-v1beta/Gemfile new file mode 100644 index 000000000000..1d08558908d8 --- /dev/null +++ b/owl-bot-staging/google-cloud-workflows-executions-v1beta/Gemfile @@ -0,0 +1,14 @@ +source "https://rubygems.org" + +gemspec + +gem "google-style", "~> 1.32.0" +gem "irb", "~> 1.17" +gem "minitest", "~> 6.0.2" +gem "minitest-focus", "~> 1.4" +gem "minitest-mock", "~> 5.27" +gem "minitest-rg", "~> 5.3" +gem "ostruct", "~> 0.5.5" +gem "rake", ">= 13.0" +gem "redcarpet", "~> 3.6" +gem "yard", "~> 0.9" diff --git a/owl-bot-staging/google-cloud-workflows-executions-v1beta/LICENSE.md b/owl-bot-staging/google-cloud-workflows-executions-v1beta/LICENSE.md new file mode 100644 index 000000000000..c261857ba6ad --- /dev/null +++ b/owl-bot-staging/google-cloud-workflows-executions-v1beta/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-workflows-executions-v1beta/README.md b/owl-bot-staging/google-cloud-workflows-executions-v1beta/README.md new file mode 100644 index 000000000000..006a8fe26b14 --- /dev/null +++ b/owl-bot-staging/google-cloud-workflows-executions-v1beta/README.md @@ -0,0 +1,154 @@ +# Ruby Client for the Workflows Executions V1beta API + +Manages user-provided workflows. + +Workflows link series of serverless tasks together in an order you define. Combine the power of Google Cloud's APIs, serverless products like Cloud Functions and Cloud Run, and calls to external APIs to create flexible serverless applications. Workflows requires no infrastructure management and scales seamlessly with demand, including scaling down to zero.. + +https://github.com/googleapis/google-cloud-ruby + +This gem is a _versioned_ client. It provides basic client classes for a +specific version of the Workflows Executions V1beta API. Most users should consider using +the main client gem, +[google-cloud-workflows](https://rubygems.org/gems/google-cloud-workflows). +See the section below titled *Which client should I use?* for more information. + +## Installation + +``` +$ gem install google-cloud-workflows-executions-v1beta +``` + +## 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/workflowexecutions.googleapis.com) +1. [Set up authentication.](AUTHENTICATION.md) + +## Quick Start + +```ruby +require "google/cloud/workflows/executions/v1beta" + +client = ::Google::Cloud::Workflows::Executions::V1beta::Executions::Client.new +request = ::Google::Cloud::Workflows::Executions::V1beta::ListExecutionsRequest.new # (request fields as keyword arguments...) +response = client.list_executions request +``` + +View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-workflows-executions-v1beta/latest) +for class and method documentation. + +See also the [Product Documentation](https://cloud.google.com/workflows/) +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/workflows/executions/v1beta" +require "logger" + +client = ::Google::Cloud::Workflows::Executions::V1beta::Executions::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-workflows`, +and lower-level _versioned_ client libraries with names such as +`google-cloud-workflows-executions-v1beta`. +_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-workflows`. +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-workflows-executions-v1beta`. + +### 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-workflows-executions-v1beta/Rakefile b/owl-bot-staging/google-cloud-workflows-executions-v1beta/Rakefile new file mode 100644 index 000000000000..fa9f3f6dac59 --- /dev/null +++ b/owl-bot-staging/google-cloud-workflows-executions-v1beta/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-workflows-executions-v1beta acceptance tests." +task :acceptance, :project, :keyfile do |t, args| + project = args[:project] + project ||= + ENV["WORKFLOWS_TEST_PROJECT"] || + ENV["GCLOUD_TEST_PROJECT"] + keyfile = args[:keyfile] + keyfile ||= + ENV["WORKFLOWS_TEST_KEYFILE"] || + ENV["GCLOUD_TEST_KEYFILE"] + if keyfile + keyfile = File.read keyfile + else + keyfile ||= + ENV["WORKFLOWS_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 WORKFLOWS_TEST_PROJECT=test123 WORKFLOWS_TEST_KEYFILE=/path/to/keyfile.json rake acceptance" + end + require "google/cloud/workflows/executions/v1beta/executions/credentials" + ::Google::Cloud::Workflows::Executions::V1beta::Executions::Credentials.env_vars.each do |path| + ENV[path] = nil + end + ENV["WORKFLOWS_PROJECT"] = project + ENV["WORKFLOWS_TEST_PROJECT"] = project + ENV["WORKFLOWS_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-workflows-executions-v1beta 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-workflows-executions-v1beta 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-workflows-executions-v1beta 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-workflows-executions-v1beta gem does not have doctest tests." +end + +desc "Run the CI build" +task :ci do + header "BUILDING google-cloud-workflows-executions-v1beta" + header "google-cloud-workflows-executions-v1beta rubocop", "*" + Rake::Task[:rubocop].invoke + header "google-cloud-workflows-executions-v1beta yard", "*" + Rake::Task[:yard].invoke + header "google-cloud-workflows-executions-v1beta 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-workflows-executions-v1beta 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-workflows-executions-v1beta 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-workflows-executions-v1beta/gapic_metadata.json b/owl-bot-staging/google-cloud-workflows-executions-v1beta/gapic_metadata.json new file mode 100644 index 000000000000..48333bd150d0 --- /dev/null +++ b/owl-bot-staging/google-cloud-workflows-executions-v1beta/gapic_metadata.json @@ -0,0 +1,38 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "ruby", + "protoPackage": "google.cloud.workflows.executions.v1beta", + "libraryPackage": "::Google::Cloud::Workflows::Executions::V1beta", + "services": { + "Executions": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::Workflows::Executions::V1beta::Executions::Client", + "rpcs": { + "ListExecutions": { + "methods": [ + "list_executions" + ] + }, + "CreateExecution": { + "methods": [ + "create_execution" + ] + }, + "GetExecution": { + "methods": [ + "get_execution" + ] + }, + "CancelExecution": { + "methods": [ + "cancel_execution" + ] + } + } + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-workflows-executions-v1beta/google-cloud-workflows-executions-v1beta.gemspec b/owl-bot-staging/google-cloud-workflows-executions-v1beta/google-cloud-workflows-executions-v1beta.gemspec new file mode 100644 index 000000000000..8711f18b4285 --- /dev/null +++ b/owl-bot-staging/google-cloud-workflows-executions-v1beta/google-cloud-workflows-executions-v1beta.gemspec @@ -0,0 +1,28 @@ +# -*- ruby -*- +# encoding: utf-8 + +require File.expand_path("lib/google/cloud/workflows/executions/v1beta/version", __dir__) + +Gem::Specification.new do |gem| + gem.name = "google-cloud-workflows-executions-v1beta" + gem.version = Google::Cloud::Workflows::Executions::V1beta::VERSION + + gem.authors = ["Google LLC"] + gem.email = "googleapis-packages@google.com" + gem.description = "Workflows link series of serverless tasks together in an order you define. Combine the power of Google Cloud's APIs, serverless products like Cloud Functions and Cloud Run, and calls to external APIs to create flexible serverless applications. Workflows requires no infrastructure management and scales seamlessly with demand, including scaling down to zero.. Note that google-cloud-workflows-executions-v1beta is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-workflows instead. See the readme for more details." + gem.summary = "Manages user-provided workflows." + 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.2" + + gem.add_dependency "gapic-common", "~> 1.2" + gem.add_dependency "google-cloud-errors", "~> 1.0" +end diff --git a/owl-bot-staging/google-cloud-workflows-executions-v1beta/lib/google-cloud-workflows-executions-v1beta.rb b/owl-bot-staging/google-cloud-workflows-executions-v1beta/lib/google-cloud-workflows-executions-v1beta.rb new file mode 100644 index 000000000000..2e0636bb1b59 --- /dev/null +++ b/owl-bot-staging/google-cloud-workflows-executions-v1beta/lib/google-cloud-workflows-executions-v1beta.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/workflows/executions/v1beta" diff --git a/owl-bot-staging/google-cloud-workflows-executions-v1beta/lib/google/cloud/workflows/executions/v1beta.rb b/owl-bot-staging/google-cloud-workflows-executions-v1beta/lib/google/cloud/workflows/executions/v1beta.rb new file mode 100644 index 000000000000..f86ef8bc398c --- /dev/null +++ b/owl-bot-staging/google-cloud-workflows-executions-v1beta/lib/google/cloud/workflows/executions/v1beta.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/workflows/executions/v1beta/executions" +require "google/cloud/workflows/executions/v1beta/version" + +module Google + module Cloud + module Workflows + module Executions + ## + # API client module. + # + # @example Load this package, including all its services, and instantiate a gRPC client + # + # require "google/cloud/workflows/executions/v1beta" + # client = ::Google::Cloud::Workflows::Executions::V1beta::Executions::Client.new + # + module V1beta + end + end + end + end +end + +helper_path = ::File.join __dir__, "v1beta", "_helpers.rb" +require "google/cloud/workflows/executions/v1beta/_helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-workflows-executions-v1beta/lib/google/cloud/workflows/executions/v1beta/executions.rb b/owl-bot-staging/google-cloud-workflows-executions-v1beta/lib/google/cloud/workflows/executions/v1beta/executions.rb new file mode 100644 index 000000000000..10f6adbe5ec1 --- /dev/null +++ b/owl-bot-staging/google-cloud-workflows-executions-v1beta/lib/google/cloud/workflows/executions/v1beta/executions.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 "gapic/common" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/workflows/executions/v1beta/version" + +require "google/cloud/workflows/executions/v1beta/executions/credentials" +require "google/cloud/workflows/executions/v1beta/executions/paths" +require "google/cloud/workflows/executions/v1beta/executions/client" + +module Google + module Cloud + module Workflows + module Executions + module V1beta + ## + # Executions is used to start and manage running instances of + # [Workflows][google.cloud.workflows.v1beta.Workflow] called executions. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/workflows/executions/v1beta/executions" + # client = ::Google::Cloud::Workflows::Executions::V1beta::Executions::Client.new + # + module Executions + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "executions", "helpers.rb" +require "google/cloud/workflows/executions/v1beta/executions/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-workflows-executions-v1beta/lib/google/cloud/workflows/executions/v1beta/executions/client.rb b/owl-bot-staging/google-cloud-workflows-executions-v1beta/lib/google/cloud/workflows/executions/v1beta/executions/client.rb new file mode 100644 index 000000000000..2bfac81e7856 --- /dev/null +++ b/owl-bot-staging/google-cloud-workflows-executions-v1beta/lib/google/cloud/workflows/executions/v1beta/executions/client.rb @@ -0,0 +1,789 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/workflows/executions/v1beta/executions_pb" + +module Google + module Cloud + module Workflows + module Executions + module V1beta + module Executions + ## + # Client for the Executions service. + # + # Executions is used to start and manage running instances of + # [Workflows][google.cloud.workflows.v1beta.Workflow] called executions. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "workflowexecutions.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :executions_stub + + ## + # Configure the Executions Client class. + # + # See {::Google::Cloud::Workflows::Executions::V1beta::Executions::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all Executions clients + # ::Google::Cloud::Workflows::Executions::V1beta::Executions::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", "Workflows", "Executions", "V1beta"] + 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 + end + yield @configure if block_given? + @configure + end + + ## + # Configure the Executions 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::Workflows::Executions::V1beta::Executions::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 + @executions_stub.universe_domain + end + + ## + # Create a new Executions client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Workflows::Executions::V1beta::Executions::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Workflows::Executions::V1beta::Executions::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Executions 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/workflows/executions/v1beta/executions_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 + + @executions_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::Workflows::Executions::V1beta::Executions::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 + ) + + @executions_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 + end + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @executions_stub.logger + end + + # Service calls + + ## + # Returns a list of executions which belong to the workflow with + # the given name. The method returns executions of all workflow + # revisions. Returned executions are ordered by their start time (newest + # first). + # + # @overload list_executions(request, options = nil) + # Pass arguments to `list_executions` via a request object, either of type + # {::Google::Cloud::Workflows::Executions::V1beta::ListExecutionsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Workflows::Executions::V1beta::ListExecutionsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_executions(parent: nil, page_size: nil, page_token: nil, view: nil) + # Pass arguments to `list_executions` via keyword arguments. Note that at + # least one keyword argument is 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 workflow for which the executions should be listed. + # Format: projects/\\{project}/locations/\\{location}/workflows/\\{workflow} + # @param page_size [::Integer] + # Maximum number of executions to return per call. + # Max supported value depends on the selected Execution view: it's 10000 for + # BASIC and 100 for FULL. The default value used if the field is not + # specified is 100, regardless of the selected view. Values greater than + # the max value will be coerced down to it. + # @param page_token [::String] + # A page token, received from a previous `ListExecutions` call. + # Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to `ListExecutions` must + # match the call that provided the page token. + # @param view [::Google::Cloud::Workflows::Executions::V1beta::ExecutionView] + # Optional. A view defining which fields should be filled in the returned executions. + # The API will default to the BASIC view. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Workflows::Executions::V1beta::Execution>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::Workflows::Executions::V1beta::Execution>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/workflows/executions/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Workflows::Executions::V1beta::Executions::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Workflows::Executions::V1beta::ListExecutionsRequest.new + # + # # Call the list_executions method. + # result = client.list_executions 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::Workflows::Executions::V1beta::Execution. + # p item + # end + # + def list_executions request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workflows::Executions::V1beta::ListExecutionsRequest + + # Converts hash 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_executions.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::Workflows::Executions::V1beta::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_executions.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_executions.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @executions_stub.call_rpc :list_executions, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @executions_stub, :list_executions, 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 + + ## + # Creates a new execution using the latest revision of the given workflow. + # + # @overload create_execution(request, options = nil) + # Pass arguments to `create_execution` via a request object, either of type + # {::Google::Cloud::Workflows::Executions::V1beta::CreateExecutionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Workflows::Executions::V1beta::CreateExecutionRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_execution(parent: nil, execution: nil) + # Pass arguments to `create_execution` via keyword arguments. Note that at + # least one keyword argument is 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 workflow for which an execution should be created. + # Format: projects/\\{project}/locations/\\{location}/workflows/\\{workflow} + # The latest revision of the workflow will be used. + # @param execution [::Google::Cloud::Workflows::Executions::V1beta::Execution, ::Hash] + # Required. Execution to be created. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Workflows::Executions::V1beta::Execution] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Workflows::Executions::V1beta::Execution] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/workflows/executions/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Workflows::Executions::V1beta::Executions::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Workflows::Executions::V1beta::CreateExecutionRequest.new + # + # # Call the create_execution method. + # result = client.create_execution request + # + # # The returned object is of type Google::Cloud::Workflows::Executions::V1beta::Execution. + # p result + # + def create_execution request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workflows::Executions::V1beta::CreateExecutionRequest + + # Converts hash 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_execution.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::Workflows::Executions::V1beta::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_execution.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_execution.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @executions_stub.call_rpc :create_execution, 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 an execution of the given name. + # + # @overload get_execution(request, options = nil) + # Pass arguments to `get_execution` via a request object, either of type + # {::Google::Cloud::Workflows::Executions::V1beta::GetExecutionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Workflows::Executions::V1beta::GetExecutionRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_execution(name: nil, view: nil) + # Pass arguments to `get_execution` via keyword arguments. Note that at + # least one keyword argument is 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 execution to be retrieved. + # Format: + # projects/\\{project}/locations/\\{location}/workflows/\\{workflow}/executions/\\{execution} + # @param view [::Google::Cloud::Workflows::Executions::V1beta::ExecutionView] + # Optional. A view defining which fields should be filled in the returned execution. + # The API will default to the FULL view. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Workflows::Executions::V1beta::Execution] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Workflows::Executions::V1beta::Execution] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/workflows/executions/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Workflows::Executions::V1beta::Executions::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Workflows::Executions::V1beta::GetExecutionRequest.new + # + # # Call the get_execution method. + # result = client.get_execution request + # + # # The returned object is of type Google::Cloud::Workflows::Executions::V1beta::Execution. + # p result + # + def get_execution request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workflows::Executions::V1beta::GetExecutionRequest + + # Converts hash 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_execution.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::Workflows::Executions::V1beta::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_execution.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_execution.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @executions_stub.call_rpc :get_execution, 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 + + ## + # Cancels an execution of the given name. + # + # @overload cancel_execution(request, options = nil) + # Pass arguments to `cancel_execution` via a request object, either of type + # {::Google::Cloud::Workflows::Executions::V1beta::CancelExecutionRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Workflows::Executions::V1beta::CancelExecutionRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_execution(name: nil) + # Pass arguments to `cancel_execution` via keyword arguments. Note that at + # least one keyword argument is 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 execution to be cancelled. + # Format: + # projects/\\{project}/locations/\\{location}/workflows/\\{workflow}/executions/\\{execution} + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Workflows::Executions::V1beta::Execution] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Workflows::Executions::V1beta::Execution] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/workflows/executions/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Workflows::Executions::V1beta::Executions::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Workflows::Executions::V1beta::CancelExecutionRequest.new + # + # # Call the cancel_execution method. + # result = client.cancel_execution request + # + # # The returned object is of type Google::Cloud::Workflows::Executions::V1beta::Execution. + # p result + # + def cancel_execution request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workflows::Executions::V1beta::CancelExecutionRequest + + # Converts hash 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_execution.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::Workflows::Executions::V1beta::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_execution.timeout, + metadata: metadata, + retry_policy: @config.rpcs.cancel_execution.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @executions_stub.call_rpc :cancel_execution, 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 Executions API. + # + # This class represents the configuration for Executions, + # 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::Workflows::Executions::V1beta::Executions::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_executions to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Workflows::Executions::V1beta::Executions::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_executions.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Workflows::Executions::V1beta::Executions::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_executions.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::Workflows::Executions::V1beta::Executions::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 = "workflowexecutions.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 Executions 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_executions` + # @return [::Gapic::Config::Method] + # + attr_reader :list_executions + ## + # RPC-specific configuration for `create_execution` + # @return [::Gapic::Config::Method] + # + attr_reader :create_execution + ## + # RPC-specific configuration for `get_execution` + # @return [::Gapic::Config::Method] + # + attr_reader :get_execution + ## + # RPC-specific configuration for `cancel_execution` + # @return [::Gapic::Config::Method] + # + attr_reader :cancel_execution + + # @private + def initialize parent_rpcs = nil + list_executions_config = parent_rpcs.list_executions if parent_rpcs.respond_to? :list_executions + @list_executions = ::Gapic::Config::Method.new list_executions_config + create_execution_config = parent_rpcs.create_execution if parent_rpcs.respond_to? :create_execution + @create_execution = ::Gapic::Config::Method.new create_execution_config + get_execution_config = parent_rpcs.get_execution if parent_rpcs.respond_to? :get_execution + @get_execution = ::Gapic::Config::Method.new get_execution_config + cancel_execution_config = parent_rpcs.cancel_execution if parent_rpcs.respond_to? :cancel_execution + @cancel_execution = ::Gapic::Config::Method.new cancel_execution_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-workflows-executions-v1beta/lib/google/cloud/workflows/executions/v1beta/executions/credentials.rb b/owl-bot-staging/google-cloud-workflows-executions-v1beta/lib/google/cloud/workflows/executions/v1beta/executions/credentials.rb new file mode 100644 index 000000000000..82a81fac37cc --- /dev/null +++ b/owl-bot-staging/google-cloud-workflows-executions-v1beta/lib/google/cloud/workflows/executions/v1beta/executions/credentials.rb @@ -0,0 +1,53 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Workflows + module Executions + module V1beta + module Executions + # Credentials for the Executions API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/cloud-platform" + ] + self.env_vars = [ + "WORKFLOWS_CREDENTIALS", + "WORKFLOWS_KEYFILE", + "GOOGLE_CLOUD_CREDENTIALS", + "GOOGLE_CLOUD_KEYFILE", + "GCLOUD_KEYFILE", + "WORKFLOWS_CREDENTIALS_JSON", + "WORKFLOWS_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 +end diff --git a/owl-bot-staging/google-cloud-workflows-executions-v1beta/lib/google/cloud/workflows/executions/v1beta/executions/paths.rb b/owl-bot-staging/google-cloud-workflows-executions-v1beta/lib/google/cloud/workflows/executions/v1beta/executions/paths.rb new file mode 100644 index 000000000000..91d5836ff754 --- /dev/null +++ b/owl-bot-staging/google-cloud-workflows-executions-v1beta/lib/google/cloud/workflows/executions/v1beta/executions/paths.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 Cloud + module Workflows + module Executions + module V1beta + module Executions + # Path helper methods for the Executions API. + module Paths + ## + # Create a fully-qualified Execution resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/workflows/{workflow}/executions/{execution}` + # + # @param project [String] + # @param location [String] + # @param workflow [String] + # @param execution [String] + # + # @return [::String] + def execution_path project:, location:, workflow:, execution: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "workflow cannot contain /" if workflow.to_s.include? "/" + + "projects/#{project}/locations/#{location}/workflows/#{workflow}/executions/#{execution}" + end + + ## + # Create a fully-qualified Workflow resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/workflows/{workflow}` + # + # @param project [String] + # @param location [String] + # @param workflow [String] + # + # @return [::String] + def workflow_path project:, location:, workflow: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/workflows/#{workflow}" + end + + extend self + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-workflows-executions-v1beta/lib/google/cloud/workflows/executions/v1beta/executions_pb.rb b/owl-bot-staging/google-cloud-workflows-executions-v1beta/lib/google/cloud/workflows/executions/v1beta/executions_pb.rb new file mode 100644 index 000000000000..240d00363b7a --- /dev/null +++ b/owl-bot-staging/google-cloud-workflows-executions-v1beta/lib/google/cloud/workflows/executions/v1beta/executions_pb.rb @@ -0,0 +1,37 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/workflows/executions/v1beta/executions.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/timestamp_pb' + + +descriptor_data = "\n9google/cloud/workflows/executions/v1beta/executions.proto\x12(google.cloud.workflows.executions.v1beta\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xf8\x04\n\tExecution\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x33\n\nstart_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x31\n\x08\x65nd_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12M\n\x05state\x18\x04 \x01(\x0e\x32\x39.google.cloud.workflows.executions.v1beta.Execution.StateB\x03\xe0\x41\x03\x12\x10\n\x08\x61rgument\x18\x05 \x01(\t\x12\x13\n\x06result\x18\x06 \x01(\tB\x03\xe0\x41\x03\x12M\n\x05\x65rror\x18\x07 \x01(\x0b\x32\x39.google.cloud.workflows.executions.v1beta.Execution.ErrorB\x03\xe0\x41\x03\x12!\n\x14workflow_revision_id\x18\x08 \x01(\tB\x03\xe0\x41\x03\x1a)\n\x05\x45rror\x12\x0f\n\x07payload\x18\x01 \x01(\t\x12\x0f\n\x07\x63ontext\x18\x02 \x01(\t\"T\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\n\n\x06\x41\x43TIVE\x10\x01\x12\r\n\tSUCCEEDED\x10\x02\x12\n\n\x06\x46\x41ILED\x10\x03\x12\r\n\tCANCELLED\x10\x04:\x86\x01\xea\x41\x82\x01\n+workflowexecutions.googleapis.com/Execution\x12Sprojects/{project}/locations/{location}/workflows/{workflow}/executions/{execution}\"\xc5\x01\n\x15ListExecutionsRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!workflows.googleapis.com/Workflow\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\x12J\n\x04view\x18\x04 \x01(\x0e\x32\x37.google.cloud.workflows.executions.v1beta.ExecutionViewB\x03\xe0\x41\x01\"z\n\x16ListExecutionsResponse\x12G\n\nexecutions\x18\x01 \x03(\x0b\x32\x33.google.cloud.workflows.executions.v1beta.Execution\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\xa0\x01\n\x16\x43reateExecutionRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!workflows.googleapis.com/Workflow\x12K\n\texecution\x18\x02 \x01(\x0b\x32\x33.google.cloud.workflows.executions.v1beta.ExecutionB\x03\xe0\x41\x02\"\xa4\x01\n\x13GetExecutionRequest\x12\x41\n\x04name\x18\x01 \x01(\tB3\xe0\x41\x02\xfa\x41-\n+workflowexecutions.googleapis.com/Execution\x12J\n\x04view\x18\x02 \x01(\x0e\x32\x37.google.cloud.workflows.executions.v1beta.ExecutionViewB\x03\xe0\x41\x01\"[\n\x16\x43\x61ncelExecutionRequest\x12\x41\n\x04name\x18\x01 \x01(\tB3\xe0\x41\x02\xfa\x41-\n+workflowexecutions.googleapis.com/Execution*D\n\rExecutionView\x12\x1e\n\x1a\x45XECUTION_VIEW_UNSPECIFIED\x10\x00\x12\t\n\x05\x42\x41SIC\x10\x01\x12\x08\n\x04\x46ULL\x10\x02\x32\xf3\x07\n\nExecutions\x12\xe4\x01\n\x0eListExecutions\x12?.google.cloud.workflows.executions.v1beta.ListExecutionsRequest\x1a@.google.cloud.workflows.executions.v1beta.ListExecutionsResponse\"O\xda\x41\x06parent\x82\xd3\xe4\x93\x02@\x12>/v1beta/{parent=projects/*/locations/*/workflows/*}/executions\x12\xee\x01\n\x0f\x43reateExecution\x12@.google.cloud.workflows.executions.v1beta.CreateExecutionRequest\x1a\x33.google.cloud.workflows.executions.v1beta.Execution\"d\xda\x41\x10parent,execution\x82\xd3\xe4\x93\x02K\">/v1beta/{parent=projects/*/locations/*/workflows/*}/executions:\texecution\x12\xd1\x01\n\x0cGetExecution\x12=.google.cloud.workflows.executions.v1beta.GetExecutionRequest\x1a\x33.google.cloud.workflows.executions.v1beta.Execution\"M\xda\x41\x04name\x82\xd3\xe4\x93\x02@\x12>/v1beta/{name=projects/*/locations/*/workflows/*/executions/*}\x12\xe1\x01\n\x0f\x43\x61ncelExecution\x12@.google.cloud.workflows.executions.v1beta.CancelExecutionRequest\x1a\x33.google.cloud.workflows.executions.v1beta.Execution\"W\xda\x41\x04name\x82\xd3\xe4\x93\x02J\"E/v1beta/{name=projects/*/locations/*/workflows/*/executions/*}:cancel:\x01*\x1aU\xca\x41!workflowexecutions.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\xf3\x01\n,com.google.cloud.workflows.executions.v1betaB\x0f\x45xecutionsProtoP\x01ZLcloud.google.com/go/workflows/executions/apiv1beta/executionspb;executionspb\xea\x41\x61\n!workflows.googleapis.com/Workflow\x12] + # 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. + # + # Note: This field should not be used in most cases. + 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: + # library_settings: + # 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. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Php. Clobbers the php_namespace option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.php.package_name" field + # in gapic.yaml. API teams should use the protobuf php_namespace option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # library_settings: + # php_settings: + # library_package: Google\Cloud\PubSub\V1 + 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. + # + # Example: + # + # 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 + # @!attribute [rw] batching + # @return [::Google::Api::BatchingConfigProto] + # Batching configuration for an API method in client libraries. + # + # Example of a YAML configuration: + # + # publishing: + # method_settings: + # - selector: google.example.v1.ExampleService.BatchCreateExample + # batching: + # element_count_threshold: 1000 + # request_byte_threshold: 100000000 + # delay_threshold_millis: 10 + 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. + # + # Note: This feature should not be used in most cases. + # @!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 + + # `BatchingConfigProto` defines the batching configuration for an API method. + # @!attribute [rw] thresholds + # @return [::Google::Api::BatchingSettingsProto] + # The thresholds which trigger a batched request to be sent. + # @!attribute [rw] batch_descriptor + # @return [::Google::Api::BatchingDescriptorProto] + # The request and response fields used in batching. + class BatchingConfigProto + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `BatchingSettingsProto` specifies a set of batching thresholds, each of + # which acts as a trigger to send a batch of messages as a request. At least + # one threshold must be positive nonzero. + # @!attribute [rw] element_count_threshold + # @return [::Integer] + # The number of elements of a field collected into a batch which, if + # exceeded, causes the batch to be sent. + # @!attribute [rw] request_byte_threshold + # @return [::Integer] + # The aggregated size of the batched field which, if exceeded, causes the + # batch to be sent. This size is computed by aggregating the sizes of the + # request field to be batched, not of the entire request message. + # @!attribute [rw] delay_threshold + # @return [::Google::Protobuf::Duration] + # The duration after which a batch should be sent, starting from the addition + # of the first message to that batch. + # @!attribute [rw] element_count_limit + # @return [::Integer] + # The maximum number of elements collected in a batch that could be accepted + # by server. + # @!attribute [rw] request_byte_limit + # @return [::Integer] + # The maximum size of the request that could be accepted by server. + # @!attribute [rw] flow_control_element_limit + # @return [::Integer] + # The maximum number of elements allowed by flow control. + # @!attribute [rw] flow_control_byte_limit + # @return [::Integer] + # The maximum size of data allowed by flow control. + # @!attribute [rw] flow_control_limit_exceeded_behavior + # @return [::Google::Api::FlowControlLimitExceededBehaviorProto] + # The behavior to take when the flow control limit is exceeded. + class BatchingSettingsProto + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `BatchingDescriptorProto` specifies the fields of the request message to be + # used for batching, and, optionally, the fields of the response message to be + # used for demultiplexing. + # @!attribute [rw] batched_field + # @return [::String] + # The repeated field in the request message to be aggregated by batching. + # @!attribute [rw] discriminator_fields + # @return [::Array<::String>] + # A list of the fields in the request message. Two requests will be batched + # together only if the values of every field specified in + # `request_discriminator_fields` is equal between the two requests. + # @!attribute [rw] subresponse_field + # @return [::String] + # Optional. When present, indicates the field in the response message to be + # used to demultiplex the response into multiple response messages, in + # correspondence with the multiple request messages originally batched + # together. + class BatchingDescriptorProto + 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 + + # The behavior to take when the flow control limit is exceeded. + module FlowControlLimitExceededBehaviorProto + # Default behavior, system-defined. + UNSET_BEHAVIOR = 0 + + # Stop operation, raise error. + THROW_EXCEPTION = 1 + + # Pause operation until limit clears. + BLOCK = 2 + + # Continue operation, disregard limit. + IGNORE = 3 + end + end +end diff --git a/owl-bot-staging/google-cloud-workflows-executions-v1beta/proto_docs/google/api/field_behavior.rb b/owl-bot-staging/google-cloud-workflows-executions-v1beta/proto_docs/google/api/field_behavior.rb new file mode 100644 index 000000000000..582be187d115 --- /dev/null +++ b/owl-bot-staging/google-cloud-workflows-executions-v1beta/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-workflows-executions-v1beta/proto_docs/google/api/launch_stage.rb b/owl-bot-staging/google-cloud-workflows-executions-v1beta/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..9392a413fb1b --- /dev/null +++ b/owl-bot-staging/google-cloud-workflows-executions-v1beta/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-workflows-executions-v1beta/proto_docs/google/api/resource.rb b/owl-bot-staging/google-cloud-workflows-executions-v1beta/proto_docs/google/api/resource.rb new file mode 100644 index 000000000000..25dec4847ac1 --- /dev/null +++ b/owl-bot-staging/google-cloud-workflows-executions-v1beta/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-workflows-executions-v1beta/proto_docs/google/cloud/workflows/executions/v1beta/executions.rb b/owl-bot-staging/google-cloud-workflows-executions-v1beta/proto_docs/google/cloud/workflows/executions/v1beta/executions.rb new file mode 100644 index 000000000000..155d545071b2 --- /dev/null +++ b/owl-bot-staging/google-cloud-workflows-executions-v1beta/proto_docs/google/cloud/workflows/executions/v1beta/executions.rb @@ -0,0 +1,200 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Workflows + module Executions + module V1beta + # A running instance of a [Workflow][google.cloud.workflows.v1beta.Workflow]. + # @!attribute [r] name + # @return [::String] + # Output only. The resource name of the execution. + # Format: + # projects/\\{project}/locations/\\{location}/workflows/\\{workflow}/executions/\\{execution} + # @!attribute [r] start_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Marks the beginning of execution. + # @!attribute [r] end_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Marks the end of execution, successful or not. + # @!attribute [r] state + # @return [::Google::Cloud::Workflows::Executions::V1beta::Execution::State] + # Output only. Current state of the execution. + # @!attribute [rw] argument + # @return [::String] + # Input parameters of the execution represented as a JSON string. + # The size limit is 32KB. + # @!attribute [r] result + # @return [::String] + # Output only. Output of the execution represented as a JSON string. The + # value can only be present if the execution's state is `SUCCEEDED`. + # @!attribute [r] error + # @return [::Google::Cloud::Workflows::Executions::V1beta::Execution::Error] + # Output only. The error which caused the execution to finish prematurely. + # The value is only present if the execution's state is `FAILED` + # or `CANCELLED`. + # @!attribute [r] workflow_revision_id + # @return [::String] + # Output only. Revision of the workflow this execution is using. + class Execution + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Error describes why the execution was abnormally terminated. + # @!attribute [rw] payload + # @return [::String] + # Error payload returned by the execution, represented as a JSON string. + # @!attribute [rw] context + # @return [::String] + # Human readable error context, helpful for debugging purposes. + class Error + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes the current state of the execution. More states may be added + # in the future. + module State + # Invalid state. + STATE_UNSPECIFIED = 0 + + # The execution is in progress. + ACTIVE = 1 + + # The execution finished successfully. + SUCCEEDED = 2 + + # The execution failed with an error. + FAILED = 3 + + # The execution was stopped intentionally. + CANCELLED = 4 + end + end + + # Request for the + # {::Google::Cloud::Workflows::Executions::V1beta::Executions::Client#list_executions ListExecutions} + # method. + # @!attribute [rw] parent + # @return [::String] + # Required. Name of the workflow for which the executions should be listed. + # Format: projects/\\{project}/locations/\\{location}/workflows/\\{workflow} + # @!attribute [rw] page_size + # @return [::Integer] + # Maximum number of executions to return per call. + # Max supported value depends on the selected Execution view: it's 10000 for + # BASIC and 100 for FULL. The default value used if the field is not + # specified is 100, regardless of the selected view. Values greater than + # the max value will be coerced down to it. + # @!attribute [rw] page_token + # @return [::String] + # A page token, received from a previous `ListExecutions` call. + # Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to `ListExecutions` must + # match the call that provided the page token. + # @!attribute [rw] view + # @return [::Google::Cloud::Workflows::Executions::V1beta::ExecutionView] + # Optional. A view defining which fields should be filled in the returned executions. + # The API will default to the BASIC view. + class ListExecutionsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response for the + # {::Google::Cloud::Workflows::Executions::V1beta::Executions::Client#list_executions ListExecutions} + # method. + # @!attribute [rw] executions + # @return [::Array<::Google::Cloud::Workflows::Executions::V1beta::Execution>] + # The executions which match the request. + # @!attribute [rw] next_page_token + # @return [::String] + # A token, which can be sent as `page_token` to retrieve the next page. + # If this field is omitted, there are no subsequent pages. + class ListExecutionsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request for the + # {::Google::Cloud::Workflows::Executions::V1beta::Executions::Client#create_execution CreateExecution} + # method. + # @!attribute [rw] parent + # @return [::String] + # Required. Name of the workflow for which an execution should be created. + # Format: projects/\\{project}/locations/\\{location}/workflows/\\{workflow} + # The latest revision of the workflow will be used. + # @!attribute [rw] execution + # @return [::Google::Cloud::Workflows::Executions::V1beta::Execution] + # Required. Execution to be created. + class CreateExecutionRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request for the + # {::Google::Cloud::Workflows::Executions::V1beta::Executions::Client#get_execution GetExecution} + # method. + # @!attribute [rw] name + # @return [::String] + # Required. Name of the execution to be retrieved. + # Format: + # projects/\\{project}/locations/\\{location}/workflows/\\{workflow}/executions/\\{execution} + # @!attribute [rw] view + # @return [::Google::Cloud::Workflows::Executions::V1beta::ExecutionView] + # Optional. A view defining which fields should be filled in the returned execution. + # The API will default to the FULL view. + class GetExecutionRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request for the + # {::Google::Cloud::Workflows::Executions::V1beta::Executions::Client#cancel_execution CancelExecution} + # method. + # @!attribute [rw] name + # @return [::String] + # Required. Name of the execution to be cancelled. + # Format: + # projects/\\{project}/locations/\\{location}/workflows/\\{workflow}/executions/\\{execution} + class CancelExecutionRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Defines possible views for execution resource. + module ExecutionView + # The default / unset value. + EXECUTION_VIEW_UNSPECIFIED = 0 + + # Includes only basic metadata about the execution. + # Following fields are returned: name, start_time, end_time, state + # and workflow_revision_id. + BASIC = 1 + + # Includes all data. + FULL = 2 + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-workflows-executions-v1beta/proto_docs/google/protobuf/duration.rb b/owl-bot-staging/google-cloud-workflows-executions-v1beta/proto_docs/google/protobuf/duration.rb new file mode 100644 index 000000000000..ea59f1f91daf --- /dev/null +++ b/owl-bot-staging/google-cloud-workflows-executions-v1beta/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-workflows-executions-v1beta/proto_docs/google/protobuf/timestamp.rb b/owl-bot-staging/google-cloud-workflows-executions-v1beta/proto_docs/google/protobuf/timestamp.rb new file mode 100644 index 000000000000..74352be9c58c --- /dev/null +++ b/owl-bot-staging/google-cloud-workflows-executions-v1beta/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-workflows-executions-v1beta/snippets/Gemfile b/owl-bot-staging/google-cloud-workflows-executions-v1beta/snippets/Gemfile new file mode 100644 index 000000000000..16f945ec033e --- /dev/null +++ b/owl-bot-staging/google-cloud-workflows-executions-v1beta/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-workflows-executions-v1beta", path: "../" +else + gem "google-cloud-workflows-executions-v1beta" +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-workflows-executions-v1beta/snippets/executions/cancel_execution.rb b/owl-bot-staging/google-cloud-workflows-executions-v1beta/snippets/executions/cancel_execution.rb new file mode 100644 index 000000000000..8f7f3934284c --- /dev/null +++ b/owl-bot-staging/google-cloud-workflows-executions-v1beta/snippets/executions/cancel_execution.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 workflowexecutions_v1beta_generated_Executions_CancelExecution_sync] +require "google/cloud/workflows/executions/v1beta" + +## +# Snippet for the cancel_execution call in the Executions 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::Workflows::Executions::V1beta::Executions::Client#cancel_execution. +# +def cancel_execution + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Workflows::Executions::V1beta::Executions::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Workflows::Executions::V1beta::CancelExecutionRequest.new + + # Call the cancel_execution method. + result = client.cancel_execution request + + # The returned object is of type Google::Cloud::Workflows::Executions::V1beta::Execution. + p result +end +# [END workflowexecutions_v1beta_generated_Executions_CancelExecution_sync] diff --git a/owl-bot-staging/google-cloud-workflows-executions-v1beta/snippets/executions/create_execution.rb b/owl-bot-staging/google-cloud-workflows-executions-v1beta/snippets/executions/create_execution.rb new file mode 100644 index 000000000000..926c4489f51d --- /dev/null +++ b/owl-bot-staging/google-cloud-workflows-executions-v1beta/snippets/executions/create_execution.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 workflowexecutions_v1beta_generated_Executions_CreateExecution_sync] +require "google/cloud/workflows/executions/v1beta" + +## +# Snippet for the create_execution call in the Executions 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::Workflows::Executions::V1beta::Executions::Client#create_execution. +# +def create_execution + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Workflows::Executions::V1beta::Executions::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Workflows::Executions::V1beta::CreateExecutionRequest.new + + # Call the create_execution method. + result = client.create_execution request + + # The returned object is of type Google::Cloud::Workflows::Executions::V1beta::Execution. + p result +end +# [END workflowexecutions_v1beta_generated_Executions_CreateExecution_sync] diff --git a/owl-bot-staging/google-cloud-workflows-executions-v1beta/snippets/executions/get_execution.rb b/owl-bot-staging/google-cloud-workflows-executions-v1beta/snippets/executions/get_execution.rb new file mode 100644 index 000000000000..58e0a552a8ab --- /dev/null +++ b/owl-bot-staging/google-cloud-workflows-executions-v1beta/snippets/executions/get_execution.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 workflowexecutions_v1beta_generated_Executions_GetExecution_sync] +require "google/cloud/workflows/executions/v1beta" + +## +# Snippet for the get_execution call in the Executions 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::Workflows::Executions::V1beta::Executions::Client#get_execution. +# +def get_execution + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Workflows::Executions::V1beta::Executions::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Workflows::Executions::V1beta::GetExecutionRequest.new + + # Call the get_execution method. + result = client.get_execution request + + # The returned object is of type Google::Cloud::Workflows::Executions::V1beta::Execution. + p result +end +# [END workflowexecutions_v1beta_generated_Executions_GetExecution_sync] diff --git a/owl-bot-staging/google-cloud-workflows-executions-v1beta/snippets/executions/list_executions.rb b/owl-bot-staging/google-cloud-workflows-executions-v1beta/snippets/executions/list_executions.rb new file mode 100644 index 000000000000..a8f00e5f1390 --- /dev/null +++ b/owl-bot-staging/google-cloud-workflows-executions-v1beta/snippets/executions/list_executions.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 workflowexecutions_v1beta_generated_Executions_ListExecutions_sync] +require "google/cloud/workflows/executions/v1beta" + +## +# Snippet for the list_executions call in the Executions 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::Workflows::Executions::V1beta::Executions::Client#list_executions. +# +def list_executions + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Workflows::Executions::V1beta::Executions::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Workflows::Executions::V1beta::ListExecutionsRequest.new + + # Call the list_executions method. + result = client.list_executions 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::Workflows::Executions::V1beta::Execution. + p item + end +end +# [END workflowexecutions_v1beta_generated_Executions_ListExecutions_sync] diff --git a/owl-bot-staging/google-cloud-workflows-executions-v1beta/snippets/snippet_metadata_google.cloud.workflows.executions.v1beta.json b/owl-bot-staging/google-cloud-workflows-executions-v1beta/snippets/snippet_metadata_google.cloud.workflows.executions.v1beta.json new file mode 100644 index 000000000000..598ce53245c5 --- /dev/null +++ b/owl-bot-staging/google-cloud-workflows-executions-v1beta/snippets/snippet_metadata_google.cloud.workflows.executions.v1beta.json @@ -0,0 +1,175 @@ +{ + "client_library": { + "name": "google-cloud-workflows-executions-v1beta", + "version": "", + "language": "RUBY", + "apis": [ + { + "id": "google.cloud.workflows.executions.v1beta", + "version": "v1beta" + } + ] + }, + "snippets": [ + { + "region_tag": "workflowexecutions_v1beta_generated_Executions_ListExecutions_sync", + "title": "Snippet for the list_executions call in the Executions service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Workflows::Executions::V1beta::Executions::Client#list_executions.", + "file": "executions/list_executions.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_executions", + "full_name": "::Google::Cloud::Workflows::Executions::V1beta::Executions::Client#list_executions", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Workflows::Executions::V1beta::ListExecutionsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Workflows::Executions::V1beta::ListExecutionsResponse", + "client": { + "short_name": "Executions::Client", + "full_name": "::Google::Cloud::Workflows::Executions::V1beta::Executions::Client" + }, + "method": { + "short_name": "ListExecutions", + "full_name": "google.cloud.workflows.executions.v1beta.Executions.ListExecutions", + "service": { + "short_name": "Executions", + "full_name": "google.cloud.workflows.executions.v1beta.Executions" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "workflowexecutions_v1beta_generated_Executions_CreateExecution_sync", + "title": "Snippet for the create_execution call in the Executions service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Workflows::Executions::V1beta::Executions::Client#create_execution.", + "file": "executions/create_execution.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_execution", + "full_name": "::Google::Cloud::Workflows::Executions::V1beta::Executions::Client#create_execution", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Workflows::Executions::V1beta::CreateExecutionRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Workflows::Executions::V1beta::Execution", + "client": { + "short_name": "Executions::Client", + "full_name": "::Google::Cloud::Workflows::Executions::V1beta::Executions::Client" + }, + "method": { + "short_name": "CreateExecution", + "full_name": "google.cloud.workflows.executions.v1beta.Executions.CreateExecution", + "service": { + "short_name": "Executions", + "full_name": "google.cloud.workflows.executions.v1beta.Executions" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "workflowexecutions_v1beta_generated_Executions_GetExecution_sync", + "title": "Snippet for the get_execution call in the Executions service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Workflows::Executions::V1beta::Executions::Client#get_execution.", + "file": "executions/get_execution.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_execution", + "full_name": "::Google::Cloud::Workflows::Executions::V1beta::Executions::Client#get_execution", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Workflows::Executions::V1beta::GetExecutionRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Workflows::Executions::V1beta::Execution", + "client": { + "short_name": "Executions::Client", + "full_name": "::Google::Cloud::Workflows::Executions::V1beta::Executions::Client" + }, + "method": { + "short_name": "GetExecution", + "full_name": "google.cloud.workflows.executions.v1beta.Executions.GetExecution", + "service": { + "short_name": "Executions", + "full_name": "google.cloud.workflows.executions.v1beta.Executions" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "workflowexecutions_v1beta_generated_Executions_CancelExecution_sync", + "title": "Snippet for the cancel_execution call in the Executions service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Workflows::Executions::V1beta::Executions::Client#cancel_execution.", + "file": "executions/cancel_execution.rb", + "language": "RUBY", + "client_method": { + "short_name": "cancel_execution", + "full_name": "::Google::Cloud::Workflows::Executions::V1beta::Executions::Client#cancel_execution", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Workflows::Executions::V1beta::CancelExecutionRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Workflows::Executions::V1beta::Execution", + "client": { + "short_name": "Executions::Client", + "full_name": "::Google::Cloud::Workflows::Executions::V1beta::Executions::Client" + }, + "method": { + "short_name": "CancelExecution", + "full_name": "google.cloud.workflows.executions.v1beta.Executions.CancelExecution", + "service": { + "short_name": "Executions", + "full_name": "google.cloud.workflows.executions.v1beta.Executions" + } + } + }, + "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-workflows-executions-v1beta/test/google/cloud/workflows/executions/v1beta/executions_paths_test.rb b/owl-bot-staging/google-cloud-workflows-executions-v1beta/test/google/cloud/workflows/executions/v1beta/executions_paths_test.rb new file mode 100644 index 000000000000..d23ec98d8085 --- /dev/null +++ b/owl-bot-staging/google-cloud-workflows-executions-v1beta/test/google/cloud/workflows/executions/v1beta/executions_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/workflows/executions/v1beta/executions" + +class ::Google::Cloud::Workflows::Executions::V1beta::Executions::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_execution_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Workflows::Executions::V1beta::Executions::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.execution_path project: "value0", location: "value1", workflow: "value2", execution: "value3" + assert_equal "projects/value0/locations/value1/workflows/value2/executions/value3", path + end + end + + def test_workflow_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Workflows::Executions::V1beta::Executions::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.workflow_path project: "value0", location: "value1", workflow: "value2" + assert_equal "projects/value0/locations/value1/workflows/value2", path + end + end +end diff --git a/owl-bot-staging/google-cloud-workflows-executions-v1beta/test/google/cloud/workflows/executions/v1beta/executions_test.rb b/owl-bot-staging/google-cloud-workflows-executions-v1beta/test/google/cloud/workflows/executions/v1beta/executions_test.rb new file mode 100644 index 000000000000..c293feaf68bc --- /dev/null +++ b/owl-bot-staging/google-cloud-workflows-executions-v1beta/test/google/cloud/workflows/executions/v1beta/executions_test.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! + +require "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/workflows/executions/v1beta/executions_pb" +require "google/cloud/workflows/executions/v1beta/executions" + +class ::Google::Cloud::Workflows::Executions::V1beta::Executions::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_executions + # Create GRPC objects. + grpc_response = ::Google::Cloud::Workflows::Executions::V1beta::ListExecutionsResponse.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 = :EXECUTION_VIEW_UNSPECIFIED + + list_executions_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_executions, name + assert_kind_of ::Google::Cloud::Workflows::Executions::V1beta::ListExecutionsRequest, request + assert_equal "hello world", request["parent"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + assert_equal :EXECUTION_VIEW_UNSPECIFIED, request["view"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_executions_client_stub do + # Create client + client = ::Google::Cloud::Workflows::Executions::V1beta::Executions::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_executions({ parent: parent, page_size: page_size, page_token: page_token, view: view }) 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_executions parent: parent, page_size: page_size, page_token: page_token, view: view 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_executions ::Google::Cloud::Workflows::Executions::V1beta::ListExecutionsRequest.new(parent: parent, page_size: page_size, page_token: page_token, view: view) 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_executions({ parent: parent, page_size: page_size, page_token: page_token, view: view }, 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_executions(::Google::Cloud::Workflows::Executions::V1beta::ListExecutionsRequest.new(parent: parent, page_size: page_size, page_token: page_token, view: view), 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_executions_client_stub.call_rpc_count + end + end + + def test_create_execution + # Create GRPC objects. + grpc_response = ::Google::Cloud::Workflows::Executions::V1beta::Execution.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" + execution = {} + + create_execution_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_execution, name + assert_kind_of ::Google::Cloud::Workflows::Executions::V1beta::CreateExecutionRequest, request + assert_equal "hello world", request["parent"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Workflows::Executions::V1beta::Execution), request["execution"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_execution_client_stub do + # Create client + client = ::Google::Cloud::Workflows::Executions::V1beta::Executions::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_execution({ parent: parent, execution: execution }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.create_execution parent: parent, execution: execution do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.create_execution ::Google::Cloud::Workflows::Executions::V1beta::CreateExecutionRequest.new(parent: parent, execution: execution) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.create_execution({ parent: parent, execution: execution }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.create_execution(::Google::Cloud::Workflows::Executions::V1beta::CreateExecutionRequest.new(parent: parent, execution: execution), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, create_execution_client_stub.call_rpc_count + end + end + + def test_get_execution + # Create GRPC objects. + grpc_response = ::Google::Cloud::Workflows::Executions::V1beta::Execution.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" + view = :EXECUTION_VIEW_UNSPECIFIED + + get_execution_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_execution, name + assert_kind_of ::Google::Cloud::Workflows::Executions::V1beta::GetExecutionRequest, request + assert_equal "hello world", request["name"] + assert_equal :EXECUTION_VIEW_UNSPECIFIED, request["view"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_execution_client_stub do + # Create client + client = ::Google::Cloud::Workflows::Executions::V1beta::Executions::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_execution({ name: name, view: view }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_execution name: name, view: view do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_execution ::Google::Cloud::Workflows::Executions::V1beta::GetExecutionRequest.new(name: name, view: view) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_execution({ name: name, view: view }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_execution(::Google::Cloud::Workflows::Executions::V1beta::GetExecutionRequest.new(name: name, view: view), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_execution_client_stub.call_rpc_count + end + end + + def test_cancel_execution + # Create GRPC objects. + grpc_response = ::Google::Cloud::Workflows::Executions::V1beta::Execution.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_execution_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :cancel_execution, name + assert_kind_of ::Google::Cloud::Workflows::Executions::V1beta::CancelExecutionRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, cancel_execution_client_stub do + # Create client + client = ::Google::Cloud::Workflows::Executions::V1beta::Executions::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.cancel_execution({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.cancel_execution name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.cancel_execution ::Google::Cloud::Workflows::Executions::V1beta::CancelExecutionRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.cancel_execution({ 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_execution(::Google::Cloud::Workflows::Executions::V1beta::CancelExecutionRequest.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_execution_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::Workflows::Executions::V1beta::Executions::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::Workflows::Executions::V1beta::Executions::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::Workflows::Executions::V1beta::Executions::Client.new do |config| + config.credentials = creds + end + assert_kind_of ::Google::Cloud::Workflows::Executions::V1beta::Executions::Client, client + assert_equal creds, client.configure.credentials + end + end +end diff --git a/owl-bot-staging/google-cloud-workflows-executions-v1beta/test/helper.rb b/owl-bot-staging/google-cloud-workflows-executions-v1beta/test/helper.rb new file mode 100644 index 000000000000..672b337030e7 --- /dev/null +++ b/owl-bot-staging/google-cloud-workflows-executions-v1beta/test/helper.rb @@ -0,0 +1,26 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/mock" +require "minitest/rg" + +require "grpc" + +require "ostruct" diff --git a/owl-bot-staging/google-cloud-workflows-v1/.gitignore b/owl-bot-staging/google-cloud-workflows-v1/.gitignore new file mode 100644 index 000000000000..0135b6bc6cfc --- /dev/null +++ b/owl-bot-staging/google-cloud-workflows-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-workflows-v1/.repo-metadata.json b/owl-bot-staging/google-cloud-workflows-v1/.repo-metadata.json new file mode 100644 index 000000000000..69f7509959da --- /dev/null +++ b/owl-bot-staging/google-cloud-workflows-v1/.repo-metadata.json @@ -0,0 +1,18 @@ +{ + "api_id": "workflows.googleapis.com", + "api_shortname": "workflows", + "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-workflows-v1/latest", + "distribution_name": "google-cloud-workflows-v1", + "is_cloud": true, + "language": "ruby", + "name": "workflows", + "name_pretty": "Workflows V1 API", + "product_documentation": "https://cloud.google.com/workflows/", + "release_level": "unreleased", + "repo": "googleapis/google-cloud-ruby", + "requires_billing": true, + "ruby-cloud-description": "Workflows link series of serverless tasks together in an order you define. Combine the power of Google Cloud's APIs, serverless products like Cloud Functions and Cloud Run, and calls to external APIs to create flexible serverless applications. Workflows requires no infrastructure management and scales seamlessly with demand, including scaling down to zero.. Note that google-cloud-workflows-v1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-workflows instead. See the readme for more details.", + "ruby-cloud-env-prefix": "WORKFLOWS", + "ruby-cloud-product-url": "https://cloud.google.com/workflows/", + "library_type": "GAPIC_AUTO" +} diff --git a/owl-bot-staging/google-cloud-workflows-v1/.rubocop.yml b/owl-bot-staging/google-cloud-workflows-v1/.rubocop.yml new file mode 100644 index 000000000000..f3347d525c00 --- /dev/null +++ b/owl-bot-staging/google-cloud-workflows-v1/.rubocop.yml @@ -0,0 +1,33 @@ +inherit_gem: + google-style: google-style.yml + +AllCops: + Exclude: + - "google-cloud-workflows-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-workflows-v1.rb" diff --git a/owl-bot-staging/google-cloud-workflows-v1/.toys.rb b/owl-bot-staging/google-cloud-workflows-v1/.toys.rb new file mode 100644 index 000000000000..177e22456e8a --- /dev/null +++ b/owl-bot-staging/google-cloud-workflows-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-workflows-v1/.yardopts b/owl-bot-staging/google-cloud-workflows-v1/.yardopts new file mode 100644 index 000000000000..3d801a2a7c84 --- /dev/null +++ b/owl-bot-staging/google-cloud-workflows-v1/.yardopts @@ -0,0 +1,12 @@ +--no-private +--title="Workflows 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-workflows-v1/AUTHENTICATION.md b/owl-bot-staging/google-cloud-workflows-v1/AUTHENTICATION.md new file mode 100644 index 000000000000..e217594f764c --- /dev/null +++ b/owl-bot-staging/google-cloud-workflows-v1/AUTHENTICATION.md @@ -0,0 +1,122 @@ +# Authentication + +The recommended way to authenticate to the google-cloud-workflows-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-workflows-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/workflows/v1" + +client = ::Google::Cloud::Workflows::V1::Workflows::Client.new do |config| + config.credentials = "path/to/credentialfile.json" +end +``` + +To configure a credentials file globally for all clients: + +```ruby +require "google/cloud/workflows/v1" + +::Google::Cloud::Workflows::V1::Workflows::Client.configure do |config| + config.credentials = "path/to/credentialfile.json" +end + +client = ::Google::Cloud::Workflows::V1::Workflows::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-workflows-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/workflows/v1" + +ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" + +client = ::Google::Cloud::Workflows::V1::Workflows::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-workflows-v1/CHANGELOG.md b/owl-bot-staging/google-cloud-workflows-v1/CHANGELOG.md new file mode 100644 index 000000000000..f88957a62ba2 --- /dev/null +++ b/owl-bot-staging/google-cloud-workflows-v1/CHANGELOG.md @@ -0,0 +1,2 @@ +# Release History + diff --git a/owl-bot-staging/google-cloud-workflows-v1/Gemfile b/owl-bot-staging/google-cloud-workflows-v1/Gemfile new file mode 100644 index 000000000000..1d08558908d8 --- /dev/null +++ b/owl-bot-staging/google-cloud-workflows-v1/Gemfile @@ -0,0 +1,14 @@ +source "https://rubygems.org" + +gemspec + +gem "google-style", "~> 1.32.0" +gem "irb", "~> 1.17" +gem "minitest", "~> 6.0.2" +gem "minitest-focus", "~> 1.4" +gem "minitest-mock", "~> 5.27" +gem "minitest-rg", "~> 5.3" +gem "ostruct", "~> 0.5.5" +gem "rake", ">= 13.0" +gem "redcarpet", "~> 3.6" +gem "yard", "~> 0.9" diff --git a/owl-bot-staging/google-cloud-workflows-v1/LICENSE.md b/owl-bot-staging/google-cloud-workflows-v1/LICENSE.md new file mode 100644 index 000000000000..c261857ba6ad --- /dev/null +++ b/owl-bot-staging/google-cloud-workflows-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-workflows-v1/README.md b/owl-bot-staging/google-cloud-workflows-v1/README.md new file mode 100644 index 000000000000..d7ab36838d46 --- /dev/null +++ b/owl-bot-staging/google-cloud-workflows-v1/README.md @@ -0,0 +1,154 @@ +# Ruby Client for the Workflows V1 API + +Manage workflow definitions. To execute workflows and manage executions, see the Workflows Executions API. + +Workflows link series of serverless tasks together in an order you define. Combine the power of Google Cloud's APIs, serverless products like Cloud Functions and Cloud Run, and calls to external APIs to create flexible serverless applications. Workflows requires no infrastructure management and scales seamlessly with demand, including scaling down to zero.. + +https://github.com/googleapis/google-cloud-ruby + +This gem is a _versioned_ client. It provides basic client classes for a +specific version of the Workflows V1 API. Most users should consider using +the main client gem, +[google-cloud-workflows](https://rubygems.org/gems/google-cloud-workflows). +See the section below titled *Which client should I use?* for more information. + +## Installation + +``` +$ gem install google-cloud-workflows-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/workflows.googleapis.com) +1. [Set up authentication.](AUTHENTICATION.md) + +## Quick Start + +```ruby +require "google/cloud/workflows/v1" + +client = ::Google::Cloud::Workflows::V1::Workflows::Client.new +request = ::Google::Cloud::Workflows::V1::ListWorkflowsRequest.new # (request fields as keyword arguments...) +response = client.list_workflows request +``` + +View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-workflows-v1/latest) +for class and method documentation. + +See also the [Product Documentation](https://cloud.google.com/workflows/) +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/workflows/v1" +require "logger" + +client = ::Google::Cloud::Workflows::V1::Workflows::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-workflows`, +and lower-level _versioned_ client libraries with names such as +`google-cloud-workflows-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-workflows`. +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-workflows-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-workflows-v1/Rakefile b/owl-bot-staging/google-cloud-workflows-v1/Rakefile new file mode 100644 index 000000000000..13816b0b43f6 --- /dev/null +++ b/owl-bot-staging/google-cloud-workflows-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-workflows-v1 acceptance tests." +task :acceptance, :project, :keyfile do |t, args| + project = args[:project] + project ||= + ENV["WORKFLOWS_TEST_PROJECT"] || + ENV["GCLOUD_TEST_PROJECT"] + keyfile = args[:keyfile] + keyfile ||= + ENV["WORKFLOWS_TEST_KEYFILE"] || + ENV["GCLOUD_TEST_KEYFILE"] + if keyfile + keyfile = File.read keyfile + else + keyfile ||= + ENV["WORKFLOWS_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 WORKFLOWS_TEST_PROJECT=test123 WORKFLOWS_TEST_KEYFILE=/path/to/keyfile.json rake acceptance" + end + require "google/cloud/workflows/v1/workflows/credentials" + ::Google::Cloud::Workflows::V1::Workflows::Credentials.env_vars.each do |path| + ENV[path] = nil + end + ENV["WORKFLOWS_PROJECT"] = project + ENV["WORKFLOWS_TEST_PROJECT"] = project + ENV["WORKFLOWS_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-workflows-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-workflows-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-workflows-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-workflows-v1 gem does not have doctest tests." +end + +desc "Run the CI build" +task :ci do + header "BUILDING google-cloud-workflows-v1" + header "google-cloud-workflows-v1 rubocop", "*" + Rake::Task[:rubocop].invoke + header "google-cloud-workflows-v1 yard", "*" + Rake::Task[:yard].invoke + header "google-cloud-workflows-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-workflows-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-workflows-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-workflows-v1/gapic_metadata.json b/owl-bot-staging/google-cloud-workflows-v1/gapic_metadata.json new file mode 100644 index 000000000000..ec6940cb8f05 --- /dev/null +++ b/owl-bot-staging/google-cloud-workflows-v1/gapic_metadata.json @@ -0,0 +1,48 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "ruby", + "protoPackage": "google.cloud.workflows.v1", + "libraryPackage": "::Google::Cloud::Workflows::V1", + "services": { + "Workflows": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::Workflows::V1::Workflows::Client", + "rpcs": { + "ListWorkflows": { + "methods": [ + "list_workflows" + ] + }, + "GetWorkflow": { + "methods": [ + "get_workflow" + ] + }, + "CreateWorkflow": { + "methods": [ + "create_workflow" + ] + }, + "DeleteWorkflow": { + "methods": [ + "delete_workflow" + ] + }, + "UpdateWorkflow": { + "methods": [ + "update_workflow" + ] + }, + "ListWorkflowRevisions": { + "methods": [ + "list_workflow_revisions" + ] + } + } + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-workflows-v1/google-cloud-workflows-v1.gemspec b/owl-bot-staging/google-cloud-workflows-v1/google-cloud-workflows-v1.gemspec new file mode 100644 index 000000000000..8eefcc91c52b --- /dev/null +++ b/owl-bot-staging/google-cloud-workflows-v1/google-cloud-workflows-v1.gemspec @@ -0,0 +1,29 @@ +# -*- ruby -*- +# encoding: utf-8 + +require File.expand_path("lib/google/cloud/workflows/v1/version", __dir__) + +Gem::Specification.new do |gem| + gem.name = "google-cloud-workflows-v1" + gem.version = Google::Cloud::Workflows::V1::VERSION + + gem.authors = ["Google LLC"] + gem.email = "googleapis-packages@google.com" + gem.description = "Workflows link series of serverless tasks together in an order you define. Combine the power of Google Cloud's APIs, serverless products like Cloud Functions and Cloud Run, and calls to external APIs to create flexible serverless applications. Workflows requires no infrastructure management and scales seamlessly with demand, including scaling down to zero.. Note that google-cloud-workflows-v1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-workflows instead. See the readme for more details." + gem.summary = "Manage workflow definitions. To execute workflows and manage executions, see the Workflows Executions API." + 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.2" + + gem.add_dependency "gapic-common", "~> 1.2" + gem.add_dependency "google-cloud-errors", "~> 1.0" + gem.add_dependency "google-cloud-location", "~> 1.0" +end diff --git a/owl-bot-staging/google-cloud-workflows-v1/lib/google-cloud-workflows-v1.rb b/owl-bot-staging/google-cloud-workflows-v1/lib/google-cloud-workflows-v1.rb new file mode 100644 index 000000000000..1b638a3e422e --- /dev/null +++ b/owl-bot-staging/google-cloud-workflows-v1/lib/google-cloud-workflows-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/workflows/v1" diff --git a/owl-bot-staging/google-cloud-workflows-v1/lib/google/cloud/workflows/v1.rb b/owl-bot-staging/google-cloud-workflows-v1/lib/google/cloud/workflows/v1.rb new file mode 100644 index 000000000000..bda78f5b4bc6 --- /dev/null +++ b/owl-bot-staging/google-cloud-workflows-v1/lib/google/cloud/workflows/v1.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/workflows/v1/workflows" +require "google/cloud/workflows/v1/version" + +module Google + module Cloud + module Workflows + ## + # API client module. + # + # @example Load this package, including all its services, and instantiate a gRPC client + # + # require "google/cloud/workflows/v1" + # client = ::Google::Cloud::Workflows::V1::Workflows::Client.new + # + # @example Load this package, including all its services, and instantiate a REST client + # + # require "google/cloud/workflows/v1" + # client = ::Google::Cloud::Workflows::V1::Workflows::Rest::Client.new + # + module V1 + end + end + end +end + +helper_path = ::File.join __dir__, "v1", "_helpers.rb" +require "google/cloud/workflows/v1/_helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-workflows-v1/lib/google/cloud/workflows/v1/bindings_override.rb b/owl-bot-staging/google-cloud-workflows-v1/lib/google/cloud/workflows/v1/bindings_override.rb new file mode 100644 index 000000000000..793a02bd64cd --- /dev/null +++ b/owl-bot-staging/google-cloud-workflows-v1/lib/google/cloud/workflows/v1/bindings_override.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! + +require "gapic/rest" + +module Google + module Cloud + module Workflows + ## + # @example Loading just the REST part of this package, including all its services, and instantiating a REST client + # + # require "google/cloud/workflows/v1/rest" + # client = ::Google::Cloud::Workflows::V1::Workflows::Rest::Client.new + # + module V1 + ## + # @private + # Initialize the mixin bindings configuration + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "Workflows"] + 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 + end + yield @configure if block_given? + @configure + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-workflows-v1/lib/google/cloud/workflows/v1/rest.rb b/owl-bot-staging/google-cloud-workflows-v1/lib/google/cloud/workflows/v1/rest.rb new file mode 100644 index 000000000000..16f410759b32 --- /dev/null +++ b/owl-bot-staging/google-cloud-workflows-v1/lib/google/cloud/workflows/v1/rest.rb @@ -0,0 +1,38 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/workflows/v1/workflows/rest" +require "google/cloud/workflows/v1/bindings_override" +require "google/cloud/workflows/v1/version" + +module Google + module Cloud + module Workflows + ## + # To load just the REST part of this package, including all its services, and instantiate a REST client: + # + # @example + # + # require "google/cloud/workflows/v1/rest" + # client = ::Google::Cloud::Workflows::V1::Workflows::Rest::Client.new + # + module V1 + end + end + end +end diff --git a/owl-bot-staging/google-cloud-workflows-v1/lib/google/cloud/workflows/v1/version.rb b/owl-bot-staging/google-cloud-workflows-v1/lib/google/cloud/workflows/v1/version.rb new file mode 100644 index 000000000000..ad8aed01cf91 --- /dev/null +++ b/owl-bot-staging/google-cloud-workflows-v1/lib/google/cloud/workflows/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 Workflows + module V1 + VERSION = "0.0.1" + end + end + end +end diff --git a/owl-bot-staging/google-cloud-workflows-v1/lib/google/cloud/workflows/v1/workflows.rb b/owl-bot-staging/google-cloud-workflows-v1/lib/google/cloud/workflows/v1/workflows.rb new file mode 100644 index 000000000000..f4818691ad45 --- /dev/null +++ b/owl-bot-staging/google-cloud-workflows-v1/lib/google/cloud/workflows/v1/workflows.rb @@ -0,0 +1,58 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/workflows/v1/version" + +require "google/cloud/workflows/v1/workflows/credentials" +require "google/cloud/workflows/v1/workflows/paths" +require "google/cloud/workflows/v1/workflows/operations" +require "google/cloud/workflows/v1/workflows/client" +require "google/cloud/workflows/v1/workflows/rest" + +module Google + module Cloud + module Workflows + module V1 + ## + # Workflows is used to deploy and execute workflow programs. + # Workflows makes sure the program executes reliably, despite hardware and + # networking interruptions. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/workflows/v1/workflows" + # client = ::Google::Cloud::Workflows::V1::Workflows::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/workflows/v1/workflows/rest" + # client = ::Google::Cloud::Workflows::V1::Workflows::Rest::Client.new + # + module Workflows + end + end + end + end +end + +helper_path = ::File.join __dir__, "workflows", "helpers.rb" +require "google/cloud/workflows/v1/workflows/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-workflows-v1/lib/google/cloud/workflows/v1/workflows/client.rb b/owl-bot-staging/google-cloud-workflows-v1/lib/google/cloud/workflows/v1/workflows/client.rb new file mode 100644 index 000000000000..55f6b6df1255 --- /dev/null +++ b/owl-bot-staging/google-cloud-workflows-v1/lib/google/cloud/workflows/v1/workflows/client.rb @@ -0,0 +1,1074 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/workflows/v1/workflows_pb" +require "google/cloud/location" + +module Google + module Cloud + module Workflows + module V1 + module Workflows + ## + # Client for the Workflows service. + # + # Workflows is used to deploy and execute workflow programs. + # Workflows makes sure the program executes reliably, despite hardware and + # networking interruptions. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "workflows.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :workflows_stub + + ## + # Configure the Workflows Client class. + # + # See {::Google::Cloud::Workflows::V1::Workflows::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all Workflows clients + # ::Google::Cloud::Workflows::V1::Workflows::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", "Workflows", "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 + end + yield @configure if block_given? + @configure + end + + ## + # Configure the Workflows 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::Workflows::V1::Workflows::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 + @workflows_stub.universe_domain + end + + ## + # Create a new Workflows client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Workflows::V1::Workflows::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Workflows::V1::Workflows::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Workflows 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/workflows/v1/workflows_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 + + @workflows_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::Workflows::V1::Workflows::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 + ) + + @workflows_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 = @workflows_stub.endpoint + config.universe_domain = @workflows_stub.universe_domain + config.logger = @workflows_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::Workflows::V1::Workflows::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 + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @workflows_stub.logger + end + + # Service calls + + ## + # Lists workflows in a given project and location. + # The default order is not specified. + # + # @overload list_workflows(request, options = nil) + # Pass arguments to `list_workflows` via a request object, either of type + # {::Google::Cloud::Workflows::V1::ListWorkflowsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Workflows::V1::ListWorkflowsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_workflows(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) + # Pass arguments to `list_workflows` via keyword arguments. Note that at + # least one keyword argument is 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. Project and location from which the workflows should be listed. + # Format: projects/\\{project}/locations/\\{location} + # @param page_size [::Integer] + # Maximum number of workflows to return per call. The service might return + # fewer than this value even if not at the end of the collection. If a value + # is not specified, a default value of 500 is used. The maximum permitted + # value is 1000 and values greater than 1000 are coerced down to 1000. + # @param page_token [::String] + # A page token, received from a previous `ListWorkflows` call. + # Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to `ListWorkflows` must + # match the call that provided the page token. + # @param filter [::String] + # Filter to restrict results to specific workflows. + # For details, see AIP-160. + # + # For example, if you are using the Google APIs Explorer: + # + # `state="SUCCEEDED"` + # + # or + # + # `createTime>"2023-08-01" AND state="FAILED"` + # @param order_by [::String] + # Comma-separated list of fields that specify the order of the results. + # Default sorting order for a field is ascending. To specify descending order + # for a field, append a "desc" suffix. + # If not specified, the results are returned in an unspecified order. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Workflows::V1::Workflow>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::Workflows::V1::Workflow>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/workflows/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Workflows::V1::Workflows::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Workflows::V1::ListWorkflowsRequest.new + # + # # Call the list_workflows method. + # result = client.list_workflows 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::Workflows::V1::Workflow. + # p item + # end + # + def list_workflows request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workflows::V1::ListWorkflowsRequest + + # Converts hash 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_workflows.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::Workflows::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_workflows.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_workflows.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @workflows_stub.call_rpc :list_workflows, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @workflows_stub, :list_workflows, 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 + + ## + # Gets details of a single workflow. + # + # @overload get_workflow(request, options = nil) + # Pass arguments to `get_workflow` via a request object, either of type + # {::Google::Cloud::Workflows::V1::GetWorkflowRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Workflows::V1::GetWorkflowRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_workflow(name: nil, revision_id: nil) + # Pass arguments to `get_workflow` via keyword arguments. Note that at + # least one keyword argument is 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 workflow for which information should be retrieved. + # Format: projects/\\{project}/locations/\\{location}/workflows/\\{workflow} + # @param revision_id [::String] + # Optional. The revision of the workflow to retrieve. If the revision_id is + # empty, the latest revision is retrieved. + # The format is "000001-a4d", where the first six characters define + # the zero-padded decimal revision number. They are followed by a hyphen and + # three hexadecimal characters. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Workflows::V1::Workflow] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Workflows::V1::Workflow] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/workflows/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Workflows::V1::Workflows::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Workflows::V1::GetWorkflowRequest.new + # + # # Call the get_workflow method. + # result = client.get_workflow request + # + # # The returned object is of type Google::Cloud::Workflows::V1::Workflow. + # p result + # + def get_workflow request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workflows::V1::GetWorkflowRequest + + # Converts hash 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_workflow.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::Workflows::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_workflow.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_workflow.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @workflows_stub.call_rpc :get_workflow, 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 workflow. If a workflow with the specified name already + # exists in the specified project and location, the long running operation + # returns a [ALREADY_EXISTS][google.rpc.Code.ALREADY_EXISTS] error. + # + # @overload create_workflow(request, options = nil) + # Pass arguments to `create_workflow` via a request object, either of type + # {::Google::Cloud::Workflows::V1::CreateWorkflowRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Workflows::V1::CreateWorkflowRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_workflow(parent: nil, workflow: nil, workflow_id: nil) + # Pass arguments to `create_workflow` via keyword arguments. Note that at + # least one keyword argument is 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. Project and location in which the workflow should be created. + # Format: projects/\\{project}/locations/\\{location} + # @param workflow [::Google::Cloud::Workflows::V1::Workflow, ::Hash] + # Required. Workflow to be created. + # @param workflow_id [::String] + # Required. The ID of the workflow to be created. It has to fulfill the + # following requirements: + # + # * Must contain only letters, numbers, underscores and hyphens. + # * Must start with a letter. + # * Must be between 1-64 characters. + # * Must end with a number or a letter. + # * Must be unique within the customer project and location. + # + # @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/workflows/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Workflows::V1::Workflows::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Workflows::V1::CreateWorkflowRequest.new + # + # # Call the create_workflow method. + # result = client.create_workflow 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_workflow request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workflows::V1::CreateWorkflowRequest + + # Converts hash 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_workflow.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::Workflows::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_workflow.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_workflow.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @workflows_stub.call_rpc :create_workflow, 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 workflow with the specified name. + # This method also cancels and deletes all running executions of the + # workflow. + # + # @overload delete_workflow(request, options = nil) + # Pass arguments to `delete_workflow` via a request object, either of type + # {::Google::Cloud::Workflows::V1::DeleteWorkflowRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Workflows::V1::DeleteWorkflowRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_workflow(name: nil) + # Pass arguments to `delete_workflow` via keyword arguments. Note that at + # least one keyword argument is 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 workflow to be deleted. + # Format: projects/\\{project}/locations/\\{location}/workflows/\\{workflow} + # + # @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/workflows/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Workflows::V1::Workflows::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Workflows::V1::DeleteWorkflowRequest.new + # + # # Call the delete_workflow method. + # result = client.delete_workflow 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_workflow request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workflows::V1::DeleteWorkflowRequest + + # Converts hash 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_workflow.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::Workflows::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_workflow.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_workflow.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @workflows_stub.call_rpc :delete_workflow, 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 + + ## + # Updates an existing workflow. + # Running this method has no impact on already running executions of the + # workflow. A new revision of the workflow might be created as a result of a + # successful update operation. In that case, the new revision is used + # in new workflow executions. + # + # @overload update_workflow(request, options = nil) + # Pass arguments to `update_workflow` via a request object, either of type + # {::Google::Cloud::Workflows::V1::UpdateWorkflowRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Workflows::V1::UpdateWorkflowRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_workflow(workflow: nil, update_mask: nil) + # Pass arguments to `update_workflow` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param workflow [::Google::Cloud::Workflows::V1::Workflow, ::Hash] + # Required. Workflow to be updated. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # List of fields to be updated. If not present, the entire workflow + # will be updated. + # + # @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/workflows/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Workflows::V1::Workflows::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Workflows::V1::UpdateWorkflowRequest.new + # + # # Call the update_workflow method. + # result = client.update_workflow 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 update_workflow request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workflows::V1::UpdateWorkflowRequest + + # Converts hash 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_workflow.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::Workflows::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.workflow&.name + header_params["workflow.name"] = request.workflow.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_workflow.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_workflow.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @workflows_stub.call_rpc :update_workflow, 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 + + ## + # Lists revisions for a given workflow. + # + # @overload list_workflow_revisions(request, options = nil) + # Pass arguments to `list_workflow_revisions` via a request object, either of type + # {::Google::Cloud::Workflows::V1::ListWorkflowRevisionsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Workflows::V1::ListWorkflowRevisionsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_workflow_revisions(name: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_workflow_revisions` via keyword arguments. Note that at + # least one keyword argument is 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. Workflow for which the revisions should be listed. + # Format: projects/\\{project}/locations/\\{location}/workflows/\\{workflow} + # @param page_size [::Integer] + # The maximum number of revisions to return per page. If a value is not + # specified, a default value of 20 is used. The maximum permitted value is + # 100. Values greater than 100 are coerced down to 100. + # @param page_token [::String] + # The page token, received from a previous ListWorkflowRevisions call. + # Provide this to retrieve the subsequent page. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Workflows::V1::Workflow>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::Workflows::V1::Workflow>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/workflows/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Workflows::V1::Workflows::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Workflows::V1::ListWorkflowRevisionsRequest.new + # + # # Call the list_workflow_revisions method. + # result = client.list_workflow_revisions 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::Workflows::V1::Workflow. + # p item + # end + # + def list_workflow_revisions request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workflows::V1::ListWorkflowRevisionsRequest + + # Converts hash 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_workflow_revisions.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::Workflows::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_workflow_revisions.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_workflow_revisions.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @workflows_stub.call_rpc :list_workflow_revisions, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @workflows_stub, :list_workflow_revisions, 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 Workflows API. + # + # This class represents the configuration for Workflows, + # 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::Workflows::V1::Workflows::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_workflows to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Workflows::V1::Workflows::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_workflows.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Workflows::V1::Workflows::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_workflows.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::Workflows::V1::Workflows::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 = "workflows.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 Workflows 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_workflows` + # @return [::Gapic::Config::Method] + # + attr_reader :list_workflows + ## + # RPC-specific configuration for `get_workflow` + # @return [::Gapic::Config::Method] + # + attr_reader :get_workflow + ## + # RPC-specific configuration for `create_workflow` + # @return [::Gapic::Config::Method] + # + attr_reader :create_workflow + ## + # RPC-specific configuration for `delete_workflow` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_workflow + ## + # RPC-specific configuration for `update_workflow` + # @return [::Gapic::Config::Method] + # + attr_reader :update_workflow + ## + # RPC-specific configuration for `list_workflow_revisions` + # @return [::Gapic::Config::Method] + # + attr_reader :list_workflow_revisions + + # @private + def initialize parent_rpcs = nil + list_workflows_config = parent_rpcs.list_workflows if parent_rpcs.respond_to? :list_workflows + @list_workflows = ::Gapic::Config::Method.new list_workflows_config + get_workflow_config = parent_rpcs.get_workflow if parent_rpcs.respond_to? :get_workflow + @get_workflow = ::Gapic::Config::Method.new get_workflow_config + create_workflow_config = parent_rpcs.create_workflow if parent_rpcs.respond_to? :create_workflow + @create_workflow = ::Gapic::Config::Method.new create_workflow_config + delete_workflow_config = parent_rpcs.delete_workflow if parent_rpcs.respond_to? :delete_workflow + @delete_workflow = ::Gapic::Config::Method.new delete_workflow_config + update_workflow_config = parent_rpcs.update_workflow if parent_rpcs.respond_to? :update_workflow + @update_workflow = ::Gapic::Config::Method.new update_workflow_config + list_workflow_revisions_config = parent_rpcs.list_workflow_revisions if parent_rpcs.respond_to? :list_workflow_revisions + @list_workflow_revisions = ::Gapic::Config::Method.new list_workflow_revisions_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-workflows-v1/lib/google/cloud/workflows/v1/workflows/credentials.rb b/owl-bot-staging/google-cloud-workflows-v1/lib/google/cloud/workflows/v1/workflows/credentials.rb new file mode 100644 index 000000000000..2c4bc8c1e0e6 --- /dev/null +++ b/owl-bot-staging/google-cloud-workflows-v1/lib/google/cloud/workflows/v1/workflows/credentials.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! + +require "googleauth" + +module Google + module Cloud + module Workflows + module V1 + module Workflows + # Credentials for the Workflows API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/cloud-platform" + ] + self.env_vars = [ + "WORKFLOWS_CREDENTIALS", + "WORKFLOWS_KEYFILE", + "GOOGLE_CLOUD_CREDENTIALS", + "GOOGLE_CLOUD_KEYFILE", + "GCLOUD_KEYFILE", + "WORKFLOWS_CREDENTIALS_JSON", + "WORKFLOWS_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-workflows-v1/lib/google/cloud/workflows/v1/workflows/operations.rb b/owl-bot-staging/google-cloud-workflows-v1/lib/google/cloud/workflows/v1/workflows/operations.rb new file mode 100644 index 000000000000..8ed984c55f7f --- /dev/null +++ b/owl-bot-staging/google-cloud-workflows-v1/lib/google/cloud/workflows/v1/workflows/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 Workflows + module V1 + module Workflows + # Service that implements Longrunning Operations API. + class Operations + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "workflows.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :operations_stub + + ## + # Configuration for the Workflows 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 Workflows 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::Workflows::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::Workflows::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::Workflows::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::Workflows::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::Workflows::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 = "workflows.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-workflows-v1/lib/google/cloud/workflows/v1/workflows/paths.rb b/owl-bot-staging/google-cloud-workflows-v1/lib/google/cloud/workflows/v1/workflows/paths.rb new file mode 100644 index 000000000000..7c5a1c321b45 --- /dev/null +++ b/owl-bot-staging/google-cloud-workflows-v1/lib/google/cloud/workflows/v1/workflows/paths.rb @@ -0,0 +1,113 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Workflows + module V1 + module Workflows + # Path helper methods for the Workflows 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 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 Workflow resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/workflows/{workflow}` + # + # @param project [String] + # @param location [String] + # @param workflow [String] + # + # @return [::String] + def workflow_path project:, location:, workflow: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/workflows/#{workflow}" + end + + extend self + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-workflows-v1/lib/google/cloud/workflows/v1/workflows/rest.rb b/owl-bot-staging/google-cloud-workflows-v1/lib/google/cloud/workflows/v1/workflows/rest.rb new file mode 100644 index 000000000000..250354de6315 --- /dev/null +++ b/owl-bot-staging/google-cloud-workflows-v1/lib/google/cloud/workflows/v1/workflows/rest.rb @@ -0,0 +1,56 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/workflows/v1/version" +require "google/cloud/workflows/v1/bindings_override" + +require "google/cloud/workflows/v1/workflows/credentials" +require "google/cloud/workflows/v1/workflows/paths" +require "google/cloud/workflows/v1/workflows/rest/operations" +require "google/cloud/workflows/v1/workflows/rest/client" + +module Google + module Cloud + module Workflows + module V1 + ## + # Workflows is used to deploy and execute workflow programs. + # Workflows makes sure the program executes reliably, despite hardware and + # networking interruptions. + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/workflows/v1/workflows/rest" + # client = ::Google::Cloud::Workflows::V1::Workflows::Rest::Client.new + # + module Workflows + # Client for the REST transport + module Rest + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "rest", "helpers.rb" +require "google/cloud/workflows/v1/workflows/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-workflows-v1/lib/google/cloud/workflows/v1/workflows/rest/client.rb b/owl-bot-staging/google-cloud-workflows-v1/lib/google/cloud/workflows/v1/workflows/rest/client.rb new file mode 100644 index 000000000000..d0dd3d1e2592 --- /dev/null +++ b/owl-bot-staging/google-cloud-workflows-v1/lib/google/cloud/workflows/v1/workflows/rest/client.rb @@ -0,0 +1,997 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/workflows/v1/workflows_pb" +require "google/cloud/workflows/v1/workflows/rest/service_stub" +require "google/cloud/location/rest" + +module Google + module Cloud + module Workflows + module V1 + module Workflows + module Rest + ## + # REST client for the Workflows service. + # + # Workflows is used to deploy and execute workflow programs. + # Workflows makes sure the program executes reliably, despite hardware and + # networking interruptions. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "workflows.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :workflows_stub + + ## + # Configure the Workflows Client class. + # + # See {::Google::Cloud::Workflows::V1::Workflows::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all Workflows clients + # ::Google::Cloud::Workflows::V1::Workflows::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", "Workflows", "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 + end + yield @configure if block_given? + @configure + end + + ## + # Configure the Workflows 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::Workflows::V1::Workflows::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 + @workflows_stub.universe_domain + end + + ## + # Create a new Workflows REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Workflows::V1::Workflows::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Workflows::V1::Workflows::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Workflows 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::Workflows::V1::Workflows::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 + + @workflows_stub = ::Google::Cloud::Workflows::V1::Workflows::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials, + logger: @config.logger + ) + + @workflows_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 = @workflows_stub.endpoint + config.universe_domain = @workflows_stub.universe_domain + config.bindings_override = @config.bindings_override + config.logger = @workflows_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::Workflows::V1::Workflows::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 + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @workflows_stub.logger + end + + # Service calls + + ## + # Lists workflows in a given project and location. + # The default order is not specified. + # + # @overload list_workflows(request, options = nil) + # Pass arguments to `list_workflows` via a request object, either of type + # {::Google::Cloud::Workflows::V1::ListWorkflowsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Workflows::V1::ListWorkflowsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_workflows(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) + # Pass arguments to `list_workflows` via keyword arguments. Note that at + # least one keyword argument is 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. Project and location from which the workflows should be listed. + # Format: projects/\\{project}/locations/\\{location} + # @param page_size [::Integer] + # Maximum number of workflows to return per call. The service might return + # fewer than this value even if not at the end of the collection. If a value + # is not specified, a default value of 500 is used. The maximum permitted + # value is 1000 and values greater than 1000 are coerced down to 1000. + # @param page_token [::String] + # A page token, received from a previous `ListWorkflows` call. + # Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to `ListWorkflows` must + # match the call that provided the page token. + # @param filter [::String] + # Filter to restrict results to specific workflows. + # For details, see AIP-160. + # + # For example, if you are using the Google APIs Explorer: + # + # `state="SUCCEEDED"` + # + # or + # + # `createTime>"2023-08-01" AND state="FAILED"` + # @param order_by [::String] + # Comma-separated list of fields that specify the order of the results. + # Default sorting order for a field is ascending. To specify descending order + # for a field, append a "desc" suffix. + # If not specified, the results are returned in an unspecified order. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Workflows::V1::Workflow>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Workflows::V1::Workflow>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/workflows/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Workflows::V1::Workflows::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Workflows::V1::ListWorkflowsRequest.new + # + # # Call the list_workflows method. + # result = client.list_workflows 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::Workflows::V1::Workflow. + # p item + # end + # + def list_workflows request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workflows::V1::ListWorkflowsRequest + + # Converts hash 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_workflows.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::Workflows::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_workflows.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_workflows.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @workflows_stub.list_workflows request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @workflows_stub, :list_workflows, "workflows", 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 details of a single workflow. + # + # @overload get_workflow(request, options = nil) + # Pass arguments to `get_workflow` via a request object, either of type + # {::Google::Cloud::Workflows::V1::GetWorkflowRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Workflows::V1::GetWorkflowRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_workflow(name: nil, revision_id: nil) + # Pass arguments to `get_workflow` via keyword arguments. Note that at + # least one keyword argument is 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 workflow for which information should be retrieved. + # Format: projects/\\{project}/locations/\\{location}/workflows/\\{workflow} + # @param revision_id [::String] + # Optional. The revision of the workflow to retrieve. If the revision_id is + # empty, the latest revision is retrieved. + # The format is "000001-a4d", where the first six characters define + # the zero-padded decimal revision number. They are followed by a hyphen and + # three hexadecimal characters. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Workflows::V1::Workflow] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Workflows::V1::Workflow] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/workflows/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Workflows::V1::Workflows::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Workflows::V1::GetWorkflowRequest.new + # + # # Call the get_workflow method. + # result = client.get_workflow request + # + # # The returned object is of type Google::Cloud::Workflows::V1::Workflow. + # p result + # + def get_workflow request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workflows::V1::GetWorkflowRequest + + # Converts hash 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_workflow.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::Workflows::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_workflow.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_workflow.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @workflows_stub.get_workflow 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 workflow. If a workflow with the specified name already + # exists in the specified project and location, the long running operation + # returns a [ALREADY_EXISTS][google.rpc.Code.ALREADY_EXISTS] error. + # + # @overload create_workflow(request, options = nil) + # Pass arguments to `create_workflow` via a request object, either of type + # {::Google::Cloud::Workflows::V1::CreateWorkflowRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Workflows::V1::CreateWorkflowRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_workflow(parent: nil, workflow: nil, workflow_id: nil) + # Pass arguments to `create_workflow` via keyword arguments. Note that at + # least one keyword argument is 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. Project and location in which the workflow should be created. + # Format: projects/\\{project}/locations/\\{location} + # @param workflow [::Google::Cloud::Workflows::V1::Workflow, ::Hash] + # Required. Workflow to be created. + # @param workflow_id [::String] + # Required. The ID of the workflow to be created. It has to fulfill the + # following requirements: + # + # * Must contain only letters, numbers, underscores and hyphens. + # * Must start with a letter. + # * Must be between 1-64 characters. + # * Must end with a number or a letter. + # * Must be unique within the customer project and location. + # @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/workflows/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Workflows::V1::Workflows::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Workflows::V1::CreateWorkflowRequest.new + # + # # Call the create_workflow method. + # result = client.create_workflow 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_workflow request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workflows::V1::CreateWorkflowRequest + + # Converts hash 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_workflow.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::Workflows::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_workflow.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_workflow.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @workflows_stub.create_workflow 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 workflow with the specified name. + # This method also cancels and deletes all running executions of the + # workflow. + # + # @overload delete_workflow(request, options = nil) + # Pass arguments to `delete_workflow` via a request object, either of type + # {::Google::Cloud::Workflows::V1::DeleteWorkflowRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Workflows::V1::DeleteWorkflowRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_workflow(name: nil) + # Pass arguments to `delete_workflow` via keyword arguments. Note that at + # least one keyword argument is 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 workflow to be deleted. + # Format: projects/\\{project}/locations/\\{location}/workflows/\\{workflow} + # @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/workflows/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Workflows::V1::Workflows::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Workflows::V1::DeleteWorkflowRequest.new + # + # # Call the delete_workflow method. + # result = client.delete_workflow 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_workflow request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workflows::V1::DeleteWorkflowRequest + + # Converts hash 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_workflow.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::Workflows::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_workflow.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_workflow.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @workflows_stub.delete_workflow 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 + + ## + # Updates an existing workflow. + # Running this method has no impact on already running executions of the + # workflow. A new revision of the workflow might be created as a result of a + # successful update operation. In that case, the new revision is used + # in new workflow executions. + # + # @overload update_workflow(request, options = nil) + # Pass arguments to `update_workflow` via a request object, either of type + # {::Google::Cloud::Workflows::V1::UpdateWorkflowRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Workflows::V1::UpdateWorkflowRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_workflow(workflow: nil, update_mask: nil) + # Pass arguments to `update_workflow` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param workflow [::Google::Cloud::Workflows::V1::Workflow, ::Hash] + # Required. Workflow to be updated. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # List of fields to be updated. If not present, the entire workflow + # will be updated. + # @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/workflows/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Workflows::V1::Workflows::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Workflows::V1::UpdateWorkflowRequest.new + # + # # Call the update_workflow method. + # result = client.update_workflow 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 update_workflow request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workflows::V1::UpdateWorkflowRequest + + # Converts hash 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_workflow.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::Workflows::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_workflow.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_workflow.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @workflows_stub.update_workflow 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 + + ## + # Lists revisions for a given workflow. + # + # @overload list_workflow_revisions(request, options = nil) + # Pass arguments to `list_workflow_revisions` via a request object, either of type + # {::Google::Cloud::Workflows::V1::ListWorkflowRevisionsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Workflows::V1::ListWorkflowRevisionsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_workflow_revisions(name: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_workflow_revisions` via keyword arguments. Note that at + # least one keyword argument is 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. Workflow for which the revisions should be listed. + # Format: projects/\\{project}/locations/\\{location}/workflows/\\{workflow} + # @param page_size [::Integer] + # The maximum number of revisions to return per page. If a value is not + # specified, a default value of 20 is used. The maximum permitted value is + # 100. Values greater than 100 are coerced down to 100. + # @param page_token [::String] + # The page token, received from a previous ListWorkflowRevisions call. + # Provide this to retrieve the subsequent page. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Workflows::V1::Workflow>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Workflows::V1::Workflow>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/workflows/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Workflows::V1::Workflows::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Workflows::V1::ListWorkflowRevisionsRequest.new + # + # # Call the list_workflow_revisions method. + # result = client.list_workflow_revisions 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::Workflows::V1::Workflow. + # p item + # end + # + def list_workflow_revisions request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workflows::V1::ListWorkflowRevisionsRequest + + # Converts hash 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_workflow_revisions.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::Workflows::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_workflow_revisions.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_workflow_revisions.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @workflows_stub.list_workflow_revisions request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @workflows_stub, :list_workflow_revisions, "workflows", 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 Workflows REST API. + # + # This class represents the configuration for Workflows 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::Workflows::V1::Workflows::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_workflows to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Workflows::V1::Workflows::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_workflows.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Workflows::V1::Workflows::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_workflows.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 = "workflows.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 Workflows 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_workflows` + # @return [::Gapic::Config::Method] + # + attr_reader :list_workflows + ## + # RPC-specific configuration for `get_workflow` + # @return [::Gapic::Config::Method] + # + attr_reader :get_workflow + ## + # RPC-specific configuration for `create_workflow` + # @return [::Gapic::Config::Method] + # + attr_reader :create_workflow + ## + # RPC-specific configuration for `delete_workflow` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_workflow + ## + # RPC-specific configuration for `update_workflow` + # @return [::Gapic::Config::Method] + # + attr_reader :update_workflow + ## + # RPC-specific configuration for `list_workflow_revisions` + # @return [::Gapic::Config::Method] + # + attr_reader :list_workflow_revisions + + # @private + def initialize parent_rpcs = nil + list_workflows_config = parent_rpcs.list_workflows if parent_rpcs.respond_to? :list_workflows + @list_workflows = ::Gapic::Config::Method.new list_workflows_config + get_workflow_config = parent_rpcs.get_workflow if parent_rpcs.respond_to? :get_workflow + @get_workflow = ::Gapic::Config::Method.new get_workflow_config + create_workflow_config = parent_rpcs.create_workflow if parent_rpcs.respond_to? :create_workflow + @create_workflow = ::Gapic::Config::Method.new create_workflow_config + delete_workflow_config = parent_rpcs.delete_workflow if parent_rpcs.respond_to? :delete_workflow + @delete_workflow = ::Gapic::Config::Method.new delete_workflow_config + update_workflow_config = parent_rpcs.update_workflow if parent_rpcs.respond_to? :update_workflow + @update_workflow = ::Gapic::Config::Method.new update_workflow_config + list_workflow_revisions_config = parent_rpcs.list_workflow_revisions if parent_rpcs.respond_to? :list_workflow_revisions + @list_workflow_revisions = ::Gapic::Config::Method.new list_workflow_revisions_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-workflows-v1/lib/google/cloud/workflows/v1/workflows/rest/operations.rb b/owl-bot-staging/google-cloud-workflows-v1/lib/google/cloud/workflows/v1/workflows/rest/operations.rb new file mode 100644 index 000000000000..7aead07230f8 --- /dev/null +++ b/owl-bot-staging/google-cloud-workflows-v1/lib/google/cloud/workflows/v1/workflows/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 Workflows + module V1 + module Workflows + module Rest + # Service that implements Longrunning Operations API. + class Operations + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "workflows.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :operations_stub + + ## + # Configuration for the Workflows 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 Workflows 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::Workflows::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::Workflows::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::Workflows::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::Workflows::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 = "workflows.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}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/?$}, 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{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + 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-workflows-v1/lib/google/cloud/workflows/v1/workflows/rest/service_stub.rb b/owl-bot-staging/google-cloud-workflows-v1/lib/google/cloud/workflows/v1/workflows/rest/service_stub.rb new file mode 100644 index 000000000000..c36b18474d53 --- /dev/null +++ b/owl-bot-staging/google-cloud-workflows-v1/lib/google/cloud/workflows/v1/workflows/rest/service_stub.rb @@ -0,0 +1,449 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/workflows/v1/workflows_pb" + +module Google + module Cloud + module Workflows + module V1 + module Workflows + module Rest + ## + # REST service stub for the Workflows 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_workflows REST call + # + # @param request_pb [::Google::Cloud::Workflows::V1::ListWorkflowsRequest] + # 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::Workflows::V1::ListWorkflowsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Workflows::V1::ListWorkflowsResponse] + # A result object deserialized from the server's reply + def list_workflows request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_workflows_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_workflows", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Workflows::V1::ListWorkflowsResponse.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_workflow REST call + # + # @param request_pb [::Google::Cloud::Workflows::V1::GetWorkflowRequest] + # 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::Workflows::V1::Workflow] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Workflows::V1::Workflow] + # A result object deserialized from the server's reply + def get_workflow request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_workflow_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_workflow", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Workflows::V1::Workflow.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_workflow REST call + # + # @param request_pb [::Google::Cloud::Workflows::V1::CreateWorkflowRequest] + # 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_workflow request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_workflow_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_workflow", + 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_workflow REST call + # + # @param request_pb [::Google::Cloud::Workflows::V1::DeleteWorkflowRequest] + # 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_workflow request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_workflow_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_workflow", + 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 update_workflow REST call + # + # @param request_pb [::Google::Cloud::Workflows::V1::UpdateWorkflowRequest] + # 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 update_workflow request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_workflow_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_workflow", + 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 list_workflow_revisions REST call + # + # @param request_pb [::Google::Cloud::Workflows::V1::ListWorkflowRevisionsRequest] + # 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::Workflows::V1::ListWorkflowRevisionsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Workflows::V1::ListWorkflowRevisionsResponse] + # A result object deserialized from the server's reply + def list_workflow_revisions request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_workflow_revisions_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_workflow_revisions", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Workflows::V1::ListWorkflowRevisionsResponse.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_workflows REST call + # + # @param request_pb [::Google::Cloud::Workflows::V1::ListWorkflowsRequest] + # 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_workflows_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/workflows", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_workflow REST call + # + # @param request_pb [::Google::Cloud::Workflows::V1::GetWorkflowRequest] + # 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_workflow_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/workflows/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_workflow REST call + # + # @param request_pb [::Google::Cloud::Workflows::V1::CreateWorkflowRequest] + # 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_workflow_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/workflows", + body: "workflow", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_workflow REST call + # + # @param request_pb [::Google::Cloud::Workflows::V1::DeleteWorkflowRequest] + # 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_workflow_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/workflows/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_workflow REST call + # + # @param request_pb [::Google::Cloud::Workflows::V1::UpdateWorkflowRequest] + # 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_workflow_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v1/{workflow.name}", + body: "workflow", + matches: [ + ["workflow.name", %r{^projects/[^/]+/locations/[^/]+/workflows/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_workflow_revisions REST call + # + # @param request_pb [::Google::Cloud::Workflows::V1::ListWorkflowRevisionsRequest] + # 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_workflow_revisions_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}:listRevisions", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/workflows/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-workflows-v1/lib/google/cloud/workflows/v1/workflows_pb.rb b/owl-bot-staging/google-cloud-workflows-v1/lib/google/cloud/workflows/v1/workflows_pb.rb new file mode 100644 index 000000000000..0ccabf5cfd2d --- /dev/null +++ b/owl-bot-staging/google-cloud-workflows-v1/lib/google/cloud/workflows/v1/workflows_pb.rb @@ -0,0 +1,44 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/workflows/v1/workflows.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/empty_pb' +require 'google/protobuf/field_mask_pb' +require 'google/protobuf/timestamp_pb' + + +descriptor_data = "\n)google/cloud/workflows/v1/workflows.proto\x12\x19google.cloud.workflows.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\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\x8d\r\n\x08Workflow\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x02 \x01(\t\x12=\n\x05state\x18\x03 \x01(\x0e\x32).google.cloud.workflows.v1.Workflow.StateB\x03\xe0\x41\x03\x12\x18\n\x0brevision_id\x18\x04 \x01(\tB\x03\xe0\x41\x03\x12\x34\n\x0b\x63reate_time\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12=\n\x14revision_create_time\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12?\n\x06labels\x18\x08 \x03(\x0b\x32/.google.cloud.workflows.v1.Workflow.LabelsEntry\x12\x17\n\x0fservice_account\x18\t \x01(\t\x12\x19\n\x0fsource_contents\x18\n \x01(\tH\x00\x12\x42\n\x0f\x63rypto_key_name\x18\x0b \x01(\tB)\xe0\x41\x01\xfa\x41#\n!cloudkms.googleapis.com/CryptoKey\x12H\n\x0bstate_error\x18\x0c \x01(\x0b\x32..google.cloud.workflows.v1.Workflow.StateErrorB\x03\xe0\x41\x03\x12M\n\x0e\x63\x61ll_log_level\x18\r \x01(\x0e\x32\x30.google.cloud.workflows.v1.Workflow.CallLogLevelB\x03\xe0\x41\x01\x12P\n\ruser_env_vars\x18\x0e \x03(\x0b\x32\x34.google.cloud.workflows.v1.Workflow.UserEnvVarsEntryB\x03\xe0\x41\x01\x12V\n\x17\x65xecution_history_level\x18\x0f \x01(\x0e\x32\x30.google.cloud.workflows.v1.ExecutionHistoryLevelB\x03\xe0\x41\x01\x12?\n\x0c\x61ll_kms_keys\x18\x10 \x03(\tB)\xe0\x41\x03\xfa\x41#\n!cloudkms.googleapis.com/CryptoKey\x12O\n\x15\x61ll_kms_keys_versions\x18\x11 \x03(\tB0\xe0\x41\x03\xfa\x41*\n(cloudkms.googleapis.com/CryptoKeyVersion\x12L\n\x12\x63rypto_key_version\x18\x12 \x01(\tB0\xe0\x41\x03\xfa\x41*\n(cloudkms.googleapis.com/CryptoKeyVersion\x12\x46\n\x04tags\x18\x13 \x03(\x0b\x32-.google.cloud.workflows.v1.Workflow.TagsEntryB\t\xe0\x41\x04\xe0\x41\x05\xe0\x41\x01\x1a\x8d\x01\n\nStateError\x12\x0f\n\x07\x64\x65tails\x18\x01 \x01(\t\x12\x41\n\x04type\x18\x02 \x01(\x0e\x32\x33.google.cloud.workflows.v1.Workflow.StateError.Type\"+\n\x04Type\x12\x14\n\x10TYPE_UNSPECIFIED\x10\x00\x12\r\n\tKMS_ERROR\x10\x01\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a\x32\n\x10UserEnvVarsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a+\n\tTagsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\";\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\n\n\x06\x41\x43TIVE\x10\x01\x12\x0f\n\x0bUNAVAILABLE\x10\x02\"d\n\x0c\x43\x61llLogLevel\x12\x1e\n\x1a\x43\x41LL_LOG_LEVEL_UNSPECIFIED\x10\x00\x12\x11\n\rLOG_ALL_CALLS\x10\x01\x12\x13\n\x0fLOG_ERRORS_ONLY\x10\x02\x12\x0c\n\x08LOG_NONE\x10\x03:d\xea\x41\x61\n!workflows.googleapis.com/Workflow\x12\xda\x41\x06parent\x82\xd3\xe4\x93\x02/\x12-/v1/{parent=projects/*/locations/*}/workflows\x12\x9f\x01\n\x0bGetWorkflow\x12-.google.cloud.workflows.v1.GetWorkflowRequest\x1a#.google.cloud.workflows.v1.Workflow\"<\xda\x41\x04name\x82\xd3\xe4\x93\x02/\x12-/v1/{name=projects/*/locations/*/workflows/*}\x12\xe0\x01\n\x0e\x43reateWorkflow\x12\x30.google.cloud.workflows.v1.CreateWorkflowRequest\x1a\x1d.google.longrunning.Operation\"}\xca\x41\x1d\n\x08Workflow\x12\x11OperationMetadata\xda\x41\x1bparent,workflow,workflow_id\x82\xd3\xe4\x93\x02\x39\"-/v1/{parent=projects/*/locations/*}/workflows:\x08workflow\x12\xcc\x01\n\x0e\x44\x65leteWorkflow\x12\x30.google.cloud.workflows.v1.DeleteWorkflowRequest\x1a\x1d.google.longrunning.Operation\"i\xca\x41*\n\x15google.protobuf.Empty\x12\x11OperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02/*-/v1/{name=projects/*/locations/*/workflows/*}\x12\xe2\x01\n\x0eUpdateWorkflow\x12\x30.google.cloud.workflows.v1.UpdateWorkflowRequest\x1a\x1d.google.longrunning.Operation\"\x7f\xca\x41\x1d\n\x08Workflow\x12\x11OperationMetadata\xda\x41\x14workflow,update_mask\x82\xd3\xe4\x93\x02\x42\x32\x36/v1/{workflow.name=projects/*/locations/*/workflows/*}:\x08workflow\x12\xcf\x01\n\x15ListWorkflowRevisions\x12\x37.google.cloud.workflows.v1.ListWorkflowRevisionsRequest\x1a\x38.google.cloud.workflows.v1.ListWorkflowRevisionsResponse\"C\x82\xd3\xe4\x93\x02=\x12;/v1/{name=projects/*/locations/*/workflows/*}:listRevisions\x1aL\xca\x41\x18workflows.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\x8d\x03\n\x1d\x63om.google.cloud.workflows.v1B\x0eWorkflowsProtoP\x01Z;cloud.google.com/go/workflows/apiv1/workflowspb;workflowspb\xea\x41v\n!cloudkms.googleapis.com/CryptoKey\x12Qprojects/{project}/locations/{location}/keyRings/{keyRing}/cryptoKeys/{cryptoKey}\xea\x41\xa2\x01\n(cloudkms.googleapis.com/CryptoKeyVersion\x12vprojects/{project}/locations/{location}/keyRings/{keyRing}/cryptoKeys/{cryptoKey}/cryptoKeyVersions/{cryptoKeyVersion}b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module Workflows + module V1 + Workflow = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.workflows.v1.Workflow").msgclass + Workflow::StateError = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.workflows.v1.Workflow.StateError").msgclass + Workflow::StateError::Type = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.workflows.v1.Workflow.StateError.Type").enummodule + Workflow::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.workflows.v1.Workflow.State").enummodule + Workflow::CallLogLevel = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.workflows.v1.Workflow.CallLogLevel").enummodule + ListWorkflowsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.workflows.v1.ListWorkflowsRequest").msgclass + ListWorkflowsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.workflows.v1.ListWorkflowsResponse").msgclass + GetWorkflowRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.workflows.v1.GetWorkflowRequest").msgclass + CreateWorkflowRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.workflows.v1.CreateWorkflowRequest").msgclass + DeleteWorkflowRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.workflows.v1.DeleteWorkflowRequest").msgclass + UpdateWorkflowRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.workflows.v1.UpdateWorkflowRequest").msgclass + OperationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.workflows.v1.OperationMetadata").msgclass + ListWorkflowRevisionsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.workflows.v1.ListWorkflowRevisionsRequest").msgclass + ListWorkflowRevisionsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.workflows.v1.ListWorkflowRevisionsResponse").msgclass + ExecutionHistoryLevel = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.workflows.v1.ExecutionHistoryLevel").enummodule + end + end + end +end diff --git a/owl-bot-staging/google-cloud-workflows-v1/lib/google/cloud/workflows/v1/workflows_services_pb.rb b/owl-bot-staging/google-cloud-workflows-v1/lib/google/cloud/workflows/v1/workflows_services_pb.rb new file mode 100644 index 000000000000..d568aa342f04 --- /dev/null +++ b/owl-bot-staging/google-cloud-workflows-v1/lib/google/cloud/workflows/v1/workflows_services_pb.rb @@ -0,0 +1,66 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/cloud/workflows/v1/workflows.proto for package 'google.cloud.workflows.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/workflows/v1/workflows_pb' + +module Google + module Cloud + module Workflows + module V1 + module Workflows + # Workflows is used to deploy and execute workflow programs. + # Workflows makes sure the program executes reliably, despite hardware and + # networking interruptions. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.cloud.workflows.v1.Workflows' + + # Lists workflows in a given project and location. + # The default order is not specified. + rpc :ListWorkflows, ::Google::Cloud::Workflows::V1::ListWorkflowsRequest, ::Google::Cloud::Workflows::V1::ListWorkflowsResponse + # Gets details of a single workflow. + rpc :GetWorkflow, ::Google::Cloud::Workflows::V1::GetWorkflowRequest, ::Google::Cloud::Workflows::V1::Workflow + # Creates a new workflow. If a workflow with the specified name already + # exists in the specified project and location, the long running operation + # returns a [ALREADY_EXISTS][google.rpc.Code.ALREADY_EXISTS] error. + rpc :CreateWorkflow, ::Google::Cloud::Workflows::V1::CreateWorkflowRequest, ::Google::Longrunning::Operation + # Deletes a workflow with the specified name. + # This method also cancels and deletes all running executions of the + # workflow. + rpc :DeleteWorkflow, ::Google::Cloud::Workflows::V1::DeleteWorkflowRequest, ::Google::Longrunning::Operation + # Updates an existing workflow. + # Running this method has no impact on already running executions of the + # workflow. A new revision of the workflow might be created as a result of a + # successful update operation. In that case, the new revision is used + # in new workflow executions. + rpc :UpdateWorkflow, ::Google::Cloud::Workflows::V1::UpdateWorkflowRequest, ::Google::Longrunning::Operation + # Lists revisions for a given workflow. + rpc :ListWorkflowRevisions, ::Google::Cloud::Workflows::V1::ListWorkflowRevisionsRequest, ::Google::Cloud::Workflows::V1::ListWorkflowRevisionsResponse + end + + Stub = Service.rpc_stub_class + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-workflows-v1/proto_docs/README.md b/owl-bot-staging/google-cloud-workflows-v1/proto_docs/README.md new file mode 100644 index 000000000000..5e25ae83a219 --- /dev/null +++ b/owl-bot-staging/google-cloud-workflows-v1/proto_docs/README.md @@ -0,0 +1,4 @@ +# Workflows 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-workflows-v1/proto_docs/google/api/client.rb b/owl-bot-staging/google-cloud-workflows-v1/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..3ab0b096d445 --- /dev/null +++ b/owl-bot-staging/google-cloud-workflows-v1/proto_docs/google/api/client.rb @@ -0,0 +1,593 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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. + # + # Note: This field should not be used in most cases. + 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: + # library_settings: + # 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. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Php. Clobbers the php_namespace option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.php.package_name" field + # in gapic.yaml. API teams should use the protobuf php_namespace option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # library_settings: + # php_settings: + # library_package: Google\Cloud\PubSub\V1 + 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. + # + # Example: + # + # 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 + # @!attribute [rw] batching + # @return [::Google::Api::BatchingConfigProto] + # Batching configuration for an API method in client libraries. + # + # Example of a YAML configuration: + # + # publishing: + # method_settings: + # - selector: google.example.v1.ExampleService.BatchCreateExample + # batching: + # element_count_threshold: 1000 + # request_byte_threshold: 100000000 + # delay_threshold_millis: 10 + 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. + # + # Note: This feature should not be used in most cases. + # @!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 + + # `BatchingConfigProto` defines the batching configuration for an API method. + # @!attribute [rw] thresholds + # @return [::Google::Api::BatchingSettingsProto] + # The thresholds which trigger a batched request to be sent. + # @!attribute [rw] batch_descriptor + # @return [::Google::Api::BatchingDescriptorProto] + # The request and response fields used in batching. + class BatchingConfigProto + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `BatchingSettingsProto` specifies a set of batching thresholds, each of + # which acts as a trigger to send a batch of messages as a request. At least + # one threshold must be positive nonzero. + # @!attribute [rw] element_count_threshold + # @return [::Integer] + # The number of elements of a field collected into a batch which, if + # exceeded, causes the batch to be sent. + # @!attribute [rw] request_byte_threshold + # @return [::Integer] + # The aggregated size of the batched field which, if exceeded, causes the + # batch to be sent. This size is computed by aggregating the sizes of the + # request field to be batched, not of the entire request message. + # @!attribute [rw] delay_threshold + # @return [::Google::Protobuf::Duration] + # The duration after which a batch should be sent, starting from the addition + # of the first message to that batch. + # @!attribute [rw] element_count_limit + # @return [::Integer] + # The maximum number of elements collected in a batch that could be accepted + # by server. + # @!attribute [rw] request_byte_limit + # @return [::Integer] + # The maximum size of the request that could be accepted by server. + # @!attribute [rw] flow_control_element_limit + # @return [::Integer] + # The maximum number of elements allowed by flow control. + # @!attribute [rw] flow_control_byte_limit + # @return [::Integer] + # The maximum size of data allowed by flow control. + # @!attribute [rw] flow_control_limit_exceeded_behavior + # @return [::Google::Api::FlowControlLimitExceededBehaviorProto] + # The behavior to take when the flow control limit is exceeded. + class BatchingSettingsProto + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `BatchingDescriptorProto` specifies the fields of the request message to be + # used for batching, and, optionally, the fields of the response message to be + # used for demultiplexing. + # @!attribute [rw] batched_field + # @return [::String] + # The repeated field in the request message to be aggregated by batching. + # @!attribute [rw] discriminator_fields + # @return [::Array<::String>] + # A list of the fields in the request message. Two requests will be batched + # together only if the values of every field specified in + # `request_discriminator_fields` is equal between the two requests. + # @!attribute [rw] subresponse_field + # @return [::String] + # Optional. When present, indicates the field in the response message to be + # used to demultiplex the response into multiple response messages, in + # correspondence with the multiple request messages originally batched + # together. + class BatchingDescriptorProto + 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 + + # The behavior to take when the flow control limit is exceeded. + module FlowControlLimitExceededBehaviorProto + # Default behavior, system-defined. + UNSET_BEHAVIOR = 0 + + # Stop operation, raise error. + THROW_EXCEPTION = 1 + + # Pause operation until limit clears. + BLOCK = 2 + + # Continue operation, disregard limit. + IGNORE = 3 + end + end +end diff --git a/owl-bot-staging/google-cloud-workflows-v1/proto_docs/google/api/field_behavior.rb b/owl-bot-staging/google-cloud-workflows-v1/proto_docs/google/api/field_behavior.rb new file mode 100644 index 000000000000..582be187d115 --- /dev/null +++ b/owl-bot-staging/google-cloud-workflows-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-workflows-v1/proto_docs/google/api/launch_stage.rb b/owl-bot-staging/google-cloud-workflows-v1/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..9392a413fb1b --- /dev/null +++ b/owl-bot-staging/google-cloud-workflows-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-workflows-v1/proto_docs/google/api/resource.rb b/owl-bot-staging/google-cloud-workflows-v1/proto_docs/google/api/resource.rb new file mode 100644 index 000000000000..25dec4847ac1 --- /dev/null +++ b/owl-bot-staging/google-cloud-workflows-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-workflows-v1/proto_docs/google/cloud/workflows/v1/workflows.rb b/owl-bot-staging/google-cloud-workflows-v1/proto_docs/google/cloud/workflows/v1/workflows.rb new file mode 100644 index 000000000000..78a09faef384 --- /dev/null +++ b/owl-bot-staging/google-cloud-workflows-v1/proto_docs/google/cloud/workflows/v1/workflows.rb @@ -0,0 +1,424 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Workflows + module V1 + # Workflow program to be executed by Workflows. + # @!attribute [rw] name + # @return [::String] + # The resource name of the workflow. + # Format: projects/\\{project}/locations/\\{location}/workflows/\\{workflow}. + # This is a workflow-wide field and is not tied to a specific revision. + # @!attribute [rw] description + # @return [::String] + # Description of the workflow provided by the user. + # Must be at most 1000 Unicode characters long. + # This is a workflow-wide field and is not tied to a specific revision. + # @!attribute [r] state + # @return [::Google::Cloud::Workflows::V1::Workflow::State] + # Output only. State of the workflow deployment. + # @!attribute [r] revision_id + # @return [::String] + # Output only. The revision of the workflow. + # A new revision of a workflow is created as a result of updating the + # following properties of a workflow: + # + # - {::Google::Cloud::Workflows::V1::Workflow#service_account Service account} + # - [Workflow code to be + # executed][google.cloud.workflows.v1.Workflow.source_contents] + # + # The format is "000001-a4d", where the first six characters define + # the zero-padded revision ordinal number. They are followed by a hyphen and + # three hexadecimal random characters. + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The timestamp for when the workflow was created. + # This is a workflow-wide field and is not tied to a specific revision. + # @!attribute [r] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The timestamp for when the workflow was last updated. + # This is a workflow-wide field and is not tied to a specific revision. + # @!attribute [r] revision_create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The timestamp for the latest revision of the workflow's + # creation. + # @!attribute [rw] labels + # @return [::Google::Protobuf::Map{::String => ::String}] + # Labels associated with this workflow. + # Labels can contain at most 64 entries. Keys and values can be no longer + # than 63 characters and can only contain lowercase letters, numeric + # characters, underscores, and dashes. Label keys must start with a letter. + # International characters are allowed. + # This is a workflow-wide field and is not tied to a specific revision. + # @!attribute [rw] service_account + # @return [::String] + # The service account associated with the latest workflow version. + # This service account represents the identity of the workflow and determines + # what permissions the workflow has. + # Format: projects/\\{project}/serviceAccounts/\\{account} or \\{account} + # + # Using `-` as a wildcard for the `{project}` or not providing one at all + # will infer the project from the account. The `{account}` value can be the + # `email` address or the `unique_id` of the service account. + # + # If not provided, workflow will use the project's default service account. + # Modifying this field for an existing workflow results in a new workflow + # revision. + # @!attribute [rw] source_contents + # @return [::String] + # Workflow code to be executed. The size limit is 128KB. + # @!attribute [rw] crypto_key_name + # @return [::String] + # Optional. The resource name of a KMS crypto key used to encrypt or decrypt + # the data associated with the workflow. + # + # Format: + # projects/\\{project}/locations/\\{location}/keyRings/\\{keyRing}/cryptoKeys/\\{cryptoKey} + # + # Using `-` as a wildcard for the `{project}` or not providing one at all + # will infer the project from the account. + # + # If not provided, data associated with the workflow will not be + # CMEK-encrypted. + # @!attribute [r] state_error + # @return [::Google::Cloud::Workflows::V1::Workflow::StateError] + # Output only. Error regarding the state of the workflow. For example, this + # field will have error details if the execution data is unavailable due to + # revoked KMS key permissions. + # @!attribute [rw] call_log_level + # @return [::Google::Cloud::Workflows::V1::Workflow::CallLogLevel] + # Optional. Describes the level of platform logging to apply to calls and + # call responses during executions of this workflow. If both the workflow and + # the execution specify a logging level, the execution level takes + # precedence. + # @!attribute [rw] user_env_vars + # @return [::Google::Protobuf::Map{::String => ::String}] + # Optional. User-defined environment variables associated with this workflow + # revision. This map has a maximum length of 20. Each string can take up to + # 4KiB. Keys cannot be empty strings and cannot start with "GOOGLE" or + # "WORKFLOWS". + # @!attribute [rw] execution_history_level + # @return [::Google::Cloud::Workflows::V1::ExecutionHistoryLevel] + # Optional. Describes the execution history level to apply to this workflow. + # @!attribute [r] all_kms_keys + # @return [::Array<::String>] + # Output only. A list of all KMS crypto keys used to encrypt or decrypt the + # data associated with the workflow. + # @!attribute [r] all_kms_keys_versions + # @return [::Array<::String>] + # Output only. A list of all KMS crypto key versions used to encrypt or + # decrypt the data associated with the workflow. + # @!attribute [r] crypto_key_version + # @return [::String] + # Output only. The resource name of a KMS crypto key version used to encrypt + # or decrypt the data associated with the workflow. + # + # Format: + # projects/\\{project}/locations/\\{location}/keyRings/\\{keyRing}/cryptoKeys/\\{cryptoKey}/cryptoKeyVersions/\\{cryptoKeyVersion} + # @!attribute [rw] tags + # @return [::Google::Protobuf::Map{::String => ::String}] + # Optional. Input only. Immutable. Tags associated with this workflow. + class Workflow + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes an error related to the current state of the workflow. + # @!attribute [rw] details + # @return [::String] + # Provides specifics about the error. + # @!attribute [rw] type + # @return [::Google::Cloud::Workflows::V1::Workflow::StateError::Type] + # The type of this state error. + class StateError + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Describes the possibled types of a state error. + module Type + # No type specified. + TYPE_UNSPECIFIED = 0 + + # Caused by an issue with KMS. + KMS_ERROR = 1 + end + end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class LabelsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class UserEnvVarsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class TagsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Describes the current state of workflow deployment. + module State + # Invalid state. + STATE_UNSPECIFIED = 0 + + # The workflow has been deployed successfully and is serving. + ACTIVE = 1 + + # Workflow data is unavailable. See the `state_error` field. + UNAVAILABLE = 2 + end + + # Describes the level of platform logging to apply to calls and call + # responses during workflow executions. + module CallLogLevel + # No call logging level specified. + CALL_LOG_LEVEL_UNSPECIFIED = 0 + + # Log all call steps within workflows, all call returns, and all exceptions + # raised. + LOG_ALL_CALLS = 1 + + # Log only exceptions that are raised from call steps within workflows. + LOG_ERRORS_ONLY = 2 + + # Explicitly log nothing. + LOG_NONE = 3 + end + end + + # Request for the + # {::Google::Cloud::Workflows::V1::Workflows::Client#list_workflows ListWorkflows} + # method. + # @!attribute [rw] parent + # @return [::String] + # Required. Project and location from which the workflows should be listed. + # Format: projects/\\{project}/locations/\\{location} + # @!attribute [rw] page_size + # @return [::Integer] + # Maximum number of workflows to return per call. The service might return + # fewer than this value even if not at the end of the collection. If a value + # is not specified, a default value of 500 is used. The maximum permitted + # value is 1000 and values greater than 1000 are coerced down to 1000. + # @!attribute [rw] page_token + # @return [::String] + # A page token, received from a previous `ListWorkflows` call. + # Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to `ListWorkflows` must + # match the call that provided the page token. + # @!attribute [rw] filter + # @return [::String] + # Filter to restrict results to specific workflows. + # For details, see AIP-160. + # + # For example, if you are using the Google APIs Explorer: + # + # `state="SUCCEEDED"` + # + # or + # + # `createTime>"2023-08-01" AND state="FAILED"` + # @!attribute [rw] order_by + # @return [::String] + # Comma-separated list of fields that specify the order of the results. + # Default sorting order for a field is ascending. To specify descending order + # for a field, append a "desc" suffix. + # If not specified, the results are returned in an unspecified order. + class ListWorkflowsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response for the + # {::Google::Cloud::Workflows::V1::Workflows::Client#list_workflows ListWorkflows} + # method. + # @!attribute [rw] workflows + # @return [::Array<::Google::Cloud::Workflows::V1::Workflow>] + # The workflows that match the request. + # @!attribute [rw] next_page_token + # @return [::String] + # A token, which can be sent as `page_token` to retrieve the next page. + # If this field is omitted, there are no subsequent pages. + # @!attribute [rw] unreachable + # @return [::Array<::String>] + # Unreachable resources. + class ListWorkflowsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request for the + # {::Google::Cloud::Workflows::V1::Workflows::Client#get_workflow GetWorkflow} method. + # @!attribute [rw] name + # @return [::String] + # Required. Name of the workflow for which information should be retrieved. + # Format: projects/\\{project}/locations/\\{location}/workflows/\\{workflow} + # @!attribute [rw] revision_id + # @return [::String] + # Optional. The revision of the workflow to retrieve. If the revision_id is + # empty, the latest revision is retrieved. + # The format is "000001-a4d", where the first six characters define + # the zero-padded decimal revision number. They are followed by a hyphen and + # three hexadecimal characters. + class GetWorkflowRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request for the + # {::Google::Cloud::Workflows::V1::Workflows::Client#create_workflow CreateWorkflow} + # method. + # @!attribute [rw] parent + # @return [::String] + # Required. Project and location in which the workflow should be created. + # Format: projects/\\{project}/locations/\\{location} + # @!attribute [rw] workflow + # @return [::Google::Cloud::Workflows::V1::Workflow] + # Required. Workflow to be created. + # @!attribute [rw] workflow_id + # @return [::String] + # Required. The ID of the workflow to be created. It has to fulfill the + # following requirements: + # + # * Must contain only letters, numbers, underscores and hyphens. + # * Must start with a letter. + # * Must be between 1-64 characters. + # * Must end with a number or a letter. + # * Must be unique within the customer project and location. + class CreateWorkflowRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request for the + # {::Google::Cloud::Workflows::V1::Workflows::Client#delete_workflow DeleteWorkflow} + # method. + # @!attribute [rw] name + # @return [::String] + # Required. Name of the workflow to be deleted. + # Format: projects/\\{project}/locations/\\{location}/workflows/\\{workflow} + class DeleteWorkflowRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request for the + # {::Google::Cloud::Workflows::V1::Workflows::Client#update_workflow UpdateWorkflow} + # method. + # @!attribute [rw] workflow + # @return [::Google::Cloud::Workflows::V1::Workflow] + # Required. Workflow to be updated. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # List of fields to be updated. If not present, the entire workflow + # will be updated. + class UpdateWorkflowRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Represents the metadata of the long-running operation. + # @!attribute [rw] create_time + # @return [::Google::Protobuf::Timestamp] + # The time the operation was created. + # @!attribute [rw] end_time + # @return [::Google::Protobuf::Timestamp] + # The time the operation finished running. + # @!attribute [rw] target + # @return [::String] + # Server-defined resource path for the target of the operation. + # @!attribute [rw] verb + # @return [::String] + # Name of the verb executed by the operation. + # @!attribute [rw] api_version + # @return [::String] + # API version used to start the operation. + class OperationMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request for the + # {::Google::Cloud::Workflows::V1::Workflows::Client#list_workflow_revisions ListWorkflowRevisions} + # method. + # @!attribute [rw] name + # @return [::String] + # Required. Workflow for which the revisions should be listed. + # Format: projects/\\{project}/locations/\\{location}/workflows/\\{workflow} + # @!attribute [rw] page_size + # @return [::Integer] + # The maximum number of revisions to return per page. If a value is not + # specified, a default value of 20 is used. The maximum permitted value is + # 100. Values greater than 100 are coerced down to 100. + # @!attribute [rw] page_token + # @return [::String] + # The page token, received from a previous ListWorkflowRevisions call. + # Provide this to retrieve the subsequent page. + class ListWorkflowRevisionsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response for the + # {::Google::Cloud::Workflows::V1::Workflows::Client#list_workflow_revisions ListWorkflowRevisions} + # method. + # @!attribute [rw] workflows + # @return [::Array<::Google::Cloud::Workflows::V1::Workflow>] + # The revisions of the workflow, ordered in reverse chronological order. + # @!attribute [rw] next_page_token + # @return [::String] + # A token, which can be sent as `page_token` to retrieve the next page. + # If this field is omitted, there are no subsequent pages. + class ListWorkflowRevisionsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Define possible options for enabling the execution history level. + module ExecutionHistoryLevel + # The default/unset value. + EXECUTION_HISTORY_LEVEL_UNSPECIFIED = 0 + + # Enable execution history basic feature. + EXECUTION_HISTORY_BASIC = 1 + + # Enable execution history detailed feature. + EXECUTION_HISTORY_DETAILED = 2 + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-workflows-v1/proto_docs/google/longrunning/operations.rb b/owl-bot-staging/google-cloud-workflows-v1/proto_docs/google/longrunning/operations.rb new file mode 100644 index 000000000000..7a757f512165 --- /dev/null +++ b/owl-bot-staging/google-cloud-workflows-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-workflows-v1/proto_docs/google/protobuf/any.rb b/owl-bot-staging/google-cloud-workflows-v1/proto_docs/google/protobuf/any.rb new file mode 100644 index 000000000000..58691995f02e --- /dev/null +++ b/owl-bot-staging/google-cloud-workflows-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-workflows-v1/proto_docs/google/protobuf/duration.rb b/owl-bot-staging/google-cloud-workflows-v1/proto_docs/google/protobuf/duration.rb new file mode 100644 index 000000000000..ea59f1f91daf --- /dev/null +++ b/owl-bot-staging/google-cloud-workflows-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-workflows-v1/proto_docs/google/protobuf/empty.rb b/owl-bot-staging/google-cloud-workflows-v1/proto_docs/google/protobuf/empty.rb new file mode 100644 index 000000000000..83e4481834a6 --- /dev/null +++ b/owl-bot-staging/google-cloud-workflows-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-workflows-v1/proto_docs/google/protobuf/field_mask.rb b/owl-bot-staging/google-cloud-workflows-v1/proto_docs/google/protobuf/field_mask.rb new file mode 100644 index 000000000000..7f3ffc78601a --- /dev/null +++ b/owl-bot-staging/google-cloud-workflows-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-workflows-v1/proto_docs/google/protobuf/timestamp.rb b/owl-bot-staging/google-cloud-workflows-v1/proto_docs/google/protobuf/timestamp.rb new file mode 100644 index 000000000000..74352be9c58c --- /dev/null +++ b/owl-bot-staging/google-cloud-workflows-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-workflows-v1/proto_docs/google/rpc/status.rb b/owl-bot-staging/google-cloud-workflows-v1/proto_docs/google/rpc/status.rb new file mode 100644 index 000000000000..c1a1c07eb2db --- /dev/null +++ b/owl-bot-staging/google-cloud-workflows-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-workflows-v1/snippets/Gemfile b/owl-bot-staging/google-cloud-workflows-v1/snippets/Gemfile new file mode 100644 index 000000000000..3f40a63d2540 --- /dev/null +++ b/owl-bot-staging/google-cloud-workflows-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-workflows-v1", path: "../" +else + gem "google-cloud-workflows-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-workflows-v1/snippets/snippet_metadata_google.cloud.workflows.v1.json b/owl-bot-staging/google-cloud-workflows-v1/snippets/snippet_metadata_google.cloud.workflows.v1.json new file mode 100644 index 000000000000..64415098c15f --- /dev/null +++ b/owl-bot-staging/google-cloud-workflows-v1/snippets/snippet_metadata_google.cloud.workflows.v1.json @@ -0,0 +1,255 @@ +{ + "client_library": { + "name": "google-cloud-workflows-v1", + "version": "", + "language": "RUBY", + "apis": [ + { + "id": "google.cloud.workflows.v1", + "version": "v1" + } + ] + }, + "snippets": [ + { + "region_tag": "workflows_v1_generated_Workflows_ListWorkflows_sync", + "title": "Snippet for the list_workflows call in the Workflows service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Workflows::V1::Workflows::Client#list_workflows.", + "file": "workflows/list_workflows.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_workflows", + "full_name": "::Google::Cloud::Workflows::V1::Workflows::Client#list_workflows", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Workflows::V1::ListWorkflowsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Workflows::V1::ListWorkflowsResponse", + "client": { + "short_name": "Workflows::Client", + "full_name": "::Google::Cloud::Workflows::V1::Workflows::Client" + }, + "method": { + "short_name": "ListWorkflows", + "full_name": "google.cloud.workflows.v1.Workflows.ListWorkflows", + "service": { + "short_name": "Workflows", + "full_name": "google.cloud.workflows.v1.Workflows" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "workflows_v1_generated_Workflows_GetWorkflow_sync", + "title": "Snippet for the get_workflow call in the Workflows service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Workflows::V1::Workflows::Client#get_workflow.", + "file": "workflows/get_workflow.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_workflow", + "full_name": "::Google::Cloud::Workflows::V1::Workflows::Client#get_workflow", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Workflows::V1::GetWorkflowRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Workflows::V1::Workflow", + "client": { + "short_name": "Workflows::Client", + "full_name": "::Google::Cloud::Workflows::V1::Workflows::Client" + }, + "method": { + "short_name": "GetWorkflow", + "full_name": "google.cloud.workflows.v1.Workflows.GetWorkflow", + "service": { + "short_name": "Workflows", + "full_name": "google.cloud.workflows.v1.Workflows" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "workflows_v1_generated_Workflows_CreateWorkflow_sync", + "title": "Snippet for the create_workflow call in the Workflows service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Workflows::V1::Workflows::Client#create_workflow.", + "file": "workflows/create_workflow.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_workflow", + "full_name": "::Google::Cloud::Workflows::V1::Workflows::Client#create_workflow", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Workflows::V1::CreateWorkflowRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "Workflows::Client", + "full_name": "::Google::Cloud::Workflows::V1::Workflows::Client" + }, + "method": { + "short_name": "CreateWorkflow", + "full_name": "google.cloud.workflows.v1.Workflows.CreateWorkflow", + "service": { + "short_name": "Workflows", + "full_name": "google.cloud.workflows.v1.Workflows" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "workflows_v1_generated_Workflows_DeleteWorkflow_sync", + "title": "Snippet for the delete_workflow call in the Workflows service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Workflows::V1::Workflows::Client#delete_workflow.", + "file": "workflows/delete_workflow.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_workflow", + "full_name": "::Google::Cloud::Workflows::V1::Workflows::Client#delete_workflow", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Workflows::V1::DeleteWorkflowRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "Workflows::Client", + "full_name": "::Google::Cloud::Workflows::V1::Workflows::Client" + }, + "method": { + "short_name": "DeleteWorkflow", + "full_name": "google.cloud.workflows.v1.Workflows.DeleteWorkflow", + "service": { + "short_name": "Workflows", + "full_name": "google.cloud.workflows.v1.Workflows" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "workflows_v1_generated_Workflows_UpdateWorkflow_sync", + "title": "Snippet for the update_workflow call in the Workflows service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Workflows::V1::Workflows::Client#update_workflow.", + "file": "workflows/update_workflow.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_workflow", + "full_name": "::Google::Cloud::Workflows::V1::Workflows::Client#update_workflow", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Workflows::V1::UpdateWorkflowRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "Workflows::Client", + "full_name": "::Google::Cloud::Workflows::V1::Workflows::Client" + }, + "method": { + "short_name": "UpdateWorkflow", + "full_name": "google.cloud.workflows.v1.Workflows.UpdateWorkflow", + "service": { + "short_name": "Workflows", + "full_name": "google.cloud.workflows.v1.Workflows" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "workflows_v1_generated_Workflows_ListWorkflowRevisions_sync", + "title": "Snippet for the list_workflow_revisions call in the Workflows service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Workflows::V1::Workflows::Client#list_workflow_revisions.", + "file": "workflows/list_workflow_revisions.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_workflow_revisions", + "full_name": "::Google::Cloud::Workflows::V1::Workflows::Client#list_workflow_revisions", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Workflows::V1::ListWorkflowRevisionsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Workflows::V1::ListWorkflowRevisionsResponse", + "client": { + "short_name": "Workflows::Client", + "full_name": "::Google::Cloud::Workflows::V1::Workflows::Client" + }, + "method": { + "short_name": "ListWorkflowRevisions", + "full_name": "google.cloud.workflows.v1.Workflows.ListWorkflowRevisions", + "service": { + "short_name": "Workflows", + "full_name": "google.cloud.workflows.v1.Workflows" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + } + ] +} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-workflows-v1/snippets/workflows/create_workflow.rb b/owl-bot-staging/google-cloud-workflows-v1/snippets/workflows/create_workflow.rb new file mode 100644 index 000000000000..57bb5d7052f6 --- /dev/null +++ b/owl-bot-staging/google-cloud-workflows-v1/snippets/workflows/create_workflow.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 workflows_v1_generated_Workflows_CreateWorkflow_sync] +require "google/cloud/workflows/v1" + +## +# Snippet for the create_workflow call in the Workflows 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::Workflows::V1::Workflows::Client#create_workflow. +# +def create_workflow + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Workflows::V1::Workflows::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Workflows::V1::CreateWorkflowRequest.new + + # Call the create_workflow method. + result = client.create_workflow 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 workflows_v1_generated_Workflows_CreateWorkflow_sync] diff --git a/owl-bot-staging/google-cloud-workflows-v1/snippets/workflows/delete_workflow.rb b/owl-bot-staging/google-cloud-workflows-v1/snippets/workflows/delete_workflow.rb new file mode 100644 index 000000000000..ee3a675341df --- /dev/null +++ b/owl-bot-staging/google-cloud-workflows-v1/snippets/workflows/delete_workflow.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 workflows_v1_generated_Workflows_DeleteWorkflow_sync] +require "google/cloud/workflows/v1" + +## +# Snippet for the delete_workflow call in the Workflows 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::Workflows::V1::Workflows::Client#delete_workflow. +# +def delete_workflow + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Workflows::V1::Workflows::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Workflows::V1::DeleteWorkflowRequest.new + + # Call the delete_workflow method. + result = client.delete_workflow 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 workflows_v1_generated_Workflows_DeleteWorkflow_sync] diff --git a/owl-bot-staging/google-cloud-workflows-v1/snippets/workflows/get_workflow.rb b/owl-bot-staging/google-cloud-workflows-v1/snippets/workflows/get_workflow.rb new file mode 100644 index 000000000000..8e945eb77b52 --- /dev/null +++ b/owl-bot-staging/google-cloud-workflows-v1/snippets/workflows/get_workflow.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 workflows_v1_generated_Workflows_GetWorkflow_sync] +require "google/cloud/workflows/v1" + +## +# Snippet for the get_workflow call in the Workflows 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::Workflows::V1::Workflows::Client#get_workflow. +# +def get_workflow + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Workflows::V1::Workflows::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Workflows::V1::GetWorkflowRequest.new + + # Call the get_workflow method. + result = client.get_workflow request + + # The returned object is of type Google::Cloud::Workflows::V1::Workflow. + p result +end +# [END workflows_v1_generated_Workflows_GetWorkflow_sync] diff --git a/owl-bot-staging/google-cloud-workflows-v1/snippets/workflows/list_workflow_revisions.rb b/owl-bot-staging/google-cloud-workflows-v1/snippets/workflows/list_workflow_revisions.rb new file mode 100644 index 000000000000..24fa4adf9ff9 --- /dev/null +++ b/owl-bot-staging/google-cloud-workflows-v1/snippets/workflows/list_workflow_revisions.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 workflows_v1_generated_Workflows_ListWorkflowRevisions_sync] +require "google/cloud/workflows/v1" + +## +# Snippet for the list_workflow_revisions call in the Workflows 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::Workflows::V1::Workflows::Client#list_workflow_revisions. +# +def list_workflow_revisions + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Workflows::V1::Workflows::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Workflows::V1::ListWorkflowRevisionsRequest.new + + # Call the list_workflow_revisions method. + result = client.list_workflow_revisions 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::Workflows::V1::Workflow. + p item + end +end +# [END workflows_v1_generated_Workflows_ListWorkflowRevisions_sync] diff --git a/owl-bot-staging/google-cloud-workflows-v1/snippets/workflows/list_workflows.rb b/owl-bot-staging/google-cloud-workflows-v1/snippets/workflows/list_workflows.rb new file mode 100644 index 000000000000..423d261480f1 --- /dev/null +++ b/owl-bot-staging/google-cloud-workflows-v1/snippets/workflows/list_workflows.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 workflows_v1_generated_Workflows_ListWorkflows_sync] +require "google/cloud/workflows/v1" + +## +# Snippet for the list_workflows call in the Workflows 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::Workflows::V1::Workflows::Client#list_workflows. +# +def list_workflows + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Workflows::V1::Workflows::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Workflows::V1::ListWorkflowsRequest.new + + # Call the list_workflows method. + result = client.list_workflows 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::Workflows::V1::Workflow. + p item + end +end +# [END workflows_v1_generated_Workflows_ListWorkflows_sync] diff --git a/owl-bot-staging/google-cloud-workflows-v1/snippets/workflows/update_workflow.rb b/owl-bot-staging/google-cloud-workflows-v1/snippets/workflows/update_workflow.rb new file mode 100644 index 000000000000..20e240695166 --- /dev/null +++ b/owl-bot-staging/google-cloud-workflows-v1/snippets/workflows/update_workflow.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 workflows_v1_generated_Workflows_UpdateWorkflow_sync] +require "google/cloud/workflows/v1" + +## +# Snippet for the update_workflow call in the Workflows 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::Workflows::V1::Workflows::Client#update_workflow. +# +def update_workflow + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Workflows::V1::Workflows::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Workflows::V1::UpdateWorkflowRequest.new + + # Call the update_workflow method. + result = client.update_workflow 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 workflows_v1_generated_Workflows_UpdateWorkflow_sync] diff --git a/owl-bot-staging/google-cloud-workflows-v1/test/google/cloud/workflows/v1/workflows_operations_test.rb b/owl-bot-staging/google-cloud-workflows-v1/test/google/cloud/workflows/v1/workflows_operations_test.rb new file mode 100644 index 000000000000..733d55434ff1 --- /dev/null +++ b/owl-bot-staging/google-cloud-workflows-v1/test/google/cloud/workflows/v1/workflows_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/workflows/v1/workflows_pb" +require "google/cloud/workflows/v1/workflows_services_pb" +require "google/cloud/workflows/v1/workflows" + +class ::Google::Cloud::Workflows::V1::Workflows::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::Workflows::V1::Workflows::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::Workflows::V1::Workflows::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::Workflows::V1::Workflows::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::Workflows::V1::Workflows::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::Workflows::V1::Workflows::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::Workflows::V1::Workflows::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::Workflows::V1::Workflows::Operations::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-workflows-v1/test/google/cloud/workflows/v1/workflows_paths_test.rb b/owl-bot-staging/google-cloud-workflows-v1/test/google/cloud/workflows/v1/workflows_paths_test.rb new file mode 100644 index 000000000000..940534eeb434 --- /dev/null +++ b/owl-bot-staging/google-cloud-workflows-v1/test/google/cloud/workflows/v1/workflows_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/workflows/v1/workflows" + +class ::Google::Cloud::Workflows::V1::Workflows::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::Workflows::V1::Workflows::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::Workflows::V1::Workflows::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_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::Workflows::V1::Workflows::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_workflow_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Workflows::V1::Workflows::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.workflow_path project: "value0", location: "value1", workflow: "value2" + assert_equal "projects/value0/locations/value1/workflows/value2", path + end + end +end diff --git a/owl-bot-staging/google-cloud-workflows-v1/test/google/cloud/workflows/v1/workflows_rest_test.rb b/owl-bot-staging/google-cloud-workflows-v1/test/google/cloud/workflows/v1/workflows_rest_test.rb new file mode 100644 index 000000000000..475012b3f7fd --- /dev/null +++ b/owl-bot-staging/google-cloud-workflows-v1/test/google/cloud/workflows/v1/workflows_rest_test.rb @@ -0,0 +1,433 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/workflows/v1/workflows_pb" +require "google/cloud/workflows/v1/workflows/rest" + + +class ::Google::Cloud::Workflows::V1::Workflows::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_workflows + # Create test objects. + client_result = ::Google::Cloud::Workflows::V1::ListWorkflowsResponse.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_workflows_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::Workflows::V1::Workflows::Rest::ServiceStub.stub :transcode_list_workflows_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_workflows_client_stub do + # Create client + client = ::Google::Cloud::Workflows::V1::Workflows::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_workflows({ 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_workflows 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_workflows ::Google::Cloud::Workflows::V1::ListWorkflowsRequest.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_workflows({ 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_workflows(::Google::Cloud::Workflows::V1::ListWorkflowsRequest.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_workflows_client_stub.call_count + end + end + end + + def test_get_workflow + # Create test objects. + client_result = ::Google::Cloud::Workflows::V1::Workflow.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + revision_id = "hello world" + + get_workflow_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::Workflows::V1::Workflows::Rest::ServiceStub.stub :transcode_get_workflow_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_workflow_client_stub do + # Create client + client = ::Google::Cloud::Workflows::V1::Workflows::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_workflow({ name: name, revision_id: revision_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_workflow name: name, revision_id: revision_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_workflow ::Google::Cloud::Workflows::V1::GetWorkflowRequest.new(name: name, revision_id: revision_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_workflow({ name: name, revision_id: revision_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_workflow(::Google::Cloud::Workflows::V1::GetWorkflowRequest.new(name: name, revision_id: revision_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_workflow_client_stub.call_count + end + end + end + + def test_create_workflow + # 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" + workflow = {} + workflow_id = "hello world" + + create_workflow_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::Workflows::V1::Workflows::Rest::ServiceStub.stub :transcode_create_workflow_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_workflow_client_stub do + # Create client + client = ::Google::Cloud::Workflows::V1::Workflows::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_workflow({ parent: parent, workflow: workflow, workflow_id: workflow_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_workflow parent: parent, workflow: workflow, workflow_id: workflow_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_workflow ::Google::Cloud::Workflows::V1::CreateWorkflowRequest.new(parent: parent, workflow: workflow, workflow_id: workflow_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_workflow({ parent: parent, workflow: workflow, workflow_id: workflow_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_workflow(::Google::Cloud::Workflows::V1::CreateWorkflowRequest.new(parent: parent, workflow: workflow, workflow_id: workflow_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_workflow_client_stub.call_count + end + end + end + + def test_delete_workflow + # 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_workflow_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::Workflows::V1::Workflows::Rest::ServiceStub.stub :transcode_delete_workflow_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_workflow_client_stub do + # Create client + client = ::Google::Cloud::Workflows::V1::Workflows::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_workflow({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_workflow name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_workflow ::Google::Cloud::Workflows::V1::DeleteWorkflowRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_workflow({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_workflow(::Google::Cloud::Workflows::V1::DeleteWorkflowRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_workflow_client_stub.call_count + end + end + end + + def test_update_workflow + # 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. + workflow = {} + update_mask = {} + + update_workflow_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::Workflows::V1::Workflows::Rest::ServiceStub.stub :transcode_update_workflow_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_workflow_client_stub do + # Create client + client = ::Google::Cloud::Workflows::V1::Workflows::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_workflow({ workflow: workflow, update_mask: update_mask }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_workflow workflow: workflow, update_mask: update_mask do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_workflow ::Google::Cloud::Workflows::V1::UpdateWorkflowRequest.new(workflow: workflow, update_mask: update_mask) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_workflow({ workflow: workflow, update_mask: update_mask }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_workflow(::Google::Cloud::Workflows::V1::UpdateWorkflowRequest.new(workflow: workflow, update_mask: update_mask), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_workflow_client_stub.call_count + end + end + end + + def test_list_workflow_revisions + # Create test objects. + client_result = ::Google::Cloud::Workflows::V1::ListWorkflowRevisionsResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + page_size = 42 + page_token = "hello world" + + list_workflow_revisions_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::Workflows::V1::Workflows::Rest::ServiceStub.stub :transcode_list_workflow_revisions_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_workflow_revisions_client_stub do + # Create client + client = ::Google::Cloud::Workflows::V1::Workflows::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_workflow_revisions({ name: name, page_size: page_size, page_token: page_token }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.list_workflow_revisions name: name, page_size: page_size, page_token: page_token do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.list_workflow_revisions ::Google::Cloud::Workflows::V1::ListWorkflowRevisionsRequest.new(name: name, 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_workflow_revisions({ name: name, 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_workflow_revisions(::Google::Cloud::Workflows::V1::ListWorkflowRevisionsRequest.new(name: name, 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_workflow_revisions_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::Workflows::V1::Workflows::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::Workflows::V1::Workflows::Rest::Client::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-workflows-v1/test/google/cloud/workflows/v1/workflows_test.rb b/owl-bot-staging/google-cloud-workflows-v1/test/google/cloud/workflows/v1/workflows_test.rb new file mode 100644 index 000000000000..588d6ca4b23a --- /dev/null +++ b/owl-bot-staging/google-cloud-workflows-v1/test/google/cloud/workflows/v1/workflows_test.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 "helper" + +require "gapic/grpc/service_stub" + +require "google/cloud/workflows/v1/workflows_pb" +require "google/cloud/workflows/v1/workflows" + +class ::Google::Cloud::Workflows::V1::Workflows::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_workflows + # Create GRPC objects. + grpc_response = ::Google::Cloud::Workflows::V1::ListWorkflowsResponse.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_workflows_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_workflows, name + assert_kind_of ::Google::Cloud::Workflows::V1::ListWorkflowsRequest, 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_workflows_client_stub do + # Create client + client = ::Google::Cloud::Workflows::V1::Workflows::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_workflows({ 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_workflows 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_workflows ::Google::Cloud::Workflows::V1::ListWorkflowsRequest.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_workflows({ 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_workflows(::Google::Cloud::Workflows::V1::ListWorkflowsRequest.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_workflows_client_stub.call_rpc_count + end + end + + def test_get_workflow + # Create GRPC objects. + grpc_response = ::Google::Cloud::Workflows::V1::Workflow.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" + revision_id = "hello world" + + get_workflow_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_workflow, name + assert_kind_of ::Google::Cloud::Workflows::V1::GetWorkflowRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["revision_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_workflow_client_stub do + # Create client + client = ::Google::Cloud::Workflows::V1::Workflows::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_workflow({ name: name, revision_id: revision_id }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_workflow name: name, revision_id: revision_id do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_workflow ::Google::Cloud::Workflows::V1::GetWorkflowRequest.new(name: name, revision_id: revision_id) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_workflow({ name: name, revision_id: revision_id }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_workflow(::Google::Cloud::Workflows::V1::GetWorkflowRequest.new(name: name, revision_id: revision_id), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_workflow_client_stub.call_rpc_count + end + end + + def test_create_workflow + # 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" + workflow = {} + workflow_id = "hello world" + + create_workflow_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_workflow, name + assert_kind_of ::Google::Cloud::Workflows::V1::CreateWorkflowRequest, request + assert_equal "hello world", request["parent"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Workflows::V1::Workflow), request["workflow"] + assert_equal "hello world", request["workflow_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_workflow_client_stub do + # Create client + client = ::Google::Cloud::Workflows::V1::Workflows::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_workflow({ parent: parent, workflow: workflow, workflow_id: workflow_id }) 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_workflow parent: parent, workflow: workflow, workflow_id: workflow_id 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_workflow ::Google::Cloud::Workflows::V1::CreateWorkflowRequest.new(parent: parent, workflow: workflow, workflow_id: workflow_id) 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_workflow({ parent: parent, workflow: workflow, workflow_id: workflow_id }, 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_workflow(::Google::Cloud::Workflows::V1::CreateWorkflowRequest.new(parent: parent, workflow: workflow, workflow_id: workflow_id), 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_workflow_client_stub.call_rpc_count + end + end + + def test_delete_workflow + # 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_workflow_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_workflow, name + assert_kind_of ::Google::Cloud::Workflows::V1::DeleteWorkflowRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_workflow_client_stub do + # Create client + client = ::Google::Cloud::Workflows::V1::Workflows::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_workflow({ 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_workflow 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_workflow ::Google::Cloud::Workflows::V1::DeleteWorkflowRequest.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_workflow({ 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_workflow(::Google::Cloud::Workflows::V1::DeleteWorkflowRequest.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_workflow_client_stub.call_rpc_count + end + end + + def test_update_workflow + # 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. + workflow = {} + update_mask = {} + + update_workflow_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_workflow, name + assert_kind_of ::Google::Cloud::Workflows::V1::UpdateWorkflowRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Workflows::V1::Workflow), request["workflow"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_workflow_client_stub do + # Create client + client = ::Google::Cloud::Workflows::V1::Workflows::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_workflow({ workflow: workflow, update_mask: update_mask }) 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.update_workflow workflow: workflow, update_mask: update_mask 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.update_workflow ::Google::Cloud::Workflows::V1::UpdateWorkflowRequest.new(workflow: workflow, update_mask: update_mask) 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.update_workflow({ workflow: workflow, update_mask: update_mask }, 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.update_workflow(::Google::Cloud::Workflows::V1::UpdateWorkflowRequest.new(workflow: workflow, update_mask: update_mask), 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, update_workflow_client_stub.call_rpc_count + end + end + + def test_list_workflow_revisions + # Create GRPC objects. + grpc_response = ::Google::Cloud::Workflows::V1::ListWorkflowRevisionsResponse.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" + page_size = 42 + page_token = "hello world" + + list_workflow_revisions_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_workflow_revisions, name + assert_kind_of ::Google::Cloud::Workflows::V1::ListWorkflowRevisionsRequest, request + assert_equal "hello world", request["name"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_workflow_revisions_client_stub do + # Create client + client = ::Google::Cloud::Workflows::V1::Workflows::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_workflow_revisions({ name: name, 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_workflow_revisions name: name, 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_workflow_revisions ::Google::Cloud::Workflows::V1::ListWorkflowRevisionsRequest.new(name: name, 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_workflow_revisions({ name: name, 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_workflow_revisions(::Google::Cloud::Workflows::V1::ListWorkflowRevisionsRequest.new(name: name, 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_workflow_revisions_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::Workflows::V1::Workflows::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::Workflows::V1::Workflows::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::Workflows::V1::Workflows::Client.new do |config| + config.credentials = creds + end + assert_kind_of ::Google::Cloud::Workflows::V1::Workflows::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::Workflows::V1::Workflows::Client.new do |config| + config.credentials = grpc_channel + end + end + + assert_kind_of ::Google::Cloud::Workflows::V1::Workflows::Operations, client.operations_client + end +end diff --git a/owl-bot-staging/google-cloud-workflows-v1/test/helper.rb b/owl-bot-staging/google-cloud-workflows-v1/test/helper.rb new file mode 100644 index 000000000000..672b337030e7 --- /dev/null +++ b/owl-bot-staging/google-cloud-workflows-v1/test/helper.rb @@ -0,0 +1,26 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/mock" +require "minitest/rg" + +require "grpc" + +require "ostruct" diff --git a/owl-bot-staging/google-cloud-workflows-v1beta/.gitignore b/owl-bot-staging/google-cloud-workflows-v1beta/.gitignore new file mode 100644 index 000000000000..0135b6bc6cfc --- /dev/null +++ b/owl-bot-staging/google-cloud-workflows-v1beta/.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-workflows-v1beta/.repo-metadata.json b/owl-bot-staging/google-cloud-workflows-v1beta/.repo-metadata.json new file mode 100644 index 000000000000..1d4a95557ac5 --- /dev/null +++ b/owl-bot-staging/google-cloud-workflows-v1beta/.repo-metadata.json @@ -0,0 +1,18 @@ +{ + "api_id": "workflows.googleapis.com", + "api_shortname": "workflows", + "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-workflows-v1beta/latest", + "distribution_name": "google-cloud-workflows-v1beta", + "is_cloud": true, + "language": "ruby", + "name": "workflows", + "name_pretty": "Workflows V1beta API", + "product_documentation": "https://cloud.google.com/workflows/", + "release_level": "unreleased", + "repo": "googleapis/google-cloud-ruby", + "requires_billing": true, + "ruby-cloud-description": "Workflows link series of serverless tasks together in an order you define. Combine the power of Google Cloud's APIs, serverless products like Cloud Functions and Cloud Run, and calls to external APIs to create flexible serverless applications. Workflows requires no infrastructure management and scales seamlessly with demand, including scaling down to zero.. Note that google-cloud-workflows-v1beta is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-workflows instead. See the readme for more details.", + "ruby-cloud-env-prefix": "WORKFLOWS", + "ruby-cloud-product-url": "https://cloud.google.com/workflows/", + "library_type": "GAPIC_AUTO" +} diff --git a/owl-bot-staging/google-cloud-workflows-v1beta/.rubocop.yml b/owl-bot-staging/google-cloud-workflows-v1beta/.rubocop.yml new file mode 100644 index 000000000000..40c98f2b2441 --- /dev/null +++ b/owl-bot-staging/google-cloud-workflows-v1beta/.rubocop.yml @@ -0,0 +1,33 @@ +inherit_gem: + google-style: google-style.yml + +AllCops: + Exclude: + - "google-cloud-workflows-v1beta.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-workflows-v1beta.rb" diff --git a/owl-bot-staging/google-cloud-workflows-v1beta/.toys.rb b/owl-bot-staging/google-cloud-workflows-v1beta/.toys.rb new file mode 100644 index 000000000000..177e22456e8a --- /dev/null +++ b/owl-bot-staging/google-cloud-workflows-v1beta/.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-workflows-v1beta/.yardopts b/owl-bot-staging/google-cloud-workflows-v1beta/.yardopts new file mode 100644 index 000000000000..56f969dffb3b --- /dev/null +++ b/owl-bot-staging/google-cloud-workflows-v1beta/.yardopts @@ -0,0 +1,12 @@ +--no-private +--title="Workflows V1beta 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-workflows-v1beta/AUTHENTICATION.md b/owl-bot-staging/google-cloud-workflows-v1beta/AUTHENTICATION.md new file mode 100644 index 000000000000..5854f731e93e --- /dev/null +++ b/owl-bot-staging/google-cloud-workflows-v1beta/AUTHENTICATION.md @@ -0,0 +1,122 @@ +# Authentication + +The recommended way to authenticate to the google-cloud-workflows-v1beta 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-workflows-v1beta 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/workflows/v1beta" + +client = ::Google::Cloud::Workflows::V1beta::Workflows::Client.new do |config| + config.credentials = "path/to/credentialfile.json" +end +``` + +To configure a credentials file globally for all clients: + +```ruby +require "google/cloud/workflows/v1beta" + +::Google::Cloud::Workflows::V1beta::Workflows::Client.configure do |config| + config.credentials = "path/to/credentialfile.json" +end + +client = ::Google::Cloud::Workflows::V1beta::Workflows::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-workflows-v1beta +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/workflows/v1beta" + +ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" + +client = ::Google::Cloud::Workflows::V1beta::Workflows::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-workflows-v1beta/CHANGELOG.md b/owl-bot-staging/google-cloud-workflows-v1beta/CHANGELOG.md new file mode 100644 index 000000000000..f88957a62ba2 --- /dev/null +++ b/owl-bot-staging/google-cloud-workflows-v1beta/CHANGELOG.md @@ -0,0 +1,2 @@ +# Release History + diff --git a/owl-bot-staging/google-cloud-workflows-v1beta/Gemfile b/owl-bot-staging/google-cloud-workflows-v1beta/Gemfile new file mode 100644 index 000000000000..1d08558908d8 --- /dev/null +++ b/owl-bot-staging/google-cloud-workflows-v1beta/Gemfile @@ -0,0 +1,14 @@ +source "https://rubygems.org" + +gemspec + +gem "google-style", "~> 1.32.0" +gem "irb", "~> 1.17" +gem "minitest", "~> 6.0.2" +gem "minitest-focus", "~> 1.4" +gem "minitest-mock", "~> 5.27" +gem "minitest-rg", "~> 5.3" +gem "ostruct", "~> 0.5.5" +gem "rake", ">= 13.0" +gem "redcarpet", "~> 3.6" +gem "yard", "~> 0.9" diff --git a/owl-bot-staging/google-cloud-workflows-v1beta/LICENSE.md b/owl-bot-staging/google-cloud-workflows-v1beta/LICENSE.md new file mode 100644 index 000000000000..c261857ba6ad --- /dev/null +++ b/owl-bot-staging/google-cloud-workflows-v1beta/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-workflows-v1beta/README.md b/owl-bot-staging/google-cloud-workflows-v1beta/README.md new file mode 100644 index 000000000000..9bd00b31c471 --- /dev/null +++ b/owl-bot-staging/google-cloud-workflows-v1beta/README.md @@ -0,0 +1,154 @@ +# Ruby Client for the Workflows V1beta API + +Manage workflow definitions. To execute workflows and manage executions, see the Workflows Executions API. + +Workflows link series of serverless tasks together in an order you define. Combine the power of Google Cloud's APIs, serverless products like Cloud Functions and Cloud Run, and calls to external APIs to create flexible serverless applications. Workflows requires no infrastructure management and scales seamlessly with demand, including scaling down to zero.. + +https://github.com/googleapis/google-cloud-ruby + +This gem is a _versioned_ client. It provides basic client classes for a +specific version of the Workflows V1beta API. Most users should consider using +the main client gem, +[google-cloud-workflows](https://rubygems.org/gems/google-cloud-workflows). +See the section below titled *Which client should I use?* for more information. + +## Installation + +``` +$ gem install google-cloud-workflows-v1beta +``` + +## 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/workflows.googleapis.com) +1. [Set up authentication.](AUTHENTICATION.md) + +## Quick Start + +```ruby +require "google/cloud/workflows/v1beta" + +client = ::Google::Cloud::Workflows::V1beta::Workflows::Client.new +request = ::Google::Cloud::Workflows::V1beta::ListWorkflowsRequest.new # (request fields as keyword arguments...) +response = client.list_workflows request +``` + +View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-workflows-v1beta/latest) +for class and method documentation. + +See also the [Product Documentation](https://cloud.google.com/workflows/) +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/workflows/v1beta" +require "logger" + +client = ::Google::Cloud::Workflows::V1beta::Workflows::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-workflows`, +and lower-level _versioned_ client libraries with names such as +`google-cloud-workflows-v1beta`. +_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-workflows`. +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-workflows-v1beta`. + +### 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-workflows-v1beta/Rakefile b/owl-bot-staging/google-cloud-workflows-v1beta/Rakefile new file mode 100644 index 000000000000..26a1b0335b69 --- /dev/null +++ b/owl-bot-staging/google-cloud-workflows-v1beta/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-workflows-v1beta acceptance tests." +task :acceptance, :project, :keyfile do |t, args| + project = args[:project] + project ||= + ENV["WORKFLOWS_TEST_PROJECT"] || + ENV["GCLOUD_TEST_PROJECT"] + keyfile = args[:keyfile] + keyfile ||= + ENV["WORKFLOWS_TEST_KEYFILE"] || + ENV["GCLOUD_TEST_KEYFILE"] + if keyfile + keyfile = File.read keyfile + else + keyfile ||= + ENV["WORKFLOWS_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 WORKFLOWS_TEST_PROJECT=test123 WORKFLOWS_TEST_KEYFILE=/path/to/keyfile.json rake acceptance" + end + require "google/cloud/workflows/v1beta/workflows/credentials" + ::Google::Cloud::Workflows::V1beta::Workflows::Credentials.env_vars.each do |path| + ENV[path] = nil + end + ENV["WORKFLOWS_PROJECT"] = project + ENV["WORKFLOWS_TEST_PROJECT"] = project + ENV["WORKFLOWS_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-workflows-v1beta 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-workflows-v1beta 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-workflows-v1beta 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-workflows-v1beta gem does not have doctest tests." +end + +desc "Run the CI build" +task :ci do + header "BUILDING google-cloud-workflows-v1beta" + header "google-cloud-workflows-v1beta rubocop", "*" + Rake::Task[:rubocop].invoke + header "google-cloud-workflows-v1beta yard", "*" + Rake::Task[:yard].invoke + header "google-cloud-workflows-v1beta 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-workflows-v1beta 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-workflows-v1beta 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-workflows-v1beta/gapic_metadata.json b/owl-bot-staging/google-cloud-workflows-v1beta/gapic_metadata.json new file mode 100644 index 000000000000..251ea95013fb --- /dev/null +++ b/owl-bot-staging/google-cloud-workflows-v1beta/gapic_metadata.json @@ -0,0 +1,43 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "ruby", + "protoPackage": "google.cloud.workflows.v1beta", + "libraryPackage": "::Google::Cloud::Workflows::V1beta", + "services": { + "Workflows": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::Workflows::V1beta::Workflows::Client", + "rpcs": { + "ListWorkflows": { + "methods": [ + "list_workflows" + ] + }, + "GetWorkflow": { + "methods": [ + "get_workflow" + ] + }, + "CreateWorkflow": { + "methods": [ + "create_workflow" + ] + }, + "DeleteWorkflow": { + "methods": [ + "delete_workflow" + ] + }, + "UpdateWorkflow": { + "methods": [ + "update_workflow" + ] + } + } + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-workflows-v1beta/google-cloud-workflows-v1beta.gemspec b/owl-bot-staging/google-cloud-workflows-v1beta/google-cloud-workflows-v1beta.gemspec new file mode 100644 index 000000000000..7fc0b732d071 --- /dev/null +++ b/owl-bot-staging/google-cloud-workflows-v1beta/google-cloud-workflows-v1beta.gemspec @@ -0,0 +1,29 @@ +# -*- ruby -*- +# encoding: utf-8 + +require File.expand_path("lib/google/cloud/workflows/v1beta/version", __dir__) + +Gem::Specification.new do |gem| + gem.name = "google-cloud-workflows-v1beta" + gem.version = Google::Cloud::Workflows::V1beta::VERSION + + gem.authors = ["Google LLC"] + gem.email = "googleapis-packages@google.com" + gem.description = "Workflows link series of serverless tasks together in an order you define. Combine the power of Google Cloud's APIs, serverless products like Cloud Functions and Cloud Run, and calls to external APIs to create flexible serverless applications. Workflows requires no infrastructure management and scales seamlessly with demand, including scaling down to zero.. Note that google-cloud-workflows-v1beta is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-workflows instead. See the readme for more details." + gem.summary = "Manage workflow definitions. To execute workflows and manage executions, see the Workflows Executions API." + 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.2" + + gem.add_dependency "gapic-common", "~> 1.2" + gem.add_dependency "google-cloud-errors", "~> 1.0" + gem.add_dependency "google-cloud-location", "~> 1.0" +end diff --git a/owl-bot-staging/google-cloud-workflows-v1beta/lib/google-cloud-workflows-v1beta.rb b/owl-bot-staging/google-cloud-workflows-v1beta/lib/google-cloud-workflows-v1beta.rb new file mode 100644 index 000000000000..6570d59e4c97 --- /dev/null +++ b/owl-bot-staging/google-cloud-workflows-v1beta/lib/google-cloud-workflows-v1beta.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/workflows/v1beta" diff --git a/owl-bot-staging/google-cloud-workflows-v1beta/lib/google/cloud/workflows/v1beta.rb b/owl-bot-staging/google-cloud-workflows-v1beta/lib/google/cloud/workflows/v1beta.rb new file mode 100644 index 000000000000..8ffa325a3d21 --- /dev/null +++ b/owl-bot-staging/google-cloud-workflows-v1beta/lib/google/cloud/workflows/v1beta.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/workflows/v1beta/workflows" +require "google/cloud/workflows/v1beta/version" + +module Google + module Cloud + module Workflows + ## + # API client module. + # + # @example Load this package, including all its services, and instantiate a gRPC client + # + # require "google/cloud/workflows/v1beta" + # client = ::Google::Cloud::Workflows::V1beta::Workflows::Client.new + # + # @example Load this package, including all its services, and instantiate a REST client + # + # require "google/cloud/workflows/v1beta" + # client = ::Google::Cloud::Workflows::V1beta::Workflows::Rest::Client.new + # + module V1beta + end + end + end +end + +helper_path = ::File.join __dir__, "v1beta", "_helpers.rb" +require "google/cloud/workflows/v1beta/_helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-workflows-v1beta/lib/google/cloud/workflows/v1beta/bindings_override.rb b/owl-bot-staging/google-cloud-workflows-v1beta/lib/google/cloud/workflows/v1beta/bindings_override.rb new file mode 100644 index 000000000000..89cc4db94d26 --- /dev/null +++ b/owl-bot-staging/google-cloud-workflows-v1beta/lib/google/cloud/workflows/v1beta/bindings_override.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! + +require "gapic/rest" + +module Google + module Cloud + module Workflows + ## + # @example Loading just the REST part of this package, including all its services, and instantiating a REST client + # + # require "google/cloud/workflows/v1beta/rest" + # client = ::Google::Cloud::Workflows::V1beta::Workflows::Rest::Client.new + # + module V1beta + ## + # @private + # Initialize the mixin bindings configuration + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "Workflows"] + 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: "/v1beta/{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: "/v1beta/{name}/locations", + matches: [ + ["name", %r{^projects/[^/]+/?$}, false] + ], + body: nil + ) + ] + default_config + end + yield @configure if block_given? + @configure + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-workflows-v1beta/lib/google/cloud/workflows/v1beta/rest.rb b/owl-bot-staging/google-cloud-workflows-v1beta/lib/google/cloud/workflows/v1beta/rest.rb new file mode 100644 index 000000000000..449f092f35af --- /dev/null +++ b/owl-bot-staging/google-cloud-workflows-v1beta/lib/google/cloud/workflows/v1beta/rest.rb @@ -0,0 +1,38 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/workflows/v1beta/workflows/rest" +require "google/cloud/workflows/v1beta/bindings_override" +require "google/cloud/workflows/v1beta/version" + +module Google + module Cloud + module Workflows + ## + # To load just the REST part of this package, including all its services, and instantiate a REST client: + # + # @example + # + # require "google/cloud/workflows/v1beta/rest" + # client = ::Google::Cloud::Workflows::V1beta::Workflows::Rest::Client.new + # + module V1beta + end + end + end +end diff --git a/owl-bot-staging/google-cloud-workflows-v1beta/lib/google/cloud/workflows/v1beta/version.rb b/owl-bot-staging/google-cloud-workflows-v1beta/lib/google/cloud/workflows/v1beta/version.rb new file mode 100644 index 000000000000..0bdbdee492ae --- /dev/null +++ b/owl-bot-staging/google-cloud-workflows-v1beta/lib/google/cloud/workflows/v1beta/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 Workflows + module V1beta + VERSION = "0.0.1" + end + end + end +end diff --git a/owl-bot-staging/google-cloud-workflows-v1beta/lib/google/cloud/workflows/v1beta/workflows.rb b/owl-bot-staging/google-cloud-workflows-v1beta/lib/google/cloud/workflows/v1beta/workflows.rb new file mode 100644 index 000000000000..0fcbf048c458 --- /dev/null +++ b/owl-bot-staging/google-cloud-workflows-v1beta/lib/google/cloud/workflows/v1beta/workflows.rb @@ -0,0 +1,58 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/workflows/v1beta/version" + +require "google/cloud/workflows/v1beta/workflows/credentials" +require "google/cloud/workflows/v1beta/workflows/paths" +require "google/cloud/workflows/v1beta/workflows/operations" +require "google/cloud/workflows/v1beta/workflows/client" +require "google/cloud/workflows/v1beta/workflows/rest" + +module Google + module Cloud + module Workflows + module V1beta + ## + # Workflows is used to deploy and execute workflow programs. + # Workflows makes sure the program executes reliably, despite hardware and + # networking interruptions. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/workflows/v1beta/workflows" + # client = ::Google::Cloud::Workflows::V1beta::Workflows::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/workflows/v1beta/workflows/rest" + # client = ::Google::Cloud::Workflows::V1beta::Workflows::Rest::Client.new + # + module Workflows + end + end + end + end +end + +helper_path = ::File.join __dir__, "workflows", "helpers.rb" +require "google/cloud/workflows/v1beta/workflows/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-workflows-v1beta/lib/google/cloud/workflows/v1beta/workflows/client.rb b/owl-bot-staging/google-cloud-workflows-v1beta/lib/google/cloud/workflows/v1beta/workflows/client.rb new file mode 100644 index 000000000000..9d115ffa4047 --- /dev/null +++ b/owl-bot-staging/google-cloud-workflows-v1beta/lib/google/cloud/workflows/v1beta/workflows/client.rb @@ -0,0 +1,952 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/workflows/v1beta/workflows_pb" +require "google/cloud/location" + +module Google + module Cloud + module Workflows + module V1beta + module Workflows + ## + # Client for the Workflows service. + # + # Workflows is used to deploy and execute workflow programs. + # Workflows makes sure the program executes reliably, despite hardware and + # networking interruptions. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "workflows.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :workflows_stub + + ## + # Configure the Workflows Client class. + # + # See {::Google::Cloud::Workflows::V1beta::Workflows::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all Workflows clients + # ::Google::Cloud::Workflows::V1beta::Workflows::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", "Workflows", "V1beta"] + 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 + end + yield @configure if block_given? + @configure + end + + ## + # Configure the Workflows 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::Workflows::V1beta::Workflows::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 + @workflows_stub.universe_domain + end + + ## + # Create a new Workflows client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Workflows::V1beta::Workflows::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Workflows::V1beta::Workflows::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Workflows 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/workflows/v1beta/workflows_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 + + @workflows_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::Workflows::V1beta::Workflows::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 + ) + + @workflows_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 = @workflows_stub.endpoint + config.universe_domain = @workflows_stub.universe_domain + config.logger = @workflows_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::Workflows::V1beta::Workflows::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 + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @workflows_stub.logger + end + + # Service calls + + ## + # Lists Workflows in a given project and location. + # The default order is not specified. + # + # @overload list_workflows(request, options = nil) + # Pass arguments to `list_workflows` via a request object, either of type + # {::Google::Cloud::Workflows::V1beta::ListWorkflowsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Workflows::V1beta::ListWorkflowsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_workflows(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) + # Pass arguments to `list_workflows` via keyword arguments. Note that at + # least one keyword argument is 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. Project and location from which the workflows should be listed. + # Format: projects/\\{project}/locations/\\{location} + # @param page_size [::Integer] + # Maximum number of workflows to return per call. The service may return + # fewer than this value. If the value is not specified, a default value of + # 500 will be used. The maximum permitted value is 1000 and values greater + # than 1000 will be coerced down to 1000. + # @param page_token [::String] + # A page token, received from a previous `ListWorkflows` call. + # Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to `ListWorkflows` must + # match the call that provided the page token. + # @param filter [::String] + # Filter to restrict results to specific workflows. + # @param order_by [::String] + # Comma-separated list of fields that that specify the order of the results. + # Default sorting order for a field is ascending. To specify descending order + # for a field, append a " desc" suffix. + # If not specified, the results will be returned in an unspecified order. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Workflows::V1beta::Workflow>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::Workflows::V1beta::Workflow>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/workflows/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Workflows::V1beta::Workflows::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Workflows::V1beta::ListWorkflowsRequest.new + # + # # Call the list_workflows method. + # result = client.list_workflows 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::Workflows::V1beta::Workflow. + # p item + # end + # + def list_workflows request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workflows::V1beta::ListWorkflowsRequest + + # Converts hash 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_workflows.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::Workflows::V1beta::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_workflows.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_workflows.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @workflows_stub.call_rpc :list_workflows, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @workflows_stub, :list_workflows, 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 + + ## + # Gets details of a single Workflow. + # + # @overload get_workflow(request, options = nil) + # Pass arguments to `get_workflow` via a request object, either of type + # {::Google::Cloud::Workflows::V1beta::GetWorkflowRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Workflows::V1beta::GetWorkflowRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_workflow(name: nil) + # Pass arguments to `get_workflow` via keyword arguments. Note that at + # least one keyword argument is 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 workflow which information should be retrieved. + # Format: projects/\\{project}/locations/\\{location}/workflows/\\{workflow} + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Workflows::V1beta::Workflow] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Workflows::V1beta::Workflow] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/workflows/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Workflows::V1beta::Workflows::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Workflows::V1beta::GetWorkflowRequest.new + # + # # Call the get_workflow method. + # result = client.get_workflow request + # + # # The returned object is of type Google::Cloud::Workflows::V1beta::Workflow. + # p result + # + def get_workflow request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workflows::V1beta::GetWorkflowRequest + + # Converts hash 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_workflow.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::Workflows::V1beta::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_workflow.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_workflow.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @workflows_stub.call_rpc :get_workflow, 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 workflow. If a workflow with the specified name already + # exists in the specified project and location, the long running operation + # will return [ALREADY_EXISTS][google.rpc.Code.ALREADY_EXISTS] error. + # + # @overload create_workflow(request, options = nil) + # Pass arguments to `create_workflow` via a request object, either of type + # {::Google::Cloud::Workflows::V1beta::CreateWorkflowRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Workflows::V1beta::CreateWorkflowRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_workflow(parent: nil, workflow: nil, workflow_id: nil) + # Pass arguments to `create_workflow` via keyword arguments. Note that at + # least one keyword argument is 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. Project and location in which the workflow should be created. + # Format: projects/\\{project}/locations/\\{location} + # @param workflow [::Google::Cloud::Workflows::V1beta::Workflow, ::Hash] + # Required. Workflow to be created. + # @param workflow_id [::String] + # Required. The ID of the workflow to be created. It has to fulfill the + # following requirements: + # + # * Must contain only letters, numbers, underscores and hyphens. + # * Must start with a letter. + # * Must be between 1-64 characters. + # * Must end with a number or a letter. + # * Must be unique within the customer project and location. + # + # @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/workflows/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Workflows::V1beta::Workflows::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Workflows::V1beta::CreateWorkflowRequest.new + # + # # Call the create_workflow method. + # result = client.create_workflow 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_workflow request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workflows::V1beta::CreateWorkflowRequest + + # Converts hash 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_workflow.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::Workflows::V1beta::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_workflow.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_workflow.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @workflows_stub.call_rpc :create_workflow, 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 workflow with the specified name. + # This method also cancels and deletes all running executions of the + # workflow. + # + # @overload delete_workflow(request, options = nil) + # Pass arguments to `delete_workflow` via a request object, either of type + # {::Google::Cloud::Workflows::V1beta::DeleteWorkflowRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Workflows::V1beta::DeleteWorkflowRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_workflow(name: nil) + # Pass arguments to `delete_workflow` via keyword arguments. Note that at + # least one keyword argument is 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 workflow to be deleted. + # Format: projects/\\{project}/locations/\\{location}/workflows/\\{workflow} + # + # @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/workflows/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Workflows::V1beta::Workflows::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Workflows::V1beta::DeleteWorkflowRequest.new + # + # # Call the delete_workflow method. + # result = client.delete_workflow 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_workflow request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workflows::V1beta::DeleteWorkflowRequest + + # Converts hash 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_workflow.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::Workflows::V1beta::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_workflow.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_workflow.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @workflows_stub.call_rpc :delete_workflow, 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 + + ## + # Updates an existing workflow. + # Running this method has no impact on already running executions of the + # workflow. A new revision of the workflow may be created as a result of a + # successful update operation. In that case, such revision will be used + # in new workflow executions. + # + # @overload update_workflow(request, options = nil) + # Pass arguments to `update_workflow` via a request object, either of type + # {::Google::Cloud::Workflows::V1beta::UpdateWorkflowRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Workflows::V1beta::UpdateWorkflowRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_workflow(workflow: nil, update_mask: nil) + # Pass arguments to `update_workflow` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param workflow [::Google::Cloud::Workflows::V1beta::Workflow, ::Hash] + # Required. Workflow to be updated. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # List of fields to be updated. If not present, the entire workflow + # will be updated. + # + # @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/workflows/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Workflows::V1beta::Workflows::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Workflows::V1beta::UpdateWorkflowRequest.new + # + # # Call the update_workflow method. + # result = client.update_workflow 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 update_workflow request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workflows::V1beta::UpdateWorkflowRequest + + # Converts hash 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_workflow.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::Workflows::V1beta::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.workflow&.name + header_params["workflow.name"] = request.workflow.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_workflow.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_workflow.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @workflows_stub.call_rpc :update_workflow, 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 Workflows API. + # + # This class represents the configuration for Workflows, + # 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::Workflows::V1beta::Workflows::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_workflows to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Workflows::V1beta::Workflows::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_workflows.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Workflows::V1beta::Workflows::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_workflows.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::Workflows::V1beta::Workflows::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 = "workflows.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 Workflows 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_workflows` + # @return [::Gapic::Config::Method] + # + attr_reader :list_workflows + ## + # RPC-specific configuration for `get_workflow` + # @return [::Gapic::Config::Method] + # + attr_reader :get_workflow + ## + # RPC-specific configuration for `create_workflow` + # @return [::Gapic::Config::Method] + # + attr_reader :create_workflow + ## + # RPC-specific configuration for `delete_workflow` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_workflow + ## + # RPC-specific configuration for `update_workflow` + # @return [::Gapic::Config::Method] + # + attr_reader :update_workflow + + # @private + def initialize parent_rpcs = nil + list_workflows_config = parent_rpcs.list_workflows if parent_rpcs.respond_to? :list_workflows + @list_workflows = ::Gapic::Config::Method.new list_workflows_config + get_workflow_config = parent_rpcs.get_workflow if parent_rpcs.respond_to? :get_workflow + @get_workflow = ::Gapic::Config::Method.new get_workflow_config + create_workflow_config = parent_rpcs.create_workflow if parent_rpcs.respond_to? :create_workflow + @create_workflow = ::Gapic::Config::Method.new create_workflow_config + delete_workflow_config = parent_rpcs.delete_workflow if parent_rpcs.respond_to? :delete_workflow + @delete_workflow = ::Gapic::Config::Method.new delete_workflow_config + update_workflow_config = parent_rpcs.update_workflow if parent_rpcs.respond_to? :update_workflow + @update_workflow = ::Gapic::Config::Method.new update_workflow_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-workflows-v1beta/lib/google/cloud/workflows/v1beta/workflows/credentials.rb b/owl-bot-staging/google-cloud-workflows-v1beta/lib/google/cloud/workflows/v1beta/workflows/credentials.rb new file mode 100644 index 000000000000..550b00fccd1b --- /dev/null +++ b/owl-bot-staging/google-cloud-workflows-v1beta/lib/google/cloud/workflows/v1beta/workflows/credentials.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! + +require "googleauth" + +module Google + module Cloud + module Workflows + module V1beta + module Workflows + # Credentials for the Workflows API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/cloud-platform" + ] + self.env_vars = [ + "WORKFLOWS_CREDENTIALS", + "WORKFLOWS_KEYFILE", + "GOOGLE_CLOUD_CREDENTIALS", + "GOOGLE_CLOUD_KEYFILE", + "GCLOUD_KEYFILE", + "WORKFLOWS_CREDENTIALS_JSON", + "WORKFLOWS_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-workflows-v1beta/lib/google/cloud/workflows/v1beta/workflows/operations.rb b/owl-bot-staging/google-cloud-workflows-v1beta/lib/google/cloud/workflows/v1beta/workflows/operations.rb new file mode 100644 index 000000000000..7011dce23d65 --- /dev/null +++ b/owl-bot-staging/google-cloud-workflows-v1beta/lib/google/cloud/workflows/v1beta/workflows/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 Workflows + module V1beta + module Workflows + # Service that implements Longrunning Operations API. + class Operations + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "workflows.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :operations_stub + + ## + # Configuration for the Workflows 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 Workflows 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::Workflows::V1beta::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::Workflows::V1beta::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::Workflows::V1beta::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::Workflows::V1beta::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::Workflows::V1beta::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 = "workflows.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-workflows-v1beta/lib/google/cloud/workflows/v1beta/workflows/paths.rb b/owl-bot-staging/google-cloud-workflows-v1beta/lib/google/cloud/workflows/v1beta/workflows/paths.rb new file mode 100644 index 000000000000..8e6d9fdd43a9 --- /dev/null +++ b/owl-bot-staging/google-cloud-workflows-v1beta/lib/google/cloud/workflows/v1beta/workflows/paths.rb @@ -0,0 +1,69 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Workflows + module V1beta + module Workflows + # Path helper methods for the Workflows 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 Workflow resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/workflows/{workflow}` + # + # @param project [String] + # @param location [String] + # @param workflow [String] + # + # @return [::String] + def workflow_path project:, location:, workflow: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/workflows/#{workflow}" + end + + extend self + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-workflows-v1beta/lib/google/cloud/workflows/v1beta/workflows/rest.rb b/owl-bot-staging/google-cloud-workflows-v1beta/lib/google/cloud/workflows/v1beta/workflows/rest.rb new file mode 100644 index 000000000000..c806faf98cba --- /dev/null +++ b/owl-bot-staging/google-cloud-workflows-v1beta/lib/google/cloud/workflows/v1beta/workflows/rest.rb @@ -0,0 +1,56 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/workflows/v1beta/version" +require "google/cloud/workflows/v1beta/bindings_override" + +require "google/cloud/workflows/v1beta/workflows/credentials" +require "google/cloud/workflows/v1beta/workflows/paths" +require "google/cloud/workflows/v1beta/workflows/rest/operations" +require "google/cloud/workflows/v1beta/workflows/rest/client" + +module Google + module Cloud + module Workflows + module V1beta + ## + # Workflows is used to deploy and execute workflow programs. + # Workflows makes sure the program executes reliably, despite hardware and + # networking interruptions. + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/workflows/v1beta/workflows/rest" + # client = ::Google::Cloud::Workflows::V1beta::Workflows::Rest::Client.new + # + module Workflows + # Client for the REST transport + module Rest + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "rest", "helpers.rb" +require "google/cloud/workflows/v1beta/workflows/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-workflows-v1beta/lib/google/cloud/workflows/v1beta/workflows/rest/client.rb b/owl-bot-staging/google-cloud-workflows-v1beta/lib/google/cloud/workflows/v1beta/workflows/rest/client.rb new file mode 100644 index 000000000000..129d779d0741 --- /dev/null +++ b/owl-bot-staging/google-cloud-workflows-v1beta/lib/google/cloud/workflows/v1beta/workflows/rest/client.rb @@ -0,0 +1,882 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/workflows/v1beta/workflows_pb" +require "google/cloud/workflows/v1beta/workflows/rest/service_stub" +require "google/cloud/location/rest" + +module Google + module Cloud + module Workflows + module V1beta + module Workflows + module Rest + ## + # REST client for the Workflows service. + # + # Workflows is used to deploy and execute workflow programs. + # Workflows makes sure the program executes reliably, despite hardware and + # networking interruptions. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "workflows.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :workflows_stub + + ## + # Configure the Workflows Client class. + # + # See {::Google::Cloud::Workflows::V1beta::Workflows::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all Workflows clients + # ::Google::Cloud::Workflows::V1beta::Workflows::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", "Workflows", "V1beta"] + 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 + end + yield @configure if block_given? + @configure + end + + ## + # Configure the Workflows 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::Workflows::V1beta::Workflows::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 + @workflows_stub.universe_domain + end + + ## + # Create a new Workflows REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Workflows::V1beta::Workflows::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Workflows::V1beta::Workflows::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Workflows 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::Workflows::V1beta::Workflows::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 + + @workflows_stub = ::Google::Cloud::Workflows::V1beta::Workflows::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials, + logger: @config.logger + ) + + @workflows_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 = @workflows_stub.endpoint + config.universe_domain = @workflows_stub.universe_domain + config.bindings_override = @config.bindings_override + config.logger = @workflows_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::Workflows::V1beta::Workflows::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 + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @workflows_stub.logger + end + + # Service calls + + ## + # Lists Workflows in a given project and location. + # The default order is not specified. + # + # @overload list_workflows(request, options = nil) + # Pass arguments to `list_workflows` via a request object, either of type + # {::Google::Cloud::Workflows::V1beta::ListWorkflowsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Workflows::V1beta::ListWorkflowsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_workflows(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) + # Pass arguments to `list_workflows` via keyword arguments. Note that at + # least one keyword argument is 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. Project and location from which the workflows should be listed. + # Format: projects/\\{project}/locations/\\{location} + # @param page_size [::Integer] + # Maximum number of workflows to return per call. The service may return + # fewer than this value. If the value is not specified, a default value of + # 500 will be used. The maximum permitted value is 1000 and values greater + # than 1000 will be coerced down to 1000. + # @param page_token [::String] + # A page token, received from a previous `ListWorkflows` call. + # Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to `ListWorkflows` must + # match the call that provided the page token. + # @param filter [::String] + # Filter to restrict results to specific workflows. + # @param order_by [::String] + # Comma-separated list of fields that that specify the order of the results. + # Default sorting order for a field is ascending. To specify descending order + # for a field, append a " desc" suffix. + # If not specified, the results will be returned in an unspecified order. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Workflows::V1beta::Workflow>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Workflows::V1beta::Workflow>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/workflows/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Workflows::V1beta::Workflows::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Workflows::V1beta::ListWorkflowsRequest.new + # + # # Call the list_workflows method. + # result = client.list_workflows 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::Workflows::V1beta::Workflow. + # p item + # end + # + def list_workflows request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workflows::V1beta::ListWorkflowsRequest + + # Converts hash 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_workflows.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::Workflows::V1beta::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_workflows.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_workflows.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @workflows_stub.list_workflows request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @workflows_stub, :list_workflows, "workflows", 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 details of a single Workflow. + # + # @overload get_workflow(request, options = nil) + # Pass arguments to `get_workflow` via a request object, either of type + # {::Google::Cloud::Workflows::V1beta::GetWorkflowRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Workflows::V1beta::GetWorkflowRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_workflow(name: nil) + # Pass arguments to `get_workflow` via keyword arguments. Note that at + # least one keyword argument is 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 workflow which information should be retrieved. + # Format: projects/\\{project}/locations/\\{location}/workflows/\\{workflow} + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Workflows::V1beta::Workflow] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Workflows::V1beta::Workflow] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/workflows/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Workflows::V1beta::Workflows::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Workflows::V1beta::GetWorkflowRequest.new + # + # # Call the get_workflow method. + # result = client.get_workflow request + # + # # The returned object is of type Google::Cloud::Workflows::V1beta::Workflow. + # p result + # + def get_workflow request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workflows::V1beta::GetWorkflowRequest + + # Converts hash 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_workflow.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::Workflows::V1beta::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_workflow.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_workflow.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @workflows_stub.get_workflow 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 workflow. If a workflow with the specified name already + # exists in the specified project and location, the long running operation + # will return [ALREADY_EXISTS][google.rpc.Code.ALREADY_EXISTS] error. + # + # @overload create_workflow(request, options = nil) + # Pass arguments to `create_workflow` via a request object, either of type + # {::Google::Cloud::Workflows::V1beta::CreateWorkflowRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Workflows::V1beta::CreateWorkflowRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_workflow(parent: nil, workflow: nil, workflow_id: nil) + # Pass arguments to `create_workflow` via keyword arguments. Note that at + # least one keyword argument is 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. Project and location in which the workflow should be created. + # Format: projects/\\{project}/locations/\\{location} + # @param workflow [::Google::Cloud::Workflows::V1beta::Workflow, ::Hash] + # Required. Workflow to be created. + # @param workflow_id [::String] + # Required. The ID of the workflow to be created. It has to fulfill the + # following requirements: + # + # * Must contain only letters, numbers, underscores and hyphens. + # * Must start with a letter. + # * Must be between 1-64 characters. + # * Must end with a number or a letter. + # * Must be unique within the customer project and location. + # @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/workflows/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Workflows::V1beta::Workflows::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Workflows::V1beta::CreateWorkflowRequest.new + # + # # Call the create_workflow method. + # result = client.create_workflow 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_workflow request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workflows::V1beta::CreateWorkflowRequest + + # Converts hash 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_workflow.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::Workflows::V1beta::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_workflow.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_workflow.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @workflows_stub.create_workflow 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 workflow with the specified name. + # This method also cancels and deletes all running executions of the + # workflow. + # + # @overload delete_workflow(request, options = nil) + # Pass arguments to `delete_workflow` via a request object, either of type + # {::Google::Cloud::Workflows::V1beta::DeleteWorkflowRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Workflows::V1beta::DeleteWorkflowRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_workflow(name: nil) + # Pass arguments to `delete_workflow` via keyword arguments. Note that at + # least one keyword argument is 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 workflow to be deleted. + # Format: projects/\\{project}/locations/\\{location}/workflows/\\{workflow} + # @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/workflows/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Workflows::V1beta::Workflows::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Workflows::V1beta::DeleteWorkflowRequest.new + # + # # Call the delete_workflow method. + # result = client.delete_workflow 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_workflow request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workflows::V1beta::DeleteWorkflowRequest + + # Converts hash 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_workflow.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::Workflows::V1beta::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_workflow.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_workflow.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @workflows_stub.delete_workflow 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 + + ## + # Updates an existing workflow. + # Running this method has no impact on already running executions of the + # workflow. A new revision of the workflow may be created as a result of a + # successful update operation. In that case, such revision will be used + # in new workflow executions. + # + # @overload update_workflow(request, options = nil) + # Pass arguments to `update_workflow` via a request object, either of type + # {::Google::Cloud::Workflows::V1beta::UpdateWorkflowRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Workflows::V1beta::UpdateWorkflowRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_workflow(workflow: nil, update_mask: nil) + # Pass arguments to `update_workflow` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param workflow [::Google::Cloud::Workflows::V1beta::Workflow, ::Hash] + # Required. Workflow to be updated. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # List of fields to be updated. If not present, the entire workflow + # will be updated. + # @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/workflows/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Workflows::V1beta::Workflows::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Workflows::V1beta::UpdateWorkflowRequest.new + # + # # Call the update_workflow method. + # result = client.update_workflow 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 update_workflow request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workflows::V1beta::UpdateWorkflowRequest + + # Converts hash 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_workflow.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::Workflows::V1beta::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_workflow.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_workflow.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @workflows_stub.update_workflow 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 + + ## + # Configuration class for the Workflows REST API. + # + # This class represents the configuration for Workflows 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::Workflows::V1beta::Workflows::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_workflows to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Workflows::V1beta::Workflows::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_workflows.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Workflows::V1beta::Workflows::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_workflows.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 = "workflows.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 Workflows 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_workflows` + # @return [::Gapic::Config::Method] + # + attr_reader :list_workflows + ## + # RPC-specific configuration for `get_workflow` + # @return [::Gapic::Config::Method] + # + attr_reader :get_workflow + ## + # RPC-specific configuration for `create_workflow` + # @return [::Gapic::Config::Method] + # + attr_reader :create_workflow + ## + # RPC-specific configuration for `delete_workflow` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_workflow + ## + # RPC-specific configuration for `update_workflow` + # @return [::Gapic::Config::Method] + # + attr_reader :update_workflow + + # @private + def initialize parent_rpcs = nil + list_workflows_config = parent_rpcs.list_workflows if parent_rpcs.respond_to? :list_workflows + @list_workflows = ::Gapic::Config::Method.new list_workflows_config + get_workflow_config = parent_rpcs.get_workflow if parent_rpcs.respond_to? :get_workflow + @get_workflow = ::Gapic::Config::Method.new get_workflow_config + create_workflow_config = parent_rpcs.create_workflow if parent_rpcs.respond_to? :create_workflow + @create_workflow = ::Gapic::Config::Method.new create_workflow_config + delete_workflow_config = parent_rpcs.delete_workflow if parent_rpcs.respond_to? :delete_workflow + @delete_workflow = ::Gapic::Config::Method.new delete_workflow_config + update_workflow_config = parent_rpcs.update_workflow if parent_rpcs.respond_to? :update_workflow + @update_workflow = ::Gapic::Config::Method.new update_workflow_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-workflows-v1beta/lib/google/cloud/workflows/v1beta/workflows/rest/operations.rb b/owl-bot-staging/google-cloud-workflows-v1beta/lib/google/cloud/workflows/v1beta/workflows/rest/operations.rb new file mode 100644 index 000000000000..f7964defcdb0 --- /dev/null +++ b/owl-bot-staging/google-cloud-workflows-v1beta/lib/google/cloud/workflows/v1beta/workflows/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 Workflows + module V1beta + module Workflows + module Rest + # Service that implements Longrunning Operations API. + class Operations + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "workflows.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :operations_stub + + ## + # Configuration for the Workflows 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 Workflows 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::Workflows::V1beta::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::Workflows::V1beta::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::Workflows::V1beta::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::Workflows::V1beta::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 = "workflows.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: "/v1beta/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/?$}, 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: "/v1beta/{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: "/v1beta/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + 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-workflows-v1beta/lib/google/cloud/workflows/v1beta/workflows/rest/service_stub.rb b/owl-bot-staging/google-cloud-workflows-v1beta/lib/google/cloud/workflows/v1beta/workflows/rest/service_stub.rb new file mode 100644 index 000000000000..2b77bde101f9 --- /dev/null +++ b/owl-bot-staging/google-cloud-workflows-v1beta/lib/google/cloud/workflows/v1beta/workflows/rest/service_stub.rb @@ -0,0 +1,388 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/workflows/v1beta/workflows_pb" + +module Google + module Cloud + module Workflows + module V1beta + module Workflows + module Rest + ## + # REST service stub for the Workflows 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_workflows REST call + # + # @param request_pb [::Google::Cloud::Workflows::V1beta::ListWorkflowsRequest] + # 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::Workflows::V1beta::ListWorkflowsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Workflows::V1beta::ListWorkflowsResponse] + # A result object deserialized from the server's reply + def list_workflows request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_workflows_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_workflows", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Workflows::V1beta::ListWorkflowsResponse.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_workflow REST call + # + # @param request_pb [::Google::Cloud::Workflows::V1beta::GetWorkflowRequest] + # 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::Workflows::V1beta::Workflow] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Workflows::V1beta::Workflow] + # A result object deserialized from the server's reply + def get_workflow request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_workflow_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_workflow", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Workflows::V1beta::Workflow.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_workflow REST call + # + # @param request_pb [::Google::Cloud::Workflows::V1beta::CreateWorkflowRequest] + # 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_workflow request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_workflow_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_workflow", + 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_workflow REST call + # + # @param request_pb [::Google::Cloud::Workflows::V1beta::DeleteWorkflowRequest] + # 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_workflow request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_workflow_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_workflow", + 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 update_workflow REST call + # + # @param request_pb [::Google::Cloud::Workflows::V1beta::UpdateWorkflowRequest] + # 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 update_workflow request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_workflow_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_workflow", + 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 + + ## + # @private + # + # GRPC transcoding helper method for the list_workflows REST call + # + # @param request_pb [::Google::Cloud::Workflows::V1beta::ListWorkflowsRequest] + # 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_workflows_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1beta/{parent}/workflows", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_workflow REST call + # + # @param request_pb [::Google::Cloud::Workflows::V1beta::GetWorkflowRequest] + # 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_workflow_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1beta/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/workflows/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_workflow REST call + # + # @param request_pb [::Google::Cloud::Workflows::V1beta::CreateWorkflowRequest] + # 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_workflow_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1beta/{parent}/workflows", + body: "workflow", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_workflow REST call + # + # @param request_pb [::Google::Cloud::Workflows::V1beta::DeleteWorkflowRequest] + # 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_workflow_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1beta/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/workflows/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_workflow REST call + # + # @param request_pb [::Google::Cloud::Workflows::V1beta::UpdateWorkflowRequest] + # 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_workflow_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v1beta/{workflow.name}", + body: "workflow", + matches: [ + ["workflow.name", %r{^projects/[^/]+/locations/[^/]+/workflows/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-workflows-v1beta/lib/google/cloud/workflows/v1beta/workflows_pb.rb b/owl-bot-staging/google-cloud-workflows-v1beta/lib/google/cloud/workflows/v1beta/workflows_pb.rb new file mode 100644 index 000000000000..7b8323216f07 --- /dev/null +++ b/owl-bot-staging/google-cloud-workflows-v1beta/lib/google/cloud/workflows/v1beta/workflows_pb.rb @@ -0,0 +1,38 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/workflows/v1beta/workflows.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/empty_pb' +require 'google/protobuf/field_mask_pb' +require 'google/protobuf/timestamp_pb' + + +descriptor_data = "\n-google/cloud/workflows/v1beta/workflows.proto\x12\x1dgoogle.cloud.workflows.v1beta\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\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xfe\x04\n\x08Workflow\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x02 \x01(\t\x12\x41\n\x05state\x18\x03 \x01(\x0e\x32-.google.cloud.workflows.v1beta.Workflow.StateB\x03\xe0\x41\x03\x12\x18\n\x0brevision_id\x18\x04 \x01(\tB\x03\xe0\x41\x03\x12\x34\n\x0b\x63reate_time\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12=\n\x14revision_create_time\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x43\n\x06labels\x18\x08 \x03(\x0b\x32\x33.google.cloud.workflows.v1beta.Workflow.LabelsEntry\x12\x17\n\x0fservice_account\x18\t \x01(\t\x12\x19\n\x0fsource_contents\x18\n \x01(\tH\x00\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"*\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\n\n\x06\x41\x43TIVE\x10\x01:d\xea\x41\x61\n!workflows.googleapis.com/Workflow\x12\n\x08workflow\x18\x02 \x01(\x0b\x32\'.google.cloud.workflows.v1beta.WorkflowB\x03\xe0\x41\x02\x12\x18\n\x0bworkflow_id\x18\x03 \x01(\tB\x03\xe0\x41\x02\"P\n\x15\x44\x65leteWorkflowRequest\x12\x37\n\x04name\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!workflows.googleapis.com/Workflow\"\x88\x01\n\x15UpdateWorkflowRequest\x12>\n\x08workflow\x18\x01 \x01(\x0b\x32\'.google.cloud.workflows.v1beta.WorkflowB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"\xa5\x01\n\x11OperationMetadata\x12/\n\x0b\x63reate_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12,\n\x08\x65nd_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x0e\n\x06target\x18\x03 \x01(\t\x12\x0c\n\x04verb\x18\x04 \x01(\t\x12\x13\n\x0b\x61pi_version\x18\x05 \x01(\t2\xf9\x08\n\tWorkflows\x12\xbe\x01\n\rListWorkflows\x12\x33.google.cloud.workflows.v1beta.ListWorkflowsRequest\x1a\x34.google.cloud.workflows.v1beta.ListWorkflowsResponse\"B\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x33\x12\x31/v1beta/{parent=projects/*/locations/*}/workflows\x12\xab\x01\n\x0bGetWorkflow\x12\x31.google.cloud.workflows.v1beta.GetWorkflowRequest\x1a\'.google.cloud.workflows.v1beta.Workflow\"@\xda\x41\x04name\x82\xd3\xe4\x93\x02\x33\x12\x31/v1beta/{name=projects/*/locations/*/workflows/*}\x12\xe9\x01\n\x0e\x43reateWorkflow\x12\x34.google.cloud.workflows.v1beta.CreateWorkflowRequest\x1a\x1d.google.longrunning.Operation\"\x81\x01\xca\x41\x1d\n\x08Workflow\x12\x11OperationMetadata\xda\x41\x1bparent,workflow,workflow_id\x82\xd3\xe4\x93\x02=\"1/v1beta/{parent=projects/*/locations/*}/workflows:\x08workflow\x12\xd4\x01\n\x0e\x44\x65leteWorkflow\x12\x34.google.cloud.workflows.v1beta.DeleteWorkflowRequest\x1a\x1d.google.longrunning.Operation\"m\xca\x41*\n\x15google.protobuf.Empty\x12\x11OperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02\x33*1/v1beta/{name=projects/*/locations/*/workflows/*}\x12\xeb\x01\n\x0eUpdateWorkflow\x12\x34.google.cloud.workflows.v1beta.UpdateWorkflowRequest\x1a\x1d.google.longrunning.Operation\"\x83\x01\xca\x41\x1d\n\x08Workflow\x12\x11OperationMetadata\xda\x41\x14workflow,update_mask\x82\xd3\xe4\x93\x02\x46\x32:/v1beta/{workflow.name=projects/*/locations/*/workflows/*}:\x08workflow\x1aL\xca\x41\x18workflows.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformBv\n!com.google.cloud.workflows.v1betaB\x0eWorkflowsProtoP\x01Z?cloud.google.com/go/workflows/apiv1beta/workflowspb;workflowspbb\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module Workflows + module V1beta + Workflow = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.workflows.v1beta.Workflow").msgclass + Workflow::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.workflows.v1beta.Workflow.State").enummodule + ListWorkflowsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.workflows.v1beta.ListWorkflowsRequest").msgclass + ListWorkflowsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.workflows.v1beta.ListWorkflowsResponse").msgclass + GetWorkflowRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.workflows.v1beta.GetWorkflowRequest").msgclass + CreateWorkflowRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.workflows.v1beta.CreateWorkflowRequest").msgclass + DeleteWorkflowRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.workflows.v1beta.DeleteWorkflowRequest").msgclass + UpdateWorkflowRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.workflows.v1beta.UpdateWorkflowRequest").msgclass + OperationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.workflows.v1beta.OperationMetadata").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-workflows-v1beta/lib/google/cloud/workflows/v1beta/workflows_services_pb.rb b/owl-bot-staging/google-cloud-workflows-v1beta/lib/google/cloud/workflows/v1beta/workflows_services_pb.rb new file mode 100644 index 000000000000..c6606ec7ea91 --- /dev/null +++ b/owl-bot-staging/google-cloud-workflows-v1beta/lib/google/cloud/workflows/v1beta/workflows_services_pb.rb @@ -0,0 +1,64 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/cloud/workflows/v1beta/workflows.proto for package 'google.cloud.workflows.v1beta' +# 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/workflows/v1beta/workflows_pb' + +module Google + module Cloud + module Workflows + module V1beta + module Workflows + # Workflows is used to deploy and execute workflow programs. + # Workflows makes sure the program executes reliably, despite hardware and + # networking interruptions. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.cloud.workflows.v1beta.Workflows' + + # Lists Workflows in a given project and location. + # The default order is not specified. + rpc :ListWorkflows, ::Google::Cloud::Workflows::V1beta::ListWorkflowsRequest, ::Google::Cloud::Workflows::V1beta::ListWorkflowsResponse + # Gets details of a single Workflow. + rpc :GetWorkflow, ::Google::Cloud::Workflows::V1beta::GetWorkflowRequest, ::Google::Cloud::Workflows::V1beta::Workflow + # Creates a new workflow. If a workflow with the specified name already + # exists in the specified project and location, the long running operation + # will return [ALREADY_EXISTS][google.rpc.Code.ALREADY_EXISTS] error. + rpc :CreateWorkflow, ::Google::Cloud::Workflows::V1beta::CreateWorkflowRequest, ::Google::Longrunning::Operation + # Deletes a workflow with the specified name. + # This method also cancels and deletes all running executions of the + # workflow. + rpc :DeleteWorkflow, ::Google::Cloud::Workflows::V1beta::DeleteWorkflowRequest, ::Google::Longrunning::Operation + # Updates an existing workflow. + # Running this method has no impact on already running executions of the + # workflow. A new revision of the workflow may be created as a result of a + # successful update operation. In that case, such revision will be used + # in new workflow executions. + rpc :UpdateWorkflow, ::Google::Cloud::Workflows::V1beta::UpdateWorkflowRequest, ::Google::Longrunning::Operation + end + + Stub = Service.rpc_stub_class + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-workflows-v1beta/proto_docs/README.md b/owl-bot-staging/google-cloud-workflows-v1beta/proto_docs/README.md new file mode 100644 index 000000000000..00492e17dd69 --- /dev/null +++ b/owl-bot-staging/google-cloud-workflows-v1beta/proto_docs/README.md @@ -0,0 +1,4 @@ +# Workflows V1beta 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-workflows-v1beta/proto_docs/google/api/client.rb b/owl-bot-staging/google-cloud-workflows-v1beta/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..3ab0b096d445 --- /dev/null +++ b/owl-bot-staging/google-cloud-workflows-v1beta/proto_docs/google/api/client.rb @@ -0,0 +1,593 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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. + # + # Note: This field should not be used in most cases. + 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: + # library_settings: + # 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. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Php. Clobbers the php_namespace option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.php.package_name" field + # in gapic.yaml. API teams should use the protobuf php_namespace option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # library_settings: + # php_settings: + # library_package: Google\Cloud\PubSub\V1 + 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. + # + # Example: + # + # 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 + # @!attribute [rw] batching + # @return [::Google::Api::BatchingConfigProto] + # Batching configuration for an API method in client libraries. + # + # Example of a YAML configuration: + # + # publishing: + # method_settings: + # - selector: google.example.v1.ExampleService.BatchCreateExample + # batching: + # element_count_threshold: 1000 + # request_byte_threshold: 100000000 + # delay_threshold_millis: 10 + 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. + # + # Note: This feature should not be used in most cases. + # @!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 + + # `BatchingConfigProto` defines the batching configuration for an API method. + # @!attribute [rw] thresholds + # @return [::Google::Api::BatchingSettingsProto] + # The thresholds which trigger a batched request to be sent. + # @!attribute [rw] batch_descriptor + # @return [::Google::Api::BatchingDescriptorProto] + # The request and response fields used in batching. + class BatchingConfigProto + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `BatchingSettingsProto` specifies a set of batching thresholds, each of + # which acts as a trigger to send a batch of messages as a request. At least + # one threshold must be positive nonzero. + # @!attribute [rw] element_count_threshold + # @return [::Integer] + # The number of elements of a field collected into a batch which, if + # exceeded, causes the batch to be sent. + # @!attribute [rw] request_byte_threshold + # @return [::Integer] + # The aggregated size of the batched field which, if exceeded, causes the + # batch to be sent. This size is computed by aggregating the sizes of the + # request field to be batched, not of the entire request message. + # @!attribute [rw] delay_threshold + # @return [::Google::Protobuf::Duration] + # The duration after which a batch should be sent, starting from the addition + # of the first message to that batch. + # @!attribute [rw] element_count_limit + # @return [::Integer] + # The maximum number of elements collected in a batch that could be accepted + # by server. + # @!attribute [rw] request_byte_limit + # @return [::Integer] + # The maximum size of the request that could be accepted by server. + # @!attribute [rw] flow_control_element_limit + # @return [::Integer] + # The maximum number of elements allowed by flow control. + # @!attribute [rw] flow_control_byte_limit + # @return [::Integer] + # The maximum size of data allowed by flow control. + # @!attribute [rw] flow_control_limit_exceeded_behavior + # @return [::Google::Api::FlowControlLimitExceededBehaviorProto] + # The behavior to take when the flow control limit is exceeded. + class BatchingSettingsProto + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `BatchingDescriptorProto` specifies the fields of the request message to be + # used for batching, and, optionally, the fields of the response message to be + # used for demultiplexing. + # @!attribute [rw] batched_field + # @return [::String] + # The repeated field in the request message to be aggregated by batching. + # @!attribute [rw] discriminator_fields + # @return [::Array<::String>] + # A list of the fields in the request message. Two requests will be batched + # together only if the values of every field specified in + # `request_discriminator_fields` is equal between the two requests. + # @!attribute [rw] subresponse_field + # @return [::String] + # Optional. When present, indicates the field in the response message to be + # used to demultiplex the response into multiple response messages, in + # correspondence with the multiple request messages originally batched + # together. + class BatchingDescriptorProto + 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 + + # The behavior to take when the flow control limit is exceeded. + module FlowControlLimitExceededBehaviorProto + # Default behavior, system-defined. + UNSET_BEHAVIOR = 0 + + # Stop operation, raise error. + THROW_EXCEPTION = 1 + + # Pause operation until limit clears. + BLOCK = 2 + + # Continue operation, disregard limit. + IGNORE = 3 + end + end +end diff --git a/owl-bot-staging/google-cloud-workflows-v1beta/proto_docs/google/api/field_behavior.rb b/owl-bot-staging/google-cloud-workflows-v1beta/proto_docs/google/api/field_behavior.rb new file mode 100644 index 000000000000..582be187d115 --- /dev/null +++ b/owl-bot-staging/google-cloud-workflows-v1beta/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-workflows-v1beta/proto_docs/google/api/launch_stage.rb b/owl-bot-staging/google-cloud-workflows-v1beta/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..9392a413fb1b --- /dev/null +++ b/owl-bot-staging/google-cloud-workflows-v1beta/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-workflows-v1beta/proto_docs/google/api/resource.rb b/owl-bot-staging/google-cloud-workflows-v1beta/proto_docs/google/api/resource.rb new file mode 100644 index 000000000000..25dec4847ac1 --- /dev/null +++ b/owl-bot-staging/google-cloud-workflows-v1beta/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-workflows-v1beta/proto_docs/google/cloud/workflows/v1beta/workflows.rb b/owl-bot-staging/google-cloud-workflows-v1beta/proto_docs/google/cloud/workflows/v1beta/workflows.rb new file mode 100644 index 000000000000..51dd7e8cb940 --- /dev/null +++ b/owl-bot-staging/google-cloud-workflows-v1beta/proto_docs/google/cloud/workflows/v1beta/workflows.rb @@ -0,0 +1,245 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Workflows + module V1beta + # Workflow program to be executed by Workflows. + # @!attribute [rw] name + # @return [::String] + # The resource name of the workflow. + # Format: projects/\\{project}/locations/\\{location}/workflows/\\{workflow} + # @!attribute [rw] description + # @return [::String] + # Description of the workflow provided by the user. + # Must be at most 1000 unicode characters long. + # @!attribute [r] state + # @return [::Google::Cloud::Workflows::V1beta::Workflow::State] + # Output only. State of the workflow deployment. + # @!attribute [r] revision_id + # @return [::String] + # Output only. The revision of the workflow. + # A new revision of a workflow is created as a result of updating the + # following properties of a workflow: + # + # - {::Google::Cloud::Workflows::V1beta::Workflow#service_account Service account} + # - [Workflow code to be + # executed][google.cloud.workflows.v1beta.Workflow.source_contents] + # + # The format is "000001-a4d", where the first 6 characters define + # the zero-padded revision ordinal number. They are followed by a hyphen and + # 3 hexadecimal random characters. + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The timestamp of when the workflow was created. + # @!attribute [r] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The last update timestamp of the workflow. + # @!attribute [r] revision_create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The timestamp that the latest revision of the workflow + # was created. + # @!attribute [rw] labels + # @return [::Google::Protobuf::Map{::String => ::String}] + # Labels associated with this workflow. + # Labels can contain at most 64 entries. Keys and values can be no longer + # than 63 characters and can only contain lowercase letters, numeric + # characters, underscores and dashes. Label keys must start with a letter. + # International characters are allowed. + # @!attribute [rw] service_account + # @return [::String] + # The service account associated with the latest workflow version. + # This service account represents the identity of the workflow and determines + # what permissions the workflow has. + # Format: projects/\\{project}/serviceAccounts/\\{account} or \\{account} + # + # Using `-` as a wildcard for the `{project}` or not providing one at all + # will infer the project from the account. The `{account}` value can be the + # `email` address or the `unique_id` of the service account. + # + # If not provided, workflow will use the project's default service account. + # Modifying this field for an existing workflow results in a new workflow + # revision. + # @!attribute [rw] source_contents + # @return [::String] + # Workflow code to be executed. The size limit is 128KB. + class Workflow + 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 + + # Describes the current state of workflow deployment. More states may be + # added in the future. + module State + # Invalid state. + STATE_UNSPECIFIED = 0 + + # The workflow has been deployed successfully and is serving. + ACTIVE = 1 + end + end + + # Request for the + # {::Google::Cloud::Workflows::V1beta::Workflows::Client#list_workflows ListWorkflows} + # method. + # @!attribute [rw] parent + # @return [::String] + # Required. Project and location from which the workflows should be listed. + # Format: projects/\\{project}/locations/\\{location} + # @!attribute [rw] page_size + # @return [::Integer] + # Maximum number of workflows to return per call. The service may return + # fewer than this value. If the value is not specified, a default value of + # 500 will be used. The maximum permitted value is 1000 and values greater + # than 1000 will be coerced down to 1000. + # @!attribute [rw] page_token + # @return [::String] + # A page token, received from a previous `ListWorkflows` call. + # Provide this to retrieve the subsequent page. + # + # When paginating, all other parameters provided to `ListWorkflows` must + # match the call that provided the page token. + # @!attribute [rw] filter + # @return [::String] + # Filter to restrict results to specific workflows. + # @!attribute [rw] order_by + # @return [::String] + # Comma-separated list of fields that that specify the order of the results. + # Default sorting order for a field is ascending. To specify descending order + # for a field, append a " desc" suffix. + # If not specified, the results will be returned in an unspecified order. + class ListWorkflowsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response for the + # {::Google::Cloud::Workflows::V1beta::Workflows::Client#list_workflows ListWorkflows} + # method. + # @!attribute [rw] workflows + # @return [::Array<::Google::Cloud::Workflows::V1beta::Workflow>] + # The workflows which match the request. + # @!attribute [rw] next_page_token + # @return [::String] + # A token, which can be sent as `page_token` to retrieve the next page. + # If this field is omitted, there are no subsequent pages. + # @!attribute [rw] unreachable + # @return [::Array<::String>] + # Unreachable resources. + class ListWorkflowsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request for the + # {::Google::Cloud::Workflows::V1beta::Workflows::Client#get_workflow GetWorkflow} method. + # @!attribute [rw] name + # @return [::String] + # Required. Name of the workflow which information should be retrieved. + # Format: projects/\\{project}/locations/\\{location}/workflows/\\{workflow} + class GetWorkflowRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request for the + # {::Google::Cloud::Workflows::V1beta::Workflows::Client#create_workflow CreateWorkflow} + # method. + # @!attribute [rw] parent + # @return [::String] + # Required. Project and location in which the workflow should be created. + # Format: projects/\\{project}/locations/\\{location} + # @!attribute [rw] workflow + # @return [::Google::Cloud::Workflows::V1beta::Workflow] + # Required. Workflow to be created. + # @!attribute [rw] workflow_id + # @return [::String] + # Required. The ID of the workflow to be created. It has to fulfill the + # following requirements: + # + # * Must contain only letters, numbers, underscores and hyphens. + # * Must start with a letter. + # * Must be between 1-64 characters. + # * Must end with a number or a letter. + # * Must be unique within the customer project and location. + class CreateWorkflowRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request for the + # {::Google::Cloud::Workflows::V1beta::Workflows::Client#delete_workflow DeleteWorkflow} + # method. + # @!attribute [rw] name + # @return [::String] + # Required. Name of the workflow to be deleted. + # Format: projects/\\{project}/locations/\\{location}/workflows/\\{workflow} + class DeleteWorkflowRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request for the + # {::Google::Cloud::Workflows::V1beta::Workflows::Client#update_workflow UpdateWorkflow} + # method. + # @!attribute [rw] workflow + # @return [::Google::Cloud::Workflows::V1beta::Workflow] + # Required. Workflow to be updated. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # List of fields to be updated. If not present, the entire workflow + # will be updated. + class UpdateWorkflowRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Represents the metadata of the long-running operation. + # @!attribute [rw] create_time + # @return [::Google::Protobuf::Timestamp] + # The time the operation was created. + # @!attribute [rw] end_time + # @return [::Google::Protobuf::Timestamp] + # The time the operation finished running. + # @!attribute [rw] target + # @return [::String] + # Server-defined resource path for the target of the operation. + # @!attribute [rw] verb + # @return [::String] + # Name of the verb executed by the operation. + # @!attribute [rw] api_version + # @return [::String] + # API version used to start the operation. + class OperationMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-workflows-v1beta/proto_docs/google/longrunning/operations.rb b/owl-bot-staging/google-cloud-workflows-v1beta/proto_docs/google/longrunning/operations.rb new file mode 100644 index 000000000000..7a757f512165 --- /dev/null +++ b/owl-bot-staging/google-cloud-workflows-v1beta/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-workflows-v1beta/proto_docs/google/protobuf/any.rb b/owl-bot-staging/google-cloud-workflows-v1beta/proto_docs/google/protobuf/any.rb new file mode 100644 index 000000000000..58691995f02e --- /dev/null +++ b/owl-bot-staging/google-cloud-workflows-v1beta/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-workflows-v1beta/proto_docs/google/protobuf/duration.rb b/owl-bot-staging/google-cloud-workflows-v1beta/proto_docs/google/protobuf/duration.rb new file mode 100644 index 000000000000..ea59f1f91daf --- /dev/null +++ b/owl-bot-staging/google-cloud-workflows-v1beta/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-workflows-v1beta/proto_docs/google/protobuf/empty.rb b/owl-bot-staging/google-cloud-workflows-v1beta/proto_docs/google/protobuf/empty.rb new file mode 100644 index 000000000000..83e4481834a6 --- /dev/null +++ b/owl-bot-staging/google-cloud-workflows-v1beta/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-workflows-v1beta/proto_docs/google/protobuf/field_mask.rb b/owl-bot-staging/google-cloud-workflows-v1beta/proto_docs/google/protobuf/field_mask.rb new file mode 100644 index 000000000000..7f3ffc78601a --- /dev/null +++ b/owl-bot-staging/google-cloud-workflows-v1beta/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-workflows-v1beta/proto_docs/google/protobuf/timestamp.rb b/owl-bot-staging/google-cloud-workflows-v1beta/proto_docs/google/protobuf/timestamp.rb new file mode 100644 index 000000000000..74352be9c58c --- /dev/null +++ b/owl-bot-staging/google-cloud-workflows-v1beta/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-workflows-v1beta/proto_docs/google/rpc/status.rb b/owl-bot-staging/google-cloud-workflows-v1beta/proto_docs/google/rpc/status.rb new file mode 100644 index 000000000000..c1a1c07eb2db --- /dev/null +++ b/owl-bot-staging/google-cloud-workflows-v1beta/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-workflows-v1beta/snippets/Gemfile b/owl-bot-staging/google-cloud-workflows-v1beta/snippets/Gemfile new file mode 100644 index 000000000000..6d0b5707d9d1 --- /dev/null +++ b/owl-bot-staging/google-cloud-workflows-v1beta/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-workflows-v1beta", path: "../" +else + gem "google-cloud-workflows-v1beta" +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-workflows-v1beta/snippets/snippet_metadata_google.cloud.workflows.v1beta.json b/owl-bot-staging/google-cloud-workflows-v1beta/snippets/snippet_metadata_google.cloud.workflows.v1beta.json new file mode 100644 index 000000000000..aa4ec480902e --- /dev/null +++ b/owl-bot-staging/google-cloud-workflows-v1beta/snippets/snippet_metadata_google.cloud.workflows.v1beta.json @@ -0,0 +1,215 @@ +{ + "client_library": { + "name": "google-cloud-workflows-v1beta", + "version": "", + "language": "RUBY", + "apis": [ + { + "id": "google.cloud.workflows.v1beta", + "version": "v1beta" + } + ] + }, + "snippets": [ + { + "region_tag": "workflows_v1beta_generated_Workflows_ListWorkflows_sync", + "title": "Snippet for the list_workflows call in the Workflows service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Workflows::V1beta::Workflows::Client#list_workflows.", + "file": "workflows/list_workflows.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_workflows", + "full_name": "::Google::Cloud::Workflows::V1beta::Workflows::Client#list_workflows", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Workflows::V1beta::ListWorkflowsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Workflows::V1beta::ListWorkflowsResponse", + "client": { + "short_name": "Workflows::Client", + "full_name": "::Google::Cloud::Workflows::V1beta::Workflows::Client" + }, + "method": { + "short_name": "ListWorkflows", + "full_name": "google.cloud.workflows.v1beta.Workflows.ListWorkflows", + "service": { + "short_name": "Workflows", + "full_name": "google.cloud.workflows.v1beta.Workflows" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "workflows_v1beta_generated_Workflows_GetWorkflow_sync", + "title": "Snippet for the get_workflow call in the Workflows service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Workflows::V1beta::Workflows::Client#get_workflow.", + "file": "workflows/get_workflow.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_workflow", + "full_name": "::Google::Cloud::Workflows::V1beta::Workflows::Client#get_workflow", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Workflows::V1beta::GetWorkflowRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Workflows::V1beta::Workflow", + "client": { + "short_name": "Workflows::Client", + "full_name": "::Google::Cloud::Workflows::V1beta::Workflows::Client" + }, + "method": { + "short_name": "GetWorkflow", + "full_name": "google.cloud.workflows.v1beta.Workflows.GetWorkflow", + "service": { + "short_name": "Workflows", + "full_name": "google.cloud.workflows.v1beta.Workflows" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "workflows_v1beta_generated_Workflows_CreateWorkflow_sync", + "title": "Snippet for the create_workflow call in the Workflows service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Workflows::V1beta::Workflows::Client#create_workflow.", + "file": "workflows/create_workflow.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_workflow", + "full_name": "::Google::Cloud::Workflows::V1beta::Workflows::Client#create_workflow", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Workflows::V1beta::CreateWorkflowRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "Workflows::Client", + "full_name": "::Google::Cloud::Workflows::V1beta::Workflows::Client" + }, + "method": { + "short_name": "CreateWorkflow", + "full_name": "google.cloud.workflows.v1beta.Workflows.CreateWorkflow", + "service": { + "short_name": "Workflows", + "full_name": "google.cloud.workflows.v1beta.Workflows" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "workflows_v1beta_generated_Workflows_DeleteWorkflow_sync", + "title": "Snippet for the delete_workflow call in the Workflows service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Workflows::V1beta::Workflows::Client#delete_workflow.", + "file": "workflows/delete_workflow.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_workflow", + "full_name": "::Google::Cloud::Workflows::V1beta::Workflows::Client#delete_workflow", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Workflows::V1beta::DeleteWorkflowRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "Workflows::Client", + "full_name": "::Google::Cloud::Workflows::V1beta::Workflows::Client" + }, + "method": { + "short_name": "DeleteWorkflow", + "full_name": "google.cloud.workflows.v1beta.Workflows.DeleteWorkflow", + "service": { + "short_name": "Workflows", + "full_name": "google.cloud.workflows.v1beta.Workflows" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "workflows_v1beta_generated_Workflows_UpdateWorkflow_sync", + "title": "Snippet for the update_workflow call in the Workflows service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Workflows::V1beta::Workflows::Client#update_workflow.", + "file": "workflows/update_workflow.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_workflow", + "full_name": "::Google::Cloud::Workflows::V1beta::Workflows::Client#update_workflow", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Workflows::V1beta::UpdateWorkflowRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "Workflows::Client", + "full_name": "::Google::Cloud::Workflows::V1beta::Workflows::Client" + }, + "method": { + "short_name": "UpdateWorkflow", + "full_name": "google.cloud.workflows.v1beta.Workflows.UpdateWorkflow", + "service": { + "short_name": "Workflows", + "full_name": "google.cloud.workflows.v1beta.Workflows" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + } + ] +} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-workflows-v1beta/snippets/workflows/create_workflow.rb b/owl-bot-staging/google-cloud-workflows-v1beta/snippets/workflows/create_workflow.rb new file mode 100644 index 000000000000..8b8c1e929159 --- /dev/null +++ b/owl-bot-staging/google-cloud-workflows-v1beta/snippets/workflows/create_workflow.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 workflows_v1beta_generated_Workflows_CreateWorkflow_sync] +require "google/cloud/workflows/v1beta" + +## +# Snippet for the create_workflow call in the Workflows 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::Workflows::V1beta::Workflows::Client#create_workflow. +# +def create_workflow + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Workflows::V1beta::Workflows::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Workflows::V1beta::CreateWorkflowRequest.new + + # Call the create_workflow method. + result = client.create_workflow 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 workflows_v1beta_generated_Workflows_CreateWorkflow_sync] diff --git a/owl-bot-staging/google-cloud-workflows-v1beta/snippets/workflows/delete_workflow.rb b/owl-bot-staging/google-cloud-workflows-v1beta/snippets/workflows/delete_workflow.rb new file mode 100644 index 000000000000..95eaf09e0e6f --- /dev/null +++ b/owl-bot-staging/google-cloud-workflows-v1beta/snippets/workflows/delete_workflow.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 workflows_v1beta_generated_Workflows_DeleteWorkflow_sync] +require "google/cloud/workflows/v1beta" + +## +# Snippet for the delete_workflow call in the Workflows 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::Workflows::V1beta::Workflows::Client#delete_workflow. +# +def delete_workflow + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Workflows::V1beta::Workflows::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Workflows::V1beta::DeleteWorkflowRequest.new + + # Call the delete_workflow method. + result = client.delete_workflow 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 workflows_v1beta_generated_Workflows_DeleteWorkflow_sync] diff --git a/owl-bot-staging/google-cloud-workflows-v1beta/snippets/workflows/get_workflow.rb b/owl-bot-staging/google-cloud-workflows-v1beta/snippets/workflows/get_workflow.rb new file mode 100644 index 000000000000..8d629d661011 --- /dev/null +++ b/owl-bot-staging/google-cloud-workflows-v1beta/snippets/workflows/get_workflow.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 workflows_v1beta_generated_Workflows_GetWorkflow_sync] +require "google/cloud/workflows/v1beta" + +## +# Snippet for the get_workflow call in the Workflows 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::Workflows::V1beta::Workflows::Client#get_workflow. +# +def get_workflow + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Workflows::V1beta::Workflows::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Workflows::V1beta::GetWorkflowRequest.new + + # Call the get_workflow method. + result = client.get_workflow request + + # The returned object is of type Google::Cloud::Workflows::V1beta::Workflow. + p result +end +# [END workflows_v1beta_generated_Workflows_GetWorkflow_sync] diff --git a/owl-bot-staging/google-cloud-workflows-v1beta/snippets/workflows/list_workflows.rb b/owl-bot-staging/google-cloud-workflows-v1beta/snippets/workflows/list_workflows.rb new file mode 100644 index 000000000000..0ed09a7616d6 --- /dev/null +++ b/owl-bot-staging/google-cloud-workflows-v1beta/snippets/workflows/list_workflows.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 workflows_v1beta_generated_Workflows_ListWorkflows_sync] +require "google/cloud/workflows/v1beta" + +## +# Snippet for the list_workflows call in the Workflows 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::Workflows::V1beta::Workflows::Client#list_workflows. +# +def list_workflows + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Workflows::V1beta::Workflows::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Workflows::V1beta::ListWorkflowsRequest.new + + # Call the list_workflows method. + result = client.list_workflows 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::Workflows::V1beta::Workflow. + p item + end +end +# [END workflows_v1beta_generated_Workflows_ListWorkflows_sync] diff --git a/owl-bot-staging/google-cloud-workflows-v1beta/snippets/workflows/update_workflow.rb b/owl-bot-staging/google-cloud-workflows-v1beta/snippets/workflows/update_workflow.rb new file mode 100644 index 000000000000..bab5a8ac4c65 --- /dev/null +++ b/owl-bot-staging/google-cloud-workflows-v1beta/snippets/workflows/update_workflow.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 workflows_v1beta_generated_Workflows_UpdateWorkflow_sync] +require "google/cloud/workflows/v1beta" + +## +# Snippet for the update_workflow call in the Workflows 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::Workflows::V1beta::Workflows::Client#update_workflow. +# +def update_workflow + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Workflows::V1beta::Workflows::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Workflows::V1beta::UpdateWorkflowRequest.new + + # Call the update_workflow method. + result = client.update_workflow 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 workflows_v1beta_generated_Workflows_UpdateWorkflow_sync] diff --git a/owl-bot-staging/google-cloud-workflows-v1beta/test/google/cloud/workflows/v1beta/workflows_operations_test.rb b/owl-bot-staging/google-cloud-workflows-v1beta/test/google/cloud/workflows/v1beta/workflows_operations_test.rb new file mode 100644 index 000000000000..7056811966a4 --- /dev/null +++ b/owl-bot-staging/google-cloud-workflows-v1beta/test/google/cloud/workflows/v1beta/workflows_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/workflows/v1beta/workflows_pb" +require "google/cloud/workflows/v1beta/workflows_services_pb" +require "google/cloud/workflows/v1beta/workflows" + +class ::Google::Cloud::Workflows::V1beta::Workflows::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::Workflows::V1beta::Workflows::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::Workflows::V1beta::Workflows::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::Workflows::V1beta::Workflows::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::Workflows::V1beta::Workflows::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::Workflows::V1beta::Workflows::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::Workflows::V1beta::Workflows::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::Workflows::V1beta::Workflows::Operations::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-workflows-v1beta/test/google/cloud/workflows/v1beta/workflows_paths_test.rb b/owl-bot-staging/google-cloud-workflows-v1beta/test/google/cloud/workflows/v1beta/workflows_paths_test.rb new file mode 100644 index 000000000000..79297ed7cc4c --- /dev/null +++ b/owl-bot-staging/google-cloud-workflows-v1beta/test/google/cloud/workflows/v1beta/workflows_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/workflows/v1beta/workflows" + +class ::Google::Cloud::Workflows::V1beta::Workflows::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::Workflows::V1beta::Workflows::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_workflow_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Workflows::V1beta::Workflows::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.workflow_path project: "value0", location: "value1", workflow: "value2" + assert_equal "projects/value0/locations/value1/workflows/value2", path + end + end +end diff --git a/owl-bot-staging/google-cloud-workflows-v1beta/test/google/cloud/workflows/v1beta/workflows_rest_test.rb b/owl-bot-staging/google-cloud-workflows-v1beta/test/google/cloud/workflows/v1beta/workflows_rest_test.rb new file mode 100644 index 000000000000..b88805f29aeb --- /dev/null +++ b/owl-bot-staging/google-cloud-workflows-v1beta/test/google/cloud/workflows/v1beta/workflows_rest_test.rb @@ -0,0 +1,376 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/workflows/v1beta/workflows_pb" +require "google/cloud/workflows/v1beta/workflows/rest" + + +class ::Google::Cloud::Workflows::V1beta::Workflows::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_workflows + # Create test objects. + client_result = ::Google::Cloud::Workflows::V1beta::ListWorkflowsResponse.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_workflows_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::Workflows::V1beta::Workflows::Rest::ServiceStub.stub :transcode_list_workflows_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_workflows_client_stub do + # Create client + client = ::Google::Cloud::Workflows::V1beta::Workflows::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_workflows({ 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_workflows 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_workflows ::Google::Cloud::Workflows::V1beta::ListWorkflowsRequest.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_workflows({ 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_workflows(::Google::Cloud::Workflows::V1beta::ListWorkflowsRequest.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_workflows_client_stub.call_count + end + end + end + + def test_get_workflow + # Create test objects. + client_result = ::Google::Cloud::Workflows::V1beta::Workflow.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_workflow_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::Workflows::V1beta::Workflows::Rest::ServiceStub.stub :transcode_get_workflow_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_workflow_client_stub do + # Create client + client = ::Google::Cloud::Workflows::V1beta::Workflows::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_workflow({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_workflow name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_workflow ::Google::Cloud::Workflows::V1beta::GetWorkflowRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_workflow({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_workflow(::Google::Cloud::Workflows::V1beta::GetWorkflowRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_workflow_client_stub.call_count + end + end + end + + def test_create_workflow + # 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" + workflow = {} + workflow_id = "hello world" + + create_workflow_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::Workflows::V1beta::Workflows::Rest::ServiceStub.stub :transcode_create_workflow_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_workflow_client_stub do + # Create client + client = ::Google::Cloud::Workflows::V1beta::Workflows::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_workflow({ parent: parent, workflow: workflow, workflow_id: workflow_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_workflow parent: parent, workflow: workflow, workflow_id: workflow_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_workflow ::Google::Cloud::Workflows::V1beta::CreateWorkflowRequest.new(parent: parent, workflow: workflow, workflow_id: workflow_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_workflow({ parent: parent, workflow: workflow, workflow_id: workflow_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_workflow(::Google::Cloud::Workflows::V1beta::CreateWorkflowRequest.new(parent: parent, workflow: workflow, workflow_id: workflow_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_workflow_client_stub.call_count + end + end + end + + def test_delete_workflow + # 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_workflow_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::Workflows::V1beta::Workflows::Rest::ServiceStub.stub :transcode_delete_workflow_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_workflow_client_stub do + # Create client + client = ::Google::Cloud::Workflows::V1beta::Workflows::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_workflow({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_workflow name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_workflow ::Google::Cloud::Workflows::V1beta::DeleteWorkflowRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_workflow({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_workflow(::Google::Cloud::Workflows::V1beta::DeleteWorkflowRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_workflow_client_stub.call_count + end + end + end + + def test_update_workflow + # 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. + workflow = {} + update_mask = {} + + update_workflow_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::Workflows::V1beta::Workflows::Rest::ServiceStub.stub :transcode_update_workflow_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_workflow_client_stub do + # Create client + client = ::Google::Cloud::Workflows::V1beta::Workflows::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_workflow({ workflow: workflow, update_mask: update_mask }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_workflow workflow: workflow, update_mask: update_mask do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_workflow ::Google::Cloud::Workflows::V1beta::UpdateWorkflowRequest.new(workflow: workflow, update_mask: update_mask) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_workflow({ workflow: workflow, update_mask: update_mask }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_workflow(::Google::Cloud::Workflows::V1beta::UpdateWorkflowRequest.new(workflow: workflow, update_mask: update_mask), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_workflow_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::Workflows::V1beta::Workflows::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::Workflows::V1beta::Workflows::Rest::Client::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-workflows-v1beta/test/google/cloud/workflows/v1beta/workflows_test.rb b/owl-bot-staging/google-cloud-workflows-v1beta/test/google/cloud/workflows/v1beta/workflows_test.rb new file mode 100644 index 000000000000..b92f9a575774 --- /dev/null +++ b/owl-bot-staging/google-cloud-workflows-v1beta/test/google/cloud/workflows/v1beta/workflows_test.rb @@ -0,0 +1,442 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/workflows/v1beta/workflows_pb" +require "google/cloud/workflows/v1beta/workflows" + +class ::Google::Cloud::Workflows::V1beta::Workflows::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_workflows + # Create GRPC objects. + grpc_response = ::Google::Cloud::Workflows::V1beta::ListWorkflowsResponse.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_workflows_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_workflows, name + assert_kind_of ::Google::Cloud::Workflows::V1beta::ListWorkflowsRequest, 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_workflows_client_stub do + # Create client + client = ::Google::Cloud::Workflows::V1beta::Workflows::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_workflows({ 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_workflows 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_workflows ::Google::Cloud::Workflows::V1beta::ListWorkflowsRequest.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_workflows({ 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_workflows(::Google::Cloud::Workflows::V1beta::ListWorkflowsRequest.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_workflows_client_stub.call_rpc_count + end + end + + def test_get_workflow + # Create GRPC objects. + grpc_response = ::Google::Cloud::Workflows::V1beta::Workflow.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_workflow_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_workflow, name + assert_kind_of ::Google::Cloud::Workflows::V1beta::GetWorkflowRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_workflow_client_stub do + # Create client + client = ::Google::Cloud::Workflows::V1beta::Workflows::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_workflow({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_workflow name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_workflow ::Google::Cloud::Workflows::V1beta::GetWorkflowRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_workflow({ 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_workflow(::Google::Cloud::Workflows::V1beta::GetWorkflowRequest.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_workflow_client_stub.call_rpc_count + end + end + + def test_create_workflow + # 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" + workflow = {} + workflow_id = "hello world" + + create_workflow_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_workflow, name + assert_kind_of ::Google::Cloud::Workflows::V1beta::CreateWorkflowRequest, request + assert_equal "hello world", request["parent"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Workflows::V1beta::Workflow), request["workflow"] + assert_equal "hello world", request["workflow_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_workflow_client_stub do + # Create client + client = ::Google::Cloud::Workflows::V1beta::Workflows::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_workflow({ parent: parent, workflow: workflow, workflow_id: workflow_id }) 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_workflow parent: parent, workflow: workflow, workflow_id: workflow_id 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_workflow ::Google::Cloud::Workflows::V1beta::CreateWorkflowRequest.new(parent: parent, workflow: workflow, workflow_id: workflow_id) 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_workflow({ parent: parent, workflow: workflow, workflow_id: workflow_id }, 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_workflow(::Google::Cloud::Workflows::V1beta::CreateWorkflowRequest.new(parent: parent, workflow: workflow, workflow_id: workflow_id), 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_workflow_client_stub.call_rpc_count + end + end + + def test_delete_workflow + # 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_workflow_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_workflow, name + assert_kind_of ::Google::Cloud::Workflows::V1beta::DeleteWorkflowRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_workflow_client_stub do + # Create client + client = ::Google::Cloud::Workflows::V1beta::Workflows::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_workflow({ 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_workflow 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_workflow ::Google::Cloud::Workflows::V1beta::DeleteWorkflowRequest.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_workflow({ 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_workflow(::Google::Cloud::Workflows::V1beta::DeleteWorkflowRequest.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_workflow_client_stub.call_rpc_count + end + end + + def test_update_workflow + # 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. + workflow = {} + update_mask = {} + + update_workflow_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_workflow, name + assert_kind_of ::Google::Cloud::Workflows::V1beta::UpdateWorkflowRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Workflows::V1beta::Workflow), request["workflow"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_workflow_client_stub do + # Create client + client = ::Google::Cloud::Workflows::V1beta::Workflows::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_workflow({ workflow: workflow, update_mask: update_mask }) 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.update_workflow workflow: workflow, update_mask: update_mask 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.update_workflow ::Google::Cloud::Workflows::V1beta::UpdateWorkflowRequest.new(workflow: workflow, update_mask: update_mask) 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.update_workflow({ workflow: workflow, update_mask: update_mask }, 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.update_workflow(::Google::Cloud::Workflows::V1beta::UpdateWorkflowRequest.new(workflow: workflow, update_mask: update_mask), 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, update_workflow_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::Workflows::V1beta::Workflows::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::Workflows::V1beta::Workflows::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::Workflows::V1beta::Workflows::Client.new do |config| + config.credentials = creds + end + assert_kind_of ::Google::Cloud::Workflows::V1beta::Workflows::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::Workflows::V1beta::Workflows::Client.new do |config| + config.credentials = grpc_channel + end + end + + assert_kind_of ::Google::Cloud::Workflows::V1beta::Workflows::Operations, client.operations_client + end +end diff --git a/owl-bot-staging/google-cloud-workflows-v1beta/test/helper.rb b/owl-bot-staging/google-cloud-workflows-v1beta/test/helper.rb new file mode 100644 index 000000000000..672b337030e7 --- /dev/null +++ b/owl-bot-staging/google-cloud-workflows-v1beta/test/helper.rb @@ -0,0 +1,26 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/mock" +require "minitest/rg" + +require "grpc" + +require "ostruct" diff --git a/owl-bot-staging/google-cloud-workstations-v1/.gitignore b/owl-bot-staging/google-cloud-workstations-v1/.gitignore new file mode 100644 index 000000000000..0135b6bc6cfc --- /dev/null +++ b/owl-bot-staging/google-cloud-workstations-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-workstations-v1/.repo-metadata.json b/owl-bot-staging/google-cloud-workstations-v1/.repo-metadata.json new file mode 100644 index 000000000000..45c35fe5368d --- /dev/null +++ b/owl-bot-staging/google-cloud-workstations-v1/.repo-metadata.json @@ -0,0 +1,17 @@ +{ + "api_id": "workstations.googleapis.com", + "api_shortname": "workstations", + "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-workstations-v1/latest", + "distribution_name": "google-cloud-workstations-v1", + "is_cloud": true, + "language": "ruby", + "name": "workstations", + "name_pretty": "Cloud Workstations V1 API", + "product_documentation": "https://cloud.google.com/workstations/docs", + "release_level": "unreleased", + "repo": "googleapis/google-cloud-ruby", + "requires_billing": true, + "ruby-cloud-description": "Allows administrators to create managed developer environments in the cloud. Note that google-cloud-workstations-v1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-workstations instead. See the readme for more details.", + "ruby-cloud-product-url": "https://cloud.google.com/workstations/docs", + "library_type": "GAPIC_AUTO" +} diff --git a/owl-bot-staging/google-cloud-workstations-v1/.rubocop.yml b/owl-bot-staging/google-cloud-workstations-v1/.rubocop.yml new file mode 100644 index 000000000000..a44551c617b3 --- /dev/null +++ b/owl-bot-staging/google-cloud-workstations-v1/.rubocop.yml @@ -0,0 +1,33 @@ +inherit_gem: + google-style: google-style.yml + +AllCops: + Exclude: + - "google-cloud-workstations-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-workstations-v1.rb" diff --git a/owl-bot-staging/google-cloud-workstations-v1/.toys.rb b/owl-bot-staging/google-cloud-workstations-v1/.toys.rb new file mode 100644 index 000000000000..177e22456e8a --- /dev/null +++ b/owl-bot-staging/google-cloud-workstations-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-workstations-v1/.yardopts b/owl-bot-staging/google-cloud-workstations-v1/.yardopts new file mode 100644 index 000000000000..2d5ddbfd78ca --- /dev/null +++ b/owl-bot-staging/google-cloud-workstations-v1/.yardopts @@ -0,0 +1,12 @@ +--no-private +--title="Cloud Workstations 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-workstations-v1/AUTHENTICATION.md b/owl-bot-staging/google-cloud-workstations-v1/AUTHENTICATION.md new file mode 100644 index 000000000000..f69ad9397007 --- /dev/null +++ b/owl-bot-staging/google-cloud-workstations-v1/AUTHENTICATION.md @@ -0,0 +1,122 @@ +# Authentication + +The recommended way to authenticate to the google-cloud-workstations-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-workstations-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/workstations/v1" + +client = ::Google::Cloud::Workstations::V1::Workstations::Client.new do |config| + config.credentials = "path/to/credentialfile.json" +end +``` + +To configure a credentials file globally for all clients: + +```ruby +require "google/cloud/workstations/v1" + +::Google::Cloud::Workstations::V1::Workstations::Client.configure do |config| + config.credentials = "path/to/credentialfile.json" +end + +client = ::Google::Cloud::Workstations::V1::Workstations::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-workstations-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/workstations/v1" + +ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" + +client = ::Google::Cloud::Workstations::V1::Workstations::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-workstations-v1/CHANGELOG.md b/owl-bot-staging/google-cloud-workstations-v1/CHANGELOG.md new file mode 100644 index 000000000000..f88957a62ba2 --- /dev/null +++ b/owl-bot-staging/google-cloud-workstations-v1/CHANGELOG.md @@ -0,0 +1,2 @@ +# Release History + diff --git a/owl-bot-staging/google-cloud-workstations-v1/Gemfile b/owl-bot-staging/google-cloud-workstations-v1/Gemfile new file mode 100644 index 000000000000..1d08558908d8 --- /dev/null +++ b/owl-bot-staging/google-cloud-workstations-v1/Gemfile @@ -0,0 +1,14 @@ +source "https://rubygems.org" + +gemspec + +gem "google-style", "~> 1.32.0" +gem "irb", "~> 1.17" +gem "minitest", "~> 6.0.2" +gem "minitest-focus", "~> 1.4" +gem "minitest-mock", "~> 5.27" +gem "minitest-rg", "~> 5.3" +gem "ostruct", "~> 0.5.5" +gem "rake", ">= 13.0" +gem "redcarpet", "~> 3.6" +gem "yard", "~> 0.9" diff --git a/owl-bot-staging/google-cloud-workstations-v1/LICENSE.md b/owl-bot-staging/google-cloud-workstations-v1/LICENSE.md new file mode 100644 index 000000000000..c261857ba6ad --- /dev/null +++ b/owl-bot-staging/google-cloud-workstations-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-workstations-v1/README.md b/owl-bot-staging/google-cloud-workstations-v1/README.md new file mode 100644 index 000000000000..a82b29f2a4e7 --- /dev/null +++ b/owl-bot-staging/google-cloud-workstations-v1/README.md @@ -0,0 +1,153 @@ +# Ruby Client for the Cloud Workstations V1 API + +Allows administrators to create managed developer environments in the cloud. + + +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 Workstations V1 API. Most users should consider using +the main client gem, +[google-cloud-workstations](https://rubygems.org/gems/google-cloud-workstations). +See the section below titled *Which client should I use?* for more information. + +## Installation + +``` +$ gem install google-cloud-workstations-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/workstations.googleapis.com) +1. [Set up authentication.](AUTHENTICATION.md) + +## Quick Start + +```ruby +require "google/cloud/workstations/v1" + +client = ::Google::Cloud::Workstations::V1::Workstations::Client.new +request = ::Google::Cloud::Workstations::V1::GetWorkstationClusterRequest.new # (request fields as keyword arguments...) +response = client.get_workstation_cluster request +``` + +View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-workstations-v1/latest) +for class and method documentation. + +See also the [Product Documentation](https://cloud.google.com/workstations/docs) +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/workstations/v1" +require "logger" + +client = ::Google::Cloud::Workstations::V1::Workstations::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-workstations`, +and lower-level _versioned_ client libraries with names such as +`google-cloud-workstations-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-workstations`. +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-workstations-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-workstations-v1/Rakefile b/owl-bot-staging/google-cloud-workstations-v1/Rakefile new file mode 100644 index 000000000000..2d6588091b1a --- /dev/null +++ b/owl-bot-staging/google-cloud-workstations-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-workstations-v1 acceptance tests." +task :acceptance, :project, :keyfile do |t, args| + project = args[:project] + project ||= + ENV["GOOGLE_CLOUD_TEST_PROJECT"] || + ENV["GCLOUD_TEST_PROJECT"] + keyfile = args[:keyfile] + keyfile ||= + ENV["GOOGLE_CLOUD_TEST_KEYFILE"] || + ENV["GCLOUD_TEST_KEYFILE"] + if keyfile + keyfile = File.read keyfile + else + keyfile ||= + ENV["GOOGLE_CLOUD_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 GOOGLE_CLOUD_TEST_PROJECT=test123 GOOGLE_CLOUD_TEST_KEYFILE=/path/to/keyfile.json rake acceptance" + end + require "google/cloud/workstations/v1/workstations/credentials" + ::Google::Cloud::Workstations::V1::Workstations::Credentials.env_vars.each do |path| + ENV[path] = nil + end + ENV["GOOGLE_CLOUD_PROJECT"] = project + ENV["GOOGLE_CLOUD_TEST_PROJECT"] = project + ENV["GOOGLE_CLOUD_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-workstations-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-workstations-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-workstations-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-workstations-v1 gem does not have doctest tests." +end + +desc "Run the CI build" +task :ci do + header "BUILDING google-cloud-workstations-v1" + header "google-cloud-workstations-v1 rubocop", "*" + Rake::Task[:rubocop].invoke + header "google-cloud-workstations-v1 yard", "*" + Rake::Task[:yard].invoke + header "google-cloud-workstations-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-workstations-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-workstations-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-workstations-v1/gapic_metadata.json b/owl-bot-staging/google-cloud-workstations-v1/gapic_metadata.json new file mode 100644 index 000000000000..27954dcb3a8f --- /dev/null +++ b/owl-bot-staging/google-cloud-workstations-v1/gapic_metadata.json @@ -0,0 +1,118 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "ruby", + "protoPackage": "google.cloud.workstations.v1", + "libraryPackage": "::Google::Cloud::Workstations::V1", + "services": { + "Workstations": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::Workstations::V1::Workstations::Client", + "rpcs": { + "GetWorkstationCluster": { + "methods": [ + "get_workstation_cluster" + ] + }, + "ListWorkstationClusters": { + "methods": [ + "list_workstation_clusters" + ] + }, + "CreateWorkstationCluster": { + "methods": [ + "create_workstation_cluster" + ] + }, + "UpdateWorkstationCluster": { + "methods": [ + "update_workstation_cluster" + ] + }, + "DeleteWorkstationCluster": { + "methods": [ + "delete_workstation_cluster" + ] + }, + "GetWorkstationConfig": { + "methods": [ + "get_workstation_config" + ] + }, + "ListWorkstationConfigs": { + "methods": [ + "list_workstation_configs" + ] + }, + "ListUsableWorkstationConfigs": { + "methods": [ + "list_usable_workstation_configs" + ] + }, + "CreateWorkstationConfig": { + "methods": [ + "create_workstation_config" + ] + }, + "UpdateWorkstationConfig": { + "methods": [ + "update_workstation_config" + ] + }, + "DeleteWorkstationConfig": { + "methods": [ + "delete_workstation_config" + ] + }, + "GetWorkstation": { + "methods": [ + "get_workstation" + ] + }, + "ListWorkstations": { + "methods": [ + "list_workstations" + ] + }, + "ListUsableWorkstations": { + "methods": [ + "list_usable_workstations" + ] + }, + "CreateWorkstation": { + "methods": [ + "create_workstation" + ] + }, + "UpdateWorkstation": { + "methods": [ + "update_workstation" + ] + }, + "DeleteWorkstation": { + "methods": [ + "delete_workstation" + ] + }, + "StartWorkstation": { + "methods": [ + "start_workstation" + ] + }, + "StopWorkstation": { + "methods": [ + "stop_workstation" + ] + }, + "GenerateAccessToken": { + "methods": [ + "generate_access_token" + ] + } + } + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-workstations-v1/google-cloud-workstations-v1.gemspec b/owl-bot-staging/google-cloud-workstations-v1/google-cloud-workstations-v1.gemspec new file mode 100644 index 000000000000..d1e85aa74e8d --- /dev/null +++ b/owl-bot-staging/google-cloud-workstations-v1/google-cloud-workstations-v1.gemspec @@ -0,0 +1,30 @@ +# -*- ruby -*- +# encoding: utf-8 + +require File.expand_path("lib/google/cloud/workstations/v1/version", __dir__) + +Gem::Specification.new do |gem| + gem.name = "google-cloud-workstations-v1" + gem.version = Google::Cloud::Workstations::V1::VERSION + + gem.authors = ["Google LLC"] + gem.email = "googleapis-packages@google.com" + gem.description = "Allows administrators to create managed developer environments in the cloud. Note that google-cloud-workstations-v1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-workstations instead. See the readme for more details." + gem.summary = "Allows administrators to create managed developer environments in the cloud." + 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.2" + + 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-workstations-v1/lib/google-cloud-workstations-v1.rb b/owl-bot-staging/google-cloud-workstations-v1/lib/google-cloud-workstations-v1.rb new file mode 100644 index 000000000000..5432da78d5cb --- /dev/null +++ b/owl-bot-staging/google-cloud-workstations-v1/lib/google-cloud-workstations-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/workstations/v1" diff --git a/owl-bot-staging/google-cloud-workstations-v1/lib/google/cloud/workstations/v1.rb b/owl-bot-staging/google-cloud-workstations-v1/lib/google/cloud/workstations/v1.rb new file mode 100644 index 000000000000..33d0c263a9f4 --- /dev/null +++ b/owl-bot-staging/google-cloud-workstations-v1/lib/google/cloud/workstations/v1.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/workstations/v1/workstations" +require "google/cloud/workstations/v1/version" + +module Google + module Cloud + module Workstations + ## + # API client module. + # + # @example Load this package, including all its services, and instantiate a gRPC client + # + # require "google/cloud/workstations/v1" + # client = ::Google::Cloud::Workstations::V1::Workstations::Client.new + # + # @example Load this package, including all its services, and instantiate a REST client + # + # require "google/cloud/workstations/v1" + # client = ::Google::Cloud::Workstations::V1::Workstations::Rest::Client.new + # + module V1 + end + end + end +end + +helper_path = ::File.join __dir__, "v1", "_helpers.rb" +require "google/cloud/workstations/v1/_helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-workstations-v1/lib/google/cloud/workstations/v1/bindings_override.rb b/owl-bot-staging/google-cloud-workstations-v1/lib/google/cloud/workstations/v1/bindings_override.rb new file mode 100644 index 000000000000..4e045e2c88f2 --- /dev/null +++ b/owl-bot-staging/google-cloud-workstations-v1/lib/google/cloud/workstations/v1/bindings_override.rb @@ -0,0 +1,110 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Workstations + ## + # @example Loading just the REST part of this package, including all its services, and instantiating a REST client + # + # require "google/cloud/workstations/v1/rest" + # client = ::Google::Cloud::Workstations::V1::Workstations::Rest::Client.new + # + module V1 + ## + # @private + # Initialize the mixin bindings configuration + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "Workstations"] + 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.iam.v1.IAMPolicy.GetIamPolicy"] = [ + Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( + uri_method: :get, + uri_template: "/v1/{resource}:getIamPolicy", + matches: [ + ["resource", %r{^projects/[^/]+/locations/[^/]+/workstationClusters/[^/]+/workstationConfigs/[^/]+/?$}, false] + ], + body: nil + ), + Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( + uri_method: :get, + uri_template: "/v1/{resource}:getIamPolicy", + matches: [ + ["resource", %r{^projects/[^/]+/locations/[^/]+/workstationClusters/[^/]+/workstationConfigs/[^/]+/workstations/[^/]+/?$}, 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/[^/]+/workstationClusters/[^/]+/workstationConfigs/[^/]+/?$}, false] + ], + body: "*" + ), + Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( + uri_method: :post, + uri_template: "/v1/{resource}:setIamPolicy", + matches: [ + ["resource", %r{^projects/[^/]+/locations/[^/]+/workstationClusters/[^/]+/workstationConfigs/[^/]+/workstations/[^/]+/?$}, 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/[^/]+/workstationClusters/[^/]+/workstationConfigs/[^/]+/?$}, false] + ], + body: "*" + ), + Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( + uri_method: :post, + uri_template: "/v1/{resource}:testIamPermissions", + matches: [ + ["resource", %r{^projects/[^/]+/locations/[^/]+/workstationClusters/[^/]+/workstationConfigs/[^/]+/workstations/[^/]+/?$}, false] + ], + body: "*" + ) + ] + default_config + end + yield @configure if block_given? + @configure + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-workstations-v1/lib/google/cloud/workstations/v1/rest.rb b/owl-bot-staging/google-cloud-workstations-v1/lib/google/cloud/workstations/v1/rest.rb new file mode 100644 index 000000000000..4a1cec95dcc9 --- /dev/null +++ b/owl-bot-staging/google-cloud-workstations-v1/lib/google/cloud/workstations/v1/rest.rb @@ -0,0 +1,38 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/workstations/v1/workstations/rest" +require "google/cloud/workstations/v1/bindings_override" +require "google/cloud/workstations/v1/version" + +module Google + module Cloud + module Workstations + ## + # To load just the REST part of this package, including all its services, and instantiate a REST client: + # + # @example + # + # require "google/cloud/workstations/v1/rest" + # client = ::Google::Cloud::Workstations::V1::Workstations::Rest::Client.new + # + module V1 + end + end + end +end diff --git a/owl-bot-staging/google-cloud-workstations-v1/lib/google/cloud/workstations/v1/version.rb b/owl-bot-staging/google-cloud-workstations-v1/lib/google/cloud/workstations/v1/version.rb new file mode 100644 index 000000000000..fda56f15b199 --- /dev/null +++ b/owl-bot-staging/google-cloud-workstations-v1/lib/google/cloud/workstations/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 Workstations + module V1 + VERSION = "0.0.1" + end + end + end +end diff --git a/owl-bot-staging/google-cloud-workstations-v1/lib/google/cloud/workstations/v1/workstations.rb b/owl-bot-staging/google-cloud-workstations-v1/lib/google/cloud/workstations/v1/workstations.rb new file mode 100644 index 000000000000..08a4bda4af66 --- /dev/null +++ b/owl-bot-staging/google-cloud-workstations-v1/lib/google/cloud/workstations/v1/workstations.rb @@ -0,0 +1,56 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/workstations/v1/version" + +require "google/cloud/workstations/v1/workstations/credentials" +require "google/cloud/workstations/v1/workstations/paths" +require "google/cloud/workstations/v1/workstations/operations" +require "google/cloud/workstations/v1/workstations/client" +require "google/cloud/workstations/v1/workstations/rest" + +module Google + module Cloud + module Workstations + module V1 + ## + # Service for interacting with Cloud Workstations. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/workstations/v1/workstations" + # client = ::Google::Cloud::Workstations::V1::Workstations::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/workstations/v1/workstations/rest" + # client = ::Google::Cloud::Workstations::V1::Workstations::Rest::Client.new + # + module Workstations + end + end + end + end +end + +helper_path = ::File.join __dir__, "workstations", "helpers.rb" +require "google/cloud/workstations/v1/workstations/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-workstations-v1/lib/google/cloud/workstations/v1/workstations/client.rb b/owl-bot-staging/google-cloud-workstations-v1/lib/google/cloud/workstations/v1/workstations/client.rb new file mode 100644 index 000000000000..0a8ab36092c6 --- /dev/null +++ b/owl-bot-staging/google-cloud-workstations-v1/lib/google/cloud/workstations/v1/workstations/client.rb @@ -0,0 +1,2595 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/workstations/v1/workstations_pb" +require "google/cloud/location" +require "google/iam/v1" + +module Google + module Cloud + module Workstations + module V1 + module Workstations + ## + # Client for the Workstations service. + # + # Service for interacting with Cloud Workstations. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "workstations.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :workstations_stub + + ## + # Configure the Workstations Client class. + # + # See {::Google::Cloud::Workstations::V1::Workstations::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all Workstations clients + # ::Google::Cloud::Workstations::V1::Workstations::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", "Workstations", "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.get_workstation_cluster.timeout = 60.0 + default_config.rpcs.get_workstation_cluster.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.list_workstation_clusters.timeout = 60.0 + default_config.rpcs.list_workstation_clusters.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.create_workstation_cluster.timeout = 60.0 + + default_config.rpcs.update_workstation_cluster.timeout = 60.0 + + default_config.rpcs.delete_workstation_cluster.timeout = 60.0 + + default_config.rpcs.get_workstation_config.timeout = 60.0 + default_config.rpcs.get_workstation_config.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.list_workstation_configs.timeout = 60.0 + default_config.rpcs.list_workstation_configs.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.list_usable_workstation_configs.timeout = 60.0 + default_config.rpcs.list_usable_workstation_configs.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.create_workstation_config.timeout = 60.0 + + default_config.rpcs.update_workstation_config.timeout = 60.0 + + default_config.rpcs.delete_workstation_config.timeout = 60.0 + + default_config.rpcs.get_workstation.timeout = 60.0 + default_config.rpcs.get_workstation.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.list_workstations.timeout = 60.0 + default_config.rpcs.list_workstations.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.list_usable_workstations.timeout = 60.0 + default_config.rpcs.list_usable_workstations.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.create_workstation.timeout = 60.0 + + default_config.rpcs.update_workstation.timeout = 60.0 + + default_config.rpcs.delete_workstation.timeout = 60.0 + + default_config.rpcs.start_workstation.timeout = 60.0 + + default_config.rpcs.stop_workstation.timeout = 60.0 + + default_config.rpcs.generate_access_token.timeout = 60.0 + default_config.rpcs.generate_access_token.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the Workstations 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::Workstations::V1::Workstations::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 + @workstations_stub.universe_domain + end + + ## + # Create a new Workstations client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Workstations::V1::Workstations::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Workstations::V1::Workstations::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Workstations 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/workstations/v1/workstations_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 + + @workstations_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::Workstations::V1::Workstations::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 + ) + + @workstations_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 = @workstations_stub.endpoint + config.universe_domain = @workstations_stub.universe_domain + config.logger = @workstations_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 = @workstations_stub.endpoint + config.universe_domain = @workstations_stub.universe_domain + config.logger = @workstations_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::Workstations::V1::Workstations::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 + @workstations_stub.logger + end + + # Service calls + + ## + # Returns the requested workstation cluster. + # + # @overload get_workstation_cluster(request, options = nil) + # Pass arguments to `get_workstation_cluster` via a request object, either of type + # {::Google::Cloud::Workstations::V1::GetWorkstationClusterRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Workstations::V1::GetWorkstationClusterRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_workstation_cluster(name: nil) + # Pass arguments to `get_workstation_cluster` via keyword arguments. Note that at + # least one keyword argument is 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 requested resource. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Workstations::V1::WorkstationCluster] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Workstations::V1::WorkstationCluster] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/workstations/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Workstations::V1::Workstations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Workstations::V1::GetWorkstationClusterRequest.new + # + # # Call the get_workstation_cluster method. + # result = client.get_workstation_cluster request + # + # # The returned object is of type Google::Cloud::Workstations::V1::WorkstationCluster. + # p result + # + def get_workstation_cluster request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workstations::V1::GetWorkstationClusterRequest + + # Converts hash 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_workstation_cluster.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::Workstations::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_workstation_cluster.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_workstation_cluster.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @workstations_stub.call_rpc :get_workstation_cluster, 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 all workstation clusters in the specified location. + # + # @overload list_workstation_clusters(request, options = nil) + # Pass arguments to `list_workstation_clusters` via a request object, either of type + # {::Google::Cloud::Workstations::V1::ListWorkstationClustersRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Workstations::V1::ListWorkstationClustersRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_workstation_clusters(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_workstation_clusters` via keyword arguments. Note that at + # least one keyword argument is 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. Parent resource name. + # @param page_size [::Integer] + # Optional. Maximum number of items to return. + # @param page_token [::String] + # Optional. next_page_token value returned from a previous List request, if + # any. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Workstations::V1::WorkstationCluster>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::Workstations::V1::WorkstationCluster>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/workstations/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Workstations::V1::Workstations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Workstations::V1::ListWorkstationClustersRequest.new + # + # # Call the list_workstation_clusters method. + # result = client.list_workstation_clusters 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::Workstations::V1::WorkstationCluster. + # p item + # end + # + def list_workstation_clusters request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workstations::V1::ListWorkstationClustersRequest + + # Converts hash 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_workstation_clusters.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::Workstations::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_workstation_clusters.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_workstation_clusters.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @workstations_stub.call_rpc :list_workstation_clusters, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @workstations_stub, :list_workstation_clusters, 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 + + ## + # Creates a new workstation cluster. + # + # @overload create_workstation_cluster(request, options = nil) + # Pass arguments to `create_workstation_cluster` via a request object, either of type + # {::Google::Cloud::Workstations::V1::CreateWorkstationClusterRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Workstations::V1::CreateWorkstationClusterRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_workstation_cluster(parent: nil, workstation_cluster_id: nil, workstation_cluster: nil, validate_only: nil) + # Pass arguments to `create_workstation_cluster` via keyword arguments. Note that at + # least one keyword argument is 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. Parent resource name. + # @param workstation_cluster_id [::String] + # Required. ID to use for the workstation cluster. + # @param workstation_cluster [::Google::Cloud::Workstations::V1::WorkstationCluster, ::Hash] + # Required. Workstation cluster to create. + # @param validate_only [::Boolean] + # Optional. If set, validate the request and preview the review, but do not + # actually apply it. + # + # @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/workstations/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Workstations::V1::Workstations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Workstations::V1::CreateWorkstationClusterRequest.new + # + # # Call the create_workstation_cluster method. + # result = client.create_workstation_cluster 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_workstation_cluster request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workstations::V1::CreateWorkstationClusterRequest + + # Converts hash 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_workstation_cluster.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::Workstations::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_workstation_cluster.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_workstation_cluster.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @workstations_stub.call_rpc :create_workstation_cluster, 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 + + ## + # Updates an existing workstation cluster. + # + # @overload update_workstation_cluster(request, options = nil) + # Pass arguments to `update_workstation_cluster` via a request object, either of type + # {::Google::Cloud::Workstations::V1::UpdateWorkstationClusterRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Workstations::V1::UpdateWorkstationClusterRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_workstation_cluster(workstation_cluster: nil, update_mask: nil, validate_only: nil, allow_missing: nil) + # Pass arguments to `update_workstation_cluster` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param workstation_cluster [::Google::Cloud::Workstations::V1::WorkstationCluster, ::Hash] + # Required. Workstation cluster to update. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. Mask that specifies which fields in the workstation cluster + # should be updated. + # @param validate_only [::Boolean] + # Optional. If set, validate the request and preview the review, but do not + # actually apply it. + # @param allow_missing [::Boolean] + # Optional. If set, and the workstation cluster is not found, a new + # workstation cluster will be created. In this situation, update_mask is + # ignored. + # + # @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/workstations/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Workstations::V1::Workstations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Workstations::V1::UpdateWorkstationClusterRequest.new + # + # # Call the update_workstation_cluster method. + # result = client.update_workstation_cluster 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 update_workstation_cluster request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workstations::V1::UpdateWorkstationClusterRequest + + # Converts hash 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_workstation_cluster.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::Workstations::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.workstation_cluster&.name + header_params["workstation_cluster.name"] = request.workstation_cluster.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_workstation_cluster.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_workstation_cluster.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @workstations_stub.call_rpc :update_workstation_cluster, 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 the specified workstation cluster. + # + # @overload delete_workstation_cluster(request, options = nil) + # Pass arguments to `delete_workstation_cluster` via a request object, either of type + # {::Google::Cloud::Workstations::V1::DeleteWorkstationClusterRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Workstations::V1::DeleteWorkstationClusterRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_workstation_cluster(name: nil, validate_only: nil, etag: nil, force: nil) + # Pass arguments to `delete_workstation_cluster` via keyword arguments. Note that at + # least one keyword argument is 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 workstation cluster to delete. + # @param validate_only [::Boolean] + # Optional. If set, validate the request and preview the review, but do not + # apply it. + # @param etag [::String] + # Optional. If set, the request will be rejected if the latest version of the + # workstation cluster on the server does not have this ETag. + # @param force [::Boolean] + # Optional. If set, any workstation configurations and workstations in the + # workstation cluster are also deleted. Otherwise, the request only + # works if the workstation cluster has no configurations or workstations. + # + # @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/workstations/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Workstations::V1::Workstations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Workstations::V1::DeleteWorkstationClusterRequest.new + # + # # Call the delete_workstation_cluster method. + # result = client.delete_workstation_cluster 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_workstation_cluster request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workstations::V1::DeleteWorkstationClusterRequest + + # Converts hash 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_workstation_cluster.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::Workstations::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_workstation_cluster.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_workstation_cluster.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @workstations_stub.call_rpc :delete_workstation_cluster, 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 requested workstation configuration. + # + # @overload get_workstation_config(request, options = nil) + # Pass arguments to `get_workstation_config` via a request object, either of type + # {::Google::Cloud::Workstations::V1::GetWorkstationConfigRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Workstations::V1::GetWorkstationConfigRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_workstation_config(name: nil) + # Pass arguments to `get_workstation_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 requested resource. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Workstations::V1::WorkstationConfig] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Workstations::V1::WorkstationConfig] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/workstations/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Workstations::V1::Workstations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Workstations::V1::GetWorkstationConfigRequest.new + # + # # Call the get_workstation_config method. + # result = client.get_workstation_config request + # + # # The returned object is of type Google::Cloud::Workstations::V1::WorkstationConfig. + # p result + # + def get_workstation_config request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workstations::V1::GetWorkstationConfigRequest + + # Converts hash 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_workstation_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::Workstations::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_workstation_config.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_workstation_config.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @workstations_stub.call_rpc :get_workstation_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 all workstation configurations in the specified cluster. + # + # @overload list_workstation_configs(request, options = nil) + # Pass arguments to `list_workstation_configs` via a request object, either of type + # {::Google::Cloud::Workstations::V1::ListWorkstationConfigsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Workstations::V1::ListWorkstationConfigsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_workstation_configs(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_workstation_configs` via keyword arguments. Note that at + # least one keyword argument is 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. Parent resource name. + # @param page_size [::Integer] + # Optional. Maximum number of items to return. + # @param page_token [::String] + # Optional. next_page_token value returned from a previous List request, if + # any. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Workstations::V1::WorkstationConfig>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::Workstations::V1::WorkstationConfig>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/workstations/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Workstations::V1::Workstations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Workstations::V1::ListWorkstationConfigsRequest.new + # + # # Call the list_workstation_configs method. + # result = client.list_workstation_configs 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::Workstations::V1::WorkstationConfig. + # p item + # end + # + def list_workstation_configs request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workstations::V1::ListWorkstationConfigsRequest + + # Converts hash 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_workstation_configs.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::Workstations::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_workstation_configs.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_workstation_configs.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @workstations_stub.call_rpc :list_workstation_configs, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @workstations_stub, :list_workstation_configs, 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 all workstation configurations in the specified cluster on which + # the caller has the "workstations.workstation.create" permission. + # + # @overload list_usable_workstation_configs(request, options = nil) + # Pass arguments to `list_usable_workstation_configs` via a request object, either of type + # {::Google::Cloud::Workstations::V1::ListUsableWorkstationConfigsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Workstations::V1::ListUsableWorkstationConfigsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_usable_workstation_configs(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_usable_workstation_configs` via keyword arguments. Note that at + # least one keyword argument is 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. Parent resource name. + # @param page_size [::Integer] + # Optional. Maximum number of items to return. + # @param page_token [::String] + # Optional. next_page_token value returned from a previous List request, if + # any. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Workstations::V1::WorkstationConfig>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::Workstations::V1::WorkstationConfig>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/workstations/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Workstations::V1::Workstations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Workstations::V1::ListUsableWorkstationConfigsRequest.new + # + # # Call the list_usable_workstation_configs method. + # result = client.list_usable_workstation_configs 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::Workstations::V1::WorkstationConfig. + # p item + # end + # + def list_usable_workstation_configs request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workstations::V1::ListUsableWorkstationConfigsRequest + + # Converts hash 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_usable_workstation_configs.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::Workstations::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_usable_workstation_configs.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_usable_workstation_configs.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @workstations_stub.call_rpc :list_usable_workstation_configs, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @workstations_stub, :list_usable_workstation_configs, 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 + + ## + # Creates a new workstation configuration. + # + # @overload create_workstation_config(request, options = nil) + # Pass arguments to `create_workstation_config` via a request object, either of type + # {::Google::Cloud::Workstations::V1::CreateWorkstationConfigRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Workstations::V1::CreateWorkstationConfigRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_workstation_config(parent: nil, workstation_config_id: nil, workstation_config: nil, validate_only: nil) + # Pass arguments to `create_workstation_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. Parent resource name. + # @param workstation_config_id [::String] + # Required. ID to use for the workstation configuration. + # @param workstation_config [::Google::Cloud::Workstations::V1::WorkstationConfig, ::Hash] + # Required. Config to create. + # @param validate_only [::Boolean] + # Optional. If set, validate the request and preview the review, but do not + # actually apply it. + # + # @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/workstations/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Workstations::V1::Workstations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Workstations::V1::CreateWorkstationConfigRequest.new + # + # # Call the create_workstation_config method. + # result = client.create_workstation_config 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_workstation_config request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workstations::V1::CreateWorkstationConfigRequest + + # Converts hash 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_workstation_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::Workstations::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_workstation_config.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_workstation_config.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @workstations_stub.call_rpc :create_workstation_config, 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 + + ## + # Updates an existing workstation configuration. + # + # @overload update_workstation_config(request, options = nil) + # Pass arguments to `update_workstation_config` via a request object, either of type + # {::Google::Cloud::Workstations::V1::UpdateWorkstationConfigRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Workstations::V1::UpdateWorkstationConfigRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_workstation_config(workstation_config: nil, update_mask: nil, validate_only: nil, allow_missing: nil) + # Pass arguments to `update_workstation_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 workstation_config [::Google::Cloud::Workstations::V1::WorkstationConfig, ::Hash] + # Required. Config to update. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. Mask specifying which fields in the workstation configuration + # should be updated. + # @param validate_only [::Boolean] + # Optional. If set, validate the request and preview the review, but do not + # actually apply it. + # @param allow_missing [::Boolean] + # Optional. If set and the workstation configuration is not found, a new + # workstation configuration will be created. In this situation, + # update_mask is ignored. + # + # @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/workstations/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Workstations::V1::Workstations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Workstations::V1::UpdateWorkstationConfigRequest.new + # + # # Call the update_workstation_config method. + # result = client.update_workstation_config 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 update_workstation_config request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workstations::V1::UpdateWorkstationConfigRequest + + # Converts hash 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_workstation_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::Workstations::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.workstation_config&.name + header_params["workstation_config.name"] = request.workstation_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_workstation_config.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_workstation_config.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @workstations_stub.call_rpc :update_workstation_config, 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 the specified workstation configuration. + # + # @overload delete_workstation_config(request, options = nil) + # Pass arguments to `delete_workstation_config` via a request object, either of type + # {::Google::Cloud::Workstations::V1::DeleteWorkstationConfigRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Workstations::V1::DeleteWorkstationConfigRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_workstation_config(name: nil, validate_only: nil, etag: nil, force: nil) + # Pass arguments to `delete_workstation_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 workstation configuration to delete. + # @param validate_only [::Boolean] + # Optional. If set, validate the request and preview the review, but do not + # actually apply it. + # @param etag [::String] + # Optional. If set, the request is rejected if the latest version of the + # workstation configuration on the server does not have this ETag. + # @param force [::Boolean] + # Optional. If set, any workstations in the workstation configuration are + # also deleted. Otherwise, the request works only if the workstation + # configuration has no workstations. + # + # @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/workstations/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Workstations::V1::Workstations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Workstations::V1::DeleteWorkstationConfigRequest.new + # + # # Call the delete_workstation_config method. + # result = client.delete_workstation_config 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_workstation_config request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workstations::V1::DeleteWorkstationConfigRequest + + # Converts hash 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_workstation_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::Workstations::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_workstation_config.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_workstation_config.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @workstations_stub.call_rpc :delete_workstation_config, 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 requested workstation. + # + # @overload get_workstation(request, options = nil) + # Pass arguments to `get_workstation` via a request object, either of type + # {::Google::Cloud::Workstations::V1::GetWorkstationRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Workstations::V1::GetWorkstationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_workstation(name: nil) + # Pass arguments to `get_workstation` via keyword arguments. Note that at + # least one keyword argument is 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 requested resource. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Workstations::V1::Workstation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Workstations::V1::Workstation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/workstations/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Workstations::V1::Workstations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Workstations::V1::GetWorkstationRequest.new + # + # # Call the get_workstation method. + # result = client.get_workstation request + # + # # The returned object is of type Google::Cloud::Workstations::V1::Workstation. + # p result + # + def get_workstation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workstations::V1::GetWorkstationRequest + + # Converts hash 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_workstation.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::Workstations::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_workstation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_workstation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @workstations_stub.call_rpc :get_workstation, 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 all Workstations using the specified workstation configuration. + # + # @overload list_workstations(request, options = nil) + # Pass arguments to `list_workstations` via a request object, either of type + # {::Google::Cloud::Workstations::V1::ListWorkstationsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Workstations::V1::ListWorkstationsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_workstations(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_workstations` via keyword arguments. Note that at + # least one keyword argument is 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. Parent resource name. + # @param page_size [::Integer] + # Optional. Maximum number of items to return. + # @param page_token [::String] + # Optional. next_page_token value returned from a previous List request, if + # any. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Workstations::V1::Workstation>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::Workstations::V1::Workstation>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/workstations/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Workstations::V1::Workstations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Workstations::V1::ListWorkstationsRequest.new + # + # # Call the list_workstations method. + # result = client.list_workstations 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::Workstations::V1::Workstation. + # p item + # end + # + def list_workstations request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workstations::V1::ListWorkstationsRequest + + # Converts hash 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_workstations.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::Workstations::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_workstations.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_workstations.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @workstations_stub.call_rpc :list_workstations, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @workstations_stub, :list_workstations, 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 all workstations using the specified workstation configuration + # on which the caller has the "workstations.workstations.use" permission. + # + # @overload list_usable_workstations(request, options = nil) + # Pass arguments to `list_usable_workstations` via a request object, either of type + # {::Google::Cloud::Workstations::V1::ListUsableWorkstationsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Workstations::V1::ListUsableWorkstationsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_usable_workstations(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_usable_workstations` via keyword arguments. Note that at + # least one keyword argument is 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. Parent resource name. + # @param page_size [::Integer] + # Optional. Maximum number of items to return. + # @param page_token [::String] + # Optional. next_page_token value returned from a previous List request, if + # any. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Workstations::V1::Workstation>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::Workstations::V1::Workstation>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/workstations/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Workstations::V1::Workstations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Workstations::V1::ListUsableWorkstationsRequest.new + # + # # Call the list_usable_workstations method. + # result = client.list_usable_workstations 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::Workstations::V1::Workstation. + # p item + # end + # + def list_usable_workstations request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workstations::V1::ListUsableWorkstationsRequest + + # Converts hash 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_usable_workstations.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::Workstations::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_usable_workstations.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_usable_workstations.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @workstations_stub.call_rpc :list_usable_workstations, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @workstations_stub, :list_usable_workstations, 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 + + ## + # Creates a new workstation. + # + # @overload create_workstation(request, options = nil) + # Pass arguments to `create_workstation` via a request object, either of type + # {::Google::Cloud::Workstations::V1::CreateWorkstationRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Workstations::V1::CreateWorkstationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_workstation(parent: nil, workstation_id: nil, workstation: nil, validate_only: nil) + # Pass arguments to `create_workstation` via keyword arguments. Note that at + # least one keyword argument is 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. Parent resource name. + # @param workstation_id [::String] + # Required. ID to use for the workstation. + # @param workstation [::Google::Cloud::Workstations::V1::Workstation, ::Hash] + # Required. Workstation to create. + # @param validate_only [::Boolean] + # Optional. If set, validate the request and preview the review, but do not + # actually apply it. + # + # @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/workstations/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Workstations::V1::Workstations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Workstations::V1::CreateWorkstationRequest.new + # + # # Call the create_workstation method. + # result = client.create_workstation 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_workstation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workstations::V1::CreateWorkstationRequest + + # Converts hash 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_workstation.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::Workstations::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_workstation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_workstation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @workstations_stub.call_rpc :create_workstation, 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 + + ## + # Updates an existing workstation. + # + # @overload update_workstation(request, options = nil) + # Pass arguments to `update_workstation` via a request object, either of type + # {::Google::Cloud::Workstations::V1::UpdateWorkstationRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Workstations::V1::UpdateWorkstationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_workstation(workstation: nil, update_mask: nil, validate_only: nil, allow_missing: nil) + # Pass arguments to `update_workstation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param workstation [::Google::Cloud::Workstations::V1::Workstation, ::Hash] + # Required. Workstation to update. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. Mask specifying which fields in the workstation configuration + # should be updated. + # @param validate_only [::Boolean] + # Optional. If set, validate the request and preview the review, but do not + # actually apply it. + # @param allow_missing [::Boolean] + # Optional. If set and the workstation configuration is not found, a new + # workstation configuration is created. In this situation, update_mask + # is ignored. + # + # @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/workstations/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Workstations::V1::Workstations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Workstations::V1::UpdateWorkstationRequest.new + # + # # Call the update_workstation method. + # result = client.update_workstation 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 update_workstation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workstations::V1::UpdateWorkstationRequest + + # Converts hash 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_workstation.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::Workstations::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.workstation&.name + header_params["workstation.name"] = request.workstation.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_workstation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_workstation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @workstations_stub.call_rpc :update_workstation, 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 the specified workstation. + # + # @overload delete_workstation(request, options = nil) + # Pass arguments to `delete_workstation` via a request object, either of type + # {::Google::Cloud::Workstations::V1::DeleteWorkstationRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Workstations::V1::DeleteWorkstationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_workstation(name: nil, validate_only: nil, etag: nil) + # Pass arguments to `delete_workstation` via keyword arguments. Note that at + # least one keyword argument is 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 workstation to delete. + # @param validate_only [::Boolean] + # Optional. If set, validate the request and preview the review, but do not + # actually apply it. + # @param etag [::String] + # Optional. If set, the request will be rejected if the latest version of the + # workstation on the server does not have this ETag. + # + # @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/workstations/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Workstations::V1::Workstations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Workstations::V1::DeleteWorkstationRequest.new + # + # # Call the delete_workstation method. + # result = client.delete_workstation 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_workstation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workstations::V1::DeleteWorkstationRequest + + # Converts hash 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_workstation.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::Workstations::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_workstation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_workstation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @workstations_stub.call_rpc :delete_workstation, 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 + + ## + # Starts running a workstation so that users can connect to it. + # + # @overload start_workstation(request, options = nil) + # Pass arguments to `start_workstation` via a request object, either of type + # {::Google::Cloud::Workstations::V1::StartWorkstationRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Workstations::V1::StartWorkstationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload start_workstation(name: nil, validate_only: nil, etag: nil) + # Pass arguments to `start_workstation` via keyword arguments. Note that at + # least one keyword argument is 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 workstation to start. + # @param validate_only [::Boolean] + # Optional. If set, validate the request and preview the review, but do not + # actually apply it. + # @param etag [::String] + # Optional. If set, the request will be rejected if the latest version of the + # workstation on the server does not have this ETag. + # + # @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/workstations/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Workstations::V1::Workstations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Workstations::V1::StartWorkstationRequest.new + # + # # Call the start_workstation method. + # result = client.start_workstation 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 start_workstation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workstations::V1::StartWorkstationRequest + + # Converts hash 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.start_workstation.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::Workstations::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.start_workstation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.start_workstation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @workstations_stub.call_rpc :start_workstation, 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 + + ## + # Stops running a workstation, reducing costs. + # + # @overload stop_workstation(request, options = nil) + # Pass arguments to `stop_workstation` via a request object, either of type + # {::Google::Cloud::Workstations::V1::StopWorkstationRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Workstations::V1::StopWorkstationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload stop_workstation(name: nil, validate_only: nil, etag: nil) + # Pass arguments to `stop_workstation` via keyword arguments. Note that at + # least one keyword argument is 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 workstation to stop. + # @param validate_only [::Boolean] + # Optional. If set, validate the request and preview the review, but do not + # actually apply it. + # @param etag [::String] + # Optional. If set, the request will be rejected if the latest version of the + # workstation on the server does not have this ETag. + # + # @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/workstations/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Workstations::V1::Workstations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Workstations::V1::StopWorkstationRequest.new + # + # # Call the stop_workstation method. + # result = client.stop_workstation 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 stop_workstation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workstations::V1::StopWorkstationRequest + + # Converts hash 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.stop_workstation.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::Workstations::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.stop_workstation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.stop_workstation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @workstations_stub.call_rpc :stop_workstation, 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 a short-lived credential that can be used to send authenticated and + # authorized traffic to a workstation. + # + # @overload generate_access_token(request, options = nil) + # Pass arguments to `generate_access_token` via a request object, either of type + # {::Google::Cloud::Workstations::V1::GenerateAccessTokenRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Workstations::V1::GenerateAccessTokenRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_access_token(expire_time: nil, ttl: nil, workstation: nil) + # Pass arguments to `generate_access_token` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param expire_time [::Google::Protobuf::Timestamp, ::Hash] + # Desired expiration time of the access token. This value must + # be at most 24 hours in the future. If a value is not specified, the + # token's expiration time will be set to a default value of 1 hour in the + # future. + # + # Note: The following parameters are mutually exclusive: `expire_time`, `ttl`. 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 ttl [::Google::Protobuf::Duration, ::Hash] + # Desired lifetime duration of the access token. This value must + # be at most 24 hours. If a value is not specified, the token's lifetime + # will be set to a default value of 1 hour. + # + # Note: The following parameters are mutually exclusive: `ttl`, `expire_time`. 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 workstation [::String] + # Required. Name of the workstation for which the access token should be + # generated. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Workstations::V1::GenerateAccessTokenResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Workstations::V1::GenerateAccessTokenResponse] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/workstations/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Workstations::V1::Workstations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Workstations::V1::GenerateAccessTokenRequest.new + # + # # Call the generate_access_token method. + # result = client.generate_access_token request + # + # # The returned object is of type Google::Cloud::Workstations::V1::GenerateAccessTokenResponse. + # p result + # + def generate_access_token request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workstations::V1::GenerateAccessTokenRequest + + # Converts hash 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_access_token.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::Workstations::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.workstation + header_params["workstation"] = request.workstation + 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_access_token.timeout, + metadata: metadata, + retry_policy: @config.rpcs.generate_access_token.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @workstations_stub.call_rpc :generate_access_token, 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 Workstations API. + # + # This class represents the configuration for Workstations, + # 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::Workstations::V1::Workstations::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 + # # get_workstation_cluster to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Workstations::V1::Workstations::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.get_workstation_cluster.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Workstations::V1::Workstations::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.get_workstation_cluster.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::Workstations::V1::Workstations::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 = "workstations.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 Workstations 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 `get_workstation_cluster` + # @return [::Gapic::Config::Method] + # + attr_reader :get_workstation_cluster + ## + # RPC-specific configuration for `list_workstation_clusters` + # @return [::Gapic::Config::Method] + # + attr_reader :list_workstation_clusters + ## + # RPC-specific configuration for `create_workstation_cluster` + # @return [::Gapic::Config::Method] + # + attr_reader :create_workstation_cluster + ## + # RPC-specific configuration for `update_workstation_cluster` + # @return [::Gapic::Config::Method] + # + attr_reader :update_workstation_cluster + ## + # RPC-specific configuration for `delete_workstation_cluster` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_workstation_cluster + ## + # RPC-specific configuration for `get_workstation_config` + # @return [::Gapic::Config::Method] + # + attr_reader :get_workstation_config + ## + # RPC-specific configuration for `list_workstation_configs` + # @return [::Gapic::Config::Method] + # + attr_reader :list_workstation_configs + ## + # RPC-specific configuration for `list_usable_workstation_configs` + # @return [::Gapic::Config::Method] + # + attr_reader :list_usable_workstation_configs + ## + # RPC-specific configuration for `create_workstation_config` + # @return [::Gapic::Config::Method] + # + attr_reader :create_workstation_config + ## + # RPC-specific configuration for `update_workstation_config` + # @return [::Gapic::Config::Method] + # + attr_reader :update_workstation_config + ## + # RPC-specific configuration for `delete_workstation_config` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_workstation_config + ## + # RPC-specific configuration for `get_workstation` + # @return [::Gapic::Config::Method] + # + attr_reader :get_workstation + ## + # RPC-specific configuration for `list_workstations` + # @return [::Gapic::Config::Method] + # + attr_reader :list_workstations + ## + # RPC-specific configuration for `list_usable_workstations` + # @return [::Gapic::Config::Method] + # + attr_reader :list_usable_workstations + ## + # RPC-specific configuration for `create_workstation` + # @return [::Gapic::Config::Method] + # + attr_reader :create_workstation + ## + # RPC-specific configuration for `update_workstation` + # @return [::Gapic::Config::Method] + # + attr_reader :update_workstation + ## + # RPC-specific configuration for `delete_workstation` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_workstation + ## + # RPC-specific configuration for `start_workstation` + # @return [::Gapic::Config::Method] + # + attr_reader :start_workstation + ## + # RPC-specific configuration for `stop_workstation` + # @return [::Gapic::Config::Method] + # + attr_reader :stop_workstation + ## + # RPC-specific configuration for `generate_access_token` + # @return [::Gapic::Config::Method] + # + attr_reader :generate_access_token + + # @private + def initialize parent_rpcs = nil + get_workstation_cluster_config = parent_rpcs.get_workstation_cluster if parent_rpcs.respond_to? :get_workstation_cluster + @get_workstation_cluster = ::Gapic::Config::Method.new get_workstation_cluster_config + list_workstation_clusters_config = parent_rpcs.list_workstation_clusters if parent_rpcs.respond_to? :list_workstation_clusters + @list_workstation_clusters = ::Gapic::Config::Method.new list_workstation_clusters_config + create_workstation_cluster_config = parent_rpcs.create_workstation_cluster if parent_rpcs.respond_to? :create_workstation_cluster + @create_workstation_cluster = ::Gapic::Config::Method.new create_workstation_cluster_config + update_workstation_cluster_config = parent_rpcs.update_workstation_cluster if parent_rpcs.respond_to? :update_workstation_cluster + @update_workstation_cluster = ::Gapic::Config::Method.new update_workstation_cluster_config + delete_workstation_cluster_config = parent_rpcs.delete_workstation_cluster if parent_rpcs.respond_to? :delete_workstation_cluster + @delete_workstation_cluster = ::Gapic::Config::Method.new delete_workstation_cluster_config + get_workstation_config_config = parent_rpcs.get_workstation_config if parent_rpcs.respond_to? :get_workstation_config + @get_workstation_config = ::Gapic::Config::Method.new get_workstation_config_config + list_workstation_configs_config = parent_rpcs.list_workstation_configs if parent_rpcs.respond_to? :list_workstation_configs + @list_workstation_configs = ::Gapic::Config::Method.new list_workstation_configs_config + list_usable_workstation_configs_config = parent_rpcs.list_usable_workstation_configs if parent_rpcs.respond_to? :list_usable_workstation_configs + @list_usable_workstation_configs = ::Gapic::Config::Method.new list_usable_workstation_configs_config + create_workstation_config_config = parent_rpcs.create_workstation_config if parent_rpcs.respond_to? :create_workstation_config + @create_workstation_config = ::Gapic::Config::Method.new create_workstation_config_config + update_workstation_config_config = parent_rpcs.update_workstation_config if parent_rpcs.respond_to? :update_workstation_config + @update_workstation_config = ::Gapic::Config::Method.new update_workstation_config_config + delete_workstation_config_config = parent_rpcs.delete_workstation_config if parent_rpcs.respond_to? :delete_workstation_config + @delete_workstation_config = ::Gapic::Config::Method.new delete_workstation_config_config + get_workstation_config = parent_rpcs.get_workstation if parent_rpcs.respond_to? :get_workstation + @get_workstation = ::Gapic::Config::Method.new get_workstation_config + list_workstations_config = parent_rpcs.list_workstations if parent_rpcs.respond_to? :list_workstations + @list_workstations = ::Gapic::Config::Method.new list_workstations_config + list_usable_workstations_config = parent_rpcs.list_usable_workstations if parent_rpcs.respond_to? :list_usable_workstations + @list_usable_workstations = ::Gapic::Config::Method.new list_usable_workstations_config + create_workstation_config = parent_rpcs.create_workstation if parent_rpcs.respond_to? :create_workstation + @create_workstation = ::Gapic::Config::Method.new create_workstation_config + update_workstation_config = parent_rpcs.update_workstation if parent_rpcs.respond_to? :update_workstation + @update_workstation = ::Gapic::Config::Method.new update_workstation_config + delete_workstation_config = parent_rpcs.delete_workstation if parent_rpcs.respond_to? :delete_workstation + @delete_workstation = ::Gapic::Config::Method.new delete_workstation_config + start_workstation_config = parent_rpcs.start_workstation if parent_rpcs.respond_to? :start_workstation + @start_workstation = ::Gapic::Config::Method.new start_workstation_config + stop_workstation_config = parent_rpcs.stop_workstation if parent_rpcs.respond_to? :stop_workstation + @stop_workstation = ::Gapic::Config::Method.new stop_workstation_config + generate_access_token_config = parent_rpcs.generate_access_token if parent_rpcs.respond_to? :generate_access_token + @generate_access_token = ::Gapic::Config::Method.new generate_access_token_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-workstations-v1/lib/google/cloud/workstations/v1/workstations/credentials.rb b/owl-bot-staging/google-cloud-workstations-v1/lib/google/cloud/workstations/v1/workstations/credentials.rb new file mode 100644 index 000000000000..dfd9bd39ea0a --- /dev/null +++ b/owl-bot-staging/google-cloud-workstations-v1/lib/google/cloud/workstations/v1/workstations/credentials.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! + +require "googleauth" + +module Google + module Cloud + module Workstations + module V1 + module Workstations + # Credentials for the Workstations API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/cloud-platform" + ] + self.env_vars = [ + "GOOGLE_CLOUD_CREDENTIALS", + "GOOGLE_CLOUD_KEYFILE", + "GCLOUD_KEYFILE", + "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-workstations-v1/lib/google/cloud/workstations/v1/workstations/operations.rb b/owl-bot-staging/google-cloud-workstations-v1/lib/google/cloud/workstations/v1/workstations/operations.rb new file mode 100644 index 000000000000..667b9e605bce --- /dev/null +++ b/owl-bot-staging/google-cloud-workstations-v1/lib/google/cloud/workstations/v1/workstations/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 Workstations + module V1 + module Workstations + # Service that implements Longrunning Operations API. + class Operations + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "workstations.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :operations_stub + + ## + # Configuration for the Workstations 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 Workstations 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::Workstations::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::Workstations::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::Workstations::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::Workstations::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::Workstations::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 = "workstations.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-workstations-v1/lib/google/cloud/workstations/v1/workstations/paths.rb b/owl-bot-staging/google-cloud-workstations-v1/lib/google/cloud/workstations/v1/workstations/paths.rb new file mode 100644 index 000000000000..464e72c7f12e --- /dev/null +++ b/owl-bot-staging/google-cloud-workstations-v1/lib/google/cloud/workstations/v1/workstations/paths.rb @@ -0,0 +1,113 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Workstations + module V1 + module Workstations + # Path helper methods for the Workstations 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 Workstation resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/workstationClusters/{workstation_cluster}/workstationConfigs/{workstation_config}/workstations/{workstation}` + # + # @param project [String] + # @param location [String] + # @param workstation_cluster [String] + # @param workstation_config [String] + # @param workstation [String] + # + # @return [::String] + def workstation_path project:, location:, workstation_cluster:, workstation_config:, workstation: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "workstation_cluster cannot contain /" if workstation_cluster.to_s.include? "/" + raise ::ArgumentError, "workstation_config cannot contain /" if workstation_config.to_s.include? "/" + + "projects/#{project}/locations/#{location}/workstationClusters/#{workstation_cluster}/workstationConfigs/#{workstation_config}/workstations/#{workstation}" + end + + ## + # Create a fully-qualified WorkstationCluster resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/workstationClusters/{workstation_cluster}` + # + # @param project [String] + # @param location [String] + # @param workstation_cluster [String] + # + # @return [::String] + def workstation_cluster_path project:, location:, workstation_cluster: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/workstationClusters/#{workstation_cluster}" + end + + ## + # Create a fully-qualified WorkstationConfig resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/workstationClusters/{workstation_cluster}/workstationConfigs/{workstation_config}` + # + # @param project [String] + # @param location [String] + # @param workstation_cluster [String] + # @param workstation_config [String] + # + # @return [::String] + def workstation_config_path project:, location:, workstation_cluster:, workstation_config: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "workstation_cluster cannot contain /" if workstation_cluster.to_s.include? "/" + + "projects/#{project}/locations/#{location}/workstationClusters/#{workstation_cluster}/workstationConfigs/#{workstation_config}" + end + + extend self + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-workstations-v1/lib/google/cloud/workstations/v1/workstations/rest.rb b/owl-bot-staging/google-cloud-workstations-v1/lib/google/cloud/workstations/v1/workstations/rest.rb new file mode 100644 index 000000000000..ba4f83cc6e0c --- /dev/null +++ b/owl-bot-staging/google-cloud-workstations-v1/lib/google/cloud/workstations/v1/workstations/rest.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! + +require "gapic/rest" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/workstations/v1/version" +require "google/cloud/workstations/v1/bindings_override" + +require "google/cloud/workstations/v1/workstations/credentials" +require "google/cloud/workstations/v1/workstations/paths" +require "google/cloud/workstations/v1/workstations/rest/operations" +require "google/cloud/workstations/v1/workstations/rest/client" + +module Google + module Cloud + module Workstations + module V1 + ## + # Service for interacting with Cloud Workstations. + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/workstations/v1/workstations/rest" + # client = ::Google::Cloud::Workstations::V1::Workstations::Rest::Client.new + # + module Workstations + # Client for the REST transport + module Rest + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "rest", "helpers.rb" +require "google/cloud/workstations/v1/workstations/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-workstations-v1/lib/google/cloud/workstations/v1/workstations/rest/client.rb b/owl-bot-staging/google-cloud-workstations-v1/lib/google/cloud/workstations/v1/workstations/rest/client.rb new file mode 100644 index 000000000000..fe30c7b2e4fe --- /dev/null +++ b/owl-bot-staging/google-cloud-workstations-v1/lib/google/cloud/workstations/v1/workstations/rest/client.rb @@ -0,0 +1,2420 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/workstations/v1/workstations_pb" +require "google/cloud/workstations/v1/workstations/rest/service_stub" +require "google/cloud/location/rest" +require "google/iam/v1/rest" + +module Google + module Cloud + module Workstations + module V1 + module Workstations + module Rest + ## + # REST client for the Workstations service. + # + # Service for interacting with Cloud Workstations. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "workstations.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :workstations_stub + + ## + # Configure the Workstations Client class. + # + # See {::Google::Cloud::Workstations::V1::Workstations::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all Workstations clients + # ::Google::Cloud::Workstations::V1::Workstations::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", "Workstations", "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.get_workstation_cluster.timeout = 60.0 + default_config.rpcs.get_workstation_cluster.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.list_workstation_clusters.timeout = 60.0 + default_config.rpcs.list_workstation_clusters.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.create_workstation_cluster.timeout = 60.0 + + default_config.rpcs.update_workstation_cluster.timeout = 60.0 + + default_config.rpcs.delete_workstation_cluster.timeout = 60.0 + + default_config.rpcs.get_workstation_config.timeout = 60.0 + default_config.rpcs.get_workstation_config.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.list_workstation_configs.timeout = 60.0 + default_config.rpcs.list_workstation_configs.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.list_usable_workstation_configs.timeout = 60.0 + default_config.rpcs.list_usable_workstation_configs.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.create_workstation_config.timeout = 60.0 + + default_config.rpcs.update_workstation_config.timeout = 60.0 + + default_config.rpcs.delete_workstation_config.timeout = 60.0 + + default_config.rpcs.get_workstation.timeout = 60.0 + default_config.rpcs.get_workstation.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.list_workstations.timeout = 60.0 + default_config.rpcs.list_workstations.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.list_usable_workstations.timeout = 60.0 + default_config.rpcs.list_usable_workstations.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.create_workstation.timeout = 60.0 + + default_config.rpcs.update_workstation.timeout = 60.0 + + default_config.rpcs.delete_workstation.timeout = 60.0 + + default_config.rpcs.start_workstation.timeout = 60.0 + + default_config.rpcs.stop_workstation.timeout = 60.0 + + default_config.rpcs.generate_access_token.timeout = 60.0 + default_config.rpcs.generate_access_token.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the Workstations 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::Workstations::V1::Workstations::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 + @workstations_stub.universe_domain + end + + ## + # Create a new Workstations REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Workstations::V1::Workstations::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Workstations::V1::Workstations::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Workstations 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::Workstations::V1::Workstations::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 + + @workstations_stub = ::Google::Cloud::Workstations::V1::Workstations::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials, + logger: @config.logger + ) + + @workstations_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 = @workstations_stub.endpoint + config.universe_domain = @workstations_stub.universe_domain + config.logger = @workstations_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 = @workstations_stub.endpoint + config.universe_domain = @workstations_stub.universe_domain + config.bindings_override = @config.bindings_override + config.logger = @workstations_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::Workstations::V1::Workstations::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 + @workstations_stub.logger + end + + # Service calls + + ## + # Returns the requested workstation cluster. + # + # @overload get_workstation_cluster(request, options = nil) + # Pass arguments to `get_workstation_cluster` via a request object, either of type + # {::Google::Cloud::Workstations::V1::GetWorkstationClusterRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Workstations::V1::GetWorkstationClusterRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_workstation_cluster(name: nil) + # Pass arguments to `get_workstation_cluster` via keyword arguments. Note that at + # least one keyword argument is 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 requested resource. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Workstations::V1::WorkstationCluster] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Workstations::V1::WorkstationCluster] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/workstations/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Workstations::V1::Workstations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Workstations::V1::GetWorkstationClusterRequest.new + # + # # Call the get_workstation_cluster method. + # result = client.get_workstation_cluster request + # + # # The returned object is of type Google::Cloud::Workstations::V1::WorkstationCluster. + # p result + # + def get_workstation_cluster request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workstations::V1::GetWorkstationClusterRequest + + # Converts hash 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_workstation_cluster.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::Workstations::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_workstation_cluster.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_workstation_cluster.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @workstations_stub.get_workstation_cluster 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 all workstation clusters in the specified location. + # + # @overload list_workstation_clusters(request, options = nil) + # Pass arguments to `list_workstation_clusters` via a request object, either of type + # {::Google::Cloud::Workstations::V1::ListWorkstationClustersRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Workstations::V1::ListWorkstationClustersRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_workstation_clusters(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_workstation_clusters` via keyword arguments. Note that at + # least one keyword argument is 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. Parent resource name. + # @param page_size [::Integer] + # Optional. Maximum number of items to return. + # @param page_token [::String] + # Optional. next_page_token value returned from a previous List request, if + # any. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Workstations::V1::WorkstationCluster>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Workstations::V1::WorkstationCluster>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/workstations/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Workstations::V1::Workstations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Workstations::V1::ListWorkstationClustersRequest.new + # + # # Call the list_workstation_clusters method. + # result = client.list_workstation_clusters 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::Workstations::V1::WorkstationCluster. + # p item + # end + # + def list_workstation_clusters request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workstations::V1::ListWorkstationClustersRequest + + # Converts hash 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_workstation_clusters.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::Workstations::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_workstation_clusters.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_workstation_clusters.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @workstations_stub.list_workstation_clusters request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @workstations_stub, :list_workstation_clusters, "workstation_clusters", 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 + + ## + # Creates a new workstation cluster. + # + # @overload create_workstation_cluster(request, options = nil) + # Pass arguments to `create_workstation_cluster` via a request object, either of type + # {::Google::Cloud::Workstations::V1::CreateWorkstationClusterRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Workstations::V1::CreateWorkstationClusterRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_workstation_cluster(parent: nil, workstation_cluster_id: nil, workstation_cluster: nil, validate_only: nil) + # Pass arguments to `create_workstation_cluster` via keyword arguments. Note that at + # least one keyword argument is 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. Parent resource name. + # @param workstation_cluster_id [::String] + # Required. ID to use for the workstation cluster. + # @param workstation_cluster [::Google::Cloud::Workstations::V1::WorkstationCluster, ::Hash] + # Required. Workstation cluster to create. + # @param validate_only [::Boolean] + # Optional. If set, validate the request and preview the review, but do not + # actually apply it. + # @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/workstations/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Workstations::V1::Workstations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Workstations::V1::CreateWorkstationClusterRequest.new + # + # # Call the create_workstation_cluster method. + # result = client.create_workstation_cluster 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_workstation_cluster request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workstations::V1::CreateWorkstationClusterRequest + + # Converts hash 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_workstation_cluster.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::Workstations::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_workstation_cluster.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_workstation_cluster.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @workstations_stub.create_workstation_cluster 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 + + ## + # Updates an existing workstation cluster. + # + # @overload update_workstation_cluster(request, options = nil) + # Pass arguments to `update_workstation_cluster` via a request object, either of type + # {::Google::Cloud::Workstations::V1::UpdateWorkstationClusterRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Workstations::V1::UpdateWorkstationClusterRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_workstation_cluster(workstation_cluster: nil, update_mask: nil, validate_only: nil, allow_missing: nil) + # Pass arguments to `update_workstation_cluster` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param workstation_cluster [::Google::Cloud::Workstations::V1::WorkstationCluster, ::Hash] + # Required. Workstation cluster to update. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. Mask that specifies which fields in the workstation cluster + # should be updated. + # @param validate_only [::Boolean] + # Optional. If set, validate the request and preview the review, but do not + # actually apply it. + # @param allow_missing [::Boolean] + # Optional. If set, and the workstation cluster is not found, a new + # workstation cluster will be created. In this situation, update_mask is + # ignored. + # @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/workstations/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Workstations::V1::Workstations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Workstations::V1::UpdateWorkstationClusterRequest.new + # + # # Call the update_workstation_cluster method. + # result = client.update_workstation_cluster 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 update_workstation_cluster request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workstations::V1::UpdateWorkstationClusterRequest + + # Converts hash 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_workstation_cluster.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::Workstations::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_workstation_cluster.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_workstation_cluster.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @workstations_stub.update_workstation_cluster 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 the specified workstation cluster. + # + # @overload delete_workstation_cluster(request, options = nil) + # Pass arguments to `delete_workstation_cluster` via a request object, either of type + # {::Google::Cloud::Workstations::V1::DeleteWorkstationClusterRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Workstations::V1::DeleteWorkstationClusterRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_workstation_cluster(name: nil, validate_only: nil, etag: nil, force: nil) + # Pass arguments to `delete_workstation_cluster` via keyword arguments. Note that at + # least one keyword argument is 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 workstation cluster to delete. + # @param validate_only [::Boolean] + # Optional. If set, validate the request and preview the review, but do not + # apply it. + # @param etag [::String] + # Optional. If set, the request will be rejected if the latest version of the + # workstation cluster on the server does not have this ETag. + # @param force [::Boolean] + # Optional. If set, any workstation configurations and workstations in the + # workstation cluster are also deleted. Otherwise, the request only + # works if the workstation cluster has no configurations or workstations. + # @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/workstations/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Workstations::V1::Workstations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Workstations::V1::DeleteWorkstationClusterRequest.new + # + # # Call the delete_workstation_cluster method. + # result = client.delete_workstation_cluster 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_workstation_cluster request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workstations::V1::DeleteWorkstationClusterRequest + + # Converts hash 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_workstation_cluster.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::Workstations::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_workstation_cluster.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_workstation_cluster.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @workstations_stub.delete_workstation_cluster 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 requested workstation configuration. + # + # @overload get_workstation_config(request, options = nil) + # Pass arguments to `get_workstation_config` via a request object, either of type + # {::Google::Cloud::Workstations::V1::GetWorkstationConfigRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Workstations::V1::GetWorkstationConfigRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_workstation_config(name: nil) + # Pass arguments to `get_workstation_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 requested resource. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Workstations::V1::WorkstationConfig] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Workstations::V1::WorkstationConfig] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/workstations/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Workstations::V1::Workstations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Workstations::V1::GetWorkstationConfigRequest.new + # + # # Call the get_workstation_config method. + # result = client.get_workstation_config request + # + # # The returned object is of type Google::Cloud::Workstations::V1::WorkstationConfig. + # p result + # + def get_workstation_config request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workstations::V1::GetWorkstationConfigRequest + + # Converts hash 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_workstation_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::Workstations::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_workstation_config.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_workstation_config.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @workstations_stub.get_workstation_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 all workstation configurations in the specified cluster. + # + # @overload list_workstation_configs(request, options = nil) + # Pass arguments to `list_workstation_configs` via a request object, either of type + # {::Google::Cloud::Workstations::V1::ListWorkstationConfigsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Workstations::V1::ListWorkstationConfigsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_workstation_configs(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_workstation_configs` via keyword arguments. Note that at + # least one keyword argument is 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. Parent resource name. + # @param page_size [::Integer] + # Optional. Maximum number of items to return. + # @param page_token [::String] + # Optional. next_page_token value returned from a previous List request, if + # any. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Workstations::V1::WorkstationConfig>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Workstations::V1::WorkstationConfig>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/workstations/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Workstations::V1::Workstations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Workstations::V1::ListWorkstationConfigsRequest.new + # + # # Call the list_workstation_configs method. + # result = client.list_workstation_configs 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::Workstations::V1::WorkstationConfig. + # p item + # end + # + def list_workstation_configs request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workstations::V1::ListWorkstationConfigsRequest + + # Converts hash 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_workstation_configs.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::Workstations::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_workstation_configs.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_workstation_configs.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @workstations_stub.list_workstation_configs request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @workstations_stub, :list_workstation_configs, "workstation_configs", 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 all workstation configurations in the specified cluster on which + # the caller has the "workstations.workstation.create" permission. + # + # @overload list_usable_workstation_configs(request, options = nil) + # Pass arguments to `list_usable_workstation_configs` via a request object, either of type + # {::Google::Cloud::Workstations::V1::ListUsableWorkstationConfigsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Workstations::V1::ListUsableWorkstationConfigsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_usable_workstation_configs(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_usable_workstation_configs` via keyword arguments. Note that at + # least one keyword argument is 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. Parent resource name. + # @param page_size [::Integer] + # Optional. Maximum number of items to return. + # @param page_token [::String] + # Optional. next_page_token value returned from a previous List request, if + # any. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Workstations::V1::WorkstationConfig>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Workstations::V1::WorkstationConfig>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/workstations/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Workstations::V1::Workstations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Workstations::V1::ListUsableWorkstationConfigsRequest.new + # + # # Call the list_usable_workstation_configs method. + # result = client.list_usable_workstation_configs 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::Workstations::V1::WorkstationConfig. + # p item + # end + # + def list_usable_workstation_configs request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workstations::V1::ListUsableWorkstationConfigsRequest + + # Converts hash 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_usable_workstation_configs.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::Workstations::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_usable_workstation_configs.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_usable_workstation_configs.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @workstations_stub.list_usable_workstation_configs request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @workstations_stub, :list_usable_workstation_configs, "workstation_configs", 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 + + ## + # Creates a new workstation configuration. + # + # @overload create_workstation_config(request, options = nil) + # Pass arguments to `create_workstation_config` via a request object, either of type + # {::Google::Cloud::Workstations::V1::CreateWorkstationConfigRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Workstations::V1::CreateWorkstationConfigRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_workstation_config(parent: nil, workstation_config_id: nil, workstation_config: nil, validate_only: nil) + # Pass arguments to `create_workstation_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. Parent resource name. + # @param workstation_config_id [::String] + # Required. ID to use for the workstation configuration. + # @param workstation_config [::Google::Cloud::Workstations::V1::WorkstationConfig, ::Hash] + # Required. Config to create. + # @param validate_only [::Boolean] + # Optional. If set, validate the request and preview the review, but do not + # actually apply it. + # @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/workstations/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Workstations::V1::Workstations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Workstations::V1::CreateWorkstationConfigRequest.new + # + # # Call the create_workstation_config method. + # result = client.create_workstation_config 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_workstation_config request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workstations::V1::CreateWorkstationConfigRequest + + # Converts hash 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_workstation_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::Workstations::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_workstation_config.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_workstation_config.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @workstations_stub.create_workstation_config 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 + + ## + # Updates an existing workstation configuration. + # + # @overload update_workstation_config(request, options = nil) + # Pass arguments to `update_workstation_config` via a request object, either of type + # {::Google::Cloud::Workstations::V1::UpdateWorkstationConfigRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Workstations::V1::UpdateWorkstationConfigRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_workstation_config(workstation_config: nil, update_mask: nil, validate_only: nil, allow_missing: nil) + # Pass arguments to `update_workstation_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 workstation_config [::Google::Cloud::Workstations::V1::WorkstationConfig, ::Hash] + # Required. Config to update. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. Mask specifying which fields in the workstation configuration + # should be updated. + # @param validate_only [::Boolean] + # Optional. If set, validate the request and preview the review, but do not + # actually apply it. + # @param allow_missing [::Boolean] + # Optional. If set and the workstation configuration is not found, a new + # workstation configuration will be created. In this situation, + # update_mask is ignored. + # @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/workstations/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Workstations::V1::Workstations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Workstations::V1::UpdateWorkstationConfigRequest.new + # + # # Call the update_workstation_config method. + # result = client.update_workstation_config 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 update_workstation_config request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workstations::V1::UpdateWorkstationConfigRequest + + # Converts hash 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_workstation_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::Workstations::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_workstation_config.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_workstation_config.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @workstations_stub.update_workstation_config 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 the specified workstation configuration. + # + # @overload delete_workstation_config(request, options = nil) + # Pass arguments to `delete_workstation_config` via a request object, either of type + # {::Google::Cloud::Workstations::V1::DeleteWorkstationConfigRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Workstations::V1::DeleteWorkstationConfigRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_workstation_config(name: nil, validate_only: nil, etag: nil, force: nil) + # Pass arguments to `delete_workstation_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 workstation configuration to delete. + # @param validate_only [::Boolean] + # Optional. If set, validate the request and preview the review, but do not + # actually apply it. + # @param etag [::String] + # Optional. If set, the request is rejected if the latest version of the + # workstation configuration on the server does not have this ETag. + # @param force [::Boolean] + # Optional. If set, any workstations in the workstation configuration are + # also deleted. Otherwise, the request works only if the workstation + # configuration has no workstations. + # @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/workstations/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Workstations::V1::Workstations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Workstations::V1::DeleteWorkstationConfigRequest.new + # + # # Call the delete_workstation_config method. + # result = client.delete_workstation_config 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_workstation_config request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workstations::V1::DeleteWorkstationConfigRequest + + # Converts hash 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_workstation_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::Workstations::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_workstation_config.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_workstation_config.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @workstations_stub.delete_workstation_config 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 requested workstation. + # + # @overload get_workstation(request, options = nil) + # Pass arguments to `get_workstation` via a request object, either of type + # {::Google::Cloud::Workstations::V1::GetWorkstationRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Workstations::V1::GetWorkstationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_workstation(name: nil) + # Pass arguments to `get_workstation` via keyword arguments. Note that at + # least one keyword argument is 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 requested resource. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Workstations::V1::Workstation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Workstations::V1::Workstation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/workstations/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Workstations::V1::Workstations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Workstations::V1::GetWorkstationRequest.new + # + # # Call the get_workstation method. + # result = client.get_workstation request + # + # # The returned object is of type Google::Cloud::Workstations::V1::Workstation. + # p result + # + def get_workstation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workstations::V1::GetWorkstationRequest + + # Converts hash 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_workstation.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::Workstations::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_workstation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_workstation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @workstations_stub.get_workstation 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 all Workstations using the specified workstation configuration. + # + # @overload list_workstations(request, options = nil) + # Pass arguments to `list_workstations` via a request object, either of type + # {::Google::Cloud::Workstations::V1::ListWorkstationsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Workstations::V1::ListWorkstationsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_workstations(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_workstations` via keyword arguments. Note that at + # least one keyword argument is 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. Parent resource name. + # @param page_size [::Integer] + # Optional. Maximum number of items to return. + # @param page_token [::String] + # Optional. next_page_token value returned from a previous List request, if + # any. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Workstations::V1::Workstation>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Workstations::V1::Workstation>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/workstations/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Workstations::V1::Workstations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Workstations::V1::ListWorkstationsRequest.new + # + # # Call the list_workstations method. + # result = client.list_workstations 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::Workstations::V1::Workstation. + # p item + # end + # + def list_workstations request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workstations::V1::ListWorkstationsRequest + + # Converts hash 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_workstations.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::Workstations::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_workstations.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_workstations.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @workstations_stub.list_workstations request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @workstations_stub, :list_workstations, "workstations", 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 all workstations using the specified workstation configuration + # on which the caller has the "workstations.workstations.use" permission. + # + # @overload list_usable_workstations(request, options = nil) + # Pass arguments to `list_usable_workstations` via a request object, either of type + # {::Google::Cloud::Workstations::V1::ListUsableWorkstationsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Workstations::V1::ListUsableWorkstationsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_usable_workstations(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_usable_workstations` via keyword arguments. Note that at + # least one keyword argument is 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. Parent resource name. + # @param page_size [::Integer] + # Optional. Maximum number of items to return. + # @param page_token [::String] + # Optional. next_page_token value returned from a previous List request, if + # any. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Workstations::V1::Workstation>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Workstations::V1::Workstation>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/workstations/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Workstations::V1::Workstations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Workstations::V1::ListUsableWorkstationsRequest.new + # + # # Call the list_usable_workstations method. + # result = client.list_usable_workstations 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::Workstations::V1::Workstation. + # p item + # end + # + def list_usable_workstations request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workstations::V1::ListUsableWorkstationsRequest + + # Converts hash 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_usable_workstations.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::Workstations::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_usable_workstations.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_usable_workstations.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @workstations_stub.list_usable_workstations request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @workstations_stub, :list_usable_workstations, "workstations", 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 + + ## + # Creates a new workstation. + # + # @overload create_workstation(request, options = nil) + # Pass arguments to `create_workstation` via a request object, either of type + # {::Google::Cloud::Workstations::V1::CreateWorkstationRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Workstations::V1::CreateWorkstationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_workstation(parent: nil, workstation_id: nil, workstation: nil, validate_only: nil) + # Pass arguments to `create_workstation` via keyword arguments. Note that at + # least one keyword argument is 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. Parent resource name. + # @param workstation_id [::String] + # Required. ID to use for the workstation. + # @param workstation [::Google::Cloud::Workstations::V1::Workstation, ::Hash] + # Required. Workstation to create. + # @param validate_only [::Boolean] + # Optional. If set, validate the request and preview the review, but do not + # actually apply it. + # @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/workstations/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Workstations::V1::Workstations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Workstations::V1::CreateWorkstationRequest.new + # + # # Call the create_workstation method. + # result = client.create_workstation 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_workstation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workstations::V1::CreateWorkstationRequest + + # Converts hash 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_workstation.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::Workstations::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_workstation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_workstation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @workstations_stub.create_workstation 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 + + ## + # Updates an existing workstation. + # + # @overload update_workstation(request, options = nil) + # Pass arguments to `update_workstation` via a request object, either of type + # {::Google::Cloud::Workstations::V1::UpdateWorkstationRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Workstations::V1::UpdateWorkstationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_workstation(workstation: nil, update_mask: nil, validate_only: nil, allow_missing: nil) + # Pass arguments to `update_workstation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param workstation [::Google::Cloud::Workstations::V1::Workstation, ::Hash] + # Required. Workstation to update. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. Mask specifying which fields in the workstation configuration + # should be updated. + # @param validate_only [::Boolean] + # Optional. If set, validate the request and preview the review, but do not + # actually apply it. + # @param allow_missing [::Boolean] + # Optional. If set and the workstation configuration is not found, a new + # workstation configuration is created. In this situation, update_mask + # is ignored. + # @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/workstations/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Workstations::V1::Workstations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Workstations::V1::UpdateWorkstationRequest.new + # + # # Call the update_workstation method. + # result = client.update_workstation 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 update_workstation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workstations::V1::UpdateWorkstationRequest + + # Converts hash 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_workstation.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::Workstations::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_workstation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_workstation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @workstations_stub.update_workstation 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 the specified workstation. + # + # @overload delete_workstation(request, options = nil) + # Pass arguments to `delete_workstation` via a request object, either of type + # {::Google::Cloud::Workstations::V1::DeleteWorkstationRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Workstations::V1::DeleteWorkstationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_workstation(name: nil, validate_only: nil, etag: nil) + # Pass arguments to `delete_workstation` via keyword arguments. Note that at + # least one keyword argument is 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 workstation to delete. + # @param validate_only [::Boolean] + # Optional. If set, validate the request and preview the review, but do not + # actually apply it. + # @param etag [::String] + # Optional. If set, the request will be rejected if the latest version of the + # workstation on the server does not have this ETag. + # @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/workstations/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Workstations::V1::Workstations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Workstations::V1::DeleteWorkstationRequest.new + # + # # Call the delete_workstation method. + # result = client.delete_workstation 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_workstation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workstations::V1::DeleteWorkstationRequest + + # Converts hash 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_workstation.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::Workstations::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_workstation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_workstation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @workstations_stub.delete_workstation 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 + + ## + # Starts running a workstation so that users can connect to it. + # + # @overload start_workstation(request, options = nil) + # Pass arguments to `start_workstation` via a request object, either of type + # {::Google::Cloud::Workstations::V1::StartWorkstationRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Workstations::V1::StartWorkstationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload start_workstation(name: nil, validate_only: nil, etag: nil) + # Pass arguments to `start_workstation` via keyword arguments. Note that at + # least one keyword argument is 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 workstation to start. + # @param validate_only [::Boolean] + # Optional. If set, validate the request and preview the review, but do not + # actually apply it. + # @param etag [::String] + # Optional. If set, the request will be rejected if the latest version of the + # workstation on the server does not have this ETag. + # @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/workstations/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Workstations::V1::Workstations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Workstations::V1::StartWorkstationRequest.new + # + # # Call the start_workstation method. + # result = client.start_workstation 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 start_workstation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workstations::V1::StartWorkstationRequest + + # Converts hash 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.start_workstation.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::Workstations::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.start_workstation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.start_workstation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @workstations_stub.start_workstation 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 + + ## + # Stops running a workstation, reducing costs. + # + # @overload stop_workstation(request, options = nil) + # Pass arguments to `stop_workstation` via a request object, either of type + # {::Google::Cloud::Workstations::V1::StopWorkstationRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Workstations::V1::StopWorkstationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload stop_workstation(name: nil, validate_only: nil, etag: nil) + # Pass arguments to `stop_workstation` via keyword arguments. Note that at + # least one keyword argument is 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 workstation to stop. + # @param validate_only [::Boolean] + # Optional. If set, validate the request and preview the review, but do not + # actually apply it. + # @param etag [::String] + # Optional. If set, the request will be rejected if the latest version of the + # workstation on the server does not have this ETag. + # @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/workstations/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Workstations::V1::Workstations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Workstations::V1::StopWorkstationRequest.new + # + # # Call the stop_workstation method. + # result = client.stop_workstation 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 stop_workstation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workstations::V1::StopWorkstationRequest + + # Converts hash 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.stop_workstation.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::Workstations::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.stop_workstation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.stop_workstation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @workstations_stub.stop_workstation 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 a short-lived credential that can be used to send authenticated and + # authorized traffic to a workstation. + # + # @overload generate_access_token(request, options = nil) + # Pass arguments to `generate_access_token` via a request object, either of type + # {::Google::Cloud::Workstations::V1::GenerateAccessTokenRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Workstations::V1::GenerateAccessTokenRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_access_token(expire_time: nil, ttl: nil, workstation: nil) + # Pass arguments to `generate_access_token` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param expire_time [::Google::Protobuf::Timestamp, ::Hash] + # Desired expiration time of the access token. This value must + # be at most 24 hours in the future. If a value is not specified, the + # token's expiration time will be set to a default value of 1 hour in the + # future. + # + # Note: The following parameters are mutually exclusive: `expire_time`, `ttl`. 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 ttl [::Google::Protobuf::Duration, ::Hash] + # Desired lifetime duration of the access token. This value must + # be at most 24 hours. If a value is not specified, the token's lifetime + # will be set to a default value of 1 hour. + # + # Note: The following parameters are mutually exclusive: `ttl`, `expire_time`. 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 workstation [::String] + # Required. Name of the workstation for which the access token should be + # generated. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Workstations::V1::GenerateAccessTokenResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Workstations::V1::GenerateAccessTokenResponse] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/workstations/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Workstations::V1::Workstations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Workstations::V1::GenerateAccessTokenRequest.new + # + # # Call the generate_access_token method. + # result = client.generate_access_token request + # + # # The returned object is of type Google::Cloud::Workstations::V1::GenerateAccessTokenResponse. + # p result + # + def generate_access_token request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workstations::V1::GenerateAccessTokenRequest + + # Converts hash 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_access_token.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::Workstations::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_access_token.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.generate_access_token.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @workstations_stub.generate_access_token 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 Workstations REST API. + # + # This class represents the configuration for Workstations 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::Workstations::V1::Workstations::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 + # # get_workstation_cluster to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Workstations::V1::Workstations::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.get_workstation_cluster.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Workstations::V1::Workstations::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.get_workstation_cluster.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 = "workstations.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 Workstations 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 `get_workstation_cluster` + # @return [::Gapic::Config::Method] + # + attr_reader :get_workstation_cluster + ## + # RPC-specific configuration for `list_workstation_clusters` + # @return [::Gapic::Config::Method] + # + attr_reader :list_workstation_clusters + ## + # RPC-specific configuration for `create_workstation_cluster` + # @return [::Gapic::Config::Method] + # + attr_reader :create_workstation_cluster + ## + # RPC-specific configuration for `update_workstation_cluster` + # @return [::Gapic::Config::Method] + # + attr_reader :update_workstation_cluster + ## + # RPC-specific configuration for `delete_workstation_cluster` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_workstation_cluster + ## + # RPC-specific configuration for `get_workstation_config` + # @return [::Gapic::Config::Method] + # + attr_reader :get_workstation_config + ## + # RPC-specific configuration for `list_workstation_configs` + # @return [::Gapic::Config::Method] + # + attr_reader :list_workstation_configs + ## + # RPC-specific configuration for `list_usable_workstation_configs` + # @return [::Gapic::Config::Method] + # + attr_reader :list_usable_workstation_configs + ## + # RPC-specific configuration for `create_workstation_config` + # @return [::Gapic::Config::Method] + # + attr_reader :create_workstation_config + ## + # RPC-specific configuration for `update_workstation_config` + # @return [::Gapic::Config::Method] + # + attr_reader :update_workstation_config + ## + # RPC-specific configuration for `delete_workstation_config` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_workstation_config + ## + # RPC-specific configuration for `get_workstation` + # @return [::Gapic::Config::Method] + # + attr_reader :get_workstation + ## + # RPC-specific configuration for `list_workstations` + # @return [::Gapic::Config::Method] + # + attr_reader :list_workstations + ## + # RPC-specific configuration for `list_usable_workstations` + # @return [::Gapic::Config::Method] + # + attr_reader :list_usable_workstations + ## + # RPC-specific configuration for `create_workstation` + # @return [::Gapic::Config::Method] + # + attr_reader :create_workstation + ## + # RPC-specific configuration for `update_workstation` + # @return [::Gapic::Config::Method] + # + attr_reader :update_workstation + ## + # RPC-specific configuration for `delete_workstation` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_workstation + ## + # RPC-specific configuration for `start_workstation` + # @return [::Gapic::Config::Method] + # + attr_reader :start_workstation + ## + # RPC-specific configuration for `stop_workstation` + # @return [::Gapic::Config::Method] + # + attr_reader :stop_workstation + ## + # RPC-specific configuration for `generate_access_token` + # @return [::Gapic::Config::Method] + # + attr_reader :generate_access_token + + # @private + def initialize parent_rpcs = nil + get_workstation_cluster_config = parent_rpcs.get_workstation_cluster if parent_rpcs.respond_to? :get_workstation_cluster + @get_workstation_cluster = ::Gapic::Config::Method.new get_workstation_cluster_config + list_workstation_clusters_config = parent_rpcs.list_workstation_clusters if parent_rpcs.respond_to? :list_workstation_clusters + @list_workstation_clusters = ::Gapic::Config::Method.new list_workstation_clusters_config + create_workstation_cluster_config = parent_rpcs.create_workstation_cluster if parent_rpcs.respond_to? :create_workstation_cluster + @create_workstation_cluster = ::Gapic::Config::Method.new create_workstation_cluster_config + update_workstation_cluster_config = parent_rpcs.update_workstation_cluster if parent_rpcs.respond_to? :update_workstation_cluster + @update_workstation_cluster = ::Gapic::Config::Method.new update_workstation_cluster_config + delete_workstation_cluster_config = parent_rpcs.delete_workstation_cluster if parent_rpcs.respond_to? :delete_workstation_cluster + @delete_workstation_cluster = ::Gapic::Config::Method.new delete_workstation_cluster_config + get_workstation_config_config = parent_rpcs.get_workstation_config if parent_rpcs.respond_to? :get_workstation_config + @get_workstation_config = ::Gapic::Config::Method.new get_workstation_config_config + list_workstation_configs_config = parent_rpcs.list_workstation_configs if parent_rpcs.respond_to? :list_workstation_configs + @list_workstation_configs = ::Gapic::Config::Method.new list_workstation_configs_config + list_usable_workstation_configs_config = parent_rpcs.list_usable_workstation_configs if parent_rpcs.respond_to? :list_usable_workstation_configs + @list_usable_workstation_configs = ::Gapic::Config::Method.new list_usable_workstation_configs_config + create_workstation_config_config = parent_rpcs.create_workstation_config if parent_rpcs.respond_to? :create_workstation_config + @create_workstation_config = ::Gapic::Config::Method.new create_workstation_config_config + update_workstation_config_config = parent_rpcs.update_workstation_config if parent_rpcs.respond_to? :update_workstation_config + @update_workstation_config = ::Gapic::Config::Method.new update_workstation_config_config + delete_workstation_config_config = parent_rpcs.delete_workstation_config if parent_rpcs.respond_to? :delete_workstation_config + @delete_workstation_config = ::Gapic::Config::Method.new delete_workstation_config_config + get_workstation_config = parent_rpcs.get_workstation if parent_rpcs.respond_to? :get_workstation + @get_workstation = ::Gapic::Config::Method.new get_workstation_config + list_workstations_config = parent_rpcs.list_workstations if parent_rpcs.respond_to? :list_workstations + @list_workstations = ::Gapic::Config::Method.new list_workstations_config + list_usable_workstations_config = parent_rpcs.list_usable_workstations if parent_rpcs.respond_to? :list_usable_workstations + @list_usable_workstations = ::Gapic::Config::Method.new list_usable_workstations_config + create_workstation_config = parent_rpcs.create_workstation if parent_rpcs.respond_to? :create_workstation + @create_workstation = ::Gapic::Config::Method.new create_workstation_config + update_workstation_config = parent_rpcs.update_workstation if parent_rpcs.respond_to? :update_workstation + @update_workstation = ::Gapic::Config::Method.new update_workstation_config + delete_workstation_config = parent_rpcs.delete_workstation if parent_rpcs.respond_to? :delete_workstation + @delete_workstation = ::Gapic::Config::Method.new delete_workstation_config + start_workstation_config = parent_rpcs.start_workstation if parent_rpcs.respond_to? :start_workstation + @start_workstation = ::Gapic::Config::Method.new start_workstation_config + stop_workstation_config = parent_rpcs.stop_workstation if parent_rpcs.respond_to? :stop_workstation + @stop_workstation = ::Gapic::Config::Method.new stop_workstation_config + generate_access_token_config = parent_rpcs.generate_access_token if parent_rpcs.respond_to? :generate_access_token + @generate_access_token = ::Gapic::Config::Method.new generate_access_token_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-workstations-v1/lib/google/cloud/workstations/v1/workstations/rest/operations.rb b/owl-bot-staging/google-cloud-workstations-v1/lib/google/cloud/workstations/v1/workstations/rest/operations.rb new file mode 100644 index 000000000000..5408543aa712 --- /dev/null +++ b/owl-bot-staging/google-cloud-workstations-v1/lib/google/cloud/workstations/v1/workstations/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 Workstations + module V1 + module Workstations + module Rest + # Service that implements Longrunning Operations API. + class Operations + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "workstations.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :operations_stub + + ## + # Configuration for the Workstations 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 Workstations 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::Workstations::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::Workstations::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::Workstations::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::Workstations::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 = "workstations.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}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/?$}, 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{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + 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{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-workstations-v1/lib/google/cloud/workstations/v1/workstations/rest/service_stub.rb b/owl-bot-staging/google-cloud-workstations-v1/lib/google/cloud/workstations/v1/workstations/rest/service_stub.rb new file mode 100644 index 000000000000..420e199f7069 --- /dev/null +++ b/owl-bot-staging/google-cloud-workstations-v1/lib/google/cloud/workstations/v1/workstations/rest/service_stub.rb @@ -0,0 +1,1310 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/workstations/v1/workstations_pb" + +module Google + module Cloud + module Workstations + module V1 + module Workstations + module Rest + ## + # REST service stub for the Workstations 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 get_workstation_cluster REST call + # + # @param request_pb [::Google::Cloud::Workstations::V1::GetWorkstationClusterRequest] + # 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::Workstations::V1::WorkstationCluster] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Workstations::V1::WorkstationCluster] + # A result object deserialized from the server's reply + def get_workstation_cluster request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_workstation_cluster_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_workstation_cluster", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Workstations::V1::WorkstationCluster.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_workstation_clusters REST call + # + # @param request_pb [::Google::Cloud::Workstations::V1::ListWorkstationClustersRequest] + # 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::Workstations::V1::ListWorkstationClustersResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Workstations::V1::ListWorkstationClustersResponse] + # A result object deserialized from the server's reply + def list_workstation_clusters request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_workstation_clusters_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_workstation_clusters", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Workstations::V1::ListWorkstationClustersResponse.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_workstation_cluster REST call + # + # @param request_pb [::Google::Cloud::Workstations::V1::CreateWorkstationClusterRequest] + # 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_workstation_cluster request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_workstation_cluster_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_workstation_cluster", + 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 update_workstation_cluster REST call + # + # @param request_pb [::Google::Cloud::Workstations::V1::UpdateWorkstationClusterRequest] + # 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 update_workstation_cluster request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_workstation_cluster_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_workstation_cluster", + 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_workstation_cluster REST call + # + # @param request_pb [::Google::Cloud::Workstations::V1::DeleteWorkstationClusterRequest] + # 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_workstation_cluster request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_workstation_cluster_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_workstation_cluster", + 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_workstation_config REST call + # + # @param request_pb [::Google::Cloud::Workstations::V1::GetWorkstationConfigRequest] + # 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::Workstations::V1::WorkstationConfig] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Workstations::V1::WorkstationConfig] + # A result object deserialized from the server's reply + def get_workstation_config request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_workstation_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_workstation_config", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Workstations::V1::WorkstationConfig.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_workstation_configs REST call + # + # @param request_pb [::Google::Cloud::Workstations::V1::ListWorkstationConfigsRequest] + # 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::Workstations::V1::ListWorkstationConfigsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Workstations::V1::ListWorkstationConfigsResponse] + # A result object deserialized from the server's reply + def list_workstation_configs request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_workstation_configs_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_workstation_configs", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Workstations::V1::ListWorkstationConfigsResponse.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_usable_workstation_configs REST call + # + # @param request_pb [::Google::Cloud::Workstations::V1::ListUsableWorkstationConfigsRequest] + # 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::Workstations::V1::ListUsableWorkstationConfigsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Workstations::V1::ListUsableWorkstationConfigsResponse] + # A result object deserialized from the server's reply + def list_usable_workstation_configs request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_usable_workstation_configs_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_usable_workstation_configs", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Workstations::V1::ListUsableWorkstationConfigsResponse.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_workstation_config REST call + # + # @param request_pb [::Google::Cloud::Workstations::V1::CreateWorkstationConfigRequest] + # 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_workstation_config request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_workstation_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: "create_workstation_config", + 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 update_workstation_config REST call + # + # @param request_pb [::Google::Cloud::Workstations::V1::UpdateWorkstationConfigRequest] + # 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 update_workstation_config request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_workstation_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_workstation_config", + 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_workstation_config REST call + # + # @param request_pb [::Google::Cloud::Workstations::V1::DeleteWorkstationConfigRequest] + # 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_workstation_config request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_workstation_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: "delete_workstation_config", + 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_workstation REST call + # + # @param request_pb [::Google::Cloud::Workstations::V1::GetWorkstationRequest] + # 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::Workstations::V1::Workstation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Workstations::V1::Workstation] + # A result object deserialized from the server's reply + def get_workstation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_workstation_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_workstation", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Workstations::V1::Workstation.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_workstations REST call + # + # @param request_pb [::Google::Cloud::Workstations::V1::ListWorkstationsRequest] + # 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::Workstations::V1::ListWorkstationsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Workstations::V1::ListWorkstationsResponse] + # A result object deserialized from the server's reply + def list_workstations request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_workstations_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_workstations", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Workstations::V1::ListWorkstationsResponse.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_usable_workstations REST call + # + # @param request_pb [::Google::Cloud::Workstations::V1::ListUsableWorkstationsRequest] + # 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::Workstations::V1::ListUsableWorkstationsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Workstations::V1::ListUsableWorkstationsResponse] + # A result object deserialized from the server's reply + def list_usable_workstations request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_usable_workstations_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_usable_workstations", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Workstations::V1::ListUsableWorkstationsResponse.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_workstation REST call + # + # @param request_pb [::Google::Cloud::Workstations::V1::CreateWorkstationRequest] + # 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_workstation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_workstation_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_workstation", + 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 update_workstation REST call + # + # @param request_pb [::Google::Cloud::Workstations::V1::UpdateWorkstationRequest] + # 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 update_workstation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_workstation_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_workstation", + 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_workstation REST call + # + # @param request_pb [::Google::Cloud::Workstations::V1::DeleteWorkstationRequest] + # 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_workstation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_workstation_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_workstation", + 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 start_workstation REST call + # + # @param request_pb [::Google::Cloud::Workstations::V1::StartWorkstationRequest] + # 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 start_workstation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_start_workstation_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: "start_workstation", + 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 stop_workstation REST call + # + # @param request_pb [::Google::Cloud::Workstations::V1::StopWorkstationRequest] + # 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 stop_workstation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_stop_workstation_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: "stop_workstation", + 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 generate_access_token REST call + # + # @param request_pb [::Google::Cloud::Workstations::V1::GenerateAccessTokenRequest] + # 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::Workstations::V1::GenerateAccessTokenResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Workstations::V1::GenerateAccessTokenResponse] + # A result object deserialized from the server's reply + def generate_access_token request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_generate_access_token_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_access_token", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Workstations::V1::GenerateAccessTokenResponse.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 get_workstation_cluster REST call + # + # @param request_pb [::Google::Cloud::Workstations::V1::GetWorkstationClusterRequest] + # 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_workstation_cluster_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/workstationClusters/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_workstation_clusters REST call + # + # @param request_pb [::Google::Cloud::Workstations::V1::ListWorkstationClustersRequest] + # 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_workstation_clusters_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/workstationClusters", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_workstation_cluster REST call + # + # @param request_pb [::Google::Cloud::Workstations::V1::CreateWorkstationClusterRequest] + # 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_workstation_cluster_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/workstationClusters", + body: "workstation_cluster", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_workstation_cluster REST call + # + # @param request_pb [::Google::Cloud::Workstations::V1::UpdateWorkstationClusterRequest] + # 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_workstation_cluster_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v1/{workstation_cluster.name}", + body: "workstation_cluster", + matches: [ + ["workstation_cluster.name", %r{^projects/[^/]+/locations/[^/]+/workstationClusters/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_workstation_cluster REST call + # + # @param request_pb [::Google::Cloud::Workstations::V1::DeleteWorkstationClusterRequest] + # 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_workstation_cluster_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/workstationClusters/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_workstation_config REST call + # + # @param request_pb [::Google::Cloud::Workstations::V1::GetWorkstationConfigRequest] + # 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_workstation_config_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/workstationClusters/[^/]+/workstationConfigs/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_workstation_configs REST call + # + # @param request_pb [::Google::Cloud::Workstations::V1::ListWorkstationConfigsRequest] + # 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_workstation_configs_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/workstationConfigs", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/workstationClusters/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_usable_workstation_configs REST call + # + # @param request_pb [::Google::Cloud::Workstations::V1::ListUsableWorkstationConfigsRequest] + # 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_usable_workstation_configs_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/workstationConfigs:listUsable", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/workstationClusters/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_workstation_config REST call + # + # @param request_pb [::Google::Cloud::Workstations::V1::CreateWorkstationConfigRequest] + # 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_workstation_config_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/workstationConfigs", + body: "workstation_config", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/workstationClusters/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_workstation_config REST call + # + # @param request_pb [::Google::Cloud::Workstations::V1::UpdateWorkstationConfigRequest] + # 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_workstation_config_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v1/{workstation_config.name}", + body: "workstation_config", + matches: [ + ["workstation_config.name", %r{^projects/[^/]+/locations/[^/]+/workstationClusters/[^/]+/workstationConfigs/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_workstation_config REST call + # + # @param request_pb [::Google::Cloud::Workstations::V1::DeleteWorkstationConfigRequest] + # 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_workstation_config_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/workstationClusters/[^/]+/workstationConfigs/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_workstation REST call + # + # @param request_pb [::Google::Cloud::Workstations::V1::GetWorkstationRequest] + # 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_workstation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/workstationClusters/[^/]+/workstationConfigs/[^/]+/workstations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_workstations REST call + # + # @param request_pb [::Google::Cloud::Workstations::V1::ListWorkstationsRequest] + # 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_workstations_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/workstations", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/workstationClusters/[^/]+/workstationConfigs/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_usable_workstations REST call + # + # @param request_pb [::Google::Cloud::Workstations::V1::ListUsableWorkstationsRequest] + # 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_usable_workstations_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1/{parent}/workstations:listUsable", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/workstationClusters/[^/]+/workstationConfigs/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_workstation REST call + # + # @param request_pb [::Google::Cloud::Workstations::V1::CreateWorkstationRequest] + # 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_workstation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{parent}/workstations", + body: "workstation", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/workstationClusters/[^/]+/workstationConfigs/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_workstation REST call + # + # @param request_pb [::Google::Cloud::Workstations::V1::UpdateWorkstationRequest] + # 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_workstation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v1/{workstation.name}", + body: "workstation", + matches: [ + ["workstation.name", %r{^projects/[^/]+/locations/[^/]+/workstationClusters/[^/]+/workstationConfigs/[^/]+/workstations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_workstation REST call + # + # @param request_pb [::Google::Cloud::Workstations::V1::DeleteWorkstationRequest] + # 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_workstation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/workstationClusters/[^/]+/workstationConfigs/[^/]+/workstations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the start_workstation REST call + # + # @param request_pb [::Google::Cloud::Workstations::V1::StartWorkstationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_start_workstation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:start", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/workstationClusters/[^/]+/workstationConfigs/[^/]+/workstations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the stop_workstation REST call + # + # @param request_pb [::Google::Cloud::Workstations::V1::StopWorkstationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_stop_workstation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:stop", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/workstationClusters/[^/]+/workstationConfigs/[^/]+/workstations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the generate_access_token REST call + # + # @param request_pb [::Google::Cloud::Workstations::V1::GenerateAccessTokenRequest] + # 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_access_token_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{workstation}:generateAccessToken", + body: "*", + matches: [ + ["workstation", %r{^projects/[^/]+/locations/[^/]+/workstationClusters/[^/]+/workstationConfigs/[^/]+/workstations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-workstations-v1/lib/google/cloud/workstations/v1/workstations_pb.rb b/owl-bot-staging/google-cloud-workstations-v1/lib/google/cloud/workstations/v1/workstations_pb.rb new file mode 100644 index 000000000000..609d86ca1a68 --- /dev/null +++ b/owl-bot-staging/google-cloud-workstations-v1/lib/google/cloud/workstations/v1/workstations_pb.rb @@ -0,0 +1,72 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/workstations/v1/workstations.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/field_mask_pb' +require 'google/protobuf/timestamp_pb' +require 'google/rpc/status_pb' + + +descriptor_data = "\n/google/cloud/workstations/v1/workstations.proto\x12\x1cgoogle.cloud.workstations.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 google/protobuf/field_mask.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x17google/rpc/status.proto\"\x87\t\n\x12WorkstationCluster\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x19\n\x0c\x64isplay_name\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x10\n\x03uid\x18\x03 \x01(\tB\x03\xe0\x41\x03\x12\x18\n\x0breconciling\x18\x04 \x01(\x08\x42\x03\xe0\x41\x03\x12[\n\x0b\x61nnotations\x18\x05 \x03(\x0b\x32\x41.google.cloud.workstations.v1.WorkstationCluster.AnnotationsEntryB\x03\xe0\x41\x01\x12Q\n\x06labels\x18\x0f \x03(\x0b\x32<.google.cloud.workstations.v1.WorkstationCluster.LabelsEntryB\x03\xe0\x41\x01\x12\x34\n\x0b\x63reate_time\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0b\x64\x65lete_time\x18\x08 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x11\n\x04\x65tag\x18\t \x01(\tB\x03\xe0\x41\x01\x12\x14\n\x07network\x18\n \x01(\tB\x03\xe0\x41\x05\x12\x17\n\nsubnetwork\x18\x0b \x01(\tB\x03\xe0\x41\x05\x12\x1d\n\x10\x63ontrol_plane_ip\x18\x10 \x01(\tB\x03\xe0\x41\x03\x12j\n\x16private_cluster_config\x18\x0c \x01(\x0b\x32\x45.google.cloud.workstations.v1.WorkstationCluster.PrivateClusterConfigB\x03\xe0\x41\x01\x12\x15\n\x08\x64\x65graded\x18\r \x01(\x08\x42\x03\xe0\x41\x03\x12+\n\nconditions\x18\x0e \x03(\x0b\x32\x12.google.rpc.StatusB\x03\xe0\x41\x03\x1a\x9f\x01\n\x14PrivateClusterConfig\x12$\n\x17\x65nable_private_endpoint\x18\x01 \x01(\x08\x42\x03\xe0\x41\x05\x12\x1d\n\x10\x63luster_hostname\x18\x02 \x01(\tB\x03\xe0\x41\x03\x12#\n\x16service_attachment_uri\x18\x03 \x01(\tB\x03\xe0\x41\x03\x12\x1d\n\x10\x61llowed_projects\x18\x04 \x03(\tB\x03\xe0\x41\x01\x1a\x32\n\x10\x41nnotationsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01:\xb3\x01\xea\x41\xaf\x01\n.workstations.googleapis.com/WorkstationCluster\x12Qprojects/{project}/locations/{location}/workstationClusters/{workstation_cluster}*\x13workstationClusters2\x12workstationClusterR\x01\x01\"\xb2\x19\n\x11WorkstationConfig\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x19\n\x0c\x64isplay_name\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x10\n\x03uid\x18\x03 \x01(\tB\x03\xe0\x41\x03\x12\x18\n\x0breconciling\x18\x04 \x01(\x08\x42\x03\xe0\x41\x03\x12Z\n\x0b\x61nnotations\x18\x05 \x03(\x0b\x32@.google.cloud.workstations.v1.WorkstationConfig.AnnotationsEntryB\x03\xe0\x41\x01\x12P\n\x06labels\x18\x12 \x03(\x0b\x32;.google.cloud.workstations.v1.WorkstationConfig.LabelsEntryB\x03\xe0\x41\x01\x12\x34\n\x0b\x63reate_time\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0b\x64\x65lete_time\x18\x08 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x11\n\x04\x65tag\x18\t \x01(\tB\x03\xe0\x41\x01\x12\x34\n\x0cidle_timeout\x18\n \x01(\x0b\x32\x19.google.protobuf.DurationB\x03\xe0\x41\x01\x12\x37\n\x0frunning_timeout\x18\x0b \x01(\x0b\x32\x19.google.protobuf.DurationB\x03\xe0\x41\x01\x12G\n\x04host\x18\x0c \x01(\x0b\x32\x34.google.cloud.workstations.v1.WorkstationConfig.HostB\x03\xe0\x41\x01\x12h\n\x16persistent_directories\x18\r \x03(\x0b\x32\x43.google.cloud.workstations.v1.WorkstationConfig.PersistentDirectoryB\x03\xe0\x41\x01\x12Q\n\tcontainer\x18\x0e \x01(\x0b\x32\x39.google.cloud.workstations.v1.WorkstationConfig.ContainerB\x03\xe0\x41\x01\x12\x62\n\x0e\x65ncryption_key\x18\x11 \x01(\x0b\x32\x45.google.cloud.workstations.v1.WorkstationConfig.CustomerEncryptionKeyB\x03\xe0\x41\x05\x12]\n\x10readiness_checks\x18\x13 \x03(\x0b\x32>.google.cloud.workstations.v1.WorkstationConfig.ReadinessCheckB\x03\xe0\x41\x01\x12\x1d\n\rreplica_zones\x18\x17 \x03(\tB\x06\xe0\x41\x01\xe0\x41\x05\x12\x15\n\x08\x64\x65graded\x18\x0f \x01(\x08\x42\x03\xe0\x41\x03\x12+\n\nconditions\x18\x10 \x03(\x0b\x32\x12.google.rpc.StatusB\x03\xe0\x41\x03\x1a\xf5\x06\n\x04Host\x12X\n\x0cgce_instance\x18\x01 \x01(\x0b\x32@.google.cloud.workstations.v1.WorkstationConfig.Host.GceInstanceH\x00\x1a\x88\x06\n\x0bGceInstance\x12\x19\n\x0cmachine_type\x18\x01 \x01(\tB\x03\xe0\x41\x01\x12\x1c\n\x0fservice_account\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12#\n\x16service_account_scopes\x18\x03 \x03(\tB\x03\xe0\x41\x01\x12\x11\n\x04tags\x18\x04 \x03(\tB\x03\xe0\x41\x01\x12\x16\n\tpool_size\x18\x05 \x01(\x05\x42\x03\xe0\x41\x01\x12\x1d\n\x10pooled_instances\x18\x0c \x01(\x05\x42\x03\xe0\x41\x03\x12(\n\x1b\x64isable_public_ip_addresses\x18\x06 \x01(\x08\x42\x03\xe0\x41\x01\x12)\n\x1c\x65nable_nested_virtualization\x18\x07 \x01(\x08\x42\x03\xe0\x41\x01\x12\x81\x01\n\x18shielded_instance_config\x18\x08 \x01(\x0b\x32Z.google.cloud.workstations.v1.WorkstationConfig.Host.GceInstance.GceShieldedInstanceConfigB\x03\xe0\x41\x01\x12\x89\x01\n\x1c\x63onfidential_instance_config\x18\n \x01(\x0b\x32^.google.cloud.workstations.v1.WorkstationConfig.Host.GceInstance.GceConfidentialInstanceConfigB\x03\xe0\x41\x01\x12\x1e\n\x11\x62oot_disk_size_gb\x18\t \x01(\x05\x42\x03\xe0\x41\x01\x1a\x80\x01\n\x19GceShieldedInstanceConfig\x12\x1f\n\x12\x65nable_secure_boot\x18\x01 \x01(\x08\x42\x03\xe0\x41\x01\x12\x18\n\x0b\x65nable_vtpm\x18\x02 \x01(\x08\x42\x03\xe0\x41\x01\x12(\n\x1b\x65nable_integrity_monitoring\x18\x03 \x01(\x08\x42\x03\xe0\x41\x01\x1aI\n\x1dGceConfidentialInstanceConfig\x12(\n\x1b\x65nable_confidential_compute\x18\x01 \x01(\x08\x42\x03\xe0\x41\x01\x42\x08\n\x06\x63onfig\x1a\x85\x04\n\x13PersistentDirectory\x12o\n\x06gce_pd\x18\x02 \x01(\x0b\x32].google.cloud.workstations.v1.WorkstationConfig.PersistentDirectory.GceRegionalPersistentDiskH\x00\x12\x17\n\nmount_path\x18\x01 \x01(\tB\x03\xe0\x41\x01\x1a\xd1\x02\n\x19GceRegionalPersistentDisk\x12\x14\n\x07size_gb\x18\x01 \x01(\x05\x42\x03\xe0\x41\x01\x12\x14\n\x07\x66s_type\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x16\n\tdisk_type\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12\x1c\n\x0fsource_snapshot\x18\x05 \x01(\tB\x03\xe0\x41\x01\x12\x88\x01\n\x0ereclaim_policy\x18\x04 \x01(\x0e\x32k.google.cloud.workstations.v1.WorkstationConfig.PersistentDirectory.GceRegionalPersistentDisk.ReclaimPolicyB\x03\xe0\x41\x01\"G\n\rReclaimPolicy\x12\x1e\n\x1aRECLAIM_POLICY_UNSPECIFIED\x10\x00\x12\n\n\x06\x44\x45LETE\x10\x01\x12\n\n\x06RETAIN\x10\x02\x42\x10\n\x0e\x64irectory_type\x1a\xfe\x01\n\tContainer\x12\x12\n\x05image\x18\x01 \x01(\tB\x03\xe0\x41\x01\x12\x14\n\x07\x63ommand\x18\x02 \x03(\tB\x03\xe0\x41\x01\x12\x11\n\x04\x61rgs\x18\x03 \x03(\tB\x03\xe0\x41\x01\x12T\n\x03\x65nv\x18\x04 \x03(\x0b\x32\x42.google.cloud.workstations.v1.WorkstationConfig.Container.EnvEntryB\x03\xe0\x41\x01\x12\x18\n\x0bworking_dir\x18\x05 \x01(\tB\x03\xe0\x41\x01\x12\x18\n\x0brun_as_user\x18\x06 \x01(\x05\x42\x03\xe0\x41\x01\x1a*\n\x08\x45nvEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1aS\n\x15\x43ustomerEncryptionKey\x12\x14\n\x07kms_key\x18\x01 \x01(\tB\x03\xe0\x41\x05\x12$\n\x17kms_key_service_account\x18\x02 \x01(\tB\x03\xe0\x41\x05\x1a\x36\n\x0eReadinessCheck\x12\x11\n\x04path\x18\x01 \x01(\tB\x03\xe0\x41\x01\x12\x11\n\x04port\x18\x02 \x01(\x05\x42\x03\xe0\x41\x01\x1a\x32\n\x10\x41nnotationsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01:\xd8\x01\xea\x41\xd4\x01\n-workstations.googleapis.com/WorkstationConfig\x12yprojects/{project}/locations/{location}/workstationClusters/{workstation_cluster}/workstationConfigs/{workstation_config}*\x12workstationConfigs2\x11workstationConfigR\x01\x01\"\xfc\x07\n\x0bWorkstation\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x19\n\x0c\x64isplay_name\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x10\n\x03uid\x18\x03 \x01(\tB\x03\xe0\x41\x03\x12\x18\n\x0breconciling\x18\x04 \x01(\x08\x42\x03\xe0\x41\x03\x12T\n\x0b\x61nnotations\x18\x05 \x03(\x0b\x32:.google.cloud.workstations.v1.Workstation.AnnotationsEntryB\x03\xe0\x41\x01\x12J\n\x06labels\x18\r \x03(\x0b\x32\x35.google.cloud.workstations.v1.Workstation.LabelsEntryB\x03\xe0\x41\x01\x12\x34\n\x0b\x63reate_time\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x33\n\nstart_time\x18\x0e \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0b\x64\x65lete_time\x18\x08 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x11\n\x04\x65tag\x18\t \x01(\tB\x03\xe0\x41\x01\x12\x43\n\x05state\x18\n \x01(\x0e\x32/.google.cloud.workstations.v1.Workstation.StateB\x03\xe0\x41\x03\x12\x11\n\x04host\x18\x0b \x01(\tB\x03\xe0\x41\x03\x1a\x32\n\x10\x41nnotationsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"l\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x12\n\x0eSTATE_STARTING\x10\x01\x12\x11\n\rSTATE_RUNNING\x10\x02\x12\x12\n\x0eSTATE_STOPPING\x10\x03\x12\x11\n\rSTATE_STOPPED\x10\x04:\xe2\x01\xea\x41\xde\x01\n\'workstations.googleapis.com/Workstation\x12\x94\x01projects/{project}/locations/{location}/workstationClusters/{workstation_cluster}/workstationConfigs/{workstation_config}/workstations/{workstation}*\x0cworkstations2\x0bworkstationR\x01\x01\"d\n\x1cGetWorkstationClusterRequest\x12\x44\n\x04name\x18\x01 \x01(\tB6\xe0\x41\x02\xfa\x41\x30\n.workstations.googleapis.com/WorkstationCluster\"\x99\x01\n\x1eListWorkstationClustersRequest\x12\x46\n\x06parent\x18\x01 \x01(\tB6\xe0\x41\x02\xfa\x41\x30\x12.workstations.googleapis.com/WorkstationCluster\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\"\x9f\x01\n\x1fListWorkstationClustersResponse\x12N\n\x14workstation_clusters\x18\x01 \x03(\x0b\x32\x30.google.cloud.workstations.v1.WorkstationCluster\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x13\n\x0bunreachable\x18\x03 \x03(\t\"\xfe\x01\n\x1f\x43reateWorkstationClusterRequest\x12\x46\n\x06parent\x18\x01 \x01(\tB6\xe0\x41\x02\xfa\x41\x30\x12.workstations.googleapis.com/WorkstationCluster\x12#\n\x16workstation_cluster_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12R\n\x13workstation_cluster\x18\x03 \x01(\x0b\x32\x30.google.cloud.workstations.v1.WorkstationClusterB\x03\xe0\x41\x02\x12\x1a\n\rvalidate_only\x18\x04 \x01(\x08\x42\x03\xe0\x41\x01\"\xe3\x01\n\x1fUpdateWorkstationClusterRequest\x12R\n\x13workstation_cluster\x18\x01 \x01(\x0b\x32\x30.google.cloud.workstations.v1.WorkstationClusterB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\x12\x1a\n\rvalidate_only\x18\x03 \x01(\x08\x42\x03\xe0\x41\x01\x12\x1a\n\rallow_missing\x18\x04 \x01(\x08\x42\x03\xe0\x41\x01\"\xaa\x01\n\x1f\x44\x65leteWorkstationClusterRequest\x12\x44\n\x04name\x18\x01 \x01(\tB6\xe0\x41\x02\xfa\x41\x30\n.workstations.googleapis.com/WorkstationCluster\x12\x1a\n\rvalidate_only\x18\x02 \x01(\x08\x42\x03\xe0\x41\x01\x12\x11\n\x04\x65tag\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12\x12\n\x05\x66orce\x18\x04 \x01(\x08\x42\x03\xe0\x41\x01\"b\n\x1bGetWorkstationConfigRequest\x12\x43\n\x04name\x18\x01 \x01(\tB5\xe0\x41\x02\xfa\x41/\n-workstations.googleapis.com/WorkstationConfig\"\x98\x01\n\x1dListWorkstationConfigsRequest\x12\x46\n\x06parent\x18\x01 \x01(\tB6\xe0\x41\x02\xfa\x41\x30\n.workstations.googleapis.com/WorkstationCluster\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\"\x9c\x01\n\x1eListWorkstationConfigsResponse\x12L\n\x13workstation_configs\x18\x01 \x03(\x0b\x32/.google.cloud.workstations.v1.WorkstationConfig\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x13\n\x0bunreachable\x18\x03 \x03(\t\"\x9e\x01\n#ListUsableWorkstationConfigsRequest\x12\x46\n\x06parent\x18\x01 \x01(\tB6\xe0\x41\x02\xfa\x41\x30\n.workstations.googleapis.com/WorkstationCluster\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\"\xa2\x01\n$ListUsableWorkstationConfigsResponse\x12L\n\x13workstation_configs\x18\x01 \x03(\x0b\x32/.google.cloud.workstations.v1.WorkstationConfig\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x13\n\x0bunreachable\x18\x03 \x03(\t\"\xfa\x01\n\x1e\x43reateWorkstationConfigRequest\x12\x46\n\x06parent\x18\x01 \x01(\tB6\xe0\x41\x02\xfa\x41\x30\n.workstations.googleapis.com/WorkstationCluster\x12\"\n\x15workstation_config_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12P\n\x12workstation_config\x18\x03 \x01(\x0b\x32/.google.cloud.workstations.v1.WorkstationConfigB\x03\xe0\x41\x02\x12\x1a\n\rvalidate_only\x18\x04 \x01(\x08\x42\x03\xe0\x41\x01\"\xe0\x01\n\x1eUpdateWorkstationConfigRequest\x12P\n\x12workstation_config\x18\x01 \x01(\x0b\x32/.google.cloud.workstations.v1.WorkstationConfigB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\x12\x1a\n\rvalidate_only\x18\x03 \x01(\x08\x42\x03\xe0\x41\x01\x12\x1a\n\rallow_missing\x18\x04 \x01(\x08\x42\x03\xe0\x41\x01\"\xa8\x01\n\x1e\x44\x65leteWorkstationConfigRequest\x12\x43\n\x04name\x18\x01 \x01(\tB5\xe0\x41\x02\xfa\x41/\n-workstations.googleapis.com/WorkstationConfig\x12\x1a\n\rvalidate_only\x18\x02 \x01(\x08\x42\x03\xe0\x41\x01\x12\x11\n\x04\x65tag\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12\x12\n\x05\x66orce\x18\x04 \x01(\x08\x42\x03\xe0\x41\x01\"V\n\x15GetWorkstationRequest\x12=\n\x04name\x18\x01 \x01(\tB/\xe0\x41\x02\xfa\x41)\n\'workstations.googleapis.com/Workstation\"\x91\x01\n\x17ListWorkstationsRequest\x12\x45\n\x06parent\x18\x01 \x01(\tB5\xe0\x41\x02\xfa\x41/\n-workstations.googleapis.com/WorkstationConfig\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\"\x93\x01\n\x18ListWorkstationsResponse\x12?\n\x0cworkstations\x18\x01 \x03(\x0b\x32).google.cloud.workstations.v1.Workstation\x12\x1c\n\x0fnext_page_token\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x18\n\x0bunreachable\x18\x03 \x03(\tB\x03\xe0\x41\x01\"\x97\x01\n\x1dListUsableWorkstationsRequest\x12\x45\n\x06parent\x18\x01 \x01(\tB5\xe0\x41\x02\xfa\x41/\n-workstations.googleapis.com/WorkstationConfig\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\"\x8f\x01\n\x1eListUsableWorkstationsResponse\x12?\n\x0cworkstations\x18\x01 \x03(\x0b\x32).google.cloud.workstations.v1.Workstation\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x13\n\x0bunreachable\x18\x03 \x03(\t\"\xdf\x01\n\x18\x43reateWorkstationRequest\x12\x45\n\x06parent\x18\x01 \x01(\tB5\xe0\x41\x02\xfa\x41/\n-workstations.googleapis.com/WorkstationConfig\x12\x1b\n\x0eworkstation_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x43\n\x0bworkstation\x18\x03 \x01(\x0b\x32).google.cloud.workstations.v1.WorkstationB\x03\xe0\x41\x02\x12\x1a\n\rvalidate_only\x18\x04 \x01(\x08\x42\x03\xe0\x41\x01\"\xcd\x01\n\x18UpdateWorkstationRequest\x12\x43\n\x0bworkstation\x18\x01 \x01(\x0b\x32).google.cloud.workstations.v1.WorkstationB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\x12\x1a\n\rvalidate_only\x18\x03 \x01(\x08\x42\x03\xe0\x41\x01\x12\x1a\n\rallow_missing\x18\x04 \x01(\x08\x42\x03\xe0\x41\x01\"\x88\x01\n\x18\x44\x65leteWorkstationRequest\x12=\n\x04name\x18\x01 \x01(\tB/\xe0\x41\x02\xfa\x41)\n\'workstations.googleapis.com/Workstation\x12\x1a\n\rvalidate_only\x18\x02 \x01(\x08\x42\x03\xe0\x41\x01\x12\x11\n\x04\x65tag\x18\x03 \x01(\tB\x03\xe0\x41\x01\"\x87\x01\n\x17StartWorkstationRequest\x12=\n\x04name\x18\x01 \x01(\tB/\xe0\x41\x02\xfa\x41)\n\'workstations.googleapis.com/Workstation\x12\x1a\n\rvalidate_only\x18\x02 \x01(\x08\x42\x03\xe0\x41\x01\x12\x11\n\x04\x65tag\x18\x03 \x01(\tB\x03\xe0\x41\x01\"\x86\x01\n\x16StopWorkstationRequest\x12=\n\x04name\x18\x01 \x01(\tB/\xe0\x41\x02\xfa\x41)\n\'workstations.googleapis.com/Workstation\x12\x1a\n\rvalidate_only\x18\x02 \x01(\x08\x42\x03\xe0\x41\x01\x12\x11\n\x04\x65tag\x18\x03 \x01(\tB\x03\xe0\x41\x01\"\xcd\x01\n\x1aGenerateAccessTokenRequest\x12\x31\n\x0b\x65xpire_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampH\x00\x12(\n\x03ttl\x18\x03 \x01(\x0b\x32\x19.google.protobuf.DurationH\x00\x12\x44\n\x0bworkstation\x18\x01 \x01(\tB/\xe0\x41\x02\xfa\x41)\n\'workstations.googleapis.com/WorkstationB\x0c\n\nexpiration\"d\n\x1bGenerateAccessTokenResponse\x12\x14\n\x0c\x61\x63\x63\x65ss_token\x18\x01 \x01(\t\x12/\n\x0b\x65xpire_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"\x80\x02\n\x11OperationMetadata\x12\x34\n\x0b\x63reate_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x31\n\x08\x65nd_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x13\n\x06target\x18\x03 \x01(\tB\x03\xe0\x41\x03\x12\x11\n\x04verb\x18\x04 \x01(\tB\x03\xe0\x41\x03\x12\x1b\n\x0estatus_message\x18\x05 \x01(\tB\x03\xe0\x41\x03\x12#\n\x16requested_cancellation\x18\x06 \x01(\x08\x42\x03\xe0\x41\x03\x12\x18\n\x0b\x61pi_version\x18\x07 \x01(\tB\x03\xe0\x41\x03\x32\x9b*\n\x0cWorkstations\x12\xcd\x01\n\x15GetWorkstationCluster\x12:.google.cloud.workstations.v1.GetWorkstationClusterRequest\x1a\x30.google.cloud.workstations.v1.WorkstationCluster\"F\xda\x41\x04name\x82\xd3\xe4\x93\x02\x39\x12\x37/v1/{name=projects/*/locations/*/workstationClusters/*}\x12\xe0\x01\n\x17ListWorkstationClusters\x12<.google.cloud.workstations.v1.ListWorkstationClustersRequest\x1a=.google.cloud.workstations.v1.ListWorkstationClustersResponse\"H\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x39\x12\x37/v1/{parent=projects/*/locations/*}/workstationClusters\x12\xad\x02\n\x18\x43reateWorkstationCluster\x12=.google.cloud.workstations.v1.CreateWorkstationClusterRequest\x1a\x1d.google.longrunning.Operation\"\xb2\x01\xca\x41\'\n\x12WorkstationCluster\x12\x11OperationMetadata\xda\x41\x31parent,workstation_cluster,workstation_cluster_id\x82\xd3\xe4\x93\x02N\"7/v1/{parent=projects/*/locations/*}/workstationClusters:\x13workstation_cluster\x12\xaf\x02\n\x18UpdateWorkstationCluster\x12=.google.cloud.workstations.v1.UpdateWorkstationClusterRequest\x1a\x1d.google.longrunning.Operation\"\xb4\x01\xca\x41\'\n\x12WorkstationCluster\x12\x11OperationMetadata\xda\x41\x1fworkstation_cluster,update_mask\x82\xd3\xe4\x93\x02\x62\x32K/v1/{workstation_cluster.name=projects/*/locations/*/workstationClusters/*}:\x13workstation_cluster\x12\xea\x01\n\x18\x44\x65leteWorkstationCluster\x12=.google.cloud.workstations.v1.DeleteWorkstationClusterRequest\x1a\x1d.google.longrunning.Operation\"p\xca\x41\'\n\x12WorkstationCluster\x12\x11OperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02\x39*7/v1/{name=projects/*/locations/*/workstationClusters/*}\x12\xdf\x01\n\x14GetWorkstationConfig\x12\x39.google.cloud.workstations.v1.GetWorkstationConfigRequest\x1a/.google.cloud.workstations.v1.WorkstationConfig\"[\xda\x41\x04name\x82\xd3\xe4\x93\x02N\x12L/v1/{name=projects/*/locations/*/workstationClusters/*/workstationConfigs/*}\x12\xf2\x01\n\x16ListWorkstationConfigs\x12;.google.cloud.workstations.v1.ListWorkstationConfigsRequest\x1a<.google.cloud.workstations.v1.ListWorkstationConfigsResponse\"]\xda\x41\x06parent\x82\xd3\xe4\x93\x02N\x12L/v1/{parent=projects/*/locations/*/workstationClusters/*}/workstationConfigs\x12\x8f\x02\n\x1cListUsableWorkstationConfigs\x12\x41.google.cloud.workstations.v1.ListUsableWorkstationConfigsRequest\x1a\x42.google.cloud.workstations.v1.ListUsableWorkstationConfigsResponse\"h\xda\x41\x06parent\x82\xd3\xe4\x93\x02Y\x12W/v1/{parent=projects/*/locations/*/workstationClusters/*}/workstationConfigs:listUsable\x12\xbc\x02\n\x17\x43reateWorkstationConfig\x12<.google.cloud.workstations.v1.CreateWorkstationConfigRequest\x1a\x1d.google.longrunning.Operation\"\xc3\x01\xca\x41&\n\x11WorkstationConfig\x12\x11OperationMetadata\xda\x41/parent,workstation_config,workstation_config_id\x82\xd3\xe4\x93\x02\x62\"L/v1/{parent=projects/*/locations/*/workstationClusters/*}/workstationConfigs:\x12workstation_config\x12\xbe\x02\n\x17UpdateWorkstationConfig\x12<.google.cloud.workstations.v1.UpdateWorkstationConfigRequest\x1a\x1d.google.longrunning.Operation\"\xc5\x01\xca\x41&\n\x11WorkstationConfig\x12\x11OperationMetadata\xda\x41\x1eworkstation_config,update_mask\x82\xd3\xe4\x93\x02u2_/v1/{workstation_config.name=projects/*/locations/*/workstationClusters/*/workstationConfigs/*}:\x12workstation_config\x12\xfd\x01\n\x17\x44\x65leteWorkstationConfig\x12<.google.cloud.workstations.v1.DeleteWorkstationConfigRequest\x1a\x1d.google.longrunning.Operation\"\x84\x01\xca\x41&\n\x11WorkstationConfig\x12\x11OperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02N*L/v1/{name=projects/*/locations/*/workstationClusters/*/workstationConfigs/*}\x12\xdc\x01\n\x0eGetWorkstation\x12\x33.google.cloud.workstations.v1.GetWorkstationRequest\x1a).google.cloud.workstations.v1.Workstation\"j\xda\x41\x04name\x82\xd3\xe4\x93\x02]\x12[/v1/{name=projects/*/locations/*/workstationClusters/*/workstationConfigs/*/workstations/*}\x12\xef\x01\n\x10ListWorkstations\x12\x35.google.cloud.workstations.v1.ListWorkstationsRequest\x1a\x36.google.cloud.workstations.v1.ListWorkstationsResponse\"l\xda\x41\x06parent\x82\xd3\xe4\x93\x02]\x12[/v1/{parent=projects/*/locations/*/workstationClusters/*/workstationConfigs/*}/workstations\x12\x8c\x02\n\x16ListUsableWorkstations\x12;.google.cloud.workstations.v1.ListUsableWorkstationsRequest\x1a<.google.cloud.workstations.v1.ListUsableWorkstationsResponse\"w\xda\x41\x06parent\x82\xd3\xe4\x93\x02h\x12\x66/v1/{parent=projects/*/locations/*/workstationClusters/*/workstationConfigs/*}/workstations:listUsable\x12\xa4\x02\n\x11\x43reateWorkstation\x12\x36.google.cloud.workstations.v1.CreateWorkstationRequest\x1a\x1d.google.longrunning.Operation\"\xb7\x01\xca\x41 \n\x0bWorkstation\x12\x11OperationMetadata\xda\x41!parent,workstation,workstation_id\x82\xd3\xe4\x93\x02j\"[/v1/{parent=projects/*/locations/*/workstationClusters/*/workstationConfigs/*}/workstations:\x0bworkstation\x12\xa6\x02\n\x11UpdateWorkstation\x12\x36.google.cloud.workstations.v1.UpdateWorkstationRequest\x1a\x1d.google.longrunning.Operation\"\xb9\x01\xca\x41 \n\x0bWorkstation\x12\x11OperationMetadata\xda\x41\x17workstation,update_mask\x82\xd3\xe4\x93\x02v2g/v1/{workstation.name=projects/*/locations/*/workstationClusters/*/workstationConfigs/*/workstations/*}:\x0bworkstation\x12\xfa\x01\n\x11\x44\x65leteWorkstation\x12\x36.google.cloud.workstations.v1.DeleteWorkstationRequest\x1a\x1d.google.longrunning.Operation\"\x8d\x01\xca\x41 \n\x0bWorkstation\x12\x11OperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02]*[/v1/{name=projects/*/locations/*/workstationClusters/*/workstationConfigs/*/workstations/*}\x12\x81\x02\n\x10StartWorkstation\x12\x35.google.cloud.workstations.v1.StartWorkstationRequest\x1a\x1d.google.longrunning.Operation\"\x96\x01\xca\x41 \n\x0bWorkstation\x12\x11OperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02\x66\"a/v1/{name=projects/*/locations/*/workstationClusters/*/workstationConfigs/*/workstations/*}:start:\x01*\x12\xfe\x01\n\x0fStopWorkstation\x12\x34.google.cloud.workstations.v1.StopWorkstationRequest\x1a\x1d.google.longrunning.Operation\"\x95\x01\xca\x41 \n\x0bWorkstation\x12\x11OperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02\x65\"`/v1/{name=projects/*/locations/*/workstationClusters/*/workstationConfigs/*/workstations/*}:stop:\x01*\x12\x9c\x02\n\x13GenerateAccessToken\x12\x38.google.cloud.workstations.v1.GenerateAccessTokenRequest\x1a\x39.google.cloud.workstations.v1.GenerateAccessTokenResponse\"\x8f\x01\xda\x41\x0bworkstation\x82\xd3\xe4\x93\x02{\"v/v1/{workstation=projects/*/locations/*/workstationClusters/*/workstationConfigs/*/workstations/*}:generateAccessToken:\x01*\x1aO\xca\x41\x1bworkstations.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB}\n com.google.cloud.workstations.v1B\x11WorkstationsProtoP\x01ZDcloud.google.com/go/workstations/apiv1/workstationspb;workstationspbb\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module Workstations + module V1 + WorkstationCluster = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.workstations.v1.WorkstationCluster").msgclass + WorkstationCluster::PrivateClusterConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.workstations.v1.WorkstationCluster.PrivateClusterConfig").msgclass + WorkstationConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.workstations.v1.WorkstationConfig").msgclass + WorkstationConfig::Host = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.workstations.v1.WorkstationConfig.Host").msgclass + WorkstationConfig::Host::GceInstance = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.workstations.v1.WorkstationConfig.Host.GceInstance").msgclass + WorkstationConfig::Host::GceInstance::GceShieldedInstanceConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.workstations.v1.WorkstationConfig.Host.GceInstance.GceShieldedInstanceConfig").msgclass + WorkstationConfig::Host::GceInstance::GceConfidentialInstanceConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.workstations.v1.WorkstationConfig.Host.GceInstance.GceConfidentialInstanceConfig").msgclass + WorkstationConfig::PersistentDirectory = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.workstations.v1.WorkstationConfig.PersistentDirectory").msgclass + WorkstationConfig::PersistentDirectory::GceRegionalPersistentDisk = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.workstations.v1.WorkstationConfig.PersistentDirectory.GceRegionalPersistentDisk").msgclass + WorkstationConfig::PersistentDirectory::GceRegionalPersistentDisk::ReclaimPolicy = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.workstations.v1.WorkstationConfig.PersistentDirectory.GceRegionalPersistentDisk.ReclaimPolicy").enummodule + WorkstationConfig::Container = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.workstations.v1.WorkstationConfig.Container").msgclass + WorkstationConfig::CustomerEncryptionKey = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.workstations.v1.WorkstationConfig.CustomerEncryptionKey").msgclass + WorkstationConfig::ReadinessCheck = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.workstations.v1.WorkstationConfig.ReadinessCheck").msgclass + Workstation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.workstations.v1.Workstation").msgclass + Workstation::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.workstations.v1.Workstation.State").enummodule + GetWorkstationClusterRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.workstations.v1.GetWorkstationClusterRequest").msgclass + ListWorkstationClustersRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.workstations.v1.ListWorkstationClustersRequest").msgclass + ListWorkstationClustersResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.workstations.v1.ListWorkstationClustersResponse").msgclass + CreateWorkstationClusterRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.workstations.v1.CreateWorkstationClusterRequest").msgclass + UpdateWorkstationClusterRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.workstations.v1.UpdateWorkstationClusterRequest").msgclass + DeleteWorkstationClusterRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.workstations.v1.DeleteWorkstationClusterRequest").msgclass + GetWorkstationConfigRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.workstations.v1.GetWorkstationConfigRequest").msgclass + ListWorkstationConfigsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.workstations.v1.ListWorkstationConfigsRequest").msgclass + ListWorkstationConfigsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.workstations.v1.ListWorkstationConfigsResponse").msgclass + ListUsableWorkstationConfigsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.workstations.v1.ListUsableWorkstationConfigsRequest").msgclass + ListUsableWorkstationConfigsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.workstations.v1.ListUsableWorkstationConfigsResponse").msgclass + CreateWorkstationConfigRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.workstations.v1.CreateWorkstationConfigRequest").msgclass + UpdateWorkstationConfigRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.workstations.v1.UpdateWorkstationConfigRequest").msgclass + DeleteWorkstationConfigRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.workstations.v1.DeleteWorkstationConfigRequest").msgclass + GetWorkstationRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.workstations.v1.GetWorkstationRequest").msgclass + ListWorkstationsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.workstations.v1.ListWorkstationsRequest").msgclass + ListWorkstationsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.workstations.v1.ListWorkstationsResponse").msgclass + ListUsableWorkstationsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.workstations.v1.ListUsableWorkstationsRequest").msgclass + ListUsableWorkstationsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.workstations.v1.ListUsableWorkstationsResponse").msgclass + CreateWorkstationRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.workstations.v1.CreateWorkstationRequest").msgclass + UpdateWorkstationRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.workstations.v1.UpdateWorkstationRequest").msgclass + DeleteWorkstationRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.workstations.v1.DeleteWorkstationRequest").msgclass + StartWorkstationRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.workstations.v1.StartWorkstationRequest").msgclass + StopWorkstationRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.workstations.v1.StopWorkstationRequest").msgclass + GenerateAccessTokenRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.workstations.v1.GenerateAccessTokenRequest").msgclass + GenerateAccessTokenResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.workstations.v1.GenerateAccessTokenResponse").msgclass + OperationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.workstations.v1.OperationMetadata").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-workstations-v1/lib/google/cloud/workstations/v1/workstations_services_pb.rb b/owl-bot-staging/google-cloud-workstations-v1/lib/google/cloud/workstations/v1/workstations_services_pb.rb new file mode 100644 index 000000000000..023403299d59 --- /dev/null +++ b/owl-bot-staging/google-cloud-workstations-v1/lib/google/cloud/workstations/v1/workstations_services_pb.rb @@ -0,0 +1,86 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/cloud/workstations/v1/workstations.proto for package 'google.cloud.workstations.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/workstations/v1/workstations_pb' + +module Google + module Cloud + module Workstations + module V1 + module Workstations + # Service for interacting with Cloud Workstations. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.cloud.workstations.v1.Workstations' + + # Returns the requested workstation cluster. + rpc :GetWorkstationCluster, ::Google::Cloud::Workstations::V1::GetWorkstationClusterRequest, ::Google::Cloud::Workstations::V1::WorkstationCluster + # Returns all workstation clusters in the specified location. + rpc :ListWorkstationClusters, ::Google::Cloud::Workstations::V1::ListWorkstationClustersRequest, ::Google::Cloud::Workstations::V1::ListWorkstationClustersResponse + # Creates a new workstation cluster. + rpc :CreateWorkstationCluster, ::Google::Cloud::Workstations::V1::CreateWorkstationClusterRequest, ::Google::Longrunning::Operation + # Updates an existing workstation cluster. + rpc :UpdateWorkstationCluster, ::Google::Cloud::Workstations::V1::UpdateWorkstationClusterRequest, ::Google::Longrunning::Operation + # Deletes the specified workstation cluster. + rpc :DeleteWorkstationCluster, ::Google::Cloud::Workstations::V1::DeleteWorkstationClusterRequest, ::Google::Longrunning::Operation + # Returns the requested workstation configuration. + rpc :GetWorkstationConfig, ::Google::Cloud::Workstations::V1::GetWorkstationConfigRequest, ::Google::Cloud::Workstations::V1::WorkstationConfig + # Returns all workstation configurations in the specified cluster. + rpc :ListWorkstationConfigs, ::Google::Cloud::Workstations::V1::ListWorkstationConfigsRequest, ::Google::Cloud::Workstations::V1::ListWorkstationConfigsResponse + # Returns all workstation configurations in the specified cluster on which + # the caller has the "workstations.workstation.create" permission. + rpc :ListUsableWorkstationConfigs, ::Google::Cloud::Workstations::V1::ListUsableWorkstationConfigsRequest, ::Google::Cloud::Workstations::V1::ListUsableWorkstationConfigsResponse + # Creates a new workstation configuration. + rpc :CreateWorkstationConfig, ::Google::Cloud::Workstations::V1::CreateWorkstationConfigRequest, ::Google::Longrunning::Operation + # Updates an existing workstation configuration. + rpc :UpdateWorkstationConfig, ::Google::Cloud::Workstations::V1::UpdateWorkstationConfigRequest, ::Google::Longrunning::Operation + # Deletes the specified workstation configuration. + rpc :DeleteWorkstationConfig, ::Google::Cloud::Workstations::V1::DeleteWorkstationConfigRequest, ::Google::Longrunning::Operation + # Returns the requested workstation. + rpc :GetWorkstation, ::Google::Cloud::Workstations::V1::GetWorkstationRequest, ::Google::Cloud::Workstations::V1::Workstation + # Returns all Workstations using the specified workstation configuration. + rpc :ListWorkstations, ::Google::Cloud::Workstations::V1::ListWorkstationsRequest, ::Google::Cloud::Workstations::V1::ListWorkstationsResponse + # Returns all workstations using the specified workstation configuration + # on which the caller has the "workstations.workstations.use" permission. + rpc :ListUsableWorkstations, ::Google::Cloud::Workstations::V1::ListUsableWorkstationsRequest, ::Google::Cloud::Workstations::V1::ListUsableWorkstationsResponse + # Creates a new workstation. + rpc :CreateWorkstation, ::Google::Cloud::Workstations::V1::CreateWorkstationRequest, ::Google::Longrunning::Operation + # Updates an existing workstation. + rpc :UpdateWorkstation, ::Google::Cloud::Workstations::V1::UpdateWorkstationRequest, ::Google::Longrunning::Operation + # Deletes the specified workstation. + rpc :DeleteWorkstation, ::Google::Cloud::Workstations::V1::DeleteWorkstationRequest, ::Google::Longrunning::Operation + # Starts running a workstation so that users can connect to it. + rpc :StartWorkstation, ::Google::Cloud::Workstations::V1::StartWorkstationRequest, ::Google::Longrunning::Operation + # Stops running a workstation, reducing costs. + rpc :StopWorkstation, ::Google::Cloud::Workstations::V1::StopWorkstationRequest, ::Google::Longrunning::Operation + # Returns a short-lived credential that can be used to send authenticated and + # authorized traffic to a workstation. + rpc :GenerateAccessToken, ::Google::Cloud::Workstations::V1::GenerateAccessTokenRequest, ::Google::Cloud::Workstations::V1::GenerateAccessTokenResponse + end + + Stub = Service.rpc_stub_class + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-workstations-v1/proto_docs/README.md b/owl-bot-staging/google-cloud-workstations-v1/proto_docs/README.md new file mode 100644 index 000000000000..4081c926988b --- /dev/null +++ b/owl-bot-staging/google-cloud-workstations-v1/proto_docs/README.md @@ -0,0 +1,4 @@ +# Cloud Workstations 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-workstations-v1/proto_docs/google/api/client.rb b/owl-bot-staging/google-cloud-workstations-v1/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..3ab0b096d445 --- /dev/null +++ b/owl-bot-staging/google-cloud-workstations-v1/proto_docs/google/api/client.rb @@ -0,0 +1,593 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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. + # + # Note: This field should not be used in most cases. + 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: + # library_settings: + # 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. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Php. Clobbers the php_namespace option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.php.package_name" field + # in gapic.yaml. API teams should use the protobuf php_namespace option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # library_settings: + # php_settings: + # library_package: Google\Cloud\PubSub\V1 + 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. + # + # Example: + # + # 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 + # @!attribute [rw] batching + # @return [::Google::Api::BatchingConfigProto] + # Batching configuration for an API method in client libraries. + # + # Example of a YAML configuration: + # + # publishing: + # method_settings: + # - selector: google.example.v1.ExampleService.BatchCreateExample + # batching: + # element_count_threshold: 1000 + # request_byte_threshold: 100000000 + # delay_threshold_millis: 10 + 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. + # + # Note: This feature should not be used in most cases. + # @!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 + + # `BatchingConfigProto` defines the batching configuration for an API method. + # @!attribute [rw] thresholds + # @return [::Google::Api::BatchingSettingsProto] + # The thresholds which trigger a batched request to be sent. + # @!attribute [rw] batch_descriptor + # @return [::Google::Api::BatchingDescriptorProto] + # The request and response fields used in batching. + class BatchingConfigProto + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `BatchingSettingsProto` specifies a set of batching thresholds, each of + # which acts as a trigger to send a batch of messages as a request. At least + # one threshold must be positive nonzero. + # @!attribute [rw] element_count_threshold + # @return [::Integer] + # The number of elements of a field collected into a batch which, if + # exceeded, causes the batch to be sent. + # @!attribute [rw] request_byte_threshold + # @return [::Integer] + # The aggregated size of the batched field which, if exceeded, causes the + # batch to be sent. This size is computed by aggregating the sizes of the + # request field to be batched, not of the entire request message. + # @!attribute [rw] delay_threshold + # @return [::Google::Protobuf::Duration] + # The duration after which a batch should be sent, starting from the addition + # of the first message to that batch. + # @!attribute [rw] element_count_limit + # @return [::Integer] + # The maximum number of elements collected in a batch that could be accepted + # by server. + # @!attribute [rw] request_byte_limit + # @return [::Integer] + # The maximum size of the request that could be accepted by server. + # @!attribute [rw] flow_control_element_limit + # @return [::Integer] + # The maximum number of elements allowed by flow control. + # @!attribute [rw] flow_control_byte_limit + # @return [::Integer] + # The maximum size of data allowed by flow control. + # @!attribute [rw] flow_control_limit_exceeded_behavior + # @return [::Google::Api::FlowControlLimitExceededBehaviorProto] + # The behavior to take when the flow control limit is exceeded. + class BatchingSettingsProto + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `BatchingDescriptorProto` specifies the fields of the request message to be + # used for batching, and, optionally, the fields of the response message to be + # used for demultiplexing. + # @!attribute [rw] batched_field + # @return [::String] + # The repeated field in the request message to be aggregated by batching. + # @!attribute [rw] discriminator_fields + # @return [::Array<::String>] + # A list of the fields in the request message. Two requests will be batched + # together only if the values of every field specified in + # `request_discriminator_fields` is equal between the two requests. + # @!attribute [rw] subresponse_field + # @return [::String] + # Optional. When present, indicates the field in the response message to be + # used to demultiplex the response into multiple response messages, in + # correspondence with the multiple request messages originally batched + # together. + class BatchingDescriptorProto + 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 + + # The behavior to take when the flow control limit is exceeded. + module FlowControlLimitExceededBehaviorProto + # Default behavior, system-defined. + UNSET_BEHAVIOR = 0 + + # Stop operation, raise error. + THROW_EXCEPTION = 1 + + # Pause operation until limit clears. + BLOCK = 2 + + # Continue operation, disregard limit. + IGNORE = 3 + end + end +end diff --git a/owl-bot-staging/google-cloud-workstations-v1/proto_docs/google/api/field_behavior.rb b/owl-bot-staging/google-cloud-workstations-v1/proto_docs/google/api/field_behavior.rb new file mode 100644 index 000000000000..582be187d115 --- /dev/null +++ b/owl-bot-staging/google-cloud-workstations-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-workstations-v1/proto_docs/google/api/launch_stage.rb b/owl-bot-staging/google-cloud-workstations-v1/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..9392a413fb1b --- /dev/null +++ b/owl-bot-staging/google-cloud-workstations-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-workstations-v1/proto_docs/google/api/resource.rb b/owl-bot-staging/google-cloud-workstations-v1/proto_docs/google/api/resource.rb new file mode 100644 index 000000000000..25dec4847ac1 --- /dev/null +++ b/owl-bot-staging/google-cloud-workstations-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-workstations-v1/proto_docs/google/cloud/workstations/v1/workstations.rb b/owl-bot-staging/google-cloud-workstations-v1/proto_docs/google/cloud/workstations/v1/workstations.rb new file mode 100644 index 000000000000..97b65f828112 --- /dev/null +++ b/owl-bot-staging/google-cloud-workstations-v1/proto_docs/google/cloud/workstations/v1/workstations.rb @@ -0,0 +1,1177 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Workstations + module V1 + # A workstation cluster resource in the Cloud Workstations API. + # + # Defines a group of workstations in a particular region and the + # VPC network they're attached to. + # @!attribute [rw] name + # @return [::String] + # Full name of this workstation cluster. + # @!attribute [rw] display_name + # @return [::String] + # Optional. Human-readable name for this workstation cluster. + # @!attribute [r] uid + # @return [::String] + # Output only. A system-assigned unique identifier for this workstation + # cluster. + # @!attribute [r] reconciling + # @return [::Boolean] + # Output only. Indicates whether this workstation cluster is currently being + # updated to match its intended state. + # @!attribute [rw] annotations + # @return [::Google::Protobuf::Map{::String => ::String}] + # Optional. Client-specified annotations. + # @!attribute [rw] labels + # @return [::Google::Protobuf::Map{::String => ::String}] + # Optional. + # [Labels](https://cloud.google.com/workstations/docs/label-resources) that + # are applied to the workstation cluster and that are also propagated to the + # underlying Compute Engine resources. + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Time when this workstation cluster was created. + # @!attribute [r] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Time when this workstation cluster was most recently updated. + # @!attribute [r] delete_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Time when this workstation cluster was soft-deleted. + # @!attribute [rw] etag + # @return [::String] + # Optional. Checksum computed by the server. May be sent on update and delete + # requests to make sure that the client has an up-to-date value before + # proceeding. + # @!attribute [rw] network + # @return [::String] + # Immutable. Name of the Compute Engine network in which instances associated + # with this workstation cluster will be created. + # @!attribute [rw] subnetwork + # @return [::String] + # Immutable. Name of the Compute Engine subnetwork in which instances + # associated with this workstation cluster will be created. Must be part of + # the subnetwork specified for this workstation cluster. + # @!attribute [r] control_plane_ip + # @return [::String] + # Output only. The private IP address of the control plane for this + # workstation cluster. Workstation VMs need access to this IP address to work + # with the service, so make sure that your firewall rules allow egress from + # the workstation VMs to this address. + # @!attribute [rw] private_cluster_config + # @return [::Google::Cloud::Workstations::V1::WorkstationCluster::PrivateClusterConfig] + # Optional. Configuration for private workstation cluster. + # @!attribute [r] degraded + # @return [::Boolean] + # Output only. Whether this workstation cluster is in degraded mode, in which + # case it may require user action to restore full functionality. Details can + # be found in + # {::Google::Cloud::Workstations::V1::WorkstationCluster#conditions conditions}. + # @!attribute [r] conditions + # @return [::Array<::Google::Rpc::Status>] + # Output only. Status conditions describing the workstation cluster's current + # state. + class WorkstationCluster + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Configuration options for private workstation clusters. + # @!attribute [rw] enable_private_endpoint + # @return [::Boolean] + # Immutable. Whether Workstations endpoint is private. + # @!attribute [r] cluster_hostname + # @return [::String] + # Output only. Hostname for the workstation cluster. This field will be + # populated only when private endpoint is enabled. To access workstations + # in the workstation cluster, create a new DNS zone mapping this domain + # name to an internal IP address and a forwarding rule mapping that address + # to the service attachment. + # @!attribute [r] service_attachment_uri + # @return [::String] + # Output only. Service attachment URI for the workstation cluster. The + # service attachemnt is created when private endpoint is enabled. To access + # workstations in the workstation cluster, configure access to the managed + # service using [Private Service + # Connect](https://cloud.google.com/vpc/docs/configure-private-service-connect-services). + # @!attribute [rw] allowed_projects + # @return [::Array<::String>] + # Optional. Additional projects that are allowed to attach to the + # workstation cluster's service attachment. By default, the workstation + # cluster's project and the VPC host project (if different) are allowed. + class PrivateClusterConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class AnnotationsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class LabelsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # A workstation configuration resource in the Cloud Workstations API. + # + # Workstation configurations act as templates for workstations. The workstation + # configuration defines details such as the workstation virtual machine (VM) + # instance type, persistent storage, container image defining environment, + # which IDE or Code Editor to use, and more. Administrators and platform teams + # can also use [Identity and Access Management + # (IAM)](https://cloud.google.com/iam/docs/overview) rules to grant access to + # teams or to individual developers. + # @!attribute [rw] name + # @return [::String] + # Full name of this workstation configuration. + # @!attribute [rw] display_name + # @return [::String] + # Optional. Human-readable name for this workstation configuration. + # @!attribute [r] uid + # @return [::String] + # Output only. A system-assigned unique identifier for this workstation + # configuration. + # @!attribute [r] reconciling + # @return [::Boolean] + # Output only. Indicates whether this workstation configuration is currently + # being updated to match its intended state. + # @!attribute [rw] annotations + # @return [::Google::Protobuf::Map{::String => ::String}] + # Optional. Client-specified annotations. + # @!attribute [rw] labels + # @return [::Google::Protobuf::Map{::String => ::String}] + # Optional. + # [Labels](https://cloud.google.com/workstations/docs/label-resources) that + # are applied to the workstation configuration and that are also propagated + # to the underlying Compute Engine resources. + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Time when this workstation configuration was created. + # @!attribute [r] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Time when this workstation configuration was most recently + # updated. + # @!attribute [r] delete_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Time when this workstation configuration was soft-deleted. + # @!attribute [rw] etag + # @return [::String] + # Optional. Checksum computed by the server. May be sent on update and delete + # requests to make sure that the client has an up-to-date value before + # proceeding. + # @!attribute [rw] idle_timeout + # @return [::Google::Protobuf::Duration] + # Optional. Number of seconds to wait before automatically stopping a + # workstation after it last received user traffic. + # + # A value of `"0s"` indicates that Cloud Workstations VMs created with this + # configuration should never time out due to idleness. + # Provide + # [duration](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#duration) + # terminated by `s` for seconds—for example, `"7200s"` (2 hours). + # The default is `"1200s"` (20 minutes). + # @!attribute [rw] running_timeout + # @return [::Google::Protobuf::Duration] + # Optional. Number of seconds that a workstation can run until it is + # automatically shut down. We recommend that workstations be shut down daily + # to reduce costs and so that security updates can be applied upon restart. + # The + # {::Google::Cloud::Workstations::V1::WorkstationConfig#idle_timeout idle_timeout} + # and + # {::Google::Cloud::Workstations::V1::WorkstationConfig#running_timeout running_timeout} + # fields are independent of each other. Note that the + # {::Google::Cloud::Workstations::V1::WorkstationConfig#running_timeout running_timeout} + # field shuts down VMs after the specified time, regardless of whether or not + # the VMs are idle. + # + # Provide duration terminated by `s` for seconds—for example, `"54000s"` + # (15 hours). Defaults to `"43200s"` (12 hours). A value of `"0s"` indicates + # that workstations using this configuration should never time out. If + # {::Google::Cloud::Workstations::V1::WorkstationConfig#encryption_key encryption_key} + # is set, it must be greater than `"0s"` and less than + # `"86400s"` (24 hours). + # + # Warning: A value of `"0s"` indicates that Cloud Workstations VMs created + # with this configuration have no maximum running time. This is strongly + # discouraged because you incur costs and will not pick up security updates. + # @!attribute [rw] host + # @return [::Google::Cloud::Workstations::V1::WorkstationConfig::Host] + # Optional. Runtime host for the workstation. + # @!attribute [rw] persistent_directories + # @return [::Array<::Google::Cloud::Workstations::V1::WorkstationConfig::PersistentDirectory>] + # Optional. Directories to persist across workstation sessions. + # @!attribute [rw] container + # @return [::Google::Cloud::Workstations::V1::WorkstationConfig::Container] + # Optional. Container that runs upon startup for each workstation using this + # workstation configuration. + # @!attribute [rw] encryption_key + # @return [::Google::Cloud::Workstations::V1::WorkstationConfig::CustomerEncryptionKey] + # Immutable. Encrypts resources of this workstation configuration using a + # customer-managed encryption key (CMEK). + # + # If specified, the boot disk of the Compute Engine instance and the + # persistent disk are encrypted using this encryption key. If + # this field is not set, the disks are encrypted using a generated + # key. Customer-managed encryption keys do not protect disk metadata. + # + # If the customer-managed encryption key is rotated, when the workstation + # instance is stopped, the system attempts to recreate the + # persistent disk with the new version of the key. Be sure to keep + # older versions of the key until the persistent disk is recreated. + # Otherwise, data on the persistent disk might be lost. + # + # If the encryption key is revoked, the workstation session automatically + # stops within 7 hours. + # + # Immutable after the workstation configuration is created. + # @!attribute [rw] readiness_checks + # @return [::Array<::Google::Cloud::Workstations::V1::WorkstationConfig::ReadinessCheck>] + # Optional. Readiness checks to perform when starting a workstation using + # this workstation configuration. Mark a workstation as running only after + # all specified readiness checks return 200 status codes. + # @!attribute [rw] replica_zones + # @return [::Array<::String>] + # Optional. Immutable. Specifies the zones used to replicate the VM and disk + # resources within the region. If set, exactly two zones within the + # workstation cluster's region must be specified—for example, + # `['us-central1-a', 'us-central1-f']`. If this field is empty, two default + # zones within the region are used. + # + # Immutable after the workstation configuration is created. + # @!attribute [r] degraded + # @return [::Boolean] + # Output only. Whether this resource is degraded, in which case it may + # require user action to restore full functionality. See also the + # {::Google::Cloud::Workstations::V1::WorkstationConfig#conditions conditions} + # field. + # @!attribute [r] conditions + # @return [::Array<::Google::Rpc::Status>] + # Output only. Status conditions describing the current resource state. + class WorkstationConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Runtime host for a workstation. + # @!attribute [rw] gce_instance + # @return [::Google::Cloud::Workstations::V1::WorkstationConfig::Host::GceInstance] + # Specifies a Compute Engine instance as the host. + class Host + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # A runtime using a Compute Engine instance. + # @!attribute [rw] machine_type + # @return [::String] + # Optional. The type of machine to use for VM instances—for example, + # `"e2-standard-4"`. For more information about machine types that + # Cloud Workstations supports, see the list of + # [available machine + # types](https://cloud.google.com/workstations/docs/available-machine-types). + # @!attribute [rw] service_account + # @return [::String] + # Optional. The email address of the service account for Cloud + # Workstations VMs created with this configuration. When specified, be + # sure that the service account has `logginglogEntries.create` permission + # on the project so it can write logs out to Cloud Logging. If using a + # custom container image, the service account must have permissions to + # pull the specified image. + # + # If you as the administrator want to be able to `ssh` into the + # underlying VM, you need to set this value to a service account + # for which you have the `iam.serviceAccounts.actAs` permission. + # Conversely, if you don't want anyone to be able to `ssh` into the + # underlying VM, use a service account where no one has that + # permission. + # + # If not set, VMs run with a service account provided by the + # Cloud Workstations service, and the image must be publicly + # accessible. + # @!attribute [rw] service_account_scopes + # @return [::Array<::String>] + # Optional. Scopes to grant to the + # {::Google::Cloud::Workstations::V1::WorkstationConfig::Host::GceInstance#service_account service_account}. + # Various scopes are automatically added based on feature usage. When + # specified, users of workstations under this configuration must have + # `iam.serviceAccounts.actAs` on the service account. + # @!attribute [rw] tags + # @return [::Array<::String>] + # Optional. Network tags to add to the Compute Engine VMs backing the + # workstations. This option applies + # [network + # tags](https://cloud.google.com/vpc/docs/add-remove-network-tags) to VMs + # created with this configuration. These network tags enable the creation + # of [firewall + # rules](https://cloud.google.com/workstations/docs/configure-firewall-rules). + # @!attribute [rw] pool_size + # @return [::Integer] + # Optional. The number of VMs that the system should keep idle so that + # new workstations can be started quickly for new users. Defaults to `0` + # in the API. + # @!attribute [r] pooled_instances + # @return [::Integer] + # Output only. Number of instances currently available in the pool for + # faster workstation startup. + # @!attribute [rw] disable_public_ip_addresses + # @return [::Boolean] + # Optional. When set to true, disables public IP addresses for VMs. If + # you disable public IP addresses, you must set up Private Google Access + # or Cloud NAT on your network. If you use Private Google Access and you + # use `private.googleapis.com` or `restricted.googleapis.com` for + # Container Registry and Artifact Registry, make sure that you set + # up DNS records for domains `*.gcr.io` and `*.pkg.dev`. + # Defaults to false (VMs have public IP addresses). + # @!attribute [rw] enable_nested_virtualization + # @return [::Boolean] + # Optional. Whether to enable nested virtualization on Cloud Workstations + # VMs created under this workstation configuration. + # + # Nested virtualization lets you run virtual machine (VM) instances + # inside your workstation. Before enabling nested virtualization, + # consider the following important considerations. Cloud Workstations + # instances are subject to the [same restrictions as Compute Engine + # instances](https://cloud.google.com/compute/docs/instances/nested-virtualization/overview#restrictions): + # + # * **Organization policy**: projects, folders, or + # organizations may be restricted from creating nested VMs if the + # **Disable VM nested virtualization** constraint is enforced in + # the organization policy. For more information, see the + # Compute Engine section, + # [Checking whether nested virtualization is + # allowed](https://cloud.google.com/compute/docs/instances/nested-virtualization/managing-constraint#checking_whether_nested_virtualization_is_allowed). + # * **Performance**: nested VMs might experience a 10% or greater + # decrease in performance for workloads that are CPU-bound and + # possibly greater than a 10% decrease for workloads that are + # input/output bound. + # * **Machine Type**: nested virtualization can only be enabled on + # workstation configurations that specify a + # {::Google::Cloud::Workstations::V1::WorkstationConfig::Host::GceInstance#machine_type machine_type} + # in the N1 or N2 machine series. + # * **GPUs**: nested virtualization may not be enabled on workstation + # configurations with accelerators. + # * **Operating System**: Because + # [Container-Optimized + # OS](https://cloud.google.com/compute/docs/images/os-details#container-optimized_os_cos) + # does not support nested virtualization, when nested virtualization is + # enabled, the underlying Compute Engine VM instances boot from an + # [Ubuntu + # LTS](https://cloud.google.com/compute/docs/images/os-details#ubuntu_lts) + # image. + # @!attribute [rw] shielded_instance_config + # @return [::Google::Cloud::Workstations::V1::WorkstationConfig::Host::GceInstance::GceShieldedInstanceConfig] + # Optional. A set of Compute Engine Shielded instance options. + # @!attribute [rw] confidential_instance_config + # @return [::Google::Cloud::Workstations::V1::WorkstationConfig::Host::GceInstance::GceConfidentialInstanceConfig] + # Optional. A set of Compute Engine Confidential VM instance options. + # @!attribute [rw] boot_disk_size_gb + # @return [::Integer] + # Optional. The size of the boot disk for the VM in gigabytes (GB). + # The minimum boot disk size is `30` GB. Defaults to `50` GB. + class GceInstance + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # A set of Compute Engine Shielded instance options. + # @!attribute [rw] enable_secure_boot + # @return [::Boolean] + # Optional. Whether the instance has Secure Boot enabled. + # @!attribute [rw] enable_vtpm + # @return [::Boolean] + # Optional. Whether the instance has the vTPM enabled. + # @!attribute [rw] enable_integrity_monitoring + # @return [::Boolean] + # Optional. Whether the instance has integrity monitoring enabled. + class GceShieldedInstanceConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A set of Compute Engine Confidential VM instance options. + # @!attribute [rw] enable_confidential_compute + # @return [::Boolean] + # Optional. Whether the instance has confidential compute enabled. + class GceConfidentialInstanceConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + + # A directory to persist across workstation sessions. + # @!attribute [rw] gce_pd + # @return [::Google::Cloud::Workstations::V1::WorkstationConfig::PersistentDirectory::GceRegionalPersistentDisk] + # A PersistentDirectory backed by a Compute Engine persistent disk. + # @!attribute [rw] mount_path + # @return [::String] + # Optional. Location of this directory in the running workstation. + class PersistentDirectory + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # A PersistentDirectory backed by a Compute Engine regional persistent + # disk. The + # {::Google::Cloud::Workstations::V1::WorkstationConfig#persistent_directories persistent_directories} + # field is repeated, but it may contain only one entry. It creates a + # [persistent + # disk](https://cloud.google.com/compute/docs/disks/persistent-disks) that + # mounts to the workstation VM at `/home` when the session starts and + # detaches when the session ends. If this field is empty, workstations + # created with this configuration do not have a persistent home + # directory. + # @!attribute [rw] size_gb + # @return [::Integer] + # Optional. The GB capacity of a persistent home directory for each + # workstation created with this configuration. Must be empty if + # {::Google::Cloud::Workstations::V1::WorkstationConfig::PersistentDirectory::GceRegionalPersistentDisk#source_snapshot source_snapshot} + # is set. + # + # Valid values are `10`, `50`, `100`, `200`, `500`, or `1000`. + # Defaults to `200`. If less than `200` GB, the + # {::Google::Cloud::Workstations::V1::WorkstationConfig::PersistentDirectory::GceRegionalPersistentDisk#disk_type disk_type} + # must be + # `"pd-balanced"` or `"pd-ssd"`. + # @!attribute [rw] fs_type + # @return [::String] + # Optional. Type of file system that the disk should be formatted with. + # The workstation image must support this file system type. Must be empty + # if + # {::Google::Cloud::Workstations::V1::WorkstationConfig::PersistentDirectory::GceRegionalPersistentDisk#source_snapshot source_snapshot} + # is set. Defaults to `"ext4"`. + # @!attribute [rw] disk_type + # @return [::String] + # Optional. The [type of the persistent + # disk](https://cloud.google.com/compute/docs/disks#disk-types) for the + # home directory. Defaults to `"pd-standard"`. + # @!attribute [rw] source_snapshot + # @return [::String] + # Optional. Name of the snapshot to use as the source for the disk. If + # set, + # {::Google::Cloud::Workstations::V1::WorkstationConfig::PersistentDirectory::GceRegionalPersistentDisk#size_gb size_gb} + # and + # {::Google::Cloud::Workstations::V1::WorkstationConfig::PersistentDirectory::GceRegionalPersistentDisk#fs_type fs_type} + # must be empty. + # @!attribute [rw] reclaim_policy + # @return [::Google::Cloud::Workstations::V1::WorkstationConfig::PersistentDirectory::GceRegionalPersistentDisk::ReclaimPolicy] + # Optional. Whether the persistent disk should be deleted when the + # workstation is deleted. Valid values are `DELETE` and `RETAIN`. + # Defaults to `DELETE`. + class GceRegionalPersistentDisk + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Value representing what should happen to the disk after the workstation + # is deleted. + module ReclaimPolicy + # Do not use. + RECLAIM_POLICY_UNSPECIFIED = 0 + + # Delete the persistent disk when deleting the workstation. + DELETE = 1 + + # Keep the persistent disk when deleting the workstation. + # An administrator must manually delete the disk. + RETAIN = 2 + end + end + end + + # A Docker container. + # @!attribute [rw] image + # @return [::String] + # Optional. A Docker container image that defines a custom environment. + # + # Cloud Workstations provides a number of + # [preconfigured + # images](https://cloud.google.com/workstations/docs/preconfigured-base-images), + # but you can create your own + # [custom container + # images](https://cloud.google.com/workstations/docs/custom-container-images). + # If using a private image, the `host.gceInstance.serviceAccount` field + # must be specified in the workstation configuration and must have + # permission to pull the specified image. Otherwise, the image must be + # publicly accessible. + # @!attribute [rw] command + # @return [::Array<::String>] + # Optional. If set, overrides the default ENTRYPOINT specified by the + # image. + # @!attribute [rw] args + # @return [::Array<::String>] + # Optional. Arguments passed to the entrypoint. + # @!attribute [rw] env + # @return [::Google::Protobuf::Map{::String => ::String}] + # Optional. Environment variables passed to the container's entrypoint. + # @!attribute [rw] working_dir + # @return [::String] + # Optional. If set, overrides the default DIR specified by the image. + # @!attribute [rw] run_as_user + # @return [::Integer] + # Optional. If set, overrides the USER specified in the image with the + # given uid. + class Container + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class EnvEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # A customer-managed encryption key (CMEK) for the Compute Engine + # resources of the associated workstation configuration. Specify the name of + # your Cloud KMS encryption key and the default service account. + # We recommend that you use a separate service account and follow + # [Cloud KMS best + # practices](https://cloud.google.com/kms/docs/separation-of-duties). + # @!attribute [rw] kms_key + # @return [::String] + # Immutable. The name of the Google Cloud KMS encryption key. For example, + # `"projects/PROJECT_ID/locations/REGION/keyRings/KEY_RING/cryptoKeys/KEY_NAME"`. + # The key must be in the same region as the workstation configuration. + # @!attribute [rw] kms_key_service_account + # @return [::String] + # Immutable. The service account to use with the specified + # KMS key. We recommend that you use a separate service account + # and follow KMS best practices. For more information, see + # [Separation of + # duties](https://cloud.google.com/kms/docs/separation-of-duties) and + # `gcloud kms keys add-iam-policy-binding` + # [`--member`](https://cloud.google.com/sdk/gcloud/reference/kms/keys/add-iam-policy-binding#--member). + class CustomerEncryptionKey + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A readiness check to be performed on a workstation. + # @!attribute [rw] path + # @return [::String] + # Optional. Path to which the request should be sent. + # @!attribute [rw] port + # @return [::Integer] + # Optional. Port to which the request should be sent. + class ReadinessCheck + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class AnnotationsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class LabelsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # A single instance of a developer workstation with its own persistent storage. + # @!attribute [rw] name + # @return [::String] + # Full name of this workstation. + # @!attribute [rw] display_name + # @return [::String] + # Optional. Human-readable name for this workstation. + # @!attribute [r] uid + # @return [::String] + # Output only. A system-assigned unique identifier for this workstation. + # @!attribute [r] reconciling + # @return [::Boolean] + # Output only. Indicates whether this workstation is currently being updated + # to match its intended state. + # @!attribute [rw] annotations + # @return [::Google::Protobuf::Map{::String => ::String}] + # Optional. Client-specified annotations. + # @!attribute [rw] labels + # @return [::Google::Protobuf::Map{::String => ::String}] + # Optional. + # [Labels](https://cloud.google.com/workstations/docs/label-resources) that + # are applied to the workstation and that are also propagated to the + # underlying Compute Engine resources. + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Time when this workstation was created. + # @!attribute [r] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Time when this workstation was most recently updated. + # @!attribute [r] start_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Time when this workstation was most recently successfully + # started, regardless of the workstation's initial state. + # @!attribute [r] delete_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Time when this workstation was soft-deleted. + # @!attribute [rw] etag + # @return [::String] + # Optional. Checksum computed by the server. May be sent on update and delete + # requests to make sure that the client has an up-to-date value before + # proceeding. + # @!attribute [r] state + # @return [::Google::Cloud::Workstations::V1::Workstation::State] + # Output only. Current state of the workstation. + # @!attribute [r] host + # @return [::String] + # Output only. Host to which clients can send HTTPS traffic that will be + # received by the workstation. Authorized traffic will be received to the + # workstation as HTTP on port 80. To send traffic to a different port, + # clients may prefix the host with the destination port in the format + # `{port}-{host}`. + class Workstation + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class AnnotationsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class LabelsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Whether a workstation is running and ready to receive user requests. + module State + # Do not use. + STATE_UNSPECIFIED = 0 + + # The workstation is not yet ready to accept requests from users but will + # be soon. + STATE_STARTING = 1 + + # The workstation is ready to accept requests from users. + STATE_RUNNING = 2 + + # The workstation is being stopped. + STATE_STOPPING = 3 + + # The workstation is stopped and will not be able to receive requests until + # it is started. + STATE_STOPPED = 4 + end + end + + # Request message for GetWorkstationCluster. + # @!attribute [rw] name + # @return [::String] + # Required. Name of the requested resource. + class GetWorkstationClusterRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for ListWorkstationClusters. + # @!attribute [rw] parent + # @return [::String] + # Required. Parent resource name. + # @!attribute [rw] page_size + # @return [::Integer] + # Optional. Maximum number of items to return. + # @!attribute [rw] page_token + # @return [::String] + # Optional. next_page_token value returned from a previous List request, if + # any. + class ListWorkstationClustersRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for ListWorkstationClusters. + # @!attribute [rw] workstation_clusters + # @return [::Array<::Google::Cloud::Workstations::V1::WorkstationCluster>] + # The requested workstation clusters. + # @!attribute [rw] next_page_token + # @return [::String] + # Token to retrieve the next page of results, or empty if there are no more + # results in the list. + # @!attribute [rw] unreachable + # @return [::Array<::String>] + # Unreachable resources. + class ListWorkstationClustersResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Message for creating a CreateWorkstationCluster. + # @!attribute [rw] parent + # @return [::String] + # Required. Parent resource name. + # @!attribute [rw] workstation_cluster_id + # @return [::String] + # Required. ID to use for the workstation cluster. + # @!attribute [rw] workstation_cluster + # @return [::Google::Cloud::Workstations::V1::WorkstationCluster] + # Required. Workstation cluster to create. + # @!attribute [rw] validate_only + # @return [::Boolean] + # Optional. If set, validate the request and preview the review, but do not + # actually apply it. + class CreateWorkstationClusterRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for UpdateWorkstationCluster. + # @!attribute [rw] workstation_cluster + # @return [::Google::Cloud::Workstations::V1::WorkstationCluster] + # Required. Workstation cluster to update. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # Required. Mask that specifies which fields in the workstation cluster + # should be updated. + # @!attribute [rw] validate_only + # @return [::Boolean] + # Optional. If set, validate the request and preview the review, but do not + # actually apply it. + # @!attribute [rw] allow_missing + # @return [::Boolean] + # Optional. If set, and the workstation cluster is not found, a new + # workstation cluster will be created. In this situation, update_mask is + # ignored. + class UpdateWorkstationClusterRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Message for deleting a workstation cluster. + # @!attribute [rw] name + # @return [::String] + # Required. Name of the workstation cluster to delete. + # @!attribute [rw] validate_only + # @return [::Boolean] + # Optional. If set, validate the request and preview the review, but do not + # apply it. + # @!attribute [rw] etag + # @return [::String] + # Optional. If set, the request will be rejected if the latest version of the + # workstation cluster on the server does not have this ETag. + # @!attribute [rw] force + # @return [::Boolean] + # Optional. If set, any workstation configurations and workstations in the + # workstation cluster are also deleted. Otherwise, the request only + # works if the workstation cluster has no configurations or workstations. + class DeleteWorkstationClusterRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for GetWorkstationConfig. + # @!attribute [rw] name + # @return [::String] + # Required. Name of the requested resource. + class GetWorkstationConfigRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for ListWorkstationConfigs. + # @!attribute [rw] parent + # @return [::String] + # Required. Parent resource name. + # @!attribute [rw] page_size + # @return [::Integer] + # Optional. Maximum number of items to return. + # @!attribute [rw] page_token + # @return [::String] + # Optional. next_page_token value returned from a previous List request, if + # any. + class ListWorkstationConfigsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for ListWorkstationConfigs. + # @!attribute [rw] workstation_configs + # @return [::Array<::Google::Cloud::Workstations::V1::WorkstationConfig>] + # The requested configs. + # @!attribute [rw] next_page_token + # @return [::String] + # Token to retrieve the next page of results, or empty if there are no more + # results in the list. + # @!attribute [rw] unreachable + # @return [::Array<::String>] + # Unreachable resources. + class ListWorkstationConfigsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for ListUsableWorkstationConfigs. + # @!attribute [rw] parent + # @return [::String] + # Required. Parent resource name. + # @!attribute [rw] page_size + # @return [::Integer] + # Optional. Maximum number of items to return. + # @!attribute [rw] page_token + # @return [::String] + # Optional. next_page_token value returned from a previous List request, if + # any. + class ListUsableWorkstationConfigsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for ListUsableWorkstationConfigs. + # @!attribute [rw] workstation_configs + # @return [::Array<::Google::Cloud::Workstations::V1::WorkstationConfig>] + # The requested configs. + # @!attribute [rw] next_page_token + # @return [::String] + # Token to retrieve the next page of results, or empty if there are no more + # results in the list. + # @!attribute [rw] unreachable + # @return [::Array<::String>] + # Unreachable resources. + class ListUsableWorkstationConfigsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Message for creating a CreateWorkstationConfig. + # @!attribute [rw] parent + # @return [::String] + # Required. Parent resource name. + # @!attribute [rw] workstation_config_id + # @return [::String] + # Required. ID to use for the workstation configuration. + # @!attribute [rw] workstation_config + # @return [::Google::Cloud::Workstations::V1::WorkstationConfig] + # Required. Config to create. + # @!attribute [rw] validate_only + # @return [::Boolean] + # Optional. If set, validate the request and preview the review, but do not + # actually apply it. + class CreateWorkstationConfigRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for UpdateWorkstationConfig. + # @!attribute [rw] workstation_config + # @return [::Google::Cloud::Workstations::V1::WorkstationConfig] + # Required. Config to update. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # Required. Mask specifying which fields in the workstation configuration + # should be updated. + # @!attribute [rw] validate_only + # @return [::Boolean] + # Optional. If set, validate the request and preview the review, but do not + # actually apply it. + # @!attribute [rw] allow_missing + # @return [::Boolean] + # Optional. If set and the workstation configuration is not found, a new + # workstation configuration will be created. In this situation, + # update_mask is ignored. + class UpdateWorkstationConfigRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Message for deleting a workstation configuration. + # @!attribute [rw] name + # @return [::String] + # Required. Name of the workstation configuration to delete. + # @!attribute [rw] validate_only + # @return [::Boolean] + # Optional. If set, validate the request and preview the review, but do not + # actually apply it. + # @!attribute [rw] etag + # @return [::String] + # Optional. If set, the request is rejected if the latest version of the + # workstation configuration on the server does not have this ETag. + # @!attribute [rw] force + # @return [::Boolean] + # Optional. If set, any workstations in the workstation configuration are + # also deleted. Otherwise, the request works only if the workstation + # configuration has no workstations. + class DeleteWorkstationConfigRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for GetWorkstation. + # @!attribute [rw] name + # @return [::String] + # Required. Name of the requested resource. + class GetWorkstationRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for ListWorkstations. + # @!attribute [rw] parent + # @return [::String] + # Required. Parent resource name. + # @!attribute [rw] page_size + # @return [::Integer] + # Optional. Maximum number of items to return. + # @!attribute [rw] page_token + # @return [::String] + # Optional. next_page_token value returned from a previous List request, if + # any. + class ListWorkstationsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for ListWorkstations. + # @!attribute [rw] workstations + # @return [::Array<::Google::Cloud::Workstations::V1::Workstation>] + # The requested workstations. + # @!attribute [rw] next_page_token + # @return [::String] + # Optional. Token to retrieve the next page of results, or empty if there are + # no more results in the list. + # @!attribute [rw] unreachable + # @return [::Array<::String>] + # Optional. Unreachable resources. + class ListWorkstationsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for ListUsableWorkstations. + # @!attribute [rw] parent + # @return [::String] + # Required. Parent resource name. + # @!attribute [rw] page_size + # @return [::Integer] + # Optional. Maximum number of items to return. + # @!attribute [rw] page_token + # @return [::String] + # Optional. next_page_token value returned from a previous List request, if + # any. + class ListUsableWorkstationsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for ListUsableWorkstations. + # @!attribute [rw] workstations + # @return [::Array<::Google::Cloud::Workstations::V1::Workstation>] + # The requested workstations. + # @!attribute [rw] next_page_token + # @return [::String] + # Token to retrieve the next page of results, or empty if there are no more + # results in the list. + # @!attribute [rw] unreachable + # @return [::Array<::String>] + # Unreachable resources. + class ListUsableWorkstationsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Message for creating a CreateWorkstation. + # @!attribute [rw] parent + # @return [::String] + # Required. Parent resource name. + # @!attribute [rw] workstation_id + # @return [::String] + # Required. ID to use for the workstation. + # @!attribute [rw] workstation + # @return [::Google::Cloud::Workstations::V1::Workstation] + # Required. Workstation to create. + # @!attribute [rw] validate_only + # @return [::Boolean] + # Optional. If set, validate the request and preview the review, but do not + # actually apply it. + class CreateWorkstationRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for UpdateWorkstation. + # @!attribute [rw] workstation + # @return [::Google::Cloud::Workstations::V1::Workstation] + # Required. Workstation to update. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # Required. Mask specifying which fields in the workstation configuration + # should be updated. + # @!attribute [rw] validate_only + # @return [::Boolean] + # Optional. If set, validate the request and preview the review, but do not + # actually apply it. + # @!attribute [rw] allow_missing + # @return [::Boolean] + # Optional. If set and the workstation configuration is not found, a new + # workstation configuration is created. In this situation, update_mask + # is ignored. + class UpdateWorkstationRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for DeleteWorkstation. + # @!attribute [rw] name + # @return [::String] + # Required. Name of the workstation to delete. + # @!attribute [rw] validate_only + # @return [::Boolean] + # Optional. If set, validate the request and preview the review, but do not + # actually apply it. + # @!attribute [rw] etag + # @return [::String] + # Optional. If set, the request will be rejected if the latest version of the + # workstation on the server does not have this ETag. + class DeleteWorkstationRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for StartWorkstation. + # @!attribute [rw] name + # @return [::String] + # Required. Name of the workstation to start. + # @!attribute [rw] validate_only + # @return [::Boolean] + # Optional. If set, validate the request and preview the review, but do not + # actually apply it. + # @!attribute [rw] etag + # @return [::String] + # Optional. If set, the request will be rejected if the latest version of the + # workstation on the server does not have this ETag. + class StartWorkstationRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for StopWorkstation. + # @!attribute [rw] name + # @return [::String] + # Required. Name of the workstation to stop. + # @!attribute [rw] validate_only + # @return [::Boolean] + # Optional. If set, validate the request and preview the review, but do not + # actually apply it. + # @!attribute [rw] etag + # @return [::String] + # Optional. If set, the request will be rejected if the latest version of the + # workstation on the server does not have this ETag. + class StopWorkstationRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for GenerateAccessToken. + # @!attribute [rw] expire_time + # @return [::Google::Protobuf::Timestamp] + # Desired expiration time of the access token. This value must + # be at most 24 hours in the future. If a value is not specified, the + # token's expiration time will be set to a default value of 1 hour in the + # future. + # + # 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] + # Desired lifetime duration of the access token. This value must + # be at most 24 hours. If a value is not specified, the token's lifetime + # will be set to a default value of 1 hour. + # + # 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 [rw] workstation + # @return [::String] + # Required. Name of the workstation for which the access token should be + # generated. + class GenerateAccessTokenRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for GenerateAccessToken. + # @!attribute [rw] access_token + # @return [::String] + # The generated bearer access token. To use this token, include it in an + # Authorization header of an HTTP request sent to the associated + # workstation's hostname—for example, `Authorization: Bearer + # `. + # @!attribute [rw] expire_time + # @return [::Google::Protobuf::Timestamp] + # Time at which the generated token will expire. + class GenerateAccessTokenResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Metadata for long-running operations. + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Time that the operation was created. + # @!attribute [r] end_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Time that the operation finished running. + # @!attribute [r] target + # @return [::String] + # Output only. Server-defined resource path for the target of the operation. + # @!attribute [r] verb + # @return [::String] + # Output only. Name of the verb executed by the operation. + # @!attribute [r] status_message + # @return [::String] + # Output only. Human-readable status of the operation, if any. + # @!attribute [r] requested_cancellation + # @return [::Boolean] + # Output only. Identifies whether the user has requested cancellation + # of the operation. + # @!attribute [r] api_version + # @return [::String] + # Output only. API version used to start the operation. + class OperationMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-workstations-v1/proto_docs/google/longrunning/operations.rb b/owl-bot-staging/google-cloud-workstations-v1/proto_docs/google/longrunning/operations.rb new file mode 100644 index 000000000000..7a757f512165 --- /dev/null +++ b/owl-bot-staging/google-cloud-workstations-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-workstations-v1/proto_docs/google/protobuf/any.rb b/owl-bot-staging/google-cloud-workstations-v1/proto_docs/google/protobuf/any.rb new file mode 100644 index 000000000000..58691995f02e --- /dev/null +++ b/owl-bot-staging/google-cloud-workstations-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-workstations-v1/proto_docs/google/protobuf/duration.rb b/owl-bot-staging/google-cloud-workstations-v1/proto_docs/google/protobuf/duration.rb new file mode 100644 index 000000000000..ea59f1f91daf --- /dev/null +++ b/owl-bot-staging/google-cloud-workstations-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-workstations-v1/proto_docs/google/protobuf/empty.rb b/owl-bot-staging/google-cloud-workstations-v1/proto_docs/google/protobuf/empty.rb new file mode 100644 index 000000000000..83e4481834a6 --- /dev/null +++ b/owl-bot-staging/google-cloud-workstations-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-workstations-v1/proto_docs/google/protobuf/field_mask.rb b/owl-bot-staging/google-cloud-workstations-v1/proto_docs/google/protobuf/field_mask.rb new file mode 100644 index 000000000000..7f3ffc78601a --- /dev/null +++ b/owl-bot-staging/google-cloud-workstations-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-workstations-v1/proto_docs/google/protobuf/timestamp.rb b/owl-bot-staging/google-cloud-workstations-v1/proto_docs/google/protobuf/timestamp.rb new file mode 100644 index 000000000000..74352be9c58c --- /dev/null +++ b/owl-bot-staging/google-cloud-workstations-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-workstations-v1/proto_docs/google/rpc/status.rb b/owl-bot-staging/google-cloud-workstations-v1/proto_docs/google/rpc/status.rb new file mode 100644 index 000000000000..c1a1c07eb2db --- /dev/null +++ b/owl-bot-staging/google-cloud-workstations-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-workstations-v1/proto_docs/google/type/expr.rb b/owl-bot-staging/google-cloud-workstations-v1/proto_docs/google/type/expr.rb new file mode 100644 index 000000000000..53e7733b6592 --- /dev/null +++ b/owl-bot-staging/google-cloud-workstations-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-workstations-v1/snippets/Gemfile b/owl-bot-staging/google-cloud-workstations-v1/snippets/Gemfile new file mode 100644 index 000000000000..a1469457e584 --- /dev/null +++ b/owl-bot-staging/google-cloud-workstations-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-workstations-v1", path: "../" +else + gem "google-cloud-workstations-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-workstations-v1/snippets/snippet_metadata_google.cloud.workstations.v1.json b/owl-bot-staging/google-cloud-workstations-v1/snippets/snippet_metadata_google.cloud.workstations.v1.json new file mode 100644 index 000000000000..e900c252d0bb --- /dev/null +++ b/owl-bot-staging/google-cloud-workstations-v1/snippets/snippet_metadata_google.cloud.workstations.v1.json @@ -0,0 +1,815 @@ +{ + "client_library": { + "name": "google-cloud-workstations-v1", + "version": "", + "language": "RUBY", + "apis": [ + { + "id": "google.cloud.workstations.v1", + "version": "v1" + } + ] + }, + "snippets": [ + { + "region_tag": "workstations_v1_generated_Workstations_GetWorkstationCluster_sync", + "title": "Snippet for the get_workstation_cluster call in the Workstations service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Workstations::V1::Workstations::Client#get_workstation_cluster.", + "file": "workstations/get_workstation_cluster.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_workstation_cluster", + "full_name": "::Google::Cloud::Workstations::V1::Workstations::Client#get_workstation_cluster", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Workstations::V1::GetWorkstationClusterRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Workstations::V1::WorkstationCluster", + "client": { + "short_name": "Workstations::Client", + "full_name": "::Google::Cloud::Workstations::V1::Workstations::Client" + }, + "method": { + "short_name": "GetWorkstationCluster", + "full_name": "google.cloud.workstations.v1.Workstations.GetWorkstationCluster", + "service": { + "short_name": "Workstations", + "full_name": "google.cloud.workstations.v1.Workstations" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "workstations_v1_generated_Workstations_ListWorkstationClusters_sync", + "title": "Snippet for the list_workstation_clusters call in the Workstations service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Workstations::V1::Workstations::Client#list_workstation_clusters.", + "file": "workstations/list_workstation_clusters.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_workstation_clusters", + "full_name": "::Google::Cloud::Workstations::V1::Workstations::Client#list_workstation_clusters", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Workstations::V1::ListWorkstationClustersRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Workstations::V1::ListWorkstationClustersResponse", + "client": { + "short_name": "Workstations::Client", + "full_name": "::Google::Cloud::Workstations::V1::Workstations::Client" + }, + "method": { + "short_name": "ListWorkstationClusters", + "full_name": "google.cloud.workstations.v1.Workstations.ListWorkstationClusters", + "service": { + "short_name": "Workstations", + "full_name": "google.cloud.workstations.v1.Workstations" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "workstations_v1_generated_Workstations_CreateWorkstationCluster_sync", + "title": "Snippet for the create_workstation_cluster call in the Workstations service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Workstations::V1::Workstations::Client#create_workstation_cluster.", + "file": "workstations/create_workstation_cluster.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_workstation_cluster", + "full_name": "::Google::Cloud::Workstations::V1::Workstations::Client#create_workstation_cluster", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Workstations::V1::CreateWorkstationClusterRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "Workstations::Client", + "full_name": "::Google::Cloud::Workstations::V1::Workstations::Client" + }, + "method": { + "short_name": "CreateWorkstationCluster", + "full_name": "google.cloud.workstations.v1.Workstations.CreateWorkstationCluster", + "service": { + "short_name": "Workstations", + "full_name": "google.cloud.workstations.v1.Workstations" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "workstations_v1_generated_Workstations_UpdateWorkstationCluster_sync", + "title": "Snippet for the update_workstation_cluster call in the Workstations service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Workstations::V1::Workstations::Client#update_workstation_cluster.", + "file": "workstations/update_workstation_cluster.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_workstation_cluster", + "full_name": "::Google::Cloud::Workstations::V1::Workstations::Client#update_workstation_cluster", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Workstations::V1::UpdateWorkstationClusterRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "Workstations::Client", + "full_name": "::Google::Cloud::Workstations::V1::Workstations::Client" + }, + "method": { + "short_name": "UpdateWorkstationCluster", + "full_name": "google.cloud.workstations.v1.Workstations.UpdateWorkstationCluster", + "service": { + "short_name": "Workstations", + "full_name": "google.cloud.workstations.v1.Workstations" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "workstations_v1_generated_Workstations_DeleteWorkstationCluster_sync", + "title": "Snippet for the delete_workstation_cluster call in the Workstations service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Workstations::V1::Workstations::Client#delete_workstation_cluster.", + "file": "workstations/delete_workstation_cluster.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_workstation_cluster", + "full_name": "::Google::Cloud::Workstations::V1::Workstations::Client#delete_workstation_cluster", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Workstations::V1::DeleteWorkstationClusterRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "Workstations::Client", + "full_name": "::Google::Cloud::Workstations::V1::Workstations::Client" + }, + "method": { + "short_name": "DeleteWorkstationCluster", + "full_name": "google.cloud.workstations.v1.Workstations.DeleteWorkstationCluster", + "service": { + "short_name": "Workstations", + "full_name": "google.cloud.workstations.v1.Workstations" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "workstations_v1_generated_Workstations_GetWorkstationConfig_sync", + "title": "Snippet for the get_workstation_config call in the Workstations service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Workstations::V1::Workstations::Client#get_workstation_config.", + "file": "workstations/get_workstation_config.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_workstation_config", + "full_name": "::Google::Cloud::Workstations::V1::Workstations::Client#get_workstation_config", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Workstations::V1::GetWorkstationConfigRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Workstations::V1::WorkstationConfig", + "client": { + "short_name": "Workstations::Client", + "full_name": "::Google::Cloud::Workstations::V1::Workstations::Client" + }, + "method": { + "short_name": "GetWorkstationConfig", + "full_name": "google.cloud.workstations.v1.Workstations.GetWorkstationConfig", + "service": { + "short_name": "Workstations", + "full_name": "google.cloud.workstations.v1.Workstations" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "workstations_v1_generated_Workstations_ListWorkstationConfigs_sync", + "title": "Snippet for the list_workstation_configs call in the Workstations service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Workstations::V1::Workstations::Client#list_workstation_configs.", + "file": "workstations/list_workstation_configs.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_workstation_configs", + "full_name": "::Google::Cloud::Workstations::V1::Workstations::Client#list_workstation_configs", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Workstations::V1::ListWorkstationConfigsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Workstations::V1::ListWorkstationConfigsResponse", + "client": { + "short_name": "Workstations::Client", + "full_name": "::Google::Cloud::Workstations::V1::Workstations::Client" + }, + "method": { + "short_name": "ListWorkstationConfigs", + "full_name": "google.cloud.workstations.v1.Workstations.ListWorkstationConfigs", + "service": { + "short_name": "Workstations", + "full_name": "google.cloud.workstations.v1.Workstations" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "workstations_v1_generated_Workstations_ListUsableWorkstationConfigs_sync", + "title": "Snippet for the list_usable_workstation_configs call in the Workstations service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Workstations::V1::Workstations::Client#list_usable_workstation_configs.", + "file": "workstations/list_usable_workstation_configs.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_usable_workstation_configs", + "full_name": "::Google::Cloud::Workstations::V1::Workstations::Client#list_usable_workstation_configs", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Workstations::V1::ListUsableWorkstationConfigsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Workstations::V1::ListUsableWorkstationConfigsResponse", + "client": { + "short_name": "Workstations::Client", + "full_name": "::Google::Cloud::Workstations::V1::Workstations::Client" + }, + "method": { + "short_name": "ListUsableWorkstationConfigs", + "full_name": "google.cloud.workstations.v1.Workstations.ListUsableWorkstationConfigs", + "service": { + "short_name": "Workstations", + "full_name": "google.cloud.workstations.v1.Workstations" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "workstations_v1_generated_Workstations_CreateWorkstationConfig_sync", + "title": "Snippet for the create_workstation_config call in the Workstations service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Workstations::V1::Workstations::Client#create_workstation_config.", + "file": "workstations/create_workstation_config.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_workstation_config", + "full_name": "::Google::Cloud::Workstations::V1::Workstations::Client#create_workstation_config", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Workstations::V1::CreateWorkstationConfigRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "Workstations::Client", + "full_name": "::Google::Cloud::Workstations::V1::Workstations::Client" + }, + "method": { + "short_name": "CreateWorkstationConfig", + "full_name": "google.cloud.workstations.v1.Workstations.CreateWorkstationConfig", + "service": { + "short_name": "Workstations", + "full_name": "google.cloud.workstations.v1.Workstations" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "workstations_v1_generated_Workstations_UpdateWorkstationConfig_sync", + "title": "Snippet for the update_workstation_config call in the Workstations service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Workstations::V1::Workstations::Client#update_workstation_config.", + "file": "workstations/update_workstation_config.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_workstation_config", + "full_name": "::Google::Cloud::Workstations::V1::Workstations::Client#update_workstation_config", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Workstations::V1::UpdateWorkstationConfigRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "Workstations::Client", + "full_name": "::Google::Cloud::Workstations::V1::Workstations::Client" + }, + "method": { + "short_name": "UpdateWorkstationConfig", + "full_name": "google.cloud.workstations.v1.Workstations.UpdateWorkstationConfig", + "service": { + "short_name": "Workstations", + "full_name": "google.cloud.workstations.v1.Workstations" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "workstations_v1_generated_Workstations_DeleteWorkstationConfig_sync", + "title": "Snippet for the delete_workstation_config call in the Workstations service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Workstations::V1::Workstations::Client#delete_workstation_config.", + "file": "workstations/delete_workstation_config.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_workstation_config", + "full_name": "::Google::Cloud::Workstations::V1::Workstations::Client#delete_workstation_config", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Workstations::V1::DeleteWorkstationConfigRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "Workstations::Client", + "full_name": "::Google::Cloud::Workstations::V1::Workstations::Client" + }, + "method": { + "short_name": "DeleteWorkstationConfig", + "full_name": "google.cloud.workstations.v1.Workstations.DeleteWorkstationConfig", + "service": { + "short_name": "Workstations", + "full_name": "google.cloud.workstations.v1.Workstations" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "workstations_v1_generated_Workstations_GetWorkstation_sync", + "title": "Snippet for the get_workstation call in the Workstations service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Workstations::V1::Workstations::Client#get_workstation.", + "file": "workstations/get_workstation.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_workstation", + "full_name": "::Google::Cloud::Workstations::V1::Workstations::Client#get_workstation", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Workstations::V1::GetWorkstationRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Workstations::V1::Workstation", + "client": { + "short_name": "Workstations::Client", + "full_name": "::Google::Cloud::Workstations::V1::Workstations::Client" + }, + "method": { + "short_name": "GetWorkstation", + "full_name": "google.cloud.workstations.v1.Workstations.GetWorkstation", + "service": { + "short_name": "Workstations", + "full_name": "google.cloud.workstations.v1.Workstations" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "workstations_v1_generated_Workstations_ListWorkstations_sync", + "title": "Snippet for the list_workstations call in the Workstations service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Workstations::V1::Workstations::Client#list_workstations.", + "file": "workstations/list_workstations.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_workstations", + "full_name": "::Google::Cloud::Workstations::V1::Workstations::Client#list_workstations", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Workstations::V1::ListWorkstationsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Workstations::V1::ListWorkstationsResponse", + "client": { + "short_name": "Workstations::Client", + "full_name": "::Google::Cloud::Workstations::V1::Workstations::Client" + }, + "method": { + "short_name": "ListWorkstations", + "full_name": "google.cloud.workstations.v1.Workstations.ListWorkstations", + "service": { + "short_name": "Workstations", + "full_name": "google.cloud.workstations.v1.Workstations" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "workstations_v1_generated_Workstations_ListUsableWorkstations_sync", + "title": "Snippet for the list_usable_workstations call in the Workstations service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Workstations::V1::Workstations::Client#list_usable_workstations.", + "file": "workstations/list_usable_workstations.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_usable_workstations", + "full_name": "::Google::Cloud::Workstations::V1::Workstations::Client#list_usable_workstations", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Workstations::V1::ListUsableWorkstationsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Workstations::V1::ListUsableWorkstationsResponse", + "client": { + "short_name": "Workstations::Client", + "full_name": "::Google::Cloud::Workstations::V1::Workstations::Client" + }, + "method": { + "short_name": "ListUsableWorkstations", + "full_name": "google.cloud.workstations.v1.Workstations.ListUsableWorkstations", + "service": { + "short_name": "Workstations", + "full_name": "google.cloud.workstations.v1.Workstations" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "workstations_v1_generated_Workstations_CreateWorkstation_sync", + "title": "Snippet for the create_workstation call in the Workstations service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Workstations::V1::Workstations::Client#create_workstation.", + "file": "workstations/create_workstation.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_workstation", + "full_name": "::Google::Cloud::Workstations::V1::Workstations::Client#create_workstation", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Workstations::V1::CreateWorkstationRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "Workstations::Client", + "full_name": "::Google::Cloud::Workstations::V1::Workstations::Client" + }, + "method": { + "short_name": "CreateWorkstation", + "full_name": "google.cloud.workstations.v1.Workstations.CreateWorkstation", + "service": { + "short_name": "Workstations", + "full_name": "google.cloud.workstations.v1.Workstations" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "workstations_v1_generated_Workstations_UpdateWorkstation_sync", + "title": "Snippet for the update_workstation call in the Workstations service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Workstations::V1::Workstations::Client#update_workstation.", + "file": "workstations/update_workstation.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_workstation", + "full_name": "::Google::Cloud::Workstations::V1::Workstations::Client#update_workstation", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Workstations::V1::UpdateWorkstationRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "Workstations::Client", + "full_name": "::Google::Cloud::Workstations::V1::Workstations::Client" + }, + "method": { + "short_name": "UpdateWorkstation", + "full_name": "google.cloud.workstations.v1.Workstations.UpdateWorkstation", + "service": { + "short_name": "Workstations", + "full_name": "google.cloud.workstations.v1.Workstations" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "workstations_v1_generated_Workstations_DeleteWorkstation_sync", + "title": "Snippet for the delete_workstation call in the Workstations service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Workstations::V1::Workstations::Client#delete_workstation.", + "file": "workstations/delete_workstation.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_workstation", + "full_name": "::Google::Cloud::Workstations::V1::Workstations::Client#delete_workstation", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Workstations::V1::DeleteWorkstationRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "Workstations::Client", + "full_name": "::Google::Cloud::Workstations::V1::Workstations::Client" + }, + "method": { + "short_name": "DeleteWorkstation", + "full_name": "google.cloud.workstations.v1.Workstations.DeleteWorkstation", + "service": { + "short_name": "Workstations", + "full_name": "google.cloud.workstations.v1.Workstations" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "workstations_v1_generated_Workstations_StartWorkstation_sync", + "title": "Snippet for the start_workstation call in the Workstations service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Workstations::V1::Workstations::Client#start_workstation.", + "file": "workstations/start_workstation.rb", + "language": "RUBY", + "client_method": { + "short_name": "start_workstation", + "full_name": "::Google::Cloud::Workstations::V1::Workstations::Client#start_workstation", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Workstations::V1::StartWorkstationRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "Workstations::Client", + "full_name": "::Google::Cloud::Workstations::V1::Workstations::Client" + }, + "method": { + "short_name": "StartWorkstation", + "full_name": "google.cloud.workstations.v1.Workstations.StartWorkstation", + "service": { + "short_name": "Workstations", + "full_name": "google.cloud.workstations.v1.Workstations" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "workstations_v1_generated_Workstations_StopWorkstation_sync", + "title": "Snippet for the stop_workstation call in the Workstations service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Workstations::V1::Workstations::Client#stop_workstation.", + "file": "workstations/stop_workstation.rb", + "language": "RUBY", + "client_method": { + "short_name": "stop_workstation", + "full_name": "::Google::Cloud::Workstations::V1::Workstations::Client#stop_workstation", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Workstations::V1::StopWorkstationRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "Workstations::Client", + "full_name": "::Google::Cloud::Workstations::V1::Workstations::Client" + }, + "method": { + "short_name": "StopWorkstation", + "full_name": "google.cloud.workstations.v1.Workstations.StopWorkstation", + "service": { + "short_name": "Workstations", + "full_name": "google.cloud.workstations.v1.Workstations" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "workstations_v1_generated_Workstations_GenerateAccessToken_sync", + "title": "Snippet for the generate_access_token call in the Workstations service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Workstations::V1::Workstations::Client#generate_access_token.", + "file": "workstations/generate_access_token.rb", + "language": "RUBY", + "client_method": { + "short_name": "generate_access_token", + "full_name": "::Google::Cloud::Workstations::V1::Workstations::Client#generate_access_token", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Workstations::V1::GenerateAccessTokenRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Workstations::V1::GenerateAccessTokenResponse", + "client": { + "short_name": "Workstations::Client", + "full_name": "::Google::Cloud::Workstations::V1::Workstations::Client" + }, + "method": { + "short_name": "GenerateAccessToken", + "full_name": "google.cloud.workstations.v1.Workstations.GenerateAccessToken", + "service": { + "short_name": "Workstations", + "full_name": "google.cloud.workstations.v1.Workstations" + } + } + }, + "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-workstations-v1/snippets/workstations/create_workstation.rb b/owl-bot-staging/google-cloud-workstations-v1/snippets/workstations/create_workstation.rb new file mode 100644 index 000000000000..4031f08e9005 --- /dev/null +++ b/owl-bot-staging/google-cloud-workstations-v1/snippets/workstations/create_workstation.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 workstations_v1_generated_Workstations_CreateWorkstation_sync] +require "google/cloud/workstations/v1" + +## +# Snippet for the create_workstation call in the Workstations 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::Workstations::V1::Workstations::Client#create_workstation. +# +def create_workstation + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Workstations::V1::Workstations::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Workstations::V1::CreateWorkstationRequest.new + + # Call the create_workstation method. + result = client.create_workstation 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 workstations_v1_generated_Workstations_CreateWorkstation_sync] diff --git a/owl-bot-staging/google-cloud-workstations-v1/snippets/workstations/create_workstation_cluster.rb b/owl-bot-staging/google-cloud-workstations-v1/snippets/workstations/create_workstation_cluster.rb new file mode 100644 index 000000000000..6920a957ca47 --- /dev/null +++ b/owl-bot-staging/google-cloud-workstations-v1/snippets/workstations/create_workstation_cluster.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 workstations_v1_generated_Workstations_CreateWorkstationCluster_sync] +require "google/cloud/workstations/v1" + +## +# Snippet for the create_workstation_cluster call in the Workstations 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::Workstations::V1::Workstations::Client#create_workstation_cluster. +# +def create_workstation_cluster + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Workstations::V1::Workstations::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Workstations::V1::CreateWorkstationClusterRequest.new + + # Call the create_workstation_cluster method. + result = client.create_workstation_cluster 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 workstations_v1_generated_Workstations_CreateWorkstationCluster_sync] diff --git a/owl-bot-staging/google-cloud-workstations-v1/snippets/workstations/create_workstation_config.rb b/owl-bot-staging/google-cloud-workstations-v1/snippets/workstations/create_workstation_config.rb new file mode 100644 index 000000000000..a4ee1a5ba3bd --- /dev/null +++ b/owl-bot-staging/google-cloud-workstations-v1/snippets/workstations/create_workstation_config.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 workstations_v1_generated_Workstations_CreateWorkstationConfig_sync] +require "google/cloud/workstations/v1" + +## +# Snippet for the create_workstation_config call in the Workstations 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::Workstations::V1::Workstations::Client#create_workstation_config. +# +def create_workstation_config + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Workstations::V1::Workstations::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Workstations::V1::CreateWorkstationConfigRequest.new + + # Call the create_workstation_config method. + result = client.create_workstation_config 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 workstations_v1_generated_Workstations_CreateWorkstationConfig_sync] diff --git a/owl-bot-staging/google-cloud-workstations-v1/snippets/workstations/delete_workstation.rb b/owl-bot-staging/google-cloud-workstations-v1/snippets/workstations/delete_workstation.rb new file mode 100644 index 000000000000..81660ff7e383 --- /dev/null +++ b/owl-bot-staging/google-cloud-workstations-v1/snippets/workstations/delete_workstation.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 workstations_v1_generated_Workstations_DeleteWorkstation_sync] +require "google/cloud/workstations/v1" + +## +# Snippet for the delete_workstation call in the Workstations 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::Workstations::V1::Workstations::Client#delete_workstation. +# +def delete_workstation + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Workstations::V1::Workstations::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Workstations::V1::DeleteWorkstationRequest.new + + # Call the delete_workstation method. + result = client.delete_workstation 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 workstations_v1_generated_Workstations_DeleteWorkstation_sync] diff --git a/owl-bot-staging/google-cloud-workstations-v1/snippets/workstations/delete_workstation_cluster.rb b/owl-bot-staging/google-cloud-workstations-v1/snippets/workstations/delete_workstation_cluster.rb new file mode 100644 index 000000000000..979c4987b36e --- /dev/null +++ b/owl-bot-staging/google-cloud-workstations-v1/snippets/workstations/delete_workstation_cluster.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 workstations_v1_generated_Workstations_DeleteWorkstationCluster_sync] +require "google/cloud/workstations/v1" + +## +# Snippet for the delete_workstation_cluster call in the Workstations 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::Workstations::V1::Workstations::Client#delete_workstation_cluster. +# +def delete_workstation_cluster + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Workstations::V1::Workstations::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Workstations::V1::DeleteWorkstationClusterRequest.new + + # Call the delete_workstation_cluster method. + result = client.delete_workstation_cluster 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 workstations_v1_generated_Workstations_DeleteWorkstationCluster_sync] diff --git a/owl-bot-staging/google-cloud-workstations-v1/snippets/workstations/delete_workstation_config.rb b/owl-bot-staging/google-cloud-workstations-v1/snippets/workstations/delete_workstation_config.rb new file mode 100644 index 000000000000..282347e33b9b --- /dev/null +++ b/owl-bot-staging/google-cloud-workstations-v1/snippets/workstations/delete_workstation_config.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 workstations_v1_generated_Workstations_DeleteWorkstationConfig_sync] +require "google/cloud/workstations/v1" + +## +# Snippet for the delete_workstation_config call in the Workstations 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::Workstations::V1::Workstations::Client#delete_workstation_config. +# +def delete_workstation_config + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Workstations::V1::Workstations::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Workstations::V1::DeleteWorkstationConfigRequest.new + + # Call the delete_workstation_config method. + result = client.delete_workstation_config 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 workstations_v1_generated_Workstations_DeleteWorkstationConfig_sync] diff --git a/owl-bot-staging/google-cloud-workstations-v1/snippets/workstations/generate_access_token.rb b/owl-bot-staging/google-cloud-workstations-v1/snippets/workstations/generate_access_token.rb new file mode 100644 index 000000000000..5ee1e774fee1 --- /dev/null +++ b/owl-bot-staging/google-cloud-workstations-v1/snippets/workstations/generate_access_token.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 workstations_v1_generated_Workstations_GenerateAccessToken_sync] +require "google/cloud/workstations/v1" + +## +# Snippet for the generate_access_token call in the Workstations 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::Workstations::V1::Workstations::Client#generate_access_token. +# +def generate_access_token + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Workstations::V1::Workstations::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Workstations::V1::GenerateAccessTokenRequest.new + + # Call the generate_access_token method. + result = client.generate_access_token request + + # The returned object is of type Google::Cloud::Workstations::V1::GenerateAccessTokenResponse. + p result +end +# [END workstations_v1_generated_Workstations_GenerateAccessToken_sync] diff --git a/owl-bot-staging/google-cloud-workstations-v1/snippets/workstations/get_workstation.rb b/owl-bot-staging/google-cloud-workstations-v1/snippets/workstations/get_workstation.rb new file mode 100644 index 000000000000..3f39180ba50d --- /dev/null +++ b/owl-bot-staging/google-cloud-workstations-v1/snippets/workstations/get_workstation.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 workstations_v1_generated_Workstations_GetWorkstation_sync] +require "google/cloud/workstations/v1" + +## +# Snippet for the get_workstation call in the Workstations 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::Workstations::V1::Workstations::Client#get_workstation. +# +def get_workstation + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Workstations::V1::Workstations::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Workstations::V1::GetWorkstationRequest.new + + # Call the get_workstation method. + result = client.get_workstation request + + # The returned object is of type Google::Cloud::Workstations::V1::Workstation. + p result +end +# [END workstations_v1_generated_Workstations_GetWorkstation_sync] diff --git a/owl-bot-staging/google-cloud-workstations-v1/snippets/workstations/get_workstation_cluster.rb b/owl-bot-staging/google-cloud-workstations-v1/snippets/workstations/get_workstation_cluster.rb new file mode 100644 index 000000000000..439839d2c17f --- /dev/null +++ b/owl-bot-staging/google-cloud-workstations-v1/snippets/workstations/get_workstation_cluster.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 workstations_v1_generated_Workstations_GetWorkstationCluster_sync] +require "google/cloud/workstations/v1" + +## +# Snippet for the get_workstation_cluster call in the Workstations 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::Workstations::V1::Workstations::Client#get_workstation_cluster. +# +def get_workstation_cluster + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Workstations::V1::Workstations::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Workstations::V1::GetWorkstationClusterRequest.new + + # Call the get_workstation_cluster method. + result = client.get_workstation_cluster request + + # The returned object is of type Google::Cloud::Workstations::V1::WorkstationCluster. + p result +end +# [END workstations_v1_generated_Workstations_GetWorkstationCluster_sync] diff --git a/owl-bot-staging/google-cloud-workstations-v1/snippets/workstations/get_workstation_config.rb b/owl-bot-staging/google-cloud-workstations-v1/snippets/workstations/get_workstation_config.rb new file mode 100644 index 000000000000..03403b54417f --- /dev/null +++ b/owl-bot-staging/google-cloud-workstations-v1/snippets/workstations/get_workstation_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 workstations_v1_generated_Workstations_GetWorkstationConfig_sync] +require "google/cloud/workstations/v1" + +## +# Snippet for the get_workstation_config call in the Workstations 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::Workstations::V1::Workstations::Client#get_workstation_config. +# +def get_workstation_config + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Workstations::V1::Workstations::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Workstations::V1::GetWorkstationConfigRequest.new + + # Call the get_workstation_config method. + result = client.get_workstation_config request + + # The returned object is of type Google::Cloud::Workstations::V1::WorkstationConfig. + p result +end +# [END workstations_v1_generated_Workstations_GetWorkstationConfig_sync] diff --git a/owl-bot-staging/google-cloud-workstations-v1/snippets/workstations/list_usable_workstation_configs.rb b/owl-bot-staging/google-cloud-workstations-v1/snippets/workstations/list_usable_workstation_configs.rb new file mode 100644 index 000000000000..b829c05c865c --- /dev/null +++ b/owl-bot-staging/google-cloud-workstations-v1/snippets/workstations/list_usable_workstation_configs.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 workstations_v1_generated_Workstations_ListUsableWorkstationConfigs_sync] +require "google/cloud/workstations/v1" + +## +# Snippet for the list_usable_workstation_configs call in the Workstations 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::Workstations::V1::Workstations::Client#list_usable_workstation_configs. +# +def list_usable_workstation_configs + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Workstations::V1::Workstations::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Workstations::V1::ListUsableWorkstationConfigsRequest.new + + # Call the list_usable_workstation_configs method. + result = client.list_usable_workstation_configs 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::Workstations::V1::WorkstationConfig. + p item + end +end +# [END workstations_v1_generated_Workstations_ListUsableWorkstationConfigs_sync] diff --git a/owl-bot-staging/google-cloud-workstations-v1/snippets/workstations/list_usable_workstations.rb b/owl-bot-staging/google-cloud-workstations-v1/snippets/workstations/list_usable_workstations.rb new file mode 100644 index 000000000000..d7266f51ca88 --- /dev/null +++ b/owl-bot-staging/google-cloud-workstations-v1/snippets/workstations/list_usable_workstations.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 workstations_v1_generated_Workstations_ListUsableWorkstations_sync] +require "google/cloud/workstations/v1" + +## +# Snippet for the list_usable_workstations call in the Workstations 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::Workstations::V1::Workstations::Client#list_usable_workstations. +# +def list_usable_workstations + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Workstations::V1::Workstations::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Workstations::V1::ListUsableWorkstationsRequest.new + + # Call the list_usable_workstations method. + result = client.list_usable_workstations 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::Workstations::V1::Workstation. + p item + end +end +# [END workstations_v1_generated_Workstations_ListUsableWorkstations_sync] diff --git a/owl-bot-staging/google-cloud-workstations-v1/snippets/workstations/list_workstation_clusters.rb b/owl-bot-staging/google-cloud-workstations-v1/snippets/workstations/list_workstation_clusters.rb new file mode 100644 index 000000000000..4234e04c9aee --- /dev/null +++ b/owl-bot-staging/google-cloud-workstations-v1/snippets/workstations/list_workstation_clusters.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 workstations_v1_generated_Workstations_ListWorkstationClusters_sync] +require "google/cloud/workstations/v1" + +## +# Snippet for the list_workstation_clusters call in the Workstations 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::Workstations::V1::Workstations::Client#list_workstation_clusters. +# +def list_workstation_clusters + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Workstations::V1::Workstations::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Workstations::V1::ListWorkstationClustersRequest.new + + # Call the list_workstation_clusters method. + result = client.list_workstation_clusters 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::Workstations::V1::WorkstationCluster. + p item + end +end +# [END workstations_v1_generated_Workstations_ListWorkstationClusters_sync] diff --git a/owl-bot-staging/google-cloud-workstations-v1/snippets/workstations/list_workstation_configs.rb b/owl-bot-staging/google-cloud-workstations-v1/snippets/workstations/list_workstation_configs.rb new file mode 100644 index 000000000000..8810eb261cd2 --- /dev/null +++ b/owl-bot-staging/google-cloud-workstations-v1/snippets/workstations/list_workstation_configs.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 workstations_v1_generated_Workstations_ListWorkstationConfigs_sync] +require "google/cloud/workstations/v1" + +## +# Snippet for the list_workstation_configs call in the Workstations 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::Workstations::V1::Workstations::Client#list_workstation_configs. +# +def list_workstation_configs + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Workstations::V1::Workstations::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Workstations::V1::ListWorkstationConfigsRequest.new + + # Call the list_workstation_configs method. + result = client.list_workstation_configs 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::Workstations::V1::WorkstationConfig. + p item + end +end +# [END workstations_v1_generated_Workstations_ListWorkstationConfigs_sync] diff --git a/owl-bot-staging/google-cloud-workstations-v1/snippets/workstations/list_workstations.rb b/owl-bot-staging/google-cloud-workstations-v1/snippets/workstations/list_workstations.rb new file mode 100644 index 000000000000..f667c3ea7346 --- /dev/null +++ b/owl-bot-staging/google-cloud-workstations-v1/snippets/workstations/list_workstations.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 workstations_v1_generated_Workstations_ListWorkstations_sync] +require "google/cloud/workstations/v1" + +## +# Snippet for the list_workstations call in the Workstations 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::Workstations::V1::Workstations::Client#list_workstations. +# +def list_workstations + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Workstations::V1::Workstations::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Workstations::V1::ListWorkstationsRequest.new + + # Call the list_workstations method. + result = client.list_workstations 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::Workstations::V1::Workstation. + p item + end +end +# [END workstations_v1_generated_Workstations_ListWorkstations_sync] diff --git a/owl-bot-staging/google-cloud-workstations-v1/snippets/workstations/start_workstation.rb b/owl-bot-staging/google-cloud-workstations-v1/snippets/workstations/start_workstation.rb new file mode 100644 index 000000000000..8e9f7ff1738c --- /dev/null +++ b/owl-bot-staging/google-cloud-workstations-v1/snippets/workstations/start_workstation.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 workstations_v1_generated_Workstations_StartWorkstation_sync] +require "google/cloud/workstations/v1" + +## +# Snippet for the start_workstation call in the Workstations 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::Workstations::V1::Workstations::Client#start_workstation. +# +def start_workstation + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Workstations::V1::Workstations::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Workstations::V1::StartWorkstationRequest.new + + # Call the start_workstation method. + result = client.start_workstation 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 workstations_v1_generated_Workstations_StartWorkstation_sync] diff --git a/owl-bot-staging/google-cloud-workstations-v1/snippets/workstations/stop_workstation.rb b/owl-bot-staging/google-cloud-workstations-v1/snippets/workstations/stop_workstation.rb new file mode 100644 index 000000000000..938fb5a5843f --- /dev/null +++ b/owl-bot-staging/google-cloud-workstations-v1/snippets/workstations/stop_workstation.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 workstations_v1_generated_Workstations_StopWorkstation_sync] +require "google/cloud/workstations/v1" + +## +# Snippet for the stop_workstation call in the Workstations 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::Workstations::V1::Workstations::Client#stop_workstation. +# +def stop_workstation + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Workstations::V1::Workstations::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Workstations::V1::StopWorkstationRequest.new + + # Call the stop_workstation method. + result = client.stop_workstation 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 workstations_v1_generated_Workstations_StopWorkstation_sync] diff --git a/owl-bot-staging/google-cloud-workstations-v1/snippets/workstations/update_workstation.rb b/owl-bot-staging/google-cloud-workstations-v1/snippets/workstations/update_workstation.rb new file mode 100644 index 000000000000..7b34ea13f4bb --- /dev/null +++ b/owl-bot-staging/google-cloud-workstations-v1/snippets/workstations/update_workstation.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 workstations_v1_generated_Workstations_UpdateWorkstation_sync] +require "google/cloud/workstations/v1" + +## +# Snippet for the update_workstation call in the Workstations 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::Workstations::V1::Workstations::Client#update_workstation. +# +def update_workstation + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Workstations::V1::Workstations::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Workstations::V1::UpdateWorkstationRequest.new + + # Call the update_workstation method. + result = client.update_workstation 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 workstations_v1_generated_Workstations_UpdateWorkstation_sync] diff --git a/owl-bot-staging/google-cloud-workstations-v1/snippets/workstations/update_workstation_cluster.rb b/owl-bot-staging/google-cloud-workstations-v1/snippets/workstations/update_workstation_cluster.rb new file mode 100644 index 000000000000..b2c9b129aa80 --- /dev/null +++ b/owl-bot-staging/google-cloud-workstations-v1/snippets/workstations/update_workstation_cluster.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 workstations_v1_generated_Workstations_UpdateWorkstationCluster_sync] +require "google/cloud/workstations/v1" + +## +# Snippet for the update_workstation_cluster call in the Workstations 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::Workstations::V1::Workstations::Client#update_workstation_cluster. +# +def update_workstation_cluster + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Workstations::V1::Workstations::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Workstations::V1::UpdateWorkstationClusterRequest.new + + # Call the update_workstation_cluster method. + result = client.update_workstation_cluster 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 workstations_v1_generated_Workstations_UpdateWorkstationCluster_sync] diff --git a/owl-bot-staging/google-cloud-workstations-v1/snippets/workstations/update_workstation_config.rb b/owl-bot-staging/google-cloud-workstations-v1/snippets/workstations/update_workstation_config.rb new file mode 100644 index 000000000000..f2129ee535ec --- /dev/null +++ b/owl-bot-staging/google-cloud-workstations-v1/snippets/workstations/update_workstation_config.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 workstations_v1_generated_Workstations_UpdateWorkstationConfig_sync] +require "google/cloud/workstations/v1" + +## +# Snippet for the update_workstation_config call in the Workstations 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::Workstations::V1::Workstations::Client#update_workstation_config. +# +def update_workstation_config + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Workstations::V1::Workstations::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Workstations::V1::UpdateWorkstationConfigRequest.new + + # Call the update_workstation_config method. + result = client.update_workstation_config 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 workstations_v1_generated_Workstations_UpdateWorkstationConfig_sync] diff --git a/owl-bot-staging/google-cloud-workstations-v1/test/google/cloud/workstations/v1/workstations_operations_test.rb b/owl-bot-staging/google-cloud-workstations-v1/test/google/cloud/workstations/v1/workstations_operations_test.rb new file mode 100644 index 000000000000..c0aa5969d1f8 --- /dev/null +++ b/owl-bot-staging/google-cloud-workstations-v1/test/google/cloud/workstations/v1/workstations_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/workstations/v1/workstations_pb" +require "google/cloud/workstations/v1/workstations_services_pb" +require "google/cloud/workstations/v1/workstations" + +class ::Google::Cloud::Workstations::V1::Workstations::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::Workstations::V1::Workstations::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::Workstations::V1::Workstations::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::Workstations::V1::Workstations::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::Workstations::V1::Workstations::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::Workstations::V1::Workstations::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::Workstations::V1::Workstations::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::Workstations::V1::Workstations::Operations::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-workstations-v1/test/google/cloud/workstations/v1/workstations_paths_test.rb b/owl-bot-staging/google-cloud-workstations-v1/test/google/cloud/workstations/v1/workstations_paths_test.rb new file mode 100644 index 000000000000..2411b91ff053 --- /dev/null +++ b/owl-bot-staging/google-cloud-workstations-v1/test/google/cloud/workstations/v1/workstations_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/workstations/v1/workstations" + +class ::Google::Cloud::Workstations::V1::Workstations::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::Workstations::V1::Workstations::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_workstation_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Workstations::V1::Workstations::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.workstation_path project: "value0", location: "value1", workstation_cluster: "value2", workstation_config: "value3", workstation: "value4" + assert_equal "projects/value0/locations/value1/workstationClusters/value2/workstationConfigs/value3/workstations/value4", path + end + end + + def test_workstation_cluster_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Workstations::V1::Workstations::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.workstation_cluster_path project: "value0", location: "value1", workstation_cluster: "value2" + assert_equal "projects/value0/locations/value1/workstationClusters/value2", path + end + end + + def test_workstation_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::Workstations::V1::Workstations::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.workstation_config_path project: "value0", location: "value1", workstation_cluster: "value2", workstation_config: "value3" + assert_equal "projects/value0/locations/value1/workstationClusters/value2/workstationConfigs/value3", path + end + end +end diff --git a/owl-bot-staging/google-cloud-workstations-v1/test/google/cloud/workstations/v1/workstations_rest_test.rb b/owl-bot-staging/google-cloud-workstations-v1/test/google/cloud/workstations/v1/workstations_rest_test.rb new file mode 100644 index 000000000000..3ac48d97c0c7 --- /dev/null +++ b/owl-bot-staging/google-cloud-workstations-v1/test/google/cloud/workstations/v1/workstations_rest_test.rb @@ -0,0 +1,1220 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/workstations/v1/workstations_pb" +require "google/cloud/workstations/v1/workstations/rest" + + +class ::Google::Cloud::Workstations::V1::Workstations::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_get_workstation_cluster + # Create test objects. + client_result = ::Google::Cloud::Workstations::V1::WorkstationCluster.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_workstation_cluster_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::Workstations::V1::Workstations::Rest::ServiceStub.stub :transcode_get_workstation_cluster_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_workstation_cluster_client_stub do + # Create client + client = ::Google::Cloud::Workstations::V1::Workstations::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_workstation_cluster({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_workstation_cluster name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_workstation_cluster ::Google::Cloud::Workstations::V1::GetWorkstationClusterRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_workstation_cluster({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_workstation_cluster(::Google::Cloud::Workstations::V1::GetWorkstationClusterRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_workstation_cluster_client_stub.call_count + end + end + end + + def test_list_workstation_clusters + # Create test objects. + client_result = ::Google::Cloud::Workstations::V1::ListWorkstationClustersResponse.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_workstation_clusters_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::Workstations::V1::Workstations::Rest::ServiceStub.stub :transcode_list_workstation_clusters_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_workstation_clusters_client_stub do + # Create client + client = ::Google::Cloud::Workstations::V1::Workstations::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_workstation_clusters({ 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_workstation_clusters 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_workstation_clusters ::Google::Cloud::Workstations::V1::ListWorkstationClustersRequest.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_workstation_clusters({ 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_workstation_clusters(::Google::Cloud::Workstations::V1::ListWorkstationClustersRequest.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_workstation_clusters_client_stub.call_count + end + end + end + + def test_create_workstation_cluster + # 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" + workstation_cluster_id = "hello world" + workstation_cluster = {} + validate_only = true + + create_workstation_cluster_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::Workstations::V1::Workstations::Rest::ServiceStub.stub :transcode_create_workstation_cluster_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_workstation_cluster_client_stub do + # Create client + client = ::Google::Cloud::Workstations::V1::Workstations::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_workstation_cluster({ parent: parent, workstation_cluster_id: workstation_cluster_id, workstation_cluster: workstation_cluster, validate_only: validate_only }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_workstation_cluster parent: parent, workstation_cluster_id: workstation_cluster_id, workstation_cluster: workstation_cluster, validate_only: validate_only do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_workstation_cluster ::Google::Cloud::Workstations::V1::CreateWorkstationClusterRequest.new(parent: parent, workstation_cluster_id: workstation_cluster_id, workstation_cluster: workstation_cluster, validate_only: validate_only) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_workstation_cluster({ parent: parent, workstation_cluster_id: workstation_cluster_id, workstation_cluster: workstation_cluster, validate_only: validate_only }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_workstation_cluster(::Google::Cloud::Workstations::V1::CreateWorkstationClusterRequest.new(parent: parent, workstation_cluster_id: workstation_cluster_id, workstation_cluster: workstation_cluster, validate_only: validate_only), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_workstation_cluster_client_stub.call_count + end + end + end + + def test_update_workstation_cluster + # 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. + workstation_cluster = {} + update_mask = {} + validate_only = true + allow_missing = true + + update_workstation_cluster_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::Workstations::V1::Workstations::Rest::ServiceStub.stub :transcode_update_workstation_cluster_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_workstation_cluster_client_stub do + # Create client + client = ::Google::Cloud::Workstations::V1::Workstations::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_workstation_cluster({ workstation_cluster: workstation_cluster, update_mask: update_mask, validate_only: validate_only, allow_missing: allow_missing }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_workstation_cluster workstation_cluster: workstation_cluster, update_mask: update_mask, validate_only: validate_only, allow_missing: allow_missing do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_workstation_cluster ::Google::Cloud::Workstations::V1::UpdateWorkstationClusterRequest.new(workstation_cluster: workstation_cluster, update_mask: update_mask, validate_only: validate_only, allow_missing: allow_missing) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_workstation_cluster({ workstation_cluster: workstation_cluster, update_mask: update_mask, validate_only: validate_only, allow_missing: allow_missing }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_workstation_cluster(::Google::Cloud::Workstations::V1::UpdateWorkstationClusterRequest.new(workstation_cluster: workstation_cluster, update_mask: update_mask, validate_only: validate_only, allow_missing: allow_missing), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_workstation_cluster_client_stub.call_count + end + end + end + + def test_delete_workstation_cluster + # 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" + validate_only = true + etag = "hello world" + force = true + + delete_workstation_cluster_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::Workstations::V1::Workstations::Rest::ServiceStub.stub :transcode_delete_workstation_cluster_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_workstation_cluster_client_stub do + # Create client + client = ::Google::Cloud::Workstations::V1::Workstations::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_workstation_cluster({ name: name, validate_only: validate_only, etag: etag, force: force }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_workstation_cluster name: name, validate_only: validate_only, etag: etag, force: force do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_workstation_cluster ::Google::Cloud::Workstations::V1::DeleteWorkstationClusterRequest.new(name: name, validate_only: validate_only, etag: etag, force: force) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_workstation_cluster({ name: name, validate_only: validate_only, etag: etag, force: force }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_workstation_cluster(::Google::Cloud::Workstations::V1::DeleteWorkstationClusterRequest.new(name: name, validate_only: validate_only, etag: etag, force: force), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_workstation_cluster_client_stub.call_count + end + end + end + + def test_get_workstation_config + # Create test objects. + client_result = ::Google::Cloud::Workstations::V1::WorkstationConfig.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_workstation_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::Workstations::V1::Workstations::Rest::ServiceStub.stub :transcode_get_workstation_config_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_workstation_config_client_stub do + # Create client + client = ::Google::Cloud::Workstations::V1::Workstations::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_workstation_config({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_workstation_config name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_workstation_config ::Google::Cloud::Workstations::V1::GetWorkstationConfigRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_workstation_config({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_workstation_config(::Google::Cloud::Workstations::V1::GetWorkstationConfigRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_workstation_config_client_stub.call_count + end + end + end + + def test_list_workstation_configs + # Create test objects. + client_result = ::Google::Cloud::Workstations::V1::ListWorkstationConfigsResponse.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_workstation_configs_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::Workstations::V1::Workstations::Rest::ServiceStub.stub :transcode_list_workstation_configs_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_workstation_configs_client_stub do + # Create client + client = ::Google::Cloud::Workstations::V1::Workstations::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_workstation_configs({ 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_workstation_configs 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_workstation_configs ::Google::Cloud::Workstations::V1::ListWorkstationConfigsRequest.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_workstation_configs({ 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_workstation_configs(::Google::Cloud::Workstations::V1::ListWorkstationConfigsRequest.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_workstation_configs_client_stub.call_count + end + end + end + + def test_list_usable_workstation_configs + # Create test objects. + client_result = ::Google::Cloud::Workstations::V1::ListUsableWorkstationConfigsResponse.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_usable_workstation_configs_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::Workstations::V1::Workstations::Rest::ServiceStub.stub :transcode_list_usable_workstation_configs_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_usable_workstation_configs_client_stub do + # Create client + client = ::Google::Cloud::Workstations::V1::Workstations::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_usable_workstation_configs({ 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_usable_workstation_configs 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_usable_workstation_configs ::Google::Cloud::Workstations::V1::ListUsableWorkstationConfigsRequest.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_usable_workstation_configs({ 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_usable_workstation_configs(::Google::Cloud::Workstations::V1::ListUsableWorkstationConfigsRequest.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_usable_workstation_configs_client_stub.call_count + end + end + end + + def test_create_workstation_config + # 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" + workstation_config_id = "hello world" + workstation_config = {} + validate_only = true + + create_workstation_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::Workstations::V1::Workstations::Rest::ServiceStub.stub :transcode_create_workstation_config_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_workstation_config_client_stub do + # Create client + client = ::Google::Cloud::Workstations::V1::Workstations::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_workstation_config({ parent: parent, workstation_config_id: workstation_config_id, workstation_config: workstation_config, validate_only: validate_only }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_workstation_config parent: parent, workstation_config_id: workstation_config_id, workstation_config: workstation_config, validate_only: validate_only do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_workstation_config ::Google::Cloud::Workstations::V1::CreateWorkstationConfigRequest.new(parent: parent, workstation_config_id: workstation_config_id, workstation_config: workstation_config, validate_only: validate_only) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_workstation_config({ parent: parent, workstation_config_id: workstation_config_id, workstation_config: workstation_config, validate_only: validate_only }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_workstation_config(::Google::Cloud::Workstations::V1::CreateWorkstationConfigRequest.new(parent: parent, workstation_config_id: workstation_config_id, workstation_config: workstation_config, validate_only: validate_only), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_workstation_config_client_stub.call_count + end + end + end + + def test_update_workstation_config + # 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. + workstation_config = {} + update_mask = {} + validate_only = true + allow_missing = true + + update_workstation_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::Workstations::V1::Workstations::Rest::ServiceStub.stub :transcode_update_workstation_config_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_workstation_config_client_stub do + # Create client + client = ::Google::Cloud::Workstations::V1::Workstations::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_workstation_config({ workstation_config: workstation_config, update_mask: update_mask, validate_only: validate_only, allow_missing: allow_missing }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_workstation_config workstation_config: workstation_config, update_mask: update_mask, validate_only: validate_only, allow_missing: allow_missing do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_workstation_config ::Google::Cloud::Workstations::V1::UpdateWorkstationConfigRequest.new(workstation_config: workstation_config, update_mask: update_mask, validate_only: validate_only, allow_missing: allow_missing) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_workstation_config({ workstation_config: workstation_config, update_mask: update_mask, validate_only: validate_only, allow_missing: allow_missing }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_workstation_config(::Google::Cloud::Workstations::V1::UpdateWorkstationConfigRequest.new(workstation_config: workstation_config, update_mask: update_mask, validate_only: validate_only, allow_missing: allow_missing), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_workstation_config_client_stub.call_count + end + end + end + + def test_delete_workstation_config + # 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" + validate_only = true + etag = "hello world" + force = true + + delete_workstation_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::Workstations::V1::Workstations::Rest::ServiceStub.stub :transcode_delete_workstation_config_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_workstation_config_client_stub do + # Create client + client = ::Google::Cloud::Workstations::V1::Workstations::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_workstation_config({ name: name, validate_only: validate_only, etag: etag, force: force }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_workstation_config name: name, validate_only: validate_only, etag: etag, force: force do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_workstation_config ::Google::Cloud::Workstations::V1::DeleteWorkstationConfigRequest.new(name: name, validate_only: validate_only, etag: etag, force: force) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_workstation_config({ name: name, validate_only: validate_only, etag: etag, force: force }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_workstation_config(::Google::Cloud::Workstations::V1::DeleteWorkstationConfigRequest.new(name: name, validate_only: validate_only, etag: etag, force: force), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_workstation_config_client_stub.call_count + end + end + end + + def test_get_workstation + # Create test objects. + client_result = ::Google::Cloud::Workstations::V1::Workstation.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_workstation_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::Workstations::V1::Workstations::Rest::ServiceStub.stub :transcode_get_workstation_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_workstation_client_stub do + # Create client + client = ::Google::Cloud::Workstations::V1::Workstations::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_workstation({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_workstation name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_workstation ::Google::Cloud::Workstations::V1::GetWorkstationRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_workstation({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_workstation(::Google::Cloud::Workstations::V1::GetWorkstationRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_workstation_client_stub.call_count + end + end + end + + def test_list_workstations + # Create test objects. + client_result = ::Google::Cloud::Workstations::V1::ListWorkstationsResponse.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_workstations_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::Workstations::V1::Workstations::Rest::ServiceStub.stub :transcode_list_workstations_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_workstations_client_stub do + # Create client + client = ::Google::Cloud::Workstations::V1::Workstations::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_workstations({ 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_workstations 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_workstations ::Google::Cloud::Workstations::V1::ListWorkstationsRequest.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_workstations({ 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_workstations(::Google::Cloud::Workstations::V1::ListWorkstationsRequest.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_workstations_client_stub.call_count + end + end + end + + def test_list_usable_workstations + # Create test objects. + client_result = ::Google::Cloud::Workstations::V1::ListUsableWorkstationsResponse.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_usable_workstations_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::Workstations::V1::Workstations::Rest::ServiceStub.stub :transcode_list_usable_workstations_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_usable_workstations_client_stub do + # Create client + client = ::Google::Cloud::Workstations::V1::Workstations::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_usable_workstations({ 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_usable_workstations 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_usable_workstations ::Google::Cloud::Workstations::V1::ListUsableWorkstationsRequest.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_usable_workstations({ 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_usable_workstations(::Google::Cloud::Workstations::V1::ListUsableWorkstationsRequest.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_usable_workstations_client_stub.call_count + end + end + end + + def test_create_workstation + # 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" + workstation_id = "hello world" + workstation = {} + validate_only = true + + create_workstation_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::Workstations::V1::Workstations::Rest::ServiceStub.stub :transcode_create_workstation_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_workstation_client_stub do + # Create client + client = ::Google::Cloud::Workstations::V1::Workstations::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_workstation({ parent: parent, workstation_id: workstation_id, workstation: workstation, validate_only: validate_only }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_workstation parent: parent, workstation_id: workstation_id, workstation: workstation, validate_only: validate_only do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_workstation ::Google::Cloud::Workstations::V1::CreateWorkstationRequest.new(parent: parent, workstation_id: workstation_id, workstation: workstation, validate_only: validate_only) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_workstation({ parent: parent, workstation_id: workstation_id, workstation: workstation, validate_only: validate_only }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_workstation(::Google::Cloud::Workstations::V1::CreateWorkstationRequest.new(parent: parent, workstation_id: workstation_id, workstation: workstation, validate_only: validate_only), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_workstation_client_stub.call_count + end + end + end + + def test_update_workstation + # 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. + workstation = {} + update_mask = {} + validate_only = true + allow_missing = true + + update_workstation_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::Workstations::V1::Workstations::Rest::ServiceStub.stub :transcode_update_workstation_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_workstation_client_stub do + # Create client + client = ::Google::Cloud::Workstations::V1::Workstations::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_workstation({ workstation: workstation, update_mask: update_mask, validate_only: validate_only, allow_missing: allow_missing }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_workstation workstation: workstation, update_mask: update_mask, validate_only: validate_only, allow_missing: allow_missing do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_workstation ::Google::Cloud::Workstations::V1::UpdateWorkstationRequest.new(workstation: workstation, update_mask: update_mask, validate_only: validate_only, allow_missing: allow_missing) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_workstation({ workstation: workstation, update_mask: update_mask, validate_only: validate_only, allow_missing: allow_missing }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_workstation(::Google::Cloud::Workstations::V1::UpdateWorkstationRequest.new(workstation: workstation, update_mask: update_mask, validate_only: validate_only, allow_missing: allow_missing), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_workstation_client_stub.call_count + end + end + end + + def test_delete_workstation + # 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" + validate_only = true + etag = "hello world" + + delete_workstation_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::Workstations::V1::Workstations::Rest::ServiceStub.stub :transcode_delete_workstation_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_workstation_client_stub do + # Create client + client = ::Google::Cloud::Workstations::V1::Workstations::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_workstation({ name: name, validate_only: validate_only, etag: etag }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_workstation name: name, validate_only: validate_only, etag: etag do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_workstation ::Google::Cloud::Workstations::V1::DeleteWorkstationRequest.new(name: name, validate_only: validate_only, etag: etag) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_workstation({ name: name, validate_only: validate_only, etag: etag }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_workstation(::Google::Cloud::Workstations::V1::DeleteWorkstationRequest.new(name: name, validate_only: validate_only, etag: etag), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_workstation_client_stub.call_count + end + end + end + + def test_start_workstation + # 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" + validate_only = true + etag = "hello world" + + start_workstation_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::Workstations::V1::Workstations::Rest::ServiceStub.stub :transcode_start_workstation_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, start_workstation_client_stub do + # Create client + client = ::Google::Cloud::Workstations::V1::Workstations::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.start_workstation({ name: name, validate_only: validate_only, etag: etag }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.start_workstation name: name, validate_only: validate_only, etag: etag do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.start_workstation ::Google::Cloud::Workstations::V1::StartWorkstationRequest.new(name: name, validate_only: validate_only, etag: etag) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.start_workstation({ name: name, validate_only: validate_only, etag: etag }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.start_workstation(::Google::Cloud::Workstations::V1::StartWorkstationRequest.new(name: name, validate_only: validate_only, etag: etag), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, start_workstation_client_stub.call_count + end + end + end + + def test_stop_workstation + # 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" + validate_only = true + etag = "hello world" + + stop_workstation_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::Workstations::V1::Workstations::Rest::ServiceStub.stub :transcode_stop_workstation_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, stop_workstation_client_stub do + # Create client + client = ::Google::Cloud::Workstations::V1::Workstations::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.stop_workstation({ name: name, validate_only: validate_only, etag: etag }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.stop_workstation name: name, validate_only: validate_only, etag: etag do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.stop_workstation ::Google::Cloud::Workstations::V1::StopWorkstationRequest.new(name: name, validate_only: validate_only, etag: etag) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.stop_workstation({ name: name, validate_only: validate_only, etag: etag }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.stop_workstation(::Google::Cloud::Workstations::V1::StopWorkstationRequest.new(name: name, validate_only: validate_only, etag: etag), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, stop_workstation_client_stub.call_count + end + end + end + + def test_generate_access_token + # Create test objects. + client_result = ::Google::Cloud::Workstations::V1::GenerateAccessTokenResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + expire_time = {} + workstation = "hello world" + + generate_access_token_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::Workstations::V1::Workstations::Rest::ServiceStub.stub :transcode_generate_access_token_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, generate_access_token_client_stub do + # Create client + client = ::Google::Cloud::Workstations::V1::Workstations::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.generate_access_token({ expire_time: expire_time, workstation: workstation }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.generate_access_token expire_time: expire_time, workstation: workstation do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.generate_access_token ::Google::Cloud::Workstations::V1::GenerateAccessTokenRequest.new(expire_time: expire_time, workstation: workstation) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.generate_access_token({ expire_time: expire_time, workstation: workstation }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.generate_access_token(::Google::Cloud::Workstations::V1::GenerateAccessTokenRequest.new(expire_time: expire_time, workstation: workstation), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, generate_access_token_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::Workstations::V1::Workstations::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::Workstations::V1::Workstations::Rest::Client::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-workstations-v1/test/google/cloud/workstations/v1/workstations_test.rb b/owl-bot-staging/google-cloud-workstations-v1/test/google/cloud/workstations/v1/workstations_test.rb new file mode 100644 index 000000000000..18791d244c13 --- /dev/null +++ b/owl-bot-staging/google-cloud-workstations-v1/test/google/cloud/workstations/v1/workstations_test.rb @@ -0,0 +1,1441 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/workstations/v1/workstations_pb" +require "google/cloud/workstations/v1/workstations" + +class ::Google::Cloud::Workstations::V1::Workstations::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_get_workstation_cluster + # Create GRPC objects. + grpc_response = ::Google::Cloud::Workstations::V1::WorkstationCluster.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_workstation_cluster_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_workstation_cluster, name + assert_kind_of ::Google::Cloud::Workstations::V1::GetWorkstationClusterRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_workstation_cluster_client_stub do + # Create client + client = ::Google::Cloud::Workstations::V1::Workstations::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_workstation_cluster({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_workstation_cluster name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_workstation_cluster ::Google::Cloud::Workstations::V1::GetWorkstationClusterRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_workstation_cluster({ 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_workstation_cluster(::Google::Cloud::Workstations::V1::GetWorkstationClusterRequest.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_workstation_cluster_client_stub.call_rpc_count + end + end + + def test_list_workstation_clusters + # Create GRPC objects. + grpc_response = ::Google::Cloud::Workstations::V1::ListWorkstationClustersResponse.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_workstation_clusters_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_workstation_clusters, name + assert_kind_of ::Google::Cloud::Workstations::V1::ListWorkstationClustersRequest, 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_workstation_clusters_client_stub do + # Create client + client = ::Google::Cloud::Workstations::V1::Workstations::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_workstation_clusters({ 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_workstation_clusters 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_workstation_clusters ::Google::Cloud::Workstations::V1::ListWorkstationClustersRequest.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_workstation_clusters({ 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_workstation_clusters(::Google::Cloud::Workstations::V1::ListWorkstationClustersRequest.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_workstation_clusters_client_stub.call_rpc_count + end + end + + def test_create_workstation_cluster + # 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" + workstation_cluster_id = "hello world" + workstation_cluster = {} + validate_only = true + + create_workstation_cluster_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_workstation_cluster, name + assert_kind_of ::Google::Cloud::Workstations::V1::CreateWorkstationClusterRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["workstation_cluster_id"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Workstations::V1::WorkstationCluster), request["workstation_cluster"] + assert_equal true, request["validate_only"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_workstation_cluster_client_stub do + # Create client + client = ::Google::Cloud::Workstations::V1::Workstations::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_workstation_cluster({ parent: parent, workstation_cluster_id: workstation_cluster_id, workstation_cluster: workstation_cluster, validate_only: validate_only }) 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_workstation_cluster parent: parent, workstation_cluster_id: workstation_cluster_id, workstation_cluster: workstation_cluster, validate_only: validate_only 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_workstation_cluster ::Google::Cloud::Workstations::V1::CreateWorkstationClusterRequest.new(parent: parent, workstation_cluster_id: workstation_cluster_id, workstation_cluster: workstation_cluster, validate_only: validate_only) 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_workstation_cluster({ parent: parent, workstation_cluster_id: workstation_cluster_id, workstation_cluster: workstation_cluster, validate_only: validate_only }, 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_workstation_cluster(::Google::Cloud::Workstations::V1::CreateWorkstationClusterRequest.new(parent: parent, workstation_cluster_id: workstation_cluster_id, workstation_cluster: workstation_cluster, validate_only: validate_only), 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_workstation_cluster_client_stub.call_rpc_count + end + end + + def test_update_workstation_cluster + # 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. + workstation_cluster = {} + update_mask = {} + validate_only = true + allow_missing = true + + update_workstation_cluster_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_workstation_cluster, name + assert_kind_of ::Google::Cloud::Workstations::V1::UpdateWorkstationClusterRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Workstations::V1::WorkstationCluster), request["workstation_cluster"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + assert_equal true, request["validate_only"] + assert_equal true, request["allow_missing"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_workstation_cluster_client_stub do + # Create client + client = ::Google::Cloud::Workstations::V1::Workstations::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_workstation_cluster({ workstation_cluster: workstation_cluster, update_mask: update_mask, validate_only: validate_only, allow_missing: allow_missing }) 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.update_workstation_cluster workstation_cluster: workstation_cluster, update_mask: update_mask, validate_only: validate_only, allow_missing: allow_missing 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.update_workstation_cluster ::Google::Cloud::Workstations::V1::UpdateWorkstationClusterRequest.new(workstation_cluster: workstation_cluster, update_mask: update_mask, validate_only: validate_only, allow_missing: allow_missing) 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.update_workstation_cluster({ workstation_cluster: workstation_cluster, update_mask: update_mask, validate_only: validate_only, allow_missing: allow_missing }, 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.update_workstation_cluster(::Google::Cloud::Workstations::V1::UpdateWorkstationClusterRequest.new(workstation_cluster: workstation_cluster, update_mask: update_mask, validate_only: validate_only, allow_missing: allow_missing), 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, update_workstation_cluster_client_stub.call_rpc_count + end + end + + def test_delete_workstation_cluster + # 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" + validate_only = true + etag = "hello world" + force = true + + delete_workstation_cluster_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_workstation_cluster, name + assert_kind_of ::Google::Cloud::Workstations::V1::DeleteWorkstationClusterRequest, request + assert_equal "hello world", request["name"] + assert_equal true, request["validate_only"] + assert_equal "hello world", request["etag"] + assert_equal true, request["force"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_workstation_cluster_client_stub do + # Create client + client = ::Google::Cloud::Workstations::V1::Workstations::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_workstation_cluster({ name: name, validate_only: validate_only, etag: etag, force: force }) 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_workstation_cluster name: name, validate_only: validate_only, etag: etag, force: force 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_workstation_cluster ::Google::Cloud::Workstations::V1::DeleteWorkstationClusterRequest.new(name: name, validate_only: validate_only, etag: etag, force: force) 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_workstation_cluster({ name: name, validate_only: validate_only, etag: etag, force: force }, 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_workstation_cluster(::Google::Cloud::Workstations::V1::DeleteWorkstationClusterRequest.new(name: name, validate_only: validate_only, etag: etag, force: force), 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_workstation_cluster_client_stub.call_rpc_count + end + end + + def test_get_workstation_config + # Create GRPC objects. + grpc_response = ::Google::Cloud::Workstations::V1::WorkstationConfig.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_workstation_config_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_workstation_config, name + assert_kind_of ::Google::Cloud::Workstations::V1::GetWorkstationConfigRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_workstation_config_client_stub do + # Create client + client = ::Google::Cloud::Workstations::V1::Workstations::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_workstation_config({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_workstation_config name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_workstation_config ::Google::Cloud::Workstations::V1::GetWorkstationConfigRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_workstation_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_workstation_config(::Google::Cloud::Workstations::V1::GetWorkstationConfigRequest.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_workstation_config_client_stub.call_rpc_count + end + end + + def test_list_workstation_configs + # Create GRPC objects. + grpc_response = ::Google::Cloud::Workstations::V1::ListWorkstationConfigsResponse.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_workstation_configs_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_workstation_configs, name + assert_kind_of ::Google::Cloud::Workstations::V1::ListWorkstationConfigsRequest, 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_workstation_configs_client_stub do + # Create client + client = ::Google::Cloud::Workstations::V1::Workstations::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_workstation_configs({ 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_workstation_configs 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_workstation_configs ::Google::Cloud::Workstations::V1::ListWorkstationConfigsRequest.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_workstation_configs({ 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_workstation_configs(::Google::Cloud::Workstations::V1::ListWorkstationConfigsRequest.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_workstation_configs_client_stub.call_rpc_count + end + end + + def test_list_usable_workstation_configs + # Create GRPC objects. + grpc_response = ::Google::Cloud::Workstations::V1::ListUsableWorkstationConfigsResponse.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_usable_workstation_configs_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_usable_workstation_configs, name + assert_kind_of ::Google::Cloud::Workstations::V1::ListUsableWorkstationConfigsRequest, 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_usable_workstation_configs_client_stub do + # Create client + client = ::Google::Cloud::Workstations::V1::Workstations::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_usable_workstation_configs({ 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_usable_workstation_configs 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_usable_workstation_configs ::Google::Cloud::Workstations::V1::ListUsableWorkstationConfigsRequest.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_usable_workstation_configs({ 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_usable_workstation_configs(::Google::Cloud::Workstations::V1::ListUsableWorkstationConfigsRequest.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_usable_workstation_configs_client_stub.call_rpc_count + end + end + + def test_create_workstation_config + # 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" + workstation_config_id = "hello world" + workstation_config = {} + validate_only = true + + create_workstation_config_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_workstation_config, name + assert_kind_of ::Google::Cloud::Workstations::V1::CreateWorkstationConfigRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["workstation_config_id"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Workstations::V1::WorkstationConfig), request["workstation_config"] + assert_equal true, request["validate_only"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_workstation_config_client_stub do + # Create client + client = ::Google::Cloud::Workstations::V1::Workstations::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_workstation_config({ parent: parent, workstation_config_id: workstation_config_id, workstation_config: workstation_config, validate_only: validate_only }) 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_workstation_config parent: parent, workstation_config_id: workstation_config_id, workstation_config: workstation_config, validate_only: validate_only 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_workstation_config ::Google::Cloud::Workstations::V1::CreateWorkstationConfigRequest.new(parent: parent, workstation_config_id: workstation_config_id, workstation_config: workstation_config, validate_only: validate_only) 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_workstation_config({ parent: parent, workstation_config_id: workstation_config_id, workstation_config: workstation_config, validate_only: validate_only }, 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_workstation_config(::Google::Cloud::Workstations::V1::CreateWorkstationConfigRequest.new(parent: parent, workstation_config_id: workstation_config_id, workstation_config: workstation_config, validate_only: validate_only), 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_workstation_config_client_stub.call_rpc_count + end + end + + def test_update_workstation_config + # 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. + workstation_config = {} + update_mask = {} + validate_only = true + allow_missing = true + + update_workstation_config_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_workstation_config, name + assert_kind_of ::Google::Cloud::Workstations::V1::UpdateWorkstationConfigRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Workstations::V1::WorkstationConfig), request["workstation_config"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + assert_equal true, request["validate_only"] + assert_equal true, request["allow_missing"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_workstation_config_client_stub do + # Create client + client = ::Google::Cloud::Workstations::V1::Workstations::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_workstation_config({ workstation_config: workstation_config, update_mask: update_mask, validate_only: validate_only, allow_missing: allow_missing }) 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.update_workstation_config workstation_config: workstation_config, update_mask: update_mask, validate_only: validate_only, allow_missing: allow_missing 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.update_workstation_config ::Google::Cloud::Workstations::V1::UpdateWorkstationConfigRequest.new(workstation_config: workstation_config, update_mask: update_mask, validate_only: validate_only, allow_missing: allow_missing) 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.update_workstation_config({ workstation_config: workstation_config, update_mask: update_mask, validate_only: validate_only, allow_missing: allow_missing }, 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.update_workstation_config(::Google::Cloud::Workstations::V1::UpdateWorkstationConfigRequest.new(workstation_config: workstation_config, update_mask: update_mask, validate_only: validate_only, allow_missing: allow_missing), 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, update_workstation_config_client_stub.call_rpc_count + end + end + + def test_delete_workstation_config + # 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" + validate_only = true + etag = "hello world" + force = true + + delete_workstation_config_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_workstation_config, name + assert_kind_of ::Google::Cloud::Workstations::V1::DeleteWorkstationConfigRequest, request + assert_equal "hello world", request["name"] + assert_equal true, request["validate_only"] + assert_equal "hello world", request["etag"] + assert_equal true, request["force"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_workstation_config_client_stub do + # Create client + client = ::Google::Cloud::Workstations::V1::Workstations::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_workstation_config({ name: name, validate_only: validate_only, etag: etag, force: force }) 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_workstation_config name: name, validate_only: validate_only, etag: etag, force: force 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_workstation_config ::Google::Cloud::Workstations::V1::DeleteWorkstationConfigRequest.new(name: name, validate_only: validate_only, etag: etag, force: force) 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_workstation_config({ name: name, validate_only: validate_only, etag: etag, force: force }, 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_workstation_config(::Google::Cloud::Workstations::V1::DeleteWorkstationConfigRequest.new(name: name, validate_only: validate_only, etag: etag, force: force), 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_workstation_config_client_stub.call_rpc_count + end + end + + def test_get_workstation + # Create GRPC objects. + grpc_response = ::Google::Cloud::Workstations::V1::Workstation.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_workstation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_workstation, name + assert_kind_of ::Google::Cloud::Workstations::V1::GetWorkstationRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_workstation_client_stub do + # Create client + client = ::Google::Cloud::Workstations::V1::Workstations::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_workstation({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_workstation name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_workstation ::Google::Cloud::Workstations::V1::GetWorkstationRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_workstation({ 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_workstation(::Google::Cloud::Workstations::V1::GetWorkstationRequest.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_workstation_client_stub.call_rpc_count + end + end + + def test_list_workstations + # Create GRPC objects. + grpc_response = ::Google::Cloud::Workstations::V1::ListWorkstationsResponse.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_workstations_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_workstations, name + assert_kind_of ::Google::Cloud::Workstations::V1::ListWorkstationsRequest, 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_workstations_client_stub do + # Create client + client = ::Google::Cloud::Workstations::V1::Workstations::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_workstations({ 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_workstations 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_workstations ::Google::Cloud::Workstations::V1::ListWorkstationsRequest.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_workstations({ 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_workstations(::Google::Cloud::Workstations::V1::ListWorkstationsRequest.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_workstations_client_stub.call_rpc_count + end + end + + def test_list_usable_workstations + # Create GRPC objects. + grpc_response = ::Google::Cloud::Workstations::V1::ListUsableWorkstationsResponse.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_usable_workstations_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_usable_workstations, name + assert_kind_of ::Google::Cloud::Workstations::V1::ListUsableWorkstationsRequest, 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_usable_workstations_client_stub do + # Create client + client = ::Google::Cloud::Workstations::V1::Workstations::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_usable_workstations({ 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_usable_workstations 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_usable_workstations ::Google::Cloud::Workstations::V1::ListUsableWorkstationsRequest.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_usable_workstations({ 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_usable_workstations(::Google::Cloud::Workstations::V1::ListUsableWorkstationsRequest.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_usable_workstations_client_stub.call_rpc_count + end + end + + def test_create_workstation + # 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" + workstation_id = "hello world" + workstation = {} + validate_only = true + + create_workstation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_workstation, name + assert_kind_of ::Google::Cloud::Workstations::V1::CreateWorkstationRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["workstation_id"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Workstations::V1::Workstation), request["workstation"] + assert_equal true, request["validate_only"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_workstation_client_stub do + # Create client + client = ::Google::Cloud::Workstations::V1::Workstations::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_workstation({ parent: parent, workstation_id: workstation_id, workstation: workstation, validate_only: validate_only }) 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_workstation parent: parent, workstation_id: workstation_id, workstation: workstation, validate_only: validate_only 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_workstation ::Google::Cloud::Workstations::V1::CreateWorkstationRequest.new(parent: parent, workstation_id: workstation_id, workstation: workstation, validate_only: validate_only) 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_workstation({ parent: parent, workstation_id: workstation_id, workstation: workstation, validate_only: validate_only }, 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_workstation(::Google::Cloud::Workstations::V1::CreateWorkstationRequest.new(parent: parent, workstation_id: workstation_id, workstation: workstation, validate_only: validate_only), 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_workstation_client_stub.call_rpc_count + end + end + + def test_update_workstation + # 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. + workstation = {} + update_mask = {} + validate_only = true + allow_missing = true + + update_workstation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_workstation, name + assert_kind_of ::Google::Cloud::Workstations::V1::UpdateWorkstationRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Workstations::V1::Workstation), request["workstation"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + assert_equal true, request["validate_only"] + assert_equal true, request["allow_missing"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_workstation_client_stub do + # Create client + client = ::Google::Cloud::Workstations::V1::Workstations::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_workstation({ workstation: workstation, update_mask: update_mask, validate_only: validate_only, allow_missing: allow_missing }) 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.update_workstation workstation: workstation, update_mask: update_mask, validate_only: validate_only, allow_missing: allow_missing 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.update_workstation ::Google::Cloud::Workstations::V1::UpdateWorkstationRequest.new(workstation: workstation, update_mask: update_mask, validate_only: validate_only, allow_missing: allow_missing) 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.update_workstation({ workstation: workstation, update_mask: update_mask, validate_only: validate_only, allow_missing: allow_missing }, 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.update_workstation(::Google::Cloud::Workstations::V1::UpdateWorkstationRequest.new(workstation: workstation, update_mask: update_mask, validate_only: validate_only, allow_missing: allow_missing), 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, update_workstation_client_stub.call_rpc_count + end + end + + def test_delete_workstation + # 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" + validate_only = true + etag = "hello world" + + delete_workstation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_workstation, name + assert_kind_of ::Google::Cloud::Workstations::V1::DeleteWorkstationRequest, request + assert_equal "hello world", request["name"] + assert_equal true, request["validate_only"] + assert_equal "hello world", request["etag"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_workstation_client_stub do + # Create client + client = ::Google::Cloud::Workstations::V1::Workstations::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_workstation({ name: name, validate_only: validate_only, etag: etag }) 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_workstation name: name, validate_only: validate_only, etag: etag 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_workstation ::Google::Cloud::Workstations::V1::DeleteWorkstationRequest.new(name: name, validate_only: validate_only, etag: etag) 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_workstation({ name: name, validate_only: validate_only, etag: etag }, 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_workstation(::Google::Cloud::Workstations::V1::DeleteWorkstationRequest.new(name: name, validate_only: validate_only, etag: etag), 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_workstation_client_stub.call_rpc_count + end + end + + def test_start_workstation + # 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" + validate_only = true + etag = "hello world" + + start_workstation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :start_workstation, name + assert_kind_of ::Google::Cloud::Workstations::V1::StartWorkstationRequest, request + assert_equal "hello world", request["name"] + assert_equal true, request["validate_only"] + assert_equal "hello world", request["etag"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, start_workstation_client_stub do + # Create client + client = ::Google::Cloud::Workstations::V1::Workstations::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.start_workstation({ name: name, validate_only: validate_only, etag: etag }) 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.start_workstation name: name, validate_only: validate_only, etag: etag 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.start_workstation ::Google::Cloud::Workstations::V1::StartWorkstationRequest.new(name: name, validate_only: validate_only, etag: etag) 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.start_workstation({ name: name, validate_only: validate_only, etag: etag }, 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.start_workstation(::Google::Cloud::Workstations::V1::StartWorkstationRequest.new(name: name, validate_only: validate_only, etag: etag), 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, start_workstation_client_stub.call_rpc_count + end + end + + def test_stop_workstation + # 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" + validate_only = true + etag = "hello world" + + stop_workstation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :stop_workstation, name + assert_kind_of ::Google::Cloud::Workstations::V1::StopWorkstationRequest, request + assert_equal "hello world", request["name"] + assert_equal true, request["validate_only"] + assert_equal "hello world", request["etag"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, stop_workstation_client_stub do + # Create client + client = ::Google::Cloud::Workstations::V1::Workstations::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.stop_workstation({ name: name, validate_only: validate_only, etag: etag }) 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.stop_workstation name: name, validate_only: validate_only, etag: etag 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.stop_workstation ::Google::Cloud::Workstations::V1::StopWorkstationRequest.new(name: name, validate_only: validate_only, etag: etag) 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.stop_workstation({ name: name, validate_only: validate_only, etag: etag }, 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.stop_workstation(::Google::Cloud::Workstations::V1::StopWorkstationRequest.new(name: name, validate_only: validate_only, etag: etag), 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, stop_workstation_client_stub.call_rpc_count + end + end + + def test_generate_access_token + # Create GRPC objects. + grpc_response = ::Google::Cloud::Workstations::V1::GenerateAccessTokenResponse.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. + expire_time = {} + workstation = "hello world" + + generate_access_token_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :generate_access_token, name + assert_kind_of ::Google::Cloud::Workstations::V1::GenerateAccessTokenRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Timestamp), request["expire_time"] + assert_equal :expire_time, request.expiration + assert_equal "hello world", request["workstation"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, generate_access_token_client_stub do + # Create client + client = ::Google::Cloud::Workstations::V1::Workstations::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.generate_access_token({ expire_time: expire_time, workstation: workstation }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.generate_access_token expire_time: expire_time, workstation: workstation do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.generate_access_token ::Google::Cloud::Workstations::V1::GenerateAccessTokenRequest.new(expire_time: expire_time, workstation: workstation) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.generate_access_token({ expire_time: expire_time, workstation: workstation }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.generate_access_token(::Google::Cloud::Workstations::V1::GenerateAccessTokenRequest.new(expire_time: expire_time, workstation: workstation), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, generate_access_token_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::Workstations::V1::Workstations::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::Workstations::V1::Workstations::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::Workstations::V1::Workstations::Client.new do |config| + config.credentials = creds + end + assert_kind_of ::Google::Cloud::Workstations::V1::Workstations::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::Workstations::V1::Workstations::Client.new do |config| + config.credentials = grpc_channel + end + end + + assert_kind_of ::Google::Cloud::Workstations::V1::Workstations::Operations, client.operations_client + end +end diff --git a/owl-bot-staging/google-cloud-workstations-v1/test/helper.rb b/owl-bot-staging/google-cloud-workstations-v1/test/helper.rb new file mode 100644 index 000000000000..672b337030e7 --- /dev/null +++ b/owl-bot-staging/google-cloud-workstations-v1/test/helper.rb @@ -0,0 +1,26 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/mock" +require "minitest/rg" + +require "grpc" + +require "ostruct" diff --git a/owl-bot-staging/google-cloud-workstations-v1beta/.gitignore b/owl-bot-staging/google-cloud-workstations-v1beta/.gitignore new file mode 100644 index 000000000000..0135b6bc6cfc --- /dev/null +++ b/owl-bot-staging/google-cloud-workstations-v1beta/.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-workstations-v1beta/.repo-metadata.json b/owl-bot-staging/google-cloud-workstations-v1beta/.repo-metadata.json new file mode 100644 index 000000000000..1f075089291e --- /dev/null +++ b/owl-bot-staging/google-cloud-workstations-v1beta/.repo-metadata.json @@ -0,0 +1,17 @@ +{ + "api_id": "workstations.googleapis.com", + "api_shortname": "workstations", + "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-workstations-v1beta/latest", + "distribution_name": "google-cloud-workstations-v1beta", + "is_cloud": true, + "language": "ruby", + "name": "workstations", + "name_pretty": "Cloud Workstations V1BETA API", + "product_documentation": "https://cloud.google.com/workstations/docs", + "release_level": "unreleased", + "repo": "googleapis/google-cloud-ruby", + "requires_billing": true, + "ruby-cloud-description": "Allows administrators to create managed developer environments in the cloud. Note that google-cloud-workstations-v1beta is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-workstations instead. See the readme for more details.", + "ruby-cloud-product-url": "https://cloud.google.com/workstations/docs", + "library_type": "GAPIC_AUTO" +} diff --git a/owl-bot-staging/google-cloud-workstations-v1beta/.rubocop.yml b/owl-bot-staging/google-cloud-workstations-v1beta/.rubocop.yml new file mode 100644 index 000000000000..7ef831857790 --- /dev/null +++ b/owl-bot-staging/google-cloud-workstations-v1beta/.rubocop.yml @@ -0,0 +1,33 @@ +inherit_gem: + google-style: google-style.yml + +AllCops: + Exclude: + - "google-cloud-workstations-v1beta.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-workstations-v1beta.rb" diff --git a/owl-bot-staging/google-cloud-workstations-v1beta/.toys.rb b/owl-bot-staging/google-cloud-workstations-v1beta/.toys.rb new file mode 100644 index 000000000000..177e22456e8a --- /dev/null +++ b/owl-bot-staging/google-cloud-workstations-v1beta/.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-workstations-v1beta/.yardopts b/owl-bot-staging/google-cloud-workstations-v1beta/.yardopts new file mode 100644 index 000000000000..760a9a0f14a5 --- /dev/null +++ b/owl-bot-staging/google-cloud-workstations-v1beta/.yardopts @@ -0,0 +1,12 @@ +--no-private +--title="Cloud Workstations V1BETA 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-workstations-v1beta/AUTHENTICATION.md b/owl-bot-staging/google-cloud-workstations-v1beta/AUTHENTICATION.md new file mode 100644 index 000000000000..31c9da61967d --- /dev/null +++ b/owl-bot-staging/google-cloud-workstations-v1beta/AUTHENTICATION.md @@ -0,0 +1,122 @@ +# Authentication + +The recommended way to authenticate to the google-cloud-workstations-v1beta 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-workstations-v1beta 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/workstations/v1beta" + +client = ::Google::Cloud::Workstations::V1beta::Workstations::Client.new do |config| + config.credentials = "path/to/credentialfile.json" +end +``` + +To configure a credentials file globally for all clients: + +```ruby +require "google/cloud/workstations/v1beta" + +::Google::Cloud::Workstations::V1beta::Workstations::Client.configure do |config| + config.credentials = "path/to/credentialfile.json" +end + +client = ::Google::Cloud::Workstations::V1beta::Workstations::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-workstations-v1beta +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/workstations/v1beta" + +ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" + +client = ::Google::Cloud::Workstations::V1beta::Workstations::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-workstations-v1beta/CHANGELOG.md b/owl-bot-staging/google-cloud-workstations-v1beta/CHANGELOG.md new file mode 100644 index 000000000000..f88957a62ba2 --- /dev/null +++ b/owl-bot-staging/google-cloud-workstations-v1beta/CHANGELOG.md @@ -0,0 +1,2 @@ +# Release History + diff --git a/owl-bot-staging/google-cloud-workstations-v1beta/Gemfile b/owl-bot-staging/google-cloud-workstations-v1beta/Gemfile new file mode 100644 index 000000000000..1d08558908d8 --- /dev/null +++ b/owl-bot-staging/google-cloud-workstations-v1beta/Gemfile @@ -0,0 +1,14 @@ +source "https://rubygems.org" + +gemspec + +gem "google-style", "~> 1.32.0" +gem "irb", "~> 1.17" +gem "minitest", "~> 6.0.2" +gem "minitest-focus", "~> 1.4" +gem "minitest-mock", "~> 5.27" +gem "minitest-rg", "~> 5.3" +gem "ostruct", "~> 0.5.5" +gem "rake", ">= 13.0" +gem "redcarpet", "~> 3.6" +gem "yard", "~> 0.9" diff --git a/owl-bot-staging/google-cloud-workstations-v1beta/LICENSE.md b/owl-bot-staging/google-cloud-workstations-v1beta/LICENSE.md new file mode 100644 index 000000000000..c261857ba6ad --- /dev/null +++ b/owl-bot-staging/google-cloud-workstations-v1beta/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-workstations-v1beta/README.md b/owl-bot-staging/google-cloud-workstations-v1beta/README.md new file mode 100644 index 000000000000..97a3e0b962f0 --- /dev/null +++ b/owl-bot-staging/google-cloud-workstations-v1beta/README.md @@ -0,0 +1,153 @@ +# Ruby Client for the Cloud Workstations V1BETA API + +Allows administrators to create managed developer environments in the cloud. + + +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 Workstations V1BETA API. Most users should consider using +the main client gem, +[google-cloud-workstations](https://rubygems.org/gems/google-cloud-workstations). +See the section below titled *Which client should I use?* for more information. + +## Installation + +``` +$ gem install google-cloud-workstations-v1beta +``` + +## 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/workstations.googleapis.com) +1. [Set up authentication.](AUTHENTICATION.md) + +## Quick Start + +```ruby +require "google/cloud/workstations/v1beta" + +client = ::Google::Cloud::Workstations::V1beta::Workstations::Client.new +request = ::Google::Cloud::Workstations::V1beta::GetWorkstationClusterRequest.new # (request fields as keyword arguments...) +response = client.get_workstation_cluster request +``` + +View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-workstations-v1beta/latest) +for class and method documentation. + +See also the [Product Documentation](https://cloud.google.com/workstations/docs) +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/workstations/v1beta" +require "logger" + +client = ::Google::Cloud::Workstations::V1beta::Workstations::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-workstations`, +and lower-level _versioned_ client libraries with names such as +`google-cloud-workstations-v1beta`. +_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-workstations`. +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-workstations-v1beta`. + +### 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-workstations-v1beta/Rakefile b/owl-bot-staging/google-cloud-workstations-v1beta/Rakefile new file mode 100644 index 000000000000..19a6e40ad1cb --- /dev/null +++ b/owl-bot-staging/google-cloud-workstations-v1beta/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-workstations-v1beta acceptance tests." +task :acceptance, :project, :keyfile do |t, args| + project = args[:project] + project ||= + ENV["GOOGLE_CLOUD_TEST_PROJECT"] || + ENV["GCLOUD_TEST_PROJECT"] + keyfile = args[:keyfile] + keyfile ||= + ENV["GOOGLE_CLOUD_TEST_KEYFILE"] || + ENV["GCLOUD_TEST_KEYFILE"] + if keyfile + keyfile = File.read keyfile + else + keyfile ||= + ENV["GOOGLE_CLOUD_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 GOOGLE_CLOUD_TEST_PROJECT=test123 GOOGLE_CLOUD_TEST_KEYFILE=/path/to/keyfile.json rake acceptance" + end + require "google/cloud/workstations/v1beta/workstations/credentials" + ::Google::Cloud::Workstations::V1beta::Workstations::Credentials.env_vars.each do |path| + ENV[path] = nil + end + ENV["GOOGLE_CLOUD_PROJECT"] = project + ENV["GOOGLE_CLOUD_TEST_PROJECT"] = project + ENV["GOOGLE_CLOUD_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-workstations-v1beta 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-workstations-v1beta 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-workstations-v1beta 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-workstations-v1beta gem does not have doctest tests." +end + +desc "Run the CI build" +task :ci do + header "BUILDING google-cloud-workstations-v1beta" + header "google-cloud-workstations-v1beta rubocop", "*" + Rake::Task[:rubocop].invoke + header "google-cloud-workstations-v1beta yard", "*" + Rake::Task[:yard].invoke + header "google-cloud-workstations-v1beta 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-workstations-v1beta 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-workstations-v1beta 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-workstations-v1beta/gapic_metadata.json b/owl-bot-staging/google-cloud-workstations-v1beta/gapic_metadata.json new file mode 100644 index 000000000000..f14a54eb9f14 --- /dev/null +++ b/owl-bot-staging/google-cloud-workstations-v1beta/gapic_metadata.json @@ -0,0 +1,118 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "ruby", + "protoPackage": "google.cloud.workstations.v1beta", + "libraryPackage": "::Google::Cloud::Workstations::V1beta", + "services": { + "Workstations": { + "clients": { + "grpc": { + "libraryClient": "::Google::Cloud::Workstations::V1beta::Workstations::Client", + "rpcs": { + "GetWorkstationCluster": { + "methods": [ + "get_workstation_cluster" + ] + }, + "ListWorkstationClusters": { + "methods": [ + "list_workstation_clusters" + ] + }, + "CreateWorkstationCluster": { + "methods": [ + "create_workstation_cluster" + ] + }, + "UpdateWorkstationCluster": { + "methods": [ + "update_workstation_cluster" + ] + }, + "DeleteWorkstationCluster": { + "methods": [ + "delete_workstation_cluster" + ] + }, + "GetWorkstationConfig": { + "methods": [ + "get_workstation_config" + ] + }, + "ListWorkstationConfigs": { + "methods": [ + "list_workstation_configs" + ] + }, + "ListUsableWorkstationConfigs": { + "methods": [ + "list_usable_workstation_configs" + ] + }, + "CreateWorkstationConfig": { + "methods": [ + "create_workstation_config" + ] + }, + "UpdateWorkstationConfig": { + "methods": [ + "update_workstation_config" + ] + }, + "DeleteWorkstationConfig": { + "methods": [ + "delete_workstation_config" + ] + }, + "GetWorkstation": { + "methods": [ + "get_workstation" + ] + }, + "ListWorkstations": { + "methods": [ + "list_workstations" + ] + }, + "ListUsableWorkstations": { + "methods": [ + "list_usable_workstations" + ] + }, + "CreateWorkstation": { + "methods": [ + "create_workstation" + ] + }, + "UpdateWorkstation": { + "methods": [ + "update_workstation" + ] + }, + "DeleteWorkstation": { + "methods": [ + "delete_workstation" + ] + }, + "StartWorkstation": { + "methods": [ + "start_workstation" + ] + }, + "StopWorkstation": { + "methods": [ + "stop_workstation" + ] + }, + "GenerateAccessToken": { + "methods": [ + "generate_access_token" + ] + } + } + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-workstations-v1beta/google-cloud-workstations-v1beta.gemspec b/owl-bot-staging/google-cloud-workstations-v1beta/google-cloud-workstations-v1beta.gemspec new file mode 100644 index 000000000000..5c79f5000963 --- /dev/null +++ b/owl-bot-staging/google-cloud-workstations-v1beta/google-cloud-workstations-v1beta.gemspec @@ -0,0 +1,30 @@ +# -*- ruby -*- +# encoding: utf-8 + +require File.expand_path("lib/google/cloud/workstations/v1beta/version", __dir__) + +Gem::Specification.new do |gem| + gem.name = "google-cloud-workstations-v1beta" + gem.version = Google::Cloud::Workstations::V1beta::VERSION + + gem.authors = ["Google LLC"] + gem.email = "googleapis-packages@google.com" + gem.description = "Allows administrators to create managed developer environments in the cloud. Note that google-cloud-workstations-v1beta is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-workstations instead. See the readme for more details." + gem.summary = "Allows administrators to create managed developer environments in the cloud." + 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.2" + + 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-workstations-v1beta/lib/google-cloud-workstations-v1beta.rb b/owl-bot-staging/google-cloud-workstations-v1beta/lib/google-cloud-workstations-v1beta.rb new file mode 100644 index 000000000000..a0188c280162 --- /dev/null +++ b/owl-bot-staging/google-cloud-workstations-v1beta/lib/google-cloud-workstations-v1beta.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/workstations/v1beta" diff --git a/owl-bot-staging/google-cloud-workstations-v1beta/lib/google/cloud/workstations/v1beta.rb b/owl-bot-staging/google-cloud-workstations-v1beta/lib/google/cloud/workstations/v1beta.rb new file mode 100644 index 000000000000..c7ef63fc2912 --- /dev/null +++ b/owl-bot-staging/google-cloud-workstations-v1beta/lib/google/cloud/workstations/v1beta.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/workstations/v1beta/workstations" +require "google/cloud/workstations/v1beta/version" + +module Google + module Cloud + module Workstations + ## + # API client module. + # + # @example Load this package, including all its services, and instantiate a gRPC client + # + # require "google/cloud/workstations/v1beta" + # client = ::Google::Cloud::Workstations::V1beta::Workstations::Client.new + # + # @example Load this package, including all its services, and instantiate a REST client + # + # require "google/cloud/workstations/v1beta" + # client = ::Google::Cloud::Workstations::V1beta::Workstations::Rest::Client.new + # + module V1beta + end + end + end +end + +helper_path = ::File.join __dir__, "v1beta", "_helpers.rb" +require "google/cloud/workstations/v1beta/_helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-workstations-v1beta/lib/google/cloud/workstations/v1beta/bindings_override.rb b/owl-bot-staging/google-cloud-workstations-v1beta/lib/google/cloud/workstations/v1beta/bindings_override.rb new file mode 100644 index 000000000000..2b52965b4f26 --- /dev/null +++ b/owl-bot-staging/google-cloud-workstations-v1beta/lib/google/cloud/workstations/v1beta/bindings_override.rb @@ -0,0 +1,110 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Workstations + ## + # @example Loading just the REST part of this package, including all its services, and instantiating a REST client + # + # require "google/cloud/workstations/v1beta/rest" + # client = ::Google::Cloud::Workstations::V1beta::Workstations::Rest::Client.new + # + module V1beta + ## + # @private + # Initialize the mixin bindings configuration + # + def self.configure + @configure ||= begin + namespace = ["Google", "Cloud", "Workstations"] + 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.iam.v1.IAMPolicy.GetIamPolicy"] = [ + Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( + uri_method: :get, + uri_template: "/v1beta/{resource}:getIamPolicy", + matches: [ + ["resource", %r{^projects/[^/]+/locations/[^/]+/workstationClusters/[^/]+/workstationConfigs/[^/]+/?$}, false] + ], + body: nil + ), + Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( + uri_method: :get, + uri_template: "/v1beta/{resource}:getIamPolicy", + matches: [ + ["resource", %r{^projects/[^/]+/locations/[^/]+/workstationClusters/[^/]+/workstationConfigs/[^/]+/workstations/[^/]+/?$}, false] + ], + body: nil + ) + ] + default_config.bindings_override["google.iam.v1.IAMPolicy.SetIamPolicy"] = [ + + Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( + uri_method: :post, + uri_template: "/v1beta/{resource}:setIamPolicy", + matches: [ + ["resource", %r{^projects/[^/]+/locations/[^/]+/workstationClusters/[^/]+/workstationConfigs/[^/]+/?$}, false] + ], + body: "*" + ), + Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( + uri_method: :post, + uri_template: "/v1beta/{resource}:setIamPolicy", + matches: [ + ["resource", %r{^projects/[^/]+/locations/[^/]+/workstationClusters/[^/]+/workstationConfigs/[^/]+/workstations/[^/]+/?$}, false] + ], + body: "*" + ) + ] + default_config.bindings_override["google.iam.v1.IAMPolicy.TestIamPermissions"] = [ + + Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( + uri_method: :post, + uri_template: "/v1beta/{resource}:testIamPermissions", + matches: [ + ["resource", %r{^projects/[^/]+/locations/[^/]+/workstationClusters/[^/]+/workstationConfigs/[^/]+/?$}, false] + ], + body: "*" + ), + Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( + uri_method: :post, + uri_template: "/v1beta/{resource}:testIamPermissions", + matches: [ + ["resource", %r{^projects/[^/]+/locations/[^/]+/workstationClusters/[^/]+/workstationConfigs/[^/]+/workstations/[^/]+/?$}, false] + ], + body: "*" + ) + ] + default_config + end + yield @configure if block_given? + @configure + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-workstations-v1beta/lib/google/cloud/workstations/v1beta/rest.rb b/owl-bot-staging/google-cloud-workstations-v1beta/lib/google/cloud/workstations/v1beta/rest.rb new file mode 100644 index 000000000000..80bc9428e548 --- /dev/null +++ b/owl-bot-staging/google-cloud-workstations-v1beta/lib/google/cloud/workstations/v1beta/rest.rb @@ -0,0 +1,38 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/workstations/v1beta/workstations/rest" +require "google/cloud/workstations/v1beta/bindings_override" +require "google/cloud/workstations/v1beta/version" + +module Google + module Cloud + module Workstations + ## + # To load just the REST part of this package, including all its services, and instantiate a REST client: + # + # @example + # + # require "google/cloud/workstations/v1beta/rest" + # client = ::Google::Cloud::Workstations::V1beta::Workstations::Rest::Client.new + # + module V1beta + end + end + end +end diff --git a/owl-bot-staging/google-cloud-workstations-v1beta/lib/google/cloud/workstations/v1beta/version.rb b/owl-bot-staging/google-cloud-workstations-v1beta/lib/google/cloud/workstations/v1beta/version.rb new file mode 100644 index 000000000000..4f71d3f1ee75 --- /dev/null +++ b/owl-bot-staging/google-cloud-workstations-v1beta/lib/google/cloud/workstations/v1beta/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 Workstations + module V1beta + VERSION = "0.0.1" + end + end + end +end diff --git a/owl-bot-staging/google-cloud-workstations-v1beta/lib/google/cloud/workstations/v1beta/workstations.rb b/owl-bot-staging/google-cloud-workstations-v1beta/lib/google/cloud/workstations/v1beta/workstations.rb new file mode 100644 index 000000000000..b0c7dfb12bbf --- /dev/null +++ b/owl-bot-staging/google-cloud-workstations-v1beta/lib/google/cloud/workstations/v1beta/workstations.rb @@ -0,0 +1,56 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/workstations/v1beta/version" + +require "google/cloud/workstations/v1beta/workstations/credentials" +require "google/cloud/workstations/v1beta/workstations/paths" +require "google/cloud/workstations/v1beta/workstations/operations" +require "google/cloud/workstations/v1beta/workstations/client" +require "google/cloud/workstations/v1beta/workstations/rest" + +module Google + module Cloud + module Workstations + module V1beta + ## + # Service for interacting with Cloud Workstations. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/cloud/workstations/v1beta/workstations" + # client = ::Google::Cloud::Workstations::V1beta::Workstations::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/cloud/workstations/v1beta/workstations/rest" + # client = ::Google::Cloud::Workstations::V1beta::Workstations::Rest::Client.new + # + module Workstations + end + end + end + end +end + +helper_path = ::File.join __dir__, "workstations", "helpers.rb" +require "google/cloud/workstations/v1beta/workstations/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-workstations-v1beta/lib/google/cloud/workstations/v1beta/workstations/client.rb b/owl-bot-staging/google-cloud-workstations-v1beta/lib/google/cloud/workstations/v1beta/workstations/client.rb new file mode 100644 index 000000000000..0921d9287c0a --- /dev/null +++ b/owl-bot-staging/google-cloud-workstations-v1beta/lib/google/cloud/workstations/v1beta/workstations/client.rb @@ -0,0 +1,2595 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/workstations/v1beta/workstations_pb" +require "google/cloud/location" +require "google/iam/v1" + +module Google + module Cloud + module Workstations + module V1beta + module Workstations + ## + # Client for the Workstations service. + # + # Service for interacting with Cloud Workstations. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "workstations.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :workstations_stub + + ## + # Configure the Workstations Client class. + # + # See {::Google::Cloud::Workstations::V1beta::Workstations::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all Workstations clients + # ::Google::Cloud::Workstations::V1beta::Workstations::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", "Workstations", "V1beta"] + 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.get_workstation_cluster.timeout = 60.0 + default_config.rpcs.get_workstation_cluster.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.list_workstation_clusters.timeout = 60.0 + default_config.rpcs.list_workstation_clusters.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.create_workstation_cluster.timeout = 60.0 + + default_config.rpcs.update_workstation_cluster.timeout = 60.0 + + default_config.rpcs.delete_workstation_cluster.timeout = 60.0 + + default_config.rpcs.get_workstation_config.timeout = 60.0 + default_config.rpcs.get_workstation_config.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.list_workstation_configs.timeout = 60.0 + default_config.rpcs.list_workstation_configs.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.list_usable_workstation_configs.timeout = 60.0 + default_config.rpcs.list_usable_workstation_configs.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.create_workstation_config.timeout = 60.0 + + default_config.rpcs.update_workstation_config.timeout = 60.0 + + default_config.rpcs.delete_workstation_config.timeout = 60.0 + + default_config.rpcs.get_workstation.timeout = 60.0 + default_config.rpcs.get_workstation.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.list_workstations.timeout = 60.0 + default_config.rpcs.list_workstations.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.list_usable_workstations.timeout = 60.0 + default_config.rpcs.list_usable_workstations.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.create_workstation.timeout = 60.0 + + default_config.rpcs.update_workstation.timeout = 60.0 + + default_config.rpcs.delete_workstation.timeout = 60.0 + + default_config.rpcs.start_workstation.timeout = 60.0 + + default_config.rpcs.stop_workstation.timeout = 60.0 + + default_config.rpcs.generate_access_token.timeout = 60.0 + default_config.rpcs.generate_access_token.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the Workstations 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::Workstations::V1beta::Workstations::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 + @workstations_stub.universe_domain + end + + ## + # Create a new Workstations client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Workstations::V1beta::Workstations::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Workstations::V1beta::Workstations::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Workstations 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/workstations/v1beta/workstations_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 + + @workstations_stub = ::Gapic::ServiceStub.new( + ::Google::Cloud::Workstations::V1beta::Workstations::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 + ) + + @workstations_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 = @workstations_stub.endpoint + config.universe_domain = @workstations_stub.universe_domain + config.logger = @workstations_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 = @workstations_stub.endpoint + config.universe_domain = @workstations_stub.universe_domain + config.logger = @workstations_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::Workstations::V1beta::Workstations::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 + @workstations_stub.logger + end + + # Service calls + + ## + # Returns the requested workstation cluster. + # + # @overload get_workstation_cluster(request, options = nil) + # Pass arguments to `get_workstation_cluster` via a request object, either of type + # {::Google::Cloud::Workstations::V1beta::GetWorkstationClusterRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Workstations::V1beta::GetWorkstationClusterRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_workstation_cluster(name: nil) + # Pass arguments to `get_workstation_cluster` via keyword arguments. Note that at + # least one keyword argument is 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 requested resource. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Workstations::V1beta::WorkstationCluster] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Workstations::V1beta::WorkstationCluster] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/workstations/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Workstations::V1beta::Workstations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Workstations::V1beta::GetWorkstationClusterRequest.new + # + # # Call the get_workstation_cluster method. + # result = client.get_workstation_cluster request + # + # # The returned object is of type Google::Cloud::Workstations::V1beta::WorkstationCluster. + # p result + # + def get_workstation_cluster request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workstations::V1beta::GetWorkstationClusterRequest + + # Converts hash 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_workstation_cluster.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::Workstations::V1beta::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_workstation_cluster.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_workstation_cluster.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @workstations_stub.call_rpc :get_workstation_cluster, 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 all workstation clusters in the specified location. + # + # @overload list_workstation_clusters(request, options = nil) + # Pass arguments to `list_workstation_clusters` via a request object, either of type + # {::Google::Cloud::Workstations::V1beta::ListWorkstationClustersRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Workstations::V1beta::ListWorkstationClustersRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_workstation_clusters(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_workstation_clusters` via keyword arguments. Note that at + # least one keyword argument is 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. Parent resource name. + # @param page_size [::Integer] + # Optional. Maximum number of items to return. + # @param page_token [::String] + # Optional. next_page_token value returned from a previous List request, if + # any. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Workstations::V1beta::WorkstationCluster>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::Workstations::V1beta::WorkstationCluster>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/workstations/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Workstations::V1beta::Workstations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Workstations::V1beta::ListWorkstationClustersRequest.new + # + # # Call the list_workstation_clusters method. + # result = client.list_workstation_clusters 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::Workstations::V1beta::WorkstationCluster. + # p item + # end + # + def list_workstation_clusters request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workstations::V1beta::ListWorkstationClustersRequest + + # Converts hash 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_workstation_clusters.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::Workstations::V1beta::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_workstation_clusters.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_workstation_clusters.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @workstations_stub.call_rpc :list_workstation_clusters, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @workstations_stub, :list_workstation_clusters, 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 + + ## + # Creates a new workstation cluster. + # + # @overload create_workstation_cluster(request, options = nil) + # Pass arguments to `create_workstation_cluster` via a request object, either of type + # {::Google::Cloud::Workstations::V1beta::CreateWorkstationClusterRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Workstations::V1beta::CreateWorkstationClusterRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_workstation_cluster(parent: nil, workstation_cluster_id: nil, workstation_cluster: nil, validate_only: nil) + # Pass arguments to `create_workstation_cluster` via keyword arguments. Note that at + # least one keyword argument is 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. Parent resource name. + # @param workstation_cluster_id [::String] + # Required. ID to use for the workstation cluster. + # @param workstation_cluster [::Google::Cloud::Workstations::V1beta::WorkstationCluster, ::Hash] + # Required. Workstation cluster to create. + # @param validate_only [::Boolean] + # Optional. If set, validate the request and preview the review, but do not + # actually apply it. + # + # @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/workstations/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Workstations::V1beta::Workstations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Workstations::V1beta::CreateWorkstationClusterRequest.new + # + # # Call the create_workstation_cluster method. + # result = client.create_workstation_cluster 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_workstation_cluster request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workstations::V1beta::CreateWorkstationClusterRequest + + # Converts hash 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_workstation_cluster.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::Workstations::V1beta::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_workstation_cluster.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_workstation_cluster.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @workstations_stub.call_rpc :create_workstation_cluster, 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 + + ## + # Updates an existing workstation cluster. + # + # @overload update_workstation_cluster(request, options = nil) + # Pass arguments to `update_workstation_cluster` via a request object, either of type + # {::Google::Cloud::Workstations::V1beta::UpdateWorkstationClusterRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Workstations::V1beta::UpdateWorkstationClusterRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_workstation_cluster(workstation_cluster: nil, update_mask: nil, validate_only: nil, allow_missing: nil) + # Pass arguments to `update_workstation_cluster` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param workstation_cluster [::Google::Cloud::Workstations::V1beta::WorkstationCluster, ::Hash] + # Required. Workstation cluster to update. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. Mask that specifies which fields in the workstation cluster + # should be updated. + # @param validate_only [::Boolean] + # Optional. If set, validate the request and preview the review, but do not + # actually apply it. + # @param allow_missing [::Boolean] + # Optional. If set, and the workstation cluster is not found, a new + # workstation cluster will be created. In this situation, update_mask is + # ignored. + # + # @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/workstations/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Workstations::V1beta::Workstations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Workstations::V1beta::UpdateWorkstationClusterRequest.new + # + # # Call the update_workstation_cluster method. + # result = client.update_workstation_cluster 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 update_workstation_cluster request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workstations::V1beta::UpdateWorkstationClusterRequest + + # Converts hash 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_workstation_cluster.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::Workstations::V1beta::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.workstation_cluster&.name + header_params["workstation_cluster.name"] = request.workstation_cluster.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_workstation_cluster.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_workstation_cluster.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @workstations_stub.call_rpc :update_workstation_cluster, 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 the specified workstation cluster. + # + # @overload delete_workstation_cluster(request, options = nil) + # Pass arguments to `delete_workstation_cluster` via a request object, either of type + # {::Google::Cloud::Workstations::V1beta::DeleteWorkstationClusterRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Workstations::V1beta::DeleteWorkstationClusterRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_workstation_cluster(name: nil, validate_only: nil, etag: nil, force: nil) + # Pass arguments to `delete_workstation_cluster` via keyword arguments. Note that at + # least one keyword argument is 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 workstation cluster to delete. + # @param validate_only [::Boolean] + # Optional. If set, validate the request and preview the review, but do not + # apply it. + # @param etag [::String] + # Optional. If set, the request will be rejected if the latest version of the + # workstation cluster on the server does not have this ETag. + # @param force [::Boolean] + # Optional. If set, any workstation configurations and workstations in the + # workstation cluster are also deleted. Otherwise, the request only + # works if the workstation cluster has no configurations or workstations. + # + # @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/workstations/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Workstations::V1beta::Workstations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Workstations::V1beta::DeleteWorkstationClusterRequest.new + # + # # Call the delete_workstation_cluster method. + # result = client.delete_workstation_cluster 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_workstation_cluster request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workstations::V1beta::DeleteWorkstationClusterRequest + + # Converts hash 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_workstation_cluster.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::Workstations::V1beta::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_workstation_cluster.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_workstation_cluster.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @workstations_stub.call_rpc :delete_workstation_cluster, 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 requested workstation configuration. + # + # @overload get_workstation_config(request, options = nil) + # Pass arguments to `get_workstation_config` via a request object, either of type + # {::Google::Cloud::Workstations::V1beta::GetWorkstationConfigRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Workstations::V1beta::GetWorkstationConfigRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_workstation_config(name: nil) + # Pass arguments to `get_workstation_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 requested resource. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Workstations::V1beta::WorkstationConfig] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Workstations::V1beta::WorkstationConfig] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/workstations/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Workstations::V1beta::Workstations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Workstations::V1beta::GetWorkstationConfigRequest.new + # + # # Call the get_workstation_config method. + # result = client.get_workstation_config request + # + # # The returned object is of type Google::Cloud::Workstations::V1beta::WorkstationConfig. + # p result + # + def get_workstation_config request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workstations::V1beta::GetWorkstationConfigRequest + + # Converts hash 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_workstation_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::Workstations::V1beta::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_workstation_config.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_workstation_config.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @workstations_stub.call_rpc :get_workstation_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 all workstation configurations in the specified cluster. + # + # @overload list_workstation_configs(request, options = nil) + # Pass arguments to `list_workstation_configs` via a request object, either of type + # {::Google::Cloud::Workstations::V1beta::ListWorkstationConfigsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Workstations::V1beta::ListWorkstationConfigsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_workstation_configs(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_workstation_configs` via keyword arguments. Note that at + # least one keyword argument is 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. Parent resource name. + # @param page_size [::Integer] + # Optional. Maximum number of items to return. + # @param page_token [::String] + # Optional. next_page_token value returned from a previous List request, if + # any. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Workstations::V1beta::WorkstationConfig>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::Workstations::V1beta::WorkstationConfig>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/workstations/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Workstations::V1beta::Workstations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Workstations::V1beta::ListWorkstationConfigsRequest.new + # + # # Call the list_workstation_configs method. + # result = client.list_workstation_configs 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::Workstations::V1beta::WorkstationConfig. + # p item + # end + # + def list_workstation_configs request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workstations::V1beta::ListWorkstationConfigsRequest + + # Converts hash 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_workstation_configs.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::Workstations::V1beta::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_workstation_configs.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_workstation_configs.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @workstations_stub.call_rpc :list_workstation_configs, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @workstations_stub, :list_workstation_configs, 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 all workstation configurations in the specified cluster on which + # the caller has the "workstations.workstation.create" permission. + # + # @overload list_usable_workstation_configs(request, options = nil) + # Pass arguments to `list_usable_workstation_configs` via a request object, either of type + # {::Google::Cloud::Workstations::V1beta::ListUsableWorkstationConfigsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Workstations::V1beta::ListUsableWorkstationConfigsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_usable_workstation_configs(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_usable_workstation_configs` via keyword arguments. Note that at + # least one keyword argument is 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. Parent resource name. + # @param page_size [::Integer] + # Optional. Maximum number of items to return. + # @param page_token [::String] + # Optional. next_page_token value returned from a previous List request, if + # any. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Workstations::V1beta::WorkstationConfig>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::Workstations::V1beta::WorkstationConfig>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/workstations/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Workstations::V1beta::Workstations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Workstations::V1beta::ListUsableWorkstationConfigsRequest.new + # + # # Call the list_usable_workstation_configs method. + # result = client.list_usable_workstation_configs 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::Workstations::V1beta::WorkstationConfig. + # p item + # end + # + def list_usable_workstation_configs request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workstations::V1beta::ListUsableWorkstationConfigsRequest + + # Converts hash 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_usable_workstation_configs.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::Workstations::V1beta::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_usable_workstation_configs.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_usable_workstation_configs.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @workstations_stub.call_rpc :list_usable_workstation_configs, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @workstations_stub, :list_usable_workstation_configs, 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 + + ## + # Creates a new workstation configuration. + # + # @overload create_workstation_config(request, options = nil) + # Pass arguments to `create_workstation_config` via a request object, either of type + # {::Google::Cloud::Workstations::V1beta::CreateWorkstationConfigRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Workstations::V1beta::CreateWorkstationConfigRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_workstation_config(parent: nil, workstation_config_id: nil, workstation_config: nil, validate_only: nil) + # Pass arguments to `create_workstation_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. Parent resource name. + # @param workstation_config_id [::String] + # Required. ID to use for the workstation configuration. + # @param workstation_config [::Google::Cloud::Workstations::V1beta::WorkstationConfig, ::Hash] + # Required. Config to create. + # @param validate_only [::Boolean] + # Optional. If set, validate the request and preview the review, but do not + # actually apply it. + # + # @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/workstations/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Workstations::V1beta::Workstations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Workstations::V1beta::CreateWorkstationConfigRequest.new + # + # # Call the create_workstation_config method. + # result = client.create_workstation_config 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_workstation_config request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workstations::V1beta::CreateWorkstationConfigRequest + + # Converts hash 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_workstation_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::Workstations::V1beta::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_workstation_config.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_workstation_config.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @workstations_stub.call_rpc :create_workstation_config, 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 + + ## + # Updates an existing workstation configuration. + # + # @overload update_workstation_config(request, options = nil) + # Pass arguments to `update_workstation_config` via a request object, either of type + # {::Google::Cloud::Workstations::V1beta::UpdateWorkstationConfigRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Workstations::V1beta::UpdateWorkstationConfigRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_workstation_config(workstation_config: nil, update_mask: nil, validate_only: nil, allow_missing: nil) + # Pass arguments to `update_workstation_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 workstation_config [::Google::Cloud::Workstations::V1beta::WorkstationConfig, ::Hash] + # Required. Config to update. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. Mask specifying which fields in the workstation configuration + # should be updated. + # @param validate_only [::Boolean] + # Optional. If set, validate the request and preview the review, but do not + # actually apply it. + # @param allow_missing [::Boolean] + # Optional. If set and the workstation configuration is not found, a new + # workstation configuration will be created. In this situation, + # update_mask is ignored. + # + # @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/workstations/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Workstations::V1beta::Workstations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Workstations::V1beta::UpdateWorkstationConfigRequest.new + # + # # Call the update_workstation_config method. + # result = client.update_workstation_config 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 update_workstation_config request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workstations::V1beta::UpdateWorkstationConfigRequest + + # Converts hash 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_workstation_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::Workstations::V1beta::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.workstation_config&.name + header_params["workstation_config.name"] = request.workstation_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_workstation_config.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_workstation_config.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @workstations_stub.call_rpc :update_workstation_config, 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 the specified workstation configuration. + # + # @overload delete_workstation_config(request, options = nil) + # Pass arguments to `delete_workstation_config` via a request object, either of type + # {::Google::Cloud::Workstations::V1beta::DeleteWorkstationConfigRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Workstations::V1beta::DeleteWorkstationConfigRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_workstation_config(name: nil, validate_only: nil, etag: nil, force: nil) + # Pass arguments to `delete_workstation_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 workstation configuration to delete. + # @param validate_only [::Boolean] + # Optional. If set, validate the request and preview the review, but do not + # actually apply it. + # @param etag [::String] + # Optional. If set, the request is rejected if the latest version of the + # workstation configuration on the server does not have this ETag. + # @param force [::Boolean] + # Optional. If set, any workstations in the workstation configuration are + # also deleted. Otherwise, the request works only if the workstation + # configuration has no workstations. + # + # @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/workstations/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Workstations::V1beta::Workstations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Workstations::V1beta::DeleteWorkstationConfigRequest.new + # + # # Call the delete_workstation_config method. + # result = client.delete_workstation_config 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_workstation_config request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workstations::V1beta::DeleteWorkstationConfigRequest + + # Converts hash 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_workstation_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::Workstations::V1beta::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_workstation_config.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_workstation_config.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @workstations_stub.call_rpc :delete_workstation_config, 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 requested workstation. + # + # @overload get_workstation(request, options = nil) + # Pass arguments to `get_workstation` via a request object, either of type + # {::Google::Cloud::Workstations::V1beta::GetWorkstationRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Workstations::V1beta::GetWorkstationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_workstation(name: nil) + # Pass arguments to `get_workstation` via keyword arguments. Note that at + # least one keyword argument is 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 requested resource. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Workstations::V1beta::Workstation] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Workstations::V1beta::Workstation] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/workstations/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Workstations::V1beta::Workstations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Workstations::V1beta::GetWorkstationRequest.new + # + # # Call the get_workstation method. + # result = client.get_workstation request + # + # # The returned object is of type Google::Cloud::Workstations::V1beta::Workstation. + # p result + # + def get_workstation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workstations::V1beta::GetWorkstationRequest + + # Converts hash 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_workstation.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::Workstations::V1beta::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_workstation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_workstation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @workstations_stub.call_rpc :get_workstation, 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 all Workstations using the specified workstation configuration. + # + # @overload list_workstations(request, options = nil) + # Pass arguments to `list_workstations` via a request object, either of type + # {::Google::Cloud::Workstations::V1beta::ListWorkstationsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Workstations::V1beta::ListWorkstationsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_workstations(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_workstations` via keyword arguments. Note that at + # least one keyword argument is 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. Parent resource name. + # @param page_size [::Integer] + # Optional. Maximum number of items to return. + # @param page_token [::String] + # Optional. next_page_token value returned from a previous List request, if + # any. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Workstations::V1beta::Workstation>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::Workstations::V1beta::Workstation>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/workstations/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Workstations::V1beta::Workstations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Workstations::V1beta::ListWorkstationsRequest.new + # + # # Call the list_workstations method. + # result = client.list_workstations 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::Workstations::V1beta::Workstation. + # p item + # end + # + def list_workstations request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workstations::V1beta::ListWorkstationsRequest + + # Converts hash 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_workstations.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::Workstations::V1beta::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_workstations.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_workstations.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @workstations_stub.call_rpc :list_workstations, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @workstations_stub, :list_workstations, 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 all workstations using the specified workstation configuration + # on which the caller has the "workstations.workstations.use" permission. + # + # @overload list_usable_workstations(request, options = nil) + # Pass arguments to `list_usable_workstations` via a request object, either of type + # {::Google::Cloud::Workstations::V1beta::ListUsableWorkstationsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Workstations::V1beta::ListUsableWorkstationsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_usable_workstations(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_usable_workstations` via keyword arguments. Note that at + # least one keyword argument is 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. Parent resource name. + # @param page_size [::Integer] + # Optional. Maximum number of items to return. + # @param page_token [::String] + # Optional. next_page_token value returned from a previous List request, if + # any. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Workstations::V1beta::Workstation>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Cloud::Workstations::V1beta::Workstation>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/workstations/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Workstations::V1beta::Workstations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Workstations::V1beta::ListUsableWorkstationsRequest.new + # + # # Call the list_usable_workstations method. + # result = client.list_usable_workstations 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::Workstations::V1beta::Workstation. + # p item + # end + # + def list_usable_workstations request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workstations::V1beta::ListUsableWorkstationsRequest + + # Converts hash 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_usable_workstations.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::Workstations::V1beta::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_usable_workstations.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_usable_workstations.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @workstations_stub.call_rpc :list_usable_workstations, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @workstations_stub, :list_usable_workstations, 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 + + ## + # Creates a new workstation. + # + # @overload create_workstation(request, options = nil) + # Pass arguments to `create_workstation` via a request object, either of type + # {::Google::Cloud::Workstations::V1beta::CreateWorkstationRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Workstations::V1beta::CreateWorkstationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_workstation(parent: nil, workstation_id: nil, workstation: nil, validate_only: nil) + # Pass arguments to `create_workstation` via keyword arguments. Note that at + # least one keyword argument is 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. Parent resource name. + # @param workstation_id [::String] + # Required. ID to use for the workstation. + # @param workstation [::Google::Cloud::Workstations::V1beta::Workstation, ::Hash] + # Required. Workstation to create. + # @param validate_only [::Boolean] + # Optional. If set, validate the request and preview the review, but do not + # actually apply it. + # + # @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/workstations/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Workstations::V1beta::Workstations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Workstations::V1beta::CreateWorkstationRequest.new + # + # # Call the create_workstation method. + # result = client.create_workstation 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_workstation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workstations::V1beta::CreateWorkstationRequest + + # Converts hash 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_workstation.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::Workstations::V1beta::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_workstation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_workstation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @workstations_stub.call_rpc :create_workstation, 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 + + ## + # Updates an existing workstation. + # + # @overload update_workstation(request, options = nil) + # Pass arguments to `update_workstation` via a request object, either of type + # {::Google::Cloud::Workstations::V1beta::UpdateWorkstationRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Workstations::V1beta::UpdateWorkstationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_workstation(workstation: nil, update_mask: nil, validate_only: nil, allow_missing: nil) + # Pass arguments to `update_workstation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param workstation [::Google::Cloud::Workstations::V1beta::Workstation, ::Hash] + # Required. Workstation to update. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. Mask specifying which fields in the workstation configuration + # should be updated. + # @param validate_only [::Boolean] + # Optional. If set, validate the request and preview the review, but do not + # actually apply it. + # @param allow_missing [::Boolean] + # Optional. If set and the workstation configuration is not found, a new + # workstation configuration is created. In this situation, update_mask + # is ignored. + # + # @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/workstations/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Workstations::V1beta::Workstations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Workstations::V1beta::UpdateWorkstationRequest.new + # + # # Call the update_workstation method. + # result = client.update_workstation 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 update_workstation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workstations::V1beta::UpdateWorkstationRequest + + # Converts hash 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_workstation.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::Workstations::V1beta::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.workstation&.name + header_params["workstation.name"] = request.workstation.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_workstation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_workstation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @workstations_stub.call_rpc :update_workstation, 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 the specified workstation. + # + # @overload delete_workstation(request, options = nil) + # Pass arguments to `delete_workstation` via a request object, either of type + # {::Google::Cloud::Workstations::V1beta::DeleteWorkstationRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Workstations::V1beta::DeleteWorkstationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_workstation(name: nil, validate_only: nil, etag: nil) + # Pass arguments to `delete_workstation` via keyword arguments. Note that at + # least one keyword argument is 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 workstation to delete. + # @param validate_only [::Boolean] + # Optional. If set, validate the request and preview the review, but do not + # actually apply it. + # @param etag [::String] + # Optional. If set, the request will be rejected if the latest version of the + # workstation on the server does not have this ETag. + # + # @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/workstations/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Workstations::V1beta::Workstations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Workstations::V1beta::DeleteWorkstationRequest.new + # + # # Call the delete_workstation method. + # result = client.delete_workstation 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_workstation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workstations::V1beta::DeleteWorkstationRequest + + # Converts hash 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_workstation.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::Workstations::V1beta::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_workstation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_workstation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @workstations_stub.call_rpc :delete_workstation, 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 + + ## + # Starts running a workstation so that users can connect to it. + # + # @overload start_workstation(request, options = nil) + # Pass arguments to `start_workstation` via a request object, either of type + # {::Google::Cloud::Workstations::V1beta::StartWorkstationRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Workstations::V1beta::StartWorkstationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload start_workstation(name: nil, validate_only: nil, etag: nil) + # Pass arguments to `start_workstation` via keyword arguments. Note that at + # least one keyword argument is 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 workstation to start. + # @param validate_only [::Boolean] + # Optional. If set, validate the request and preview the review, but do not + # actually apply it. + # @param etag [::String] + # Optional. If set, the request will be rejected if the latest version of the + # workstation on the server does not have this ETag. + # + # @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/workstations/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Workstations::V1beta::Workstations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Workstations::V1beta::StartWorkstationRequest.new + # + # # Call the start_workstation method. + # result = client.start_workstation 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 start_workstation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workstations::V1beta::StartWorkstationRequest + + # Converts hash 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.start_workstation.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::Workstations::V1beta::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.start_workstation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.start_workstation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @workstations_stub.call_rpc :start_workstation, 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 + + ## + # Stops running a workstation, reducing costs. + # + # @overload stop_workstation(request, options = nil) + # Pass arguments to `stop_workstation` via a request object, either of type + # {::Google::Cloud::Workstations::V1beta::StopWorkstationRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Workstations::V1beta::StopWorkstationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload stop_workstation(name: nil, validate_only: nil, etag: nil) + # Pass arguments to `stop_workstation` via keyword arguments. Note that at + # least one keyword argument is 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 workstation to stop. + # @param validate_only [::Boolean] + # Optional. If set, validate the request and preview the review, but do not + # actually apply it. + # @param etag [::String] + # Optional. If set, the request will be rejected if the latest version of the + # workstation on the server does not have this ETag. + # + # @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/workstations/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Workstations::V1beta::Workstations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Workstations::V1beta::StopWorkstationRequest.new + # + # # Call the stop_workstation method. + # result = client.stop_workstation 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 stop_workstation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workstations::V1beta::StopWorkstationRequest + + # Converts hash 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.stop_workstation.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::Workstations::V1beta::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.stop_workstation.timeout, + metadata: metadata, + retry_policy: @config.rpcs.stop_workstation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @workstations_stub.call_rpc :stop_workstation, 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 a short-lived credential that can be used to send authenticated and + # authorized traffic to a workstation. + # + # @overload generate_access_token(request, options = nil) + # Pass arguments to `generate_access_token` via a request object, either of type + # {::Google::Cloud::Workstations::V1beta::GenerateAccessTokenRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Workstations::V1beta::GenerateAccessTokenRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_access_token(expire_time: nil, ttl: nil, workstation: nil) + # Pass arguments to `generate_access_token` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param expire_time [::Google::Protobuf::Timestamp, ::Hash] + # Desired expiration time of the access token. This value must + # be at most 24 hours in the future. If a value is not specified, the + # token's expiration time will be set to a default value of 1 hour in the + # future. + # + # Note: The following parameters are mutually exclusive: `expire_time`, `ttl`. 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 ttl [::Google::Protobuf::Duration, ::Hash] + # Desired lifetime duration of the access token. This value must + # be at most 24 hours. If a value is not specified, the token's lifetime + # will be set to a default value of 1 hour. + # + # Note: The following parameters are mutually exclusive: `ttl`, `expire_time`. 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 workstation [::String] + # Required. Name of the workstation for which the access token should be + # generated. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Cloud::Workstations::V1beta::GenerateAccessTokenResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Cloud::Workstations::V1beta::GenerateAccessTokenResponse] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/cloud/workstations/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Workstations::V1beta::Workstations::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Workstations::V1beta::GenerateAccessTokenRequest.new + # + # # Call the generate_access_token method. + # result = client.generate_access_token request + # + # # The returned object is of type Google::Cloud::Workstations::V1beta::GenerateAccessTokenResponse. + # p result + # + def generate_access_token request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workstations::V1beta::GenerateAccessTokenRequest + + # Converts hash 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_access_token.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::Workstations::V1beta::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.workstation + header_params["workstation"] = request.workstation + 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_access_token.timeout, + metadata: metadata, + retry_policy: @config.rpcs.generate_access_token.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @workstations_stub.call_rpc :generate_access_token, 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 Workstations API. + # + # This class represents the configuration for Workstations, + # 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::Workstations::V1beta::Workstations::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 + # # get_workstation_cluster to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Workstations::V1beta::Workstations::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.get_workstation_cluster.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Workstations::V1beta::Workstations::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.get_workstation_cluster.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::Workstations::V1beta::Workstations::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 = "workstations.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 Workstations 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 `get_workstation_cluster` + # @return [::Gapic::Config::Method] + # + attr_reader :get_workstation_cluster + ## + # RPC-specific configuration for `list_workstation_clusters` + # @return [::Gapic::Config::Method] + # + attr_reader :list_workstation_clusters + ## + # RPC-specific configuration for `create_workstation_cluster` + # @return [::Gapic::Config::Method] + # + attr_reader :create_workstation_cluster + ## + # RPC-specific configuration for `update_workstation_cluster` + # @return [::Gapic::Config::Method] + # + attr_reader :update_workstation_cluster + ## + # RPC-specific configuration for `delete_workstation_cluster` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_workstation_cluster + ## + # RPC-specific configuration for `get_workstation_config` + # @return [::Gapic::Config::Method] + # + attr_reader :get_workstation_config + ## + # RPC-specific configuration for `list_workstation_configs` + # @return [::Gapic::Config::Method] + # + attr_reader :list_workstation_configs + ## + # RPC-specific configuration for `list_usable_workstation_configs` + # @return [::Gapic::Config::Method] + # + attr_reader :list_usable_workstation_configs + ## + # RPC-specific configuration for `create_workstation_config` + # @return [::Gapic::Config::Method] + # + attr_reader :create_workstation_config + ## + # RPC-specific configuration for `update_workstation_config` + # @return [::Gapic::Config::Method] + # + attr_reader :update_workstation_config + ## + # RPC-specific configuration for `delete_workstation_config` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_workstation_config + ## + # RPC-specific configuration for `get_workstation` + # @return [::Gapic::Config::Method] + # + attr_reader :get_workstation + ## + # RPC-specific configuration for `list_workstations` + # @return [::Gapic::Config::Method] + # + attr_reader :list_workstations + ## + # RPC-specific configuration for `list_usable_workstations` + # @return [::Gapic::Config::Method] + # + attr_reader :list_usable_workstations + ## + # RPC-specific configuration for `create_workstation` + # @return [::Gapic::Config::Method] + # + attr_reader :create_workstation + ## + # RPC-specific configuration for `update_workstation` + # @return [::Gapic::Config::Method] + # + attr_reader :update_workstation + ## + # RPC-specific configuration for `delete_workstation` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_workstation + ## + # RPC-specific configuration for `start_workstation` + # @return [::Gapic::Config::Method] + # + attr_reader :start_workstation + ## + # RPC-specific configuration for `stop_workstation` + # @return [::Gapic::Config::Method] + # + attr_reader :stop_workstation + ## + # RPC-specific configuration for `generate_access_token` + # @return [::Gapic::Config::Method] + # + attr_reader :generate_access_token + + # @private + def initialize parent_rpcs = nil + get_workstation_cluster_config = parent_rpcs.get_workstation_cluster if parent_rpcs.respond_to? :get_workstation_cluster + @get_workstation_cluster = ::Gapic::Config::Method.new get_workstation_cluster_config + list_workstation_clusters_config = parent_rpcs.list_workstation_clusters if parent_rpcs.respond_to? :list_workstation_clusters + @list_workstation_clusters = ::Gapic::Config::Method.new list_workstation_clusters_config + create_workstation_cluster_config = parent_rpcs.create_workstation_cluster if parent_rpcs.respond_to? :create_workstation_cluster + @create_workstation_cluster = ::Gapic::Config::Method.new create_workstation_cluster_config + update_workstation_cluster_config = parent_rpcs.update_workstation_cluster if parent_rpcs.respond_to? :update_workstation_cluster + @update_workstation_cluster = ::Gapic::Config::Method.new update_workstation_cluster_config + delete_workstation_cluster_config = parent_rpcs.delete_workstation_cluster if parent_rpcs.respond_to? :delete_workstation_cluster + @delete_workstation_cluster = ::Gapic::Config::Method.new delete_workstation_cluster_config + get_workstation_config_config = parent_rpcs.get_workstation_config if parent_rpcs.respond_to? :get_workstation_config + @get_workstation_config = ::Gapic::Config::Method.new get_workstation_config_config + list_workstation_configs_config = parent_rpcs.list_workstation_configs if parent_rpcs.respond_to? :list_workstation_configs + @list_workstation_configs = ::Gapic::Config::Method.new list_workstation_configs_config + list_usable_workstation_configs_config = parent_rpcs.list_usable_workstation_configs if parent_rpcs.respond_to? :list_usable_workstation_configs + @list_usable_workstation_configs = ::Gapic::Config::Method.new list_usable_workstation_configs_config + create_workstation_config_config = parent_rpcs.create_workstation_config if parent_rpcs.respond_to? :create_workstation_config + @create_workstation_config = ::Gapic::Config::Method.new create_workstation_config_config + update_workstation_config_config = parent_rpcs.update_workstation_config if parent_rpcs.respond_to? :update_workstation_config + @update_workstation_config = ::Gapic::Config::Method.new update_workstation_config_config + delete_workstation_config_config = parent_rpcs.delete_workstation_config if parent_rpcs.respond_to? :delete_workstation_config + @delete_workstation_config = ::Gapic::Config::Method.new delete_workstation_config_config + get_workstation_config = parent_rpcs.get_workstation if parent_rpcs.respond_to? :get_workstation + @get_workstation = ::Gapic::Config::Method.new get_workstation_config + list_workstations_config = parent_rpcs.list_workstations if parent_rpcs.respond_to? :list_workstations + @list_workstations = ::Gapic::Config::Method.new list_workstations_config + list_usable_workstations_config = parent_rpcs.list_usable_workstations if parent_rpcs.respond_to? :list_usable_workstations + @list_usable_workstations = ::Gapic::Config::Method.new list_usable_workstations_config + create_workstation_config = parent_rpcs.create_workstation if parent_rpcs.respond_to? :create_workstation + @create_workstation = ::Gapic::Config::Method.new create_workstation_config + update_workstation_config = parent_rpcs.update_workstation if parent_rpcs.respond_to? :update_workstation + @update_workstation = ::Gapic::Config::Method.new update_workstation_config + delete_workstation_config = parent_rpcs.delete_workstation if parent_rpcs.respond_to? :delete_workstation + @delete_workstation = ::Gapic::Config::Method.new delete_workstation_config + start_workstation_config = parent_rpcs.start_workstation if parent_rpcs.respond_to? :start_workstation + @start_workstation = ::Gapic::Config::Method.new start_workstation_config + stop_workstation_config = parent_rpcs.stop_workstation if parent_rpcs.respond_to? :stop_workstation + @stop_workstation = ::Gapic::Config::Method.new stop_workstation_config + generate_access_token_config = parent_rpcs.generate_access_token if parent_rpcs.respond_to? :generate_access_token + @generate_access_token = ::Gapic::Config::Method.new generate_access_token_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-workstations-v1beta/lib/google/cloud/workstations/v1beta/workstations/credentials.rb b/owl-bot-staging/google-cloud-workstations-v1beta/lib/google/cloud/workstations/v1beta/workstations/credentials.rb new file mode 100644 index 000000000000..cd1d778b15ef --- /dev/null +++ b/owl-bot-staging/google-cloud-workstations-v1beta/lib/google/cloud/workstations/v1beta/workstations/credentials.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! + +require "googleauth" + +module Google + module Cloud + module Workstations + module V1beta + module Workstations + # Credentials for the Workstations API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/cloud-platform" + ] + self.env_vars = [ + "GOOGLE_CLOUD_CREDENTIALS", + "GOOGLE_CLOUD_KEYFILE", + "GCLOUD_KEYFILE", + "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-workstations-v1beta/lib/google/cloud/workstations/v1beta/workstations/operations.rb b/owl-bot-staging/google-cloud-workstations-v1beta/lib/google/cloud/workstations/v1beta/workstations/operations.rb new file mode 100644 index 000000000000..59dfe3cc08d6 --- /dev/null +++ b/owl-bot-staging/google-cloud-workstations-v1beta/lib/google/cloud/workstations/v1beta/workstations/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 Workstations + module V1beta + module Workstations + # Service that implements Longrunning Operations API. + class Operations + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "workstations.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :operations_stub + + ## + # Configuration for the Workstations 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 Workstations 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::Workstations::V1beta::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::Workstations::V1beta::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::Workstations::V1beta::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::Workstations::V1beta::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::Workstations::V1beta::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 = "workstations.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-workstations-v1beta/lib/google/cloud/workstations/v1beta/workstations/paths.rb b/owl-bot-staging/google-cloud-workstations-v1beta/lib/google/cloud/workstations/v1beta/workstations/paths.rb new file mode 100644 index 000000000000..651fbc0e8140 --- /dev/null +++ b/owl-bot-staging/google-cloud-workstations-v1beta/lib/google/cloud/workstations/v1beta/workstations/paths.rb @@ -0,0 +1,113 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Workstations + module V1beta + module Workstations + # Path helper methods for the Workstations 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 Workstation resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/workstationClusters/{workstation_cluster}/workstationConfigs/{workstation_config}/workstations/{workstation}` + # + # @param project [String] + # @param location [String] + # @param workstation_cluster [String] + # @param workstation_config [String] + # @param workstation [String] + # + # @return [::String] + def workstation_path project:, location:, workstation_cluster:, workstation_config:, workstation: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "workstation_cluster cannot contain /" if workstation_cluster.to_s.include? "/" + raise ::ArgumentError, "workstation_config cannot contain /" if workstation_config.to_s.include? "/" + + "projects/#{project}/locations/#{location}/workstationClusters/#{workstation_cluster}/workstationConfigs/#{workstation_config}/workstations/#{workstation}" + end + + ## + # Create a fully-qualified WorkstationCluster resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/workstationClusters/{workstation_cluster}` + # + # @param project [String] + # @param location [String] + # @param workstation_cluster [String] + # + # @return [::String] + def workstation_cluster_path project:, location:, workstation_cluster: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/workstationClusters/#{workstation_cluster}" + end + + ## + # Create a fully-qualified WorkstationConfig resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/workstationClusters/{workstation_cluster}/workstationConfigs/{workstation_config}` + # + # @param project [String] + # @param location [String] + # @param workstation_cluster [String] + # @param workstation_config [String] + # + # @return [::String] + def workstation_config_path project:, location:, workstation_cluster:, workstation_config: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "workstation_cluster cannot contain /" if workstation_cluster.to_s.include? "/" + + "projects/#{project}/locations/#{location}/workstationClusters/#{workstation_cluster}/workstationConfigs/#{workstation_config}" + end + + extend self + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-workstations-v1beta/lib/google/cloud/workstations/v1beta/workstations/rest.rb b/owl-bot-staging/google-cloud-workstations-v1beta/lib/google/cloud/workstations/v1beta/workstations/rest.rb new file mode 100644 index 000000000000..203469f53bee --- /dev/null +++ b/owl-bot-staging/google-cloud-workstations-v1beta/lib/google/cloud/workstations/v1beta/workstations/rest.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! + +require "gapic/rest" +require "gapic/config" +require "gapic/config/method" + +require "google/cloud/workstations/v1beta/version" +require "google/cloud/workstations/v1beta/bindings_override" + +require "google/cloud/workstations/v1beta/workstations/credentials" +require "google/cloud/workstations/v1beta/workstations/paths" +require "google/cloud/workstations/v1beta/workstations/rest/operations" +require "google/cloud/workstations/v1beta/workstations/rest/client" + +module Google + module Cloud + module Workstations + module V1beta + ## + # Service for interacting with Cloud Workstations. + # + # To load this service and instantiate a REST client: + # + # require "google/cloud/workstations/v1beta/workstations/rest" + # client = ::Google::Cloud::Workstations::V1beta::Workstations::Rest::Client.new + # + module Workstations + # Client for the REST transport + module Rest + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "rest", "helpers.rb" +require "google/cloud/workstations/v1beta/workstations/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-workstations-v1beta/lib/google/cloud/workstations/v1beta/workstations/rest/client.rb b/owl-bot-staging/google-cloud-workstations-v1beta/lib/google/cloud/workstations/v1beta/workstations/rest/client.rb new file mode 100644 index 000000000000..914cc70a57bb --- /dev/null +++ b/owl-bot-staging/google-cloud-workstations-v1beta/lib/google/cloud/workstations/v1beta/workstations/rest/client.rb @@ -0,0 +1,2420 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/workstations/v1beta/workstations_pb" +require "google/cloud/workstations/v1beta/workstations/rest/service_stub" +require "google/cloud/location/rest" +require "google/iam/v1/rest" + +module Google + module Cloud + module Workstations + module V1beta + module Workstations + module Rest + ## + # REST client for the Workstations service. + # + # Service for interacting with Cloud Workstations. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "workstations.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :workstations_stub + + ## + # Configure the Workstations Client class. + # + # See {::Google::Cloud::Workstations::V1beta::Workstations::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all Workstations clients + # ::Google::Cloud::Workstations::V1beta::Workstations::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", "Workstations", "V1beta"] + 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.get_workstation_cluster.timeout = 60.0 + default_config.rpcs.get_workstation_cluster.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.list_workstation_clusters.timeout = 60.0 + default_config.rpcs.list_workstation_clusters.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.create_workstation_cluster.timeout = 60.0 + + default_config.rpcs.update_workstation_cluster.timeout = 60.0 + + default_config.rpcs.delete_workstation_cluster.timeout = 60.0 + + default_config.rpcs.get_workstation_config.timeout = 60.0 + default_config.rpcs.get_workstation_config.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.list_workstation_configs.timeout = 60.0 + default_config.rpcs.list_workstation_configs.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.list_usable_workstation_configs.timeout = 60.0 + default_config.rpcs.list_usable_workstation_configs.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.create_workstation_config.timeout = 60.0 + + default_config.rpcs.update_workstation_config.timeout = 60.0 + + default_config.rpcs.delete_workstation_config.timeout = 60.0 + + default_config.rpcs.get_workstation.timeout = 60.0 + default_config.rpcs.get_workstation.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.list_workstations.timeout = 60.0 + default_config.rpcs.list_workstations.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.list_usable_workstations.timeout = 60.0 + default_config.rpcs.list_usable_workstations.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.create_workstation.timeout = 60.0 + + default_config.rpcs.update_workstation.timeout = 60.0 + + default_config.rpcs.delete_workstation.timeout = 60.0 + + default_config.rpcs.start_workstation.timeout = 60.0 + + default_config.rpcs.stop_workstation.timeout = 60.0 + + default_config.rpcs.generate_access_token.timeout = 60.0 + default_config.rpcs.generate_access_token.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the Workstations 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::Workstations::V1beta::Workstations::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 + @workstations_stub.universe_domain + end + + ## + # Create a new Workstations REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Cloud::Workstations::V1beta::Workstations::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Cloud::Workstations::V1beta::Workstations::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Workstations 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::Workstations::V1beta::Workstations::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 + + @workstations_stub = ::Google::Cloud::Workstations::V1beta::Workstations::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials, + logger: @config.logger + ) + + @workstations_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 = @workstations_stub.endpoint + config.universe_domain = @workstations_stub.universe_domain + config.logger = @workstations_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 = @workstations_stub.endpoint + config.universe_domain = @workstations_stub.universe_domain + config.bindings_override = @config.bindings_override + config.logger = @workstations_stub.logger if config.respond_to? :logger= + end + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Cloud::Workstations::V1beta::Workstations::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 + @workstations_stub.logger + end + + # Service calls + + ## + # Returns the requested workstation cluster. + # + # @overload get_workstation_cluster(request, options = nil) + # Pass arguments to `get_workstation_cluster` via a request object, either of type + # {::Google::Cloud::Workstations::V1beta::GetWorkstationClusterRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Workstations::V1beta::GetWorkstationClusterRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_workstation_cluster(name: nil) + # Pass arguments to `get_workstation_cluster` via keyword arguments. Note that at + # least one keyword argument is 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 requested resource. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Workstations::V1beta::WorkstationCluster] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Workstations::V1beta::WorkstationCluster] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/workstations/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Workstations::V1beta::Workstations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Workstations::V1beta::GetWorkstationClusterRequest.new + # + # # Call the get_workstation_cluster method. + # result = client.get_workstation_cluster request + # + # # The returned object is of type Google::Cloud::Workstations::V1beta::WorkstationCluster. + # p result + # + def get_workstation_cluster request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workstations::V1beta::GetWorkstationClusterRequest + + # Converts hash 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_workstation_cluster.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::Workstations::V1beta::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_workstation_cluster.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_workstation_cluster.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @workstations_stub.get_workstation_cluster 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 all workstation clusters in the specified location. + # + # @overload list_workstation_clusters(request, options = nil) + # Pass arguments to `list_workstation_clusters` via a request object, either of type + # {::Google::Cloud::Workstations::V1beta::ListWorkstationClustersRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Workstations::V1beta::ListWorkstationClustersRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_workstation_clusters(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_workstation_clusters` via keyword arguments. Note that at + # least one keyword argument is 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. Parent resource name. + # @param page_size [::Integer] + # Optional. Maximum number of items to return. + # @param page_token [::String] + # Optional. next_page_token value returned from a previous List request, if + # any. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Workstations::V1beta::WorkstationCluster>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Workstations::V1beta::WorkstationCluster>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/workstations/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Workstations::V1beta::Workstations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Workstations::V1beta::ListWorkstationClustersRequest.new + # + # # Call the list_workstation_clusters method. + # result = client.list_workstation_clusters 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::Workstations::V1beta::WorkstationCluster. + # p item + # end + # + def list_workstation_clusters request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workstations::V1beta::ListWorkstationClustersRequest + + # Converts hash 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_workstation_clusters.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::Workstations::V1beta::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_workstation_clusters.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_workstation_clusters.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @workstations_stub.list_workstation_clusters request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @workstations_stub, :list_workstation_clusters, "workstation_clusters", 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 + + ## + # Creates a new workstation cluster. + # + # @overload create_workstation_cluster(request, options = nil) + # Pass arguments to `create_workstation_cluster` via a request object, either of type + # {::Google::Cloud::Workstations::V1beta::CreateWorkstationClusterRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Workstations::V1beta::CreateWorkstationClusterRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_workstation_cluster(parent: nil, workstation_cluster_id: nil, workstation_cluster: nil, validate_only: nil) + # Pass arguments to `create_workstation_cluster` via keyword arguments. Note that at + # least one keyword argument is 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. Parent resource name. + # @param workstation_cluster_id [::String] + # Required. ID to use for the workstation cluster. + # @param workstation_cluster [::Google::Cloud::Workstations::V1beta::WorkstationCluster, ::Hash] + # Required. Workstation cluster to create. + # @param validate_only [::Boolean] + # Optional. If set, validate the request and preview the review, but do not + # actually apply it. + # @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/workstations/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Workstations::V1beta::Workstations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Workstations::V1beta::CreateWorkstationClusterRequest.new + # + # # Call the create_workstation_cluster method. + # result = client.create_workstation_cluster 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_workstation_cluster request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workstations::V1beta::CreateWorkstationClusterRequest + + # Converts hash 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_workstation_cluster.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::Workstations::V1beta::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_workstation_cluster.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_workstation_cluster.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @workstations_stub.create_workstation_cluster 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 + + ## + # Updates an existing workstation cluster. + # + # @overload update_workstation_cluster(request, options = nil) + # Pass arguments to `update_workstation_cluster` via a request object, either of type + # {::Google::Cloud::Workstations::V1beta::UpdateWorkstationClusterRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Workstations::V1beta::UpdateWorkstationClusterRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_workstation_cluster(workstation_cluster: nil, update_mask: nil, validate_only: nil, allow_missing: nil) + # Pass arguments to `update_workstation_cluster` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param workstation_cluster [::Google::Cloud::Workstations::V1beta::WorkstationCluster, ::Hash] + # Required. Workstation cluster to update. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. Mask that specifies which fields in the workstation cluster + # should be updated. + # @param validate_only [::Boolean] + # Optional. If set, validate the request and preview the review, but do not + # actually apply it. + # @param allow_missing [::Boolean] + # Optional. If set, and the workstation cluster is not found, a new + # workstation cluster will be created. In this situation, update_mask is + # ignored. + # @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/workstations/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Workstations::V1beta::Workstations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Workstations::V1beta::UpdateWorkstationClusterRequest.new + # + # # Call the update_workstation_cluster method. + # result = client.update_workstation_cluster 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 update_workstation_cluster request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workstations::V1beta::UpdateWorkstationClusterRequest + + # Converts hash 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_workstation_cluster.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::Workstations::V1beta::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_workstation_cluster.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_workstation_cluster.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @workstations_stub.update_workstation_cluster 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 the specified workstation cluster. + # + # @overload delete_workstation_cluster(request, options = nil) + # Pass arguments to `delete_workstation_cluster` via a request object, either of type + # {::Google::Cloud::Workstations::V1beta::DeleteWorkstationClusterRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Workstations::V1beta::DeleteWorkstationClusterRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_workstation_cluster(name: nil, validate_only: nil, etag: nil, force: nil) + # Pass arguments to `delete_workstation_cluster` via keyword arguments. Note that at + # least one keyword argument is 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 workstation cluster to delete. + # @param validate_only [::Boolean] + # Optional. If set, validate the request and preview the review, but do not + # apply it. + # @param etag [::String] + # Optional. If set, the request will be rejected if the latest version of the + # workstation cluster on the server does not have this ETag. + # @param force [::Boolean] + # Optional. If set, any workstation configurations and workstations in the + # workstation cluster are also deleted. Otherwise, the request only + # works if the workstation cluster has no configurations or workstations. + # @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/workstations/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Workstations::V1beta::Workstations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Workstations::V1beta::DeleteWorkstationClusterRequest.new + # + # # Call the delete_workstation_cluster method. + # result = client.delete_workstation_cluster 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_workstation_cluster request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workstations::V1beta::DeleteWorkstationClusterRequest + + # Converts hash 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_workstation_cluster.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::Workstations::V1beta::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_workstation_cluster.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_workstation_cluster.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @workstations_stub.delete_workstation_cluster 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 requested workstation configuration. + # + # @overload get_workstation_config(request, options = nil) + # Pass arguments to `get_workstation_config` via a request object, either of type + # {::Google::Cloud::Workstations::V1beta::GetWorkstationConfigRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Workstations::V1beta::GetWorkstationConfigRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_workstation_config(name: nil) + # Pass arguments to `get_workstation_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 requested resource. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Workstations::V1beta::WorkstationConfig] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Workstations::V1beta::WorkstationConfig] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/workstations/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Workstations::V1beta::Workstations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Workstations::V1beta::GetWorkstationConfigRequest.new + # + # # Call the get_workstation_config method. + # result = client.get_workstation_config request + # + # # The returned object is of type Google::Cloud::Workstations::V1beta::WorkstationConfig. + # p result + # + def get_workstation_config request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workstations::V1beta::GetWorkstationConfigRequest + + # Converts hash 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_workstation_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::Workstations::V1beta::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_workstation_config.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_workstation_config.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @workstations_stub.get_workstation_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 all workstation configurations in the specified cluster. + # + # @overload list_workstation_configs(request, options = nil) + # Pass arguments to `list_workstation_configs` via a request object, either of type + # {::Google::Cloud::Workstations::V1beta::ListWorkstationConfigsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Workstations::V1beta::ListWorkstationConfigsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_workstation_configs(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_workstation_configs` via keyword arguments. Note that at + # least one keyword argument is 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. Parent resource name. + # @param page_size [::Integer] + # Optional. Maximum number of items to return. + # @param page_token [::String] + # Optional. next_page_token value returned from a previous List request, if + # any. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Workstations::V1beta::WorkstationConfig>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Workstations::V1beta::WorkstationConfig>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/workstations/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Workstations::V1beta::Workstations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Workstations::V1beta::ListWorkstationConfigsRequest.new + # + # # Call the list_workstation_configs method. + # result = client.list_workstation_configs 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::Workstations::V1beta::WorkstationConfig. + # p item + # end + # + def list_workstation_configs request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workstations::V1beta::ListWorkstationConfigsRequest + + # Converts hash 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_workstation_configs.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::Workstations::V1beta::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_workstation_configs.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_workstation_configs.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @workstations_stub.list_workstation_configs request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @workstations_stub, :list_workstation_configs, "workstation_configs", 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 all workstation configurations in the specified cluster on which + # the caller has the "workstations.workstation.create" permission. + # + # @overload list_usable_workstation_configs(request, options = nil) + # Pass arguments to `list_usable_workstation_configs` via a request object, either of type + # {::Google::Cloud::Workstations::V1beta::ListUsableWorkstationConfigsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Workstations::V1beta::ListUsableWorkstationConfigsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_usable_workstation_configs(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_usable_workstation_configs` via keyword arguments. Note that at + # least one keyword argument is 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. Parent resource name. + # @param page_size [::Integer] + # Optional. Maximum number of items to return. + # @param page_token [::String] + # Optional. next_page_token value returned from a previous List request, if + # any. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Workstations::V1beta::WorkstationConfig>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Workstations::V1beta::WorkstationConfig>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/workstations/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Workstations::V1beta::Workstations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Workstations::V1beta::ListUsableWorkstationConfigsRequest.new + # + # # Call the list_usable_workstation_configs method. + # result = client.list_usable_workstation_configs 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::Workstations::V1beta::WorkstationConfig. + # p item + # end + # + def list_usable_workstation_configs request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workstations::V1beta::ListUsableWorkstationConfigsRequest + + # Converts hash 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_usable_workstation_configs.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::Workstations::V1beta::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_usable_workstation_configs.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_usable_workstation_configs.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @workstations_stub.list_usable_workstation_configs request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @workstations_stub, :list_usable_workstation_configs, "workstation_configs", 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 + + ## + # Creates a new workstation configuration. + # + # @overload create_workstation_config(request, options = nil) + # Pass arguments to `create_workstation_config` via a request object, either of type + # {::Google::Cloud::Workstations::V1beta::CreateWorkstationConfigRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Workstations::V1beta::CreateWorkstationConfigRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_workstation_config(parent: nil, workstation_config_id: nil, workstation_config: nil, validate_only: nil) + # Pass arguments to `create_workstation_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. Parent resource name. + # @param workstation_config_id [::String] + # Required. ID to use for the workstation configuration. + # @param workstation_config [::Google::Cloud::Workstations::V1beta::WorkstationConfig, ::Hash] + # Required. Config to create. + # @param validate_only [::Boolean] + # Optional. If set, validate the request and preview the review, but do not + # actually apply it. + # @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/workstations/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Workstations::V1beta::Workstations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Workstations::V1beta::CreateWorkstationConfigRequest.new + # + # # Call the create_workstation_config method. + # result = client.create_workstation_config 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_workstation_config request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workstations::V1beta::CreateWorkstationConfigRequest + + # Converts hash 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_workstation_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::Workstations::V1beta::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_workstation_config.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_workstation_config.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @workstations_stub.create_workstation_config 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 + + ## + # Updates an existing workstation configuration. + # + # @overload update_workstation_config(request, options = nil) + # Pass arguments to `update_workstation_config` via a request object, either of type + # {::Google::Cloud::Workstations::V1beta::UpdateWorkstationConfigRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Workstations::V1beta::UpdateWorkstationConfigRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_workstation_config(workstation_config: nil, update_mask: nil, validate_only: nil, allow_missing: nil) + # Pass arguments to `update_workstation_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 workstation_config [::Google::Cloud::Workstations::V1beta::WorkstationConfig, ::Hash] + # Required. Config to update. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. Mask specifying which fields in the workstation configuration + # should be updated. + # @param validate_only [::Boolean] + # Optional. If set, validate the request and preview the review, but do not + # actually apply it. + # @param allow_missing [::Boolean] + # Optional. If set and the workstation configuration is not found, a new + # workstation configuration will be created. In this situation, + # update_mask is ignored. + # @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/workstations/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Workstations::V1beta::Workstations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Workstations::V1beta::UpdateWorkstationConfigRequest.new + # + # # Call the update_workstation_config method. + # result = client.update_workstation_config 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 update_workstation_config request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workstations::V1beta::UpdateWorkstationConfigRequest + + # Converts hash 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_workstation_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::Workstations::V1beta::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_workstation_config.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_workstation_config.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @workstations_stub.update_workstation_config 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 the specified workstation configuration. + # + # @overload delete_workstation_config(request, options = nil) + # Pass arguments to `delete_workstation_config` via a request object, either of type + # {::Google::Cloud::Workstations::V1beta::DeleteWorkstationConfigRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Workstations::V1beta::DeleteWorkstationConfigRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_workstation_config(name: nil, validate_only: nil, etag: nil, force: nil) + # Pass arguments to `delete_workstation_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 workstation configuration to delete. + # @param validate_only [::Boolean] + # Optional. If set, validate the request and preview the review, but do not + # actually apply it. + # @param etag [::String] + # Optional. If set, the request is rejected if the latest version of the + # workstation configuration on the server does not have this ETag. + # @param force [::Boolean] + # Optional. If set, any workstations in the workstation configuration are + # also deleted. Otherwise, the request works only if the workstation + # configuration has no workstations. + # @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/workstations/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Workstations::V1beta::Workstations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Workstations::V1beta::DeleteWorkstationConfigRequest.new + # + # # Call the delete_workstation_config method. + # result = client.delete_workstation_config 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_workstation_config request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workstations::V1beta::DeleteWorkstationConfigRequest + + # Converts hash 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_workstation_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::Workstations::V1beta::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_workstation_config.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_workstation_config.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @workstations_stub.delete_workstation_config 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 requested workstation. + # + # @overload get_workstation(request, options = nil) + # Pass arguments to `get_workstation` via a request object, either of type + # {::Google::Cloud::Workstations::V1beta::GetWorkstationRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Workstations::V1beta::GetWorkstationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_workstation(name: nil) + # Pass arguments to `get_workstation` via keyword arguments. Note that at + # least one keyword argument is 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 requested resource. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Workstations::V1beta::Workstation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Workstations::V1beta::Workstation] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/workstations/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Workstations::V1beta::Workstations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Workstations::V1beta::GetWorkstationRequest.new + # + # # Call the get_workstation method. + # result = client.get_workstation request + # + # # The returned object is of type Google::Cloud::Workstations::V1beta::Workstation. + # p result + # + def get_workstation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workstations::V1beta::GetWorkstationRequest + + # Converts hash 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_workstation.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::Workstations::V1beta::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_workstation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_workstation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @workstations_stub.get_workstation 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 all Workstations using the specified workstation configuration. + # + # @overload list_workstations(request, options = nil) + # Pass arguments to `list_workstations` via a request object, either of type + # {::Google::Cloud::Workstations::V1beta::ListWorkstationsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Workstations::V1beta::ListWorkstationsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_workstations(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_workstations` via keyword arguments. Note that at + # least one keyword argument is 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. Parent resource name. + # @param page_size [::Integer] + # Optional. Maximum number of items to return. + # @param page_token [::String] + # Optional. next_page_token value returned from a previous List request, if + # any. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Workstations::V1beta::Workstation>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Workstations::V1beta::Workstation>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/workstations/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Workstations::V1beta::Workstations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Workstations::V1beta::ListWorkstationsRequest.new + # + # # Call the list_workstations method. + # result = client.list_workstations 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::Workstations::V1beta::Workstation. + # p item + # end + # + def list_workstations request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workstations::V1beta::ListWorkstationsRequest + + # Converts hash 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_workstations.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::Workstations::V1beta::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_workstations.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_workstations.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @workstations_stub.list_workstations request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @workstations_stub, :list_workstations, "workstations", 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 all workstations using the specified workstation configuration + # on which the caller has the "workstations.workstations.use" permission. + # + # @overload list_usable_workstations(request, options = nil) + # Pass arguments to `list_usable_workstations` via a request object, either of type + # {::Google::Cloud::Workstations::V1beta::ListUsableWorkstationsRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Workstations::V1beta::ListUsableWorkstationsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_usable_workstations(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_usable_workstations` via keyword arguments. Note that at + # least one keyword argument is 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. Parent resource name. + # @param page_size [::Integer] + # Optional. Maximum number of items to return. + # @param page_token [::String] + # Optional. next_page_token value returned from a previous List request, if + # any. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Workstations::V1beta::Workstation>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Workstations::V1beta::Workstation>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/workstations/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Workstations::V1beta::Workstations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Workstations::V1beta::ListUsableWorkstationsRequest.new + # + # # Call the list_usable_workstations method. + # result = client.list_usable_workstations 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::Workstations::V1beta::Workstation. + # p item + # end + # + def list_usable_workstations request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workstations::V1beta::ListUsableWorkstationsRequest + + # Converts hash 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_usable_workstations.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::Workstations::V1beta::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_usable_workstations.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_usable_workstations.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @workstations_stub.list_usable_workstations request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @workstations_stub, :list_usable_workstations, "workstations", 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 + + ## + # Creates a new workstation. + # + # @overload create_workstation(request, options = nil) + # Pass arguments to `create_workstation` via a request object, either of type + # {::Google::Cloud::Workstations::V1beta::CreateWorkstationRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Workstations::V1beta::CreateWorkstationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_workstation(parent: nil, workstation_id: nil, workstation: nil, validate_only: nil) + # Pass arguments to `create_workstation` via keyword arguments. Note that at + # least one keyword argument is 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. Parent resource name. + # @param workstation_id [::String] + # Required. ID to use for the workstation. + # @param workstation [::Google::Cloud::Workstations::V1beta::Workstation, ::Hash] + # Required. Workstation to create. + # @param validate_only [::Boolean] + # Optional. If set, validate the request and preview the review, but do not + # actually apply it. + # @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/workstations/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Workstations::V1beta::Workstations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Workstations::V1beta::CreateWorkstationRequest.new + # + # # Call the create_workstation method. + # result = client.create_workstation 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_workstation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workstations::V1beta::CreateWorkstationRequest + + # Converts hash 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_workstation.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::Workstations::V1beta::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_workstation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_workstation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @workstations_stub.create_workstation 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 + + ## + # Updates an existing workstation. + # + # @overload update_workstation(request, options = nil) + # Pass arguments to `update_workstation` via a request object, either of type + # {::Google::Cloud::Workstations::V1beta::UpdateWorkstationRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Workstations::V1beta::UpdateWorkstationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_workstation(workstation: nil, update_mask: nil, validate_only: nil, allow_missing: nil) + # Pass arguments to `update_workstation` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param workstation [::Google::Cloud::Workstations::V1beta::Workstation, ::Hash] + # Required. Workstation to update. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. Mask specifying which fields in the workstation configuration + # should be updated. + # @param validate_only [::Boolean] + # Optional. If set, validate the request and preview the review, but do not + # actually apply it. + # @param allow_missing [::Boolean] + # Optional. If set and the workstation configuration is not found, a new + # workstation configuration is created. In this situation, update_mask + # is ignored. + # @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/workstations/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Workstations::V1beta::Workstations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Workstations::V1beta::UpdateWorkstationRequest.new + # + # # Call the update_workstation method. + # result = client.update_workstation 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 update_workstation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workstations::V1beta::UpdateWorkstationRequest + + # Converts hash 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_workstation.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::Workstations::V1beta::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_workstation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_workstation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @workstations_stub.update_workstation 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 the specified workstation. + # + # @overload delete_workstation(request, options = nil) + # Pass arguments to `delete_workstation` via a request object, either of type + # {::Google::Cloud::Workstations::V1beta::DeleteWorkstationRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Workstations::V1beta::DeleteWorkstationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_workstation(name: nil, validate_only: nil, etag: nil) + # Pass arguments to `delete_workstation` via keyword arguments. Note that at + # least one keyword argument is 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 workstation to delete. + # @param validate_only [::Boolean] + # Optional. If set, validate the request and preview the review, but do not + # actually apply it. + # @param etag [::String] + # Optional. If set, the request will be rejected if the latest version of the + # workstation on the server does not have this ETag. + # @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/workstations/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Workstations::V1beta::Workstations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Workstations::V1beta::DeleteWorkstationRequest.new + # + # # Call the delete_workstation method. + # result = client.delete_workstation 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_workstation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workstations::V1beta::DeleteWorkstationRequest + + # Converts hash 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_workstation.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::Workstations::V1beta::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_workstation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_workstation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @workstations_stub.delete_workstation 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 + + ## + # Starts running a workstation so that users can connect to it. + # + # @overload start_workstation(request, options = nil) + # Pass arguments to `start_workstation` via a request object, either of type + # {::Google::Cloud::Workstations::V1beta::StartWorkstationRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Workstations::V1beta::StartWorkstationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload start_workstation(name: nil, validate_only: nil, etag: nil) + # Pass arguments to `start_workstation` via keyword arguments. Note that at + # least one keyword argument is 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 workstation to start. + # @param validate_only [::Boolean] + # Optional. If set, validate the request and preview the review, but do not + # actually apply it. + # @param etag [::String] + # Optional. If set, the request will be rejected if the latest version of the + # workstation on the server does not have this ETag. + # @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/workstations/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Workstations::V1beta::Workstations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Workstations::V1beta::StartWorkstationRequest.new + # + # # Call the start_workstation method. + # result = client.start_workstation 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 start_workstation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workstations::V1beta::StartWorkstationRequest + + # Converts hash 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.start_workstation.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::Workstations::V1beta::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.start_workstation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.start_workstation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @workstations_stub.start_workstation 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 + + ## + # Stops running a workstation, reducing costs. + # + # @overload stop_workstation(request, options = nil) + # Pass arguments to `stop_workstation` via a request object, either of type + # {::Google::Cloud::Workstations::V1beta::StopWorkstationRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Workstations::V1beta::StopWorkstationRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload stop_workstation(name: nil, validate_only: nil, etag: nil) + # Pass arguments to `stop_workstation` via keyword arguments. Note that at + # least one keyword argument is 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 workstation to stop. + # @param validate_only [::Boolean] + # Optional. If set, validate the request and preview the review, but do not + # actually apply it. + # @param etag [::String] + # Optional. If set, the request will be rejected if the latest version of the + # workstation on the server does not have this ETag. + # @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/workstations/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Workstations::V1beta::Workstations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Workstations::V1beta::StopWorkstationRequest.new + # + # # Call the stop_workstation method. + # result = client.stop_workstation 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 stop_workstation request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workstations::V1beta::StopWorkstationRequest + + # Converts hash 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.stop_workstation.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::Workstations::V1beta::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.stop_workstation.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.stop_workstation.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @workstations_stub.stop_workstation 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 a short-lived credential that can be used to send authenticated and + # authorized traffic to a workstation. + # + # @overload generate_access_token(request, options = nil) + # Pass arguments to `generate_access_token` via a request object, either of type + # {::Google::Cloud::Workstations::V1beta::GenerateAccessTokenRequest} or an equivalent Hash. + # + # @param request [::Google::Cloud::Workstations::V1beta::GenerateAccessTokenRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_access_token(expire_time: nil, ttl: nil, workstation: nil) + # Pass arguments to `generate_access_token` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param expire_time [::Google::Protobuf::Timestamp, ::Hash] + # Desired expiration time of the access token. This value must + # be at most 24 hours in the future. If a value is not specified, the + # token's expiration time will be set to a default value of 1 hour in the + # future. + # + # Note: The following parameters are mutually exclusive: `expire_time`, `ttl`. 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 ttl [::Google::Protobuf::Duration, ::Hash] + # Desired lifetime duration of the access token. This value must + # be at most 24 hours. If a value is not specified, the token's lifetime + # will be set to a default value of 1 hour. + # + # Note: The following parameters are mutually exclusive: `ttl`, `expire_time`. 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 workstation [::String] + # Required. Name of the workstation for which the access token should be + # generated. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Cloud::Workstations::V1beta::GenerateAccessTokenResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Workstations::V1beta::GenerateAccessTokenResponse] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/cloud/workstations/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Cloud::Workstations::V1beta::Workstations::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Cloud::Workstations::V1beta::GenerateAccessTokenRequest.new + # + # # Call the generate_access_token method. + # result = client.generate_access_token request + # + # # The returned object is of type Google::Cloud::Workstations::V1beta::GenerateAccessTokenResponse. + # p result + # + def generate_access_token request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workstations::V1beta::GenerateAccessTokenRequest + + # Converts hash 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_access_token.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::Workstations::V1beta::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_access_token.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.generate_access_token.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @workstations_stub.generate_access_token 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 Workstations REST API. + # + # This class represents the configuration for Workstations 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::Workstations::V1beta::Workstations::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 + # # get_workstation_cluster to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Cloud::Workstations::V1beta::Workstations::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.get_workstation_cluster.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Cloud::Workstations::V1beta::Workstations::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.get_workstation_cluster.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 = "workstations.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 Workstations 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 `get_workstation_cluster` + # @return [::Gapic::Config::Method] + # + attr_reader :get_workstation_cluster + ## + # RPC-specific configuration for `list_workstation_clusters` + # @return [::Gapic::Config::Method] + # + attr_reader :list_workstation_clusters + ## + # RPC-specific configuration for `create_workstation_cluster` + # @return [::Gapic::Config::Method] + # + attr_reader :create_workstation_cluster + ## + # RPC-specific configuration for `update_workstation_cluster` + # @return [::Gapic::Config::Method] + # + attr_reader :update_workstation_cluster + ## + # RPC-specific configuration for `delete_workstation_cluster` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_workstation_cluster + ## + # RPC-specific configuration for `get_workstation_config` + # @return [::Gapic::Config::Method] + # + attr_reader :get_workstation_config + ## + # RPC-specific configuration for `list_workstation_configs` + # @return [::Gapic::Config::Method] + # + attr_reader :list_workstation_configs + ## + # RPC-specific configuration for `list_usable_workstation_configs` + # @return [::Gapic::Config::Method] + # + attr_reader :list_usable_workstation_configs + ## + # RPC-specific configuration for `create_workstation_config` + # @return [::Gapic::Config::Method] + # + attr_reader :create_workstation_config + ## + # RPC-specific configuration for `update_workstation_config` + # @return [::Gapic::Config::Method] + # + attr_reader :update_workstation_config + ## + # RPC-specific configuration for `delete_workstation_config` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_workstation_config + ## + # RPC-specific configuration for `get_workstation` + # @return [::Gapic::Config::Method] + # + attr_reader :get_workstation + ## + # RPC-specific configuration for `list_workstations` + # @return [::Gapic::Config::Method] + # + attr_reader :list_workstations + ## + # RPC-specific configuration for `list_usable_workstations` + # @return [::Gapic::Config::Method] + # + attr_reader :list_usable_workstations + ## + # RPC-specific configuration for `create_workstation` + # @return [::Gapic::Config::Method] + # + attr_reader :create_workstation + ## + # RPC-specific configuration for `update_workstation` + # @return [::Gapic::Config::Method] + # + attr_reader :update_workstation + ## + # RPC-specific configuration for `delete_workstation` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_workstation + ## + # RPC-specific configuration for `start_workstation` + # @return [::Gapic::Config::Method] + # + attr_reader :start_workstation + ## + # RPC-specific configuration for `stop_workstation` + # @return [::Gapic::Config::Method] + # + attr_reader :stop_workstation + ## + # RPC-specific configuration for `generate_access_token` + # @return [::Gapic::Config::Method] + # + attr_reader :generate_access_token + + # @private + def initialize parent_rpcs = nil + get_workstation_cluster_config = parent_rpcs.get_workstation_cluster if parent_rpcs.respond_to? :get_workstation_cluster + @get_workstation_cluster = ::Gapic::Config::Method.new get_workstation_cluster_config + list_workstation_clusters_config = parent_rpcs.list_workstation_clusters if parent_rpcs.respond_to? :list_workstation_clusters + @list_workstation_clusters = ::Gapic::Config::Method.new list_workstation_clusters_config + create_workstation_cluster_config = parent_rpcs.create_workstation_cluster if parent_rpcs.respond_to? :create_workstation_cluster + @create_workstation_cluster = ::Gapic::Config::Method.new create_workstation_cluster_config + update_workstation_cluster_config = parent_rpcs.update_workstation_cluster if parent_rpcs.respond_to? :update_workstation_cluster + @update_workstation_cluster = ::Gapic::Config::Method.new update_workstation_cluster_config + delete_workstation_cluster_config = parent_rpcs.delete_workstation_cluster if parent_rpcs.respond_to? :delete_workstation_cluster + @delete_workstation_cluster = ::Gapic::Config::Method.new delete_workstation_cluster_config + get_workstation_config_config = parent_rpcs.get_workstation_config if parent_rpcs.respond_to? :get_workstation_config + @get_workstation_config = ::Gapic::Config::Method.new get_workstation_config_config + list_workstation_configs_config = parent_rpcs.list_workstation_configs if parent_rpcs.respond_to? :list_workstation_configs + @list_workstation_configs = ::Gapic::Config::Method.new list_workstation_configs_config + list_usable_workstation_configs_config = parent_rpcs.list_usable_workstation_configs if parent_rpcs.respond_to? :list_usable_workstation_configs + @list_usable_workstation_configs = ::Gapic::Config::Method.new list_usable_workstation_configs_config + create_workstation_config_config = parent_rpcs.create_workstation_config if parent_rpcs.respond_to? :create_workstation_config + @create_workstation_config = ::Gapic::Config::Method.new create_workstation_config_config + update_workstation_config_config = parent_rpcs.update_workstation_config if parent_rpcs.respond_to? :update_workstation_config + @update_workstation_config = ::Gapic::Config::Method.new update_workstation_config_config + delete_workstation_config_config = parent_rpcs.delete_workstation_config if parent_rpcs.respond_to? :delete_workstation_config + @delete_workstation_config = ::Gapic::Config::Method.new delete_workstation_config_config + get_workstation_config = parent_rpcs.get_workstation if parent_rpcs.respond_to? :get_workstation + @get_workstation = ::Gapic::Config::Method.new get_workstation_config + list_workstations_config = parent_rpcs.list_workstations if parent_rpcs.respond_to? :list_workstations + @list_workstations = ::Gapic::Config::Method.new list_workstations_config + list_usable_workstations_config = parent_rpcs.list_usable_workstations if parent_rpcs.respond_to? :list_usable_workstations + @list_usable_workstations = ::Gapic::Config::Method.new list_usable_workstations_config + create_workstation_config = parent_rpcs.create_workstation if parent_rpcs.respond_to? :create_workstation + @create_workstation = ::Gapic::Config::Method.new create_workstation_config + update_workstation_config = parent_rpcs.update_workstation if parent_rpcs.respond_to? :update_workstation + @update_workstation = ::Gapic::Config::Method.new update_workstation_config + delete_workstation_config = parent_rpcs.delete_workstation if parent_rpcs.respond_to? :delete_workstation + @delete_workstation = ::Gapic::Config::Method.new delete_workstation_config + start_workstation_config = parent_rpcs.start_workstation if parent_rpcs.respond_to? :start_workstation + @start_workstation = ::Gapic::Config::Method.new start_workstation_config + stop_workstation_config = parent_rpcs.stop_workstation if parent_rpcs.respond_to? :stop_workstation + @stop_workstation = ::Gapic::Config::Method.new stop_workstation_config + generate_access_token_config = parent_rpcs.generate_access_token if parent_rpcs.respond_to? :generate_access_token + @generate_access_token = ::Gapic::Config::Method.new generate_access_token_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-workstations-v1beta/lib/google/cloud/workstations/v1beta/workstations/rest/operations.rb b/owl-bot-staging/google-cloud-workstations-v1beta/lib/google/cloud/workstations/v1beta/workstations/rest/operations.rb new file mode 100644 index 000000000000..582c87e5cfde --- /dev/null +++ b/owl-bot-staging/google-cloud-workstations-v1beta/lib/google/cloud/workstations/v1beta/workstations/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 Workstations + module V1beta + module Workstations + module Rest + # Service that implements Longrunning Operations API. + class Operations + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "workstations.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :operations_stub + + ## + # Configuration for the Workstations 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 Workstations 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::Workstations::V1beta::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::Workstations::V1beta::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::Workstations::V1beta::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::Workstations::V1beta::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 = "workstations.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: "/v1beta/{name}/operations", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/?$}, 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: "/v1beta/{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: "/v1beta/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + 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: "/v1beta/{name}:cancel", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-workstations-v1beta/lib/google/cloud/workstations/v1beta/workstations/rest/service_stub.rb b/owl-bot-staging/google-cloud-workstations-v1beta/lib/google/cloud/workstations/v1beta/workstations/rest/service_stub.rb new file mode 100644 index 000000000000..402c25eda4b8 --- /dev/null +++ b/owl-bot-staging/google-cloud-workstations-v1beta/lib/google/cloud/workstations/v1beta/workstations/rest/service_stub.rb @@ -0,0 +1,1310 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/workstations/v1beta/workstations_pb" + +module Google + module Cloud + module Workstations + module V1beta + module Workstations + module Rest + ## + # REST service stub for the Workstations 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 get_workstation_cluster REST call + # + # @param request_pb [::Google::Cloud::Workstations::V1beta::GetWorkstationClusterRequest] + # 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::Workstations::V1beta::WorkstationCluster] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Workstations::V1beta::WorkstationCluster] + # A result object deserialized from the server's reply + def get_workstation_cluster request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_workstation_cluster_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_workstation_cluster", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Workstations::V1beta::WorkstationCluster.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_workstation_clusters REST call + # + # @param request_pb [::Google::Cloud::Workstations::V1beta::ListWorkstationClustersRequest] + # 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::Workstations::V1beta::ListWorkstationClustersResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Workstations::V1beta::ListWorkstationClustersResponse] + # A result object deserialized from the server's reply + def list_workstation_clusters request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_workstation_clusters_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_workstation_clusters", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Workstations::V1beta::ListWorkstationClustersResponse.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_workstation_cluster REST call + # + # @param request_pb [::Google::Cloud::Workstations::V1beta::CreateWorkstationClusterRequest] + # 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_workstation_cluster request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_workstation_cluster_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_workstation_cluster", + 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 update_workstation_cluster REST call + # + # @param request_pb [::Google::Cloud::Workstations::V1beta::UpdateWorkstationClusterRequest] + # 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 update_workstation_cluster request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_workstation_cluster_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_workstation_cluster", + 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_workstation_cluster REST call + # + # @param request_pb [::Google::Cloud::Workstations::V1beta::DeleteWorkstationClusterRequest] + # 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_workstation_cluster request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_workstation_cluster_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_workstation_cluster", + 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_workstation_config REST call + # + # @param request_pb [::Google::Cloud::Workstations::V1beta::GetWorkstationConfigRequest] + # 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::Workstations::V1beta::WorkstationConfig] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Workstations::V1beta::WorkstationConfig] + # A result object deserialized from the server's reply + def get_workstation_config request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_workstation_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_workstation_config", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Workstations::V1beta::WorkstationConfig.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_workstation_configs REST call + # + # @param request_pb [::Google::Cloud::Workstations::V1beta::ListWorkstationConfigsRequest] + # 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::Workstations::V1beta::ListWorkstationConfigsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Workstations::V1beta::ListWorkstationConfigsResponse] + # A result object deserialized from the server's reply + def list_workstation_configs request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_workstation_configs_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_workstation_configs", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Workstations::V1beta::ListWorkstationConfigsResponse.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_usable_workstation_configs REST call + # + # @param request_pb [::Google::Cloud::Workstations::V1beta::ListUsableWorkstationConfigsRequest] + # 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::Workstations::V1beta::ListUsableWorkstationConfigsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Workstations::V1beta::ListUsableWorkstationConfigsResponse] + # A result object deserialized from the server's reply + def list_usable_workstation_configs request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_usable_workstation_configs_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_usable_workstation_configs", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Workstations::V1beta::ListUsableWorkstationConfigsResponse.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_workstation_config REST call + # + # @param request_pb [::Google::Cloud::Workstations::V1beta::CreateWorkstationConfigRequest] + # 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_workstation_config request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_workstation_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: "create_workstation_config", + 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 update_workstation_config REST call + # + # @param request_pb [::Google::Cloud::Workstations::V1beta::UpdateWorkstationConfigRequest] + # 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 update_workstation_config request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_workstation_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_workstation_config", + 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_workstation_config REST call + # + # @param request_pb [::Google::Cloud::Workstations::V1beta::DeleteWorkstationConfigRequest] + # 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_workstation_config request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_workstation_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: "delete_workstation_config", + 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_workstation REST call + # + # @param request_pb [::Google::Cloud::Workstations::V1beta::GetWorkstationRequest] + # 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::Workstations::V1beta::Workstation] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Workstations::V1beta::Workstation] + # A result object deserialized from the server's reply + def get_workstation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_workstation_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_workstation", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Workstations::V1beta::Workstation.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_workstations REST call + # + # @param request_pb [::Google::Cloud::Workstations::V1beta::ListWorkstationsRequest] + # 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::Workstations::V1beta::ListWorkstationsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Workstations::V1beta::ListWorkstationsResponse] + # A result object deserialized from the server's reply + def list_workstations request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_workstations_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_workstations", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Workstations::V1beta::ListWorkstationsResponse.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_usable_workstations REST call + # + # @param request_pb [::Google::Cloud::Workstations::V1beta::ListUsableWorkstationsRequest] + # 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::Workstations::V1beta::ListUsableWorkstationsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Workstations::V1beta::ListUsableWorkstationsResponse] + # A result object deserialized from the server's reply + def list_usable_workstations request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_usable_workstations_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_usable_workstations", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Workstations::V1beta::ListUsableWorkstationsResponse.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_workstation REST call + # + # @param request_pb [::Google::Cloud::Workstations::V1beta::CreateWorkstationRequest] + # 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_workstation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_workstation_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_workstation", + 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 update_workstation REST call + # + # @param request_pb [::Google::Cloud::Workstations::V1beta::UpdateWorkstationRequest] + # 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 update_workstation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_workstation_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_workstation", + 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_workstation REST call + # + # @param request_pb [::Google::Cloud::Workstations::V1beta::DeleteWorkstationRequest] + # 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_workstation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_workstation_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_workstation", + 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 start_workstation REST call + # + # @param request_pb [::Google::Cloud::Workstations::V1beta::StartWorkstationRequest] + # 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 start_workstation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_start_workstation_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: "start_workstation", + 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 stop_workstation REST call + # + # @param request_pb [::Google::Cloud::Workstations::V1beta::StopWorkstationRequest] + # 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 stop_workstation request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_stop_workstation_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: "stop_workstation", + 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 generate_access_token REST call + # + # @param request_pb [::Google::Cloud::Workstations::V1beta::GenerateAccessTokenRequest] + # 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::Workstations::V1beta::GenerateAccessTokenResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Cloud::Workstations::V1beta::GenerateAccessTokenResponse] + # A result object deserialized from the server's reply + def generate_access_token request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_generate_access_token_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_access_token", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Cloud::Workstations::V1beta::GenerateAccessTokenResponse.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 get_workstation_cluster REST call + # + # @param request_pb [::Google::Cloud::Workstations::V1beta::GetWorkstationClusterRequest] + # 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_workstation_cluster_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1beta/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/workstationClusters/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_workstation_clusters REST call + # + # @param request_pb [::Google::Cloud::Workstations::V1beta::ListWorkstationClustersRequest] + # 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_workstation_clusters_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1beta/{parent}/workstationClusters", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_workstation_cluster REST call + # + # @param request_pb [::Google::Cloud::Workstations::V1beta::CreateWorkstationClusterRequest] + # 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_workstation_cluster_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1beta/{parent}/workstationClusters", + body: "workstation_cluster", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_workstation_cluster REST call + # + # @param request_pb [::Google::Cloud::Workstations::V1beta::UpdateWorkstationClusterRequest] + # 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_workstation_cluster_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v1beta/{workstation_cluster.name}", + body: "workstation_cluster", + matches: [ + ["workstation_cluster.name", %r{^projects/[^/]+/locations/[^/]+/workstationClusters/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_workstation_cluster REST call + # + # @param request_pb [::Google::Cloud::Workstations::V1beta::DeleteWorkstationClusterRequest] + # 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_workstation_cluster_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1beta/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/workstationClusters/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_workstation_config REST call + # + # @param request_pb [::Google::Cloud::Workstations::V1beta::GetWorkstationConfigRequest] + # 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_workstation_config_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1beta/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/workstationClusters/[^/]+/workstationConfigs/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_workstation_configs REST call + # + # @param request_pb [::Google::Cloud::Workstations::V1beta::ListWorkstationConfigsRequest] + # 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_workstation_configs_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1beta/{parent}/workstationConfigs", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/workstationClusters/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_usable_workstation_configs REST call + # + # @param request_pb [::Google::Cloud::Workstations::V1beta::ListUsableWorkstationConfigsRequest] + # 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_usable_workstation_configs_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1beta/{parent}/workstationConfigs:listUsable", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/workstationClusters/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_workstation_config REST call + # + # @param request_pb [::Google::Cloud::Workstations::V1beta::CreateWorkstationConfigRequest] + # 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_workstation_config_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1beta/{parent}/workstationConfigs", + body: "workstation_config", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/workstationClusters/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_workstation_config REST call + # + # @param request_pb [::Google::Cloud::Workstations::V1beta::UpdateWorkstationConfigRequest] + # 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_workstation_config_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v1beta/{workstation_config.name}", + body: "workstation_config", + matches: [ + ["workstation_config.name", %r{^projects/[^/]+/locations/[^/]+/workstationClusters/[^/]+/workstationConfigs/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_workstation_config REST call + # + # @param request_pb [::Google::Cloud::Workstations::V1beta::DeleteWorkstationConfigRequest] + # 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_workstation_config_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1beta/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/workstationClusters/[^/]+/workstationConfigs/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_workstation REST call + # + # @param request_pb [::Google::Cloud::Workstations::V1beta::GetWorkstationRequest] + # 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_workstation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1beta/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/workstationClusters/[^/]+/workstationConfigs/[^/]+/workstations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_workstations REST call + # + # @param request_pb [::Google::Cloud::Workstations::V1beta::ListWorkstationsRequest] + # 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_workstations_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1beta/{parent}/workstations", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/workstationClusters/[^/]+/workstationConfigs/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the list_usable_workstations REST call + # + # @param request_pb [::Google::Cloud::Workstations::V1beta::ListUsableWorkstationsRequest] + # 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_usable_workstations_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v1beta/{parent}/workstations:listUsable", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/workstationClusters/[^/]+/workstationConfigs/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_workstation REST call + # + # @param request_pb [::Google::Cloud::Workstations::V1beta::CreateWorkstationRequest] + # 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_workstation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1beta/{parent}/workstations", + body: "workstation", + matches: [ + ["parent", %r{^projects/[^/]+/locations/[^/]+/workstationClusters/[^/]+/workstationConfigs/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_workstation REST call + # + # @param request_pb [::Google::Cloud::Workstations::V1beta::UpdateWorkstationRequest] + # 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_workstation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :patch, + uri_template: "/v1beta/{workstation.name}", + body: "workstation", + matches: [ + ["workstation.name", %r{^projects/[^/]+/locations/[^/]+/workstationClusters/[^/]+/workstationConfigs/[^/]+/workstations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_workstation REST call + # + # @param request_pb [::Google::Cloud::Workstations::V1beta::DeleteWorkstationRequest] + # 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_workstation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v1beta/{name}", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/workstationClusters/[^/]+/workstationConfigs/[^/]+/workstations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the start_workstation REST call + # + # @param request_pb [::Google::Cloud::Workstations::V1beta::StartWorkstationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_start_workstation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1beta/{name}:start", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/workstationClusters/[^/]+/workstationConfigs/[^/]+/workstations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the stop_workstation REST call + # + # @param request_pb [::Google::Cloud::Workstations::V1beta::StopWorkstationRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_stop_workstation_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1beta/{name}:stop", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/locations/[^/]+/workstationClusters/[^/]+/workstationConfigs/[^/]+/workstations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the generate_access_token REST call + # + # @param request_pb [::Google::Cloud::Workstations::V1beta::GenerateAccessTokenRequest] + # 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_access_token_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1beta/{workstation}:generateAccessToken", + body: "*", + matches: [ + ["workstation", %r{^projects/[^/]+/locations/[^/]+/workstationClusters/[^/]+/workstationConfigs/[^/]+/workstations/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-workstations-v1beta/lib/google/cloud/workstations/v1beta/workstations_pb.rb b/owl-bot-staging/google-cloud-workstations-v1beta/lib/google/cloud/workstations/v1beta/workstations_pb.rb new file mode 100644 index 000000000000..2e5c104516ba --- /dev/null +++ b/owl-bot-staging/google-cloud-workstations-v1beta/lib/google/cloud/workstations/v1beta/workstations_pb.rb @@ -0,0 +1,75 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/cloud/workstations/v1beta/workstations.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/field_mask_pb' +require 'google/protobuf/timestamp_pb' +require 'google/rpc/status_pb' + + +descriptor_data = "\n3google/cloud/workstations/v1beta/workstations.proto\x12 google.cloud.workstations.v1beta\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 google/protobuf/field_mask.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x17google/rpc/status.proto\"\x93\t\n\x12WorkstationCluster\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x19\n\x0c\x64isplay_name\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x10\n\x03uid\x18\x03 \x01(\tB\x03\xe0\x41\x03\x12\x18\n\x0breconciling\x18\x04 \x01(\x08\x42\x03\xe0\x41\x03\x12_\n\x0b\x61nnotations\x18\x05 \x03(\x0b\x32\x45.google.cloud.workstations.v1beta.WorkstationCluster.AnnotationsEntryB\x03\xe0\x41\x01\x12U\n\x06labels\x18\x0f \x03(\x0b\x32@.google.cloud.workstations.v1beta.WorkstationCluster.LabelsEntryB\x03\xe0\x41\x01\x12\x34\n\x0b\x63reate_time\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0b\x64\x65lete_time\x18\x08 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x11\n\x04\x65tag\x18\t \x01(\tB\x03\xe0\x41\x01\x12\x14\n\x07network\x18\n \x01(\tB\x03\xe0\x41\x05\x12\x17\n\nsubnetwork\x18\x0b \x01(\tB\x03\xe0\x41\x05\x12\x1d\n\x10\x63ontrol_plane_ip\x18\x10 \x01(\tB\x03\xe0\x41\x03\x12n\n\x16private_cluster_config\x18\x0c \x01(\x0b\x32I.google.cloud.workstations.v1beta.WorkstationCluster.PrivateClusterConfigB\x03\xe0\x41\x01\x12\x15\n\x08\x64\x65graded\x18\r \x01(\x08\x42\x03\xe0\x41\x03\x12+\n\nconditions\x18\x0e \x03(\x0b\x32\x12.google.rpc.StatusB\x03\xe0\x41\x03\x1a\x9f\x01\n\x14PrivateClusterConfig\x12$\n\x17\x65nable_private_endpoint\x18\x01 \x01(\x08\x42\x03\xe0\x41\x05\x12\x1d\n\x10\x63luster_hostname\x18\x02 \x01(\tB\x03\xe0\x41\x03\x12#\n\x16service_attachment_uri\x18\x03 \x01(\tB\x03\xe0\x41\x03\x12\x1d\n\x10\x61llowed_projects\x18\x04 \x03(\tB\x03\xe0\x41\x01\x1a\x32\n\x10\x41nnotationsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01:\xb3\x01\xea\x41\xaf\x01\n.workstations.googleapis.com/WorkstationCluster\x12Qprojects/{project}/locations/{location}/workstationClusters/{workstation_cluster}*\x13workstationClusters2\x12workstationClusterR\x01\x01\"\xc2\x1e\n\x11WorkstationConfig\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x19\n\x0c\x64isplay_name\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x10\n\x03uid\x18\x03 \x01(\tB\x03\xe0\x41\x03\x12\x18\n\x0breconciling\x18\x04 \x01(\x08\x42\x03\xe0\x41\x03\x12^\n\x0b\x61nnotations\x18\x05 \x03(\x0b\x32\x44.google.cloud.workstations.v1beta.WorkstationConfig.AnnotationsEntryB\x03\xe0\x41\x01\x12T\n\x06labels\x18\x12 \x03(\x0b\x32?.google.cloud.workstations.v1beta.WorkstationConfig.LabelsEntryB\x03\xe0\x41\x01\x12\x34\n\x0b\x63reate_time\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0b\x64\x65lete_time\x18\x08 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x11\n\x04\x65tag\x18\t \x01(\tB\x03\xe0\x41\x01\x12\x34\n\x0cidle_timeout\x18\n \x01(\x0b\x32\x19.google.protobuf.DurationB\x03\xe0\x41\x01\x12\x37\n\x0frunning_timeout\x18\x0b \x01(\x0b\x32\x19.google.protobuf.DurationB\x03\xe0\x41\x01\x12K\n\x04host\x18\x0c \x01(\x0b\x32\x38.google.cloud.workstations.v1beta.WorkstationConfig.HostB\x03\xe0\x41\x01\x12l\n\x16persistent_directories\x18\r \x03(\x0b\x32G.google.cloud.workstations.v1beta.WorkstationConfig.PersistentDirectoryB\x03\xe0\x41\x01\x12j\n\x15\x65phemeral_directories\x18\x16 \x03(\x0b\x32\x46.google.cloud.workstations.v1beta.WorkstationConfig.EphemeralDirectoryB\x03\xe0\x41\x01\x12U\n\tcontainer\x18\x0e \x01(\x0b\x32=.google.cloud.workstations.v1beta.WorkstationConfig.ContainerB\x03\xe0\x41\x01\x12\x66\n\x0e\x65ncryption_key\x18\x11 \x01(\x0b\x32I.google.cloud.workstations.v1beta.WorkstationConfig.CustomerEncryptionKeyB\x03\xe0\x41\x05\x12\x61\n\x10readiness_checks\x18\x13 \x03(\x0b\x32\x42.google.cloud.workstations.v1beta.WorkstationConfig.ReadinessCheckB\x03\xe0\x41\x01\x12\x1d\n\rreplica_zones\x18\x17 \x03(\tB\x06\xe0\x41\x01\xe0\x41\x05\x12\x15\n\x08\x64\x65graded\x18\x0f \x01(\x08\x42\x03\xe0\x41\x03\x12+\n\nconditions\x18\x10 \x03(\x0b\x32\x12.google.rpc.StatusB\x03\xe0\x41\x03\x12\x1f\n\x12\x65nable_audit_agent\x18\x14 \x01(\x08\x42\x03\xe0\x41\x01\x1a\xa4\x08\n\x04Host\x12\\\n\x0cgce_instance\x18\x01 \x01(\x0b\x32\x44.google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstanceH\x00\x1a\xb3\x07\n\x0bGceInstance\x12\x19\n\x0cmachine_type\x18\x01 \x01(\tB\x03\xe0\x41\x01\x12\x1c\n\x0fservice_account\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12#\n\x16service_account_scopes\x18\x03 \x03(\tB\x03\xe0\x41\x01\x12\x11\n\x04tags\x18\x04 \x03(\tB\x03\xe0\x41\x01\x12\x16\n\tpool_size\x18\x05 \x01(\x05\x42\x03\xe0\x41\x01\x12\x1d\n\x10pooled_instances\x18\x0c \x01(\x05\x42\x03\xe0\x41\x03\x12(\n\x1b\x64isable_public_ip_addresses\x18\x06 \x01(\x08\x42\x03\xe0\x41\x01\x12)\n\x1c\x65nable_nested_virtualization\x18\x07 \x01(\x08\x42\x03\xe0\x41\x01\x12\x85\x01\n\x18shielded_instance_config\x18\x08 \x01(\x0b\x32^.google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance.GceShieldedInstanceConfigB\x03\xe0\x41\x01\x12\x8d\x01\n\x1c\x63onfidential_instance_config\x18\n \x01(\x0b\x32\x62.google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance.GceConfidentialInstanceConfigB\x03\xe0\x41\x01\x12\x1e\n\x11\x62oot_disk_size_gb\x18\t \x01(\x05\x42\x03\xe0\x41\x01\x12k\n\x0c\x61\x63\x63\x65lerators\x18\x0b \x03(\x0b\x32P.google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance.AcceleratorB\x03\xe0\x41\x01\x1a\x80\x01\n\x19GceShieldedInstanceConfig\x12\x1f\n\x12\x65nable_secure_boot\x18\x01 \x01(\x08\x42\x03\xe0\x41\x01\x12\x18\n\x0b\x65nable_vtpm\x18\x02 \x01(\x08\x42\x03\xe0\x41\x01\x12(\n\x1b\x65nable_integrity_monitoring\x18\x03 \x01(\x08\x42\x03\xe0\x41\x01\x1aI\n\x1dGceConfidentialInstanceConfig\x12(\n\x1b\x65nable_confidential_compute\x18\x01 \x01(\x08\x42\x03\xe0\x41\x01\x1a\x34\n\x0b\x41\x63\x63\x65lerator\x12\x11\n\x04type\x18\x01 \x01(\tB\x03\xe0\x41\x01\x12\x12\n\x05\x63ount\x18\x02 \x01(\x05\x42\x03\xe0\x41\x01\x42\x08\n\x06\x63onfig\x1a\x8d\x04\n\x13PersistentDirectory\x12s\n\x06gce_pd\x18\x02 \x01(\x0b\x32\x61.google.cloud.workstations.v1beta.WorkstationConfig.PersistentDirectory.GceRegionalPersistentDiskH\x00\x12\x17\n\nmount_path\x18\x01 \x01(\tB\x03\xe0\x41\x01\x1a\xd5\x02\n\x19GceRegionalPersistentDisk\x12\x14\n\x07size_gb\x18\x01 \x01(\x05\x42\x03\xe0\x41\x01\x12\x14\n\x07\x66s_type\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x16\n\tdisk_type\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12\x1c\n\x0fsource_snapshot\x18\x05 \x01(\tB\x03\xe0\x41\x01\x12\x8c\x01\n\x0ereclaim_policy\x18\x04 \x01(\x0e\x32o.google.cloud.workstations.v1beta.WorkstationConfig.PersistentDirectory.GceRegionalPersistentDisk.ReclaimPolicyB\x03\xe0\x41\x01\"G\n\rReclaimPolicy\x12\x1e\n\x1aRECLAIM_POLICY_UNSPECIFIED\x10\x00\x12\n\n\x06\x44\x45LETE\x10\x01\x12\n\n\x06RETAIN\x10\x02\x42\x10\n\x0e\x64irectory_type\x1a\xa9\x02\n\x12\x45phemeralDirectory\x12j\n\x06gce_pd\x18\x03 \x01(\x0b\x32X.google.cloud.workstations.v1beta.WorkstationConfig.EphemeralDirectory.GcePersistentDiskH\x00\x12\x17\n\nmount_path\x18\x01 \x01(\tB\x03\xe0\x41\x02\x1a|\n\x11GcePersistentDisk\x12\x16\n\tdisk_type\x18\x01 \x01(\tB\x03\xe0\x41\x01\x12\x1c\n\x0fsource_snapshot\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x19\n\x0csource_image\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12\x16\n\tread_only\x18\x04 \x01(\x08\x42\x03\xe0\x41\x01\x42\x10\n\x0e\x64irectory_type\x1a\x82\x02\n\tContainer\x12\x12\n\x05image\x18\x01 \x01(\tB\x03\xe0\x41\x01\x12\x14\n\x07\x63ommand\x18\x02 \x03(\tB\x03\xe0\x41\x01\x12\x11\n\x04\x61rgs\x18\x03 \x03(\tB\x03\xe0\x41\x01\x12X\n\x03\x65nv\x18\x04 \x03(\x0b\x32\x46.google.cloud.workstations.v1beta.WorkstationConfig.Container.EnvEntryB\x03\xe0\x41\x01\x12\x18\n\x0bworking_dir\x18\x05 \x01(\tB\x03\xe0\x41\x01\x12\x18\n\x0brun_as_user\x18\x06 \x01(\x05\x42\x03\xe0\x41\x01\x1a*\n\x08\x45nvEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1aS\n\x15\x43ustomerEncryptionKey\x12\x14\n\x07kms_key\x18\x01 \x01(\tB\x03\xe0\x41\x05\x12$\n\x17kms_key_service_account\x18\x02 \x01(\tB\x03\xe0\x41\x05\x1a\x36\n\x0eReadinessCheck\x12\x11\n\x04path\x18\x01 \x01(\tB\x03\xe0\x41\x01\x12\x11\n\x04port\x18\x02 \x01(\x05\x42\x03\xe0\x41\x01\x1a\x32\n\x10\x41nnotationsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01:\xd8\x01\xea\x41\xd4\x01\n-workstations.googleapis.com/WorkstationConfig\x12yprojects/{project}/locations/{location}/workstationClusters/{workstation_cluster}/workstationConfigs/{workstation_config}*\x12workstationConfigs2\x11workstationConfigR\x01\x01\"\xfe\x08\n\x0bWorkstation\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x19\n\x0c\x64isplay_name\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x10\n\x03uid\x18\x03 \x01(\tB\x03\xe0\x41\x03\x12\x18\n\x0breconciling\x18\x04 \x01(\x08\x42\x03\xe0\x41\x03\x12X\n\x0b\x61nnotations\x18\x05 \x03(\x0b\x32>.google.cloud.workstations.v1beta.Workstation.AnnotationsEntryB\x03\xe0\x41\x01\x12N\n\x06labels\x18\r \x03(\x0b\x32\x39.google.cloud.workstations.v1beta.Workstation.LabelsEntryB\x03\xe0\x41\x01\x12\x34\n\x0b\x63reate_time\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x33\n\nstart_time\x18\x0e \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0b\x64\x65lete_time\x18\x08 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x11\n\x04\x65tag\x18\t \x01(\tB\x03\xe0\x41\x01\x12G\n\x05state\x18\n \x01(\x0e\x32\x33.google.cloud.workstations.v1beta.Workstation.StateB\x03\xe0\x41\x03\x12\x11\n\x04host\x18\x0b \x01(\tB\x03\xe0\x41\x03\x12H\n\x03\x65nv\x18\x0c \x03(\x0b\x32\x36.google.cloud.workstations.v1beta.Workstation.EnvEntryB\x03\xe0\x41\x01\x1a\x32\n\x10\x41nnotationsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a*\n\x08\x45nvEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"l\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x12\n\x0eSTATE_STARTING\x10\x01\x12\x11\n\rSTATE_RUNNING\x10\x02\x12\x12\n\x0eSTATE_STOPPING\x10\x03\x12\x11\n\rSTATE_STOPPED\x10\x04:\xe2\x01\xea\x41\xde\x01\n\'workstations.googleapis.com/Workstation\x12\x94\x01projects/{project}/locations/{location}/workstationClusters/{workstation_cluster}/workstationConfigs/{workstation_config}/workstations/{workstation}*\x0cworkstations2\x0bworkstationR\x01\x01\"d\n\x1cGetWorkstationClusterRequest\x12\x44\n\x04name\x18\x01 \x01(\tB6\xe0\x41\x02\xfa\x41\x30\n.workstations.googleapis.com/WorkstationCluster\"\x99\x01\n\x1eListWorkstationClustersRequest\x12\x46\n\x06parent\x18\x01 \x01(\tB6\xe0\x41\x02\xfa\x41\x30\x12.workstations.googleapis.com/WorkstationCluster\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\"\xa3\x01\n\x1fListWorkstationClustersResponse\x12R\n\x14workstation_clusters\x18\x01 \x03(\x0b\x32\x34.google.cloud.workstations.v1beta.WorkstationCluster\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x13\n\x0bunreachable\x18\x03 \x03(\t\"\x82\x02\n\x1f\x43reateWorkstationClusterRequest\x12\x46\n\x06parent\x18\x01 \x01(\tB6\xe0\x41\x02\xfa\x41\x30\x12.workstations.googleapis.com/WorkstationCluster\x12#\n\x16workstation_cluster_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12V\n\x13workstation_cluster\x18\x03 \x01(\x0b\x32\x34.google.cloud.workstations.v1beta.WorkstationClusterB\x03\xe0\x41\x02\x12\x1a\n\rvalidate_only\x18\x04 \x01(\x08\x42\x03\xe0\x41\x01\"\xe7\x01\n\x1fUpdateWorkstationClusterRequest\x12V\n\x13workstation_cluster\x18\x01 \x01(\x0b\x32\x34.google.cloud.workstations.v1beta.WorkstationClusterB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\x12\x1a\n\rvalidate_only\x18\x03 \x01(\x08\x42\x03\xe0\x41\x01\x12\x1a\n\rallow_missing\x18\x04 \x01(\x08\x42\x03\xe0\x41\x01\"\xaa\x01\n\x1f\x44\x65leteWorkstationClusterRequest\x12\x44\n\x04name\x18\x01 \x01(\tB6\xe0\x41\x02\xfa\x41\x30\n.workstations.googleapis.com/WorkstationCluster\x12\x1a\n\rvalidate_only\x18\x02 \x01(\x08\x42\x03\xe0\x41\x01\x12\x11\n\x04\x65tag\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12\x12\n\x05\x66orce\x18\x04 \x01(\x08\x42\x03\xe0\x41\x01\"b\n\x1bGetWorkstationConfigRequest\x12\x43\n\x04name\x18\x01 \x01(\tB5\xe0\x41\x02\xfa\x41/\n-workstations.googleapis.com/WorkstationConfig\"\x98\x01\n\x1dListWorkstationConfigsRequest\x12\x46\n\x06parent\x18\x01 \x01(\tB6\xe0\x41\x02\xfa\x41\x30\n.workstations.googleapis.com/WorkstationCluster\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\"\xa0\x01\n\x1eListWorkstationConfigsResponse\x12P\n\x13workstation_configs\x18\x01 \x03(\x0b\x32\x33.google.cloud.workstations.v1beta.WorkstationConfig\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x13\n\x0bunreachable\x18\x03 \x03(\t\"\x9e\x01\n#ListUsableWorkstationConfigsRequest\x12\x46\n\x06parent\x18\x01 \x01(\tB6\xe0\x41\x02\xfa\x41\x30\n.workstations.googleapis.com/WorkstationCluster\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\"\xa6\x01\n$ListUsableWorkstationConfigsResponse\x12P\n\x13workstation_configs\x18\x01 \x03(\x0b\x32\x33.google.cloud.workstations.v1beta.WorkstationConfig\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x13\n\x0bunreachable\x18\x03 \x03(\t\"\xfe\x01\n\x1e\x43reateWorkstationConfigRequest\x12\x46\n\x06parent\x18\x01 \x01(\tB6\xe0\x41\x02\xfa\x41\x30\n.workstations.googleapis.com/WorkstationCluster\x12\"\n\x15workstation_config_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12T\n\x12workstation_config\x18\x03 \x01(\x0b\x32\x33.google.cloud.workstations.v1beta.WorkstationConfigB\x03\xe0\x41\x02\x12\x1a\n\rvalidate_only\x18\x04 \x01(\x08\x42\x03\xe0\x41\x01\"\xe4\x01\n\x1eUpdateWorkstationConfigRequest\x12T\n\x12workstation_config\x18\x01 \x01(\x0b\x32\x33.google.cloud.workstations.v1beta.WorkstationConfigB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\x12\x1a\n\rvalidate_only\x18\x03 \x01(\x08\x42\x03\xe0\x41\x01\x12\x1a\n\rallow_missing\x18\x04 \x01(\x08\x42\x03\xe0\x41\x01\"\xa8\x01\n\x1e\x44\x65leteWorkstationConfigRequest\x12\x43\n\x04name\x18\x01 \x01(\tB5\xe0\x41\x02\xfa\x41/\n-workstations.googleapis.com/WorkstationConfig\x12\x1a\n\rvalidate_only\x18\x02 \x01(\x08\x42\x03\xe0\x41\x01\x12\x11\n\x04\x65tag\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12\x12\n\x05\x66orce\x18\x04 \x01(\x08\x42\x03\xe0\x41\x01\"V\n\x15GetWorkstationRequest\x12=\n\x04name\x18\x01 \x01(\tB/\xe0\x41\x02\xfa\x41)\n\'workstations.googleapis.com/Workstation\"\x91\x01\n\x17ListWorkstationsRequest\x12\x45\n\x06parent\x18\x01 \x01(\tB5\xe0\x41\x02\xfa\x41/\n-workstations.googleapis.com/WorkstationConfig\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\"\x97\x01\n\x18ListWorkstationsResponse\x12\x43\n\x0cworkstations\x18\x01 \x03(\x0b\x32-.google.cloud.workstations.v1beta.Workstation\x12\x1c\n\x0fnext_page_token\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x18\n\x0bunreachable\x18\x03 \x03(\tB\x03\xe0\x41\x01\"\x97\x01\n\x1dListUsableWorkstationsRequest\x12\x45\n\x06parent\x18\x01 \x01(\tB5\xe0\x41\x02\xfa\x41/\n-workstations.googleapis.com/WorkstationConfig\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\"\x93\x01\n\x1eListUsableWorkstationsResponse\x12\x43\n\x0cworkstations\x18\x01 \x03(\x0b\x32-.google.cloud.workstations.v1beta.Workstation\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x13\n\x0bunreachable\x18\x03 \x03(\t\"\xe3\x01\n\x18\x43reateWorkstationRequest\x12\x45\n\x06parent\x18\x01 \x01(\tB5\xe0\x41\x02\xfa\x41/\n-workstations.googleapis.com/WorkstationConfig\x12\x1b\n\x0eworkstation_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12G\n\x0bworkstation\x18\x03 \x01(\x0b\x32-.google.cloud.workstations.v1beta.WorkstationB\x03\xe0\x41\x02\x12\x1a\n\rvalidate_only\x18\x04 \x01(\x08\x42\x03\xe0\x41\x01\"\xd1\x01\n\x18UpdateWorkstationRequest\x12G\n\x0bworkstation\x18\x01 \x01(\x0b\x32-.google.cloud.workstations.v1beta.WorkstationB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\x12\x1a\n\rvalidate_only\x18\x03 \x01(\x08\x42\x03\xe0\x41\x01\x12\x1a\n\rallow_missing\x18\x04 \x01(\x08\x42\x03\xe0\x41\x01\"\x88\x01\n\x18\x44\x65leteWorkstationRequest\x12=\n\x04name\x18\x01 \x01(\tB/\xe0\x41\x02\xfa\x41)\n\'workstations.googleapis.com/Workstation\x12\x1a\n\rvalidate_only\x18\x02 \x01(\x08\x42\x03\xe0\x41\x01\x12\x11\n\x04\x65tag\x18\x03 \x01(\tB\x03\xe0\x41\x01\"\x87\x01\n\x17StartWorkstationRequest\x12=\n\x04name\x18\x01 \x01(\tB/\xe0\x41\x02\xfa\x41)\n\'workstations.googleapis.com/Workstation\x12\x1a\n\rvalidate_only\x18\x02 \x01(\x08\x42\x03\xe0\x41\x01\x12\x11\n\x04\x65tag\x18\x03 \x01(\tB\x03\xe0\x41\x01\"\x86\x01\n\x16StopWorkstationRequest\x12=\n\x04name\x18\x01 \x01(\tB/\xe0\x41\x02\xfa\x41)\n\'workstations.googleapis.com/Workstation\x12\x1a\n\rvalidate_only\x18\x02 \x01(\x08\x42\x03\xe0\x41\x01\x12\x11\n\x04\x65tag\x18\x03 \x01(\tB\x03\xe0\x41\x01\"\xcd\x01\n\x1aGenerateAccessTokenRequest\x12\x31\n\x0b\x65xpire_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampH\x00\x12(\n\x03ttl\x18\x03 \x01(\x0b\x32\x19.google.protobuf.DurationH\x00\x12\x44\n\x0bworkstation\x18\x01 \x01(\tB/\xe0\x41\x02\xfa\x41)\n\'workstations.googleapis.com/WorkstationB\x0c\n\nexpiration\"d\n\x1bGenerateAccessTokenResponse\x12\x14\n\x0c\x61\x63\x63\x65ss_token\x18\x01 \x01(\t\x12/\n\x0b\x65xpire_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"\x80\x02\n\x11OperationMetadata\x12\x34\n\x0b\x63reate_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x31\n\x08\x65nd_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x13\n\x06target\x18\x03 \x01(\tB\x03\xe0\x41\x03\x12\x11\n\x04verb\x18\x04 \x01(\tB\x03\xe0\x41\x03\x12\x1b\n\x0estatus_message\x18\x05 \x01(\tB\x03\xe0\x41\x03\x12#\n\x16requested_cancellation\x18\x06 \x01(\x08\x42\x03\xe0\x41\x03\x12\x18\n\x0b\x61pi_version\x18\x07 \x01(\tB\x03\xe0\x41\x03\x32\xdf+\n\x0cWorkstations\x12\xd9\x01\n\x15GetWorkstationCluster\x12>.google.cloud.workstations.v1beta.GetWorkstationClusterRequest\x1a\x34.google.cloud.workstations.v1beta.WorkstationCluster\"J\xda\x41\x04name\x82\xd3\xe4\x93\x02=\x12;/v1beta/{name=projects/*/locations/*/workstationClusters/*}\x12\xec\x01\n\x17ListWorkstationClusters\x12@.google.cloud.workstations.v1beta.ListWorkstationClustersRequest\x1a\x41.google.cloud.workstations.v1beta.ListWorkstationClustersResponse\"L\xda\x41\x06parent\x82\xd3\xe4\x93\x02=\x12;/v1beta/{parent=projects/*/locations/*}/workstationClusters\x12\xb5\x02\n\x18\x43reateWorkstationCluster\x12\x41.google.cloud.workstations.v1beta.CreateWorkstationClusterRequest\x1a\x1d.google.longrunning.Operation\"\xb6\x01\xca\x41\'\n\x12WorkstationCluster\x12\x11OperationMetadata\xda\x41\x31parent,workstation_cluster,workstation_cluster_id\x82\xd3\xe4\x93\x02R\";/v1beta/{parent=projects/*/locations/*}/workstationClusters:\x13workstation_cluster\x12\xb7\x02\n\x18UpdateWorkstationCluster\x12\x41.google.cloud.workstations.v1beta.UpdateWorkstationClusterRequest\x1a\x1d.google.longrunning.Operation\"\xb8\x01\xca\x41\'\n\x12WorkstationCluster\x12\x11OperationMetadata\xda\x41\x1fworkstation_cluster,update_mask\x82\xd3\xe4\x93\x02\x66\x32O/v1beta/{workstation_cluster.name=projects/*/locations/*/workstationClusters/*}:\x13workstation_cluster\x12\xf2\x01\n\x18\x44\x65leteWorkstationCluster\x12\x41.google.cloud.workstations.v1beta.DeleteWorkstationClusterRequest\x1a\x1d.google.longrunning.Operation\"t\xca\x41\'\n\x12WorkstationCluster\x12\x11OperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02=*;/v1beta/{name=projects/*/locations/*/workstationClusters/*}\x12\xeb\x01\n\x14GetWorkstationConfig\x12=.google.cloud.workstations.v1beta.GetWorkstationConfigRequest\x1a\x33.google.cloud.workstations.v1beta.WorkstationConfig\"_\xda\x41\x04name\x82\xd3\xe4\x93\x02R\x12P/v1beta/{name=projects/*/locations/*/workstationClusters/*/workstationConfigs/*}\x12\xfe\x01\n\x16ListWorkstationConfigs\x12?.google.cloud.workstations.v1beta.ListWorkstationConfigsRequest\x1a@.google.cloud.workstations.v1beta.ListWorkstationConfigsResponse\"a\xda\x41\x06parent\x82\xd3\xe4\x93\x02R\x12P/v1beta/{parent=projects/*/locations/*/workstationClusters/*}/workstationConfigs\x12\x9b\x02\n\x1cListUsableWorkstationConfigs\x12\x45.google.cloud.workstations.v1beta.ListUsableWorkstationConfigsRequest\x1a\x46.google.cloud.workstations.v1beta.ListUsableWorkstationConfigsResponse\"l\xda\x41\x06parent\x82\xd3\xe4\x93\x02]\x12[/v1beta/{parent=projects/*/locations/*/workstationClusters/*}/workstationConfigs:listUsable\x12\xc4\x02\n\x17\x43reateWorkstationConfig\x12@.google.cloud.workstations.v1beta.CreateWorkstationConfigRequest\x1a\x1d.google.longrunning.Operation\"\xc7\x01\xca\x41&\n\x11WorkstationConfig\x12\x11OperationMetadata\xda\x41/parent,workstation_config,workstation_config_id\x82\xd3\xe4\x93\x02\x66\"P/v1beta/{parent=projects/*/locations/*/workstationClusters/*}/workstationConfigs:\x12workstation_config\x12\xc6\x02\n\x17UpdateWorkstationConfig\x12@.google.cloud.workstations.v1beta.UpdateWorkstationConfigRequest\x1a\x1d.google.longrunning.Operation\"\xc9\x01\xca\x41&\n\x11WorkstationConfig\x12\x11OperationMetadata\xda\x41\x1eworkstation_config,update_mask\x82\xd3\xe4\x93\x02y2c/v1beta/{workstation_config.name=projects/*/locations/*/workstationClusters/*/workstationConfigs/*}:\x12workstation_config\x12\x85\x02\n\x17\x44\x65leteWorkstationConfig\x12@.google.cloud.workstations.v1beta.DeleteWorkstationConfigRequest\x1a\x1d.google.longrunning.Operation\"\x88\x01\xca\x41&\n\x11WorkstationConfig\x12\x11OperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02R*P/v1beta/{name=projects/*/locations/*/workstationClusters/*/workstationConfigs/*}\x12\xe8\x01\n\x0eGetWorkstation\x12\x37.google.cloud.workstations.v1beta.GetWorkstationRequest\x1a-.google.cloud.workstations.v1beta.Workstation\"n\xda\x41\x04name\x82\xd3\xe4\x93\x02\x61\x12_/v1beta/{name=projects/*/locations/*/workstationClusters/*/workstationConfigs/*/workstations/*}\x12\xfb\x01\n\x10ListWorkstations\x12\x39.google.cloud.workstations.v1beta.ListWorkstationsRequest\x1a:.google.cloud.workstations.v1beta.ListWorkstationsResponse\"p\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x61\x12_/v1beta/{parent=projects/*/locations/*/workstationClusters/*/workstationConfigs/*}/workstations\x12\x98\x02\n\x16ListUsableWorkstations\x12?.google.cloud.workstations.v1beta.ListUsableWorkstationsRequest\x1a@.google.cloud.workstations.v1beta.ListUsableWorkstationsResponse\"{\xda\x41\x06parent\x82\xd3\xe4\x93\x02l\x12j/v1beta/{parent=projects/*/locations/*/workstationClusters/*/workstationConfigs/*}/workstations:listUsable\x12\xac\x02\n\x11\x43reateWorkstation\x12:.google.cloud.workstations.v1beta.CreateWorkstationRequest\x1a\x1d.google.longrunning.Operation\"\xbb\x01\xca\x41 \n\x0bWorkstation\x12\x11OperationMetadata\xda\x41!parent,workstation,workstation_id\x82\xd3\xe4\x93\x02n\"_/v1beta/{parent=projects/*/locations/*/workstationClusters/*/workstationConfigs/*}/workstations:\x0bworkstation\x12\xae\x02\n\x11UpdateWorkstation\x12:.google.cloud.workstations.v1beta.UpdateWorkstationRequest\x1a\x1d.google.longrunning.Operation\"\xbd\x01\xca\x41 \n\x0bWorkstation\x12\x11OperationMetadata\xda\x41\x17workstation,update_mask\x82\xd3\xe4\x93\x02z2k/v1beta/{workstation.name=projects/*/locations/*/workstationClusters/*/workstationConfigs/*/workstations/*}:\x0bworkstation\x12\x82\x02\n\x11\x44\x65leteWorkstation\x12:.google.cloud.workstations.v1beta.DeleteWorkstationRequest\x1a\x1d.google.longrunning.Operation\"\x91\x01\xca\x41 \n\x0bWorkstation\x12\x11OperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02\x61*_/v1beta/{name=projects/*/locations/*/workstationClusters/*/workstationConfigs/*/workstations/*}\x12\x89\x02\n\x10StartWorkstation\x12\x39.google.cloud.workstations.v1beta.StartWorkstationRequest\x1a\x1d.google.longrunning.Operation\"\x9a\x01\xca\x41 \n\x0bWorkstation\x12\x11OperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02j\"e/v1beta/{name=projects/*/locations/*/workstationClusters/*/workstationConfigs/*/workstations/*}:start:\x01*\x12\x86\x02\n\x0fStopWorkstation\x12\x38.google.cloud.workstations.v1beta.StopWorkstationRequest\x1a\x1d.google.longrunning.Operation\"\x99\x01\xca\x41 \n\x0bWorkstation\x12\x11OperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02i\"d/v1beta/{name=projects/*/locations/*/workstationClusters/*/workstationConfigs/*/workstations/*}:stop:\x01*\x12\xa8\x02\n\x13GenerateAccessToken\x12<.google.cloud.workstations.v1beta.GenerateAccessTokenRequest\x1a=.google.cloud.workstations.v1beta.GenerateAccessTokenResponse\"\x93\x01\xda\x41\x0bworkstation\x82\xd3\xe4\x93\x02\x7f\"z/v1beta/{workstation=projects/*/locations/*/workstationClusters/*/workstationConfigs/*/workstations/*}:generateAccessToken:\x01*\x1aO\xca\x41\x1bworkstations.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\x85\x01\n$com.google.cloud.workstations.v1betaB\x11WorkstationsProtoP\x01ZHcloud.google.com/go/workstations/apiv1beta/workstationspb;workstationspbb\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Cloud + module Workstations + module V1beta + WorkstationCluster = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.workstations.v1beta.WorkstationCluster").msgclass + WorkstationCluster::PrivateClusterConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.workstations.v1beta.WorkstationCluster.PrivateClusterConfig").msgclass + WorkstationConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.workstations.v1beta.WorkstationConfig").msgclass + WorkstationConfig::Host = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.workstations.v1beta.WorkstationConfig.Host").msgclass + WorkstationConfig::Host::GceInstance = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance").msgclass + WorkstationConfig::Host::GceInstance::GceShieldedInstanceConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance.GceShieldedInstanceConfig").msgclass + WorkstationConfig::Host::GceInstance::GceConfidentialInstanceConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance.GceConfidentialInstanceConfig").msgclass + WorkstationConfig::Host::GceInstance::Accelerator = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance.Accelerator").msgclass + WorkstationConfig::PersistentDirectory = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.workstations.v1beta.WorkstationConfig.PersistentDirectory").msgclass + WorkstationConfig::PersistentDirectory::GceRegionalPersistentDisk = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.workstations.v1beta.WorkstationConfig.PersistentDirectory.GceRegionalPersistentDisk").msgclass + WorkstationConfig::PersistentDirectory::GceRegionalPersistentDisk::ReclaimPolicy = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.workstations.v1beta.WorkstationConfig.PersistentDirectory.GceRegionalPersistentDisk.ReclaimPolicy").enummodule + WorkstationConfig::EphemeralDirectory = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.workstations.v1beta.WorkstationConfig.EphemeralDirectory").msgclass + WorkstationConfig::EphemeralDirectory::GcePersistentDisk = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.workstations.v1beta.WorkstationConfig.EphemeralDirectory.GcePersistentDisk").msgclass + WorkstationConfig::Container = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.workstations.v1beta.WorkstationConfig.Container").msgclass + WorkstationConfig::CustomerEncryptionKey = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.workstations.v1beta.WorkstationConfig.CustomerEncryptionKey").msgclass + WorkstationConfig::ReadinessCheck = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.workstations.v1beta.WorkstationConfig.ReadinessCheck").msgclass + Workstation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.workstations.v1beta.Workstation").msgclass + Workstation::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.workstations.v1beta.Workstation.State").enummodule + GetWorkstationClusterRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.workstations.v1beta.GetWorkstationClusterRequest").msgclass + ListWorkstationClustersRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.workstations.v1beta.ListWorkstationClustersRequest").msgclass + ListWorkstationClustersResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.workstations.v1beta.ListWorkstationClustersResponse").msgclass + CreateWorkstationClusterRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.workstations.v1beta.CreateWorkstationClusterRequest").msgclass + UpdateWorkstationClusterRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.workstations.v1beta.UpdateWorkstationClusterRequest").msgclass + DeleteWorkstationClusterRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.workstations.v1beta.DeleteWorkstationClusterRequest").msgclass + GetWorkstationConfigRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.workstations.v1beta.GetWorkstationConfigRequest").msgclass + ListWorkstationConfigsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.workstations.v1beta.ListWorkstationConfigsRequest").msgclass + ListWorkstationConfigsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.workstations.v1beta.ListWorkstationConfigsResponse").msgclass + ListUsableWorkstationConfigsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.workstations.v1beta.ListUsableWorkstationConfigsRequest").msgclass + ListUsableWorkstationConfigsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.workstations.v1beta.ListUsableWorkstationConfigsResponse").msgclass + CreateWorkstationConfigRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.workstations.v1beta.CreateWorkstationConfigRequest").msgclass + UpdateWorkstationConfigRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.workstations.v1beta.UpdateWorkstationConfigRequest").msgclass + DeleteWorkstationConfigRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.workstations.v1beta.DeleteWorkstationConfigRequest").msgclass + GetWorkstationRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.workstations.v1beta.GetWorkstationRequest").msgclass + ListWorkstationsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.workstations.v1beta.ListWorkstationsRequest").msgclass + ListWorkstationsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.workstations.v1beta.ListWorkstationsResponse").msgclass + ListUsableWorkstationsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.workstations.v1beta.ListUsableWorkstationsRequest").msgclass + ListUsableWorkstationsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.workstations.v1beta.ListUsableWorkstationsResponse").msgclass + CreateWorkstationRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.workstations.v1beta.CreateWorkstationRequest").msgclass + UpdateWorkstationRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.workstations.v1beta.UpdateWorkstationRequest").msgclass + DeleteWorkstationRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.workstations.v1beta.DeleteWorkstationRequest").msgclass + StartWorkstationRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.workstations.v1beta.StartWorkstationRequest").msgclass + StopWorkstationRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.workstations.v1beta.StopWorkstationRequest").msgclass + GenerateAccessTokenRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.workstations.v1beta.GenerateAccessTokenRequest").msgclass + GenerateAccessTokenResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.workstations.v1beta.GenerateAccessTokenResponse").msgclass + OperationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.workstations.v1beta.OperationMetadata").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-cloud-workstations-v1beta/lib/google/cloud/workstations/v1beta/workstations_services_pb.rb b/owl-bot-staging/google-cloud-workstations-v1beta/lib/google/cloud/workstations/v1beta/workstations_services_pb.rb new file mode 100644 index 000000000000..90f2fe5da085 --- /dev/null +++ b/owl-bot-staging/google-cloud-workstations-v1beta/lib/google/cloud/workstations/v1beta/workstations_services_pb.rb @@ -0,0 +1,86 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/cloud/workstations/v1beta/workstations.proto for package 'google.cloud.workstations.v1beta' +# 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/workstations/v1beta/workstations_pb' + +module Google + module Cloud + module Workstations + module V1beta + module Workstations + # Service for interacting with Cloud Workstations. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.cloud.workstations.v1beta.Workstations' + + # Returns the requested workstation cluster. + rpc :GetWorkstationCluster, ::Google::Cloud::Workstations::V1beta::GetWorkstationClusterRequest, ::Google::Cloud::Workstations::V1beta::WorkstationCluster + # Returns all workstation clusters in the specified location. + rpc :ListWorkstationClusters, ::Google::Cloud::Workstations::V1beta::ListWorkstationClustersRequest, ::Google::Cloud::Workstations::V1beta::ListWorkstationClustersResponse + # Creates a new workstation cluster. + rpc :CreateWorkstationCluster, ::Google::Cloud::Workstations::V1beta::CreateWorkstationClusterRequest, ::Google::Longrunning::Operation + # Updates an existing workstation cluster. + rpc :UpdateWorkstationCluster, ::Google::Cloud::Workstations::V1beta::UpdateWorkstationClusterRequest, ::Google::Longrunning::Operation + # Deletes the specified workstation cluster. + rpc :DeleteWorkstationCluster, ::Google::Cloud::Workstations::V1beta::DeleteWorkstationClusterRequest, ::Google::Longrunning::Operation + # Returns the requested workstation configuration. + rpc :GetWorkstationConfig, ::Google::Cloud::Workstations::V1beta::GetWorkstationConfigRequest, ::Google::Cloud::Workstations::V1beta::WorkstationConfig + # Returns all workstation configurations in the specified cluster. + rpc :ListWorkstationConfigs, ::Google::Cloud::Workstations::V1beta::ListWorkstationConfigsRequest, ::Google::Cloud::Workstations::V1beta::ListWorkstationConfigsResponse + # Returns all workstation configurations in the specified cluster on which + # the caller has the "workstations.workstation.create" permission. + rpc :ListUsableWorkstationConfigs, ::Google::Cloud::Workstations::V1beta::ListUsableWorkstationConfigsRequest, ::Google::Cloud::Workstations::V1beta::ListUsableWorkstationConfigsResponse + # Creates a new workstation configuration. + rpc :CreateWorkstationConfig, ::Google::Cloud::Workstations::V1beta::CreateWorkstationConfigRequest, ::Google::Longrunning::Operation + # Updates an existing workstation configuration. + rpc :UpdateWorkstationConfig, ::Google::Cloud::Workstations::V1beta::UpdateWorkstationConfigRequest, ::Google::Longrunning::Operation + # Deletes the specified workstation configuration. + rpc :DeleteWorkstationConfig, ::Google::Cloud::Workstations::V1beta::DeleteWorkstationConfigRequest, ::Google::Longrunning::Operation + # Returns the requested workstation. + rpc :GetWorkstation, ::Google::Cloud::Workstations::V1beta::GetWorkstationRequest, ::Google::Cloud::Workstations::V1beta::Workstation + # Returns all Workstations using the specified workstation configuration. + rpc :ListWorkstations, ::Google::Cloud::Workstations::V1beta::ListWorkstationsRequest, ::Google::Cloud::Workstations::V1beta::ListWorkstationsResponse + # Returns all workstations using the specified workstation configuration + # on which the caller has the "workstations.workstations.use" permission. + rpc :ListUsableWorkstations, ::Google::Cloud::Workstations::V1beta::ListUsableWorkstationsRequest, ::Google::Cloud::Workstations::V1beta::ListUsableWorkstationsResponse + # Creates a new workstation. + rpc :CreateWorkstation, ::Google::Cloud::Workstations::V1beta::CreateWorkstationRequest, ::Google::Longrunning::Operation + # Updates an existing workstation. + rpc :UpdateWorkstation, ::Google::Cloud::Workstations::V1beta::UpdateWorkstationRequest, ::Google::Longrunning::Operation + # Deletes the specified workstation. + rpc :DeleteWorkstation, ::Google::Cloud::Workstations::V1beta::DeleteWorkstationRequest, ::Google::Longrunning::Operation + # Starts running a workstation so that users can connect to it. + rpc :StartWorkstation, ::Google::Cloud::Workstations::V1beta::StartWorkstationRequest, ::Google::Longrunning::Operation + # Stops running a workstation, reducing costs. + rpc :StopWorkstation, ::Google::Cloud::Workstations::V1beta::StopWorkstationRequest, ::Google::Longrunning::Operation + # Returns a short-lived credential that can be used to send authenticated and + # authorized traffic to a workstation. + rpc :GenerateAccessToken, ::Google::Cloud::Workstations::V1beta::GenerateAccessTokenRequest, ::Google::Cloud::Workstations::V1beta::GenerateAccessTokenResponse + end + + Stub = Service.rpc_stub_class + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-workstations-v1beta/proto_docs/README.md b/owl-bot-staging/google-cloud-workstations-v1beta/proto_docs/README.md new file mode 100644 index 000000000000..3f70f22b3c09 --- /dev/null +++ b/owl-bot-staging/google-cloud-workstations-v1beta/proto_docs/README.md @@ -0,0 +1,4 @@ +# Cloud Workstations V1BETA 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-workstations-v1beta/proto_docs/google/api/client.rb b/owl-bot-staging/google-cloud-workstations-v1beta/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..3ab0b096d445 --- /dev/null +++ b/owl-bot-staging/google-cloud-workstations-v1beta/proto_docs/google/api/client.rb @@ -0,0 +1,593 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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. + # + # Note: This field should not be used in most cases. + 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: + # library_settings: + # 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. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Php. Clobbers the php_namespace option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.php.package_name" field + # in gapic.yaml. API teams should use the protobuf php_namespace option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # library_settings: + # php_settings: + # library_package: Google\Cloud\PubSub\V1 + 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. + # + # Example: + # + # 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 + # @!attribute [rw] batching + # @return [::Google::Api::BatchingConfigProto] + # Batching configuration for an API method in client libraries. + # + # Example of a YAML configuration: + # + # publishing: + # method_settings: + # - selector: google.example.v1.ExampleService.BatchCreateExample + # batching: + # element_count_threshold: 1000 + # request_byte_threshold: 100000000 + # delay_threshold_millis: 10 + 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. + # + # Note: This feature should not be used in most cases. + # @!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 + + # `BatchingConfigProto` defines the batching configuration for an API method. + # @!attribute [rw] thresholds + # @return [::Google::Api::BatchingSettingsProto] + # The thresholds which trigger a batched request to be sent. + # @!attribute [rw] batch_descriptor + # @return [::Google::Api::BatchingDescriptorProto] + # The request and response fields used in batching. + class BatchingConfigProto + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `BatchingSettingsProto` specifies a set of batching thresholds, each of + # which acts as a trigger to send a batch of messages as a request. At least + # one threshold must be positive nonzero. + # @!attribute [rw] element_count_threshold + # @return [::Integer] + # The number of elements of a field collected into a batch which, if + # exceeded, causes the batch to be sent. + # @!attribute [rw] request_byte_threshold + # @return [::Integer] + # The aggregated size of the batched field which, if exceeded, causes the + # batch to be sent. This size is computed by aggregating the sizes of the + # request field to be batched, not of the entire request message. + # @!attribute [rw] delay_threshold + # @return [::Google::Protobuf::Duration] + # The duration after which a batch should be sent, starting from the addition + # of the first message to that batch. + # @!attribute [rw] element_count_limit + # @return [::Integer] + # The maximum number of elements collected in a batch that could be accepted + # by server. + # @!attribute [rw] request_byte_limit + # @return [::Integer] + # The maximum size of the request that could be accepted by server. + # @!attribute [rw] flow_control_element_limit + # @return [::Integer] + # The maximum number of elements allowed by flow control. + # @!attribute [rw] flow_control_byte_limit + # @return [::Integer] + # The maximum size of data allowed by flow control. + # @!attribute [rw] flow_control_limit_exceeded_behavior + # @return [::Google::Api::FlowControlLimitExceededBehaviorProto] + # The behavior to take when the flow control limit is exceeded. + class BatchingSettingsProto + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `BatchingDescriptorProto` specifies the fields of the request message to be + # used for batching, and, optionally, the fields of the response message to be + # used for demultiplexing. + # @!attribute [rw] batched_field + # @return [::String] + # The repeated field in the request message to be aggregated by batching. + # @!attribute [rw] discriminator_fields + # @return [::Array<::String>] + # A list of the fields in the request message. Two requests will be batched + # together only if the values of every field specified in + # `request_discriminator_fields` is equal between the two requests. + # @!attribute [rw] subresponse_field + # @return [::String] + # Optional. When present, indicates the field in the response message to be + # used to demultiplex the response into multiple response messages, in + # correspondence with the multiple request messages originally batched + # together. + class BatchingDescriptorProto + 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 + + # The behavior to take when the flow control limit is exceeded. + module FlowControlLimitExceededBehaviorProto + # Default behavior, system-defined. + UNSET_BEHAVIOR = 0 + + # Stop operation, raise error. + THROW_EXCEPTION = 1 + + # Pause operation until limit clears. + BLOCK = 2 + + # Continue operation, disregard limit. + IGNORE = 3 + end + end +end diff --git a/owl-bot-staging/google-cloud-workstations-v1beta/proto_docs/google/api/field_behavior.rb b/owl-bot-staging/google-cloud-workstations-v1beta/proto_docs/google/api/field_behavior.rb new file mode 100644 index 000000000000..582be187d115 --- /dev/null +++ b/owl-bot-staging/google-cloud-workstations-v1beta/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-workstations-v1beta/proto_docs/google/api/launch_stage.rb b/owl-bot-staging/google-cloud-workstations-v1beta/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..9392a413fb1b --- /dev/null +++ b/owl-bot-staging/google-cloud-workstations-v1beta/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-workstations-v1beta/proto_docs/google/api/resource.rb b/owl-bot-staging/google-cloud-workstations-v1beta/proto_docs/google/api/resource.rb new file mode 100644 index 000000000000..25dec4847ac1 --- /dev/null +++ b/owl-bot-staging/google-cloud-workstations-v1beta/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-workstations-v1beta/proto_docs/google/cloud/workstations/v1beta/workstations.rb b/owl-bot-staging/google-cloud-workstations-v1beta/proto_docs/google/cloud/workstations/v1beta/workstations.rb new file mode 100644 index 000000000000..dc2b64da78fb --- /dev/null +++ b/owl-bot-staging/google-cloud-workstations-v1beta/proto_docs/google/cloud/workstations/v1beta/workstations.rb @@ -0,0 +1,1265 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Workstations + module V1beta + # A workstation cluster resource in the Cloud Workstations API. + # + # Defines a group of workstations in a particular region and the + # VPC network they're attached to. + # @!attribute [rw] name + # @return [::String] + # Full name of this workstation cluster. + # @!attribute [rw] display_name + # @return [::String] + # Optional. Human-readable name for this workstation cluster. + # @!attribute [r] uid + # @return [::String] + # Output only. A system-assigned unique identifier for this workstation + # cluster. + # @!attribute [r] reconciling + # @return [::Boolean] + # Output only. Indicates whether this workstation cluster is currently being + # updated to match its intended state. + # @!attribute [rw] annotations + # @return [::Google::Protobuf::Map{::String => ::String}] + # Optional. Client-specified annotations. + # @!attribute [rw] labels + # @return [::Google::Protobuf::Map{::String => ::String}] + # Optional. + # [Labels](https://cloud.google.com/workstations/docs/label-resources) that + # are applied to the workstation cluster and that are also propagated to the + # underlying Compute Engine resources. + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Time when this workstation cluster was created. + # @!attribute [r] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Time when this workstation cluster was most recently updated. + # @!attribute [r] delete_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Time when this workstation cluster was soft-deleted. + # @!attribute [rw] etag + # @return [::String] + # Optional. Checksum computed by the server. May be sent on update and delete + # requests to make sure that the client has an up-to-date value before + # proceeding. + # @!attribute [rw] network + # @return [::String] + # Immutable. Name of the Compute Engine network in which instances associated + # with this workstation cluster will be created. + # @!attribute [rw] subnetwork + # @return [::String] + # Immutable. Name of the Compute Engine subnetwork in which instances + # associated with this workstation cluster will be created. Must be part of + # the subnetwork specified for this workstation cluster. + # @!attribute [r] control_plane_ip + # @return [::String] + # Output only. The private IP address of the control plane for this + # workstation cluster. Workstation VMs need access to this IP address to work + # with the service, so make sure that your firewall rules allow egress from + # the workstation VMs to this address. + # @!attribute [rw] private_cluster_config + # @return [::Google::Cloud::Workstations::V1beta::WorkstationCluster::PrivateClusterConfig] + # Optional. Configuration for private workstation cluster. + # @!attribute [r] degraded + # @return [::Boolean] + # Output only. Whether this workstation cluster is in degraded mode, in which + # case it may require user action to restore full functionality. Details can + # be found in + # {::Google::Cloud::Workstations::V1beta::WorkstationCluster#conditions conditions}. + # @!attribute [r] conditions + # @return [::Array<::Google::Rpc::Status>] + # Output only. Status conditions describing the workstation cluster's current + # state. + class WorkstationCluster + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Configuration options for private workstation clusters. + # @!attribute [rw] enable_private_endpoint + # @return [::Boolean] + # Immutable. Whether Workstations endpoint is private. + # @!attribute [r] cluster_hostname + # @return [::String] + # Output only. Hostname for the workstation cluster. This field will be + # populated only when private endpoint is enabled. To access workstations + # in the workstation cluster, create a new DNS zone mapping this domain + # name to an internal IP address and a forwarding rule mapping that address + # to the service attachment. + # @!attribute [r] service_attachment_uri + # @return [::String] + # Output only. Service attachment URI for the workstation cluster. The + # service attachemnt is created when private endpoint is enabled. To access + # workstations in the workstation cluster, configure access to the managed + # service using [Private Service + # Connect](https://cloud.google.com/vpc/docs/configure-private-service-connect-services). + # @!attribute [rw] allowed_projects + # @return [::Array<::String>] + # Optional. Additional projects that are allowed to attach to the + # workstation cluster's service attachment. By default, the workstation + # cluster's project and the VPC host project (if different) are allowed. + class PrivateClusterConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class AnnotationsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class LabelsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # A workstation configuration resource in the Cloud Workstations API. + # + # Workstation configurations act as templates for workstations. The workstation + # configuration defines details such as the workstation virtual machine (VM) + # instance type, persistent storage, container image defining environment, + # which IDE or Code Editor to use, and more. Administrators and platform teams + # can also use [Identity and Access Management + # (IAM)](https://cloud.google.com/iam/docs/overview) rules to grant access to + # teams or to individual developers. + # @!attribute [rw] name + # @return [::String] + # Full name of this workstation configuration. + # @!attribute [rw] display_name + # @return [::String] + # Optional. Human-readable name for this workstation configuration. + # @!attribute [r] uid + # @return [::String] + # Output only. A system-assigned unique identifier for this workstation + # configuration. + # @!attribute [r] reconciling + # @return [::Boolean] + # Output only. Indicates whether this workstation configuration is currently + # being updated to match its intended state. + # @!attribute [rw] annotations + # @return [::Google::Protobuf::Map{::String => ::String}] + # Optional. Client-specified annotations. + # @!attribute [rw] labels + # @return [::Google::Protobuf::Map{::String => ::String}] + # Optional. + # [Labels](https://cloud.google.com/workstations/docs/label-resources) that + # are applied to the workstation configuration and that are also propagated + # to the underlying Compute Engine resources. + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Time when this workstation configuration was created. + # @!attribute [r] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Time when this workstation configuration was most recently + # updated. + # @!attribute [r] delete_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Time when this workstation configuration was soft-deleted. + # @!attribute [rw] etag + # @return [::String] + # Optional. Checksum computed by the server. May be sent on update and delete + # requests to make sure that the client has an up-to-date value before + # proceeding. + # @!attribute [rw] idle_timeout + # @return [::Google::Protobuf::Duration] + # Optional. Number of seconds to wait before automatically stopping a + # workstation after it last received user traffic. + # + # A value of `"0s"` indicates that Cloud Workstations VMs created with this + # configuration should never time out due to idleness. + # Provide + # [duration](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#duration) + # terminated by `s` for seconds—for example, `"7200s"` (2 hours). + # The default is `"1200s"` (20 minutes). + # @!attribute [rw] running_timeout + # @return [::Google::Protobuf::Duration] + # Optional. Number of seconds that a workstation can run until it is + # automatically shut down. We recommend that workstations be shut down daily + # to reduce costs and so that security updates can be applied upon restart. + # The + # {::Google::Cloud::Workstations::V1beta::WorkstationConfig#idle_timeout idle_timeout} + # and + # {::Google::Cloud::Workstations::V1beta::WorkstationConfig#running_timeout running_timeout} + # fields are independent of each other. Note that the + # {::Google::Cloud::Workstations::V1beta::WorkstationConfig#running_timeout running_timeout} + # field shuts down VMs after the specified time, regardless of whether or not + # the VMs are idle. + # + # Provide duration terminated by `s` for seconds—for example, `"54000s"` + # (15 hours). Defaults to `"43200s"` (12 hours). A value of `"0s"` indicates + # that workstations using this configuration should never time out. If + # {::Google::Cloud::Workstations::V1beta::WorkstationConfig#encryption_key encryption_key} + # is set, it must be greater than `"0s"` and less than + # `"86400s"` (24 hours). + # + # Warning: A value of `"0s"` indicates that Cloud Workstations VMs created + # with this configuration have no maximum running time. This is strongly + # discouraged because you incur costs and will not pick up security updates. + # @!attribute [rw] host + # @return [::Google::Cloud::Workstations::V1beta::WorkstationConfig::Host] + # Optional. Runtime host for the workstation. + # @!attribute [rw] persistent_directories + # @return [::Array<::Google::Cloud::Workstations::V1beta::WorkstationConfig::PersistentDirectory>] + # Optional. Directories to persist across workstation sessions. + # @!attribute [rw] ephemeral_directories + # @return [::Array<::Google::Cloud::Workstations::V1beta::WorkstationConfig::EphemeralDirectory>] + # Optional. Ephemeral directories which won't persist across workstation + # sessions. + # @!attribute [rw] container + # @return [::Google::Cloud::Workstations::V1beta::WorkstationConfig::Container] + # Optional. Container that runs upon startup for each workstation using this + # workstation configuration. + # @!attribute [rw] encryption_key + # @return [::Google::Cloud::Workstations::V1beta::WorkstationConfig::CustomerEncryptionKey] + # Immutable. Encrypts resources of this workstation configuration using a + # customer-managed encryption key (CMEK). + # + # If specified, the boot disk of the Compute Engine instance and the + # persistent disk are encrypted using this encryption key. If + # this field is not set, the disks are encrypted using a generated + # key. Customer-managed encryption keys do not protect disk metadata. + # + # If the customer-managed encryption key is rotated, when the workstation + # instance is stopped, the system attempts to recreate the + # persistent disk with the new version of the key. Be sure to keep + # older versions of the key until the persistent disk is recreated. + # Otherwise, data on the persistent disk might be lost. + # + # If the encryption key is revoked, the workstation session automatically + # stops within 7 hours. + # + # Immutable after the workstation configuration is created. + # @!attribute [rw] readiness_checks + # @return [::Array<::Google::Cloud::Workstations::V1beta::WorkstationConfig::ReadinessCheck>] + # Optional. Readiness checks to perform when starting a workstation using + # this workstation configuration. Mark a workstation as running only after + # all specified readiness checks return 200 status codes. + # @!attribute [rw] replica_zones + # @return [::Array<::String>] + # Optional. Immutable. Specifies the zones used to replicate the VM and disk + # resources within the region. If set, exactly two zones within the + # workstation cluster's region must be specified—for example, + # `['us-central1-a', 'us-central1-f']`. If this field is empty, two default + # zones within the region are used. + # + # Immutable after the workstation configuration is created. + # @!attribute [r] degraded + # @return [::Boolean] + # Output only. Whether this resource is degraded, in which case it may + # require user action to restore full functionality. See also the + # {::Google::Cloud::Workstations::V1beta::WorkstationConfig#conditions conditions} + # field. + # @!attribute [r] conditions + # @return [::Array<::Google::Rpc::Status>] + # Output only. Status conditions describing the current resource state. + # @!attribute [rw] enable_audit_agent + # @return [::Boolean] + # Optional. Whether to enable Linux `auditd` logging on the workstation. When + # enabled, a service account must also be specified that has + # `logging.buckets.write` permission on the project. Operating system audit + # logging is distinct from [Cloud Audit + # Logs](https://cloud.google.com/workstations/docs/audit-logging). + class WorkstationConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Runtime host for a workstation. + # @!attribute [rw] gce_instance + # @return [::Google::Cloud::Workstations::V1beta::WorkstationConfig::Host::GceInstance] + # Specifies a Compute Engine instance as the host. + class Host + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # A runtime using a Compute Engine instance. + # @!attribute [rw] machine_type + # @return [::String] + # Optional. The type of machine to use for VM instances—for example, + # `"e2-standard-4"`. For more information about machine types that + # Cloud Workstations supports, see the list of + # [available machine + # types](https://cloud.google.com/workstations/docs/available-machine-types). + # @!attribute [rw] service_account + # @return [::String] + # Optional. The email address of the service account for Cloud + # Workstations VMs created with this configuration. When specified, be + # sure that the service account has `logginglogEntries.create` permission + # on the project so it can write logs out to Cloud Logging. If using a + # custom container image, the service account must have permissions to + # pull the specified image. + # + # If you as the administrator want to be able to `ssh` into the + # underlying VM, you need to set this value to a service account + # for which you have the `iam.serviceAccounts.actAs` permission. + # Conversely, if you don't want anyone to be able to `ssh` into the + # underlying VM, use a service account where no one has that + # permission. + # + # If not set, VMs run with a service account provided by the + # Cloud Workstations service, and the image must be publicly + # accessible. + # @!attribute [rw] service_account_scopes + # @return [::Array<::String>] + # Optional. Scopes to grant to the + # {::Google::Cloud::Workstations::V1beta::WorkstationConfig::Host::GceInstance#service_account service_account}. + # Various scopes are automatically added based on feature usage. When + # specified, users of workstations under this configuration must have + # `iam.serviceAccounts.actAs` on the service account. + # @!attribute [rw] tags + # @return [::Array<::String>] + # Optional. Network tags to add to the Compute Engine VMs backing the + # workstations. This option applies + # [network + # tags](https://cloud.google.com/vpc/docs/add-remove-network-tags) to VMs + # created with this configuration. These network tags enable the creation + # of [firewall + # rules](https://cloud.google.com/workstations/docs/configure-firewall-rules). + # @!attribute [rw] pool_size + # @return [::Integer] + # Optional. The number of VMs that the system should keep idle so that + # new workstations can be started quickly for new users. Defaults to `0` + # in the API. + # @!attribute [r] pooled_instances + # @return [::Integer] + # Output only. Number of instances currently available in the pool for + # faster workstation startup. + # @!attribute [rw] disable_public_ip_addresses + # @return [::Boolean] + # Optional. When set to true, disables public IP addresses for VMs. If + # you disable public IP addresses, you must set up Private Google Access + # or Cloud NAT on your network. If you use Private Google Access and you + # use `private.googleapis.com` or `restricted.googleapis.com` for + # Container Registry and Artifact Registry, make sure that you set + # up DNS records for domains `*.gcr.io` and `*.pkg.dev`. + # Defaults to false (VMs have public IP addresses). + # @!attribute [rw] enable_nested_virtualization + # @return [::Boolean] + # Optional. Whether to enable nested virtualization on Cloud Workstations + # VMs created under this workstation configuration. + # + # Nested virtualization lets you run virtual machine (VM) instances + # inside your workstation. Before enabling nested virtualization, + # consider the following important considerations. Cloud Workstations + # instances are subject to the [same restrictions as Compute Engine + # instances](https://cloud.google.com/compute/docs/instances/nested-virtualization/overview#restrictions): + # + # * **Organization policy**: projects, folders, or + # organizations may be restricted from creating nested VMs if the + # **Disable VM nested virtualization** constraint is enforced in + # the organization policy. For more information, see the + # Compute Engine section, + # [Checking whether nested virtualization is + # allowed](https://cloud.google.com/compute/docs/instances/nested-virtualization/managing-constraint#checking_whether_nested_virtualization_is_allowed). + # * **Performance**: nested VMs might experience a 10% or greater + # decrease in performance for workloads that are CPU-bound and + # possibly greater than a 10% decrease for workloads that are + # input/output bound. + # * **Machine Type**: nested virtualization can only be enabled on + # workstation configurations that specify a + # {::Google::Cloud::Workstations::V1beta::WorkstationConfig::Host::GceInstance#machine_type machine_type} + # in the N1 or N2 machine series. + # * **GPUs**: nested virtualization may not be enabled on workstation + # configurations with accelerators. + # * **Operating System**: Because + # [Container-Optimized + # OS](https://cloud.google.com/compute/docs/images/os-details#container-optimized_os_cos) + # does not support nested virtualization, when nested virtualization is + # enabled, the underlying Compute Engine VM instances boot from an + # [Ubuntu + # LTS](https://cloud.google.com/compute/docs/images/os-details#ubuntu_lts) + # image. + # @!attribute [rw] shielded_instance_config + # @return [::Google::Cloud::Workstations::V1beta::WorkstationConfig::Host::GceInstance::GceShieldedInstanceConfig] + # Optional. A set of Compute Engine Shielded instance options. + # @!attribute [rw] confidential_instance_config + # @return [::Google::Cloud::Workstations::V1beta::WorkstationConfig::Host::GceInstance::GceConfidentialInstanceConfig] + # Optional. A set of Compute Engine Confidential VM instance options. + # @!attribute [rw] boot_disk_size_gb + # @return [::Integer] + # Optional. The size of the boot disk for the VM in gigabytes (GB). + # The minimum boot disk size is `30` GB. Defaults to `50` GB. + # @!attribute [rw] accelerators + # @return [::Array<::Google::Cloud::Workstations::V1beta::WorkstationConfig::Host::GceInstance::Accelerator>] + # Optional. A list of the type and count of accelerator cards attached to + # the instance. + class GceInstance + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # A set of Compute Engine Shielded instance options. + # @!attribute [rw] enable_secure_boot + # @return [::Boolean] + # Optional. Whether the instance has Secure Boot enabled. + # @!attribute [rw] enable_vtpm + # @return [::Boolean] + # Optional. Whether the instance has the vTPM enabled. + # @!attribute [rw] enable_integrity_monitoring + # @return [::Boolean] + # Optional. Whether the instance has integrity monitoring enabled. + class GceShieldedInstanceConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A set of Compute Engine Confidential VM instance options. + # @!attribute [rw] enable_confidential_compute + # @return [::Boolean] + # Optional. Whether the instance has confidential compute enabled. + class GceConfidentialInstanceConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # An accelerator card attached to the instance. + # @!attribute [rw] type + # @return [::String] + # Optional. Type of accelerator resource to attach to the instance, for + # example, + # `"nvidia-tesla-p100"`. + # @!attribute [rw] count + # @return [::Integer] + # Optional. Number of accelerator cards exposed to the instance. + class Accelerator + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + + # A directory to persist across workstation sessions. + # @!attribute [rw] gce_pd + # @return [::Google::Cloud::Workstations::V1beta::WorkstationConfig::PersistentDirectory::GceRegionalPersistentDisk] + # A PersistentDirectory backed by a Compute Engine persistent disk. + # @!attribute [rw] mount_path + # @return [::String] + # Optional. Location of this directory in the running workstation. + class PersistentDirectory + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # A PersistentDirectory backed by a Compute Engine regional persistent + # disk. The + # {::Google::Cloud::Workstations::V1beta::WorkstationConfig#persistent_directories persistent_directories} + # field is repeated, but it may contain only one entry. It creates a + # [persistent + # disk](https://cloud.google.com/compute/docs/disks/persistent-disks) that + # mounts to the workstation VM at `/home` when the session starts and + # detaches when the session ends. If this field is empty, workstations + # created with this configuration do not have a persistent home + # directory. + # @!attribute [rw] size_gb + # @return [::Integer] + # Optional. The GB capacity of a persistent home directory for each + # workstation created with this configuration. Must be empty if + # {::Google::Cloud::Workstations::V1beta::WorkstationConfig::PersistentDirectory::GceRegionalPersistentDisk#source_snapshot source_snapshot} + # is set. + # + # Valid values are `10`, `50`, `100`, `200`, `500`, or `1000`. + # Defaults to `200`. If less than `200` GB, the + # {::Google::Cloud::Workstations::V1beta::WorkstationConfig::PersistentDirectory::GceRegionalPersistentDisk#disk_type disk_type} + # must be + # `"pd-balanced"` or `"pd-ssd"`. + # @!attribute [rw] fs_type + # @return [::String] + # Optional. Type of file system that the disk should be formatted with. + # The workstation image must support this file system type. Must be empty + # if + # {::Google::Cloud::Workstations::V1beta::WorkstationConfig::PersistentDirectory::GceRegionalPersistentDisk#source_snapshot source_snapshot} + # is set. Defaults to `"ext4"`. + # @!attribute [rw] disk_type + # @return [::String] + # Optional. The [type of the persistent + # disk](https://cloud.google.com/compute/docs/disks#disk-types) for the + # home directory. Defaults to `"pd-standard"`. + # @!attribute [rw] source_snapshot + # @return [::String] + # Optional. Name of the snapshot to use as the source for the disk. If + # set, + # {::Google::Cloud::Workstations::V1beta::WorkstationConfig::PersistentDirectory::GceRegionalPersistentDisk#size_gb size_gb} + # and + # {::Google::Cloud::Workstations::V1beta::WorkstationConfig::PersistentDirectory::GceRegionalPersistentDisk#fs_type fs_type} + # must be empty. + # @!attribute [rw] reclaim_policy + # @return [::Google::Cloud::Workstations::V1beta::WorkstationConfig::PersistentDirectory::GceRegionalPersistentDisk::ReclaimPolicy] + # Optional. Whether the persistent disk should be deleted when the + # workstation is deleted. Valid values are `DELETE` and `RETAIN`. + # Defaults to `DELETE`. + class GceRegionalPersistentDisk + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Value representing what should happen to the disk after the workstation + # is deleted. + module ReclaimPolicy + # Do not use. + RECLAIM_POLICY_UNSPECIFIED = 0 + + # Delete the persistent disk when deleting the workstation. + DELETE = 1 + + # Keep the persistent disk when deleting the workstation. + # An administrator must manually delete the disk. + RETAIN = 2 + end + end + end + + # An ephemeral directory which won't persist across workstation sessions. It + # is freshly created on every workstation start operation. + # @!attribute [rw] gce_pd + # @return [::Google::Cloud::Workstations::V1beta::WorkstationConfig::EphemeralDirectory::GcePersistentDisk] + # An EphemeralDirectory backed by a Compute Engine persistent disk. + # @!attribute [rw] mount_path + # @return [::String] + # Required. Location of this directory in the running workstation. + class EphemeralDirectory + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # An EphemeralDirectory is backed by a Compute Engine persistent disk. + # @!attribute [rw] disk_type + # @return [::String] + # Optional. Type of the disk to use. Defaults to `"pd-standard"`. + # @!attribute [rw] source_snapshot + # @return [::String] + # Optional. Name of the snapshot to use as the source for the disk. Must + # be empty if + # {::Google::Cloud::Workstations::V1beta::WorkstationConfig::EphemeralDirectory::GcePersistentDisk#source_image source_image} + # is set. Updating + # {::Google::Cloud::Workstations::V1beta::WorkstationConfig::EphemeralDirectory::GcePersistentDisk#source_snapshot source_snapshot} + # will update content in the ephemeral directory after the workstation is + # restarted. This field is mutable. + # @!attribute [rw] source_image + # @return [::String] + # Optional. Name of the disk image to use as the source for the disk. + # Must be empty if + # {::Google::Cloud::Workstations::V1beta::WorkstationConfig::EphemeralDirectory::GcePersistentDisk#source_snapshot source_snapshot} + # is set. Updating + # {::Google::Cloud::Workstations::V1beta::WorkstationConfig::EphemeralDirectory::GcePersistentDisk#source_image source_image} + # will update content in the ephemeral directory after the workstation is + # restarted. This field is mutable. + # @!attribute [rw] read_only + # @return [::Boolean] + # Optional. Whether the disk is read only. If true, the disk may be + # shared by multiple VMs and + # {::Google::Cloud::Workstations::V1beta::WorkstationConfig::EphemeralDirectory::GcePersistentDisk#source_snapshot source_snapshot} + # must be set. + class GcePersistentDisk + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # A Docker container. + # @!attribute [rw] image + # @return [::String] + # Optional. A Docker container image that defines a custom environment. + # + # Cloud Workstations provides a number of + # [preconfigured + # images](https://cloud.google.com/workstations/docs/preconfigured-base-images), + # but you can create your own + # [custom container + # images](https://cloud.google.com/workstations/docs/custom-container-images). + # If using a private image, the `host.gceInstance.serviceAccount` field + # must be specified in the workstation configuration and must have + # permission to pull the specified image. Otherwise, the image must be + # publicly accessible. + # @!attribute [rw] command + # @return [::Array<::String>] + # Optional. If set, overrides the default ENTRYPOINT specified by the + # image. + # @!attribute [rw] args + # @return [::Array<::String>] + # Optional. Arguments passed to the entrypoint. + # @!attribute [rw] env + # @return [::Google::Protobuf::Map{::String => ::String}] + # Optional. Environment variables passed to the container's entrypoint. + # @!attribute [rw] working_dir + # @return [::String] + # Optional. If set, overrides the default DIR specified by the image. + # @!attribute [rw] run_as_user + # @return [::Integer] + # Optional. If set, overrides the USER specified in the image with the + # given uid. + class Container + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class EnvEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # A customer-managed encryption key (CMEK) for the Compute Engine + # resources of the associated workstation configuration. Specify the name of + # your Cloud KMS encryption key and the default service account. + # We recommend that you use a separate service account and follow + # [Cloud KMS best + # practices](https://cloud.google.com/kms/docs/separation-of-duties). + # @!attribute [rw] kms_key + # @return [::String] + # Immutable. The name of the Google Cloud KMS encryption key. For example, + # `"projects/PROJECT_ID/locations/REGION/keyRings/KEY_RING/cryptoKeys/KEY_NAME"`. + # The key must be in the same region as the workstation configuration. + # @!attribute [rw] kms_key_service_account + # @return [::String] + # Immutable. The service account to use with the specified + # KMS key. We recommend that you use a separate service account + # and follow KMS best practices. For more information, see + # [Separation of + # duties](https://cloud.google.com/kms/docs/separation-of-duties) and + # `gcloud kms keys add-iam-policy-binding` + # [`--member`](https://cloud.google.com/sdk/gcloud/reference/kms/keys/add-iam-policy-binding#--member). + class CustomerEncryptionKey + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # A readiness check to be performed on a workstation. + # @!attribute [rw] path + # @return [::String] + # Optional. Path to which the request should be sent. + # @!attribute [rw] port + # @return [::Integer] + # Optional. Port to which the request should be sent. + class ReadinessCheck + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class AnnotationsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class LabelsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # A single instance of a developer workstation with its own persistent storage. + # @!attribute [rw] name + # @return [::String] + # Full name of this workstation. + # @!attribute [rw] display_name + # @return [::String] + # Optional. Human-readable name for this workstation. + # @!attribute [r] uid + # @return [::String] + # Output only. A system-assigned unique identifier for this workstation. + # @!attribute [r] reconciling + # @return [::Boolean] + # Output only. Indicates whether this workstation is currently being updated + # to match its intended state. + # @!attribute [rw] annotations + # @return [::Google::Protobuf::Map{::String => ::String}] + # Optional. Client-specified annotations. + # @!attribute [rw] labels + # @return [::Google::Protobuf::Map{::String => ::String}] + # Optional. + # [Labels](https://cloud.google.com/workstations/docs/label-resources) that + # are applied to the workstation and that are also propagated to the + # underlying Compute Engine resources. + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Time when this workstation was created. + # @!attribute [r] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Time when this workstation was most recently updated. + # @!attribute [r] start_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Time when this workstation was most recently successfully + # started, regardless of the workstation's initial state. + # @!attribute [r] delete_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Time when this workstation was soft-deleted. + # @!attribute [rw] etag + # @return [::String] + # Optional. Checksum computed by the server. May be sent on update and delete + # requests to make sure that the client has an up-to-date value before + # proceeding. + # @!attribute [r] state + # @return [::Google::Cloud::Workstations::V1beta::Workstation::State] + # Output only. Current state of the workstation. + # @!attribute [r] host + # @return [::String] + # Output only. Host to which clients can send HTTPS traffic that will be + # received by the workstation. Authorized traffic will be received to the + # workstation as HTTP on port 80. To send traffic to a different port, + # clients may prefix the host with the destination port in the format + # `{port}-{host}`. + # @!attribute [rw] env + # @return [::Google::Protobuf::Map{::String => ::String}] + # Optional. Environment variables passed to the workstation container's + # entrypoint. + class Workstation + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class AnnotationsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class LabelsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class EnvEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Whether a workstation is running and ready to receive user requests. + module State + # Do not use. + STATE_UNSPECIFIED = 0 + + # The workstation is not yet ready to accept requests from users but will + # be soon. + STATE_STARTING = 1 + + # The workstation is ready to accept requests from users. + STATE_RUNNING = 2 + + # The workstation is being stopped. + STATE_STOPPING = 3 + + # The workstation is stopped and will not be able to receive requests until + # it is started. + STATE_STOPPED = 4 + end + end + + # Request message for GetWorkstationCluster. + # @!attribute [rw] name + # @return [::String] + # Required. Name of the requested resource. + class GetWorkstationClusterRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for ListWorkstationClusters. + # @!attribute [rw] parent + # @return [::String] + # Required. Parent resource name. + # @!attribute [rw] page_size + # @return [::Integer] + # Optional. Maximum number of items to return. + # @!attribute [rw] page_token + # @return [::String] + # Optional. next_page_token value returned from a previous List request, if + # any. + class ListWorkstationClustersRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for ListWorkstationClusters. + # @!attribute [rw] workstation_clusters + # @return [::Array<::Google::Cloud::Workstations::V1beta::WorkstationCluster>] + # The requested workstation clusters. + # @!attribute [rw] next_page_token + # @return [::String] + # Token to retrieve the next page of results, or empty if there are no more + # results in the list. + # @!attribute [rw] unreachable + # @return [::Array<::String>] + # Unreachable resources. + class ListWorkstationClustersResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Message for creating a CreateWorkstationCluster. + # @!attribute [rw] parent + # @return [::String] + # Required. Parent resource name. + # @!attribute [rw] workstation_cluster_id + # @return [::String] + # Required. ID to use for the workstation cluster. + # @!attribute [rw] workstation_cluster + # @return [::Google::Cloud::Workstations::V1beta::WorkstationCluster] + # Required. Workstation cluster to create. + # @!attribute [rw] validate_only + # @return [::Boolean] + # Optional. If set, validate the request and preview the review, but do not + # actually apply it. + class CreateWorkstationClusterRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for UpdateWorkstationCluster. + # @!attribute [rw] workstation_cluster + # @return [::Google::Cloud::Workstations::V1beta::WorkstationCluster] + # Required. Workstation cluster to update. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # Required. Mask that specifies which fields in the workstation cluster + # should be updated. + # @!attribute [rw] validate_only + # @return [::Boolean] + # Optional. If set, validate the request and preview the review, but do not + # actually apply it. + # @!attribute [rw] allow_missing + # @return [::Boolean] + # Optional. If set, and the workstation cluster is not found, a new + # workstation cluster will be created. In this situation, update_mask is + # ignored. + class UpdateWorkstationClusterRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Message for deleting a workstation cluster. + # @!attribute [rw] name + # @return [::String] + # Required. Name of the workstation cluster to delete. + # @!attribute [rw] validate_only + # @return [::Boolean] + # Optional. If set, validate the request and preview the review, but do not + # apply it. + # @!attribute [rw] etag + # @return [::String] + # Optional. If set, the request will be rejected if the latest version of the + # workstation cluster on the server does not have this ETag. + # @!attribute [rw] force + # @return [::Boolean] + # Optional. If set, any workstation configurations and workstations in the + # workstation cluster are also deleted. Otherwise, the request only + # works if the workstation cluster has no configurations or workstations. + class DeleteWorkstationClusterRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for GetWorkstationConfig. + # @!attribute [rw] name + # @return [::String] + # Required. Name of the requested resource. + class GetWorkstationConfigRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for ListWorkstationConfigs. + # @!attribute [rw] parent + # @return [::String] + # Required. Parent resource name. + # @!attribute [rw] page_size + # @return [::Integer] + # Optional. Maximum number of items to return. + # @!attribute [rw] page_token + # @return [::String] + # Optional. next_page_token value returned from a previous List request, if + # any. + class ListWorkstationConfigsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for ListWorkstationConfigs. + # @!attribute [rw] workstation_configs + # @return [::Array<::Google::Cloud::Workstations::V1beta::WorkstationConfig>] + # The requested configs. + # @!attribute [rw] next_page_token + # @return [::String] + # Token to retrieve the next page of results, or empty if there are no more + # results in the list. + # @!attribute [rw] unreachable + # @return [::Array<::String>] + # Unreachable resources. + class ListWorkstationConfigsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for ListUsableWorkstationConfigs. + # @!attribute [rw] parent + # @return [::String] + # Required. Parent resource name. + # @!attribute [rw] page_size + # @return [::Integer] + # Optional. Maximum number of items to return. + # @!attribute [rw] page_token + # @return [::String] + # Optional. next_page_token value returned from a previous List request, if + # any. + class ListUsableWorkstationConfigsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for ListUsableWorkstationConfigs. + # @!attribute [rw] workstation_configs + # @return [::Array<::Google::Cloud::Workstations::V1beta::WorkstationConfig>] + # The requested configs. + # @!attribute [rw] next_page_token + # @return [::String] + # Token to retrieve the next page of results, or empty if there are no more + # results in the list. + # @!attribute [rw] unreachable + # @return [::Array<::String>] + # Unreachable resources. + class ListUsableWorkstationConfigsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Message for creating a CreateWorkstationConfig. + # @!attribute [rw] parent + # @return [::String] + # Required. Parent resource name. + # @!attribute [rw] workstation_config_id + # @return [::String] + # Required. ID to use for the workstation configuration. + # @!attribute [rw] workstation_config + # @return [::Google::Cloud::Workstations::V1beta::WorkstationConfig] + # Required. Config to create. + # @!attribute [rw] validate_only + # @return [::Boolean] + # Optional. If set, validate the request and preview the review, but do not + # actually apply it. + class CreateWorkstationConfigRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for UpdateWorkstationConfig. + # @!attribute [rw] workstation_config + # @return [::Google::Cloud::Workstations::V1beta::WorkstationConfig] + # Required. Config to update. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # Required. Mask specifying which fields in the workstation configuration + # should be updated. + # @!attribute [rw] validate_only + # @return [::Boolean] + # Optional. If set, validate the request and preview the review, but do not + # actually apply it. + # @!attribute [rw] allow_missing + # @return [::Boolean] + # Optional. If set and the workstation configuration is not found, a new + # workstation configuration will be created. In this situation, + # update_mask is ignored. + class UpdateWorkstationConfigRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Message for deleting a workstation configuration. + # @!attribute [rw] name + # @return [::String] + # Required. Name of the workstation configuration to delete. + # @!attribute [rw] validate_only + # @return [::Boolean] + # Optional. If set, validate the request and preview the review, but do not + # actually apply it. + # @!attribute [rw] etag + # @return [::String] + # Optional. If set, the request is rejected if the latest version of the + # workstation configuration on the server does not have this ETag. + # @!attribute [rw] force + # @return [::Boolean] + # Optional. If set, any workstations in the workstation configuration are + # also deleted. Otherwise, the request works only if the workstation + # configuration has no workstations. + class DeleteWorkstationConfigRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for GetWorkstation. + # @!attribute [rw] name + # @return [::String] + # Required. Name of the requested resource. + class GetWorkstationRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for ListWorkstations. + # @!attribute [rw] parent + # @return [::String] + # Required. Parent resource name. + # @!attribute [rw] page_size + # @return [::Integer] + # Optional. Maximum number of items to return. + # @!attribute [rw] page_token + # @return [::String] + # Optional. next_page_token value returned from a previous List request, if + # any. + class ListWorkstationsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for ListWorkstations. + # @!attribute [rw] workstations + # @return [::Array<::Google::Cloud::Workstations::V1beta::Workstation>] + # The requested workstations. + # @!attribute [rw] next_page_token + # @return [::String] + # Optional. Token to retrieve the next page of results, or empty if there are + # no more results in the list. + # @!attribute [rw] unreachable + # @return [::Array<::String>] + # Optional. Unreachable resources. + class ListWorkstationsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for ListUsableWorkstations. + # @!attribute [rw] parent + # @return [::String] + # Required. Parent resource name. + # @!attribute [rw] page_size + # @return [::Integer] + # Optional. Maximum number of items to return. + # @!attribute [rw] page_token + # @return [::String] + # Optional. next_page_token value returned from a previous List request, if + # any. + class ListUsableWorkstationsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for ListUsableWorkstations. + # @!attribute [rw] workstations + # @return [::Array<::Google::Cloud::Workstations::V1beta::Workstation>] + # The requested workstations. + # @!attribute [rw] next_page_token + # @return [::String] + # Token to retrieve the next page of results, or empty if there are no more + # results in the list. + # @!attribute [rw] unreachable + # @return [::Array<::String>] + # Unreachable resources. + class ListUsableWorkstationsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Message for creating a CreateWorkstation. + # @!attribute [rw] parent + # @return [::String] + # Required. Parent resource name. + # @!attribute [rw] workstation_id + # @return [::String] + # Required. ID to use for the workstation. + # @!attribute [rw] workstation + # @return [::Google::Cloud::Workstations::V1beta::Workstation] + # Required. Workstation to create. + # @!attribute [rw] validate_only + # @return [::Boolean] + # Optional. If set, validate the request and preview the review, but do not + # actually apply it. + class CreateWorkstationRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for UpdateWorkstation. + # @!attribute [rw] workstation + # @return [::Google::Cloud::Workstations::V1beta::Workstation] + # Required. Workstation to update. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # Required. Mask specifying which fields in the workstation configuration + # should be updated. + # @!attribute [rw] validate_only + # @return [::Boolean] + # Optional. If set, validate the request and preview the review, but do not + # actually apply it. + # @!attribute [rw] allow_missing + # @return [::Boolean] + # Optional. If set and the workstation configuration is not found, a new + # workstation configuration is created. In this situation, update_mask + # is ignored. + class UpdateWorkstationRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for DeleteWorkstation. + # @!attribute [rw] name + # @return [::String] + # Required. Name of the workstation to delete. + # @!attribute [rw] validate_only + # @return [::Boolean] + # Optional. If set, validate the request and preview the review, but do not + # actually apply it. + # @!attribute [rw] etag + # @return [::String] + # Optional. If set, the request will be rejected if the latest version of the + # workstation on the server does not have this ETag. + class DeleteWorkstationRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for StartWorkstation. + # @!attribute [rw] name + # @return [::String] + # Required. Name of the workstation to start. + # @!attribute [rw] validate_only + # @return [::Boolean] + # Optional. If set, validate the request and preview the review, but do not + # actually apply it. + # @!attribute [rw] etag + # @return [::String] + # Optional. If set, the request will be rejected if the latest version of the + # workstation on the server does not have this ETag. + class StartWorkstationRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for StopWorkstation. + # @!attribute [rw] name + # @return [::String] + # Required. Name of the workstation to stop. + # @!attribute [rw] validate_only + # @return [::Boolean] + # Optional. If set, validate the request and preview the review, but do not + # actually apply it. + # @!attribute [rw] etag + # @return [::String] + # Optional. If set, the request will be rejected if the latest version of the + # workstation on the server does not have this ETag. + class StopWorkstationRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for GenerateAccessToken. + # @!attribute [rw] expire_time + # @return [::Google::Protobuf::Timestamp] + # Desired expiration time of the access token. This value must + # be at most 24 hours in the future. If a value is not specified, the + # token's expiration time will be set to a default value of 1 hour in the + # future. + # + # 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] + # Desired lifetime duration of the access token. This value must + # be at most 24 hours. If a value is not specified, the token's lifetime + # will be set to a default value of 1 hour. + # + # 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 [rw] workstation + # @return [::String] + # Required. Name of the workstation for which the access token should be + # generated. + class GenerateAccessTokenRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for GenerateAccessToken. + # @!attribute [rw] access_token + # @return [::String] + # The generated bearer access token. To use this token, include it in an + # Authorization header of an HTTP request sent to the associated + # workstation's hostname—for example, `Authorization: Bearer + # `. + # @!attribute [rw] expire_time + # @return [::Google::Protobuf::Timestamp] + # Time at which the generated token will expire. + class GenerateAccessTokenResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Metadata for long-running operations. + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Time that the operation was created. + # @!attribute [r] end_time + # @return [::Google::Protobuf::Timestamp] + # Output only. Time that the operation finished running. + # @!attribute [r] target + # @return [::String] + # Output only. Server-defined resource path for the target of the operation. + # @!attribute [r] verb + # @return [::String] + # Output only. Name of the verb executed by the operation. + # @!attribute [r] status_message + # @return [::String] + # Output only. Human-readable status of the operation, if any. + # @!attribute [r] requested_cancellation + # @return [::Boolean] + # Output only. Identifies whether the user has requested cancellation + # of the operation. + # @!attribute [r] api_version + # @return [::String] + # Output only. API version used to start the operation. + class OperationMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-cloud-workstations-v1beta/proto_docs/google/longrunning/operations.rb b/owl-bot-staging/google-cloud-workstations-v1beta/proto_docs/google/longrunning/operations.rb new file mode 100644 index 000000000000..7a757f512165 --- /dev/null +++ b/owl-bot-staging/google-cloud-workstations-v1beta/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-workstations-v1beta/proto_docs/google/protobuf/any.rb b/owl-bot-staging/google-cloud-workstations-v1beta/proto_docs/google/protobuf/any.rb new file mode 100644 index 000000000000..58691995f02e --- /dev/null +++ b/owl-bot-staging/google-cloud-workstations-v1beta/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-workstations-v1beta/proto_docs/google/protobuf/duration.rb b/owl-bot-staging/google-cloud-workstations-v1beta/proto_docs/google/protobuf/duration.rb new file mode 100644 index 000000000000..ea59f1f91daf --- /dev/null +++ b/owl-bot-staging/google-cloud-workstations-v1beta/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-workstations-v1beta/proto_docs/google/protobuf/empty.rb b/owl-bot-staging/google-cloud-workstations-v1beta/proto_docs/google/protobuf/empty.rb new file mode 100644 index 000000000000..83e4481834a6 --- /dev/null +++ b/owl-bot-staging/google-cloud-workstations-v1beta/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-workstations-v1beta/proto_docs/google/protobuf/field_mask.rb b/owl-bot-staging/google-cloud-workstations-v1beta/proto_docs/google/protobuf/field_mask.rb new file mode 100644 index 000000000000..7f3ffc78601a --- /dev/null +++ b/owl-bot-staging/google-cloud-workstations-v1beta/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-workstations-v1beta/proto_docs/google/protobuf/timestamp.rb b/owl-bot-staging/google-cloud-workstations-v1beta/proto_docs/google/protobuf/timestamp.rb new file mode 100644 index 000000000000..74352be9c58c --- /dev/null +++ b/owl-bot-staging/google-cloud-workstations-v1beta/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-workstations-v1beta/proto_docs/google/rpc/status.rb b/owl-bot-staging/google-cloud-workstations-v1beta/proto_docs/google/rpc/status.rb new file mode 100644 index 000000000000..c1a1c07eb2db --- /dev/null +++ b/owl-bot-staging/google-cloud-workstations-v1beta/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-workstations-v1beta/proto_docs/google/type/expr.rb b/owl-bot-staging/google-cloud-workstations-v1beta/proto_docs/google/type/expr.rb new file mode 100644 index 000000000000..53e7733b6592 --- /dev/null +++ b/owl-bot-staging/google-cloud-workstations-v1beta/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-workstations-v1beta/snippets/Gemfile b/owl-bot-staging/google-cloud-workstations-v1beta/snippets/Gemfile new file mode 100644 index 000000000000..7a19ba50a0c6 --- /dev/null +++ b/owl-bot-staging/google-cloud-workstations-v1beta/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-workstations-v1beta", path: "../" +else + gem "google-cloud-workstations-v1beta" +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-workstations-v1beta/snippets/snippet_metadata_google.cloud.workstations.v1beta.json b/owl-bot-staging/google-cloud-workstations-v1beta/snippets/snippet_metadata_google.cloud.workstations.v1beta.json new file mode 100644 index 000000000000..46f10e2bfde3 --- /dev/null +++ b/owl-bot-staging/google-cloud-workstations-v1beta/snippets/snippet_metadata_google.cloud.workstations.v1beta.json @@ -0,0 +1,815 @@ +{ + "client_library": { + "name": "google-cloud-workstations-v1beta", + "version": "", + "language": "RUBY", + "apis": [ + { + "id": "google.cloud.workstations.v1beta", + "version": "v1beta" + } + ] + }, + "snippets": [ + { + "region_tag": "workstations_v1beta_generated_Workstations_GetWorkstationCluster_sync", + "title": "Snippet for the get_workstation_cluster call in the Workstations service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Workstations::V1beta::Workstations::Client#get_workstation_cluster.", + "file": "workstations/get_workstation_cluster.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_workstation_cluster", + "full_name": "::Google::Cloud::Workstations::V1beta::Workstations::Client#get_workstation_cluster", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Workstations::V1beta::GetWorkstationClusterRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Workstations::V1beta::WorkstationCluster", + "client": { + "short_name": "Workstations::Client", + "full_name": "::Google::Cloud::Workstations::V1beta::Workstations::Client" + }, + "method": { + "short_name": "GetWorkstationCluster", + "full_name": "google.cloud.workstations.v1beta.Workstations.GetWorkstationCluster", + "service": { + "short_name": "Workstations", + "full_name": "google.cloud.workstations.v1beta.Workstations" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "workstations_v1beta_generated_Workstations_ListWorkstationClusters_sync", + "title": "Snippet for the list_workstation_clusters call in the Workstations service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Workstations::V1beta::Workstations::Client#list_workstation_clusters.", + "file": "workstations/list_workstation_clusters.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_workstation_clusters", + "full_name": "::Google::Cloud::Workstations::V1beta::Workstations::Client#list_workstation_clusters", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Workstations::V1beta::ListWorkstationClustersRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Workstations::V1beta::ListWorkstationClustersResponse", + "client": { + "short_name": "Workstations::Client", + "full_name": "::Google::Cloud::Workstations::V1beta::Workstations::Client" + }, + "method": { + "short_name": "ListWorkstationClusters", + "full_name": "google.cloud.workstations.v1beta.Workstations.ListWorkstationClusters", + "service": { + "short_name": "Workstations", + "full_name": "google.cloud.workstations.v1beta.Workstations" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "workstations_v1beta_generated_Workstations_CreateWorkstationCluster_sync", + "title": "Snippet for the create_workstation_cluster call in the Workstations service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Workstations::V1beta::Workstations::Client#create_workstation_cluster.", + "file": "workstations/create_workstation_cluster.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_workstation_cluster", + "full_name": "::Google::Cloud::Workstations::V1beta::Workstations::Client#create_workstation_cluster", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Workstations::V1beta::CreateWorkstationClusterRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "Workstations::Client", + "full_name": "::Google::Cloud::Workstations::V1beta::Workstations::Client" + }, + "method": { + "short_name": "CreateWorkstationCluster", + "full_name": "google.cloud.workstations.v1beta.Workstations.CreateWorkstationCluster", + "service": { + "short_name": "Workstations", + "full_name": "google.cloud.workstations.v1beta.Workstations" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "workstations_v1beta_generated_Workstations_UpdateWorkstationCluster_sync", + "title": "Snippet for the update_workstation_cluster call in the Workstations service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Workstations::V1beta::Workstations::Client#update_workstation_cluster.", + "file": "workstations/update_workstation_cluster.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_workstation_cluster", + "full_name": "::Google::Cloud::Workstations::V1beta::Workstations::Client#update_workstation_cluster", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Workstations::V1beta::UpdateWorkstationClusterRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "Workstations::Client", + "full_name": "::Google::Cloud::Workstations::V1beta::Workstations::Client" + }, + "method": { + "short_name": "UpdateWorkstationCluster", + "full_name": "google.cloud.workstations.v1beta.Workstations.UpdateWorkstationCluster", + "service": { + "short_name": "Workstations", + "full_name": "google.cloud.workstations.v1beta.Workstations" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "workstations_v1beta_generated_Workstations_DeleteWorkstationCluster_sync", + "title": "Snippet for the delete_workstation_cluster call in the Workstations service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Workstations::V1beta::Workstations::Client#delete_workstation_cluster.", + "file": "workstations/delete_workstation_cluster.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_workstation_cluster", + "full_name": "::Google::Cloud::Workstations::V1beta::Workstations::Client#delete_workstation_cluster", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Workstations::V1beta::DeleteWorkstationClusterRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "Workstations::Client", + "full_name": "::Google::Cloud::Workstations::V1beta::Workstations::Client" + }, + "method": { + "short_name": "DeleteWorkstationCluster", + "full_name": "google.cloud.workstations.v1beta.Workstations.DeleteWorkstationCluster", + "service": { + "short_name": "Workstations", + "full_name": "google.cloud.workstations.v1beta.Workstations" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "workstations_v1beta_generated_Workstations_GetWorkstationConfig_sync", + "title": "Snippet for the get_workstation_config call in the Workstations service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Workstations::V1beta::Workstations::Client#get_workstation_config.", + "file": "workstations/get_workstation_config.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_workstation_config", + "full_name": "::Google::Cloud::Workstations::V1beta::Workstations::Client#get_workstation_config", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Workstations::V1beta::GetWorkstationConfigRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Workstations::V1beta::WorkstationConfig", + "client": { + "short_name": "Workstations::Client", + "full_name": "::Google::Cloud::Workstations::V1beta::Workstations::Client" + }, + "method": { + "short_name": "GetWorkstationConfig", + "full_name": "google.cloud.workstations.v1beta.Workstations.GetWorkstationConfig", + "service": { + "short_name": "Workstations", + "full_name": "google.cloud.workstations.v1beta.Workstations" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "workstations_v1beta_generated_Workstations_ListWorkstationConfigs_sync", + "title": "Snippet for the list_workstation_configs call in the Workstations service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Workstations::V1beta::Workstations::Client#list_workstation_configs.", + "file": "workstations/list_workstation_configs.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_workstation_configs", + "full_name": "::Google::Cloud::Workstations::V1beta::Workstations::Client#list_workstation_configs", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Workstations::V1beta::ListWorkstationConfigsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Workstations::V1beta::ListWorkstationConfigsResponse", + "client": { + "short_name": "Workstations::Client", + "full_name": "::Google::Cloud::Workstations::V1beta::Workstations::Client" + }, + "method": { + "short_name": "ListWorkstationConfigs", + "full_name": "google.cloud.workstations.v1beta.Workstations.ListWorkstationConfigs", + "service": { + "short_name": "Workstations", + "full_name": "google.cloud.workstations.v1beta.Workstations" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "workstations_v1beta_generated_Workstations_ListUsableWorkstationConfigs_sync", + "title": "Snippet for the list_usable_workstation_configs call in the Workstations service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Workstations::V1beta::Workstations::Client#list_usable_workstation_configs.", + "file": "workstations/list_usable_workstation_configs.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_usable_workstation_configs", + "full_name": "::Google::Cloud::Workstations::V1beta::Workstations::Client#list_usable_workstation_configs", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Workstations::V1beta::ListUsableWorkstationConfigsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Workstations::V1beta::ListUsableWorkstationConfigsResponse", + "client": { + "short_name": "Workstations::Client", + "full_name": "::Google::Cloud::Workstations::V1beta::Workstations::Client" + }, + "method": { + "short_name": "ListUsableWorkstationConfigs", + "full_name": "google.cloud.workstations.v1beta.Workstations.ListUsableWorkstationConfigs", + "service": { + "short_name": "Workstations", + "full_name": "google.cloud.workstations.v1beta.Workstations" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "workstations_v1beta_generated_Workstations_CreateWorkstationConfig_sync", + "title": "Snippet for the create_workstation_config call in the Workstations service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Workstations::V1beta::Workstations::Client#create_workstation_config.", + "file": "workstations/create_workstation_config.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_workstation_config", + "full_name": "::Google::Cloud::Workstations::V1beta::Workstations::Client#create_workstation_config", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Workstations::V1beta::CreateWorkstationConfigRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "Workstations::Client", + "full_name": "::Google::Cloud::Workstations::V1beta::Workstations::Client" + }, + "method": { + "short_name": "CreateWorkstationConfig", + "full_name": "google.cloud.workstations.v1beta.Workstations.CreateWorkstationConfig", + "service": { + "short_name": "Workstations", + "full_name": "google.cloud.workstations.v1beta.Workstations" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "workstations_v1beta_generated_Workstations_UpdateWorkstationConfig_sync", + "title": "Snippet for the update_workstation_config call in the Workstations service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Workstations::V1beta::Workstations::Client#update_workstation_config.", + "file": "workstations/update_workstation_config.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_workstation_config", + "full_name": "::Google::Cloud::Workstations::V1beta::Workstations::Client#update_workstation_config", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Workstations::V1beta::UpdateWorkstationConfigRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "Workstations::Client", + "full_name": "::Google::Cloud::Workstations::V1beta::Workstations::Client" + }, + "method": { + "short_name": "UpdateWorkstationConfig", + "full_name": "google.cloud.workstations.v1beta.Workstations.UpdateWorkstationConfig", + "service": { + "short_name": "Workstations", + "full_name": "google.cloud.workstations.v1beta.Workstations" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "workstations_v1beta_generated_Workstations_DeleteWorkstationConfig_sync", + "title": "Snippet for the delete_workstation_config call in the Workstations service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Workstations::V1beta::Workstations::Client#delete_workstation_config.", + "file": "workstations/delete_workstation_config.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_workstation_config", + "full_name": "::Google::Cloud::Workstations::V1beta::Workstations::Client#delete_workstation_config", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Workstations::V1beta::DeleteWorkstationConfigRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "Workstations::Client", + "full_name": "::Google::Cloud::Workstations::V1beta::Workstations::Client" + }, + "method": { + "short_name": "DeleteWorkstationConfig", + "full_name": "google.cloud.workstations.v1beta.Workstations.DeleteWorkstationConfig", + "service": { + "short_name": "Workstations", + "full_name": "google.cloud.workstations.v1beta.Workstations" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "workstations_v1beta_generated_Workstations_GetWorkstation_sync", + "title": "Snippet for the get_workstation call in the Workstations service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Workstations::V1beta::Workstations::Client#get_workstation.", + "file": "workstations/get_workstation.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_workstation", + "full_name": "::Google::Cloud::Workstations::V1beta::Workstations::Client#get_workstation", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Workstations::V1beta::GetWorkstationRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Workstations::V1beta::Workstation", + "client": { + "short_name": "Workstations::Client", + "full_name": "::Google::Cloud::Workstations::V1beta::Workstations::Client" + }, + "method": { + "short_name": "GetWorkstation", + "full_name": "google.cloud.workstations.v1beta.Workstations.GetWorkstation", + "service": { + "short_name": "Workstations", + "full_name": "google.cloud.workstations.v1beta.Workstations" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "workstations_v1beta_generated_Workstations_ListWorkstations_sync", + "title": "Snippet for the list_workstations call in the Workstations service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Workstations::V1beta::Workstations::Client#list_workstations.", + "file": "workstations/list_workstations.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_workstations", + "full_name": "::Google::Cloud::Workstations::V1beta::Workstations::Client#list_workstations", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Workstations::V1beta::ListWorkstationsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Workstations::V1beta::ListWorkstationsResponse", + "client": { + "short_name": "Workstations::Client", + "full_name": "::Google::Cloud::Workstations::V1beta::Workstations::Client" + }, + "method": { + "short_name": "ListWorkstations", + "full_name": "google.cloud.workstations.v1beta.Workstations.ListWorkstations", + "service": { + "short_name": "Workstations", + "full_name": "google.cloud.workstations.v1beta.Workstations" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "workstations_v1beta_generated_Workstations_ListUsableWorkstations_sync", + "title": "Snippet for the list_usable_workstations call in the Workstations service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Workstations::V1beta::Workstations::Client#list_usable_workstations.", + "file": "workstations/list_usable_workstations.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_usable_workstations", + "full_name": "::Google::Cloud::Workstations::V1beta::Workstations::Client#list_usable_workstations", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Workstations::V1beta::ListUsableWorkstationsRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Workstations::V1beta::ListUsableWorkstationsResponse", + "client": { + "short_name": "Workstations::Client", + "full_name": "::Google::Cloud::Workstations::V1beta::Workstations::Client" + }, + "method": { + "short_name": "ListUsableWorkstations", + "full_name": "google.cloud.workstations.v1beta.Workstations.ListUsableWorkstations", + "service": { + "short_name": "Workstations", + "full_name": "google.cloud.workstations.v1beta.Workstations" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "workstations_v1beta_generated_Workstations_CreateWorkstation_sync", + "title": "Snippet for the create_workstation call in the Workstations service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Workstations::V1beta::Workstations::Client#create_workstation.", + "file": "workstations/create_workstation.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_workstation", + "full_name": "::Google::Cloud::Workstations::V1beta::Workstations::Client#create_workstation", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Workstations::V1beta::CreateWorkstationRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "Workstations::Client", + "full_name": "::Google::Cloud::Workstations::V1beta::Workstations::Client" + }, + "method": { + "short_name": "CreateWorkstation", + "full_name": "google.cloud.workstations.v1beta.Workstations.CreateWorkstation", + "service": { + "short_name": "Workstations", + "full_name": "google.cloud.workstations.v1beta.Workstations" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "workstations_v1beta_generated_Workstations_UpdateWorkstation_sync", + "title": "Snippet for the update_workstation call in the Workstations service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Workstations::V1beta::Workstations::Client#update_workstation.", + "file": "workstations/update_workstation.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_workstation", + "full_name": "::Google::Cloud::Workstations::V1beta::Workstations::Client#update_workstation", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Workstations::V1beta::UpdateWorkstationRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "Workstations::Client", + "full_name": "::Google::Cloud::Workstations::V1beta::Workstations::Client" + }, + "method": { + "short_name": "UpdateWorkstation", + "full_name": "google.cloud.workstations.v1beta.Workstations.UpdateWorkstation", + "service": { + "short_name": "Workstations", + "full_name": "google.cloud.workstations.v1beta.Workstations" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "workstations_v1beta_generated_Workstations_DeleteWorkstation_sync", + "title": "Snippet for the delete_workstation call in the Workstations service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Workstations::V1beta::Workstations::Client#delete_workstation.", + "file": "workstations/delete_workstation.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_workstation", + "full_name": "::Google::Cloud::Workstations::V1beta::Workstations::Client#delete_workstation", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Workstations::V1beta::DeleteWorkstationRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "Workstations::Client", + "full_name": "::Google::Cloud::Workstations::V1beta::Workstations::Client" + }, + "method": { + "short_name": "DeleteWorkstation", + "full_name": "google.cloud.workstations.v1beta.Workstations.DeleteWorkstation", + "service": { + "short_name": "Workstations", + "full_name": "google.cloud.workstations.v1beta.Workstations" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "workstations_v1beta_generated_Workstations_StartWorkstation_sync", + "title": "Snippet for the start_workstation call in the Workstations service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Workstations::V1beta::Workstations::Client#start_workstation.", + "file": "workstations/start_workstation.rb", + "language": "RUBY", + "client_method": { + "short_name": "start_workstation", + "full_name": "::Google::Cloud::Workstations::V1beta::Workstations::Client#start_workstation", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Workstations::V1beta::StartWorkstationRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "Workstations::Client", + "full_name": "::Google::Cloud::Workstations::V1beta::Workstations::Client" + }, + "method": { + "short_name": "StartWorkstation", + "full_name": "google.cloud.workstations.v1beta.Workstations.StartWorkstation", + "service": { + "short_name": "Workstations", + "full_name": "google.cloud.workstations.v1beta.Workstations" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "workstations_v1beta_generated_Workstations_StopWorkstation_sync", + "title": "Snippet for the stop_workstation call in the Workstations service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Workstations::V1beta::Workstations::Client#stop_workstation.", + "file": "workstations/stop_workstation.rb", + "language": "RUBY", + "client_method": { + "short_name": "stop_workstation", + "full_name": "::Google::Cloud::Workstations::V1beta::Workstations::Client#stop_workstation", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Workstations::V1beta::StopWorkstationRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "Workstations::Client", + "full_name": "::Google::Cloud::Workstations::V1beta::Workstations::Client" + }, + "method": { + "short_name": "StopWorkstation", + "full_name": "google.cloud.workstations.v1beta.Workstations.StopWorkstation", + "service": { + "short_name": "Workstations", + "full_name": "google.cloud.workstations.v1beta.Workstations" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "workstations_v1beta_generated_Workstations_GenerateAccessToken_sync", + "title": "Snippet for the generate_access_token call in the Workstations service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Workstations::V1beta::Workstations::Client#generate_access_token.", + "file": "workstations/generate_access_token.rb", + "language": "RUBY", + "client_method": { + "short_name": "generate_access_token", + "full_name": "::Google::Cloud::Workstations::V1beta::Workstations::Client#generate_access_token", + "async": false, + "parameters": [ + { + "type": "::Google::Cloud::Workstations::V1beta::GenerateAccessTokenRequest", + "name": "request" + } + ], + "result_type": "::Google::Cloud::Workstations::V1beta::GenerateAccessTokenResponse", + "client": { + "short_name": "Workstations::Client", + "full_name": "::Google::Cloud::Workstations::V1beta::Workstations::Client" + }, + "method": { + "short_name": "GenerateAccessToken", + "full_name": "google.cloud.workstations.v1beta.Workstations.GenerateAccessToken", + "service": { + "short_name": "Workstations", + "full_name": "google.cloud.workstations.v1beta.Workstations" + } + } + }, + "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-workstations-v1beta/snippets/workstations/create_workstation.rb b/owl-bot-staging/google-cloud-workstations-v1beta/snippets/workstations/create_workstation.rb new file mode 100644 index 000000000000..d693d2b46ae5 --- /dev/null +++ b/owl-bot-staging/google-cloud-workstations-v1beta/snippets/workstations/create_workstation.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 workstations_v1beta_generated_Workstations_CreateWorkstation_sync] +require "google/cloud/workstations/v1beta" + +## +# Snippet for the create_workstation call in the Workstations 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::Workstations::V1beta::Workstations::Client#create_workstation. +# +def create_workstation + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Workstations::V1beta::Workstations::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Workstations::V1beta::CreateWorkstationRequest.new + + # Call the create_workstation method. + result = client.create_workstation 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 workstations_v1beta_generated_Workstations_CreateWorkstation_sync] diff --git a/owl-bot-staging/google-cloud-workstations-v1beta/snippets/workstations/create_workstation_cluster.rb b/owl-bot-staging/google-cloud-workstations-v1beta/snippets/workstations/create_workstation_cluster.rb new file mode 100644 index 000000000000..87128b5c9ea7 --- /dev/null +++ b/owl-bot-staging/google-cloud-workstations-v1beta/snippets/workstations/create_workstation_cluster.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 workstations_v1beta_generated_Workstations_CreateWorkstationCluster_sync] +require "google/cloud/workstations/v1beta" + +## +# Snippet for the create_workstation_cluster call in the Workstations 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::Workstations::V1beta::Workstations::Client#create_workstation_cluster. +# +def create_workstation_cluster + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Workstations::V1beta::Workstations::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Workstations::V1beta::CreateWorkstationClusterRequest.new + + # Call the create_workstation_cluster method. + result = client.create_workstation_cluster 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 workstations_v1beta_generated_Workstations_CreateWorkstationCluster_sync] diff --git a/owl-bot-staging/google-cloud-workstations-v1beta/snippets/workstations/create_workstation_config.rb b/owl-bot-staging/google-cloud-workstations-v1beta/snippets/workstations/create_workstation_config.rb new file mode 100644 index 000000000000..f2b1d8cd72ce --- /dev/null +++ b/owl-bot-staging/google-cloud-workstations-v1beta/snippets/workstations/create_workstation_config.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 workstations_v1beta_generated_Workstations_CreateWorkstationConfig_sync] +require "google/cloud/workstations/v1beta" + +## +# Snippet for the create_workstation_config call in the Workstations 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::Workstations::V1beta::Workstations::Client#create_workstation_config. +# +def create_workstation_config + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Workstations::V1beta::Workstations::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Workstations::V1beta::CreateWorkstationConfigRequest.new + + # Call the create_workstation_config method. + result = client.create_workstation_config 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 workstations_v1beta_generated_Workstations_CreateWorkstationConfig_sync] diff --git a/owl-bot-staging/google-cloud-workstations-v1beta/snippets/workstations/delete_workstation.rb b/owl-bot-staging/google-cloud-workstations-v1beta/snippets/workstations/delete_workstation.rb new file mode 100644 index 000000000000..5077d7921393 --- /dev/null +++ b/owl-bot-staging/google-cloud-workstations-v1beta/snippets/workstations/delete_workstation.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 workstations_v1beta_generated_Workstations_DeleteWorkstation_sync] +require "google/cloud/workstations/v1beta" + +## +# Snippet for the delete_workstation call in the Workstations 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::Workstations::V1beta::Workstations::Client#delete_workstation. +# +def delete_workstation + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Workstations::V1beta::Workstations::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Workstations::V1beta::DeleteWorkstationRequest.new + + # Call the delete_workstation method. + result = client.delete_workstation 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 workstations_v1beta_generated_Workstations_DeleteWorkstation_sync] diff --git a/owl-bot-staging/google-cloud-workstations-v1beta/snippets/workstations/delete_workstation_cluster.rb b/owl-bot-staging/google-cloud-workstations-v1beta/snippets/workstations/delete_workstation_cluster.rb new file mode 100644 index 000000000000..102ab70aae42 --- /dev/null +++ b/owl-bot-staging/google-cloud-workstations-v1beta/snippets/workstations/delete_workstation_cluster.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 workstations_v1beta_generated_Workstations_DeleteWorkstationCluster_sync] +require "google/cloud/workstations/v1beta" + +## +# Snippet for the delete_workstation_cluster call in the Workstations 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::Workstations::V1beta::Workstations::Client#delete_workstation_cluster. +# +def delete_workstation_cluster + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Workstations::V1beta::Workstations::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Workstations::V1beta::DeleteWorkstationClusterRequest.new + + # Call the delete_workstation_cluster method. + result = client.delete_workstation_cluster 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 workstations_v1beta_generated_Workstations_DeleteWorkstationCluster_sync] diff --git a/owl-bot-staging/google-cloud-workstations-v1beta/snippets/workstations/delete_workstation_config.rb b/owl-bot-staging/google-cloud-workstations-v1beta/snippets/workstations/delete_workstation_config.rb new file mode 100644 index 000000000000..9ad29224664b --- /dev/null +++ b/owl-bot-staging/google-cloud-workstations-v1beta/snippets/workstations/delete_workstation_config.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 workstations_v1beta_generated_Workstations_DeleteWorkstationConfig_sync] +require "google/cloud/workstations/v1beta" + +## +# Snippet for the delete_workstation_config call in the Workstations 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::Workstations::V1beta::Workstations::Client#delete_workstation_config. +# +def delete_workstation_config + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Workstations::V1beta::Workstations::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Workstations::V1beta::DeleteWorkstationConfigRequest.new + + # Call the delete_workstation_config method. + result = client.delete_workstation_config 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 workstations_v1beta_generated_Workstations_DeleteWorkstationConfig_sync] diff --git a/owl-bot-staging/google-cloud-workstations-v1beta/snippets/workstations/generate_access_token.rb b/owl-bot-staging/google-cloud-workstations-v1beta/snippets/workstations/generate_access_token.rb new file mode 100644 index 000000000000..c810256cd2e2 --- /dev/null +++ b/owl-bot-staging/google-cloud-workstations-v1beta/snippets/workstations/generate_access_token.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 workstations_v1beta_generated_Workstations_GenerateAccessToken_sync] +require "google/cloud/workstations/v1beta" + +## +# Snippet for the generate_access_token call in the Workstations 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::Workstations::V1beta::Workstations::Client#generate_access_token. +# +def generate_access_token + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Workstations::V1beta::Workstations::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Workstations::V1beta::GenerateAccessTokenRequest.new + + # Call the generate_access_token method. + result = client.generate_access_token request + + # The returned object is of type Google::Cloud::Workstations::V1beta::GenerateAccessTokenResponse. + p result +end +# [END workstations_v1beta_generated_Workstations_GenerateAccessToken_sync] diff --git a/owl-bot-staging/google-cloud-workstations-v1beta/snippets/workstations/get_workstation.rb b/owl-bot-staging/google-cloud-workstations-v1beta/snippets/workstations/get_workstation.rb new file mode 100644 index 000000000000..ed645c9c161d --- /dev/null +++ b/owl-bot-staging/google-cloud-workstations-v1beta/snippets/workstations/get_workstation.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 workstations_v1beta_generated_Workstations_GetWorkstation_sync] +require "google/cloud/workstations/v1beta" + +## +# Snippet for the get_workstation call in the Workstations 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::Workstations::V1beta::Workstations::Client#get_workstation. +# +def get_workstation + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Workstations::V1beta::Workstations::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Workstations::V1beta::GetWorkstationRequest.new + + # Call the get_workstation method. + result = client.get_workstation request + + # The returned object is of type Google::Cloud::Workstations::V1beta::Workstation. + p result +end +# [END workstations_v1beta_generated_Workstations_GetWorkstation_sync] diff --git a/owl-bot-staging/google-cloud-workstations-v1beta/snippets/workstations/get_workstation_cluster.rb b/owl-bot-staging/google-cloud-workstations-v1beta/snippets/workstations/get_workstation_cluster.rb new file mode 100644 index 000000000000..665a6a0fe884 --- /dev/null +++ b/owl-bot-staging/google-cloud-workstations-v1beta/snippets/workstations/get_workstation_cluster.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 workstations_v1beta_generated_Workstations_GetWorkstationCluster_sync] +require "google/cloud/workstations/v1beta" + +## +# Snippet for the get_workstation_cluster call in the Workstations 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::Workstations::V1beta::Workstations::Client#get_workstation_cluster. +# +def get_workstation_cluster + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Workstations::V1beta::Workstations::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Workstations::V1beta::GetWorkstationClusterRequest.new + + # Call the get_workstation_cluster method. + result = client.get_workstation_cluster request + + # The returned object is of type Google::Cloud::Workstations::V1beta::WorkstationCluster. + p result +end +# [END workstations_v1beta_generated_Workstations_GetWorkstationCluster_sync] diff --git a/owl-bot-staging/google-cloud-workstations-v1beta/snippets/workstations/get_workstation_config.rb b/owl-bot-staging/google-cloud-workstations-v1beta/snippets/workstations/get_workstation_config.rb new file mode 100644 index 000000000000..df2764fba5d2 --- /dev/null +++ b/owl-bot-staging/google-cloud-workstations-v1beta/snippets/workstations/get_workstation_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 workstations_v1beta_generated_Workstations_GetWorkstationConfig_sync] +require "google/cloud/workstations/v1beta" + +## +# Snippet for the get_workstation_config call in the Workstations 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::Workstations::V1beta::Workstations::Client#get_workstation_config. +# +def get_workstation_config + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Workstations::V1beta::Workstations::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Workstations::V1beta::GetWorkstationConfigRequest.new + + # Call the get_workstation_config method. + result = client.get_workstation_config request + + # The returned object is of type Google::Cloud::Workstations::V1beta::WorkstationConfig. + p result +end +# [END workstations_v1beta_generated_Workstations_GetWorkstationConfig_sync] diff --git a/owl-bot-staging/google-cloud-workstations-v1beta/snippets/workstations/list_usable_workstation_configs.rb b/owl-bot-staging/google-cloud-workstations-v1beta/snippets/workstations/list_usable_workstation_configs.rb new file mode 100644 index 000000000000..04c759f7d070 --- /dev/null +++ b/owl-bot-staging/google-cloud-workstations-v1beta/snippets/workstations/list_usable_workstation_configs.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 workstations_v1beta_generated_Workstations_ListUsableWorkstationConfigs_sync] +require "google/cloud/workstations/v1beta" + +## +# Snippet for the list_usable_workstation_configs call in the Workstations 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::Workstations::V1beta::Workstations::Client#list_usable_workstation_configs. +# +def list_usable_workstation_configs + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Workstations::V1beta::Workstations::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Workstations::V1beta::ListUsableWorkstationConfigsRequest.new + + # Call the list_usable_workstation_configs method. + result = client.list_usable_workstation_configs 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::Workstations::V1beta::WorkstationConfig. + p item + end +end +# [END workstations_v1beta_generated_Workstations_ListUsableWorkstationConfigs_sync] diff --git a/owl-bot-staging/google-cloud-workstations-v1beta/snippets/workstations/list_usable_workstations.rb b/owl-bot-staging/google-cloud-workstations-v1beta/snippets/workstations/list_usable_workstations.rb new file mode 100644 index 000000000000..ac98db348987 --- /dev/null +++ b/owl-bot-staging/google-cloud-workstations-v1beta/snippets/workstations/list_usable_workstations.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 workstations_v1beta_generated_Workstations_ListUsableWorkstations_sync] +require "google/cloud/workstations/v1beta" + +## +# Snippet for the list_usable_workstations call in the Workstations 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::Workstations::V1beta::Workstations::Client#list_usable_workstations. +# +def list_usable_workstations + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Workstations::V1beta::Workstations::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Workstations::V1beta::ListUsableWorkstationsRequest.new + + # Call the list_usable_workstations method. + result = client.list_usable_workstations 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::Workstations::V1beta::Workstation. + p item + end +end +# [END workstations_v1beta_generated_Workstations_ListUsableWorkstations_sync] diff --git a/owl-bot-staging/google-cloud-workstations-v1beta/snippets/workstations/list_workstation_clusters.rb b/owl-bot-staging/google-cloud-workstations-v1beta/snippets/workstations/list_workstation_clusters.rb new file mode 100644 index 000000000000..339e219b560c --- /dev/null +++ b/owl-bot-staging/google-cloud-workstations-v1beta/snippets/workstations/list_workstation_clusters.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 workstations_v1beta_generated_Workstations_ListWorkstationClusters_sync] +require "google/cloud/workstations/v1beta" + +## +# Snippet for the list_workstation_clusters call in the Workstations 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::Workstations::V1beta::Workstations::Client#list_workstation_clusters. +# +def list_workstation_clusters + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Workstations::V1beta::Workstations::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Workstations::V1beta::ListWorkstationClustersRequest.new + + # Call the list_workstation_clusters method. + result = client.list_workstation_clusters 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::Workstations::V1beta::WorkstationCluster. + p item + end +end +# [END workstations_v1beta_generated_Workstations_ListWorkstationClusters_sync] diff --git a/owl-bot-staging/google-cloud-workstations-v1beta/snippets/workstations/list_workstation_configs.rb b/owl-bot-staging/google-cloud-workstations-v1beta/snippets/workstations/list_workstation_configs.rb new file mode 100644 index 000000000000..e048457320f7 --- /dev/null +++ b/owl-bot-staging/google-cloud-workstations-v1beta/snippets/workstations/list_workstation_configs.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 workstations_v1beta_generated_Workstations_ListWorkstationConfigs_sync] +require "google/cloud/workstations/v1beta" + +## +# Snippet for the list_workstation_configs call in the Workstations 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::Workstations::V1beta::Workstations::Client#list_workstation_configs. +# +def list_workstation_configs + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Workstations::V1beta::Workstations::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Workstations::V1beta::ListWorkstationConfigsRequest.new + + # Call the list_workstation_configs method. + result = client.list_workstation_configs 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::Workstations::V1beta::WorkstationConfig. + p item + end +end +# [END workstations_v1beta_generated_Workstations_ListWorkstationConfigs_sync] diff --git a/owl-bot-staging/google-cloud-workstations-v1beta/snippets/workstations/list_workstations.rb b/owl-bot-staging/google-cloud-workstations-v1beta/snippets/workstations/list_workstations.rb new file mode 100644 index 000000000000..cdea490fd7b3 --- /dev/null +++ b/owl-bot-staging/google-cloud-workstations-v1beta/snippets/workstations/list_workstations.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 workstations_v1beta_generated_Workstations_ListWorkstations_sync] +require "google/cloud/workstations/v1beta" + +## +# Snippet for the list_workstations call in the Workstations 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::Workstations::V1beta::Workstations::Client#list_workstations. +# +def list_workstations + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Workstations::V1beta::Workstations::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Workstations::V1beta::ListWorkstationsRequest.new + + # Call the list_workstations method. + result = client.list_workstations 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::Workstations::V1beta::Workstation. + p item + end +end +# [END workstations_v1beta_generated_Workstations_ListWorkstations_sync] diff --git a/owl-bot-staging/google-cloud-workstations-v1beta/snippets/workstations/start_workstation.rb b/owl-bot-staging/google-cloud-workstations-v1beta/snippets/workstations/start_workstation.rb new file mode 100644 index 000000000000..4d0f92d6a22b --- /dev/null +++ b/owl-bot-staging/google-cloud-workstations-v1beta/snippets/workstations/start_workstation.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 workstations_v1beta_generated_Workstations_StartWorkstation_sync] +require "google/cloud/workstations/v1beta" + +## +# Snippet for the start_workstation call in the Workstations 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::Workstations::V1beta::Workstations::Client#start_workstation. +# +def start_workstation + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Workstations::V1beta::Workstations::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Workstations::V1beta::StartWorkstationRequest.new + + # Call the start_workstation method. + result = client.start_workstation 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 workstations_v1beta_generated_Workstations_StartWorkstation_sync] diff --git a/owl-bot-staging/google-cloud-workstations-v1beta/snippets/workstations/stop_workstation.rb b/owl-bot-staging/google-cloud-workstations-v1beta/snippets/workstations/stop_workstation.rb new file mode 100644 index 000000000000..81426cbc8008 --- /dev/null +++ b/owl-bot-staging/google-cloud-workstations-v1beta/snippets/workstations/stop_workstation.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 workstations_v1beta_generated_Workstations_StopWorkstation_sync] +require "google/cloud/workstations/v1beta" + +## +# Snippet for the stop_workstation call in the Workstations 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::Workstations::V1beta::Workstations::Client#stop_workstation. +# +def stop_workstation + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Workstations::V1beta::Workstations::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Workstations::V1beta::StopWorkstationRequest.new + + # Call the stop_workstation method. + result = client.stop_workstation 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 workstations_v1beta_generated_Workstations_StopWorkstation_sync] diff --git a/owl-bot-staging/google-cloud-workstations-v1beta/snippets/workstations/update_workstation.rb b/owl-bot-staging/google-cloud-workstations-v1beta/snippets/workstations/update_workstation.rb new file mode 100644 index 000000000000..5f5722b2f007 --- /dev/null +++ b/owl-bot-staging/google-cloud-workstations-v1beta/snippets/workstations/update_workstation.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 workstations_v1beta_generated_Workstations_UpdateWorkstation_sync] +require "google/cloud/workstations/v1beta" + +## +# Snippet for the update_workstation call in the Workstations 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::Workstations::V1beta::Workstations::Client#update_workstation. +# +def update_workstation + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Workstations::V1beta::Workstations::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Workstations::V1beta::UpdateWorkstationRequest.new + + # Call the update_workstation method. + result = client.update_workstation 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 workstations_v1beta_generated_Workstations_UpdateWorkstation_sync] diff --git a/owl-bot-staging/google-cloud-workstations-v1beta/snippets/workstations/update_workstation_cluster.rb b/owl-bot-staging/google-cloud-workstations-v1beta/snippets/workstations/update_workstation_cluster.rb new file mode 100644 index 000000000000..9890ea125115 --- /dev/null +++ b/owl-bot-staging/google-cloud-workstations-v1beta/snippets/workstations/update_workstation_cluster.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 workstations_v1beta_generated_Workstations_UpdateWorkstationCluster_sync] +require "google/cloud/workstations/v1beta" + +## +# Snippet for the update_workstation_cluster call in the Workstations 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::Workstations::V1beta::Workstations::Client#update_workstation_cluster. +# +def update_workstation_cluster + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Workstations::V1beta::Workstations::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Workstations::V1beta::UpdateWorkstationClusterRequest.new + + # Call the update_workstation_cluster method. + result = client.update_workstation_cluster 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 workstations_v1beta_generated_Workstations_UpdateWorkstationCluster_sync] diff --git a/owl-bot-staging/google-cloud-workstations-v1beta/snippets/workstations/update_workstation_config.rb b/owl-bot-staging/google-cloud-workstations-v1beta/snippets/workstations/update_workstation_config.rb new file mode 100644 index 000000000000..659a518628ac --- /dev/null +++ b/owl-bot-staging/google-cloud-workstations-v1beta/snippets/workstations/update_workstation_config.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 workstations_v1beta_generated_Workstations_UpdateWorkstationConfig_sync] +require "google/cloud/workstations/v1beta" + +## +# Snippet for the update_workstation_config call in the Workstations 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::Workstations::V1beta::Workstations::Client#update_workstation_config. +# +def update_workstation_config + # Create a client object. The client can be reused for multiple calls. + client = Google::Cloud::Workstations::V1beta::Workstations::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Cloud::Workstations::V1beta::UpdateWorkstationConfigRequest.new + + # Call the update_workstation_config method. + result = client.update_workstation_config 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 workstations_v1beta_generated_Workstations_UpdateWorkstationConfig_sync] diff --git a/owl-bot-staging/google-cloud-workstations-v1beta/test/google/cloud/workstations/v1beta/workstations_operations_test.rb b/owl-bot-staging/google-cloud-workstations-v1beta/test/google/cloud/workstations/v1beta/workstations_operations_test.rb new file mode 100644 index 000000000000..15f8d121ef95 --- /dev/null +++ b/owl-bot-staging/google-cloud-workstations-v1beta/test/google/cloud/workstations/v1beta/workstations_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/workstations/v1beta/workstations_pb" +require "google/cloud/workstations/v1beta/workstations_services_pb" +require "google/cloud/workstations/v1beta/workstations" + +class ::Google::Cloud::Workstations::V1beta::Workstations::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::Workstations::V1beta::Workstations::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::Workstations::V1beta::Workstations::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::Workstations::V1beta::Workstations::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::Workstations::V1beta::Workstations::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::Workstations::V1beta::Workstations::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::Workstations::V1beta::Workstations::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::Workstations::V1beta::Workstations::Operations::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-workstations-v1beta/test/google/cloud/workstations/v1beta/workstations_paths_test.rb b/owl-bot-staging/google-cloud-workstations-v1beta/test/google/cloud/workstations/v1beta/workstations_paths_test.rb new file mode 100644 index 000000000000..b909911491fb --- /dev/null +++ b/owl-bot-staging/google-cloud-workstations-v1beta/test/google/cloud/workstations/v1beta/workstations_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/workstations/v1beta/workstations" + +class ::Google::Cloud::Workstations::V1beta::Workstations::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::Workstations::V1beta::Workstations::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_workstation_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Workstations::V1beta::Workstations::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.workstation_path project: "value0", location: "value1", workstation_cluster: "value2", workstation_config: "value3", workstation: "value4" + assert_equal "projects/value0/locations/value1/workstationClusters/value2/workstationConfigs/value3/workstations/value4", path + end + end + + def test_workstation_cluster_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Cloud::Workstations::V1beta::Workstations::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.workstation_cluster_path project: "value0", location: "value1", workstation_cluster: "value2" + assert_equal "projects/value0/locations/value1/workstationClusters/value2", path + end + end + + def test_workstation_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::Workstations::V1beta::Workstations::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.workstation_config_path project: "value0", location: "value1", workstation_cluster: "value2", workstation_config: "value3" + assert_equal "projects/value0/locations/value1/workstationClusters/value2/workstationConfigs/value3", path + end + end +end diff --git a/owl-bot-staging/google-cloud-workstations-v1beta/test/google/cloud/workstations/v1beta/workstations_rest_test.rb b/owl-bot-staging/google-cloud-workstations-v1beta/test/google/cloud/workstations/v1beta/workstations_rest_test.rb new file mode 100644 index 000000000000..4700ae680eee --- /dev/null +++ b/owl-bot-staging/google-cloud-workstations-v1beta/test/google/cloud/workstations/v1beta/workstations_rest_test.rb @@ -0,0 +1,1220 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/workstations/v1beta/workstations_pb" +require "google/cloud/workstations/v1beta/workstations/rest" + + +class ::Google::Cloud::Workstations::V1beta::Workstations::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_get_workstation_cluster + # Create test objects. + client_result = ::Google::Cloud::Workstations::V1beta::WorkstationCluster.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_workstation_cluster_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::Workstations::V1beta::Workstations::Rest::ServiceStub.stub :transcode_get_workstation_cluster_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_workstation_cluster_client_stub do + # Create client + client = ::Google::Cloud::Workstations::V1beta::Workstations::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_workstation_cluster({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_workstation_cluster name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_workstation_cluster ::Google::Cloud::Workstations::V1beta::GetWorkstationClusterRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_workstation_cluster({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_workstation_cluster(::Google::Cloud::Workstations::V1beta::GetWorkstationClusterRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_workstation_cluster_client_stub.call_count + end + end + end + + def test_list_workstation_clusters + # Create test objects. + client_result = ::Google::Cloud::Workstations::V1beta::ListWorkstationClustersResponse.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_workstation_clusters_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::Workstations::V1beta::Workstations::Rest::ServiceStub.stub :transcode_list_workstation_clusters_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_workstation_clusters_client_stub do + # Create client + client = ::Google::Cloud::Workstations::V1beta::Workstations::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_workstation_clusters({ 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_workstation_clusters 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_workstation_clusters ::Google::Cloud::Workstations::V1beta::ListWorkstationClustersRequest.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_workstation_clusters({ 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_workstation_clusters(::Google::Cloud::Workstations::V1beta::ListWorkstationClustersRequest.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_workstation_clusters_client_stub.call_count + end + end + end + + def test_create_workstation_cluster + # 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" + workstation_cluster_id = "hello world" + workstation_cluster = {} + validate_only = true + + create_workstation_cluster_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::Workstations::V1beta::Workstations::Rest::ServiceStub.stub :transcode_create_workstation_cluster_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_workstation_cluster_client_stub do + # Create client + client = ::Google::Cloud::Workstations::V1beta::Workstations::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_workstation_cluster({ parent: parent, workstation_cluster_id: workstation_cluster_id, workstation_cluster: workstation_cluster, validate_only: validate_only }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_workstation_cluster parent: parent, workstation_cluster_id: workstation_cluster_id, workstation_cluster: workstation_cluster, validate_only: validate_only do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_workstation_cluster ::Google::Cloud::Workstations::V1beta::CreateWorkstationClusterRequest.new(parent: parent, workstation_cluster_id: workstation_cluster_id, workstation_cluster: workstation_cluster, validate_only: validate_only) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_workstation_cluster({ parent: parent, workstation_cluster_id: workstation_cluster_id, workstation_cluster: workstation_cluster, validate_only: validate_only }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_workstation_cluster(::Google::Cloud::Workstations::V1beta::CreateWorkstationClusterRequest.new(parent: parent, workstation_cluster_id: workstation_cluster_id, workstation_cluster: workstation_cluster, validate_only: validate_only), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_workstation_cluster_client_stub.call_count + end + end + end + + def test_update_workstation_cluster + # 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. + workstation_cluster = {} + update_mask = {} + validate_only = true + allow_missing = true + + update_workstation_cluster_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::Workstations::V1beta::Workstations::Rest::ServiceStub.stub :transcode_update_workstation_cluster_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_workstation_cluster_client_stub do + # Create client + client = ::Google::Cloud::Workstations::V1beta::Workstations::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_workstation_cluster({ workstation_cluster: workstation_cluster, update_mask: update_mask, validate_only: validate_only, allow_missing: allow_missing }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_workstation_cluster workstation_cluster: workstation_cluster, update_mask: update_mask, validate_only: validate_only, allow_missing: allow_missing do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_workstation_cluster ::Google::Cloud::Workstations::V1beta::UpdateWorkstationClusterRequest.new(workstation_cluster: workstation_cluster, update_mask: update_mask, validate_only: validate_only, allow_missing: allow_missing) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_workstation_cluster({ workstation_cluster: workstation_cluster, update_mask: update_mask, validate_only: validate_only, allow_missing: allow_missing }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_workstation_cluster(::Google::Cloud::Workstations::V1beta::UpdateWorkstationClusterRequest.new(workstation_cluster: workstation_cluster, update_mask: update_mask, validate_only: validate_only, allow_missing: allow_missing), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_workstation_cluster_client_stub.call_count + end + end + end + + def test_delete_workstation_cluster + # 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" + validate_only = true + etag = "hello world" + force = true + + delete_workstation_cluster_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::Workstations::V1beta::Workstations::Rest::ServiceStub.stub :transcode_delete_workstation_cluster_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_workstation_cluster_client_stub do + # Create client + client = ::Google::Cloud::Workstations::V1beta::Workstations::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_workstation_cluster({ name: name, validate_only: validate_only, etag: etag, force: force }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_workstation_cluster name: name, validate_only: validate_only, etag: etag, force: force do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_workstation_cluster ::Google::Cloud::Workstations::V1beta::DeleteWorkstationClusterRequest.new(name: name, validate_only: validate_only, etag: etag, force: force) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_workstation_cluster({ name: name, validate_only: validate_only, etag: etag, force: force }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_workstation_cluster(::Google::Cloud::Workstations::V1beta::DeleteWorkstationClusterRequest.new(name: name, validate_only: validate_only, etag: etag, force: force), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_workstation_cluster_client_stub.call_count + end + end + end + + def test_get_workstation_config + # Create test objects. + client_result = ::Google::Cloud::Workstations::V1beta::WorkstationConfig.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_workstation_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::Workstations::V1beta::Workstations::Rest::ServiceStub.stub :transcode_get_workstation_config_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_workstation_config_client_stub do + # Create client + client = ::Google::Cloud::Workstations::V1beta::Workstations::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_workstation_config({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_workstation_config name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_workstation_config ::Google::Cloud::Workstations::V1beta::GetWorkstationConfigRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_workstation_config({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_workstation_config(::Google::Cloud::Workstations::V1beta::GetWorkstationConfigRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_workstation_config_client_stub.call_count + end + end + end + + def test_list_workstation_configs + # Create test objects. + client_result = ::Google::Cloud::Workstations::V1beta::ListWorkstationConfigsResponse.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_workstation_configs_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::Workstations::V1beta::Workstations::Rest::ServiceStub.stub :transcode_list_workstation_configs_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_workstation_configs_client_stub do + # Create client + client = ::Google::Cloud::Workstations::V1beta::Workstations::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_workstation_configs({ 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_workstation_configs 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_workstation_configs ::Google::Cloud::Workstations::V1beta::ListWorkstationConfigsRequest.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_workstation_configs({ 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_workstation_configs(::Google::Cloud::Workstations::V1beta::ListWorkstationConfigsRequest.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_workstation_configs_client_stub.call_count + end + end + end + + def test_list_usable_workstation_configs + # Create test objects. + client_result = ::Google::Cloud::Workstations::V1beta::ListUsableWorkstationConfigsResponse.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_usable_workstation_configs_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::Workstations::V1beta::Workstations::Rest::ServiceStub.stub :transcode_list_usable_workstation_configs_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_usable_workstation_configs_client_stub do + # Create client + client = ::Google::Cloud::Workstations::V1beta::Workstations::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_usable_workstation_configs({ 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_usable_workstation_configs 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_usable_workstation_configs ::Google::Cloud::Workstations::V1beta::ListUsableWorkstationConfigsRequest.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_usable_workstation_configs({ 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_usable_workstation_configs(::Google::Cloud::Workstations::V1beta::ListUsableWorkstationConfigsRequest.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_usable_workstation_configs_client_stub.call_count + end + end + end + + def test_create_workstation_config + # 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" + workstation_config_id = "hello world" + workstation_config = {} + validate_only = true + + create_workstation_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::Workstations::V1beta::Workstations::Rest::ServiceStub.stub :transcode_create_workstation_config_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_workstation_config_client_stub do + # Create client + client = ::Google::Cloud::Workstations::V1beta::Workstations::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_workstation_config({ parent: parent, workstation_config_id: workstation_config_id, workstation_config: workstation_config, validate_only: validate_only }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_workstation_config parent: parent, workstation_config_id: workstation_config_id, workstation_config: workstation_config, validate_only: validate_only do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_workstation_config ::Google::Cloud::Workstations::V1beta::CreateWorkstationConfigRequest.new(parent: parent, workstation_config_id: workstation_config_id, workstation_config: workstation_config, validate_only: validate_only) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_workstation_config({ parent: parent, workstation_config_id: workstation_config_id, workstation_config: workstation_config, validate_only: validate_only }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_workstation_config(::Google::Cloud::Workstations::V1beta::CreateWorkstationConfigRequest.new(parent: parent, workstation_config_id: workstation_config_id, workstation_config: workstation_config, validate_only: validate_only), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_workstation_config_client_stub.call_count + end + end + end + + def test_update_workstation_config + # 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. + workstation_config = {} + update_mask = {} + validate_only = true + allow_missing = true + + update_workstation_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::Workstations::V1beta::Workstations::Rest::ServiceStub.stub :transcode_update_workstation_config_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_workstation_config_client_stub do + # Create client + client = ::Google::Cloud::Workstations::V1beta::Workstations::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_workstation_config({ workstation_config: workstation_config, update_mask: update_mask, validate_only: validate_only, allow_missing: allow_missing }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_workstation_config workstation_config: workstation_config, update_mask: update_mask, validate_only: validate_only, allow_missing: allow_missing do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_workstation_config ::Google::Cloud::Workstations::V1beta::UpdateWorkstationConfigRequest.new(workstation_config: workstation_config, update_mask: update_mask, validate_only: validate_only, allow_missing: allow_missing) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_workstation_config({ workstation_config: workstation_config, update_mask: update_mask, validate_only: validate_only, allow_missing: allow_missing }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_workstation_config(::Google::Cloud::Workstations::V1beta::UpdateWorkstationConfigRequest.new(workstation_config: workstation_config, update_mask: update_mask, validate_only: validate_only, allow_missing: allow_missing), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_workstation_config_client_stub.call_count + end + end + end + + def test_delete_workstation_config + # 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" + validate_only = true + etag = "hello world" + force = true + + delete_workstation_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::Workstations::V1beta::Workstations::Rest::ServiceStub.stub :transcode_delete_workstation_config_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_workstation_config_client_stub do + # Create client + client = ::Google::Cloud::Workstations::V1beta::Workstations::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_workstation_config({ name: name, validate_only: validate_only, etag: etag, force: force }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_workstation_config name: name, validate_only: validate_only, etag: etag, force: force do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_workstation_config ::Google::Cloud::Workstations::V1beta::DeleteWorkstationConfigRequest.new(name: name, validate_only: validate_only, etag: etag, force: force) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_workstation_config({ name: name, validate_only: validate_only, etag: etag, force: force }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_workstation_config(::Google::Cloud::Workstations::V1beta::DeleteWorkstationConfigRequest.new(name: name, validate_only: validate_only, etag: etag, force: force), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_workstation_config_client_stub.call_count + end + end + end + + def test_get_workstation + # Create test objects. + client_result = ::Google::Cloud::Workstations::V1beta::Workstation.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_workstation_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::Workstations::V1beta::Workstations::Rest::ServiceStub.stub :transcode_get_workstation_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_workstation_client_stub do + # Create client + client = ::Google::Cloud::Workstations::V1beta::Workstations::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_workstation({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_workstation name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_workstation ::Google::Cloud::Workstations::V1beta::GetWorkstationRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_workstation({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_workstation(::Google::Cloud::Workstations::V1beta::GetWorkstationRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_workstation_client_stub.call_count + end + end + end + + def test_list_workstations + # Create test objects. + client_result = ::Google::Cloud::Workstations::V1beta::ListWorkstationsResponse.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_workstations_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::Workstations::V1beta::Workstations::Rest::ServiceStub.stub :transcode_list_workstations_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_workstations_client_stub do + # Create client + client = ::Google::Cloud::Workstations::V1beta::Workstations::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_workstations({ 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_workstations 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_workstations ::Google::Cloud::Workstations::V1beta::ListWorkstationsRequest.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_workstations({ 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_workstations(::Google::Cloud::Workstations::V1beta::ListWorkstationsRequest.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_workstations_client_stub.call_count + end + end + end + + def test_list_usable_workstations + # Create test objects. + client_result = ::Google::Cloud::Workstations::V1beta::ListUsableWorkstationsResponse.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_usable_workstations_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::Workstations::V1beta::Workstations::Rest::ServiceStub.stub :transcode_list_usable_workstations_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_usable_workstations_client_stub do + # Create client + client = ::Google::Cloud::Workstations::V1beta::Workstations::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_usable_workstations({ 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_usable_workstations 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_usable_workstations ::Google::Cloud::Workstations::V1beta::ListUsableWorkstationsRequest.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_usable_workstations({ 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_usable_workstations(::Google::Cloud::Workstations::V1beta::ListUsableWorkstationsRequest.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_usable_workstations_client_stub.call_count + end + end + end + + def test_create_workstation + # 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" + workstation_id = "hello world" + workstation = {} + validate_only = true + + create_workstation_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::Workstations::V1beta::Workstations::Rest::ServiceStub.stub :transcode_create_workstation_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_workstation_client_stub do + # Create client + client = ::Google::Cloud::Workstations::V1beta::Workstations::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_workstation({ parent: parent, workstation_id: workstation_id, workstation: workstation, validate_only: validate_only }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_workstation parent: parent, workstation_id: workstation_id, workstation: workstation, validate_only: validate_only do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_workstation ::Google::Cloud::Workstations::V1beta::CreateWorkstationRequest.new(parent: parent, workstation_id: workstation_id, workstation: workstation, validate_only: validate_only) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_workstation({ parent: parent, workstation_id: workstation_id, workstation: workstation, validate_only: validate_only }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_workstation(::Google::Cloud::Workstations::V1beta::CreateWorkstationRequest.new(parent: parent, workstation_id: workstation_id, workstation: workstation, validate_only: validate_only), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_workstation_client_stub.call_count + end + end + end + + def test_update_workstation + # 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. + workstation = {} + update_mask = {} + validate_only = true + allow_missing = true + + update_workstation_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::Workstations::V1beta::Workstations::Rest::ServiceStub.stub :transcode_update_workstation_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_workstation_client_stub do + # Create client + client = ::Google::Cloud::Workstations::V1beta::Workstations::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_workstation({ workstation: workstation, update_mask: update_mask, validate_only: validate_only, allow_missing: allow_missing }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_workstation workstation: workstation, update_mask: update_mask, validate_only: validate_only, allow_missing: allow_missing do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_workstation ::Google::Cloud::Workstations::V1beta::UpdateWorkstationRequest.new(workstation: workstation, update_mask: update_mask, validate_only: validate_only, allow_missing: allow_missing) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_workstation({ workstation: workstation, update_mask: update_mask, validate_only: validate_only, allow_missing: allow_missing }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_workstation(::Google::Cloud::Workstations::V1beta::UpdateWorkstationRequest.new(workstation: workstation, update_mask: update_mask, validate_only: validate_only, allow_missing: allow_missing), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_workstation_client_stub.call_count + end + end + end + + def test_delete_workstation + # 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" + validate_only = true + etag = "hello world" + + delete_workstation_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::Workstations::V1beta::Workstations::Rest::ServiceStub.stub :transcode_delete_workstation_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_workstation_client_stub do + # Create client + client = ::Google::Cloud::Workstations::V1beta::Workstations::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_workstation({ name: name, validate_only: validate_only, etag: etag }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_workstation name: name, validate_only: validate_only, etag: etag do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_workstation ::Google::Cloud::Workstations::V1beta::DeleteWorkstationRequest.new(name: name, validate_only: validate_only, etag: etag) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_workstation({ name: name, validate_only: validate_only, etag: etag }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_workstation(::Google::Cloud::Workstations::V1beta::DeleteWorkstationRequest.new(name: name, validate_only: validate_only, etag: etag), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_workstation_client_stub.call_count + end + end + end + + def test_start_workstation + # 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" + validate_only = true + etag = "hello world" + + start_workstation_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::Workstations::V1beta::Workstations::Rest::ServiceStub.stub :transcode_start_workstation_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, start_workstation_client_stub do + # Create client + client = ::Google::Cloud::Workstations::V1beta::Workstations::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.start_workstation({ name: name, validate_only: validate_only, etag: etag }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.start_workstation name: name, validate_only: validate_only, etag: etag do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.start_workstation ::Google::Cloud::Workstations::V1beta::StartWorkstationRequest.new(name: name, validate_only: validate_only, etag: etag) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.start_workstation({ name: name, validate_only: validate_only, etag: etag }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.start_workstation(::Google::Cloud::Workstations::V1beta::StartWorkstationRequest.new(name: name, validate_only: validate_only, etag: etag), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, start_workstation_client_stub.call_count + end + end + end + + def test_stop_workstation + # 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" + validate_only = true + etag = "hello world" + + stop_workstation_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::Workstations::V1beta::Workstations::Rest::ServiceStub.stub :transcode_stop_workstation_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, stop_workstation_client_stub do + # Create client + client = ::Google::Cloud::Workstations::V1beta::Workstations::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.stop_workstation({ name: name, validate_only: validate_only, etag: etag }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.stop_workstation name: name, validate_only: validate_only, etag: etag do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.stop_workstation ::Google::Cloud::Workstations::V1beta::StopWorkstationRequest.new(name: name, validate_only: validate_only, etag: etag) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.stop_workstation({ name: name, validate_only: validate_only, etag: etag }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.stop_workstation(::Google::Cloud::Workstations::V1beta::StopWorkstationRequest.new(name: name, validate_only: validate_only, etag: etag), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, stop_workstation_client_stub.call_count + end + end + end + + def test_generate_access_token + # Create test objects. + client_result = ::Google::Cloud::Workstations::V1beta::GenerateAccessTokenResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + expire_time = {} + workstation = "hello world" + + generate_access_token_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::Workstations::V1beta::Workstations::Rest::ServiceStub.stub :transcode_generate_access_token_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, generate_access_token_client_stub do + # Create client + client = ::Google::Cloud::Workstations::V1beta::Workstations::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.generate_access_token({ expire_time: expire_time, workstation: workstation }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.generate_access_token expire_time: expire_time, workstation: workstation do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.generate_access_token ::Google::Cloud::Workstations::V1beta::GenerateAccessTokenRequest.new(expire_time: expire_time, workstation: workstation) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.generate_access_token({ expire_time: expire_time, workstation: workstation }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.generate_access_token(::Google::Cloud::Workstations::V1beta::GenerateAccessTokenRequest.new(expire_time: expire_time, workstation: workstation), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, generate_access_token_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::Workstations::V1beta::Workstations::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::Workstations::V1beta::Workstations::Rest::Client::Configuration, config + end +end diff --git a/owl-bot-staging/google-cloud-workstations-v1beta/test/google/cloud/workstations/v1beta/workstations_test.rb b/owl-bot-staging/google-cloud-workstations-v1beta/test/google/cloud/workstations/v1beta/workstations_test.rb new file mode 100644 index 000000000000..f211534d13c1 --- /dev/null +++ b/owl-bot-staging/google-cloud-workstations-v1beta/test/google/cloud/workstations/v1beta/workstations_test.rb @@ -0,0 +1,1441 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/workstations/v1beta/workstations_pb" +require "google/cloud/workstations/v1beta/workstations" + +class ::Google::Cloud::Workstations::V1beta::Workstations::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_get_workstation_cluster + # Create GRPC objects. + grpc_response = ::Google::Cloud::Workstations::V1beta::WorkstationCluster.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_workstation_cluster_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_workstation_cluster, name + assert_kind_of ::Google::Cloud::Workstations::V1beta::GetWorkstationClusterRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_workstation_cluster_client_stub do + # Create client + client = ::Google::Cloud::Workstations::V1beta::Workstations::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_workstation_cluster({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_workstation_cluster name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_workstation_cluster ::Google::Cloud::Workstations::V1beta::GetWorkstationClusterRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_workstation_cluster({ 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_workstation_cluster(::Google::Cloud::Workstations::V1beta::GetWorkstationClusterRequest.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_workstation_cluster_client_stub.call_rpc_count + end + end + + def test_list_workstation_clusters + # Create GRPC objects. + grpc_response = ::Google::Cloud::Workstations::V1beta::ListWorkstationClustersResponse.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_workstation_clusters_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_workstation_clusters, name + assert_kind_of ::Google::Cloud::Workstations::V1beta::ListWorkstationClustersRequest, 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_workstation_clusters_client_stub do + # Create client + client = ::Google::Cloud::Workstations::V1beta::Workstations::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_workstation_clusters({ 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_workstation_clusters 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_workstation_clusters ::Google::Cloud::Workstations::V1beta::ListWorkstationClustersRequest.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_workstation_clusters({ 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_workstation_clusters(::Google::Cloud::Workstations::V1beta::ListWorkstationClustersRequest.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_workstation_clusters_client_stub.call_rpc_count + end + end + + def test_create_workstation_cluster + # 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" + workstation_cluster_id = "hello world" + workstation_cluster = {} + validate_only = true + + create_workstation_cluster_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_workstation_cluster, name + assert_kind_of ::Google::Cloud::Workstations::V1beta::CreateWorkstationClusterRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["workstation_cluster_id"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Workstations::V1beta::WorkstationCluster), request["workstation_cluster"] + assert_equal true, request["validate_only"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_workstation_cluster_client_stub do + # Create client + client = ::Google::Cloud::Workstations::V1beta::Workstations::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_workstation_cluster({ parent: parent, workstation_cluster_id: workstation_cluster_id, workstation_cluster: workstation_cluster, validate_only: validate_only }) 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_workstation_cluster parent: parent, workstation_cluster_id: workstation_cluster_id, workstation_cluster: workstation_cluster, validate_only: validate_only 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_workstation_cluster ::Google::Cloud::Workstations::V1beta::CreateWorkstationClusterRequest.new(parent: parent, workstation_cluster_id: workstation_cluster_id, workstation_cluster: workstation_cluster, validate_only: validate_only) 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_workstation_cluster({ parent: parent, workstation_cluster_id: workstation_cluster_id, workstation_cluster: workstation_cluster, validate_only: validate_only }, 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_workstation_cluster(::Google::Cloud::Workstations::V1beta::CreateWorkstationClusterRequest.new(parent: parent, workstation_cluster_id: workstation_cluster_id, workstation_cluster: workstation_cluster, validate_only: validate_only), 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_workstation_cluster_client_stub.call_rpc_count + end + end + + def test_update_workstation_cluster + # 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. + workstation_cluster = {} + update_mask = {} + validate_only = true + allow_missing = true + + update_workstation_cluster_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_workstation_cluster, name + assert_kind_of ::Google::Cloud::Workstations::V1beta::UpdateWorkstationClusterRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Workstations::V1beta::WorkstationCluster), request["workstation_cluster"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + assert_equal true, request["validate_only"] + assert_equal true, request["allow_missing"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_workstation_cluster_client_stub do + # Create client + client = ::Google::Cloud::Workstations::V1beta::Workstations::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_workstation_cluster({ workstation_cluster: workstation_cluster, update_mask: update_mask, validate_only: validate_only, allow_missing: allow_missing }) 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.update_workstation_cluster workstation_cluster: workstation_cluster, update_mask: update_mask, validate_only: validate_only, allow_missing: allow_missing 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.update_workstation_cluster ::Google::Cloud::Workstations::V1beta::UpdateWorkstationClusterRequest.new(workstation_cluster: workstation_cluster, update_mask: update_mask, validate_only: validate_only, allow_missing: allow_missing) 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.update_workstation_cluster({ workstation_cluster: workstation_cluster, update_mask: update_mask, validate_only: validate_only, allow_missing: allow_missing }, 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.update_workstation_cluster(::Google::Cloud::Workstations::V1beta::UpdateWorkstationClusterRequest.new(workstation_cluster: workstation_cluster, update_mask: update_mask, validate_only: validate_only, allow_missing: allow_missing), 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, update_workstation_cluster_client_stub.call_rpc_count + end + end + + def test_delete_workstation_cluster + # 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" + validate_only = true + etag = "hello world" + force = true + + delete_workstation_cluster_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_workstation_cluster, name + assert_kind_of ::Google::Cloud::Workstations::V1beta::DeleteWorkstationClusterRequest, request + assert_equal "hello world", request["name"] + assert_equal true, request["validate_only"] + assert_equal "hello world", request["etag"] + assert_equal true, request["force"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_workstation_cluster_client_stub do + # Create client + client = ::Google::Cloud::Workstations::V1beta::Workstations::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_workstation_cluster({ name: name, validate_only: validate_only, etag: etag, force: force }) 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_workstation_cluster name: name, validate_only: validate_only, etag: etag, force: force 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_workstation_cluster ::Google::Cloud::Workstations::V1beta::DeleteWorkstationClusterRequest.new(name: name, validate_only: validate_only, etag: etag, force: force) 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_workstation_cluster({ name: name, validate_only: validate_only, etag: etag, force: force }, 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_workstation_cluster(::Google::Cloud::Workstations::V1beta::DeleteWorkstationClusterRequest.new(name: name, validate_only: validate_only, etag: etag, force: force), 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_workstation_cluster_client_stub.call_rpc_count + end + end + + def test_get_workstation_config + # Create GRPC objects. + grpc_response = ::Google::Cloud::Workstations::V1beta::WorkstationConfig.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_workstation_config_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_workstation_config, name + assert_kind_of ::Google::Cloud::Workstations::V1beta::GetWorkstationConfigRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_workstation_config_client_stub do + # Create client + client = ::Google::Cloud::Workstations::V1beta::Workstations::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_workstation_config({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_workstation_config name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_workstation_config ::Google::Cloud::Workstations::V1beta::GetWorkstationConfigRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_workstation_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_workstation_config(::Google::Cloud::Workstations::V1beta::GetWorkstationConfigRequest.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_workstation_config_client_stub.call_rpc_count + end + end + + def test_list_workstation_configs + # Create GRPC objects. + grpc_response = ::Google::Cloud::Workstations::V1beta::ListWorkstationConfigsResponse.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_workstation_configs_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_workstation_configs, name + assert_kind_of ::Google::Cloud::Workstations::V1beta::ListWorkstationConfigsRequest, 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_workstation_configs_client_stub do + # Create client + client = ::Google::Cloud::Workstations::V1beta::Workstations::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_workstation_configs({ 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_workstation_configs 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_workstation_configs ::Google::Cloud::Workstations::V1beta::ListWorkstationConfigsRequest.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_workstation_configs({ 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_workstation_configs(::Google::Cloud::Workstations::V1beta::ListWorkstationConfigsRequest.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_workstation_configs_client_stub.call_rpc_count + end + end + + def test_list_usable_workstation_configs + # Create GRPC objects. + grpc_response = ::Google::Cloud::Workstations::V1beta::ListUsableWorkstationConfigsResponse.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_usable_workstation_configs_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_usable_workstation_configs, name + assert_kind_of ::Google::Cloud::Workstations::V1beta::ListUsableWorkstationConfigsRequest, 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_usable_workstation_configs_client_stub do + # Create client + client = ::Google::Cloud::Workstations::V1beta::Workstations::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_usable_workstation_configs({ 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_usable_workstation_configs 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_usable_workstation_configs ::Google::Cloud::Workstations::V1beta::ListUsableWorkstationConfigsRequest.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_usable_workstation_configs({ 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_usable_workstation_configs(::Google::Cloud::Workstations::V1beta::ListUsableWorkstationConfigsRequest.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_usable_workstation_configs_client_stub.call_rpc_count + end + end + + def test_create_workstation_config + # 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" + workstation_config_id = "hello world" + workstation_config = {} + validate_only = true + + create_workstation_config_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_workstation_config, name + assert_kind_of ::Google::Cloud::Workstations::V1beta::CreateWorkstationConfigRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["workstation_config_id"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Workstations::V1beta::WorkstationConfig), request["workstation_config"] + assert_equal true, request["validate_only"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_workstation_config_client_stub do + # Create client + client = ::Google::Cloud::Workstations::V1beta::Workstations::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_workstation_config({ parent: parent, workstation_config_id: workstation_config_id, workstation_config: workstation_config, validate_only: validate_only }) 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_workstation_config parent: parent, workstation_config_id: workstation_config_id, workstation_config: workstation_config, validate_only: validate_only 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_workstation_config ::Google::Cloud::Workstations::V1beta::CreateWorkstationConfigRequest.new(parent: parent, workstation_config_id: workstation_config_id, workstation_config: workstation_config, validate_only: validate_only) 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_workstation_config({ parent: parent, workstation_config_id: workstation_config_id, workstation_config: workstation_config, validate_only: validate_only }, 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_workstation_config(::Google::Cloud::Workstations::V1beta::CreateWorkstationConfigRequest.new(parent: parent, workstation_config_id: workstation_config_id, workstation_config: workstation_config, validate_only: validate_only), 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_workstation_config_client_stub.call_rpc_count + end + end + + def test_update_workstation_config + # 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. + workstation_config = {} + update_mask = {} + validate_only = true + allow_missing = true + + update_workstation_config_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_workstation_config, name + assert_kind_of ::Google::Cloud::Workstations::V1beta::UpdateWorkstationConfigRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Workstations::V1beta::WorkstationConfig), request["workstation_config"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + assert_equal true, request["validate_only"] + assert_equal true, request["allow_missing"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_workstation_config_client_stub do + # Create client + client = ::Google::Cloud::Workstations::V1beta::Workstations::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_workstation_config({ workstation_config: workstation_config, update_mask: update_mask, validate_only: validate_only, allow_missing: allow_missing }) 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.update_workstation_config workstation_config: workstation_config, update_mask: update_mask, validate_only: validate_only, allow_missing: allow_missing 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.update_workstation_config ::Google::Cloud::Workstations::V1beta::UpdateWorkstationConfigRequest.new(workstation_config: workstation_config, update_mask: update_mask, validate_only: validate_only, allow_missing: allow_missing) 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.update_workstation_config({ workstation_config: workstation_config, update_mask: update_mask, validate_only: validate_only, allow_missing: allow_missing }, 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.update_workstation_config(::Google::Cloud::Workstations::V1beta::UpdateWorkstationConfigRequest.new(workstation_config: workstation_config, update_mask: update_mask, validate_only: validate_only, allow_missing: allow_missing), 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, update_workstation_config_client_stub.call_rpc_count + end + end + + def test_delete_workstation_config + # 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" + validate_only = true + etag = "hello world" + force = true + + delete_workstation_config_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_workstation_config, name + assert_kind_of ::Google::Cloud::Workstations::V1beta::DeleteWorkstationConfigRequest, request + assert_equal "hello world", request["name"] + assert_equal true, request["validate_only"] + assert_equal "hello world", request["etag"] + assert_equal true, request["force"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_workstation_config_client_stub do + # Create client + client = ::Google::Cloud::Workstations::V1beta::Workstations::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_workstation_config({ name: name, validate_only: validate_only, etag: etag, force: force }) 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_workstation_config name: name, validate_only: validate_only, etag: etag, force: force 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_workstation_config ::Google::Cloud::Workstations::V1beta::DeleteWorkstationConfigRequest.new(name: name, validate_only: validate_only, etag: etag, force: force) 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_workstation_config({ name: name, validate_only: validate_only, etag: etag, force: force }, 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_workstation_config(::Google::Cloud::Workstations::V1beta::DeleteWorkstationConfigRequest.new(name: name, validate_only: validate_only, etag: etag, force: force), 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_workstation_config_client_stub.call_rpc_count + end + end + + def test_get_workstation + # Create GRPC objects. + grpc_response = ::Google::Cloud::Workstations::V1beta::Workstation.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_workstation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_workstation, name + assert_kind_of ::Google::Cloud::Workstations::V1beta::GetWorkstationRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_workstation_client_stub do + # Create client + client = ::Google::Cloud::Workstations::V1beta::Workstations::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_workstation({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_workstation name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_workstation ::Google::Cloud::Workstations::V1beta::GetWorkstationRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_workstation({ 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_workstation(::Google::Cloud::Workstations::V1beta::GetWorkstationRequest.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_workstation_client_stub.call_rpc_count + end + end + + def test_list_workstations + # Create GRPC objects. + grpc_response = ::Google::Cloud::Workstations::V1beta::ListWorkstationsResponse.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_workstations_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_workstations, name + assert_kind_of ::Google::Cloud::Workstations::V1beta::ListWorkstationsRequest, 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_workstations_client_stub do + # Create client + client = ::Google::Cloud::Workstations::V1beta::Workstations::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_workstations({ 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_workstations 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_workstations ::Google::Cloud::Workstations::V1beta::ListWorkstationsRequest.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_workstations({ 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_workstations(::Google::Cloud::Workstations::V1beta::ListWorkstationsRequest.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_workstations_client_stub.call_rpc_count + end + end + + def test_list_usable_workstations + # Create GRPC objects. + grpc_response = ::Google::Cloud::Workstations::V1beta::ListUsableWorkstationsResponse.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_usable_workstations_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_usable_workstations, name + assert_kind_of ::Google::Cloud::Workstations::V1beta::ListUsableWorkstationsRequest, 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_usable_workstations_client_stub do + # Create client + client = ::Google::Cloud::Workstations::V1beta::Workstations::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_usable_workstations({ 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_usable_workstations 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_usable_workstations ::Google::Cloud::Workstations::V1beta::ListUsableWorkstationsRequest.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_usable_workstations({ 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_usable_workstations(::Google::Cloud::Workstations::V1beta::ListUsableWorkstationsRequest.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_usable_workstations_client_stub.call_rpc_count + end + end + + def test_create_workstation + # 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" + workstation_id = "hello world" + workstation = {} + validate_only = true + + create_workstation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_workstation, name + assert_kind_of ::Google::Cloud::Workstations::V1beta::CreateWorkstationRequest, request + assert_equal "hello world", request["parent"] + assert_equal "hello world", request["workstation_id"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Workstations::V1beta::Workstation), request["workstation"] + assert_equal true, request["validate_only"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_workstation_client_stub do + # Create client + client = ::Google::Cloud::Workstations::V1beta::Workstations::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_workstation({ parent: parent, workstation_id: workstation_id, workstation: workstation, validate_only: validate_only }) 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_workstation parent: parent, workstation_id: workstation_id, workstation: workstation, validate_only: validate_only 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_workstation ::Google::Cloud::Workstations::V1beta::CreateWorkstationRequest.new(parent: parent, workstation_id: workstation_id, workstation: workstation, validate_only: validate_only) 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_workstation({ parent: parent, workstation_id: workstation_id, workstation: workstation, validate_only: validate_only }, 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_workstation(::Google::Cloud::Workstations::V1beta::CreateWorkstationRequest.new(parent: parent, workstation_id: workstation_id, workstation: workstation, validate_only: validate_only), 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_workstation_client_stub.call_rpc_count + end + end + + def test_update_workstation + # 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. + workstation = {} + update_mask = {} + validate_only = true + allow_missing = true + + update_workstation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_workstation, name + assert_kind_of ::Google::Cloud::Workstations::V1beta::UpdateWorkstationRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Workstations::V1beta::Workstation), request["workstation"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + assert_equal true, request["validate_only"] + assert_equal true, request["allow_missing"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_workstation_client_stub do + # Create client + client = ::Google::Cloud::Workstations::V1beta::Workstations::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_workstation({ workstation: workstation, update_mask: update_mask, validate_only: validate_only, allow_missing: allow_missing }) 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.update_workstation workstation: workstation, update_mask: update_mask, validate_only: validate_only, allow_missing: allow_missing 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.update_workstation ::Google::Cloud::Workstations::V1beta::UpdateWorkstationRequest.new(workstation: workstation, update_mask: update_mask, validate_only: validate_only, allow_missing: allow_missing) 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.update_workstation({ workstation: workstation, update_mask: update_mask, validate_only: validate_only, allow_missing: allow_missing }, 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.update_workstation(::Google::Cloud::Workstations::V1beta::UpdateWorkstationRequest.new(workstation: workstation, update_mask: update_mask, validate_only: validate_only, allow_missing: allow_missing), 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, update_workstation_client_stub.call_rpc_count + end + end + + def test_delete_workstation + # 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" + validate_only = true + etag = "hello world" + + delete_workstation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_workstation, name + assert_kind_of ::Google::Cloud::Workstations::V1beta::DeleteWorkstationRequest, request + assert_equal "hello world", request["name"] + assert_equal true, request["validate_only"] + assert_equal "hello world", request["etag"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_workstation_client_stub do + # Create client + client = ::Google::Cloud::Workstations::V1beta::Workstations::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_workstation({ name: name, validate_only: validate_only, etag: etag }) 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_workstation name: name, validate_only: validate_only, etag: etag 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_workstation ::Google::Cloud::Workstations::V1beta::DeleteWorkstationRequest.new(name: name, validate_only: validate_only, etag: etag) 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_workstation({ name: name, validate_only: validate_only, etag: etag }, 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_workstation(::Google::Cloud::Workstations::V1beta::DeleteWorkstationRequest.new(name: name, validate_only: validate_only, etag: etag), 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_workstation_client_stub.call_rpc_count + end + end + + def test_start_workstation + # 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" + validate_only = true + etag = "hello world" + + start_workstation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :start_workstation, name + assert_kind_of ::Google::Cloud::Workstations::V1beta::StartWorkstationRequest, request + assert_equal "hello world", request["name"] + assert_equal true, request["validate_only"] + assert_equal "hello world", request["etag"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, start_workstation_client_stub do + # Create client + client = ::Google::Cloud::Workstations::V1beta::Workstations::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.start_workstation({ name: name, validate_only: validate_only, etag: etag }) 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.start_workstation name: name, validate_only: validate_only, etag: etag 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.start_workstation ::Google::Cloud::Workstations::V1beta::StartWorkstationRequest.new(name: name, validate_only: validate_only, etag: etag) 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.start_workstation({ name: name, validate_only: validate_only, etag: etag }, 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.start_workstation(::Google::Cloud::Workstations::V1beta::StartWorkstationRequest.new(name: name, validate_only: validate_only, etag: etag), 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, start_workstation_client_stub.call_rpc_count + end + end + + def test_stop_workstation + # 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" + validate_only = true + etag = "hello world" + + stop_workstation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :stop_workstation, name + assert_kind_of ::Google::Cloud::Workstations::V1beta::StopWorkstationRequest, request + assert_equal "hello world", request["name"] + assert_equal true, request["validate_only"] + assert_equal "hello world", request["etag"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, stop_workstation_client_stub do + # Create client + client = ::Google::Cloud::Workstations::V1beta::Workstations::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.stop_workstation({ name: name, validate_only: validate_only, etag: etag }) 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.stop_workstation name: name, validate_only: validate_only, etag: etag 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.stop_workstation ::Google::Cloud::Workstations::V1beta::StopWorkstationRequest.new(name: name, validate_only: validate_only, etag: etag) 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.stop_workstation({ name: name, validate_only: validate_only, etag: etag }, 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.stop_workstation(::Google::Cloud::Workstations::V1beta::StopWorkstationRequest.new(name: name, validate_only: validate_only, etag: etag), 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, stop_workstation_client_stub.call_rpc_count + end + end + + def test_generate_access_token + # Create GRPC objects. + grpc_response = ::Google::Cloud::Workstations::V1beta::GenerateAccessTokenResponse.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. + expire_time = {} + workstation = "hello world" + + generate_access_token_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :generate_access_token, name + assert_kind_of ::Google::Cloud::Workstations::V1beta::GenerateAccessTokenRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Timestamp), request["expire_time"] + assert_equal :expire_time, request.expiration + assert_equal "hello world", request["workstation"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, generate_access_token_client_stub do + # Create client + client = ::Google::Cloud::Workstations::V1beta::Workstations::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.generate_access_token({ expire_time: expire_time, workstation: workstation }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.generate_access_token expire_time: expire_time, workstation: workstation do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.generate_access_token ::Google::Cloud::Workstations::V1beta::GenerateAccessTokenRequest.new(expire_time: expire_time, workstation: workstation) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.generate_access_token({ expire_time: expire_time, workstation: workstation }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.generate_access_token(::Google::Cloud::Workstations::V1beta::GenerateAccessTokenRequest.new(expire_time: expire_time, workstation: workstation), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, generate_access_token_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::Workstations::V1beta::Workstations::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::Workstations::V1beta::Workstations::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::Workstations::V1beta::Workstations::Client.new do |config| + config.credentials = creds + end + assert_kind_of ::Google::Cloud::Workstations::V1beta::Workstations::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::Workstations::V1beta::Workstations::Client.new do |config| + config.credentials = grpc_channel + end + end + + assert_kind_of ::Google::Cloud::Workstations::V1beta::Workstations::Operations, client.operations_client + end +end diff --git a/owl-bot-staging/google-cloud-workstations-v1beta/test/helper.rb b/owl-bot-staging/google-cloud-workstations-v1beta/test/helper.rb new file mode 100644 index 000000000000..672b337030e7 --- /dev/null +++ b/owl-bot-staging/google-cloud-workstations-v1beta/test/helper.rb @@ -0,0 +1,26 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/mock" +require "minitest/rg" + +require "grpc" + +require "ostruct" diff --git a/owl-bot-staging/google-iam-credentials-v1/.gitignore b/owl-bot-staging/google-iam-credentials-v1/.gitignore new file mode 100644 index 000000000000..0135b6bc6cfc --- /dev/null +++ b/owl-bot-staging/google-iam-credentials-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-iam-credentials-v1/.repo-metadata.json b/owl-bot-staging/google-iam-credentials-v1/.repo-metadata.json new file mode 100644 index 000000000000..63df137774ef --- /dev/null +++ b/owl-bot-staging/google-iam-credentials-v1/.repo-metadata.json @@ -0,0 +1,18 @@ +{ + "api_id": "iamcredentials.googleapis.com", + "api_shortname": "iamcredentials", + "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-iam-credentials-v1/latest", + "distribution_name": "google-iam-credentials-v1", + "is_cloud": true, + "language": "ruby", + "name": "iamcredentials", + "name_pretty": "IAM Service Account Credentials V1 API", + "product_documentation": "https://cloud.google.com/iam", + "release_level": "unreleased", + "repo": "googleapis/google-cloud-ruby", + "requires_billing": true, + "ruby-cloud-description": "The Service Account Credentials API creates short-lived credentials for Identity and Access Management (IAM) service accounts. You can also use this API to sign JSON Web Tokens (JWTs), as well as blobs of binary data that contain other types of tokens. Note that google-iam-credentials-v1 is a version-specific client library. For most uses, we recommend installing the main client library google-iam-credentials instead. See the readme for more details.", + "ruby-cloud-env-prefix": "IAM_CREDENTIALS", + "ruby-cloud-product-url": "https://cloud.google.com/iam", + "library_type": "GAPIC_AUTO" +} diff --git a/owl-bot-staging/google-iam-credentials-v1/.rubocop.yml b/owl-bot-staging/google-iam-credentials-v1/.rubocop.yml new file mode 100644 index 000000000000..9b2a231aba17 --- /dev/null +++ b/owl-bot-staging/google-iam-credentials-v1/.rubocop.yml @@ -0,0 +1,33 @@ +inherit_gem: + google-style: google-style.yml + +AllCops: + Exclude: + - "google-iam-credentials-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-iam-credentials-v1.rb" diff --git a/owl-bot-staging/google-iam-credentials-v1/.toys.rb b/owl-bot-staging/google-iam-credentials-v1/.toys.rb new file mode 100644 index 000000000000..177e22456e8a --- /dev/null +++ b/owl-bot-staging/google-iam-credentials-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-iam-credentials-v1/.yardopts b/owl-bot-staging/google-iam-credentials-v1/.yardopts new file mode 100644 index 000000000000..b52365dc43b4 --- /dev/null +++ b/owl-bot-staging/google-iam-credentials-v1/.yardopts @@ -0,0 +1,12 @@ +--no-private +--title="IAM Service Account Credentials 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-iam-credentials-v1/AUTHENTICATION.md b/owl-bot-staging/google-iam-credentials-v1/AUTHENTICATION.md new file mode 100644 index 000000000000..1d811fed1a80 --- /dev/null +++ b/owl-bot-staging/google-iam-credentials-v1/AUTHENTICATION.md @@ -0,0 +1,122 @@ +# Authentication + +The recommended way to authenticate to the google-iam-credentials-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-iam-credentials-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/iam/credentials/v1" + +client = ::Google::Iam::Credentials::V1::IAMCredentials::Client.new do |config| + config.credentials = "path/to/credentialfile.json" +end +``` + +To configure a credentials file globally for all clients: + +```ruby +require "google/iam/credentials/v1" + +::Google::Iam::Credentials::V1::IAMCredentials::Client.configure do |config| + config.credentials = "path/to/credentialfile.json" +end + +client = ::Google::Iam::Credentials::V1::IAMCredentials::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-iam-credentials-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/iam/credentials/v1" + +ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" + +client = ::Google::Iam::Credentials::V1::IAMCredentials::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-iam-credentials-v1/CHANGELOG.md b/owl-bot-staging/google-iam-credentials-v1/CHANGELOG.md new file mode 100644 index 000000000000..f88957a62ba2 --- /dev/null +++ b/owl-bot-staging/google-iam-credentials-v1/CHANGELOG.md @@ -0,0 +1,2 @@ +# Release History + diff --git a/owl-bot-staging/google-iam-credentials-v1/Gemfile b/owl-bot-staging/google-iam-credentials-v1/Gemfile new file mode 100644 index 000000000000..1d08558908d8 --- /dev/null +++ b/owl-bot-staging/google-iam-credentials-v1/Gemfile @@ -0,0 +1,14 @@ +source "https://rubygems.org" + +gemspec + +gem "google-style", "~> 1.32.0" +gem "irb", "~> 1.17" +gem "minitest", "~> 6.0.2" +gem "minitest-focus", "~> 1.4" +gem "minitest-mock", "~> 5.27" +gem "minitest-rg", "~> 5.3" +gem "ostruct", "~> 0.5.5" +gem "rake", ">= 13.0" +gem "redcarpet", "~> 3.6" +gem "yard", "~> 0.9" diff --git a/owl-bot-staging/google-iam-credentials-v1/LICENSE.md b/owl-bot-staging/google-iam-credentials-v1/LICENSE.md new file mode 100644 index 000000000000..c261857ba6ad --- /dev/null +++ b/owl-bot-staging/google-iam-credentials-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-iam-credentials-v1/README.md b/owl-bot-staging/google-iam-credentials-v1/README.md new file mode 100644 index 000000000000..6e9c7e5f994f --- /dev/null +++ b/owl-bot-staging/google-iam-credentials-v1/README.md @@ -0,0 +1,154 @@ +# Ruby Client for the IAM Service Account Credentials V1 API + +Creates short-lived, limited-privilege credentials for IAM service accounts. + +The Service Account Credentials API creates short-lived credentials for Identity and Access Management (IAM) service accounts. You can also use this API to sign JSON Web Tokens (JWTs), as well as blobs of binary data that contain other types of tokens. + +https://github.com/googleapis/google-cloud-ruby + +This gem is a _versioned_ client. It provides basic client classes for a +specific version of the IAM Service Account Credentials V1 API. Most users should consider using +the main client gem, +[google-iam-credentials](https://rubygems.org/gems/google-iam-credentials). +See the section below titled *Which client should I use?* for more information. + +## Installation + +``` +$ gem install google-iam-credentials-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/iamcredentials.googleapis.com) +1. [Set up authentication.](AUTHENTICATION.md) + +## Quick Start + +```ruby +require "google/iam/credentials/v1" + +client = ::Google::Iam::Credentials::V1::IAMCredentials::Client.new +request = ::Google::Iam::Credentials::V1::GenerateAccessTokenRequest.new # (request fields as keyword arguments...) +response = client.generate_access_token request +``` + +View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-iam-credentials-v1/latest) +for class and method documentation. + +See also the [Product Documentation](https://cloud.google.com/iam) +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/iam/credentials/v1" +require "logger" + +client = ::Google::Iam::Credentials::V1::IAMCredentials::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-iam-credentials`, +and lower-level _versioned_ client libraries with names such as +`google-iam-credentials-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-iam-credentials`. +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-iam-credentials-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-iam-credentials-v1/Rakefile b/owl-bot-staging/google-iam-credentials-v1/Rakefile new file mode 100644 index 000000000000..d9311daefed7 --- /dev/null +++ b/owl-bot-staging/google-iam-credentials-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-iam-credentials-v1 acceptance tests." +task :acceptance, :project, :keyfile do |t, args| + project = args[:project] + project ||= + ENV["IAM_CREDENTIALS_TEST_PROJECT"] || + ENV["GCLOUD_TEST_PROJECT"] + keyfile = args[:keyfile] + keyfile ||= + ENV["IAM_CREDENTIALS_TEST_KEYFILE"] || + ENV["GCLOUD_TEST_KEYFILE"] + if keyfile + keyfile = File.read keyfile + else + keyfile ||= + ENV["IAM_CREDENTIALS_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 IAM_CREDENTIALS_TEST_PROJECT=test123 IAM_CREDENTIALS_TEST_KEYFILE=/path/to/keyfile.json rake acceptance" + end + require "google/iam/credentials/v1/iam_credentials/credentials" + ::Google::Iam::Credentials::V1::IAMCredentials::Credentials.env_vars.each do |path| + ENV[path] = nil + end + ENV["IAM_CREDENTIALS_PROJECT"] = project + ENV["IAM_CREDENTIALS_TEST_PROJECT"] = project + ENV["IAM_CREDENTIALS_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-iam-credentials-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-iam-credentials-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-iam-credentials-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-iam-credentials-v1 gem does not have doctest tests." +end + +desc "Run the CI build" +task :ci do + header "BUILDING google-iam-credentials-v1" + header "google-iam-credentials-v1 rubocop", "*" + Rake::Task[:rubocop].invoke + header "google-iam-credentials-v1 yard", "*" + Rake::Task[:yard].invoke + header "google-iam-credentials-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-iam-credentials-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-iam-credentials-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-iam-credentials-v1/gapic_metadata.json b/owl-bot-staging/google-iam-credentials-v1/gapic_metadata.json new file mode 100644 index 000000000000..e3528a0323fe --- /dev/null +++ b/owl-bot-staging/google-iam-credentials-v1/gapic_metadata.json @@ -0,0 +1,38 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "ruby", + "protoPackage": "google.iam.credentials.v1", + "libraryPackage": "::Google::Iam::Credentials::V1", + "services": { + "IAMCredentials": { + "clients": { + "grpc": { + "libraryClient": "::Google::Iam::Credentials::V1::IAMCredentials::Client", + "rpcs": { + "GenerateAccessToken": { + "methods": [ + "generate_access_token" + ] + }, + "GenerateIdToken": { + "methods": [ + "generate_id_token" + ] + }, + "SignBlob": { + "methods": [ + "sign_blob" + ] + }, + "SignJwt": { + "methods": [ + "sign_jwt" + ] + } + } + } + } + } + } +} diff --git a/owl-bot-staging/google-iam-credentials-v1/google-iam-credentials-v1.gemspec b/owl-bot-staging/google-iam-credentials-v1/google-iam-credentials-v1.gemspec new file mode 100644 index 000000000000..545e30f7002b --- /dev/null +++ b/owl-bot-staging/google-iam-credentials-v1/google-iam-credentials-v1.gemspec @@ -0,0 +1,28 @@ +# -*- ruby -*- +# encoding: utf-8 + +require File.expand_path("lib/google/iam/credentials/v1/version", __dir__) + +Gem::Specification.new do |gem| + gem.name = "google-iam-credentials-v1" + gem.version = Google::Iam::Credentials::V1::VERSION + + gem.authors = ["Google LLC"] + gem.email = "googleapis-packages@google.com" + gem.description = "The Service Account Credentials API creates short-lived credentials for Identity and Access Management (IAM) service accounts. You can also use this API to sign JSON Web Tokens (JWTs), as well as blobs of binary data that contain other types of tokens. Note that google-iam-credentials-v1 is a version-specific client library. For most uses, we recommend installing the main client library google-iam-credentials instead. See the readme for more details." + gem.summary = "Creates short-lived, limited-privilege credentials for IAM service accounts." + 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.2" + + gem.add_dependency "gapic-common", "~> 1.2" + gem.add_dependency "google-cloud-errors", "~> 1.0" +end diff --git a/owl-bot-staging/google-iam-credentials-v1/lib/google-iam-credentials-v1.rb b/owl-bot-staging/google-iam-credentials-v1/lib/google-iam-credentials-v1.rb new file mode 100644 index 000000000000..ed2f7cb1dc33 --- /dev/null +++ b/owl-bot-staging/google-iam-credentials-v1/lib/google-iam-credentials-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/iam/credentials/v1" diff --git a/owl-bot-staging/google-iam-credentials-v1/lib/google/iam/credentials/v1.rb b/owl-bot-staging/google-iam-credentials-v1/lib/google/iam/credentials/v1.rb new file mode 100644 index 000000000000..a614ad91054b --- /dev/null +++ b/owl-bot-staging/google-iam-credentials-v1/lib/google/iam/credentials/v1.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/iam/credentials/v1/iam_credentials" +require "google/iam/credentials/v1/version" + +module Google + module Iam + module Credentials + ## + # API client module. + # + # @example Load this package, including all its services, and instantiate a gRPC client + # + # require "google/iam/credentials/v1" + # client = ::Google::Iam::Credentials::V1::IAMCredentials::Client.new + # + # @example Load this package, including all its services, and instantiate a REST client + # + # require "google/iam/credentials/v1" + # client = ::Google::Iam::Credentials::V1::IAMCredentials::Rest::Client.new + # + module V1 + end + end + end +end + +helper_path = ::File.join __dir__, "v1", "_helpers.rb" +require "google/iam/credentials/v1/_helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-iam-credentials-v1/lib/google/iam/credentials/v1/common_pb.rb b/owl-bot-staging/google-iam-credentials-v1/lib/google/iam/credentials/v1/common_pb.rb new file mode 100644 index 000000000000..e50c0aa546c8 --- /dev/null +++ b/owl-bot-staging/google-iam-credentials-v1/lib/google/iam/credentials/v1/common_pb.rb @@ -0,0 +1,33 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/iam/credentials/v1/common.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' + + +descriptor_data = "\n&google/iam/credentials/v1/common.proto\x12\x19google.iam.credentials.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xa9\x01\n\x1aGenerateAccessTokenRequest\x12\x37\n\x04name\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!iam.googleapis.com/ServiceAccount\x12\x11\n\tdelegates\x18\x02 \x03(\t\x12\x12\n\x05scope\x18\x04 \x03(\tB\x03\xe0\x41\x02\x12+\n\x08lifetime\x18\x07 \x01(\x0b\x32\x19.google.protobuf.Duration\"d\n\x1bGenerateAccessTokenResponse\x12\x14\n\x0c\x61\x63\x63\x65ss_token\x18\x01 \x01(\t\x12/\n\x0b\x65xpire_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"s\n\x0fSignBlobRequest\x12\x37\n\x04name\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!iam.googleapis.com/ServiceAccount\x12\x11\n\tdelegates\x18\x03 \x03(\t\x12\x14\n\x07payload\x18\x05 \x01(\x0c\x42\x03\xe0\x41\x02\"7\n\x10SignBlobResponse\x12\x0e\n\x06key_id\x18\x01 \x01(\t\x12\x13\n\x0bsigned_blob\x18\x04 \x01(\x0c\"r\n\x0eSignJwtRequest\x12\x37\n\x04name\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!iam.googleapis.com/ServiceAccount\x12\x11\n\tdelegates\x18\x03 \x03(\t\x12\x14\n\x07payload\x18\x05 \x01(\tB\x03\xe0\x41\x02\"5\n\x0fSignJwtResponse\x12\x0e\n\x06key_id\x18\x01 \x01(\t\x12\x12\n\nsigned_jwt\x18\x02 \x01(\t\"\x92\x01\n\x16GenerateIdTokenRequest\x12\x37\n\x04name\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!iam.googleapis.com/ServiceAccount\x12\x11\n\tdelegates\x18\x02 \x03(\t\x12\x15\n\x08\x61udience\x18\x03 \x01(\tB\x03\xe0\x41\x02\x12\x15\n\rinclude_email\x18\x04 \x01(\x08\"(\n\x17GenerateIdTokenResponse\x12\r\n\x05token\x18\x01 \x01(\tB\xac\x02\n#com.google.cloud.iam.credentials.v1B\x19IAMCredentialsCommonProtoP\x01ZEcloud.google.com/go/iam/credentials/apiv1/credentialspb;credentialspb\xf8\x01\x01\xaa\x02\x1fGoogle.Cloud.Iam.Credentials.V1\xca\x02\x1fGoogle\\Cloud\\Iam\\Credentials\\V1\xea\x41Y\n!iam.googleapis.com/ServiceAccount\x12\x34projects/{project}/serviceAccounts/{service_account}b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Iam + module Credentials + module V1 + GenerateAccessTokenRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.iam.credentials.v1.GenerateAccessTokenRequest").msgclass + GenerateAccessTokenResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.iam.credentials.v1.GenerateAccessTokenResponse").msgclass + SignBlobRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.iam.credentials.v1.SignBlobRequest").msgclass + SignBlobResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.iam.credentials.v1.SignBlobResponse").msgclass + SignJwtRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.iam.credentials.v1.SignJwtRequest").msgclass + SignJwtResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.iam.credentials.v1.SignJwtResponse").msgclass + GenerateIdTokenRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.iam.credentials.v1.GenerateIdTokenRequest").msgclass + GenerateIdTokenResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.iam.credentials.v1.GenerateIdTokenResponse").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-iam-credentials-v1/lib/google/iam/credentials/v1/iam_credentials.rb b/owl-bot-staging/google-iam-credentials-v1/lib/google/iam/credentials/v1/iam_credentials.rb new file mode 100644 index 000000000000..f97cbb3723e3 --- /dev/null +++ b/owl-bot-staging/google-iam-credentials-v1/lib/google/iam/credentials/v1/iam_credentials.rb @@ -0,0 +1,63 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/iam/credentials/v1/version" + +require "google/iam/credentials/v1/iam_credentials/credentials" +require "google/iam/credentials/v1/iam_credentials/paths" +require "google/iam/credentials/v1/iam_credentials/client" +require "google/iam/credentials/v1/iam_credentials/rest" + +module Google + module Iam + module Credentials + module V1 + ## + # A service account is a special type of Google account that belongs to your + # application or a virtual machine (VM), instead of to an individual end user. + # Your application assumes the identity of the service account to call Google + # APIs, so that the users aren't directly involved. + # + # Service account credentials are used to temporarily assume the identity + # of the service account. Supported credential types include OAuth 2.0 access + # tokens, OpenID Connect ID tokens, self-signed JSON Web Tokens (JWTs), and + # more. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/iam/credentials/v1/iam_credentials" + # client = ::Google::Iam::Credentials::V1::IAMCredentials::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/iam/credentials/v1/iam_credentials/rest" + # client = ::Google::Iam::Credentials::V1::IAMCredentials::Rest::Client.new + # + module IAMCredentials + end + end + end + end +end + +helper_path = ::File.join __dir__, "iam_credentials", "helpers.rb" +require "google/iam/credentials/v1/iam_credentials/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-iam-credentials-v1/lib/google/iam/credentials/v1/iam_credentials/client.rb b/owl-bot-staging/google-iam-credentials-v1/lib/google/iam/credentials/v1/iam_credentials/client.rb new file mode 100644 index 000000000000..b1369925485c --- /dev/null +++ b/owl-bot-staging/google-iam-credentials-v1/lib/google/iam/credentials/v1/iam_credentials/client.rb @@ -0,0 +1,854 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/iam/credentials/v1/iamcredentials_pb" + +module Google + module Iam + module Credentials + module V1 + module IAMCredentials + ## + # Client for the IAMCredentials service. + # + # A service account is a special type of Google account that belongs to your + # application or a virtual machine (VM), instead of to an individual end user. + # Your application assumes the identity of the service account to call Google + # APIs, so that the users aren't directly involved. + # + # Service account credentials are used to temporarily assume the identity + # of the service account. Supported credential types include OAuth 2.0 access + # tokens, OpenID Connect ID tokens, self-signed JSON Web Tokens (JWTs), and + # more. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "iamcredentials.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :iam_credentials_stub + + ## + # Configure the IAMCredentials Client class. + # + # See {::Google::Iam::Credentials::V1::IAMCredentials::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all IAMCredentials clients + # ::Google::Iam::Credentials::V1::IAMCredentials::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", "Iam", "Credentials", "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.generate_access_token.timeout = 60.0 + default_config.rpcs.generate_access_token.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.generate_id_token.timeout = 60.0 + default_config.rpcs.generate_id_token.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.sign_blob.timeout = 60.0 + default_config.rpcs.sign_blob.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.sign_jwt.timeout = 60.0 + default_config.rpcs.sign_jwt.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 IAMCredentials 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::Iam::Credentials::V1::IAMCredentials::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 + @iam_credentials_stub.universe_domain + end + + ## + # Create a new IAMCredentials client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Iam::Credentials::V1::IAMCredentials::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Iam::Credentials::V1::IAMCredentials::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the IAMCredentials 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/iam/credentials/v1/iamcredentials_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 + + @iam_credentials_stub = ::Gapic::ServiceStub.new( + ::Google::Iam::Credentials::V1::IAMCredentials::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 + ) + + @iam_credentials_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 + end + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @iam_credentials_stub.logger + end + + # Service calls + + ## + # Generates an OAuth 2.0 access token for a service account. + # + # @overload generate_access_token(request, options = nil) + # Pass arguments to `generate_access_token` via a request object, either of type + # {::Google::Iam::Credentials::V1::GenerateAccessTokenRequest} or an equivalent Hash. + # + # @param request [::Google::Iam::Credentials::V1::GenerateAccessTokenRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_access_token(name: nil, delegates: nil, scope: nil, lifetime: nil) + # Pass arguments to `generate_access_token` via keyword arguments. Note that at + # least one keyword argument is 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 service account for which the credentials + # are requested, in the following format: + # `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`. The `-` wildcard + # character is required; replacing it with a project ID is invalid. + # @param delegates [::Array<::String>] + # The sequence of service accounts in a delegation chain. Each service + # account must be granted the `roles/iam.serviceAccountTokenCreator` role + # on its next service account in the chain. The last service account in the + # chain must be granted the `roles/iam.serviceAccountTokenCreator` role + # on the service account that is specified in the `name` field of the + # request. + # + # The delegates must have the following format: + # `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`. The `-` wildcard + # character is required; replacing it with a project ID is invalid. + # @param scope [::Array<::String>] + # Required. Code to identify the scopes to be included in the OAuth 2.0 access token. + # See https://developers.google.com/identity/protocols/googlescopes for more + # information. + # At least one value required. + # @param lifetime [::Google::Protobuf::Duration, ::Hash] + # The desired lifetime duration of the access token in seconds. + # Must be set to a value less than or equal to 3600 (1 hour). If a value is + # not specified, the token's lifetime will be set to a default value of one + # hour. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Iam::Credentials::V1::GenerateAccessTokenResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Iam::Credentials::V1::GenerateAccessTokenResponse] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/iam/credentials/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Iam::Credentials::V1::IAMCredentials::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Iam::Credentials::V1::GenerateAccessTokenRequest.new + # + # # Call the generate_access_token method. + # result = client.generate_access_token request + # + # # The returned object is of type Google::Iam::Credentials::V1::GenerateAccessTokenResponse. + # p result + # + def generate_access_token request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::Credentials::V1::GenerateAccessTokenRequest + + # Converts hash 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_access_token.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::Iam::Credentials::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.generate_access_token.timeout, + metadata: metadata, + retry_policy: @config.rpcs.generate_access_token.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @iam_credentials_stub.call_rpc :generate_access_token, 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 + + ## + # Generates an OpenID Connect ID token for a service account. + # + # @overload generate_id_token(request, options = nil) + # Pass arguments to `generate_id_token` via a request object, either of type + # {::Google::Iam::Credentials::V1::GenerateIdTokenRequest} or an equivalent Hash. + # + # @param request [::Google::Iam::Credentials::V1::GenerateIdTokenRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_id_token(name: nil, delegates: nil, audience: nil, include_email: nil) + # Pass arguments to `generate_id_token` via keyword arguments. Note that at + # least one keyword argument is 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 service account for which the credentials + # are requested, in the following format: + # `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`. The `-` wildcard + # character is required; replacing it with a project ID is invalid. + # @param delegates [::Array<::String>] + # The sequence of service accounts in a delegation chain. Each service + # account must be granted the `roles/iam.serviceAccountTokenCreator` role + # on its next service account in the chain. The last service account in the + # chain must be granted the `roles/iam.serviceAccountTokenCreator` role + # on the service account that is specified in the `name` field of the + # request. + # + # The delegates must have the following format: + # `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`. The `-` wildcard + # character is required; replacing it with a project ID is invalid. + # @param audience [::String] + # Required. The audience for the token, such as the API or account that this token + # grants access to. + # @param include_email [::Boolean] + # Include the service account email in the token. If set to `true`, the + # token will contain `email` and `email_verified` claims. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Iam::Credentials::V1::GenerateIdTokenResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Iam::Credentials::V1::GenerateIdTokenResponse] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/iam/credentials/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Iam::Credentials::V1::IAMCredentials::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Iam::Credentials::V1::GenerateIdTokenRequest.new + # + # # Call the generate_id_token method. + # result = client.generate_id_token request + # + # # The returned object is of type Google::Iam::Credentials::V1::GenerateIdTokenResponse. + # p result + # + def generate_id_token request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::Credentials::V1::GenerateIdTokenRequest + + # Converts hash 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_id_token.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::Iam::Credentials::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.generate_id_token.timeout, + metadata: metadata, + retry_policy: @config.rpcs.generate_id_token.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @iam_credentials_stub.call_rpc :generate_id_token, 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 a blob using a service account's system-managed private key. + # + # @overload sign_blob(request, options = nil) + # Pass arguments to `sign_blob` via a request object, either of type + # {::Google::Iam::Credentials::V1::SignBlobRequest} or an equivalent Hash. + # + # @param request [::Google::Iam::Credentials::V1::SignBlobRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload sign_blob(name: nil, delegates: nil, payload: nil) + # Pass arguments to `sign_blob` via keyword arguments. Note that at + # least one keyword argument is 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 service account for which the credentials + # are requested, in the following format: + # `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`. The `-` wildcard + # character is required; replacing it with a project ID is invalid. + # @param delegates [::Array<::String>] + # The sequence of service accounts in a delegation chain. Each service + # account must be granted the `roles/iam.serviceAccountTokenCreator` role + # on its next service account in the chain. The last service account in the + # chain must be granted the `roles/iam.serviceAccountTokenCreator` role + # on the service account that is specified in the `name` field of the + # request. + # + # The delegates must have the following format: + # `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`. The `-` wildcard + # character is required; replacing it with a project ID is invalid. + # @param payload [::String] + # Required. The bytes to sign. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Iam::Credentials::V1::SignBlobResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Iam::Credentials::V1::SignBlobResponse] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/iam/credentials/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Iam::Credentials::V1::IAMCredentials::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Iam::Credentials::V1::SignBlobRequest.new + # + # # Call the sign_blob method. + # result = client.sign_blob request + # + # # The returned object is of type Google::Iam::Credentials::V1::SignBlobResponse. + # p result + # + def sign_blob request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::Credentials::V1::SignBlobRequest + + # Converts hash 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.sign_blob.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::Iam::Credentials::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.sign_blob.timeout, + metadata: metadata, + retry_policy: @config.rpcs.sign_blob.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @iam_credentials_stub.call_rpc :sign_blob, 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 a JWT using a service account's system-managed private key. + # + # @overload sign_jwt(request, options = nil) + # Pass arguments to `sign_jwt` via a request object, either of type + # {::Google::Iam::Credentials::V1::SignJwtRequest} or an equivalent Hash. + # + # @param request [::Google::Iam::Credentials::V1::SignJwtRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload sign_jwt(name: nil, delegates: nil, payload: nil) + # Pass arguments to `sign_jwt` via keyword arguments. Note that at + # least one keyword argument is 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 service account for which the credentials + # are requested, in the following format: + # `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`. The `-` wildcard + # character is required; replacing it with a project ID is invalid. + # @param delegates [::Array<::String>] + # The sequence of service accounts in a delegation chain. Each service + # account must be granted the `roles/iam.serviceAccountTokenCreator` role + # on its next service account in the chain. The last service account in the + # chain must be granted the `roles/iam.serviceAccountTokenCreator` role + # on the service account that is specified in the `name` field of the + # request. + # + # The delegates must have the following format: + # `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`. The `-` wildcard + # character is required; replacing it with a project ID is invalid. + # @param payload [::String] + # Required. The JWT payload to sign: a JSON object that contains a JWT Claims Set. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Iam::Credentials::V1::SignJwtResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Iam::Credentials::V1::SignJwtResponse] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/iam/credentials/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Iam::Credentials::V1::IAMCredentials::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Iam::Credentials::V1::SignJwtRequest.new + # + # # Call the sign_jwt method. + # result = client.sign_jwt request + # + # # The returned object is of type Google::Iam::Credentials::V1::SignJwtResponse. + # p result + # + def sign_jwt request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::Credentials::V1::SignJwtRequest + + # Converts hash 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.sign_jwt.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::Iam::Credentials::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.sign_jwt.timeout, + metadata: metadata, + retry_policy: @config.rpcs.sign_jwt.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @iam_credentials_stub.call_rpc :sign_jwt, 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 IAMCredentials API. + # + # This class represents the configuration for IAMCredentials, + # 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::Iam::Credentials::V1::IAMCredentials::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 + # # generate_access_token to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Iam::Credentials::V1::IAMCredentials::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.generate_access_token.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Iam::Credentials::V1::IAMCredentials::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.generate_access_token.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::Iam::Credentials::V1::IAMCredentials::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 = "iamcredentials.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 IAMCredentials 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 `generate_access_token` + # @return [::Gapic::Config::Method] + # + attr_reader :generate_access_token + ## + # RPC-specific configuration for `generate_id_token` + # @return [::Gapic::Config::Method] + # + attr_reader :generate_id_token + ## + # RPC-specific configuration for `sign_blob` + # @return [::Gapic::Config::Method] + # + attr_reader :sign_blob + ## + # RPC-specific configuration for `sign_jwt` + # @return [::Gapic::Config::Method] + # + attr_reader :sign_jwt + + # @private + def initialize parent_rpcs = nil + generate_access_token_config = parent_rpcs.generate_access_token if parent_rpcs.respond_to? :generate_access_token + @generate_access_token = ::Gapic::Config::Method.new generate_access_token_config + generate_id_token_config = parent_rpcs.generate_id_token if parent_rpcs.respond_to? :generate_id_token + @generate_id_token = ::Gapic::Config::Method.new generate_id_token_config + sign_blob_config = parent_rpcs.sign_blob if parent_rpcs.respond_to? :sign_blob + @sign_blob = ::Gapic::Config::Method.new sign_blob_config + sign_jwt_config = parent_rpcs.sign_jwt if parent_rpcs.respond_to? :sign_jwt + @sign_jwt = ::Gapic::Config::Method.new sign_jwt_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-iam-credentials-v1/lib/google/iam/credentials/v1/iam_credentials/credentials.rb b/owl-bot-staging/google-iam-credentials-v1/lib/google/iam/credentials/v1/iam_credentials/credentials.rb new file mode 100644 index 000000000000..7cb79642525d --- /dev/null +++ b/owl-bot-staging/google-iam-credentials-v1/lib/google/iam/credentials/v1/iam_credentials/credentials.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! + +require "googleauth" + +module Google + module Iam + module Credentials + module V1 + module IAMCredentials + # Credentials for the IAMCredentials API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/cloud-platform" + ] + self.env_vars = [ + "IAM_CREDENTIALS_CREDENTIALS", + "IAM_CREDENTIALS_KEYFILE", + "GOOGLE_CLOUD_CREDENTIALS", + "GOOGLE_CLOUD_KEYFILE", + "GCLOUD_KEYFILE", + "IAM_CREDENTIALS_CREDENTIALS_JSON", + "IAM_CREDENTIALS_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-iam-credentials-v1/lib/google/iam/credentials/v1/iam_credentials/paths.rb b/owl-bot-staging/google-iam-credentials-v1/lib/google/iam/credentials/v1/iam_credentials/paths.rb new file mode 100644 index 000000000000..a57ff6ec11e5 --- /dev/null +++ b/owl-bot-staging/google-iam-credentials-v1/lib/google/iam/credentials/v1/iam_credentials/paths.rb @@ -0,0 +1,50 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Iam + module Credentials + module V1 + module IAMCredentials + # Path helper methods for the IAMCredentials API. + module Paths + ## + # Create a fully-qualified ServiceAccount resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/serviceAccounts/{service_account}` + # + # @param project [String] + # @param service_account [String] + # + # @return [::String] + def service_account_path project:, service_account: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + + "projects/#{project}/serviceAccounts/#{service_account}" + end + + extend self + end + end + end + end + end +end diff --git a/owl-bot-staging/google-iam-credentials-v1/lib/google/iam/credentials/v1/iam_credentials/rest.rb b/owl-bot-staging/google-iam-credentials-v1/lib/google/iam/credentials/v1/iam_credentials/rest.rb new file mode 100644 index 000000000000..80ffb5c62a94 --- /dev/null +++ b/owl-bot-staging/google-iam-credentials-v1/lib/google/iam/credentials/v1/iam_credentials/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/iam/credentials/v1/version" + +require "google/iam/credentials/v1/iam_credentials/credentials" +require "google/iam/credentials/v1/iam_credentials/paths" +require "google/iam/credentials/v1/iam_credentials/rest/client" + +module Google + module Iam + module Credentials + module V1 + ## + # A service account is a special type of Google account that belongs to your + # application or a virtual machine (VM), instead of to an individual end user. + # Your application assumes the identity of the service account to call Google + # APIs, so that the users aren't directly involved. + # + # Service account credentials are used to temporarily assume the identity + # of the service account. Supported credential types include OAuth 2.0 access + # tokens, OpenID Connect ID tokens, self-signed JSON Web Tokens (JWTs), and + # more. + # + # To load this service and instantiate a REST client: + # + # require "google/iam/credentials/v1/iam_credentials/rest" + # client = ::Google::Iam::Credentials::V1::IAMCredentials::Rest::Client.new + # + module IAMCredentials + # Client for the REST transport + module Rest + end + end + end + end + end +end + +helper_path = ::File.join __dir__, "rest", "helpers.rb" +require "google/iam/credentials/v1/iam_credentials/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-iam-credentials-v1/lib/google/iam/credentials/v1/iam_credentials/rest/client.rb b/owl-bot-staging/google-iam-credentials-v1/lib/google/iam/credentials/v1/iam_credentials/rest/client.rb new file mode 100644 index 000000000000..9771a2dee4a6 --- /dev/null +++ b/owl-bot-staging/google-iam-credentials-v1/lib/google/iam/credentials/v1/iam_credentials/rest/client.rb @@ -0,0 +1,783 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/iam/credentials/v1/iamcredentials_pb" +require "google/iam/credentials/v1/iam_credentials/rest/service_stub" + +module Google + module Iam + module Credentials + module V1 + module IAMCredentials + module Rest + ## + # REST client for the IAMCredentials service. + # + # A service account is a special type of Google account that belongs to your + # application or a virtual machine (VM), instead of to an individual end user. + # Your application assumes the identity of the service account to call Google + # APIs, so that the users aren't directly involved. + # + # Service account credentials are used to temporarily assume the identity + # of the service account. Supported credential types include OAuth 2.0 access + # tokens, OpenID Connect ID tokens, self-signed JSON Web Tokens (JWTs), and + # more. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "iamcredentials.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :iam_credentials_stub + + ## + # Configure the IAMCredentials Client class. + # + # See {::Google::Iam::Credentials::V1::IAMCredentials::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all IAMCredentials clients + # ::Google::Iam::Credentials::V1::IAMCredentials::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", "Iam", "Credentials", "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.generate_access_token.timeout = 60.0 + default_config.rpcs.generate_access_token.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.generate_id_token.timeout = 60.0 + default_config.rpcs.generate_id_token.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.sign_blob.timeout = 60.0 + default_config.rpcs.sign_blob.retry_policy = { + initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.sign_jwt.timeout = 60.0 + default_config.rpcs.sign_jwt.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 IAMCredentials 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::Iam::Credentials::V1::IAMCredentials::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 + @iam_credentials_stub.universe_domain + end + + ## + # Create a new IAMCredentials REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Iam::Credentials::V1::IAMCredentials::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Iam::Credentials::V1::IAMCredentials::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the IAMCredentials 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 + + @iam_credentials_stub = ::Google::Iam::Credentials::V1::IAMCredentials::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials, + logger: @config.logger + ) + + @iam_credentials_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 + end + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @iam_credentials_stub.logger + end + + # Service calls + + ## + # Generates an OAuth 2.0 access token for a service account. + # + # @overload generate_access_token(request, options = nil) + # Pass arguments to `generate_access_token` via a request object, either of type + # {::Google::Iam::Credentials::V1::GenerateAccessTokenRequest} or an equivalent Hash. + # + # @param request [::Google::Iam::Credentials::V1::GenerateAccessTokenRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_access_token(name: nil, delegates: nil, scope: nil, lifetime: nil) + # Pass arguments to `generate_access_token` via keyword arguments. Note that at + # least one keyword argument is 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 service account for which the credentials + # are requested, in the following format: + # `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`. The `-` wildcard + # character is required; replacing it with a project ID is invalid. + # @param delegates [::Array<::String>] + # The sequence of service accounts in a delegation chain. Each service + # account must be granted the `roles/iam.serviceAccountTokenCreator` role + # on its next service account in the chain. The last service account in the + # chain must be granted the `roles/iam.serviceAccountTokenCreator` role + # on the service account that is specified in the `name` field of the + # request. + # + # The delegates must have the following format: + # `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`. The `-` wildcard + # character is required; replacing it with a project ID is invalid. + # @param scope [::Array<::String>] + # Required. Code to identify the scopes to be included in the OAuth 2.0 access token. + # See https://developers.google.com/identity/protocols/googlescopes for more + # information. + # At least one value required. + # @param lifetime [::Google::Protobuf::Duration, ::Hash] + # The desired lifetime duration of the access token in seconds. + # Must be set to a value less than or equal to 3600 (1 hour). If a value is + # not specified, the token's lifetime will be set to a default value of one + # hour. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Iam::Credentials::V1::GenerateAccessTokenResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Iam::Credentials::V1::GenerateAccessTokenResponse] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/iam/credentials/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Iam::Credentials::V1::IAMCredentials::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Iam::Credentials::V1::GenerateAccessTokenRequest.new + # + # # Call the generate_access_token method. + # result = client.generate_access_token request + # + # # The returned object is of type Google::Iam::Credentials::V1::GenerateAccessTokenResponse. + # p result + # + def generate_access_token request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::Credentials::V1::GenerateAccessTokenRequest + + # Converts hash 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_access_token.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::Iam::Credentials::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_access_token.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.generate_access_token.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @iam_credentials_stub.generate_access_token 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 + + ## + # Generates an OpenID Connect ID token for a service account. + # + # @overload generate_id_token(request, options = nil) + # Pass arguments to `generate_id_token` via a request object, either of type + # {::Google::Iam::Credentials::V1::GenerateIdTokenRequest} or an equivalent Hash. + # + # @param request [::Google::Iam::Credentials::V1::GenerateIdTokenRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_id_token(name: nil, delegates: nil, audience: nil, include_email: nil) + # Pass arguments to `generate_id_token` via keyword arguments. Note that at + # least one keyword argument is 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 service account for which the credentials + # are requested, in the following format: + # `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`. The `-` wildcard + # character is required; replacing it with a project ID is invalid. + # @param delegates [::Array<::String>] + # The sequence of service accounts in a delegation chain. Each service + # account must be granted the `roles/iam.serviceAccountTokenCreator` role + # on its next service account in the chain. The last service account in the + # chain must be granted the `roles/iam.serviceAccountTokenCreator` role + # on the service account that is specified in the `name` field of the + # request. + # + # The delegates must have the following format: + # `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`. The `-` wildcard + # character is required; replacing it with a project ID is invalid. + # @param audience [::String] + # Required. The audience for the token, such as the API or account that this token + # grants access to. + # @param include_email [::Boolean] + # Include the service account email in the token. If set to `true`, the + # token will contain `email` and `email_verified` claims. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Iam::Credentials::V1::GenerateIdTokenResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Iam::Credentials::V1::GenerateIdTokenResponse] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/iam/credentials/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Iam::Credentials::V1::IAMCredentials::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Iam::Credentials::V1::GenerateIdTokenRequest.new + # + # # Call the generate_id_token method. + # result = client.generate_id_token request + # + # # The returned object is of type Google::Iam::Credentials::V1::GenerateIdTokenResponse. + # p result + # + def generate_id_token request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::Credentials::V1::GenerateIdTokenRequest + + # Converts hash 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_id_token.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::Iam::Credentials::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_id_token.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.generate_id_token.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @iam_credentials_stub.generate_id_token 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 a blob using a service account's system-managed private key. + # + # @overload sign_blob(request, options = nil) + # Pass arguments to `sign_blob` via a request object, either of type + # {::Google::Iam::Credentials::V1::SignBlobRequest} or an equivalent Hash. + # + # @param request [::Google::Iam::Credentials::V1::SignBlobRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload sign_blob(name: nil, delegates: nil, payload: nil) + # Pass arguments to `sign_blob` via keyword arguments. Note that at + # least one keyword argument is 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 service account for which the credentials + # are requested, in the following format: + # `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`. The `-` wildcard + # character is required; replacing it with a project ID is invalid. + # @param delegates [::Array<::String>] + # The sequence of service accounts in a delegation chain. Each service + # account must be granted the `roles/iam.serviceAccountTokenCreator` role + # on its next service account in the chain. The last service account in the + # chain must be granted the `roles/iam.serviceAccountTokenCreator` role + # on the service account that is specified in the `name` field of the + # request. + # + # The delegates must have the following format: + # `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`. The `-` wildcard + # character is required; replacing it with a project ID is invalid. + # @param payload [::String] + # Required. The bytes to sign. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Iam::Credentials::V1::SignBlobResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Iam::Credentials::V1::SignBlobResponse] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/iam/credentials/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Iam::Credentials::V1::IAMCredentials::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Iam::Credentials::V1::SignBlobRequest.new + # + # # Call the sign_blob method. + # result = client.sign_blob request + # + # # The returned object is of type Google::Iam::Credentials::V1::SignBlobResponse. + # p result + # + def sign_blob request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::Credentials::V1::SignBlobRequest + + # Converts hash 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.sign_blob.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::Iam::Credentials::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.sign_blob.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.sign_blob.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @iam_credentials_stub.sign_blob 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 a JWT using a service account's system-managed private key. + # + # @overload sign_jwt(request, options = nil) + # Pass arguments to `sign_jwt` via a request object, either of type + # {::Google::Iam::Credentials::V1::SignJwtRequest} or an equivalent Hash. + # + # @param request [::Google::Iam::Credentials::V1::SignJwtRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload sign_jwt(name: nil, delegates: nil, payload: nil) + # Pass arguments to `sign_jwt` via keyword arguments. Note that at + # least one keyword argument is 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 service account for which the credentials + # are requested, in the following format: + # `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`. The `-` wildcard + # character is required; replacing it with a project ID is invalid. + # @param delegates [::Array<::String>] + # The sequence of service accounts in a delegation chain. Each service + # account must be granted the `roles/iam.serviceAccountTokenCreator` role + # on its next service account in the chain. The last service account in the + # chain must be granted the `roles/iam.serviceAccountTokenCreator` role + # on the service account that is specified in the `name` field of the + # request. + # + # The delegates must have the following format: + # `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`. The `-` wildcard + # character is required; replacing it with a project ID is invalid. + # @param payload [::String] + # Required. The JWT payload to sign: a JSON object that contains a JWT Claims Set. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Iam::Credentials::V1::SignJwtResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Iam::Credentials::V1::SignJwtResponse] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/iam/credentials/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Iam::Credentials::V1::IAMCredentials::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Iam::Credentials::V1::SignJwtRequest.new + # + # # Call the sign_jwt method. + # result = client.sign_jwt request + # + # # The returned object is of type Google::Iam::Credentials::V1::SignJwtResponse. + # p result + # + def sign_jwt request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::Credentials::V1::SignJwtRequest + + # Converts hash 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.sign_jwt.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::Iam::Credentials::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.sign_jwt.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.sign_jwt.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @iam_credentials_stub.sign_jwt 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 IAMCredentials REST API. + # + # This class represents the configuration for IAMCredentials 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::Iam::Credentials::V1::IAMCredentials::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 + # # generate_access_token to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Iam::Credentials::V1::IAMCredentials::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.generate_access_token.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Iam::Credentials::V1::IAMCredentials::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.generate_access_token.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 = "iamcredentials.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 IAMCredentials 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 `generate_access_token` + # @return [::Gapic::Config::Method] + # + attr_reader :generate_access_token + ## + # RPC-specific configuration for `generate_id_token` + # @return [::Gapic::Config::Method] + # + attr_reader :generate_id_token + ## + # RPC-specific configuration for `sign_blob` + # @return [::Gapic::Config::Method] + # + attr_reader :sign_blob + ## + # RPC-specific configuration for `sign_jwt` + # @return [::Gapic::Config::Method] + # + attr_reader :sign_jwt + + # @private + def initialize parent_rpcs = nil + generate_access_token_config = parent_rpcs.generate_access_token if parent_rpcs.respond_to? :generate_access_token + @generate_access_token = ::Gapic::Config::Method.new generate_access_token_config + generate_id_token_config = parent_rpcs.generate_id_token if parent_rpcs.respond_to? :generate_id_token + @generate_id_token = ::Gapic::Config::Method.new generate_id_token_config + sign_blob_config = parent_rpcs.sign_blob if parent_rpcs.respond_to? :sign_blob + @sign_blob = ::Gapic::Config::Method.new sign_blob_config + sign_jwt_config = parent_rpcs.sign_jwt if parent_rpcs.respond_to? :sign_jwt + @sign_jwt = ::Gapic::Config::Method.new sign_jwt_config + + yield self if block_given? + end + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-iam-credentials-v1/lib/google/iam/credentials/v1/iam_credentials/rest/service_stub.rb b/owl-bot-staging/google-iam-credentials-v1/lib/google/iam/credentials/v1/iam_credentials/rest/service_stub.rb new file mode 100644 index 000000000000..c6cfe4454df2 --- /dev/null +++ b/owl-bot-staging/google-iam-credentials-v1/lib/google/iam/credentials/v1/iam_credentials/rest/service_stub.rb @@ -0,0 +1,329 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/iam/credentials/v1/iamcredentials_pb" + +module Google + module Iam + module Credentials + module V1 + module IAMCredentials + module Rest + ## + # REST service stub for the IAMCredentials 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 generate_access_token REST call + # + # @param request_pb [::Google::Iam::Credentials::V1::GenerateAccessTokenRequest] + # 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::Iam::Credentials::V1::GenerateAccessTokenResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Iam::Credentials::V1::GenerateAccessTokenResponse] + # A result object deserialized from the server's reply + def generate_access_token request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_generate_access_token_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_access_token", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Iam::Credentials::V1::GenerateAccessTokenResponse.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_id_token REST call + # + # @param request_pb [::Google::Iam::Credentials::V1::GenerateIdTokenRequest] + # 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::Iam::Credentials::V1::GenerateIdTokenResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Iam::Credentials::V1::GenerateIdTokenResponse] + # A result object deserialized from the server's reply + def generate_id_token request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_generate_id_token_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_id_token", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Iam::Credentials::V1::GenerateIdTokenResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the sign_blob REST call + # + # @param request_pb [::Google::Iam::Credentials::V1::SignBlobRequest] + # 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::Iam::Credentials::V1::SignBlobResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Iam::Credentials::V1::SignBlobResponse] + # A result object deserialized from the server's reply + def sign_blob request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_sign_blob_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: "sign_blob", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Iam::Credentials::V1::SignBlobResponse.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the sign_jwt REST call + # + # @param request_pb [::Google::Iam::Credentials::V1::SignJwtRequest] + # 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::Iam::Credentials::V1::SignJwtResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Iam::Credentials::V1::SignJwtResponse] + # A result object deserialized from the server's reply + def sign_jwt request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_sign_jwt_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: "sign_jwt", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Iam::Credentials::V1::SignJwtResponse.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 generate_access_token REST call + # + # @param request_pb [::Google::Iam::Credentials::V1::GenerateAccessTokenRequest] + # 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_access_token_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:generateAccessToken", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/serviceAccounts/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the generate_id_token REST call + # + # @param request_pb [::Google::Iam::Credentials::V1::GenerateIdTokenRequest] + # 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_id_token_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:generateIdToken", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/serviceAccounts/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the sign_blob REST call + # + # @param request_pb [::Google::Iam::Credentials::V1::SignBlobRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_sign_blob_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:signBlob", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/serviceAccounts/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the sign_jwt REST call + # + # @param request_pb [::Google::Iam::Credentials::V1::SignJwtRequest] + # A request object representing the call parameters. Required. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_sign_jwt_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{name}:signJwt", + body: "*", + matches: [ + ["name", %r{^projects/[^/]+/serviceAccounts/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-iam-credentials-v1/lib/google/iam/credentials/v1/iamcredentials_pb.rb b/owl-bot-staging/google-iam-credentials-v1/lib/google/iam/credentials/v1/iamcredentials_pb.rb new file mode 100644 index 000000000000..e27e78574f32 --- /dev/null +++ b/owl-bot-staging/google-iam-credentials-v1/lib/google/iam/credentials/v1/iamcredentials_pb.rb @@ -0,0 +1,24 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/iam/credentials/v1/iamcredentials.proto + +require 'google/protobuf' + +require 'google/api/annotations_pb' +require 'google/api/client_pb' +require 'google/iam/credentials/v1/common_pb' + + +descriptor_data = "\n.google/iam/credentials/v1/iamcredentials.proto\x12\x19google.iam.credentials.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a&google/iam/credentials/v1/common.proto2\xad\x07\n\x0eIAMCredentials\x12\xec\x01\n\x13GenerateAccessToken\x12\x35.google.iam.credentials.v1.GenerateAccessTokenRequest\x1a\x36.google.iam.credentials.v1.GenerateAccessTokenResponse\"f\xda\x41\x1dname,delegates,scope,lifetime\x82\xd3\xe4\x93\x02@\";/v1/{name=projects/*/serviceAccounts/*}:generateAccessToken:\x01*\x12\xe4\x01\n\x0fGenerateIdToken\x12\x31.google.iam.credentials.v1.GenerateIdTokenRequest\x1a\x32.google.iam.credentials.v1.GenerateIdTokenResponse\"j\xda\x41%name,delegates,audience,include_email\x82\xd3\xe4\x93\x02<\"7/v1/{name=projects/*/serviceAccounts/*}:generateIdToken:\x01*\x12\xb9\x01\n\x08SignBlob\x12*.google.iam.credentials.v1.SignBlobRequest\x1a+.google.iam.credentials.v1.SignBlobResponse\"T\xda\x41\x16name,delegates,payload\x82\xd3\xe4\x93\x02\x35\"0/v1/{name=projects/*/serviceAccounts/*}:signBlob:\x01*\x12\xb5\x01\n\x07SignJwt\x12).google.iam.credentials.v1.SignJwtRequest\x1a*.google.iam.credentials.v1.SignJwtResponse\"S\xda\x41\x16name,delegates,payload\x82\xd3\xe4\x93\x02\x34\"//v1/{name=projects/*/serviceAccounts/*}:signJwt:\x01*\x1aQ\xca\x41\x1diamcredentials.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\xca\x01\n#com.google.cloud.iam.credentials.v1B\x13IAMCredentialsProtoP\x01ZEcloud.google.com/go/iam/credentials/apiv1/credentialspb;credentialspb\xf8\x01\x01\xaa\x02\x1fGoogle.Cloud.Iam.Credentials.V1\xca\x02\x1fGoogle\\Cloud\\Iam\\Credentials\\V1b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Iam + module Credentials + module V1 + end + end + end +end diff --git a/owl-bot-staging/google-iam-credentials-v1/lib/google/iam/credentials/v1/iamcredentials_services_pb.rb b/owl-bot-staging/google-iam-credentials-v1/lib/google/iam/credentials/v1/iamcredentials_services_pb.rb new file mode 100644 index 000000000000..a550a8f0fcfe --- /dev/null +++ b/owl-bot-staging/google-iam-credentials-v1/lib/google/iam/credentials/v1/iamcredentials_services_pb.rb @@ -0,0 +1,59 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/iam/credentials/v1/iamcredentials.proto for package 'google.iam.credentials.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/iam/credentials/v1/iamcredentials_pb' + +module Google + module Iam + module Credentials + module V1 + module IAMCredentials + # A service account is a special type of Google account that belongs to your + # application or a virtual machine (VM), instead of to an individual end user. + # Your application assumes the identity of the service account to call Google + # APIs, so that the users aren't directly involved. + # + # Service account credentials are used to temporarily assume the identity + # of the service account. Supported credential types include OAuth 2.0 access + # tokens, OpenID Connect ID tokens, self-signed JSON Web Tokens (JWTs), and + # more. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.iam.credentials.v1.IAMCredentials' + + # Generates an OAuth 2.0 access token for a service account. + rpc :GenerateAccessToken, ::Google::Iam::Credentials::V1::GenerateAccessTokenRequest, ::Google::Iam::Credentials::V1::GenerateAccessTokenResponse + # Generates an OpenID Connect ID token for a service account. + rpc :GenerateIdToken, ::Google::Iam::Credentials::V1::GenerateIdTokenRequest, ::Google::Iam::Credentials::V1::GenerateIdTokenResponse + # Signs a blob using a service account's system-managed private key. + rpc :SignBlob, ::Google::Iam::Credentials::V1::SignBlobRequest, ::Google::Iam::Credentials::V1::SignBlobResponse + # Signs a JWT using a service account's system-managed private key. + rpc :SignJwt, ::Google::Iam::Credentials::V1::SignJwtRequest, ::Google::Iam::Credentials::V1::SignJwtResponse + end + + Stub = Service.rpc_stub_class + end + end + end + end +end diff --git a/owl-bot-staging/google-iam-credentials-v1/lib/google/iam/credentials/v1/rest.rb b/owl-bot-staging/google-iam-credentials-v1/lib/google/iam/credentials/v1/rest.rb new file mode 100644 index 000000000000..68ade197545e --- /dev/null +++ b/owl-bot-staging/google-iam-credentials-v1/lib/google/iam/credentials/v1/rest.rb @@ -0,0 +1,37 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/iam/credentials/v1/iam_credentials/rest" +require "google/iam/credentials/v1/version" + +module Google + module Iam + module Credentials + ## + # To load just the REST part of this package, including all its services, and instantiate a REST client: + # + # @example + # + # require "google/iam/credentials/v1/rest" + # client = ::Google::Iam::Credentials::V1::IAMCredentials::Rest::Client.new + # + module V1 + end + end + end +end diff --git a/owl-bot-staging/google-iam-credentials-v1/lib/google/iam/credentials/v1/version.rb b/owl-bot-staging/google-iam-credentials-v1/lib/google/iam/credentials/v1/version.rb new file mode 100644 index 000000000000..8e69fe1e8479 --- /dev/null +++ b/owl-bot-staging/google-iam-credentials-v1/lib/google/iam/credentials/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 Iam + module Credentials + module V1 + VERSION = "0.0.1" + end + end + end +end diff --git a/owl-bot-staging/google-iam-credentials-v1/proto_docs/README.md b/owl-bot-staging/google-iam-credentials-v1/proto_docs/README.md new file mode 100644 index 000000000000..b9037a182cf2 --- /dev/null +++ b/owl-bot-staging/google-iam-credentials-v1/proto_docs/README.md @@ -0,0 +1,4 @@ +# IAM Service Account Credentials 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-iam-credentials-v1/proto_docs/google/api/client.rb b/owl-bot-staging/google-iam-credentials-v1/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..3ab0b096d445 --- /dev/null +++ b/owl-bot-staging/google-iam-credentials-v1/proto_docs/google/api/client.rb @@ -0,0 +1,593 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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. + # + # Note: This field should not be used in most cases. + 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: + # library_settings: + # 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. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Php. Clobbers the php_namespace option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.php.package_name" field + # in gapic.yaml. API teams should use the protobuf php_namespace option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # library_settings: + # php_settings: + # library_package: Google\Cloud\PubSub\V1 + 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. + # + # Example: + # + # 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 + # @!attribute [rw] batching + # @return [::Google::Api::BatchingConfigProto] + # Batching configuration for an API method in client libraries. + # + # Example of a YAML configuration: + # + # publishing: + # method_settings: + # - selector: google.example.v1.ExampleService.BatchCreateExample + # batching: + # element_count_threshold: 1000 + # request_byte_threshold: 100000000 + # delay_threshold_millis: 10 + 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. + # + # Note: This feature should not be used in most cases. + # @!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 + + # `BatchingConfigProto` defines the batching configuration for an API method. + # @!attribute [rw] thresholds + # @return [::Google::Api::BatchingSettingsProto] + # The thresholds which trigger a batched request to be sent. + # @!attribute [rw] batch_descriptor + # @return [::Google::Api::BatchingDescriptorProto] + # The request and response fields used in batching. + class BatchingConfigProto + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `BatchingSettingsProto` specifies a set of batching thresholds, each of + # which acts as a trigger to send a batch of messages as a request. At least + # one threshold must be positive nonzero. + # @!attribute [rw] element_count_threshold + # @return [::Integer] + # The number of elements of a field collected into a batch which, if + # exceeded, causes the batch to be sent. + # @!attribute [rw] request_byte_threshold + # @return [::Integer] + # The aggregated size of the batched field which, if exceeded, causes the + # batch to be sent. This size is computed by aggregating the sizes of the + # request field to be batched, not of the entire request message. + # @!attribute [rw] delay_threshold + # @return [::Google::Protobuf::Duration] + # The duration after which a batch should be sent, starting from the addition + # of the first message to that batch. + # @!attribute [rw] element_count_limit + # @return [::Integer] + # The maximum number of elements collected in a batch that could be accepted + # by server. + # @!attribute [rw] request_byte_limit + # @return [::Integer] + # The maximum size of the request that could be accepted by server. + # @!attribute [rw] flow_control_element_limit + # @return [::Integer] + # The maximum number of elements allowed by flow control. + # @!attribute [rw] flow_control_byte_limit + # @return [::Integer] + # The maximum size of data allowed by flow control. + # @!attribute [rw] flow_control_limit_exceeded_behavior + # @return [::Google::Api::FlowControlLimitExceededBehaviorProto] + # The behavior to take when the flow control limit is exceeded. + class BatchingSettingsProto + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `BatchingDescriptorProto` specifies the fields of the request message to be + # used for batching, and, optionally, the fields of the response message to be + # used for demultiplexing. + # @!attribute [rw] batched_field + # @return [::String] + # The repeated field in the request message to be aggregated by batching. + # @!attribute [rw] discriminator_fields + # @return [::Array<::String>] + # A list of the fields in the request message. Two requests will be batched + # together only if the values of every field specified in + # `request_discriminator_fields` is equal between the two requests. + # @!attribute [rw] subresponse_field + # @return [::String] + # Optional. When present, indicates the field in the response message to be + # used to demultiplex the response into multiple response messages, in + # correspondence with the multiple request messages originally batched + # together. + class BatchingDescriptorProto + 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 + + # The behavior to take when the flow control limit is exceeded. + module FlowControlLimitExceededBehaviorProto + # Default behavior, system-defined. + UNSET_BEHAVIOR = 0 + + # Stop operation, raise error. + THROW_EXCEPTION = 1 + + # Pause operation until limit clears. + BLOCK = 2 + + # Continue operation, disregard limit. + IGNORE = 3 + end + end +end diff --git a/owl-bot-staging/google-iam-credentials-v1/proto_docs/google/api/field_behavior.rb b/owl-bot-staging/google-iam-credentials-v1/proto_docs/google/api/field_behavior.rb new file mode 100644 index 000000000000..582be187d115 --- /dev/null +++ b/owl-bot-staging/google-iam-credentials-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-iam-credentials-v1/proto_docs/google/api/launch_stage.rb b/owl-bot-staging/google-iam-credentials-v1/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..9392a413fb1b --- /dev/null +++ b/owl-bot-staging/google-iam-credentials-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-iam-credentials-v1/proto_docs/google/api/resource.rb b/owl-bot-staging/google-iam-credentials-v1/proto_docs/google/api/resource.rb new file mode 100644 index 000000000000..25dec4847ac1 --- /dev/null +++ b/owl-bot-staging/google-iam-credentials-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-iam-credentials-v1/proto_docs/google/iam/credentials/v1/common.rb b/owl-bot-staging/google-iam-credentials-v1/proto_docs/google/iam/credentials/v1/common.rb new file mode 100644 index 000000000000..87dc4a4ab1ff --- /dev/null +++ b/owl-bot-staging/google-iam-credentials-v1/proto_docs/google/iam/credentials/v1/common.rb @@ -0,0 +1,186 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Iam + module Credentials + module V1 + # @!attribute [rw] name + # @return [::String] + # Required. The resource name of the service account for which the credentials + # are requested, in the following format: + # `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`. The `-` wildcard + # character is required; replacing it with a project ID is invalid. + # @!attribute [rw] delegates + # @return [::Array<::String>] + # The sequence of service accounts in a delegation chain. Each service + # account must be granted the `roles/iam.serviceAccountTokenCreator` role + # on its next service account in the chain. The last service account in the + # chain must be granted the `roles/iam.serviceAccountTokenCreator` role + # on the service account that is specified in the `name` field of the + # request. + # + # The delegates must have the following format: + # `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`. The `-` wildcard + # character is required; replacing it with a project ID is invalid. + # @!attribute [rw] scope + # @return [::Array<::String>] + # Required. Code to identify the scopes to be included in the OAuth 2.0 access token. + # See https://developers.google.com/identity/protocols/googlescopes for more + # information. + # At least one value required. + # @!attribute [rw] lifetime + # @return [::Google::Protobuf::Duration] + # The desired lifetime duration of the access token in seconds. + # Must be set to a value less than or equal to 3600 (1 hour). If a value is + # not specified, the token's lifetime will be set to a default value of one + # hour. + class GenerateAccessTokenRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] access_token + # @return [::String] + # The OAuth 2.0 access token. + # @!attribute [rw] expire_time + # @return [::Google::Protobuf::Timestamp] + # Token expiration time. + # The expiration time is always set. + class GenerateAccessTokenResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] name + # @return [::String] + # Required. The resource name of the service account for which the credentials + # are requested, in the following format: + # `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`. The `-` wildcard + # character is required; replacing it with a project ID is invalid. + # @!attribute [rw] delegates + # @return [::Array<::String>] + # The sequence of service accounts in a delegation chain. Each service + # account must be granted the `roles/iam.serviceAccountTokenCreator` role + # on its next service account in the chain. The last service account in the + # chain must be granted the `roles/iam.serviceAccountTokenCreator` role + # on the service account that is specified in the `name` field of the + # request. + # + # The delegates must have the following format: + # `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`. The `-` wildcard + # character is required; replacing it with a project ID is invalid. + # @!attribute [rw] payload + # @return [::String] + # Required. The bytes to sign. + class SignBlobRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] key_id + # @return [::String] + # The ID of the key used to sign the blob. + # @!attribute [rw] signed_blob + # @return [::String] + # The signed blob. + class SignBlobResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] name + # @return [::String] + # Required. The resource name of the service account for which the credentials + # are requested, in the following format: + # `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`. The `-` wildcard + # character is required; replacing it with a project ID is invalid. + # @!attribute [rw] delegates + # @return [::Array<::String>] + # The sequence of service accounts in a delegation chain. Each service + # account must be granted the `roles/iam.serviceAccountTokenCreator` role + # on its next service account in the chain. The last service account in the + # chain must be granted the `roles/iam.serviceAccountTokenCreator` role + # on the service account that is specified in the `name` field of the + # request. + # + # The delegates must have the following format: + # `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`. The `-` wildcard + # character is required; replacing it with a project ID is invalid. + # @!attribute [rw] payload + # @return [::String] + # Required. The JWT payload to sign: a JSON object that contains a JWT Claims Set. + class SignJwtRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] key_id + # @return [::String] + # The ID of the key used to sign the JWT. + # @!attribute [rw] signed_jwt + # @return [::String] + # The signed JWT. + class SignJwtResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] name + # @return [::String] + # Required. The resource name of the service account for which the credentials + # are requested, in the following format: + # `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`. The `-` wildcard + # character is required; replacing it with a project ID is invalid. + # @!attribute [rw] delegates + # @return [::Array<::String>] + # The sequence of service accounts in a delegation chain. Each service + # account must be granted the `roles/iam.serviceAccountTokenCreator` role + # on its next service account in the chain. The last service account in the + # chain must be granted the `roles/iam.serviceAccountTokenCreator` role + # on the service account that is specified in the `name` field of the + # request. + # + # The delegates must have the following format: + # `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`. The `-` wildcard + # character is required; replacing it with a project ID is invalid. + # @!attribute [rw] audience + # @return [::String] + # Required. The audience for the token, such as the API or account that this token + # grants access to. + # @!attribute [rw] include_email + # @return [::Boolean] + # Include the service account email in the token. If set to `true`, the + # token will contain `email` and `email_verified` claims. + class GenerateIdTokenRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] token + # @return [::String] + # The OpenId Connect ID token. + class GenerateIdTokenResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end + end +end diff --git a/owl-bot-staging/google-iam-credentials-v1/proto_docs/google/protobuf/duration.rb b/owl-bot-staging/google-iam-credentials-v1/proto_docs/google/protobuf/duration.rb new file mode 100644 index 000000000000..ea59f1f91daf --- /dev/null +++ b/owl-bot-staging/google-iam-credentials-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-iam-credentials-v1/proto_docs/google/protobuf/timestamp.rb b/owl-bot-staging/google-iam-credentials-v1/proto_docs/google/protobuf/timestamp.rb new file mode 100644 index 000000000000..74352be9c58c --- /dev/null +++ b/owl-bot-staging/google-iam-credentials-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-iam-credentials-v1/snippets/Gemfile b/owl-bot-staging/google-iam-credentials-v1/snippets/Gemfile new file mode 100644 index 000000000000..68414f33ff49 --- /dev/null +++ b/owl-bot-staging/google-iam-credentials-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-iam-credentials-v1", path: "../" +else + gem "google-iam-credentials-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-iam-credentials-v1/snippets/iam_credentials/generate_access_token.rb b/owl-bot-staging/google-iam-credentials-v1/snippets/iam_credentials/generate_access_token.rb new file mode 100644 index 000000000000..9ba589bd6910 --- /dev/null +++ b/owl-bot-staging/google-iam-credentials-v1/snippets/iam_credentials/generate_access_token.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 iamcredentials_v1_generated_IAMCredentials_GenerateAccessToken_sync] +require "google/iam/credentials/v1" + +## +# Snippet for the generate_access_token call in the IAMCredentials 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::Iam::Credentials::V1::IAMCredentials::Client#generate_access_token. +# +def generate_access_token + # Create a client object. The client can be reused for multiple calls. + client = Google::Iam::Credentials::V1::IAMCredentials::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::Credentials::V1::GenerateAccessTokenRequest.new + + # Call the generate_access_token method. + result = client.generate_access_token request + + # The returned object is of type Google::Iam::Credentials::V1::GenerateAccessTokenResponse. + p result +end +# [END iamcredentials_v1_generated_IAMCredentials_GenerateAccessToken_sync] diff --git a/owl-bot-staging/google-iam-credentials-v1/snippets/iam_credentials/generate_id_token.rb b/owl-bot-staging/google-iam-credentials-v1/snippets/iam_credentials/generate_id_token.rb new file mode 100644 index 000000000000..4a1c3491483f --- /dev/null +++ b/owl-bot-staging/google-iam-credentials-v1/snippets/iam_credentials/generate_id_token.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 iamcredentials_v1_generated_IAMCredentials_GenerateIdToken_sync] +require "google/iam/credentials/v1" + +## +# Snippet for the generate_id_token call in the IAMCredentials 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::Iam::Credentials::V1::IAMCredentials::Client#generate_id_token. +# +def generate_id_token + # Create a client object. The client can be reused for multiple calls. + client = Google::Iam::Credentials::V1::IAMCredentials::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::Credentials::V1::GenerateIdTokenRequest.new + + # Call the generate_id_token method. + result = client.generate_id_token request + + # The returned object is of type Google::Iam::Credentials::V1::GenerateIdTokenResponse. + p result +end +# [END iamcredentials_v1_generated_IAMCredentials_GenerateIdToken_sync] diff --git a/owl-bot-staging/google-iam-credentials-v1/snippets/iam_credentials/sign_blob.rb b/owl-bot-staging/google-iam-credentials-v1/snippets/iam_credentials/sign_blob.rb new file mode 100644 index 000000000000..27272c74919b --- /dev/null +++ b/owl-bot-staging/google-iam-credentials-v1/snippets/iam_credentials/sign_blob.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 iamcredentials_v1_generated_IAMCredentials_SignBlob_sync] +require "google/iam/credentials/v1" + +## +# Snippet for the sign_blob call in the IAMCredentials 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::Iam::Credentials::V1::IAMCredentials::Client#sign_blob. +# +def sign_blob + # Create a client object. The client can be reused for multiple calls. + client = Google::Iam::Credentials::V1::IAMCredentials::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::Credentials::V1::SignBlobRequest.new + + # Call the sign_blob method. + result = client.sign_blob request + + # The returned object is of type Google::Iam::Credentials::V1::SignBlobResponse. + p result +end +# [END iamcredentials_v1_generated_IAMCredentials_SignBlob_sync] diff --git a/owl-bot-staging/google-iam-credentials-v1/snippets/iam_credentials/sign_jwt.rb b/owl-bot-staging/google-iam-credentials-v1/snippets/iam_credentials/sign_jwt.rb new file mode 100644 index 000000000000..806a57c1515f --- /dev/null +++ b/owl-bot-staging/google-iam-credentials-v1/snippets/iam_credentials/sign_jwt.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 iamcredentials_v1_generated_IAMCredentials_SignJwt_sync] +require "google/iam/credentials/v1" + +## +# Snippet for the sign_jwt call in the IAMCredentials 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::Iam::Credentials::V1::IAMCredentials::Client#sign_jwt. +# +def sign_jwt + # Create a client object. The client can be reused for multiple calls. + client = Google::Iam::Credentials::V1::IAMCredentials::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::Credentials::V1::SignJwtRequest.new + + # Call the sign_jwt method. + result = client.sign_jwt request + + # The returned object is of type Google::Iam::Credentials::V1::SignJwtResponse. + p result +end +# [END iamcredentials_v1_generated_IAMCredentials_SignJwt_sync] diff --git a/owl-bot-staging/google-iam-credentials-v1/snippets/snippet_metadata_google.iam.credentials.v1.json b/owl-bot-staging/google-iam-credentials-v1/snippets/snippet_metadata_google.iam.credentials.v1.json new file mode 100644 index 000000000000..6ca1e368089a --- /dev/null +++ b/owl-bot-staging/google-iam-credentials-v1/snippets/snippet_metadata_google.iam.credentials.v1.json @@ -0,0 +1,175 @@ +{ + "client_library": { + "name": "google-iam-credentials-v1", + "version": "", + "language": "RUBY", + "apis": [ + { + "id": "google.iam.credentials.v1", + "version": "v1" + } + ] + }, + "snippets": [ + { + "region_tag": "iamcredentials_v1_generated_IAMCredentials_GenerateAccessToken_sync", + "title": "Snippet for the generate_access_token call in the IAMCredentials service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Iam::Credentials::V1::IAMCredentials::Client#generate_access_token.", + "file": "iam_credentials/generate_access_token.rb", + "language": "RUBY", + "client_method": { + "short_name": "generate_access_token", + "full_name": "::Google::Iam::Credentials::V1::IAMCredentials::Client#generate_access_token", + "async": false, + "parameters": [ + { + "type": "::Google::Iam::Credentials::V1::GenerateAccessTokenRequest", + "name": "request" + } + ], + "result_type": "::Google::Iam::Credentials::V1::GenerateAccessTokenResponse", + "client": { + "short_name": "IAMCredentials::Client", + "full_name": "::Google::Iam::Credentials::V1::IAMCredentials::Client" + }, + "method": { + "short_name": "GenerateAccessToken", + "full_name": "google.iam.credentials.v1.IAMCredentials.GenerateAccessToken", + "service": { + "short_name": "IAMCredentials", + "full_name": "google.iam.credentials.v1.IAMCredentials" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "iamcredentials_v1_generated_IAMCredentials_GenerateIdToken_sync", + "title": "Snippet for the generate_id_token call in the IAMCredentials service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Iam::Credentials::V1::IAMCredentials::Client#generate_id_token.", + "file": "iam_credentials/generate_id_token.rb", + "language": "RUBY", + "client_method": { + "short_name": "generate_id_token", + "full_name": "::Google::Iam::Credentials::V1::IAMCredentials::Client#generate_id_token", + "async": false, + "parameters": [ + { + "type": "::Google::Iam::Credentials::V1::GenerateIdTokenRequest", + "name": "request" + } + ], + "result_type": "::Google::Iam::Credentials::V1::GenerateIdTokenResponse", + "client": { + "short_name": "IAMCredentials::Client", + "full_name": "::Google::Iam::Credentials::V1::IAMCredentials::Client" + }, + "method": { + "short_name": "GenerateIdToken", + "full_name": "google.iam.credentials.v1.IAMCredentials.GenerateIdToken", + "service": { + "short_name": "IAMCredentials", + "full_name": "google.iam.credentials.v1.IAMCredentials" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "iamcredentials_v1_generated_IAMCredentials_SignBlob_sync", + "title": "Snippet for the sign_blob call in the IAMCredentials service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Iam::Credentials::V1::IAMCredentials::Client#sign_blob.", + "file": "iam_credentials/sign_blob.rb", + "language": "RUBY", + "client_method": { + "short_name": "sign_blob", + "full_name": "::Google::Iam::Credentials::V1::IAMCredentials::Client#sign_blob", + "async": false, + "parameters": [ + { + "type": "::Google::Iam::Credentials::V1::SignBlobRequest", + "name": "request" + } + ], + "result_type": "::Google::Iam::Credentials::V1::SignBlobResponse", + "client": { + "short_name": "IAMCredentials::Client", + "full_name": "::Google::Iam::Credentials::V1::IAMCredentials::Client" + }, + "method": { + "short_name": "SignBlob", + "full_name": "google.iam.credentials.v1.IAMCredentials.SignBlob", + "service": { + "short_name": "IAMCredentials", + "full_name": "google.iam.credentials.v1.IAMCredentials" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "iamcredentials_v1_generated_IAMCredentials_SignJwt_sync", + "title": "Snippet for the sign_jwt call in the IAMCredentials service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Iam::Credentials::V1::IAMCredentials::Client#sign_jwt.", + "file": "iam_credentials/sign_jwt.rb", + "language": "RUBY", + "client_method": { + "short_name": "sign_jwt", + "full_name": "::Google::Iam::Credentials::V1::IAMCredentials::Client#sign_jwt", + "async": false, + "parameters": [ + { + "type": "::Google::Iam::Credentials::V1::SignJwtRequest", + "name": "request" + } + ], + "result_type": "::Google::Iam::Credentials::V1::SignJwtResponse", + "client": { + "short_name": "IAMCredentials::Client", + "full_name": "::Google::Iam::Credentials::V1::IAMCredentials::Client" + }, + "method": { + "short_name": "SignJwt", + "full_name": "google.iam.credentials.v1.IAMCredentials.SignJwt", + "service": { + "short_name": "IAMCredentials", + "full_name": "google.iam.credentials.v1.IAMCredentials" + } + } + }, + "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-iam-credentials-v1/test/google/iam/credentials/v1/iam_credentials_paths_test.rb b/owl-bot-staging/google-iam-credentials-v1/test/google/iam/credentials/v1/iam_credentials_paths_test.rb new file mode 100644 index 000000000000..3a872d20e5a0 --- /dev/null +++ b/owl-bot-staging/google-iam-credentials-v1/test/google/iam/credentials/v1/iam_credentials_paths_test.rb @@ -0,0 +1,55 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/iam/credentials/v1/iam_credentials" + +class ::Google::Iam::Credentials::V1::IAMCredentials::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_service_account_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Iam::Credentials::V1::IAMCredentials::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.service_account_path project: "value0", service_account: "value1" + assert_equal "projects/value0/serviceAccounts/value1", path + end + end +end diff --git a/owl-bot-staging/google-iam-credentials-v1/test/google/iam/credentials/v1/iam_credentials_rest_test.rb b/owl-bot-staging/google-iam-credentials-v1/test/google/iam/credentials/v1/iam_credentials_rest_test.rb new file mode 100644 index 000000000000..1c350f0ecfba --- /dev/null +++ b/owl-bot-staging/google-iam-credentials-v1/test/google/iam/credentials/v1/iam_credentials_rest_test.rb @@ -0,0 +1,325 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/iam/credentials/v1/iamcredentials_pb" +require "google/iam/credentials/v1/iam_credentials/rest" + + +class ::Google::Iam::Credentials::V1::IAMCredentials::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_generate_access_token + # Create test objects. + client_result = ::Google::Iam::Credentials::V1::GenerateAccessTokenResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + delegates = ["hello world"] + scope = ["hello world"] + lifetime = {} + + generate_access_token_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::Iam::Credentials::V1::IAMCredentials::Rest::ServiceStub.stub :transcode_generate_access_token_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, generate_access_token_client_stub do + # Create client + client = ::Google::Iam::Credentials::V1::IAMCredentials::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.generate_access_token({ name: name, delegates: delegates, scope: scope, lifetime: lifetime }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.generate_access_token name: name, delegates: delegates, scope: scope, lifetime: lifetime do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.generate_access_token ::Google::Iam::Credentials::V1::GenerateAccessTokenRequest.new(name: name, delegates: delegates, scope: scope, lifetime: lifetime) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.generate_access_token({ name: name, delegates: delegates, scope: scope, lifetime: lifetime }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.generate_access_token(::Google::Iam::Credentials::V1::GenerateAccessTokenRequest.new(name: name, delegates: delegates, scope: scope, lifetime: lifetime), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, generate_access_token_client_stub.call_count + end + end + end + + def test_generate_id_token + # Create test objects. + client_result = ::Google::Iam::Credentials::V1::GenerateIdTokenResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + delegates = ["hello world"] + audience = "hello world" + include_email = true + + generate_id_token_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::Iam::Credentials::V1::IAMCredentials::Rest::ServiceStub.stub :transcode_generate_id_token_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, generate_id_token_client_stub do + # Create client + client = ::Google::Iam::Credentials::V1::IAMCredentials::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.generate_id_token({ name: name, delegates: delegates, audience: audience, include_email: include_email }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.generate_id_token name: name, delegates: delegates, audience: audience, include_email: include_email do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.generate_id_token ::Google::Iam::Credentials::V1::GenerateIdTokenRequest.new(name: name, delegates: delegates, audience: audience, include_email: include_email) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.generate_id_token({ name: name, delegates: delegates, audience: audience, include_email: include_email }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.generate_id_token(::Google::Iam::Credentials::V1::GenerateIdTokenRequest.new(name: name, delegates: delegates, audience: audience, include_email: include_email), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, generate_id_token_client_stub.call_count + end + end + end + + def test_sign_blob + # Create test objects. + client_result = ::Google::Iam::Credentials::V1::SignBlobResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + delegates = ["hello world"] + payload = "hello world" + + sign_blob_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::Iam::Credentials::V1::IAMCredentials::Rest::ServiceStub.stub :transcode_sign_blob_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, sign_blob_client_stub do + # Create client + client = ::Google::Iam::Credentials::V1::IAMCredentials::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.sign_blob({ name: name, delegates: delegates, payload: payload }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.sign_blob name: name, delegates: delegates, payload: payload do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.sign_blob ::Google::Iam::Credentials::V1::SignBlobRequest.new(name: name, delegates: delegates, payload: payload) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.sign_blob({ name: name, delegates: delegates, payload: payload }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.sign_blob(::Google::Iam::Credentials::V1::SignBlobRequest.new(name: name, delegates: delegates, payload: payload), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, sign_blob_client_stub.call_count + end + end + end + + def test_sign_jwt + # Create test objects. + client_result = ::Google::Iam::Credentials::V1::SignJwtResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + delegates = ["hello world"] + payload = "hello world" + + sign_jwt_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::Iam::Credentials::V1::IAMCredentials::Rest::ServiceStub.stub :transcode_sign_jwt_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, sign_jwt_client_stub do + # Create client + client = ::Google::Iam::Credentials::V1::IAMCredentials::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.sign_jwt({ name: name, delegates: delegates, payload: payload }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.sign_jwt name: name, delegates: delegates, payload: payload do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.sign_jwt ::Google::Iam::Credentials::V1::SignJwtRequest.new(name: name, delegates: delegates, payload: payload) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.sign_jwt({ name: name, delegates: delegates, payload: payload }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.sign_jwt(::Google::Iam::Credentials::V1::SignJwtRequest.new(name: name, delegates: delegates, payload: payload), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, sign_jwt_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::Iam::Credentials::V1::IAMCredentials::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::Iam::Credentials::V1::IAMCredentials::Rest::Client::Configuration, config + end +end diff --git a/owl-bot-staging/google-iam-credentials-v1/test/google/iam/credentials/v1/iam_credentials_test.rb b/owl-bot-staging/google-iam-credentials-v1/test/google/iam/credentials/v1/iam_credentials_test.rb new file mode 100644 index 000000000000..3953d3ced1aa --- /dev/null +++ b/owl-bot-staging/google-iam-credentials-v1/test/google/iam/credentials/v1/iam_credentials_test.rb @@ -0,0 +1,356 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/iam/credentials/v1/iamcredentials_pb" +require "google/iam/credentials/v1/iam_credentials" + +class ::Google::Iam::Credentials::V1::IAMCredentials::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_generate_access_token + # Create GRPC objects. + grpc_response = ::Google::Iam::Credentials::V1::GenerateAccessTokenResponse.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" + delegates = ["hello world"] + scope = ["hello world"] + lifetime = {} + + generate_access_token_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :generate_access_token, name + assert_kind_of ::Google::Iam::Credentials::V1::GenerateAccessTokenRequest, request + assert_equal "hello world", request["name"] + assert_equal ["hello world"], request["delegates"] + assert_equal ["hello world"], request["scope"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Duration), request["lifetime"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, generate_access_token_client_stub do + # Create client + client = ::Google::Iam::Credentials::V1::IAMCredentials::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.generate_access_token({ name: name, delegates: delegates, scope: scope, lifetime: lifetime }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.generate_access_token name: name, delegates: delegates, scope: scope, lifetime: lifetime do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.generate_access_token ::Google::Iam::Credentials::V1::GenerateAccessTokenRequest.new(name: name, delegates: delegates, scope: scope, lifetime: lifetime) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.generate_access_token({ name: name, delegates: delegates, scope: scope, lifetime: lifetime }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.generate_access_token(::Google::Iam::Credentials::V1::GenerateAccessTokenRequest.new(name: name, delegates: delegates, scope: scope, lifetime: lifetime), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, generate_access_token_client_stub.call_rpc_count + end + end + + def test_generate_id_token + # Create GRPC objects. + grpc_response = ::Google::Iam::Credentials::V1::GenerateIdTokenResponse.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" + delegates = ["hello world"] + audience = "hello world" + include_email = true + + generate_id_token_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :generate_id_token, name + assert_kind_of ::Google::Iam::Credentials::V1::GenerateIdTokenRequest, request + assert_equal "hello world", request["name"] + assert_equal ["hello world"], request["delegates"] + assert_equal "hello world", request["audience"] + assert_equal true, request["include_email"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, generate_id_token_client_stub do + # Create client + client = ::Google::Iam::Credentials::V1::IAMCredentials::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.generate_id_token({ name: name, delegates: delegates, audience: audience, include_email: include_email }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.generate_id_token name: name, delegates: delegates, audience: audience, include_email: include_email do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.generate_id_token ::Google::Iam::Credentials::V1::GenerateIdTokenRequest.new(name: name, delegates: delegates, audience: audience, include_email: include_email) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.generate_id_token({ name: name, delegates: delegates, audience: audience, include_email: include_email }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.generate_id_token(::Google::Iam::Credentials::V1::GenerateIdTokenRequest.new(name: name, delegates: delegates, audience: audience, include_email: include_email), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, generate_id_token_client_stub.call_rpc_count + end + end + + def test_sign_blob + # Create GRPC objects. + grpc_response = ::Google::Iam::Credentials::V1::SignBlobResponse.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" + delegates = ["hello world"] + payload = "hello world" + + sign_blob_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :sign_blob, name + assert_kind_of ::Google::Iam::Credentials::V1::SignBlobRequest, request + assert_equal "hello world", request["name"] + assert_equal ["hello world"], request["delegates"] + assert_equal "hello world", request["payload"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, sign_blob_client_stub do + # Create client + client = ::Google::Iam::Credentials::V1::IAMCredentials::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.sign_blob({ name: name, delegates: delegates, payload: payload }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.sign_blob name: name, delegates: delegates, payload: payload do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.sign_blob ::Google::Iam::Credentials::V1::SignBlobRequest.new(name: name, delegates: delegates, payload: payload) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.sign_blob({ name: name, delegates: delegates, payload: payload }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.sign_blob(::Google::Iam::Credentials::V1::SignBlobRequest.new(name: name, delegates: delegates, payload: payload), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, sign_blob_client_stub.call_rpc_count + end + end + + def test_sign_jwt + # Create GRPC objects. + grpc_response = ::Google::Iam::Credentials::V1::SignJwtResponse.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" + delegates = ["hello world"] + payload = "hello world" + + sign_jwt_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :sign_jwt, name + assert_kind_of ::Google::Iam::Credentials::V1::SignJwtRequest, request + assert_equal "hello world", request["name"] + assert_equal ["hello world"], request["delegates"] + assert_equal "hello world", request["payload"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, sign_jwt_client_stub do + # Create client + client = ::Google::Iam::Credentials::V1::IAMCredentials::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.sign_jwt({ name: name, delegates: delegates, payload: payload }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.sign_jwt name: name, delegates: delegates, payload: payload do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.sign_jwt ::Google::Iam::Credentials::V1::SignJwtRequest.new(name: name, delegates: delegates, payload: payload) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.sign_jwt({ name: name, delegates: delegates, payload: payload }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.sign_jwt(::Google::Iam::Credentials::V1::SignJwtRequest.new(name: name, delegates: delegates, payload: payload), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, sign_jwt_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::Iam::Credentials::V1::IAMCredentials::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::Iam::Credentials::V1::IAMCredentials::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::Iam::Credentials::V1::IAMCredentials::Client.new do |config| + config.credentials = creds + end + assert_kind_of ::Google::Iam::Credentials::V1::IAMCredentials::Client, client + assert_equal creds, client.configure.credentials + end + end +end diff --git a/owl-bot-staging/google-iam-credentials-v1/test/helper.rb b/owl-bot-staging/google-iam-credentials-v1/test/helper.rb new file mode 100644 index 000000000000..672b337030e7 --- /dev/null +++ b/owl-bot-staging/google-iam-credentials-v1/test/helper.rb @@ -0,0 +1,26 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/mock" +require "minitest/rg" + +require "grpc" + +require "ostruct" diff --git a/owl-bot-staging/google-iam-v1/.gitignore b/owl-bot-staging/google-iam-v1/.gitignore new file mode 100644 index 000000000000..0135b6bc6cfc --- /dev/null +++ b/owl-bot-staging/google-iam-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-iam-v1/.repo-metadata.json b/owl-bot-staging/google-iam-v1/.repo-metadata.json new file mode 100644 index 000000000000..ac8c3d5d4020 --- /dev/null +++ b/owl-bot-staging/google-iam-v1/.repo-metadata.json @@ -0,0 +1,15 @@ +{ + "api_id": "iam-meta-api.googleapis.com", + "api_shortname": "iam", + "client_documentation": "https://rubydoc.info/gems/google-iam-v1", + "distribution_name": "google-iam-v1", + "is_cloud": false, + "language": "ruby", + "name": "iam", + "name_pretty": "IAM API", + "release_level": "unreleased", + "repo": "googleapis/google-cloud-ruby", + "requires_billing": true, + "ruby-cloud-description": "An add-on interface used by some Google API clients to provide IAM Policy calls. Note that google-iam-v1 is a version-specific client library. For most uses, we recommend installing the main client library google-iam instead. See the readme for more details.", + "library_type": "GAPIC_AUTO" +} diff --git a/owl-bot-staging/google-iam-v1/.rubocop.yml b/owl-bot-staging/google-iam-v1/.rubocop.yml new file mode 100644 index 000000000000..b2f162eb67aa --- /dev/null +++ b/owl-bot-staging/google-iam-v1/.rubocop.yml @@ -0,0 +1,33 @@ +inherit_gem: + google-style: google-style.yml + +AllCops: + Exclude: + - "google-iam-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-iam-v1.rb" diff --git a/owl-bot-staging/google-iam-v1/.toys.rb b/owl-bot-staging/google-iam-v1/.toys.rb new file mode 100644 index 000000000000..177e22456e8a --- /dev/null +++ b/owl-bot-staging/google-iam-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-iam-v1/.yardopts b/owl-bot-staging/google-iam-v1/.yardopts new file mode 100644 index 000000000000..ffea73c50984 --- /dev/null +++ b/owl-bot-staging/google-iam-v1/.yardopts @@ -0,0 +1,12 @@ +--no-private +--title="IAM 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-iam-v1/AUTHENTICATION.md b/owl-bot-staging/google-iam-v1/AUTHENTICATION.md new file mode 100644 index 000000000000..091be9ba75f1 --- /dev/null +++ b/owl-bot-staging/google-iam-v1/AUTHENTICATION.md @@ -0,0 +1,122 @@ +# Authentication + +The recommended way to authenticate to the google-iam-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-iam-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/iam/v1" + +client = ::Google::Iam::V1::IAMPolicy::Client.new do |config| + config.credentials = "path/to/credentialfile.json" +end +``` + +To configure a credentials file globally for all clients: + +```ruby +require "google/iam/v1" + +::Google::Iam::V1::IAMPolicy::Client.configure do |config| + config.credentials = "path/to/credentialfile.json" +end + +client = ::Google::Iam::V1::IAMPolicy::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-iam-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/iam/v1" + +ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" + +client = ::Google::Iam::V1::IAMPolicy::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-iam-v1/CHANGELOG.md b/owl-bot-staging/google-iam-v1/CHANGELOG.md new file mode 100644 index 000000000000..f88957a62ba2 --- /dev/null +++ b/owl-bot-staging/google-iam-v1/CHANGELOG.md @@ -0,0 +1,2 @@ +# Release History + diff --git a/owl-bot-staging/google-iam-v1/Gemfile b/owl-bot-staging/google-iam-v1/Gemfile new file mode 100644 index 000000000000..1d08558908d8 --- /dev/null +++ b/owl-bot-staging/google-iam-v1/Gemfile @@ -0,0 +1,14 @@ +source "https://rubygems.org" + +gemspec + +gem "google-style", "~> 1.32.0" +gem "irb", "~> 1.17" +gem "minitest", "~> 6.0.2" +gem "minitest-focus", "~> 1.4" +gem "minitest-mock", "~> 5.27" +gem "minitest-rg", "~> 5.3" +gem "ostruct", "~> 0.5.5" +gem "rake", ">= 13.0" +gem "redcarpet", "~> 3.6" +gem "yard", "~> 0.9" diff --git a/owl-bot-staging/google-iam-v1/LICENSE.md b/owl-bot-staging/google-iam-v1/LICENSE.md new file mode 100644 index 000000000000..c261857ba6ad --- /dev/null +++ b/owl-bot-staging/google-iam-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-iam-v1/README.md b/owl-bot-staging/google-iam-v1/README.md new file mode 100644 index 000000000000..b2f110454aad --- /dev/null +++ b/owl-bot-staging/google-iam-v1/README.md @@ -0,0 +1,151 @@ +# Ruby Client for the IAM API + +Manages access control for Google Cloud Platform resources. + +An add-on interface used by some Google API clients to provide IAM Policy calls. + +https://github.com/googleapis/google-cloud-ruby + +This gem is a _versioned_ client. It provides basic client classes for a +specific version of the IAM API. Most users should consider using +the main client gem, +[google-iam](https://rubygems.org/gems/google-iam). +See the section below titled *Which client should I use?* for more information. + +## Installation + +``` +$ gem install google-iam-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/iam-meta-api.googleapis.com) +1. [Set up authentication.](AUTHENTICATION.md) + +## Quick Start + +```ruby +require "google/iam/v1" + +client = ::Google::Iam::V1::IAMPolicy::Client.new +request = ::Google::Iam::V1::SetIamPolicyRequest.new # (request fields as keyword arguments...) +response = client.set_iam_policy request +``` + +View the [Client Library Documentation](https://rubydoc.info/gems/google-iam-v1) +for class and method documentation. + +## 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/iam/v1" +require "logger" + +client = ::Google::Iam::V1::IAMPolicy::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-iam`, +and lower-level _versioned_ client libraries with names such as +`google-iam-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-iam`. +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-iam-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-iam-v1/Rakefile b/owl-bot-staging/google-iam-v1/Rakefile new file mode 100644 index 000000000000..b98eca5ed91e --- /dev/null +++ b/owl-bot-staging/google-iam-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-iam-v1 acceptance tests." +task :acceptance, :project, :keyfile do |t, args| + project = args[:project] + project ||= + ENV["GOOGLE_CLOUD_TEST_PROJECT"] || + ENV["GCLOUD_TEST_PROJECT"] + keyfile = args[:keyfile] + keyfile ||= + ENV["GOOGLE_CLOUD_TEST_KEYFILE"] || + ENV["GCLOUD_TEST_KEYFILE"] + if keyfile + keyfile = File.read keyfile + else + keyfile ||= + ENV["GOOGLE_CLOUD_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 GOOGLE_CLOUD_TEST_PROJECT=test123 GOOGLE_CLOUD_TEST_KEYFILE=/path/to/keyfile.json rake acceptance" + end + require "google/iam/v1/iam_policy/credentials" + ::Google::Iam::V1::IAMPolicy::Credentials.env_vars.each do |path| + ENV[path] = nil + end + ENV["GOOGLE_CLOUD_PROJECT"] = project + ENV["GOOGLE_CLOUD_TEST_PROJECT"] = project + ENV["GOOGLE_CLOUD_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-iam-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-iam-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-iam-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-iam-v1 gem does not have doctest tests." +end + +desc "Run the CI build" +task :ci do + header "BUILDING google-iam-v1" + header "google-iam-v1 rubocop", "*" + Rake::Task[:rubocop].invoke + header "google-iam-v1 yard", "*" + Rake::Task[:yard].invoke + header "google-iam-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-iam-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-iam-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-iam-v1/gapic_metadata.json b/owl-bot-staging/google-iam-v1/gapic_metadata.json new file mode 100644 index 000000000000..460f0e3504a4 --- /dev/null +++ b/owl-bot-staging/google-iam-v1/gapic_metadata.json @@ -0,0 +1,33 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "ruby", + "protoPackage": "google.iam.v1", + "libraryPackage": "::Google::Iam::V1", + "services": { + "IAMPolicy": { + "clients": { + "grpc": { + "libraryClient": "::Google::Iam::V1::IAMPolicy::Client", + "rpcs": { + "SetIamPolicy": { + "methods": [ + "set_iam_policy" + ] + }, + "GetIamPolicy": { + "methods": [ + "get_iam_policy" + ] + }, + "TestIamPermissions": { + "methods": [ + "test_iam_permissions" + ] + } + } + } + } + } + } +} diff --git a/owl-bot-staging/google-iam-v1/google-iam-v1.gemspec b/owl-bot-staging/google-iam-v1/google-iam-v1.gemspec new file mode 100644 index 000000000000..8a38f57a9e4e --- /dev/null +++ b/owl-bot-staging/google-iam-v1/google-iam-v1.gemspec @@ -0,0 +1,29 @@ +# -*- ruby -*- +# encoding: utf-8 + +require File.expand_path("lib/google/iam/v1/version", __dir__) + +Gem::Specification.new do |gem| + gem.name = "google-iam-v1" + gem.version = Google::Iam::V1::VERSION + + gem.authors = ["Google LLC"] + gem.email = "googleapis-packages@google.com" + gem.description = "An add-on interface used by some Google API clients to provide IAM Policy calls. Note that google-iam-v1 is a version-specific client library. For most uses, we recommend installing the main client library google-iam instead. See the readme for more details." + gem.summary = "Manages access control for Google Cloud Platform resources." + 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.2" + + gem.add_dependency "gapic-common", "~> 1.2" + gem.add_dependency "google-cloud-errors", "~> 1.0" + gem.add_dependency "grpc-google-iam-v1", "~> 1.11" +end diff --git a/owl-bot-staging/google-iam-v1/lib/google-iam-v1.rb b/owl-bot-staging/google-iam-v1/lib/google-iam-v1.rb new file mode 100644 index 000000000000..8535b41b7b04 --- /dev/null +++ b/owl-bot-staging/google-iam-v1/lib/google-iam-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/iam/v1" diff --git a/owl-bot-staging/google-iam-v1/lib/google/iam/v1.rb b/owl-bot-staging/google-iam-v1/lib/google/iam/v1.rb new file mode 100644 index 000000000000..82236fcafd28 --- /dev/null +++ b/owl-bot-staging/google-iam-v1/lib/google/iam/v1.rb @@ -0,0 +1,43 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/iam/v1/iam_policy" +require "google/iam/v1/version" + +module Google + module Iam + ## + # API client module. + # + # @example Load this package, including all its services, and instantiate a gRPC client + # + # require "google/iam/v1" + # client = ::Google::Iam::V1::IAMPolicy::Client.new + # + # @example Load this package, including all its services, and instantiate a REST client + # + # require "google/iam/v1" + # client = ::Google::Iam::V1::IAMPolicy::Rest::Client.new + # + module V1 + end + end +end + +helper_path = ::File.join __dir__, "v1", "_helpers.rb" +require "google/iam/v1/_helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-iam-v1/lib/google/iam/v1/iam_policy.rb b/owl-bot-staging/google-iam-v1/lib/google/iam/v1/iam_policy.rb new file mode 100644 index 000000000000..548e35457af4 --- /dev/null +++ b/owl-bot-staging/google-iam-v1/lib/google/iam/v1/iam_policy.rb @@ -0,0 +1,76 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/iam/v1/version" + +require "google/iam/v1/iam_policy/credentials" +require "google/iam/v1/iam_policy/client" +require "google/iam/v1/iam_policy/rest" + +module Google + module Iam + module V1 + ## + # API Overview + # + # Manages Identity and Access Management (IAM) policies. + # + # Any implementation of an API that offers access control features + # implements the google.iam.v1.IAMPolicy interface. + # + # ## Data model + # + # Access control is applied when a principal (user or service account), takes + # some action on a resource exposed by a service. Resources, identified by + # URI-like names, are the unit of access control specification. Service + # implementations can choose the granularity of access control and the + # supported permissions for their resources. + # For example one database service may allow access control to be + # specified only at the Table level, whereas another might allow access control + # to also be specified at the Column level. + # + # ## Policy Structure + # + # See google.iam.v1.Policy + # + # This is intentionally not a CRUD style API because access control policies + # are created and deleted implicitly with the resources to which they are + # attached. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/iam/v1/iam_policy" + # client = ::Google::Iam::V1::IAMPolicy::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/iam/v1/iam_policy/rest" + # client = ::Google::Iam::V1::IAMPolicy::Rest::Client.new + # + module IAMPolicy + end + end + end +end + +helper_path = ::File.join __dir__, "iam_policy", "helpers.rb" +require "google/iam/v1/iam_policy/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-iam-v1/lib/google/iam/v1/iam_policy/client.rb b/owl-bot-staging/google-iam-v1/lib/google/iam/v1/iam_policy/client.rb new file mode 100644 index 000000000000..703172dfaf36 --- /dev/null +++ b/owl-bot-staging/google-iam-v1/lib/google/iam/v1/iam_policy/client.rb @@ -0,0 +1,711 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/iam/v1/iam_policy_pb" + +module Google + module Iam + module V1 + module IAMPolicy + ## + # Client for the IAMPolicy service. + # + # API Overview + # + # Manages Identity and Access Management (IAM) policies. + # + # Any implementation of an API that offers access control features + # implements the google.iam.v1.IAMPolicy interface. + # + # ## Data model + # + # Access control is applied when a principal (user or service account), takes + # some action on a resource exposed by a service. Resources, identified by + # URI-like names, are the unit of access control specification. Service + # implementations can choose the granularity of access control and the + # supported permissions for their resources. + # For example one database service may allow access control to be + # specified only at the Table level, whereas another might allow access control + # to also be specified at the Column level. + # + # ## Policy Structure + # + # See google.iam.v1.Policy + # + # This is intentionally not a CRUD style API because access control policies + # are created and deleted implicitly with the resources to which they are + # attached. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "iam-meta-api.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :iam_policy_stub + + ## + # Configure the IAMPolicy Client class. + # + # See {::Google::Iam::V1::IAMPolicy::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all IAMPolicy clients + # ::Google::Iam::V1::IAMPolicy::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", "Iam", "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 + end + yield @configure if block_given? + @configure + end + + ## + # Configure the IAMPolicy 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::Iam::V1::IAMPolicy::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 + @iam_policy_stub.universe_domain + end + + ## + # Create a new IAMPolicy client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Iam::V1::IAMPolicy::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Iam::V1::IAMPolicy::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the IAMPolicy 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/iam/v1/iam_policy_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 + + @iam_policy_stub = ::Gapic::ServiceStub.new( + ::Google::Iam::V1::IAMPolicy::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 + ) + + @iam_policy_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 + end + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @iam_policy_stub.logger + end + + # Service calls + + ## + # Sets the access control policy on the specified resource. Replaces any + # existing policy. + # + # Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` errors. + # + # @overload set_iam_policy(request, options = nil) + # Pass arguments to `set_iam_policy` via a request object, either of type + # {::Google::Iam::V1::SetIamPolicyRequest} or an equivalent Hash. + # + # @param request [::Google::Iam::V1::SetIamPolicyRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload set_iam_policy(resource: nil, policy: nil, update_mask: nil) + # Pass arguments to `set_iam_policy` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param resource [::String] + # REQUIRED: The resource for which the policy is being specified. + # See the operation documentation for the appropriate value for this field. + # @param policy [::Google::Iam::V1::Policy, ::Hash] + # REQUIRED: The complete policy to be applied to the `resource`. The size of + # the policy is limited to a few 10s of KB. An empty policy is a + # valid policy but certain Cloud Platform services (such as Projects) + # might reject them. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only + # the fields in the mask will be modified. If no mask is provided, the + # following default mask is used: + # + # `paths: "bindings, etag"` + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Iam::V1::Policy] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Iam::V1::Policy] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/iam/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Iam::V1::IAMPolicy::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Iam::V1::SetIamPolicyRequest.new + # + # # Call the set_iam_policy method. + # result = client.set_iam_policy request + # + # # The returned object is of type Google::Iam::V1::Policy. + # p result + # + def set_iam_policy request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::SetIamPolicyRequest + + # Converts hash 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.set_iam_policy.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::Iam::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.resource + header_params["resource"] = request.resource + 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.set_iam_policy.timeout, + metadata: metadata, + retry_policy: @config.rpcs.set_iam_policy.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @iam_policy_stub.call_rpc :set_iam_policy, 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 + + ## + # Gets the access control policy for a resource. + # Returns an empty policy if the resource exists and does not have a policy + # set. + # + # @overload get_iam_policy(request, options = nil) + # Pass arguments to `get_iam_policy` via a request object, either of type + # {::Google::Iam::V1::GetIamPolicyRequest} or an equivalent Hash. + # + # @param request [::Google::Iam::V1::GetIamPolicyRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_iam_policy(resource: nil, options: nil) + # Pass arguments to `get_iam_policy` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param resource [::String] + # REQUIRED: The resource for which the policy is being requested. + # See the operation documentation for the appropriate value for this field. + # @param options [::Google::Iam::V1::GetPolicyOptions, ::Hash] + # OPTIONAL: A `GetPolicyOptions` object for specifying options to + # `GetIamPolicy`. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Iam::V1::Policy] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Iam::V1::Policy] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/iam/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Iam::V1::IAMPolicy::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Iam::V1::GetIamPolicyRequest.new + # + # # Call the get_iam_policy method. + # result = client.get_iam_policy request + # + # # The returned object is of type Google::Iam::V1::Policy. + # p result + # + def get_iam_policy request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::GetIamPolicyRequest + + # Converts hash 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_iam_policy.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::Iam::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.resource + header_params["resource"] = request.resource + 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_iam_policy.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_iam_policy.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @iam_policy_stub.call_rpc :get_iam_policy, 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 permissions that a caller has on the specified resource. + # If the resource does not exist, this will return an empty set of + # permissions, not a `NOT_FOUND` error. + # + # Note: This operation is designed to be used for building permission-aware + # UIs and command-line tools, not for authorization checking. This operation + # may "fail open" without warning. + # + # @overload test_iam_permissions(request, options = nil) + # Pass arguments to `test_iam_permissions` via a request object, either of type + # {::Google::Iam::V1::TestIamPermissionsRequest} or an equivalent Hash. + # + # @param request [::Google::Iam::V1::TestIamPermissionsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload test_iam_permissions(resource: nil, permissions: nil) + # Pass arguments to `test_iam_permissions` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param resource [::String] + # REQUIRED: The resource for which the policy detail is being requested. + # See the operation documentation for the appropriate value for this field. + # @param permissions [::Array<::String>] + # The set of permissions to check for the `resource`. Permissions with + # wildcards (such as '*' or 'storage.*') are not allowed. For more + # information see + # [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Iam::V1::TestIamPermissionsResponse] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Iam::V1::TestIamPermissionsResponse] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/iam/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Iam::V1::IAMPolicy::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Iam::V1::TestIamPermissionsRequest.new + # + # # Call the test_iam_permissions method. + # result = client.test_iam_permissions request + # + # # The returned object is of type Google::Iam::V1::TestIamPermissionsResponse. + # p result + # + def test_iam_permissions request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::TestIamPermissionsRequest + + # Converts hash 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.test_iam_permissions.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::Iam::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.resource + header_params["resource"] = request.resource + 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.test_iam_permissions.timeout, + metadata: metadata, + retry_policy: @config.rpcs.test_iam_permissions.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @iam_policy_stub.call_rpc :test_iam_permissions, 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 IAMPolicy API. + # + # This class represents the configuration for IAMPolicy, + # 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::Iam::V1::IAMPolicy::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 + # # set_iam_policy to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Iam::V1::IAMPolicy::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.set_iam_policy.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Iam::V1::IAMPolicy::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.set_iam_policy.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::Iam::V1::IAMPolicy::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 = "iam-meta-api.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 IAMPolicy 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 `set_iam_policy` + # @return [::Gapic::Config::Method] + # + attr_reader :set_iam_policy + ## + # RPC-specific configuration for `get_iam_policy` + # @return [::Gapic::Config::Method] + # + attr_reader :get_iam_policy + ## + # RPC-specific configuration for `test_iam_permissions` + # @return [::Gapic::Config::Method] + # + attr_reader :test_iam_permissions + + # @private + def initialize parent_rpcs = nil + set_iam_policy_config = parent_rpcs.set_iam_policy if parent_rpcs.respond_to? :set_iam_policy + @set_iam_policy = ::Gapic::Config::Method.new set_iam_policy_config + get_iam_policy_config = parent_rpcs.get_iam_policy if parent_rpcs.respond_to? :get_iam_policy + @get_iam_policy = ::Gapic::Config::Method.new get_iam_policy_config + test_iam_permissions_config = parent_rpcs.test_iam_permissions if parent_rpcs.respond_to? :test_iam_permissions + @test_iam_permissions = ::Gapic::Config::Method.new test_iam_permissions_config + + yield self if block_given? + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-iam-v1/lib/google/iam/v1/iam_policy/credentials.rb b/owl-bot-staging/google-iam-v1/lib/google/iam/v1/iam_policy/credentials.rb new file mode 100644 index 000000000000..ae4df78450b3 --- /dev/null +++ b/owl-bot-staging/google-iam-v1/lib/google/iam/v1/iam_policy/credentials.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 "googleauth" + +module Google + module Iam + module V1 + module IAMPolicy + # Credentials for the IAMPolicy API. + class Credentials < ::Google::Auth::Credentials + self.env_vars = [ + "GOOGLE_CLOUD_CREDENTIALS", + "GOOGLE_CLOUD_KEYFILE", + "GCLOUD_KEYFILE", + "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 diff --git a/owl-bot-staging/google-iam-v1/lib/google/iam/v1/iam_policy/rest.rb b/owl-bot-staging/google-iam-v1/lib/google/iam/v1/iam_policy/rest.rb new file mode 100644 index 000000000000..ddd2c64fa229 --- /dev/null +++ b/owl-bot-staging/google-iam-v1/lib/google/iam/v1/iam_policy/rest.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/rest" +require "gapic/config" +require "gapic/config/method" + +require "google/iam/v1/version" + +require "google/iam/v1/iam_policy/credentials" +require "google/iam/v1/iam_policy/rest/client" + +module Google + module Iam + module V1 + ## + # API Overview + # + # Manages Identity and Access Management (IAM) policies. + # + # Any implementation of an API that offers access control features + # implements the google.iam.v1.IAMPolicy interface. + # + # ## Data model + # + # Access control is applied when a principal (user or service account), takes + # some action on a resource exposed by a service. Resources, identified by + # URI-like names, are the unit of access control specification. Service + # implementations can choose the granularity of access control and the + # supported permissions for their resources. + # For example one database service may allow access control to be + # specified only at the Table level, whereas another might allow access control + # to also be specified at the Column level. + # + # ## Policy Structure + # + # See google.iam.v1.Policy + # + # This is intentionally not a CRUD style API because access control policies + # are created and deleted implicitly with the resources to which they are + # attached. + # + # To load this service and instantiate a REST client: + # + # require "google/iam/v1/iam_policy/rest" + # client = ::Google::Iam::V1::IAMPolicy::Rest::Client.new + # + module IAMPolicy + # Client for the REST transport + module Rest + end + end + end + end +end + +helper_path = ::File.join __dir__, "rest", "helpers.rb" +require "google/iam/v1/iam_policy/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-iam-v1/lib/google/iam/v1/iam_policy/rest/client.rb b/owl-bot-staging/google-iam-v1/lib/google/iam/v1/iam_policy/rest/client.rb new file mode 100644 index 000000000000..7a09adf098b2 --- /dev/null +++ b/owl-bot-staging/google-iam-v1/lib/google/iam/v1/iam_policy/rest/client.rb @@ -0,0 +1,660 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/iam/v1/iam_policy_pb" +require "google/iam/v1/iam_policy/rest/service_stub" + +module Google + module Iam + module V1 + module IAMPolicy + module Rest + ## + # REST client for the IAMPolicy service. + # + # API Overview + # + # Manages Identity and Access Management (IAM) policies. + # + # Any implementation of an API that offers access control features + # implements the google.iam.v1.IAMPolicy interface. + # + # ## Data model + # + # Access control is applied when a principal (user or service account), takes + # some action on a resource exposed by a service. Resources, identified by + # URI-like names, are the unit of access control specification. Service + # implementations can choose the granularity of access control and the + # supported permissions for their resources. + # For example one database service may allow access control to be + # specified only at the Table level, whereas another might allow access control + # to also be specified at the Column level. + # + # ## Policy Structure + # + # See google.iam.v1.Policy + # + # This is intentionally not a CRUD style API because access control policies + # are created and deleted implicitly with the resources to which they are + # attached. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "iam-meta-api.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :iam_policy_stub + + ## + # Configure the IAMPolicy Client class. + # + # See {::Google::Iam::V1::IAMPolicy::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all IAMPolicy clients + # ::Google::Iam::V1::IAMPolicy::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", "Iam", "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 + end + yield @configure if block_given? + @configure + end + + ## + # Configure the IAMPolicy 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::Iam::V1::IAMPolicy::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 + @iam_policy_stub.universe_domain + end + + ## + # Create a new IAMPolicy REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Iam::V1::IAMPolicy::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Iam::V1::IAMPolicy::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the IAMPolicy 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 + + @iam_policy_stub = ::Google::Iam::V1::IAMPolicy::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials, + logger: @config.logger + ) + + @iam_policy_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 + end + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @iam_policy_stub.logger + end + + # Service calls + + ## + # Sets the access control policy on the specified resource. Replaces any + # existing policy. + # + # Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` errors. + # + # @overload set_iam_policy(request, options = nil) + # Pass arguments to `set_iam_policy` via a request object, either of type + # {::Google::Iam::V1::SetIamPolicyRequest} or an equivalent Hash. + # + # @param request [::Google::Iam::V1::SetIamPolicyRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload set_iam_policy(resource: nil, policy: nil, update_mask: nil) + # Pass arguments to `set_iam_policy` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param resource [::String] + # REQUIRED: The resource for which the policy is being specified. + # See the operation documentation for the appropriate value for this field. + # @param policy [::Google::Iam::V1::Policy, ::Hash] + # REQUIRED: The complete policy to be applied to the `resource`. The size of + # the policy is limited to a few 10s of KB. An empty policy is a + # valid policy but certain Cloud Platform services (such as Projects) + # might reject them. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only + # the fields in the mask will be modified. If no mask is provided, the + # following default mask is used: + # + # `paths: "bindings, etag"` + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Iam::V1::Policy] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Iam::V1::Policy] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/iam/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Iam::V1::IAMPolicy::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Iam::V1::SetIamPolicyRequest.new + # + # # Call the set_iam_policy method. + # result = client.set_iam_policy request + # + # # The returned object is of type Google::Iam::V1::Policy. + # p result + # + def set_iam_policy request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::SetIamPolicyRequest + + # Converts hash 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.set_iam_policy.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::Iam::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.set_iam_policy.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.set_iam_policy.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + bindings_override = @config.bindings_override["google.iam.v1.IAMPolicy.SetIamPolicy"] + + @iam_policy_stub.set_iam_policy request, options, bindings_override: bindings_override do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Gets the access control policy for a resource. + # Returns an empty policy if the resource exists and does not have a policy + # set. + # + # @overload get_iam_policy(request, options = nil) + # Pass arguments to `get_iam_policy` via a request object, either of type + # {::Google::Iam::V1::GetIamPolicyRequest} or an equivalent Hash. + # + # @param request [::Google::Iam::V1::GetIamPolicyRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_iam_policy(resource: nil, options: nil) + # Pass arguments to `get_iam_policy` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param resource [::String] + # REQUIRED: The resource for which the policy is being requested. + # See the operation documentation for the appropriate value for this field. + # @param options [::Google::Iam::V1::GetPolicyOptions, ::Hash] + # OPTIONAL: A `GetPolicyOptions` object for specifying options to + # `GetIamPolicy`. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Iam::V1::Policy] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Iam::V1::Policy] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/iam/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Iam::V1::IAMPolicy::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Iam::V1::GetIamPolicyRequest.new + # + # # Call the get_iam_policy method. + # result = client.get_iam_policy request + # + # # The returned object is of type Google::Iam::V1::Policy. + # p result + # + def get_iam_policy request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::GetIamPolicyRequest + + # Converts hash 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_iam_policy.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::Iam::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_iam_policy.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_iam_policy.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + bindings_override = @config.bindings_override["google.iam.v1.IAMPolicy.GetIamPolicy"] + + @iam_policy_stub.get_iam_policy request, options, bindings_override: bindings_override do |result, operation| + yield result, operation if block_given? + end + rescue ::Gapic::Rest::Error => e + raise ::Google::Cloud::Error.from_error(e) + end + + ## + # Returns permissions that a caller has on the specified resource. + # If the resource does not exist, this will return an empty set of + # permissions, not a `NOT_FOUND` error. + # + # Note: This operation is designed to be used for building permission-aware + # UIs and command-line tools, not for authorization checking. This operation + # may "fail open" without warning. + # + # @overload test_iam_permissions(request, options = nil) + # Pass arguments to `test_iam_permissions` via a request object, either of type + # {::Google::Iam::V1::TestIamPermissionsRequest} or an equivalent Hash. + # + # @param request [::Google::Iam::V1::TestIamPermissionsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. + # + # @overload test_iam_permissions(resource: nil, permissions: nil) + # Pass arguments to `test_iam_permissions` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param resource [::String] + # REQUIRED: The resource for which the policy detail is being requested. + # See the operation documentation for the appropriate value for this field. + # @param permissions [::Array<::String>] + # The set of permissions to check for the `resource`. Permissions with + # wildcards (such as '*' or 'storage.*') are not allowed. For more + # information see + # [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Iam::V1::TestIamPermissionsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Iam::V1::TestIamPermissionsResponse] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/iam/v1" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Iam::V1::IAMPolicy::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Iam::V1::TestIamPermissionsRequest.new + # + # # Call the test_iam_permissions method. + # result = client.test_iam_permissions request + # + # # The returned object is of type Google::Iam::V1::TestIamPermissionsResponse. + # p result + # + def test_iam_permissions request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::TestIamPermissionsRequest + + # Converts hash 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.test_iam_permissions.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::Iam::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.test_iam_permissions.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.test_iam_permissions.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + bindings_override = @config.bindings_override["google.iam.v1.IAMPolicy.TestIamPermissions"] + + @iam_policy_stub.test_iam_permissions request, options, bindings_override: bindings_override 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 IAMPolicy REST API. + # + # This class represents the configuration for IAMPolicy 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::Iam::V1::IAMPolicy::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 + # # set_iam_policy to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Iam::V1::IAMPolicy::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.set_iam_policy.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Iam::V1::IAMPolicy::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.set_iam_policy.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 = "iam-meta-api.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 IAMPolicy 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 `set_iam_policy` + # @return [::Gapic::Config::Method] + # + attr_reader :set_iam_policy + ## + # RPC-specific configuration for `get_iam_policy` + # @return [::Gapic::Config::Method] + # + attr_reader :get_iam_policy + ## + # RPC-specific configuration for `test_iam_permissions` + # @return [::Gapic::Config::Method] + # + attr_reader :test_iam_permissions + + # @private + def initialize parent_rpcs = nil + set_iam_policy_config = parent_rpcs.set_iam_policy if parent_rpcs.respond_to? :set_iam_policy + @set_iam_policy = ::Gapic::Config::Method.new set_iam_policy_config + get_iam_policy_config = parent_rpcs.get_iam_policy if parent_rpcs.respond_to? :get_iam_policy + @get_iam_policy = ::Gapic::Config::Method.new get_iam_policy_config + test_iam_permissions_config = parent_rpcs.test_iam_permissions if parent_rpcs.respond_to? :test_iam_permissions + @test_iam_permissions = ::Gapic::Config::Method.new test_iam_permissions_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-iam-v1/lib/google/iam/v1/iam_policy/rest/service_stub.rb b/owl-bot-staging/google-iam-v1/lib/google/iam/v1/iam_policy/rest/service_stub.rb new file mode 100644 index 000000000000..d64e9eeb27e1 --- /dev/null +++ b/owl-bot-staging/google-iam-v1/lib/google/iam/v1/iam_policy/rest/service_stub.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 "google/iam/v1/iam_policy_pb" + +module Google + module Iam + module V1 + module IAMPolicy + module Rest + ## + # REST service stub for the IAMPolicy 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: false, + 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 set_iam_policy REST call + # + # @param request_pb [::Google::Iam::V1::SetIamPolicyRequest] + # 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. + # @param bindings_override [::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>, nil] + # Binding overrides for the transcoding. Only used internally. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Iam::V1::Policy] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Iam::V1::Policy] + # A result object deserialized from the server's reply + def set_iam_policy request_pb, options = nil, bindings_override: nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_set_iam_policy_request request_pb, bindings_override: bindings_override + 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: "set_iam_policy", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Iam::V1::Policy.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_iam_policy REST call + # + # @param request_pb [::Google::Iam::V1::GetIamPolicyRequest] + # 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. + # @param bindings_override [::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>, nil] + # Binding overrides for the transcoding. Only used internally. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Iam::V1::Policy] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Iam::V1::Policy] + # A result object deserialized from the server's reply + def get_iam_policy request_pb, options = nil, bindings_override: nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_iam_policy_request request_pb, bindings_override: bindings_override + 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_iam_policy", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Iam::V1::Policy.decode_json response.body, ignore_unknown_fields: true + catch :response do + yield result, operation if block_given? + result + end + end + + ## + # Baseline implementation for the test_iam_permissions REST call + # + # @param request_pb [::Google::Iam::V1::TestIamPermissionsRequest] + # 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. + # @param bindings_override [::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>, nil] + # Binding overrides for the transcoding. Only used internally. + # + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Iam::V1::TestIamPermissionsResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Iam::V1::TestIamPermissionsResponse] + # A result object deserialized from the server's reply + def test_iam_permissions request_pb, options = nil, bindings_override: nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_test_iam_permissions_request request_pb, bindings_override: bindings_override + 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: "test_iam_permissions", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Iam::V1::TestIamPermissionsResponse.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 set_iam_policy REST call + # + # @param request_pb [::Google::Iam::V1::SetIamPolicyRequest] + # A request object representing the call parameters. Required. + # @param bindings_override [::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>, nil] + # Binding overrides for the transcoding. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_set_iam_policy_request request_pb, bindings_override: nil + transcoder = Gapic::Rest::GrpcTranscoder.new(bindings_override) if bindings_override + transcoder ||= Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{resource}:setIamPolicy", + body: "*", + matches: [ + ["resource", %r{^.*$}, true] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_iam_policy REST call + # + # @param request_pb [::Google::Iam::V1::GetIamPolicyRequest] + # A request object representing the call parameters. Required. + # @param bindings_override [::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>, nil] + # Binding overrides for the transcoding. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_get_iam_policy_request request_pb, bindings_override: nil + transcoder = Gapic::Rest::GrpcTranscoder.new(bindings_override) if bindings_override + transcoder ||= Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{resource}:getIamPolicy", + body: "*", + matches: [ + ["resource", %r{^.*$}, true] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the test_iam_permissions REST call + # + # @param request_pb [::Google::Iam::V1::TestIamPermissionsRequest] + # A request object representing the call parameters. Required. + # @param bindings_override [::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>, nil] + # Binding overrides for the transcoding. + # @return [Array(String, [String, nil], Hash{String => String})] + # Uri, Body, Query string parameters + def self.transcode_test_iam_permissions_request request_pb, bindings_override: nil + transcoder = Gapic::Rest::GrpcTranscoder.new(bindings_override) if bindings_override + transcoder ||= Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v1/{resource}:testIamPermissions", + body: "*", + matches: [ + ["resource", %r{^.*$}, true] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-iam-v1/lib/google/iam/v1/iam_policy_pb.rb b/owl-bot-staging/google-iam-v1/lib/google/iam/v1/iam_policy_pb.rb new file mode 100644 index 000000000000..31791896cf09 --- /dev/null +++ b/owl-bot-staging/google-iam-v1/lib/google/iam/v1/iam_policy_pb.rb @@ -0,0 +1,30 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/iam/v1/iam_policy.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/iam/v1/options_pb' +require 'google/iam/v1/policy_pb' +require 'google/protobuf/field_mask_pb' + + +descriptor_data = "\n\x1egoogle/iam/v1/iam_policy.proto\x12\rgoogle.iam.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x1bgoogle/iam/v1/options.proto\x1a\x1agoogle/iam/v1/policy.proto\x1a google/protobuf/field_mask.proto\"\x8f\x01\n\x13SetIamPolicyRequest\x12\x1b\n\x08resource\x18\x01 \x01(\tB\t\xe0\x41\x02\xfa\x41\x03\n\x01*\x12*\n\x06policy\x18\x02 \x01(\x0b\x32\x15.google.iam.v1.PolicyB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"d\n\x13GetIamPolicyRequest\x12\x1b\n\x08resource\x18\x01 \x01(\tB\t\xe0\x41\x02\xfa\x41\x03\n\x01*\x12\x30\n\x07options\x18\x02 \x01(\x0b\x32\x1f.google.iam.v1.GetPolicyOptions\"R\n\x19TestIamPermissionsRequest\x12\x1b\n\x08resource\x18\x01 \x01(\tB\t\xe0\x41\x02\xfa\x41\x03\n\x01*\x12\x18\n\x0bpermissions\x18\x02 \x03(\tB\x03\xe0\x41\x02\"1\n\x1aTestIamPermissionsResponse\x12\x13\n\x0bpermissions\x18\x01 \x03(\t2\xb4\x03\n\tIAMPolicy\x12t\n\x0cSetIamPolicy\x12\".google.iam.v1.SetIamPolicyRequest\x1a\x15.google.iam.v1.Policy\")\x82\xd3\xe4\x93\x02#\"\x1e/v1/{resource=**}:setIamPolicy:\x01*\x12t\n\x0cGetIamPolicy\x12\".google.iam.v1.GetIamPolicyRequest\x1a\x15.google.iam.v1.Policy\")\x82\xd3\xe4\x93\x02#\"\x1e/v1/{resource=**}:getIamPolicy:\x01*\x12\x9a\x01\n\x12TestIamPermissions\x12(.google.iam.v1.TestIamPermissionsRequest\x1a).google.iam.v1.TestIamPermissionsResponse\"/\x82\xd3\xe4\x93\x02)\"$/v1/{resource=**}:testIamPermissions:\x01*\x1a\x1e\xca\x41\x1biam-meta-api.googleapis.comB|\n\x11\x63om.google.iam.v1B\x0eIamPolicyProtoP\x01Z)cloud.google.com/go/iam/apiv1/iampb;iampb\xaa\x02\x13Google.Cloud.Iam.V1\xca\x02\x13Google\\Cloud\\Iam\\V1b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Iam + module V1 + SetIamPolicyRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.iam.v1.SetIamPolicyRequest").msgclass + GetIamPolicyRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.iam.v1.GetIamPolicyRequest").msgclass + TestIamPermissionsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.iam.v1.TestIamPermissionsRequest").msgclass + TestIamPermissionsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.iam.v1.TestIamPermissionsResponse").msgclass + end + end +end diff --git a/owl-bot-staging/google-iam-v1/lib/google/iam/v1/iam_policy_services_pb.rb b/owl-bot-staging/google-iam-v1/lib/google/iam/v1/iam_policy_services_pb.rb new file mode 100644 index 000000000000..45ac992e8c4e --- /dev/null +++ b/owl-bot-staging/google-iam-v1/lib/google/iam/v1/iam_policy_services_pb.rb @@ -0,0 +1,82 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/iam/v1/iam_policy.proto for package 'google.iam.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/iam/v1/iam_policy_pb' + +module Google + module Iam + module V1 + module IAMPolicy + # API Overview + # + # Manages Identity and Access Management (IAM) policies. + # + # Any implementation of an API that offers access control features + # implements the google.iam.v1.IAMPolicy interface. + # + # ## Data model + # + # Access control is applied when a principal (user or service account), takes + # some action on a resource exposed by a service. Resources, identified by + # URI-like names, are the unit of access control specification. Service + # implementations can choose the granularity of access control and the + # supported permissions for their resources. + # For example one database service may allow access control to be + # specified only at the Table level, whereas another might allow access control + # to also be specified at the Column level. + # + # ## Policy Structure + # + # See google.iam.v1.Policy + # + # This is intentionally not a CRUD style API because access control policies + # are created and deleted implicitly with the resources to which they are + # attached. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.iam.v1.IAMPolicy' + + # Sets the access control policy on the specified resource. Replaces any + # existing policy. + # + # Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` errors. + rpc :SetIamPolicy, ::Google::Iam::V1::SetIamPolicyRequest, ::Google::Iam::V1::Policy + # Gets the access control policy for a resource. + # Returns an empty policy if the resource exists and does not have a policy + # set. + rpc :GetIamPolicy, ::Google::Iam::V1::GetIamPolicyRequest, ::Google::Iam::V1::Policy + # Returns permissions that a caller has on the specified resource. + # If the resource does not exist, this will return an empty set of + # permissions, not a `NOT_FOUND` error. + # + # Note: This operation is designed to be used for building permission-aware + # UIs and command-line tools, not for authorization checking. This operation + # may "fail open" without warning. + rpc :TestIamPermissions, ::Google::Iam::V1::TestIamPermissionsRequest, ::Google::Iam::V1::TestIamPermissionsResponse + end + + Stub = Service.rpc_stub_class + end + end + end +end diff --git a/owl-bot-staging/google-iam-v1/lib/google/iam/v1/logging/audit_data_pb.rb b/owl-bot-staging/google-iam-v1/lib/google/iam/v1/logging/audit_data_pb.rb new file mode 100644 index 000000000000..bc90a33663bc --- /dev/null +++ b/owl-bot-staging/google-iam-v1/lib/google/iam/v1/logging/audit_data_pb.rb @@ -0,0 +1,23 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/iam/v1/logging/audit_data.proto + +require 'google/protobuf' + +require 'google/iam/v1/policy_pb' + + +descriptor_data = "\n&google/iam/v1/logging/audit_data.proto\x12\x15google.iam.v1.logging\x1a\x1agoogle/iam/v1/policy.proto\"=\n\tAuditData\x12\x30\n\x0cpolicy_delta\x18\x02 \x01(\x0b\x32\x1a.google.iam.v1.PolicyDeltaB\x86\x01\n\x19\x63om.google.iam.v1.loggingB\x0e\x41uditDataProtoP\x01Z9cloud.google.com/go/iam/apiv1/logging/loggingpb;loggingpb\xaa\x02\x1bGoogle.Cloud.Iam.V1.Loggingb\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Iam + module V1 + module Logging + AuditData = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.iam.v1.logging.AuditData").msgclass + end + end + end +end diff --git a/owl-bot-staging/google-iam-v1/lib/google/iam/v1/options_pb.rb b/owl-bot-staging/google-iam-v1/lib/google/iam/v1/options_pb.rb new file mode 100644 index 000000000000..8293db38efdc --- /dev/null +++ b/owl-bot-staging/google-iam-v1/lib/google/iam/v1/options_pb.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/iam/v1/options.proto + +require 'google/protobuf' + + +descriptor_data = "\n\x1bgoogle/iam/v1/options.proto\x12\rgoogle.iam.v1\"4\n\x10GetPolicyOptions\x12 \n\x18requested_policy_version\x18\x01 \x01(\x05\x42}\n\x11\x63om.google.iam.v1B\x0cOptionsProtoP\x01Z)cloud.google.com/go/iam/apiv1/iampb;iampb\xf8\x01\x01\xaa\x02\x13Google.Cloud.Iam.V1\xca\x02\x13Google\\Cloud\\Iam\\V1b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Iam + module V1 + GetPolicyOptions = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.iam.v1.GetPolicyOptions").msgclass + end + end +end diff --git a/owl-bot-staging/google-iam-v1/lib/google/iam/v1/policy_pb.rb b/owl-bot-staging/google-iam-v1/lib/google/iam/v1/policy_pb.rb new file mode 100644 index 000000000000..4347360a984e --- /dev/null +++ b/owl-bot-staging/google-iam-v1/lib/google/iam/v1/policy_pb.rb @@ -0,0 +1,30 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/iam/v1/policy.proto + +require 'google/protobuf' + +require 'google/type/expr_pb' + + +descriptor_data = "\n\x1agoogle/iam/v1/policy.proto\x12\rgoogle.iam.v1\x1a\x16google/type/expr.proto\"\x84\x01\n\x06Policy\x12\x0f\n\x07version\x18\x01 \x01(\x05\x12(\n\x08\x62indings\x18\x04 \x03(\x0b\x32\x16.google.iam.v1.Binding\x12\x31\n\raudit_configs\x18\x06 \x03(\x0b\x32\x1a.google.iam.v1.AuditConfig\x12\x0c\n\x04\x65tag\x18\x03 \x01(\x0c\"N\n\x07\x42inding\x12\x0c\n\x04role\x18\x01 \x01(\t\x12\x0f\n\x07members\x18\x02 \x03(\t\x12$\n\tcondition\x18\x03 \x01(\x0b\x32\x11.google.type.Expr\"X\n\x0b\x41uditConfig\x12\x0f\n\x07service\x18\x01 \x01(\t\x12\x38\n\x11\x61udit_log_configs\x18\x03 \x03(\x0b\x32\x1d.google.iam.v1.AuditLogConfig\"\xb7\x01\n\x0e\x41uditLogConfig\x12\x37\n\x08log_type\x18\x01 \x01(\x0e\x32%.google.iam.v1.AuditLogConfig.LogType\x12\x18\n\x10\x65xempted_members\x18\x02 \x03(\t\"R\n\x07LogType\x12\x18\n\x14LOG_TYPE_UNSPECIFIED\x10\x00\x12\x0e\n\nADMIN_READ\x10\x01\x12\x0e\n\nDATA_WRITE\x10\x02\x12\r\n\tDATA_READ\x10\x03\"\x80\x01\n\x0bPolicyDelta\x12\x33\n\x0e\x62inding_deltas\x18\x01 \x03(\x0b\x32\x1b.google.iam.v1.BindingDelta\x12<\n\x13\x61udit_config_deltas\x18\x02 \x03(\x0b\x32\x1f.google.iam.v1.AuditConfigDelta\"\xbd\x01\n\x0c\x42indingDelta\x12\x32\n\x06\x61\x63tion\x18\x01 \x01(\x0e\x32\".google.iam.v1.BindingDelta.Action\x12\x0c\n\x04role\x18\x02 \x01(\t\x12\x0e\n\x06member\x18\x03 \x01(\t\x12$\n\tcondition\x18\x04 \x01(\x0b\x32\x11.google.type.Expr\"5\n\x06\x41\x63tion\x12\x16\n\x12\x41\x43TION_UNSPECIFIED\x10\x00\x12\x07\n\x03\x41\x44\x44\x10\x01\x12\n\n\x06REMOVE\x10\x02\"\xbd\x01\n\x10\x41uditConfigDelta\x12\x36\n\x06\x61\x63tion\x18\x01 \x01(\x0e\x32&.google.iam.v1.AuditConfigDelta.Action\x12\x0f\n\x07service\x18\x02 \x01(\t\x12\x17\n\x0f\x65xempted_member\x18\x03 \x01(\t\x12\x10\n\x08log_type\x18\x04 \x01(\t\"5\n\x06\x41\x63tion\x12\x16\n\x12\x41\x43TION_UNSPECIFIED\x10\x00\x12\x07\n\x03\x41\x44\x44\x10\x01\x12\n\n\x06REMOVE\x10\x02\x42|\n\x11\x63om.google.iam.v1B\x0bPolicyProtoP\x01Z)cloud.google.com/go/iam/apiv1/iampb;iampb\xf8\x01\x01\xaa\x02\x13Google.Cloud.Iam.V1\xca\x02\x13Google\\Cloud\\Iam\\V1b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Iam + module V1 + Policy = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.iam.v1.Policy").msgclass + Binding = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.iam.v1.Binding").msgclass + AuditConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.iam.v1.AuditConfig").msgclass + AuditLogConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.iam.v1.AuditLogConfig").msgclass + AuditLogConfig::LogType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.iam.v1.AuditLogConfig.LogType").enummodule + PolicyDelta = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.iam.v1.PolicyDelta").msgclass + BindingDelta = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.iam.v1.BindingDelta").msgclass + BindingDelta::Action = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.iam.v1.BindingDelta.Action").enummodule + AuditConfigDelta = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.iam.v1.AuditConfigDelta").msgclass + AuditConfigDelta::Action = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.iam.v1.AuditConfigDelta.Action").enummodule + end + end +end diff --git a/owl-bot-staging/google-iam-v1/lib/google/iam/v1/resource_policy_member_pb.rb b/owl-bot-staging/google-iam-v1/lib/google/iam/v1/resource_policy_member_pb.rb new file mode 100644 index 000000000000..21ae4b08c8dc --- /dev/null +++ b/owl-bot-staging/google-iam-v1/lib/google/iam/v1/resource_policy_member_pb.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/iam/v1/resource_policy_member.proto + +require 'google/protobuf' + +require 'google/api/field_behavior_pb' + + +descriptor_data = "\n*google/iam/v1/resource_policy_member.proto\x12\rgoogle.iam.v1\x1a\x1fgoogle/api/field_behavior.proto\"e\n\x14ResourcePolicyMember\x12&\n\x19iam_policy_name_principal\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12%\n\x18iam_policy_uid_principal\x18\x02 \x01(\tB\x03\xe0\x41\x03\x42\x87\x01\n\x11\x63om.google.iam.v1B\x19ResourcePolicyMemberProtoP\x01Z)cloud.google.com/go/iam/apiv1/iampb;iampb\xaa\x02\x13Google.Cloud.Iam.V1\xca\x02\x13Google\\Cloud\\Iam\\V1b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Iam + module V1 + ResourcePolicyMember = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.iam.v1.ResourcePolicyMember").msgclass + end + end +end diff --git a/owl-bot-staging/google-iam-v1/lib/google/iam/v1/rest.rb b/owl-bot-staging/google-iam-v1/lib/google/iam/v1/rest.rb new file mode 100644 index 000000000000..6c154f17a54d --- /dev/null +++ b/owl-bot-staging/google-iam-v1/lib/google/iam/v1/rest.rb @@ -0,0 +1,35 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/iam/v1/iam_policy/rest" +require "google/iam/v1/version" + +module Google + module Iam + ## + # To load just the REST part of this package, including all its services, and instantiate a REST client: + # + # @example + # + # require "google/iam/v1/rest" + # client = ::Google::Iam::V1::IAMPolicy::Rest::Client.new + # + module V1 + end + end +end diff --git a/owl-bot-staging/google-iam-v1/lib/google/iam/v1/version.rb b/owl-bot-staging/google-iam-v1/lib/google/iam/v1/version.rb new file mode 100644 index 000000000000..b2a1323c8493 --- /dev/null +++ b/owl-bot-staging/google-iam-v1/lib/google/iam/v1/version.rb @@ -0,0 +1,26 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Iam + module V1 + VERSION = "0.0.1" + end + end +end diff --git a/owl-bot-staging/google-iam-v1/proto_docs/README.md b/owl-bot-staging/google-iam-v1/proto_docs/README.md new file mode 100644 index 000000000000..d9dc948b945f --- /dev/null +++ b/owl-bot-staging/google-iam-v1/proto_docs/README.md @@ -0,0 +1,4 @@ +# IAM 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-iam-v1/proto_docs/google/api/client.rb b/owl-bot-staging/google-iam-v1/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..3ab0b096d445 --- /dev/null +++ b/owl-bot-staging/google-iam-v1/proto_docs/google/api/client.rb @@ -0,0 +1,593 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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. + # + # Note: This field should not be used in most cases. + 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: + # library_settings: + # 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. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Php. Clobbers the php_namespace option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.php.package_name" field + # in gapic.yaml. API teams should use the protobuf php_namespace option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # library_settings: + # php_settings: + # library_package: Google\Cloud\PubSub\V1 + 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. + # + # Example: + # + # 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 + # @!attribute [rw] batching + # @return [::Google::Api::BatchingConfigProto] + # Batching configuration for an API method in client libraries. + # + # Example of a YAML configuration: + # + # publishing: + # method_settings: + # - selector: google.example.v1.ExampleService.BatchCreateExample + # batching: + # element_count_threshold: 1000 + # request_byte_threshold: 100000000 + # delay_threshold_millis: 10 + 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. + # + # Note: This feature should not be used in most cases. + # @!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 + + # `BatchingConfigProto` defines the batching configuration for an API method. + # @!attribute [rw] thresholds + # @return [::Google::Api::BatchingSettingsProto] + # The thresholds which trigger a batched request to be sent. + # @!attribute [rw] batch_descriptor + # @return [::Google::Api::BatchingDescriptorProto] + # The request and response fields used in batching. + class BatchingConfigProto + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `BatchingSettingsProto` specifies a set of batching thresholds, each of + # which acts as a trigger to send a batch of messages as a request. At least + # one threshold must be positive nonzero. + # @!attribute [rw] element_count_threshold + # @return [::Integer] + # The number of elements of a field collected into a batch which, if + # exceeded, causes the batch to be sent. + # @!attribute [rw] request_byte_threshold + # @return [::Integer] + # The aggregated size of the batched field which, if exceeded, causes the + # batch to be sent. This size is computed by aggregating the sizes of the + # request field to be batched, not of the entire request message. + # @!attribute [rw] delay_threshold + # @return [::Google::Protobuf::Duration] + # The duration after which a batch should be sent, starting from the addition + # of the first message to that batch. + # @!attribute [rw] element_count_limit + # @return [::Integer] + # The maximum number of elements collected in a batch that could be accepted + # by server. + # @!attribute [rw] request_byte_limit + # @return [::Integer] + # The maximum size of the request that could be accepted by server. + # @!attribute [rw] flow_control_element_limit + # @return [::Integer] + # The maximum number of elements allowed by flow control. + # @!attribute [rw] flow_control_byte_limit + # @return [::Integer] + # The maximum size of data allowed by flow control. + # @!attribute [rw] flow_control_limit_exceeded_behavior + # @return [::Google::Api::FlowControlLimitExceededBehaviorProto] + # The behavior to take when the flow control limit is exceeded. + class BatchingSettingsProto + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `BatchingDescriptorProto` specifies the fields of the request message to be + # used for batching, and, optionally, the fields of the response message to be + # used for demultiplexing. + # @!attribute [rw] batched_field + # @return [::String] + # The repeated field in the request message to be aggregated by batching. + # @!attribute [rw] discriminator_fields + # @return [::Array<::String>] + # A list of the fields in the request message. Two requests will be batched + # together only if the values of every field specified in + # `request_discriminator_fields` is equal between the two requests. + # @!attribute [rw] subresponse_field + # @return [::String] + # Optional. When present, indicates the field in the response message to be + # used to demultiplex the response into multiple response messages, in + # correspondence with the multiple request messages originally batched + # together. + class BatchingDescriptorProto + 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 + + # The behavior to take when the flow control limit is exceeded. + module FlowControlLimitExceededBehaviorProto + # Default behavior, system-defined. + UNSET_BEHAVIOR = 0 + + # Stop operation, raise error. + THROW_EXCEPTION = 1 + + # Pause operation until limit clears. + BLOCK = 2 + + # Continue operation, disregard limit. + IGNORE = 3 + end + end +end diff --git a/owl-bot-staging/google-iam-v1/proto_docs/google/api/field_behavior.rb b/owl-bot-staging/google-iam-v1/proto_docs/google/api/field_behavior.rb new file mode 100644 index 000000000000..582be187d115 --- /dev/null +++ b/owl-bot-staging/google-iam-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-iam-v1/proto_docs/google/api/launch_stage.rb b/owl-bot-staging/google-iam-v1/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..9392a413fb1b --- /dev/null +++ b/owl-bot-staging/google-iam-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-iam-v1/proto_docs/google/api/resource.rb b/owl-bot-staging/google-iam-v1/proto_docs/google/api/resource.rb new file mode 100644 index 000000000000..25dec4847ac1 --- /dev/null +++ b/owl-bot-staging/google-iam-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-iam-v1/proto_docs/google/iam/v1/iam_policy.rb b/owl-bot-staging/google-iam-v1/proto_docs/google/iam/v1/iam_policy.rb new file mode 100644 index 000000000000..5445c77f8258 --- /dev/null +++ b/owl-bot-staging/google-iam-v1/proto_docs/google/iam/v1/iam_policy.rb @@ -0,0 +1,87 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Iam + module V1 + # Request message for `SetIamPolicy` method. + # @!attribute [rw] resource + # @return [::String] + # REQUIRED: The resource for which the policy is being specified. + # See the operation documentation for the appropriate value for this field. + # @!attribute [rw] policy + # @return [::Google::Iam::V1::Policy] + # REQUIRED: The complete policy to be applied to the `resource`. The size of + # the policy is limited to a few 10s of KB. An empty policy is a + # valid policy but certain Cloud Platform services (such as Projects) + # might reject them. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only + # the fields in the mask will be modified. If no mask is provided, the + # following default mask is used: + # + # `paths: "bindings, etag"` + class SetIamPolicyRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for `GetIamPolicy` method. + # @!attribute [rw] resource + # @return [::String] + # REQUIRED: The resource for which the policy is being requested. + # See the operation documentation for the appropriate value for this field. + # @!attribute [rw] options + # @return [::Google::Iam::V1::GetPolicyOptions] + # OPTIONAL: A `GetPolicyOptions` object for specifying options to + # `GetIamPolicy`. + class GetIamPolicyRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for `TestIamPermissions` method. + # @!attribute [rw] resource + # @return [::String] + # REQUIRED: The resource for which the policy detail is being requested. + # See the operation documentation for the appropriate value for this field. + # @!attribute [rw] permissions + # @return [::Array<::String>] + # The set of permissions to check for the `resource`. Permissions with + # wildcards (such as '*' or 'storage.*') are not allowed. For more + # information see + # [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). + class TestIamPermissionsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for `TestIamPermissions` method. + # @!attribute [rw] permissions + # @return [::Array<::String>] + # A subset of `TestPermissionsRequest.permissions` that the caller is + # allowed. + class TestIamPermissionsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end +end diff --git a/owl-bot-staging/google-iam-v1/proto_docs/google/iam/v1/options.rb b/owl-bot-staging/google-iam-v1/proto_docs/google/iam/v1/options.rb new file mode 100644 index 000000000000..60713d995b86 --- /dev/null +++ b/owl-bot-staging/google-iam-v1/proto_docs/google/iam/v1/options.rb @@ -0,0 +1,50 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Iam + module V1 + # Encapsulates settings provided to GetIamPolicy. + # @!attribute [rw] requested_policy_version + # @return [::Integer] + # Optional. The maximum policy version that will be used to format the + # policy. + # + # Valid values are 0, 1, and 3. Requests specifying an invalid value will be + # rejected. + # + # Requests for policies with any conditional role bindings must specify + # version 3. Policies with no conditional role bindings may specify any valid + # value or leave the field unset. + # + # The policy in the response might use the policy version that you specified, + # or it might use a lower policy version. For example, if you specify version + # 3, but the policy has no conditional role bindings, the response uses + # version 1. + # + # To learn which resources support conditions in their IAM policies, see the + # [IAM + # documentation](https://cloud.google.com/iam/help/conditions/resource-policies). + class GetPolicyOptions + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end +end diff --git a/owl-bot-staging/google-iam-v1/proto_docs/google/iam/v1/policy.rb b/owl-bot-staging/google-iam-v1/proto_docs/google/iam/v1/policy.rb new file mode 100644 index 000000000000..d693e0c6371c --- /dev/null +++ b/owl-bot-staging/google-iam-v1/proto_docs/google/iam/v1/policy.rb @@ -0,0 +1,426 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Iam + module V1 + # An Identity and Access Management (IAM) policy, which specifies access + # controls for Google Cloud resources. + # + # + # A `Policy` is a collection of `bindings`. A `binding` binds one or more + # `members`, or principals, to a single `role`. Principals can be user + # accounts, service accounts, Google groups, and domains (such as G Suite). A + # `role` is a named list of permissions; each `role` can be an IAM predefined + # role or a user-created custom role. + # + # For some types of Google Cloud resources, a `binding` can also specify a + # `condition`, which is a logical expression that allows access to a resource + # only if the expression evaluates to `true`. A condition can add constraints + # based on attributes of the request, the resource, or both. To learn which + # resources support conditions in their IAM policies, see the + # [IAM + # documentation](https://cloud.google.com/iam/help/conditions/resource-policies). + # + # **JSON example:** + # + # ``` + # { + # "bindings": [ + # { + # "role": "roles/resourcemanager.organizationAdmin", + # "members": [ + # "user:mike@example.com", + # "group:admins@example.com", + # "domain:google.com", + # "serviceAccount:my-project-id@appspot.gserviceaccount.com" + # ] + # }, + # { + # "role": "roles/resourcemanager.organizationViewer", + # "members": [ + # "user:eve@example.com" + # ], + # "condition": { + # "title": "expirable access", + # "description": "Does not grant access after Sep 2020", + # "expression": "request.time < + # timestamp('2020-10-01T00:00:00.000Z')", + # } + # } + # ], + # "etag": "BwWWja0YfJA=", + # "version": 3 + # } + # ``` + # + # **YAML example:** + # + # ``` + # bindings: + # - members: + # - user:mike@example.com + # - group:admins@example.com + # - domain:google.com + # - serviceAccount:my-project-id@appspot.gserviceaccount.com + # role: roles/resourcemanager.organizationAdmin + # - members: + # - user:eve@example.com + # role: roles/resourcemanager.organizationViewer + # condition: + # title: expirable access + # description: Does not grant access after Sep 2020 + # expression: request.time < timestamp('2020-10-01T00:00:00.000Z') + # etag: BwWWja0YfJA= + # version: 3 + # ``` + # + # For a description of IAM and its features, see the + # [IAM documentation](https://cloud.google.com/iam/docs/). + # @!attribute [rw] version + # @return [::Integer] + # Specifies the format of the policy. + # + # Valid values are `0`, `1`, and `3`. Requests that specify an invalid value + # are rejected. + # + # Any operation that affects conditional role bindings must specify version + # `3`. This requirement applies to the following operations: + # + # * Getting a policy that includes a conditional role binding + # * Adding a conditional role binding to a policy + # * Changing a conditional role binding in a policy + # * Removing any role binding, with or without a condition, from a policy + # that includes conditions + # + # **Important:** If you use IAM Conditions, you must include the `etag` field + # whenever you call `setIamPolicy`. If you omit this field, then IAM allows + # you to overwrite a version `3` policy with a version `1` policy, and all of + # the conditions in the version `3` policy are lost. + # + # If a policy does not include any conditions, operations on that policy may + # specify any valid version or leave the field unset. + # + # To learn which resources support conditions in their IAM policies, see the + # [IAM + # documentation](https://cloud.google.com/iam/help/conditions/resource-policies). + # @!attribute [rw] bindings + # @return [::Array<::Google::Iam::V1::Binding>] + # Associates a list of `members`, or principals, with a `role`. Optionally, + # may specify a `condition` that determines how and when the `bindings` are + # applied. Each of the `bindings` must contain at least one principal. + # + # The `bindings` in a `Policy` can refer to up to 1,500 principals; up to 250 + # of these principals can be Google groups. Each occurrence of a principal + # counts towards these limits. For example, if the `bindings` grant 50 + # different roles to `user:alice@example.com`, and not to any other + # principal, then you can add another 1,450 principals to the `bindings` in + # the `Policy`. + # @!attribute [rw] audit_configs + # @return [::Array<::Google::Iam::V1::AuditConfig>] + # Specifies cloud audit logging configuration for this policy. + # @!attribute [rw] etag + # @return [::String] + # `etag` is used for optimistic concurrency control as a way to help + # prevent simultaneous updates of a policy from overwriting each other. + # It is strongly suggested that systems make use of the `etag` in the + # read-modify-write cycle to perform policy updates in order to avoid race + # conditions: An `etag` is returned in the response to `getIamPolicy`, and + # systems are expected to put that etag in the request to `setIamPolicy` to + # ensure that their change will be applied to the same version of the policy. + # + # **Important:** If you use IAM Conditions, you must include the `etag` field + # whenever you call `setIamPolicy`. If you omit this field, then IAM allows + # you to overwrite a version `3` policy with a version `1` policy, and all of + # the conditions in the version `3` policy are lost. + class Policy + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Associates `members`, or principals, with a `role`. + # @!attribute [rw] role + # @return [::String] + # Role that is assigned to the list of `members`, or principals. + # For example, `roles/viewer`, `roles/editor`, or `roles/owner`. + # @!attribute [rw] members + # @return [::Array<::String>] + # Specifies the principals requesting access for a Google Cloud resource. + # `members` can have the following values: + # + # * `allUsers`: A special identifier that represents anyone who is + # on the internet; with or without a Google account. + # + # * `allAuthenticatedUsers`: A special identifier that represents anyone + # who is authenticated with a Google account or a service account. + # + # * `user:{emailid}`: An email address that represents a specific Google + # account. For example, `alice@example.com` . + # + # + # * `serviceAccount:{emailid}`: An email address that represents a service + # account. For example, `my-other-app@appspot.gserviceaccount.com`. + # + # * `group:{emailid}`: An email address that represents a Google group. + # For example, `admins@example.com`. + # + # * `deleted:user:{emailid}?uid={uniqueid}`: An email address (plus unique + # identifier) representing a user that has been recently deleted. For + # example, `alice@example.com?uid=123456789012345678901`. If the user is + # recovered, this value reverts to `user:{emailid}` and the recovered user + # retains the role in the binding. + # + # * `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address (plus + # unique identifier) representing a service account that has been recently + # deleted. For example, + # `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`. + # If the service account is undeleted, this value reverts to + # `serviceAccount:{emailid}` and the undeleted service account retains the + # role in the binding. + # + # * `deleted:group:{emailid}?uid={uniqueid}`: An email address (plus unique + # identifier) representing a Google group that has been recently + # deleted. For example, `admins@example.com?uid=123456789012345678901`. If + # the group is recovered, this value reverts to `group:{emailid}` and the + # recovered group retains the role in the binding. + # + # + # * `domain:{domain}`: The G Suite domain (primary) that represents all the + # users of that domain. For example, `google.com` or `example.com`. + # @!attribute [rw] condition + # @return [::Google::Type::Expr] + # The condition that is associated with this binding. + # + # If the condition evaluates to `true`, then this binding applies to the + # current request. + # + # If the condition evaluates to `false`, then this binding does not apply to + # the current request. However, a different role binding might grant the same + # role to one or more of the principals in this binding. + # + # To learn which resources support conditions in their IAM policies, see the + # [IAM + # documentation](https://cloud.google.com/iam/help/conditions/resource-policies). + class Binding + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Specifies the audit configuration for a service. + # The configuration determines which permission types are logged, and what + # identities, if any, are exempted from logging. + # An AuditConfig must have one or more AuditLogConfigs. + # + # If there are AuditConfigs for both `allServices` and a specific service, + # the union of the two AuditConfigs is used for that service: the log_types + # specified in each AuditConfig are enabled, and the exempted_members in each + # AuditLogConfig are exempted. + # + # Example Policy with multiple AuditConfigs: + # + # { + # "audit_configs": [ + # { + # "service": "allServices", + # "audit_log_configs": [ + # { + # "log_type": "DATA_READ", + # "exempted_members": [ + # "user:jose@example.com" + # ] + # }, + # { + # "log_type": "DATA_WRITE" + # }, + # { + # "log_type": "ADMIN_READ" + # } + # ] + # }, + # { + # "service": "sampleservice.googleapis.com", + # "audit_log_configs": [ + # { + # "log_type": "DATA_READ" + # }, + # { + # "log_type": "DATA_WRITE", + # "exempted_members": [ + # "user:aliya@example.com" + # ] + # } + # ] + # } + # ] + # } + # + # For sampleservice, this policy enables DATA_READ, DATA_WRITE and ADMIN_READ + # logging. It also exempts `jose@example.com` from DATA_READ logging, and + # `aliya@example.com` from DATA_WRITE logging. + # @!attribute [rw] service + # @return [::String] + # Specifies a service that will be enabled for audit logging. + # For example, `storage.googleapis.com`, `cloudsql.googleapis.com`. + # `allServices` is a special value that covers all services. + # @!attribute [rw] audit_log_configs + # @return [::Array<::Google::Iam::V1::AuditLogConfig>] + # The configuration for logging of each type of permission. + class AuditConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Provides the configuration for logging a type of permissions. + # Example: + # + # { + # "audit_log_configs": [ + # { + # "log_type": "DATA_READ", + # "exempted_members": [ + # "user:jose@example.com" + # ] + # }, + # { + # "log_type": "DATA_WRITE" + # } + # ] + # } + # + # This enables 'DATA_READ' and 'DATA_WRITE' logging, while exempting + # jose@example.com from DATA_READ logging. + # @!attribute [rw] log_type + # @return [::Google::Iam::V1::AuditLogConfig::LogType] + # The log type that this config enables. + # @!attribute [rw] exempted_members + # @return [::Array<::String>] + # Specifies the identities that do not cause logging for this type of + # permission. + # Follows the same format of + # {::Google::Iam::V1::Binding#members Binding.members}. + class AuditLogConfig + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The list of valid permission types for which logging can be configured. + # Admin writes are always logged, and are not configurable. + module LogType + # Default case. Should never be this. + LOG_TYPE_UNSPECIFIED = 0 + + # Admin reads. Example: CloudIAM getIamPolicy + ADMIN_READ = 1 + + # Data writes. Example: CloudSQL Users create + DATA_WRITE = 2 + + # Data reads. Example: CloudSQL Users list + DATA_READ = 3 + end + end + + # The difference delta between two policies. + # @!attribute [rw] binding_deltas + # @return [::Array<::Google::Iam::V1::BindingDelta>] + # The delta for Bindings between two policies. + # @!attribute [rw] audit_config_deltas + # @return [::Array<::Google::Iam::V1::AuditConfigDelta>] + # The delta for AuditConfigs between two policies. + class PolicyDelta + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # One delta entry for Binding. Each individual change (only one member in each + # entry) to a binding will be a separate entry. + # @!attribute [rw] action + # @return [::Google::Iam::V1::BindingDelta::Action] + # The action that was performed on a Binding. + # Required + # @!attribute [rw] role + # @return [::String] + # Role that is assigned to `members`. + # For example, `roles/viewer`, `roles/editor`, or `roles/owner`. + # Required + # @!attribute [rw] member + # @return [::String] + # A single identity requesting access for a Google Cloud resource. + # Follows the same format of Binding.members. + # Required + # @!attribute [rw] condition + # @return [::Google::Type::Expr] + # The condition that is associated with this binding. + class BindingDelta + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The type of action performed on a Binding in a policy. + module Action + # Unspecified. + ACTION_UNSPECIFIED = 0 + + # Addition of a Binding. + ADD = 1 + + # Removal of a Binding. + REMOVE = 2 + end + end + + # One delta entry for AuditConfig. Each individual change (only one + # exempted_member in each entry) to a AuditConfig will be a separate entry. + # @!attribute [rw] action + # @return [::Google::Iam::V1::AuditConfigDelta::Action] + # The action that was performed on an audit configuration in a policy. + # Required + # @!attribute [rw] service + # @return [::String] + # Specifies a service that was configured for Cloud Audit Logging. + # For example, `storage.googleapis.com`, `cloudsql.googleapis.com`. + # `allServices` is a special value that covers all services. + # Required + # @!attribute [rw] exempted_member + # @return [::String] + # A single identity that is exempted from "data access" audit + # logging for the `service` specified above. + # Follows the same format of Binding.members. + # @!attribute [rw] log_type + # @return [::String] + # Specifies the log_type that was be enabled. ADMIN_ACTIVITY is always + # enabled, and cannot be configured. + # Required + class AuditConfigDelta + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The type of action performed on an audit configuration in a policy. + module Action + # Unspecified. + ACTION_UNSPECIFIED = 0 + + # Addition of an audit configuration. + ADD = 1 + + # Removal of an audit configuration. + REMOVE = 2 + end + end + end + end +end diff --git a/owl-bot-staging/google-iam-v1/proto_docs/google/iam/v1/resource_policy_member.rb b/owl-bot-staging/google-iam-v1/proto_docs/google/iam/v1/resource_policy_member.rb new file mode 100644 index 000000000000..5f60d79049ba --- /dev/null +++ b/owl-bot-staging/google-iam-v1/proto_docs/google/iam/v1/resource_policy_member.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! + + +module Google + module Iam + module V1 + # Output-only policy member strings of a Google Cloud resource's built-in + # identity. + # @!attribute [r] iam_policy_name_principal + # @return [::String] + # IAM policy binding member referring to a Google Cloud resource by + # user-assigned name (https://google.aip.dev/122). If a resource is deleted + # and recreated with the same name, the binding will be applicable to the new + # resource. + # + # Example: + # `principal://parametermanager.googleapis.com/projects/12345/name/locations/us-central1-a/parameters/my-parameter` + # @!attribute [r] iam_policy_uid_principal + # @return [::String] + # IAM policy binding member referring to a Google Cloud resource by + # system-assigned unique identifier (https://google.aip.dev/148#uid). If a + # resource is deleted and recreated with the same name, the binding will not + # be applicable to the new resource + # + # Example: + # `principal://parametermanager.googleapis.com/projects/12345/uid/locations/us-central1-a/parameters/a918fed5` + class ResourcePolicyMember + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end +end diff --git a/owl-bot-staging/google-iam-v1/proto_docs/google/protobuf/duration.rb b/owl-bot-staging/google-iam-v1/proto_docs/google/protobuf/duration.rb new file mode 100644 index 000000000000..ea59f1f91daf --- /dev/null +++ b/owl-bot-staging/google-iam-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-iam-v1/proto_docs/google/protobuf/field_mask.rb b/owl-bot-staging/google-iam-v1/proto_docs/google/protobuf/field_mask.rb new file mode 100644 index 000000000000..7f3ffc78601a --- /dev/null +++ b/owl-bot-staging/google-iam-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-iam-v1/proto_docs/google/type/expr.rb b/owl-bot-staging/google-iam-v1/proto_docs/google/type/expr.rb new file mode 100644 index 000000000000..53e7733b6592 --- /dev/null +++ b/owl-bot-staging/google-iam-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-iam-v1/snippets/Gemfile b/owl-bot-staging/google-iam-v1/snippets/Gemfile new file mode 100644 index 000000000000..222c98f20f3c --- /dev/null +++ b/owl-bot-staging/google-iam-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-iam-v1", path: "../" +else + gem "google-iam-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-iam-v1/snippets/iam_policy/get_iam_policy.rb b/owl-bot-staging/google-iam-v1/snippets/iam_policy/get_iam_policy.rb new file mode 100644 index 000000000000..c1935fa21a05 --- /dev/null +++ b/owl-bot-staging/google-iam-v1/snippets/iam_policy/get_iam_policy.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 iam_v1_generated_IAMPolicy_GetIamPolicy_sync] +require "google/iam/v1" + +## +# Snippet for the get_iam_policy call in the IAMPolicy 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::Iam::V1::IAMPolicy::Client#get_iam_policy. +# +def get_iam_policy + # Create a client object. The client can be reused for multiple calls. + client = Google::Iam::V1::IAMPolicy::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::V1::GetIamPolicyRequest.new + + # Call the get_iam_policy method. + result = client.get_iam_policy request + + # The returned object is of type Google::Iam::V1::Policy. + p result +end +# [END iam_v1_generated_IAMPolicy_GetIamPolicy_sync] diff --git a/owl-bot-staging/google-iam-v1/snippets/iam_policy/set_iam_policy.rb b/owl-bot-staging/google-iam-v1/snippets/iam_policy/set_iam_policy.rb new file mode 100644 index 000000000000..81aaa0bbdad7 --- /dev/null +++ b/owl-bot-staging/google-iam-v1/snippets/iam_policy/set_iam_policy.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 iam_v1_generated_IAMPolicy_SetIamPolicy_sync] +require "google/iam/v1" + +## +# Snippet for the set_iam_policy call in the IAMPolicy 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::Iam::V1::IAMPolicy::Client#set_iam_policy. +# +def set_iam_policy + # Create a client object. The client can be reused for multiple calls. + client = Google::Iam::V1::IAMPolicy::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::V1::SetIamPolicyRequest.new + + # Call the set_iam_policy method. + result = client.set_iam_policy request + + # The returned object is of type Google::Iam::V1::Policy. + p result +end +# [END iam_v1_generated_IAMPolicy_SetIamPolicy_sync] diff --git a/owl-bot-staging/google-iam-v1/snippets/iam_policy/test_iam_permissions.rb b/owl-bot-staging/google-iam-v1/snippets/iam_policy/test_iam_permissions.rb new file mode 100644 index 000000000000..2379ca2c168d --- /dev/null +++ b/owl-bot-staging/google-iam-v1/snippets/iam_policy/test_iam_permissions.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 iam_v1_generated_IAMPolicy_TestIamPermissions_sync] +require "google/iam/v1" + +## +# Snippet for the test_iam_permissions call in the IAMPolicy 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::Iam::V1::IAMPolicy::Client#test_iam_permissions. +# +def test_iam_permissions + # Create a client object. The client can be reused for multiple calls. + client = Google::Iam::V1::IAMPolicy::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::V1::TestIamPermissionsRequest.new + + # Call the test_iam_permissions method. + result = client.test_iam_permissions request + + # The returned object is of type Google::Iam::V1::TestIamPermissionsResponse. + p result +end +# [END iam_v1_generated_IAMPolicy_TestIamPermissions_sync] diff --git a/owl-bot-staging/google-iam-v1/snippets/snippet_metadata_google.iam.v1.json b/owl-bot-staging/google-iam-v1/snippets/snippet_metadata_google.iam.v1.json new file mode 100644 index 000000000000..93be3207db59 --- /dev/null +++ b/owl-bot-staging/google-iam-v1/snippets/snippet_metadata_google.iam.v1.json @@ -0,0 +1,135 @@ +{ + "client_library": { + "name": "google-iam-v1", + "version": "", + "language": "RUBY", + "apis": [ + { + "id": "google.iam.v1", + "version": "v1" + } + ] + }, + "snippets": [ + { + "region_tag": "iam_v1_generated_IAMPolicy_SetIamPolicy_sync", + "title": "Snippet for the set_iam_policy call in the IAMPolicy service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Iam::V1::IAMPolicy::Client#set_iam_policy.", + "file": "iam_policy/set_iam_policy.rb", + "language": "RUBY", + "client_method": { + "short_name": "set_iam_policy", + "full_name": "::Google::Iam::V1::IAMPolicy::Client#set_iam_policy", + "async": false, + "parameters": [ + { + "type": "::Google::Iam::V1::SetIamPolicyRequest", + "name": "request" + } + ], + "result_type": "::Google::Iam::V1::Policy", + "client": { + "short_name": "IAMPolicy::Client", + "full_name": "::Google::Iam::V1::IAMPolicy::Client" + }, + "method": { + "short_name": "SetIamPolicy", + "full_name": "google.iam.v1.IAMPolicy.SetIamPolicy", + "service": { + "short_name": "IAMPolicy", + "full_name": "google.iam.v1.IAMPolicy" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "iam_v1_generated_IAMPolicy_GetIamPolicy_sync", + "title": "Snippet for the get_iam_policy call in the IAMPolicy service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Iam::V1::IAMPolicy::Client#get_iam_policy.", + "file": "iam_policy/get_iam_policy.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_iam_policy", + "full_name": "::Google::Iam::V1::IAMPolicy::Client#get_iam_policy", + "async": false, + "parameters": [ + { + "type": "::Google::Iam::V1::GetIamPolicyRequest", + "name": "request" + } + ], + "result_type": "::Google::Iam::V1::Policy", + "client": { + "short_name": "IAMPolicy::Client", + "full_name": "::Google::Iam::V1::IAMPolicy::Client" + }, + "method": { + "short_name": "GetIamPolicy", + "full_name": "google.iam.v1.IAMPolicy.GetIamPolicy", + "service": { + "short_name": "IAMPolicy", + "full_name": "google.iam.v1.IAMPolicy" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "iam_v1_generated_IAMPolicy_TestIamPermissions_sync", + "title": "Snippet for the test_iam_permissions call in the IAMPolicy service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Iam::V1::IAMPolicy::Client#test_iam_permissions.", + "file": "iam_policy/test_iam_permissions.rb", + "language": "RUBY", + "client_method": { + "short_name": "test_iam_permissions", + "full_name": "::Google::Iam::V1::IAMPolicy::Client#test_iam_permissions", + "async": false, + "parameters": [ + { + "type": "::Google::Iam::V1::TestIamPermissionsRequest", + "name": "request" + } + ], + "result_type": "::Google::Iam::V1::TestIamPermissionsResponse", + "client": { + "short_name": "IAMPolicy::Client", + "full_name": "::Google::Iam::V1::IAMPolicy::Client" + }, + "method": { + "short_name": "TestIamPermissions", + "full_name": "google.iam.v1.IAMPolicy.TestIamPermissions", + "service": { + "short_name": "IAMPolicy", + "full_name": "google.iam.v1.IAMPolicy" + } + } + }, + "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-iam-v1/test/google/iam/v1/iam_policy_rest_test.rb b/owl-bot-staging/google-iam-v1/test/google/iam/v1/iam_policy_rest_test.rb new file mode 100644 index 000000000000..5872de89cd6b --- /dev/null +++ b/owl-bot-staging/google-iam-v1/test/google/iam/v1/iam_policy_rest_test.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 "helper" +require "gapic/rest" +require "google/iam/v1/iam_policy_pb" +require "google/iam/v1/iam_policy/rest" + + +class ::Google::Iam::V1::IAMPolicy::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_set_iam_policy + # Create test objects. + client_result = ::Google::Iam::V1::Policy.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + resource = "hello world" + policy = {} + update_mask = {} + + set_iam_policy_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::Iam::V1::IAMPolicy::Rest::ServiceStub.stub :transcode_set_iam_policy_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, set_iam_policy_client_stub do + # Create client + client = ::Google::Iam::V1::IAMPolicy::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.set_iam_policy({ resource: resource, policy: policy, update_mask: update_mask }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.set_iam_policy resource: resource, policy: policy, update_mask: update_mask do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.set_iam_policy ::Google::Iam::V1::SetIamPolicyRequest.new(resource: resource, policy: policy, update_mask: update_mask) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.set_iam_policy({ resource: resource, policy: policy, update_mask: update_mask }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.set_iam_policy(::Google::Iam::V1::SetIamPolicyRequest.new(resource: resource, policy: policy, update_mask: update_mask), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, set_iam_policy_client_stub.call_count + end + end + end + + def test_get_iam_policy + # Create test objects. + client_result = ::Google::Iam::V1::Policy.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + resource = "hello world" + options = {} + + get_iam_policy_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::Iam::V1::IAMPolicy::Rest::ServiceStub.stub :transcode_get_iam_policy_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_iam_policy_client_stub do + # Create client + client = ::Google::Iam::V1::IAMPolicy::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_iam_policy({ resource: resource, options: options }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_iam_policy resource: resource, options: options do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_iam_policy ::Google::Iam::V1::GetIamPolicyRequest.new(resource: resource, options: options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_iam_policy({ resource: resource, options: options }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_iam_policy(::Google::Iam::V1::GetIamPolicyRequest.new(resource: resource, options: options), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_iam_policy_client_stub.call_count + end + end + end + + def test_test_iam_permissions + # Create test objects. + client_result = ::Google::Iam::V1::TestIamPermissionsResponse.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + resource = "hello world" + permissions = ["hello world"] + + test_iam_permissions_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::Iam::V1::IAMPolicy::Rest::ServiceStub.stub :transcode_test_iam_permissions_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, test_iam_permissions_client_stub do + # Create client + client = ::Google::Iam::V1::IAMPolicy::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.test_iam_permissions({ resource: resource, permissions: permissions }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.test_iam_permissions resource: resource, permissions: permissions do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.test_iam_permissions ::Google::Iam::V1::TestIamPermissionsRequest.new(resource: resource, permissions: permissions) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.test_iam_permissions({ resource: resource, permissions: permissions }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.test_iam_permissions(::Google::Iam::V1::TestIamPermissionsRequest.new(resource: resource, permissions: permissions), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, test_iam_permissions_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::Iam::V1::IAMPolicy::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::Iam::V1::IAMPolicy::Rest::Client::Configuration, config + end +end diff --git a/owl-bot-staging/google-iam-v1/test/google/iam/v1/iam_policy_test.rb b/owl-bot-staging/google-iam-v1/test/google/iam/v1/iam_policy_test.rb new file mode 100644 index 000000000000..fbfb3e8939bd --- /dev/null +++ b/owl-bot-staging/google-iam-v1/test/google/iam/v1/iam_policy_test.rb @@ -0,0 +1,286 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/iam/v1/iam_policy_pb" +require "google/iam/v1/iam_policy" + +class ::Google::Iam::V1::IAMPolicy::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_set_iam_policy + # Create GRPC objects. + grpc_response = ::Google::Iam::V1::Policy.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. + resource = "hello world" + policy = {} + update_mask = {} + + set_iam_policy_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :set_iam_policy, name + assert_kind_of ::Google::Iam::V1::SetIamPolicyRequest, request + assert_equal "hello world", request["resource"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Iam::V1::Policy), request["policy"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, set_iam_policy_client_stub do + # Create client + client = ::Google::Iam::V1::IAMPolicy::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.set_iam_policy({ resource: resource, policy: policy, update_mask: update_mask }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.set_iam_policy resource: resource, policy: policy, update_mask: update_mask do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.set_iam_policy ::Google::Iam::V1::SetIamPolicyRequest.new(resource: resource, policy: policy, update_mask: update_mask) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.set_iam_policy({ resource: resource, policy: policy, 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.set_iam_policy(::Google::Iam::V1::SetIamPolicyRequest.new(resource: resource, policy: policy, 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, set_iam_policy_client_stub.call_rpc_count + end + end + + def test_get_iam_policy + # Create GRPC objects. + grpc_response = ::Google::Iam::V1::Policy.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. + resource = "hello world" + options = {} + + get_iam_policy_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_iam_policy, name + assert_kind_of ::Google::Iam::V1::GetIamPolicyRequest, request + assert_equal "hello world", request["resource"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Iam::V1::GetPolicyOptions), request["options"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_iam_policy_client_stub do + # Create client + client = ::Google::Iam::V1::IAMPolicy::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_iam_policy({ resource: resource, options: options }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_iam_policy resource: resource, options: options do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_iam_policy ::Google::Iam::V1::GetIamPolicyRequest.new(resource: resource, options: options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_iam_policy({ resource: resource, options: options }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.get_iam_policy(::Google::Iam::V1::GetIamPolicyRequest.new(resource: resource, options: options), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, get_iam_policy_client_stub.call_rpc_count + end + end + + def test_test_iam_permissions + # Create GRPC objects. + grpc_response = ::Google::Iam::V1::TestIamPermissionsResponse.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. + resource = "hello world" + permissions = ["hello world"] + + test_iam_permissions_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :test_iam_permissions, name + assert_kind_of ::Google::Iam::V1::TestIamPermissionsRequest, request + assert_equal "hello world", request["resource"] + assert_equal ["hello world"], request["permissions"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, test_iam_permissions_client_stub do + # Create client + client = ::Google::Iam::V1::IAMPolicy::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.test_iam_permissions({ resource: resource, permissions: permissions }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.test_iam_permissions resource: resource, permissions: permissions do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.test_iam_permissions ::Google::Iam::V1::TestIamPermissionsRequest.new(resource: resource, permissions: permissions) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.test_iam_permissions({ resource: resource, permissions: permissions }, grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object with options + client.test_iam_permissions(::Google::Iam::V1::TestIamPermissionsRequest.new(resource: resource, permissions: permissions), grpc_options) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Verify method calls + assert_equal 5, test_iam_permissions_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::Iam::V1::IAMPolicy::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::Iam::V1::IAMPolicy::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::Iam::V1::IAMPolicy::Client.new do |config| + config.credentials = creds + end + assert_kind_of ::Google::Iam::V1::IAMPolicy::Client, client + assert_equal creds, client.configure.credentials + end + end +end diff --git a/owl-bot-staging/google-iam-v1/test/helper.rb b/owl-bot-staging/google-iam-v1/test/helper.rb new file mode 100644 index 000000000000..672b337030e7 --- /dev/null +++ b/owl-bot-staging/google-iam-v1/test/helper.rb @@ -0,0 +1,26 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/mock" +require "minitest/rg" + +require "grpc" + +require "ostruct" diff --git a/owl-bot-staging/google-iam-v1beta/.gitignore b/owl-bot-staging/google-iam-v1beta/.gitignore new file mode 100644 index 000000000000..0135b6bc6cfc --- /dev/null +++ b/owl-bot-staging/google-iam-v1beta/.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-iam-v1beta/.repo-metadata.json b/owl-bot-staging/google-iam-v1beta/.repo-metadata.json new file mode 100644 index 000000000000..7bc483fbac5e --- /dev/null +++ b/owl-bot-staging/google-iam-v1beta/.repo-metadata.json @@ -0,0 +1,18 @@ +{ + "api_id": "iam.googleapis.com", + "api_shortname": "iam", + "client_documentation": "https://rubydoc.info/gems/google-iam-v1beta", + "distribution_name": "google-iam-v1beta", + "is_cloud": false, + "language": "ruby", + "name": "iam", + "name_pretty": "Google IAM V1beta API", + "product_documentation": "https://cloud.google.com/iam/docs/manage-workload-identity-pools-providers", + "release_level": "unreleased", + "repo": "googleapis/google-cloud-ruby", + "requires_billing": true, + "ruby-cloud-description": "Pre-release client for the WorkloadIdentityPools service. Note that google-iam-v1beta is a version-specific client library. For most uses, we recommend installing the main client library google-iam instead. See the readme for more details.", + "ruby-cloud-env-prefix": "IAM", + "ruby-cloud-product-url": "https://cloud.google.com/iam/docs/manage-workload-identity-pools-providers", + "library_type": "GAPIC_AUTO" +} diff --git a/owl-bot-staging/google-iam-v1beta/.rubocop.yml b/owl-bot-staging/google-iam-v1beta/.rubocop.yml new file mode 100644 index 000000000000..e1301e1a1ab9 --- /dev/null +++ b/owl-bot-staging/google-iam-v1beta/.rubocop.yml @@ -0,0 +1,33 @@ +inherit_gem: + google-style: google-style.yml + +AllCops: + Exclude: + - "google-iam-v1beta.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-iam-v1beta.rb" diff --git a/owl-bot-staging/google-iam-v1beta/.toys.rb b/owl-bot-staging/google-iam-v1beta/.toys.rb new file mode 100644 index 000000000000..177e22456e8a --- /dev/null +++ b/owl-bot-staging/google-iam-v1beta/.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-iam-v1beta/.yardopts b/owl-bot-staging/google-iam-v1beta/.yardopts new file mode 100644 index 000000000000..db01ec47e974 --- /dev/null +++ b/owl-bot-staging/google-iam-v1beta/.yardopts @@ -0,0 +1,12 @@ +--no-private +--title="Google IAM V1beta 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-iam-v1beta/AUTHENTICATION.md b/owl-bot-staging/google-iam-v1beta/AUTHENTICATION.md new file mode 100644 index 000000000000..b760c7d68202 --- /dev/null +++ b/owl-bot-staging/google-iam-v1beta/AUTHENTICATION.md @@ -0,0 +1,122 @@ +# Authentication + +The recommended way to authenticate to the google-iam-v1beta 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-iam-v1beta 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/iam/v1beta" + +client = ::Google::Iam::V1beta::WorkloadIdentityPools::Client.new do |config| + config.credentials = "path/to/credentialfile.json" +end +``` + +To configure a credentials file globally for all clients: + +```ruby +require "google/iam/v1beta" + +::Google::Iam::V1beta::WorkloadIdentityPools::Client.configure do |config| + config.credentials = "path/to/credentialfile.json" +end + +client = ::Google::Iam::V1beta::WorkloadIdentityPools::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-iam-v1beta +checks for credentials are: + +* `GOOGLE_CLOUD_CREDENTIALS` - Path to JSON file, or JSON contents +* `GOOGLE_APPLICATION_CREDENTIALS` - Path to JSON file + +```ruby +require "google/iam/v1beta" + +ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" + +client = ::Google::Iam::V1beta::WorkloadIdentityPools::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-iam-v1beta/CHANGELOG.md b/owl-bot-staging/google-iam-v1beta/CHANGELOG.md new file mode 100644 index 000000000000..f88957a62ba2 --- /dev/null +++ b/owl-bot-staging/google-iam-v1beta/CHANGELOG.md @@ -0,0 +1,2 @@ +# Release History + diff --git a/owl-bot-staging/google-iam-v1beta/Gemfile b/owl-bot-staging/google-iam-v1beta/Gemfile new file mode 100644 index 000000000000..1d08558908d8 --- /dev/null +++ b/owl-bot-staging/google-iam-v1beta/Gemfile @@ -0,0 +1,14 @@ +source "https://rubygems.org" + +gemspec + +gem "google-style", "~> 1.32.0" +gem "irb", "~> 1.17" +gem "minitest", "~> 6.0.2" +gem "minitest-focus", "~> 1.4" +gem "minitest-mock", "~> 5.27" +gem "minitest-rg", "~> 5.3" +gem "ostruct", "~> 0.5.5" +gem "rake", ">= 13.0" +gem "redcarpet", "~> 3.6" +gem "yard", "~> 0.9" diff --git a/owl-bot-staging/google-iam-v1beta/LICENSE.md b/owl-bot-staging/google-iam-v1beta/LICENSE.md new file mode 100644 index 000000000000..c261857ba6ad --- /dev/null +++ b/owl-bot-staging/google-iam-v1beta/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-iam-v1beta/README.md b/owl-bot-staging/google-iam-v1beta/README.md new file mode 100644 index 000000000000..d6d0d514aaf4 --- /dev/null +++ b/owl-bot-staging/google-iam-v1beta/README.md @@ -0,0 +1,154 @@ +# Ruby Client for the Google IAM V1beta API + +Manages identity and access control for Google Cloud Platform resources, including the creation of service accounts, which you can use to authenticate to Google and make API calls. Note: This API is tied to the IAM service account credentials API (iamcredentials.googleapis.com). Enabling or disabling this API will also enable or disable the IAM service account credentials API. + +Pre-release client for the WorkloadIdentityPools service. + +https://github.com/googleapis/google-cloud-ruby + +This gem is a _versioned_ client. It provides basic client classes for a +specific version of the Google IAM V1beta API. Most users should consider using +the main client gem, +[google-iam](https://rubygems.org/gems/google-iam). +See the section below titled *Which client should I use?* for more information. + +## Installation + +``` +$ gem install google-iam-v1beta +``` + +## 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/iam.googleapis.com) +1. [Set up authentication.](AUTHENTICATION.md) + +## Quick Start + +```ruby +require "google/iam/v1beta" + +client = ::Google::Iam::V1beta::WorkloadIdentityPools::Client.new +request = ::Google::Iam::V1beta::ListWorkloadIdentityPoolsRequest.new # (request fields as keyword arguments...) +response = client.list_workload_identity_pools request +``` + +View the [Client Library Documentation](https://rubydoc.info/gems/google-iam-v1beta) +for class and method documentation. + +See also the [Product Documentation](https://cloud.google.com/iam/docs/manage-workload-identity-pools-providers) +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/iam/v1beta" +require "logger" + +client = ::Google::Iam::V1beta::WorkloadIdentityPools::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-iam`, +and lower-level _versioned_ client libraries with names such as +`google-iam-v1beta`. +_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-iam`. +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-iam-v1beta`. + +### 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-iam-v1beta/Rakefile b/owl-bot-staging/google-iam-v1beta/Rakefile new file mode 100644 index 000000000000..e0cb1430b9ad --- /dev/null +++ b/owl-bot-staging/google-iam-v1beta/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-iam-v1beta acceptance tests." +task :acceptance, :project, :keyfile do |t, args| + project = args[:project] + project ||= + ENV["IAM_TEST_PROJECT"] || + ENV["GCLOUD_TEST_PROJECT"] + keyfile = args[:keyfile] + keyfile ||= + ENV["IAM_TEST_KEYFILE"] || + ENV["GCLOUD_TEST_KEYFILE"] + if keyfile + keyfile = File.read keyfile + else + keyfile ||= + ENV["IAM_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 IAM_TEST_PROJECT=test123 IAM_TEST_KEYFILE=/path/to/keyfile.json rake acceptance" + end + require "google/iam/v1beta/workload_identity_pools/credentials" + ::Google::Iam::V1beta::WorkloadIdentityPools::Credentials.env_vars.each do |path| + ENV[path] = nil + end + ENV["IAM_PROJECT"] = project + ENV["IAM_TEST_PROJECT"] = project + ENV["IAM_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-iam-v1beta 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-iam-v1beta 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-iam-v1beta 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-iam-v1beta gem does not have doctest tests." +end + +desc "Run the CI build" +task :ci do + header "BUILDING google-iam-v1beta" + header "google-iam-v1beta rubocop", "*" + Rake::Task[:rubocop].invoke + header "google-iam-v1beta yard", "*" + Rake::Task[:yard].invoke + header "google-iam-v1beta 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-iam-v1beta 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-iam-v1beta 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-iam-v1beta/gapic_metadata.json b/owl-bot-staging/google-iam-v1beta/gapic_metadata.json new file mode 100644 index 000000000000..20698b70c75f --- /dev/null +++ b/owl-bot-staging/google-iam-v1beta/gapic_metadata.json @@ -0,0 +1,78 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "ruby", + "protoPackage": "google.iam.v1beta", + "libraryPackage": "::Google::Iam::V1beta", + "services": { + "WorkloadIdentityPools": { + "clients": { + "grpc": { + "libraryClient": "::Google::Iam::V1beta::WorkloadIdentityPools::Client", + "rpcs": { + "ListWorkloadIdentityPools": { + "methods": [ + "list_workload_identity_pools" + ] + }, + "GetWorkloadIdentityPool": { + "methods": [ + "get_workload_identity_pool" + ] + }, + "CreateWorkloadIdentityPool": { + "methods": [ + "create_workload_identity_pool" + ] + }, + "UpdateWorkloadIdentityPool": { + "methods": [ + "update_workload_identity_pool" + ] + }, + "DeleteWorkloadIdentityPool": { + "methods": [ + "delete_workload_identity_pool" + ] + }, + "UndeleteWorkloadIdentityPool": { + "methods": [ + "undelete_workload_identity_pool" + ] + }, + "ListWorkloadIdentityPoolProviders": { + "methods": [ + "list_workload_identity_pool_providers" + ] + }, + "GetWorkloadIdentityPoolProvider": { + "methods": [ + "get_workload_identity_pool_provider" + ] + }, + "CreateWorkloadIdentityPoolProvider": { + "methods": [ + "create_workload_identity_pool_provider" + ] + }, + "UpdateWorkloadIdentityPoolProvider": { + "methods": [ + "update_workload_identity_pool_provider" + ] + }, + "DeleteWorkloadIdentityPoolProvider": { + "methods": [ + "delete_workload_identity_pool_provider" + ] + }, + "UndeleteWorkloadIdentityPoolProvider": { + "methods": [ + "undelete_workload_identity_pool_provider" + ] + } + } + } + } + } + } +} diff --git a/owl-bot-staging/google-iam-v1beta/google-iam-v1beta.gemspec b/owl-bot-staging/google-iam-v1beta/google-iam-v1beta.gemspec new file mode 100644 index 000000000000..43e3670d974b --- /dev/null +++ b/owl-bot-staging/google-iam-v1beta/google-iam-v1beta.gemspec @@ -0,0 +1,28 @@ +# -*- ruby -*- +# encoding: utf-8 + +require File.expand_path("lib/google/iam/v1beta/version", __dir__) + +Gem::Specification.new do |gem| + gem.name = "google-iam-v1beta" + gem.version = Google::Iam::V1beta::VERSION + + gem.authors = ["Google LLC"] + gem.email = "googleapis-packages@google.com" + gem.description = "Pre-release client for the WorkloadIdentityPools service. Note that google-iam-v1beta is a version-specific client library. For most uses, we recommend installing the main client library google-iam instead. See the readme for more details." + gem.summary = "Manages identity and access control for Google Cloud Platform resources, including the creation of service accounts, which you can use to authenticate to Google and make API calls. Note: This API is tied to the IAM service account credentials API (iamcredentials.googleapis.com). Enabling or disabling this API will also enable or disable the IAM service account credentials API." + 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.2" + + gem.add_dependency "gapic-common", "~> 1.2" + gem.add_dependency "google-cloud-errors", "~> 1.0" +end diff --git a/owl-bot-staging/google-iam-v1beta/lib/google-iam-v1beta.rb b/owl-bot-staging/google-iam-v1beta/lib/google-iam-v1beta.rb new file mode 100644 index 000000000000..3d3ddff928fb --- /dev/null +++ b/owl-bot-staging/google-iam-v1beta/lib/google-iam-v1beta.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/iam/v1beta" diff --git a/owl-bot-staging/google-iam-v1beta/lib/google/iam/v1beta.rb b/owl-bot-staging/google-iam-v1beta/lib/google/iam/v1beta.rb new file mode 100644 index 000000000000..4bf8fc10a312 --- /dev/null +++ b/owl-bot-staging/google-iam-v1beta/lib/google/iam/v1beta.rb @@ -0,0 +1,38 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/iam/v1beta/workload_identity_pools" +require "google/iam/v1beta/version" + +module Google + module Iam + ## + # API client module. + # + # @example Load this package, including all its services, and instantiate a gRPC client + # + # require "google/iam/v1beta" + # client = ::Google::Iam::V1beta::WorkloadIdentityPools::Client.new + # + module V1beta + end + end +end + +helper_path = ::File.join __dir__, "v1beta", "_helpers.rb" +require "google/iam/v1beta/_helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-iam-v1beta/lib/google/iam/v1beta/version.rb b/owl-bot-staging/google-iam-v1beta/lib/google/iam/v1beta/version.rb new file mode 100644 index 000000000000..ae41055a7d94 --- /dev/null +++ b/owl-bot-staging/google-iam-v1beta/lib/google/iam/v1beta/version.rb @@ -0,0 +1,26 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Iam + module V1beta + VERSION = "0.0.1" + end + end +end diff --git a/owl-bot-staging/google-iam-v1beta/lib/google/iam/v1beta/workload_identity_pool_pb.rb b/owl-bot-staging/google-iam-v1beta/lib/google/iam/v1beta/workload_identity_pool_pb.rb new file mode 100644 index 000000000000..787d1952cd7e --- /dev/null +++ b/owl-bot-staging/google-iam-v1beta/lib/google/iam/v1beta/workload_identity_pool_pb.rb @@ -0,0 +1,47 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/iam/v1beta/workload_identity_pool.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/field_mask_pb' + + +descriptor_data = "\n.google/iam/v1beta/workload_identity_pool.proto\x12\x11google.iam.v1beta\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 google/protobuf/field_mask.proto\"\xea\x02\n\x14WorkloadIdentityPool\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x14\n\x0c\x64isplay_name\x18\x02 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x03 \x01(\t\x12\x41\n\x05state\x18\x04 \x01(\x0e\x32-.google.iam.v1beta.WorkloadIdentityPool.StateB\x03\xe0\x41\x03\x12\x10\n\x08\x64isabled\x18\x05 \x01(\x08\"7\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\n\n\x06\x41\x43TIVE\x10\x01\x12\x0b\n\x07\x44\x45LETED\x10\x02:\x85\x01\xea\x41\x81\x01\n\'iam.googleapis.com/WorkloadIdentityPool\x12Vprojects/{project}/locations/{location}/workloadIdentityPools/{workload_identity_pool}\"\xe0\x06\n\x1cWorkloadIdentityPoolProvider\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x14\n\x0c\x64isplay_name\x18\x02 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x03 \x01(\t\x12I\n\x05state\x18\x04 \x01(\x0e\x32\x35.google.iam.v1beta.WorkloadIdentityPoolProvider.StateB\x03\xe0\x41\x03\x12\x10\n\x08\x64isabled\x18\x05 \x01(\x08\x12`\n\x11\x61ttribute_mapping\x18\x06 \x03(\x0b\x32\x45.google.iam.v1beta.WorkloadIdentityPoolProvider.AttributeMappingEntry\x12\x1b\n\x13\x61ttribute_condition\x18\x07 \x01(\t\x12\x42\n\x03\x61ws\x18\x08 \x01(\x0b\x32\x33.google.iam.v1beta.WorkloadIdentityPoolProvider.AwsH\x00\x12\x44\n\x04oidc\x18\t \x01(\x0b\x32\x34.google.iam.v1beta.WorkloadIdentityPoolProvider.OidcH\x00\x1a\x1e\n\x03\x41ws\x12\x17\n\naccount_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x1a:\n\x04Oidc\x12\x17\n\nissuer_uri\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x19\n\x11\x61llowed_audiences\x18\x02 \x03(\t\x1a\x37\n\x15\x41ttributeMappingEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"7\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\n\n\x06\x41\x43TIVE\x10\x01\x12\x0b\n\x07\x44\x45LETED\x10\x02:\xba\x01\xea\x41\xb6\x01\n/iam.googleapis.com/WorkloadIdentityPoolProvider\x12\x82\x01projects/{project}/locations/{location}/workloadIdentityPools/{workload_identity_pool}/providers/{workload_identity_pool_provider}B\x11\n\x0fprovider_config\"\xa4\x01\n ListWorkloadIdentityPoolsRequest\x12\x43\n\x06parent\x18\x01 \x01(\tB3\xe0\x41\x02\xfa\x41-\n+cloudresourcemanager.googleapis.com/Project\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\x12\x14\n\x0cshow_deleted\x18\x04 \x01(\x08\"\x86\x01\n!ListWorkloadIdentityPoolsResponse\x12H\n\x17workload_identity_pools\x18\x01 \x03(\x0b\x32\'.google.iam.v1beta.WorkloadIdentityPool\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"_\n\x1eGetWorkloadIdentityPoolRequest\x12=\n\x04name\x18\x01 \x01(\tB/\xe0\x41\x02\xfa\x41)\n\'iam.googleapis.com/WorkloadIdentityPool\"\xde\x01\n!CreateWorkloadIdentityPoolRequest\x12\x43\n\x06parent\x18\x01 \x01(\tB3\xe0\x41\x02\xfa\x41-\n+cloudresourcemanager.googleapis.com/Project\x12L\n\x16workload_identity_pool\x18\x02 \x01(\x0b\x32\'.google.iam.v1beta.WorkloadIdentityPoolB\x03\xe0\x41\x02\x12&\n\x19workload_identity_pool_id\x18\x03 \x01(\tB\x03\xe0\x41\x02\"\xa7\x01\n!UpdateWorkloadIdentityPoolRequest\x12L\n\x16workload_identity_pool\x18\x01 \x01(\x0b\x32\'.google.iam.v1beta.WorkloadIdentityPoolB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\"b\n!DeleteWorkloadIdentityPoolRequest\x12=\n\x04name\x18\x01 \x01(\tB/\xe0\x41\x02\xfa\x41)\n\'iam.googleapis.com/WorkloadIdentityPool\"d\n#UndeleteWorkloadIdentityPoolRequest\x12=\n\x04name\x18\x01 \x01(\tB/\xe0\x41\x02\xfa\x41)\n\'iam.googleapis.com/WorkloadIdentityPool\"\xa8\x01\n(ListWorkloadIdentityPoolProvidersRequest\x12?\n\x06parent\x18\x01 \x01(\tB/\xe0\x41\x02\xfa\x41)\n\'iam.googleapis.com/WorkloadIdentityPool\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\x12\x14\n\x0cshow_deleted\x18\x04 \x01(\x08\"\x9f\x01\n)ListWorkloadIdentityPoolProvidersResponse\x12Y\n workload_identity_pool_providers\x18\x01 \x03(\x0b\x32/.google.iam.v1beta.WorkloadIdentityPoolProvider\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"o\n&GetWorkloadIdentityPoolProviderRequest\x12\x45\n\x04name\x18\x01 \x01(\tB7\xe0\x41\x02\xfa\x41\x31\n/iam.googleapis.com/WorkloadIdentityPoolProvider\"\xfc\x01\n)CreateWorkloadIdentityPoolProviderRequest\x12?\n\x06parent\x18\x01 \x01(\tB/\xe0\x41\x02\xfa\x41)\n\'iam.googleapis.com/WorkloadIdentityPool\x12]\n\x1fworkload_identity_pool_provider\x18\x02 \x01(\x0b\x32/.google.iam.v1beta.WorkloadIdentityPoolProviderB\x03\xe0\x41\x02\x12/\n\"workload_identity_pool_provider_id\x18\x03 \x01(\tB\x03\xe0\x41\x02\"\xc0\x01\n)UpdateWorkloadIdentityPoolProviderRequest\x12]\n\x1fworkload_identity_pool_provider\x18\x01 \x01(\x0b\x32/.google.iam.v1beta.WorkloadIdentityPoolProviderB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\"r\n)DeleteWorkloadIdentityPoolProviderRequest\x12\x45\n\x04name\x18\x01 \x01(\tB7\xe0\x41\x02\xfa\x41\x31\n/iam.googleapis.com/WorkloadIdentityPoolProvider\"t\n+UndeleteWorkloadIdentityPoolProviderRequest\x12\x45\n\x04name\x18\x01 \x01(\tB7\xe0\x41\x02\xfa\x41\x31\n/iam.googleapis.com/WorkloadIdentityPoolProvider\"\'\n%WorkloadIdentityPoolOperationMetadata\"/\n-WorkloadIdentityPoolProviderOperationMetadata2\xb4\x1c\n\x15WorkloadIdentityPools\x12\xd6\x01\n\x19ListWorkloadIdentityPools\x12\x33.google.iam.v1beta.ListWorkloadIdentityPoolsRequest\x1a\x34.google.iam.v1beta.ListWorkloadIdentityPoolsResponse\"N\xda\x41\x06parent\x82\xd3\xe4\x93\x02?\x12=/v1beta/{parent=projects/*/locations/*}/workloadIdentityPools\x12\xc3\x01\n\x17GetWorkloadIdentityPool\x12\x31.google.iam.v1beta.GetWorkloadIdentityPoolRequest\x1a\'.google.iam.v1beta.WorkloadIdentityPool\"L\xda\x41\x04name\x82\xd3\xe4\x93\x02?\x12=/v1beta/{name=projects/*/locations/*/workloadIdentityPools/*}\x12\xcb\x02\n\x1a\x43reateWorkloadIdentityPool\x12\x34.google.iam.v1beta.CreateWorkloadIdentityPoolRequest\x1a\x1d.google.longrunning.Operation\"\xd7\x01\xca\x41=\n\x14WorkloadIdentityPool\x12%WorkloadIdentityPoolOperationMetadata\xda\x41\x37parent,workload_identity_pool,workload_identity_pool_id\x82\xd3\xe4\x93\x02W\"=/v1beta/{parent=projects/*/locations/*}/workloadIdentityPools:\x16workload_identity_pool\x12\xcd\x02\n\x1aUpdateWorkloadIdentityPool\x12\x34.google.iam.v1beta.UpdateWorkloadIdentityPoolRequest\x1a\x1d.google.longrunning.Operation\"\xd9\x01\xca\x41=\n\x14WorkloadIdentityPool\x12%WorkloadIdentityPoolOperationMetadata\xda\x41\"workload_identity_pool,update_mask\x82\xd3\xe4\x93\x02n2T/v1beta/{workload_identity_pool.name=projects/*/locations/*/workloadIdentityPools/*}:\x16workload_identity_pool\x12\x80\x02\n\x1a\x44\x65leteWorkloadIdentityPool\x12\x34.google.iam.v1beta.DeleteWorkloadIdentityPoolRequest\x1a\x1d.google.longrunning.Operation\"\x8c\x01\xca\x41=\n\x14WorkloadIdentityPool\x12%WorkloadIdentityPoolOperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02?*=/v1beta/{name=projects/*/locations/*/workloadIdentityPools/*}\x12\x90\x02\n\x1cUndeleteWorkloadIdentityPool\x12\x36.google.iam.v1beta.UndeleteWorkloadIdentityPoolRequest\x1a\x1d.google.longrunning.Operation\"\x98\x01\xca\x41=\n\x14WorkloadIdentityPool\x12%WorkloadIdentityPoolOperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02K\"F/v1beta/{name=projects/*/locations/*/workloadIdentityPools/*}:undelete:\x01*\x12\xfa\x01\n!ListWorkloadIdentityPoolProviders\x12;.google.iam.v1beta.ListWorkloadIdentityPoolProvidersRequest\x1a<.google.iam.v1beta.ListWorkloadIdentityPoolProvidersResponse\"Z\xda\x41\x06parent\x82\xd3\xe4\x93\x02K\x12I/v1beta/{parent=projects/*/locations/*/workloadIdentityPools/*}/providers\x12\xe7\x01\n\x1fGetWorkloadIdentityPoolProvider\x12\x39.google.iam.v1beta.GetWorkloadIdentityPoolProviderRequest\x1a/.google.iam.v1beta.WorkloadIdentityPoolProvider\"X\xda\x41\x04name\x82\xd3\xe4\x93\x02K\x12I/v1beta/{name=projects/*/locations/*/workloadIdentityPools/*/providers/*}\x12\x92\x03\n\"CreateWorkloadIdentityPoolProvider\x12<.google.iam.v1beta.CreateWorkloadIdentityPoolProviderRequest\x1a\x1d.google.longrunning.Operation\"\x8e\x02\xca\x41M\n\x1cWorkloadIdentityPoolProvider\x12-WorkloadIdentityPoolProviderOperationMetadata\xda\x41Iparent,workload_identity_pool_provider,workload_identity_pool_provider_id\x82\xd3\xe4\x93\x02l\"I/v1beta/{parent=projects/*/locations/*/workloadIdentityPools/*}/providers:\x1fworkload_identity_pool_provider\x12\x95\x03\n\"UpdateWorkloadIdentityPoolProvider\x12<.google.iam.v1beta.UpdateWorkloadIdentityPoolProviderRequest\x1a\x1d.google.longrunning.Operation\"\x91\x02\xca\x41M\n\x1cWorkloadIdentityPoolProvider\x12-WorkloadIdentityPoolProviderOperationMetadata\xda\x41+workload_identity_pool_provider,update_mask\x82\xd3\xe4\x93\x02\x8c\x01\x32i/v1beta/{workload_identity_pool_provider.name=projects/*/locations/*/workloadIdentityPools/*/providers/*}:\x1fworkload_identity_pool_provider\x12\xac\x02\n\"DeleteWorkloadIdentityPoolProvider\x12<.google.iam.v1beta.DeleteWorkloadIdentityPoolProviderRequest\x1a\x1d.google.longrunning.Operation\"\xa8\x01\xca\x41M\n\x1cWorkloadIdentityPoolProvider\x12-WorkloadIdentityPoolProviderOperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02K*I/v1beta/{name=projects/*/locations/*/workloadIdentityPools/*/providers/*}\x12\xbc\x02\n$UndeleteWorkloadIdentityPoolProvider\x12>.google.iam.v1beta.UndeleteWorkloadIdentityPoolProviderRequest\x1a\x1d.google.longrunning.Operation\"\xb4\x01\xca\x41M\n\x1cWorkloadIdentityPoolProvider\x12-WorkloadIdentityPoolProviderOperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02W\"R/v1beta/{name=projects/*/locations/*/workloadIdentityPools/*/providers/*}:undelete:\x01*\x1a\x46\xca\x41\x12iam.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformBc\n\x15\x63om.google.iam.v1betaB\x19WorkloadIdentityPoolProtoP\x01Z-cloud.google.com/go/iam/apiv1beta/iampb;iampbb\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Iam + module V1beta + WorkloadIdentityPool = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.iam.v1beta.WorkloadIdentityPool").msgclass + WorkloadIdentityPool::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.iam.v1beta.WorkloadIdentityPool.State").enummodule + WorkloadIdentityPoolProvider = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.iam.v1beta.WorkloadIdentityPoolProvider").msgclass + WorkloadIdentityPoolProvider::Aws = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.iam.v1beta.WorkloadIdentityPoolProvider.Aws").msgclass + WorkloadIdentityPoolProvider::Oidc = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.iam.v1beta.WorkloadIdentityPoolProvider.Oidc").msgclass + WorkloadIdentityPoolProvider::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.iam.v1beta.WorkloadIdentityPoolProvider.State").enummodule + ListWorkloadIdentityPoolsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.iam.v1beta.ListWorkloadIdentityPoolsRequest").msgclass + ListWorkloadIdentityPoolsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.iam.v1beta.ListWorkloadIdentityPoolsResponse").msgclass + GetWorkloadIdentityPoolRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.iam.v1beta.GetWorkloadIdentityPoolRequest").msgclass + CreateWorkloadIdentityPoolRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.iam.v1beta.CreateWorkloadIdentityPoolRequest").msgclass + UpdateWorkloadIdentityPoolRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.iam.v1beta.UpdateWorkloadIdentityPoolRequest").msgclass + DeleteWorkloadIdentityPoolRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.iam.v1beta.DeleteWorkloadIdentityPoolRequest").msgclass + UndeleteWorkloadIdentityPoolRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.iam.v1beta.UndeleteWorkloadIdentityPoolRequest").msgclass + ListWorkloadIdentityPoolProvidersRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.iam.v1beta.ListWorkloadIdentityPoolProvidersRequest").msgclass + ListWorkloadIdentityPoolProvidersResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.iam.v1beta.ListWorkloadIdentityPoolProvidersResponse").msgclass + GetWorkloadIdentityPoolProviderRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.iam.v1beta.GetWorkloadIdentityPoolProviderRequest").msgclass + CreateWorkloadIdentityPoolProviderRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.iam.v1beta.CreateWorkloadIdentityPoolProviderRequest").msgclass + UpdateWorkloadIdentityPoolProviderRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.iam.v1beta.UpdateWorkloadIdentityPoolProviderRequest").msgclass + DeleteWorkloadIdentityPoolProviderRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.iam.v1beta.DeleteWorkloadIdentityPoolProviderRequest").msgclass + UndeleteWorkloadIdentityPoolProviderRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.iam.v1beta.UndeleteWorkloadIdentityPoolProviderRequest").msgclass + WorkloadIdentityPoolOperationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.iam.v1beta.WorkloadIdentityPoolOperationMetadata").msgclass + WorkloadIdentityPoolProviderOperationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.iam.v1beta.WorkloadIdentityPoolProviderOperationMetadata").msgclass + end + end +end diff --git a/owl-bot-staging/google-iam-v1beta/lib/google/iam/v1beta/workload_identity_pool_services_pb.rb b/owl-bot-staging/google-iam-v1beta/lib/google/iam/v1beta/workload_identity_pool_services_pb.rb new file mode 100644 index 000000000000..86ff8e174977 --- /dev/null +++ b/owl-bot-staging/google-iam-v1beta/lib/google/iam/v1beta/workload_identity_pool_services_pb.rb @@ -0,0 +1,103 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/iam/v1beta/workload_identity_pool.proto for package 'google.iam.v1beta' +# 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/iam/v1beta/workload_identity_pool_pb' + +module Google + module Iam + module V1beta + module WorkloadIdentityPools + # Manages WorkloadIdentityPools. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.iam.v1beta.WorkloadIdentityPools' + + # Lists all non-deleted + # [WorkloadIdentityPool][google.iam.v1beta.WorkloadIdentityPool]s in a + # project. If `show_deleted` is set to `true`, then deleted pools are also + # listed. + rpc :ListWorkloadIdentityPools, ::Google::Iam::V1beta::ListWorkloadIdentityPoolsRequest, ::Google::Iam::V1beta::ListWorkloadIdentityPoolsResponse + # Gets an individual + # [WorkloadIdentityPool][google.iam.v1beta.WorkloadIdentityPool]. + rpc :GetWorkloadIdentityPool, ::Google::Iam::V1beta::GetWorkloadIdentityPoolRequest, ::Google::Iam::V1beta::WorkloadIdentityPool + # Creates a new + # [WorkloadIdentityPool][google.iam.v1beta.WorkloadIdentityPool]. + # + # You cannot reuse the name of a deleted pool until 30 days after deletion. + rpc :CreateWorkloadIdentityPool, ::Google::Iam::V1beta::CreateWorkloadIdentityPoolRequest, ::Google::Longrunning::Operation + # Updates an existing + # [WorkloadIdentityPool][google.iam.v1beta.WorkloadIdentityPool]. + rpc :UpdateWorkloadIdentityPool, ::Google::Iam::V1beta::UpdateWorkloadIdentityPoolRequest, ::Google::Longrunning::Operation + # Deletes a + # [WorkloadIdentityPool][google.iam.v1beta.WorkloadIdentityPool]. + # + # You cannot use a deleted pool to exchange external + # credentials for Google Cloud credentials. However, deletion does + # not revoke credentials that have already been issued. + # Credentials issued for a deleted pool do not grant access to resources. + # If the pool is undeleted, and the credentials are not expired, they + # grant access again. + # You can undelete a pool for 30 days. After 30 days, deletion is + # permanent. + # You cannot update deleted pools. However, you can view and list them. + rpc :DeleteWorkloadIdentityPool, ::Google::Iam::V1beta::DeleteWorkloadIdentityPoolRequest, ::Google::Longrunning::Operation + # Undeletes a [WorkloadIdentityPool][google.iam.v1beta.WorkloadIdentityPool], + # as long as it was deleted fewer than 30 days ago. + rpc :UndeleteWorkloadIdentityPool, ::Google::Iam::V1beta::UndeleteWorkloadIdentityPoolRequest, ::Google::Longrunning::Operation + # Lists all non-deleted + # [WorkloadIdentityPoolProvider][google.iam.v1beta.WorkloadIdentityPoolProvider]s + # in a [WorkloadIdentityPool][google.iam.v1beta.WorkloadIdentityPool]. + # If `show_deleted` is set to `true`, then deleted providers are also listed. + rpc :ListWorkloadIdentityPoolProviders, ::Google::Iam::V1beta::ListWorkloadIdentityPoolProvidersRequest, ::Google::Iam::V1beta::ListWorkloadIdentityPoolProvidersResponse + # Gets an individual + # [WorkloadIdentityPoolProvider][google.iam.v1beta.WorkloadIdentityPoolProvider]. + rpc :GetWorkloadIdentityPoolProvider, ::Google::Iam::V1beta::GetWorkloadIdentityPoolProviderRequest, ::Google::Iam::V1beta::WorkloadIdentityPoolProvider + # Creates a new + # [WorkloadIdentityPoolProvider][google.iam.v1beta.WorkloadIdentityProvider] + # in a [WorkloadIdentityPool][google.iam.v1beta.WorkloadIdentityPool]. + # + # You cannot reuse the name of a deleted provider until 30 days after + # deletion. + rpc :CreateWorkloadIdentityPoolProvider, ::Google::Iam::V1beta::CreateWorkloadIdentityPoolProviderRequest, ::Google::Longrunning::Operation + # Updates an existing + # [WorkloadIdentityPoolProvider][google.iam.v1beta.WorkloadIdentityProvider]. + rpc :UpdateWorkloadIdentityPoolProvider, ::Google::Iam::V1beta::UpdateWorkloadIdentityPoolProviderRequest, ::Google::Longrunning::Operation + # Deletes a + # [WorkloadIdentityPoolProvider][google.iam.v1beta.WorkloadIdentityProvider]. + # Deleting a provider does not revoke credentials that have already been + # issued; they continue to grant access. + # You can undelete a provider for 30 days. After 30 days, deletion is + # permanent. + # You cannot update deleted providers. However, you can view and list them. + rpc :DeleteWorkloadIdentityPoolProvider, ::Google::Iam::V1beta::DeleteWorkloadIdentityPoolProviderRequest, ::Google::Longrunning::Operation + # Undeletes a + # [WorkloadIdentityPoolProvider][google.iam.v1beta.WorkloadIdentityProvider], + # as long as it was deleted fewer than 30 days ago. + rpc :UndeleteWorkloadIdentityPoolProvider, ::Google::Iam::V1beta::UndeleteWorkloadIdentityPoolProviderRequest, ::Google::Longrunning::Operation + end + + Stub = Service.rpc_stub_class + end + end + end +end diff --git a/owl-bot-staging/google-iam-v1beta/lib/google/iam/v1beta/workload_identity_pools.rb b/owl-bot-staging/google-iam-v1beta/lib/google/iam/v1beta/workload_identity_pools.rb new file mode 100644 index 000000000000..2b3f569b9b77 --- /dev/null +++ b/owl-bot-staging/google-iam-v1beta/lib/google/iam/v1beta/workload_identity_pools.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! + +require "gapic/common" +require "gapic/config" +require "gapic/config/method" + +require "google/iam/v1beta/version" + +require "google/iam/v1beta/workload_identity_pools/credentials" +require "google/iam/v1beta/workload_identity_pools/paths" +require "google/iam/v1beta/workload_identity_pools/operations" +require "google/iam/v1beta/workload_identity_pools/client" + +module Google + module Iam + module V1beta + ## + # Manages WorkloadIdentityPools. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/iam/v1beta/workload_identity_pools" + # client = ::Google::Iam::V1beta::WorkloadIdentityPools::Client.new + # + module WorkloadIdentityPools + end + end + end +end + +helper_path = ::File.join __dir__, "workload_identity_pools", "helpers.rb" +require "google/iam/v1beta/workload_identity_pools/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-iam-v1beta/lib/google/iam/v1beta/workload_identity_pools/client.rb b/owl-bot-staging/google-iam-v1beta/lib/google/iam/v1beta/workload_identity_pools/client.rb new file mode 100644 index 000000000000..1408ae58dae9 --- /dev/null +++ b/owl-bot-staging/google-iam-v1beta/lib/google/iam/v1beta/workload_identity_pools/client.rb @@ -0,0 +1,1718 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/iam/v1beta/workload_identity_pool_pb" + +module Google + module Iam + module V1beta + module WorkloadIdentityPools + ## + # Client for the WorkloadIdentityPools service. + # + # Manages WorkloadIdentityPools. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "iam.$UNIVERSE_DOMAIN$" + + include Paths + + # @private + attr_reader :workload_identity_pools_stub + + ## + # Configure the WorkloadIdentityPools Client class. + # + # See {::Google::Iam::V1beta::WorkloadIdentityPools::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all WorkloadIdentityPools clients + # ::Google::Iam::V1beta::WorkloadIdentityPools::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", "Iam", "V1beta"] + 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_workload_identity_pools.timeout = 60.0 + default_config.rpcs.list_workload_identity_pools.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.get_workload_identity_pool.timeout = 60.0 + default_config.rpcs.get_workload_identity_pool.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.create_workload_identity_pool.timeout = 60.0 + default_config.rpcs.create_workload_identity_pool.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.update_workload_identity_pool.timeout = 60.0 + default_config.rpcs.update_workload_identity_pool.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.delete_workload_identity_pool.timeout = 60.0 + default_config.rpcs.delete_workload_identity_pool.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.undelete_workload_identity_pool.timeout = 60.0 + default_config.rpcs.undelete_workload_identity_pool.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.list_workload_identity_pool_providers.timeout = 60.0 + default_config.rpcs.list_workload_identity_pool_providers.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.get_workload_identity_pool_provider.timeout = 60.0 + default_config.rpcs.get_workload_identity_pool_provider.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.create_workload_identity_pool_provider.timeout = 60.0 + default_config.rpcs.create_workload_identity_pool_provider.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.update_workload_identity_pool_provider.timeout = 60.0 + default_config.rpcs.update_workload_identity_pool_provider.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.delete_workload_identity_pool_provider.timeout = 60.0 + default_config.rpcs.delete_workload_identity_pool_provider.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config.rpcs.undelete_workload_identity_pool_provider.timeout = 60.0 + default_config.rpcs.undelete_workload_identity_pool_provider.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14, 4] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the WorkloadIdentityPools 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::Iam::V1beta::WorkloadIdentityPools::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 + @workload_identity_pools_stub.universe_domain + end + + ## + # Create a new WorkloadIdentityPools client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Iam::V1beta::WorkloadIdentityPools::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Iam::V1beta::WorkloadIdentityPools::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the WorkloadIdentityPools 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/iam/v1beta/workload_identity_pool_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 + + @workload_identity_pools_stub = ::Gapic::ServiceStub.new( + ::Google::Iam::V1beta::WorkloadIdentityPools::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 + ) + + @workload_identity_pools_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 + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Iam::V1beta::WorkloadIdentityPools::Operations] + # + attr_reader :operations_client + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @workload_identity_pools_stub.logger + end + + # Service calls + + ## + # Lists all non-deleted + # {::Google::Iam::V1beta::WorkloadIdentityPool WorkloadIdentityPool}s in a + # project. If `show_deleted` is set to `true`, then deleted pools are also + # listed. + # + # @overload list_workload_identity_pools(request, options = nil) + # Pass arguments to `list_workload_identity_pools` via a request object, either of type + # {::Google::Iam::V1beta::ListWorkloadIdentityPoolsRequest} or an equivalent Hash. + # + # @param request [::Google::Iam::V1beta::ListWorkloadIdentityPoolsRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_workload_identity_pools(parent: nil, page_size: nil, page_token: nil, show_deleted: nil) + # Pass arguments to `list_workload_identity_pools` via keyword arguments. Note that at + # least one keyword argument is 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 parent resource to list pools for. + # @param page_size [::Integer] + # The maximum number of pools to return. + # If unspecified, at most 50 pools are returned. + # The maximum value is 1000; values above are 1000 truncated to 1000. + # @param page_token [::String] + # A page token, received from a previous `ListWorkloadIdentityPools` + # call. Provide this to retrieve the subsequent page. + # @param show_deleted [::Boolean] + # Whether to return soft-deleted pools. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Iam::V1beta::WorkloadIdentityPool>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Iam::V1beta::WorkloadIdentityPool>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/iam/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Iam::V1beta::WorkloadIdentityPools::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Iam::V1beta::ListWorkloadIdentityPoolsRequest.new + # + # # Call the list_workload_identity_pools method. + # result = client.list_workload_identity_pools 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::Iam::V1beta::WorkloadIdentityPool. + # p item + # end + # + def list_workload_identity_pools request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1beta::ListWorkloadIdentityPoolsRequest + + # Converts hash 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_workload_identity_pools.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::Iam::V1beta::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_workload_identity_pools.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_workload_identity_pools.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @workload_identity_pools_stub.call_rpc :list_workload_identity_pools, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @workload_identity_pools_stub, :list_workload_identity_pools, 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 + + ## + # Gets an individual + # {::Google::Iam::V1beta::WorkloadIdentityPool WorkloadIdentityPool}. + # + # @overload get_workload_identity_pool(request, options = nil) + # Pass arguments to `get_workload_identity_pool` via a request object, either of type + # {::Google::Iam::V1beta::GetWorkloadIdentityPoolRequest} or an equivalent Hash. + # + # @param request [::Google::Iam::V1beta::GetWorkloadIdentityPoolRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_workload_identity_pool(name: nil) + # Pass arguments to `get_workload_identity_pool` via keyword arguments. Note that at + # least one keyword argument is 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 name of the pool to retrieve. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Iam::V1beta::WorkloadIdentityPool] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Iam::V1beta::WorkloadIdentityPool] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/iam/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Iam::V1beta::WorkloadIdentityPools::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Iam::V1beta::GetWorkloadIdentityPoolRequest.new + # + # # Call the get_workload_identity_pool method. + # result = client.get_workload_identity_pool request + # + # # The returned object is of type Google::Iam::V1beta::WorkloadIdentityPool. + # p result + # + def get_workload_identity_pool request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1beta::GetWorkloadIdentityPoolRequest + + # Converts hash 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_workload_identity_pool.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::Iam::V1beta::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_workload_identity_pool.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_workload_identity_pool.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @workload_identity_pools_stub.call_rpc :get_workload_identity_pool, 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::Iam::V1beta::WorkloadIdentityPool WorkloadIdentityPool}. + # + # You cannot reuse the name of a deleted pool until 30 days after deletion. + # + # @overload create_workload_identity_pool(request, options = nil) + # Pass arguments to `create_workload_identity_pool` via a request object, either of type + # {::Google::Iam::V1beta::CreateWorkloadIdentityPoolRequest} or an equivalent Hash. + # + # @param request [::Google::Iam::V1beta::CreateWorkloadIdentityPoolRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_workload_identity_pool(parent: nil, workload_identity_pool: nil, workload_identity_pool_id: nil) + # Pass arguments to `create_workload_identity_pool` via keyword arguments. Note that at + # least one keyword argument is 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 parent resource to create the pool in. The only supported + # location is `global`. + # @param workload_identity_pool [::Google::Iam::V1beta::WorkloadIdentityPool, ::Hash] + # Required. The pool to create. + # @param workload_identity_pool_id [::String] + # Required. The ID to use for the pool, which becomes the + # final component of the resource name. This value should be 4-32 characters, + # and may contain the characters [a-z0-9-]. The prefix `gcp-` is + # reserved for use by Google, and may not be specified. + # + # @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/iam/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Iam::V1beta::WorkloadIdentityPools::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Iam::V1beta::CreateWorkloadIdentityPoolRequest.new + # + # # Call the create_workload_identity_pool method. + # result = client.create_workload_identity_pool 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_workload_identity_pool request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1beta::CreateWorkloadIdentityPoolRequest + + # Converts hash 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_workload_identity_pool.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::Iam::V1beta::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_workload_identity_pool.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_workload_identity_pool.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @workload_identity_pools_stub.call_rpc :create_workload_identity_pool, 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 + + ## + # Updates an existing + # {::Google::Iam::V1beta::WorkloadIdentityPool WorkloadIdentityPool}. + # + # @overload update_workload_identity_pool(request, options = nil) + # Pass arguments to `update_workload_identity_pool` via a request object, either of type + # {::Google::Iam::V1beta::UpdateWorkloadIdentityPoolRequest} or an equivalent Hash. + # + # @param request [::Google::Iam::V1beta::UpdateWorkloadIdentityPoolRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_workload_identity_pool(workload_identity_pool: nil, update_mask: nil) + # Pass arguments to `update_workload_identity_pool` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param workload_identity_pool [::Google::Iam::V1beta::WorkloadIdentityPool, ::Hash] + # Required. The pool to update. The `name` field is used to identify the pool. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. The list of fields update. + # + # @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/iam/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Iam::V1beta::WorkloadIdentityPools::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Iam::V1beta::UpdateWorkloadIdentityPoolRequest.new + # + # # Call the update_workload_identity_pool method. + # result = client.update_workload_identity_pool 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 update_workload_identity_pool request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1beta::UpdateWorkloadIdentityPoolRequest + + # Converts hash 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_workload_identity_pool.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::Iam::V1beta::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.workload_identity_pool&.name + header_params["workload_identity_pool.name"] = request.workload_identity_pool.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_workload_identity_pool.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_workload_identity_pool.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @workload_identity_pools_stub.call_rpc :update_workload_identity_pool, 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 + # {::Google::Iam::V1beta::WorkloadIdentityPool WorkloadIdentityPool}. + # + # You cannot use a deleted pool to exchange external + # credentials for Google Cloud credentials. However, deletion does + # not revoke credentials that have already been issued. + # Credentials issued for a deleted pool do not grant access to resources. + # If the pool is undeleted, and the credentials are not expired, they + # grant access again. + # You can undelete a pool for 30 days. After 30 days, deletion is + # permanent. + # You cannot update deleted pools. However, you can view and list them. + # + # @overload delete_workload_identity_pool(request, options = nil) + # Pass arguments to `delete_workload_identity_pool` via a request object, either of type + # {::Google::Iam::V1beta::DeleteWorkloadIdentityPoolRequest} or an equivalent Hash. + # + # @param request [::Google::Iam::V1beta::DeleteWorkloadIdentityPoolRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_workload_identity_pool(name: nil) + # Pass arguments to `delete_workload_identity_pool` via keyword arguments. Note that at + # least one keyword argument is 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 name of the pool 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/iam/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Iam::V1beta::WorkloadIdentityPools::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Iam::V1beta::DeleteWorkloadIdentityPoolRequest.new + # + # # Call the delete_workload_identity_pool method. + # result = client.delete_workload_identity_pool 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_workload_identity_pool request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1beta::DeleteWorkloadIdentityPoolRequest + + # Converts hash 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_workload_identity_pool.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::Iam::V1beta::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_workload_identity_pool.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_workload_identity_pool.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @workload_identity_pools_stub.call_rpc :delete_workload_identity_pool, 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 + + ## + # Undeletes a {::Google::Iam::V1beta::WorkloadIdentityPool WorkloadIdentityPool}, + # as long as it was deleted fewer than 30 days ago. + # + # @overload undelete_workload_identity_pool(request, options = nil) + # Pass arguments to `undelete_workload_identity_pool` via a request object, either of type + # {::Google::Iam::V1beta::UndeleteWorkloadIdentityPoolRequest} or an equivalent Hash. + # + # @param request [::Google::Iam::V1beta::UndeleteWorkloadIdentityPoolRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload undelete_workload_identity_pool(name: nil) + # Pass arguments to `undelete_workload_identity_pool` via keyword arguments. Note that at + # least one keyword argument is 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 name of the pool to undelete. + # + # @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/iam/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Iam::V1beta::WorkloadIdentityPools::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Iam::V1beta::UndeleteWorkloadIdentityPoolRequest.new + # + # # Call the undelete_workload_identity_pool method. + # result = client.undelete_workload_identity_pool 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 undelete_workload_identity_pool request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1beta::UndeleteWorkloadIdentityPoolRequest + + # Converts hash 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.undelete_workload_identity_pool.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::Iam::V1beta::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.undelete_workload_identity_pool.timeout, + metadata: metadata, + retry_policy: @config.rpcs.undelete_workload_identity_pool.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @workload_identity_pools_stub.call_rpc :undelete_workload_identity_pool, 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 + + ## + # Lists all non-deleted + # {::Google::Iam::V1beta::WorkloadIdentityPoolProvider WorkloadIdentityPoolProvider}s + # in a {::Google::Iam::V1beta::WorkloadIdentityPool WorkloadIdentityPool}. + # If `show_deleted` is set to `true`, then deleted providers are also listed. + # + # @overload list_workload_identity_pool_providers(request, options = nil) + # Pass arguments to `list_workload_identity_pool_providers` via a request object, either of type + # {::Google::Iam::V1beta::ListWorkloadIdentityPoolProvidersRequest} or an equivalent Hash. + # + # @param request [::Google::Iam::V1beta::ListWorkloadIdentityPoolProvidersRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_workload_identity_pool_providers(parent: nil, page_size: nil, page_token: nil, show_deleted: nil) + # Pass arguments to `list_workload_identity_pool_providers` via keyword arguments. Note that at + # least one keyword argument is 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 pool to list providers for. + # @param page_size [::Integer] + # The maximum number of providers to return. + # If unspecified, at most 50 providers are returned. + # The maximum value is 100; values above 100 are truncated to 100. + # @param page_token [::String] + # A page token, received from a previous + # `ListWorkloadIdentityPoolProviders` call. Provide this to retrieve the + # subsequent page. + # @param show_deleted [::Boolean] + # Whether to return soft-deleted providers. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Iam::V1beta::WorkloadIdentityPoolProvider>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Iam::V1beta::WorkloadIdentityPoolProvider>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/iam/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Iam::V1beta::WorkloadIdentityPools::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Iam::V1beta::ListWorkloadIdentityPoolProvidersRequest.new + # + # # Call the list_workload_identity_pool_providers method. + # result = client.list_workload_identity_pool_providers 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::Iam::V1beta::WorkloadIdentityPoolProvider. + # p item + # end + # + def list_workload_identity_pool_providers request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1beta::ListWorkloadIdentityPoolProvidersRequest + + # Converts hash 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_workload_identity_pool_providers.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::Iam::V1beta::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_workload_identity_pool_providers.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_workload_identity_pool_providers.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @workload_identity_pools_stub.call_rpc :list_workload_identity_pool_providers, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @workload_identity_pools_stub, :list_workload_identity_pool_providers, 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 + + ## + # Gets an individual + # {::Google::Iam::V1beta::WorkloadIdentityPoolProvider WorkloadIdentityPoolProvider}. + # + # @overload get_workload_identity_pool_provider(request, options = nil) + # Pass arguments to `get_workload_identity_pool_provider` via a request object, either of type + # {::Google::Iam::V1beta::GetWorkloadIdentityPoolProviderRequest} or an equivalent Hash. + # + # @param request [::Google::Iam::V1beta::GetWorkloadIdentityPoolProviderRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_workload_identity_pool_provider(name: nil) + # Pass arguments to `get_workload_identity_pool_provider` via keyword arguments. Note that at + # least one keyword argument is 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 name of the provider to retrieve. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Iam::V1beta::WorkloadIdentityPoolProvider] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Iam::V1beta::WorkloadIdentityPoolProvider] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/iam/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Iam::V1beta::WorkloadIdentityPools::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Iam::V1beta::GetWorkloadIdentityPoolProviderRequest.new + # + # # Call the get_workload_identity_pool_provider method. + # result = client.get_workload_identity_pool_provider request + # + # # The returned object is of type Google::Iam::V1beta::WorkloadIdentityPoolProvider. + # p result + # + def get_workload_identity_pool_provider request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1beta::GetWorkloadIdentityPoolProviderRequest + + # Converts hash 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_workload_identity_pool_provider.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::Iam::V1beta::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_workload_identity_pool_provider.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_workload_identity_pool_provider.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @workload_identity_pools_stub.call_rpc :get_workload_identity_pool_provider, 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 + # [WorkloadIdentityPoolProvider][google.iam.v1beta.WorkloadIdentityProvider] + # in a {::Google::Iam::V1beta::WorkloadIdentityPool WorkloadIdentityPool}. + # + # You cannot reuse the name of a deleted provider until 30 days after + # deletion. + # + # @overload create_workload_identity_pool_provider(request, options = nil) + # Pass arguments to `create_workload_identity_pool_provider` via a request object, either of type + # {::Google::Iam::V1beta::CreateWorkloadIdentityPoolProviderRequest} or an equivalent Hash. + # + # @param request [::Google::Iam::V1beta::CreateWorkloadIdentityPoolProviderRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_workload_identity_pool_provider(parent: nil, workload_identity_pool_provider: nil, workload_identity_pool_provider_id: nil) + # Pass arguments to `create_workload_identity_pool_provider` via keyword arguments. Note that at + # least one keyword argument is 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 pool to create this provider in. + # @param workload_identity_pool_provider [::Google::Iam::V1beta::WorkloadIdentityPoolProvider, ::Hash] + # Required. The provider to create. + # @param workload_identity_pool_provider_id [::String] + # Required. The ID for the provider, which becomes the + # final component of the resource name. This value must be 4-32 characters, + # and may contain the characters [a-z0-9-]. The prefix `gcp-` is + # reserved for use by Google, and may not be specified. + # + # @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/iam/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Iam::V1beta::WorkloadIdentityPools::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Iam::V1beta::CreateWorkloadIdentityPoolProviderRequest.new + # + # # Call the create_workload_identity_pool_provider method. + # result = client.create_workload_identity_pool_provider 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_workload_identity_pool_provider request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1beta::CreateWorkloadIdentityPoolProviderRequest + + # Converts hash 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_workload_identity_pool_provider.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::Iam::V1beta::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_workload_identity_pool_provider.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_workload_identity_pool_provider.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @workload_identity_pools_stub.call_rpc :create_workload_identity_pool_provider, 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 + + ## + # Updates an existing + # [WorkloadIdentityPoolProvider][google.iam.v1beta.WorkloadIdentityProvider]. + # + # @overload update_workload_identity_pool_provider(request, options = nil) + # Pass arguments to `update_workload_identity_pool_provider` via a request object, either of type + # {::Google::Iam::V1beta::UpdateWorkloadIdentityPoolProviderRequest} or an equivalent Hash. + # + # @param request [::Google::Iam::V1beta::UpdateWorkloadIdentityPoolProviderRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_workload_identity_pool_provider(workload_identity_pool_provider: nil, update_mask: nil) + # Pass arguments to `update_workload_identity_pool_provider` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param workload_identity_pool_provider [::Google::Iam::V1beta::WorkloadIdentityPoolProvider, ::Hash] + # Required. The provider to update. + # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] + # Required. The list of fields to update. + # + # @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/iam/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Iam::V1beta::WorkloadIdentityPools::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Iam::V1beta::UpdateWorkloadIdentityPoolProviderRequest.new + # + # # Call the update_workload_identity_pool_provider method. + # result = client.update_workload_identity_pool_provider 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 update_workload_identity_pool_provider request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1beta::UpdateWorkloadIdentityPoolProviderRequest + + # Converts hash 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_workload_identity_pool_provider.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::Iam::V1beta::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.workload_identity_pool_provider&.name + header_params["workload_identity_pool_provider.name"] = request.workload_identity_pool_provider.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_workload_identity_pool_provider.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_workload_identity_pool_provider.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @workload_identity_pools_stub.call_rpc :update_workload_identity_pool_provider, 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 + # [WorkloadIdentityPoolProvider][google.iam.v1beta.WorkloadIdentityProvider]. + # Deleting a provider does not revoke credentials that have already been + # issued; they continue to grant access. + # You can undelete a provider for 30 days. After 30 days, deletion is + # permanent. + # You cannot update deleted providers. However, you can view and list them. + # + # @overload delete_workload_identity_pool_provider(request, options = nil) + # Pass arguments to `delete_workload_identity_pool_provider` via a request object, either of type + # {::Google::Iam::V1beta::DeleteWorkloadIdentityPoolProviderRequest} or an equivalent Hash. + # + # @param request [::Google::Iam::V1beta::DeleteWorkloadIdentityPoolProviderRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_workload_identity_pool_provider(name: nil) + # Pass arguments to `delete_workload_identity_pool_provider` via keyword arguments. Note that at + # least one keyword argument is 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 name of the provider 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/iam/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Iam::V1beta::WorkloadIdentityPools::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Iam::V1beta::DeleteWorkloadIdentityPoolProviderRequest.new + # + # # Call the delete_workload_identity_pool_provider method. + # result = client.delete_workload_identity_pool_provider 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_workload_identity_pool_provider request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1beta::DeleteWorkloadIdentityPoolProviderRequest + + # Converts hash 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_workload_identity_pool_provider.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::Iam::V1beta::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_workload_identity_pool_provider.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_workload_identity_pool_provider.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @workload_identity_pools_stub.call_rpc :delete_workload_identity_pool_provider, 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 + + ## + # Undeletes a + # [WorkloadIdentityPoolProvider][google.iam.v1beta.WorkloadIdentityProvider], + # as long as it was deleted fewer than 30 days ago. + # + # @overload undelete_workload_identity_pool_provider(request, options = nil) + # Pass arguments to `undelete_workload_identity_pool_provider` via a request object, either of type + # {::Google::Iam::V1beta::UndeleteWorkloadIdentityPoolProviderRequest} or an equivalent Hash. + # + # @param request [::Google::Iam::V1beta::UndeleteWorkloadIdentityPoolProviderRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter values, pass an empty Hash. + # @param options [::Gapic::CallOptions, ::Hash] + # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. + # + # @overload undelete_workload_identity_pool_provider(name: nil) + # Pass arguments to `undelete_workload_identity_pool_provider` via keyword arguments. Note that at + # least one keyword argument is 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 name of the provider to undelete. + # + # @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/iam/v1beta" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Iam::V1beta::WorkloadIdentityPools::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Iam::V1beta::UndeleteWorkloadIdentityPoolProviderRequest.new + # + # # Call the undelete_workload_identity_pool_provider method. + # result = client.undelete_workload_identity_pool_provider 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 undelete_workload_identity_pool_provider request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1beta::UndeleteWorkloadIdentityPoolProviderRequest + + # Converts hash 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.undelete_workload_identity_pool_provider.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::Iam::V1beta::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.undelete_workload_identity_pool_provider.timeout, + metadata: metadata, + retry_policy: @config.rpcs.undelete_workload_identity_pool_provider.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @workload_identity_pools_stub.call_rpc :undelete_workload_identity_pool_provider, 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 WorkloadIdentityPools API. + # + # This class represents the configuration for WorkloadIdentityPools, + # 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::Iam::V1beta::WorkloadIdentityPools::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_workload_identity_pools to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Iam::V1beta::WorkloadIdentityPools::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_workload_identity_pools.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Iam::V1beta::WorkloadIdentityPools::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_workload_identity_pools.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::Iam::V1beta::WorkloadIdentityPools::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 = "iam.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 WorkloadIdentityPools 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_workload_identity_pools` + # @return [::Gapic::Config::Method] + # + attr_reader :list_workload_identity_pools + ## + # RPC-specific configuration for `get_workload_identity_pool` + # @return [::Gapic::Config::Method] + # + attr_reader :get_workload_identity_pool + ## + # RPC-specific configuration for `create_workload_identity_pool` + # @return [::Gapic::Config::Method] + # + attr_reader :create_workload_identity_pool + ## + # RPC-specific configuration for `update_workload_identity_pool` + # @return [::Gapic::Config::Method] + # + attr_reader :update_workload_identity_pool + ## + # RPC-specific configuration for `delete_workload_identity_pool` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_workload_identity_pool + ## + # RPC-specific configuration for `undelete_workload_identity_pool` + # @return [::Gapic::Config::Method] + # + attr_reader :undelete_workload_identity_pool + ## + # RPC-specific configuration for `list_workload_identity_pool_providers` + # @return [::Gapic::Config::Method] + # + attr_reader :list_workload_identity_pool_providers + ## + # RPC-specific configuration for `get_workload_identity_pool_provider` + # @return [::Gapic::Config::Method] + # + attr_reader :get_workload_identity_pool_provider + ## + # RPC-specific configuration for `create_workload_identity_pool_provider` + # @return [::Gapic::Config::Method] + # + attr_reader :create_workload_identity_pool_provider + ## + # RPC-specific configuration for `update_workload_identity_pool_provider` + # @return [::Gapic::Config::Method] + # + attr_reader :update_workload_identity_pool_provider + ## + # RPC-specific configuration for `delete_workload_identity_pool_provider` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_workload_identity_pool_provider + ## + # RPC-specific configuration for `undelete_workload_identity_pool_provider` + # @return [::Gapic::Config::Method] + # + attr_reader :undelete_workload_identity_pool_provider + + # @private + def initialize parent_rpcs = nil + list_workload_identity_pools_config = parent_rpcs.list_workload_identity_pools if parent_rpcs.respond_to? :list_workload_identity_pools + @list_workload_identity_pools = ::Gapic::Config::Method.new list_workload_identity_pools_config + get_workload_identity_pool_config = parent_rpcs.get_workload_identity_pool if parent_rpcs.respond_to? :get_workload_identity_pool + @get_workload_identity_pool = ::Gapic::Config::Method.new get_workload_identity_pool_config + create_workload_identity_pool_config = parent_rpcs.create_workload_identity_pool if parent_rpcs.respond_to? :create_workload_identity_pool + @create_workload_identity_pool = ::Gapic::Config::Method.new create_workload_identity_pool_config + update_workload_identity_pool_config = parent_rpcs.update_workload_identity_pool if parent_rpcs.respond_to? :update_workload_identity_pool + @update_workload_identity_pool = ::Gapic::Config::Method.new update_workload_identity_pool_config + delete_workload_identity_pool_config = parent_rpcs.delete_workload_identity_pool if parent_rpcs.respond_to? :delete_workload_identity_pool + @delete_workload_identity_pool = ::Gapic::Config::Method.new delete_workload_identity_pool_config + undelete_workload_identity_pool_config = parent_rpcs.undelete_workload_identity_pool if parent_rpcs.respond_to? :undelete_workload_identity_pool + @undelete_workload_identity_pool = ::Gapic::Config::Method.new undelete_workload_identity_pool_config + list_workload_identity_pool_providers_config = parent_rpcs.list_workload_identity_pool_providers if parent_rpcs.respond_to? :list_workload_identity_pool_providers + @list_workload_identity_pool_providers = ::Gapic::Config::Method.new list_workload_identity_pool_providers_config + get_workload_identity_pool_provider_config = parent_rpcs.get_workload_identity_pool_provider if parent_rpcs.respond_to? :get_workload_identity_pool_provider + @get_workload_identity_pool_provider = ::Gapic::Config::Method.new get_workload_identity_pool_provider_config + create_workload_identity_pool_provider_config = parent_rpcs.create_workload_identity_pool_provider if parent_rpcs.respond_to? :create_workload_identity_pool_provider + @create_workload_identity_pool_provider = ::Gapic::Config::Method.new create_workload_identity_pool_provider_config + update_workload_identity_pool_provider_config = parent_rpcs.update_workload_identity_pool_provider if parent_rpcs.respond_to? :update_workload_identity_pool_provider + @update_workload_identity_pool_provider = ::Gapic::Config::Method.new update_workload_identity_pool_provider_config + delete_workload_identity_pool_provider_config = parent_rpcs.delete_workload_identity_pool_provider if parent_rpcs.respond_to? :delete_workload_identity_pool_provider + @delete_workload_identity_pool_provider = ::Gapic::Config::Method.new delete_workload_identity_pool_provider_config + undelete_workload_identity_pool_provider_config = parent_rpcs.undelete_workload_identity_pool_provider if parent_rpcs.respond_to? :undelete_workload_identity_pool_provider + @undelete_workload_identity_pool_provider = ::Gapic::Config::Method.new undelete_workload_identity_pool_provider_config + + yield self if block_given? + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-iam-v1beta/lib/google/iam/v1beta/workload_identity_pools/credentials.rb b/owl-bot-staging/google-iam-v1beta/lib/google/iam/v1beta/workload_identity_pools/credentials.rb new file mode 100644 index 000000000000..860275d22643 --- /dev/null +++ b/owl-bot-staging/google-iam-v1beta/lib/google/iam/v1beta/workload_identity_pools/credentials.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 "googleauth" + +module Google + module Iam + module V1beta + module WorkloadIdentityPools + # Credentials for the WorkloadIdentityPools API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/cloud-platform" + ] + self.env_vars = [ + "IAM_CREDENTIALS", + "IAM_KEYFILE", + "GOOGLE_CLOUD_CREDENTIALS", + "GOOGLE_CLOUD_KEYFILE", + "GCLOUD_KEYFILE", + "IAM_CREDENTIALS_JSON", + "IAM_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 diff --git a/owl-bot-staging/google-iam-v1beta/lib/google/iam/v1beta/workload_identity_pools/operations.rb b/owl-bot-staging/google-iam-v1beta/lib/google/iam/v1beta/workload_identity_pools/operations.rb new file mode 100644 index 000000000000..b3b9896d2daf --- /dev/null +++ b/owl-bot-staging/google-iam-v1beta/lib/google/iam/v1beta/workload_identity_pools/operations.rb @@ -0,0 +1,839 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Iam + module V1beta + module WorkloadIdentityPools + # Service that implements Longrunning Operations API. + class Operations + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "iam.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :operations_stub + + ## + # Configuration for the WorkloadIdentityPools 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 WorkloadIdentityPools 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::Iam::V1beta::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::Iam::V1beta::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::Iam::V1beta::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::Iam::V1beta::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::Iam::V1beta::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 = "iam.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 diff --git a/owl-bot-staging/google-iam-v1beta/lib/google/iam/v1beta/workload_identity_pools/paths.rb b/owl-bot-staging/google-iam-v1beta/lib/google/iam/v1beta/workload_identity_pools/paths.rb new file mode 100644 index 000000000000..efdcf8b4dd15 --- /dev/null +++ b/owl-bot-staging/google-iam-v1beta/lib/google/iam/v1beta/workload_identity_pools/paths.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 Iam + module V1beta + module WorkloadIdentityPools + # Path helper methods for the WorkloadIdentityPools API. + module Paths + ## + # 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 + + ## + # Create a fully-qualified WorkloadIdentityPool resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/workloadIdentityPools/{workload_identity_pool}` + # + # @param project [String] + # @param location [String] + # @param workload_identity_pool [String] + # + # @return [::String] + def workload_identity_pool_path project:, location:, workload_identity_pool: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + + "projects/#{project}/locations/#{location}/workloadIdentityPools/#{workload_identity_pool}" + end + + ## + # Create a fully-qualified WorkloadIdentityPoolProvider resource string. + # + # The resource will be in the following format: + # + # `projects/{project}/locations/{location}/workloadIdentityPools/{workload_identity_pool}/providers/{workload_identity_pool_provider}` + # + # @param project [String] + # @param location [String] + # @param workload_identity_pool [String] + # @param workload_identity_pool_provider [String] + # + # @return [::String] + def workload_identity_pool_provider_path project:, location:, workload_identity_pool:, workload_identity_pool_provider: + raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" + raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" + raise ::ArgumentError, "workload_identity_pool cannot contain /" if workload_identity_pool.to_s.include? "/" + + "projects/#{project}/locations/#{location}/workloadIdentityPools/#{workload_identity_pool}/providers/#{workload_identity_pool_provider}" + end + + extend self + end + end + end + end +end diff --git a/owl-bot-staging/google-iam-v1beta/proto_docs/README.md b/owl-bot-staging/google-iam-v1beta/proto_docs/README.md new file mode 100644 index 000000000000..2b729bf74b6d --- /dev/null +++ b/owl-bot-staging/google-iam-v1beta/proto_docs/README.md @@ -0,0 +1,4 @@ +# Google IAM V1beta 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-iam-v1beta/proto_docs/google/api/client.rb b/owl-bot-staging/google-iam-v1beta/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..3ab0b096d445 --- /dev/null +++ b/owl-bot-staging/google-iam-v1beta/proto_docs/google/api/client.rb @@ -0,0 +1,593 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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. + # + # Note: This field should not be used in most cases. + 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: + # library_settings: + # 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. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Php. Clobbers the php_namespace option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.php.package_name" field + # in gapic.yaml. API teams should use the protobuf php_namespace option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # library_settings: + # php_settings: + # library_package: Google\Cloud\PubSub\V1 + 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. + # + # Example: + # + # 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 + # @!attribute [rw] batching + # @return [::Google::Api::BatchingConfigProto] + # Batching configuration for an API method in client libraries. + # + # Example of a YAML configuration: + # + # publishing: + # method_settings: + # - selector: google.example.v1.ExampleService.BatchCreateExample + # batching: + # element_count_threshold: 1000 + # request_byte_threshold: 100000000 + # delay_threshold_millis: 10 + 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. + # + # Note: This feature should not be used in most cases. + # @!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 + + # `BatchingConfigProto` defines the batching configuration for an API method. + # @!attribute [rw] thresholds + # @return [::Google::Api::BatchingSettingsProto] + # The thresholds which trigger a batched request to be sent. + # @!attribute [rw] batch_descriptor + # @return [::Google::Api::BatchingDescriptorProto] + # The request and response fields used in batching. + class BatchingConfigProto + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `BatchingSettingsProto` specifies a set of batching thresholds, each of + # which acts as a trigger to send a batch of messages as a request. At least + # one threshold must be positive nonzero. + # @!attribute [rw] element_count_threshold + # @return [::Integer] + # The number of elements of a field collected into a batch which, if + # exceeded, causes the batch to be sent. + # @!attribute [rw] request_byte_threshold + # @return [::Integer] + # The aggregated size of the batched field which, if exceeded, causes the + # batch to be sent. This size is computed by aggregating the sizes of the + # request field to be batched, not of the entire request message. + # @!attribute [rw] delay_threshold + # @return [::Google::Protobuf::Duration] + # The duration after which a batch should be sent, starting from the addition + # of the first message to that batch. + # @!attribute [rw] element_count_limit + # @return [::Integer] + # The maximum number of elements collected in a batch that could be accepted + # by server. + # @!attribute [rw] request_byte_limit + # @return [::Integer] + # The maximum size of the request that could be accepted by server. + # @!attribute [rw] flow_control_element_limit + # @return [::Integer] + # The maximum number of elements allowed by flow control. + # @!attribute [rw] flow_control_byte_limit + # @return [::Integer] + # The maximum size of data allowed by flow control. + # @!attribute [rw] flow_control_limit_exceeded_behavior + # @return [::Google::Api::FlowControlLimitExceededBehaviorProto] + # The behavior to take when the flow control limit is exceeded. + class BatchingSettingsProto + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `BatchingDescriptorProto` specifies the fields of the request message to be + # used for batching, and, optionally, the fields of the response message to be + # used for demultiplexing. + # @!attribute [rw] batched_field + # @return [::String] + # The repeated field in the request message to be aggregated by batching. + # @!attribute [rw] discriminator_fields + # @return [::Array<::String>] + # A list of the fields in the request message. Two requests will be batched + # together only if the values of every field specified in + # `request_discriminator_fields` is equal between the two requests. + # @!attribute [rw] subresponse_field + # @return [::String] + # Optional. When present, indicates the field in the response message to be + # used to demultiplex the response into multiple response messages, in + # correspondence with the multiple request messages originally batched + # together. + class BatchingDescriptorProto + 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 + + # The behavior to take when the flow control limit is exceeded. + module FlowControlLimitExceededBehaviorProto + # Default behavior, system-defined. + UNSET_BEHAVIOR = 0 + + # Stop operation, raise error. + THROW_EXCEPTION = 1 + + # Pause operation until limit clears. + BLOCK = 2 + + # Continue operation, disregard limit. + IGNORE = 3 + end + end +end diff --git a/owl-bot-staging/google-iam-v1beta/proto_docs/google/api/field_behavior.rb b/owl-bot-staging/google-iam-v1beta/proto_docs/google/api/field_behavior.rb new file mode 100644 index 000000000000..582be187d115 --- /dev/null +++ b/owl-bot-staging/google-iam-v1beta/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-iam-v1beta/proto_docs/google/api/launch_stage.rb b/owl-bot-staging/google-iam-v1beta/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..9392a413fb1b --- /dev/null +++ b/owl-bot-staging/google-iam-v1beta/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-iam-v1beta/proto_docs/google/api/resource.rb b/owl-bot-staging/google-iam-v1beta/proto_docs/google/api/resource.rb new file mode 100644 index 000000000000..25dec4847ac1 --- /dev/null +++ b/owl-bot-staging/google-iam-v1beta/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-iam-v1beta/proto_docs/google/iam/v1beta/workload_identity_pool.rb b/owl-bot-staging/google-iam-v1beta/proto_docs/google/iam/v1beta/workload_identity_pool.rb new file mode 100644 index 000000000000..175cbd0fee65 --- /dev/null +++ b/owl-bot-staging/google-iam-v1beta/proto_docs/google/iam/v1beta/workload_identity_pool.rb @@ -0,0 +1,467 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Iam + module V1beta + # Represents a collection of external workload identities. You can define IAM + # policies to grant these identities access to Google Cloud resources. + # @!attribute [r] name + # @return [::String] + # Output only. The resource name of the pool. + # @!attribute [rw] display_name + # @return [::String] + # A display name for the pool. Cannot exceed 32 characters. + # @!attribute [rw] description + # @return [::String] + # A description of the pool. Cannot exceed 256 characters. + # @!attribute [r] state + # @return [::Google::Iam::V1beta::WorkloadIdentityPool::State] + # Output only. The state of the pool. + # @!attribute [rw] disabled + # @return [::Boolean] + # Whether the pool is disabled. You cannot use a disabled pool to exchange + # tokens, or use existing tokens to access resources. If + # the pool is re-enabled, existing tokens grant access again. + class WorkloadIdentityPool + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # The current state of the pool. + module State + # State unspecified. + STATE_UNSPECIFIED = 0 + + # The pool is active, and may be used in Google Cloud policies. + ACTIVE = 1 + + # The pool is soft-deleted. Soft-deleted pools are permanently deleted + # after approximately 30 days. You can restore a soft-deleted pool using + # {::Google::Iam::V1beta::WorkloadIdentityPools::Client#undelete_workload_identity_pool UndeleteWorkloadIdentityPool}. + # + # You cannot reuse the ID of a soft-deleted pool until it is permanently + # deleted. + # + # While a pool is deleted, you cannot use it to exchange tokens, or use + # existing tokens to access resources. If the pool is undeleted, existing + # tokens grant access again. + DELETED = 2 + end + end + + # A configuration for an external identity provider. + # @!attribute [r] name + # @return [::String] + # Output only. The resource name of the provider. + # @!attribute [rw] display_name + # @return [::String] + # A display name for the provider. Cannot exceed 32 characters. + # @!attribute [rw] description + # @return [::String] + # A description for the provider. Cannot exceed 256 characters. + # @!attribute [r] state + # @return [::Google::Iam::V1beta::WorkloadIdentityPoolProvider::State] + # Output only. The state of the provider. + # @!attribute [rw] disabled + # @return [::Boolean] + # Whether the provider is disabled. You cannot use a disabled provider to + # exchange tokens. However, existing tokens still grant access. + # @!attribute [rw] attribute_mapping + # @return [::Google::Protobuf::Map{::String => ::String}] + # Maps attributes from authentication credentials issued by an external + # identity provider to Google Cloud attributes, such as `subject` and + # `segment`. + # + # Each key must be a string specifying the Google Cloud IAM attribute to + # map to. + # + # The following keys are supported: + # + # * `google.subject`: The principal IAM is authenticating. You can reference + # this value in IAM bindings. This is also the + # subject that appears in Cloud Logging logs. + # Cannot exceed 127 characters. + # + # * `google.groups`: Groups the external identity belongs to. You can grant + # groups access to resources using an IAM `principalSet` + # binding; access applies to all members of the group. + # + # You can also provide custom attributes by specifying + # `attribute.{custom_attribute}`, where `{custom_attribute}` is the name of + # the custom attribute to be mapped. You can define a maximum of 50 custom + # attributes. The maximum length of a mapped attribute key is + # 100 characters, and the key may only contain the characters [a-z0-9_]. + # + # You can reference these attributes in IAM policies to define fine-grained + # access for a workload to Google Cloud resources. For example: + # + # * `google.subject`: + # `principal://iam.googleapis.com/projects/{project}/locations/{location}/workloadIdentityPools/{pool}/subject/{value}` + # + # * `google.groups`: + # `principalSet://iam.googleapis.com/projects/{project}/locations/{location}/workloadIdentityPools/{pool}/group/{value}` + # + # * `attribute.{custom_attribute}`: + # `principalSet://iam.googleapis.com/projects/{project}/locations/{location}/workloadIdentityPools/{pool}/attribute.{custom_attribute}/{value}` + # + # Each value must be a [Common Expression Language] + # (https://opensource.google/projects/cel) function that maps an + # identity provider credential to the normalized attribute specified by the + # corresponding map key. + # + # You can use the `assertion` keyword in the expression to access a JSON + # representation of the authentication credential issued by the provider. + # + # The maximum length of an attribute mapping expression is 2048 characters. + # When evaluated, the total size of all mapped attributes must not exceed + # 8KB. + # + # For AWS providers, the following rules apply: + # + # - If no attribute mapping is defined, the following default mapping + # applies: + # + # ``` + # { + # "google.subject":"assertion.arn", + # "attribute.aws_role": + # "assertion.arn.contains('assumed-role')" + # " ? assertion.arn.extract('\\{account_arn}assumed-role/')" + # " + 'assumed-role/'" + # " + assertion.arn.extract('assumed-role/\\{role_name}/')" + # " : assertion.arn", + # } + # ``` + # + # - If any custom attribute mappings are defined, they must include a mapping + # to the `google.subject` attribute. + # + # + # For OIDC providers, the following rules apply: + # + # - Custom attribute mappings must be defined, and must include a mapping to + # the `google.subject` attribute. For example, the following maps the + # `sub` claim of the incoming credential to the `subject` attribute on + # a Google token. + # + # ``` + # \\{"google.subject": "assertion.sub"} + # ``` + # @!attribute [rw] attribute_condition + # @return [::String] + # [A Common Expression Language](https://opensource.google/projects/cel) + # expression, in plain text, to restrict what otherwise valid authentication + # credentials issued by the provider should not be accepted. + # + # The expression must output a boolean representing whether to allow the + # federation. + # + # The following keywords may be referenced in the expressions: + # + # * `assertion`: JSON representing the authentication credential issued by + # the provider. + # * `google`: The Google attributes mapped from the assertion in the + # `attribute_mappings`. + # * `attribute`: The custom attributes mapped from the assertion in the + # `attribute_mappings`. + # + # The maximum length of the attribute condition expression is 4096 + # characters. If unspecified, all valid authentication credential are + # accepted. + # + # The following example shows how to only allow credentials with a mapped + # `google.groups` value of `admins`: + # + # ``` + # "'admins' in google.groups" + # ``` + # @!attribute [rw] aws + # @return [::Google::Iam::V1beta::WorkloadIdentityPoolProvider::Aws] + # An Amazon Web Services identity provider. + # + # Note: The following fields are mutually exclusive: `aws`, `oidc`. If a field in that set is populated, all other fields in the set will automatically be cleared. + # @!attribute [rw] oidc + # @return [::Google::Iam::V1beta::WorkloadIdentityPoolProvider::Oidc] + # An OpenId Connect 1.0 identity provider. + # + # Note: The following fields are mutually exclusive: `oidc`, `aws`. If a field in that set is populated, all other fields in the set will automatically be cleared. + class WorkloadIdentityPoolProvider + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # Represents an Amazon Web Services identity provider. + # @!attribute [rw] account_id + # @return [::String] + # Required. The AWS account ID. + class Aws + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Represents an OpenId Connect 1.0 identity provider. + # @!attribute [rw] issuer_uri + # @return [::String] + # Required. The OIDC issuer URL. + # @!attribute [rw] allowed_audiences + # @return [::Array<::String>] + # Acceptable values for the `aud` field (audience) in the OIDC token. Token + # exchange requests are rejected if the token audience does not match one + # of the configured values. Each audience may be at most 256 characters. A + # maximum of 10 audiences may be configured. + # + # If this list is empty, the OIDC token audience must be equal to + # the full canonical resource name of the WorkloadIdentityPoolProvider, + # with or without the HTTPS prefix. For example: + # + # ``` + # //iam.googleapis.com/projects//locations//workloadIdentityPools//providers/ + # https://iam.googleapis.com/projects//locations//workloadIdentityPools//providers/ + # ``` + class Oidc + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class AttributeMappingEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # The current state of the provider. + module State + # State unspecified. + STATE_UNSPECIFIED = 0 + + # The provider is active, and may be used to validate authentication + # credentials. + ACTIVE = 1 + + # The provider is soft-deleted. Soft-deleted providers are permanently + # deleted after approximately 30 days. You can restore a soft-deleted + # provider using + # {::Google::Iam::V1beta::WorkloadIdentityPools::Client#undelete_workload_identity_pool_provider UndeleteWorkloadIdentityPoolProvider}. + # + # You cannot reuse the ID of a soft-deleted provider until it is + # permanently deleted. + DELETED = 2 + end + end + + # Request message for ListWorkloadIdentityPools. + # @!attribute [rw] parent + # @return [::String] + # Required. The parent resource to list pools for. + # @!attribute [rw] page_size + # @return [::Integer] + # The maximum number of pools to return. + # If unspecified, at most 50 pools are returned. + # The maximum value is 1000; values above are 1000 truncated to 1000. + # @!attribute [rw] page_token + # @return [::String] + # A page token, received from a previous `ListWorkloadIdentityPools` + # call. Provide this to retrieve the subsequent page. + # @!attribute [rw] show_deleted + # @return [::Boolean] + # Whether to return soft-deleted pools. + class ListWorkloadIdentityPoolsRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for ListWorkloadIdentityPools. + # @!attribute [rw] workload_identity_pools + # @return [::Array<::Google::Iam::V1beta::WorkloadIdentityPool>] + # A list of pools. + # @!attribute [rw] next_page_token + # @return [::String] + # A token, which can be sent as `page_token` to retrieve the next page. + # If this field is omitted, there are no subsequent pages. + class ListWorkloadIdentityPoolsResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for GetWorkloadIdentityPool. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the pool to retrieve. + class GetWorkloadIdentityPoolRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for CreateWorkloadIdentityPool. + # @!attribute [rw] parent + # @return [::String] + # Required. The parent resource to create the pool in. The only supported + # location is `global`. + # @!attribute [rw] workload_identity_pool + # @return [::Google::Iam::V1beta::WorkloadIdentityPool] + # Required. The pool to create. + # @!attribute [rw] workload_identity_pool_id + # @return [::String] + # Required. The ID to use for the pool, which becomes the + # final component of the resource name. This value should be 4-32 characters, + # and may contain the characters [a-z0-9-]. The prefix `gcp-` is + # reserved for use by Google, and may not be specified. + class CreateWorkloadIdentityPoolRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for UpdateWorkloadIdentityPool. + # @!attribute [rw] workload_identity_pool + # @return [::Google::Iam::V1beta::WorkloadIdentityPool] + # Required. The pool to update. The `name` field is used to identify the pool. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # Required. The list of fields update. + class UpdateWorkloadIdentityPoolRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for DeleteWorkloadIdentityPool. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the pool to delete. + class DeleteWorkloadIdentityPoolRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for UndeleteWorkloadIdentityPool. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the pool to undelete. + class UndeleteWorkloadIdentityPoolRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for ListWorkloadIdentityPoolProviders. + # @!attribute [rw] parent + # @return [::String] + # Required. The pool to list providers for. + # @!attribute [rw] page_size + # @return [::Integer] + # The maximum number of providers to return. + # If unspecified, at most 50 providers are returned. + # The maximum value is 100; values above 100 are truncated to 100. + # @!attribute [rw] page_token + # @return [::String] + # A page token, received from a previous + # `ListWorkloadIdentityPoolProviders` call. Provide this to retrieve the + # subsequent page. + # @!attribute [rw] show_deleted + # @return [::Boolean] + # Whether to return soft-deleted providers. + class ListWorkloadIdentityPoolProvidersRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for ListWorkloadIdentityPoolProviders. + # @!attribute [rw] workload_identity_pool_providers + # @return [::Array<::Google::Iam::V1beta::WorkloadIdentityPoolProvider>] + # A list of providers. + # @!attribute [rw] next_page_token + # @return [::String] + # A token, which can be sent as `page_token` to retrieve the next page. + # If this field is omitted, there are no subsequent pages. + class ListWorkloadIdentityPoolProvidersResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for GetWorkloadIdentityPoolProvider. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the provider to retrieve. + class GetWorkloadIdentityPoolProviderRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for CreateWorkloadIdentityPoolProvider. + # @!attribute [rw] parent + # @return [::String] + # Required. The pool to create this provider in. + # @!attribute [rw] workload_identity_pool_provider + # @return [::Google::Iam::V1beta::WorkloadIdentityPoolProvider] + # Required. The provider to create. + # @!attribute [rw] workload_identity_pool_provider_id + # @return [::String] + # Required. The ID for the provider, which becomes the + # final component of the resource name. This value must be 4-32 characters, + # and may contain the characters [a-z0-9-]. The prefix `gcp-` is + # reserved for use by Google, and may not be specified. + class CreateWorkloadIdentityPoolProviderRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for UpdateWorkloadIdentityPoolProvider. + # @!attribute [rw] workload_identity_pool_provider + # @return [::Google::Iam::V1beta::WorkloadIdentityPoolProvider] + # Required. The provider to update. + # @!attribute [rw] update_mask + # @return [::Google::Protobuf::FieldMask] + # Required. The list of fields to update. + class UpdateWorkloadIdentityPoolProviderRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for DeleteWorkloadIdentityPoolProvider. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the provider to delete. + class DeleteWorkloadIdentityPoolProviderRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for UndeleteWorkloadIdentityPoolProvider. + # @!attribute [rw] name + # @return [::String] + # Required. The name of the provider to undelete. + class UndeleteWorkloadIdentityPoolProviderRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Metadata for long-running WorkloadIdentityPool operations. + class WorkloadIdentityPoolOperationMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Metadata for long-running WorkloadIdentityPoolProvider operations. + class WorkloadIdentityPoolProviderOperationMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end +end diff --git a/owl-bot-staging/google-iam-v1beta/proto_docs/google/longrunning/operations.rb b/owl-bot-staging/google-iam-v1beta/proto_docs/google/longrunning/operations.rb new file mode 100644 index 000000000000..7a757f512165 --- /dev/null +++ b/owl-bot-staging/google-iam-v1beta/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-iam-v1beta/proto_docs/google/protobuf/any.rb b/owl-bot-staging/google-iam-v1beta/proto_docs/google/protobuf/any.rb new file mode 100644 index 000000000000..58691995f02e --- /dev/null +++ b/owl-bot-staging/google-iam-v1beta/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-iam-v1beta/proto_docs/google/protobuf/duration.rb b/owl-bot-staging/google-iam-v1beta/proto_docs/google/protobuf/duration.rb new file mode 100644 index 000000000000..ea59f1f91daf --- /dev/null +++ b/owl-bot-staging/google-iam-v1beta/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-iam-v1beta/proto_docs/google/protobuf/empty.rb b/owl-bot-staging/google-iam-v1beta/proto_docs/google/protobuf/empty.rb new file mode 100644 index 000000000000..83e4481834a6 --- /dev/null +++ b/owl-bot-staging/google-iam-v1beta/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-iam-v1beta/proto_docs/google/protobuf/field_mask.rb b/owl-bot-staging/google-iam-v1beta/proto_docs/google/protobuf/field_mask.rb new file mode 100644 index 000000000000..7f3ffc78601a --- /dev/null +++ b/owl-bot-staging/google-iam-v1beta/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-iam-v1beta/proto_docs/google/rpc/status.rb b/owl-bot-staging/google-iam-v1beta/proto_docs/google/rpc/status.rb new file mode 100644 index 000000000000..c1a1c07eb2db --- /dev/null +++ b/owl-bot-staging/google-iam-v1beta/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-iam-v1beta/snippets/Gemfile b/owl-bot-staging/google-iam-v1beta/snippets/Gemfile new file mode 100644 index 000000000000..f4fbd0daaecf --- /dev/null +++ b/owl-bot-staging/google-iam-v1beta/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-iam-v1beta", path: "../" +else + gem "google-iam-v1beta" +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-iam-v1beta/snippets/snippet_metadata_google.iam.v1beta.json b/owl-bot-staging/google-iam-v1beta/snippets/snippet_metadata_google.iam.v1beta.json new file mode 100644 index 000000000000..0c0f6ad2607f --- /dev/null +++ b/owl-bot-staging/google-iam-v1beta/snippets/snippet_metadata_google.iam.v1beta.json @@ -0,0 +1,495 @@ +{ + "client_library": { + "name": "google-iam-v1beta", + "version": "", + "language": "RUBY", + "apis": [ + { + "id": "google.iam.v1beta", + "version": "v1beta" + } + ] + }, + "snippets": [ + { + "region_tag": "iam_v1beta_generated_WorkloadIdentityPools_ListWorkloadIdentityPools_sync", + "title": "Snippet for the list_workload_identity_pools call in the WorkloadIdentityPools service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Iam::V1beta::WorkloadIdentityPools::Client#list_workload_identity_pools.", + "file": "workload_identity_pools/list_workload_identity_pools.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_workload_identity_pools", + "full_name": "::Google::Iam::V1beta::WorkloadIdentityPools::Client#list_workload_identity_pools", + "async": false, + "parameters": [ + { + "type": "::Google::Iam::V1beta::ListWorkloadIdentityPoolsRequest", + "name": "request" + } + ], + "result_type": "::Google::Iam::V1beta::ListWorkloadIdentityPoolsResponse", + "client": { + "short_name": "WorkloadIdentityPools::Client", + "full_name": "::Google::Iam::V1beta::WorkloadIdentityPools::Client" + }, + "method": { + "short_name": "ListWorkloadIdentityPools", + "full_name": "google.iam.v1beta.WorkloadIdentityPools.ListWorkloadIdentityPools", + "service": { + "short_name": "WorkloadIdentityPools", + "full_name": "google.iam.v1beta.WorkloadIdentityPools" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "iam_v1beta_generated_WorkloadIdentityPools_GetWorkloadIdentityPool_sync", + "title": "Snippet for the get_workload_identity_pool call in the WorkloadIdentityPools service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Iam::V1beta::WorkloadIdentityPools::Client#get_workload_identity_pool.", + "file": "workload_identity_pools/get_workload_identity_pool.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_workload_identity_pool", + "full_name": "::Google::Iam::V1beta::WorkloadIdentityPools::Client#get_workload_identity_pool", + "async": false, + "parameters": [ + { + "type": "::Google::Iam::V1beta::GetWorkloadIdentityPoolRequest", + "name": "request" + } + ], + "result_type": "::Google::Iam::V1beta::WorkloadIdentityPool", + "client": { + "short_name": "WorkloadIdentityPools::Client", + "full_name": "::Google::Iam::V1beta::WorkloadIdentityPools::Client" + }, + "method": { + "short_name": "GetWorkloadIdentityPool", + "full_name": "google.iam.v1beta.WorkloadIdentityPools.GetWorkloadIdentityPool", + "service": { + "short_name": "WorkloadIdentityPools", + "full_name": "google.iam.v1beta.WorkloadIdentityPools" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "iam_v1beta_generated_WorkloadIdentityPools_CreateWorkloadIdentityPool_sync", + "title": "Snippet for the create_workload_identity_pool call in the WorkloadIdentityPools service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Iam::V1beta::WorkloadIdentityPools::Client#create_workload_identity_pool.", + "file": "workload_identity_pools/create_workload_identity_pool.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_workload_identity_pool", + "full_name": "::Google::Iam::V1beta::WorkloadIdentityPools::Client#create_workload_identity_pool", + "async": false, + "parameters": [ + { + "type": "::Google::Iam::V1beta::CreateWorkloadIdentityPoolRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "WorkloadIdentityPools::Client", + "full_name": "::Google::Iam::V1beta::WorkloadIdentityPools::Client" + }, + "method": { + "short_name": "CreateWorkloadIdentityPool", + "full_name": "google.iam.v1beta.WorkloadIdentityPools.CreateWorkloadIdentityPool", + "service": { + "short_name": "WorkloadIdentityPools", + "full_name": "google.iam.v1beta.WorkloadIdentityPools" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "iam_v1beta_generated_WorkloadIdentityPools_UpdateWorkloadIdentityPool_sync", + "title": "Snippet for the update_workload_identity_pool call in the WorkloadIdentityPools service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Iam::V1beta::WorkloadIdentityPools::Client#update_workload_identity_pool.", + "file": "workload_identity_pools/update_workload_identity_pool.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_workload_identity_pool", + "full_name": "::Google::Iam::V1beta::WorkloadIdentityPools::Client#update_workload_identity_pool", + "async": false, + "parameters": [ + { + "type": "::Google::Iam::V1beta::UpdateWorkloadIdentityPoolRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "WorkloadIdentityPools::Client", + "full_name": "::Google::Iam::V1beta::WorkloadIdentityPools::Client" + }, + "method": { + "short_name": "UpdateWorkloadIdentityPool", + "full_name": "google.iam.v1beta.WorkloadIdentityPools.UpdateWorkloadIdentityPool", + "service": { + "short_name": "WorkloadIdentityPools", + "full_name": "google.iam.v1beta.WorkloadIdentityPools" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "iam_v1beta_generated_WorkloadIdentityPools_DeleteWorkloadIdentityPool_sync", + "title": "Snippet for the delete_workload_identity_pool call in the WorkloadIdentityPools service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Iam::V1beta::WorkloadIdentityPools::Client#delete_workload_identity_pool.", + "file": "workload_identity_pools/delete_workload_identity_pool.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_workload_identity_pool", + "full_name": "::Google::Iam::V1beta::WorkloadIdentityPools::Client#delete_workload_identity_pool", + "async": false, + "parameters": [ + { + "type": "::Google::Iam::V1beta::DeleteWorkloadIdentityPoolRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "WorkloadIdentityPools::Client", + "full_name": "::Google::Iam::V1beta::WorkloadIdentityPools::Client" + }, + "method": { + "short_name": "DeleteWorkloadIdentityPool", + "full_name": "google.iam.v1beta.WorkloadIdentityPools.DeleteWorkloadIdentityPool", + "service": { + "short_name": "WorkloadIdentityPools", + "full_name": "google.iam.v1beta.WorkloadIdentityPools" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "iam_v1beta_generated_WorkloadIdentityPools_UndeleteWorkloadIdentityPool_sync", + "title": "Snippet for the undelete_workload_identity_pool call in the WorkloadIdentityPools service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Iam::V1beta::WorkloadIdentityPools::Client#undelete_workload_identity_pool.", + "file": "workload_identity_pools/undelete_workload_identity_pool.rb", + "language": "RUBY", + "client_method": { + "short_name": "undelete_workload_identity_pool", + "full_name": "::Google::Iam::V1beta::WorkloadIdentityPools::Client#undelete_workload_identity_pool", + "async": false, + "parameters": [ + { + "type": "::Google::Iam::V1beta::UndeleteWorkloadIdentityPoolRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "WorkloadIdentityPools::Client", + "full_name": "::Google::Iam::V1beta::WorkloadIdentityPools::Client" + }, + "method": { + "short_name": "UndeleteWorkloadIdentityPool", + "full_name": "google.iam.v1beta.WorkloadIdentityPools.UndeleteWorkloadIdentityPool", + "service": { + "short_name": "WorkloadIdentityPools", + "full_name": "google.iam.v1beta.WorkloadIdentityPools" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "iam_v1beta_generated_WorkloadIdentityPools_ListWorkloadIdentityPoolProviders_sync", + "title": "Snippet for the list_workload_identity_pool_providers call in the WorkloadIdentityPools service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Iam::V1beta::WorkloadIdentityPools::Client#list_workload_identity_pool_providers.", + "file": "workload_identity_pools/list_workload_identity_pool_providers.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_workload_identity_pool_providers", + "full_name": "::Google::Iam::V1beta::WorkloadIdentityPools::Client#list_workload_identity_pool_providers", + "async": false, + "parameters": [ + { + "type": "::Google::Iam::V1beta::ListWorkloadIdentityPoolProvidersRequest", + "name": "request" + } + ], + "result_type": "::Google::Iam::V1beta::ListWorkloadIdentityPoolProvidersResponse", + "client": { + "short_name": "WorkloadIdentityPools::Client", + "full_name": "::Google::Iam::V1beta::WorkloadIdentityPools::Client" + }, + "method": { + "short_name": "ListWorkloadIdentityPoolProviders", + "full_name": "google.iam.v1beta.WorkloadIdentityPools.ListWorkloadIdentityPoolProviders", + "service": { + "short_name": "WorkloadIdentityPools", + "full_name": "google.iam.v1beta.WorkloadIdentityPools" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "iam_v1beta_generated_WorkloadIdentityPools_GetWorkloadIdentityPoolProvider_sync", + "title": "Snippet for the get_workload_identity_pool_provider call in the WorkloadIdentityPools service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Iam::V1beta::WorkloadIdentityPools::Client#get_workload_identity_pool_provider.", + "file": "workload_identity_pools/get_workload_identity_pool_provider.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_workload_identity_pool_provider", + "full_name": "::Google::Iam::V1beta::WorkloadIdentityPools::Client#get_workload_identity_pool_provider", + "async": false, + "parameters": [ + { + "type": "::Google::Iam::V1beta::GetWorkloadIdentityPoolProviderRequest", + "name": "request" + } + ], + "result_type": "::Google::Iam::V1beta::WorkloadIdentityPoolProvider", + "client": { + "short_name": "WorkloadIdentityPools::Client", + "full_name": "::Google::Iam::V1beta::WorkloadIdentityPools::Client" + }, + "method": { + "short_name": "GetWorkloadIdentityPoolProvider", + "full_name": "google.iam.v1beta.WorkloadIdentityPools.GetWorkloadIdentityPoolProvider", + "service": { + "short_name": "WorkloadIdentityPools", + "full_name": "google.iam.v1beta.WorkloadIdentityPools" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "iam_v1beta_generated_WorkloadIdentityPools_CreateWorkloadIdentityPoolProvider_sync", + "title": "Snippet for the create_workload_identity_pool_provider call in the WorkloadIdentityPools service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Iam::V1beta::WorkloadIdentityPools::Client#create_workload_identity_pool_provider.", + "file": "workload_identity_pools/create_workload_identity_pool_provider.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_workload_identity_pool_provider", + "full_name": "::Google::Iam::V1beta::WorkloadIdentityPools::Client#create_workload_identity_pool_provider", + "async": false, + "parameters": [ + { + "type": "::Google::Iam::V1beta::CreateWorkloadIdentityPoolProviderRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "WorkloadIdentityPools::Client", + "full_name": "::Google::Iam::V1beta::WorkloadIdentityPools::Client" + }, + "method": { + "short_name": "CreateWorkloadIdentityPoolProvider", + "full_name": "google.iam.v1beta.WorkloadIdentityPools.CreateWorkloadIdentityPoolProvider", + "service": { + "short_name": "WorkloadIdentityPools", + "full_name": "google.iam.v1beta.WorkloadIdentityPools" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "iam_v1beta_generated_WorkloadIdentityPools_UpdateWorkloadIdentityPoolProvider_sync", + "title": "Snippet for the update_workload_identity_pool_provider call in the WorkloadIdentityPools service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Iam::V1beta::WorkloadIdentityPools::Client#update_workload_identity_pool_provider.", + "file": "workload_identity_pools/update_workload_identity_pool_provider.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_workload_identity_pool_provider", + "full_name": "::Google::Iam::V1beta::WorkloadIdentityPools::Client#update_workload_identity_pool_provider", + "async": false, + "parameters": [ + { + "type": "::Google::Iam::V1beta::UpdateWorkloadIdentityPoolProviderRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "WorkloadIdentityPools::Client", + "full_name": "::Google::Iam::V1beta::WorkloadIdentityPools::Client" + }, + "method": { + "short_name": "UpdateWorkloadIdentityPoolProvider", + "full_name": "google.iam.v1beta.WorkloadIdentityPools.UpdateWorkloadIdentityPoolProvider", + "service": { + "short_name": "WorkloadIdentityPools", + "full_name": "google.iam.v1beta.WorkloadIdentityPools" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "iam_v1beta_generated_WorkloadIdentityPools_DeleteWorkloadIdentityPoolProvider_sync", + "title": "Snippet for the delete_workload_identity_pool_provider call in the WorkloadIdentityPools service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Iam::V1beta::WorkloadIdentityPools::Client#delete_workload_identity_pool_provider.", + "file": "workload_identity_pools/delete_workload_identity_pool_provider.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_workload_identity_pool_provider", + "full_name": "::Google::Iam::V1beta::WorkloadIdentityPools::Client#delete_workload_identity_pool_provider", + "async": false, + "parameters": [ + { + "type": "::Google::Iam::V1beta::DeleteWorkloadIdentityPoolProviderRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "WorkloadIdentityPools::Client", + "full_name": "::Google::Iam::V1beta::WorkloadIdentityPools::Client" + }, + "method": { + "short_name": "DeleteWorkloadIdentityPoolProvider", + "full_name": "google.iam.v1beta.WorkloadIdentityPools.DeleteWorkloadIdentityPoolProvider", + "service": { + "short_name": "WorkloadIdentityPools", + "full_name": "google.iam.v1beta.WorkloadIdentityPools" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "iam_v1beta_generated_WorkloadIdentityPools_UndeleteWorkloadIdentityPoolProvider_sync", + "title": "Snippet for the undelete_workload_identity_pool_provider call in the WorkloadIdentityPools service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Iam::V1beta::WorkloadIdentityPools::Client#undelete_workload_identity_pool_provider.", + "file": "workload_identity_pools/undelete_workload_identity_pool_provider.rb", + "language": "RUBY", + "client_method": { + "short_name": "undelete_workload_identity_pool_provider", + "full_name": "::Google::Iam::V1beta::WorkloadIdentityPools::Client#undelete_workload_identity_pool_provider", + "async": false, + "parameters": [ + { + "type": "::Google::Iam::V1beta::UndeleteWorkloadIdentityPoolProviderRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "WorkloadIdentityPools::Client", + "full_name": "::Google::Iam::V1beta::WorkloadIdentityPools::Client" + }, + "method": { + "short_name": "UndeleteWorkloadIdentityPoolProvider", + "full_name": "google.iam.v1beta.WorkloadIdentityPools.UndeleteWorkloadIdentityPoolProvider", + "service": { + "short_name": "WorkloadIdentityPools", + "full_name": "google.iam.v1beta.WorkloadIdentityPools" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + } + ] +} \ No newline at end of file diff --git a/owl-bot-staging/google-iam-v1beta/snippets/workload_identity_pools/create_workload_identity_pool.rb b/owl-bot-staging/google-iam-v1beta/snippets/workload_identity_pools/create_workload_identity_pool.rb new file mode 100644 index 000000000000..fba71e6d0b13 --- /dev/null +++ b/owl-bot-staging/google-iam-v1beta/snippets/workload_identity_pools/create_workload_identity_pool.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 iam_v1beta_generated_WorkloadIdentityPools_CreateWorkloadIdentityPool_sync] +require "google/iam/v1beta" + +## +# Snippet for the create_workload_identity_pool call in the WorkloadIdentityPools 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::Iam::V1beta::WorkloadIdentityPools::Client#create_workload_identity_pool. +# +def create_workload_identity_pool + # Create a client object. The client can be reused for multiple calls. + client = Google::Iam::V1beta::WorkloadIdentityPools::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::V1beta::CreateWorkloadIdentityPoolRequest.new + + # Call the create_workload_identity_pool method. + result = client.create_workload_identity_pool 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 iam_v1beta_generated_WorkloadIdentityPools_CreateWorkloadIdentityPool_sync] diff --git a/owl-bot-staging/google-iam-v1beta/snippets/workload_identity_pools/create_workload_identity_pool_provider.rb b/owl-bot-staging/google-iam-v1beta/snippets/workload_identity_pools/create_workload_identity_pool_provider.rb new file mode 100644 index 000000000000..2b1165c92103 --- /dev/null +++ b/owl-bot-staging/google-iam-v1beta/snippets/workload_identity_pools/create_workload_identity_pool_provider.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 iam_v1beta_generated_WorkloadIdentityPools_CreateWorkloadIdentityPoolProvider_sync] +require "google/iam/v1beta" + +## +# Snippet for the create_workload_identity_pool_provider call in the WorkloadIdentityPools 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::Iam::V1beta::WorkloadIdentityPools::Client#create_workload_identity_pool_provider. +# +def create_workload_identity_pool_provider + # Create a client object. The client can be reused for multiple calls. + client = Google::Iam::V1beta::WorkloadIdentityPools::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::V1beta::CreateWorkloadIdentityPoolProviderRequest.new + + # Call the create_workload_identity_pool_provider method. + result = client.create_workload_identity_pool_provider 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 iam_v1beta_generated_WorkloadIdentityPools_CreateWorkloadIdentityPoolProvider_sync] diff --git a/owl-bot-staging/google-iam-v1beta/snippets/workload_identity_pools/delete_workload_identity_pool.rb b/owl-bot-staging/google-iam-v1beta/snippets/workload_identity_pools/delete_workload_identity_pool.rb new file mode 100644 index 000000000000..a2bbb45a5c7d --- /dev/null +++ b/owl-bot-staging/google-iam-v1beta/snippets/workload_identity_pools/delete_workload_identity_pool.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 iam_v1beta_generated_WorkloadIdentityPools_DeleteWorkloadIdentityPool_sync] +require "google/iam/v1beta" + +## +# Snippet for the delete_workload_identity_pool call in the WorkloadIdentityPools 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::Iam::V1beta::WorkloadIdentityPools::Client#delete_workload_identity_pool. +# +def delete_workload_identity_pool + # Create a client object. The client can be reused for multiple calls. + client = Google::Iam::V1beta::WorkloadIdentityPools::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::V1beta::DeleteWorkloadIdentityPoolRequest.new + + # Call the delete_workload_identity_pool method. + result = client.delete_workload_identity_pool 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 iam_v1beta_generated_WorkloadIdentityPools_DeleteWorkloadIdentityPool_sync] diff --git a/owl-bot-staging/google-iam-v1beta/snippets/workload_identity_pools/delete_workload_identity_pool_provider.rb b/owl-bot-staging/google-iam-v1beta/snippets/workload_identity_pools/delete_workload_identity_pool_provider.rb new file mode 100644 index 000000000000..0dcacc0d7d0f --- /dev/null +++ b/owl-bot-staging/google-iam-v1beta/snippets/workload_identity_pools/delete_workload_identity_pool_provider.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 iam_v1beta_generated_WorkloadIdentityPools_DeleteWorkloadIdentityPoolProvider_sync] +require "google/iam/v1beta" + +## +# Snippet for the delete_workload_identity_pool_provider call in the WorkloadIdentityPools 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::Iam::V1beta::WorkloadIdentityPools::Client#delete_workload_identity_pool_provider. +# +def delete_workload_identity_pool_provider + # Create a client object. The client can be reused for multiple calls. + client = Google::Iam::V1beta::WorkloadIdentityPools::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::V1beta::DeleteWorkloadIdentityPoolProviderRequest.new + + # Call the delete_workload_identity_pool_provider method. + result = client.delete_workload_identity_pool_provider 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 iam_v1beta_generated_WorkloadIdentityPools_DeleteWorkloadIdentityPoolProvider_sync] diff --git a/owl-bot-staging/google-iam-v1beta/snippets/workload_identity_pools/get_workload_identity_pool.rb b/owl-bot-staging/google-iam-v1beta/snippets/workload_identity_pools/get_workload_identity_pool.rb new file mode 100644 index 000000000000..41e8e125bbc4 --- /dev/null +++ b/owl-bot-staging/google-iam-v1beta/snippets/workload_identity_pools/get_workload_identity_pool.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 iam_v1beta_generated_WorkloadIdentityPools_GetWorkloadIdentityPool_sync] +require "google/iam/v1beta" + +## +# Snippet for the get_workload_identity_pool call in the WorkloadIdentityPools 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::Iam::V1beta::WorkloadIdentityPools::Client#get_workload_identity_pool. +# +def get_workload_identity_pool + # Create a client object. The client can be reused for multiple calls. + client = Google::Iam::V1beta::WorkloadIdentityPools::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::V1beta::GetWorkloadIdentityPoolRequest.new + + # Call the get_workload_identity_pool method. + result = client.get_workload_identity_pool request + + # The returned object is of type Google::Iam::V1beta::WorkloadIdentityPool. + p result +end +# [END iam_v1beta_generated_WorkloadIdentityPools_GetWorkloadIdentityPool_sync] diff --git a/owl-bot-staging/google-iam-v1beta/snippets/workload_identity_pools/get_workload_identity_pool_provider.rb b/owl-bot-staging/google-iam-v1beta/snippets/workload_identity_pools/get_workload_identity_pool_provider.rb new file mode 100644 index 000000000000..b3de9d32d877 --- /dev/null +++ b/owl-bot-staging/google-iam-v1beta/snippets/workload_identity_pools/get_workload_identity_pool_provider.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 iam_v1beta_generated_WorkloadIdentityPools_GetWorkloadIdentityPoolProvider_sync] +require "google/iam/v1beta" + +## +# Snippet for the get_workload_identity_pool_provider call in the WorkloadIdentityPools 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::Iam::V1beta::WorkloadIdentityPools::Client#get_workload_identity_pool_provider. +# +def get_workload_identity_pool_provider + # Create a client object. The client can be reused for multiple calls. + client = Google::Iam::V1beta::WorkloadIdentityPools::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::V1beta::GetWorkloadIdentityPoolProviderRequest.new + + # Call the get_workload_identity_pool_provider method. + result = client.get_workload_identity_pool_provider request + + # The returned object is of type Google::Iam::V1beta::WorkloadIdentityPoolProvider. + p result +end +# [END iam_v1beta_generated_WorkloadIdentityPools_GetWorkloadIdentityPoolProvider_sync] diff --git a/owl-bot-staging/google-iam-v1beta/snippets/workload_identity_pools/list_workload_identity_pool_providers.rb b/owl-bot-staging/google-iam-v1beta/snippets/workload_identity_pools/list_workload_identity_pool_providers.rb new file mode 100644 index 000000000000..73859f63733a --- /dev/null +++ b/owl-bot-staging/google-iam-v1beta/snippets/workload_identity_pools/list_workload_identity_pool_providers.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 iam_v1beta_generated_WorkloadIdentityPools_ListWorkloadIdentityPoolProviders_sync] +require "google/iam/v1beta" + +## +# Snippet for the list_workload_identity_pool_providers call in the WorkloadIdentityPools 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::Iam::V1beta::WorkloadIdentityPools::Client#list_workload_identity_pool_providers. +# +def list_workload_identity_pool_providers + # Create a client object. The client can be reused for multiple calls. + client = Google::Iam::V1beta::WorkloadIdentityPools::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::V1beta::ListWorkloadIdentityPoolProvidersRequest.new + + # Call the list_workload_identity_pool_providers method. + result = client.list_workload_identity_pool_providers 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::Iam::V1beta::WorkloadIdentityPoolProvider. + p item + end +end +# [END iam_v1beta_generated_WorkloadIdentityPools_ListWorkloadIdentityPoolProviders_sync] diff --git a/owl-bot-staging/google-iam-v1beta/snippets/workload_identity_pools/list_workload_identity_pools.rb b/owl-bot-staging/google-iam-v1beta/snippets/workload_identity_pools/list_workload_identity_pools.rb new file mode 100644 index 000000000000..f4bfd270a975 --- /dev/null +++ b/owl-bot-staging/google-iam-v1beta/snippets/workload_identity_pools/list_workload_identity_pools.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 iam_v1beta_generated_WorkloadIdentityPools_ListWorkloadIdentityPools_sync] +require "google/iam/v1beta" + +## +# Snippet for the list_workload_identity_pools call in the WorkloadIdentityPools 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::Iam::V1beta::WorkloadIdentityPools::Client#list_workload_identity_pools. +# +def list_workload_identity_pools + # Create a client object. The client can be reused for multiple calls. + client = Google::Iam::V1beta::WorkloadIdentityPools::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::V1beta::ListWorkloadIdentityPoolsRequest.new + + # Call the list_workload_identity_pools method. + result = client.list_workload_identity_pools 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::Iam::V1beta::WorkloadIdentityPool. + p item + end +end +# [END iam_v1beta_generated_WorkloadIdentityPools_ListWorkloadIdentityPools_sync] diff --git a/owl-bot-staging/google-iam-v1beta/snippets/workload_identity_pools/undelete_workload_identity_pool.rb b/owl-bot-staging/google-iam-v1beta/snippets/workload_identity_pools/undelete_workload_identity_pool.rb new file mode 100644 index 000000000000..731613f744e1 --- /dev/null +++ b/owl-bot-staging/google-iam-v1beta/snippets/workload_identity_pools/undelete_workload_identity_pool.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 iam_v1beta_generated_WorkloadIdentityPools_UndeleteWorkloadIdentityPool_sync] +require "google/iam/v1beta" + +## +# Snippet for the undelete_workload_identity_pool call in the WorkloadIdentityPools 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::Iam::V1beta::WorkloadIdentityPools::Client#undelete_workload_identity_pool. +# +def undelete_workload_identity_pool + # Create a client object. The client can be reused for multiple calls. + client = Google::Iam::V1beta::WorkloadIdentityPools::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::V1beta::UndeleteWorkloadIdentityPoolRequest.new + + # Call the undelete_workload_identity_pool method. + result = client.undelete_workload_identity_pool 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 iam_v1beta_generated_WorkloadIdentityPools_UndeleteWorkloadIdentityPool_sync] diff --git a/owl-bot-staging/google-iam-v1beta/snippets/workload_identity_pools/undelete_workload_identity_pool_provider.rb b/owl-bot-staging/google-iam-v1beta/snippets/workload_identity_pools/undelete_workload_identity_pool_provider.rb new file mode 100644 index 000000000000..1c8edd42f39e --- /dev/null +++ b/owl-bot-staging/google-iam-v1beta/snippets/workload_identity_pools/undelete_workload_identity_pool_provider.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 iam_v1beta_generated_WorkloadIdentityPools_UndeleteWorkloadIdentityPoolProvider_sync] +require "google/iam/v1beta" + +## +# Snippet for the undelete_workload_identity_pool_provider call in the WorkloadIdentityPools 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::Iam::V1beta::WorkloadIdentityPools::Client#undelete_workload_identity_pool_provider. +# +def undelete_workload_identity_pool_provider + # Create a client object. The client can be reused for multiple calls. + client = Google::Iam::V1beta::WorkloadIdentityPools::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::V1beta::UndeleteWorkloadIdentityPoolProviderRequest.new + + # Call the undelete_workload_identity_pool_provider method. + result = client.undelete_workload_identity_pool_provider 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 iam_v1beta_generated_WorkloadIdentityPools_UndeleteWorkloadIdentityPoolProvider_sync] diff --git a/owl-bot-staging/google-iam-v1beta/snippets/workload_identity_pools/update_workload_identity_pool.rb b/owl-bot-staging/google-iam-v1beta/snippets/workload_identity_pools/update_workload_identity_pool.rb new file mode 100644 index 000000000000..61a1f1d9c12c --- /dev/null +++ b/owl-bot-staging/google-iam-v1beta/snippets/workload_identity_pools/update_workload_identity_pool.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 iam_v1beta_generated_WorkloadIdentityPools_UpdateWorkloadIdentityPool_sync] +require "google/iam/v1beta" + +## +# Snippet for the update_workload_identity_pool call in the WorkloadIdentityPools 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::Iam::V1beta::WorkloadIdentityPools::Client#update_workload_identity_pool. +# +def update_workload_identity_pool + # Create a client object. The client can be reused for multiple calls. + client = Google::Iam::V1beta::WorkloadIdentityPools::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::V1beta::UpdateWorkloadIdentityPoolRequest.new + + # Call the update_workload_identity_pool method. + result = client.update_workload_identity_pool 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 iam_v1beta_generated_WorkloadIdentityPools_UpdateWorkloadIdentityPool_sync] diff --git a/owl-bot-staging/google-iam-v1beta/snippets/workload_identity_pools/update_workload_identity_pool_provider.rb b/owl-bot-staging/google-iam-v1beta/snippets/workload_identity_pools/update_workload_identity_pool_provider.rb new file mode 100644 index 000000000000..5d53d77ebced --- /dev/null +++ b/owl-bot-staging/google-iam-v1beta/snippets/workload_identity_pools/update_workload_identity_pool_provider.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 iam_v1beta_generated_WorkloadIdentityPools_UpdateWorkloadIdentityPoolProvider_sync] +require "google/iam/v1beta" + +## +# Snippet for the update_workload_identity_pool_provider call in the WorkloadIdentityPools 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::Iam::V1beta::WorkloadIdentityPools::Client#update_workload_identity_pool_provider. +# +def update_workload_identity_pool_provider + # Create a client object. The client can be reused for multiple calls. + client = Google::Iam::V1beta::WorkloadIdentityPools::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::V1beta::UpdateWorkloadIdentityPoolProviderRequest.new + + # Call the update_workload_identity_pool_provider method. + result = client.update_workload_identity_pool_provider 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 iam_v1beta_generated_WorkloadIdentityPools_UpdateWorkloadIdentityPoolProvider_sync] diff --git a/owl-bot-staging/google-iam-v1beta/test/google/iam/v1beta/workload_identity_pools_operations_test.rb b/owl-bot-staging/google-iam-v1beta/test/google/iam/v1beta/workload_identity_pools_operations_test.rb new file mode 100644 index 000000000000..4d405127c64f --- /dev/null +++ b/owl-bot-staging/google-iam-v1beta/test/google/iam/v1beta/workload_identity_pools_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/iam/v1beta/workload_identity_pool_pb" +require "google/iam/v1beta/workload_identity_pool_services_pb" +require "google/iam/v1beta/workload_identity_pools" + +class ::Google::Iam::V1beta::WorkloadIdentityPools::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::Iam::V1beta::WorkloadIdentityPools::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::Iam::V1beta::WorkloadIdentityPools::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::Iam::V1beta::WorkloadIdentityPools::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::Iam::V1beta::WorkloadIdentityPools::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::Iam::V1beta::WorkloadIdentityPools::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::Iam::V1beta::WorkloadIdentityPools::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::Iam::V1beta::WorkloadIdentityPools::Operations::Configuration, config + end +end diff --git a/owl-bot-staging/google-iam-v1beta/test/google/iam/v1beta/workload_identity_pools_paths_test.rb b/owl-bot-staging/google-iam-v1beta/test/google/iam/v1beta/workload_identity_pools_paths_test.rb new file mode 100644 index 000000000000..209fb00b70a7 --- /dev/null +++ b/owl-bot-staging/google-iam-v1beta/test/google/iam/v1beta/workload_identity_pools_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/iam/v1beta/workload_identity_pools" + +class ::Google::Iam::V1beta::WorkloadIdentityPools::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_project_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Iam::V1beta::WorkloadIdentityPools::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.project_path project: "value0" + assert_equal "projects/value0", path + end + end + + def test_workload_identity_pool_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Iam::V1beta::WorkloadIdentityPools::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.workload_identity_pool_path project: "value0", location: "value1", workload_identity_pool: "value2" + assert_equal "projects/value0/locations/value1/workloadIdentityPools/value2", path + end + end + + def test_workload_identity_pool_provider_path + grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure + ::Gapic::ServiceStub.stub :new, DummyStub.new do + client = ::Google::Iam::V1beta::WorkloadIdentityPools::Client.new do |config| + config.credentials = grpc_channel + end + + path = client.workload_identity_pool_provider_path project: "value0", location: "value1", workload_identity_pool: "value2", workload_identity_pool_provider: "value3" + assert_equal "projects/value0/locations/value1/workloadIdentityPools/value2/providers/value3", path + end + end +end diff --git a/owl-bot-staging/google-iam-v1beta/test/google/iam/v1beta/workload_identity_pools_test.rb b/owl-bot-staging/google-iam-v1beta/test/google/iam/v1beta/workload_identity_pools_test.rb new file mode 100644 index 000000000000..2bfd418063ee --- /dev/null +++ b/owl-bot-staging/google-iam-v1beta/test/google/iam/v1beta/workload_identity_pools_test.rb @@ -0,0 +1,888 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/iam/v1beta/workload_identity_pool_pb" +require "google/iam/v1beta/workload_identity_pools" + +class ::Google::Iam::V1beta::WorkloadIdentityPools::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_workload_identity_pools + # Create GRPC objects. + grpc_response = ::Google::Iam::V1beta::ListWorkloadIdentityPoolsResponse.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" + show_deleted = true + + list_workload_identity_pools_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_workload_identity_pools, name + assert_kind_of ::Google::Iam::V1beta::ListWorkloadIdentityPoolsRequest, request + assert_equal "hello world", request["parent"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + assert_equal true, request["show_deleted"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_workload_identity_pools_client_stub do + # Create client + client = ::Google::Iam::V1beta::WorkloadIdentityPools::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_workload_identity_pools({ parent: parent, page_size: page_size, page_token: page_token, 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_workload_identity_pools parent: parent, page_size: page_size, page_token: page_token, 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_workload_identity_pools ::Google::Iam::V1beta::ListWorkloadIdentityPoolsRequest.new(parent: parent, page_size: page_size, page_token: page_token, 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_workload_identity_pools({ parent: parent, page_size: page_size, page_token: page_token, 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_workload_identity_pools(::Google::Iam::V1beta::ListWorkloadIdentityPoolsRequest.new(parent: parent, page_size: page_size, page_token: page_token, 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_workload_identity_pools_client_stub.call_rpc_count + end + end + + def test_get_workload_identity_pool + # Create GRPC objects. + grpc_response = ::Google::Iam::V1beta::WorkloadIdentityPool.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_workload_identity_pool_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_workload_identity_pool, name + assert_kind_of ::Google::Iam::V1beta::GetWorkloadIdentityPoolRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_workload_identity_pool_client_stub do + # Create client + client = ::Google::Iam::V1beta::WorkloadIdentityPools::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_workload_identity_pool({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_workload_identity_pool name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_workload_identity_pool ::Google::Iam::V1beta::GetWorkloadIdentityPoolRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_workload_identity_pool({ 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_workload_identity_pool(::Google::Iam::V1beta::GetWorkloadIdentityPoolRequest.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_workload_identity_pool_client_stub.call_rpc_count + end + end + + def test_create_workload_identity_pool + # 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" + workload_identity_pool = {} + workload_identity_pool_id = "hello world" + + create_workload_identity_pool_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_workload_identity_pool, name + assert_kind_of ::Google::Iam::V1beta::CreateWorkloadIdentityPoolRequest, request + assert_equal "hello world", request["parent"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Iam::V1beta::WorkloadIdentityPool), request["workload_identity_pool"] + assert_equal "hello world", request["workload_identity_pool_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_workload_identity_pool_client_stub do + # Create client + client = ::Google::Iam::V1beta::WorkloadIdentityPools::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_workload_identity_pool({ parent: parent, workload_identity_pool: workload_identity_pool, workload_identity_pool_id: workload_identity_pool_id }) 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_workload_identity_pool parent: parent, workload_identity_pool: workload_identity_pool, workload_identity_pool_id: workload_identity_pool_id 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_workload_identity_pool ::Google::Iam::V1beta::CreateWorkloadIdentityPoolRequest.new(parent: parent, workload_identity_pool: workload_identity_pool, workload_identity_pool_id: workload_identity_pool_id) 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_workload_identity_pool({ parent: parent, workload_identity_pool: workload_identity_pool, workload_identity_pool_id: workload_identity_pool_id }, 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_workload_identity_pool(::Google::Iam::V1beta::CreateWorkloadIdentityPoolRequest.new(parent: parent, workload_identity_pool: workload_identity_pool, workload_identity_pool_id: workload_identity_pool_id), 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_workload_identity_pool_client_stub.call_rpc_count + end + end + + def test_update_workload_identity_pool + # 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. + workload_identity_pool = {} + update_mask = {} + + update_workload_identity_pool_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_workload_identity_pool, name + assert_kind_of ::Google::Iam::V1beta::UpdateWorkloadIdentityPoolRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Iam::V1beta::WorkloadIdentityPool), request["workload_identity_pool"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_workload_identity_pool_client_stub do + # Create client + client = ::Google::Iam::V1beta::WorkloadIdentityPools::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_workload_identity_pool({ workload_identity_pool: workload_identity_pool, update_mask: update_mask }) 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.update_workload_identity_pool workload_identity_pool: workload_identity_pool, update_mask: update_mask 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.update_workload_identity_pool ::Google::Iam::V1beta::UpdateWorkloadIdentityPoolRequest.new(workload_identity_pool: workload_identity_pool, update_mask: update_mask) 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.update_workload_identity_pool({ workload_identity_pool: workload_identity_pool, update_mask: update_mask }, 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.update_workload_identity_pool(::Google::Iam::V1beta::UpdateWorkloadIdentityPoolRequest.new(workload_identity_pool: workload_identity_pool, update_mask: update_mask), 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, update_workload_identity_pool_client_stub.call_rpc_count + end + end + + def test_delete_workload_identity_pool + # 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_workload_identity_pool_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_workload_identity_pool, name + assert_kind_of ::Google::Iam::V1beta::DeleteWorkloadIdentityPoolRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_workload_identity_pool_client_stub do + # Create client + client = ::Google::Iam::V1beta::WorkloadIdentityPools::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_workload_identity_pool({ 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_workload_identity_pool 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_workload_identity_pool ::Google::Iam::V1beta::DeleteWorkloadIdentityPoolRequest.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_workload_identity_pool({ 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_workload_identity_pool(::Google::Iam::V1beta::DeleteWorkloadIdentityPoolRequest.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_workload_identity_pool_client_stub.call_rpc_count + end + end + + def test_undelete_workload_identity_pool + # 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" + + undelete_workload_identity_pool_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :undelete_workload_identity_pool, name + assert_kind_of ::Google::Iam::V1beta::UndeleteWorkloadIdentityPoolRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, undelete_workload_identity_pool_client_stub do + # Create client + client = ::Google::Iam::V1beta::WorkloadIdentityPools::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.undelete_workload_identity_pool({ 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.undelete_workload_identity_pool 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.undelete_workload_identity_pool ::Google::Iam::V1beta::UndeleteWorkloadIdentityPoolRequest.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.undelete_workload_identity_pool({ 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.undelete_workload_identity_pool(::Google::Iam::V1beta::UndeleteWorkloadIdentityPoolRequest.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, undelete_workload_identity_pool_client_stub.call_rpc_count + end + end + + def test_list_workload_identity_pool_providers + # Create GRPC objects. + grpc_response = ::Google::Iam::V1beta::ListWorkloadIdentityPoolProvidersResponse.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" + show_deleted = true + + list_workload_identity_pool_providers_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_workload_identity_pool_providers, name + assert_kind_of ::Google::Iam::V1beta::ListWorkloadIdentityPoolProvidersRequest, request + assert_equal "hello world", request["parent"] + assert_equal 42, request["page_size"] + assert_equal "hello world", request["page_token"] + assert_equal true, request["show_deleted"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, list_workload_identity_pool_providers_client_stub do + # Create client + client = ::Google::Iam::V1beta::WorkloadIdentityPools::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_workload_identity_pool_providers({ parent: parent, page_size: page_size, page_token: page_token, 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_workload_identity_pool_providers parent: parent, page_size: page_size, page_token: page_token, 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_workload_identity_pool_providers ::Google::Iam::V1beta::ListWorkloadIdentityPoolProvidersRequest.new(parent: parent, page_size: page_size, page_token: page_token, 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_workload_identity_pool_providers({ parent: parent, page_size: page_size, page_token: page_token, 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_workload_identity_pool_providers(::Google::Iam::V1beta::ListWorkloadIdentityPoolProvidersRequest.new(parent: parent, page_size: page_size, page_token: page_token, 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_workload_identity_pool_providers_client_stub.call_rpc_count + end + end + + def test_get_workload_identity_pool_provider + # Create GRPC objects. + grpc_response = ::Google::Iam::V1beta::WorkloadIdentityPoolProvider.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_workload_identity_pool_provider_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_workload_identity_pool_provider, name + assert_kind_of ::Google::Iam::V1beta::GetWorkloadIdentityPoolProviderRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_workload_identity_pool_provider_client_stub do + # Create client + client = ::Google::Iam::V1beta::WorkloadIdentityPools::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_workload_identity_pool_provider({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_workload_identity_pool_provider name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_workload_identity_pool_provider ::Google::Iam::V1beta::GetWorkloadIdentityPoolProviderRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_workload_identity_pool_provider({ 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_workload_identity_pool_provider(::Google::Iam::V1beta::GetWorkloadIdentityPoolProviderRequest.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_workload_identity_pool_provider_client_stub.call_rpc_count + end + end + + def test_create_workload_identity_pool_provider + # 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" + workload_identity_pool_provider = {} + workload_identity_pool_provider_id = "hello world" + + create_workload_identity_pool_provider_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_workload_identity_pool_provider, name + assert_kind_of ::Google::Iam::V1beta::CreateWorkloadIdentityPoolProviderRequest, request + assert_equal "hello world", request["parent"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Iam::V1beta::WorkloadIdentityPoolProvider), request["workload_identity_pool_provider"] + assert_equal "hello world", request["workload_identity_pool_provider_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_workload_identity_pool_provider_client_stub do + # Create client + client = ::Google::Iam::V1beta::WorkloadIdentityPools::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_workload_identity_pool_provider({ parent: parent, workload_identity_pool_provider: workload_identity_pool_provider, workload_identity_pool_provider_id: workload_identity_pool_provider_id }) 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_workload_identity_pool_provider parent: parent, workload_identity_pool_provider: workload_identity_pool_provider, workload_identity_pool_provider_id: workload_identity_pool_provider_id 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_workload_identity_pool_provider ::Google::Iam::V1beta::CreateWorkloadIdentityPoolProviderRequest.new(parent: parent, workload_identity_pool_provider: workload_identity_pool_provider, workload_identity_pool_provider_id: workload_identity_pool_provider_id) 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_workload_identity_pool_provider({ parent: parent, workload_identity_pool_provider: workload_identity_pool_provider, workload_identity_pool_provider_id: workload_identity_pool_provider_id }, 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_workload_identity_pool_provider(::Google::Iam::V1beta::CreateWorkloadIdentityPoolProviderRequest.new(parent: parent, workload_identity_pool_provider: workload_identity_pool_provider, workload_identity_pool_provider_id: workload_identity_pool_provider_id), 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_workload_identity_pool_provider_client_stub.call_rpc_count + end + end + + def test_update_workload_identity_pool_provider + # 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. + workload_identity_pool_provider = {} + update_mask = {} + + update_workload_identity_pool_provider_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_workload_identity_pool_provider, name + assert_kind_of ::Google::Iam::V1beta::UpdateWorkloadIdentityPoolProviderRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Iam::V1beta::WorkloadIdentityPoolProvider), request["workload_identity_pool_provider"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_workload_identity_pool_provider_client_stub do + # Create client + client = ::Google::Iam::V1beta::WorkloadIdentityPools::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_workload_identity_pool_provider({ workload_identity_pool_provider: workload_identity_pool_provider, update_mask: update_mask }) 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.update_workload_identity_pool_provider workload_identity_pool_provider: workload_identity_pool_provider, update_mask: update_mask 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.update_workload_identity_pool_provider ::Google::Iam::V1beta::UpdateWorkloadIdentityPoolProviderRequest.new(workload_identity_pool_provider: workload_identity_pool_provider, update_mask: update_mask) 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.update_workload_identity_pool_provider({ workload_identity_pool_provider: workload_identity_pool_provider, update_mask: update_mask }, 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.update_workload_identity_pool_provider(::Google::Iam::V1beta::UpdateWorkloadIdentityPoolProviderRequest.new(workload_identity_pool_provider: workload_identity_pool_provider, update_mask: update_mask), 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, update_workload_identity_pool_provider_client_stub.call_rpc_count + end + end + + def test_delete_workload_identity_pool_provider + # 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_workload_identity_pool_provider_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_workload_identity_pool_provider, name + assert_kind_of ::Google::Iam::V1beta::DeleteWorkloadIdentityPoolProviderRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_workload_identity_pool_provider_client_stub do + # Create client + client = ::Google::Iam::V1beta::WorkloadIdentityPools::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_workload_identity_pool_provider({ 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_workload_identity_pool_provider 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_workload_identity_pool_provider ::Google::Iam::V1beta::DeleteWorkloadIdentityPoolProviderRequest.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_workload_identity_pool_provider({ 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_workload_identity_pool_provider(::Google::Iam::V1beta::DeleteWorkloadIdentityPoolProviderRequest.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_workload_identity_pool_provider_client_stub.call_rpc_count + end + end + + def test_undelete_workload_identity_pool_provider + # 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" + + undelete_workload_identity_pool_provider_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :undelete_workload_identity_pool_provider, name + assert_kind_of ::Google::Iam::V1beta::UndeleteWorkloadIdentityPoolProviderRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, undelete_workload_identity_pool_provider_client_stub do + # Create client + client = ::Google::Iam::V1beta::WorkloadIdentityPools::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.undelete_workload_identity_pool_provider({ 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.undelete_workload_identity_pool_provider 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.undelete_workload_identity_pool_provider ::Google::Iam::V1beta::UndeleteWorkloadIdentityPoolProviderRequest.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.undelete_workload_identity_pool_provider({ 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.undelete_workload_identity_pool_provider(::Google::Iam::V1beta::UndeleteWorkloadIdentityPoolProviderRequest.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, undelete_workload_identity_pool_provider_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::Iam::V1beta::WorkloadIdentityPools::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::Iam::V1beta::WorkloadIdentityPools::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::Iam::V1beta::WorkloadIdentityPools::Client.new do |config| + config.credentials = creds + end + assert_kind_of ::Google::Iam::V1beta::WorkloadIdentityPools::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::Iam::V1beta::WorkloadIdentityPools::Client.new do |config| + config.credentials = grpc_channel + end + end + + assert_kind_of ::Google::Iam::V1beta::WorkloadIdentityPools::Operations, client.operations_client + end +end diff --git a/owl-bot-staging/google-iam-v1beta/test/helper.rb b/owl-bot-staging/google-iam-v1beta/test/helper.rb new file mode 100644 index 000000000000..672b337030e7 --- /dev/null +++ b/owl-bot-staging/google-iam-v1beta/test/helper.rb @@ -0,0 +1,26 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/mock" +require "minitest/rg" + +require "grpc" + +require "ostruct" diff --git a/owl-bot-staging/google-iam-v2/.gitignore b/owl-bot-staging/google-iam-v2/.gitignore new file mode 100644 index 000000000000..0135b6bc6cfc --- /dev/null +++ b/owl-bot-staging/google-iam-v2/.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-iam-v2/.repo-metadata.json b/owl-bot-staging/google-iam-v2/.repo-metadata.json new file mode 100644 index 000000000000..f361454bbf48 --- /dev/null +++ b/owl-bot-staging/google-iam-v2/.repo-metadata.json @@ -0,0 +1,17 @@ +{ + "api_id": "iam.googleapis.com", + "api_shortname": "iam", + "client_documentation": "https://rubydoc.info/gems/google-iam-v2", + "distribution_name": "google-iam-v2", + "is_cloud": false, + "language": "ruby", + "name": "iam", + "name_pretty": "IAM V2 API", + "product_documentation": "https://cloud.google.com/iam", + "release_level": "unreleased", + "repo": "googleapis/google-cloud-ruby", + "requires_billing": true, + "ruby-cloud-description": "Manages identity and access control policies for Google Cloud Platform resources. Note that google-iam-v2 is a version-specific client library. For most uses, we recommend installing the main client library google-iam-client instead. See the readme for more details.", + "ruby-cloud-product-url": "https://cloud.google.com/iam", + "library_type": "GAPIC_AUTO" +} diff --git a/owl-bot-staging/google-iam-v2/.rubocop.yml b/owl-bot-staging/google-iam-v2/.rubocop.yml new file mode 100644 index 000000000000..34e52b136070 --- /dev/null +++ b/owl-bot-staging/google-iam-v2/.rubocop.yml @@ -0,0 +1,33 @@ +inherit_gem: + google-style: google-style.yml + +AllCops: + Exclude: + - "google-iam-v2.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-iam-v2.rb" diff --git a/owl-bot-staging/google-iam-v2/.toys.rb b/owl-bot-staging/google-iam-v2/.toys.rb new file mode 100644 index 000000000000..177e22456e8a --- /dev/null +++ b/owl-bot-staging/google-iam-v2/.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-iam-v2/.yardopts b/owl-bot-staging/google-iam-v2/.yardopts new file mode 100644 index 000000000000..74817379a031 --- /dev/null +++ b/owl-bot-staging/google-iam-v2/.yardopts @@ -0,0 +1,12 @@ +--no-private +--title="IAM V2 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-iam-v2/AUTHENTICATION.md b/owl-bot-staging/google-iam-v2/AUTHENTICATION.md new file mode 100644 index 000000000000..6a0825ac614f --- /dev/null +++ b/owl-bot-staging/google-iam-v2/AUTHENTICATION.md @@ -0,0 +1,122 @@ +# Authentication + +The recommended way to authenticate to the google-iam-v2 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-iam-v2 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/iam/v2" + +client = ::Google::Iam::V2::Policies::Client.new do |config| + config.credentials = "path/to/credentialfile.json" +end +``` + +To configure a credentials file globally for all clients: + +```ruby +require "google/iam/v2" + +::Google::Iam::V2::Policies::Client.configure do |config| + config.credentials = "path/to/credentialfile.json" +end + +client = ::Google::Iam::V2::Policies::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-iam-v2 +checks for credentials are: + +* `GOOGLE_CLOUD_CREDENTIALS` - Path to JSON file, or JSON contents +* `GOOGLE_APPLICATION_CREDENTIALS` - Path to JSON file + +```ruby +require "google/iam/v2" + +ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" + +client = ::Google::Iam::V2::Policies::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-iam-v2/CHANGELOG.md b/owl-bot-staging/google-iam-v2/CHANGELOG.md new file mode 100644 index 000000000000..f88957a62ba2 --- /dev/null +++ b/owl-bot-staging/google-iam-v2/CHANGELOG.md @@ -0,0 +1,2 @@ +# Release History + diff --git a/owl-bot-staging/google-iam-v2/Gemfile b/owl-bot-staging/google-iam-v2/Gemfile new file mode 100644 index 000000000000..1d08558908d8 --- /dev/null +++ b/owl-bot-staging/google-iam-v2/Gemfile @@ -0,0 +1,14 @@ +source "https://rubygems.org" + +gemspec + +gem "google-style", "~> 1.32.0" +gem "irb", "~> 1.17" +gem "minitest", "~> 6.0.2" +gem "minitest-focus", "~> 1.4" +gem "minitest-mock", "~> 5.27" +gem "minitest-rg", "~> 5.3" +gem "ostruct", "~> 0.5.5" +gem "rake", ">= 13.0" +gem "redcarpet", "~> 3.6" +gem "yard", "~> 0.9" diff --git a/owl-bot-staging/google-iam-v2/LICENSE.md b/owl-bot-staging/google-iam-v2/LICENSE.md new file mode 100644 index 000000000000..c261857ba6ad --- /dev/null +++ b/owl-bot-staging/google-iam-v2/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-iam-v2/README.md b/owl-bot-staging/google-iam-v2/README.md new file mode 100644 index 000000000000..743fbe826f82 --- /dev/null +++ b/owl-bot-staging/google-iam-v2/README.md @@ -0,0 +1,154 @@ +# Ruby Client for the IAM V2 API + +Manages identity and access control for Google Cloud Platform resources, including the creation of service accounts, which you can use to authenticate to Google and make API calls. + +Manages identity and access control policies for Google Cloud Platform resources. + +https://github.com/googleapis/google-cloud-ruby + +This gem is a _versioned_ client. It provides basic client classes for a +specific version of the IAM V2 API. Most users should consider using +the main client gem, +[google-iam-client](https://rubygems.org/gems/google-iam-client). +See the section below titled *Which client should I use?* for more information. + +## Installation + +``` +$ gem install google-iam-v2 +``` + +## 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/iam.googleapis.com) +1. [Set up authentication.](AUTHENTICATION.md) + +## Quick Start + +```ruby +require "google/iam/v2" + +client = ::Google::Iam::V2::Policies::Client.new +request = ::Google::Iam::V2::ListPoliciesRequest.new # (request fields as keyword arguments...) +response = client.list_policies request +``` + +View the [Client Library Documentation](https://rubydoc.info/gems/google-iam-v2) +for class and method documentation. + +See also the [Product Documentation](https://cloud.google.com/iam) +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/iam/v2" +require "logger" + +client = ::Google::Iam::V2::Policies::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-iam-client`, +and lower-level _versioned_ client libraries with names such as +`google-iam-v2`. +_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-iam-client`. +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-iam-v2`. + +### 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-iam-v2/Rakefile b/owl-bot-staging/google-iam-v2/Rakefile new file mode 100644 index 000000000000..17091d3aff5d --- /dev/null +++ b/owl-bot-staging/google-iam-v2/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-iam-v2 acceptance tests." +task :acceptance, :project, :keyfile do |t, args| + project = args[:project] + project ||= + ENV["GOOGLE_CLOUD_TEST_PROJECT"] || + ENV["GCLOUD_TEST_PROJECT"] + keyfile = args[:keyfile] + keyfile ||= + ENV["GOOGLE_CLOUD_TEST_KEYFILE"] || + ENV["GCLOUD_TEST_KEYFILE"] + if keyfile + keyfile = File.read keyfile + else + keyfile ||= + ENV["GOOGLE_CLOUD_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 GOOGLE_CLOUD_TEST_PROJECT=test123 GOOGLE_CLOUD_TEST_KEYFILE=/path/to/keyfile.json rake acceptance" + end + require "google/iam/v2/policies/credentials" + ::Google::Iam::V2::Policies::Credentials.env_vars.each do |path| + ENV[path] = nil + end + ENV["GOOGLE_CLOUD_PROJECT"] = project + ENV["GOOGLE_CLOUD_TEST_PROJECT"] = project + ENV["GOOGLE_CLOUD_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-iam-v2 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-iam-v2 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-iam-v2 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-iam-v2 gem does not have doctest tests." +end + +desc "Run the CI build" +task :ci do + header "BUILDING google-iam-v2" + header "google-iam-v2 rubocop", "*" + Rake::Task[:rubocop].invoke + header "google-iam-v2 yard", "*" + Rake::Task[:yard].invoke + header "google-iam-v2 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-iam-v2 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-iam-v2 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-iam-v2/gapic_metadata.json b/owl-bot-staging/google-iam-v2/gapic_metadata.json new file mode 100644 index 000000000000..f9325ed5c881 --- /dev/null +++ b/owl-bot-staging/google-iam-v2/gapic_metadata.json @@ -0,0 +1,43 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "ruby", + "protoPackage": "google.iam.v2", + "libraryPackage": "::Google::Iam::V2", + "services": { + "Policies": { + "clients": { + "grpc": { + "libraryClient": "::Google::Iam::V2::Policies::Client", + "rpcs": { + "ListPolicies": { + "methods": [ + "list_policies" + ] + }, + "GetPolicy": { + "methods": [ + "get_policy" + ] + }, + "CreatePolicy": { + "methods": [ + "create_policy" + ] + }, + "UpdatePolicy": { + "methods": [ + "update_policy" + ] + }, + "DeletePolicy": { + "methods": [ + "delete_policy" + ] + } + } + } + } + } + } +} diff --git a/owl-bot-staging/google-iam-v2/google-iam-v2.gemspec b/owl-bot-staging/google-iam-v2/google-iam-v2.gemspec new file mode 100644 index 000000000000..5624956ca734 --- /dev/null +++ b/owl-bot-staging/google-iam-v2/google-iam-v2.gemspec @@ -0,0 +1,28 @@ +# -*- ruby -*- +# encoding: utf-8 + +require File.expand_path("lib/google/iam/v2/version", __dir__) + +Gem::Specification.new do |gem| + gem.name = "google-iam-v2" + gem.version = Google::Iam::V2::VERSION + + gem.authors = ["Google LLC"] + gem.email = "googleapis-packages@google.com" + gem.description = "Manages identity and access control policies for Google Cloud Platform resources. Note that google-iam-v2 is a version-specific client library. For most uses, we recommend installing the main client library google-iam-client instead. See the readme for more details." + gem.summary = "Manages identity and access control for Google Cloud Platform resources, including the creation of service accounts, which you can use to authenticate to Google and make API calls." + 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.2" + + gem.add_dependency "gapic-common", "~> 1.2" + gem.add_dependency "google-cloud-errors", "~> 1.0" +end diff --git a/owl-bot-staging/google-iam-v2/lib/google-iam-v2.rb b/owl-bot-staging/google-iam-v2/lib/google-iam-v2.rb new file mode 100644 index 000000000000..976c5cee3515 --- /dev/null +++ b/owl-bot-staging/google-iam-v2/lib/google-iam-v2.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/iam/v2" diff --git a/owl-bot-staging/google-iam-v2/lib/google/iam/v2.rb b/owl-bot-staging/google-iam-v2/lib/google/iam/v2.rb new file mode 100644 index 000000000000..fc5ba38b2a63 --- /dev/null +++ b/owl-bot-staging/google-iam-v2/lib/google/iam/v2.rb @@ -0,0 +1,43 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/iam/v2/policies" +require "google/iam/v2/version" + +module Google + module Iam + ## + # API client module. + # + # @example Load this package, including all its services, and instantiate a gRPC client + # + # require "google/iam/v2" + # client = ::Google::Iam::V2::Policies::Client.new + # + # @example Load this package, including all its services, and instantiate a REST client + # + # require "google/iam/v2" + # client = ::Google::Iam::V2::Policies::Rest::Client.new + # + module V2 + end + end +end + +helper_path = ::File.join __dir__, "v2", "_helpers.rb" +require "google/iam/v2/_helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-iam-v2/lib/google/iam/v2/deny_pb.rb b/owl-bot-staging/google-iam-v2/lib/google/iam/v2/deny_pb.rb new file mode 100644 index 000000000000..13a714e88610 --- /dev/null +++ b/owl-bot-staging/google-iam-v2/lib/google/iam/v2/deny_pb.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/iam/v2/deny.proto + +require 'google/protobuf' + +require 'google/type/expr_pb' + + +descriptor_data = "\n\x18google/iam/v2/deny.proto\x12\rgoogle.iam.v2\x1a\x16google/type/expr.proto\"\xab\x01\n\x08\x44\x65nyRule\x12\x19\n\x11\x64\x65nied_principals\x18\x01 \x03(\t\x12\x1c\n\x14\x65xception_principals\x18\x02 \x03(\t\x12\x1a\n\x12\x64\x65nied_permissions\x18\x03 \x03(\t\x12\x1d\n\x15\x65xception_permissions\x18\x04 \x03(\t\x12+\n\x10\x64\x65nial_condition\x18\x05 \x01(\x0b\x32\x11.google.type.ExprB{\n\x11\x63om.google.iam.v2B\rDenyRuleProtoP\x01Z)cloud.google.com/go/iam/apiv2/iampb;iampb\xaa\x02\x13Google.Cloud.Iam.V2\xca\x02\x13Google\\Cloud\\Iam\\V2b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Iam + module V2 + DenyRule = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.iam.v2.DenyRule").msgclass + end + end +end diff --git a/owl-bot-staging/google-iam-v2/lib/google/iam/v2/policies.rb b/owl-bot-staging/google-iam-v2/lib/google/iam/v2/policies.rb new file mode 100644 index 000000000000..7c30e2a1e284 --- /dev/null +++ b/owl-bot-staging/google-iam-v2/lib/google/iam/v2/policies.rb @@ -0,0 +1,53 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/iam/v2/version" + +require "google/iam/v2/policies/credentials" +require "google/iam/v2/policies/operations" +require "google/iam/v2/policies/client" +require "google/iam/v2/policies/rest" + +module Google + module Iam + module V2 + ## + # An interface for managing Identity and Access Management (IAM) policies. + # + # @example Load this service and instantiate a gRPC client + # + # require "google/iam/v2/policies" + # client = ::Google::Iam::V2::Policies::Client.new + # + # @example Load this service and instantiate a REST client + # + # require "google/iam/v2/policies/rest" + # client = ::Google::Iam::V2::Policies::Rest::Client.new + # + module Policies + end + end + end +end + +helper_path = ::File.join __dir__, "policies", "helpers.rb" +require "google/iam/v2/policies/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-iam-v2/lib/google/iam/v2/policies/client.rb b/owl-bot-staging/google-iam-v2/lib/google/iam/v2/policies/client.rb new file mode 100644 index 000000000000..4affa68fa123 --- /dev/null +++ b/owl-bot-staging/google-iam-v2/lib/google/iam/v2/policies/client.rb @@ -0,0 +1,987 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/iam/v2/policy_pb" + +module Google + module Iam + module V2 + module Policies + ## + # Client for the Policies service. + # + # An interface for managing Identity and Access Management (IAM) policies. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "iam.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :policies_stub + + ## + # Configure the Policies Client class. + # + # See {::Google::Iam::V2::Policies::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all Policies clients + # ::Google::Iam::V2::Policies::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", "Iam", "V2"] + 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_policies.timeout = 60.0 + default_config.rpcs.list_policies.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.get_policy.timeout = 60.0 + default_config.rpcs.get_policy.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.create_policy.timeout = 60.0 + default_config.rpcs.create_policy.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.update_policy.timeout = 60.0 + default_config.rpcs.update_policy.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.delete_policy.timeout = 60.0 + default_config.rpcs.delete_policy.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the Policies 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::Iam::V2::Policies::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 + @policies_stub.universe_domain + end + + ## + # Create a new Policies client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Iam::V2::Policies::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Iam::V2::Policies::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Policies 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/iam/v2/policy_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 + + @policies_stub = ::Gapic::ServiceStub.new( + ::Google::Iam::V2::Policies::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 + ) + + @policies_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 + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Iam::V2::Policies::Operations] + # + attr_reader :operations_client + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @policies_stub.logger + end + + # Service calls + + ## + # Retrieves the policies of the specified kind that are attached to a + # resource. + # + # The response lists only policy metadata. In particular, policy rules are + # omitted. + # + # @overload list_policies(request, options = nil) + # Pass arguments to `list_policies` via a request object, either of type + # {::Google::Iam::V2::ListPoliciesRequest} or an equivalent Hash. + # + # @param request [::Google::Iam::V2::ListPoliciesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_policies(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_policies` via keyword arguments. Note that at + # least one keyword argument is 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 that the policy is attached to, along with the kind of policy + # to list. Format: + # `policies/{attachment_point}/denypolicies` + # + # + # The attachment point is identified by its URL-encoded full resource name, + # which means that the forward-slash character, `/`, must be written as + # `%2F`. For example, + # `policies/cloudresourcemanager.googleapis.com%2Fprojects%2Fmy-project/denypolicies`. + # + # For organizations and folders, use the numeric ID in the full resource + # name. For projects, you can use the alphanumeric or the numeric ID. + # @param page_size [::Integer] + # The maximum number of policies to return. IAM ignores this value and uses + # the value 1000. + # @param page_token [::String] + # A page token received in a {::Google::Iam::V2::ListPoliciesResponse ListPoliciesResponse}. Provide this token to + # retrieve the next page. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Gapic::PagedEnumerable<::Google::Iam::V2::Policy>] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Gapic::PagedEnumerable<::Google::Iam::V2::Policy>] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/iam/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Iam::V2::Policies::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Iam::V2::ListPoliciesRequest.new + # + # # Call the list_policies method. + # result = client.list_policies 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::Iam::V2::Policy. + # p item + # end + # + def list_policies request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V2::ListPoliciesRequest + + # Converts hash 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_policies.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::Iam::V2::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_policies.timeout, + metadata: metadata, + retry_policy: @config.rpcs.list_policies.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @policies_stub.call_rpc :list_policies, request, options: options do |response, operation| + response = ::Gapic::PagedEnumerable.new @policies_stub, :list_policies, 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 + + ## + # Gets a policy. + # + # @overload get_policy(request, options = nil) + # Pass arguments to `get_policy` via a request object, either of type + # {::Google::Iam::V2::GetPolicyRequest} or an equivalent Hash. + # + # @param request [::Google::Iam::V2::GetPolicyRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_policy(name: nil) + # Pass arguments to `get_policy` via keyword arguments. Note that at + # least one keyword argument is 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 policy to retrieve. Format: + # `policies/{attachment_point}/denypolicies/{policy_id}` + # + # + # Use the URL-encoded full resource name, which means that the forward-slash + # character, `/`, must be written as `%2F`. For example, + # `policies/cloudresourcemanager.googleapis.com%2Fprojects%2Fmy-project/denypolicies/my-policy`. + # + # For organizations and folders, use the numeric ID in the full resource + # name. For projects, you can use the alphanumeric or the numeric ID. + # + # @yield [response, operation] Access the result along with the RPC operation + # @yieldparam response [::Google::Iam::V2::Policy] + # @yieldparam operation [::GRPC::ActiveCall::Operation] + # + # @return [::Google::Iam::V2::Policy] + # + # @raise [::Google::Cloud::Error] if the RPC is aborted. + # + # @example Basic example + # require "google/iam/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Iam::V2::Policies::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Iam::V2::GetPolicyRequest.new + # + # # Call the get_policy method. + # result = client.get_policy request + # + # # The returned object is of type Google::Iam::V2::Policy. + # p result + # + def get_policy request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V2::GetPolicyRequest + + # Converts hash 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_policy.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::Iam::V2::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_policy.timeout, + metadata: metadata, + retry_policy: @config.rpcs.get_policy.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @policies_stub.call_rpc :get_policy, 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 policy. + # + # @overload create_policy(request, options = nil) + # Pass arguments to `create_policy` via a request object, either of type + # {::Google::Iam::V2::CreatePolicyRequest} or an equivalent Hash. + # + # @param request [::Google::Iam::V2::CreatePolicyRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_policy(parent: nil, policy: nil, policy_id: nil) + # Pass arguments to `create_policy` via keyword arguments. Note that at + # least one keyword argument is 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 that the policy is attached to, along with the kind of policy + # to create. Format: `policies/{attachment_point}/denypolicies` + # + # + # The attachment point is identified by its URL-encoded full resource name, + # which means that the forward-slash character, `/`, must be written as + # `%2F`. For example, + # `policies/cloudresourcemanager.googleapis.com%2Fprojects%2Fmy-project/denypolicies`. + # + # For organizations and folders, use the numeric ID in the full resource + # name. For projects, you can use the alphanumeric or the numeric ID. + # @param policy [::Google::Iam::V2::Policy, ::Hash] + # Required. The policy to create. + # @param policy_id [::String] + # The ID to use for this policy, which will become the final component of + # the policy's resource name. The ID must contain 3 to 63 characters. It can + # contain lowercase letters and numbers, as well as dashes (`-`) and periods + # (`.`). The first character must be a lowercase letter. + # + # @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/iam/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Iam::V2::Policies::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Iam::V2::CreatePolicyRequest.new + # + # # Call the create_policy method. + # result = client.create_policy 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_policy request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V2::CreatePolicyRequest + + # Converts hash 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_policy.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::Iam::V2::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_policy.timeout, + metadata: metadata, + retry_policy: @config.rpcs.create_policy.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @policies_stub.call_rpc :create_policy, 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 + + ## + # Updates the specified policy. + # + # You can update only the rules and the display name for the policy. + # + # To update a policy, you should use a read-modify-write loop: + # + # 1. Use {::Google::Iam::V2::Policies::Client#get_policy GetPolicy} to read the current version of the policy. + # 2. Modify the policy as needed. + # 3. Use `UpdatePolicy` to write the updated policy. + # + # This pattern helps prevent conflicts between concurrent updates. + # + # @overload update_policy(request, options = nil) + # Pass arguments to `update_policy` via a request object, either of type + # {::Google::Iam::V2::UpdatePolicyRequest} or an equivalent Hash. + # + # @param request [::Google::Iam::V2::UpdatePolicyRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_policy(policy: nil) + # Pass arguments to `update_policy` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param policy [::Google::Iam::V2::Policy, ::Hash] + # Required. The policy to update. + # + # To prevent conflicting updates, the `etag` value must match the value that + # is stored in IAM. If the `etag` values do not match, the request fails with + # a `409` error code and `ABORTED` status. + # + # @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/iam/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Iam::V2::Policies::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Iam::V2::UpdatePolicyRequest.new + # + # # Call the update_policy method. + # result = client.update_policy 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 update_policy request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V2::UpdatePolicyRequest + + # Converts hash 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_policy.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::Iam::V2::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.policy&.name + header_params["policy.name"] = request.policy.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_policy.timeout, + metadata: metadata, + retry_policy: @config.rpcs.update_policy.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @policies_stub.call_rpc :update_policy, 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 policy. This action is permanent. + # + # @overload delete_policy(request, options = nil) + # Pass arguments to `delete_policy` via a request object, either of type + # {::Google::Iam::V2::DeletePolicyRequest} or an equivalent Hash. + # + # @param request [::Google::Iam::V2::DeletePolicyRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_policy(name: nil, etag: nil) + # Pass arguments to `delete_policy` via keyword arguments. Note that at + # least one keyword argument is 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 policy to delete. Format: + # `policies/{attachment_point}/denypolicies/{policy_id}` + # + # + # Use the URL-encoded full resource name, which means that the forward-slash + # character, `/`, must be written as `%2F`. For example, + # `policies/cloudresourcemanager.googleapis.com%2Fprojects%2Fmy-project/denypolicies/my-policy`. + # + # For organizations and folders, use the numeric ID in the full resource + # name. For projects, you can use the alphanumeric or the numeric ID. + # @param etag [::String] + # Optional. The expected `etag` of the policy to delete. If the value does not match + # the value that is stored in IAM, the request fails with a `409` error code + # and `ABORTED` status. + # + # If you omit this field, the policy is deleted regardless of its current + # `etag`. + # + # @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/iam/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Iam::V2::Policies::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Iam::V2::DeletePolicyRequest.new + # + # # Call the delete_policy method. + # result = client.delete_policy 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_policy request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V2::DeletePolicyRequest + + # Converts hash 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_policy.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::Iam::V2::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_policy.timeout, + metadata: metadata, + retry_policy: @config.rpcs.delete_policy.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @policies_stub.call_rpc :delete_policy, 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 Policies API. + # + # This class represents the configuration for Policies, + # 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::Iam::V2::Policies::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_policies to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Iam::V2::Policies::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_policies.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Iam::V2::Policies::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_policies.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::Iam::V2::Policies::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 = "iam.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 Policies 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_policies` + # @return [::Gapic::Config::Method] + # + attr_reader :list_policies + ## + # RPC-specific configuration for `get_policy` + # @return [::Gapic::Config::Method] + # + attr_reader :get_policy + ## + # RPC-specific configuration for `create_policy` + # @return [::Gapic::Config::Method] + # + attr_reader :create_policy + ## + # RPC-specific configuration for `update_policy` + # @return [::Gapic::Config::Method] + # + attr_reader :update_policy + ## + # RPC-specific configuration for `delete_policy` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_policy + + # @private + def initialize parent_rpcs = nil + list_policies_config = parent_rpcs.list_policies if parent_rpcs.respond_to? :list_policies + @list_policies = ::Gapic::Config::Method.new list_policies_config + get_policy_config = parent_rpcs.get_policy if parent_rpcs.respond_to? :get_policy + @get_policy = ::Gapic::Config::Method.new get_policy_config + create_policy_config = parent_rpcs.create_policy if parent_rpcs.respond_to? :create_policy + @create_policy = ::Gapic::Config::Method.new create_policy_config + update_policy_config = parent_rpcs.update_policy if parent_rpcs.respond_to? :update_policy + @update_policy = ::Gapic::Config::Method.new update_policy_config + delete_policy_config = parent_rpcs.delete_policy if parent_rpcs.respond_to? :delete_policy + @delete_policy = ::Gapic::Config::Method.new delete_policy_config + + yield self if block_given? + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-iam-v2/lib/google/iam/v2/policies/credentials.rb b/owl-bot-staging/google-iam-v2/lib/google/iam/v2/policies/credentials.rb new file mode 100644 index 000000000000..99a803e1b8c6 --- /dev/null +++ b/owl-bot-staging/google-iam-v2/lib/google/iam/v2/policies/credentials.rb @@ -0,0 +1,45 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Iam + module V2 + module Policies + # Credentials for the Policies API. + class Credentials < ::Google::Auth::Credentials + self.scope = [ + "https://www.googleapis.com/auth/cloud-platform" + ] + self.env_vars = [ + "GOOGLE_CLOUD_CREDENTIALS", + "GOOGLE_CLOUD_KEYFILE", + "GCLOUD_KEYFILE", + "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 diff --git a/owl-bot-staging/google-iam-v2/lib/google/iam/v2/policies/operations.rb b/owl-bot-staging/google-iam-v2/lib/google/iam/v2/policies/operations.rb new file mode 100644 index 000000000000..2f2e84c1ee11 --- /dev/null +++ b/owl-bot-staging/google-iam-v2/lib/google/iam/v2/policies/operations.rb @@ -0,0 +1,839 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Iam + module V2 + module Policies + # Service that implements Longrunning Operations API. + class Operations + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "iam.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :operations_stub + + ## + # Configuration for the Policies 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 Policies 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::Iam::V2::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::Iam::V2::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::Iam::V2::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::Iam::V2::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::Iam::V2::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 = "iam.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 diff --git a/owl-bot-staging/google-iam-v2/lib/google/iam/v2/policies/rest.rb b/owl-bot-staging/google-iam-v2/lib/google/iam/v2/policies/rest.rb new file mode 100644 index 000000000000..c1f6d1def0ec --- /dev/null +++ b/owl-bot-staging/google-iam-v2/lib/google/iam/v2/policies/rest.rb @@ -0,0 +1,50 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/iam/v2/version" + +require "google/iam/v2/policies/credentials" +require "google/iam/v2/policies/rest/operations" +require "google/iam/v2/policies/rest/client" + +module Google + module Iam + module V2 + ## + # An interface for managing Identity and Access Management (IAM) policies. + # + # To load this service and instantiate a REST client: + # + # require "google/iam/v2/policies/rest" + # client = ::Google::Iam::V2::Policies::Rest::Client.new + # + module Policies + # Client for the REST transport + module Rest + end + end + end + end +end + +helper_path = ::File.join __dir__, "rest", "helpers.rb" +require "google/iam/v2/policies/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-iam-v2/lib/google/iam/v2/policies/rest/client.rb b/owl-bot-staging/google-iam-v2/lib/google/iam/v2/policies/rest/client.rb new file mode 100644 index 000000000000..fd046205b243 --- /dev/null +++ b/owl-bot-staging/google-iam-v2/lib/google/iam/v2/policies/rest/client.rb @@ -0,0 +1,909 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/iam/v2/policy_pb" +require "google/iam/v2/policies/rest/service_stub" + +module Google + module Iam + module V2 + module Policies + module Rest + ## + # REST client for the Policies service. + # + # An interface for managing Identity and Access Management (IAM) policies. + # + class Client + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "iam.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :policies_stub + + ## + # Configure the Policies Client class. + # + # See {::Google::Iam::V2::Policies::Rest::Client::Configuration} + # for a description of the configuration fields. + # + # @example + # + # # Modify the configuration for all Policies clients + # ::Google::Iam::V2::Policies::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", "Iam", "V2"] + 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_policies.timeout = 60.0 + default_config.rpcs.list_policies.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.get_policy.timeout = 60.0 + default_config.rpcs.get_policy.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.create_policy.timeout = 60.0 + default_config.rpcs.create_policy.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.update_policy.timeout = 60.0 + default_config.rpcs.update_policy.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config.rpcs.delete_policy.timeout = 60.0 + default_config.rpcs.delete_policy.retry_policy = { + initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] + } + + default_config + end + yield @configure if block_given? + @configure + end + + ## + # Configure the Policies 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::Iam::V2::Policies::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 + @policies_stub.universe_domain + end + + ## + # Create a new Policies REST client object. + # + # @example + # + # # Create a client using the default configuration + # client = ::Google::Iam::V2::Policies::Rest::Client.new + # + # # Create a client using a custom configuration + # client = ::Google::Iam::V2::Policies::Rest::Client.new do |config| + # config.timeout = 10.0 + # end + # + # @yield [config] Configure the Policies 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::Iam::V2::Policies::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 + + @policies_stub = ::Google::Iam::V2::Policies::Rest::ServiceStub.new( + endpoint: @config.endpoint, + endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, + universe_domain: @config.universe_domain, + credentials: credentials, + logger: @config.logger + ) + + @policies_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 + end + + ## + # Get the associated client for long-running operations. + # + # @return [::Google::Iam::V2::Policies::Rest::Operations] + # + attr_reader :operations_client + + ## + # The logger used for request/response debug logging. + # + # @return [Logger] + # + def logger + @policies_stub.logger + end + + # Service calls + + ## + # Retrieves the policies of the specified kind that are attached to a + # resource. + # + # The response lists only policy metadata. In particular, policy rules are + # omitted. + # + # @overload list_policies(request, options = nil) + # Pass arguments to `list_policies` via a request object, either of type + # {::Google::Iam::V2::ListPoliciesRequest} or an equivalent Hash. + # + # @param request [::Google::Iam::V2::ListPoliciesRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_policies(parent: nil, page_size: nil, page_token: nil) + # Pass arguments to `list_policies` via keyword arguments. Note that at + # least one keyword argument is 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 that the policy is attached to, along with the kind of policy + # to list. Format: + # `policies/{attachment_point}/denypolicies` + # + # + # The attachment point is identified by its URL-encoded full resource name, + # which means that the forward-slash character, `/`, must be written as + # `%2F`. For example, + # `policies/cloudresourcemanager.googleapis.com%2Fprojects%2Fmy-project/denypolicies`. + # + # For organizations and folders, use the numeric ID in the full resource + # name. For projects, you can use the alphanumeric or the numeric ID. + # @param page_size [::Integer] + # The maximum number of policies to return. IAM ignores this value and uses + # the value 1000. + # @param page_token [::String] + # A page token received in a {::Google::Iam::V2::ListPoliciesResponse ListPoliciesResponse}. Provide this token to + # retrieve the next page. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Iam::V2::Policy>] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Gapic::Rest::PagedEnumerable<::Google::Iam::V2::Policy>] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/iam/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Iam::V2::Policies::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Iam::V2::ListPoliciesRequest.new + # + # # Call the list_policies method. + # result = client.list_policies 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::Iam::V2::Policy. + # p item + # end + # + def list_policies request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V2::ListPoliciesRequest + + # Converts hash 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_policies.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::Iam::V2::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_policies.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.list_policies.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @policies_stub.list_policies request, options do |result, operation| + result = ::Gapic::Rest::PagedEnumerable.new @policies_stub, :list_policies, "policies", 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 a policy. + # + # @overload get_policy(request, options = nil) + # Pass arguments to `get_policy` via a request object, either of type + # {::Google::Iam::V2::GetPolicyRequest} or an equivalent Hash. + # + # @param request [::Google::Iam::V2::GetPolicyRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_policy(name: nil) + # Pass arguments to `get_policy` via keyword arguments. Note that at + # least one keyword argument is 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 policy to retrieve. Format: + # `policies/{attachment_point}/denypolicies/{policy_id}` + # + # + # Use the URL-encoded full resource name, which means that the forward-slash + # character, `/`, must be written as `%2F`. For example, + # `policies/cloudresourcemanager.googleapis.com%2Fprojects%2Fmy-project/denypolicies/my-policy`. + # + # For organizations and folders, use the numeric ID in the full resource + # name. For projects, you can use the alphanumeric or the numeric ID. + # @yield [result, operation] Access the result along with the TransportOperation object + # @yieldparam result [::Google::Iam::V2::Policy] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Iam::V2::Policy] + # + # @raise [::Google::Cloud::Error] if the REST call is aborted. + # + # @example Basic example + # require "google/iam/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Iam::V2::Policies::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Iam::V2::GetPolicyRequest.new + # + # # Call the get_policy method. + # result = client.get_policy request + # + # # The returned object is of type Google::Iam::V2::Policy. + # p result + # + def get_policy request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V2::GetPolicyRequest + + # Converts hash 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_policy.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::Iam::V2::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_policy.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.get_policy.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @policies_stub.get_policy 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 policy. + # + # @overload create_policy(request, options = nil) + # Pass arguments to `create_policy` via a request object, either of type + # {::Google::Iam::V2::CreatePolicyRequest} or an equivalent Hash. + # + # @param request [::Google::Iam::V2::CreatePolicyRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_policy(parent: nil, policy: nil, policy_id: nil) + # Pass arguments to `create_policy` via keyword arguments. Note that at + # least one keyword argument is 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 that the policy is attached to, along with the kind of policy + # to create. Format: `policies/{attachment_point}/denypolicies` + # + # + # The attachment point is identified by its URL-encoded full resource name, + # which means that the forward-slash character, `/`, must be written as + # `%2F`. For example, + # `policies/cloudresourcemanager.googleapis.com%2Fprojects%2Fmy-project/denypolicies`. + # + # For organizations and folders, use the numeric ID in the full resource + # name. For projects, you can use the alphanumeric or the numeric ID. + # @param policy [::Google::Iam::V2::Policy, ::Hash] + # Required. The policy to create. + # @param policy_id [::String] + # The ID to use for this policy, which will become the final component of + # the policy's resource name. The ID must contain 3 to 63 characters. It can + # contain lowercase letters and numbers, as well as dashes (`-`) and periods + # (`.`). The first character must be a lowercase letter. + # @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/iam/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Iam::V2::Policies::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Iam::V2::CreatePolicyRequest.new + # + # # Call the create_policy method. + # result = client.create_policy 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_policy request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V2::CreatePolicyRequest + + # Converts hash 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_policy.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::Iam::V2::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_policy.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.create_policy.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @policies_stub.create_policy 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 + + ## + # Updates the specified policy. + # + # You can update only the rules and the display name for the policy. + # + # To update a policy, you should use a read-modify-write loop: + # + # 1. Use {::Google::Iam::V2::Policies::Rest::Client#get_policy GetPolicy} to read the current version of the policy. + # 2. Modify the policy as needed. + # 3. Use `UpdatePolicy` to write the updated policy. + # + # This pattern helps prevent conflicts between concurrent updates. + # + # @overload update_policy(request, options = nil) + # Pass arguments to `update_policy` via a request object, either of type + # {::Google::Iam::V2::UpdatePolicyRequest} or an equivalent Hash. + # + # @param request [::Google::Iam::V2::UpdatePolicyRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_policy(policy: nil) + # Pass arguments to `update_policy` via keyword arguments. Note that at + # least one keyword argument is required. To specify no parameters, or to keep all + # the default parameter values, pass an empty Hash as a request object (see above). + # + # @param policy [::Google::Iam::V2::Policy, ::Hash] + # Required. The policy to update. + # + # To prevent conflicting updates, the `etag` value must match the value that + # is stored in IAM. If the `etag` values do not match, the request fails with + # a `409` error code and `ABORTED` status. + # @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/iam/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Iam::V2::Policies::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Iam::V2::UpdatePolicyRequest.new + # + # # Call the update_policy method. + # result = client.update_policy 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 update_policy request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V2::UpdatePolicyRequest + + # Converts hash 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_policy.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::Iam::V2::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_policy.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.update_policy.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @policies_stub.update_policy 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 policy. This action is permanent. + # + # @overload delete_policy(request, options = nil) + # Pass arguments to `delete_policy` via a request object, either of type + # {::Google::Iam::V2::DeletePolicyRequest} or an equivalent Hash. + # + # @param request [::Google::Iam::V2::DeletePolicyRequest, ::Hash] + # A request object representing the call parameters. Required. To specify no + # parameters, or to keep all the default parameter 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_policy(name: nil, etag: nil) + # Pass arguments to `delete_policy` via keyword arguments. Note that at + # least one keyword argument is 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 policy to delete. Format: + # `policies/{attachment_point}/denypolicies/{policy_id}` + # + # + # Use the URL-encoded full resource name, which means that the forward-slash + # character, `/`, must be written as `%2F`. For example, + # `policies/cloudresourcemanager.googleapis.com%2Fprojects%2Fmy-project/denypolicies/my-policy`. + # + # For organizations and folders, use the numeric ID in the full resource + # name. For projects, you can use the alphanumeric or the numeric ID. + # @param etag [::String] + # Optional. The expected `etag` of the policy to delete. If the value does not match + # the value that is stored in IAM, the request fails with a `409` error code + # and `ABORTED` status. + # + # If you omit this field, the policy is deleted regardless of its current + # `etag`. + # @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/iam/v2" + # + # # Create a client object. The client can be reused for multiple calls. + # client = Google::Iam::V2::Policies::Rest::Client.new + # + # # Create a request. To set request fields, pass in keyword arguments. + # request = Google::Iam::V2::DeletePolicyRequest.new + # + # # Call the delete_policy method. + # result = client.delete_policy 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_policy request, options = nil + raise ::ArgumentError, "request must be provided" if request.nil? + + request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V2::DeletePolicyRequest + + # Converts hash 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_policy.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::Iam::V2::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_policy.timeout, + metadata: call_metadata, + retry_policy: @config.rpcs.delete_policy.retry_policy + + options.apply_defaults timeout: @config.timeout, + metadata: @config.metadata, + retry_policy: @config.retry_policy + + @policies_stub.delete_policy 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 + + ## + # Configuration class for the Policies REST API. + # + # This class represents the configuration for Policies 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::Iam::V2::Policies::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_policies to 20 seconds, + # # and all remaining timeouts to 10 seconds. + # ::Google::Iam::V2::Policies::Rest::Client.configure do |config| + # config.timeout = 10.0 + # config.rpcs.list_policies.timeout = 20.0 + # end + # + # # Apply the above configuration only to a new client. + # client = ::Google::Iam::V2::Policies::Rest::Client.new do |config| + # config.timeout = 10.0 + # config.rpcs.list_policies.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 = "iam.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 Policies 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_policies` + # @return [::Gapic::Config::Method] + # + attr_reader :list_policies + ## + # RPC-specific configuration for `get_policy` + # @return [::Gapic::Config::Method] + # + attr_reader :get_policy + ## + # RPC-specific configuration for `create_policy` + # @return [::Gapic::Config::Method] + # + attr_reader :create_policy + ## + # RPC-specific configuration for `update_policy` + # @return [::Gapic::Config::Method] + # + attr_reader :update_policy + ## + # RPC-specific configuration for `delete_policy` + # @return [::Gapic::Config::Method] + # + attr_reader :delete_policy + + # @private + def initialize parent_rpcs = nil + list_policies_config = parent_rpcs.list_policies if parent_rpcs.respond_to? :list_policies + @list_policies = ::Gapic::Config::Method.new list_policies_config + get_policy_config = parent_rpcs.get_policy if parent_rpcs.respond_to? :get_policy + @get_policy = ::Gapic::Config::Method.new get_policy_config + create_policy_config = parent_rpcs.create_policy if parent_rpcs.respond_to? :create_policy + @create_policy = ::Gapic::Config::Method.new create_policy_config + update_policy_config = parent_rpcs.update_policy if parent_rpcs.respond_to? :update_policy + @update_policy = ::Gapic::Config::Method.new update_policy_config + delete_policy_config = parent_rpcs.delete_policy if parent_rpcs.respond_to? :delete_policy + @delete_policy = ::Gapic::Config::Method.new delete_policy_config + + yield self if block_given? + end + end + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-iam-v2/lib/google/iam/v2/policies/rest/operations.rb b/owl-bot-staging/google-iam-v2/lib/google/iam/v2/policies/rest/operations.rb new file mode 100644 index 000000000000..9bb7499864d3 --- /dev/null +++ b/owl-bot-staging/google-iam-v2/lib/google/iam/v2/policies/rest/operations.rb @@ -0,0 +1,923 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Iam + module V2 + module Policies + module Rest + # Service that implements Longrunning Operations API. + class Operations + # @private + API_VERSION = "" + + # @private + DEFAULT_ENDPOINT_TEMPLATE = "iam.$UNIVERSE_DOMAIN$" + + # @private + attr_reader :operations_stub + + ## + # Configuration for the Policies 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 Policies 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::Iam::V2::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::Iam::V2::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::Iam::V2::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::Iam::V2::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 = "iam.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: "/v2/{name}", + matches: [ + ["name", %r{^policies/[^/]+/[^/]+/[^/]+/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 diff --git a/owl-bot-staging/google-iam-v2/lib/google/iam/v2/policies/rest/service_stub.rb b/owl-bot-staging/google-iam-v2/lib/google/iam/v2/policies/rest/service_stub.rb new file mode 100644 index 000000000000..cfcc7003472b --- /dev/null +++ b/owl-bot-staging/google-iam-v2/lib/google/iam/v2/policies/rest/service_stub.rb @@ -0,0 +1,386 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/iam/v2/policy_pb" + +module Google + module Iam + module V2 + module Policies + module Rest + ## + # REST service stub for the Policies 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_policies REST call + # + # @param request_pb [::Google::Iam::V2::ListPoliciesRequest] + # 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::Iam::V2::ListPoliciesResponse] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Iam::V2::ListPoliciesResponse] + # A result object deserialized from the server's reply + def list_policies request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_list_policies_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_policies", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Iam::V2::ListPoliciesResponse.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_policy REST call + # + # @param request_pb [::Google::Iam::V2::GetPolicyRequest] + # 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::Iam::V2::Policy] + # @yieldparam operation [::Gapic::Rest::TransportOperation] + # + # @return [::Google::Iam::V2::Policy] + # A result object deserialized from the server's reply + def get_policy request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_get_policy_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_policy", + options: options + ) + operation = ::Gapic::Rest::TransportOperation.new response + result = ::Google::Iam::V2::Policy.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_policy REST call + # + # @param request_pb [::Google::Iam::V2::CreatePolicyRequest] + # 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_policy request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_create_policy_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_policy", + 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 update_policy REST call + # + # @param request_pb [::Google::Iam::V2::UpdatePolicyRequest] + # 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 update_policy request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_update_policy_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_policy", + 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_policy REST call + # + # @param request_pb [::Google::Iam::V2::DeletePolicyRequest] + # 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_policy request_pb, options = nil + raise ::ArgumentError, "request must be provided" if request_pb.nil? + + verb, uri, query_string_params, body = ServiceStub.transcode_delete_policy_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_policy", + 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 + + ## + # @private + # + # GRPC transcoding helper method for the list_policies REST call + # + # @param request_pb [::Google::Iam::V2::ListPoliciesRequest] + # 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_policies_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v2/{parent}", + matches: [ + ["parent", %r{^policies/[^/]+/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the get_policy REST call + # + # @param request_pb [::Google::Iam::V2::GetPolicyRequest] + # 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_policy_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :get, + uri_template: "/v2/{name}", + matches: [ + ["name", %r{^policies/[^/]+/[^/]+/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the create_policy REST call + # + # @param request_pb [::Google::Iam::V2::CreatePolicyRequest] + # 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_policy_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :post, + uri_template: "/v2/{parent}", + body: "policy", + matches: [ + ["parent", %r{^policies/[^/]+/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the update_policy REST call + # + # @param request_pb [::Google::Iam::V2::UpdatePolicyRequest] + # 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_policy_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :put, + uri_template: "/v2/{policy.name}", + body: "policy", + matches: [ + ["policy.name", %r{^policies/[^/]+/[^/]+/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + + ## + # @private + # + # GRPC transcoding helper method for the delete_policy REST call + # + # @param request_pb [::Google::Iam::V2::DeletePolicyRequest] + # 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_policy_request request_pb + transcoder = Gapic::Rest::GrpcTranscoder.new + .with_bindings( + uri_method: :delete, + uri_template: "/v2/{name}", + matches: [ + ["name", %r{^policies/[^/]+/[^/]+/[^/]+/?$}, false] + ] + ) + transcoder.transcode request_pb + end + end + end + end + end + end +end diff --git a/owl-bot-staging/google-iam-v2/lib/google/iam/v2/policy_pb.rb b/owl-bot-staging/google-iam-v2/lib/google/iam/v2/policy_pb.rb new file mode 100644 index 000000000000..ac1b3aaac015 --- /dev/null +++ b/owl-bot-staging/google-iam-v2/lib/google/iam/v2/policy_pb.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: google/iam/v2/policy.proto + +require 'google/protobuf' + +require 'google/api/annotations_pb' +require 'google/api/client_pb' +require 'google/api/field_behavior_pb' +require 'google/iam/v2/deny_pb' +require 'google/longrunning/operations_pb' +require 'google/protobuf/timestamp_pb' + + +descriptor_data = "\n\x1agoogle/iam/v2/policy.proto\x12\rgoogle.iam.v2\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x18google/iam/v2/deny.proto\x1a#google/longrunning/operations.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xc2\x03\n\x06Policy\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x05\x12\x10\n\x03uid\x18\x02 \x01(\tB\x03\xe0\x41\x05\x12\x11\n\x04kind\x18\x03 \x01(\tB\x03\xe0\x41\x03\x12\x14\n\x0c\x64isplay_name\x18\x04 \x01(\t\x12;\n\x0b\x61nnotations\x18\x05 \x03(\x0b\x32&.google.iam.v2.Policy.AnnotationsEntry\x12\x0c\n\x04\x65tag\x18\x06 \x01(\t\x12\x34\n\x0b\x63reate_time\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x08 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0b\x64\x65lete_time\x18\t \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12(\n\x05rules\x18\n \x03(\x0b\x32\x19.google.iam.v2.PolicyRule\x12\x1f\n\x12managing_authority\x18\x0b \x01(\tB\x03\xe0\x41\x05\x1a\x32\n\x10\x41nnotationsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"W\n\nPolicyRule\x12,\n\tdeny_rule\x18\x02 \x01(\x0b\x32\x17.google.iam.v2.DenyRuleH\x00\x12\x13\n\x0b\x64\x65scription\x18\x01 \x01(\tB\x06\n\x04kind\"Q\n\x13ListPoliciesRequest\x12\x13\n\x06parent\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\"X\n\x14ListPoliciesResponse\x12\'\n\x08policies\x18\x01 \x03(\x0b\x32\x15.google.iam.v2.Policy\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"%\n\x10GetPolicyRequest\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x02\"i\n\x13\x43reatePolicyRequest\x12\x13\n\x06parent\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12*\n\x06policy\x18\x02 \x01(\x0b\x32\x15.google.iam.v2.PolicyB\x03\xe0\x41\x02\x12\x11\n\tpolicy_id\x18\x03 \x01(\t\"A\n\x13UpdatePolicyRequest\x12*\n\x06policy\x18\x01 \x01(\x0b\x32\x15.google.iam.v2.PolicyB\x03\xe0\x41\x02\";\n\x13\x44\x65letePolicyRequest\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x11\n\x04\x65tag\x18\x02 \x01(\tB\x03\xe0\x41\x01\"J\n\x17PolicyOperationMetadata\x12/\n\x0b\x63reate_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp2\xd0\x06\n\x08Policies\x12\x83\x01\n\x0cListPolicies\x12\".google.iam.v2.ListPoliciesRequest\x1a#.google.iam.v2.ListPoliciesResponse\"*\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x1b\x12\x19/v2/{parent=policies/*/*}\x12m\n\tGetPolicy\x12\x1f.google.iam.v2.GetPolicyRequest\x1a\x15.google.iam.v2.Policy\"(\xda\x41\x04name\x82\xd3\xe4\x93\x02\x1b\x12\x19/v2/{name=policies/*/*/*}\x12\xba\x01\n\x0c\x43reatePolicy\x12\".google.iam.v2.CreatePolicyRequest\x1a\x1d.google.longrunning.Operation\"g\xca\x41!\n\x06Policy\x12\x17PolicyOperationMetadata\xda\x41\x17parent,policy,policy_id\x82\xd3\xe4\x93\x02#\"\x19/v2/{parent=policies/*/*}:\x06policy\x12\xa7\x01\n\x0cUpdatePolicy\x12\".google.iam.v2.UpdatePolicyRequest\x1a\x1d.google.longrunning.Operation\"T\xca\x41!\n\x06Policy\x12\x17PolicyOperationMetadata\x82\xd3\xe4\x93\x02*\x1a /v2/{policy.name=policies/*/*/*}:\x06policy\x12\x9f\x01\n\x0c\x44\x65letePolicy\x12\".google.iam.v2.DeletePolicyRequest\x1a\x1d.google.longrunning.Operation\"L\xca\x41!\n\x06Policy\x12\x17PolicyOperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02\x1b*\x19/v2/{name=policies/*/*/*}\x1a\x46\xca\x41\x12iam.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformBy\n\x11\x63om.google.iam.v2B\x0bPolicyProtoP\x01Z)cloud.google.com/go/iam/apiv2/iampb;iampb\xaa\x02\x13Google.Cloud.Iam.V2\xca\x02\x13Google\\Cloud\\Iam\\V2b\x06proto3" + +pool = ::Google::Protobuf::DescriptorPool.generated_pool +pool.add_serialized_file(descriptor_data) + +module Google + module Iam + module V2 + Policy = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.iam.v2.Policy").msgclass + PolicyRule = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.iam.v2.PolicyRule").msgclass + ListPoliciesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.iam.v2.ListPoliciesRequest").msgclass + ListPoliciesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.iam.v2.ListPoliciesResponse").msgclass + GetPolicyRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.iam.v2.GetPolicyRequest").msgclass + CreatePolicyRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.iam.v2.CreatePolicyRequest").msgclass + UpdatePolicyRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.iam.v2.UpdatePolicyRequest").msgclass + DeletePolicyRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.iam.v2.DeletePolicyRequest").msgclass + PolicyOperationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.iam.v2.PolicyOperationMetadata").msgclass + end + end +end diff --git a/owl-bot-staging/google-iam-v2/lib/google/iam/v2/policy_services_pb.rb b/owl-bot-staging/google-iam-v2/lib/google/iam/v2/policy_services_pb.rb new file mode 100644 index 000000000000..bd26fe57cd18 --- /dev/null +++ b/owl-bot-staging/google-iam-v2/lib/google/iam/v2/policy_services_pb.rb @@ -0,0 +1,65 @@ +# Generated by the protocol buffer compiler. DO NOT EDIT! +# Source: google/iam/v2/policy.proto for package 'google.iam.v2' +# 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/iam/v2/policy_pb' + +module Google + module Iam + module V2 + module Policies + # An interface for managing Identity and Access Management (IAM) policies. + class Service + + include ::GRPC::GenericService + + self.marshal_class_method = :encode + self.unmarshal_class_method = :decode + self.service_name = 'google.iam.v2.Policies' + + # Retrieves the policies of the specified kind that are attached to a + # resource. + # + # The response lists only policy metadata. In particular, policy rules are + # omitted. + rpc :ListPolicies, ::Google::Iam::V2::ListPoliciesRequest, ::Google::Iam::V2::ListPoliciesResponse + # Gets a policy. + rpc :GetPolicy, ::Google::Iam::V2::GetPolicyRequest, ::Google::Iam::V2::Policy + # Creates a policy. + rpc :CreatePolicy, ::Google::Iam::V2::CreatePolicyRequest, ::Google::Longrunning::Operation + # Updates the specified policy. + # + # You can update only the rules and the display name for the policy. + # + # To update a policy, you should use a read-modify-write loop: + # + # 1. Use [GetPolicy][google.iam.v2.Policies.GetPolicy] to read the current version of the policy. + # 2. Modify the policy as needed. + # 3. Use `UpdatePolicy` to write the updated policy. + # + # This pattern helps prevent conflicts between concurrent updates. + rpc :UpdatePolicy, ::Google::Iam::V2::UpdatePolicyRequest, ::Google::Longrunning::Operation + # Deletes a policy. This action is permanent. + rpc :DeletePolicy, ::Google::Iam::V2::DeletePolicyRequest, ::Google::Longrunning::Operation + end + + Stub = Service.rpc_stub_class + end + end + end +end diff --git a/owl-bot-staging/google-iam-v2/lib/google/iam/v2/rest.rb b/owl-bot-staging/google-iam-v2/lib/google/iam/v2/rest.rb new file mode 100644 index 000000000000..d430e48053e6 --- /dev/null +++ b/owl-bot-staging/google-iam-v2/lib/google/iam/v2/rest.rb @@ -0,0 +1,35 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/iam/v2/policies/rest" +require "google/iam/v2/version" + +module Google + module Iam + ## + # To load just the REST part of this package, including all its services, and instantiate a REST client: + # + # @example + # + # require "google/iam/v2/rest" + # client = ::Google::Iam::V2::Policies::Rest::Client.new + # + module V2 + end + end +end diff --git a/owl-bot-staging/google-iam-v2/lib/google/iam/v2/version.rb b/owl-bot-staging/google-iam-v2/lib/google/iam/v2/version.rb new file mode 100644 index 000000000000..da9bc723e32d --- /dev/null +++ b/owl-bot-staging/google-iam-v2/lib/google/iam/v2/version.rb @@ -0,0 +1,26 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Iam + module V2 + VERSION = "0.0.1" + end + end +end diff --git a/owl-bot-staging/google-iam-v2/proto_docs/README.md b/owl-bot-staging/google-iam-v2/proto_docs/README.md new file mode 100644 index 000000000000..155a17d3cb7c --- /dev/null +++ b/owl-bot-staging/google-iam-v2/proto_docs/README.md @@ -0,0 +1,4 @@ +# IAM V2 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-iam-v2/proto_docs/google/api/client.rb b/owl-bot-staging/google-iam-v2/proto_docs/google/api/client.rb new file mode 100644 index 000000000000..3ab0b096d445 --- /dev/null +++ b/owl-bot-staging/google-iam-v2/proto_docs/google/api/client.rb @@ -0,0 +1,593 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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. + # + # Note: This field should not be used in most cases. + 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: + # library_settings: + # 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. + # @!attribute [rw] library_package + # @return [::String] + # The package name to use in Php. Clobbers the php_namespace option + # set in the protobuf. This should be used **only** by APIs + # who have already set the language_settings.php.package_name" field + # in gapic.yaml. API teams should use the protobuf php_namespace option + # where possible. + # + # Example of a YAML configuration:: + # + # publishing: + # library_settings: + # php_settings: + # library_package: Google\Cloud\PubSub\V1 + 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. + # + # Example: + # + # 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 + # @!attribute [rw] batching + # @return [::Google::Api::BatchingConfigProto] + # Batching configuration for an API method in client libraries. + # + # Example of a YAML configuration: + # + # publishing: + # method_settings: + # - selector: google.example.v1.ExampleService.BatchCreateExample + # batching: + # element_count_threshold: 1000 + # request_byte_threshold: 100000000 + # delay_threshold_millis: 10 + 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. + # + # Note: This feature should not be used in most cases. + # @!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 + + # `BatchingConfigProto` defines the batching configuration for an API method. + # @!attribute [rw] thresholds + # @return [::Google::Api::BatchingSettingsProto] + # The thresholds which trigger a batched request to be sent. + # @!attribute [rw] batch_descriptor + # @return [::Google::Api::BatchingDescriptorProto] + # The request and response fields used in batching. + class BatchingConfigProto + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `BatchingSettingsProto` specifies a set of batching thresholds, each of + # which acts as a trigger to send a batch of messages as a request. At least + # one threshold must be positive nonzero. + # @!attribute [rw] element_count_threshold + # @return [::Integer] + # The number of elements of a field collected into a batch which, if + # exceeded, causes the batch to be sent. + # @!attribute [rw] request_byte_threshold + # @return [::Integer] + # The aggregated size of the batched field which, if exceeded, causes the + # batch to be sent. This size is computed by aggregating the sizes of the + # request field to be batched, not of the entire request message. + # @!attribute [rw] delay_threshold + # @return [::Google::Protobuf::Duration] + # The duration after which a batch should be sent, starting from the addition + # of the first message to that batch. + # @!attribute [rw] element_count_limit + # @return [::Integer] + # The maximum number of elements collected in a batch that could be accepted + # by server. + # @!attribute [rw] request_byte_limit + # @return [::Integer] + # The maximum size of the request that could be accepted by server. + # @!attribute [rw] flow_control_element_limit + # @return [::Integer] + # The maximum number of elements allowed by flow control. + # @!attribute [rw] flow_control_byte_limit + # @return [::Integer] + # The maximum size of data allowed by flow control. + # @!attribute [rw] flow_control_limit_exceeded_behavior + # @return [::Google::Api::FlowControlLimitExceededBehaviorProto] + # The behavior to take when the flow control limit is exceeded. + class BatchingSettingsProto + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # `BatchingDescriptorProto` specifies the fields of the request message to be + # used for batching, and, optionally, the fields of the response message to be + # used for demultiplexing. + # @!attribute [rw] batched_field + # @return [::String] + # The repeated field in the request message to be aggregated by batching. + # @!attribute [rw] discriminator_fields + # @return [::Array<::String>] + # A list of the fields in the request message. Two requests will be batched + # together only if the values of every field specified in + # `request_discriminator_fields` is equal between the two requests. + # @!attribute [rw] subresponse_field + # @return [::String] + # Optional. When present, indicates the field in the response message to be + # used to demultiplex the response into multiple response messages, in + # correspondence with the multiple request messages originally batched + # together. + class BatchingDescriptorProto + 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 + + # The behavior to take when the flow control limit is exceeded. + module FlowControlLimitExceededBehaviorProto + # Default behavior, system-defined. + UNSET_BEHAVIOR = 0 + + # Stop operation, raise error. + THROW_EXCEPTION = 1 + + # Pause operation until limit clears. + BLOCK = 2 + + # Continue operation, disregard limit. + IGNORE = 3 + end + end +end diff --git a/owl-bot-staging/google-iam-v2/proto_docs/google/api/field_behavior.rb b/owl-bot-staging/google-iam-v2/proto_docs/google/api/field_behavior.rb new file mode 100644 index 000000000000..582be187d115 --- /dev/null +++ b/owl-bot-staging/google-iam-v2/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-iam-v2/proto_docs/google/api/launch_stage.rb b/owl-bot-staging/google-iam-v2/proto_docs/google/api/launch_stage.rb new file mode 100644 index 000000000000..9392a413fb1b --- /dev/null +++ b/owl-bot-staging/google-iam-v2/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-iam-v2/proto_docs/google/api/resource.rb b/owl-bot-staging/google-iam-v2/proto_docs/google/api/resource.rb new file mode 100644 index 000000000000..25dec4847ac1 --- /dev/null +++ b/owl-bot-staging/google-iam-v2/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-iam-v2/proto_docs/google/iam/v2/deny.rb b/owl-bot-staging/google-iam-v2/proto_docs/google/iam/v2/deny.rb new file mode 100644 index 000000000000..85ac06367665 --- /dev/null +++ b/owl-bot-staging/google-iam-v2/proto_docs/google/iam/v2/deny.rb @@ -0,0 +1,110 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Iam + module V2 + # A deny rule in an IAM deny policy. + # @!attribute [rw] denied_principals + # @return [::Array<::String>] + # The identities that are prevented from using one or more permissions on + # Google Cloud resources. This field can contain the following values: + # + # * `principalSet://goog/public:all`: A special identifier that represents + # any principal that is on the internet, even if they do not have a Google + # Account or are not logged in. + # + # * `principal://goog/subject/{email_id}`: A specific Google Account. + # Includes Gmail, Cloud Identity, and Google Workspace user accounts. For + # example, `principal://goog/subject/alice@example.com`. + # + # * `deleted:principal://goog/subject/{email_id}?uid={uid}`: A specific + # Google Account that was deleted recently. For example, + # `deleted:principal://goog/subject/alice@example.com?uid=1234567890`. If + # the Google Account is recovered, this identifier reverts to the standard + # identifier for a Google Account. + # + # * `principalSet://goog/group/{group_id}`: A Google group. For example, + # `principalSet://goog/group/admins@example.com`. + # + # * `deleted:principalSet://goog/group/{group_id}?uid={uid}`: A Google group + # that was deleted recently. For example, + # `deleted:principalSet://goog/group/admins@example.com?uid=1234567890`. If + # the Google group is restored, this identifier reverts to the standard + # identifier for a Google group. + # + # * `principal://iam.googleapis.com/projects/-/serviceAccounts/{service_account_id}`: + # A Google Cloud service account. For example, + # `principal://iam.googleapis.com/projects/-/serviceAccounts/my-service-account@iam.gserviceaccount.com`. + # + # * `deleted:principal://iam.googleapis.com/projects/-/serviceAccounts/{service_account_id}?uid={uid}`: + # A Google Cloud service account that was deleted recently. For example, + # `deleted:principal://iam.googleapis.com/projects/-/serviceAccounts/my-service-account@iam.gserviceaccount.com?uid=1234567890`. + # If the service account is undeleted, this identifier reverts to the + # standard identifier for a service account. + # + # * `principalSet://goog/cloudIdentityCustomerId/{customer_id}`: All of the + # principals associated with the specified Google Workspace or Cloud + # Identity customer ID. For example, + # `principalSet://goog/cloudIdentityCustomerId/C01Abc35`. + # @!attribute [rw] exception_principals + # @return [::Array<::String>] + # The identities that are excluded from the deny rule, even if they are + # listed in the `denied_principals`. For example, you could add a Google + # group to the `denied_principals`, then exclude specific users who belong to + # that group. + # + # This field can contain the same values as the `denied_principals` field, + # excluding `principalSet://goog/public:all`, which represents all users on + # the internet. + # @!attribute [rw] denied_permissions + # @return [::Array<::String>] + # The permissions that are explicitly denied by this rule. Each permission + # uses the format `{service_fqdn}/{resource}.{verb}`, where `{service_fqdn}` + # is the fully qualified domain name for the service. For example, + # `iam.googleapis.com/roles.list`. + # @!attribute [rw] exception_permissions + # @return [::Array<::String>] + # Specifies the permissions that this rule excludes from the set of denied + # permissions given by `denied_permissions`. If a permission appears in + # `denied_permissions` _and_ in `exception_permissions` then it will _not_ be + # denied. + # + # The excluded permissions can be specified using the same syntax as + # `denied_permissions`. + # @!attribute [rw] denial_condition + # @return [::Google::Type::Expr] + # The condition that determines whether this deny rule applies to a request. + # If the condition expression evaluates to `true`, then the deny rule is + # applied; otherwise, the deny rule is not applied. + # + # Each deny rule is evaluated independently. If this deny rule does not apply + # to a request, other deny rules might still apply. + # + # The condition can use CEL functions that evaluate + # [resource + # tags](https://cloud.google.com/iam/help/conditions/resource-tags). Other + # functions and operators are not supported. + class DenyRule + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end +end diff --git a/owl-bot-staging/google-iam-v2/proto_docs/google/iam/v2/policy.rb b/owl-bot-staging/google-iam-v2/proto_docs/google/iam/v2/policy.rb new file mode 100644 index 000000000000..917b870c27c0 --- /dev/null +++ b/owl-bot-staging/google-iam-v2/proto_docs/google/iam/v2/policy.rb @@ -0,0 +1,241 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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 Iam + module V2 + # Data for an IAM policy. + # @!attribute [rw] name + # @return [::String] + # Immutable. The resource name of the `Policy`, which must be unique. Format: + # `policies/{attachment_point}/denypolicies/{policy_id}` + # + # + # The attachment point is identified by its URL-encoded full resource name, + # which means that the forward-slash character, `/`, must be written as + # `%2F`. For example, + # `policies/cloudresourcemanager.googleapis.com%2Fprojects%2Fmy-project/denypolicies/my-deny-policy`. + # + # For organizations and folders, use the numeric ID in the full resource + # name. For projects, requests can use the alphanumeric or the numeric ID. + # Responses always contain the numeric ID. + # @!attribute [rw] uid + # @return [::String] + # Immutable. The globally unique ID of the `Policy`. Assigned automatically when the + # `Policy` is created. + # @!attribute [r] kind + # @return [::String] + # Output only. The kind of the `Policy`. Always contains the value `DenyPolicy`. + # @!attribute [rw] display_name + # @return [::String] + # A user-specified description of the `Policy`. This value can be up to 63 + # characters. + # @!attribute [rw] annotations + # @return [::Google::Protobuf::Map{::String => ::String}] + # A key-value map to store arbitrary metadata for the `Policy`. Keys + # can be up to 63 characters. Values can be up to 255 characters. + # @!attribute [rw] etag + # @return [::String] + # An opaque tag that identifies the current version of the `Policy`. IAM uses + # this value to help manage concurrent updates, so they do not cause one + # update to be overwritten by another. + # + # If this field is present in a [CreatePolicy][] request, the value is + # ignored. + # @!attribute [r] create_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time when the `Policy` was created. + # @!attribute [r] update_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time when the `Policy` was last updated. + # @!attribute [r] delete_time + # @return [::Google::Protobuf::Timestamp] + # Output only. The time when the `Policy` was deleted. Empty if the policy is not deleted. + # @!attribute [rw] rules + # @return [::Array<::Google::Iam::V2::PolicyRule>] + # A list of rules that specify the behavior of the `Policy`. All of the rules + # should be of the `kind` specified in the `Policy`. + # @!attribute [rw] managing_authority + # @return [::String] + # Immutable. Specifies that this policy is managed by an authority and can only be + # modified by that authority. Usage is restricted. + class Policy + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + + # @!attribute [rw] key + # @return [::String] + # @!attribute [rw] value + # @return [::String] + class AnnotationsEntry + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + + # A single rule in a `Policy`. + # @!attribute [rw] deny_rule + # @return [::Google::Iam::V2::DenyRule] + # A rule for a deny policy. + # @!attribute [rw] description + # @return [::String] + # A user-specified description of the rule. This value can be up to 256 + # characters. + class PolicyRule + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for `ListPolicies`. + # @!attribute [rw] parent + # @return [::String] + # Required. The resource that the policy is attached to, along with the kind of policy + # to list. Format: + # `policies/{attachment_point}/denypolicies` + # + # + # The attachment point is identified by its URL-encoded full resource name, + # which means that the forward-slash character, `/`, must be written as + # `%2F`. For example, + # `policies/cloudresourcemanager.googleapis.com%2Fprojects%2Fmy-project/denypolicies`. + # + # For organizations and folders, use the numeric ID in the full resource + # name. For projects, you can use the alphanumeric or the numeric ID. + # @!attribute [rw] page_size + # @return [::Integer] + # The maximum number of policies to return. IAM ignores this value and uses + # the value 1000. + # @!attribute [rw] page_token + # @return [::String] + # A page token received in a {::Google::Iam::V2::ListPoliciesResponse ListPoliciesResponse}. Provide this token to + # retrieve the next page. + class ListPoliciesRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Response message for `ListPolicies`. + # @!attribute [rw] policies + # @return [::Array<::Google::Iam::V2::Policy>] + # Metadata for the policies that are attached to the resource. + # @!attribute [rw] next_page_token + # @return [::String] + # A page token that you can use in a {::Google::Iam::V2::ListPoliciesRequest ListPoliciesRequest} to retrieve the + # next page. If this field is omitted, there are no additional pages. + class ListPoliciesResponse + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for `GetPolicy`. + # @!attribute [rw] name + # @return [::String] + # Required. The resource name of the policy to retrieve. Format: + # `policies/{attachment_point}/denypolicies/{policy_id}` + # + # + # Use the URL-encoded full resource name, which means that the forward-slash + # character, `/`, must be written as `%2F`. For example, + # `policies/cloudresourcemanager.googleapis.com%2Fprojects%2Fmy-project/denypolicies/my-policy`. + # + # For organizations and folders, use the numeric ID in the full resource + # name. For projects, you can use the alphanumeric or the numeric ID. + class GetPolicyRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for `CreatePolicy`. + # @!attribute [rw] parent + # @return [::String] + # Required. The resource that the policy is attached to, along with the kind of policy + # to create. Format: `policies/{attachment_point}/denypolicies` + # + # + # The attachment point is identified by its URL-encoded full resource name, + # which means that the forward-slash character, `/`, must be written as + # `%2F`. For example, + # `policies/cloudresourcemanager.googleapis.com%2Fprojects%2Fmy-project/denypolicies`. + # + # For organizations and folders, use the numeric ID in the full resource + # name. For projects, you can use the alphanumeric or the numeric ID. + # @!attribute [rw] policy + # @return [::Google::Iam::V2::Policy] + # Required. The policy to create. + # @!attribute [rw] policy_id + # @return [::String] + # The ID to use for this policy, which will become the final component of + # the policy's resource name. The ID must contain 3 to 63 characters. It can + # contain lowercase letters and numbers, as well as dashes (`-`) and periods + # (`.`). The first character must be a lowercase letter. + class CreatePolicyRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for `UpdatePolicy`. + # @!attribute [rw] policy + # @return [::Google::Iam::V2::Policy] + # Required. The policy to update. + # + # To prevent conflicting updates, the `etag` value must match the value that + # is stored in IAM. If the `etag` values do not match, the request fails with + # a `409` error code and `ABORTED` status. + class UpdatePolicyRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Request message for `DeletePolicy`. + # @!attribute [rw] name + # @return [::String] + # Required. The resource name of the policy to delete. Format: + # `policies/{attachment_point}/denypolicies/{policy_id}` + # + # + # Use the URL-encoded full resource name, which means that the forward-slash + # character, `/`, must be written as `%2F`. For example, + # `policies/cloudresourcemanager.googleapis.com%2Fprojects%2Fmy-project/denypolicies/my-policy`. + # + # For organizations and folders, use the numeric ID in the full resource + # name. For projects, you can use the alphanumeric or the numeric ID. + # @!attribute [rw] etag + # @return [::String] + # Optional. The expected `etag` of the policy to delete. If the value does not match + # the value that is stored in IAM, the request fails with a `409` error code + # and `ABORTED` status. + # + # If you omit this field, the policy is deleted regardless of its current + # `etag`. + class DeletePolicyRequest + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + + # Metadata for long-running `Policy` operations. + # @!attribute [rw] create_time + # @return [::Google::Protobuf::Timestamp] + # Timestamp when the `google.longrunning.Operation` was created. + class PolicyOperationMetadata + include ::Google::Protobuf::MessageExts + extend ::Google::Protobuf::MessageExts::ClassMethods + end + end + end +end diff --git a/owl-bot-staging/google-iam-v2/proto_docs/google/longrunning/operations.rb b/owl-bot-staging/google-iam-v2/proto_docs/google/longrunning/operations.rb new file mode 100644 index 000000000000..7a757f512165 --- /dev/null +++ b/owl-bot-staging/google-iam-v2/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-iam-v2/proto_docs/google/protobuf/any.rb b/owl-bot-staging/google-iam-v2/proto_docs/google/protobuf/any.rb new file mode 100644 index 000000000000..58691995f02e --- /dev/null +++ b/owl-bot-staging/google-iam-v2/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-iam-v2/proto_docs/google/protobuf/duration.rb b/owl-bot-staging/google-iam-v2/proto_docs/google/protobuf/duration.rb new file mode 100644 index 000000000000..ea59f1f91daf --- /dev/null +++ b/owl-bot-staging/google-iam-v2/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-iam-v2/proto_docs/google/protobuf/empty.rb b/owl-bot-staging/google-iam-v2/proto_docs/google/protobuf/empty.rb new file mode 100644 index 000000000000..83e4481834a6 --- /dev/null +++ b/owl-bot-staging/google-iam-v2/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-iam-v2/proto_docs/google/protobuf/timestamp.rb b/owl-bot-staging/google-iam-v2/proto_docs/google/protobuf/timestamp.rb new file mode 100644 index 000000000000..74352be9c58c --- /dev/null +++ b/owl-bot-staging/google-iam-v2/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-iam-v2/proto_docs/google/rpc/status.rb b/owl-bot-staging/google-iam-v2/proto_docs/google/rpc/status.rb new file mode 100644 index 000000000000..c1a1c07eb2db --- /dev/null +++ b/owl-bot-staging/google-iam-v2/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-iam-v2/proto_docs/google/type/expr.rb b/owl-bot-staging/google-iam-v2/proto_docs/google/type/expr.rb new file mode 100644 index 000000000000..53e7733b6592 --- /dev/null +++ b/owl-bot-staging/google-iam-v2/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-iam-v2/snippets/Gemfile b/owl-bot-staging/google-iam-v2/snippets/Gemfile new file mode 100644 index 000000000000..0b586e897f32 --- /dev/null +++ b/owl-bot-staging/google-iam-v2/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-iam-v2", path: "../" +else + gem "google-iam-v2" +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-iam-v2/snippets/policies/create_policy.rb b/owl-bot-staging/google-iam-v2/snippets/policies/create_policy.rb new file mode 100644 index 000000000000..992efa4ac456 --- /dev/null +++ b/owl-bot-staging/google-iam-v2/snippets/policies/create_policy.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 iam_v2_generated_Policies_CreatePolicy_sync] +require "google/iam/v2" + +## +# Snippet for the create_policy call in the Policies 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::Iam::V2::Policies::Client#create_policy. +# +def create_policy + # Create a client object. The client can be reused for multiple calls. + client = Google::Iam::V2::Policies::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::V2::CreatePolicyRequest.new + + # Call the create_policy method. + result = client.create_policy 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 iam_v2_generated_Policies_CreatePolicy_sync] diff --git a/owl-bot-staging/google-iam-v2/snippets/policies/delete_policy.rb b/owl-bot-staging/google-iam-v2/snippets/policies/delete_policy.rb new file mode 100644 index 000000000000..97dbcb650132 --- /dev/null +++ b/owl-bot-staging/google-iam-v2/snippets/policies/delete_policy.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 iam_v2_generated_Policies_DeletePolicy_sync] +require "google/iam/v2" + +## +# Snippet for the delete_policy call in the Policies 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::Iam::V2::Policies::Client#delete_policy. +# +def delete_policy + # Create a client object. The client can be reused for multiple calls. + client = Google::Iam::V2::Policies::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::V2::DeletePolicyRequest.new + + # Call the delete_policy method. + result = client.delete_policy 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 iam_v2_generated_Policies_DeletePolicy_sync] diff --git a/owl-bot-staging/google-iam-v2/snippets/policies/get_policy.rb b/owl-bot-staging/google-iam-v2/snippets/policies/get_policy.rb new file mode 100644 index 000000000000..6820282d9a3b --- /dev/null +++ b/owl-bot-staging/google-iam-v2/snippets/policies/get_policy.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 iam_v2_generated_Policies_GetPolicy_sync] +require "google/iam/v2" + +## +# Snippet for the get_policy call in the Policies 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::Iam::V2::Policies::Client#get_policy. +# +def get_policy + # Create a client object. The client can be reused for multiple calls. + client = Google::Iam::V2::Policies::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::V2::GetPolicyRequest.new + + # Call the get_policy method. + result = client.get_policy request + + # The returned object is of type Google::Iam::V2::Policy. + p result +end +# [END iam_v2_generated_Policies_GetPolicy_sync] diff --git a/owl-bot-staging/google-iam-v2/snippets/policies/list_policies.rb b/owl-bot-staging/google-iam-v2/snippets/policies/list_policies.rb new file mode 100644 index 000000000000..d7d580e8441f --- /dev/null +++ b/owl-bot-staging/google-iam-v2/snippets/policies/list_policies.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 iam_v2_generated_Policies_ListPolicies_sync] +require "google/iam/v2" + +## +# Snippet for the list_policies call in the Policies 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::Iam::V2::Policies::Client#list_policies. +# +def list_policies + # Create a client object. The client can be reused for multiple calls. + client = Google::Iam::V2::Policies::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::V2::ListPoliciesRequest.new + + # Call the list_policies method. + result = client.list_policies 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::Iam::V2::Policy. + p item + end +end +# [END iam_v2_generated_Policies_ListPolicies_sync] diff --git a/owl-bot-staging/google-iam-v2/snippets/policies/update_policy.rb b/owl-bot-staging/google-iam-v2/snippets/policies/update_policy.rb new file mode 100644 index 000000000000..417fd211883b --- /dev/null +++ b/owl-bot-staging/google-iam-v2/snippets/policies/update_policy.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 iam_v2_generated_Policies_UpdatePolicy_sync] +require "google/iam/v2" + +## +# Snippet for the update_policy call in the Policies 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::Iam::V2::Policies::Client#update_policy. +# +def update_policy + # Create a client object. The client can be reused for multiple calls. + client = Google::Iam::V2::Policies::Client.new + + # Create a request. To set request fields, pass in keyword arguments. + request = Google::Iam::V2::UpdatePolicyRequest.new + + # Call the update_policy method. + result = client.update_policy 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 iam_v2_generated_Policies_UpdatePolicy_sync] diff --git a/owl-bot-staging/google-iam-v2/snippets/snippet_metadata_google.iam.v2.json b/owl-bot-staging/google-iam-v2/snippets/snippet_metadata_google.iam.v2.json new file mode 100644 index 000000000000..a44511598630 --- /dev/null +++ b/owl-bot-staging/google-iam-v2/snippets/snippet_metadata_google.iam.v2.json @@ -0,0 +1,215 @@ +{ + "client_library": { + "name": "google-iam-v2", + "version": "", + "language": "RUBY", + "apis": [ + { + "id": "google.iam.v2", + "version": "v2" + } + ] + }, + "snippets": [ + { + "region_tag": "iam_v2_generated_Policies_ListPolicies_sync", + "title": "Snippet for the list_policies call in the Policies service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Iam::V2::Policies::Client#list_policies.", + "file": "policies/list_policies.rb", + "language": "RUBY", + "client_method": { + "short_name": "list_policies", + "full_name": "::Google::Iam::V2::Policies::Client#list_policies", + "async": false, + "parameters": [ + { + "type": "::Google::Iam::V2::ListPoliciesRequest", + "name": "request" + } + ], + "result_type": "::Google::Iam::V2::ListPoliciesResponse", + "client": { + "short_name": "Policies::Client", + "full_name": "::Google::Iam::V2::Policies::Client" + }, + "method": { + "short_name": "ListPolicies", + "full_name": "google.iam.v2.Policies.ListPolicies", + "service": { + "short_name": "Policies", + "full_name": "google.iam.v2.Policies" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 50, + "type": "FULL" + } + ] + }, + { + "region_tag": "iam_v2_generated_Policies_GetPolicy_sync", + "title": "Snippet for the get_policy call in the Policies service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Iam::V2::Policies::Client#get_policy.", + "file": "policies/get_policy.rb", + "language": "RUBY", + "client_method": { + "short_name": "get_policy", + "full_name": "::Google::Iam::V2::Policies::Client#get_policy", + "async": false, + "parameters": [ + { + "type": "::Google::Iam::V2::GetPolicyRequest", + "name": "request" + } + ], + "result_type": "::Google::Iam::V2::Policy", + "client": { + "short_name": "Policies::Client", + "full_name": "::Google::Iam::V2::Policies::Client" + }, + "method": { + "short_name": "GetPolicy", + "full_name": "google.iam.v2.Policies.GetPolicy", + "service": { + "short_name": "Policies", + "full_name": "google.iam.v2.Policies" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 46, + "type": "FULL" + } + ] + }, + { + "region_tag": "iam_v2_generated_Policies_CreatePolicy_sync", + "title": "Snippet for the create_policy call in the Policies service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Iam::V2::Policies::Client#create_policy.", + "file": "policies/create_policy.rb", + "language": "RUBY", + "client_method": { + "short_name": "create_policy", + "full_name": "::Google::Iam::V2::Policies::Client#create_policy", + "async": false, + "parameters": [ + { + "type": "::Google::Iam::V2::CreatePolicyRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "Policies::Client", + "full_name": "::Google::Iam::V2::Policies::Client" + }, + "method": { + "short_name": "CreatePolicy", + "full_name": "google.iam.v2.Policies.CreatePolicy", + "service": { + "short_name": "Policies", + "full_name": "google.iam.v2.Policies" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "iam_v2_generated_Policies_UpdatePolicy_sync", + "title": "Snippet for the update_policy call in the Policies service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Iam::V2::Policies::Client#update_policy.", + "file": "policies/update_policy.rb", + "language": "RUBY", + "client_method": { + "short_name": "update_policy", + "full_name": "::Google::Iam::V2::Policies::Client#update_policy", + "async": false, + "parameters": [ + { + "type": "::Google::Iam::V2::UpdatePolicyRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "Policies::Client", + "full_name": "::Google::Iam::V2::Policies::Client" + }, + "method": { + "short_name": "UpdatePolicy", + "full_name": "google.iam.v2.Policies.UpdatePolicy", + "service": { + "short_name": "Policies", + "full_name": "google.iam.v2.Policies" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + }, + { + "region_tag": "iam_v2_generated_Policies_DeletePolicy_sync", + "title": "Snippet for the delete_policy call in the Policies service", + "description": "This is an auto-generated example demonstrating basic usage of Google::Iam::V2::Policies::Client#delete_policy.", + "file": "policies/delete_policy.rb", + "language": "RUBY", + "client_method": { + "short_name": "delete_policy", + "full_name": "::Google::Iam::V2::Policies::Client#delete_policy", + "async": false, + "parameters": [ + { + "type": "::Google::Iam::V2::DeletePolicyRequest", + "name": "request" + } + ], + "result_type": "::Google::Longrunning::Operation", + "client": { + "short_name": "Policies::Client", + "full_name": "::Google::Iam::V2::Policies::Client" + }, + "method": { + "short_name": "DeletePolicy", + "full_name": "google.iam.v2.Policies.DeletePolicy", + "service": { + "short_name": "Policies", + "full_name": "google.iam.v2.Policies" + } + } + }, + "canonical": true, + "origin": "API_DEFINITION", + "segments": [ + { + "start": 20, + "end": 53, + "type": "FULL" + } + ] + } + ] +} \ No newline at end of file diff --git a/owl-bot-staging/google-iam-v2/test/google/iam/v2/policies_operations_test.rb b/owl-bot-staging/google-iam-v2/test/google/iam/v2/policies_operations_test.rb new file mode 100644 index 000000000000..ee66097c2e4e --- /dev/null +++ b/owl-bot-staging/google-iam-v2/test/google/iam/v2/policies_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/iam/v2/policy_pb" +require "google/iam/v2/policy_services_pb" +require "google/iam/v2/policies" + +class ::Google::Iam::V2::Policies::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::Iam::V2::Policies::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::Iam::V2::Policies::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::Iam::V2::Policies::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::Iam::V2::Policies::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::Iam::V2::Policies::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::Iam::V2::Policies::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::Iam::V2::Policies::Operations::Configuration, config + end +end diff --git a/owl-bot-staging/google-iam-v2/test/google/iam/v2/policies_rest_test.rb b/owl-bot-staging/google-iam-v2/test/google/iam/v2/policies_rest_test.rb new file mode 100644 index 000000000000..9e17bd6ea73b --- /dev/null +++ b/owl-bot-staging/google-iam-v2/test/google/iam/v2/policies_rest_test.rb @@ -0,0 +1,374 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/iam/v2/policy_pb" +require "google/iam/v2/policies/rest" + + +class ::Google::Iam::V2::Policies::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_policies + # Create test objects. + client_result = ::Google::Iam::V2::ListPoliciesResponse.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_policies_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::Iam::V2::Policies::Rest::ServiceStub.stub :transcode_list_policies_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, list_policies_client_stub do + # Create client + client = ::Google::Iam::V2::Policies::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.list_policies({ 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_policies 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_policies ::Google::Iam::V2::ListPoliciesRequest.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_policies({ 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_policies(::Google::Iam::V2::ListPoliciesRequest.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_policies_client_stub.call_count + end + end + end + + def test_get_policy + # Create test objects. + client_result = ::Google::Iam::V2::Policy.new + http_response = OpenStruct.new body: client_result.to_json + + call_options = {} + + # Create request parameters for a unary method. + name = "hello world" + + get_policy_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::Iam::V2::Policies::Rest::ServiceStub.stub :transcode_get_policy_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, get_policy_client_stub do + # Create client + client = ::Google::Iam::V2::Policies::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.get_policy({ name: name }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.get_policy name: name do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.get_policy ::Google::Iam::V2::GetPolicyRequest.new(name: name) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.get_policy({ name: name }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.get_policy(::Google::Iam::V2::GetPolicyRequest.new(name: name), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, get_policy_client_stub.call_count + end + end + end + + def test_create_policy + # 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" + policy = {} + policy_id = "hello world" + + create_policy_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::Iam::V2::Policies::Rest::ServiceStub.stub :transcode_create_policy_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, create_policy_client_stub do + # Create client + client = ::Google::Iam::V2::Policies::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.create_policy({ parent: parent, policy: policy, policy_id: policy_id }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.create_policy parent: parent, policy: policy, policy_id: policy_id do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.create_policy ::Google::Iam::V2::CreatePolicyRequest.new(parent: parent, policy: policy, policy_id: policy_id) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.create_policy({ parent: parent, policy: policy, policy_id: policy_id }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.create_policy(::Google::Iam::V2::CreatePolicyRequest.new(parent: parent, policy: policy, policy_id: policy_id), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, create_policy_client_stub.call_count + end + end + end + + def test_update_policy + # 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. + policy = {} + + update_policy_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::Iam::V2::Policies::Rest::ServiceStub.stub :transcode_update_policy_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, update_policy_client_stub do + # Create client + client = ::Google::Iam::V2::Policies::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.update_policy({ policy: policy }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.update_policy policy: policy do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.update_policy ::Google::Iam::V2::UpdatePolicyRequest.new(policy: policy) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.update_policy({ policy: policy }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.update_policy(::Google::Iam::V2::UpdatePolicyRequest.new(policy: policy), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, update_policy_client_stub.call_count + end + end + end + + def test_delete_policy + # 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" + etag = "hello world" + + delete_policy_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::Iam::V2::Policies::Rest::ServiceStub.stub :transcode_delete_policy_request, ["", "", {}] do + Gapic::Rest::ClientStub.stub :new, delete_policy_client_stub do + # Create client + client = ::Google::Iam::V2::Policies::Rest::Client.new do |config| + config.credentials = :dummy_value + end + + # Use hash object + client.delete_policy({ name: name, etag: etag }) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use named arguments + client.delete_policy name: name, etag: etag do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object + client.delete_policy ::Google::Iam::V2::DeletePolicyRequest.new(name: name, etag: etag) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use hash object with options + client.delete_policy({ name: name, etag: etag }, call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Use protobuf object with options + client.delete_policy(::Google::Iam::V2::DeletePolicyRequest.new(name: name, etag: etag), call_options) do |_result, response| + assert_equal http_response, response.underlying_op + end + + # Verify method calls + assert_equal 5, delete_policy_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::Iam::V2::Policies::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::Iam::V2::Policies::Rest::Client::Configuration, config + end +end diff --git a/owl-bot-staging/google-iam-v2/test/google/iam/v2/policies_test.rb b/owl-bot-staging/google-iam-v2/test/google/iam/v2/policies_test.rb new file mode 100644 index 000000000000..1be0f9fd672d --- /dev/null +++ b/owl-bot-staging/google-iam-v2/test/google/iam/v2/policies_test.rb @@ -0,0 +1,438 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/iam/v2/policy_pb" +require "google/iam/v2/policies" + +class ::Google::Iam::V2::Policies::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_policies + # Create GRPC objects. + grpc_response = ::Google::Iam::V2::ListPoliciesResponse.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_policies_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :list_policies, name + assert_kind_of ::Google::Iam::V2::ListPoliciesRequest, 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_policies_client_stub do + # Create client + client = ::Google::Iam::V2::Policies::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.list_policies({ 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_policies 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_policies ::Google::Iam::V2::ListPoliciesRequest.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_policies({ 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_policies(::Google::Iam::V2::ListPoliciesRequest.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_policies_client_stub.call_rpc_count + end + end + + def test_get_policy + # Create GRPC objects. + grpc_response = ::Google::Iam::V2::Policy.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_policy_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :get_policy, name + assert_kind_of ::Google::Iam::V2::GetPolicyRequest, request + assert_equal "hello world", request["name"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, get_policy_client_stub do + # Create client + client = ::Google::Iam::V2::Policies::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.get_policy({ name: name }) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use named arguments + client.get_policy name: name do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use protobuf object + client.get_policy ::Google::Iam::V2::GetPolicyRequest.new(name: name) do |response, operation| + assert_equal grpc_response, response + assert_equal grpc_operation, operation + end + + # Use hash object with options + client.get_policy({ 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_policy(::Google::Iam::V2::GetPolicyRequest.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_policy_client_stub.call_rpc_count + end + end + + def test_create_policy + # 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" + policy = {} + policy_id = "hello world" + + create_policy_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :create_policy, name + assert_kind_of ::Google::Iam::V2::CreatePolicyRequest, request + assert_equal "hello world", request["parent"] + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Iam::V2::Policy), request["policy"] + assert_equal "hello world", request["policy_id"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, create_policy_client_stub do + # Create client + client = ::Google::Iam::V2::Policies::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.create_policy({ parent: parent, policy: policy, policy_id: policy_id }) 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_policy parent: parent, policy: policy, policy_id: policy_id 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_policy ::Google::Iam::V2::CreatePolicyRequest.new(parent: parent, policy: policy, policy_id: policy_id) 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_policy({ parent: parent, policy: policy, policy_id: policy_id }, 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_policy(::Google::Iam::V2::CreatePolicyRequest.new(parent: parent, policy: policy, policy_id: policy_id), 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_policy_client_stub.call_rpc_count + end + end + + def test_update_policy + # 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. + policy = {} + + update_policy_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :update_policy, name + assert_kind_of ::Google::Iam::V2::UpdatePolicyRequest, request + assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Iam::V2::Policy), request["policy"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, update_policy_client_stub do + # Create client + client = ::Google::Iam::V2::Policies::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.update_policy({ policy: policy }) 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.update_policy policy: policy 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.update_policy ::Google::Iam::V2::UpdatePolicyRequest.new(policy: policy) 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.update_policy({ policy: policy }, 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.update_policy(::Google::Iam::V2::UpdatePolicyRequest.new(policy: policy), 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, update_policy_client_stub.call_rpc_count + end + end + + def test_delete_policy + # 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" + etag = "hello world" + + delete_policy_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| + assert_equal :delete_policy, name + assert_kind_of ::Google::Iam::V2::DeletePolicyRequest, request + assert_equal "hello world", request["name"] + assert_equal "hello world", request["etag"] + refute_nil options + end + + Gapic::ServiceStub.stub :new, delete_policy_client_stub do + # Create client + client = ::Google::Iam::V2::Policies::Client.new do |config| + config.credentials = grpc_channel + end + + # Use hash object + client.delete_policy({ name: name, etag: etag }) 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_policy name: name, etag: etag 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_policy ::Google::Iam::V2::DeletePolicyRequest.new(name: name, etag: etag) 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_policy({ name: name, etag: etag }, 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_policy(::Google::Iam::V2::DeletePolicyRequest.new(name: name, etag: etag), 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_policy_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::Iam::V2::Policies::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::Iam::V2::Policies::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::Iam::V2::Policies::Client.new do |config| + config.credentials = creds + end + assert_kind_of ::Google::Iam::V2::Policies::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::Iam::V2::Policies::Client.new do |config| + config.credentials = grpc_channel + end + end + + assert_kind_of ::Google::Iam::V2::Policies::Operations, client.operations_client + end +end diff --git a/owl-bot-staging/google-iam-v2/test/helper.rb b/owl-bot-staging/google-iam-v2/test/helper.rb new file mode 100644 index 000000000000..672b337030e7 --- /dev/null +++ b/owl-bot-staging/google-iam-v2/test/helper.rb @@ -0,0 +1,26 @@ +# frozen_string_literal: true + +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 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/mock" +require "minitest/rg" + +require "grpc" + +require "ostruct" From b71701ab4ae2e1210462255ff83252a5fd338cbb Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Wed, 1 Apr 2026 08:21:23 +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 --- .../proto_docs/google/api/client.rb | 4 + .../proto_docs/google/api/client.rb | 4 + .../proto_docs/google/api/client.rb | 4 + .../proto_docs/google/api/client.rb | 4 + .../proto_docs/google/api/client.rb | 4 + .../proto_docs/google/api/client.rb | 4 + .../proto_docs/google/api/client.rb | 4 + .../proto_docs/google/api/client.rb | 4 + .../proto_docs/google/api/client.rb | 4 + .../proto_docs/google/api/client.rb | 4 + .../proto_docs/google/api/client.rb | 4 + .../proto_docs/google/api/client.rb | 4 + .../proto_docs/google/api/client.rb | 4 + .../proto_docs/google/api/client.rb | 4 + .../proto_docs/google/api/client.rb | 4 + .../proto_docs/google/api/client.rb | 4 + .../proto_docs/google/api/client.rb | 4 + google-iam-v1/proto_docs/google/api/client.rb | 4 + .../proto_docs/google/api/client.rb | 4 + google-iam-v2/proto_docs/google/api/client.rb | 4 + .../google-cloud-vision-v1p3beta1/.gitignore | 22 - .../.repo-metadata.json | 18 - .../.rubocop.yml | 33 - .../google-cloud-vision-v1p3beta1/.toys.rb | 28 - .../google-cloud-vision-v1p3beta1/.yardopts | 12 - .../AUTHENTICATION.md | 122 - .../CHANGELOG.md | 2 - .../google-cloud-vision-v1p3beta1/Gemfile | 14 - .../google-cloud-vision-v1p3beta1/LICENSE.md | 201 - .../google-cloud-vision-v1p3beta1/README.md | 154 - .../google-cloud-vision-v1p3beta1/Rakefile | 169 - .../gapic_metadata.json | 127 - .../google-cloud-vision-v1p3beta1.gemspec | 28 - .../lib/google-cloud-vision-v1p3beta1.rb | 21 - .../lib/google/cloud/vision/v1p3beta1.rb | 46 - .../cloud/vision/v1p3beta1/geometry_pb.rb | 24 - .../cloud/vision/v1p3beta1/image_annotator.rb | 58 - .../v1p3beta1/image_annotator/client.rb | 590 - .../v1p3beta1/image_annotator/credentials.rb | 52 - .../v1p3beta1/image_annotator/operations.rb | 841 -- .../vision/v1p3beta1/image_annotator/paths.rb | 52 - .../vision/v1p3beta1/image_annotator/rest.rb | 55 - .../v1p3beta1/image_annotator/rest/client.rb | 549 - .../image_annotator/rest/operations.rb | 925 -- .../image_annotator/rest/service_stub.rb | 201 - .../vision/v1p3beta1/image_annotator_pb.rb | 72 - .../v1p3beta1/image_annotator_services_pb.rb | 55 - .../cloud/vision/v1p3beta1/product_search.rb | 69 - .../vision/v1p3beta1/product_search/client.rb | 2429 ----- .../v1p3beta1/product_search/credentials.rb | 52 - .../v1p3beta1/product_search/operations.rb | 841 -- .../vision/v1p3beta1/product_search/paths.rb | 109 - .../vision/v1p3beta1/product_search/rest.rb | 66 - .../v1p3beta1/product_search/rest/client.rb | 2260 ---- .../product_search/rest/operations.rb | 925 -- .../product_search/rest/service_stub.rb | 1187 -- .../vision/v1p3beta1/product_search_pb.rb | 30 - .../v1p3beta1/product_search_service_pb.rb | 62 - .../product_search_service_services_pb.rb | 222 - .../lib/google/cloud/vision/v1p3beta1/rest.rb | 38 - .../vision/v1p3beta1/text_annotation_pb.rb | 33 - .../google/cloud/vision/v1p3beta1/version.rb | 28 - .../vision/v1p3beta1/web_detection_pb.rb | 25 - .../proto_docs/README.md | 4 - .../proto_docs/google/api/client.rb | 593 - .../proto_docs/google/api/field_behavior.rb | 85 - .../proto_docs/google/api/launch_stage.rb | 71 - .../proto_docs/google/api/resource.rb | 227 - .../google/cloud/vision/v1p3beta1/geometry.rb | 82 - .../cloud/vision/v1p3beta1/image_annotator.rb | 888 -- .../cloud/vision/v1p3beta1/product_search.rb | 134 - .../v1p3beta1/product_search_service.rb | 630 -- .../cloud/vision/v1p3beta1/text_annotation.rb | 286 - .../cloud/vision/v1p3beta1/web_detection.rb | 120 - .../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 | 148 - .../proto_docs/google/rpc/status.rb | 48 - .../proto_docs/google/type/color.rb | 173 - .../proto_docs/google/type/latlng.rb | 38 - .../snippets/Gemfile | 32 - .../async_batch_annotate_files.rb | 54 - .../image_annotator/batch_annotate_images.rb | 47 - .../add_product_to_product_set.rb | 47 - .../snippets/product_search/create_product.rb | 47 - .../product_search/create_product_set.rb | 47 - .../product_search/create_reference_image.rb | 47 - .../snippets/product_search/delete_product.rb | 47 - .../product_search/delete_product_set.rb | 47 - .../product_search/delete_reference_image.rb | 47 - .../snippets/product_search/get_product.rb | 47 - .../product_search/get_product_set.rb | 47 - .../product_search/get_reference_image.rb | 47 - .../product_search/import_product_sets.rb | 54 - .../product_search/list_product_sets.rb | 51 - .../snippets/product_search/list_products.rb | 51 - .../list_products_in_product_set.rb | 51 - .../product_search/list_reference_images.rb | 51 - .../remove_product_from_product_set.rb | 47 - .../snippets/product_search/update_product.rb | 47 - .../product_search/update_product_set.rb | 47 - ...etadata_google.cloud.vision.v1p3beta1.json | 815 -- .../image_annotator_operations_test.rb | 400 - .../v1p3beta1/image_annotator_paths_test.rb | 55 - .../v1p3beta1/image_annotator_rest_test.rb | 207 - .../vision/v1p3beta1/image_annotator_test.rb | 239 - .../product_search_operations_test.rb | 400 - .../v1p3beta1/product_search_paths_test.rb | 91 - .../v1p3beta1/product_search_rest_test.rb | 1090 -- .../vision/v1p3beta1/product_search_test.rb | 1225 --- .../test/helper.rb | 26 - .../google-cloud-vision-v1p4beta1/.gitignore | 22 - .../.repo-metadata.json | 18 - .../.rubocop.yml | 33 - .../google-cloud-vision-v1p4beta1/.toys.rb | 28 - .../google-cloud-vision-v1p4beta1/.yardopts | 12 - .../AUTHENTICATION.md | 122 - .../CHANGELOG.md | 2 - .../google-cloud-vision-v1p4beta1/Gemfile | 14 - .../google-cloud-vision-v1p4beta1/LICENSE.md | 201 - .../google-cloud-vision-v1p4beta1/README.md | 154 - .../google-cloud-vision-v1p4beta1/Rakefile | 169 - .../gapic_metadata.json | 142 - .../google-cloud-vision-v1p4beta1.gemspec | 28 - .../lib/google-cloud-vision-v1p4beta1.rb | 21 - .../lib/google/cloud/vision/v1p4beta1.rb | 46 - .../google/cloud/vision/v1p4beta1/face_pb.rb | 25 - .../cloud/vision/v1p4beta1/geometry_pb.rb | 24 - .../cloud/vision/v1p4beta1/image_annotator.rb | 58 - .../v1p4beta1/image_annotator/client.rb | 794 -- .../v1p4beta1/image_annotator/credentials.rb | 52 - .../v1p4beta1/image_annotator/operations.rb | 841 -- .../vision/v1p4beta1/image_annotator/paths.rb | 52 - .../vision/v1p4beta1/image_annotator/rest.rb | 55 - .../v1p4beta1/image_annotator/rest/client.rb | 755 -- .../image_annotator/rest/operations.rb | 925 -- .../image_annotator/rest/service_stub.rb | 321 - .../vision/v1p4beta1/image_annotator_pb.rb | 78 - .../v1p4beta1/image_annotator_services_pb.rb | 73 - .../cloud/vision/v1p4beta1/product_search.rb | 73 - .../vision/v1p4beta1/product_search/client.rb | 2558 ----- .../v1p4beta1/product_search/credentials.rb | 52 - .../v1p4beta1/product_search/operations.rb | 841 -- .../vision/v1p4beta1/product_search/paths.rb | 109 - .../vision/v1p4beta1/product_search/rest.rb | 70 - .../v1p4beta1/product_search/rest/client.rb | 2382 ---- .../product_search/rest/operations.rb | 925 -- .../product_search/rest/service_stub.rb | 1249 --- .../vision/v1p4beta1/product_search_pb.rb | 30 - .../v1p4beta1/product_search_service_pb.rb | 64 - .../product_search_service_services_pb.rb | 236 - .../lib/google/cloud/vision/v1p4beta1/rest.rb | 38 - .../vision/v1p4beta1/text_annotation_pb.rb | 33 - .../google/cloud/vision/v1p4beta1/version.rb | 28 - .../vision/v1p4beta1/web_detection_pb.rb | 25 - .../proto_docs/README.md | 4 - .../proto_docs/google/api/client.rb | 593 - .../proto_docs/google/api/field_behavior.rb | 85 - .../proto_docs/google/api/launch_stage.rb | 71 - .../proto_docs/google/api/resource.rb | 227 - .../google/cloud/vision/v1p4beta1/face.rb | 68 - .../google/cloud/vision/v1p4beta1/geometry.rb | 82 - .../cloud/vision/v1p4beta1/image_annotator.rb | 994 -- .../cloud/vision/v1p4beta1/product_search.rb | 136 - .../v1p4beta1/product_search_service.rb | 680 -- .../cloud/vision/v1p4beta1/text_annotation.rb | 286 - .../cloud/vision/v1p4beta1/web_detection.rb | 121 - .../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 | 148 - .../proto_docs/google/rpc/status.rb | 48 - .../proto_docs/google/type/color.rb | 173 - .../proto_docs/google/type/latlng.rb | 38 - .../snippets/Gemfile | 32 - .../async_batch_annotate_files.rb | 54 - .../async_batch_annotate_images.rb | 54 - .../image_annotator/batch_annotate_files.rb | 47 - .../image_annotator/batch_annotate_images.rb | 47 - .../add_product_to_product_set.rb | 47 - .../snippets/product_search/create_product.rb | 47 - .../product_search/create_product_set.rb | 47 - .../product_search/create_reference_image.rb | 47 - .../snippets/product_search/delete_product.rb | 47 - .../product_search/delete_product_set.rb | 47 - .../product_search/delete_reference_image.rb | 47 - .../snippets/product_search/get_product.rb | 47 - .../product_search/get_product_set.rb | 47 - .../product_search/get_reference_image.rb | 47 - .../product_search/import_product_sets.rb | 54 - .../product_search/list_product_sets.rb | 51 - .../snippets/product_search/list_products.rb | 51 - .../list_products_in_product_set.rb | 51 - .../product_search/list_reference_images.rb | 51 - .../snippets/product_search/purge_products.rb | 54 - .../remove_product_from_product_set.rb | 47 - .../snippets/product_search/update_product.rb | 47 - .../product_search/update_product_set.rb | 47 - ...etadata_google.cloud.vision.v1p4beta1.json | 935 -- .../image_annotator_operations_test.rb | 400 - .../v1p4beta1/image_annotator_paths_test.rb | 55 - .../v1p4beta1/image_annotator_rest_test.rb | 316 - .../vision/v1p4beta1/image_annotator_test.rb | 362 - .../product_search_operations_test.rb | 400 - .../v1p4beta1/product_search_paths_test.rb | 91 - .../v1p4beta1/product_search_rest_test.rb | 1146 -- .../vision/v1p4beta1/product_search_test.rb | 1293 --- .../test/helper.rb | 26 - .../google-cloud-vision_ai-v1/.gitignore | 22 - .../.repo-metadata.json | 17 - .../google-cloud-vision_ai-v1/.rubocop.yml | 33 - .../google-cloud-vision_ai-v1/.toys.rb | 28 - .../google-cloud-vision_ai-v1/.yardopts | 12 - .../AUTHENTICATION.md | 122 - .../google-cloud-vision_ai-v1/CHANGELOG.md | 2 - .../google-cloud-vision_ai-v1/Gemfile | 14 - .../google-cloud-vision_ai-v1/LICENSE.md | 201 - .../google-cloud-vision_ai-v1/README.md | 154 - .../google-cloud-vision_ai-v1/Rakefile | 169 - .../gapic_metadata.json | 748 -- .../google-cloud-vision_ai-v1.gemspec | 30 - .../lib/google-cloud-vision_ai-v1.rb | 21 - .../lib/google/cloud/vision_ai/v1.rb | 50 - .../google/cloud/vision_ai/v1/app_platform.rb | 56 - .../cloud/vision_ai/v1/app_platform/client.rb | 3365 ------ .../vision_ai/v1/app_platform/credentials.rb | 47 - .../vision_ai/v1/app_platform/operations.rb | 841 -- .../cloud/vision_ai/v1/app_platform/paths.rb | 151 - .../cloud/vision_ai/v1/app_platform/rest.rb | 54 - .../vision_ai/v1/app_platform/rest/client.rb | 3148 ------ .../v1/app_platform/rest/operations.rb | 974 -- .../v1/app_platform/rest/service_stub.rb | 1682 --- .../cloud/vision_ai/v1/bindings_override.rb | 75 - .../vision_ai/v1/health_check_service.rb | 56 - .../v1/health_check_service/client.rb | 507 - .../v1/health_check_service/credentials.rb | 47 - .../v1/health_check_service/paths.rb | 52 - .../vision_ai/v1/health_check_service/rest.rb | 54 - .../v1/health_check_service/rest/client.rb | 465 - .../health_check_service/rest/service_stub.rb | 142 - .../vision_ai/v1/live_video_analytics.rb | 57 - .../v1/live_video_analytics/client.rb | 2423 ----- .../v1/live_video_analytics/credentials.rb | 47 - .../v1/live_video_analytics/operations.rb | 841 -- .../v1/live_video_analytics/paths.rb | 130 - .../vision_ai/v1/live_video_analytics/rest.rb | 55 - .../v1/live_video_analytics/rest/client.rb | 2262 ---- .../live_video_analytics/rest/operations.rb | 974 -- .../live_video_analytics/rest/service_stub.rb | 1187 -- .../lib/google/cloud/vision_ai/v1/rest.rb | 43 - .../cloud/vision_ai/v1/streaming_service.rb | 55 - .../vision_ai/v1/streaming_service/client.rb | 961 -- .../v1/streaming_service/credentials.rb | 47 - .../vision_ai/v1/streaming_service/paths.rb | 54 - .../vision_ai/v1/streaming_service/rest.rb | 53 - .../v1/streaming_service/rest/client.rb | 650 -- .../v1/streaming_service/rest/service_stub.rb | 267 - .../cloud/vision_ai/v1/streams_service.rb | 59 - .../vision_ai/v1/streams_service/client.rb | 2978 ----- .../v1/streams_service/credentials.rb | 47 - .../v1/streams_service/operations.rb | 841 -- .../vision_ai/v1/streams_service/paths.rb | 153 - .../vision_ai/v1/streams_service/rest.rb | 57 - .../v1/streams_service/rest/client.rb | 2782 ----- .../v1/streams_service/rest/operations.rb | 974 -- .../v1/streams_service/rest/service_stub.rb | 1495 --- .../lib/google/cloud/vision_ai/v1/version.rb | 28 - .../google/cloud/vision_ai/v1/warehouse.rb | 56 - .../cloud/vision_ai/v1/warehouse/client.rb | 6982 ------------ .../vision_ai/v1/warehouse/credentials.rb | 47 - .../vision_ai/v1/warehouse/operations.rb | 841 -- .../cloud/vision_ai/v1/warehouse/paths.rb | 237 - .../cloud/vision_ai/v1/warehouse/rest.rb | 54 - .../vision_ai/v1/warehouse/rest/client.rb | 6420 ----------- .../vision_ai/v1/warehouse/rest/operations.rb | 974 -- .../v1/warehouse/rest/service_stub.rb | 3896 ------- .../cloud/visionai/v1/annotations_pb.rb | 67 - .../lib/google/cloud/visionai/v1/common_pb.rb | 28 - .../cloud/visionai/v1/health_service_pb.rb | 27 - .../visionai/v1/health_service_services_pb.rb | 46 - .../lib/google/cloud/visionai/v1/lva_pb.rb | 33 - .../cloud/visionai/v1/lva_resources_pb.rb | 28 - .../cloud/visionai/v1/lva_service_pb.rb | 57 - .../visionai/v1/lva_service_services_pb.rb | 81 - .../google/cloud/visionai/v1/platform_pb.rb | 135 - .../cloud/visionai/v1/platform_services_pb.rb | 111 - .../visionai/v1/streaming_resources_pb.rb | 34 - .../cloud/visionai/v1/streaming_service_pb.rb | 47 - .../v1/streaming_service_services_pb.rb | 55 - .../cloud/visionai/v1/streams_resources_pb.rb | 30 - .../cloud/visionai/v1/streams_service_pb.rb | 60 - .../v1/streams_service_services_pb.rb | 92 - .../google/cloud/visionai/v1/warehouse_pb.rb | 222 - .../visionai/v1/warehouse_services_pb.rb | 228 - .../proto_docs/README.md | 4 - .../proto_docs/google/api/client.rb | 593 - .../proto_docs/google/api/field_behavior.rb | 85 - .../proto_docs/google/api/launch_stage.rb | 71 - .../proto_docs/google/api/resource.rb | 227 - .../google/cloud/visionai/v1/annotations.rb | 791 -- .../google/cloud/visionai/v1/common.rb | 134 - .../cloud/visionai/v1/health_service.rb | 61 - .../google/cloud/visionai/v1/lva.rb | 353 - .../google/cloud/visionai/v1/lva_resources.rb | 167 - .../google/cloud/visionai/v1/lva_service.rb | 543 - .../google/cloud/visionai/v1/platform.rb | 2272 ---- .../cloud/visionai/v1/streaming_resources.rb | 182 - .../cloud/visionai/v1/streaming_service.rb | 425 - .../cloud/visionai/v1/streams_resources.rb | 229 - .../cloud/visionai/v1/streams_service.rb | 644 -- .../google/cloud/visionai/v1/warehouse.rb | 3119 ------ .../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/struct.rb | 108 - .../proto_docs/google/protobuf/timestamp.rb | 127 - .../proto_docs/google/rpc/status.rb | 48 - .../proto_docs/google/type/datetime.rb | 104 - .../proto_docs/google/type/expr.rb | 75 - .../snippets/Gemfile | 32 - .../add_application_stream_input.rb | 54 - .../app_platform/create_application.rb | 54 - .../create_application_instances.rb | 54 - .../snippets/app_platform/create_draft.rb | 54 - .../snippets/app_platform/create_processor.rb | 54 - .../app_platform/delete_application.rb | 54 - .../delete_application_instances.rb | 54 - .../snippets/app_platform/delete_draft.rb | 54 - .../snippets/app_platform/delete_processor.rb | 54 - .../app_platform/deploy_application.rb | 54 - .../snippets/app_platform/get_application.rb | 47 - .../snippets/app_platform/get_draft.rb | 47 - .../snippets/app_platform/get_instance.rb | 47 - .../snippets/app_platform/get_processor.rb | 47 - .../app_platform/list_applications.rb | 51 - .../snippets/app_platform/list_drafts.rb | 51 - .../snippets/app_platform/list_instances.rb | 51 - .../app_platform/list_prebuilt_processors.rb | 47 - .../snippets/app_platform/list_processors.rb | 51 - .../remove_application_stream_input.rb | 54 - .../app_platform/undeploy_application.rb | 54 - .../app_platform/update_application.rb | 54 - .../update_application_instances.rb | 54 - .../update_application_stream_input.rb | 54 - .../snippets/app_platform/update_draft.rb | 54 - .../snippets/app_platform/update_processor.rb | 54 - .../health_check_service/health_check.rb | 47 - .../live_video_analytics/batch_run_process.rb | 54 - .../live_video_analytics/create_analysis.rb | 54 - .../live_video_analytics/create_operator.rb | 54 - .../live_video_analytics/create_process.rb | 54 - .../live_video_analytics/delete_analysis.rb | 54 - .../live_video_analytics/delete_operator.rb | 54 - .../live_video_analytics/delete_process.rb | 54 - .../live_video_analytics/get_analysis.rb | 47 - .../live_video_analytics/get_operator.rb | 47 - .../live_video_analytics/get_process.rb | 47 - .../live_video_analytics/list_analyses.rb | 51 - .../live_video_analytics/list_operators.rb | 51 - .../live_video_analytics/list_processes.rb | 51 - .../list_public_operators.rb | 51 - .../resolve_operator_info.rb | 47 - .../live_video_analytics/update_analysis.rb | 54 - .../live_video_analytics/update_operator.rb | 54 - .../live_video_analytics/update_process.rb | 54 - ...pet_metadata_google.cloud.visionai.v1.json | 5495 ---------- .../streaming_service/acquire_lease.rb | 47 - .../streaming_service/receive_events.rb | 56 - .../streaming_service/receive_packets.rb | 56 - .../streaming_service/release_lease.rb | 47 - .../snippets/streaming_service/renew_lease.rb | 47 - .../streaming_service/send_packets.rb | 56 - .../streams_service/create_cluster.rb | 54 - .../snippets/streams_service/create_event.rb | 54 - .../snippets/streams_service/create_series.rb | 54 - .../snippets/streams_service/create_stream.rb | 54 - .../streams_service/delete_cluster.rb | 54 - .../snippets/streams_service/delete_event.rb | 54 - .../snippets/streams_service/delete_series.rb | 54 - .../snippets/streams_service/delete_stream.rb | 54 - .../generate_stream_hls_token.rb | 47 - .../snippets/streams_service/get_cluster.rb | 47 - .../snippets/streams_service/get_event.rb | 47 - .../snippets/streams_service/get_series.rb | 47 - .../snippets/streams_service/get_stream.rb | 47 - .../streams_service/get_stream_thumbnail.rb | 54 - .../snippets/streams_service/list_clusters.rb | 51 - .../snippets/streams_service/list_events.rb | 51 - .../snippets/streams_service/list_series.rb | 51 - .../snippets/streams_service/list_streams.rb | 51 - .../streams_service/materialize_channel.rb | 54 - .../streams_service/update_cluster.rb | 54 - .../snippets/streams_service/update_event.rb | 54 - .../snippets/streams_service/update_series.rb | 54 - .../snippets/streams_service/update_stream.rb | 54 - .../snippets/warehouse/add_collection_item.rb | 47 - .../snippets/warehouse/analyze_asset.rb | 54 - .../snippets/warehouse/analyze_corpus.rb | 54 - .../snippets/warehouse/clip_asset.rb | 47 - .../snippets/warehouse/create_annotation.rb | 47 - .../snippets/warehouse/create_asset.rb | 47 - .../snippets/warehouse/create_collection.rb | 54 - .../snippets/warehouse/create_corpus.rb | 54 - .../snippets/warehouse/create_data_schema.rb | 47 - .../snippets/warehouse/create_index.rb | 54 - .../warehouse/create_index_endpoint.rb | 54 - .../warehouse/create_search_config.rb | 47 - .../warehouse/create_search_hypernym.rb | 47 - .../snippets/warehouse/delete_annotation.rb | 47 - .../snippets/warehouse/delete_asset.rb | 54 - .../snippets/warehouse/delete_collection.rb | 54 - .../snippets/warehouse/delete_corpus.rb | 47 - .../snippets/warehouse/delete_data_schema.rb | 47 - .../snippets/warehouse/delete_index.rb | 54 - .../warehouse/delete_index_endpoint.rb | 54 - .../warehouse/delete_search_config.rb | 47 - .../warehouse/delete_search_hypernym.rb | 47 - .../snippets/warehouse/deploy_index.rb | 54 - .../snippets/warehouse/generate_hls_uri.rb | 47 - .../warehouse/generate_retrieval_url.rb | 47 - .../snippets/warehouse/get_annotation.rb | 47 - .../snippets/warehouse/get_asset.rb | 47 - .../snippets/warehouse/get_collection.rb | 47 - .../snippets/warehouse/get_corpus.rb | 47 - .../snippets/warehouse/get_data_schema.rb | 47 - .../snippets/warehouse/get_index.rb | 47 - .../snippets/warehouse/get_index_endpoint.rb | 47 - .../snippets/warehouse/get_search_config.rb | 47 - .../snippets/warehouse/get_search_hypernym.rb | 47 - .../snippets/warehouse/import_assets.rb | 54 - .../snippets/warehouse/index_asset.rb | 54 - .../snippets/warehouse/ingest_asset.rb | 56 - .../snippets/warehouse/list_annotations.rb | 51 - .../snippets/warehouse/list_assets.rb | 51 - .../snippets/warehouse/list_collections.rb | 51 - .../snippets/warehouse/list_corpora.rb | 51 - .../snippets/warehouse/list_data_schemas.rb | 51 - .../warehouse/list_index_endpoints.rb | 51 - .../snippets/warehouse/list_indexes.rb | 51 - .../snippets/warehouse/list_search_configs.rb | 51 - .../warehouse/list_search_hypernyms.rb | 51 - .../warehouse/remove_collection_item.rb | 47 - .../snippets/warehouse/remove_index_asset.rb | 54 - .../snippets/warehouse/search_assets.rb | 51 - .../warehouse/search_index_endpoint.rb | 51 - .../snippets/warehouse/undeploy_index.rb | 54 - .../snippets/warehouse/update_annotation.rb | 47 - .../snippets/warehouse/update_asset.rb | 47 - .../snippets/warehouse/update_collection.rb | 47 - .../snippets/warehouse/update_corpus.rb | 47 - .../snippets/warehouse/update_data_schema.rb | 47 - .../snippets/warehouse/update_index.rb | 54 - .../warehouse/update_index_endpoint.rb | 54 - .../warehouse/update_search_config.rb | 47 - .../warehouse/update_search_hypernym.rb | 47 - .../snippets/warehouse/upload_asset.rb | 54 - .../warehouse/view_collection_items.rb | 51 - .../snippets/warehouse/view_indexed_assets.rb | 51 - .../v1/app_platform_operations_test.rb | 400 - .../vision_ai/v1/app_platform_paths_test.rb | 115 - .../vision_ai/v1/app_platform_rest_test.rb | 1557 --- .../cloud/vision_ai/v1/app_platform_test.rb | 1839 ---- .../v1/health_check_service_paths_test.rb | 55 - .../v1/health_check_service_rest_test.rb | 153 - .../vision_ai/v1/health_check_service_test.rb | 162 - .../live_video_analytics_operations_test.rb | 400 - .../v1/live_video_analytics_paths_test.rb | 103 - .../v1/live_video_analytics_rest_test.rb | 1109 -- .../vision_ai/v1/live_video_analytics_test.rb | 1308 --- .../v1/streaming_service_paths_test.rb | 55 - .../v1/streaming_service_rest_test.rb | 269 - .../vision_ai/v1/streaming_service_test.rb | 561 - .../v1/streams_service_operations_test.rb | 400 - .../v1/streams_service_paths_test.rb | 115 - .../vision_ai/v1/streams_service_rest_test.rb | 1387 --- .../vision_ai/v1/streams_service_test.rb | 1634 --- .../vision_ai/v1/warehouse_operations_test.rb | 400 - .../vision_ai/v1/warehouse_paths_test.rb | 163 - .../cloud/vision_ai/v1/warehouse_rest_test.rb | 3520 ------ .../cloud/vision_ai/v1/warehouse_test.rb | 4111 ------- .../google-cloud-vision_ai-v1/test/helper.rb | 26 - .../google-cloud-vm_migration-v1/.gitignore | 22 - .../.repo-metadata.json | 18 - .../google-cloud-vm_migration-v1/.rubocop.yml | 33 - .../google-cloud-vm_migration-v1/.toys.rb | 28 - .../google-cloud-vm_migration-v1/.yardopts | 12 - .../AUTHENTICATION.md | 122 - .../google-cloud-vm_migration-v1/CHANGELOG.md | 2 - .../google-cloud-vm_migration-v1/Gemfile | 14 - .../google-cloud-vm_migration-v1/LICENSE.md | 201 - .../google-cloud-vm_migration-v1/README.md | 154 - .../google-cloud-vm_migration-v1/Rakefile | 169 - .../gapic_metadata.json | 328 - .../google-cloud-vm_migration-v1.gemspec | 30 - .../lib/google-cloud-vm_migration-v1.rb | 22 - .../lib/google/cloud/vm_migration/v1.rb | 45 - .../vm_migration/v1/bindings_override.rb | 75 - .../lib/google/cloud/vm_migration/v1/rest.rb | 38 - .../google/cloud/vm_migration/v1/version.rb | 28 - .../cloud/vm_migration/v1/vm_migration.rb | 56 - .../vm_migration/v1/vm_migration/client.rb | 7173 ------------- .../v1/vm_migration/credentials.rb | 47 - .../v1/vm_migration/operations.rb | 841 -- .../vm_migration/v1/vm_migration/paths.rb | 355 - .../vm_migration/v1/vm_migration/rest.rb | 54 - .../v1/vm_migration/rest/client.rb | 6704 ------------ .../v1/vm_migration/rest/operations.rb | 925 -- .../v1/vm_migration/rest/service_stub.rb | 3891 ------- .../cloud/vmmigration/v1/vmmigration_pb.rb | 262 - .../vmmigration/v1/vmmigration_services_pb.rb | 203 - .../lib/google/iam/v1.rb | 43 - .../lib/google/iam/v1/bindings_override.rb | 73 - .../lib/google/iam/v1/iam_policy.rb | 76 - .../lib/google/iam/v1/iam_policy/client.rb | 727 -- .../google/iam/v1/iam_policy/credentials.rb | 42 - .../lib/google/iam/v1/iam_policy/rest.rb | 74 - .../google/iam/v1/iam_policy/rest/client.rb | 671 -- .../iam/v1/iam_policy/rest/service_stub.rb | 265 - .../lib/google/iam/v1/rest.rb | 36 - .../proto_docs/README.md | 4 - .../proto_docs/google/api/client.rb | 593 - .../proto_docs/google/api/field_behavior.rb | 85 - .../proto_docs/google/api/field_info.rb | 88 - .../proto_docs/google/api/launch_stage.rb | 71 - .../proto_docs/google/api/resource.rb | 227 - .../cloud/vmmigration/v1/vmmigration.rb | 4882 --------- .../proto_docs/google/iam/v1/iam_policy.rb | 87 - .../proto_docs/google/iam/v1/options.rb | 50 - .../proto_docs/google/iam/v1/policy.rb | 426 - .../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/rpc/error_details.rb | 420 - .../proto_docs/google/rpc/status.rb | 48 - .../proto_docs/google/type/expr.rb | 75 - .../snippets/Gemfile | 32 - .../snippets/iam_policy/get_iam_policy.rb | 47 - .../snippets/iam_policy/set_iam_policy.rb | 47 - .../iam_policy/test_iam_permissions.rb | 47 - ..._metadata_google.cloud.vmmigration.v1.json | 2495 ----- .../snippet_metadata_google.iam.v1.json | 135 - .../vm_migration/add_group_migration.rb | 54 - .../snippets/vm_migration/cancel_clone_job.rb | 54 - .../vm_migration/cancel_cutover_job.rb | 54 - .../vm_migration/cancel_disk_migration_job.rb | 54 - .../vm_migration/cancel_image_import_job.rb | 54 - .../snippets/vm_migration/create_clone_job.rb | 54 - .../vm_migration/create_cutover_job.rb | 54 - .../create_datacenter_connector.rb | 54 - .../vm_migration/create_disk_migration_job.rb | 54 - .../snippets/vm_migration/create_group.rb | 54 - .../vm_migration/create_image_import.rb | 54 - .../vm_migration/create_migrating_vm.rb | 54 - .../snippets/vm_migration/create_source.rb | 54 - .../vm_migration/create_target_project.rb | 54 - .../vm_migration/create_utilization_report.rb | 54 - .../delete_datacenter_connector.rb | 54 - .../vm_migration/delete_disk_migration_job.rb | 54 - .../snippets/vm_migration/delete_group.rb | 54 - .../vm_migration/delete_image_import.rb | 54 - .../vm_migration/delete_migrating_vm.rb | 54 - .../snippets/vm_migration/delete_source.rb | 54 - .../vm_migration/delete_target_project.rb | 54 - .../vm_migration/delete_utilization_report.rb | 54 - .../snippets/vm_migration/extend_migration.rb | 54 - .../snippets/vm_migration/fetch_inventory.rb | 47 - .../vm_migration/fetch_storage_inventory.rb | 51 - .../vm_migration/finalize_migration.rb | 54 - .../snippets/vm_migration/get_clone_job.rb | 47 - .../snippets/vm_migration/get_cutover_job.rb | 47 - .../vm_migration/get_datacenter_connector.rb | 47 - .../vm_migration/get_disk_migration_job.rb | 47 - .../snippets/vm_migration/get_group.rb | 47 - .../snippets/vm_migration/get_image_import.rb | 47 - .../vm_migration/get_image_import_job.rb | 47 - .../snippets/vm_migration/get_migrating_vm.rb | 47 - .../vm_migration/get_replication_cycle.rb | 47 - .../snippets/vm_migration/get_source.rb | 47 - .../vm_migration/get_target_project.rb | 47 - .../vm_migration/get_utilization_report.rb | 47 - .../snippets/vm_migration/list_clone_jobs.rb | 51 - .../vm_migration/list_cutover_jobs.rb | 51 - .../list_datacenter_connectors.rb | 51 - .../vm_migration/list_disk_migration_jobs.rb | 51 - .../snippets/vm_migration/list_groups.rb | 51 - .../vm_migration/list_image_import_jobs.rb | 51 - .../vm_migration/list_image_imports.rb | 51 - .../vm_migration/list_migrating_vms.rb | 51 - .../vm_migration/list_replication_cycles.rb | 51 - .../snippets/vm_migration/list_sources.rb | 51 - .../vm_migration/list_target_projects.rb | 51 - .../vm_migration/list_utilization_reports.rb | 51 - .../snippets/vm_migration/pause_migration.rb | 54 - .../vm_migration/remove_group_migration.rb | 54 - .../snippets/vm_migration/resume_migration.rb | 54 - .../vm_migration/run_disk_migration_job.rb | 54 - .../snippets/vm_migration/start_migration.rb | 54 - .../vm_migration/update_disk_migration_job.rb | 54 - .../snippets/vm_migration/update_group.rb | 54 - .../vm_migration/update_migrating_vm.rb | 54 - .../snippets/vm_migration/update_source.rb | 54 - .../vm_migration/update_target_project.rb | 54 - .../vm_migration/upgrade_appliance.rb | 54 - .../v1/vm_migration_operations_test.rb | 400 - .../v1/vm_migration_paths_test.rb | 235 - .../vm_migration/v1/vm_migration_rest_test.rb | 3553 ------ .../vm_migration/v1/vm_migration_test.rb | 4171 ------- .../google/iam/v1/iam_policy_rest_test.rb | 265 - .../test/google/iam/v1/iam_policy_test.rb | 286 - .../test/helper.rb | 26 - .../google-cloud-vmware_engine-v1/.gitignore | 22 - .../.repo-metadata.json | 17 - .../.rubocop.yml | 33 - .../google-cloud-vmware_engine-v1/.toys.rb | 28 - .../google-cloud-vmware_engine-v1/.yardopts | 12 - .../AUTHENTICATION.md | 122 - .../CHANGELOG.md | 2 - .../google-cloud-vmware_engine-v1/Gemfile | 14 - .../google-cloud-vmware_engine-v1/LICENSE.md | 201 - .../google-cloud-vmware_engine-v1/README.md | 154 - .../google-cloud-vmware_engine-v1/Rakefile | 169 - .../gapic_metadata.json | 388 - .../google-cloud-vmware_engine-v1.gemspec | 30 - .../lib/google-cloud-vmware_engine-v1.rb | 21 - .../lib/google/cloud/vmware_engine/v1.rb | 45 - .../vmware_engine/v1/bindings_override.rb | 156 - .../lib/google/cloud/vmware_engine/v1/rest.rb | 38 - .../google/cloud/vmware_engine/v1/version.rb | 28 - .../cloud/vmware_engine/v1/vmware_engine.rb | 56 - .../vmware_engine/v1/vmware_engine/client.rb | 9555 ----------------- .../v1/vmware_engine/credentials.rb | 47 - .../v1/vmware_engine/operations.rb | 841 -- .../vmware_engine/v1/vmware_engine/paths.rb | 387 - .../vmware_engine/v1/vmware_engine/rest.rb | 54 - .../v1/vmware_engine/rest/client.rb | 9003 ---------------- .../v1/vmware_engine/rest/operations.rb | 925 -- .../v1/vmware_engine/rest/service_stub.rb | 4624 -------- .../cloud/vmwareengine/v1/vmwareengine_pb.rb | 123 - .../v1/vmwareengine_resources_pb.rb | 90 - .../v1/vmwareengine_services_pb.rb | 313 - .../proto_docs/README.md | 4 - .../proto_docs/google/api/client.rb | 593 - .../proto_docs/google/api/field_behavior.rb | 85 - .../proto_docs/google/api/field_info.rb | 88 - .../proto_docs/google/api/launch_stage.rb | 71 - .../proto_docs/google/api/resource.rb | 227 - .../cloud/vmwareengine/v1/vmwareengine.rb | 2791 ----- .../vmwareengine/v1/vmwareengine_resources.rb | 1690 --- .../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/rpc/status.rb | 48 - .../proto_docs/google/type/expr.rb | 75 - .../snippets/Gemfile | 32 - ...metadata_google.cloud.vmwareengine.v1.json | 2975 ----- .../snippets/vmware_engine/create_cluster.rb | 54 - .../create_external_access_rule.rb | 54 - .../vmware_engine/create_external_address.rb | 54 - .../create_hcx_activation_key.rb | 54 - .../vmware_engine/create_logging_server.rb | 54 - .../create_management_dns_zone_binding.rb | 54 - .../vmware_engine/create_network_peering.rb | 54 - .../vmware_engine/create_network_policy.rb | 54 - .../vmware_engine/create_private_cloud.rb | 54 - .../create_private_connection.rb | 54 - .../create_vmware_engine_network.rb | 54 - .../snippets/vmware_engine/delete_cluster.rb | 54 - .../delete_external_access_rule.rb | 54 - .../vmware_engine/delete_external_address.rb | 54 - .../vmware_engine/delete_logging_server.rb | 54 - .../delete_management_dns_zone_binding.rb | 54 - .../vmware_engine/delete_network_peering.rb | 54 - .../vmware_engine/delete_network_policy.rb | 54 - .../vmware_engine/delete_private_cloud.rb | 54 - .../delete_private_connection.rb | 54 - .../delete_vmware_engine_network.rb | 54 - ...fetch_network_policy_external_addresses.rb | 51 - .../snippets/vmware_engine/get_cluster.rb | 47 - .../vmware_engine/get_dns_bind_permission.rb | 47 - .../vmware_engine/get_dns_forwarding.rb | 47 - .../vmware_engine/get_external_access_rule.rb | 47 - .../vmware_engine/get_external_address.rb | 47 - .../vmware_engine/get_hcx_activation_key.rb | 47 - .../vmware_engine/get_logging_server.rb | 47 - .../get_management_dns_zone_binding.rb | 47 - .../vmware_engine/get_network_peering.rb | 47 - .../vmware_engine/get_network_policy.rb | 47 - .../snippets/vmware_engine/get_node.rb | 47 - .../snippets/vmware_engine/get_node_type.rb | 47 - .../vmware_engine/get_private_cloud.rb | 47 - .../vmware_engine/get_private_connection.rb | 47 - .../snippets/vmware_engine/get_subnet.rb | 47 - .../get_vmware_engine_network.rb | 47 - .../grant_dns_bind_permission.rb | 54 - .../snippets/vmware_engine/list_clusters.rb | 51 - .../list_external_access_rules.rb | 51 - .../vmware_engine/list_external_addresses.rb | 51 - .../vmware_engine/list_hcx_activation_keys.rb | 51 - .../vmware_engine/list_logging_servers.rb | 51 - .../list_management_dns_zone_bindings.rb | 51 - .../vmware_engine/list_network_peerings.rb | 51 - .../vmware_engine/list_network_policies.rb | 51 - .../snippets/vmware_engine/list_node_types.rb | 51 - .../snippets/vmware_engine/list_nodes.rb | 51 - .../vmware_engine/list_peering_routes.rb | 51 - .../vmware_engine/list_private_clouds.rb | 51 - .../list_private_connection_peering_routes.rb | 51 - .../vmware_engine/list_private_connections.rb | 51 - .../snippets/vmware_engine/list_subnets.rb | 51 - .../list_vmware_engine_networks.rb | 51 - .../repair_management_dns_zone_binding.rb | 54 - .../vmware_engine/reset_nsx_credentials.rb | 54 - .../reset_vcenter_credentials.rb | 54 - .../revoke_dns_bind_permission.rb | 54 - .../vmware_engine/show_nsx_credentials.rb | 47 - .../vmware_engine/show_vcenter_credentials.rb | 47 - .../vmware_engine/undelete_private_cloud.rb | 54 - .../snippets/vmware_engine/update_cluster.rb | 54 - .../vmware_engine/update_dns_forwarding.rb | 54 - .../update_external_access_rule.rb | 54 - .../vmware_engine/update_external_address.rb | 54 - .../vmware_engine/update_logging_server.rb | 54 - .../update_management_dns_zone_binding.rb | 54 - .../vmware_engine/update_network_peering.rb | 54 - .../vmware_engine/update_network_policy.rb | 54 - .../vmware_engine/update_private_cloud.rb | 54 - .../update_private_connection.rb | 54 - .../snippets/vmware_engine/update_subnet.rb | 54 - .../update_vmware_engine_network.rb | 54 - .../v1/vmware_engine_operations_test.rb | 400 - .../v1/vmware_engine_paths_test.rb | 259 - .../v1/vmware_engine_rest_test.rb | 4233 -------- .../vmware_engine/v1/vmware_engine_test.rb | 4967 --------- .../test/helper.rb | 26 - .../google-cloud-vpc_access-v1/.gitignore | 22 - .../.repo-metadata.json | 18 - .../google-cloud-vpc_access-v1/.rubocop.yml | 33 - .../google-cloud-vpc_access-v1/.toys.rb | 28 - .../google-cloud-vpc_access-v1/.yardopts | 12 - .../AUTHENTICATION.md | 122 - .../google-cloud-vpc_access-v1/CHANGELOG.md | 2 - .../google-cloud-vpc_access-v1/Gemfile | 14 - .../google-cloud-vpc_access-v1/LICENSE.md | 201 - .../google-cloud-vpc_access-v1/README.md | 154 - .../google-cloud-vpc_access-v1/Rakefile | 169 - .../gapic_metadata.json | 38 - .../google-cloud-vpc_access-v1.gemspec | 29 - .../lib/google-cloud-vpc_access-v1.rb | 21 - .../lib/google/cloud/vpc_access/v1.rb | 45 - .../cloud/vpc_access/v1/bindings_override.rb | 64 - .../lib/google/cloud/vpc_access/v1/rest.rb | 38 - .../lib/google/cloud/vpc_access/v1/version.rb | 28 - .../cloud/vpc_access/v1/vpc_access_service.rb | 58 - .../v1/vpc_access_service/client.rb | 830 -- .../v1/vpc_access_service/credentials.rb | 51 - .../v1/vpc_access_service/operations.rb | 841 -- .../vpc_access/v1/vpc_access_service/paths.rb | 69 - .../vpc_access/v1/vpc_access_service/rest.rb | 56 - .../v1/vpc_access_service/rest/client.rb | 767 -- .../v1/vpc_access_service/rest/operations.rb | 925 -- .../vpc_access_service/rest/service_stub.rb | 326 - .../cloud/vpcaccess/v1/vpc_access_pb.rb | 36 - .../vpcaccess/v1/vpc_access_services_pb.rb | 55 - .../proto_docs/README.md | 4 - .../proto_docs/google/api/client.rb | 593 - .../proto_docs/google/api/field_behavior.rb | 85 - .../proto_docs/google/api/launch_stage.rb | 71 - .../proto_docs/google/api/resource.rb | 227 - .../google/cloud/vpcaccess/v1/vpc_access.rb | 185 - .../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/timestamp.rb | 127 - .../proto_docs/google/rpc/status.rb | 48 - .../snippets/Gemfile | 32 - ...et_metadata_google.cloud.vpcaccess.v1.json | 175 - .../vpc_access_service/create_connector.rb | 54 - .../vpc_access_service/delete_connector.rb | 54 - .../vpc_access_service/get_connector.rb | 47 - .../vpc_access_service/list_connectors.rb | 51 - .../v1/vpc_access_service_operations_test.rb | 400 - .../v1/vpc_access_service_paths_test.rb | 67 - .../v1/vpc_access_service_rest_test.rb | 319 - .../vpc_access/v1/vpc_access_service_test.rb | 373 - .../google-cloud-vpc_access-v1/test/helper.rb | 26 - .../google-cloud-web_risk-v1/.gitignore | 22 - .../.repo-metadata.json | 18 - .../google-cloud-web_risk-v1/.rubocop.yml | 33 - .../google-cloud-web_risk-v1/.toys.rb | 28 - .../google-cloud-web_risk-v1/.yardopts | 12 - .../AUTHENTICATION.md | 122 - .../google-cloud-web_risk-v1/CHANGELOG.md | 2 - .../google-cloud-web_risk-v1/Gemfile | 14 - .../google-cloud-web_risk-v1/LICENSE.md | 201 - .../google-cloud-web_risk-v1/README.md | 154 - .../google-cloud-web_risk-v1/Rakefile | 169 - .../gapic_metadata.json | 43 - .../google-cloud-web_risk-v1.gemspec | 28 - .../lib/google-cloud-web_risk-v1.rb | 21 - .../lib/google/cloud/web_risk/v1.rb | 45 - .../lib/google/cloud/web_risk/v1/rest.rb | 37 - .../lib/google/cloud/web_risk/v1/version.rb | 28 - .../cloud/web_risk/v1/web_risk_service.rb | 57 - .../web_risk/v1/web_risk_service/client.rb | 916 -- .../v1/web_risk_service/credentials.rb | 51 - .../v1/web_risk_service/operations.rb | 841 -- .../web_risk/v1/web_risk_service/paths.rb | 47 - .../web_risk/v1/web_risk_service/rest.rb | 54 - .../v1/web_risk_service/rest/client.rb | 862 -- .../v1/web_risk_service/rest/operations.rb | 925 -- .../v1/web_risk_service/rest/service_stub.rb | 382 - .../lib/google/cloud/webrisk/v1/webrisk_pb.rb | 58 - .../cloud/webrisk/v1/webrisk_services_pb.rb | 82 - .../proto_docs/README.md | 4 - .../proto_docs/google/api/client.rb | 593 - .../proto_docs/google/api/field_behavior.rb | 85 - .../proto_docs/google/api/launch_stage.rb | 71 - .../proto_docs/google/api/resource.rb | 227 - .../google/cloud/webrisk/v1/webrisk.rb | 528 - .../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/timestamp.rb | 127 - .../proto_docs/google/rpc/status.rb | 48 - .../google-cloud-web_risk-v1/snippets/Gemfile | 32 - ...ppet_metadata_google.cloud.webrisk.v1.json | 215 - .../compute_threat_list_diff.rb | 47 - .../web_risk_service/create_submission.rb | 47 - .../web_risk_service/search_hashes.rb | 47 - .../snippets/web_risk_service/search_uris.rb | 47 - .../snippets/web_risk_service/submit_uri.rb | 54 - .../v1/web_risk_service_operations_test.rb | 400 - .../v1/web_risk_service_paths_test.rb | 55 - .../web_risk/v1/web_risk_service_rest_test.rb | 377 - .../web_risk/v1/web_risk_service_test.rb | 429 - .../google-cloud-web_risk-v1/test/helper.rb | 26 - .../google-cloud-web_risk-v1beta1/.gitignore | 22 - .../.repo-metadata.json | 19 - .../.rubocop.yml | 33 - .../google-cloud-web_risk-v1beta1/.toys.rb | 28 - .../google-cloud-web_risk-v1beta1/.yardopts | 12 - .../AUTHENTICATION.md | 122 - .../CHANGELOG.md | 2 - .../google-cloud-web_risk-v1beta1/Gemfile | 14 - .../google-cloud-web_risk-v1beta1/LICENSE.md | 201 - .../google-cloud-web_risk-v1beta1/README.md | 154 - .../google-cloud-web_risk-v1beta1/Rakefile | 169 - .../gapic_metadata.json | 33 - .../google-cloud-web_risk-v1beta1.gemspec | 28 - .../lib/google-cloud-web_risk-v1beta1.rb | 21 - .../lib/google/cloud/web_risk/v1beta1.rb | 45 - .../lib/google/cloud/web_risk/v1beta1/rest.rb | 37 - .../google/cloud/web_risk/v1beta1/version.rb | 28 - .../web_risk/v1beta1/web_risk_service.rb | 55 - .../v1beta1/web_risk_service/client.rb | 662 -- .../v1beta1/web_risk_service/credentials.rb | 51 - .../web_risk/v1beta1/web_risk_service/rest.rb | 52 - .../v1beta1/web_risk_service/rest/client.rb | 622 -- .../web_risk_service/rest/service_stub.rb | 258 - .../cloud/webrisk/v1beta1/webrisk_pb.rb | 43 - .../webrisk/v1beta1/webrisk_services_pb.rb | 55 - .../proto_docs/README.md | 4 - .../proto_docs/google/api/client.rb | 593 - .../proto_docs/google/api/field_behavior.rb | 85 - .../proto_docs/google/api/launch_stage.rb | 71 - .../proto_docs/google/api/resource.rb | 227 - .../google/cloud/webrisk/v1beta1/webrisk.rb | 307 - .../proto_docs/google/protobuf/duration.rb | 98 - .../proto_docs/google/protobuf/timestamp.rb | 127 - .../snippets/Gemfile | 32 - ...metadata_google.cloud.webrisk.v1beta1.json | 135 - .../compute_threat_list_diff.rb | 47 - .../web_risk_service/search_hashes.rb | 47 - .../snippets/web_risk_service/search_uris.rb | 47 - .../v1beta1/web_risk_service_rest_test.rb | 265 - .../web_risk/v1beta1/web_risk_service_test.rb | 286 - .../test/helper.rb | 26 - .../.gitignore | 22 - .../.repo-metadata.json | 18 - .../.rubocop.yml | 33 - .../.toys.rb | 28 - .../.yardopts | 12 - .../AUTHENTICATION.md | 122 - .../CHANGELOG.md | 2 - .../Gemfile | 14 - .../LICENSE.md | 201 - .../README.md | 154 - .../Rakefile | 169 - .../gapic_metadata.json | 83 - ...ogle-cloud-web_security_scanner-v1.gemspec | 28 - .../google-cloud-web_security_scanner-v1.rb | 21 - .../google/cloud/web_security_scanner/v1.rb | 45 - .../cloud/web_security_scanner/v1/rest.rb | 37 - .../cloud/web_security_scanner/v1/version.rb | 28 - .../v1/web_security_scanner.rb | 56 - .../v1/web_security_scanner/client.rb | 1719 --- .../v1/web_security_scanner/credentials.rb | 51 - .../v1/web_security_scanner/rest.rb | 53 - .../v1/web_security_scanner/rest/client.rb | 1585 --- .../web_security_scanner/rest/service_stub.rb | 878 -- .../websecurityscanner/v1/crawled_url_pb.rb | 21 - .../websecurityscanner/v1/finding_addon_pb.rb | 30 - .../cloud/websecurityscanner/v1/finding_pb.rb | 26 - .../v1/finding_type_stats_pb.rb | 21 - .../v1/scan_config_error_pb.rb | 22 - .../websecurityscanner/v1/scan_config_pb.rb | 33 - .../v1/scan_run_error_trace_pb.rb | 24 - .../websecurityscanner/v1/scan_run_log_pb.rb | 24 - .../websecurityscanner/v1/scan_run_pb.rb | 27 - .../v1/scan_run_warning_trace_pb.rb | 22 - .../v1/web_security_scanner_pb.rb | 48 - .../v1/web_security_scanner_services_pb.rb | 72 - .../proto_docs/README.md | 4 - .../proto_docs/google/api/client.rb | 593 - .../proto_docs/google/api/field_behavior.rb | 85 - .../proto_docs/google/api/launch_stage.rb | 71 - .../proto_docs/google/api/resource.rb | 227 - .../websecurityscanner/v1/crawled_url.rb | 44 - .../cloud/websecurityscanner/v1/finding.rb | 117 - .../websecurityscanner/v1/finding_addon.rb | 191 - .../v1/finding_type_stats.rb | 39 - .../websecurityscanner/v1/scan_config.rb | 211 - .../v1/scan_config_error.rb | 191 - .../cloud/websecurityscanner/v1/scan_run.rb | 110 - .../v1/scan_run_error_trace.rb | 77 - .../websecurityscanner/v1/scan_run_log.rb | 56 - .../v1/scan_run_warning_trace.rb | 65 - .../v1/web_security_scanner.rb | 278 - .../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 - .../snippets/Gemfile | 32 - ...ta_google.cloud.websecurityscanner.v1.json | 535 - .../create_scan_config.rb | 47 - .../delete_scan_config.rb | 47 - .../web_security_scanner/get_finding.rb | 47 - .../web_security_scanner/get_scan_config.rb | 47 - .../web_security_scanner/get_scan_run.rb | 47 - .../web_security_scanner/list_crawled_urls.rb | 51 - .../list_finding_type_stats.rb | 47 - .../web_security_scanner/list_findings.rb | 51 - .../web_security_scanner/list_scan_configs.rb | 51 - .../web_security_scanner/list_scan_runs.rb | 51 - .../web_security_scanner/start_scan_run.rb | 47 - .../web_security_scanner/stop_scan_run.rb | 47 - .../update_scan_config.rb | 47 - .../v1/web_security_scanner_rest_test.rb | 812 -- .../v1/web_security_scanner_test.rb | 900 -- .../test/helper.rb | 26 - .../.gitignore | 22 - .../.repo-metadata.json | 18 - .../.rubocop.yml | 33 - .../.toys.rb | 28 - .../.yardopts | 12 - .../AUTHENTICATION.md | 122 - .../CHANGELOG.md | 2 - .../Gemfile | 14 - .../LICENSE.md | 201 - .../README.md | 154 - .../Rakefile | 169 - .../gapic_metadata.json | 83 - ...-cloud-web_security_scanner-v1beta.gemspec | 28 - ...oogle-cloud-web_security_scanner-v1beta.rb | 21 - .../cloud/web_security_scanner/v1beta.rb | 45 - .../cloud/web_security_scanner/v1beta/rest.rb | 37 - .../web_security_scanner/v1beta/version.rb | 28 - .../v1beta/web_security_scanner.rb | 57 - .../v1beta/web_security_scanner/client.rb | 1721 --- .../web_security_scanner/credentials.rb | 51 - .../v1beta/web_security_scanner/paths.rb | 104 - .../v1beta/web_security_scanner/rest.rb | 54 - .../web_security_scanner/rest/client.rb | 1587 --- .../web_security_scanner/rest/service_stub.rb | 878 -- .../v1beta/crawled_url_pb.rb | 21 - .../v1beta/finding_addon_pb.rb | 27 - .../websecurityscanner/v1beta/finding_pb.rb | 24 - .../v1beta/finding_type_stats_pb.rb | 21 - .../v1beta/scan_config_error_pb.rb | 22 - .../v1beta/scan_config_pb.rb | 34 - .../v1beta/scan_run_error_trace_pb.rb | 24 - .../websecurityscanner/v1beta/scan_run_pb.rb | 28 - .../v1beta/scan_run_warning_trace_pb.rb | 22 - .../v1beta/web_security_scanner_pb.rb | 50 - .../web_security_scanner_services_pb.rb | 73 - .../proto_docs/README.md | 4 - .../proto_docs/google/api/client.rb | 593 - .../proto_docs/google/api/field_behavior.rb | 85 - .../proto_docs/google/api/launch_stage.rb | 71 - .../proto_docs/google/api/resource.rb | 227 - .../websecurityscanner/v1beta/crawled_url.rb | 44 - .../websecurityscanner/v1beta/finding.rb | 93 - .../v1beta/finding_addon.rb | 111 - .../v1beta/finding_type_stats.rb | 39 - .../websecurityscanner/v1beta/scan_config.rb | 192 - .../v1beta/scan_config_error.rb | 191 - .../websecurityscanner/v1beta/scan_run.rb | 110 - .../v1beta/scan_run_error_trace.rb | 77 - .../v1beta/scan_run_warning_trace.rb | 62 - .../v1beta/web_security_scanner.rb | 278 - .../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 - .../snippets/Gemfile | 32 - ...oogle.cloud.websecurityscanner.v1beta.json | 535 - .../create_scan_config.rb | 47 - .../delete_scan_config.rb | 47 - .../web_security_scanner/get_finding.rb | 47 - .../web_security_scanner/get_scan_config.rb | 47 - .../web_security_scanner/get_scan_run.rb | 47 - .../web_security_scanner/list_crawled_urls.rb | 51 - .../list_finding_type_stats.rb | 47 - .../web_security_scanner/list_findings.rb | 51 - .../web_security_scanner/list_scan_configs.rb | 51 - .../web_security_scanner/list_scan_runs.rb | 51 - .../web_security_scanner/start_scan_run.rb | 47 - .../web_security_scanner/stop_scan_run.rb | 47 - .../update_scan_config.rb | 47 - .../v1beta/web_security_scanner_paths_test.rb | 91 - .../v1beta/web_security_scanner_rest_test.rb | 812 -- .../v1beta/web_security_scanner_test.rb | 900 -- .../test/helper.rb | 26 - .../.gitignore | 22 - .../.repo-metadata.json | 18 - .../.rubocop.yml | 33 - .../.toys.rb | 28 - .../.yardopts | 12 - .../AUTHENTICATION.md | 122 - .../CHANGELOG.md | 2 - .../Gemfile | 14 - .../LICENSE.md | 201 - .../README.md | 154 - .../Rakefile | 169 - .../gapic_metadata.json | 38 - ...ogle-cloud-workflows-executions-v1.gemspec | 28 - .../google-cloud-workflows-executions-v1.rb | 21 - .../google/cloud/workflows/executions/v1.rb | 47 - .../workflows/executions/v1/executions.rb | 58 - .../executions/v1/executions/client.rb | 802 -- .../executions/v1/executions/credentials.rb | 53 - .../executions/v1/executions/paths.rb | 75 - .../executions/v1/executions/rest.rb | 55 - .../executions/v1/executions/rest/client.rb | 731 -- .../v1/executions/rest/service_stub.rb | 329 - .../workflows/executions/v1/executions_pb.rb | 46 - .../executions/v1/executions_services_pb.rb | 57 - .../cloud/workflows/executions/v1/rest.rb | 39 - .../cloud/workflows/executions/v1/version.rb | 30 - .../proto_docs/README.md | 4 - .../proto_docs/google/api/client.rb | 593 - .../proto_docs/google/api/field_behavior.rb | 85 - .../proto_docs/google/api/launch_stage.rb | 71 - .../proto_docs/google/api/resource.rb | 227 - .../workflows/executions/v1/executions.rb | 369 - .../proto_docs/google/protobuf/duration.rb | 98 - .../proto_docs/google/protobuf/timestamp.rb | 127 - .../snippets/Gemfile | 32 - .../snippets/executions/cancel_execution.rb | 47 - .../snippets/executions/create_execution.rb | 47 - .../snippets/executions/get_execution.rb | 47 - .../snippets/executions/list_executions.rb | 51 - ..._google.cloud.workflows.executions.v1.json | 175 - .../executions/v1/executions_paths_test.rb | 67 - .../executions/v1/executions_rest_test.rb | 322 - .../executions/v1/executions_test.rb | 355 - .../test/helper.rb | 26 - .../.gitignore | 22 - .../.repo-metadata.json | 18 - .../.rubocop.yml | 33 - .../.toys.rb | 28 - .../.yardopts | 12 - .../AUTHENTICATION.md | 122 - .../CHANGELOG.md | 2 - .../Gemfile | 14 - .../LICENSE.md | 201 - .../README.md | 154 - .../Rakefile | 169 - .../gapic_metadata.json | 38 - ...-cloud-workflows-executions-v1beta.gemspec | 28 - ...oogle-cloud-workflows-executions-v1beta.rb | 21 - .../cloud/workflows/executions/v1beta.rb | 42 - .../workflows/executions/v1beta/executions.rb | 52 - .../executions/v1beta/executions/client.rb | 789 -- .../v1beta/executions/credentials.rb | 53 - .../executions/v1beta/executions/paths.rb | 75 - .../executions/v1beta/executions_pb.rb | 37 - .../v1beta/executions_services_pb.rb | 57 - .../workflows/executions/v1beta/version.rb | 30 - .../proto_docs/README.md | 4 - .../proto_docs/google/api/client.rb | 593 - .../proto_docs/google/api/field_behavior.rb | 85 - .../proto_docs/google/api/launch_stage.rb | 71 - .../proto_docs/google/api/resource.rb | 227 - .../workflows/executions/v1beta/executions.rb | 200 - .../proto_docs/google/protobuf/duration.rb | 98 - .../proto_docs/google/protobuf/timestamp.rb | 127 - .../snippets/Gemfile | 32 - .../snippets/executions/cancel_execution.rb | 47 - .../snippets/executions/create_execution.rb | 47 - .../snippets/executions/get_execution.rb | 47 - .../snippets/executions/list_executions.rb | 51 - ...gle.cloud.workflows.executions.v1beta.json | 175 - .../v1beta/executions_paths_test.rb | 67 - .../executions/v1beta/executions_test.rb | 351 - .../test/helper.rb | 26 - .../google-cloud-workflows-v1/.gitignore | 22 - .../.repo-metadata.json | 18 - .../google-cloud-workflows-v1/.rubocop.yml | 33 - .../google-cloud-workflows-v1/.toys.rb | 28 - .../google-cloud-workflows-v1/.yardopts | 12 - .../AUTHENTICATION.md | 122 - .../google-cloud-workflows-v1/CHANGELOG.md | 2 - .../google-cloud-workflows-v1/Gemfile | 14 - .../google-cloud-workflows-v1/LICENSE.md | 201 - .../google-cloud-workflows-v1/README.md | 154 - .../google-cloud-workflows-v1/Rakefile | 169 - .../gapic_metadata.json | 48 - .../google-cloud-workflows-v1.gemspec | 29 - .../lib/google-cloud-workflows-v1.rb | 21 - .../lib/google/cloud/workflows/v1.rb | 45 - .../cloud/workflows/v1/bindings_override.rb | 75 - .../lib/google/cloud/workflows/v1/rest.rb | 38 - .../lib/google/cloud/workflows/v1/version.rb | 28 - .../google/cloud/workflows/v1/workflows.rb | 58 - .../cloud/workflows/v1/workflows/client.rb | 1074 -- .../workflows/v1/workflows/credentials.rb | 51 - .../workflows/v1/workflows/operations.rb | 841 -- .../cloud/workflows/v1/workflows/paths.rb | 113 - .../cloud/workflows/v1/workflows/rest.rb | 56 - .../workflows/v1/workflows/rest/client.rb | 997 -- .../workflows/v1/workflows/rest/operations.rb | 925 -- .../v1/workflows/rest/service_stub.rb | 449 - .../google/cloud/workflows/v1/workflows_pb.rb | 44 - .../workflows/v1/workflows_services_pb.rb | 66 - .../proto_docs/README.md | 4 - .../proto_docs/google/api/client.rb | 593 - .../proto_docs/google/api/field_behavior.rb | 85 - .../proto_docs/google/api/launch_stage.rb | 71 - .../proto_docs/google/api/resource.rb | 227 - .../google/cloud/workflows/v1/workflows.rb | 424 - .../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/rpc/status.rb | 48 - .../snippets/Gemfile | 32 - ...et_metadata_google.cloud.workflows.v1.json | 255 - .../snippets/workflows/create_workflow.rb | 54 - .../snippets/workflows/delete_workflow.rb | 54 - .../snippets/workflows/get_workflow.rb | 47 - .../workflows/list_workflow_revisions.rb | 51 - .../snippets/workflows/list_workflows.rb | 51 - .../snippets/workflows/update_workflow.rb | 54 - .../workflows/v1/workflows_operations_test.rb | 400 - .../workflows/v1/workflows_paths_test.rb | 91 - .../cloud/workflows/v1/workflows_rest_test.rb | 433 - .../cloud/workflows/v1/workflows_test.rb | 511 - .../google-cloud-workflows-v1/test/helper.rb | 26 - .../google-cloud-workflows-v1beta/.gitignore | 22 - .../.repo-metadata.json | 18 - .../.rubocop.yml | 33 - .../google-cloud-workflows-v1beta/.toys.rb | 28 - .../google-cloud-workflows-v1beta/.yardopts | 12 - .../AUTHENTICATION.md | 122 - .../CHANGELOG.md | 2 - .../google-cloud-workflows-v1beta/Gemfile | 14 - .../google-cloud-workflows-v1beta/LICENSE.md | 201 - .../google-cloud-workflows-v1beta/README.md | 154 - .../google-cloud-workflows-v1beta/Rakefile | 169 - .../gapic_metadata.json | 43 - .../google-cloud-workflows-v1beta.gemspec | 29 - .../lib/google-cloud-workflows-v1beta.rb | 21 - .../lib/google/cloud/workflows/v1beta.rb | 45 - .../workflows/v1beta/bindings_override.rb | 75 - .../lib/google/cloud/workflows/v1beta/rest.rb | 38 - .../google/cloud/workflows/v1beta/version.rb | 28 - .../cloud/workflows/v1beta/workflows.rb | 58 - .../workflows/v1beta/workflows/client.rb | 952 -- .../workflows/v1beta/workflows/credentials.rb | 51 - .../workflows/v1beta/workflows/operations.rb | 841 -- .../cloud/workflows/v1beta/workflows/paths.rb | 69 - .../cloud/workflows/v1beta/workflows/rest.rb | 56 - .../workflows/v1beta/workflows/rest/client.rb | 882 -- .../v1beta/workflows/rest/operations.rb | 925 -- .../v1beta/workflows/rest/service_stub.rb | 388 - .../cloud/workflows/v1beta/workflows_pb.rb | 38 - .../workflows/v1beta/workflows_services_pb.rb | 64 - .../proto_docs/README.md | 4 - .../proto_docs/google/api/client.rb | 593 - .../proto_docs/google/api/field_behavior.rb | 85 - .../proto_docs/google/api/launch_stage.rb | 71 - .../proto_docs/google/api/resource.rb | 227 - .../cloud/workflows/v1beta/workflows.rb | 245 - .../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/rpc/status.rb | 48 - .../snippets/Gemfile | 32 - ...etadata_google.cloud.workflows.v1beta.json | 215 - .../snippets/workflows/create_workflow.rb | 54 - .../snippets/workflows/delete_workflow.rb | 54 - .../snippets/workflows/get_workflow.rb | 47 - .../snippets/workflows/list_workflows.rb | 51 - .../snippets/workflows/update_workflow.rb | 54 - .../v1beta/workflows_operations_test.rb | 400 - .../workflows/v1beta/workflows_paths_test.rb | 67 - .../workflows/v1beta/workflows_rest_test.rb | 376 - .../cloud/workflows/v1beta/workflows_test.rb | 442 - .../test/helper.rb | 26 - .../google-cloud-workstations-v1/.gitignore | 22 - .../.repo-metadata.json | 17 - .../google-cloud-workstations-v1/.rubocop.yml | 33 - .../google-cloud-workstations-v1/.toys.rb | 28 - .../google-cloud-workstations-v1/.yardopts | 12 - .../AUTHENTICATION.md | 122 - .../google-cloud-workstations-v1/CHANGELOG.md | 2 - .../google-cloud-workstations-v1/Gemfile | 14 - .../google-cloud-workstations-v1/LICENSE.md | 201 - .../google-cloud-workstations-v1/README.md | 153 - .../google-cloud-workstations-v1/Rakefile | 169 - .../gapic_metadata.json | 118 - .../google-cloud-workstations-v1.gemspec | 30 - .../lib/google-cloud-workstations-v1.rb | 21 - .../lib/google/cloud/workstations/v1.rb | 45 - .../workstations/v1/bindings_override.rb | 110 - .../lib/google/cloud/workstations/v1/rest.rb | 38 - .../google/cloud/workstations/v1/version.rb | 28 - .../cloud/workstations/v1/workstations.rb | 56 - .../workstations/v1/workstations/client.rb | 2595 ----- .../v1/workstations/credentials.rb | 47 - .../v1/workstations/operations.rb | 841 -- .../workstations/v1/workstations/paths.rb | 113 - .../workstations/v1/workstations/rest.rb | 54 - .../v1/workstations/rest/client.rb | 2420 ----- .../v1/workstations/rest/operations.rb | 925 -- .../v1/workstations/rest/service_stub.rb | 1310 --- .../cloud/workstations/v1/workstations_pb.rb | 72 - .../v1/workstations_services_pb.rb | 86 - .../proto_docs/README.md | 4 - .../proto_docs/google/api/client.rb | 593 - .../proto_docs/google/api/field_behavior.rb | 85 - .../proto_docs/google/api/launch_stage.rb | 71 - .../proto_docs/google/api/resource.rb | 227 - .../cloud/workstations/v1/workstations.rb | 1177 -- .../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/rpc/status.rb | 48 - .../proto_docs/google/type/expr.rb | 75 - .../snippets/Gemfile | 32 - ...metadata_google.cloud.workstations.v1.json | 815 -- .../workstations/create_workstation.rb | 54 - .../create_workstation_cluster.rb | 54 - .../workstations/create_workstation_config.rb | 54 - .../workstations/delete_workstation.rb | 54 - .../delete_workstation_cluster.rb | 54 - .../workstations/delete_workstation_config.rb | 54 - .../workstations/generate_access_token.rb | 47 - .../snippets/workstations/get_workstation.rb | 47 - .../workstations/get_workstation_cluster.rb | 47 - .../workstations/get_workstation_config.rb | 47 - .../list_usable_workstation_configs.rb | 51 - .../workstations/list_usable_workstations.rb | 51 - .../workstations/list_workstation_clusters.rb | 51 - .../workstations/list_workstation_configs.rb | 51 - .../workstations/list_workstations.rb | 51 - .../workstations/start_workstation.rb | 54 - .../snippets/workstations/stop_workstation.rb | 54 - .../workstations/update_workstation.rb | 54 - .../update_workstation_cluster.rb | 54 - .../workstations/update_workstation_config.rb | 54 - .../v1/workstations_operations_test.rb | 400 - .../v1/workstations_paths_test.rb | 91 - .../workstations/v1/workstations_rest_test.rb | 1220 --- .../workstations/v1/workstations_test.rb | 1441 --- .../test/helper.rb | 26 - .../.gitignore | 22 - .../.repo-metadata.json | 17 - .../.rubocop.yml | 33 - .../google-cloud-workstations-v1beta/.toys.rb | 28 - .../.yardopts | 12 - .../AUTHENTICATION.md | 122 - .../CHANGELOG.md | 2 - .../google-cloud-workstations-v1beta/Gemfile | 14 - .../LICENSE.md | 201 - .../README.md | 153 - .../google-cloud-workstations-v1beta/Rakefile | 169 - .../gapic_metadata.json | 118 - .../google-cloud-workstations-v1beta.gemspec | 30 - .../lib/google-cloud-workstations-v1beta.rb | 21 - .../lib/google/cloud/workstations/v1beta.rb | 45 - .../workstations/v1beta/bindings_override.rb | 110 - .../google/cloud/workstations/v1beta/rest.rb | 38 - .../cloud/workstations/v1beta/version.rb | 28 - .../cloud/workstations/v1beta/workstations.rb | 56 - .../v1beta/workstations/client.rb | 2595 ----- .../v1beta/workstations/credentials.rb | 47 - .../v1beta/workstations/operations.rb | 841 -- .../workstations/v1beta/workstations/paths.rb | 113 - .../workstations/v1beta/workstations/rest.rb | 54 - .../v1beta/workstations/rest/client.rb | 2420 ----- .../v1beta/workstations/rest/operations.rb | 925 -- .../v1beta/workstations/rest/service_stub.rb | 1310 --- .../workstations/v1beta/workstations_pb.rb | 75 - .../v1beta/workstations_services_pb.rb | 86 - .../proto_docs/README.md | 4 - .../proto_docs/google/api/client.rb | 593 - .../proto_docs/google/api/field_behavior.rb | 85 - .../proto_docs/google/api/launch_stage.rb | 71 - .../proto_docs/google/api/resource.rb | 227 - .../cloud/workstations/v1beta/workstations.rb | 1265 --- .../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/rpc/status.rb | 48 - .../proto_docs/google/type/expr.rb | 75 - .../snippets/Gemfile | 32 - ...data_google.cloud.workstations.v1beta.json | 815 -- .../workstations/create_workstation.rb | 54 - .../create_workstation_cluster.rb | 54 - .../workstations/create_workstation_config.rb | 54 - .../workstations/delete_workstation.rb | 54 - .../delete_workstation_cluster.rb | 54 - .../workstations/delete_workstation_config.rb | 54 - .../workstations/generate_access_token.rb | 47 - .../snippets/workstations/get_workstation.rb | 47 - .../workstations/get_workstation_cluster.rb | 47 - .../workstations/get_workstation_config.rb | 47 - .../list_usable_workstation_configs.rb | 51 - .../workstations/list_usable_workstations.rb | 51 - .../workstations/list_workstation_clusters.rb | 51 - .../workstations/list_workstation_configs.rb | 51 - .../workstations/list_workstations.rb | 51 - .../workstations/start_workstation.rb | 54 - .../snippets/workstations/stop_workstation.rb | 54 - .../workstations/update_workstation.rb | 54 - .../update_workstation_cluster.rb | 54 - .../workstations/update_workstation_config.rb | 54 - .../v1beta/workstations_operations_test.rb | 400 - .../v1beta/workstations_paths_test.rb | 91 - .../v1beta/workstations_rest_test.rb | 1220 --- .../workstations/v1beta/workstations_test.rb | 1441 --- .../test/helper.rb | 26 - .../google-iam-credentials-v1/.gitignore | 22 - .../.repo-metadata.json | 18 - .../google-iam-credentials-v1/.rubocop.yml | 33 - .../google-iam-credentials-v1/.toys.rb | 28 - .../google-iam-credentials-v1/.yardopts | 12 - .../AUTHENTICATION.md | 122 - .../google-iam-credentials-v1/CHANGELOG.md | 2 - .../google-iam-credentials-v1/Gemfile | 14 - .../google-iam-credentials-v1/LICENSE.md | 201 - .../google-iam-credentials-v1/README.md | 154 - .../google-iam-credentials-v1/Rakefile | 169 - .../gapic_metadata.json | 38 - .../google-iam-credentials-v1.gemspec | 28 - .../lib/google-iam-credentials-v1.rb | 21 - .../lib/google/iam/credentials/v1.rb | 45 - .../google/iam/credentials/v1/common_pb.rb | 33 - .../iam/credentials/v1/iam_credentials.rb | 63 - .../credentials/v1/iam_credentials/client.rb | 854 -- .../v1/iam_credentials/credentials.rb | 51 - .../credentials/v1/iam_credentials/paths.rb | 50 - .../credentials/v1/iam_credentials/rest.rb | 60 - .../v1/iam_credentials/rest/client.rb | 783 -- .../v1/iam_credentials/rest/service_stub.rb | 329 - .../iam/credentials/v1/iamcredentials_pb.rb | 24 - .../v1/iamcredentials_services_pb.rb | 59 - .../lib/google/iam/credentials/v1/rest.rb | 37 - .../lib/google/iam/credentials/v1/version.rb | 28 - .../proto_docs/README.md | 4 - .../proto_docs/google/api/client.rb | 593 - .../proto_docs/google/api/field_behavior.rb | 85 - .../proto_docs/google/api/launch_stage.rb | 71 - .../proto_docs/google/api/resource.rb | 227 - .../google/iam/credentials/v1/common.rb | 186 - .../proto_docs/google/protobuf/duration.rb | 98 - .../proto_docs/google/protobuf/timestamp.rb | 127 - .../snippets/Gemfile | 32 - .../iam_credentials/generate_access_token.rb | 47 - .../iam_credentials/generate_id_token.rb | 47 - .../snippets/iam_credentials/sign_blob.rb | 47 - .../snippets/iam_credentials/sign_jwt.rb | 47 - ...et_metadata_google.iam.credentials.v1.json | 175 - .../v1/iam_credentials_paths_test.rb | 55 - .../v1/iam_credentials_rest_test.rb | 325 - .../credentials/v1/iam_credentials_test.rb | 356 - .../google-iam-credentials-v1/test/helper.rb | 26 - owl-bot-staging/google-iam-v1/.gitignore | 22 - .../google-iam-v1/.repo-metadata.json | 15 - owl-bot-staging/google-iam-v1/.rubocop.yml | 33 - owl-bot-staging/google-iam-v1/.toys.rb | 28 - owl-bot-staging/google-iam-v1/.yardopts | 12 - .../google-iam-v1/AUTHENTICATION.md | 122 - owl-bot-staging/google-iam-v1/CHANGELOG.md | 2 - owl-bot-staging/google-iam-v1/Gemfile | 14 - owl-bot-staging/google-iam-v1/LICENSE.md | 201 - owl-bot-staging/google-iam-v1/README.md | 151 - owl-bot-staging/google-iam-v1/Rakefile | 169 - .../google-iam-v1/gapic_metadata.json | 33 - .../google-iam-v1/google-iam-v1.gemspec | 29 - .../google-iam-v1/lib/google-iam-v1.rb | 21 - .../google-iam-v1/lib/google/iam/v1.rb | 43 - .../lib/google/iam/v1/iam_policy.rb | 76 - .../lib/google/iam/v1/iam_policy/client.rb | 711 -- .../google/iam/v1/iam_policy/credentials.rb | 42 - .../lib/google/iam/v1/iam_policy/rest.rb | 73 - .../google/iam/v1/iam_policy/rest/client.rb | 660 -- .../iam/v1/iam_policy/rest/service_stub.rb | 280 - .../lib/google/iam/v1/iam_policy_pb.rb | 30 - .../google/iam/v1/iam_policy_services_pb.rb | 82 - .../google/iam/v1/logging/audit_data_pb.rb | 23 - .../lib/google/iam/v1/options_pb.rb | 19 - .../lib/google/iam/v1/policy_pb.rb | 30 - .../iam/v1/resource_policy_member_pb.rb | 21 - .../google-iam-v1/lib/google/iam/v1/rest.rb | 35 - .../lib/google/iam/v1/version.rb | 26 - .../google-iam-v1/proto_docs/README.md | 4 - .../proto_docs/google/api/client.rb | 593 - .../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/iam/v1/iam_policy.rb | 87 - .../proto_docs/google/iam/v1/options.rb | 50 - .../proto_docs/google/iam/v1/policy.rb | 426 - .../google/iam/v1/resource_policy_member.rb | 49 - .../proto_docs/google/protobuf/duration.rb | 98 - .../proto_docs/google/protobuf/field_mask.rb | 229 - .../proto_docs/google/type/expr.rb | 75 - .../google-iam-v1/snippets/Gemfile | 32 - .../snippets/iam_policy/get_iam_policy.rb | 47 - .../snippets/iam_policy/set_iam_policy.rb | 47 - .../iam_policy/test_iam_permissions.rb | 47 - .../snippet_metadata_google.iam.v1.json | 135 - .../google/iam/v1/iam_policy_rest_test.rb | 265 - .../test/google/iam/v1/iam_policy_test.rb | 286 - owl-bot-staging/google-iam-v1/test/helper.rb | 26 - owl-bot-staging/google-iam-v1beta/.gitignore | 22 - .../google-iam-v1beta/.repo-metadata.json | 18 - .../google-iam-v1beta/.rubocop.yml | 33 - owl-bot-staging/google-iam-v1beta/.toys.rb | 28 - owl-bot-staging/google-iam-v1beta/.yardopts | 12 - .../google-iam-v1beta/AUTHENTICATION.md | 122 - .../google-iam-v1beta/CHANGELOG.md | 2 - owl-bot-staging/google-iam-v1beta/Gemfile | 14 - owl-bot-staging/google-iam-v1beta/LICENSE.md | 201 - owl-bot-staging/google-iam-v1beta/README.md | 154 - owl-bot-staging/google-iam-v1beta/Rakefile | 169 - .../google-iam-v1beta/gapic_metadata.json | 78 - .../google-iam-v1beta.gemspec | 28 - .../lib/google-iam-v1beta.rb | 21 - .../lib/google/iam/v1beta.rb | 38 - .../lib/google/iam/v1beta/version.rb | 26 - .../iam/v1beta/workload_identity_pool_pb.rb | 47 - .../workload_identity_pool_services_pb.rb | 103 - .../iam/v1beta/workload_identity_pools.rb | 48 - .../v1beta/workload_identity_pools/client.rb | 1718 --- .../workload_identity_pools/credentials.rb | 49 - .../workload_identity_pools/operations.rb | 839 -- .../v1beta/workload_identity_pools/paths.rb | 85 - .../google-iam-v1beta/proto_docs/README.md | 4 - .../proto_docs/google/api/client.rb | 593 - .../proto_docs/google/api/field_behavior.rb | 85 - .../proto_docs/google/api/launch_stage.rb | 71 - .../proto_docs/google/api/resource.rb | 227 - .../iam/v1beta/workload_identity_pool.rb | 467 - .../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/rpc/status.rb | 48 - .../google-iam-v1beta/snippets/Gemfile | 32 - .../snippet_metadata_google.iam.v1beta.json | 495 - .../create_workload_identity_pool.rb | 54 - .../create_workload_identity_pool_provider.rb | 54 - .../delete_workload_identity_pool.rb | 54 - .../delete_workload_identity_pool_provider.rb | 54 - .../get_workload_identity_pool.rb | 47 - .../get_workload_identity_pool_provider.rb | 47 - .../list_workload_identity_pool_providers.rb | 51 - .../list_workload_identity_pools.rb | 51 - .../undelete_workload_identity_pool.rb | 54 - ...ndelete_workload_identity_pool_provider.rb | 54 - .../update_workload_identity_pool.rb | 54 - .../update_workload_identity_pool_provider.rb | 54 - ...workload_identity_pools_operations_test.rb | 400 - .../workload_identity_pools_paths_test.rb | 79 - .../v1beta/workload_identity_pools_test.rb | 888 -- .../google-iam-v1beta/test/helper.rb | 26 - owl-bot-staging/google-iam-v2/.gitignore | 22 - .../google-iam-v2/.repo-metadata.json | 17 - owl-bot-staging/google-iam-v2/.rubocop.yml | 33 - owl-bot-staging/google-iam-v2/.toys.rb | 28 - owl-bot-staging/google-iam-v2/.yardopts | 12 - .../google-iam-v2/AUTHENTICATION.md | 122 - owl-bot-staging/google-iam-v2/CHANGELOG.md | 2 - owl-bot-staging/google-iam-v2/Gemfile | 14 - owl-bot-staging/google-iam-v2/LICENSE.md | 201 - owl-bot-staging/google-iam-v2/README.md | 154 - owl-bot-staging/google-iam-v2/Rakefile | 169 - .../google-iam-v2/gapic_metadata.json | 43 - .../google-iam-v2/google-iam-v2.gemspec | 28 - .../google-iam-v2/lib/google-iam-v2.rb | 21 - .../google-iam-v2/lib/google/iam/v2.rb | 43 - .../lib/google/iam/v2/deny_pb.rb | 21 - .../lib/google/iam/v2/policies.rb | 53 - .../lib/google/iam/v2/policies/client.rb | 987 -- .../lib/google/iam/v2/policies/credentials.rb | 45 - .../lib/google/iam/v2/policies/operations.rb | 839 -- .../lib/google/iam/v2/policies/rest.rb | 50 - .../lib/google/iam/v2/policies/rest/client.rb | 909 -- .../google/iam/v2/policies/rest/operations.rb | 923 -- .../iam/v2/policies/rest/service_stub.rb | 386 - .../lib/google/iam/v2/policy_pb.rb | 34 - .../lib/google/iam/v2/policy_services_pb.rb | 65 - .../google-iam-v2/lib/google/iam/v2/rest.rb | 35 - .../lib/google/iam/v2/version.rb | 26 - .../google-iam-v2/proto_docs/README.md | 4 - .../proto_docs/google/api/client.rb | 593 - .../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/iam/v2/deny.rb | 110 - .../proto_docs/google/iam/v2/policy.rb | 241 - .../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/timestamp.rb | 127 - .../proto_docs/google/rpc/status.rb | 48 - .../proto_docs/google/type/expr.rb | 75 - .../google-iam-v2/snippets/Gemfile | 32 - .../snippets/policies/create_policy.rb | 54 - .../snippets/policies/delete_policy.rb | 54 - .../snippets/policies/get_policy.rb | 47 - .../snippets/policies/list_policies.rb | 51 - .../snippets/policies/update_policy.rb | 54 - .../snippet_metadata_google.iam.v2.json | 215 - .../google/iam/v2/policies_operations_test.rb | 400 - .../test/google/iam/v2/policies_rest_test.rb | 374 - .../test/google/iam/v2/policies_test.rb | 438 - owl-bot-staging/google-iam-v2/test/helper.rb | 26 - 1572 files changed, 80 insertions(+), 382359 deletions(-) delete mode 100644 owl-bot-staging/google-cloud-vision-v1p3beta1/.gitignore delete mode 100644 owl-bot-staging/google-cloud-vision-v1p3beta1/.repo-metadata.json delete mode 100644 owl-bot-staging/google-cloud-vision-v1p3beta1/.rubocop.yml delete mode 100644 owl-bot-staging/google-cloud-vision-v1p3beta1/.toys.rb delete mode 100644 owl-bot-staging/google-cloud-vision-v1p3beta1/.yardopts delete mode 100644 owl-bot-staging/google-cloud-vision-v1p3beta1/AUTHENTICATION.md delete mode 100644 owl-bot-staging/google-cloud-vision-v1p3beta1/CHANGELOG.md delete mode 100644 owl-bot-staging/google-cloud-vision-v1p3beta1/Gemfile delete mode 100644 owl-bot-staging/google-cloud-vision-v1p3beta1/LICENSE.md delete mode 100644 owl-bot-staging/google-cloud-vision-v1p3beta1/README.md delete mode 100644 owl-bot-staging/google-cloud-vision-v1p3beta1/Rakefile delete mode 100644 owl-bot-staging/google-cloud-vision-v1p3beta1/gapic_metadata.json delete mode 100644 owl-bot-staging/google-cloud-vision-v1p3beta1/google-cloud-vision-v1p3beta1.gemspec delete mode 100644 owl-bot-staging/google-cloud-vision-v1p3beta1/lib/google-cloud-vision-v1p3beta1.rb delete mode 100644 owl-bot-staging/google-cloud-vision-v1p3beta1/lib/google/cloud/vision/v1p3beta1.rb delete mode 100644 owl-bot-staging/google-cloud-vision-v1p3beta1/lib/google/cloud/vision/v1p3beta1/geometry_pb.rb delete mode 100644 owl-bot-staging/google-cloud-vision-v1p3beta1/lib/google/cloud/vision/v1p3beta1/image_annotator.rb delete mode 100644 owl-bot-staging/google-cloud-vision-v1p3beta1/lib/google/cloud/vision/v1p3beta1/image_annotator/client.rb delete mode 100644 owl-bot-staging/google-cloud-vision-v1p3beta1/lib/google/cloud/vision/v1p3beta1/image_annotator/credentials.rb delete mode 100644 owl-bot-staging/google-cloud-vision-v1p3beta1/lib/google/cloud/vision/v1p3beta1/image_annotator/operations.rb delete mode 100644 owl-bot-staging/google-cloud-vision-v1p3beta1/lib/google/cloud/vision/v1p3beta1/image_annotator/paths.rb delete mode 100644 owl-bot-staging/google-cloud-vision-v1p3beta1/lib/google/cloud/vision/v1p3beta1/image_annotator/rest.rb delete mode 100644 owl-bot-staging/google-cloud-vision-v1p3beta1/lib/google/cloud/vision/v1p3beta1/image_annotator/rest/client.rb delete mode 100644 owl-bot-staging/google-cloud-vision-v1p3beta1/lib/google/cloud/vision/v1p3beta1/image_annotator/rest/operations.rb delete mode 100644 owl-bot-staging/google-cloud-vision-v1p3beta1/lib/google/cloud/vision/v1p3beta1/image_annotator/rest/service_stub.rb delete mode 100644 owl-bot-staging/google-cloud-vision-v1p3beta1/lib/google/cloud/vision/v1p3beta1/image_annotator_pb.rb delete mode 100644 owl-bot-staging/google-cloud-vision-v1p3beta1/lib/google/cloud/vision/v1p3beta1/image_annotator_services_pb.rb delete mode 100644 owl-bot-staging/google-cloud-vision-v1p3beta1/lib/google/cloud/vision/v1p3beta1/product_search.rb delete mode 100644 owl-bot-staging/google-cloud-vision-v1p3beta1/lib/google/cloud/vision/v1p3beta1/product_search/client.rb delete mode 100644 owl-bot-staging/google-cloud-vision-v1p3beta1/lib/google/cloud/vision/v1p3beta1/product_search/credentials.rb delete mode 100644 owl-bot-staging/google-cloud-vision-v1p3beta1/lib/google/cloud/vision/v1p3beta1/product_search/operations.rb delete mode 100644 owl-bot-staging/google-cloud-vision-v1p3beta1/lib/google/cloud/vision/v1p3beta1/product_search/paths.rb delete mode 100644 owl-bot-staging/google-cloud-vision-v1p3beta1/lib/google/cloud/vision/v1p3beta1/product_search/rest.rb delete mode 100644 owl-bot-staging/google-cloud-vision-v1p3beta1/lib/google/cloud/vision/v1p3beta1/product_search/rest/client.rb delete mode 100644 owl-bot-staging/google-cloud-vision-v1p3beta1/lib/google/cloud/vision/v1p3beta1/product_search/rest/operations.rb delete mode 100644 owl-bot-staging/google-cloud-vision-v1p3beta1/lib/google/cloud/vision/v1p3beta1/product_search/rest/service_stub.rb delete mode 100644 owl-bot-staging/google-cloud-vision-v1p3beta1/lib/google/cloud/vision/v1p3beta1/product_search_pb.rb delete mode 100644 owl-bot-staging/google-cloud-vision-v1p3beta1/lib/google/cloud/vision/v1p3beta1/product_search_service_pb.rb delete mode 100644 owl-bot-staging/google-cloud-vision-v1p3beta1/lib/google/cloud/vision/v1p3beta1/product_search_service_services_pb.rb delete mode 100644 owl-bot-staging/google-cloud-vision-v1p3beta1/lib/google/cloud/vision/v1p3beta1/rest.rb delete mode 100644 owl-bot-staging/google-cloud-vision-v1p3beta1/lib/google/cloud/vision/v1p3beta1/text_annotation_pb.rb delete mode 100644 owl-bot-staging/google-cloud-vision-v1p3beta1/lib/google/cloud/vision/v1p3beta1/version.rb delete mode 100644 owl-bot-staging/google-cloud-vision-v1p3beta1/lib/google/cloud/vision/v1p3beta1/web_detection_pb.rb delete mode 100644 owl-bot-staging/google-cloud-vision-v1p3beta1/proto_docs/README.md delete mode 100644 owl-bot-staging/google-cloud-vision-v1p3beta1/proto_docs/google/api/client.rb delete mode 100644 owl-bot-staging/google-cloud-vision-v1p3beta1/proto_docs/google/api/field_behavior.rb delete mode 100644 owl-bot-staging/google-cloud-vision-v1p3beta1/proto_docs/google/api/launch_stage.rb delete mode 100644 owl-bot-staging/google-cloud-vision-v1p3beta1/proto_docs/google/api/resource.rb delete mode 100644 owl-bot-staging/google-cloud-vision-v1p3beta1/proto_docs/google/cloud/vision/v1p3beta1/geometry.rb delete mode 100644 owl-bot-staging/google-cloud-vision-v1p3beta1/proto_docs/google/cloud/vision/v1p3beta1/image_annotator.rb delete mode 100644 owl-bot-staging/google-cloud-vision-v1p3beta1/proto_docs/google/cloud/vision/v1p3beta1/product_search.rb delete mode 100644 owl-bot-staging/google-cloud-vision-v1p3beta1/proto_docs/google/cloud/vision/v1p3beta1/product_search_service.rb delete mode 100644 owl-bot-staging/google-cloud-vision-v1p3beta1/proto_docs/google/cloud/vision/v1p3beta1/text_annotation.rb delete mode 100644 owl-bot-staging/google-cloud-vision-v1p3beta1/proto_docs/google/cloud/vision/v1p3beta1/web_detection.rb delete mode 100644 owl-bot-staging/google-cloud-vision-v1p3beta1/proto_docs/google/longrunning/operations.rb delete mode 100644 owl-bot-staging/google-cloud-vision-v1p3beta1/proto_docs/google/protobuf/any.rb delete mode 100644 owl-bot-staging/google-cloud-vision-v1p3beta1/proto_docs/google/protobuf/duration.rb delete mode 100644 owl-bot-staging/google-cloud-vision-v1p3beta1/proto_docs/google/protobuf/empty.rb delete mode 100644 owl-bot-staging/google-cloud-vision-v1p3beta1/proto_docs/google/protobuf/field_mask.rb delete mode 100644 owl-bot-staging/google-cloud-vision-v1p3beta1/proto_docs/google/protobuf/timestamp.rb delete mode 100644 owl-bot-staging/google-cloud-vision-v1p3beta1/proto_docs/google/protobuf/wrappers.rb delete mode 100644 owl-bot-staging/google-cloud-vision-v1p3beta1/proto_docs/google/rpc/status.rb delete mode 100644 owl-bot-staging/google-cloud-vision-v1p3beta1/proto_docs/google/type/color.rb delete mode 100644 owl-bot-staging/google-cloud-vision-v1p3beta1/proto_docs/google/type/latlng.rb delete mode 100644 owl-bot-staging/google-cloud-vision-v1p3beta1/snippets/Gemfile delete mode 100644 owl-bot-staging/google-cloud-vision-v1p3beta1/snippets/image_annotator/async_batch_annotate_files.rb delete mode 100644 owl-bot-staging/google-cloud-vision-v1p3beta1/snippets/image_annotator/batch_annotate_images.rb delete mode 100644 owl-bot-staging/google-cloud-vision-v1p3beta1/snippets/product_search/add_product_to_product_set.rb delete mode 100644 owl-bot-staging/google-cloud-vision-v1p3beta1/snippets/product_search/create_product.rb delete mode 100644 owl-bot-staging/google-cloud-vision-v1p3beta1/snippets/product_search/create_product_set.rb delete mode 100644 owl-bot-staging/google-cloud-vision-v1p3beta1/snippets/product_search/create_reference_image.rb delete mode 100644 owl-bot-staging/google-cloud-vision-v1p3beta1/snippets/product_search/delete_product.rb delete mode 100644 owl-bot-staging/google-cloud-vision-v1p3beta1/snippets/product_search/delete_product_set.rb delete mode 100644 owl-bot-staging/google-cloud-vision-v1p3beta1/snippets/product_search/delete_reference_image.rb delete mode 100644 owl-bot-staging/google-cloud-vision-v1p3beta1/snippets/product_search/get_product.rb delete mode 100644 owl-bot-staging/google-cloud-vision-v1p3beta1/snippets/product_search/get_product_set.rb delete mode 100644 owl-bot-staging/google-cloud-vision-v1p3beta1/snippets/product_search/get_reference_image.rb delete mode 100644 owl-bot-staging/google-cloud-vision-v1p3beta1/snippets/product_search/import_product_sets.rb delete mode 100644 owl-bot-staging/google-cloud-vision-v1p3beta1/snippets/product_search/list_product_sets.rb delete mode 100644 owl-bot-staging/google-cloud-vision-v1p3beta1/snippets/product_search/list_products.rb delete mode 100644 owl-bot-staging/google-cloud-vision-v1p3beta1/snippets/product_search/list_products_in_product_set.rb delete mode 100644 owl-bot-staging/google-cloud-vision-v1p3beta1/snippets/product_search/list_reference_images.rb delete mode 100644 owl-bot-staging/google-cloud-vision-v1p3beta1/snippets/product_search/remove_product_from_product_set.rb delete mode 100644 owl-bot-staging/google-cloud-vision-v1p3beta1/snippets/product_search/update_product.rb delete mode 100644 owl-bot-staging/google-cloud-vision-v1p3beta1/snippets/product_search/update_product_set.rb delete mode 100644 owl-bot-staging/google-cloud-vision-v1p3beta1/snippets/snippet_metadata_google.cloud.vision.v1p3beta1.json delete mode 100644 owl-bot-staging/google-cloud-vision-v1p3beta1/test/google/cloud/vision/v1p3beta1/image_annotator_operations_test.rb delete mode 100644 owl-bot-staging/google-cloud-vision-v1p3beta1/test/google/cloud/vision/v1p3beta1/image_annotator_paths_test.rb delete mode 100644 owl-bot-staging/google-cloud-vision-v1p3beta1/test/google/cloud/vision/v1p3beta1/image_annotator_rest_test.rb delete mode 100644 owl-bot-staging/google-cloud-vision-v1p3beta1/test/google/cloud/vision/v1p3beta1/image_annotator_test.rb delete mode 100644 owl-bot-staging/google-cloud-vision-v1p3beta1/test/google/cloud/vision/v1p3beta1/product_search_operations_test.rb delete mode 100644 owl-bot-staging/google-cloud-vision-v1p3beta1/test/google/cloud/vision/v1p3beta1/product_search_paths_test.rb delete mode 100644 owl-bot-staging/google-cloud-vision-v1p3beta1/test/google/cloud/vision/v1p3beta1/product_search_rest_test.rb delete mode 100644 owl-bot-staging/google-cloud-vision-v1p3beta1/test/google/cloud/vision/v1p3beta1/product_search_test.rb delete mode 100644 owl-bot-staging/google-cloud-vision-v1p3beta1/test/helper.rb delete mode 100644 owl-bot-staging/google-cloud-vision-v1p4beta1/.gitignore delete mode 100644 owl-bot-staging/google-cloud-vision-v1p4beta1/.repo-metadata.json delete mode 100644 owl-bot-staging/google-cloud-vision-v1p4beta1/.rubocop.yml delete mode 100644 owl-bot-staging/google-cloud-vision-v1p4beta1/.toys.rb delete mode 100644 owl-bot-staging/google-cloud-vision-v1p4beta1/.yardopts delete mode 100644 owl-bot-staging/google-cloud-vision-v1p4beta1/AUTHENTICATION.md delete mode 100644 owl-bot-staging/google-cloud-vision-v1p4beta1/CHANGELOG.md delete mode 100644 owl-bot-staging/google-cloud-vision-v1p4beta1/Gemfile delete mode 100644 owl-bot-staging/google-cloud-vision-v1p4beta1/LICENSE.md delete mode 100644 owl-bot-staging/google-cloud-vision-v1p4beta1/README.md delete mode 100644 owl-bot-staging/google-cloud-vision-v1p4beta1/Rakefile delete mode 100644 owl-bot-staging/google-cloud-vision-v1p4beta1/gapic_metadata.json delete mode 100644 owl-bot-staging/google-cloud-vision-v1p4beta1/google-cloud-vision-v1p4beta1.gemspec delete mode 100644 owl-bot-staging/google-cloud-vision-v1p4beta1/lib/google-cloud-vision-v1p4beta1.rb delete mode 100644 owl-bot-staging/google-cloud-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1.rb delete mode 100644 owl-bot-staging/google-cloud-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1/face_pb.rb delete mode 100644 owl-bot-staging/google-cloud-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1/geometry_pb.rb delete mode 100644 owl-bot-staging/google-cloud-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1/image_annotator.rb delete mode 100644 owl-bot-staging/google-cloud-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1/image_annotator/client.rb delete mode 100644 owl-bot-staging/google-cloud-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1/image_annotator/credentials.rb delete mode 100644 owl-bot-staging/google-cloud-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1/image_annotator/operations.rb delete mode 100644 owl-bot-staging/google-cloud-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1/image_annotator/paths.rb delete mode 100644 owl-bot-staging/google-cloud-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1/image_annotator/rest.rb delete mode 100644 owl-bot-staging/google-cloud-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1/image_annotator/rest/client.rb delete mode 100644 owl-bot-staging/google-cloud-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1/image_annotator/rest/operations.rb delete mode 100644 owl-bot-staging/google-cloud-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1/image_annotator/rest/service_stub.rb delete mode 100644 owl-bot-staging/google-cloud-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1/image_annotator_pb.rb delete mode 100644 owl-bot-staging/google-cloud-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1/image_annotator_services_pb.rb delete mode 100644 owl-bot-staging/google-cloud-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1/product_search.rb delete mode 100644 owl-bot-staging/google-cloud-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1/product_search/client.rb delete mode 100644 owl-bot-staging/google-cloud-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1/product_search/credentials.rb delete mode 100644 owl-bot-staging/google-cloud-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1/product_search/operations.rb delete mode 100644 owl-bot-staging/google-cloud-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1/product_search/paths.rb delete mode 100644 owl-bot-staging/google-cloud-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1/product_search/rest.rb delete mode 100644 owl-bot-staging/google-cloud-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1/product_search/rest/client.rb delete mode 100644 owl-bot-staging/google-cloud-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1/product_search/rest/operations.rb delete mode 100644 owl-bot-staging/google-cloud-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1/product_search/rest/service_stub.rb delete mode 100644 owl-bot-staging/google-cloud-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1/product_search_pb.rb delete mode 100644 owl-bot-staging/google-cloud-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1/product_search_service_pb.rb delete mode 100644 owl-bot-staging/google-cloud-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1/product_search_service_services_pb.rb delete mode 100644 owl-bot-staging/google-cloud-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1/rest.rb delete mode 100644 owl-bot-staging/google-cloud-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1/text_annotation_pb.rb delete mode 100644 owl-bot-staging/google-cloud-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1/version.rb delete mode 100644 owl-bot-staging/google-cloud-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1/web_detection_pb.rb delete mode 100644 owl-bot-staging/google-cloud-vision-v1p4beta1/proto_docs/README.md delete mode 100644 owl-bot-staging/google-cloud-vision-v1p4beta1/proto_docs/google/api/client.rb delete mode 100644 owl-bot-staging/google-cloud-vision-v1p4beta1/proto_docs/google/api/field_behavior.rb delete mode 100644 owl-bot-staging/google-cloud-vision-v1p4beta1/proto_docs/google/api/launch_stage.rb delete mode 100644 owl-bot-staging/google-cloud-vision-v1p4beta1/proto_docs/google/api/resource.rb delete mode 100644 owl-bot-staging/google-cloud-vision-v1p4beta1/proto_docs/google/cloud/vision/v1p4beta1/face.rb delete mode 100644 owl-bot-staging/google-cloud-vision-v1p4beta1/proto_docs/google/cloud/vision/v1p4beta1/geometry.rb delete mode 100644 owl-bot-staging/google-cloud-vision-v1p4beta1/proto_docs/google/cloud/vision/v1p4beta1/image_annotator.rb delete mode 100644 owl-bot-staging/google-cloud-vision-v1p4beta1/proto_docs/google/cloud/vision/v1p4beta1/product_search.rb delete mode 100644 owl-bot-staging/google-cloud-vision-v1p4beta1/proto_docs/google/cloud/vision/v1p4beta1/product_search_service.rb delete mode 100644 owl-bot-staging/google-cloud-vision-v1p4beta1/proto_docs/google/cloud/vision/v1p4beta1/text_annotation.rb delete mode 100644 owl-bot-staging/google-cloud-vision-v1p4beta1/proto_docs/google/cloud/vision/v1p4beta1/web_detection.rb delete mode 100644 owl-bot-staging/google-cloud-vision-v1p4beta1/proto_docs/google/longrunning/operations.rb delete mode 100644 owl-bot-staging/google-cloud-vision-v1p4beta1/proto_docs/google/protobuf/any.rb delete mode 100644 owl-bot-staging/google-cloud-vision-v1p4beta1/proto_docs/google/protobuf/duration.rb delete mode 100644 owl-bot-staging/google-cloud-vision-v1p4beta1/proto_docs/google/protobuf/empty.rb delete mode 100644 owl-bot-staging/google-cloud-vision-v1p4beta1/proto_docs/google/protobuf/field_mask.rb delete mode 100644 owl-bot-staging/google-cloud-vision-v1p4beta1/proto_docs/google/protobuf/timestamp.rb delete mode 100644 owl-bot-staging/google-cloud-vision-v1p4beta1/proto_docs/google/protobuf/wrappers.rb delete mode 100644 owl-bot-staging/google-cloud-vision-v1p4beta1/proto_docs/google/rpc/status.rb delete mode 100644 owl-bot-staging/google-cloud-vision-v1p4beta1/proto_docs/google/type/color.rb delete mode 100644 owl-bot-staging/google-cloud-vision-v1p4beta1/proto_docs/google/type/latlng.rb delete mode 100644 owl-bot-staging/google-cloud-vision-v1p4beta1/snippets/Gemfile delete mode 100644 owl-bot-staging/google-cloud-vision-v1p4beta1/snippets/image_annotator/async_batch_annotate_files.rb delete mode 100644 owl-bot-staging/google-cloud-vision-v1p4beta1/snippets/image_annotator/async_batch_annotate_images.rb delete mode 100644 owl-bot-staging/google-cloud-vision-v1p4beta1/snippets/image_annotator/batch_annotate_files.rb delete mode 100644 owl-bot-staging/google-cloud-vision-v1p4beta1/snippets/image_annotator/batch_annotate_images.rb delete mode 100644 owl-bot-staging/google-cloud-vision-v1p4beta1/snippets/product_search/add_product_to_product_set.rb delete mode 100644 owl-bot-staging/google-cloud-vision-v1p4beta1/snippets/product_search/create_product.rb delete mode 100644 owl-bot-staging/google-cloud-vision-v1p4beta1/snippets/product_search/create_product_set.rb delete mode 100644 owl-bot-staging/google-cloud-vision-v1p4beta1/snippets/product_search/create_reference_image.rb delete mode 100644 owl-bot-staging/google-cloud-vision-v1p4beta1/snippets/product_search/delete_product.rb delete mode 100644 owl-bot-staging/google-cloud-vision-v1p4beta1/snippets/product_search/delete_product_set.rb delete mode 100644 owl-bot-staging/google-cloud-vision-v1p4beta1/snippets/product_search/delete_reference_image.rb delete mode 100644 owl-bot-staging/google-cloud-vision-v1p4beta1/snippets/product_search/get_product.rb delete mode 100644 owl-bot-staging/google-cloud-vision-v1p4beta1/snippets/product_search/get_product_set.rb delete mode 100644 owl-bot-staging/google-cloud-vision-v1p4beta1/snippets/product_search/get_reference_image.rb delete mode 100644 owl-bot-staging/google-cloud-vision-v1p4beta1/snippets/product_search/import_product_sets.rb delete mode 100644 owl-bot-staging/google-cloud-vision-v1p4beta1/snippets/product_search/list_product_sets.rb delete mode 100644 owl-bot-staging/google-cloud-vision-v1p4beta1/snippets/product_search/list_products.rb delete mode 100644 owl-bot-staging/google-cloud-vision-v1p4beta1/snippets/product_search/list_products_in_product_set.rb delete mode 100644 owl-bot-staging/google-cloud-vision-v1p4beta1/snippets/product_search/list_reference_images.rb delete mode 100644 owl-bot-staging/google-cloud-vision-v1p4beta1/snippets/product_search/purge_products.rb delete mode 100644 owl-bot-staging/google-cloud-vision-v1p4beta1/snippets/product_search/remove_product_from_product_set.rb delete mode 100644 owl-bot-staging/google-cloud-vision-v1p4beta1/snippets/product_search/update_product.rb delete mode 100644 owl-bot-staging/google-cloud-vision-v1p4beta1/snippets/product_search/update_product_set.rb delete mode 100644 owl-bot-staging/google-cloud-vision-v1p4beta1/snippets/snippet_metadata_google.cloud.vision.v1p4beta1.json delete mode 100644 owl-bot-staging/google-cloud-vision-v1p4beta1/test/google/cloud/vision/v1p4beta1/image_annotator_operations_test.rb delete mode 100644 owl-bot-staging/google-cloud-vision-v1p4beta1/test/google/cloud/vision/v1p4beta1/image_annotator_paths_test.rb delete mode 100644 owl-bot-staging/google-cloud-vision-v1p4beta1/test/google/cloud/vision/v1p4beta1/image_annotator_rest_test.rb delete mode 100644 owl-bot-staging/google-cloud-vision-v1p4beta1/test/google/cloud/vision/v1p4beta1/image_annotator_test.rb delete mode 100644 owl-bot-staging/google-cloud-vision-v1p4beta1/test/google/cloud/vision/v1p4beta1/product_search_operations_test.rb delete mode 100644 owl-bot-staging/google-cloud-vision-v1p4beta1/test/google/cloud/vision/v1p4beta1/product_search_paths_test.rb delete mode 100644 owl-bot-staging/google-cloud-vision-v1p4beta1/test/google/cloud/vision/v1p4beta1/product_search_rest_test.rb delete mode 100644 owl-bot-staging/google-cloud-vision-v1p4beta1/test/google/cloud/vision/v1p4beta1/product_search_test.rb delete mode 100644 owl-bot-staging/google-cloud-vision-v1p4beta1/test/helper.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/.gitignore delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/.repo-metadata.json delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/.rubocop.yml delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/.toys.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/.yardopts delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/AUTHENTICATION.md delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/CHANGELOG.md delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/Gemfile delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/LICENSE.md delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/README.md delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/Rakefile delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/gapic_metadata.json delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/google-cloud-vision_ai-v1.gemspec delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/lib/google-cloud-vision_ai-v1.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/app_platform.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/app_platform/client.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/app_platform/credentials.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/app_platform/operations.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/app_platform/paths.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/app_platform/rest.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/app_platform/rest/client.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/app_platform/rest/operations.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/app_platform/rest/service_stub.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/bindings_override.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/health_check_service.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/health_check_service/client.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/health_check_service/credentials.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/health_check_service/paths.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/health_check_service/rest.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/health_check_service/rest/client.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/health_check_service/rest/service_stub.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/live_video_analytics.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/live_video_analytics/client.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/live_video_analytics/credentials.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/live_video_analytics/operations.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/live_video_analytics/paths.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/live_video_analytics/rest.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/live_video_analytics/rest/client.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/live_video_analytics/rest/operations.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/live_video_analytics/rest/service_stub.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/rest.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/streaming_service.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/streaming_service/client.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/streaming_service/credentials.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/streaming_service/paths.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/streaming_service/rest.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/streaming_service/rest/client.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/streaming_service/rest/service_stub.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/streams_service.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/streams_service/client.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/streams_service/credentials.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/streams_service/operations.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/streams_service/paths.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/streams_service/rest.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/streams_service/rest/client.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/streams_service/rest/operations.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/streams_service/rest/service_stub.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/version.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/warehouse.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/warehouse/client.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/warehouse/credentials.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/warehouse/operations.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/warehouse/paths.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/warehouse/rest.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/warehouse/rest/client.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/warehouse/rest/operations.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/warehouse/rest/service_stub.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/visionai/v1/annotations_pb.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/visionai/v1/common_pb.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/visionai/v1/health_service_pb.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/visionai/v1/health_service_services_pb.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/visionai/v1/lva_pb.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/visionai/v1/lva_resources_pb.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/visionai/v1/lva_service_pb.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/visionai/v1/lva_service_services_pb.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/visionai/v1/platform_pb.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/visionai/v1/platform_services_pb.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/visionai/v1/streaming_resources_pb.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/visionai/v1/streaming_service_pb.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/visionai/v1/streaming_service_services_pb.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/visionai/v1/streams_resources_pb.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/visionai/v1/streams_service_pb.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/visionai/v1/streams_service_services_pb.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/visionai/v1/warehouse_pb.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/visionai/v1/warehouse_services_pb.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/proto_docs/README.md delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/proto_docs/google/api/client.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/proto_docs/google/api/field_behavior.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/proto_docs/google/api/launch_stage.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/proto_docs/google/api/resource.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/proto_docs/google/cloud/visionai/v1/annotations.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/proto_docs/google/cloud/visionai/v1/common.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/proto_docs/google/cloud/visionai/v1/health_service.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/proto_docs/google/cloud/visionai/v1/lva.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/proto_docs/google/cloud/visionai/v1/lva_resources.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/proto_docs/google/cloud/visionai/v1/lva_service.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/proto_docs/google/cloud/visionai/v1/platform.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/proto_docs/google/cloud/visionai/v1/streaming_resources.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/proto_docs/google/cloud/visionai/v1/streaming_service.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/proto_docs/google/cloud/visionai/v1/streams_resources.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/proto_docs/google/cloud/visionai/v1/streams_service.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/proto_docs/google/cloud/visionai/v1/warehouse.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/proto_docs/google/longrunning/operations.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/proto_docs/google/protobuf/any.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/proto_docs/google/protobuf/duration.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/proto_docs/google/protobuf/empty.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/proto_docs/google/protobuf/field_mask.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/proto_docs/google/protobuf/struct.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/proto_docs/google/protobuf/timestamp.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/proto_docs/google/rpc/status.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/proto_docs/google/type/datetime.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/proto_docs/google/type/expr.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/Gemfile delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/app_platform/add_application_stream_input.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/app_platform/create_application.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/app_platform/create_application_instances.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/app_platform/create_draft.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/app_platform/create_processor.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/app_platform/delete_application.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/app_platform/delete_application_instances.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/app_platform/delete_draft.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/app_platform/delete_processor.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/app_platform/deploy_application.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/app_platform/get_application.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/app_platform/get_draft.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/app_platform/get_instance.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/app_platform/get_processor.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/app_platform/list_applications.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/app_platform/list_drafts.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/app_platform/list_instances.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/app_platform/list_prebuilt_processors.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/app_platform/list_processors.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/app_platform/remove_application_stream_input.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/app_platform/undeploy_application.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/app_platform/update_application.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/app_platform/update_application_instances.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/app_platform/update_application_stream_input.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/app_platform/update_draft.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/app_platform/update_processor.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/health_check_service/health_check.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/live_video_analytics/batch_run_process.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/live_video_analytics/create_analysis.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/live_video_analytics/create_operator.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/live_video_analytics/create_process.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/live_video_analytics/delete_analysis.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/live_video_analytics/delete_operator.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/live_video_analytics/delete_process.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/live_video_analytics/get_analysis.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/live_video_analytics/get_operator.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/live_video_analytics/get_process.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/live_video_analytics/list_analyses.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/live_video_analytics/list_operators.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/live_video_analytics/list_processes.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/live_video_analytics/list_public_operators.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/live_video_analytics/resolve_operator_info.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/live_video_analytics/update_analysis.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/live_video_analytics/update_operator.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/live_video_analytics/update_process.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/snippet_metadata_google.cloud.visionai.v1.json delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/streaming_service/acquire_lease.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/streaming_service/receive_events.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/streaming_service/receive_packets.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/streaming_service/release_lease.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/streaming_service/renew_lease.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/streaming_service/send_packets.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/streams_service/create_cluster.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/streams_service/create_event.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/streams_service/create_series.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/streams_service/create_stream.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/streams_service/delete_cluster.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/streams_service/delete_event.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/streams_service/delete_series.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/streams_service/delete_stream.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/streams_service/generate_stream_hls_token.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/streams_service/get_cluster.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/streams_service/get_event.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/streams_service/get_series.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/streams_service/get_stream.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/streams_service/get_stream_thumbnail.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/streams_service/list_clusters.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/streams_service/list_events.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/streams_service/list_series.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/streams_service/list_streams.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/streams_service/materialize_channel.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/streams_service/update_cluster.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/streams_service/update_event.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/streams_service/update_series.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/streams_service/update_stream.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/add_collection_item.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/analyze_asset.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/analyze_corpus.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/clip_asset.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/create_annotation.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/create_asset.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/create_collection.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/create_corpus.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/create_data_schema.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/create_index.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/create_index_endpoint.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/create_search_config.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/create_search_hypernym.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/delete_annotation.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/delete_asset.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/delete_collection.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/delete_corpus.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/delete_data_schema.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/delete_index.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/delete_index_endpoint.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/delete_search_config.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/delete_search_hypernym.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/deploy_index.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/generate_hls_uri.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/generate_retrieval_url.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/get_annotation.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/get_asset.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/get_collection.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/get_corpus.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/get_data_schema.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/get_index.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/get_index_endpoint.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/get_search_config.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/get_search_hypernym.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/import_assets.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/index_asset.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/ingest_asset.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/list_annotations.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/list_assets.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/list_collections.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/list_corpora.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/list_data_schemas.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/list_index_endpoints.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/list_indexes.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/list_search_configs.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/list_search_hypernyms.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/remove_collection_item.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/remove_index_asset.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/search_assets.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/search_index_endpoint.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/undeploy_index.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/update_annotation.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/update_asset.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/update_collection.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/update_corpus.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/update_data_schema.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/update_index.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/update_index_endpoint.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/update_search_config.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/update_search_hypernym.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/upload_asset.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/view_collection_items.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/view_indexed_assets.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/test/google/cloud/vision_ai/v1/app_platform_operations_test.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/test/google/cloud/vision_ai/v1/app_platform_paths_test.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/test/google/cloud/vision_ai/v1/app_platform_rest_test.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/test/google/cloud/vision_ai/v1/app_platform_test.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/test/google/cloud/vision_ai/v1/health_check_service_paths_test.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/test/google/cloud/vision_ai/v1/health_check_service_rest_test.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/test/google/cloud/vision_ai/v1/health_check_service_test.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/test/google/cloud/vision_ai/v1/live_video_analytics_operations_test.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/test/google/cloud/vision_ai/v1/live_video_analytics_paths_test.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/test/google/cloud/vision_ai/v1/live_video_analytics_rest_test.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/test/google/cloud/vision_ai/v1/live_video_analytics_test.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/test/google/cloud/vision_ai/v1/streaming_service_paths_test.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/test/google/cloud/vision_ai/v1/streaming_service_rest_test.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/test/google/cloud/vision_ai/v1/streaming_service_test.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/test/google/cloud/vision_ai/v1/streams_service_operations_test.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/test/google/cloud/vision_ai/v1/streams_service_paths_test.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/test/google/cloud/vision_ai/v1/streams_service_rest_test.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/test/google/cloud/vision_ai/v1/streams_service_test.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/test/google/cloud/vision_ai/v1/warehouse_operations_test.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/test/google/cloud/vision_ai/v1/warehouse_paths_test.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/test/google/cloud/vision_ai/v1/warehouse_rest_test.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/test/google/cloud/vision_ai/v1/warehouse_test.rb delete mode 100644 owl-bot-staging/google-cloud-vision_ai-v1/test/helper.rb delete mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/.gitignore delete mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/.repo-metadata.json delete mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/.rubocop.yml delete mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/.toys.rb delete mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/.yardopts delete mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/AUTHENTICATION.md delete mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/CHANGELOG.md delete mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/Gemfile delete mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/LICENSE.md delete mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/README.md delete mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/Rakefile delete mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/gapic_metadata.json delete mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/google-cloud-vm_migration-v1.gemspec delete mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/lib/google-cloud-vm_migration-v1.rb delete mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/lib/google/cloud/vm_migration/v1.rb delete mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/lib/google/cloud/vm_migration/v1/bindings_override.rb delete mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/lib/google/cloud/vm_migration/v1/rest.rb delete mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/lib/google/cloud/vm_migration/v1/version.rb delete mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/lib/google/cloud/vm_migration/v1/vm_migration.rb delete mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/lib/google/cloud/vm_migration/v1/vm_migration/client.rb delete mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/lib/google/cloud/vm_migration/v1/vm_migration/credentials.rb delete mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/lib/google/cloud/vm_migration/v1/vm_migration/operations.rb delete mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/lib/google/cloud/vm_migration/v1/vm_migration/paths.rb delete mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/lib/google/cloud/vm_migration/v1/vm_migration/rest.rb delete mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/lib/google/cloud/vm_migration/v1/vm_migration/rest/client.rb delete mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/lib/google/cloud/vm_migration/v1/vm_migration/rest/operations.rb delete mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/lib/google/cloud/vm_migration/v1/vm_migration/rest/service_stub.rb delete mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/lib/google/cloud/vmmigration/v1/vmmigration_pb.rb delete mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/lib/google/cloud/vmmigration/v1/vmmigration_services_pb.rb delete mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/lib/google/iam/v1.rb delete mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/lib/google/iam/v1/bindings_override.rb delete mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/lib/google/iam/v1/iam_policy.rb delete mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/lib/google/iam/v1/iam_policy/client.rb delete mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/lib/google/iam/v1/iam_policy/credentials.rb delete mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/lib/google/iam/v1/iam_policy/rest.rb delete mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/lib/google/iam/v1/iam_policy/rest/client.rb delete mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/lib/google/iam/v1/iam_policy/rest/service_stub.rb delete mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/lib/google/iam/v1/rest.rb delete mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/proto_docs/README.md delete mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/proto_docs/google/api/client.rb delete mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/proto_docs/google/api/field_behavior.rb delete mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/proto_docs/google/api/field_info.rb delete mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/proto_docs/google/api/launch_stage.rb delete mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/proto_docs/google/api/resource.rb delete mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/proto_docs/google/cloud/vmmigration/v1/vmmigration.rb delete mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/proto_docs/google/iam/v1/iam_policy.rb delete mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/proto_docs/google/iam/v1/options.rb delete mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/proto_docs/google/iam/v1/policy.rb delete mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/proto_docs/google/longrunning/operations.rb delete mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/proto_docs/google/protobuf/any.rb delete mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/proto_docs/google/protobuf/duration.rb delete mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/proto_docs/google/protobuf/empty.rb delete mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/proto_docs/google/protobuf/field_mask.rb delete mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/proto_docs/google/protobuf/timestamp.rb delete mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/proto_docs/google/rpc/error_details.rb delete mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/proto_docs/google/rpc/status.rb delete mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/proto_docs/google/type/expr.rb delete mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/snippets/Gemfile delete mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/snippets/iam_policy/get_iam_policy.rb delete mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/snippets/iam_policy/set_iam_policy.rb delete mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/snippets/iam_policy/test_iam_permissions.rb delete mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/snippets/snippet_metadata_google.cloud.vmmigration.v1.json delete mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/snippets/snippet_metadata_google.iam.v1.json delete mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/add_group_migration.rb delete mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/cancel_clone_job.rb delete mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/cancel_cutover_job.rb delete mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/cancel_disk_migration_job.rb delete mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/cancel_image_import_job.rb delete mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/create_clone_job.rb delete mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/create_cutover_job.rb delete mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/create_datacenter_connector.rb delete mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/create_disk_migration_job.rb delete mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/create_group.rb delete mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/create_image_import.rb delete mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/create_migrating_vm.rb delete mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/create_source.rb delete mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/create_target_project.rb delete mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/create_utilization_report.rb delete mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/delete_datacenter_connector.rb delete mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/delete_disk_migration_job.rb delete mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/delete_group.rb delete mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/delete_image_import.rb delete mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/delete_migrating_vm.rb delete mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/delete_source.rb delete mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/delete_target_project.rb delete mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/delete_utilization_report.rb delete mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/extend_migration.rb delete mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/fetch_inventory.rb delete mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/fetch_storage_inventory.rb delete mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/finalize_migration.rb delete mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/get_clone_job.rb delete mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/get_cutover_job.rb delete mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/get_datacenter_connector.rb delete mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/get_disk_migration_job.rb delete mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/get_group.rb delete mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/get_image_import.rb delete mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/get_image_import_job.rb delete mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/get_migrating_vm.rb delete mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/get_replication_cycle.rb delete mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/get_source.rb delete mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/get_target_project.rb delete mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/get_utilization_report.rb delete mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/list_clone_jobs.rb delete mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/list_cutover_jobs.rb delete mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/list_datacenter_connectors.rb delete mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/list_disk_migration_jobs.rb delete mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/list_groups.rb delete mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/list_image_import_jobs.rb delete mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/list_image_imports.rb delete mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/list_migrating_vms.rb delete mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/list_replication_cycles.rb delete mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/list_sources.rb delete mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/list_target_projects.rb delete mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/list_utilization_reports.rb delete mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/pause_migration.rb delete mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/remove_group_migration.rb delete mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/resume_migration.rb delete mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/run_disk_migration_job.rb delete mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/start_migration.rb delete mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/update_disk_migration_job.rb delete mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/update_group.rb delete mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/update_migrating_vm.rb delete mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/update_source.rb delete mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/update_target_project.rb delete mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/upgrade_appliance.rb delete mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/test/google/cloud/vm_migration/v1/vm_migration_operations_test.rb delete mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/test/google/cloud/vm_migration/v1/vm_migration_paths_test.rb delete mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/test/google/cloud/vm_migration/v1/vm_migration_rest_test.rb delete mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/test/google/cloud/vm_migration/v1/vm_migration_test.rb delete mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/test/google/iam/v1/iam_policy_rest_test.rb delete mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/test/google/iam/v1/iam_policy_test.rb delete mode 100644 owl-bot-staging/google-cloud-vm_migration-v1/test/helper.rb delete mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/.gitignore delete mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/.repo-metadata.json delete mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/.rubocop.yml delete mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/.toys.rb delete mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/.yardopts delete mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/AUTHENTICATION.md delete mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/CHANGELOG.md delete mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/Gemfile delete mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/LICENSE.md delete mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/README.md delete mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/Rakefile delete mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/gapic_metadata.json delete mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/google-cloud-vmware_engine-v1.gemspec delete mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/lib/google-cloud-vmware_engine-v1.rb delete mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/lib/google/cloud/vmware_engine/v1.rb delete mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/lib/google/cloud/vmware_engine/v1/bindings_override.rb delete mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/lib/google/cloud/vmware_engine/v1/rest.rb delete mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/lib/google/cloud/vmware_engine/v1/version.rb delete mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/lib/google/cloud/vmware_engine/v1/vmware_engine.rb delete mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/lib/google/cloud/vmware_engine/v1/vmware_engine/client.rb delete mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/lib/google/cloud/vmware_engine/v1/vmware_engine/credentials.rb delete mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/lib/google/cloud/vmware_engine/v1/vmware_engine/operations.rb delete mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/lib/google/cloud/vmware_engine/v1/vmware_engine/paths.rb delete mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/lib/google/cloud/vmware_engine/v1/vmware_engine/rest.rb delete mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/lib/google/cloud/vmware_engine/v1/vmware_engine/rest/client.rb delete mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/lib/google/cloud/vmware_engine/v1/vmware_engine/rest/operations.rb delete mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/lib/google/cloud/vmware_engine/v1/vmware_engine/rest/service_stub.rb delete mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/lib/google/cloud/vmwareengine/v1/vmwareengine_pb.rb delete mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/lib/google/cloud/vmwareengine/v1/vmwareengine_resources_pb.rb delete mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/lib/google/cloud/vmwareengine/v1/vmwareengine_services_pb.rb delete mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/proto_docs/README.md delete mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/proto_docs/google/api/client.rb delete mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/proto_docs/google/api/field_behavior.rb delete mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/proto_docs/google/api/field_info.rb delete mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/proto_docs/google/api/launch_stage.rb delete mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/proto_docs/google/api/resource.rb delete mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/proto_docs/google/cloud/vmwareengine/v1/vmwareengine.rb delete mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/proto_docs/google/cloud/vmwareengine/v1/vmwareengine_resources.rb delete mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/proto_docs/google/longrunning/operations.rb delete mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/proto_docs/google/protobuf/any.rb delete mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/proto_docs/google/protobuf/duration.rb delete mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/proto_docs/google/protobuf/empty.rb delete mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/proto_docs/google/protobuf/field_mask.rb delete mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/proto_docs/google/protobuf/timestamp.rb delete mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/proto_docs/google/rpc/status.rb delete mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/proto_docs/google/type/expr.rb delete mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/snippets/Gemfile delete mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/snippets/snippet_metadata_google.cloud.vmwareengine.v1.json delete mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/create_cluster.rb delete mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/create_external_access_rule.rb delete mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/create_external_address.rb delete mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/create_hcx_activation_key.rb delete mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/create_logging_server.rb delete mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/create_management_dns_zone_binding.rb delete mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/create_network_peering.rb delete mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/create_network_policy.rb delete mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/create_private_cloud.rb delete mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/create_private_connection.rb delete mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/create_vmware_engine_network.rb delete mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/delete_cluster.rb delete mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/delete_external_access_rule.rb delete mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/delete_external_address.rb delete mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/delete_logging_server.rb delete mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/delete_management_dns_zone_binding.rb delete mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/delete_network_peering.rb delete mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/delete_network_policy.rb delete mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/delete_private_cloud.rb delete mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/delete_private_connection.rb delete mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/delete_vmware_engine_network.rb delete mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/fetch_network_policy_external_addresses.rb delete mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/get_cluster.rb delete mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/get_dns_bind_permission.rb delete mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/get_dns_forwarding.rb delete mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/get_external_access_rule.rb delete mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/get_external_address.rb delete mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/get_hcx_activation_key.rb delete mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/get_logging_server.rb delete mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/get_management_dns_zone_binding.rb delete mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/get_network_peering.rb delete mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/get_network_policy.rb delete mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/get_node.rb delete mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/get_node_type.rb delete mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/get_private_cloud.rb delete mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/get_private_connection.rb delete mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/get_subnet.rb delete mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/get_vmware_engine_network.rb delete mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/grant_dns_bind_permission.rb delete mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/list_clusters.rb delete mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/list_external_access_rules.rb delete mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/list_external_addresses.rb delete mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/list_hcx_activation_keys.rb delete mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/list_logging_servers.rb delete mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/list_management_dns_zone_bindings.rb delete mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/list_network_peerings.rb delete mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/list_network_policies.rb delete mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/list_node_types.rb delete mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/list_nodes.rb delete mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/list_peering_routes.rb delete mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/list_private_clouds.rb delete mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/list_private_connection_peering_routes.rb delete mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/list_private_connections.rb delete mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/list_subnets.rb delete mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/list_vmware_engine_networks.rb delete mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/repair_management_dns_zone_binding.rb delete mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/reset_nsx_credentials.rb delete mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/reset_vcenter_credentials.rb delete mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/revoke_dns_bind_permission.rb delete mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/show_nsx_credentials.rb delete mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/show_vcenter_credentials.rb delete mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/undelete_private_cloud.rb delete mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/update_cluster.rb delete mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/update_dns_forwarding.rb delete mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/update_external_access_rule.rb delete mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/update_external_address.rb delete mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/update_logging_server.rb delete mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/update_management_dns_zone_binding.rb delete mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/update_network_peering.rb delete mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/update_network_policy.rb delete mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/update_private_cloud.rb delete mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/update_private_connection.rb delete mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/update_subnet.rb delete mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/update_vmware_engine_network.rb delete mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/test/google/cloud/vmware_engine/v1/vmware_engine_operations_test.rb delete mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/test/google/cloud/vmware_engine/v1/vmware_engine_paths_test.rb delete mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/test/google/cloud/vmware_engine/v1/vmware_engine_rest_test.rb delete mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/test/google/cloud/vmware_engine/v1/vmware_engine_test.rb delete mode 100644 owl-bot-staging/google-cloud-vmware_engine-v1/test/helper.rb delete mode 100644 owl-bot-staging/google-cloud-vpc_access-v1/.gitignore delete mode 100644 owl-bot-staging/google-cloud-vpc_access-v1/.repo-metadata.json delete mode 100644 owl-bot-staging/google-cloud-vpc_access-v1/.rubocop.yml delete mode 100644 owl-bot-staging/google-cloud-vpc_access-v1/.toys.rb delete mode 100644 owl-bot-staging/google-cloud-vpc_access-v1/.yardopts delete mode 100644 owl-bot-staging/google-cloud-vpc_access-v1/AUTHENTICATION.md delete mode 100644 owl-bot-staging/google-cloud-vpc_access-v1/CHANGELOG.md delete mode 100644 owl-bot-staging/google-cloud-vpc_access-v1/Gemfile delete mode 100644 owl-bot-staging/google-cloud-vpc_access-v1/LICENSE.md delete mode 100644 owl-bot-staging/google-cloud-vpc_access-v1/README.md delete mode 100644 owl-bot-staging/google-cloud-vpc_access-v1/Rakefile delete mode 100644 owl-bot-staging/google-cloud-vpc_access-v1/gapic_metadata.json delete mode 100644 owl-bot-staging/google-cloud-vpc_access-v1/google-cloud-vpc_access-v1.gemspec delete mode 100644 owl-bot-staging/google-cloud-vpc_access-v1/lib/google-cloud-vpc_access-v1.rb delete mode 100644 owl-bot-staging/google-cloud-vpc_access-v1/lib/google/cloud/vpc_access/v1.rb delete mode 100644 owl-bot-staging/google-cloud-vpc_access-v1/lib/google/cloud/vpc_access/v1/bindings_override.rb delete mode 100644 owl-bot-staging/google-cloud-vpc_access-v1/lib/google/cloud/vpc_access/v1/rest.rb delete mode 100644 owl-bot-staging/google-cloud-vpc_access-v1/lib/google/cloud/vpc_access/v1/version.rb delete mode 100644 owl-bot-staging/google-cloud-vpc_access-v1/lib/google/cloud/vpc_access/v1/vpc_access_service.rb delete mode 100644 owl-bot-staging/google-cloud-vpc_access-v1/lib/google/cloud/vpc_access/v1/vpc_access_service/client.rb delete mode 100644 owl-bot-staging/google-cloud-vpc_access-v1/lib/google/cloud/vpc_access/v1/vpc_access_service/credentials.rb delete mode 100644 owl-bot-staging/google-cloud-vpc_access-v1/lib/google/cloud/vpc_access/v1/vpc_access_service/operations.rb delete mode 100644 owl-bot-staging/google-cloud-vpc_access-v1/lib/google/cloud/vpc_access/v1/vpc_access_service/paths.rb delete mode 100644 owl-bot-staging/google-cloud-vpc_access-v1/lib/google/cloud/vpc_access/v1/vpc_access_service/rest.rb delete mode 100644 owl-bot-staging/google-cloud-vpc_access-v1/lib/google/cloud/vpc_access/v1/vpc_access_service/rest/client.rb delete mode 100644 owl-bot-staging/google-cloud-vpc_access-v1/lib/google/cloud/vpc_access/v1/vpc_access_service/rest/operations.rb delete mode 100644 owl-bot-staging/google-cloud-vpc_access-v1/lib/google/cloud/vpc_access/v1/vpc_access_service/rest/service_stub.rb delete mode 100644 owl-bot-staging/google-cloud-vpc_access-v1/lib/google/cloud/vpcaccess/v1/vpc_access_pb.rb delete mode 100644 owl-bot-staging/google-cloud-vpc_access-v1/lib/google/cloud/vpcaccess/v1/vpc_access_services_pb.rb delete mode 100644 owl-bot-staging/google-cloud-vpc_access-v1/proto_docs/README.md delete mode 100644 owl-bot-staging/google-cloud-vpc_access-v1/proto_docs/google/api/client.rb delete mode 100644 owl-bot-staging/google-cloud-vpc_access-v1/proto_docs/google/api/field_behavior.rb delete mode 100644 owl-bot-staging/google-cloud-vpc_access-v1/proto_docs/google/api/launch_stage.rb delete mode 100644 owl-bot-staging/google-cloud-vpc_access-v1/proto_docs/google/api/resource.rb delete mode 100644 owl-bot-staging/google-cloud-vpc_access-v1/proto_docs/google/cloud/vpcaccess/v1/vpc_access.rb delete mode 100644 owl-bot-staging/google-cloud-vpc_access-v1/proto_docs/google/longrunning/operations.rb delete mode 100644 owl-bot-staging/google-cloud-vpc_access-v1/proto_docs/google/protobuf/any.rb delete mode 100644 owl-bot-staging/google-cloud-vpc_access-v1/proto_docs/google/protobuf/duration.rb delete mode 100644 owl-bot-staging/google-cloud-vpc_access-v1/proto_docs/google/protobuf/empty.rb delete mode 100644 owl-bot-staging/google-cloud-vpc_access-v1/proto_docs/google/protobuf/timestamp.rb delete mode 100644 owl-bot-staging/google-cloud-vpc_access-v1/proto_docs/google/rpc/status.rb delete mode 100644 owl-bot-staging/google-cloud-vpc_access-v1/snippets/Gemfile delete mode 100644 owl-bot-staging/google-cloud-vpc_access-v1/snippets/snippet_metadata_google.cloud.vpcaccess.v1.json delete mode 100644 owl-bot-staging/google-cloud-vpc_access-v1/snippets/vpc_access_service/create_connector.rb delete mode 100644 owl-bot-staging/google-cloud-vpc_access-v1/snippets/vpc_access_service/delete_connector.rb delete mode 100644 owl-bot-staging/google-cloud-vpc_access-v1/snippets/vpc_access_service/get_connector.rb delete mode 100644 owl-bot-staging/google-cloud-vpc_access-v1/snippets/vpc_access_service/list_connectors.rb delete mode 100644 owl-bot-staging/google-cloud-vpc_access-v1/test/google/cloud/vpc_access/v1/vpc_access_service_operations_test.rb delete mode 100644 owl-bot-staging/google-cloud-vpc_access-v1/test/google/cloud/vpc_access/v1/vpc_access_service_paths_test.rb delete mode 100644 owl-bot-staging/google-cloud-vpc_access-v1/test/google/cloud/vpc_access/v1/vpc_access_service_rest_test.rb delete mode 100644 owl-bot-staging/google-cloud-vpc_access-v1/test/google/cloud/vpc_access/v1/vpc_access_service_test.rb delete mode 100644 owl-bot-staging/google-cloud-vpc_access-v1/test/helper.rb delete mode 100644 owl-bot-staging/google-cloud-web_risk-v1/.gitignore delete mode 100644 owl-bot-staging/google-cloud-web_risk-v1/.repo-metadata.json delete mode 100644 owl-bot-staging/google-cloud-web_risk-v1/.rubocop.yml delete mode 100644 owl-bot-staging/google-cloud-web_risk-v1/.toys.rb delete mode 100644 owl-bot-staging/google-cloud-web_risk-v1/.yardopts delete mode 100644 owl-bot-staging/google-cloud-web_risk-v1/AUTHENTICATION.md delete mode 100644 owl-bot-staging/google-cloud-web_risk-v1/CHANGELOG.md delete mode 100644 owl-bot-staging/google-cloud-web_risk-v1/Gemfile delete mode 100644 owl-bot-staging/google-cloud-web_risk-v1/LICENSE.md delete mode 100644 owl-bot-staging/google-cloud-web_risk-v1/README.md delete mode 100644 owl-bot-staging/google-cloud-web_risk-v1/Rakefile delete mode 100644 owl-bot-staging/google-cloud-web_risk-v1/gapic_metadata.json delete mode 100644 owl-bot-staging/google-cloud-web_risk-v1/google-cloud-web_risk-v1.gemspec delete mode 100644 owl-bot-staging/google-cloud-web_risk-v1/lib/google-cloud-web_risk-v1.rb delete mode 100644 owl-bot-staging/google-cloud-web_risk-v1/lib/google/cloud/web_risk/v1.rb delete mode 100644 owl-bot-staging/google-cloud-web_risk-v1/lib/google/cloud/web_risk/v1/rest.rb delete mode 100644 owl-bot-staging/google-cloud-web_risk-v1/lib/google/cloud/web_risk/v1/version.rb delete mode 100644 owl-bot-staging/google-cloud-web_risk-v1/lib/google/cloud/web_risk/v1/web_risk_service.rb delete mode 100644 owl-bot-staging/google-cloud-web_risk-v1/lib/google/cloud/web_risk/v1/web_risk_service/client.rb delete mode 100644 owl-bot-staging/google-cloud-web_risk-v1/lib/google/cloud/web_risk/v1/web_risk_service/credentials.rb delete mode 100644 owl-bot-staging/google-cloud-web_risk-v1/lib/google/cloud/web_risk/v1/web_risk_service/operations.rb delete mode 100644 owl-bot-staging/google-cloud-web_risk-v1/lib/google/cloud/web_risk/v1/web_risk_service/paths.rb delete mode 100644 owl-bot-staging/google-cloud-web_risk-v1/lib/google/cloud/web_risk/v1/web_risk_service/rest.rb delete mode 100644 owl-bot-staging/google-cloud-web_risk-v1/lib/google/cloud/web_risk/v1/web_risk_service/rest/client.rb delete mode 100644 owl-bot-staging/google-cloud-web_risk-v1/lib/google/cloud/web_risk/v1/web_risk_service/rest/operations.rb delete mode 100644 owl-bot-staging/google-cloud-web_risk-v1/lib/google/cloud/web_risk/v1/web_risk_service/rest/service_stub.rb delete mode 100644 owl-bot-staging/google-cloud-web_risk-v1/lib/google/cloud/webrisk/v1/webrisk_pb.rb delete mode 100644 owl-bot-staging/google-cloud-web_risk-v1/lib/google/cloud/webrisk/v1/webrisk_services_pb.rb delete mode 100644 owl-bot-staging/google-cloud-web_risk-v1/proto_docs/README.md delete mode 100644 owl-bot-staging/google-cloud-web_risk-v1/proto_docs/google/api/client.rb delete mode 100644 owl-bot-staging/google-cloud-web_risk-v1/proto_docs/google/api/field_behavior.rb delete mode 100644 owl-bot-staging/google-cloud-web_risk-v1/proto_docs/google/api/launch_stage.rb delete mode 100644 owl-bot-staging/google-cloud-web_risk-v1/proto_docs/google/api/resource.rb delete mode 100644 owl-bot-staging/google-cloud-web_risk-v1/proto_docs/google/cloud/webrisk/v1/webrisk.rb delete mode 100644 owl-bot-staging/google-cloud-web_risk-v1/proto_docs/google/longrunning/operations.rb delete mode 100644 owl-bot-staging/google-cloud-web_risk-v1/proto_docs/google/protobuf/any.rb delete mode 100644 owl-bot-staging/google-cloud-web_risk-v1/proto_docs/google/protobuf/duration.rb delete mode 100644 owl-bot-staging/google-cloud-web_risk-v1/proto_docs/google/protobuf/empty.rb delete mode 100644 owl-bot-staging/google-cloud-web_risk-v1/proto_docs/google/protobuf/timestamp.rb delete mode 100644 owl-bot-staging/google-cloud-web_risk-v1/proto_docs/google/rpc/status.rb delete mode 100644 owl-bot-staging/google-cloud-web_risk-v1/snippets/Gemfile delete mode 100644 owl-bot-staging/google-cloud-web_risk-v1/snippets/snippet_metadata_google.cloud.webrisk.v1.json delete mode 100644 owl-bot-staging/google-cloud-web_risk-v1/snippets/web_risk_service/compute_threat_list_diff.rb delete mode 100644 owl-bot-staging/google-cloud-web_risk-v1/snippets/web_risk_service/create_submission.rb delete mode 100644 owl-bot-staging/google-cloud-web_risk-v1/snippets/web_risk_service/search_hashes.rb delete mode 100644 owl-bot-staging/google-cloud-web_risk-v1/snippets/web_risk_service/search_uris.rb delete mode 100644 owl-bot-staging/google-cloud-web_risk-v1/snippets/web_risk_service/submit_uri.rb delete mode 100644 owl-bot-staging/google-cloud-web_risk-v1/test/google/cloud/web_risk/v1/web_risk_service_operations_test.rb delete mode 100644 owl-bot-staging/google-cloud-web_risk-v1/test/google/cloud/web_risk/v1/web_risk_service_paths_test.rb delete mode 100644 owl-bot-staging/google-cloud-web_risk-v1/test/google/cloud/web_risk/v1/web_risk_service_rest_test.rb delete mode 100644 owl-bot-staging/google-cloud-web_risk-v1/test/google/cloud/web_risk/v1/web_risk_service_test.rb delete mode 100644 owl-bot-staging/google-cloud-web_risk-v1/test/helper.rb delete mode 100644 owl-bot-staging/google-cloud-web_risk-v1beta1/.gitignore delete mode 100644 owl-bot-staging/google-cloud-web_risk-v1beta1/.repo-metadata.json delete mode 100644 owl-bot-staging/google-cloud-web_risk-v1beta1/.rubocop.yml delete mode 100644 owl-bot-staging/google-cloud-web_risk-v1beta1/.toys.rb delete mode 100644 owl-bot-staging/google-cloud-web_risk-v1beta1/.yardopts delete mode 100644 owl-bot-staging/google-cloud-web_risk-v1beta1/AUTHENTICATION.md delete mode 100644 owl-bot-staging/google-cloud-web_risk-v1beta1/CHANGELOG.md delete mode 100644 owl-bot-staging/google-cloud-web_risk-v1beta1/Gemfile delete mode 100644 owl-bot-staging/google-cloud-web_risk-v1beta1/LICENSE.md delete mode 100644 owl-bot-staging/google-cloud-web_risk-v1beta1/README.md delete mode 100644 owl-bot-staging/google-cloud-web_risk-v1beta1/Rakefile delete mode 100644 owl-bot-staging/google-cloud-web_risk-v1beta1/gapic_metadata.json delete mode 100644 owl-bot-staging/google-cloud-web_risk-v1beta1/google-cloud-web_risk-v1beta1.gemspec delete mode 100644 owl-bot-staging/google-cloud-web_risk-v1beta1/lib/google-cloud-web_risk-v1beta1.rb delete mode 100644 owl-bot-staging/google-cloud-web_risk-v1beta1/lib/google/cloud/web_risk/v1beta1.rb delete mode 100644 owl-bot-staging/google-cloud-web_risk-v1beta1/lib/google/cloud/web_risk/v1beta1/rest.rb delete mode 100644 owl-bot-staging/google-cloud-web_risk-v1beta1/lib/google/cloud/web_risk/v1beta1/version.rb delete mode 100644 owl-bot-staging/google-cloud-web_risk-v1beta1/lib/google/cloud/web_risk/v1beta1/web_risk_service.rb delete mode 100644 owl-bot-staging/google-cloud-web_risk-v1beta1/lib/google/cloud/web_risk/v1beta1/web_risk_service/client.rb delete mode 100644 owl-bot-staging/google-cloud-web_risk-v1beta1/lib/google/cloud/web_risk/v1beta1/web_risk_service/credentials.rb delete mode 100644 owl-bot-staging/google-cloud-web_risk-v1beta1/lib/google/cloud/web_risk/v1beta1/web_risk_service/rest.rb delete mode 100644 owl-bot-staging/google-cloud-web_risk-v1beta1/lib/google/cloud/web_risk/v1beta1/web_risk_service/rest/client.rb delete mode 100644 owl-bot-staging/google-cloud-web_risk-v1beta1/lib/google/cloud/web_risk/v1beta1/web_risk_service/rest/service_stub.rb delete mode 100644 owl-bot-staging/google-cloud-web_risk-v1beta1/lib/google/cloud/webrisk/v1beta1/webrisk_pb.rb delete mode 100644 owl-bot-staging/google-cloud-web_risk-v1beta1/lib/google/cloud/webrisk/v1beta1/webrisk_services_pb.rb delete mode 100644 owl-bot-staging/google-cloud-web_risk-v1beta1/proto_docs/README.md delete mode 100644 owl-bot-staging/google-cloud-web_risk-v1beta1/proto_docs/google/api/client.rb delete mode 100644 owl-bot-staging/google-cloud-web_risk-v1beta1/proto_docs/google/api/field_behavior.rb delete mode 100644 owl-bot-staging/google-cloud-web_risk-v1beta1/proto_docs/google/api/launch_stage.rb delete mode 100644 owl-bot-staging/google-cloud-web_risk-v1beta1/proto_docs/google/api/resource.rb delete mode 100644 owl-bot-staging/google-cloud-web_risk-v1beta1/proto_docs/google/cloud/webrisk/v1beta1/webrisk.rb delete mode 100644 owl-bot-staging/google-cloud-web_risk-v1beta1/proto_docs/google/protobuf/duration.rb delete mode 100644 owl-bot-staging/google-cloud-web_risk-v1beta1/proto_docs/google/protobuf/timestamp.rb delete mode 100644 owl-bot-staging/google-cloud-web_risk-v1beta1/snippets/Gemfile delete mode 100644 owl-bot-staging/google-cloud-web_risk-v1beta1/snippets/snippet_metadata_google.cloud.webrisk.v1beta1.json delete mode 100644 owl-bot-staging/google-cloud-web_risk-v1beta1/snippets/web_risk_service/compute_threat_list_diff.rb delete mode 100644 owl-bot-staging/google-cloud-web_risk-v1beta1/snippets/web_risk_service/search_hashes.rb delete mode 100644 owl-bot-staging/google-cloud-web_risk-v1beta1/snippets/web_risk_service/search_uris.rb delete mode 100644 owl-bot-staging/google-cloud-web_risk-v1beta1/test/google/cloud/web_risk/v1beta1/web_risk_service_rest_test.rb delete mode 100644 owl-bot-staging/google-cloud-web_risk-v1beta1/test/google/cloud/web_risk/v1beta1/web_risk_service_test.rb delete mode 100644 owl-bot-staging/google-cloud-web_risk-v1beta1/test/helper.rb delete mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1/.gitignore delete mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1/.repo-metadata.json delete mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1/.rubocop.yml delete mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1/.toys.rb delete mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1/.yardopts delete mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1/AUTHENTICATION.md delete mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1/CHANGELOG.md delete mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1/Gemfile delete mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1/LICENSE.md delete mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1/README.md delete mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1/Rakefile delete mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1/gapic_metadata.json delete mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1/google-cloud-web_security_scanner-v1.gemspec delete mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1/lib/google-cloud-web_security_scanner-v1.rb delete mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1/lib/google/cloud/web_security_scanner/v1.rb delete mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1/lib/google/cloud/web_security_scanner/v1/rest.rb delete mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1/lib/google/cloud/web_security_scanner/v1/version.rb delete mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1/lib/google/cloud/web_security_scanner/v1/web_security_scanner.rb delete mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1/lib/google/cloud/web_security_scanner/v1/web_security_scanner/client.rb delete mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1/lib/google/cloud/web_security_scanner/v1/web_security_scanner/credentials.rb delete mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1/lib/google/cloud/web_security_scanner/v1/web_security_scanner/rest.rb delete mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1/lib/google/cloud/web_security_scanner/v1/web_security_scanner/rest/client.rb delete mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1/lib/google/cloud/web_security_scanner/v1/web_security_scanner/rest/service_stub.rb delete mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1/lib/google/cloud/websecurityscanner/v1/crawled_url_pb.rb delete mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1/lib/google/cloud/websecurityscanner/v1/finding_addon_pb.rb delete mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1/lib/google/cloud/websecurityscanner/v1/finding_pb.rb delete mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1/lib/google/cloud/websecurityscanner/v1/finding_type_stats_pb.rb delete mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1/lib/google/cloud/websecurityscanner/v1/scan_config_error_pb.rb delete mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1/lib/google/cloud/websecurityscanner/v1/scan_config_pb.rb delete mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1/lib/google/cloud/websecurityscanner/v1/scan_run_error_trace_pb.rb delete mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1/lib/google/cloud/websecurityscanner/v1/scan_run_log_pb.rb delete mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1/lib/google/cloud/websecurityscanner/v1/scan_run_pb.rb delete mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1/lib/google/cloud/websecurityscanner/v1/scan_run_warning_trace_pb.rb delete mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1/lib/google/cloud/websecurityscanner/v1/web_security_scanner_pb.rb delete mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1/lib/google/cloud/websecurityscanner/v1/web_security_scanner_services_pb.rb delete mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1/proto_docs/README.md delete mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1/proto_docs/google/api/client.rb delete mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1/proto_docs/google/api/field_behavior.rb delete mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1/proto_docs/google/api/launch_stage.rb delete mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1/proto_docs/google/api/resource.rb delete mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1/proto_docs/google/cloud/websecurityscanner/v1/crawled_url.rb delete mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1/proto_docs/google/cloud/websecurityscanner/v1/finding.rb delete mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1/proto_docs/google/cloud/websecurityscanner/v1/finding_addon.rb delete mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1/proto_docs/google/cloud/websecurityscanner/v1/finding_type_stats.rb delete mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1/proto_docs/google/cloud/websecurityscanner/v1/scan_config.rb delete mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1/proto_docs/google/cloud/websecurityscanner/v1/scan_config_error.rb delete mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1/proto_docs/google/cloud/websecurityscanner/v1/scan_run.rb delete mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1/proto_docs/google/cloud/websecurityscanner/v1/scan_run_error_trace.rb delete mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1/proto_docs/google/cloud/websecurityscanner/v1/scan_run_log.rb delete mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1/proto_docs/google/cloud/websecurityscanner/v1/scan_run_warning_trace.rb delete mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1/proto_docs/google/cloud/websecurityscanner/v1/web_security_scanner.rb delete mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1/proto_docs/google/protobuf/duration.rb delete mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1/proto_docs/google/protobuf/empty.rb delete mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1/proto_docs/google/protobuf/field_mask.rb delete mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1/proto_docs/google/protobuf/timestamp.rb delete mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1/snippets/Gemfile delete mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1/snippets/snippet_metadata_google.cloud.websecurityscanner.v1.json delete mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1/snippets/web_security_scanner/create_scan_config.rb delete mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1/snippets/web_security_scanner/delete_scan_config.rb delete mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1/snippets/web_security_scanner/get_finding.rb delete mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1/snippets/web_security_scanner/get_scan_config.rb delete mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1/snippets/web_security_scanner/get_scan_run.rb delete mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1/snippets/web_security_scanner/list_crawled_urls.rb delete mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1/snippets/web_security_scanner/list_finding_type_stats.rb delete mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1/snippets/web_security_scanner/list_findings.rb delete mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1/snippets/web_security_scanner/list_scan_configs.rb delete mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1/snippets/web_security_scanner/list_scan_runs.rb delete mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1/snippets/web_security_scanner/start_scan_run.rb delete mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1/snippets/web_security_scanner/stop_scan_run.rb delete mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1/snippets/web_security_scanner/update_scan_config.rb delete mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1/test/google/cloud/web_security_scanner/v1/web_security_scanner_rest_test.rb delete mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1/test/google/cloud/web_security_scanner/v1/web_security_scanner_test.rb delete mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1/test/helper.rb delete mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1beta/.gitignore delete mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1beta/.repo-metadata.json delete mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1beta/.rubocop.yml delete mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1beta/.toys.rb delete mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1beta/.yardopts delete mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1beta/AUTHENTICATION.md delete mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1beta/CHANGELOG.md delete mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1beta/Gemfile delete mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1beta/LICENSE.md delete mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1beta/README.md delete mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1beta/Rakefile delete mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1beta/gapic_metadata.json delete mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1beta/google-cloud-web_security_scanner-v1beta.gemspec delete mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1beta/lib/google-cloud-web_security_scanner-v1beta.rb delete mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1beta/lib/google/cloud/web_security_scanner/v1beta.rb delete mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1beta/lib/google/cloud/web_security_scanner/v1beta/rest.rb delete mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1beta/lib/google/cloud/web_security_scanner/v1beta/version.rb delete mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1beta/lib/google/cloud/web_security_scanner/v1beta/web_security_scanner.rb delete mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1beta/lib/google/cloud/web_security_scanner/v1beta/web_security_scanner/client.rb delete mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1beta/lib/google/cloud/web_security_scanner/v1beta/web_security_scanner/credentials.rb delete mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1beta/lib/google/cloud/web_security_scanner/v1beta/web_security_scanner/paths.rb delete mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1beta/lib/google/cloud/web_security_scanner/v1beta/web_security_scanner/rest.rb delete mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1beta/lib/google/cloud/web_security_scanner/v1beta/web_security_scanner/rest/client.rb delete mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1beta/lib/google/cloud/web_security_scanner/v1beta/web_security_scanner/rest/service_stub.rb delete mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1beta/lib/google/cloud/websecurityscanner/v1beta/crawled_url_pb.rb delete mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1beta/lib/google/cloud/websecurityscanner/v1beta/finding_addon_pb.rb delete mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1beta/lib/google/cloud/websecurityscanner/v1beta/finding_pb.rb delete mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1beta/lib/google/cloud/websecurityscanner/v1beta/finding_type_stats_pb.rb delete mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1beta/lib/google/cloud/websecurityscanner/v1beta/scan_config_error_pb.rb delete mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1beta/lib/google/cloud/websecurityscanner/v1beta/scan_config_pb.rb delete mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1beta/lib/google/cloud/websecurityscanner/v1beta/scan_run_error_trace_pb.rb delete mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1beta/lib/google/cloud/websecurityscanner/v1beta/scan_run_pb.rb delete mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1beta/lib/google/cloud/websecurityscanner/v1beta/scan_run_warning_trace_pb.rb delete mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1beta/lib/google/cloud/websecurityscanner/v1beta/web_security_scanner_pb.rb delete mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1beta/lib/google/cloud/websecurityscanner/v1beta/web_security_scanner_services_pb.rb delete mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1beta/proto_docs/README.md delete mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1beta/proto_docs/google/api/client.rb delete mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1beta/proto_docs/google/api/field_behavior.rb delete mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1beta/proto_docs/google/api/launch_stage.rb delete mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1beta/proto_docs/google/api/resource.rb delete mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1beta/proto_docs/google/cloud/websecurityscanner/v1beta/crawled_url.rb delete mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1beta/proto_docs/google/cloud/websecurityscanner/v1beta/finding.rb delete mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1beta/proto_docs/google/cloud/websecurityscanner/v1beta/finding_addon.rb delete mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1beta/proto_docs/google/cloud/websecurityscanner/v1beta/finding_type_stats.rb delete mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1beta/proto_docs/google/cloud/websecurityscanner/v1beta/scan_config.rb delete mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1beta/proto_docs/google/cloud/websecurityscanner/v1beta/scan_config_error.rb delete mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1beta/proto_docs/google/cloud/websecurityscanner/v1beta/scan_run.rb delete mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1beta/proto_docs/google/cloud/websecurityscanner/v1beta/scan_run_error_trace.rb delete mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1beta/proto_docs/google/cloud/websecurityscanner/v1beta/scan_run_warning_trace.rb delete mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1beta/proto_docs/google/cloud/websecurityscanner/v1beta/web_security_scanner.rb delete mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1beta/proto_docs/google/protobuf/duration.rb delete mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1beta/proto_docs/google/protobuf/empty.rb delete mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1beta/proto_docs/google/protobuf/field_mask.rb delete mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1beta/proto_docs/google/protobuf/timestamp.rb delete mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1beta/snippets/Gemfile delete mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1beta/snippets/snippet_metadata_google.cloud.websecurityscanner.v1beta.json delete mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1beta/snippets/web_security_scanner/create_scan_config.rb delete mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1beta/snippets/web_security_scanner/delete_scan_config.rb delete mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1beta/snippets/web_security_scanner/get_finding.rb delete mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1beta/snippets/web_security_scanner/get_scan_config.rb delete mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1beta/snippets/web_security_scanner/get_scan_run.rb delete mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1beta/snippets/web_security_scanner/list_crawled_urls.rb delete mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1beta/snippets/web_security_scanner/list_finding_type_stats.rb delete mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1beta/snippets/web_security_scanner/list_findings.rb delete mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1beta/snippets/web_security_scanner/list_scan_configs.rb delete mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1beta/snippets/web_security_scanner/list_scan_runs.rb delete mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1beta/snippets/web_security_scanner/start_scan_run.rb delete mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1beta/snippets/web_security_scanner/stop_scan_run.rb delete mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1beta/snippets/web_security_scanner/update_scan_config.rb delete mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1beta/test/google/cloud/web_security_scanner/v1beta/web_security_scanner_paths_test.rb delete mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1beta/test/google/cloud/web_security_scanner/v1beta/web_security_scanner_rest_test.rb delete mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1beta/test/google/cloud/web_security_scanner/v1beta/web_security_scanner_test.rb delete mode 100644 owl-bot-staging/google-cloud-web_security_scanner-v1beta/test/helper.rb delete mode 100644 owl-bot-staging/google-cloud-workflows-executions-v1/.gitignore delete mode 100644 owl-bot-staging/google-cloud-workflows-executions-v1/.repo-metadata.json delete mode 100644 owl-bot-staging/google-cloud-workflows-executions-v1/.rubocop.yml delete mode 100644 owl-bot-staging/google-cloud-workflows-executions-v1/.toys.rb delete mode 100644 owl-bot-staging/google-cloud-workflows-executions-v1/.yardopts delete mode 100644 owl-bot-staging/google-cloud-workflows-executions-v1/AUTHENTICATION.md delete mode 100644 owl-bot-staging/google-cloud-workflows-executions-v1/CHANGELOG.md delete mode 100644 owl-bot-staging/google-cloud-workflows-executions-v1/Gemfile delete mode 100644 owl-bot-staging/google-cloud-workflows-executions-v1/LICENSE.md delete mode 100644 owl-bot-staging/google-cloud-workflows-executions-v1/README.md delete mode 100644 owl-bot-staging/google-cloud-workflows-executions-v1/Rakefile delete mode 100644 owl-bot-staging/google-cloud-workflows-executions-v1/gapic_metadata.json delete mode 100644 owl-bot-staging/google-cloud-workflows-executions-v1/google-cloud-workflows-executions-v1.gemspec delete mode 100644 owl-bot-staging/google-cloud-workflows-executions-v1/lib/google-cloud-workflows-executions-v1.rb delete mode 100644 owl-bot-staging/google-cloud-workflows-executions-v1/lib/google/cloud/workflows/executions/v1.rb delete mode 100644 owl-bot-staging/google-cloud-workflows-executions-v1/lib/google/cloud/workflows/executions/v1/executions.rb delete mode 100644 owl-bot-staging/google-cloud-workflows-executions-v1/lib/google/cloud/workflows/executions/v1/executions/client.rb delete mode 100644 owl-bot-staging/google-cloud-workflows-executions-v1/lib/google/cloud/workflows/executions/v1/executions/credentials.rb delete mode 100644 owl-bot-staging/google-cloud-workflows-executions-v1/lib/google/cloud/workflows/executions/v1/executions/paths.rb delete mode 100644 owl-bot-staging/google-cloud-workflows-executions-v1/lib/google/cloud/workflows/executions/v1/executions/rest.rb delete mode 100644 owl-bot-staging/google-cloud-workflows-executions-v1/lib/google/cloud/workflows/executions/v1/executions/rest/client.rb delete mode 100644 owl-bot-staging/google-cloud-workflows-executions-v1/lib/google/cloud/workflows/executions/v1/executions/rest/service_stub.rb delete mode 100644 owl-bot-staging/google-cloud-workflows-executions-v1/lib/google/cloud/workflows/executions/v1/executions_pb.rb delete mode 100644 owl-bot-staging/google-cloud-workflows-executions-v1/lib/google/cloud/workflows/executions/v1/executions_services_pb.rb delete mode 100644 owl-bot-staging/google-cloud-workflows-executions-v1/lib/google/cloud/workflows/executions/v1/rest.rb delete mode 100644 owl-bot-staging/google-cloud-workflows-executions-v1/lib/google/cloud/workflows/executions/v1/version.rb delete mode 100644 owl-bot-staging/google-cloud-workflows-executions-v1/proto_docs/README.md delete mode 100644 owl-bot-staging/google-cloud-workflows-executions-v1/proto_docs/google/api/client.rb delete mode 100644 owl-bot-staging/google-cloud-workflows-executions-v1/proto_docs/google/api/field_behavior.rb delete mode 100644 owl-bot-staging/google-cloud-workflows-executions-v1/proto_docs/google/api/launch_stage.rb delete mode 100644 owl-bot-staging/google-cloud-workflows-executions-v1/proto_docs/google/api/resource.rb delete mode 100644 owl-bot-staging/google-cloud-workflows-executions-v1/proto_docs/google/cloud/workflows/executions/v1/executions.rb delete mode 100644 owl-bot-staging/google-cloud-workflows-executions-v1/proto_docs/google/protobuf/duration.rb delete mode 100644 owl-bot-staging/google-cloud-workflows-executions-v1/proto_docs/google/protobuf/timestamp.rb delete mode 100644 owl-bot-staging/google-cloud-workflows-executions-v1/snippets/Gemfile delete mode 100644 owl-bot-staging/google-cloud-workflows-executions-v1/snippets/executions/cancel_execution.rb delete mode 100644 owl-bot-staging/google-cloud-workflows-executions-v1/snippets/executions/create_execution.rb delete mode 100644 owl-bot-staging/google-cloud-workflows-executions-v1/snippets/executions/get_execution.rb delete mode 100644 owl-bot-staging/google-cloud-workflows-executions-v1/snippets/executions/list_executions.rb delete mode 100644 owl-bot-staging/google-cloud-workflows-executions-v1/snippets/snippet_metadata_google.cloud.workflows.executions.v1.json delete mode 100644 owl-bot-staging/google-cloud-workflows-executions-v1/test/google/cloud/workflows/executions/v1/executions_paths_test.rb delete mode 100644 owl-bot-staging/google-cloud-workflows-executions-v1/test/google/cloud/workflows/executions/v1/executions_rest_test.rb delete mode 100644 owl-bot-staging/google-cloud-workflows-executions-v1/test/google/cloud/workflows/executions/v1/executions_test.rb delete mode 100644 owl-bot-staging/google-cloud-workflows-executions-v1/test/helper.rb delete mode 100644 owl-bot-staging/google-cloud-workflows-executions-v1beta/.gitignore delete mode 100644 owl-bot-staging/google-cloud-workflows-executions-v1beta/.repo-metadata.json delete mode 100644 owl-bot-staging/google-cloud-workflows-executions-v1beta/.rubocop.yml delete mode 100644 owl-bot-staging/google-cloud-workflows-executions-v1beta/.toys.rb delete mode 100644 owl-bot-staging/google-cloud-workflows-executions-v1beta/.yardopts delete mode 100644 owl-bot-staging/google-cloud-workflows-executions-v1beta/AUTHENTICATION.md delete mode 100644 owl-bot-staging/google-cloud-workflows-executions-v1beta/CHANGELOG.md delete mode 100644 owl-bot-staging/google-cloud-workflows-executions-v1beta/Gemfile delete mode 100644 owl-bot-staging/google-cloud-workflows-executions-v1beta/LICENSE.md delete mode 100644 owl-bot-staging/google-cloud-workflows-executions-v1beta/README.md delete mode 100644 owl-bot-staging/google-cloud-workflows-executions-v1beta/Rakefile delete mode 100644 owl-bot-staging/google-cloud-workflows-executions-v1beta/gapic_metadata.json delete mode 100644 owl-bot-staging/google-cloud-workflows-executions-v1beta/google-cloud-workflows-executions-v1beta.gemspec delete mode 100644 owl-bot-staging/google-cloud-workflows-executions-v1beta/lib/google-cloud-workflows-executions-v1beta.rb delete mode 100644 owl-bot-staging/google-cloud-workflows-executions-v1beta/lib/google/cloud/workflows/executions/v1beta.rb delete mode 100644 owl-bot-staging/google-cloud-workflows-executions-v1beta/lib/google/cloud/workflows/executions/v1beta/executions.rb delete mode 100644 owl-bot-staging/google-cloud-workflows-executions-v1beta/lib/google/cloud/workflows/executions/v1beta/executions/client.rb delete mode 100644 owl-bot-staging/google-cloud-workflows-executions-v1beta/lib/google/cloud/workflows/executions/v1beta/executions/credentials.rb delete mode 100644 owl-bot-staging/google-cloud-workflows-executions-v1beta/lib/google/cloud/workflows/executions/v1beta/executions/paths.rb delete mode 100644 owl-bot-staging/google-cloud-workflows-executions-v1beta/lib/google/cloud/workflows/executions/v1beta/executions_pb.rb delete mode 100644 owl-bot-staging/google-cloud-workflows-executions-v1beta/lib/google/cloud/workflows/executions/v1beta/executions_services_pb.rb delete mode 100644 owl-bot-staging/google-cloud-workflows-executions-v1beta/lib/google/cloud/workflows/executions/v1beta/version.rb delete mode 100644 owl-bot-staging/google-cloud-workflows-executions-v1beta/proto_docs/README.md delete mode 100644 owl-bot-staging/google-cloud-workflows-executions-v1beta/proto_docs/google/api/client.rb delete mode 100644 owl-bot-staging/google-cloud-workflows-executions-v1beta/proto_docs/google/api/field_behavior.rb delete mode 100644 owl-bot-staging/google-cloud-workflows-executions-v1beta/proto_docs/google/api/launch_stage.rb delete mode 100644 owl-bot-staging/google-cloud-workflows-executions-v1beta/proto_docs/google/api/resource.rb delete mode 100644 owl-bot-staging/google-cloud-workflows-executions-v1beta/proto_docs/google/cloud/workflows/executions/v1beta/executions.rb delete mode 100644 owl-bot-staging/google-cloud-workflows-executions-v1beta/proto_docs/google/protobuf/duration.rb delete mode 100644 owl-bot-staging/google-cloud-workflows-executions-v1beta/proto_docs/google/protobuf/timestamp.rb delete mode 100644 owl-bot-staging/google-cloud-workflows-executions-v1beta/snippets/Gemfile delete mode 100644 owl-bot-staging/google-cloud-workflows-executions-v1beta/snippets/executions/cancel_execution.rb delete mode 100644 owl-bot-staging/google-cloud-workflows-executions-v1beta/snippets/executions/create_execution.rb delete mode 100644 owl-bot-staging/google-cloud-workflows-executions-v1beta/snippets/executions/get_execution.rb delete mode 100644 owl-bot-staging/google-cloud-workflows-executions-v1beta/snippets/executions/list_executions.rb delete mode 100644 owl-bot-staging/google-cloud-workflows-executions-v1beta/snippets/snippet_metadata_google.cloud.workflows.executions.v1beta.json delete mode 100644 owl-bot-staging/google-cloud-workflows-executions-v1beta/test/google/cloud/workflows/executions/v1beta/executions_paths_test.rb delete mode 100644 owl-bot-staging/google-cloud-workflows-executions-v1beta/test/google/cloud/workflows/executions/v1beta/executions_test.rb delete mode 100644 owl-bot-staging/google-cloud-workflows-executions-v1beta/test/helper.rb delete mode 100644 owl-bot-staging/google-cloud-workflows-v1/.gitignore delete mode 100644 owl-bot-staging/google-cloud-workflows-v1/.repo-metadata.json delete mode 100644 owl-bot-staging/google-cloud-workflows-v1/.rubocop.yml delete mode 100644 owl-bot-staging/google-cloud-workflows-v1/.toys.rb delete mode 100644 owl-bot-staging/google-cloud-workflows-v1/.yardopts delete mode 100644 owl-bot-staging/google-cloud-workflows-v1/AUTHENTICATION.md delete mode 100644 owl-bot-staging/google-cloud-workflows-v1/CHANGELOG.md delete mode 100644 owl-bot-staging/google-cloud-workflows-v1/Gemfile delete mode 100644 owl-bot-staging/google-cloud-workflows-v1/LICENSE.md delete mode 100644 owl-bot-staging/google-cloud-workflows-v1/README.md delete mode 100644 owl-bot-staging/google-cloud-workflows-v1/Rakefile delete mode 100644 owl-bot-staging/google-cloud-workflows-v1/gapic_metadata.json delete mode 100644 owl-bot-staging/google-cloud-workflows-v1/google-cloud-workflows-v1.gemspec delete mode 100644 owl-bot-staging/google-cloud-workflows-v1/lib/google-cloud-workflows-v1.rb delete mode 100644 owl-bot-staging/google-cloud-workflows-v1/lib/google/cloud/workflows/v1.rb delete mode 100644 owl-bot-staging/google-cloud-workflows-v1/lib/google/cloud/workflows/v1/bindings_override.rb delete mode 100644 owl-bot-staging/google-cloud-workflows-v1/lib/google/cloud/workflows/v1/rest.rb delete mode 100644 owl-bot-staging/google-cloud-workflows-v1/lib/google/cloud/workflows/v1/version.rb delete mode 100644 owl-bot-staging/google-cloud-workflows-v1/lib/google/cloud/workflows/v1/workflows.rb delete mode 100644 owl-bot-staging/google-cloud-workflows-v1/lib/google/cloud/workflows/v1/workflows/client.rb delete mode 100644 owl-bot-staging/google-cloud-workflows-v1/lib/google/cloud/workflows/v1/workflows/credentials.rb delete mode 100644 owl-bot-staging/google-cloud-workflows-v1/lib/google/cloud/workflows/v1/workflows/operations.rb delete mode 100644 owl-bot-staging/google-cloud-workflows-v1/lib/google/cloud/workflows/v1/workflows/paths.rb delete mode 100644 owl-bot-staging/google-cloud-workflows-v1/lib/google/cloud/workflows/v1/workflows/rest.rb delete mode 100644 owl-bot-staging/google-cloud-workflows-v1/lib/google/cloud/workflows/v1/workflows/rest/client.rb delete mode 100644 owl-bot-staging/google-cloud-workflows-v1/lib/google/cloud/workflows/v1/workflows/rest/operations.rb delete mode 100644 owl-bot-staging/google-cloud-workflows-v1/lib/google/cloud/workflows/v1/workflows/rest/service_stub.rb delete mode 100644 owl-bot-staging/google-cloud-workflows-v1/lib/google/cloud/workflows/v1/workflows_pb.rb delete mode 100644 owl-bot-staging/google-cloud-workflows-v1/lib/google/cloud/workflows/v1/workflows_services_pb.rb delete mode 100644 owl-bot-staging/google-cloud-workflows-v1/proto_docs/README.md delete mode 100644 owl-bot-staging/google-cloud-workflows-v1/proto_docs/google/api/client.rb delete mode 100644 owl-bot-staging/google-cloud-workflows-v1/proto_docs/google/api/field_behavior.rb delete mode 100644 owl-bot-staging/google-cloud-workflows-v1/proto_docs/google/api/launch_stage.rb delete mode 100644 owl-bot-staging/google-cloud-workflows-v1/proto_docs/google/api/resource.rb delete mode 100644 owl-bot-staging/google-cloud-workflows-v1/proto_docs/google/cloud/workflows/v1/workflows.rb delete mode 100644 owl-bot-staging/google-cloud-workflows-v1/proto_docs/google/longrunning/operations.rb delete mode 100644 owl-bot-staging/google-cloud-workflows-v1/proto_docs/google/protobuf/any.rb delete mode 100644 owl-bot-staging/google-cloud-workflows-v1/proto_docs/google/protobuf/duration.rb delete mode 100644 owl-bot-staging/google-cloud-workflows-v1/proto_docs/google/protobuf/empty.rb delete mode 100644 owl-bot-staging/google-cloud-workflows-v1/proto_docs/google/protobuf/field_mask.rb delete mode 100644 owl-bot-staging/google-cloud-workflows-v1/proto_docs/google/protobuf/timestamp.rb delete mode 100644 owl-bot-staging/google-cloud-workflows-v1/proto_docs/google/rpc/status.rb delete mode 100644 owl-bot-staging/google-cloud-workflows-v1/snippets/Gemfile delete mode 100644 owl-bot-staging/google-cloud-workflows-v1/snippets/snippet_metadata_google.cloud.workflows.v1.json delete mode 100644 owl-bot-staging/google-cloud-workflows-v1/snippets/workflows/create_workflow.rb delete mode 100644 owl-bot-staging/google-cloud-workflows-v1/snippets/workflows/delete_workflow.rb delete mode 100644 owl-bot-staging/google-cloud-workflows-v1/snippets/workflows/get_workflow.rb delete mode 100644 owl-bot-staging/google-cloud-workflows-v1/snippets/workflows/list_workflow_revisions.rb delete mode 100644 owl-bot-staging/google-cloud-workflows-v1/snippets/workflows/list_workflows.rb delete mode 100644 owl-bot-staging/google-cloud-workflows-v1/snippets/workflows/update_workflow.rb delete mode 100644 owl-bot-staging/google-cloud-workflows-v1/test/google/cloud/workflows/v1/workflows_operations_test.rb delete mode 100644 owl-bot-staging/google-cloud-workflows-v1/test/google/cloud/workflows/v1/workflows_paths_test.rb delete mode 100644 owl-bot-staging/google-cloud-workflows-v1/test/google/cloud/workflows/v1/workflows_rest_test.rb delete mode 100644 owl-bot-staging/google-cloud-workflows-v1/test/google/cloud/workflows/v1/workflows_test.rb delete mode 100644 owl-bot-staging/google-cloud-workflows-v1/test/helper.rb delete mode 100644 owl-bot-staging/google-cloud-workflows-v1beta/.gitignore delete mode 100644 owl-bot-staging/google-cloud-workflows-v1beta/.repo-metadata.json delete mode 100644 owl-bot-staging/google-cloud-workflows-v1beta/.rubocop.yml delete mode 100644 owl-bot-staging/google-cloud-workflows-v1beta/.toys.rb delete mode 100644 owl-bot-staging/google-cloud-workflows-v1beta/.yardopts delete mode 100644 owl-bot-staging/google-cloud-workflows-v1beta/AUTHENTICATION.md delete mode 100644 owl-bot-staging/google-cloud-workflows-v1beta/CHANGELOG.md delete mode 100644 owl-bot-staging/google-cloud-workflows-v1beta/Gemfile delete mode 100644 owl-bot-staging/google-cloud-workflows-v1beta/LICENSE.md delete mode 100644 owl-bot-staging/google-cloud-workflows-v1beta/README.md delete mode 100644 owl-bot-staging/google-cloud-workflows-v1beta/Rakefile delete mode 100644 owl-bot-staging/google-cloud-workflows-v1beta/gapic_metadata.json delete mode 100644 owl-bot-staging/google-cloud-workflows-v1beta/google-cloud-workflows-v1beta.gemspec delete mode 100644 owl-bot-staging/google-cloud-workflows-v1beta/lib/google-cloud-workflows-v1beta.rb delete mode 100644 owl-bot-staging/google-cloud-workflows-v1beta/lib/google/cloud/workflows/v1beta.rb delete mode 100644 owl-bot-staging/google-cloud-workflows-v1beta/lib/google/cloud/workflows/v1beta/bindings_override.rb delete mode 100644 owl-bot-staging/google-cloud-workflows-v1beta/lib/google/cloud/workflows/v1beta/rest.rb delete mode 100644 owl-bot-staging/google-cloud-workflows-v1beta/lib/google/cloud/workflows/v1beta/version.rb delete mode 100644 owl-bot-staging/google-cloud-workflows-v1beta/lib/google/cloud/workflows/v1beta/workflows.rb delete mode 100644 owl-bot-staging/google-cloud-workflows-v1beta/lib/google/cloud/workflows/v1beta/workflows/client.rb delete mode 100644 owl-bot-staging/google-cloud-workflows-v1beta/lib/google/cloud/workflows/v1beta/workflows/credentials.rb delete mode 100644 owl-bot-staging/google-cloud-workflows-v1beta/lib/google/cloud/workflows/v1beta/workflows/operations.rb delete mode 100644 owl-bot-staging/google-cloud-workflows-v1beta/lib/google/cloud/workflows/v1beta/workflows/paths.rb delete mode 100644 owl-bot-staging/google-cloud-workflows-v1beta/lib/google/cloud/workflows/v1beta/workflows/rest.rb delete mode 100644 owl-bot-staging/google-cloud-workflows-v1beta/lib/google/cloud/workflows/v1beta/workflows/rest/client.rb delete mode 100644 owl-bot-staging/google-cloud-workflows-v1beta/lib/google/cloud/workflows/v1beta/workflows/rest/operations.rb delete mode 100644 owl-bot-staging/google-cloud-workflows-v1beta/lib/google/cloud/workflows/v1beta/workflows/rest/service_stub.rb delete mode 100644 owl-bot-staging/google-cloud-workflows-v1beta/lib/google/cloud/workflows/v1beta/workflows_pb.rb delete mode 100644 owl-bot-staging/google-cloud-workflows-v1beta/lib/google/cloud/workflows/v1beta/workflows_services_pb.rb delete mode 100644 owl-bot-staging/google-cloud-workflows-v1beta/proto_docs/README.md delete mode 100644 owl-bot-staging/google-cloud-workflows-v1beta/proto_docs/google/api/client.rb delete mode 100644 owl-bot-staging/google-cloud-workflows-v1beta/proto_docs/google/api/field_behavior.rb delete mode 100644 owl-bot-staging/google-cloud-workflows-v1beta/proto_docs/google/api/launch_stage.rb delete mode 100644 owl-bot-staging/google-cloud-workflows-v1beta/proto_docs/google/api/resource.rb delete mode 100644 owl-bot-staging/google-cloud-workflows-v1beta/proto_docs/google/cloud/workflows/v1beta/workflows.rb delete mode 100644 owl-bot-staging/google-cloud-workflows-v1beta/proto_docs/google/longrunning/operations.rb delete mode 100644 owl-bot-staging/google-cloud-workflows-v1beta/proto_docs/google/protobuf/any.rb delete mode 100644 owl-bot-staging/google-cloud-workflows-v1beta/proto_docs/google/protobuf/duration.rb delete mode 100644 owl-bot-staging/google-cloud-workflows-v1beta/proto_docs/google/protobuf/empty.rb delete mode 100644 owl-bot-staging/google-cloud-workflows-v1beta/proto_docs/google/protobuf/field_mask.rb delete mode 100644 owl-bot-staging/google-cloud-workflows-v1beta/proto_docs/google/protobuf/timestamp.rb delete mode 100644 owl-bot-staging/google-cloud-workflows-v1beta/proto_docs/google/rpc/status.rb delete mode 100644 owl-bot-staging/google-cloud-workflows-v1beta/snippets/Gemfile delete mode 100644 owl-bot-staging/google-cloud-workflows-v1beta/snippets/snippet_metadata_google.cloud.workflows.v1beta.json delete mode 100644 owl-bot-staging/google-cloud-workflows-v1beta/snippets/workflows/create_workflow.rb delete mode 100644 owl-bot-staging/google-cloud-workflows-v1beta/snippets/workflows/delete_workflow.rb delete mode 100644 owl-bot-staging/google-cloud-workflows-v1beta/snippets/workflows/get_workflow.rb delete mode 100644 owl-bot-staging/google-cloud-workflows-v1beta/snippets/workflows/list_workflows.rb delete mode 100644 owl-bot-staging/google-cloud-workflows-v1beta/snippets/workflows/update_workflow.rb delete mode 100644 owl-bot-staging/google-cloud-workflows-v1beta/test/google/cloud/workflows/v1beta/workflows_operations_test.rb delete mode 100644 owl-bot-staging/google-cloud-workflows-v1beta/test/google/cloud/workflows/v1beta/workflows_paths_test.rb delete mode 100644 owl-bot-staging/google-cloud-workflows-v1beta/test/google/cloud/workflows/v1beta/workflows_rest_test.rb delete mode 100644 owl-bot-staging/google-cloud-workflows-v1beta/test/google/cloud/workflows/v1beta/workflows_test.rb delete mode 100644 owl-bot-staging/google-cloud-workflows-v1beta/test/helper.rb delete mode 100644 owl-bot-staging/google-cloud-workstations-v1/.gitignore delete mode 100644 owl-bot-staging/google-cloud-workstations-v1/.repo-metadata.json delete mode 100644 owl-bot-staging/google-cloud-workstations-v1/.rubocop.yml delete mode 100644 owl-bot-staging/google-cloud-workstations-v1/.toys.rb delete mode 100644 owl-bot-staging/google-cloud-workstations-v1/.yardopts delete mode 100644 owl-bot-staging/google-cloud-workstations-v1/AUTHENTICATION.md delete mode 100644 owl-bot-staging/google-cloud-workstations-v1/CHANGELOG.md delete mode 100644 owl-bot-staging/google-cloud-workstations-v1/Gemfile delete mode 100644 owl-bot-staging/google-cloud-workstations-v1/LICENSE.md delete mode 100644 owl-bot-staging/google-cloud-workstations-v1/README.md delete mode 100644 owl-bot-staging/google-cloud-workstations-v1/Rakefile delete mode 100644 owl-bot-staging/google-cloud-workstations-v1/gapic_metadata.json delete mode 100644 owl-bot-staging/google-cloud-workstations-v1/google-cloud-workstations-v1.gemspec delete mode 100644 owl-bot-staging/google-cloud-workstations-v1/lib/google-cloud-workstations-v1.rb delete mode 100644 owl-bot-staging/google-cloud-workstations-v1/lib/google/cloud/workstations/v1.rb delete mode 100644 owl-bot-staging/google-cloud-workstations-v1/lib/google/cloud/workstations/v1/bindings_override.rb delete mode 100644 owl-bot-staging/google-cloud-workstations-v1/lib/google/cloud/workstations/v1/rest.rb delete mode 100644 owl-bot-staging/google-cloud-workstations-v1/lib/google/cloud/workstations/v1/version.rb delete mode 100644 owl-bot-staging/google-cloud-workstations-v1/lib/google/cloud/workstations/v1/workstations.rb delete mode 100644 owl-bot-staging/google-cloud-workstations-v1/lib/google/cloud/workstations/v1/workstations/client.rb delete mode 100644 owl-bot-staging/google-cloud-workstations-v1/lib/google/cloud/workstations/v1/workstations/credentials.rb delete mode 100644 owl-bot-staging/google-cloud-workstations-v1/lib/google/cloud/workstations/v1/workstations/operations.rb delete mode 100644 owl-bot-staging/google-cloud-workstations-v1/lib/google/cloud/workstations/v1/workstations/paths.rb delete mode 100644 owl-bot-staging/google-cloud-workstations-v1/lib/google/cloud/workstations/v1/workstations/rest.rb delete mode 100644 owl-bot-staging/google-cloud-workstations-v1/lib/google/cloud/workstations/v1/workstations/rest/client.rb delete mode 100644 owl-bot-staging/google-cloud-workstations-v1/lib/google/cloud/workstations/v1/workstations/rest/operations.rb delete mode 100644 owl-bot-staging/google-cloud-workstations-v1/lib/google/cloud/workstations/v1/workstations/rest/service_stub.rb delete mode 100644 owl-bot-staging/google-cloud-workstations-v1/lib/google/cloud/workstations/v1/workstations_pb.rb delete mode 100644 owl-bot-staging/google-cloud-workstations-v1/lib/google/cloud/workstations/v1/workstations_services_pb.rb delete mode 100644 owl-bot-staging/google-cloud-workstations-v1/proto_docs/README.md delete mode 100644 owl-bot-staging/google-cloud-workstations-v1/proto_docs/google/api/client.rb delete mode 100644 owl-bot-staging/google-cloud-workstations-v1/proto_docs/google/api/field_behavior.rb delete mode 100644 owl-bot-staging/google-cloud-workstations-v1/proto_docs/google/api/launch_stage.rb delete mode 100644 owl-bot-staging/google-cloud-workstations-v1/proto_docs/google/api/resource.rb delete mode 100644 owl-bot-staging/google-cloud-workstations-v1/proto_docs/google/cloud/workstations/v1/workstations.rb delete mode 100644 owl-bot-staging/google-cloud-workstations-v1/proto_docs/google/longrunning/operations.rb delete mode 100644 owl-bot-staging/google-cloud-workstations-v1/proto_docs/google/protobuf/any.rb delete mode 100644 owl-bot-staging/google-cloud-workstations-v1/proto_docs/google/protobuf/duration.rb delete mode 100644 owl-bot-staging/google-cloud-workstations-v1/proto_docs/google/protobuf/empty.rb delete mode 100644 owl-bot-staging/google-cloud-workstations-v1/proto_docs/google/protobuf/field_mask.rb delete mode 100644 owl-bot-staging/google-cloud-workstations-v1/proto_docs/google/protobuf/timestamp.rb delete mode 100644 owl-bot-staging/google-cloud-workstations-v1/proto_docs/google/rpc/status.rb delete mode 100644 owl-bot-staging/google-cloud-workstations-v1/proto_docs/google/type/expr.rb delete mode 100644 owl-bot-staging/google-cloud-workstations-v1/snippets/Gemfile delete mode 100644 owl-bot-staging/google-cloud-workstations-v1/snippets/snippet_metadata_google.cloud.workstations.v1.json delete mode 100644 owl-bot-staging/google-cloud-workstations-v1/snippets/workstations/create_workstation.rb delete mode 100644 owl-bot-staging/google-cloud-workstations-v1/snippets/workstations/create_workstation_cluster.rb delete mode 100644 owl-bot-staging/google-cloud-workstations-v1/snippets/workstations/create_workstation_config.rb delete mode 100644 owl-bot-staging/google-cloud-workstations-v1/snippets/workstations/delete_workstation.rb delete mode 100644 owl-bot-staging/google-cloud-workstations-v1/snippets/workstations/delete_workstation_cluster.rb delete mode 100644 owl-bot-staging/google-cloud-workstations-v1/snippets/workstations/delete_workstation_config.rb delete mode 100644 owl-bot-staging/google-cloud-workstations-v1/snippets/workstations/generate_access_token.rb delete mode 100644 owl-bot-staging/google-cloud-workstations-v1/snippets/workstations/get_workstation.rb delete mode 100644 owl-bot-staging/google-cloud-workstations-v1/snippets/workstations/get_workstation_cluster.rb delete mode 100644 owl-bot-staging/google-cloud-workstations-v1/snippets/workstations/get_workstation_config.rb delete mode 100644 owl-bot-staging/google-cloud-workstations-v1/snippets/workstations/list_usable_workstation_configs.rb delete mode 100644 owl-bot-staging/google-cloud-workstations-v1/snippets/workstations/list_usable_workstations.rb delete mode 100644 owl-bot-staging/google-cloud-workstations-v1/snippets/workstations/list_workstation_clusters.rb delete mode 100644 owl-bot-staging/google-cloud-workstations-v1/snippets/workstations/list_workstation_configs.rb delete mode 100644 owl-bot-staging/google-cloud-workstations-v1/snippets/workstations/list_workstations.rb delete mode 100644 owl-bot-staging/google-cloud-workstations-v1/snippets/workstations/start_workstation.rb delete mode 100644 owl-bot-staging/google-cloud-workstations-v1/snippets/workstations/stop_workstation.rb delete mode 100644 owl-bot-staging/google-cloud-workstations-v1/snippets/workstations/update_workstation.rb delete mode 100644 owl-bot-staging/google-cloud-workstations-v1/snippets/workstations/update_workstation_cluster.rb delete mode 100644 owl-bot-staging/google-cloud-workstations-v1/snippets/workstations/update_workstation_config.rb delete mode 100644 owl-bot-staging/google-cloud-workstations-v1/test/google/cloud/workstations/v1/workstations_operations_test.rb delete mode 100644 owl-bot-staging/google-cloud-workstations-v1/test/google/cloud/workstations/v1/workstations_paths_test.rb delete mode 100644 owl-bot-staging/google-cloud-workstations-v1/test/google/cloud/workstations/v1/workstations_rest_test.rb delete mode 100644 owl-bot-staging/google-cloud-workstations-v1/test/google/cloud/workstations/v1/workstations_test.rb delete mode 100644 owl-bot-staging/google-cloud-workstations-v1/test/helper.rb delete mode 100644 owl-bot-staging/google-cloud-workstations-v1beta/.gitignore delete mode 100644 owl-bot-staging/google-cloud-workstations-v1beta/.repo-metadata.json delete mode 100644 owl-bot-staging/google-cloud-workstations-v1beta/.rubocop.yml delete mode 100644 owl-bot-staging/google-cloud-workstations-v1beta/.toys.rb delete mode 100644 owl-bot-staging/google-cloud-workstations-v1beta/.yardopts delete mode 100644 owl-bot-staging/google-cloud-workstations-v1beta/AUTHENTICATION.md delete mode 100644 owl-bot-staging/google-cloud-workstations-v1beta/CHANGELOG.md delete mode 100644 owl-bot-staging/google-cloud-workstations-v1beta/Gemfile delete mode 100644 owl-bot-staging/google-cloud-workstations-v1beta/LICENSE.md delete mode 100644 owl-bot-staging/google-cloud-workstations-v1beta/README.md delete mode 100644 owl-bot-staging/google-cloud-workstations-v1beta/Rakefile delete mode 100644 owl-bot-staging/google-cloud-workstations-v1beta/gapic_metadata.json delete mode 100644 owl-bot-staging/google-cloud-workstations-v1beta/google-cloud-workstations-v1beta.gemspec delete mode 100644 owl-bot-staging/google-cloud-workstations-v1beta/lib/google-cloud-workstations-v1beta.rb delete mode 100644 owl-bot-staging/google-cloud-workstations-v1beta/lib/google/cloud/workstations/v1beta.rb delete mode 100644 owl-bot-staging/google-cloud-workstations-v1beta/lib/google/cloud/workstations/v1beta/bindings_override.rb delete mode 100644 owl-bot-staging/google-cloud-workstations-v1beta/lib/google/cloud/workstations/v1beta/rest.rb delete mode 100644 owl-bot-staging/google-cloud-workstations-v1beta/lib/google/cloud/workstations/v1beta/version.rb delete mode 100644 owl-bot-staging/google-cloud-workstations-v1beta/lib/google/cloud/workstations/v1beta/workstations.rb delete mode 100644 owl-bot-staging/google-cloud-workstations-v1beta/lib/google/cloud/workstations/v1beta/workstations/client.rb delete mode 100644 owl-bot-staging/google-cloud-workstations-v1beta/lib/google/cloud/workstations/v1beta/workstations/credentials.rb delete mode 100644 owl-bot-staging/google-cloud-workstations-v1beta/lib/google/cloud/workstations/v1beta/workstations/operations.rb delete mode 100644 owl-bot-staging/google-cloud-workstations-v1beta/lib/google/cloud/workstations/v1beta/workstations/paths.rb delete mode 100644 owl-bot-staging/google-cloud-workstations-v1beta/lib/google/cloud/workstations/v1beta/workstations/rest.rb delete mode 100644 owl-bot-staging/google-cloud-workstations-v1beta/lib/google/cloud/workstations/v1beta/workstations/rest/client.rb delete mode 100644 owl-bot-staging/google-cloud-workstations-v1beta/lib/google/cloud/workstations/v1beta/workstations/rest/operations.rb delete mode 100644 owl-bot-staging/google-cloud-workstations-v1beta/lib/google/cloud/workstations/v1beta/workstations/rest/service_stub.rb delete mode 100644 owl-bot-staging/google-cloud-workstations-v1beta/lib/google/cloud/workstations/v1beta/workstations_pb.rb delete mode 100644 owl-bot-staging/google-cloud-workstations-v1beta/lib/google/cloud/workstations/v1beta/workstations_services_pb.rb delete mode 100644 owl-bot-staging/google-cloud-workstations-v1beta/proto_docs/README.md delete mode 100644 owl-bot-staging/google-cloud-workstations-v1beta/proto_docs/google/api/client.rb delete mode 100644 owl-bot-staging/google-cloud-workstations-v1beta/proto_docs/google/api/field_behavior.rb delete mode 100644 owl-bot-staging/google-cloud-workstations-v1beta/proto_docs/google/api/launch_stage.rb delete mode 100644 owl-bot-staging/google-cloud-workstations-v1beta/proto_docs/google/api/resource.rb delete mode 100644 owl-bot-staging/google-cloud-workstations-v1beta/proto_docs/google/cloud/workstations/v1beta/workstations.rb delete mode 100644 owl-bot-staging/google-cloud-workstations-v1beta/proto_docs/google/longrunning/operations.rb delete mode 100644 owl-bot-staging/google-cloud-workstations-v1beta/proto_docs/google/protobuf/any.rb delete mode 100644 owl-bot-staging/google-cloud-workstations-v1beta/proto_docs/google/protobuf/duration.rb delete mode 100644 owl-bot-staging/google-cloud-workstations-v1beta/proto_docs/google/protobuf/empty.rb delete mode 100644 owl-bot-staging/google-cloud-workstations-v1beta/proto_docs/google/protobuf/field_mask.rb delete mode 100644 owl-bot-staging/google-cloud-workstations-v1beta/proto_docs/google/protobuf/timestamp.rb delete mode 100644 owl-bot-staging/google-cloud-workstations-v1beta/proto_docs/google/rpc/status.rb delete mode 100644 owl-bot-staging/google-cloud-workstations-v1beta/proto_docs/google/type/expr.rb delete mode 100644 owl-bot-staging/google-cloud-workstations-v1beta/snippets/Gemfile delete mode 100644 owl-bot-staging/google-cloud-workstations-v1beta/snippets/snippet_metadata_google.cloud.workstations.v1beta.json delete mode 100644 owl-bot-staging/google-cloud-workstations-v1beta/snippets/workstations/create_workstation.rb delete mode 100644 owl-bot-staging/google-cloud-workstations-v1beta/snippets/workstations/create_workstation_cluster.rb delete mode 100644 owl-bot-staging/google-cloud-workstations-v1beta/snippets/workstations/create_workstation_config.rb delete mode 100644 owl-bot-staging/google-cloud-workstations-v1beta/snippets/workstations/delete_workstation.rb delete mode 100644 owl-bot-staging/google-cloud-workstations-v1beta/snippets/workstations/delete_workstation_cluster.rb delete mode 100644 owl-bot-staging/google-cloud-workstations-v1beta/snippets/workstations/delete_workstation_config.rb delete mode 100644 owl-bot-staging/google-cloud-workstations-v1beta/snippets/workstations/generate_access_token.rb delete mode 100644 owl-bot-staging/google-cloud-workstations-v1beta/snippets/workstations/get_workstation.rb delete mode 100644 owl-bot-staging/google-cloud-workstations-v1beta/snippets/workstations/get_workstation_cluster.rb delete mode 100644 owl-bot-staging/google-cloud-workstations-v1beta/snippets/workstations/get_workstation_config.rb delete mode 100644 owl-bot-staging/google-cloud-workstations-v1beta/snippets/workstations/list_usable_workstation_configs.rb delete mode 100644 owl-bot-staging/google-cloud-workstations-v1beta/snippets/workstations/list_usable_workstations.rb delete mode 100644 owl-bot-staging/google-cloud-workstations-v1beta/snippets/workstations/list_workstation_clusters.rb delete mode 100644 owl-bot-staging/google-cloud-workstations-v1beta/snippets/workstations/list_workstation_configs.rb delete mode 100644 owl-bot-staging/google-cloud-workstations-v1beta/snippets/workstations/list_workstations.rb delete mode 100644 owl-bot-staging/google-cloud-workstations-v1beta/snippets/workstations/start_workstation.rb delete mode 100644 owl-bot-staging/google-cloud-workstations-v1beta/snippets/workstations/stop_workstation.rb delete mode 100644 owl-bot-staging/google-cloud-workstations-v1beta/snippets/workstations/update_workstation.rb delete mode 100644 owl-bot-staging/google-cloud-workstations-v1beta/snippets/workstations/update_workstation_cluster.rb delete mode 100644 owl-bot-staging/google-cloud-workstations-v1beta/snippets/workstations/update_workstation_config.rb delete mode 100644 owl-bot-staging/google-cloud-workstations-v1beta/test/google/cloud/workstations/v1beta/workstations_operations_test.rb delete mode 100644 owl-bot-staging/google-cloud-workstations-v1beta/test/google/cloud/workstations/v1beta/workstations_paths_test.rb delete mode 100644 owl-bot-staging/google-cloud-workstations-v1beta/test/google/cloud/workstations/v1beta/workstations_rest_test.rb delete mode 100644 owl-bot-staging/google-cloud-workstations-v1beta/test/google/cloud/workstations/v1beta/workstations_test.rb delete mode 100644 owl-bot-staging/google-cloud-workstations-v1beta/test/helper.rb delete mode 100644 owl-bot-staging/google-iam-credentials-v1/.gitignore delete mode 100644 owl-bot-staging/google-iam-credentials-v1/.repo-metadata.json delete mode 100644 owl-bot-staging/google-iam-credentials-v1/.rubocop.yml delete mode 100644 owl-bot-staging/google-iam-credentials-v1/.toys.rb delete mode 100644 owl-bot-staging/google-iam-credentials-v1/.yardopts delete mode 100644 owl-bot-staging/google-iam-credentials-v1/AUTHENTICATION.md delete mode 100644 owl-bot-staging/google-iam-credentials-v1/CHANGELOG.md delete mode 100644 owl-bot-staging/google-iam-credentials-v1/Gemfile delete mode 100644 owl-bot-staging/google-iam-credentials-v1/LICENSE.md delete mode 100644 owl-bot-staging/google-iam-credentials-v1/README.md delete mode 100644 owl-bot-staging/google-iam-credentials-v1/Rakefile delete mode 100644 owl-bot-staging/google-iam-credentials-v1/gapic_metadata.json delete mode 100644 owl-bot-staging/google-iam-credentials-v1/google-iam-credentials-v1.gemspec delete mode 100644 owl-bot-staging/google-iam-credentials-v1/lib/google-iam-credentials-v1.rb delete mode 100644 owl-bot-staging/google-iam-credentials-v1/lib/google/iam/credentials/v1.rb delete mode 100644 owl-bot-staging/google-iam-credentials-v1/lib/google/iam/credentials/v1/common_pb.rb delete mode 100644 owl-bot-staging/google-iam-credentials-v1/lib/google/iam/credentials/v1/iam_credentials.rb delete mode 100644 owl-bot-staging/google-iam-credentials-v1/lib/google/iam/credentials/v1/iam_credentials/client.rb delete mode 100644 owl-bot-staging/google-iam-credentials-v1/lib/google/iam/credentials/v1/iam_credentials/credentials.rb delete mode 100644 owl-bot-staging/google-iam-credentials-v1/lib/google/iam/credentials/v1/iam_credentials/paths.rb delete mode 100644 owl-bot-staging/google-iam-credentials-v1/lib/google/iam/credentials/v1/iam_credentials/rest.rb delete mode 100644 owl-bot-staging/google-iam-credentials-v1/lib/google/iam/credentials/v1/iam_credentials/rest/client.rb delete mode 100644 owl-bot-staging/google-iam-credentials-v1/lib/google/iam/credentials/v1/iam_credentials/rest/service_stub.rb delete mode 100644 owl-bot-staging/google-iam-credentials-v1/lib/google/iam/credentials/v1/iamcredentials_pb.rb delete mode 100644 owl-bot-staging/google-iam-credentials-v1/lib/google/iam/credentials/v1/iamcredentials_services_pb.rb delete mode 100644 owl-bot-staging/google-iam-credentials-v1/lib/google/iam/credentials/v1/rest.rb delete mode 100644 owl-bot-staging/google-iam-credentials-v1/lib/google/iam/credentials/v1/version.rb delete mode 100644 owl-bot-staging/google-iam-credentials-v1/proto_docs/README.md delete mode 100644 owl-bot-staging/google-iam-credentials-v1/proto_docs/google/api/client.rb delete mode 100644 owl-bot-staging/google-iam-credentials-v1/proto_docs/google/api/field_behavior.rb delete mode 100644 owl-bot-staging/google-iam-credentials-v1/proto_docs/google/api/launch_stage.rb delete mode 100644 owl-bot-staging/google-iam-credentials-v1/proto_docs/google/api/resource.rb delete mode 100644 owl-bot-staging/google-iam-credentials-v1/proto_docs/google/iam/credentials/v1/common.rb delete mode 100644 owl-bot-staging/google-iam-credentials-v1/proto_docs/google/protobuf/duration.rb delete mode 100644 owl-bot-staging/google-iam-credentials-v1/proto_docs/google/protobuf/timestamp.rb delete mode 100644 owl-bot-staging/google-iam-credentials-v1/snippets/Gemfile delete mode 100644 owl-bot-staging/google-iam-credentials-v1/snippets/iam_credentials/generate_access_token.rb delete mode 100644 owl-bot-staging/google-iam-credentials-v1/snippets/iam_credentials/generate_id_token.rb delete mode 100644 owl-bot-staging/google-iam-credentials-v1/snippets/iam_credentials/sign_blob.rb delete mode 100644 owl-bot-staging/google-iam-credentials-v1/snippets/iam_credentials/sign_jwt.rb delete mode 100644 owl-bot-staging/google-iam-credentials-v1/snippets/snippet_metadata_google.iam.credentials.v1.json delete mode 100644 owl-bot-staging/google-iam-credentials-v1/test/google/iam/credentials/v1/iam_credentials_paths_test.rb delete mode 100644 owl-bot-staging/google-iam-credentials-v1/test/google/iam/credentials/v1/iam_credentials_rest_test.rb delete mode 100644 owl-bot-staging/google-iam-credentials-v1/test/google/iam/credentials/v1/iam_credentials_test.rb delete mode 100644 owl-bot-staging/google-iam-credentials-v1/test/helper.rb delete mode 100644 owl-bot-staging/google-iam-v1/.gitignore delete mode 100644 owl-bot-staging/google-iam-v1/.repo-metadata.json delete mode 100644 owl-bot-staging/google-iam-v1/.rubocop.yml delete mode 100644 owl-bot-staging/google-iam-v1/.toys.rb delete mode 100644 owl-bot-staging/google-iam-v1/.yardopts delete mode 100644 owl-bot-staging/google-iam-v1/AUTHENTICATION.md delete mode 100644 owl-bot-staging/google-iam-v1/CHANGELOG.md delete mode 100644 owl-bot-staging/google-iam-v1/Gemfile delete mode 100644 owl-bot-staging/google-iam-v1/LICENSE.md delete mode 100644 owl-bot-staging/google-iam-v1/README.md delete mode 100644 owl-bot-staging/google-iam-v1/Rakefile delete mode 100644 owl-bot-staging/google-iam-v1/gapic_metadata.json delete mode 100644 owl-bot-staging/google-iam-v1/google-iam-v1.gemspec delete mode 100644 owl-bot-staging/google-iam-v1/lib/google-iam-v1.rb delete mode 100644 owl-bot-staging/google-iam-v1/lib/google/iam/v1.rb delete mode 100644 owl-bot-staging/google-iam-v1/lib/google/iam/v1/iam_policy.rb delete mode 100644 owl-bot-staging/google-iam-v1/lib/google/iam/v1/iam_policy/client.rb delete mode 100644 owl-bot-staging/google-iam-v1/lib/google/iam/v1/iam_policy/credentials.rb delete mode 100644 owl-bot-staging/google-iam-v1/lib/google/iam/v1/iam_policy/rest.rb delete mode 100644 owl-bot-staging/google-iam-v1/lib/google/iam/v1/iam_policy/rest/client.rb delete mode 100644 owl-bot-staging/google-iam-v1/lib/google/iam/v1/iam_policy/rest/service_stub.rb delete mode 100644 owl-bot-staging/google-iam-v1/lib/google/iam/v1/iam_policy_pb.rb delete mode 100644 owl-bot-staging/google-iam-v1/lib/google/iam/v1/iam_policy_services_pb.rb delete mode 100644 owl-bot-staging/google-iam-v1/lib/google/iam/v1/logging/audit_data_pb.rb delete mode 100644 owl-bot-staging/google-iam-v1/lib/google/iam/v1/options_pb.rb delete mode 100644 owl-bot-staging/google-iam-v1/lib/google/iam/v1/policy_pb.rb delete mode 100644 owl-bot-staging/google-iam-v1/lib/google/iam/v1/resource_policy_member_pb.rb delete mode 100644 owl-bot-staging/google-iam-v1/lib/google/iam/v1/rest.rb delete mode 100644 owl-bot-staging/google-iam-v1/lib/google/iam/v1/version.rb delete mode 100644 owl-bot-staging/google-iam-v1/proto_docs/README.md delete mode 100644 owl-bot-staging/google-iam-v1/proto_docs/google/api/client.rb delete mode 100644 owl-bot-staging/google-iam-v1/proto_docs/google/api/field_behavior.rb delete mode 100644 owl-bot-staging/google-iam-v1/proto_docs/google/api/launch_stage.rb delete mode 100644 owl-bot-staging/google-iam-v1/proto_docs/google/api/resource.rb delete mode 100644 owl-bot-staging/google-iam-v1/proto_docs/google/iam/v1/iam_policy.rb delete mode 100644 owl-bot-staging/google-iam-v1/proto_docs/google/iam/v1/options.rb delete mode 100644 owl-bot-staging/google-iam-v1/proto_docs/google/iam/v1/policy.rb delete mode 100644 owl-bot-staging/google-iam-v1/proto_docs/google/iam/v1/resource_policy_member.rb delete mode 100644 owl-bot-staging/google-iam-v1/proto_docs/google/protobuf/duration.rb delete mode 100644 owl-bot-staging/google-iam-v1/proto_docs/google/protobuf/field_mask.rb delete mode 100644 owl-bot-staging/google-iam-v1/proto_docs/google/type/expr.rb delete mode 100644 owl-bot-staging/google-iam-v1/snippets/Gemfile delete mode 100644 owl-bot-staging/google-iam-v1/snippets/iam_policy/get_iam_policy.rb delete mode 100644 owl-bot-staging/google-iam-v1/snippets/iam_policy/set_iam_policy.rb delete mode 100644 owl-bot-staging/google-iam-v1/snippets/iam_policy/test_iam_permissions.rb delete mode 100644 owl-bot-staging/google-iam-v1/snippets/snippet_metadata_google.iam.v1.json delete mode 100644 owl-bot-staging/google-iam-v1/test/google/iam/v1/iam_policy_rest_test.rb delete mode 100644 owl-bot-staging/google-iam-v1/test/google/iam/v1/iam_policy_test.rb delete mode 100644 owl-bot-staging/google-iam-v1/test/helper.rb delete mode 100644 owl-bot-staging/google-iam-v1beta/.gitignore delete mode 100644 owl-bot-staging/google-iam-v1beta/.repo-metadata.json delete mode 100644 owl-bot-staging/google-iam-v1beta/.rubocop.yml delete mode 100644 owl-bot-staging/google-iam-v1beta/.toys.rb delete mode 100644 owl-bot-staging/google-iam-v1beta/.yardopts delete mode 100644 owl-bot-staging/google-iam-v1beta/AUTHENTICATION.md delete mode 100644 owl-bot-staging/google-iam-v1beta/CHANGELOG.md delete mode 100644 owl-bot-staging/google-iam-v1beta/Gemfile delete mode 100644 owl-bot-staging/google-iam-v1beta/LICENSE.md delete mode 100644 owl-bot-staging/google-iam-v1beta/README.md delete mode 100644 owl-bot-staging/google-iam-v1beta/Rakefile delete mode 100644 owl-bot-staging/google-iam-v1beta/gapic_metadata.json delete mode 100644 owl-bot-staging/google-iam-v1beta/google-iam-v1beta.gemspec delete mode 100644 owl-bot-staging/google-iam-v1beta/lib/google-iam-v1beta.rb delete mode 100644 owl-bot-staging/google-iam-v1beta/lib/google/iam/v1beta.rb delete mode 100644 owl-bot-staging/google-iam-v1beta/lib/google/iam/v1beta/version.rb delete mode 100644 owl-bot-staging/google-iam-v1beta/lib/google/iam/v1beta/workload_identity_pool_pb.rb delete mode 100644 owl-bot-staging/google-iam-v1beta/lib/google/iam/v1beta/workload_identity_pool_services_pb.rb delete mode 100644 owl-bot-staging/google-iam-v1beta/lib/google/iam/v1beta/workload_identity_pools.rb delete mode 100644 owl-bot-staging/google-iam-v1beta/lib/google/iam/v1beta/workload_identity_pools/client.rb delete mode 100644 owl-bot-staging/google-iam-v1beta/lib/google/iam/v1beta/workload_identity_pools/credentials.rb delete mode 100644 owl-bot-staging/google-iam-v1beta/lib/google/iam/v1beta/workload_identity_pools/operations.rb delete mode 100644 owl-bot-staging/google-iam-v1beta/lib/google/iam/v1beta/workload_identity_pools/paths.rb delete mode 100644 owl-bot-staging/google-iam-v1beta/proto_docs/README.md delete mode 100644 owl-bot-staging/google-iam-v1beta/proto_docs/google/api/client.rb delete mode 100644 owl-bot-staging/google-iam-v1beta/proto_docs/google/api/field_behavior.rb delete mode 100644 owl-bot-staging/google-iam-v1beta/proto_docs/google/api/launch_stage.rb delete mode 100644 owl-bot-staging/google-iam-v1beta/proto_docs/google/api/resource.rb delete mode 100644 owl-bot-staging/google-iam-v1beta/proto_docs/google/iam/v1beta/workload_identity_pool.rb delete mode 100644 owl-bot-staging/google-iam-v1beta/proto_docs/google/longrunning/operations.rb delete mode 100644 owl-bot-staging/google-iam-v1beta/proto_docs/google/protobuf/any.rb delete mode 100644 owl-bot-staging/google-iam-v1beta/proto_docs/google/protobuf/duration.rb delete mode 100644 owl-bot-staging/google-iam-v1beta/proto_docs/google/protobuf/empty.rb delete mode 100644 owl-bot-staging/google-iam-v1beta/proto_docs/google/protobuf/field_mask.rb delete mode 100644 owl-bot-staging/google-iam-v1beta/proto_docs/google/rpc/status.rb delete mode 100644 owl-bot-staging/google-iam-v1beta/snippets/Gemfile delete mode 100644 owl-bot-staging/google-iam-v1beta/snippets/snippet_metadata_google.iam.v1beta.json delete mode 100644 owl-bot-staging/google-iam-v1beta/snippets/workload_identity_pools/create_workload_identity_pool.rb delete mode 100644 owl-bot-staging/google-iam-v1beta/snippets/workload_identity_pools/create_workload_identity_pool_provider.rb delete mode 100644 owl-bot-staging/google-iam-v1beta/snippets/workload_identity_pools/delete_workload_identity_pool.rb delete mode 100644 owl-bot-staging/google-iam-v1beta/snippets/workload_identity_pools/delete_workload_identity_pool_provider.rb delete mode 100644 owl-bot-staging/google-iam-v1beta/snippets/workload_identity_pools/get_workload_identity_pool.rb delete mode 100644 owl-bot-staging/google-iam-v1beta/snippets/workload_identity_pools/get_workload_identity_pool_provider.rb delete mode 100644 owl-bot-staging/google-iam-v1beta/snippets/workload_identity_pools/list_workload_identity_pool_providers.rb delete mode 100644 owl-bot-staging/google-iam-v1beta/snippets/workload_identity_pools/list_workload_identity_pools.rb delete mode 100644 owl-bot-staging/google-iam-v1beta/snippets/workload_identity_pools/undelete_workload_identity_pool.rb delete mode 100644 owl-bot-staging/google-iam-v1beta/snippets/workload_identity_pools/undelete_workload_identity_pool_provider.rb delete mode 100644 owl-bot-staging/google-iam-v1beta/snippets/workload_identity_pools/update_workload_identity_pool.rb delete mode 100644 owl-bot-staging/google-iam-v1beta/snippets/workload_identity_pools/update_workload_identity_pool_provider.rb delete mode 100644 owl-bot-staging/google-iam-v1beta/test/google/iam/v1beta/workload_identity_pools_operations_test.rb delete mode 100644 owl-bot-staging/google-iam-v1beta/test/google/iam/v1beta/workload_identity_pools_paths_test.rb delete mode 100644 owl-bot-staging/google-iam-v1beta/test/google/iam/v1beta/workload_identity_pools_test.rb delete mode 100644 owl-bot-staging/google-iam-v1beta/test/helper.rb delete mode 100644 owl-bot-staging/google-iam-v2/.gitignore delete mode 100644 owl-bot-staging/google-iam-v2/.repo-metadata.json delete mode 100644 owl-bot-staging/google-iam-v2/.rubocop.yml delete mode 100644 owl-bot-staging/google-iam-v2/.toys.rb delete mode 100644 owl-bot-staging/google-iam-v2/.yardopts delete mode 100644 owl-bot-staging/google-iam-v2/AUTHENTICATION.md delete mode 100644 owl-bot-staging/google-iam-v2/CHANGELOG.md delete mode 100644 owl-bot-staging/google-iam-v2/Gemfile delete mode 100644 owl-bot-staging/google-iam-v2/LICENSE.md delete mode 100644 owl-bot-staging/google-iam-v2/README.md delete mode 100644 owl-bot-staging/google-iam-v2/Rakefile delete mode 100644 owl-bot-staging/google-iam-v2/gapic_metadata.json delete mode 100644 owl-bot-staging/google-iam-v2/google-iam-v2.gemspec delete mode 100644 owl-bot-staging/google-iam-v2/lib/google-iam-v2.rb delete mode 100644 owl-bot-staging/google-iam-v2/lib/google/iam/v2.rb delete mode 100644 owl-bot-staging/google-iam-v2/lib/google/iam/v2/deny_pb.rb delete mode 100644 owl-bot-staging/google-iam-v2/lib/google/iam/v2/policies.rb delete mode 100644 owl-bot-staging/google-iam-v2/lib/google/iam/v2/policies/client.rb delete mode 100644 owl-bot-staging/google-iam-v2/lib/google/iam/v2/policies/credentials.rb delete mode 100644 owl-bot-staging/google-iam-v2/lib/google/iam/v2/policies/operations.rb delete mode 100644 owl-bot-staging/google-iam-v2/lib/google/iam/v2/policies/rest.rb delete mode 100644 owl-bot-staging/google-iam-v2/lib/google/iam/v2/policies/rest/client.rb delete mode 100644 owl-bot-staging/google-iam-v2/lib/google/iam/v2/policies/rest/operations.rb delete mode 100644 owl-bot-staging/google-iam-v2/lib/google/iam/v2/policies/rest/service_stub.rb delete mode 100644 owl-bot-staging/google-iam-v2/lib/google/iam/v2/policy_pb.rb delete mode 100644 owl-bot-staging/google-iam-v2/lib/google/iam/v2/policy_services_pb.rb delete mode 100644 owl-bot-staging/google-iam-v2/lib/google/iam/v2/rest.rb delete mode 100644 owl-bot-staging/google-iam-v2/lib/google/iam/v2/version.rb delete mode 100644 owl-bot-staging/google-iam-v2/proto_docs/README.md delete mode 100644 owl-bot-staging/google-iam-v2/proto_docs/google/api/client.rb delete mode 100644 owl-bot-staging/google-iam-v2/proto_docs/google/api/field_behavior.rb delete mode 100644 owl-bot-staging/google-iam-v2/proto_docs/google/api/launch_stage.rb delete mode 100644 owl-bot-staging/google-iam-v2/proto_docs/google/api/resource.rb delete mode 100644 owl-bot-staging/google-iam-v2/proto_docs/google/iam/v2/deny.rb delete mode 100644 owl-bot-staging/google-iam-v2/proto_docs/google/iam/v2/policy.rb delete mode 100644 owl-bot-staging/google-iam-v2/proto_docs/google/longrunning/operations.rb delete mode 100644 owl-bot-staging/google-iam-v2/proto_docs/google/protobuf/any.rb delete mode 100644 owl-bot-staging/google-iam-v2/proto_docs/google/protobuf/duration.rb delete mode 100644 owl-bot-staging/google-iam-v2/proto_docs/google/protobuf/empty.rb delete mode 100644 owl-bot-staging/google-iam-v2/proto_docs/google/protobuf/timestamp.rb delete mode 100644 owl-bot-staging/google-iam-v2/proto_docs/google/rpc/status.rb delete mode 100644 owl-bot-staging/google-iam-v2/proto_docs/google/type/expr.rb delete mode 100644 owl-bot-staging/google-iam-v2/snippets/Gemfile delete mode 100644 owl-bot-staging/google-iam-v2/snippets/policies/create_policy.rb delete mode 100644 owl-bot-staging/google-iam-v2/snippets/policies/delete_policy.rb delete mode 100644 owl-bot-staging/google-iam-v2/snippets/policies/get_policy.rb delete mode 100644 owl-bot-staging/google-iam-v2/snippets/policies/list_policies.rb delete mode 100644 owl-bot-staging/google-iam-v2/snippets/policies/update_policy.rb delete mode 100644 owl-bot-staging/google-iam-v2/snippets/snippet_metadata_google.iam.v2.json delete mode 100644 owl-bot-staging/google-iam-v2/test/google/iam/v2/policies_operations_test.rb delete mode 100644 owl-bot-staging/google-iam-v2/test/google/iam/v2/policies_rest_test.rb delete mode 100644 owl-bot-staging/google-iam-v2/test/google/iam/v2/policies_test.rb delete mode 100644 owl-bot-staging/google-iam-v2/test/helper.rb diff --git a/google-cloud-vision-v1p3beta1/proto_docs/google/api/client.rb b/google-cloud-vision-v1p3beta1/proto_docs/google/api/client.rb index 7796382e3a21..e62ceba4577a 100644 --- a/google-cloud-vision-v1p3beta1/proto_docs/google/api/client.rb +++ b/google-cloud-vision-v1p3beta1/proto_docs/google/api/client.rb @@ -31,6 +31,8 @@ module Api # @!attribute [rw] selective_gapic_generation # @return [::Google::Api::SelectiveGapicGeneration] # Configuration for which RPCs should be generated in the GAPIC client. + # + # Note: This field should not be used in most cases. class CommonLanguageSettings include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods @@ -441,6 +443,8 @@ class LongRunning # This message is used to configure the generation of a subset of the RPCs in # a service for client libraries. + # + # Note: This feature should not be used in most cases. # @!attribute [rw] methods # @return [::Array<::String>] # An allowlist of the fully qualified names of RPCs that should be included diff --git a/google-cloud-vision-v1p4beta1/proto_docs/google/api/client.rb b/google-cloud-vision-v1p4beta1/proto_docs/google/api/client.rb index 7796382e3a21..e62ceba4577a 100644 --- a/google-cloud-vision-v1p4beta1/proto_docs/google/api/client.rb +++ b/google-cloud-vision-v1p4beta1/proto_docs/google/api/client.rb @@ -31,6 +31,8 @@ module Api # @!attribute [rw] selective_gapic_generation # @return [::Google::Api::SelectiveGapicGeneration] # Configuration for which RPCs should be generated in the GAPIC client. + # + # Note: This field should not be used in most cases. class CommonLanguageSettings include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods @@ -441,6 +443,8 @@ class LongRunning # This message is used to configure the generation of a subset of the RPCs in # a service for client libraries. + # + # Note: This feature should not be used in most cases. # @!attribute [rw] methods # @return [::Array<::String>] # An allowlist of the fully qualified names of RPCs that should be included diff --git a/google-cloud-vision_ai-v1/proto_docs/google/api/client.rb b/google-cloud-vision_ai-v1/proto_docs/google/api/client.rb index a8b1b06d1cad..c58739e32368 100644 --- a/google-cloud-vision_ai-v1/proto_docs/google/api/client.rb +++ b/google-cloud-vision_ai-v1/proto_docs/google/api/client.rb @@ -31,6 +31,8 @@ module Api # @!attribute [rw] selective_gapic_generation # @return [::Google::Api::SelectiveGapicGeneration] # Configuration for which RPCs should be generated in the GAPIC client. + # + # Note: This field should not be used in most cases. class CommonLanguageSettings include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods @@ -441,6 +443,8 @@ class LongRunning # This message is used to configure the generation of a subset of the RPCs in # a service for client libraries. + # + # Note: This feature should not be used in most cases. # @!attribute [rw] methods # @return [::Array<::String>] # An allowlist of the fully qualified names of RPCs that should be included diff --git a/google-cloud-vm_migration-v1/proto_docs/google/api/client.rb b/google-cloud-vm_migration-v1/proto_docs/google/api/client.rb index 7796382e3a21..e62ceba4577a 100644 --- a/google-cloud-vm_migration-v1/proto_docs/google/api/client.rb +++ b/google-cloud-vm_migration-v1/proto_docs/google/api/client.rb @@ -31,6 +31,8 @@ module Api # @!attribute [rw] selective_gapic_generation # @return [::Google::Api::SelectiveGapicGeneration] # Configuration for which RPCs should be generated in the GAPIC client. + # + # Note: This field should not be used in most cases. class CommonLanguageSettings include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods @@ -441,6 +443,8 @@ class LongRunning # This message is used to configure the generation of a subset of the RPCs in # a service for client libraries. + # + # Note: This feature should not be used in most cases. # @!attribute [rw] methods # @return [::Array<::String>] # An allowlist of the fully qualified names of RPCs that should be included diff --git a/google-cloud-vmware_engine-v1/proto_docs/google/api/client.rb b/google-cloud-vmware_engine-v1/proto_docs/google/api/client.rb index 7796382e3a21..e62ceba4577a 100644 --- a/google-cloud-vmware_engine-v1/proto_docs/google/api/client.rb +++ b/google-cloud-vmware_engine-v1/proto_docs/google/api/client.rb @@ -31,6 +31,8 @@ module Api # @!attribute [rw] selective_gapic_generation # @return [::Google::Api::SelectiveGapicGeneration] # Configuration for which RPCs should be generated in the GAPIC client. + # + # Note: This field should not be used in most cases. class CommonLanguageSettings include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods @@ -441,6 +443,8 @@ class LongRunning # This message is used to configure the generation of a subset of the RPCs in # a service for client libraries. + # + # Note: This feature should not be used in most cases. # @!attribute [rw] methods # @return [::Array<::String>] # An allowlist of the fully qualified names of RPCs that should be included diff --git a/google-cloud-vpc_access-v1/proto_docs/google/api/client.rb b/google-cloud-vpc_access-v1/proto_docs/google/api/client.rb index 7796382e3a21..e62ceba4577a 100644 --- a/google-cloud-vpc_access-v1/proto_docs/google/api/client.rb +++ b/google-cloud-vpc_access-v1/proto_docs/google/api/client.rb @@ -31,6 +31,8 @@ module Api # @!attribute [rw] selective_gapic_generation # @return [::Google::Api::SelectiveGapicGeneration] # Configuration for which RPCs should be generated in the GAPIC client. + # + # Note: This field should not be used in most cases. class CommonLanguageSettings include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods @@ -441,6 +443,8 @@ class LongRunning # This message is used to configure the generation of a subset of the RPCs in # a service for client libraries. + # + # Note: This feature should not be used in most cases. # @!attribute [rw] methods # @return [::Array<::String>] # An allowlist of the fully qualified names of RPCs that should be included diff --git a/google-cloud-web_risk-v1/proto_docs/google/api/client.rb b/google-cloud-web_risk-v1/proto_docs/google/api/client.rb index 7796382e3a21..e62ceba4577a 100644 --- a/google-cloud-web_risk-v1/proto_docs/google/api/client.rb +++ b/google-cloud-web_risk-v1/proto_docs/google/api/client.rb @@ -31,6 +31,8 @@ module Api # @!attribute [rw] selective_gapic_generation # @return [::Google::Api::SelectiveGapicGeneration] # Configuration for which RPCs should be generated in the GAPIC client. + # + # Note: This field should not be used in most cases. class CommonLanguageSettings include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods @@ -441,6 +443,8 @@ class LongRunning # This message is used to configure the generation of a subset of the RPCs in # a service for client libraries. + # + # Note: This feature should not be used in most cases. # @!attribute [rw] methods # @return [::Array<::String>] # An allowlist of the fully qualified names of RPCs that should be included diff --git a/google-cloud-web_risk-v1beta1/proto_docs/google/api/client.rb b/google-cloud-web_risk-v1beta1/proto_docs/google/api/client.rb index 7796382e3a21..e62ceba4577a 100644 --- a/google-cloud-web_risk-v1beta1/proto_docs/google/api/client.rb +++ b/google-cloud-web_risk-v1beta1/proto_docs/google/api/client.rb @@ -31,6 +31,8 @@ module Api # @!attribute [rw] selective_gapic_generation # @return [::Google::Api::SelectiveGapicGeneration] # Configuration for which RPCs should be generated in the GAPIC client. + # + # Note: This field should not be used in most cases. class CommonLanguageSettings include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods @@ -441,6 +443,8 @@ class LongRunning # This message is used to configure the generation of a subset of the RPCs in # a service for client libraries. + # + # Note: This feature should not be used in most cases. # @!attribute [rw] methods # @return [::Array<::String>] # An allowlist of the fully qualified names of RPCs that should be included diff --git a/google-cloud-web_security_scanner-v1/proto_docs/google/api/client.rb b/google-cloud-web_security_scanner-v1/proto_docs/google/api/client.rb index 7796382e3a21..e62ceba4577a 100644 --- a/google-cloud-web_security_scanner-v1/proto_docs/google/api/client.rb +++ b/google-cloud-web_security_scanner-v1/proto_docs/google/api/client.rb @@ -31,6 +31,8 @@ module Api # @!attribute [rw] selective_gapic_generation # @return [::Google::Api::SelectiveGapicGeneration] # Configuration for which RPCs should be generated in the GAPIC client. + # + # Note: This field should not be used in most cases. class CommonLanguageSettings include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods @@ -441,6 +443,8 @@ class LongRunning # This message is used to configure the generation of a subset of the RPCs in # a service for client libraries. + # + # Note: This feature should not be used in most cases. # @!attribute [rw] methods # @return [::Array<::String>] # An allowlist of the fully qualified names of RPCs that should be included diff --git a/google-cloud-web_security_scanner-v1beta/proto_docs/google/api/client.rb b/google-cloud-web_security_scanner-v1beta/proto_docs/google/api/client.rb index 7796382e3a21..e62ceba4577a 100644 --- a/google-cloud-web_security_scanner-v1beta/proto_docs/google/api/client.rb +++ b/google-cloud-web_security_scanner-v1beta/proto_docs/google/api/client.rb @@ -31,6 +31,8 @@ module Api # @!attribute [rw] selective_gapic_generation # @return [::Google::Api::SelectiveGapicGeneration] # Configuration for which RPCs should be generated in the GAPIC client. + # + # Note: This field should not be used in most cases. class CommonLanguageSettings include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods @@ -441,6 +443,8 @@ class LongRunning # This message is used to configure the generation of a subset of the RPCs in # a service for client libraries. + # + # Note: This feature should not be used in most cases. # @!attribute [rw] methods # @return [::Array<::String>] # An allowlist of the fully qualified names of RPCs that should be included diff --git a/google-cloud-workflows-executions-v1/proto_docs/google/api/client.rb b/google-cloud-workflows-executions-v1/proto_docs/google/api/client.rb index 7796382e3a21..e62ceba4577a 100644 --- a/google-cloud-workflows-executions-v1/proto_docs/google/api/client.rb +++ b/google-cloud-workflows-executions-v1/proto_docs/google/api/client.rb @@ -31,6 +31,8 @@ module Api # @!attribute [rw] selective_gapic_generation # @return [::Google::Api::SelectiveGapicGeneration] # Configuration for which RPCs should be generated in the GAPIC client. + # + # Note: This field should not be used in most cases. class CommonLanguageSettings include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods @@ -441,6 +443,8 @@ class LongRunning # This message is used to configure the generation of a subset of the RPCs in # a service for client libraries. + # + # Note: This feature should not be used in most cases. # @!attribute [rw] methods # @return [::Array<::String>] # An allowlist of the fully qualified names of RPCs that should be included diff --git a/google-cloud-workflows-executions-v1beta/proto_docs/google/api/client.rb b/google-cloud-workflows-executions-v1beta/proto_docs/google/api/client.rb index 7796382e3a21..e62ceba4577a 100644 --- a/google-cloud-workflows-executions-v1beta/proto_docs/google/api/client.rb +++ b/google-cloud-workflows-executions-v1beta/proto_docs/google/api/client.rb @@ -31,6 +31,8 @@ module Api # @!attribute [rw] selective_gapic_generation # @return [::Google::Api::SelectiveGapicGeneration] # Configuration for which RPCs should be generated in the GAPIC client. + # + # Note: This field should not be used in most cases. class CommonLanguageSettings include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods @@ -441,6 +443,8 @@ class LongRunning # This message is used to configure the generation of a subset of the RPCs in # a service for client libraries. + # + # Note: This feature should not be used in most cases. # @!attribute [rw] methods # @return [::Array<::String>] # An allowlist of the fully qualified names of RPCs that should be included diff --git a/google-cloud-workflows-v1/proto_docs/google/api/client.rb b/google-cloud-workflows-v1/proto_docs/google/api/client.rb index 7796382e3a21..e62ceba4577a 100644 --- a/google-cloud-workflows-v1/proto_docs/google/api/client.rb +++ b/google-cloud-workflows-v1/proto_docs/google/api/client.rb @@ -31,6 +31,8 @@ module Api # @!attribute [rw] selective_gapic_generation # @return [::Google::Api::SelectiveGapicGeneration] # Configuration for which RPCs should be generated in the GAPIC client. + # + # Note: This field should not be used in most cases. class CommonLanguageSettings include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods @@ -441,6 +443,8 @@ class LongRunning # This message is used to configure the generation of a subset of the RPCs in # a service for client libraries. + # + # Note: This feature should not be used in most cases. # @!attribute [rw] methods # @return [::Array<::String>] # An allowlist of the fully qualified names of RPCs that should be included diff --git a/google-cloud-workflows-v1beta/proto_docs/google/api/client.rb b/google-cloud-workflows-v1beta/proto_docs/google/api/client.rb index 7796382e3a21..e62ceba4577a 100644 --- a/google-cloud-workflows-v1beta/proto_docs/google/api/client.rb +++ b/google-cloud-workflows-v1beta/proto_docs/google/api/client.rb @@ -31,6 +31,8 @@ module Api # @!attribute [rw] selective_gapic_generation # @return [::Google::Api::SelectiveGapicGeneration] # Configuration for which RPCs should be generated in the GAPIC client. + # + # Note: This field should not be used in most cases. class CommonLanguageSettings include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods @@ -441,6 +443,8 @@ class LongRunning # This message is used to configure the generation of a subset of the RPCs in # a service for client libraries. + # + # Note: This feature should not be used in most cases. # @!attribute [rw] methods # @return [::Array<::String>] # An allowlist of the fully qualified names of RPCs that should be included diff --git a/google-cloud-workstations-v1/proto_docs/google/api/client.rb b/google-cloud-workstations-v1/proto_docs/google/api/client.rb index a8b1b06d1cad..c58739e32368 100644 --- a/google-cloud-workstations-v1/proto_docs/google/api/client.rb +++ b/google-cloud-workstations-v1/proto_docs/google/api/client.rb @@ -31,6 +31,8 @@ module Api # @!attribute [rw] selective_gapic_generation # @return [::Google::Api::SelectiveGapicGeneration] # Configuration for which RPCs should be generated in the GAPIC client. + # + # Note: This field should not be used in most cases. class CommonLanguageSettings include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods @@ -441,6 +443,8 @@ class LongRunning # This message is used to configure the generation of a subset of the RPCs in # a service for client libraries. + # + # Note: This feature should not be used in most cases. # @!attribute [rw] methods # @return [::Array<::String>] # An allowlist of the fully qualified names of RPCs that should be included diff --git a/google-cloud-workstations-v1beta/proto_docs/google/api/client.rb b/google-cloud-workstations-v1beta/proto_docs/google/api/client.rb index a8b1b06d1cad..c58739e32368 100644 --- a/google-cloud-workstations-v1beta/proto_docs/google/api/client.rb +++ b/google-cloud-workstations-v1beta/proto_docs/google/api/client.rb @@ -31,6 +31,8 @@ module Api # @!attribute [rw] selective_gapic_generation # @return [::Google::Api::SelectiveGapicGeneration] # Configuration for which RPCs should be generated in the GAPIC client. + # + # Note: This field should not be used in most cases. class CommonLanguageSettings include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods @@ -441,6 +443,8 @@ class LongRunning # This message is used to configure the generation of a subset of the RPCs in # a service for client libraries. + # + # Note: This feature should not be used in most cases. # @!attribute [rw] methods # @return [::Array<::String>] # An allowlist of the fully qualified names of RPCs that should be included diff --git a/google-iam-credentials-v1/proto_docs/google/api/client.rb b/google-iam-credentials-v1/proto_docs/google/api/client.rb index 7796382e3a21..e62ceba4577a 100644 --- a/google-iam-credentials-v1/proto_docs/google/api/client.rb +++ b/google-iam-credentials-v1/proto_docs/google/api/client.rb @@ -31,6 +31,8 @@ module Api # @!attribute [rw] selective_gapic_generation # @return [::Google::Api::SelectiveGapicGeneration] # Configuration for which RPCs should be generated in the GAPIC client. + # + # Note: This field should not be used in most cases. class CommonLanguageSettings include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods @@ -441,6 +443,8 @@ class LongRunning # This message is used to configure the generation of a subset of the RPCs in # a service for client libraries. + # + # Note: This feature should not be used in most cases. # @!attribute [rw] methods # @return [::Array<::String>] # An allowlist of the fully qualified names of RPCs that should be included diff --git a/google-iam-v1/proto_docs/google/api/client.rb b/google-iam-v1/proto_docs/google/api/client.rb index 7796382e3a21..e62ceba4577a 100644 --- a/google-iam-v1/proto_docs/google/api/client.rb +++ b/google-iam-v1/proto_docs/google/api/client.rb @@ -31,6 +31,8 @@ module Api # @!attribute [rw] selective_gapic_generation # @return [::Google::Api::SelectiveGapicGeneration] # Configuration for which RPCs should be generated in the GAPIC client. + # + # Note: This field should not be used in most cases. class CommonLanguageSettings include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods @@ -441,6 +443,8 @@ class LongRunning # This message is used to configure the generation of a subset of the RPCs in # a service for client libraries. + # + # Note: This feature should not be used in most cases. # @!attribute [rw] methods # @return [::Array<::String>] # An allowlist of the fully qualified names of RPCs that should be included diff --git a/google-iam-v1beta/proto_docs/google/api/client.rb b/google-iam-v1beta/proto_docs/google/api/client.rb index 7796382e3a21..e62ceba4577a 100644 --- a/google-iam-v1beta/proto_docs/google/api/client.rb +++ b/google-iam-v1beta/proto_docs/google/api/client.rb @@ -31,6 +31,8 @@ module Api # @!attribute [rw] selective_gapic_generation # @return [::Google::Api::SelectiveGapicGeneration] # Configuration for which RPCs should be generated in the GAPIC client. + # + # Note: This field should not be used in most cases. class CommonLanguageSettings include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods @@ -441,6 +443,8 @@ class LongRunning # This message is used to configure the generation of a subset of the RPCs in # a service for client libraries. + # + # Note: This feature should not be used in most cases. # @!attribute [rw] methods # @return [::Array<::String>] # An allowlist of the fully qualified names of RPCs that should be included diff --git a/google-iam-v2/proto_docs/google/api/client.rb b/google-iam-v2/proto_docs/google/api/client.rb index 7796382e3a21..e62ceba4577a 100644 --- a/google-iam-v2/proto_docs/google/api/client.rb +++ b/google-iam-v2/proto_docs/google/api/client.rb @@ -31,6 +31,8 @@ module Api # @!attribute [rw] selective_gapic_generation # @return [::Google::Api::SelectiveGapicGeneration] # Configuration for which RPCs should be generated in the GAPIC client. + # + # Note: This field should not be used in most cases. class CommonLanguageSettings include ::Google::Protobuf::MessageExts extend ::Google::Protobuf::MessageExts::ClassMethods @@ -441,6 +443,8 @@ class LongRunning # This message is used to configure the generation of a subset of the RPCs in # a service for client libraries. + # + # Note: This feature should not be used in most cases. # @!attribute [rw] methods # @return [::Array<::String>] # An allowlist of the fully qualified names of RPCs that should be included diff --git a/owl-bot-staging/google-cloud-vision-v1p3beta1/.gitignore b/owl-bot-staging/google-cloud-vision-v1p3beta1/.gitignore deleted file mode 100644 index 0135b6bc6cfc..000000000000 --- a/owl-bot-staging/google-cloud-vision-v1p3beta1/.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-vision-v1p3beta1/.repo-metadata.json b/owl-bot-staging/google-cloud-vision-v1p3beta1/.repo-metadata.json deleted file mode 100644 index 30a5a4a4aaf9..000000000000 --- a/owl-bot-staging/google-cloud-vision-v1p3beta1/.repo-metadata.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "api_id": "vision.googleapis.com", - "api_shortname": "vision", - "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-vision-v1p3beta1/latest", - "distribution_name": "google-cloud-vision-v1p3beta1", - "is_cloud": true, - "language": "ruby", - "name": "vision", - "name_pretty": "Cloud Vision V1p3beta1 API", - "product_documentation": "https://cloud.google.com/vision", - "release_level": "unreleased", - "repo": "googleapis/google-cloud-ruby", - "requires_billing": true, - "ruby-cloud-description": "Cloud Vision API allows developers to easily integrate vision detection features within applications, including image labeling, face and landmark detection, optical character recognition (OCR), and tagging of explicit content. Note that google-cloud-vision-v1p3beta1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-vision instead. See the readme for more details.", - "ruby-cloud-env-prefix": "VISION", - "ruby-cloud-product-url": "https://cloud.google.com/vision", - "library_type": "GAPIC_AUTO" -} diff --git a/owl-bot-staging/google-cloud-vision-v1p3beta1/.rubocop.yml b/owl-bot-staging/google-cloud-vision-v1p3beta1/.rubocop.yml deleted file mode 100644 index a1a5953f98fb..000000000000 --- a/owl-bot-staging/google-cloud-vision-v1p3beta1/.rubocop.yml +++ /dev/null @@ -1,33 +0,0 @@ -inherit_gem: - google-style: google-style.yml - -AllCops: - Exclude: - - "google-cloud-vision-v1p3beta1.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-vision-v1p3beta1.rb" diff --git a/owl-bot-staging/google-cloud-vision-v1p3beta1/.toys.rb b/owl-bot-staging/google-cloud-vision-v1p3beta1/.toys.rb deleted file mode 100644 index 177e22456e8a..000000000000 --- a/owl-bot-staging/google-cloud-vision-v1p3beta1/.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-vision-v1p3beta1/.yardopts b/owl-bot-staging/google-cloud-vision-v1p3beta1/.yardopts deleted file mode 100644 index bf7e43450e71..000000000000 --- a/owl-bot-staging/google-cloud-vision-v1p3beta1/.yardopts +++ /dev/null @@ -1,12 +0,0 @@ ---no-private ---title="Cloud Vision V1p3beta1 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-vision-v1p3beta1/AUTHENTICATION.md b/owl-bot-staging/google-cloud-vision-v1p3beta1/AUTHENTICATION.md deleted file mode 100644 index 14862ca33879..000000000000 --- a/owl-bot-staging/google-cloud-vision-v1p3beta1/AUTHENTICATION.md +++ /dev/null @@ -1,122 +0,0 @@ -# Authentication - -The recommended way to authenticate to the google-cloud-vision-v1p3beta1 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-vision-v1p3beta1 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/vision/v1p3beta1" - -client = ::Google::Cloud::Vision::V1p3beta1::ProductSearch::Client.new do |config| - config.credentials = "path/to/credentialfile.json" -end -``` - -To configure a credentials file globally for all clients: - -```ruby -require "google/cloud/vision/v1p3beta1" - -::Google::Cloud::Vision::V1p3beta1::ProductSearch::Client.configure do |config| - config.credentials = "path/to/credentialfile.json" -end - -client = ::Google::Cloud::Vision::V1p3beta1::ProductSearch::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-vision-v1p3beta1 -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/vision/v1p3beta1" - -ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" - -client = ::Google::Cloud::Vision::V1p3beta1::ProductSearch::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-vision-v1p3beta1/CHANGELOG.md b/owl-bot-staging/google-cloud-vision-v1p3beta1/CHANGELOG.md deleted file mode 100644 index f88957a62ba2..000000000000 --- a/owl-bot-staging/google-cloud-vision-v1p3beta1/CHANGELOG.md +++ /dev/null @@ -1,2 +0,0 @@ -# Release History - diff --git a/owl-bot-staging/google-cloud-vision-v1p3beta1/Gemfile b/owl-bot-staging/google-cloud-vision-v1p3beta1/Gemfile deleted file mode 100644 index 1d08558908d8..000000000000 --- a/owl-bot-staging/google-cloud-vision-v1p3beta1/Gemfile +++ /dev/null @@ -1,14 +0,0 @@ -source "https://rubygems.org" - -gemspec - -gem "google-style", "~> 1.32.0" -gem "irb", "~> 1.17" -gem "minitest", "~> 6.0.2" -gem "minitest-focus", "~> 1.4" -gem "minitest-mock", "~> 5.27" -gem "minitest-rg", "~> 5.3" -gem "ostruct", "~> 0.5.5" -gem "rake", ">= 13.0" -gem "redcarpet", "~> 3.6" -gem "yard", "~> 0.9" diff --git a/owl-bot-staging/google-cloud-vision-v1p3beta1/LICENSE.md b/owl-bot-staging/google-cloud-vision-v1p3beta1/LICENSE.md deleted file mode 100644 index c261857ba6ad..000000000000 --- a/owl-bot-staging/google-cloud-vision-v1p3beta1/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-vision-v1p3beta1/README.md b/owl-bot-staging/google-cloud-vision-v1p3beta1/README.md deleted file mode 100644 index ea2de28aa1ed..000000000000 --- a/owl-bot-staging/google-cloud-vision-v1p3beta1/README.md +++ /dev/null @@ -1,154 +0,0 @@ -# Ruby Client for the Cloud Vision V1p3beta1 API - -Integrates Google Vision features, including image labeling, face, logo, and landmark detection, optical character recognition (OCR), and detection of explicit content, into applications. - -Cloud Vision API allows developers to easily integrate vision detection features within applications, including image labeling, face and landmark detection, optical character recognition (OCR), and tagging of explicit content. - -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 Vision V1p3beta1 API. Most users should consider using -the main client gem, -[google-cloud-vision](https://rubygems.org/gems/google-cloud-vision). -See the section below titled *Which client should I use?* for more information. - -## Installation - -``` -$ gem install google-cloud-vision-v1p3beta1 -``` - -## 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/vision.googleapis.com) -1. [Set up authentication.](AUTHENTICATION.md) - -## Quick Start - -```ruby -require "google/cloud/vision/v1p3beta1" - -client = ::Google::Cloud::Vision::V1p3beta1::ProductSearch::Client.new -request = ::Google::Cloud::Vision::V1p3beta1::CreateProductSetRequest.new # (request fields as keyword arguments...) -response = client.create_product_set request -``` - -View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-vision-v1p3beta1/latest) -for class and method documentation. - -See also the [Product Documentation](https://cloud.google.com/vision) -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/vision/v1p3beta1" -require "logger" - -client = ::Google::Cloud::Vision::V1p3beta1::ProductSearch::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-vision`, -and lower-level _versioned_ client libraries with names such as -`google-cloud-vision-v1p3beta1`. -_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-vision`. -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-vision-v1p3beta1`. - -### 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-vision-v1p3beta1/Rakefile b/owl-bot-staging/google-cloud-vision-v1p3beta1/Rakefile deleted file mode 100644 index 4ddeb5b558b9..000000000000 --- a/owl-bot-staging/google-cloud-vision-v1p3beta1/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-vision-v1p3beta1 acceptance tests." -task :acceptance, :project, :keyfile do |t, args| - project = args[:project] - project ||= - ENV["VISION_TEST_PROJECT"] || - ENV["GCLOUD_TEST_PROJECT"] - keyfile = args[:keyfile] - keyfile ||= - ENV["VISION_TEST_KEYFILE"] || - ENV["GCLOUD_TEST_KEYFILE"] - if keyfile - keyfile = File.read keyfile - else - keyfile ||= - ENV["VISION_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 VISION_TEST_PROJECT=test123 VISION_TEST_KEYFILE=/path/to/keyfile.json rake acceptance" - end - require "google/cloud/vision/v1p3beta1/product_search/credentials" - ::Google::Cloud::Vision::V1p3beta1::ProductSearch::Credentials.env_vars.each do |path| - ENV[path] = nil - end - ENV["VISION_PROJECT"] = project - ENV["VISION_TEST_PROJECT"] = project - ENV["VISION_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-vision-v1p3beta1 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-vision-v1p3beta1 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-vision-v1p3beta1 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-vision-v1p3beta1 gem does not have doctest tests." -end - -desc "Run the CI build" -task :ci do - header "BUILDING google-cloud-vision-v1p3beta1" - header "google-cloud-vision-v1p3beta1 rubocop", "*" - Rake::Task[:rubocop].invoke - header "google-cloud-vision-v1p3beta1 yard", "*" - Rake::Task[:yard].invoke - header "google-cloud-vision-v1p3beta1 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-vision-v1p3beta1 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-vision-v1p3beta1 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-vision-v1p3beta1/gapic_metadata.json b/owl-bot-staging/google-cloud-vision-v1p3beta1/gapic_metadata.json deleted file mode 100644 index dac137fd5f24..000000000000 --- a/owl-bot-staging/google-cloud-vision-v1p3beta1/gapic_metadata.json +++ /dev/null @@ -1,127 +0,0 @@ -{ - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", - "language": "ruby", - "protoPackage": "google.cloud.vision.v1p3beta1", - "libraryPackage": "::Google::Cloud::Vision::V1p3beta1", - "services": { - "ProductSearch": { - "clients": { - "grpc": { - "libraryClient": "::Google::Cloud::Vision::V1p3beta1::ProductSearch::Client", - "rpcs": { - "CreateProductSet": { - "methods": [ - "create_product_set" - ] - }, - "ListProductSets": { - "methods": [ - "list_product_sets" - ] - }, - "GetProductSet": { - "methods": [ - "get_product_set" - ] - }, - "UpdateProductSet": { - "methods": [ - "update_product_set" - ] - }, - "DeleteProductSet": { - "methods": [ - "delete_product_set" - ] - }, - "CreateProduct": { - "methods": [ - "create_product" - ] - }, - "ListProducts": { - "methods": [ - "list_products" - ] - }, - "GetProduct": { - "methods": [ - "get_product" - ] - }, - "UpdateProduct": { - "methods": [ - "update_product" - ] - }, - "DeleteProduct": { - "methods": [ - "delete_product" - ] - }, - "CreateReferenceImage": { - "methods": [ - "create_reference_image" - ] - }, - "DeleteReferenceImage": { - "methods": [ - "delete_reference_image" - ] - }, - "ListReferenceImages": { - "methods": [ - "list_reference_images" - ] - }, - "GetReferenceImage": { - "methods": [ - "get_reference_image" - ] - }, - "AddProductToProductSet": { - "methods": [ - "add_product_to_product_set" - ] - }, - "RemoveProductFromProductSet": { - "methods": [ - "remove_product_from_product_set" - ] - }, - "ListProductsInProductSet": { - "methods": [ - "list_products_in_product_set" - ] - }, - "ImportProductSets": { - "methods": [ - "import_product_sets" - ] - } - } - } - } - }, - "ImageAnnotator": { - "clients": { - "grpc": { - "libraryClient": "::Google::Cloud::Vision::V1p3beta1::ImageAnnotator::Client", - "rpcs": { - "BatchAnnotateImages": { - "methods": [ - "batch_annotate_images" - ] - }, - "AsyncBatchAnnotateFiles": { - "methods": [ - "async_batch_annotate_files" - ] - } - } - } - } - } - } -} diff --git a/owl-bot-staging/google-cloud-vision-v1p3beta1/google-cloud-vision-v1p3beta1.gemspec b/owl-bot-staging/google-cloud-vision-v1p3beta1/google-cloud-vision-v1p3beta1.gemspec deleted file mode 100644 index 931107b4720f..000000000000 --- a/owl-bot-staging/google-cloud-vision-v1p3beta1/google-cloud-vision-v1p3beta1.gemspec +++ /dev/null @@ -1,28 +0,0 @@ -# -*- ruby -*- -# encoding: utf-8 - -require File.expand_path("lib/google/cloud/vision/v1p3beta1/version", __dir__) - -Gem::Specification.new do |gem| - gem.name = "google-cloud-vision-v1p3beta1" - gem.version = Google::Cloud::Vision::V1p3beta1::VERSION - - gem.authors = ["Google LLC"] - gem.email = "googleapis-packages@google.com" - gem.description = "Cloud Vision API allows developers to easily integrate vision detection features within applications, including image labeling, face and landmark detection, optical character recognition (OCR), and tagging of explicit content. Note that google-cloud-vision-v1p3beta1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-vision instead. See the readme for more details." - gem.summary = "Integrates Google Vision features, including image labeling, face, logo, and landmark detection, optical character recognition (OCR), and detection of explicit content, into 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.2" - - gem.add_dependency "gapic-common", "~> 1.2" - gem.add_dependency "google-cloud-errors", "~> 1.0" -end diff --git a/owl-bot-staging/google-cloud-vision-v1p3beta1/lib/google-cloud-vision-v1p3beta1.rb b/owl-bot-staging/google-cloud-vision-v1p3beta1/lib/google-cloud-vision-v1p3beta1.rb deleted file mode 100644 index e1b1874d5d61..000000000000 --- a/owl-bot-staging/google-cloud-vision-v1p3beta1/lib/google-cloud-vision-v1p3beta1.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/vision/v1p3beta1" diff --git a/owl-bot-staging/google-cloud-vision-v1p3beta1/lib/google/cloud/vision/v1p3beta1.rb b/owl-bot-staging/google-cloud-vision-v1p3beta1/lib/google/cloud/vision/v1p3beta1.rb deleted file mode 100644 index 0bf1423aef5b..000000000000 --- a/owl-bot-staging/google-cloud-vision-v1p3beta1/lib/google/cloud/vision/v1p3beta1.rb +++ /dev/null @@ -1,46 +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/vision/v1p3beta1/product_search" -require "google/cloud/vision/v1p3beta1/image_annotator" -require "google/cloud/vision/v1p3beta1/version" - -module Google - module Cloud - module Vision - ## - # API client module. - # - # @example Load this package, including all its services, and instantiate a gRPC client - # - # require "google/cloud/vision/v1p3beta1" - # client = ::Google::Cloud::Vision::V1p3beta1::ProductSearch::Client.new - # - # @example Load this package, including all its services, and instantiate a REST client - # - # require "google/cloud/vision/v1p3beta1" - # client = ::Google::Cloud::Vision::V1p3beta1::ProductSearch::Rest::Client.new - # - module V1p3beta1 - end - end - end -end - -helper_path = ::File.join __dir__, "v1p3beta1", "_helpers.rb" -require "google/cloud/vision/v1p3beta1/_helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-vision-v1p3beta1/lib/google/cloud/vision/v1p3beta1/geometry_pb.rb b/owl-bot-staging/google-cloud-vision-v1p3beta1/lib/google/cloud/vision/v1p3beta1/geometry_pb.rb deleted file mode 100644 index b934be0f3ef7..000000000000 --- a/owl-bot-staging/google-cloud-vision-v1p3beta1/lib/google/cloud/vision/v1p3beta1/geometry_pb.rb +++ /dev/null @@ -1,24 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/vision/v1p3beta1/geometry.proto - -require 'google/protobuf' - - -descriptor_data = "\n,google/cloud/vision/v1p3beta1/geometry.proto\x12\x1dgoogle.cloud.vision.v1p3beta1\"\x1e\n\x06Vertex\x12\t\n\x01x\x18\x01 \x01(\x05\x12\t\n\x01y\x18\x02 \x01(\x05\"(\n\x10NormalizedVertex\x12\t\n\x01x\x18\x01 \x01(\x02\x12\t\n\x01y\x18\x02 \x01(\x02\"\x95\x01\n\x0c\x42oundingPoly\x12\x37\n\x08vertices\x18\x01 \x03(\x0b\x32%.google.cloud.vision.v1p3beta1.Vertex\x12L\n\x13normalized_vertices\x18\x02 \x03(\x0b\x32/.google.cloud.vision.v1p3beta1.NormalizedVertex\"+\n\x08Position\x12\t\n\x01x\x18\x01 \x01(\x02\x12\t\n\x01y\x18\x02 \x01(\x02\x12\t\n\x01z\x18\x03 \x01(\x02\x42y\n!com.google.cloud.vision.v1p3beta1B\rGeometryProtoP\x01Z9cloud.google.com/go/vision/apiv1p3beta1/visionpb;visionpb\xf8\x01\x01\xa2\x02\x04GCVNb\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module Vision - module V1p3beta1 - Vertex = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p3beta1.Vertex").msgclass - NormalizedVertex = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p3beta1.NormalizedVertex").msgclass - BoundingPoly = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p3beta1.BoundingPoly").msgclass - Position = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p3beta1.Position").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-vision-v1p3beta1/lib/google/cloud/vision/v1p3beta1/image_annotator.rb b/owl-bot-staging/google-cloud-vision-v1p3beta1/lib/google/cloud/vision/v1p3beta1/image_annotator.rb deleted file mode 100644 index 84650572725f..000000000000 --- a/owl-bot-staging/google-cloud-vision-v1p3beta1/lib/google/cloud/vision/v1p3beta1/image_annotator.rb +++ /dev/null @@ -1,58 +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/vision/v1p3beta1/version" - -require "google/cloud/vision/v1p3beta1/image_annotator/credentials" -require "google/cloud/vision/v1p3beta1/image_annotator/paths" -require "google/cloud/vision/v1p3beta1/image_annotator/operations" -require "google/cloud/vision/v1p3beta1/image_annotator/client" -require "google/cloud/vision/v1p3beta1/image_annotator/rest" - -module Google - module Cloud - module Vision - module V1p3beta1 - ## - # Service that performs Google Cloud Vision API detection tasks over client - # images, such as face, landmark, logo, label, and text detection. The - # ImageAnnotator service returns detected entities from the images. - # - # @example Load this service and instantiate a gRPC client - # - # require "google/cloud/vision/v1p3beta1/image_annotator" - # client = ::Google::Cloud::Vision::V1p3beta1::ImageAnnotator::Client.new - # - # @example Load this service and instantiate a REST client - # - # require "google/cloud/vision/v1p3beta1/image_annotator/rest" - # client = ::Google::Cloud::Vision::V1p3beta1::ImageAnnotator::Rest::Client.new - # - module ImageAnnotator - end - end - end - end -end - -helper_path = ::File.join __dir__, "image_annotator", "helpers.rb" -require "google/cloud/vision/v1p3beta1/image_annotator/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-vision-v1p3beta1/lib/google/cloud/vision/v1p3beta1/image_annotator/client.rb b/owl-bot-staging/google-cloud-vision-v1p3beta1/lib/google/cloud/vision/v1p3beta1/image_annotator/client.rb deleted file mode 100644 index eb6c7473f064..000000000000 --- a/owl-bot-staging/google-cloud-vision-v1p3beta1/lib/google/cloud/vision/v1p3beta1/image_annotator/client.rb +++ /dev/null @@ -1,590 +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/vision/v1p3beta1/image_annotator_pb" - -module Google - module Cloud - module Vision - module V1p3beta1 - module ImageAnnotator - ## - # Client for the ImageAnnotator service. - # - # Service that performs Google Cloud Vision API detection tasks over client - # images, such as face, landmark, logo, label, and text detection. The - # ImageAnnotator service returns detected entities from the images. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "vision.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :image_annotator_stub - - ## - # Configure the ImageAnnotator Client class. - # - # See {::Google::Cloud::Vision::V1p3beta1::ImageAnnotator::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all ImageAnnotator clients - # ::Google::Cloud::Vision::V1p3beta1::ImageAnnotator::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", "Vision", "V1p3beta1"] - 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.batch_annotate_images.timeout = 600.0 - default_config.rpcs.batch_annotate_images.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.async_batch_annotate_files.timeout = 600.0 - default_config.rpcs.async_batch_annotate_files.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [] - } - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the ImageAnnotator 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::Vision::V1p3beta1::ImageAnnotator::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 - @image_annotator_stub.universe_domain - end - - ## - # Create a new ImageAnnotator client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Vision::V1p3beta1::ImageAnnotator::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Vision::V1p3beta1::ImageAnnotator::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the ImageAnnotator 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/vision/v1p3beta1/image_annotator_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 - - @image_annotator_stub = ::Gapic::ServiceStub.new( - ::Google::Cloud::Vision::V1p3beta1::ImageAnnotator::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 - ) - - @image_annotator_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 - end - - ## - # Get the associated client for long-running operations. - # - # @return [::Google::Cloud::Vision::V1p3beta1::ImageAnnotator::Operations] - # - attr_reader :operations_client - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @image_annotator_stub.logger - end - - # Service calls - - ## - # Run image detection and annotation for a batch of images. - # - # @overload batch_annotate_images(request, options = nil) - # Pass arguments to `batch_annotate_images` via a request object, either of type - # {::Google::Cloud::Vision::V1p3beta1::BatchAnnotateImagesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Vision::V1p3beta1::BatchAnnotateImagesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload batch_annotate_images(requests: nil) - # Pass arguments to `batch_annotate_images` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param requests [::Array<::Google::Cloud::Vision::V1p3beta1::AnnotateImageRequest, ::Hash>] - # Individual image annotation requests for this batch. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Vision::V1p3beta1::BatchAnnotateImagesResponse] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Vision::V1p3beta1::BatchAnnotateImagesResponse] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/vision/v1p3beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Vision::V1p3beta1::ImageAnnotator::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Vision::V1p3beta1::BatchAnnotateImagesRequest.new - # - # # Call the batch_annotate_images method. - # result = client.batch_annotate_images request - # - # # The returned object is of type Google::Cloud::Vision::V1p3beta1::BatchAnnotateImagesResponse. - # p result - # - def batch_annotate_images request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Vision::V1p3beta1::BatchAnnotateImagesRequest - - # Converts hash 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.batch_annotate_images.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::Vision::V1p3beta1::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.batch_annotate_images.timeout, - metadata: metadata, - retry_policy: @config.rpcs.batch_annotate_images.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @image_annotator_stub.call_rpc :batch_annotate_images, 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 - - ## - # Run asynchronous image detection and annotation for a list of generic - # files, such as PDF files, which may contain multiple pages and multiple - # images per page. Progress and results can be retrieved through the - # `google.longrunning.Operations` interface. - # `Operation.metadata` contains `OperationMetadata` (metadata). - # `Operation.response` contains `AsyncBatchAnnotateFilesResponse` (results). - # - # @overload async_batch_annotate_files(request, options = nil) - # Pass arguments to `async_batch_annotate_files` via a request object, either of type - # {::Google::Cloud::Vision::V1p3beta1::AsyncBatchAnnotateFilesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Vision::V1p3beta1::AsyncBatchAnnotateFilesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload async_batch_annotate_files(requests: nil) - # Pass arguments to `async_batch_annotate_files` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param requests [::Array<::Google::Cloud::Vision::V1p3beta1::AsyncAnnotateFileRequest, ::Hash>] - # Required. Individual async file annotation requests for this batch. - # - # @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/vision/v1p3beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Vision::V1p3beta1::ImageAnnotator::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Vision::V1p3beta1::AsyncBatchAnnotateFilesRequest.new - # - # # Call the async_batch_annotate_files method. - # result = client.async_batch_annotate_files 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 async_batch_annotate_files request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Vision::V1p3beta1::AsyncBatchAnnotateFilesRequest - - # Converts hash 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.async_batch_annotate_files.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::Vision::V1p3beta1::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.async_batch_annotate_files.timeout, - metadata: metadata, - retry_policy: @config.rpcs.async_batch_annotate_files.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @image_annotator_stub.call_rpc :async_batch_annotate_files, 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 ImageAnnotator API. - # - # This class represents the configuration for ImageAnnotator, - # 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::Vision::V1p3beta1::ImageAnnotator::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 - # # batch_annotate_images to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Vision::V1p3beta1::ImageAnnotator::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.batch_annotate_images.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Vision::V1p3beta1::ImageAnnotator::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.batch_annotate_images.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::Vision::V1p3beta1::ImageAnnotator::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 = "vision.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 ImageAnnotator 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 `batch_annotate_images` - # @return [::Gapic::Config::Method] - # - attr_reader :batch_annotate_images - ## - # RPC-specific configuration for `async_batch_annotate_files` - # @return [::Gapic::Config::Method] - # - attr_reader :async_batch_annotate_files - - # @private - def initialize parent_rpcs = nil - batch_annotate_images_config = parent_rpcs.batch_annotate_images if parent_rpcs.respond_to? :batch_annotate_images - @batch_annotate_images = ::Gapic::Config::Method.new batch_annotate_images_config - async_batch_annotate_files_config = parent_rpcs.async_batch_annotate_files if parent_rpcs.respond_to? :async_batch_annotate_files - @async_batch_annotate_files = ::Gapic::Config::Method.new async_batch_annotate_files_config - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-vision-v1p3beta1/lib/google/cloud/vision/v1p3beta1/image_annotator/credentials.rb b/owl-bot-staging/google-cloud-vision-v1p3beta1/lib/google/cloud/vision/v1p3beta1/image_annotator/credentials.rb deleted file mode 100644 index 1e1740f8329e..000000000000 --- a/owl-bot-staging/google-cloud-vision-v1p3beta1/lib/google/cloud/vision/v1p3beta1/image_annotator/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 Vision - module V1p3beta1 - module ImageAnnotator - # Credentials for the ImageAnnotator API. - class Credentials < ::Google::Auth::Credentials - self.scope = [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/cloud-vision" - ] - self.env_vars = [ - "VISION_CREDENTIALS", - "VISION_KEYFILE", - "GOOGLE_CLOUD_CREDENTIALS", - "GOOGLE_CLOUD_KEYFILE", - "GCLOUD_KEYFILE", - "VISION_CREDENTIALS_JSON", - "VISION_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-vision-v1p3beta1/lib/google/cloud/vision/v1p3beta1/image_annotator/operations.rb b/owl-bot-staging/google-cloud-vision-v1p3beta1/lib/google/cloud/vision/v1p3beta1/image_annotator/operations.rb deleted file mode 100644 index 12bd396910d5..000000000000 --- a/owl-bot-staging/google-cloud-vision-v1p3beta1/lib/google/cloud/vision/v1p3beta1/image_annotator/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 Vision - module V1p3beta1 - module ImageAnnotator - # Service that implements Longrunning Operations API. - class Operations - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "vision.$UNIVERSE_DOMAIN$" - - # @private - attr_reader :operations_stub - - ## - # Configuration for the ImageAnnotator 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 ImageAnnotator 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::Vision::V1p3beta1::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::Vision::V1p3beta1::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::Vision::V1p3beta1::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::Vision::V1p3beta1::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::Vision::V1p3beta1::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 = "vision.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-vision-v1p3beta1/lib/google/cloud/vision/v1p3beta1/image_annotator/paths.rb b/owl-bot-staging/google-cloud-vision-v1p3beta1/lib/google/cloud/vision/v1p3beta1/image_annotator/paths.rb deleted file mode 100644 index 98b4b7b34af3..000000000000 --- a/owl-bot-staging/google-cloud-vision-v1p3beta1/lib/google/cloud/vision/v1p3beta1/image_annotator/paths.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! - - -module Google - module Cloud - module Vision - module V1p3beta1 - module ImageAnnotator - # Path helper methods for the ImageAnnotator API. - module Paths - ## - # Create a fully-qualified ProductSet resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/productSets/{product_set}` - # - # @param project [String] - # @param location [String] - # @param product_set [String] - # - # @return [::String] - def product_set_path project:, location:, product_set: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/productSets/#{product_set}" - end - - extend self - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-vision-v1p3beta1/lib/google/cloud/vision/v1p3beta1/image_annotator/rest.rb b/owl-bot-staging/google-cloud-vision-v1p3beta1/lib/google/cloud/vision/v1p3beta1/image_annotator/rest.rb deleted file mode 100644 index 3536e3389641..000000000000 --- a/owl-bot-staging/google-cloud-vision-v1p3beta1/lib/google/cloud/vision/v1p3beta1/image_annotator/rest.rb +++ /dev/null @@ -1,55 +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/vision/v1p3beta1/version" - -require "google/cloud/vision/v1p3beta1/image_annotator/credentials" -require "google/cloud/vision/v1p3beta1/image_annotator/paths" -require "google/cloud/vision/v1p3beta1/image_annotator/rest/operations" -require "google/cloud/vision/v1p3beta1/image_annotator/rest/client" - -module Google - module Cloud - module Vision - module V1p3beta1 - ## - # Service that performs Google Cloud Vision API detection tasks over client - # images, such as face, landmark, logo, label, and text detection. The - # ImageAnnotator service returns detected entities from the images. - # - # To load this service and instantiate a REST client: - # - # require "google/cloud/vision/v1p3beta1/image_annotator/rest" - # client = ::Google::Cloud::Vision::V1p3beta1::ImageAnnotator::Rest::Client.new - # - module ImageAnnotator - # Client for the REST transport - module Rest - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "rest", "helpers.rb" -require "google/cloud/vision/v1p3beta1/image_annotator/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-vision-v1p3beta1/lib/google/cloud/vision/v1p3beta1/image_annotator/rest/client.rb b/owl-bot-staging/google-cloud-vision-v1p3beta1/lib/google/cloud/vision/v1p3beta1/image_annotator/rest/client.rb deleted file mode 100644 index cc28aa72ad67..000000000000 --- a/owl-bot-staging/google-cloud-vision-v1p3beta1/lib/google/cloud/vision/v1p3beta1/image_annotator/rest/client.rb +++ /dev/null @@ -1,549 +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/vision/v1p3beta1/image_annotator_pb" -require "google/cloud/vision/v1p3beta1/image_annotator/rest/service_stub" - -module Google - module Cloud - module Vision - module V1p3beta1 - module ImageAnnotator - module Rest - ## - # REST client for the ImageAnnotator service. - # - # Service that performs Google Cloud Vision API detection tasks over client - # images, such as face, landmark, logo, label, and text detection. The - # ImageAnnotator service returns detected entities from the images. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "vision.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :image_annotator_stub - - ## - # Configure the ImageAnnotator Client class. - # - # See {::Google::Cloud::Vision::V1p3beta1::ImageAnnotator::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all ImageAnnotator clients - # ::Google::Cloud::Vision::V1p3beta1::ImageAnnotator::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", "Vision", "V1p3beta1"] - 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.batch_annotate_images.timeout = 600.0 - default_config.rpcs.batch_annotate_images.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.async_batch_annotate_files.timeout = 600.0 - default_config.rpcs.async_batch_annotate_files.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [] - } - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the ImageAnnotator 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::Vision::V1p3beta1::ImageAnnotator::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 - @image_annotator_stub.universe_domain - end - - ## - # Create a new ImageAnnotator REST client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Vision::V1p3beta1::ImageAnnotator::Rest::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Vision::V1p3beta1::ImageAnnotator::Rest::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the ImageAnnotator 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::Vision::V1p3beta1::ImageAnnotator::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 - - @image_annotator_stub = ::Google::Cloud::Vision::V1p3beta1::ImageAnnotator::Rest::ServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials, - logger: @config.logger - ) - - @image_annotator_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 - end - - ## - # Get the associated client for long-running operations. - # - # @return [::Google::Cloud::Vision::V1p3beta1::ImageAnnotator::Rest::Operations] - # - attr_reader :operations_client - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @image_annotator_stub.logger - end - - # Service calls - - ## - # Run image detection and annotation for a batch of images. - # - # @overload batch_annotate_images(request, options = nil) - # Pass arguments to `batch_annotate_images` via a request object, either of type - # {::Google::Cloud::Vision::V1p3beta1::BatchAnnotateImagesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Vision::V1p3beta1::BatchAnnotateImagesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload batch_annotate_images(requests: nil) - # Pass arguments to `batch_annotate_images` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param requests [::Array<::Google::Cloud::Vision::V1p3beta1::AnnotateImageRequest, ::Hash>] - # Individual image annotation requests for this batch. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Vision::V1p3beta1::BatchAnnotateImagesResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Vision::V1p3beta1::BatchAnnotateImagesResponse] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/vision/v1p3beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Vision::V1p3beta1::ImageAnnotator::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Vision::V1p3beta1::BatchAnnotateImagesRequest.new - # - # # Call the batch_annotate_images method. - # result = client.batch_annotate_images request - # - # # The returned object is of type Google::Cloud::Vision::V1p3beta1::BatchAnnotateImagesResponse. - # p result - # - def batch_annotate_images request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Vision::V1p3beta1::BatchAnnotateImagesRequest - - # Converts hash 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.batch_annotate_images.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::Vision::V1p3beta1::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.batch_annotate_images.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.batch_annotate_images.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @image_annotator_stub.batch_annotate_images 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 - - ## - # Run asynchronous image detection and annotation for a list of generic - # files, such as PDF files, which may contain multiple pages and multiple - # images per page. Progress and results can be retrieved through the - # `google.longrunning.Operations` interface. - # `Operation.metadata` contains `OperationMetadata` (metadata). - # `Operation.response` contains `AsyncBatchAnnotateFilesResponse` (results). - # - # @overload async_batch_annotate_files(request, options = nil) - # Pass arguments to `async_batch_annotate_files` via a request object, either of type - # {::Google::Cloud::Vision::V1p3beta1::AsyncBatchAnnotateFilesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Vision::V1p3beta1::AsyncBatchAnnotateFilesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload async_batch_annotate_files(requests: nil) - # Pass arguments to `async_batch_annotate_files` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param requests [::Array<::Google::Cloud::Vision::V1p3beta1::AsyncAnnotateFileRequest, ::Hash>] - # Required. Individual async file annotation requests for this batch. - # @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/vision/v1p3beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Vision::V1p3beta1::ImageAnnotator::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Vision::V1p3beta1::AsyncBatchAnnotateFilesRequest.new - # - # # Call the async_batch_annotate_files method. - # result = client.async_batch_annotate_files 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 async_batch_annotate_files request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Vision::V1p3beta1::AsyncBatchAnnotateFilesRequest - - # Converts hash 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.async_batch_annotate_files.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::Vision::V1p3beta1::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.async_batch_annotate_files.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.async_batch_annotate_files.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @image_annotator_stub.async_batch_annotate_files 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 - - ## - # Configuration class for the ImageAnnotator REST API. - # - # This class represents the configuration for ImageAnnotator 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::Vision::V1p3beta1::ImageAnnotator::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 - # # batch_annotate_images to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Vision::V1p3beta1::ImageAnnotator::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.batch_annotate_images.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Vision::V1p3beta1::ImageAnnotator::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.batch_annotate_images.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 = "vision.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 ImageAnnotator 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 `batch_annotate_images` - # @return [::Gapic::Config::Method] - # - attr_reader :batch_annotate_images - ## - # RPC-specific configuration for `async_batch_annotate_files` - # @return [::Gapic::Config::Method] - # - attr_reader :async_batch_annotate_files - - # @private - def initialize parent_rpcs = nil - batch_annotate_images_config = parent_rpcs.batch_annotate_images if parent_rpcs.respond_to? :batch_annotate_images - @batch_annotate_images = ::Gapic::Config::Method.new batch_annotate_images_config - async_batch_annotate_files_config = parent_rpcs.async_batch_annotate_files if parent_rpcs.respond_to? :async_batch_annotate_files - @async_batch_annotate_files = ::Gapic::Config::Method.new async_batch_annotate_files_config - - yield self if block_given? - end - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-vision-v1p3beta1/lib/google/cloud/vision/v1p3beta1/image_annotator/rest/operations.rb b/owl-bot-staging/google-cloud-vision-v1p3beta1/lib/google/cloud/vision/v1p3beta1/image_annotator/rest/operations.rb deleted file mode 100644 index 7001792ef50e..000000000000 --- a/owl-bot-staging/google-cloud-vision-v1p3beta1/lib/google/cloud/vision/v1p3beta1/image_annotator/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 Vision - module V1p3beta1 - module ImageAnnotator - module Rest - # Service that implements Longrunning Operations API. - class Operations - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "vision.$UNIVERSE_DOMAIN$" - - # @private - attr_reader :operations_stub - - ## - # Configuration for the ImageAnnotator 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 ImageAnnotator 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::Vision::V1p3beta1::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::Vision::V1p3beta1::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::Vision::V1p3beta1::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::Vision::V1p3beta1::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 = "vision.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{^operations(?:/.*)?$}, true] - ] - ) - 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-vision-v1p3beta1/lib/google/cloud/vision/v1p3beta1/image_annotator/rest/service_stub.rb b/owl-bot-staging/google-cloud-vision-v1p3beta1/lib/google/cloud/vision/v1p3beta1/image_annotator/rest/service_stub.rb deleted file mode 100644 index be1f56c5d62e..000000000000 --- a/owl-bot-staging/google-cloud-vision-v1p3beta1/lib/google/cloud/vision/v1p3beta1/image_annotator/rest/service_stub.rb +++ /dev/null @@ -1,201 +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/vision/v1p3beta1/image_annotator_pb" - -module Google - module Cloud - module Vision - module V1p3beta1 - module ImageAnnotator - module Rest - ## - # REST service stub for the ImageAnnotator 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 batch_annotate_images REST call - # - # @param request_pb [::Google::Cloud::Vision::V1p3beta1::BatchAnnotateImagesRequest] - # 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::Vision::V1p3beta1::BatchAnnotateImagesResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Vision::V1p3beta1::BatchAnnotateImagesResponse] - # A result object deserialized from the server's reply - def batch_annotate_images request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_batch_annotate_images_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: "batch_annotate_images", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Vision::V1p3beta1::BatchAnnotateImagesResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the async_batch_annotate_files REST call - # - # @param request_pb [::Google::Cloud::Vision::V1p3beta1::AsyncBatchAnnotateFilesRequest] - # 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 async_batch_annotate_files request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_async_batch_annotate_files_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: "async_batch_annotate_files", - 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 - - ## - # @private - # - # GRPC transcoding helper method for the batch_annotate_images REST call - # - # @param request_pb [::Google::Cloud::Vision::V1p3beta1::BatchAnnotateImagesRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_batch_annotate_images_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1p3beta1/images:annotate", - body: "*", - matches: [] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the async_batch_annotate_files REST call - # - # @param request_pb [::Google::Cloud::Vision::V1p3beta1::AsyncBatchAnnotateFilesRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_async_batch_annotate_files_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1p3beta1/files:asyncBatchAnnotate", - body: "*", - matches: [] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-vision-v1p3beta1/lib/google/cloud/vision/v1p3beta1/image_annotator_pb.rb b/owl-bot-staging/google-cloud-vision-v1p3beta1/lib/google/cloud/vision/v1p3beta1/image_annotator_pb.rb deleted file mode 100644 index 2143defa89f2..000000000000 --- a/owl-bot-staging/google-cloud-vision-v1p3beta1/lib/google/cloud/vision/v1p3beta1/image_annotator_pb.rb +++ /dev/null @@ -1,72 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/vision/v1p3beta1/image_annotator.proto - -require 'google/protobuf' - -require 'google/api/annotations_pb' -require 'google/api/client_pb' -require 'google/api/field_behavior_pb' -require 'google/cloud/vision/v1p3beta1/geometry_pb' -require 'google/cloud/vision/v1p3beta1/product_search_pb' -require 'google/cloud/vision/v1p3beta1/text_annotation_pb' -require 'google/cloud/vision/v1p3beta1/web_detection_pb' -require 'google/longrunning/operations_pb' -require 'google/protobuf/timestamp_pb' -require 'google/rpc/status_pb' -require 'google/type/color_pb' -require 'google/type/latlng_pb' - - -descriptor_data = "\n3google/cloud/vision/v1p3beta1/image_annotator.proto\x12\x1dgoogle.cloud.vision.v1p3beta1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a,google/cloud/vision/v1p3beta1/geometry.proto\x1a\x32google/cloud/vision/v1p3beta1/product_search.proto\x1a\x33google/cloud/vision/v1p3beta1/text_annotation.proto\x1a\x31google/cloud/vision/v1p3beta1/web_detection.proto\x1a#google/longrunning/operations.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x17google/rpc/status.proto\x1a\x17google/type/color.proto\x1a\x18google/type/latlng.proto\"\x8e\x03\n\x07\x46\x65\x61ture\x12\x39\n\x04type\x18\x01 \x01(\x0e\x32+.google.cloud.vision.v1p3beta1.Feature.Type\x12\x13\n\x0bmax_results\x18\x02 \x01(\x05\x12\r\n\x05model\x18\x03 \x01(\t\"\xa3\x02\n\x04Type\x12\x14\n\x10TYPE_UNSPECIFIED\x10\x00\x12\x12\n\x0e\x46\x41\x43\x45_DETECTION\x10\x01\x12\x16\n\x12LANDMARK_DETECTION\x10\x02\x12\x12\n\x0eLOGO_DETECTION\x10\x03\x12\x13\n\x0fLABEL_DETECTION\x10\x04\x12\x12\n\x0eTEXT_DETECTION\x10\x05\x12\x1b\n\x17\x44OCUMENT_TEXT_DETECTION\x10\x0b\x12\x19\n\x15SAFE_SEARCH_DETECTION\x10\x06\x12\x14\n\x10IMAGE_PROPERTIES\x10\x07\x12\x0e\n\nCROP_HINTS\x10\t\x12\x11\n\rWEB_DETECTION\x10\n\x12\x12\n\x0ePRODUCT_SEARCH\x10\x0c\x12\x17\n\x13OBJECT_LOCALIZATION\x10\x13\"7\n\x0bImageSource\x12\x15\n\rgcs_image_uri\x18\x01 \x01(\t\x12\x11\n\timage_uri\x18\x02 \x01(\t\"T\n\x05Image\x12\x0f\n\x07\x63ontent\x18\x01 \x01(\x0c\x12:\n\x06source\x18\x02 \x01(\x0b\x32*.google.cloud.vision.v1p3beta1.ImageSource\"\x9b\x0e\n\x0e\x46\x61\x63\x65\x41nnotation\x12\x42\n\rbounding_poly\x18\x01 \x01(\x0b\x32+.google.cloud.vision.v1p3beta1.BoundingPoly\x12\x45\n\x10\x66\x64_bounding_poly\x18\x02 \x01(\x0b\x32+.google.cloud.vision.v1p3beta1.BoundingPoly\x12I\n\tlandmarks\x18\x03 \x03(\x0b\x32\x36.google.cloud.vision.v1p3beta1.FaceAnnotation.Landmark\x12\x12\n\nroll_angle\x18\x04 \x01(\x02\x12\x11\n\tpan_angle\x18\x05 \x01(\x02\x12\x12\n\ntilt_angle\x18\x06 \x01(\x02\x12\x1c\n\x14\x64\x65tection_confidence\x18\x07 \x01(\x02\x12\x1e\n\x16landmarking_confidence\x18\x08 \x01(\x02\x12\x41\n\x0ejoy_likelihood\x18\t \x01(\x0e\x32).google.cloud.vision.v1p3beta1.Likelihood\x12\x44\n\x11sorrow_likelihood\x18\n \x01(\x0e\x32).google.cloud.vision.v1p3beta1.Likelihood\x12\x43\n\x10\x61nger_likelihood\x18\x0b \x01(\x0e\x32).google.cloud.vision.v1p3beta1.Likelihood\x12\x46\n\x13surprise_likelihood\x18\x0c \x01(\x0e\x32).google.cloud.vision.v1p3beta1.Likelihood\x12K\n\x18under_exposed_likelihood\x18\r \x01(\x0e\x32).google.cloud.vision.v1p3beta1.Likelihood\x12\x45\n\x12\x62lurred_likelihood\x18\x0e \x01(\x0e\x32).google.cloud.vision.v1p3beta1.Likelihood\x12\x46\n\x13headwear_likelihood\x18\x0f \x01(\x0e\x32).google.cloud.vision.v1p3beta1.Likelihood\x1a\xc7\x07\n\x08Landmark\x12I\n\x04type\x18\x03 \x01(\x0e\x32;.google.cloud.vision.v1p3beta1.FaceAnnotation.Landmark.Type\x12\x39\n\x08position\x18\x04 \x01(\x0b\x32\'.google.cloud.vision.v1p3beta1.Position\"\xb4\x06\n\x04Type\x12\x14\n\x10UNKNOWN_LANDMARK\x10\x00\x12\x0c\n\x08LEFT_EYE\x10\x01\x12\r\n\tRIGHT_EYE\x10\x02\x12\x18\n\x14LEFT_OF_LEFT_EYEBROW\x10\x03\x12\x19\n\x15RIGHT_OF_LEFT_EYEBROW\x10\x04\x12\x19\n\x15LEFT_OF_RIGHT_EYEBROW\x10\x05\x12\x1a\n\x16RIGHT_OF_RIGHT_EYEBROW\x10\x06\x12\x19\n\x15MIDPOINT_BETWEEN_EYES\x10\x07\x12\x0c\n\x08NOSE_TIP\x10\x08\x12\r\n\tUPPER_LIP\x10\t\x12\r\n\tLOWER_LIP\x10\n\x12\x0e\n\nMOUTH_LEFT\x10\x0b\x12\x0f\n\x0bMOUTH_RIGHT\x10\x0c\x12\x10\n\x0cMOUTH_CENTER\x10\r\x12\x15\n\x11NOSE_BOTTOM_RIGHT\x10\x0e\x12\x14\n\x10NOSE_BOTTOM_LEFT\x10\x0f\x12\x16\n\x12NOSE_BOTTOM_CENTER\x10\x10\x12\x19\n\x15LEFT_EYE_TOP_BOUNDARY\x10\x11\x12\x19\n\x15LEFT_EYE_RIGHT_CORNER\x10\x12\x12\x1c\n\x18LEFT_EYE_BOTTOM_BOUNDARY\x10\x13\x12\x18\n\x14LEFT_EYE_LEFT_CORNER\x10\x14\x12\x1a\n\x16RIGHT_EYE_TOP_BOUNDARY\x10\x15\x12\x1a\n\x16RIGHT_EYE_RIGHT_CORNER\x10\x16\x12\x1d\n\x19RIGHT_EYE_BOTTOM_BOUNDARY\x10\x17\x12\x19\n\x15RIGHT_EYE_LEFT_CORNER\x10\x18\x12\x1f\n\x1bLEFT_EYEBROW_UPPER_MIDPOINT\x10\x19\x12 \n\x1cRIGHT_EYEBROW_UPPER_MIDPOINT\x10\x1a\x12\x14\n\x10LEFT_EAR_TRAGION\x10\x1b\x12\x15\n\x11RIGHT_EAR_TRAGION\x10\x1c\x12\x12\n\x0eLEFT_EYE_PUPIL\x10\x1d\x12\x13\n\x0fRIGHT_EYE_PUPIL\x10\x1e\x12\x15\n\x11\x46OREHEAD_GLABELLA\x10\x1f\x12\x11\n\rCHIN_GNATHION\x10 \x12\x14\n\x10\x43HIN_LEFT_GONION\x10!\x12\x15\n\x11\x43HIN_RIGHT_GONION\x10\"\"4\n\x0cLocationInfo\x12$\n\x07lat_lng\x18\x01 \x01(\x0b\x32\x13.google.type.LatLng\"=\n\x08Property\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t\x12\x14\n\x0cuint64_value\x18\x03 \x01(\x04\"\xbc\x02\n\x10\x45ntityAnnotation\x12\x0b\n\x03mid\x18\x01 \x01(\t\x12\x0e\n\x06locale\x18\x02 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x03 \x01(\t\x12\r\n\x05score\x18\x04 \x01(\x02\x12\x12\n\nconfidence\x18\x05 \x01(\x02\x12\x12\n\ntopicality\x18\x06 \x01(\x02\x12\x42\n\rbounding_poly\x18\x07 \x01(\x0b\x32+.google.cloud.vision.v1p3beta1.BoundingPoly\x12>\n\tlocations\x18\x08 \x03(\x0b\x32+.google.cloud.vision.v1p3beta1.LocationInfo\x12;\n\nproperties\x18\t \x03(\x0b\x32\'.google.cloud.vision.v1p3beta1.Property\"\xa0\x01\n\x19LocalizedObjectAnnotation\x12\x0b\n\x03mid\x18\x01 \x01(\t\x12\x15\n\rlanguage_code\x18\x02 \x01(\t\x12\x0c\n\x04name\x18\x03 \x01(\t\x12\r\n\x05score\x18\x04 \x01(\x02\x12\x42\n\rbounding_poly\x18\x05 \x01(\x0b\x32+.google.cloud.vision.v1p3beta1.BoundingPoly\"\xbc\x02\n\x14SafeSearchAnnotation\x12\x38\n\x05\x61\x64ult\x18\x01 \x01(\x0e\x32).google.cloud.vision.v1p3beta1.Likelihood\x12\x38\n\x05spoof\x18\x02 \x01(\x0e\x32).google.cloud.vision.v1p3beta1.Likelihood\x12:\n\x07medical\x18\x03 \x01(\x0e\x32).google.cloud.vision.v1p3beta1.Likelihood\x12;\n\x08violence\x18\x04 \x01(\x0e\x32).google.cloud.vision.v1p3beta1.Likelihood\x12\x37\n\x04racy\x18\t \x01(\x0e\x32).google.cloud.vision.v1p3beta1.Likelihood\"a\n\x0bLatLongRect\x12(\n\x0bmin_lat_lng\x18\x01 \x01(\x0b\x32\x13.google.type.LatLng\x12(\n\x0bmax_lat_lng\x18\x02 \x01(\x0b\x32\x13.google.type.LatLng\"U\n\tColorInfo\x12!\n\x05\x63olor\x18\x01 \x01(\x0b\x32\x12.google.type.Color\x12\r\n\x05score\x18\x02 \x01(\x02\x12\x16\n\x0epixel_fraction\x18\x03 \x01(\x02\"T\n\x18\x44ominantColorsAnnotation\x12\x38\n\x06\x63olors\x18\x01 \x03(\x0b\x32(.google.cloud.vision.v1p3beta1.ColorInfo\"c\n\x0fImageProperties\x12P\n\x0f\x64ominant_colors\x18\x01 \x01(\x0b\x32\x37.google.cloud.vision.v1p3beta1.DominantColorsAnnotation\"\x7f\n\x08\x43ropHint\x12\x42\n\rbounding_poly\x18\x01 \x01(\x0b\x32+.google.cloud.vision.v1p3beta1.BoundingPoly\x12\x12\n\nconfidence\x18\x02 \x01(\x02\x12\x1b\n\x13importance_fraction\x18\x03 \x01(\x02\"R\n\x13\x43ropHintsAnnotation\x12;\n\ncrop_hints\x18\x01 \x03(\x0b\x32\'.google.cloud.vision.v1p3beta1.CropHint\"(\n\x0f\x43ropHintsParams\x12\x15\n\raspect_ratios\x18\x01 \x03(\x02\"1\n\x12WebDetectionParams\x12\x1b\n\x13include_geo_results\x18\x02 \x01(\x08\"c\n\x13TextDetectionParams\x12.\n&enable_text_detection_confidence_score\x18\t \x01(\x08\x12\x1c\n\x14\x61\x64vanced_ocr_options\x18\x0b \x03(\t\"\xab\x03\n\x0cImageContext\x12\x41\n\rlat_long_rect\x18\x01 \x01(\x0b\x32*.google.cloud.vision.v1p3beta1.LatLongRect\x12\x16\n\x0elanguage_hints\x18\x02 \x03(\t\x12I\n\x11\x63rop_hints_params\x18\x04 \x01(\x0b\x32..google.cloud.vision.v1p3beta1.CropHintsParams\x12Q\n\x15product_search_params\x18\x05 \x01(\x0b\x32\x32.google.cloud.vision.v1p3beta1.ProductSearchParams\x12O\n\x14web_detection_params\x18\x06 \x01(\x0b\x32\x31.google.cloud.vision.v1p3beta1.WebDetectionParams\x12Q\n\x15text_detection_params\x18\x0c \x01(\x0b\x32\x32.google.cloud.vision.v1p3beta1.TextDetectionParams\"\xc9\x01\n\x14\x41nnotateImageRequest\x12\x33\n\x05image\x18\x01 \x01(\x0b\x32$.google.cloud.vision.v1p3beta1.Image\x12\x38\n\x08\x66\x65\x61tures\x18\x02 \x03(\x0b\x32&.google.cloud.vision.v1p3beta1.Feature\x12\x42\n\rimage_context\x18\x03 \x01(\x0b\x32+.google.cloud.vision.v1p3beta1.ImageContext\":\n\x16ImageAnnotationContext\x12\x0b\n\x03uri\x18\x01 \x01(\t\x12\x13\n\x0bpage_number\x18\x02 \x01(\x05\"\xbf\x08\n\x15\x41nnotateImageResponse\x12G\n\x10\x66\x61\x63\x65_annotations\x18\x01 \x03(\x0b\x32-.google.cloud.vision.v1p3beta1.FaceAnnotation\x12M\n\x14landmark_annotations\x18\x02 \x03(\x0b\x32/.google.cloud.vision.v1p3beta1.EntityAnnotation\x12I\n\x10logo_annotations\x18\x03 \x03(\x0b\x32/.google.cloud.vision.v1p3beta1.EntityAnnotation\x12J\n\x11label_annotations\x18\x04 \x03(\x0b\x32/.google.cloud.vision.v1p3beta1.EntityAnnotation\x12^\n\x1clocalized_object_annotations\x18\x16 \x03(\x0b\x32\x38.google.cloud.vision.v1p3beta1.LocalizedObjectAnnotation\x12I\n\x10text_annotations\x18\x05 \x03(\x0b\x32/.google.cloud.vision.v1p3beta1.EntityAnnotation\x12K\n\x14\x66ull_text_annotation\x18\x0c \x01(\x0b\x32-.google.cloud.vision.v1p3beta1.TextAnnotation\x12S\n\x16safe_search_annotation\x18\x06 \x01(\x0b\x32\x33.google.cloud.vision.v1p3beta1.SafeSearchAnnotation\x12S\n\x1bimage_properties_annotation\x18\x08 \x01(\x0b\x32..google.cloud.vision.v1p3beta1.ImageProperties\x12Q\n\x15\x63rop_hints_annotation\x18\x0b \x01(\x0b\x32\x32.google.cloud.vision.v1p3beta1.CropHintsAnnotation\x12\x42\n\rweb_detection\x18\r \x01(\x0b\x32+.google.cloud.vision.v1p3beta1.WebDetection\x12S\n\x16product_search_results\x18\x0e \x01(\x0b\x32\x33.google.cloud.vision.v1p3beta1.ProductSearchResults\x12!\n\x05\x65rror\x18\t \x01(\x0b\x32\x12.google.rpc.Status\x12\x46\n\x07\x63ontext\x18\x15 \x01(\x0b\x32\x35.google.cloud.vision.v1p3beta1.ImageAnnotationContext\"\xa1\x01\n\x14\x41nnotateFileResponse\x12@\n\x0cinput_config\x18\x01 \x01(\x0b\x32*.google.cloud.vision.v1p3beta1.InputConfig\x12G\n\tresponses\x18\x02 \x03(\x0b\x32\x34.google.cloud.vision.v1p3beta1.AnnotateImageResponse\"h\n\x1a\x42\x61tchAnnotateImagesRequest\x12J\n\x08requests\x18\x01 \x03(\x0b\x32\x33.google.cloud.vision.v1p3beta1.AnnotateImageRequestB\x03\xe0\x41\x02\"f\n\x1b\x42\x61tchAnnotateImagesResponse\x12G\n\tresponses\x18\x01 \x03(\x0b\x32\x34.google.cloud.vision.v1p3beta1.AnnotateImageResponse\"\x9e\x02\n\x18\x41syncAnnotateFileRequest\x12@\n\x0cinput_config\x18\x01 \x01(\x0b\x32*.google.cloud.vision.v1p3beta1.InputConfig\x12\x38\n\x08\x66\x65\x61tures\x18\x02 \x03(\x0b\x32&.google.cloud.vision.v1p3beta1.Feature\x12\x42\n\rimage_context\x18\x03 \x01(\x0b\x32+.google.cloud.vision.v1p3beta1.ImageContext\x12\x42\n\routput_config\x18\x04 \x01(\x0b\x32+.google.cloud.vision.v1p3beta1.OutputConfig\"_\n\x19\x41syncAnnotateFileResponse\x12\x42\n\routput_config\x18\x01 \x01(\x0b\x32+.google.cloud.vision.v1p3beta1.OutputConfig\"p\n\x1e\x41syncBatchAnnotateFilesRequest\x12N\n\x08requests\x18\x01 \x03(\x0b\x32\x37.google.cloud.vision.v1p3beta1.AsyncAnnotateFileRequestB\x03\xe0\x41\x02\"n\n\x1f\x41syncBatchAnnotateFilesResponse\x12K\n\tresponses\x18\x01 \x03(\x0b\x32\x38.google.cloud.vision.v1p3beta1.AsyncAnnotateFileResponse\"^\n\x0bInputConfig\x12<\n\ngcs_source\x18\x01 \x01(\x0b\x32(.google.cloud.vision.v1p3beta1.GcsSource\x12\x11\n\tmime_type\x18\x02 \x01(\t\"j\n\x0cOutputConfig\x12\x46\n\x0fgcs_destination\x18\x01 \x01(\x0b\x32-.google.cloud.vision.v1p3beta1.GcsDestination\x12\x12\n\nbatch_size\x18\x02 \x01(\x05\"\x18\n\tGcsSource\x12\x0b\n\x03uri\x18\x01 \x01(\t\"\x1d\n\x0eGcsDestination\x12\x0b\n\x03uri\x18\x01 \x01(\t\"\x8f\x02\n\x11OperationMetadata\x12\x45\n\x05state\x18\x01 \x01(\x0e\x32\x36.google.cloud.vision.v1p3beta1.OperationMetadata.State\x12/\n\x0b\x63reate_time\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12/\n\x0bupdate_time\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"Q\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0b\n\x07\x43REATED\x10\x01\x12\x0b\n\x07RUNNING\x10\x02\x12\x08\n\x04\x44ONE\x10\x03\x12\r\n\tCANCELLED\x10\x04*e\n\nLikelihood\x12\x0b\n\x07UNKNOWN\x10\x00\x12\x11\n\rVERY_UNLIKELY\x10\x01\x12\x0c\n\x08UNLIKELY\x10\x02\x12\x0c\n\x08POSSIBLE\x10\x03\x12\n\n\x06LIKELY\x10\x04\x12\x0f\n\x0bVERY_LIKELY\x10\x05\x32\xb5\x04\n\x0eImageAnnotator\x12\xbe\x01\n\x13\x42\x61tchAnnotateImages\x12\x39.google.cloud.vision.v1p3beta1.BatchAnnotateImagesRequest\x1a:.google.cloud.vision.v1p3beta1.BatchAnnotateImagesResponse\"0\xda\x41\x08requests\x82\xd3\xe4\x93\x02\x1f\"\x1a/v1p3beta1/images:annotate:\x01*\x12\xe9\x01\n\x17\x41syncBatchAnnotateFiles\x12=.google.cloud.vision.v1p3beta1.AsyncBatchAnnotateFilesRequest\x1a\x1d.google.longrunning.Operation\"p\xca\x41\x34\n\x1f\x41syncBatchAnnotateFilesResponse\x12\x11OperationMetadata\xda\x41\x08requests\x82\xd3\xe4\x93\x02(\"#/v1p3beta1/files:asyncBatchAnnotate:\x01*\x1av\xca\x41\x15vision.googleapis.com\xd2\x41[https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/cloud-visionBx\n!com.google.cloud.vision.v1p3beta1B\x13ImageAnnotatorProtoP\x01Z9cloud.google.com/go/vision/apiv1p3beta1/visionpb;visionpb\xf8\x01\x01\x62\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module Vision - module V1p3beta1 - Feature = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p3beta1.Feature").msgclass - Feature::Type = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p3beta1.Feature.Type").enummodule - ImageSource = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p3beta1.ImageSource").msgclass - Image = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p3beta1.Image").msgclass - FaceAnnotation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p3beta1.FaceAnnotation").msgclass - FaceAnnotation::Landmark = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p3beta1.FaceAnnotation.Landmark").msgclass - FaceAnnotation::Landmark::Type = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p3beta1.FaceAnnotation.Landmark.Type").enummodule - LocationInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p3beta1.LocationInfo").msgclass - Property = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p3beta1.Property").msgclass - EntityAnnotation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p3beta1.EntityAnnotation").msgclass - LocalizedObjectAnnotation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p3beta1.LocalizedObjectAnnotation").msgclass - SafeSearchAnnotation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p3beta1.SafeSearchAnnotation").msgclass - LatLongRect = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p3beta1.LatLongRect").msgclass - ColorInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p3beta1.ColorInfo").msgclass - DominantColorsAnnotation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p3beta1.DominantColorsAnnotation").msgclass - ImageProperties = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p3beta1.ImageProperties").msgclass - CropHint = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p3beta1.CropHint").msgclass - CropHintsAnnotation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p3beta1.CropHintsAnnotation").msgclass - CropHintsParams = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p3beta1.CropHintsParams").msgclass - WebDetectionParams = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p3beta1.WebDetectionParams").msgclass - TextDetectionParams = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p3beta1.TextDetectionParams").msgclass - ImageContext = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p3beta1.ImageContext").msgclass - AnnotateImageRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p3beta1.AnnotateImageRequest").msgclass - ImageAnnotationContext = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p3beta1.ImageAnnotationContext").msgclass - AnnotateImageResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p3beta1.AnnotateImageResponse").msgclass - AnnotateFileResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p3beta1.AnnotateFileResponse").msgclass - BatchAnnotateImagesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p3beta1.BatchAnnotateImagesRequest").msgclass - BatchAnnotateImagesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p3beta1.BatchAnnotateImagesResponse").msgclass - AsyncAnnotateFileRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p3beta1.AsyncAnnotateFileRequest").msgclass - AsyncAnnotateFileResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p3beta1.AsyncAnnotateFileResponse").msgclass - AsyncBatchAnnotateFilesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p3beta1.AsyncBatchAnnotateFilesRequest").msgclass - AsyncBatchAnnotateFilesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p3beta1.AsyncBatchAnnotateFilesResponse").msgclass - InputConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p3beta1.InputConfig").msgclass - OutputConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p3beta1.OutputConfig").msgclass - GcsSource = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p3beta1.GcsSource").msgclass - GcsDestination = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p3beta1.GcsDestination").msgclass - OperationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p3beta1.OperationMetadata").msgclass - OperationMetadata::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p3beta1.OperationMetadata.State").enummodule - Likelihood = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p3beta1.Likelihood").enummodule - end - end - end -end diff --git a/owl-bot-staging/google-cloud-vision-v1p3beta1/lib/google/cloud/vision/v1p3beta1/image_annotator_services_pb.rb b/owl-bot-staging/google-cloud-vision-v1p3beta1/lib/google/cloud/vision/v1p3beta1/image_annotator_services_pb.rb deleted file mode 100644 index 8a8f2c55fac0..000000000000 --- a/owl-bot-staging/google-cloud-vision-v1p3beta1/lib/google/cloud/vision/v1p3beta1/image_annotator_services_pb.rb +++ /dev/null @@ -1,55 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# Source: google/cloud/vision/v1p3beta1/image_annotator.proto for package 'google.cloud.vision.v1p3beta1' -# 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/vision/v1p3beta1/image_annotator_pb' - -module Google - module Cloud - module Vision - module V1p3beta1 - module ImageAnnotator - # Service that performs Google Cloud Vision API detection tasks over client - # images, such as face, landmark, logo, label, and text detection. The - # ImageAnnotator service returns detected entities from the images. - class Service - - include ::GRPC::GenericService - - self.marshal_class_method = :encode - self.unmarshal_class_method = :decode - self.service_name = 'google.cloud.vision.v1p3beta1.ImageAnnotator' - - # Run image detection and annotation for a batch of images. - rpc :BatchAnnotateImages, ::Google::Cloud::Vision::V1p3beta1::BatchAnnotateImagesRequest, ::Google::Cloud::Vision::V1p3beta1::BatchAnnotateImagesResponse - # Run asynchronous image detection and annotation for a list of generic - # files, such as PDF files, which may contain multiple pages and multiple - # images per page. Progress and results can be retrieved through the - # `google.longrunning.Operations` interface. - # `Operation.metadata` contains `OperationMetadata` (metadata). - # `Operation.response` contains `AsyncBatchAnnotateFilesResponse` (results). - rpc :AsyncBatchAnnotateFiles, ::Google::Cloud::Vision::V1p3beta1::AsyncBatchAnnotateFilesRequest, ::Google::Longrunning::Operation - end - - Stub = Service.rpc_stub_class - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-vision-v1p3beta1/lib/google/cloud/vision/v1p3beta1/product_search.rb b/owl-bot-staging/google-cloud-vision-v1p3beta1/lib/google/cloud/vision/v1p3beta1/product_search.rb deleted file mode 100644 index 9706818d4c6b..000000000000 --- a/owl-bot-staging/google-cloud-vision-v1p3beta1/lib/google/cloud/vision/v1p3beta1/product_search.rb +++ /dev/null @@ -1,69 +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/vision/v1p3beta1/version" - -require "google/cloud/vision/v1p3beta1/product_search/credentials" -require "google/cloud/vision/v1p3beta1/product_search/paths" -require "google/cloud/vision/v1p3beta1/product_search/operations" -require "google/cloud/vision/v1p3beta1/product_search/client" -require "google/cloud/vision/v1p3beta1/product_search/rest" - -module Google - module Cloud - module Vision - module V1p3beta1 - ## - # Manages Products and ProductSets of reference images for use in product - # search. It uses the following resource model: - # - # - The API has a collection of {::Google::Cloud::Vision::V1p3beta1::ProductSet ProductSet} resources, named - # `projects/*/locations/*/productSets/*`, which acts as a way to put different - # products into groups to limit identification. - # - # In parallel, - # - # - The API has a collection of {::Google::Cloud::Vision::V1p3beta1::Product Product} resources, named - # `projects/*/locations/*/products/*` - # - # - Each {::Google::Cloud::Vision::V1p3beta1::Product Product} has a collection of {::Google::Cloud::Vision::V1p3beta1::ReferenceImage ReferenceImage} resources, named - # `projects/*/locations/*/products/*/referenceImages/*` - # - # @example Load this service and instantiate a gRPC client - # - # require "google/cloud/vision/v1p3beta1/product_search" - # client = ::Google::Cloud::Vision::V1p3beta1::ProductSearch::Client.new - # - # @example Load this service and instantiate a REST client - # - # require "google/cloud/vision/v1p3beta1/product_search/rest" - # client = ::Google::Cloud::Vision::V1p3beta1::ProductSearch::Rest::Client.new - # - module ProductSearch - end - end - end - end -end - -helper_path = ::File.join __dir__, "product_search", "helpers.rb" -require "google/cloud/vision/v1p3beta1/product_search/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-vision-v1p3beta1/lib/google/cloud/vision/v1p3beta1/product_search/client.rb b/owl-bot-staging/google-cloud-vision-v1p3beta1/lib/google/cloud/vision/v1p3beta1/product_search/client.rb deleted file mode 100644 index 1d0d59cb2903..000000000000 --- a/owl-bot-staging/google-cloud-vision-v1p3beta1/lib/google/cloud/vision/v1p3beta1/product_search/client.rb +++ /dev/null @@ -1,2429 +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/vision/v1p3beta1/product_search_service_pb" - -module Google - module Cloud - module Vision - module V1p3beta1 - module ProductSearch - ## - # Client for the ProductSearch service. - # - # Manages Products and ProductSets of reference images for use in product - # search. It uses the following resource model: - # - # - The API has a collection of {::Google::Cloud::Vision::V1p3beta1::ProductSet ProductSet} resources, named - # `projects/*/locations/*/productSets/*`, which acts as a way to put different - # products into groups to limit identification. - # - # In parallel, - # - # - The API has a collection of {::Google::Cloud::Vision::V1p3beta1::Product Product} resources, named - # `projects/*/locations/*/products/*` - # - # - Each {::Google::Cloud::Vision::V1p3beta1::Product Product} has a collection of {::Google::Cloud::Vision::V1p3beta1::ReferenceImage ReferenceImage} resources, named - # `projects/*/locations/*/products/*/referenceImages/*` - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "vision.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :product_search_stub - - ## - # Configure the ProductSearch Client class. - # - # See {::Google::Cloud::Vision::V1p3beta1::ProductSearch::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all ProductSearch clients - # ::Google::Cloud::Vision::V1p3beta1::ProductSearch::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", "Vision", "V1p3beta1"] - 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_product_set.timeout = 600.0 - default_config.rpcs.create_product_set.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [] - } - - default_config.rpcs.list_product_sets.timeout = 600.0 - default_config.rpcs.list_product_sets.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.get_product_set.timeout = 600.0 - default_config.rpcs.get_product_set.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.update_product_set.timeout = 600.0 - default_config.rpcs.update_product_set.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [] - } - - default_config.rpcs.delete_product_set.timeout = 600.0 - default_config.rpcs.delete_product_set.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.create_product.timeout = 600.0 - default_config.rpcs.create_product.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [] - } - - default_config.rpcs.list_products.timeout = 600.0 - default_config.rpcs.list_products.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.get_product.timeout = 600.0 - default_config.rpcs.get_product.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.update_product.timeout = 600.0 - default_config.rpcs.update_product.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [] - } - - default_config.rpcs.delete_product.timeout = 600.0 - default_config.rpcs.delete_product.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.create_reference_image.timeout = 600.0 - default_config.rpcs.create_reference_image.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [] - } - - default_config.rpcs.delete_reference_image.timeout = 600.0 - default_config.rpcs.delete_reference_image.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.list_reference_images.timeout = 600.0 - default_config.rpcs.list_reference_images.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.get_reference_image.timeout = 600.0 - default_config.rpcs.get_reference_image.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.add_product_to_product_set.timeout = 600.0 - default_config.rpcs.add_product_to_product_set.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [] - } - - default_config.rpcs.remove_product_from_product_set.timeout = 600.0 - default_config.rpcs.remove_product_from_product_set.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [] - } - - default_config.rpcs.list_products_in_product_set.timeout = 600.0 - default_config.rpcs.list_products_in_product_set.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.import_product_sets.timeout = 600.0 - default_config.rpcs.import_product_sets.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [] - } - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the ProductSearch 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::Vision::V1p3beta1::ProductSearch::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 - @product_search_stub.universe_domain - end - - ## - # Create a new ProductSearch client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Vision::V1p3beta1::ProductSearch::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Vision::V1p3beta1::ProductSearch::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the ProductSearch 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/vision/v1p3beta1/product_search_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 - - @product_search_stub = ::Gapic::ServiceStub.new( - ::Google::Cloud::Vision::V1p3beta1::ProductSearch::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 - ) - - @product_search_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 - end - - ## - # Get the associated client for long-running operations. - # - # @return [::Google::Cloud::Vision::V1p3beta1::ProductSearch::Operations] - # - attr_reader :operations_client - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @product_search_stub.logger - end - - # Service calls - - ## - # Creates and returns a new ProductSet resource. - # - # Possible errors: - # - # * Returns INVALID_ARGUMENT if display_name is missing, or is longer than - # 4096 characters. - # - # @overload create_product_set(request, options = nil) - # Pass arguments to `create_product_set` via a request object, either of type - # {::Google::Cloud::Vision::V1p3beta1::CreateProductSetRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Vision::V1p3beta1::CreateProductSetRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_product_set(parent: nil, product_set: nil, product_set_id: nil) - # Pass arguments to `create_product_set` via keyword arguments. Note that at - # least one keyword argument is 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 in which the ProductSet should be created. - # - # Format is `projects/PROJECT_ID/locations/LOC_ID`. - # @param product_set [::Google::Cloud::Vision::V1p3beta1::ProductSet, ::Hash] - # Required. The ProductSet to create. - # @param product_set_id [::String] - # A user-supplied resource id for this ProductSet. If set, the server will - # attempt to use this value as the resource id. If it is already in use, an - # error is returned with code ALREADY_EXISTS. Must be at most 128 characters - # long. It cannot contain the character `/`. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Vision::V1p3beta1::ProductSet] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Vision::V1p3beta1::ProductSet] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/vision/v1p3beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Vision::V1p3beta1::ProductSearch::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Vision::V1p3beta1::CreateProductSetRequest.new - # - # # Call the create_product_set method. - # result = client.create_product_set request - # - # # The returned object is of type Google::Cloud::Vision::V1p3beta1::ProductSet. - # p result - # - def create_product_set request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Vision::V1p3beta1::CreateProductSetRequest - - # Converts hash 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_product_set.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::Vision::V1p3beta1::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_product_set.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_product_set.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @product_search_stub.call_rpc :create_product_set, 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 ProductSets in an unspecified order. - # - # Possible errors: - # - # * Returns INVALID_ARGUMENT if page_size is greater than 100, or less - # than 1. - # - # @overload list_product_sets(request, options = nil) - # Pass arguments to `list_product_sets` via a request object, either of type - # {::Google::Cloud::Vision::V1p3beta1::ListProductSetsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Vision::V1p3beta1::ListProductSetsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_product_sets(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_product_sets` via keyword arguments. Note that at - # least one keyword argument is 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 from which ProductSets should be listed. - # - # Format is `projects/PROJECT_ID/locations/LOC_ID`. - # @param page_size [::Integer] - # The maximum number of items to return. Default 10, maximum 100. - # @param page_token [::String] - # The next_page_token returned from a previous List request, if any. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Vision::V1p3beta1::ProductSet>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::Vision::V1p3beta1::ProductSet>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/vision/v1p3beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Vision::V1p3beta1::ProductSearch::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Vision::V1p3beta1::ListProductSetsRequest.new - # - # # Call the list_product_sets method. - # result = client.list_product_sets 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::Vision::V1p3beta1::ProductSet. - # p item - # end - # - def list_product_sets request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Vision::V1p3beta1::ListProductSetsRequest - - # Converts hash 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_product_sets.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::Vision::V1p3beta1::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_product_sets.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_product_sets.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @product_search_stub.call_rpc :list_product_sets, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @product_search_stub, :list_product_sets, 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 - - ## - # Gets information associated with a ProductSet. - # - # Possible errors: - # - # * Returns NOT_FOUND if the ProductSet does not exist. - # - # @overload get_product_set(request, options = nil) - # Pass arguments to `get_product_set` via a request object, either of type - # {::Google::Cloud::Vision::V1p3beta1::GetProductSetRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Vision::V1p3beta1::GetProductSetRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_product_set(name: nil) - # Pass arguments to `get_product_set` via keyword arguments. Note that at - # least one keyword argument is 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. Resource name of the ProductSet to get. - # - # Format is: - # `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID` - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Vision::V1p3beta1::ProductSet] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Vision::V1p3beta1::ProductSet] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/vision/v1p3beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Vision::V1p3beta1::ProductSearch::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Vision::V1p3beta1::GetProductSetRequest.new - # - # # Call the get_product_set method. - # result = client.get_product_set request - # - # # The returned object is of type Google::Cloud::Vision::V1p3beta1::ProductSet. - # p result - # - def get_product_set request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Vision::V1p3beta1::GetProductSetRequest - - # Converts hash 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_product_set.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::Vision::V1p3beta1::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_product_set.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_product_set.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @product_search_stub.call_rpc :get_product_set, 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 - - ## - # Makes changes to a ProductSet resource. - # Only display_name can be updated currently. - # - # Possible errors: - # - # * Returns NOT_FOUND if the ProductSet does not exist. - # * Returns INVALID_ARGUMENT if display_name is present in update_mask but - # missing from the request or longer than 4096 characters. - # - # @overload update_product_set(request, options = nil) - # Pass arguments to `update_product_set` via a request object, either of type - # {::Google::Cloud::Vision::V1p3beta1::UpdateProductSetRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Vision::V1p3beta1::UpdateProductSetRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_product_set(product_set: nil, update_mask: nil) - # Pass arguments to `update_product_set` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param product_set [::Google::Cloud::Vision::V1p3beta1::ProductSet, ::Hash] - # Required. The ProductSet resource which replaces the one on the server. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # The {::Google::Protobuf::FieldMask FieldMask} that specifies which fields to - # update. - # If update_mask isn't specified, all mutable fields are to be updated. - # Valid mask path is `display_name`. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Vision::V1p3beta1::ProductSet] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Vision::V1p3beta1::ProductSet] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/vision/v1p3beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Vision::V1p3beta1::ProductSearch::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Vision::V1p3beta1::UpdateProductSetRequest.new - # - # # Call the update_product_set method. - # result = client.update_product_set request - # - # # The returned object is of type Google::Cloud::Vision::V1p3beta1::ProductSet. - # p result - # - def update_product_set request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Vision::V1p3beta1::UpdateProductSetRequest - - # Converts hash 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_product_set.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::Vision::V1p3beta1::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.product_set&.name - header_params["product_set.name"] = request.product_set.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_product_set.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_product_set.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @product_search_stub.call_rpc :update_product_set, 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 a ProductSet. All Products and ReferenceImages in the - # ProductSet will be deleted. - # - # The actual image files are not deleted from Google Cloud Storage. - # - # Possible errors: - # - # * Returns NOT_FOUND if the ProductSet does not exist. - # - # @overload delete_product_set(request, options = nil) - # Pass arguments to `delete_product_set` via a request object, either of type - # {::Google::Cloud::Vision::V1p3beta1::DeleteProductSetRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Vision::V1p3beta1::DeleteProductSetRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_product_set(name: nil) - # Pass arguments to `delete_product_set` via keyword arguments. Note that at - # least one keyword argument is 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. Resource name of the ProductSet to delete. - # - # Format is: - # `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID` - # - # @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/vision/v1p3beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Vision::V1p3beta1::ProductSearch::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Vision::V1p3beta1::DeleteProductSetRequest.new - # - # # Call the delete_product_set method. - # result = client.delete_product_set request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_product_set request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Vision::V1p3beta1::DeleteProductSetRequest - - # Converts hash 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_product_set.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::Vision::V1p3beta1::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_product_set.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_product_set.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @product_search_stub.call_rpc :delete_product_set, 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 and returns a new product resource. - # - # Possible errors: - # - # * Returns INVALID_ARGUMENT if display_name is missing or longer than 4096 - # characters. - # * Returns INVALID_ARGUMENT if description is longer than 4096 characters. - # * Returns INVALID_ARGUMENT if product_category is missing or invalid. - # - # @overload create_product(request, options = nil) - # Pass arguments to `create_product` via a request object, either of type - # {::Google::Cloud::Vision::V1p3beta1::CreateProductRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Vision::V1p3beta1::CreateProductRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_product(parent: nil, product: nil, product_id: nil) - # Pass arguments to `create_product` via keyword arguments. Note that at - # least one keyword argument is 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 in which the Product should be created. - # - # Format is - # `projects/PROJECT_ID/locations/LOC_ID`. - # @param product [::Google::Cloud::Vision::V1p3beta1::Product, ::Hash] - # Required. The product to create. - # @param product_id [::String] - # A user-supplied resource id for this Product. If set, the server will - # attempt to use this value as the resource id. If it is already in use, an - # error is returned with code ALREADY_EXISTS. Must be at most 128 characters - # long. It cannot contain the character `/`. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Vision::V1p3beta1::Product] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Vision::V1p3beta1::Product] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/vision/v1p3beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Vision::V1p3beta1::ProductSearch::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Vision::V1p3beta1::CreateProductRequest.new - # - # # Call the create_product method. - # result = client.create_product request - # - # # The returned object is of type Google::Cloud::Vision::V1p3beta1::Product. - # p result - # - def create_product request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Vision::V1p3beta1::CreateProductRequest - - # Converts hash 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_product.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::Vision::V1p3beta1::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_product.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_product.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @product_search_stub.call_rpc :create_product, 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 products in an unspecified order. - # - # Possible errors: - # - # * Returns INVALID_ARGUMENT if page_size is greater than 100 or less than 1. - # - # @overload list_products(request, options = nil) - # Pass arguments to `list_products` via a request object, either of type - # {::Google::Cloud::Vision::V1p3beta1::ListProductsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Vision::V1p3beta1::ListProductsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_products(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_products` via keyword arguments. Note that at - # least one keyword argument is 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 OR ProductSet from which Products should be listed. - # - # Format: - # `projects/PROJECT_ID/locations/LOC_ID` - # @param page_size [::Integer] - # The maximum number of items to return. Default 10, maximum 100. - # @param page_token [::String] - # The next_page_token returned from a previous List request, if any. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Vision::V1p3beta1::Product>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::Vision::V1p3beta1::Product>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/vision/v1p3beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Vision::V1p3beta1::ProductSearch::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Vision::V1p3beta1::ListProductsRequest.new - # - # # Call the list_products method. - # result = client.list_products 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::Vision::V1p3beta1::Product. - # p item - # end - # - def list_products request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Vision::V1p3beta1::ListProductsRequest - - # Converts hash 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_products.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::Vision::V1p3beta1::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_products.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_products.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @product_search_stub.call_rpc :list_products, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @product_search_stub, :list_products, 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 - - ## - # Gets information associated with a Product. - # - # Possible errors: - # - # * Returns NOT_FOUND if the Product does not exist. - # - # @overload get_product(request, options = nil) - # Pass arguments to `get_product` via a request object, either of type - # {::Google::Cloud::Vision::V1p3beta1::GetProductRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Vision::V1p3beta1::GetProductRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_product(name: nil) - # Pass arguments to `get_product` via keyword arguments. Note that at - # least one keyword argument is 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. Resource name of the Product to get. - # - # Format is: - # `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID` - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Vision::V1p3beta1::Product] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Vision::V1p3beta1::Product] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/vision/v1p3beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Vision::V1p3beta1::ProductSearch::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Vision::V1p3beta1::GetProductRequest.new - # - # # Call the get_product method. - # result = client.get_product request - # - # # The returned object is of type Google::Cloud::Vision::V1p3beta1::Product. - # p result - # - def get_product request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Vision::V1p3beta1::GetProductRequest - - # Converts hash 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_product.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::Vision::V1p3beta1::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_product.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_product.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @product_search_stub.call_rpc :get_product, 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 - - ## - # Makes changes to a Product resource. - # Only display_name, description and labels can be updated right now. - # - # If labels are updated, the change will not be reflected in queries until - # the next index time. - # - # Possible errors: - # - # * Returns NOT_FOUND if the Product does not exist. - # * Returns INVALID_ARGUMENT if display_name is present in update_mask but is - # missing from the request or longer than 4096 characters. - # * Returns INVALID_ARGUMENT if description is present in update_mask but is - # longer than 4096 characters. - # * Returns INVALID_ARGUMENT if product_category is present in update_mask. - # - # @overload update_product(request, options = nil) - # Pass arguments to `update_product` via a request object, either of type - # {::Google::Cloud::Vision::V1p3beta1::UpdateProductRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Vision::V1p3beta1::UpdateProductRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_product(product: nil, update_mask: nil) - # Pass arguments to `update_product` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param product [::Google::Cloud::Vision::V1p3beta1::Product, ::Hash] - # Required. The Product resource which replaces the one on the server. - # product.name is immutable. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # The {::Google::Protobuf::FieldMask FieldMask} that specifies which fields - # to update. - # If update_mask isn't specified, all mutable fields are to be updated. - # Valid mask paths include `product_labels`, `display_name`, and - # `description`. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Vision::V1p3beta1::Product] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Vision::V1p3beta1::Product] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/vision/v1p3beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Vision::V1p3beta1::ProductSearch::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Vision::V1p3beta1::UpdateProductRequest.new - # - # # Call the update_product method. - # result = client.update_product request - # - # # The returned object is of type Google::Cloud::Vision::V1p3beta1::Product. - # p result - # - def update_product request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Vision::V1p3beta1::UpdateProductRequest - - # Converts hash 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_product.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::Vision::V1p3beta1::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.product&.name - header_params["product.name"] = request.product.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_product.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_product.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @product_search_stub.call_rpc :update_product, 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 a product and its reference images. - # - # Metadata of the product and all its images will be deleted right away, but - # search queries against ProductSets containing the product may still work - # until all related caches are refreshed. - # - # Possible errors: - # - # * Returns NOT_FOUND if the product does not exist. - # - # @overload delete_product(request, options = nil) - # Pass arguments to `delete_product` via a request object, either of type - # {::Google::Cloud::Vision::V1p3beta1::DeleteProductRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Vision::V1p3beta1::DeleteProductRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_product(name: nil) - # Pass arguments to `delete_product` via keyword arguments. Note that at - # least one keyword argument is 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. Resource name of product to delete. - # - # Format is: - # `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID` - # - # @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/vision/v1p3beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Vision::V1p3beta1::ProductSearch::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Vision::V1p3beta1::DeleteProductRequest.new - # - # # Call the delete_product method. - # result = client.delete_product request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_product request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Vision::V1p3beta1::DeleteProductRequest - - # Converts hash 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_product.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::Vision::V1p3beta1::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_product.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_product.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @product_search_stub.call_rpc :delete_product, 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 and returns a new ReferenceImage resource. - # - # The `bounding_poly` field is optional. If `bounding_poly` is not specified, - # the system will try to detect regions of interest in the image that are - # compatible with the product_category on the parent product. If it is - # specified, detection is ALWAYS skipped. The system converts polygons into - # non-rotated rectangles. - # - # Note that the pipeline will resize the image if the image resolution is too - # large to process (above 50MP). - # - # Possible errors: - # - # * Returns INVALID_ARGUMENT if the image_uri is missing or longer than 4096 - # characters. - # * Returns INVALID_ARGUMENT if the product does not exist. - # * Returns INVALID_ARGUMENT if bounding_poly is not provided, and nothing - # compatible with the parent product's product_category is detected. - # * Returns INVALID_ARGUMENT if bounding_poly contains more than 10 polygons. - # - # @overload create_reference_image(request, options = nil) - # Pass arguments to `create_reference_image` via a request object, either of type - # {::Google::Cloud::Vision::V1p3beta1::CreateReferenceImageRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Vision::V1p3beta1::CreateReferenceImageRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_reference_image(parent: nil, reference_image: nil, reference_image_id: nil) - # Pass arguments to `create_reference_image` via keyword arguments. Note that at - # least one keyword argument is 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. Resource name of the product in which to create the reference image. - # - # Format is - # `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`. - # @param reference_image [::Google::Cloud::Vision::V1p3beta1::ReferenceImage, ::Hash] - # Required. The reference image to create. - # If an image ID is specified, it is ignored. - # @param reference_image_id [::String] - # A user-supplied resource id for the ReferenceImage to be added. If set, - # the server will attempt to use this value as the resource id. If it is - # already in use, an error is returned with code ALREADY_EXISTS. Must be at - # most 128 characters long. It cannot contain the character `/`. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Vision::V1p3beta1::ReferenceImage] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Vision::V1p3beta1::ReferenceImage] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/vision/v1p3beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Vision::V1p3beta1::ProductSearch::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Vision::V1p3beta1::CreateReferenceImageRequest.new - # - # # Call the create_reference_image method. - # result = client.create_reference_image request - # - # # The returned object is of type Google::Cloud::Vision::V1p3beta1::ReferenceImage. - # p result - # - def create_reference_image request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Vision::V1p3beta1::CreateReferenceImageRequest - - # Converts hash 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_reference_image.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::Vision::V1p3beta1::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_reference_image.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_reference_image.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @product_search_stub.call_rpc :create_reference_image, 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 a reference image. - # - # The image metadata will be deleted right away, but search queries - # against ProductSets containing the image may still work until all related - # caches are refreshed. - # - # The actual image files are not deleted from Google Cloud Storage. - # - # Possible errors: - # - # * Returns NOT_FOUND if the reference image does not exist. - # - # @overload delete_reference_image(request, options = nil) - # Pass arguments to `delete_reference_image` via a request object, either of type - # {::Google::Cloud::Vision::V1p3beta1::DeleteReferenceImageRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Vision::V1p3beta1::DeleteReferenceImageRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_reference_image(name: nil) - # Pass arguments to `delete_reference_image` via keyword arguments. Note that at - # least one keyword argument is 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 reference image to delete. - # - # Format is: - # - # `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID` - # - # @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/vision/v1p3beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Vision::V1p3beta1::ProductSearch::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Vision::V1p3beta1::DeleteReferenceImageRequest.new - # - # # Call the delete_reference_image method. - # result = client.delete_reference_image request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_reference_image request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Vision::V1p3beta1::DeleteReferenceImageRequest - - # Converts hash 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_reference_image.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::Vision::V1p3beta1::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_reference_image.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_reference_image.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @product_search_stub.call_rpc :delete_reference_image, 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 reference images. - # - # Possible errors: - # - # * Returns NOT_FOUND if the parent product does not exist. - # * Returns INVALID_ARGUMENT if the page_size is greater than 100, or less - # than 1. - # - # @overload list_reference_images(request, options = nil) - # Pass arguments to `list_reference_images` via a request object, either of type - # {::Google::Cloud::Vision::V1p3beta1::ListReferenceImagesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Vision::V1p3beta1::ListReferenceImagesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_reference_images(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_reference_images` via keyword arguments. Note that at - # least one keyword argument is 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. Resource name of the product containing the reference images. - # - # Format is - # `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`. - # @param page_size [::Integer] - # The maximum number of items to return. Default 10, maximum 100. - # @param page_token [::String] - # A token identifying a page of results to be returned. This is the value - # of `nextPageToken` returned in a previous reference image list request. - # - # Defaults to the first page if not specified. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Vision::V1p3beta1::ReferenceImage>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::Vision::V1p3beta1::ReferenceImage>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/vision/v1p3beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Vision::V1p3beta1::ProductSearch::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Vision::V1p3beta1::ListReferenceImagesRequest.new - # - # # Call the list_reference_images method. - # result = client.list_reference_images 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::Vision::V1p3beta1::ReferenceImage. - # p item - # end - # - def list_reference_images request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Vision::V1p3beta1::ListReferenceImagesRequest - - # Converts hash 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_reference_images.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::Vision::V1p3beta1::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_reference_images.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_reference_images.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @product_search_stub.call_rpc :list_reference_images, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @product_search_stub, :list_reference_images, 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 - - ## - # Gets information associated with a ReferenceImage. - # - # Possible errors: - # - # * Returns NOT_FOUND if the specified image does not exist. - # - # @overload get_reference_image(request, options = nil) - # Pass arguments to `get_reference_image` via a request object, either of type - # {::Google::Cloud::Vision::V1p3beta1::GetReferenceImageRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Vision::V1p3beta1::GetReferenceImageRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_reference_image(name: nil) - # Pass arguments to `get_reference_image` via keyword arguments. Note that at - # least one keyword argument is 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 ReferenceImage to get. - # - # Format is: - # - # `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID`. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Vision::V1p3beta1::ReferenceImage] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Vision::V1p3beta1::ReferenceImage] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/vision/v1p3beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Vision::V1p3beta1::ProductSearch::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Vision::V1p3beta1::GetReferenceImageRequest.new - # - # # Call the get_reference_image method. - # result = client.get_reference_image request - # - # # The returned object is of type Google::Cloud::Vision::V1p3beta1::ReferenceImage. - # p result - # - def get_reference_image request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Vision::V1p3beta1::GetReferenceImageRequest - - # Converts hash 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_reference_image.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::Vision::V1p3beta1::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_reference_image.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_reference_image.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @product_search_stub.call_rpc :get_reference_image, 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 - - ## - # Adds a Product to the specified ProductSet. If the Product is already - # present, no change is made. - # - # One Product can be added to at most 100 ProductSets. - # - # Possible errors: - # - # * Returns NOT_FOUND if the Product or the ProductSet doesn't exist. - # - # @overload add_product_to_product_set(request, options = nil) - # Pass arguments to `add_product_to_product_set` via a request object, either of type - # {::Google::Cloud::Vision::V1p3beta1::AddProductToProductSetRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Vision::V1p3beta1::AddProductToProductSetRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload add_product_to_product_set(name: nil, product: nil) - # Pass arguments to `add_product_to_product_set` via keyword arguments. Note that at - # least one keyword argument is 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 for the ProductSet to modify. - # - # Format is: - # `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID` - # @param product [::String] - # Required. The resource name for the Product to be added to this ProductSet. - # - # Format is: - # `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID` - # - # @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/vision/v1p3beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Vision::V1p3beta1::ProductSearch::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Vision::V1p3beta1::AddProductToProductSetRequest.new - # - # # Call the add_product_to_product_set method. - # result = client.add_product_to_product_set request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def add_product_to_product_set request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Vision::V1p3beta1::AddProductToProductSetRequest - - # Converts hash 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.add_product_to_product_set.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::Vision::V1p3beta1::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.add_product_to_product_set.timeout, - metadata: metadata, - retry_policy: @config.rpcs.add_product_to_product_set.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @product_search_stub.call_rpc :add_product_to_product_set, 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 - - ## - # Removes a Product from the specified ProductSet. - # - # Possible errors: - # - # * Returns NOT_FOUND If the Product is not found under the ProductSet. - # - # @overload remove_product_from_product_set(request, options = nil) - # Pass arguments to `remove_product_from_product_set` via a request object, either of type - # {::Google::Cloud::Vision::V1p3beta1::RemoveProductFromProductSetRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Vision::V1p3beta1::RemoveProductFromProductSetRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload remove_product_from_product_set(name: nil, product: nil) - # Pass arguments to `remove_product_from_product_set` via keyword arguments. Note that at - # least one keyword argument is 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 for the ProductSet to modify. - # - # Format is: - # `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID` - # @param product [::String] - # Required. The resource name for the Product to be removed from this ProductSet. - # - # Format is: - # `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID` - # - # @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/vision/v1p3beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Vision::V1p3beta1::ProductSearch::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Vision::V1p3beta1::RemoveProductFromProductSetRequest.new - # - # # Call the remove_product_from_product_set method. - # result = client.remove_product_from_product_set request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def remove_product_from_product_set request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Vision::V1p3beta1::RemoveProductFromProductSetRequest - - # Converts hash 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.remove_product_from_product_set.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::Vision::V1p3beta1::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.remove_product_from_product_set.timeout, - metadata: metadata, - retry_policy: @config.rpcs.remove_product_from_product_set.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @product_search_stub.call_rpc :remove_product_from_product_set, 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 the Products in a ProductSet, in an unspecified order. If the - # ProductSet does not exist, the products field of the response will be - # empty. - # - # Possible errors: - # - # * Returns INVALID_ARGUMENT if page_size is greater than 100 or less than 1. - # - # @overload list_products_in_product_set(request, options = nil) - # Pass arguments to `list_products_in_product_set` via a request object, either of type - # {::Google::Cloud::Vision::V1p3beta1::ListProductsInProductSetRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Vision::V1p3beta1::ListProductsInProductSetRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_products_in_product_set(name: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_products_in_product_set` via keyword arguments. Note that at - # least one keyword argument is 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 ProductSet resource for which to retrieve Products. - # - # Format is: - # `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID` - # @param page_size [::Integer] - # The maximum number of items to return. Default 10, maximum 100. - # @param page_token [::String] - # The next_page_token returned from a previous List request, if any. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Vision::V1p3beta1::Product>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::Vision::V1p3beta1::Product>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/vision/v1p3beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Vision::V1p3beta1::ProductSearch::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Vision::V1p3beta1::ListProductsInProductSetRequest.new - # - # # Call the list_products_in_product_set method. - # result = client.list_products_in_product_set 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::Vision::V1p3beta1::Product. - # p item - # end - # - def list_products_in_product_set request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Vision::V1p3beta1::ListProductsInProductSetRequest - - # Converts hash 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_products_in_product_set.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::Vision::V1p3beta1::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_products_in_product_set.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_products_in_product_set.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @product_search_stub.call_rpc :list_products_in_product_set, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @product_search_stub, :list_products_in_product_set, 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 - - ## - # Asynchronous API that imports a list of reference images to specified - # product sets based on a list of image information. - # - # The {::Google::Longrunning::Operation google.longrunning.Operation} API can be - # used to keep track of the progress and results of the request. - # `Operation.metadata` contains `BatchOperationMetadata`. (progress) - # `Operation.response` contains `ImportProductSetsResponse`. (results) - # - # The input source of this method is a csv file on Google Cloud Storage. - # For the format of the csv file please see - # {::Google::Cloud::Vision::V1p3beta1::ImportProductSetsGcsSource#csv_file_uri ImportProductSetsGcsSource.csv_file_uri}. - # - # @overload import_product_sets(request, options = nil) - # Pass arguments to `import_product_sets` via a request object, either of type - # {::Google::Cloud::Vision::V1p3beta1::ImportProductSetsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Vision::V1p3beta1::ImportProductSetsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_product_sets(parent: nil, input_config: nil) - # Pass arguments to `import_product_sets` via keyword arguments. Note that at - # least one keyword argument is 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 in which the ProductSets should be imported. - # - # Format is `projects/PROJECT_ID/locations/LOC_ID`. - # @param input_config [::Google::Cloud::Vision::V1p3beta1::ImportProductSetsInputConfig, ::Hash] - # Required. The input content for the list of requests. - # - # @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/vision/v1p3beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Vision::V1p3beta1::ProductSearch::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Vision::V1p3beta1::ImportProductSetsRequest.new - # - # # Call the import_product_sets method. - # result = client.import_product_sets 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 import_product_sets request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Vision::V1p3beta1::ImportProductSetsRequest - - # Converts hash 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_product_sets.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::Vision::V1p3beta1::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_product_sets.timeout, - metadata: metadata, - retry_policy: @config.rpcs.import_product_sets.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @product_search_stub.call_rpc :import_product_sets, 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 ProductSearch API. - # - # This class represents the configuration for ProductSearch, - # 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::Vision::V1p3beta1::ProductSearch::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_product_set to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Vision::V1p3beta1::ProductSearch::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.create_product_set.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Vision::V1p3beta1::ProductSearch::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.create_product_set.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::Vision::V1p3beta1::ProductSearch::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 = "vision.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 ProductSearch 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_product_set` - # @return [::Gapic::Config::Method] - # - attr_reader :create_product_set - ## - # RPC-specific configuration for `list_product_sets` - # @return [::Gapic::Config::Method] - # - attr_reader :list_product_sets - ## - # RPC-specific configuration for `get_product_set` - # @return [::Gapic::Config::Method] - # - attr_reader :get_product_set - ## - # RPC-specific configuration for `update_product_set` - # @return [::Gapic::Config::Method] - # - attr_reader :update_product_set - ## - # RPC-specific configuration for `delete_product_set` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_product_set - ## - # RPC-specific configuration for `create_product` - # @return [::Gapic::Config::Method] - # - attr_reader :create_product - ## - # RPC-specific configuration for `list_products` - # @return [::Gapic::Config::Method] - # - attr_reader :list_products - ## - # RPC-specific configuration for `get_product` - # @return [::Gapic::Config::Method] - # - attr_reader :get_product - ## - # RPC-specific configuration for `update_product` - # @return [::Gapic::Config::Method] - # - attr_reader :update_product - ## - # RPC-specific configuration for `delete_product` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_product - ## - # RPC-specific configuration for `create_reference_image` - # @return [::Gapic::Config::Method] - # - attr_reader :create_reference_image - ## - # RPC-specific configuration for `delete_reference_image` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_reference_image - ## - # RPC-specific configuration for `list_reference_images` - # @return [::Gapic::Config::Method] - # - attr_reader :list_reference_images - ## - # RPC-specific configuration for `get_reference_image` - # @return [::Gapic::Config::Method] - # - attr_reader :get_reference_image - ## - # RPC-specific configuration for `add_product_to_product_set` - # @return [::Gapic::Config::Method] - # - attr_reader :add_product_to_product_set - ## - # RPC-specific configuration for `remove_product_from_product_set` - # @return [::Gapic::Config::Method] - # - attr_reader :remove_product_from_product_set - ## - # RPC-specific configuration for `list_products_in_product_set` - # @return [::Gapic::Config::Method] - # - attr_reader :list_products_in_product_set - ## - # RPC-specific configuration for `import_product_sets` - # @return [::Gapic::Config::Method] - # - attr_reader :import_product_sets - - # @private - def initialize parent_rpcs = nil - create_product_set_config = parent_rpcs.create_product_set if parent_rpcs.respond_to? :create_product_set - @create_product_set = ::Gapic::Config::Method.new create_product_set_config - list_product_sets_config = parent_rpcs.list_product_sets if parent_rpcs.respond_to? :list_product_sets - @list_product_sets = ::Gapic::Config::Method.new list_product_sets_config - get_product_set_config = parent_rpcs.get_product_set if parent_rpcs.respond_to? :get_product_set - @get_product_set = ::Gapic::Config::Method.new get_product_set_config - update_product_set_config = parent_rpcs.update_product_set if parent_rpcs.respond_to? :update_product_set - @update_product_set = ::Gapic::Config::Method.new update_product_set_config - delete_product_set_config = parent_rpcs.delete_product_set if parent_rpcs.respond_to? :delete_product_set - @delete_product_set = ::Gapic::Config::Method.new delete_product_set_config - create_product_config = parent_rpcs.create_product if parent_rpcs.respond_to? :create_product - @create_product = ::Gapic::Config::Method.new create_product_config - list_products_config = parent_rpcs.list_products if parent_rpcs.respond_to? :list_products - @list_products = ::Gapic::Config::Method.new list_products_config - get_product_config = parent_rpcs.get_product if parent_rpcs.respond_to? :get_product - @get_product = ::Gapic::Config::Method.new get_product_config - update_product_config = parent_rpcs.update_product if parent_rpcs.respond_to? :update_product - @update_product = ::Gapic::Config::Method.new update_product_config - delete_product_config = parent_rpcs.delete_product if parent_rpcs.respond_to? :delete_product - @delete_product = ::Gapic::Config::Method.new delete_product_config - create_reference_image_config = parent_rpcs.create_reference_image if parent_rpcs.respond_to? :create_reference_image - @create_reference_image = ::Gapic::Config::Method.new create_reference_image_config - delete_reference_image_config = parent_rpcs.delete_reference_image if parent_rpcs.respond_to? :delete_reference_image - @delete_reference_image = ::Gapic::Config::Method.new delete_reference_image_config - list_reference_images_config = parent_rpcs.list_reference_images if parent_rpcs.respond_to? :list_reference_images - @list_reference_images = ::Gapic::Config::Method.new list_reference_images_config - get_reference_image_config = parent_rpcs.get_reference_image if parent_rpcs.respond_to? :get_reference_image - @get_reference_image = ::Gapic::Config::Method.new get_reference_image_config - add_product_to_product_set_config = parent_rpcs.add_product_to_product_set if parent_rpcs.respond_to? :add_product_to_product_set - @add_product_to_product_set = ::Gapic::Config::Method.new add_product_to_product_set_config - remove_product_from_product_set_config = parent_rpcs.remove_product_from_product_set if parent_rpcs.respond_to? :remove_product_from_product_set - @remove_product_from_product_set = ::Gapic::Config::Method.new remove_product_from_product_set_config - list_products_in_product_set_config = parent_rpcs.list_products_in_product_set if parent_rpcs.respond_to? :list_products_in_product_set - @list_products_in_product_set = ::Gapic::Config::Method.new list_products_in_product_set_config - import_product_sets_config = parent_rpcs.import_product_sets if parent_rpcs.respond_to? :import_product_sets - @import_product_sets = ::Gapic::Config::Method.new import_product_sets_config - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-vision-v1p3beta1/lib/google/cloud/vision/v1p3beta1/product_search/credentials.rb b/owl-bot-staging/google-cloud-vision-v1p3beta1/lib/google/cloud/vision/v1p3beta1/product_search/credentials.rb deleted file mode 100644 index 53d6f69d33e9..000000000000 --- a/owl-bot-staging/google-cloud-vision-v1p3beta1/lib/google/cloud/vision/v1p3beta1/product_search/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 Vision - module V1p3beta1 - module ProductSearch - # Credentials for the ProductSearch API. - class Credentials < ::Google::Auth::Credentials - self.scope = [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/cloud-vision" - ] - self.env_vars = [ - "VISION_CREDENTIALS", - "VISION_KEYFILE", - "GOOGLE_CLOUD_CREDENTIALS", - "GOOGLE_CLOUD_KEYFILE", - "GCLOUD_KEYFILE", - "VISION_CREDENTIALS_JSON", - "VISION_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-vision-v1p3beta1/lib/google/cloud/vision/v1p3beta1/product_search/operations.rb b/owl-bot-staging/google-cloud-vision-v1p3beta1/lib/google/cloud/vision/v1p3beta1/product_search/operations.rb deleted file mode 100644 index 1c778ed43a8f..000000000000 --- a/owl-bot-staging/google-cloud-vision-v1p3beta1/lib/google/cloud/vision/v1p3beta1/product_search/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 Vision - module V1p3beta1 - module ProductSearch - # Service that implements Longrunning Operations API. - class Operations - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "vision.$UNIVERSE_DOMAIN$" - - # @private - attr_reader :operations_stub - - ## - # Configuration for the ProductSearch 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 ProductSearch 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::Vision::V1p3beta1::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::Vision::V1p3beta1::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::Vision::V1p3beta1::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::Vision::V1p3beta1::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::Vision::V1p3beta1::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 = "vision.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-vision-v1p3beta1/lib/google/cloud/vision/v1p3beta1/product_search/paths.rb b/owl-bot-staging/google-cloud-vision-v1p3beta1/lib/google/cloud/vision/v1p3beta1/product_search/paths.rb deleted file mode 100644 index ad78880db1b4..000000000000 --- a/owl-bot-staging/google-cloud-vision-v1p3beta1/lib/google/cloud/vision/v1p3beta1/product_search/paths.rb +++ /dev/null @@ -1,109 +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 Vision - module V1p3beta1 - module ProductSearch - # Path helper methods for the ProductSearch 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 Product resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/products/{product}` - # - # @param project [String] - # @param location [String] - # @param product [String] - # - # @return [::String] - def product_path project:, location:, product: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/products/#{product}" - end - - ## - # Create a fully-qualified ProductSet resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/productSets/{product_set}` - # - # @param project [String] - # @param location [String] - # @param product_set [String] - # - # @return [::String] - def product_set_path project:, location:, product_set: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/productSets/#{product_set}" - end - - ## - # Create a fully-qualified ReferenceImage resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/products/{product}/referenceImages/{reference_image}` - # - # @param project [String] - # @param location [String] - # @param product [String] - # @param reference_image [String] - # - # @return [::String] - def reference_image_path project:, location:, product:, reference_image: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "product cannot contain /" if product.to_s.include? "/" - - "projects/#{project}/locations/#{location}/products/#{product}/referenceImages/#{reference_image}" - end - - extend self - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-vision-v1p3beta1/lib/google/cloud/vision/v1p3beta1/product_search/rest.rb b/owl-bot-staging/google-cloud-vision-v1p3beta1/lib/google/cloud/vision/v1p3beta1/product_search/rest.rb deleted file mode 100644 index dbb9b858e8fe..000000000000 --- a/owl-bot-staging/google-cloud-vision-v1p3beta1/lib/google/cloud/vision/v1p3beta1/product_search/rest.rb +++ /dev/null @@ -1,66 +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/vision/v1p3beta1/version" - -require "google/cloud/vision/v1p3beta1/product_search/credentials" -require "google/cloud/vision/v1p3beta1/product_search/paths" -require "google/cloud/vision/v1p3beta1/product_search/rest/operations" -require "google/cloud/vision/v1p3beta1/product_search/rest/client" - -module Google - module Cloud - module Vision - module V1p3beta1 - ## - # Manages Products and ProductSets of reference images for use in product - # search. It uses the following resource model: - # - # - The API has a collection of {::Google::Cloud::Vision::V1p3beta1::ProductSet ProductSet} resources, named - # `projects/*/locations/*/productSets/*`, which acts as a way to put different - # products into groups to limit identification. - # - # In parallel, - # - # - The API has a collection of {::Google::Cloud::Vision::V1p3beta1::Product Product} resources, named - # `projects/*/locations/*/products/*` - # - # - Each {::Google::Cloud::Vision::V1p3beta1::Product Product} has a collection of {::Google::Cloud::Vision::V1p3beta1::ReferenceImage ReferenceImage} resources, named - # `projects/*/locations/*/products/*/referenceImages/*` - # - # To load this service and instantiate a REST client: - # - # require "google/cloud/vision/v1p3beta1/product_search/rest" - # client = ::Google::Cloud::Vision::V1p3beta1::ProductSearch::Rest::Client.new - # - module ProductSearch - # Client for the REST transport - module Rest - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "rest", "helpers.rb" -require "google/cloud/vision/v1p3beta1/product_search/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-vision-v1p3beta1/lib/google/cloud/vision/v1p3beta1/product_search/rest/client.rb b/owl-bot-staging/google-cloud-vision-v1p3beta1/lib/google/cloud/vision/v1p3beta1/product_search/rest/client.rb deleted file mode 100644 index 28f85c45cbd6..000000000000 --- a/owl-bot-staging/google-cloud-vision-v1p3beta1/lib/google/cloud/vision/v1p3beta1/product_search/rest/client.rb +++ /dev/null @@ -1,2260 +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/vision/v1p3beta1/product_search_service_pb" -require "google/cloud/vision/v1p3beta1/product_search/rest/service_stub" - -module Google - module Cloud - module Vision - module V1p3beta1 - module ProductSearch - module Rest - ## - # REST client for the ProductSearch service. - # - # Manages Products and ProductSets of reference images for use in product - # search. It uses the following resource model: - # - # - The API has a collection of {::Google::Cloud::Vision::V1p3beta1::ProductSet ProductSet} resources, named - # `projects/*/locations/*/productSets/*`, which acts as a way to put different - # products into groups to limit identification. - # - # In parallel, - # - # - The API has a collection of {::Google::Cloud::Vision::V1p3beta1::Product Product} resources, named - # `projects/*/locations/*/products/*` - # - # - Each {::Google::Cloud::Vision::V1p3beta1::Product Product} has a collection of {::Google::Cloud::Vision::V1p3beta1::ReferenceImage ReferenceImage} resources, named - # `projects/*/locations/*/products/*/referenceImages/*` - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "vision.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :product_search_stub - - ## - # Configure the ProductSearch Client class. - # - # See {::Google::Cloud::Vision::V1p3beta1::ProductSearch::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all ProductSearch clients - # ::Google::Cloud::Vision::V1p3beta1::ProductSearch::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", "Vision", "V1p3beta1"] - 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_product_set.timeout = 600.0 - default_config.rpcs.create_product_set.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [] - } - - default_config.rpcs.list_product_sets.timeout = 600.0 - default_config.rpcs.list_product_sets.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.get_product_set.timeout = 600.0 - default_config.rpcs.get_product_set.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.update_product_set.timeout = 600.0 - default_config.rpcs.update_product_set.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [] - } - - default_config.rpcs.delete_product_set.timeout = 600.0 - default_config.rpcs.delete_product_set.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.create_product.timeout = 600.0 - default_config.rpcs.create_product.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [] - } - - default_config.rpcs.list_products.timeout = 600.0 - default_config.rpcs.list_products.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.get_product.timeout = 600.0 - default_config.rpcs.get_product.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.update_product.timeout = 600.0 - default_config.rpcs.update_product.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [] - } - - default_config.rpcs.delete_product.timeout = 600.0 - default_config.rpcs.delete_product.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.create_reference_image.timeout = 600.0 - default_config.rpcs.create_reference_image.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [] - } - - default_config.rpcs.delete_reference_image.timeout = 600.0 - default_config.rpcs.delete_reference_image.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.list_reference_images.timeout = 600.0 - default_config.rpcs.list_reference_images.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.get_reference_image.timeout = 600.0 - default_config.rpcs.get_reference_image.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.add_product_to_product_set.timeout = 600.0 - default_config.rpcs.add_product_to_product_set.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [] - } - - default_config.rpcs.remove_product_from_product_set.timeout = 600.0 - default_config.rpcs.remove_product_from_product_set.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [] - } - - default_config.rpcs.list_products_in_product_set.timeout = 600.0 - default_config.rpcs.list_products_in_product_set.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.import_product_sets.timeout = 600.0 - default_config.rpcs.import_product_sets.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [] - } - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the ProductSearch 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::Vision::V1p3beta1::ProductSearch::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 - @product_search_stub.universe_domain - end - - ## - # Create a new ProductSearch REST client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Vision::V1p3beta1::ProductSearch::Rest::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Vision::V1p3beta1::ProductSearch::Rest::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the ProductSearch 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::Vision::V1p3beta1::ProductSearch::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 - - @product_search_stub = ::Google::Cloud::Vision::V1p3beta1::ProductSearch::Rest::ServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials, - logger: @config.logger - ) - - @product_search_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 - end - - ## - # Get the associated client for long-running operations. - # - # @return [::Google::Cloud::Vision::V1p3beta1::ProductSearch::Rest::Operations] - # - attr_reader :operations_client - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @product_search_stub.logger - end - - # Service calls - - ## - # Creates and returns a new ProductSet resource. - # - # Possible errors: - # - # * Returns INVALID_ARGUMENT if display_name is missing, or is longer than - # 4096 characters. - # - # @overload create_product_set(request, options = nil) - # Pass arguments to `create_product_set` via a request object, either of type - # {::Google::Cloud::Vision::V1p3beta1::CreateProductSetRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Vision::V1p3beta1::CreateProductSetRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_product_set(parent: nil, product_set: nil, product_set_id: nil) - # Pass arguments to `create_product_set` via keyword arguments. Note that at - # least one keyword argument is 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 in which the ProductSet should be created. - # - # Format is `projects/PROJECT_ID/locations/LOC_ID`. - # @param product_set [::Google::Cloud::Vision::V1p3beta1::ProductSet, ::Hash] - # Required. The ProductSet to create. - # @param product_set_id [::String] - # A user-supplied resource id for this ProductSet. If set, the server will - # attempt to use this value as the resource id. If it is already in use, an - # error is returned with code ALREADY_EXISTS. Must be at most 128 characters - # long. It cannot contain the character `/`. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Vision::V1p3beta1::ProductSet] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Vision::V1p3beta1::ProductSet] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/vision/v1p3beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Vision::V1p3beta1::ProductSearch::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Vision::V1p3beta1::CreateProductSetRequest.new - # - # # Call the create_product_set method. - # result = client.create_product_set request - # - # # The returned object is of type Google::Cloud::Vision::V1p3beta1::ProductSet. - # p result - # - def create_product_set request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Vision::V1p3beta1::CreateProductSetRequest - - # Converts hash 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_product_set.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::Vision::V1p3beta1::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_product_set.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_product_set.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @product_search_stub.create_product_set 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 ProductSets in an unspecified order. - # - # Possible errors: - # - # * Returns INVALID_ARGUMENT if page_size is greater than 100, or less - # than 1. - # - # @overload list_product_sets(request, options = nil) - # Pass arguments to `list_product_sets` via a request object, either of type - # {::Google::Cloud::Vision::V1p3beta1::ListProductSetsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Vision::V1p3beta1::ListProductSetsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_product_sets(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_product_sets` via keyword arguments. Note that at - # least one keyword argument is 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 from which ProductSets should be listed. - # - # Format is `projects/PROJECT_ID/locations/LOC_ID`. - # @param page_size [::Integer] - # The maximum number of items to return. Default 10, maximum 100. - # @param page_token [::String] - # The next_page_token returned from a previous List request, if any. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Vision::V1p3beta1::ProductSet>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Vision::V1p3beta1::ProductSet>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/vision/v1p3beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Vision::V1p3beta1::ProductSearch::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Vision::V1p3beta1::ListProductSetsRequest.new - # - # # Call the list_product_sets method. - # result = client.list_product_sets 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::Vision::V1p3beta1::ProductSet. - # p item - # end - # - def list_product_sets request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Vision::V1p3beta1::ListProductSetsRequest - - # Converts hash 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_product_sets.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::Vision::V1p3beta1::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_product_sets.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_product_sets.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @product_search_stub.list_product_sets request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @product_search_stub, :list_product_sets, "product_sets", 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 information associated with a ProductSet. - # - # Possible errors: - # - # * Returns NOT_FOUND if the ProductSet does not exist. - # - # @overload get_product_set(request, options = nil) - # Pass arguments to `get_product_set` via a request object, either of type - # {::Google::Cloud::Vision::V1p3beta1::GetProductSetRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Vision::V1p3beta1::GetProductSetRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_product_set(name: nil) - # Pass arguments to `get_product_set` via keyword arguments. Note that at - # least one keyword argument is 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. Resource name of the ProductSet to get. - # - # Format is: - # `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID` - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Vision::V1p3beta1::ProductSet] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Vision::V1p3beta1::ProductSet] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/vision/v1p3beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Vision::V1p3beta1::ProductSearch::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Vision::V1p3beta1::GetProductSetRequest.new - # - # # Call the get_product_set method. - # result = client.get_product_set request - # - # # The returned object is of type Google::Cloud::Vision::V1p3beta1::ProductSet. - # p result - # - def get_product_set request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Vision::V1p3beta1::GetProductSetRequest - - # Converts hash 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_product_set.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::Vision::V1p3beta1::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_product_set.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_product_set.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @product_search_stub.get_product_set 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 - - ## - # Makes changes to a ProductSet resource. - # Only display_name can be updated currently. - # - # Possible errors: - # - # * Returns NOT_FOUND if the ProductSet does not exist. - # * Returns INVALID_ARGUMENT if display_name is present in update_mask but - # missing from the request or longer than 4096 characters. - # - # @overload update_product_set(request, options = nil) - # Pass arguments to `update_product_set` via a request object, either of type - # {::Google::Cloud::Vision::V1p3beta1::UpdateProductSetRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Vision::V1p3beta1::UpdateProductSetRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_product_set(product_set: nil, update_mask: nil) - # Pass arguments to `update_product_set` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param product_set [::Google::Cloud::Vision::V1p3beta1::ProductSet, ::Hash] - # Required. The ProductSet resource which replaces the one on the server. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # The {::Google::Protobuf::FieldMask FieldMask} that specifies which fields to - # update. - # If update_mask isn't specified, all mutable fields are to be updated. - # Valid mask path is `display_name`. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Vision::V1p3beta1::ProductSet] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Vision::V1p3beta1::ProductSet] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/vision/v1p3beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Vision::V1p3beta1::ProductSearch::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Vision::V1p3beta1::UpdateProductSetRequest.new - # - # # Call the update_product_set method. - # result = client.update_product_set request - # - # # The returned object is of type Google::Cloud::Vision::V1p3beta1::ProductSet. - # p result - # - def update_product_set request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Vision::V1p3beta1::UpdateProductSetRequest - - # Converts hash 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_product_set.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::Vision::V1p3beta1::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_product_set.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_product_set.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @product_search_stub.update_product_set 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 a ProductSet. All Products and ReferenceImages in the - # ProductSet will be deleted. - # - # The actual image files are not deleted from Google Cloud Storage. - # - # Possible errors: - # - # * Returns NOT_FOUND if the ProductSet does not exist. - # - # @overload delete_product_set(request, options = nil) - # Pass arguments to `delete_product_set` via a request object, either of type - # {::Google::Cloud::Vision::V1p3beta1::DeleteProductSetRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Vision::V1p3beta1::DeleteProductSetRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_product_set(name: nil) - # Pass arguments to `delete_product_set` via keyword arguments. Note that at - # least one keyword argument is 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. Resource name of the ProductSet to delete. - # - # Format is: - # `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID` - # @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/vision/v1p3beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Vision::V1p3beta1::ProductSearch::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Vision::V1p3beta1::DeleteProductSetRequest.new - # - # # Call the delete_product_set method. - # result = client.delete_product_set request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_product_set request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Vision::V1p3beta1::DeleteProductSetRequest - - # Converts hash 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_product_set.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::Vision::V1p3beta1::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_product_set.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_product_set.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @product_search_stub.delete_product_set 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 and returns a new product resource. - # - # Possible errors: - # - # * Returns INVALID_ARGUMENT if display_name is missing or longer than 4096 - # characters. - # * Returns INVALID_ARGUMENT if description is longer than 4096 characters. - # * Returns INVALID_ARGUMENT if product_category is missing or invalid. - # - # @overload create_product(request, options = nil) - # Pass arguments to `create_product` via a request object, either of type - # {::Google::Cloud::Vision::V1p3beta1::CreateProductRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Vision::V1p3beta1::CreateProductRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_product(parent: nil, product: nil, product_id: nil) - # Pass arguments to `create_product` via keyword arguments. Note that at - # least one keyword argument is 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 in which the Product should be created. - # - # Format is - # `projects/PROJECT_ID/locations/LOC_ID`. - # @param product [::Google::Cloud::Vision::V1p3beta1::Product, ::Hash] - # Required. The product to create. - # @param product_id [::String] - # A user-supplied resource id for this Product. If set, the server will - # attempt to use this value as the resource id. If it is already in use, an - # error is returned with code ALREADY_EXISTS. Must be at most 128 characters - # long. It cannot contain the character `/`. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Vision::V1p3beta1::Product] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Vision::V1p3beta1::Product] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/vision/v1p3beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Vision::V1p3beta1::ProductSearch::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Vision::V1p3beta1::CreateProductRequest.new - # - # # Call the create_product method. - # result = client.create_product request - # - # # The returned object is of type Google::Cloud::Vision::V1p3beta1::Product. - # p result - # - def create_product request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Vision::V1p3beta1::CreateProductRequest - - # Converts hash 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_product.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::Vision::V1p3beta1::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_product.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_product.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @product_search_stub.create_product 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 products in an unspecified order. - # - # Possible errors: - # - # * Returns INVALID_ARGUMENT if page_size is greater than 100 or less than 1. - # - # @overload list_products(request, options = nil) - # Pass arguments to `list_products` via a request object, either of type - # {::Google::Cloud::Vision::V1p3beta1::ListProductsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Vision::V1p3beta1::ListProductsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_products(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_products` via keyword arguments. Note that at - # least one keyword argument is 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 OR ProductSet from which Products should be listed. - # - # Format: - # `projects/PROJECT_ID/locations/LOC_ID` - # @param page_size [::Integer] - # The maximum number of items to return. Default 10, maximum 100. - # @param page_token [::String] - # The next_page_token returned from a previous List request, if any. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Vision::V1p3beta1::Product>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Vision::V1p3beta1::Product>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/vision/v1p3beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Vision::V1p3beta1::ProductSearch::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Vision::V1p3beta1::ListProductsRequest.new - # - # # Call the list_products method. - # result = client.list_products 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::Vision::V1p3beta1::Product. - # p item - # end - # - def list_products request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Vision::V1p3beta1::ListProductsRequest - - # Converts hash 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_products.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::Vision::V1p3beta1::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_products.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_products.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @product_search_stub.list_products request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @product_search_stub, :list_products, "products", 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 information associated with a Product. - # - # Possible errors: - # - # * Returns NOT_FOUND if the Product does not exist. - # - # @overload get_product(request, options = nil) - # Pass arguments to `get_product` via a request object, either of type - # {::Google::Cloud::Vision::V1p3beta1::GetProductRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Vision::V1p3beta1::GetProductRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_product(name: nil) - # Pass arguments to `get_product` via keyword arguments. Note that at - # least one keyword argument is 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. Resource name of the Product to get. - # - # Format is: - # `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID` - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Vision::V1p3beta1::Product] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Vision::V1p3beta1::Product] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/vision/v1p3beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Vision::V1p3beta1::ProductSearch::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Vision::V1p3beta1::GetProductRequest.new - # - # # Call the get_product method. - # result = client.get_product request - # - # # The returned object is of type Google::Cloud::Vision::V1p3beta1::Product. - # p result - # - def get_product request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Vision::V1p3beta1::GetProductRequest - - # Converts hash 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_product.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::Vision::V1p3beta1::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_product.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_product.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @product_search_stub.get_product 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 - - ## - # Makes changes to a Product resource. - # Only display_name, description and labels can be updated right now. - # - # If labels are updated, the change will not be reflected in queries until - # the next index time. - # - # Possible errors: - # - # * Returns NOT_FOUND if the Product does not exist. - # * Returns INVALID_ARGUMENT if display_name is present in update_mask but is - # missing from the request or longer than 4096 characters. - # * Returns INVALID_ARGUMENT if description is present in update_mask but is - # longer than 4096 characters. - # * Returns INVALID_ARGUMENT if product_category is present in update_mask. - # - # @overload update_product(request, options = nil) - # Pass arguments to `update_product` via a request object, either of type - # {::Google::Cloud::Vision::V1p3beta1::UpdateProductRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Vision::V1p3beta1::UpdateProductRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_product(product: nil, update_mask: nil) - # Pass arguments to `update_product` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param product [::Google::Cloud::Vision::V1p3beta1::Product, ::Hash] - # Required. The Product resource which replaces the one on the server. - # product.name is immutable. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # The {::Google::Protobuf::FieldMask FieldMask} that specifies which fields - # to update. - # If update_mask isn't specified, all mutable fields are to be updated. - # Valid mask paths include `product_labels`, `display_name`, and - # `description`. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Vision::V1p3beta1::Product] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Vision::V1p3beta1::Product] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/vision/v1p3beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Vision::V1p3beta1::ProductSearch::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Vision::V1p3beta1::UpdateProductRequest.new - # - # # Call the update_product method. - # result = client.update_product request - # - # # The returned object is of type Google::Cloud::Vision::V1p3beta1::Product. - # p result - # - def update_product request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Vision::V1p3beta1::UpdateProductRequest - - # Converts hash 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_product.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::Vision::V1p3beta1::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_product.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_product.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @product_search_stub.update_product 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 a product and its reference images. - # - # Metadata of the product and all its images will be deleted right away, but - # search queries against ProductSets containing the product may still work - # until all related caches are refreshed. - # - # Possible errors: - # - # * Returns NOT_FOUND if the product does not exist. - # - # @overload delete_product(request, options = nil) - # Pass arguments to `delete_product` via a request object, either of type - # {::Google::Cloud::Vision::V1p3beta1::DeleteProductRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Vision::V1p3beta1::DeleteProductRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_product(name: nil) - # Pass arguments to `delete_product` via keyword arguments. Note that at - # least one keyword argument is 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. Resource name of product to delete. - # - # Format is: - # `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID` - # @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/vision/v1p3beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Vision::V1p3beta1::ProductSearch::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Vision::V1p3beta1::DeleteProductRequest.new - # - # # Call the delete_product method. - # result = client.delete_product request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_product request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Vision::V1p3beta1::DeleteProductRequest - - # Converts hash 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_product.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::Vision::V1p3beta1::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_product.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_product.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @product_search_stub.delete_product 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 and returns a new ReferenceImage resource. - # - # The `bounding_poly` field is optional. If `bounding_poly` is not specified, - # the system will try to detect regions of interest in the image that are - # compatible with the product_category on the parent product. If it is - # specified, detection is ALWAYS skipped. The system converts polygons into - # non-rotated rectangles. - # - # Note that the pipeline will resize the image if the image resolution is too - # large to process (above 50MP). - # - # Possible errors: - # - # * Returns INVALID_ARGUMENT if the image_uri is missing or longer than 4096 - # characters. - # * Returns INVALID_ARGUMENT if the product does not exist. - # * Returns INVALID_ARGUMENT if bounding_poly is not provided, and nothing - # compatible with the parent product's product_category is detected. - # * Returns INVALID_ARGUMENT if bounding_poly contains more than 10 polygons. - # - # @overload create_reference_image(request, options = nil) - # Pass arguments to `create_reference_image` via a request object, either of type - # {::Google::Cloud::Vision::V1p3beta1::CreateReferenceImageRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Vision::V1p3beta1::CreateReferenceImageRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_reference_image(parent: nil, reference_image: nil, reference_image_id: nil) - # Pass arguments to `create_reference_image` via keyword arguments. Note that at - # least one keyword argument is 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. Resource name of the product in which to create the reference image. - # - # Format is - # `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`. - # @param reference_image [::Google::Cloud::Vision::V1p3beta1::ReferenceImage, ::Hash] - # Required. The reference image to create. - # If an image ID is specified, it is ignored. - # @param reference_image_id [::String] - # A user-supplied resource id for the ReferenceImage to be added. If set, - # the server will attempt to use this value as the resource id. If it is - # already in use, an error is returned with code ALREADY_EXISTS. Must be at - # most 128 characters long. It cannot contain the character `/`. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Vision::V1p3beta1::ReferenceImage] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Vision::V1p3beta1::ReferenceImage] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/vision/v1p3beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Vision::V1p3beta1::ProductSearch::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Vision::V1p3beta1::CreateReferenceImageRequest.new - # - # # Call the create_reference_image method. - # result = client.create_reference_image request - # - # # The returned object is of type Google::Cloud::Vision::V1p3beta1::ReferenceImage. - # p result - # - def create_reference_image request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Vision::V1p3beta1::CreateReferenceImageRequest - - # Converts hash 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_reference_image.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::Vision::V1p3beta1::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_reference_image.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_reference_image.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @product_search_stub.create_reference_image 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 a reference image. - # - # The image metadata will be deleted right away, but search queries - # against ProductSets containing the image may still work until all related - # caches are refreshed. - # - # The actual image files are not deleted from Google Cloud Storage. - # - # Possible errors: - # - # * Returns NOT_FOUND if the reference image does not exist. - # - # @overload delete_reference_image(request, options = nil) - # Pass arguments to `delete_reference_image` via a request object, either of type - # {::Google::Cloud::Vision::V1p3beta1::DeleteReferenceImageRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Vision::V1p3beta1::DeleteReferenceImageRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_reference_image(name: nil) - # Pass arguments to `delete_reference_image` via keyword arguments. Note that at - # least one keyword argument is 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 reference image to delete. - # - # Format is: - # - # `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID` - # @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/vision/v1p3beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Vision::V1p3beta1::ProductSearch::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Vision::V1p3beta1::DeleteReferenceImageRequest.new - # - # # Call the delete_reference_image method. - # result = client.delete_reference_image request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_reference_image request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Vision::V1p3beta1::DeleteReferenceImageRequest - - # Converts hash 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_reference_image.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::Vision::V1p3beta1::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_reference_image.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_reference_image.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @product_search_stub.delete_reference_image 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 reference images. - # - # Possible errors: - # - # * Returns NOT_FOUND if the parent product does not exist. - # * Returns INVALID_ARGUMENT if the page_size is greater than 100, or less - # than 1. - # - # @overload list_reference_images(request, options = nil) - # Pass arguments to `list_reference_images` via a request object, either of type - # {::Google::Cloud::Vision::V1p3beta1::ListReferenceImagesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Vision::V1p3beta1::ListReferenceImagesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_reference_images(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_reference_images` via keyword arguments. Note that at - # least one keyword argument is 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. Resource name of the product containing the reference images. - # - # Format is - # `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`. - # @param page_size [::Integer] - # The maximum number of items to return. Default 10, maximum 100. - # @param page_token [::String] - # A token identifying a page of results to be returned. This is the value - # of `nextPageToken` returned in a previous reference image list request. - # - # Defaults to the first page if not specified. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Vision::V1p3beta1::ReferenceImage>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Vision::V1p3beta1::ReferenceImage>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/vision/v1p3beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Vision::V1p3beta1::ProductSearch::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Vision::V1p3beta1::ListReferenceImagesRequest.new - # - # # Call the list_reference_images method. - # result = client.list_reference_images 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::Vision::V1p3beta1::ReferenceImage. - # p item - # end - # - def list_reference_images request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Vision::V1p3beta1::ListReferenceImagesRequest - - # Converts hash 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_reference_images.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::Vision::V1p3beta1::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_reference_images.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_reference_images.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @product_search_stub.list_reference_images request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @product_search_stub, :list_reference_images, "reference_images", 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 information associated with a ReferenceImage. - # - # Possible errors: - # - # * Returns NOT_FOUND if the specified image does not exist. - # - # @overload get_reference_image(request, options = nil) - # Pass arguments to `get_reference_image` via a request object, either of type - # {::Google::Cloud::Vision::V1p3beta1::GetReferenceImageRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Vision::V1p3beta1::GetReferenceImageRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_reference_image(name: nil) - # Pass arguments to `get_reference_image` via keyword arguments. Note that at - # least one keyword argument is 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 ReferenceImage to get. - # - # Format is: - # - # `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID`. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Vision::V1p3beta1::ReferenceImage] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Vision::V1p3beta1::ReferenceImage] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/vision/v1p3beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Vision::V1p3beta1::ProductSearch::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Vision::V1p3beta1::GetReferenceImageRequest.new - # - # # Call the get_reference_image method. - # result = client.get_reference_image request - # - # # The returned object is of type Google::Cloud::Vision::V1p3beta1::ReferenceImage. - # p result - # - def get_reference_image request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Vision::V1p3beta1::GetReferenceImageRequest - - # Converts hash 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_reference_image.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::Vision::V1p3beta1::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_reference_image.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_reference_image.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @product_search_stub.get_reference_image 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 - - ## - # Adds a Product to the specified ProductSet. If the Product is already - # present, no change is made. - # - # One Product can be added to at most 100 ProductSets. - # - # Possible errors: - # - # * Returns NOT_FOUND if the Product or the ProductSet doesn't exist. - # - # @overload add_product_to_product_set(request, options = nil) - # Pass arguments to `add_product_to_product_set` via a request object, either of type - # {::Google::Cloud::Vision::V1p3beta1::AddProductToProductSetRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Vision::V1p3beta1::AddProductToProductSetRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload add_product_to_product_set(name: nil, product: nil) - # Pass arguments to `add_product_to_product_set` via keyword arguments. Note that at - # least one keyword argument is 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 for the ProductSet to modify. - # - # Format is: - # `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID` - # @param product [::String] - # Required. The resource name for the Product to be added to this ProductSet. - # - # Format is: - # `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID` - # @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/vision/v1p3beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Vision::V1p3beta1::ProductSearch::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Vision::V1p3beta1::AddProductToProductSetRequest.new - # - # # Call the add_product_to_product_set method. - # result = client.add_product_to_product_set request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def add_product_to_product_set request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Vision::V1p3beta1::AddProductToProductSetRequest - - # Converts hash 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.add_product_to_product_set.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::Vision::V1p3beta1::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.add_product_to_product_set.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.add_product_to_product_set.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @product_search_stub.add_product_to_product_set 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 - - ## - # Removes a Product from the specified ProductSet. - # - # Possible errors: - # - # * Returns NOT_FOUND If the Product is not found under the ProductSet. - # - # @overload remove_product_from_product_set(request, options = nil) - # Pass arguments to `remove_product_from_product_set` via a request object, either of type - # {::Google::Cloud::Vision::V1p3beta1::RemoveProductFromProductSetRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Vision::V1p3beta1::RemoveProductFromProductSetRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload remove_product_from_product_set(name: nil, product: nil) - # Pass arguments to `remove_product_from_product_set` via keyword arguments. Note that at - # least one keyword argument is 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 for the ProductSet to modify. - # - # Format is: - # `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID` - # @param product [::String] - # Required. The resource name for the Product to be removed from this ProductSet. - # - # Format is: - # `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID` - # @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/vision/v1p3beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Vision::V1p3beta1::ProductSearch::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Vision::V1p3beta1::RemoveProductFromProductSetRequest.new - # - # # Call the remove_product_from_product_set method. - # result = client.remove_product_from_product_set request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def remove_product_from_product_set request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Vision::V1p3beta1::RemoveProductFromProductSetRequest - - # Converts hash 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.remove_product_from_product_set.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::Vision::V1p3beta1::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.remove_product_from_product_set.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.remove_product_from_product_set.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @product_search_stub.remove_product_from_product_set 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 the Products in a ProductSet, in an unspecified order. If the - # ProductSet does not exist, the products field of the response will be - # empty. - # - # Possible errors: - # - # * Returns INVALID_ARGUMENT if page_size is greater than 100 or less than 1. - # - # @overload list_products_in_product_set(request, options = nil) - # Pass arguments to `list_products_in_product_set` via a request object, either of type - # {::Google::Cloud::Vision::V1p3beta1::ListProductsInProductSetRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Vision::V1p3beta1::ListProductsInProductSetRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_products_in_product_set(name: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_products_in_product_set` via keyword arguments. Note that at - # least one keyword argument is 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 ProductSet resource for which to retrieve Products. - # - # Format is: - # `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID` - # @param page_size [::Integer] - # The maximum number of items to return. Default 10, maximum 100. - # @param page_token [::String] - # The next_page_token returned from a previous List request, if any. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Vision::V1p3beta1::Product>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Vision::V1p3beta1::Product>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/vision/v1p3beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Vision::V1p3beta1::ProductSearch::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Vision::V1p3beta1::ListProductsInProductSetRequest.new - # - # # Call the list_products_in_product_set method. - # result = client.list_products_in_product_set 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::Vision::V1p3beta1::Product. - # p item - # end - # - def list_products_in_product_set request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Vision::V1p3beta1::ListProductsInProductSetRequest - - # Converts hash 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_products_in_product_set.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::Vision::V1p3beta1::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_products_in_product_set.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_products_in_product_set.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @product_search_stub.list_products_in_product_set request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @product_search_stub, :list_products_in_product_set, "products", 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 - - ## - # Asynchronous API that imports a list of reference images to specified - # product sets based on a list of image information. - # - # The {::Google::Longrunning::Operation google.longrunning.Operation} API can be - # used to keep track of the progress and results of the request. - # `Operation.metadata` contains `BatchOperationMetadata`. (progress) - # `Operation.response` contains `ImportProductSetsResponse`. (results) - # - # The input source of this method is a csv file on Google Cloud Storage. - # For the format of the csv file please see - # {::Google::Cloud::Vision::V1p3beta1::ImportProductSetsGcsSource#csv_file_uri ImportProductSetsGcsSource.csv_file_uri}. - # - # @overload import_product_sets(request, options = nil) - # Pass arguments to `import_product_sets` via a request object, either of type - # {::Google::Cloud::Vision::V1p3beta1::ImportProductSetsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Vision::V1p3beta1::ImportProductSetsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_product_sets(parent: nil, input_config: nil) - # Pass arguments to `import_product_sets` via keyword arguments. Note that at - # least one keyword argument is 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 in which the ProductSets should be imported. - # - # Format is `projects/PROJECT_ID/locations/LOC_ID`. - # @param input_config [::Google::Cloud::Vision::V1p3beta1::ImportProductSetsInputConfig, ::Hash] - # Required. The input content for the list of requests. - # @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/vision/v1p3beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Vision::V1p3beta1::ProductSearch::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Vision::V1p3beta1::ImportProductSetsRequest.new - # - # # Call the import_product_sets method. - # result = client.import_product_sets 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 import_product_sets request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Vision::V1p3beta1::ImportProductSetsRequest - - # Converts hash 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_product_sets.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::Vision::V1p3beta1::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_product_sets.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.import_product_sets.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @product_search_stub.import_product_sets 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 - - ## - # Configuration class for the ProductSearch REST API. - # - # This class represents the configuration for ProductSearch 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::Vision::V1p3beta1::ProductSearch::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_product_set to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Vision::V1p3beta1::ProductSearch::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.create_product_set.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Vision::V1p3beta1::ProductSearch::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.create_product_set.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 = "vision.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 ProductSearch 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_product_set` - # @return [::Gapic::Config::Method] - # - attr_reader :create_product_set - ## - # RPC-specific configuration for `list_product_sets` - # @return [::Gapic::Config::Method] - # - attr_reader :list_product_sets - ## - # RPC-specific configuration for `get_product_set` - # @return [::Gapic::Config::Method] - # - attr_reader :get_product_set - ## - # RPC-specific configuration for `update_product_set` - # @return [::Gapic::Config::Method] - # - attr_reader :update_product_set - ## - # RPC-specific configuration for `delete_product_set` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_product_set - ## - # RPC-specific configuration for `create_product` - # @return [::Gapic::Config::Method] - # - attr_reader :create_product - ## - # RPC-specific configuration for `list_products` - # @return [::Gapic::Config::Method] - # - attr_reader :list_products - ## - # RPC-specific configuration for `get_product` - # @return [::Gapic::Config::Method] - # - attr_reader :get_product - ## - # RPC-specific configuration for `update_product` - # @return [::Gapic::Config::Method] - # - attr_reader :update_product - ## - # RPC-specific configuration for `delete_product` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_product - ## - # RPC-specific configuration for `create_reference_image` - # @return [::Gapic::Config::Method] - # - attr_reader :create_reference_image - ## - # RPC-specific configuration for `delete_reference_image` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_reference_image - ## - # RPC-specific configuration for `list_reference_images` - # @return [::Gapic::Config::Method] - # - attr_reader :list_reference_images - ## - # RPC-specific configuration for `get_reference_image` - # @return [::Gapic::Config::Method] - # - attr_reader :get_reference_image - ## - # RPC-specific configuration for `add_product_to_product_set` - # @return [::Gapic::Config::Method] - # - attr_reader :add_product_to_product_set - ## - # RPC-specific configuration for `remove_product_from_product_set` - # @return [::Gapic::Config::Method] - # - attr_reader :remove_product_from_product_set - ## - # RPC-specific configuration for `list_products_in_product_set` - # @return [::Gapic::Config::Method] - # - attr_reader :list_products_in_product_set - ## - # RPC-specific configuration for `import_product_sets` - # @return [::Gapic::Config::Method] - # - attr_reader :import_product_sets - - # @private - def initialize parent_rpcs = nil - create_product_set_config = parent_rpcs.create_product_set if parent_rpcs.respond_to? :create_product_set - @create_product_set = ::Gapic::Config::Method.new create_product_set_config - list_product_sets_config = parent_rpcs.list_product_sets if parent_rpcs.respond_to? :list_product_sets - @list_product_sets = ::Gapic::Config::Method.new list_product_sets_config - get_product_set_config = parent_rpcs.get_product_set if parent_rpcs.respond_to? :get_product_set - @get_product_set = ::Gapic::Config::Method.new get_product_set_config - update_product_set_config = parent_rpcs.update_product_set if parent_rpcs.respond_to? :update_product_set - @update_product_set = ::Gapic::Config::Method.new update_product_set_config - delete_product_set_config = parent_rpcs.delete_product_set if parent_rpcs.respond_to? :delete_product_set - @delete_product_set = ::Gapic::Config::Method.new delete_product_set_config - create_product_config = parent_rpcs.create_product if parent_rpcs.respond_to? :create_product - @create_product = ::Gapic::Config::Method.new create_product_config - list_products_config = parent_rpcs.list_products if parent_rpcs.respond_to? :list_products - @list_products = ::Gapic::Config::Method.new list_products_config - get_product_config = parent_rpcs.get_product if parent_rpcs.respond_to? :get_product - @get_product = ::Gapic::Config::Method.new get_product_config - update_product_config = parent_rpcs.update_product if parent_rpcs.respond_to? :update_product - @update_product = ::Gapic::Config::Method.new update_product_config - delete_product_config = parent_rpcs.delete_product if parent_rpcs.respond_to? :delete_product - @delete_product = ::Gapic::Config::Method.new delete_product_config - create_reference_image_config = parent_rpcs.create_reference_image if parent_rpcs.respond_to? :create_reference_image - @create_reference_image = ::Gapic::Config::Method.new create_reference_image_config - delete_reference_image_config = parent_rpcs.delete_reference_image if parent_rpcs.respond_to? :delete_reference_image - @delete_reference_image = ::Gapic::Config::Method.new delete_reference_image_config - list_reference_images_config = parent_rpcs.list_reference_images if parent_rpcs.respond_to? :list_reference_images - @list_reference_images = ::Gapic::Config::Method.new list_reference_images_config - get_reference_image_config = parent_rpcs.get_reference_image if parent_rpcs.respond_to? :get_reference_image - @get_reference_image = ::Gapic::Config::Method.new get_reference_image_config - add_product_to_product_set_config = parent_rpcs.add_product_to_product_set if parent_rpcs.respond_to? :add_product_to_product_set - @add_product_to_product_set = ::Gapic::Config::Method.new add_product_to_product_set_config - remove_product_from_product_set_config = parent_rpcs.remove_product_from_product_set if parent_rpcs.respond_to? :remove_product_from_product_set - @remove_product_from_product_set = ::Gapic::Config::Method.new remove_product_from_product_set_config - list_products_in_product_set_config = parent_rpcs.list_products_in_product_set if parent_rpcs.respond_to? :list_products_in_product_set - @list_products_in_product_set = ::Gapic::Config::Method.new list_products_in_product_set_config - import_product_sets_config = parent_rpcs.import_product_sets if parent_rpcs.respond_to? :import_product_sets - @import_product_sets = ::Gapic::Config::Method.new import_product_sets_config - - yield self if block_given? - end - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-vision-v1p3beta1/lib/google/cloud/vision/v1p3beta1/product_search/rest/operations.rb b/owl-bot-staging/google-cloud-vision-v1p3beta1/lib/google/cloud/vision/v1p3beta1/product_search/rest/operations.rb deleted file mode 100644 index 7e192b331f69..000000000000 --- a/owl-bot-staging/google-cloud-vision-v1p3beta1/lib/google/cloud/vision/v1p3beta1/product_search/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 Vision - module V1p3beta1 - module ProductSearch - module Rest - # Service that implements Longrunning Operations API. - class Operations - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "vision.$UNIVERSE_DOMAIN$" - - # @private - attr_reader :operations_stub - - ## - # Configuration for the ProductSearch 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 ProductSearch 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::Vision::V1p3beta1::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::Vision::V1p3beta1::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::Vision::V1p3beta1::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::Vision::V1p3beta1::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 = "vision.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{^operations(?:/.*)?$}, true] - ] - ) - 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-vision-v1p3beta1/lib/google/cloud/vision/v1p3beta1/product_search/rest/service_stub.rb b/owl-bot-staging/google-cloud-vision-v1p3beta1/lib/google/cloud/vision/v1p3beta1/product_search/rest/service_stub.rb deleted file mode 100644 index cda5e5059ea4..000000000000 --- a/owl-bot-staging/google-cloud-vision-v1p3beta1/lib/google/cloud/vision/v1p3beta1/product_search/rest/service_stub.rb +++ /dev/null @@ -1,1187 +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/vision/v1p3beta1/product_search_service_pb" - -module Google - module Cloud - module Vision - module V1p3beta1 - module ProductSearch - module Rest - ## - # REST service stub for the ProductSearch 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_product_set REST call - # - # @param request_pb [::Google::Cloud::Vision::V1p3beta1::CreateProductSetRequest] - # 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::Vision::V1p3beta1::ProductSet] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Vision::V1p3beta1::ProductSet] - # A result object deserialized from the server's reply - def create_product_set request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_product_set_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_product_set", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Vision::V1p3beta1::ProductSet.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_product_sets REST call - # - # @param request_pb [::Google::Cloud::Vision::V1p3beta1::ListProductSetsRequest] - # 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::Vision::V1p3beta1::ListProductSetsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Vision::V1p3beta1::ListProductSetsResponse] - # A result object deserialized from the server's reply - def list_product_sets request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_product_sets_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_product_sets", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Vision::V1p3beta1::ListProductSetsResponse.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_product_set REST call - # - # @param request_pb [::Google::Cloud::Vision::V1p3beta1::GetProductSetRequest] - # 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::Vision::V1p3beta1::ProductSet] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Vision::V1p3beta1::ProductSet] - # A result object deserialized from the server's reply - def get_product_set request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_product_set_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_product_set", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Vision::V1p3beta1::ProductSet.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_product_set REST call - # - # @param request_pb [::Google::Cloud::Vision::V1p3beta1::UpdateProductSetRequest] - # 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::Vision::V1p3beta1::ProductSet] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Vision::V1p3beta1::ProductSet] - # A result object deserialized from the server's reply - def update_product_set request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_product_set_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_product_set", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Vision::V1p3beta1::ProductSet.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_product_set REST call - # - # @param request_pb [::Google::Cloud::Vision::V1p3beta1::DeleteProductSetRequest] - # 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_product_set request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_delete_product_set_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_product_set", - 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 create_product REST call - # - # @param request_pb [::Google::Cloud::Vision::V1p3beta1::CreateProductRequest] - # 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::Vision::V1p3beta1::Product] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Vision::V1p3beta1::Product] - # A result object deserialized from the server's reply - def create_product request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_product_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_product", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Vision::V1p3beta1::Product.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_products REST call - # - # @param request_pb [::Google::Cloud::Vision::V1p3beta1::ListProductsRequest] - # 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::Vision::V1p3beta1::ListProductsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Vision::V1p3beta1::ListProductsResponse] - # A result object deserialized from the server's reply - def list_products request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_products_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_products", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Vision::V1p3beta1::ListProductsResponse.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_product REST call - # - # @param request_pb [::Google::Cloud::Vision::V1p3beta1::GetProductRequest] - # 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::Vision::V1p3beta1::Product] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Vision::V1p3beta1::Product] - # A result object deserialized from the server's reply - def get_product request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_product_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_product", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Vision::V1p3beta1::Product.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_product REST call - # - # @param request_pb [::Google::Cloud::Vision::V1p3beta1::UpdateProductRequest] - # 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::Vision::V1p3beta1::Product] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Vision::V1p3beta1::Product] - # A result object deserialized from the server's reply - def update_product request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_product_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_product", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Vision::V1p3beta1::Product.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_product REST call - # - # @param request_pb [::Google::Cloud::Vision::V1p3beta1::DeleteProductRequest] - # 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_product request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_delete_product_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_product", - 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 create_reference_image REST call - # - # @param request_pb [::Google::Cloud::Vision::V1p3beta1::CreateReferenceImageRequest] - # 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::Vision::V1p3beta1::ReferenceImage] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Vision::V1p3beta1::ReferenceImage] - # A result object deserialized from the server's reply - def create_reference_image request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_reference_image_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_reference_image", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Vision::V1p3beta1::ReferenceImage.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_reference_image REST call - # - # @param request_pb [::Google::Cloud::Vision::V1p3beta1::DeleteReferenceImageRequest] - # 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_reference_image request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_delete_reference_image_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_reference_image", - 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 list_reference_images REST call - # - # @param request_pb [::Google::Cloud::Vision::V1p3beta1::ListReferenceImagesRequest] - # 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::Vision::V1p3beta1::ListReferenceImagesResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Vision::V1p3beta1::ListReferenceImagesResponse] - # A result object deserialized from the server's reply - def list_reference_images request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_reference_images_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_reference_images", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Vision::V1p3beta1::ListReferenceImagesResponse.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_reference_image REST call - # - # @param request_pb [::Google::Cloud::Vision::V1p3beta1::GetReferenceImageRequest] - # 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::Vision::V1p3beta1::ReferenceImage] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Vision::V1p3beta1::ReferenceImage] - # A result object deserialized from the server's reply - def get_reference_image request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_reference_image_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_reference_image", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Vision::V1p3beta1::ReferenceImage.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the add_product_to_product_set REST call - # - # @param request_pb [::Google::Cloud::Vision::V1p3beta1::AddProductToProductSetRequest] - # 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 add_product_to_product_set request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_add_product_to_product_set_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: "add_product_to_product_set", - 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 remove_product_from_product_set REST call - # - # @param request_pb [::Google::Cloud::Vision::V1p3beta1::RemoveProductFromProductSetRequest] - # 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 remove_product_from_product_set request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_remove_product_from_product_set_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: "remove_product_from_product_set", - 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 list_products_in_product_set REST call - # - # @param request_pb [::Google::Cloud::Vision::V1p3beta1::ListProductsInProductSetRequest] - # 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::Vision::V1p3beta1::ListProductsInProductSetResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Vision::V1p3beta1::ListProductsInProductSetResponse] - # A result object deserialized from the server's reply - def list_products_in_product_set request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_products_in_product_set_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_products_in_product_set", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Vision::V1p3beta1::ListProductsInProductSetResponse.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_product_sets REST call - # - # @param request_pb [::Google::Cloud::Vision::V1p3beta1::ImportProductSetsRequest] - # 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 import_product_sets request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_import_product_sets_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_product_sets", - 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 - - ## - # @private - # - # GRPC transcoding helper method for the create_product_set REST call - # - # @param request_pb [::Google::Cloud::Vision::V1p3beta1::CreateProductSetRequest] - # 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_product_set_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1p3beta1/{parent}/productSets", - body: "product_set", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_product_sets REST call - # - # @param request_pb [::Google::Cloud::Vision::V1p3beta1::ListProductSetsRequest] - # 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_product_sets_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1p3beta1/{parent}/productSets", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_product_set REST call - # - # @param request_pb [::Google::Cloud::Vision::V1p3beta1::GetProductSetRequest] - # 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_product_set_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1p3beta1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/productSets/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_product_set REST call - # - # @param request_pb [::Google::Cloud::Vision::V1p3beta1::UpdateProductSetRequest] - # 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_product_set_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v1p3beta1/{product_set.name}", - body: "product_set", - matches: [ - ["product_set.name", %r{^projects/[^/]+/locations/[^/]+/productSets/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_product_set REST call - # - # @param request_pb [::Google::Cloud::Vision::V1p3beta1::DeleteProductSetRequest] - # 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_product_set_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v1p3beta1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/productSets/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the create_product REST call - # - # @param request_pb [::Google::Cloud::Vision::V1p3beta1::CreateProductRequest] - # 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_product_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1p3beta1/{parent}/products", - body: "product", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_products REST call - # - # @param request_pb [::Google::Cloud::Vision::V1p3beta1::ListProductsRequest] - # 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_products_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1p3beta1/{parent}/products", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_product REST call - # - # @param request_pb [::Google::Cloud::Vision::V1p3beta1::GetProductRequest] - # 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_product_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1p3beta1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/products/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_product REST call - # - # @param request_pb [::Google::Cloud::Vision::V1p3beta1::UpdateProductRequest] - # 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_product_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v1p3beta1/{product.name}", - body: "product", - matches: [ - ["product.name", %r{^projects/[^/]+/locations/[^/]+/products/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_product REST call - # - # @param request_pb [::Google::Cloud::Vision::V1p3beta1::DeleteProductRequest] - # 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_product_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v1p3beta1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/products/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the create_reference_image REST call - # - # @param request_pb [::Google::Cloud::Vision::V1p3beta1::CreateReferenceImageRequest] - # 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_reference_image_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1p3beta1/{parent}/referenceImages", - body: "reference_image", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/products/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_reference_image REST call - # - # @param request_pb [::Google::Cloud::Vision::V1p3beta1::DeleteReferenceImageRequest] - # 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_reference_image_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v1p3beta1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/products/[^/]+/referenceImages/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_reference_images REST call - # - # @param request_pb [::Google::Cloud::Vision::V1p3beta1::ListReferenceImagesRequest] - # 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_reference_images_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1p3beta1/{parent}/referenceImages", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/products/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_reference_image REST call - # - # @param request_pb [::Google::Cloud::Vision::V1p3beta1::GetReferenceImageRequest] - # 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_reference_image_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1p3beta1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/products/[^/]+/referenceImages/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the add_product_to_product_set REST call - # - # @param request_pb [::Google::Cloud::Vision::V1p3beta1::AddProductToProductSetRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_add_product_to_product_set_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1p3beta1/{name}:addProduct", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/productSets/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the remove_product_from_product_set REST call - # - # @param request_pb [::Google::Cloud::Vision::V1p3beta1::RemoveProductFromProductSetRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_remove_product_from_product_set_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1p3beta1/{name}:removeProduct", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/productSets/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_products_in_product_set REST call - # - # @param request_pb [::Google::Cloud::Vision::V1p3beta1::ListProductsInProductSetRequest] - # 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_products_in_product_set_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1p3beta1/{name}/products", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/productSets/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the import_product_sets REST call - # - # @param request_pb [::Google::Cloud::Vision::V1p3beta1::ImportProductSetsRequest] - # 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_product_sets_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1p3beta1/{parent}/productSets:import", - body: "*", - 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-vision-v1p3beta1/lib/google/cloud/vision/v1p3beta1/product_search_pb.rb b/owl-bot-staging/google-cloud-vision-v1p3beta1/lib/google/cloud/vision/v1p3beta1/product_search_pb.rb deleted file mode 100644 index 3f311656f1a5..000000000000 --- a/owl-bot-staging/google-cloud-vision-v1p3beta1/lib/google/cloud/vision/v1p3beta1/product_search_pb.rb +++ /dev/null @@ -1,30 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/vision/v1p3beta1/product_search.proto - -require 'google/protobuf' - -require 'google/api/resource_pb' -require 'google/cloud/vision/v1p3beta1/geometry_pb' -require 'google/cloud/vision/v1p3beta1/product_search_service_pb' -require 'google/protobuf/timestamp_pb' - - -descriptor_data = "\n2google/cloud/vision/v1p3beta1/product_search.proto\x12\x1dgoogle.cloud.vision.v1p3beta1\x1a\x19google/api/resource.proto\x1a,google/cloud/vision/v1p3beta1/geometry.proto\x1a:google/cloud/vision/v1p3beta1/product_search_service.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xc1\x01\n\x13ProductSearchParams\x12\x42\n\rbounding_poly\x18\t \x01(\x0b\x32+.google.cloud.vision.v1p3beta1.BoundingPoly\x12:\n\x0bproduct_set\x18\x06 \x01(\tB%\xfa\x41\"\n vision.googleapis.com/ProductSet\x12\x1a\n\x12product_categories\x18\x07 \x03(\t\x12\x0e\n\x06\x66ilter\x18\x08 \x01(\t\"\xb2\x05\n\x14ProductSearchResults\x12.\n\nindex_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12K\n\x07results\x18\x05 \x03(\x0b\x32:.google.cloud.vision.v1p3beta1.ProductSearchResults.Result\x12\x62\n\x17product_grouped_results\x18\x06 \x03(\x0b\x32\x41.google.cloud.vision.v1p3beta1.ProductSearchResults.GroupedResult\x1a_\n\x06Result\x12\x37\n\x07product\x18\x01 \x01(\x0b\x32&.google.cloud.vision.v1p3beta1.Product\x12\r\n\x05score\x18\x02 \x01(\x02\x12\r\n\x05image\x18\x03 \x01(\t\x1aS\n\x10ObjectAnnotation\x12\x0b\n\x03mid\x18\x01 \x01(\t\x12\x15\n\rlanguage_code\x18\x02 \x01(\t\x12\x0c\n\x04name\x18\x03 \x01(\t\x12\r\n\x05score\x18\x04 \x01(\x02\x1a\x82\x02\n\rGroupedResult\x12\x42\n\rbounding_poly\x18\x01 \x01(\x0b\x32+.google.cloud.vision.v1p3beta1.BoundingPoly\x12K\n\x07results\x18\x02 \x03(\x0b\x32:.google.cloud.vision.v1p3beta1.ProductSearchResults.Result\x12`\n\x12object_annotations\x18\x03 \x03(\x0b\x32\x44.google.cloud.vision.v1p3beta1.ProductSearchResults.ObjectAnnotationB~\n!com.google.cloud.vision.v1p3beta1B\x12ProductSearchProtoP\x01Z9cloud.google.com/go/vision/apiv1p3beta1/visionpb;visionpb\xf8\x01\x01\xa2\x02\x04GCVNb\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module Vision - module V1p3beta1 - ProductSearchParams = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p3beta1.ProductSearchParams").msgclass - ProductSearchResults = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p3beta1.ProductSearchResults").msgclass - ProductSearchResults::Result = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p3beta1.ProductSearchResults.Result").msgclass - ProductSearchResults::ObjectAnnotation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p3beta1.ProductSearchResults.ObjectAnnotation").msgclass - ProductSearchResults::GroupedResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p3beta1.ProductSearchResults.GroupedResult").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-vision-v1p3beta1/lib/google/cloud/vision/v1p3beta1/product_search_service_pb.rb b/owl-bot-staging/google-cloud-vision-v1p3beta1/lib/google/cloud/vision/v1p3beta1/product_search_service_pb.rb deleted file mode 100644 index 44e4525965db..000000000000 --- a/owl-bot-staging/google-cloud-vision-v1p3beta1/lib/google/cloud/vision/v1p3beta1/product_search_service_pb.rb +++ /dev/null @@ -1,62 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/vision/v1p3beta1/product_search_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/vision/v1p3beta1/geometry_pb' -require 'google/longrunning/operations_pb' -require 'google/protobuf/empty_pb' -require 'google/protobuf/field_mask_pb' -require 'google/protobuf/timestamp_pb' -require 'google/rpc/status_pb' - - -descriptor_data = "\n:google/cloud/vision/v1p3beta1/product_search_service.proto\x12\x1dgoogle.cloud.vision.v1p3beta1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a,google/cloud/vision/v1p3beta1/geometry.proto\x1a#google/longrunning/operations.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x17google/rpc/status.proto\"\xb2\x02\n\x07Product\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x14\n\x0c\x64isplay_name\x18\x02 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x03 \x01(\t\x12\x1d\n\x10product_category\x18\x04 \x01(\tB\x03\xe0\x41\x05\x12G\n\x0eproduct_labels\x18\x05 \x03(\x0b\x32/.google.cloud.vision.v1p3beta1.Product.KeyValue\x1a&\n\x08KeyValue\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:^\xea\x41[\n\x1dvision.googleapis.com/Product\x12:projects/{project}/locations/{location}/products/{product}\"\xfd\x01\n\nProductSet\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x14\n\x0c\x64isplay_name\x18\x02 \x01(\t\x12\x33\n\nindex_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12,\n\x0bindex_error\x18\x04 \x01(\x0b\x32\x12.google.rpc.StatusB\x03\xe0\x41\x03:h\xea\x41\x65\n vision.googleapis.com/ProductSet\x12\x41projects/{project}/locations/{location}/productSets/{product_set}\"\x85\x02\n\x0eReferenceImage\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x10\n\x03uri\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12H\n\x0e\x62ounding_polys\x18\x03 \x03(\x0b\x32+.google.cloud.vision.v1p3beta1.BoundingPolyB\x03\xe0\x41\x01:\x88\x01\xea\x41\x84\x01\n$vision.googleapis.com/ReferenceImage\x12\\projects/{project}/locations/{location}/products/{product}/referenceImages/{reference_image}\"\xa3\x01\n\x14\x43reateProductRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\x12<\n\x07product\x18\x02 \x01(\x0b\x32&.google.cloud.vision.v1p3beta1.ProductB\x03\xe0\x41\x02\x12\x12\n\nproduct_id\x18\x03 \x01(\t\"w\n\x13ListProductsRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\"i\n\x14ListProductsResponse\x12\x38\n\x08products\x18\x01 \x03(\x0b\x32&.google.cloud.vision.v1p3beta1.Product\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"H\n\x11GetProductRequest\x12\x33\n\x04name\x18\x01 \x01(\tB%\xe0\x41\x02\xfa\x41\x1f\n\x1dvision.googleapis.com/Product\"\x85\x01\n\x14UpdateProductRequest\x12<\n\x07product\x18\x01 \x01(\x0b\x32&.google.cloud.vision.v1p3beta1.ProductB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"K\n\x14\x44\x65leteProductRequest\x12\x33\n\x04name\x18\x01 \x01(\tB%\xe0\x41\x02\xfa\x41\x1f\n\x1dvision.googleapis.com/Product\"\xb1\x01\n\x17\x43reateProductSetRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\x12\x43\n\x0bproduct_set\x18\x02 \x01(\x0b\x32).google.cloud.vision.v1p3beta1.ProductSetB\x03\xe0\x41\x02\x12\x16\n\x0eproduct_set_id\x18\x03 \x01(\t\"z\n\x16ListProductSetsRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\"s\n\x17ListProductSetsResponse\x12?\n\x0cproduct_sets\x18\x01 \x03(\x0b\x32).google.cloud.vision.v1p3beta1.ProductSet\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"N\n\x14GetProductSetRequest\x12\x36\n\x04name\x18\x01 \x01(\tB(\xe0\x41\x02\xfa\x41\"\n vision.googleapis.com/ProductSet\"\x8f\x01\n\x17UpdateProductSetRequest\x12\x43\n\x0bproduct_set\x18\x01 \x01(\x0b\x32).google.cloud.vision.v1p3beta1.ProductSetB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"Q\n\x17\x44\x65leteProductSetRequest\x12\x36\n\x04name\x18\x01 \x01(\tB(\xe0\x41\x02\xfa\x41\"\n vision.googleapis.com/ProductSet\"\xbd\x01\n\x1b\x43reateReferenceImageRequest\x12\x35\n\x06parent\x18\x01 \x01(\tB%\xe0\x41\x02\xfa\x41\x1f\n\x1dvision.googleapis.com/Product\x12K\n\x0freference_image\x18\x02 \x01(\x0b\x32-.google.cloud.vision.v1p3beta1.ReferenceImageB\x03\xe0\x41\x02\x12\x1a\n\x12reference_image_id\x18\x03 \x01(\t\"z\n\x1aListReferenceImagesRequest\x12\x35\n\x06parent\x18\x01 \x01(\tB%\xe0\x41\x02\xfa\x41\x1f\n\x1dvision.googleapis.com/Product\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\"\x92\x01\n\x1bListReferenceImagesResponse\x12G\n\x10reference_images\x18\x01 \x03(\x0b\x32-.google.cloud.vision.v1p3beta1.ReferenceImage\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x17\n\x0fnext_page_token\x18\x03 \x01(\t\"V\n\x18GetReferenceImageRequest\x12:\n\x04name\x18\x01 \x01(\tB,\xe0\x41\x02\xfa\x41&\n$vision.googleapis.com/ReferenceImage\"Y\n\x1b\x44\x65leteReferenceImageRequest\x12:\n\x04name\x18\x01 \x01(\tB,\xe0\x41\x02\xfa\x41&\n$vision.googleapis.com/ReferenceImage\"\x8f\x01\n\x1d\x41\x64\x64ProductToProductSetRequest\x12\x36\n\x04name\x18\x01 \x01(\tB(\xe0\x41\x02\xfa\x41\"\n vision.googleapis.com/ProductSet\x12\x36\n\x07product\x18\x02 \x01(\tB%\xe0\x41\x02\xfa\x41\x1f\n\x1dvision.googleapis.com/Product\"\x94\x01\n\"RemoveProductFromProductSetRequest\x12\x36\n\x04name\x18\x01 \x01(\tB(\xe0\x41\x02\xfa\x41\"\n vision.googleapis.com/ProductSet\x12\x36\n\x07product\x18\x02 \x01(\tB%\xe0\x41\x02\xfa\x41\x1f\n\x1dvision.googleapis.com/Product\"\x80\x01\n\x1fListProductsInProductSetRequest\x12\x36\n\x04name\x18\x01 \x01(\tB(\xe0\x41\x02\xfa\x41\"\n vision.googleapis.com/ProductSet\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\"u\n ListProductsInProductSetResponse\x12\x38\n\x08products\x18\x01 \x03(\x0b\x32&.google.cloud.vision.v1p3beta1.Product\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"2\n\x1aImportProductSetsGcsSource\x12\x14\n\x0c\x63sv_file_uri\x18\x01 \x01(\t\"y\n\x1cImportProductSetsInputConfig\x12O\n\ngcs_source\x18\x01 \x01(\x0b\x32\x39.google.cloud.vision.v1p3beta1.ImportProductSetsGcsSourceH\x00\x42\x08\n\x06source\"\xad\x01\n\x18ImportProductSetsRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\x12V\n\x0cinput_config\x18\x02 \x01(\x0b\x32;.google.cloud.vision.v1p3beta1.ImportProductSetsInputConfigB\x03\xe0\x41\x02\"\x8a\x01\n\x19ImportProductSetsResponse\x12G\n\x10reference_images\x18\x01 \x03(\x0b\x32-.google.cloud.vision.v1p3beta1.ReferenceImage\x12$\n\x08statuses\x18\x02 \x03(\x0b\x32\x12.google.rpc.Status\"\x9e\x02\n\x16\x42\x61tchOperationMetadata\x12J\n\x05state\x18\x01 \x01(\x0e\x32;.google.cloud.vision.v1p3beta1.BatchOperationMetadata.State\x12/\n\x0bsubmit_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12,\n\x08\x65nd_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"Y\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0e\n\nPROCESSING\x10\x01\x12\x0e\n\nSUCCESSFUL\x10\x02\x12\n\n\x06\x46\x41ILED\x10\x03\x12\r\n\tCANCELLED\x10\x04\x32\xeb\x1e\n\rProductSearch\x12\xe6\x01\n\x10\x43reateProductSet\x12\x36.google.cloud.vision.v1p3beta1.CreateProductSetRequest\x1a).google.cloud.vision.v1p3beta1.ProductSet\"o\xda\x41!parent,product_set,product_set_id\x82\xd3\xe4\x93\x02\x45\"6/v1p3beta1/{parent=projects/*/locations/*}/productSets:\x0bproduct_set\x12\xc9\x01\n\x0fListProductSets\x12\x35.google.cloud.vision.v1p3beta1.ListProductSetsRequest\x1a\x36.google.cloud.vision.v1p3beta1.ListProductSetsResponse\"G\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x38\x12\x36/v1p3beta1/{parent=projects/*/locations/*}/productSets\x12\xb6\x01\n\rGetProductSet\x12\x33.google.cloud.vision.v1p3beta1.GetProductSetRequest\x1a).google.cloud.vision.v1p3beta1.ProductSet\"E\xda\x41\x04name\x82\xd3\xe4\x93\x02\x38\x12\x36/v1p3beta1/{name=projects/*/locations/*/productSets/*}\x12\xe8\x01\n\x10UpdateProductSet\x12\x36.google.cloud.vision.v1p3beta1.UpdateProductSetRequest\x1a).google.cloud.vision.v1p3beta1.ProductSet\"q\xda\x41\x17product_set,update_mask\x82\xd3\xe4\x93\x02Q2B/v1p3beta1/{product_set.name=projects/*/locations/*/productSets/*}:\x0bproduct_set\x12\xa9\x01\n\x10\x44\x65leteProductSet\x12\x36.google.cloud.vision.v1p3beta1.DeleteProductSetRequest\x1a\x16.google.protobuf.Empty\"E\xda\x41\x04name\x82\xd3\xe4\x93\x02\x38*6/v1p3beta1/{name=projects/*/locations/*/productSets/*}\x12\xce\x01\n\rCreateProduct\x12\x33.google.cloud.vision.v1p3beta1.CreateProductRequest\x1a&.google.cloud.vision.v1p3beta1.Product\"`\xda\x41\x19parent,product,product_id\x82\xd3\xe4\x93\x02>\"3/v1p3beta1/{parent=projects/*/locations/*}/products:\x07product\x12\xbd\x01\n\x0cListProducts\x12\x32.google.cloud.vision.v1p3beta1.ListProductsRequest\x1a\x33.google.cloud.vision.v1p3beta1.ListProductsResponse\"D\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x35\x12\x33/v1p3beta1/{parent=projects/*/locations/*}/products\x12\xaa\x01\n\nGetProduct\x12\x30.google.cloud.vision.v1p3beta1.GetProductRequest\x1a&.google.cloud.vision.v1p3beta1.Product\"B\xda\x41\x04name\x82\xd3\xe4\x93\x02\x35\x12\x33/v1p3beta1/{name=projects/*/locations/*/products/*}\x12\xd0\x01\n\rUpdateProduct\x12\x33.google.cloud.vision.v1p3beta1.UpdateProductRequest\x1a&.google.cloud.vision.v1p3beta1.Product\"b\xda\x41\x13product,update_mask\x82\xd3\xe4\x93\x02\x46\x32;/v1p3beta1/{product.name=projects/*/locations/*/products/*}:\x07product\x12\xa0\x01\n\rDeleteProduct\x12\x33.google.cloud.vision.v1p3beta1.DeleteProductRequest\x1a\x16.google.protobuf.Empty\"B\xda\x41\x04name\x82\xd3\xe4\x93\x02\x35*3/v1p3beta1/{name=projects/*/locations/*/products/*}\x12\x8e\x02\n\x14\x43reateReferenceImage\x12:.google.cloud.vision.v1p3beta1.CreateReferenceImageRequest\x1a-.google.cloud.vision.v1p3beta1.ReferenceImage\"\x8a\x01\xda\x41)parent,reference_image,reference_image_id\x82\xd3\xe4\x93\x02X\"E/v1p3beta1/{parent=projects/*/locations/*/products/*}/referenceImages:\x0freference_image\x12\xc0\x01\n\x14\x44\x65leteReferenceImage\x12:.google.cloud.vision.v1p3beta1.DeleteReferenceImageRequest\x1a\x16.google.protobuf.Empty\"T\xda\x41\x04name\x82\xd3\xe4\x93\x02G*E/v1p3beta1/{name=projects/*/locations/*/products/*/referenceImages/*}\x12\xe4\x01\n\x13ListReferenceImages\x12\x39.google.cloud.vision.v1p3beta1.ListReferenceImagesRequest\x1a:.google.cloud.vision.v1p3beta1.ListReferenceImagesResponse\"V\xda\x41\x06parent\x82\xd3\xe4\x93\x02G\x12\x45/v1p3beta1/{parent=projects/*/locations/*/products/*}/referenceImages\x12\xd1\x01\n\x11GetReferenceImage\x12\x37.google.cloud.vision.v1p3beta1.GetReferenceImageRequest\x1a-.google.cloud.vision.v1p3beta1.ReferenceImage\"T\xda\x41\x04name\x82\xd3\xe4\x93\x02G\x12\x45/v1p3beta1/{name=projects/*/locations/*/products/*/referenceImages/*}\x12\xcb\x01\n\x16\x41\x64\x64ProductToProductSet\x12<.google.cloud.vision.v1p3beta1.AddProductToProductSetRequest\x1a\x16.google.protobuf.Empty\"[\xda\x41\x0cname,product\x82\xd3\xe4\x93\x02\x46\"A/v1p3beta1/{name=projects/*/locations/*/productSets/*}:addProduct:\x01*\x12\xd8\x01\n\x1bRemoveProductFromProductSet\x12\x41.google.cloud.vision.v1p3beta1.RemoveProductFromProductSetRequest\x1a\x16.google.protobuf.Empty\"^\xda\x41\x0cname,product\x82\xd3\xe4\x93\x02I\"D/v1p3beta1/{name=projects/*/locations/*/productSets/*}:removeProduct:\x01*\x12\xeb\x01\n\x18ListProductsInProductSet\x12>.google.cloud.vision.v1p3beta1.ListProductsInProductSetRequest\x1a?.google.cloud.vision.v1p3beta1.ListProductsInProductSetResponse\"N\xda\x41\x04name\x82\xd3\xe4\x93\x02\x41\x12?/v1p3beta1/{name=projects/*/locations/*/productSets/*}/products\x12\x82\x02\n\x11ImportProductSets\x12\x37.google.cloud.vision.v1p3beta1.ImportProductSetsRequest\x1a\x1d.google.longrunning.Operation\"\x94\x01\xca\x41\x33\n\x19ImportProductSetsResponse\x12\x16\x42\x61tchOperationMetadata\xda\x41\x13parent,input_config\x82\xd3\xe4\x93\x02\x42\"=/v1p3beta1/{parent=projects/*/locations/*}/productSets:import:\x01*\x1av\xca\x41\x15vision.googleapis.com\xd2\x41[https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/cloud-visionB~\n!com.google.cloud.vision.v1p3beta1B\x19ProductSearchServiceProtoP\x01Z9cloud.google.com/go/vision/apiv1p3beta1/visionpb;visionpb\xf8\x01\x01\x62\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module Vision - module V1p3beta1 - Product = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p3beta1.Product").msgclass - Product::KeyValue = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p3beta1.Product.KeyValue").msgclass - ProductSet = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p3beta1.ProductSet").msgclass - ReferenceImage = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p3beta1.ReferenceImage").msgclass - CreateProductRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p3beta1.CreateProductRequest").msgclass - ListProductsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p3beta1.ListProductsRequest").msgclass - ListProductsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p3beta1.ListProductsResponse").msgclass - GetProductRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p3beta1.GetProductRequest").msgclass - UpdateProductRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p3beta1.UpdateProductRequest").msgclass - DeleteProductRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p3beta1.DeleteProductRequest").msgclass - CreateProductSetRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p3beta1.CreateProductSetRequest").msgclass - ListProductSetsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p3beta1.ListProductSetsRequest").msgclass - ListProductSetsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p3beta1.ListProductSetsResponse").msgclass - GetProductSetRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p3beta1.GetProductSetRequest").msgclass - UpdateProductSetRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p3beta1.UpdateProductSetRequest").msgclass - DeleteProductSetRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p3beta1.DeleteProductSetRequest").msgclass - CreateReferenceImageRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p3beta1.CreateReferenceImageRequest").msgclass - ListReferenceImagesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p3beta1.ListReferenceImagesRequest").msgclass - ListReferenceImagesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p3beta1.ListReferenceImagesResponse").msgclass - GetReferenceImageRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p3beta1.GetReferenceImageRequest").msgclass - DeleteReferenceImageRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p3beta1.DeleteReferenceImageRequest").msgclass - AddProductToProductSetRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p3beta1.AddProductToProductSetRequest").msgclass - RemoveProductFromProductSetRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p3beta1.RemoveProductFromProductSetRequest").msgclass - ListProductsInProductSetRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p3beta1.ListProductsInProductSetRequest").msgclass - ListProductsInProductSetResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p3beta1.ListProductsInProductSetResponse").msgclass - ImportProductSetsGcsSource = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p3beta1.ImportProductSetsGcsSource").msgclass - ImportProductSetsInputConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p3beta1.ImportProductSetsInputConfig").msgclass - ImportProductSetsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p3beta1.ImportProductSetsRequest").msgclass - ImportProductSetsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p3beta1.ImportProductSetsResponse").msgclass - BatchOperationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p3beta1.BatchOperationMetadata").msgclass - BatchOperationMetadata::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p3beta1.BatchOperationMetadata.State").enummodule - end - end - end -end diff --git a/owl-bot-staging/google-cloud-vision-v1p3beta1/lib/google/cloud/vision/v1p3beta1/product_search_service_services_pb.rb b/owl-bot-staging/google-cloud-vision-v1p3beta1/lib/google/cloud/vision/v1p3beta1/product_search_service_services_pb.rb deleted file mode 100644 index e177b3044f3a..000000000000 --- a/owl-bot-staging/google-cloud-vision-v1p3beta1/lib/google/cloud/vision/v1p3beta1/product_search_service_services_pb.rb +++ /dev/null @@ -1,222 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# Source: google/cloud/vision/v1p3beta1/product_search_service.proto for package 'google.cloud.vision.v1p3beta1' -# 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/vision/v1p3beta1/product_search_service_pb' - -module Google - module Cloud - module Vision - module V1p3beta1 - module ProductSearch - # Manages Products and ProductSets of reference images for use in product - # search. It uses the following resource model: - # - # - The API has a collection of [ProductSet][google.cloud.vision.v1p3beta1.ProductSet] resources, named - # `projects/*/locations/*/productSets/*`, which acts as a way to put different - # products into groups to limit identification. - # - # In parallel, - # - # - The API has a collection of [Product][google.cloud.vision.v1p3beta1.Product] resources, named - # `projects/*/locations/*/products/*` - # - # - Each [Product][google.cloud.vision.v1p3beta1.Product] has a collection of [ReferenceImage][google.cloud.vision.v1p3beta1.ReferenceImage] resources, named - # `projects/*/locations/*/products/*/referenceImages/*` - class Service - - include ::GRPC::GenericService - - self.marshal_class_method = :encode - self.unmarshal_class_method = :decode - self.service_name = 'google.cloud.vision.v1p3beta1.ProductSearch' - - # Creates and returns a new ProductSet resource. - # - # Possible errors: - # - # * Returns INVALID_ARGUMENT if display_name is missing, or is longer than - # 4096 characters. - rpc :CreateProductSet, ::Google::Cloud::Vision::V1p3beta1::CreateProductSetRequest, ::Google::Cloud::Vision::V1p3beta1::ProductSet - # Lists ProductSets in an unspecified order. - # - # Possible errors: - # - # * Returns INVALID_ARGUMENT if page_size is greater than 100, or less - # than 1. - rpc :ListProductSets, ::Google::Cloud::Vision::V1p3beta1::ListProductSetsRequest, ::Google::Cloud::Vision::V1p3beta1::ListProductSetsResponse - # Gets information associated with a ProductSet. - # - # Possible errors: - # - # * Returns NOT_FOUND if the ProductSet does not exist. - rpc :GetProductSet, ::Google::Cloud::Vision::V1p3beta1::GetProductSetRequest, ::Google::Cloud::Vision::V1p3beta1::ProductSet - # Makes changes to a ProductSet resource. - # Only display_name can be updated currently. - # - # Possible errors: - # - # * Returns NOT_FOUND if the ProductSet does not exist. - # * Returns INVALID_ARGUMENT if display_name is present in update_mask but - # missing from the request or longer than 4096 characters. - rpc :UpdateProductSet, ::Google::Cloud::Vision::V1p3beta1::UpdateProductSetRequest, ::Google::Cloud::Vision::V1p3beta1::ProductSet - # Permanently deletes a ProductSet. All Products and ReferenceImages in the - # ProductSet will be deleted. - # - # The actual image files are not deleted from Google Cloud Storage. - # - # Possible errors: - # - # * Returns NOT_FOUND if the ProductSet does not exist. - rpc :DeleteProductSet, ::Google::Cloud::Vision::V1p3beta1::DeleteProductSetRequest, ::Google::Protobuf::Empty - # Creates and returns a new product resource. - # - # Possible errors: - # - # * Returns INVALID_ARGUMENT if display_name is missing or longer than 4096 - # characters. - # * Returns INVALID_ARGUMENT if description is longer than 4096 characters. - # * Returns INVALID_ARGUMENT if product_category is missing or invalid. - rpc :CreateProduct, ::Google::Cloud::Vision::V1p3beta1::CreateProductRequest, ::Google::Cloud::Vision::V1p3beta1::Product - # Lists products in an unspecified order. - # - # Possible errors: - # - # * Returns INVALID_ARGUMENT if page_size is greater than 100 or less than 1. - rpc :ListProducts, ::Google::Cloud::Vision::V1p3beta1::ListProductsRequest, ::Google::Cloud::Vision::V1p3beta1::ListProductsResponse - # Gets information associated with a Product. - # - # Possible errors: - # - # * Returns NOT_FOUND if the Product does not exist. - rpc :GetProduct, ::Google::Cloud::Vision::V1p3beta1::GetProductRequest, ::Google::Cloud::Vision::V1p3beta1::Product - # Makes changes to a Product resource. - # Only display_name, description and labels can be updated right now. - # - # If labels are updated, the change will not be reflected in queries until - # the next index time. - # - # Possible errors: - # - # * Returns NOT_FOUND if the Product does not exist. - # * Returns INVALID_ARGUMENT if display_name is present in update_mask but is - # missing from the request or longer than 4096 characters. - # * Returns INVALID_ARGUMENT if description is present in update_mask but is - # longer than 4096 characters. - # * Returns INVALID_ARGUMENT if product_category is present in update_mask. - rpc :UpdateProduct, ::Google::Cloud::Vision::V1p3beta1::UpdateProductRequest, ::Google::Cloud::Vision::V1p3beta1::Product - # Permanently deletes a product and its reference images. - # - # Metadata of the product and all its images will be deleted right away, but - # search queries against ProductSets containing the product may still work - # until all related caches are refreshed. - # - # Possible errors: - # - # * Returns NOT_FOUND if the product does not exist. - rpc :DeleteProduct, ::Google::Cloud::Vision::V1p3beta1::DeleteProductRequest, ::Google::Protobuf::Empty - # Creates and returns a new ReferenceImage resource. - # - # The `bounding_poly` field is optional. If `bounding_poly` is not specified, - # the system will try to detect regions of interest in the image that are - # compatible with the product_category on the parent product. If it is - # specified, detection is ALWAYS skipped. The system converts polygons into - # non-rotated rectangles. - # - # Note that the pipeline will resize the image if the image resolution is too - # large to process (above 50MP). - # - # Possible errors: - # - # * Returns INVALID_ARGUMENT if the image_uri is missing or longer than 4096 - # characters. - # * Returns INVALID_ARGUMENT if the product does not exist. - # * Returns INVALID_ARGUMENT if bounding_poly is not provided, and nothing - # compatible with the parent product's product_category is detected. - # * Returns INVALID_ARGUMENT if bounding_poly contains more than 10 polygons. - rpc :CreateReferenceImage, ::Google::Cloud::Vision::V1p3beta1::CreateReferenceImageRequest, ::Google::Cloud::Vision::V1p3beta1::ReferenceImage - # Permanently deletes a reference image. - # - # The image metadata will be deleted right away, but search queries - # against ProductSets containing the image may still work until all related - # caches are refreshed. - # - # The actual image files are not deleted from Google Cloud Storage. - # - # Possible errors: - # - # * Returns NOT_FOUND if the reference image does not exist. - rpc :DeleteReferenceImage, ::Google::Cloud::Vision::V1p3beta1::DeleteReferenceImageRequest, ::Google::Protobuf::Empty - # Lists reference images. - # - # Possible errors: - # - # * Returns NOT_FOUND if the parent product does not exist. - # * Returns INVALID_ARGUMENT if the page_size is greater than 100, or less - # than 1. - rpc :ListReferenceImages, ::Google::Cloud::Vision::V1p3beta1::ListReferenceImagesRequest, ::Google::Cloud::Vision::V1p3beta1::ListReferenceImagesResponse - # Gets information associated with a ReferenceImage. - # - # Possible errors: - # - # * Returns NOT_FOUND if the specified image does not exist. - rpc :GetReferenceImage, ::Google::Cloud::Vision::V1p3beta1::GetReferenceImageRequest, ::Google::Cloud::Vision::V1p3beta1::ReferenceImage - # Adds a Product to the specified ProductSet. If the Product is already - # present, no change is made. - # - # One Product can be added to at most 100 ProductSets. - # - # Possible errors: - # - # * Returns NOT_FOUND if the Product or the ProductSet doesn't exist. - rpc :AddProductToProductSet, ::Google::Cloud::Vision::V1p3beta1::AddProductToProductSetRequest, ::Google::Protobuf::Empty - # Removes a Product from the specified ProductSet. - # - # Possible errors: - # - # * Returns NOT_FOUND If the Product is not found under the ProductSet. - rpc :RemoveProductFromProductSet, ::Google::Cloud::Vision::V1p3beta1::RemoveProductFromProductSetRequest, ::Google::Protobuf::Empty - # Lists the Products in a ProductSet, in an unspecified order. If the - # ProductSet does not exist, the products field of the response will be - # empty. - # - # Possible errors: - # - # * Returns INVALID_ARGUMENT if page_size is greater than 100 or less than 1. - rpc :ListProductsInProductSet, ::Google::Cloud::Vision::V1p3beta1::ListProductsInProductSetRequest, ::Google::Cloud::Vision::V1p3beta1::ListProductsInProductSetResponse - # Asynchronous API that imports a list of reference images to specified - # product sets based on a list of image information. - # - # The [google.longrunning.Operation][google.longrunning.Operation] API can be - # used to keep track of the progress and results of the request. - # `Operation.metadata` contains `BatchOperationMetadata`. (progress) - # `Operation.response` contains `ImportProductSetsResponse`. (results) - # - # The input source of this method is a csv file on Google Cloud Storage. - # For the format of the csv file please see - # [ImportProductSetsGcsSource.csv_file_uri][google.cloud.vision.v1p3beta1.ImportProductSetsGcsSource.csv_file_uri]. - rpc :ImportProductSets, ::Google::Cloud::Vision::V1p3beta1::ImportProductSetsRequest, ::Google::Longrunning::Operation - end - - Stub = Service.rpc_stub_class - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-vision-v1p3beta1/lib/google/cloud/vision/v1p3beta1/rest.rb b/owl-bot-staging/google-cloud-vision-v1p3beta1/lib/google/cloud/vision/v1p3beta1/rest.rb deleted file mode 100644 index 81f51ad2579e..000000000000 --- a/owl-bot-staging/google-cloud-vision-v1p3beta1/lib/google/cloud/vision/v1p3beta1/rest.rb +++ /dev/null @@ -1,38 +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/vision/v1p3beta1/product_search/rest" -require "google/cloud/vision/v1p3beta1/image_annotator/rest" -require "google/cloud/vision/v1p3beta1/version" - -module Google - module Cloud - module Vision - ## - # To load just the REST part of this package, including all its services, and instantiate a REST client: - # - # @example - # - # require "google/cloud/vision/v1p3beta1/rest" - # client = ::Google::Cloud::Vision::V1p3beta1::ProductSearch::Rest::Client.new - # - module V1p3beta1 - end - end - end -end diff --git a/owl-bot-staging/google-cloud-vision-v1p3beta1/lib/google/cloud/vision/v1p3beta1/text_annotation_pb.rb b/owl-bot-staging/google-cloud-vision-v1p3beta1/lib/google/cloud/vision/v1p3beta1/text_annotation_pb.rb deleted file mode 100644 index 0a5409aa7036..000000000000 --- a/owl-bot-staging/google-cloud-vision-v1p3beta1/lib/google/cloud/vision/v1p3beta1/text_annotation_pb.rb +++ /dev/null @@ -1,33 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/vision/v1p3beta1/text_annotation.proto - -require 'google/protobuf' - -require 'google/cloud/vision/v1p3beta1/geometry_pb' - - -descriptor_data = "\n3google/cloud/vision/v1p3beta1/text_annotation.proto\x12\x1dgoogle.cloud.vision.v1p3beta1\x1a,google/cloud/vision/v1p3beta1/geometry.proto\"\xb2\x04\n\x0eTextAnnotation\x12\x32\n\x05pages\x18\x01 \x03(\x0b\x32#.google.cloud.vision.v1p3beta1.Page\x12\x0c\n\x04text\x18\x02 \x01(\t\x1a=\n\x10\x44\x65tectedLanguage\x12\x15\n\rlanguage_code\x18\x01 \x01(\t\x12\x12\n\nconfidence\x18\x02 \x01(\x02\x1a\xdc\x01\n\rDetectedBreak\x12S\n\x04type\x18\x01 \x01(\x0e\x32\x45.google.cloud.vision.v1p3beta1.TextAnnotation.DetectedBreak.BreakType\x12\x11\n\tis_prefix\x18\x02 \x01(\x08\"c\n\tBreakType\x12\x0b\n\x07UNKNOWN\x10\x00\x12\t\n\x05SPACE\x10\x01\x12\x0e\n\nSURE_SPACE\x10\x02\x12\x12\n\x0e\x45OL_SURE_SPACE\x10\x03\x12\n\n\x06HYPHEN\x10\x04\x12\x0e\n\nLINE_BREAK\x10\x05\x1a\xbf\x01\n\x0cTextProperty\x12Z\n\x12\x64\x65tected_languages\x18\x01 \x03(\x0b\x32>.google.cloud.vision.v1p3beta1.TextAnnotation.DetectedLanguage\x12S\n\x0e\x64\x65tected_break\x18\x02 \x01(\x0b\x32;.google.cloud.vision.v1p3beta1.TextAnnotation.DetectedBreak\"\xbd\x01\n\x04Page\x12L\n\x08property\x18\x01 \x01(\x0b\x32:.google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty\x12\r\n\x05width\x18\x02 \x01(\x05\x12\x0e\n\x06height\x18\x03 \x01(\x05\x12\x34\n\x06\x62locks\x18\x04 \x03(\x0b\x32$.google.cloud.vision.v1p3beta1.Block\x12\x12\n\nconfidence\x18\x05 \x01(\x02\"\x82\x03\n\x05\x42lock\x12L\n\x08property\x18\x01 \x01(\x0b\x32:.google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty\x12\x41\n\x0c\x62ounding_box\x18\x02 \x01(\x0b\x32+.google.cloud.vision.v1p3beta1.BoundingPoly\x12<\n\nparagraphs\x18\x03 \x03(\x0b\x32(.google.cloud.vision.v1p3beta1.Paragraph\x12\x42\n\nblock_type\x18\x04 \x01(\x0e\x32..google.cloud.vision.v1p3beta1.Block.BlockType\x12\x12\n\nconfidence\x18\x05 \x01(\x02\"R\n\tBlockType\x12\x0b\n\x07UNKNOWN\x10\x00\x12\x08\n\x04TEXT\x10\x01\x12\t\n\x05TABLE\x10\x02\x12\x0b\n\x07PICTURE\x10\x03\x12\t\n\x05RULER\x10\x04\x12\x0b\n\x07\x42\x41RCODE\x10\x05\"\xe4\x01\n\tParagraph\x12L\n\x08property\x18\x01 \x01(\x0b\x32:.google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty\x12\x41\n\x0c\x62ounding_box\x18\x02 \x01(\x0b\x32+.google.cloud.vision.v1p3beta1.BoundingPoly\x12\x32\n\x05words\x18\x03 \x03(\x0b\x32#.google.cloud.vision.v1p3beta1.Word\x12\x12\n\nconfidence\x18\x04 \x01(\x02\"\xe3\x01\n\x04Word\x12L\n\x08property\x18\x01 \x01(\x0b\x32:.google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty\x12\x41\n\x0c\x62ounding_box\x18\x02 \x01(\x0b\x32+.google.cloud.vision.v1p3beta1.BoundingPoly\x12\x36\n\x07symbols\x18\x03 \x03(\x0b\x32%.google.cloud.vision.v1p3beta1.Symbol\x12\x12\n\nconfidence\x18\x04 \x01(\x02\"\xbb\x01\n\x06Symbol\x12L\n\x08property\x18\x01 \x01(\x0b\x32:.google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty\x12\x41\n\x0c\x62ounding_box\x18\x02 \x01(\x0b\x32+.google.cloud.vision.v1p3beta1.BoundingPoly\x12\x0c\n\x04text\x18\x03 \x01(\t\x12\x12\n\nconfidence\x18\x04 \x01(\x02\x42x\n!com.google.cloud.vision.v1p3beta1B\x13TextAnnotationProtoP\x01Z9cloud.google.com/go/vision/apiv1p3beta1/visionpb;visionpb\xf8\x01\x01\x62\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module Vision - module V1p3beta1 - TextAnnotation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p3beta1.TextAnnotation").msgclass - TextAnnotation::DetectedLanguage = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p3beta1.TextAnnotation.DetectedLanguage").msgclass - TextAnnotation::DetectedBreak = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p3beta1.TextAnnotation.DetectedBreak").msgclass - TextAnnotation::DetectedBreak::BreakType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p3beta1.TextAnnotation.DetectedBreak.BreakType").enummodule - TextAnnotation::TextProperty = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty").msgclass - Page = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p3beta1.Page").msgclass - Block = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p3beta1.Block").msgclass - Block::BlockType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p3beta1.Block.BlockType").enummodule - Paragraph = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p3beta1.Paragraph").msgclass - Word = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p3beta1.Word").msgclass - Symbol = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p3beta1.Symbol").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-vision-v1p3beta1/lib/google/cloud/vision/v1p3beta1/version.rb b/owl-bot-staging/google-cloud-vision-v1p3beta1/lib/google/cloud/vision/v1p3beta1/version.rb deleted file mode 100644 index d81d32458c35..000000000000 --- a/owl-bot-staging/google-cloud-vision-v1p3beta1/lib/google/cloud/vision/v1p3beta1/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 Vision - module V1p3beta1 - VERSION = "0.0.1" - end - end - end -end diff --git a/owl-bot-staging/google-cloud-vision-v1p3beta1/lib/google/cloud/vision/v1p3beta1/web_detection_pb.rb b/owl-bot-staging/google-cloud-vision-v1p3beta1/lib/google/cloud/vision/v1p3beta1/web_detection_pb.rb deleted file mode 100644 index fbf1cce38347..000000000000 --- a/owl-bot-staging/google-cloud-vision-v1p3beta1/lib/google/cloud/vision/v1p3beta1/web_detection_pb.rb +++ /dev/null @@ -1,25 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/vision/v1p3beta1/web_detection.proto - -require 'google/protobuf' - - -descriptor_data = "\n1google/cloud/vision/v1p3beta1/web_detection.proto\x12\x1dgoogle.cloud.vision.v1p3beta1\"\x8c\x07\n\x0cWebDetection\x12K\n\x0cweb_entities\x18\x01 \x03(\x0b\x32\x35.google.cloud.vision.v1p3beta1.WebDetection.WebEntity\x12R\n\x14\x66ull_matching_images\x18\x02 \x03(\x0b\x32\x34.google.cloud.vision.v1p3beta1.WebDetection.WebImage\x12U\n\x17partial_matching_images\x18\x03 \x03(\x0b\x32\x34.google.cloud.vision.v1p3beta1.WebDetection.WebImage\x12W\n\x1apages_with_matching_images\x18\x04 \x03(\x0b\x32\x33.google.cloud.vision.v1p3beta1.WebDetection.WebPage\x12U\n\x17visually_similar_images\x18\x06 \x03(\x0b\x32\x34.google.cloud.vision.v1p3beta1.WebDetection.WebImage\x12O\n\x11\x62\x65st_guess_labels\x18\x08 \x03(\x0b\x32\x34.google.cloud.vision.v1p3beta1.WebDetection.WebLabel\x1a\x42\n\tWebEntity\x12\x11\n\tentity_id\x18\x01 \x01(\t\x12\r\n\x05score\x18\x02 \x01(\x02\x12\x13\n\x0b\x64\x65scription\x18\x03 \x01(\t\x1a&\n\x08WebImage\x12\x0b\n\x03url\x18\x01 \x01(\t\x12\r\n\x05score\x18\x02 \x01(\x02\x1a\xe4\x01\n\x07WebPage\x12\x0b\n\x03url\x18\x01 \x01(\t\x12\r\n\x05score\x18\x02 \x01(\x02\x12\x12\n\npage_title\x18\x03 \x01(\t\x12R\n\x14\x66ull_matching_images\x18\x04 \x03(\x0b\x32\x34.google.cloud.vision.v1p3beta1.WebDetection.WebImage\x12U\n\x17partial_matching_images\x18\x05 \x03(\x0b\x32\x34.google.cloud.vision.v1p3beta1.WebDetection.WebImage\x1a\x30\n\x08WebLabel\x12\r\n\x05label\x18\x01 \x01(\t\x12\x15\n\rlanguage_code\x18\x02 \x01(\tBv\n!com.google.cloud.vision.v1p3beta1B\x11WebDetectionProtoP\x01Z9cloud.google.com/go/vision/apiv1p3beta1/visionpb;visionpb\xf8\x01\x01\x62\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module Vision - module V1p3beta1 - WebDetection = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p3beta1.WebDetection").msgclass - WebDetection::WebEntity = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p3beta1.WebDetection.WebEntity").msgclass - WebDetection::WebImage = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p3beta1.WebDetection.WebImage").msgclass - WebDetection::WebPage = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p3beta1.WebDetection.WebPage").msgclass - WebDetection::WebLabel = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p3beta1.WebDetection.WebLabel").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-vision-v1p3beta1/proto_docs/README.md b/owl-bot-staging/google-cloud-vision-v1p3beta1/proto_docs/README.md deleted file mode 100644 index 686393024ffb..000000000000 --- a/owl-bot-staging/google-cloud-vision-v1p3beta1/proto_docs/README.md +++ /dev/null @@ -1,4 +0,0 @@ -# Cloud Vision V1p3beta1 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-vision-v1p3beta1/proto_docs/google/api/client.rb b/owl-bot-staging/google-cloud-vision-v1p3beta1/proto_docs/google/api/client.rb deleted file mode 100644 index 3ab0b096d445..000000000000 --- a/owl-bot-staging/google-cloud-vision-v1p3beta1/proto_docs/google/api/client.rb +++ /dev/null @@ -1,593 +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. - # - # Note: This field should not be used in most cases. - 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: - # library_settings: - # 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. - # @!attribute [rw] library_package - # @return [::String] - # The package name to use in Php. Clobbers the php_namespace option - # set in the protobuf. This should be used **only** by APIs - # who have already set the language_settings.php.package_name" field - # in gapic.yaml. API teams should use the protobuf php_namespace option - # where possible. - # - # Example of a YAML configuration:: - # - # publishing: - # library_settings: - # php_settings: - # library_package: Google\Cloud\PubSub\V1 - 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. - # - # Example: - # - # 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 - # @!attribute [rw] batching - # @return [::Google::Api::BatchingConfigProto] - # Batching configuration for an API method in client libraries. - # - # Example of a YAML configuration: - # - # publishing: - # method_settings: - # - selector: google.example.v1.ExampleService.BatchCreateExample - # batching: - # element_count_threshold: 1000 - # request_byte_threshold: 100000000 - # delay_threshold_millis: 10 - 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. - # - # Note: This feature should not be used in most cases. - # @!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 - - # `BatchingConfigProto` defines the batching configuration for an API method. - # @!attribute [rw] thresholds - # @return [::Google::Api::BatchingSettingsProto] - # The thresholds which trigger a batched request to be sent. - # @!attribute [rw] batch_descriptor - # @return [::Google::Api::BatchingDescriptorProto] - # The request and response fields used in batching. - class BatchingConfigProto - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # `BatchingSettingsProto` specifies a set of batching thresholds, each of - # which acts as a trigger to send a batch of messages as a request. At least - # one threshold must be positive nonzero. - # @!attribute [rw] element_count_threshold - # @return [::Integer] - # The number of elements of a field collected into a batch which, if - # exceeded, causes the batch to be sent. - # @!attribute [rw] request_byte_threshold - # @return [::Integer] - # The aggregated size of the batched field which, if exceeded, causes the - # batch to be sent. This size is computed by aggregating the sizes of the - # request field to be batched, not of the entire request message. - # @!attribute [rw] delay_threshold - # @return [::Google::Protobuf::Duration] - # The duration after which a batch should be sent, starting from the addition - # of the first message to that batch. - # @!attribute [rw] element_count_limit - # @return [::Integer] - # The maximum number of elements collected in a batch that could be accepted - # by server. - # @!attribute [rw] request_byte_limit - # @return [::Integer] - # The maximum size of the request that could be accepted by server. - # @!attribute [rw] flow_control_element_limit - # @return [::Integer] - # The maximum number of elements allowed by flow control. - # @!attribute [rw] flow_control_byte_limit - # @return [::Integer] - # The maximum size of data allowed by flow control. - # @!attribute [rw] flow_control_limit_exceeded_behavior - # @return [::Google::Api::FlowControlLimitExceededBehaviorProto] - # The behavior to take when the flow control limit is exceeded. - class BatchingSettingsProto - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # `BatchingDescriptorProto` specifies the fields of the request message to be - # used for batching, and, optionally, the fields of the response message to be - # used for demultiplexing. - # @!attribute [rw] batched_field - # @return [::String] - # The repeated field in the request message to be aggregated by batching. - # @!attribute [rw] discriminator_fields - # @return [::Array<::String>] - # A list of the fields in the request message. Two requests will be batched - # together only if the values of every field specified in - # `request_discriminator_fields` is equal between the two requests. - # @!attribute [rw] subresponse_field - # @return [::String] - # Optional. When present, indicates the field in the response message to be - # used to demultiplex the response into multiple response messages, in - # correspondence with the multiple request messages originally batched - # together. - class BatchingDescriptorProto - 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 - - # The behavior to take when the flow control limit is exceeded. - module FlowControlLimitExceededBehaviorProto - # Default behavior, system-defined. - UNSET_BEHAVIOR = 0 - - # Stop operation, raise error. - THROW_EXCEPTION = 1 - - # Pause operation until limit clears. - BLOCK = 2 - - # Continue operation, disregard limit. - IGNORE = 3 - end - end -end diff --git a/owl-bot-staging/google-cloud-vision-v1p3beta1/proto_docs/google/api/field_behavior.rb b/owl-bot-staging/google-cloud-vision-v1p3beta1/proto_docs/google/api/field_behavior.rb deleted file mode 100644 index 582be187d115..000000000000 --- a/owl-bot-staging/google-cloud-vision-v1p3beta1/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-vision-v1p3beta1/proto_docs/google/api/launch_stage.rb b/owl-bot-staging/google-cloud-vision-v1p3beta1/proto_docs/google/api/launch_stage.rb deleted file mode 100644 index 9392a413fb1b..000000000000 --- a/owl-bot-staging/google-cloud-vision-v1p3beta1/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-vision-v1p3beta1/proto_docs/google/api/resource.rb b/owl-bot-staging/google-cloud-vision-v1p3beta1/proto_docs/google/api/resource.rb deleted file mode 100644 index 25dec4847ac1..000000000000 --- a/owl-bot-staging/google-cloud-vision-v1p3beta1/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-vision-v1p3beta1/proto_docs/google/cloud/vision/v1p3beta1/geometry.rb b/owl-bot-staging/google-cloud-vision-v1p3beta1/proto_docs/google/cloud/vision/v1p3beta1/geometry.rb deleted file mode 100644 index 0c3bbeb9aaa4..000000000000 --- a/owl-bot-staging/google-cloud-vision-v1p3beta1/proto_docs/google/cloud/vision/v1p3beta1/geometry.rb +++ /dev/null @@ -1,82 +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 Vision - module V1p3beta1 - # A vertex represents a 2D point in the image. - # NOTE: the vertex coordinates are in the same scale as the original image. - # @!attribute [rw] x - # @return [::Integer] - # X coordinate. - # @!attribute [rw] y - # @return [::Integer] - # Y coordinate. - class Vertex - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A vertex represents a 2D point in the image. - # NOTE: the normalized vertex coordinates are relative to the original image - # and range from 0 to 1. - # @!attribute [rw] x - # @return [::Float] - # X coordinate. - # @!attribute [rw] y - # @return [::Float] - # Y coordinate. - class NormalizedVertex - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A bounding polygon for the detected image annotation. - # @!attribute [rw] vertices - # @return [::Array<::Google::Cloud::Vision::V1p3beta1::Vertex>] - # The bounding polygon vertices. - # @!attribute [rw] normalized_vertices - # @return [::Array<::Google::Cloud::Vision::V1p3beta1::NormalizedVertex>] - # The bounding polygon normalized vertices. - class BoundingPoly - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A 3D position in the image, used primarily for Face detection landmarks. - # A valid Position must have both x and y coordinates. - # The position coordinates are in the same scale as the original image. - # @!attribute [rw] x - # @return [::Float] - # X coordinate. - # @!attribute [rw] y - # @return [::Float] - # Y coordinate. - # @!attribute [rw] z - # @return [::Float] - # Z coordinate (or depth). - class Position - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-vision-v1p3beta1/proto_docs/google/cloud/vision/v1p3beta1/image_annotator.rb b/owl-bot-staging/google-cloud-vision-v1p3beta1/proto_docs/google/cloud/vision/v1p3beta1/image_annotator.rb deleted file mode 100644 index e69372467857..000000000000 --- a/owl-bot-staging/google-cloud-vision-v1p3beta1/proto_docs/google/cloud/vision/v1p3beta1/image_annotator.rb +++ /dev/null @@ -1,888 +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 Vision - module V1p3beta1 - # The type of Google Cloud Vision API detection to perform, and the maximum - # number of results to return for that type. Multiple `Feature` objects can - # be specified in the `features` list. - # @!attribute [rw] type - # @return [::Google::Cloud::Vision::V1p3beta1::Feature::Type] - # The feature type. - # @!attribute [rw] max_results - # @return [::Integer] - # Maximum number of results of this type. Does not apply to - # `TEXT_DETECTION`, `DOCUMENT_TEXT_DETECTION`, or `CROP_HINTS`. - # @!attribute [rw] model - # @return [::String] - # Model to use for the feature. - # Supported values: "builtin/stable" (the default if unset) and - # "builtin/latest". `DOCUMENT_TEXT_DETECTION` and `TEXT_DETECTION` also - # support "builtin/weekly" for the bleeding edge release updated weekly. - class Feature - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Type of Google Cloud Vision API feature to be extracted. - module Type - # Unspecified feature type. - TYPE_UNSPECIFIED = 0 - - # Run face detection. - FACE_DETECTION = 1 - - # Run landmark detection. - LANDMARK_DETECTION = 2 - - # Run logo detection. - LOGO_DETECTION = 3 - - # Run label detection. - LABEL_DETECTION = 4 - - # Run text detection / optical character recognition (OCR). Text detection - # is optimized for areas of text within a larger image; if the image is - # a document, use `DOCUMENT_TEXT_DETECTION` instead. - TEXT_DETECTION = 5 - - # Run dense text document OCR. Takes precedence when both - # `DOCUMENT_TEXT_DETECTION` and `TEXT_DETECTION` are present. - DOCUMENT_TEXT_DETECTION = 11 - - # Run Safe Search to detect potentially unsafe - # or undesirable content. - SAFE_SEARCH_DETECTION = 6 - - # Compute a set of image properties, such as the - # image's dominant colors. - IMAGE_PROPERTIES = 7 - - # Run crop hints. - CROP_HINTS = 9 - - # Run web detection. - WEB_DETECTION = 10 - - # Run Product Search. - PRODUCT_SEARCH = 12 - - # Run localizer for object detection. - OBJECT_LOCALIZATION = 19 - end - end - - # External image source (Google Cloud Storage or web URL image location). - # @!attribute [rw] gcs_image_uri - # @return [::String] - # **Use `image_uri` instead.** - # - # The Google Cloud Storage URI of the form - # `gs://bucket_name/object_name`. Object versioning is not supported. See - # [Google Cloud Storage Request - # URIs](https://cloud.google.com/storage/docs/reference-uris) for more info. - # @!attribute [rw] image_uri - # @return [::String] - # The URI of the source image. Can be either: - # - # 1. A Google Cloud Storage URI of the form - # `gs://bucket_name/object_name`. Object versioning is not supported. See - # [Google Cloud Storage Request - # URIs](https://cloud.google.com/storage/docs/reference-uris) for more - # info. - # - # 2. A publicly-accessible image HTTP/HTTPS URL. When fetching images from - # HTTP/HTTPS URLs, Google cannot guarantee that the request will be - # completed. Your request may fail if the specified host denies the - # request (e.g. due to request throttling or DOS prevention), or if Google - # throttles requests to the site for abuse prevention. You should not - # depend on externally-hosted images for production applications. - # - # When both `gcs_image_uri` and `image_uri` are specified, `image_uri` takes - # precedence. - class ImageSource - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Client image to perform Google Cloud Vision API tasks over. - # @!attribute [rw] content - # @return [::String] - # Image content, represented as a stream of bytes. - # Note: As with all `bytes` fields, protobuffers use a pure binary - # representation, whereas JSON representations use base64. - # @!attribute [rw] source - # @return [::Google::Cloud::Vision::V1p3beta1::ImageSource] - # Google Cloud Storage image location, or publicly-accessible image - # URL. If both `content` and `source` are provided for an image, `content` - # takes precedence and is used to perform the image annotation request. - class Image - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A face annotation object contains the results of face detection. - # @!attribute [rw] bounding_poly - # @return [::Google::Cloud::Vision::V1p3beta1::BoundingPoly] - # The bounding polygon around the face. The coordinates of the bounding box - # are in the original image's scale, as returned in `ImageParams`. - # The bounding box is computed to "frame" the face in accordance with human - # expectations. It is based on the landmarker results. - # Note that one or more x and/or y coordinates may not be generated in the - # `BoundingPoly` (the polygon will be unbounded) if only a partial face - # appears in the image to be annotated. - # @!attribute [rw] fd_bounding_poly - # @return [::Google::Cloud::Vision::V1p3beta1::BoundingPoly] - # The `fd_bounding_poly` bounding polygon is tighter than the - # `boundingPoly`, and encloses only the skin part of the face. Typically, it - # is used to eliminate the face from any image analysis that detects the - # "amount of skin" visible in an image. It is not based on the - # landmarker results, only on the initial face detection, hence - # the fd (face detection) prefix. - # @!attribute [rw] landmarks - # @return [::Array<::Google::Cloud::Vision::V1p3beta1::FaceAnnotation::Landmark>] - # Detected face landmarks. - # @!attribute [rw] roll_angle - # @return [::Float] - # Roll angle, which indicates the amount of clockwise/anti-clockwise rotation - # of the face relative to the image vertical about the axis perpendicular to - # the face. Range [-180,180]. - # @!attribute [rw] pan_angle - # @return [::Float] - # Yaw angle, which indicates the leftward/rightward angle that the face is - # pointing relative to the vertical plane perpendicular to the image. Range - # [-180,180]. - # @!attribute [rw] tilt_angle - # @return [::Float] - # Pitch angle, which indicates the upwards/downwards angle that the face is - # pointing relative to the image's horizontal plane. Range [-180,180]. - # @!attribute [rw] detection_confidence - # @return [::Float] - # Detection confidence. Range [0, 1]. - # @!attribute [rw] landmarking_confidence - # @return [::Float] - # Face landmarking confidence. Range [0, 1]. - # @!attribute [rw] joy_likelihood - # @return [::Google::Cloud::Vision::V1p3beta1::Likelihood] - # Joy likelihood. - # @!attribute [rw] sorrow_likelihood - # @return [::Google::Cloud::Vision::V1p3beta1::Likelihood] - # Sorrow likelihood. - # @!attribute [rw] anger_likelihood - # @return [::Google::Cloud::Vision::V1p3beta1::Likelihood] - # Anger likelihood. - # @!attribute [rw] surprise_likelihood - # @return [::Google::Cloud::Vision::V1p3beta1::Likelihood] - # Surprise likelihood. - # @!attribute [rw] under_exposed_likelihood - # @return [::Google::Cloud::Vision::V1p3beta1::Likelihood] - # Under-exposed likelihood. - # @!attribute [rw] blurred_likelihood - # @return [::Google::Cloud::Vision::V1p3beta1::Likelihood] - # Blurred likelihood. - # @!attribute [rw] headwear_likelihood - # @return [::Google::Cloud::Vision::V1p3beta1::Likelihood] - # Headwear likelihood. - class FaceAnnotation - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # A face-specific landmark (for example, a face feature). - # @!attribute [rw] type - # @return [::Google::Cloud::Vision::V1p3beta1::FaceAnnotation::Landmark::Type] - # Face landmark type. - # @!attribute [rw] position - # @return [::Google::Cloud::Vision::V1p3beta1::Position] - # Face landmark position. - class Landmark - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Face landmark (feature) type. - # Left and right are defined from the vantage of the viewer of the image - # without considering mirror projections typical of photos. So, `LEFT_EYE`, - # typically, is the person's right eye. - module Type - # Unknown face landmark detected. Should not be filled. - UNKNOWN_LANDMARK = 0 - - # Left eye. - LEFT_EYE = 1 - - # Right eye. - RIGHT_EYE = 2 - - # Left of left eyebrow. - LEFT_OF_LEFT_EYEBROW = 3 - - # Right of left eyebrow. - RIGHT_OF_LEFT_EYEBROW = 4 - - # Left of right eyebrow. - LEFT_OF_RIGHT_EYEBROW = 5 - - # Right of right eyebrow. - RIGHT_OF_RIGHT_EYEBROW = 6 - - # Midpoint between eyes. - MIDPOINT_BETWEEN_EYES = 7 - - # Nose tip. - NOSE_TIP = 8 - - # Upper lip. - UPPER_LIP = 9 - - # Lower lip. - LOWER_LIP = 10 - - # Mouth left. - MOUTH_LEFT = 11 - - # Mouth right. - MOUTH_RIGHT = 12 - - # Mouth center. - MOUTH_CENTER = 13 - - # Nose, bottom right. - NOSE_BOTTOM_RIGHT = 14 - - # Nose, bottom left. - NOSE_BOTTOM_LEFT = 15 - - # Nose, bottom center. - NOSE_BOTTOM_CENTER = 16 - - # Left eye, top boundary. - LEFT_EYE_TOP_BOUNDARY = 17 - - # Left eye, right corner. - LEFT_EYE_RIGHT_CORNER = 18 - - # Left eye, bottom boundary. - LEFT_EYE_BOTTOM_BOUNDARY = 19 - - # Left eye, left corner. - LEFT_EYE_LEFT_CORNER = 20 - - # Right eye, top boundary. - RIGHT_EYE_TOP_BOUNDARY = 21 - - # Right eye, right corner. - RIGHT_EYE_RIGHT_CORNER = 22 - - # Right eye, bottom boundary. - RIGHT_EYE_BOTTOM_BOUNDARY = 23 - - # Right eye, left corner. - RIGHT_EYE_LEFT_CORNER = 24 - - # Left eyebrow, upper midpoint. - LEFT_EYEBROW_UPPER_MIDPOINT = 25 - - # Right eyebrow, upper midpoint. - RIGHT_EYEBROW_UPPER_MIDPOINT = 26 - - # Left ear tragion. - LEFT_EAR_TRAGION = 27 - - # Right ear tragion. - RIGHT_EAR_TRAGION = 28 - - # Left eye pupil. - LEFT_EYE_PUPIL = 29 - - # Right eye pupil. - RIGHT_EYE_PUPIL = 30 - - # Forehead glabella. - FOREHEAD_GLABELLA = 31 - - # Chin gnathion. - CHIN_GNATHION = 32 - - # Chin left gonion. - CHIN_LEFT_GONION = 33 - - # Chin right gonion. - CHIN_RIGHT_GONION = 34 - end - end - end - - # Detected entity location information. - # @!attribute [rw] lat_lng - # @return [::Google::Type::LatLng] - # lat/long location coordinates. - class LocationInfo - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A `Property` consists of a user-supplied name/value pair. - # @!attribute [rw] name - # @return [::String] - # Name of the property. - # @!attribute [rw] value - # @return [::String] - # Value of the property. - # @!attribute [rw] uint64_value - # @return [::Integer] - # Value of numeric properties. - class Property - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Set of detected entity features. - # @!attribute [rw] mid - # @return [::String] - # Opaque entity ID. Some IDs may be available in - # [Google Knowledge Graph Search - # API](https://developers.google.com/knowledge-graph/). - # @!attribute [rw] locale - # @return [::String] - # The language code for the locale in which the entity textual - # `description` is expressed. - # @!attribute [rw] description - # @return [::String] - # Entity textual description, expressed in its `locale` language. - # @!attribute [rw] score - # @return [::Float] - # Overall score of the result. Range [0, 1]. - # @!attribute [rw] confidence - # @return [::Float] - # **Deprecated. Use `score` instead.** - # The accuracy of the entity detection in an image. - # For example, for an image in which the "Eiffel Tower" entity is detected, - # this field represents the confidence that there is a tower in the query - # image. Range [0, 1]. - # @!attribute [rw] topicality - # @return [::Float] - # The relevancy of the ICA (Image Content Annotation) label to the - # image. For example, the relevancy of "tower" is likely higher to an image - # containing the detected "Eiffel Tower" than to an image containing a - # detected distant towering building, even though the confidence that - # there is a tower in each image may be the same. Range [0, 1]. - # @!attribute [rw] bounding_poly - # @return [::Google::Cloud::Vision::V1p3beta1::BoundingPoly] - # Image region to which this entity belongs. Not produced - # for `LABEL_DETECTION` features. - # @!attribute [rw] locations - # @return [::Array<::Google::Cloud::Vision::V1p3beta1::LocationInfo>] - # The location information for the detected entity. Multiple - # `LocationInfo` elements can be present because one location may - # indicate the location of the scene in the image, and another location - # may indicate the location of the place where the image was taken. - # Location information is usually present for landmarks. - # @!attribute [rw] properties - # @return [::Array<::Google::Cloud::Vision::V1p3beta1::Property>] - # Some entities may have optional user-supplied `Property` (name/value) - # fields, such a score or string that qualifies the entity. - class EntityAnnotation - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Set of detected objects with bounding boxes. - # @!attribute [rw] mid - # @return [::String] - # Object ID that should align with EntityAnnotation mid. - # @!attribute [rw] language_code - # @return [::String] - # The BCP-47 language code, such as "en-US" or "sr-Latn". For more - # information, see - # http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. - # @!attribute [rw] name - # @return [::String] - # Object name, expressed in its `language_code` language. - # @!attribute [rw] score - # @return [::Float] - # Score of the result. Range [0, 1]. - # @!attribute [rw] bounding_poly - # @return [::Google::Cloud::Vision::V1p3beta1::BoundingPoly] - # Image region to which this object belongs. This must be populated. - class LocalizedObjectAnnotation - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Set of features pertaining to the image, computed by computer vision - # methods over safe-search verticals (for example, adult, spoof, medical, - # violence). - # @!attribute [rw] adult - # @return [::Google::Cloud::Vision::V1p3beta1::Likelihood] - # Represents the adult content likelihood for the image. Adult content may - # contain elements such as nudity, pornographic images or cartoons, or - # sexual activities. - # @!attribute [rw] spoof - # @return [::Google::Cloud::Vision::V1p3beta1::Likelihood] - # Spoof likelihood. The likelihood that an modification - # was made to the image's canonical version to make it appear - # funny or offensive. - # @!attribute [rw] medical - # @return [::Google::Cloud::Vision::V1p3beta1::Likelihood] - # Likelihood that this is a medical image. - # @!attribute [rw] violence - # @return [::Google::Cloud::Vision::V1p3beta1::Likelihood] - # Likelihood that this image contains violent content. - # @!attribute [rw] racy - # @return [::Google::Cloud::Vision::V1p3beta1::Likelihood] - # Likelihood that the request image contains racy content. Racy content may - # include (but is not limited to) skimpy or sheer clothing, strategically - # covered nudity, lewd or provocative poses, or close-ups of sensitive - # body areas. - class SafeSearchAnnotation - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Rectangle determined by min and max `LatLng` pairs. - # @!attribute [rw] min_lat_lng - # @return [::Google::Type::LatLng] - # Min lat/long pair. - # @!attribute [rw] max_lat_lng - # @return [::Google::Type::LatLng] - # Max lat/long pair. - class LatLongRect - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Color information consists of RGB channels, score, and the fraction of - # the image that the color occupies in the image. - # @!attribute [rw] color - # @return [::Google::Type::Color] - # RGB components of the color. - # @!attribute [rw] score - # @return [::Float] - # Image-specific score for this color. Value in range [0, 1]. - # @!attribute [rw] pixel_fraction - # @return [::Float] - # The fraction of pixels the color occupies in the image. - # Value in range [0, 1]. - class ColorInfo - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Set of dominant colors and their corresponding scores. - # @!attribute [rw] colors - # @return [::Array<::Google::Cloud::Vision::V1p3beta1::ColorInfo>] - # RGB color values with their score and pixel fraction. - class DominantColorsAnnotation - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Stores image properties, such as dominant colors. - # @!attribute [rw] dominant_colors - # @return [::Google::Cloud::Vision::V1p3beta1::DominantColorsAnnotation] - # If present, dominant colors completed successfully. - class ImageProperties - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Single crop hint that is used to generate a new crop when serving an image. - # @!attribute [rw] bounding_poly - # @return [::Google::Cloud::Vision::V1p3beta1::BoundingPoly] - # The bounding polygon for the crop region. The coordinates of the bounding - # box are in the original image's scale, as returned in `ImageParams`. - # @!attribute [rw] confidence - # @return [::Float] - # Confidence of this being a salient region. Range [0, 1]. - # @!attribute [rw] importance_fraction - # @return [::Float] - # Fraction of importance of this salient region with respect to the original - # image. - class CropHint - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Set of crop hints that are used to generate new crops when serving images. - # @!attribute [rw] crop_hints - # @return [::Array<::Google::Cloud::Vision::V1p3beta1::CropHint>] - # Crop hint results. - class CropHintsAnnotation - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Parameters for crop hints annotation request. - # @!attribute [rw] aspect_ratios - # @return [::Array<::Float>] - # Aspect ratios in floats, representing the ratio of the width to the height - # of the image. For example, if the desired aspect ratio is 4/3, the - # corresponding float value should be 1.33333. If not specified, the - # best possible crop is returned. The number of provided aspect ratios is - # limited to a maximum of 16; any aspect ratios provided after the 16th are - # ignored. - class CropHintsParams - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Parameters for web detection request. - # @!attribute [rw] include_geo_results - # @return [::Boolean] - # Whether to include results derived from the geo information in the image. - class WebDetectionParams - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Parameters for text detections. This is used to control TEXT_DETECTION and - # DOCUMENT_TEXT_DETECTION features. - # @!attribute [rw] enable_text_detection_confidence_score - # @return [::Boolean] - # By default, Cloud Vision API only includes confidence score for - # DOCUMENT_TEXT_DETECTION result. Set the flag to true to include confidence - # score for TEXT_DETECTION as well. - # @!attribute [rw] advanced_ocr_options - # @return [::Array<::String>] - # A list of advanced OCR options to fine-tune OCR behavior. - class TextDetectionParams - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Image context and/or feature-specific parameters. - # @!attribute [rw] lat_long_rect - # @return [::Google::Cloud::Vision::V1p3beta1::LatLongRect] - # Not used. - # @!attribute [rw] language_hints - # @return [::Array<::String>] - # List of languages to use for TEXT_DETECTION. In most cases, an empty value - # yields the best results since it enables automatic language detection. For - # languages based on the Latin alphabet, setting `language_hints` is not - # needed. In rare cases, when the language of the text in the image is known, - # setting a hint will help get better results (although it will be a - # significant hindrance if the hint is wrong). Text detection returns an - # error if one or more of the specified languages is not one of the - # [supported languages](https://cloud.google.com/vision/docs/languages). - # @!attribute [rw] crop_hints_params - # @return [::Google::Cloud::Vision::V1p3beta1::CropHintsParams] - # Parameters for crop hints annotation request. - # @!attribute [rw] product_search_params - # @return [::Google::Cloud::Vision::V1p3beta1::ProductSearchParams] - # Parameters for product search. - # @!attribute [rw] web_detection_params - # @return [::Google::Cloud::Vision::V1p3beta1::WebDetectionParams] - # Parameters for web detection. - # @!attribute [rw] text_detection_params - # @return [::Google::Cloud::Vision::V1p3beta1::TextDetectionParams] - # Parameters for text detection and document text detection. - class ImageContext - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request for performing Google Cloud Vision API tasks over a user-provided - # image, with user-requested features. - # @!attribute [rw] image - # @return [::Google::Cloud::Vision::V1p3beta1::Image] - # The image to be processed. - # @!attribute [rw] features - # @return [::Array<::Google::Cloud::Vision::V1p3beta1::Feature>] - # Requested features. - # @!attribute [rw] image_context - # @return [::Google::Cloud::Vision::V1p3beta1::ImageContext] - # Additional context that may accompany the image. - class AnnotateImageRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # If an image was produced from a file (e.g. a PDF), this message gives - # information about the source of that image. - # @!attribute [rw] uri - # @return [::String] - # The URI of the file used to produce the image. - # @!attribute [rw] page_number - # @return [::Integer] - # If the file was a PDF or TIFF, this field gives the page number within - # the file used to produce the image. - class ImageAnnotationContext - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response to an image annotation request. - # @!attribute [rw] face_annotations - # @return [::Array<::Google::Cloud::Vision::V1p3beta1::FaceAnnotation>] - # If present, face detection has completed successfully. - # @!attribute [rw] landmark_annotations - # @return [::Array<::Google::Cloud::Vision::V1p3beta1::EntityAnnotation>] - # If present, landmark detection has completed successfully. - # @!attribute [rw] logo_annotations - # @return [::Array<::Google::Cloud::Vision::V1p3beta1::EntityAnnotation>] - # If present, logo detection has completed successfully. - # @!attribute [rw] label_annotations - # @return [::Array<::Google::Cloud::Vision::V1p3beta1::EntityAnnotation>] - # If present, label detection has completed successfully. - # @!attribute [rw] localized_object_annotations - # @return [::Array<::Google::Cloud::Vision::V1p3beta1::LocalizedObjectAnnotation>] - # If present, localized object detection has completed successfully. - # This will be sorted descending by confidence score. - # @!attribute [rw] text_annotations - # @return [::Array<::Google::Cloud::Vision::V1p3beta1::EntityAnnotation>] - # If present, text (OCR) detection has completed successfully. - # @!attribute [rw] full_text_annotation - # @return [::Google::Cloud::Vision::V1p3beta1::TextAnnotation] - # If present, text (OCR) detection or document (OCR) text detection has - # completed successfully. - # This annotation provides the structural hierarchy for the OCR detected - # text. - # @!attribute [rw] safe_search_annotation - # @return [::Google::Cloud::Vision::V1p3beta1::SafeSearchAnnotation] - # If present, safe-search annotation has completed successfully. - # @!attribute [rw] image_properties_annotation - # @return [::Google::Cloud::Vision::V1p3beta1::ImageProperties] - # If present, image properties were extracted successfully. - # @!attribute [rw] crop_hints_annotation - # @return [::Google::Cloud::Vision::V1p3beta1::CropHintsAnnotation] - # If present, crop hints have completed successfully. - # @!attribute [rw] web_detection - # @return [::Google::Cloud::Vision::V1p3beta1::WebDetection] - # If present, web detection has completed successfully. - # @!attribute [rw] product_search_results - # @return [::Google::Cloud::Vision::V1p3beta1::ProductSearchResults] - # If present, product search has completed successfully. - # @!attribute [rw] error - # @return [::Google::Rpc::Status] - # If set, represents the error message for the operation. - # Note that filled-in image annotations are guaranteed to be - # correct, even when `error` is set. - # @!attribute [rw] context - # @return [::Google::Cloud::Vision::V1p3beta1::ImageAnnotationContext] - # If present, contextual information is needed to understand where this image - # comes from. - class AnnotateImageResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response to a single file annotation request. A file may contain one or more - # images, which individually have their own responses. - # @!attribute [rw] input_config - # @return [::Google::Cloud::Vision::V1p3beta1::InputConfig] - # Information about the file for which this response is generated. - # @!attribute [rw] responses - # @return [::Array<::Google::Cloud::Vision::V1p3beta1::AnnotateImageResponse>] - # Individual responses to images found within the file. - class AnnotateFileResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Multiple image annotation requests are batched into a single service call. - # @!attribute [rw] requests - # @return [::Array<::Google::Cloud::Vision::V1p3beta1::AnnotateImageRequest>] - # Individual image annotation requests for this batch. - class BatchAnnotateImagesRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response to a batch image annotation request. - # @!attribute [rw] responses - # @return [::Array<::Google::Cloud::Vision::V1p3beta1::AnnotateImageResponse>] - # Individual responses to image annotation requests within the batch. - class BatchAnnotateImagesResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # An offline file annotation request. - # @!attribute [rw] input_config - # @return [::Google::Cloud::Vision::V1p3beta1::InputConfig] - # Required. Information about the input file. - # @!attribute [rw] features - # @return [::Array<::Google::Cloud::Vision::V1p3beta1::Feature>] - # Required. Requested features. - # @!attribute [rw] image_context - # @return [::Google::Cloud::Vision::V1p3beta1::ImageContext] - # Additional context that may accompany the image(s) in the file. - # @!attribute [rw] output_config - # @return [::Google::Cloud::Vision::V1p3beta1::OutputConfig] - # Required. The desired output location and metadata (e.g. format). - class AsyncAnnotateFileRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The response for a single offline file annotation request. - # @!attribute [rw] output_config - # @return [::Google::Cloud::Vision::V1p3beta1::OutputConfig] - # The output location and metadata from AsyncAnnotateFileRequest. - class AsyncAnnotateFileResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Multiple async file annotation requests are batched into a single service - # call. - # @!attribute [rw] requests - # @return [::Array<::Google::Cloud::Vision::V1p3beta1::AsyncAnnotateFileRequest>] - # Required. Individual async file annotation requests for this batch. - class AsyncBatchAnnotateFilesRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response to an async batch file annotation request. - # @!attribute [rw] responses - # @return [::Array<::Google::Cloud::Vision::V1p3beta1::AsyncAnnotateFileResponse>] - # The list of file annotation responses, one for each request in - # AsyncBatchAnnotateFilesRequest. - class AsyncBatchAnnotateFilesResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The desired input location and metadata. - # @!attribute [rw] gcs_source - # @return [::Google::Cloud::Vision::V1p3beta1::GcsSource] - # The Google Cloud Storage location to read the input from. - # @!attribute [rw] mime_type - # @return [::String] - # The type of the file. Currently only "application/pdf" and "image/tiff" - # are supported. Wildcards are not supported. - class InputConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The desired output location and metadata. - # @!attribute [rw] gcs_destination - # @return [::Google::Cloud::Vision::V1p3beta1::GcsDestination] - # The Google Cloud Storage location to write the output(s) to. - # @!attribute [rw] batch_size - # @return [::Integer] - # The max number of response protos to put into each output JSON file on - # Google Cloud Storage. - # The valid range is [1, 100]. If not specified, the default value is 20. - # - # For example, for one pdf file with 100 pages, 100 response protos will - # be generated. If `batch_size` = 20, then 5 json files each - # containing 20 response protos will be written under the prefix - # `gcs_destination`.`uri`. - # - # Currently, batch_size only applies to GcsDestination, with potential future - # support for other output configurations. - class OutputConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The Google Cloud Storage location where the input will be read from. - # @!attribute [rw] uri - # @return [::String] - # Google Cloud Storage URI for the input file. This must only be a - # Google Cloud Storage object. Wildcards are not currently supported. - class GcsSource - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The Google Cloud Storage location where the output will be written to. - # @!attribute [rw] uri - # @return [::String] - # Google Cloud Storage URI where the results will be stored. Results will - # be in JSON format and preceded by its corresponding input URI. This field - # can either represent a single file, or a prefix for multiple outputs. - # Prefixes must end in a `/`. - # - # Examples: - # - # * File: gs://bucket-name/filename.json - # * Prefix: gs://bucket-name/prefix/here/ - # * File: gs://bucket-name/prefix/here - # - # If multiple outputs, each response is still AnnotateFileResponse, each of - # which contains some subset of the full list of AnnotateImageResponse. - # Multiple outputs can happen if, for example, the output JSON is too large - # and overflows into multiple sharded files. - class GcsDestination - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Contains metadata for the BatchAnnotateImages operation. - # @!attribute [rw] state - # @return [::Google::Cloud::Vision::V1p3beta1::OperationMetadata::State] - # Current state of the batch operation. - # @!attribute [rw] create_time - # @return [::Google::Protobuf::Timestamp] - # The time when the batch request was received. - # @!attribute [rw] update_time - # @return [::Google::Protobuf::Timestamp] - # The time when the operation result was last updated. - class OperationMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Batch operation states. - module State - # Invalid. - STATE_UNSPECIFIED = 0 - - # Request is received. - CREATED = 1 - - # Request is actively being processed. - RUNNING = 2 - - # The batch processing is done. - DONE = 3 - - # The batch processing was cancelled. - CANCELLED = 4 - end - end - - # A bucketized representation of likelihood, which is intended to give clients - # highly stable results across model upgrades. - module Likelihood - # Unknown likelihood. - UNKNOWN = 0 - - # It is very unlikely that the image belongs to the specified vertical. - VERY_UNLIKELY = 1 - - # It is unlikely that the image belongs to the specified vertical. - UNLIKELY = 2 - - # It is possible that the image belongs to the specified vertical. - POSSIBLE = 3 - - # It is likely that the image belongs to the specified vertical. - LIKELY = 4 - - # It is very likely that the image belongs to the specified vertical. - VERY_LIKELY = 5 - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-vision-v1p3beta1/proto_docs/google/cloud/vision/v1p3beta1/product_search.rb b/owl-bot-staging/google-cloud-vision-v1p3beta1/proto_docs/google/cloud/vision/v1p3beta1/product_search.rb deleted file mode 100644 index bb560c3cf6f3..000000000000 --- a/owl-bot-staging/google-cloud-vision-v1p3beta1/proto_docs/google/cloud/vision/v1p3beta1/product_search.rb +++ /dev/null @@ -1,134 +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 Vision - module V1p3beta1 - # Parameters for a product search request. - # @!attribute [rw] bounding_poly - # @return [::Google::Cloud::Vision::V1p3beta1::BoundingPoly] - # The bounding polygon around the area of interest in the image. - # If it is not specified, system discretion will be applied. - # @!attribute [rw] product_set - # @return [::String] - # The resource name of a {::Google::Cloud::Vision::V1p3beta1::ProductSet ProductSet} to be searched for similar images. - # - # Format is: - # `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`. - # @!attribute [rw] product_categories - # @return [::Array<::String>] - # The list of product categories to search in. Currently, we only consider - # the first category, and either "homegoods-v2", "apparel-v2", "toys-v2", - # "packagedgoods-v1", or "general-v1" should be specified. The legacy - # categories "homegoods", "apparel", and "toys" are still supported but will - # be deprecated. For new products, please use "homegoods-v2", "apparel-v2", - # or "toys-v2" for better product search accuracy. It is recommended to - # migrate existing products to these categories as well. - # @!attribute [rw] filter - # @return [::String] - # The filtering expression. This can be used to restrict search results based - # on Product labels. We currently support an AND of OR of key-value - # expressions, where each expression within an OR must have the same key. An - # '=' should be used to connect the key and value. - # - # For example, "(color = red OR color = blue) AND brand = Google" is - # acceptable, but "(color = red OR brand = Google)" is not acceptable. - # "color: red" is not acceptable because it uses a ':' instead of an '='. - class ProductSearchParams - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Results for a product search request. - # @!attribute [rw] index_time - # @return [::Google::Protobuf::Timestamp] - # Timestamp of the index which provided these results. Products added to the - # product set and products removed from the product set after this time are - # not reflected in the current results. - # @!attribute [rw] results - # @return [::Array<::Google::Cloud::Vision::V1p3beta1::ProductSearchResults::Result>] - # List of results, one for each product match. - # @!attribute [rw] product_grouped_results - # @return [::Array<::Google::Cloud::Vision::V1p3beta1::ProductSearchResults::GroupedResult>] - # List of results grouped by products detected in the query image. Each entry - # corresponds to one bounding polygon in the query image, and contains the - # matching products specific to that region. There may be duplicate product - # matches in the union of all the per-product results. - class ProductSearchResults - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Information about a product. - # @!attribute [rw] product - # @return [::Google::Cloud::Vision::V1p3beta1::Product] - # The Product. - # @!attribute [rw] score - # @return [::Float] - # A confidence level on the match, ranging from 0 (no confidence) to - # 1 (full confidence). - # @!attribute [rw] image - # @return [::String] - # The resource name of the image from the product that is the closest match - # to the query. - class Result - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Prediction for what the object in the bounding box is. - # @!attribute [rw] mid - # @return [::String] - # Object ID that should align with EntityAnnotation mid. - # @!attribute [rw] language_code - # @return [::String] - # The BCP-47 language code, such as "en-US" or "sr-Latn". For more - # information, see - # http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. - # @!attribute [rw] name - # @return [::String] - # Object name, expressed in its `language_code` language. - # @!attribute [rw] score - # @return [::Float] - # Score of the result. Range [0, 1]. - class ObjectAnnotation - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Information about the products similar to a single product in a query - # image. - # @!attribute [rw] bounding_poly - # @return [::Google::Cloud::Vision::V1p3beta1::BoundingPoly] - # The bounding polygon around the product detected in the query image. - # @!attribute [rw] results - # @return [::Array<::Google::Cloud::Vision::V1p3beta1::ProductSearchResults::Result>] - # List of results, one for each product match. - # @!attribute [rw] object_annotations - # @return [::Array<::Google::Cloud::Vision::V1p3beta1::ProductSearchResults::ObjectAnnotation>] - # List of generic predictions for the object in the bounding box. - class GroupedResult - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-vision-v1p3beta1/proto_docs/google/cloud/vision/v1p3beta1/product_search_service.rb b/owl-bot-staging/google-cloud-vision-v1p3beta1/proto_docs/google/cloud/vision/v1p3beta1/product_search_service.rb deleted file mode 100644 index 06d75f8a2143..000000000000 --- a/owl-bot-staging/google-cloud-vision-v1p3beta1/proto_docs/google/cloud/vision/v1p3beta1/product_search_service.rb +++ /dev/null @@ -1,630 +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 Vision - module V1p3beta1 - # A Product contains ReferenceImages. - # @!attribute [rw] name - # @return [::String] - # The resource name of the product. - # - # Format is: - # `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`. - # - # This field is ignored when creating a product. - # @!attribute [rw] display_name - # @return [::String] - # The user-provided name for this Product. Must not be empty. Must be at most - # 4096 characters long. - # @!attribute [rw] description - # @return [::String] - # User-provided metadata to be stored with this product. Must be at most 4096 - # characters long. - # @!attribute [rw] product_category - # @return [::String] - # Immutable. The category for the product identified by the reference image. This should - # be either "homegoods-v2", "apparel-v2", or "toys-v2". The legacy categories - # "homegoods", "apparel", and "toys" are still supported, but these should - # not be used for new products. - # @!attribute [rw] product_labels - # @return [::Array<::Google::Cloud::Vision::V1p3beta1::Product::KeyValue>] - # Key-value pairs that can be attached to a product. At query time, - # constraints can be specified based on the product_labels. - # - # Note that integer values can be provided as strings, e.g. "1199". Only - # strings with integer values can match a range-based restriction which is - # to be supported soon. - # - # Multiple values can be assigned to the same key. One product may have up to - # 100 product_labels. - class Product - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # A product label represented as a key-value pair. - # @!attribute [rw] key - # @return [::String] - # The key of the label attached to the product. Cannot be empty and cannot - # exceed 128 bytes. - # @!attribute [rw] value - # @return [::String] - # The value of the label attached to the product. Cannot be empty and - # cannot exceed 128 bytes. - class KeyValue - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # A ProductSet contains Products. A ProductSet can contain a maximum of 1 - # million reference images. If the limit is exceeded, periodic indexing will - # fail. - # @!attribute [rw] name - # @return [::String] - # The resource name of the ProductSet. - # - # Format is: - # `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`. - # - # This field is ignored when creating a ProductSet. - # @!attribute [rw] display_name - # @return [::String] - # The user-provided name for this ProductSet. Must not be empty. Must be at - # most 4096 characters long. - # @!attribute [r] index_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time at which this ProductSet was last indexed. Query - # results will reflect all updates before this time. If this ProductSet has - # never been indexed, this field is 0. - # - # This field is ignored when creating a ProductSet. - # @!attribute [r] index_error - # @return [::Google::Rpc::Status] - # Output only. If there was an error with indexing the product set, the field - # is populated. - # - # This field is ignored when creating a ProductSet. - class ProductSet - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A `ReferenceImage` represents a product image and its associated metadata, - # such as bounding boxes. - # @!attribute [rw] name - # @return [::String] - # The resource name of the reference image. - # - # Format is: - # - # `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID`. - # - # This field is ignored when creating a reference image. - # @!attribute [rw] uri - # @return [::String] - # Required. The Google Cloud Storage URI of the reference image. - # - # The URI must start with `gs://`. - # @!attribute [rw] bounding_polys - # @return [::Array<::Google::Cloud::Vision::V1p3beta1::BoundingPoly>] - # Optional. Bounding polygons around the areas of interest in the reference image. - # If this field is empty, the system will try to detect regions of - # interest. At most 10 bounding polygons will be used. - # - # The provided shape is converted into a non-rotated rectangle. Once - # converted, the small edge of the rectangle must be greater than or equal - # to 300 pixels. The aspect ratio must be 1:4 or less (i.e. 1:3 is ok; 1:5 - # is not). - class ReferenceImage - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for the `CreateProduct` method. - # @!attribute [rw] parent - # @return [::String] - # Required. The project in which the Product should be created. - # - # Format is - # `projects/PROJECT_ID/locations/LOC_ID`. - # @!attribute [rw] product - # @return [::Google::Cloud::Vision::V1p3beta1::Product] - # Required. The product to create. - # @!attribute [rw] product_id - # @return [::String] - # A user-supplied resource id for this Product. If set, the server will - # attempt to use this value as the resource id. If it is already in use, an - # error is returned with code ALREADY_EXISTS. Must be at most 128 characters - # long. It cannot contain the character `/`. - class CreateProductRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for the `ListProducts` method. - # @!attribute [rw] parent - # @return [::String] - # Required. The project OR ProductSet from which Products should be listed. - # - # Format: - # `projects/PROJECT_ID/locations/LOC_ID` - # @!attribute [rw] page_size - # @return [::Integer] - # The maximum number of items to return. Default 10, maximum 100. - # @!attribute [rw] page_token - # @return [::String] - # The next_page_token returned from a previous List request, if any. - class ListProductsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for the `ListProducts` method. - # @!attribute [rw] products - # @return [::Array<::Google::Cloud::Vision::V1p3beta1::Product>] - # List of products. - # @!attribute [rw] next_page_token - # @return [::String] - # Token to retrieve the next page of results, or empty if there are no more - # results in the list. - class ListProductsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for the `GetProduct` method. - # @!attribute [rw] name - # @return [::String] - # Required. Resource name of the Product to get. - # - # Format is: - # `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID` - class GetProductRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for the `UpdateProduct` method. - # @!attribute [rw] product - # @return [::Google::Cloud::Vision::V1p3beta1::Product] - # Required. The Product resource which replaces the one on the server. - # product.name is immutable. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # The {::Google::Protobuf::FieldMask FieldMask} that specifies which fields - # to update. - # If update_mask isn't specified, all mutable fields are to be updated. - # Valid mask paths include `product_labels`, `display_name`, and - # `description`. - class UpdateProductRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for the `DeleteProduct` method. - # @!attribute [rw] name - # @return [::String] - # Required. Resource name of product to delete. - # - # Format is: - # `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID` - class DeleteProductRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for the `CreateProductSet` method. - # @!attribute [rw] parent - # @return [::String] - # Required. The project in which the ProductSet should be created. - # - # Format is `projects/PROJECT_ID/locations/LOC_ID`. - # @!attribute [rw] product_set - # @return [::Google::Cloud::Vision::V1p3beta1::ProductSet] - # Required. The ProductSet to create. - # @!attribute [rw] product_set_id - # @return [::String] - # A user-supplied resource id for this ProductSet. If set, the server will - # attempt to use this value as the resource id. If it is already in use, an - # error is returned with code ALREADY_EXISTS. Must be at most 128 characters - # long. It cannot contain the character `/`. - class CreateProductSetRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for the `ListProductSets` method. - # @!attribute [rw] parent - # @return [::String] - # Required. The project from which ProductSets should be listed. - # - # Format is `projects/PROJECT_ID/locations/LOC_ID`. - # @!attribute [rw] page_size - # @return [::Integer] - # The maximum number of items to return. Default 10, maximum 100. - # @!attribute [rw] page_token - # @return [::String] - # The next_page_token returned from a previous List request, if any. - class ListProductSetsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for the `ListProductSets` method. - # @!attribute [rw] product_sets - # @return [::Array<::Google::Cloud::Vision::V1p3beta1::ProductSet>] - # List of ProductSets. - # @!attribute [rw] next_page_token - # @return [::String] - # Token to retrieve the next page of results, or empty if there are no more - # results in the list. - class ListProductSetsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for the `GetProductSet` method. - # @!attribute [rw] name - # @return [::String] - # Required. Resource name of the ProductSet to get. - # - # Format is: - # `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID` - class GetProductSetRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for the `UpdateProductSet` method. - # @!attribute [rw] product_set - # @return [::Google::Cloud::Vision::V1p3beta1::ProductSet] - # Required. The ProductSet resource which replaces the one on the server. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # The {::Google::Protobuf::FieldMask FieldMask} that specifies which fields to - # update. - # If update_mask isn't specified, all mutable fields are to be updated. - # Valid mask path is `display_name`. - class UpdateProductSetRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for the `DeleteProductSet` method. - # @!attribute [rw] name - # @return [::String] - # Required. Resource name of the ProductSet to delete. - # - # Format is: - # `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID` - class DeleteProductSetRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for the `CreateReferenceImage` method. - # @!attribute [rw] parent - # @return [::String] - # Required. Resource name of the product in which to create the reference image. - # - # Format is - # `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`. - # @!attribute [rw] reference_image - # @return [::Google::Cloud::Vision::V1p3beta1::ReferenceImage] - # Required. The reference image to create. - # If an image ID is specified, it is ignored. - # @!attribute [rw] reference_image_id - # @return [::String] - # A user-supplied resource id for the ReferenceImage to be added. If set, - # the server will attempt to use this value as the resource id. If it is - # already in use, an error is returned with code ALREADY_EXISTS. Must be at - # most 128 characters long. It cannot contain the character `/`. - class CreateReferenceImageRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for the `ListReferenceImages` method. - # @!attribute [rw] parent - # @return [::String] - # Required. Resource name of the product containing the reference images. - # - # Format is - # `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`. - # @!attribute [rw] page_size - # @return [::Integer] - # The maximum number of items to return. Default 10, maximum 100. - # @!attribute [rw] page_token - # @return [::String] - # A token identifying a page of results to be returned. This is the value - # of `nextPageToken` returned in a previous reference image list request. - # - # Defaults to the first page if not specified. - class ListReferenceImagesRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for the `ListReferenceImages` method. - # @!attribute [rw] reference_images - # @return [::Array<::Google::Cloud::Vision::V1p3beta1::ReferenceImage>] - # The list of reference images. - # @!attribute [rw] page_size - # @return [::Integer] - # The maximum number of items to return. Default 10, maximum 100. - # @!attribute [rw] next_page_token - # @return [::String] - # The next_page_token returned from a previous List request, if any. - class ListReferenceImagesResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for the `GetReferenceImage` method. - # @!attribute [rw] name - # @return [::String] - # Required. The resource name of the ReferenceImage to get. - # - # Format is: - # - # `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID`. - class GetReferenceImageRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for the `DeleteReferenceImage` method. - # @!attribute [rw] name - # @return [::String] - # Required. The resource name of the reference image to delete. - # - # Format is: - # - # `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID` - class DeleteReferenceImageRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for the `AddProductToProductSet` method. - # @!attribute [rw] name - # @return [::String] - # Required. The resource name for the ProductSet to modify. - # - # Format is: - # `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID` - # @!attribute [rw] product - # @return [::String] - # Required. The resource name for the Product to be added to this ProductSet. - # - # Format is: - # `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID` - class AddProductToProductSetRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for the `RemoveProductFromProductSet` method. - # @!attribute [rw] name - # @return [::String] - # Required. The resource name for the ProductSet to modify. - # - # Format is: - # `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID` - # @!attribute [rw] product - # @return [::String] - # Required. The resource name for the Product to be removed from this ProductSet. - # - # Format is: - # `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID` - class RemoveProductFromProductSetRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for the `ListProductsInProductSet` method. - # @!attribute [rw] name - # @return [::String] - # Required. The ProductSet resource for which to retrieve Products. - # - # Format is: - # `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID` - # @!attribute [rw] page_size - # @return [::Integer] - # The maximum number of items to return. Default 10, maximum 100. - # @!attribute [rw] page_token - # @return [::String] - # The next_page_token returned from a previous List request, if any. - class ListProductsInProductSetRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for the `ListProductsInProductSet` method. - # @!attribute [rw] products - # @return [::Array<::Google::Cloud::Vision::V1p3beta1::Product>] - # The list of Products. - # @!attribute [rw] next_page_token - # @return [::String] - # Token to retrieve the next page of results, or empty if there are no more - # results in the list. - class ListProductsInProductSetResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The Google Cloud Storage location for a csv file which preserves a list of - # ImportProductSetRequests in each line. - # @!attribute [rw] csv_file_uri - # @return [::String] - # The Google Cloud Storage URI of the input csv file. - # - # The URI must start with `gs://`. - # - # The format of the input csv file should be one image per line. - # In each line, there are 6 columns. - # 1. image_uri - # 2, image_id - # 3. product_set_id - # 4. product_id - # 5, product_category - # 6, product_display_name - # 7, labels - # 8. bounding_poly - # - # Columns 1, 3, 4, and 5 are required, other columns are optional. A new - # ProductSet/Product with the same id will be created on the fly - # if the ProductSet/Product specified by product_set_id/product_id does not - # exist. - # - # The image_id field is optional but has to be unique if provided. If it is - # empty, we will automatically assign an unique id to the image. - # - # The product_display_name field is optional. If it is empty, a space (" ") - # is used as the place holder for the product display_name, which can - # be updated later through the realtime API. - # - # If the Product with product_id already exists, the fields - # product_display_name, product_category and labels are ignored. - # - # If a Product doesn't exist and needs to be created on the fly, the - # product_display_name field refers to - # {::Google::Cloud::Vision::V1p3beta1::Product#display_name Product.display_name}, - # the product_category field refers to - # {::Google::Cloud::Vision::V1p3beta1::Product#product_category Product.product_category}, - # and the labels field refers to [Product.labels][]. - # - # Labels (optional) should be a line containing a list of comma-separated - # key-value pairs, with the format - # "key_1=value_1,key_2=value_2,...,key_n=value_n". - # - # The bounding_poly (optional) field is used to identify one region of - # interest from the image in the same manner as CreateReferenceImage. If no - # bounding_poly is specified, the system will try to detect regions of - # interest automatically. - # - # Note that the pipeline will resize the image if the image resolution is too - # large to process (above 20MP). - # - # Also note that at most one bounding_poly is allowed per line. If the image - # contains multiple regions of interest, the csv should contain one line per - # region of interest. - # - # The bounding_poly column should contain an even number of comma-separated - # numbers, with the format "p1_x,p1_y,p2_x,p2_y,...,pn_x,pn_y". Nonnegative - # integers should be used for absolute bounding polygons, and float values - # in [0, 1] should be used for normalized bounding polygons. - class ImportProductSetsGcsSource - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The input content for the `ImportProductSets` method. - # @!attribute [rw] gcs_source - # @return [::Google::Cloud::Vision::V1p3beta1::ImportProductSetsGcsSource] - # The Google Cloud Storage location for a csv file which preserves a list - # of ImportProductSetRequests in each line. - class ImportProductSetsInputConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for the `ImportProductSets` method. - # @!attribute [rw] parent - # @return [::String] - # Required. The project in which the ProductSets should be imported. - # - # Format is `projects/PROJECT_ID/locations/LOC_ID`. - # @!attribute [rw] input_config - # @return [::Google::Cloud::Vision::V1p3beta1::ImportProductSetsInputConfig] - # Required. The input content for the list of requests. - class ImportProductSetsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for the `ImportProductSets` method. - # - # This message is returned by the - # google.longrunning.Operations.GetOperation - # method in the returned - # {::Google::Longrunning::Operation#response google.longrunning.Operation.response} - # field. - # @!attribute [rw] reference_images - # @return [::Array<::Google::Cloud::Vision::V1p3beta1::ReferenceImage>] - # The list of reference_images that are imported successfully. - # @!attribute [rw] statuses - # @return [::Array<::Google::Rpc::Status>] - # The rpc status for each ImportProductSet request, including both successes - # and errors. - # - # The number of statuses here matches the number of lines in the csv file, - # and statuses[i] stores the success or failure status of processing the i-th - # line of the csv, starting from line 0. - class ImportProductSetsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Metadata for the batch operations such as the current state. - # - # This is included in the `metadata` field of the `Operation` returned by the - # `GetOperation` call of the `google::longrunning::Operations` service. - # @!attribute [rw] state - # @return [::Google::Cloud::Vision::V1p3beta1::BatchOperationMetadata::State] - # The current state of the batch operation. - # @!attribute [rw] submit_time - # @return [::Google::Protobuf::Timestamp] - # The time when the batch request was submitted to the server. - # @!attribute [rw] end_time - # @return [::Google::Protobuf::Timestamp] - # The time when the batch request is finished and - # {::Google::Longrunning::Operation#done google.longrunning.Operation.done} is - # set to true. - class BatchOperationMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Enumerates the possible states that the batch request can be in. - module State - # Invalid. - STATE_UNSPECIFIED = 0 - - # Request is actively being processed. - PROCESSING = 1 - - # The request is done and at least one item has been successfully - # processed. - SUCCESSFUL = 2 - - # The request is done and no item has been successfully processed. - FAILED = 3 - - # The request is done after the longrunning.Operations.CancelOperation has - # been called by the user. Any records that were processed before the - # cancel command are output as specified in the request. - CANCELLED = 4 - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-vision-v1p3beta1/proto_docs/google/cloud/vision/v1p3beta1/text_annotation.rb b/owl-bot-staging/google-cloud-vision-v1p3beta1/proto_docs/google/cloud/vision/v1p3beta1/text_annotation.rb deleted file mode 100644 index beb1cf354514..000000000000 --- a/owl-bot-staging/google-cloud-vision-v1p3beta1/proto_docs/google/cloud/vision/v1p3beta1/text_annotation.rb +++ /dev/null @@ -1,286 +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 Vision - module V1p3beta1 - # TextAnnotation contains a structured representation of OCR extracted text. - # The hierarchy of an OCR extracted text structure is like this: - # TextAnnotation -> Page -> Block -> Paragraph -> Word -> Symbol - # Each structural component, starting from Page, may further have their own - # properties. Properties describe detected languages, breaks etc.. Please refer - # to the - # {::Google::Cloud::Vision::V1p3beta1::TextAnnotation::TextProperty TextAnnotation.TextProperty} - # message definition below for more detail. - # @!attribute [rw] pages - # @return [::Array<::Google::Cloud::Vision::V1p3beta1::Page>] - # List of pages detected by OCR. - # @!attribute [rw] text - # @return [::String] - # UTF-8 text detected on the pages. - class TextAnnotation - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Detected language for a structural component. - # @!attribute [rw] language_code - # @return [::String] - # The BCP-47 language code, such as "en-US" or "sr-Latn". For more - # information, see - # http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. - # @!attribute [rw] confidence - # @return [::Float] - # Confidence of detected language. Range [0, 1]. - class DetectedLanguage - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Detected start or end of a structural component. - # @!attribute [rw] type - # @return [::Google::Cloud::Vision::V1p3beta1::TextAnnotation::DetectedBreak::BreakType] - # Detected break type. - # @!attribute [rw] is_prefix - # @return [::Boolean] - # True if break prepends the element. - class DetectedBreak - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Enum to denote the type of break found. New line, space etc. - module BreakType - # Unknown break label type. - UNKNOWN = 0 - - # Regular space. - SPACE = 1 - - # Sure space (very wide). - SURE_SPACE = 2 - - # Line-wrapping break. - EOL_SURE_SPACE = 3 - - # End-line hyphen that is not present in text; does not co-occur with - # `SPACE`, `LEADER_SPACE`, or `LINE_BREAK`. - HYPHEN = 4 - - # Line break that ends a paragraph. - LINE_BREAK = 5 - end - end - - # Additional information detected on the structural component. - # @!attribute [rw] detected_languages - # @return [::Array<::Google::Cloud::Vision::V1p3beta1::TextAnnotation::DetectedLanguage>] - # A list of detected languages together with confidence. - # @!attribute [rw] detected_break - # @return [::Google::Cloud::Vision::V1p3beta1::TextAnnotation::DetectedBreak] - # Detected start or end of a text segment. - class TextProperty - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Detected page from OCR. - # @!attribute [rw] property - # @return [::Google::Cloud::Vision::V1p3beta1::TextAnnotation::TextProperty] - # Additional information detected on the page. - # @!attribute [rw] width - # @return [::Integer] - # Page width. For PDFs the unit is points. For images (including - # TIFFs) the unit is pixels. - # @!attribute [rw] height - # @return [::Integer] - # Page height. For PDFs the unit is points. For images (including - # TIFFs) the unit is pixels. - # @!attribute [rw] blocks - # @return [::Array<::Google::Cloud::Vision::V1p3beta1::Block>] - # List of blocks of text, images etc on this page. - # @!attribute [rw] confidence - # @return [::Float] - # Confidence of the OCR results on the page. Range [0, 1]. - class Page - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Logical element on the page. - # @!attribute [rw] property - # @return [::Google::Cloud::Vision::V1p3beta1::TextAnnotation::TextProperty] - # Additional information detected for the block. - # @!attribute [rw] bounding_box - # @return [::Google::Cloud::Vision::V1p3beta1::BoundingPoly] - # The bounding box for the block. - # The vertices are in the order of top-left, top-right, bottom-right, - # bottom-left. When a rotation of the bounding box is detected the rotation - # is represented as around the top-left corner as defined when the text is - # read in the 'natural' orientation. - # For example: - # - # * when the text is horizontal it might look like: - # - # 0----1 - # | | - # 3----2 - # - # * when it's rotated 180 degrees around the top-left corner it becomes: - # - # 2----3 - # | | - # 1----0 - # - # and the vertice order will still be (0, 1, 2, 3). - # @!attribute [rw] paragraphs - # @return [::Array<::Google::Cloud::Vision::V1p3beta1::Paragraph>] - # List of paragraphs in this block (if this blocks is of type text). - # @!attribute [rw] block_type - # @return [::Google::Cloud::Vision::V1p3beta1::Block::BlockType] - # Detected block type (text, image etc) for this block. - # @!attribute [rw] confidence - # @return [::Float] - # Confidence of the OCR results on the block. Range [0, 1]. - class Block - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Type of a block (text, image etc) as identified by OCR. - module BlockType - # Unknown block type. - UNKNOWN = 0 - - # Regular text block. - TEXT = 1 - - # Table block. - TABLE = 2 - - # Image block. - PICTURE = 3 - - # Horizontal/vertical line box. - RULER = 4 - - # Barcode block. - BARCODE = 5 - end - end - - # Structural unit of text representing a number of words in certain order. - # @!attribute [rw] property - # @return [::Google::Cloud::Vision::V1p3beta1::TextAnnotation::TextProperty] - # Additional information detected for the paragraph. - # @!attribute [rw] bounding_box - # @return [::Google::Cloud::Vision::V1p3beta1::BoundingPoly] - # The bounding box for the paragraph. - # The vertices are in the order of top-left, top-right, bottom-right, - # bottom-left. When a rotation of the bounding box is detected the rotation - # is represented as around the top-left corner as defined when the text is - # read in the 'natural' orientation. - # For example: - # * when the text is horizontal it might look like: - # 0----1 - # | | - # 3----2 - # * when it's rotated 180 degrees around the top-left corner it becomes: - # 2----3 - # | | - # 1----0 - # and the vertice order will still be (0, 1, 2, 3). - # @!attribute [rw] words - # @return [::Array<::Google::Cloud::Vision::V1p3beta1::Word>] - # List of words in this paragraph. - # @!attribute [rw] confidence - # @return [::Float] - # Confidence of the OCR results for the paragraph. Range [0, 1]. - class Paragraph - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A word representation. - # @!attribute [rw] property - # @return [::Google::Cloud::Vision::V1p3beta1::TextAnnotation::TextProperty] - # Additional information detected for the word. - # @!attribute [rw] bounding_box - # @return [::Google::Cloud::Vision::V1p3beta1::BoundingPoly] - # The bounding box for the word. - # The vertices are in the order of top-left, top-right, bottom-right, - # bottom-left. When a rotation of the bounding box is detected the rotation - # is represented as around the top-left corner as defined when the text is - # read in the 'natural' orientation. - # For example: - # * when the text is horizontal it might look like: - # 0----1 - # | | - # 3----2 - # * when it's rotated 180 degrees around the top-left corner it becomes: - # 2----3 - # | | - # 1----0 - # and the vertice order will still be (0, 1, 2, 3). - # @!attribute [rw] symbols - # @return [::Array<::Google::Cloud::Vision::V1p3beta1::Symbol>] - # List of symbols in the word. - # The order of the symbols follows the natural reading order. - # @!attribute [rw] confidence - # @return [::Float] - # Confidence of the OCR results for the word. Range [0, 1]. - class Word - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A single symbol representation. - # @!attribute [rw] property - # @return [::Google::Cloud::Vision::V1p3beta1::TextAnnotation::TextProperty] - # Additional information detected for the symbol. - # @!attribute [rw] bounding_box - # @return [::Google::Cloud::Vision::V1p3beta1::BoundingPoly] - # The bounding box for the symbol. - # The vertices are in the order of top-left, top-right, bottom-right, - # bottom-left. When a rotation of the bounding box is detected the rotation - # is represented as around the top-left corner as defined when the text is - # read in the 'natural' orientation. - # For example: - # * when the text is horizontal it might look like: - # 0----1 - # | | - # 3----2 - # * when it's rotated 180 degrees around the top-left corner it becomes: - # 2----3 - # | | - # 1----0 - # and the vertice order will still be (0, 1, 2, 3). - # @!attribute [rw] text - # @return [::String] - # The actual UTF-8 representation of the symbol. - # @!attribute [rw] confidence - # @return [::Float] - # Confidence of the OCR results for the symbol. Range [0, 1]. - class Symbol - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-vision-v1p3beta1/proto_docs/google/cloud/vision/v1p3beta1/web_detection.rb b/owl-bot-staging/google-cloud-vision-v1p3beta1/proto_docs/google/cloud/vision/v1p3beta1/web_detection.rb deleted file mode 100644 index 01b730aadb1c..000000000000 --- a/owl-bot-staging/google-cloud-vision-v1p3beta1/proto_docs/google/cloud/vision/v1p3beta1/web_detection.rb +++ /dev/null @@ -1,120 +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 Vision - module V1p3beta1 - # Relevant information for the image from the Internet. - # @!attribute [rw] web_entities - # @return [::Array<::Google::Cloud::Vision::V1p3beta1::WebDetection::WebEntity>] - # Deduced entities from similar images on the Internet. - # @!attribute [rw] full_matching_images - # @return [::Array<::Google::Cloud::Vision::V1p3beta1::WebDetection::WebImage>] - # Fully matching images from the Internet. - # Can include resized copies of the query image. - # @!attribute [rw] partial_matching_images - # @return [::Array<::Google::Cloud::Vision::V1p3beta1::WebDetection::WebImage>] - # Partial matching images from the Internet. - # Those images are similar enough to share some key-point features. For - # example an original image will likely have partial matching for its crops. - # @!attribute [rw] pages_with_matching_images - # @return [::Array<::Google::Cloud::Vision::V1p3beta1::WebDetection::WebPage>] - # Web pages containing the matching images from the Internet. - # @!attribute [rw] visually_similar_images - # @return [::Array<::Google::Cloud::Vision::V1p3beta1::WebDetection::WebImage>] - # The visually similar image results. - # @!attribute [rw] best_guess_labels - # @return [::Array<::Google::Cloud::Vision::V1p3beta1::WebDetection::WebLabel>] - # Best guess text labels for the request image. - class WebDetection - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Entity deduced from similar images on the Internet. - # @!attribute [rw] entity_id - # @return [::String] - # Opaque entity ID. - # @!attribute [rw] score - # @return [::Float] - # Overall relevancy score for the entity. - # Not normalized and not comparable across different image queries. - # @!attribute [rw] description - # @return [::String] - # Canonical description of the entity, in English. - class WebEntity - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Metadata for online images. - # @!attribute [rw] url - # @return [::String] - # The result image URL. - # @!attribute [rw] score - # @return [::Float] - # (Deprecated) Overall relevancy score for the image. - class WebImage - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Metadata for web pages. - # @!attribute [rw] url - # @return [::String] - # The result web page URL. - # @!attribute [rw] score - # @return [::Float] - # (Deprecated) Overall relevancy score for the web page. - # @!attribute [rw] page_title - # @return [::String] - # Title for the web page, may contain HTML markups. - # @!attribute [rw] full_matching_images - # @return [::Array<::Google::Cloud::Vision::V1p3beta1::WebDetection::WebImage>] - # Fully matching images on the page. - # Can include resized copies of the query image. - # @!attribute [rw] partial_matching_images - # @return [::Array<::Google::Cloud::Vision::V1p3beta1::WebDetection::WebImage>] - # Partial matching images on the page. - # Those images are similar enough to share some key-point features. For - # example an original image will likely have partial matching for its - # crops. - class WebPage - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Label to provide extra metadata for the web detection. - # @!attribute [rw] label - # @return [::String] - # Label for extra metadata. - # @!attribute [rw] language_code - # @return [::String] - # The BCP-47 language code for `label`, such as "en-US" or "sr-Latn". - # For more information, see - # http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. - class WebLabel - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-vision-v1p3beta1/proto_docs/google/longrunning/operations.rb b/owl-bot-staging/google-cloud-vision-v1p3beta1/proto_docs/google/longrunning/operations.rb deleted file mode 100644 index 7a757f512165..000000000000 --- a/owl-bot-staging/google-cloud-vision-v1p3beta1/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-vision-v1p3beta1/proto_docs/google/protobuf/any.rb b/owl-bot-staging/google-cloud-vision-v1p3beta1/proto_docs/google/protobuf/any.rb deleted file mode 100644 index 58691995f02e..000000000000 --- a/owl-bot-staging/google-cloud-vision-v1p3beta1/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-vision-v1p3beta1/proto_docs/google/protobuf/duration.rb b/owl-bot-staging/google-cloud-vision-v1p3beta1/proto_docs/google/protobuf/duration.rb deleted file mode 100644 index ea59f1f91daf..000000000000 --- a/owl-bot-staging/google-cloud-vision-v1p3beta1/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-vision-v1p3beta1/proto_docs/google/protobuf/empty.rb b/owl-bot-staging/google-cloud-vision-v1p3beta1/proto_docs/google/protobuf/empty.rb deleted file mode 100644 index 83e4481834a6..000000000000 --- a/owl-bot-staging/google-cloud-vision-v1p3beta1/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-vision-v1p3beta1/proto_docs/google/protobuf/field_mask.rb b/owl-bot-staging/google-cloud-vision-v1p3beta1/proto_docs/google/protobuf/field_mask.rb deleted file mode 100644 index 7f3ffc78601a..000000000000 --- a/owl-bot-staging/google-cloud-vision-v1p3beta1/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-vision-v1p3beta1/proto_docs/google/protobuf/timestamp.rb b/owl-bot-staging/google-cloud-vision-v1p3beta1/proto_docs/google/protobuf/timestamp.rb deleted file mode 100644 index 74352be9c58c..000000000000 --- a/owl-bot-staging/google-cloud-vision-v1p3beta1/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-vision-v1p3beta1/proto_docs/google/protobuf/wrappers.rb b/owl-bot-staging/google-cloud-vision-v1p3beta1/proto_docs/google/protobuf/wrappers.rb deleted file mode 100644 index 9a7c0269fa42..000000000000 --- a/owl-bot-staging/google-cloud-vision-v1p3beta1/proto_docs/google/protobuf/wrappers.rb +++ /dev/null @@ -1,148 +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. - # - # Not recommended for use in new APIs, but still useful for legacy APIs and - # has no plan to be removed. - # @!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. - # - # Not recommended for use in new APIs, but still useful for legacy APIs and - # has no plan to be removed. - # @!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. - # - # Not recommended for use in new APIs, but still useful for legacy APIs and - # has no plan to be removed. - # @!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. - # - # Not recommended for use in new APIs, but still useful for legacy APIs and - # has no plan to be removed. - # @!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. - # - # Not recommended for use in new APIs, but still useful for legacy APIs and - # has no plan to be removed. - # @!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. - # - # Not recommended for use in new APIs, but still useful for legacy APIs and - # has no plan to be removed. - # @!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`. - # - # Not recommended for use in new APIs, but still useful for legacy APIs and - # has no plan to be removed. - # @!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. - # - # Not recommended for use in new APIs, but still useful for legacy APIs and - # has no plan to be removed. - # @!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. - # - # Not recommended for use in new APIs, but still useful for legacy APIs and - # has no plan to be removed. - # @!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-vision-v1p3beta1/proto_docs/google/rpc/status.rb b/owl-bot-staging/google-cloud-vision-v1p3beta1/proto_docs/google/rpc/status.rb deleted file mode 100644 index c1a1c07eb2db..000000000000 --- a/owl-bot-staging/google-cloud-vision-v1p3beta1/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-vision-v1p3beta1/proto_docs/google/type/color.rb b/owl-bot-staging/google-cloud-vision-v1p3beta1/proto_docs/google/type/color.rb deleted file mode 100644 index 5728bc06bc83..000000000000 --- a/owl-bot-staging/google-cloud-vision-v1p3beta1/proto_docs/google/type/color.rb +++ /dev/null @@ -1,173 +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 color in the RGBA color space. This representation is designed - # for simplicity of conversion to and from color representations in various - # languages over compactness. For example, the fields of this representation - # can be trivially provided to the constructor of `java.awt.Color` in Java; it - # can also be trivially provided to UIColor's `+colorWithRed:green:blue:alpha` - # method in iOS; and, with just a little work, it can be easily formatted into - # a CSS `rgba()` string in JavaScript. - # - # This reference page doesn't have information about the absolute color - # space that should be used to interpret the RGB value—for example, sRGB, - # Adobe RGB, - # DCI-P3, and BT.2020. By default, applications should assume the sRGB color - # space. - # - # When color equality needs to be decided, implementations, unless documented - # otherwise, treat two colors as equal if all their red, green, blue, and alpha - # values each differ by at most `1e-5`. - # - # Example (Java): - # - # import com.google.type.Color; - # - # // ... - # public static java.awt.Color fromProto(Color protocolor) { - # float alpha = protocolor.hasAlpha() - # ? protocolor.getAlpha().getValue() - # : 1.0; - # - # return new java.awt.Color( - # protocolor.getRed(), - # protocolor.getGreen(), - # protocolor.getBlue(), - # alpha); - # } - # - # public static Color toProto(java.awt.Color color) { - # float red = (float) color.getRed(); - # float green = (float) color.getGreen(); - # float blue = (float) color.getBlue(); - # float denominator = 255.0; - # Color.Builder resultBuilder = - # Color - # .newBuilder() - # .setRed(red / denominator) - # .setGreen(green / denominator) - # .setBlue(blue / denominator); - # int alpha = color.getAlpha(); - # if (alpha != 255) { - # result.setAlpha( - # FloatValue - # .newBuilder() - # .setValue(((float) alpha) / denominator) - # .build()); - # } - # return resultBuilder.build(); - # } - # // ... - # - # Example (iOS / Obj-C): - # - # // ... - # static UIColor* fromProto(Color* protocolor) { - # float red = [protocolor red]; - # float green = [protocolor green]; - # float blue = [protocolor blue]; - # FloatValue* alpha_wrapper = [protocolor alpha]; - # float alpha = 1.0; - # if (alpha_wrapper != nil) { - # alpha = [alpha_wrapper value]; - # } - # return [UIColor colorWithRed:red green:green blue:blue alpha:alpha]; - # } - # - # static Color* toProto(UIColor* color) { - # CGFloat red, green, blue, alpha; - # if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) { - # return nil; - # } - # Color* result = [[Color alloc] init]; - # [result setRed:red]; - # [result setGreen:green]; - # [result setBlue:blue]; - # if (alpha <= 0.9999) { - # [result setAlpha:floatWrapperWithValue(alpha)]; - # } - # [result autorelease]; - # return result; - # } - # // ... - # - # Example (JavaScript): - # - # // ... - # - # var protoToCssColor = function(rgb_color) { - # var redFrac = rgb_color.red || 0.0; - # var greenFrac = rgb_color.green || 0.0; - # var blueFrac = rgb_color.blue || 0.0; - # var red = Math.floor(redFrac * 255); - # var green = Math.floor(greenFrac * 255); - # var blue = Math.floor(blueFrac * 255); - # - # if (!('alpha' in rgb_color)) { - # return rgbToCssColor(red, green, blue); - # } - # - # var alphaFrac = rgb_color.alpha.value || 0.0; - # var rgbParams = [red, green, blue].join(','); - # return ['rgba(', rgbParams, ',', alphaFrac, ')'].join(''); - # }; - # - # var rgbToCssColor = function(red, green, blue) { - # var rgbNumber = new Number((red << 16) | (green << 8) | blue); - # var hexString = rgbNumber.toString(16); - # var missingZeros = 6 - hexString.length; - # var resultBuilder = ['#']; - # for (var i = 0; i < missingZeros; i++) { - # resultBuilder.push('0'); - # } - # resultBuilder.push(hexString); - # return resultBuilder.join(''); - # }; - # - # // ... - # @!attribute [rw] red - # @return [::Float] - # The amount of red in the color as a value in the interval [0, 1]. - # @!attribute [rw] green - # @return [::Float] - # The amount of green in the color as a value in the interval [0, 1]. - # @!attribute [rw] blue - # @return [::Float] - # The amount of blue in the color as a value in the interval [0, 1]. - # @!attribute [rw] alpha - # @return [::Google::Protobuf::FloatValue] - # The fraction of this color that should be applied to the pixel. That is, - # the final pixel color is defined by the equation: - # - # `pixel color = alpha * (this color) + (1.0 - alpha) * (background color)` - # - # This means that a value of 1.0 corresponds to a solid color, whereas - # a value of 0.0 corresponds to a completely transparent color. This - # uses a wrapper message rather than a simple float scalar so that it is - # possible to distinguish between a default value and the value being unset. - # If omitted, this color object is rendered as a solid color - # (as if the alpha value had been explicitly given a value of 1.0). - class Color - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-vision-v1p3beta1/proto_docs/google/type/latlng.rb b/owl-bot-staging/google-cloud-vision-v1p3beta1/proto_docs/google/type/latlng.rb deleted file mode 100644 index 593314b4cde5..000000000000 --- a/owl-bot-staging/google-cloud-vision-v1p3beta1/proto_docs/google/type/latlng.rb +++ /dev/null @@ -1,38 +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 - # An object that represents a latitude/longitude pair. This is expressed as a - # pair of doubles to represent degrees latitude and degrees longitude. Unless - # specified otherwise, this object must conform to the - # - # WGS84 standard. Values must be within normalized ranges. - # @!attribute [rw] latitude - # @return [::Float] - # The latitude in degrees. It must be in the range [-90.0, +90.0]. - # @!attribute [rw] longitude - # @return [::Float] - # The longitude in degrees. It must be in the range [-180.0, +180.0]. - class LatLng - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-vision-v1p3beta1/snippets/Gemfile b/owl-bot-staging/google-cloud-vision-v1p3beta1/snippets/Gemfile deleted file mode 100644 index 4321e3a73dc1..000000000000 --- a/owl-bot-staging/google-cloud-vision-v1p3beta1/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-vision-v1p3beta1", path: "../" -else - gem "google-cloud-vision-v1p3beta1" -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-vision-v1p3beta1/snippets/image_annotator/async_batch_annotate_files.rb b/owl-bot-staging/google-cloud-vision-v1p3beta1/snippets/image_annotator/async_batch_annotate_files.rb deleted file mode 100644 index 4ddd3393dcfa..000000000000 --- a/owl-bot-staging/google-cloud-vision-v1p3beta1/snippets/image_annotator/async_batch_annotate_files.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 vision_v1p3beta1_generated_ImageAnnotator_AsyncBatchAnnotateFiles_sync] -require "google/cloud/vision/v1p3beta1" - -## -# Snippet for the async_batch_annotate_files call in the ImageAnnotator 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::Vision::V1p3beta1::ImageAnnotator::Client#async_batch_annotate_files. -# -def async_batch_annotate_files - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Vision::V1p3beta1::ImageAnnotator::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Vision::V1p3beta1::AsyncBatchAnnotateFilesRequest.new - - # Call the async_batch_annotate_files method. - result = client.async_batch_annotate_files 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 vision_v1p3beta1_generated_ImageAnnotator_AsyncBatchAnnotateFiles_sync] diff --git a/owl-bot-staging/google-cloud-vision-v1p3beta1/snippets/image_annotator/batch_annotate_images.rb b/owl-bot-staging/google-cloud-vision-v1p3beta1/snippets/image_annotator/batch_annotate_images.rb deleted file mode 100644 index 06a7d8393e27..000000000000 --- a/owl-bot-staging/google-cloud-vision-v1p3beta1/snippets/image_annotator/batch_annotate_images.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 vision_v1p3beta1_generated_ImageAnnotator_BatchAnnotateImages_sync] -require "google/cloud/vision/v1p3beta1" - -## -# Snippet for the batch_annotate_images call in the ImageAnnotator 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::Vision::V1p3beta1::ImageAnnotator::Client#batch_annotate_images. -# -def batch_annotate_images - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Vision::V1p3beta1::ImageAnnotator::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Vision::V1p3beta1::BatchAnnotateImagesRequest.new - - # Call the batch_annotate_images method. - result = client.batch_annotate_images request - - # The returned object is of type Google::Cloud::Vision::V1p3beta1::BatchAnnotateImagesResponse. - p result -end -# [END vision_v1p3beta1_generated_ImageAnnotator_BatchAnnotateImages_sync] diff --git a/owl-bot-staging/google-cloud-vision-v1p3beta1/snippets/product_search/add_product_to_product_set.rb b/owl-bot-staging/google-cloud-vision-v1p3beta1/snippets/product_search/add_product_to_product_set.rb deleted file mode 100644 index 72e0c5891061..000000000000 --- a/owl-bot-staging/google-cloud-vision-v1p3beta1/snippets/product_search/add_product_to_product_set.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 vision_v1p3beta1_generated_ProductSearch_AddProductToProductSet_sync] -require "google/cloud/vision/v1p3beta1" - -## -# Snippet for the add_product_to_product_set call in the ProductSearch 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::Vision::V1p3beta1::ProductSearch::Client#add_product_to_product_set. -# -def add_product_to_product_set - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Vision::V1p3beta1::ProductSearch::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Vision::V1p3beta1::AddProductToProductSetRequest.new - - # Call the add_product_to_product_set method. - result = client.add_product_to_product_set request - - # The returned object is of type Google::Protobuf::Empty. - p result -end -# [END vision_v1p3beta1_generated_ProductSearch_AddProductToProductSet_sync] diff --git a/owl-bot-staging/google-cloud-vision-v1p3beta1/snippets/product_search/create_product.rb b/owl-bot-staging/google-cloud-vision-v1p3beta1/snippets/product_search/create_product.rb deleted file mode 100644 index 0635900e9530..000000000000 --- a/owl-bot-staging/google-cloud-vision-v1p3beta1/snippets/product_search/create_product.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 vision_v1p3beta1_generated_ProductSearch_CreateProduct_sync] -require "google/cloud/vision/v1p3beta1" - -## -# Snippet for the create_product call in the ProductSearch 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::Vision::V1p3beta1::ProductSearch::Client#create_product. -# -def create_product - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Vision::V1p3beta1::ProductSearch::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Vision::V1p3beta1::CreateProductRequest.new - - # Call the create_product method. - result = client.create_product request - - # The returned object is of type Google::Cloud::Vision::V1p3beta1::Product. - p result -end -# [END vision_v1p3beta1_generated_ProductSearch_CreateProduct_sync] diff --git a/owl-bot-staging/google-cloud-vision-v1p3beta1/snippets/product_search/create_product_set.rb b/owl-bot-staging/google-cloud-vision-v1p3beta1/snippets/product_search/create_product_set.rb deleted file mode 100644 index d347ab0fce39..000000000000 --- a/owl-bot-staging/google-cloud-vision-v1p3beta1/snippets/product_search/create_product_set.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 vision_v1p3beta1_generated_ProductSearch_CreateProductSet_sync] -require "google/cloud/vision/v1p3beta1" - -## -# Snippet for the create_product_set call in the ProductSearch 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::Vision::V1p3beta1::ProductSearch::Client#create_product_set. -# -def create_product_set - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Vision::V1p3beta1::ProductSearch::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Vision::V1p3beta1::CreateProductSetRequest.new - - # Call the create_product_set method. - result = client.create_product_set request - - # The returned object is of type Google::Cloud::Vision::V1p3beta1::ProductSet. - p result -end -# [END vision_v1p3beta1_generated_ProductSearch_CreateProductSet_sync] diff --git a/owl-bot-staging/google-cloud-vision-v1p3beta1/snippets/product_search/create_reference_image.rb b/owl-bot-staging/google-cloud-vision-v1p3beta1/snippets/product_search/create_reference_image.rb deleted file mode 100644 index 7e78ab1f7330..000000000000 --- a/owl-bot-staging/google-cloud-vision-v1p3beta1/snippets/product_search/create_reference_image.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 vision_v1p3beta1_generated_ProductSearch_CreateReferenceImage_sync] -require "google/cloud/vision/v1p3beta1" - -## -# Snippet for the create_reference_image call in the ProductSearch 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::Vision::V1p3beta1::ProductSearch::Client#create_reference_image. -# -def create_reference_image - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Vision::V1p3beta1::ProductSearch::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Vision::V1p3beta1::CreateReferenceImageRequest.new - - # Call the create_reference_image method. - result = client.create_reference_image request - - # The returned object is of type Google::Cloud::Vision::V1p3beta1::ReferenceImage. - p result -end -# [END vision_v1p3beta1_generated_ProductSearch_CreateReferenceImage_sync] diff --git a/owl-bot-staging/google-cloud-vision-v1p3beta1/snippets/product_search/delete_product.rb b/owl-bot-staging/google-cloud-vision-v1p3beta1/snippets/product_search/delete_product.rb deleted file mode 100644 index 44eb1115fb95..000000000000 --- a/owl-bot-staging/google-cloud-vision-v1p3beta1/snippets/product_search/delete_product.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 vision_v1p3beta1_generated_ProductSearch_DeleteProduct_sync] -require "google/cloud/vision/v1p3beta1" - -## -# Snippet for the delete_product call in the ProductSearch 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::Vision::V1p3beta1::ProductSearch::Client#delete_product. -# -def delete_product - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Vision::V1p3beta1::ProductSearch::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Vision::V1p3beta1::DeleteProductRequest.new - - # Call the delete_product method. - result = client.delete_product request - - # The returned object is of type Google::Protobuf::Empty. - p result -end -# [END vision_v1p3beta1_generated_ProductSearch_DeleteProduct_sync] diff --git a/owl-bot-staging/google-cloud-vision-v1p3beta1/snippets/product_search/delete_product_set.rb b/owl-bot-staging/google-cloud-vision-v1p3beta1/snippets/product_search/delete_product_set.rb deleted file mode 100644 index 0618c52f4d7a..000000000000 --- a/owl-bot-staging/google-cloud-vision-v1p3beta1/snippets/product_search/delete_product_set.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 vision_v1p3beta1_generated_ProductSearch_DeleteProductSet_sync] -require "google/cloud/vision/v1p3beta1" - -## -# Snippet for the delete_product_set call in the ProductSearch 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::Vision::V1p3beta1::ProductSearch::Client#delete_product_set. -# -def delete_product_set - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Vision::V1p3beta1::ProductSearch::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Vision::V1p3beta1::DeleteProductSetRequest.new - - # Call the delete_product_set method. - result = client.delete_product_set request - - # The returned object is of type Google::Protobuf::Empty. - p result -end -# [END vision_v1p3beta1_generated_ProductSearch_DeleteProductSet_sync] diff --git a/owl-bot-staging/google-cloud-vision-v1p3beta1/snippets/product_search/delete_reference_image.rb b/owl-bot-staging/google-cloud-vision-v1p3beta1/snippets/product_search/delete_reference_image.rb deleted file mode 100644 index fcae51b9374c..000000000000 --- a/owl-bot-staging/google-cloud-vision-v1p3beta1/snippets/product_search/delete_reference_image.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 vision_v1p3beta1_generated_ProductSearch_DeleteReferenceImage_sync] -require "google/cloud/vision/v1p3beta1" - -## -# Snippet for the delete_reference_image call in the ProductSearch 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::Vision::V1p3beta1::ProductSearch::Client#delete_reference_image. -# -def delete_reference_image - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Vision::V1p3beta1::ProductSearch::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Vision::V1p3beta1::DeleteReferenceImageRequest.new - - # Call the delete_reference_image method. - result = client.delete_reference_image request - - # The returned object is of type Google::Protobuf::Empty. - p result -end -# [END vision_v1p3beta1_generated_ProductSearch_DeleteReferenceImage_sync] diff --git a/owl-bot-staging/google-cloud-vision-v1p3beta1/snippets/product_search/get_product.rb b/owl-bot-staging/google-cloud-vision-v1p3beta1/snippets/product_search/get_product.rb deleted file mode 100644 index ba15d6232a7f..000000000000 --- a/owl-bot-staging/google-cloud-vision-v1p3beta1/snippets/product_search/get_product.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 vision_v1p3beta1_generated_ProductSearch_GetProduct_sync] -require "google/cloud/vision/v1p3beta1" - -## -# Snippet for the get_product call in the ProductSearch 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::Vision::V1p3beta1::ProductSearch::Client#get_product. -# -def get_product - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Vision::V1p3beta1::ProductSearch::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Vision::V1p3beta1::GetProductRequest.new - - # Call the get_product method. - result = client.get_product request - - # The returned object is of type Google::Cloud::Vision::V1p3beta1::Product. - p result -end -# [END vision_v1p3beta1_generated_ProductSearch_GetProduct_sync] diff --git a/owl-bot-staging/google-cloud-vision-v1p3beta1/snippets/product_search/get_product_set.rb b/owl-bot-staging/google-cloud-vision-v1p3beta1/snippets/product_search/get_product_set.rb deleted file mode 100644 index d62d02cb2ff2..000000000000 --- a/owl-bot-staging/google-cloud-vision-v1p3beta1/snippets/product_search/get_product_set.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 vision_v1p3beta1_generated_ProductSearch_GetProductSet_sync] -require "google/cloud/vision/v1p3beta1" - -## -# Snippet for the get_product_set call in the ProductSearch 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::Vision::V1p3beta1::ProductSearch::Client#get_product_set. -# -def get_product_set - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Vision::V1p3beta1::ProductSearch::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Vision::V1p3beta1::GetProductSetRequest.new - - # Call the get_product_set method. - result = client.get_product_set request - - # The returned object is of type Google::Cloud::Vision::V1p3beta1::ProductSet. - p result -end -# [END vision_v1p3beta1_generated_ProductSearch_GetProductSet_sync] diff --git a/owl-bot-staging/google-cloud-vision-v1p3beta1/snippets/product_search/get_reference_image.rb b/owl-bot-staging/google-cloud-vision-v1p3beta1/snippets/product_search/get_reference_image.rb deleted file mode 100644 index 8b5f078cbab2..000000000000 --- a/owl-bot-staging/google-cloud-vision-v1p3beta1/snippets/product_search/get_reference_image.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 vision_v1p3beta1_generated_ProductSearch_GetReferenceImage_sync] -require "google/cloud/vision/v1p3beta1" - -## -# Snippet for the get_reference_image call in the ProductSearch 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::Vision::V1p3beta1::ProductSearch::Client#get_reference_image. -# -def get_reference_image - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Vision::V1p3beta1::ProductSearch::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Vision::V1p3beta1::GetReferenceImageRequest.new - - # Call the get_reference_image method. - result = client.get_reference_image request - - # The returned object is of type Google::Cloud::Vision::V1p3beta1::ReferenceImage. - p result -end -# [END vision_v1p3beta1_generated_ProductSearch_GetReferenceImage_sync] diff --git a/owl-bot-staging/google-cloud-vision-v1p3beta1/snippets/product_search/import_product_sets.rb b/owl-bot-staging/google-cloud-vision-v1p3beta1/snippets/product_search/import_product_sets.rb deleted file mode 100644 index a17e856f8db6..000000000000 --- a/owl-bot-staging/google-cloud-vision-v1p3beta1/snippets/product_search/import_product_sets.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 vision_v1p3beta1_generated_ProductSearch_ImportProductSets_sync] -require "google/cloud/vision/v1p3beta1" - -## -# Snippet for the import_product_sets call in the ProductSearch 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::Vision::V1p3beta1::ProductSearch::Client#import_product_sets. -# -def import_product_sets - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Vision::V1p3beta1::ProductSearch::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Vision::V1p3beta1::ImportProductSetsRequest.new - - # Call the import_product_sets method. - result = client.import_product_sets 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 vision_v1p3beta1_generated_ProductSearch_ImportProductSets_sync] diff --git a/owl-bot-staging/google-cloud-vision-v1p3beta1/snippets/product_search/list_product_sets.rb b/owl-bot-staging/google-cloud-vision-v1p3beta1/snippets/product_search/list_product_sets.rb deleted file mode 100644 index 07e3dc4caf09..000000000000 --- a/owl-bot-staging/google-cloud-vision-v1p3beta1/snippets/product_search/list_product_sets.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 vision_v1p3beta1_generated_ProductSearch_ListProductSets_sync] -require "google/cloud/vision/v1p3beta1" - -## -# Snippet for the list_product_sets call in the ProductSearch 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::Vision::V1p3beta1::ProductSearch::Client#list_product_sets. -# -def list_product_sets - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Vision::V1p3beta1::ProductSearch::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Vision::V1p3beta1::ListProductSetsRequest.new - - # Call the list_product_sets method. - result = client.list_product_sets 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::Vision::V1p3beta1::ProductSet. - p item - end -end -# [END vision_v1p3beta1_generated_ProductSearch_ListProductSets_sync] diff --git a/owl-bot-staging/google-cloud-vision-v1p3beta1/snippets/product_search/list_products.rb b/owl-bot-staging/google-cloud-vision-v1p3beta1/snippets/product_search/list_products.rb deleted file mode 100644 index 99dca5f70254..000000000000 --- a/owl-bot-staging/google-cloud-vision-v1p3beta1/snippets/product_search/list_products.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 vision_v1p3beta1_generated_ProductSearch_ListProducts_sync] -require "google/cloud/vision/v1p3beta1" - -## -# Snippet for the list_products call in the ProductSearch 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::Vision::V1p3beta1::ProductSearch::Client#list_products. -# -def list_products - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Vision::V1p3beta1::ProductSearch::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Vision::V1p3beta1::ListProductsRequest.new - - # Call the list_products method. - result = client.list_products 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::Vision::V1p3beta1::Product. - p item - end -end -# [END vision_v1p3beta1_generated_ProductSearch_ListProducts_sync] diff --git a/owl-bot-staging/google-cloud-vision-v1p3beta1/snippets/product_search/list_products_in_product_set.rb b/owl-bot-staging/google-cloud-vision-v1p3beta1/snippets/product_search/list_products_in_product_set.rb deleted file mode 100644 index 530fec8cb1d7..000000000000 --- a/owl-bot-staging/google-cloud-vision-v1p3beta1/snippets/product_search/list_products_in_product_set.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 vision_v1p3beta1_generated_ProductSearch_ListProductsInProductSet_sync] -require "google/cloud/vision/v1p3beta1" - -## -# Snippet for the list_products_in_product_set call in the ProductSearch 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::Vision::V1p3beta1::ProductSearch::Client#list_products_in_product_set. -# -def list_products_in_product_set - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Vision::V1p3beta1::ProductSearch::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Vision::V1p3beta1::ListProductsInProductSetRequest.new - - # Call the list_products_in_product_set method. - result = client.list_products_in_product_set 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::Vision::V1p3beta1::Product. - p item - end -end -# [END vision_v1p3beta1_generated_ProductSearch_ListProductsInProductSet_sync] diff --git a/owl-bot-staging/google-cloud-vision-v1p3beta1/snippets/product_search/list_reference_images.rb b/owl-bot-staging/google-cloud-vision-v1p3beta1/snippets/product_search/list_reference_images.rb deleted file mode 100644 index d0307e5133e8..000000000000 --- a/owl-bot-staging/google-cloud-vision-v1p3beta1/snippets/product_search/list_reference_images.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 vision_v1p3beta1_generated_ProductSearch_ListReferenceImages_sync] -require "google/cloud/vision/v1p3beta1" - -## -# Snippet for the list_reference_images call in the ProductSearch 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::Vision::V1p3beta1::ProductSearch::Client#list_reference_images. -# -def list_reference_images - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Vision::V1p3beta1::ProductSearch::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Vision::V1p3beta1::ListReferenceImagesRequest.new - - # Call the list_reference_images method. - result = client.list_reference_images 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::Vision::V1p3beta1::ReferenceImage. - p item - end -end -# [END vision_v1p3beta1_generated_ProductSearch_ListReferenceImages_sync] diff --git a/owl-bot-staging/google-cloud-vision-v1p3beta1/snippets/product_search/remove_product_from_product_set.rb b/owl-bot-staging/google-cloud-vision-v1p3beta1/snippets/product_search/remove_product_from_product_set.rb deleted file mode 100644 index e5748c283499..000000000000 --- a/owl-bot-staging/google-cloud-vision-v1p3beta1/snippets/product_search/remove_product_from_product_set.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 vision_v1p3beta1_generated_ProductSearch_RemoveProductFromProductSet_sync] -require "google/cloud/vision/v1p3beta1" - -## -# Snippet for the remove_product_from_product_set call in the ProductSearch 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::Vision::V1p3beta1::ProductSearch::Client#remove_product_from_product_set. -# -def remove_product_from_product_set - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Vision::V1p3beta1::ProductSearch::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Vision::V1p3beta1::RemoveProductFromProductSetRequest.new - - # Call the remove_product_from_product_set method. - result = client.remove_product_from_product_set request - - # The returned object is of type Google::Protobuf::Empty. - p result -end -# [END vision_v1p3beta1_generated_ProductSearch_RemoveProductFromProductSet_sync] diff --git a/owl-bot-staging/google-cloud-vision-v1p3beta1/snippets/product_search/update_product.rb b/owl-bot-staging/google-cloud-vision-v1p3beta1/snippets/product_search/update_product.rb deleted file mode 100644 index e1e3020720cd..000000000000 --- a/owl-bot-staging/google-cloud-vision-v1p3beta1/snippets/product_search/update_product.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 vision_v1p3beta1_generated_ProductSearch_UpdateProduct_sync] -require "google/cloud/vision/v1p3beta1" - -## -# Snippet for the update_product call in the ProductSearch 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::Vision::V1p3beta1::ProductSearch::Client#update_product. -# -def update_product - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Vision::V1p3beta1::ProductSearch::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Vision::V1p3beta1::UpdateProductRequest.new - - # Call the update_product method. - result = client.update_product request - - # The returned object is of type Google::Cloud::Vision::V1p3beta1::Product. - p result -end -# [END vision_v1p3beta1_generated_ProductSearch_UpdateProduct_sync] diff --git a/owl-bot-staging/google-cloud-vision-v1p3beta1/snippets/product_search/update_product_set.rb b/owl-bot-staging/google-cloud-vision-v1p3beta1/snippets/product_search/update_product_set.rb deleted file mode 100644 index ca7c016737e8..000000000000 --- a/owl-bot-staging/google-cloud-vision-v1p3beta1/snippets/product_search/update_product_set.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 vision_v1p3beta1_generated_ProductSearch_UpdateProductSet_sync] -require "google/cloud/vision/v1p3beta1" - -## -# Snippet for the update_product_set call in the ProductSearch 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::Vision::V1p3beta1::ProductSearch::Client#update_product_set. -# -def update_product_set - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Vision::V1p3beta1::ProductSearch::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Vision::V1p3beta1::UpdateProductSetRequest.new - - # Call the update_product_set method. - result = client.update_product_set request - - # The returned object is of type Google::Cloud::Vision::V1p3beta1::ProductSet. - p result -end -# [END vision_v1p3beta1_generated_ProductSearch_UpdateProductSet_sync] diff --git a/owl-bot-staging/google-cloud-vision-v1p3beta1/snippets/snippet_metadata_google.cloud.vision.v1p3beta1.json b/owl-bot-staging/google-cloud-vision-v1p3beta1/snippets/snippet_metadata_google.cloud.vision.v1p3beta1.json deleted file mode 100644 index 3fe8aa600c9d..000000000000 --- a/owl-bot-staging/google-cloud-vision-v1p3beta1/snippets/snippet_metadata_google.cloud.vision.v1p3beta1.json +++ /dev/null @@ -1,815 +0,0 @@ -{ - "client_library": { - "name": "google-cloud-vision-v1p3beta1", - "version": "", - "language": "RUBY", - "apis": [ - { - "id": "google.cloud.vision.v1p3beta1", - "version": "v1p3beta1" - } - ] - }, - "snippets": [ - { - "region_tag": "vision_v1p3beta1_generated_ProductSearch_CreateProductSet_sync", - "title": "Snippet for the create_product_set call in the ProductSearch service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Vision::V1p3beta1::ProductSearch::Client#create_product_set.", - "file": "product_search/create_product_set.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_product_set", - "full_name": "::Google::Cloud::Vision::V1p3beta1::ProductSearch::Client#create_product_set", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Vision::V1p3beta1::CreateProductSetRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Vision::V1p3beta1::ProductSet", - "client": { - "short_name": "ProductSearch::Client", - "full_name": "::Google::Cloud::Vision::V1p3beta1::ProductSearch::Client" - }, - "method": { - "short_name": "CreateProductSet", - "full_name": "google.cloud.vision.v1p3beta1.ProductSearch.CreateProductSet", - "service": { - "short_name": "ProductSearch", - "full_name": "google.cloud.vision.v1p3beta1.ProductSearch" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "vision_v1p3beta1_generated_ProductSearch_ListProductSets_sync", - "title": "Snippet for the list_product_sets call in the ProductSearch service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Vision::V1p3beta1::ProductSearch::Client#list_product_sets.", - "file": "product_search/list_product_sets.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_product_sets", - "full_name": "::Google::Cloud::Vision::V1p3beta1::ProductSearch::Client#list_product_sets", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Vision::V1p3beta1::ListProductSetsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Vision::V1p3beta1::ListProductSetsResponse", - "client": { - "short_name": "ProductSearch::Client", - "full_name": "::Google::Cloud::Vision::V1p3beta1::ProductSearch::Client" - }, - "method": { - "short_name": "ListProductSets", - "full_name": "google.cloud.vision.v1p3beta1.ProductSearch.ListProductSets", - "service": { - "short_name": "ProductSearch", - "full_name": "google.cloud.vision.v1p3beta1.ProductSearch" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "vision_v1p3beta1_generated_ProductSearch_GetProductSet_sync", - "title": "Snippet for the get_product_set call in the ProductSearch service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Vision::V1p3beta1::ProductSearch::Client#get_product_set.", - "file": "product_search/get_product_set.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_product_set", - "full_name": "::Google::Cloud::Vision::V1p3beta1::ProductSearch::Client#get_product_set", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Vision::V1p3beta1::GetProductSetRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Vision::V1p3beta1::ProductSet", - "client": { - "short_name": "ProductSearch::Client", - "full_name": "::Google::Cloud::Vision::V1p3beta1::ProductSearch::Client" - }, - "method": { - "short_name": "GetProductSet", - "full_name": "google.cloud.vision.v1p3beta1.ProductSearch.GetProductSet", - "service": { - "short_name": "ProductSearch", - "full_name": "google.cloud.vision.v1p3beta1.ProductSearch" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "vision_v1p3beta1_generated_ProductSearch_UpdateProductSet_sync", - "title": "Snippet for the update_product_set call in the ProductSearch service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Vision::V1p3beta1::ProductSearch::Client#update_product_set.", - "file": "product_search/update_product_set.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_product_set", - "full_name": "::Google::Cloud::Vision::V1p3beta1::ProductSearch::Client#update_product_set", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Vision::V1p3beta1::UpdateProductSetRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Vision::V1p3beta1::ProductSet", - "client": { - "short_name": "ProductSearch::Client", - "full_name": "::Google::Cloud::Vision::V1p3beta1::ProductSearch::Client" - }, - "method": { - "short_name": "UpdateProductSet", - "full_name": "google.cloud.vision.v1p3beta1.ProductSearch.UpdateProductSet", - "service": { - "short_name": "ProductSearch", - "full_name": "google.cloud.vision.v1p3beta1.ProductSearch" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "vision_v1p3beta1_generated_ProductSearch_DeleteProductSet_sync", - "title": "Snippet for the delete_product_set call in the ProductSearch service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Vision::V1p3beta1::ProductSearch::Client#delete_product_set.", - "file": "product_search/delete_product_set.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_product_set", - "full_name": "::Google::Cloud::Vision::V1p3beta1::ProductSearch::Client#delete_product_set", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Vision::V1p3beta1::DeleteProductSetRequest", - "name": "request" - } - ], - "result_type": "::Google::Protobuf::Empty", - "client": { - "short_name": "ProductSearch::Client", - "full_name": "::Google::Cloud::Vision::V1p3beta1::ProductSearch::Client" - }, - "method": { - "short_name": "DeleteProductSet", - "full_name": "google.cloud.vision.v1p3beta1.ProductSearch.DeleteProductSet", - "service": { - "short_name": "ProductSearch", - "full_name": "google.cloud.vision.v1p3beta1.ProductSearch" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "vision_v1p3beta1_generated_ProductSearch_CreateProduct_sync", - "title": "Snippet for the create_product call in the ProductSearch service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Vision::V1p3beta1::ProductSearch::Client#create_product.", - "file": "product_search/create_product.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_product", - "full_name": "::Google::Cloud::Vision::V1p3beta1::ProductSearch::Client#create_product", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Vision::V1p3beta1::CreateProductRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Vision::V1p3beta1::Product", - "client": { - "short_name": "ProductSearch::Client", - "full_name": "::Google::Cloud::Vision::V1p3beta1::ProductSearch::Client" - }, - "method": { - "short_name": "CreateProduct", - "full_name": "google.cloud.vision.v1p3beta1.ProductSearch.CreateProduct", - "service": { - "short_name": "ProductSearch", - "full_name": "google.cloud.vision.v1p3beta1.ProductSearch" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "vision_v1p3beta1_generated_ProductSearch_ListProducts_sync", - "title": "Snippet for the list_products call in the ProductSearch service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Vision::V1p3beta1::ProductSearch::Client#list_products.", - "file": "product_search/list_products.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_products", - "full_name": "::Google::Cloud::Vision::V1p3beta1::ProductSearch::Client#list_products", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Vision::V1p3beta1::ListProductsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Vision::V1p3beta1::ListProductsResponse", - "client": { - "short_name": "ProductSearch::Client", - "full_name": "::Google::Cloud::Vision::V1p3beta1::ProductSearch::Client" - }, - "method": { - "short_name": "ListProducts", - "full_name": "google.cloud.vision.v1p3beta1.ProductSearch.ListProducts", - "service": { - "short_name": "ProductSearch", - "full_name": "google.cloud.vision.v1p3beta1.ProductSearch" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "vision_v1p3beta1_generated_ProductSearch_GetProduct_sync", - "title": "Snippet for the get_product call in the ProductSearch service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Vision::V1p3beta1::ProductSearch::Client#get_product.", - "file": "product_search/get_product.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_product", - "full_name": "::Google::Cloud::Vision::V1p3beta1::ProductSearch::Client#get_product", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Vision::V1p3beta1::GetProductRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Vision::V1p3beta1::Product", - "client": { - "short_name": "ProductSearch::Client", - "full_name": "::Google::Cloud::Vision::V1p3beta1::ProductSearch::Client" - }, - "method": { - "short_name": "GetProduct", - "full_name": "google.cloud.vision.v1p3beta1.ProductSearch.GetProduct", - "service": { - "short_name": "ProductSearch", - "full_name": "google.cloud.vision.v1p3beta1.ProductSearch" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "vision_v1p3beta1_generated_ProductSearch_UpdateProduct_sync", - "title": "Snippet for the update_product call in the ProductSearch service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Vision::V1p3beta1::ProductSearch::Client#update_product.", - "file": "product_search/update_product.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_product", - "full_name": "::Google::Cloud::Vision::V1p3beta1::ProductSearch::Client#update_product", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Vision::V1p3beta1::UpdateProductRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Vision::V1p3beta1::Product", - "client": { - "short_name": "ProductSearch::Client", - "full_name": "::Google::Cloud::Vision::V1p3beta1::ProductSearch::Client" - }, - "method": { - "short_name": "UpdateProduct", - "full_name": "google.cloud.vision.v1p3beta1.ProductSearch.UpdateProduct", - "service": { - "short_name": "ProductSearch", - "full_name": "google.cloud.vision.v1p3beta1.ProductSearch" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "vision_v1p3beta1_generated_ProductSearch_DeleteProduct_sync", - "title": "Snippet for the delete_product call in the ProductSearch service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Vision::V1p3beta1::ProductSearch::Client#delete_product.", - "file": "product_search/delete_product.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_product", - "full_name": "::Google::Cloud::Vision::V1p3beta1::ProductSearch::Client#delete_product", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Vision::V1p3beta1::DeleteProductRequest", - "name": "request" - } - ], - "result_type": "::Google::Protobuf::Empty", - "client": { - "short_name": "ProductSearch::Client", - "full_name": "::Google::Cloud::Vision::V1p3beta1::ProductSearch::Client" - }, - "method": { - "short_name": "DeleteProduct", - "full_name": "google.cloud.vision.v1p3beta1.ProductSearch.DeleteProduct", - "service": { - "short_name": "ProductSearch", - "full_name": "google.cloud.vision.v1p3beta1.ProductSearch" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "vision_v1p3beta1_generated_ProductSearch_CreateReferenceImage_sync", - "title": "Snippet for the create_reference_image call in the ProductSearch service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Vision::V1p3beta1::ProductSearch::Client#create_reference_image.", - "file": "product_search/create_reference_image.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_reference_image", - "full_name": "::Google::Cloud::Vision::V1p3beta1::ProductSearch::Client#create_reference_image", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Vision::V1p3beta1::CreateReferenceImageRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Vision::V1p3beta1::ReferenceImage", - "client": { - "short_name": "ProductSearch::Client", - "full_name": "::Google::Cloud::Vision::V1p3beta1::ProductSearch::Client" - }, - "method": { - "short_name": "CreateReferenceImage", - "full_name": "google.cloud.vision.v1p3beta1.ProductSearch.CreateReferenceImage", - "service": { - "short_name": "ProductSearch", - "full_name": "google.cloud.vision.v1p3beta1.ProductSearch" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "vision_v1p3beta1_generated_ProductSearch_DeleteReferenceImage_sync", - "title": "Snippet for the delete_reference_image call in the ProductSearch service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Vision::V1p3beta1::ProductSearch::Client#delete_reference_image.", - "file": "product_search/delete_reference_image.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_reference_image", - "full_name": "::Google::Cloud::Vision::V1p3beta1::ProductSearch::Client#delete_reference_image", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Vision::V1p3beta1::DeleteReferenceImageRequest", - "name": "request" - } - ], - "result_type": "::Google::Protobuf::Empty", - "client": { - "short_name": "ProductSearch::Client", - "full_name": "::Google::Cloud::Vision::V1p3beta1::ProductSearch::Client" - }, - "method": { - "short_name": "DeleteReferenceImage", - "full_name": "google.cloud.vision.v1p3beta1.ProductSearch.DeleteReferenceImage", - "service": { - "short_name": "ProductSearch", - "full_name": "google.cloud.vision.v1p3beta1.ProductSearch" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "vision_v1p3beta1_generated_ProductSearch_ListReferenceImages_sync", - "title": "Snippet for the list_reference_images call in the ProductSearch service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Vision::V1p3beta1::ProductSearch::Client#list_reference_images.", - "file": "product_search/list_reference_images.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_reference_images", - "full_name": "::Google::Cloud::Vision::V1p3beta1::ProductSearch::Client#list_reference_images", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Vision::V1p3beta1::ListReferenceImagesRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Vision::V1p3beta1::ListReferenceImagesResponse", - "client": { - "short_name": "ProductSearch::Client", - "full_name": "::Google::Cloud::Vision::V1p3beta1::ProductSearch::Client" - }, - "method": { - "short_name": "ListReferenceImages", - "full_name": "google.cloud.vision.v1p3beta1.ProductSearch.ListReferenceImages", - "service": { - "short_name": "ProductSearch", - "full_name": "google.cloud.vision.v1p3beta1.ProductSearch" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "vision_v1p3beta1_generated_ProductSearch_GetReferenceImage_sync", - "title": "Snippet for the get_reference_image call in the ProductSearch service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Vision::V1p3beta1::ProductSearch::Client#get_reference_image.", - "file": "product_search/get_reference_image.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_reference_image", - "full_name": "::Google::Cloud::Vision::V1p3beta1::ProductSearch::Client#get_reference_image", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Vision::V1p3beta1::GetReferenceImageRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Vision::V1p3beta1::ReferenceImage", - "client": { - "short_name": "ProductSearch::Client", - "full_name": "::Google::Cloud::Vision::V1p3beta1::ProductSearch::Client" - }, - "method": { - "short_name": "GetReferenceImage", - "full_name": "google.cloud.vision.v1p3beta1.ProductSearch.GetReferenceImage", - "service": { - "short_name": "ProductSearch", - "full_name": "google.cloud.vision.v1p3beta1.ProductSearch" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "vision_v1p3beta1_generated_ProductSearch_AddProductToProductSet_sync", - "title": "Snippet for the add_product_to_product_set call in the ProductSearch service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Vision::V1p3beta1::ProductSearch::Client#add_product_to_product_set.", - "file": "product_search/add_product_to_product_set.rb", - "language": "RUBY", - "client_method": { - "short_name": "add_product_to_product_set", - "full_name": "::Google::Cloud::Vision::V1p3beta1::ProductSearch::Client#add_product_to_product_set", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Vision::V1p3beta1::AddProductToProductSetRequest", - "name": "request" - } - ], - "result_type": "::Google::Protobuf::Empty", - "client": { - "short_name": "ProductSearch::Client", - "full_name": "::Google::Cloud::Vision::V1p3beta1::ProductSearch::Client" - }, - "method": { - "short_name": "AddProductToProductSet", - "full_name": "google.cloud.vision.v1p3beta1.ProductSearch.AddProductToProductSet", - "service": { - "short_name": "ProductSearch", - "full_name": "google.cloud.vision.v1p3beta1.ProductSearch" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "vision_v1p3beta1_generated_ProductSearch_RemoveProductFromProductSet_sync", - "title": "Snippet for the remove_product_from_product_set call in the ProductSearch service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Vision::V1p3beta1::ProductSearch::Client#remove_product_from_product_set.", - "file": "product_search/remove_product_from_product_set.rb", - "language": "RUBY", - "client_method": { - "short_name": "remove_product_from_product_set", - "full_name": "::Google::Cloud::Vision::V1p3beta1::ProductSearch::Client#remove_product_from_product_set", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Vision::V1p3beta1::RemoveProductFromProductSetRequest", - "name": "request" - } - ], - "result_type": "::Google::Protobuf::Empty", - "client": { - "short_name": "ProductSearch::Client", - "full_name": "::Google::Cloud::Vision::V1p3beta1::ProductSearch::Client" - }, - "method": { - "short_name": "RemoveProductFromProductSet", - "full_name": "google.cloud.vision.v1p3beta1.ProductSearch.RemoveProductFromProductSet", - "service": { - "short_name": "ProductSearch", - "full_name": "google.cloud.vision.v1p3beta1.ProductSearch" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "vision_v1p3beta1_generated_ProductSearch_ListProductsInProductSet_sync", - "title": "Snippet for the list_products_in_product_set call in the ProductSearch service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Vision::V1p3beta1::ProductSearch::Client#list_products_in_product_set.", - "file": "product_search/list_products_in_product_set.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_products_in_product_set", - "full_name": "::Google::Cloud::Vision::V1p3beta1::ProductSearch::Client#list_products_in_product_set", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Vision::V1p3beta1::ListProductsInProductSetRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Vision::V1p3beta1::ListProductsInProductSetResponse", - "client": { - "short_name": "ProductSearch::Client", - "full_name": "::Google::Cloud::Vision::V1p3beta1::ProductSearch::Client" - }, - "method": { - "short_name": "ListProductsInProductSet", - "full_name": "google.cloud.vision.v1p3beta1.ProductSearch.ListProductsInProductSet", - "service": { - "short_name": "ProductSearch", - "full_name": "google.cloud.vision.v1p3beta1.ProductSearch" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "vision_v1p3beta1_generated_ProductSearch_ImportProductSets_sync", - "title": "Snippet for the import_product_sets call in the ProductSearch service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Vision::V1p3beta1::ProductSearch::Client#import_product_sets.", - "file": "product_search/import_product_sets.rb", - "language": "RUBY", - "client_method": { - "short_name": "import_product_sets", - "full_name": "::Google::Cloud::Vision::V1p3beta1::ProductSearch::Client#import_product_sets", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Vision::V1p3beta1::ImportProductSetsRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "ProductSearch::Client", - "full_name": "::Google::Cloud::Vision::V1p3beta1::ProductSearch::Client" - }, - "method": { - "short_name": "ImportProductSets", - "full_name": "google.cloud.vision.v1p3beta1.ProductSearch.ImportProductSets", - "service": { - "short_name": "ProductSearch", - "full_name": "google.cloud.vision.v1p3beta1.ProductSearch" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "vision_v1p3beta1_generated_ImageAnnotator_BatchAnnotateImages_sync", - "title": "Snippet for the batch_annotate_images call in the ImageAnnotator service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Vision::V1p3beta1::ImageAnnotator::Client#batch_annotate_images.", - "file": "image_annotator/batch_annotate_images.rb", - "language": "RUBY", - "client_method": { - "short_name": "batch_annotate_images", - "full_name": "::Google::Cloud::Vision::V1p3beta1::ImageAnnotator::Client#batch_annotate_images", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Vision::V1p3beta1::BatchAnnotateImagesRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Vision::V1p3beta1::BatchAnnotateImagesResponse", - "client": { - "short_name": "ImageAnnotator::Client", - "full_name": "::Google::Cloud::Vision::V1p3beta1::ImageAnnotator::Client" - }, - "method": { - "short_name": "BatchAnnotateImages", - "full_name": "google.cloud.vision.v1p3beta1.ImageAnnotator.BatchAnnotateImages", - "service": { - "short_name": "ImageAnnotator", - "full_name": "google.cloud.vision.v1p3beta1.ImageAnnotator" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "vision_v1p3beta1_generated_ImageAnnotator_AsyncBatchAnnotateFiles_sync", - "title": "Snippet for the async_batch_annotate_files call in the ImageAnnotator service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Vision::V1p3beta1::ImageAnnotator::Client#async_batch_annotate_files.", - "file": "image_annotator/async_batch_annotate_files.rb", - "language": "RUBY", - "client_method": { - "short_name": "async_batch_annotate_files", - "full_name": "::Google::Cloud::Vision::V1p3beta1::ImageAnnotator::Client#async_batch_annotate_files", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Vision::V1p3beta1::AsyncBatchAnnotateFilesRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "ImageAnnotator::Client", - "full_name": "::Google::Cloud::Vision::V1p3beta1::ImageAnnotator::Client" - }, - "method": { - "short_name": "AsyncBatchAnnotateFiles", - "full_name": "google.cloud.vision.v1p3beta1.ImageAnnotator.AsyncBatchAnnotateFiles", - "service": { - "short_name": "ImageAnnotator", - "full_name": "google.cloud.vision.v1p3beta1.ImageAnnotator" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - } - ] -} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-vision-v1p3beta1/test/google/cloud/vision/v1p3beta1/image_annotator_operations_test.rb b/owl-bot-staging/google-cloud-vision-v1p3beta1/test/google/cloud/vision/v1p3beta1/image_annotator_operations_test.rb deleted file mode 100644 index f0952f2bdc85..000000000000 --- a/owl-bot-staging/google-cloud-vision-v1p3beta1/test/google/cloud/vision/v1p3beta1/image_annotator_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/vision/v1p3beta1/image_annotator_pb" -require "google/cloud/vision/v1p3beta1/image_annotator_services_pb" -require "google/cloud/vision/v1p3beta1/image_annotator" - -class ::Google::Cloud::Vision::V1p3beta1::ImageAnnotator::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::Vision::V1p3beta1::ImageAnnotator::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::Vision::V1p3beta1::ImageAnnotator::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::Vision::V1p3beta1::ImageAnnotator::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::Vision::V1p3beta1::ImageAnnotator::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::Vision::V1p3beta1::ImageAnnotator::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::Vision::V1p3beta1::ImageAnnotator::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::Vision::V1p3beta1::ImageAnnotator::Operations::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-vision-v1p3beta1/test/google/cloud/vision/v1p3beta1/image_annotator_paths_test.rb b/owl-bot-staging/google-cloud-vision-v1p3beta1/test/google/cloud/vision/v1p3beta1/image_annotator_paths_test.rb deleted file mode 100644 index d1b56b68f316..000000000000 --- a/owl-bot-staging/google-cloud-vision-v1p3beta1/test/google/cloud/vision/v1p3beta1/image_annotator_paths_test.rb +++ /dev/null @@ -1,55 +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/vision/v1p3beta1/image_annotator" - -class ::Google::Cloud::Vision::V1p3beta1::ImageAnnotator::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_product_set_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Vision::V1p3beta1::ImageAnnotator::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.product_set_path project: "value0", location: "value1", product_set: "value2" - assert_equal "projects/value0/locations/value1/productSets/value2", path - end - end -end diff --git a/owl-bot-staging/google-cloud-vision-v1p3beta1/test/google/cloud/vision/v1p3beta1/image_annotator_rest_test.rb b/owl-bot-staging/google-cloud-vision-v1p3beta1/test/google/cloud/vision/v1p3beta1/image_annotator_rest_test.rb deleted file mode 100644 index b3a646a63442..000000000000 --- a/owl-bot-staging/google-cloud-vision-v1p3beta1/test/google/cloud/vision/v1p3beta1/image_annotator_rest_test.rb +++ /dev/null @@ -1,207 +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/vision/v1p3beta1/image_annotator_pb" -require "google/cloud/vision/v1p3beta1/image_annotator/rest" - - -class ::Google::Cloud::Vision::V1p3beta1::ImageAnnotator::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_batch_annotate_images - # Create test objects. - client_result = ::Google::Cloud::Vision::V1p3beta1::BatchAnnotateImagesResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - requests = [{}] - - batch_annotate_images_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::Vision::V1p3beta1::ImageAnnotator::Rest::ServiceStub.stub :transcode_batch_annotate_images_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, batch_annotate_images_client_stub do - # Create client - client = ::Google::Cloud::Vision::V1p3beta1::ImageAnnotator::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.batch_annotate_images({ requests: requests }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.batch_annotate_images requests: requests do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.batch_annotate_images ::Google::Cloud::Vision::V1p3beta1::BatchAnnotateImagesRequest.new(requests: requests) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.batch_annotate_images({ requests: requests }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.batch_annotate_images(::Google::Cloud::Vision::V1p3beta1::BatchAnnotateImagesRequest.new(requests: requests), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, batch_annotate_images_client_stub.call_count - end - end - end - - def test_async_batch_annotate_files - # 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. - requests = [{}] - - async_batch_annotate_files_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::Vision::V1p3beta1::ImageAnnotator::Rest::ServiceStub.stub :transcode_async_batch_annotate_files_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, async_batch_annotate_files_client_stub do - # Create client - client = ::Google::Cloud::Vision::V1p3beta1::ImageAnnotator::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.async_batch_annotate_files({ requests: requests }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.async_batch_annotate_files requests: requests do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.async_batch_annotate_files ::Google::Cloud::Vision::V1p3beta1::AsyncBatchAnnotateFilesRequest.new(requests: requests) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.async_batch_annotate_files({ requests: requests }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.async_batch_annotate_files(::Google::Cloud::Vision::V1p3beta1::AsyncBatchAnnotateFilesRequest.new(requests: requests), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, async_batch_annotate_files_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::Vision::V1p3beta1::ImageAnnotator::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::Vision::V1p3beta1::ImageAnnotator::Rest::Client::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-vision-v1p3beta1/test/google/cloud/vision/v1p3beta1/image_annotator_test.rb b/owl-bot-staging/google-cloud-vision-v1p3beta1/test/google/cloud/vision/v1p3beta1/image_annotator_test.rb deleted file mode 100644 index dec04f8ba62f..000000000000 --- a/owl-bot-staging/google-cloud-vision-v1p3beta1/test/google/cloud/vision/v1p3beta1/image_annotator_test.rb +++ /dev/null @@ -1,239 +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/vision/v1p3beta1/image_annotator_pb" -require "google/cloud/vision/v1p3beta1/image_annotator" - -class ::Google::Cloud::Vision::V1p3beta1::ImageAnnotator::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_batch_annotate_images - # Create GRPC objects. - grpc_response = ::Google::Cloud::Vision::V1p3beta1::BatchAnnotateImagesResponse.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. - requests = [{}] - - batch_annotate_images_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :batch_annotate_images, name - assert_kind_of ::Google::Cloud::Vision::V1p3beta1::BatchAnnotateImagesRequest, request - assert_kind_of ::Google::Cloud::Vision::V1p3beta1::AnnotateImageRequest, request["requests"].first - refute_nil options - end - - Gapic::ServiceStub.stub :new, batch_annotate_images_client_stub do - # Create client - client = ::Google::Cloud::Vision::V1p3beta1::ImageAnnotator::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.batch_annotate_images({ requests: requests }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.batch_annotate_images requests: requests do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.batch_annotate_images ::Google::Cloud::Vision::V1p3beta1::BatchAnnotateImagesRequest.new(requests: requests) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.batch_annotate_images({ requests: requests }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.batch_annotate_images(::Google::Cloud::Vision::V1p3beta1::BatchAnnotateImagesRequest.new(requests: requests), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, batch_annotate_images_client_stub.call_rpc_count - end - end - - def test_async_batch_annotate_files - # 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. - requests = [{}] - - async_batch_annotate_files_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :async_batch_annotate_files, name - assert_kind_of ::Google::Cloud::Vision::V1p3beta1::AsyncBatchAnnotateFilesRequest, request - assert_kind_of ::Google::Cloud::Vision::V1p3beta1::AsyncAnnotateFileRequest, request["requests"].first - refute_nil options - end - - Gapic::ServiceStub.stub :new, async_batch_annotate_files_client_stub do - # Create client - client = ::Google::Cloud::Vision::V1p3beta1::ImageAnnotator::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.async_batch_annotate_files({ requests: requests }) 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.async_batch_annotate_files requests: requests 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.async_batch_annotate_files ::Google::Cloud::Vision::V1p3beta1::AsyncBatchAnnotateFilesRequest.new(requests: requests) 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.async_batch_annotate_files({ requests: requests }, 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.async_batch_annotate_files(::Google::Cloud::Vision::V1p3beta1::AsyncBatchAnnotateFilesRequest.new(requests: requests), 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, async_batch_annotate_files_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::Vision::V1p3beta1::ImageAnnotator::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::Vision::V1p3beta1::ImageAnnotator::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::Vision::V1p3beta1::ImageAnnotator::Client.new do |config| - config.credentials = creds - end - assert_kind_of ::Google::Cloud::Vision::V1p3beta1::ImageAnnotator::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::Vision::V1p3beta1::ImageAnnotator::Client.new do |config| - config.credentials = grpc_channel - end - end - - assert_kind_of ::Google::Cloud::Vision::V1p3beta1::ImageAnnotator::Operations, client.operations_client - end -end diff --git a/owl-bot-staging/google-cloud-vision-v1p3beta1/test/google/cloud/vision/v1p3beta1/product_search_operations_test.rb b/owl-bot-staging/google-cloud-vision-v1p3beta1/test/google/cloud/vision/v1p3beta1/product_search_operations_test.rb deleted file mode 100644 index 5b77b03de60a..000000000000 --- a/owl-bot-staging/google-cloud-vision-v1p3beta1/test/google/cloud/vision/v1p3beta1/product_search_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/vision/v1p3beta1/product_search_service_pb" -require "google/cloud/vision/v1p3beta1/product_search_service_services_pb" -require "google/cloud/vision/v1p3beta1/product_search" - -class ::Google::Cloud::Vision::V1p3beta1::ProductSearch::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::Vision::V1p3beta1::ProductSearch::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::Vision::V1p3beta1::ProductSearch::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::Vision::V1p3beta1::ProductSearch::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::Vision::V1p3beta1::ProductSearch::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::Vision::V1p3beta1::ProductSearch::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::Vision::V1p3beta1::ProductSearch::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::Vision::V1p3beta1::ProductSearch::Operations::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-vision-v1p3beta1/test/google/cloud/vision/v1p3beta1/product_search_paths_test.rb b/owl-bot-staging/google-cloud-vision-v1p3beta1/test/google/cloud/vision/v1p3beta1/product_search_paths_test.rb deleted file mode 100644 index bb6638c5da76..000000000000 --- a/owl-bot-staging/google-cloud-vision-v1p3beta1/test/google/cloud/vision/v1p3beta1/product_search_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/vision/v1p3beta1/product_search" - -class ::Google::Cloud::Vision::V1p3beta1::ProductSearch::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::Vision::V1p3beta1::ProductSearch::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_product_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Vision::V1p3beta1::ProductSearch::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.product_path project: "value0", location: "value1", product: "value2" - assert_equal "projects/value0/locations/value1/products/value2", path - end - end - - def test_product_set_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Vision::V1p3beta1::ProductSearch::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.product_set_path project: "value0", location: "value1", product_set: "value2" - assert_equal "projects/value0/locations/value1/productSets/value2", path - end - end - - def test_reference_image_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Vision::V1p3beta1::ProductSearch::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.reference_image_path project: "value0", location: "value1", product: "value2", reference_image: "value3" - assert_equal "projects/value0/locations/value1/products/value2/referenceImages/value3", path - end - end -end diff --git a/owl-bot-staging/google-cloud-vision-v1p3beta1/test/google/cloud/vision/v1p3beta1/product_search_rest_test.rb b/owl-bot-staging/google-cloud-vision-v1p3beta1/test/google/cloud/vision/v1p3beta1/product_search_rest_test.rb deleted file mode 100644 index 219d39df70f9..000000000000 --- a/owl-bot-staging/google-cloud-vision-v1p3beta1/test/google/cloud/vision/v1p3beta1/product_search_rest_test.rb +++ /dev/null @@ -1,1090 +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/vision/v1p3beta1/product_search_service_pb" -require "google/cloud/vision/v1p3beta1/product_search/rest" - - -class ::Google::Cloud::Vision::V1p3beta1::ProductSearch::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_product_set - # Create test objects. - client_result = ::Google::Cloud::Vision::V1p3beta1::ProductSet.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - product_set = {} - product_set_id = "hello world" - - create_product_set_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::Vision::V1p3beta1::ProductSearch::Rest::ServiceStub.stub :transcode_create_product_set_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_product_set_client_stub do - # Create client - client = ::Google::Cloud::Vision::V1p3beta1::ProductSearch::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_product_set({ parent: parent, product_set: product_set, product_set_id: product_set_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_product_set parent: parent, product_set: product_set, product_set_id: product_set_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_product_set ::Google::Cloud::Vision::V1p3beta1::CreateProductSetRequest.new(parent: parent, product_set: product_set, product_set_id: product_set_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_product_set({ parent: parent, product_set: product_set, product_set_id: product_set_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_product_set(::Google::Cloud::Vision::V1p3beta1::CreateProductSetRequest.new(parent: parent, product_set: product_set, product_set_id: product_set_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_product_set_client_stub.call_count - end - end - end - - def test_list_product_sets - # Create test objects. - client_result = ::Google::Cloud::Vision::V1p3beta1::ListProductSetsResponse.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_product_sets_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::Vision::V1p3beta1::ProductSearch::Rest::ServiceStub.stub :transcode_list_product_sets_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_product_sets_client_stub do - # Create client - client = ::Google::Cloud::Vision::V1p3beta1::ProductSearch::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_product_sets({ 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_product_sets 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_product_sets ::Google::Cloud::Vision::V1p3beta1::ListProductSetsRequest.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_product_sets({ 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_product_sets(::Google::Cloud::Vision::V1p3beta1::ListProductSetsRequest.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_product_sets_client_stub.call_count - end - end - end - - def test_get_product_set - # Create test objects. - client_result = ::Google::Cloud::Vision::V1p3beta1::ProductSet.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_product_set_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::Vision::V1p3beta1::ProductSearch::Rest::ServiceStub.stub :transcode_get_product_set_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_product_set_client_stub do - # Create client - client = ::Google::Cloud::Vision::V1p3beta1::ProductSearch::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_product_set({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_product_set name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_product_set ::Google::Cloud::Vision::V1p3beta1::GetProductSetRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_product_set({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_product_set(::Google::Cloud::Vision::V1p3beta1::GetProductSetRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_product_set_client_stub.call_count - end - end - end - - def test_update_product_set - # Create test objects. - client_result = ::Google::Cloud::Vision::V1p3beta1::ProductSet.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - product_set = {} - update_mask = {} - - update_product_set_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::Vision::V1p3beta1::ProductSearch::Rest::ServiceStub.stub :transcode_update_product_set_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_product_set_client_stub do - # Create client - client = ::Google::Cloud::Vision::V1p3beta1::ProductSearch::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.update_product_set({ product_set: product_set, update_mask: update_mask }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.update_product_set product_set: product_set, update_mask: update_mask do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.update_product_set ::Google::Cloud::Vision::V1p3beta1::UpdateProductSetRequest.new(product_set: product_set, update_mask: update_mask) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.update_product_set({ product_set: product_set, update_mask: update_mask }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.update_product_set(::Google::Cloud::Vision::V1p3beta1::UpdateProductSetRequest.new(product_set: product_set, update_mask: update_mask), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, update_product_set_client_stub.call_count - end - end - end - - def test_delete_product_set - # 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_product_set_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::Vision::V1p3beta1::ProductSearch::Rest::ServiceStub.stub :transcode_delete_product_set_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_product_set_client_stub do - # Create client - client = ::Google::Cloud::Vision::V1p3beta1::ProductSearch::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.delete_product_set({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.delete_product_set name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.delete_product_set ::Google::Cloud::Vision::V1p3beta1::DeleteProductSetRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.delete_product_set({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.delete_product_set(::Google::Cloud::Vision::V1p3beta1::DeleteProductSetRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, delete_product_set_client_stub.call_count - end - end - end - - def test_create_product - # Create test objects. - client_result = ::Google::Cloud::Vision::V1p3beta1::Product.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - product = {} - product_id = "hello world" - - create_product_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::Vision::V1p3beta1::ProductSearch::Rest::ServiceStub.stub :transcode_create_product_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_product_client_stub do - # Create client - client = ::Google::Cloud::Vision::V1p3beta1::ProductSearch::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_product({ parent: parent, product: product, product_id: product_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_product parent: parent, product: product, product_id: product_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_product ::Google::Cloud::Vision::V1p3beta1::CreateProductRequest.new(parent: parent, product: product, product_id: product_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_product({ parent: parent, product: product, product_id: product_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_product(::Google::Cloud::Vision::V1p3beta1::CreateProductRequest.new(parent: parent, product: product, product_id: product_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_product_client_stub.call_count - end - end - end - - def test_list_products - # Create test objects. - client_result = ::Google::Cloud::Vision::V1p3beta1::ListProductsResponse.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_products_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::Vision::V1p3beta1::ProductSearch::Rest::ServiceStub.stub :transcode_list_products_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_products_client_stub do - # Create client - client = ::Google::Cloud::Vision::V1p3beta1::ProductSearch::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_products({ 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_products 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_products ::Google::Cloud::Vision::V1p3beta1::ListProductsRequest.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_products({ 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_products(::Google::Cloud::Vision::V1p3beta1::ListProductsRequest.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_products_client_stub.call_count - end - end - end - - def test_get_product - # Create test objects. - client_result = ::Google::Cloud::Vision::V1p3beta1::Product.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_product_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::Vision::V1p3beta1::ProductSearch::Rest::ServiceStub.stub :transcode_get_product_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_product_client_stub do - # Create client - client = ::Google::Cloud::Vision::V1p3beta1::ProductSearch::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_product({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_product name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_product ::Google::Cloud::Vision::V1p3beta1::GetProductRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_product({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_product(::Google::Cloud::Vision::V1p3beta1::GetProductRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_product_client_stub.call_count - end - end - end - - def test_update_product - # Create test objects. - client_result = ::Google::Cloud::Vision::V1p3beta1::Product.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - product = {} - update_mask = {} - - update_product_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::Vision::V1p3beta1::ProductSearch::Rest::ServiceStub.stub :transcode_update_product_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_product_client_stub do - # Create client - client = ::Google::Cloud::Vision::V1p3beta1::ProductSearch::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.update_product({ product: product, update_mask: update_mask }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.update_product product: product, update_mask: update_mask do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.update_product ::Google::Cloud::Vision::V1p3beta1::UpdateProductRequest.new(product: product, update_mask: update_mask) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.update_product({ product: product, update_mask: update_mask }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.update_product(::Google::Cloud::Vision::V1p3beta1::UpdateProductRequest.new(product: product, update_mask: update_mask), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, update_product_client_stub.call_count - end - end - end - - def test_delete_product - # 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_product_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::Vision::V1p3beta1::ProductSearch::Rest::ServiceStub.stub :transcode_delete_product_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_product_client_stub do - # Create client - client = ::Google::Cloud::Vision::V1p3beta1::ProductSearch::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.delete_product({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.delete_product name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.delete_product ::Google::Cloud::Vision::V1p3beta1::DeleteProductRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.delete_product({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.delete_product(::Google::Cloud::Vision::V1p3beta1::DeleteProductRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, delete_product_client_stub.call_count - end - end - end - - def test_create_reference_image - # Create test objects. - client_result = ::Google::Cloud::Vision::V1p3beta1::ReferenceImage.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - reference_image = {} - reference_image_id = "hello world" - - create_reference_image_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::Vision::V1p3beta1::ProductSearch::Rest::ServiceStub.stub :transcode_create_reference_image_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_reference_image_client_stub do - # Create client - client = ::Google::Cloud::Vision::V1p3beta1::ProductSearch::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_reference_image({ parent: parent, reference_image: reference_image, reference_image_id: reference_image_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_reference_image parent: parent, reference_image: reference_image, reference_image_id: reference_image_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_reference_image ::Google::Cloud::Vision::V1p3beta1::CreateReferenceImageRequest.new(parent: parent, reference_image: reference_image, reference_image_id: reference_image_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_reference_image({ parent: parent, reference_image: reference_image, reference_image_id: reference_image_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_reference_image(::Google::Cloud::Vision::V1p3beta1::CreateReferenceImageRequest.new(parent: parent, reference_image: reference_image, reference_image_id: reference_image_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_reference_image_client_stub.call_count - end - end - end - - def test_delete_reference_image - # 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_reference_image_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::Vision::V1p3beta1::ProductSearch::Rest::ServiceStub.stub :transcode_delete_reference_image_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_reference_image_client_stub do - # Create client - client = ::Google::Cloud::Vision::V1p3beta1::ProductSearch::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.delete_reference_image({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.delete_reference_image name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.delete_reference_image ::Google::Cloud::Vision::V1p3beta1::DeleteReferenceImageRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.delete_reference_image({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.delete_reference_image(::Google::Cloud::Vision::V1p3beta1::DeleteReferenceImageRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, delete_reference_image_client_stub.call_count - end - end - end - - def test_list_reference_images - # Create test objects. - client_result = ::Google::Cloud::Vision::V1p3beta1::ListReferenceImagesResponse.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_reference_images_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::Vision::V1p3beta1::ProductSearch::Rest::ServiceStub.stub :transcode_list_reference_images_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_reference_images_client_stub do - # Create client - client = ::Google::Cloud::Vision::V1p3beta1::ProductSearch::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_reference_images({ 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_reference_images 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_reference_images ::Google::Cloud::Vision::V1p3beta1::ListReferenceImagesRequest.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_reference_images({ 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_reference_images(::Google::Cloud::Vision::V1p3beta1::ListReferenceImagesRequest.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_reference_images_client_stub.call_count - end - end - end - - def test_get_reference_image - # Create test objects. - client_result = ::Google::Cloud::Vision::V1p3beta1::ReferenceImage.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_reference_image_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::Vision::V1p3beta1::ProductSearch::Rest::ServiceStub.stub :transcode_get_reference_image_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_reference_image_client_stub do - # Create client - client = ::Google::Cloud::Vision::V1p3beta1::ProductSearch::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_reference_image({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_reference_image name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_reference_image ::Google::Cloud::Vision::V1p3beta1::GetReferenceImageRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_reference_image({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_reference_image(::Google::Cloud::Vision::V1p3beta1::GetReferenceImageRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_reference_image_client_stub.call_count - end - end - end - - def test_add_product_to_product_set - # 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" - product = "hello world" - - add_product_to_product_set_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::Vision::V1p3beta1::ProductSearch::Rest::ServiceStub.stub :transcode_add_product_to_product_set_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, add_product_to_product_set_client_stub do - # Create client - client = ::Google::Cloud::Vision::V1p3beta1::ProductSearch::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.add_product_to_product_set({ name: name, product: product }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.add_product_to_product_set name: name, product: product do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.add_product_to_product_set ::Google::Cloud::Vision::V1p3beta1::AddProductToProductSetRequest.new(name: name, product: product) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.add_product_to_product_set({ name: name, product: product }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.add_product_to_product_set(::Google::Cloud::Vision::V1p3beta1::AddProductToProductSetRequest.new(name: name, product: product), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, add_product_to_product_set_client_stub.call_count - end - end - end - - def test_remove_product_from_product_set - # 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" - product = "hello world" - - remove_product_from_product_set_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::Vision::V1p3beta1::ProductSearch::Rest::ServiceStub.stub :transcode_remove_product_from_product_set_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, remove_product_from_product_set_client_stub do - # Create client - client = ::Google::Cloud::Vision::V1p3beta1::ProductSearch::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.remove_product_from_product_set({ name: name, product: product }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.remove_product_from_product_set name: name, product: product do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.remove_product_from_product_set ::Google::Cloud::Vision::V1p3beta1::RemoveProductFromProductSetRequest.new(name: name, product: product) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.remove_product_from_product_set({ name: name, product: product }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.remove_product_from_product_set(::Google::Cloud::Vision::V1p3beta1::RemoveProductFromProductSetRequest.new(name: name, product: product), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, remove_product_from_product_set_client_stub.call_count - end - end - end - - def test_list_products_in_product_set - # Create test objects. - client_result = ::Google::Cloud::Vision::V1p3beta1::ListProductsInProductSetResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - page_size = 42 - page_token = "hello world" - - list_products_in_product_set_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::Vision::V1p3beta1::ProductSearch::Rest::ServiceStub.stub :transcode_list_products_in_product_set_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_products_in_product_set_client_stub do - # Create client - client = ::Google::Cloud::Vision::V1p3beta1::ProductSearch::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_products_in_product_set({ name: name, page_size: page_size, page_token: page_token }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.list_products_in_product_set name: name, page_size: page_size, page_token: page_token do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.list_products_in_product_set ::Google::Cloud::Vision::V1p3beta1::ListProductsInProductSetRequest.new(name: name, 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_products_in_product_set({ name: name, 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_products_in_product_set(::Google::Cloud::Vision::V1p3beta1::ListProductsInProductSetRequest.new(name: name, 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_products_in_product_set_client_stub.call_count - end - end - end - - def test_import_product_sets - # 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" - input_config = {} - - import_product_sets_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::Vision::V1p3beta1::ProductSearch::Rest::ServiceStub.stub :transcode_import_product_sets_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, import_product_sets_client_stub do - # Create client - client = ::Google::Cloud::Vision::V1p3beta1::ProductSearch::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.import_product_sets({ parent: parent, input_config: input_config }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.import_product_sets parent: parent, input_config: input_config do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.import_product_sets ::Google::Cloud::Vision::V1p3beta1::ImportProductSetsRequest.new(parent: parent, input_config: input_config) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.import_product_sets({ parent: parent, input_config: input_config }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.import_product_sets(::Google::Cloud::Vision::V1p3beta1::ImportProductSetsRequest.new(parent: parent, input_config: input_config), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, import_product_sets_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::Vision::V1p3beta1::ProductSearch::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::Vision::V1p3beta1::ProductSearch::Rest::Client::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-vision-v1p3beta1/test/google/cloud/vision/v1p3beta1/product_search_test.rb b/owl-bot-staging/google-cloud-vision-v1p3beta1/test/google/cloud/vision/v1p3beta1/product_search_test.rb deleted file mode 100644 index 2535f0d3b3c9..000000000000 --- a/owl-bot-staging/google-cloud-vision-v1p3beta1/test/google/cloud/vision/v1p3beta1/product_search_test.rb +++ /dev/null @@ -1,1225 +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/vision/v1p3beta1/product_search_service_pb" -require "google/cloud/vision/v1p3beta1/product_search" - -class ::Google::Cloud::Vision::V1p3beta1::ProductSearch::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_product_set - # Create GRPC objects. - grpc_response = ::Google::Cloud::Vision::V1p3beta1::ProductSet.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" - product_set = {} - product_set_id = "hello world" - - create_product_set_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_product_set, name - assert_kind_of ::Google::Cloud::Vision::V1p3beta1::CreateProductSetRequest, request - assert_equal "hello world", request["parent"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Vision::V1p3beta1::ProductSet), request["product_set"] - assert_equal "hello world", request["product_set_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_product_set_client_stub do - # Create client - client = ::Google::Cloud::Vision::V1p3beta1::ProductSearch::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_product_set({ parent: parent, product_set: product_set, product_set_id: product_set_id }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.create_product_set parent: parent, product_set: product_set, product_set_id: product_set_id do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.create_product_set ::Google::Cloud::Vision::V1p3beta1::CreateProductSetRequest.new(parent: parent, product_set: product_set, product_set_id: product_set_id) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.create_product_set({ parent: parent, product_set: product_set, product_set_id: product_set_id }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.create_product_set(::Google::Cloud::Vision::V1p3beta1::CreateProductSetRequest.new(parent: parent, product_set: product_set, product_set_id: product_set_id), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, create_product_set_client_stub.call_rpc_count - end - end - - def test_list_product_sets - # Create GRPC objects. - grpc_response = ::Google::Cloud::Vision::V1p3beta1::ListProductSetsResponse.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_product_sets_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_product_sets, name - assert_kind_of ::Google::Cloud::Vision::V1p3beta1::ListProductSetsRequest, 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_product_sets_client_stub do - # Create client - client = ::Google::Cloud::Vision::V1p3beta1::ProductSearch::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_product_sets({ 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_product_sets 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_product_sets ::Google::Cloud::Vision::V1p3beta1::ListProductSetsRequest.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_product_sets({ 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_product_sets(::Google::Cloud::Vision::V1p3beta1::ListProductSetsRequest.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_product_sets_client_stub.call_rpc_count - end - end - - def test_get_product_set - # Create GRPC objects. - grpc_response = ::Google::Cloud::Vision::V1p3beta1::ProductSet.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_product_set_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_product_set, name - assert_kind_of ::Google::Cloud::Vision::V1p3beta1::GetProductSetRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_product_set_client_stub do - # Create client - client = ::Google::Cloud::Vision::V1p3beta1::ProductSearch::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_product_set({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_product_set name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_product_set ::Google::Cloud::Vision::V1p3beta1::GetProductSetRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_product_set({ 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_product_set(::Google::Cloud::Vision::V1p3beta1::GetProductSetRequest.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_product_set_client_stub.call_rpc_count - end - end - - def test_update_product_set - # Create GRPC objects. - grpc_response = ::Google::Cloud::Vision::V1p3beta1::ProductSet.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. - product_set = {} - update_mask = {} - - update_product_set_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_product_set, name - assert_kind_of ::Google::Cloud::Vision::V1p3beta1::UpdateProductSetRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Vision::V1p3beta1::ProductSet), request["product_set"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_product_set_client_stub do - # Create client - client = ::Google::Cloud::Vision::V1p3beta1::ProductSearch::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_product_set({ product_set: product_set, update_mask: update_mask }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.update_product_set product_set: product_set, update_mask: update_mask do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.update_product_set ::Google::Cloud::Vision::V1p3beta1::UpdateProductSetRequest.new(product_set: product_set, 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_product_set({ product_set: product_set, 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_product_set(::Google::Cloud::Vision::V1p3beta1::UpdateProductSetRequest.new(product_set: product_set, 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_product_set_client_stub.call_rpc_count - end - end - - def test_delete_product_set - # 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_product_set_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_product_set, name - assert_kind_of ::Google::Cloud::Vision::V1p3beta1::DeleteProductSetRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_product_set_client_stub do - # Create client - client = ::Google::Cloud::Vision::V1p3beta1::ProductSearch::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_product_set({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.delete_product_set name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.delete_product_set ::Google::Cloud::Vision::V1p3beta1::DeleteProductSetRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.delete_product_set({ 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_product_set(::Google::Cloud::Vision::V1p3beta1::DeleteProductSetRequest.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_product_set_client_stub.call_rpc_count - end - end - - def test_create_product - # Create GRPC objects. - grpc_response = ::Google::Cloud::Vision::V1p3beta1::Product.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" - product = {} - product_id = "hello world" - - create_product_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_product, name - assert_kind_of ::Google::Cloud::Vision::V1p3beta1::CreateProductRequest, request - assert_equal "hello world", request["parent"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Vision::V1p3beta1::Product), request["product"] - assert_equal "hello world", request["product_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_product_client_stub do - # Create client - client = ::Google::Cloud::Vision::V1p3beta1::ProductSearch::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_product({ parent: parent, product: product, product_id: product_id }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.create_product parent: parent, product: product, product_id: product_id do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.create_product ::Google::Cloud::Vision::V1p3beta1::CreateProductRequest.new(parent: parent, product: product, product_id: product_id) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.create_product({ parent: parent, product: product, product_id: product_id }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.create_product(::Google::Cloud::Vision::V1p3beta1::CreateProductRequest.new(parent: parent, product: product, product_id: product_id), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, create_product_client_stub.call_rpc_count - end - end - - def test_list_products - # Create GRPC objects. - grpc_response = ::Google::Cloud::Vision::V1p3beta1::ListProductsResponse.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_products_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_products, name - assert_kind_of ::Google::Cloud::Vision::V1p3beta1::ListProductsRequest, 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_products_client_stub do - # Create client - client = ::Google::Cloud::Vision::V1p3beta1::ProductSearch::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_products({ 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_products 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_products ::Google::Cloud::Vision::V1p3beta1::ListProductsRequest.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_products({ 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_products(::Google::Cloud::Vision::V1p3beta1::ListProductsRequest.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_products_client_stub.call_rpc_count - end - end - - def test_get_product - # Create GRPC objects. - grpc_response = ::Google::Cloud::Vision::V1p3beta1::Product.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_product_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_product, name - assert_kind_of ::Google::Cloud::Vision::V1p3beta1::GetProductRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_product_client_stub do - # Create client - client = ::Google::Cloud::Vision::V1p3beta1::ProductSearch::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_product({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_product name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_product ::Google::Cloud::Vision::V1p3beta1::GetProductRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_product({ 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_product(::Google::Cloud::Vision::V1p3beta1::GetProductRequest.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_product_client_stub.call_rpc_count - end - end - - def test_update_product - # Create GRPC objects. - grpc_response = ::Google::Cloud::Vision::V1p3beta1::Product.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. - product = {} - update_mask = {} - - update_product_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_product, name - assert_kind_of ::Google::Cloud::Vision::V1p3beta1::UpdateProductRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Vision::V1p3beta1::Product), request["product"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_product_client_stub do - # Create client - client = ::Google::Cloud::Vision::V1p3beta1::ProductSearch::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_product({ product: product, update_mask: update_mask }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.update_product product: product, update_mask: update_mask do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.update_product ::Google::Cloud::Vision::V1p3beta1::UpdateProductRequest.new(product: product, 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_product({ product: product, 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_product(::Google::Cloud::Vision::V1p3beta1::UpdateProductRequest.new(product: product, 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_product_client_stub.call_rpc_count - end - end - - def test_delete_product - # 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_product_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_product, name - assert_kind_of ::Google::Cloud::Vision::V1p3beta1::DeleteProductRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_product_client_stub do - # Create client - client = ::Google::Cloud::Vision::V1p3beta1::ProductSearch::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_product({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.delete_product name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.delete_product ::Google::Cloud::Vision::V1p3beta1::DeleteProductRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.delete_product({ 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_product(::Google::Cloud::Vision::V1p3beta1::DeleteProductRequest.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_product_client_stub.call_rpc_count - end - end - - def test_create_reference_image - # Create GRPC objects. - grpc_response = ::Google::Cloud::Vision::V1p3beta1::ReferenceImage.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" - reference_image = {} - reference_image_id = "hello world" - - create_reference_image_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_reference_image, name - assert_kind_of ::Google::Cloud::Vision::V1p3beta1::CreateReferenceImageRequest, request - assert_equal "hello world", request["parent"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Vision::V1p3beta1::ReferenceImage), request["reference_image"] - assert_equal "hello world", request["reference_image_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_reference_image_client_stub do - # Create client - client = ::Google::Cloud::Vision::V1p3beta1::ProductSearch::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_reference_image({ parent: parent, reference_image: reference_image, reference_image_id: reference_image_id }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.create_reference_image parent: parent, reference_image: reference_image, reference_image_id: reference_image_id do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.create_reference_image ::Google::Cloud::Vision::V1p3beta1::CreateReferenceImageRequest.new(parent: parent, reference_image: reference_image, reference_image_id: reference_image_id) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.create_reference_image({ parent: parent, reference_image: reference_image, reference_image_id: reference_image_id }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.create_reference_image(::Google::Cloud::Vision::V1p3beta1::CreateReferenceImageRequest.new(parent: parent, reference_image: reference_image, reference_image_id: reference_image_id), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, create_reference_image_client_stub.call_rpc_count - end - end - - def test_delete_reference_image - # 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_reference_image_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_reference_image, name - assert_kind_of ::Google::Cloud::Vision::V1p3beta1::DeleteReferenceImageRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_reference_image_client_stub do - # Create client - client = ::Google::Cloud::Vision::V1p3beta1::ProductSearch::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_reference_image({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.delete_reference_image name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.delete_reference_image ::Google::Cloud::Vision::V1p3beta1::DeleteReferenceImageRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.delete_reference_image({ 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_reference_image(::Google::Cloud::Vision::V1p3beta1::DeleteReferenceImageRequest.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_reference_image_client_stub.call_rpc_count - end - end - - def test_list_reference_images - # Create GRPC objects. - grpc_response = ::Google::Cloud::Vision::V1p3beta1::ListReferenceImagesResponse.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_reference_images_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_reference_images, name - assert_kind_of ::Google::Cloud::Vision::V1p3beta1::ListReferenceImagesRequest, 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_reference_images_client_stub do - # Create client - client = ::Google::Cloud::Vision::V1p3beta1::ProductSearch::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_reference_images({ 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_reference_images 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_reference_images ::Google::Cloud::Vision::V1p3beta1::ListReferenceImagesRequest.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_reference_images({ 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_reference_images(::Google::Cloud::Vision::V1p3beta1::ListReferenceImagesRequest.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_reference_images_client_stub.call_rpc_count - end - end - - def test_get_reference_image - # Create GRPC objects. - grpc_response = ::Google::Cloud::Vision::V1p3beta1::ReferenceImage.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_reference_image_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_reference_image, name - assert_kind_of ::Google::Cloud::Vision::V1p3beta1::GetReferenceImageRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_reference_image_client_stub do - # Create client - client = ::Google::Cloud::Vision::V1p3beta1::ProductSearch::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_reference_image({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_reference_image name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_reference_image ::Google::Cloud::Vision::V1p3beta1::GetReferenceImageRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_reference_image({ 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_reference_image(::Google::Cloud::Vision::V1p3beta1::GetReferenceImageRequest.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_reference_image_client_stub.call_rpc_count - end - end - - def test_add_product_to_product_set - # 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" - product = "hello world" - - add_product_to_product_set_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :add_product_to_product_set, name - assert_kind_of ::Google::Cloud::Vision::V1p3beta1::AddProductToProductSetRequest, request - assert_equal "hello world", request["name"] - assert_equal "hello world", request["product"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, add_product_to_product_set_client_stub do - # Create client - client = ::Google::Cloud::Vision::V1p3beta1::ProductSearch::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.add_product_to_product_set({ name: name, product: product }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.add_product_to_product_set name: name, product: product do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.add_product_to_product_set ::Google::Cloud::Vision::V1p3beta1::AddProductToProductSetRequest.new(name: name, product: product) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.add_product_to_product_set({ name: name, product: product }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.add_product_to_product_set(::Google::Cloud::Vision::V1p3beta1::AddProductToProductSetRequest.new(name: name, product: product), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, add_product_to_product_set_client_stub.call_rpc_count - end - end - - def test_remove_product_from_product_set - # 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" - product = "hello world" - - remove_product_from_product_set_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :remove_product_from_product_set, name - assert_kind_of ::Google::Cloud::Vision::V1p3beta1::RemoveProductFromProductSetRequest, request - assert_equal "hello world", request["name"] - assert_equal "hello world", request["product"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, remove_product_from_product_set_client_stub do - # Create client - client = ::Google::Cloud::Vision::V1p3beta1::ProductSearch::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.remove_product_from_product_set({ name: name, product: product }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.remove_product_from_product_set name: name, product: product do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.remove_product_from_product_set ::Google::Cloud::Vision::V1p3beta1::RemoveProductFromProductSetRequest.new(name: name, product: product) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.remove_product_from_product_set({ name: name, product: product }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.remove_product_from_product_set(::Google::Cloud::Vision::V1p3beta1::RemoveProductFromProductSetRequest.new(name: name, product: product), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, remove_product_from_product_set_client_stub.call_rpc_count - end - end - - def test_list_products_in_product_set - # Create GRPC objects. - grpc_response = ::Google::Cloud::Vision::V1p3beta1::ListProductsInProductSetResponse.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" - page_size = 42 - page_token = "hello world" - - list_products_in_product_set_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_products_in_product_set, name - assert_kind_of ::Google::Cloud::Vision::V1p3beta1::ListProductsInProductSetRequest, request - assert_equal "hello world", request["name"] - assert_equal 42, request["page_size"] - assert_equal "hello world", request["page_token"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_products_in_product_set_client_stub do - # Create client - client = ::Google::Cloud::Vision::V1p3beta1::ProductSearch::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_products_in_product_set({ name: name, 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_products_in_product_set name: name, 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_products_in_product_set ::Google::Cloud::Vision::V1p3beta1::ListProductsInProductSetRequest.new(name: name, 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_products_in_product_set({ name: name, 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_products_in_product_set(::Google::Cloud::Vision::V1p3beta1::ListProductsInProductSetRequest.new(name: name, 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_products_in_product_set_client_stub.call_rpc_count - end - end - - def test_import_product_sets - # 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" - input_config = {} - - import_product_sets_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :import_product_sets, name - assert_kind_of ::Google::Cloud::Vision::V1p3beta1::ImportProductSetsRequest, request - assert_equal "hello world", request["parent"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Vision::V1p3beta1::ImportProductSetsInputConfig), request["input_config"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, import_product_sets_client_stub do - # Create client - client = ::Google::Cloud::Vision::V1p3beta1::ProductSearch::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.import_product_sets({ parent: parent, input_config: input_config }) 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.import_product_sets parent: parent, input_config: input_config 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.import_product_sets ::Google::Cloud::Vision::V1p3beta1::ImportProductSetsRequest.new(parent: parent, input_config: input_config) 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.import_product_sets({ parent: parent, input_config: input_config }, 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.import_product_sets(::Google::Cloud::Vision::V1p3beta1::ImportProductSetsRequest.new(parent: parent, input_config: input_config), 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, import_product_sets_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::Vision::V1p3beta1::ProductSearch::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::Vision::V1p3beta1::ProductSearch::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::Vision::V1p3beta1::ProductSearch::Client.new do |config| - config.credentials = creds - end - assert_kind_of ::Google::Cloud::Vision::V1p3beta1::ProductSearch::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::Vision::V1p3beta1::ProductSearch::Client.new do |config| - config.credentials = grpc_channel - end - end - - assert_kind_of ::Google::Cloud::Vision::V1p3beta1::ProductSearch::Operations, client.operations_client - end -end diff --git a/owl-bot-staging/google-cloud-vision-v1p3beta1/test/helper.rb b/owl-bot-staging/google-cloud-vision-v1p3beta1/test/helper.rb deleted file mode 100644 index 672b337030e7..000000000000 --- a/owl-bot-staging/google-cloud-vision-v1p3beta1/test/helper.rb +++ /dev/null @@ -1,26 +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/mock" -require "minitest/rg" - -require "grpc" - -require "ostruct" diff --git a/owl-bot-staging/google-cloud-vision-v1p4beta1/.gitignore b/owl-bot-staging/google-cloud-vision-v1p4beta1/.gitignore deleted file mode 100644 index 0135b6bc6cfc..000000000000 --- a/owl-bot-staging/google-cloud-vision-v1p4beta1/.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-vision-v1p4beta1/.repo-metadata.json b/owl-bot-staging/google-cloud-vision-v1p4beta1/.repo-metadata.json deleted file mode 100644 index 2e6a125e1ed7..000000000000 --- a/owl-bot-staging/google-cloud-vision-v1p4beta1/.repo-metadata.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "api_id": "vision.googleapis.com", - "api_shortname": "vision", - "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-vision-v1p4beta1/latest", - "distribution_name": "google-cloud-vision-v1p4beta1", - "is_cloud": true, - "language": "ruby", - "name": "vision", - "name_pretty": "Cloud Vision V1p4beta1 API", - "product_documentation": "https://cloud.google.com/vision", - "release_level": "unreleased", - "repo": "googleapis/google-cloud-ruby", - "requires_billing": true, - "ruby-cloud-description": "Cloud Vision API allows developers to easily integrate vision detection features within applications, including image labeling, face and landmark detection, optical character recognition (OCR), and tagging of explicit content. Note that google-cloud-vision-v1p4beta1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-vision instead. See the readme for more details.", - "ruby-cloud-env-prefix": "VISION", - "ruby-cloud-product-url": "https://cloud.google.com/vision", - "library_type": "GAPIC_AUTO" -} diff --git a/owl-bot-staging/google-cloud-vision-v1p4beta1/.rubocop.yml b/owl-bot-staging/google-cloud-vision-v1p4beta1/.rubocop.yml deleted file mode 100644 index 3b29e65f7fbe..000000000000 --- a/owl-bot-staging/google-cloud-vision-v1p4beta1/.rubocop.yml +++ /dev/null @@ -1,33 +0,0 @@ -inherit_gem: - google-style: google-style.yml - -AllCops: - Exclude: - - "google-cloud-vision-v1p4beta1.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-vision-v1p4beta1.rb" diff --git a/owl-bot-staging/google-cloud-vision-v1p4beta1/.toys.rb b/owl-bot-staging/google-cloud-vision-v1p4beta1/.toys.rb deleted file mode 100644 index 177e22456e8a..000000000000 --- a/owl-bot-staging/google-cloud-vision-v1p4beta1/.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-vision-v1p4beta1/.yardopts b/owl-bot-staging/google-cloud-vision-v1p4beta1/.yardopts deleted file mode 100644 index 4d5d42768816..000000000000 --- a/owl-bot-staging/google-cloud-vision-v1p4beta1/.yardopts +++ /dev/null @@ -1,12 +0,0 @@ ---no-private ---title="Cloud Vision V1p4beta1 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-vision-v1p4beta1/AUTHENTICATION.md b/owl-bot-staging/google-cloud-vision-v1p4beta1/AUTHENTICATION.md deleted file mode 100644 index 94d7020a4c49..000000000000 --- a/owl-bot-staging/google-cloud-vision-v1p4beta1/AUTHENTICATION.md +++ /dev/null @@ -1,122 +0,0 @@ -# Authentication - -The recommended way to authenticate to the google-cloud-vision-v1p4beta1 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-vision-v1p4beta1 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/vision/v1p4beta1" - -client = ::Google::Cloud::Vision::V1p4beta1::ProductSearch::Client.new do |config| - config.credentials = "path/to/credentialfile.json" -end -``` - -To configure a credentials file globally for all clients: - -```ruby -require "google/cloud/vision/v1p4beta1" - -::Google::Cloud::Vision::V1p4beta1::ProductSearch::Client.configure do |config| - config.credentials = "path/to/credentialfile.json" -end - -client = ::Google::Cloud::Vision::V1p4beta1::ProductSearch::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-vision-v1p4beta1 -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/vision/v1p4beta1" - -ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" - -client = ::Google::Cloud::Vision::V1p4beta1::ProductSearch::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-vision-v1p4beta1/CHANGELOG.md b/owl-bot-staging/google-cloud-vision-v1p4beta1/CHANGELOG.md deleted file mode 100644 index f88957a62ba2..000000000000 --- a/owl-bot-staging/google-cloud-vision-v1p4beta1/CHANGELOG.md +++ /dev/null @@ -1,2 +0,0 @@ -# Release History - diff --git a/owl-bot-staging/google-cloud-vision-v1p4beta1/Gemfile b/owl-bot-staging/google-cloud-vision-v1p4beta1/Gemfile deleted file mode 100644 index 1d08558908d8..000000000000 --- a/owl-bot-staging/google-cloud-vision-v1p4beta1/Gemfile +++ /dev/null @@ -1,14 +0,0 @@ -source "https://rubygems.org" - -gemspec - -gem "google-style", "~> 1.32.0" -gem "irb", "~> 1.17" -gem "minitest", "~> 6.0.2" -gem "minitest-focus", "~> 1.4" -gem "minitest-mock", "~> 5.27" -gem "minitest-rg", "~> 5.3" -gem "ostruct", "~> 0.5.5" -gem "rake", ">= 13.0" -gem "redcarpet", "~> 3.6" -gem "yard", "~> 0.9" diff --git a/owl-bot-staging/google-cloud-vision-v1p4beta1/LICENSE.md b/owl-bot-staging/google-cloud-vision-v1p4beta1/LICENSE.md deleted file mode 100644 index c261857ba6ad..000000000000 --- a/owl-bot-staging/google-cloud-vision-v1p4beta1/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-vision-v1p4beta1/README.md b/owl-bot-staging/google-cloud-vision-v1p4beta1/README.md deleted file mode 100644 index 780aaacb1d2b..000000000000 --- a/owl-bot-staging/google-cloud-vision-v1p4beta1/README.md +++ /dev/null @@ -1,154 +0,0 @@ -# Ruby Client for the Cloud Vision V1p4beta1 API - -Integrates Google Vision features, including image labeling, face, logo, and landmark detection, optical character recognition (OCR), and detection of explicit content, into applications. - -Cloud Vision API allows developers to easily integrate vision detection features within applications, including image labeling, face and landmark detection, optical character recognition (OCR), and tagging of explicit content. - -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 Vision V1p4beta1 API. Most users should consider using -the main client gem, -[google-cloud-vision](https://rubygems.org/gems/google-cloud-vision). -See the section below titled *Which client should I use?* for more information. - -## Installation - -``` -$ gem install google-cloud-vision-v1p4beta1 -``` - -## 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/vision.googleapis.com) -1. [Set up authentication.](AUTHENTICATION.md) - -## Quick Start - -```ruby -require "google/cloud/vision/v1p4beta1" - -client = ::Google::Cloud::Vision::V1p4beta1::ProductSearch::Client.new -request = ::Google::Cloud::Vision::V1p4beta1::CreateProductSetRequest.new # (request fields as keyword arguments...) -response = client.create_product_set request -``` - -View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-vision-v1p4beta1/latest) -for class and method documentation. - -See also the [Product Documentation](https://cloud.google.com/vision) -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/vision/v1p4beta1" -require "logger" - -client = ::Google::Cloud::Vision::V1p4beta1::ProductSearch::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-vision`, -and lower-level _versioned_ client libraries with names such as -`google-cloud-vision-v1p4beta1`. -_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-vision`. -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-vision-v1p4beta1`. - -### 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-vision-v1p4beta1/Rakefile b/owl-bot-staging/google-cloud-vision-v1p4beta1/Rakefile deleted file mode 100644 index 88648aa39bba..000000000000 --- a/owl-bot-staging/google-cloud-vision-v1p4beta1/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-vision-v1p4beta1 acceptance tests." -task :acceptance, :project, :keyfile do |t, args| - project = args[:project] - project ||= - ENV["VISION_TEST_PROJECT"] || - ENV["GCLOUD_TEST_PROJECT"] - keyfile = args[:keyfile] - keyfile ||= - ENV["VISION_TEST_KEYFILE"] || - ENV["GCLOUD_TEST_KEYFILE"] - if keyfile - keyfile = File.read keyfile - else - keyfile ||= - ENV["VISION_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 VISION_TEST_PROJECT=test123 VISION_TEST_KEYFILE=/path/to/keyfile.json rake acceptance" - end - require "google/cloud/vision/v1p4beta1/product_search/credentials" - ::Google::Cloud::Vision::V1p4beta1::ProductSearch::Credentials.env_vars.each do |path| - ENV[path] = nil - end - ENV["VISION_PROJECT"] = project - ENV["VISION_TEST_PROJECT"] = project - ENV["VISION_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-vision-v1p4beta1 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-vision-v1p4beta1 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-vision-v1p4beta1 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-vision-v1p4beta1 gem does not have doctest tests." -end - -desc "Run the CI build" -task :ci do - header "BUILDING google-cloud-vision-v1p4beta1" - header "google-cloud-vision-v1p4beta1 rubocop", "*" - Rake::Task[:rubocop].invoke - header "google-cloud-vision-v1p4beta1 yard", "*" - Rake::Task[:yard].invoke - header "google-cloud-vision-v1p4beta1 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-vision-v1p4beta1 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-vision-v1p4beta1 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-vision-v1p4beta1/gapic_metadata.json b/owl-bot-staging/google-cloud-vision-v1p4beta1/gapic_metadata.json deleted file mode 100644 index ced5866fddd0..000000000000 --- a/owl-bot-staging/google-cloud-vision-v1p4beta1/gapic_metadata.json +++ /dev/null @@ -1,142 +0,0 @@ -{ - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", - "language": "ruby", - "protoPackage": "google.cloud.vision.v1p4beta1", - "libraryPackage": "::Google::Cloud::Vision::V1p4beta1", - "services": { - "ProductSearch": { - "clients": { - "grpc": { - "libraryClient": "::Google::Cloud::Vision::V1p4beta1::ProductSearch::Client", - "rpcs": { - "CreateProductSet": { - "methods": [ - "create_product_set" - ] - }, - "ListProductSets": { - "methods": [ - "list_product_sets" - ] - }, - "GetProductSet": { - "methods": [ - "get_product_set" - ] - }, - "UpdateProductSet": { - "methods": [ - "update_product_set" - ] - }, - "DeleteProductSet": { - "methods": [ - "delete_product_set" - ] - }, - "CreateProduct": { - "methods": [ - "create_product" - ] - }, - "ListProducts": { - "methods": [ - "list_products" - ] - }, - "GetProduct": { - "methods": [ - "get_product" - ] - }, - "UpdateProduct": { - "methods": [ - "update_product" - ] - }, - "DeleteProduct": { - "methods": [ - "delete_product" - ] - }, - "CreateReferenceImage": { - "methods": [ - "create_reference_image" - ] - }, - "DeleteReferenceImage": { - "methods": [ - "delete_reference_image" - ] - }, - "ListReferenceImages": { - "methods": [ - "list_reference_images" - ] - }, - "GetReferenceImage": { - "methods": [ - "get_reference_image" - ] - }, - "AddProductToProductSet": { - "methods": [ - "add_product_to_product_set" - ] - }, - "RemoveProductFromProductSet": { - "methods": [ - "remove_product_from_product_set" - ] - }, - "ListProductsInProductSet": { - "methods": [ - "list_products_in_product_set" - ] - }, - "ImportProductSets": { - "methods": [ - "import_product_sets" - ] - }, - "PurgeProducts": { - "methods": [ - "purge_products" - ] - } - } - } - } - }, - "ImageAnnotator": { - "clients": { - "grpc": { - "libraryClient": "::Google::Cloud::Vision::V1p4beta1::ImageAnnotator::Client", - "rpcs": { - "BatchAnnotateImages": { - "methods": [ - "batch_annotate_images" - ] - }, - "BatchAnnotateFiles": { - "methods": [ - "batch_annotate_files" - ] - }, - "AsyncBatchAnnotateImages": { - "methods": [ - "async_batch_annotate_images" - ] - }, - "AsyncBatchAnnotateFiles": { - "methods": [ - "async_batch_annotate_files" - ] - } - } - } - } - } - } -} diff --git a/owl-bot-staging/google-cloud-vision-v1p4beta1/google-cloud-vision-v1p4beta1.gemspec b/owl-bot-staging/google-cloud-vision-v1p4beta1/google-cloud-vision-v1p4beta1.gemspec deleted file mode 100644 index fe0b5808e934..000000000000 --- a/owl-bot-staging/google-cloud-vision-v1p4beta1/google-cloud-vision-v1p4beta1.gemspec +++ /dev/null @@ -1,28 +0,0 @@ -# -*- ruby -*- -# encoding: utf-8 - -require File.expand_path("lib/google/cloud/vision/v1p4beta1/version", __dir__) - -Gem::Specification.new do |gem| - gem.name = "google-cloud-vision-v1p4beta1" - gem.version = Google::Cloud::Vision::V1p4beta1::VERSION - - gem.authors = ["Google LLC"] - gem.email = "googleapis-packages@google.com" - gem.description = "Cloud Vision API allows developers to easily integrate vision detection features within applications, including image labeling, face and landmark detection, optical character recognition (OCR), and tagging of explicit content. Note that google-cloud-vision-v1p4beta1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-vision instead. See the readme for more details." - gem.summary = "Integrates Google Vision features, including image labeling, face, logo, and landmark detection, optical character recognition (OCR), and detection of explicit content, into 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.2" - - gem.add_dependency "gapic-common", "~> 1.2" - gem.add_dependency "google-cloud-errors", "~> 1.0" -end diff --git a/owl-bot-staging/google-cloud-vision-v1p4beta1/lib/google-cloud-vision-v1p4beta1.rb b/owl-bot-staging/google-cloud-vision-v1p4beta1/lib/google-cloud-vision-v1p4beta1.rb deleted file mode 100644 index c8b30388aac1..000000000000 --- a/owl-bot-staging/google-cloud-vision-v1p4beta1/lib/google-cloud-vision-v1p4beta1.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/vision/v1p4beta1" diff --git a/owl-bot-staging/google-cloud-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1.rb b/owl-bot-staging/google-cloud-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1.rb deleted file mode 100644 index fff4835afa60..000000000000 --- a/owl-bot-staging/google-cloud-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1.rb +++ /dev/null @@ -1,46 +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/vision/v1p4beta1/product_search" -require "google/cloud/vision/v1p4beta1/image_annotator" -require "google/cloud/vision/v1p4beta1/version" - -module Google - module Cloud - module Vision - ## - # API client module. - # - # @example Load this package, including all its services, and instantiate a gRPC client - # - # require "google/cloud/vision/v1p4beta1" - # client = ::Google::Cloud::Vision::V1p4beta1::ProductSearch::Client.new - # - # @example Load this package, including all its services, and instantiate a REST client - # - # require "google/cloud/vision/v1p4beta1" - # client = ::Google::Cloud::Vision::V1p4beta1::ProductSearch::Rest::Client.new - # - module V1p4beta1 - end - end - end -end - -helper_path = ::File.join __dir__, "v1p4beta1", "_helpers.rb" -require "google/cloud/vision/v1p4beta1/_helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1/face_pb.rb b/owl-bot-staging/google-cloud-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1/face_pb.rb deleted file mode 100644 index c52d29d87def..000000000000 --- a/owl-bot-staging/google-cloud-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1/face_pb.rb +++ /dev/null @@ -1,25 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/vision/v1p4beta1/face.proto - -require 'google/protobuf' - -require 'google/cloud/vision/v1p4beta1/geometry_pb' - - -descriptor_data = "\n(google/cloud/vision/v1p4beta1/face.proto\x12\x1dgoogle.cloud.vision.v1p4beta1\x1a,google/cloud/vision/v1p4beta1/geometry.proto\".\n\x15\x46\x61\x63\x65RecognitionParams\x12\x15\n\rcelebrity_set\x18\x01 \x03(\t\"D\n\tCelebrity\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x14\n\x0c\x64isplay_name\x18\x02 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x03 \x01(\t\"h\n\x15\x46\x61\x63\x65RecognitionResult\x12;\n\tcelebrity\x18\x01 \x01(\x0b\x32(.google.cloud.vision.v1p4beta1.Celebrity\x12\x12\n\nconfidence\x18\x02 \x01(\x02\x42z\n!com.google.cloud.vision.v1p4beta1B\x0e\x43\x65lebrityProtoP\x01Z9cloud.google.com/go/vision/apiv1p4beta1/visionpb;visionpb\xf8\x01\x01\xa2\x02\x04GCVNb\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module Vision - module V1p4beta1 - FaceRecognitionParams = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p4beta1.FaceRecognitionParams").msgclass - Celebrity = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p4beta1.Celebrity").msgclass - FaceRecognitionResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p4beta1.FaceRecognitionResult").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1/geometry_pb.rb b/owl-bot-staging/google-cloud-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1/geometry_pb.rb deleted file mode 100644 index 966725a595fc..000000000000 --- a/owl-bot-staging/google-cloud-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1/geometry_pb.rb +++ /dev/null @@ -1,24 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/vision/v1p4beta1/geometry.proto - -require 'google/protobuf' - - -descriptor_data = "\n,google/cloud/vision/v1p4beta1/geometry.proto\x12\x1dgoogle.cloud.vision.v1p4beta1\"\x1e\n\x06Vertex\x12\t\n\x01x\x18\x01 \x01(\x05\x12\t\n\x01y\x18\x02 \x01(\x05\"(\n\x10NormalizedVertex\x12\t\n\x01x\x18\x01 \x01(\x02\x12\t\n\x01y\x18\x02 \x01(\x02\"\x95\x01\n\x0c\x42oundingPoly\x12\x37\n\x08vertices\x18\x01 \x03(\x0b\x32%.google.cloud.vision.v1p4beta1.Vertex\x12L\n\x13normalized_vertices\x18\x02 \x03(\x0b\x32/.google.cloud.vision.v1p4beta1.NormalizedVertex\"+\n\x08Position\x12\t\n\x01x\x18\x01 \x01(\x02\x12\t\n\x01y\x18\x02 \x01(\x02\x12\t\n\x01z\x18\x03 \x01(\x02\x42y\n!com.google.cloud.vision.v1p4beta1B\rGeometryProtoP\x01Z9cloud.google.com/go/vision/apiv1p4beta1/visionpb;visionpb\xf8\x01\x01\xa2\x02\x04GCVNb\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module Vision - module V1p4beta1 - Vertex = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p4beta1.Vertex").msgclass - NormalizedVertex = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p4beta1.NormalizedVertex").msgclass - BoundingPoly = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p4beta1.BoundingPoly").msgclass - Position = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p4beta1.Position").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1/image_annotator.rb b/owl-bot-staging/google-cloud-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1/image_annotator.rb deleted file mode 100644 index 1d62da930e19..000000000000 --- a/owl-bot-staging/google-cloud-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1/image_annotator.rb +++ /dev/null @@ -1,58 +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/vision/v1p4beta1/version" - -require "google/cloud/vision/v1p4beta1/image_annotator/credentials" -require "google/cloud/vision/v1p4beta1/image_annotator/paths" -require "google/cloud/vision/v1p4beta1/image_annotator/operations" -require "google/cloud/vision/v1p4beta1/image_annotator/client" -require "google/cloud/vision/v1p4beta1/image_annotator/rest" - -module Google - module Cloud - module Vision - module V1p4beta1 - ## - # Service that performs Google Cloud Vision API detection tasks over client - # images, such as face, landmark, logo, label, and text detection. The - # ImageAnnotator service returns detected entities from the images. - # - # @example Load this service and instantiate a gRPC client - # - # require "google/cloud/vision/v1p4beta1/image_annotator" - # client = ::Google::Cloud::Vision::V1p4beta1::ImageAnnotator::Client.new - # - # @example Load this service and instantiate a REST client - # - # require "google/cloud/vision/v1p4beta1/image_annotator/rest" - # client = ::Google::Cloud::Vision::V1p4beta1::ImageAnnotator::Rest::Client.new - # - module ImageAnnotator - end - end - end - end -end - -helper_path = ::File.join __dir__, "image_annotator", "helpers.rb" -require "google/cloud/vision/v1p4beta1/image_annotator/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1/image_annotator/client.rb b/owl-bot-staging/google-cloud-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1/image_annotator/client.rb deleted file mode 100644 index aa8219bcc679..000000000000 --- a/owl-bot-staging/google-cloud-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1/image_annotator/client.rb +++ /dev/null @@ -1,794 +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/vision/v1p4beta1/image_annotator_pb" - -module Google - module Cloud - module Vision - module V1p4beta1 - module ImageAnnotator - ## - # Client for the ImageAnnotator service. - # - # Service that performs Google Cloud Vision API detection tasks over client - # images, such as face, landmark, logo, label, and text detection. The - # ImageAnnotator service returns detected entities from the images. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "vision.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :image_annotator_stub - - ## - # Configure the ImageAnnotator Client class. - # - # See {::Google::Cloud::Vision::V1p4beta1::ImageAnnotator::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all ImageAnnotator clients - # ::Google::Cloud::Vision::V1p4beta1::ImageAnnotator::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", "Vision", "V1p4beta1"] - 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.batch_annotate_images.timeout = 600.0 - default_config.rpcs.batch_annotate_images.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [] - } - - default_config.rpcs.batch_annotate_files.timeout = 600.0 - default_config.rpcs.batch_annotate_files.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [] - } - - default_config.rpcs.async_batch_annotate_images.timeout = 600.0 - default_config.rpcs.async_batch_annotate_images.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [] - } - - default_config.rpcs.async_batch_annotate_files.timeout = 600.0 - default_config.rpcs.async_batch_annotate_files.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [] - } - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the ImageAnnotator 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::Vision::V1p4beta1::ImageAnnotator::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 - @image_annotator_stub.universe_domain - end - - ## - # Create a new ImageAnnotator client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Vision::V1p4beta1::ImageAnnotator::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Vision::V1p4beta1::ImageAnnotator::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the ImageAnnotator 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/vision/v1p4beta1/image_annotator_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 - - @image_annotator_stub = ::Gapic::ServiceStub.new( - ::Google::Cloud::Vision::V1p4beta1::ImageAnnotator::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 - ) - - @image_annotator_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 - end - - ## - # Get the associated client for long-running operations. - # - # @return [::Google::Cloud::Vision::V1p4beta1::ImageAnnotator::Operations] - # - attr_reader :operations_client - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @image_annotator_stub.logger - end - - # Service calls - - ## - # Run image detection and annotation for a batch of images. - # - # @overload batch_annotate_images(request, options = nil) - # Pass arguments to `batch_annotate_images` via a request object, either of type - # {::Google::Cloud::Vision::V1p4beta1::BatchAnnotateImagesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Vision::V1p4beta1::BatchAnnotateImagesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload batch_annotate_images(requests: nil) - # Pass arguments to `batch_annotate_images` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param requests [::Array<::Google::Cloud::Vision::V1p4beta1::AnnotateImageRequest, ::Hash>] - # Required. Individual image annotation requests for this batch. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Vision::V1p4beta1::BatchAnnotateImagesResponse] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Vision::V1p4beta1::BatchAnnotateImagesResponse] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/vision/v1p4beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Vision::V1p4beta1::ImageAnnotator::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Vision::V1p4beta1::BatchAnnotateImagesRequest.new - # - # # Call the batch_annotate_images method. - # result = client.batch_annotate_images request - # - # # The returned object is of type Google::Cloud::Vision::V1p4beta1::BatchAnnotateImagesResponse. - # p result - # - def batch_annotate_images request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Vision::V1p4beta1::BatchAnnotateImagesRequest - - # Converts hash 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.batch_annotate_images.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::Vision::V1p4beta1::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.batch_annotate_images.timeout, - metadata: metadata, - retry_policy: @config.rpcs.batch_annotate_images.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @image_annotator_stub.call_rpc :batch_annotate_images, 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 - - ## - # Service that performs image detection and annotation for a batch of files. - # Now only "application/pdf", "image/tiff" and "image/gif" are supported. - # - # This service will extract at most 5 (customers can specify which 5 in - # AnnotateFileRequest.pages) frames (gif) or pages (pdf or tiff) from each - # file provided and perform detection and annotation for each image - # extracted. - # - # @overload batch_annotate_files(request, options = nil) - # Pass arguments to `batch_annotate_files` via a request object, either of type - # {::Google::Cloud::Vision::V1p4beta1::BatchAnnotateFilesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Vision::V1p4beta1::BatchAnnotateFilesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload batch_annotate_files(requests: nil) - # Pass arguments to `batch_annotate_files` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param requests [::Array<::Google::Cloud::Vision::V1p4beta1::AnnotateFileRequest, ::Hash>] - # Required. The list of file annotation requests. Right now we support only - # one AnnotateFileRequest in BatchAnnotateFilesRequest. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Vision::V1p4beta1::BatchAnnotateFilesResponse] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Vision::V1p4beta1::BatchAnnotateFilesResponse] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/vision/v1p4beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Vision::V1p4beta1::ImageAnnotator::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Vision::V1p4beta1::BatchAnnotateFilesRequest.new - # - # # Call the batch_annotate_files method. - # result = client.batch_annotate_files request - # - # # The returned object is of type Google::Cloud::Vision::V1p4beta1::BatchAnnotateFilesResponse. - # p result - # - def batch_annotate_files request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Vision::V1p4beta1::BatchAnnotateFilesRequest - - # Converts hash 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.batch_annotate_files.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::Vision::V1p4beta1::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.batch_annotate_files.timeout, - metadata: metadata, - retry_policy: @config.rpcs.batch_annotate_files.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @image_annotator_stub.call_rpc :batch_annotate_files, 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 - - ## - # Run asynchronous image detection and annotation for a list of images. - # - # Progress and results can be retrieved through the - # `google.longrunning.Operations` interface. - # `Operation.metadata` contains `OperationMetadata` (metadata). - # `Operation.response` contains `AsyncBatchAnnotateImagesResponse` (results). - # - # This service will write image annotation outputs to json files in customer - # GCS bucket, each json file containing BatchAnnotateImagesResponse proto. - # - # @overload async_batch_annotate_images(request, options = nil) - # Pass arguments to `async_batch_annotate_images` via a request object, either of type - # {::Google::Cloud::Vision::V1p4beta1::AsyncBatchAnnotateImagesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Vision::V1p4beta1::AsyncBatchAnnotateImagesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload async_batch_annotate_images(requests: nil, output_config: nil) - # Pass arguments to `async_batch_annotate_images` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param requests [::Array<::Google::Cloud::Vision::V1p4beta1::AnnotateImageRequest, ::Hash>] - # Required. Individual image annotation requests for this batch. - # @param output_config [::Google::Cloud::Vision::V1p4beta1::OutputConfig, ::Hash] - # Required. The desired output location and metadata (e.g. format). - # - # @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/vision/v1p4beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Vision::V1p4beta1::ImageAnnotator::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Vision::V1p4beta1::AsyncBatchAnnotateImagesRequest.new - # - # # Call the async_batch_annotate_images method. - # result = client.async_batch_annotate_images 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 async_batch_annotate_images request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Vision::V1p4beta1::AsyncBatchAnnotateImagesRequest - - # Converts hash 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.async_batch_annotate_images.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::Vision::V1p4beta1::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.async_batch_annotate_images.timeout, - metadata: metadata, - retry_policy: @config.rpcs.async_batch_annotate_images.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @image_annotator_stub.call_rpc :async_batch_annotate_images, 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 - - ## - # Run asynchronous image detection and annotation for a list of generic - # files, such as PDF files, which may contain multiple pages and multiple - # images per page. Progress and results can be retrieved through the - # `google.longrunning.Operations` interface. - # `Operation.metadata` contains `OperationMetadata` (metadata). - # `Operation.response` contains `AsyncBatchAnnotateFilesResponse` (results). - # - # @overload async_batch_annotate_files(request, options = nil) - # Pass arguments to `async_batch_annotate_files` via a request object, either of type - # {::Google::Cloud::Vision::V1p4beta1::AsyncBatchAnnotateFilesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Vision::V1p4beta1::AsyncBatchAnnotateFilesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload async_batch_annotate_files(requests: nil) - # Pass arguments to `async_batch_annotate_files` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param requests [::Array<::Google::Cloud::Vision::V1p4beta1::AsyncAnnotateFileRequest, ::Hash>] - # Required. Individual async file annotation requests for this batch. - # - # @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/vision/v1p4beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Vision::V1p4beta1::ImageAnnotator::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Vision::V1p4beta1::AsyncBatchAnnotateFilesRequest.new - # - # # Call the async_batch_annotate_files method. - # result = client.async_batch_annotate_files 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 async_batch_annotate_files request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Vision::V1p4beta1::AsyncBatchAnnotateFilesRequest - - # Converts hash 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.async_batch_annotate_files.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::Vision::V1p4beta1::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.async_batch_annotate_files.timeout, - metadata: metadata, - retry_policy: @config.rpcs.async_batch_annotate_files.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @image_annotator_stub.call_rpc :async_batch_annotate_files, 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 ImageAnnotator API. - # - # This class represents the configuration for ImageAnnotator, - # 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::Vision::V1p4beta1::ImageAnnotator::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 - # # batch_annotate_images to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Vision::V1p4beta1::ImageAnnotator::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.batch_annotate_images.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Vision::V1p4beta1::ImageAnnotator::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.batch_annotate_images.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::Vision::V1p4beta1::ImageAnnotator::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 = "vision.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 ImageAnnotator 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 `batch_annotate_images` - # @return [::Gapic::Config::Method] - # - attr_reader :batch_annotate_images - ## - # RPC-specific configuration for `batch_annotate_files` - # @return [::Gapic::Config::Method] - # - attr_reader :batch_annotate_files - ## - # RPC-specific configuration for `async_batch_annotate_images` - # @return [::Gapic::Config::Method] - # - attr_reader :async_batch_annotate_images - ## - # RPC-specific configuration for `async_batch_annotate_files` - # @return [::Gapic::Config::Method] - # - attr_reader :async_batch_annotate_files - - # @private - def initialize parent_rpcs = nil - batch_annotate_images_config = parent_rpcs.batch_annotate_images if parent_rpcs.respond_to? :batch_annotate_images - @batch_annotate_images = ::Gapic::Config::Method.new batch_annotate_images_config - batch_annotate_files_config = parent_rpcs.batch_annotate_files if parent_rpcs.respond_to? :batch_annotate_files - @batch_annotate_files = ::Gapic::Config::Method.new batch_annotate_files_config - async_batch_annotate_images_config = parent_rpcs.async_batch_annotate_images if parent_rpcs.respond_to? :async_batch_annotate_images - @async_batch_annotate_images = ::Gapic::Config::Method.new async_batch_annotate_images_config - async_batch_annotate_files_config = parent_rpcs.async_batch_annotate_files if parent_rpcs.respond_to? :async_batch_annotate_files - @async_batch_annotate_files = ::Gapic::Config::Method.new async_batch_annotate_files_config - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1/image_annotator/credentials.rb b/owl-bot-staging/google-cloud-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1/image_annotator/credentials.rb deleted file mode 100644 index e4193e52b799..000000000000 --- a/owl-bot-staging/google-cloud-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1/image_annotator/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 Vision - module V1p4beta1 - module ImageAnnotator - # Credentials for the ImageAnnotator API. - class Credentials < ::Google::Auth::Credentials - self.scope = [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/cloud-vision" - ] - self.env_vars = [ - "VISION_CREDENTIALS", - "VISION_KEYFILE", - "GOOGLE_CLOUD_CREDENTIALS", - "GOOGLE_CLOUD_KEYFILE", - "GCLOUD_KEYFILE", - "VISION_CREDENTIALS_JSON", - "VISION_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-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1/image_annotator/operations.rb b/owl-bot-staging/google-cloud-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1/image_annotator/operations.rb deleted file mode 100644 index 2ad367b5c005..000000000000 --- a/owl-bot-staging/google-cloud-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1/image_annotator/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 Vision - module V1p4beta1 - module ImageAnnotator - # Service that implements Longrunning Operations API. - class Operations - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "vision.$UNIVERSE_DOMAIN$" - - # @private - attr_reader :operations_stub - - ## - # Configuration for the ImageAnnotator 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 ImageAnnotator 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::Vision::V1p4beta1::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::Vision::V1p4beta1::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::Vision::V1p4beta1::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::Vision::V1p4beta1::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::Vision::V1p4beta1::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 = "vision.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-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1/image_annotator/paths.rb b/owl-bot-staging/google-cloud-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1/image_annotator/paths.rb deleted file mode 100644 index 853dee7b526d..000000000000 --- a/owl-bot-staging/google-cloud-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1/image_annotator/paths.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! - - -module Google - module Cloud - module Vision - module V1p4beta1 - module ImageAnnotator - # Path helper methods for the ImageAnnotator API. - module Paths - ## - # Create a fully-qualified ProductSet resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/productSets/{product_set}` - # - # @param project [String] - # @param location [String] - # @param product_set [String] - # - # @return [::String] - def product_set_path project:, location:, product_set: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/productSets/#{product_set}" - end - - extend self - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1/image_annotator/rest.rb b/owl-bot-staging/google-cloud-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1/image_annotator/rest.rb deleted file mode 100644 index bb924636f07e..000000000000 --- a/owl-bot-staging/google-cloud-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1/image_annotator/rest.rb +++ /dev/null @@ -1,55 +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/vision/v1p4beta1/version" - -require "google/cloud/vision/v1p4beta1/image_annotator/credentials" -require "google/cloud/vision/v1p4beta1/image_annotator/paths" -require "google/cloud/vision/v1p4beta1/image_annotator/rest/operations" -require "google/cloud/vision/v1p4beta1/image_annotator/rest/client" - -module Google - module Cloud - module Vision - module V1p4beta1 - ## - # Service that performs Google Cloud Vision API detection tasks over client - # images, such as face, landmark, logo, label, and text detection. The - # ImageAnnotator service returns detected entities from the images. - # - # To load this service and instantiate a REST client: - # - # require "google/cloud/vision/v1p4beta1/image_annotator/rest" - # client = ::Google::Cloud::Vision::V1p4beta1::ImageAnnotator::Rest::Client.new - # - module ImageAnnotator - # Client for the REST transport - module Rest - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "rest", "helpers.rb" -require "google/cloud/vision/v1p4beta1/image_annotator/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1/image_annotator/rest/client.rb b/owl-bot-staging/google-cloud-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1/image_annotator/rest/client.rb deleted file mode 100644 index 6b4c7032b4bb..000000000000 --- a/owl-bot-staging/google-cloud-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1/image_annotator/rest/client.rb +++ /dev/null @@ -1,755 +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/vision/v1p4beta1/image_annotator_pb" -require "google/cloud/vision/v1p4beta1/image_annotator/rest/service_stub" - -module Google - module Cloud - module Vision - module V1p4beta1 - module ImageAnnotator - module Rest - ## - # REST client for the ImageAnnotator service. - # - # Service that performs Google Cloud Vision API detection tasks over client - # images, such as face, landmark, logo, label, and text detection. The - # ImageAnnotator service returns detected entities from the images. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "vision.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :image_annotator_stub - - ## - # Configure the ImageAnnotator Client class. - # - # See {::Google::Cloud::Vision::V1p4beta1::ImageAnnotator::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all ImageAnnotator clients - # ::Google::Cloud::Vision::V1p4beta1::ImageAnnotator::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", "Vision", "V1p4beta1"] - 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.batch_annotate_images.timeout = 600.0 - default_config.rpcs.batch_annotate_images.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [] - } - - default_config.rpcs.batch_annotate_files.timeout = 600.0 - default_config.rpcs.batch_annotate_files.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [] - } - - default_config.rpcs.async_batch_annotate_images.timeout = 600.0 - default_config.rpcs.async_batch_annotate_images.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [] - } - - default_config.rpcs.async_batch_annotate_files.timeout = 600.0 - default_config.rpcs.async_batch_annotate_files.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [] - } - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the ImageAnnotator 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::Vision::V1p4beta1::ImageAnnotator::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 - @image_annotator_stub.universe_domain - end - - ## - # Create a new ImageAnnotator REST client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Vision::V1p4beta1::ImageAnnotator::Rest::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Vision::V1p4beta1::ImageAnnotator::Rest::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the ImageAnnotator 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::Vision::V1p4beta1::ImageAnnotator::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 - - @image_annotator_stub = ::Google::Cloud::Vision::V1p4beta1::ImageAnnotator::Rest::ServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials, - logger: @config.logger - ) - - @image_annotator_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 - end - - ## - # Get the associated client for long-running operations. - # - # @return [::Google::Cloud::Vision::V1p4beta1::ImageAnnotator::Rest::Operations] - # - attr_reader :operations_client - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @image_annotator_stub.logger - end - - # Service calls - - ## - # Run image detection and annotation for a batch of images. - # - # @overload batch_annotate_images(request, options = nil) - # Pass arguments to `batch_annotate_images` via a request object, either of type - # {::Google::Cloud::Vision::V1p4beta1::BatchAnnotateImagesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Vision::V1p4beta1::BatchAnnotateImagesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload batch_annotate_images(requests: nil) - # Pass arguments to `batch_annotate_images` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param requests [::Array<::Google::Cloud::Vision::V1p4beta1::AnnotateImageRequest, ::Hash>] - # Required. Individual image annotation requests for this batch. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Vision::V1p4beta1::BatchAnnotateImagesResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Vision::V1p4beta1::BatchAnnotateImagesResponse] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/vision/v1p4beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Vision::V1p4beta1::ImageAnnotator::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Vision::V1p4beta1::BatchAnnotateImagesRequest.new - # - # # Call the batch_annotate_images method. - # result = client.batch_annotate_images request - # - # # The returned object is of type Google::Cloud::Vision::V1p4beta1::BatchAnnotateImagesResponse. - # p result - # - def batch_annotate_images request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Vision::V1p4beta1::BatchAnnotateImagesRequest - - # Converts hash 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.batch_annotate_images.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::Vision::V1p4beta1::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.batch_annotate_images.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.batch_annotate_images.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @image_annotator_stub.batch_annotate_images 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 - - ## - # Service that performs image detection and annotation for a batch of files. - # Now only "application/pdf", "image/tiff" and "image/gif" are supported. - # - # This service will extract at most 5 (customers can specify which 5 in - # AnnotateFileRequest.pages) frames (gif) or pages (pdf or tiff) from each - # file provided and perform detection and annotation for each image - # extracted. - # - # @overload batch_annotate_files(request, options = nil) - # Pass arguments to `batch_annotate_files` via a request object, either of type - # {::Google::Cloud::Vision::V1p4beta1::BatchAnnotateFilesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Vision::V1p4beta1::BatchAnnotateFilesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload batch_annotate_files(requests: nil) - # Pass arguments to `batch_annotate_files` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param requests [::Array<::Google::Cloud::Vision::V1p4beta1::AnnotateFileRequest, ::Hash>] - # Required. The list of file annotation requests. Right now we support only - # one AnnotateFileRequest in BatchAnnotateFilesRequest. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Vision::V1p4beta1::BatchAnnotateFilesResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Vision::V1p4beta1::BatchAnnotateFilesResponse] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/vision/v1p4beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Vision::V1p4beta1::ImageAnnotator::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Vision::V1p4beta1::BatchAnnotateFilesRequest.new - # - # # Call the batch_annotate_files method. - # result = client.batch_annotate_files request - # - # # The returned object is of type Google::Cloud::Vision::V1p4beta1::BatchAnnotateFilesResponse. - # p result - # - def batch_annotate_files request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Vision::V1p4beta1::BatchAnnotateFilesRequest - - # Converts hash 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.batch_annotate_files.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::Vision::V1p4beta1::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.batch_annotate_files.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.batch_annotate_files.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @image_annotator_stub.batch_annotate_files 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 - - ## - # Run asynchronous image detection and annotation for a list of images. - # - # Progress and results can be retrieved through the - # `google.longrunning.Operations` interface. - # `Operation.metadata` contains `OperationMetadata` (metadata). - # `Operation.response` contains `AsyncBatchAnnotateImagesResponse` (results). - # - # This service will write image annotation outputs to json files in customer - # GCS bucket, each json file containing BatchAnnotateImagesResponse proto. - # - # @overload async_batch_annotate_images(request, options = nil) - # Pass arguments to `async_batch_annotate_images` via a request object, either of type - # {::Google::Cloud::Vision::V1p4beta1::AsyncBatchAnnotateImagesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Vision::V1p4beta1::AsyncBatchAnnotateImagesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload async_batch_annotate_images(requests: nil, output_config: nil) - # Pass arguments to `async_batch_annotate_images` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param requests [::Array<::Google::Cloud::Vision::V1p4beta1::AnnotateImageRequest, ::Hash>] - # Required. Individual image annotation requests for this batch. - # @param output_config [::Google::Cloud::Vision::V1p4beta1::OutputConfig, ::Hash] - # Required. The desired output location and metadata (e.g. format). - # @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/vision/v1p4beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Vision::V1p4beta1::ImageAnnotator::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Vision::V1p4beta1::AsyncBatchAnnotateImagesRequest.new - # - # # Call the async_batch_annotate_images method. - # result = client.async_batch_annotate_images 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 async_batch_annotate_images request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Vision::V1p4beta1::AsyncBatchAnnotateImagesRequest - - # Converts hash 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.async_batch_annotate_images.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::Vision::V1p4beta1::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.async_batch_annotate_images.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.async_batch_annotate_images.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @image_annotator_stub.async_batch_annotate_images 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 - - ## - # Run asynchronous image detection and annotation for a list of generic - # files, such as PDF files, which may contain multiple pages and multiple - # images per page. Progress and results can be retrieved through the - # `google.longrunning.Operations` interface. - # `Operation.metadata` contains `OperationMetadata` (metadata). - # `Operation.response` contains `AsyncBatchAnnotateFilesResponse` (results). - # - # @overload async_batch_annotate_files(request, options = nil) - # Pass arguments to `async_batch_annotate_files` via a request object, either of type - # {::Google::Cloud::Vision::V1p4beta1::AsyncBatchAnnotateFilesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Vision::V1p4beta1::AsyncBatchAnnotateFilesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload async_batch_annotate_files(requests: nil) - # Pass arguments to `async_batch_annotate_files` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param requests [::Array<::Google::Cloud::Vision::V1p4beta1::AsyncAnnotateFileRequest, ::Hash>] - # Required. Individual async file annotation requests for this batch. - # @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/vision/v1p4beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Vision::V1p4beta1::ImageAnnotator::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Vision::V1p4beta1::AsyncBatchAnnotateFilesRequest.new - # - # # Call the async_batch_annotate_files method. - # result = client.async_batch_annotate_files 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 async_batch_annotate_files request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Vision::V1p4beta1::AsyncBatchAnnotateFilesRequest - - # Converts hash 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.async_batch_annotate_files.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::Vision::V1p4beta1::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.async_batch_annotate_files.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.async_batch_annotate_files.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @image_annotator_stub.async_batch_annotate_files 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 - - ## - # Configuration class for the ImageAnnotator REST API. - # - # This class represents the configuration for ImageAnnotator 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::Vision::V1p4beta1::ImageAnnotator::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 - # # batch_annotate_images to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Vision::V1p4beta1::ImageAnnotator::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.batch_annotate_images.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Vision::V1p4beta1::ImageAnnotator::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.batch_annotate_images.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 = "vision.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 ImageAnnotator 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 `batch_annotate_images` - # @return [::Gapic::Config::Method] - # - attr_reader :batch_annotate_images - ## - # RPC-specific configuration for `batch_annotate_files` - # @return [::Gapic::Config::Method] - # - attr_reader :batch_annotate_files - ## - # RPC-specific configuration for `async_batch_annotate_images` - # @return [::Gapic::Config::Method] - # - attr_reader :async_batch_annotate_images - ## - # RPC-specific configuration for `async_batch_annotate_files` - # @return [::Gapic::Config::Method] - # - attr_reader :async_batch_annotate_files - - # @private - def initialize parent_rpcs = nil - batch_annotate_images_config = parent_rpcs.batch_annotate_images if parent_rpcs.respond_to? :batch_annotate_images - @batch_annotate_images = ::Gapic::Config::Method.new batch_annotate_images_config - batch_annotate_files_config = parent_rpcs.batch_annotate_files if parent_rpcs.respond_to? :batch_annotate_files - @batch_annotate_files = ::Gapic::Config::Method.new batch_annotate_files_config - async_batch_annotate_images_config = parent_rpcs.async_batch_annotate_images if parent_rpcs.respond_to? :async_batch_annotate_images - @async_batch_annotate_images = ::Gapic::Config::Method.new async_batch_annotate_images_config - async_batch_annotate_files_config = parent_rpcs.async_batch_annotate_files if parent_rpcs.respond_to? :async_batch_annotate_files - @async_batch_annotate_files = ::Gapic::Config::Method.new async_batch_annotate_files_config - - yield self if block_given? - end - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1/image_annotator/rest/operations.rb b/owl-bot-staging/google-cloud-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1/image_annotator/rest/operations.rb deleted file mode 100644 index 40d87bee3397..000000000000 --- a/owl-bot-staging/google-cloud-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1/image_annotator/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 Vision - module V1p4beta1 - module ImageAnnotator - module Rest - # Service that implements Longrunning Operations API. - class Operations - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "vision.$UNIVERSE_DOMAIN$" - - # @private - attr_reader :operations_stub - - ## - # Configuration for the ImageAnnotator 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 ImageAnnotator 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::Vision::V1p4beta1::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::Vision::V1p4beta1::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::Vision::V1p4beta1::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::Vision::V1p4beta1::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 = "vision.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{^operations(?:/.*)?$}, true] - ] - ) - 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-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1/image_annotator/rest/service_stub.rb b/owl-bot-staging/google-cloud-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1/image_annotator/rest/service_stub.rb deleted file mode 100644 index 1f7eefd44806..000000000000 --- a/owl-bot-staging/google-cloud-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1/image_annotator/rest/service_stub.rb +++ /dev/null @@ -1,321 +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/vision/v1p4beta1/image_annotator_pb" - -module Google - module Cloud - module Vision - module V1p4beta1 - module ImageAnnotator - module Rest - ## - # REST service stub for the ImageAnnotator 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 batch_annotate_images REST call - # - # @param request_pb [::Google::Cloud::Vision::V1p4beta1::BatchAnnotateImagesRequest] - # 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::Vision::V1p4beta1::BatchAnnotateImagesResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Vision::V1p4beta1::BatchAnnotateImagesResponse] - # A result object deserialized from the server's reply - def batch_annotate_images request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_batch_annotate_images_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: "batch_annotate_images", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Vision::V1p4beta1::BatchAnnotateImagesResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the batch_annotate_files REST call - # - # @param request_pb [::Google::Cloud::Vision::V1p4beta1::BatchAnnotateFilesRequest] - # 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::Vision::V1p4beta1::BatchAnnotateFilesResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Vision::V1p4beta1::BatchAnnotateFilesResponse] - # A result object deserialized from the server's reply - def batch_annotate_files request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_batch_annotate_files_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: "batch_annotate_files", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Vision::V1p4beta1::BatchAnnotateFilesResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the async_batch_annotate_images REST call - # - # @param request_pb [::Google::Cloud::Vision::V1p4beta1::AsyncBatchAnnotateImagesRequest] - # 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 async_batch_annotate_images request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_async_batch_annotate_images_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: "async_batch_annotate_images", - 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 async_batch_annotate_files REST call - # - # @param request_pb [::Google::Cloud::Vision::V1p4beta1::AsyncBatchAnnotateFilesRequest] - # 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 async_batch_annotate_files request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_async_batch_annotate_files_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: "async_batch_annotate_files", - 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 - - ## - # @private - # - # GRPC transcoding helper method for the batch_annotate_images REST call - # - # @param request_pb [::Google::Cloud::Vision::V1p4beta1::BatchAnnotateImagesRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_batch_annotate_images_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1p4beta1/images:annotate", - body: "*", - matches: [] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the batch_annotate_files REST call - # - # @param request_pb [::Google::Cloud::Vision::V1p4beta1::BatchAnnotateFilesRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_batch_annotate_files_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1p4beta1/files:annotate", - body: "*", - matches: [] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the async_batch_annotate_images REST call - # - # @param request_pb [::Google::Cloud::Vision::V1p4beta1::AsyncBatchAnnotateImagesRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_async_batch_annotate_images_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1p4beta1/images:asyncBatchAnnotate", - body: "*", - matches: [] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the async_batch_annotate_files REST call - # - # @param request_pb [::Google::Cloud::Vision::V1p4beta1::AsyncBatchAnnotateFilesRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_async_batch_annotate_files_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1p4beta1/files:asyncBatchAnnotate", - body: "*", - matches: [] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1/image_annotator_pb.rb b/owl-bot-staging/google-cloud-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1/image_annotator_pb.rb deleted file mode 100644 index e0b4ceeefcd7..000000000000 --- a/owl-bot-staging/google-cloud-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1/image_annotator_pb.rb +++ /dev/null @@ -1,78 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/vision/v1p4beta1/image_annotator.proto - -require 'google/protobuf' - -require 'google/api/annotations_pb' -require 'google/api/client_pb' -require 'google/api/field_behavior_pb' -require 'google/cloud/vision/v1p4beta1/face_pb' -require 'google/cloud/vision/v1p4beta1/geometry_pb' -require 'google/cloud/vision/v1p4beta1/product_search_pb' -require 'google/cloud/vision/v1p4beta1/text_annotation_pb' -require 'google/cloud/vision/v1p4beta1/web_detection_pb' -require 'google/longrunning/operations_pb' -require 'google/protobuf/timestamp_pb' -require 'google/rpc/status_pb' -require 'google/type/color_pb' -require 'google/type/latlng_pb' - - -descriptor_data = "\n3google/cloud/vision/v1p4beta1/image_annotator.proto\x12\x1dgoogle.cloud.vision.v1p4beta1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a(google/cloud/vision/v1p4beta1/face.proto\x1a,google/cloud/vision/v1p4beta1/geometry.proto\x1a\x32google/cloud/vision/v1p4beta1/product_search.proto\x1a\x33google/cloud/vision/v1p4beta1/text_annotation.proto\x1a\x31google/cloud/vision/v1p4beta1/web_detection.proto\x1a#google/longrunning/operations.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x17google/rpc/status.proto\x1a\x17google/type/color.proto\x1a\x18google/type/latlng.proto\"\x8e\x03\n\x07\x46\x65\x61ture\x12\x39\n\x04type\x18\x01 \x01(\x0e\x32+.google.cloud.vision.v1p4beta1.Feature.Type\x12\x13\n\x0bmax_results\x18\x02 \x01(\x05\x12\r\n\x05model\x18\x03 \x01(\t\"\xa3\x02\n\x04Type\x12\x14\n\x10TYPE_UNSPECIFIED\x10\x00\x12\x12\n\x0e\x46\x41\x43\x45_DETECTION\x10\x01\x12\x16\n\x12LANDMARK_DETECTION\x10\x02\x12\x12\n\x0eLOGO_DETECTION\x10\x03\x12\x13\n\x0fLABEL_DETECTION\x10\x04\x12\x12\n\x0eTEXT_DETECTION\x10\x05\x12\x1b\n\x17\x44OCUMENT_TEXT_DETECTION\x10\x0b\x12\x19\n\x15SAFE_SEARCH_DETECTION\x10\x06\x12\x14\n\x10IMAGE_PROPERTIES\x10\x07\x12\x0e\n\nCROP_HINTS\x10\t\x12\x11\n\rWEB_DETECTION\x10\n\x12\x12\n\x0ePRODUCT_SEARCH\x10\x0c\x12\x17\n\x13OBJECT_LOCALIZATION\x10\x13\"7\n\x0bImageSource\x12\x15\n\rgcs_image_uri\x18\x01 \x01(\t\x12\x11\n\timage_uri\x18\x02 \x01(\t\"T\n\x05Image\x12\x0f\n\x07\x63ontent\x18\x01 \x01(\x0c\x12:\n\x06source\x18\x02 \x01(\x0b\x32*.google.cloud.vision.v1p4beta1.ImageSource\"\xed\x0e\n\x0e\x46\x61\x63\x65\x41nnotation\x12\x42\n\rbounding_poly\x18\x01 \x01(\x0b\x32+.google.cloud.vision.v1p4beta1.BoundingPoly\x12\x45\n\x10\x66\x64_bounding_poly\x18\x02 \x01(\x0b\x32+.google.cloud.vision.v1p4beta1.BoundingPoly\x12I\n\tlandmarks\x18\x03 \x03(\x0b\x32\x36.google.cloud.vision.v1p4beta1.FaceAnnotation.Landmark\x12\x12\n\nroll_angle\x18\x04 \x01(\x02\x12\x11\n\tpan_angle\x18\x05 \x01(\x02\x12\x12\n\ntilt_angle\x18\x06 \x01(\x02\x12\x1c\n\x14\x64\x65tection_confidence\x18\x07 \x01(\x02\x12\x1e\n\x16landmarking_confidence\x18\x08 \x01(\x02\x12\x41\n\x0ejoy_likelihood\x18\t \x01(\x0e\x32).google.cloud.vision.v1p4beta1.Likelihood\x12\x44\n\x11sorrow_likelihood\x18\n \x01(\x0e\x32).google.cloud.vision.v1p4beta1.Likelihood\x12\x43\n\x10\x61nger_likelihood\x18\x0b \x01(\x0e\x32).google.cloud.vision.v1p4beta1.Likelihood\x12\x46\n\x13surprise_likelihood\x18\x0c \x01(\x0e\x32).google.cloud.vision.v1p4beta1.Likelihood\x12K\n\x18under_exposed_likelihood\x18\r \x01(\x0e\x32).google.cloud.vision.v1p4beta1.Likelihood\x12\x45\n\x12\x62lurred_likelihood\x18\x0e \x01(\x0e\x32).google.cloud.vision.v1p4beta1.Likelihood\x12\x46\n\x13headwear_likelihood\x18\x0f \x01(\x0e\x32).google.cloud.vision.v1p4beta1.Likelihood\x12P\n\x12recognition_result\x18\x10 \x03(\x0b\x32\x34.google.cloud.vision.v1p4beta1.FaceRecognitionResult\x1a\xc7\x07\n\x08Landmark\x12I\n\x04type\x18\x03 \x01(\x0e\x32;.google.cloud.vision.v1p4beta1.FaceAnnotation.Landmark.Type\x12\x39\n\x08position\x18\x04 \x01(\x0b\x32\'.google.cloud.vision.v1p4beta1.Position\"\xb4\x06\n\x04Type\x12\x14\n\x10UNKNOWN_LANDMARK\x10\x00\x12\x0c\n\x08LEFT_EYE\x10\x01\x12\r\n\tRIGHT_EYE\x10\x02\x12\x18\n\x14LEFT_OF_LEFT_EYEBROW\x10\x03\x12\x19\n\x15RIGHT_OF_LEFT_EYEBROW\x10\x04\x12\x19\n\x15LEFT_OF_RIGHT_EYEBROW\x10\x05\x12\x1a\n\x16RIGHT_OF_RIGHT_EYEBROW\x10\x06\x12\x19\n\x15MIDPOINT_BETWEEN_EYES\x10\x07\x12\x0c\n\x08NOSE_TIP\x10\x08\x12\r\n\tUPPER_LIP\x10\t\x12\r\n\tLOWER_LIP\x10\n\x12\x0e\n\nMOUTH_LEFT\x10\x0b\x12\x0f\n\x0bMOUTH_RIGHT\x10\x0c\x12\x10\n\x0cMOUTH_CENTER\x10\r\x12\x15\n\x11NOSE_BOTTOM_RIGHT\x10\x0e\x12\x14\n\x10NOSE_BOTTOM_LEFT\x10\x0f\x12\x16\n\x12NOSE_BOTTOM_CENTER\x10\x10\x12\x19\n\x15LEFT_EYE_TOP_BOUNDARY\x10\x11\x12\x19\n\x15LEFT_EYE_RIGHT_CORNER\x10\x12\x12\x1c\n\x18LEFT_EYE_BOTTOM_BOUNDARY\x10\x13\x12\x18\n\x14LEFT_EYE_LEFT_CORNER\x10\x14\x12\x1a\n\x16RIGHT_EYE_TOP_BOUNDARY\x10\x15\x12\x1a\n\x16RIGHT_EYE_RIGHT_CORNER\x10\x16\x12\x1d\n\x19RIGHT_EYE_BOTTOM_BOUNDARY\x10\x17\x12\x19\n\x15RIGHT_EYE_LEFT_CORNER\x10\x18\x12\x1f\n\x1bLEFT_EYEBROW_UPPER_MIDPOINT\x10\x19\x12 \n\x1cRIGHT_EYEBROW_UPPER_MIDPOINT\x10\x1a\x12\x14\n\x10LEFT_EAR_TRAGION\x10\x1b\x12\x15\n\x11RIGHT_EAR_TRAGION\x10\x1c\x12\x12\n\x0eLEFT_EYE_PUPIL\x10\x1d\x12\x13\n\x0fRIGHT_EYE_PUPIL\x10\x1e\x12\x15\n\x11\x46OREHEAD_GLABELLA\x10\x1f\x12\x11\n\rCHIN_GNATHION\x10 \x12\x14\n\x10\x43HIN_LEFT_GONION\x10!\x12\x15\n\x11\x43HIN_RIGHT_GONION\x10\"\"4\n\x0cLocationInfo\x12$\n\x07lat_lng\x18\x01 \x01(\x0b\x32\x13.google.type.LatLng\"=\n\x08Property\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t\x12\x14\n\x0cuint64_value\x18\x03 \x01(\x04\"\xc0\x02\n\x10\x45ntityAnnotation\x12\x0b\n\x03mid\x18\x01 \x01(\t\x12\x0e\n\x06locale\x18\x02 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x03 \x01(\t\x12\r\n\x05score\x18\x04 \x01(\x02\x12\x16\n\nconfidence\x18\x05 \x01(\x02\x42\x02\x18\x01\x12\x12\n\ntopicality\x18\x06 \x01(\x02\x12\x42\n\rbounding_poly\x18\x07 \x01(\x0b\x32+.google.cloud.vision.v1p4beta1.BoundingPoly\x12>\n\tlocations\x18\x08 \x03(\x0b\x32+.google.cloud.vision.v1p4beta1.LocationInfo\x12;\n\nproperties\x18\t \x03(\x0b\x32\'.google.cloud.vision.v1p4beta1.Property\"\xa0\x01\n\x19LocalizedObjectAnnotation\x12\x0b\n\x03mid\x18\x01 \x01(\t\x12\x15\n\rlanguage_code\x18\x02 \x01(\t\x12\x0c\n\x04name\x18\x03 \x01(\t\x12\r\n\x05score\x18\x04 \x01(\x02\x12\x42\n\rbounding_poly\x18\x05 \x01(\x0b\x32+.google.cloud.vision.v1p4beta1.BoundingPoly\"\xbc\x02\n\x14SafeSearchAnnotation\x12\x38\n\x05\x61\x64ult\x18\x01 \x01(\x0e\x32).google.cloud.vision.v1p4beta1.Likelihood\x12\x38\n\x05spoof\x18\x02 \x01(\x0e\x32).google.cloud.vision.v1p4beta1.Likelihood\x12:\n\x07medical\x18\x03 \x01(\x0e\x32).google.cloud.vision.v1p4beta1.Likelihood\x12;\n\x08violence\x18\x04 \x01(\x0e\x32).google.cloud.vision.v1p4beta1.Likelihood\x12\x37\n\x04racy\x18\t \x01(\x0e\x32).google.cloud.vision.v1p4beta1.Likelihood\"a\n\x0bLatLongRect\x12(\n\x0bmin_lat_lng\x18\x01 \x01(\x0b\x32\x13.google.type.LatLng\x12(\n\x0bmax_lat_lng\x18\x02 \x01(\x0b\x32\x13.google.type.LatLng\"U\n\tColorInfo\x12!\n\x05\x63olor\x18\x01 \x01(\x0b\x32\x12.google.type.Color\x12\r\n\x05score\x18\x02 \x01(\x02\x12\x16\n\x0epixel_fraction\x18\x03 \x01(\x02\"T\n\x18\x44ominantColorsAnnotation\x12\x38\n\x06\x63olors\x18\x01 \x03(\x0b\x32(.google.cloud.vision.v1p4beta1.ColorInfo\"c\n\x0fImageProperties\x12P\n\x0f\x64ominant_colors\x18\x01 \x01(\x0b\x32\x37.google.cloud.vision.v1p4beta1.DominantColorsAnnotation\"\x7f\n\x08\x43ropHint\x12\x42\n\rbounding_poly\x18\x01 \x01(\x0b\x32+.google.cloud.vision.v1p4beta1.BoundingPoly\x12\x12\n\nconfidence\x18\x02 \x01(\x02\x12\x1b\n\x13importance_fraction\x18\x03 \x01(\x02\"R\n\x13\x43ropHintsAnnotation\x12;\n\ncrop_hints\x18\x01 \x03(\x0b\x32\'.google.cloud.vision.v1p4beta1.CropHint\"(\n\x0f\x43ropHintsParams\x12\x15\n\raspect_ratios\x18\x01 \x03(\x02\"1\n\x12WebDetectionParams\x12\x1b\n\x13include_geo_results\x18\x02 \x01(\x08\"c\n\x13TextDetectionParams\x12.\n&enable_text_detection_confidence_score\x18\t \x01(\x08\x12\x1c\n\x14\x61\x64vanced_ocr_options\x18\x0b \x03(\t\"\x82\x04\n\x0cImageContext\x12\x41\n\rlat_long_rect\x18\x01 \x01(\x0b\x32*.google.cloud.vision.v1p4beta1.LatLongRect\x12\x16\n\x0elanguage_hints\x18\x02 \x03(\t\x12I\n\x11\x63rop_hints_params\x18\x04 \x01(\x0b\x32..google.cloud.vision.v1p4beta1.CropHintsParams\x12U\n\x17\x66\x61\x63\x65_recognition_params\x18\n \x01(\x0b\x32\x34.google.cloud.vision.v1p4beta1.FaceRecognitionParams\x12Q\n\x15product_search_params\x18\x05 \x01(\x0b\x32\x32.google.cloud.vision.v1p4beta1.ProductSearchParams\x12O\n\x14web_detection_params\x18\x06 \x01(\x0b\x32\x31.google.cloud.vision.v1p4beta1.WebDetectionParams\x12Q\n\x15text_detection_params\x18\x0c \x01(\x0b\x32\x32.google.cloud.vision.v1p4beta1.TextDetectionParams\"\xc9\x01\n\x14\x41nnotateImageRequest\x12\x33\n\x05image\x18\x01 \x01(\x0b\x32$.google.cloud.vision.v1p4beta1.Image\x12\x38\n\x08\x66\x65\x61tures\x18\x02 \x03(\x0b\x32&.google.cloud.vision.v1p4beta1.Feature\x12\x42\n\rimage_context\x18\x03 \x01(\x0b\x32+.google.cloud.vision.v1p4beta1.ImageContext\":\n\x16ImageAnnotationContext\x12\x0b\n\x03uri\x18\x01 \x01(\t\x12\x13\n\x0bpage_number\x18\x02 \x01(\x05\"\xbf\x08\n\x15\x41nnotateImageResponse\x12G\n\x10\x66\x61\x63\x65_annotations\x18\x01 \x03(\x0b\x32-.google.cloud.vision.v1p4beta1.FaceAnnotation\x12M\n\x14landmark_annotations\x18\x02 \x03(\x0b\x32/.google.cloud.vision.v1p4beta1.EntityAnnotation\x12I\n\x10logo_annotations\x18\x03 \x03(\x0b\x32/.google.cloud.vision.v1p4beta1.EntityAnnotation\x12J\n\x11label_annotations\x18\x04 \x03(\x0b\x32/.google.cloud.vision.v1p4beta1.EntityAnnotation\x12^\n\x1clocalized_object_annotations\x18\x16 \x03(\x0b\x32\x38.google.cloud.vision.v1p4beta1.LocalizedObjectAnnotation\x12I\n\x10text_annotations\x18\x05 \x03(\x0b\x32/.google.cloud.vision.v1p4beta1.EntityAnnotation\x12K\n\x14\x66ull_text_annotation\x18\x0c \x01(\x0b\x32-.google.cloud.vision.v1p4beta1.TextAnnotation\x12S\n\x16safe_search_annotation\x18\x06 \x01(\x0b\x32\x33.google.cloud.vision.v1p4beta1.SafeSearchAnnotation\x12S\n\x1bimage_properties_annotation\x18\x08 \x01(\x0b\x32..google.cloud.vision.v1p4beta1.ImageProperties\x12Q\n\x15\x63rop_hints_annotation\x18\x0b \x01(\x0b\x32\x32.google.cloud.vision.v1p4beta1.CropHintsAnnotation\x12\x42\n\rweb_detection\x18\r \x01(\x0b\x32+.google.cloud.vision.v1p4beta1.WebDetection\x12S\n\x16product_search_results\x18\x0e \x01(\x0b\x32\x33.google.cloud.vision.v1p4beta1.ProductSearchResults\x12!\n\x05\x65rror\x18\t \x01(\x0b\x32\x12.google.rpc.Status\x12\x46\n\x07\x63ontext\x18\x15 \x01(\x0b\x32\x35.google.cloud.vision.v1p4beta1.ImageAnnotationContext\"h\n\x1a\x42\x61tchAnnotateImagesRequest\x12J\n\x08requests\x18\x01 \x03(\x0b\x32\x33.google.cloud.vision.v1p4beta1.AnnotateImageRequestB\x03\xe0\x41\x02\"f\n\x1b\x42\x61tchAnnotateImagesResponse\x12G\n\tresponses\x18\x01 \x03(\x0b\x32\x34.google.cloud.vision.v1p4beta1.AnnotateImageResponse\"\xe4\x01\n\x13\x41nnotateFileRequest\x12@\n\x0cinput_config\x18\x01 \x01(\x0b\x32*.google.cloud.vision.v1p4beta1.InputConfig\x12\x38\n\x08\x66\x65\x61tures\x18\x02 \x03(\x0b\x32&.google.cloud.vision.v1p4beta1.Feature\x12\x42\n\rimage_context\x18\x03 \x01(\x0b\x32+.google.cloud.vision.v1p4beta1.ImageContext\x12\r\n\x05pages\x18\x04 \x03(\x05\"\xd9\x01\n\x14\x41nnotateFileResponse\x12@\n\x0cinput_config\x18\x01 \x01(\x0b\x32*.google.cloud.vision.v1p4beta1.InputConfig\x12G\n\tresponses\x18\x02 \x03(\x0b\x32\x34.google.cloud.vision.v1p4beta1.AnnotateImageResponse\x12\x13\n\x0btotal_pages\x18\x03 \x01(\x05\x12!\n\x05\x65rror\x18\x04 \x01(\x0b\x32\x12.google.rpc.Status\"f\n\x19\x42\x61tchAnnotateFilesRequest\x12I\n\x08requests\x18\x01 \x03(\x0b\x32\x32.google.cloud.vision.v1p4beta1.AnnotateFileRequestB\x03\xe0\x41\x02\"d\n\x1a\x42\x61tchAnnotateFilesResponse\x12\x46\n\tresponses\x18\x01 \x03(\x0b\x32\x33.google.cloud.vision.v1p4beta1.AnnotateFileResponse\"\x9e\x02\n\x18\x41syncAnnotateFileRequest\x12@\n\x0cinput_config\x18\x01 \x01(\x0b\x32*.google.cloud.vision.v1p4beta1.InputConfig\x12\x38\n\x08\x66\x65\x61tures\x18\x02 \x03(\x0b\x32&.google.cloud.vision.v1p4beta1.Feature\x12\x42\n\rimage_context\x18\x03 \x01(\x0b\x32+.google.cloud.vision.v1p4beta1.ImageContext\x12\x42\n\routput_config\x18\x04 \x01(\x0b\x32+.google.cloud.vision.v1p4beta1.OutputConfig\"_\n\x19\x41syncAnnotateFileResponse\x12\x42\n\routput_config\x18\x01 \x01(\x0b\x32+.google.cloud.vision.v1p4beta1.OutputConfig\"\xb6\x01\n\x1f\x41syncBatchAnnotateImagesRequest\x12J\n\x08requests\x18\x01 \x03(\x0b\x32\x33.google.cloud.vision.v1p4beta1.AnnotateImageRequestB\x03\xe0\x41\x02\x12G\n\routput_config\x18\x02 \x01(\x0b\x32+.google.cloud.vision.v1p4beta1.OutputConfigB\x03\xe0\x41\x02\"f\n AsyncBatchAnnotateImagesResponse\x12\x42\n\routput_config\x18\x01 \x01(\x0b\x32+.google.cloud.vision.v1p4beta1.OutputConfig\"p\n\x1e\x41syncBatchAnnotateFilesRequest\x12N\n\x08requests\x18\x01 \x03(\x0b\x32\x37.google.cloud.vision.v1p4beta1.AsyncAnnotateFileRequestB\x03\xe0\x41\x02\"n\n\x1f\x41syncBatchAnnotateFilesResponse\x12K\n\tresponses\x18\x01 \x03(\x0b\x32\x38.google.cloud.vision.v1p4beta1.AsyncAnnotateFileResponse\"o\n\x0bInputConfig\x12<\n\ngcs_source\x18\x01 \x01(\x0b\x32(.google.cloud.vision.v1p4beta1.GcsSource\x12\x0f\n\x07\x63ontent\x18\x03 \x01(\x0c\x12\x11\n\tmime_type\x18\x02 \x01(\t\"j\n\x0cOutputConfig\x12\x46\n\x0fgcs_destination\x18\x01 \x01(\x0b\x32-.google.cloud.vision.v1p4beta1.GcsDestination\x12\x12\n\nbatch_size\x18\x02 \x01(\x05\"\x18\n\tGcsSource\x12\x0b\n\x03uri\x18\x01 \x01(\t\"\x1d\n\x0eGcsDestination\x12\x0b\n\x03uri\x18\x01 \x01(\t\"\x8f\x02\n\x11OperationMetadata\x12\x45\n\x05state\x18\x01 \x01(\x0e\x32\x36.google.cloud.vision.v1p4beta1.OperationMetadata.State\x12/\n\x0b\x63reate_time\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12/\n\x0bupdate_time\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"Q\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0b\n\x07\x43REATED\x10\x01\x12\x0b\n\x07RUNNING\x10\x02\x12\x08\n\x04\x44ONE\x10\x03\x12\r\n\tCANCELLED\x10\x04*e\n\nLikelihood\x12\x0b\n\x07UNKNOWN\x10\x00\x12\x11\n\rVERY_UNLIKELY\x10\x01\x12\x0c\n\x08UNLIKELY\x10\x02\x12\x0c\n\x08POSSIBLE\x10\x03\x12\n\n\x06LIKELY\x10\x04\x12\x0f\n\x0bVERY_LIKELY\x10\x05\x32\xf1\x07\n\x0eImageAnnotator\x12\xbe\x01\n\x13\x42\x61tchAnnotateImages\x12\x39.google.cloud.vision.v1p4beta1.BatchAnnotateImagesRequest\x1a:.google.cloud.vision.v1p4beta1.BatchAnnotateImagesResponse\"0\xda\x41\x08requests\x82\xd3\xe4\x93\x02\x1f\"\x1a/v1p4beta1/images:annotate:\x01*\x12\xba\x01\n\x12\x42\x61tchAnnotateFiles\x12\x38.google.cloud.vision.v1p4beta1.BatchAnnotateFilesRequest\x1a\x39.google.cloud.vision.v1p4beta1.BatchAnnotateFilesResponse\"/\xda\x41\x08requests\x82\xd3\xe4\x93\x02\x1e\"\x19/v1p4beta1/files:annotate:\x01*\x12\xfc\x01\n\x18\x41syncBatchAnnotateImages\x12>.google.cloud.vision.v1p4beta1.AsyncBatchAnnotateImagesRequest\x1a\x1d.google.longrunning.Operation\"\x80\x01\xca\x41\x35\n AsyncBatchAnnotateImagesResponse\x12\x11OperationMetadata\xda\x41\x16requests,output_config\x82\xd3\xe4\x93\x02)\"$/v1p4beta1/images:asyncBatchAnnotate:\x01*\x12\xe9\x01\n\x17\x41syncBatchAnnotateFiles\x12=.google.cloud.vision.v1p4beta1.AsyncBatchAnnotateFilesRequest\x1a\x1d.google.longrunning.Operation\"p\xca\x41\x34\n\x1f\x41syncBatchAnnotateFilesResponse\x12\x11OperationMetadata\xda\x41\x08requests\x82\xd3\xe4\x93\x02(\"#/v1p4beta1/files:asyncBatchAnnotate:\x01*\x1av\xca\x41\x15vision.googleapis.com\xd2\x41[https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/cloud-visionB\x7f\n!com.google.cloud.vision.v1p4beta1B\x13ImageAnnotatorProtoP\x01Z9cloud.google.com/go/vision/apiv1p4beta1/visionpb;visionpb\xf8\x01\x01\xa2\x02\x04GCVNb\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module Vision - module V1p4beta1 - Feature = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p4beta1.Feature").msgclass - Feature::Type = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p4beta1.Feature.Type").enummodule - ImageSource = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p4beta1.ImageSource").msgclass - Image = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p4beta1.Image").msgclass - FaceAnnotation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p4beta1.FaceAnnotation").msgclass - FaceAnnotation::Landmark = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p4beta1.FaceAnnotation.Landmark").msgclass - FaceAnnotation::Landmark::Type = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p4beta1.FaceAnnotation.Landmark.Type").enummodule - LocationInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p4beta1.LocationInfo").msgclass - Property = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p4beta1.Property").msgclass - EntityAnnotation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p4beta1.EntityAnnotation").msgclass - LocalizedObjectAnnotation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p4beta1.LocalizedObjectAnnotation").msgclass - SafeSearchAnnotation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p4beta1.SafeSearchAnnotation").msgclass - LatLongRect = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p4beta1.LatLongRect").msgclass - ColorInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p4beta1.ColorInfo").msgclass - DominantColorsAnnotation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p4beta1.DominantColorsAnnotation").msgclass - ImageProperties = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p4beta1.ImageProperties").msgclass - CropHint = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p4beta1.CropHint").msgclass - CropHintsAnnotation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p4beta1.CropHintsAnnotation").msgclass - CropHintsParams = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p4beta1.CropHintsParams").msgclass - WebDetectionParams = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p4beta1.WebDetectionParams").msgclass - TextDetectionParams = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p4beta1.TextDetectionParams").msgclass - ImageContext = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p4beta1.ImageContext").msgclass - AnnotateImageRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p4beta1.AnnotateImageRequest").msgclass - ImageAnnotationContext = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p4beta1.ImageAnnotationContext").msgclass - AnnotateImageResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p4beta1.AnnotateImageResponse").msgclass - BatchAnnotateImagesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p4beta1.BatchAnnotateImagesRequest").msgclass - BatchAnnotateImagesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p4beta1.BatchAnnotateImagesResponse").msgclass - AnnotateFileRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p4beta1.AnnotateFileRequest").msgclass - AnnotateFileResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p4beta1.AnnotateFileResponse").msgclass - BatchAnnotateFilesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p4beta1.BatchAnnotateFilesRequest").msgclass - BatchAnnotateFilesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p4beta1.BatchAnnotateFilesResponse").msgclass - AsyncAnnotateFileRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p4beta1.AsyncAnnotateFileRequest").msgclass - AsyncAnnotateFileResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p4beta1.AsyncAnnotateFileResponse").msgclass - AsyncBatchAnnotateImagesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p4beta1.AsyncBatchAnnotateImagesRequest").msgclass - AsyncBatchAnnotateImagesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p4beta1.AsyncBatchAnnotateImagesResponse").msgclass - AsyncBatchAnnotateFilesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p4beta1.AsyncBatchAnnotateFilesRequest").msgclass - AsyncBatchAnnotateFilesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p4beta1.AsyncBatchAnnotateFilesResponse").msgclass - InputConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p4beta1.InputConfig").msgclass - OutputConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p4beta1.OutputConfig").msgclass - GcsSource = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p4beta1.GcsSource").msgclass - GcsDestination = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p4beta1.GcsDestination").msgclass - OperationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p4beta1.OperationMetadata").msgclass - OperationMetadata::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p4beta1.OperationMetadata.State").enummodule - Likelihood = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p4beta1.Likelihood").enummodule - end - end - end -end diff --git a/owl-bot-staging/google-cloud-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1/image_annotator_services_pb.rb b/owl-bot-staging/google-cloud-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1/image_annotator_services_pb.rb deleted file mode 100644 index e34e7d914cce..000000000000 --- a/owl-bot-staging/google-cloud-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1/image_annotator_services_pb.rb +++ /dev/null @@ -1,73 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# Source: google/cloud/vision/v1p4beta1/image_annotator.proto for package 'google.cloud.vision.v1p4beta1' -# 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/vision/v1p4beta1/image_annotator_pb' - -module Google - module Cloud - module Vision - module V1p4beta1 - module ImageAnnotator - # Service that performs Google Cloud Vision API detection tasks over client - # images, such as face, landmark, logo, label, and text detection. The - # ImageAnnotator service returns detected entities from the images. - class Service - - include ::GRPC::GenericService - - self.marshal_class_method = :encode - self.unmarshal_class_method = :decode - self.service_name = 'google.cloud.vision.v1p4beta1.ImageAnnotator' - - # Run image detection and annotation for a batch of images. - rpc :BatchAnnotateImages, ::Google::Cloud::Vision::V1p4beta1::BatchAnnotateImagesRequest, ::Google::Cloud::Vision::V1p4beta1::BatchAnnotateImagesResponse - # Service that performs image detection and annotation for a batch of files. - # Now only "application/pdf", "image/tiff" and "image/gif" are supported. - # - # This service will extract at most 5 (customers can specify which 5 in - # AnnotateFileRequest.pages) frames (gif) or pages (pdf or tiff) from each - # file provided and perform detection and annotation for each image - # extracted. - rpc :BatchAnnotateFiles, ::Google::Cloud::Vision::V1p4beta1::BatchAnnotateFilesRequest, ::Google::Cloud::Vision::V1p4beta1::BatchAnnotateFilesResponse - # Run asynchronous image detection and annotation for a list of images. - # - # Progress and results can be retrieved through the - # `google.longrunning.Operations` interface. - # `Operation.metadata` contains `OperationMetadata` (metadata). - # `Operation.response` contains `AsyncBatchAnnotateImagesResponse` (results). - # - # This service will write image annotation outputs to json files in customer - # GCS bucket, each json file containing BatchAnnotateImagesResponse proto. - rpc :AsyncBatchAnnotateImages, ::Google::Cloud::Vision::V1p4beta1::AsyncBatchAnnotateImagesRequest, ::Google::Longrunning::Operation - # Run asynchronous image detection and annotation for a list of generic - # files, such as PDF files, which may contain multiple pages and multiple - # images per page. Progress and results can be retrieved through the - # `google.longrunning.Operations` interface. - # `Operation.metadata` contains `OperationMetadata` (metadata). - # `Operation.response` contains `AsyncBatchAnnotateFilesResponse` (results). - rpc :AsyncBatchAnnotateFiles, ::Google::Cloud::Vision::V1p4beta1::AsyncBatchAnnotateFilesRequest, ::Google::Longrunning::Operation - end - - Stub = Service.rpc_stub_class - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1/product_search.rb b/owl-bot-staging/google-cloud-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1/product_search.rb deleted file mode 100644 index 012158d076ed..000000000000 --- a/owl-bot-staging/google-cloud-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1/product_search.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/vision/v1p4beta1/version" - -require "google/cloud/vision/v1p4beta1/product_search/credentials" -require "google/cloud/vision/v1p4beta1/product_search/paths" -require "google/cloud/vision/v1p4beta1/product_search/operations" -require "google/cloud/vision/v1p4beta1/product_search/client" -require "google/cloud/vision/v1p4beta1/product_search/rest" - -module Google - module Cloud - module Vision - module V1p4beta1 - ## - # Manages Products and ProductSets of reference images for use in product - # search. It uses the following resource model: - # - # - The API has a collection of - # {::Google::Cloud::Vision::V1p4beta1::ProductSet ProductSet} resources, named - # `projects/*/locations/*/productSets/*`, which acts as a way to put different - # products into groups to limit identification. - # - # In parallel, - # - # - The API has a collection of - # {::Google::Cloud::Vision::V1p4beta1::Product Product} resources, named - # `projects/*/locations/*/products/*` - # - # - Each {::Google::Cloud::Vision::V1p4beta1::Product Product} has a collection of - # {::Google::Cloud::Vision::V1p4beta1::ReferenceImage ReferenceImage} resources, - # named - # `projects/*/locations/*/products/*/referenceImages/*` - # - # @example Load this service and instantiate a gRPC client - # - # require "google/cloud/vision/v1p4beta1/product_search" - # client = ::Google::Cloud::Vision::V1p4beta1::ProductSearch::Client.new - # - # @example Load this service and instantiate a REST client - # - # require "google/cloud/vision/v1p4beta1/product_search/rest" - # client = ::Google::Cloud::Vision::V1p4beta1::ProductSearch::Rest::Client.new - # - module ProductSearch - end - end - end - end -end - -helper_path = ::File.join __dir__, "product_search", "helpers.rb" -require "google/cloud/vision/v1p4beta1/product_search/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1/product_search/client.rb b/owl-bot-staging/google-cloud-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1/product_search/client.rb deleted file mode 100644 index 9813ed9b82d1..000000000000 --- a/owl-bot-staging/google-cloud-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1/product_search/client.rb +++ /dev/null @@ -1,2558 +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/vision/v1p4beta1/product_search_service_pb" - -module Google - module Cloud - module Vision - module V1p4beta1 - module ProductSearch - ## - # Client for the ProductSearch service. - # - # Manages Products and ProductSets of reference images for use in product - # search. It uses the following resource model: - # - # - The API has a collection of - # {::Google::Cloud::Vision::V1p4beta1::ProductSet ProductSet} resources, named - # `projects/*/locations/*/productSets/*`, which acts as a way to put different - # products into groups to limit identification. - # - # In parallel, - # - # - The API has a collection of - # {::Google::Cloud::Vision::V1p4beta1::Product Product} resources, named - # `projects/*/locations/*/products/*` - # - # - Each {::Google::Cloud::Vision::V1p4beta1::Product Product} has a collection of - # {::Google::Cloud::Vision::V1p4beta1::ReferenceImage ReferenceImage} resources, - # named - # `projects/*/locations/*/products/*/referenceImages/*` - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "vision.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :product_search_stub - - ## - # Configure the ProductSearch Client class. - # - # See {::Google::Cloud::Vision::V1p4beta1::ProductSearch::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all ProductSearch clients - # ::Google::Cloud::Vision::V1p4beta1::ProductSearch::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", "Vision", "V1p4beta1"] - 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_product_set.timeout = 600.0 - default_config.rpcs.create_product_set.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [] - } - - default_config.rpcs.list_product_sets.timeout = 600.0 - default_config.rpcs.list_product_sets.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.get_product_set.timeout = 600.0 - default_config.rpcs.get_product_set.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.update_product_set.timeout = 600.0 - default_config.rpcs.update_product_set.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [] - } - - default_config.rpcs.delete_product_set.timeout = 600.0 - default_config.rpcs.delete_product_set.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.create_product.timeout = 600.0 - default_config.rpcs.create_product.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [] - } - - default_config.rpcs.list_products.timeout = 600.0 - default_config.rpcs.list_products.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.get_product.timeout = 600.0 - default_config.rpcs.get_product.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.update_product.timeout = 600.0 - default_config.rpcs.update_product.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [] - } - - default_config.rpcs.delete_product.timeout = 600.0 - default_config.rpcs.delete_product.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.create_reference_image.timeout = 600.0 - default_config.rpcs.create_reference_image.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [] - } - - default_config.rpcs.delete_reference_image.timeout = 600.0 - default_config.rpcs.delete_reference_image.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.list_reference_images.timeout = 600.0 - default_config.rpcs.list_reference_images.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.get_reference_image.timeout = 600.0 - default_config.rpcs.get_reference_image.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.add_product_to_product_set.timeout = 600.0 - default_config.rpcs.add_product_to_product_set.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [] - } - - default_config.rpcs.remove_product_from_product_set.timeout = 600.0 - default_config.rpcs.remove_product_from_product_set.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [] - } - - default_config.rpcs.list_products_in_product_set.timeout = 600.0 - default_config.rpcs.list_products_in_product_set.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.import_product_sets.timeout = 600.0 - default_config.rpcs.import_product_sets.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [] - } - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the ProductSearch 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::Vision::V1p4beta1::ProductSearch::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 - @product_search_stub.universe_domain - end - - ## - # Create a new ProductSearch client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Vision::V1p4beta1::ProductSearch::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Vision::V1p4beta1::ProductSearch::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the ProductSearch 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/vision/v1p4beta1/product_search_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 - - @product_search_stub = ::Gapic::ServiceStub.new( - ::Google::Cloud::Vision::V1p4beta1::ProductSearch::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 - ) - - @product_search_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 - end - - ## - # Get the associated client for long-running operations. - # - # @return [::Google::Cloud::Vision::V1p4beta1::ProductSearch::Operations] - # - attr_reader :operations_client - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @product_search_stub.logger - end - - # Service calls - - ## - # Creates and returns a new ProductSet resource. - # - # Possible errors: - # - # * Returns INVALID_ARGUMENT if display_name is missing, or is longer than - # 4096 characters. - # - # @overload create_product_set(request, options = nil) - # Pass arguments to `create_product_set` via a request object, either of type - # {::Google::Cloud::Vision::V1p4beta1::CreateProductSetRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Vision::V1p4beta1::CreateProductSetRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_product_set(parent: nil, product_set: nil, product_set_id: nil) - # Pass arguments to `create_product_set` via keyword arguments. Note that at - # least one keyword argument is 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 in which the ProductSet should be created. - # - # Format is `projects/PROJECT_ID/locations/LOC_ID`. - # @param product_set [::Google::Cloud::Vision::V1p4beta1::ProductSet, ::Hash] - # Required. The ProductSet to create. - # @param product_set_id [::String] - # A user-supplied resource id for this ProductSet. If set, the server will - # attempt to use this value as the resource id. If it is already in use, an - # error is returned with code ALREADY_EXISTS. Must be at most 128 characters - # long. It cannot contain the character `/`. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Vision::V1p4beta1::ProductSet] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Vision::V1p4beta1::ProductSet] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/vision/v1p4beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Vision::V1p4beta1::ProductSearch::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Vision::V1p4beta1::CreateProductSetRequest.new - # - # # Call the create_product_set method. - # result = client.create_product_set request - # - # # The returned object is of type Google::Cloud::Vision::V1p4beta1::ProductSet. - # p result - # - def create_product_set request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Vision::V1p4beta1::CreateProductSetRequest - - # Converts hash 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_product_set.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::Vision::V1p4beta1::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_product_set.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_product_set.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @product_search_stub.call_rpc :create_product_set, 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 ProductSets in an unspecified order. - # - # Possible errors: - # - # * Returns INVALID_ARGUMENT if page_size is greater than 100, or less - # than 1. - # - # @overload list_product_sets(request, options = nil) - # Pass arguments to `list_product_sets` via a request object, either of type - # {::Google::Cloud::Vision::V1p4beta1::ListProductSetsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Vision::V1p4beta1::ListProductSetsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_product_sets(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_product_sets` via keyword arguments. Note that at - # least one keyword argument is 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 from which ProductSets should be listed. - # - # Format is `projects/PROJECT_ID/locations/LOC_ID`. - # @param page_size [::Integer] - # The maximum number of items to return. Default 10, maximum 100. - # @param page_token [::String] - # The next_page_token returned from a previous List request, if any. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Vision::V1p4beta1::ProductSet>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::Vision::V1p4beta1::ProductSet>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/vision/v1p4beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Vision::V1p4beta1::ProductSearch::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Vision::V1p4beta1::ListProductSetsRequest.new - # - # # Call the list_product_sets method. - # result = client.list_product_sets 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::Vision::V1p4beta1::ProductSet. - # p item - # end - # - def list_product_sets request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Vision::V1p4beta1::ListProductSetsRequest - - # Converts hash 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_product_sets.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::Vision::V1p4beta1::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_product_sets.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_product_sets.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @product_search_stub.call_rpc :list_product_sets, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @product_search_stub, :list_product_sets, 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 - - ## - # Gets information associated with a ProductSet. - # - # Possible errors: - # - # * Returns NOT_FOUND if the ProductSet does not exist. - # - # @overload get_product_set(request, options = nil) - # Pass arguments to `get_product_set` via a request object, either of type - # {::Google::Cloud::Vision::V1p4beta1::GetProductSetRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Vision::V1p4beta1::GetProductSetRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_product_set(name: nil) - # Pass arguments to `get_product_set` via keyword arguments. Note that at - # least one keyword argument is 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. Resource name of the ProductSet to get. - # - # Format is: - # `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID` - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Vision::V1p4beta1::ProductSet] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Vision::V1p4beta1::ProductSet] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/vision/v1p4beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Vision::V1p4beta1::ProductSearch::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Vision::V1p4beta1::GetProductSetRequest.new - # - # # Call the get_product_set method. - # result = client.get_product_set request - # - # # The returned object is of type Google::Cloud::Vision::V1p4beta1::ProductSet. - # p result - # - def get_product_set request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Vision::V1p4beta1::GetProductSetRequest - - # Converts hash 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_product_set.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::Vision::V1p4beta1::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_product_set.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_product_set.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @product_search_stub.call_rpc :get_product_set, 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 - - ## - # Makes changes to a ProductSet resource. - # Only display_name can be updated currently. - # - # Possible errors: - # - # * Returns NOT_FOUND if the ProductSet does not exist. - # * Returns INVALID_ARGUMENT if display_name is present in update_mask but - # missing from the request or longer than 4096 characters. - # - # @overload update_product_set(request, options = nil) - # Pass arguments to `update_product_set` via a request object, either of type - # {::Google::Cloud::Vision::V1p4beta1::UpdateProductSetRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Vision::V1p4beta1::UpdateProductSetRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_product_set(product_set: nil, update_mask: nil) - # Pass arguments to `update_product_set` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param product_set [::Google::Cloud::Vision::V1p4beta1::ProductSet, ::Hash] - # Required. The ProductSet resource which replaces the one on the server. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # The {::Google::Protobuf::FieldMask FieldMask} that specifies which fields to - # update. - # If update_mask isn't specified, all mutable fields are to be updated. - # Valid mask path is `display_name`. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Vision::V1p4beta1::ProductSet] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Vision::V1p4beta1::ProductSet] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/vision/v1p4beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Vision::V1p4beta1::ProductSearch::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Vision::V1p4beta1::UpdateProductSetRequest.new - # - # # Call the update_product_set method. - # result = client.update_product_set request - # - # # The returned object is of type Google::Cloud::Vision::V1p4beta1::ProductSet. - # p result - # - def update_product_set request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Vision::V1p4beta1::UpdateProductSetRequest - - # Converts hash 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_product_set.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::Vision::V1p4beta1::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.product_set&.name - header_params["product_set.name"] = request.product_set.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_product_set.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_product_set.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @product_search_stub.call_rpc :update_product_set, 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 a ProductSet. Products and ReferenceImages in the - # ProductSet are not deleted. - # - # The actual image files are not deleted from Google Cloud Storage. - # - # @overload delete_product_set(request, options = nil) - # Pass arguments to `delete_product_set` via a request object, either of type - # {::Google::Cloud::Vision::V1p4beta1::DeleteProductSetRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Vision::V1p4beta1::DeleteProductSetRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_product_set(name: nil) - # Pass arguments to `delete_product_set` via keyword arguments. Note that at - # least one keyword argument is 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. Resource name of the ProductSet to delete. - # - # Format is: - # `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID` - # - # @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/vision/v1p4beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Vision::V1p4beta1::ProductSearch::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Vision::V1p4beta1::DeleteProductSetRequest.new - # - # # Call the delete_product_set method. - # result = client.delete_product_set request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_product_set request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Vision::V1p4beta1::DeleteProductSetRequest - - # Converts hash 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_product_set.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::Vision::V1p4beta1::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_product_set.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_product_set.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @product_search_stub.call_rpc :delete_product_set, 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 and returns a new product resource. - # - # Possible errors: - # - # * Returns INVALID_ARGUMENT if display_name is missing or longer than 4096 - # characters. - # * Returns INVALID_ARGUMENT if description is longer than 4096 characters. - # * Returns INVALID_ARGUMENT if product_category is missing or invalid. - # - # @overload create_product(request, options = nil) - # Pass arguments to `create_product` via a request object, either of type - # {::Google::Cloud::Vision::V1p4beta1::CreateProductRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Vision::V1p4beta1::CreateProductRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_product(parent: nil, product: nil, product_id: nil) - # Pass arguments to `create_product` via keyword arguments. Note that at - # least one keyword argument is 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 in which the Product should be created. - # - # Format is - # `projects/PROJECT_ID/locations/LOC_ID`. - # @param product [::Google::Cloud::Vision::V1p4beta1::Product, ::Hash] - # Required. The product to create. - # @param product_id [::String] - # A user-supplied resource id for this Product. If set, the server will - # attempt to use this value as the resource id. If it is already in use, an - # error is returned with code ALREADY_EXISTS. Must be at most 128 characters - # long. It cannot contain the character `/`. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Vision::V1p4beta1::Product] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Vision::V1p4beta1::Product] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/vision/v1p4beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Vision::V1p4beta1::ProductSearch::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Vision::V1p4beta1::CreateProductRequest.new - # - # # Call the create_product method. - # result = client.create_product request - # - # # The returned object is of type Google::Cloud::Vision::V1p4beta1::Product. - # p result - # - def create_product request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Vision::V1p4beta1::CreateProductRequest - - # Converts hash 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_product.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::Vision::V1p4beta1::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_product.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_product.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @product_search_stub.call_rpc :create_product, 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 products in an unspecified order. - # - # Possible errors: - # - # * Returns INVALID_ARGUMENT if page_size is greater than 100 or less than 1. - # - # @overload list_products(request, options = nil) - # Pass arguments to `list_products` via a request object, either of type - # {::Google::Cloud::Vision::V1p4beta1::ListProductsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Vision::V1p4beta1::ListProductsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_products(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_products` via keyword arguments. Note that at - # least one keyword argument is 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 OR ProductSet from which Products should be listed. - # - # Format: - # `projects/PROJECT_ID/locations/LOC_ID` - # @param page_size [::Integer] - # The maximum number of items to return. Default 10, maximum 100. - # @param page_token [::String] - # The next_page_token returned from a previous List request, if any. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Vision::V1p4beta1::Product>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::Vision::V1p4beta1::Product>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/vision/v1p4beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Vision::V1p4beta1::ProductSearch::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Vision::V1p4beta1::ListProductsRequest.new - # - # # Call the list_products method. - # result = client.list_products 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::Vision::V1p4beta1::Product. - # p item - # end - # - def list_products request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Vision::V1p4beta1::ListProductsRequest - - # Converts hash 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_products.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::Vision::V1p4beta1::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_products.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_products.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @product_search_stub.call_rpc :list_products, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @product_search_stub, :list_products, 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 - - ## - # Gets information associated with a Product. - # - # Possible errors: - # - # * Returns NOT_FOUND if the Product does not exist. - # - # @overload get_product(request, options = nil) - # Pass arguments to `get_product` via a request object, either of type - # {::Google::Cloud::Vision::V1p4beta1::GetProductRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Vision::V1p4beta1::GetProductRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_product(name: nil) - # Pass arguments to `get_product` via keyword arguments. Note that at - # least one keyword argument is 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. Resource name of the Product to get. - # - # Format is: - # `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID` - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Vision::V1p4beta1::Product] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Vision::V1p4beta1::Product] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/vision/v1p4beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Vision::V1p4beta1::ProductSearch::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Vision::V1p4beta1::GetProductRequest.new - # - # # Call the get_product method. - # result = client.get_product request - # - # # The returned object is of type Google::Cloud::Vision::V1p4beta1::Product. - # p result - # - def get_product request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Vision::V1p4beta1::GetProductRequest - - # Converts hash 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_product.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::Vision::V1p4beta1::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_product.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_product.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @product_search_stub.call_rpc :get_product, 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 - - ## - # Makes changes to a Product resource. - # Only the `display_name`, `description`, and `labels` fields can be updated - # right now. - # - # If labels are updated, the change will not be reflected in queries until - # the next index time. - # - # Possible errors: - # - # * Returns NOT_FOUND if the Product does not exist. - # * Returns INVALID_ARGUMENT if display_name is present in update_mask but is - # missing from the request or longer than 4096 characters. - # * Returns INVALID_ARGUMENT if description is present in update_mask but is - # longer than 4096 characters. - # * Returns INVALID_ARGUMENT if product_category is present in update_mask. - # - # @overload update_product(request, options = nil) - # Pass arguments to `update_product` via a request object, either of type - # {::Google::Cloud::Vision::V1p4beta1::UpdateProductRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Vision::V1p4beta1::UpdateProductRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_product(product: nil, update_mask: nil) - # Pass arguments to `update_product` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param product [::Google::Cloud::Vision::V1p4beta1::Product, ::Hash] - # Required. The Product resource which replaces the one on the server. - # product.name is immutable. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # The {::Google::Protobuf::FieldMask FieldMask} that specifies which fields - # to update. - # If update_mask isn't specified, all mutable fields are to be updated. - # Valid mask paths include `product_labels`, `display_name`, and - # `description`. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Vision::V1p4beta1::Product] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Vision::V1p4beta1::Product] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/vision/v1p4beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Vision::V1p4beta1::ProductSearch::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Vision::V1p4beta1::UpdateProductRequest.new - # - # # Call the update_product method. - # result = client.update_product request - # - # # The returned object is of type Google::Cloud::Vision::V1p4beta1::Product. - # p result - # - def update_product request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Vision::V1p4beta1::UpdateProductRequest - - # Converts hash 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_product.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::Vision::V1p4beta1::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.product&.name - header_params["product.name"] = request.product.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_product.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_product.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @product_search_stub.call_rpc :update_product, 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 a product and its reference images. - # - # Metadata of the product and all its images will be deleted right away, but - # search queries against ProductSets containing the product may still work - # until all related caches are refreshed. - # - # @overload delete_product(request, options = nil) - # Pass arguments to `delete_product` via a request object, either of type - # {::Google::Cloud::Vision::V1p4beta1::DeleteProductRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Vision::V1p4beta1::DeleteProductRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_product(name: nil) - # Pass arguments to `delete_product` via keyword arguments. Note that at - # least one keyword argument is 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. Resource name of product to delete. - # - # Format is: - # `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID` - # - # @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/vision/v1p4beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Vision::V1p4beta1::ProductSearch::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Vision::V1p4beta1::DeleteProductRequest.new - # - # # Call the delete_product method. - # result = client.delete_product request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_product request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Vision::V1p4beta1::DeleteProductRequest - - # Converts hash 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_product.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::Vision::V1p4beta1::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_product.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_product.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @product_search_stub.call_rpc :delete_product, 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 and returns a new ReferenceImage resource. - # - # The `bounding_poly` field is optional. If `bounding_poly` is not specified, - # the system will try to detect regions of interest in the image that are - # compatible with the product_category on the parent product. If it is - # specified, detection is ALWAYS skipped. The system converts polygons into - # non-rotated rectangles. - # - # Note that the pipeline will resize the image if the image resolution is too - # large to process (above 50MP). - # - # Possible errors: - # - # * Returns INVALID_ARGUMENT if the image_uri is missing or longer than 4096 - # characters. - # * Returns INVALID_ARGUMENT if the product does not exist. - # * Returns INVALID_ARGUMENT if bounding_poly is not provided, and nothing - # compatible with the parent product's product_category is detected. - # * Returns INVALID_ARGUMENT if bounding_poly contains more than 10 polygons. - # - # @overload create_reference_image(request, options = nil) - # Pass arguments to `create_reference_image` via a request object, either of type - # {::Google::Cloud::Vision::V1p4beta1::CreateReferenceImageRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Vision::V1p4beta1::CreateReferenceImageRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_reference_image(parent: nil, reference_image: nil, reference_image_id: nil) - # Pass arguments to `create_reference_image` via keyword arguments. Note that at - # least one keyword argument is 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. Resource name of the product in which to create the reference - # image. - # - # Format is - # `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`. - # @param reference_image [::Google::Cloud::Vision::V1p4beta1::ReferenceImage, ::Hash] - # Required. The reference image to create. - # If an image ID is specified, it is ignored. - # @param reference_image_id [::String] - # A user-supplied resource id for the ReferenceImage to be added. If set, - # the server will attempt to use this value as the resource id. If it is - # already in use, an error is returned with code ALREADY_EXISTS. Must be at - # most 128 characters long. It cannot contain the character `/`. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Vision::V1p4beta1::ReferenceImage] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Vision::V1p4beta1::ReferenceImage] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/vision/v1p4beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Vision::V1p4beta1::ProductSearch::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Vision::V1p4beta1::CreateReferenceImageRequest.new - # - # # Call the create_reference_image method. - # result = client.create_reference_image request - # - # # The returned object is of type Google::Cloud::Vision::V1p4beta1::ReferenceImage. - # p result - # - def create_reference_image request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Vision::V1p4beta1::CreateReferenceImageRequest - - # Converts hash 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_reference_image.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::Vision::V1p4beta1::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_reference_image.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_reference_image.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @product_search_stub.call_rpc :create_reference_image, 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 a reference image. - # - # The image metadata will be deleted right away, but search queries - # against ProductSets containing the image may still work until all related - # caches are refreshed. - # - # The actual image files are not deleted from Google Cloud Storage. - # - # @overload delete_reference_image(request, options = nil) - # Pass arguments to `delete_reference_image` via a request object, either of type - # {::Google::Cloud::Vision::V1p4beta1::DeleteReferenceImageRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Vision::V1p4beta1::DeleteReferenceImageRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_reference_image(name: nil) - # Pass arguments to `delete_reference_image` via keyword arguments. Note that at - # least one keyword argument is 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 reference image to delete. - # - # Format is: - # - # `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID` - # - # @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/vision/v1p4beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Vision::V1p4beta1::ProductSearch::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Vision::V1p4beta1::DeleteReferenceImageRequest.new - # - # # Call the delete_reference_image method. - # result = client.delete_reference_image request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_reference_image request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Vision::V1p4beta1::DeleteReferenceImageRequest - - # Converts hash 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_reference_image.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::Vision::V1p4beta1::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_reference_image.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_reference_image.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @product_search_stub.call_rpc :delete_reference_image, 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 reference images. - # - # Possible errors: - # - # * Returns NOT_FOUND if the parent product does not exist. - # * Returns INVALID_ARGUMENT if the page_size is greater than 100, or less - # than 1. - # - # @overload list_reference_images(request, options = nil) - # Pass arguments to `list_reference_images` via a request object, either of type - # {::Google::Cloud::Vision::V1p4beta1::ListReferenceImagesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Vision::V1p4beta1::ListReferenceImagesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_reference_images(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_reference_images` via keyword arguments. Note that at - # least one keyword argument is 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. Resource name of the product containing the reference images. - # - # Format is - # `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`. - # @param page_size [::Integer] - # The maximum number of items to return. Default 10, maximum 100. - # @param page_token [::String] - # A token identifying a page of results to be returned. This is the value - # of `nextPageToken` returned in a previous reference image list request. - # - # Defaults to the first page if not specified. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Vision::V1p4beta1::ReferenceImage>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::Vision::V1p4beta1::ReferenceImage>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/vision/v1p4beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Vision::V1p4beta1::ProductSearch::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Vision::V1p4beta1::ListReferenceImagesRequest.new - # - # # Call the list_reference_images method. - # result = client.list_reference_images 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::Vision::V1p4beta1::ReferenceImage. - # p item - # end - # - def list_reference_images request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Vision::V1p4beta1::ListReferenceImagesRequest - - # Converts hash 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_reference_images.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::Vision::V1p4beta1::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_reference_images.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_reference_images.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @product_search_stub.call_rpc :list_reference_images, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @product_search_stub, :list_reference_images, 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 - - ## - # Gets information associated with a ReferenceImage. - # - # Possible errors: - # - # * Returns NOT_FOUND if the specified image does not exist. - # - # @overload get_reference_image(request, options = nil) - # Pass arguments to `get_reference_image` via a request object, either of type - # {::Google::Cloud::Vision::V1p4beta1::GetReferenceImageRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Vision::V1p4beta1::GetReferenceImageRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_reference_image(name: nil) - # Pass arguments to `get_reference_image` via keyword arguments. Note that at - # least one keyword argument is 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 ReferenceImage to get. - # - # Format is: - # - # `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID`. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Vision::V1p4beta1::ReferenceImage] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Vision::V1p4beta1::ReferenceImage] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/vision/v1p4beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Vision::V1p4beta1::ProductSearch::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Vision::V1p4beta1::GetReferenceImageRequest.new - # - # # Call the get_reference_image method. - # result = client.get_reference_image request - # - # # The returned object is of type Google::Cloud::Vision::V1p4beta1::ReferenceImage. - # p result - # - def get_reference_image request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Vision::V1p4beta1::GetReferenceImageRequest - - # Converts hash 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_reference_image.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::Vision::V1p4beta1::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_reference_image.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_reference_image.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @product_search_stub.call_rpc :get_reference_image, 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 - - ## - # Adds a Product to the specified ProductSet. If the Product is already - # present, no change is made. - # - # One Product can be added to at most 100 ProductSets. - # - # Possible errors: - # - # * Returns NOT_FOUND if the Product or the ProductSet doesn't exist. - # - # @overload add_product_to_product_set(request, options = nil) - # Pass arguments to `add_product_to_product_set` via a request object, either of type - # {::Google::Cloud::Vision::V1p4beta1::AddProductToProductSetRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Vision::V1p4beta1::AddProductToProductSetRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload add_product_to_product_set(name: nil, product: nil) - # Pass arguments to `add_product_to_product_set` via keyword arguments. Note that at - # least one keyword argument is 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 for the ProductSet to modify. - # - # Format is: - # `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID` - # @param product [::String] - # Required. The resource name for the Product to be added to this ProductSet. - # - # Format is: - # `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID` - # - # @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/vision/v1p4beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Vision::V1p4beta1::ProductSearch::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Vision::V1p4beta1::AddProductToProductSetRequest.new - # - # # Call the add_product_to_product_set method. - # result = client.add_product_to_product_set request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def add_product_to_product_set request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Vision::V1p4beta1::AddProductToProductSetRequest - - # Converts hash 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.add_product_to_product_set.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::Vision::V1p4beta1::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.add_product_to_product_set.timeout, - metadata: metadata, - retry_policy: @config.rpcs.add_product_to_product_set.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @product_search_stub.call_rpc :add_product_to_product_set, 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 - - ## - # Removes a Product from the specified ProductSet. - # - # @overload remove_product_from_product_set(request, options = nil) - # Pass arguments to `remove_product_from_product_set` via a request object, either of type - # {::Google::Cloud::Vision::V1p4beta1::RemoveProductFromProductSetRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Vision::V1p4beta1::RemoveProductFromProductSetRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload remove_product_from_product_set(name: nil, product: nil) - # Pass arguments to `remove_product_from_product_set` via keyword arguments. Note that at - # least one keyword argument is 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 for the ProductSet to modify. - # - # Format is: - # `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID` - # @param product [::String] - # Required. The resource name for the Product to be removed from this - # ProductSet. - # - # Format is: - # `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID` - # - # @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/vision/v1p4beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Vision::V1p4beta1::ProductSearch::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Vision::V1p4beta1::RemoveProductFromProductSetRequest.new - # - # # Call the remove_product_from_product_set method. - # result = client.remove_product_from_product_set request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def remove_product_from_product_set request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Vision::V1p4beta1::RemoveProductFromProductSetRequest - - # Converts hash 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.remove_product_from_product_set.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::Vision::V1p4beta1::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.remove_product_from_product_set.timeout, - metadata: metadata, - retry_policy: @config.rpcs.remove_product_from_product_set.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @product_search_stub.call_rpc :remove_product_from_product_set, 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 the Products in a ProductSet, in an unspecified order. If the - # ProductSet does not exist, the products field of the response will be - # empty. - # - # Possible errors: - # - # * Returns INVALID_ARGUMENT if page_size is greater than 100 or less than 1. - # - # @overload list_products_in_product_set(request, options = nil) - # Pass arguments to `list_products_in_product_set` via a request object, either of type - # {::Google::Cloud::Vision::V1p4beta1::ListProductsInProductSetRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Vision::V1p4beta1::ListProductsInProductSetRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_products_in_product_set(name: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_products_in_product_set` via keyword arguments. Note that at - # least one keyword argument is 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 ProductSet resource for which to retrieve Products. - # - # Format is: - # `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID` - # @param page_size [::Integer] - # The maximum number of items to return. Default 10, maximum 100. - # @param page_token [::String] - # The next_page_token returned from a previous List request, if any. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Vision::V1p4beta1::Product>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::Vision::V1p4beta1::Product>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/vision/v1p4beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Vision::V1p4beta1::ProductSearch::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Vision::V1p4beta1::ListProductsInProductSetRequest.new - # - # # Call the list_products_in_product_set method. - # result = client.list_products_in_product_set 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::Vision::V1p4beta1::Product. - # p item - # end - # - def list_products_in_product_set request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Vision::V1p4beta1::ListProductsInProductSetRequest - - # Converts hash 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_products_in_product_set.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::Vision::V1p4beta1::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_products_in_product_set.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_products_in_product_set.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @product_search_stub.call_rpc :list_products_in_product_set, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @product_search_stub, :list_products_in_product_set, 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 - - ## - # Asynchronous API that imports a list of reference images to specified - # product sets based on a list of image information. - # - # The {::Google::Longrunning::Operation google.longrunning.Operation} API can be - # used to keep track of the progress and results of the request. - # `Operation.metadata` contains `BatchOperationMetadata`. (progress) - # `Operation.response` contains `ImportProductSetsResponse`. (results) - # - # The input source of this method is a csv file on Google Cloud Storage. - # For the format of the csv file please see - # {::Google::Cloud::Vision::V1p4beta1::ImportProductSetsGcsSource#csv_file_uri ImportProductSetsGcsSource.csv_file_uri}. - # - # @overload import_product_sets(request, options = nil) - # Pass arguments to `import_product_sets` via a request object, either of type - # {::Google::Cloud::Vision::V1p4beta1::ImportProductSetsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Vision::V1p4beta1::ImportProductSetsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_product_sets(parent: nil, input_config: nil) - # Pass arguments to `import_product_sets` via keyword arguments. Note that at - # least one keyword argument is 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 in which the ProductSets should be imported. - # - # Format is `projects/PROJECT_ID/locations/LOC_ID`. - # @param input_config [::Google::Cloud::Vision::V1p4beta1::ImportProductSetsInputConfig, ::Hash] - # Required. The input content for the list of requests. - # - # @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/vision/v1p4beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Vision::V1p4beta1::ProductSearch::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Vision::V1p4beta1::ImportProductSetsRequest.new - # - # # Call the import_product_sets method. - # result = client.import_product_sets 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 import_product_sets request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Vision::V1p4beta1::ImportProductSetsRequest - - # Converts hash 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_product_sets.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::Vision::V1p4beta1::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_product_sets.timeout, - metadata: metadata, - retry_policy: @config.rpcs.import_product_sets.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @product_search_stub.call_rpc :import_product_sets, 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 - - ## - # Asynchronous API to delete all Products in a ProductSet or all Products - # that are in no ProductSet. - # - # If a Product is a member of the specified ProductSet in addition to other - # ProductSets, the Product will still be deleted. - # - # It is recommended to not delete the specified ProductSet until after this - # operation has completed. It is also recommended to not add any of the - # Products involved in the batch delete to a new ProductSet while this - # operation is running because those Products may still end up deleted. - # - # It's not possible to undo the PurgeProducts operation. Therefore, it is - # recommended to keep the csv files used in ImportProductSets (if that was - # how you originally built the Product Set) before starting PurgeProducts, in - # case you need to re-import the data after deletion. - # - # If the plan is to purge all of the Products from a ProductSet and then - # re-use the empty ProductSet to re-import new Products into the empty - # ProductSet, you must wait until the PurgeProducts operation has finished - # for that ProductSet. - # - # The {::Google::Longrunning::Operation google.longrunning.Operation} API can be - # used to keep track of the progress and results of the request. - # `Operation.metadata` contains `BatchOperationMetadata`. (progress) - # - # @overload purge_products(request, options = nil) - # Pass arguments to `purge_products` via a request object, either of type - # {::Google::Cloud::Vision::V1p4beta1::PurgeProductsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Vision::V1p4beta1::PurgeProductsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload purge_products(product_set_purge_config: nil, delete_orphan_products: nil, parent: nil, force: nil) - # Pass arguments to `purge_products` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param product_set_purge_config [::Google::Cloud::Vision::V1p4beta1::ProductSetPurgeConfig, ::Hash] - # Specify which ProductSet contains the Products to be deleted. - # - # Note: The following parameters are mutually exclusive: `product_set_purge_config`, `delete_orphan_products`. 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 delete_orphan_products [::Boolean] - # If delete_orphan_products is true, all Products that are not in any - # ProductSet will be deleted. - # - # Note: The following parameters are mutually exclusive: `delete_orphan_products`, `product_set_purge_config`. 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 parent [::String] - # Required. The project and location in which the Products should be deleted. - # - # Format is `projects/PROJECT_ID/locations/LOC_ID`. - # @param force [::Boolean] - # The default value is false. Override this value to true to actually perform - # the purge. - # - # @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/vision/v1p4beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Vision::V1p4beta1::ProductSearch::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Vision::V1p4beta1::PurgeProductsRequest.new - # - # # Call the purge_products method. - # result = client.purge_products 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 purge_products request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Vision::V1p4beta1::PurgeProductsRequest - - # Converts hash 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.purge_products.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::Vision::V1p4beta1::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.purge_products.timeout, - metadata: metadata, - retry_policy: @config.rpcs.purge_products.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @product_search_stub.call_rpc :purge_products, 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 ProductSearch API. - # - # This class represents the configuration for ProductSearch, - # 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::Vision::V1p4beta1::ProductSearch::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_product_set to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Vision::V1p4beta1::ProductSearch::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.create_product_set.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Vision::V1p4beta1::ProductSearch::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.create_product_set.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::Vision::V1p4beta1::ProductSearch::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 = "vision.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 ProductSearch 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_product_set` - # @return [::Gapic::Config::Method] - # - attr_reader :create_product_set - ## - # RPC-specific configuration for `list_product_sets` - # @return [::Gapic::Config::Method] - # - attr_reader :list_product_sets - ## - # RPC-specific configuration for `get_product_set` - # @return [::Gapic::Config::Method] - # - attr_reader :get_product_set - ## - # RPC-specific configuration for `update_product_set` - # @return [::Gapic::Config::Method] - # - attr_reader :update_product_set - ## - # RPC-specific configuration for `delete_product_set` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_product_set - ## - # RPC-specific configuration for `create_product` - # @return [::Gapic::Config::Method] - # - attr_reader :create_product - ## - # RPC-specific configuration for `list_products` - # @return [::Gapic::Config::Method] - # - attr_reader :list_products - ## - # RPC-specific configuration for `get_product` - # @return [::Gapic::Config::Method] - # - attr_reader :get_product - ## - # RPC-specific configuration for `update_product` - # @return [::Gapic::Config::Method] - # - attr_reader :update_product - ## - # RPC-specific configuration for `delete_product` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_product - ## - # RPC-specific configuration for `create_reference_image` - # @return [::Gapic::Config::Method] - # - attr_reader :create_reference_image - ## - # RPC-specific configuration for `delete_reference_image` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_reference_image - ## - # RPC-specific configuration for `list_reference_images` - # @return [::Gapic::Config::Method] - # - attr_reader :list_reference_images - ## - # RPC-specific configuration for `get_reference_image` - # @return [::Gapic::Config::Method] - # - attr_reader :get_reference_image - ## - # RPC-specific configuration for `add_product_to_product_set` - # @return [::Gapic::Config::Method] - # - attr_reader :add_product_to_product_set - ## - # RPC-specific configuration for `remove_product_from_product_set` - # @return [::Gapic::Config::Method] - # - attr_reader :remove_product_from_product_set - ## - # RPC-specific configuration for `list_products_in_product_set` - # @return [::Gapic::Config::Method] - # - attr_reader :list_products_in_product_set - ## - # RPC-specific configuration for `import_product_sets` - # @return [::Gapic::Config::Method] - # - attr_reader :import_product_sets - ## - # RPC-specific configuration for `purge_products` - # @return [::Gapic::Config::Method] - # - attr_reader :purge_products - - # @private - def initialize parent_rpcs = nil - create_product_set_config = parent_rpcs.create_product_set if parent_rpcs.respond_to? :create_product_set - @create_product_set = ::Gapic::Config::Method.new create_product_set_config - list_product_sets_config = parent_rpcs.list_product_sets if parent_rpcs.respond_to? :list_product_sets - @list_product_sets = ::Gapic::Config::Method.new list_product_sets_config - get_product_set_config = parent_rpcs.get_product_set if parent_rpcs.respond_to? :get_product_set - @get_product_set = ::Gapic::Config::Method.new get_product_set_config - update_product_set_config = parent_rpcs.update_product_set if parent_rpcs.respond_to? :update_product_set - @update_product_set = ::Gapic::Config::Method.new update_product_set_config - delete_product_set_config = parent_rpcs.delete_product_set if parent_rpcs.respond_to? :delete_product_set - @delete_product_set = ::Gapic::Config::Method.new delete_product_set_config - create_product_config = parent_rpcs.create_product if parent_rpcs.respond_to? :create_product - @create_product = ::Gapic::Config::Method.new create_product_config - list_products_config = parent_rpcs.list_products if parent_rpcs.respond_to? :list_products - @list_products = ::Gapic::Config::Method.new list_products_config - get_product_config = parent_rpcs.get_product if parent_rpcs.respond_to? :get_product - @get_product = ::Gapic::Config::Method.new get_product_config - update_product_config = parent_rpcs.update_product if parent_rpcs.respond_to? :update_product - @update_product = ::Gapic::Config::Method.new update_product_config - delete_product_config = parent_rpcs.delete_product if parent_rpcs.respond_to? :delete_product - @delete_product = ::Gapic::Config::Method.new delete_product_config - create_reference_image_config = parent_rpcs.create_reference_image if parent_rpcs.respond_to? :create_reference_image - @create_reference_image = ::Gapic::Config::Method.new create_reference_image_config - delete_reference_image_config = parent_rpcs.delete_reference_image if parent_rpcs.respond_to? :delete_reference_image - @delete_reference_image = ::Gapic::Config::Method.new delete_reference_image_config - list_reference_images_config = parent_rpcs.list_reference_images if parent_rpcs.respond_to? :list_reference_images - @list_reference_images = ::Gapic::Config::Method.new list_reference_images_config - get_reference_image_config = parent_rpcs.get_reference_image if parent_rpcs.respond_to? :get_reference_image - @get_reference_image = ::Gapic::Config::Method.new get_reference_image_config - add_product_to_product_set_config = parent_rpcs.add_product_to_product_set if parent_rpcs.respond_to? :add_product_to_product_set - @add_product_to_product_set = ::Gapic::Config::Method.new add_product_to_product_set_config - remove_product_from_product_set_config = parent_rpcs.remove_product_from_product_set if parent_rpcs.respond_to? :remove_product_from_product_set - @remove_product_from_product_set = ::Gapic::Config::Method.new remove_product_from_product_set_config - list_products_in_product_set_config = parent_rpcs.list_products_in_product_set if parent_rpcs.respond_to? :list_products_in_product_set - @list_products_in_product_set = ::Gapic::Config::Method.new list_products_in_product_set_config - import_product_sets_config = parent_rpcs.import_product_sets if parent_rpcs.respond_to? :import_product_sets - @import_product_sets = ::Gapic::Config::Method.new import_product_sets_config - purge_products_config = parent_rpcs.purge_products if parent_rpcs.respond_to? :purge_products - @purge_products = ::Gapic::Config::Method.new purge_products_config - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1/product_search/credentials.rb b/owl-bot-staging/google-cloud-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1/product_search/credentials.rb deleted file mode 100644 index c5f696af4315..000000000000 --- a/owl-bot-staging/google-cloud-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1/product_search/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 Vision - module V1p4beta1 - module ProductSearch - # Credentials for the ProductSearch API. - class Credentials < ::Google::Auth::Credentials - self.scope = [ - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/cloud-vision" - ] - self.env_vars = [ - "VISION_CREDENTIALS", - "VISION_KEYFILE", - "GOOGLE_CLOUD_CREDENTIALS", - "GOOGLE_CLOUD_KEYFILE", - "GCLOUD_KEYFILE", - "VISION_CREDENTIALS_JSON", - "VISION_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-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1/product_search/operations.rb b/owl-bot-staging/google-cloud-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1/product_search/operations.rb deleted file mode 100644 index 41322f7e33b1..000000000000 --- a/owl-bot-staging/google-cloud-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1/product_search/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 Vision - module V1p4beta1 - module ProductSearch - # Service that implements Longrunning Operations API. - class Operations - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "vision.$UNIVERSE_DOMAIN$" - - # @private - attr_reader :operations_stub - - ## - # Configuration for the ProductSearch 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 ProductSearch 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::Vision::V1p4beta1::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::Vision::V1p4beta1::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::Vision::V1p4beta1::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::Vision::V1p4beta1::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::Vision::V1p4beta1::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 = "vision.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-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1/product_search/paths.rb b/owl-bot-staging/google-cloud-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1/product_search/paths.rb deleted file mode 100644 index a4e5df23a7cf..000000000000 --- a/owl-bot-staging/google-cloud-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1/product_search/paths.rb +++ /dev/null @@ -1,109 +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 Vision - module V1p4beta1 - module ProductSearch - # Path helper methods for the ProductSearch 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 Product resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/products/{product}` - # - # @param project [String] - # @param location [String] - # @param product [String] - # - # @return [::String] - def product_path project:, location:, product: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/products/#{product}" - end - - ## - # Create a fully-qualified ProductSet resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/productSets/{product_set}` - # - # @param project [String] - # @param location [String] - # @param product_set [String] - # - # @return [::String] - def product_set_path project:, location:, product_set: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/productSets/#{product_set}" - end - - ## - # Create a fully-qualified ReferenceImage resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/products/{product}/referenceImages/{reference_image}` - # - # @param project [String] - # @param location [String] - # @param product [String] - # @param reference_image [String] - # - # @return [::String] - def reference_image_path project:, location:, product:, reference_image: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "product cannot contain /" if product.to_s.include? "/" - - "projects/#{project}/locations/#{location}/products/#{product}/referenceImages/#{reference_image}" - end - - extend self - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1/product_search/rest.rb b/owl-bot-staging/google-cloud-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1/product_search/rest.rb deleted file mode 100644 index 8a761f864824..000000000000 --- a/owl-bot-staging/google-cloud-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1/product_search/rest.rb +++ /dev/null @@ -1,70 +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/vision/v1p4beta1/version" - -require "google/cloud/vision/v1p4beta1/product_search/credentials" -require "google/cloud/vision/v1p4beta1/product_search/paths" -require "google/cloud/vision/v1p4beta1/product_search/rest/operations" -require "google/cloud/vision/v1p4beta1/product_search/rest/client" - -module Google - module Cloud - module Vision - module V1p4beta1 - ## - # Manages Products and ProductSets of reference images for use in product - # search. It uses the following resource model: - # - # - The API has a collection of - # {::Google::Cloud::Vision::V1p4beta1::ProductSet ProductSet} resources, named - # `projects/*/locations/*/productSets/*`, which acts as a way to put different - # products into groups to limit identification. - # - # In parallel, - # - # - The API has a collection of - # {::Google::Cloud::Vision::V1p4beta1::Product Product} resources, named - # `projects/*/locations/*/products/*` - # - # - Each {::Google::Cloud::Vision::V1p4beta1::Product Product} has a collection of - # {::Google::Cloud::Vision::V1p4beta1::ReferenceImage ReferenceImage} resources, - # named - # `projects/*/locations/*/products/*/referenceImages/*` - # - # To load this service and instantiate a REST client: - # - # require "google/cloud/vision/v1p4beta1/product_search/rest" - # client = ::Google::Cloud::Vision::V1p4beta1::ProductSearch::Rest::Client.new - # - module ProductSearch - # Client for the REST transport - module Rest - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "rest", "helpers.rb" -require "google/cloud/vision/v1p4beta1/product_search/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1/product_search/rest/client.rb b/owl-bot-staging/google-cloud-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1/product_search/rest/client.rb deleted file mode 100644 index 4b56ab73e1da..000000000000 --- a/owl-bot-staging/google-cloud-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1/product_search/rest/client.rb +++ /dev/null @@ -1,2382 +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/vision/v1p4beta1/product_search_service_pb" -require "google/cloud/vision/v1p4beta1/product_search/rest/service_stub" - -module Google - module Cloud - module Vision - module V1p4beta1 - module ProductSearch - module Rest - ## - # REST client for the ProductSearch service. - # - # Manages Products and ProductSets of reference images for use in product - # search. It uses the following resource model: - # - # - The API has a collection of - # {::Google::Cloud::Vision::V1p4beta1::ProductSet ProductSet} resources, named - # `projects/*/locations/*/productSets/*`, which acts as a way to put different - # products into groups to limit identification. - # - # In parallel, - # - # - The API has a collection of - # {::Google::Cloud::Vision::V1p4beta1::Product Product} resources, named - # `projects/*/locations/*/products/*` - # - # - Each {::Google::Cloud::Vision::V1p4beta1::Product Product} has a collection of - # {::Google::Cloud::Vision::V1p4beta1::ReferenceImage ReferenceImage} resources, - # named - # `projects/*/locations/*/products/*/referenceImages/*` - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "vision.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :product_search_stub - - ## - # Configure the ProductSearch Client class. - # - # See {::Google::Cloud::Vision::V1p4beta1::ProductSearch::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all ProductSearch clients - # ::Google::Cloud::Vision::V1p4beta1::ProductSearch::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", "Vision", "V1p4beta1"] - 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_product_set.timeout = 600.0 - default_config.rpcs.create_product_set.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [] - } - - default_config.rpcs.list_product_sets.timeout = 600.0 - default_config.rpcs.list_product_sets.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.get_product_set.timeout = 600.0 - default_config.rpcs.get_product_set.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.update_product_set.timeout = 600.0 - default_config.rpcs.update_product_set.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [] - } - - default_config.rpcs.delete_product_set.timeout = 600.0 - default_config.rpcs.delete_product_set.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.create_product.timeout = 600.0 - default_config.rpcs.create_product.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [] - } - - default_config.rpcs.list_products.timeout = 600.0 - default_config.rpcs.list_products.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.get_product.timeout = 600.0 - default_config.rpcs.get_product.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.update_product.timeout = 600.0 - default_config.rpcs.update_product.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [] - } - - default_config.rpcs.delete_product.timeout = 600.0 - default_config.rpcs.delete_product.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.create_reference_image.timeout = 600.0 - default_config.rpcs.create_reference_image.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [] - } - - default_config.rpcs.delete_reference_image.timeout = 600.0 - default_config.rpcs.delete_reference_image.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.list_reference_images.timeout = 600.0 - default_config.rpcs.list_reference_images.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.get_reference_image.timeout = 600.0 - default_config.rpcs.get_reference_image.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.add_product_to_product_set.timeout = 600.0 - default_config.rpcs.add_product_to_product_set.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [] - } - - default_config.rpcs.remove_product_from_product_set.timeout = 600.0 - default_config.rpcs.remove_product_from_product_set.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [] - } - - default_config.rpcs.list_products_in_product_set.timeout = 600.0 - default_config.rpcs.list_products_in_product_set.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.import_product_sets.timeout = 600.0 - default_config.rpcs.import_product_sets.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [] - } - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the ProductSearch 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::Vision::V1p4beta1::ProductSearch::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 - @product_search_stub.universe_domain - end - - ## - # Create a new ProductSearch REST client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Vision::V1p4beta1::ProductSearch::Rest::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Vision::V1p4beta1::ProductSearch::Rest::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the ProductSearch 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::Vision::V1p4beta1::ProductSearch::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 - - @product_search_stub = ::Google::Cloud::Vision::V1p4beta1::ProductSearch::Rest::ServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials, - logger: @config.logger - ) - - @product_search_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 - end - - ## - # Get the associated client for long-running operations. - # - # @return [::Google::Cloud::Vision::V1p4beta1::ProductSearch::Rest::Operations] - # - attr_reader :operations_client - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @product_search_stub.logger - end - - # Service calls - - ## - # Creates and returns a new ProductSet resource. - # - # Possible errors: - # - # * Returns INVALID_ARGUMENT if display_name is missing, or is longer than - # 4096 characters. - # - # @overload create_product_set(request, options = nil) - # Pass arguments to `create_product_set` via a request object, either of type - # {::Google::Cloud::Vision::V1p4beta1::CreateProductSetRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Vision::V1p4beta1::CreateProductSetRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_product_set(parent: nil, product_set: nil, product_set_id: nil) - # Pass arguments to `create_product_set` via keyword arguments. Note that at - # least one keyword argument is 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 in which the ProductSet should be created. - # - # Format is `projects/PROJECT_ID/locations/LOC_ID`. - # @param product_set [::Google::Cloud::Vision::V1p4beta1::ProductSet, ::Hash] - # Required. The ProductSet to create. - # @param product_set_id [::String] - # A user-supplied resource id for this ProductSet. If set, the server will - # attempt to use this value as the resource id. If it is already in use, an - # error is returned with code ALREADY_EXISTS. Must be at most 128 characters - # long. It cannot contain the character `/`. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Vision::V1p4beta1::ProductSet] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Vision::V1p4beta1::ProductSet] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/vision/v1p4beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Vision::V1p4beta1::ProductSearch::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Vision::V1p4beta1::CreateProductSetRequest.new - # - # # Call the create_product_set method. - # result = client.create_product_set request - # - # # The returned object is of type Google::Cloud::Vision::V1p4beta1::ProductSet. - # p result - # - def create_product_set request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Vision::V1p4beta1::CreateProductSetRequest - - # Converts hash 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_product_set.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::Vision::V1p4beta1::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_product_set.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_product_set.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @product_search_stub.create_product_set 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 ProductSets in an unspecified order. - # - # Possible errors: - # - # * Returns INVALID_ARGUMENT if page_size is greater than 100, or less - # than 1. - # - # @overload list_product_sets(request, options = nil) - # Pass arguments to `list_product_sets` via a request object, either of type - # {::Google::Cloud::Vision::V1p4beta1::ListProductSetsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Vision::V1p4beta1::ListProductSetsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_product_sets(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_product_sets` via keyword arguments. Note that at - # least one keyword argument is 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 from which ProductSets should be listed. - # - # Format is `projects/PROJECT_ID/locations/LOC_ID`. - # @param page_size [::Integer] - # The maximum number of items to return. Default 10, maximum 100. - # @param page_token [::String] - # The next_page_token returned from a previous List request, if any. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Vision::V1p4beta1::ProductSet>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Vision::V1p4beta1::ProductSet>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/vision/v1p4beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Vision::V1p4beta1::ProductSearch::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Vision::V1p4beta1::ListProductSetsRequest.new - # - # # Call the list_product_sets method. - # result = client.list_product_sets 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::Vision::V1p4beta1::ProductSet. - # p item - # end - # - def list_product_sets request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Vision::V1p4beta1::ListProductSetsRequest - - # Converts hash 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_product_sets.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::Vision::V1p4beta1::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_product_sets.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_product_sets.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @product_search_stub.list_product_sets request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @product_search_stub, :list_product_sets, "product_sets", 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 information associated with a ProductSet. - # - # Possible errors: - # - # * Returns NOT_FOUND if the ProductSet does not exist. - # - # @overload get_product_set(request, options = nil) - # Pass arguments to `get_product_set` via a request object, either of type - # {::Google::Cloud::Vision::V1p4beta1::GetProductSetRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Vision::V1p4beta1::GetProductSetRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_product_set(name: nil) - # Pass arguments to `get_product_set` via keyword arguments. Note that at - # least one keyword argument is 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. Resource name of the ProductSet to get. - # - # Format is: - # `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID` - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Vision::V1p4beta1::ProductSet] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Vision::V1p4beta1::ProductSet] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/vision/v1p4beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Vision::V1p4beta1::ProductSearch::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Vision::V1p4beta1::GetProductSetRequest.new - # - # # Call the get_product_set method. - # result = client.get_product_set request - # - # # The returned object is of type Google::Cloud::Vision::V1p4beta1::ProductSet. - # p result - # - def get_product_set request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Vision::V1p4beta1::GetProductSetRequest - - # Converts hash 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_product_set.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::Vision::V1p4beta1::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_product_set.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_product_set.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @product_search_stub.get_product_set 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 - - ## - # Makes changes to a ProductSet resource. - # Only display_name can be updated currently. - # - # Possible errors: - # - # * Returns NOT_FOUND if the ProductSet does not exist. - # * Returns INVALID_ARGUMENT if display_name is present in update_mask but - # missing from the request or longer than 4096 characters. - # - # @overload update_product_set(request, options = nil) - # Pass arguments to `update_product_set` via a request object, either of type - # {::Google::Cloud::Vision::V1p4beta1::UpdateProductSetRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Vision::V1p4beta1::UpdateProductSetRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_product_set(product_set: nil, update_mask: nil) - # Pass arguments to `update_product_set` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param product_set [::Google::Cloud::Vision::V1p4beta1::ProductSet, ::Hash] - # Required. The ProductSet resource which replaces the one on the server. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # The {::Google::Protobuf::FieldMask FieldMask} that specifies which fields to - # update. - # If update_mask isn't specified, all mutable fields are to be updated. - # Valid mask path is `display_name`. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Vision::V1p4beta1::ProductSet] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Vision::V1p4beta1::ProductSet] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/vision/v1p4beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Vision::V1p4beta1::ProductSearch::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Vision::V1p4beta1::UpdateProductSetRequest.new - # - # # Call the update_product_set method. - # result = client.update_product_set request - # - # # The returned object is of type Google::Cloud::Vision::V1p4beta1::ProductSet. - # p result - # - def update_product_set request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Vision::V1p4beta1::UpdateProductSetRequest - - # Converts hash 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_product_set.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::Vision::V1p4beta1::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_product_set.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_product_set.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @product_search_stub.update_product_set 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 a ProductSet. Products and ReferenceImages in the - # ProductSet are not deleted. - # - # The actual image files are not deleted from Google Cloud Storage. - # - # @overload delete_product_set(request, options = nil) - # Pass arguments to `delete_product_set` via a request object, either of type - # {::Google::Cloud::Vision::V1p4beta1::DeleteProductSetRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Vision::V1p4beta1::DeleteProductSetRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_product_set(name: nil) - # Pass arguments to `delete_product_set` via keyword arguments. Note that at - # least one keyword argument is 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. Resource name of the ProductSet to delete. - # - # Format is: - # `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID` - # @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/vision/v1p4beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Vision::V1p4beta1::ProductSearch::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Vision::V1p4beta1::DeleteProductSetRequest.new - # - # # Call the delete_product_set method. - # result = client.delete_product_set request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_product_set request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Vision::V1p4beta1::DeleteProductSetRequest - - # Converts hash 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_product_set.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::Vision::V1p4beta1::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_product_set.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_product_set.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @product_search_stub.delete_product_set 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 and returns a new product resource. - # - # Possible errors: - # - # * Returns INVALID_ARGUMENT if display_name is missing or longer than 4096 - # characters. - # * Returns INVALID_ARGUMENT if description is longer than 4096 characters. - # * Returns INVALID_ARGUMENT if product_category is missing or invalid. - # - # @overload create_product(request, options = nil) - # Pass arguments to `create_product` via a request object, either of type - # {::Google::Cloud::Vision::V1p4beta1::CreateProductRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Vision::V1p4beta1::CreateProductRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_product(parent: nil, product: nil, product_id: nil) - # Pass arguments to `create_product` via keyword arguments. Note that at - # least one keyword argument is 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 in which the Product should be created. - # - # Format is - # `projects/PROJECT_ID/locations/LOC_ID`. - # @param product [::Google::Cloud::Vision::V1p4beta1::Product, ::Hash] - # Required. The product to create. - # @param product_id [::String] - # A user-supplied resource id for this Product. If set, the server will - # attempt to use this value as the resource id. If it is already in use, an - # error is returned with code ALREADY_EXISTS. Must be at most 128 characters - # long. It cannot contain the character `/`. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Vision::V1p4beta1::Product] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Vision::V1p4beta1::Product] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/vision/v1p4beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Vision::V1p4beta1::ProductSearch::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Vision::V1p4beta1::CreateProductRequest.new - # - # # Call the create_product method. - # result = client.create_product request - # - # # The returned object is of type Google::Cloud::Vision::V1p4beta1::Product. - # p result - # - def create_product request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Vision::V1p4beta1::CreateProductRequest - - # Converts hash 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_product.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::Vision::V1p4beta1::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_product.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_product.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @product_search_stub.create_product 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 products in an unspecified order. - # - # Possible errors: - # - # * Returns INVALID_ARGUMENT if page_size is greater than 100 or less than 1. - # - # @overload list_products(request, options = nil) - # Pass arguments to `list_products` via a request object, either of type - # {::Google::Cloud::Vision::V1p4beta1::ListProductsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Vision::V1p4beta1::ListProductsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_products(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_products` via keyword arguments. Note that at - # least one keyword argument is 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 OR ProductSet from which Products should be listed. - # - # Format: - # `projects/PROJECT_ID/locations/LOC_ID` - # @param page_size [::Integer] - # The maximum number of items to return. Default 10, maximum 100. - # @param page_token [::String] - # The next_page_token returned from a previous List request, if any. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Vision::V1p4beta1::Product>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Vision::V1p4beta1::Product>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/vision/v1p4beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Vision::V1p4beta1::ProductSearch::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Vision::V1p4beta1::ListProductsRequest.new - # - # # Call the list_products method. - # result = client.list_products 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::Vision::V1p4beta1::Product. - # p item - # end - # - def list_products request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Vision::V1p4beta1::ListProductsRequest - - # Converts hash 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_products.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::Vision::V1p4beta1::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_products.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_products.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @product_search_stub.list_products request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @product_search_stub, :list_products, "products", 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 information associated with a Product. - # - # Possible errors: - # - # * Returns NOT_FOUND if the Product does not exist. - # - # @overload get_product(request, options = nil) - # Pass arguments to `get_product` via a request object, either of type - # {::Google::Cloud::Vision::V1p4beta1::GetProductRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Vision::V1p4beta1::GetProductRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_product(name: nil) - # Pass arguments to `get_product` via keyword arguments. Note that at - # least one keyword argument is 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. Resource name of the Product to get. - # - # Format is: - # `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID` - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Vision::V1p4beta1::Product] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Vision::V1p4beta1::Product] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/vision/v1p4beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Vision::V1p4beta1::ProductSearch::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Vision::V1p4beta1::GetProductRequest.new - # - # # Call the get_product method. - # result = client.get_product request - # - # # The returned object is of type Google::Cloud::Vision::V1p4beta1::Product. - # p result - # - def get_product request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Vision::V1p4beta1::GetProductRequest - - # Converts hash 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_product.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::Vision::V1p4beta1::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_product.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_product.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @product_search_stub.get_product 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 - - ## - # Makes changes to a Product resource. - # Only the `display_name`, `description`, and `labels` fields can be updated - # right now. - # - # If labels are updated, the change will not be reflected in queries until - # the next index time. - # - # Possible errors: - # - # * Returns NOT_FOUND if the Product does not exist. - # * Returns INVALID_ARGUMENT if display_name is present in update_mask but is - # missing from the request or longer than 4096 characters. - # * Returns INVALID_ARGUMENT if description is present in update_mask but is - # longer than 4096 characters. - # * Returns INVALID_ARGUMENT if product_category is present in update_mask. - # - # @overload update_product(request, options = nil) - # Pass arguments to `update_product` via a request object, either of type - # {::Google::Cloud::Vision::V1p4beta1::UpdateProductRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Vision::V1p4beta1::UpdateProductRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_product(product: nil, update_mask: nil) - # Pass arguments to `update_product` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param product [::Google::Cloud::Vision::V1p4beta1::Product, ::Hash] - # Required. The Product resource which replaces the one on the server. - # product.name is immutable. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # The {::Google::Protobuf::FieldMask FieldMask} that specifies which fields - # to update. - # If update_mask isn't specified, all mutable fields are to be updated. - # Valid mask paths include `product_labels`, `display_name`, and - # `description`. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Vision::V1p4beta1::Product] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Vision::V1p4beta1::Product] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/vision/v1p4beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Vision::V1p4beta1::ProductSearch::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Vision::V1p4beta1::UpdateProductRequest.new - # - # # Call the update_product method. - # result = client.update_product request - # - # # The returned object is of type Google::Cloud::Vision::V1p4beta1::Product. - # p result - # - def update_product request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Vision::V1p4beta1::UpdateProductRequest - - # Converts hash 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_product.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::Vision::V1p4beta1::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_product.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_product.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @product_search_stub.update_product 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 a product and its reference images. - # - # Metadata of the product and all its images will be deleted right away, but - # search queries against ProductSets containing the product may still work - # until all related caches are refreshed. - # - # @overload delete_product(request, options = nil) - # Pass arguments to `delete_product` via a request object, either of type - # {::Google::Cloud::Vision::V1p4beta1::DeleteProductRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Vision::V1p4beta1::DeleteProductRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_product(name: nil) - # Pass arguments to `delete_product` via keyword arguments. Note that at - # least one keyword argument is 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. Resource name of product to delete. - # - # Format is: - # `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID` - # @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/vision/v1p4beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Vision::V1p4beta1::ProductSearch::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Vision::V1p4beta1::DeleteProductRequest.new - # - # # Call the delete_product method. - # result = client.delete_product request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_product request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Vision::V1p4beta1::DeleteProductRequest - - # Converts hash 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_product.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::Vision::V1p4beta1::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_product.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_product.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @product_search_stub.delete_product 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 and returns a new ReferenceImage resource. - # - # The `bounding_poly` field is optional. If `bounding_poly` is not specified, - # the system will try to detect regions of interest in the image that are - # compatible with the product_category on the parent product. If it is - # specified, detection is ALWAYS skipped. The system converts polygons into - # non-rotated rectangles. - # - # Note that the pipeline will resize the image if the image resolution is too - # large to process (above 50MP). - # - # Possible errors: - # - # * Returns INVALID_ARGUMENT if the image_uri is missing or longer than 4096 - # characters. - # * Returns INVALID_ARGUMENT if the product does not exist. - # * Returns INVALID_ARGUMENT if bounding_poly is not provided, and nothing - # compatible with the parent product's product_category is detected. - # * Returns INVALID_ARGUMENT if bounding_poly contains more than 10 polygons. - # - # @overload create_reference_image(request, options = nil) - # Pass arguments to `create_reference_image` via a request object, either of type - # {::Google::Cloud::Vision::V1p4beta1::CreateReferenceImageRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Vision::V1p4beta1::CreateReferenceImageRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_reference_image(parent: nil, reference_image: nil, reference_image_id: nil) - # Pass arguments to `create_reference_image` via keyword arguments. Note that at - # least one keyword argument is 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. Resource name of the product in which to create the reference - # image. - # - # Format is - # `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`. - # @param reference_image [::Google::Cloud::Vision::V1p4beta1::ReferenceImage, ::Hash] - # Required. The reference image to create. - # If an image ID is specified, it is ignored. - # @param reference_image_id [::String] - # A user-supplied resource id for the ReferenceImage to be added. If set, - # the server will attempt to use this value as the resource id. If it is - # already in use, an error is returned with code ALREADY_EXISTS. Must be at - # most 128 characters long. It cannot contain the character `/`. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Vision::V1p4beta1::ReferenceImage] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Vision::V1p4beta1::ReferenceImage] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/vision/v1p4beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Vision::V1p4beta1::ProductSearch::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Vision::V1p4beta1::CreateReferenceImageRequest.new - # - # # Call the create_reference_image method. - # result = client.create_reference_image request - # - # # The returned object is of type Google::Cloud::Vision::V1p4beta1::ReferenceImage. - # p result - # - def create_reference_image request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Vision::V1p4beta1::CreateReferenceImageRequest - - # Converts hash 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_reference_image.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::Vision::V1p4beta1::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_reference_image.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_reference_image.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @product_search_stub.create_reference_image 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 a reference image. - # - # The image metadata will be deleted right away, but search queries - # against ProductSets containing the image may still work until all related - # caches are refreshed. - # - # The actual image files are not deleted from Google Cloud Storage. - # - # @overload delete_reference_image(request, options = nil) - # Pass arguments to `delete_reference_image` via a request object, either of type - # {::Google::Cloud::Vision::V1p4beta1::DeleteReferenceImageRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Vision::V1p4beta1::DeleteReferenceImageRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_reference_image(name: nil) - # Pass arguments to `delete_reference_image` via keyword arguments. Note that at - # least one keyword argument is 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 reference image to delete. - # - # Format is: - # - # `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID` - # @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/vision/v1p4beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Vision::V1p4beta1::ProductSearch::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Vision::V1p4beta1::DeleteReferenceImageRequest.new - # - # # Call the delete_reference_image method. - # result = client.delete_reference_image request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_reference_image request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Vision::V1p4beta1::DeleteReferenceImageRequest - - # Converts hash 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_reference_image.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::Vision::V1p4beta1::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_reference_image.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_reference_image.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @product_search_stub.delete_reference_image 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 reference images. - # - # Possible errors: - # - # * Returns NOT_FOUND if the parent product does not exist. - # * Returns INVALID_ARGUMENT if the page_size is greater than 100, or less - # than 1. - # - # @overload list_reference_images(request, options = nil) - # Pass arguments to `list_reference_images` via a request object, either of type - # {::Google::Cloud::Vision::V1p4beta1::ListReferenceImagesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Vision::V1p4beta1::ListReferenceImagesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_reference_images(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_reference_images` via keyword arguments. Note that at - # least one keyword argument is 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. Resource name of the product containing the reference images. - # - # Format is - # `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`. - # @param page_size [::Integer] - # The maximum number of items to return. Default 10, maximum 100. - # @param page_token [::String] - # A token identifying a page of results to be returned. This is the value - # of `nextPageToken` returned in a previous reference image list request. - # - # Defaults to the first page if not specified. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Vision::V1p4beta1::ReferenceImage>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Vision::V1p4beta1::ReferenceImage>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/vision/v1p4beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Vision::V1p4beta1::ProductSearch::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Vision::V1p4beta1::ListReferenceImagesRequest.new - # - # # Call the list_reference_images method. - # result = client.list_reference_images 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::Vision::V1p4beta1::ReferenceImage. - # p item - # end - # - def list_reference_images request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Vision::V1p4beta1::ListReferenceImagesRequest - - # Converts hash 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_reference_images.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::Vision::V1p4beta1::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_reference_images.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_reference_images.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @product_search_stub.list_reference_images request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @product_search_stub, :list_reference_images, "reference_images", 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 information associated with a ReferenceImage. - # - # Possible errors: - # - # * Returns NOT_FOUND if the specified image does not exist. - # - # @overload get_reference_image(request, options = nil) - # Pass arguments to `get_reference_image` via a request object, either of type - # {::Google::Cloud::Vision::V1p4beta1::GetReferenceImageRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Vision::V1p4beta1::GetReferenceImageRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_reference_image(name: nil) - # Pass arguments to `get_reference_image` via keyword arguments. Note that at - # least one keyword argument is 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 ReferenceImage to get. - # - # Format is: - # - # `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID`. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Vision::V1p4beta1::ReferenceImage] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Vision::V1p4beta1::ReferenceImage] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/vision/v1p4beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Vision::V1p4beta1::ProductSearch::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Vision::V1p4beta1::GetReferenceImageRequest.new - # - # # Call the get_reference_image method. - # result = client.get_reference_image request - # - # # The returned object is of type Google::Cloud::Vision::V1p4beta1::ReferenceImage. - # p result - # - def get_reference_image request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Vision::V1p4beta1::GetReferenceImageRequest - - # Converts hash 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_reference_image.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::Vision::V1p4beta1::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_reference_image.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_reference_image.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @product_search_stub.get_reference_image 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 - - ## - # Adds a Product to the specified ProductSet. If the Product is already - # present, no change is made. - # - # One Product can be added to at most 100 ProductSets. - # - # Possible errors: - # - # * Returns NOT_FOUND if the Product or the ProductSet doesn't exist. - # - # @overload add_product_to_product_set(request, options = nil) - # Pass arguments to `add_product_to_product_set` via a request object, either of type - # {::Google::Cloud::Vision::V1p4beta1::AddProductToProductSetRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Vision::V1p4beta1::AddProductToProductSetRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload add_product_to_product_set(name: nil, product: nil) - # Pass arguments to `add_product_to_product_set` via keyword arguments. Note that at - # least one keyword argument is 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 for the ProductSet to modify. - # - # Format is: - # `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID` - # @param product [::String] - # Required. The resource name for the Product to be added to this ProductSet. - # - # Format is: - # `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID` - # @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/vision/v1p4beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Vision::V1p4beta1::ProductSearch::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Vision::V1p4beta1::AddProductToProductSetRequest.new - # - # # Call the add_product_to_product_set method. - # result = client.add_product_to_product_set request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def add_product_to_product_set request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Vision::V1p4beta1::AddProductToProductSetRequest - - # Converts hash 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.add_product_to_product_set.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::Vision::V1p4beta1::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.add_product_to_product_set.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.add_product_to_product_set.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @product_search_stub.add_product_to_product_set 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 - - ## - # Removes a Product from the specified ProductSet. - # - # @overload remove_product_from_product_set(request, options = nil) - # Pass arguments to `remove_product_from_product_set` via a request object, either of type - # {::Google::Cloud::Vision::V1p4beta1::RemoveProductFromProductSetRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Vision::V1p4beta1::RemoveProductFromProductSetRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload remove_product_from_product_set(name: nil, product: nil) - # Pass arguments to `remove_product_from_product_set` via keyword arguments. Note that at - # least one keyword argument is 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 for the ProductSet to modify. - # - # Format is: - # `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID` - # @param product [::String] - # Required. The resource name for the Product to be removed from this - # ProductSet. - # - # Format is: - # `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID` - # @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/vision/v1p4beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Vision::V1p4beta1::ProductSearch::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Vision::V1p4beta1::RemoveProductFromProductSetRequest.new - # - # # Call the remove_product_from_product_set method. - # result = client.remove_product_from_product_set request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def remove_product_from_product_set request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Vision::V1p4beta1::RemoveProductFromProductSetRequest - - # Converts hash 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.remove_product_from_product_set.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::Vision::V1p4beta1::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.remove_product_from_product_set.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.remove_product_from_product_set.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @product_search_stub.remove_product_from_product_set 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 the Products in a ProductSet, in an unspecified order. If the - # ProductSet does not exist, the products field of the response will be - # empty. - # - # Possible errors: - # - # * Returns INVALID_ARGUMENT if page_size is greater than 100 or less than 1. - # - # @overload list_products_in_product_set(request, options = nil) - # Pass arguments to `list_products_in_product_set` via a request object, either of type - # {::Google::Cloud::Vision::V1p4beta1::ListProductsInProductSetRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Vision::V1p4beta1::ListProductsInProductSetRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_products_in_product_set(name: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_products_in_product_set` via keyword arguments. Note that at - # least one keyword argument is 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 ProductSet resource for which to retrieve Products. - # - # Format is: - # `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID` - # @param page_size [::Integer] - # The maximum number of items to return. Default 10, maximum 100. - # @param page_token [::String] - # The next_page_token returned from a previous List request, if any. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Vision::V1p4beta1::Product>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Vision::V1p4beta1::Product>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/vision/v1p4beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Vision::V1p4beta1::ProductSearch::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Vision::V1p4beta1::ListProductsInProductSetRequest.new - # - # # Call the list_products_in_product_set method. - # result = client.list_products_in_product_set 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::Vision::V1p4beta1::Product. - # p item - # end - # - def list_products_in_product_set request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Vision::V1p4beta1::ListProductsInProductSetRequest - - # Converts hash 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_products_in_product_set.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::Vision::V1p4beta1::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_products_in_product_set.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_products_in_product_set.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @product_search_stub.list_products_in_product_set request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @product_search_stub, :list_products_in_product_set, "products", 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 - - ## - # Asynchronous API that imports a list of reference images to specified - # product sets based on a list of image information. - # - # The {::Google::Longrunning::Operation google.longrunning.Operation} API can be - # used to keep track of the progress and results of the request. - # `Operation.metadata` contains `BatchOperationMetadata`. (progress) - # `Operation.response` contains `ImportProductSetsResponse`. (results) - # - # The input source of this method is a csv file on Google Cloud Storage. - # For the format of the csv file please see - # {::Google::Cloud::Vision::V1p4beta1::ImportProductSetsGcsSource#csv_file_uri ImportProductSetsGcsSource.csv_file_uri}. - # - # @overload import_product_sets(request, options = nil) - # Pass arguments to `import_product_sets` via a request object, either of type - # {::Google::Cloud::Vision::V1p4beta1::ImportProductSetsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Vision::V1p4beta1::ImportProductSetsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_product_sets(parent: nil, input_config: nil) - # Pass arguments to `import_product_sets` via keyword arguments. Note that at - # least one keyword argument is 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 in which the ProductSets should be imported. - # - # Format is `projects/PROJECT_ID/locations/LOC_ID`. - # @param input_config [::Google::Cloud::Vision::V1p4beta1::ImportProductSetsInputConfig, ::Hash] - # Required. The input content for the list of requests. - # @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/vision/v1p4beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Vision::V1p4beta1::ProductSearch::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Vision::V1p4beta1::ImportProductSetsRequest.new - # - # # Call the import_product_sets method. - # result = client.import_product_sets 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 import_product_sets request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Vision::V1p4beta1::ImportProductSetsRequest - - # Converts hash 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_product_sets.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::Vision::V1p4beta1::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_product_sets.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.import_product_sets.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @product_search_stub.import_product_sets 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 - - ## - # Asynchronous API to delete all Products in a ProductSet or all Products - # that are in no ProductSet. - # - # If a Product is a member of the specified ProductSet in addition to other - # ProductSets, the Product will still be deleted. - # - # It is recommended to not delete the specified ProductSet until after this - # operation has completed. It is also recommended to not add any of the - # Products involved in the batch delete to a new ProductSet while this - # operation is running because those Products may still end up deleted. - # - # It's not possible to undo the PurgeProducts operation. Therefore, it is - # recommended to keep the csv files used in ImportProductSets (if that was - # how you originally built the Product Set) before starting PurgeProducts, in - # case you need to re-import the data after deletion. - # - # If the plan is to purge all of the Products from a ProductSet and then - # re-use the empty ProductSet to re-import new Products into the empty - # ProductSet, you must wait until the PurgeProducts operation has finished - # for that ProductSet. - # - # The {::Google::Longrunning::Operation google.longrunning.Operation} API can be - # used to keep track of the progress and results of the request. - # `Operation.metadata` contains `BatchOperationMetadata`. (progress) - # - # @overload purge_products(request, options = nil) - # Pass arguments to `purge_products` via a request object, either of type - # {::Google::Cloud::Vision::V1p4beta1::PurgeProductsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Vision::V1p4beta1::PurgeProductsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload purge_products(product_set_purge_config: nil, delete_orphan_products: nil, parent: nil, force: nil) - # Pass arguments to `purge_products` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param product_set_purge_config [::Google::Cloud::Vision::V1p4beta1::ProductSetPurgeConfig, ::Hash] - # Specify which ProductSet contains the Products to be deleted. - # - # Note: The following parameters are mutually exclusive: `product_set_purge_config`, `delete_orphan_products`. 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 delete_orphan_products [::Boolean] - # If delete_orphan_products is true, all Products that are not in any - # ProductSet will be deleted. - # - # Note: The following parameters are mutually exclusive: `delete_orphan_products`, `product_set_purge_config`. 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 parent [::String] - # Required. The project and location in which the Products should be deleted. - # - # Format is `projects/PROJECT_ID/locations/LOC_ID`. - # @param force [::Boolean] - # The default value is false. Override this value to true to actually perform - # the purge. - # @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/vision/v1p4beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Vision::V1p4beta1::ProductSearch::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Vision::V1p4beta1::PurgeProductsRequest.new - # - # # Call the purge_products method. - # result = client.purge_products 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 purge_products request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Vision::V1p4beta1::PurgeProductsRequest - - # Converts hash 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.purge_products.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::Vision::V1p4beta1::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.purge_products.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.purge_products.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @product_search_stub.purge_products 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 - - ## - # Configuration class for the ProductSearch REST API. - # - # This class represents the configuration for ProductSearch 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::Vision::V1p4beta1::ProductSearch::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_product_set to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Vision::V1p4beta1::ProductSearch::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.create_product_set.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Vision::V1p4beta1::ProductSearch::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.create_product_set.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 = "vision.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 ProductSearch 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_product_set` - # @return [::Gapic::Config::Method] - # - attr_reader :create_product_set - ## - # RPC-specific configuration for `list_product_sets` - # @return [::Gapic::Config::Method] - # - attr_reader :list_product_sets - ## - # RPC-specific configuration for `get_product_set` - # @return [::Gapic::Config::Method] - # - attr_reader :get_product_set - ## - # RPC-specific configuration for `update_product_set` - # @return [::Gapic::Config::Method] - # - attr_reader :update_product_set - ## - # RPC-specific configuration for `delete_product_set` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_product_set - ## - # RPC-specific configuration for `create_product` - # @return [::Gapic::Config::Method] - # - attr_reader :create_product - ## - # RPC-specific configuration for `list_products` - # @return [::Gapic::Config::Method] - # - attr_reader :list_products - ## - # RPC-specific configuration for `get_product` - # @return [::Gapic::Config::Method] - # - attr_reader :get_product - ## - # RPC-specific configuration for `update_product` - # @return [::Gapic::Config::Method] - # - attr_reader :update_product - ## - # RPC-specific configuration for `delete_product` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_product - ## - # RPC-specific configuration for `create_reference_image` - # @return [::Gapic::Config::Method] - # - attr_reader :create_reference_image - ## - # RPC-specific configuration for `delete_reference_image` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_reference_image - ## - # RPC-specific configuration for `list_reference_images` - # @return [::Gapic::Config::Method] - # - attr_reader :list_reference_images - ## - # RPC-specific configuration for `get_reference_image` - # @return [::Gapic::Config::Method] - # - attr_reader :get_reference_image - ## - # RPC-specific configuration for `add_product_to_product_set` - # @return [::Gapic::Config::Method] - # - attr_reader :add_product_to_product_set - ## - # RPC-specific configuration for `remove_product_from_product_set` - # @return [::Gapic::Config::Method] - # - attr_reader :remove_product_from_product_set - ## - # RPC-specific configuration for `list_products_in_product_set` - # @return [::Gapic::Config::Method] - # - attr_reader :list_products_in_product_set - ## - # RPC-specific configuration for `import_product_sets` - # @return [::Gapic::Config::Method] - # - attr_reader :import_product_sets - ## - # RPC-specific configuration for `purge_products` - # @return [::Gapic::Config::Method] - # - attr_reader :purge_products - - # @private - def initialize parent_rpcs = nil - create_product_set_config = parent_rpcs.create_product_set if parent_rpcs.respond_to? :create_product_set - @create_product_set = ::Gapic::Config::Method.new create_product_set_config - list_product_sets_config = parent_rpcs.list_product_sets if parent_rpcs.respond_to? :list_product_sets - @list_product_sets = ::Gapic::Config::Method.new list_product_sets_config - get_product_set_config = parent_rpcs.get_product_set if parent_rpcs.respond_to? :get_product_set - @get_product_set = ::Gapic::Config::Method.new get_product_set_config - update_product_set_config = parent_rpcs.update_product_set if parent_rpcs.respond_to? :update_product_set - @update_product_set = ::Gapic::Config::Method.new update_product_set_config - delete_product_set_config = parent_rpcs.delete_product_set if parent_rpcs.respond_to? :delete_product_set - @delete_product_set = ::Gapic::Config::Method.new delete_product_set_config - create_product_config = parent_rpcs.create_product if parent_rpcs.respond_to? :create_product - @create_product = ::Gapic::Config::Method.new create_product_config - list_products_config = parent_rpcs.list_products if parent_rpcs.respond_to? :list_products - @list_products = ::Gapic::Config::Method.new list_products_config - get_product_config = parent_rpcs.get_product if parent_rpcs.respond_to? :get_product - @get_product = ::Gapic::Config::Method.new get_product_config - update_product_config = parent_rpcs.update_product if parent_rpcs.respond_to? :update_product - @update_product = ::Gapic::Config::Method.new update_product_config - delete_product_config = parent_rpcs.delete_product if parent_rpcs.respond_to? :delete_product - @delete_product = ::Gapic::Config::Method.new delete_product_config - create_reference_image_config = parent_rpcs.create_reference_image if parent_rpcs.respond_to? :create_reference_image - @create_reference_image = ::Gapic::Config::Method.new create_reference_image_config - delete_reference_image_config = parent_rpcs.delete_reference_image if parent_rpcs.respond_to? :delete_reference_image - @delete_reference_image = ::Gapic::Config::Method.new delete_reference_image_config - list_reference_images_config = parent_rpcs.list_reference_images if parent_rpcs.respond_to? :list_reference_images - @list_reference_images = ::Gapic::Config::Method.new list_reference_images_config - get_reference_image_config = parent_rpcs.get_reference_image if parent_rpcs.respond_to? :get_reference_image - @get_reference_image = ::Gapic::Config::Method.new get_reference_image_config - add_product_to_product_set_config = parent_rpcs.add_product_to_product_set if parent_rpcs.respond_to? :add_product_to_product_set - @add_product_to_product_set = ::Gapic::Config::Method.new add_product_to_product_set_config - remove_product_from_product_set_config = parent_rpcs.remove_product_from_product_set if parent_rpcs.respond_to? :remove_product_from_product_set - @remove_product_from_product_set = ::Gapic::Config::Method.new remove_product_from_product_set_config - list_products_in_product_set_config = parent_rpcs.list_products_in_product_set if parent_rpcs.respond_to? :list_products_in_product_set - @list_products_in_product_set = ::Gapic::Config::Method.new list_products_in_product_set_config - import_product_sets_config = parent_rpcs.import_product_sets if parent_rpcs.respond_to? :import_product_sets - @import_product_sets = ::Gapic::Config::Method.new import_product_sets_config - purge_products_config = parent_rpcs.purge_products if parent_rpcs.respond_to? :purge_products - @purge_products = ::Gapic::Config::Method.new purge_products_config - - yield self if block_given? - end - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1/product_search/rest/operations.rb b/owl-bot-staging/google-cloud-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1/product_search/rest/operations.rb deleted file mode 100644 index 7aac05d68b97..000000000000 --- a/owl-bot-staging/google-cloud-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1/product_search/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 Vision - module V1p4beta1 - module ProductSearch - module Rest - # Service that implements Longrunning Operations API. - class Operations - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "vision.$UNIVERSE_DOMAIN$" - - # @private - attr_reader :operations_stub - - ## - # Configuration for the ProductSearch 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 ProductSearch 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::Vision::V1p4beta1::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::Vision::V1p4beta1::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::Vision::V1p4beta1::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::Vision::V1p4beta1::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 = "vision.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{^operations(?:/.*)?$}, true] - ] - ) - 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-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1/product_search/rest/service_stub.rb b/owl-bot-staging/google-cloud-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1/product_search/rest/service_stub.rb deleted file mode 100644 index 7c4814833ba5..000000000000 --- a/owl-bot-staging/google-cloud-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1/product_search/rest/service_stub.rb +++ /dev/null @@ -1,1249 +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/vision/v1p4beta1/product_search_service_pb" - -module Google - module Cloud - module Vision - module V1p4beta1 - module ProductSearch - module Rest - ## - # REST service stub for the ProductSearch 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_product_set REST call - # - # @param request_pb [::Google::Cloud::Vision::V1p4beta1::CreateProductSetRequest] - # 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::Vision::V1p4beta1::ProductSet] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Vision::V1p4beta1::ProductSet] - # A result object deserialized from the server's reply - def create_product_set request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_product_set_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_product_set", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Vision::V1p4beta1::ProductSet.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_product_sets REST call - # - # @param request_pb [::Google::Cloud::Vision::V1p4beta1::ListProductSetsRequest] - # 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::Vision::V1p4beta1::ListProductSetsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Vision::V1p4beta1::ListProductSetsResponse] - # A result object deserialized from the server's reply - def list_product_sets request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_product_sets_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_product_sets", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Vision::V1p4beta1::ListProductSetsResponse.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_product_set REST call - # - # @param request_pb [::Google::Cloud::Vision::V1p4beta1::GetProductSetRequest] - # 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::Vision::V1p4beta1::ProductSet] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Vision::V1p4beta1::ProductSet] - # A result object deserialized from the server's reply - def get_product_set request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_product_set_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_product_set", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Vision::V1p4beta1::ProductSet.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_product_set REST call - # - # @param request_pb [::Google::Cloud::Vision::V1p4beta1::UpdateProductSetRequest] - # 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::Vision::V1p4beta1::ProductSet] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Vision::V1p4beta1::ProductSet] - # A result object deserialized from the server's reply - def update_product_set request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_product_set_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_product_set", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Vision::V1p4beta1::ProductSet.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_product_set REST call - # - # @param request_pb [::Google::Cloud::Vision::V1p4beta1::DeleteProductSetRequest] - # 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_product_set request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_delete_product_set_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_product_set", - 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 create_product REST call - # - # @param request_pb [::Google::Cloud::Vision::V1p4beta1::CreateProductRequest] - # 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::Vision::V1p4beta1::Product] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Vision::V1p4beta1::Product] - # A result object deserialized from the server's reply - def create_product request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_product_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_product", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Vision::V1p4beta1::Product.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_products REST call - # - # @param request_pb [::Google::Cloud::Vision::V1p4beta1::ListProductsRequest] - # 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::Vision::V1p4beta1::ListProductsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Vision::V1p4beta1::ListProductsResponse] - # A result object deserialized from the server's reply - def list_products request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_products_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_products", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Vision::V1p4beta1::ListProductsResponse.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_product REST call - # - # @param request_pb [::Google::Cloud::Vision::V1p4beta1::GetProductRequest] - # 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::Vision::V1p4beta1::Product] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Vision::V1p4beta1::Product] - # A result object deserialized from the server's reply - def get_product request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_product_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_product", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Vision::V1p4beta1::Product.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_product REST call - # - # @param request_pb [::Google::Cloud::Vision::V1p4beta1::UpdateProductRequest] - # 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::Vision::V1p4beta1::Product] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Vision::V1p4beta1::Product] - # A result object deserialized from the server's reply - def update_product request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_product_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_product", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Vision::V1p4beta1::Product.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_product REST call - # - # @param request_pb [::Google::Cloud::Vision::V1p4beta1::DeleteProductRequest] - # 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_product request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_delete_product_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_product", - 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 create_reference_image REST call - # - # @param request_pb [::Google::Cloud::Vision::V1p4beta1::CreateReferenceImageRequest] - # 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::Vision::V1p4beta1::ReferenceImage] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Vision::V1p4beta1::ReferenceImage] - # A result object deserialized from the server's reply - def create_reference_image request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_reference_image_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_reference_image", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Vision::V1p4beta1::ReferenceImage.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_reference_image REST call - # - # @param request_pb [::Google::Cloud::Vision::V1p4beta1::DeleteReferenceImageRequest] - # 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_reference_image request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_delete_reference_image_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_reference_image", - 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 list_reference_images REST call - # - # @param request_pb [::Google::Cloud::Vision::V1p4beta1::ListReferenceImagesRequest] - # 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::Vision::V1p4beta1::ListReferenceImagesResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Vision::V1p4beta1::ListReferenceImagesResponse] - # A result object deserialized from the server's reply - def list_reference_images request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_reference_images_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_reference_images", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Vision::V1p4beta1::ListReferenceImagesResponse.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_reference_image REST call - # - # @param request_pb [::Google::Cloud::Vision::V1p4beta1::GetReferenceImageRequest] - # 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::Vision::V1p4beta1::ReferenceImage] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Vision::V1p4beta1::ReferenceImage] - # A result object deserialized from the server's reply - def get_reference_image request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_reference_image_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_reference_image", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Vision::V1p4beta1::ReferenceImage.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the add_product_to_product_set REST call - # - # @param request_pb [::Google::Cloud::Vision::V1p4beta1::AddProductToProductSetRequest] - # 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 add_product_to_product_set request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_add_product_to_product_set_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: "add_product_to_product_set", - 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 remove_product_from_product_set REST call - # - # @param request_pb [::Google::Cloud::Vision::V1p4beta1::RemoveProductFromProductSetRequest] - # 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 remove_product_from_product_set request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_remove_product_from_product_set_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: "remove_product_from_product_set", - 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 list_products_in_product_set REST call - # - # @param request_pb [::Google::Cloud::Vision::V1p4beta1::ListProductsInProductSetRequest] - # 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::Vision::V1p4beta1::ListProductsInProductSetResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Vision::V1p4beta1::ListProductsInProductSetResponse] - # A result object deserialized from the server's reply - def list_products_in_product_set request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_products_in_product_set_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_products_in_product_set", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Vision::V1p4beta1::ListProductsInProductSetResponse.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_product_sets REST call - # - # @param request_pb [::Google::Cloud::Vision::V1p4beta1::ImportProductSetsRequest] - # 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 import_product_sets request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_import_product_sets_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_product_sets", - 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 purge_products REST call - # - # @param request_pb [::Google::Cloud::Vision::V1p4beta1::PurgeProductsRequest] - # 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 purge_products request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_purge_products_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: "purge_products", - 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 - - ## - # @private - # - # GRPC transcoding helper method for the create_product_set REST call - # - # @param request_pb [::Google::Cloud::Vision::V1p4beta1::CreateProductSetRequest] - # 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_product_set_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1p4beta1/{parent}/productSets", - body: "product_set", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_product_sets REST call - # - # @param request_pb [::Google::Cloud::Vision::V1p4beta1::ListProductSetsRequest] - # 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_product_sets_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1p4beta1/{parent}/productSets", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_product_set REST call - # - # @param request_pb [::Google::Cloud::Vision::V1p4beta1::GetProductSetRequest] - # 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_product_set_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1p4beta1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/productSets/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_product_set REST call - # - # @param request_pb [::Google::Cloud::Vision::V1p4beta1::UpdateProductSetRequest] - # 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_product_set_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v1p4beta1/{product_set.name}", - body: "product_set", - matches: [ - ["product_set.name", %r{^projects/[^/]+/locations/[^/]+/productSets/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_product_set REST call - # - # @param request_pb [::Google::Cloud::Vision::V1p4beta1::DeleteProductSetRequest] - # 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_product_set_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v1p4beta1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/productSets/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the create_product REST call - # - # @param request_pb [::Google::Cloud::Vision::V1p4beta1::CreateProductRequest] - # 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_product_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1p4beta1/{parent}/products", - body: "product", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_products REST call - # - # @param request_pb [::Google::Cloud::Vision::V1p4beta1::ListProductsRequest] - # 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_products_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1p4beta1/{parent}/products", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_product REST call - # - # @param request_pb [::Google::Cloud::Vision::V1p4beta1::GetProductRequest] - # 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_product_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1p4beta1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/products/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_product REST call - # - # @param request_pb [::Google::Cloud::Vision::V1p4beta1::UpdateProductRequest] - # 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_product_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v1p4beta1/{product.name}", - body: "product", - matches: [ - ["product.name", %r{^projects/[^/]+/locations/[^/]+/products/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_product REST call - # - # @param request_pb [::Google::Cloud::Vision::V1p4beta1::DeleteProductRequest] - # 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_product_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v1p4beta1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/products/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the create_reference_image REST call - # - # @param request_pb [::Google::Cloud::Vision::V1p4beta1::CreateReferenceImageRequest] - # 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_reference_image_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1p4beta1/{parent}/referenceImages", - body: "reference_image", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/products/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_reference_image REST call - # - # @param request_pb [::Google::Cloud::Vision::V1p4beta1::DeleteReferenceImageRequest] - # 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_reference_image_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v1p4beta1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/products/[^/]+/referenceImages/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_reference_images REST call - # - # @param request_pb [::Google::Cloud::Vision::V1p4beta1::ListReferenceImagesRequest] - # 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_reference_images_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1p4beta1/{parent}/referenceImages", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/products/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_reference_image REST call - # - # @param request_pb [::Google::Cloud::Vision::V1p4beta1::GetReferenceImageRequest] - # 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_reference_image_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1p4beta1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/products/[^/]+/referenceImages/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the add_product_to_product_set REST call - # - # @param request_pb [::Google::Cloud::Vision::V1p4beta1::AddProductToProductSetRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_add_product_to_product_set_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1p4beta1/{name}:addProduct", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/productSets/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the remove_product_from_product_set REST call - # - # @param request_pb [::Google::Cloud::Vision::V1p4beta1::RemoveProductFromProductSetRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_remove_product_from_product_set_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1p4beta1/{name}:removeProduct", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/productSets/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_products_in_product_set REST call - # - # @param request_pb [::Google::Cloud::Vision::V1p4beta1::ListProductsInProductSetRequest] - # 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_products_in_product_set_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1p4beta1/{name}/products", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/productSets/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the import_product_sets REST call - # - # @param request_pb [::Google::Cloud::Vision::V1p4beta1::ImportProductSetsRequest] - # 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_product_sets_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1p4beta1/{parent}/productSets:import", - body: "*", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the purge_products REST call - # - # @param request_pb [::Google::Cloud::Vision::V1p4beta1::PurgeProductsRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_purge_products_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1p4beta1/{parent}/products:purge", - body: "*", - 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-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1/product_search_pb.rb b/owl-bot-staging/google-cloud-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1/product_search_pb.rb deleted file mode 100644 index 09e3001149ae..000000000000 --- a/owl-bot-staging/google-cloud-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1/product_search_pb.rb +++ /dev/null @@ -1,30 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/vision/v1p4beta1/product_search.proto - -require 'google/protobuf' - -require 'google/api/resource_pb' -require 'google/cloud/vision/v1p4beta1/geometry_pb' -require 'google/cloud/vision/v1p4beta1/product_search_service_pb' -require 'google/protobuf/timestamp_pb' - - -descriptor_data = "\n2google/cloud/vision/v1p4beta1/product_search.proto\x12\x1dgoogle.cloud.vision.v1p4beta1\x1a\x19google/api/resource.proto\x1a,google/cloud/vision/v1p4beta1/geometry.proto\x1a:google/cloud/vision/v1p4beta1/product_search_service.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xc1\x01\n\x13ProductSearchParams\x12\x42\n\rbounding_poly\x18\t \x01(\x0b\x32+.google.cloud.vision.v1p4beta1.BoundingPoly\x12:\n\x0bproduct_set\x18\x06 \x01(\tB%\xfa\x41\"\n vision.googleapis.com/ProductSet\x12\x1a\n\x12product_categories\x18\x07 \x03(\t\x12\x0e\n\x06\x66ilter\x18\x08 \x01(\t\"\xb2\x05\n\x14ProductSearchResults\x12.\n\nindex_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12K\n\x07results\x18\x05 \x03(\x0b\x32:.google.cloud.vision.v1p4beta1.ProductSearchResults.Result\x12\x62\n\x17product_grouped_results\x18\x06 \x03(\x0b\x32\x41.google.cloud.vision.v1p4beta1.ProductSearchResults.GroupedResult\x1a_\n\x06Result\x12\x37\n\x07product\x18\x01 \x01(\x0b\x32&.google.cloud.vision.v1p4beta1.Product\x12\r\n\x05score\x18\x02 \x01(\x02\x12\r\n\x05image\x18\x03 \x01(\t\x1aS\n\x10ObjectAnnotation\x12\x0b\n\x03mid\x18\x01 \x01(\t\x12\x15\n\rlanguage_code\x18\x02 \x01(\t\x12\x0c\n\x04name\x18\x03 \x01(\t\x12\r\n\x05score\x18\x04 \x01(\x02\x1a\x82\x02\n\rGroupedResult\x12\x42\n\rbounding_poly\x18\x01 \x01(\x0b\x32+.google.cloud.vision.v1p4beta1.BoundingPoly\x12K\n\x07results\x18\x02 \x03(\x0b\x32:.google.cloud.vision.v1p4beta1.ProductSearchResults.Result\x12`\n\x12object_annotations\x18\x03 \x03(\x0b\x32\x44.google.cloud.vision.v1p4beta1.ProductSearchResults.ObjectAnnotationB~\n!com.google.cloud.vision.v1p4beta1B\x12ProductSearchProtoP\x01Z9cloud.google.com/go/vision/apiv1p4beta1/visionpb;visionpb\xf8\x01\x01\xa2\x02\x04GCVNb\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module Vision - module V1p4beta1 - ProductSearchParams = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p4beta1.ProductSearchParams").msgclass - ProductSearchResults = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p4beta1.ProductSearchResults").msgclass - ProductSearchResults::Result = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p4beta1.ProductSearchResults.Result").msgclass - ProductSearchResults::ObjectAnnotation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p4beta1.ProductSearchResults.ObjectAnnotation").msgclass - ProductSearchResults::GroupedResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p4beta1.ProductSearchResults.GroupedResult").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1/product_search_service_pb.rb b/owl-bot-staging/google-cloud-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1/product_search_service_pb.rb deleted file mode 100644 index 9174582ef97d..000000000000 --- a/owl-bot-staging/google-cloud-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1/product_search_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/vision/v1p4beta1/product_search_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/vision/v1p4beta1/geometry_pb' -require 'google/longrunning/operations_pb' -require 'google/protobuf/empty_pb' -require 'google/protobuf/field_mask_pb' -require 'google/protobuf/timestamp_pb' -require 'google/rpc/status_pb' - - -descriptor_data = "\n:google/cloud/vision/v1p4beta1/product_search_service.proto\x12\x1dgoogle.cloud.vision.v1p4beta1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a,google/cloud/vision/v1p4beta1/geometry.proto\x1a#google/longrunning/operations.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x17google/rpc/status.proto\"\xb2\x02\n\x07Product\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x14\n\x0c\x64isplay_name\x18\x02 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x03 \x01(\t\x12\x1d\n\x10product_category\x18\x04 \x01(\tB\x03\xe0\x41\x05\x12G\n\x0eproduct_labels\x18\x05 \x03(\x0b\x32/.google.cloud.vision.v1p4beta1.Product.KeyValue\x1a&\n\x08KeyValue\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:^\xea\x41[\n\x1dvision.googleapis.com/Product\x12:projects/{project}/locations/{location}/products/{product}\"\xfd\x01\n\nProductSet\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x14\n\x0c\x64isplay_name\x18\x02 \x01(\t\x12\x33\n\nindex_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12,\n\x0bindex_error\x18\x04 \x01(\x0b\x32\x12.google.rpc.StatusB\x03\xe0\x41\x03:h\xea\x41\x65\n vision.googleapis.com/ProductSet\x12\x41projects/{project}/locations/{location}/productSets/{product_set}\"\x85\x02\n\x0eReferenceImage\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x10\n\x03uri\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12H\n\x0e\x62ounding_polys\x18\x03 \x03(\x0b\x32+.google.cloud.vision.v1p4beta1.BoundingPolyB\x03\xe0\x41\x01:\x88\x01\xea\x41\x84\x01\n$vision.googleapis.com/ReferenceImage\x12\\projects/{project}/locations/{location}/products/{product}/referenceImages/{reference_image}\"\xa3\x01\n\x14\x43reateProductRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\x12<\n\x07product\x18\x02 \x01(\x0b\x32&.google.cloud.vision.v1p4beta1.ProductB\x03\xe0\x41\x02\x12\x12\n\nproduct_id\x18\x03 \x01(\t\"w\n\x13ListProductsRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\"i\n\x14ListProductsResponse\x12\x38\n\x08products\x18\x01 \x03(\x0b\x32&.google.cloud.vision.v1p4beta1.Product\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"H\n\x11GetProductRequest\x12\x33\n\x04name\x18\x01 \x01(\tB%\xe0\x41\x02\xfa\x41\x1f\n\x1dvision.googleapis.com/Product\"\x85\x01\n\x14UpdateProductRequest\x12<\n\x07product\x18\x01 \x01(\x0b\x32&.google.cloud.vision.v1p4beta1.ProductB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"K\n\x14\x44\x65leteProductRequest\x12\x33\n\x04name\x18\x01 \x01(\tB%\xe0\x41\x02\xfa\x41\x1f\n\x1dvision.googleapis.com/Product\"\xb1\x01\n\x17\x43reateProductSetRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\x12\x43\n\x0bproduct_set\x18\x02 \x01(\x0b\x32).google.cloud.vision.v1p4beta1.ProductSetB\x03\xe0\x41\x02\x12\x16\n\x0eproduct_set_id\x18\x03 \x01(\t\"z\n\x16ListProductSetsRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\"s\n\x17ListProductSetsResponse\x12?\n\x0cproduct_sets\x18\x01 \x03(\x0b\x32).google.cloud.vision.v1p4beta1.ProductSet\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"N\n\x14GetProductSetRequest\x12\x36\n\x04name\x18\x01 \x01(\tB(\xe0\x41\x02\xfa\x41\"\n vision.googleapis.com/ProductSet\"\x8f\x01\n\x17UpdateProductSetRequest\x12\x43\n\x0bproduct_set\x18\x01 \x01(\x0b\x32).google.cloud.vision.v1p4beta1.ProductSetB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"Q\n\x17\x44\x65leteProductSetRequest\x12\x36\n\x04name\x18\x01 \x01(\tB(\xe0\x41\x02\xfa\x41\"\n vision.googleapis.com/ProductSet\"\xbd\x01\n\x1b\x43reateReferenceImageRequest\x12\x35\n\x06parent\x18\x01 \x01(\tB%\xe0\x41\x02\xfa\x41\x1f\n\x1dvision.googleapis.com/Product\x12K\n\x0freference_image\x18\x02 \x01(\x0b\x32-.google.cloud.vision.v1p4beta1.ReferenceImageB\x03\xe0\x41\x02\x12\x1a\n\x12reference_image_id\x18\x03 \x01(\t\"z\n\x1aListReferenceImagesRequest\x12\x35\n\x06parent\x18\x01 \x01(\tB%\xe0\x41\x02\xfa\x41\x1f\n\x1dvision.googleapis.com/Product\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\"\x92\x01\n\x1bListReferenceImagesResponse\x12G\n\x10reference_images\x18\x01 \x03(\x0b\x32-.google.cloud.vision.v1p4beta1.ReferenceImage\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x17\n\x0fnext_page_token\x18\x03 \x01(\t\"V\n\x18GetReferenceImageRequest\x12:\n\x04name\x18\x01 \x01(\tB,\xe0\x41\x02\xfa\x41&\n$vision.googleapis.com/ReferenceImage\"Y\n\x1b\x44\x65leteReferenceImageRequest\x12:\n\x04name\x18\x01 \x01(\tB,\xe0\x41\x02\xfa\x41&\n$vision.googleapis.com/ReferenceImage\"\x8f\x01\n\x1d\x41\x64\x64ProductToProductSetRequest\x12\x36\n\x04name\x18\x01 \x01(\tB(\xe0\x41\x02\xfa\x41\"\n vision.googleapis.com/ProductSet\x12\x36\n\x07product\x18\x02 \x01(\tB%\xe0\x41\x02\xfa\x41\x1f\n\x1dvision.googleapis.com/Product\"\x94\x01\n\"RemoveProductFromProductSetRequest\x12\x36\n\x04name\x18\x01 \x01(\tB(\xe0\x41\x02\xfa\x41\"\n vision.googleapis.com/ProductSet\x12\x36\n\x07product\x18\x02 \x01(\tB%\xe0\x41\x02\xfa\x41\x1f\n\x1dvision.googleapis.com/Product\"\x80\x01\n\x1fListProductsInProductSetRequest\x12\x36\n\x04name\x18\x01 \x01(\tB(\xe0\x41\x02\xfa\x41\"\n vision.googleapis.com/ProductSet\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\"u\n ListProductsInProductSetResponse\x12\x38\n\x08products\x18\x01 \x03(\x0b\x32&.google.cloud.vision.v1p4beta1.Product\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"2\n\x1aImportProductSetsGcsSource\x12\x14\n\x0c\x63sv_file_uri\x18\x01 \x01(\t\"y\n\x1cImportProductSetsInputConfig\x12O\n\ngcs_source\x18\x01 \x01(\x0b\x32\x39.google.cloud.vision.v1p4beta1.ImportProductSetsGcsSourceH\x00\x42\x08\n\x06source\"\xad\x01\n\x18ImportProductSetsRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\x12V\n\x0cinput_config\x18\x02 \x01(\x0b\x32;.google.cloud.vision.v1p4beta1.ImportProductSetsInputConfigB\x03\xe0\x41\x02\"\x8a\x01\n\x19ImportProductSetsResponse\x12G\n\x10reference_images\x18\x01 \x03(\x0b\x32-.google.cloud.vision.v1p4beta1.ReferenceImage\x12$\n\x08statuses\x18\x02 \x03(\x0b\x32\x12.google.rpc.Status\"\x9e\x02\n\x16\x42\x61tchOperationMetadata\x12J\n\x05state\x18\x01 \x01(\x0e\x32;.google.cloud.vision.v1p4beta1.BatchOperationMetadata.State\x12/\n\x0bsubmit_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12,\n\x08\x65nd_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"Y\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0e\n\nPROCESSING\x10\x01\x12\x0e\n\nSUCCESSFUL\x10\x02\x12\n\n\x06\x46\x41ILED\x10\x03\x12\r\n\tCANCELLED\x10\x04\"/\n\x15ProductSetPurgeConfig\x12\x16\n\x0eproduct_set_id\x18\x01 \x01(\t\"\xe6\x01\n\x14PurgeProductsRequest\x12X\n\x18product_set_purge_config\x18\x02 \x01(\x0b\x32\x34.google.cloud.vision.v1p4beta1.ProductSetPurgeConfigH\x00\x12 \n\x16\x64\x65lete_orphan_products\x18\x03 \x01(\x08H\x00\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\x12\r\n\x05\x66orce\x18\x04 \x01(\x08\x42\x08\n\x06target2\xd2 \n\rProductSearch\x12\xe6\x01\n\x10\x43reateProductSet\x12\x36.google.cloud.vision.v1p4beta1.CreateProductSetRequest\x1a).google.cloud.vision.v1p4beta1.ProductSet\"o\xda\x41!parent,product_set,product_set_id\x82\xd3\xe4\x93\x02\x45\"6/v1p4beta1/{parent=projects/*/locations/*}/productSets:\x0bproduct_set\x12\xc9\x01\n\x0fListProductSets\x12\x35.google.cloud.vision.v1p4beta1.ListProductSetsRequest\x1a\x36.google.cloud.vision.v1p4beta1.ListProductSetsResponse\"G\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x38\x12\x36/v1p4beta1/{parent=projects/*/locations/*}/productSets\x12\xb6\x01\n\rGetProductSet\x12\x33.google.cloud.vision.v1p4beta1.GetProductSetRequest\x1a).google.cloud.vision.v1p4beta1.ProductSet\"E\xda\x41\x04name\x82\xd3\xe4\x93\x02\x38\x12\x36/v1p4beta1/{name=projects/*/locations/*/productSets/*}\x12\xe8\x01\n\x10UpdateProductSet\x12\x36.google.cloud.vision.v1p4beta1.UpdateProductSetRequest\x1a).google.cloud.vision.v1p4beta1.ProductSet\"q\xda\x41\x17product_set,update_mask\x82\xd3\xe4\x93\x02Q2B/v1p4beta1/{product_set.name=projects/*/locations/*/productSets/*}:\x0bproduct_set\x12\xa9\x01\n\x10\x44\x65leteProductSet\x12\x36.google.cloud.vision.v1p4beta1.DeleteProductSetRequest\x1a\x16.google.protobuf.Empty\"E\xda\x41\x04name\x82\xd3\xe4\x93\x02\x38*6/v1p4beta1/{name=projects/*/locations/*/productSets/*}\x12\xce\x01\n\rCreateProduct\x12\x33.google.cloud.vision.v1p4beta1.CreateProductRequest\x1a&.google.cloud.vision.v1p4beta1.Product\"`\xda\x41\x19parent,product,product_id\x82\xd3\xe4\x93\x02>\"3/v1p4beta1/{parent=projects/*/locations/*}/products:\x07product\x12\xbd\x01\n\x0cListProducts\x12\x32.google.cloud.vision.v1p4beta1.ListProductsRequest\x1a\x33.google.cloud.vision.v1p4beta1.ListProductsResponse\"D\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x35\x12\x33/v1p4beta1/{parent=projects/*/locations/*}/products\x12\xaa\x01\n\nGetProduct\x12\x30.google.cloud.vision.v1p4beta1.GetProductRequest\x1a&.google.cloud.vision.v1p4beta1.Product\"B\xda\x41\x04name\x82\xd3\xe4\x93\x02\x35\x12\x33/v1p4beta1/{name=projects/*/locations/*/products/*}\x12\xd0\x01\n\rUpdateProduct\x12\x33.google.cloud.vision.v1p4beta1.UpdateProductRequest\x1a&.google.cloud.vision.v1p4beta1.Product\"b\xda\x41\x13product,update_mask\x82\xd3\xe4\x93\x02\x46\x32;/v1p4beta1/{product.name=projects/*/locations/*/products/*}:\x07product\x12\xa0\x01\n\rDeleteProduct\x12\x33.google.cloud.vision.v1p4beta1.DeleteProductRequest\x1a\x16.google.protobuf.Empty\"B\xda\x41\x04name\x82\xd3\xe4\x93\x02\x35*3/v1p4beta1/{name=projects/*/locations/*/products/*}\x12\x8e\x02\n\x14\x43reateReferenceImage\x12:.google.cloud.vision.v1p4beta1.CreateReferenceImageRequest\x1a-.google.cloud.vision.v1p4beta1.ReferenceImage\"\x8a\x01\xda\x41)parent,reference_image,reference_image_id\x82\xd3\xe4\x93\x02X\"E/v1p4beta1/{parent=projects/*/locations/*/products/*}/referenceImages:\x0freference_image\x12\xc0\x01\n\x14\x44\x65leteReferenceImage\x12:.google.cloud.vision.v1p4beta1.DeleteReferenceImageRequest\x1a\x16.google.protobuf.Empty\"T\xda\x41\x04name\x82\xd3\xe4\x93\x02G*E/v1p4beta1/{name=projects/*/locations/*/products/*/referenceImages/*}\x12\xe4\x01\n\x13ListReferenceImages\x12\x39.google.cloud.vision.v1p4beta1.ListReferenceImagesRequest\x1a:.google.cloud.vision.v1p4beta1.ListReferenceImagesResponse\"V\xda\x41\x06parent\x82\xd3\xe4\x93\x02G\x12\x45/v1p4beta1/{parent=projects/*/locations/*/products/*}/referenceImages\x12\xd1\x01\n\x11GetReferenceImage\x12\x37.google.cloud.vision.v1p4beta1.GetReferenceImageRequest\x1a-.google.cloud.vision.v1p4beta1.ReferenceImage\"T\xda\x41\x04name\x82\xd3\xe4\x93\x02G\x12\x45/v1p4beta1/{name=projects/*/locations/*/products/*/referenceImages/*}\x12\xcb\x01\n\x16\x41\x64\x64ProductToProductSet\x12<.google.cloud.vision.v1p4beta1.AddProductToProductSetRequest\x1a\x16.google.protobuf.Empty\"[\xda\x41\x0cname,product\x82\xd3\xe4\x93\x02\x46\"A/v1p4beta1/{name=projects/*/locations/*/productSets/*}:addProduct:\x01*\x12\xd8\x01\n\x1bRemoveProductFromProductSet\x12\x41.google.cloud.vision.v1p4beta1.RemoveProductFromProductSetRequest\x1a\x16.google.protobuf.Empty\"^\xda\x41\x0cname,product\x82\xd3\xe4\x93\x02I\"D/v1p4beta1/{name=projects/*/locations/*/productSets/*}:removeProduct:\x01*\x12\xeb\x01\n\x18ListProductsInProductSet\x12>.google.cloud.vision.v1p4beta1.ListProductsInProductSetRequest\x1a?.google.cloud.vision.v1p4beta1.ListProductsInProductSetResponse\"N\xda\x41\x04name\x82\xd3\xe4\x93\x02\x41\x12?/v1p4beta1/{name=projects/*/locations/*/productSets/*}/products\x12\x82\x02\n\x11ImportProductSets\x12\x37.google.cloud.vision.v1p4beta1.ImportProductSetsRequest\x1a\x1d.google.longrunning.Operation\"\x94\x01\xca\x41\x33\n\x19ImportProductSetsResponse\x12\x16\x42\x61tchOperationMetadata\xda\x41\x13parent,input_config\x82\xd3\xe4\x93\x02\x42\"=/v1p4beta1/{parent=projects/*/locations/*}/productSets:import:\x01*\x12\xe4\x01\n\rPurgeProducts\x12\x33.google.cloud.vision.v1p4beta1.PurgeProductsRequest\x1a\x1d.google.longrunning.Operation\"\x7f\xca\x41/\n\x15google.protobuf.Empty\x12\x16\x42\x61tchOperationMetadata\xda\x41\x06parent\x82\xd3\xe4\x93\x02>\"9/v1p4beta1/{parent=projects/*/locations/*}/products:purge:\x01*\x1av\xca\x41\x15vision.googleapis.com\xd2\x41[https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/cloud-visionB\x85\x01\n!com.google.cloud.vision.v1p4beta1B\x19ProductSearchServiceProtoP\x01Z9cloud.google.com/go/vision/apiv1p4beta1/visionpb;visionpb\xf8\x01\x01\xa2\x02\x04GCVNb\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module Vision - module V1p4beta1 - Product = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p4beta1.Product").msgclass - Product::KeyValue = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p4beta1.Product.KeyValue").msgclass - ProductSet = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p4beta1.ProductSet").msgclass - ReferenceImage = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p4beta1.ReferenceImage").msgclass - CreateProductRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p4beta1.CreateProductRequest").msgclass - ListProductsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p4beta1.ListProductsRequest").msgclass - ListProductsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p4beta1.ListProductsResponse").msgclass - GetProductRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p4beta1.GetProductRequest").msgclass - UpdateProductRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p4beta1.UpdateProductRequest").msgclass - DeleteProductRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p4beta1.DeleteProductRequest").msgclass - CreateProductSetRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p4beta1.CreateProductSetRequest").msgclass - ListProductSetsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p4beta1.ListProductSetsRequest").msgclass - ListProductSetsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p4beta1.ListProductSetsResponse").msgclass - GetProductSetRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p4beta1.GetProductSetRequest").msgclass - UpdateProductSetRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p4beta1.UpdateProductSetRequest").msgclass - DeleteProductSetRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p4beta1.DeleteProductSetRequest").msgclass - CreateReferenceImageRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p4beta1.CreateReferenceImageRequest").msgclass - ListReferenceImagesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p4beta1.ListReferenceImagesRequest").msgclass - ListReferenceImagesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p4beta1.ListReferenceImagesResponse").msgclass - GetReferenceImageRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p4beta1.GetReferenceImageRequest").msgclass - DeleteReferenceImageRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p4beta1.DeleteReferenceImageRequest").msgclass - AddProductToProductSetRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p4beta1.AddProductToProductSetRequest").msgclass - RemoveProductFromProductSetRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p4beta1.RemoveProductFromProductSetRequest").msgclass - ListProductsInProductSetRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p4beta1.ListProductsInProductSetRequest").msgclass - ListProductsInProductSetResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p4beta1.ListProductsInProductSetResponse").msgclass - ImportProductSetsGcsSource = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p4beta1.ImportProductSetsGcsSource").msgclass - ImportProductSetsInputConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p4beta1.ImportProductSetsInputConfig").msgclass - ImportProductSetsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p4beta1.ImportProductSetsRequest").msgclass - ImportProductSetsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p4beta1.ImportProductSetsResponse").msgclass - BatchOperationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p4beta1.BatchOperationMetadata").msgclass - BatchOperationMetadata::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p4beta1.BatchOperationMetadata.State").enummodule - ProductSetPurgeConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p4beta1.ProductSetPurgeConfig").msgclass - PurgeProductsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p4beta1.PurgeProductsRequest").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1/product_search_service_services_pb.rb b/owl-bot-staging/google-cloud-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1/product_search_service_services_pb.rb deleted file mode 100644 index 9d8e60b47cfc..000000000000 --- a/owl-bot-staging/google-cloud-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1/product_search_service_services_pb.rb +++ /dev/null @@ -1,236 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# Source: google/cloud/vision/v1p4beta1/product_search_service.proto for package 'google.cloud.vision.v1p4beta1' -# 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/vision/v1p4beta1/product_search_service_pb' - -module Google - module Cloud - module Vision - module V1p4beta1 - module ProductSearch - # Manages Products and ProductSets of reference images for use in product - # search. It uses the following resource model: - # - # - The API has a collection of - # [ProductSet][google.cloud.vision.v1p4beta1.ProductSet] resources, named - # `projects/*/locations/*/productSets/*`, which acts as a way to put different - # products into groups to limit identification. - # - # In parallel, - # - # - The API has a collection of - # [Product][google.cloud.vision.v1p4beta1.Product] resources, named - # `projects/*/locations/*/products/*` - # - # - Each [Product][google.cloud.vision.v1p4beta1.Product] has a collection of - # [ReferenceImage][google.cloud.vision.v1p4beta1.ReferenceImage] resources, - # named - # `projects/*/locations/*/products/*/referenceImages/*` - class Service - - include ::GRPC::GenericService - - self.marshal_class_method = :encode - self.unmarshal_class_method = :decode - self.service_name = 'google.cloud.vision.v1p4beta1.ProductSearch' - - # Creates and returns a new ProductSet resource. - # - # Possible errors: - # - # * Returns INVALID_ARGUMENT if display_name is missing, or is longer than - # 4096 characters. - rpc :CreateProductSet, ::Google::Cloud::Vision::V1p4beta1::CreateProductSetRequest, ::Google::Cloud::Vision::V1p4beta1::ProductSet - # Lists ProductSets in an unspecified order. - # - # Possible errors: - # - # * Returns INVALID_ARGUMENT if page_size is greater than 100, or less - # than 1. - rpc :ListProductSets, ::Google::Cloud::Vision::V1p4beta1::ListProductSetsRequest, ::Google::Cloud::Vision::V1p4beta1::ListProductSetsResponse - # Gets information associated with a ProductSet. - # - # Possible errors: - # - # * Returns NOT_FOUND if the ProductSet does not exist. - rpc :GetProductSet, ::Google::Cloud::Vision::V1p4beta1::GetProductSetRequest, ::Google::Cloud::Vision::V1p4beta1::ProductSet - # Makes changes to a ProductSet resource. - # Only display_name can be updated currently. - # - # Possible errors: - # - # * Returns NOT_FOUND if the ProductSet does not exist. - # * Returns INVALID_ARGUMENT if display_name is present in update_mask but - # missing from the request or longer than 4096 characters. - rpc :UpdateProductSet, ::Google::Cloud::Vision::V1p4beta1::UpdateProductSetRequest, ::Google::Cloud::Vision::V1p4beta1::ProductSet - # Permanently deletes a ProductSet. Products and ReferenceImages in the - # ProductSet are not deleted. - # - # The actual image files are not deleted from Google Cloud Storage. - rpc :DeleteProductSet, ::Google::Cloud::Vision::V1p4beta1::DeleteProductSetRequest, ::Google::Protobuf::Empty - # Creates and returns a new product resource. - # - # Possible errors: - # - # * Returns INVALID_ARGUMENT if display_name is missing or longer than 4096 - # characters. - # * Returns INVALID_ARGUMENT if description is longer than 4096 characters. - # * Returns INVALID_ARGUMENT if product_category is missing or invalid. - rpc :CreateProduct, ::Google::Cloud::Vision::V1p4beta1::CreateProductRequest, ::Google::Cloud::Vision::V1p4beta1::Product - # Lists products in an unspecified order. - # - # Possible errors: - # - # * Returns INVALID_ARGUMENT if page_size is greater than 100 or less than 1. - rpc :ListProducts, ::Google::Cloud::Vision::V1p4beta1::ListProductsRequest, ::Google::Cloud::Vision::V1p4beta1::ListProductsResponse - # Gets information associated with a Product. - # - # Possible errors: - # - # * Returns NOT_FOUND if the Product does not exist. - rpc :GetProduct, ::Google::Cloud::Vision::V1p4beta1::GetProductRequest, ::Google::Cloud::Vision::V1p4beta1::Product - # Makes changes to a Product resource. - # Only the `display_name`, `description`, and `labels` fields can be updated - # right now. - # - # If labels are updated, the change will not be reflected in queries until - # the next index time. - # - # Possible errors: - # - # * Returns NOT_FOUND if the Product does not exist. - # * Returns INVALID_ARGUMENT if display_name is present in update_mask but is - # missing from the request or longer than 4096 characters. - # * Returns INVALID_ARGUMENT if description is present in update_mask but is - # longer than 4096 characters. - # * Returns INVALID_ARGUMENT if product_category is present in update_mask. - rpc :UpdateProduct, ::Google::Cloud::Vision::V1p4beta1::UpdateProductRequest, ::Google::Cloud::Vision::V1p4beta1::Product - # Permanently deletes a product and its reference images. - # - # Metadata of the product and all its images will be deleted right away, but - # search queries against ProductSets containing the product may still work - # until all related caches are refreshed. - rpc :DeleteProduct, ::Google::Cloud::Vision::V1p4beta1::DeleteProductRequest, ::Google::Protobuf::Empty - # Creates and returns a new ReferenceImage resource. - # - # The `bounding_poly` field is optional. If `bounding_poly` is not specified, - # the system will try to detect regions of interest in the image that are - # compatible with the product_category on the parent product. If it is - # specified, detection is ALWAYS skipped. The system converts polygons into - # non-rotated rectangles. - # - # Note that the pipeline will resize the image if the image resolution is too - # large to process (above 50MP). - # - # Possible errors: - # - # * Returns INVALID_ARGUMENT if the image_uri is missing or longer than 4096 - # characters. - # * Returns INVALID_ARGUMENT if the product does not exist. - # * Returns INVALID_ARGUMENT if bounding_poly is not provided, and nothing - # compatible with the parent product's product_category is detected. - # * Returns INVALID_ARGUMENT if bounding_poly contains more than 10 polygons. - rpc :CreateReferenceImage, ::Google::Cloud::Vision::V1p4beta1::CreateReferenceImageRequest, ::Google::Cloud::Vision::V1p4beta1::ReferenceImage - # Permanently deletes a reference image. - # - # The image metadata will be deleted right away, but search queries - # against ProductSets containing the image may still work until all related - # caches are refreshed. - # - # The actual image files are not deleted from Google Cloud Storage. - rpc :DeleteReferenceImage, ::Google::Cloud::Vision::V1p4beta1::DeleteReferenceImageRequest, ::Google::Protobuf::Empty - # Lists reference images. - # - # Possible errors: - # - # * Returns NOT_FOUND if the parent product does not exist. - # * Returns INVALID_ARGUMENT if the page_size is greater than 100, or less - # than 1. - rpc :ListReferenceImages, ::Google::Cloud::Vision::V1p4beta1::ListReferenceImagesRequest, ::Google::Cloud::Vision::V1p4beta1::ListReferenceImagesResponse - # Gets information associated with a ReferenceImage. - # - # Possible errors: - # - # * Returns NOT_FOUND if the specified image does not exist. - rpc :GetReferenceImage, ::Google::Cloud::Vision::V1p4beta1::GetReferenceImageRequest, ::Google::Cloud::Vision::V1p4beta1::ReferenceImage - # Adds a Product to the specified ProductSet. If the Product is already - # present, no change is made. - # - # One Product can be added to at most 100 ProductSets. - # - # Possible errors: - # - # * Returns NOT_FOUND if the Product or the ProductSet doesn't exist. - rpc :AddProductToProductSet, ::Google::Cloud::Vision::V1p4beta1::AddProductToProductSetRequest, ::Google::Protobuf::Empty - # Removes a Product from the specified ProductSet. - rpc :RemoveProductFromProductSet, ::Google::Cloud::Vision::V1p4beta1::RemoveProductFromProductSetRequest, ::Google::Protobuf::Empty - # Lists the Products in a ProductSet, in an unspecified order. If the - # ProductSet does not exist, the products field of the response will be - # empty. - # - # Possible errors: - # - # * Returns INVALID_ARGUMENT if page_size is greater than 100 or less than 1. - rpc :ListProductsInProductSet, ::Google::Cloud::Vision::V1p4beta1::ListProductsInProductSetRequest, ::Google::Cloud::Vision::V1p4beta1::ListProductsInProductSetResponse - # Asynchronous API that imports a list of reference images to specified - # product sets based on a list of image information. - # - # The [google.longrunning.Operation][google.longrunning.Operation] API can be - # used to keep track of the progress and results of the request. - # `Operation.metadata` contains `BatchOperationMetadata`. (progress) - # `Operation.response` contains `ImportProductSetsResponse`. (results) - # - # The input source of this method is a csv file on Google Cloud Storage. - # For the format of the csv file please see - # [ImportProductSetsGcsSource.csv_file_uri][google.cloud.vision.v1p4beta1.ImportProductSetsGcsSource.csv_file_uri]. - rpc :ImportProductSets, ::Google::Cloud::Vision::V1p4beta1::ImportProductSetsRequest, ::Google::Longrunning::Operation - # Asynchronous API to delete all Products in a ProductSet or all Products - # that are in no ProductSet. - # - # If a Product is a member of the specified ProductSet in addition to other - # ProductSets, the Product will still be deleted. - # - # It is recommended to not delete the specified ProductSet until after this - # operation has completed. It is also recommended to not add any of the - # Products involved in the batch delete to a new ProductSet while this - # operation is running because those Products may still end up deleted. - # - # It's not possible to undo the PurgeProducts operation. Therefore, it is - # recommended to keep the csv files used in ImportProductSets (if that was - # how you originally built the Product Set) before starting PurgeProducts, in - # case you need to re-import the data after deletion. - # - # If the plan is to purge all of the Products from a ProductSet and then - # re-use the empty ProductSet to re-import new Products into the empty - # ProductSet, you must wait until the PurgeProducts operation has finished - # for that ProductSet. - # - # The [google.longrunning.Operation][google.longrunning.Operation] API can be - # used to keep track of the progress and results of the request. - # `Operation.metadata` contains `BatchOperationMetadata`. (progress) - rpc :PurgeProducts, ::Google::Cloud::Vision::V1p4beta1::PurgeProductsRequest, ::Google::Longrunning::Operation - end - - Stub = Service.rpc_stub_class - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1/rest.rb b/owl-bot-staging/google-cloud-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1/rest.rb deleted file mode 100644 index e5b113bc93a9..000000000000 --- a/owl-bot-staging/google-cloud-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1/rest.rb +++ /dev/null @@ -1,38 +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/vision/v1p4beta1/product_search/rest" -require "google/cloud/vision/v1p4beta1/image_annotator/rest" -require "google/cloud/vision/v1p4beta1/version" - -module Google - module Cloud - module Vision - ## - # To load just the REST part of this package, including all its services, and instantiate a REST client: - # - # @example - # - # require "google/cloud/vision/v1p4beta1/rest" - # client = ::Google::Cloud::Vision::V1p4beta1::ProductSearch::Rest::Client.new - # - module V1p4beta1 - end - end - end -end diff --git a/owl-bot-staging/google-cloud-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1/text_annotation_pb.rb b/owl-bot-staging/google-cloud-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1/text_annotation_pb.rb deleted file mode 100644 index e94c47e37a44..000000000000 --- a/owl-bot-staging/google-cloud-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1/text_annotation_pb.rb +++ /dev/null @@ -1,33 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/vision/v1p4beta1/text_annotation.proto - -require 'google/protobuf' - -require 'google/cloud/vision/v1p4beta1/geometry_pb' - - -descriptor_data = "\n3google/cloud/vision/v1p4beta1/text_annotation.proto\x12\x1dgoogle.cloud.vision.v1p4beta1\x1a,google/cloud/vision/v1p4beta1/geometry.proto\"\xb2\x04\n\x0eTextAnnotation\x12\x32\n\x05pages\x18\x01 \x03(\x0b\x32#.google.cloud.vision.v1p4beta1.Page\x12\x0c\n\x04text\x18\x02 \x01(\t\x1a=\n\x10\x44\x65tectedLanguage\x12\x15\n\rlanguage_code\x18\x01 \x01(\t\x12\x12\n\nconfidence\x18\x02 \x01(\x02\x1a\xdc\x01\n\rDetectedBreak\x12S\n\x04type\x18\x01 \x01(\x0e\x32\x45.google.cloud.vision.v1p4beta1.TextAnnotation.DetectedBreak.BreakType\x12\x11\n\tis_prefix\x18\x02 \x01(\x08\"c\n\tBreakType\x12\x0b\n\x07UNKNOWN\x10\x00\x12\t\n\x05SPACE\x10\x01\x12\x0e\n\nSURE_SPACE\x10\x02\x12\x12\n\x0e\x45OL_SURE_SPACE\x10\x03\x12\n\n\x06HYPHEN\x10\x04\x12\x0e\n\nLINE_BREAK\x10\x05\x1a\xbf\x01\n\x0cTextProperty\x12Z\n\x12\x64\x65tected_languages\x18\x01 \x03(\x0b\x32>.google.cloud.vision.v1p4beta1.TextAnnotation.DetectedLanguage\x12S\n\x0e\x64\x65tected_break\x18\x02 \x01(\x0b\x32;.google.cloud.vision.v1p4beta1.TextAnnotation.DetectedBreak\"\xbd\x01\n\x04Page\x12L\n\x08property\x18\x01 \x01(\x0b\x32:.google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty\x12\r\n\x05width\x18\x02 \x01(\x05\x12\x0e\n\x06height\x18\x03 \x01(\x05\x12\x34\n\x06\x62locks\x18\x04 \x03(\x0b\x32$.google.cloud.vision.v1p4beta1.Block\x12\x12\n\nconfidence\x18\x05 \x01(\x02\"\x82\x03\n\x05\x42lock\x12L\n\x08property\x18\x01 \x01(\x0b\x32:.google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty\x12\x41\n\x0c\x62ounding_box\x18\x02 \x01(\x0b\x32+.google.cloud.vision.v1p4beta1.BoundingPoly\x12<\n\nparagraphs\x18\x03 \x03(\x0b\x32(.google.cloud.vision.v1p4beta1.Paragraph\x12\x42\n\nblock_type\x18\x04 \x01(\x0e\x32..google.cloud.vision.v1p4beta1.Block.BlockType\x12\x12\n\nconfidence\x18\x05 \x01(\x02\"R\n\tBlockType\x12\x0b\n\x07UNKNOWN\x10\x00\x12\x08\n\x04TEXT\x10\x01\x12\t\n\x05TABLE\x10\x02\x12\x0b\n\x07PICTURE\x10\x03\x12\t\n\x05RULER\x10\x04\x12\x0b\n\x07\x42\x41RCODE\x10\x05\"\xe4\x01\n\tParagraph\x12L\n\x08property\x18\x01 \x01(\x0b\x32:.google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty\x12\x41\n\x0c\x62ounding_box\x18\x02 \x01(\x0b\x32+.google.cloud.vision.v1p4beta1.BoundingPoly\x12\x32\n\x05words\x18\x03 \x03(\x0b\x32#.google.cloud.vision.v1p4beta1.Word\x12\x12\n\nconfidence\x18\x04 \x01(\x02\"\xe3\x01\n\x04Word\x12L\n\x08property\x18\x01 \x01(\x0b\x32:.google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty\x12\x41\n\x0c\x62ounding_box\x18\x02 \x01(\x0b\x32+.google.cloud.vision.v1p4beta1.BoundingPoly\x12\x36\n\x07symbols\x18\x03 \x03(\x0b\x32%.google.cloud.vision.v1p4beta1.Symbol\x12\x12\n\nconfidence\x18\x04 \x01(\x02\"\xbb\x01\n\x06Symbol\x12L\n\x08property\x18\x01 \x01(\x0b\x32:.google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty\x12\x41\n\x0c\x62ounding_box\x18\x02 \x01(\x0b\x32+.google.cloud.vision.v1p4beta1.BoundingPoly\x12\x0c\n\x04text\x18\x03 \x01(\t\x12\x12\n\nconfidence\x18\x04 \x01(\x02\x42\x7f\n!com.google.cloud.vision.v1p4beta1B\x13TextAnnotationProtoP\x01Z9cloud.google.com/go/vision/apiv1p4beta1/visionpb;visionpb\xf8\x01\x01\xa2\x02\x04GCVNb\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module Vision - module V1p4beta1 - TextAnnotation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p4beta1.TextAnnotation").msgclass - TextAnnotation::DetectedLanguage = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p4beta1.TextAnnotation.DetectedLanguage").msgclass - TextAnnotation::DetectedBreak = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p4beta1.TextAnnotation.DetectedBreak").msgclass - TextAnnotation::DetectedBreak::BreakType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p4beta1.TextAnnotation.DetectedBreak.BreakType").enummodule - TextAnnotation::TextProperty = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty").msgclass - Page = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p4beta1.Page").msgclass - Block = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p4beta1.Block").msgclass - Block::BlockType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p4beta1.Block.BlockType").enummodule - Paragraph = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p4beta1.Paragraph").msgclass - Word = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p4beta1.Word").msgclass - Symbol = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p4beta1.Symbol").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1/version.rb b/owl-bot-staging/google-cloud-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1/version.rb deleted file mode 100644 index 8354c32c6ad6..000000000000 --- a/owl-bot-staging/google-cloud-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1/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 Vision - module V1p4beta1 - VERSION = "0.0.1" - end - end - end -end diff --git a/owl-bot-staging/google-cloud-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1/web_detection_pb.rb b/owl-bot-staging/google-cloud-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1/web_detection_pb.rb deleted file mode 100644 index af43ae9b8064..000000000000 --- a/owl-bot-staging/google-cloud-vision-v1p4beta1/lib/google/cloud/vision/v1p4beta1/web_detection_pb.rb +++ /dev/null @@ -1,25 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/vision/v1p4beta1/web_detection.proto - -require 'google/protobuf' - - -descriptor_data = "\n1google/cloud/vision/v1p4beta1/web_detection.proto\x12\x1dgoogle.cloud.vision.v1p4beta1\"\x8c\x07\n\x0cWebDetection\x12K\n\x0cweb_entities\x18\x01 \x03(\x0b\x32\x35.google.cloud.vision.v1p4beta1.WebDetection.WebEntity\x12R\n\x14\x66ull_matching_images\x18\x02 \x03(\x0b\x32\x34.google.cloud.vision.v1p4beta1.WebDetection.WebImage\x12U\n\x17partial_matching_images\x18\x03 \x03(\x0b\x32\x34.google.cloud.vision.v1p4beta1.WebDetection.WebImage\x12W\n\x1apages_with_matching_images\x18\x04 \x03(\x0b\x32\x33.google.cloud.vision.v1p4beta1.WebDetection.WebPage\x12U\n\x17visually_similar_images\x18\x06 \x03(\x0b\x32\x34.google.cloud.vision.v1p4beta1.WebDetection.WebImage\x12O\n\x11\x62\x65st_guess_labels\x18\x08 \x03(\x0b\x32\x34.google.cloud.vision.v1p4beta1.WebDetection.WebLabel\x1a\x42\n\tWebEntity\x12\x11\n\tentity_id\x18\x01 \x01(\t\x12\r\n\x05score\x18\x02 \x01(\x02\x12\x13\n\x0b\x64\x65scription\x18\x03 \x01(\t\x1a&\n\x08WebImage\x12\x0b\n\x03url\x18\x01 \x01(\t\x12\r\n\x05score\x18\x02 \x01(\x02\x1a\xe4\x01\n\x07WebPage\x12\x0b\n\x03url\x18\x01 \x01(\t\x12\r\n\x05score\x18\x02 \x01(\x02\x12\x12\n\npage_title\x18\x03 \x01(\t\x12R\n\x14\x66ull_matching_images\x18\x04 \x03(\x0b\x32\x34.google.cloud.vision.v1p4beta1.WebDetection.WebImage\x12U\n\x17partial_matching_images\x18\x05 \x03(\x0b\x32\x34.google.cloud.vision.v1p4beta1.WebDetection.WebImage\x1a\x30\n\x08WebLabel\x12\r\n\x05label\x18\x01 \x01(\t\x12\x15\n\rlanguage_code\x18\x02 \x01(\tB}\n!com.google.cloud.vision.v1p4beta1B\x11WebDetectionProtoP\x01Z9cloud.google.com/go/vision/apiv1p4beta1/visionpb;visionpb\xf8\x01\x01\xa2\x02\x04GCVNb\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module Vision - module V1p4beta1 - WebDetection = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p4beta1.WebDetection").msgclass - WebDetection::WebEntity = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p4beta1.WebDetection.WebEntity").msgclass - WebDetection::WebImage = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p4beta1.WebDetection.WebImage").msgclass - WebDetection::WebPage = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p4beta1.WebDetection.WebPage").msgclass - WebDetection::WebLabel = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vision.v1p4beta1.WebDetection.WebLabel").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-vision-v1p4beta1/proto_docs/README.md b/owl-bot-staging/google-cloud-vision-v1p4beta1/proto_docs/README.md deleted file mode 100644 index 33f6816ca582..000000000000 --- a/owl-bot-staging/google-cloud-vision-v1p4beta1/proto_docs/README.md +++ /dev/null @@ -1,4 +0,0 @@ -# Cloud Vision V1p4beta1 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-vision-v1p4beta1/proto_docs/google/api/client.rb b/owl-bot-staging/google-cloud-vision-v1p4beta1/proto_docs/google/api/client.rb deleted file mode 100644 index 3ab0b096d445..000000000000 --- a/owl-bot-staging/google-cloud-vision-v1p4beta1/proto_docs/google/api/client.rb +++ /dev/null @@ -1,593 +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. - # - # Note: This field should not be used in most cases. - 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: - # library_settings: - # 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. - # @!attribute [rw] library_package - # @return [::String] - # The package name to use in Php. Clobbers the php_namespace option - # set in the protobuf. This should be used **only** by APIs - # who have already set the language_settings.php.package_name" field - # in gapic.yaml. API teams should use the protobuf php_namespace option - # where possible. - # - # Example of a YAML configuration:: - # - # publishing: - # library_settings: - # php_settings: - # library_package: Google\Cloud\PubSub\V1 - 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. - # - # Example: - # - # 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 - # @!attribute [rw] batching - # @return [::Google::Api::BatchingConfigProto] - # Batching configuration for an API method in client libraries. - # - # Example of a YAML configuration: - # - # publishing: - # method_settings: - # - selector: google.example.v1.ExampleService.BatchCreateExample - # batching: - # element_count_threshold: 1000 - # request_byte_threshold: 100000000 - # delay_threshold_millis: 10 - 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. - # - # Note: This feature should not be used in most cases. - # @!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 - - # `BatchingConfigProto` defines the batching configuration for an API method. - # @!attribute [rw] thresholds - # @return [::Google::Api::BatchingSettingsProto] - # The thresholds which trigger a batched request to be sent. - # @!attribute [rw] batch_descriptor - # @return [::Google::Api::BatchingDescriptorProto] - # The request and response fields used in batching. - class BatchingConfigProto - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # `BatchingSettingsProto` specifies a set of batching thresholds, each of - # which acts as a trigger to send a batch of messages as a request. At least - # one threshold must be positive nonzero. - # @!attribute [rw] element_count_threshold - # @return [::Integer] - # The number of elements of a field collected into a batch which, if - # exceeded, causes the batch to be sent. - # @!attribute [rw] request_byte_threshold - # @return [::Integer] - # The aggregated size of the batched field which, if exceeded, causes the - # batch to be sent. This size is computed by aggregating the sizes of the - # request field to be batched, not of the entire request message. - # @!attribute [rw] delay_threshold - # @return [::Google::Protobuf::Duration] - # The duration after which a batch should be sent, starting from the addition - # of the first message to that batch. - # @!attribute [rw] element_count_limit - # @return [::Integer] - # The maximum number of elements collected in a batch that could be accepted - # by server. - # @!attribute [rw] request_byte_limit - # @return [::Integer] - # The maximum size of the request that could be accepted by server. - # @!attribute [rw] flow_control_element_limit - # @return [::Integer] - # The maximum number of elements allowed by flow control. - # @!attribute [rw] flow_control_byte_limit - # @return [::Integer] - # The maximum size of data allowed by flow control. - # @!attribute [rw] flow_control_limit_exceeded_behavior - # @return [::Google::Api::FlowControlLimitExceededBehaviorProto] - # The behavior to take when the flow control limit is exceeded. - class BatchingSettingsProto - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # `BatchingDescriptorProto` specifies the fields of the request message to be - # used for batching, and, optionally, the fields of the response message to be - # used for demultiplexing. - # @!attribute [rw] batched_field - # @return [::String] - # The repeated field in the request message to be aggregated by batching. - # @!attribute [rw] discriminator_fields - # @return [::Array<::String>] - # A list of the fields in the request message. Two requests will be batched - # together only if the values of every field specified in - # `request_discriminator_fields` is equal between the two requests. - # @!attribute [rw] subresponse_field - # @return [::String] - # Optional. When present, indicates the field in the response message to be - # used to demultiplex the response into multiple response messages, in - # correspondence with the multiple request messages originally batched - # together. - class BatchingDescriptorProto - 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 - - # The behavior to take when the flow control limit is exceeded. - module FlowControlLimitExceededBehaviorProto - # Default behavior, system-defined. - UNSET_BEHAVIOR = 0 - - # Stop operation, raise error. - THROW_EXCEPTION = 1 - - # Pause operation until limit clears. - BLOCK = 2 - - # Continue operation, disregard limit. - IGNORE = 3 - end - end -end diff --git a/owl-bot-staging/google-cloud-vision-v1p4beta1/proto_docs/google/api/field_behavior.rb b/owl-bot-staging/google-cloud-vision-v1p4beta1/proto_docs/google/api/field_behavior.rb deleted file mode 100644 index 582be187d115..000000000000 --- a/owl-bot-staging/google-cloud-vision-v1p4beta1/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-vision-v1p4beta1/proto_docs/google/api/launch_stage.rb b/owl-bot-staging/google-cloud-vision-v1p4beta1/proto_docs/google/api/launch_stage.rb deleted file mode 100644 index 9392a413fb1b..000000000000 --- a/owl-bot-staging/google-cloud-vision-v1p4beta1/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-vision-v1p4beta1/proto_docs/google/api/resource.rb b/owl-bot-staging/google-cloud-vision-v1p4beta1/proto_docs/google/api/resource.rb deleted file mode 100644 index 25dec4847ac1..000000000000 --- a/owl-bot-staging/google-cloud-vision-v1p4beta1/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-vision-v1p4beta1/proto_docs/google/cloud/vision/v1p4beta1/face.rb b/owl-bot-staging/google-cloud-vision-v1p4beta1/proto_docs/google/cloud/vision/v1p4beta1/face.rb deleted file mode 100644 index 67c8368db2a6..000000000000 --- a/owl-bot-staging/google-cloud-vision-v1p4beta1/proto_docs/google/cloud/vision/v1p4beta1/face.rb +++ /dev/null @@ -1,68 +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 Vision - module V1p4beta1 - # Parameters for a celebrity recognition request. - # @!attribute [rw] celebrity_set - # @return [::Array<::String>] - # The resource names for one or more - # [CelebritySet][google.cloud.vision.v1p4beta1.CelebritySet]s. A celebrity - # set is preloaded and can be specified as "builtin/default". If this is - # specified, the algorithm will try to match the faces detected in the input - # image to the Celebrities in the CelebritySets. - class FaceRecognitionParams - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A Celebrity is a group of Faces with an identity. - # @!attribute [rw] name - # @return [::String] - # The resource name of the preloaded Celebrity. Has the format - # `builtin/{mid}`. - # @!attribute [rw] display_name - # @return [::String] - # The Celebrity's display name. - # @!attribute [rw] description - # @return [::String] - # The Celebrity's description. - class Celebrity - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Information about a face's identity. - # @!attribute [rw] celebrity - # @return [::Google::Cloud::Vision::V1p4beta1::Celebrity] - # The {::Google::Cloud::Vision::V1p4beta1::Celebrity Celebrity} that this face was - # matched to. - # @!attribute [rw] confidence - # @return [::Float] - # Recognition confidence. Range [0, 1]. - class FaceRecognitionResult - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-vision-v1p4beta1/proto_docs/google/cloud/vision/v1p4beta1/geometry.rb b/owl-bot-staging/google-cloud-vision-v1p4beta1/proto_docs/google/cloud/vision/v1p4beta1/geometry.rb deleted file mode 100644 index c88392894891..000000000000 --- a/owl-bot-staging/google-cloud-vision-v1p4beta1/proto_docs/google/cloud/vision/v1p4beta1/geometry.rb +++ /dev/null @@ -1,82 +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 Vision - module V1p4beta1 - # A vertex represents a 2D point in the image. - # NOTE: the vertex coordinates are in the same scale as the original image. - # @!attribute [rw] x - # @return [::Integer] - # X coordinate. - # @!attribute [rw] y - # @return [::Integer] - # Y coordinate. - class Vertex - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A vertex represents a 2D point in the image. - # NOTE: the normalized vertex coordinates are relative to the original image - # and range from 0 to 1. - # @!attribute [rw] x - # @return [::Float] - # X coordinate. - # @!attribute [rw] y - # @return [::Float] - # Y coordinate. - class NormalizedVertex - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A bounding polygon for the detected image annotation. - # @!attribute [rw] vertices - # @return [::Array<::Google::Cloud::Vision::V1p4beta1::Vertex>] - # The bounding polygon vertices. - # @!attribute [rw] normalized_vertices - # @return [::Array<::Google::Cloud::Vision::V1p4beta1::NormalizedVertex>] - # The bounding polygon normalized vertices. - class BoundingPoly - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A 3D position in the image, used primarily for Face detection landmarks. - # A valid Position must have both x and y coordinates. - # The position coordinates are in the same scale as the original image. - # @!attribute [rw] x - # @return [::Float] - # X coordinate. - # @!attribute [rw] y - # @return [::Float] - # Y coordinate. - # @!attribute [rw] z - # @return [::Float] - # Z coordinate (or depth). - class Position - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-vision-v1p4beta1/proto_docs/google/cloud/vision/v1p4beta1/image_annotator.rb b/owl-bot-staging/google-cloud-vision-v1p4beta1/proto_docs/google/cloud/vision/v1p4beta1/image_annotator.rb deleted file mode 100644 index fa038f2bcdd0..000000000000 --- a/owl-bot-staging/google-cloud-vision-v1p4beta1/proto_docs/google/cloud/vision/v1p4beta1/image_annotator.rb +++ /dev/null @@ -1,994 +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 Vision - module V1p4beta1 - # The type of Google Cloud Vision API detection to perform, and the maximum - # number of results to return for that type. Multiple `Feature` objects can - # be specified in the `features` list. - # @!attribute [rw] type - # @return [::Google::Cloud::Vision::V1p4beta1::Feature::Type] - # The feature type. - # @!attribute [rw] max_results - # @return [::Integer] - # Maximum number of results of this type. Does not apply to - # `TEXT_DETECTION`, `DOCUMENT_TEXT_DETECTION`, or `CROP_HINTS`. - # @!attribute [rw] model - # @return [::String] - # Model to use for the feature. - # Supported values: "builtin/stable" (the default if unset) and - # "builtin/latest". `DOCUMENT_TEXT_DETECTION` and `TEXT_DETECTION` also - # support "builtin/weekly" for the bleeding edge release updated weekly. - class Feature - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Type of Google Cloud Vision API feature to be extracted. - module Type - # Unspecified feature type. - TYPE_UNSPECIFIED = 0 - - # Run face detection. - FACE_DETECTION = 1 - - # Run landmark detection. - LANDMARK_DETECTION = 2 - - # Run logo detection. - LOGO_DETECTION = 3 - - # Run label detection. - LABEL_DETECTION = 4 - - # Run text detection / optical character recognition (OCR). Text detection - # is optimized for areas of text within a larger image; if the image is - # a document, use `DOCUMENT_TEXT_DETECTION` instead. - TEXT_DETECTION = 5 - - # Run dense text document OCR. Takes precedence when both - # `DOCUMENT_TEXT_DETECTION` and `TEXT_DETECTION` are present. - DOCUMENT_TEXT_DETECTION = 11 - - # Run Safe Search to detect potentially unsafe - # or undesirable content. - SAFE_SEARCH_DETECTION = 6 - - # Compute a set of image properties, such as the - # image's dominant colors. - IMAGE_PROPERTIES = 7 - - # Run crop hints. - CROP_HINTS = 9 - - # Run web detection. - WEB_DETECTION = 10 - - # Run Product Search. - PRODUCT_SEARCH = 12 - - # Run localizer for object detection. - OBJECT_LOCALIZATION = 19 - end - end - - # External image source (Google Cloud Storage or web URL image location). - # @!attribute [rw] gcs_image_uri - # @return [::String] - # **Use `image_uri` instead.** - # - # The Google Cloud Storage URI of the form - # `gs://bucket_name/object_name`. Object versioning is not supported. See - # [Google Cloud Storage Request - # URIs](https://cloud.google.com/storage/docs/reference-uris) for more info. - # @!attribute [rw] image_uri - # @return [::String] - # The URI of the source image. Can be either: - # - # 1. A Google Cloud Storage URI of the form - # `gs://bucket_name/object_name`. Object versioning is not supported. See - # [Google Cloud Storage Request - # URIs](https://cloud.google.com/storage/docs/reference-uris) for more - # info. - # - # 2. A publicly-accessible image HTTP/HTTPS URL. When fetching images from - # HTTP/HTTPS URLs, Google cannot guarantee that the request will be - # completed. Your request may fail if the specified host denies the - # request (e.g. due to request throttling or DOS prevention), or if Google - # throttles requests to the site for abuse prevention. You should not - # depend on externally-hosted images for production applications. - # - # When both `gcs_image_uri` and `image_uri` are specified, `image_uri` takes - # precedence. - class ImageSource - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Client image to perform Google Cloud Vision API tasks over. - # @!attribute [rw] content - # @return [::String] - # Image content, represented as a stream of bytes. - # Note: As with all `bytes` fields, protobuffers use a pure binary - # representation, whereas JSON representations use base64. - # @!attribute [rw] source - # @return [::Google::Cloud::Vision::V1p4beta1::ImageSource] - # Google Cloud Storage image location, or publicly-accessible image - # URL. If both `content` and `source` are provided for an image, `content` - # takes precedence and is used to perform the image annotation request. - class Image - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A face annotation object contains the results of face detection. - # @!attribute [rw] bounding_poly - # @return [::Google::Cloud::Vision::V1p4beta1::BoundingPoly] - # The bounding polygon around the face. The coordinates of the bounding box - # are in the original image's scale. - # The bounding box is computed to "frame" the face in accordance with human - # expectations. It is based on the landmarker results. - # Note that one or more x and/or y coordinates may not be generated in the - # `BoundingPoly` (the polygon will be unbounded) if only a partial face - # appears in the image to be annotated. - # @!attribute [rw] fd_bounding_poly - # @return [::Google::Cloud::Vision::V1p4beta1::BoundingPoly] - # The `fd_bounding_poly` bounding polygon is tighter than the - # `boundingPoly`, and encloses only the skin part of the face. Typically, it - # is used to eliminate the face from any image analysis that detects the - # "amount of skin" visible in an image. It is not based on the - # landmarker results, only on the initial face detection, hence - # the fd (face detection) prefix. - # @!attribute [rw] landmarks - # @return [::Array<::Google::Cloud::Vision::V1p4beta1::FaceAnnotation::Landmark>] - # Detected face landmarks. - # @!attribute [rw] roll_angle - # @return [::Float] - # Roll angle, which indicates the amount of clockwise/anti-clockwise rotation - # of the face relative to the image vertical about the axis perpendicular to - # the face. Range [-180,180]. - # @!attribute [rw] pan_angle - # @return [::Float] - # Yaw angle, which indicates the leftward/rightward angle that the face is - # pointing relative to the vertical plane perpendicular to the image. Range - # [-180,180]. - # @!attribute [rw] tilt_angle - # @return [::Float] - # Pitch angle, which indicates the upwards/downwards angle that the face is - # pointing relative to the image's horizontal plane. Range [-180,180]. - # @!attribute [rw] detection_confidence - # @return [::Float] - # Detection confidence. Range [0, 1]. - # @!attribute [rw] landmarking_confidence - # @return [::Float] - # Face landmarking confidence. Range [0, 1]. - # @!attribute [rw] joy_likelihood - # @return [::Google::Cloud::Vision::V1p4beta1::Likelihood] - # Joy likelihood. - # @!attribute [rw] sorrow_likelihood - # @return [::Google::Cloud::Vision::V1p4beta1::Likelihood] - # Sorrow likelihood. - # @!attribute [rw] anger_likelihood - # @return [::Google::Cloud::Vision::V1p4beta1::Likelihood] - # Anger likelihood. - # @!attribute [rw] surprise_likelihood - # @return [::Google::Cloud::Vision::V1p4beta1::Likelihood] - # Surprise likelihood. - # @!attribute [rw] under_exposed_likelihood - # @return [::Google::Cloud::Vision::V1p4beta1::Likelihood] - # Under-exposed likelihood. - # @!attribute [rw] blurred_likelihood - # @return [::Google::Cloud::Vision::V1p4beta1::Likelihood] - # Blurred likelihood. - # @!attribute [rw] headwear_likelihood - # @return [::Google::Cloud::Vision::V1p4beta1::Likelihood] - # Headwear likelihood. - # @!attribute [rw] recognition_result - # @return [::Array<::Google::Cloud::Vision::V1p4beta1::FaceRecognitionResult>] - # Additional recognition information. Only computed if - # image_context.face_recognition_params is provided, **and** a match is found - # to a {::Google::Cloud::Vision::V1p4beta1::Celebrity Celebrity} in the input - # [CelebritySet][google.cloud.vision.v1p4beta1.CelebritySet]. This field is - # sorted in order of decreasing confidence values. - class FaceAnnotation - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # A face-specific landmark (for example, a face feature). - # @!attribute [rw] type - # @return [::Google::Cloud::Vision::V1p4beta1::FaceAnnotation::Landmark::Type] - # Face landmark type. - # @!attribute [rw] position - # @return [::Google::Cloud::Vision::V1p4beta1::Position] - # Face landmark position. - class Landmark - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Face landmark (feature) type. - # Left and right are defined from the vantage of the viewer of the image - # without considering mirror projections typical of photos. So, `LEFT_EYE`, - # typically, is the person's right eye. - module Type - # Unknown face landmark detected. Should not be filled. - UNKNOWN_LANDMARK = 0 - - # Left eye. - LEFT_EYE = 1 - - # Right eye. - RIGHT_EYE = 2 - - # Left of left eyebrow. - LEFT_OF_LEFT_EYEBROW = 3 - - # Right of left eyebrow. - RIGHT_OF_LEFT_EYEBROW = 4 - - # Left of right eyebrow. - LEFT_OF_RIGHT_EYEBROW = 5 - - # Right of right eyebrow. - RIGHT_OF_RIGHT_EYEBROW = 6 - - # Midpoint between eyes. - MIDPOINT_BETWEEN_EYES = 7 - - # Nose tip. - NOSE_TIP = 8 - - # Upper lip. - UPPER_LIP = 9 - - # Lower lip. - LOWER_LIP = 10 - - # Mouth left. - MOUTH_LEFT = 11 - - # Mouth right. - MOUTH_RIGHT = 12 - - # Mouth center. - MOUTH_CENTER = 13 - - # Nose, bottom right. - NOSE_BOTTOM_RIGHT = 14 - - # Nose, bottom left. - NOSE_BOTTOM_LEFT = 15 - - # Nose, bottom center. - NOSE_BOTTOM_CENTER = 16 - - # Left eye, top boundary. - LEFT_EYE_TOP_BOUNDARY = 17 - - # Left eye, right corner. - LEFT_EYE_RIGHT_CORNER = 18 - - # Left eye, bottom boundary. - LEFT_EYE_BOTTOM_BOUNDARY = 19 - - # Left eye, left corner. - LEFT_EYE_LEFT_CORNER = 20 - - # Right eye, top boundary. - RIGHT_EYE_TOP_BOUNDARY = 21 - - # Right eye, right corner. - RIGHT_EYE_RIGHT_CORNER = 22 - - # Right eye, bottom boundary. - RIGHT_EYE_BOTTOM_BOUNDARY = 23 - - # Right eye, left corner. - RIGHT_EYE_LEFT_CORNER = 24 - - # Left eyebrow, upper midpoint. - LEFT_EYEBROW_UPPER_MIDPOINT = 25 - - # Right eyebrow, upper midpoint. - RIGHT_EYEBROW_UPPER_MIDPOINT = 26 - - # Left ear tragion. - LEFT_EAR_TRAGION = 27 - - # Right ear tragion. - RIGHT_EAR_TRAGION = 28 - - # Left eye pupil. - LEFT_EYE_PUPIL = 29 - - # Right eye pupil. - RIGHT_EYE_PUPIL = 30 - - # Forehead glabella. - FOREHEAD_GLABELLA = 31 - - # Chin gnathion. - CHIN_GNATHION = 32 - - # Chin left gonion. - CHIN_LEFT_GONION = 33 - - # Chin right gonion. - CHIN_RIGHT_GONION = 34 - end - end - end - - # Detected entity location information. - # @!attribute [rw] lat_lng - # @return [::Google::Type::LatLng] - # lat/long location coordinates. - class LocationInfo - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A `Property` consists of a user-supplied name/value pair. - # @!attribute [rw] name - # @return [::String] - # Name of the property. - # @!attribute [rw] value - # @return [::String] - # Value of the property. - # @!attribute [rw] uint64_value - # @return [::Integer] - # Value of numeric properties. - class Property - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Set of detected entity features. - # @!attribute [rw] mid - # @return [::String] - # Opaque entity ID. Some IDs may be available in - # [Google Knowledge Graph Search - # API](https://developers.google.com/knowledge-graph/). - # @!attribute [rw] locale - # @return [::String] - # The language code for the locale in which the entity textual - # `description` is expressed. - # @!attribute [rw] description - # @return [::String] - # Entity textual description, expressed in its `locale` language. - # @!attribute [rw] score - # @return [::Float] - # Overall score of the result. Range [0, 1]. - # @!attribute [rw] confidence - # @deprecated This field is deprecated and may be removed in the next major version update. - # @return [::Float] - # **Deprecated. Use `score` instead.** - # The accuracy of the entity detection in an image. - # For example, for an image in which the "Eiffel Tower" entity is detected, - # this field represents the confidence that there is a tower in the query - # image. Range [0, 1]. - # @!attribute [rw] topicality - # @return [::Float] - # The relevancy of the ICA (Image Content Annotation) label to the - # image. For example, the relevancy of "tower" is likely higher to an image - # containing the detected "Eiffel Tower" than to an image containing a - # detected distant towering building, even though the confidence that - # there is a tower in each image may be the same. Range [0, 1]. - # @!attribute [rw] bounding_poly - # @return [::Google::Cloud::Vision::V1p4beta1::BoundingPoly] - # Image region to which this entity belongs. Not produced - # for `LABEL_DETECTION` features. - # @!attribute [rw] locations - # @return [::Array<::Google::Cloud::Vision::V1p4beta1::LocationInfo>] - # The location information for the detected entity. Multiple - # `LocationInfo` elements can be present because one location may - # indicate the location of the scene in the image, and another location - # may indicate the location of the place where the image was taken. - # Location information is usually present for landmarks. - # @!attribute [rw] properties - # @return [::Array<::Google::Cloud::Vision::V1p4beta1::Property>] - # Some entities may have optional user-supplied `Property` (name/value) - # fields, such a score or string that qualifies the entity. - class EntityAnnotation - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Set of detected objects with bounding boxes. - # @!attribute [rw] mid - # @return [::String] - # Object ID that should align with EntityAnnotation mid. - # @!attribute [rw] language_code - # @return [::String] - # The BCP-47 language code, such as "en-US" or "sr-Latn". For more - # information, see - # http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. - # @!attribute [rw] name - # @return [::String] - # Object name, expressed in its `language_code` language. - # @!attribute [rw] score - # @return [::Float] - # Score of the result. Range [0, 1]. - # @!attribute [rw] bounding_poly - # @return [::Google::Cloud::Vision::V1p4beta1::BoundingPoly] - # Image region to which this object belongs. This must be populated. - class LocalizedObjectAnnotation - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Set of features pertaining to the image, computed by computer vision - # methods over safe-search verticals (for example, adult, spoof, medical, - # violence). - # @!attribute [rw] adult - # @return [::Google::Cloud::Vision::V1p4beta1::Likelihood] - # Represents the adult content likelihood for the image. Adult content may - # contain elements such as nudity, pornographic images or cartoons, or - # sexual activities. - # @!attribute [rw] spoof - # @return [::Google::Cloud::Vision::V1p4beta1::Likelihood] - # Spoof likelihood. The likelihood that an modification - # was made to the image's canonical version to make it appear - # funny or offensive. - # @!attribute [rw] medical - # @return [::Google::Cloud::Vision::V1p4beta1::Likelihood] - # Likelihood that this is a medical image. - # @!attribute [rw] violence - # @return [::Google::Cloud::Vision::V1p4beta1::Likelihood] - # Likelihood that this image contains violent content. - # @!attribute [rw] racy - # @return [::Google::Cloud::Vision::V1p4beta1::Likelihood] - # Likelihood that the request image contains racy content. Racy content may - # include (but is not limited to) skimpy or sheer clothing, strategically - # covered nudity, lewd or provocative poses, or close-ups of sensitive - # body areas. - class SafeSearchAnnotation - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Rectangle determined by min and max `LatLng` pairs. - # @!attribute [rw] min_lat_lng - # @return [::Google::Type::LatLng] - # Min lat/long pair. - # @!attribute [rw] max_lat_lng - # @return [::Google::Type::LatLng] - # Max lat/long pair. - class LatLongRect - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Color information consists of RGB channels, score, and the fraction of - # the image that the color occupies in the image. - # @!attribute [rw] color - # @return [::Google::Type::Color] - # RGB components of the color. - # @!attribute [rw] score - # @return [::Float] - # Image-specific score for this color. Value in range [0, 1]. - # @!attribute [rw] pixel_fraction - # @return [::Float] - # The fraction of pixels the color occupies in the image. - # Value in range [0, 1]. - class ColorInfo - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Set of dominant colors and their corresponding scores. - # @!attribute [rw] colors - # @return [::Array<::Google::Cloud::Vision::V1p4beta1::ColorInfo>] - # RGB color values with their score and pixel fraction. - class DominantColorsAnnotation - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Stores image properties, such as dominant colors. - # @!attribute [rw] dominant_colors - # @return [::Google::Cloud::Vision::V1p4beta1::DominantColorsAnnotation] - # If present, dominant colors completed successfully. - class ImageProperties - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Single crop hint that is used to generate a new crop when serving an image. - # @!attribute [rw] bounding_poly - # @return [::Google::Cloud::Vision::V1p4beta1::BoundingPoly] - # The bounding polygon for the crop region. The coordinates of the bounding - # box are in the original image's scale. - # @!attribute [rw] confidence - # @return [::Float] - # Confidence of this being a salient region. Range [0, 1]. - # @!attribute [rw] importance_fraction - # @return [::Float] - # Fraction of importance of this salient region with respect to the original - # image. - class CropHint - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Set of crop hints that are used to generate new crops when serving images. - # @!attribute [rw] crop_hints - # @return [::Array<::Google::Cloud::Vision::V1p4beta1::CropHint>] - # Crop hint results. - class CropHintsAnnotation - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Parameters for crop hints annotation request. - # @!attribute [rw] aspect_ratios - # @return [::Array<::Float>] - # Aspect ratios in floats, representing the ratio of the width to the height - # of the image. For example, if the desired aspect ratio is 4/3, the - # corresponding float value should be 1.33333. If not specified, the - # best possible crop is returned. The number of provided aspect ratios is - # limited to a maximum of 16; any aspect ratios provided after the 16th are - # ignored. - class CropHintsParams - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Parameters for web detection request. - # @!attribute [rw] include_geo_results - # @return [::Boolean] - # Whether to include results derived from the geo information in the image. - class WebDetectionParams - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Parameters for text detections. This is used to control TEXT_DETECTION and - # DOCUMENT_TEXT_DETECTION features. - # @!attribute [rw] enable_text_detection_confidence_score - # @return [::Boolean] - # By default, Cloud Vision API only includes confidence score for - # DOCUMENT_TEXT_DETECTION result. Set the flag to true to include confidence - # score for TEXT_DETECTION as well. - # @!attribute [rw] advanced_ocr_options - # @return [::Array<::String>] - # A list of advanced OCR options to fine-tune OCR behavior. - class TextDetectionParams - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Image context and/or feature-specific parameters. - # @!attribute [rw] lat_long_rect - # @return [::Google::Cloud::Vision::V1p4beta1::LatLongRect] - # Not used. - # @!attribute [rw] language_hints - # @return [::Array<::String>] - # List of languages to use for TEXT_DETECTION. In most cases, an empty value - # yields the best results since it enables automatic language detection. For - # languages based on the Latin alphabet, setting `language_hints` is not - # needed. In rare cases, when the language of the text in the image is known, - # setting a hint will help get better results (although it will be a - # significant hindrance if the hint is wrong). Text detection returns an - # error if one or more of the specified languages is not one of the - # [supported languages](https://cloud.google.com/vision/docs/languages). - # @!attribute [rw] crop_hints_params - # @return [::Google::Cloud::Vision::V1p4beta1::CropHintsParams] - # Parameters for crop hints annotation request. - # @!attribute [rw] face_recognition_params - # @return [::Google::Cloud::Vision::V1p4beta1::FaceRecognitionParams] - # Parameters for face recognition. - # @!attribute [rw] product_search_params - # @return [::Google::Cloud::Vision::V1p4beta1::ProductSearchParams] - # Parameters for product search. - # @!attribute [rw] web_detection_params - # @return [::Google::Cloud::Vision::V1p4beta1::WebDetectionParams] - # Parameters for web detection. - # @!attribute [rw] text_detection_params - # @return [::Google::Cloud::Vision::V1p4beta1::TextDetectionParams] - # Parameters for text detection and document text detection. - class ImageContext - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request for performing Google Cloud Vision API tasks over a user-provided - # image, with user-requested features, and with context information. - # @!attribute [rw] image - # @return [::Google::Cloud::Vision::V1p4beta1::Image] - # The image to be processed. - # @!attribute [rw] features - # @return [::Array<::Google::Cloud::Vision::V1p4beta1::Feature>] - # Requested features. - # @!attribute [rw] image_context - # @return [::Google::Cloud::Vision::V1p4beta1::ImageContext] - # Additional context that may accompany the image. - class AnnotateImageRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # If an image was produced from a file (e.g. a PDF), this message gives - # information about the source of that image. - # @!attribute [rw] uri - # @return [::String] - # The URI of the file used to produce the image. - # @!attribute [rw] page_number - # @return [::Integer] - # If the file was a PDF or TIFF, this field gives the page number within - # the file used to produce the image. - class ImageAnnotationContext - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response to an image annotation request. - # @!attribute [rw] face_annotations - # @return [::Array<::Google::Cloud::Vision::V1p4beta1::FaceAnnotation>] - # If present, face detection has completed successfully. - # @!attribute [rw] landmark_annotations - # @return [::Array<::Google::Cloud::Vision::V1p4beta1::EntityAnnotation>] - # If present, landmark detection has completed successfully. - # @!attribute [rw] logo_annotations - # @return [::Array<::Google::Cloud::Vision::V1p4beta1::EntityAnnotation>] - # If present, logo detection has completed successfully. - # @!attribute [rw] label_annotations - # @return [::Array<::Google::Cloud::Vision::V1p4beta1::EntityAnnotation>] - # If present, label detection has completed successfully. - # @!attribute [rw] localized_object_annotations - # @return [::Array<::Google::Cloud::Vision::V1p4beta1::LocalizedObjectAnnotation>] - # If present, localized object detection has completed successfully. - # This will be sorted descending by confidence score. - # @!attribute [rw] text_annotations - # @return [::Array<::Google::Cloud::Vision::V1p4beta1::EntityAnnotation>] - # If present, text (OCR) detection has completed successfully. - # @!attribute [rw] full_text_annotation - # @return [::Google::Cloud::Vision::V1p4beta1::TextAnnotation] - # If present, text (OCR) detection or document (OCR) text detection has - # completed successfully. - # This annotation provides the structural hierarchy for the OCR detected - # text. - # @!attribute [rw] safe_search_annotation - # @return [::Google::Cloud::Vision::V1p4beta1::SafeSearchAnnotation] - # If present, safe-search annotation has completed successfully. - # @!attribute [rw] image_properties_annotation - # @return [::Google::Cloud::Vision::V1p4beta1::ImageProperties] - # If present, image properties were extracted successfully. - # @!attribute [rw] crop_hints_annotation - # @return [::Google::Cloud::Vision::V1p4beta1::CropHintsAnnotation] - # If present, crop hints have completed successfully. - # @!attribute [rw] web_detection - # @return [::Google::Cloud::Vision::V1p4beta1::WebDetection] - # If present, web detection has completed successfully. - # @!attribute [rw] product_search_results - # @return [::Google::Cloud::Vision::V1p4beta1::ProductSearchResults] - # If present, product search has completed successfully. - # @!attribute [rw] error - # @return [::Google::Rpc::Status] - # If set, represents the error message for the operation. - # Note that filled-in image annotations are guaranteed to be - # correct, even when `error` is set. - # @!attribute [rw] context - # @return [::Google::Cloud::Vision::V1p4beta1::ImageAnnotationContext] - # If present, contextual information is needed to understand where this image - # comes from. - class AnnotateImageResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Multiple image annotation requests are batched into a single service call. - # @!attribute [rw] requests - # @return [::Array<::Google::Cloud::Vision::V1p4beta1::AnnotateImageRequest>] - # Required. Individual image annotation requests for this batch. - class BatchAnnotateImagesRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response to a batch image annotation request. - # @!attribute [rw] responses - # @return [::Array<::Google::Cloud::Vision::V1p4beta1::AnnotateImageResponse>] - # Individual responses to image annotation requests within the batch. - class BatchAnnotateImagesResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A request to annotate one single file, e.g. a PDF, TIFF or GIF file. - # @!attribute [rw] input_config - # @return [::Google::Cloud::Vision::V1p4beta1::InputConfig] - # Required. Information about the input file. - # @!attribute [rw] features - # @return [::Array<::Google::Cloud::Vision::V1p4beta1::Feature>] - # Required. Requested features. - # @!attribute [rw] image_context - # @return [::Google::Cloud::Vision::V1p4beta1::ImageContext] - # Additional context that may accompany the image(s) in the file. - # @!attribute [rw] pages - # @return [::Array<::Integer>] - # Pages of the file to perform image annotation. - # - # Pages starts from 1, we assume the first page of the file is page 1. - # At most 5 pages are supported per request. Pages can be negative. - # - # Page 1 means the first page. - # Page 2 means the second page. - # Page -1 means the last page. - # Page -2 means the second to the last page. - # - # If the file is GIF instead of PDF or TIFF, page refers to GIF frames. - # - # If this field is empty, by default the service performs image annotation - # for the first 5 pages of the file. - class AnnotateFileRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response to a single file annotation request. A file may contain one or more - # images, which individually have their own responses. - # @!attribute [rw] input_config - # @return [::Google::Cloud::Vision::V1p4beta1::InputConfig] - # Information about the file for which this response is generated. - # @!attribute [rw] responses - # @return [::Array<::Google::Cloud::Vision::V1p4beta1::AnnotateImageResponse>] - # Individual responses to images found within the file. This field will be - # empty if the `error` field is set. - # @!attribute [rw] total_pages - # @return [::Integer] - # This field gives the total number of pages in the file. - # @!attribute [rw] error - # @return [::Google::Rpc::Status] - # If set, represents the error message for the failed request. The - # `responses` field will not be set in this case. - class AnnotateFileResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A list of requests to annotate files using the BatchAnnotateFiles API. - # @!attribute [rw] requests - # @return [::Array<::Google::Cloud::Vision::V1p4beta1::AnnotateFileRequest>] - # Required. The list of file annotation requests. Right now we support only - # one AnnotateFileRequest in BatchAnnotateFilesRequest. - class BatchAnnotateFilesRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A list of file annotation responses. - # @!attribute [rw] responses - # @return [::Array<::Google::Cloud::Vision::V1p4beta1::AnnotateFileResponse>] - # The list of file annotation responses, each response corresponding to each - # AnnotateFileRequest in BatchAnnotateFilesRequest. - class BatchAnnotateFilesResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # An offline file annotation request. - # @!attribute [rw] input_config - # @return [::Google::Cloud::Vision::V1p4beta1::InputConfig] - # Required. Information about the input file. - # @!attribute [rw] features - # @return [::Array<::Google::Cloud::Vision::V1p4beta1::Feature>] - # Required. Requested features. - # @!attribute [rw] image_context - # @return [::Google::Cloud::Vision::V1p4beta1::ImageContext] - # Additional context that may accompany the image(s) in the file. - # @!attribute [rw] output_config - # @return [::Google::Cloud::Vision::V1p4beta1::OutputConfig] - # Required. The desired output location and metadata (e.g. format). - class AsyncAnnotateFileRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The response for a single offline file annotation request. - # @!attribute [rw] output_config - # @return [::Google::Cloud::Vision::V1p4beta1::OutputConfig] - # The output location and metadata from AsyncAnnotateFileRequest. - class AsyncAnnotateFileResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request for async image annotation for a list of images. - # @!attribute [rw] requests - # @return [::Array<::Google::Cloud::Vision::V1p4beta1::AnnotateImageRequest>] - # Required. Individual image annotation requests for this batch. - # @!attribute [rw] output_config - # @return [::Google::Cloud::Vision::V1p4beta1::OutputConfig] - # Required. The desired output location and metadata (e.g. format). - class AsyncBatchAnnotateImagesRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response to an async batch image annotation request. - # @!attribute [rw] output_config - # @return [::Google::Cloud::Vision::V1p4beta1::OutputConfig] - # The output location and metadata from AsyncBatchAnnotateImagesRequest. - class AsyncBatchAnnotateImagesResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Multiple async file annotation requests are batched into a single service - # call. - # @!attribute [rw] requests - # @return [::Array<::Google::Cloud::Vision::V1p4beta1::AsyncAnnotateFileRequest>] - # Required. Individual async file annotation requests for this batch. - class AsyncBatchAnnotateFilesRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response to an async batch file annotation request. - # @!attribute [rw] responses - # @return [::Array<::Google::Cloud::Vision::V1p4beta1::AsyncAnnotateFileResponse>] - # The list of file annotation responses, one for each request in - # AsyncBatchAnnotateFilesRequest. - class AsyncBatchAnnotateFilesResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The desired input location and metadata. - # @!attribute [rw] gcs_source - # @return [::Google::Cloud::Vision::V1p4beta1::GcsSource] - # The Google Cloud Storage location to read the input from. - # @!attribute [rw] content - # @return [::String] - # File content, represented as a stream of bytes. - # Note: As with all `bytes` fields, protobuffers use a pure binary - # representation, whereas JSON representations use base64. - # - # Currently, this field only works for BatchAnnotateFiles requests. It does - # not work for AsyncBatchAnnotateFiles requests. - # @!attribute [rw] mime_type - # @return [::String] - # The type of the file. Currently only "application/pdf", "image/tiff" and - # "image/gif" are supported. Wildcards are not supported. - class InputConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The desired output location and metadata. - # @!attribute [rw] gcs_destination - # @return [::Google::Cloud::Vision::V1p4beta1::GcsDestination] - # The Google Cloud Storage location to write the output(s) to. - # @!attribute [rw] batch_size - # @return [::Integer] - # The max number of response protos to put into each output JSON file on - # Google Cloud Storage. - # The valid range is [1, 100]. If not specified, the default value is 20. - # - # For example, for one pdf file with 100 pages, 100 response protos will - # be generated. If `batch_size` = 20, then 5 json files each - # containing 20 response protos will be written under the prefix - # `gcs_destination`.`uri`. - # - # Currently, batch_size only applies to GcsDestination, with potential future - # support for other output configurations. - class OutputConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The Google Cloud Storage location where the input will be read from. - # @!attribute [rw] uri - # @return [::String] - # Google Cloud Storage URI for the input file. This must only be a - # Google Cloud Storage object. Wildcards are not currently supported. - class GcsSource - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The Google Cloud Storage location where the output will be written to. - # @!attribute [rw] uri - # @return [::String] - # Google Cloud Storage URI prefix where the results will be stored. Results - # will be in JSON format and preceded by its corresponding input URI prefix. - # This field can either represent a gcs file prefix or gcs directory. In - # either case, the uri should be unique because in order to get all of the - # output files, you will need to do a wildcard gcs search on the uri prefix - # you provide. - # - # Examples: - # - # * File Prefix: gs://bucket-name/here/filenameprefix The output files - # will be created in gs://bucket-name/here/ and the names of the - # output files will begin with "filenameprefix". - # - # * Directory Prefix: gs://bucket-name/some/location/ The output files - # will be created in gs://bucket-name/some/location/ and the names of the - # output files could be anything because there was no filename prefix - # specified. - # - # If multiple outputs, each response is still AnnotateFileResponse, each of - # which contains some subset of the full list of AnnotateImageResponse. - # Multiple outputs can happen if, for example, the output JSON is too large - # and overflows into multiple sharded files. - class GcsDestination - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Contains metadata for the BatchAnnotateImages operation. - # @!attribute [rw] state - # @return [::Google::Cloud::Vision::V1p4beta1::OperationMetadata::State] - # Current state of the batch operation. - # @!attribute [rw] create_time - # @return [::Google::Protobuf::Timestamp] - # The time when the batch request was received. - # @!attribute [rw] update_time - # @return [::Google::Protobuf::Timestamp] - # The time when the operation result was last updated. - class OperationMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Batch operation states. - module State - # Invalid. - STATE_UNSPECIFIED = 0 - - # Request is received. - CREATED = 1 - - # Request is actively being processed. - RUNNING = 2 - - # The batch processing is done. - DONE = 3 - - # The batch processing was cancelled. - CANCELLED = 4 - end - end - - # A bucketized representation of likelihood, which is intended to give clients - # highly stable results across model upgrades. - module Likelihood - # Unknown likelihood. - UNKNOWN = 0 - - # It is very unlikely. - VERY_UNLIKELY = 1 - - # It is unlikely. - UNLIKELY = 2 - - # It is possible. - POSSIBLE = 3 - - # It is likely. - LIKELY = 4 - - # It is very likely. - VERY_LIKELY = 5 - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-vision-v1p4beta1/proto_docs/google/cloud/vision/v1p4beta1/product_search.rb b/owl-bot-staging/google-cloud-vision-v1p4beta1/proto_docs/google/cloud/vision/v1p4beta1/product_search.rb deleted file mode 100644 index 55b889f7a52d..000000000000 --- a/owl-bot-staging/google-cloud-vision-v1p4beta1/proto_docs/google/cloud/vision/v1p4beta1/product_search.rb +++ /dev/null @@ -1,136 +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 Vision - module V1p4beta1 - # Parameters for a product search request. - # @!attribute [rw] bounding_poly - # @return [::Google::Cloud::Vision::V1p4beta1::BoundingPoly] - # The bounding polygon around the area of interest in the image. - # If it is not specified, system discretion will be applied. - # @!attribute [rw] product_set - # @return [::String] - # The resource name of a - # {::Google::Cloud::Vision::V1p4beta1::ProductSet ProductSet} to be searched for - # similar images. - # - # Format is: - # `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`. - # @!attribute [rw] product_categories - # @return [::Array<::String>] - # The list of product categories to search in. Currently, we only consider - # the first category, and either "homegoods-v2", "apparel-v2", "toys-v2", - # "packagedgoods-v1", or "general-v1" should be specified. The legacy - # categories "homegoods", "apparel", and "toys" are still supported but will - # be deprecated. For new products, please use "homegoods-v2", "apparel-v2", - # or "toys-v2" for better product search accuracy. It is recommended to - # migrate existing products to these categories as well. - # @!attribute [rw] filter - # @return [::String] - # The filtering expression. This can be used to restrict search results based - # on Product labels. We currently support an AND of OR of key-value - # expressions, where each expression within an OR must have the same key. An - # '=' should be used to connect the key and value. - # - # For example, "(color = red OR color = blue) AND brand = Google" is - # acceptable, but "(color = red OR brand = Google)" is not acceptable. - # "color: red" is not acceptable because it uses a ':' instead of an '='. - class ProductSearchParams - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Results for a product search request. - # @!attribute [rw] index_time - # @return [::Google::Protobuf::Timestamp] - # Timestamp of the index which provided these results. Products added to the - # product set and products removed from the product set after this time are - # not reflected in the current results. - # @!attribute [rw] results - # @return [::Array<::Google::Cloud::Vision::V1p4beta1::ProductSearchResults::Result>] - # List of results, one for each product match. - # @!attribute [rw] product_grouped_results - # @return [::Array<::Google::Cloud::Vision::V1p4beta1::ProductSearchResults::GroupedResult>] - # List of results grouped by products detected in the query image. Each entry - # corresponds to one bounding polygon in the query image, and contains the - # matching products specific to that region. There may be duplicate product - # matches in the union of all the per-product results. - class ProductSearchResults - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Information about a product. - # @!attribute [rw] product - # @return [::Google::Cloud::Vision::V1p4beta1::Product] - # The Product. - # @!attribute [rw] score - # @return [::Float] - # A confidence level on the match, ranging from 0 (no confidence) to - # 1 (full confidence). - # @!attribute [rw] image - # @return [::String] - # The resource name of the image from the product that is the closest match - # to the query. - class Result - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Prediction for what the object in the bounding box is. - # @!attribute [rw] mid - # @return [::String] - # Object ID that should align with EntityAnnotation mid. - # @!attribute [rw] language_code - # @return [::String] - # The BCP-47 language code, such as "en-US" or "sr-Latn". For more - # information, see - # http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. - # @!attribute [rw] name - # @return [::String] - # Object name, expressed in its `language_code` language. - # @!attribute [rw] score - # @return [::Float] - # Score of the result. Range [0, 1]. - class ObjectAnnotation - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Information about the products similar to a single product in a query - # image. - # @!attribute [rw] bounding_poly - # @return [::Google::Cloud::Vision::V1p4beta1::BoundingPoly] - # The bounding polygon around the product detected in the query image. - # @!attribute [rw] results - # @return [::Array<::Google::Cloud::Vision::V1p4beta1::ProductSearchResults::Result>] - # List of results, one for each product match. - # @!attribute [rw] object_annotations - # @return [::Array<::Google::Cloud::Vision::V1p4beta1::ProductSearchResults::ObjectAnnotation>] - # List of generic predictions for the object in the bounding box. - class GroupedResult - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-vision-v1p4beta1/proto_docs/google/cloud/vision/v1p4beta1/product_search_service.rb b/owl-bot-staging/google-cloud-vision-v1p4beta1/proto_docs/google/cloud/vision/v1p4beta1/product_search_service.rb deleted file mode 100644 index 6d0a05fd15a8..000000000000 --- a/owl-bot-staging/google-cloud-vision-v1p4beta1/proto_docs/google/cloud/vision/v1p4beta1/product_search_service.rb +++ /dev/null @@ -1,680 +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 Vision - module V1p4beta1 - # A Product contains ReferenceImages. - # @!attribute [rw] name - # @return [::String] - # The resource name of the product. - # - # Format is: - # `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`. - # - # This field is ignored when creating a product. - # @!attribute [rw] display_name - # @return [::String] - # The user-provided name for this Product. Must not be empty. Must be at most - # 4096 characters long. - # @!attribute [rw] description - # @return [::String] - # User-provided metadata to be stored with this product. Must be at most 4096 - # characters long. - # @!attribute [rw] product_category - # @return [::String] - # Immutable. The category for the product identified by the reference image. - # This should be either "homegoods-v2", "apparel-v2", or "toys-v2". The - # legacy categories "homegoods", "apparel", and "toys" are still supported, - # but these should not be used for new products. - # @!attribute [rw] product_labels - # @return [::Array<::Google::Cloud::Vision::V1p4beta1::Product::KeyValue>] - # Key-value pairs that can be attached to a product. At query time, - # constraints can be specified based on the product_labels. - # - # Note that integer values can be provided as strings, e.g. "1199". Only - # strings with integer values can match a range-based restriction which is - # to be supported soon. - # - # Multiple values can be assigned to the same key. One product may have up to - # 500 product_labels. - # - # Notice that the total number of distinct product_labels over all products - # in one ProductSet cannot exceed 1M, otherwise the product search pipeline - # will refuse to work for that ProductSet. - class Product - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # A product label represented as a key-value pair. - # @!attribute [rw] key - # @return [::String] - # The key of the label attached to the product. Cannot be empty and cannot - # exceed 128 bytes. - # @!attribute [rw] value - # @return [::String] - # The value of the label attached to the product. Cannot be empty and - # cannot exceed 128 bytes. - class KeyValue - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # A ProductSet contains Products. A ProductSet can contain a maximum of 1 - # million reference images. If the limit is exceeded, periodic indexing will - # fail. - # @!attribute [rw] name - # @return [::String] - # The resource name of the ProductSet. - # - # Format is: - # `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`. - # - # This field is ignored when creating a ProductSet. - # @!attribute [rw] display_name - # @return [::String] - # The user-provided name for this ProductSet. Must not be empty. Must be at - # most 4096 characters long. - # @!attribute [r] index_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time at which this ProductSet was last indexed. Query - # results will reflect all updates before this time. If this ProductSet has - # never been indexed, this timestamp is the default value - # "1970-01-01T00:00:00Z". - # - # This field is ignored when creating a ProductSet. - # @!attribute [r] index_error - # @return [::Google::Rpc::Status] - # Output only. If there was an error with indexing the product set, the field - # is populated. - # - # This field is ignored when creating a ProductSet. - class ProductSet - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A `ReferenceImage` represents a product image and its associated metadata, - # such as bounding boxes. - # @!attribute [rw] name - # @return [::String] - # The resource name of the reference image. - # - # Format is: - # - # `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID`. - # - # This field is ignored when creating a reference image. - # @!attribute [rw] uri - # @return [::String] - # Required. The Google Cloud Storage URI of the reference image. - # - # The URI must start with `gs://`. - # @!attribute [rw] bounding_polys - # @return [::Array<::Google::Cloud::Vision::V1p4beta1::BoundingPoly>] - # Optional. Bounding polygons around the areas of interest in the reference - # image. If this field is empty, the system will try to detect regions of - # interest. At most 10 bounding polygons will be used. - # - # The provided shape is converted into a non-rotated rectangle. Once - # converted, the small edge of the rectangle must be greater than or equal - # to 300 pixels. The aspect ratio must be 1:4 or less (i.e. 1:3 is ok; 1:5 - # is not). - class ReferenceImage - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for the `CreateProduct` method. - # @!attribute [rw] parent - # @return [::String] - # Required. The project in which the Product should be created. - # - # Format is - # `projects/PROJECT_ID/locations/LOC_ID`. - # @!attribute [rw] product - # @return [::Google::Cloud::Vision::V1p4beta1::Product] - # Required. The product to create. - # @!attribute [rw] product_id - # @return [::String] - # A user-supplied resource id for this Product. If set, the server will - # attempt to use this value as the resource id. If it is already in use, an - # error is returned with code ALREADY_EXISTS. Must be at most 128 characters - # long. It cannot contain the character `/`. - class CreateProductRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for the `ListProducts` method. - # @!attribute [rw] parent - # @return [::String] - # Required. The project OR ProductSet from which Products should be listed. - # - # Format: - # `projects/PROJECT_ID/locations/LOC_ID` - # @!attribute [rw] page_size - # @return [::Integer] - # The maximum number of items to return. Default 10, maximum 100. - # @!attribute [rw] page_token - # @return [::String] - # The next_page_token returned from a previous List request, if any. - class ListProductsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for the `ListProducts` method. - # @!attribute [rw] products - # @return [::Array<::Google::Cloud::Vision::V1p4beta1::Product>] - # List of products. - # @!attribute [rw] next_page_token - # @return [::String] - # Token to retrieve the next page of results, or empty if there are no more - # results in the list. - class ListProductsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for the `GetProduct` method. - # @!attribute [rw] name - # @return [::String] - # Required. Resource name of the Product to get. - # - # Format is: - # `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID` - class GetProductRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for the `UpdateProduct` method. - # @!attribute [rw] product - # @return [::Google::Cloud::Vision::V1p4beta1::Product] - # Required. The Product resource which replaces the one on the server. - # product.name is immutable. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # The {::Google::Protobuf::FieldMask FieldMask} that specifies which fields - # to update. - # If update_mask isn't specified, all mutable fields are to be updated. - # Valid mask paths include `product_labels`, `display_name`, and - # `description`. - class UpdateProductRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for the `DeleteProduct` method. - # @!attribute [rw] name - # @return [::String] - # Required. Resource name of product to delete. - # - # Format is: - # `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID` - class DeleteProductRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for the `CreateProductSet` method. - # @!attribute [rw] parent - # @return [::String] - # Required. The project in which the ProductSet should be created. - # - # Format is `projects/PROJECT_ID/locations/LOC_ID`. - # @!attribute [rw] product_set - # @return [::Google::Cloud::Vision::V1p4beta1::ProductSet] - # Required. The ProductSet to create. - # @!attribute [rw] product_set_id - # @return [::String] - # A user-supplied resource id for this ProductSet. If set, the server will - # attempt to use this value as the resource id. If it is already in use, an - # error is returned with code ALREADY_EXISTS. Must be at most 128 characters - # long. It cannot contain the character `/`. - class CreateProductSetRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for the `ListProductSets` method. - # @!attribute [rw] parent - # @return [::String] - # Required. The project from which ProductSets should be listed. - # - # Format is `projects/PROJECT_ID/locations/LOC_ID`. - # @!attribute [rw] page_size - # @return [::Integer] - # The maximum number of items to return. Default 10, maximum 100. - # @!attribute [rw] page_token - # @return [::String] - # The next_page_token returned from a previous List request, if any. - class ListProductSetsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for the `ListProductSets` method. - # @!attribute [rw] product_sets - # @return [::Array<::Google::Cloud::Vision::V1p4beta1::ProductSet>] - # List of ProductSets. - # @!attribute [rw] next_page_token - # @return [::String] - # Token to retrieve the next page of results, or empty if there are no more - # results in the list. - class ListProductSetsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for the `GetProductSet` method. - # @!attribute [rw] name - # @return [::String] - # Required. Resource name of the ProductSet to get. - # - # Format is: - # `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID` - class GetProductSetRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for the `UpdateProductSet` method. - # @!attribute [rw] product_set - # @return [::Google::Cloud::Vision::V1p4beta1::ProductSet] - # Required. The ProductSet resource which replaces the one on the server. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # The {::Google::Protobuf::FieldMask FieldMask} that specifies which fields to - # update. - # If update_mask isn't specified, all mutable fields are to be updated. - # Valid mask path is `display_name`. - class UpdateProductSetRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for the `DeleteProductSet` method. - # @!attribute [rw] name - # @return [::String] - # Required. Resource name of the ProductSet to delete. - # - # Format is: - # `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID` - class DeleteProductSetRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for the `CreateReferenceImage` method. - # @!attribute [rw] parent - # @return [::String] - # Required. Resource name of the product in which to create the reference - # image. - # - # Format is - # `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`. - # @!attribute [rw] reference_image - # @return [::Google::Cloud::Vision::V1p4beta1::ReferenceImage] - # Required. The reference image to create. - # If an image ID is specified, it is ignored. - # @!attribute [rw] reference_image_id - # @return [::String] - # A user-supplied resource id for the ReferenceImage to be added. If set, - # the server will attempt to use this value as the resource id. If it is - # already in use, an error is returned with code ALREADY_EXISTS. Must be at - # most 128 characters long. It cannot contain the character `/`. - class CreateReferenceImageRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for the `ListReferenceImages` method. - # @!attribute [rw] parent - # @return [::String] - # Required. Resource name of the product containing the reference images. - # - # Format is - # `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`. - # @!attribute [rw] page_size - # @return [::Integer] - # The maximum number of items to return. Default 10, maximum 100. - # @!attribute [rw] page_token - # @return [::String] - # A token identifying a page of results to be returned. This is the value - # of `nextPageToken` returned in a previous reference image list request. - # - # Defaults to the first page if not specified. - class ListReferenceImagesRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for the `ListReferenceImages` method. - # @!attribute [rw] reference_images - # @return [::Array<::Google::Cloud::Vision::V1p4beta1::ReferenceImage>] - # The list of reference images. - # @!attribute [rw] page_size - # @return [::Integer] - # The maximum number of items to return. Default 10, maximum 100. - # @!attribute [rw] next_page_token - # @return [::String] - # The next_page_token returned from a previous List request, if any. - class ListReferenceImagesResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for the `GetReferenceImage` method. - # @!attribute [rw] name - # @return [::String] - # Required. The resource name of the ReferenceImage to get. - # - # Format is: - # - # `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID`. - class GetReferenceImageRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for the `DeleteReferenceImage` method. - # @!attribute [rw] name - # @return [::String] - # Required. The resource name of the reference image to delete. - # - # Format is: - # - # `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID` - class DeleteReferenceImageRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for the `AddProductToProductSet` method. - # @!attribute [rw] name - # @return [::String] - # Required. The resource name for the ProductSet to modify. - # - # Format is: - # `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID` - # @!attribute [rw] product - # @return [::String] - # Required. The resource name for the Product to be added to this ProductSet. - # - # Format is: - # `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID` - class AddProductToProductSetRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for the `RemoveProductFromProductSet` method. - # @!attribute [rw] name - # @return [::String] - # Required. The resource name for the ProductSet to modify. - # - # Format is: - # `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID` - # @!attribute [rw] product - # @return [::String] - # Required. The resource name for the Product to be removed from this - # ProductSet. - # - # Format is: - # `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID` - class RemoveProductFromProductSetRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for the `ListProductsInProductSet` method. - # @!attribute [rw] name - # @return [::String] - # Required. The ProductSet resource for which to retrieve Products. - # - # Format is: - # `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID` - # @!attribute [rw] page_size - # @return [::Integer] - # The maximum number of items to return. Default 10, maximum 100. - # @!attribute [rw] page_token - # @return [::String] - # The next_page_token returned from a previous List request, if any. - class ListProductsInProductSetRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for the `ListProductsInProductSet` method. - # @!attribute [rw] products - # @return [::Array<::Google::Cloud::Vision::V1p4beta1::Product>] - # The list of Products. - # @!attribute [rw] next_page_token - # @return [::String] - # Token to retrieve the next page of results, or empty if there are no more - # results in the list. - class ListProductsInProductSetResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The Google Cloud Storage location for a csv file which preserves a list of - # ImportProductSetRequests in each line. - # @!attribute [rw] csv_file_uri - # @return [::String] - # The Google Cloud Storage URI of the input csv file. - # - # The URI must start with `gs://`. - # - # The format of the input csv file should be one image per line. - # In each line, there are 8 columns. - # - # 1. image-uri - # 2. image-id - # 3. product-set-id - # 4. product-id - # 5. product-category - # 6. product-display-name - # 7. labels - # 8. bounding-poly - # - # The `image-uri`, `product-set-id`, `product-id`, and `product-category` - # columns are required. All other columns are optional. - # - # If the `ProductSet` or `Product` specified by the `product-set-id` and - # `product-id` values does not exist, then the system will create a new - # `ProductSet` or `Product` for the image. In this case, the - # `product-display-name` column refers to - # {::Google::Cloud::Vision::V1p4beta1::Product#display_name display_name}, the - # `product-category` column refers to - # {::Google::Cloud::Vision::V1p4beta1::Product#product_category product_category}, - # and the `labels` column refers to - # {::Google::Cloud::Vision::V1p4beta1::Product#product_labels product_labels}. - # - # The `image-id` column is optional but must be unique if provided. If it is - # empty, the system will automatically assign a unique id to the image. - # - # The `product-display-name` column is optional. If it is empty, the system - # sets the {::Google::Cloud::Vision::V1p4beta1::Product#display_name display_name} - # field for the product to a space (" "). You can update the `display_name` - # later by using the API. - # - # If a `Product` with the specified `product-id` already exists, then the - # system ignores the `product-display-name`, `product-category`, and `labels` - # columns. - # - # The `labels` column (optional) is a line containing a list of - # comma-separated key-value pairs, in the following format: - # - # "key_1=value_1,key_2=value_2,...,key_n=value_n" - # - # The `bounding-poly` column (optional) identifies one region of - # interest from the image in the same manner as `CreateReferenceImage`. If - # you do not specify the `bounding-poly` column, then the system will try to - # detect regions of interest automatically. - # - # At most one `bounding-poly` column is allowed per line. If the image - # contains multiple regions of interest, add a line to the CSV file that - # includes the same product information, and the `bounding-poly` values for - # each region of interest. - # - # The `bounding-poly` column must contain an even number of comma-separated - # numbers, in the format "p1_x,p1_y,p2_x,p2_y,...,pn_x,pn_y". Use - # non-negative integers for absolute bounding polygons, and float values - # in [0, 1] for normalized bounding polygons. - # - # The system will resize the image if the image resolution is too - # large to process (larger than 20MP). - class ImportProductSetsGcsSource - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The input content for the `ImportProductSets` method. - # @!attribute [rw] gcs_source - # @return [::Google::Cloud::Vision::V1p4beta1::ImportProductSetsGcsSource] - # The Google Cloud Storage location for a csv file which preserves a list - # of ImportProductSetRequests in each line. - class ImportProductSetsInputConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for the `ImportProductSets` method. - # @!attribute [rw] parent - # @return [::String] - # Required. The project in which the ProductSets should be imported. - # - # Format is `projects/PROJECT_ID/locations/LOC_ID`. - # @!attribute [rw] input_config - # @return [::Google::Cloud::Vision::V1p4beta1::ImportProductSetsInputConfig] - # Required. The input content for the list of requests. - class ImportProductSetsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for the `ImportProductSets` method. - # - # This message is returned by the - # google.longrunning.Operations.GetOperation - # method in the returned - # {::Google::Longrunning::Operation#response google.longrunning.Operation.response} - # field. - # @!attribute [rw] reference_images - # @return [::Array<::Google::Cloud::Vision::V1p4beta1::ReferenceImage>] - # The list of reference_images that are imported successfully. - # @!attribute [rw] statuses - # @return [::Array<::Google::Rpc::Status>] - # The rpc status for each ImportProductSet request, including both successes - # and errors. - # - # The number of statuses here matches the number of lines in the csv file, - # and statuses[i] stores the success or failure status of processing the i-th - # line of the csv, starting from line 0. - class ImportProductSetsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Metadata for the batch operations such as the current state. - # - # This is included in the `metadata` field of the `Operation` returned by the - # `GetOperation` call of the `google::longrunning::Operations` service. - # @!attribute [rw] state - # @return [::Google::Cloud::Vision::V1p4beta1::BatchOperationMetadata::State] - # The current state of the batch operation. - # @!attribute [rw] submit_time - # @return [::Google::Protobuf::Timestamp] - # The time when the batch request was submitted to the server. - # @!attribute [rw] end_time - # @return [::Google::Protobuf::Timestamp] - # The time when the batch request is finished and - # {::Google::Longrunning::Operation#done google.longrunning.Operation.done} is - # set to true. - class BatchOperationMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Enumerates the possible states that the batch request can be in. - module State - # Invalid. - STATE_UNSPECIFIED = 0 - - # Request is actively being processed. - PROCESSING = 1 - - # The request is done and at least one item has been successfully - # processed. - SUCCESSFUL = 2 - - # The request is done and no item has been successfully processed. - FAILED = 3 - - # The request is done after the longrunning.Operations.CancelOperation has - # been called by the user. Any records that were processed before the - # cancel command are output as specified in the request. - CANCELLED = 4 - end - end - - # Config to control which ProductSet contains the Products to be deleted. - # @!attribute [rw] product_set_id - # @return [::String] - # The ProductSet that contains the Products to delete. If a Product is a - # member of product_set_id in addition to other ProductSets, the Product will - # still be deleted. - class ProductSetPurgeConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for the `PurgeProducts` method. - # @!attribute [rw] product_set_purge_config - # @return [::Google::Cloud::Vision::V1p4beta1::ProductSetPurgeConfig] - # Specify which ProductSet contains the Products to be deleted. - # - # Note: The following fields are mutually exclusive: `product_set_purge_config`, `delete_orphan_products`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] delete_orphan_products - # @return [::Boolean] - # If delete_orphan_products is true, all Products that are not in any - # ProductSet will be deleted. - # - # Note: The following fields are mutually exclusive: `delete_orphan_products`, `product_set_purge_config`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] parent - # @return [::String] - # Required. The project and location in which the Products should be deleted. - # - # Format is `projects/PROJECT_ID/locations/LOC_ID`. - # @!attribute [rw] force - # @return [::Boolean] - # The default value is false. Override this value to true to actually perform - # the purge. - class PurgeProductsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-vision-v1p4beta1/proto_docs/google/cloud/vision/v1p4beta1/text_annotation.rb b/owl-bot-staging/google-cloud-vision-v1p4beta1/proto_docs/google/cloud/vision/v1p4beta1/text_annotation.rb deleted file mode 100644 index 197b12ffc815..000000000000 --- a/owl-bot-staging/google-cloud-vision-v1p4beta1/proto_docs/google/cloud/vision/v1p4beta1/text_annotation.rb +++ /dev/null @@ -1,286 +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 Vision - module V1p4beta1 - # TextAnnotation contains a structured representation of OCR extracted text. - # The hierarchy of an OCR extracted text structure is like this: - # TextAnnotation -> Page -> Block -> Paragraph -> Word -> Symbol - # Each structural component, starting from Page, may further have their own - # properties. Properties describe detected languages, breaks etc.. Please refer - # to the - # {::Google::Cloud::Vision::V1p4beta1::TextAnnotation::TextProperty TextAnnotation.TextProperty} - # message definition below for more detail. - # @!attribute [rw] pages - # @return [::Array<::Google::Cloud::Vision::V1p4beta1::Page>] - # List of pages detected by OCR. - # @!attribute [rw] text - # @return [::String] - # UTF-8 text detected on the pages. - class TextAnnotation - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Detected language for a structural component. - # @!attribute [rw] language_code - # @return [::String] - # The BCP-47 language code, such as "en-US" or "sr-Latn". For more - # information, see - # http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. - # @!attribute [rw] confidence - # @return [::Float] - # Confidence of detected language. Range [0, 1]. - class DetectedLanguage - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Detected start or end of a structural component. - # @!attribute [rw] type - # @return [::Google::Cloud::Vision::V1p4beta1::TextAnnotation::DetectedBreak::BreakType] - # Detected break type. - # @!attribute [rw] is_prefix - # @return [::Boolean] - # True if break prepends the element. - class DetectedBreak - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Enum to denote the type of break found. New line, space etc. - module BreakType - # Unknown break label type. - UNKNOWN = 0 - - # Regular space. - SPACE = 1 - - # Sure space (very wide). - SURE_SPACE = 2 - - # Line-wrapping break. - EOL_SURE_SPACE = 3 - - # End-line hyphen that is not present in text; does not co-occur with - # `SPACE`, `LEADER_SPACE`, or `LINE_BREAK`. - HYPHEN = 4 - - # Line break that ends a paragraph. - LINE_BREAK = 5 - end - end - - # Additional information detected on the structural component. - # @!attribute [rw] detected_languages - # @return [::Array<::Google::Cloud::Vision::V1p4beta1::TextAnnotation::DetectedLanguage>] - # A list of detected languages together with confidence. - # @!attribute [rw] detected_break - # @return [::Google::Cloud::Vision::V1p4beta1::TextAnnotation::DetectedBreak] - # Detected start or end of a text segment. - class TextProperty - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Detected page from OCR. - # @!attribute [rw] property - # @return [::Google::Cloud::Vision::V1p4beta1::TextAnnotation::TextProperty] - # Additional information detected on the page. - # @!attribute [rw] width - # @return [::Integer] - # Page width. For PDFs the unit is points. For images (including - # TIFFs) the unit is pixels. - # @!attribute [rw] height - # @return [::Integer] - # Page height. For PDFs the unit is points. For images (including - # TIFFs) the unit is pixels. - # @!attribute [rw] blocks - # @return [::Array<::Google::Cloud::Vision::V1p4beta1::Block>] - # List of blocks of text, images etc on this page. - # @!attribute [rw] confidence - # @return [::Float] - # Confidence of the OCR results on the page. Range [0, 1]. - class Page - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Logical element on the page. - # @!attribute [rw] property - # @return [::Google::Cloud::Vision::V1p4beta1::TextAnnotation::TextProperty] - # Additional information detected for the block. - # @!attribute [rw] bounding_box - # @return [::Google::Cloud::Vision::V1p4beta1::BoundingPoly] - # The bounding box for the block. - # The vertices are in the order of top-left, top-right, bottom-right, - # bottom-left. When a rotation of the bounding box is detected the rotation - # is represented as around the top-left corner as defined when the text is - # read in the 'natural' orientation. - # For example: - # - # * when the text is horizontal it might look like: - # - # 0----1 - # | | - # 3----2 - # - # * when it's rotated 180 degrees around the top-left corner it becomes: - # - # 2----3 - # | | - # 1----0 - # - # and the vertex order will still be (0, 1, 2, 3). - # @!attribute [rw] paragraphs - # @return [::Array<::Google::Cloud::Vision::V1p4beta1::Paragraph>] - # List of paragraphs in this block (if this blocks is of type text). - # @!attribute [rw] block_type - # @return [::Google::Cloud::Vision::V1p4beta1::Block::BlockType] - # Detected block type (text, image etc) for this block. - # @!attribute [rw] confidence - # @return [::Float] - # Confidence of the OCR results on the block. Range [0, 1]. - class Block - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Type of a block (text, image etc) as identified by OCR. - module BlockType - # Unknown block type. - UNKNOWN = 0 - - # Regular text block. - TEXT = 1 - - # Table block. - TABLE = 2 - - # Image block. - PICTURE = 3 - - # Horizontal/vertical line box. - RULER = 4 - - # Barcode block. - BARCODE = 5 - end - end - - # Structural unit of text representing a number of words in certain order. - # @!attribute [rw] property - # @return [::Google::Cloud::Vision::V1p4beta1::TextAnnotation::TextProperty] - # Additional information detected for the paragraph. - # @!attribute [rw] bounding_box - # @return [::Google::Cloud::Vision::V1p4beta1::BoundingPoly] - # The bounding box for the paragraph. - # The vertices are in the order of top-left, top-right, bottom-right, - # bottom-left. When a rotation of the bounding box is detected the rotation - # is represented as around the top-left corner as defined when the text is - # read in the 'natural' orientation. - # For example: - # * when the text is horizontal it might look like: - # 0----1 - # | | - # 3----2 - # * when it's rotated 180 degrees around the top-left corner it becomes: - # 2----3 - # | | - # 1----0 - # and the vertex order will still be (0, 1, 2, 3). - # @!attribute [rw] words - # @return [::Array<::Google::Cloud::Vision::V1p4beta1::Word>] - # List of all words in this paragraph. - # @!attribute [rw] confidence - # @return [::Float] - # Confidence of the OCR results for the paragraph. Range [0, 1]. - class Paragraph - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A word representation. - # @!attribute [rw] property - # @return [::Google::Cloud::Vision::V1p4beta1::TextAnnotation::TextProperty] - # Additional information detected for the word. - # @!attribute [rw] bounding_box - # @return [::Google::Cloud::Vision::V1p4beta1::BoundingPoly] - # The bounding box for the word. - # The vertices are in the order of top-left, top-right, bottom-right, - # bottom-left. When a rotation of the bounding box is detected the rotation - # is represented as around the top-left corner as defined when the text is - # read in the 'natural' orientation. - # For example: - # * when the text is horizontal it might look like: - # 0----1 - # | | - # 3----2 - # * when it's rotated 180 degrees around the top-left corner it becomes: - # 2----3 - # | | - # 1----0 - # and the vertex order will still be (0, 1, 2, 3). - # @!attribute [rw] symbols - # @return [::Array<::Google::Cloud::Vision::V1p4beta1::Symbol>] - # List of symbols in the word. - # The order of the symbols follows the natural reading order. - # @!attribute [rw] confidence - # @return [::Float] - # Confidence of the OCR results for the word. Range [0, 1]. - class Word - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A single symbol representation. - # @!attribute [rw] property - # @return [::Google::Cloud::Vision::V1p4beta1::TextAnnotation::TextProperty] - # Additional information detected for the symbol. - # @!attribute [rw] bounding_box - # @return [::Google::Cloud::Vision::V1p4beta1::BoundingPoly] - # The bounding box for the symbol. - # The vertices are in the order of top-left, top-right, bottom-right, - # bottom-left. When a rotation of the bounding box is detected the rotation - # is represented as around the top-left corner as defined when the text is - # read in the 'natural' orientation. - # For example: - # * when the text is horizontal it might look like: - # 0----1 - # | | - # 3----2 - # * when it's rotated 180 degrees around the top-left corner it becomes: - # 2----3 - # | | - # 1----0 - # and the vertex order will still be (0, 1, 2, 3). - # @!attribute [rw] text - # @return [::String] - # The actual UTF-8 representation of the symbol. - # @!attribute [rw] confidence - # @return [::Float] - # Confidence of the OCR results for the symbol. Range [0, 1]. - class Symbol - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-vision-v1p4beta1/proto_docs/google/cloud/vision/v1p4beta1/web_detection.rb b/owl-bot-staging/google-cloud-vision-v1p4beta1/proto_docs/google/cloud/vision/v1p4beta1/web_detection.rb deleted file mode 100644 index 963a7f738570..000000000000 --- a/owl-bot-staging/google-cloud-vision-v1p4beta1/proto_docs/google/cloud/vision/v1p4beta1/web_detection.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 Cloud - module Vision - module V1p4beta1 - # Relevant information for the image from the Internet. - # @!attribute [rw] web_entities - # @return [::Array<::Google::Cloud::Vision::V1p4beta1::WebDetection::WebEntity>] - # Deduced entities from similar images on the Internet. - # @!attribute [rw] full_matching_images - # @return [::Array<::Google::Cloud::Vision::V1p4beta1::WebDetection::WebImage>] - # Fully matching images from the Internet. - # Can include resized copies of the query image. - # @!attribute [rw] partial_matching_images - # @return [::Array<::Google::Cloud::Vision::V1p4beta1::WebDetection::WebImage>] - # Partial matching images from the Internet. - # Those images are similar enough to share some key-point features. For - # example an original image will likely have partial matching for its crops. - # @!attribute [rw] pages_with_matching_images - # @return [::Array<::Google::Cloud::Vision::V1p4beta1::WebDetection::WebPage>] - # Web pages containing the matching images from the Internet. - # @!attribute [rw] visually_similar_images - # @return [::Array<::Google::Cloud::Vision::V1p4beta1::WebDetection::WebImage>] - # The visually similar image results. - # @!attribute [rw] best_guess_labels - # @return [::Array<::Google::Cloud::Vision::V1p4beta1::WebDetection::WebLabel>] - # The service's best guess as to the topic of the request image. - # Inferred from similar images on the open web. - class WebDetection - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Entity deduced from similar images on the Internet. - # @!attribute [rw] entity_id - # @return [::String] - # Opaque entity ID. - # @!attribute [rw] score - # @return [::Float] - # Overall relevancy score for the entity. - # Not normalized and not comparable across different image queries. - # @!attribute [rw] description - # @return [::String] - # Canonical description of the entity, in English. - class WebEntity - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Metadata for online images. - # @!attribute [rw] url - # @return [::String] - # The result image URL. - # @!attribute [rw] score - # @return [::Float] - # (Deprecated) Overall relevancy score for the image. - class WebImage - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Metadata for web pages. - # @!attribute [rw] url - # @return [::String] - # The result web page URL. - # @!attribute [rw] score - # @return [::Float] - # (Deprecated) Overall relevancy score for the web page. - # @!attribute [rw] page_title - # @return [::String] - # Title for the web page, may contain HTML markups. - # @!attribute [rw] full_matching_images - # @return [::Array<::Google::Cloud::Vision::V1p4beta1::WebDetection::WebImage>] - # Fully matching images on the page. - # Can include resized copies of the query image. - # @!attribute [rw] partial_matching_images - # @return [::Array<::Google::Cloud::Vision::V1p4beta1::WebDetection::WebImage>] - # Partial matching images on the page. - # Those images are similar enough to share some key-point features. For - # example an original image will likely have partial matching for its - # crops. - class WebPage - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Label to provide extra metadata for the web detection. - # @!attribute [rw] label - # @return [::String] - # Label for extra metadata. - # @!attribute [rw] language_code - # @return [::String] - # The BCP-47 language code for `label`, such as "en-US" or "sr-Latn". - # For more information, see - # http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. - class WebLabel - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-vision-v1p4beta1/proto_docs/google/longrunning/operations.rb b/owl-bot-staging/google-cloud-vision-v1p4beta1/proto_docs/google/longrunning/operations.rb deleted file mode 100644 index 7a757f512165..000000000000 --- a/owl-bot-staging/google-cloud-vision-v1p4beta1/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-vision-v1p4beta1/proto_docs/google/protobuf/any.rb b/owl-bot-staging/google-cloud-vision-v1p4beta1/proto_docs/google/protobuf/any.rb deleted file mode 100644 index 58691995f02e..000000000000 --- a/owl-bot-staging/google-cloud-vision-v1p4beta1/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-vision-v1p4beta1/proto_docs/google/protobuf/duration.rb b/owl-bot-staging/google-cloud-vision-v1p4beta1/proto_docs/google/protobuf/duration.rb deleted file mode 100644 index ea59f1f91daf..000000000000 --- a/owl-bot-staging/google-cloud-vision-v1p4beta1/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-vision-v1p4beta1/proto_docs/google/protobuf/empty.rb b/owl-bot-staging/google-cloud-vision-v1p4beta1/proto_docs/google/protobuf/empty.rb deleted file mode 100644 index 83e4481834a6..000000000000 --- a/owl-bot-staging/google-cloud-vision-v1p4beta1/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-vision-v1p4beta1/proto_docs/google/protobuf/field_mask.rb b/owl-bot-staging/google-cloud-vision-v1p4beta1/proto_docs/google/protobuf/field_mask.rb deleted file mode 100644 index 7f3ffc78601a..000000000000 --- a/owl-bot-staging/google-cloud-vision-v1p4beta1/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-vision-v1p4beta1/proto_docs/google/protobuf/timestamp.rb b/owl-bot-staging/google-cloud-vision-v1p4beta1/proto_docs/google/protobuf/timestamp.rb deleted file mode 100644 index 74352be9c58c..000000000000 --- a/owl-bot-staging/google-cloud-vision-v1p4beta1/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-vision-v1p4beta1/proto_docs/google/protobuf/wrappers.rb b/owl-bot-staging/google-cloud-vision-v1p4beta1/proto_docs/google/protobuf/wrappers.rb deleted file mode 100644 index 9a7c0269fa42..000000000000 --- a/owl-bot-staging/google-cloud-vision-v1p4beta1/proto_docs/google/protobuf/wrappers.rb +++ /dev/null @@ -1,148 +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. - # - # Not recommended for use in new APIs, but still useful for legacy APIs and - # has no plan to be removed. - # @!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. - # - # Not recommended for use in new APIs, but still useful for legacy APIs and - # has no plan to be removed. - # @!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. - # - # Not recommended for use in new APIs, but still useful for legacy APIs and - # has no plan to be removed. - # @!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. - # - # Not recommended for use in new APIs, but still useful for legacy APIs and - # has no plan to be removed. - # @!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. - # - # Not recommended for use in new APIs, but still useful for legacy APIs and - # has no plan to be removed. - # @!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. - # - # Not recommended for use in new APIs, but still useful for legacy APIs and - # has no plan to be removed. - # @!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`. - # - # Not recommended for use in new APIs, but still useful for legacy APIs and - # has no plan to be removed. - # @!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. - # - # Not recommended for use in new APIs, but still useful for legacy APIs and - # has no plan to be removed. - # @!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. - # - # Not recommended for use in new APIs, but still useful for legacy APIs and - # has no plan to be removed. - # @!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-vision-v1p4beta1/proto_docs/google/rpc/status.rb b/owl-bot-staging/google-cloud-vision-v1p4beta1/proto_docs/google/rpc/status.rb deleted file mode 100644 index c1a1c07eb2db..000000000000 --- a/owl-bot-staging/google-cloud-vision-v1p4beta1/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-vision-v1p4beta1/proto_docs/google/type/color.rb b/owl-bot-staging/google-cloud-vision-v1p4beta1/proto_docs/google/type/color.rb deleted file mode 100644 index 5728bc06bc83..000000000000 --- a/owl-bot-staging/google-cloud-vision-v1p4beta1/proto_docs/google/type/color.rb +++ /dev/null @@ -1,173 +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 color in the RGBA color space. This representation is designed - # for simplicity of conversion to and from color representations in various - # languages over compactness. For example, the fields of this representation - # can be trivially provided to the constructor of `java.awt.Color` in Java; it - # can also be trivially provided to UIColor's `+colorWithRed:green:blue:alpha` - # method in iOS; and, with just a little work, it can be easily formatted into - # a CSS `rgba()` string in JavaScript. - # - # This reference page doesn't have information about the absolute color - # space that should be used to interpret the RGB value—for example, sRGB, - # Adobe RGB, - # DCI-P3, and BT.2020. By default, applications should assume the sRGB color - # space. - # - # When color equality needs to be decided, implementations, unless documented - # otherwise, treat two colors as equal if all their red, green, blue, and alpha - # values each differ by at most `1e-5`. - # - # Example (Java): - # - # import com.google.type.Color; - # - # // ... - # public static java.awt.Color fromProto(Color protocolor) { - # float alpha = protocolor.hasAlpha() - # ? protocolor.getAlpha().getValue() - # : 1.0; - # - # return new java.awt.Color( - # protocolor.getRed(), - # protocolor.getGreen(), - # protocolor.getBlue(), - # alpha); - # } - # - # public static Color toProto(java.awt.Color color) { - # float red = (float) color.getRed(); - # float green = (float) color.getGreen(); - # float blue = (float) color.getBlue(); - # float denominator = 255.0; - # Color.Builder resultBuilder = - # Color - # .newBuilder() - # .setRed(red / denominator) - # .setGreen(green / denominator) - # .setBlue(blue / denominator); - # int alpha = color.getAlpha(); - # if (alpha != 255) { - # result.setAlpha( - # FloatValue - # .newBuilder() - # .setValue(((float) alpha) / denominator) - # .build()); - # } - # return resultBuilder.build(); - # } - # // ... - # - # Example (iOS / Obj-C): - # - # // ... - # static UIColor* fromProto(Color* protocolor) { - # float red = [protocolor red]; - # float green = [protocolor green]; - # float blue = [protocolor blue]; - # FloatValue* alpha_wrapper = [protocolor alpha]; - # float alpha = 1.0; - # if (alpha_wrapper != nil) { - # alpha = [alpha_wrapper value]; - # } - # return [UIColor colorWithRed:red green:green blue:blue alpha:alpha]; - # } - # - # static Color* toProto(UIColor* color) { - # CGFloat red, green, blue, alpha; - # if (![color getRed:&red green:&green blue:&blue alpha:&alpha]) { - # return nil; - # } - # Color* result = [[Color alloc] init]; - # [result setRed:red]; - # [result setGreen:green]; - # [result setBlue:blue]; - # if (alpha <= 0.9999) { - # [result setAlpha:floatWrapperWithValue(alpha)]; - # } - # [result autorelease]; - # return result; - # } - # // ... - # - # Example (JavaScript): - # - # // ... - # - # var protoToCssColor = function(rgb_color) { - # var redFrac = rgb_color.red || 0.0; - # var greenFrac = rgb_color.green || 0.0; - # var blueFrac = rgb_color.blue || 0.0; - # var red = Math.floor(redFrac * 255); - # var green = Math.floor(greenFrac * 255); - # var blue = Math.floor(blueFrac * 255); - # - # if (!('alpha' in rgb_color)) { - # return rgbToCssColor(red, green, blue); - # } - # - # var alphaFrac = rgb_color.alpha.value || 0.0; - # var rgbParams = [red, green, blue].join(','); - # return ['rgba(', rgbParams, ',', alphaFrac, ')'].join(''); - # }; - # - # var rgbToCssColor = function(red, green, blue) { - # var rgbNumber = new Number((red << 16) | (green << 8) | blue); - # var hexString = rgbNumber.toString(16); - # var missingZeros = 6 - hexString.length; - # var resultBuilder = ['#']; - # for (var i = 0; i < missingZeros; i++) { - # resultBuilder.push('0'); - # } - # resultBuilder.push(hexString); - # return resultBuilder.join(''); - # }; - # - # // ... - # @!attribute [rw] red - # @return [::Float] - # The amount of red in the color as a value in the interval [0, 1]. - # @!attribute [rw] green - # @return [::Float] - # The amount of green in the color as a value in the interval [0, 1]. - # @!attribute [rw] blue - # @return [::Float] - # The amount of blue in the color as a value in the interval [0, 1]. - # @!attribute [rw] alpha - # @return [::Google::Protobuf::FloatValue] - # The fraction of this color that should be applied to the pixel. That is, - # the final pixel color is defined by the equation: - # - # `pixel color = alpha * (this color) + (1.0 - alpha) * (background color)` - # - # This means that a value of 1.0 corresponds to a solid color, whereas - # a value of 0.0 corresponds to a completely transparent color. This - # uses a wrapper message rather than a simple float scalar so that it is - # possible to distinguish between a default value and the value being unset. - # If omitted, this color object is rendered as a solid color - # (as if the alpha value had been explicitly given a value of 1.0). - class Color - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-vision-v1p4beta1/proto_docs/google/type/latlng.rb b/owl-bot-staging/google-cloud-vision-v1p4beta1/proto_docs/google/type/latlng.rb deleted file mode 100644 index 593314b4cde5..000000000000 --- a/owl-bot-staging/google-cloud-vision-v1p4beta1/proto_docs/google/type/latlng.rb +++ /dev/null @@ -1,38 +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 - # An object that represents a latitude/longitude pair. This is expressed as a - # pair of doubles to represent degrees latitude and degrees longitude. Unless - # specified otherwise, this object must conform to the - # - # WGS84 standard. Values must be within normalized ranges. - # @!attribute [rw] latitude - # @return [::Float] - # The latitude in degrees. It must be in the range [-90.0, +90.0]. - # @!attribute [rw] longitude - # @return [::Float] - # The longitude in degrees. It must be in the range [-180.0, +180.0]. - class LatLng - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-vision-v1p4beta1/snippets/Gemfile b/owl-bot-staging/google-cloud-vision-v1p4beta1/snippets/Gemfile deleted file mode 100644 index fa5d3567f418..000000000000 --- a/owl-bot-staging/google-cloud-vision-v1p4beta1/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-vision-v1p4beta1", path: "../" -else - gem "google-cloud-vision-v1p4beta1" -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-vision-v1p4beta1/snippets/image_annotator/async_batch_annotate_files.rb b/owl-bot-staging/google-cloud-vision-v1p4beta1/snippets/image_annotator/async_batch_annotate_files.rb deleted file mode 100644 index dc14f0d7783a..000000000000 --- a/owl-bot-staging/google-cloud-vision-v1p4beta1/snippets/image_annotator/async_batch_annotate_files.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 vision_v1p4beta1_generated_ImageAnnotator_AsyncBatchAnnotateFiles_sync] -require "google/cloud/vision/v1p4beta1" - -## -# Snippet for the async_batch_annotate_files call in the ImageAnnotator 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::Vision::V1p4beta1::ImageAnnotator::Client#async_batch_annotate_files. -# -def async_batch_annotate_files - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Vision::V1p4beta1::ImageAnnotator::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Vision::V1p4beta1::AsyncBatchAnnotateFilesRequest.new - - # Call the async_batch_annotate_files method. - result = client.async_batch_annotate_files 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 vision_v1p4beta1_generated_ImageAnnotator_AsyncBatchAnnotateFiles_sync] diff --git a/owl-bot-staging/google-cloud-vision-v1p4beta1/snippets/image_annotator/async_batch_annotate_images.rb b/owl-bot-staging/google-cloud-vision-v1p4beta1/snippets/image_annotator/async_batch_annotate_images.rb deleted file mode 100644 index 4c982c9e0224..000000000000 --- a/owl-bot-staging/google-cloud-vision-v1p4beta1/snippets/image_annotator/async_batch_annotate_images.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 vision_v1p4beta1_generated_ImageAnnotator_AsyncBatchAnnotateImages_sync] -require "google/cloud/vision/v1p4beta1" - -## -# Snippet for the async_batch_annotate_images call in the ImageAnnotator 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::Vision::V1p4beta1::ImageAnnotator::Client#async_batch_annotate_images. -# -def async_batch_annotate_images - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Vision::V1p4beta1::ImageAnnotator::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Vision::V1p4beta1::AsyncBatchAnnotateImagesRequest.new - - # Call the async_batch_annotate_images method. - result = client.async_batch_annotate_images 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 vision_v1p4beta1_generated_ImageAnnotator_AsyncBatchAnnotateImages_sync] diff --git a/owl-bot-staging/google-cloud-vision-v1p4beta1/snippets/image_annotator/batch_annotate_files.rb b/owl-bot-staging/google-cloud-vision-v1p4beta1/snippets/image_annotator/batch_annotate_files.rb deleted file mode 100644 index 6f60270c3f43..000000000000 --- a/owl-bot-staging/google-cloud-vision-v1p4beta1/snippets/image_annotator/batch_annotate_files.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 vision_v1p4beta1_generated_ImageAnnotator_BatchAnnotateFiles_sync] -require "google/cloud/vision/v1p4beta1" - -## -# Snippet for the batch_annotate_files call in the ImageAnnotator 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::Vision::V1p4beta1::ImageAnnotator::Client#batch_annotate_files. -# -def batch_annotate_files - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Vision::V1p4beta1::ImageAnnotator::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Vision::V1p4beta1::BatchAnnotateFilesRequest.new - - # Call the batch_annotate_files method. - result = client.batch_annotate_files request - - # The returned object is of type Google::Cloud::Vision::V1p4beta1::BatchAnnotateFilesResponse. - p result -end -# [END vision_v1p4beta1_generated_ImageAnnotator_BatchAnnotateFiles_sync] diff --git a/owl-bot-staging/google-cloud-vision-v1p4beta1/snippets/image_annotator/batch_annotate_images.rb b/owl-bot-staging/google-cloud-vision-v1p4beta1/snippets/image_annotator/batch_annotate_images.rb deleted file mode 100644 index 0044519b6e1f..000000000000 --- a/owl-bot-staging/google-cloud-vision-v1p4beta1/snippets/image_annotator/batch_annotate_images.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 vision_v1p4beta1_generated_ImageAnnotator_BatchAnnotateImages_sync] -require "google/cloud/vision/v1p4beta1" - -## -# Snippet for the batch_annotate_images call in the ImageAnnotator 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::Vision::V1p4beta1::ImageAnnotator::Client#batch_annotate_images. -# -def batch_annotate_images - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Vision::V1p4beta1::ImageAnnotator::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Vision::V1p4beta1::BatchAnnotateImagesRequest.new - - # Call the batch_annotate_images method. - result = client.batch_annotate_images request - - # The returned object is of type Google::Cloud::Vision::V1p4beta1::BatchAnnotateImagesResponse. - p result -end -# [END vision_v1p4beta1_generated_ImageAnnotator_BatchAnnotateImages_sync] diff --git a/owl-bot-staging/google-cloud-vision-v1p4beta1/snippets/product_search/add_product_to_product_set.rb b/owl-bot-staging/google-cloud-vision-v1p4beta1/snippets/product_search/add_product_to_product_set.rb deleted file mode 100644 index e06f0695767b..000000000000 --- a/owl-bot-staging/google-cloud-vision-v1p4beta1/snippets/product_search/add_product_to_product_set.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 vision_v1p4beta1_generated_ProductSearch_AddProductToProductSet_sync] -require "google/cloud/vision/v1p4beta1" - -## -# Snippet for the add_product_to_product_set call in the ProductSearch 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::Vision::V1p4beta1::ProductSearch::Client#add_product_to_product_set. -# -def add_product_to_product_set - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Vision::V1p4beta1::ProductSearch::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Vision::V1p4beta1::AddProductToProductSetRequest.new - - # Call the add_product_to_product_set method. - result = client.add_product_to_product_set request - - # The returned object is of type Google::Protobuf::Empty. - p result -end -# [END vision_v1p4beta1_generated_ProductSearch_AddProductToProductSet_sync] diff --git a/owl-bot-staging/google-cloud-vision-v1p4beta1/snippets/product_search/create_product.rb b/owl-bot-staging/google-cloud-vision-v1p4beta1/snippets/product_search/create_product.rb deleted file mode 100644 index 158f2bc49f13..000000000000 --- a/owl-bot-staging/google-cloud-vision-v1p4beta1/snippets/product_search/create_product.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 vision_v1p4beta1_generated_ProductSearch_CreateProduct_sync] -require "google/cloud/vision/v1p4beta1" - -## -# Snippet for the create_product call in the ProductSearch 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::Vision::V1p4beta1::ProductSearch::Client#create_product. -# -def create_product - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Vision::V1p4beta1::ProductSearch::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Vision::V1p4beta1::CreateProductRequest.new - - # Call the create_product method. - result = client.create_product request - - # The returned object is of type Google::Cloud::Vision::V1p4beta1::Product. - p result -end -# [END vision_v1p4beta1_generated_ProductSearch_CreateProduct_sync] diff --git a/owl-bot-staging/google-cloud-vision-v1p4beta1/snippets/product_search/create_product_set.rb b/owl-bot-staging/google-cloud-vision-v1p4beta1/snippets/product_search/create_product_set.rb deleted file mode 100644 index d9f01a876438..000000000000 --- a/owl-bot-staging/google-cloud-vision-v1p4beta1/snippets/product_search/create_product_set.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 vision_v1p4beta1_generated_ProductSearch_CreateProductSet_sync] -require "google/cloud/vision/v1p4beta1" - -## -# Snippet for the create_product_set call in the ProductSearch 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::Vision::V1p4beta1::ProductSearch::Client#create_product_set. -# -def create_product_set - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Vision::V1p4beta1::ProductSearch::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Vision::V1p4beta1::CreateProductSetRequest.new - - # Call the create_product_set method. - result = client.create_product_set request - - # The returned object is of type Google::Cloud::Vision::V1p4beta1::ProductSet. - p result -end -# [END vision_v1p4beta1_generated_ProductSearch_CreateProductSet_sync] diff --git a/owl-bot-staging/google-cloud-vision-v1p4beta1/snippets/product_search/create_reference_image.rb b/owl-bot-staging/google-cloud-vision-v1p4beta1/snippets/product_search/create_reference_image.rb deleted file mode 100644 index 57b2525a94ad..000000000000 --- a/owl-bot-staging/google-cloud-vision-v1p4beta1/snippets/product_search/create_reference_image.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 vision_v1p4beta1_generated_ProductSearch_CreateReferenceImage_sync] -require "google/cloud/vision/v1p4beta1" - -## -# Snippet for the create_reference_image call in the ProductSearch 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::Vision::V1p4beta1::ProductSearch::Client#create_reference_image. -# -def create_reference_image - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Vision::V1p4beta1::ProductSearch::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Vision::V1p4beta1::CreateReferenceImageRequest.new - - # Call the create_reference_image method. - result = client.create_reference_image request - - # The returned object is of type Google::Cloud::Vision::V1p4beta1::ReferenceImage. - p result -end -# [END vision_v1p4beta1_generated_ProductSearch_CreateReferenceImage_sync] diff --git a/owl-bot-staging/google-cloud-vision-v1p4beta1/snippets/product_search/delete_product.rb b/owl-bot-staging/google-cloud-vision-v1p4beta1/snippets/product_search/delete_product.rb deleted file mode 100644 index 373d6d22946b..000000000000 --- a/owl-bot-staging/google-cloud-vision-v1p4beta1/snippets/product_search/delete_product.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 vision_v1p4beta1_generated_ProductSearch_DeleteProduct_sync] -require "google/cloud/vision/v1p4beta1" - -## -# Snippet for the delete_product call in the ProductSearch 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::Vision::V1p4beta1::ProductSearch::Client#delete_product. -# -def delete_product - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Vision::V1p4beta1::ProductSearch::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Vision::V1p4beta1::DeleteProductRequest.new - - # Call the delete_product method. - result = client.delete_product request - - # The returned object is of type Google::Protobuf::Empty. - p result -end -# [END vision_v1p4beta1_generated_ProductSearch_DeleteProduct_sync] diff --git a/owl-bot-staging/google-cloud-vision-v1p4beta1/snippets/product_search/delete_product_set.rb b/owl-bot-staging/google-cloud-vision-v1p4beta1/snippets/product_search/delete_product_set.rb deleted file mode 100644 index 5e6180d9186d..000000000000 --- a/owl-bot-staging/google-cloud-vision-v1p4beta1/snippets/product_search/delete_product_set.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 vision_v1p4beta1_generated_ProductSearch_DeleteProductSet_sync] -require "google/cloud/vision/v1p4beta1" - -## -# Snippet for the delete_product_set call in the ProductSearch 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::Vision::V1p4beta1::ProductSearch::Client#delete_product_set. -# -def delete_product_set - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Vision::V1p4beta1::ProductSearch::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Vision::V1p4beta1::DeleteProductSetRequest.new - - # Call the delete_product_set method. - result = client.delete_product_set request - - # The returned object is of type Google::Protobuf::Empty. - p result -end -# [END vision_v1p4beta1_generated_ProductSearch_DeleteProductSet_sync] diff --git a/owl-bot-staging/google-cloud-vision-v1p4beta1/snippets/product_search/delete_reference_image.rb b/owl-bot-staging/google-cloud-vision-v1p4beta1/snippets/product_search/delete_reference_image.rb deleted file mode 100644 index 4f1669b6aa92..000000000000 --- a/owl-bot-staging/google-cloud-vision-v1p4beta1/snippets/product_search/delete_reference_image.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 vision_v1p4beta1_generated_ProductSearch_DeleteReferenceImage_sync] -require "google/cloud/vision/v1p4beta1" - -## -# Snippet for the delete_reference_image call in the ProductSearch 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::Vision::V1p4beta1::ProductSearch::Client#delete_reference_image. -# -def delete_reference_image - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Vision::V1p4beta1::ProductSearch::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Vision::V1p4beta1::DeleteReferenceImageRequest.new - - # Call the delete_reference_image method. - result = client.delete_reference_image request - - # The returned object is of type Google::Protobuf::Empty. - p result -end -# [END vision_v1p4beta1_generated_ProductSearch_DeleteReferenceImage_sync] diff --git a/owl-bot-staging/google-cloud-vision-v1p4beta1/snippets/product_search/get_product.rb b/owl-bot-staging/google-cloud-vision-v1p4beta1/snippets/product_search/get_product.rb deleted file mode 100644 index e612a5636102..000000000000 --- a/owl-bot-staging/google-cloud-vision-v1p4beta1/snippets/product_search/get_product.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 vision_v1p4beta1_generated_ProductSearch_GetProduct_sync] -require "google/cloud/vision/v1p4beta1" - -## -# Snippet for the get_product call in the ProductSearch 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::Vision::V1p4beta1::ProductSearch::Client#get_product. -# -def get_product - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Vision::V1p4beta1::ProductSearch::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Vision::V1p4beta1::GetProductRequest.new - - # Call the get_product method. - result = client.get_product request - - # The returned object is of type Google::Cloud::Vision::V1p4beta1::Product. - p result -end -# [END vision_v1p4beta1_generated_ProductSearch_GetProduct_sync] diff --git a/owl-bot-staging/google-cloud-vision-v1p4beta1/snippets/product_search/get_product_set.rb b/owl-bot-staging/google-cloud-vision-v1p4beta1/snippets/product_search/get_product_set.rb deleted file mode 100644 index 7bdc62b0a92a..000000000000 --- a/owl-bot-staging/google-cloud-vision-v1p4beta1/snippets/product_search/get_product_set.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 vision_v1p4beta1_generated_ProductSearch_GetProductSet_sync] -require "google/cloud/vision/v1p4beta1" - -## -# Snippet for the get_product_set call in the ProductSearch 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::Vision::V1p4beta1::ProductSearch::Client#get_product_set. -# -def get_product_set - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Vision::V1p4beta1::ProductSearch::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Vision::V1p4beta1::GetProductSetRequest.new - - # Call the get_product_set method. - result = client.get_product_set request - - # The returned object is of type Google::Cloud::Vision::V1p4beta1::ProductSet. - p result -end -# [END vision_v1p4beta1_generated_ProductSearch_GetProductSet_sync] diff --git a/owl-bot-staging/google-cloud-vision-v1p4beta1/snippets/product_search/get_reference_image.rb b/owl-bot-staging/google-cloud-vision-v1p4beta1/snippets/product_search/get_reference_image.rb deleted file mode 100644 index 29a9933a607b..000000000000 --- a/owl-bot-staging/google-cloud-vision-v1p4beta1/snippets/product_search/get_reference_image.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 vision_v1p4beta1_generated_ProductSearch_GetReferenceImage_sync] -require "google/cloud/vision/v1p4beta1" - -## -# Snippet for the get_reference_image call in the ProductSearch 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::Vision::V1p4beta1::ProductSearch::Client#get_reference_image. -# -def get_reference_image - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Vision::V1p4beta1::ProductSearch::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Vision::V1p4beta1::GetReferenceImageRequest.new - - # Call the get_reference_image method. - result = client.get_reference_image request - - # The returned object is of type Google::Cloud::Vision::V1p4beta1::ReferenceImage. - p result -end -# [END vision_v1p4beta1_generated_ProductSearch_GetReferenceImage_sync] diff --git a/owl-bot-staging/google-cloud-vision-v1p4beta1/snippets/product_search/import_product_sets.rb b/owl-bot-staging/google-cloud-vision-v1p4beta1/snippets/product_search/import_product_sets.rb deleted file mode 100644 index b15910ae998f..000000000000 --- a/owl-bot-staging/google-cloud-vision-v1p4beta1/snippets/product_search/import_product_sets.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 vision_v1p4beta1_generated_ProductSearch_ImportProductSets_sync] -require "google/cloud/vision/v1p4beta1" - -## -# Snippet for the import_product_sets call in the ProductSearch 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::Vision::V1p4beta1::ProductSearch::Client#import_product_sets. -# -def import_product_sets - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Vision::V1p4beta1::ProductSearch::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Vision::V1p4beta1::ImportProductSetsRequest.new - - # Call the import_product_sets method. - result = client.import_product_sets 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 vision_v1p4beta1_generated_ProductSearch_ImportProductSets_sync] diff --git a/owl-bot-staging/google-cloud-vision-v1p4beta1/snippets/product_search/list_product_sets.rb b/owl-bot-staging/google-cloud-vision-v1p4beta1/snippets/product_search/list_product_sets.rb deleted file mode 100644 index 34f4ca6b2991..000000000000 --- a/owl-bot-staging/google-cloud-vision-v1p4beta1/snippets/product_search/list_product_sets.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 vision_v1p4beta1_generated_ProductSearch_ListProductSets_sync] -require "google/cloud/vision/v1p4beta1" - -## -# Snippet for the list_product_sets call in the ProductSearch 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::Vision::V1p4beta1::ProductSearch::Client#list_product_sets. -# -def list_product_sets - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Vision::V1p4beta1::ProductSearch::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Vision::V1p4beta1::ListProductSetsRequest.new - - # Call the list_product_sets method. - result = client.list_product_sets 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::Vision::V1p4beta1::ProductSet. - p item - end -end -# [END vision_v1p4beta1_generated_ProductSearch_ListProductSets_sync] diff --git a/owl-bot-staging/google-cloud-vision-v1p4beta1/snippets/product_search/list_products.rb b/owl-bot-staging/google-cloud-vision-v1p4beta1/snippets/product_search/list_products.rb deleted file mode 100644 index e500225203b9..000000000000 --- a/owl-bot-staging/google-cloud-vision-v1p4beta1/snippets/product_search/list_products.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 vision_v1p4beta1_generated_ProductSearch_ListProducts_sync] -require "google/cloud/vision/v1p4beta1" - -## -# Snippet for the list_products call in the ProductSearch 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::Vision::V1p4beta1::ProductSearch::Client#list_products. -# -def list_products - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Vision::V1p4beta1::ProductSearch::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Vision::V1p4beta1::ListProductsRequest.new - - # Call the list_products method. - result = client.list_products 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::Vision::V1p4beta1::Product. - p item - end -end -# [END vision_v1p4beta1_generated_ProductSearch_ListProducts_sync] diff --git a/owl-bot-staging/google-cloud-vision-v1p4beta1/snippets/product_search/list_products_in_product_set.rb b/owl-bot-staging/google-cloud-vision-v1p4beta1/snippets/product_search/list_products_in_product_set.rb deleted file mode 100644 index fcda8ed986ca..000000000000 --- a/owl-bot-staging/google-cloud-vision-v1p4beta1/snippets/product_search/list_products_in_product_set.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 vision_v1p4beta1_generated_ProductSearch_ListProductsInProductSet_sync] -require "google/cloud/vision/v1p4beta1" - -## -# Snippet for the list_products_in_product_set call in the ProductSearch 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::Vision::V1p4beta1::ProductSearch::Client#list_products_in_product_set. -# -def list_products_in_product_set - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Vision::V1p4beta1::ProductSearch::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Vision::V1p4beta1::ListProductsInProductSetRequest.new - - # Call the list_products_in_product_set method. - result = client.list_products_in_product_set 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::Vision::V1p4beta1::Product. - p item - end -end -# [END vision_v1p4beta1_generated_ProductSearch_ListProductsInProductSet_sync] diff --git a/owl-bot-staging/google-cloud-vision-v1p4beta1/snippets/product_search/list_reference_images.rb b/owl-bot-staging/google-cloud-vision-v1p4beta1/snippets/product_search/list_reference_images.rb deleted file mode 100644 index 48069abae603..000000000000 --- a/owl-bot-staging/google-cloud-vision-v1p4beta1/snippets/product_search/list_reference_images.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 vision_v1p4beta1_generated_ProductSearch_ListReferenceImages_sync] -require "google/cloud/vision/v1p4beta1" - -## -# Snippet for the list_reference_images call in the ProductSearch 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::Vision::V1p4beta1::ProductSearch::Client#list_reference_images. -# -def list_reference_images - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Vision::V1p4beta1::ProductSearch::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Vision::V1p4beta1::ListReferenceImagesRequest.new - - # Call the list_reference_images method. - result = client.list_reference_images 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::Vision::V1p4beta1::ReferenceImage. - p item - end -end -# [END vision_v1p4beta1_generated_ProductSearch_ListReferenceImages_sync] diff --git a/owl-bot-staging/google-cloud-vision-v1p4beta1/snippets/product_search/purge_products.rb b/owl-bot-staging/google-cloud-vision-v1p4beta1/snippets/product_search/purge_products.rb deleted file mode 100644 index 4ec390e3f796..000000000000 --- a/owl-bot-staging/google-cloud-vision-v1p4beta1/snippets/product_search/purge_products.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 vision_v1p4beta1_generated_ProductSearch_PurgeProducts_sync] -require "google/cloud/vision/v1p4beta1" - -## -# Snippet for the purge_products call in the ProductSearch 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::Vision::V1p4beta1::ProductSearch::Client#purge_products. -# -def purge_products - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Vision::V1p4beta1::ProductSearch::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Vision::V1p4beta1::PurgeProductsRequest.new - - # Call the purge_products method. - result = client.purge_products 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 vision_v1p4beta1_generated_ProductSearch_PurgeProducts_sync] diff --git a/owl-bot-staging/google-cloud-vision-v1p4beta1/snippets/product_search/remove_product_from_product_set.rb b/owl-bot-staging/google-cloud-vision-v1p4beta1/snippets/product_search/remove_product_from_product_set.rb deleted file mode 100644 index d36e76723ceb..000000000000 --- a/owl-bot-staging/google-cloud-vision-v1p4beta1/snippets/product_search/remove_product_from_product_set.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 vision_v1p4beta1_generated_ProductSearch_RemoveProductFromProductSet_sync] -require "google/cloud/vision/v1p4beta1" - -## -# Snippet for the remove_product_from_product_set call in the ProductSearch 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::Vision::V1p4beta1::ProductSearch::Client#remove_product_from_product_set. -# -def remove_product_from_product_set - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Vision::V1p4beta1::ProductSearch::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Vision::V1p4beta1::RemoveProductFromProductSetRequest.new - - # Call the remove_product_from_product_set method. - result = client.remove_product_from_product_set request - - # The returned object is of type Google::Protobuf::Empty. - p result -end -# [END vision_v1p4beta1_generated_ProductSearch_RemoveProductFromProductSet_sync] diff --git a/owl-bot-staging/google-cloud-vision-v1p4beta1/snippets/product_search/update_product.rb b/owl-bot-staging/google-cloud-vision-v1p4beta1/snippets/product_search/update_product.rb deleted file mode 100644 index a31096ff5b33..000000000000 --- a/owl-bot-staging/google-cloud-vision-v1p4beta1/snippets/product_search/update_product.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 vision_v1p4beta1_generated_ProductSearch_UpdateProduct_sync] -require "google/cloud/vision/v1p4beta1" - -## -# Snippet for the update_product call in the ProductSearch 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::Vision::V1p4beta1::ProductSearch::Client#update_product. -# -def update_product - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Vision::V1p4beta1::ProductSearch::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Vision::V1p4beta1::UpdateProductRequest.new - - # Call the update_product method. - result = client.update_product request - - # The returned object is of type Google::Cloud::Vision::V1p4beta1::Product. - p result -end -# [END vision_v1p4beta1_generated_ProductSearch_UpdateProduct_sync] diff --git a/owl-bot-staging/google-cloud-vision-v1p4beta1/snippets/product_search/update_product_set.rb b/owl-bot-staging/google-cloud-vision-v1p4beta1/snippets/product_search/update_product_set.rb deleted file mode 100644 index 563efaae0fca..000000000000 --- a/owl-bot-staging/google-cloud-vision-v1p4beta1/snippets/product_search/update_product_set.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 vision_v1p4beta1_generated_ProductSearch_UpdateProductSet_sync] -require "google/cloud/vision/v1p4beta1" - -## -# Snippet for the update_product_set call in the ProductSearch 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::Vision::V1p4beta1::ProductSearch::Client#update_product_set. -# -def update_product_set - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Vision::V1p4beta1::ProductSearch::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Vision::V1p4beta1::UpdateProductSetRequest.new - - # Call the update_product_set method. - result = client.update_product_set request - - # The returned object is of type Google::Cloud::Vision::V1p4beta1::ProductSet. - p result -end -# [END vision_v1p4beta1_generated_ProductSearch_UpdateProductSet_sync] diff --git a/owl-bot-staging/google-cloud-vision-v1p4beta1/snippets/snippet_metadata_google.cloud.vision.v1p4beta1.json b/owl-bot-staging/google-cloud-vision-v1p4beta1/snippets/snippet_metadata_google.cloud.vision.v1p4beta1.json deleted file mode 100644 index 0126262b1c05..000000000000 --- a/owl-bot-staging/google-cloud-vision-v1p4beta1/snippets/snippet_metadata_google.cloud.vision.v1p4beta1.json +++ /dev/null @@ -1,935 +0,0 @@ -{ - "client_library": { - "name": "google-cloud-vision-v1p4beta1", - "version": "", - "language": "RUBY", - "apis": [ - { - "id": "google.cloud.vision.v1p4beta1", - "version": "v1p4beta1" - } - ] - }, - "snippets": [ - { - "region_tag": "vision_v1p4beta1_generated_ProductSearch_CreateProductSet_sync", - "title": "Snippet for the create_product_set call in the ProductSearch service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Vision::V1p4beta1::ProductSearch::Client#create_product_set.", - "file": "product_search/create_product_set.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_product_set", - "full_name": "::Google::Cloud::Vision::V1p4beta1::ProductSearch::Client#create_product_set", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Vision::V1p4beta1::CreateProductSetRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Vision::V1p4beta1::ProductSet", - "client": { - "short_name": "ProductSearch::Client", - "full_name": "::Google::Cloud::Vision::V1p4beta1::ProductSearch::Client" - }, - "method": { - "short_name": "CreateProductSet", - "full_name": "google.cloud.vision.v1p4beta1.ProductSearch.CreateProductSet", - "service": { - "short_name": "ProductSearch", - "full_name": "google.cloud.vision.v1p4beta1.ProductSearch" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "vision_v1p4beta1_generated_ProductSearch_ListProductSets_sync", - "title": "Snippet for the list_product_sets call in the ProductSearch service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Vision::V1p4beta1::ProductSearch::Client#list_product_sets.", - "file": "product_search/list_product_sets.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_product_sets", - "full_name": "::Google::Cloud::Vision::V1p4beta1::ProductSearch::Client#list_product_sets", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Vision::V1p4beta1::ListProductSetsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Vision::V1p4beta1::ListProductSetsResponse", - "client": { - "short_name": "ProductSearch::Client", - "full_name": "::Google::Cloud::Vision::V1p4beta1::ProductSearch::Client" - }, - "method": { - "short_name": "ListProductSets", - "full_name": "google.cloud.vision.v1p4beta1.ProductSearch.ListProductSets", - "service": { - "short_name": "ProductSearch", - "full_name": "google.cloud.vision.v1p4beta1.ProductSearch" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "vision_v1p4beta1_generated_ProductSearch_GetProductSet_sync", - "title": "Snippet for the get_product_set call in the ProductSearch service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Vision::V1p4beta1::ProductSearch::Client#get_product_set.", - "file": "product_search/get_product_set.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_product_set", - "full_name": "::Google::Cloud::Vision::V1p4beta1::ProductSearch::Client#get_product_set", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Vision::V1p4beta1::GetProductSetRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Vision::V1p4beta1::ProductSet", - "client": { - "short_name": "ProductSearch::Client", - "full_name": "::Google::Cloud::Vision::V1p4beta1::ProductSearch::Client" - }, - "method": { - "short_name": "GetProductSet", - "full_name": "google.cloud.vision.v1p4beta1.ProductSearch.GetProductSet", - "service": { - "short_name": "ProductSearch", - "full_name": "google.cloud.vision.v1p4beta1.ProductSearch" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "vision_v1p4beta1_generated_ProductSearch_UpdateProductSet_sync", - "title": "Snippet for the update_product_set call in the ProductSearch service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Vision::V1p4beta1::ProductSearch::Client#update_product_set.", - "file": "product_search/update_product_set.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_product_set", - "full_name": "::Google::Cloud::Vision::V1p4beta1::ProductSearch::Client#update_product_set", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Vision::V1p4beta1::UpdateProductSetRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Vision::V1p4beta1::ProductSet", - "client": { - "short_name": "ProductSearch::Client", - "full_name": "::Google::Cloud::Vision::V1p4beta1::ProductSearch::Client" - }, - "method": { - "short_name": "UpdateProductSet", - "full_name": "google.cloud.vision.v1p4beta1.ProductSearch.UpdateProductSet", - "service": { - "short_name": "ProductSearch", - "full_name": "google.cloud.vision.v1p4beta1.ProductSearch" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "vision_v1p4beta1_generated_ProductSearch_DeleteProductSet_sync", - "title": "Snippet for the delete_product_set call in the ProductSearch service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Vision::V1p4beta1::ProductSearch::Client#delete_product_set.", - "file": "product_search/delete_product_set.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_product_set", - "full_name": "::Google::Cloud::Vision::V1p4beta1::ProductSearch::Client#delete_product_set", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Vision::V1p4beta1::DeleteProductSetRequest", - "name": "request" - } - ], - "result_type": "::Google::Protobuf::Empty", - "client": { - "short_name": "ProductSearch::Client", - "full_name": "::Google::Cloud::Vision::V1p4beta1::ProductSearch::Client" - }, - "method": { - "short_name": "DeleteProductSet", - "full_name": "google.cloud.vision.v1p4beta1.ProductSearch.DeleteProductSet", - "service": { - "short_name": "ProductSearch", - "full_name": "google.cloud.vision.v1p4beta1.ProductSearch" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "vision_v1p4beta1_generated_ProductSearch_CreateProduct_sync", - "title": "Snippet for the create_product call in the ProductSearch service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Vision::V1p4beta1::ProductSearch::Client#create_product.", - "file": "product_search/create_product.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_product", - "full_name": "::Google::Cloud::Vision::V1p4beta1::ProductSearch::Client#create_product", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Vision::V1p4beta1::CreateProductRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Vision::V1p4beta1::Product", - "client": { - "short_name": "ProductSearch::Client", - "full_name": "::Google::Cloud::Vision::V1p4beta1::ProductSearch::Client" - }, - "method": { - "short_name": "CreateProduct", - "full_name": "google.cloud.vision.v1p4beta1.ProductSearch.CreateProduct", - "service": { - "short_name": "ProductSearch", - "full_name": "google.cloud.vision.v1p4beta1.ProductSearch" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "vision_v1p4beta1_generated_ProductSearch_ListProducts_sync", - "title": "Snippet for the list_products call in the ProductSearch service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Vision::V1p4beta1::ProductSearch::Client#list_products.", - "file": "product_search/list_products.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_products", - "full_name": "::Google::Cloud::Vision::V1p4beta1::ProductSearch::Client#list_products", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Vision::V1p4beta1::ListProductsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Vision::V1p4beta1::ListProductsResponse", - "client": { - "short_name": "ProductSearch::Client", - "full_name": "::Google::Cloud::Vision::V1p4beta1::ProductSearch::Client" - }, - "method": { - "short_name": "ListProducts", - "full_name": "google.cloud.vision.v1p4beta1.ProductSearch.ListProducts", - "service": { - "short_name": "ProductSearch", - "full_name": "google.cloud.vision.v1p4beta1.ProductSearch" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "vision_v1p4beta1_generated_ProductSearch_GetProduct_sync", - "title": "Snippet for the get_product call in the ProductSearch service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Vision::V1p4beta1::ProductSearch::Client#get_product.", - "file": "product_search/get_product.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_product", - "full_name": "::Google::Cloud::Vision::V1p4beta1::ProductSearch::Client#get_product", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Vision::V1p4beta1::GetProductRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Vision::V1p4beta1::Product", - "client": { - "short_name": "ProductSearch::Client", - "full_name": "::Google::Cloud::Vision::V1p4beta1::ProductSearch::Client" - }, - "method": { - "short_name": "GetProduct", - "full_name": "google.cloud.vision.v1p4beta1.ProductSearch.GetProduct", - "service": { - "short_name": "ProductSearch", - "full_name": "google.cloud.vision.v1p4beta1.ProductSearch" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "vision_v1p4beta1_generated_ProductSearch_UpdateProduct_sync", - "title": "Snippet for the update_product call in the ProductSearch service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Vision::V1p4beta1::ProductSearch::Client#update_product.", - "file": "product_search/update_product.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_product", - "full_name": "::Google::Cloud::Vision::V1p4beta1::ProductSearch::Client#update_product", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Vision::V1p4beta1::UpdateProductRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Vision::V1p4beta1::Product", - "client": { - "short_name": "ProductSearch::Client", - "full_name": "::Google::Cloud::Vision::V1p4beta1::ProductSearch::Client" - }, - "method": { - "short_name": "UpdateProduct", - "full_name": "google.cloud.vision.v1p4beta1.ProductSearch.UpdateProduct", - "service": { - "short_name": "ProductSearch", - "full_name": "google.cloud.vision.v1p4beta1.ProductSearch" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "vision_v1p4beta1_generated_ProductSearch_DeleteProduct_sync", - "title": "Snippet for the delete_product call in the ProductSearch service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Vision::V1p4beta1::ProductSearch::Client#delete_product.", - "file": "product_search/delete_product.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_product", - "full_name": "::Google::Cloud::Vision::V1p4beta1::ProductSearch::Client#delete_product", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Vision::V1p4beta1::DeleteProductRequest", - "name": "request" - } - ], - "result_type": "::Google::Protobuf::Empty", - "client": { - "short_name": "ProductSearch::Client", - "full_name": "::Google::Cloud::Vision::V1p4beta1::ProductSearch::Client" - }, - "method": { - "short_name": "DeleteProduct", - "full_name": "google.cloud.vision.v1p4beta1.ProductSearch.DeleteProduct", - "service": { - "short_name": "ProductSearch", - "full_name": "google.cloud.vision.v1p4beta1.ProductSearch" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "vision_v1p4beta1_generated_ProductSearch_CreateReferenceImage_sync", - "title": "Snippet for the create_reference_image call in the ProductSearch service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Vision::V1p4beta1::ProductSearch::Client#create_reference_image.", - "file": "product_search/create_reference_image.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_reference_image", - "full_name": "::Google::Cloud::Vision::V1p4beta1::ProductSearch::Client#create_reference_image", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Vision::V1p4beta1::CreateReferenceImageRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Vision::V1p4beta1::ReferenceImage", - "client": { - "short_name": "ProductSearch::Client", - "full_name": "::Google::Cloud::Vision::V1p4beta1::ProductSearch::Client" - }, - "method": { - "short_name": "CreateReferenceImage", - "full_name": "google.cloud.vision.v1p4beta1.ProductSearch.CreateReferenceImage", - "service": { - "short_name": "ProductSearch", - "full_name": "google.cloud.vision.v1p4beta1.ProductSearch" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "vision_v1p4beta1_generated_ProductSearch_DeleteReferenceImage_sync", - "title": "Snippet for the delete_reference_image call in the ProductSearch service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Vision::V1p4beta1::ProductSearch::Client#delete_reference_image.", - "file": "product_search/delete_reference_image.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_reference_image", - "full_name": "::Google::Cloud::Vision::V1p4beta1::ProductSearch::Client#delete_reference_image", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Vision::V1p4beta1::DeleteReferenceImageRequest", - "name": "request" - } - ], - "result_type": "::Google::Protobuf::Empty", - "client": { - "short_name": "ProductSearch::Client", - "full_name": "::Google::Cloud::Vision::V1p4beta1::ProductSearch::Client" - }, - "method": { - "short_name": "DeleteReferenceImage", - "full_name": "google.cloud.vision.v1p4beta1.ProductSearch.DeleteReferenceImage", - "service": { - "short_name": "ProductSearch", - "full_name": "google.cloud.vision.v1p4beta1.ProductSearch" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "vision_v1p4beta1_generated_ProductSearch_ListReferenceImages_sync", - "title": "Snippet for the list_reference_images call in the ProductSearch service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Vision::V1p4beta1::ProductSearch::Client#list_reference_images.", - "file": "product_search/list_reference_images.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_reference_images", - "full_name": "::Google::Cloud::Vision::V1p4beta1::ProductSearch::Client#list_reference_images", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Vision::V1p4beta1::ListReferenceImagesRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Vision::V1p4beta1::ListReferenceImagesResponse", - "client": { - "short_name": "ProductSearch::Client", - "full_name": "::Google::Cloud::Vision::V1p4beta1::ProductSearch::Client" - }, - "method": { - "short_name": "ListReferenceImages", - "full_name": "google.cloud.vision.v1p4beta1.ProductSearch.ListReferenceImages", - "service": { - "short_name": "ProductSearch", - "full_name": "google.cloud.vision.v1p4beta1.ProductSearch" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "vision_v1p4beta1_generated_ProductSearch_GetReferenceImage_sync", - "title": "Snippet for the get_reference_image call in the ProductSearch service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Vision::V1p4beta1::ProductSearch::Client#get_reference_image.", - "file": "product_search/get_reference_image.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_reference_image", - "full_name": "::Google::Cloud::Vision::V1p4beta1::ProductSearch::Client#get_reference_image", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Vision::V1p4beta1::GetReferenceImageRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Vision::V1p4beta1::ReferenceImage", - "client": { - "short_name": "ProductSearch::Client", - "full_name": "::Google::Cloud::Vision::V1p4beta1::ProductSearch::Client" - }, - "method": { - "short_name": "GetReferenceImage", - "full_name": "google.cloud.vision.v1p4beta1.ProductSearch.GetReferenceImage", - "service": { - "short_name": "ProductSearch", - "full_name": "google.cloud.vision.v1p4beta1.ProductSearch" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "vision_v1p4beta1_generated_ProductSearch_AddProductToProductSet_sync", - "title": "Snippet for the add_product_to_product_set call in the ProductSearch service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Vision::V1p4beta1::ProductSearch::Client#add_product_to_product_set.", - "file": "product_search/add_product_to_product_set.rb", - "language": "RUBY", - "client_method": { - "short_name": "add_product_to_product_set", - "full_name": "::Google::Cloud::Vision::V1p4beta1::ProductSearch::Client#add_product_to_product_set", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Vision::V1p4beta1::AddProductToProductSetRequest", - "name": "request" - } - ], - "result_type": "::Google::Protobuf::Empty", - "client": { - "short_name": "ProductSearch::Client", - "full_name": "::Google::Cloud::Vision::V1p4beta1::ProductSearch::Client" - }, - "method": { - "short_name": "AddProductToProductSet", - "full_name": "google.cloud.vision.v1p4beta1.ProductSearch.AddProductToProductSet", - "service": { - "short_name": "ProductSearch", - "full_name": "google.cloud.vision.v1p4beta1.ProductSearch" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "vision_v1p4beta1_generated_ProductSearch_RemoveProductFromProductSet_sync", - "title": "Snippet for the remove_product_from_product_set call in the ProductSearch service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Vision::V1p4beta1::ProductSearch::Client#remove_product_from_product_set.", - "file": "product_search/remove_product_from_product_set.rb", - "language": "RUBY", - "client_method": { - "short_name": "remove_product_from_product_set", - "full_name": "::Google::Cloud::Vision::V1p4beta1::ProductSearch::Client#remove_product_from_product_set", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Vision::V1p4beta1::RemoveProductFromProductSetRequest", - "name": "request" - } - ], - "result_type": "::Google::Protobuf::Empty", - "client": { - "short_name": "ProductSearch::Client", - "full_name": "::Google::Cloud::Vision::V1p4beta1::ProductSearch::Client" - }, - "method": { - "short_name": "RemoveProductFromProductSet", - "full_name": "google.cloud.vision.v1p4beta1.ProductSearch.RemoveProductFromProductSet", - "service": { - "short_name": "ProductSearch", - "full_name": "google.cloud.vision.v1p4beta1.ProductSearch" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "vision_v1p4beta1_generated_ProductSearch_ListProductsInProductSet_sync", - "title": "Snippet for the list_products_in_product_set call in the ProductSearch service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Vision::V1p4beta1::ProductSearch::Client#list_products_in_product_set.", - "file": "product_search/list_products_in_product_set.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_products_in_product_set", - "full_name": "::Google::Cloud::Vision::V1p4beta1::ProductSearch::Client#list_products_in_product_set", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Vision::V1p4beta1::ListProductsInProductSetRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Vision::V1p4beta1::ListProductsInProductSetResponse", - "client": { - "short_name": "ProductSearch::Client", - "full_name": "::Google::Cloud::Vision::V1p4beta1::ProductSearch::Client" - }, - "method": { - "short_name": "ListProductsInProductSet", - "full_name": "google.cloud.vision.v1p4beta1.ProductSearch.ListProductsInProductSet", - "service": { - "short_name": "ProductSearch", - "full_name": "google.cloud.vision.v1p4beta1.ProductSearch" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "vision_v1p4beta1_generated_ProductSearch_ImportProductSets_sync", - "title": "Snippet for the import_product_sets call in the ProductSearch service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Vision::V1p4beta1::ProductSearch::Client#import_product_sets.", - "file": "product_search/import_product_sets.rb", - "language": "RUBY", - "client_method": { - "short_name": "import_product_sets", - "full_name": "::Google::Cloud::Vision::V1p4beta1::ProductSearch::Client#import_product_sets", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Vision::V1p4beta1::ImportProductSetsRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "ProductSearch::Client", - "full_name": "::Google::Cloud::Vision::V1p4beta1::ProductSearch::Client" - }, - "method": { - "short_name": "ImportProductSets", - "full_name": "google.cloud.vision.v1p4beta1.ProductSearch.ImportProductSets", - "service": { - "short_name": "ProductSearch", - "full_name": "google.cloud.vision.v1p4beta1.ProductSearch" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "vision_v1p4beta1_generated_ProductSearch_PurgeProducts_sync", - "title": "Snippet for the purge_products call in the ProductSearch service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Vision::V1p4beta1::ProductSearch::Client#purge_products.", - "file": "product_search/purge_products.rb", - "language": "RUBY", - "client_method": { - "short_name": "purge_products", - "full_name": "::Google::Cloud::Vision::V1p4beta1::ProductSearch::Client#purge_products", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Vision::V1p4beta1::PurgeProductsRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "ProductSearch::Client", - "full_name": "::Google::Cloud::Vision::V1p4beta1::ProductSearch::Client" - }, - "method": { - "short_name": "PurgeProducts", - "full_name": "google.cloud.vision.v1p4beta1.ProductSearch.PurgeProducts", - "service": { - "short_name": "ProductSearch", - "full_name": "google.cloud.vision.v1p4beta1.ProductSearch" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "vision_v1p4beta1_generated_ImageAnnotator_BatchAnnotateImages_sync", - "title": "Snippet for the batch_annotate_images call in the ImageAnnotator service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Vision::V1p4beta1::ImageAnnotator::Client#batch_annotate_images.", - "file": "image_annotator/batch_annotate_images.rb", - "language": "RUBY", - "client_method": { - "short_name": "batch_annotate_images", - "full_name": "::Google::Cloud::Vision::V1p4beta1::ImageAnnotator::Client#batch_annotate_images", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Vision::V1p4beta1::BatchAnnotateImagesRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Vision::V1p4beta1::BatchAnnotateImagesResponse", - "client": { - "short_name": "ImageAnnotator::Client", - "full_name": "::Google::Cloud::Vision::V1p4beta1::ImageAnnotator::Client" - }, - "method": { - "short_name": "BatchAnnotateImages", - "full_name": "google.cloud.vision.v1p4beta1.ImageAnnotator.BatchAnnotateImages", - "service": { - "short_name": "ImageAnnotator", - "full_name": "google.cloud.vision.v1p4beta1.ImageAnnotator" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "vision_v1p4beta1_generated_ImageAnnotator_BatchAnnotateFiles_sync", - "title": "Snippet for the batch_annotate_files call in the ImageAnnotator service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Vision::V1p4beta1::ImageAnnotator::Client#batch_annotate_files.", - "file": "image_annotator/batch_annotate_files.rb", - "language": "RUBY", - "client_method": { - "short_name": "batch_annotate_files", - "full_name": "::Google::Cloud::Vision::V1p4beta1::ImageAnnotator::Client#batch_annotate_files", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Vision::V1p4beta1::BatchAnnotateFilesRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Vision::V1p4beta1::BatchAnnotateFilesResponse", - "client": { - "short_name": "ImageAnnotator::Client", - "full_name": "::Google::Cloud::Vision::V1p4beta1::ImageAnnotator::Client" - }, - "method": { - "short_name": "BatchAnnotateFiles", - "full_name": "google.cloud.vision.v1p4beta1.ImageAnnotator.BatchAnnotateFiles", - "service": { - "short_name": "ImageAnnotator", - "full_name": "google.cloud.vision.v1p4beta1.ImageAnnotator" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "vision_v1p4beta1_generated_ImageAnnotator_AsyncBatchAnnotateImages_sync", - "title": "Snippet for the async_batch_annotate_images call in the ImageAnnotator service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Vision::V1p4beta1::ImageAnnotator::Client#async_batch_annotate_images.", - "file": "image_annotator/async_batch_annotate_images.rb", - "language": "RUBY", - "client_method": { - "short_name": "async_batch_annotate_images", - "full_name": "::Google::Cloud::Vision::V1p4beta1::ImageAnnotator::Client#async_batch_annotate_images", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Vision::V1p4beta1::AsyncBatchAnnotateImagesRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "ImageAnnotator::Client", - "full_name": "::Google::Cloud::Vision::V1p4beta1::ImageAnnotator::Client" - }, - "method": { - "short_name": "AsyncBatchAnnotateImages", - "full_name": "google.cloud.vision.v1p4beta1.ImageAnnotator.AsyncBatchAnnotateImages", - "service": { - "short_name": "ImageAnnotator", - "full_name": "google.cloud.vision.v1p4beta1.ImageAnnotator" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "vision_v1p4beta1_generated_ImageAnnotator_AsyncBatchAnnotateFiles_sync", - "title": "Snippet for the async_batch_annotate_files call in the ImageAnnotator service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Vision::V1p4beta1::ImageAnnotator::Client#async_batch_annotate_files.", - "file": "image_annotator/async_batch_annotate_files.rb", - "language": "RUBY", - "client_method": { - "short_name": "async_batch_annotate_files", - "full_name": "::Google::Cloud::Vision::V1p4beta1::ImageAnnotator::Client#async_batch_annotate_files", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Vision::V1p4beta1::AsyncBatchAnnotateFilesRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "ImageAnnotator::Client", - "full_name": "::Google::Cloud::Vision::V1p4beta1::ImageAnnotator::Client" - }, - "method": { - "short_name": "AsyncBatchAnnotateFiles", - "full_name": "google.cloud.vision.v1p4beta1.ImageAnnotator.AsyncBatchAnnotateFiles", - "service": { - "short_name": "ImageAnnotator", - "full_name": "google.cloud.vision.v1p4beta1.ImageAnnotator" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - } - ] -} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-vision-v1p4beta1/test/google/cloud/vision/v1p4beta1/image_annotator_operations_test.rb b/owl-bot-staging/google-cloud-vision-v1p4beta1/test/google/cloud/vision/v1p4beta1/image_annotator_operations_test.rb deleted file mode 100644 index 330883fe0c3c..000000000000 --- a/owl-bot-staging/google-cloud-vision-v1p4beta1/test/google/cloud/vision/v1p4beta1/image_annotator_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/vision/v1p4beta1/image_annotator_pb" -require "google/cloud/vision/v1p4beta1/image_annotator_services_pb" -require "google/cloud/vision/v1p4beta1/image_annotator" - -class ::Google::Cloud::Vision::V1p4beta1::ImageAnnotator::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::Vision::V1p4beta1::ImageAnnotator::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::Vision::V1p4beta1::ImageAnnotator::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::Vision::V1p4beta1::ImageAnnotator::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::Vision::V1p4beta1::ImageAnnotator::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::Vision::V1p4beta1::ImageAnnotator::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::Vision::V1p4beta1::ImageAnnotator::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::Vision::V1p4beta1::ImageAnnotator::Operations::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-vision-v1p4beta1/test/google/cloud/vision/v1p4beta1/image_annotator_paths_test.rb b/owl-bot-staging/google-cloud-vision-v1p4beta1/test/google/cloud/vision/v1p4beta1/image_annotator_paths_test.rb deleted file mode 100644 index fe6fddbfc65c..000000000000 --- a/owl-bot-staging/google-cloud-vision-v1p4beta1/test/google/cloud/vision/v1p4beta1/image_annotator_paths_test.rb +++ /dev/null @@ -1,55 +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/vision/v1p4beta1/image_annotator" - -class ::Google::Cloud::Vision::V1p4beta1::ImageAnnotator::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_product_set_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Vision::V1p4beta1::ImageAnnotator::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.product_set_path project: "value0", location: "value1", product_set: "value2" - assert_equal "projects/value0/locations/value1/productSets/value2", path - end - end -end diff --git a/owl-bot-staging/google-cloud-vision-v1p4beta1/test/google/cloud/vision/v1p4beta1/image_annotator_rest_test.rb b/owl-bot-staging/google-cloud-vision-v1p4beta1/test/google/cloud/vision/v1p4beta1/image_annotator_rest_test.rb deleted file mode 100644 index 8334fca2fd3d..000000000000 --- a/owl-bot-staging/google-cloud-vision-v1p4beta1/test/google/cloud/vision/v1p4beta1/image_annotator_rest_test.rb +++ /dev/null @@ -1,316 +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/vision/v1p4beta1/image_annotator_pb" -require "google/cloud/vision/v1p4beta1/image_annotator/rest" - - -class ::Google::Cloud::Vision::V1p4beta1::ImageAnnotator::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_batch_annotate_images - # Create test objects. - client_result = ::Google::Cloud::Vision::V1p4beta1::BatchAnnotateImagesResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - requests = [{}] - - batch_annotate_images_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::Vision::V1p4beta1::ImageAnnotator::Rest::ServiceStub.stub :transcode_batch_annotate_images_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, batch_annotate_images_client_stub do - # Create client - client = ::Google::Cloud::Vision::V1p4beta1::ImageAnnotator::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.batch_annotate_images({ requests: requests }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.batch_annotate_images requests: requests do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.batch_annotate_images ::Google::Cloud::Vision::V1p4beta1::BatchAnnotateImagesRequest.new(requests: requests) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.batch_annotate_images({ requests: requests }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.batch_annotate_images(::Google::Cloud::Vision::V1p4beta1::BatchAnnotateImagesRequest.new(requests: requests), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, batch_annotate_images_client_stub.call_count - end - end - end - - def test_batch_annotate_files - # Create test objects. - client_result = ::Google::Cloud::Vision::V1p4beta1::BatchAnnotateFilesResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - requests = [{}] - - batch_annotate_files_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::Vision::V1p4beta1::ImageAnnotator::Rest::ServiceStub.stub :transcode_batch_annotate_files_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, batch_annotate_files_client_stub do - # Create client - client = ::Google::Cloud::Vision::V1p4beta1::ImageAnnotator::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.batch_annotate_files({ requests: requests }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.batch_annotate_files requests: requests do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.batch_annotate_files ::Google::Cloud::Vision::V1p4beta1::BatchAnnotateFilesRequest.new(requests: requests) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.batch_annotate_files({ requests: requests }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.batch_annotate_files(::Google::Cloud::Vision::V1p4beta1::BatchAnnotateFilesRequest.new(requests: requests), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, batch_annotate_files_client_stub.call_count - end - end - end - - def test_async_batch_annotate_images - # 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. - requests = [{}] - output_config = {} - - async_batch_annotate_images_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::Vision::V1p4beta1::ImageAnnotator::Rest::ServiceStub.stub :transcode_async_batch_annotate_images_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, async_batch_annotate_images_client_stub do - # Create client - client = ::Google::Cloud::Vision::V1p4beta1::ImageAnnotator::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.async_batch_annotate_images({ requests: requests, output_config: output_config }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.async_batch_annotate_images requests: requests, output_config: output_config do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.async_batch_annotate_images ::Google::Cloud::Vision::V1p4beta1::AsyncBatchAnnotateImagesRequest.new(requests: requests, output_config: output_config) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.async_batch_annotate_images({ requests: requests, output_config: output_config }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.async_batch_annotate_images(::Google::Cloud::Vision::V1p4beta1::AsyncBatchAnnotateImagesRequest.new(requests: requests, output_config: output_config), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, async_batch_annotate_images_client_stub.call_count - end - end - end - - def test_async_batch_annotate_files - # 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. - requests = [{}] - - async_batch_annotate_files_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::Vision::V1p4beta1::ImageAnnotator::Rest::ServiceStub.stub :transcode_async_batch_annotate_files_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, async_batch_annotate_files_client_stub do - # Create client - client = ::Google::Cloud::Vision::V1p4beta1::ImageAnnotator::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.async_batch_annotate_files({ requests: requests }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.async_batch_annotate_files requests: requests do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.async_batch_annotate_files ::Google::Cloud::Vision::V1p4beta1::AsyncBatchAnnotateFilesRequest.new(requests: requests) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.async_batch_annotate_files({ requests: requests }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.async_batch_annotate_files(::Google::Cloud::Vision::V1p4beta1::AsyncBatchAnnotateFilesRequest.new(requests: requests), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, async_batch_annotate_files_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::Vision::V1p4beta1::ImageAnnotator::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::Vision::V1p4beta1::ImageAnnotator::Rest::Client::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-vision-v1p4beta1/test/google/cloud/vision/v1p4beta1/image_annotator_test.rb b/owl-bot-staging/google-cloud-vision-v1p4beta1/test/google/cloud/vision/v1p4beta1/image_annotator_test.rb deleted file mode 100644 index 64029a17a8e2..000000000000 --- a/owl-bot-staging/google-cloud-vision-v1p4beta1/test/google/cloud/vision/v1p4beta1/image_annotator_test.rb +++ /dev/null @@ -1,362 +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/vision/v1p4beta1/image_annotator_pb" -require "google/cloud/vision/v1p4beta1/image_annotator" - -class ::Google::Cloud::Vision::V1p4beta1::ImageAnnotator::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_batch_annotate_images - # Create GRPC objects. - grpc_response = ::Google::Cloud::Vision::V1p4beta1::BatchAnnotateImagesResponse.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. - requests = [{}] - - batch_annotate_images_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :batch_annotate_images, name - assert_kind_of ::Google::Cloud::Vision::V1p4beta1::BatchAnnotateImagesRequest, request - assert_kind_of ::Google::Cloud::Vision::V1p4beta1::AnnotateImageRequest, request["requests"].first - refute_nil options - end - - Gapic::ServiceStub.stub :new, batch_annotate_images_client_stub do - # Create client - client = ::Google::Cloud::Vision::V1p4beta1::ImageAnnotator::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.batch_annotate_images({ requests: requests }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.batch_annotate_images requests: requests do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.batch_annotate_images ::Google::Cloud::Vision::V1p4beta1::BatchAnnotateImagesRequest.new(requests: requests) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.batch_annotate_images({ requests: requests }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.batch_annotate_images(::Google::Cloud::Vision::V1p4beta1::BatchAnnotateImagesRequest.new(requests: requests), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, batch_annotate_images_client_stub.call_rpc_count - end - end - - def test_batch_annotate_files - # Create GRPC objects. - grpc_response = ::Google::Cloud::Vision::V1p4beta1::BatchAnnotateFilesResponse.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. - requests = [{}] - - batch_annotate_files_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :batch_annotate_files, name - assert_kind_of ::Google::Cloud::Vision::V1p4beta1::BatchAnnotateFilesRequest, request - assert_kind_of ::Google::Cloud::Vision::V1p4beta1::AnnotateFileRequest, request["requests"].first - refute_nil options - end - - Gapic::ServiceStub.stub :new, batch_annotate_files_client_stub do - # Create client - client = ::Google::Cloud::Vision::V1p4beta1::ImageAnnotator::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.batch_annotate_files({ requests: requests }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.batch_annotate_files requests: requests do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.batch_annotate_files ::Google::Cloud::Vision::V1p4beta1::BatchAnnotateFilesRequest.new(requests: requests) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.batch_annotate_files({ requests: requests }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.batch_annotate_files(::Google::Cloud::Vision::V1p4beta1::BatchAnnotateFilesRequest.new(requests: requests), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, batch_annotate_files_client_stub.call_rpc_count - end - end - - def test_async_batch_annotate_images - # 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. - requests = [{}] - output_config = {} - - async_batch_annotate_images_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :async_batch_annotate_images, name - assert_kind_of ::Google::Cloud::Vision::V1p4beta1::AsyncBatchAnnotateImagesRequest, request - assert_kind_of ::Google::Cloud::Vision::V1p4beta1::AnnotateImageRequest, request["requests"].first - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Vision::V1p4beta1::OutputConfig), request["output_config"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, async_batch_annotate_images_client_stub do - # Create client - client = ::Google::Cloud::Vision::V1p4beta1::ImageAnnotator::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.async_batch_annotate_images({ requests: requests, output_config: output_config }) 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.async_batch_annotate_images requests: requests, output_config: output_config 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.async_batch_annotate_images ::Google::Cloud::Vision::V1p4beta1::AsyncBatchAnnotateImagesRequest.new(requests: requests, output_config: output_config) 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.async_batch_annotate_images({ requests: requests, output_config: output_config }, 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.async_batch_annotate_images(::Google::Cloud::Vision::V1p4beta1::AsyncBatchAnnotateImagesRequest.new(requests: requests, output_config: output_config), 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, async_batch_annotate_images_client_stub.call_rpc_count - end - end - - def test_async_batch_annotate_files - # 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. - requests = [{}] - - async_batch_annotate_files_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :async_batch_annotate_files, name - assert_kind_of ::Google::Cloud::Vision::V1p4beta1::AsyncBatchAnnotateFilesRequest, request - assert_kind_of ::Google::Cloud::Vision::V1p4beta1::AsyncAnnotateFileRequest, request["requests"].first - refute_nil options - end - - Gapic::ServiceStub.stub :new, async_batch_annotate_files_client_stub do - # Create client - client = ::Google::Cloud::Vision::V1p4beta1::ImageAnnotator::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.async_batch_annotate_files({ requests: requests }) 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.async_batch_annotate_files requests: requests 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.async_batch_annotate_files ::Google::Cloud::Vision::V1p4beta1::AsyncBatchAnnotateFilesRequest.new(requests: requests) 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.async_batch_annotate_files({ requests: requests }, 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.async_batch_annotate_files(::Google::Cloud::Vision::V1p4beta1::AsyncBatchAnnotateFilesRequest.new(requests: requests), 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, async_batch_annotate_files_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::Vision::V1p4beta1::ImageAnnotator::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::Vision::V1p4beta1::ImageAnnotator::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::Vision::V1p4beta1::ImageAnnotator::Client.new do |config| - config.credentials = creds - end - assert_kind_of ::Google::Cloud::Vision::V1p4beta1::ImageAnnotator::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::Vision::V1p4beta1::ImageAnnotator::Client.new do |config| - config.credentials = grpc_channel - end - end - - assert_kind_of ::Google::Cloud::Vision::V1p4beta1::ImageAnnotator::Operations, client.operations_client - end -end diff --git a/owl-bot-staging/google-cloud-vision-v1p4beta1/test/google/cloud/vision/v1p4beta1/product_search_operations_test.rb b/owl-bot-staging/google-cloud-vision-v1p4beta1/test/google/cloud/vision/v1p4beta1/product_search_operations_test.rb deleted file mode 100644 index 71071f78046c..000000000000 --- a/owl-bot-staging/google-cloud-vision-v1p4beta1/test/google/cloud/vision/v1p4beta1/product_search_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/vision/v1p4beta1/product_search_service_pb" -require "google/cloud/vision/v1p4beta1/product_search_service_services_pb" -require "google/cloud/vision/v1p4beta1/product_search" - -class ::Google::Cloud::Vision::V1p4beta1::ProductSearch::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::Vision::V1p4beta1::ProductSearch::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::Vision::V1p4beta1::ProductSearch::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::Vision::V1p4beta1::ProductSearch::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::Vision::V1p4beta1::ProductSearch::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::Vision::V1p4beta1::ProductSearch::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::Vision::V1p4beta1::ProductSearch::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::Vision::V1p4beta1::ProductSearch::Operations::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-vision-v1p4beta1/test/google/cloud/vision/v1p4beta1/product_search_paths_test.rb b/owl-bot-staging/google-cloud-vision-v1p4beta1/test/google/cloud/vision/v1p4beta1/product_search_paths_test.rb deleted file mode 100644 index 1690b8545f17..000000000000 --- a/owl-bot-staging/google-cloud-vision-v1p4beta1/test/google/cloud/vision/v1p4beta1/product_search_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/vision/v1p4beta1/product_search" - -class ::Google::Cloud::Vision::V1p4beta1::ProductSearch::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::Vision::V1p4beta1::ProductSearch::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_product_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Vision::V1p4beta1::ProductSearch::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.product_path project: "value0", location: "value1", product: "value2" - assert_equal "projects/value0/locations/value1/products/value2", path - end - end - - def test_product_set_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Vision::V1p4beta1::ProductSearch::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.product_set_path project: "value0", location: "value1", product_set: "value2" - assert_equal "projects/value0/locations/value1/productSets/value2", path - end - end - - def test_reference_image_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Vision::V1p4beta1::ProductSearch::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.reference_image_path project: "value0", location: "value1", product: "value2", reference_image: "value3" - assert_equal "projects/value0/locations/value1/products/value2/referenceImages/value3", path - end - end -end diff --git a/owl-bot-staging/google-cloud-vision-v1p4beta1/test/google/cloud/vision/v1p4beta1/product_search_rest_test.rb b/owl-bot-staging/google-cloud-vision-v1p4beta1/test/google/cloud/vision/v1p4beta1/product_search_rest_test.rb deleted file mode 100644 index 38273cf58b6f..000000000000 --- a/owl-bot-staging/google-cloud-vision-v1p4beta1/test/google/cloud/vision/v1p4beta1/product_search_rest_test.rb +++ /dev/null @@ -1,1146 +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/vision/v1p4beta1/product_search_service_pb" -require "google/cloud/vision/v1p4beta1/product_search/rest" - - -class ::Google::Cloud::Vision::V1p4beta1::ProductSearch::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_product_set - # Create test objects. - client_result = ::Google::Cloud::Vision::V1p4beta1::ProductSet.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - product_set = {} - product_set_id = "hello world" - - create_product_set_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::Vision::V1p4beta1::ProductSearch::Rest::ServiceStub.stub :transcode_create_product_set_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_product_set_client_stub do - # Create client - client = ::Google::Cloud::Vision::V1p4beta1::ProductSearch::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_product_set({ parent: parent, product_set: product_set, product_set_id: product_set_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_product_set parent: parent, product_set: product_set, product_set_id: product_set_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_product_set ::Google::Cloud::Vision::V1p4beta1::CreateProductSetRequest.new(parent: parent, product_set: product_set, product_set_id: product_set_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_product_set({ parent: parent, product_set: product_set, product_set_id: product_set_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_product_set(::Google::Cloud::Vision::V1p4beta1::CreateProductSetRequest.new(parent: parent, product_set: product_set, product_set_id: product_set_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_product_set_client_stub.call_count - end - end - end - - def test_list_product_sets - # Create test objects. - client_result = ::Google::Cloud::Vision::V1p4beta1::ListProductSetsResponse.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_product_sets_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::Vision::V1p4beta1::ProductSearch::Rest::ServiceStub.stub :transcode_list_product_sets_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_product_sets_client_stub do - # Create client - client = ::Google::Cloud::Vision::V1p4beta1::ProductSearch::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_product_sets({ 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_product_sets 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_product_sets ::Google::Cloud::Vision::V1p4beta1::ListProductSetsRequest.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_product_sets({ 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_product_sets(::Google::Cloud::Vision::V1p4beta1::ListProductSetsRequest.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_product_sets_client_stub.call_count - end - end - end - - def test_get_product_set - # Create test objects. - client_result = ::Google::Cloud::Vision::V1p4beta1::ProductSet.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_product_set_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::Vision::V1p4beta1::ProductSearch::Rest::ServiceStub.stub :transcode_get_product_set_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_product_set_client_stub do - # Create client - client = ::Google::Cloud::Vision::V1p4beta1::ProductSearch::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_product_set({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_product_set name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_product_set ::Google::Cloud::Vision::V1p4beta1::GetProductSetRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_product_set({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_product_set(::Google::Cloud::Vision::V1p4beta1::GetProductSetRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_product_set_client_stub.call_count - end - end - end - - def test_update_product_set - # Create test objects. - client_result = ::Google::Cloud::Vision::V1p4beta1::ProductSet.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - product_set = {} - update_mask = {} - - update_product_set_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::Vision::V1p4beta1::ProductSearch::Rest::ServiceStub.stub :transcode_update_product_set_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_product_set_client_stub do - # Create client - client = ::Google::Cloud::Vision::V1p4beta1::ProductSearch::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.update_product_set({ product_set: product_set, update_mask: update_mask }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.update_product_set product_set: product_set, update_mask: update_mask do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.update_product_set ::Google::Cloud::Vision::V1p4beta1::UpdateProductSetRequest.new(product_set: product_set, update_mask: update_mask) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.update_product_set({ product_set: product_set, update_mask: update_mask }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.update_product_set(::Google::Cloud::Vision::V1p4beta1::UpdateProductSetRequest.new(product_set: product_set, update_mask: update_mask), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, update_product_set_client_stub.call_count - end - end - end - - def test_delete_product_set - # 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_product_set_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::Vision::V1p4beta1::ProductSearch::Rest::ServiceStub.stub :transcode_delete_product_set_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_product_set_client_stub do - # Create client - client = ::Google::Cloud::Vision::V1p4beta1::ProductSearch::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.delete_product_set({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.delete_product_set name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.delete_product_set ::Google::Cloud::Vision::V1p4beta1::DeleteProductSetRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.delete_product_set({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.delete_product_set(::Google::Cloud::Vision::V1p4beta1::DeleteProductSetRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, delete_product_set_client_stub.call_count - end - end - end - - def test_create_product - # Create test objects. - client_result = ::Google::Cloud::Vision::V1p4beta1::Product.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - product = {} - product_id = "hello world" - - create_product_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::Vision::V1p4beta1::ProductSearch::Rest::ServiceStub.stub :transcode_create_product_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_product_client_stub do - # Create client - client = ::Google::Cloud::Vision::V1p4beta1::ProductSearch::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_product({ parent: parent, product: product, product_id: product_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_product parent: parent, product: product, product_id: product_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_product ::Google::Cloud::Vision::V1p4beta1::CreateProductRequest.new(parent: parent, product: product, product_id: product_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_product({ parent: parent, product: product, product_id: product_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_product(::Google::Cloud::Vision::V1p4beta1::CreateProductRequest.new(parent: parent, product: product, product_id: product_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_product_client_stub.call_count - end - end - end - - def test_list_products - # Create test objects. - client_result = ::Google::Cloud::Vision::V1p4beta1::ListProductsResponse.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_products_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::Vision::V1p4beta1::ProductSearch::Rest::ServiceStub.stub :transcode_list_products_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_products_client_stub do - # Create client - client = ::Google::Cloud::Vision::V1p4beta1::ProductSearch::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_products({ 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_products 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_products ::Google::Cloud::Vision::V1p4beta1::ListProductsRequest.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_products({ 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_products(::Google::Cloud::Vision::V1p4beta1::ListProductsRequest.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_products_client_stub.call_count - end - end - end - - def test_get_product - # Create test objects. - client_result = ::Google::Cloud::Vision::V1p4beta1::Product.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_product_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::Vision::V1p4beta1::ProductSearch::Rest::ServiceStub.stub :transcode_get_product_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_product_client_stub do - # Create client - client = ::Google::Cloud::Vision::V1p4beta1::ProductSearch::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_product({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_product name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_product ::Google::Cloud::Vision::V1p4beta1::GetProductRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_product({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_product(::Google::Cloud::Vision::V1p4beta1::GetProductRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_product_client_stub.call_count - end - end - end - - def test_update_product - # Create test objects. - client_result = ::Google::Cloud::Vision::V1p4beta1::Product.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - product = {} - update_mask = {} - - update_product_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::Vision::V1p4beta1::ProductSearch::Rest::ServiceStub.stub :transcode_update_product_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_product_client_stub do - # Create client - client = ::Google::Cloud::Vision::V1p4beta1::ProductSearch::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.update_product({ product: product, update_mask: update_mask }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.update_product product: product, update_mask: update_mask do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.update_product ::Google::Cloud::Vision::V1p4beta1::UpdateProductRequest.new(product: product, update_mask: update_mask) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.update_product({ product: product, update_mask: update_mask }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.update_product(::Google::Cloud::Vision::V1p4beta1::UpdateProductRequest.new(product: product, update_mask: update_mask), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, update_product_client_stub.call_count - end - end - end - - def test_delete_product - # 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_product_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::Vision::V1p4beta1::ProductSearch::Rest::ServiceStub.stub :transcode_delete_product_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_product_client_stub do - # Create client - client = ::Google::Cloud::Vision::V1p4beta1::ProductSearch::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.delete_product({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.delete_product name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.delete_product ::Google::Cloud::Vision::V1p4beta1::DeleteProductRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.delete_product({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.delete_product(::Google::Cloud::Vision::V1p4beta1::DeleteProductRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, delete_product_client_stub.call_count - end - end - end - - def test_create_reference_image - # Create test objects. - client_result = ::Google::Cloud::Vision::V1p4beta1::ReferenceImage.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - reference_image = {} - reference_image_id = "hello world" - - create_reference_image_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::Vision::V1p4beta1::ProductSearch::Rest::ServiceStub.stub :transcode_create_reference_image_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_reference_image_client_stub do - # Create client - client = ::Google::Cloud::Vision::V1p4beta1::ProductSearch::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_reference_image({ parent: parent, reference_image: reference_image, reference_image_id: reference_image_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_reference_image parent: parent, reference_image: reference_image, reference_image_id: reference_image_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_reference_image ::Google::Cloud::Vision::V1p4beta1::CreateReferenceImageRequest.new(parent: parent, reference_image: reference_image, reference_image_id: reference_image_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_reference_image({ parent: parent, reference_image: reference_image, reference_image_id: reference_image_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_reference_image(::Google::Cloud::Vision::V1p4beta1::CreateReferenceImageRequest.new(parent: parent, reference_image: reference_image, reference_image_id: reference_image_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_reference_image_client_stub.call_count - end - end - end - - def test_delete_reference_image - # 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_reference_image_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::Vision::V1p4beta1::ProductSearch::Rest::ServiceStub.stub :transcode_delete_reference_image_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_reference_image_client_stub do - # Create client - client = ::Google::Cloud::Vision::V1p4beta1::ProductSearch::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.delete_reference_image({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.delete_reference_image name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.delete_reference_image ::Google::Cloud::Vision::V1p4beta1::DeleteReferenceImageRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.delete_reference_image({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.delete_reference_image(::Google::Cloud::Vision::V1p4beta1::DeleteReferenceImageRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, delete_reference_image_client_stub.call_count - end - end - end - - def test_list_reference_images - # Create test objects. - client_result = ::Google::Cloud::Vision::V1p4beta1::ListReferenceImagesResponse.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_reference_images_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::Vision::V1p4beta1::ProductSearch::Rest::ServiceStub.stub :transcode_list_reference_images_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_reference_images_client_stub do - # Create client - client = ::Google::Cloud::Vision::V1p4beta1::ProductSearch::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_reference_images({ 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_reference_images 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_reference_images ::Google::Cloud::Vision::V1p4beta1::ListReferenceImagesRequest.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_reference_images({ 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_reference_images(::Google::Cloud::Vision::V1p4beta1::ListReferenceImagesRequest.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_reference_images_client_stub.call_count - end - end - end - - def test_get_reference_image - # Create test objects. - client_result = ::Google::Cloud::Vision::V1p4beta1::ReferenceImage.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_reference_image_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::Vision::V1p4beta1::ProductSearch::Rest::ServiceStub.stub :transcode_get_reference_image_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_reference_image_client_stub do - # Create client - client = ::Google::Cloud::Vision::V1p4beta1::ProductSearch::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_reference_image({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_reference_image name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_reference_image ::Google::Cloud::Vision::V1p4beta1::GetReferenceImageRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_reference_image({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_reference_image(::Google::Cloud::Vision::V1p4beta1::GetReferenceImageRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_reference_image_client_stub.call_count - end - end - end - - def test_add_product_to_product_set - # 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" - product = "hello world" - - add_product_to_product_set_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::Vision::V1p4beta1::ProductSearch::Rest::ServiceStub.stub :transcode_add_product_to_product_set_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, add_product_to_product_set_client_stub do - # Create client - client = ::Google::Cloud::Vision::V1p4beta1::ProductSearch::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.add_product_to_product_set({ name: name, product: product }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.add_product_to_product_set name: name, product: product do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.add_product_to_product_set ::Google::Cloud::Vision::V1p4beta1::AddProductToProductSetRequest.new(name: name, product: product) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.add_product_to_product_set({ name: name, product: product }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.add_product_to_product_set(::Google::Cloud::Vision::V1p4beta1::AddProductToProductSetRequest.new(name: name, product: product), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, add_product_to_product_set_client_stub.call_count - end - end - end - - def test_remove_product_from_product_set - # 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" - product = "hello world" - - remove_product_from_product_set_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::Vision::V1p4beta1::ProductSearch::Rest::ServiceStub.stub :transcode_remove_product_from_product_set_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, remove_product_from_product_set_client_stub do - # Create client - client = ::Google::Cloud::Vision::V1p4beta1::ProductSearch::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.remove_product_from_product_set({ name: name, product: product }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.remove_product_from_product_set name: name, product: product do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.remove_product_from_product_set ::Google::Cloud::Vision::V1p4beta1::RemoveProductFromProductSetRequest.new(name: name, product: product) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.remove_product_from_product_set({ name: name, product: product }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.remove_product_from_product_set(::Google::Cloud::Vision::V1p4beta1::RemoveProductFromProductSetRequest.new(name: name, product: product), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, remove_product_from_product_set_client_stub.call_count - end - end - end - - def test_list_products_in_product_set - # Create test objects. - client_result = ::Google::Cloud::Vision::V1p4beta1::ListProductsInProductSetResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - page_size = 42 - page_token = "hello world" - - list_products_in_product_set_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::Vision::V1p4beta1::ProductSearch::Rest::ServiceStub.stub :transcode_list_products_in_product_set_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_products_in_product_set_client_stub do - # Create client - client = ::Google::Cloud::Vision::V1p4beta1::ProductSearch::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_products_in_product_set({ name: name, page_size: page_size, page_token: page_token }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.list_products_in_product_set name: name, page_size: page_size, page_token: page_token do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.list_products_in_product_set ::Google::Cloud::Vision::V1p4beta1::ListProductsInProductSetRequest.new(name: name, 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_products_in_product_set({ name: name, 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_products_in_product_set(::Google::Cloud::Vision::V1p4beta1::ListProductsInProductSetRequest.new(name: name, 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_products_in_product_set_client_stub.call_count - end - end - end - - def test_import_product_sets - # 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" - input_config = {} - - import_product_sets_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::Vision::V1p4beta1::ProductSearch::Rest::ServiceStub.stub :transcode_import_product_sets_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, import_product_sets_client_stub do - # Create client - client = ::Google::Cloud::Vision::V1p4beta1::ProductSearch::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.import_product_sets({ parent: parent, input_config: input_config }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.import_product_sets parent: parent, input_config: input_config do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.import_product_sets ::Google::Cloud::Vision::V1p4beta1::ImportProductSetsRequest.new(parent: parent, input_config: input_config) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.import_product_sets({ parent: parent, input_config: input_config }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.import_product_sets(::Google::Cloud::Vision::V1p4beta1::ImportProductSetsRequest.new(parent: parent, input_config: input_config), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, import_product_sets_client_stub.call_count - end - end - end - - def test_purge_products - # 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. - product_set_purge_config = {} - parent = "hello world" - force = true - - purge_products_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::Vision::V1p4beta1::ProductSearch::Rest::ServiceStub.stub :transcode_purge_products_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, purge_products_client_stub do - # Create client - client = ::Google::Cloud::Vision::V1p4beta1::ProductSearch::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.purge_products({ product_set_purge_config: product_set_purge_config, parent: parent, force: force }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.purge_products product_set_purge_config: product_set_purge_config, parent: parent, force: force do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.purge_products ::Google::Cloud::Vision::V1p4beta1::PurgeProductsRequest.new(product_set_purge_config: product_set_purge_config, parent: parent, force: force) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.purge_products({ product_set_purge_config: product_set_purge_config, parent: parent, force: force }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.purge_products(::Google::Cloud::Vision::V1p4beta1::PurgeProductsRequest.new(product_set_purge_config: product_set_purge_config, parent: parent, force: force), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, purge_products_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::Vision::V1p4beta1::ProductSearch::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::Vision::V1p4beta1::ProductSearch::Rest::Client::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-vision-v1p4beta1/test/google/cloud/vision/v1p4beta1/product_search_test.rb b/owl-bot-staging/google-cloud-vision-v1p4beta1/test/google/cloud/vision/v1p4beta1/product_search_test.rb deleted file mode 100644 index 6fb82bba4ea5..000000000000 --- a/owl-bot-staging/google-cloud-vision-v1p4beta1/test/google/cloud/vision/v1p4beta1/product_search_test.rb +++ /dev/null @@ -1,1293 +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/vision/v1p4beta1/product_search_service_pb" -require "google/cloud/vision/v1p4beta1/product_search" - -class ::Google::Cloud::Vision::V1p4beta1::ProductSearch::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_product_set - # Create GRPC objects. - grpc_response = ::Google::Cloud::Vision::V1p4beta1::ProductSet.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" - product_set = {} - product_set_id = "hello world" - - create_product_set_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_product_set, name - assert_kind_of ::Google::Cloud::Vision::V1p4beta1::CreateProductSetRequest, request - assert_equal "hello world", request["parent"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Vision::V1p4beta1::ProductSet), request["product_set"] - assert_equal "hello world", request["product_set_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_product_set_client_stub do - # Create client - client = ::Google::Cloud::Vision::V1p4beta1::ProductSearch::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_product_set({ parent: parent, product_set: product_set, product_set_id: product_set_id }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.create_product_set parent: parent, product_set: product_set, product_set_id: product_set_id do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.create_product_set ::Google::Cloud::Vision::V1p4beta1::CreateProductSetRequest.new(parent: parent, product_set: product_set, product_set_id: product_set_id) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.create_product_set({ parent: parent, product_set: product_set, product_set_id: product_set_id }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.create_product_set(::Google::Cloud::Vision::V1p4beta1::CreateProductSetRequest.new(parent: parent, product_set: product_set, product_set_id: product_set_id), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, create_product_set_client_stub.call_rpc_count - end - end - - def test_list_product_sets - # Create GRPC objects. - grpc_response = ::Google::Cloud::Vision::V1p4beta1::ListProductSetsResponse.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_product_sets_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_product_sets, name - assert_kind_of ::Google::Cloud::Vision::V1p4beta1::ListProductSetsRequest, 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_product_sets_client_stub do - # Create client - client = ::Google::Cloud::Vision::V1p4beta1::ProductSearch::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_product_sets({ 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_product_sets 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_product_sets ::Google::Cloud::Vision::V1p4beta1::ListProductSetsRequest.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_product_sets({ 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_product_sets(::Google::Cloud::Vision::V1p4beta1::ListProductSetsRequest.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_product_sets_client_stub.call_rpc_count - end - end - - def test_get_product_set - # Create GRPC objects. - grpc_response = ::Google::Cloud::Vision::V1p4beta1::ProductSet.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_product_set_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_product_set, name - assert_kind_of ::Google::Cloud::Vision::V1p4beta1::GetProductSetRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_product_set_client_stub do - # Create client - client = ::Google::Cloud::Vision::V1p4beta1::ProductSearch::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_product_set({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_product_set name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_product_set ::Google::Cloud::Vision::V1p4beta1::GetProductSetRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_product_set({ 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_product_set(::Google::Cloud::Vision::V1p4beta1::GetProductSetRequest.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_product_set_client_stub.call_rpc_count - end - end - - def test_update_product_set - # Create GRPC objects. - grpc_response = ::Google::Cloud::Vision::V1p4beta1::ProductSet.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. - product_set = {} - update_mask = {} - - update_product_set_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_product_set, name - assert_kind_of ::Google::Cloud::Vision::V1p4beta1::UpdateProductSetRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Vision::V1p4beta1::ProductSet), request["product_set"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_product_set_client_stub do - # Create client - client = ::Google::Cloud::Vision::V1p4beta1::ProductSearch::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_product_set({ product_set: product_set, update_mask: update_mask }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.update_product_set product_set: product_set, update_mask: update_mask do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.update_product_set ::Google::Cloud::Vision::V1p4beta1::UpdateProductSetRequest.new(product_set: product_set, 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_product_set({ product_set: product_set, 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_product_set(::Google::Cloud::Vision::V1p4beta1::UpdateProductSetRequest.new(product_set: product_set, 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_product_set_client_stub.call_rpc_count - end - end - - def test_delete_product_set - # 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_product_set_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_product_set, name - assert_kind_of ::Google::Cloud::Vision::V1p4beta1::DeleteProductSetRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_product_set_client_stub do - # Create client - client = ::Google::Cloud::Vision::V1p4beta1::ProductSearch::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_product_set({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.delete_product_set name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.delete_product_set ::Google::Cloud::Vision::V1p4beta1::DeleteProductSetRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.delete_product_set({ 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_product_set(::Google::Cloud::Vision::V1p4beta1::DeleteProductSetRequest.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_product_set_client_stub.call_rpc_count - end - end - - def test_create_product - # Create GRPC objects. - grpc_response = ::Google::Cloud::Vision::V1p4beta1::Product.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" - product = {} - product_id = "hello world" - - create_product_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_product, name - assert_kind_of ::Google::Cloud::Vision::V1p4beta1::CreateProductRequest, request - assert_equal "hello world", request["parent"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Vision::V1p4beta1::Product), request["product"] - assert_equal "hello world", request["product_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_product_client_stub do - # Create client - client = ::Google::Cloud::Vision::V1p4beta1::ProductSearch::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_product({ parent: parent, product: product, product_id: product_id }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.create_product parent: parent, product: product, product_id: product_id do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.create_product ::Google::Cloud::Vision::V1p4beta1::CreateProductRequest.new(parent: parent, product: product, product_id: product_id) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.create_product({ parent: parent, product: product, product_id: product_id }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.create_product(::Google::Cloud::Vision::V1p4beta1::CreateProductRequest.new(parent: parent, product: product, product_id: product_id), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, create_product_client_stub.call_rpc_count - end - end - - def test_list_products - # Create GRPC objects. - grpc_response = ::Google::Cloud::Vision::V1p4beta1::ListProductsResponse.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_products_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_products, name - assert_kind_of ::Google::Cloud::Vision::V1p4beta1::ListProductsRequest, 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_products_client_stub do - # Create client - client = ::Google::Cloud::Vision::V1p4beta1::ProductSearch::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_products({ 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_products 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_products ::Google::Cloud::Vision::V1p4beta1::ListProductsRequest.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_products({ 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_products(::Google::Cloud::Vision::V1p4beta1::ListProductsRequest.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_products_client_stub.call_rpc_count - end - end - - def test_get_product - # Create GRPC objects. - grpc_response = ::Google::Cloud::Vision::V1p4beta1::Product.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_product_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_product, name - assert_kind_of ::Google::Cloud::Vision::V1p4beta1::GetProductRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_product_client_stub do - # Create client - client = ::Google::Cloud::Vision::V1p4beta1::ProductSearch::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_product({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_product name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_product ::Google::Cloud::Vision::V1p4beta1::GetProductRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_product({ 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_product(::Google::Cloud::Vision::V1p4beta1::GetProductRequest.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_product_client_stub.call_rpc_count - end - end - - def test_update_product - # Create GRPC objects. - grpc_response = ::Google::Cloud::Vision::V1p4beta1::Product.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. - product = {} - update_mask = {} - - update_product_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_product, name - assert_kind_of ::Google::Cloud::Vision::V1p4beta1::UpdateProductRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Vision::V1p4beta1::Product), request["product"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_product_client_stub do - # Create client - client = ::Google::Cloud::Vision::V1p4beta1::ProductSearch::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_product({ product: product, update_mask: update_mask }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.update_product product: product, update_mask: update_mask do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.update_product ::Google::Cloud::Vision::V1p4beta1::UpdateProductRequest.new(product: product, 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_product({ product: product, 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_product(::Google::Cloud::Vision::V1p4beta1::UpdateProductRequest.new(product: product, 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_product_client_stub.call_rpc_count - end - end - - def test_delete_product - # 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_product_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_product, name - assert_kind_of ::Google::Cloud::Vision::V1p4beta1::DeleteProductRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_product_client_stub do - # Create client - client = ::Google::Cloud::Vision::V1p4beta1::ProductSearch::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_product({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.delete_product name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.delete_product ::Google::Cloud::Vision::V1p4beta1::DeleteProductRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.delete_product({ 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_product(::Google::Cloud::Vision::V1p4beta1::DeleteProductRequest.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_product_client_stub.call_rpc_count - end - end - - def test_create_reference_image - # Create GRPC objects. - grpc_response = ::Google::Cloud::Vision::V1p4beta1::ReferenceImage.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" - reference_image = {} - reference_image_id = "hello world" - - create_reference_image_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_reference_image, name - assert_kind_of ::Google::Cloud::Vision::V1p4beta1::CreateReferenceImageRequest, request - assert_equal "hello world", request["parent"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Vision::V1p4beta1::ReferenceImage), request["reference_image"] - assert_equal "hello world", request["reference_image_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_reference_image_client_stub do - # Create client - client = ::Google::Cloud::Vision::V1p4beta1::ProductSearch::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_reference_image({ parent: parent, reference_image: reference_image, reference_image_id: reference_image_id }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.create_reference_image parent: parent, reference_image: reference_image, reference_image_id: reference_image_id do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.create_reference_image ::Google::Cloud::Vision::V1p4beta1::CreateReferenceImageRequest.new(parent: parent, reference_image: reference_image, reference_image_id: reference_image_id) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.create_reference_image({ parent: parent, reference_image: reference_image, reference_image_id: reference_image_id }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.create_reference_image(::Google::Cloud::Vision::V1p4beta1::CreateReferenceImageRequest.new(parent: parent, reference_image: reference_image, reference_image_id: reference_image_id), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, create_reference_image_client_stub.call_rpc_count - end - end - - def test_delete_reference_image - # 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_reference_image_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_reference_image, name - assert_kind_of ::Google::Cloud::Vision::V1p4beta1::DeleteReferenceImageRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_reference_image_client_stub do - # Create client - client = ::Google::Cloud::Vision::V1p4beta1::ProductSearch::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_reference_image({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.delete_reference_image name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.delete_reference_image ::Google::Cloud::Vision::V1p4beta1::DeleteReferenceImageRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.delete_reference_image({ 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_reference_image(::Google::Cloud::Vision::V1p4beta1::DeleteReferenceImageRequest.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_reference_image_client_stub.call_rpc_count - end - end - - def test_list_reference_images - # Create GRPC objects. - grpc_response = ::Google::Cloud::Vision::V1p4beta1::ListReferenceImagesResponse.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_reference_images_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_reference_images, name - assert_kind_of ::Google::Cloud::Vision::V1p4beta1::ListReferenceImagesRequest, 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_reference_images_client_stub do - # Create client - client = ::Google::Cloud::Vision::V1p4beta1::ProductSearch::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_reference_images({ 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_reference_images 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_reference_images ::Google::Cloud::Vision::V1p4beta1::ListReferenceImagesRequest.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_reference_images({ 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_reference_images(::Google::Cloud::Vision::V1p4beta1::ListReferenceImagesRequest.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_reference_images_client_stub.call_rpc_count - end - end - - def test_get_reference_image - # Create GRPC objects. - grpc_response = ::Google::Cloud::Vision::V1p4beta1::ReferenceImage.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_reference_image_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_reference_image, name - assert_kind_of ::Google::Cloud::Vision::V1p4beta1::GetReferenceImageRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_reference_image_client_stub do - # Create client - client = ::Google::Cloud::Vision::V1p4beta1::ProductSearch::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_reference_image({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_reference_image name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_reference_image ::Google::Cloud::Vision::V1p4beta1::GetReferenceImageRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_reference_image({ 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_reference_image(::Google::Cloud::Vision::V1p4beta1::GetReferenceImageRequest.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_reference_image_client_stub.call_rpc_count - end - end - - def test_add_product_to_product_set - # 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" - product = "hello world" - - add_product_to_product_set_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :add_product_to_product_set, name - assert_kind_of ::Google::Cloud::Vision::V1p4beta1::AddProductToProductSetRequest, request - assert_equal "hello world", request["name"] - assert_equal "hello world", request["product"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, add_product_to_product_set_client_stub do - # Create client - client = ::Google::Cloud::Vision::V1p4beta1::ProductSearch::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.add_product_to_product_set({ name: name, product: product }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.add_product_to_product_set name: name, product: product do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.add_product_to_product_set ::Google::Cloud::Vision::V1p4beta1::AddProductToProductSetRequest.new(name: name, product: product) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.add_product_to_product_set({ name: name, product: product }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.add_product_to_product_set(::Google::Cloud::Vision::V1p4beta1::AddProductToProductSetRequest.new(name: name, product: product), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, add_product_to_product_set_client_stub.call_rpc_count - end - end - - def test_remove_product_from_product_set - # 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" - product = "hello world" - - remove_product_from_product_set_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :remove_product_from_product_set, name - assert_kind_of ::Google::Cloud::Vision::V1p4beta1::RemoveProductFromProductSetRequest, request - assert_equal "hello world", request["name"] - assert_equal "hello world", request["product"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, remove_product_from_product_set_client_stub do - # Create client - client = ::Google::Cloud::Vision::V1p4beta1::ProductSearch::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.remove_product_from_product_set({ name: name, product: product }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.remove_product_from_product_set name: name, product: product do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.remove_product_from_product_set ::Google::Cloud::Vision::V1p4beta1::RemoveProductFromProductSetRequest.new(name: name, product: product) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.remove_product_from_product_set({ name: name, product: product }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.remove_product_from_product_set(::Google::Cloud::Vision::V1p4beta1::RemoveProductFromProductSetRequest.new(name: name, product: product), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, remove_product_from_product_set_client_stub.call_rpc_count - end - end - - def test_list_products_in_product_set - # Create GRPC objects. - grpc_response = ::Google::Cloud::Vision::V1p4beta1::ListProductsInProductSetResponse.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" - page_size = 42 - page_token = "hello world" - - list_products_in_product_set_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_products_in_product_set, name - assert_kind_of ::Google::Cloud::Vision::V1p4beta1::ListProductsInProductSetRequest, request - assert_equal "hello world", request["name"] - assert_equal 42, request["page_size"] - assert_equal "hello world", request["page_token"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_products_in_product_set_client_stub do - # Create client - client = ::Google::Cloud::Vision::V1p4beta1::ProductSearch::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_products_in_product_set({ name: name, 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_products_in_product_set name: name, 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_products_in_product_set ::Google::Cloud::Vision::V1p4beta1::ListProductsInProductSetRequest.new(name: name, 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_products_in_product_set({ name: name, 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_products_in_product_set(::Google::Cloud::Vision::V1p4beta1::ListProductsInProductSetRequest.new(name: name, 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_products_in_product_set_client_stub.call_rpc_count - end - end - - def test_import_product_sets - # 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" - input_config = {} - - import_product_sets_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :import_product_sets, name - assert_kind_of ::Google::Cloud::Vision::V1p4beta1::ImportProductSetsRequest, request - assert_equal "hello world", request["parent"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Vision::V1p4beta1::ImportProductSetsInputConfig), request["input_config"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, import_product_sets_client_stub do - # Create client - client = ::Google::Cloud::Vision::V1p4beta1::ProductSearch::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.import_product_sets({ parent: parent, input_config: input_config }) 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.import_product_sets parent: parent, input_config: input_config 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.import_product_sets ::Google::Cloud::Vision::V1p4beta1::ImportProductSetsRequest.new(parent: parent, input_config: input_config) 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.import_product_sets({ parent: parent, input_config: input_config }, 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.import_product_sets(::Google::Cloud::Vision::V1p4beta1::ImportProductSetsRequest.new(parent: parent, input_config: input_config), 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, import_product_sets_client_stub.call_rpc_count - end - end - - def test_purge_products - # 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. - product_set_purge_config = {} - parent = "hello world" - force = true - - purge_products_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :purge_products, name - assert_kind_of ::Google::Cloud::Vision::V1p4beta1::PurgeProductsRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Vision::V1p4beta1::ProductSetPurgeConfig), request["product_set_purge_config"] - assert_equal :product_set_purge_config, request.target - assert_equal "hello world", request["parent"] - assert_equal true, request["force"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, purge_products_client_stub do - # Create client - client = ::Google::Cloud::Vision::V1p4beta1::ProductSearch::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.purge_products({ product_set_purge_config: product_set_purge_config, parent: parent, force: force }) 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.purge_products product_set_purge_config: product_set_purge_config, parent: parent, force: force 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.purge_products ::Google::Cloud::Vision::V1p4beta1::PurgeProductsRequest.new(product_set_purge_config: product_set_purge_config, parent: parent, force: force) 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.purge_products({ product_set_purge_config: product_set_purge_config, parent: parent, force: force }, 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.purge_products(::Google::Cloud::Vision::V1p4beta1::PurgeProductsRequest.new(product_set_purge_config: product_set_purge_config, parent: parent, force: force), 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, purge_products_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::Vision::V1p4beta1::ProductSearch::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::Vision::V1p4beta1::ProductSearch::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::Vision::V1p4beta1::ProductSearch::Client.new do |config| - config.credentials = creds - end - assert_kind_of ::Google::Cloud::Vision::V1p4beta1::ProductSearch::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::Vision::V1p4beta1::ProductSearch::Client.new do |config| - config.credentials = grpc_channel - end - end - - assert_kind_of ::Google::Cloud::Vision::V1p4beta1::ProductSearch::Operations, client.operations_client - end -end diff --git a/owl-bot-staging/google-cloud-vision-v1p4beta1/test/helper.rb b/owl-bot-staging/google-cloud-vision-v1p4beta1/test/helper.rb deleted file mode 100644 index 672b337030e7..000000000000 --- a/owl-bot-staging/google-cloud-vision-v1p4beta1/test/helper.rb +++ /dev/null @@ -1,26 +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/mock" -require "minitest/rg" - -require "grpc" - -require "ostruct" diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/.gitignore b/owl-bot-staging/google-cloud-vision_ai-v1/.gitignore deleted file mode 100644 index 0135b6bc6cfc..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-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-vision_ai-v1/.repo-metadata.json b/owl-bot-staging/google-cloud-vision_ai-v1/.repo-metadata.json deleted file mode 100644 index 05ac4458ba7a..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/.repo-metadata.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "api_id": "visionai.googleapis.com", - "api_shortname": "visionai", - "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-vision_ai-v1/latest", - "distribution_name": "google-cloud-vision_ai-v1", - "is_cloud": true, - "language": "ruby", - "name": "visionai", - "name_pretty": "Vision AI V1 API", - "product_documentation": "https://cloud.google.com/vision-ai/docs", - "release_level": "unreleased", - "repo": "googleapis/google-cloud-ruby", - "requires_billing": true, - "ruby-cloud-description": "google-cloud-vision_ai-v1 is the official client library for the Vision AI V1 API. Note that google-cloud-vision_ai-v1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-vision_ai instead. See the readme for more details.", - "ruby-cloud-product-url": "https://cloud.google.com/vision-ai/docs", - "library_type": "GAPIC_AUTO" -} diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/.rubocop.yml b/owl-bot-staging/google-cloud-vision_ai-v1/.rubocop.yml deleted file mode 100644 index 16e71bee558f..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/.rubocop.yml +++ /dev/null @@ -1,33 +0,0 @@ -inherit_gem: - google-style: google-style.yml - -AllCops: - Exclude: - - "google-cloud-vision_ai-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-vision_ai-v1.rb" diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/.toys.rb b/owl-bot-staging/google-cloud-vision_ai-v1/.toys.rb deleted file mode 100644 index 177e22456e8a..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-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-vision_ai-v1/.yardopts b/owl-bot-staging/google-cloud-vision_ai-v1/.yardopts deleted file mode 100644 index a32152e31aaf..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/.yardopts +++ /dev/null @@ -1,12 +0,0 @@ ---no-private ---title="Vision AI 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-vision_ai-v1/AUTHENTICATION.md b/owl-bot-staging/google-cloud-vision_ai-v1/AUTHENTICATION.md deleted file mode 100644 index f7419a708f89..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/AUTHENTICATION.md +++ /dev/null @@ -1,122 +0,0 @@ -# Authentication - -The recommended way to authenticate to the google-cloud-vision_ai-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-vision_ai-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/vision_ai/v1" - -client = ::Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client.new do |config| - config.credentials = "path/to/credentialfile.json" -end -``` - -To configure a credentials file globally for all clients: - -```ruby -require "google/cloud/vision_ai/v1" - -::Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client.configure do |config| - config.credentials = "path/to/credentialfile.json" -end - -client = ::Google::Cloud::VisionAI::V1::LiveVideoAnalytics::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-vision_ai-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/vision_ai/v1" - -ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" - -client = ::Google::Cloud::VisionAI::V1::LiveVideoAnalytics::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-vision_ai-v1/CHANGELOG.md b/owl-bot-staging/google-cloud-vision_ai-v1/CHANGELOG.md deleted file mode 100644 index f88957a62ba2..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/CHANGELOG.md +++ /dev/null @@ -1,2 +0,0 @@ -# Release History - diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/Gemfile b/owl-bot-staging/google-cloud-vision_ai-v1/Gemfile deleted file mode 100644 index 1d08558908d8..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/Gemfile +++ /dev/null @@ -1,14 +0,0 @@ -source "https://rubygems.org" - -gemspec - -gem "google-style", "~> 1.32.0" -gem "irb", "~> 1.17" -gem "minitest", "~> 6.0.2" -gem "minitest-focus", "~> 1.4" -gem "minitest-mock", "~> 5.27" -gem "minitest-rg", "~> 5.3" -gem "ostruct", "~> 0.5.5" -gem "rake", ">= 13.0" -gem "redcarpet", "~> 3.6" -gem "yard", "~> 0.9" diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/LICENSE.md b/owl-bot-staging/google-cloud-vision_ai-v1/LICENSE.md deleted file mode 100644 index c261857ba6ad..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-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-vision_ai-v1/README.md b/owl-bot-staging/google-cloud-vision_ai-v1/README.md deleted file mode 100644 index 1dd8953d2ecb..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/README.md +++ /dev/null @@ -1,154 +0,0 @@ -# Ruby Client for the Vision AI V1 API - -API Client library for the Vision AI V1 API - -google-cloud-vision_ai-v1 is the official client library for the Vision AI V1 API. - -https://github.com/googleapis/google-cloud-ruby - -This gem is a _versioned_ client. It provides basic client classes for a -specific version of the Vision AI V1 API. Most users should consider using -the main client gem, -[google-cloud-vision_ai](https://rubygems.org/gems/google-cloud-vision_ai). -See the section below titled *Which client should I use?* for more information. - -## Installation - -``` -$ gem install google-cloud-vision_ai-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/visionai.googleapis.com) -1. [Set up authentication.](AUTHENTICATION.md) - -## Quick Start - -```ruby -require "google/cloud/vision_ai/v1" - -client = ::Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client.new -request = ::Google::Cloud::VisionAI::V1::ListPublicOperatorsRequest.new # (request fields as keyword arguments...) -response = client.list_public_operators request -``` - -View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-vision_ai-v1/latest) -for class and method documentation. - -See also the [Product Documentation](https://cloud.google.com/vision-ai/docs) -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/vision_ai/v1" -require "logger" - -client = ::Google::Cloud::VisionAI::V1::LiveVideoAnalytics::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-vision_ai`, -and lower-level _versioned_ client libraries with names such as -`google-cloud-vision_ai-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-vision_ai`. -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-vision_ai-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-vision_ai-v1/Rakefile b/owl-bot-staging/google-cloud-vision_ai-v1/Rakefile deleted file mode 100644 index 604a1a8e81f8..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-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-vision_ai-v1 acceptance tests." -task :acceptance, :project, :keyfile do |t, args| - project = args[:project] - project ||= - ENV["GOOGLE_CLOUD_TEST_PROJECT"] || - ENV["GCLOUD_TEST_PROJECT"] - keyfile = args[:keyfile] - keyfile ||= - ENV["GOOGLE_CLOUD_TEST_KEYFILE"] || - ENV["GCLOUD_TEST_KEYFILE"] - if keyfile - keyfile = File.read keyfile - else - keyfile ||= - ENV["GOOGLE_CLOUD_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 GOOGLE_CLOUD_TEST_PROJECT=test123 GOOGLE_CLOUD_TEST_KEYFILE=/path/to/keyfile.json rake acceptance" - end - require "google/cloud/vision_ai/v1/live_video_analytics/credentials" - ::Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Credentials.env_vars.each do |path| - ENV[path] = nil - end - ENV["GOOGLE_CLOUD_PROJECT"] = project - ENV["GOOGLE_CLOUD_TEST_PROJECT"] = project - ENV["GOOGLE_CLOUD_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-vision_ai-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-vision_ai-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-vision_ai-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-vision_ai-v1 gem does not have doctest tests." -end - -desc "Run the CI build" -task :ci do - header "BUILDING google-cloud-vision_ai-v1" - header "google-cloud-vision_ai-v1 rubocop", "*" - Rake::Task[:rubocop].invoke - header "google-cloud-vision_ai-v1 yard", "*" - Rake::Task[:yard].invoke - header "google-cloud-vision_ai-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-vision_ai-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-vision_ai-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-vision_ai-v1/gapic_metadata.json b/owl-bot-staging/google-cloud-vision_ai-v1/gapic_metadata.json deleted file mode 100644 index 76a1b675ccdf..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/gapic_metadata.json +++ /dev/null @@ -1,748 +0,0 @@ -{ - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", - "language": "ruby", - "protoPackage": "google.cloud.visionai.v1", - "libraryPackage": "::Google::Cloud::VisionAI::V1", - "services": { - "LiveVideoAnalytics": { - "clients": { - "grpc": { - "libraryClient": "::Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client", - "rpcs": { - "ListPublicOperators": { - "methods": [ - "list_public_operators" - ] - }, - "ResolveOperatorInfo": { - "methods": [ - "resolve_operator_info" - ] - }, - "ListOperators": { - "methods": [ - "list_operators" - ] - }, - "GetOperator": { - "methods": [ - "get_operator" - ] - }, - "CreateOperator": { - "methods": [ - "create_operator" - ] - }, - "UpdateOperator": { - "methods": [ - "update_operator" - ] - }, - "DeleteOperator": { - "methods": [ - "delete_operator" - ] - }, - "ListAnalyses": { - "methods": [ - "list_analyses" - ] - }, - "GetAnalysis": { - "methods": [ - "get_analysis" - ] - }, - "CreateAnalysis": { - "methods": [ - "create_analysis" - ] - }, - "UpdateAnalysis": { - "methods": [ - "update_analysis" - ] - }, - "DeleteAnalysis": { - "methods": [ - "delete_analysis" - ] - }, - "ListProcesses": { - "methods": [ - "list_processes" - ] - }, - "GetProcess": { - "methods": [ - "get_process" - ] - }, - "CreateProcess": { - "methods": [ - "create_process" - ] - }, - "UpdateProcess": { - "methods": [ - "update_process" - ] - }, - "DeleteProcess": { - "methods": [ - "delete_process" - ] - }, - "BatchRunProcess": { - "methods": [ - "batch_run_process" - ] - } - } - } - } - }, - "AppPlatform": { - "clients": { - "grpc": { - "libraryClient": "::Google::Cloud::VisionAI::V1::AppPlatform::Client", - "rpcs": { - "ListApplications": { - "methods": [ - "list_applications" - ] - }, - "GetApplication": { - "methods": [ - "get_application" - ] - }, - "CreateApplication": { - "methods": [ - "create_application" - ] - }, - "UpdateApplication": { - "methods": [ - "update_application" - ] - }, - "DeleteApplication": { - "methods": [ - "delete_application" - ] - }, - "DeployApplication": { - "methods": [ - "deploy_application" - ] - }, - "UndeployApplication": { - "methods": [ - "undeploy_application" - ] - }, - "AddApplicationStreamInput": { - "methods": [ - "add_application_stream_input" - ] - }, - "RemoveApplicationStreamInput": { - "methods": [ - "remove_application_stream_input" - ] - }, - "UpdateApplicationStreamInput": { - "methods": [ - "update_application_stream_input" - ] - }, - "ListInstances": { - "methods": [ - "list_instances" - ] - }, - "GetInstance": { - "methods": [ - "get_instance" - ] - }, - "CreateApplicationInstances": { - "methods": [ - "create_application_instances" - ] - }, - "DeleteApplicationInstances": { - "methods": [ - "delete_application_instances" - ] - }, - "UpdateApplicationInstances": { - "methods": [ - "update_application_instances" - ] - }, - "ListDrafts": { - "methods": [ - "list_drafts" - ] - }, - "GetDraft": { - "methods": [ - "get_draft" - ] - }, - "CreateDraft": { - "methods": [ - "create_draft" - ] - }, - "UpdateDraft": { - "methods": [ - "update_draft" - ] - }, - "DeleteDraft": { - "methods": [ - "delete_draft" - ] - }, - "ListProcessors": { - "methods": [ - "list_processors" - ] - }, - "ListPrebuiltProcessors": { - "methods": [ - "list_prebuilt_processors" - ] - }, - "GetProcessor": { - "methods": [ - "get_processor" - ] - }, - "CreateProcessor": { - "methods": [ - "create_processor" - ] - }, - "UpdateProcessor": { - "methods": [ - "update_processor" - ] - }, - "DeleteProcessor": { - "methods": [ - "delete_processor" - ] - } - } - } - } - }, - "StreamingService": { - "clients": { - "grpc": { - "libraryClient": "::Google::Cloud::VisionAI::V1::StreamingService::Client", - "rpcs": { - "SendPackets": { - "methods": [ - "send_packets" - ] - }, - "ReceivePackets": { - "methods": [ - "receive_packets" - ] - }, - "ReceiveEvents": { - "methods": [ - "receive_events" - ] - }, - "AcquireLease": { - "methods": [ - "acquire_lease" - ] - }, - "RenewLease": { - "methods": [ - "renew_lease" - ] - }, - "ReleaseLease": { - "methods": [ - "release_lease" - ] - } - } - } - } - }, - "StreamsService": { - "clients": { - "grpc": { - "libraryClient": "::Google::Cloud::VisionAI::V1::StreamsService::Client", - "rpcs": { - "ListClusters": { - "methods": [ - "list_clusters" - ] - }, - "GetCluster": { - "methods": [ - "get_cluster" - ] - }, - "CreateCluster": { - "methods": [ - "create_cluster" - ] - }, - "UpdateCluster": { - "methods": [ - "update_cluster" - ] - }, - "DeleteCluster": { - "methods": [ - "delete_cluster" - ] - }, - "ListStreams": { - "methods": [ - "list_streams" - ] - }, - "GetStream": { - "methods": [ - "get_stream" - ] - }, - "CreateStream": { - "methods": [ - "create_stream" - ] - }, - "UpdateStream": { - "methods": [ - "update_stream" - ] - }, - "DeleteStream": { - "methods": [ - "delete_stream" - ] - }, - "GetStreamThumbnail": { - "methods": [ - "get_stream_thumbnail" - ] - }, - "GenerateStreamHlsToken": { - "methods": [ - "generate_stream_hls_token" - ] - }, - "ListEvents": { - "methods": [ - "list_events" - ] - }, - "GetEvent": { - "methods": [ - "get_event" - ] - }, - "CreateEvent": { - "methods": [ - "create_event" - ] - }, - "UpdateEvent": { - "methods": [ - "update_event" - ] - }, - "DeleteEvent": { - "methods": [ - "delete_event" - ] - }, - "ListSeries": { - "methods": [ - "list_series" - ] - }, - "GetSeries": { - "methods": [ - "get_series" - ] - }, - "CreateSeries": { - "methods": [ - "create_series" - ] - }, - "UpdateSeries": { - "methods": [ - "update_series" - ] - }, - "DeleteSeries": { - "methods": [ - "delete_series" - ] - }, - "MaterializeChannel": { - "methods": [ - "materialize_channel" - ] - } - } - } - } - }, - "Warehouse": { - "clients": { - "grpc": { - "libraryClient": "::Google::Cloud::VisionAI::V1::Warehouse::Client", - "rpcs": { - "CreateAsset": { - "methods": [ - "create_asset" - ] - }, - "UpdateAsset": { - "methods": [ - "update_asset" - ] - }, - "GetAsset": { - "methods": [ - "get_asset" - ] - }, - "ListAssets": { - "methods": [ - "list_assets" - ] - }, - "DeleteAsset": { - "methods": [ - "delete_asset" - ] - }, - "UploadAsset": { - "methods": [ - "upload_asset" - ] - }, - "GenerateRetrievalUrl": { - "methods": [ - "generate_retrieval_url" - ] - }, - "AnalyzeAsset": { - "methods": [ - "analyze_asset" - ] - }, - "IndexAsset": { - "methods": [ - "index_asset" - ] - }, - "RemoveIndexAsset": { - "methods": [ - "remove_index_asset" - ] - }, - "ViewIndexedAssets": { - "methods": [ - "view_indexed_assets" - ] - }, - "CreateIndex": { - "methods": [ - "create_index" - ] - }, - "UpdateIndex": { - "methods": [ - "update_index" - ] - }, - "GetIndex": { - "methods": [ - "get_index" - ] - }, - "ListIndexes": { - "methods": [ - "list_indexes" - ] - }, - "DeleteIndex": { - "methods": [ - "delete_index" - ] - }, - "CreateCorpus": { - "methods": [ - "create_corpus" - ] - }, - "GetCorpus": { - "methods": [ - "get_corpus" - ] - }, - "UpdateCorpus": { - "methods": [ - "update_corpus" - ] - }, - "ListCorpora": { - "methods": [ - "list_corpora" - ] - }, - "DeleteCorpus": { - "methods": [ - "delete_corpus" - ] - }, - "AnalyzeCorpus": { - "methods": [ - "analyze_corpus" - ] - }, - "CreateDataSchema": { - "methods": [ - "create_data_schema" - ] - }, - "UpdateDataSchema": { - "methods": [ - "update_data_schema" - ] - }, - "GetDataSchema": { - "methods": [ - "get_data_schema" - ] - }, - "DeleteDataSchema": { - "methods": [ - "delete_data_schema" - ] - }, - "ListDataSchemas": { - "methods": [ - "list_data_schemas" - ] - }, - "CreateAnnotation": { - "methods": [ - "create_annotation" - ] - }, - "GetAnnotation": { - "methods": [ - "get_annotation" - ] - }, - "ListAnnotations": { - "methods": [ - "list_annotations" - ] - }, - "UpdateAnnotation": { - "methods": [ - "update_annotation" - ] - }, - "DeleteAnnotation": { - "methods": [ - "delete_annotation" - ] - }, - "IngestAsset": { - "methods": [ - "ingest_asset" - ] - }, - "ClipAsset": { - "methods": [ - "clip_asset" - ] - }, - "GenerateHlsUri": { - "methods": [ - "generate_hls_uri" - ] - }, - "ImportAssets": { - "methods": [ - "import_assets" - ] - }, - "CreateSearchConfig": { - "methods": [ - "create_search_config" - ] - }, - "UpdateSearchConfig": { - "methods": [ - "update_search_config" - ] - }, - "GetSearchConfig": { - "methods": [ - "get_search_config" - ] - }, - "DeleteSearchConfig": { - "methods": [ - "delete_search_config" - ] - }, - "ListSearchConfigs": { - "methods": [ - "list_search_configs" - ] - }, - "CreateSearchHypernym": { - "methods": [ - "create_search_hypernym" - ] - }, - "UpdateSearchHypernym": { - "methods": [ - "update_search_hypernym" - ] - }, - "GetSearchHypernym": { - "methods": [ - "get_search_hypernym" - ] - }, - "DeleteSearchHypernym": { - "methods": [ - "delete_search_hypernym" - ] - }, - "ListSearchHypernyms": { - "methods": [ - "list_search_hypernyms" - ] - }, - "SearchAssets": { - "methods": [ - "search_assets" - ] - }, - "SearchIndexEndpoint": { - "methods": [ - "search_index_endpoint" - ] - }, - "CreateIndexEndpoint": { - "methods": [ - "create_index_endpoint" - ] - }, - "GetIndexEndpoint": { - "methods": [ - "get_index_endpoint" - ] - }, - "ListIndexEndpoints": { - "methods": [ - "list_index_endpoints" - ] - }, - "UpdateIndexEndpoint": { - "methods": [ - "update_index_endpoint" - ] - }, - "DeleteIndexEndpoint": { - "methods": [ - "delete_index_endpoint" - ] - }, - "DeployIndex": { - "methods": [ - "deploy_index" - ] - }, - "UndeployIndex": { - "methods": [ - "undeploy_index" - ] - }, - "CreateCollection": { - "methods": [ - "create_collection" - ] - }, - "DeleteCollection": { - "methods": [ - "delete_collection" - ] - }, - "GetCollection": { - "methods": [ - "get_collection" - ] - }, - "UpdateCollection": { - "methods": [ - "update_collection" - ] - }, - "ListCollections": { - "methods": [ - "list_collections" - ] - }, - "AddCollectionItem": { - "methods": [ - "add_collection_item" - ] - }, - "RemoveCollectionItem": { - "methods": [ - "remove_collection_item" - ] - }, - "ViewCollectionItems": { - "methods": [ - "view_collection_items" - ] - } - } - } - } - }, - "HealthCheckService": { - "clients": { - "grpc": { - "libraryClient": "::Google::Cloud::VisionAI::V1::HealthCheckService::Client", - "rpcs": { - "HealthCheck": { - "methods": [ - "health_check" - ] - } - } - } - } - } - } -} diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/google-cloud-vision_ai-v1.gemspec b/owl-bot-staging/google-cloud-vision_ai-v1/google-cloud-vision_ai-v1.gemspec deleted file mode 100644 index 5957dadd3da9..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/google-cloud-vision_ai-v1.gemspec +++ /dev/null @@ -1,30 +0,0 @@ -# -*- ruby -*- -# encoding: utf-8 - -require File.expand_path("lib/google/cloud/vision_ai/v1/version", __dir__) - -Gem::Specification.new do |gem| - gem.name = "google-cloud-vision_ai-v1" - gem.version = Google::Cloud::VisionAI::V1::VERSION - - gem.authors = ["Google LLC"] - gem.email = "googleapis-packages@google.com" - gem.description = "google-cloud-vision_ai-v1 is the official client library for the Vision AI V1 API. Note that google-cloud-vision_ai-v1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-vision_ai instead. See the readme for more details." - gem.summary = "API Client library for the Vision AI V1 API" - 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.2" - - 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-vision_ai-v1/lib/google-cloud-vision_ai-v1.rb b/owl-bot-staging/google-cloud-vision_ai-v1/lib/google-cloud-vision_ai-v1.rb deleted file mode 100644 index 75eb1d114bb3..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/lib/google-cloud-vision_ai-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/vision_ai/v1" diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1.rb b/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1.rb deleted file mode 100644 index a4cc7739037e..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1.rb +++ /dev/null @@ -1,50 +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/vision_ai/v1/live_video_analytics" -require "google/cloud/vision_ai/v1/app_platform" -require "google/cloud/vision_ai/v1/streaming_service" -require "google/cloud/vision_ai/v1/streams_service" -require "google/cloud/vision_ai/v1/warehouse" -require "google/cloud/vision_ai/v1/health_check_service" -require "google/cloud/vision_ai/v1/version" - -module Google - module Cloud - module VisionAI - ## - # API client module. - # - # @example Load this package, including all its services, and instantiate a gRPC client - # - # require "google/cloud/vision_ai/v1" - # client = ::Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client.new - # - # @example Load this package, including all its services, and instantiate a REST client - # - # require "google/cloud/vision_ai/v1" - # client = ::Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Rest::Client.new - # - module V1 - end - end - end -end - -helper_path = ::File.join __dir__, "v1", "_helpers.rb" -require "google/cloud/vision_ai/v1/_helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/app_platform.rb b/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/app_platform.rb deleted file mode 100644 index f8c7a42a31d5..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/app_platform.rb +++ /dev/null @@ -1,56 +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/vision_ai/v1/version" - -require "google/cloud/vision_ai/v1/app_platform/credentials" -require "google/cloud/vision_ai/v1/app_platform/paths" -require "google/cloud/vision_ai/v1/app_platform/operations" -require "google/cloud/vision_ai/v1/app_platform/client" -require "google/cloud/vision_ai/v1/app_platform/rest" - -module Google - module Cloud - module VisionAI - module V1 - ## - # Service describing handlers for resources - # - # @example Load this service and instantiate a gRPC client - # - # require "google/cloud/vision_ai/v1/app_platform" - # client = ::Google::Cloud::VisionAI::V1::AppPlatform::Client.new - # - # @example Load this service and instantiate a REST client - # - # require "google/cloud/vision_ai/v1/app_platform/rest" - # client = ::Google::Cloud::VisionAI::V1::AppPlatform::Rest::Client.new - # - module AppPlatform - end - end - end - end -end - -helper_path = ::File.join __dir__, "app_platform", "helpers.rb" -require "google/cloud/vision_ai/v1/app_platform/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/app_platform/client.rb b/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/app_platform/client.rb deleted file mode 100644 index 27dcef0fbd95..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/app_platform/client.rb +++ /dev/null @@ -1,3365 +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/visionai/v1/platform_pb" -require "google/cloud/location" -require "google/iam/v1" - -module Google - module Cloud - module VisionAI - module V1 - module AppPlatform - ## - # Client for the AppPlatform service. - # - # Service describing handlers for resources - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "visionai.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :app_platform_stub - - ## - # Configure the AppPlatform Client class. - # - # See {::Google::Cloud::VisionAI::V1::AppPlatform::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all AppPlatform clients - # ::Google::Cloud::VisionAI::V1::AppPlatform::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", "VisionAI", "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 - end - yield @configure if block_given? - @configure - end - - ## - # Configure the AppPlatform 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::VisionAI::V1::AppPlatform::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 - @app_platform_stub.universe_domain - end - - ## - # Create a new AppPlatform client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::VisionAI::V1::AppPlatform::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::VisionAI::V1::AppPlatform::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the AppPlatform 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/visionai/v1/platform_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 - - @app_platform_stub = ::Gapic::ServiceStub.new( - ::Google::Cloud::VisionAI::V1::AppPlatform::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 - ) - - @app_platform_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 = @app_platform_stub.endpoint - config.universe_domain = @app_platform_stub.universe_domain - config.logger = @app_platform_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 = @app_platform_stub.endpoint - config.universe_domain = @app_platform_stub.universe_domain - config.logger = @app_platform_stub.logger if config.respond_to? :logger= - end - end - - ## - # Get the associated client for long-running operations. - # - # @return [::Google::Cloud::VisionAI::V1::AppPlatform::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 - @app_platform_stub.logger - end - - # Service calls - - ## - # Lists Applications in a given project and location. - # - # @overload list_applications(request, options = nil) - # Pass arguments to `list_applications` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::ListApplicationsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::ListApplicationsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_applications(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) - # Pass arguments to `list_applications` via keyword arguments. Note that at - # least one keyword argument is 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. Parent value for ListApplicationsRequest. - # @param page_size [::Integer] - # Requested page size. Server may return fewer items than requested. - # If unspecified, server will pick an appropriate default. - # @param page_token [::String] - # A token identifying a page of results the server should return. - # @param filter [::String] - # Filtering results. - # @param order_by [::String] - # Hint for how to order the results. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::VisionAI::V1::Application>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::VisionAI::V1::Application>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::AppPlatform::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::ListApplicationsRequest.new - # - # # Call the list_applications method. - # result = client.list_applications 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::VisionAI::V1::Application. - # p item - # end - # - def list_applications request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::ListApplicationsRequest - - # Converts hash 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_applications.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::VisionAI::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_applications.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_applications.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @app_platform_stub.call_rpc :list_applications, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @app_platform_stub, :list_applications, 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 - - ## - # Gets details of a single Application. - # - # @overload get_application(request, options = nil) - # Pass arguments to `get_application` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::GetApplicationRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::GetApplicationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_application(name: nil) - # Pass arguments to `get_application` via keyword arguments. Note that at - # least one keyword argument is 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 resource. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::VisionAI::V1::Application] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::VisionAI::V1::Application] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::AppPlatform::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::GetApplicationRequest.new - # - # # Call the get_application method. - # result = client.get_application request - # - # # The returned object is of type Google::Cloud::VisionAI::V1::Application. - # p result - # - def get_application request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::GetApplicationRequest - - # Converts hash 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_application.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::VisionAI::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_application.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_application.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @app_platform_stub.call_rpc :get_application, 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 Application in a given project and location. - # - # @overload create_application(request, options = nil) - # Pass arguments to `create_application` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::CreateApplicationRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::CreateApplicationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_application(parent: nil, application_id: nil, application: nil, request_id: nil) - # Pass arguments to `create_application` via keyword arguments. Note that at - # least one keyword argument is 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. Value for parent. - # @param application_id [::String] - # Required. Id of the requesting object. - # @param application [::Google::Cloud::VisionAI::V1::Application, ::Hash] - # Required. The resource being created. - # @param request_id [::String] - # Optional. An optional request ID to identify requests. Specify a unique - # request ID so that if you must retry your request, the server will know to - # ignore the request if it has already been completed. The server will - # guarantee that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # - # @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/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::AppPlatform::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::CreateApplicationRequest.new - # - # # Call the create_application method. - # result = client.create_application 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_application request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::CreateApplicationRequest - - # Converts hash 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_application.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::VisionAI::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_application.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_application.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @app_platform_stub.call_rpc :create_application, 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 - - ## - # Updates the parameters of a single Application. - # - # @overload update_application(request, options = nil) - # Pass arguments to `update_application` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::UpdateApplicationRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::UpdateApplicationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_application(update_mask: nil, application: nil, request_id: nil) - # Pass arguments to `update_application` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Optional. Field mask is used to specify the fields to be overwritten in the - # Application resource by the update. - # The fields specified in the update_mask are relative to the resource, not - # the full request. A field will be overwritten if it is in the mask. If the - # user does not provide a mask then all fields will be overwritten. - # @param application [::Google::Cloud::VisionAI::V1::Application, ::Hash] - # Required. The resource being updated. - # @param request_id [::String] - # Optional. An optional request ID to identify requests. Specify a unique - # request ID so that if you must retry your request, the server will know to - # ignore the request if it has already been completed. The server will - # guarantee that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # - # @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/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::AppPlatform::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::UpdateApplicationRequest.new - # - # # Call the update_application method. - # result = client.update_application 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 update_application request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::UpdateApplicationRequest - - # Converts hash 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_application.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::VisionAI::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.application&.name - header_params["application.name"] = request.application.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_application.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_application.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @app_platform_stub.call_rpc :update_application, 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 single Application. - # - # @overload delete_application(request, options = nil) - # Pass arguments to `delete_application` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::DeleteApplicationRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::DeleteApplicationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_application(name: nil, request_id: nil, force: nil) - # Pass arguments to `delete_application` via keyword arguments. Note that at - # least one keyword argument is 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 resource. - # @param request_id [::String] - # Optional. An optional request ID to identify requests. Specify a unique - # request ID so that if you must retry your request, the server will know to - # ignore the request if it has already been completed. The server will - # guarantee that for at least 60 minutes after the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @param force [::Boolean] - # Optional. If set to true, any instances and drafts from this application - # will also be deleted. (Otherwise, the request will only work if the - # application has no instances and drafts.) - # - # @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/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::AppPlatform::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::DeleteApplicationRequest.new - # - # # Call the delete_application method. - # result = client.delete_application 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_application request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::DeleteApplicationRequest - - # Converts hash 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_application.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::VisionAI::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_application.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_application.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @app_platform_stub.call_rpc :delete_application, 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 - - ## - # Deploys a single Application. - # - # @overload deploy_application(request, options = nil) - # Pass arguments to `deploy_application` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::DeployApplicationRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::DeployApplicationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload deploy_application(name: nil, validate_only: nil, request_id: nil, enable_monitoring: nil) - # Pass arguments to `deploy_application` via keyword arguments. Note that at - # least one keyword argument is 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 name of the application to retrieve. - # Format: - # "projects/\\{project}/locations/\\{location}/applications/\\{application}" - # @param validate_only [::Boolean] - # If set, validate the request and preview the application graph, but do not - # actually deploy it. - # @param request_id [::String] - # Optional. An optional request ID to identify requests. Specify a unique - # request ID so that if you must retry your request, the server will know to - # ignore the request if it has already been completed. The server will - # guarantee that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @param enable_monitoring [::Boolean] - # Optional. Whether or not to enable monitoring for the application on - # deployment. - # - # @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/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::AppPlatform::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::DeployApplicationRequest.new - # - # # Call the deploy_application method. - # result = client.deploy_application 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 deploy_application request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::DeployApplicationRequest - - # Converts hash 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.deploy_application.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::VisionAI::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.deploy_application.timeout, - metadata: metadata, - retry_policy: @config.rpcs.deploy_application.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @app_platform_stub.call_rpc :deploy_application, 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 - - ## - # Undeploys a single Application. - # - # @overload undeploy_application(request, options = nil) - # Pass arguments to `undeploy_application` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::UndeployApplicationRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::UndeployApplicationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload undeploy_application(name: nil, request_id: nil) - # Pass arguments to `undeploy_application` via keyword arguments. Note that at - # least one keyword argument is 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 name of the application to retrieve. - # Format: - # "projects/\\{project}/locations/\\{location}/applications/\\{application}" - # @param request_id [::String] - # Optional. An optional request ID to identify requests. Specify a unique - # request ID so that if you must retry your request, the server will know to - # ignore the request if it has already been completed. The server will - # guarantee that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # - # @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/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::AppPlatform::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::UndeployApplicationRequest.new - # - # # Call the undeploy_application method. - # result = client.undeploy_application 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 undeploy_application request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::UndeployApplicationRequest - - # Converts hash 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.undeploy_application.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::VisionAI::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.undeploy_application.timeout, - metadata: metadata, - retry_policy: @config.rpcs.undeploy_application.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @app_platform_stub.call_rpc :undeploy_application, 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 - - ## - # Adds target stream input to the Application. - # If the Application is deployed, the corresponding new Application instance - # will be created. If the stream has already been in the Application, the RPC - # will fail. - # - # @overload add_application_stream_input(request, options = nil) - # Pass arguments to `add_application_stream_input` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::AddApplicationStreamInputRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::AddApplicationStreamInputRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload add_application_stream_input(name: nil, application_stream_inputs: nil, request_id: nil) - # Pass arguments to `add_application_stream_input` via keyword arguments. Note that at - # least one keyword argument is 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 name of the application to retrieve. - # Format: - # "projects/\\{project}/locations/\\{location}/applications/\\{application}" - # @param application_stream_inputs [::Array<::Google::Cloud::VisionAI::V1::ApplicationStreamInput, ::Hash>] - # The stream inputs to add, the stream resource name is the key of each - # StreamInput, and it must be unique within each application. - # @param request_id [::String] - # Optional. An optional request ID to identify requests. Specify a unique - # request ID so that if you must retry your request, the server will know to - # ignore the request if it has already been completed. The server will - # guarantee that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # - # @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/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::AppPlatform::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::AddApplicationStreamInputRequest.new - # - # # Call the add_application_stream_input method. - # result = client.add_application_stream_input 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 add_application_stream_input request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::AddApplicationStreamInputRequest - - # Converts hash 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.add_application_stream_input.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::VisionAI::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.add_application_stream_input.timeout, - metadata: metadata, - retry_policy: @config.rpcs.add_application_stream_input.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @app_platform_stub.call_rpc :add_application_stream_input, 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 - - ## - # Remove target stream input to the Application, if the Application is - # deployed, the corresponding instance based will be deleted. If the stream - # is not in the Application, the RPC will fail. - # - # @overload remove_application_stream_input(request, options = nil) - # Pass arguments to `remove_application_stream_input` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::RemoveApplicationStreamInputRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::RemoveApplicationStreamInputRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload remove_application_stream_input(name: nil, target_stream_inputs: nil, request_id: nil) - # Pass arguments to `remove_application_stream_input` via keyword arguments. Note that at - # least one keyword argument is 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 name of the application to retrieve. - # Format: - # "projects/\\{project}/locations/\\{location}/applications/\\{application}" - # @param target_stream_inputs [::Array<::Google::Cloud::VisionAI::V1::RemoveApplicationStreamInputRequest::TargetStreamInput, ::Hash>] - # The target stream to remove. - # @param request_id [::String] - # Optional. An optional request ID to identify requests. Specify a unique - # request ID so that if you must retry your request, the server will know to - # ignore the request if it has already been completed. The server will - # guarantee that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # - # @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/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::AppPlatform::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::RemoveApplicationStreamInputRequest.new - # - # # Call the remove_application_stream_input method. - # result = client.remove_application_stream_input 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 remove_application_stream_input request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::RemoveApplicationStreamInputRequest - - # Converts hash 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.remove_application_stream_input.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::VisionAI::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.remove_application_stream_input.timeout, - metadata: metadata, - retry_policy: @config.rpcs.remove_application_stream_input.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @app_platform_stub.call_rpc :remove_application_stream_input, 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 - - ## - # Update target stream input to the Application, if the Application is - # deployed, the corresponding instance based will be deployed. For - # CreateOrUpdate behavior, set allow_missing to true. - # - # @overload update_application_stream_input(request, options = nil) - # Pass arguments to `update_application_stream_input` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::UpdateApplicationStreamInputRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::UpdateApplicationStreamInputRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_application_stream_input(name: nil, application_stream_inputs: nil, request_id: nil, allow_missing: nil) - # Pass arguments to `update_application_stream_input` via keyword arguments. Note that at - # least one keyword argument is 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 name of the application to retrieve. - # Format: - # "projects/\\{project}/locations/\\{location}/applications/\\{application}" - # @param application_stream_inputs [::Array<::Google::Cloud::VisionAI::V1::ApplicationStreamInput, ::Hash>] - # The stream inputs to update, the stream resource name is the key of each - # StreamInput, and it must be unique within each application. - # @param request_id [::String] - # Optional. An optional request ID to identify requests. Specify a unique - # request ID so that if you must retry your request, the server will know to - # ignore the request if it has already been completed. The server will - # guarantee that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @param allow_missing [::Boolean] - # If true, UpdateApplicationStreamInput will insert stream input to - # application even if the target stream is not included in the application. - # - # @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/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::AppPlatform::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::UpdateApplicationStreamInputRequest.new - # - # # Call the update_application_stream_input method. - # result = client.update_application_stream_input 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 update_application_stream_input request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::UpdateApplicationStreamInputRequest - - # Converts hash 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_application_stream_input.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::VisionAI::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_application_stream_input.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_application_stream_input.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @app_platform_stub.call_rpc :update_application_stream_input, 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 - - ## - # Lists Instances in a given project and location. - # - # @overload list_instances(request, options = nil) - # Pass arguments to `list_instances` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::ListInstancesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::ListInstancesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_instances(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) - # Pass arguments to `list_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. Parent value for ListInstancesRequest. - # @param page_size [::Integer] - # Requested page size. Server may return fewer items than requested. - # If unspecified, server will pick an appropriate default. - # @param page_token [::String] - # A token identifying a page of results the server should return. - # @param filter [::String] - # Filtering results. - # @param order_by [::String] - # Hint for how to order the results. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::VisionAI::V1::Instance>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::VisionAI::V1::Instance>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::AppPlatform::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::ListInstancesRequest.new - # - # # Call the list_instances method. - # result = client.list_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::VisionAI::V1::Instance. - # p item - # end - # - def list_instances request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::ListInstancesRequest - - # Converts hash 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_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::VisionAI::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_instances.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_instances.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @app_platform_stub.call_rpc :list_instances, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @app_platform_stub, :list_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 - - ## - # Gets details of a single Instance. - # - # @overload get_instance(request, options = nil) - # Pass arguments to `get_instance` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::GetInstanceRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::GetInstanceRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_instance(name: nil) - # Pass arguments to `get_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. Name of the resource. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::VisionAI::V1::Instance] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::VisionAI::V1::Instance] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::AppPlatform::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::GetInstanceRequest.new - # - # # Call the get_instance method. - # result = client.get_instance request - # - # # The returned object is of type Google::Cloud::VisionAI::V1::Instance. - # p result - # - def get_instance request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::GetInstanceRequest - - # Converts hash 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_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::VisionAI::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_instance.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_instance.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @app_platform_stub.call_rpc :get_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 - - ## - # Adds target stream input to the Application. - # If the Application is deployed, the corresponding new Application instance - # will be created. If the stream has already been in the Application, the RPC - # will fail. - # - # @overload create_application_instances(request, options = nil) - # Pass arguments to `create_application_instances` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::CreateApplicationInstancesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::CreateApplicationInstancesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_application_instances(name: nil, application_instances: nil, request_id: nil) - # Pass arguments to `create_application_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 name [::String] - # Required. the name of the application to retrieve. - # Format: - # "projects/\\{project}/locations/\\{location}/applications/\\{application}" - # @param application_instances [::Array<::Google::Cloud::VisionAI::V1::ApplicationInstance, ::Hash>] - # Required. The resources being created. - # @param request_id [::String] - # Optional. An optional request ID to identify requests. Specify a unique - # request ID so that if you must retry your request, the server will know to - # ignore the request if it has already been completed. The server will - # guarantee that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # - # @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/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::AppPlatform::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::CreateApplicationInstancesRequest.new - # - # # Call the create_application_instances method. - # result = client.create_application_instances 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_application_instances request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::CreateApplicationInstancesRequest - - # Converts hash 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_application_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::VisionAI::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.create_application_instances.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_application_instances.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @app_platform_stub.call_rpc :create_application_instances, 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 - - ## - # Remove target stream input to the Application, if the Application is - # deployed, the corresponding instance based will be deleted. If the stream - # is not in the Application, the RPC will fail. - # - # @overload delete_application_instances(request, options = nil) - # Pass arguments to `delete_application_instances` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::DeleteApplicationInstancesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::DeleteApplicationInstancesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_application_instances(name: nil, instance_ids: nil, request_id: nil) - # Pass arguments to `delete_application_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 name [::String] - # Required. the name of the application to retrieve. - # Format: - # "projects/\\{project}/locations/\\{location}/applications/\\{application}" - # @param instance_ids [::Array<::String>] - # Required. Id of the requesting object. - # @param request_id [::String] - # Optional. An optional request ID to identify requests. Specify a unique - # request ID so that if you must retry your request, the server will know to - # ignore the request if it has already been completed. The server will - # guarantee that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # - # @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/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::AppPlatform::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::DeleteApplicationInstancesRequest.new - # - # # Call the delete_application_instances method. - # result = client.delete_application_instances 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_application_instances request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::DeleteApplicationInstancesRequest - - # Converts hash 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_application_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::VisionAI::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_application_instances.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_application_instances.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @app_platform_stub.call_rpc :delete_application_instances, 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 - - ## - # Adds target stream input to the Application. - # If the Application is deployed, the corresponding new Application instance - # will be created. If the stream has already been in the Application, the RPC - # will fail. - # - # @overload update_application_instances(request, options = nil) - # Pass arguments to `update_application_instances` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::UpdateApplicationInstancesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::UpdateApplicationInstancesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_application_instances(name: nil, application_instances: nil, request_id: nil, allow_missing: nil) - # Pass arguments to `update_application_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 name [::String] - # Required. the name of the application to retrieve. - # Format: - # "projects/\\{project}/locations/\\{location}/applications/\\{application}" - # @param application_instances [::Array<::Google::Cloud::VisionAI::V1::UpdateApplicationInstancesRequest::UpdateApplicationInstance, ::Hash>] - # @param request_id [::String] - # Optional. An optional request ID to identify requests. Specify a unique - # request ID so that if you must retry your request, the server will know to - # ignore the request if it has already been completed. The server will - # guarantee that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @param allow_missing [::Boolean] - # If true, Update Request will create one resource if the target resource - # doesn't exist, this time, the field_mask will be ignored. - # - # @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/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::AppPlatform::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::UpdateApplicationInstancesRequest.new - # - # # Call the update_application_instances method. - # result = client.update_application_instances 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 update_application_instances request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::UpdateApplicationInstancesRequest - - # Converts hash 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_application_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::VisionAI::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_application_instances.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_application_instances.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @app_platform_stub.call_rpc :update_application_instances, 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 - - ## - # Lists Drafts in a given project and location. - # - # @overload list_drafts(request, options = nil) - # Pass arguments to `list_drafts` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::ListDraftsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::ListDraftsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_drafts(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) - # Pass arguments to `list_drafts` via keyword arguments. Note that at - # least one keyword argument is 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. Parent value for ListDraftsRequest. - # @param page_size [::Integer] - # Requested page size. Server may return fewer items than requested. - # If unspecified, server will pick an appropriate default. - # @param page_token [::String] - # A token identifying a page of results the server should return. - # @param filter [::String] - # Filtering results. - # @param order_by [::String] - # Hint for how to order the results. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::VisionAI::V1::Draft>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::VisionAI::V1::Draft>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::AppPlatform::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::ListDraftsRequest.new - # - # # Call the list_drafts method. - # result = client.list_drafts 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::VisionAI::V1::Draft. - # p item - # end - # - def list_drafts request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::ListDraftsRequest - - # Converts hash 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_drafts.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::VisionAI::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_drafts.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_drafts.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @app_platform_stub.call_rpc :list_drafts, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @app_platform_stub, :list_drafts, 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 - - ## - # Gets details of a single Draft. - # - # @overload get_draft(request, options = nil) - # Pass arguments to `get_draft` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::GetDraftRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::GetDraftRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_draft(name: nil) - # Pass arguments to `get_draft` via keyword arguments. Note that at - # least one keyword argument is 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 resource. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::VisionAI::V1::Draft] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::VisionAI::V1::Draft] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::AppPlatform::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::GetDraftRequest.new - # - # # Call the get_draft method. - # result = client.get_draft request - # - # # The returned object is of type Google::Cloud::VisionAI::V1::Draft. - # p result - # - def get_draft request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::GetDraftRequest - - # Converts hash 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_draft.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::VisionAI::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_draft.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_draft.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @app_platform_stub.call_rpc :get_draft, 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 Draft in a given project and location. - # - # @overload create_draft(request, options = nil) - # Pass arguments to `create_draft` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::CreateDraftRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::CreateDraftRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_draft(parent: nil, draft_id: nil, draft: nil, request_id: nil) - # Pass arguments to `create_draft` via keyword arguments. Note that at - # least one keyword argument is 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. Value for parent. - # @param draft_id [::String] - # Required. Id of the requesting object. - # @param draft [::Google::Cloud::VisionAI::V1::Draft, ::Hash] - # Required. The resource being created. - # @param request_id [::String] - # Optional. An optional request ID to identify requests. Specify a unique - # request ID so that if you must retry your request, the server will know to - # ignore the request if it has already been completed. The server will - # guarantee that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # - # @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/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::AppPlatform::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::CreateDraftRequest.new - # - # # Call the create_draft method. - # result = client.create_draft 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_draft request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::CreateDraftRequest - - # Converts hash 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_draft.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::VisionAI::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_draft.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_draft.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @app_platform_stub.call_rpc :create_draft, 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 - - ## - # Updates the parameters of a single Draft. - # - # @overload update_draft(request, options = nil) - # Pass arguments to `update_draft` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::UpdateDraftRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::UpdateDraftRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_draft(update_mask: nil, draft: nil, request_id: nil, allow_missing: nil) - # Pass arguments to `update_draft` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Optional. Field mask is used to specify the fields to be overwritten in the - # Draft resource by the update. - # The fields specified in the update_mask are relative to the resource, not - # the full request. A field will be overwritten if it is in the mask. If the - # user does not provide a mask then all fields will be overwritten. - # @param draft [::Google::Cloud::VisionAI::V1::Draft, ::Hash] - # Required. The resource being updated. - # @param request_id [::String] - # Optional. An optional request ID to identify requests. Specify a unique - # request ID so that if you must retry your request, the server will know to - # ignore the request if it has already been completed. The server will - # guarantee that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @param allow_missing [::Boolean] - # If true, UpdateDraftRequest will create one resource if the target resource - # doesn't exist, this time, the field_mask will be ignored. - # - # @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/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::AppPlatform::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::UpdateDraftRequest.new - # - # # Call the update_draft method. - # result = client.update_draft 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 update_draft request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::UpdateDraftRequest - - # Converts hash 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_draft.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::VisionAI::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.draft&.name - header_params["draft.name"] = request.draft.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_draft.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_draft.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @app_platform_stub.call_rpc :update_draft, 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 single Draft. - # - # @overload delete_draft(request, options = nil) - # Pass arguments to `delete_draft` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::DeleteDraftRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::DeleteDraftRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_draft(name: nil, request_id: nil) - # Pass arguments to `delete_draft` via keyword arguments. Note that at - # least one keyword argument is 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 resource. - # @param request_id [::String] - # Optional. An optional request ID to identify requests. Specify a unique - # request ID so that if you must retry your request, the server will know to - # ignore the request if it has already been completed. The server will - # guarantee that for at least 60 minutes after the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # - # @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/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::AppPlatform::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::DeleteDraftRequest.new - # - # # Call the delete_draft method. - # result = client.delete_draft 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_draft request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::DeleteDraftRequest - - # Converts hash 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_draft.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::VisionAI::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_draft.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_draft.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @app_platform_stub.call_rpc :delete_draft, 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 - - ## - # Lists Processors in a given project and location. - # - # @overload list_processors(request, options = nil) - # Pass arguments to `list_processors` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::ListProcessorsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::ListProcessorsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_processors(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) - # Pass arguments to `list_processors` via keyword arguments. Note that at - # least one keyword argument is 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. Parent value for ListProcessorsRequest. - # @param page_size [::Integer] - # Requested page size. Server may return fewer items than requested. - # If unspecified, server will pick an appropriate default. - # @param page_token [::String] - # A token identifying a page of results the server should return. - # @param filter [::String] - # Filtering results. - # @param order_by [::String] - # Hint for how to order the results. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::VisionAI::V1::Processor>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::VisionAI::V1::Processor>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::AppPlatform::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::ListProcessorsRequest.new - # - # # Call the list_processors method. - # result = client.list_processors 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::VisionAI::V1::Processor. - # p item - # end - # - def list_processors request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::ListProcessorsRequest - - # Converts hash 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_processors.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::VisionAI::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_processors.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_processors.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @app_platform_stub.call_rpc :list_processors, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @app_platform_stub, :list_processors, 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 - - ## - # ListPrebuiltProcessors is a custom pass-through verb that Lists Prebuilt - # Processors. - # - # @overload list_prebuilt_processors(request, options = nil) - # Pass arguments to `list_prebuilt_processors` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::ListPrebuiltProcessorsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::ListPrebuiltProcessorsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_prebuilt_processors(parent: nil) - # Pass arguments to `list_prebuilt_processors` via keyword arguments. Note that at - # least one keyword argument is 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. Parent path. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::VisionAI::V1::ListPrebuiltProcessorsResponse] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::VisionAI::V1::ListPrebuiltProcessorsResponse] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::AppPlatform::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::ListPrebuiltProcessorsRequest.new - # - # # Call the list_prebuilt_processors method. - # result = client.list_prebuilt_processors request - # - # # The returned object is of type Google::Cloud::VisionAI::V1::ListPrebuiltProcessorsResponse. - # p result - # - def list_prebuilt_processors request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::ListPrebuiltProcessorsRequest - - # Converts hash 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_prebuilt_processors.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::VisionAI::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_prebuilt_processors.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_prebuilt_processors.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @app_platform_stub.call_rpc :list_prebuilt_processors, 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 - - ## - # Gets details of a single Processor. - # - # @overload get_processor(request, options = nil) - # Pass arguments to `get_processor` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::GetProcessorRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::GetProcessorRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_processor(name: nil) - # Pass arguments to `get_processor` via keyword arguments. Note that at - # least one keyword argument is 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 resource. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::VisionAI::V1::Processor] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::VisionAI::V1::Processor] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::AppPlatform::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::GetProcessorRequest.new - # - # # Call the get_processor method. - # result = client.get_processor request - # - # # The returned object is of type Google::Cloud::VisionAI::V1::Processor. - # p result - # - def get_processor request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::GetProcessorRequest - - # Converts hash 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_processor.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::VisionAI::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_processor.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_processor.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @app_platform_stub.call_rpc :get_processor, 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 Processor in a given project and location. - # - # @overload create_processor(request, options = nil) - # Pass arguments to `create_processor` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::CreateProcessorRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::CreateProcessorRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_processor(parent: nil, processor_id: nil, processor: nil, request_id: nil) - # Pass arguments to `create_processor` via keyword arguments. Note that at - # least one keyword argument is 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. Value for parent. - # @param processor_id [::String] - # Required. Id of the requesting object. - # @param processor [::Google::Cloud::VisionAI::V1::Processor, ::Hash] - # Required. The resource being created. - # @param request_id [::String] - # Optional. An optional request ID to identify requests. Specify a unique - # request ID so that if you must retry your request, the server will know to - # ignore the request if it has already been completed. The server will - # guarantee that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # - # @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/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::AppPlatform::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::CreateProcessorRequest.new - # - # # Call the create_processor method. - # result = client.create_processor 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_processor request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::CreateProcessorRequest - - # Converts hash 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_processor.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::VisionAI::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_processor.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_processor.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @app_platform_stub.call_rpc :create_processor, 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 - - ## - # Updates the parameters of a single Processor. - # - # @overload update_processor(request, options = nil) - # Pass arguments to `update_processor` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::UpdateProcessorRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::UpdateProcessorRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_processor(update_mask: nil, processor: nil, request_id: nil) - # Pass arguments to `update_processor` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Optional. Field mask is used to specify the fields to be overwritten in the - # Processor resource by the update. - # The fields specified in the update_mask are relative to the resource, not - # the full request. A field will be overwritten if it is in the mask. If the - # user does not provide a mask then all fields will be overwritten. - # @param processor [::Google::Cloud::VisionAI::V1::Processor, ::Hash] - # Required. The resource being updated. - # @param request_id [::String] - # Optional. An optional request ID to identify requests. Specify a unique - # request ID so that if you must retry your request, the server will know to - # ignore the request if it has already been completed. The server will - # guarantee that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # - # @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/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::AppPlatform::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::UpdateProcessorRequest.new - # - # # Call the update_processor method. - # result = client.update_processor 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 update_processor request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::UpdateProcessorRequest - - # Converts hash 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_processor.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::VisionAI::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.processor&.name - header_params["processor.name"] = request.processor.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_processor.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_processor.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @app_platform_stub.call_rpc :update_processor, 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 single Processor. - # - # @overload delete_processor(request, options = nil) - # Pass arguments to `delete_processor` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::DeleteProcessorRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::DeleteProcessorRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_processor(name: nil, request_id: nil) - # Pass arguments to `delete_processor` via keyword arguments. Note that at - # least one keyword argument is 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 resource - # @param request_id [::String] - # Optional. An optional request ID to identify requests. Specify a unique - # request ID so that if you must retry your request, the server will know to - # ignore the request if it has already been completed. The server will - # guarantee that for at least 60 minutes after the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # - # @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/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::AppPlatform::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::DeleteProcessorRequest.new - # - # # Call the delete_processor method. - # result = client.delete_processor 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_processor request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::DeleteProcessorRequest - - # Converts hash 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_processor.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::VisionAI::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_processor.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_processor.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @app_platform_stub.call_rpc :delete_processor, 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 AppPlatform API. - # - # This class represents the configuration for AppPlatform, - # 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::VisionAI::V1::AppPlatform::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_applications to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::VisionAI::V1::AppPlatform::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_applications.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::VisionAI::V1::AppPlatform::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_applications.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::VisionAI::V1::AppPlatform::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 = "visionai.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 AppPlatform 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_applications` - # @return [::Gapic::Config::Method] - # - attr_reader :list_applications - ## - # RPC-specific configuration for `get_application` - # @return [::Gapic::Config::Method] - # - attr_reader :get_application - ## - # RPC-specific configuration for `create_application` - # @return [::Gapic::Config::Method] - # - attr_reader :create_application - ## - # RPC-specific configuration for `update_application` - # @return [::Gapic::Config::Method] - # - attr_reader :update_application - ## - # RPC-specific configuration for `delete_application` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_application - ## - # RPC-specific configuration for `deploy_application` - # @return [::Gapic::Config::Method] - # - attr_reader :deploy_application - ## - # RPC-specific configuration for `undeploy_application` - # @return [::Gapic::Config::Method] - # - attr_reader :undeploy_application - ## - # RPC-specific configuration for `add_application_stream_input` - # @return [::Gapic::Config::Method] - # - attr_reader :add_application_stream_input - ## - # RPC-specific configuration for `remove_application_stream_input` - # @return [::Gapic::Config::Method] - # - attr_reader :remove_application_stream_input - ## - # RPC-specific configuration for `update_application_stream_input` - # @return [::Gapic::Config::Method] - # - attr_reader :update_application_stream_input - ## - # RPC-specific configuration for `list_instances` - # @return [::Gapic::Config::Method] - # - attr_reader :list_instances - ## - # RPC-specific configuration for `get_instance` - # @return [::Gapic::Config::Method] - # - attr_reader :get_instance - ## - # RPC-specific configuration for `create_application_instances` - # @return [::Gapic::Config::Method] - # - attr_reader :create_application_instances - ## - # RPC-specific configuration for `delete_application_instances` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_application_instances - ## - # RPC-specific configuration for `update_application_instances` - # @return [::Gapic::Config::Method] - # - attr_reader :update_application_instances - ## - # RPC-specific configuration for `list_drafts` - # @return [::Gapic::Config::Method] - # - attr_reader :list_drafts - ## - # RPC-specific configuration for `get_draft` - # @return [::Gapic::Config::Method] - # - attr_reader :get_draft - ## - # RPC-specific configuration for `create_draft` - # @return [::Gapic::Config::Method] - # - attr_reader :create_draft - ## - # RPC-specific configuration for `update_draft` - # @return [::Gapic::Config::Method] - # - attr_reader :update_draft - ## - # RPC-specific configuration for `delete_draft` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_draft - ## - # RPC-specific configuration for `list_processors` - # @return [::Gapic::Config::Method] - # - attr_reader :list_processors - ## - # RPC-specific configuration for `list_prebuilt_processors` - # @return [::Gapic::Config::Method] - # - attr_reader :list_prebuilt_processors - ## - # RPC-specific configuration for `get_processor` - # @return [::Gapic::Config::Method] - # - attr_reader :get_processor - ## - # RPC-specific configuration for `create_processor` - # @return [::Gapic::Config::Method] - # - attr_reader :create_processor - ## - # RPC-specific configuration for `update_processor` - # @return [::Gapic::Config::Method] - # - attr_reader :update_processor - ## - # RPC-specific configuration for `delete_processor` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_processor - - # @private - def initialize parent_rpcs = nil - list_applications_config = parent_rpcs.list_applications if parent_rpcs.respond_to? :list_applications - @list_applications = ::Gapic::Config::Method.new list_applications_config - get_application_config = parent_rpcs.get_application if parent_rpcs.respond_to? :get_application - @get_application = ::Gapic::Config::Method.new get_application_config - create_application_config = parent_rpcs.create_application if parent_rpcs.respond_to? :create_application - @create_application = ::Gapic::Config::Method.new create_application_config - update_application_config = parent_rpcs.update_application if parent_rpcs.respond_to? :update_application - @update_application = ::Gapic::Config::Method.new update_application_config - delete_application_config = parent_rpcs.delete_application if parent_rpcs.respond_to? :delete_application - @delete_application = ::Gapic::Config::Method.new delete_application_config - deploy_application_config = parent_rpcs.deploy_application if parent_rpcs.respond_to? :deploy_application - @deploy_application = ::Gapic::Config::Method.new deploy_application_config - undeploy_application_config = parent_rpcs.undeploy_application if parent_rpcs.respond_to? :undeploy_application - @undeploy_application = ::Gapic::Config::Method.new undeploy_application_config - add_application_stream_input_config = parent_rpcs.add_application_stream_input if parent_rpcs.respond_to? :add_application_stream_input - @add_application_stream_input = ::Gapic::Config::Method.new add_application_stream_input_config - remove_application_stream_input_config = parent_rpcs.remove_application_stream_input if parent_rpcs.respond_to? :remove_application_stream_input - @remove_application_stream_input = ::Gapic::Config::Method.new remove_application_stream_input_config - update_application_stream_input_config = parent_rpcs.update_application_stream_input if parent_rpcs.respond_to? :update_application_stream_input - @update_application_stream_input = ::Gapic::Config::Method.new update_application_stream_input_config - list_instances_config = parent_rpcs.list_instances if parent_rpcs.respond_to? :list_instances - @list_instances = ::Gapic::Config::Method.new list_instances_config - get_instance_config = parent_rpcs.get_instance if parent_rpcs.respond_to? :get_instance - @get_instance = ::Gapic::Config::Method.new get_instance_config - create_application_instances_config = parent_rpcs.create_application_instances if parent_rpcs.respond_to? :create_application_instances - @create_application_instances = ::Gapic::Config::Method.new create_application_instances_config - delete_application_instances_config = parent_rpcs.delete_application_instances if parent_rpcs.respond_to? :delete_application_instances - @delete_application_instances = ::Gapic::Config::Method.new delete_application_instances_config - update_application_instances_config = parent_rpcs.update_application_instances if parent_rpcs.respond_to? :update_application_instances - @update_application_instances = ::Gapic::Config::Method.new update_application_instances_config - list_drafts_config = parent_rpcs.list_drafts if parent_rpcs.respond_to? :list_drafts - @list_drafts = ::Gapic::Config::Method.new list_drafts_config - get_draft_config = parent_rpcs.get_draft if parent_rpcs.respond_to? :get_draft - @get_draft = ::Gapic::Config::Method.new get_draft_config - create_draft_config = parent_rpcs.create_draft if parent_rpcs.respond_to? :create_draft - @create_draft = ::Gapic::Config::Method.new create_draft_config - update_draft_config = parent_rpcs.update_draft if parent_rpcs.respond_to? :update_draft - @update_draft = ::Gapic::Config::Method.new update_draft_config - delete_draft_config = parent_rpcs.delete_draft if parent_rpcs.respond_to? :delete_draft - @delete_draft = ::Gapic::Config::Method.new delete_draft_config - list_processors_config = parent_rpcs.list_processors if parent_rpcs.respond_to? :list_processors - @list_processors = ::Gapic::Config::Method.new list_processors_config - list_prebuilt_processors_config = parent_rpcs.list_prebuilt_processors if parent_rpcs.respond_to? :list_prebuilt_processors - @list_prebuilt_processors = ::Gapic::Config::Method.new list_prebuilt_processors_config - get_processor_config = parent_rpcs.get_processor if parent_rpcs.respond_to? :get_processor - @get_processor = ::Gapic::Config::Method.new get_processor_config - create_processor_config = parent_rpcs.create_processor if parent_rpcs.respond_to? :create_processor - @create_processor = ::Gapic::Config::Method.new create_processor_config - update_processor_config = parent_rpcs.update_processor if parent_rpcs.respond_to? :update_processor - @update_processor = ::Gapic::Config::Method.new update_processor_config - delete_processor_config = parent_rpcs.delete_processor if parent_rpcs.respond_to? :delete_processor - @delete_processor = ::Gapic::Config::Method.new delete_processor_config - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/app_platform/credentials.rb b/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/app_platform/credentials.rb deleted file mode 100644 index a848b5bbc36c..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/app_platform/credentials.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! - -require "googleauth" - -module Google - module Cloud - module VisionAI - module V1 - module AppPlatform - # Credentials for the AppPlatform API. - class Credentials < ::Google::Auth::Credentials - self.scope = [ - "https://www.googleapis.com/auth/cloud-platform" - ] - self.env_vars = [ - "GOOGLE_CLOUD_CREDENTIALS", - "GOOGLE_CLOUD_KEYFILE", - "GCLOUD_KEYFILE", - "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-vision_ai-v1/lib/google/cloud/vision_ai/v1/app_platform/operations.rb b/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/app_platform/operations.rb deleted file mode 100644 index e7ceba645b5e..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/app_platform/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 VisionAI - module V1 - module AppPlatform - # Service that implements Longrunning Operations API. - class Operations - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "visionai.$UNIVERSE_DOMAIN$" - - # @private - attr_reader :operations_stub - - ## - # Configuration for the AppPlatform 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 AppPlatform 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::VisionAI::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::VisionAI::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::VisionAI::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::VisionAI::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::VisionAI::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 = "visionai.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-vision_ai-v1/lib/google/cloud/vision_ai/v1/app_platform/paths.rb b/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/app_platform/paths.rb deleted file mode 100644 index 03999e0934fe..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/app_platform/paths.rb +++ /dev/null @@ -1,151 +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 VisionAI - module V1 - module AppPlatform - # Path helper methods for the AppPlatform API. - module Paths - ## - # Create a fully-qualified Application resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/applications/{application}` - # - # @param project [String] - # @param location [String] - # @param application [String] - # - # @return [::String] - def application_path project:, location:, application: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/applications/#{application}" - end - - ## - # Create a fully-qualified Draft resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/applications/{application}/drafts/{draft}` - # - # @param project [String] - # @param location [String] - # @param application [String] - # @param draft [String] - # - # @return [::String] - def draft_path project:, location:, application:, draft: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "application cannot contain /" if application.to_s.include? "/" - - "projects/#{project}/locations/#{location}/applications/#{application}/drafts/#{draft}" - end - - ## - # Create a fully-qualified Instance resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/applications/{application}/instances/{instance}` - # - # @param project [String] - # @param location [String] - # @param application [String] - # @param instance [String] - # - # @return [::String] - def instance_path project:, location:, application:, instance: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "application cannot contain /" if application.to_s.include? "/" - - "projects/#{project}/locations/#{location}/applications/#{application}/instances/#{instance}" - 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 Processor resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/processors/{processor}` - # - # @param project [String] - # @param location [String] - # @param processor [String] - # - # @return [::String] - def processor_path project:, location:, processor: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/processors/#{processor}" - end - - ## - # Create a fully-qualified Stream resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/clusters/{cluster}/streams/{stream}` - # - # @param project [String] - # @param location [String] - # @param cluster [String] - # @param stream [String] - # - # @return [::String] - def stream_path project:, location:, cluster:, stream: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "cluster cannot contain /" if cluster.to_s.include? "/" - - "projects/#{project}/locations/#{location}/clusters/#{cluster}/streams/#{stream}" - end - - extend self - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/app_platform/rest.rb b/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/app_platform/rest.rb deleted file mode 100644 index b520ce69c50f..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/app_platform/rest.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! - -require "gapic/rest" -require "gapic/config" -require "gapic/config/method" - -require "google/cloud/vision_ai/v1/version" -require "google/cloud/vision_ai/v1/bindings_override" - -require "google/cloud/vision_ai/v1/app_platform/credentials" -require "google/cloud/vision_ai/v1/app_platform/paths" -require "google/cloud/vision_ai/v1/app_platform/rest/operations" -require "google/cloud/vision_ai/v1/app_platform/rest/client" - -module Google - module Cloud - module VisionAI - module V1 - ## - # Service describing handlers for resources - # - # To load this service and instantiate a REST client: - # - # require "google/cloud/vision_ai/v1/app_platform/rest" - # client = ::Google::Cloud::VisionAI::V1::AppPlatform::Rest::Client.new - # - module AppPlatform - # Client for the REST transport - module Rest - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "rest", "helpers.rb" -require "google/cloud/vision_ai/v1/app_platform/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/app_platform/rest/client.rb b/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/app_platform/rest/client.rb deleted file mode 100644 index 10aca3e68596..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/app_platform/rest/client.rb +++ /dev/null @@ -1,3148 +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/visionai/v1/platform_pb" -require "google/cloud/vision_ai/v1/app_platform/rest/service_stub" -require "google/cloud/location/rest" -require "google/iam/v1/rest" - -module Google - module Cloud - module VisionAI - module V1 - module AppPlatform - module Rest - ## - # REST client for the AppPlatform service. - # - # Service describing handlers for resources - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "visionai.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :app_platform_stub - - ## - # Configure the AppPlatform Client class. - # - # See {::Google::Cloud::VisionAI::V1::AppPlatform::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all AppPlatform clients - # ::Google::Cloud::VisionAI::V1::AppPlatform::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", "VisionAI", "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 - end - yield @configure if block_given? - @configure - end - - ## - # Configure the AppPlatform 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::VisionAI::V1::AppPlatform::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 - @app_platform_stub.universe_domain - end - - ## - # Create a new AppPlatform REST client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::VisionAI::V1::AppPlatform::Rest::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::VisionAI::V1::AppPlatform::Rest::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the AppPlatform 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::VisionAI::V1::AppPlatform::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 - - @app_platform_stub = ::Google::Cloud::VisionAI::V1::AppPlatform::Rest::ServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials, - logger: @config.logger - ) - - @app_platform_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 = @app_platform_stub.endpoint - config.universe_domain = @app_platform_stub.universe_domain - config.bindings_override = @config.bindings_override - config.logger = @app_platform_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 = @app_platform_stub.endpoint - config.universe_domain = @app_platform_stub.universe_domain - config.logger = @app_platform_stub.logger if config.respond_to? :logger= - end - end - - ## - # Get the associated client for long-running operations. - # - # @return [::Google::Cloud::VisionAI::V1::AppPlatform::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 - @app_platform_stub.logger - end - - # Service calls - - ## - # Lists Applications in a given project and location. - # - # @overload list_applications(request, options = nil) - # Pass arguments to `list_applications` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::ListApplicationsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::ListApplicationsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_applications(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) - # Pass arguments to `list_applications` via keyword arguments. Note that at - # least one keyword argument is 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. Parent value for ListApplicationsRequest. - # @param page_size [::Integer] - # Requested page size. Server may return fewer items than requested. - # If unspecified, server will pick an appropriate default. - # @param page_token [::String] - # A token identifying a page of results the server should return. - # @param filter [::String] - # Filtering results. - # @param order_by [::String] - # Hint for how to order the results. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::VisionAI::V1::Application>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::VisionAI::V1::Application>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::AppPlatform::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::ListApplicationsRequest.new - # - # # Call the list_applications method. - # result = client.list_applications 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::VisionAI::V1::Application. - # p item - # end - # - def list_applications request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::ListApplicationsRequest - - # Converts hash 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_applications.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::VisionAI::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_applications.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_applications.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @app_platform_stub.list_applications request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @app_platform_stub, :list_applications, "applications", 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 details of a single Application. - # - # @overload get_application(request, options = nil) - # Pass arguments to `get_application` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::GetApplicationRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::GetApplicationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_application(name: nil) - # Pass arguments to `get_application` via keyword arguments. Note that at - # least one keyword argument is 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 resource. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::VisionAI::V1::Application] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::VisionAI::V1::Application] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::AppPlatform::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::GetApplicationRequest.new - # - # # Call the get_application method. - # result = client.get_application request - # - # # The returned object is of type Google::Cloud::VisionAI::V1::Application. - # p result - # - def get_application request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::GetApplicationRequest - - # Converts hash 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_application.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::VisionAI::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_application.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_application.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @app_platform_stub.get_application 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 Application in a given project and location. - # - # @overload create_application(request, options = nil) - # Pass arguments to `create_application` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::CreateApplicationRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::CreateApplicationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_application(parent: nil, application_id: nil, application: nil, request_id: nil) - # Pass arguments to `create_application` via keyword arguments. Note that at - # least one keyword argument is 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. Value for parent. - # @param application_id [::String] - # Required. Id of the requesting object. - # @param application [::Google::Cloud::VisionAI::V1::Application, ::Hash] - # Required. The resource being created. - # @param request_id [::String] - # Optional. An optional request ID to identify requests. Specify a unique - # request ID so that if you must retry your request, the server will know to - # ignore the request if it has already been completed. The server will - # guarantee that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @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/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::AppPlatform::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::CreateApplicationRequest.new - # - # # Call the create_application method. - # result = client.create_application 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_application request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::CreateApplicationRequest - - # Converts hash 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_application.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::VisionAI::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_application.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_application.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @app_platform_stub.create_application 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 - - ## - # Updates the parameters of a single Application. - # - # @overload update_application(request, options = nil) - # Pass arguments to `update_application` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::UpdateApplicationRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::UpdateApplicationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_application(update_mask: nil, application: nil, request_id: nil) - # Pass arguments to `update_application` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Optional. Field mask is used to specify the fields to be overwritten in the - # Application resource by the update. - # The fields specified in the update_mask are relative to the resource, not - # the full request. A field will be overwritten if it is in the mask. If the - # user does not provide a mask then all fields will be overwritten. - # @param application [::Google::Cloud::VisionAI::V1::Application, ::Hash] - # Required. The resource being updated. - # @param request_id [::String] - # Optional. An optional request ID to identify requests. Specify a unique - # request ID so that if you must retry your request, the server will know to - # ignore the request if it has already been completed. The server will - # guarantee that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @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/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::AppPlatform::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::UpdateApplicationRequest.new - # - # # Call the update_application method. - # result = client.update_application 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 update_application request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::UpdateApplicationRequest - - # Converts hash 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_application.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::VisionAI::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_application.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_application.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @app_platform_stub.update_application 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 single Application. - # - # @overload delete_application(request, options = nil) - # Pass arguments to `delete_application` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::DeleteApplicationRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::DeleteApplicationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_application(name: nil, request_id: nil, force: nil) - # Pass arguments to `delete_application` via keyword arguments. Note that at - # least one keyword argument is 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 resource. - # @param request_id [::String] - # Optional. An optional request ID to identify requests. Specify a unique - # request ID so that if you must retry your request, the server will know to - # ignore the request if it has already been completed. The server will - # guarantee that for at least 60 minutes after the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @param force [::Boolean] - # Optional. If set to true, any instances and drafts from this application - # will also be deleted. (Otherwise, the request will only work if the - # application has no instances and drafts.) - # @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/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::AppPlatform::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::DeleteApplicationRequest.new - # - # # Call the delete_application method. - # result = client.delete_application 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_application request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::DeleteApplicationRequest - - # Converts hash 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_application.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::VisionAI::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_application.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_application.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @app_platform_stub.delete_application 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 - - ## - # Deploys a single Application. - # - # @overload deploy_application(request, options = nil) - # Pass arguments to `deploy_application` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::DeployApplicationRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::DeployApplicationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload deploy_application(name: nil, validate_only: nil, request_id: nil, enable_monitoring: nil) - # Pass arguments to `deploy_application` via keyword arguments. Note that at - # least one keyword argument is 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 name of the application to retrieve. - # Format: - # "projects/\\{project}/locations/\\{location}/applications/\\{application}" - # @param validate_only [::Boolean] - # If set, validate the request and preview the application graph, but do not - # actually deploy it. - # @param request_id [::String] - # Optional. An optional request ID to identify requests. Specify a unique - # request ID so that if you must retry your request, the server will know to - # ignore the request if it has already been completed. The server will - # guarantee that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @param enable_monitoring [::Boolean] - # Optional. Whether or not to enable monitoring for the application on - # deployment. - # @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/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::AppPlatform::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::DeployApplicationRequest.new - # - # # Call the deploy_application method. - # result = client.deploy_application 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 deploy_application request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::DeployApplicationRequest - - # Converts hash 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.deploy_application.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::VisionAI::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.deploy_application.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.deploy_application.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @app_platform_stub.deploy_application 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 - - ## - # Undeploys a single Application. - # - # @overload undeploy_application(request, options = nil) - # Pass arguments to `undeploy_application` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::UndeployApplicationRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::UndeployApplicationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload undeploy_application(name: nil, request_id: nil) - # Pass arguments to `undeploy_application` via keyword arguments. Note that at - # least one keyword argument is 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 name of the application to retrieve. - # Format: - # "projects/\\{project}/locations/\\{location}/applications/\\{application}" - # @param request_id [::String] - # Optional. An optional request ID to identify requests. Specify a unique - # request ID so that if you must retry your request, the server will know to - # ignore the request if it has already been completed. The server will - # guarantee that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @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/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::AppPlatform::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::UndeployApplicationRequest.new - # - # # Call the undeploy_application method. - # result = client.undeploy_application 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 undeploy_application request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::UndeployApplicationRequest - - # Converts hash 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.undeploy_application.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::VisionAI::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.undeploy_application.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.undeploy_application.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @app_platform_stub.undeploy_application 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 - - ## - # Adds target stream input to the Application. - # If the Application is deployed, the corresponding new Application instance - # will be created. If the stream has already been in the Application, the RPC - # will fail. - # - # @overload add_application_stream_input(request, options = nil) - # Pass arguments to `add_application_stream_input` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::AddApplicationStreamInputRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::AddApplicationStreamInputRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload add_application_stream_input(name: nil, application_stream_inputs: nil, request_id: nil) - # Pass arguments to `add_application_stream_input` via keyword arguments. Note that at - # least one keyword argument is 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 name of the application to retrieve. - # Format: - # "projects/\\{project}/locations/\\{location}/applications/\\{application}" - # @param application_stream_inputs [::Array<::Google::Cloud::VisionAI::V1::ApplicationStreamInput, ::Hash>] - # The stream inputs to add, the stream resource name is the key of each - # StreamInput, and it must be unique within each application. - # @param request_id [::String] - # Optional. An optional request ID to identify requests. Specify a unique - # request ID so that if you must retry your request, the server will know to - # ignore the request if it has already been completed. The server will - # guarantee that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @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/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::AppPlatform::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::AddApplicationStreamInputRequest.new - # - # # Call the add_application_stream_input method. - # result = client.add_application_stream_input 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 add_application_stream_input request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::AddApplicationStreamInputRequest - - # Converts hash 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.add_application_stream_input.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::VisionAI::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.add_application_stream_input.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.add_application_stream_input.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @app_platform_stub.add_application_stream_input 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 - - ## - # Remove target stream input to the Application, if the Application is - # deployed, the corresponding instance based will be deleted. If the stream - # is not in the Application, the RPC will fail. - # - # @overload remove_application_stream_input(request, options = nil) - # Pass arguments to `remove_application_stream_input` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::RemoveApplicationStreamInputRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::RemoveApplicationStreamInputRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload remove_application_stream_input(name: nil, target_stream_inputs: nil, request_id: nil) - # Pass arguments to `remove_application_stream_input` via keyword arguments. Note that at - # least one keyword argument is 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 name of the application to retrieve. - # Format: - # "projects/\\{project}/locations/\\{location}/applications/\\{application}" - # @param target_stream_inputs [::Array<::Google::Cloud::VisionAI::V1::RemoveApplicationStreamInputRequest::TargetStreamInput, ::Hash>] - # The target stream to remove. - # @param request_id [::String] - # Optional. An optional request ID to identify requests. Specify a unique - # request ID so that if you must retry your request, the server will know to - # ignore the request if it has already been completed. The server will - # guarantee that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @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/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::AppPlatform::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::RemoveApplicationStreamInputRequest.new - # - # # Call the remove_application_stream_input method. - # result = client.remove_application_stream_input 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 remove_application_stream_input request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::RemoveApplicationStreamInputRequest - - # Converts hash 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.remove_application_stream_input.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::VisionAI::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.remove_application_stream_input.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.remove_application_stream_input.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @app_platform_stub.remove_application_stream_input 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 - - ## - # Update target stream input to the Application, if the Application is - # deployed, the corresponding instance based will be deployed. For - # CreateOrUpdate behavior, set allow_missing to true. - # - # @overload update_application_stream_input(request, options = nil) - # Pass arguments to `update_application_stream_input` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::UpdateApplicationStreamInputRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::UpdateApplicationStreamInputRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_application_stream_input(name: nil, application_stream_inputs: nil, request_id: nil, allow_missing: nil) - # Pass arguments to `update_application_stream_input` via keyword arguments. Note that at - # least one keyword argument is 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 name of the application to retrieve. - # Format: - # "projects/\\{project}/locations/\\{location}/applications/\\{application}" - # @param application_stream_inputs [::Array<::Google::Cloud::VisionAI::V1::ApplicationStreamInput, ::Hash>] - # The stream inputs to update, the stream resource name is the key of each - # StreamInput, and it must be unique within each application. - # @param request_id [::String] - # Optional. An optional request ID to identify requests. Specify a unique - # request ID so that if you must retry your request, the server will know to - # ignore the request if it has already been completed. The server will - # guarantee that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @param allow_missing [::Boolean] - # If true, UpdateApplicationStreamInput will insert stream input to - # application even if the target stream is not included in the application. - # @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/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::AppPlatform::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::UpdateApplicationStreamInputRequest.new - # - # # Call the update_application_stream_input method. - # result = client.update_application_stream_input 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 update_application_stream_input request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::UpdateApplicationStreamInputRequest - - # Converts hash 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_application_stream_input.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::VisionAI::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_application_stream_input.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_application_stream_input.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @app_platform_stub.update_application_stream_input 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 - - ## - # Lists Instances in a given project and location. - # - # @overload list_instances(request, options = nil) - # Pass arguments to `list_instances` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::ListInstancesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::ListInstancesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_instances(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) - # Pass arguments to `list_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. Parent value for ListInstancesRequest. - # @param page_size [::Integer] - # Requested page size. Server may return fewer items than requested. - # If unspecified, server will pick an appropriate default. - # @param page_token [::String] - # A token identifying a page of results the server should return. - # @param filter [::String] - # Filtering results. - # @param order_by [::String] - # Hint for how to order the results. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::VisionAI::V1::Instance>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::VisionAI::V1::Instance>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::AppPlatform::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::ListInstancesRequest.new - # - # # Call the list_instances method. - # result = client.list_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::VisionAI::V1::Instance. - # p item - # end - # - def list_instances request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::ListInstancesRequest - - # Converts hash 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_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::VisionAI::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_instances.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_instances.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @app_platform_stub.list_instances request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @app_platform_stub, :list_instances, "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 - - ## - # Gets details of a single Instance. - # - # @overload get_instance(request, options = nil) - # Pass arguments to `get_instance` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::GetInstanceRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::GetInstanceRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_instance(name: nil) - # Pass arguments to `get_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. Name of the resource. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::VisionAI::V1::Instance] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::VisionAI::V1::Instance] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::AppPlatform::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::GetInstanceRequest.new - # - # # Call the get_instance method. - # result = client.get_instance request - # - # # The returned object is of type Google::Cloud::VisionAI::V1::Instance. - # p result - # - def get_instance request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::GetInstanceRequest - - # Converts hash 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_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::VisionAI::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_instance.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_instance.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @app_platform_stub.get_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 - - ## - # Adds target stream input to the Application. - # If the Application is deployed, the corresponding new Application instance - # will be created. If the stream has already been in the Application, the RPC - # will fail. - # - # @overload create_application_instances(request, options = nil) - # Pass arguments to `create_application_instances` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::CreateApplicationInstancesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::CreateApplicationInstancesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_application_instances(name: nil, application_instances: nil, request_id: nil) - # Pass arguments to `create_application_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 name [::String] - # Required. the name of the application to retrieve. - # Format: - # "projects/\\{project}/locations/\\{location}/applications/\\{application}" - # @param application_instances [::Array<::Google::Cloud::VisionAI::V1::ApplicationInstance, ::Hash>] - # Required. The resources being created. - # @param request_id [::String] - # Optional. An optional request ID to identify requests. Specify a unique - # request ID so that if you must retry your request, the server will know to - # ignore the request if it has already been completed. The server will - # guarantee that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @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/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::AppPlatform::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::CreateApplicationInstancesRequest.new - # - # # Call the create_application_instances method. - # result = client.create_application_instances 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_application_instances request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::CreateApplicationInstancesRequest - - # Converts hash 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_application_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::VisionAI::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_application_instances.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_application_instances.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @app_platform_stub.create_application_instances 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 - - ## - # Remove target stream input to the Application, if the Application is - # deployed, the corresponding instance based will be deleted. If the stream - # is not in the Application, the RPC will fail. - # - # @overload delete_application_instances(request, options = nil) - # Pass arguments to `delete_application_instances` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::DeleteApplicationInstancesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::DeleteApplicationInstancesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_application_instances(name: nil, instance_ids: nil, request_id: nil) - # Pass arguments to `delete_application_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 name [::String] - # Required. the name of the application to retrieve. - # Format: - # "projects/\\{project}/locations/\\{location}/applications/\\{application}" - # @param instance_ids [::Array<::String>] - # Required. Id of the requesting object. - # @param request_id [::String] - # Optional. An optional request ID to identify requests. Specify a unique - # request ID so that if you must retry your request, the server will know to - # ignore the request if it has already been completed. The server will - # guarantee that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @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/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::AppPlatform::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::DeleteApplicationInstancesRequest.new - # - # # Call the delete_application_instances method. - # result = client.delete_application_instances 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_application_instances request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::DeleteApplicationInstancesRequest - - # Converts hash 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_application_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::VisionAI::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_application_instances.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_application_instances.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @app_platform_stub.delete_application_instances 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 - - ## - # Adds target stream input to the Application. - # If the Application is deployed, the corresponding new Application instance - # will be created. If the stream has already been in the Application, the RPC - # will fail. - # - # @overload update_application_instances(request, options = nil) - # Pass arguments to `update_application_instances` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::UpdateApplicationInstancesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::UpdateApplicationInstancesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_application_instances(name: nil, application_instances: nil, request_id: nil, allow_missing: nil) - # Pass arguments to `update_application_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 name [::String] - # Required. the name of the application to retrieve. - # Format: - # "projects/\\{project}/locations/\\{location}/applications/\\{application}" - # @param application_instances [::Array<::Google::Cloud::VisionAI::V1::UpdateApplicationInstancesRequest::UpdateApplicationInstance, ::Hash>] - # @param request_id [::String] - # Optional. An optional request ID to identify requests. Specify a unique - # request ID so that if you must retry your request, the server will know to - # ignore the request if it has already been completed. The server will - # guarantee that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @param allow_missing [::Boolean] - # If true, Update Request will create one resource if the target resource - # doesn't exist, this time, the field_mask will be ignored. - # @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/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::AppPlatform::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::UpdateApplicationInstancesRequest.new - # - # # Call the update_application_instances method. - # result = client.update_application_instances 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 update_application_instances request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::UpdateApplicationInstancesRequest - - # Converts hash 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_application_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::VisionAI::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_application_instances.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_application_instances.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @app_platform_stub.update_application_instances 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 - - ## - # Lists Drafts in a given project and location. - # - # @overload list_drafts(request, options = nil) - # Pass arguments to `list_drafts` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::ListDraftsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::ListDraftsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_drafts(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) - # Pass arguments to `list_drafts` via keyword arguments. Note that at - # least one keyword argument is 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. Parent value for ListDraftsRequest. - # @param page_size [::Integer] - # Requested page size. Server may return fewer items than requested. - # If unspecified, server will pick an appropriate default. - # @param page_token [::String] - # A token identifying a page of results the server should return. - # @param filter [::String] - # Filtering results. - # @param order_by [::String] - # Hint for how to order the results. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::VisionAI::V1::Draft>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::VisionAI::V1::Draft>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::AppPlatform::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::ListDraftsRequest.new - # - # # Call the list_drafts method. - # result = client.list_drafts 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::VisionAI::V1::Draft. - # p item - # end - # - def list_drafts request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::ListDraftsRequest - - # Converts hash 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_drafts.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::VisionAI::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_drafts.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_drafts.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @app_platform_stub.list_drafts request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @app_platform_stub, :list_drafts, "drafts", 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 details of a single Draft. - # - # @overload get_draft(request, options = nil) - # Pass arguments to `get_draft` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::GetDraftRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::GetDraftRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_draft(name: nil) - # Pass arguments to `get_draft` via keyword arguments. Note that at - # least one keyword argument is 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 resource. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::VisionAI::V1::Draft] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::VisionAI::V1::Draft] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::AppPlatform::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::GetDraftRequest.new - # - # # Call the get_draft method. - # result = client.get_draft request - # - # # The returned object is of type Google::Cloud::VisionAI::V1::Draft. - # p result - # - def get_draft request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::GetDraftRequest - - # Converts hash 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_draft.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::VisionAI::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_draft.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_draft.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @app_platform_stub.get_draft 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 Draft in a given project and location. - # - # @overload create_draft(request, options = nil) - # Pass arguments to `create_draft` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::CreateDraftRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::CreateDraftRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_draft(parent: nil, draft_id: nil, draft: nil, request_id: nil) - # Pass arguments to `create_draft` via keyword arguments. Note that at - # least one keyword argument is 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. Value for parent. - # @param draft_id [::String] - # Required. Id of the requesting object. - # @param draft [::Google::Cloud::VisionAI::V1::Draft, ::Hash] - # Required. The resource being created. - # @param request_id [::String] - # Optional. An optional request ID to identify requests. Specify a unique - # request ID so that if you must retry your request, the server will know to - # ignore the request if it has already been completed. The server will - # guarantee that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @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/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::AppPlatform::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::CreateDraftRequest.new - # - # # Call the create_draft method. - # result = client.create_draft 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_draft request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::CreateDraftRequest - - # Converts hash 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_draft.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::VisionAI::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_draft.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_draft.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @app_platform_stub.create_draft 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 - - ## - # Updates the parameters of a single Draft. - # - # @overload update_draft(request, options = nil) - # Pass arguments to `update_draft` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::UpdateDraftRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::UpdateDraftRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_draft(update_mask: nil, draft: nil, request_id: nil, allow_missing: nil) - # Pass arguments to `update_draft` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Optional. Field mask is used to specify the fields to be overwritten in the - # Draft resource by the update. - # The fields specified in the update_mask are relative to the resource, not - # the full request. A field will be overwritten if it is in the mask. If the - # user does not provide a mask then all fields will be overwritten. - # @param draft [::Google::Cloud::VisionAI::V1::Draft, ::Hash] - # Required. The resource being updated. - # @param request_id [::String] - # Optional. An optional request ID to identify requests. Specify a unique - # request ID so that if you must retry your request, the server will know to - # ignore the request if it has already been completed. The server will - # guarantee that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @param allow_missing [::Boolean] - # If true, UpdateDraftRequest will create one resource if the target resource - # doesn't exist, this time, the field_mask will be ignored. - # @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/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::AppPlatform::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::UpdateDraftRequest.new - # - # # Call the update_draft method. - # result = client.update_draft 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 update_draft request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::UpdateDraftRequest - - # Converts hash 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_draft.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::VisionAI::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_draft.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_draft.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @app_platform_stub.update_draft 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 single Draft. - # - # @overload delete_draft(request, options = nil) - # Pass arguments to `delete_draft` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::DeleteDraftRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::DeleteDraftRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_draft(name: nil, request_id: nil) - # Pass arguments to `delete_draft` via keyword arguments. Note that at - # least one keyword argument is 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 resource. - # @param request_id [::String] - # Optional. An optional request ID to identify requests. Specify a unique - # request ID so that if you must retry your request, the server will know to - # ignore the request if it has already been completed. The server will - # guarantee that for at least 60 minutes after the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @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/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::AppPlatform::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::DeleteDraftRequest.new - # - # # Call the delete_draft method. - # result = client.delete_draft 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_draft request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::DeleteDraftRequest - - # Converts hash 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_draft.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::VisionAI::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_draft.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_draft.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @app_platform_stub.delete_draft 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 - - ## - # Lists Processors in a given project and location. - # - # @overload list_processors(request, options = nil) - # Pass arguments to `list_processors` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::ListProcessorsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::ListProcessorsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_processors(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) - # Pass arguments to `list_processors` via keyword arguments. Note that at - # least one keyword argument is 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. Parent value for ListProcessorsRequest. - # @param page_size [::Integer] - # Requested page size. Server may return fewer items than requested. - # If unspecified, server will pick an appropriate default. - # @param page_token [::String] - # A token identifying a page of results the server should return. - # @param filter [::String] - # Filtering results. - # @param order_by [::String] - # Hint for how to order the results. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::VisionAI::V1::Processor>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::VisionAI::V1::Processor>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::AppPlatform::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::ListProcessorsRequest.new - # - # # Call the list_processors method. - # result = client.list_processors 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::VisionAI::V1::Processor. - # p item - # end - # - def list_processors request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::ListProcessorsRequest - - # Converts hash 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_processors.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::VisionAI::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_processors.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_processors.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @app_platform_stub.list_processors request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @app_platform_stub, :list_processors, "processors", 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 - - ## - # ListPrebuiltProcessors is a custom pass-through verb that Lists Prebuilt - # Processors. - # - # @overload list_prebuilt_processors(request, options = nil) - # Pass arguments to `list_prebuilt_processors` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::ListPrebuiltProcessorsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::ListPrebuiltProcessorsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_prebuilt_processors(parent: nil) - # Pass arguments to `list_prebuilt_processors` via keyword arguments. Note that at - # least one keyword argument is 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. Parent path. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::VisionAI::V1::ListPrebuiltProcessorsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::VisionAI::V1::ListPrebuiltProcessorsResponse] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::AppPlatform::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::ListPrebuiltProcessorsRequest.new - # - # # Call the list_prebuilt_processors method. - # result = client.list_prebuilt_processors request - # - # # The returned object is of type Google::Cloud::VisionAI::V1::ListPrebuiltProcessorsResponse. - # p result - # - def list_prebuilt_processors request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::ListPrebuiltProcessorsRequest - - # Converts hash 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_prebuilt_processors.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::VisionAI::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_prebuilt_processors.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_prebuilt_processors.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @app_platform_stub.list_prebuilt_processors 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 - - ## - # Gets details of a single Processor. - # - # @overload get_processor(request, options = nil) - # Pass arguments to `get_processor` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::GetProcessorRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::GetProcessorRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_processor(name: nil) - # Pass arguments to `get_processor` via keyword arguments. Note that at - # least one keyword argument is 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 resource. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::VisionAI::V1::Processor] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::VisionAI::V1::Processor] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::AppPlatform::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::GetProcessorRequest.new - # - # # Call the get_processor method. - # result = client.get_processor request - # - # # The returned object is of type Google::Cloud::VisionAI::V1::Processor. - # p result - # - def get_processor request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::GetProcessorRequest - - # Converts hash 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_processor.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::VisionAI::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_processor.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_processor.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @app_platform_stub.get_processor 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 Processor in a given project and location. - # - # @overload create_processor(request, options = nil) - # Pass arguments to `create_processor` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::CreateProcessorRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::CreateProcessorRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_processor(parent: nil, processor_id: nil, processor: nil, request_id: nil) - # Pass arguments to `create_processor` via keyword arguments. Note that at - # least one keyword argument is 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. Value for parent. - # @param processor_id [::String] - # Required. Id of the requesting object. - # @param processor [::Google::Cloud::VisionAI::V1::Processor, ::Hash] - # Required. The resource being created. - # @param request_id [::String] - # Optional. An optional request ID to identify requests. Specify a unique - # request ID so that if you must retry your request, the server will know to - # ignore the request if it has already been completed. The server will - # guarantee that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @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/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::AppPlatform::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::CreateProcessorRequest.new - # - # # Call the create_processor method. - # result = client.create_processor 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_processor request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::CreateProcessorRequest - - # Converts hash 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_processor.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::VisionAI::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_processor.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_processor.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @app_platform_stub.create_processor 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 - - ## - # Updates the parameters of a single Processor. - # - # @overload update_processor(request, options = nil) - # Pass arguments to `update_processor` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::UpdateProcessorRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::UpdateProcessorRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_processor(update_mask: nil, processor: nil, request_id: nil) - # Pass arguments to `update_processor` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Optional. Field mask is used to specify the fields to be overwritten in the - # Processor resource by the update. - # The fields specified in the update_mask are relative to the resource, not - # the full request. A field will be overwritten if it is in the mask. If the - # user does not provide a mask then all fields will be overwritten. - # @param processor [::Google::Cloud::VisionAI::V1::Processor, ::Hash] - # Required. The resource being updated. - # @param request_id [::String] - # Optional. An optional request ID to identify requests. Specify a unique - # request ID so that if you must retry your request, the server will know to - # ignore the request if it has already been completed. The server will - # guarantee that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @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/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::AppPlatform::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::UpdateProcessorRequest.new - # - # # Call the update_processor method. - # result = client.update_processor 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 update_processor request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::UpdateProcessorRequest - - # Converts hash 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_processor.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::VisionAI::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_processor.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_processor.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @app_platform_stub.update_processor 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 single Processor. - # - # @overload delete_processor(request, options = nil) - # Pass arguments to `delete_processor` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::DeleteProcessorRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::DeleteProcessorRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_processor(name: nil, request_id: nil) - # Pass arguments to `delete_processor` via keyword arguments. Note that at - # least one keyword argument is 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 resource - # @param request_id [::String] - # Optional. An optional request ID to identify requests. Specify a unique - # request ID so that if you must retry your request, the server will know to - # ignore the request if it has already been completed. The server will - # guarantee that for at least 60 minutes after the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @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/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::AppPlatform::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::DeleteProcessorRequest.new - # - # # Call the delete_processor method. - # result = client.delete_processor 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_processor request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::DeleteProcessorRequest - - # Converts hash 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_processor.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::VisionAI::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_processor.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_processor.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @app_platform_stub.delete_processor 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 - - ## - # Configuration class for the AppPlatform REST API. - # - # This class represents the configuration for AppPlatform 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::VisionAI::V1::AppPlatform::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_applications to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::VisionAI::V1::AppPlatform::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_applications.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::VisionAI::V1::AppPlatform::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_applications.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 = "visionai.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 AppPlatform 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_applications` - # @return [::Gapic::Config::Method] - # - attr_reader :list_applications - ## - # RPC-specific configuration for `get_application` - # @return [::Gapic::Config::Method] - # - attr_reader :get_application - ## - # RPC-specific configuration for `create_application` - # @return [::Gapic::Config::Method] - # - attr_reader :create_application - ## - # RPC-specific configuration for `update_application` - # @return [::Gapic::Config::Method] - # - attr_reader :update_application - ## - # RPC-specific configuration for `delete_application` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_application - ## - # RPC-specific configuration for `deploy_application` - # @return [::Gapic::Config::Method] - # - attr_reader :deploy_application - ## - # RPC-specific configuration for `undeploy_application` - # @return [::Gapic::Config::Method] - # - attr_reader :undeploy_application - ## - # RPC-specific configuration for `add_application_stream_input` - # @return [::Gapic::Config::Method] - # - attr_reader :add_application_stream_input - ## - # RPC-specific configuration for `remove_application_stream_input` - # @return [::Gapic::Config::Method] - # - attr_reader :remove_application_stream_input - ## - # RPC-specific configuration for `update_application_stream_input` - # @return [::Gapic::Config::Method] - # - attr_reader :update_application_stream_input - ## - # RPC-specific configuration for `list_instances` - # @return [::Gapic::Config::Method] - # - attr_reader :list_instances - ## - # RPC-specific configuration for `get_instance` - # @return [::Gapic::Config::Method] - # - attr_reader :get_instance - ## - # RPC-specific configuration for `create_application_instances` - # @return [::Gapic::Config::Method] - # - attr_reader :create_application_instances - ## - # RPC-specific configuration for `delete_application_instances` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_application_instances - ## - # RPC-specific configuration for `update_application_instances` - # @return [::Gapic::Config::Method] - # - attr_reader :update_application_instances - ## - # RPC-specific configuration for `list_drafts` - # @return [::Gapic::Config::Method] - # - attr_reader :list_drafts - ## - # RPC-specific configuration for `get_draft` - # @return [::Gapic::Config::Method] - # - attr_reader :get_draft - ## - # RPC-specific configuration for `create_draft` - # @return [::Gapic::Config::Method] - # - attr_reader :create_draft - ## - # RPC-specific configuration for `update_draft` - # @return [::Gapic::Config::Method] - # - attr_reader :update_draft - ## - # RPC-specific configuration for `delete_draft` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_draft - ## - # RPC-specific configuration for `list_processors` - # @return [::Gapic::Config::Method] - # - attr_reader :list_processors - ## - # RPC-specific configuration for `list_prebuilt_processors` - # @return [::Gapic::Config::Method] - # - attr_reader :list_prebuilt_processors - ## - # RPC-specific configuration for `get_processor` - # @return [::Gapic::Config::Method] - # - attr_reader :get_processor - ## - # RPC-specific configuration for `create_processor` - # @return [::Gapic::Config::Method] - # - attr_reader :create_processor - ## - # RPC-specific configuration for `update_processor` - # @return [::Gapic::Config::Method] - # - attr_reader :update_processor - ## - # RPC-specific configuration for `delete_processor` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_processor - - # @private - def initialize parent_rpcs = nil - list_applications_config = parent_rpcs.list_applications if parent_rpcs.respond_to? :list_applications - @list_applications = ::Gapic::Config::Method.new list_applications_config - get_application_config = parent_rpcs.get_application if parent_rpcs.respond_to? :get_application - @get_application = ::Gapic::Config::Method.new get_application_config - create_application_config = parent_rpcs.create_application if parent_rpcs.respond_to? :create_application - @create_application = ::Gapic::Config::Method.new create_application_config - update_application_config = parent_rpcs.update_application if parent_rpcs.respond_to? :update_application - @update_application = ::Gapic::Config::Method.new update_application_config - delete_application_config = parent_rpcs.delete_application if parent_rpcs.respond_to? :delete_application - @delete_application = ::Gapic::Config::Method.new delete_application_config - deploy_application_config = parent_rpcs.deploy_application if parent_rpcs.respond_to? :deploy_application - @deploy_application = ::Gapic::Config::Method.new deploy_application_config - undeploy_application_config = parent_rpcs.undeploy_application if parent_rpcs.respond_to? :undeploy_application - @undeploy_application = ::Gapic::Config::Method.new undeploy_application_config - add_application_stream_input_config = parent_rpcs.add_application_stream_input if parent_rpcs.respond_to? :add_application_stream_input - @add_application_stream_input = ::Gapic::Config::Method.new add_application_stream_input_config - remove_application_stream_input_config = parent_rpcs.remove_application_stream_input if parent_rpcs.respond_to? :remove_application_stream_input - @remove_application_stream_input = ::Gapic::Config::Method.new remove_application_stream_input_config - update_application_stream_input_config = parent_rpcs.update_application_stream_input if parent_rpcs.respond_to? :update_application_stream_input - @update_application_stream_input = ::Gapic::Config::Method.new update_application_stream_input_config - list_instances_config = parent_rpcs.list_instances if parent_rpcs.respond_to? :list_instances - @list_instances = ::Gapic::Config::Method.new list_instances_config - get_instance_config = parent_rpcs.get_instance if parent_rpcs.respond_to? :get_instance - @get_instance = ::Gapic::Config::Method.new get_instance_config - create_application_instances_config = parent_rpcs.create_application_instances if parent_rpcs.respond_to? :create_application_instances - @create_application_instances = ::Gapic::Config::Method.new create_application_instances_config - delete_application_instances_config = parent_rpcs.delete_application_instances if parent_rpcs.respond_to? :delete_application_instances - @delete_application_instances = ::Gapic::Config::Method.new delete_application_instances_config - update_application_instances_config = parent_rpcs.update_application_instances if parent_rpcs.respond_to? :update_application_instances - @update_application_instances = ::Gapic::Config::Method.new update_application_instances_config - list_drafts_config = parent_rpcs.list_drafts if parent_rpcs.respond_to? :list_drafts - @list_drafts = ::Gapic::Config::Method.new list_drafts_config - get_draft_config = parent_rpcs.get_draft if parent_rpcs.respond_to? :get_draft - @get_draft = ::Gapic::Config::Method.new get_draft_config - create_draft_config = parent_rpcs.create_draft if parent_rpcs.respond_to? :create_draft - @create_draft = ::Gapic::Config::Method.new create_draft_config - update_draft_config = parent_rpcs.update_draft if parent_rpcs.respond_to? :update_draft - @update_draft = ::Gapic::Config::Method.new update_draft_config - delete_draft_config = parent_rpcs.delete_draft if parent_rpcs.respond_to? :delete_draft - @delete_draft = ::Gapic::Config::Method.new delete_draft_config - list_processors_config = parent_rpcs.list_processors if parent_rpcs.respond_to? :list_processors - @list_processors = ::Gapic::Config::Method.new list_processors_config - list_prebuilt_processors_config = parent_rpcs.list_prebuilt_processors if parent_rpcs.respond_to? :list_prebuilt_processors - @list_prebuilt_processors = ::Gapic::Config::Method.new list_prebuilt_processors_config - get_processor_config = parent_rpcs.get_processor if parent_rpcs.respond_to? :get_processor - @get_processor = ::Gapic::Config::Method.new get_processor_config - create_processor_config = parent_rpcs.create_processor if parent_rpcs.respond_to? :create_processor - @create_processor = ::Gapic::Config::Method.new create_processor_config - update_processor_config = parent_rpcs.update_processor if parent_rpcs.respond_to? :update_processor - @update_processor = ::Gapic::Config::Method.new update_processor_config - delete_processor_config = parent_rpcs.delete_processor if parent_rpcs.respond_to? :delete_processor - @delete_processor = ::Gapic::Config::Method.new delete_processor_config - - yield self if block_given? - end - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/app_platform/rest/operations.rb b/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/app_platform/rest/operations.rb deleted file mode 100644 index 94d93d0a51a4..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/app_platform/rest/operations.rb +++ /dev/null @@ -1,974 +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 VisionAI - module V1 - module AppPlatform - module Rest - # Service that implements Longrunning Operations API. - class Operations - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "visionai.$UNIVERSE_DOMAIN$" - - # @private - attr_reader :operations_stub - - ## - # Configuration for the AppPlatform 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 AppPlatform 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::VisionAI::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::VisionAI::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::VisionAI::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::VisionAI::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 = "visionai.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}/operations", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/?$}, 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] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/warehouseOperations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/corpora/[^/]+/assets/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/corpora/[^/]+/collections/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/corpora/[^/]+/imageIndexes/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/corpora/[^/]+/indexes/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/corpora/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/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{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] - ] - ) - 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{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/app_platform/rest/service_stub.rb b/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/app_platform/rest/service_stub.rb deleted file mode 100644 index f38e0fdfce6d..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/app_platform/rest/service_stub.rb +++ /dev/null @@ -1,1682 +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/visionai/v1/platform_pb" - -module Google - module Cloud - module VisionAI - module V1 - module AppPlatform - module Rest - ## - # REST service stub for the AppPlatform 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_applications REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::ListApplicationsRequest] - # 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::VisionAI::V1::ListApplicationsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::VisionAI::V1::ListApplicationsResponse] - # A result object deserialized from the server's reply - def list_applications request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_applications_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_applications", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::VisionAI::V1::ListApplicationsResponse.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_application REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::GetApplicationRequest] - # 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::VisionAI::V1::Application] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::VisionAI::V1::Application] - # A result object deserialized from the server's reply - def get_application request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_application_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_application", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::VisionAI::V1::Application.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_application REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::CreateApplicationRequest] - # 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_application request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_application_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_application", - 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 update_application REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::UpdateApplicationRequest] - # 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 update_application request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_application_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_application", - 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_application REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::DeleteApplicationRequest] - # 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_application request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_delete_application_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_application", - 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 deploy_application REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::DeployApplicationRequest] - # 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 deploy_application request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_deploy_application_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: "deploy_application", - 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 undeploy_application REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::UndeployApplicationRequest] - # 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 undeploy_application request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_undeploy_application_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: "undeploy_application", - 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 add_application_stream_input REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::AddApplicationStreamInputRequest] - # 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 add_application_stream_input request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_add_application_stream_input_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: "add_application_stream_input", - 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 remove_application_stream_input REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::RemoveApplicationStreamInputRequest] - # 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 remove_application_stream_input request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_remove_application_stream_input_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: "remove_application_stream_input", - 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 update_application_stream_input REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::UpdateApplicationStreamInputRequest] - # 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 update_application_stream_input request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_application_stream_input_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_application_stream_input", - 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 list_instances REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::ListInstancesRequest] - # 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::VisionAI::V1::ListInstancesResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::VisionAI::V1::ListInstancesResponse] - # A result object deserialized from the server's reply - def list_instances request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_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_instances", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::VisionAI::V1::ListInstancesResponse.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_instance REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::GetInstanceRequest] - # 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::VisionAI::V1::Instance] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::VisionAI::V1::Instance] - # A result object deserialized from the server's reply - def get_instance request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_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_instance", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::VisionAI::V1::Instance.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_application_instances REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::CreateApplicationInstancesRequest] - # 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_application_instances request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_application_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: "create_application_instances", - 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_application_instances REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::DeleteApplicationInstancesRequest] - # 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_application_instances request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_delete_application_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: "delete_application_instances", - 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 update_application_instances REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::UpdateApplicationInstancesRequest] - # 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 update_application_instances request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_application_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: "update_application_instances", - 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 list_drafts REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::ListDraftsRequest] - # 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::VisionAI::V1::ListDraftsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::VisionAI::V1::ListDraftsResponse] - # A result object deserialized from the server's reply - def list_drafts request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_drafts_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_drafts", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::VisionAI::V1::ListDraftsResponse.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_draft REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::GetDraftRequest] - # 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::VisionAI::V1::Draft] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::VisionAI::V1::Draft] - # A result object deserialized from the server's reply - def get_draft request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_draft_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_draft", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::VisionAI::V1::Draft.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_draft REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::CreateDraftRequest] - # 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_draft request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_draft_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_draft", - 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 update_draft REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::UpdateDraftRequest] - # 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 update_draft request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_draft_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_draft", - 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_draft REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::DeleteDraftRequest] - # 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_draft request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_delete_draft_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_draft", - 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 list_processors REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::ListProcessorsRequest] - # 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::VisionAI::V1::ListProcessorsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::VisionAI::V1::ListProcessorsResponse] - # A result object deserialized from the server's reply - def list_processors request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_processors_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_processors", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::VisionAI::V1::ListProcessorsResponse.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_prebuilt_processors REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::ListPrebuiltProcessorsRequest] - # 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::VisionAI::V1::ListPrebuiltProcessorsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::VisionAI::V1::ListPrebuiltProcessorsResponse] - # A result object deserialized from the server's reply - def list_prebuilt_processors request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_prebuilt_processors_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_prebuilt_processors", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::VisionAI::V1::ListPrebuiltProcessorsResponse.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_processor REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::GetProcessorRequest] - # 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::VisionAI::V1::Processor] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::VisionAI::V1::Processor] - # A result object deserialized from the server's reply - def get_processor request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_processor_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_processor", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::VisionAI::V1::Processor.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_processor REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::CreateProcessorRequest] - # 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_processor request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_processor_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_processor", - 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 update_processor REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::UpdateProcessorRequest] - # 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 update_processor request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_processor_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_processor", - 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_processor REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::DeleteProcessorRequest] - # 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_processor request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_delete_processor_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_processor", - 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 - - ## - # @private - # - # GRPC transcoding helper method for the list_applications REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::ListApplicationsRequest] - # 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_applications_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/applications", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_application REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::GetApplicationRequest] - # 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_application_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/applications/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the create_application REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::CreateApplicationRequest] - # 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_application_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}/applications", - body: "application", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_application REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::UpdateApplicationRequest] - # 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_application_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v1/{application.name}", - body: "application", - matches: [ - ["application.name", %r{^projects/[^/]+/locations/[^/]+/applications/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_application REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::DeleteApplicationRequest] - # 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_application_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/applications/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the deploy_application REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::DeployApplicationRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_deploy_application_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:deploy", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/applications/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the undeploy_application REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::UndeployApplicationRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_undeploy_application_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:undeploy", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/applications/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the add_application_stream_input REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::AddApplicationStreamInputRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_add_application_stream_input_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:addStreamInput", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/applications/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the remove_application_stream_input REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::RemoveApplicationStreamInputRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_remove_application_stream_input_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:removeStreamInput", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/applications/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_application_stream_input REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::UpdateApplicationStreamInputRequest] - # 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_application_stream_input_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:updateStreamInput", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/applications/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_instances REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::ListInstancesRequest] - # 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_instances_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/instances", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/applications/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_instance REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::GetInstanceRequest] - # 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_instance_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/applications/[^/]+/instances/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the create_application_instances REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::CreateApplicationInstancesRequest] - # 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_application_instances_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:createApplicationInstances", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/applications/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_application_instances REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::DeleteApplicationInstancesRequest] - # 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_application_instances_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:deleteApplicationInstances", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/applications/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_application_instances REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::UpdateApplicationInstancesRequest] - # 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_application_instances_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:updateApplicationInstances", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/applications/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_drafts REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::ListDraftsRequest] - # 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_drafts_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/drafts", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/applications/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_draft REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::GetDraftRequest] - # 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_draft_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/applications/[^/]+/drafts/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the create_draft REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::CreateDraftRequest] - # 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_draft_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}/drafts", - body: "draft", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/applications/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_draft REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::UpdateDraftRequest] - # 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_draft_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v1/{draft.name}", - body: "draft", - matches: [ - ["draft.name", %r{^projects/[^/]+/locations/[^/]+/applications/[^/]+/drafts/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_draft REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::DeleteDraftRequest] - # 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_draft_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/applications/[^/]+/drafts/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_processors REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::ListProcessorsRequest] - # 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_processors_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/processors", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_prebuilt_processors REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::ListPrebuiltProcessorsRequest] - # 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_prebuilt_processors_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}/processors:prebuilt", - body: "*", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_processor REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::GetProcessorRequest] - # 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_processor_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/processors/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the create_processor REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::CreateProcessorRequest] - # 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_processor_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}/processors", - body: "processor", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_processor REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::UpdateProcessorRequest] - # 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_processor_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v1/{processor.name}", - body: "processor", - matches: [ - ["processor.name", %r{^projects/[^/]+/locations/[^/]+/processors/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_processor REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::DeleteProcessorRequest] - # 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_processor_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/processors/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/bindings_override.rb b/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/bindings_override.rb deleted file mode 100644 index 32c29b6758a7..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/bindings_override.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! - -require "gapic/rest" - -module Google - module Cloud - module VisionAI - ## - # @example Loading just the REST part of this package, including all its services, and instantiating a REST client - # - # require "google/cloud/vision_ai/v1/rest" - # client = ::Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Rest::Client.new - # - module V1 - ## - # @private - # Initialize the mixin bindings configuration - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "VisionAI"] - 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 - end - yield @configure if block_given? - @configure - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/health_check_service.rb b/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/health_check_service.rb deleted file mode 100644 index 6f083b643903..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/health_check_service.rb +++ /dev/null @@ -1,56 +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/vision_ai/v1/version" - -require "google/cloud/vision_ai/v1/health_check_service/credentials" -require "google/cloud/vision_ai/v1/health_check_service/paths" -require "google/cloud/vision_ai/v1/health_check_service/client" -require "google/cloud/vision_ai/v1/health_check_service/rest" - -module Google - module Cloud - module VisionAI - module V1 - ## - # HealthCheckService provides an interface for Vertex AI Vision Cluster Health - # Check. - # - # @example Load this service and instantiate a gRPC client - # - # require "google/cloud/vision_ai/v1/health_check_service" - # client = ::Google::Cloud::VisionAI::V1::HealthCheckService::Client.new - # - # @example Load this service and instantiate a REST client - # - # require "google/cloud/vision_ai/v1/health_check_service/rest" - # client = ::Google::Cloud::VisionAI::V1::HealthCheckService::Rest::Client.new - # - module HealthCheckService - end - end - end - end -end - -helper_path = ::File.join __dir__, "health_check_service", "helpers.rb" -require "google/cloud/vision_ai/v1/health_check_service/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/health_check_service/client.rb b/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/health_check_service/client.rb deleted file mode 100644 index de5277421a7b..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/health_check_service/client.rb +++ /dev/null @@ -1,507 +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/visionai/v1/health_service_pb" -require "google/cloud/location" -require "google/iam/v1" - -module Google - module Cloud - module VisionAI - module V1 - module HealthCheckService - ## - # Client for the HealthCheckService service. - # - # HealthCheckService provides an interface for Vertex AI Vision Cluster Health - # Check. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "visionai.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :health_check_service_stub - - ## - # Configure the HealthCheckService Client class. - # - # See {::Google::Cloud::VisionAI::V1::HealthCheckService::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all HealthCheckService clients - # ::Google::Cloud::VisionAI::V1::HealthCheckService::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", "VisionAI", "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 - end - yield @configure if block_given? - @configure - end - - ## - # Configure the HealthCheckService 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::VisionAI::V1::HealthCheckService::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 - @health_check_service_stub.universe_domain - end - - ## - # Create a new HealthCheckService client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::VisionAI::V1::HealthCheckService::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::VisionAI::V1::HealthCheckService::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the HealthCheckService 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/visionai/v1/health_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 - - @health_check_service_stub = ::Gapic::ServiceStub.new( - ::Google::Cloud::VisionAI::V1::HealthCheckService::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 - ) - - @health_check_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 = @health_check_service_stub.endpoint - config.universe_domain = @health_check_service_stub.universe_domain - config.logger = @health_check_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 = @health_check_service_stub.endpoint - config.universe_domain = @health_check_service_stub.universe_domain - config.logger = @health_check_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 - @health_check_service_stub.logger - end - - # Service calls - - ## - # HealthCheck method checks the health status of the cluster. - # - # @overload health_check(request, options = nil) - # Pass arguments to `health_check` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::HealthCheckRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::HealthCheckRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload health_check(cluster: nil) - # Pass arguments to `health_check` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param cluster [::String] - # The parent of the resource. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::VisionAI::V1::HealthCheckResponse] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::VisionAI::V1::HealthCheckResponse] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::HealthCheckService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::HealthCheckRequest.new - # - # # Call the health_check method. - # result = client.health_check request - # - # # The returned object is of type Google::Cloud::VisionAI::V1::HealthCheckResponse. - # p result - # - def health_check request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::HealthCheckRequest - - # Converts hash 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.health_check.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::VisionAI::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.cluster - header_params["cluster"] = request.cluster - 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.health_check.timeout, - metadata: metadata, - retry_policy: @config.rpcs.health_check.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @health_check_service_stub.call_rpc :health_check, 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 HealthCheckService API. - # - # This class represents the configuration for HealthCheckService, - # 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::VisionAI::V1::HealthCheckService::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 - # # health_check to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::VisionAI::V1::HealthCheckService::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.health_check.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::VisionAI::V1::HealthCheckService::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.health_check.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::VisionAI::V1::HealthCheckService::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 = "visionai.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 HealthCheckService 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 `health_check` - # @return [::Gapic::Config::Method] - # - attr_reader :health_check - - # @private - def initialize parent_rpcs = nil - health_check_config = parent_rpcs.health_check if parent_rpcs.respond_to? :health_check - @health_check = ::Gapic::Config::Method.new health_check_config - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/health_check_service/credentials.rb b/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/health_check_service/credentials.rb deleted file mode 100644 index 281032fe20a5..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/health_check_service/credentials.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! - -require "googleauth" - -module Google - module Cloud - module VisionAI - module V1 - module HealthCheckService - # Credentials for the HealthCheckService API. - class Credentials < ::Google::Auth::Credentials - self.scope = [ - "https://www.googleapis.com/auth/cloud-platform" - ] - self.env_vars = [ - "GOOGLE_CLOUD_CREDENTIALS", - "GOOGLE_CLOUD_KEYFILE", - "GCLOUD_KEYFILE", - "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-vision_ai-v1/lib/google/cloud/vision_ai/v1/health_check_service/paths.rb b/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/health_check_service/paths.rb deleted file mode 100644 index 8baa8c07a953..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/health_check_service/paths.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! - - -module Google - module Cloud - module VisionAI - module V1 - module HealthCheckService - # Path helper methods for the HealthCheckService API. - module Paths - ## - # Create a fully-qualified Cluster resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/clusters/{cluster}` - # - # @param project [String] - # @param location [String] - # @param cluster [String] - # - # @return [::String] - def cluster_path project:, location:, cluster: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/clusters/#{cluster}" - end - - extend self - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/health_check_service/rest.rb b/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/health_check_service/rest.rb deleted file mode 100644 index 8e39a033aae1..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/health_check_service/rest.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! - -require "gapic/rest" -require "gapic/config" -require "gapic/config/method" - -require "google/cloud/vision_ai/v1/version" -require "google/cloud/vision_ai/v1/bindings_override" - -require "google/cloud/vision_ai/v1/health_check_service/credentials" -require "google/cloud/vision_ai/v1/health_check_service/paths" -require "google/cloud/vision_ai/v1/health_check_service/rest/client" - -module Google - module Cloud - module VisionAI - module V1 - ## - # HealthCheckService provides an interface for Vertex AI Vision Cluster Health - # Check. - # - # To load this service and instantiate a REST client: - # - # require "google/cloud/vision_ai/v1/health_check_service/rest" - # client = ::Google::Cloud::VisionAI::V1::HealthCheckService::Rest::Client.new - # - module HealthCheckService - # Client for the REST transport - module Rest - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "rest", "helpers.rb" -require "google/cloud/vision_ai/v1/health_check_service/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/health_check_service/rest/client.rb b/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/health_check_service/rest/client.rb deleted file mode 100644 index b6e0616c6227..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/health_check_service/rest/client.rb +++ /dev/null @@ -1,465 +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/visionai/v1/health_service_pb" -require "google/cloud/vision_ai/v1/health_check_service/rest/service_stub" -require "google/cloud/location/rest" -require "google/iam/v1/rest" - -module Google - module Cloud - module VisionAI - module V1 - module HealthCheckService - module Rest - ## - # REST client for the HealthCheckService service. - # - # HealthCheckService provides an interface for Vertex AI Vision Cluster Health - # Check. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "visionai.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :health_check_service_stub - - ## - # Configure the HealthCheckService Client class. - # - # See {::Google::Cloud::VisionAI::V1::HealthCheckService::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all HealthCheckService clients - # ::Google::Cloud::VisionAI::V1::HealthCheckService::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", "VisionAI", "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 - end - yield @configure if block_given? - @configure - end - - ## - # Configure the HealthCheckService 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::VisionAI::V1::HealthCheckService::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 - @health_check_service_stub.universe_domain - end - - ## - # Create a new HealthCheckService REST client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::VisionAI::V1::HealthCheckService::Rest::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::VisionAI::V1::HealthCheckService::Rest::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the HealthCheckService 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 - - @health_check_service_stub = ::Google::Cloud::VisionAI::V1::HealthCheckService::Rest::ServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials, - logger: @config.logger - ) - - @health_check_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 = @health_check_service_stub.endpoint - config.universe_domain = @health_check_service_stub.universe_domain - config.bindings_override = @config.bindings_override - config.logger = @health_check_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 = @health_check_service_stub.endpoint - config.universe_domain = @health_check_service_stub.universe_domain - config.logger = @health_check_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 - @health_check_service_stub.logger - end - - # Service calls - - ## - # HealthCheck method checks the health status of the cluster. - # - # @overload health_check(request, options = nil) - # Pass arguments to `health_check` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::HealthCheckRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::HealthCheckRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload health_check(cluster: nil) - # Pass arguments to `health_check` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param cluster [::String] - # The parent of the resource. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::VisionAI::V1::HealthCheckResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::VisionAI::V1::HealthCheckResponse] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::HealthCheckService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::HealthCheckRequest.new - # - # # Call the health_check method. - # result = client.health_check request - # - # # The returned object is of type Google::Cloud::VisionAI::V1::HealthCheckResponse. - # p result - # - def health_check request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::HealthCheckRequest - - # Converts hash 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.health_check.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::VisionAI::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.health_check.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.health_check.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @health_check_service_stub.health_check 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 HealthCheckService REST API. - # - # This class represents the configuration for HealthCheckService 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::VisionAI::V1::HealthCheckService::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 - # # health_check to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::VisionAI::V1::HealthCheckService::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.health_check.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::VisionAI::V1::HealthCheckService::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.health_check.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 = "visionai.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 HealthCheckService 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 `health_check` - # @return [::Gapic::Config::Method] - # - attr_reader :health_check - - # @private - def initialize parent_rpcs = nil - health_check_config = parent_rpcs.health_check if parent_rpcs.respond_to? :health_check - @health_check = ::Gapic::Config::Method.new health_check_config - - yield self if block_given? - end - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/health_check_service/rest/service_stub.rb b/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/health_check_service/rest/service_stub.rb deleted file mode 100644 index a9a836a06e63..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/health_check_service/rest/service_stub.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! - -require "google/cloud/visionai/v1/health_service_pb" - -module Google - module Cloud - module VisionAI - module V1 - module HealthCheckService - module Rest - ## - # REST service stub for the HealthCheckService 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 health_check REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::HealthCheckRequest] - # 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::VisionAI::V1::HealthCheckResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::VisionAI::V1::HealthCheckResponse] - # A result object deserialized from the server's reply - def health_check request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_health_check_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: "health_check", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::VisionAI::V1::HealthCheckResponse.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 health_check REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::HealthCheckRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_health_check_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{cluster}:healthCheck", - matches: [ - ["cluster", %r{^projects/[^/]+/locations/[^/]+/clusters/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/live_video_analytics.rb b/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/live_video_analytics.rb deleted file mode 100644 index 3aa518cd3b87..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/live_video_analytics.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/common" -require "gapic/config" -require "gapic/config/method" - -require "google/cloud/vision_ai/v1/version" - -require "google/cloud/vision_ai/v1/live_video_analytics/credentials" -require "google/cloud/vision_ai/v1/live_video_analytics/paths" -require "google/cloud/vision_ai/v1/live_video_analytics/operations" -require "google/cloud/vision_ai/v1/live_video_analytics/client" -require "google/cloud/vision_ai/v1/live_video_analytics/rest" - -module Google - module Cloud - module VisionAI - module V1 - ## - # Service describing handlers for resources. The service enables clients to run - # Live Video Analytics (LVA) on the streaming inputs. - # - # @example Load this service and instantiate a gRPC client - # - # require "google/cloud/vision_ai/v1/live_video_analytics" - # client = ::Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client.new - # - # @example Load this service and instantiate a REST client - # - # require "google/cloud/vision_ai/v1/live_video_analytics/rest" - # client = ::Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Rest::Client.new - # - module LiveVideoAnalytics - end - end - end - end -end - -helper_path = ::File.join __dir__, "live_video_analytics", "helpers.rb" -require "google/cloud/vision_ai/v1/live_video_analytics/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/live_video_analytics/client.rb b/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/live_video_analytics/client.rb deleted file mode 100644 index d22cd5cb8b45..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/live_video_analytics/client.rb +++ /dev/null @@ -1,2423 +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/visionai/v1/lva_service_pb" -require "google/cloud/location" -require "google/iam/v1" - -module Google - module Cloud - module VisionAI - module V1 - module LiveVideoAnalytics - ## - # Client for the LiveVideoAnalytics service. - # - # Service describing handlers for resources. The service enables clients to run - # Live Video Analytics (LVA) on the streaming inputs. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "visionai.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :live_video_analytics_stub - - ## - # Configure the LiveVideoAnalytics Client class. - # - # See {::Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all LiveVideoAnalytics clients - # ::Google::Cloud::VisionAI::V1::LiveVideoAnalytics::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", "VisionAI", "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.timeout = 60.0 - default_config.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.list_operators.timeout = 60.0 - - default_config.rpcs.get_operator.timeout = 60.0 - - default_config.rpcs.create_operator.timeout = 300.0 - - default_config.rpcs.update_operator.timeout = 60.0 - - default_config.rpcs.delete_operator.timeout = 60.0 - - default_config.rpcs.list_analyses.timeout = 60.0 - - default_config.rpcs.get_analysis.timeout = 60.0 - - default_config.rpcs.create_analysis.timeout = 300.0 - - default_config.rpcs.update_analysis.timeout = 60.0 - - default_config.rpcs.delete_analysis.timeout = 60.0 - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the LiveVideoAnalytics 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::VisionAI::V1::LiveVideoAnalytics::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 - @live_video_analytics_stub.universe_domain - end - - ## - # Create a new LiveVideoAnalytics client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the LiveVideoAnalytics 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/visionai/v1/lva_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 - - @live_video_analytics_stub = ::Gapic::ServiceStub.new( - ::Google::Cloud::VisionAI::V1::LiveVideoAnalytics::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 - ) - - @live_video_analytics_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 = @live_video_analytics_stub.endpoint - config.universe_domain = @live_video_analytics_stub.universe_domain - config.logger = @live_video_analytics_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 = @live_video_analytics_stub.endpoint - config.universe_domain = @live_video_analytics_stub.universe_domain - config.logger = @live_video_analytics_stub.logger if config.respond_to? :logger= - end - end - - ## - # Get the associated client for long-running operations. - # - # @return [::Google::Cloud::VisionAI::V1::LiveVideoAnalytics::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 - @live_video_analytics_stub.logger - end - - # Service calls - - ## - # ListPublicOperators returns all the operators in public registry. - # - # @overload list_public_operators(request, options = nil) - # Pass arguments to `list_public_operators` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::ListPublicOperatorsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::ListPublicOperatorsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_public_operators(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) - # Pass arguments to `list_public_operators` via keyword arguments. Note that at - # least one keyword argument is 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. Parent value for ListPublicOperatorsRequest. - # @param page_size [::Integer] - # Requested page size. Server may return fewer items than requested. - # If unspecified, server will pick an appropriate default. - # @param page_token [::String] - # A token identifying a page of results the server should return. - # @param filter [::String] - # Filtering results. - # @param order_by [::String] - # Hint for how to order the results. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::VisionAI::V1::Operator>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::VisionAI::V1::Operator>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::ListPublicOperatorsRequest.new - # - # # Call the list_public_operators method. - # result = client.list_public_operators 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::VisionAI::V1::Operator. - # p item - # end - # - def list_public_operators request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::ListPublicOperatorsRequest - - # Converts hash 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_public_operators.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::VisionAI::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_public_operators.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_public_operators.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @live_video_analytics_stub.call_rpc :list_public_operators, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @live_video_analytics_stub, :list_public_operators, 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 - - ## - # ResolveOperatorInfo returns the operator information based on the request. - # - # @overload resolve_operator_info(request, options = nil) - # Pass arguments to `resolve_operator_info` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::ResolveOperatorInfoRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::ResolveOperatorInfoRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload resolve_operator_info(parent: nil, queries: nil) - # Pass arguments to `resolve_operator_info` via keyword arguments. Note that at - # least one keyword argument is 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. Parent value for ResolveOperatorInfoRequest. - # @param queries [::Array<::Google::Cloud::VisionAI::V1::OperatorQuery, ::Hash>] - # Required. The operator queries. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::VisionAI::V1::ResolveOperatorInfoResponse] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::VisionAI::V1::ResolveOperatorInfoResponse] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::ResolveOperatorInfoRequest.new - # - # # Call the resolve_operator_info method. - # result = client.resolve_operator_info request - # - # # The returned object is of type Google::Cloud::VisionAI::V1::ResolveOperatorInfoResponse. - # p result - # - def resolve_operator_info request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::ResolveOperatorInfoRequest - - # Converts hash 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.resolve_operator_info.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::VisionAI::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.resolve_operator_info.timeout, - metadata: metadata, - retry_policy: @config.rpcs.resolve_operator_info.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @live_video_analytics_stub.call_rpc :resolve_operator_info, 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 Operators in a given project and location. - # - # @overload list_operators(request, options = nil) - # Pass arguments to `list_operators` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::ListOperatorsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::ListOperatorsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_operators(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) - # Pass arguments to `list_operators` via keyword arguments. Note that at - # least one keyword argument is 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. Parent value for ListOperatorsRequest. - # @param page_size [::Integer] - # Requested page size. Server may return fewer items than requested. - # If unspecified, server will pick an appropriate default. - # @param page_token [::String] - # A token identifying a page of results the server should return. - # @param filter [::String] - # Filtering results. - # @param order_by [::String] - # Hint for how to order the results. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::VisionAI::V1::Operator>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::VisionAI::V1::Operator>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::ListOperatorsRequest.new - # - # # Call the list_operators method. - # result = client.list_operators 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::VisionAI::V1::Operator. - # p item - # end - # - def list_operators request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::ListOperatorsRequest - - # Converts hash 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_operators.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::VisionAI::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_operators.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_operators.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @live_video_analytics_stub.call_rpc :list_operators, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @live_video_analytics_stub, :list_operators, 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 - - ## - # Gets details of a single Operator. - # - # @overload get_operator(request, options = nil) - # Pass arguments to `get_operator` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::GetOperatorRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::GetOperatorRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_operator(name: nil) - # Pass arguments to `get_operator` via keyword arguments. Note that at - # least one keyword argument is 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 resource. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::VisionAI::V1::Operator] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::VisionAI::V1::Operator] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::GetOperatorRequest.new - # - # # Call the get_operator method. - # result = client.get_operator request - # - # # The returned object is of type Google::Cloud::VisionAI::V1::Operator. - # p result - # - def get_operator request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::GetOperatorRequest - - # Converts hash 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_operator.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::VisionAI::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_operator.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_operator.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @live_video_analytics_stub.call_rpc :get_operator, 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 Operator in a given project and location. - # - # @overload create_operator(request, options = nil) - # Pass arguments to `create_operator` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::CreateOperatorRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::CreateOperatorRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_operator(parent: nil, operator_id: nil, operator: nil, request_id: nil) - # Pass arguments to `create_operator` via keyword arguments. Note that at - # least one keyword argument is 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. Value for parent. - # @param operator_id [::String] - # Required. Id of the requesting object. - # @param operator [::Google::Cloud::VisionAI::V1::Operator, ::Hash] - # Required. The resource being created. - # @param request_id [::String] - # Optional. An optional request ID to identify requests. Specify a unique - # request ID so that if you must retry your request, the server will know to - # ignore the request if it has already been completed. The server will - # guarantee that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request ID, - # the server can check if original operation with the same request ID was - # received, and if so, will ignore the second request. This prevents clients - # from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # - # @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/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::CreateOperatorRequest.new - # - # # Call the create_operator method. - # result = client.create_operator 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_operator request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::CreateOperatorRequest - - # Converts hash 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_operator.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::VisionAI::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_operator.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_operator.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @live_video_analytics_stub.call_rpc :create_operator, 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 - - ## - # Updates the parameters of a single Operator. - # - # @overload update_operator(request, options = nil) - # Pass arguments to `update_operator` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::UpdateOperatorRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::UpdateOperatorRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_operator(update_mask: nil, operator: nil, request_id: nil) - # Pass arguments to `update_operator` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Required. Field mask is used to specify the fields to be overwritten in the - # Operator resource by the update. - # The fields specified in the update_mask are relative to the resource, not - # the full request. A field will be overwritten if it is in the mask. If the - # user does not provide a mask then all fields will be overwritten. - # @param operator [::Google::Cloud::VisionAI::V1::Operator, ::Hash] - # Required. The resource being updated - # @param request_id [::String] - # Optional. An optional request ID to identify requests. Specify a unique - # request ID so that if you must retry your request, the server will know to - # ignore the request if it has already been completed. The server will - # guarantee that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request ID, - # the server can check if original operation with the same request ID was - # received, and if so, will ignore the second request. This prevents clients - # from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # - # @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/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::UpdateOperatorRequest.new - # - # # Call the update_operator method. - # result = client.update_operator 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 update_operator request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::UpdateOperatorRequest - - # Converts hash 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_operator.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::VisionAI::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.operator&.name - header_params["operator.name"] = request.operator.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_operator.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_operator.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @live_video_analytics_stub.call_rpc :update_operator, 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 single Operator. - # - # @overload delete_operator(request, options = nil) - # Pass arguments to `delete_operator` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::DeleteOperatorRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::DeleteOperatorRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_operator(name: nil, request_id: nil) - # Pass arguments to `delete_operator` via keyword arguments. Note that at - # least one keyword argument is 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 resource - # @param request_id [::String] - # Optional. An optional request ID to identify requests. Specify a unique - # request ID so that if you must retry your request, the server will know to - # ignore the request if it has already been completed. The server will - # guarantee that for at least 60 minutes after the first request. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request ID, - # the server can check if original operation with the same request ID was - # received, and if so, will ignore the second request. This prevents clients - # from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # - # @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/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::DeleteOperatorRequest.new - # - # # Call the delete_operator method. - # result = client.delete_operator 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_operator request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::DeleteOperatorRequest - - # Converts hash 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_operator.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::VisionAI::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_operator.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_operator.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @live_video_analytics_stub.call_rpc :delete_operator, 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 - - ## - # Lists Analyses in a given project and location. - # - # @overload list_analyses(request, options = nil) - # Pass arguments to `list_analyses` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::ListAnalysesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::ListAnalysesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_analyses(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) - # Pass arguments to `list_analyses` via keyword arguments. Note that at - # least one keyword argument is 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. Parent value for ListAnalysesRequest - # @param page_size [::Integer] - # Requested page size. Server may return fewer items than requested. - # If unspecified, server will pick an appropriate default. - # @param page_token [::String] - # A token identifying a page of results the server should return. - # @param filter [::String] - # Filtering results - # @param order_by [::String] - # Hint for how to order the results - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::VisionAI::V1::Analysis>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::VisionAI::V1::Analysis>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::ListAnalysesRequest.new - # - # # Call the list_analyses method. - # result = client.list_analyses 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::VisionAI::V1::Analysis. - # p item - # end - # - def list_analyses request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::ListAnalysesRequest - - # Converts hash 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_analyses.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::VisionAI::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_analyses.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_analyses.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @live_video_analytics_stub.call_rpc :list_analyses, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @live_video_analytics_stub, :list_analyses, 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 - - ## - # Gets details of a single Analysis. - # - # @overload get_analysis(request, options = nil) - # Pass arguments to `get_analysis` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::GetAnalysisRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::GetAnalysisRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_analysis(name: nil) - # Pass arguments to `get_analysis` via keyword arguments. Note that at - # least one keyword argument is 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 resource. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::VisionAI::V1::Analysis] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::VisionAI::V1::Analysis] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::GetAnalysisRequest.new - # - # # Call the get_analysis method. - # result = client.get_analysis request - # - # # The returned object is of type Google::Cloud::VisionAI::V1::Analysis. - # p result - # - def get_analysis request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::GetAnalysisRequest - - # Converts hash 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_analysis.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::VisionAI::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_analysis.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_analysis.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @live_video_analytics_stub.call_rpc :get_analysis, 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 Analysis in a given project and location. - # - # @overload create_analysis(request, options = nil) - # Pass arguments to `create_analysis` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::CreateAnalysisRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::CreateAnalysisRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_analysis(parent: nil, analysis_id: nil, analysis: nil, request_id: nil) - # Pass arguments to `create_analysis` via keyword arguments. Note that at - # least one keyword argument is 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. Value for parent. - # @param analysis_id [::String] - # Required. Id of the requesting object. - # @param analysis [::Google::Cloud::VisionAI::V1::Analysis, ::Hash] - # Required. The resource being created. - # @param request_id [::String] - # Optional. An optional request ID to identify requests. Specify a unique - # request ID so that if you must retry your request, the server will know to - # ignore the request if it has already been completed. The server will - # guarantee that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request ID, - # the server can check if original operation with the same request ID was - # received, and if so, will ignore the second request. This prevents clients - # from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # - # @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/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::CreateAnalysisRequest.new - # - # # Call the create_analysis method. - # result = client.create_analysis 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_analysis request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::CreateAnalysisRequest - - # Converts hash 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_analysis.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::VisionAI::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_analysis.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_analysis.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @live_video_analytics_stub.call_rpc :create_analysis, 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 - - ## - # Updates the parameters of a single Analysis. - # - # @overload update_analysis(request, options = nil) - # Pass arguments to `update_analysis` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::UpdateAnalysisRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::UpdateAnalysisRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_analysis(update_mask: nil, analysis: nil, request_id: nil) - # Pass arguments to `update_analysis` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Required. Field mask is used to specify the fields to be overwritten in the - # Analysis resource by the update. - # The fields specified in the update_mask are relative to the resource, not - # the full request. A field will be overwritten if it is in the mask. If the - # user does not provide a mask then all fields will be overwritten. - # @param analysis [::Google::Cloud::VisionAI::V1::Analysis, ::Hash] - # Required. The resource being updated. - # @param request_id [::String] - # Optional. An optional request ID to identify requests. Specify a unique - # request ID so that if you must retry your request, the server will know to - # ignore the request if it has already been completed. The server will - # guarantee that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request ID, - # the server can check if original operation with the same request ID was - # received, and if so, will ignore the second request. This prevents clients - # from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # - # @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/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::UpdateAnalysisRequest.new - # - # # Call the update_analysis method. - # result = client.update_analysis 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 update_analysis request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::UpdateAnalysisRequest - - # Converts hash 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_analysis.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::VisionAI::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.analysis&.name - header_params["analysis.name"] = request.analysis.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_analysis.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_analysis.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @live_video_analytics_stub.call_rpc :update_analysis, 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 single Analysis. - # - # @overload delete_analysis(request, options = nil) - # Pass arguments to `delete_analysis` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::DeleteAnalysisRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::DeleteAnalysisRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_analysis(name: nil, request_id: nil) - # Pass arguments to `delete_analysis` via keyword arguments. Note that at - # least one keyword argument is 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 resource. - # @param request_id [::String] - # Optional. An optional request ID to identify requests. Specify a unique - # request ID so that if you must retry your request, the server will know to - # ignore the request if it has already been completed. The server will - # guarantee that for at least 60 minutes after the first request. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request ID, - # the server can check if original operation with the same request ID was - # received, and if so, will ignore the second request. This prevents clients - # from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # - # @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/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::DeleteAnalysisRequest.new - # - # # Call the delete_analysis method. - # result = client.delete_analysis 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_analysis request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::DeleteAnalysisRequest - - # Converts hash 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_analysis.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::VisionAI::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_analysis.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_analysis.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @live_video_analytics_stub.call_rpc :delete_analysis, 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 - - ## - # Lists Processes in a given project and location. - # - # @overload list_processes(request, options = nil) - # Pass arguments to `list_processes` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::ListProcessesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::ListProcessesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_processes(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) - # Pass arguments to `list_processes` via keyword arguments. Note that at - # least one keyword argument is 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. Parent value for ListProcessesRequest. - # @param page_size [::Integer] - # Requested page size. Server may return fewer items than requested. - # If unspecified, server will pick an appropriate default. - # @param page_token [::String] - # A token identifying a page of results the server should return. - # @param filter [::String] - # Filtering results - # @param order_by [::String] - # Hint for how to order the results - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::VisionAI::V1::Process>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::VisionAI::V1::Process>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::ListProcessesRequest.new - # - # # Call the list_processes method. - # result = client.list_processes 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::VisionAI::V1::Process. - # p item - # end - # - def list_processes request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::ListProcessesRequest - - # Converts hash 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_processes.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::VisionAI::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_processes.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_processes.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @live_video_analytics_stub.call_rpc :list_processes, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @live_video_analytics_stub, :list_processes, 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 - - ## - # Gets details of a single Process. - # - # @overload get_process(request, options = nil) - # Pass arguments to `get_process` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::GetProcessRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::GetProcessRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_process(name: nil) - # Pass arguments to `get_process` via keyword arguments. Note that at - # least one keyword argument is 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 resource. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::VisionAI::V1::Process] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::VisionAI::V1::Process] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::GetProcessRequest.new - # - # # Call the get_process method. - # result = client.get_process request - # - # # The returned object is of type Google::Cloud::VisionAI::V1::Process. - # p result - # - def get_process request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::GetProcessRequest - - # Converts hash 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_process.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::VisionAI::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_process.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_process.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @live_video_analytics_stub.call_rpc :get_process, 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 Process in a given project and location. - # - # @overload create_process(request, options = nil) - # Pass arguments to `create_process` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::CreateProcessRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::CreateProcessRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_process(parent: nil, process_id: nil, process: nil, request_id: nil) - # Pass arguments to `create_process` via keyword arguments. Note that at - # least one keyword argument is 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. Value for parent. - # @param process_id [::String] - # Required. Id of the requesting object. - # @param process [::Google::Cloud::VisionAI::V1::Process, ::Hash] - # Required. The resource being created. - # @param request_id [::String] - # Optional. An optional request ID to identify requests. Specify a unique - # request ID so that if you must retry your request, the server will know to - # ignore the request if it has already been completed. The server will - # guarantee that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request ID, - # the server can check if original operation with the same request ID was - # received, and if so, will ignore the second request. This prevents clients - # from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # - # @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/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::CreateProcessRequest.new - # - # # Call the create_process method. - # result = client.create_process 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_process request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::CreateProcessRequest - - # Converts hash 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_process.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::VisionAI::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_process.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_process.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @live_video_analytics_stub.call_rpc :create_process, 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 - - ## - # Updates the parameters of a single Process. - # - # @overload update_process(request, options = nil) - # Pass arguments to `update_process` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::UpdateProcessRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::UpdateProcessRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_process(update_mask: nil, process: nil, request_id: nil) - # Pass arguments to `update_process` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Required. Field mask is used to specify the fields to be overwritten in the - # Process resource by the update. - # The fields specified in the update_mask are relative to the resource, not - # the full request. A field will be overwritten if it is in the mask. If the - # user does not provide a mask then all fields will be overwritten. - # @param process [::Google::Cloud::VisionAI::V1::Process, ::Hash] - # Required. The resource being updated. - # @param request_id [::String] - # Optional. An optional request ID to identify requests. Specify a unique - # request ID so that if you must retry your request, the server will know to - # ignore the request if it has already been completed. The server will - # guarantee that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request ID, - # the server can check if original operation with the same request ID was - # received, and if so, will ignore the second request. This prevents clients - # from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # - # @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/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::UpdateProcessRequest.new - # - # # Call the update_process method. - # result = client.update_process 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 update_process request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::UpdateProcessRequest - - # Converts hash 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_process.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::VisionAI::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.process&.name - header_params["process.name"] = request.process.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_process.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_process.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @live_video_analytics_stub.call_rpc :update_process, 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 single Process. - # - # @overload delete_process(request, options = nil) - # Pass arguments to `delete_process` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::DeleteProcessRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::DeleteProcessRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_process(name: nil, request_id: nil) - # Pass arguments to `delete_process` via keyword arguments. Note that at - # least one keyword argument is 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 resource. - # @param request_id [::String] - # Optional. An optional request ID to identify requests. Specify a unique - # request ID so that if you must retry your request, the server will know to - # ignore the request if it has already been completed. The server will - # guarantee that for at least 60 minutes after the first request. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request ID, - # the server can check if original operation with the same request ID was - # received, and if so, will ignore the second request. This prevents clients - # from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # - # @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/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::DeleteProcessRequest.new - # - # # Call the delete_process method. - # result = client.delete_process 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_process request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::DeleteProcessRequest - - # Converts hash 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_process.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::VisionAI::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_process.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_process.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @live_video_analytics_stub.call_rpc :delete_process, 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 - - ## - # Run all of the processes to "completion". Max time for each process is - # the LRO time limit. - # - # @overload batch_run_process(request, options = nil) - # Pass arguments to `batch_run_process` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::BatchRunProcessRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::BatchRunProcessRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload batch_run_process(parent: nil, requests: nil, options: nil) - # Pass arguments to `batch_run_process` via keyword arguments. Note that at - # least one keyword argument is 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 parent resource shared by all processes being created. - # @param requests [::Array<::Google::Cloud::VisionAI::V1::CreateProcessRequest, ::Hash>] - # Required. The create process requests. - # @param options [::Google::Cloud::VisionAI::V1::BatchRunProcessRequest::BatchRunProcessOptions, ::Hash] - # Optional. Options for batch processes. - # - # @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/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::BatchRunProcessRequest.new - # - # # Call the batch_run_process method. - # result = client.batch_run_process 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 batch_run_process request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::BatchRunProcessRequest - - # Converts hash 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.batch_run_process.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::VisionAI::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.batch_run_process.timeout, - metadata: metadata, - retry_policy: @config.rpcs.batch_run_process.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @live_video_analytics_stub.call_rpc :batch_run_process, 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 LiveVideoAnalytics API. - # - # This class represents the configuration for LiveVideoAnalytics, - # 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::VisionAI::V1::LiveVideoAnalytics::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_public_operators to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_public_operators.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_public_operators.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::VisionAI::V1::LiveVideoAnalytics::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 = "visionai.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 LiveVideoAnalytics 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_public_operators` - # @return [::Gapic::Config::Method] - # - attr_reader :list_public_operators - ## - # RPC-specific configuration for `resolve_operator_info` - # @return [::Gapic::Config::Method] - # - attr_reader :resolve_operator_info - ## - # RPC-specific configuration for `list_operators` - # @return [::Gapic::Config::Method] - # - attr_reader :list_operators - ## - # RPC-specific configuration for `get_operator` - # @return [::Gapic::Config::Method] - # - attr_reader :get_operator - ## - # RPC-specific configuration for `create_operator` - # @return [::Gapic::Config::Method] - # - attr_reader :create_operator - ## - # RPC-specific configuration for `update_operator` - # @return [::Gapic::Config::Method] - # - attr_reader :update_operator - ## - # RPC-specific configuration for `delete_operator` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_operator - ## - # RPC-specific configuration for `list_analyses` - # @return [::Gapic::Config::Method] - # - attr_reader :list_analyses - ## - # RPC-specific configuration for `get_analysis` - # @return [::Gapic::Config::Method] - # - attr_reader :get_analysis - ## - # RPC-specific configuration for `create_analysis` - # @return [::Gapic::Config::Method] - # - attr_reader :create_analysis - ## - # RPC-specific configuration for `update_analysis` - # @return [::Gapic::Config::Method] - # - attr_reader :update_analysis - ## - # RPC-specific configuration for `delete_analysis` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_analysis - ## - # RPC-specific configuration for `list_processes` - # @return [::Gapic::Config::Method] - # - attr_reader :list_processes - ## - # RPC-specific configuration for `get_process` - # @return [::Gapic::Config::Method] - # - attr_reader :get_process - ## - # RPC-specific configuration for `create_process` - # @return [::Gapic::Config::Method] - # - attr_reader :create_process - ## - # RPC-specific configuration for `update_process` - # @return [::Gapic::Config::Method] - # - attr_reader :update_process - ## - # RPC-specific configuration for `delete_process` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_process - ## - # RPC-specific configuration for `batch_run_process` - # @return [::Gapic::Config::Method] - # - attr_reader :batch_run_process - - # @private - def initialize parent_rpcs = nil - list_public_operators_config = parent_rpcs.list_public_operators if parent_rpcs.respond_to? :list_public_operators - @list_public_operators = ::Gapic::Config::Method.new list_public_operators_config - resolve_operator_info_config = parent_rpcs.resolve_operator_info if parent_rpcs.respond_to? :resolve_operator_info - @resolve_operator_info = ::Gapic::Config::Method.new resolve_operator_info_config - list_operators_config = parent_rpcs.list_operators if parent_rpcs.respond_to? :list_operators - @list_operators = ::Gapic::Config::Method.new list_operators_config - get_operator_config = parent_rpcs.get_operator if parent_rpcs.respond_to? :get_operator - @get_operator = ::Gapic::Config::Method.new get_operator_config - create_operator_config = parent_rpcs.create_operator if parent_rpcs.respond_to? :create_operator - @create_operator = ::Gapic::Config::Method.new create_operator_config - update_operator_config = parent_rpcs.update_operator if parent_rpcs.respond_to? :update_operator - @update_operator = ::Gapic::Config::Method.new update_operator_config - delete_operator_config = parent_rpcs.delete_operator if parent_rpcs.respond_to? :delete_operator - @delete_operator = ::Gapic::Config::Method.new delete_operator_config - list_analyses_config = parent_rpcs.list_analyses if parent_rpcs.respond_to? :list_analyses - @list_analyses = ::Gapic::Config::Method.new list_analyses_config - get_analysis_config = parent_rpcs.get_analysis if parent_rpcs.respond_to? :get_analysis - @get_analysis = ::Gapic::Config::Method.new get_analysis_config - create_analysis_config = parent_rpcs.create_analysis if parent_rpcs.respond_to? :create_analysis - @create_analysis = ::Gapic::Config::Method.new create_analysis_config - update_analysis_config = parent_rpcs.update_analysis if parent_rpcs.respond_to? :update_analysis - @update_analysis = ::Gapic::Config::Method.new update_analysis_config - delete_analysis_config = parent_rpcs.delete_analysis if parent_rpcs.respond_to? :delete_analysis - @delete_analysis = ::Gapic::Config::Method.new delete_analysis_config - list_processes_config = parent_rpcs.list_processes if parent_rpcs.respond_to? :list_processes - @list_processes = ::Gapic::Config::Method.new list_processes_config - get_process_config = parent_rpcs.get_process if parent_rpcs.respond_to? :get_process - @get_process = ::Gapic::Config::Method.new get_process_config - create_process_config = parent_rpcs.create_process if parent_rpcs.respond_to? :create_process - @create_process = ::Gapic::Config::Method.new create_process_config - update_process_config = parent_rpcs.update_process if parent_rpcs.respond_to? :update_process - @update_process = ::Gapic::Config::Method.new update_process_config - delete_process_config = parent_rpcs.delete_process if parent_rpcs.respond_to? :delete_process - @delete_process = ::Gapic::Config::Method.new delete_process_config - batch_run_process_config = parent_rpcs.batch_run_process if parent_rpcs.respond_to? :batch_run_process - @batch_run_process = ::Gapic::Config::Method.new batch_run_process_config - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/live_video_analytics/credentials.rb b/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/live_video_analytics/credentials.rb deleted file mode 100644 index b31bd3fb9b7b..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/live_video_analytics/credentials.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! - -require "googleauth" - -module Google - module Cloud - module VisionAI - module V1 - module LiveVideoAnalytics - # Credentials for the LiveVideoAnalytics API. - class Credentials < ::Google::Auth::Credentials - self.scope = [ - "https://www.googleapis.com/auth/cloud-platform" - ] - self.env_vars = [ - "GOOGLE_CLOUD_CREDENTIALS", - "GOOGLE_CLOUD_KEYFILE", - "GCLOUD_KEYFILE", - "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-vision_ai-v1/lib/google/cloud/vision_ai/v1/live_video_analytics/operations.rb b/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/live_video_analytics/operations.rb deleted file mode 100644 index b82f7a9ba07a..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/live_video_analytics/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 VisionAI - module V1 - module LiveVideoAnalytics - # Service that implements Longrunning Operations API. - class Operations - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "visionai.$UNIVERSE_DOMAIN$" - - # @private - attr_reader :operations_stub - - ## - # Configuration for the LiveVideoAnalytics 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 LiveVideoAnalytics 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::VisionAI::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::VisionAI::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::VisionAI::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::VisionAI::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::VisionAI::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 = "visionai.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-vision_ai-v1/lib/google/cloud/vision_ai/v1/live_video_analytics/paths.rb b/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/live_video_analytics/paths.rb deleted file mode 100644 index ee3aa6e57557..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/live_video_analytics/paths.rb +++ /dev/null @@ -1,130 +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 VisionAI - module V1 - module LiveVideoAnalytics - # Path helper methods for the LiveVideoAnalytics API. - module Paths - ## - # Create a fully-qualified Analysis resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/clusters/{cluster}/analyses/{analysis}` - # - # @param project [String] - # @param location [String] - # @param cluster [String] - # @param analysis [String] - # - # @return [::String] - def analysis_path project:, location:, cluster:, analysis: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "cluster cannot contain /" if cluster.to_s.include? "/" - - "projects/#{project}/locations/#{location}/clusters/#{cluster}/analyses/#{analysis}" - end - - ## - # Create a fully-qualified Cluster resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/clusters/{cluster}` - # - # @param project [String] - # @param location [String] - # @param cluster [String] - # - # @return [::String] - def cluster_path project:, location:, cluster: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/clusters/#{cluster}" - 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 Operator resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/operators/{operator}` - # - # @param project [String] - # @param location [String] - # @param operator [String] - # - # @return [::String] - def operator_path project:, location:, operator: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/operators/#{operator}" - end - - ## - # Create a fully-qualified Process resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/clusters/{cluster}/processes/{process}` - # - # @param project [String] - # @param location [String] - # @param cluster [String] - # @param process [String] - # - # @return [::String] - def process_path project:, location:, cluster:, process: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "cluster cannot contain /" if cluster.to_s.include? "/" - - "projects/#{project}/locations/#{location}/clusters/#{cluster}/processes/#{process}" - end - - extend self - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/live_video_analytics/rest.rb b/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/live_video_analytics/rest.rb deleted file mode 100644 index 6e2749651b4a..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/live_video_analytics/rest.rb +++ /dev/null @@ -1,55 +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/vision_ai/v1/version" -require "google/cloud/vision_ai/v1/bindings_override" - -require "google/cloud/vision_ai/v1/live_video_analytics/credentials" -require "google/cloud/vision_ai/v1/live_video_analytics/paths" -require "google/cloud/vision_ai/v1/live_video_analytics/rest/operations" -require "google/cloud/vision_ai/v1/live_video_analytics/rest/client" - -module Google - module Cloud - module VisionAI - module V1 - ## - # Service describing handlers for resources. The service enables clients to run - # Live Video Analytics (LVA) on the streaming inputs. - # - # To load this service and instantiate a REST client: - # - # require "google/cloud/vision_ai/v1/live_video_analytics/rest" - # client = ::Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Rest::Client.new - # - module LiveVideoAnalytics - # Client for the REST transport - module Rest - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "rest", "helpers.rb" -require "google/cloud/vision_ai/v1/live_video_analytics/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/live_video_analytics/rest/client.rb b/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/live_video_analytics/rest/client.rb deleted file mode 100644 index 1cb8ade2dfbc..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/live_video_analytics/rest/client.rb +++ /dev/null @@ -1,2262 +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/visionai/v1/lva_service_pb" -require "google/cloud/vision_ai/v1/live_video_analytics/rest/service_stub" -require "google/cloud/location/rest" -require "google/iam/v1/rest" - -module Google - module Cloud - module VisionAI - module V1 - module LiveVideoAnalytics - module Rest - ## - # REST client for the LiveVideoAnalytics service. - # - # Service describing handlers for resources. The service enables clients to run - # Live Video Analytics (LVA) on the streaming inputs. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "visionai.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :live_video_analytics_stub - - ## - # Configure the LiveVideoAnalytics Client class. - # - # See {::Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all LiveVideoAnalytics clients - # ::Google::Cloud::VisionAI::V1::LiveVideoAnalytics::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", "VisionAI", "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.timeout = 60.0 - default_config.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.list_operators.timeout = 60.0 - - default_config.rpcs.get_operator.timeout = 60.0 - - default_config.rpcs.create_operator.timeout = 300.0 - - default_config.rpcs.update_operator.timeout = 60.0 - - default_config.rpcs.delete_operator.timeout = 60.0 - - default_config.rpcs.list_analyses.timeout = 60.0 - - default_config.rpcs.get_analysis.timeout = 60.0 - - default_config.rpcs.create_analysis.timeout = 300.0 - - default_config.rpcs.update_analysis.timeout = 60.0 - - default_config.rpcs.delete_analysis.timeout = 60.0 - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the LiveVideoAnalytics 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::VisionAI::V1::LiveVideoAnalytics::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 - @live_video_analytics_stub.universe_domain - end - - ## - # Create a new LiveVideoAnalytics REST client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Rest::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Rest::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the LiveVideoAnalytics 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::VisionAI::V1::LiveVideoAnalytics::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 - - @live_video_analytics_stub = ::Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Rest::ServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials, - logger: @config.logger - ) - - @live_video_analytics_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 = @live_video_analytics_stub.endpoint - config.universe_domain = @live_video_analytics_stub.universe_domain - config.bindings_override = @config.bindings_override - config.logger = @live_video_analytics_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 = @live_video_analytics_stub.endpoint - config.universe_domain = @live_video_analytics_stub.universe_domain - config.logger = @live_video_analytics_stub.logger if config.respond_to? :logger= - end - end - - ## - # Get the associated client for long-running operations. - # - # @return [::Google::Cloud::VisionAI::V1::LiveVideoAnalytics::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 - @live_video_analytics_stub.logger - end - - # Service calls - - ## - # ListPublicOperators returns all the operators in public registry. - # - # @overload list_public_operators(request, options = nil) - # Pass arguments to `list_public_operators` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::ListPublicOperatorsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::ListPublicOperatorsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_public_operators(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) - # Pass arguments to `list_public_operators` via keyword arguments. Note that at - # least one keyword argument is 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. Parent value for ListPublicOperatorsRequest. - # @param page_size [::Integer] - # Requested page size. Server may return fewer items than requested. - # If unspecified, server will pick an appropriate default. - # @param page_token [::String] - # A token identifying a page of results the server should return. - # @param filter [::String] - # Filtering results. - # @param order_by [::String] - # Hint for how to order the results. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::VisionAI::V1::Operator>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::VisionAI::V1::Operator>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::ListPublicOperatorsRequest.new - # - # # Call the list_public_operators method. - # result = client.list_public_operators 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::VisionAI::V1::Operator. - # p item - # end - # - def list_public_operators request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::ListPublicOperatorsRequest - - # Converts hash 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_public_operators.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::VisionAI::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_public_operators.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_public_operators.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @live_video_analytics_stub.list_public_operators request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @live_video_analytics_stub, :list_public_operators, "operators", 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 - - ## - # ResolveOperatorInfo returns the operator information based on the request. - # - # @overload resolve_operator_info(request, options = nil) - # Pass arguments to `resolve_operator_info` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::ResolveOperatorInfoRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::ResolveOperatorInfoRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload resolve_operator_info(parent: nil, queries: nil) - # Pass arguments to `resolve_operator_info` via keyword arguments. Note that at - # least one keyword argument is 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. Parent value for ResolveOperatorInfoRequest. - # @param queries [::Array<::Google::Cloud::VisionAI::V1::OperatorQuery, ::Hash>] - # Required. The operator queries. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::VisionAI::V1::ResolveOperatorInfoResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::VisionAI::V1::ResolveOperatorInfoResponse] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::ResolveOperatorInfoRequest.new - # - # # Call the resolve_operator_info method. - # result = client.resolve_operator_info request - # - # # The returned object is of type Google::Cloud::VisionAI::V1::ResolveOperatorInfoResponse. - # p result - # - def resolve_operator_info request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::ResolveOperatorInfoRequest - - # Converts hash 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.resolve_operator_info.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::VisionAI::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.resolve_operator_info.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.resolve_operator_info.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @live_video_analytics_stub.resolve_operator_info 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 Operators in a given project and location. - # - # @overload list_operators(request, options = nil) - # Pass arguments to `list_operators` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::ListOperatorsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::ListOperatorsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_operators(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) - # Pass arguments to `list_operators` via keyword arguments. Note that at - # least one keyword argument is 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. Parent value for ListOperatorsRequest. - # @param page_size [::Integer] - # Requested page size. Server may return fewer items than requested. - # If unspecified, server will pick an appropriate default. - # @param page_token [::String] - # A token identifying a page of results the server should return. - # @param filter [::String] - # Filtering results. - # @param order_by [::String] - # Hint for how to order the results. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::VisionAI::V1::Operator>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::VisionAI::V1::Operator>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::ListOperatorsRequest.new - # - # # Call the list_operators method. - # result = client.list_operators 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::VisionAI::V1::Operator. - # p item - # end - # - def list_operators request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::ListOperatorsRequest - - # Converts hash 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_operators.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::VisionAI::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_operators.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_operators.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @live_video_analytics_stub.list_operators request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @live_video_analytics_stub, :list_operators, "operators", 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 details of a single Operator. - # - # @overload get_operator(request, options = nil) - # Pass arguments to `get_operator` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::GetOperatorRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::GetOperatorRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_operator(name: nil) - # Pass arguments to `get_operator` via keyword arguments. Note that at - # least one keyword argument is 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 resource. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::VisionAI::V1::Operator] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::VisionAI::V1::Operator] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::GetOperatorRequest.new - # - # # Call the get_operator method. - # result = client.get_operator request - # - # # The returned object is of type Google::Cloud::VisionAI::V1::Operator. - # p result - # - def get_operator request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::GetOperatorRequest - - # Converts hash 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_operator.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::VisionAI::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_operator.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_operator.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @live_video_analytics_stub.get_operator 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 Operator in a given project and location. - # - # @overload create_operator(request, options = nil) - # Pass arguments to `create_operator` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::CreateOperatorRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::CreateOperatorRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_operator(parent: nil, operator_id: nil, operator: nil, request_id: nil) - # Pass arguments to `create_operator` via keyword arguments. Note that at - # least one keyword argument is 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. Value for parent. - # @param operator_id [::String] - # Required. Id of the requesting object. - # @param operator [::Google::Cloud::VisionAI::V1::Operator, ::Hash] - # Required. The resource being created. - # @param request_id [::String] - # Optional. An optional request ID to identify requests. Specify a unique - # request ID so that if you must retry your request, the server will know to - # ignore the request if it has already been completed. The server will - # guarantee that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request ID, - # the server can check if original operation with the same request ID was - # received, and if so, will ignore the second request. This prevents clients - # from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @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/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::CreateOperatorRequest.new - # - # # Call the create_operator method. - # result = client.create_operator 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_operator request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::CreateOperatorRequest - - # Converts hash 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_operator.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::VisionAI::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_operator.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_operator.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @live_video_analytics_stub.create_operator 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 - - ## - # Updates the parameters of a single Operator. - # - # @overload update_operator(request, options = nil) - # Pass arguments to `update_operator` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::UpdateOperatorRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::UpdateOperatorRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_operator(update_mask: nil, operator: nil, request_id: nil) - # Pass arguments to `update_operator` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Required. Field mask is used to specify the fields to be overwritten in the - # Operator resource by the update. - # The fields specified in the update_mask are relative to the resource, not - # the full request. A field will be overwritten if it is in the mask. If the - # user does not provide a mask then all fields will be overwritten. - # @param operator [::Google::Cloud::VisionAI::V1::Operator, ::Hash] - # Required. The resource being updated - # @param request_id [::String] - # Optional. An optional request ID to identify requests. Specify a unique - # request ID so that if you must retry your request, the server will know to - # ignore the request if it has already been completed. The server will - # guarantee that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request ID, - # the server can check if original operation with the same request ID was - # received, and if so, will ignore the second request. This prevents clients - # from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @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/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::UpdateOperatorRequest.new - # - # # Call the update_operator method. - # result = client.update_operator 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 update_operator request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::UpdateOperatorRequest - - # Converts hash 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_operator.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::VisionAI::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_operator.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_operator.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @live_video_analytics_stub.update_operator 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 single Operator. - # - # @overload delete_operator(request, options = nil) - # Pass arguments to `delete_operator` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::DeleteOperatorRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::DeleteOperatorRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_operator(name: nil, request_id: nil) - # Pass arguments to `delete_operator` via keyword arguments. Note that at - # least one keyword argument is 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 resource - # @param request_id [::String] - # Optional. An optional request ID to identify requests. Specify a unique - # request ID so that if you must retry your request, the server will know to - # ignore the request if it has already been completed. The server will - # guarantee that for at least 60 minutes after the first request. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request ID, - # the server can check if original operation with the same request ID was - # received, and if so, will ignore the second request. This prevents clients - # from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @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/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::DeleteOperatorRequest.new - # - # # Call the delete_operator method. - # result = client.delete_operator 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_operator request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::DeleteOperatorRequest - - # Converts hash 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_operator.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::VisionAI::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_operator.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_operator.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @live_video_analytics_stub.delete_operator 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 - - ## - # Lists Analyses in a given project and location. - # - # @overload list_analyses(request, options = nil) - # Pass arguments to `list_analyses` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::ListAnalysesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::ListAnalysesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_analyses(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) - # Pass arguments to `list_analyses` via keyword arguments. Note that at - # least one keyword argument is 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. Parent value for ListAnalysesRequest - # @param page_size [::Integer] - # Requested page size. Server may return fewer items than requested. - # If unspecified, server will pick an appropriate default. - # @param page_token [::String] - # A token identifying a page of results the server should return. - # @param filter [::String] - # Filtering results - # @param order_by [::String] - # Hint for how to order the results - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::VisionAI::V1::Analysis>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::VisionAI::V1::Analysis>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::ListAnalysesRequest.new - # - # # Call the list_analyses method. - # result = client.list_analyses 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::VisionAI::V1::Analysis. - # p item - # end - # - def list_analyses request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::ListAnalysesRequest - - # Converts hash 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_analyses.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::VisionAI::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_analyses.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_analyses.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @live_video_analytics_stub.list_analyses request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @live_video_analytics_stub, :list_analyses, "analyses", 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 details of a single Analysis. - # - # @overload get_analysis(request, options = nil) - # Pass arguments to `get_analysis` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::GetAnalysisRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::GetAnalysisRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_analysis(name: nil) - # Pass arguments to `get_analysis` via keyword arguments. Note that at - # least one keyword argument is 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 resource. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::VisionAI::V1::Analysis] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::VisionAI::V1::Analysis] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::GetAnalysisRequest.new - # - # # Call the get_analysis method. - # result = client.get_analysis request - # - # # The returned object is of type Google::Cloud::VisionAI::V1::Analysis. - # p result - # - def get_analysis request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::GetAnalysisRequest - - # Converts hash 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_analysis.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::VisionAI::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_analysis.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_analysis.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @live_video_analytics_stub.get_analysis 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 Analysis in a given project and location. - # - # @overload create_analysis(request, options = nil) - # Pass arguments to `create_analysis` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::CreateAnalysisRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::CreateAnalysisRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_analysis(parent: nil, analysis_id: nil, analysis: nil, request_id: nil) - # Pass arguments to `create_analysis` via keyword arguments. Note that at - # least one keyword argument is 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. Value for parent. - # @param analysis_id [::String] - # Required. Id of the requesting object. - # @param analysis [::Google::Cloud::VisionAI::V1::Analysis, ::Hash] - # Required. The resource being created. - # @param request_id [::String] - # Optional. An optional request ID to identify requests. Specify a unique - # request ID so that if you must retry your request, the server will know to - # ignore the request if it has already been completed. The server will - # guarantee that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request ID, - # the server can check if original operation with the same request ID was - # received, and if so, will ignore the second request. This prevents clients - # from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @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/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::CreateAnalysisRequest.new - # - # # Call the create_analysis method. - # result = client.create_analysis 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_analysis request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::CreateAnalysisRequest - - # Converts hash 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_analysis.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::VisionAI::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_analysis.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_analysis.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @live_video_analytics_stub.create_analysis 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 - - ## - # Updates the parameters of a single Analysis. - # - # @overload update_analysis(request, options = nil) - # Pass arguments to `update_analysis` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::UpdateAnalysisRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::UpdateAnalysisRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_analysis(update_mask: nil, analysis: nil, request_id: nil) - # Pass arguments to `update_analysis` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Required. Field mask is used to specify the fields to be overwritten in the - # Analysis resource by the update. - # The fields specified in the update_mask are relative to the resource, not - # the full request. A field will be overwritten if it is in the mask. If the - # user does not provide a mask then all fields will be overwritten. - # @param analysis [::Google::Cloud::VisionAI::V1::Analysis, ::Hash] - # Required. The resource being updated. - # @param request_id [::String] - # Optional. An optional request ID to identify requests. Specify a unique - # request ID so that if you must retry your request, the server will know to - # ignore the request if it has already been completed. The server will - # guarantee that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request ID, - # the server can check if original operation with the same request ID was - # received, and if so, will ignore the second request. This prevents clients - # from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @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/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::UpdateAnalysisRequest.new - # - # # Call the update_analysis method. - # result = client.update_analysis 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 update_analysis request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::UpdateAnalysisRequest - - # Converts hash 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_analysis.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::VisionAI::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_analysis.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_analysis.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @live_video_analytics_stub.update_analysis 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 single Analysis. - # - # @overload delete_analysis(request, options = nil) - # Pass arguments to `delete_analysis` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::DeleteAnalysisRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::DeleteAnalysisRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_analysis(name: nil, request_id: nil) - # Pass arguments to `delete_analysis` via keyword arguments. Note that at - # least one keyword argument is 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 resource. - # @param request_id [::String] - # Optional. An optional request ID to identify requests. Specify a unique - # request ID so that if you must retry your request, the server will know to - # ignore the request if it has already been completed. The server will - # guarantee that for at least 60 minutes after the first request. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request ID, - # the server can check if original operation with the same request ID was - # received, and if so, will ignore the second request. This prevents clients - # from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @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/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::DeleteAnalysisRequest.new - # - # # Call the delete_analysis method. - # result = client.delete_analysis 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_analysis request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::DeleteAnalysisRequest - - # Converts hash 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_analysis.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::VisionAI::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_analysis.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_analysis.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @live_video_analytics_stub.delete_analysis 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 - - ## - # Lists Processes in a given project and location. - # - # @overload list_processes(request, options = nil) - # Pass arguments to `list_processes` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::ListProcessesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::ListProcessesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_processes(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) - # Pass arguments to `list_processes` via keyword arguments. Note that at - # least one keyword argument is 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. Parent value for ListProcessesRequest. - # @param page_size [::Integer] - # Requested page size. Server may return fewer items than requested. - # If unspecified, server will pick an appropriate default. - # @param page_token [::String] - # A token identifying a page of results the server should return. - # @param filter [::String] - # Filtering results - # @param order_by [::String] - # Hint for how to order the results - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::VisionAI::V1::Process>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::VisionAI::V1::Process>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::ListProcessesRequest.new - # - # # Call the list_processes method. - # result = client.list_processes 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::VisionAI::V1::Process. - # p item - # end - # - def list_processes request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::ListProcessesRequest - - # Converts hash 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_processes.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::VisionAI::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_processes.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_processes.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @live_video_analytics_stub.list_processes request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @live_video_analytics_stub, :list_processes, "processes", 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 details of a single Process. - # - # @overload get_process(request, options = nil) - # Pass arguments to `get_process` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::GetProcessRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::GetProcessRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_process(name: nil) - # Pass arguments to `get_process` via keyword arguments. Note that at - # least one keyword argument is 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 resource. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::VisionAI::V1::Process] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::VisionAI::V1::Process] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::GetProcessRequest.new - # - # # Call the get_process method. - # result = client.get_process request - # - # # The returned object is of type Google::Cloud::VisionAI::V1::Process. - # p result - # - def get_process request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::GetProcessRequest - - # Converts hash 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_process.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::VisionAI::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_process.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_process.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @live_video_analytics_stub.get_process 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 Process in a given project and location. - # - # @overload create_process(request, options = nil) - # Pass arguments to `create_process` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::CreateProcessRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::CreateProcessRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_process(parent: nil, process_id: nil, process: nil, request_id: nil) - # Pass arguments to `create_process` via keyword arguments. Note that at - # least one keyword argument is 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. Value for parent. - # @param process_id [::String] - # Required. Id of the requesting object. - # @param process [::Google::Cloud::VisionAI::V1::Process, ::Hash] - # Required. The resource being created. - # @param request_id [::String] - # Optional. An optional request ID to identify requests. Specify a unique - # request ID so that if you must retry your request, the server will know to - # ignore the request if it has already been completed. The server will - # guarantee that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request ID, - # the server can check if original operation with the same request ID was - # received, and if so, will ignore the second request. This prevents clients - # from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @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/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::CreateProcessRequest.new - # - # # Call the create_process method. - # result = client.create_process 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_process request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::CreateProcessRequest - - # Converts hash 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_process.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::VisionAI::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_process.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_process.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @live_video_analytics_stub.create_process 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 - - ## - # Updates the parameters of a single Process. - # - # @overload update_process(request, options = nil) - # Pass arguments to `update_process` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::UpdateProcessRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::UpdateProcessRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_process(update_mask: nil, process: nil, request_id: nil) - # Pass arguments to `update_process` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Required. Field mask is used to specify the fields to be overwritten in the - # Process resource by the update. - # The fields specified in the update_mask are relative to the resource, not - # the full request. A field will be overwritten if it is in the mask. If the - # user does not provide a mask then all fields will be overwritten. - # @param process [::Google::Cloud::VisionAI::V1::Process, ::Hash] - # Required. The resource being updated. - # @param request_id [::String] - # Optional. An optional request ID to identify requests. Specify a unique - # request ID so that if you must retry your request, the server will know to - # ignore the request if it has already been completed. The server will - # guarantee that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request ID, - # the server can check if original operation with the same request ID was - # received, and if so, will ignore the second request. This prevents clients - # from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @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/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::UpdateProcessRequest.new - # - # # Call the update_process method. - # result = client.update_process 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 update_process request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::UpdateProcessRequest - - # Converts hash 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_process.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::VisionAI::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_process.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_process.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @live_video_analytics_stub.update_process 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 single Process. - # - # @overload delete_process(request, options = nil) - # Pass arguments to `delete_process` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::DeleteProcessRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::DeleteProcessRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_process(name: nil, request_id: nil) - # Pass arguments to `delete_process` via keyword arguments. Note that at - # least one keyword argument is 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 resource. - # @param request_id [::String] - # Optional. An optional request ID to identify requests. Specify a unique - # request ID so that if you must retry your request, the server will know to - # ignore the request if it has already been completed. The server will - # guarantee that for at least 60 minutes after the first request. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request ID, - # the server can check if original operation with the same request ID was - # received, and if so, will ignore the second request. This prevents clients - # from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @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/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::DeleteProcessRequest.new - # - # # Call the delete_process method. - # result = client.delete_process 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_process request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::DeleteProcessRequest - - # Converts hash 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_process.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::VisionAI::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_process.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_process.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @live_video_analytics_stub.delete_process 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 - - ## - # Run all of the processes to "completion". Max time for each process is - # the LRO time limit. - # - # @overload batch_run_process(request, options = nil) - # Pass arguments to `batch_run_process` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::BatchRunProcessRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::BatchRunProcessRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload batch_run_process(parent: nil, requests: nil, options: nil) - # Pass arguments to `batch_run_process` via keyword arguments. Note that at - # least one keyword argument is 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 parent resource shared by all processes being created. - # @param requests [::Array<::Google::Cloud::VisionAI::V1::CreateProcessRequest, ::Hash>] - # Required. The create process requests. - # @param options [::Google::Cloud::VisionAI::V1::BatchRunProcessRequest::BatchRunProcessOptions, ::Hash] - # Optional. Options for batch processes. - # @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/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::BatchRunProcessRequest.new - # - # # Call the batch_run_process method. - # result = client.batch_run_process 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 batch_run_process request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::BatchRunProcessRequest - - # Converts hash 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.batch_run_process.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::VisionAI::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.batch_run_process.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.batch_run_process.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @live_video_analytics_stub.batch_run_process 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 - - ## - # Configuration class for the LiveVideoAnalytics REST API. - # - # This class represents the configuration for LiveVideoAnalytics 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::VisionAI::V1::LiveVideoAnalytics::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_public_operators to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_public_operators.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_public_operators.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 = "visionai.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 LiveVideoAnalytics 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_public_operators` - # @return [::Gapic::Config::Method] - # - attr_reader :list_public_operators - ## - # RPC-specific configuration for `resolve_operator_info` - # @return [::Gapic::Config::Method] - # - attr_reader :resolve_operator_info - ## - # RPC-specific configuration for `list_operators` - # @return [::Gapic::Config::Method] - # - attr_reader :list_operators - ## - # RPC-specific configuration for `get_operator` - # @return [::Gapic::Config::Method] - # - attr_reader :get_operator - ## - # RPC-specific configuration for `create_operator` - # @return [::Gapic::Config::Method] - # - attr_reader :create_operator - ## - # RPC-specific configuration for `update_operator` - # @return [::Gapic::Config::Method] - # - attr_reader :update_operator - ## - # RPC-specific configuration for `delete_operator` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_operator - ## - # RPC-specific configuration for `list_analyses` - # @return [::Gapic::Config::Method] - # - attr_reader :list_analyses - ## - # RPC-specific configuration for `get_analysis` - # @return [::Gapic::Config::Method] - # - attr_reader :get_analysis - ## - # RPC-specific configuration for `create_analysis` - # @return [::Gapic::Config::Method] - # - attr_reader :create_analysis - ## - # RPC-specific configuration for `update_analysis` - # @return [::Gapic::Config::Method] - # - attr_reader :update_analysis - ## - # RPC-specific configuration for `delete_analysis` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_analysis - ## - # RPC-specific configuration for `list_processes` - # @return [::Gapic::Config::Method] - # - attr_reader :list_processes - ## - # RPC-specific configuration for `get_process` - # @return [::Gapic::Config::Method] - # - attr_reader :get_process - ## - # RPC-specific configuration for `create_process` - # @return [::Gapic::Config::Method] - # - attr_reader :create_process - ## - # RPC-specific configuration for `update_process` - # @return [::Gapic::Config::Method] - # - attr_reader :update_process - ## - # RPC-specific configuration for `delete_process` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_process - ## - # RPC-specific configuration for `batch_run_process` - # @return [::Gapic::Config::Method] - # - attr_reader :batch_run_process - - # @private - def initialize parent_rpcs = nil - list_public_operators_config = parent_rpcs.list_public_operators if parent_rpcs.respond_to? :list_public_operators - @list_public_operators = ::Gapic::Config::Method.new list_public_operators_config - resolve_operator_info_config = parent_rpcs.resolve_operator_info if parent_rpcs.respond_to? :resolve_operator_info - @resolve_operator_info = ::Gapic::Config::Method.new resolve_operator_info_config - list_operators_config = parent_rpcs.list_operators if parent_rpcs.respond_to? :list_operators - @list_operators = ::Gapic::Config::Method.new list_operators_config - get_operator_config = parent_rpcs.get_operator if parent_rpcs.respond_to? :get_operator - @get_operator = ::Gapic::Config::Method.new get_operator_config - create_operator_config = parent_rpcs.create_operator if parent_rpcs.respond_to? :create_operator - @create_operator = ::Gapic::Config::Method.new create_operator_config - update_operator_config = parent_rpcs.update_operator if parent_rpcs.respond_to? :update_operator - @update_operator = ::Gapic::Config::Method.new update_operator_config - delete_operator_config = parent_rpcs.delete_operator if parent_rpcs.respond_to? :delete_operator - @delete_operator = ::Gapic::Config::Method.new delete_operator_config - list_analyses_config = parent_rpcs.list_analyses if parent_rpcs.respond_to? :list_analyses - @list_analyses = ::Gapic::Config::Method.new list_analyses_config - get_analysis_config = parent_rpcs.get_analysis if parent_rpcs.respond_to? :get_analysis - @get_analysis = ::Gapic::Config::Method.new get_analysis_config - create_analysis_config = parent_rpcs.create_analysis if parent_rpcs.respond_to? :create_analysis - @create_analysis = ::Gapic::Config::Method.new create_analysis_config - update_analysis_config = parent_rpcs.update_analysis if parent_rpcs.respond_to? :update_analysis - @update_analysis = ::Gapic::Config::Method.new update_analysis_config - delete_analysis_config = parent_rpcs.delete_analysis if parent_rpcs.respond_to? :delete_analysis - @delete_analysis = ::Gapic::Config::Method.new delete_analysis_config - list_processes_config = parent_rpcs.list_processes if parent_rpcs.respond_to? :list_processes - @list_processes = ::Gapic::Config::Method.new list_processes_config - get_process_config = parent_rpcs.get_process if parent_rpcs.respond_to? :get_process - @get_process = ::Gapic::Config::Method.new get_process_config - create_process_config = parent_rpcs.create_process if parent_rpcs.respond_to? :create_process - @create_process = ::Gapic::Config::Method.new create_process_config - update_process_config = parent_rpcs.update_process if parent_rpcs.respond_to? :update_process - @update_process = ::Gapic::Config::Method.new update_process_config - delete_process_config = parent_rpcs.delete_process if parent_rpcs.respond_to? :delete_process - @delete_process = ::Gapic::Config::Method.new delete_process_config - batch_run_process_config = parent_rpcs.batch_run_process if parent_rpcs.respond_to? :batch_run_process - @batch_run_process = ::Gapic::Config::Method.new batch_run_process_config - - yield self if block_given? - end - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/live_video_analytics/rest/operations.rb b/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/live_video_analytics/rest/operations.rb deleted file mode 100644 index 8e118e8c0e2f..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/live_video_analytics/rest/operations.rb +++ /dev/null @@ -1,974 +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 VisionAI - module V1 - module LiveVideoAnalytics - module Rest - # Service that implements Longrunning Operations API. - class Operations - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "visionai.$UNIVERSE_DOMAIN$" - - # @private - attr_reader :operations_stub - - ## - # Configuration for the LiveVideoAnalytics 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 LiveVideoAnalytics 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::VisionAI::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::VisionAI::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::VisionAI::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::VisionAI::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 = "visionai.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}/operations", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/?$}, 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] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/warehouseOperations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/corpora/[^/]+/assets/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/corpora/[^/]+/collections/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/corpora/[^/]+/imageIndexes/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/corpora/[^/]+/indexes/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/corpora/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/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{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] - ] - ) - 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{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/live_video_analytics/rest/service_stub.rb b/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/live_video_analytics/rest/service_stub.rb deleted file mode 100644 index c44ddb947aa8..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/live_video_analytics/rest/service_stub.rb +++ /dev/null @@ -1,1187 +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/visionai/v1/lva_service_pb" - -module Google - module Cloud - module VisionAI - module V1 - module LiveVideoAnalytics - module Rest - ## - # REST service stub for the LiveVideoAnalytics 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_public_operators REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::ListPublicOperatorsRequest] - # 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::VisionAI::V1::ListPublicOperatorsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::VisionAI::V1::ListPublicOperatorsResponse] - # A result object deserialized from the server's reply - def list_public_operators request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_public_operators_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_public_operators", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::VisionAI::V1::ListPublicOperatorsResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the resolve_operator_info REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::ResolveOperatorInfoRequest] - # 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::VisionAI::V1::ResolveOperatorInfoResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::VisionAI::V1::ResolveOperatorInfoResponse] - # A result object deserialized from the server's reply - def resolve_operator_info request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_resolve_operator_info_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: "resolve_operator_info", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::VisionAI::V1::ResolveOperatorInfoResponse.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_operators REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::ListOperatorsRequest] - # 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::VisionAI::V1::ListOperatorsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::VisionAI::V1::ListOperatorsResponse] - # A result object deserialized from the server's reply - def list_operators request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_operators_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_operators", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::VisionAI::V1::ListOperatorsResponse.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_operator REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::GetOperatorRequest] - # 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::VisionAI::V1::Operator] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::VisionAI::V1::Operator] - # A result object deserialized from the server's reply - def get_operator request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_operator_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_operator", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::VisionAI::V1::Operator.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_operator REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::CreateOperatorRequest] - # 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_operator request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_operator_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_operator", - 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 update_operator REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::UpdateOperatorRequest] - # 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 update_operator request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_operator_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_operator", - 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_operator REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::DeleteOperatorRequest] - # 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_operator request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_delete_operator_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_operator", - 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 list_analyses REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::ListAnalysesRequest] - # 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::VisionAI::V1::ListAnalysesResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::VisionAI::V1::ListAnalysesResponse] - # A result object deserialized from the server's reply - def list_analyses request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_analyses_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_analyses", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::VisionAI::V1::ListAnalysesResponse.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_analysis REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::GetAnalysisRequest] - # 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::VisionAI::V1::Analysis] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::VisionAI::V1::Analysis] - # A result object deserialized from the server's reply - def get_analysis request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_analysis_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_analysis", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::VisionAI::V1::Analysis.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_analysis REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::CreateAnalysisRequest] - # 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_analysis request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_analysis_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_analysis", - 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 update_analysis REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::UpdateAnalysisRequest] - # 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 update_analysis request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_analysis_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_analysis", - 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_analysis REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::DeleteAnalysisRequest] - # 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_analysis request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_delete_analysis_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_analysis", - 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 list_processes REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::ListProcessesRequest] - # 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::VisionAI::V1::ListProcessesResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::VisionAI::V1::ListProcessesResponse] - # A result object deserialized from the server's reply - def list_processes request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_processes_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_processes", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::VisionAI::V1::ListProcessesResponse.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_process REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::GetProcessRequest] - # 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::VisionAI::V1::Process] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::VisionAI::V1::Process] - # A result object deserialized from the server's reply - def get_process request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_process_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_process", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::VisionAI::V1::Process.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_process REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::CreateProcessRequest] - # 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_process request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_process_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_process", - 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 update_process REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::UpdateProcessRequest] - # 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 update_process request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_process_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_process", - 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_process REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::DeleteProcessRequest] - # 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_process request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_delete_process_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_process", - 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 batch_run_process REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::BatchRunProcessRequest] - # 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 batch_run_process request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_batch_run_process_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: "batch_run_process", - 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 - - ## - # @private - # - # GRPC transcoding helper method for the list_public_operators REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::ListPublicOperatorsRequest] - # 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_public_operators_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}:listPublicOperators", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the resolve_operator_info REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::ResolveOperatorInfoRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_resolve_operator_info_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}:resolveOperatorInfo", - body: "*", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_operators REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::ListOperatorsRequest] - # 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_operators_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/operators", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_operator REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::GetOperatorRequest] - # 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_operator_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/operators/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the create_operator REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::CreateOperatorRequest] - # 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_operator_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}/operators", - body: "operator", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_operator REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::UpdateOperatorRequest] - # 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_operator_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v1/{operator.name}", - body: "operator", - matches: [ - ["operator.name", %r{^projects/[^/]+/locations/[^/]+/operators/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_operator REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::DeleteOperatorRequest] - # 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_operator_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/operators/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_analyses REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::ListAnalysesRequest] - # 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_analyses_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/analyses", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/clusters/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_analysis REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::GetAnalysisRequest] - # 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_analysis_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/clusters/[^/]+/analyses/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the create_analysis REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::CreateAnalysisRequest] - # 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_analysis_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}/analyses", - body: "analysis", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/clusters/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_analysis REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::UpdateAnalysisRequest] - # 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_analysis_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v1/{analysis.name}", - body: "analysis", - matches: [ - ["analysis.name", %r{^projects/[^/]+/locations/[^/]+/clusters/[^/]+/analyses/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_analysis REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::DeleteAnalysisRequest] - # 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_analysis_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/clusters/[^/]+/analyses/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_processes REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::ListProcessesRequest] - # 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_processes_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/processes", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/clusters/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_process REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::GetProcessRequest] - # 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_process_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/clusters/[^/]+/processes/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the create_process REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::CreateProcessRequest] - # 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_process_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}/processes", - body: "process", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/clusters/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_process REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::UpdateProcessRequest] - # 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_process_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v1/{process.name}", - body: "process", - matches: [ - ["process.name", %r{^projects/[^/]+/locations/[^/]+/clusters/[^/]+/processes/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_process REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::DeleteProcessRequest] - # 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_process_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/clusters/[^/]+/processes/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the batch_run_process REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::BatchRunProcessRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_batch_run_process_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}/processes:batchRun", - body: "*", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/clusters/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/rest.rb b/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/rest.rb deleted file mode 100644 index 3f373fb0a2e0..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/rest.rb +++ /dev/null @@ -1,43 +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/vision_ai/v1/live_video_analytics/rest" -require "google/cloud/vision_ai/v1/app_platform/rest" -require "google/cloud/vision_ai/v1/streaming_service/rest" -require "google/cloud/vision_ai/v1/streams_service/rest" -require "google/cloud/vision_ai/v1/warehouse/rest" -require "google/cloud/vision_ai/v1/health_check_service/rest" -require "google/cloud/vision_ai/v1/bindings_override" -require "google/cloud/vision_ai/v1/version" - -module Google - module Cloud - module VisionAI - ## - # To load just the REST part of this package, including all its services, and instantiate a REST client: - # - # @example - # - # require "google/cloud/vision_ai/v1/rest" - # client = ::Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Rest::Client.new - # - module V1 - end - end - end -end diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/streaming_service.rb b/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/streaming_service.rb deleted file mode 100644 index 71b7779b4a6d..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/streaming_service.rb +++ /dev/null @@ -1,55 +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/vision_ai/v1/version" - -require "google/cloud/vision_ai/v1/streaming_service/credentials" -require "google/cloud/vision_ai/v1/streaming_service/paths" -require "google/cloud/vision_ai/v1/streaming_service/client" -require "google/cloud/vision_ai/v1/streaming_service/rest" - -module Google - module Cloud - module VisionAI - module V1 - ## - # Streaming service for receiving and sending packets. - # - # @example Load this service and instantiate a gRPC client - # - # require "google/cloud/vision_ai/v1/streaming_service" - # client = ::Google::Cloud::VisionAI::V1::StreamingService::Client.new - # - # @example Load this service and instantiate a REST client - # - # require "google/cloud/vision_ai/v1/streaming_service/rest" - # client = ::Google::Cloud::VisionAI::V1::StreamingService::Rest::Client.new - # - module StreamingService - end - end - end - end -end - -helper_path = ::File.join __dir__, "streaming_service", "helpers.rb" -require "google/cloud/vision_ai/v1/streaming_service/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/streaming_service/client.rb b/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/streaming_service/client.rb deleted file mode 100644 index e525c4c362dc..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/streaming_service/client.rb +++ /dev/null @@ -1,961 +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/visionai/v1/streaming_service_pb" -require "google/cloud/location" -require "google/iam/v1" - -module Google - module Cloud - module VisionAI - module V1 - module StreamingService - ## - # Client for the StreamingService service. - # - # Streaming service for receiving and sending packets. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "visionai.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :streaming_service_stub - - ## - # Configure the StreamingService Client class. - # - # See {::Google::Cloud::VisionAI::V1::StreamingService::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all StreamingService clients - # ::Google::Cloud::VisionAI::V1::StreamingService::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", "VisionAI", "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 - end - yield @configure if block_given? - @configure - end - - ## - # Configure the StreamingService 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::VisionAI::V1::StreamingService::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 - @streaming_service_stub.universe_domain - end - - ## - # Create a new StreamingService client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::VisionAI::V1::StreamingService::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::VisionAI::V1::StreamingService::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the StreamingService 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/visionai/v1/streaming_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 - - @streaming_service_stub = ::Gapic::ServiceStub.new( - ::Google::Cloud::VisionAI::V1::StreamingService::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 - ) - - @streaming_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 = @streaming_service_stub.endpoint - config.universe_domain = @streaming_service_stub.universe_domain - config.logger = @streaming_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 = @streaming_service_stub.endpoint - config.universe_domain = @streaming_service_stub.universe_domain - config.logger = @streaming_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 - @streaming_service_stub.logger - end - - # Service calls - - ## - # Send packets to the series. - # - # @param request [::Gapic::StreamInput, ::Enumerable<::Google::Cloud::VisionAI::V1::SendPacketsRequest, ::Hash>] - # An enumerable of {::Google::Cloud::VisionAI::V1::SendPacketsRequest} instances. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Enumerable<::Google::Cloud::VisionAI::V1::SendPacketsResponse>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Enumerable<::Google::Cloud::VisionAI::V1::SendPacketsResponse>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::StreamingService::Client.new - # - # # Create an input stream. - # input = Gapic::StreamInput.new - # - # # Call the send_packets method to start streaming. - # output = client.send_packets input - # - # # Send requests on the stream. For each request object, set fields by - # # passing keyword arguments. Be sure to close the stream when done. - # input << Google::Cloud::VisionAI::V1::SendPacketsRequest.new - # input << Google::Cloud::VisionAI::V1::SendPacketsRequest.new - # input.close - # - # # The returned object is a streamed enumerable yielding elements of type - # # ::Google::Cloud::VisionAI::V1::SendPacketsResponse - # output.each do |current_response| - # p current_response - # end - # - def send_packets request, options = nil - unless request.is_a? ::Enumerable - raise ::ArgumentError, "request must be an Enumerable" unless request.respond_to? :to_enum - request = request.to_enum - end - - request = request.lazy.map do |req| - ::Gapic::Protobuf.coerce req, to: ::Google::Cloud::VisionAI::V1::SendPacketsRequest - end - - # Converts hash 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.send_packets.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::VisionAI::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.send_packets.timeout, - metadata: metadata, - retry_policy: @config.rpcs.send_packets.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @streaming_service_stub.call_rpc :send_packets, 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 - - ## - # Receive packets from the series. - # - # @param request [::Gapic::StreamInput, ::Enumerable<::Google::Cloud::VisionAI::V1::ReceivePacketsRequest, ::Hash>] - # An enumerable of {::Google::Cloud::VisionAI::V1::ReceivePacketsRequest} instances. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Enumerable<::Google::Cloud::VisionAI::V1::ReceivePacketsResponse>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Enumerable<::Google::Cloud::VisionAI::V1::ReceivePacketsResponse>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::StreamingService::Client.new - # - # # Create an input stream. - # input = Gapic::StreamInput.new - # - # # Call the receive_packets method to start streaming. - # output = client.receive_packets input - # - # # Send requests on the stream. For each request object, set fields by - # # passing keyword arguments. Be sure to close the stream when done. - # input << Google::Cloud::VisionAI::V1::ReceivePacketsRequest.new - # input << Google::Cloud::VisionAI::V1::ReceivePacketsRequest.new - # input.close - # - # # The returned object is a streamed enumerable yielding elements of type - # # ::Google::Cloud::VisionAI::V1::ReceivePacketsResponse - # output.each do |current_response| - # p current_response - # end - # - def receive_packets request, options = nil - unless request.is_a? ::Enumerable - raise ::ArgumentError, "request must be an Enumerable" unless request.respond_to? :to_enum - request = request.to_enum - end - - request = request.lazy.map do |req| - ::Gapic::Protobuf.coerce req, to: ::Google::Cloud::VisionAI::V1::ReceivePacketsRequest - end - - # Converts hash 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.receive_packets.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::VisionAI::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.receive_packets.timeout, - metadata: metadata, - retry_policy: @config.rpcs.receive_packets.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @streaming_service_stub.call_rpc :receive_packets, 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 - - ## - # Receive events given the stream name. - # - # @param request [::Gapic::StreamInput, ::Enumerable<::Google::Cloud::VisionAI::V1::ReceiveEventsRequest, ::Hash>] - # An enumerable of {::Google::Cloud::VisionAI::V1::ReceiveEventsRequest} instances. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Enumerable<::Google::Cloud::VisionAI::V1::ReceiveEventsResponse>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Enumerable<::Google::Cloud::VisionAI::V1::ReceiveEventsResponse>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::StreamingService::Client.new - # - # # Create an input stream. - # input = Gapic::StreamInput.new - # - # # Call the receive_events method to start streaming. - # output = client.receive_events input - # - # # Send requests on the stream. For each request object, set fields by - # # passing keyword arguments. Be sure to close the stream when done. - # input << Google::Cloud::VisionAI::V1::ReceiveEventsRequest.new - # input << Google::Cloud::VisionAI::V1::ReceiveEventsRequest.new - # input.close - # - # # The returned object is a streamed enumerable yielding elements of type - # # ::Google::Cloud::VisionAI::V1::ReceiveEventsResponse - # output.each do |current_response| - # p current_response - # end - # - def receive_events request, options = nil - unless request.is_a? ::Enumerable - raise ::ArgumentError, "request must be an Enumerable" unless request.respond_to? :to_enum - request = request.to_enum - end - - request = request.lazy.map do |req| - ::Gapic::Protobuf.coerce req, to: ::Google::Cloud::VisionAI::V1::ReceiveEventsRequest - end - - # Converts hash 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.receive_events.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::VisionAI::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.receive_events.timeout, - metadata: metadata, - retry_policy: @config.rpcs.receive_events.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @streaming_service_stub.call_rpc :receive_events, 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 - - ## - # AcquireLease acquires a lease. - # - # @overload acquire_lease(request, options = nil) - # Pass arguments to `acquire_lease` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::AcquireLeaseRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::AcquireLeaseRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload acquire_lease(series: nil, owner: nil, term: nil, lease_type: nil) - # Pass arguments to `acquire_lease` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param series [::String] - # The series name. - # @param owner [::String] - # The owner name. - # @param term [::Google::Protobuf::Duration, ::Hash] - # The lease term. - # @param lease_type [::Google::Cloud::VisionAI::V1::LeaseType] - # The lease type. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::VisionAI::V1::Lease] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::VisionAI::V1::Lease] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::StreamingService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::AcquireLeaseRequest.new - # - # # Call the acquire_lease method. - # result = client.acquire_lease request - # - # # The returned object is of type Google::Cloud::VisionAI::V1::Lease. - # p result - # - def acquire_lease request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::AcquireLeaseRequest - - # Converts hash 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.acquire_lease.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::VisionAI::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.series - header_params["series"] = request.series - 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.acquire_lease.timeout, - metadata: metadata, - retry_policy: @config.rpcs.acquire_lease.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @streaming_service_stub.call_rpc :acquire_lease, 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 - - ## - # RenewLease renews a lease. - # - # @overload renew_lease(request, options = nil) - # Pass arguments to `renew_lease` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::RenewLeaseRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::RenewLeaseRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload renew_lease(id: nil, series: nil, owner: nil, term: nil) - # Pass arguments to `renew_lease` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param id [::String] - # Lease id. - # @param series [::String] - # Series name. - # @param owner [::String] - # Lease owner. - # @param term [::Google::Protobuf::Duration, ::Hash] - # Lease term. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::VisionAI::V1::Lease] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::VisionAI::V1::Lease] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::StreamingService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::RenewLeaseRequest.new - # - # # Call the renew_lease method. - # result = client.renew_lease request - # - # # The returned object is of type Google::Cloud::VisionAI::V1::Lease. - # p result - # - def renew_lease request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::RenewLeaseRequest - - # Converts hash 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.renew_lease.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::VisionAI::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.series - header_params["series"] = request.series - 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.renew_lease.timeout, - metadata: metadata, - retry_policy: @config.rpcs.renew_lease.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @streaming_service_stub.call_rpc :renew_lease, 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 - - ## - # RleaseLease releases a lease. - # - # @overload release_lease(request, options = nil) - # Pass arguments to `release_lease` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::ReleaseLeaseRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::ReleaseLeaseRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload release_lease(id: nil, series: nil, owner: nil) - # Pass arguments to `release_lease` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param id [::String] - # Lease id. - # @param series [::String] - # Series name. - # @param owner [::String] - # Lease owner. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::VisionAI::V1::ReleaseLeaseResponse] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::VisionAI::V1::ReleaseLeaseResponse] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::StreamingService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::ReleaseLeaseRequest.new - # - # # Call the release_lease method. - # result = client.release_lease request - # - # # The returned object is of type Google::Cloud::VisionAI::V1::ReleaseLeaseResponse. - # p result - # - def release_lease request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::ReleaseLeaseRequest - - # Converts hash 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.release_lease.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::VisionAI::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.series - header_params["series"] = request.series - 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.release_lease.timeout, - metadata: metadata, - retry_policy: @config.rpcs.release_lease.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @streaming_service_stub.call_rpc :release_lease, 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 StreamingService API. - # - # This class represents the configuration for StreamingService, - # 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::VisionAI::V1::StreamingService::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 - # # send_packets to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::VisionAI::V1::StreamingService::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.send_packets.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::VisionAI::V1::StreamingService::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.send_packets.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::VisionAI::V1::StreamingService::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 = "visionai.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 StreamingService 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 `send_packets` - # @return [::Gapic::Config::Method] - # - attr_reader :send_packets - ## - # RPC-specific configuration for `receive_packets` - # @return [::Gapic::Config::Method] - # - attr_reader :receive_packets - ## - # RPC-specific configuration for `receive_events` - # @return [::Gapic::Config::Method] - # - attr_reader :receive_events - ## - # RPC-specific configuration for `acquire_lease` - # @return [::Gapic::Config::Method] - # - attr_reader :acquire_lease - ## - # RPC-specific configuration for `renew_lease` - # @return [::Gapic::Config::Method] - # - attr_reader :renew_lease - ## - # RPC-specific configuration for `release_lease` - # @return [::Gapic::Config::Method] - # - attr_reader :release_lease - - # @private - def initialize parent_rpcs = nil - send_packets_config = parent_rpcs.send_packets if parent_rpcs.respond_to? :send_packets - @send_packets = ::Gapic::Config::Method.new send_packets_config - receive_packets_config = parent_rpcs.receive_packets if parent_rpcs.respond_to? :receive_packets - @receive_packets = ::Gapic::Config::Method.new receive_packets_config - receive_events_config = parent_rpcs.receive_events if parent_rpcs.respond_to? :receive_events - @receive_events = ::Gapic::Config::Method.new receive_events_config - acquire_lease_config = parent_rpcs.acquire_lease if parent_rpcs.respond_to? :acquire_lease - @acquire_lease = ::Gapic::Config::Method.new acquire_lease_config - renew_lease_config = parent_rpcs.renew_lease if parent_rpcs.respond_to? :renew_lease - @renew_lease = ::Gapic::Config::Method.new renew_lease_config - release_lease_config = parent_rpcs.release_lease if parent_rpcs.respond_to? :release_lease - @release_lease = ::Gapic::Config::Method.new release_lease_config - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/streaming_service/credentials.rb b/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/streaming_service/credentials.rb deleted file mode 100644 index d185c1307983..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/streaming_service/credentials.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! - -require "googleauth" - -module Google - module Cloud - module VisionAI - module V1 - module StreamingService - # Credentials for the StreamingService API. - class Credentials < ::Google::Auth::Credentials - self.scope = [ - "https://www.googleapis.com/auth/cloud-platform" - ] - self.env_vars = [ - "GOOGLE_CLOUD_CREDENTIALS", - "GOOGLE_CLOUD_KEYFILE", - "GCLOUD_KEYFILE", - "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-vision_ai-v1/lib/google/cloud/vision_ai/v1/streaming_service/paths.rb b/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/streaming_service/paths.rb deleted file mode 100644 index d08b2855cae9..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/streaming_service/paths.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! - - -module Google - module Cloud - module VisionAI - module V1 - module StreamingService - # Path helper methods for the StreamingService API. - module Paths - ## - # Create a fully-qualified Series resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/clusters/{cluster}/series/{series}` - # - # @param project [String] - # @param location [String] - # @param cluster [String] - # @param series [String] - # - # @return [::String] - def series_path project:, location:, cluster:, series: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "cluster cannot contain /" if cluster.to_s.include? "/" - - "projects/#{project}/locations/#{location}/clusters/#{cluster}/series/#{series}" - end - - extend self - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/streaming_service/rest.rb b/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/streaming_service/rest.rb deleted file mode 100644 index 42521a060a3d..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/streaming_service/rest.rb +++ /dev/null @@ -1,53 +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/vision_ai/v1/version" -require "google/cloud/vision_ai/v1/bindings_override" - -require "google/cloud/vision_ai/v1/streaming_service/credentials" -require "google/cloud/vision_ai/v1/streaming_service/paths" -require "google/cloud/vision_ai/v1/streaming_service/rest/client" - -module Google - module Cloud - module VisionAI - module V1 - ## - # Streaming service for receiving and sending packets. - # - # To load this service and instantiate a REST client: - # - # require "google/cloud/vision_ai/v1/streaming_service/rest" - # client = ::Google::Cloud::VisionAI::V1::StreamingService::Rest::Client.new - # - module StreamingService - # Client for the REST transport - module Rest - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "rest", "helpers.rb" -require "google/cloud/vision_ai/v1/streaming_service/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/streaming_service/rest/client.rb b/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/streaming_service/rest/client.rb deleted file mode 100644 index 6bae7f94456c..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/streaming_service/rest/client.rb +++ /dev/null @@ -1,650 +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/visionai/v1/streaming_service_pb" -require "google/cloud/vision_ai/v1/streaming_service/rest/service_stub" -require "google/cloud/location/rest" -require "google/iam/v1/rest" - -module Google - module Cloud - module VisionAI - module V1 - module StreamingService - module Rest - ## - # REST client for the StreamingService service. - # - # Streaming service for receiving and sending packets. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "visionai.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :streaming_service_stub - - ## - # Configure the StreamingService Client class. - # - # See {::Google::Cloud::VisionAI::V1::StreamingService::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all StreamingService clients - # ::Google::Cloud::VisionAI::V1::StreamingService::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", "VisionAI", "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 - end - yield @configure if block_given? - @configure - end - - ## - # Configure the StreamingService 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::VisionAI::V1::StreamingService::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 - @streaming_service_stub.universe_domain - end - - ## - # Create a new StreamingService REST client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::VisionAI::V1::StreamingService::Rest::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::VisionAI::V1::StreamingService::Rest::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the StreamingService 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 - - @streaming_service_stub = ::Google::Cloud::VisionAI::V1::StreamingService::Rest::ServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials, - logger: @config.logger - ) - - @streaming_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 = @streaming_service_stub.endpoint - config.universe_domain = @streaming_service_stub.universe_domain - config.bindings_override = @config.bindings_override - config.logger = @streaming_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 = @streaming_service_stub.endpoint - config.universe_domain = @streaming_service_stub.universe_domain - config.logger = @streaming_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 - @streaming_service_stub.logger - end - - # Service calls - - ## - # AcquireLease acquires a lease. - # - # @overload acquire_lease(request, options = nil) - # Pass arguments to `acquire_lease` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::AcquireLeaseRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::AcquireLeaseRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload acquire_lease(series: nil, owner: nil, term: nil, lease_type: nil) - # Pass arguments to `acquire_lease` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param series [::String] - # The series name. - # @param owner [::String] - # The owner name. - # @param term [::Google::Protobuf::Duration, ::Hash] - # The lease term. - # @param lease_type [::Google::Cloud::VisionAI::V1::LeaseType] - # The lease type. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::VisionAI::V1::Lease] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::VisionAI::V1::Lease] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::StreamingService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::AcquireLeaseRequest.new - # - # # Call the acquire_lease method. - # result = client.acquire_lease request - # - # # The returned object is of type Google::Cloud::VisionAI::V1::Lease. - # p result - # - def acquire_lease request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::AcquireLeaseRequest - - # Converts hash 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.acquire_lease.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::VisionAI::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.acquire_lease.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.acquire_lease.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @streaming_service_stub.acquire_lease 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 - - ## - # RenewLease renews a lease. - # - # @overload renew_lease(request, options = nil) - # Pass arguments to `renew_lease` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::RenewLeaseRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::RenewLeaseRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload renew_lease(id: nil, series: nil, owner: nil, term: nil) - # Pass arguments to `renew_lease` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param id [::String] - # Lease id. - # @param series [::String] - # Series name. - # @param owner [::String] - # Lease owner. - # @param term [::Google::Protobuf::Duration, ::Hash] - # Lease term. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::VisionAI::V1::Lease] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::VisionAI::V1::Lease] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::StreamingService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::RenewLeaseRequest.new - # - # # Call the renew_lease method. - # result = client.renew_lease request - # - # # The returned object is of type Google::Cloud::VisionAI::V1::Lease. - # p result - # - def renew_lease request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::RenewLeaseRequest - - # Converts hash 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.renew_lease.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::VisionAI::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.renew_lease.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.renew_lease.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @streaming_service_stub.renew_lease 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 - - ## - # RleaseLease releases a lease. - # - # @overload release_lease(request, options = nil) - # Pass arguments to `release_lease` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::ReleaseLeaseRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::ReleaseLeaseRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload release_lease(id: nil, series: nil, owner: nil) - # Pass arguments to `release_lease` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param id [::String] - # Lease id. - # @param series [::String] - # Series name. - # @param owner [::String] - # Lease owner. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::VisionAI::V1::ReleaseLeaseResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::VisionAI::V1::ReleaseLeaseResponse] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::StreamingService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::ReleaseLeaseRequest.new - # - # # Call the release_lease method. - # result = client.release_lease request - # - # # The returned object is of type Google::Cloud::VisionAI::V1::ReleaseLeaseResponse. - # p result - # - def release_lease request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::ReleaseLeaseRequest - - # Converts hash 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.release_lease.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::VisionAI::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.release_lease.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.release_lease.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @streaming_service_stub.release_lease 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 StreamingService REST API. - # - # This class represents the configuration for StreamingService 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::VisionAI::V1::StreamingService::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 - # # acquire_lease to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::VisionAI::V1::StreamingService::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.acquire_lease.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::VisionAI::V1::StreamingService::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.acquire_lease.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 = "visionai.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 StreamingService 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 `acquire_lease` - # @return [::Gapic::Config::Method] - # - attr_reader :acquire_lease - ## - # RPC-specific configuration for `renew_lease` - # @return [::Gapic::Config::Method] - # - attr_reader :renew_lease - ## - # RPC-specific configuration for `release_lease` - # @return [::Gapic::Config::Method] - # - attr_reader :release_lease - - # @private - def initialize parent_rpcs = nil - acquire_lease_config = parent_rpcs.acquire_lease if parent_rpcs.respond_to? :acquire_lease - @acquire_lease = ::Gapic::Config::Method.new acquire_lease_config - renew_lease_config = parent_rpcs.renew_lease if parent_rpcs.respond_to? :renew_lease - @renew_lease = ::Gapic::Config::Method.new renew_lease_config - release_lease_config = parent_rpcs.release_lease if parent_rpcs.respond_to? :release_lease - @release_lease = ::Gapic::Config::Method.new release_lease_config - - yield self if block_given? - end - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/streaming_service/rest/service_stub.rb b/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/streaming_service/rest/service_stub.rb deleted file mode 100644 index cfebca262a77..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/streaming_service/rest/service_stub.rb +++ /dev/null @@ -1,267 +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/visionai/v1/streaming_service_pb" - -module Google - module Cloud - module VisionAI - module V1 - module StreamingService - module Rest - ## - # REST service stub for the StreamingService 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 acquire_lease REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::AcquireLeaseRequest] - # 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::VisionAI::V1::Lease] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::VisionAI::V1::Lease] - # A result object deserialized from the server's reply - def acquire_lease request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_acquire_lease_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: "acquire_lease", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::VisionAI::V1::Lease.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the renew_lease REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::RenewLeaseRequest] - # 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::VisionAI::V1::Lease] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::VisionAI::V1::Lease] - # A result object deserialized from the server's reply - def renew_lease request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_renew_lease_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: "renew_lease", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::VisionAI::V1::Lease.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the release_lease REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::ReleaseLeaseRequest] - # 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::VisionAI::V1::ReleaseLeaseResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::VisionAI::V1::ReleaseLeaseResponse] - # A result object deserialized from the server's reply - def release_lease request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_release_lease_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: "release_lease", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::VisionAI::V1::ReleaseLeaseResponse.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 acquire_lease REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::AcquireLeaseRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_acquire_lease_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{series}:acquireLease", - body: "*", - matches: [ - ["series", %r{^projects/[^/]+/locations/[^/]+/clusters/[^/]+/series/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the renew_lease REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::RenewLeaseRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_renew_lease_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{series}:renewLease", - body: "*", - matches: [ - ["series", %r{^projects/[^/]+/locations/[^/]+/clusters/[^/]+/series/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the release_lease REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::ReleaseLeaseRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_release_lease_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{series}:releaseLease", - body: "*", - matches: [ - ["series", %r{^projects/[^/]+/locations/[^/]+/clusters/[^/]+/series/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/streams_service.rb b/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/streams_service.rb deleted file mode 100644 index c230200dac0f..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/streams_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/vision_ai/v1/version" - -require "google/cloud/vision_ai/v1/streams_service/credentials" -require "google/cloud/vision_ai/v1/streams_service/paths" -require "google/cloud/vision_ai/v1/streams_service/operations" -require "google/cloud/vision_ai/v1/streams_service/client" -require "google/cloud/vision_ai/v1/streams_service/rest" - -module Google - module Cloud - module VisionAI - module V1 - ## - # Service describing handlers for resources. - # Vision API and Vision AI API are two independent APIs developed by the same - # team. Vision API is for people to annotate their image while Vision AI is an - # e2e solution for customer to build their own computer vision application. - # - # @example Load this service and instantiate a gRPC client - # - # require "google/cloud/vision_ai/v1/streams_service" - # client = ::Google::Cloud::VisionAI::V1::StreamsService::Client.new - # - # @example Load this service and instantiate a REST client - # - # require "google/cloud/vision_ai/v1/streams_service/rest" - # client = ::Google::Cloud::VisionAI::V1::StreamsService::Rest::Client.new - # - module StreamsService - end - end - end - end -end - -helper_path = ::File.join __dir__, "streams_service", "helpers.rb" -require "google/cloud/vision_ai/v1/streams_service/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/streams_service/client.rb b/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/streams_service/client.rb deleted file mode 100644 index b9545358fa30..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/streams_service/client.rb +++ /dev/null @@ -1,2978 +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/visionai/v1/streams_service_pb" -require "google/cloud/location" -require "google/iam/v1" - -module Google - module Cloud - module VisionAI - module V1 - module StreamsService - ## - # Client for the StreamsService service. - # - # Service describing handlers for resources. - # Vision API and Vision AI API are two independent APIs developed by the same - # team. Vision API is for people to annotate their image while Vision AI is an - # e2e solution for customer to build their own computer vision application. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "visionai.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :streams_service_stub - - ## - # Configure the StreamsService Client class. - # - # See {::Google::Cloud::VisionAI::V1::StreamsService::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all StreamsService clients - # ::Google::Cloud::VisionAI::V1::StreamsService::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", "VisionAI", "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 - end - yield @configure if block_given? - @configure - end - - ## - # Configure the StreamsService 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::VisionAI::V1::StreamsService::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 - @streams_service_stub.universe_domain - end - - ## - # Create a new StreamsService client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::VisionAI::V1::StreamsService::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::VisionAI::V1::StreamsService::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the StreamsService 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/visionai/v1/streams_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 - - @streams_service_stub = ::Gapic::ServiceStub.new( - ::Google::Cloud::VisionAI::V1::StreamsService::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 - ) - - @streams_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 = @streams_service_stub.endpoint - config.universe_domain = @streams_service_stub.universe_domain - config.logger = @streams_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 = @streams_service_stub.endpoint - config.universe_domain = @streams_service_stub.universe_domain - config.logger = @streams_service_stub.logger if config.respond_to? :logger= - end - end - - ## - # Get the associated client for long-running operations. - # - # @return [::Google::Cloud::VisionAI::V1::StreamsService::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 - @streams_service_stub.logger - end - - # Service calls - - ## - # Lists Clusters in a given project and location. - # - # @overload list_clusters(request, options = nil) - # Pass arguments to `list_clusters` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::ListClustersRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::ListClustersRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_clusters(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) - # Pass arguments to `list_clusters` via keyword arguments. Note that at - # least one keyword argument is 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. Parent value for ListClustersRequest. - # @param page_size [::Integer] - # Requested page size. Server may return fewer items than requested. - # If unspecified, server will pick an appropriate default. - # @param page_token [::String] - # A token identifying a page of results the server should return. - # @param filter [::String] - # Filtering results. - # @param order_by [::String] - # Hint for how to order the results. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::VisionAI::V1::Cluster>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::VisionAI::V1::Cluster>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::StreamsService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::ListClustersRequest.new - # - # # Call the list_clusters method. - # result = client.list_clusters 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::VisionAI::V1::Cluster. - # p item - # end - # - def list_clusters request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::ListClustersRequest - - # Converts hash 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_clusters.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::VisionAI::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_clusters.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_clusters.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @streams_service_stub.call_rpc :list_clusters, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @streams_service_stub, :list_clusters, 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 - - ## - # Gets details of a single Cluster. - # - # @overload get_cluster(request, options = nil) - # Pass arguments to `get_cluster` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::GetClusterRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::GetClusterRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_cluster(name: nil) - # Pass arguments to `get_cluster` via keyword arguments. Note that at - # least one keyword argument is 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 resource. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::VisionAI::V1::Cluster] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::VisionAI::V1::Cluster] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::StreamsService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::GetClusterRequest.new - # - # # Call the get_cluster method. - # result = client.get_cluster request - # - # # The returned object is of type Google::Cloud::VisionAI::V1::Cluster. - # p result - # - def get_cluster request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::GetClusterRequest - - # Converts hash 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_cluster.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::VisionAI::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_cluster.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_cluster.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @streams_service_stub.call_rpc :get_cluster, 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 Cluster in a given project and location. - # - # @overload create_cluster(request, options = nil) - # Pass arguments to `create_cluster` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::CreateClusterRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::CreateClusterRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_cluster(parent: nil, cluster_id: nil, cluster: nil, request_id: nil) - # Pass arguments to `create_cluster` via keyword arguments. Note that at - # least one keyword argument is 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. Value for parent. - # @param cluster_id [::String] - # Required. Id of the requesting object. - # @param cluster [::Google::Cloud::VisionAI::V1::Cluster, ::Hash] - # Required. The resource being created. - # @param request_id [::String] - # Optional. An optional request ID to identify requests. Specify a unique - # request ID so that if you must retry your request, the server will know to - # ignore the request if it has already been completed. The server will - # guarantee that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request ID, - # the server can check if original operation with the same request ID was - # received, and if so, will ignore the second request. This prevents clients - # from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # - # @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/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::StreamsService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::CreateClusterRequest.new - # - # # Call the create_cluster method. - # result = client.create_cluster 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_cluster request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::CreateClusterRequest - - # Converts hash 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_cluster.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::VisionAI::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_cluster.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_cluster.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @streams_service_stub.call_rpc :create_cluster, 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 - - ## - # Updates the parameters of a single Cluster. - # - # @overload update_cluster(request, options = nil) - # Pass arguments to `update_cluster` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::UpdateClusterRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::UpdateClusterRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_cluster(update_mask: nil, cluster: nil, request_id: nil) - # Pass arguments to `update_cluster` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Required. Field mask is used to specify the fields to be overwritten in the - # Cluster resource by the update. - # The fields specified in the update_mask are relative to the resource, not - # the full request. A field will be overwritten if it is in the mask. If the - # user does not provide a mask then all fields will be overwritten. - # @param cluster [::Google::Cloud::VisionAI::V1::Cluster, ::Hash] - # Required. The resource being updated - # @param request_id [::String] - # Optional. An optional request ID to identify requests. Specify a unique - # request ID so that if you must retry your request, the server will know to - # ignore the request if it has already been completed. The server will - # guarantee that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request ID, - # the server can check if original operation with the same request ID was - # received, and if so, will ignore the second request. This prevents clients - # from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # - # @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/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::StreamsService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::UpdateClusterRequest.new - # - # # Call the update_cluster method. - # result = client.update_cluster 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 update_cluster request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::UpdateClusterRequest - - # Converts hash 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_cluster.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::VisionAI::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.cluster&.name - header_params["cluster.name"] = request.cluster.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_cluster.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_cluster.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @streams_service_stub.call_rpc :update_cluster, 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 single Cluster. - # - # @overload delete_cluster(request, options = nil) - # Pass arguments to `delete_cluster` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::DeleteClusterRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::DeleteClusterRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_cluster(name: nil, request_id: nil) - # Pass arguments to `delete_cluster` via keyword arguments. Note that at - # least one keyword argument is 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 resource - # @param request_id [::String] - # Optional. An optional request ID to identify requests. Specify a unique - # request ID so that if you must retry your request, the server will know to - # ignore the request if it has already been completed. The server will - # guarantee that for at least 60 minutes after the first request. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request ID, - # the server can check if original operation with the same request ID was - # received, and if so, will ignore the second request. This prevents clients - # from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # - # @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/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::StreamsService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::DeleteClusterRequest.new - # - # # Call the delete_cluster method. - # result = client.delete_cluster 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_cluster request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::DeleteClusterRequest - - # Converts hash 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_cluster.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::VisionAI::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_cluster.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_cluster.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @streams_service_stub.call_rpc :delete_cluster, 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 - - ## - # Lists Streams in a given project and location. - # - # @overload list_streams(request, options = nil) - # Pass arguments to `list_streams` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::ListStreamsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::ListStreamsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_streams(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) - # Pass arguments to `list_streams` via keyword arguments. Note that at - # least one keyword argument is 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. Parent value for ListStreamsRequest. - # @param page_size [::Integer] - # Requested page size. Server may return fewer items than requested. - # If unspecified, server will pick an appropriate default. - # @param page_token [::String] - # A token identifying a page of results the server should return. - # @param filter [::String] - # Filtering results. - # @param order_by [::String] - # Hint for how to order the results. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::VisionAI::V1::Stream>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::VisionAI::V1::Stream>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::StreamsService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::ListStreamsRequest.new - # - # # Call the list_streams method. - # result = client.list_streams 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::VisionAI::V1::Stream. - # p item - # end - # - def list_streams request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::ListStreamsRequest - - # Converts hash 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_streams.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::VisionAI::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_streams.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_streams.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @streams_service_stub.call_rpc :list_streams, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @streams_service_stub, :list_streams, 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 - - ## - # Gets details of a single Stream. - # - # @overload get_stream(request, options = nil) - # Pass arguments to `get_stream` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::GetStreamRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::GetStreamRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_stream(name: nil) - # Pass arguments to `get_stream` via keyword arguments. Note that at - # least one keyword argument is 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 resource. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::VisionAI::V1::Stream] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::VisionAI::V1::Stream] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::StreamsService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::GetStreamRequest.new - # - # # Call the get_stream method. - # result = client.get_stream request - # - # # The returned object is of type Google::Cloud::VisionAI::V1::Stream. - # p result - # - def get_stream request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::GetStreamRequest - - # Converts hash 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_stream.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::VisionAI::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_stream.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_stream.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @streams_service_stub.call_rpc :get_stream, 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 Stream in a given project and location. - # - # @overload create_stream(request, options = nil) - # Pass arguments to `create_stream` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::CreateStreamRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::CreateStreamRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_stream(parent: nil, stream_id: nil, stream: nil, request_id: nil) - # Pass arguments to `create_stream` via keyword arguments. Note that at - # least one keyword argument is 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. Value for parent. - # @param stream_id [::String] - # Required. Id of the requesting object. - # @param stream [::Google::Cloud::VisionAI::V1::Stream, ::Hash] - # Required. The resource being created. - # @param request_id [::String] - # Optional. An optional request ID to identify requests. Specify a unique - # request ID so that if you must retry your request, the server will know to - # ignore the request if it has already been completed. The server will - # guarantee that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request ID, - # the server can check if original operation with the same request ID was - # received, and if so, will ignore the second request. This prevents clients - # from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # - # @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/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::StreamsService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::CreateStreamRequest.new - # - # # Call the create_stream method. - # result = client.create_stream 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_stream request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::CreateStreamRequest - - # Converts hash 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_stream.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::VisionAI::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_stream.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_stream.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @streams_service_stub.call_rpc :create_stream, 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 - - ## - # Updates the parameters of a single Stream. - # - # @overload update_stream(request, options = nil) - # Pass arguments to `update_stream` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::UpdateStreamRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::UpdateStreamRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_stream(update_mask: nil, stream: nil, request_id: nil) - # Pass arguments to `update_stream` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Required. Field mask is used to specify the fields to be overwritten in the - # Stream resource by the update. - # The fields specified in the update_mask are relative to the resource, not - # the full request. A field will be overwritten if it is in the mask. If the - # user does not provide a mask then all fields will be overwritten. - # @param stream [::Google::Cloud::VisionAI::V1::Stream, ::Hash] - # Required. The resource being updated. - # @param request_id [::String] - # Optional. An optional request ID to identify requests. Specify a unique - # request ID so that if you must retry your request, the server will know to - # ignore the request if it has already been completed. The server will - # guarantee that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request ID, - # the server can check if original operation with the same request ID was - # received, and if so, will ignore the second request. This prevents clients - # from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # - # @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/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::StreamsService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::UpdateStreamRequest.new - # - # # Call the update_stream method. - # result = client.update_stream 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 update_stream request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::UpdateStreamRequest - - # Converts hash 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_stream.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::VisionAI::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.stream&.name - header_params["stream.name"] = request.stream.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_stream.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_stream.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @streams_service_stub.call_rpc :update_stream, 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 single Stream. - # - # @overload delete_stream(request, options = nil) - # Pass arguments to `delete_stream` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::DeleteStreamRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::DeleteStreamRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_stream(name: nil, request_id: nil) - # Pass arguments to `delete_stream` via keyword arguments. Note that at - # least one keyword argument is 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 resource. - # @param request_id [::String] - # Optional. An optional request ID to identify requests. Specify a unique - # request ID so that if you must retry your request, the server will know to - # ignore the request if it has already been completed. The server will - # guarantee that for at least 60 minutes after the first request. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request ID, - # the server can check if original operation with the same request ID was - # received, and if so, will ignore the second request. This prevents clients - # from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # - # @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/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::StreamsService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::DeleteStreamRequest.new - # - # # Call the delete_stream method. - # result = client.delete_stream 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_stream request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::DeleteStreamRequest - - # Converts hash 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_stream.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::VisionAI::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_stream.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_stream.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @streams_service_stub.call_rpc :delete_stream, 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 - - ## - # Gets the thumbnail (image snapshot) of a single Stream. - # - # @overload get_stream_thumbnail(request, options = nil) - # Pass arguments to `get_stream_thumbnail` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::GetStreamThumbnailRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::GetStreamThumbnailRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_stream_thumbnail(stream: nil, gcs_object_name: nil, event: nil, request_id: nil) - # Pass arguments to `get_stream_thumbnail` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param stream [::String] - # Required. The name of the stream for to get the thumbnail from. - # @param gcs_object_name [::String] - # Required. The name of the GCS object to store the thumbnail image. - # @param event [::String] - # Optional. The name of the event. If unspecified, the thumbnail will be - # retrieved from the latest event. - # @param request_id [::String] - # Optional. An optional request ID to identify the requests. Specify a unique - # request ID so that if you must retry your request, the server will know to - # ignore the request if it has already been completed. The server will - # guarantee that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request ID, - # the server can check if original operation with the same request ID was - # received, and if so, will ignore the second request. This prevents clients - # from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # - # @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/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::StreamsService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::GetStreamThumbnailRequest.new - # - # # Call the get_stream_thumbnail method. - # result = client.get_stream_thumbnail 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_stream_thumbnail request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::GetStreamThumbnailRequest - - # Converts hash 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_stream_thumbnail.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::VisionAI::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.stream - header_params["stream"] = request.stream - 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_stream_thumbnail.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_stream_thumbnail.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @streams_service_stub.call_rpc :get_stream_thumbnail, 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 - - ## - # Generate the JWT auth token required to get the stream HLS contents. - # - # @overload generate_stream_hls_token(request, options = nil) - # Pass arguments to `generate_stream_hls_token` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::GenerateStreamHlsTokenRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::GenerateStreamHlsTokenRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_stream_hls_token(stream: nil) - # Pass arguments to `generate_stream_hls_token` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param stream [::String] - # Required. The name of the stream. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::VisionAI::V1::GenerateStreamHlsTokenResponse] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::VisionAI::V1::GenerateStreamHlsTokenResponse] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::StreamsService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::GenerateStreamHlsTokenRequest.new - # - # # Call the generate_stream_hls_token method. - # result = client.generate_stream_hls_token request - # - # # The returned object is of type Google::Cloud::VisionAI::V1::GenerateStreamHlsTokenResponse. - # p result - # - def generate_stream_hls_token request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::GenerateStreamHlsTokenRequest - - # Converts hash 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_stream_hls_token.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::VisionAI::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.stream - header_params["stream"] = request.stream - 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_stream_hls_token.timeout, - metadata: metadata, - retry_policy: @config.rpcs.generate_stream_hls_token.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @streams_service_stub.call_rpc :generate_stream_hls_token, 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 Events in a given project and location. - # - # @overload list_events(request, options = nil) - # Pass arguments to `list_events` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::ListEventsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::ListEventsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_events(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) - # Pass arguments to `list_events` via keyword arguments. Note that at - # least one keyword argument is 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. Parent value for ListEventsRequest. - # @param page_size [::Integer] - # Requested page size. Server may return fewer items than requested. - # If unspecified, server will pick an appropriate default. - # @param page_token [::String] - # A token identifying a page of results the server should return. - # @param filter [::String] - # Filtering results. - # @param order_by [::String] - # Hint for how to order the results. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::VisionAI::V1::Event>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::VisionAI::V1::Event>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::StreamsService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::ListEventsRequest.new - # - # # Call the list_events method. - # result = client.list_events 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::VisionAI::V1::Event. - # p item - # end - # - def list_events request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::ListEventsRequest - - # Converts hash 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_events.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::VisionAI::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_events.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_events.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @streams_service_stub.call_rpc :list_events, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @streams_service_stub, :list_events, 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 - - ## - # Gets details of a single Event. - # - # @overload get_event(request, options = nil) - # Pass arguments to `get_event` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::GetEventRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::GetEventRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_event(name: nil) - # Pass arguments to `get_event` via keyword arguments. Note that at - # least one keyword argument is 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 resource. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::VisionAI::V1::Event] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::VisionAI::V1::Event] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::StreamsService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::GetEventRequest.new - # - # # Call the get_event method. - # result = client.get_event request - # - # # The returned object is of type Google::Cloud::VisionAI::V1::Event. - # p result - # - def get_event request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::GetEventRequest - - # Converts hash 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_event.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::VisionAI::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_event.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_event.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @streams_service_stub.call_rpc :get_event, 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 Event in a given project and location. - # - # @overload create_event(request, options = nil) - # Pass arguments to `create_event` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::CreateEventRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::CreateEventRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_event(parent: nil, event_id: nil, event: nil, request_id: nil) - # Pass arguments to `create_event` via keyword arguments. Note that at - # least one keyword argument is 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. Value for parent. - # @param event_id [::String] - # Required. Id of the requesting object. - # @param event [::Google::Cloud::VisionAI::V1::Event, ::Hash] - # Required. The resource being created. - # @param request_id [::String] - # Optional. An optional request ID to identify requests. Specify a unique - # request ID so that if you must retry your request, the server will know to - # ignore the request if it has already been completed. The server will - # guarantee that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request ID, - # the server can check if original operation with the same request ID was - # received, and if so, will ignore the second request. This prevents clients - # from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # - # @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/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::StreamsService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::CreateEventRequest.new - # - # # Call the create_event method. - # result = client.create_event 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_event request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::CreateEventRequest - - # Converts hash 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_event.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::VisionAI::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_event.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_event.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @streams_service_stub.call_rpc :create_event, 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 - - ## - # Updates the parameters of a single Event. - # - # @overload update_event(request, options = nil) - # Pass arguments to `update_event` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::UpdateEventRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::UpdateEventRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_event(update_mask: nil, event: nil, request_id: nil) - # Pass arguments to `update_event` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Required. Field mask is used to specify the fields to be overwritten in the - # Event resource by the update. - # The fields specified in the update_mask are relative to the resource, not - # the full request. A field will be overwritten if it is in the mask. If the - # user does not provide a mask then all fields will be overwritten. - # @param event [::Google::Cloud::VisionAI::V1::Event, ::Hash] - # Required. The resource being updated. - # @param request_id [::String] - # Optional. An optional request ID to identify requests. Specify a unique - # request ID so that if you must retry your request, the server will know to - # ignore the request if it has already been completed. The server will - # guarantee that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request ID, - # the server can check if original operation with the same request ID was - # received, and if so, will ignore the second request. This prevents clients - # from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # - # @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/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::StreamsService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::UpdateEventRequest.new - # - # # Call the update_event method. - # result = client.update_event 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 update_event request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::UpdateEventRequest - - # Converts hash 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_event.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::VisionAI::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.event&.name - header_params["event.name"] = request.event.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_event.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_event.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @streams_service_stub.call_rpc :update_event, 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 single Event. - # - # @overload delete_event(request, options = nil) - # Pass arguments to `delete_event` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::DeleteEventRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::DeleteEventRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_event(name: nil, request_id: nil) - # Pass arguments to `delete_event` via keyword arguments. Note that at - # least one keyword argument is 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 resource. - # @param request_id [::String] - # Optional. An optional request ID to identify requests. Specify a unique - # request ID so that if you must retry your request, the server will know to - # ignore the request if it has already been completed. The server will - # guarantee that for at least 60 minutes after the first request. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request ID, - # the server can check if original operation with the same request ID was - # received, and if so, will ignore the second request. This prevents clients - # from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # - # @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/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::StreamsService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::DeleteEventRequest.new - # - # # Call the delete_event method. - # result = client.delete_event 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_event request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::DeleteEventRequest - - # Converts hash 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_event.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::VisionAI::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_event.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_event.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @streams_service_stub.call_rpc :delete_event, 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 - - ## - # Lists Series in a given project and location. - # - # @overload list_series(request, options = nil) - # Pass arguments to `list_series` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::ListSeriesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::ListSeriesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_series(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) - # Pass arguments to `list_series` via keyword arguments. Note that at - # least one keyword argument is 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. Parent value for ListSeriesRequest. - # @param page_size [::Integer] - # Requested page size. Server may return fewer items than requested. - # If unspecified, server will pick an appropriate default. - # @param page_token [::String] - # A token identifying a page of results the server should return. - # @param filter [::String] - # Filtering results. - # @param order_by [::String] - # Hint for how to order the results. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::VisionAI::V1::Series>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::VisionAI::V1::Series>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::StreamsService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::ListSeriesRequest.new - # - # # Call the list_series method. - # result = client.list_series 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::VisionAI::V1::Series. - # p item - # end - # - def list_series request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::ListSeriesRequest - - # Converts hash 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_series.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::VisionAI::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_series.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_series.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @streams_service_stub.call_rpc :list_series, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @streams_service_stub, :list_series, 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 - - ## - # Gets details of a single Series. - # - # @overload get_series(request, options = nil) - # Pass arguments to `get_series` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::GetSeriesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::GetSeriesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_series(name: nil) - # Pass arguments to `get_series` via keyword arguments. Note that at - # least one keyword argument is 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 resource. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::VisionAI::V1::Series] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::VisionAI::V1::Series] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::StreamsService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::GetSeriesRequest.new - # - # # Call the get_series method. - # result = client.get_series request - # - # # The returned object is of type Google::Cloud::VisionAI::V1::Series. - # p result - # - def get_series request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::GetSeriesRequest - - # Converts hash 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_series.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::VisionAI::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_series.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_series.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @streams_service_stub.call_rpc :get_series, 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 Series in a given project and location. - # - # @overload create_series(request, options = nil) - # Pass arguments to `create_series` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::CreateSeriesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::CreateSeriesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_series(parent: nil, series_id: nil, series: nil, request_id: nil) - # Pass arguments to `create_series` via keyword arguments. Note that at - # least one keyword argument is 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. Value for parent. - # @param series_id [::String] - # Required. Id of the requesting object. - # @param series [::Google::Cloud::VisionAI::V1::Series, ::Hash] - # Required. The resource being created. - # @param request_id [::String] - # Optional. An optional request ID to identify requests. Specify a unique - # request ID so that if you must retry your request, the server will know to - # ignore the request if it has already been completed. The server will - # guarantee that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request ID, - # the server can check if original operation with the same request ID was - # received, and if so, will ignore the second request. This prevents clients - # from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # - # @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/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::StreamsService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::CreateSeriesRequest.new - # - # # Call the create_series method. - # result = client.create_series 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_series request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::CreateSeriesRequest - - # Converts hash 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_series.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::VisionAI::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_series.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_series.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @streams_service_stub.call_rpc :create_series, 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 - - ## - # Updates the parameters of a single Event. - # - # @overload update_series(request, options = nil) - # Pass arguments to `update_series` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::UpdateSeriesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::UpdateSeriesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_series(update_mask: nil, series: nil, request_id: nil) - # Pass arguments to `update_series` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Required. Field mask is used to specify the fields to be overwritten in the - # Series resource by the update. The fields specified in the update_mask are - # relative to the resource, not the full request. A field will be overwritten - # if it is in the mask. If the user does not provide a mask then all fields - # will be overwritten. - # @param series [::Google::Cloud::VisionAI::V1::Series, ::Hash] - # Required. The resource being updated - # @param request_id [::String] - # Optional. An optional request ID to identify requests. Specify a unique - # request ID so that if you must retry your request, the server will know to - # ignore the request if it has already been completed. The server will - # guarantee that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request ID, - # the server can check if original operation with the same request ID was - # received, and if so, will ignore the second request. This prevents clients - # from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # - # @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/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::StreamsService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::UpdateSeriesRequest.new - # - # # Call the update_series method. - # result = client.update_series 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 update_series request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::UpdateSeriesRequest - - # Converts hash 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_series.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::VisionAI::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.series&.name - header_params["series.name"] = request.series.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_series.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_series.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @streams_service_stub.call_rpc :update_series, 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 single Series. - # - # @overload delete_series(request, options = nil) - # Pass arguments to `delete_series` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::DeleteSeriesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::DeleteSeriesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_series(name: nil, request_id: nil) - # Pass arguments to `delete_series` via keyword arguments. Note that at - # least one keyword argument is 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 resource. - # @param request_id [::String] - # Optional. An optional request ID to identify requests. Specify a unique - # request ID so that if you must retry your request, the server will know to - # ignore the request if it has already been completed. The server will - # guarantee that for at least 60 minutes after the first request. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request ID, - # the server can check if original operation with the same request ID was - # received, and if so, will ignore the second request. This prevents clients - # from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # - # @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/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::StreamsService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::DeleteSeriesRequest.new - # - # # Call the delete_series method. - # result = client.delete_series 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_series request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::DeleteSeriesRequest - - # Converts hash 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_series.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::VisionAI::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_series.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_series.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @streams_service_stub.call_rpc :delete_series, 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 - - ## - # Materialize a channel. - # - # @overload materialize_channel(request, options = nil) - # Pass arguments to `materialize_channel` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::MaterializeChannelRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::MaterializeChannelRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload materialize_channel(parent: nil, channel_id: nil, channel: nil, request_id: nil) - # Pass arguments to `materialize_channel` via keyword arguments. Note that at - # least one keyword argument is 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. Value for parent. - # @param channel_id [::String] - # Required. Id of the channel. - # @param channel [::Google::Cloud::VisionAI::V1::Channel, ::Hash] - # Required. The resource being created. - # @param request_id [::String] - # Optional. An optional request ID to identify requests. Specify a unique - # request ID so that if you must retry your request, the server will know to - # ignore the request if it has already been completed. The server will - # guarantee that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request ID, - # the server can check if original operation with the same request ID was - # received, and if so, will ignore the second request. This prevents clients - # from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # - # @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/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::StreamsService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::MaterializeChannelRequest.new - # - # # Call the materialize_channel method. - # result = client.materialize_channel 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 materialize_channel request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::MaterializeChannelRequest - - # Converts hash 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.materialize_channel.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::VisionAI::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.materialize_channel.timeout, - metadata: metadata, - retry_policy: @config.rpcs.materialize_channel.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @streams_service_stub.call_rpc :materialize_channel, 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 StreamsService API. - # - # This class represents the configuration for StreamsService, - # 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::VisionAI::V1::StreamsService::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_clusters to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::VisionAI::V1::StreamsService::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_clusters.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::VisionAI::V1::StreamsService::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_clusters.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::VisionAI::V1::StreamsService::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 = "visionai.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 StreamsService 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_clusters` - # @return [::Gapic::Config::Method] - # - attr_reader :list_clusters - ## - # RPC-specific configuration for `get_cluster` - # @return [::Gapic::Config::Method] - # - attr_reader :get_cluster - ## - # RPC-specific configuration for `create_cluster` - # @return [::Gapic::Config::Method] - # - attr_reader :create_cluster - ## - # RPC-specific configuration for `update_cluster` - # @return [::Gapic::Config::Method] - # - attr_reader :update_cluster - ## - # RPC-specific configuration for `delete_cluster` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_cluster - ## - # RPC-specific configuration for `list_streams` - # @return [::Gapic::Config::Method] - # - attr_reader :list_streams - ## - # RPC-specific configuration for `get_stream` - # @return [::Gapic::Config::Method] - # - attr_reader :get_stream - ## - # RPC-specific configuration for `create_stream` - # @return [::Gapic::Config::Method] - # - attr_reader :create_stream - ## - # RPC-specific configuration for `update_stream` - # @return [::Gapic::Config::Method] - # - attr_reader :update_stream - ## - # RPC-specific configuration for `delete_stream` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_stream - ## - # RPC-specific configuration for `get_stream_thumbnail` - # @return [::Gapic::Config::Method] - # - attr_reader :get_stream_thumbnail - ## - # RPC-specific configuration for `generate_stream_hls_token` - # @return [::Gapic::Config::Method] - # - attr_reader :generate_stream_hls_token - ## - # RPC-specific configuration for `list_events` - # @return [::Gapic::Config::Method] - # - attr_reader :list_events - ## - # RPC-specific configuration for `get_event` - # @return [::Gapic::Config::Method] - # - attr_reader :get_event - ## - # RPC-specific configuration for `create_event` - # @return [::Gapic::Config::Method] - # - attr_reader :create_event - ## - # RPC-specific configuration for `update_event` - # @return [::Gapic::Config::Method] - # - attr_reader :update_event - ## - # RPC-specific configuration for `delete_event` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_event - ## - # RPC-specific configuration for `list_series` - # @return [::Gapic::Config::Method] - # - attr_reader :list_series - ## - # RPC-specific configuration for `get_series` - # @return [::Gapic::Config::Method] - # - attr_reader :get_series - ## - # RPC-specific configuration for `create_series` - # @return [::Gapic::Config::Method] - # - attr_reader :create_series - ## - # RPC-specific configuration for `update_series` - # @return [::Gapic::Config::Method] - # - attr_reader :update_series - ## - # RPC-specific configuration for `delete_series` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_series - ## - # RPC-specific configuration for `materialize_channel` - # @return [::Gapic::Config::Method] - # - attr_reader :materialize_channel - - # @private - def initialize parent_rpcs = nil - list_clusters_config = parent_rpcs.list_clusters if parent_rpcs.respond_to? :list_clusters - @list_clusters = ::Gapic::Config::Method.new list_clusters_config - get_cluster_config = parent_rpcs.get_cluster if parent_rpcs.respond_to? :get_cluster - @get_cluster = ::Gapic::Config::Method.new get_cluster_config - create_cluster_config = parent_rpcs.create_cluster if parent_rpcs.respond_to? :create_cluster - @create_cluster = ::Gapic::Config::Method.new create_cluster_config - update_cluster_config = parent_rpcs.update_cluster if parent_rpcs.respond_to? :update_cluster - @update_cluster = ::Gapic::Config::Method.new update_cluster_config - delete_cluster_config = parent_rpcs.delete_cluster if parent_rpcs.respond_to? :delete_cluster - @delete_cluster = ::Gapic::Config::Method.new delete_cluster_config - list_streams_config = parent_rpcs.list_streams if parent_rpcs.respond_to? :list_streams - @list_streams = ::Gapic::Config::Method.new list_streams_config - get_stream_config = parent_rpcs.get_stream if parent_rpcs.respond_to? :get_stream - @get_stream = ::Gapic::Config::Method.new get_stream_config - create_stream_config = parent_rpcs.create_stream if parent_rpcs.respond_to? :create_stream - @create_stream = ::Gapic::Config::Method.new create_stream_config - update_stream_config = parent_rpcs.update_stream if parent_rpcs.respond_to? :update_stream - @update_stream = ::Gapic::Config::Method.new update_stream_config - delete_stream_config = parent_rpcs.delete_stream if parent_rpcs.respond_to? :delete_stream - @delete_stream = ::Gapic::Config::Method.new delete_stream_config - get_stream_thumbnail_config = parent_rpcs.get_stream_thumbnail if parent_rpcs.respond_to? :get_stream_thumbnail - @get_stream_thumbnail = ::Gapic::Config::Method.new get_stream_thumbnail_config - generate_stream_hls_token_config = parent_rpcs.generate_stream_hls_token if parent_rpcs.respond_to? :generate_stream_hls_token - @generate_stream_hls_token = ::Gapic::Config::Method.new generate_stream_hls_token_config - list_events_config = parent_rpcs.list_events if parent_rpcs.respond_to? :list_events - @list_events = ::Gapic::Config::Method.new list_events_config - get_event_config = parent_rpcs.get_event if parent_rpcs.respond_to? :get_event - @get_event = ::Gapic::Config::Method.new get_event_config - create_event_config = parent_rpcs.create_event if parent_rpcs.respond_to? :create_event - @create_event = ::Gapic::Config::Method.new create_event_config - update_event_config = parent_rpcs.update_event if parent_rpcs.respond_to? :update_event - @update_event = ::Gapic::Config::Method.new update_event_config - delete_event_config = parent_rpcs.delete_event if parent_rpcs.respond_to? :delete_event - @delete_event = ::Gapic::Config::Method.new delete_event_config - list_series_config = parent_rpcs.list_series if parent_rpcs.respond_to? :list_series - @list_series = ::Gapic::Config::Method.new list_series_config - get_series_config = parent_rpcs.get_series if parent_rpcs.respond_to? :get_series - @get_series = ::Gapic::Config::Method.new get_series_config - create_series_config = parent_rpcs.create_series if parent_rpcs.respond_to? :create_series - @create_series = ::Gapic::Config::Method.new create_series_config - update_series_config = parent_rpcs.update_series if parent_rpcs.respond_to? :update_series - @update_series = ::Gapic::Config::Method.new update_series_config - delete_series_config = parent_rpcs.delete_series if parent_rpcs.respond_to? :delete_series - @delete_series = ::Gapic::Config::Method.new delete_series_config - materialize_channel_config = parent_rpcs.materialize_channel if parent_rpcs.respond_to? :materialize_channel - @materialize_channel = ::Gapic::Config::Method.new materialize_channel_config - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/streams_service/credentials.rb b/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/streams_service/credentials.rb deleted file mode 100644 index cb4a5a1af909..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/streams_service/credentials.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! - -require "googleauth" - -module Google - module Cloud - module VisionAI - module V1 - module StreamsService - # Credentials for the StreamsService API. - class Credentials < ::Google::Auth::Credentials - self.scope = [ - "https://www.googleapis.com/auth/cloud-platform" - ] - self.env_vars = [ - "GOOGLE_CLOUD_CREDENTIALS", - "GOOGLE_CLOUD_KEYFILE", - "GCLOUD_KEYFILE", - "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-vision_ai-v1/lib/google/cloud/vision_ai/v1/streams_service/operations.rb b/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/streams_service/operations.rb deleted file mode 100644 index 07ea7e58b0aa..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/streams_service/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 VisionAI - module V1 - module StreamsService - # Service that implements Longrunning Operations API. - class Operations - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "visionai.$UNIVERSE_DOMAIN$" - - # @private - attr_reader :operations_stub - - ## - # Configuration for the StreamsService 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 StreamsService 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::VisionAI::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::VisionAI::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::VisionAI::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::VisionAI::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::VisionAI::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 = "visionai.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-vision_ai-v1/lib/google/cloud/vision_ai/v1/streams_service/paths.rb b/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/streams_service/paths.rb deleted file mode 100644 index 5420a55803e4..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/streams_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 VisionAI - module V1 - module StreamsService - # Path helper methods for the StreamsService API. - module Paths - ## - # Create a fully-qualified Channel resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/clusters/{cluster}/channels/{channel}` - # - # @param project [String] - # @param location [String] - # @param cluster [String] - # @param channel [String] - # - # @return [::String] - def channel_path project:, location:, cluster:, channel: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "cluster cannot contain /" if cluster.to_s.include? "/" - - "projects/#{project}/locations/#{location}/clusters/#{cluster}/channels/#{channel}" - end - - ## - # Create a fully-qualified Cluster resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/clusters/{cluster}` - # - # @param project [String] - # @param location [String] - # @param cluster [String] - # - # @return [::String] - def cluster_path project:, location:, cluster: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/clusters/#{cluster}" - end - - ## - # Create a fully-qualified Event resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/clusters/{cluster}/events/{event}` - # - # @param project [String] - # @param location [String] - # @param cluster [String] - # @param event [String] - # - # @return [::String] - def event_path project:, location:, cluster:, event: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "cluster cannot contain /" if cluster.to_s.include? "/" - - "projects/#{project}/locations/#{location}/clusters/#{cluster}/events/#{event}" - 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 Series resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/clusters/{cluster}/series/{series}` - # - # @param project [String] - # @param location [String] - # @param cluster [String] - # @param series [String] - # - # @return [::String] - def series_path project:, location:, cluster:, series: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "cluster cannot contain /" if cluster.to_s.include? "/" - - "projects/#{project}/locations/#{location}/clusters/#{cluster}/series/#{series}" - end - - ## - # Create a fully-qualified Stream resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/clusters/{cluster}/streams/{stream}` - # - # @param project [String] - # @param location [String] - # @param cluster [String] - # @param stream [String] - # - # @return [::String] - def stream_path project:, location:, cluster:, stream: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "cluster cannot contain /" if cluster.to_s.include? "/" - - "projects/#{project}/locations/#{location}/clusters/#{cluster}/streams/#{stream}" - end - - extend self - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/streams_service/rest.rb b/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/streams_service/rest.rb deleted file mode 100644 index 757c90bf973e..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/streams_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/vision_ai/v1/version" -require "google/cloud/vision_ai/v1/bindings_override" - -require "google/cloud/vision_ai/v1/streams_service/credentials" -require "google/cloud/vision_ai/v1/streams_service/paths" -require "google/cloud/vision_ai/v1/streams_service/rest/operations" -require "google/cloud/vision_ai/v1/streams_service/rest/client" - -module Google - module Cloud - module VisionAI - module V1 - ## - # Service describing handlers for resources. - # Vision API and Vision AI API are two independent APIs developed by the same - # team. Vision API is for people to annotate their image while Vision AI is an - # e2e solution for customer to build their own computer vision application. - # - # To load this service and instantiate a REST client: - # - # require "google/cloud/vision_ai/v1/streams_service/rest" - # client = ::Google::Cloud::VisionAI::V1::StreamsService::Rest::Client.new - # - module StreamsService - # Client for the REST transport - module Rest - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "rest", "helpers.rb" -require "google/cloud/vision_ai/v1/streams_service/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/streams_service/rest/client.rb b/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/streams_service/rest/client.rb deleted file mode 100644 index 2afb823f4d8c..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/streams_service/rest/client.rb +++ /dev/null @@ -1,2782 +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/visionai/v1/streams_service_pb" -require "google/cloud/vision_ai/v1/streams_service/rest/service_stub" -require "google/cloud/location/rest" -require "google/iam/v1/rest" - -module Google - module Cloud - module VisionAI - module V1 - module StreamsService - module Rest - ## - # REST client for the StreamsService service. - # - # Service describing handlers for resources. - # Vision API and Vision AI API are two independent APIs developed by the same - # team. Vision API is for people to annotate their image while Vision AI is an - # e2e solution for customer to build their own computer vision application. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "visionai.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :streams_service_stub - - ## - # Configure the StreamsService Client class. - # - # See {::Google::Cloud::VisionAI::V1::StreamsService::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all StreamsService clients - # ::Google::Cloud::VisionAI::V1::StreamsService::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", "VisionAI", "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 - end - yield @configure if block_given? - @configure - end - - ## - # Configure the StreamsService 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::VisionAI::V1::StreamsService::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 - @streams_service_stub.universe_domain - end - - ## - # Create a new StreamsService REST client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::VisionAI::V1::StreamsService::Rest::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::VisionAI::V1::StreamsService::Rest::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the StreamsService 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::VisionAI::V1::StreamsService::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 - - @streams_service_stub = ::Google::Cloud::VisionAI::V1::StreamsService::Rest::ServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials, - logger: @config.logger - ) - - @streams_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 = @streams_service_stub.endpoint - config.universe_domain = @streams_service_stub.universe_domain - config.bindings_override = @config.bindings_override - config.logger = @streams_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 = @streams_service_stub.endpoint - config.universe_domain = @streams_service_stub.universe_domain - config.logger = @streams_service_stub.logger if config.respond_to? :logger= - end - end - - ## - # Get the associated client for long-running operations. - # - # @return [::Google::Cloud::VisionAI::V1::StreamsService::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 - @streams_service_stub.logger - end - - # Service calls - - ## - # Lists Clusters in a given project and location. - # - # @overload list_clusters(request, options = nil) - # Pass arguments to `list_clusters` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::ListClustersRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::ListClustersRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_clusters(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) - # Pass arguments to `list_clusters` via keyword arguments. Note that at - # least one keyword argument is 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. Parent value for ListClustersRequest. - # @param page_size [::Integer] - # Requested page size. Server may return fewer items than requested. - # If unspecified, server will pick an appropriate default. - # @param page_token [::String] - # A token identifying a page of results the server should return. - # @param filter [::String] - # Filtering results. - # @param order_by [::String] - # Hint for how to order the results. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::VisionAI::V1::Cluster>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::VisionAI::V1::Cluster>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::StreamsService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::ListClustersRequest.new - # - # # Call the list_clusters method. - # result = client.list_clusters 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::VisionAI::V1::Cluster. - # p item - # end - # - def list_clusters request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::ListClustersRequest - - # Converts hash 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_clusters.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::VisionAI::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_clusters.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_clusters.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @streams_service_stub.list_clusters request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @streams_service_stub, :list_clusters, "clusters", 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 details of a single Cluster. - # - # @overload get_cluster(request, options = nil) - # Pass arguments to `get_cluster` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::GetClusterRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::GetClusterRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_cluster(name: nil) - # Pass arguments to `get_cluster` via keyword arguments. Note that at - # least one keyword argument is 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 resource. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::VisionAI::V1::Cluster] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::VisionAI::V1::Cluster] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::StreamsService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::GetClusterRequest.new - # - # # Call the get_cluster method. - # result = client.get_cluster request - # - # # The returned object is of type Google::Cloud::VisionAI::V1::Cluster. - # p result - # - def get_cluster request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::GetClusterRequest - - # Converts hash 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_cluster.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::VisionAI::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_cluster.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_cluster.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @streams_service_stub.get_cluster 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 Cluster in a given project and location. - # - # @overload create_cluster(request, options = nil) - # Pass arguments to `create_cluster` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::CreateClusterRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::CreateClusterRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_cluster(parent: nil, cluster_id: nil, cluster: nil, request_id: nil) - # Pass arguments to `create_cluster` via keyword arguments. Note that at - # least one keyword argument is 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. Value for parent. - # @param cluster_id [::String] - # Required. Id of the requesting object. - # @param cluster [::Google::Cloud::VisionAI::V1::Cluster, ::Hash] - # Required. The resource being created. - # @param request_id [::String] - # Optional. An optional request ID to identify requests. Specify a unique - # request ID so that if you must retry your request, the server will know to - # ignore the request if it has already been completed. The server will - # guarantee that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request ID, - # the server can check if original operation with the same request ID was - # received, and if so, will ignore the second request. This prevents clients - # from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @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/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::StreamsService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::CreateClusterRequest.new - # - # # Call the create_cluster method. - # result = client.create_cluster 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_cluster request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::CreateClusterRequest - - # Converts hash 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_cluster.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::VisionAI::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_cluster.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_cluster.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @streams_service_stub.create_cluster 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 - - ## - # Updates the parameters of a single Cluster. - # - # @overload update_cluster(request, options = nil) - # Pass arguments to `update_cluster` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::UpdateClusterRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::UpdateClusterRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_cluster(update_mask: nil, cluster: nil, request_id: nil) - # Pass arguments to `update_cluster` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Required. Field mask is used to specify the fields to be overwritten in the - # Cluster resource by the update. - # The fields specified in the update_mask are relative to the resource, not - # the full request. A field will be overwritten if it is in the mask. If the - # user does not provide a mask then all fields will be overwritten. - # @param cluster [::Google::Cloud::VisionAI::V1::Cluster, ::Hash] - # Required. The resource being updated - # @param request_id [::String] - # Optional. An optional request ID to identify requests. Specify a unique - # request ID so that if you must retry your request, the server will know to - # ignore the request if it has already been completed. The server will - # guarantee that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request ID, - # the server can check if original operation with the same request ID was - # received, and if so, will ignore the second request. This prevents clients - # from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @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/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::StreamsService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::UpdateClusterRequest.new - # - # # Call the update_cluster method. - # result = client.update_cluster 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 update_cluster request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::UpdateClusterRequest - - # Converts hash 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_cluster.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::VisionAI::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_cluster.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_cluster.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @streams_service_stub.update_cluster 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 single Cluster. - # - # @overload delete_cluster(request, options = nil) - # Pass arguments to `delete_cluster` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::DeleteClusterRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::DeleteClusterRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_cluster(name: nil, request_id: nil) - # Pass arguments to `delete_cluster` via keyword arguments. Note that at - # least one keyword argument is 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 resource - # @param request_id [::String] - # Optional. An optional request ID to identify requests. Specify a unique - # request ID so that if you must retry your request, the server will know to - # ignore the request if it has already been completed. The server will - # guarantee that for at least 60 minutes after the first request. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request ID, - # the server can check if original operation with the same request ID was - # received, and if so, will ignore the second request. This prevents clients - # from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @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/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::StreamsService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::DeleteClusterRequest.new - # - # # Call the delete_cluster method. - # result = client.delete_cluster 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_cluster request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::DeleteClusterRequest - - # Converts hash 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_cluster.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::VisionAI::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_cluster.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_cluster.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @streams_service_stub.delete_cluster 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 - - ## - # Lists Streams in a given project and location. - # - # @overload list_streams(request, options = nil) - # Pass arguments to `list_streams` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::ListStreamsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::ListStreamsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_streams(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) - # Pass arguments to `list_streams` via keyword arguments. Note that at - # least one keyword argument is 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. Parent value for ListStreamsRequest. - # @param page_size [::Integer] - # Requested page size. Server may return fewer items than requested. - # If unspecified, server will pick an appropriate default. - # @param page_token [::String] - # A token identifying a page of results the server should return. - # @param filter [::String] - # Filtering results. - # @param order_by [::String] - # Hint for how to order the results. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::VisionAI::V1::Stream>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::VisionAI::V1::Stream>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::StreamsService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::ListStreamsRequest.new - # - # # Call the list_streams method. - # result = client.list_streams 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::VisionAI::V1::Stream. - # p item - # end - # - def list_streams request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::ListStreamsRequest - - # Converts hash 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_streams.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::VisionAI::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_streams.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_streams.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @streams_service_stub.list_streams request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @streams_service_stub, :list_streams, "streams", 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 details of a single Stream. - # - # @overload get_stream(request, options = nil) - # Pass arguments to `get_stream` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::GetStreamRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::GetStreamRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_stream(name: nil) - # Pass arguments to `get_stream` via keyword arguments. Note that at - # least one keyword argument is 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 resource. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::VisionAI::V1::Stream] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::VisionAI::V1::Stream] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::StreamsService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::GetStreamRequest.new - # - # # Call the get_stream method. - # result = client.get_stream request - # - # # The returned object is of type Google::Cloud::VisionAI::V1::Stream. - # p result - # - def get_stream request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::GetStreamRequest - - # Converts hash 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_stream.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::VisionAI::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_stream.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_stream.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @streams_service_stub.get_stream 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 Stream in a given project and location. - # - # @overload create_stream(request, options = nil) - # Pass arguments to `create_stream` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::CreateStreamRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::CreateStreamRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_stream(parent: nil, stream_id: nil, stream: nil, request_id: nil) - # Pass arguments to `create_stream` via keyword arguments. Note that at - # least one keyword argument is 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. Value for parent. - # @param stream_id [::String] - # Required. Id of the requesting object. - # @param stream [::Google::Cloud::VisionAI::V1::Stream, ::Hash] - # Required. The resource being created. - # @param request_id [::String] - # Optional. An optional request ID to identify requests. Specify a unique - # request ID so that if you must retry your request, the server will know to - # ignore the request if it has already been completed. The server will - # guarantee that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request ID, - # the server can check if original operation with the same request ID was - # received, and if so, will ignore the second request. This prevents clients - # from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @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/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::StreamsService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::CreateStreamRequest.new - # - # # Call the create_stream method. - # result = client.create_stream 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_stream request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::CreateStreamRequest - - # Converts hash 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_stream.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::VisionAI::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_stream.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_stream.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @streams_service_stub.create_stream 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 - - ## - # Updates the parameters of a single Stream. - # - # @overload update_stream(request, options = nil) - # Pass arguments to `update_stream` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::UpdateStreamRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::UpdateStreamRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_stream(update_mask: nil, stream: nil, request_id: nil) - # Pass arguments to `update_stream` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Required. Field mask is used to specify the fields to be overwritten in the - # Stream resource by the update. - # The fields specified in the update_mask are relative to the resource, not - # the full request. A field will be overwritten if it is in the mask. If the - # user does not provide a mask then all fields will be overwritten. - # @param stream [::Google::Cloud::VisionAI::V1::Stream, ::Hash] - # Required. The resource being updated. - # @param request_id [::String] - # Optional. An optional request ID to identify requests. Specify a unique - # request ID so that if you must retry your request, the server will know to - # ignore the request if it has already been completed. The server will - # guarantee that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request ID, - # the server can check if original operation with the same request ID was - # received, and if so, will ignore the second request. This prevents clients - # from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @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/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::StreamsService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::UpdateStreamRequest.new - # - # # Call the update_stream method. - # result = client.update_stream 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 update_stream request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::UpdateStreamRequest - - # Converts hash 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_stream.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::VisionAI::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_stream.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_stream.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @streams_service_stub.update_stream 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 single Stream. - # - # @overload delete_stream(request, options = nil) - # Pass arguments to `delete_stream` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::DeleteStreamRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::DeleteStreamRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_stream(name: nil, request_id: nil) - # Pass arguments to `delete_stream` via keyword arguments. Note that at - # least one keyword argument is 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 resource. - # @param request_id [::String] - # Optional. An optional request ID to identify requests. Specify a unique - # request ID so that if you must retry your request, the server will know to - # ignore the request if it has already been completed. The server will - # guarantee that for at least 60 minutes after the first request. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request ID, - # the server can check if original operation with the same request ID was - # received, and if so, will ignore the second request. This prevents clients - # from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @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/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::StreamsService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::DeleteStreamRequest.new - # - # # Call the delete_stream method. - # result = client.delete_stream 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_stream request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::DeleteStreamRequest - - # Converts hash 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_stream.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::VisionAI::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_stream.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_stream.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @streams_service_stub.delete_stream 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 - - ## - # Gets the thumbnail (image snapshot) of a single Stream. - # - # @overload get_stream_thumbnail(request, options = nil) - # Pass arguments to `get_stream_thumbnail` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::GetStreamThumbnailRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::GetStreamThumbnailRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_stream_thumbnail(stream: nil, gcs_object_name: nil, event: nil, request_id: nil) - # Pass arguments to `get_stream_thumbnail` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param stream [::String] - # Required. The name of the stream for to get the thumbnail from. - # @param gcs_object_name [::String] - # Required. The name of the GCS object to store the thumbnail image. - # @param event [::String] - # Optional. The name of the event. If unspecified, the thumbnail will be - # retrieved from the latest event. - # @param request_id [::String] - # Optional. An optional request ID to identify the requests. Specify a unique - # request ID so that if you must retry your request, the server will know to - # ignore the request if it has already been completed. The server will - # guarantee that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request ID, - # the server can check if original operation with the same request ID was - # received, and if so, will ignore the second request. This prevents clients - # from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @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/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::StreamsService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::GetStreamThumbnailRequest.new - # - # # Call the get_stream_thumbnail method. - # result = client.get_stream_thumbnail 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_stream_thumbnail request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::GetStreamThumbnailRequest - - # Converts hash 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_stream_thumbnail.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::VisionAI::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_stream_thumbnail.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_stream_thumbnail.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @streams_service_stub.get_stream_thumbnail 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 - - ## - # Generate the JWT auth token required to get the stream HLS contents. - # - # @overload generate_stream_hls_token(request, options = nil) - # Pass arguments to `generate_stream_hls_token` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::GenerateStreamHlsTokenRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::GenerateStreamHlsTokenRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_stream_hls_token(stream: nil) - # Pass arguments to `generate_stream_hls_token` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param stream [::String] - # Required. The name of the stream. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::VisionAI::V1::GenerateStreamHlsTokenResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::VisionAI::V1::GenerateStreamHlsTokenResponse] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::StreamsService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::GenerateStreamHlsTokenRequest.new - # - # # Call the generate_stream_hls_token method. - # result = client.generate_stream_hls_token request - # - # # The returned object is of type Google::Cloud::VisionAI::V1::GenerateStreamHlsTokenResponse. - # p result - # - def generate_stream_hls_token request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::GenerateStreamHlsTokenRequest - - # Converts hash 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_stream_hls_token.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::VisionAI::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_stream_hls_token.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.generate_stream_hls_token.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @streams_service_stub.generate_stream_hls_token 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 Events in a given project and location. - # - # @overload list_events(request, options = nil) - # Pass arguments to `list_events` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::ListEventsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::ListEventsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_events(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) - # Pass arguments to `list_events` via keyword arguments. Note that at - # least one keyword argument is 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. Parent value for ListEventsRequest. - # @param page_size [::Integer] - # Requested page size. Server may return fewer items than requested. - # If unspecified, server will pick an appropriate default. - # @param page_token [::String] - # A token identifying a page of results the server should return. - # @param filter [::String] - # Filtering results. - # @param order_by [::String] - # Hint for how to order the results. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::VisionAI::V1::Event>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::VisionAI::V1::Event>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::StreamsService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::ListEventsRequest.new - # - # # Call the list_events method. - # result = client.list_events 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::VisionAI::V1::Event. - # p item - # end - # - def list_events request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::ListEventsRequest - - # Converts hash 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_events.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::VisionAI::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_events.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_events.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @streams_service_stub.list_events request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @streams_service_stub, :list_events, "events", 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 details of a single Event. - # - # @overload get_event(request, options = nil) - # Pass arguments to `get_event` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::GetEventRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::GetEventRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_event(name: nil) - # Pass arguments to `get_event` via keyword arguments. Note that at - # least one keyword argument is 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 resource. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::VisionAI::V1::Event] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::VisionAI::V1::Event] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::StreamsService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::GetEventRequest.new - # - # # Call the get_event method. - # result = client.get_event request - # - # # The returned object is of type Google::Cloud::VisionAI::V1::Event. - # p result - # - def get_event request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::GetEventRequest - - # Converts hash 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_event.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::VisionAI::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_event.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_event.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @streams_service_stub.get_event 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 Event in a given project and location. - # - # @overload create_event(request, options = nil) - # Pass arguments to `create_event` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::CreateEventRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::CreateEventRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_event(parent: nil, event_id: nil, event: nil, request_id: nil) - # Pass arguments to `create_event` via keyword arguments. Note that at - # least one keyword argument is 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. Value for parent. - # @param event_id [::String] - # Required. Id of the requesting object. - # @param event [::Google::Cloud::VisionAI::V1::Event, ::Hash] - # Required. The resource being created. - # @param request_id [::String] - # Optional. An optional request ID to identify requests. Specify a unique - # request ID so that if you must retry your request, the server will know to - # ignore the request if it has already been completed. The server will - # guarantee that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request ID, - # the server can check if original operation with the same request ID was - # received, and if so, will ignore the second request. This prevents clients - # from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @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/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::StreamsService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::CreateEventRequest.new - # - # # Call the create_event method. - # result = client.create_event 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_event request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::CreateEventRequest - - # Converts hash 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_event.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::VisionAI::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_event.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_event.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @streams_service_stub.create_event 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 - - ## - # Updates the parameters of a single Event. - # - # @overload update_event(request, options = nil) - # Pass arguments to `update_event` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::UpdateEventRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::UpdateEventRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_event(update_mask: nil, event: nil, request_id: nil) - # Pass arguments to `update_event` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Required. Field mask is used to specify the fields to be overwritten in the - # Event resource by the update. - # The fields specified in the update_mask are relative to the resource, not - # the full request. A field will be overwritten if it is in the mask. If the - # user does not provide a mask then all fields will be overwritten. - # @param event [::Google::Cloud::VisionAI::V1::Event, ::Hash] - # Required. The resource being updated. - # @param request_id [::String] - # Optional. An optional request ID to identify requests. Specify a unique - # request ID so that if you must retry your request, the server will know to - # ignore the request if it has already been completed. The server will - # guarantee that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request ID, - # the server can check if original operation with the same request ID was - # received, and if so, will ignore the second request. This prevents clients - # from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @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/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::StreamsService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::UpdateEventRequest.new - # - # # Call the update_event method. - # result = client.update_event 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 update_event request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::UpdateEventRequest - - # Converts hash 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_event.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::VisionAI::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_event.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_event.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @streams_service_stub.update_event 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 single Event. - # - # @overload delete_event(request, options = nil) - # Pass arguments to `delete_event` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::DeleteEventRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::DeleteEventRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_event(name: nil, request_id: nil) - # Pass arguments to `delete_event` via keyword arguments. Note that at - # least one keyword argument is 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 resource. - # @param request_id [::String] - # Optional. An optional request ID to identify requests. Specify a unique - # request ID so that if you must retry your request, the server will know to - # ignore the request if it has already been completed. The server will - # guarantee that for at least 60 minutes after the first request. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request ID, - # the server can check if original operation with the same request ID was - # received, and if so, will ignore the second request. This prevents clients - # from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @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/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::StreamsService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::DeleteEventRequest.new - # - # # Call the delete_event method. - # result = client.delete_event 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_event request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::DeleteEventRequest - - # Converts hash 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_event.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::VisionAI::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_event.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_event.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @streams_service_stub.delete_event 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 - - ## - # Lists Series in a given project and location. - # - # @overload list_series(request, options = nil) - # Pass arguments to `list_series` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::ListSeriesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::ListSeriesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_series(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) - # Pass arguments to `list_series` via keyword arguments. Note that at - # least one keyword argument is 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. Parent value for ListSeriesRequest. - # @param page_size [::Integer] - # Requested page size. Server may return fewer items than requested. - # If unspecified, server will pick an appropriate default. - # @param page_token [::String] - # A token identifying a page of results the server should return. - # @param filter [::String] - # Filtering results. - # @param order_by [::String] - # Hint for how to order the results. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::VisionAI::V1::Series>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::VisionAI::V1::Series>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::StreamsService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::ListSeriesRequest.new - # - # # Call the list_series method. - # result = client.list_series 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::VisionAI::V1::Series. - # p item - # end - # - def list_series request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::ListSeriesRequest - - # Converts hash 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_series.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::VisionAI::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_series.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_series.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @streams_service_stub.list_series request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @streams_service_stub, :list_series, "series", 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 details of a single Series. - # - # @overload get_series(request, options = nil) - # Pass arguments to `get_series` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::GetSeriesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::GetSeriesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_series(name: nil) - # Pass arguments to `get_series` via keyword arguments. Note that at - # least one keyword argument is 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 resource. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::VisionAI::V1::Series] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::VisionAI::V1::Series] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::StreamsService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::GetSeriesRequest.new - # - # # Call the get_series method. - # result = client.get_series request - # - # # The returned object is of type Google::Cloud::VisionAI::V1::Series. - # p result - # - def get_series request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::GetSeriesRequest - - # Converts hash 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_series.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::VisionAI::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_series.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_series.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @streams_service_stub.get_series 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 Series in a given project and location. - # - # @overload create_series(request, options = nil) - # Pass arguments to `create_series` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::CreateSeriesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::CreateSeriesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_series(parent: nil, series_id: nil, series: nil, request_id: nil) - # Pass arguments to `create_series` via keyword arguments. Note that at - # least one keyword argument is 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. Value for parent. - # @param series_id [::String] - # Required. Id of the requesting object. - # @param series [::Google::Cloud::VisionAI::V1::Series, ::Hash] - # Required. The resource being created. - # @param request_id [::String] - # Optional. An optional request ID to identify requests. Specify a unique - # request ID so that if you must retry your request, the server will know to - # ignore the request if it has already been completed. The server will - # guarantee that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request ID, - # the server can check if original operation with the same request ID was - # received, and if so, will ignore the second request. This prevents clients - # from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @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/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::StreamsService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::CreateSeriesRequest.new - # - # # Call the create_series method. - # result = client.create_series 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_series request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::CreateSeriesRequest - - # Converts hash 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_series.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::VisionAI::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_series.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_series.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @streams_service_stub.create_series 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 - - ## - # Updates the parameters of a single Event. - # - # @overload update_series(request, options = nil) - # Pass arguments to `update_series` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::UpdateSeriesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::UpdateSeriesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_series(update_mask: nil, series: nil, request_id: nil) - # Pass arguments to `update_series` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Required. Field mask is used to specify the fields to be overwritten in the - # Series resource by the update. The fields specified in the update_mask are - # relative to the resource, not the full request. A field will be overwritten - # if it is in the mask. If the user does not provide a mask then all fields - # will be overwritten. - # @param series [::Google::Cloud::VisionAI::V1::Series, ::Hash] - # Required. The resource being updated - # @param request_id [::String] - # Optional. An optional request ID to identify requests. Specify a unique - # request ID so that if you must retry your request, the server will know to - # ignore the request if it has already been completed. The server will - # guarantee that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request ID, - # the server can check if original operation with the same request ID was - # received, and if so, will ignore the second request. This prevents clients - # from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @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/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::StreamsService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::UpdateSeriesRequest.new - # - # # Call the update_series method. - # result = client.update_series 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 update_series request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::UpdateSeriesRequest - - # Converts hash 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_series.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::VisionAI::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_series.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_series.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @streams_service_stub.update_series 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 single Series. - # - # @overload delete_series(request, options = nil) - # Pass arguments to `delete_series` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::DeleteSeriesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::DeleteSeriesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_series(name: nil, request_id: nil) - # Pass arguments to `delete_series` via keyword arguments. Note that at - # least one keyword argument is 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 resource. - # @param request_id [::String] - # Optional. An optional request ID to identify requests. Specify a unique - # request ID so that if you must retry your request, the server will know to - # ignore the request if it has already been completed. The server will - # guarantee that for at least 60 minutes after the first request. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request ID, - # the server can check if original operation with the same request ID was - # received, and if so, will ignore the second request. This prevents clients - # from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @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/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::StreamsService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::DeleteSeriesRequest.new - # - # # Call the delete_series method. - # result = client.delete_series 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_series request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::DeleteSeriesRequest - - # Converts hash 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_series.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::VisionAI::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_series.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_series.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @streams_service_stub.delete_series 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 - - ## - # Materialize a channel. - # - # @overload materialize_channel(request, options = nil) - # Pass arguments to `materialize_channel` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::MaterializeChannelRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::MaterializeChannelRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload materialize_channel(parent: nil, channel_id: nil, channel: nil, request_id: nil) - # Pass arguments to `materialize_channel` via keyword arguments. Note that at - # least one keyword argument is 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. Value for parent. - # @param channel_id [::String] - # Required. Id of the channel. - # @param channel [::Google::Cloud::VisionAI::V1::Channel, ::Hash] - # Required. The resource being created. - # @param request_id [::String] - # Optional. An optional request ID to identify requests. Specify a unique - # request ID so that if you must retry your request, the server will know to - # ignore the request if it has already been completed. The server will - # guarantee that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request ID, - # the server can check if original operation with the same request ID was - # received, and if so, will ignore the second request. This prevents clients - # from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @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/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::StreamsService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::MaterializeChannelRequest.new - # - # # Call the materialize_channel method. - # result = client.materialize_channel 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 materialize_channel request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::MaterializeChannelRequest - - # Converts hash 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.materialize_channel.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::VisionAI::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.materialize_channel.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.materialize_channel.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @streams_service_stub.materialize_channel 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 - - ## - # Configuration class for the StreamsService REST API. - # - # This class represents the configuration for StreamsService 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::VisionAI::V1::StreamsService::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_clusters to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::VisionAI::V1::StreamsService::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_clusters.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::VisionAI::V1::StreamsService::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_clusters.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 = "visionai.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 StreamsService 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_clusters` - # @return [::Gapic::Config::Method] - # - attr_reader :list_clusters - ## - # RPC-specific configuration for `get_cluster` - # @return [::Gapic::Config::Method] - # - attr_reader :get_cluster - ## - # RPC-specific configuration for `create_cluster` - # @return [::Gapic::Config::Method] - # - attr_reader :create_cluster - ## - # RPC-specific configuration for `update_cluster` - # @return [::Gapic::Config::Method] - # - attr_reader :update_cluster - ## - # RPC-specific configuration for `delete_cluster` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_cluster - ## - # RPC-specific configuration for `list_streams` - # @return [::Gapic::Config::Method] - # - attr_reader :list_streams - ## - # RPC-specific configuration for `get_stream` - # @return [::Gapic::Config::Method] - # - attr_reader :get_stream - ## - # RPC-specific configuration for `create_stream` - # @return [::Gapic::Config::Method] - # - attr_reader :create_stream - ## - # RPC-specific configuration for `update_stream` - # @return [::Gapic::Config::Method] - # - attr_reader :update_stream - ## - # RPC-specific configuration for `delete_stream` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_stream - ## - # RPC-specific configuration for `get_stream_thumbnail` - # @return [::Gapic::Config::Method] - # - attr_reader :get_stream_thumbnail - ## - # RPC-specific configuration for `generate_stream_hls_token` - # @return [::Gapic::Config::Method] - # - attr_reader :generate_stream_hls_token - ## - # RPC-specific configuration for `list_events` - # @return [::Gapic::Config::Method] - # - attr_reader :list_events - ## - # RPC-specific configuration for `get_event` - # @return [::Gapic::Config::Method] - # - attr_reader :get_event - ## - # RPC-specific configuration for `create_event` - # @return [::Gapic::Config::Method] - # - attr_reader :create_event - ## - # RPC-specific configuration for `update_event` - # @return [::Gapic::Config::Method] - # - attr_reader :update_event - ## - # RPC-specific configuration for `delete_event` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_event - ## - # RPC-specific configuration for `list_series` - # @return [::Gapic::Config::Method] - # - attr_reader :list_series - ## - # RPC-specific configuration for `get_series` - # @return [::Gapic::Config::Method] - # - attr_reader :get_series - ## - # RPC-specific configuration for `create_series` - # @return [::Gapic::Config::Method] - # - attr_reader :create_series - ## - # RPC-specific configuration for `update_series` - # @return [::Gapic::Config::Method] - # - attr_reader :update_series - ## - # RPC-specific configuration for `delete_series` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_series - ## - # RPC-specific configuration for `materialize_channel` - # @return [::Gapic::Config::Method] - # - attr_reader :materialize_channel - - # @private - def initialize parent_rpcs = nil - list_clusters_config = parent_rpcs.list_clusters if parent_rpcs.respond_to? :list_clusters - @list_clusters = ::Gapic::Config::Method.new list_clusters_config - get_cluster_config = parent_rpcs.get_cluster if parent_rpcs.respond_to? :get_cluster - @get_cluster = ::Gapic::Config::Method.new get_cluster_config - create_cluster_config = parent_rpcs.create_cluster if parent_rpcs.respond_to? :create_cluster - @create_cluster = ::Gapic::Config::Method.new create_cluster_config - update_cluster_config = parent_rpcs.update_cluster if parent_rpcs.respond_to? :update_cluster - @update_cluster = ::Gapic::Config::Method.new update_cluster_config - delete_cluster_config = parent_rpcs.delete_cluster if parent_rpcs.respond_to? :delete_cluster - @delete_cluster = ::Gapic::Config::Method.new delete_cluster_config - list_streams_config = parent_rpcs.list_streams if parent_rpcs.respond_to? :list_streams - @list_streams = ::Gapic::Config::Method.new list_streams_config - get_stream_config = parent_rpcs.get_stream if parent_rpcs.respond_to? :get_stream - @get_stream = ::Gapic::Config::Method.new get_stream_config - create_stream_config = parent_rpcs.create_stream if parent_rpcs.respond_to? :create_stream - @create_stream = ::Gapic::Config::Method.new create_stream_config - update_stream_config = parent_rpcs.update_stream if parent_rpcs.respond_to? :update_stream - @update_stream = ::Gapic::Config::Method.new update_stream_config - delete_stream_config = parent_rpcs.delete_stream if parent_rpcs.respond_to? :delete_stream - @delete_stream = ::Gapic::Config::Method.new delete_stream_config - get_stream_thumbnail_config = parent_rpcs.get_stream_thumbnail if parent_rpcs.respond_to? :get_stream_thumbnail - @get_stream_thumbnail = ::Gapic::Config::Method.new get_stream_thumbnail_config - generate_stream_hls_token_config = parent_rpcs.generate_stream_hls_token if parent_rpcs.respond_to? :generate_stream_hls_token - @generate_stream_hls_token = ::Gapic::Config::Method.new generate_stream_hls_token_config - list_events_config = parent_rpcs.list_events if parent_rpcs.respond_to? :list_events - @list_events = ::Gapic::Config::Method.new list_events_config - get_event_config = parent_rpcs.get_event if parent_rpcs.respond_to? :get_event - @get_event = ::Gapic::Config::Method.new get_event_config - create_event_config = parent_rpcs.create_event if parent_rpcs.respond_to? :create_event - @create_event = ::Gapic::Config::Method.new create_event_config - update_event_config = parent_rpcs.update_event if parent_rpcs.respond_to? :update_event - @update_event = ::Gapic::Config::Method.new update_event_config - delete_event_config = parent_rpcs.delete_event if parent_rpcs.respond_to? :delete_event - @delete_event = ::Gapic::Config::Method.new delete_event_config - list_series_config = parent_rpcs.list_series if parent_rpcs.respond_to? :list_series - @list_series = ::Gapic::Config::Method.new list_series_config - get_series_config = parent_rpcs.get_series if parent_rpcs.respond_to? :get_series - @get_series = ::Gapic::Config::Method.new get_series_config - create_series_config = parent_rpcs.create_series if parent_rpcs.respond_to? :create_series - @create_series = ::Gapic::Config::Method.new create_series_config - update_series_config = parent_rpcs.update_series if parent_rpcs.respond_to? :update_series - @update_series = ::Gapic::Config::Method.new update_series_config - delete_series_config = parent_rpcs.delete_series if parent_rpcs.respond_to? :delete_series - @delete_series = ::Gapic::Config::Method.new delete_series_config - materialize_channel_config = parent_rpcs.materialize_channel if parent_rpcs.respond_to? :materialize_channel - @materialize_channel = ::Gapic::Config::Method.new materialize_channel_config - - yield self if block_given? - end - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/streams_service/rest/operations.rb b/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/streams_service/rest/operations.rb deleted file mode 100644 index 55fd98a9f0c3..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/streams_service/rest/operations.rb +++ /dev/null @@ -1,974 +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 VisionAI - module V1 - module StreamsService - module Rest - # Service that implements Longrunning Operations API. - class Operations - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "visionai.$UNIVERSE_DOMAIN$" - - # @private - attr_reader :operations_stub - - ## - # Configuration for the StreamsService 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 StreamsService 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::VisionAI::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::VisionAI::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::VisionAI::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::VisionAI::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 = "visionai.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}/operations", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/?$}, 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] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/warehouseOperations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/corpora/[^/]+/assets/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/corpora/[^/]+/collections/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/corpora/[^/]+/imageIndexes/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/corpora/[^/]+/indexes/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/corpora/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/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{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] - ] - ) - 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{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/streams_service/rest/service_stub.rb b/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/streams_service/rest/service_stub.rb deleted file mode 100644 index 49d892a53343..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/streams_service/rest/service_stub.rb +++ /dev/null @@ -1,1495 +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/visionai/v1/streams_service_pb" - -module Google - module Cloud - module VisionAI - module V1 - module StreamsService - module Rest - ## - # REST service stub for the StreamsService 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_clusters REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::ListClustersRequest] - # 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::VisionAI::V1::ListClustersResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::VisionAI::V1::ListClustersResponse] - # A result object deserialized from the server's reply - def list_clusters request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_clusters_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_clusters", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::VisionAI::V1::ListClustersResponse.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_cluster REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::GetClusterRequest] - # 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::VisionAI::V1::Cluster] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::VisionAI::V1::Cluster] - # A result object deserialized from the server's reply - def get_cluster request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_cluster_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_cluster", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::VisionAI::V1::Cluster.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_cluster REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::CreateClusterRequest] - # 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_cluster request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_cluster_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_cluster", - 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 update_cluster REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::UpdateClusterRequest] - # 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 update_cluster request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_cluster_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_cluster", - 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_cluster REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::DeleteClusterRequest] - # 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_cluster request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_delete_cluster_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_cluster", - 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 list_streams REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::ListStreamsRequest] - # 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::VisionAI::V1::ListStreamsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::VisionAI::V1::ListStreamsResponse] - # A result object deserialized from the server's reply - def list_streams request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_streams_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_streams", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::VisionAI::V1::ListStreamsResponse.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_stream REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::GetStreamRequest] - # 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::VisionAI::V1::Stream] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::VisionAI::V1::Stream] - # A result object deserialized from the server's reply - def get_stream request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_stream_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_stream", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::VisionAI::V1::Stream.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_stream REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::CreateStreamRequest] - # 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_stream request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_stream_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_stream", - 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 update_stream REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::UpdateStreamRequest] - # 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 update_stream request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_stream_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_stream", - 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_stream REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::DeleteStreamRequest] - # 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_stream request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_delete_stream_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_stream", - 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_stream_thumbnail REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::GetStreamThumbnailRequest] - # 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_stream_thumbnail request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_stream_thumbnail_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_stream_thumbnail", - 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 generate_stream_hls_token REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::GenerateStreamHlsTokenRequest] - # 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::VisionAI::V1::GenerateStreamHlsTokenResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::VisionAI::V1::GenerateStreamHlsTokenResponse] - # A result object deserialized from the server's reply - def generate_stream_hls_token request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_generate_stream_hls_token_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_stream_hls_token", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::VisionAI::V1::GenerateStreamHlsTokenResponse.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_events REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::ListEventsRequest] - # 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::VisionAI::V1::ListEventsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::VisionAI::V1::ListEventsResponse] - # A result object deserialized from the server's reply - def list_events request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_events_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_events", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::VisionAI::V1::ListEventsResponse.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_event REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::GetEventRequest] - # 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::VisionAI::V1::Event] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::VisionAI::V1::Event] - # A result object deserialized from the server's reply - def get_event request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_event_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_event", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::VisionAI::V1::Event.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_event REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::CreateEventRequest] - # 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_event request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_event_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_event", - 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 update_event REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::UpdateEventRequest] - # 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 update_event request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_event_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_event", - 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_event REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::DeleteEventRequest] - # 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_event request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_delete_event_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_event", - 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 list_series REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::ListSeriesRequest] - # 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::VisionAI::V1::ListSeriesResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::VisionAI::V1::ListSeriesResponse] - # A result object deserialized from the server's reply - def list_series request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_series_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_series", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::VisionAI::V1::ListSeriesResponse.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_series REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::GetSeriesRequest] - # 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::VisionAI::V1::Series] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::VisionAI::V1::Series] - # A result object deserialized from the server's reply - def get_series request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_series_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_series", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::VisionAI::V1::Series.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_series REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::CreateSeriesRequest] - # 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_series request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_series_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_series", - 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 update_series REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::UpdateSeriesRequest] - # 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 update_series request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_series_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_series", - 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_series REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::DeleteSeriesRequest] - # 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_series request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_delete_series_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_series", - 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 materialize_channel REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::MaterializeChannelRequest] - # 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 materialize_channel request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_materialize_channel_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: "materialize_channel", - 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 - - ## - # @private - # - # GRPC transcoding helper method for the list_clusters REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::ListClustersRequest] - # 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_clusters_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/clusters", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_cluster REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::GetClusterRequest] - # 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_cluster_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/clusters/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the create_cluster REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::CreateClusterRequest] - # 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_cluster_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}/clusters", - body: "cluster", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_cluster REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::UpdateClusterRequest] - # 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_cluster_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v1/{cluster.name}", - body: "cluster", - matches: [ - ["cluster.name", %r{^projects/[^/]+/locations/[^/]+/clusters/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_cluster REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::DeleteClusterRequest] - # 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_cluster_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/clusters/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_streams REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::ListStreamsRequest] - # 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_streams_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/streams", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/clusters/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_stream REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::GetStreamRequest] - # 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_stream_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/clusters/[^/]+/streams/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the create_stream REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::CreateStreamRequest] - # 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_stream_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}/streams", - body: "stream", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/clusters/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_stream REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::UpdateStreamRequest] - # 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_stream_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v1/{stream.name}", - body: "stream", - matches: [ - ["stream.name", %r{^projects/[^/]+/locations/[^/]+/clusters/[^/]+/streams/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_stream REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::DeleteStreamRequest] - # 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_stream_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/clusters/[^/]+/streams/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_stream_thumbnail REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::GetStreamThumbnailRequest] - # 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_stream_thumbnail_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{stream}:getThumbnail", - body: "*", - matches: [ - ["stream", %r{^projects/[^/]+/locations/[^/]+/clusters/[^/]+/streams/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the generate_stream_hls_token REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::GenerateStreamHlsTokenRequest] - # 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_stream_hls_token_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{stream}:generateStreamHlsToken", - body: "*", - matches: [ - ["stream", %r{^projects/[^/]+/locations/[^/]+/clusters/[^/]+/streams/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_events REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::ListEventsRequest] - # 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_events_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/events", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/clusters/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_event REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::GetEventRequest] - # 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_event_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/clusters/[^/]+/events/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the create_event REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::CreateEventRequest] - # 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_event_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}/events", - body: "event", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/clusters/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_event REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::UpdateEventRequest] - # 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_event_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v1/{event.name}", - body: "event", - matches: [ - ["event.name", %r{^projects/[^/]+/locations/[^/]+/clusters/[^/]+/events/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_event REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::DeleteEventRequest] - # 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_event_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/clusters/[^/]+/events/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_series REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::ListSeriesRequest] - # 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_series_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/series", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/clusters/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_series REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::GetSeriesRequest] - # 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_series_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/clusters/[^/]+/series/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the create_series REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::CreateSeriesRequest] - # 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_series_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}/series", - body: "series", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/clusters/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_series REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::UpdateSeriesRequest] - # 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_series_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v1/{series.name}", - body: "series", - matches: [ - ["series.name", %r{^projects/[^/]+/locations/[^/]+/clusters/[^/]+/series/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_series REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::DeleteSeriesRequest] - # 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_series_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/clusters/[^/]+/series/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the materialize_channel REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::MaterializeChannelRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_materialize_channel_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}/channels", - body: "channel", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/clusters/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/version.rb b/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/version.rb deleted file mode 100644 index dd2a2e130b69..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/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 VisionAI - module V1 - VERSION = "0.0.1" - end - end - end -end diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/warehouse.rb b/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/warehouse.rb deleted file mode 100644 index 50fa7e50f9fb..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/warehouse.rb +++ /dev/null @@ -1,56 +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/vision_ai/v1/version" - -require "google/cloud/vision_ai/v1/warehouse/credentials" -require "google/cloud/vision_ai/v1/warehouse/paths" -require "google/cloud/vision_ai/v1/warehouse/operations" -require "google/cloud/vision_ai/v1/warehouse/client" -require "google/cloud/vision_ai/v1/warehouse/rest" - -module Google - module Cloud - module VisionAI - module V1 - ## - # Service that manages media content + metadata for streaming. - # - # @example Load this service and instantiate a gRPC client - # - # require "google/cloud/vision_ai/v1/warehouse" - # client = ::Google::Cloud::VisionAI::V1::Warehouse::Client.new - # - # @example Load this service and instantiate a REST client - # - # require "google/cloud/vision_ai/v1/warehouse/rest" - # client = ::Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new - # - module Warehouse - end - end - end - end -end - -helper_path = ::File.join __dir__, "warehouse", "helpers.rb" -require "google/cloud/vision_ai/v1/warehouse/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/warehouse/client.rb b/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/warehouse/client.rb deleted file mode 100644 index 9f0a73b90543..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/warehouse/client.rb +++ /dev/null @@ -1,6982 +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/visionai/v1/warehouse_pb" -require "google/cloud/location" -require "google/iam/v1" - -module Google - module Cloud - module VisionAI - module V1 - module Warehouse - ## - # Client for the Warehouse service. - # - # Service that manages media content + metadata for streaming. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "warehouse-visionai.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :warehouse_stub - - ## - # Configure the Warehouse Client class. - # - # See {::Google::Cloud::VisionAI::V1::Warehouse::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all Warehouse clients - # ::Google::Cloud::VisionAI::V1::Warehouse::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", "VisionAI", "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.timeout = 60.0 - default_config.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.create_asset.timeout = 120.0 - default_config.rpcs.create_asset.retry_policy = { - initial_delay: 1.0, max_delay: 120.0, multiplier: 2.5, retry_codes: [14] - } - - default_config.rpcs.create_corpus.timeout = 120.0 - default_config.rpcs.create_corpus.retry_policy = { - initial_delay: 1.0, max_delay: 120.0, multiplier: 2.5, retry_codes: [14] - } - - default_config.rpcs.create_data_schema.timeout = 120.0 - default_config.rpcs.create_data_schema.retry_policy = { - initial_delay: 1.0, max_delay: 120.0, multiplier: 2.5, retry_codes: [14] - } - - default_config.rpcs.create_annotation.timeout = 120.0 - default_config.rpcs.create_annotation.retry_policy = { - initial_delay: 1.0, max_delay: 120.0, multiplier: 2.5, retry_codes: [14] - } - - default_config.rpcs.ingest_asset.timeout = 120.0 - default_config.rpcs.ingest_asset.retry_policy = { - initial_delay: 1.0, max_delay: 120.0, multiplier: 2.5, retry_codes: [14] - } - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the Warehouse 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::VisionAI::V1::Warehouse::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 - @warehouse_stub.universe_domain - end - - ## - # Create a new Warehouse client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::VisionAI::V1::Warehouse::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::VisionAI::V1::Warehouse::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Warehouse 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/visionai/v1/warehouse_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 - - @warehouse_stub = ::Gapic::ServiceStub.new( - ::Google::Cloud::VisionAI::V1::Warehouse::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 - ) - - @warehouse_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 = @warehouse_stub.endpoint - config.universe_domain = @warehouse_stub.universe_domain - config.logger = @warehouse_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 = @warehouse_stub.endpoint - config.universe_domain = @warehouse_stub.universe_domain - config.logger = @warehouse_stub.logger if config.respond_to? :logger= - end - end - - ## - # Get the associated client for long-running operations. - # - # @return [::Google::Cloud::VisionAI::V1::Warehouse::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 - @warehouse_stub.logger - end - - # Service calls - - ## - # Creates an asset inside corpus. - # - # @overload create_asset(request, options = nil) - # Pass arguments to `create_asset` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::CreateAssetRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::CreateAssetRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_asset(parent: nil, asset: nil, asset_id: nil) - # Pass arguments to `create_asset` via keyword arguments. Note that at - # least one keyword argument is 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 parent resource where this asset will be created. - # Format: - # `projects/{project_number}/locations/{location_id}/corpora/{corpus_id}` - # @param asset [::Google::Cloud::VisionAI::V1::Asset, ::Hash] - # Required. The asset to create. - # @param asset_id [::String] - # Optional. The ID to use for the asset, which will become the final - # component of the asset's resource name if user choose to specify. - # Otherwise, asset id will be generated by system. - # - # This value should be up to 63 characters, and valid characters - # are /[a-z][0-9]-/. The first character must be a letter, the last could be - # a letter or a number. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::VisionAI::V1::Asset] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::VisionAI::V1::Asset] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::Warehouse::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::CreateAssetRequest.new - # - # # Call the create_asset method. - # result = client.create_asset request - # - # # The returned object is of type Google::Cloud::VisionAI::V1::Asset. - # p result - # - def create_asset request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::CreateAssetRequest - - # Converts hash 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_asset.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::VisionAI::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_asset.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_asset.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @warehouse_stub.call_rpc :create_asset, 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 asset inside corpus. - # - # @overload update_asset(request, options = nil) - # Pass arguments to `update_asset` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::UpdateAssetRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::UpdateAssetRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_asset(asset: nil, update_mask: nil) - # Pass arguments to `update_asset` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param asset [::Google::Cloud::VisionAI::V1::Asset, ::Hash] - # Required. The asset to update. - # - # The asset's `name` field is used to identify the asset to be updated. - # Format: - # `projects/{project_number}/locations/{location}/corpora/{corpus}/assets/{asset}` - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # The list of fields to be updated. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::VisionAI::V1::Asset] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::VisionAI::V1::Asset] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::Warehouse::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::UpdateAssetRequest.new - # - # # Call the update_asset method. - # result = client.update_asset request - # - # # The returned object is of type Google::Cloud::VisionAI::V1::Asset. - # p result - # - def update_asset request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::UpdateAssetRequest - - # Converts hash 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_asset.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::VisionAI::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.asset&.name - header_params["asset.name"] = request.asset.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_asset.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_asset.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @warehouse_stub.call_rpc :update_asset, 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 - - ## - # Reads an asset inside corpus. - # - # @overload get_asset(request, options = nil) - # Pass arguments to `get_asset` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::GetAssetRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::GetAssetRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_asset(name: nil) - # Pass arguments to `get_asset` via keyword arguments. Note that at - # least one keyword argument is 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 name of the asset to retrieve. - # Format: - # projects/\\{project_number}/locations/\\{location}/corpora/\\{corpus}/assets/\\{asset} - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::VisionAI::V1::Asset] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::VisionAI::V1::Asset] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::Warehouse::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::GetAssetRequest.new - # - # # Call the get_asset method. - # result = client.get_asset request - # - # # The returned object is of type Google::Cloud::VisionAI::V1::Asset. - # p result - # - def get_asset request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::GetAssetRequest - - # Converts hash 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_asset.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::VisionAI::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_asset.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_asset.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @warehouse_stub.call_rpc :get_asset, 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 an list of assets inside corpus. - # - # @overload list_assets(request, options = nil) - # Pass arguments to `list_assets` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::ListAssetsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::ListAssetsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_assets(parent: nil, page_size: nil, page_token: nil, filter: nil) - # Pass arguments to `list_assets` via keyword arguments. Note that at - # least one keyword argument is 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 parent, which owns this collection of assets. - # Format: - # `projects/{project_number}/locations/{location}/corpora/{corpus}` - # @param page_size [::Integer] - # The maximum number of assets to return. The service may return fewer than - # this value. - # If unspecified, at most 50 assets will be returned. - # The maximum value is 1000; values above 1000 will be coerced to 1000. - # @param page_token [::String] - # A page token, received from a previous `ListAssets` call. - # Provide this to retrieve the subsequent page. - # - # When paginating, all other parameters provided to `ListAssets` must match - # the call that provided the page token. - # @param filter [::String] - # The filter applied to the returned list. - # Only the following filterings are supported: - # "assets_with_contents = true", which returns assets with contents uploaded; - # "assets_with_contents = false", which returns assets without contents. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::VisionAI::V1::Asset>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::VisionAI::V1::Asset>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::Warehouse::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::ListAssetsRequest.new - # - # # Call the list_assets method. - # result = client.list_assets 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::VisionAI::V1::Asset. - # p item - # end - # - def list_assets request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::ListAssetsRequest - - # Converts hash 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_assets.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::VisionAI::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_assets.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_assets.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @warehouse_stub.call_rpc :list_assets, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @warehouse_stub, :list_assets, 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 asset inside corpus. - # - # @overload delete_asset(request, options = nil) - # Pass arguments to `delete_asset` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::DeleteAssetRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::DeleteAssetRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_asset(name: nil) - # Pass arguments to `delete_asset` via keyword arguments. Note that at - # least one keyword argument is 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 name of the asset to delete. - # Format: - # `projects/{project_number}/locations/{location}/corpora/{corpus}/assets/{asset}` - # - # @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/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::Warehouse::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::DeleteAssetRequest.new - # - # # Call the delete_asset method. - # result = client.delete_asset 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_asset request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::DeleteAssetRequest - - # Converts hash 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_asset.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::VisionAI::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_asset.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_asset.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @warehouse_stub.call_rpc :delete_asset, 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 - - ## - # Upload asset by specifing the asset Cloud Storage uri. - # For video warehouse, it requires users who call this API have read access - # to the cloud storage file. Once it is uploaded, it can be retrieved by - # GenerateRetrievalUrl API which by default, only can retrieve cloud storage - # files from the same project of the warehouse. To allow retrieval cloud - # storage files that are in a separate project, it requires to find the - # vision ai service account (Go to IAM, check checkbox to show "Include - # Google-provided role grants", search for "Cloud Vision AI Service Agent") - # and grant the read access of the cloud storage files to that service - # account. - # - # @overload upload_asset(request, options = nil) - # Pass arguments to `upload_asset` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::UploadAssetRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::UploadAssetRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload upload_asset(name: nil, asset_source: nil) - # Pass arguments to `upload_asset` via keyword arguments. Note that at - # least one keyword argument is 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 asset to upload. - # Format: - # `projects/{project_number}/locations/{location_id}/corpora/{corpus_id}/assets/{asset_id}` - # @param asset_source [::Google::Cloud::VisionAI::V1::AssetSource, ::Hash] - # The source of the asset. - # - # @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/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::Warehouse::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::UploadAssetRequest.new - # - # # Call the upload_asset method. - # result = client.upload_asset 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 upload_asset request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::UploadAssetRequest - - # Converts hash 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.upload_asset.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::VisionAI::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.upload_asset.timeout, - metadata: metadata, - retry_policy: @config.rpcs.upload_asset.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @warehouse_stub.call_rpc :upload_asset, 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 - - ## - # Generates a signed url for downloading the asset. - # For video warehouse, please see comment of UploadAsset about how to allow - # retrieval of cloud storage files in a different project. - # - # @overload generate_retrieval_url(request, options = nil) - # Pass arguments to `generate_retrieval_url` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::GenerateRetrievalUrlRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::GenerateRetrievalUrlRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_retrieval_url(name: nil) - # Pass arguments to `generate_retrieval_url` via keyword arguments. Note that at - # least one keyword argument is 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 asset to request signed url for. - # Format: - # `projects/{project_number}/locations/{location_id}/corpora/{corpus_id}/assets/{asset_id}` - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::VisionAI::V1::GenerateRetrievalUrlResponse] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::VisionAI::V1::GenerateRetrievalUrlResponse] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::Warehouse::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::GenerateRetrievalUrlRequest.new - # - # # Call the generate_retrieval_url method. - # result = client.generate_retrieval_url request - # - # # The returned object is of type Google::Cloud::VisionAI::V1::GenerateRetrievalUrlResponse. - # p result - # - def generate_retrieval_url request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::GenerateRetrievalUrlRequest - - # Converts hash 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_retrieval_url.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::VisionAI::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.generate_retrieval_url.timeout, - metadata: metadata, - retry_policy: @config.rpcs.generate_retrieval_url.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @warehouse_stub.call_rpc :generate_retrieval_url, 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 - - ## - # Analyze asset to power search capability. - # - # @overload analyze_asset(request, options = nil) - # Pass arguments to `analyze_asset` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::AnalyzeAssetRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::AnalyzeAssetRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload analyze_asset(name: nil) - # Pass arguments to `analyze_asset` via keyword arguments. Note that at - # least one keyword argument is 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 asset to analyze. - # Format: - # `projects/{project_number}/locations/{location_id}/corpora/{corpus_id}/assets/{asset_id}` - # - # @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/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::Warehouse::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::AnalyzeAssetRequest.new - # - # # Call the analyze_asset method. - # result = client.analyze_asset 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 analyze_asset request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::AnalyzeAssetRequest - - # Converts hash 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.analyze_asset.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::VisionAI::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.analyze_asset.timeout, - metadata: metadata, - retry_policy: @config.rpcs.analyze_asset.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @warehouse_stub.call_rpc :analyze_asset, 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 - - ## - # Index one asset for search. - # Supported corpus type: Corpus.Type.VIDEO_ON_DEMAND - # - # @overload index_asset(request, options = nil) - # Pass arguments to `index_asset` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::IndexAssetRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::IndexAssetRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload index_asset(name: nil, index: nil) - # Pass arguments to `index_asset` via keyword arguments. Note that at - # least one keyword argument is 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 asset to index. - # Format: - # `projects/{project_number}/locations/{location_id}/corpora/{corpus_id}/assets/{asset_id}` - # @param index [::String] - # Optional. The name of the index. - # Format: - # `projects/{project_number}/locations/{location}/corpora/{corpus}/indexes/{index}` - # - # @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/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::Warehouse::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::IndexAssetRequest.new - # - # # Call the index_asset method. - # result = client.index_asset 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 index_asset request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::IndexAssetRequest - - # Converts hash 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.index_asset.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::VisionAI::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.index_asset.timeout, - metadata: metadata, - retry_policy: @config.rpcs.index_asset.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @warehouse_stub.call_rpc :index_asset, 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 - - ## - # Remove one asset's index data for search. - # Supported corpus type: Corpus.Type.VIDEO_ON_DEMAND - # - # @overload remove_index_asset(request, options = nil) - # Pass arguments to `remove_index_asset` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::RemoveIndexAssetRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::RemoveIndexAssetRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload remove_index_asset(name: nil, index: nil) - # Pass arguments to `remove_index_asset` via keyword arguments. Note that at - # least one keyword argument is 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 asset to index. - # Format: - # `projects/{project_number}/locations/{location_id}/corpora/{corpus_id}/assets/{asset_id}` - # @param index [::String] - # Optional. The name of the index. - # Format: - # `projects/{project_number}/locations/{location}/corpora/{corpus}/indexes/{index}` - # - # @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/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::Warehouse::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::RemoveIndexAssetRequest.new - # - # # Call the remove_index_asset method. - # result = client.remove_index_asset 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 remove_index_asset request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::RemoveIndexAssetRequest - - # Converts hash 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.remove_index_asset.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::VisionAI::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.remove_index_asset.timeout, - metadata: metadata, - retry_policy: @config.rpcs.remove_index_asset.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @warehouse_stub.call_rpc :remove_index_asset, 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 - - ## - # Lists assets inside an index. - # - # @overload view_indexed_assets(request, options = nil) - # Pass arguments to `view_indexed_assets` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::ViewIndexedAssetsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::ViewIndexedAssetsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload view_indexed_assets(index: nil, page_size: nil, page_token: nil, filter: nil) - # Pass arguments to `view_indexed_assets` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param index [::String] - # Required. The index that owns this collection of assets. - # Format: - # `projects/{project_number}/locations/{location}/corpora/{corpus}/indexes/{index}` - # @param page_size [::Integer] - # The maximum number of assets to return. The service may return fewer than - # this value. - # If unspecified, at most 50 assets will be returned. - # The maximum value is 1000; values above 1000 will be coerced to 1000. - # @param page_token [::String] - # A page token, received from a previous `ViewIndexedAssets` call. - # Provide this to retrieve the subsequent page. - # - # When paginating, all other parameters provided to `ViewIndexedAssets` must - # match the call that provided the page token. - # @param filter [::String] - # The filter applied to the returned list. - # Only the following filterings are supported: - # "asset_id = xxxx", which returns asset with specified id. - # "asset_id = xxxx, yyyy, zzzz", which returns assets with specified ids. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::VisionAI::V1::IndexedAsset>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::VisionAI::V1::IndexedAsset>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::Warehouse::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::ViewIndexedAssetsRequest.new - # - # # Call the view_indexed_assets method. - # result = client.view_indexed_assets 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::VisionAI::V1::IndexedAsset. - # p item - # end - # - def view_indexed_assets request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::ViewIndexedAssetsRequest - - # Converts hash 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.view_indexed_assets.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::VisionAI::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.index - header_params["index"] = request.index - 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.view_indexed_assets.timeout, - metadata: metadata, - retry_policy: @config.rpcs.view_indexed_assets.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @warehouse_stub.call_rpc :view_indexed_assets, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @warehouse_stub, :view_indexed_assets, 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 - - ## - # Creates an Index under the corpus. - # - # @overload create_index(request, options = nil) - # Pass arguments to `create_index` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::CreateIndexRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::CreateIndexRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_index(parent: nil, index_id: nil, index: nil) - # Pass arguments to `create_index` via keyword arguments. Note that at - # least one keyword argument is 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. Value for the parent. The resource name of the Corpus under which - # this index is created. Format: - # `projects/{project_number}/locations/{location_id}/corpora/{corpus_id}` - # @param index_id [::String] - # Optional. The ID for the index. This will become the final resource name - # for the index. If the user does not specify this value, it will be - # generated by system. - # - # This value should be up to 63 characters, and valid characters - # are /[a-z][0-9]-/. The first character must be a letter, the last could be - # a letter or a number. - # @param index [::Google::Cloud::VisionAI::V1::Index, ::Hash] - # Required. The index being created. - # - # @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/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::Warehouse::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::CreateIndexRequest.new - # - # # Call the create_index method. - # result = client.create_index 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_index request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::CreateIndexRequest - - # Converts hash 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_index.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::VisionAI::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_index.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_index.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @warehouse_stub.call_rpc :create_index, 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 - - ## - # Updates an Index under the corpus. - # Users can perform a metadata-only update or trigger a full index rebuild - # with different update_mask values. - # - # @overload update_index(request, options = nil) - # Pass arguments to `update_index` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::UpdateIndexRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::UpdateIndexRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_index(index: nil, update_mask: nil) - # Pass arguments to `update_index` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param index [::Google::Cloud::VisionAI::V1::Index, ::Hash] - # Required. The resource being updated. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Required. Field mask is used to specify the fields to be overwritten in the - # Index resource by the update. The fields specified in the update_mask are - # relative to the resource, not the full request. A field of the resource - # will be overwritten if it is in the mask. Empty field mask is not allowed. - # If the mask is "*", it triggers a full update of the index, and also a - # whole rebuild of index data. - # - # @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/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::Warehouse::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::UpdateIndexRequest.new - # - # # Call the update_index method. - # result = client.update_index 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 update_index request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::UpdateIndexRequest - - # Converts hash 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_index.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::VisionAI::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.index&.name - header_params["index.name"] = request.index.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_index.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_index.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @warehouse_stub.call_rpc :update_index, 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 - - ## - # Gets the details of a single Index under a Corpus. - # - # @overload get_index(request, options = nil) - # Pass arguments to `get_index` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::GetIndexRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::GetIndexRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_index(name: nil) - # Pass arguments to `get_index` via keyword arguments. Note that at - # least one keyword argument is 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 Index resource. - # Format: - # `projects/{project_number}/locations/{location}/corpora/{corpus}/indexes/{index}` - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::VisionAI::V1::Index] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::VisionAI::V1::Index] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::Warehouse::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::GetIndexRequest.new - # - # # Call the get_index method. - # result = client.get_index request - # - # # The returned object is of type Google::Cloud::VisionAI::V1::Index. - # p result - # - def get_index request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::GetIndexRequest - - # Converts hash 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_index.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::VisionAI::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_index.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_index.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @warehouse_stub.call_rpc :get_index, 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 - - ## - # List all Indexes in a given Corpus. - # - # @overload list_indexes(request, options = nil) - # Pass arguments to `list_indexes` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::ListIndexesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::ListIndexesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_indexes(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_indexes` via keyword arguments. Note that at - # least one keyword argument is 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 parent corpus that owns this collection of indexes. - # Format: - # `projects/{project_number}/locations/{location}/corpora/{corpus}` - # @param page_size [::Integer] - # The maximum number of indexes to return. The service may return fewer than - # this value. - # If unspecified, at most 50 indexes will be returned. - # The maximum value is 1000; values above 1000 will be coerced to 1000. - # @param page_token [::String] - # A page token, received from a previous `ListIndexes` call. - # Provide this to retrieve the subsequent page. - # - # When paginating, all other parameters provided to `ListIndexes` must match - # the call that provided the page token. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::VisionAI::V1::Index>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::VisionAI::V1::Index>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::Warehouse::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::ListIndexesRequest.new - # - # # Call the list_indexes method. - # result = client.list_indexes 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::VisionAI::V1::Index. - # p item - # end - # - def list_indexes request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::ListIndexesRequest - - # Converts hash 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_indexes.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::VisionAI::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_indexes.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_indexes.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @warehouse_stub.call_rpc :list_indexes, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @warehouse_stub, :list_indexes, 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 - - ## - # Delete a single Index. In order to delete an index, the caller must - # make sure that it is not deployed to any index endpoint. - # - # @overload delete_index(request, options = nil) - # Pass arguments to `delete_index` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::DeleteIndexRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::DeleteIndexRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_index(name: nil) - # Pass arguments to `delete_index` via keyword arguments. Note that at - # least one keyword argument is 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 name of the index to delete. - # Format: - # `projects/{project_number}/locations/{location}/corpora/{corpus}/indexes/{index}` - # - # @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/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::Warehouse::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::DeleteIndexRequest.new - # - # # Call the delete_index method. - # result = client.delete_index 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_index request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::DeleteIndexRequest - - # Converts hash 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_index.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::VisionAI::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_index.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_index.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @warehouse_stub.call_rpc :delete_index, 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 corpus inside a project. - # - # @overload create_corpus(request, options = nil) - # Pass arguments to `create_corpus` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::CreateCorpusRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::CreateCorpusRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_corpus(parent: nil, corpus: nil) - # Pass arguments to `create_corpus` via keyword arguments. Note that at - # least one keyword argument is 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. Form: `projects/{project_number}/locations/{location_id}` - # @param corpus [::Google::Cloud::VisionAI::V1::Corpus, ::Hash] - # Required. The corpus to be created. - # - # @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/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::Warehouse::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::CreateCorpusRequest.new - # - # # Call the create_corpus method. - # result = client.create_corpus 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_corpus request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::CreateCorpusRequest - - # Converts hash 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_corpus.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::VisionAI::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_corpus.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_corpus.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @warehouse_stub.call_rpc :create_corpus, 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 - - ## - # Gets corpus details inside a project. - # - # @overload get_corpus(request, options = nil) - # Pass arguments to `get_corpus` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::GetCorpusRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::GetCorpusRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_corpus(name: nil) - # Pass arguments to `get_corpus` via keyword arguments. Note that at - # least one keyword argument is 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 corpus to retrieve. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::VisionAI::V1::Corpus] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::VisionAI::V1::Corpus] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::Warehouse::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::GetCorpusRequest.new - # - # # Call the get_corpus method. - # result = client.get_corpus request - # - # # The returned object is of type Google::Cloud::VisionAI::V1::Corpus. - # p result - # - def get_corpus request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::GetCorpusRequest - - # Converts hash 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_corpus.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::VisionAI::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_corpus.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_corpus.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @warehouse_stub.call_rpc :get_corpus, 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 a corpus in a project. - # - # @overload update_corpus(request, options = nil) - # Pass arguments to `update_corpus` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::UpdateCorpusRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::UpdateCorpusRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_corpus(corpus: nil, update_mask: nil) - # Pass arguments to `update_corpus` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param corpus [::Google::Cloud::VisionAI::V1::Corpus, ::Hash] - # Required. The corpus which replaces the resource on the server. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # The list of fields to be updated. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::VisionAI::V1::Corpus] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::VisionAI::V1::Corpus] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::Warehouse::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::UpdateCorpusRequest.new - # - # # Call the update_corpus method. - # result = client.update_corpus request - # - # # The returned object is of type Google::Cloud::VisionAI::V1::Corpus. - # p result - # - def update_corpus request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::UpdateCorpusRequest - - # Converts hash 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_corpus.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::VisionAI::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.corpus&.name - header_params["corpus.name"] = request.corpus.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_corpus.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_corpus.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @warehouse_stub.call_rpc :update_corpus, 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 all corpora in a project. - # - # @overload list_corpora(request, options = nil) - # Pass arguments to `list_corpora` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::ListCorporaRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::ListCorporaRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_corpora(parent: nil, page_size: nil, page_token: nil, filter: nil) - # Pass arguments to `list_corpora` via keyword arguments. Note that at - # least one keyword argument is 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 project from which to list corpora. - # @param page_size [::Integer] - # Requested page size. API may return fewer results than requested. - # If negative, INVALID_ARGUMENT error will be returned. - # If unspecified or 0, API will pick a default size, which is 10. - # If the requested page size is larger than the maximum size, API will pick - # use the maximum size, which is 20. - # @param page_token [::String] - # A token identifying a page of results for the server to return. - # Typically obtained via - # {::Google::Cloud::VisionAI::V1::ListCorporaResponse#next_page_token ListCorporaResponse.next_page_token} - # of the previous - # {::Google::Cloud::VisionAI::V1::Warehouse::Client#list_corpora Warehouse.ListCorpora} - # call. - # @param filter [::String] - # The filter applied to the returned corpora list. - # Only the following restrictions are supported: - # `type=`, - # `type!=`. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::VisionAI::V1::Corpus>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::VisionAI::V1::Corpus>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::Warehouse::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::ListCorporaRequest.new - # - # # Call the list_corpora method. - # result = client.list_corpora 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::VisionAI::V1::Corpus. - # p item - # end - # - def list_corpora request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::ListCorporaRequest - - # Converts hash 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_corpora.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::VisionAI::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_corpora.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_corpora.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @warehouse_stub.call_rpc :list_corpora, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @warehouse_stub, :list_corpora, 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 corpus only if its empty. - # Returns empty response. - # - # @overload delete_corpus(request, options = nil) - # Pass arguments to `delete_corpus` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::DeleteCorpusRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::DeleteCorpusRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_corpus(name: nil) - # Pass arguments to `delete_corpus` via keyword arguments. Note that at - # least one keyword argument is 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 corpus 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/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::Warehouse::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::DeleteCorpusRequest.new - # - # # Call the delete_corpus method. - # result = client.delete_corpus request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_corpus request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::DeleteCorpusRequest - - # Converts hash 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_corpus.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::VisionAI::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_corpus.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_corpus.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @warehouse_stub.call_rpc :delete_corpus, 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 - - ## - # Analyzes a corpus. - # - # @overload analyze_corpus(request, options = nil) - # Pass arguments to `analyze_corpus` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::AnalyzeCorpusRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::AnalyzeCorpusRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload analyze_corpus(name: nil) - # Pass arguments to `analyze_corpus` via keyword arguments. Note that at - # least one keyword argument is 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 parent corpus resource where the assets will be analyzed. - # Format: - # `projects/{project_number}/locations/{location_id}/corpora/{corpus_id}` - # - # @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/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::Warehouse::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::AnalyzeCorpusRequest.new - # - # # Call the analyze_corpus method. - # result = client.analyze_corpus 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 analyze_corpus request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::AnalyzeCorpusRequest - - # Converts hash 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.analyze_corpus.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::VisionAI::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.analyze_corpus.timeout, - metadata: metadata, - retry_policy: @config.rpcs.analyze_corpus.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @warehouse_stub.call_rpc :analyze_corpus, 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 data schema inside corpus. - # - # @overload create_data_schema(request, options = nil) - # Pass arguments to `create_data_schema` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::CreateDataSchemaRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::CreateDataSchemaRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_data_schema(parent: nil, data_schema: nil) - # Pass arguments to `create_data_schema` via keyword arguments. Note that at - # least one keyword argument is 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 parent resource where this data schema will be created. - # Format: - # `projects/{project_number}/locations/{location_id}/corpora/{corpus_id}` - # @param data_schema [::Google::Cloud::VisionAI::V1::DataSchema, ::Hash] - # Required. The data schema to create. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::VisionAI::V1::DataSchema] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::VisionAI::V1::DataSchema] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::Warehouse::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::CreateDataSchemaRequest.new - # - # # Call the create_data_schema method. - # result = client.create_data_schema request - # - # # The returned object is of type Google::Cloud::VisionAI::V1::DataSchema. - # p result - # - def create_data_schema request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::CreateDataSchemaRequest - - # Converts hash 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_data_schema.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::VisionAI::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_data_schema.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_data_schema.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @warehouse_stub.call_rpc :create_data_schema, 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 data schema inside corpus. - # - # @overload update_data_schema(request, options = nil) - # Pass arguments to `update_data_schema` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::UpdateDataSchemaRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::UpdateDataSchemaRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_data_schema(data_schema: nil, update_mask: nil) - # Pass arguments to `update_data_schema` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param data_schema [::Google::Cloud::VisionAI::V1::DataSchema, ::Hash] - # Required. The data schema's `name` field is used to identify the data - # schema to be updated. Format: - # `projects/{project_number}/locations/{location}/corpora/{corpus}/dataSchemas/{data_schema}` - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # The list of fields to be updated. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::VisionAI::V1::DataSchema] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::VisionAI::V1::DataSchema] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::Warehouse::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::UpdateDataSchemaRequest.new - # - # # Call the update_data_schema method. - # result = client.update_data_schema request - # - # # The returned object is of type Google::Cloud::VisionAI::V1::DataSchema. - # p result - # - def update_data_schema request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::UpdateDataSchemaRequest - - # Converts hash 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_data_schema.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::VisionAI::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.data_schema&.name - header_params["data_schema.name"] = request.data_schema.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_data_schema.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_data_schema.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @warehouse_stub.call_rpc :update_data_schema, 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 - - ## - # Gets data schema inside corpus. - # - # @overload get_data_schema(request, options = nil) - # Pass arguments to `get_data_schema` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::GetDataSchemaRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::GetDataSchemaRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_data_schema(name: nil) - # Pass arguments to `get_data_schema` via keyword arguments. Note that at - # least one keyword argument is 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 name of the data schema to retrieve. - # Format: - # `projects/{project_number}/locations/{location_id}/corpora/{corpus_id}/dataSchemas/{data_schema_id}` - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::VisionAI::V1::DataSchema] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::VisionAI::V1::DataSchema] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::Warehouse::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::GetDataSchemaRequest.new - # - # # Call the get_data_schema method. - # result = client.get_data_schema request - # - # # The returned object is of type Google::Cloud::VisionAI::V1::DataSchema. - # p result - # - def get_data_schema request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::GetDataSchemaRequest - - # Converts hash 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_data_schema.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::VisionAI::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_data_schema.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_data_schema.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @warehouse_stub.call_rpc :get_data_schema, 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 - - ## - # Deletes data schema inside corpus. - # - # @overload delete_data_schema(request, options = nil) - # Pass arguments to `delete_data_schema` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::DeleteDataSchemaRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::DeleteDataSchemaRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_data_schema(name: nil) - # Pass arguments to `delete_data_schema` via keyword arguments. Note that at - # least one keyword argument is 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 name of the data schema to delete. - # Format: - # `projects/{project_number}/locations/{location_id}/corpora/{corpus_id}/dataSchemas/{data_schema_id}` - # - # @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/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::Warehouse::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::DeleteDataSchemaRequest.new - # - # # Call the delete_data_schema method. - # result = client.delete_data_schema request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_data_schema request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::DeleteDataSchemaRequest - - # Converts hash 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_data_schema.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::VisionAI::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_data_schema.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_data_schema.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @warehouse_stub.call_rpc :delete_data_schema, 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 a list of data schemas inside corpus. - # - # @overload list_data_schemas(request, options = nil) - # Pass arguments to `list_data_schemas` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::ListDataSchemasRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::ListDataSchemasRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_data_schemas(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_data_schemas` via keyword arguments. Note that at - # least one keyword argument is 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 parent, which owns this collection of data schemas. - # Format: - # `projects/{project_number}/locations/{location_id}/corpora/{corpus_id}` - # @param page_size [::Integer] - # The maximum number of data schemas to return. The service may return fewer - # than this value. If unspecified, at most 50 data schemas will be returned. - # The maximum value is 1000; values above 1000 will be coerced to 1000. - # @param page_token [::String] - # A page token, received from a previous `ListDataSchemas` call. - # Provide this to retrieve the subsequent page. - # - # When paginating, all other parameters provided to `ListDataSchemas` must - # match the call that provided the page token. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::VisionAI::V1::DataSchema>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::VisionAI::V1::DataSchema>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::Warehouse::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::ListDataSchemasRequest.new - # - # # Call the list_data_schemas method. - # result = client.list_data_schemas 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::VisionAI::V1::DataSchema. - # p item - # end - # - def list_data_schemas request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::ListDataSchemasRequest - - # Converts hash 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_data_schemas.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::VisionAI::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_data_schemas.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_data_schemas.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @warehouse_stub.call_rpc :list_data_schemas, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @warehouse_stub, :list_data_schemas, 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 - - ## - # Creates annotation inside asset. - # - # @overload create_annotation(request, options = nil) - # Pass arguments to `create_annotation` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::CreateAnnotationRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::CreateAnnotationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_annotation(parent: nil, annotation: nil, annotation_id: nil) - # Pass arguments to `create_annotation` via keyword arguments. Note that at - # least one keyword argument is 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 parent resource where this annotation will be created. - # Format: - # `projects/{project_number}/locations/{location_id}/corpora/{corpus_id}/assets/{asset_id}` - # @param annotation [::Google::Cloud::VisionAI::V1::Annotation, ::Hash] - # Required. The annotation to create. - # @param annotation_id [::String] - # Optional. The ID to use for the annotation, which will become the final - # component of the annotation's resource name if user choose to specify. - # Otherwise, annotation id will be generated by system. - # - # This value should be up to 63 characters, and valid characters - # are /[a-z][0-9]-/. The first character must be a letter, the last could be - # a letter or a number. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::VisionAI::V1::Annotation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::VisionAI::V1::Annotation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::Warehouse::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::CreateAnnotationRequest.new - # - # # Call the create_annotation method. - # result = client.create_annotation request - # - # # The returned object is of type Google::Cloud::VisionAI::V1::Annotation. - # p result - # - def create_annotation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::CreateAnnotationRequest - - # Converts hash 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_annotation.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::VisionAI::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_annotation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_annotation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @warehouse_stub.call_rpc :create_annotation, 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 - - ## - # Reads annotation inside asset. - # - # @overload get_annotation(request, options = nil) - # Pass arguments to `get_annotation` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::GetAnnotationRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::GetAnnotationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_annotation(name: nil) - # Pass arguments to `get_annotation` via keyword arguments. Note that at - # least one keyword argument is 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 name of the annotation to retrieve. - # Format: - # `projects/{project_number}/locations/{location}/corpora/{corpus}/assets/{asset}/annotations/{annotation}` - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::VisionAI::V1::Annotation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::VisionAI::V1::Annotation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::Warehouse::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::GetAnnotationRequest.new - # - # # Call the get_annotation method. - # result = client.get_annotation request - # - # # The returned object is of type Google::Cloud::VisionAI::V1::Annotation. - # p result - # - def get_annotation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::GetAnnotationRequest - - # Converts hash 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_annotation.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::VisionAI::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_annotation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_annotation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @warehouse_stub.call_rpc :get_annotation, 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 a list of annotations inside asset. - # - # @overload list_annotations(request, options = nil) - # Pass arguments to `list_annotations` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::ListAnnotationsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::ListAnnotationsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_annotations(parent: nil, page_size: nil, page_token: nil, filter: nil) - # Pass arguments to `list_annotations` via keyword arguments. Note that at - # least one keyword argument is 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] - # The parent, which owns this collection of annotations. - # Format: - # `projects/{project_number}/locations/{location}/corpora/{corpus}/assets/{asset}` - # @param page_size [::Integer] - # The maximum number of annotations to return. The service may return fewer - # than this value. If unspecified, at most 50 annotations will be returned. - # The maximum value is 1000; values above 1000 will be coerced to 1000. - # @param page_token [::String] - # A page token, received from a previous `ListAnnotations` call. - # Provide this to retrieve the subsequent page. - # - # When paginating, all other parameters provided to `ListAnnotations` must - # match the call that provided the page token. - # @param filter [::String] - # The filter applied to the returned list. - # We only support filtering for the following fields: - # For corpus of STREAM_VIDEO type: - # `partition.temporal_partition.start_time`, - # `partition.temporal_partition.end_time`, and `key`. - # For corpus of VIDEO_ON_DEMAND type, - # `partition.relative_temporal_partition.start_offset`, - # `partition.relative_temporal_partition.end_offset`, and `key`. - # For corpus of IMAGE type, only `key` is supported. - # Timestamps are specified in the RFC-3339 format, and only one restriction - # may be applied per field, joined by conjunctions. - # Format: - # "partition.temporal_partition.start_time > "2012-04-21T11:30:00-04:00" AND - # partition.temporal_partition.end_time < "2012-04-22T11:30:00-04:00" AND - # key = "example_key"" - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::VisionAI::V1::Annotation>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::VisionAI::V1::Annotation>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::Warehouse::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::ListAnnotationsRequest.new - # - # # Call the list_annotations method. - # result = client.list_annotations 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::VisionAI::V1::Annotation. - # p item - # end - # - def list_annotations request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::ListAnnotationsRequest - - # Converts hash 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_annotations.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::VisionAI::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_annotations.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_annotations.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @warehouse_stub.call_rpc :list_annotations, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @warehouse_stub, :list_annotations, 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 - - ## - # Updates annotation inside asset. - # - # @overload update_annotation(request, options = nil) - # Pass arguments to `update_annotation` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::UpdateAnnotationRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::UpdateAnnotationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_annotation(annotation: nil, update_mask: nil) - # Pass arguments to `update_annotation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param annotation [::Google::Cloud::VisionAI::V1::Annotation, ::Hash] - # Required. The annotation to update. - # The annotation's `name` field is used to identify the annotation to be - # updated. Format: - # `projects/{project_number}/locations/{location}/corpora/{corpus}/assets/{asset}/annotations/{annotation}` - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # The list of fields to be updated. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::VisionAI::V1::Annotation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::VisionAI::V1::Annotation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::Warehouse::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::UpdateAnnotationRequest.new - # - # # Call the update_annotation method. - # result = client.update_annotation request - # - # # The returned object is of type Google::Cloud::VisionAI::V1::Annotation. - # p result - # - def update_annotation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::UpdateAnnotationRequest - - # Converts hash 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_annotation.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::VisionAI::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.annotation&.name - header_params["annotation.name"] = request.annotation.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_annotation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_annotation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @warehouse_stub.call_rpc :update_annotation, 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 - - ## - # Deletes annotation inside asset. - # - # @overload delete_annotation(request, options = nil) - # Pass arguments to `delete_annotation` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::DeleteAnnotationRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::DeleteAnnotationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_annotation(name: nil) - # Pass arguments to `delete_annotation` via keyword arguments. Note that at - # least one keyword argument is 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 name of the annotation to delete. - # Format: - # `projects/{project_number}/locations/{location}/corpora/{corpus}/assets/{asset}/annotations/{annotation}` - # - # @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/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::Warehouse::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::DeleteAnnotationRequest.new - # - # # Call the delete_annotation method. - # result = client.delete_annotation request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_annotation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::DeleteAnnotationRequest - - # Converts hash 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_annotation.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::VisionAI::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_annotation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_annotation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @warehouse_stub.call_rpc :delete_annotation, 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 - - ## - # Ingests data for the asset. It is not allowed to ingest a data chunk which - # is already expired according to TTL. - # This method is only available via the gRPC API (not HTTP since - # bi-directional streaming is not supported via HTTP). - # - # @param request [::Gapic::StreamInput, ::Enumerable<::Google::Cloud::VisionAI::V1::IngestAssetRequest, ::Hash>] - # An enumerable of {::Google::Cloud::VisionAI::V1::IngestAssetRequest} instances. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Enumerable<::Google::Cloud::VisionAI::V1::IngestAssetResponse>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Enumerable<::Google::Cloud::VisionAI::V1::IngestAssetResponse>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::Warehouse::Client.new - # - # # Create an input stream. - # input = Gapic::StreamInput.new - # - # # Call the ingest_asset method to start streaming. - # output = client.ingest_asset input - # - # # Send requests on the stream. For each request object, set fields by - # # passing keyword arguments. Be sure to close the stream when done. - # input << Google::Cloud::VisionAI::V1::IngestAssetRequest.new - # input << Google::Cloud::VisionAI::V1::IngestAssetRequest.new - # input.close - # - # # The returned object is a streamed enumerable yielding elements of type - # # ::Google::Cloud::VisionAI::V1::IngestAssetResponse - # output.each do |current_response| - # p current_response - # end - # - def ingest_asset request, options = nil - unless request.is_a? ::Enumerable - raise ::ArgumentError, "request must be an Enumerable" unless request.respond_to? :to_enum - request = request.to_enum - end - - request = request.lazy.map do |req| - ::Gapic::Protobuf.coerce req, to: ::Google::Cloud::VisionAI::V1::IngestAssetRequest - end - - # Converts hash 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.ingest_asset.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::VisionAI::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.ingest_asset.timeout, - metadata: metadata, - retry_policy: @config.rpcs.ingest_asset.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @warehouse_stub.call_rpc :ingest_asset, 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 - - ## - # Supported by STREAM_VIDEO corpus type. - # Generates clips for downloading. The api takes in a time range, and - # generates a clip of the first content available after start_time and - # before end_time, which may overflow beyond these bounds. - # Returned clips are truncated if the total size of the clips are larger - # than 100MB. - # - # @overload clip_asset(request, options = nil) - # Pass arguments to `clip_asset` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::ClipAssetRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::ClipAssetRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload clip_asset(name: nil, temporal_partition: nil) - # Pass arguments to `clip_asset` via keyword arguments. Note that at - # least one keyword argument is 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 asset to request clips for. - # Format: - # `projects/{project_number}/locations/{location_id}/corpora/{corpus_id}/assets/{asset_id}` - # @param temporal_partition [::Google::Cloud::VisionAI::V1::Partition::TemporalPartition, ::Hash] - # Required. The time range to request clips for. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::VisionAI::V1::ClipAssetResponse] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::VisionAI::V1::ClipAssetResponse] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::Warehouse::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::ClipAssetRequest.new - # - # # Call the clip_asset method. - # result = client.clip_asset request - # - # # The returned object is of type Google::Cloud::VisionAI::V1::ClipAssetResponse. - # p result - # - def clip_asset request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::ClipAssetRequest - - # Converts hash 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.clip_asset.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::VisionAI::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.clip_asset.timeout, - metadata: metadata, - retry_policy: @config.rpcs.clip_asset.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @warehouse_stub.call_rpc :clip_asset, 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 - - ## - # Generates a uri for an HLS manifest. The api takes in a collection of time - # ranges, and generates a URI for an HLS manifest that covers all the - # requested time ranges. - # - # @overload generate_hls_uri(request, options = nil) - # Pass arguments to `generate_hls_uri` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::GenerateHlsUriRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::GenerateHlsUriRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_hls_uri(name: nil, temporal_partitions: nil, live_view_enabled: nil) - # Pass arguments to `generate_hls_uri` via keyword arguments. Note that at - # least one keyword argument is 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 asset to request clips for. - # Format: - # `projects/{project_number}/locations/{location_id}/corpora/{corpus_id}/assets/{asset_id}` - # @param temporal_partitions [::Array<::Google::Cloud::VisionAI::V1::Partition::TemporalPartition, ::Hash>] - # The time range to request clips for. Will be ignored if `get_live_view` is - # set to True. The total time range requested should be smaller than 24h. - # @param live_view_enabled [::Boolean] - # Option to exclusively show a livestream of the asset with up to 3 minutes - # of backlog data. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::VisionAI::V1::GenerateHlsUriResponse] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::VisionAI::V1::GenerateHlsUriResponse] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::Warehouse::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::GenerateHlsUriRequest.new - # - # # Call the generate_hls_uri method. - # result = client.generate_hls_uri request - # - # # The returned object is of type Google::Cloud::VisionAI::V1::GenerateHlsUriResponse. - # p result - # - def generate_hls_uri request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::GenerateHlsUriRequest - - # Converts hash 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_hls_uri.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::VisionAI::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.generate_hls_uri.timeout, - metadata: metadata, - retry_policy: @config.rpcs.generate_hls_uri.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @warehouse_stub.call_rpc :generate_hls_uri, 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 - - ## - # Imports assets (images plus annotations) from a meta file on cloud storage. - # Each row in the meta file is corresponding to an image (specified by a - # cloud storage uri) and its annotations. - # - # @overload import_assets(request, options = nil) - # Pass arguments to `import_assets` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::ImportAssetsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::ImportAssetsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_assets(assets_gcs_uri: nil, parent: nil) - # Pass arguments to `import_assets` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param assets_gcs_uri [::String] - # The file contains all assets information to be imported. - # * The file is in JSONL format. - # * Each line corresponding to one asset. - # * Each line will be converted into InputImageAsset proto. - # @param parent [::String] - # Required. The parent corpus resource where the assets will be imported. - # Format: - # `projects/{project_number}/locations/{location_id}/corpora/{corpus_id}` - # - # @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/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::Warehouse::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::ImportAssetsRequest.new - # - # # Call the import_assets method. - # result = client.import_assets 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 import_assets request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::ImportAssetsRequest - - # Converts hash 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_assets.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::VisionAI::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_assets.timeout, - metadata: metadata, - retry_policy: @config.rpcs.import_assets.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @warehouse_stub.call_rpc :import_assets, 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 search configuration inside a corpus. - # - # Please follow the rules below to create a valid CreateSearchConfigRequest. - # --- General Rules --- - # 1. Request.search_config_id must not be associated with an existing - # SearchConfig. - # 2. Request must contain at least one non-empty search_criteria_property or - # facet_property. - # 3. mapped_fields must not be empty, and must map to existing UGA keys. - # 4. All mapped_fields must be of the same type. - # 5. All mapped_fields must share the same granularity. - # 6. All mapped_fields must share the same semantic SearchConfig match - # options. - # For property-specific rules, please reference the comments for - # FacetProperty and SearchCriteriaProperty. - # - # @overload create_search_config(request, options = nil) - # Pass arguments to `create_search_config` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::CreateSearchConfigRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::CreateSearchConfigRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_search_config(parent: nil, search_config: nil, search_config_id: nil) - # Pass arguments to `create_search_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. The parent resource where this search configuration will be - # created. Format: - # `projects/{project_number}/locations/{location_id}/corpora/{corpus_id}` - # @param search_config [::Google::Cloud::VisionAI::V1::SearchConfig, ::Hash] - # Required. The search config to create. - # @param search_config_id [::String] - # Required. ID to use for the new search config. Will become the final - # component of the SearchConfig's resource name. This value should be up to - # 63 characters, and valid characters are /[a-z][0-9]-_/. The first character - # must be a letter, the last could be a letter or a number. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::VisionAI::V1::SearchConfig] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::VisionAI::V1::SearchConfig] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::Warehouse::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::CreateSearchConfigRequest.new - # - # # Call the create_search_config method. - # result = client.create_search_config request - # - # # The returned object is of type Google::Cloud::VisionAI::V1::SearchConfig. - # p result - # - def create_search_config request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::CreateSearchConfigRequest - - # Converts hash 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_search_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::VisionAI::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_search_config.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_search_config.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @warehouse_stub.call_rpc :create_search_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 a search configuration inside a corpus. - # - # Please follow the rules below to create a valid UpdateSearchConfigRequest. - # --- General Rules --- - # 1. Request.search_configuration.name must already exist. - # 2. Request must contain at least one non-empty search_criteria_property or - # facet_property. - # 3. mapped_fields must not be empty, and must map to existing UGA keys. - # 4. All mapped_fields must be of the same type. - # 5. All mapped_fields must share the same granularity. - # 6. All mapped_fields must share the same semantic SearchConfig match - # options. - # For property-specific rules, please reference the comments for - # FacetProperty and SearchCriteriaProperty. - # - # @overload update_search_config(request, options = nil) - # Pass arguments to `update_search_config` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::UpdateSearchConfigRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::UpdateSearchConfigRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_search_config(search_config: nil, update_mask: nil) - # Pass arguments to `update_search_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 search_config [::Google::Cloud::VisionAI::V1::SearchConfig, ::Hash] - # Required. The search configuration to update. - # - # The search configuration's `name` field is used to identify the resource to - # be updated. Format: - # `projects/{project_number}/locations/{location}/corpora/{corpus}/searchConfigs/{search_config}` - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # The list of fields to be updated. If left unset, all field paths will be - # updated/overwritten. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::VisionAI::V1::SearchConfig] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::VisionAI::V1::SearchConfig] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::Warehouse::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::UpdateSearchConfigRequest.new - # - # # Call the update_search_config method. - # result = client.update_search_config request - # - # # The returned object is of type Google::Cloud::VisionAI::V1::SearchConfig. - # p result - # - def update_search_config request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::UpdateSearchConfigRequest - - # Converts hash 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_search_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::VisionAI::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.search_config&.name - header_params["search_config.name"] = request.search_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_search_config.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_search_config.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @warehouse_stub.call_rpc :update_search_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 - - ## - # Gets a search configuration inside a corpus. - # - # @overload get_search_config(request, options = nil) - # Pass arguments to `get_search_config` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::GetSearchConfigRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::GetSearchConfigRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_search_config(name: nil) - # Pass arguments to `get_search_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 name of the search configuration to retrieve. - # Format: - # `projects/{project_number}/locations/{location}/corpora/{corpus}/searchConfigs/{search_config}` - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::VisionAI::V1::SearchConfig] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::VisionAI::V1::SearchConfig] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::Warehouse::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::GetSearchConfigRequest.new - # - # # Call the get_search_config method. - # result = client.get_search_config request - # - # # The returned object is of type Google::Cloud::VisionAI::V1::SearchConfig. - # p result - # - def get_search_config request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::GetSearchConfigRequest - - # Converts hash 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_search_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::VisionAI::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_search_config.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_search_config.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @warehouse_stub.call_rpc :get_search_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 - - ## - # Deletes a search configuration inside a corpus. - # - # For a DeleteSearchConfigRequest to be valid, - # Request.search_configuration.name must already exist. - # - # @overload delete_search_config(request, options = nil) - # Pass arguments to `delete_search_config` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::DeleteSearchConfigRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::DeleteSearchConfigRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_search_config(name: nil) - # Pass arguments to `delete_search_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 name of the search configuration to delete. - # Format: - # `projects/{project_number}/locations/{location}/corpora/{corpus}/searchConfigs/{search_config}` - # - # @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/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::Warehouse::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::DeleteSearchConfigRequest.new - # - # # Call the delete_search_config method. - # result = client.delete_search_config request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_search_config request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::DeleteSearchConfigRequest - - # Converts hash 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_search_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::VisionAI::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_search_config.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_search_config.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @warehouse_stub.call_rpc :delete_search_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 - - ## - # Lists all search configurations inside a corpus. - # - # @overload list_search_configs(request, options = nil) - # Pass arguments to `list_search_configs` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::ListSearchConfigsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::ListSearchConfigsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_search_configs(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_search_configs` via keyword arguments. Note that at - # least one keyword argument is 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 parent, which owns this collection of search configurations. - # Format: - # `projects/{project_number}/locations/{location}/corpora/{corpus}` - # @param page_size [::Integer] - # The maximum number of search configurations to return. The service may - # return fewer than this value. If unspecified, a page size of 50 will be - # used. The maximum value is 1000; values above 1000 will be coerced to 1000. - # @param page_token [::String] - # A page token, received from a previous `ListSearchConfigs` call. - # Provide this to retrieve the subsequent page. - # - # When paginating, all other parameters provided to - # `ListSearchConfigs` must match the call that provided the page - # token. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::VisionAI::V1::SearchConfig>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::VisionAI::V1::SearchConfig>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::Warehouse::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::ListSearchConfigsRequest.new - # - # # Call the list_search_configs method. - # result = client.list_search_configs 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::VisionAI::V1::SearchConfig. - # p item - # end - # - def list_search_configs request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::ListSearchConfigsRequest - - # Converts hash 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_search_configs.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::VisionAI::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_search_configs.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_search_configs.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @warehouse_stub.call_rpc :list_search_configs, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @warehouse_stub, :list_search_configs, 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 - - ## - # Creates a SearchHypernym inside a corpus. - # - # @overload create_search_hypernym(request, options = nil) - # Pass arguments to `create_search_hypernym` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::CreateSearchHypernymRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::CreateSearchHypernymRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_search_hypernym(parent: nil, search_hypernym: nil, search_hypernym_id: nil) - # Pass arguments to `create_search_hypernym` via keyword arguments. Note that at - # least one keyword argument is 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 parent resource where this SearchHypernym will be created. - # Format: `projects/{project_number}/locations/{location}/corpora/{corpus}` - # @param search_hypernym [::Google::Cloud::VisionAI::V1::SearchHypernym, ::Hash] - # Required. The SearchHypernym to create. - # @param search_hypernym_id [::String] - # Optional. The search hypernym id. - # If omitted, a random UUID will be generated. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::VisionAI::V1::SearchHypernym] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::VisionAI::V1::SearchHypernym] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::Warehouse::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::CreateSearchHypernymRequest.new - # - # # Call the create_search_hypernym method. - # result = client.create_search_hypernym request - # - # # The returned object is of type Google::Cloud::VisionAI::V1::SearchHypernym. - # p result - # - def create_search_hypernym request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::CreateSearchHypernymRequest - - # Converts hash 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_search_hypernym.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::VisionAI::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_search_hypernym.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_search_hypernym.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @warehouse_stub.call_rpc :create_search_hypernym, 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 a SearchHypernym inside a corpus. - # - # @overload update_search_hypernym(request, options = nil) - # Pass arguments to `update_search_hypernym` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::UpdateSearchHypernymRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::UpdateSearchHypernymRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_search_hypernym(search_hypernym: nil, update_mask: nil) - # Pass arguments to `update_search_hypernym` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param search_hypernym [::Google::Cloud::VisionAI::V1::SearchHypernym, ::Hash] - # Required. The SearchHypernym to update. - # The search hypernym's `name` field is used to identify the search hypernym - # to be updated. Format: - # `projects/{project_number}/locations/{location}/corpora/{corpus}/searchHypernyms/{search_hypernym}` - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # The list of fields to be updated. If left unset, all field paths will be - # updated/overwritten. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::VisionAI::V1::SearchHypernym] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::VisionAI::V1::SearchHypernym] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::Warehouse::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::UpdateSearchHypernymRequest.new - # - # # Call the update_search_hypernym method. - # result = client.update_search_hypernym request - # - # # The returned object is of type Google::Cloud::VisionAI::V1::SearchHypernym. - # p result - # - def update_search_hypernym request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::UpdateSearchHypernymRequest - - # Converts hash 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_search_hypernym.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::VisionAI::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.search_hypernym&.name - header_params["search_hypernym.name"] = request.search_hypernym.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_search_hypernym.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_search_hypernym.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @warehouse_stub.call_rpc :update_search_hypernym, 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 - - ## - # Gets a SearchHypernym inside a corpus. - # - # @overload get_search_hypernym(request, options = nil) - # Pass arguments to `get_search_hypernym` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::GetSearchHypernymRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::GetSearchHypernymRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_search_hypernym(name: nil) - # Pass arguments to `get_search_hypernym` via keyword arguments. Note that at - # least one keyword argument is 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 name of the SearchHypernym to retrieve. - # Format: - # `projects/{project_number}/locations/{location}/corpora/{corpus}/searchHypernyms/{search_hypernym}` - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::VisionAI::V1::SearchHypernym] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::VisionAI::V1::SearchHypernym] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::Warehouse::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::GetSearchHypernymRequest.new - # - # # Call the get_search_hypernym method. - # result = client.get_search_hypernym request - # - # # The returned object is of type Google::Cloud::VisionAI::V1::SearchHypernym. - # p result - # - def get_search_hypernym request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::GetSearchHypernymRequest - - # Converts hash 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_search_hypernym.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::VisionAI::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_search_hypernym.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_search_hypernym.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @warehouse_stub.call_rpc :get_search_hypernym, 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 - - ## - # Deletes a SearchHypernym inside a corpus. - # - # @overload delete_search_hypernym(request, options = nil) - # Pass arguments to `delete_search_hypernym` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::DeleteSearchHypernymRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::DeleteSearchHypernymRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_search_hypernym(name: nil) - # Pass arguments to `delete_search_hypernym` via keyword arguments. Note that at - # least one keyword argument is 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 name of the SearchHypernym to delete. - # Format: - # `projects/{project_number}/locations/{location}/corpora/{corpus}/searchHypernyms/{search_hypernym}` - # - # @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/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::Warehouse::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::DeleteSearchHypernymRequest.new - # - # # Call the delete_search_hypernym method. - # result = client.delete_search_hypernym request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_search_hypernym request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::DeleteSearchHypernymRequest - - # Converts hash 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_search_hypernym.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::VisionAI::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_search_hypernym.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_search_hypernym.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @warehouse_stub.call_rpc :delete_search_hypernym, 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 SearchHypernyms inside a corpus. - # - # @overload list_search_hypernyms(request, options = nil) - # Pass arguments to `list_search_hypernyms` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::ListSearchHypernymsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::ListSearchHypernymsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_search_hypernyms(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_search_hypernyms` via keyword arguments. Note that at - # least one keyword argument is 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 parent, which owns this collection of SearchHypernyms. - # Format: - # `projects/{project_number}/locations/{location}/corpora/{corpus}` - # @param page_size [::Integer] - # The maximum number of SearchHypernyms returned. The service may - # return fewer than this value. If unspecified, a page size of 50 will be - # used. The maximum value is 1000; values above 1000 will be coerced to 1000. - # @param page_token [::String] - # A page token, received from a previous `SearchHypernym` call. - # Provide this to retrieve the subsequent page. - # - # When paginating, all other parameters provided to - # `SearchHypernym` must match the call that provided the page - # token. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::VisionAI::V1::SearchHypernym>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::VisionAI::V1::SearchHypernym>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::Warehouse::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::ListSearchHypernymsRequest.new - # - # # Call the list_search_hypernyms method. - # result = client.list_search_hypernyms 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::VisionAI::V1::SearchHypernym. - # p item - # end - # - def list_search_hypernyms request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::ListSearchHypernymsRequest - - # Converts hash 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_search_hypernyms.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::VisionAI::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_search_hypernyms.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_search_hypernyms.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @warehouse_stub.call_rpc :list_search_hypernyms, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @warehouse_stub, :list_search_hypernyms, 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 - - ## - # Search media asset. - # - # @overload search_assets(request, options = nil) - # Pass arguments to `search_assets` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::SearchAssetsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::SearchAssetsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload search_assets(schema_key_sorting_strategy: nil, corpus: nil, page_size: nil, page_token: nil, content_time_ranges: nil, criteria: nil, facet_selections: nil, result_annotation_keys: nil, search_query: nil) - # Pass arguments to `search_assets` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param schema_key_sorting_strategy [::Google::Cloud::VisionAI::V1::SchemaKeySortingStrategy, ::Hash] - # Sort by the value under the data schema key. - # @param corpus [::String] - # Required. The parent corpus to search. - # Format: `projects/{project_id}/locations/{location_id}/corpora/{corpus_id}' - # @param page_size [::Integer] - # The number of results to be returned in this page. If it's 0, the server - # will decide the appropriate page_size. - # @param page_token [::String] - # The continuation token to fetch the next page. If empty, it means it is - # fetching the first page. - # @param content_time_ranges [::Google::Cloud::VisionAI::V1::DateTimeRangeArray, ::Hash] - # Time ranges that matching video content must fall within. If no ranges are - # provided, there will be no time restriction. This field is treated just - # like the criteria below, but defined separately for convenience as it is - # used frequently. Note that if the end_time is in the future, it will be - # clamped to the time the request was received. - # @param criteria [::Array<::Google::Cloud::VisionAI::V1::Criteria, ::Hash>] - # Criteria applied to search results. - # @param facet_selections [::Array<::Google::Cloud::VisionAI::V1::FacetGroup, ::Hash>] - # Stores most recent facet selection state. Only facet groups with user's - # selection will be presented here. Selection state is either selected or - # unselected. Only selected facet buckets will be used as search criteria. - # @param result_annotation_keys [::Array<::String>] - # A list of annotation keys to specify the annotations to be retrieved and - # returned with each search result. - # Annotation granularity must be GRANULARITY_ASSET_LEVEL and its search - # strategy must not be NO_SEARCH. - # @param search_query [::String] - # Global search query. Allows user to search assets without needing to - # specify which field the value belongs to. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::VisionAI::V1::SearchResultItem>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::VisionAI::V1::SearchResultItem>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::Warehouse::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::SearchAssetsRequest.new - # - # # Call the search_assets method. - # result = client.search_assets 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::VisionAI::V1::SearchResultItem. - # p item - # end - # - def search_assets request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::SearchAssetsRequest - - # Converts hash 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.search_assets.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::VisionAI::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.corpus - header_params["corpus"] = request.corpus - 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.search_assets.timeout, - metadata: metadata, - retry_policy: @config.rpcs.search_assets.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @warehouse_stub.call_rpc :search_assets, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @warehouse_stub, :search_assets, 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 - - ## - # Search a deployed index endpoint (IMAGE corpus type only). - # - # @overload search_index_endpoint(request, options = nil) - # Pass arguments to `search_index_endpoint` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::SearchIndexEndpointRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::SearchIndexEndpointRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload search_index_endpoint(image_query: nil, text_query: nil, index_endpoint: nil, criteria: nil, exclusion_criteria: nil, page_size: nil, page_token: nil) - # Pass arguments to `search_index_endpoint` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param image_query [::Google::Cloud::VisionAI::V1::ImageQuery, ::Hash] - # An image-only query. - # - # Note: The following parameters are mutually exclusive: `image_query`, `text_query`. 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 text_query [::String] - # A text-only query. - # - # Note: The following parameters are mutually exclusive: `text_query`, `image_query`. 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 index_endpoint [::String] - # Required. The index endpoint to search. - # Format: - # `projects/{project_id}/locations/{location_id}/indexEndpoints/{index_endpoint_id}' - # @param criteria [::Array<::Google::Cloud::VisionAI::V1::Criteria, ::Hash>] - # Criteria applied to search results. - # @param exclusion_criteria [::Array<::Google::Cloud::VisionAI::V1::Criteria, ::Hash>] - # Criteria to exclude from search results. - # Note that `fetch_matched_annotations` will be ignored. - # @param page_size [::Integer] - # Requested page size. API may return fewer results than requested. - # If negative, INVALID_ARGUMENT error will be returned. - # If unspecified or 0, API will pick a default size, which is 10. - # If the requested page size is larger than the maximum size, API will pick - # the maximum size, which is 200. - # @param page_token [::String] - # The continuation token to fetch the next page. If empty, it means it is - # fetching the first page. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::VisionAI::V1::SearchResultItem>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::VisionAI::V1::SearchResultItem>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::Warehouse::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::SearchIndexEndpointRequest.new - # - # # Call the search_index_endpoint method. - # result = client.search_index_endpoint 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::VisionAI::V1::SearchResultItem. - # p item - # end - # - def search_index_endpoint request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::SearchIndexEndpointRequest - - # Converts hash 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.search_index_endpoint.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::VisionAI::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.index_endpoint - header_params["index_endpoint"] = request.index_endpoint - 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.search_index_endpoint.timeout, - metadata: metadata, - retry_policy: @config.rpcs.search_index_endpoint.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @warehouse_stub.call_rpc :search_index_endpoint, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @warehouse_stub, :search_index_endpoint, 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 - - ## - # Creates an IndexEndpoint. - # - # @overload create_index_endpoint(request, options = nil) - # Pass arguments to `create_index_endpoint` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::CreateIndexEndpointRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::CreateIndexEndpointRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_index_endpoint(parent: nil, index_endpoint_id: nil, index_endpoint: nil) - # Pass arguments to `create_index_endpoint` via keyword arguments. Note that at - # least one keyword argument is 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. Format: `projects/{project}/locations/{location}` - # @param index_endpoint_id [::String] - # Optional. The ID to use for the IndexEndpoint, which will become the final - # component of the IndexEndpoint's resource name if the user specifies it. - # Otherwise, IndexEndpoint id will be autogenerated. - # - # This value should be up to 63 characters, and valid characters - # are a-z, 0-9 and dash (-). The first character must be a letter, the last - # must be a letter or a number. - # @param index_endpoint [::Google::Cloud::VisionAI::V1::IndexEndpoint, ::Hash] - # Required. The resource being created. - # - # @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/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::Warehouse::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::CreateIndexEndpointRequest.new - # - # # Call the create_index_endpoint method. - # result = client.create_index_endpoint 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_index_endpoint request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::CreateIndexEndpointRequest - - # Converts hash 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_index_endpoint.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::VisionAI::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_index_endpoint.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_index_endpoint.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @warehouse_stub.call_rpc :create_index_endpoint, 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 - - ## - # Gets an IndexEndpoint. - # - # @overload get_index_endpoint(request, options = nil) - # Pass arguments to `get_index_endpoint` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::GetIndexEndpointRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::GetIndexEndpointRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_index_endpoint(name: nil) - # Pass arguments to `get_index_endpoint` via keyword arguments. Note that at - # least one keyword argument is 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 IndexEndpoint resource. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::VisionAI::V1::IndexEndpoint] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::VisionAI::V1::IndexEndpoint] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::Warehouse::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::GetIndexEndpointRequest.new - # - # # Call the get_index_endpoint method. - # result = client.get_index_endpoint request - # - # # The returned object is of type Google::Cloud::VisionAI::V1::IndexEndpoint. - # p result - # - def get_index_endpoint request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::GetIndexEndpointRequest - - # Converts hash 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_index_endpoint.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::VisionAI::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_index_endpoint.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_index_endpoint.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @warehouse_stub.call_rpc :get_index_endpoint, 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 all IndexEndpoints in a project. - # - # @overload list_index_endpoints(request, options = nil) - # Pass arguments to `list_index_endpoints` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::ListIndexEndpointsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::ListIndexEndpointsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_index_endpoints(parent: nil, page_size: nil, page_token: nil, filter: nil) - # Pass arguments to `list_index_endpoints` via keyword arguments. Note that at - # least one keyword argument is 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. Format: `projects/{project}/locations/{location}` - # @param page_size [::Integer] - # Optional. Requested page size. Server may return fewer items than - # requested. The service may return fewer than this value. If unspecified, a - # page size of 50 will be used. The maximum value is 1000; values above 1000 - # will be coerced to 1000. - # @param page_token [::String] - # Optional. A token identifying a page of results the server should return. - # @param filter [::String] - # Optional. The filter applied to the returned list. - # We only support filtering for the `deployed_image_index.image_index` field. - # However, to filter by a corpus instead of an image index, simply use - # `deployed_image_index.corpus`, which will return all endpoints with - # `deployed_image_index.image_index` inside of the given corpus. - # A basic filter on image index would look like: - # deployed_image_index.image_index = - # "projects/123/locations/us-central1/corpora/my_corpus/imageIndexes/my_image_index" - # A basic filter on corpus would look like: - # deployed_image_index.corpus = - # "projects/123/locations/us-central1/corpora/my_corpus" - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::VisionAI::V1::IndexEndpoint>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::VisionAI::V1::IndexEndpoint>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::Warehouse::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::ListIndexEndpointsRequest.new - # - # # Call the list_index_endpoints method. - # result = client.list_index_endpoints 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::VisionAI::V1::IndexEndpoint. - # p item - # end - # - def list_index_endpoints request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::ListIndexEndpointsRequest - - # Converts hash 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_index_endpoints.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::VisionAI::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_index_endpoints.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_index_endpoints.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @warehouse_stub.call_rpc :list_index_endpoints, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @warehouse_stub, :list_index_endpoints, 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 - - ## - # Updates an IndexEndpoint. - # - # @overload update_index_endpoint(request, options = nil) - # Pass arguments to `update_index_endpoint` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::UpdateIndexEndpointRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::UpdateIndexEndpointRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_index_endpoint(index_endpoint: nil, update_mask: nil) - # Pass arguments to `update_index_endpoint` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param index_endpoint [::Google::Cloud::VisionAI::V1::IndexEndpoint, ::Hash] - # Required. The resource being updated. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Required. Field mask is used to specify the fields to be overwritten in the - # IndexEndpoint resource by the update. - # The fields specified in the update_mask are relative to the resource, not - # the full request. - # A field of the resource will be overwritten if it is in the mask. - # Empty field mask is not allowed. - # If the mask is "*", then this is a full replacement of the 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/cloud/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::Warehouse::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::UpdateIndexEndpointRequest.new - # - # # Call the update_index_endpoint method. - # result = client.update_index_endpoint 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 update_index_endpoint request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::UpdateIndexEndpointRequest - - # Converts hash 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_index_endpoint.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::VisionAI::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.index_endpoint&.name - header_params["index_endpoint.name"] = request.index_endpoint.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_index_endpoint.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_index_endpoint.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @warehouse_stub.call_rpc :update_index_endpoint, 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 an IndexEndpoint. - # - # @overload delete_index_endpoint(request, options = nil) - # Pass arguments to `delete_index_endpoint` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::DeleteIndexEndpointRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::DeleteIndexEndpointRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_index_endpoint(name: nil) - # Pass arguments to `delete_index_endpoint` via keyword arguments. Note that at - # least one keyword argument is 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 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/cloud/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::Warehouse::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::DeleteIndexEndpointRequest.new - # - # # Call the delete_index_endpoint method. - # result = client.delete_index_endpoint 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_index_endpoint request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::DeleteIndexEndpointRequest - - # Converts hash 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_index_endpoint.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::VisionAI::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_index_endpoint.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_index_endpoint.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @warehouse_stub.call_rpc :delete_index_endpoint, 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 - - ## - # Deploys an Index to IndexEndpoint. - # - # @overload deploy_index(request, options = nil) - # Pass arguments to `deploy_index` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::DeployIndexRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::DeployIndexRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload deploy_index(index_endpoint: nil, deployed_index: nil) - # Pass arguments to `deploy_index` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param index_endpoint [::String] - # Required. IndexEndpoint the index is deployed to. - # Format: - # `projects/{project}/locations/{location}/indexEndpoints/{index_endpoint}` - # @param deployed_index [::Google::Cloud::VisionAI::V1::DeployedIndex, ::Hash] - # Required. Index to deploy. - # - # @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/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::Warehouse::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::DeployIndexRequest.new - # - # # Call the deploy_index method. - # result = client.deploy_index 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 deploy_index request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::DeployIndexRequest - - # Converts hash 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.deploy_index.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::VisionAI::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.index_endpoint - header_params["index_endpoint"] = request.index_endpoint - 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.deploy_index.timeout, - metadata: metadata, - retry_policy: @config.rpcs.deploy_index.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @warehouse_stub.call_rpc :deploy_index, 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 - - ## - # Undeploys an Index from IndexEndpoint. - # - # @overload undeploy_index(request, options = nil) - # Pass arguments to `undeploy_index` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::UndeployIndexRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::UndeployIndexRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload undeploy_index(index_endpoint: nil) - # Pass arguments to `undeploy_index` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param index_endpoint [::String] - # Required. Resource name of the IndexEndpoint resource on which the - # undeployment will act. Format: - # `projects/{project}/locations/{location}/indexEndpoints/{index_endpoint}` - # - # @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/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::Warehouse::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::UndeployIndexRequest.new - # - # # Call the undeploy_index method. - # result = client.undeploy_index 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 undeploy_index request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::UndeployIndexRequest - - # Converts hash 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.undeploy_index.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::VisionAI::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.index_endpoint - header_params["index_endpoint"] = request.index_endpoint - 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.undeploy_index.timeout, - metadata: metadata, - retry_policy: @config.rpcs.undeploy_index.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @warehouse_stub.call_rpc :undeploy_index, 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 collection. - # - # @overload create_collection(request, options = nil) - # Pass arguments to `create_collection` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::CreateCollectionRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::CreateCollectionRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_collection(parent: nil, collection: nil, collection_id: nil) - # Pass arguments to `create_collection` via keyword arguments. Note that at - # least one keyword argument is 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 parent resource where this collection will be created. - # Format: `projects/{project_number}/locations/{location}/corpora/{corpus}` - # @param collection [::Google::Cloud::VisionAI::V1::Collection, ::Hash] - # Required. The collection resource to be created. - # @param collection_id [::String] - # Optional. The ID to use for the collection, which will become the final - # component of the resource name if user choose to specify. Otherwise, - # collection id will be generated by system. - # - # This value should be up to 55 characters, and valid characters - # are /[a-z][0-9]-/. The first character must be a letter, the last could be - # a letter or a number. - # - # @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/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::Warehouse::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::CreateCollectionRequest.new - # - # # Call the create_collection method. - # result = client.create_collection 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_collection request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::CreateCollectionRequest - - # Converts hash 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_collection.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::VisionAI::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_collection.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_collection.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @warehouse_stub.call_rpc :create_collection, 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 collection. - # - # @overload delete_collection(request, options = nil) - # Pass arguments to `delete_collection` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::DeleteCollectionRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::DeleteCollectionRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_collection(name: nil) - # Pass arguments to `delete_collection` via keyword arguments. Note that at - # least one keyword argument is 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 name of the collection to delete. Format: - # `projects/{project_number}/locations/{location}/corpora/{corpus}/collections/{collection}` - # - # @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/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::Warehouse::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::DeleteCollectionRequest.new - # - # # Call the delete_collection method. - # result = client.delete_collection 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_collection request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::DeleteCollectionRequest - - # Converts hash 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_collection.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::VisionAI::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_collection.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_collection.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @warehouse_stub.call_rpc :delete_collection, 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 - - ## - # Gets a collection. - # - # @overload get_collection(request, options = nil) - # Pass arguments to `get_collection` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::GetCollectionRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::GetCollectionRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_collection(name: nil) - # Pass arguments to `get_collection` via keyword arguments. Note that at - # least one keyword argument is 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 name of the collection to retrieve. Format: - # `projects/{project_number}/locations/{location}/corpora/{corpus}/collections/{collection}` - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::VisionAI::V1::Collection] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::VisionAI::V1::Collection] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::Warehouse::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::GetCollectionRequest.new - # - # # Call the get_collection method. - # result = client.get_collection request - # - # # The returned object is of type Google::Cloud::VisionAI::V1::Collection. - # p result - # - def get_collection request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::GetCollectionRequest - - # Converts hash 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_collection.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::VisionAI::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_collection.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_collection.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @warehouse_stub.call_rpc :get_collection, 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 a collection. - # - # @overload update_collection(request, options = nil) - # Pass arguments to `update_collection` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::UpdateCollectionRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::UpdateCollectionRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_collection(collection: nil, update_mask: nil) - # Pass arguments to `update_collection` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param collection [::Google::Cloud::VisionAI::V1::Collection, ::Hash] - # Required. The collection to update. - # - # The collection's `name` field is used to identify the collection to be - # updated. Format: - # `projects/{project_number}/locations/{location}/corpora/{corpus}/collections/{collection}` - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # The list of fields to be updated. - # - Unset `update_mask` or set `update_mask` to be a single "*" only will - # update all updatable fields with the value provided in `collection`. - # - To update `display_name` value to empty string, set it in the - # `collection` - # to empty string, and set `update_mask` with "display_name". Same applies - # to other updatable string fields in the `collection`. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::VisionAI::V1::Collection] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::VisionAI::V1::Collection] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::Warehouse::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::UpdateCollectionRequest.new - # - # # Call the update_collection method. - # result = client.update_collection request - # - # # The returned object is of type Google::Cloud::VisionAI::V1::Collection. - # p result - # - def update_collection request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::UpdateCollectionRequest - - # Converts hash 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_collection.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::VisionAI::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.collection&.name - header_params["collection.name"] = request.collection.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_collection.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_collection.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @warehouse_stub.call_rpc :update_collection, 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 collections inside a corpus. - # - # @overload list_collections(request, options = nil) - # Pass arguments to `list_collections` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::ListCollectionsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::ListCollectionsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_collections(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_collections` via keyword arguments. Note that at - # least one keyword argument is 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 parent corpus. Format: - # `projects/{project_number}/locations/{location}/corpora/{corpus}` - # @param page_size [::Integer] - # The maximum number of collections to return. The service may return fewer - # than this value. If unspecified, at most 50 collections will be returned. - # The maximum value is 1000; values above 1000 will be coerced to 1000. - # @param page_token [::String] - # A page token, received from a previous `ListCollectionsRequest` call. - # Provide this to retrieve the subsequent page. - # - # When paginating, all other parameters provided to `ListCollectionsRequest` - # must match the call that provided the page token. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::VisionAI::V1::Collection>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::VisionAI::V1::Collection>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::Warehouse::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::ListCollectionsRequest.new - # - # # Call the list_collections method. - # result = client.list_collections 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::VisionAI::V1::Collection. - # p item - # end - # - def list_collections request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::ListCollectionsRequest - - # Converts hash 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_collections.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::VisionAI::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_collections.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_collections.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @warehouse_stub.call_rpc :list_collections, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @warehouse_stub, :list_collections, 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 - - ## - # Adds an item into a Collection. - # - # @overload add_collection_item(request, options = nil) - # Pass arguments to `add_collection_item` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::AddCollectionItemRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::AddCollectionItemRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload add_collection_item(item: nil) - # Pass arguments to `add_collection_item` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param item [::Google::Cloud::VisionAI::V1::CollectionItem, ::Hash] - # Required. The item to be added. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::VisionAI::V1::AddCollectionItemResponse] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::VisionAI::V1::AddCollectionItemResponse] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::Warehouse::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::AddCollectionItemRequest.new - # - # # Call the add_collection_item method. - # result = client.add_collection_item request - # - # # The returned object is of type Google::Cloud::VisionAI::V1::AddCollectionItemResponse. - # p result - # - def add_collection_item request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::AddCollectionItemRequest - - # Converts hash 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.add_collection_item.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::VisionAI::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.item&.collection - header_params["item.collection"] = request.item.collection - 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.add_collection_item.timeout, - metadata: metadata, - retry_policy: @config.rpcs.add_collection_item.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @warehouse_stub.call_rpc :add_collection_item, 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 - - ## - # Removes an item from a collection. - # - # @overload remove_collection_item(request, options = nil) - # Pass arguments to `remove_collection_item` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::RemoveCollectionItemRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::RemoveCollectionItemRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload remove_collection_item(item: nil) - # Pass arguments to `remove_collection_item` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param item [::Google::Cloud::VisionAI::V1::CollectionItem, ::Hash] - # Required. The item to be removed. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::VisionAI::V1::RemoveCollectionItemResponse] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::VisionAI::V1::RemoveCollectionItemResponse] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::Warehouse::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::RemoveCollectionItemRequest.new - # - # # Call the remove_collection_item method. - # result = client.remove_collection_item request - # - # # The returned object is of type Google::Cloud::VisionAI::V1::RemoveCollectionItemResponse. - # p result - # - def remove_collection_item request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::RemoveCollectionItemRequest - - # Converts hash 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.remove_collection_item.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::VisionAI::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.item&.collection - header_params["item.collection"] = request.item.collection - 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.remove_collection_item.timeout, - metadata: metadata, - retry_policy: @config.rpcs.remove_collection_item.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @warehouse_stub.call_rpc :remove_collection_item, 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 - - ## - # View items inside a collection. - # - # @overload view_collection_items(request, options = nil) - # Pass arguments to `view_collection_items` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::ViewCollectionItemsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::ViewCollectionItemsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload view_collection_items(collection: nil, page_size: nil, page_token: nil) - # Pass arguments to `view_collection_items` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param collection [::String] - # Required. The collection to view. Format: - # `projects/{project_number}/locations/{location}/corpora/{corpus}/collections/{collection}` - # @param page_size [::Integer] - # The maximum number of collections to return. The service may return fewer - # than this value. If unspecified, at most 50 collections will be returned. - # The maximum value is 1000; values above 1000 will be coerced to 1000. - # @param page_token [::String] - # A page token, received from a previous `ViewCollectionItemsRequest` call. - # Provide this to retrieve the subsequent page. - # - # When paginating, all other parameters provided to - # `ViewCollectionItemsRequest` must match the call that provided the page - # token. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::VisionAI::V1::CollectionItem>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::VisionAI::V1::CollectionItem>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::Warehouse::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::ViewCollectionItemsRequest.new - # - # # Call the view_collection_items method. - # result = client.view_collection_items 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::VisionAI::V1::CollectionItem. - # p item - # end - # - def view_collection_items request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::ViewCollectionItemsRequest - - # Converts hash 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.view_collection_items.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::VisionAI::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.collection - header_params["collection"] = request.collection - 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.view_collection_items.timeout, - metadata: metadata, - retry_policy: @config.rpcs.view_collection_items.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @warehouse_stub.call_rpc :view_collection_items, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @warehouse_stub, :view_collection_items, 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 Warehouse API. - # - # This class represents the configuration for Warehouse, - # 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::VisionAI::V1::Warehouse::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_asset to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::VisionAI::V1::Warehouse::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.create_asset.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::VisionAI::V1::Warehouse::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.create_asset.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::VisionAI::V1::Warehouse::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 = "warehouse-visionai.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 Warehouse 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_asset` - # @return [::Gapic::Config::Method] - # - attr_reader :create_asset - ## - # RPC-specific configuration for `update_asset` - # @return [::Gapic::Config::Method] - # - attr_reader :update_asset - ## - # RPC-specific configuration for `get_asset` - # @return [::Gapic::Config::Method] - # - attr_reader :get_asset - ## - # RPC-specific configuration for `list_assets` - # @return [::Gapic::Config::Method] - # - attr_reader :list_assets - ## - # RPC-specific configuration for `delete_asset` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_asset - ## - # RPC-specific configuration for `upload_asset` - # @return [::Gapic::Config::Method] - # - attr_reader :upload_asset - ## - # RPC-specific configuration for `generate_retrieval_url` - # @return [::Gapic::Config::Method] - # - attr_reader :generate_retrieval_url - ## - # RPC-specific configuration for `analyze_asset` - # @return [::Gapic::Config::Method] - # - attr_reader :analyze_asset - ## - # RPC-specific configuration for `index_asset` - # @return [::Gapic::Config::Method] - # - attr_reader :index_asset - ## - # RPC-specific configuration for `remove_index_asset` - # @return [::Gapic::Config::Method] - # - attr_reader :remove_index_asset - ## - # RPC-specific configuration for `view_indexed_assets` - # @return [::Gapic::Config::Method] - # - attr_reader :view_indexed_assets - ## - # RPC-specific configuration for `create_index` - # @return [::Gapic::Config::Method] - # - attr_reader :create_index - ## - # RPC-specific configuration for `update_index` - # @return [::Gapic::Config::Method] - # - attr_reader :update_index - ## - # RPC-specific configuration for `get_index` - # @return [::Gapic::Config::Method] - # - attr_reader :get_index - ## - # RPC-specific configuration for `list_indexes` - # @return [::Gapic::Config::Method] - # - attr_reader :list_indexes - ## - # RPC-specific configuration for `delete_index` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_index - ## - # RPC-specific configuration for `create_corpus` - # @return [::Gapic::Config::Method] - # - attr_reader :create_corpus - ## - # RPC-specific configuration for `get_corpus` - # @return [::Gapic::Config::Method] - # - attr_reader :get_corpus - ## - # RPC-specific configuration for `update_corpus` - # @return [::Gapic::Config::Method] - # - attr_reader :update_corpus - ## - # RPC-specific configuration for `list_corpora` - # @return [::Gapic::Config::Method] - # - attr_reader :list_corpora - ## - # RPC-specific configuration for `delete_corpus` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_corpus - ## - # RPC-specific configuration for `analyze_corpus` - # @return [::Gapic::Config::Method] - # - attr_reader :analyze_corpus - ## - # RPC-specific configuration for `create_data_schema` - # @return [::Gapic::Config::Method] - # - attr_reader :create_data_schema - ## - # RPC-specific configuration for `update_data_schema` - # @return [::Gapic::Config::Method] - # - attr_reader :update_data_schema - ## - # RPC-specific configuration for `get_data_schema` - # @return [::Gapic::Config::Method] - # - attr_reader :get_data_schema - ## - # RPC-specific configuration for `delete_data_schema` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_data_schema - ## - # RPC-specific configuration for `list_data_schemas` - # @return [::Gapic::Config::Method] - # - attr_reader :list_data_schemas - ## - # RPC-specific configuration for `create_annotation` - # @return [::Gapic::Config::Method] - # - attr_reader :create_annotation - ## - # RPC-specific configuration for `get_annotation` - # @return [::Gapic::Config::Method] - # - attr_reader :get_annotation - ## - # RPC-specific configuration for `list_annotations` - # @return [::Gapic::Config::Method] - # - attr_reader :list_annotations - ## - # RPC-specific configuration for `update_annotation` - # @return [::Gapic::Config::Method] - # - attr_reader :update_annotation - ## - # RPC-specific configuration for `delete_annotation` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_annotation - ## - # RPC-specific configuration for `ingest_asset` - # @return [::Gapic::Config::Method] - # - attr_reader :ingest_asset - ## - # RPC-specific configuration for `clip_asset` - # @return [::Gapic::Config::Method] - # - attr_reader :clip_asset - ## - # RPC-specific configuration for `generate_hls_uri` - # @return [::Gapic::Config::Method] - # - attr_reader :generate_hls_uri - ## - # RPC-specific configuration for `import_assets` - # @return [::Gapic::Config::Method] - # - attr_reader :import_assets - ## - # RPC-specific configuration for `create_search_config` - # @return [::Gapic::Config::Method] - # - attr_reader :create_search_config - ## - # RPC-specific configuration for `update_search_config` - # @return [::Gapic::Config::Method] - # - attr_reader :update_search_config - ## - # RPC-specific configuration for `get_search_config` - # @return [::Gapic::Config::Method] - # - attr_reader :get_search_config - ## - # RPC-specific configuration for `delete_search_config` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_search_config - ## - # RPC-specific configuration for `list_search_configs` - # @return [::Gapic::Config::Method] - # - attr_reader :list_search_configs - ## - # RPC-specific configuration for `create_search_hypernym` - # @return [::Gapic::Config::Method] - # - attr_reader :create_search_hypernym - ## - # RPC-specific configuration for `update_search_hypernym` - # @return [::Gapic::Config::Method] - # - attr_reader :update_search_hypernym - ## - # RPC-specific configuration for `get_search_hypernym` - # @return [::Gapic::Config::Method] - # - attr_reader :get_search_hypernym - ## - # RPC-specific configuration for `delete_search_hypernym` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_search_hypernym - ## - # RPC-specific configuration for `list_search_hypernyms` - # @return [::Gapic::Config::Method] - # - attr_reader :list_search_hypernyms - ## - # RPC-specific configuration for `search_assets` - # @return [::Gapic::Config::Method] - # - attr_reader :search_assets - ## - # RPC-specific configuration for `search_index_endpoint` - # @return [::Gapic::Config::Method] - # - attr_reader :search_index_endpoint - ## - # RPC-specific configuration for `create_index_endpoint` - # @return [::Gapic::Config::Method] - # - attr_reader :create_index_endpoint - ## - # RPC-specific configuration for `get_index_endpoint` - # @return [::Gapic::Config::Method] - # - attr_reader :get_index_endpoint - ## - # RPC-specific configuration for `list_index_endpoints` - # @return [::Gapic::Config::Method] - # - attr_reader :list_index_endpoints - ## - # RPC-specific configuration for `update_index_endpoint` - # @return [::Gapic::Config::Method] - # - attr_reader :update_index_endpoint - ## - # RPC-specific configuration for `delete_index_endpoint` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_index_endpoint - ## - # RPC-specific configuration for `deploy_index` - # @return [::Gapic::Config::Method] - # - attr_reader :deploy_index - ## - # RPC-specific configuration for `undeploy_index` - # @return [::Gapic::Config::Method] - # - attr_reader :undeploy_index - ## - # RPC-specific configuration for `create_collection` - # @return [::Gapic::Config::Method] - # - attr_reader :create_collection - ## - # RPC-specific configuration for `delete_collection` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_collection - ## - # RPC-specific configuration for `get_collection` - # @return [::Gapic::Config::Method] - # - attr_reader :get_collection - ## - # RPC-specific configuration for `update_collection` - # @return [::Gapic::Config::Method] - # - attr_reader :update_collection - ## - # RPC-specific configuration for `list_collections` - # @return [::Gapic::Config::Method] - # - attr_reader :list_collections - ## - # RPC-specific configuration for `add_collection_item` - # @return [::Gapic::Config::Method] - # - attr_reader :add_collection_item - ## - # RPC-specific configuration for `remove_collection_item` - # @return [::Gapic::Config::Method] - # - attr_reader :remove_collection_item - ## - # RPC-specific configuration for `view_collection_items` - # @return [::Gapic::Config::Method] - # - attr_reader :view_collection_items - - # @private - def initialize parent_rpcs = nil - create_asset_config = parent_rpcs.create_asset if parent_rpcs.respond_to? :create_asset - @create_asset = ::Gapic::Config::Method.new create_asset_config - update_asset_config = parent_rpcs.update_asset if parent_rpcs.respond_to? :update_asset - @update_asset = ::Gapic::Config::Method.new update_asset_config - get_asset_config = parent_rpcs.get_asset if parent_rpcs.respond_to? :get_asset - @get_asset = ::Gapic::Config::Method.new get_asset_config - list_assets_config = parent_rpcs.list_assets if parent_rpcs.respond_to? :list_assets - @list_assets = ::Gapic::Config::Method.new list_assets_config - delete_asset_config = parent_rpcs.delete_asset if parent_rpcs.respond_to? :delete_asset - @delete_asset = ::Gapic::Config::Method.new delete_asset_config - upload_asset_config = parent_rpcs.upload_asset if parent_rpcs.respond_to? :upload_asset - @upload_asset = ::Gapic::Config::Method.new upload_asset_config - generate_retrieval_url_config = parent_rpcs.generate_retrieval_url if parent_rpcs.respond_to? :generate_retrieval_url - @generate_retrieval_url = ::Gapic::Config::Method.new generate_retrieval_url_config - analyze_asset_config = parent_rpcs.analyze_asset if parent_rpcs.respond_to? :analyze_asset - @analyze_asset = ::Gapic::Config::Method.new analyze_asset_config - index_asset_config = parent_rpcs.index_asset if parent_rpcs.respond_to? :index_asset - @index_asset = ::Gapic::Config::Method.new index_asset_config - remove_index_asset_config = parent_rpcs.remove_index_asset if parent_rpcs.respond_to? :remove_index_asset - @remove_index_asset = ::Gapic::Config::Method.new remove_index_asset_config - view_indexed_assets_config = parent_rpcs.view_indexed_assets if parent_rpcs.respond_to? :view_indexed_assets - @view_indexed_assets = ::Gapic::Config::Method.new view_indexed_assets_config - create_index_config = parent_rpcs.create_index if parent_rpcs.respond_to? :create_index - @create_index = ::Gapic::Config::Method.new create_index_config - update_index_config = parent_rpcs.update_index if parent_rpcs.respond_to? :update_index - @update_index = ::Gapic::Config::Method.new update_index_config - get_index_config = parent_rpcs.get_index if parent_rpcs.respond_to? :get_index - @get_index = ::Gapic::Config::Method.new get_index_config - list_indexes_config = parent_rpcs.list_indexes if parent_rpcs.respond_to? :list_indexes - @list_indexes = ::Gapic::Config::Method.new list_indexes_config - delete_index_config = parent_rpcs.delete_index if parent_rpcs.respond_to? :delete_index - @delete_index = ::Gapic::Config::Method.new delete_index_config - create_corpus_config = parent_rpcs.create_corpus if parent_rpcs.respond_to? :create_corpus - @create_corpus = ::Gapic::Config::Method.new create_corpus_config - get_corpus_config = parent_rpcs.get_corpus if parent_rpcs.respond_to? :get_corpus - @get_corpus = ::Gapic::Config::Method.new get_corpus_config - update_corpus_config = parent_rpcs.update_corpus if parent_rpcs.respond_to? :update_corpus - @update_corpus = ::Gapic::Config::Method.new update_corpus_config - list_corpora_config = parent_rpcs.list_corpora if parent_rpcs.respond_to? :list_corpora - @list_corpora = ::Gapic::Config::Method.new list_corpora_config - delete_corpus_config = parent_rpcs.delete_corpus if parent_rpcs.respond_to? :delete_corpus - @delete_corpus = ::Gapic::Config::Method.new delete_corpus_config - analyze_corpus_config = parent_rpcs.analyze_corpus if parent_rpcs.respond_to? :analyze_corpus - @analyze_corpus = ::Gapic::Config::Method.new analyze_corpus_config - create_data_schema_config = parent_rpcs.create_data_schema if parent_rpcs.respond_to? :create_data_schema - @create_data_schema = ::Gapic::Config::Method.new create_data_schema_config - update_data_schema_config = parent_rpcs.update_data_schema if parent_rpcs.respond_to? :update_data_schema - @update_data_schema = ::Gapic::Config::Method.new update_data_schema_config - get_data_schema_config = parent_rpcs.get_data_schema if parent_rpcs.respond_to? :get_data_schema - @get_data_schema = ::Gapic::Config::Method.new get_data_schema_config - delete_data_schema_config = parent_rpcs.delete_data_schema if parent_rpcs.respond_to? :delete_data_schema - @delete_data_schema = ::Gapic::Config::Method.new delete_data_schema_config - list_data_schemas_config = parent_rpcs.list_data_schemas if parent_rpcs.respond_to? :list_data_schemas - @list_data_schemas = ::Gapic::Config::Method.new list_data_schemas_config - create_annotation_config = parent_rpcs.create_annotation if parent_rpcs.respond_to? :create_annotation - @create_annotation = ::Gapic::Config::Method.new create_annotation_config - get_annotation_config = parent_rpcs.get_annotation if parent_rpcs.respond_to? :get_annotation - @get_annotation = ::Gapic::Config::Method.new get_annotation_config - list_annotations_config = parent_rpcs.list_annotations if parent_rpcs.respond_to? :list_annotations - @list_annotations = ::Gapic::Config::Method.new list_annotations_config - update_annotation_config = parent_rpcs.update_annotation if parent_rpcs.respond_to? :update_annotation - @update_annotation = ::Gapic::Config::Method.new update_annotation_config - delete_annotation_config = parent_rpcs.delete_annotation if parent_rpcs.respond_to? :delete_annotation - @delete_annotation = ::Gapic::Config::Method.new delete_annotation_config - ingest_asset_config = parent_rpcs.ingest_asset if parent_rpcs.respond_to? :ingest_asset - @ingest_asset = ::Gapic::Config::Method.new ingest_asset_config - clip_asset_config = parent_rpcs.clip_asset if parent_rpcs.respond_to? :clip_asset - @clip_asset = ::Gapic::Config::Method.new clip_asset_config - generate_hls_uri_config = parent_rpcs.generate_hls_uri if parent_rpcs.respond_to? :generate_hls_uri - @generate_hls_uri = ::Gapic::Config::Method.new generate_hls_uri_config - import_assets_config = parent_rpcs.import_assets if parent_rpcs.respond_to? :import_assets - @import_assets = ::Gapic::Config::Method.new import_assets_config - create_search_config_config = parent_rpcs.create_search_config if parent_rpcs.respond_to? :create_search_config - @create_search_config = ::Gapic::Config::Method.new create_search_config_config - update_search_config_config = parent_rpcs.update_search_config if parent_rpcs.respond_to? :update_search_config - @update_search_config = ::Gapic::Config::Method.new update_search_config_config - get_search_config_config = parent_rpcs.get_search_config if parent_rpcs.respond_to? :get_search_config - @get_search_config = ::Gapic::Config::Method.new get_search_config_config - delete_search_config_config = parent_rpcs.delete_search_config if parent_rpcs.respond_to? :delete_search_config - @delete_search_config = ::Gapic::Config::Method.new delete_search_config_config - list_search_configs_config = parent_rpcs.list_search_configs if parent_rpcs.respond_to? :list_search_configs - @list_search_configs = ::Gapic::Config::Method.new list_search_configs_config - create_search_hypernym_config = parent_rpcs.create_search_hypernym if parent_rpcs.respond_to? :create_search_hypernym - @create_search_hypernym = ::Gapic::Config::Method.new create_search_hypernym_config - update_search_hypernym_config = parent_rpcs.update_search_hypernym if parent_rpcs.respond_to? :update_search_hypernym - @update_search_hypernym = ::Gapic::Config::Method.new update_search_hypernym_config - get_search_hypernym_config = parent_rpcs.get_search_hypernym if parent_rpcs.respond_to? :get_search_hypernym - @get_search_hypernym = ::Gapic::Config::Method.new get_search_hypernym_config - delete_search_hypernym_config = parent_rpcs.delete_search_hypernym if parent_rpcs.respond_to? :delete_search_hypernym - @delete_search_hypernym = ::Gapic::Config::Method.new delete_search_hypernym_config - list_search_hypernyms_config = parent_rpcs.list_search_hypernyms if parent_rpcs.respond_to? :list_search_hypernyms - @list_search_hypernyms = ::Gapic::Config::Method.new list_search_hypernyms_config - search_assets_config = parent_rpcs.search_assets if parent_rpcs.respond_to? :search_assets - @search_assets = ::Gapic::Config::Method.new search_assets_config - search_index_endpoint_config = parent_rpcs.search_index_endpoint if parent_rpcs.respond_to? :search_index_endpoint - @search_index_endpoint = ::Gapic::Config::Method.new search_index_endpoint_config - create_index_endpoint_config = parent_rpcs.create_index_endpoint if parent_rpcs.respond_to? :create_index_endpoint - @create_index_endpoint = ::Gapic::Config::Method.new create_index_endpoint_config - get_index_endpoint_config = parent_rpcs.get_index_endpoint if parent_rpcs.respond_to? :get_index_endpoint - @get_index_endpoint = ::Gapic::Config::Method.new get_index_endpoint_config - list_index_endpoints_config = parent_rpcs.list_index_endpoints if parent_rpcs.respond_to? :list_index_endpoints - @list_index_endpoints = ::Gapic::Config::Method.new list_index_endpoints_config - update_index_endpoint_config = parent_rpcs.update_index_endpoint if parent_rpcs.respond_to? :update_index_endpoint - @update_index_endpoint = ::Gapic::Config::Method.new update_index_endpoint_config - delete_index_endpoint_config = parent_rpcs.delete_index_endpoint if parent_rpcs.respond_to? :delete_index_endpoint - @delete_index_endpoint = ::Gapic::Config::Method.new delete_index_endpoint_config - deploy_index_config = parent_rpcs.deploy_index if parent_rpcs.respond_to? :deploy_index - @deploy_index = ::Gapic::Config::Method.new deploy_index_config - undeploy_index_config = parent_rpcs.undeploy_index if parent_rpcs.respond_to? :undeploy_index - @undeploy_index = ::Gapic::Config::Method.new undeploy_index_config - create_collection_config = parent_rpcs.create_collection if parent_rpcs.respond_to? :create_collection - @create_collection = ::Gapic::Config::Method.new create_collection_config - delete_collection_config = parent_rpcs.delete_collection if parent_rpcs.respond_to? :delete_collection - @delete_collection = ::Gapic::Config::Method.new delete_collection_config - get_collection_config = parent_rpcs.get_collection if parent_rpcs.respond_to? :get_collection - @get_collection = ::Gapic::Config::Method.new get_collection_config - update_collection_config = parent_rpcs.update_collection if parent_rpcs.respond_to? :update_collection - @update_collection = ::Gapic::Config::Method.new update_collection_config - list_collections_config = parent_rpcs.list_collections if parent_rpcs.respond_to? :list_collections - @list_collections = ::Gapic::Config::Method.new list_collections_config - add_collection_item_config = parent_rpcs.add_collection_item if parent_rpcs.respond_to? :add_collection_item - @add_collection_item = ::Gapic::Config::Method.new add_collection_item_config - remove_collection_item_config = parent_rpcs.remove_collection_item if parent_rpcs.respond_to? :remove_collection_item - @remove_collection_item = ::Gapic::Config::Method.new remove_collection_item_config - view_collection_items_config = parent_rpcs.view_collection_items if parent_rpcs.respond_to? :view_collection_items - @view_collection_items = ::Gapic::Config::Method.new view_collection_items_config - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/warehouse/credentials.rb b/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/warehouse/credentials.rb deleted file mode 100644 index 2af7c965c981..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/warehouse/credentials.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! - -require "googleauth" - -module Google - module Cloud - module VisionAI - module V1 - module Warehouse - # Credentials for the Warehouse API. - class Credentials < ::Google::Auth::Credentials - self.scope = [ - "https://www.googleapis.com/auth/cloud-platform" - ] - self.env_vars = [ - "GOOGLE_CLOUD_CREDENTIALS", - "GOOGLE_CLOUD_KEYFILE", - "GCLOUD_KEYFILE", - "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-vision_ai-v1/lib/google/cloud/vision_ai/v1/warehouse/operations.rb b/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/warehouse/operations.rb deleted file mode 100644 index 876bd0a34f02..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/warehouse/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 VisionAI - module V1 - module Warehouse - # Service that implements Longrunning Operations API. - class Operations - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "warehouse-visionai.$UNIVERSE_DOMAIN$" - - # @private - attr_reader :operations_stub - - ## - # Configuration for the Warehouse 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 Warehouse 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::VisionAI::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::VisionAI::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::VisionAI::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::VisionAI::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::VisionAI::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 = "warehouse-visionai.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-vision_ai-v1/lib/google/cloud/vision_ai/v1/warehouse/paths.rb b/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/warehouse/paths.rb deleted file mode 100644 index bc6b0095d5d0..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/warehouse/paths.rb +++ /dev/null @@ -1,237 +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 VisionAI - module V1 - module Warehouse - # Path helper methods for the Warehouse API. - module Paths - ## - # Create a fully-qualified Annotation resource string. - # - # The resource will be in the following format: - # - # `projects/{project_number}/locations/{location}/corpora/{corpus}/assets/{asset}/annotations/{annotation}` - # - # @param project_number [String] - # @param location [String] - # @param corpus [String] - # @param asset [String] - # @param annotation [String] - # - # @return [::String] - def annotation_path project_number:, location:, corpus:, asset:, annotation: - raise ::ArgumentError, "project_number cannot contain /" if project_number.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "corpus cannot contain /" if corpus.to_s.include? "/" - raise ::ArgumentError, "asset cannot contain /" if asset.to_s.include? "/" - - "projects/#{project_number}/locations/#{location}/corpora/#{corpus}/assets/#{asset}/annotations/#{annotation}" - end - - ## - # Create a fully-qualified Asset resource string. - # - # The resource will be in the following format: - # - # `projects/{project_number}/locations/{location}/corpora/{corpus}/assets/{asset}` - # - # @param project_number [String] - # @param location [String] - # @param corpus [String] - # @param asset [String] - # - # @return [::String] - def asset_path project_number:, location:, corpus:, asset: - raise ::ArgumentError, "project_number cannot contain /" if project_number.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "corpus cannot contain /" if corpus.to_s.include? "/" - - "projects/#{project_number}/locations/#{location}/corpora/#{corpus}/assets/#{asset}" - end - - ## - # Create a fully-qualified Collection resource string. - # - # The resource will be in the following format: - # - # `projects/{project_number}/locations/{location}/corpora/{corpus}/collections/{collection}` - # - # @param project_number [String] - # @param location [String] - # @param corpus [String] - # @param collection [String] - # - # @return [::String] - def collection_path project_number:, location:, corpus:, collection: - raise ::ArgumentError, "project_number cannot contain /" if project_number.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "corpus cannot contain /" if corpus.to_s.include? "/" - - "projects/#{project_number}/locations/#{location}/corpora/#{corpus}/collections/#{collection}" - end - - ## - # Create a fully-qualified Corpus resource string. - # - # The resource will be in the following format: - # - # `projects/{project_number}/locations/{location}/corpora/{corpus}` - # - # @param project_number [String] - # @param location [String] - # @param corpus [String] - # - # @return [::String] - def corpus_path project_number:, location:, corpus: - raise ::ArgumentError, "project_number cannot contain /" if project_number.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project_number}/locations/#{location}/corpora/#{corpus}" - end - - ## - # Create a fully-qualified DataSchema resource string. - # - # The resource will be in the following format: - # - # `projects/{project_number}/locations/{location}/corpora/{corpus}/dataSchemas/{data_schema}` - # - # @param project_number [String] - # @param location [String] - # @param corpus [String] - # @param data_schema [String] - # - # @return [::String] - def data_schema_path project_number:, location:, corpus:, data_schema: - raise ::ArgumentError, "project_number cannot contain /" if project_number.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "corpus cannot contain /" if corpus.to_s.include? "/" - - "projects/#{project_number}/locations/#{location}/corpora/#{corpus}/dataSchemas/#{data_schema}" - end - - ## - # Create a fully-qualified Index resource string. - # - # The resource will be in the following format: - # - # `projects/{project_number}/locations/{location}/corpora/{corpus}/indexes/{index}` - # - # @param project_number [String] - # @param location [String] - # @param corpus [String] - # @param index [String] - # - # @return [::String] - def index_path project_number:, location:, corpus:, index: - raise ::ArgumentError, "project_number cannot contain /" if project_number.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "corpus cannot contain /" if corpus.to_s.include? "/" - - "projects/#{project_number}/locations/#{location}/corpora/#{corpus}/indexes/#{index}" - end - - ## - # Create a fully-qualified IndexEndpoint resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/indexEndpoints/{index_endpoint}` - # - # @param project [String] - # @param location [String] - # @param index_endpoint [String] - # - # @return [::String] - def index_endpoint_path project:, location:, index_endpoint: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/indexEndpoints/#{index_endpoint}" - 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 SearchConfig resource string. - # - # The resource will be in the following format: - # - # `projects/{project_number}/locations/{location}/corpora/{corpus}/searchConfigs/{search_config}` - # - # @param project_number [String] - # @param location [String] - # @param corpus [String] - # @param search_config [String] - # - # @return [::String] - def search_config_path project_number:, location:, corpus:, search_config: - raise ::ArgumentError, "project_number cannot contain /" if project_number.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "corpus cannot contain /" if corpus.to_s.include? "/" - - "projects/#{project_number}/locations/#{location}/corpora/#{corpus}/searchConfigs/#{search_config}" - end - - ## - # Create a fully-qualified SearchHypernym resource string. - # - # The resource will be in the following format: - # - # `projects/{project_number}/locations/{location}/corpora/{corpus}/searchHypernyms/{search_hypernym}` - # - # @param project_number [String] - # @param location [String] - # @param corpus [String] - # @param search_hypernym [String] - # - # @return [::String] - def search_hypernym_path project_number:, location:, corpus:, search_hypernym: - raise ::ArgumentError, "project_number cannot contain /" if project_number.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "corpus cannot contain /" if corpus.to_s.include? "/" - - "projects/#{project_number}/locations/#{location}/corpora/#{corpus}/searchHypernyms/#{search_hypernym}" - end - - extend self - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/warehouse/rest.rb b/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/warehouse/rest.rb deleted file mode 100644 index 32d49293c6c4..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/warehouse/rest.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! - -require "gapic/rest" -require "gapic/config" -require "gapic/config/method" - -require "google/cloud/vision_ai/v1/version" -require "google/cloud/vision_ai/v1/bindings_override" - -require "google/cloud/vision_ai/v1/warehouse/credentials" -require "google/cloud/vision_ai/v1/warehouse/paths" -require "google/cloud/vision_ai/v1/warehouse/rest/operations" -require "google/cloud/vision_ai/v1/warehouse/rest/client" - -module Google - module Cloud - module VisionAI - module V1 - ## - # Service that manages media content + metadata for streaming. - # - # To load this service and instantiate a REST client: - # - # require "google/cloud/vision_ai/v1/warehouse/rest" - # client = ::Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new - # - module Warehouse - # Client for the REST transport - module Rest - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "rest", "helpers.rb" -require "google/cloud/vision_ai/v1/warehouse/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/warehouse/rest/client.rb b/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/warehouse/rest/client.rb deleted file mode 100644 index a40fe393ea71..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/warehouse/rest/client.rb +++ /dev/null @@ -1,6420 +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/visionai/v1/warehouse_pb" -require "google/cloud/vision_ai/v1/warehouse/rest/service_stub" -require "google/cloud/location/rest" -require "google/iam/v1/rest" - -module Google - module Cloud - module VisionAI - module V1 - module Warehouse - module Rest - ## - # REST client for the Warehouse service. - # - # Service that manages media content + metadata for streaming. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "warehouse-visionai.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :warehouse_stub - - ## - # Configure the Warehouse Client class. - # - # See {::Google::Cloud::VisionAI::V1::Warehouse::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all Warehouse clients - # ::Google::Cloud::VisionAI::V1::Warehouse::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", "VisionAI", "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.timeout = 60.0 - default_config.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.create_asset.timeout = 120.0 - default_config.rpcs.create_asset.retry_policy = { - initial_delay: 1.0, max_delay: 120.0, multiplier: 2.5, retry_codes: [14] - } - - default_config.rpcs.create_corpus.timeout = 120.0 - default_config.rpcs.create_corpus.retry_policy = { - initial_delay: 1.0, max_delay: 120.0, multiplier: 2.5, retry_codes: [14] - } - - default_config.rpcs.create_data_schema.timeout = 120.0 - default_config.rpcs.create_data_schema.retry_policy = { - initial_delay: 1.0, max_delay: 120.0, multiplier: 2.5, retry_codes: [14] - } - - default_config.rpcs.create_annotation.timeout = 120.0 - default_config.rpcs.create_annotation.retry_policy = { - initial_delay: 1.0, max_delay: 120.0, multiplier: 2.5, retry_codes: [14] - } - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the Warehouse 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::VisionAI::V1::Warehouse::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 - @warehouse_stub.universe_domain - end - - ## - # Create a new Warehouse REST client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Warehouse 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::VisionAI::V1::Warehouse::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 - - @warehouse_stub = ::Google::Cloud::VisionAI::V1::Warehouse::Rest::ServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials, - logger: @config.logger - ) - - @warehouse_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 = @warehouse_stub.endpoint - config.universe_domain = @warehouse_stub.universe_domain - config.bindings_override = @config.bindings_override - config.logger = @warehouse_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 = @warehouse_stub.endpoint - config.universe_domain = @warehouse_stub.universe_domain - config.logger = @warehouse_stub.logger if config.respond_to? :logger= - end - end - - ## - # Get the associated client for long-running operations. - # - # @return [::Google::Cloud::VisionAI::V1::Warehouse::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 - @warehouse_stub.logger - end - - # Service calls - - ## - # Creates an asset inside corpus. - # - # @overload create_asset(request, options = nil) - # Pass arguments to `create_asset` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::CreateAssetRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::CreateAssetRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_asset(parent: nil, asset: nil, asset_id: nil) - # Pass arguments to `create_asset` via keyword arguments. Note that at - # least one keyword argument is 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 parent resource where this asset will be created. - # Format: - # `projects/{project_number}/locations/{location_id}/corpora/{corpus_id}` - # @param asset [::Google::Cloud::VisionAI::V1::Asset, ::Hash] - # Required. The asset to create. - # @param asset_id [::String] - # Optional. The ID to use for the asset, which will become the final - # component of the asset's resource name if user choose to specify. - # Otherwise, asset id will be generated by system. - # - # This value should be up to 63 characters, and valid characters - # are /[a-z][0-9]-/. The first character must be a letter, the last could be - # a letter or a number. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::VisionAI::V1::Asset] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::VisionAI::V1::Asset] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::CreateAssetRequest.new - # - # # Call the create_asset method. - # result = client.create_asset request - # - # # The returned object is of type Google::Cloud::VisionAI::V1::Asset. - # p result - # - def create_asset request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::CreateAssetRequest - - # Converts hash 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_asset.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::VisionAI::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_asset.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_asset.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @warehouse_stub.create_asset 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 asset inside corpus. - # - # @overload update_asset(request, options = nil) - # Pass arguments to `update_asset` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::UpdateAssetRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::UpdateAssetRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_asset(asset: nil, update_mask: nil) - # Pass arguments to `update_asset` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param asset [::Google::Cloud::VisionAI::V1::Asset, ::Hash] - # Required. The asset to update. - # - # The asset's `name` field is used to identify the asset to be updated. - # Format: - # `projects/{project_number}/locations/{location}/corpora/{corpus}/assets/{asset}` - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # The list of fields to be updated. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::VisionAI::V1::Asset] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::VisionAI::V1::Asset] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::UpdateAssetRequest.new - # - # # Call the update_asset method. - # result = client.update_asset request - # - # # The returned object is of type Google::Cloud::VisionAI::V1::Asset. - # p result - # - def update_asset request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::UpdateAssetRequest - - # Converts hash 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_asset.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::VisionAI::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_asset.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_asset.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @warehouse_stub.update_asset 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 - - ## - # Reads an asset inside corpus. - # - # @overload get_asset(request, options = nil) - # Pass arguments to `get_asset` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::GetAssetRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::GetAssetRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_asset(name: nil) - # Pass arguments to `get_asset` via keyword arguments. Note that at - # least one keyword argument is 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 name of the asset to retrieve. - # Format: - # projects/\\{project_number}/locations/\\{location}/corpora/\\{corpus}/assets/\\{asset} - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::VisionAI::V1::Asset] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::VisionAI::V1::Asset] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::GetAssetRequest.new - # - # # Call the get_asset method. - # result = client.get_asset request - # - # # The returned object is of type Google::Cloud::VisionAI::V1::Asset. - # p result - # - def get_asset request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::GetAssetRequest - - # Converts hash 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_asset.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::VisionAI::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_asset.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_asset.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @warehouse_stub.get_asset 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 an list of assets inside corpus. - # - # @overload list_assets(request, options = nil) - # Pass arguments to `list_assets` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::ListAssetsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::ListAssetsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_assets(parent: nil, page_size: nil, page_token: nil, filter: nil) - # Pass arguments to `list_assets` via keyword arguments. Note that at - # least one keyword argument is 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 parent, which owns this collection of assets. - # Format: - # `projects/{project_number}/locations/{location}/corpora/{corpus}` - # @param page_size [::Integer] - # The maximum number of assets to return. The service may return fewer than - # this value. - # If unspecified, at most 50 assets will be returned. - # The maximum value is 1000; values above 1000 will be coerced to 1000. - # @param page_token [::String] - # A page token, received from a previous `ListAssets` call. - # Provide this to retrieve the subsequent page. - # - # When paginating, all other parameters provided to `ListAssets` must match - # the call that provided the page token. - # @param filter [::String] - # The filter applied to the returned list. - # Only the following filterings are supported: - # "assets_with_contents = true", which returns assets with contents uploaded; - # "assets_with_contents = false", which returns assets without contents. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::VisionAI::V1::Asset>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::VisionAI::V1::Asset>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::ListAssetsRequest.new - # - # # Call the list_assets method. - # result = client.list_assets 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::VisionAI::V1::Asset. - # p item - # end - # - def list_assets request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::ListAssetsRequest - - # Converts hash 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_assets.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::VisionAI::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_assets.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_assets.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @warehouse_stub.list_assets request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @warehouse_stub, :list_assets, "assets", 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 asset inside corpus. - # - # @overload delete_asset(request, options = nil) - # Pass arguments to `delete_asset` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::DeleteAssetRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::DeleteAssetRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_asset(name: nil) - # Pass arguments to `delete_asset` via keyword arguments. Note that at - # least one keyword argument is 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 name of the asset to delete. - # Format: - # `projects/{project_number}/locations/{location}/corpora/{corpus}/assets/{asset}` - # @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/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::DeleteAssetRequest.new - # - # # Call the delete_asset method. - # result = client.delete_asset 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_asset request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::DeleteAssetRequest - - # Converts hash 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_asset.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::VisionAI::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_asset.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_asset.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @warehouse_stub.delete_asset 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 - - ## - # Upload asset by specifing the asset Cloud Storage uri. - # For video warehouse, it requires users who call this API have read access - # to the cloud storage file. Once it is uploaded, it can be retrieved by - # GenerateRetrievalUrl API which by default, only can retrieve cloud storage - # files from the same project of the warehouse. To allow retrieval cloud - # storage files that are in a separate project, it requires to find the - # vision ai service account (Go to IAM, check checkbox to show "Include - # Google-provided role grants", search for "Cloud Vision AI Service Agent") - # and grant the read access of the cloud storage files to that service - # account. - # - # @overload upload_asset(request, options = nil) - # Pass arguments to `upload_asset` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::UploadAssetRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::UploadAssetRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload upload_asset(name: nil, asset_source: nil) - # Pass arguments to `upload_asset` via keyword arguments. Note that at - # least one keyword argument is 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 asset to upload. - # Format: - # `projects/{project_number}/locations/{location_id}/corpora/{corpus_id}/assets/{asset_id}` - # @param asset_source [::Google::Cloud::VisionAI::V1::AssetSource, ::Hash] - # The source of the asset. - # @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/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::UploadAssetRequest.new - # - # # Call the upload_asset method. - # result = client.upload_asset 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 upload_asset request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::UploadAssetRequest - - # Converts hash 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.upload_asset.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::VisionAI::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.upload_asset.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.upload_asset.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @warehouse_stub.upload_asset 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 - - ## - # Generates a signed url for downloading the asset. - # For video warehouse, please see comment of UploadAsset about how to allow - # retrieval of cloud storage files in a different project. - # - # @overload generate_retrieval_url(request, options = nil) - # Pass arguments to `generate_retrieval_url` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::GenerateRetrievalUrlRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::GenerateRetrievalUrlRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_retrieval_url(name: nil) - # Pass arguments to `generate_retrieval_url` via keyword arguments. Note that at - # least one keyword argument is 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 asset to request signed url for. - # Format: - # `projects/{project_number}/locations/{location_id}/corpora/{corpus_id}/assets/{asset_id}` - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::VisionAI::V1::GenerateRetrievalUrlResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::VisionAI::V1::GenerateRetrievalUrlResponse] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::GenerateRetrievalUrlRequest.new - # - # # Call the generate_retrieval_url method. - # result = client.generate_retrieval_url request - # - # # The returned object is of type Google::Cloud::VisionAI::V1::GenerateRetrievalUrlResponse. - # p result - # - def generate_retrieval_url request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::GenerateRetrievalUrlRequest - - # Converts hash 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_retrieval_url.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::VisionAI::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_retrieval_url.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.generate_retrieval_url.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @warehouse_stub.generate_retrieval_url 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 - - ## - # Analyze asset to power search capability. - # - # @overload analyze_asset(request, options = nil) - # Pass arguments to `analyze_asset` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::AnalyzeAssetRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::AnalyzeAssetRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload analyze_asset(name: nil) - # Pass arguments to `analyze_asset` via keyword arguments. Note that at - # least one keyword argument is 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 asset to analyze. - # Format: - # `projects/{project_number}/locations/{location_id}/corpora/{corpus_id}/assets/{asset_id}` - # @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/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::AnalyzeAssetRequest.new - # - # # Call the analyze_asset method. - # result = client.analyze_asset 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 analyze_asset request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::AnalyzeAssetRequest - - # Converts hash 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.analyze_asset.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::VisionAI::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.analyze_asset.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.analyze_asset.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @warehouse_stub.analyze_asset 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 - - ## - # Index one asset for search. - # Supported corpus type: Corpus.Type.VIDEO_ON_DEMAND - # - # @overload index_asset(request, options = nil) - # Pass arguments to `index_asset` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::IndexAssetRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::IndexAssetRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload index_asset(name: nil, index: nil) - # Pass arguments to `index_asset` via keyword arguments. Note that at - # least one keyword argument is 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 asset to index. - # Format: - # `projects/{project_number}/locations/{location_id}/corpora/{corpus_id}/assets/{asset_id}` - # @param index [::String] - # Optional. The name of the index. - # Format: - # `projects/{project_number}/locations/{location}/corpora/{corpus}/indexes/{index}` - # @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/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::IndexAssetRequest.new - # - # # Call the index_asset method. - # result = client.index_asset 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 index_asset request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::IndexAssetRequest - - # Converts hash 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.index_asset.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::VisionAI::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.index_asset.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.index_asset.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @warehouse_stub.index_asset 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 - - ## - # Remove one asset's index data for search. - # Supported corpus type: Corpus.Type.VIDEO_ON_DEMAND - # - # @overload remove_index_asset(request, options = nil) - # Pass arguments to `remove_index_asset` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::RemoveIndexAssetRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::RemoveIndexAssetRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload remove_index_asset(name: nil, index: nil) - # Pass arguments to `remove_index_asset` via keyword arguments. Note that at - # least one keyword argument is 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 asset to index. - # Format: - # `projects/{project_number}/locations/{location_id}/corpora/{corpus_id}/assets/{asset_id}` - # @param index [::String] - # Optional. The name of the index. - # Format: - # `projects/{project_number}/locations/{location}/corpora/{corpus}/indexes/{index}` - # @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/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::RemoveIndexAssetRequest.new - # - # # Call the remove_index_asset method. - # result = client.remove_index_asset 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 remove_index_asset request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::RemoveIndexAssetRequest - - # Converts hash 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.remove_index_asset.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::VisionAI::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.remove_index_asset.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.remove_index_asset.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @warehouse_stub.remove_index_asset 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 - - ## - # Lists assets inside an index. - # - # @overload view_indexed_assets(request, options = nil) - # Pass arguments to `view_indexed_assets` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::ViewIndexedAssetsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::ViewIndexedAssetsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload view_indexed_assets(index: nil, page_size: nil, page_token: nil, filter: nil) - # Pass arguments to `view_indexed_assets` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param index [::String] - # Required. The index that owns this collection of assets. - # Format: - # `projects/{project_number}/locations/{location}/corpora/{corpus}/indexes/{index}` - # @param page_size [::Integer] - # The maximum number of assets to return. The service may return fewer than - # this value. - # If unspecified, at most 50 assets will be returned. - # The maximum value is 1000; values above 1000 will be coerced to 1000. - # @param page_token [::String] - # A page token, received from a previous `ViewIndexedAssets` call. - # Provide this to retrieve the subsequent page. - # - # When paginating, all other parameters provided to `ViewIndexedAssets` must - # match the call that provided the page token. - # @param filter [::String] - # The filter applied to the returned list. - # Only the following filterings are supported: - # "asset_id = xxxx", which returns asset with specified id. - # "asset_id = xxxx, yyyy, zzzz", which returns assets with specified ids. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::VisionAI::V1::IndexedAsset>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::VisionAI::V1::IndexedAsset>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::ViewIndexedAssetsRequest.new - # - # # Call the view_indexed_assets method. - # result = client.view_indexed_assets 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::VisionAI::V1::IndexedAsset. - # p item - # end - # - def view_indexed_assets request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::ViewIndexedAssetsRequest - - # Converts hash 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.view_indexed_assets.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::VisionAI::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.view_indexed_assets.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.view_indexed_assets.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @warehouse_stub.view_indexed_assets request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @warehouse_stub, :view_indexed_assets, "indexed_assets", 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 - - ## - # Creates an Index under the corpus. - # - # @overload create_index(request, options = nil) - # Pass arguments to `create_index` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::CreateIndexRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::CreateIndexRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_index(parent: nil, index_id: nil, index: nil) - # Pass arguments to `create_index` via keyword arguments. Note that at - # least one keyword argument is 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. Value for the parent. The resource name of the Corpus under which - # this index is created. Format: - # `projects/{project_number}/locations/{location_id}/corpora/{corpus_id}` - # @param index_id [::String] - # Optional. The ID for the index. This will become the final resource name - # for the index. If the user does not specify this value, it will be - # generated by system. - # - # This value should be up to 63 characters, and valid characters - # are /[a-z][0-9]-/. The first character must be a letter, the last could be - # a letter or a number. - # @param index [::Google::Cloud::VisionAI::V1::Index, ::Hash] - # Required. The index being created. - # @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/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::CreateIndexRequest.new - # - # # Call the create_index method. - # result = client.create_index 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_index request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::CreateIndexRequest - - # Converts hash 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_index.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::VisionAI::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_index.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_index.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @warehouse_stub.create_index 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 - - ## - # Updates an Index under the corpus. - # Users can perform a metadata-only update or trigger a full index rebuild - # with different update_mask values. - # - # @overload update_index(request, options = nil) - # Pass arguments to `update_index` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::UpdateIndexRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::UpdateIndexRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_index(index: nil, update_mask: nil) - # Pass arguments to `update_index` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param index [::Google::Cloud::VisionAI::V1::Index, ::Hash] - # Required. The resource being updated. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Required. Field mask is used to specify the fields to be overwritten in the - # Index resource by the update. The fields specified in the update_mask are - # relative to the resource, not the full request. A field of the resource - # will be overwritten if it is in the mask. Empty field mask is not allowed. - # If the mask is "*", it triggers a full update of the index, and also a - # whole rebuild of index data. - # @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/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::UpdateIndexRequest.new - # - # # Call the update_index method. - # result = client.update_index 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 update_index request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::UpdateIndexRequest - - # Converts hash 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_index.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::VisionAI::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_index.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_index.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @warehouse_stub.update_index 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 - - ## - # Gets the details of a single Index under a Corpus. - # - # @overload get_index(request, options = nil) - # Pass arguments to `get_index` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::GetIndexRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::GetIndexRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_index(name: nil) - # Pass arguments to `get_index` via keyword arguments. Note that at - # least one keyword argument is 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 Index resource. - # Format: - # `projects/{project_number}/locations/{location}/corpora/{corpus}/indexes/{index}` - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::VisionAI::V1::Index] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::VisionAI::V1::Index] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::GetIndexRequest.new - # - # # Call the get_index method. - # result = client.get_index request - # - # # The returned object is of type Google::Cloud::VisionAI::V1::Index. - # p result - # - def get_index request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::GetIndexRequest - - # Converts hash 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_index.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::VisionAI::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_index.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_index.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @warehouse_stub.get_index 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 - - ## - # List all Indexes in a given Corpus. - # - # @overload list_indexes(request, options = nil) - # Pass arguments to `list_indexes` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::ListIndexesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::ListIndexesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_indexes(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_indexes` via keyword arguments. Note that at - # least one keyword argument is 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 parent corpus that owns this collection of indexes. - # Format: - # `projects/{project_number}/locations/{location}/corpora/{corpus}` - # @param page_size [::Integer] - # The maximum number of indexes to return. The service may return fewer than - # this value. - # If unspecified, at most 50 indexes will be returned. - # The maximum value is 1000; values above 1000 will be coerced to 1000. - # @param page_token [::String] - # A page token, received from a previous `ListIndexes` call. - # Provide this to retrieve the subsequent page. - # - # When paginating, all other parameters provided to `ListIndexes` must match - # the call that provided the page token. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::VisionAI::V1::Index>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::VisionAI::V1::Index>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::ListIndexesRequest.new - # - # # Call the list_indexes method. - # result = client.list_indexes 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::VisionAI::V1::Index. - # p item - # end - # - def list_indexes request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::ListIndexesRequest - - # Converts hash 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_indexes.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::VisionAI::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_indexes.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_indexes.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @warehouse_stub.list_indexes request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @warehouse_stub, :list_indexes, "indexes", 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 - - ## - # Delete a single Index. In order to delete an index, the caller must - # make sure that it is not deployed to any index endpoint. - # - # @overload delete_index(request, options = nil) - # Pass arguments to `delete_index` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::DeleteIndexRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::DeleteIndexRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_index(name: nil) - # Pass arguments to `delete_index` via keyword arguments. Note that at - # least one keyword argument is 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 name of the index to delete. - # Format: - # `projects/{project_number}/locations/{location}/corpora/{corpus}/indexes/{index}` - # @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/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::DeleteIndexRequest.new - # - # # Call the delete_index method. - # result = client.delete_index 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_index request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::DeleteIndexRequest - - # Converts hash 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_index.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::VisionAI::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_index.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_index.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @warehouse_stub.delete_index 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 corpus inside a project. - # - # @overload create_corpus(request, options = nil) - # Pass arguments to `create_corpus` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::CreateCorpusRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::CreateCorpusRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_corpus(parent: nil, corpus: nil) - # Pass arguments to `create_corpus` via keyword arguments. Note that at - # least one keyword argument is 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. Form: `projects/{project_number}/locations/{location_id}` - # @param corpus [::Google::Cloud::VisionAI::V1::Corpus, ::Hash] - # Required. The corpus to be created. - # @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/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::CreateCorpusRequest.new - # - # # Call the create_corpus method. - # result = client.create_corpus 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_corpus request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::CreateCorpusRequest - - # Converts hash 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_corpus.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::VisionAI::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_corpus.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_corpus.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @warehouse_stub.create_corpus 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 - - ## - # Gets corpus details inside a project. - # - # @overload get_corpus(request, options = nil) - # Pass arguments to `get_corpus` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::GetCorpusRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::GetCorpusRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_corpus(name: nil) - # Pass arguments to `get_corpus` via keyword arguments. Note that at - # least one keyword argument is 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 corpus to retrieve. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::VisionAI::V1::Corpus] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::VisionAI::V1::Corpus] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::GetCorpusRequest.new - # - # # Call the get_corpus method. - # result = client.get_corpus request - # - # # The returned object is of type Google::Cloud::VisionAI::V1::Corpus. - # p result - # - def get_corpus request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::GetCorpusRequest - - # Converts hash 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_corpus.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::VisionAI::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_corpus.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_corpus.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @warehouse_stub.get_corpus 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 a corpus in a project. - # - # @overload update_corpus(request, options = nil) - # Pass arguments to `update_corpus` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::UpdateCorpusRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::UpdateCorpusRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_corpus(corpus: nil, update_mask: nil) - # Pass arguments to `update_corpus` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param corpus [::Google::Cloud::VisionAI::V1::Corpus, ::Hash] - # Required. The corpus which replaces the resource on the server. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # The list of fields to be updated. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::VisionAI::V1::Corpus] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::VisionAI::V1::Corpus] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::UpdateCorpusRequest.new - # - # # Call the update_corpus method. - # result = client.update_corpus request - # - # # The returned object is of type Google::Cloud::VisionAI::V1::Corpus. - # p result - # - def update_corpus request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::UpdateCorpusRequest - - # Converts hash 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_corpus.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::VisionAI::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_corpus.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_corpus.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @warehouse_stub.update_corpus 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 all corpora in a project. - # - # @overload list_corpora(request, options = nil) - # Pass arguments to `list_corpora` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::ListCorporaRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::ListCorporaRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_corpora(parent: nil, page_size: nil, page_token: nil, filter: nil) - # Pass arguments to `list_corpora` via keyword arguments. Note that at - # least one keyword argument is 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 project from which to list corpora. - # @param page_size [::Integer] - # Requested page size. API may return fewer results than requested. - # If negative, INVALID_ARGUMENT error will be returned. - # If unspecified or 0, API will pick a default size, which is 10. - # If the requested page size is larger than the maximum size, API will pick - # use the maximum size, which is 20. - # @param page_token [::String] - # A token identifying a page of results for the server to return. - # Typically obtained via - # {::Google::Cloud::VisionAI::V1::ListCorporaResponse#next_page_token ListCorporaResponse.next_page_token} - # of the previous - # {::Google::Cloud::VisionAI::V1::Warehouse::Rest::Client#list_corpora Warehouse.ListCorpora} - # call. - # @param filter [::String] - # The filter applied to the returned corpora list. - # Only the following restrictions are supported: - # `type=`, - # `type!=`. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::VisionAI::V1::Corpus>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::VisionAI::V1::Corpus>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::ListCorporaRequest.new - # - # # Call the list_corpora method. - # result = client.list_corpora 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::VisionAI::V1::Corpus. - # p item - # end - # - def list_corpora request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::ListCorporaRequest - - # Converts hash 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_corpora.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::VisionAI::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_corpora.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_corpora.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @warehouse_stub.list_corpora request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @warehouse_stub, :list_corpora, "corpora", 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 corpus only if its empty. - # Returns empty response. - # - # @overload delete_corpus(request, options = nil) - # Pass arguments to `delete_corpus` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::DeleteCorpusRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::DeleteCorpusRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_corpus(name: nil) - # Pass arguments to `delete_corpus` via keyword arguments. Note that at - # least one keyword argument is 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 corpus 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/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::DeleteCorpusRequest.new - # - # # Call the delete_corpus method. - # result = client.delete_corpus request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_corpus request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::DeleteCorpusRequest - - # Converts hash 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_corpus.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::VisionAI::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_corpus.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_corpus.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @warehouse_stub.delete_corpus 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 - - ## - # Analyzes a corpus. - # - # @overload analyze_corpus(request, options = nil) - # Pass arguments to `analyze_corpus` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::AnalyzeCorpusRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::AnalyzeCorpusRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload analyze_corpus(name: nil) - # Pass arguments to `analyze_corpus` via keyword arguments. Note that at - # least one keyword argument is 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 parent corpus resource where the assets will be analyzed. - # Format: - # `projects/{project_number}/locations/{location_id}/corpora/{corpus_id}` - # @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/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::AnalyzeCorpusRequest.new - # - # # Call the analyze_corpus method. - # result = client.analyze_corpus 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 analyze_corpus request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::AnalyzeCorpusRequest - - # Converts hash 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.analyze_corpus.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::VisionAI::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.analyze_corpus.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.analyze_corpus.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @warehouse_stub.analyze_corpus 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 data schema inside corpus. - # - # @overload create_data_schema(request, options = nil) - # Pass arguments to `create_data_schema` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::CreateDataSchemaRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::CreateDataSchemaRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_data_schema(parent: nil, data_schema: nil) - # Pass arguments to `create_data_schema` via keyword arguments. Note that at - # least one keyword argument is 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 parent resource where this data schema will be created. - # Format: - # `projects/{project_number}/locations/{location_id}/corpora/{corpus_id}` - # @param data_schema [::Google::Cloud::VisionAI::V1::DataSchema, ::Hash] - # Required. The data schema to create. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::VisionAI::V1::DataSchema] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::VisionAI::V1::DataSchema] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::CreateDataSchemaRequest.new - # - # # Call the create_data_schema method. - # result = client.create_data_schema request - # - # # The returned object is of type Google::Cloud::VisionAI::V1::DataSchema. - # p result - # - def create_data_schema request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::CreateDataSchemaRequest - - # Converts hash 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_data_schema.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::VisionAI::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_data_schema.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_data_schema.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @warehouse_stub.create_data_schema 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 data schema inside corpus. - # - # @overload update_data_schema(request, options = nil) - # Pass arguments to `update_data_schema` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::UpdateDataSchemaRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::UpdateDataSchemaRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_data_schema(data_schema: nil, update_mask: nil) - # Pass arguments to `update_data_schema` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param data_schema [::Google::Cloud::VisionAI::V1::DataSchema, ::Hash] - # Required. The data schema's `name` field is used to identify the data - # schema to be updated. Format: - # `projects/{project_number}/locations/{location}/corpora/{corpus}/dataSchemas/{data_schema}` - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # The list of fields to be updated. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::VisionAI::V1::DataSchema] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::VisionAI::V1::DataSchema] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::UpdateDataSchemaRequest.new - # - # # Call the update_data_schema method. - # result = client.update_data_schema request - # - # # The returned object is of type Google::Cloud::VisionAI::V1::DataSchema. - # p result - # - def update_data_schema request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::UpdateDataSchemaRequest - - # Converts hash 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_data_schema.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::VisionAI::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_data_schema.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_data_schema.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @warehouse_stub.update_data_schema 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 - - ## - # Gets data schema inside corpus. - # - # @overload get_data_schema(request, options = nil) - # Pass arguments to `get_data_schema` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::GetDataSchemaRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::GetDataSchemaRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_data_schema(name: nil) - # Pass arguments to `get_data_schema` via keyword arguments. Note that at - # least one keyword argument is 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 name of the data schema to retrieve. - # Format: - # `projects/{project_number}/locations/{location_id}/corpora/{corpus_id}/dataSchemas/{data_schema_id}` - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::VisionAI::V1::DataSchema] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::VisionAI::V1::DataSchema] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::GetDataSchemaRequest.new - # - # # Call the get_data_schema method. - # result = client.get_data_schema request - # - # # The returned object is of type Google::Cloud::VisionAI::V1::DataSchema. - # p result - # - def get_data_schema request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::GetDataSchemaRequest - - # Converts hash 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_data_schema.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::VisionAI::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_data_schema.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_data_schema.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @warehouse_stub.get_data_schema 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 - - ## - # Deletes data schema inside corpus. - # - # @overload delete_data_schema(request, options = nil) - # Pass arguments to `delete_data_schema` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::DeleteDataSchemaRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::DeleteDataSchemaRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_data_schema(name: nil) - # Pass arguments to `delete_data_schema` via keyword arguments. Note that at - # least one keyword argument is 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 name of the data schema to delete. - # Format: - # `projects/{project_number}/locations/{location_id}/corpora/{corpus_id}/dataSchemas/{data_schema_id}` - # @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/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::DeleteDataSchemaRequest.new - # - # # Call the delete_data_schema method. - # result = client.delete_data_schema request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_data_schema request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::DeleteDataSchemaRequest - - # Converts hash 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_data_schema.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::VisionAI::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_data_schema.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_data_schema.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @warehouse_stub.delete_data_schema 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 a list of data schemas inside corpus. - # - # @overload list_data_schemas(request, options = nil) - # Pass arguments to `list_data_schemas` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::ListDataSchemasRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::ListDataSchemasRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_data_schemas(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_data_schemas` via keyword arguments. Note that at - # least one keyword argument is 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 parent, which owns this collection of data schemas. - # Format: - # `projects/{project_number}/locations/{location_id}/corpora/{corpus_id}` - # @param page_size [::Integer] - # The maximum number of data schemas to return. The service may return fewer - # than this value. If unspecified, at most 50 data schemas will be returned. - # The maximum value is 1000; values above 1000 will be coerced to 1000. - # @param page_token [::String] - # A page token, received from a previous `ListDataSchemas` call. - # Provide this to retrieve the subsequent page. - # - # When paginating, all other parameters provided to `ListDataSchemas` must - # match the call that provided the page token. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::VisionAI::V1::DataSchema>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::VisionAI::V1::DataSchema>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::ListDataSchemasRequest.new - # - # # Call the list_data_schemas method. - # result = client.list_data_schemas 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::VisionAI::V1::DataSchema. - # p item - # end - # - def list_data_schemas request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::ListDataSchemasRequest - - # Converts hash 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_data_schemas.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::VisionAI::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_data_schemas.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_data_schemas.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @warehouse_stub.list_data_schemas request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @warehouse_stub, :list_data_schemas, "data_schemas", 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 - - ## - # Creates annotation inside asset. - # - # @overload create_annotation(request, options = nil) - # Pass arguments to `create_annotation` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::CreateAnnotationRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::CreateAnnotationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_annotation(parent: nil, annotation: nil, annotation_id: nil) - # Pass arguments to `create_annotation` via keyword arguments. Note that at - # least one keyword argument is 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 parent resource where this annotation will be created. - # Format: - # `projects/{project_number}/locations/{location_id}/corpora/{corpus_id}/assets/{asset_id}` - # @param annotation [::Google::Cloud::VisionAI::V1::Annotation, ::Hash] - # Required. The annotation to create. - # @param annotation_id [::String] - # Optional. The ID to use for the annotation, which will become the final - # component of the annotation's resource name if user choose to specify. - # Otherwise, annotation id will be generated by system. - # - # This value should be up to 63 characters, and valid characters - # are /[a-z][0-9]-/. The first character must be a letter, the last could be - # a letter or a number. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::VisionAI::V1::Annotation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::VisionAI::V1::Annotation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::CreateAnnotationRequest.new - # - # # Call the create_annotation method. - # result = client.create_annotation request - # - # # The returned object is of type Google::Cloud::VisionAI::V1::Annotation. - # p result - # - def create_annotation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::CreateAnnotationRequest - - # Converts hash 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_annotation.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::VisionAI::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_annotation.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_annotation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @warehouse_stub.create_annotation 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 - - ## - # Reads annotation inside asset. - # - # @overload get_annotation(request, options = nil) - # Pass arguments to `get_annotation` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::GetAnnotationRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::GetAnnotationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_annotation(name: nil) - # Pass arguments to `get_annotation` via keyword arguments. Note that at - # least one keyword argument is 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 name of the annotation to retrieve. - # Format: - # `projects/{project_number}/locations/{location}/corpora/{corpus}/assets/{asset}/annotations/{annotation}` - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::VisionAI::V1::Annotation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::VisionAI::V1::Annotation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::GetAnnotationRequest.new - # - # # Call the get_annotation method. - # result = client.get_annotation request - # - # # The returned object is of type Google::Cloud::VisionAI::V1::Annotation. - # p result - # - def get_annotation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::GetAnnotationRequest - - # Converts hash 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_annotation.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::VisionAI::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_annotation.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_annotation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @warehouse_stub.get_annotation 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 a list of annotations inside asset. - # - # @overload list_annotations(request, options = nil) - # Pass arguments to `list_annotations` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::ListAnnotationsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::ListAnnotationsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_annotations(parent: nil, page_size: nil, page_token: nil, filter: nil) - # Pass arguments to `list_annotations` via keyword arguments. Note that at - # least one keyword argument is 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] - # The parent, which owns this collection of annotations. - # Format: - # `projects/{project_number}/locations/{location}/corpora/{corpus}/assets/{asset}` - # @param page_size [::Integer] - # The maximum number of annotations to return. The service may return fewer - # than this value. If unspecified, at most 50 annotations will be returned. - # The maximum value is 1000; values above 1000 will be coerced to 1000. - # @param page_token [::String] - # A page token, received from a previous `ListAnnotations` call. - # Provide this to retrieve the subsequent page. - # - # When paginating, all other parameters provided to `ListAnnotations` must - # match the call that provided the page token. - # @param filter [::String] - # The filter applied to the returned list. - # We only support filtering for the following fields: - # For corpus of STREAM_VIDEO type: - # `partition.temporal_partition.start_time`, - # `partition.temporal_partition.end_time`, and `key`. - # For corpus of VIDEO_ON_DEMAND type, - # `partition.relative_temporal_partition.start_offset`, - # `partition.relative_temporal_partition.end_offset`, and `key`. - # For corpus of IMAGE type, only `key` is supported. - # Timestamps are specified in the RFC-3339 format, and only one restriction - # may be applied per field, joined by conjunctions. - # Format: - # "partition.temporal_partition.start_time > "2012-04-21T11:30:00-04:00" AND - # partition.temporal_partition.end_time < "2012-04-22T11:30:00-04:00" AND - # key = "example_key"" - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::VisionAI::V1::Annotation>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::VisionAI::V1::Annotation>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::ListAnnotationsRequest.new - # - # # Call the list_annotations method. - # result = client.list_annotations 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::VisionAI::V1::Annotation. - # p item - # end - # - def list_annotations request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::ListAnnotationsRequest - - # Converts hash 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_annotations.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::VisionAI::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_annotations.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_annotations.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @warehouse_stub.list_annotations request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @warehouse_stub, :list_annotations, "annotations", 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 - - ## - # Updates annotation inside asset. - # - # @overload update_annotation(request, options = nil) - # Pass arguments to `update_annotation` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::UpdateAnnotationRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::UpdateAnnotationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_annotation(annotation: nil, update_mask: nil) - # Pass arguments to `update_annotation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param annotation [::Google::Cloud::VisionAI::V1::Annotation, ::Hash] - # Required. The annotation to update. - # The annotation's `name` field is used to identify the annotation to be - # updated. Format: - # `projects/{project_number}/locations/{location}/corpora/{corpus}/assets/{asset}/annotations/{annotation}` - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # The list of fields to be updated. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::VisionAI::V1::Annotation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::VisionAI::V1::Annotation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::UpdateAnnotationRequest.new - # - # # Call the update_annotation method. - # result = client.update_annotation request - # - # # The returned object is of type Google::Cloud::VisionAI::V1::Annotation. - # p result - # - def update_annotation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::UpdateAnnotationRequest - - # Converts hash 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_annotation.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::VisionAI::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_annotation.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_annotation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @warehouse_stub.update_annotation 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 - - ## - # Deletes annotation inside asset. - # - # @overload delete_annotation(request, options = nil) - # Pass arguments to `delete_annotation` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::DeleteAnnotationRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::DeleteAnnotationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_annotation(name: nil) - # Pass arguments to `delete_annotation` via keyword arguments. Note that at - # least one keyword argument is 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 name of the annotation to delete. - # Format: - # `projects/{project_number}/locations/{location}/corpora/{corpus}/assets/{asset}/annotations/{annotation}` - # @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/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::DeleteAnnotationRequest.new - # - # # Call the delete_annotation method. - # result = client.delete_annotation request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_annotation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::DeleteAnnotationRequest - - # Converts hash 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_annotation.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::VisionAI::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_annotation.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_annotation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @warehouse_stub.delete_annotation 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 - - ## - # Supported by STREAM_VIDEO corpus type. - # Generates clips for downloading. The api takes in a time range, and - # generates a clip of the first content available after start_time and - # before end_time, which may overflow beyond these bounds. - # Returned clips are truncated if the total size of the clips are larger - # than 100MB. - # - # @overload clip_asset(request, options = nil) - # Pass arguments to `clip_asset` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::ClipAssetRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::ClipAssetRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload clip_asset(name: nil, temporal_partition: nil) - # Pass arguments to `clip_asset` via keyword arguments. Note that at - # least one keyword argument is 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 asset to request clips for. - # Format: - # `projects/{project_number}/locations/{location_id}/corpora/{corpus_id}/assets/{asset_id}` - # @param temporal_partition [::Google::Cloud::VisionAI::V1::Partition::TemporalPartition, ::Hash] - # Required. The time range to request clips for. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::VisionAI::V1::ClipAssetResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::VisionAI::V1::ClipAssetResponse] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::ClipAssetRequest.new - # - # # Call the clip_asset method. - # result = client.clip_asset request - # - # # The returned object is of type Google::Cloud::VisionAI::V1::ClipAssetResponse. - # p result - # - def clip_asset request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::ClipAssetRequest - - # Converts hash 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.clip_asset.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::VisionAI::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.clip_asset.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.clip_asset.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @warehouse_stub.clip_asset 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 - - ## - # Generates a uri for an HLS manifest. The api takes in a collection of time - # ranges, and generates a URI for an HLS manifest that covers all the - # requested time ranges. - # - # @overload generate_hls_uri(request, options = nil) - # Pass arguments to `generate_hls_uri` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::GenerateHlsUriRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::GenerateHlsUriRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_hls_uri(name: nil, temporal_partitions: nil, live_view_enabled: nil) - # Pass arguments to `generate_hls_uri` via keyword arguments. Note that at - # least one keyword argument is 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 asset to request clips for. - # Format: - # `projects/{project_number}/locations/{location_id}/corpora/{corpus_id}/assets/{asset_id}` - # @param temporal_partitions [::Array<::Google::Cloud::VisionAI::V1::Partition::TemporalPartition, ::Hash>] - # The time range to request clips for. Will be ignored if `get_live_view` is - # set to True. The total time range requested should be smaller than 24h. - # @param live_view_enabled [::Boolean] - # Option to exclusively show a livestream of the asset with up to 3 minutes - # of backlog data. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::VisionAI::V1::GenerateHlsUriResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::VisionAI::V1::GenerateHlsUriResponse] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::GenerateHlsUriRequest.new - # - # # Call the generate_hls_uri method. - # result = client.generate_hls_uri request - # - # # The returned object is of type Google::Cloud::VisionAI::V1::GenerateHlsUriResponse. - # p result - # - def generate_hls_uri request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::GenerateHlsUriRequest - - # Converts hash 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_hls_uri.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::VisionAI::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_hls_uri.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.generate_hls_uri.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @warehouse_stub.generate_hls_uri 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 - - ## - # Imports assets (images plus annotations) from a meta file on cloud storage. - # Each row in the meta file is corresponding to an image (specified by a - # cloud storage uri) and its annotations. - # - # @overload import_assets(request, options = nil) - # Pass arguments to `import_assets` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::ImportAssetsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::ImportAssetsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_assets(assets_gcs_uri: nil, parent: nil) - # Pass arguments to `import_assets` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param assets_gcs_uri [::String] - # The file contains all assets information to be imported. - # * The file is in JSONL format. - # * Each line corresponding to one asset. - # * Each line will be converted into InputImageAsset proto. - # @param parent [::String] - # Required. The parent corpus resource where the assets will be imported. - # Format: - # `projects/{project_number}/locations/{location_id}/corpora/{corpus_id}` - # @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/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::ImportAssetsRequest.new - # - # # Call the import_assets method. - # result = client.import_assets 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 import_assets request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::ImportAssetsRequest - - # Converts hash 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_assets.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::VisionAI::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_assets.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.import_assets.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @warehouse_stub.import_assets 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 search configuration inside a corpus. - # - # Please follow the rules below to create a valid CreateSearchConfigRequest. - # --- General Rules --- - # 1. Request.search_config_id must not be associated with an existing - # SearchConfig. - # 2. Request must contain at least one non-empty search_criteria_property or - # facet_property. - # 3. mapped_fields must not be empty, and must map to existing UGA keys. - # 4. All mapped_fields must be of the same type. - # 5. All mapped_fields must share the same granularity. - # 6. All mapped_fields must share the same semantic SearchConfig match - # options. - # For property-specific rules, please reference the comments for - # FacetProperty and SearchCriteriaProperty. - # - # @overload create_search_config(request, options = nil) - # Pass arguments to `create_search_config` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::CreateSearchConfigRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::CreateSearchConfigRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_search_config(parent: nil, search_config: nil, search_config_id: nil) - # Pass arguments to `create_search_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. The parent resource where this search configuration will be - # created. Format: - # `projects/{project_number}/locations/{location_id}/corpora/{corpus_id}` - # @param search_config [::Google::Cloud::VisionAI::V1::SearchConfig, ::Hash] - # Required. The search config to create. - # @param search_config_id [::String] - # Required. ID to use for the new search config. Will become the final - # component of the SearchConfig's resource name. This value should be up to - # 63 characters, and valid characters are /[a-z][0-9]-_/. The first character - # must be a letter, the last could be a letter or a number. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::VisionAI::V1::SearchConfig] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::VisionAI::V1::SearchConfig] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::CreateSearchConfigRequest.new - # - # # Call the create_search_config method. - # result = client.create_search_config request - # - # # The returned object is of type Google::Cloud::VisionAI::V1::SearchConfig. - # p result - # - def create_search_config request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::CreateSearchConfigRequest - - # Converts hash 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_search_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::VisionAI::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_search_config.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_search_config.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @warehouse_stub.create_search_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 a search configuration inside a corpus. - # - # Please follow the rules below to create a valid UpdateSearchConfigRequest. - # --- General Rules --- - # 1. Request.search_configuration.name must already exist. - # 2. Request must contain at least one non-empty search_criteria_property or - # facet_property. - # 3. mapped_fields must not be empty, and must map to existing UGA keys. - # 4. All mapped_fields must be of the same type. - # 5. All mapped_fields must share the same granularity. - # 6. All mapped_fields must share the same semantic SearchConfig match - # options. - # For property-specific rules, please reference the comments for - # FacetProperty and SearchCriteriaProperty. - # - # @overload update_search_config(request, options = nil) - # Pass arguments to `update_search_config` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::UpdateSearchConfigRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::UpdateSearchConfigRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_search_config(search_config: nil, update_mask: nil) - # Pass arguments to `update_search_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 search_config [::Google::Cloud::VisionAI::V1::SearchConfig, ::Hash] - # Required. The search configuration to update. - # - # The search configuration's `name` field is used to identify the resource to - # be updated. Format: - # `projects/{project_number}/locations/{location}/corpora/{corpus}/searchConfigs/{search_config}` - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # The list of fields to be updated. If left unset, all field paths will be - # updated/overwritten. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::VisionAI::V1::SearchConfig] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::VisionAI::V1::SearchConfig] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::UpdateSearchConfigRequest.new - # - # # Call the update_search_config method. - # result = client.update_search_config request - # - # # The returned object is of type Google::Cloud::VisionAI::V1::SearchConfig. - # p result - # - def update_search_config request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::UpdateSearchConfigRequest - - # Converts hash 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_search_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::VisionAI::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_search_config.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_search_config.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @warehouse_stub.update_search_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 - - ## - # Gets a search configuration inside a corpus. - # - # @overload get_search_config(request, options = nil) - # Pass arguments to `get_search_config` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::GetSearchConfigRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::GetSearchConfigRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_search_config(name: nil) - # Pass arguments to `get_search_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 name of the search configuration to retrieve. - # Format: - # `projects/{project_number}/locations/{location}/corpora/{corpus}/searchConfigs/{search_config}` - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::VisionAI::V1::SearchConfig] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::VisionAI::V1::SearchConfig] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::GetSearchConfigRequest.new - # - # # Call the get_search_config method. - # result = client.get_search_config request - # - # # The returned object is of type Google::Cloud::VisionAI::V1::SearchConfig. - # p result - # - def get_search_config request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::GetSearchConfigRequest - - # Converts hash 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_search_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::VisionAI::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_search_config.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_search_config.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @warehouse_stub.get_search_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 - - ## - # Deletes a search configuration inside a corpus. - # - # For a DeleteSearchConfigRequest to be valid, - # Request.search_configuration.name must already exist. - # - # @overload delete_search_config(request, options = nil) - # Pass arguments to `delete_search_config` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::DeleteSearchConfigRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::DeleteSearchConfigRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_search_config(name: nil) - # Pass arguments to `delete_search_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 name of the search configuration to delete. - # Format: - # `projects/{project_number}/locations/{location}/corpora/{corpus}/searchConfigs/{search_config}` - # @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/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::DeleteSearchConfigRequest.new - # - # # Call the delete_search_config method. - # result = client.delete_search_config request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_search_config request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::DeleteSearchConfigRequest - - # Converts hash 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_search_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::VisionAI::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_search_config.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_search_config.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @warehouse_stub.delete_search_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 - - ## - # Lists all search configurations inside a corpus. - # - # @overload list_search_configs(request, options = nil) - # Pass arguments to `list_search_configs` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::ListSearchConfigsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::ListSearchConfigsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_search_configs(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_search_configs` via keyword arguments. Note that at - # least one keyword argument is 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 parent, which owns this collection of search configurations. - # Format: - # `projects/{project_number}/locations/{location}/corpora/{corpus}` - # @param page_size [::Integer] - # The maximum number of search configurations to return. The service may - # return fewer than this value. If unspecified, a page size of 50 will be - # used. The maximum value is 1000; values above 1000 will be coerced to 1000. - # @param page_token [::String] - # A page token, received from a previous `ListSearchConfigs` call. - # Provide this to retrieve the subsequent page. - # - # When paginating, all other parameters provided to - # `ListSearchConfigs` must match the call that provided the page - # token. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::VisionAI::V1::SearchConfig>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::VisionAI::V1::SearchConfig>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::ListSearchConfigsRequest.new - # - # # Call the list_search_configs method. - # result = client.list_search_configs 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::VisionAI::V1::SearchConfig. - # p item - # end - # - def list_search_configs request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::ListSearchConfigsRequest - - # Converts hash 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_search_configs.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::VisionAI::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_search_configs.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_search_configs.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @warehouse_stub.list_search_configs request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @warehouse_stub, :list_search_configs, "search_configs", 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 - - ## - # Creates a SearchHypernym inside a corpus. - # - # @overload create_search_hypernym(request, options = nil) - # Pass arguments to `create_search_hypernym` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::CreateSearchHypernymRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::CreateSearchHypernymRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_search_hypernym(parent: nil, search_hypernym: nil, search_hypernym_id: nil) - # Pass arguments to `create_search_hypernym` via keyword arguments. Note that at - # least one keyword argument is 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 parent resource where this SearchHypernym will be created. - # Format: `projects/{project_number}/locations/{location}/corpora/{corpus}` - # @param search_hypernym [::Google::Cloud::VisionAI::V1::SearchHypernym, ::Hash] - # Required. The SearchHypernym to create. - # @param search_hypernym_id [::String] - # Optional. The search hypernym id. - # If omitted, a random UUID will be generated. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::VisionAI::V1::SearchHypernym] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::VisionAI::V1::SearchHypernym] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::CreateSearchHypernymRequest.new - # - # # Call the create_search_hypernym method. - # result = client.create_search_hypernym request - # - # # The returned object is of type Google::Cloud::VisionAI::V1::SearchHypernym. - # p result - # - def create_search_hypernym request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::CreateSearchHypernymRequest - - # Converts hash 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_search_hypernym.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::VisionAI::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_search_hypernym.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_search_hypernym.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @warehouse_stub.create_search_hypernym 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 a SearchHypernym inside a corpus. - # - # @overload update_search_hypernym(request, options = nil) - # Pass arguments to `update_search_hypernym` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::UpdateSearchHypernymRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::UpdateSearchHypernymRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_search_hypernym(search_hypernym: nil, update_mask: nil) - # Pass arguments to `update_search_hypernym` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param search_hypernym [::Google::Cloud::VisionAI::V1::SearchHypernym, ::Hash] - # Required. The SearchHypernym to update. - # The search hypernym's `name` field is used to identify the search hypernym - # to be updated. Format: - # `projects/{project_number}/locations/{location}/corpora/{corpus}/searchHypernyms/{search_hypernym}` - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # The list of fields to be updated. If left unset, all field paths will be - # updated/overwritten. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::VisionAI::V1::SearchHypernym] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::VisionAI::V1::SearchHypernym] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::UpdateSearchHypernymRequest.new - # - # # Call the update_search_hypernym method. - # result = client.update_search_hypernym request - # - # # The returned object is of type Google::Cloud::VisionAI::V1::SearchHypernym. - # p result - # - def update_search_hypernym request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::UpdateSearchHypernymRequest - - # Converts hash 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_search_hypernym.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::VisionAI::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_search_hypernym.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_search_hypernym.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @warehouse_stub.update_search_hypernym 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 - - ## - # Gets a SearchHypernym inside a corpus. - # - # @overload get_search_hypernym(request, options = nil) - # Pass arguments to `get_search_hypernym` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::GetSearchHypernymRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::GetSearchHypernymRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_search_hypernym(name: nil) - # Pass arguments to `get_search_hypernym` via keyword arguments. Note that at - # least one keyword argument is 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 name of the SearchHypernym to retrieve. - # Format: - # `projects/{project_number}/locations/{location}/corpora/{corpus}/searchHypernyms/{search_hypernym}` - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::VisionAI::V1::SearchHypernym] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::VisionAI::V1::SearchHypernym] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::GetSearchHypernymRequest.new - # - # # Call the get_search_hypernym method. - # result = client.get_search_hypernym request - # - # # The returned object is of type Google::Cloud::VisionAI::V1::SearchHypernym. - # p result - # - def get_search_hypernym request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::GetSearchHypernymRequest - - # Converts hash 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_search_hypernym.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::VisionAI::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_search_hypernym.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_search_hypernym.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @warehouse_stub.get_search_hypernym 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 - - ## - # Deletes a SearchHypernym inside a corpus. - # - # @overload delete_search_hypernym(request, options = nil) - # Pass arguments to `delete_search_hypernym` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::DeleteSearchHypernymRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::DeleteSearchHypernymRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_search_hypernym(name: nil) - # Pass arguments to `delete_search_hypernym` via keyword arguments. Note that at - # least one keyword argument is 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 name of the SearchHypernym to delete. - # Format: - # `projects/{project_number}/locations/{location}/corpora/{corpus}/searchHypernyms/{search_hypernym}` - # @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/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::DeleteSearchHypernymRequest.new - # - # # Call the delete_search_hypernym method. - # result = client.delete_search_hypernym request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_search_hypernym request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::DeleteSearchHypernymRequest - - # Converts hash 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_search_hypernym.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::VisionAI::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_search_hypernym.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_search_hypernym.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @warehouse_stub.delete_search_hypernym 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 SearchHypernyms inside a corpus. - # - # @overload list_search_hypernyms(request, options = nil) - # Pass arguments to `list_search_hypernyms` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::ListSearchHypernymsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::ListSearchHypernymsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_search_hypernyms(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_search_hypernyms` via keyword arguments. Note that at - # least one keyword argument is 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 parent, which owns this collection of SearchHypernyms. - # Format: - # `projects/{project_number}/locations/{location}/corpora/{corpus}` - # @param page_size [::Integer] - # The maximum number of SearchHypernyms returned. The service may - # return fewer than this value. If unspecified, a page size of 50 will be - # used. The maximum value is 1000; values above 1000 will be coerced to 1000. - # @param page_token [::String] - # A page token, received from a previous `SearchHypernym` call. - # Provide this to retrieve the subsequent page. - # - # When paginating, all other parameters provided to - # `SearchHypernym` must match the call that provided the page - # token. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::VisionAI::V1::SearchHypernym>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::VisionAI::V1::SearchHypernym>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::ListSearchHypernymsRequest.new - # - # # Call the list_search_hypernyms method. - # result = client.list_search_hypernyms 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::VisionAI::V1::SearchHypernym. - # p item - # end - # - def list_search_hypernyms request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::ListSearchHypernymsRequest - - # Converts hash 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_search_hypernyms.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::VisionAI::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_search_hypernyms.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_search_hypernyms.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @warehouse_stub.list_search_hypernyms request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @warehouse_stub, :list_search_hypernyms, "search_hypernyms", 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 - - ## - # Search media asset. - # - # @overload search_assets(request, options = nil) - # Pass arguments to `search_assets` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::SearchAssetsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::SearchAssetsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload search_assets(schema_key_sorting_strategy: nil, corpus: nil, page_size: nil, page_token: nil, content_time_ranges: nil, criteria: nil, facet_selections: nil, result_annotation_keys: nil, search_query: nil) - # Pass arguments to `search_assets` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param schema_key_sorting_strategy [::Google::Cloud::VisionAI::V1::SchemaKeySortingStrategy, ::Hash] - # Sort by the value under the data schema key. - # @param corpus [::String] - # Required. The parent corpus to search. - # Format: `projects/{project_id}/locations/{location_id}/corpora/{corpus_id}' - # @param page_size [::Integer] - # The number of results to be returned in this page. If it's 0, the server - # will decide the appropriate page_size. - # @param page_token [::String] - # The continuation token to fetch the next page. If empty, it means it is - # fetching the first page. - # @param content_time_ranges [::Google::Cloud::VisionAI::V1::DateTimeRangeArray, ::Hash] - # Time ranges that matching video content must fall within. If no ranges are - # provided, there will be no time restriction. This field is treated just - # like the criteria below, but defined separately for convenience as it is - # used frequently. Note that if the end_time is in the future, it will be - # clamped to the time the request was received. - # @param criteria [::Array<::Google::Cloud::VisionAI::V1::Criteria, ::Hash>] - # Criteria applied to search results. - # @param facet_selections [::Array<::Google::Cloud::VisionAI::V1::FacetGroup, ::Hash>] - # Stores most recent facet selection state. Only facet groups with user's - # selection will be presented here. Selection state is either selected or - # unselected. Only selected facet buckets will be used as search criteria. - # @param result_annotation_keys [::Array<::String>] - # A list of annotation keys to specify the annotations to be retrieved and - # returned with each search result. - # Annotation granularity must be GRANULARITY_ASSET_LEVEL and its search - # strategy must not be NO_SEARCH. - # @param search_query [::String] - # Global search query. Allows user to search assets without needing to - # specify which field the value belongs to. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::VisionAI::V1::SearchResultItem>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::VisionAI::V1::SearchResultItem>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::SearchAssetsRequest.new - # - # # Call the search_assets method. - # result = client.search_assets 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::VisionAI::V1::SearchResultItem. - # p item - # end - # - def search_assets request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::SearchAssetsRequest - - # Converts hash 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.search_assets.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::VisionAI::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.search_assets.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.search_assets.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @warehouse_stub.search_assets request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @warehouse_stub, :search_assets, "search_result_items", 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 - - ## - # Search a deployed index endpoint (IMAGE corpus type only). - # - # @overload search_index_endpoint(request, options = nil) - # Pass arguments to `search_index_endpoint` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::SearchIndexEndpointRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::SearchIndexEndpointRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload search_index_endpoint(image_query: nil, text_query: nil, index_endpoint: nil, criteria: nil, exclusion_criteria: nil, page_size: nil, page_token: nil) - # Pass arguments to `search_index_endpoint` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param image_query [::Google::Cloud::VisionAI::V1::ImageQuery, ::Hash] - # An image-only query. - # - # Note: The following parameters are mutually exclusive: `image_query`, `text_query`. 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 text_query [::String] - # A text-only query. - # - # Note: The following parameters are mutually exclusive: `text_query`, `image_query`. 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 index_endpoint [::String] - # Required. The index endpoint to search. - # Format: - # `projects/{project_id}/locations/{location_id}/indexEndpoints/{index_endpoint_id}' - # @param criteria [::Array<::Google::Cloud::VisionAI::V1::Criteria, ::Hash>] - # Criteria applied to search results. - # @param exclusion_criteria [::Array<::Google::Cloud::VisionAI::V1::Criteria, ::Hash>] - # Criteria to exclude from search results. - # Note that `fetch_matched_annotations` will be ignored. - # @param page_size [::Integer] - # Requested page size. API may return fewer results than requested. - # If negative, INVALID_ARGUMENT error will be returned. - # If unspecified or 0, API will pick a default size, which is 10. - # If the requested page size is larger than the maximum size, API will pick - # the maximum size, which is 200. - # @param page_token [::String] - # The continuation token to fetch the next page. If empty, it means it is - # fetching the first page. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::VisionAI::V1::SearchResultItem>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::VisionAI::V1::SearchResultItem>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::SearchIndexEndpointRequest.new - # - # # Call the search_index_endpoint method. - # result = client.search_index_endpoint 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::VisionAI::V1::SearchResultItem. - # p item - # end - # - def search_index_endpoint request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::SearchIndexEndpointRequest - - # Converts hash 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.search_index_endpoint.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::VisionAI::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.search_index_endpoint.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.search_index_endpoint.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @warehouse_stub.search_index_endpoint request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @warehouse_stub, :search_index_endpoint, "search_result_items", 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 - - ## - # Creates an IndexEndpoint. - # - # @overload create_index_endpoint(request, options = nil) - # Pass arguments to `create_index_endpoint` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::CreateIndexEndpointRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::CreateIndexEndpointRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_index_endpoint(parent: nil, index_endpoint_id: nil, index_endpoint: nil) - # Pass arguments to `create_index_endpoint` via keyword arguments. Note that at - # least one keyword argument is 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. Format: `projects/{project}/locations/{location}` - # @param index_endpoint_id [::String] - # Optional. The ID to use for the IndexEndpoint, which will become the final - # component of the IndexEndpoint's resource name if the user specifies it. - # Otherwise, IndexEndpoint id will be autogenerated. - # - # This value should be up to 63 characters, and valid characters - # are a-z, 0-9 and dash (-). The first character must be a letter, the last - # must be a letter or a number. - # @param index_endpoint [::Google::Cloud::VisionAI::V1::IndexEndpoint, ::Hash] - # Required. The resource being created. - # @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/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::CreateIndexEndpointRequest.new - # - # # Call the create_index_endpoint method. - # result = client.create_index_endpoint 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_index_endpoint request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::CreateIndexEndpointRequest - - # Converts hash 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_index_endpoint.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::VisionAI::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_index_endpoint.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_index_endpoint.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @warehouse_stub.create_index_endpoint 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 - - ## - # Gets an IndexEndpoint. - # - # @overload get_index_endpoint(request, options = nil) - # Pass arguments to `get_index_endpoint` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::GetIndexEndpointRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::GetIndexEndpointRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_index_endpoint(name: nil) - # Pass arguments to `get_index_endpoint` via keyword arguments. Note that at - # least one keyword argument is 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 IndexEndpoint resource. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::VisionAI::V1::IndexEndpoint] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::VisionAI::V1::IndexEndpoint] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::GetIndexEndpointRequest.new - # - # # Call the get_index_endpoint method. - # result = client.get_index_endpoint request - # - # # The returned object is of type Google::Cloud::VisionAI::V1::IndexEndpoint. - # p result - # - def get_index_endpoint request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::GetIndexEndpointRequest - - # Converts hash 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_index_endpoint.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::VisionAI::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_index_endpoint.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_index_endpoint.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @warehouse_stub.get_index_endpoint 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 all IndexEndpoints in a project. - # - # @overload list_index_endpoints(request, options = nil) - # Pass arguments to `list_index_endpoints` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::ListIndexEndpointsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::ListIndexEndpointsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_index_endpoints(parent: nil, page_size: nil, page_token: nil, filter: nil) - # Pass arguments to `list_index_endpoints` via keyword arguments. Note that at - # least one keyword argument is 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. Format: `projects/{project}/locations/{location}` - # @param page_size [::Integer] - # Optional. Requested page size. Server may return fewer items than - # requested. The service may return fewer than this value. If unspecified, a - # page size of 50 will be used. The maximum value is 1000; values above 1000 - # will be coerced to 1000. - # @param page_token [::String] - # Optional. A token identifying a page of results the server should return. - # @param filter [::String] - # Optional. The filter applied to the returned list. - # We only support filtering for the `deployed_image_index.image_index` field. - # However, to filter by a corpus instead of an image index, simply use - # `deployed_image_index.corpus`, which will return all endpoints with - # `deployed_image_index.image_index` inside of the given corpus. - # A basic filter on image index would look like: - # deployed_image_index.image_index = - # "projects/123/locations/us-central1/corpora/my_corpus/imageIndexes/my_image_index" - # A basic filter on corpus would look like: - # deployed_image_index.corpus = - # "projects/123/locations/us-central1/corpora/my_corpus" - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::VisionAI::V1::IndexEndpoint>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::VisionAI::V1::IndexEndpoint>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::ListIndexEndpointsRequest.new - # - # # Call the list_index_endpoints method. - # result = client.list_index_endpoints 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::VisionAI::V1::IndexEndpoint. - # p item - # end - # - def list_index_endpoints request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::ListIndexEndpointsRequest - - # Converts hash 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_index_endpoints.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::VisionAI::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_index_endpoints.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_index_endpoints.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @warehouse_stub.list_index_endpoints request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @warehouse_stub, :list_index_endpoints, "index_endpoints", 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 - - ## - # Updates an IndexEndpoint. - # - # @overload update_index_endpoint(request, options = nil) - # Pass arguments to `update_index_endpoint` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::UpdateIndexEndpointRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::UpdateIndexEndpointRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_index_endpoint(index_endpoint: nil, update_mask: nil) - # Pass arguments to `update_index_endpoint` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param index_endpoint [::Google::Cloud::VisionAI::V1::IndexEndpoint, ::Hash] - # Required. The resource being updated. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Required. Field mask is used to specify the fields to be overwritten in the - # IndexEndpoint resource by the update. - # The fields specified in the update_mask are relative to the resource, not - # the full request. - # A field of the resource will be overwritten if it is in the mask. - # Empty field mask is not allowed. - # If the mask is "*", then this is a full replacement of the 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/cloud/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::UpdateIndexEndpointRequest.new - # - # # Call the update_index_endpoint method. - # result = client.update_index_endpoint 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 update_index_endpoint request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::UpdateIndexEndpointRequest - - # Converts hash 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_index_endpoint.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::VisionAI::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_index_endpoint.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_index_endpoint.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @warehouse_stub.update_index_endpoint 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 an IndexEndpoint. - # - # @overload delete_index_endpoint(request, options = nil) - # Pass arguments to `delete_index_endpoint` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::DeleteIndexEndpointRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::DeleteIndexEndpointRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_index_endpoint(name: nil) - # Pass arguments to `delete_index_endpoint` via keyword arguments. Note that at - # least one keyword argument is 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 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/cloud/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::DeleteIndexEndpointRequest.new - # - # # Call the delete_index_endpoint method. - # result = client.delete_index_endpoint 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_index_endpoint request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::DeleteIndexEndpointRequest - - # Converts hash 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_index_endpoint.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::VisionAI::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_index_endpoint.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_index_endpoint.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @warehouse_stub.delete_index_endpoint 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 - - ## - # Deploys an Index to IndexEndpoint. - # - # @overload deploy_index(request, options = nil) - # Pass arguments to `deploy_index` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::DeployIndexRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::DeployIndexRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload deploy_index(index_endpoint: nil, deployed_index: nil) - # Pass arguments to `deploy_index` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param index_endpoint [::String] - # Required. IndexEndpoint the index is deployed to. - # Format: - # `projects/{project}/locations/{location}/indexEndpoints/{index_endpoint}` - # @param deployed_index [::Google::Cloud::VisionAI::V1::DeployedIndex, ::Hash] - # Required. Index to deploy. - # @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/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::DeployIndexRequest.new - # - # # Call the deploy_index method. - # result = client.deploy_index 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 deploy_index request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::DeployIndexRequest - - # Converts hash 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.deploy_index.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::VisionAI::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.deploy_index.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.deploy_index.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @warehouse_stub.deploy_index 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 - - ## - # Undeploys an Index from IndexEndpoint. - # - # @overload undeploy_index(request, options = nil) - # Pass arguments to `undeploy_index` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::UndeployIndexRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::UndeployIndexRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload undeploy_index(index_endpoint: nil) - # Pass arguments to `undeploy_index` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param index_endpoint [::String] - # Required. Resource name of the IndexEndpoint resource on which the - # undeployment will act. Format: - # `projects/{project}/locations/{location}/indexEndpoints/{index_endpoint}` - # @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/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::UndeployIndexRequest.new - # - # # Call the undeploy_index method. - # result = client.undeploy_index 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 undeploy_index request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::UndeployIndexRequest - - # Converts hash 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.undeploy_index.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::VisionAI::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.undeploy_index.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.undeploy_index.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @warehouse_stub.undeploy_index 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 collection. - # - # @overload create_collection(request, options = nil) - # Pass arguments to `create_collection` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::CreateCollectionRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::CreateCollectionRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_collection(parent: nil, collection: nil, collection_id: nil) - # Pass arguments to `create_collection` via keyword arguments. Note that at - # least one keyword argument is 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 parent resource where this collection will be created. - # Format: `projects/{project_number}/locations/{location}/corpora/{corpus}` - # @param collection [::Google::Cloud::VisionAI::V1::Collection, ::Hash] - # Required. The collection resource to be created. - # @param collection_id [::String] - # Optional. The ID to use for the collection, which will become the final - # component of the resource name if user choose to specify. Otherwise, - # collection id will be generated by system. - # - # This value should be up to 55 characters, and valid characters - # are /[a-z][0-9]-/. The first character must be a letter, the last could be - # a letter or a number. - # @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/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::CreateCollectionRequest.new - # - # # Call the create_collection method. - # result = client.create_collection 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_collection request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::CreateCollectionRequest - - # Converts hash 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_collection.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::VisionAI::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_collection.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_collection.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @warehouse_stub.create_collection 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 collection. - # - # @overload delete_collection(request, options = nil) - # Pass arguments to `delete_collection` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::DeleteCollectionRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::DeleteCollectionRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_collection(name: nil) - # Pass arguments to `delete_collection` via keyword arguments. Note that at - # least one keyword argument is 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 name of the collection to delete. Format: - # `projects/{project_number}/locations/{location}/corpora/{corpus}/collections/{collection}` - # @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/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::DeleteCollectionRequest.new - # - # # Call the delete_collection method. - # result = client.delete_collection 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_collection request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::DeleteCollectionRequest - - # Converts hash 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_collection.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::VisionAI::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_collection.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_collection.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @warehouse_stub.delete_collection 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 - - ## - # Gets a collection. - # - # @overload get_collection(request, options = nil) - # Pass arguments to `get_collection` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::GetCollectionRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::GetCollectionRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_collection(name: nil) - # Pass arguments to `get_collection` via keyword arguments. Note that at - # least one keyword argument is 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 name of the collection to retrieve. Format: - # `projects/{project_number}/locations/{location}/corpora/{corpus}/collections/{collection}` - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::VisionAI::V1::Collection] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::VisionAI::V1::Collection] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::GetCollectionRequest.new - # - # # Call the get_collection method. - # result = client.get_collection request - # - # # The returned object is of type Google::Cloud::VisionAI::V1::Collection. - # p result - # - def get_collection request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::GetCollectionRequest - - # Converts hash 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_collection.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::VisionAI::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_collection.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_collection.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @warehouse_stub.get_collection 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 a collection. - # - # @overload update_collection(request, options = nil) - # Pass arguments to `update_collection` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::UpdateCollectionRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::UpdateCollectionRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_collection(collection: nil, update_mask: nil) - # Pass arguments to `update_collection` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param collection [::Google::Cloud::VisionAI::V1::Collection, ::Hash] - # Required. The collection to update. - # - # The collection's `name` field is used to identify the collection to be - # updated. Format: - # `projects/{project_number}/locations/{location}/corpora/{corpus}/collections/{collection}` - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # The list of fields to be updated. - # - Unset `update_mask` or set `update_mask` to be a single "*" only will - # update all updatable fields with the value provided in `collection`. - # - To update `display_name` value to empty string, set it in the - # `collection` - # to empty string, and set `update_mask` with "display_name". Same applies - # to other updatable string fields in the `collection`. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::VisionAI::V1::Collection] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::VisionAI::V1::Collection] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::UpdateCollectionRequest.new - # - # # Call the update_collection method. - # result = client.update_collection request - # - # # The returned object is of type Google::Cloud::VisionAI::V1::Collection. - # p result - # - def update_collection request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::UpdateCollectionRequest - - # Converts hash 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_collection.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::VisionAI::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_collection.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_collection.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @warehouse_stub.update_collection 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 collections inside a corpus. - # - # @overload list_collections(request, options = nil) - # Pass arguments to `list_collections` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::ListCollectionsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::ListCollectionsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_collections(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_collections` via keyword arguments. Note that at - # least one keyword argument is 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 parent corpus. Format: - # `projects/{project_number}/locations/{location}/corpora/{corpus}` - # @param page_size [::Integer] - # The maximum number of collections to return. The service may return fewer - # than this value. If unspecified, at most 50 collections will be returned. - # The maximum value is 1000; values above 1000 will be coerced to 1000. - # @param page_token [::String] - # A page token, received from a previous `ListCollectionsRequest` call. - # Provide this to retrieve the subsequent page. - # - # When paginating, all other parameters provided to `ListCollectionsRequest` - # must match the call that provided the page token. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::VisionAI::V1::Collection>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::VisionAI::V1::Collection>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::ListCollectionsRequest.new - # - # # Call the list_collections method. - # result = client.list_collections 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::VisionAI::V1::Collection. - # p item - # end - # - def list_collections request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::ListCollectionsRequest - - # Converts hash 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_collections.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::VisionAI::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_collections.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_collections.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @warehouse_stub.list_collections request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @warehouse_stub, :list_collections, "collections", 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 - - ## - # Adds an item into a Collection. - # - # @overload add_collection_item(request, options = nil) - # Pass arguments to `add_collection_item` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::AddCollectionItemRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::AddCollectionItemRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload add_collection_item(item: nil) - # Pass arguments to `add_collection_item` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param item [::Google::Cloud::VisionAI::V1::CollectionItem, ::Hash] - # Required. The item to be added. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::VisionAI::V1::AddCollectionItemResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::VisionAI::V1::AddCollectionItemResponse] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::AddCollectionItemRequest.new - # - # # Call the add_collection_item method. - # result = client.add_collection_item request - # - # # The returned object is of type Google::Cloud::VisionAI::V1::AddCollectionItemResponse. - # p result - # - def add_collection_item request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::AddCollectionItemRequest - - # Converts hash 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.add_collection_item.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::VisionAI::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.add_collection_item.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.add_collection_item.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @warehouse_stub.add_collection_item 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 - - ## - # Removes an item from a collection. - # - # @overload remove_collection_item(request, options = nil) - # Pass arguments to `remove_collection_item` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::RemoveCollectionItemRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::RemoveCollectionItemRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload remove_collection_item(item: nil) - # Pass arguments to `remove_collection_item` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param item [::Google::Cloud::VisionAI::V1::CollectionItem, ::Hash] - # Required. The item to be removed. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::VisionAI::V1::RemoveCollectionItemResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::VisionAI::V1::RemoveCollectionItemResponse] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::RemoveCollectionItemRequest.new - # - # # Call the remove_collection_item method. - # result = client.remove_collection_item request - # - # # The returned object is of type Google::Cloud::VisionAI::V1::RemoveCollectionItemResponse. - # p result - # - def remove_collection_item request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::RemoveCollectionItemRequest - - # Converts hash 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.remove_collection_item.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::VisionAI::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.remove_collection_item.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.remove_collection_item.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @warehouse_stub.remove_collection_item 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 - - ## - # View items inside a collection. - # - # @overload view_collection_items(request, options = nil) - # Pass arguments to `view_collection_items` via a request object, either of type - # {::Google::Cloud::VisionAI::V1::ViewCollectionItemsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VisionAI::V1::ViewCollectionItemsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload view_collection_items(collection: nil, page_size: nil, page_token: nil) - # Pass arguments to `view_collection_items` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param collection [::String] - # Required. The collection to view. Format: - # `projects/{project_number}/locations/{location}/corpora/{corpus}/collections/{collection}` - # @param page_size [::Integer] - # The maximum number of collections to return. The service may return fewer - # than this value. If unspecified, at most 50 collections will be returned. - # The maximum value is 1000; values above 1000 will be coerced to 1000. - # @param page_token [::String] - # A page token, received from a previous `ViewCollectionItemsRequest` call. - # Provide this to retrieve the subsequent page. - # - # When paginating, all other parameters provided to - # `ViewCollectionItemsRequest` must match the call that provided the page - # token. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::VisionAI::V1::CollectionItem>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::VisionAI::V1::CollectionItem>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/vision_ai/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VisionAI::V1::ViewCollectionItemsRequest.new - # - # # Call the view_collection_items method. - # result = client.view_collection_items 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::VisionAI::V1::CollectionItem. - # p item - # end - # - def view_collection_items request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VisionAI::V1::ViewCollectionItemsRequest - - # Converts hash 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.view_collection_items.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::VisionAI::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.view_collection_items.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.view_collection_items.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @warehouse_stub.view_collection_items request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @warehouse_stub, :view_collection_items, "items", 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 Warehouse REST API. - # - # This class represents the configuration for Warehouse 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::VisionAI::V1::Warehouse::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_asset to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.create_asset.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.create_asset.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 = "warehouse-visionai.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 Warehouse 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_asset` - # @return [::Gapic::Config::Method] - # - attr_reader :create_asset - ## - # RPC-specific configuration for `update_asset` - # @return [::Gapic::Config::Method] - # - attr_reader :update_asset - ## - # RPC-specific configuration for `get_asset` - # @return [::Gapic::Config::Method] - # - attr_reader :get_asset - ## - # RPC-specific configuration for `list_assets` - # @return [::Gapic::Config::Method] - # - attr_reader :list_assets - ## - # RPC-specific configuration for `delete_asset` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_asset - ## - # RPC-specific configuration for `upload_asset` - # @return [::Gapic::Config::Method] - # - attr_reader :upload_asset - ## - # RPC-specific configuration for `generate_retrieval_url` - # @return [::Gapic::Config::Method] - # - attr_reader :generate_retrieval_url - ## - # RPC-specific configuration for `analyze_asset` - # @return [::Gapic::Config::Method] - # - attr_reader :analyze_asset - ## - # RPC-specific configuration for `index_asset` - # @return [::Gapic::Config::Method] - # - attr_reader :index_asset - ## - # RPC-specific configuration for `remove_index_asset` - # @return [::Gapic::Config::Method] - # - attr_reader :remove_index_asset - ## - # RPC-specific configuration for `view_indexed_assets` - # @return [::Gapic::Config::Method] - # - attr_reader :view_indexed_assets - ## - # RPC-specific configuration for `create_index` - # @return [::Gapic::Config::Method] - # - attr_reader :create_index - ## - # RPC-specific configuration for `update_index` - # @return [::Gapic::Config::Method] - # - attr_reader :update_index - ## - # RPC-specific configuration for `get_index` - # @return [::Gapic::Config::Method] - # - attr_reader :get_index - ## - # RPC-specific configuration for `list_indexes` - # @return [::Gapic::Config::Method] - # - attr_reader :list_indexes - ## - # RPC-specific configuration for `delete_index` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_index - ## - # RPC-specific configuration for `create_corpus` - # @return [::Gapic::Config::Method] - # - attr_reader :create_corpus - ## - # RPC-specific configuration for `get_corpus` - # @return [::Gapic::Config::Method] - # - attr_reader :get_corpus - ## - # RPC-specific configuration for `update_corpus` - # @return [::Gapic::Config::Method] - # - attr_reader :update_corpus - ## - # RPC-specific configuration for `list_corpora` - # @return [::Gapic::Config::Method] - # - attr_reader :list_corpora - ## - # RPC-specific configuration for `delete_corpus` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_corpus - ## - # RPC-specific configuration for `analyze_corpus` - # @return [::Gapic::Config::Method] - # - attr_reader :analyze_corpus - ## - # RPC-specific configuration for `create_data_schema` - # @return [::Gapic::Config::Method] - # - attr_reader :create_data_schema - ## - # RPC-specific configuration for `update_data_schema` - # @return [::Gapic::Config::Method] - # - attr_reader :update_data_schema - ## - # RPC-specific configuration for `get_data_schema` - # @return [::Gapic::Config::Method] - # - attr_reader :get_data_schema - ## - # RPC-specific configuration for `delete_data_schema` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_data_schema - ## - # RPC-specific configuration for `list_data_schemas` - # @return [::Gapic::Config::Method] - # - attr_reader :list_data_schemas - ## - # RPC-specific configuration for `create_annotation` - # @return [::Gapic::Config::Method] - # - attr_reader :create_annotation - ## - # RPC-specific configuration for `get_annotation` - # @return [::Gapic::Config::Method] - # - attr_reader :get_annotation - ## - # RPC-specific configuration for `list_annotations` - # @return [::Gapic::Config::Method] - # - attr_reader :list_annotations - ## - # RPC-specific configuration for `update_annotation` - # @return [::Gapic::Config::Method] - # - attr_reader :update_annotation - ## - # RPC-specific configuration for `delete_annotation` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_annotation - ## - # RPC-specific configuration for `clip_asset` - # @return [::Gapic::Config::Method] - # - attr_reader :clip_asset - ## - # RPC-specific configuration for `generate_hls_uri` - # @return [::Gapic::Config::Method] - # - attr_reader :generate_hls_uri - ## - # RPC-specific configuration for `import_assets` - # @return [::Gapic::Config::Method] - # - attr_reader :import_assets - ## - # RPC-specific configuration for `create_search_config` - # @return [::Gapic::Config::Method] - # - attr_reader :create_search_config - ## - # RPC-specific configuration for `update_search_config` - # @return [::Gapic::Config::Method] - # - attr_reader :update_search_config - ## - # RPC-specific configuration for `get_search_config` - # @return [::Gapic::Config::Method] - # - attr_reader :get_search_config - ## - # RPC-specific configuration for `delete_search_config` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_search_config - ## - # RPC-specific configuration for `list_search_configs` - # @return [::Gapic::Config::Method] - # - attr_reader :list_search_configs - ## - # RPC-specific configuration for `create_search_hypernym` - # @return [::Gapic::Config::Method] - # - attr_reader :create_search_hypernym - ## - # RPC-specific configuration for `update_search_hypernym` - # @return [::Gapic::Config::Method] - # - attr_reader :update_search_hypernym - ## - # RPC-specific configuration for `get_search_hypernym` - # @return [::Gapic::Config::Method] - # - attr_reader :get_search_hypernym - ## - # RPC-specific configuration for `delete_search_hypernym` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_search_hypernym - ## - # RPC-specific configuration for `list_search_hypernyms` - # @return [::Gapic::Config::Method] - # - attr_reader :list_search_hypernyms - ## - # RPC-specific configuration for `search_assets` - # @return [::Gapic::Config::Method] - # - attr_reader :search_assets - ## - # RPC-specific configuration for `search_index_endpoint` - # @return [::Gapic::Config::Method] - # - attr_reader :search_index_endpoint - ## - # RPC-specific configuration for `create_index_endpoint` - # @return [::Gapic::Config::Method] - # - attr_reader :create_index_endpoint - ## - # RPC-specific configuration for `get_index_endpoint` - # @return [::Gapic::Config::Method] - # - attr_reader :get_index_endpoint - ## - # RPC-specific configuration for `list_index_endpoints` - # @return [::Gapic::Config::Method] - # - attr_reader :list_index_endpoints - ## - # RPC-specific configuration for `update_index_endpoint` - # @return [::Gapic::Config::Method] - # - attr_reader :update_index_endpoint - ## - # RPC-specific configuration for `delete_index_endpoint` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_index_endpoint - ## - # RPC-specific configuration for `deploy_index` - # @return [::Gapic::Config::Method] - # - attr_reader :deploy_index - ## - # RPC-specific configuration for `undeploy_index` - # @return [::Gapic::Config::Method] - # - attr_reader :undeploy_index - ## - # RPC-specific configuration for `create_collection` - # @return [::Gapic::Config::Method] - # - attr_reader :create_collection - ## - # RPC-specific configuration for `delete_collection` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_collection - ## - # RPC-specific configuration for `get_collection` - # @return [::Gapic::Config::Method] - # - attr_reader :get_collection - ## - # RPC-specific configuration for `update_collection` - # @return [::Gapic::Config::Method] - # - attr_reader :update_collection - ## - # RPC-specific configuration for `list_collections` - # @return [::Gapic::Config::Method] - # - attr_reader :list_collections - ## - # RPC-specific configuration for `add_collection_item` - # @return [::Gapic::Config::Method] - # - attr_reader :add_collection_item - ## - # RPC-specific configuration for `remove_collection_item` - # @return [::Gapic::Config::Method] - # - attr_reader :remove_collection_item - ## - # RPC-specific configuration for `view_collection_items` - # @return [::Gapic::Config::Method] - # - attr_reader :view_collection_items - - # @private - def initialize parent_rpcs = nil - create_asset_config = parent_rpcs.create_asset if parent_rpcs.respond_to? :create_asset - @create_asset = ::Gapic::Config::Method.new create_asset_config - update_asset_config = parent_rpcs.update_asset if parent_rpcs.respond_to? :update_asset - @update_asset = ::Gapic::Config::Method.new update_asset_config - get_asset_config = parent_rpcs.get_asset if parent_rpcs.respond_to? :get_asset - @get_asset = ::Gapic::Config::Method.new get_asset_config - list_assets_config = parent_rpcs.list_assets if parent_rpcs.respond_to? :list_assets - @list_assets = ::Gapic::Config::Method.new list_assets_config - delete_asset_config = parent_rpcs.delete_asset if parent_rpcs.respond_to? :delete_asset - @delete_asset = ::Gapic::Config::Method.new delete_asset_config - upload_asset_config = parent_rpcs.upload_asset if parent_rpcs.respond_to? :upload_asset - @upload_asset = ::Gapic::Config::Method.new upload_asset_config - generate_retrieval_url_config = parent_rpcs.generate_retrieval_url if parent_rpcs.respond_to? :generate_retrieval_url - @generate_retrieval_url = ::Gapic::Config::Method.new generate_retrieval_url_config - analyze_asset_config = parent_rpcs.analyze_asset if parent_rpcs.respond_to? :analyze_asset - @analyze_asset = ::Gapic::Config::Method.new analyze_asset_config - index_asset_config = parent_rpcs.index_asset if parent_rpcs.respond_to? :index_asset - @index_asset = ::Gapic::Config::Method.new index_asset_config - remove_index_asset_config = parent_rpcs.remove_index_asset if parent_rpcs.respond_to? :remove_index_asset - @remove_index_asset = ::Gapic::Config::Method.new remove_index_asset_config - view_indexed_assets_config = parent_rpcs.view_indexed_assets if parent_rpcs.respond_to? :view_indexed_assets - @view_indexed_assets = ::Gapic::Config::Method.new view_indexed_assets_config - create_index_config = parent_rpcs.create_index if parent_rpcs.respond_to? :create_index - @create_index = ::Gapic::Config::Method.new create_index_config - update_index_config = parent_rpcs.update_index if parent_rpcs.respond_to? :update_index - @update_index = ::Gapic::Config::Method.new update_index_config - get_index_config = parent_rpcs.get_index if parent_rpcs.respond_to? :get_index - @get_index = ::Gapic::Config::Method.new get_index_config - list_indexes_config = parent_rpcs.list_indexes if parent_rpcs.respond_to? :list_indexes - @list_indexes = ::Gapic::Config::Method.new list_indexes_config - delete_index_config = parent_rpcs.delete_index if parent_rpcs.respond_to? :delete_index - @delete_index = ::Gapic::Config::Method.new delete_index_config - create_corpus_config = parent_rpcs.create_corpus if parent_rpcs.respond_to? :create_corpus - @create_corpus = ::Gapic::Config::Method.new create_corpus_config - get_corpus_config = parent_rpcs.get_corpus if parent_rpcs.respond_to? :get_corpus - @get_corpus = ::Gapic::Config::Method.new get_corpus_config - update_corpus_config = parent_rpcs.update_corpus if parent_rpcs.respond_to? :update_corpus - @update_corpus = ::Gapic::Config::Method.new update_corpus_config - list_corpora_config = parent_rpcs.list_corpora if parent_rpcs.respond_to? :list_corpora - @list_corpora = ::Gapic::Config::Method.new list_corpora_config - delete_corpus_config = parent_rpcs.delete_corpus if parent_rpcs.respond_to? :delete_corpus - @delete_corpus = ::Gapic::Config::Method.new delete_corpus_config - analyze_corpus_config = parent_rpcs.analyze_corpus if parent_rpcs.respond_to? :analyze_corpus - @analyze_corpus = ::Gapic::Config::Method.new analyze_corpus_config - create_data_schema_config = parent_rpcs.create_data_schema if parent_rpcs.respond_to? :create_data_schema - @create_data_schema = ::Gapic::Config::Method.new create_data_schema_config - update_data_schema_config = parent_rpcs.update_data_schema if parent_rpcs.respond_to? :update_data_schema - @update_data_schema = ::Gapic::Config::Method.new update_data_schema_config - get_data_schema_config = parent_rpcs.get_data_schema if parent_rpcs.respond_to? :get_data_schema - @get_data_schema = ::Gapic::Config::Method.new get_data_schema_config - delete_data_schema_config = parent_rpcs.delete_data_schema if parent_rpcs.respond_to? :delete_data_schema - @delete_data_schema = ::Gapic::Config::Method.new delete_data_schema_config - list_data_schemas_config = parent_rpcs.list_data_schemas if parent_rpcs.respond_to? :list_data_schemas - @list_data_schemas = ::Gapic::Config::Method.new list_data_schemas_config - create_annotation_config = parent_rpcs.create_annotation if parent_rpcs.respond_to? :create_annotation - @create_annotation = ::Gapic::Config::Method.new create_annotation_config - get_annotation_config = parent_rpcs.get_annotation if parent_rpcs.respond_to? :get_annotation - @get_annotation = ::Gapic::Config::Method.new get_annotation_config - list_annotations_config = parent_rpcs.list_annotations if parent_rpcs.respond_to? :list_annotations - @list_annotations = ::Gapic::Config::Method.new list_annotations_config - update_annotation_config = parent_rpcs.update_annotation if parent_rpcs.respond_to? :update_annotation - @update_annotation = ::Gapic::Config::Method.new update_annotation_config - delete_annotation_config = parent_rpcs.delete_annotation if parent_rpcs.respond_to? :delete_annotation - @delete_annotation = ::Gapic::Config::Method.new delete_annotation_config - clip_asset_config = parent_rpcs.clip_asset if parent_rpcs.respond_to? :clip_asset - @clip_asset = ::Gapic::Config::Method.new clip_asset_config - generate_hls_uri_config = parent_rpcs.generate_hls_uri if parent_rpcs.respond_to? :generate_hls_uri - @generate_hls_uri = ::Gapic::Config::Method.new generate_hls_uri_config - import_assets_config = parent_rpcs.import_assets if parent_rpcs.respond_to? :import_assets - @import_assets = ::Gapic::Config::Method.new import_assets_config - create_search_config_config = parent_rpcs.create_search_config if parent_rpcs.respond_to? :create_search_config - @create_search_config = ::Gapic::Config::Method.new create_search_config_config - update_search_config_config = parent_rpcs.update_search_config if parent_rpcs.respond_to? :update_search_config - @update_search_config = ::Gapic::Config::Method.new update_search_config_config - get_search_config_config = parent_rpcs.get_search_config if parent_rpcs.respond_to? :get_search_config - @get_search_config = ::Gapic::Config::Method.new get_search_config_config - delete_search_config_config = parent_rpcs.delete_search_config if parent_rpcs.respond_to? :delete_search_config - @delete_search_config = ::Gapic::Config::Method.new delete_search_config_config - list_search_configs_config = parent_rpcs.list_search_configs if parent_rpcs.respond_to? :list_search_configs - @list_search_configs = ::Gapic::Config::Method.new list_search_configs_config - create_search_hypernym_config = parent_rpcs.create_search_hypernym if parent_rpcs.respond_to? :create_search_hypernym - @create_search_hypernym = ::Gapic::Config::Method.new create_search_hypernym_config - update_search_hypernym_config = parent_rpcs.update_search_hypernym if parent_rpcs.respond_to? :update_search_hypernym - @update_search_hypernym = ::Gapic::Config::Method.new update_search_hypernym_config - get_search_hypernym_config = parent_rpcs.get_search_hypernym if parent_rpcs.respond_to? :get_search_hypernym - @get_search_hypernym = ::Gapic::Config::Method.new get_search_hypernym_config - delete_search_hypernym_config = parent_rpcs.delete_search_hypernym if parent_rpcs.respond_to? :delete_search_hypernym - @delete_search_hypernym = ::Gapic::Config::Method.new delete_search_hypernym_config - list_search_hypernyms_config = parent_rpcs.list_search_hypernyms if parent_rpcs.respond_to? :list_search_hypernyms - @list_search_hypernyms = ::Gapic::Config::Method.new list_search_hypernyms_config - search_assets_config = parent_rpcs.search_assets if parent_rpcs.respond_to? :search_assets - @search_assets = ::Gapic::Config::Method.new search_assets_config - search_index_endpoint_config = parent_rpcs.search_index_endpoint if parent_rpcs.respond_to? :search_index_endpoint - @search_index_endpoint = ::Gapic::Config::Method.new search_index_endpoint_config - create_index_endpoint_config = parent_rpcs.create_index_endpoint if parent_rpcs.respond_to? :create_index_endpoint - @create_index_endpoint = ::Gapic::Config::Method.new create_index_endpoint_config - get_index_endpoint_config = parent_rpcs.get_index_endpoint if parent_rpcs.respond_to? :get_index_endpoint - @get_index_endpoint = ::Gapic::Config::Method.new get_index_endpoint_config - list_index_endpoints_config = parent_rpcs.list_index_endpoints if parent_rpcs.respond_to? :list_index_endpoints - @list_index_endpoints = ::Gapic::Config::Method.new list_index_endpoints_config - update_index_endpoint_config = parent_rpcs.update_index_endpoint if parent_rpcs.respond_to? :update_index_endpoint - @update_index_endpoint = ::Gapic::Config::Method.new update_index_endpoint_config - delete_index_endpoint_config = parent_rpcs.delete_index_endpoint if parent_rpcs.respond_to? :delete_index_endpoint - @delete_index_endpoint = ::Gapic::Config::Method.new delete_index_endpoint_config - deploy_index_config = parent_rpcs.deploy_index if parent_rpcs.respond_to? :deploy_index - @deploy_index = ::Gapic::Config::Method.new deploy_index_config - undeploy_index_config = parent_rpcs.undeploy_index if parent_rpcs.respond_to? :undeploy_index - @undeploy_index = ::Gapic::Config::Method.new undeploy_index_config - create_collection_config = parent_rpcs.create_collection if parent_rpcs.respond_to? :create_collection - @create_collection = ::Gapic::Config::Method.new create_collection_config - delete_collection_config = parent_rpcs.delete_collection if parent_rpcs.respond_to? :delete_collection - @delete_collection = ::Gapic::Config::Method.new delete_collection_config - get_collection_config = parent_rpcs.get_collection if parent_rpcs.respond_to? :get_collection - @get_collection = ::Gapic::Config::Method.new get_collection_config - update_collection_config = parent_rpcs.update_collection if parent_rpcs.respond_to? :update_collection - @update_collection = ::Gapic::Config::Method.new update_collection_config - list_collections_config = parent_rpcs.list_collections if parent_rpcs.respond_to? :list_collections - @list_collections = ::Gapic::Config::Method.new list_collections_config - add_collection_item_config = parent_rpcs.add_collection_item if parent_rpcs.respond_to? :add_collection_item - @add_collection_item = ::Gapic::Config::Method.new add_collection_item_config - remove_collection_item_config = parent_rpcs.remove_collection_item if parent_rpcs.respond_to? :remove_collection_item - @remove_collection_item = ::Gapic::Config::Method.new remove_collection_item_config - view_collection_items_config = parent_rpcs.view_collection_items if parent_rpcs.respond_to? :view_collection_items - @view_collection_items = ::Gapic::Config::Method.new view_collection_items_config - - yield self if block_given? - end - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/warehouse/rest/operations.rb b/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/warehouse/rest/operations.rb deleted file mode 100644 index 3dfa6122bd2d..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/warehouse/rest/operations.rb +++ /dev/null @@ -1,974 +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 VisionAI - module V1 - module Warehouse - module Rest - # Service that implements Longrunning Operations API. - class Operations - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "warehouse-visionai.$UNIVERSE_DOMAIN$" - - # @private - attr_reader :operations_stub - - ## - # Configuration for the Warehouse 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 Warehouse 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::VisionAI::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::VisionAI::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::VisionAI::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::VisionAI::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 = "warehouse-visionai.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}/operations", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/?$}, 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] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/warehouseOperations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/corpora/[^/]+/assets/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/corpora/[^/]+/collections/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/corpora/[^/]+/imageIndexes/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/corpora/[^/]+/indexes/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/corpora/[^/]+/operations/[^/]+/?$}, false] - ] - ) - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/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{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] - ] - ) - 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{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/warehouse/rest/service_stub.rb b/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/warehouse/rest/service_stub.rb deleted file mode 100644 index 83933be98d94..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/vision_ai/v1/warehouse/rest/service_stub.rb +++ /dev/null @@ -1,3896 +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/visionai/v1/warehouse_pb" - -module Google - module Cloud - module VisionAI - module V1 - module Warehouse - module Rest - ## - # REST service stub for the Warehouse 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_asset REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::CreateAssetRequest] - # 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::VisionAI::V1::Asset] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::VisionAI::V1::Asset] - # A result object deserialized from the server's reply - def create_asset request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_asset_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_asset", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::VisionAI::V1::Asset.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_asset REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::UpdateAssetRequest] - # 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::VisionAI::V1::Asset] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::VisionAI::V1::Asset] - # A result object deserialized from the server's reply - def update_asset request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_asset_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_asset", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::VisionAI::V1::Asset.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_asset REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::GetAssetRequest] - # 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::VisionAI::V1::Asset] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::VisionAI::V1::Asset] - # A result object deserialized from the server's reply - def get_asset request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_asset_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_asset", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::VisionAI::V1::Asset.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_assets REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::ListAssetsRequest] - # 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::VisionAI::V1::ListAssetsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::VisionAI::V1::ListAssetsResponse] - # A result object deserialized from the server's reply - def list_assets request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_assets_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_assets", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::VisionAI::V1::ListAssetsResponse.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_asset REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::DeleteAssetRequest] - # 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_asset request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_delete_asset_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_asset", - 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 upload_asset REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::UploadAssetRequest] - # 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 upload_asset request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_upload_asset_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: "upload_asset", - 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 generate_retrieval_url REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::GenerateRetrievalUrlRequest] - # 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::VisionAI::V1::GenerateRetrievalUrlResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::VisionAI::V1::GenerateRetrievalUrlResponse] - # A result object deserialized from the server's reply - def generate_retrieval_url request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_generate_retrieval_url_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_retrieval_url", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::VisionAI::V1::GenerateRetrievalUrlResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the analyze_asset REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::AnalyzeAssetRequest] - # 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 analyze_asset request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_analyze_asset_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: "analyze_asset", - 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 index_asset REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::IndexAssetRequest] - # 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 index_asset request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_index_asset_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: "index_asset", - 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 remove_index_asset REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::RemoveIndexAssetRequest] - # 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 remove_index_asset request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_remove_index_asset_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: "remove_index_asset", - 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 view_indexed_assets REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::ViewIndexedAssetsRequest] - # 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::VisionAI::V1::ViewIndexedAssetsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::VisionAI::V1::ViewIndexedAssetsResponse] - # A result object deserialized from the server's reply - def view_indexed_assets request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_view_indexed_assets_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: "view_indexed_assets", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::VisionAI::V1::ViewIndexedAssetsResponse.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_index REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::CreateIndexRequest] - # 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_index request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_index_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_index", - 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 update_index REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::UpdateIndexRequest] - # 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 update_index request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_index_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_index", - 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_index REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::GetIndexRequest] - # 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::VisionAI::V1::Index] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::VisionAI::V1::Index] - # A result object deserialized from the server's reply - def get_index request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_index_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_index", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::VisionAI::V1::Index.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_indexes REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::ListIndexesRequest] - # 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::VisionAI::V1::ListIndexesResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::VisionAI::V1::ListIndexesResponse] - # A result object deserialized from the server's reply - def list_indexes request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_indexes_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_indexes", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::VisionAI::V1::ListIndexesResponse.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_index REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::DeleteIndexRequest] - # 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_index request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_delete_index_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_index", - 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_corpus REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::CreateCorpusRequest] - # 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_corpus request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_corpus_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_corpus", - 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_corpus REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::GetCorpusRequest] - # 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::VisionAI::V1::Corpus] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::VisionAI::V1::Corpus] - # A result object deserialized from the server's reply - def get_corpus request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_corpus_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_corpus", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::VisionAI::V1::Corpus.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_corpus REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::UpdateCorpusRequest] - # 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::VisionAI::V1::Corpus] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::VisionAI::V1::Corpus] - # A result object deserialized from the server's reply - def update_corpus request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_corpus_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_corpus", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::VisionAI::V1::Corpus.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_corpora REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::ListCorporaRequest] - # 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::VisionAI::V1::ListCorporaResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::VisionAI::V1::ListCorporaResponse] - # A result object deserialized from the server's reply - def list_corpora request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_corpora_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_corpora", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::VisionAI::V1::ListCorporaResponse.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_corpus REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::DeleteCorpusRequest] - # 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_corpus request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_delete_corpus_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_corpus", - 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 analyze_corpus REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::AnalyzeCorpusRequest] - # 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 analyze_corpus request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_analyze_corpus_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: "analyze_corpus", - 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_data_schema REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::CreateDataSchemaRequest] - # 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::VisionAI::V1::DataSchema] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::VisionAI::V1::DataSchema] - # A result object deserialized from the server's reply - def create_data_schema request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_data_schema_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_data_schema", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::VisionAI::V1::DataSchema.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_data_schema REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::UpdateDataSchemaRequest] - # 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::VisionAI::V1::DataSchema] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::VisionAI::V1::DataSchema] - # A result object deserialized from the server's reply - def update_data_schema request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_data_schema_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_data_schema", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::VisionAI::V1::DataSchema.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_data_schema REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::GetDataSchemaRequest] - # 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::VisionAI::V1::DataSchema] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::VisionAI::V1::DataSchema] - # A result object deserialized from the server's reply - def get_data_schema request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_data_schema_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_data_schema", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::VisionAI::V1::DataSchema.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_data_schema REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::DeleteDataSchemaRequest] - # 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_data_schema request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_delete_data_schema_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_data_schema", - 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 list_data_schemas REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::ListDataSchemasRequest] - # 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::VisionAI::V1::ListDataSchemasResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::VisionAI::V1::ListDataSchemasResponse] - # A result object deserialized from the server's reply - def list_data_schemas request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_data_schemas_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_data_schemas", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::VisionAI::V1::ListDataSchemasResponse.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_annotation REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::CreateAnnotationRequest] - # 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::VisionAI::V1::Annotation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::VisionAI::V1::Annotation] - # A result object deserialized from the server's reply - def create_annotation request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_annotation_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_annotation", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::VisionAI::V1::Annotation.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_annotation REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::GetAnnotationRequest] - # 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::VisionAI::V1::Annotation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::VisionAI::V1::Annotation] - # A result object deserialized from the server's reply - def get_annotation request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_annotation_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_annotation", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::VisionAI::V1::Annotation.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_annotations REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::ListAnnotationsRequest] - # 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::VisionAI::V1::ListAnnotationsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::VisionAI::V1::ListAnnotationsResponse] - # A result object deserialized from the server's reply - def list_annotations request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_annotations_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_annotations", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::VisionAI::V1::ListAnnotationsResponse.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_annotation REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::UpdateAnnotationRequest] - # 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::VisionAI::V1::Annotation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::VisionAI::V1::Annotation] - # A result object deserialized from the server's reply - def update_annotation request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_annotation_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_annotation", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::VisionAI::V1::Annotation.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_annotation REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::DeleteAnnotationRequest] - # 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_annotation request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_delete_annotation_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_annotation", - 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 clip_asset REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::ClipAssetRequest] - # 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::VisionAI::V1::ClipAssetResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::VisionAI::V1::ClipAssetResponse] - # A result object deserialized from the server's reply - def clip_asset request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_clip_asset_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: "clip_asset", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::VisionAI::V1::ClipAssetResponse.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_hls_uri REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::GenerateHlsUriRequest] - # 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::VisionAI::V1::GenerateHlsUriResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::VisionAI::V1::GenerateHlsUriResponse] - # A result object deserialized from the server's reply - def generate_hls_uri request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_generate_hls_uri_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_hls_uri", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::VisionAI::V1::GenerateHlsUriResponse.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_assets REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::ImportAssetsRequest] - # 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 import_assets request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_import_assets_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_assets", - 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_search_config REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::CreateSearchConfigRequest] - # 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::VisionAI::V1::SearchConfig] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::VisionAI::V1::SearchConfig] - # A result object deserialized from the server's reply - def create_search_config request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_search_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: "create_search_config", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::VisionAI::V1::SearchConfig.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_search_config REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::UpdateSearchConfigRequest] - # 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::VisionAI::V1::SearchConfig] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::VisionAI::V1::SearchConfig] - # A result object deserialized from the server's reply - def update_search_config request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_search_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_search_config", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::VisionAI::V1::SearchConfig.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_search_config REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::GetSearchConfigRequest] - # 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::VisionAI::V1::SearchConfig] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::VisionAI::V1::SearchConfig] - # A result object deserialized from the server's reply - def get_search_config request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_search_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_search_config", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::VisionAI::V1::SearchConfig.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_search_config REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::DeleteSearchConfigRequest] - # 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_search_config request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_delete_search_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: "delete_search_config", - 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 list_search_configs REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::ListSearchConfigsRequest] - # 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::VisionAI::V1::ListSearchConfigsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::VisionAI::V1::ListSearchConfigsResponse] - # A result object deserialized from the server's reply - def list_search_configs request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_search_configs_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_search_configs", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::VisionAI::V1::ListSearchConfigsResponse.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_search_hypernym REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::CreateSearchHypernymRequest] - # 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::VisionAI::V1::SearchHypernym] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::VisionAI::V1::SearchHypernym] - # A result object deserialized from the server's reply - def create_search_hypernym request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_search_hypernym_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_search_hypernym", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::VisionAI::V1::SearchHypernym.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_search_hypernym REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::UpdateSearchHypernymRequest] - # 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::VisionAI::V1::SearchHypernym] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::VisionAI::V1::SearchHypernym] - # A result object deserialized from the server's reply - def update_search_hypernym request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_search_hypernym_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_search_hypernym", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::VisionAI::V1::SearchHypernym.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_search_hypernym REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::GetSearchHypernymRequest] - # 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::VisionAI::V1::SearchHypernym] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::VisionAI::V1::SearchHypernym] - # A result object deserialized from the server's reply - def get_search_hypernym request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_search_hypernym_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_search_hypernym", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::VisionAI::V1::SearchHypernym.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_search_hypernym REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::DeleteSearchHypernymRequest] - # 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_search_hypernym request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_delete_search_hypernym_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_search_hypernym", - 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 list_search_hypernyms REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::ListSearchHypernymsRequest] - # 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::VisionAI::V1::ListSearchHypernymsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::VisionAI::V1::ListSearchHypernymsResponse] - # A result object deserialized from the server's reply - def list_search_hypernyms request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_search_hypernyms_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_search_hypernyms", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::VisionAI::V1::ListSearchHypernymsResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the search_assets REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::SearchAssetsRequest] - # 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::VisionAI::V1::SearchAssetsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::VisionAI::V1::SearchAssetsResponse] - # A result object deserialized from the server's reply - def search_assets request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_search_assets_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: "search_assets", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::VisionAI::V1::SearchAssetsResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the search_index_endpoint REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::SearchIndexEndpointRequest] - # 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::VisionAI::V1::SearchIndexEndpointResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::VisionAI::V1::SearchIndexEndpointResponse] - # A result object deserialized from the server's reply - def search_index_endpoint request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_search_index_endpoint_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: "search_index_endpoint", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::VisionAI::V1::SearchIndexEndpointResponse.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_index_endpoint REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::CreateIndexEndpointRequest] - # 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_index_endpoint request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_index_endpoint_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_index_endpoint", - 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_index_endpoint REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::GetIndexEndpointRequest] - # 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::VisionAI::V1::IndexEndpoint] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::VisionAI::V1::IndexEndpoint] - # A result object deserialized from the server's reply - def get_index_endpoint request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_index_endpoint_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_index_endpoint", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::VisionAI::V1::IndexEndpoint.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_index_endpoints REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::ListIndexEndpointsRequest] - # 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::VisionAI::V1::ListIndexEndpointsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::VisionAI::V1::ListIndexEndpointsResponse] - # A result object deserialized from the server's reply - def list_index_endpoints request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_index_endpoints_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_index_endpoints", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::VisionAI::V1::ListIndexEndpointsResponse.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_index_endpoint REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::UpdateIndexEndpointRequest] - # 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 update_index_endpoint request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_index_endpoint_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_index_endpoint", - 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_index_endpoint REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::DeleteIndexEndpointRequest] - # 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_index_endpoint request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_delete_index_endpoint_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_index_endpoint", - 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 deploy_index REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::DeployIndexRequest] - # 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 deploy_index request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_deploy_index_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: "deploy_index", - 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 undeploy_index REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::UndeployIndexRequest] - # 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 undeploy_index request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_undeploy_index_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: "undeploy_index", - 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_collection REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::CreateCollectionRequest] - # 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_collection request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_collection_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_collection", - 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_collection REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::DeleteCollectionRequest] - # 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_collection request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_delete_collection_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_collection", - 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_collection REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::GetCollectionRequest] - # 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::VisionAI::V1::Collection] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::VisionAI::V1::Collection] - # A result object deserialized from the server's reply - def get_collection request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_collection_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_collection", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::VisionAI::V1::Collection.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_collection REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::UpdateCollectionRequest] - # 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::VisionAI::V1::Collection] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::VisionAI::V1::Collection] - # A result object deserialized from the server's reply - def update_collection request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_collection_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_collection", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::VisionAI::V1::Collection.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_collections REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::ListCollectionsRequest] - # 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::VisionAI::V1::ListCollectionsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::VisionAI::V1::ListCollectionsResponse] - # A result object deserialized from the server's reply - def list_collections request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_collections_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_collections", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::VisionAI::V1::ListCollectionsResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the add_collection_item REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::AddCollectionItemRequest] - # 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::VisionAI::V1::AddCollectionItemResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::VisionAI::V1::AddCollectionItemResponse] - # A result object deserialized from the server's reply - def add_collection_item request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_add_collection_item_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: "add_collection_item", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::VisionAI::V1::AddCollectionItemResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the remove_collection_item REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::RemoveCollectionItemRequest] - # 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::VisionAI::V1::RemoveCollectionItemResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::VisionAI::V1::RemoveCollectionItemResponse] - # A result object deserialized from the server's reply - def remove_collection_item request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_remove_collection_item_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: "remove_collection_item", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::VisionAI::V1::RemoveCollectionItemResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the view_collection_items REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::ViewCollectionItemsRequest] - # 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::VisionAI::V1::ViewCollectionItemsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::VisionAI::V1::ViewCollectionItemsResponse] - # A result object deserialized from the server's reply - def view_collection_items request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_view_collection_items_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: "view_collection_items", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::VisionAI::V1::ViewCollectionItemsResponse.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_asset REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::CreateAssetRequest] - # 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_asset_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}/assets", - body: "asset", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/corpora/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_asset REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::UpdateAssetRequest] - # 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_asset_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v1/{asset.name}", - body: "asset", - matches: [ - ["asset.name", %r{^projects/[^/]+/locations/[^/]+/corpora/[^/]+/assets/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_asset REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::GetAssetRequest] - # 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_asset_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/corpora/[^/]+/assets/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_assets REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::ListAssetsRequest] - # 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_assets_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/assets", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/corpora/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_asset REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::DeleteAssetRequest] - # 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_asset_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/corpora/[^/]+/assets/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the upload_asset REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::UploadAssetRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_upload_asset_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:upload", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/corpora/[^/]+/assets/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the generate_retrieval_url REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::GenerateRetrievalUrlRequest] - # 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_retrieval_url_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:generateRetrievalUrl", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/corpora/[^/]+/assets/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the analyze_asset REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::AnalyzeAssetRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_analyze_asset_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:analyze", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/corpora/[^/]+/assets/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the index_asset REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::IndexAssetRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_index_asset_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:index", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/corpora/[^/]+/assets/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the remove_index_asset REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::RemoveIndexAssetRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_remove_index_asset_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:removeIndex", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/corpora/[^/]+/assets/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the view_indexed_assets REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::ViewIndexedAssetsRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_view_indexed_assets_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{index}:viewAssets", - matches: [ - ["index", %r{^projects/[^/]+/locations/[^/]+/corpora/[^/]+/indexes/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the create_index REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::CreateIndexRequest] - # 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_index_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}/indexes", - body: "index", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/corpora/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_index REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::UpdateIndexRequest] - # 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_index_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v1/{index.name}", - body: "index", - matches: [ - ["index.name", %r{^projects/[^/]+/locations/[^/]+/corpora/[^/]+/indexes/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_index REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::GetIndexRequest] - # 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_index_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/corpora/[^/]+/indexes/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_indexes REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::ListIndexesRequest] - # 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_indexes_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/indexes", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/corpora/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_index REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::DeleteIndexRequest] - # 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_index_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/corpora/[^/]+/indexes/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the create_corpus REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::CreateCorpusRequest] - # 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_corpus_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}/corpora", - body: "corpus", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_corpus REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::GetCorpusRequest] - # 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_corpus_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/corpora/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_corpus REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::UpdateCorpusRequest] - # 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_corpus_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v1/{corpus.name}", - body: "corpus", - matches: [ - ["corpus.name", %r{^projects/[^/]+/locations/[^/]+/corpora/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_corpora REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::ListCorporaRequest] - # 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_corpora_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/corpora", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_corpus REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::DeleteCorpusRequest] - # 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_corpus_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/corpora/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the analyze_corpus REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::AnalyzeCorpusRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_analyze_corpus_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:analyze", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/corpora/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the create_data_schema REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::CreateDataSchemaRequest] - # 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_data_schema_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}/dataSchemas", - body: "data_schema", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/corpora/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_data_schema REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::UpdateDataSchemaRequest] - # 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_data_schema_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v1/{data_schema.name}", - body: "data_schema", - matches: [ - ["data_schema.name", %r{^projects/[^/]+/locations/[^/]+/corpora/[^/]+/dataSchemas/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_data_schema REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::GetDataSchemaRequest] - # 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_data_schema_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/corpora/[^/]+/dataSchemas/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_data_schema REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::DeleteDataSchemaRequest] - # 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_data_schema_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/corpora/[^/]+/dataSchemas/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_data_schemas REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::ListDataSchemasRequest] - # 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_data_schemas_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/dataSchemas", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/corpora/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the create_annotation REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::CreateAnnotationRequest] - # 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_annotation_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}/annotations", - body: "annotation", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/corpora/[^/]+/assets/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_annotation REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::GetAnnotationRequest] - # 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_annotation_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/corpora/[^/]+/assets/[^/]+/annotations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_annotations REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::ListAnnotationsRequest] - # 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_annotations_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/annotations", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/corpora/[^/]+/assets/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_annotation REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::UpdateAnnotationRequest] - # 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_annotation_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v1/{annotation.name}", - body: "annotation", - matches: [ - ["annotation.name", %r{^projects/[^/]+/locations/[^/]+/corpora/[^/]+/assets/[^/]+/annotations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_annotation REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::DeleteAnnotationRequest] - # 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_annotation_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/corpora/[^/]+/assets/[^/]+/annotations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the clip_asset REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::ClipAssetRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_clip_asset_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:clip", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/corpora/[^/]+/assets/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the generate_hls_uri REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::GenerateHlsUriRequest] - # 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_hls_uri_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:generateHlsUri", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/corpora/[^/]+/assets/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the import_assets REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::ImportAssetsRequest] - # 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_assets_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}/assets:import", - body: "*", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/corpora/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the create_search_config REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::CreateSearchConfigRequest] - # 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_search_config_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}/searchConfigs", - body: "search_config", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/corpora/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_search_config REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::UpdateSearchConfigRequest] - # 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_search_config_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v1/{search_config.name}", - body: "search_config", - matches: [ - ["search_config.name", %r{^projects/[^/]+/locations/[^/]+/corpora/[^/]+/searchConfigs/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_search_config REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::GetSearchConfigRequest] - # 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_search_config_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/corpora/[^/]+/searchConfigs/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_search_config REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::DeleteSearchConfigRequest] - # 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_search_config_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/corpora/[^/]+/searchConfigs/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_search_configs REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::ListSearchConfigsRequest] - # 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_search_configs_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/searchConfigs", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/corpora/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the create_search_hypernym REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::CreateSearchHypernymRequest] - # 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_search_hypernym_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}/searchHypernyms", - body: "search_hypernym", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/corpora/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_search_hypernym REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::UpdateSearchHypernymRequest] - # 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_search_hypernym_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v1/{search_hypernym.name}", - body: "search_hypernym", - matches: [ - ["search_hypernym.name", %r{^projects/[^/]+/locations/[^/]+/corpora/[^/]+/searchHypernyms/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_search_hypernym REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::GetSearchHypernymRequest] - # 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_search_hypernym_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/corpora/[^/]+/searchHypernyms/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_search_hypernym REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::DeleteSearchHypernymRequest] - # 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_search_hypernym_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/corpora/[^/]+/searchHypernyms/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_search_hypernyms REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::ListSearchHypernymsRequest] - # 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_search_hypernyms_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/searchHypernyms", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/corpora/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the search_assets REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::SearchAssetsRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_search_assets_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{corpus}:searchAssets", - body: "*", - matches: [ - ["corpus", %r{^projects/[^/]+/locations/[^/]+/corpora/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the search_index_endpoint REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::SearchIndexEndpointRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_search_index_endpoint_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{index_endpoint}:searchIndexEndpoint", - body: "*", - matches: [ - ["index_endpoint", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the create_index_endpoint REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::CreateIndexEndpointRequest] - # 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_index_endpoint_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}/indexEndpoints", - body: "index_endpoint", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_index_endpoint REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::GetIndexEndpointRequest] - # 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_index_endpoint_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_index_endpoints REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::ListIndexEndpointsRequest] - # 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_index_endpoints_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/indexEndpoints", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_index_endpoint REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::UpdateIndexEndpointRequest] - # 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_index_endpoint_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v1/{index_endpoint.name}", - body: "index_endpoint", - matches: [ - ["index_endpoint.name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_index_endpoint REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::DeleteIndexEndpointRequest] - # 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_index_endpoint_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the deploy_index REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::DeployIndexRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_deploy_index_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{index_endpoint}:deployIndex", - body: "*", - matches: [ - ["index_endpoint", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the undeploy_index REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::UndeployIndexRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_undeploy_index_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{index_endpoint}:undeployIndex", - body: "*", - matches: [ - ["index_endpoint", %r{^projects/[^/]+/locations/[^/]+/indexEndpoints/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the create_collection REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::CreateCollectionRequest] - # 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_collection_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}/collections", - body: "collection", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/corpora/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_collection REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::DeleteCollectionRequest] - # 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_collection_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/corpora/[^/]+/collections/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_collection REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::GetCollectionRequest] - # 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_collection_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/corpora/[^/]+/collections/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_collection REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::UpdateCollectionRequest] - # 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_collection_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v1/{collection.name}", - body: "collection", - matches: [ - ["collection.name", %r{^projects/[^/]+/locations/[^/]+/corpora/[^/]+/collections/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_collections REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::ListCollectionsRequest] - # 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_collections_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/collections", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/corpora/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the add_collection_item REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::AddCollectionItemRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_add_collection_item_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{item.collection}:addCollectionItem", - body: "*", - matches: [ - ["item.collection", %r{^projects/[^/]+/locations/[^/]+/corpora/[^/]+/collections/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the remove_collection_item REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::RemoveCollectionItemRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_remove_collection_item_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{item.collection}:removeCollectionItem", - body: "*", - matches: [ - ["item.collection", %r{^projects/[^/]+/locations/[^/]+/corpora/[^/]+/collections/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the view_collection_items REST call - # - # @param request_pb [::Google::Cloud::VisionAI::V1::ViewCollectionItemsRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_view_collection_items_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{collection}:viewCollectionItems", - matches: [ - ["collection", %r{^projects/[^/]+/locations/[^/]+/corpora/[^/]+/collections/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/visionai/v1/annotations_pb.rb b/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/visionai/v1/annotations_pb.rb deleted file mode 100644 index 1a2ad095f3aa..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/visionai/v1/annotations_pb.rb +++ /dev/null @@ -1,67 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/visionai/v1/annotations.proto - -require 'google/protobuf' - -require 'google/protobuf/struct_pb' -require 'google/protobuf/timestamp_pb' - - -descriptor_data = "\n*google/cloud/visionai/v1/annotations.proto\x12\x18google.cloud.visionai.v1\x1a\x1cgoogle/protobuf/struct.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\x95\r\n*PersonalProtectiveEquipmentDetectionOutput\x12\x30\n\x0c\x63urrent_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12m\n\x10\x64\x65tected_persons\x18\x02 \x03(\x0b\x32S.google.cloud.visionai.v1.PersonalProtectiveEquipmentDetectionOutput.DetectedPerson\x1a(\n\x0cPersonEntity\x12\x18\n\x10person_entity_id\x18\x01 \x01(\x03\x1az\n\tPPEEntity\x12\x14\n\x0cppe_label_id\x18\x01 \x01(\x03\x12\x18\n\x10ppe_label_string\x18\x02 \x01(\t\x12&\n\x1eppe_supercategory_label_string\x18\x03 \x01(\t\x12\x15\n\rppe_entity_id\x18\x04 \x01(\x03\x1aR\n\x15NormalizedBoundingBox\x12\x0c\n\x04xmin\x18\x01 \x01(\x02\x12\x0c\n\x04ymin\x18\x02 \x01(\x02\x12\r\n\x05width\x18\x03 \x01(\x02\x12\x0e\n\x06height\x18\x04 \x01(\x02\x1a\xa6\x02\n\x13PersonIdentifiedBox\x12\x0e\n\x06\x62ox_id\x18\x01 \x01(\x03\x12{\n\x17normalized_bounding_box\x18\x02 \x01(\x0b\x32Z.google.cloud.visionai.v1.PersonalProtectiveEquipmentDetectionOutput.NormalizedBoundingBox\x12\x18\n\x10\x63onfidence_score\x18\x03 \x01(\x02\x12h\n\rperson_entity\x18\x04 \x01(\x0b\x32Q.google.cloud.visionai.v1.PersonalProtectiveEquipmentDetectionOutput.PersonEntity\x1a\x9d\x02\n\x10PPEIdentifiedBox\x12\x0e\n\x06\x62ox_id\x18\x01 \x01(\x03\x12{\n\x17normalized_bounding_box\x18\x02 \x01(\x0b\x32Z.google.cloud.visionai.v1.PersonalProtectiveEquipmentDetectionOutput.NormalizedBoundingBox\x12\x18\n\x10\x63onfidence_score\x18\x03 \x01(\x02\x12\x62\n\nppe_entity\x18\x04 \x01(\x0b\x32N.google.cloud.visionai.v1.PersonalProtectiveEquipmentDetectionOutput.PPEEntity\x1a\x82\x05\n\x0e\x44\x65tectedPerson\x12\x11\n\tperson_id\x18\x01 \x01(\x03\x12\x80\x01\n\x1e\x64\x65tected_person_identified_box\x18\x02 \x01(\x0b\x32X.google.cloud.visionai.v1.PersonalProtectiveEquipmentDetectionOutput.PersonIdentifiedBox\x12|\n\x1d\x64\x65tected_ppe_identified_boxes\x18\x03 \x03(\x0b\x32U.google.cloud.visionai.v1.PersonalProtectiveEquipmentDetectionOutput.PPEIdentifiedBox\x12 \n\x13\x66\x61\x63\x65_coverage_score\x18\x04 \x01(\x02H\x00\x88\x01\x01\x12 \n\x13\x65yes_coverage_score\x18\x05 \x01(\x02H\x01\x88\x01\x01\x12 \n\x13head_coverage_score\x18\x06 \x01(\x02H\x02\x88\x01\x01\x12!\n\x14hands_coverage_score\x18\x07 \x01(\x02H\x03\x88\x01\x01\x12 \n\x13\x62ody_coverage_score\x18\x08 \x01(\x02H\x04\x88\x01\x01\x12 \n\x13\x66\x65\x65t_coverage_score\x18\t \x01(\x02H\x05\x88\x01\x01\x42\x16\n\x14_face_coverage_scoreB\x16\n\x14_eyes_coverage_scoreB\x16\n\x14_head_coverage_scoreB\x17\n\x15_hands_coverage_scoreB\x16\n\x14_body_coverage_scoreB\x16\n\x14_feet_coverage_score\"\xca\x04\n\x1fObjectDetectionPredictionResult\x12\x30\n\x0c\x63urrent_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x61\n\x10identified_boxes\x18\x02 \x03(\x0b\x32G.google.cloud.visionai.v1.ObjectDetectionPredictionResult.IdentifiedBox\x1a\x30\n\x06\x45ntity\x12\x10\n\x08label_id\x18\x01 \x01(\x03\x12\x14\n\x0clabel_string\x18\x02 \x01(\t\x1a\xdf\x02\n\rIdentifiedBox\x12\x0e\n\x06\x62ox_id\x18\x01 \x01(\x03\x12~\n\x17normalized_bounding_box\x18\x02 \x01(\x0b\x32].google.cloud.visionai.v1.ObjectDetectionPredictionResult.IdentifiedBox.NormalizedBoundingBox\x12\x18\n\x10\x63onfidence_score\x18\x03 \x01(\x02\x12P\n\x06\x65ntity\x18\x04 \x01(\x0b\x32@.google.cloud.visionai.v1.ObjectDetectionPredictionResult.Entity\x1aR\n\x15NormalizedBoundingBox\x12\x0c\n\x04xmin\x18\x01 \x01(\x02\x12\x0c\n\x04ymin\x18\x02 \x01(\x02\x12\r\n\x05width\x18\x03 \x01(\x02\x12\x0e\n\x06height\x18\x04 \x01(\x02\"\x8b\x01\n$ImageObjectDetectionPredictionResult\x12\x0b\n\x03ids\x18\x01 \x03(\x03\x12\x15\n\rdisplay_names\x18\x02 \x03(\t\x12\x13\n\x0b\x63onfidences\x18\x03 \x03(\x02\x12*\n\x06\x62\x62oxes\x18\x04 \x03(\x0b\x32\x1a.google.protobuf.ListValue\"Y\n\x1e\x43lassificationPredictionResult\x12\x0b\n\x03ids\x18\x01 \x03(\x03\x12\x15\n\rdisplay_names\x18\x02 \x03(\t\x12\x13\n\x0b\x63onfidences\x18\x03 \x03(\x02\"S\n!ImageSegmentationPredictionResult\x12\x15\n\rcategory_mask\x18\x01 \x01(\t\x12\x17\n\x0f\x63onfidence_mask\x18\x02 \x01(\t\"\xc4\x02\n&VideoActionRecognitionPredictionResult\x12\x36\n\x12segment_start_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x34\n\x10segment_end_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x62\n\x07\x61\x63tions\x18\x03 \x03(\x0b\x32Q.google.cloud.visionai.v1.VideoActionRecognitionPredictionResult.IdentifiedAction\x1aH\n\x10IdentifiedAction\x12\n\n\x02id\x18\x01 \x01(\t\x12\x14\n\x0c\x64isplay_name\x18\x02 \x01(\t\x12\x12\n\nconfidence\x18\x03 \x01(\x02\"\xf9\x03\n#VideoObjectTrackingPredictionResult\x12\x36\n\x12segment_start_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x34\n\x10segment_end_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12]\n\x07objects\x18\x03 \x03(\x0b\x32L.google.cloud.visionai.v1.VideoObjectTrackingPredictionResult.DetectedObject\x1aI\n\x0b\x42oundingBox\x12\r\n\x05x_min\x18\x01 \x01(\x02\x12\r\n\x05x_max\x18\x02 \x01(\x02\x12\r\n\x05y_min\x18\x03 \x01(\x02\x12\r\n\x05y_max\x18\x04 \x01(\x02\x1a\xb9\x01\n\x0e\x44\x65tectedObject\x12\n\n\x02id\x18\x01 \x01(\t\x12\x14\n\x0c\x64isplay_name\x18\x02 \x01(\t\x12_\n\x0c\x62ounding_box\x18\x03 \x01(\x0b\x32I.google.cloud.visionai.v1.VideoObjectTrackingPredictionResult.BoundingBox\x12\x12\n\nconfidence\x18\x04 \x01(\x02\x12\x10\n\x08track_id\x18\x05 \x01(\x03\"\xd6\x02\n#VideoClassificationPredictionResult\x12\x36\n\x12segment_start_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x34\n\x10segment_end_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12o\n\x0f\x63lassifications\x18\x03 \x03(\x0b\x32V.google.cloud.visionai.v1.VideoClassificationPredictionResult.IdentifiedClassification\x1aP\n\x18IdentifiedClassification\x12\n\n\x02id\x18\x01 \x01(\t\x12\x14\n\x0c\x64isplay_name\x18\x02 \x01(\t\x12\x12\n\nconfidence\x18\x03 \x01(\x02\"\xeb\x13\n!OccupancyCountingPredictionResult\x12\x30\n\x0c\x63urrent_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x63\n\x10identified_boxes\x18\x02 \x03(\x0b\x32I.google.cloud.visionai.v1.OccupancyCountingPredictionResult.IdentifiedBox\x12P\n\x05stats\x18\x03 \x01(\x0b\x32\x41.google.cloud.visionai.v1.OccupancyCountingPredictionResult.Stats\x12Y\n\ntrack_info\x18\x04 \x03(\x0b\x32\x45.google.cloud.visionai.v1.OccupancyCountingPredictionResult.TrackInfo\x12\x62\n\x0f\x64well_time_info\x18\x05 \x03(\x0b\x32I.google.cloud.visionai.v1.OccupancyCountingPredictionResult.DwellTimeInfo\x12\x10\n\x03pts\x18\x06 \x01(\x03H\x00\x88\x01\x01\x1a\x30\n\x06\x45ntity\x12\x10\n\x08label_id\x18\x01 \x01(\x03\x12\x14\n\x0clabel_string\x18\x02 \x01(\t\x1a\xeb\x02\n\rIdentifiedBox\x12\x0e\n\x06\x62ox_id\x18\x01 \x01(\x03\x12\x80\x01\n\x17normalized_bounding_box\x18\x02 \x01(\x0b\x32_.google.cloud.visionai.v1.OccupancyCountingPredictionResult.IdentifiedBox.NormalizedBoundingBox\x12\r\n\x05score\x18\x03 \x01(\x02\x12R\n\x06\x65ntity\x18\x04 \x01(\x0b\x32\x42.google.cloud.visionai.v1.OccupancyCountingPredictionResult.Entity\x12\x10\n\x08track_id\x18\x05 \x01(\x03\x1aR\n\x15NormalizedBoundingBox\x12\x0c\n\x04xmin\x18\x01 \x01(\x02\x12\x0c\n\x04ymin\x18\x02 \x01(\x02\x12\r\n\x05width\x18\x03 \x01(\x02\x12\x0e\n\x06height\x18\x04 \x01(\x02\x1a\xf5\n\n\x05Stats\x12g\n\x10\x66ull_frame_count\x18\x01 \x03(\x0b\x32M.google.cloud.visionai.v1.OccupancyCountingPredictionResult.Stats.ObjectCount\x12q\n\x14\x63rossing_line_counts\x18\x02 \x03(\x0b\x32S.google.cloud.visionai.v1.OccupancyCountingPredictionResult.Stats.CrossingLineCount\x12m\n\x12\x61\x63tive_zone_counts\x18\x03 \x03(\x0b\x32Q.google.cloud.visionai.v1.OccupancyCountingPredictionResult.Stats.ActiveZoneCount\x1ap\n\x0bObjectCount\x12R\n\x06\x65ntity\x18\x01 \x01(\x0b\x32\x42.google.cloud.visionai.v1.OccupancyCountingPredictionResult.Entity\x12\r\n\x05\x63ount\x18\x02 \x01(\x05\x1a\xad\x01\n\x16\x41\x63\x63umulatedObjectCount\x12.\n\nstart_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x63\n\x0cobject_count\x18\x02 \x01(\x0b\x32M.google.cloud.visionai.v1.OccupancyCountingPredictionResult.Stats.ObjectCount\x1a\xcb\x04\n\x11\x43rossingLineCount\x12>\n\nannotation\x18\x01 \x01(\x0b\x32*.google.cloud.visionai.v1.StreamAnnotation\x12p\n\x19positive_direction_counts\x18\x02 \x03(\x0b\x32M.google.cloud.visionai.v1.OccupancyCountingPredictionResult.Stats.ObjectCount\x12p\n\x19negative_direction_counts\x18\x03 \x03(\x0b\x32M.google.cloud.visionai.v1.OccupancyCountingPredictionResult.Stats.ObjectCount\x12\x87\x01\n%accumulated_positive_direction_counts\x18\x04 \x03(\x0b\x32X.google.cloud.visionai.v1.OccupancyCountingPredictionResult.Stats.AccumulatedObjectCount\x12\x87\x01\n%accumulated_negative_direction_counts\x18\x05 \x03(\x0b\x32X.google.cloud.visionai.v1.OccupancyCountingPredictionResult.Stats.AccumulatedObjectCount\x1a\xb0\x01\n\x0f\x41\x63tiveZoneCount\x12>\n\nannotation\x18\x01 \x01(\x0b\x32*.google.cloud.visionai.v1.StreamAnnotation\x12]\n\x06\x63ounts\x18\x02 \x03(\x0b\x32M.google.cloud.visionai.v1.OccupancyCountingPredictionResult.Stats.ObjectCount\x1aM\n\tTrackInfo\x12\x10\n\x08track_id\x18\x01 \x01(\t\x12.\n\nstart_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x1a\x9c\x01\n\rDwellTimeInfo\x12\x10\n\x08track_id\x18\x01 \x01(\t\x12\x0f\n\x07zone_id\x18\x02 \x01(\t\x12\x34\n\x10\x64well_start_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x32\n\x0e\x64well_end_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x06\n\x04_pts\"\xaa\x02\n\x10StreamAnnotation\x12\x42\n\x0b\x61\x63tive_zone\x18\x05 \x01(\x0b\x32+.google.cloud.visionai.v1.NormalizedPolygonH\x00\x12\x45\n\rcrossing_line\x18\x06 \x01(\x0b\x32,.google.cloud.visionai.v1.NormalizedPolylineH\x00\x12\n\n\x02id\x18\x01 \x01(\t\x12\x14\n\x0c\x64isplay_name\x18\x02 \x01(\t\x12\x15\n\rsource_stream\x18\x03 \x01(\t\x12<\n\x04type\x18\x04 \x01(\x0e\x32..google.cloud.visionai.v1.StreamAnnotationTypeB\x14\n\x12\x61nnotation_payload\"[\n\x11StreamAnnotations\x12\x46\n\x12stream_annotations\x18\x01 \x03(\x0b\x32*.google.cloud.visionai.v1.StreamAnnotation\"\\\n\x11NormalizedPolygon\x12G\n\x13normalized_vertices\x18\x01 \x03(\x0b\x32*.google.cloud.visionai.v1.NormalizedVertex\"]\n\x12NormalizedPolyline\x12G\n\x13normalized_vertices\x18\x01 \x03(\x0b\x32*.google.cloud.visionai.v1.NormalizedVertex\"(\n\x10NormalizedVertex\x12\t\n\x01x\x18\x01 \x01(\x02\x12\t\n\x01y\x18\x02 \x01(\x02\"`\n\x13\x41ppPlatformMetadata\x12\x13\n\x0b\x61pplication\x18\x01 \x01(\t\x12\x13\n\x0binstance_id\x18\x02 \x01(\t\x12\x0c\n\x04node\x18\x03 \x01(\t\x12\x11\n\tprocessor\x18\x04 \x01(\t\"\xbe\x02\n\x1f\x41ppPlatformCloudFunctionRequest\x12L\n\x15\x61pp_platform_metadata\x18\x01 \x01(\x0b\x32-.google.cloud.visionai.v1.AppPlatformMetadata\x12\x66\n\x0b\x61nnotations\x18\x02 \x03(\x0b\x32Q.google.cloud.visionai.v1.AppPlatformCloudFunctionRequest.StructedInputAnnotation\x1a\x65\n\x17StructedInputAnnotation\x12\x1d\n\x15ingestion_time_micros\x18\x01 \x01(\x03\x12+\n\nannotation\x18\x02 \x01(\x0b\x32\x17.google.protobuf.Struct\"\xb5\x02\n AppPlatformCloudFunctionResponse\x12h\n\x0b\x61nnotations\x18\x02 \x03(\x0b\x32S.google.cloud.visionai.v1.AppPlatformCloudFunctionResponse.StructedOutputAnnotation\x12\x1e\n\x16\x61nnotation_passthrough\x18\x03 \x01(\x08\x12>\n\x06\x65vents\x18\x04 \x03(\x0b\x32..google.cloud.visionai.v1.AppPlatformEventBody\x1aG\n\x18StructedOutputAnnotation\x12+\n\nannotation\x18\x01 \x01(\x0b\x32\x17.google.protobuf.Struct\"i\n\x14\x41ppPlatformEventBody\x12\x15\n\revent_message\x18\x01 \x01(\t\x12(\n\x07payload\x18\x02 \x01(\x0b\x32\x17.google.protobuf.Struct\x12\x10\n\x08\x65vent_id\x18\x03 \x01(\t*\x90\x01\n\x14StreamAnnotationType\x12&\n\"STREAM_ANNOTATION_TYPE_UNSPECIFIED\x10\x00\x12&\n\"STREAM_ANNOTATION_TYPE_ACTIVE_ZONE\x10\x01\x12(\n$STREAM_ANNOTATION_TYPE_CROSSING_LINE\x10\x02\x42\xc0\x01\n\x1c\x63om.google.cloud.visionai.v1B\x10\x41nnotationsProtoP\x01Z8cloud.google.com/go/visionai/apiv1/visionaipb;visionaipb\xaa\x02\x18Google.Cloud.VisionAI.V1\xca\x02\x18Google\\Cloud\\VisionAI\\V1\xea\x02\x1bGoogle::Cloud::VisionAI::V1b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module VisionAI - module V1 - PersonalProtectiveEquipmentDetectionOutput = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.PersonalProtectiveEquipmentDetectionOutput").msgclass - PersonalProtectiveEquipmentDetectionOutput::PersonEntity = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.PersonalProtectiveEquipmentDetectionOutput.PersonEntity").msgclass - PersonalProtectiveEquipmentDetectionOutput::PPEEntity = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.PersonalProtectiveEquipmentDetectionOutput.PPEEntity").msgclass - PersonalProtectiveEquipmentDetectionOutput::NormalizedBoundingBox = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.PersonalProtectiveEquipmentDetectionOutput.NormalizedBoundingBox").msgclass - PersonalProtectiveEquipmentDetectionOutput::PersonIdentifiedBox = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.PersonalProtectiveEquipmentDetectionOutput.PersonIdentifiedBox").msgclass - PersonalProtectiveEquipmentDetectionOutput::PPEIdentifiedBox = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.PersonalProtectiveEquipmentDetectionOutput.PPEIdentifiedBox").msgclass - PersonalProtectiveEquipmentDetectionOutput::DetectedPerson = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.PersonalProtectiveEquipmentDetectionOutput.DetectedPerson").msgclass - ObjectDetectionPredictionResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.ObjectDetectionPredictionResult").msgclass - ObjectDetectionPredictionResult::Entity = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.ObjectDetectionPredictionResult.Entity").msgclass - ObjectDetectionPredictionResult::IdentifiedBox = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.ObjectDetectionPredictionResult.IdentifiedBox").msgclass - ObjectDetectionPredictionResult::IdentifiedBox::NormalizedBoundingBox = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.ObjectDetectionPredictionResult.IdentifiedBox.NormalizedBoundingBox").msgclass - ImageObjectDetectionPredictionResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.ImageObjectDetectionPredictionResult").msgclass - ClassificationPredictionResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.ClassificationPredictionResult").msgclass - ImageSegmentationPredictionResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.ImageSegmentationPredictionResult").msgclass - VideoActionRecognitionPredictionResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.VideoActionRecognitionPredictionResult").msgclass - VideoActionRecognitionPredictionResult::IdentifiedAction = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.VideoActionRecognitionPredictionResult.IdentifiedAction").msgclass - VideoObjectTrackingPredictionResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.VideoObjectTrackingPredictionResult").msgclass - VideoObjectTrackingPredictionResult::BoundingBox = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.VideoObjectTrackingPredictionResult.BoundingBox").msgclass - VideoObjectTrackingPredictionResult::DetectedObject = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.VideoObjectTrackingPredictionResult.DetectedObject").msgclass - VideoClassificationPredictionResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.VideoClassificationPredictionResult").msgclass - VideoClassificationPredictionResult::IdentifiedClassification = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.VideoClassificationPredictionResult.IdentifiedClassification").msgclass - OccupancyCountingPredictionResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.OccupancyCountingPredictionResult").msgclass - OccupancyCountingPredictionResult::Entity = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.OccupancyCountingPredictionResult.Entity").msgclass - OccupancyCountingPredictionResult::IdentifiedBox = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.OccupancyCountingPredictionResult.IdentifiedBox").msgclass - OccupancyCountingPredictionResult::IdentifiedBox::NormalizedBoundingBox = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.OccupancyCountingPredictionResult.IdentifiedBox.NormalizedBoundingBox").msgclass - OccupancyCountingPredictionResult::Stats = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.OccupancyCountingPredictionResult.Stats").msgclass - OccupancyCountingPredictionResult::Stats::ObjectCount = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.OccupancyCountingPredictionResult.Stats.ObjectCount").msgclass - OccupancyCountingPredictionResult::Stats::AccumulatedObjectCount = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.OccupancyCountingPredictionResult.Stats.AccumulatedObjectCount").msgclass - OccupancyCountingPredictionResult::Stats::CrossingLineCount = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.OccupancyCountingPredictionResult.Stats.CrossingLineCount").msgclass - OccupancyCountingPredictionResult::Stats::ActiveZoneCount = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.OccupancyCountingPredictionResult.Stats.ActiveZoneCount").msgclass - OccupancyCountingPredictionResult::TrackInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.OccupancyCountingPredictionResult.TrackInfo").msgclass - OccupancyCountingPredictionResult::DwellTimeInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.OccupancyCountingPredictionResult.DwellTimeInfo").msgclass - StreamAnnotation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.StreamAnnotation").msgclass - StreamAnnotations = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.StreamAnnotations").msgclass - NormalizedPolygon = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.NormalizedPolygon").msgclass - NormalizedPolyline = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.NormalizedPolyline").msgclass - NormalizedVertex = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.NormalizedVertex").msgclass - AppPlatformMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.AppPlatformMetadata").msgclass - AppPlatformCloudFunctionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.AppPlatformCloudFunctionRequest").msgclass - AppPlatformCloudFunctionRequest::StructedInputAnnotation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.AppPlatformCloudFunctionRequest.StructedInputAnnotation").msgclass - AppPlatformCloudFunctionResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.AppPlatformCloudFunctionResponse").msgclass - AppPlatformCloudFunctionResponse::StructedOutputAnnotation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.AppPlatformCloudFunctionResponse.StructedOutputAnnotation").msgclass - AppPlatformEventBody = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.AppPlatformEventBody").msgclass - StreamAnnotationType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.StreamAnnotationType").enummodule - end - end - end -end diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/visionai/v1/common_pb.rb b/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/visionai/v1/common_pb.rb deleted file mode 100644 index 752b9719abc5..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/visionai/v1/common_pb.rb +++ /dev/null @@ -1,28 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/visionai/v1/common.proto - -require 'google/protobuf' - -require 'google/api/field_behavior_pb' -require 'google/api/resource_pb' -require 'google/protobuf/timestamp_pb' - - -descriptor_data = "\n%google/cloud/visionai/v1/common.proto\x12\x18google.cloud.visionai.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xac\x05\n\x07\x43luster\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\x12\x34\n\x0bupdate_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12=\n\x06labels\x18\x04 \x03(\x0b\x32-.google.cloud.visionai.v1.Cluster.LabelsEntry\x12G\n\x0b\x61nnotations\x18\x05 \x03(\x0b\x32\x32.google.cloud.visionai.v1.Cluster.AnnotationsEntry\x12\'\n\x1a\x64\x61taplane_service_endpoint\x18\x06 \x01(\tB\x03\xe0\x41\x03\x12;\n\x05state\x18\x07 \x01(\x0e\x32\'.google.cloud.visionai.v1.Cluster.StateB\x03\xe0\x41\x03\x12\x17\n\npsc_target\x18\x08 \x01(\tB\x03\xe0\x41\x03\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a\x32\n\x10\x41nnotationsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"V\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x10\n\x0cPROVISIONING\x10\x01\x12\x0b\n\x07RUNNING\x10\x02\x12\x0c\n\x08STOPPING\x10\x03\x12\t\n\x05\x45RROR\x10\x04:`\xea\x41]\n\x1fvisionai.googleapis.com/Cluster\x12:projects/{project}/locations/{location}/clusters/{cluster}\"\x80\x02\n\x11OperationMetadata\x12\x34\n\x0b\x63reate_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x31\n\x08\x65nd_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x13\n\x06target\x18\x03 \x01(\tB\x03\xe0\x41\x03\x12\x11\n\x04verb\x18\x04 \x01(\tB\x03\xe0\x41\x03\x12\x1b\n\x0estatus_message\x18\x05 \x01(\tB\x03\xe0\x41\x03\x12#\n\x16requested_cancellation\x18\x06 \x01(\x08\x42\x03\xe0\x41\x03\x12\x18\n\x0b\x61pi_version\x18\x07 \x01(\tB\x03\xe0\x41\x03\"\x1e\n\tGcsSource\x12\x11\n\x04uris\x18\x01 \x03(\tB\x03\xe0\x41\x02\x42\xbb\x01\n\x1c\x63om.google.cloud.visionai.v1B\x0b\x43ommonProtoP\x01Z8cloud.google.com/go/visionai/apiv1/visionaipb;visionaipb\xaa\x02\x18Google.Cloud.VisionAI.V1\xca\x02\x18Google\\Cloud\\VisionAI\\V1\xea\x02\x1bGoogle::Cloud::VisionAI::V1b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module VisionAI - module V1 - Cluster = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.Cluster").msgclass - Cluster::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.Cluster.State").enummodule - OperationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.OperationMetadata").msgclass - GcsSource = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.GcsSource").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/visionai/v1/health_service_pb.rb b/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/visionai/v1/health_service_pb.rb deleted file mode 100644 index 156efca341ba..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/visionai/v1/health_service_pb.rb +++ /dev/null @@ -1,27 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/visionai/v1/health_service.proto - -require 'google/protobuf' - -require 'google/api/annotations_pb' -require 'google/api/client_pb' -require 'google/api/resource_pb' - - -descriptor_data = "\n-google/cloud/visionai/v1/health_service.proto\x12\x18google.cloud.visionai.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x19google/api/resource.proto\"K\n\x12HealthCheckRequest\x12\x35\n\x07\x63luster\x18\x01 \x01(\tB$\xfa\x41!\n\x1fvisionai.googleapis.com/Cluster\"s\n\x13HealthCheckResponse\x12\x0f\n\x07healthy\x18\x01 \x01(\x08\x12\x0e\n\x06reason\x18\x02 \x01(\t\x12;\n\x0c\x63luster_info\x18\x03 \x01(\x0b\x32%.google.cloud.visionai.v1.ClusterInfo\"=\n\x0b\x43lusterInfo\x12\x15\n\rstreams_count\x18\x01 \x01(\x05\x12\x17\n\x0fprocesses_count\x18\x02 \x01(\x05\x32\x93\x02\n\x12HealthCheckService\x12\xaf\x01\n\x0bHealthCheck\x12,.google.cloud.visionai.v1.HealthCheckRequest\x1a-.google.cloud.visionai.v1.HealthCheckResponse\"C\x82\xd3\xe4\x93\x02=\x12;/v1/{cluster=projects/*/locations/*/clusters/*}:healthCheck\x1aK\xca\x41\x17visionai.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\xc7\x01\n\x1c\x63om.google.cloud.visionai.v1B\x17HealthCheckServiceProtoP\x01Z8cloud.google.com/go/visionai/apiv1/visionaipb;visionaipb\xaa\x02\x18Google.Cloud.VisionAI.V1\xca\x02\x18Google\\Cloud\\VisionAI\\V1\xea\x02\x1bGoogle::Cloud::VisionAI::V1b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module VisionAI - module V1 - HealthCheckRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.HealthCheckRequest").msgclass - HealthCheckResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.HealthCheckResponse").msgclass - ClusterInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.ClusterInfo").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/visionai/v1/health_service_services_pb.rb b/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/visionai/v1/health_service_services_pb.rb deleted file mode 100644 index f470a270025f..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/visionai/v1/health_service_services_pb.rb +++ /dev/null @@ -1,46 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# Source: google/cloud/visionai/v1/health_service.proto for package 'Google.Cloud.VisionAI.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/visionai/v1/health_service_pb' - -module Google - module Cloud - module VisionAI - module V1 - module HealthCheckService - # HealthCheckService provides an interface for Vertex AI Vision Cluster Health - # Check. - class Service - - include ::GRPC::GenericService - - self.marshal_class_method = :encode - self.unmarshal_class_method = :decode - self.service_name = 'google.cloud.visionai.v1.HealthCheckService' - - # HealthCheck method checks the health status of the cluster. - rpc :HealthCheck, ::Google::Cloud::VisionAI::V1::HealthCheckRequest, ::Google::Cloud::VisionAI::V1::HealthCheckResponse - end - - Stub = Service.rpc_stub_class - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/visionai/v1/lva_pb.rb b/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/visionai/v1/lva_pb.rb deleted file mode 100644 index 3b77f27db668..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/visionai/v1/lva_pb.rb +++ /dev/null @@ -1,33 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/visionai/v1/lva.proto - -require 'google/protobuf' - - -descriptor_data = "\n\"google/cloud/visionai/v1/lva.proto\x12\x18google.cloud.visionai.v1\"\xca\x04\n\x12OperatorDefinition\x12\x10\n\x08operator\x18\x01 \x01(\t\x12S\n\ninput_args\x18\x02 \x03(\x0b\x32?.google.cloud.visionai.v1.OperatorDefinition.ArgumentDefinition\x12T\n\x0boutput_args\x18\x03 \x03(\x0b\x32?.google.cloud.visionai.v1.OperatorDefinition.ArgumentDefinition\x12T\n\nattributes\x18\x04 \x03(\x0b\x32@.google.cloud.visionai.v1.OperatorDefinition.AttributeDefinition\x12\x42\n\tresources\x18\x05 \x01(\x0b\x32/.google.cloud.visionai.v1.ResourceSpecification\x12\x19\n\x11short_description\x18\x06 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x07 \x01(\t\x1a\x34\n\x12\x41rgumentDefinition\x12\x10\n\x08\x61rgument\x18\x01 \x01(\t\x12\x0c\n\x04type\x18\x02 \x01(\t\x1aw\n\x13\x41ttributeDefinition\x12\x11\n\tattribute\x18\x01 \x01(\t\x12\x0c\n\x04type\x18\x02 \x01(\t\x12?\n\rdefault_value\x18\x03 \x01(\x0b\x32(.google.cloud.visionai.v1.AttributeValue\"\x88\x01\n\x15ResourceSpecification\x12\x0b\n\x03\x63pu\x18\x01 \x01(\t\x12\x12\n\ncpu_limits\x18\x05 \x01(\t\x12\x0e\n\x06memory\x18\x02 \x01(\t\x12\x15\n\rmemory_limits\x18\x06 \x01(\t\x12\x0c\n\x04gpus\x18\x03 \x01(\x05\x12\x19\n\x11latency_budget_ms\x18\x04 \x01(\x05\"M\n\x0e\x41ttributeValue\x12\x0b\n\x01i\x18\x01 \x01(\x03H\x00\x12\x0b\n\x01\x66\x18\x02 \x01(\x02H\x00\x12\x0b\n\x01\x62\x18\x03 \x01(\x08H\x00\x12\x0b\n\x01s\x18\x04 \x01(\x0cH\x00\x42\x07\n\x05value\"\xdb\x05\n\x12\x41nalyzerDefinition\x12\x10\n\x08\x61nalyzer\x18\x01 \x01(\t\x12\x10\n\x08operator\x18\x02 \x01(\t\x12H\n\x06inputs\x18\x03 \x03(\x0b\x32\x38.google.cloud.visionai.v1.AnalyzerDefinition.StreamInput\x12\x46\n\x05\x61ttrs\x18\x04 \x03(\x0b\x32\x37.google.cloud.visionai.v1.AnalyzerDefinition.AttrsEntry\x12P\n\rdebug_options\x18\x05 \x01(\x0b\x32\x39.google.cloud.visionai.v1.AnalyzerDefinition.DebugOptions\x12T\n\x0foperator_option\x18\x06 \x01(\x0b\x32;.google.cloud.visionai.v1.AnalyzerDefinition.OperatorOption\x1a\x1c\n\x0bStreamInput\x12\r\n\x05input\x18\x01 \x01(\t\x1a\xbf\x01\n\x0c\x44\x65\x62ugOptions\x12r\n\x15\x65nvironment_variables\x18\x01 \x03(\x0b\x32S.google.cloud.visionai.v1.AnalyzerDefinition.DebugOptions.EnvironmentVariablesEntry\x1a;\n\x19\x45nvironmentVariablesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a/\n\x0eOperatorOption\x12\x0b\n\x03tag\x18\x01 \x01(\t\x12\x10\n\x08registry\x18\x02 \x01(\t\x1aV\n\nAttrsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\x37\n\x05value\x18\x02 \x01(\x0b\x32(.google.cloud.visionai.v1.AttributeValue:\x02\x38\x01\"U\n\x12\x41nalysisDefinition\x12?\n\tanalyzers\x18\x01 \x03(\x0b\x32,.google.cloud.visionai.v1.AnalyzerDefinition\"\xbc\x01\n\tRunStatus\x12\x38\n\x05state\x18\x01 \x01(\x0e\x32).google.cloud.visionai.v1.RunStatus.State\x12\x0e\n\x06reason\x18\x02 \x01(\t\"e\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x10\n\x0cINITIALIZING\x10\x01\x12\x0b\n\x07RUNNING\x10\x02\x12\r\n\tCOMPLETED\x10\x03\x12\n\n\x06\x46\x41ILED\x10\x04\x12\x0b\n\x07PENDING\x10\x05*=\n\x07RunMode\x12\x18\n\x14RUN_MODE_UNSPECIFIED\x10\x00\x12\x08\n\x04LIVE\x10\x01\x12\x0e\n\nSUBMISSION\x10\x02\x42\xb8\x01\n\x1c\x63om.google.cloud.visionai.v1B\x08LvaProtoP\x01Z8cloud.google.com/go/visionai/apiv1/visionaipb;visionaipb\xaa\x02\x18Google.Cloud.VisionAI.V1\xca\x02\x18Google\\Cloud\\VisionAI\\V1\xea\x02\x1bGoogle::Cloud::VisionAI::V1b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module VisionAI - module V1 - OperatorDefinition = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.OperatorDefinition").msgclass - OperatorDefinition::ArgumentDefinition = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.OperatorDefinition.ArgumentDefinition").msgclass - OperatorDefinition::AttributeDefinition = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.OperatorDefinition.AttributeDefinition").msgclass - ResourceSpecification = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.ResourceSpecification").msgclass - AttributeValue = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.AttributeValue").msgclass - AnalyzerDefinition = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.AnalyzerDefinition").msgclass - AnalyzerDefinition::StreamInput = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.AnalyzerDefinition.StreamInput").msgclass - AnalyzerDefinition::DebugOptions = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.AnalyzerDefinition.DebugOptions").msgclass - AnalyzerDefinition::OperatorOption = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.AnalyzerDefinition.OperatorOption").msgclass - AnalysisDefinition = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.AnalysisDefinition").msgclass - RunStatus = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.RunStatus").msgclass - RunStatus::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.RunStatus.State").enummodule - RunMode = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.RunMode").enummodule - end - end - end -end diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/visionai/v1/lva_resources_pb.rb b/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/visionai/v1/lva_resources_pb.rb deleted file mode 100644 index d210fa877ed6..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/visionai/v1/lva_resources_pb.rb +++ /dev/null @@ -1,28 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/visionai/v1/lva_resources.proto - -require 'google/protobuf' - -require 'google/api/field_behavior_pb' -require 'google/api/resource_pb' -require 'google/cloud/visionai/v1/lva_pb' -require 'google/protobuf/timestamp_pb' - - -descriptor_data = "\n,google/cloud/visionai/v1/lva_resources.proto\x12\x18google.cloud.visionai.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\"google/cloud/visionai/v1/lva.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xb9\x03\n\x08Operator\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x34\n\x0b\x63reate_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12>\n\x06labels\x18\x04 \x03(\x0b\x32..google.cloud.visionai.v1.Operator.LabelsEntry\x12I\n\x13operator_definition\x18\x05 \x01(\x0b\x32,.google.cloud.visionai.v1.OperatorDefinition\x12\x14\n\x0c\x64ocker_image\x18\x06 \x01(\t\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01:c\xea\x41`\n visionai.googleapis.com/Operator\x12\n\x06labels\x18\x04 \x03(\x0b\x32..google.cloud.visionai.v1.Analysis.LabelsEntry\x12I\n\x13\x61nalysis_definition\x18\x05 \x01(\x0b\x32,.google.cloud.visionai.v1.AnalysisDefinition\x12Z\n\x15input_streams_mapping\x18\x06 \x03(\x0b\x32;.google.cloud.visionai.v1.Analysis.InputStreamsMappingEntry\x12\\\n\x16output_streams_mapping\x18\x07 \x03(\x0b\x32<.google.cloud.visionai.v1.Analysis.OutputStreamsMappingEntry\x12\x1b\n\x13\x64isable_event_watch\x18\x08 \x01(\x08\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a:\n\x18InputStreamsMappingEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a;\n\x19OutputStreamsMappingEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01:u\xea\x41r\n visionai.googleapis.com/Analysis\x12Nprojects/{project}/locations/{location}/clusters/{cluster}/analyses/{analysis}\"\x97\x04\n\x07Process\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x34\n\x0b\x63reate_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12:\n\x08\x61nalysis\x18\x04 \x01(\tB(\xe0\x41\x02\xfa\x41\"\n visionai.googleapis.com/Analysis\x12 \n\x13\x61ttribute_overrides\x18\x05 \x03(\tB\x03\xe0\x41\x01\x12<\n\nrun_status\x18\x06 \x01(\x0b\x32#.google.cloud.visionai.v1.RunStatusB\x03\xe0\x41\x01\x12\x38\n\x08run_mode\x18\x07 \x01(\x0e\x32!.google.cloud.visionai.v1.RunModeB\x03\xe0\x41\x01\x12\x15\n\x08\x65vent_id\x18\x08 \x01(\tB\x03\xe0\x41\x01\x12\x15\n\x08\x62\x61tch_id\x18\t \x01(\tB\x03\xe0\x41\x01\x12\x18\n\x0bretry_count\x18\n \x01(\x05\x42\x03\xe0\x41\x01:t\xea\x41q\n\x1fvisionai.googleapis.com/Process\x12Nprojects/{project}/locations/{location}/clusters/{cluster}/processes/{process}B\xc1\x01\n\x1c\x63om.google.cloud.visionai.v1B\x11LvaResourcesProtoP\x01Z8cloud.google.com/go/visionai/apiv1/visionaipb;visionaipb\xaa\x02\x18Google.Cloud.VisionAI.V1\xca\x02\x18Google\\Cloud\\VisionAI\\V1\xea\x02\x1bGoogle::Cloud::VisionAI::V1b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module VisionAI - module V1 - Operator = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.Operator").msgclass - Analysis = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.Analysis").msgclass - Process = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.Process").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/visionai/v1/lva_service_pb.rb b/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/visionai/v1/lva_service_pb.rb deleted file mode 100644 index 5c2a943b08c2..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/visionai/v1/lva_service_pb.rb +++ /dev/null @@ -1,57 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/visionai/v1/lva_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/visionai/v1/common_pb' -require 'google/cloud/visionai/v1/lva_resources_pb' -require 'google/longrunning/operations_pb' -require 'google/protobuf/empty_pb' -require 'google/protobuf/field_mask_pb' - - -descriptor_data = "\n*google/cloud/visionai/v1/lva_service.proto\x12\x18google.cloud.visionai.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/visionai/v1/common.proto\x1a,google/cloud/visionai/v1/lva_resources.proto\x1a#google/longrunning/operations.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\"\x9a\x01\n\x14ListOperatorsRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\x12\x0e\n\x06\x66ilter\x18\x04 \x01(\t\x12\x10\n\x08order_by\x18\x05 \x01(\t\"|\n\x15ListOperatorsResponse\x12\x35\n\toperators\x18\x01 \x03(\x0b\x32\".google.cloud.visionai.v1.Operator\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x13\n\x0bunreachable\x18\x03 \x03(\t\"L\n\x12GetOperatorRequest\x12\x36\n\x04name\x18\x01 \x01(\tB(\xe0\x41\x02\xfa\x41\"\n visionai.googleapis.com/Operator\"\xc0\x01\n\x15\x43reateOperatorRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\x12\x18\n\x0boperator_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x39\n\x08operator\x18\x03 \x01(\x0b\x32\".google.cloud.visionai.v1.OperatorB\x03\xe0\x41\x02\x12\x17\n\nrequest_id\x18\x04 \x01(\tB\x03\xe0\x41\x01\"\xa1\x01\n\x15UpdateOperatorRequest\x12\x34\n\x0bupdate_mask\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\x12\x39\n\x08operator\x18\x02 \x01(\x0b\x32\".google.cloud.visionai.v1.OperatorB\x03\xe0\x41\x02\x12\x17\n\nrequest_id\x18\x03 \x01(\tB\x03\xe0\x41\x01\"h\n\x15\x44\x65leteOperatorRequest\x12\x36\n\x04name\x18\x01 \x01(\tB(\xe0\x41\x02\xfa\x41\"\n visionai.googleapis.com/Operator\x12\x17\n\nrequest_id\x18\x02 \x01(\tB\x03\xe0\x41\x01\"\x97\x01\n\x13ListAnalysesRequest\x12\x37\n\x06parent\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1fvisionai.googleapis.com/Cluster\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\x12\x0e\n\x06\x66ilter\x18\x04 \x01(\t\x12\x10\n\x08order_by\x18\x05 \x01(\t\"z\n\x14ListAnalysesResponse\x12\x34\n\x08\x61nalyses\x18\x01 \x03(\x0b\x32\".google.cloud.visionai.v1.Analysis\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x13\n\x0bunreachable\x18\x03 \x03(\t\"L\n\x12GetAnalysisRequest\x12\x36\n\x04name\x18\x01 \x01(\tB(\xe0\x41\x02\xfa\x41\"\n visionai.googleapis.com/Analysis\"\xbe\x01\n\x15\x43reateAnalysisRequest\x12\x37\n\x06parent\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1fvisionai.googleapis.com/Cluster\x12\x18\n\x0b\x61nalysis_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x39\n\x08\x61nalysis\x18\x03 \x01(\x0b\x32\".google.cloud.visionai.v1.AnalysisB\x03\xe0\x41\x02\x12\x17\n\nrequest_id\x18\x04 \x01(\tB\x03\xe0\x41\x01\"\xa1\x01\n\x15UpdateAnalysisRequest\x12\x34\n\x0bupdate_mask\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\x12\x39\n\x08\x61nalysis\x18\x02 \x01(\x0b\x32\".google.cloud.visionai.v1.AnalysisB\x03\xe0\x41\x02\x12\x17\n\nrequest_id\x18\x03 \x01(\tB\x03\xe0\x41\x01\"h\n\x15\x44\x65leteAnalysisRequest\x12\x36\n\x04name\x18\x01 \x01(\tB(\xe0\x41\x02\xfa\x41\"\n visionai.googleapis.com/Analysis\x12\x17\n\nrequest_id\x18\x02 \x01(\tB\x03\xe0\x41\x01\"\x98\x01\n\x14ListProcessesRequest\x12\x37\n\x06parent\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1fvisionai.googleapis.com/Cluster\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\x12\x0e\n\x06\x66ilter\x18\x04 \x01(\t\x12\x10\n\x08order_by\x18\x05 \x01(\t\"{\n\x15ListProcessesResponse\x12\x34\n\tprocesses\x18\x01 \x03(\x0b\x32!.google.cloud.visionai.v1.Process\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x13\n\x0bunreachable\x18\x03 \x03(\t\"J\n\x11GetProcessRequest\x12\x35\n\x04name\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1fvisionai.googleapis.com/Process\"\xba\x01\n\x14\x43reateProcessRequest\x12\x37\n\x06parent\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1fvisionai.googleapis.com/Cluster\x12\x17\n\nprocess_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x37\n\x07process\x18\x03 \x01(\x0b\x32!.google.cloud.visionai.v1.ProcessB\x03\xe0\x41\x02\x12\x17\n\nrequest_id\x18\x04 \x01(\tB\x03\xe0\x41\x01\"\x9e\x01\n\x14UpdateProcessRequest\x12\x34\n\x0bupdate_mask\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\x12\x37\n\x07process\x18\x02 \x01(\x0b\x32!.google.cloud.visionai.v1.ProcessB\x03\xe0\x41\x02\x12\x17\n\nrequest_id\x18\x03 \x01(\tB\x03\xe0\x41\x01\"f\n\x14\x44\x65leteProcessRequest\x12\x35\n\x04name\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1fvisionai.googleapis.com/Process\x12\x17\n\nrequest_id\x18\x02 \x01(\tB\x03\xe0\x41\x01\"\xd1\x02\n\x16\x42\x61tchRunProcessRequest\x12\x37\n\x06parent\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1fvisionai.googleapis.com/Cluster\x12\x45\n\x08requests\x18\x02 \x03(\x0b\x32..google.cloud.visionai.v1.CreateProcessRequestB\x03\xe0\x41\x02\x12]\n\x07options\x18\x03 \x01(\x0b\x32G.google.cloud.visionai.v1.BatchRunProcessRequest.BatchRunProcessOptionsB\x03\xe0\x41\x01\x12\x15\n\x08\x62\x61tch_id\x18\x04 \x01(\tB\x03\xe0\x41\x03\x1a\x41\n\x16\x42\x61tchRunProcessOptions\x12\x13\n\x0bretry_count\x18\x01 \x01(\x05\x12\x12\n\nbatch_size\x18\x02 \x01(\x05\"a\n\x17\x42\x61tchRunProcessResponse\x12\x10\n\x08\x62\x61tch_id\x18\x01 \x01(\t\x12\x34\n\tprocesses\x18\x02 \x03(\x0b\x32!.google.cloud.visionai.v1.Process\"\x96\x01\n\x1aResolveOperatorInfoRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\x12=\n\x07queries\x18\x02 \x03(\x0b\x32\'.google.cloud.visionai.v1.OperatorQueryB\x03\xe0\x41\x02\"s\n\rOperatorQuery\x12\x15\n\x08operator\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x10\n\x03tag\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x39\n\x08registry\x18\x03 \x01(\x0e\x32\".google.cloud.visionai.v1.RegistryB\x03\xe0\x41\x01\"T\n\x1bResolveOperatorInfoResponse\x12\x35\n\toperators\x18\x01 \x03(\x0b\x32\".google.cloud.visionai.v1.Operator\"\xa0\x01\n\x1aListPublicOperatorsRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\x12\x0e\n\x06\x66ilter\x18\x04 \x01(\t\x12\x10\n\x08order_by\x18\x05 \x01(\t\"m\n\x1bListPublicOperatorsResponse\x12\x35\n\toperators\x18\x01 \x03(\x0b\x32\".google.cloud.visionai.v1.Operator\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t*=\n\x08Registry\x12\x18\n\x14REGISTRY_UNSPECIFIED\x10\x00\x12\n\n\x06PUBLIC\x10\x01\x12\x0b\n\x07PRIVATE\x10\x02\x32\x8d\x1e\n\x12LiveVideoAnalytics\x12\xcc\x01\n\x13ListPublicOperators\x12\x34.google.cloud.visionai.v1.ListPublicOperatorsRequest\x1a\x35.google.cloud.visionai.v1.ListPublicOperatorsResponse\"H\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x39\x12\x37/v1/{parent=projects/*/locations/*}:listPublicOperators\x12\xd7\x01\n\x13ResolveOperatorInfo\x12\x34.google.cloud.visionai.v1.ResolveOperatorInfoRequest\x1a\x35.google.cloud.visionai.v1.ResolveOperatorInfoResponse\"S\xda\x41\x0eparent,queries\x82\xd3\xe4\x93\x02<\"7/v1/{parent=projects/*/locations/*}:resolveOperatorInfo:\x01*\x12\xb0\x01\n\rListOperators\x12..google.cloud.visionai.v1.ListOperatorsRequest\x1a/.google.cloud.visionai.v1.ListOperatorsResponse\">\xda\x41\x06parent\x82\xd3\xe4\x93\x02/\x12-/v1/{parent=projects/*/locations/*}/operators\x12\x9d\x01\n\x0bGetOperator\x12,.google.cloud.visionai.v1.GetOperatorRequest\x1a\".google.cloud.visionai.v1.Operator\"<\xda\x41\x04name\x82\xd3\xe4\x93\x02/\x12-/v1/{name=projects/*/locations/*/operators/*}\x12\xdf\x01\n\x0e\x43reateOperator\x12/.google.cloud.visionai.v1.CreateOperatorRequest\x1a\x1d.google.longrunning.Operation\"}\xca\x41\x1d\n\x08Operator\x12\x11OperationMetadata\xda\x41\x1bparent,operator,operator_id\x82\xd3\xe4\x93\x02\x39\"-/v1/{parent=projects/*/locations/*}/operators:\x08operator\x12\xe1\x01\n\x0eUpdateOperator\x12/.google.cloud.visionai.v1.UpdateOperatorRequest\x1a\x1d.google.longrunning.Operation\"\x7f\xca\x41\x1d\n\x08Operator\x12\x11OperationMetadata\xda\x41\x14operator,update_mask\x82\xd3\xe4\x93\x02\x42\x32\x36/v1/{operator.name=projects/*/locations/*/operators/*}:\x08operator\x12\xcb\x01\n\x0e\x44\x65leteOperator\x12/.google.cloud.visionai.v1.DeleteOperatorRequest\x1a\x1d.google.longrunning.Operation\"i\xca\x41*\n\x15google.protobuf.Empty\x12\x11OperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02/*-/v1/{name=projects/*/locations/*/operators/*}\x12\xb7\x01\n\x0cListAnalyses\x12-.google.cloud.visionai.v1.ListAnalysesRequest\x1a..google.cloud.visionai.v1.ListAnalysesResponse\"H\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x39\x12\x37/v1/{parent=projects/*/locations/*/clusters/*}/analyses\x12\xa7\x01\n\x0bGetAnalysis\x12,.google.cloud.visionai.v1.GetAnalysisRequest\x1a\".google.cloud.visionai.v1.Analysis\"F\xda\x41\x04name\x82\xd3\xe4\x93\x02\x39\x12\x37/v1/{name=projects/*/locations/*/clusters/*/analyses/*}\x12\xea\x01\n\x0e\x43reateAnalysis\x12/.google.cloud.visionai.v1.CreateAnalysisRequest\x1a\x1d.google.longrunning.Operation\"\x87\x01\xca\x41\x1d\n\x08\x41nalysis\x12\x11OperationMetadata\xda\x41\x1bparent,analysis,analysis_id\x82\xd3\xe4\x93\x02\x43\"7/v1/{parent=projects/*/locations/*/clusters/*}/analyses:\x08\x61nalysis\x12\xec\x01\n\x0eUpdateAnalysis\x12/.google.cloud.visionai.v1.UpdateAnalysisRequest\x1a\x1d.google.longrunning.Operation\"\x89\x01\xca\x41\x1d\n\x08\x41nalysis\x12\x11OperationMetadata\xda\x41\x14\x61nalysis,update_mask\x82\xd3\xe4\x93\x02L2@/v1/{analysis.name=projects/*/locations/*/clusters/*/analyses/*}:\x08\x61nalysis\x12\xd5\x01\n\x0e\x44\x65leteAnalysis\x12/.google.cloud.visionai.v1.DeleteAnalysisRequest\x1a\x1d.google.longrunning.Operation\"s\xca\x41*\n\x15google.protobuf.Empty\x12\x11OperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02\x39*7/v1/{name=projects/*/locations/*/clusters/*/analyses/*}\x12\xbb\x01\n\rListProcesses\x12..google.cloud.visionai.v1.ListProcessesRequest\x1a/.google.cloud.visionai.v1.ListProcessesResponse\"I\xda\x41\x06parent\x82\xd3\xe4\x93\x02:\x12\x38/v1/{parent=projects/*/locations/*/clusters/*}/processes\x12\xa5\x01\n\nGetProcess\x12+.google.cloud.visionai.v1.GetProcessRequest\x1a!.google.cloud.visionai.v1.Process\"G\xda\x41\x04name\x82\xd3\xe4\x93\x02:\x12\x38/v1/{name=projects/*/locations/*/clusters/*/processes/*}\x12\xe5\x01\n\rCreateProcess\x12..google.cloud.visionai.v1.CreateProcessRequest\x1a\x1d.google.longrunning.Operation\"\x84\x01\xca\x41\x1c\n\x07Process\x12\x11OperationMetadata\xda\x41\x19parent,process,process_id\x82\xd3\xe4\x93\x02\x43\"8/v1/{parent=projects/*/locations/*/clusters/*}/processes:\x07process\x12\xe7\x01\n\rUpdateProcess\x12..google.cloud.visionai.v1.UpdateProcessRequest\x1a\x1d.google.longrunning.Operation\"\x86\x01\xca\x41\x1c\n\x07Process\x12\x11OperationMetadata\xda\x41\x13process,update_mask\x82\xd3\xe4\x93\x02K2@/v1/{process.name=projects/*/locations/*/clusters/*/processes/*}:\x07process\x12\xd4\x01\n\rDeleteProcess\x12..google.cloud.visionai.v1.DeleteProcessRequest\x1a\x1d.google.longrunning.Operation\"t\xca\x41*\n\x15google.protobuf.Empty\x12\x11OperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02:*8/v1/{name=projects/*/locations/*/clusters/*/processes/*}\x12\xf2\x01\n\x0f\x42\x61tchRunProcess\x12\x30.google.cloud.visionai.v1.BatchRunProcessRequest\x1a\x1d.google.longrunning.Operation\"\x8d\x01\xca\x41,\n\x17\x42\x61tchRunProcessResponse\x12\x11OperationMetadata\xda\x41\x0fparent,requests\x82\xd3\xe4\x93\x02\x46\"A/v1/{parent=projects/*/locations/*/clusters/*}/processes:batchRun:\x01*\x1aK\xca\x41\x17visionai.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\xbf\x01\n\x1c\x63om.google.cloud.visionai.v1B\x0fLvaServiceProtoP\x01Z8cloud.google.com/go/visionai/apiv1/visionaipb;visionaipb\xaa\x02\x18Google.Cloud.VisionAI.V1\xca\x02\x18Google\\Cloud\\VisionAI\\V1\xea\x02\x1bGoogle::Cloud::VisionAI::V1b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module VisionAI - module V1 - ListOperatorsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.ListOperatorsRequest").msgclass - ListOperatorsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.ListOperatorsResponse").msgclass - GetOperatorRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.GetOperatorRequest").msgclass - CreateOperatorRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.CreateOperatorRequest").msgclass - UpdateOperatorRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.UpdateOperatorRequest").msgclass - DeleteOperatorRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.DeleteOperatorRequest").msgclass - ListAnalysesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.ListAnalysesRequest").msgclass - ListAnalysesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.ListAnalysesResponse").msgclass - GetAnalysisRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.GetAnalysisRequest").msgclass - CreateAnalysisRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.CreateAnalysisRequest").msgclass - UpdateAnalysisRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.UpdateAnalysisRequest").msgclass - DeleteAnalysisRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.DeleteAnalysisRequest").msgclass - ListProcessesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.ListProcessesRequest").msgclass - ListProcessesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.ListProcessesResponse").msgclass - GetProcessRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.GetProcessRequest").msgclass - CreateProcessRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.CreateProcessRequest").msgclass - UpdateProcessRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.UpdateProcessRequest").msgclass - DeleteProcessRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.DeleteProcessRequest").msgclass - BatchRunProcessRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.BatchRunProcessRequest").msgclass - BatchRunProcessRequest::BatchRunProcessOptions = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.BatchRunProcessRequest.BatchRunProcessOptions").msgclass - BatchRunProcessResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.BatchRunProcessResponse").msgclass - ResolveOperatorInfoRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.ResolveOperatorInfoRequest").msgclass - OperatorQuery = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.OperatorQuery").msgclass - ResolveOperatorInfoResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.ResolveOperatorInfoResponse").msgclass - ListPublicOperatorsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.ListPublicOperatorsRequest").msgclass - ListPublicOperatorsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.ListPublicOperatorsResponse").msgclass - Registry = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.Registry").enummodule - end - end - end -end diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/visionai/v1/lva_service_services_pb.rb b/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/visionai/v1/lva_service_services_pb.rb deleted file mode 100644 index 8e46c7a1a22d..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/visionai/v1/lva_service_services_pb.rb +++ /dev/null @@ -1,81 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# Source: google/cloud/visionai/v1/lva_service.proto for package 'Google.Cloud.VisionAI.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/visionai/v1/lva_service_pb' - -module Google - module Cloud - module VisionAI - module V1 - module LiveVideoAnalytics - # Service describing handlers for resources. The service enables clients to run - # Live Video Analytics (LVA) on the streaming inputs. - class Service - - include ::GRPC::GenericService - - self.marshal_class_method = :encode - self.unmarshal_class_method = :decode - self.service_name = 'google.cloud.visionai.v1.LiveVideoAnalytics' - - # ListPublicOperators returns all the operators in public registry. - rpc :ListPublicOperators, ::Google::Cloud::VisionAI::V1::ListPublicOperatorsRequest, ::Google::Cloud::VisionAI::V1::ListPublicOperatorsResponse - # ResolveOperatorInfo returns the operator information based on the request. - rpc :ResolveOperatorInfo, ::Google::Cloud::VisionAI::V1::ResolveOperatorInfoRequest, ::Google::Cloud::VisionAI::V1::ResolveOperatorInfoResponse - # Lists Operators in a given project and location. - rpc :ListOperators, ::Google::Cloud::VisionAI::V1::ListOperatorsRequest, ::Google::Cloud::VisionAI::V1::ListOperatorsResponse - # Gets details of a single Operator. - rpc :GetOperator, ::Google::Cloud::VisionAI::V1::GetOperatorRequest, ::Google::Cloud::VisionAI::V1::Operator - # Creates a new Operator in a given project and location. - rpc :CreateOperator, ::Google::Cloud::VisionAI::V1::CreateOperatorRequest, ::Google::Longrunning::Operation - # Updates the parameters of a single Operator. - rpc :UpdateOperator, ::Google::Cloud::VisionAI::V1::UpdateOperatorRequest, ::Google::Longrunning::Operation - # Deletes a single Operator. - rpc :DeleteOperator, ::Google::Cloud::VisionAI::V1::DeleteOperatorRequest, ::Google::Longrunning::Operation - # Lists Analyses in a given project and location. - rpc :ListAnalyses, ::Google::Cloud::VisionAI::V1::ListAnalysesRequest, ::Google::Cloud::VisionAI::V1::ListAnalysesResponse - # Gets details of a single Analysis. - rpc :GetAnalysis, ::Google::Cloud::VisionAI::V1::GetAnalysisRequest, ::Google::Cloud::VisionAI::V1::Analysis - # Creates a new Analysis in a given project and location. - rpc :CreateAnalysis, ::Google::Cloud::VisionAI::V1::CreateAnalysisRequest, ::Google::Longrunning::Operation - # Updates the parameters of a single Analysis. - rpc :UpdateAnalysis, ::Google::Cloud::VisionAI::V1::UpdateAnalysisRequest, ::Google::Longrunning::Operation - # Deletes a single Analysis. - rpc :DeleteAnalysis, ::Google::Cloud::VisionAI::V1::DeleteAnalysisRequest, ::Google::Longrunning::Operation - # Lists Processes in a given project and location. - rpc :ListProcesses, ::Google::Cloud::VisionAI::V1::ListProcessesRequest, ::Google::Cloud::VisionAI::V1::ListProcessesResponse - # Gets details of a single Process. - rpc :GetProcess, ::Google::Cloud::VisionAI::V1::GetProcessRequest, ::Google::Cloud::VisionAI::V1::Process - # Creates a new Process in a given project and location. - rpc :CreateProcess, ::Google::Cloud::VisionAI::V1::CreateProcessRequest, ::Google::Longrunning::Operation - # Updates the parameters of a single Process. - rpc :UpdateProcess, ::Google::Cloud::VisionAI::V1::UpdateProcessRequest, ::Google::Longrunning::Operation - # Deletes a single Process. - rpc :DeleteProcess, ::Google::Cloud::VisionAI::V1::DeleteProcessRequest, ::Google::Longrunning::Operation - # Run all of the processes to "completion". Max time for each process is - # the LRO time limit. - rpc :BatchRunProcess, ::Google::Cloud::VisionAI::V1::BatchRunProcessRequest, ::Google::Longrunning::Operation - end - - Stub = Service.rpc_stub_class - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/visionai/v1/platform_pb.rb b/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/visionai/v1/platform_pb.rb deleted file mode 100644 index 0e9ac5832d5b..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/visionai/v1/platform_pb.rb +++ /dev/null @@ -1,135 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/visionai/v1/platform.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/visionai/v1/annotations_pb' -require 'google/cloud/visionai/v1/common_pb' -require 'google/longrunning/operations_pb' -require 'google/protobuf/duration_pb' -require 'google/protobuf/empty_pb' -require 'google/protobuf/field_mask_pb' -require 'google/protobuf/struct_pb' -require 'google/protobuf/timestamp_pb' - - -descriptor_data = "\n\'google/cloud/visionai/v1/platform.proto\x12\x18google.cloud.visionai.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/visionai/v1/annotations.proto\x1a%google/cloud/visionai/v1/common.proto\x1a#google/longrunning/operations.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\x1a\x1cgoogle/protobuf/struct.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"$\n\"DeleteApplicationInstancesResponse\"$\n\"CreateApplicationInstancesResponse\"$\n\"UpdateApplicationInstancesResponse\"\xca\x01\n!CreateApplicationInstancesRequest\x12\x39\n\x04name\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\n#visionai.googleapis.com/Application\x12Q\n\x15\x61pplication_instances\x18\x02 \x03(\x0b\x32-.google.cloud.visionai.v1.ApplicationInstanceB\x03\xe0\x41\x02\x12\x17\n\nrequest_id\x18\x04 \x01(\tB\x03\xe0\x41\x01\"\xb7\x01\n!DeleteApplicationInstancesRequest\x12\x39\n\x04name\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\n#visionai.googleapis.com/Application\x12>\n\x0cinstance_ids\x18\x02 \x03(\tB(\xe0\x41\x02\xfa\x41\"\n visionai.googleapis.com/Instance\x12\x17\n\nrequest_id\x18\x03 \x01(\tB\x03\xe0\x41\x01\"\x1b\n\x19\x44\x65ployApplicationResponse\"\x1d\n\x1bUndeployApplicationResponse\"&\n$RemoveApplicationStreamInputResponse\"#\n!AddApplicationStreamInputResponse\"&\n$UpdateApplicationStreamInputResponse\"\x9f\x01\n\x17ListApplicationsRequest\x12;\n\x06parent\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\x12#visionai.googleapis.com/Application\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\x12\x0e\n\x06\x66ilter\x18\x04 \x01(\t\x12\x10\n\x08order_by\x18\x05 \x01(\t\"\x85\x01\n\x18ListApplicationsResponse\x12;\n\x0c\x61pplications\x18\x01 \x03(\x0b\x32%.google.cloud.visionai.v1.Application\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x13\n\x0bunreachable\x18\x03 \x03(\t\"R\n\x15GetApplicationRequest\x12\x39\n\x04name\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\n#visionai.googleapis.com/Application\"\xce\x01\n\x18\x43reateApplicationRequest\x12;\n\x06parent\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\x12#visionai.googleapis.com/Application\x12\x1b\n\x0e\x61pplication_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12?\n\x0b\x61pplication\x18\x03 \x01(\x0b\x32%.google.cloud.visionai.v1.ApplicationB\x03\xe0\x41\x02\x12\x17\n\nrequest_id\x18\x04 \x01(\tB\x03\xe0\x41\x01\"\xaa\x01\n\x18UpdateApplicationRequest\x12\x34\n\x0bupdate_mask\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x01\x12?\n\x0b\x61pplication\x18\x02 \x01(\x0b\x32%.google.cloud.visionai.v1.ApplicationB\x03\xe0\x41\x02\x12\x17\n\nrequest_id\x18\x03 \x01(\tB\x03\xe0\x41\x01\"\x82\x01\n\x18\x44\x65leteApplicationRequest\x12\x39\n\x04name\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\n#visionai.googleapis.com/Application\x12\x17\n\nrequest_id\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x12\n\x05\x66orce\x18\x03 \x01(\x08\x42\x03\xe0\x41\x01\"\xa5\x01\n\x18\x44\x65ployApplicationRequest\x12\x39\n\x04name\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\n#visionai.googleapis.com/Application\x12\x15\n\rvalidate_only\x18\x02 \x01(\x08\x12\x17\n\nrequest_id\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12\x1e\n\x11\x65nable_monitoring\x18\x04 \x01(\x08\x42\x03\xe0\x41\x01\"p\n\x1aUndeployApplicationRequest\x12\x39\n\x04name\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\n#visionai.googleapis.com/Application\x12\x17\n\nrequest_id\x18\x02 \x01(\tB\x03\xe0\x41\x01\"h\n\x16\x41pplicationStreamInput\x12N\n\x16stream_with_annotation\x18\x01 \x01(\x0b\x32..google.cloud.visionai.v1.StreamWithAnnotation\"\xcb\x01\n AddApplicationStreamInputRequest\x12\x39\n\x04name\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\n#visionai.googleapis.com/Application\x12S\n\x19\x61pplication_stream_inputs\x18\x02 \x03(\x0b\x32\x30.google.cloud.visionai.v1.ApplicationStreamInput\x12\x17\n\nrequest_id\x18\x03 \x01(\tB\x03\xe0\x41\x01\"\xe5\x01\n#UpdateApplicationStreamInputRequest\x12\x39\n\x04name\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\n#visionai.googleapis.com/Application\x12S\n\x19\x61pplication_stream_inputs\x18\x02 \x03(\x0b\x32\x30.google.cloud.visionai.v1.ApplicationStreamInput\x12\x17\n\nrequest_id\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12\x15\n\rallow_missing\x18\x04 \x01(\x08\"\xb2\x02\n#RemoveApplicationStreamInputRequest\x12\x39\n\x04name\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\n#visionai.googleapis.com/Application\x12m\n\x14target_stream_inputs\x18\x02 \x03(\x0b\x32O.google.cloud.visionai.v1.RemoveApplicationStreamInputRequest.TargetStreamInput\x12\x17\n\nrequest_id\x18\x03 \x01(\tB\x03\xe0\x41\x01\x1aH\n\x11TargetStreamInput\x12\x33\n\x06stream\x18\x01 \x01(\tB#\xfa\x41 \n\x1evisionai.googleapis.com/Stream\"\x99\x01\n\x14ListInstancesRequest\x12\x38\n\x06parent\x18\x01 \x01(\tB(\xe0\x41\x02\xfa\x41\"\x12 visionai.googleapis.com/Instance\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\x12\x0e\n\x06\x66ilter\x18\x04 \x01(\t\x12\x10\n\x08order_by\x18\x05 \x01(\t\"|\n\x15ListInstancesResponse\x12\x35\n\tinstances\x18\x01 \x03(\x0b\x32\".google.cloud.visionai.v1.Instance\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x13\n\x0bunreachable\x18\x03 \x03(\t\"L\n\x12GetInstanceRequest\x12\x36\n\x04name\x18\x01 \x01(\tB(\xe0\x41\x02\xfa\x41\"\n visionai.googleapis.com/Instance\"\x93\x01\n\x11ListDraftsRequest\x12\x35\n\x06parent\x18\x01 \x01(\tB%\xe0\x41\x02\xfa\x41\x1f\x12\x1dvisionai.googleapis.com/Draft\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\x12\x0e\n\x06\x66ilter\x18\x04 \x01(\t\x12\x10\n\x08order_by\x18\x05 \x01(\t\"s\n\x12ListDraftsResponse\x12/\n\x06\x64rafts\x18\x01 \x03(\x0b\x32\x1f.google.cloud.visionai.v1.Draft\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x13\n\x0bunreachable\x18\x03 \x03(\t\"F\n\x0fGetDraftRequest\x12\x33\n\x04name\x18\x01 \x01(\tB%\xe0\x41\x02\xfa\x41\x1f\n\x1dvisionai.googleapis.com/Draft\"\xb0\x01\n\x12\x43reateDraftRequest\x12\x35\n\x06parent\x18\x01 \x01(\tB%\xe0\x41\x02\xfa\x41\x1f\x12\x1dvisionai.googleapis.com/Draft\x12\x15\n\x08\x64raft_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x33\n\x05\x64raft\x18\x03 \x01(\x0b\x32\x1f.google.cloud.visionai.v1.DraftB\x03\xe0\x41\x02\x12\x17\n\nrequest_id\x18\x04 \x01(\tB\x03\xe0\x41\x01\"\xaf\x01\n\x12UpdateDraftRequest\x12\x34\n\x0bupdate_mask\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x01\x12\x33\n\x05\x64raft\x18\x02 \x01(\x0b\x32\x1f.google.cloud.visionai.v1.DraftB\x03\xe0\x41\x02\x12\x17\n\nrequest_id\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12\x15\n\rallow_missing\x18\x04 \x01(\x08\"\xad\x03\n!UpdateApplicationInstancesRequest\x12\x39\n\x04name\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\n#visionai.googleapis.com/Application\x12t\n\x15\x61pplication_instances\x18\x02 \x03(\x0b\x32U.google.cloud.visionai.v1.UpdateApplicationInstancesRequest.UpdateApplicationInstance\x12\x17\n\nrequest_id\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12\x15\n\rallow_missing\x18\x04 \x01(\x08\x1a\xa6\x01\n\x19UpdateApplicationInstance\x12\x34\n\x0bupdate_mask\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x01\x12\x39\n\x08instance\x18\x02 \x01(\x0b\x32\".google.cloud.visionai.v1.InstanceB\x03\xe0\x41\x02\x12\x18\n\x0binstance_id\x18\x03 \x01(\tB\x03\xe0\x41\x02\"b\n\x12\x44\x65leteDraftRequest\x12\x33\n\x04name\x18\x01 \x01(\tB%\xe0\x41\x02\xfa\x41\x1f\n\x1dvisionai.googleapis.com/Draft\x12\x17\n\nrequest_id\x18\x02 \x01(\tB\x03\xe0\x41\x01\"\x9b\x01\n\x15ListProcessorsRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\x12!visionai.googleapis.com/Processor\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\x12\x0e\n\x06\x66ilter\x18\x04 \x01(\t\x12\x10\n\x08order_by\x18\x05 \x01(\t\"\x7f\n\x16ListProcessorsResponse\x12\x37\n\nprocessors\x18\x01 \x03(\x0b\x32#.google.cloud.visionai.v1.Processor\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x13\n\x0bunreachable\x18\x03 \x03(\t\"Z\n\x1dListPrebuiltProcessorsRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\x12!visionai.googleapis.com/Processor\"Y\n\x1eListPrebuiltProcessorsResponse\x12\x37\n\nprocessors\x18\x01 \x03(\x0b\x32#.google.cloud.visionai.v1.Processor\"N\n\x13GetProcessorRequest\x12\x37\n\x04name\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!visionai.googleapis.com/Processor\"\xc4\x01\n\x16\x43reateProcessorRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\x12!visionai.googleapis.com/Processor\x12\x19\n\x0cprocessor_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12;\n\tprocessor\x18\x03 \x01(\x0b\x32#.google.cloud.visionai.v1.ProcessorB\x03\xe0\x41\x02\x12\x17\n\nrequest_id\x18\x04 \x01(\tB\x03\xe0\x41\x01\"\xa4\x01\n\x16UpdateProcessorRequest\x12\x34\n\x0bupdate_mask\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x01\x12;\n\tprocessor\x18\x02 \x01(\x0b\x32#.google.cloud.visionai.v1.ProcessorB\x03\xe0\x41\x02\x12\x17\n\nrequest_id\x18\x03 \x01(\tB\x03\xe0\x41\x01\"j\n\x16\x44\x65leteProcessorRequest\x12\x37\n\x04name\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!visionai.googleapis.com/Processor\x12\x17\n\nrequest_id\x18\x02 \x01(\tB\x03\xe0\x41\x01\"\xda\n\n\x0b\x41pplication\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x34\n\x0b\x63reate_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x41\n\x06labels\x18\x04 \x03(\x0b\x32\x31.google.cloud.visionai.v1.Application.LabelsEntry\x12\x19\n\x0c\x64isplay_name\x18\x05 \x01(\tB\x03\xe0\x41\x02\x12\x13\n\x0b\x64\x65scription\x18\x06 \x01(\t\x12I\n\x13\x61pplication_configs\x18\x07 \x01(\x0b\x32,.google.cloud.visionai.v1.ApplicationConfigs\x12W\n\x0cruntime_info\x18\x08 \x01(\x0b\x32<.google.cloud.visionai.v1.Application.ApplicationRuntimeInfoB\x03\xe0\x41\x03\x12?\n\x05state\x18\t \x01(\x0e\x32+.google.cloud.visionai.v1.Application.StateB\x03\xe0\x41\x03\x12G\n\x0c\x62illing_mode\x18\x0c \x01(\x0e\x32\x31.google.cloud.visionai.v1.Application.BillingMode\x1a\xa1\x03\n\x16\x41pplicationRuntimeInfo\x12/\n\x0b\x64\x65ploy_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12r\n\x17global_output_resources\x18\x03 \x03(\x0b\x32Q.google.cloud.visionai.v1.Application.ApplicationRuntimeInfo.GlobalOutputResource\x12h\n\x11monitoring_config\x18\x04 \x01(\x0b\x32M.google.cloud.visionai.v1.Application.ApplicationRuntimeInfo.MonitoringConfig\x1aS\n\x14GlobalOutputResource\x12\x17\n\x0foutput_resource\x18\x01 \x01(\t\x12\x15\n\rproducer_node\x18\x02 \x01(\t\x12\x0b\n\x03key\x18\x03 \x01(\t\x1a#\n\x10MonitoringConfig\x12\x0f\n\x07\x65nabled\x18\x01 \x01(\x08\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\xa7\x01\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0b\n\x07\x43REATED\x10\x01\x12\r\n\tDEPLOYING\x10\x02\x12\x0c\n\x08\x44\x45PLOYED\x10\x03\x12\x0f\n\x0bUNDEPLOYING\x10\x04\x12\x0b\n\x07\x44\x45LETED\x10\x05\x12\t\n\x05\x45RROR\x10\x06\x12\x0c\n\x08\x43REATING\x10\x07\x12\x0c\n\x08UPDATING\x10\x08\x12\x0c\n\x08\x44\x45LETING\x10\t\x12\n\n\x06\x46IXING\x10\n\"B\n\x0b\x42illingMode\x12\x1c\n\x18\x42ILLING_MODE_UNSPECIFIED\x10\x00\x12\x08\n\x04PAYG\x10\x01\x12\x0b\n\x07MONTHLY\x10\x02:o\xea\x41l\n#visionai.googleapis.com/Application\x12\x42projects/{project}/locations/{location}/applications/{application}R\x01\x01\"\x8a\x02\n\x12\x41pplicationConfigs\x12-\n\x05nodes\x18\x01 \x03(\x0b\x32\x1e.google.cloud.visionai.v1.Node\x12_\n\x15\x65vent_delivery_config\x18\x03 \x01(\x0b\x32@.google.cloud.visionai.v1.ApplicationConfigs.EventDeliveryConfig\x1a\x64\n\x13\x45ventDeliveryConfig\x12\x0f\n\x07\x63hannel\x18\x01 \x01(\t\x12<\n\x19minimal_delivery_interval\x18\x02 \x01(\x0b\x32\x19.google.protobuf.Duration\"\xe7\x02\n\x04Node\x12.\n$output_all_output_channels_to_stream\x18\x06 \x01(\x08H\x00\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x14\n\x0c\x64isplay_name\x18\x02 \x01(\t\x12>\n\x0bnode_config\x18\x03 \x01(\x0b\x32).google.cloud.visionai.v1.ProcessorConfig\x12\x11\n\tprocessor\x18\x04 \x01(\t\x12\x39\n\x07parents\x18\x05 \x03(\x0b\x32(.google.cloud.visionai.v1.Node.InputEdge\x1a`\n\tInputEdge\x12\x13\n\x0bparent_node\x18\x01 \x01(\t\x12\x1d\n\x15parent_output_channel\x18\x02 \x01(\t\x12\x1f\n\x17\x63onnected_input_channel\x18\x03 \x01(\tB\x16\n\x14stream_output_config\"\xe8\x03\n\x05\x44raft\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x34\n\x0b\x63reate_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12;\n\x06labels\x18\x03 \x03(\x0b\x32+.google.cloud.visionai.v1.Draft.LabelsEntry\x12\x19\n\x0c\x64isplay_name\x18\x04 \x01(\tB\x03\xe0\x41\x02\x12\x13\n\x0b\x64\x65scription\x18\x05 \x01(\t\x12O\n\x19\x64raft_application_configs\x18\x06 \x01(\x0b\x32,.google.cloud.visionai.v1.ApplicationConfigs\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01:x\xea\x41u\n\x1dvisionai.googleapis.com/Draft\x12Qprojects/{project}/locations/{location}/applications/{application}/drafts/{draft}R\x01\x01\"\xd4\x0b\n\x08Instance\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\x12\x34\n\x0bupdate_time\x18\x08 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12>\n\x06labels\x18\x03 \x03(\x0b\x32..google.cloud.visionai.v1.Instance.LabelsEntry\x12\x19\n\x0c\x64isplay_name\x18\x04 \x01(\tB\x03\xe0\x41\x02\x12\x13\n\x0b\x64\x65scription\x18\x05 \x01(\t\x12\x46\n\rinstance_type\x18\n \x01(\x0e\x32/.google.cloud.visionai.v1.Instance.InstanceType\x12I\n\x0finput_resources\x18\x06 \x03(\x0b\x32\x30.google.cloud.visionai.v1.Instance.InputResource\x12K\n\x10output_resources\x18\x07 \x03(\x0b\x32\x31.google.cloud.visionai.v1.Instance.OutputResource\x12\x37\n\x05state\x18\t \x01(\x0e\x32(.google.cloud.visionai.v1.Instance.State\x1a\xc9\x02\n\rInputResource\x12\x18\n\x0einput_resource\x18\x01 \x01(\tH\x00\x12N\n\x10\x61nnotated_stream\x18\x04 \x01(\x0b\x32..google.cloud.visionai.v1.StreamWithAnnotationB\x02\x18\x01H\x00\x12\x35\n\tdata_type\x18\x06 \x01(\x0e\x32\".google.cloud.visionai.v1.DataType\x12\x15\n\rconsumer_node\x18\x02 \x01(\t\x12\x1e\n\x16input_resource_binding\x18\x03 \x01(\t\x12\x42\n\x0b\x61nnotations\x18\x05 \x01(\x0b\x32-.google.cloud.visionai.v1.ResourceAnnotationsB\x1c\n\x1ainput_resource_information\x1a\x92\x01\n\x0eOutputResource\x12\x17\n\x0foutput_resource\x18\x01 \x01(\t\x12\x15\n\rproducer_node\x18\x02 \x01(\t\x12\x1f\n\x17output_resource_binding\x18\x04 \x01(\t\x12\x19\n\x0cis_temporary\x18\x03 \x01(\x08\x42\x03\xe0\x41\x03\x12\x14\n\x07\x61utogen\x18\x05 \x01(\x08\x42\x03\xe0\x41\x03\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"t\n\x0cInstanceType\x12\x1d\n\x19INSTANCE_TYPE_UNSPECIFIED\x10\x00\x12\x18\n\x14STREAMING_PREDICTION\x10\x01\x12\x14\n\x10\x42\x41TCH_PREDICTION\x10\x02\x12\x15\n\x11ONLINE_PREDICTION\x10\x03\"\xb5\x01\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0c\n\x08\x43REATING\x10\x01\x12\x0b\n\x07\x43REATED\x10\x02\x12\r\n\tDEPLOYING\x10\x03\x12\x0c\n\x08\x44\x45PLOYED\x10\x04\x12\x0f\n\x0bUNDEPLOYING\x10\x05\x12\x0b\n\x07\x44\x45LETED\x10\x06\x12\t\n\x05\x45RROR\x10\x07\x12\x0c\n\x08UPDATING\x10\x08\x12\x0c\n\x08\x44\x45LETING\x10\t\x12\n\n\x06\x46IXING\x10\n\x12\x0c\n\x08\x46INISHED\x10\x0b:\x81\x01\xea\x41~\n visionai.googleapis.com/Instance\x12Wprojects/{project}/locations/{location}/applications/{application}/instances/{instance}R\x01\x01\"j\n\x13\x41pplicationInstance\x12\x18\n\x0binstance_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x39\n\x08instance\x18\x02 \x01(\x0b\x32\".google.cloud.visionai.v1.InstanceB\x03\xe0\x41\x02\"\xbc\t\n\tProcessor\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x34\n\x0b\x63reate_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12?\n\x06labels\x18\x04 \x03(\x0b\x32/.google.cloud.visionai.v1.Processor.LabelsEntry\x12\x19\n\x0c\x64isplay_name\x18\x05 \x01(\tB\x03\xe0\x41\x02\x12\x13\n\x0b\x64\x65scription\x18\n \x01(\t\x12N\n\x0eprocessor_type\x18\x06 \x01(\x0e\x32\x31.google.cloud.visionai.v1.Processor.ProcessorTypeB\x03\xe0\x41\x03\x12\x37\n\nmodel_type\x18\r \x01(\x0e\x32#.google.cloud.visionai.v1.ModelType\x12Y\n\x1c\x63ustom_processor_source_info\x18\x07 \x01(\x0b\x32\x33.google.cloud.visionai.v1.CustomProcessorSourceInfo\x12\x46\n\x05state\x18\x08 \x01(\x0e\x32\x32.google.cloud.visionai.v1.Processor.ProcessorStateB\x03\xe0\x41\x03\x12I\n\x11processor_io_spec\x18\x0b \x01(\x0b\x32).google.cloud.visionai.v1.ProcessorIOSpecB\x03\xe0\x41\x03\x12\"\n\x15\x63onfiguration_typeurl\x18\x0e \x01(\tB\x03\xe0\x41\x03\x12W\n\x1asupported_annotation_types\x18\x0f \x03(\x0e\x32..google.cloud.visionai.v1.StreamAnnotationTypeB\x03\xe0\x41\x03\x12 \n\x18supports_post_processing\x18\x11 \x01(\x08\x12Q\n\x18supported_instance_types\x18\x12 \x03(\x0e\x32/.google.cloud.visionai.v1.Instance.InstanceType\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"Z\n\rProcessorType\x12\x1e\n\x1aPROCESSOR_TYPE_UNSPECIFIED\x10\x00\x12\x0e\n\nPRETRAINED\x10\x01\x12\n\n\x06\x43USTOM\x10\x02\x12\r\n\tCONNECTOR\x10\x03\"e\n\x0eProcessorState\x12\x1f\n\x1bPROCESSOR_STATE_UNSPECIFIED\x10\x00\x12\x0c\n\x08\x43REATING\x10\x01\x12\n\n\x06\x41\x43TIVE\x10\x02\x12\x0c\n\x08\x44\x45LETING\x10\x03\x12\n\n\x06\x46\x41ILED\x10\x04:i\xea\x41\x66\n!visionai.googleapis.com/Processor\x12>projects/{project}/locations/{location}/processors/{processor}R\x01\x01\"\xd6\x07\n\x0fProcessorIOSpec\x12\x62\n\x19graph_input_channel_specs\x18\x03 \x03(\x0b\x32?.google.cloud.visionai.v1.ProcessorIOSpec.GraphInputChannelSpec\x12\x64\n\x1agraph_output_channel_specs\x18\x04 \x03(\x0b\x32@.google.cloud.visionai.v1.ProcessorIOSpec.GraphOutputChannelSpec\x12y\n%instance_resource_input_binding_specs\x18\x05 \x03(\x0b\x32J.google.cloud.visionai.v1.ProcessorIOSpec.InstanceResourceInputBindingSpec\x12{\n&instance_resource_output_binding_specs\x18\x06 \x03(\x0b\x32K.google.cloud.visionai.v1.ProcessorIOSpec.InstanceResourceOutputBindingSpec\x1a\xaf\x01\n\x15GraphInputChannelSpec\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x35\n\tdata_type\x18\x02 \x01(\x0e\x32\".google.cloud.visionai.v1.DataType\x12\x1f\n\x17\x61\x63\x63\x65pted_data_type_uris\x18\x05 \x03(\t\x12\x10\n\x08required\x18\x03 \x01(\x08\x12\x1e\n\x16max_connection_allowed\x18\x04 \x01(\x03\x1at\n\x16GraphOutputChannelSpec\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x35\n\tdata_type\x18\x02 \x01(\x0e\x32\".google.cloud.visionai.v1.DataType\x12\x15\n\rdata_type_uri\x18\x03 \x01(\t\x1ay\n InstanceResourceInputBindingSpec\x12\x19\n\x0f\x63onfig_type_uri\x18\x02 \x01(\tH\x00\x12\x1b\n\x11resource_type_uri\x18\x03 \x01(\tH\x00\x12\x0c\n\x04name\x18\x01 \x01(\tB\x0f\n\rresource_type\x1a^\n!InstanceResourceOutputBindingSpec\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x19\n\x11resource_type_uri\x18\x02 \x01(\t\x12\x10\n\x08\x65xplicit\x18\x03 \x01(\x08\"\xa4\x07\n\x19\x43ustomProcessorSourceInfo\x12\x16\n\x0cvertex_model\x18\x02 \x01(\tH\x00\x12t\n\x1bproduct_recognizer_artifact\x18\x03 \x01(\x0b\x32M.google.cloud.visionai.v1.CustomProcessorSourceInfo.ProductRecognizerArtifactH\x00\x12S\n\x0bsource_type\x18\x01 \x01(\x0e\x32>.google.cloud.visionai.v1.CustomProcessorSourceInfo.SourceType\x12\x65\n\x0f\x61\x64\x64itional_info\x18\x04 \x03(\x0b\x32G.google.cloud.visionai.v1.CustomProcessorSourceInfo.AdditionalInfoEntryB\x03\xe0\x41\x03\x12U\n\x0cmodel_schema\x18\x05 \x01(\x0b\x32?.google.cloud.visionai.v1.CustomProcessorSourceInfo.ModelSchema\x1a\x65\n\x19ProductRecognizerArtifact\x12-\n retail_product_recognition_index\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x19\n\x0cvertex_model\x18\x02 \x01(\tB\x03\xe0\x41\x01\x1a\xcd\x01\n\x0bModelSchema\x12=\n\x10instances_schema\x18\x01 \x01(\x0b\x32#.google.cloud.visionai.v1.GcsSource\x12>\n\x11parameters_schema\x18\x02 \x01(\x0b\x32#.google.cloud.visionai.v1.GcsSource\x12?\n\x12predictions_schema\x18\x03 \x01(\x0b\x32#.google.cloud.visionai.v1.GcsSource\x1a\x35\n\x13\x41\x64\x64itionalInfoEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"g\n\nSourceType\x12\x1b\n\x17SOURCE_TYPE_UNSPECIFIED\x10\x00\x12\x11\n\rVERTEX_AUTOML\x10\x01\x12\x11\n\rVERTEX_CUSTOM\x10\x02\x12\x16\n\x12PRODUCT_RECOGNIZER\x10\x03\x42\x0f\n\rartifact_path\"\xd2\x0b\n\x0fProcessorConfig\x12U\n\x19video_stream_input_config\x18\t \x01(\x0b\x32\x30.google.cloud.visionai.v1.VideoStreamInputConfigH\x00\x12`\n\x1f\x61i_enabled_devices_input_config\x18\x14 \x01(\x0b\x32\x35.google.cloud.visionai.v1.AIEnabledDevicesInputConfigH\x00\x12P\n\x16media_warehouse_config\x18\n \x01(\x0b\x32..google.cloud.visionai.v1.MediaWarehouseConfigH\x00\x12H\n\x12person_blur_config\x18\x0b \x01(\x0b\x32*.google.cloud.visionai.v1.PersonBlurConfigH\x00\x12P\n\x16occupancy_count_config\x18\x0c \x01(\x0b\x32..google.cloud.visionai.v1.OccupancyCountConfigH\x00\x12\x61\n\x1fperson_vehicle_detection_config\x18\x0f \x01(\x0b\x32\x36.google.cloud.visionai.v1.PersonVehicleDetectionConfigH\x00\x12Y\n\x1bvertex_automl_vision_config\x18\r \x01(\x0b\x32\x32.google.cloud.visionai.v1.VertexAutoMLVisionConfigH\x00\x12W\n\x1avertex_automl_video_config\x18\x0e \x01(\x0b\x32\x31.google.cloud.visionai.v1.VertexAutoMLVideoConfigH\x00\x12L\n\x14vertex_custom_config\x18\x11 \x01(\x0b\x32,.google.cloud.visionai.v1.VertexCustomConfigH\x00\x12\x61\n\x1fgeneral_object_detection_config\x18\x12 \x01(\x0b\x32\x36.google.cloud.visionai.v1.GeneralObjectDetectionConfigH\x00\x12\x44\n\x10\x62ig_query_config\x18\x13 \x01(\x0b\x32(.google.cloud.visionai.v1.BigQueryConfigH\x00\x12\x46\n\x11gcs_output_config\x18\x1b \x01(\x0b\x32).google.cloud.visionai.v1.GcsOutputConfigH\x00\x12V\n\x19product_recognizer_config\x18\x15 \x01(\x0b\x32\x31.google.cloud.visionai.v1.ProductRecognizerConfigH\x00\x12~\n.personal_protective_equipment_detection_config\x18\x16 \x01(\x0b\x32\x44.google.cloud.visionai.v1.PersonalProtectiveEquipmentDetectionConfigH\x00\x12N\n\x15tag_recognizer_config\x18\x19 \x01(\x0b\x32-.google.cloud.visionai.v1.TagRecognizerConfigH\x00\x12P\n\x16universal_input_config\x18\x1c \x01(\x0b\x32..google.cloud.visionai.v1.UniversalInputConfigH\x00\x12\x34\n\x13\x65xperimental_config\x18\x1a \x01(\x0b\x32\x17.google.protobuf.StructB\x12\n\x10processor_config\"\xd2\x02\n\x14StreamWithAnnotation\x12\x33\n\x06stream\x18\x01 \x01(\tB#\xfa\x41 \n\x1evisionai.googleapis.com/Stream\x12K\n\x17\x61pplication_annotations\x18\x02 \x03(\x0b\x32*.google.cloud.visionai.v1.StreamAnnotation\x12W\n\x10node_annotations\x18\x03 \x03(\x0b\x32=.google.cloud.visionai.v1.StreamWithAnnotation.NodeAnnotation\x1a_\n\x0eNodeAnnotation\x12\x0c\n\x04node\x18\x01 \x01(\t\x12?\n\x0b\x61nnotations\x18\x02 \x03(\x0b\x32*.google.cloud.visionai.v1.StreamAnnotation\"j\n\x19\x41pplicationNodeAnnotation\x12\x0c\n\x04node\x18\x01 \x01(\t\x12?\n\x0b\x61nnotations\x18\x02 \x03(\x0b\x32*.google.cloud.visionai.v1.StreamAnnotation\"\xb1\x01\n\x13ResourceAnnotations\x12K\n\x17\x61pplication_annotations\x18\x01 \x03(\x0b\x32*.google.cloud.visionai.v1.StreamAnnotation\x12M\n\x10node_annotations\x18\x02 \x03(\x0b\x32\x33.google.cloud.visionai.v1.ApplicationNodeAnnotation\"\x82\x01\n\x16VideoStreamInputConfig\x12\x13\n\x07streams\x18\x01 \x03(\tB\x02\x18\x01\x12S\n\x17streams_with_annotation\x18\x02 \x03(\x0b\x32..google.cloud.visionai.v1.StreamWithAnnotationB\x02\x18\x01\"\x1d\n\x1b\x41IEnabledDevicesInputConfig\"b\n\x14MediaWarehouseConfig\x12\x0e\n\x06\x63orpus\x18\x01 \x01(\t\x12\x12\n\x06region\x18\x02 \x01(\tB\x02\x18\x01\x12&\n\x03ttl\x18\x03 \x01(\x0b\x32\x19.google.protobuf.Duration\"\xd5\x01\n\x10PersonBlurConfig\x12S\n\x10person_blur_type\x18\x01 \x01(\x0e\x32\x39.google.cloud.visionai.v1.PersonBlurConfig.PersonBlurType\x12\x12\n\nfaces_only\x18\x02 \x01(\x08\"X\n\x0ePersonBlurType\x12 \n\x1cPERSON_BLUR_TYPE_UNSPECIFIED\x10\x00\x12\x13\n\x0f\x46ULL_OCCULUSION\x10\x01\x12\x0f\n\x0b\x42LUR_FILTER\x10\x02\"~\n\x14OccupancyCountConfig\x12\x1e\n\x16\x65nable_people_counting\x18\x01 \x01(\x08\x12\x1f\n\x17\x65nable_vehicle_counting\x18\x02 \x01(\x08\x12%\n\x1d\x65nable_dwelling_time_tracking\x18\x03 \x01(\x08\"_\n\x1cPersonVehicleDetectionConfig\x12\x1e\n\x16\x65nable_people_counting\x18\x01 \x01(\x08\x12\x1f\n\x17\x65nable_vehicle_counting\x18\x02 \x01(\x08\"\xa5\x01\n*PersonalProtectiveEquipmentDetectionConfig\x12&\n\x1e\x65nable_face_coverage_detection\x18\x01 \x01(\x08\x12&\n\x1e\x65nable_head_coverage_detection\x18\x02 \x01(\x08\x12\'\n\x1f\x65nable_hands_coverage_detection\x18\x03 \x01(\x08\"\x1e\n\x1cGeneralObjectDetectionConfig\"\xec\x01\n\x0e\x42igQueryConfig\x12\r\n\x05table\x18\x01 \x01(\t\x12\x62\n\x16\x63loud_function_mapping\x18\x02 \x03(\x0b\x32\x42.google.cloud.visionai.v1.BigQueryConfig.CloudFunctionMappingEntry\x12*\n\"create_default_table_if_not_exists\x18\x03 \x01(\x08\x1a;\n\x19\x43loudFunctionMappingEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"Q\n\x18VertexAutoMLVisionConfig\x12\x1c\n\x14\x63onfidence_threshold\x18\x01 \x01(\x02\x12\x17\n\x0fmax_predictions\x18\x02 \x01(\x05\"\x89\x01\n\x17VertexAutoMLVideoConfig\x12\x1c\n\x14\x63onfidence_threshold\x18\x01 \x01(\x02\x12\x16\n\x0e\x62locked_labels\x18\x02 \x03(\t\x12\x17\n\x0fmax_predictions\x18\x03 \x01(\x05\x12\x1f\n\x17\x62ounding_box_size_limit\x18\x04 \x01(\x02\"\x95\x02\n\x12VertexCustomConfig\x12\x1a\n\x12max_prediction_fps\x18\x01 \x01(\x05\x12I\n\x13\x64\x65\x64icated_resources\x18\x02 \x01(\x0b\x32,.google.cloud.visionai.v1.DedicatedResources\x12&\n\x1epost_processing_cloud_function\x18\x03 \x01(\t\x12#\n\x1b\x61ttach_application_metadata\x18\x04 \x01(\x08\x12,\n\x1a\x64ynamic_config_input_topic\x18\x06 \x01(\tB\x03\xe0\x41\x01H\x00\x88\x01\x01\x42\x1d\n\x1b_dynamic_config_input_topic\"#\n\x0fGcsOutputConfig\x12\x10\n\x08gcs_path\x18\x01 \x01(\t\"\x16\n\x14UniversalInputConfig\"\x8d\x01\n\x0bMachineSpec\x12\x19\n\x0cmachine_type\x18\x01 \x01(\tB\x03\xe0\x41\x05\x12H\n\x10\x61\x63\x63\x65lerator_type\x18\x02 \x01(\x0e\x32).google.cloud.visionai.v1.AcceleratorTypeB\x03\xe0\x41\x05\x12\x19\n\x11\x61\x63\x63\x65lerator_count\x18\x03 \x01(\x05\"A\n\x15\x41utoscalingMetricSpec\x12\x18\n\x0bmetric_name\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x0e\n\x06target\x18\x02 \x01(\x05\"\xf4\x01\n\x12\x44\x65\x64icatedResources\x12\x43\n\x0cmachine_spec\x18\x01 \x01(\x0b\x32%.google.cloud.visionai.v1.MachineSpecB\x06\xe0\x41\x02\xe0\x41\x05\x12!\n\x11min_replica_count\x18\x02 \x01(\x05\x42\x06\xe0\x41\x02\xe0\x41\x05\x12\x1e\n\x11max_replica_count\x18\x03 \x01(\x05\x42\x03\xe0\x41\x05\x12V\n\x18\x61utoscaling_metric_specs\x18\x04 \x03(\x0b\x32/.google.cloud.visionai.v1.AutoscalingMetricSpecB\x03\xe0\x41\x05\"\\\n\x17ProductRecognizerConfig\x12\x17\n\x0fretail_endpoint\x18\x01 \x01(\t\x12(\n recognition_confidence_threshold\x18\x02 \x01(\x02\"\x8c\x01\n\x13TagRecognizerConfig\x12-\n%entity_detection_confidence_threshold\x18\x01 \x01(\x02\x12\x46\n\x12tag_parsing_config\x18\x02 \x01(\x0b\x32*.google.cloud.visionai.v1.TagParsingConfig\"\xaa\x03\n\x10TagParsingConfig\x12^\n\x16\x65ntity_parsing_configs\x18\x01 \x03(\x0b\x32>.google.cloud.visionai.v1.TagParsingConfig.EntityParsingConfig\x1a\xb5\x02\n\x13\x45ntityParsingConfig\x12\x19\n\x0c\x65ntity_class\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x12\n\x05regex\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12|\n\x18\x65ntity_matching_strategy\x18\x03 \x01(\x0e\x32U.google.cloud.visionai.v1.TagParsingConfig.EntityParsingConfig.EntityMatchingStrategyB\x03\xe0\x41\x01\"q\n\x16\x45ntityMatchingStrategy\x12(\n$ENTITY_MATCHING_STRATEGY_UNSPECIFIED\x10\x00\x12\x17\n\x13MULTI_LINE_MATCHING\x10\x01\x12\x14\n\x10MAX_OVERLAP_AREA\x10\x02*\xa0\x02\n\tModelType\x12\x1a\n\x16MODEL_TYPE_UNSPECIFIED\x10\x00\x12\x18\n\x14IMAGE_CLASSIFICATION\x10\x01\x12\x14\n\x10OBJECT_DETECTION\x10\x02\x12\x18\n\x14VIDEO_CLASSIFICATION\x10\x03\x12\x19\n\x15VIDEO_OBJECT_TRACKING\x10\x04\x12\x1c\n\x18VIDEO_ACTION_RECOGNITION\x10\x05\x12\x16\n\x12OCCUPANCY_COUNTING\x10\x06\x12\x0f\n\x0bPERSON_BLUR\x10\x07\x12\x11\n\rVERTEX_CUSTOM\x10\x08\x12\x16\n\x12PRODUCT_RECOGNIZER\x10\t\x12\x12\n\x0eTAG_RECOGNIZER\x10\n\x12\x0c\n\x08SYNTH_ID\x10\x0f*\xd0\x01\n\x0f\x41\x63\x63\x65leratorType\x12 \n\x1c\x41\x43\x43\x45LERATOR_TYPE_UNSPECIFIED\x10\x00\x12\x14\n\x10NVIDIA_TESLA_K80\x10\x01\x12\x15\n\x11NVIDIA_TESLA_P100\x10\x02\x12\x15\n\x11NVIDIA_TESLA_V100\x10\x03\x12\x13\n\x0fNVIDIA_TESLA_P4\x10\x04\x12\x13\n\x0fNVIDIA_TESLA_T4\x10\x05\x12\x15\n\x11NVIDIA_TESLA_A100\x10\x08\x12\n\n\x06TPU_V2\x10\x06\x12\n\n\x06TPU_V3\x10\x07*W\n\x08\x44\x61taType\x12\x19\n\x15\x44\x41TA_TYPE_UNSPECIFIED\x10\x00\x12\t\n\x05VIDEO\x10\x01\x12\t\n\x05IMAGE\x10\x03\x12\t\n\x05PROTO\x10\x02\x12\x0f\n\x0bPLACEHOLDER\x10\x04\x32\xea-\n\x0b\x41ppPlatform\x12\xbc\x01\n\x10ListApplications\x12\x31.google.cloud.visionai.v1.ListApplicationsRequest\x1a\x32.google.cloud.visionai.v1.ListApplicationsResponse\"A\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x32\x12\x30/v1/{parent=projects/*/locations/*}/applications\x12\xa9\x01\n\x0eGetApplication\x12/.google.cloud.visionai.v1.GetApplicationRequest\x1a%.google.cloud.visionai.v1.Application\"?\xda\x41\x04name\x82\xd3\xe4\x93\x02\x32\x12\x30/v1/{name=projects/*/locations/*/applications/*}\x12\xe5\x01\n\x11\x43reateApplication\x12\x32.google.cloud.visionai.v1.CreateApplicationRequest\x1a\x1d.google.longrunning.Operation\"}\xca\x41 \n\x0b\x41pplication\x12\x11OperationMetadata\xda\x41\x12parent,application\x82\xd3\xe4\x93\x02?\"0/v1/{parent=projects/*/locations/*}/applications:\x0b\x61pplication\x12\xf7\x01\n\x11UpdateApplication\x12\x32.google.cloud.visionai.v1.UpdateApplicationRequest\x1a\x1d.google.longrunning.Operation\"\x8e\x01\xca\x41 \n\x0b\x41pplication\x12\x11OperationMetadata\xda\x41\x17\x61pplication,update_mask\x82\xd3\xe4\x93\x02K2\"9/v1/{name=projects/*/locations/*/applications/*}:undeploy:\x01*\x12\x83\x02\n\x19\x41\x64\x64\x41pplicationStreamInput\x12:.google.cloud.visionai.v1.AddApplicationStreamInputRequest\x1a\x1d.google.longrunning.Operation\"\x8a\x01\xca\x41\x36\n!AddApplicationStreamInputResponse\x12\x11OperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02\x44\"?/v1/{name=projects/*/locations/*/applications/*}:addStreamInput:\x01*\x12\x8f\x02\n\x1cRemoveApplicationStreamInput\x12=.google.cloud.visionai.v1.RemoveApplicationStreamInputRequest\x1a\x1d.google.longrunning.Operation\"\x90\x01\xca\x41\x39\n$RemoveApplicationStreamInputResponse\x12\x11OperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02G\"B/v1/{name=projects/*/locations/*/applications/*}:removeStreamInput:\x01*\x12\x8f\x02\n\x1cUpdateApplicationStreamInput\x12=.google.cloud.visionai.v1.UpdateApplicationStreamInputRequest\x1a\x1d.google.longrunning.Operation\"\x90\x01\xca\x41\x39\n$UpdateApplicationStreamInputResponse\x12\x11OperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02G\"B/v1/{name=projects/*/locations/*/applications/*}:updateStreamInput:\x01*\x12\xbf\x01\n\rListInstances\x12..google.cloud.visionai.v1.ListInstancesRequest\x1a/.google.cloud.visionai.v1.ListInstancesResponse\"M\xda\x41\x06parent\x82\xd3\xe4\x93\x02>\x12\x12\n\x0f\x61lignment_clock\x18\x06 \x01(\x0e\x32%.google.cloud.visionai.v1.Event.Clock\x12/\n\x0cgrace_period\x18\x07 \x01(\x0b\x32\x19.google.protobuf.Duration\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a\x32\n\x10\x41nnotationsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"7\n\x05\x43lock\x12\x15\n\x11\x43LOCK_UNSPECIFIED\x10\x00\x12\x0b\n\x07\x43\x41PTURE\x10\x01\x12\n\n\x06INGEST\x10\x02:m\xea\x41j\n\x1dvisionai.googleapis.com/Event\x12Iprojects/{project}/locations/{location}/clusters/{cluster}/events/{event}\"\xca\x04\n\x06Series\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x34\n\x0b\x63reate_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12<\n\x06labels\x18\x04 \x03(\x0b\x32,.google.cloud.visionai.v1.Series.LabelsEntry\x12\x46\n\x0b\x61nnotations\x18\x05 \x03(\x0b\x32\x31.google.cloud.visionai.v1.Series.AnnotationsEntry\x12\x36\n\x06stream\x18\x06 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1evisionai.googleapis.com/Stream\x12\x34\n\x05\x65vent\x18\x07 \x01(\tB%\xe0\x41\x02\xfa\x41\x1f\n\x1dvisionai.googleapis.com/Event\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a\x32\n\x10\x41nnotationsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01:o\xea\x41l\n\x1evisionai.googleapis.com/Series\x12Jprojects/{project}/locations/{location}/clusters/{cluster}/series/{series}\"\xd1\x04\n\x07\x43hannel\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x34\n\x0b\x63reate_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12=\n\x06labels\x18\x04 \x03(\x0b\x32-.google.cloud.visionai.v1.Channel.LabelsEntry\x12G\n\x0b\x61nnotations\x18\x05 \x03(\x0b\x32\x32.google.cloud.visionai.v1.Channel.AnnotationsEntry\x12\x36\n\x06stream\x18\x06 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1evisionai.googleapis.com/Stream\x12\x34\n\x05\x65vent\x18\x07 \x01(\tB%\xe0\x41\x02\xfa\x41\x1f\n\x1dvisionai.googleapis.com/Event\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a\x32\n\x10\x41nnotationsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01:s\xea\x41p\n\x1fvisionai.googleapis.com/Channel\x12Mprojects/{project}/locations/{location}/clusters/{cluster}/channels/{channel}B\xc5\x01\n\x1c\x63om.google.cloud.visionai.v1B\x15StreamsResourcesProtoP\x01Z8cloud.google.com/go/visionai/apiv1/visionaipb;visionaipb\xaa\x02\x18Google.Cloud.VisionAI.V1\xca\x02\x18Google\\Cloud\\VisionAI\\V1\xea\x02\x1bGoogle::Cloud::VisionAI::V1b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module VisionAI - module V1 - Stream = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.Stream").msgclass - Event = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.Event").msgclass - Event::Clock = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.Event.Clock").enummodule - Series = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.Series").msgclass - Channel = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.Channel").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/visionai/v1/streams_service_pb.rb b/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/visionai/v1/streams_service_pb.rb deleted file mode 100644 index 5d8ae148ada3..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/visionai/v1/streams_service_pb.rb +++ /dev/null @@ -1,60 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/visionai/v1/streams_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/visionai/v1/common_pb' -require 'google/cloud/visionai/v1/streams_resources_pb' -require 'google/longrunning/operations_pb' -require 'google/protobuf/empty_pb' -require 'google/protobuf/field_mask_pb' -require 'google/protobuf/timestamp_pb' - - -descriptor_data = "\n.google/cloud/visionai/v1/streams_service.proto\x12\x18google.cloud.visionai.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/visionai/v1/common.proto\x1a\x30google/cloud/visionai/v1/streams_resources.proto\x1a#google/longrunning/operations.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\x99\x01\n\x13ListClustersRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\x12\x0e\n\x06\x66ilter\x18\x04 \x01(\t\x12\x10\n\x08order_by\x18\x05 \x01(\t\"y\n\x14ListClustersResponse\x12\x33\n\x08\x63lusters\x18\x01 \x03(\x0b\x32!.google.cloud.visionai.v1.Cluster\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x13\n\x0bunreachable\x18\x03 \x03(\t\"J\n\x11GetClusterRequest\x12\x35\n\x04name\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1fvisionai.googleapis.com/Cluster\"\xba\x01\n\x14\x43reateClusterRequest\x12\x37\n\x06parent\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\x12\x1fvisionai.googleapis.com/Cluster\x12\x17\n\ncluster_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x37\n\x07\x63luster\x18\x03 \x01(\x0b\x32!.google.cloud.visionai.v1.ClusterB\x03\xe0\x41\x02\x12\x17\n\nrequest_id\x18\x04 \x01(\tB\x03\xe0\x41\x01\"\x9e\x01\n\x14UpdateClusterRequest\x12\x34\n\x0bupdate_mask\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\x12\x37\n\x07\x63luster\x18\x02 \x01(\x0b\x32!.google.cloud.visionai.v1.ClusterB\x03\xe0\x41\x02\x12\x17\n\nrequest_id\x18\x03 \x01(\tB\x03\xe0\x41\x01\"f\n\x14\x44\x65leteClusterRequest\x12\x35\n\x04name\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1fvisionai.googleapis.com/Cluster\x12\x17\n\nrequest_id\x18\x02 \x01(\tB\x03\xe0\x41\x01\"\x96\x01\n\x12ListStreamsRequest\x12\x37\n\x06parent\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1fvisionai.googleapis.com/Cluster\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\x12\x0e\n\x06\x66ilter\x18\x04 \x01(\t\x12\x10\n\x08order_by\x18\x05 \x01(\t\"v\n\x13ListStreamsResponse\x12\x31\n\x07streams\x18\x01 \x03(\x0b\x32 .google.cloud.visionai.v1.Stream\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x13\n\x0bunreachable\x18\x03 \x03(\t\"H\n\x10GetStreamRequest\x12\x34\n\x04name\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1evisionai.googleapis.com/Stream\"\xb6\x01\n\x13\x43reateStreamRequest\x12\x37\n\x06parent\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1fvisionai.googleapis.com/Cluster\x12\x16\n\tstream_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x35\n\x06stream\x18\x03 \x01(\x0b\x32 .google.cloud.visionai.v1.StreamB\x03\xe0\x41\x02\x12\x17\n\nrequest_id\x18\x04 \x01(\tB\x03\xe0\x41\x01\"\x9b\x01\n\x13UpdateStreamRequest\x12\x34\n\x0bupdate_mask\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\x12\x35\n\x06stream\x18\x02 \x01(\x0b\x32 .google.cloud.visionai.v1.StreamB\x03\xe0\x41\x02\x12\x17\n\nrequest_id\x18\x03 \x01(\tB\x03\xe0\x41\x01\"d\n\x13\x44\x65leteStreamRequest\x12\x34\n\x04name\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1evisionai.googleapis.com/Stream\x12\x17\n\nrequest_id\x18\x02 \x01(\tB\x03\xe0\x41\x01\"{\n\x19GetStreamThumbnailRequest\x12\x13\n\x06stream\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x1c\n\x0fgcs_object_name\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x12\n\x05\x65vent\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12\x17\n\nrequest_id\x18\x04 \x01(\tB\x03\xe0\x41\x01\"\x1c\n\x1aGetStreamThumbnailResponse\"4\n\x1dGenerateStreamHlsTokenRequest\x12\x13\n\x06stream\x18\x01 \x01(\tB\x03\xe0\x41\x02\"d\n\x1eGenerateStreamHlsTokenResponse\x12\r\n\x05token\x18\x01 \x01(\t\x12\x33\n\x0f\x65xpiration_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"\x95\x01\n\x11ListEventsRequest\x12\x37\n\x06parent\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1fvisionai.googleapis.com/Cluster\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\x12\x0e\n\x06\x66ilter\x18\x04 \x01(\t\x12\x10\n\x08order_by\x18\x05 \x01(\t\"s\n\x12ListEventsResponse\x12/\n\x06\x65vents\x18\x01 \x03(\x0b\x32\x1f.google.cloud.visionai.v1.Event\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x13\n\x0bunreachable\x18\x03 \x03(\t\"F\n\x0fGetEventRequest\x12\x33\n\x04name\x18\x01 \x01(\tB%\xe0\x41\x02\xfa\x41\x1f\n\x1dvisionai.googleapis.com/Event\"\xb2\x01\n\x12\x43reateEventRequest\x12\x37\n\x06parent\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1fvisionai.googleapis.com/Cluster\x12\x15\n\x08\x65vent_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x33\n\x05\x65vent\x18\x03 \x01(\x0b\x32\x1f.google.cloud.visionai.v1.EventB\x03\xe0\x41\x02\x12\x17\n\nrequest_id\x18\x04 \x01(\tB\x03\xe0\x41\x01\"\x98\x01\n\x12UpdateEventRequest\x12\x34\n\x0bupdate_mask\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\x12\x33\n\x05\x65vent\x18\x02 \x01(\x0b\x32\x1f.google.cloud.visionai.v1.EventB\x03\xe0\x41\x02\x12\x17\n\nrequest_id\x18\x03 \x01(\tB\x03\xe0\x41\x01\"b\n\x12\x44\x65leteEventRequest\x12\x33\n\x04name\x18\x01 \x01(\tB%\xe0\x41\x02\xfa\x41\x1f\n\x1dvisionai.googleapis.com/Event\x12\x17\n\nrequest_id\x18\x02 \x01(\tB\x03\xe0\x41\x01\"\x95\x01\n\x11ListSeriesRequest\x12\x37\n\x06parent\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1fvisionai.googleapis.com/Cluster\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\x12\x0e\n\x06\x66ilter\x18\x04 \x01(\t\x12\x10\n\x08order_by\x18\x05 \x01(\t\"t\n\x12ListSeriesResponse\x12\x30\n\x06series\x18\x01 \x03(\x0b\x32 .google.cloud.visionai.v1.Series\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x13\n\x0bunreachable\x18\x03 \x03(\t\"H\n\x10GetSeriesRequest\x12\x34\n\x04name\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1evisionai.googleapis.com/Series\"\xb6\x01\n\x13\x43reateSeriesRequest\x12\x37\n\x06parent\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1fvisionai.googleapis.com/Cluster\x12\x16\n\tseries_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x35\n\x06series\x18\x03 \x01(\x0b\x32 .google.cloud.visionai.v1.SeriesB\x03\xe0\x41\x02\x12\x17\n\nrequest_id\x18\x04 \x01(\tB\x03\xe0\x41\x01\"\x9b\x01\n\x13UpdateSeriesRequest\x12\x34\n\x0bupdate_mask\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\x12\x35\n\x06series\x18\x02 \x01(\x0b\x32 .google.cloud.visionai.v1.SeriesB\x03\xe0\x41\x02\x12\x17\n\nrequest_id\x18\x03 \x01(\tB\x03\xe0\x41\x01\"d\n\x13\x44\x65leteSeriesRequest\x12\x34\n\x04name\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1evisionai.googleapis.com/Series\x12\x17\n\nrequest_id\x18\x02 \x01(\tB\x03\xe0\x41\x01\"\xbf\x01\n\x19MaterializeChannelRequest\x12\x37\n\x06parent\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1fvisionai.googleapis.com/Cluster\x12\x17\n\nchannel_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x37\n\x07\x63hannel\x18\x03 \x01(\x0b\x32!.google.cloud.visionai.v1.ChannelB\x03\xe0\x41\x02\x12\x17\n\nrequest_id\x18\x04 \x01(\tB\x03\xe0\x41\x01\x32\xbc%\n\x0eStreamsService\x12\xac\x01\n\x0cListClusters\x12-.google.cloud.visionai.v1.ListClustersRequest\x1a..google.cloud.visionai.v1.ListClustersResponse\"=\xda\x41\x06parent\x82\xd3\xe4\x93\x02.\x12,/v1/{parent=projects/*/locations/*}/clusters\x12\x99\x01\n\nGetCluster\x12+.google.cloud.visionai.v1.GetClusterRequest\x1a!.google.cloud.visionai.v1.Cluster\";\xda\x41\x04name\x82\xd3\xe4\x93\x02.\x12,/v1/{name=projects/*/locations/*/clusters/*}\x12\xd8\x01\n\rCreateCluster\x12..google.cloud.visionai.v1.CreateClusterRequest\x1a\x1d.google.longrunning.Operation\"x\xca\x41\x1c\n\x07\x43luster\x12\x11OperationMetadata\xda\x41\x19parent,cluster,cluster_id\x82\xd3\xe4\x93\x02\x37\",/v1/{parent=projects/*/locations/*}/clusters:\x07\x63luster\x12\xda\x01\n\rUpdateCluster\x12..google.cloud.visionai.v1.UpdateClusterRequest\x1a\x1d.google.longrunning.Operation\"z\xca\x41\x1c\n\x07\x43luster\x12\x11OperationMetadata\xda\x41\x13\x63luster,update_mask\x82\xd3\xe4\x93\x02?24/v1/{cluster.name=projects/*/locations/*/clusters/*}:\x07\x63luster\x12\xc8\x01\n\rDeleteCluster\x12..google.cloud.visionai.v1.DeleteClusterRequest\x1a\x1d.google.longrunning.Operation\"h\xca\x41*\n\x15google.protobuf.Empty\x12\x11OperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02.*,/v1/{name=projects/*/locations/*/clusters/*}\x12\xb3\x01\n\x0bListStreams\x12,.google.cloud.visionai.v1.ListStreamsRequest\x1a-.google.cloud.visionai.v1.ListStreamsResponse\"G\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x38\x12\x36/v1/{parent=projects/*/locations/*/clusters/*}/streams\x12\xa0\x01\n\tGetStream\x12*.google.cloud.visionai.v1.GetStreamRequest\x1a .google.cloud.visionai.v1.Stream\"E\xda\x41\x04name\x82\xd3\xe4\x93\x02\x38\x12\x36/v1/{name=projects/*/locations/*/clusters/*/streams/*}\x12\xdc\x01\n\x0c\x43reateStream\x12-.google.cloud.visionai.v1.CreateStreamRequest\x1a\x1d.google.longrunning.Operation\"~\xca\x41\x1b\n\x06Stream\x12\x11OperationMetadata\xda\x41\x17parent,stream,stream_id\x82\xd3\xe4\x93\x02@\"6/v1/{parent=projects/*/locations/*/clusters/*}/streams:\x06stream\x12\xdf\x01\n\x0cUpdateStream\x12-.google.cloud.visionai.v1.UpdateStreamRequest\x1a\x1d.google.longrunning.Operation\"\x80\x01\xca\x41\x1b\n\x06Stream\x12\x11OperationMetadata\xda\x41\x12stream,update_mask\x82\xd3\xe4\x93\x02G2=/v1/{stream.name=projects/*/locations/*/clusters/*/streams/*}:\x06stream\x12\xd0\x01\n\x0c\x44\x65leteStream\x12-.google.cloud.visionai.v1.DeleteStreamRequest\x1a\x1d.google.longrunning.Operation\"r\xca\x41*\n\x15google.protobuf.Empty\x12\x11OperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02\x38*6/v1/{name=projects/*/locations/*/clusters/*/streams/*}\x12\x86\x02\n\x12GetStreamThumbnail\x12\x33.google.cloud.visionai.v1.GetStreamThumbnailRequest\x1a\x1d.google.longrunning.Operation\"\x9b\x01\xca\x41/\n\x1aGetStreamThumbnailResponse\x12\x11OperationMetadata\xda\x41\x16stream,gcs_object_name\x82\xd3\xe4\x93\x02J\"E/v1/{stream=projects/*/locations/*/clusters/*/streams/*}:getThumbnail:\x01*\x12\xf0\x01\n\x16GenerateStreamHlsToken\x12\x37.google.cloud.visionai.v1.GenerateStreamHlsTokenRequest\x1a\x38.google.cloud.visionai.v1.GenerateStreamHlsTokenResponse\"c\xda\x41\x06stream\x82\xd3\xe4\x93\x02T\"O/v1/{stream=projects/*/locations/*/clusters/*/streams/*}:generateStreamHlsToken:\x01*\x12\xaf\x01\n\nListEvents\x12+.google.cloud.visionai.v1.ListEventsRequest\x1a,.google.cloud.visionai.v1.ListEventsResponse\"F\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x37\x12\x35/v1/{parent=projects/*/locations/*/clusters/*}/events\x12\x9c\x01\n\x08GetEvent\x12).google.cloud.visionai.v1.GetEventRequest\x1a\x1f.google.cloud.visionai.v1.Event\"D\xda\x41\x04name\x82\xd3\xe4\x93\x02\x37\x12\x35/v1/{name=projects/*/locations/*/clusters/*/events/*}\x12\xd5\x01\n\x0b\x43reateEvent\x12,.google.cloud.visionai.v1.CreateEventRequest\x1a\x1d.google.longrunning.Operation\"y\xca\x41\x1a\n\x05\x45vent\x12\x11OperationMetadata\xda\x41\x15parent,event,event_id\x82\xd3\xe4\x93\x02>\"5/v1/{parent=projects/*/locations/*/clusters/*}/events:\x05\x65vent\x12\xd7\x01\n\x0bUpdateEvent\x12,.google.cloud.visionai.v1.UpdateEventRequest\x1a\x1d.google.longrunning.Operation\"{\xca\x41\x1a\n\x05\x45vent\x12\x11OperationMetadata\xda\x41\x11\x65vent,update_mask\x82\xd3\xe4\x93\x02\x44\x32;/v1/{event.name=projects/*/locations/*/clusters/*/events/*}:\x05\x65vent\x12\xcd\x01\n\x0b\x44\x65leteEvent\x12,.google.cloud.visionai.v1.DeleteEventRequest\x1a\x1d.google.longrunning.Operation\"q\xca\x41*\n\x15google.protobuf.Empty\x12\x11OperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02\x37*5/v1/{name=projects/*/locations/*/clusters/*/events/*}\x12\xaf\x01\n\nListSeries\x12+.google.cloud.visionai.v1.ListSeriesRequest\x1a,.google.cloud.visionai.v1.ListSeriesResponse\"F\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x37\x12\x35/v1/{parent=projects/*/locations/*/clusters/*}/series\x12\x9f\x01\n\tGetSeries\x12*.google.cloud.visionai.v1.GetSeriesRequest\x1a .google.cloud.visionai.v1.Series\"D\xda\x41\x04name\x82\xd3\xe4\x93\x02\x37\x12\x35/v1/{name=projects/*/locations/*/clusters/*/series/*}\x12\xdb\x01\n\x0c\x43reateSeries\x12-.google.cloud.visionai.v1.CreateSeriesRequest\x1a\x1d.google.longrunning.Operation\"}\xca\x41\x1b\n\x06Series\x12\x11OperationMetadata\xda\x41\x17parent,series,series_id\x82\xd3\xe4\x93\x02?\"5/v1/{parent=projects/*/locations/*/clusters/*}/series:\x06series\x12\xdd\x01\n\x0cUpdateSeries\x12-.google.cloud.visionai.v1.UpdateSeriesRequest\x1a\x1d.google.longrunning.Operation\"\x7f\xca\x41\x1b\n\x06Series\x12\x11OperationMetadata\xda\x41\x12series,update_mask\x82\xd3\xe4\x93\x02\x46\x32\n\x0eindexed_assets\x18\x01 \x03(\x0b\x32&.google.cloud.visionai.v1.IndexedAsset\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"a\n\x13\x43reateCorpusRequest\x12\x13\n\x06parent\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x35\n\x06\x63orpus\x18\x02 \x01(\x0b\x32 .google.cloud.visionai.v1.CorpusB\x03\xe0\x41\x02\"x\n\x14\x43reateCorpusMetadata\x12/\n\x0b\x63reate_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12/\n\x0bupdate_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"\x85\x01\n\x10SearchCapability\x12=\n\x04type\x18\x01 \x01(\x0e\x32/.google.cloud.visionai.v1.SearchCapability.Type\"2\n\x04Type\x12\x14\n\x10TYPE_UNSPECIFIED\x10\x00\x12\x14\n\x10\x45MBEDDING_SEARCH\x10\x01\"b\n\x17SearchCapabilitySetting\x12G\n\x13search_capabilities\x18\x01 \x03(\x0b\x32*.google.cloud.visionai.v1.SearchCapability\"c\n\x18\x43reateCollectionMetadata\x12G\n\x12operation_metadata\x18\x01 \x01(\x0b\x32+.google.cloud.visionai.v1.OperationMetadata\"\xc3\x01\n\x17\x43reateCollectionRequest\x12\x36\n\x06parent\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1evisionai.googleapis.com/Corpus\x12=\n\ncollection\x18\x02 \x01(\x0b\x32$.google.cloud.visionai.v1.CollectionB\x03\xe0\x41\x02\x12\x1f\n\rcollection_id\x18\x03 \x01(\tB\x03\xe0\x41\x01H\x00\x88\x01\x01\x42\x10\n\x0e_collection_id\"c\n\x18\x44\x65leteCollectionMetadata\x12G\n\x12operation_metadata\x18\x01 \x01(\x0b\x32+.google.cloud.visionai.v1.OperationMetadata\"S\n\x17\x44\x65leteCollectionRequest\x12\x38\n\x04name\x18\x01 \x01(\tB*\xe0\x41\x02\xfa\x41$\n\"visionai.googleapis.com/Collection\"P\n\x14GetCollectionRequest\x12\x38\n\x04name\x18\x01 \x01(\tB*\xe0\x41\x02\xfa\x41$\n\"visionai.googleapis.com/Collection\"\x89\x01\n\x17UpdateCollectionRequest\x12=\n\ncollection\x18\x01 \x01(\x0b\x32$.google.cloud.visionai.v1.CollectionB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"{\n\x16ListCollectionsRequest\x12:\n\x06parent\x18\x01 \x01(\tB*\xe0\x41\x02\xfa\x41$\x12\"visionai.googleapis.com/Collection\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\"m\n\x17ListCollectionsResponse\x12\x39\n\x0b\x63ollections\x18\x01 \x03(\x0b\x32$.google.cloud.visionai.v1.Collection\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"W\n\x18\x41\x64\x64\x43ollectionItemRequest\x12;\n\x04item\x18\x01 \x01(\x0b\x32(.google.cloud.visionai.v1.CollectionItemB\x03\xe0\x41\x02\"S\n\x19\x41\x64\x64\x43ollectionItemResponse\x12\x36\n\x04item\x18\x01 \x01(\x0b\x32(.google.cloud.visionai.v1.CollectionItem\"Z\n\x1bRemoveCollectionItemRequest\x12;\n\x04item\x18\x01 \x01(\x0b\x32(.google.cloud.visionai.v1.CollectionItemB\x03\xe0\x41\x02\"V\n\x1cRemoveCollectionItemResponse\x12\x36\n\x04item\x18\x01 \x01(\x0b\x32(.google.cloud.visionai.v1.CollectionItem\"\x83\x01\n\x1aViewCollectionItemsRequest\x12>\n\ncollection\x18\x01 \x01(\tB*\xe0\x41\x02\xfa\x41$\n\"visionai.googleapis.com/Collection\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\"o\n\x1bViewCollectionItemsResponse\x12\x37\n\x05items\x18\x01 \x03(\x0b\x32(.google.cloud.visionai.v1.CollectionItem\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\xd8\x01\n\nCollection\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x19\n\x0c\x64isplay_name\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x18\n\x0b\x64\x65scription\x18\x03 \x01(\tB\x03\xe0\x41\x01:\x81\x01\xea\x41~\n\"visionai.googleapis.com/Collection\x12Xprojects/{project_number}/locations/{location}/corpora/{corpus}/collections/{collection}\"\xd7\x01\n\x0e\x43ollectionItem\x12>\n\ncollection\x18\x01 \x01(\tB*\xe0\x41\x02\xfa\x41$\n\"visionai.googleapis.com/Collection\x12@\n\x04type\x18\x02 \x01(\x0e\x32-.google.cloud.visionai.v1.CollectionItem.TypeB\x03\xe0\x41\x02\x12\x1a\n\ritem_resource\x18\x03 \x01(\tB\x03\xe0\x41\x02\"\'\n\x04Type\x12\x14\n\x10TYPE_UNSPECIFIED\x10\x00\x12\t\n\x05\x41SSET\x10\x01\"\x98\x01\n\x12\x43reateIndexRequest\x12\x36\n\x06parent\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1evisionai.googleapis.com/Corpus\x12\x15\n\x08index_id\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x33\n\x05index\x18\x03 \x01(\x0b\x32\x1f.google.cloud.visionai.v1.IndexB\x03\xe0\x41\x02\"^\n\x13\x43reateIndexMetadata\x12G\n\x12operation_metadata\x18\x01 \x01(\x0b\x32+.google.cloud.visionai.v1.OperationMetadata\"\x7f\n\x12UpdateIndexRequest\x12\x33\n\x05index\x18\x01 \x01(\x0b\x32\x1f.google.cloud.visionai.v1.IndexB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\"^\n\x13UpdateIndexMetadata\x12G\n\x12operation_metadata\x18\x01 \x01(\x0b\x32+.google.cloud.visionai.v1.OperationMetadata\"F\n\x0fGetIndexRequest\x12\x33\n\x04name\x18\x01 \x01(\tB%\xe0\x41\x02\xfa\x41\x1f\n\x1dvisionai.googleapis.com/Index\"r\n\x12ListIndexesRequest\x12\x35\n\x06parent\x18\x01 \x01(\tB%\xe0\x41\x02\xfa\x41\x1f\x12\x1dvisionai.googleapis.com/Index\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\"`\n\x13ListIndexesResponse\x12\x30\n\x07indexes\x18\x01 \x03(\x0b\x32\x1f.google.cloud.visionai.v1.Index\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"I\n\x12\x44\x65leteIndexRequest\x12\x33\n\x04name\x18\x01 \x01(\tB%\xe0\x41\x02\xfa\x41\x1f\n\x1dvisionai.googleapis.com/Index\"\x15\n\x13\x44\x65leteIndexMetadata\"\x94\x05\n\x05Index\x12\x17\n\rentire_corpus\x18\t \x01(\x08H\x00\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x19\n\x0c\x64isplay_name\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x18\n\x0b\x64\x65scription\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12\x39\n\x05state\x18\x04 \x01(\x0e\x32%.google.cloud.visionai.v1.Index.StateB\x03\xe0\x41\x03\x12\x34\n\x0b\x63reate_time\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12O\n\x10\x64\x65ployed_indexes\x18\x08 \x03(\x0b\x32\x30.google.cloud.visionai.v1.DeployedIndexReferenceB\x03\xe0\x41\x03\x12\x1f\n\rsatisfies_pzs\x18\x0b \x01(\x08\x42\x03\xe0\x41\x03H\x01\x88\x01\x01\x12\x1f\n\rsatisfies_pzi\x18\x0c \x01(\x08\x42\x03\xe0\x41\x03H\x02\x88\x01\x01\"G\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0c\n\x08\x43REATING\x10\x01\x12\x0b\n\x07\x43REATED\x10\x02\x12\x0c\n\x08UPDATING\x10\x03:s\xea\x41p\n\x1dvisionai.googleapis.com/Index\x12Oprojects/{project_number}/locations/{location}/corpora/{corpus}/indexes/{index}B\x0e\n\x0c\x61sset_filterB\x10\n\x0e_satisfies_pzsB\x10\n\x0e_satisfies_pzi\"_\n\x16\x44\x65ployedIndexReference\x12\x45\n\x0eindex_endpoint\x18\x01 \x01(\tB-\xe0\x41\x05\xfa\x41\'\n%visionai.googleapis.com/IndexEndpoint\"\xac\x04\n\x06\x43orpus\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x19\n\x0c\x64isplay_name\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x18\n\x0b\x64\x65scription\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12\x33\n\x0b\x64\x65\x66\x61ult_ttl\x18\x05 \x01(\x0b\x32\x19.google.protobuf.DurationB\x03\xe0\x41\x01\x12\x38\n\x04type\x18\x07 \x01(\x0e\x32%.google.cloud.visionai.v1.Corpus.TypeB\x03\xe0\x41\x01\x12T\n\x19search_capability_setting\x18\x08 \x01(\x0b\x32\x31.google.cloud.visionai.v1.SearchCapabilitySetting\x12\x1f\n\rsatisfies_pzs\x18\x0b \x01(\x08\x42\x03\xe0\x41\x03H\x00\x88\x01\x01\x12\x1f\n\rsatisfies_pzi\x18\x0c \x01(\x08\x42\x03\xe0\x41\x03H\x01\x88\x01\x01\"N\n\x04Type\x12\x14\n\x10TYPE_UNSPECIFIED\x10\x00\x12\x10\n\x0cSTREAM_VIDEO\x10\x01\x12\t\n\x05IMAGE\x10\x02\x12\x13\n\x0fVIDEO_ON_DEMAND\x10\x03:d\xea\x41\x61\n\x1evisionai.googleapis.com/Corpus\x12?projects/{project_number}/locations/{location}/corpora/{corpus}B\x10\n\x0e_satisfies_pzsB\x10\n\x0e_satisfies_pzi\"H\n\x10GetCorpusRequest\x12\x34\n\x04name\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1evisionai.googleapis.com/Corpus\"}\n\x13UpdateCorpusRequest\x12\x35\n\x06\x63orpus\x18\x01 \x01(\x0b\x32 .google.cloud.visionai.v1.CorpusB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"`\n\x12ListCorporaRequest\x12\x13\n\x06parent\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\x12\x0e\n\x06\x66ilter\x18\x05 \x01(\t\"a\n\x13ListCorporaResponse\x12\x31\n\x07\x63orpora\x18\x01 \x03(\x0b\x32 .google.cloud.visionai.v1.Corpus\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"K\n\x13\x44\x65leteCorpusRequest\x12\x34\n\x04name\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1evisionai.googleapis.com/Corpus\"L\n\x14\x41nalyzeCorpusRequest\x12\x34\n\x04name\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1evisionai.googleapis.com/Corpus\"V\n\x15\x41nalyzeCorpusMetadata\x12=\n\x08metadata\x18\x01 \x01(\x0b\x32+.google.cloud.visionai.v1.OperationMetadata\"\x17\n\x15\x41nalyzeCorpusResponse\"\x91\x01\n\x17\x43reateDataSchemaRequest\x12\x36\n\x06parent\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1evisionai.googleapis.com/Corpus\x12>\n\x0b\x64\x61ta_schema\x18\x02 \x01(\x0b\x32$.google.cloud.visionai.v1.DataSchemaB\x03\xe0\x41\x02\"\xf6\x01\n\nDataSchema\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x10\n\x03key\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x43\n\x0eschema_details\x18\x03 \x01(\x0b\x32+.google.cloud.visionai.v1.DataSchemaDetails:\x82\x01\xea\x41\x7f\n\"visionai.googleapis.com/DataSchema\x12Yprojects/{project_number}/locations/{location}/corpora/{corpus}/dataSchemas/{data_schema}\"\xd4\x0c\n\x11\x44\x61taSchemaDetails\x12G\n\x04type\x18\x01 \x01(\x0e\x32\x34.google.cloud.visionai.v1.DataSchemaDetails.DataTypeH\x00\x88\x01\x01\x12T\n\x10proto_any_config\x18\x06 \x01(\x0b\x32:.google.cloud.visionai.v1.DataSchemaDetails.ProtoAnyConfig\x12K\n\x0blist_config\x18\x08 \x01(\x0b\x32\x36.google.cloud.visionai.v1.DataSchemaDetails.ListConfig\x12\x64\n\x18\x63ustomized_struct_config\x18\t \x01(\x0b\x32\x42.google.cloud.visionai.v1.DataSchemaDetails.CustomizedStructConfig\x12Q\n\x0bgranularity\x18\x05 \x01(\x0e\x32\x37.google.cloud.visionai.v1.DataSchemaDetails.GranularityH\x01\x88\x01\x01\x12S\n\x0fsearch_strategy\x18\x07 \x01(\x0b\x32:.google.cloud.visionai.v1.DataSchemaDetails.SearchStrategy\x1a\"\n\x0eProtoAnyConfig\x12\x10\n\x08type_uri\x18\x01 \x01(\t\x1aO\n\nListConfig\x12\x41\n\x0cvalue_schema\x18\x01 \x01(\x0b\x32+.google.cloud.visionai.v1.DataSchemaDetails\x1a\xe7\x01\n\x16\x43ustomizedStructConfig\x12k\n\rfield_schemas\x18\x01 \x03(\x0b\x32T.google.cloud.visionai.v1.DataSchemaDetails.CustomizedStructConfig.FieldSchemasEntry\x1a`\n\x11\x46ieldSchemasEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12:\n\x05value\x18\x02 \x01(\x0b\x32+.google.cloud.visionai.v1.DataSchemaDetails:\x02\x38\x01\x1a\xb7\x03\n\x0eSearchStrategy\x12p\n\x14search_strategy_type\x18\x01 \x01(\x0e\x32M.google.cloud.visionai.v1.DataSchemaDetails.SearchStrategy.SearchStrategyTypeH\x00\x88\x01\x01\x12\x81\x01\n\x1d\x63onfidence_score_index_config\x18\x02 \x01(\x0b\x32U.google.cloud.visionai.v1.DataSchemaDetails.SearchStrategy.ConfidenceScoreIndexConfigB\x03\xe0\x41\x01\x1aM\n\x1a\x43onfidenceScoreIndexConfig\x12\x17\n\nfield_path\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x16\n\tthreshold\x18\x02 \x01(\x02\x42\x03\xe0\x41\x02\"G\n\x12SearchStrategyType\x12\r\n\tNO_SEARCH\x10\x00\x12\x10\n\x0c\x45XACT_SEARCH\x10\x01\x12\x10\n\x0cSMART_SEARCH\x10\x02\x42\x17\n\x15_search_strategy_type\"\xa8\x01\n\x08\x44\x61taType\x12\x19\n\x15\x44\x41TA_TYPE_UNSPECIFIED\x10\x00\x12\x0b\n\x07INTEGER\x10\x01\x12\t\n\x05\x46LOAT\x10\x02\x12\n\n\x06STRING\x10\x03\x12\x0c\n\x08\x44\x41TETIME\x10\x05\x12\x12\n\x0eGEO_COORDINATE\x10\x07\x12\r\n\tPROTO_ANY\x10\x08\x12\x0b\n\x07\x42OOLEAN\x10\t\x12\x08\n\x04LIST\x10\n\x12\x15\n\x11\x43USTOMIZED_STRUCT\x10\x06\"h\n\x0bGranularity\x12\x1b\n\x17GRANULARITY_UNSPECIFIED\x10\x00\x12\x1b\n\x17GRANULARITY_ASSET_LEVEL\x10\x01\x12\x1f\n\x1bGRANULARITY_PARTITION_LEVEL\x10\x02\x42\x07\n\x05_typeB\x0e\n\x0c_granularity\"\x8a\x01\n\x17UpdateDataSchemaRequest\x12>\n\x0b\x64\x61ta_schema\x18\x01 \x01(\x0b\x32$.google.cloud.visionai.v1.DataSchemaB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"P\n\x14GetDataSchemaRequest\x12\x38\n\x04name\x18\x01 \x01(\tB*\xe0\x41\x02\xfa\x41$\n\"visionai.googleapis.com/DataSchema\"S\n\x17\x44\x65leteDataSchemaRequest\x12\x38\n\x04name\x18\x01 \x01(\tB*\xe0\x41\x02\xfa\x41$\n\"visionai.googleapis.com/DataSchema\"{\n\x16ListDataSchemasRequest\x12:\n\x06parent\x18\x01 \x01(\tB*\xe0\x41\x02\xfa\x41$\x12\"visionai.googleapis.com/DataSchema\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\"n\n\x17ListDataSchemasResponse\x12:\n\x0c\x64\x61ta_schemas\x18\x01 \x03(\x0b\x32$.google.cloud.visionai.v1.DataSchema\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\xc2\x01\n\x17\x43reateAnnotationRequest\x12\x35\n\x06parent\x18\x01 \x01(\tB%\xe0\x41\x02\xfa\x41\x1f\n\x1dvisionai.googleapis.com/Asset\x12=\n\nannotation\x18\x02 \x01(\x0b\x32$.google.cloud.visionai.v1.AnnotationB\x03\xe0\x41\x02\x12\x1f\n\rannotation_id\x18\x03 \x01(\tB\x03\xe0\x41\x01H\x00\x88\x01\x01\x42\x10\n\x0e_annotation_id\"\x84\x02\n\nAnnotation\x12\x0c\n\x04name\x18\x01 \x01(\t\x12T\n\x19user_specified_annotation\x18\x02 \x01(\x0b\x32\x31.google.cloud.visionai.v1.UserSpecifiedAnnotation:\x91\x01\xea\x41\x8d\x01\n\"visionai.googleapis.com/Annotation\x12gprojects/{project_number}/locations/{location}/corpora/{corpus}/assets/{asset}/annotations/{annotation}\"\x9d\x01\n\x17UserSpecifiedAnnotation\x12\x10\n\x03key\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x38\n\x05value\x18\x02 \x01(\x0b\x32).google.cloud.visionai.v1.AnnotationValue\x12\x36\n\tpartition\x18\x03 \x01(\x0b\x32#.google.cloud.visionai.v1.Partition\"4\n\rGeoCoordinate\x12\x10\n\x08latitude\x18\x01 \x01(\x01\x12\x11\n\tlongitude\x18\x02 \x01(\x01\"\xd9\x03\n\x0f\x41nnotationValue\x12\x13\n\tint_value\x18\x01 \x01(\x03H\x00\x12\x15\n\x0b\x66loat_value\x18\x02 \x01(\x02H\x00\x12\x13\n\tstr_value\x18\x03 \x01(\tH\x00\x12\x18\n\x0e\x64\x61tetime_value\x18\x05 \x01(\tH\x00\x12\x41\n\x0egeo_coordinate\x18\x07 \x01(\x0b\x32\'.google.cloud.visionai.v1.GeoCoordinateH\x00\x12/\n\x0fproto_any_value\x18\x08 \x01(\x0b\x32\x14.google.protobuf.AnyH\x00\x12\x14\n\nbool_value\x18\t \x01(\x08H\x00\x12?\n\x1c\x63ustomized_struct_data_value\x18\n \x01(\x0b\x32\x17.google.protobuf.StructH\x00\x12>\n\nlist_value\x18\x0b \x01(\x0b\x32(.google.cloud.visionai.v1.AnnotationListH\x00\x12W\n\x17\x63ustomized_struct_value\x18\x06 \x01(\x0b\x32\x34.google.cloud.visionai.v1.AnnotationCustomizedStructH\x00\x42\x07\n\x05value\"K\n\x0e\x41nnotationList\x12\x39\n\x06values\x18\x01 \x03(\x0b\x32).google.cloud.visionai.v1.AnnotationValue\"\xce\x01\n\x1a\x41nnotationCustomizedStruct\x12T\n\x08\x65lements\x18\x02 \x03(\x0b\x32\x42.google.cloud.visionai.v1.AnnotationCustomizedStruct.ElementsEntry\x1aZ\n\rElementsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\x38\n\x05value\x18\x02 \x01(\x0b\x32).google.cloud.visionai.v1.AnnotationValue:\x02\x38\x01\"\x83\x01\n\x16ListAnnotationsRequest\x12\x32\n\x06parent\x18\x01 \x01(\tB\"\xfa\x41\x1f\n\x1dvisionai.googleapis.com/Asset\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\x12\x0e\n\x06\x66ilter\x18\x04 \x01(\t\"m\n\x17ListAnnotationsResponse\x12\x39\n\x0b\x61nnotations\x18\x01 \x03(\x0b\x32$.google.cloud.visionai.v1.Annotation\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"P\n\x14GetAnnotationRequest\x12\x38\n\x04name\x18\x01 \x01(\tB*\xe0\x41\x02\xfa\x41$\n\"visionai.googleapis.com/Annotation\"\x89\x01\n\x17UpdateAnnotationRequest\x12=\n\nannotation\x18\x01 \x01(\x0b\x32$.google.cloud.visionai.v1.AnnotationB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"S\n\x17\x44\x65leteAnnotationRequest\x12\x38\n\x04name\x18\x01 \x01(\tB*\xe0\x41\x02\xfa\x41$\n\"visionai.googleapis.com/Annotation\"q\n\x13ImportAssetsRequest\x12\x18\n\x0e\x61ssets_gcs_uri\x18\x02 \x01(\tH\x00\x12\x36\n\x06parent\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1evisionai.googleapis.com/CorpusB\x08\n\x06source\"\x95\x01\n\x14ImportAssetsMetadata\x12=\n\x08metadata\x18\x01 \x01(\x0b\x32+.google.cloud.visionai.v1.OperationMetadata\x12>\n\x06status\x18\x02 \x01(\x0b\x32..google.cloud.visionai.v1.BatchOperationStatus\"D\n\x14\x42\x61tchOperationStatus\x12\x15\n\rsuccess_count\x18\x01 \x01(\x05\x12\x15\n\rfailure_count\x18\x02 \x01(\x05\"\x16\n\x14ImportAssetsResponse\"\xbc\x01\n\x19\x43reateSearchConfigRequest\x12<\n\x06parent\x18\x01 \x01(\tB,\xe0\x41\x02\xfa\x41&\x12$visionai.googleapis.com/SearchConfig\x12\x42\n\rsearch_config\x18\x02 \x01(\x0b\x32&.google.cloud.visionai.v1.SearchConfigB\x03\xe0\x41\x02\x12\x1d\n\x10search_config_id\x18\x03 \x01(\tB\x03\xe0\x41\x02\"\x90\x01\n\x19UpdateSearchConfigRequest\x12\x42\n\rsearch_config\x18\x01 \x01(\x0b\x32&.google.cloud.visionai.v1.SearchConfigB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"T\n\x16GetSearchConfigRequest\x12:\n\x04name\x18\x01 \x01(\tB,\xe0\x41\x02\xfa\x41&\n$visionai.googleapis.com/SearchConfig\"W\n\x19\x44\x65leteSearchConfigRequest\x12:\n\x04name\x18\x01 \x01(\tB,\xe0\x41\x02\xfa\x41&\n$visionai.googleapis.com/SearchConfig\"\x7f\n\x18ListSearchConfigsRequest\x12<\n\x06parent\x18\x01 \x01(\tB,\xe0\x41\x02\xfa\x41&\x12$visionai.googleapis.com/SearchConfig\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\"t\n\x19ListSearchConfigsResponse\x12>\n\x0esearch_configs\x18\x01 \x03(\x0b\x32&.google.cloud.visionai.v1.SearchConfig\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\xbd\x02\n\x0cSearchConfig\x12\x0c\n\x04name\x18\x01 \x01(\t\x12?\n\x0e\x66\x61\x63\x65t_property\x18\x02 \x01(\x0b\x32\'.google.cloud.visionai.v1.FacetProperty\x12R\n\x18search_criteria_property\x18\x03 \x01(\x0b\x32\x30.google.cloud.visionai.v1.SearchCriteriaProperty:\x89\x01\xea\x41\x85\x01\n$visionai.googleapis.com/SearchConfig\x12]projects/{project_number}/locations/{location}/corpora/{corpus}/searchConfigs/{search_config}\"\xf5\x05\n\rIndexEndpoint\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x19\n\x0c\x64isplay_name\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x18\n\x0b\x64\x65scription\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12\x44\n\x0e\x64\x65ployed_index\x18\t \x01(\x0b\x32\'.google.cloud.visionai.v1.DeployedIndexB\x03\xe0\x41\x03\x12\x41\n\x05state\x18\x05 \x01(\x0e\x32-.google.cloud.visionai.v1.IndexEndpoint.StateB\x03\xe0\x41\x03\x12H\n\x06labels\x18\x06 \x03(\x0b\x32\x33.google.cloud.visionai.v1.IndexEndpoint.LabelsEntryB\x03\xe0\x41\x01\x12\x34\n\x0b\x63reate_time\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x08 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x1f\n\rsatisfies_pzs\x18\n \x01(\x08\x42\x03\xe0\x41\x03H\x00\x88\x01\x01\x12\x1f\n\rsatisfies_pzi\x18\x0b \x01(\x08\x42\x03\xe0\x41\x03H\x01\x88\x01\x01\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"S\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0c\n\x08\x43REATING\x10\x01\x12\x0b\n\x07\x43REATED\x10\x02\x12\x0c\n\x08UPDATING\x10\x03\x12\n\n\x06\x46\x41ILED\x10\x04:s\xea\x41p\n%visionai.googleapis.com/IndexEndpoint\x12Gprojects/{project}/locations/{location}/indexEndpoints/{index_endpoint}B\x10\n\x0e_satisfies_pzsB\x10\n\x0e_satisfies_pzi\"\xbd\x01\n\x1a\x43reateIndexEndpointRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\x12\x1e\n\x11index_endpoint_id\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x44\n\x0eindex_endpoint\x18\x03 \x01(\x0b\x32\'.google.cloud.visionai.v1.IndexEndpointB\x03\xe0\x41\x02\"f\n\x1b\x43reateIndexEndpointMetadata\x12G\n\x12operation_metadata\x18\x01 \x01(\x0b\x32+.google.cloud.visionai.v1.OperationMetadata\"V\n\x17GetIndexEndpointRequest\x12;\n\x04name\x18\x01 \x01(\tB-\xe0\x41\x02\xfa\x41\'\n%visionai.googleapis.com/IndexEndpoint\"\x9c\x01\n\x19ListIndexEndpointsRequest\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\"w\n\x1aListIndexEndpointsResponse\x12@\n\x0findex_endpoints\x18\x01 \x03(\x0b\x32\'.google.cloud.visionai.v1.IndexEndpoint\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\x98\x01\n\x1aUpdateIndexEndpointRequest\x12\x44\n\x0eindex_endpoint\x18\x01 \x01(\x0b\x32\'.google.cloud.visionai.v1.IndexEndpointB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\"f\n\x1bUpdateIndexEndpointMetadata\x12G\n\x12operation_metadata\x18\x01 \x01(\x0b\x32+.google.cloud.visionai.v1.OperationMetadata\"Y\n\x1a\x44\x65leteIndexEndpointRequest\x12;\n\x04name\x18\x01 \x01(\tB-\xe0\x41\x02\xfa\x41\'\n%visionai.googleapis.com/IndexEndpoint\"f\n\x1b\x44\x65leteIndexEndpointMetadata\x12G\n\x12operation_metadata\x18\x01 \x01(\x0b\x32+.google.cloud.visionai.v1.OperationMetadata\"\xa1\x01\n\x12\x44\x65ployIndexRequest\x12\x45\n\x0eindex_endpoint\x18\x01 \x01(\tB-\xe0\x41\x02\xfa\x41\'\n%visionai.googleapis.com/IndexEndpoint\x12\x44\n\x0e\x64\x65ployed_index\x18\x03 \x01(\x0b\x32\'.google.cloud.visionai.v1.DeployedIndexB\x03\xe0\x41\x02\"\x15\n\x13\x44\x65ployIndexResponse\"\x9d\x01\n\x13\x44\x65ployIndexMetadata\x12G\n\x12operation_metadata\x18\x01 \x01(\x0b\x32+.google.cloud.visionai.v1.OperationMetadata\x12=\n\x0e\x64\x65ployed_index\x18\x02 \x01(\tB%\xe0\x41\x03\xfa\x41\x1f\n\x1dvisionai.googleapis.com/Index\"\x9f\x01\n\x15UndeployIndexMetadata\x12G\n\x12operation_metadata\x18\x01 \x01(\x0b\x32+.google.cloud.visionai.v1.OperationMetadata\x12=\n\x0e\x64\x65ployed_index\x18\x02 \x01(\tB%\xe0\x41\x03\xfa\x41\x1f\n\x1dvisionai.googleapis.com/Index\"]\n\x14UndeployIndexRequest\x12\x45\n\x0eindex_endpoint\x18\x01 \x01(\tB-\xe0\x41\x02\xfa\x41\'\n%visionai.googleapis.com/IndexEndpoint\"\x17\n\x15UndeployIndexResponse\"E\n\rDeployedIndex\x12\x34\n\x05index\x18\x01 \x01(\tB%\xe0\x41\x02\xfa\x41\x1f\n\x1dvisionai.googleapis.com/Index\"\x84\x07\n\rFacetProperty\x12_\n\x17\x66ixed_range_bucket_spec\x18\x05 \x01(\x0b\x32<.google.cloud.visionai.v1.FacetProperty.FixedRangeBucketSpecH\x00\x12\x61\n\x18\x63ustom_range_bucket_spec\x18\x06 \x01(\x0b\x32=.google.cloud.visionai.v1.FacetProperty.CustomRangeBucketSpecH\x00\x12Z\n\x14\x64\x61tetime_bucket_spec\x18\x07 \x01(\x0b\x32:.google.cloud.visionai.v1.FacetProperty.DateTimeBucketSpecH\x00\x12\x15\n\rmapped_fields\x18\x01 \x03(\t\x12\x14\n\x0c\x64isplay_name\x18\x02 \x01(\t\x12\x13\n\x0bresult_size\x18\x03 \x01(\x03\x12>\n\x0b\x62ucket_type\x18\x04 \x01(\x0e\x32).google.cloud.visionai.v1.FacetBucketType\x1a\xaa\x01\n\x14\x46ixedRangeBucketSpec\x12:\n\x0c\x62ucket_start\x18\x01 \x01(\x0b\x32$.google.cloud.visionai.v1.FacetValue\x12@\n\x12\x62ucket_granularity\x18\x02 \x01(\x0b\x32$.google.cloud.visionai.v1.FacetValue\x12\x14\n\x0c\x62ucket_count\x18\x03 \x01(\x05\x1aP\n\x15\x43ustomRangeBucketSpec\x12\x37\n\tendpoints\x18\x01 \x03(\x0b\x32$.google.cloud.visionai.v1.FacetValue\x1a\xbb\x01\n\x12\x44\x61teTimeBucketSpec\x12[\n\x0bgranularity\x18\x01 \x01(\x0e\x32\x46.google.cloud.visionai.v1.FacetProperty.DateTimeBucketSpec.Granularity\"H\n\x0bGranularity\x12\x1b\n\x17GRANULARITY_UNSPECIFIED\x10\x00\x12\x08\n\x04YEAR\x10\x01\x12\t\n\x05MONTH\x10\x02\x12\x07\n\x03\x44\x41Y\x10\x03\x42\x14\n\x12range_facet_config\"\xde\x01\n\x0eSearchHypernym\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x15\n\x08hypernym\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x15\n\x08hyponyms\x18\x03 \x03(\tB\x03\xe0\x41\x01:\x8f\x01\xea\x41\x8b\x01\n&visionai.googleapis.com/SearchHypernym\x12\x61projects/{project_number}/locations/{location}/corpora/{corpus}/searchHypernyms/{search_hypernym}\"\xda\x01\n\x1b\x43reateSearchHypernymRequest\x12\x36\n\x06parent\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1evisionai.googleapis.com/Corpus\x12\x46\n\x0fsearch_hypernym\x18\x02 \x01(\x0b\x32(.google.cloud.visionai.v1.SearchHypernymB\x03\xe0\x41\x02\x12$\n\x12search_hypernym_id\x18\x03 \x01(\tB\x03\xe0\x41\x01H\x00\x88\x01\x01\x42\x15\n\x13_search_hypernym_id\"\x96\x01\n\x1bUpdateSearchHypernymRequest\x12\x46\n\x0fsearch_hypernym\x18\x01 \x01(\x0b\x32(.google.cloud.visionai.v1.SearchHypernymB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"X\n\x18GetSearchHypernymRequest\x12<\n\x04name\x18\x01 \x01(\tB.\xe0\x41\x02\xfa\x41(\n&visionai.googleapis.com/SearchHypernym\"[\n\x1b\x44\x65leteSearchHypernymRequest\x12<\n\x04name\x18\x01 \x01(\tB.\xe0\x41\x02\xfa\x41(\n&visionai.googleapis.com/SearchHypernym\"\x83\x01\n\x1aListSearchHypernymsRequest\x12>\n\x06parent\x18\x01 \x01(\tB.\xe0\x41\x02\xfa\x41(\x12&visionai.googleapis.com/SearchHypernym\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\"z\n\x1bListSearchHypernymsResponse\x12\x42\n\x10search_hypernyms\x18\x01 \x03(\x0b\x32(.google.cloud.visionai.v1.SearchHypernym\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"/\n\x16SearchCriteriaProperty\x12\x15\n\rmapped_fields\x18\x01 \x03(\t\"w\n\nFacetValue\x12\x16\n\x0cstring_value\x18\x01 \x01(\tH\x00\x12\x17\n\rinteger_value\x18\x02 \x01(\x03H\x00\x12/\n\x0e\x64\x61tetime_value\x18\x03 \x01(\x0b\x32\x15.google.type.DateTimeH\x00\x42\x07\n\x05value\"\x95\x02\n\x0b\x46\x61\x63\x65tBucket\x12\x35\n\x05value\x18\x02 \x01(\x0b\x32$.google.cloud.visionai.v1.FacetValueH\x00\x12<\n\x05range\x18\x04 \x01(\x0b\x32+.google.cloud.visionai.v1.FacetBucket.RangeH\x00\x12\x10\n\x08selected\x18\x03 \x01(\x08\x1ao\n\x05Range\x12\x33\n\x05start\x18\x01 \x01(\x0b\x32$.google.cloud.visionai.v1.FacetValue\x12\x31\n\x03\x65nd\x18\x02 \x01(\x0b\x32$.google.cloud.visionai.v1.FacetValueB\x0e\n\x0c\x62ucket_value\"\xcf\x01\n\nFacetGroup\x12\x10\n\x08\x66\x61\x63\x65t_id\x18\x01 \x01(\t\x12\x14\n\x0c\x64isplay_name\x18\x02 \x01(\t\x12\x36\n\x07\x62uckets\x18\x03 \x03(\x0b\x32%.google.cloud.visionai.v1.FacetBucket\x12>\n\x0b\x62ucket_type\x18\x04 \x01(\x0e\x32).google.cloud.visionai.v1.FacetBucketType\x12!\n\x19\x66\x65tch_matched_annotations\x18\x05 \x01(\x08\"\xa8\x05\n\x12IngestAssetRequest\x12\x45\n\x06\x63onfig\x18\x01 \x01(\x0b\x32\x33.google.cloud.visionai.v1.IngestAssetRequest.ConfigH\x00\x12Y\n\x11time_indexed_data\x18\x02 \x01(\x0b\x32<.google.cloud.visionai.v1.IngestAssetRequest.TimeIndexedDataH\x00\x1a\xe6\x02\n\x06\x43onfig\x12S\n\nvideo_type\x18\x02 \x01(\x0b\x32=.google.cloud.visionai.v1.IngestAssetRequest.Config.VideoTypeH\x00\x12\x34\n\x05\x61sset\x18\x01 \x01(\tB%\xe0\x41\x02\xfa\x41\x1f\n\x1dvisionai.googleapis.com/Asset\x1a\xc3\x01\n\tVideoType\x12g\n\x10\x63ontainer_format\x18\x01 \x01(\x0e\x32M.google.cloud.visionai.v1.IngestAssetRequest.Config.VideoType.ContainerFormat\"M\n\x0f\x43ontainerFormat\x12 \n\x1c\x43ONTAINER_FORMAT_UNSPECIFIED\x10\x00\x12\x18\n\x14\x43ONTAINER_FORMAT_MP4\x10\x01\x42\x0b\n\tdata_type\x1ar\n\x0fTimeIndexedData\x12\x0c\n\x04\x64\x61ta\x18\x01 \x01(\x0c\x12Q\n\x12temporal_partition\x18\x02 \x01(\x0b\x32\x35.google.cloud.visionai.v1.Partition.TemporalPartitionB\x13\n\x11streaming_request\"u\n\x13IngestAssetResponse\x12^\n\x1fsuccessfully_ingested_partition\x18\x01 \x01(\x0b\x32\x35.google.cloud.visionai.v1.Partition.TemporalPartition\"\x9f\x01\n\x10\x43lipAssetRequest\x12\x33\n\x04name\x18\x01 \x01(\tB%\xe0\x41\x02\xfa\x41\x1f\n\x1dvisionai.googleapis.com/Asset\x12V\n\x12temporal_partition\x18\x02 \x01(\x0b\x32\x35.google.cloud.visionai.v1.Partition.TemporalPartitionB\x03\xe0\x41\x02\"\xdc\x01\n\x11\x43lipAssetResponse\x12U\n\x11time_indexed_uris\x18\x01 \x03(\x0b\x32:.google.cloud.visionai.v1.ClipAssetResponse.TimeIndexedUri\x1ap\n\x0eTimeIndexedUri\x12Q\n\x12temporal_partition\x18\x01 \x01(\x0b\x32\x35.google.cloud.visionai.v1.Partition.TemporalPartition\x12\x0b\n\x03uri\x18\x02 \x01(\t\"\xbb\x01\n\x15GenerateHlsUriRequest\x12\x33\n\x04name\x18\x01 \x01(\tB%\xe0\x41\x02\xfa\x41\x1f\n\x1dvisionai.googleapis.com/Asset\x12R\n\x13temporal_partitions\x18\x02 \x03(\x0b\x32\x35.google.cloud.visionai.v1.Partition.TemporalPartition\x12\x19\n\x11live_view_enabled\x18\x03 \x01(\x08\"y\n\x16GenerateHlsUriResponse\x12\x0b\n\x03uri\x18\x01 \x01(\t\x12R\n\x13temporal_partitions\x18\x02 \x03(\x0b\x32\x35.google.cloud.visionai.v1.Partition.TemporalPartition\"\xd3\x03\n\x13SearchAssetsRequest\x12Y\n\x1bschema_key_sorting_strategy\x18\t \x01(\x0b\x32\x32.google.cloud.visionai.v1.SchemaKeySortingStrategyH\x00\x12\x36\n\x06\x63orpus\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1evisionai.googleapis.com/Corpus\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\x12I\n\x13\x63ontent_time_ranges\x18\x05 \x01(\x0b\x32,.google.cloud.visionai.v1.DateTimeRangeArray\x12\x34\n\x08\x63riteria\x18\x04 \x03(\x0b\x32\".google.cloud.visionai.v1.Criteria\x12>\n\x10\x66\x61\x63\x65t_selections\x18\x06 \x03(\x0b\x32$.google.cloud.visionai.v1.FacetGroup\x12\x1e\n\x16result_annotation_keys\x18\x08 \x03(\t\x12\x14\n\x0csearch_query\x18\n \x01(\tB\x0b\n\tsort_spec\"\xdc\x02\n\x1aSearchIndexEndpointRequest\x12;\n\x0bimage_query\x18\x02 \x01(\x0b\x32$.google.cloud.visionai.v1.ImageQueryH\x00\x12\x14\n\ntext_query\x18\x03 \x01(\tH\x00\x12\x45\n\x0eindex_endpoint\x18\x01 \x01(\tB-\xe0\x41\x02\xfa\x41\'\n%visionai.googleapis.com/IndexEndpoint\x12\x34\n\x08\x63riteria\x18\x04 \x03(\x0b\x32\".google.cloud.visionai.v1.Criteria\x12>\n\x12\x65xclusion_criteria\x18\x07 \x03(\x0b\x32\".google.cloud.visionai.v1.Criteria\x12\x11\n\tpage_size\x18\x05 \x01(\x05\x12\x12\n\npage_token\x18\x06 \x01(\tB\x07\n\x05query\"a\n\nImageQuery\x12\x15\n\x0binput_image\x18\x01 \x01(\x0cH\x00\x12\x33\n\x05\x61sset\x18\x02 \x01(\tB\"\xfa\x41\x1f\n\x1dvisionai.googleapis.com/AssetH\x00\x42\x07\n\x05image\"\x94\x03\n\x18SchemaKeySortingStrategy\x12J\n\x07options\x18\x01 \x03(\x0b\x32\x39.google.cloud.visionai.v1.SchemaKeySortingStrategy.Option\x1a\xab\x02\n\x06Option\x12\x17\n\x0f\x64\x61ta_schema_key\x18\x01 \x01(\t\x12\x17\n\x0fsort_decreasing\x18\x02 \x01(\x08\x12h\n\x10\x61ggregate_method\x18\x03 \x01(\x0e\x32I.google.cloud.visionai.v1.SchemaKeySortingStrategy.Option.AggregateMethodH\x00\x88\x01\x01\"p\n\x0f\x41ggregateMethod\x12 \n\x1c\x41GGREGATE_METHOD_UNSPECIFIED\x10\x00\x12\x1c\n\x18\x41GGREGATE_METHOD_LARGEST\x10\x01\x12\x1d\n\x19\x41GGREGATE_METHOD_SMALLEST\x10\x02\x42\x13\n\x11_aggregate_method\"\x15\n\x13\x44\x65leteAssetMetadata\"\xb7\x01\n\x18\x41nnotationMatchingResult\x12\x34\n\x08\x63riteria\x18\x01 \x01(\x0b\x32\".google.cloud.visionai.v1.Criteria\x12\x41\n\x13matched_annotations\x18\x02 \x03(\x0b\x32$.google.cloud.visionai.v1.Annotation\x12\"\n\x06status\x18\x03 \x01(\x0b\x32\x12.google.rpc.Status\"\xe7\x02\n\x10SearchResultItem\x12\r\n\x05\x61sset\x18\x01 \x01(\t\x12K\n\x08segments\x18\x02 \x03(\x0b\x32\x35.google.cloud.visionai.v1.Partition.TemporalPartitionB\x02\x18\x01\x12\x46\n\x07segment\x18\x05 \x01(\x0b\x32\x35.google.cloud.visionai.v1.Partition.TemporalPartition\x12\x11\n\trelevance\x18\x06 \x01(\x01\x12\x43\n\x15requested_annotations\x18\x03 \x03(\x0b\x32$.google.cloud.visionai.v1.Annotation\x12W\n\x1b\x61nnotation_matching_results\x18\x04 \x03(\x0b\x32\x32.google.cloud.visionai.v1.AnnotationMatchingResult\"\xb5\x01\n\x14SearchAssetsResponse\x12G\n\x13search_result_items\x18\x01 \x03(\x0b\x32*.google.cloud.visionai.v1.SearchResultItem\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12;\n\rfacet_results\x18\x03 \x03(\x0b\x32$.google.cloud.visionai.v1.FacetGroup\"\x7f\n\x1bSearchIndexEndpointResponse\x12G\n\x13search_result_items\x18\x01 \x03(\x0b\x32*.google.cloud.visionai.v1.SearchResultItem\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"B\n\x08IntRange\x12\x12\n\x05start\x18\x01 \x01(\x03H\x00\x88\x01\x01\x12\x10\n\x03\x65nd\x18\x02 \x01(\x03H\x01\x88\x01\x01\x42\x08\n\x06_startB\x06\n\x04_end\"D\n\nFloatRange\x12\x12\n\x05start\x18\x01 \x01(\x02H\x00\x88\x01\x01\x12\x10\n\x03\x65nd\x18\x02 \x01(\x02H\x01\x88\x01\x01\x42\x08\n\x06_startB\x06\n\x04_end\"!\n\x0bStringArray\x12\x12\n\ntxt_values\x18\x01 \x03(\t\"G\n\rIntRangeArray\x12\x36\n\nint_ranges\x18\x01 \x03(\x0b\x32\".google.cloud.visionai.v1.IntRange\"M\n\x0f\x46loatRangeArray\x12:\n\x0c\x66loat_ranges\x18\x01 \x03(\x0b\x32$.google.cloud.visionai.v1.FloatRange\"Y\n\rDateTimeRange\x12$\n\x05start\x18\x01 \x01(\x0b\x32\x15.google.type.DateTime\x12\"\n\x03\x65nd\x18\x02 \x01(\x0b\x32\x15.google.type.DateTime\"W\n\x12\x44\x61teTimeRangeArray\x12\x41\n\x10\x64\x61te_time_ranges\x18\x01 \x03(\x0b\x32\'.google.cloud.visionai.v1.DateTimeRange\"G\n\nCircleArea\x12\x10\n\x08latitude\x18\x01 \x01(\x01\x12\x11\n\tlongitude\x18\x02 \x01(\x01\x12\x14\n\x0cradius_meter\x18\x03 \x01(\x01\"N\n\x10GeoLocationArray\x12:\n\x0c\x63ircle_areas\x18\x01 \x03(\x0b\x32$.google.cloud.visionai.v1.CircleArea\"\x1a\n\tBoolValue\x12\r\n\x05value\x18\x01 \x01(\x08\"\xe2\x03\n\x08\x43riteria\x12;\n\ntext_array\x18\x02 \x01(\x0b\x32%.google.cloud.visionai.v1.StringArrayH\x00\x12\x42\n\x0fint_range_array\x18\x03 \x01(\x0b\x32\'.google.cloud.visionai.v1.IntRangeArrayH\x00\x12\x46\n\x11\x66loat_range_array\x18\x04 \x01(\x0b\x32).google.cloud.visionai.v1.FloatRangeArrayH\x00\x12M\n\x15\x64\x61te_time_range_array\x18\x05 \x01(\x0b\x32,.google.cloud.visionai.v1.DateTimeRangeArrayH\x00\x12H\n\x12geo_location_array\x18\x06 \x01(\x0b\x32*.google.cloud.visionai.v1.GeoLocationArrayH\x00\x12\x39\n\nbool_value\x18\x07 \x01(\x0b\x32#.google.cloud.visionai.v1.BoolValueH\x00\x12\r\n\x05\x66ield\x18\x01 \x01(\t\x12!\n\x19\x66\x65tch_matched_annotations\x18\x08 \x01(\x08\x42\x07\n\x05value\"\x90\x05\n\tPartition\x12Q\n\x12temporal_partition\x18\x01 \x01(\x0b\x32\x35.google.cloud.visionai.v1.Partition.TemporalPartition\x12O\n\x11spatial_partition\x18\x02 \x01(\x0b\x32\x34.google.cloud.visionai.v1.Partition.SpatialPartition\x12\x62\n\x1brelative_temporal_partition\x18\x03 \x01(\x0b\x32=.google.cloud.visionai.v1.Partition.RelativeTemporalPartition\x1aq\n\x11TemporalPartition\x12.\n\nstart_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12,\n\x08\x65nd_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x1a\x8a\x01\n\x10SpatialPartition\x12\x12\n\x05x_min\x18\x01 \x01(\x03H\x00\x88\x01\x01\x12\x12\n\x05y_min\x18\x02 \x01(\x03H\x01\x88\x01\x01\x12\x12\n\x05x_max\x18\x03 \x01(\x03H\x02\x88\x01\x01\x12\x12\n\x05y_max\x18\x04 \x01(\x03H\x03\x88\x01\x01\x42\x08\n\x06_x_minB\x08\n\x06_y_minB\x08\n\x06_x_maxB\x08\n\x06_y_max\x1a{\n\x19RelativeTemporalPartition\x12/\n\x0cstart_offset\x18\x01 \x01(\x0b\x32\x19.google.protobuf.Duration\x12-\n\nend_offset\x18\x02 \x01(\x0b\x32\x19.google.protobuf.Duration*\xb8\x01\n\x0f\x46\x61\x63\x65tBucketType\x12!\n\x1d\x46\x41\x43\x45T_BUCKET_TYPE_UNSPECIFIED\x10\x00\x12\x1b\n\x17\x46\x41\x43\x45T_BUCKET_TYPE_VALUE\x10\x01\x12\x1e\n\x1a\x46\x41\x43\x45T_BUCKET_TYPE_DATETIME\x10\x02\x12!\n\x1d\x46\x41\x43\x45T_BUCKET_TYPE_FIXED_RANGE\x10\x03\x12\"\n\x1e\x46\x41\x43\x45T_BUCKET_TYPE_CUSTOM_RANGE\x10\x04\x32\x9b\x66\n\tWarehouse\x12\xb9\x01\n\x0b\x43reateAsset\x12,.google.cloud.visionai.v1.CreateAssetRequest\x1a\x1f.google.cloud.visionai.v1.Asset\"[\xda\x41\x15parent,asset,asset_id\x82\xd3\xe4\x93\x02=\"4/v1/{parent=projects/*/locations/*/corpora/*}/assets:\x05\x61sset\x12\xbb\x01\n\x0bUpdateAsset\x12,.google.cloud.visionai.v1.UpdateAssetRequest\x1a\x1f.google.cloud.visionai.v1.Asset\"]\xda\x41\x11\x61sset,update_mask\x82\xd3\xe4\x93\x02\x43\x32:/v1/{asset.name=projects/*/locations/*/corpora/*/assets/*}:\x05\x61sset\x12\x9b\x01\n\x08GetAsset\x12).google.cloud.visionai.v1.GetAssetRequest\x1a\x1f.google.cloud.visionai.v1.Asset\"C\xda\x41\x04name\x82\xd3\xe4\x93\x02\x36\x12\x34/v1/{name=projects/*/locations/*/corpora/*/assets/*}\x12\xae\x01\n\nListAssets\x12+.google.cloud.visionai.v1.ListAssetsRequest\x1a,.google.cloud.visionai.v1.ListAssetsResponse\"E\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x36\x12\x34/v1/{parent=projects/*/locations/*/corpora/*}/assets\x12\xce\x01\n\x0b\x44\x65leteAsset\x12,.google.cloud.visionai.v1.DeleteAssetRequest\x1a\x1d.google.longrunning.Operation\"r\xca\x41,\n\x15google.protobuf.Empty\x12\x13\x44\x65leteAssetMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02\x36*4/v1/{name=projects/*/locations/*/corpora/*/assets/*}\x12\xcf\x01\n\x0bUploadAsset\x12,.google.cloud.visionai.v1.UploadAssetRequest\x1a\x1d.google.longrunning.Operation\"s\xca\x41*\n\x13UploadAssetResponse\x12\x13UploadAssetMetadata\x82\xd3\xe4\x93\x02@\";/v1/{name=projects/*/locations/*/corpora/*/assets/*}:upload:\x01*\x12\xdb\x01\n\x14GenerateRetrievalUrl\x12\x35.google.cloud.visionai.v1.GenerateRetrievalUrlRequest\x1a\x36.google.cloud.visionai.v1.GenerateRetrievalUrlResponse\"T\x82\xd3\xe4\x93\x02N\"I/v1/{name=projects/*/locations/*/corpora/*/assets/*}:generateRetrievalUrl:\x01*\x12\xd4\x01\n\x0c\x41nalyzeAsset\x12-.google.cloud.visionai.v1.AnalyzeAssetRequest\x1a\x1d.google.longrunning.Operation\"v\xca\x41,\n\x14\x41nalyzeAssetResponse\x12\x14\x41nalyzeAssetMetadata\x82\xd3\xe4\x93\x02\x41\"\"5/v1/{parent=projects/*/locations/*/corpora/*}/indexes:\x05index\x12\xd9\x01\n\x0bUpdateIndex\x12,.google.cloud.visionai.v1.UpdateIndexRequest\x1a\x1d.google.longrunning.Operation\"}\xca\x41\x1c\n\x05Index\x12\x13UpdateIndexMetadata\xda\x41\x11index,update_mask\x82\xd3\xe4\x93\x02\x44\x32;/v1/{index.name=projects/*/locations/*/corpora/*/indexes/*}:\x05index\x12\x9c\x01\n\x08GetIndex\x12).google.cloud.visionai.v1.GetIndexRequest\x1a\x1f.google.cloud.visionai.v1.Index\"D\xda\x41\x04name\x82\xd3\xe4\x93\x02\x37\x12\x35/v1/{name=projects/*/locations/*/corpora/*/indexes/*}\x12\xb2\x01\n\x0bListIndexes\x12,.google.cloud.visionai.v1.ListIndexesRequest\x1a-.google.cloud.visionai.v1.ListIndexesResponse\"F\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x37\x12\x35/v1/{parent=projects/*/locations/*/corpora/*}/indexes\x12\xcf\x01\n\x0b\x44\x65leteIndex\x12,.google.cloud.visionai.v1.DeleteIndexRequest\x1a\x1d.google.longrunning.Operation\"s\xca\x41,\n\x15google.protobuf.Empty\x12\x13\x44\x65leteIndexMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02\x37*5/v1/{name=projects/*/locations/*/corpora/*/indexes/*}\x12\xca\x01\n\x0c\x43reateCorpus\x12-.google.cloud.visionai.v1.CreateCorpusRequest\x1a\x1d.google.longrunning.Operation\"l\xca\x41\x1e\n\x06\x43orpus\x12\x14\x43reateCorpusMetadata\xda\x41\rparent,corpus\x82\xd3\xe4\x93\x02\x35\"+/v1/{parent=projects/*/locations/*}/corpora:\x06\x63orpus\x12\x95\x01\n\tGetCorpus\x12*.google.cloud.visionai.v1.GetCorpusRequest\x1a .google.cloud.visionai.v1.Corpus\":\xda\x41\x04name\x82\xd3\xe4\x93\x02-\x12+/v1/{name=projects/*/locations/*/corpora/*}\x12\xb8\x01\n\x0cUpdateCorpus\x12-.google.cloud.visionai.v1.UpdateCorpusRequest\x1a .google.cloud.visionai.v1.Corpus\"W\xda\x41\x12\x63orpus,update_mask\x82\xd3\xe4\x93\x02<22/v1/{corpus.name=projects/*/locations/*/corpora/*}:\x06\x63orpus\x12\xa8\x01\n\x0bListCorpora\x12,.google.cloud.visionai.v1.ListCorporaRequest\x1a-.google.cloud.visionai.v1.ListCorporaResponse\"<\xda\x41\x06parent\x82\xd3\xe4\x93\x02-\x12+/v1/{parent=projects/*/locations/*}/corpora\x12\x91\x01\n\x0c\x44\x65leteCorpus\x12-.google.cloud.visionai.v1.DeleteCorpusRequest\x1a\x16.google.protobuf.Empty\":\xda\x41\x04name\x82\xd3\xe4\x93\x02-*+/v1/{name=projects/*/locations/*/corpora/*}\x12\xcf\x01\n\rAnalyzeCorpus\x12..google.cloud.visionai.v1.AnalyzeCorpusRequest\x1a\x1d.google.longrunning.Operation\"o\xca\x41.\n\x15\x41nalyzeCorpusResponse\x12\x15\x41nalyzeCorpusMetadata\x82\xd3\xe4\x93\x02\x38\"3/v1/{name=projects/*/locations/*/corpora/*}:analyze:\x01*\x12\xd0\x01\n\x10\x43reateDataSchema\x12\x31.google.cloud.visionai.v1.CreateDataSchemaRequest\x1a$.google.cloud.visionai.v1.DataSchema\"c\xda\x41\x12parent,data_schema\x82\xd3\xe4\x93\x02H\"9/v1/{parent=projects/*/locations/*/corpora/*}/dataSchemas:\x0b\x64\x61ta_schema\x12\xe1\x01\n\x10UpdateDataSchema\x12\x31.google.cloud.visionai.v1.UpdateDataSchemaRequest\x1a$.google.cloud.visionai.v1.DataSchema\"t\xda\x41\x17\x64\x61ta_schema,update_mask\x82\xd3\xe4\x93\x02T2E/v1/{data_schema.name=projects/*/locations/*/corpora/*/dataSchemas/*}:\x0b\x64\x61ta_schema\x12\xaf\x01\n\rGetDataSchema\x12..google.cloud.visionai.v1.GetDataSchemaRequest\x1a$.google.cloud.visionai.v1.DataSchema\"H\xda\x41\x04name\x82\xd3\xe4\x93\x02;\x12\x39/v1/{name=projects/*/locations/*/corpora/*/dataSchemas/*}\x12\xa7\x01\n\x10\x44\x65leteDataSchema\x12\x31.google.cloud.visionai.v1.DeleteDataSchemaRequest\x1a\x16.google.protobuf.Empty\"H\xda\x41\x04name\x82\xd3\xe4\x93\x02;*9/v1/{name=projects/*/locations/*/corpora/*/dataSchemas/*}\x12\xc2\x01\n\x0fListDataSchemas\x12\x30.google.cloud.visionai.v1.ListDataSchemasRequest\x1a\x31.google.cloud.visionai.v1.ListDataSchemasResponse\"J\xda\x41\x06parent\x82\xd3\xe4\x93\x02;\x12\x39/v1/{parent=projects/*/locations/*/corpora/*}/dataSchemas\x12\xe5\x01\n\x10\x43reateAnnotation\x12\x31.google.cloud.visionai.v1.CreateAnnotationRequest\x1a$.google.cloud.visionai.v1.Annotation\"x\xda\x41\x1fparent,annotation,annotation_id\x82\xd3\xe4\x93\x02P\"B/v1/{parent=projects/*/locations/*/corpora/*/assets/*}/annotations:\nannotation\x12\xb8\x01\n\rGetAnnotation\x12..google.cloud.visionai.v1.GetAnnotationRequest\x1a$.google.cloud.visionai.v1.Annotation\"Q\xda\x41\x04name\x82\xd3\xe4\x93\x02\x44\x12\x42/v1/{name=projects/*/locations/*/corpora/*/assets/*/annotations/*}\x12\xcb\x01\n\x0fListAnnotations\x12\x30.google.cloud.visionai.v1.ListAnnotationsRequest\x1a\x31.google.cloud.visionai.v1.ListAnnotationsResponse\"S\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x44\x12\x42/v1/{parent=projects/*/locations/*/corpora/*/assets/*}/annotations\x12\xe7\x01\n\x10UpdateAnnotation\x12\x31.google.cloud.visionai.v1.UpdateAnnotationRequest\x1a$.google.cloud.visionai.v1.Annotation\"z\xda\x41\x16\x61nnotation,update_mask\x82\xd3\xe4\x93\x02[2M/v1/{annotation.name=projects/*/locations/*/corpora/*/assets/*/annotations/*}:\nannotation\x12\xb0\x01\n\x10\x44\x65leteAnnotation\x12\x31.google.cloud.visionai.v1.DeleteAnnotationRequest\x1a\x16.google.protobuf.Empty\"Q\xda\x41\x04name\x82\xd3\xe4\x93\x02\x44*B/v1/{name=projects/*/locations/*/corpora/*/assets/*/annotations/*}\x12p\n\x0bIngestAsset\x12,.google.cloud.visionai.v1.IngestAssetRequest\x1a-.google.cloud.visionai.v1.IngestAssetResponse\"\x00(\x01\x30\x01\x12\xaa\x01\n\tClipAsset\x12*.google.cloud.visionai.v1.ClipAssetRequest\x1a+.google.cloud.visionai.v1.ClipAssetResponse\"D\x82\xd3\xe4\x93\x02>\"9/v1/{name=projects/*/locations/*/corpora/*/assets/*}:clip:\x01*\x12\xc3\x01\n\x0eGenerateHlsUri\x12/.google.cloud.visionai.v1.GenerateHlsUriRequest\x1a\x30.google.cloud.visionai.v1.GenerateHlsUriResponse\"N\x82\xd3\xe4\x93\x02H\"C/v1/{name=projects/*/locations/*/corpora/*/assets/*}:generateHlsUri:\x01*\x12\xd3\x01\n\x0cImportAssets\x12-.google.cloud.visionai.v1.ImportAssetsRequest\x1a\x1d.google.longrunning.Operation\"u\xca\x41,\n\x14ImportAssetsResponse\x12\x14ImportAssetsMetadata\x82\xd3\xe4\x93\x02@\";/v1/{parent=projects/*/locations/*/corpora/*}/assets:import:\x01*\x12\xed\x01\n\x12\x43reateSearchConfig\x12\x33.google.cloud.visionai.v1.CreateSearchConfigRequest\x1a&.google.cloud.visionai.v1.SearchConfig\"z\xda\x41%parent,search_config,search_config_id\x82\xd3\xe4\x93\x02L\";/v1/{parent=projects/*/locations/*/corpora/*}/searchConfigs:\rsearch_config\x12\xef\x01\n\x12UpdateSearchConfig\x12\x33.google.cloud.visionai.v1.UpdateSearchConfigRequest\x1a&.google.cloud.visionai.v1.SearchConfig\"|\xda\x41\x19search_config,update_mask\x82\xd3\xe4\x93\x02Z2I/v1/{search_config.name=projects/*/locations/*/corpora/*/searchConfigs/*}:\rsearch_config\x12\xb7\x01\n\x0fGetSearchConfig\x12\x30.google.cloud.visionai.v1.GetSearchConfigRequest\x1a&.google.cloud.visionai.v1.SearchConfig\"J\xda\x41\x04name\x82\xd3\xe4\x93\x02=\x12;/v1/{name=projects/*/locations/*/corpora/*/searchConfigs/*}\x12\xad\x01\n\x12\x44\x65leteSearchConfig\x12\x33.google.cloud.visionai.v1.DeleteSearchConfigRequest\x1a\x16.google.protobuf.Empty\"J\xda\x41\x04name\x82\xd3\xe4\x93\x02=*;/v1/{name=projects/*/locations/*/corpora/*/searchConfigs/*}\x12\xca\x01\n\x11ListSearchConfigs\x12\x32.google.cloud.visionai.v1.ListSearchConfigsRequest\x1a\x33.google.cloud.visionai.v1.ListSearchConfigsResponse\"L\xda\x41\x06parent\x82\xd3\xe4\x93\x02=\x12;/v1/{parent=projects/*/locations/*/corpora/*}/searchConfigs\x12\xfc\x01\n\x14\x43reateSearchHypernym\x12\x35.google.cloud.visionai.v1.CreateSearchHypernymRequest\x1a(.google.cloud.visionai.v1.SearchHypernym\"\x82\x01\xda\x41)parent,search_hypernym,search_hypernym_id\x82\xd3\xe4\x93\x02P\"=/v1/{parent=projects/*/locations/*/corpora/*}/searchHypernyms:\x0fsearch_hypernym\x12\xfe\x01\n\x14UpdateSearchHypernym\x12\x35.google.cloud.visionai.v1.UpdateSearchHypernymRequest\x1a(.google.cloud.visionai.v1.SearchHypernym\"\x84\x01\xda\x41\x1bsearch_hypernym,update_mask\x82\xd3\xe4\x93\x02`2M/v1/{search_hypernym.name=projects/*/locations/*/corpora/*/searchHypernyms/*}:\x0fsearch_hypernym\x12\xbf\x01\n\x11GetSearchHypernym\x12\x32.google.cloud.visionai.v1.GetSearchHypernymRequest\x1a(.google.cloud.visionai.v1.SearchHypernym\"L\xda\x41\x04name\x82\xd3\xe4\x93\x02?\x12=/v1/{name=projects/*/locations/*/corpora/*/searchHypernyms/*}\x12\xb3\x01\n\x14\x44\x65leteSearchHypernym\x12\x35.google.cloud.visionai.v1.DeleteSearchHypernymRequest\x1a\x16.google.protobuf.Empty\"L\xda\x41\x04name\x82\xd3\xe4\x93\x02?*=/v1/{name=projects/*/locations/*/corpora/*/searchHypernyms/*}\x12\xd2\x01\n\x13ListSearchHypernyms\x12\x34.google.cloud.visionai.v1.ListSearchHypernymsRequest\x1a\x35.google.cloud.visionai.v1.ListSearchHypernymsResponse\"N\xda\x41\x06parent\x82\xd3\xe4\x93\x02?\x12=/v1/{parent=projects/*/locations/*/corpora/*}/searchHypernyms\x12\xb4\x01\n\x0cSearchAssets\x12-.google.cloud.visionai.v1.SearchAssetsRequest\x1a..google.cloud.visionai.v1.SearchAssetsResponse\"E\x82\xd3\xe4\x93\x02?\":/v1/{corpus=projects/*/locations/*/corpora/*}:searchAssets:\x01*\x12\xdf\x01\n\x13SearchIndexEndpoint\x12\x34.google.cloud.visionai.v1.SearchIndexEndpointRequest\x1a\x35.google.cloud.visionai.v1.SearchIndexEndpointResponse\"[\x82\xd3\xe4\x93\x02U\"P/v1/{index_endpoint=projects/*/locations/*/indexEndpoints/*}:searchIndexEndpoint:\x01*\x12\x90\x02\n\x13\x43reateIndexEndpoint\x12\x34.google.cloud.visionai.v1.CreateIndexEndpointRequest\x1a\x1d.google.longrunning.Operation\"\xa3\x01\xca\x41,\n\rIndexEndpoint\x12\x1b\x43reateIndexEndpointMetadata\xda\x41\'parent,index_endpoint,index_endpoint_id\x82\xd3\xe4\x93\x02\x44\"2/v1/{parent=projects/*/locations/*}/indexEndpoints:\x0eindex_endpoint\x12\xb1\x01\n\x10GetIndexEndpoint\x12\x31.google.cloud.visionai.v1.GetIndexEndpointRequest\x1a\'.google.cloud.visionai.v1.IndexEndpoint\"A\xda\x41\x04name\x82\xd3\xe4\x93\x02\x34\x12\x32/v1/{name=projects/*/locations/*/indexEndpoints/*}\x12\xc4\x01\n\x12ListIndexEndpoints\x12\x33.google.cloud.visionai.v1.ListIndexEndpointsRequest\x1a\x34.google.cloud.visionai.v1.ListIndexEndpointsResponse\"C\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x34\x12\x32/v1/{parent=projects/*/locations/*}/indexEndpoints\x12\x92\x02\n\x13UpdateIndexEndpoint\x12\x34.google.cloud.visionai.v1.UpdateIndexEndpointRequest\x1a\x1d.google.longrunning.Operation\"\xa5\x01\xca\x41,\n\rIndexEndpoint\x12\x1bUpdateIndexEndpointMetadata\xda\x41\x1aindex_endpoint,update_mask\x82\xd3\xe4\x93\x02S2A/v1/{index_endpoint.name=projects/*/locations/*/indexEndpoints/*}:\x0eindex_endpoint\x12\xe4\x01\n\x13\x44\x65leteIndexEndpoint\x12\x34.google.cloud.visionai.v1.DeleteIndexEndpointRequest\x1a\x1d.google.longrunning.Operation\"x\xca\x41\x34\n\x15google.protobuf.Empty\x12\x1b\x44\x65leteIndexEndpointMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02\x34*2/v1/{name=projects/*/locations/*/indexEndpoints/*}\x12\xdd\x01\n\x0b\x44\x65ployIndex\x12,.google.cloud.visionai.v1.DeployIndexRequest\x1a\x1d.google.longrunning.Operation\"\x80\x01\xca\x41*\n\x13\x44\x65ployIndexResponse\x12\x13\x44\x65ployIndexMetadata\x82\xd3\xe4\x93\x02M\"H/v1/{index_endpoint=projects/*/locations/*/indexEndpoints/*}:deployIndex:\x01*\x12\xe7\x01\n\rUndeployIndex\x12..google.cloud.visionai.v1.UndeployIndexRequest\x1a\x1d.google.longrunning.Operation\"\x86\x01\xca\x41.\n\x15UndeployIndexResponse\x12\x15UndeployIndexMetadata\x82\xd3\xe4\x93\x02O\"J/v1/{index_endpoint=projects/*/locations/*/indexEndpoints/*}:undeployIndex:\x01*\x12\xff\x01\n\x10\x43reateCollection\x12\x31.google.cloud.visionai.v1.CreateCollectionRequest\x1a\x1d.google.longrunning.Operation\"\x98\x01\xca\x41&\n\nCollection\x12\x18\x43reateCollectionMetadata\xda\x41\x1fparent,collection,collection_id\x82\xd3\xe4\x93\x02G\"9/v1/{parent=projects/*/locations/*/corpora/*}/collections:\ncollection\x12\xe2\x01\n\x10\x44\x65leteCollection\x12\x31.google.cloud.visionai.v1.DeleteCollectionRequest\x1a\x1d.google.longrunning.Operation\"|\xca\x41\x31\n\x15google.protobuf.Empty\x12\x18\x44\x65leteCollectionMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02;*9/v1/{name=projects/*/locations/*/corpora/*/collections/*}\x12\xaf\x01\n\rGetCollection\x12..google.cloud.visionai.v1.GetCollectionRequest\x1a$.google.cloud.visionai.v1.Collection\"H\xda\x41\x04name\x82\xd3\xe4\x93\x02;\x12\x39/v1/{name=projects/*/locations/*/corpora/*/collections/*}\x12\xde\x01\n\x10UpdateCollection\x12\x31.google.cloud.visionai.v1.UpdateCollectionRequest\x1a$.google.cloud.visionai.v1.Collection\"q\xda\x41\x16\x63ollection,update_mask\x82\xd3\xe4\x93\x02R2D/v1/{collection.name=projects/*/locations/*/corpora/*/collections/*}:\ncollection\x12\xc2\x01\n\x0fListCollections\x12\x30.google.cloud.visionai.v1.ListCollectionsRequest\x1a\x31.google.cloud.visionai.v1.ListCollectionsResponse\"J\xda\x41\x06parent\x82\xd3\xe4\x93\x02;\x12\x39/v1/{parent=projects/*/locations/*/corpora/*}/collections\x12\xe6\x01\n\x11\x41\x64\x64\x43ollectionItem\x12\x32.google.cloud.visionai.v1.AddCollectionItemRequest\x1a\x33.google.cloud.visionai.v1.AddCollectionItemResponse\"h\xda\x41\x04item\x82\xd3\xe4\x93\x02[\"V/v1/{item.collection=projects/*/locations/*/corpora/*/collections/*}:addCollectionItem:\x01*\x12\xf2\x01\n\x14RemoveCollectionItem\x12\x35.google.cloud.visionai.v1.RemoveCollectionItemRequest\x1a\x36.google.cloud.visionai.v1.RemoveCollectionItemResponse\"k\xda\x41\x04item\x82\xd3\xe4\x93\x02^\"Y/v1/{item.collection=projects/*/locations/*/corpora/*/collections/*}:removeCollectionItem:\x01*\x12\xec\x01\n\x13ViewCollectionItems\x12\x34.google.cloud.visionai.v1.ViewCollectionItemsRequest\x1a\x35.google.cloud.visionai.v1.ViewCollectionItemsResponse\"h\xda\x41\ncollection\x82\xd3\xe4\x93\x02U\x12S/v1/{collection=projects/*/locations/*/corpora/*/collections/*}:viewCollectionItems\x1aU\xca\x41!warehouse-visionai.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\xbe\x01\n\x1c\x63om.google.cloud.visionai.v1B\x0eWarehouseProtoP\x01Z8cloud.google.com/go/visionai/apiv1/visionaipb;visionaipb\xaa\x02\x18Google.Cloud.VisionAI.V1\xca\x02\x18Google\\Cloud\\VisionAI\\V1\xea\x02\x1bGoogle::Cloud::VisionAI::V1b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module VisionAI - module V1 - CreateAssetRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.CreateAssetRequest").msgclass - GetAssetRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.GetAssetRequest").msgclass - ListAssetsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.ListAssetsRequest").msgclass - ListAssetsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.ListAssetsResponse").msgclass - UpdateAssetRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.UpdateAssetRequest").msgclass - DeleteAssetRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.DeleteAssetRequest").msgclass - AssetSource = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.AssetSource").msgclass - AssetSource::AssetGcsSource = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.AssetSource.AssetGcsSource").msgclass - AssetSource::AssetContentData = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.AssetSource.AssetContentData").msgclass - UploadAssetRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.UploadAssetRequest").msgclass - UploadAssetResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.UploadAssetResponse").msgclass - UploadAssetMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.UploadAssetMetadata").msgclass - GenerateRetrievalUrlRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.GenerateRetrievalUrlRequest").msgclass - GenerateRetrievalUrlResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.GenerateRetrievalUrlResponse").msgclass - Asset = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.Asset").msgclass - AnalyzeAssetRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.AnalyzeAssetRequest").msgclass - AnalyzeAssetMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.AnalyzeAssetMetadata").msgclass - AnalyzeAssetMetadata::AnalysisStatus = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.AnalyzeAssetMetadata.AnalysisStatus").msgclass - AnalyzeAssetMetadata::AnalysisStatus::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.AnalyzeAssetMetadata.AnalysisStatus.State").enummodule - AnalyzeAssetResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.AnalyzeAssetResponse").msgclass - IndexingStatus = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.IndexingStatus").msgclass - IndexingStatus::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.IndexingStatus.State").enummodule - IndexAssetRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.IndexAssetRequest").msgclass - IndexAssetMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.IndexAssetMetadata").msgclass - IndexAssetResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.IndexAssetResponse").msgclass - RemoveIndexAssetRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.RemoveIndexAssetRequest").msgclass - RemoveIndexAssetMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.RemoveIndexAssetMetadata").msgclass - RemoveIndexAssetResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.RemoveIndexAssetResponse").msgclass - IndexedAsset = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.IndexedAsset").msgclass - ViewIndexedAssetsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.ViewIndexedAssetsRequest").msgclass - ViewIndexedAssetsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.ViewIndexedAssetsResponse").msgclass - CreateCorpusRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.CreateCorpusRequest").msgclass - CreateCorpusMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.CreateCorpusMetadata").msgclass - SearchCapability = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.SearchCapability").msgclass - SearchCapability::Type = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.SearchCapability.Type").enummodule - SearchCapabilitySetting = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.SearchCapabilitySetting").msgclass - CreateCollectionMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.CreateCollectionMetadata").msgclass - CreateCollectionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.CreateCollectionRequest").msgclass - DeleteCollectionMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.DeleteCollectionMetadata").msgclass - DeleteCollectionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.DeleteCollectionRequest").msgclass - GetCollectionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.GetCollectionRequest").msgclass - UpdateCollectionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.UpdateCollectionRequest").msgclass - ListCollectionsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.ListCollectionsRequest").msgclass - ListCollectionsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.ListCollectionsResponse").msgclass - AddCollectionItemRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.AddCollectionItemRequest").msgclass - AddCollectionItemResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.AddCollectionItemResponse").msgclass - RemoveCollectionItemRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.RemoveCollectionItemRequest").msgclass - RemoveCollectionItemResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.RemoveCollectionItemResponse").msgclass - ViewCollectionItemsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.ViewCollectionItemsRequest").msgclass - ViewCollectionItemsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.ViewCollectionItemsResponse").msgclass - Collection = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.Collection").msgclass - CollectionItem = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.CollectionItem").msgclass - CollectionItem::Type = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.CollectionItem.Type").enummodule - CreateIndexRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.CreateIndexRequest").msgclass - CreateIndexMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.CreateIndexMetadata").msgclass - UpdateIndexRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.UpdateIndexRequest").msgclass - UpdateIndexMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.UpdateIndexMetadata").msgclass - GetIndexRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.GetIndexRequest").msgclass - ListIndexesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.ListIndexesRequest").msgclass - ListIndexesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.ListIndexesResponse").msgclass - DeleteIndexRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.DeleteIndexRequest").msgclass - DeleteIndexMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.DeleteIndexMetadata").msgclass - Index = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.Index").msgclass - Index::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.Index.State").enummodule - DeployedIndexReference = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.DeployedIndexReference").msgclass - Corpus = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.Corpus").msgclass - Corpus::Type = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.Corpus.Type").enummodule - GetCorpusRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.GetCorpusRequest").msgclass - UpdateCorpusRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.UpdateCorpusRequest").msgclass - ListCorporaRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.ListCorporaRequest").msgclass - ListCorporaResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.ListCorporaResponse").msgclass - DeleteCorpusRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.DeleteCorpusRequest").msgclass - AnalyzeCorpusRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.AnalyzeCorpusRequest").msgclass - AnalyzeCorpusMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.AnalyzeCorpusMetadata").msgclass - AnalyzeCorpusResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.AnalyzeCorpusResponse").msgclass - CreateDataSchemaRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.CreateDataSchemaRequest").msgclass - DataSchema = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.DataSchema").msgclass - DataSchemaDetails = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.DataSchemaDetails").msgclass - DataSchemaDetails::ProtoAnyConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.DataSchemaDetails.ProtoAnyConfig").msgclass - DataSchemaDetails::ListConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.DataSchemaDetails.ListConfig").msgclass - DataSchemaDetails::CustomizedStructConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.DataSchemaDetails.CustomizedStructConfig").msgclass - DataSchemaDetails::SearchStrategy = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.DataSchemaDetails.SearchStrategy").msgclass - DataSchemaDetails::SearchStrategy::ConfidenceScoreIndexConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.DataSchemaDetails.SearchStrategy.ConfidenceScoreIndexConfig").msgclass - DataSchemaDetails::SearchStrategy::SearchStrategyType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.DataSchemaDetails.SearchStrategy.SearchStrategyType").enummodule - DataSchemaDetails::DataType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.DataSchemaDetails.DataType").enummodule - DataSchemaDetails::Granularity = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.DataSchemaDetails.Granularity").enummodule - UpdateDataSchemaRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.UpdateDataSchemaRequest").msgclass - GetDataSchemaRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.GetDataSchemaRequest").msgclass - DeleteDataSchemaRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.DeleteDataSchemaRequest").msgclass - ListDataSchemasRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.ListDataSchemasRequest").msgclass - ListDataSchemasResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.ListDataSchemasResponse").msgclass - CreateAnnotationRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.CreateAnnotationRequest").msgclass - Annotation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.Annotation").msgclass - UserSpecifiedAnnotation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.UserSpecifiedAnnotation").msgclass - GeoCoordinate = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.GeoCoordinate").msgclass - AnnotationValue = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.AnnotationValue").msgclass - AnnotationList = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.AnnotationList").msgclass - AnnotationCustomizedStruct = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.AnnotationCustomizedStruct").msgclass - ListAnnotationsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.ListAnnotationsRequest").msgclass - ListAnnotationsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.ListAnnotationsResponse").msgclass - GetAnnotationRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.GetAnnotationRequest").msgclass - UpdateAnnotationRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.UpdateAnnotationRequest").msgclass - DeleteAnnotationRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.DeleteAnnotationRequest").msgclass - ImportAssetsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.ImportAssetsRequest").msgclass - ImportAssetsMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.ImportAssetsMetadata").msgclass - BatchOperationStatus = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.BatchOperationStatus").msgclass - ImportAssetsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.ImportAssetsResponse").msgclass - CreateSearchConfigRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.CreateSearchConfigRequest").msgclass - UpdateSearchConfigRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.UpdateSearchConfigRequest").msgclass - GetSearchConfigRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.GetSearchConfigRequest").msgclass - DeleteSearchConfigRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.DeleteSearchConfigRequest").msgclass - ListSearchConfigsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.ListSearchConfigsRequest").msgclass - ListSearchConfigsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.ListSearchConfigsResponse").msgclass - SearchConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.SearchConfig").msgclass - IndexEndpoint = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.IndexEndpoint").msgclass - IndexEndpoint::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.IndexEndpoint.State").enummodule - CreateIndexEndpointRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.CreateIndexEndpointRequest").msgclass - CreateIndexEndpointMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.CreateIndexEndpointMetadata").msgclass - GetIndexEndpointRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.GetIndexEndpointRequest").msgclass - ListIndexEndpointsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.ListIndexEndpointsRequest").msgclass - ListIndexEndpointsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.ListIndexEndpointsResponse").msgclass - UpdateIndexEndpointRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.UpdateIndexEndpointRequest").msgclass - UpdateIndexEndpointMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.UpdateIndexEndpointMetadata").msgclass - DeleteIndexEndpointRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.DeleteIndexEndpointRequest").msgclass - DeleteIndexEndpointMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.DeleteIndexEndpointMetadata").msgclass - DeployIndexRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.DeployIndexRequest").msgclass - DeployIndexResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.DeployIndexResponse").msgclass - DeployIndexMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.DeployIndexMetadata").msgclass - UndeployIndexMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.UndeployIndexMetadata").msgclass - UndeployIndexRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.UndeployIndexRequest").msgclass - UndeployIndexResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.UndeployIndexResponse").msgclass - DeployedIndex = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.DeployedIndex").msgclass - FacetProperty = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.FacetProperty").msgclass - FacetProperty::FixedRangeBucketSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.FacetProperty.FixedRangeBucketSpec").msgclass - FacetProperty::CustomRangeBucketSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.FacetProperty.CustomRangeBucketSpec").msgclass - FacetProperty::DateTimeBucketSpec = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.FacetProperty.DateTimeBucketSpec").msgclass - FacetProperty::DateTimeBucketSpec::Granularity = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.FacetProperty.DateTimeBucketSpec.Granularity").enummodule - SearchHypernym = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.SearchHypernym").msgclass - CreateSearchHypernymRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.CreateSearchHypernymRequest").msgclass - UpdateSearchHypernymRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.UpdateSearchHypernymRequest").msgclass - GetSearchHypernymRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.GetSearchHypernymRequest").msgclass - DeleteSearchHypernymRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.DeleteSearchHypernymRequest").msgclass - ListSearchHypernymsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.ListSearchHypernymsRequest").msgclass - ListSearchHypernymsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.ListSearchHypernymsResponse").msgclass - SearchCriteriaProperty = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.SearchCriteriaProperty").msgclass - FacetValue = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.FacetValue").msgclass - FacetBucket = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.FacetBucket").msgclass - FacetBucket::Range = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.FacetBucket.Range").msgclass - FacetGroup = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.FacetGroup").msgclass - IngestAssetRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.IngestAssetRequest").msgclass - IngestAssetRequest::Config = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.IngestAssetRequest.Config").msgclass - IngestAssetRequest::Config::VideoType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.IngestAssetRequest.Config.VideoType").msgclass - IngestAssetRequest::Config::VideoType::ContainerFormat = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.IngestAssetRequest.Config.VideoType.ContainerFormat").enummodule - IngestAssetRequest::TimeIndexedData = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.IngestAssetRequest.TimeIndexedData").msgclass - IngestAssetResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.IngestAssetResponse").msgclass - ClipAssetRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.ClipAssetRequest").msgclass - ClipAssetResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.ClipAssetResponse").msgclass - ClipAssetResponse::TimeIndexedUri = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.ClipAssetResponse.TimeIndexedUri").msgclass - GenerateHlsUriRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.GenerateHlsUriRequest").msgclass - GenerateHlsUriResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.GenerateHlsUriResponse").msgclass - SearchAssetsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.SearchAssetsRequest").msgclass - SearchIndexEndpointRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.SearchIndexEndpointRequest").msgclass - ImageQuery = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.ImageQuery").msgclass - SchemaKeySortingStrategy = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.SchemaKeySortingStrategy").msgclass - SchemaKeySortingStrategy::Option = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.SchemaKeySortingStrategy.Option").msgclass - SchemaKeySortingStrategy::Option::AggregateMethod = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.SchemaKeySortingStrategy.Option.AggregateMethod").enummodule - DeleteAssetMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.DeleteAssetMetadata").msgclass - AnnotationMatchingResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.AnnotationMatchingResult").msgclass - SearchResultItem = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.SearchResultItem").msgclass - SearchAssetsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.SearchAssetsResponse").msgclass - SearchIndexEndpointResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.SearchIndexEndpointResponse").msgclass - IntRange = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.IntRange").msgclass - FloatRange = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.FloatRange").msgclass - StringArray = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.StringArray").msgclass - IntRangeArray = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.IntRangeArray").msgclass - FloatRangeArray = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.FloatRangeArray").msgclass - DateTimeRange = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.DateTimeRange").msgclass - DateTimeRangeArray = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.DateTimeRangeArray").msgclass - CircleArea = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.CircleArea").msgclass - GeoLocationArray = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.GeoLocationArray").msgclass - BoolValue = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.BoolValue").msgclass - Criteria = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.Criteria").msgclass - Partition = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.Partition").msgclass - Partition::TemporalPartition = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.Partition.TemporalPartition").msgclass - Partition::SpatialPartition = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.Partition.SpatialPartition").msgclass - Partition::RelativeTemporalPartition = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.Partition.RelativeTemporalPartition").msgclass - FacetBucketType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.visionai.v1.FacetBucketType").enummodule - end - end - end -end diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/visionai/v1/warehouse_services_pb.rb b/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/visionai/v1/warehouse_services_pb.rb deleted file mode 100644 index 12d4e35d643a..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/lib/google/cloud/visionai/v1/warehouse_services_pb.rb +++ /dev/null @@ -1,228 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# Source: google/cloud/visionai/v1/warehouse.proto for package 'Google.Cloud.VisionAI.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/visionai/v1/warehouse_pb' - -module Google - module Cloud - module VisionAI - module V1 - module Warehouse - # Service that manages media content + metadata for streaming. - class Service - - include ::GRPC::GenericService - - self.marshal_class_method = :encode - self.unmarshal_class_method = :decode - self.service_name = 'google.cloud.visionai.v1.Warehouse' - - # Creates an asset inside corpus. - rpc :CreateAsset, ::Google::Cloud::VisionAI::V1::CreateAssetRequest, ::Google::Cloud::VisionAI::V1::Asset - # Updates an asset inside corpus. - rpc :UpdateAsset, ::Google::Cloud::VisionAI::V1::UpdateAssetRequest, ::Google::Cloud::VisionAI::V1::Asset - # Reads an asset inside corpus. - rpc :GetAsset, ::Google::Cloud::VisionAI::V1::GetAssetRequest, ::Google::Cloud::VisionAI::V1::Asset - # Lists an list of assets inside corpus. - rpc :ListAssets, ::Google::Cloud::VisionAI::V1::ListAssetsRequest, ::Google::Cloud::VisionAI::V1::ListAssetsResponse - # Deletes asset inside corpus. - rpc :DeleteAsset, ::Google::Cloud::VisionAI::V1::DeleteAssetRequest, ::Google::Longrunning::Operation - # Upload asset by specifing the asset Cloud Storage uri. - # For video warehouse, it requires users who call this API have read access - # to the cloud storage file. Once it is uploaded, it can be retrieved by - # GenerateRetrievalUrl API which by default, only can retrieve cloud storage - # files from the same project of the warehouse. To allow retrieval cloud - # storage files that are in a separate project, it requires to find the - # vision ai service account (Go to IAM, check checkbox to show "Include - # Google-provided role grants", search for "Cloud Vision AI Service Agent") - # and grant the read access of the cloud storage files to that service - # account. - rpc :UploadAsset, ::Google::Cloud::VisionAI::V1::UploadAssetRequest, ::Google::Longrunning::Operation - # Generates a signed url for downloading the asset. - # For video warehouse, please see comment of UploadAsset about how to allow - # retrieval of cloud storage files in a different project. - rpc :GenerateRetrievalUrl, ::Google::Cloud::VisionAI::V1::GenerateRetrievalUrlRequest, ::Google::Cloud::VisionAI::V1::GenerateRetrievalUrlResponse - # Analyze asset to power search capability. - rpc :AnalyzeAsset, ::Google::Cloud::VisionAI::V1::AnalyzeAssetRequest, ::Google::Longrunning::Operation - # Index one asset for search. - # Supported corpus type: Corpus.Type.VIDEO_ON_DEMAND - rpc :IndexAsset, ::Google::Cloud::VisionAI::V1::IndexAssetRequest, ::Google::Longrunning::Operation - # Remove one asset's index data for search. - # Supported corpus type: Corpus.Type.VIDEO_ON_DEMAND - rpc :RemoveIndexAsset, ::Google::Cloud::VisionAI::V1::RemoveIndexAssetRequest, ::Google::Longrunning::Operation - # Lists assets inside an index. - rpc :ViewIndexedAssets, ::Google::Cloud::VisionAI::V1::ViewIndexedAssetsRequest, ::Google::Cloud::VisionAI::V1::ViewIndexedAssetsResponse - # Creates an Index under the corpus. - rpc :CreateIndex, ::Google::Cloud::VisionAI::V1::CreateIndexRequest, ::Google::Longrunning::Operation - # Updates an Index under the corpus. - # Users can perform a metadata-only update or trigger a full index rebuild - # with different update_mask values. - rpc :UpdateIndex, ::Google::Cloud::VisionAI::V1::UpdateIndexRequest, ::Google::Longrunning::Operation - # Gets the details of a single Index under a Corpus. - rpc :GetIndex, ::Google::Cloud::VisionAI::V1::GetIndexRequest, ::Google::Cloud::VisionAI::V1::Index - # List all Indexes in a given Corpus. - rpc :ListIndexes, ::Google::Cloud::VisionAI::V1::ListIndexesRequest, ::Google::Cloud::VisionAI::V1::ListIndexesResponse - # Delete a single Index. In order to delete an index, the caller must - # make sure that it is not deployed to any index endpoint. - rpc :DeleteIndex, ::Google::Cloud::VisionAI::V1::DeleteIndexRequest, ::Google::Longrunning::Operation - # Creates a corpus inside a project. - rpc :CreateCorpus, ::Google::Cloud::VisionAI::V1::CreateCorpusRequest, ::Google::Longrunning::Operation - # Gets corpus details inside a project. - rpc :GetCorpus, ::Google::Cloud::VisionAI::V1::GetCorpusRequest, ::Google::Cloud::VisionAI::V1::Corpus - # Updates a corpus in a project. - rpc :UpdateCorpus, ::Google::Cloud::VisionAI::V1::UpdateCorpusRequest, ::Google::Cloud::VisionAI::V1::Corpus - # Lists all corpora in a project. - rpc :ListCorpora, ::Google::Cloud::VisionAI::V1::ListCorporaRequest, ::Google::Cloud::VisionAI::V1::ListCorporaResponse - # Deletes a corpus only if its empty. - # Returns empty response. - rpc :DeleteCorpus, ::Google::Cloud::VisionAI::V1::DeleteCorpusRequest, ::Google::Protobuf::Empty - # Analyzes a corpus. - rpc :AnalyzeCorpus, ::Google::Cloud::VisionAI::V1::AnalyzeCorpusRequest, ::Google::Longrunning::Operation - # Creates data schema inside corpus. - rpc :CreateDataSchema, ::Google::Cloud::VisionAI::V1::CreateDataSchemaRequest, ::Google::Cloud::VisionAI::V1::DataSchema - # Updates data schema inside corpus. - rpc :UpdateDataSchema, ::Google::Cloud::VisionAI::V1::UpdateDataSchemaRequest, ::Google::Cloud::VisionAI::V1::DataSchema - # Gets data schema inside corpus. - rpc :GetDataSchema, ::Google::Cloud::VisionAI::V1::GetDataSchemaRequest, ::Google::Cloud::VisionAI::V1::DataSchema - # Deletes data schema inside corpus. - rpc :DeleteDataSchema, ::Google::Cloud::VisionAI::V1::DeleteDataSchemaRequest, ::Google::Protobuf::Empty - # Lists a list of data schemas inside corpus. - rpc :ListDataSchemas, ::Google::Cloud::VisionAI::V1::ListDataSchemasRequest, ::Google::Cloud::VisionAI::V1::ListDataSchemasResponse - # Creates annotation inside asset. - rpc :CreateAnnotation, ::Google::Cloud::VisionAI::V1::CreateAnnotationRequest, ::Google::Cloud::VisionAI::V1::Annotation - # Reads annotation inside asset. - rpc :GetAnnotation, ::Google::Cloud::VisionAI::V1::GetAnnotationRequest, ::Google::Cloud::VisionAI::V1::Annotation - # Lists a list of annotations inside asset. - rpc :ListAnnotations, ::Google::Cloud::VisionAI::V1::ListAnnotationsRequest, ::Google::Cloud::VisionAI::V1::ListAnnotationsResponse - # Updates annotation inside asset. - rpc :UpdateAnnotation, ::Google::Cloud::VisionAI::V1::UpdateAnnotationRequest, ::Google::Cloud::VisionAI::V1::Annotation - # Deletes annotation inside asset. - rpc :DeleteAnnotation, ::Google::Cloud::VisionAI::V1::DeleteAnnotationRequest, ::Google::Protobuf::Empty - # Ingests data for the asset. It is not allowed to ingest a data chunk which - # is already expired according to TTL. - # This method is only available via the gRPC API (not HTTP since - # bi-directional streaming is not supported via HTTP). - rpc :IngestAsset, stream(::Google::Cloud::VisionAI::V1::IngestAssetRequest), stream(::Google::Cloud::VisionAI::V1::IngestAssetResponse) - # Supported by STREAM_VIDEO corpus type. - # Generates clips for downloading. The api takes in a time range, and - # generates a clip of the first content available after start_time and - # before end_time, which may overflow beyond these bounds. - # Returned clips are truncated if the total size of the clips are larger - # than 100MB. - rpc :ClipAsset, ::Google::Cloud::VisionAI::V1::ClipAssetRequest, ::Google::Cloud::VisionAI::V1::ClipAssetResponse - # Generates a uri for an HLS manifest. The api takes in a collection of time - # ranges, and generates a URI for an HLS manifest that covers all the - # requested time ranges. - rpc :GenerateHlsUri, ::Google::Cloud::VisionAI::V1::GenerateHlsUriRequest, ::Google::Cloud::VisionAI::V1::GenerateHlsUriResponse - # Imports assets (images plus annotations) from a meta file on cloud storage. - # Each row in the meta file is corresponding to an image (specified by a - # cloud storage uri) and its annotations. - rpc :ImportAssets, ::Google::Cloud::VisionAI::V1::ImportAssetsRequest, ::Google::Longrunning::Operation - # Creates a search configuration inside a corpus. - # - # Please follow the rules below to create a valid CreateSearchConfigRequest. - # --- General Rules --- - # 1. Request.search_config_id must not be associated with an existing - # SearchConfig. - # 2. Request must contain at least one non-empty search_criteria_property or - # facet_property. - # 3. mapped_fields must not be empty, and must map to existing UGA keys. - # 4. All mapped_fields must be of the same type. - # 5. All mapped_fields must share the same granularity. - # 6. All mapped_fields must share the same semantic SearchConfig match - # options. - # For property-specific rules, please reference the comments for - # FacetProperty and SearchCriteriaProperty. - rpc :CreateSearchConfig, ::Google::Cloud::VisionAI::V1::CreateSearchConfigRequest, ::Google::Cloud::VisionAI::V1::SearchConfig - # Updates a search configuration inside a corpus. - # - # Please follow the rules below to create a valid UpdateSearchConfigRequest. - # --- General Rules --- - # 1. Request.search_configuration.name must already exist. - # 2. Request must contain at least one non-empty search_criteria_property or - # facet_property. - # 3. mapped_fields must not be empty, and must map to existing UGA keys. - # 4. All mapped_fields must be of the same type. - # 5. All mapped_fields must share the same granularity. - # 6. All mapped_fields must share the same semantic SearchConfig match - # options. - # For property-specific rules, please reference the comments for - # FacetProperty and SearchCriteriaProperty. - rpc :UpdateSearchConfig, ::Google::Cloud::VisionAI::V1::UpdateSearchConfigRequest, ::Google::Cloud::VisionAI::V1::SearchConfig - # Gets a search configuration inside a corpus. - rpc :GetSearchConfig, ::Google::Cloud::VisionAI::V1::GetSearchConfigRequest, ::Google::Cloud::VisionAI::V1::SearchConfig - # Deletes a search configuration inside a corpus. - # - # For a DeleteSearchConfigRequest to be valid, - # Request.search_configuration.name must already exist. - rpc :DeleteSearchConfig, ::Google::Cloud::VisionAI::V1::DeleteSearchConfigRequest, ::Google::Protobuf::Empty - # Lists all search configurations inside a corpus. - rpc :ListSearchConfigs, ::Google::Cloud::VisionAI::V1::ListSearchConfigsRequest, ::Google::Cloud::VisionAI::V1::ListSearchConfigsResponse - # Creates a SearchHypernym inside a corpus. - rpc :CreateSearchHypernym, ::Google::Cloud::VisionAI::V1::CreateSearchHypernymRequest, ::Google::Cloud::VisionAI::V1::SearchHypernym - # Updates a SearchHypernym inside a corpus. - rpc :UpdateSearchHypernym, ::Google::Cloud::VisionAI::V1::UpdateSearchHypernymRequest, ::Google::Cloud::VisionAI::V1::SearchHypernym - # Gets a SearchHypernym inside a corpus. - rpc :GetSearchHypernym, ::Google::Cloud::VisionAI::V1::GetSearchHypernymRequest, ::Google::Cloud::VisionAI::V1::SearchHypernym - # Deletes a SearchHypernym inside a corpus. - rpc :DeleteSearchHypernym, ::Google::Cloud::VisionAI::V1::DeleteSearchHypernymRequest, ::Google::Protobuf::Empty - # Lists SearchHypernyms inside a corpus. - rpc :ListSearchHypernyms, ::Google::Cloud::VisionAI::V1::ListSearchHypernymsRequest, ::Google::Cloud::VisionAI::V1::ListSearchHypernymsResponse - # Search media asset. - rpc :SearchAssets, ::Google::Cloud::VisionAI::V1::SearchAssetsRequest, ::Google::Cloud::VisionAI::V1::SearchAssetsResponse - # Search a deployed index endpoint (IMAGE corpus type only). - rpc :SearchIndexEndpoint, ::Google::Cloud::VisionAI::V1::SearchIndexEndpointRequest, ::Google::Cloud::VisionAI::V1::SearchIndexEndpointResponse - # Creates an IndexEndpoint. - rpc :CreateIndexEndpoint, ::Google::Cloud::VisionAI::V1::CreateIndexEndpointRequest, ::Google::Longrunning::Operation - # Gets an IndexEndpoint. - rpc :GetIndexEndpoint, ::Google::Cloud::VisionAI::V1::GetIndexEndpointRequest, ::Google::Cloud::VisionAI::V1::IndexEndpoint - # Lists all IndexEndpoints in a project. - rpc :ListIndexEndpoints, ::Google::Cloud::VisionAI::V1::ListIndexEndpointsRequest, ::Google::Cloud::VisionAI::V1::ListIndexEndpointsResponse - # Updates an IndexEndpoint. - rpc :UpdateIndexEndpoint, ::Google::Cloud::VisionAI::V1::UpdateIndexEndpointRequest, ::Google::Longrunning::Operation - # Deletes an IndexEndpoint. - rpc :DeleteIndexEndpoint, ::Google::Cloud::VisionAI::V1::DeleteIndexEndpointRequest, ::Google::Longrunning::Operation - # Deploys an Index to IndexEndpoint. - rpc :DeployIndex, ::Google::Cloud::VisionAI::V1::DeployIndexRequest, ::Google::Longrunning::Operation - # Undeploys an Index from IndexEndpoint. - rpc :UndeployIndex, ::Google::Cloud::VisionAI::V1::UndeployIndexRequest, ::Google::Longrunning::Operation - # Creates a collection. - rpc :CreateCollection, ::Google::Cloud::VisionAI::V1::CreateCollectionRequest, ::Google::Longrunning::Operation - # Deletes a collection. - rpc :DeleteCollection, ::Google::Cloud::VisionAI::V1::DeleteCollectionRequest, ::Google::Longrunning::Operation - # Gets a collection. - rpc :GetCollection, ::Google::Cloud::VisionAI::V1::GetCollectionRequest, ::Google::Cloud::VisionAI::V1::Collection - # Updates a collection. - rpc :UpdateCollection, ::Google::Cloud::VisionAI::V1::UpdateCollectionRequest, ::Google::Cloud::VisionAI::V1::Collection - # Lists collections inside a corpus. - rpc :ListCollections, ::Google::Cloud::VisionAI::V1::ListCollectionsRequest, ::Google::Cloud::VisionAI::V1::ListCollectionsResponse - # Adds an item into a Collection. - rpc :AddCollectionItem, ::Google::Cloud::VisionAI::V1::AddCollectionItemRequest, ::Google::Cloud::VisionAI::V1::AddCollectionItemResponse - # Removes an item from a collection. - rpc :RemoveCollectionItem, ::Google::Cloud::VisionAI::V1::RemoveCollectionItemRequest, ::Google::Cloud::VisionAI::V1::RemoveCollectionItemResponse - # View items inside a collection. - rpc :ViewCollectionItems, ::Google::Cloud::VisionAI::V1::ViewCollectionItemsRequest, ::Google::Cloud::VisionAI::V1::ViewCollectionItemsResponse - end - - Stub = Service.rpc_stub_class - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/proto_docs/README.md b/owl-bot-staging/google-cloud-vision_ai-v1/proto_docs/README.md deleted file mode 100644 index 380395ca6cf1..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/proto_docs/README.md +++ /dev/null @@ -1,4 +0,0 @@ -# Vision AI 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-vision_ai-v1/proto_docs/google/api/client.rb b/owl-bot-staging/google-cloud-vision_ai-v1/proto_docs/google/api/client.rb deleted file mode 100644 index 3ab0b096d445..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/proto_docs/google/api/client.rb +++ /dev/null @@ -1,593 +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. - # - # Note: This field should not be used in most cases. - 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: - # library_settings: - # 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. - # @!attribute [rw] library_package - # @return [::String] - # The package name to use in Php. Clobbers the php_namespace option - # set in the protobuf. This should be used **only** by APIs - # who have already set the language_settings.php.package_name" field - # in gapic.yaml. API teams should use the protobuf php_namespace option - # where possible. - # - # Example of a YAML configuration:: - # - # publishing: - # library_settings: - # php_settings: - # library_package: Google\Cloud\PubSub\V1 - 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. - # - # Example: - # - # 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 - # @!attribute [rw] batching - # @return [::Google::Api::BatchingConfigProto] - # Batching configuration for an API method in client libraries. - # - # Example of a YAML configuration: - # - # publishing: - # method_settings: - # - selector: google.example.v1.ExampleService.BatchCreateExample - # batching: - # element_count_threshold: 1000 - # request_byte_threshold: 100000000 - # delay_threshold_millis: 10 - 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. - # - # Note: This feature should not be used in most cases. - # @!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 - - # `BatchingConfigProto` defines the batching configuration for an API method. - # @!attribute [rw] thresholds - # @return [::Google::Api::BatchingSettingsProto] - # The thresholds which trigger a batched request to be sent. - # @!attribute [rw] batch_descriptor - # @return [::Google::Api::BatchingDescriptorProto] - # The request and response fields used in batching. - class BatchingConfigProto - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # `BatchingSettingsProto` specifies a set of batching thresholds, each of - # which acts as a trigger to send a batch of messages as a request. At least - # one threshold must be positive nonzero. - # @!attribute [rw] element_count_threshold - # @return [::Integer] - # The number of elements of a field collected into a batch which, if - # exceeded, causes the batch to be sent. - # @!attribute [rw] request_byte_threshold - # @return [::Integer] - # The aggregated size of the batched field which, if exceeded, causes the - # batch to be sent. This size is computed by aggregating the sizes of the - # request field to be batched, not of the entire request message. - # @!attribute [rw] delay_threshold - # @return [::Google::Protobuf::Duration] - # The duration after which a batch should be sent, starting from the addition - # of the first message to that batch. - # @!attribute [rw] element_count_limit - # @return [::Integer] - # The maximum number of elements collected in a batch that could be accepted - # by server. - # @!attribute [rw] request_byte_limit - # @return [::Integer] - # The maximum size of the request that could be accepted by server. - # @!attribute [rw] flow_control_element_limit - # @return [::Integer] - # The maximum number of elements allowed by flow control. - # @!attribute [rw] flow_control_byte_limit - # @return [::Integer] - # The maximum size of data allowed by flow control. - # @!attribute [rw] flow_control_limit_exceeded_behavior - # @return [::Google::Api::FlowControlLimitExceededBehaviorProto] - # The behavior to take when the flow control limit is exceeded. - class BatchingSettingsProto - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # `BatchingDescriptorProto` specifies the fields of the request message to be - # used for batching, and, optionally, the fields of the response message to be - # used for demultiplexing. - # @!attribute [rw] batched_field - # @return [::String] - # The repeated field in the request message to be aggregated by batching. - # @!attribute [rw] discriminator_fields - # @return [::Array<::String>] - # A list of the fields in the request message. Two requests will be batched - # together only if the values of every field specified in - # `request_discriminator_fields` is equal between the two requests. - # @!attribute [rw] subresponse_field - # @return [::String] - # Optional. When present, indicates the field in the response message to be - # used to demultiplex the response into multiple response messages, in - # correspondence with the multiple request messages originally batched - # together. - class BatchingDescriptorProto - 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 - - # The behavior to take when the flow control limit is exceeded. - module FlowControlLimitExceededBehaviorProto - # Default behavior, system-defined. - UNSET_BEHAVIOR = 0 - - # Stop operation, raise error. - THROW_EXCEPTION = 1 - - # Pause operation until limit clears. - BLOCK = 2 - - # Continue operation, disregard limit. - IGNORE = 3 - end - end -end diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/proto_docs/google/api/field_behavior.rb b/owl-bot-staging/google-cloud-vision_ai-v1/proto_docs/google/api/field_behavior.rb deleted file mode 100644 index 582be187d115..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-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-vision_ai-v1/proto_docs/google/api/launch_stage.rb b/owl-bot-staging/google-cloud-vision_ai-v1/proto_docs/google/api/launch_stage.rb deleted file mode 100644 index 9392a413fb1b..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-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-vision_ai-v1/proto_docs/google/api/resource.rb b/owl-bot-staging/google-cloud-vision_ai-v1/proto_docs/google/api/resource.rb deleted file mode 100644 index 25dec4847ac1..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-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-vision_ai-v1/proto_docs/google/cloud/visionai/v1/annotations.rb b/owl-bot-staging/google-cloud-vision_ai-v1/proto_docs/google/cloud/visionai/v1/annotations.rb deleted file mode 100644 index d6d8d90f615b..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/proto_docs/google/cloud/visionai/v1/annotations.rb +++ /dev/null @@ -1,791 +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 VisionAI - module V1 - # Output format for Personal Protective Equipment Detection Operator. - # @!attribute [rw] current_time - # @return [::Google::Protobuf::Timestamp] - # Current timestamp. - # @!attribute [rw] detected_persons - # @return [::Array<::Google::Cloud::VisionAI::V1::PersonalProtectiveEquipmentDetectionOutput::DetectedPerson>] - # A list of DetectedPersons. - class PersonalProtectiveEquipmentDetectionOutput - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The entity info for annotations from person detection prediction result. - # @!attribute [rw] person_entity_id - # @return [::Integer] - # Entity id. - class PersonEntity - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The entity info for annotations from PPE detection prediction result. - # @!attribute [rw] ppe_label_id - # @return [::Integer] - # Label id. - # @!attribute [rw] ppe_label_string - # @return [::String] - # Human readable string of the label (Examples: helmet, glove, mask). - # @!attribute [rw] ppe_supercategory_label_string - # @return [::String] - # Human readable string of the super category label (Examples: head_cover, - # hands_cover, face_cover). - # @!attribute [rw] ppe_entity_id - # @return [::Integer] - # Entity id. - class PPEEntity - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Bounding Box in the normalized coordinates. - # @!attribute [rw] xmin - # @return [::Float] - # Min in x coordinate. - # @!attribute [rw] ymin - # @return [::Float] - # Min in y coordinate. - # @!attribute [rw] width - # @return [::Float] - # Width of the bounding box. - # @!attribute [rw] height - # @return [::Float] - # Height of the bounding box. - class NormalizedBoundingBox - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # PersonIdentified box contains the location and the entity info of the - # person. - # @!attribute [rw] box_id - # @return [::Integer] - # An unique id for this box. - # @!attribute [rw] normalized_bounding_box - # @return [::Google::Cloud::VisionAI::V1::PersonalProtectiveEquipmentDetectionOutput::NormalizedBoundingBox] - # Bounding Box in the normalized coordinates. - # @!attribute [rw] confidence_score - # @return [::Float] - # Confidence score associated with this box. - # @!attribute [rw] person_entity - # @return [::Google::Cloud::VisionAI::V1::PersonalProtectiveEquipmentDetectionOutput::PersonEntity] - # Person entity info. - class PersonIdentifiedBox - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # PPEIdentified box contains the location and the entity info of the PPE. - # @!attribute [rw] box_id - # @return [::Integer] - # An unique id for this box. - # @!attribute [rw] normalized_bounding_box - # @return [::Google::Cloud::VisionAI::V1::PersonalProtectiveEquipmentDetectionOutput::NormalizedBoundingBox] - # Bounding Box in the normalized coordinates. - # @!attribute [rw] confidence_score - # @return [::Float] - # Confidence score associated with this box. - # @!attribute [rw] ppe_entity - # @return [::Google::Cloud::VisionAI::V1::PersonalProtectiveEquipmentDetectionOutput::PPEEntity] - # PPE entity info. - class PPEIdentifiedBox - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Detected Person contains the detected person and their associated - # ppes and their protecting information. - # @!attribute [rw] person_id - # @return [::Integer] - # The id of detected person. - # @!attribute [rw] detected_person_identified_box - # @return [::Google::Cloud::VisionAI::V1::PersonalProtectiveEquipmentDetectionOutput::PersonIdentifiedBox] - # The info of detected person identified box. - # @!attribute [rw] detected_ppe_identified_boxes - # @return [::Array<::Google::Cloud::VisionAI::V1::PersonalProtectiveEquipmentDetectionOutput::PPEIdentifiedBox>] - # The info of detected person associated ppe identified boxes. - # @!attribute [rw] face_coverage_score - # @return [::Float] - # Coverage score for each body part. - # Coverage score for face. - # @!attribute [rw] eyes_coverage_score - # @return [::Float] - # Coverage score for eyes. - # @!attribute [rw] head_coverage_score - # @return [::Float] - # Coverage score for head. - # @!attribute [rw] hands_coverage_score - # @return [::Float] - # Coverage score for hands. - # @!attribute [rw] body_coverage_score - # @return [::Float] - # Coverage score for body. - # @!attribute [rw] feet_coverage_score - # @return [::Float] - # Coverage score for feet. - class DetectedPerson - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Prediction output format for Generic Object Detection. - # @!attribute [rw] current_time - # @return [::Google::Protobuf::Timestamp] - # Current timestamp. - # @!attribute [rw] identified_boxes - # @return [::Array<::Google::Cloud::VisionAI::V1::ObjectDetectionPredictionResult::IdentifiedBox>] - # A list of identified boxes. - class ObjectDetectionPredictionResult - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The entity info for annotations from object detection prediction result. - # @!attribute [rw] label_id - # @return [::Integer] - # Label id. - # @!attribute [rw] label_string - # @return [::String] - # Human readable string of the label. - class Entity - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Identified box contains location and the entity of the object. - # @!attribute [rw] box_id - # @return [::Integer] - # An unique id for this box. - # @!attribute [rw] normalized_bounding_box - # @return [::Google::Cloud::VisionAI::V1::ObjectDetectionPredictionResult::IdentifiedBox::NormalizedBoundingBox] - # Bounding Box in the normalized coordinates. - # @!attribute [rw] confidence_score - # @return [::Float] - # Confidence score associated with this box. - # @!attribute [rw] entity - # @return [::Google::Cloud::VisionAI::V1::ObjectDetectionPredictionResult::Entity] - # Entity of this box. - class IdentifiedBox - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Bounding Box in the normalized coordinates. - # @!attribute [rw] xmin - # @return [::Float] - # Min in x coordinate. - # @!attribute [rw] ymin - # @return [::Float] - # Min in y coordinate. - # @!attribute [rw] width - # @return [::Float] - # Width of the bounding box. - # @!attribute [rw] height - # @return [::Float] - # Height of the bounding box. - class NormalizedBoundingBox - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - - # Prediction output format for Image Object Detection. - # @!attribute [rw] ids - # @return [::Array<::Integer>] - # The resource IDs of the AnnotationSpecs that had been identified, ordered - # by the confidence score descendingly. It is the id segment instead of full - # resource name. - # @!attribute [rw] display_names - # @return [::Array<::String>] - # The display names of the AnnotationSpecs that had been identified, order - # matches the IDs. - # @!attribute [rw] confidences - # @return [::Array<::Float>] - # The Model's confidences in correctness of the predicted IDs, higher value - # means higher confidence. Order matches the Ids. - # @!attribute [rw] bboxes - # @return [::Array<::Google::Protobuf::ListValue>] - # Bounding boxes, i.e. the rectangles over the image, that pinpoint - # the found AnnotationSpecs. Given in order that matches the IDs. Each - # bounding box is an array of 4 numbers `xMin`, `xMax`, `yMin`, and - # `yMax`, which represent the extremal coordinates of the box. They are - # relative to the image size, and the point 0,0 is in the top left - # of the image. - class ImageObjectDetectionPredictionResult - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Prediction output format for Image and Text Classification. - # @!attribute [rw] ids - # @return [::Array<::Integer>] - # The resource IDs of the AnnotationSpecs that had been identified. - # @!attribute [rw] display_names - # @return [::Array<::String>] - # The display names of the AnnotationSpecs that had been identified, order - # matches the IDs. - # @!attribute [rw] confidences - # @return [::Array<::Float>] - # The Model's confidences in correctness of the predicted IDs, higher value - # means higher confidence. Order matches the Ids. - class ClassificationPredictionResult - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Prediction output format for Image Segmentation. - # @!attribute [rw] category_mask - # @return [::String] - # A PNG image where each pixel in the mask represents the category in which - # the pixel in the original image was predicted to belong to. The size of - # this image will be the same as the original image. The mapping between the - # AnntoationSpec and the color can be found in model's metadata. The model - # will choose the most likely category and if none of the categories reach - # the confidence threshold, the pixel will be marked as background. - # @!attribute [rw] confidence_mask - # @return [::String] - # A one channel image which is encoded as an 8bit lossless PNG. The size of - # the image will be the same as the original image. For a specific pixel, - # darker color means less confidence in correctness of the cateogry in the - # categoryMask for the corresponding pixel. Black means no confidence and - # white means complete confidence. - class ImageSegmentationPredictionResult - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Prediction output format for Video Action Recognition. - # @!attribute [rw] segment_start_time - # @return [::Google::Protobuf::Timestamp] - # The beginning, inclusive, of the video's time segment in which the - # actions have been identified. - # @!attribute [rw] segment_end_time - # @return [::Google::Protobuf::Timestamp] - # The end, inclusive, of the video's time segment in which the actions have - # been identified. Particularly, if the end is the same as the start, it - # means the identification happens on a specific video frame. - # @!attribute [rw] actions - # @return [::Array<::Google::Cloud::VisionAI::V1::VideoActionRecognitionPredictionResult::IdentifiedAction>] - # All of the actions identified in the time range. - class VideoActionRecognitionPredictionResult - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Each IdentifiedAction is one particular identification of an action - # specified with the AnnotationSpec id, display_name and the associated - # confidence score. - # @!attribute [rw] id - # @return [::String] - # The resource ID of the AnnotationSpec that had been identified. - # @!attribute [rw] display_name - # @return [::String] - # The display name of the AnnotationSpec that had been identified. - # @!attribute [rw] confidence - # @return [::Float] - # The Model's confidence in correction of this identification, higher - # value means higher confidence. - class IdentifiedAction - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Prediction output format for Video Object Tracking. - # @!attribute [rw] segment_start_time - # @return [::Google::Protobuf::Timestamp] - # The beginning, inclusive, of the video's time segment in which the - # current identifications happens. - # @!attribute [rw] segment_end_time - # @return [::Google::Protobuf::Timestamp] - # The end, inclusive, of the video's time segment in which the current - # identifications happen. Particularly, if the end is the same as the start, - # it means the identifications happen on a specific video frame. - # @!attribute [rw] objects - # @return [::Array<::Google::Cloud::VisionAI::V1::VideoObjectTrackingPredictionResult::DetectedObject>] - # All of the objects detected in the specified time range. - class VideoObjectTrackingPredictionResult - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Boundingbox for detected object. I.e. the rectangle over the video frame - # pinpointing the found AnnotationSpec. The coordinates are relative to the - # frame size, and the point 0,0 is in the top left of the frame. - # @!attribute [rw] x_min - # @return [::Float] - # The leftmost coordinate of the bounding box. - # @!attribute [rw] x_max - # @return [::Float] - # The rightmost coordinate of the bounding box. - # @!attribute [rw] y_min - # @return [::Float] - # The topmost coordinate of the bounding box. - # @!attribute [rw] y_max - # @return [::Float] - # The bottommost coordinate of the bounding box. - class BoundingBox - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Each DetectedObject is one particular identification of an object - # specified with the AnnotationSpec id and display_name, the bounding box, - # the associated confidence score and the corresponding track_id. - # @!attribute [rw] id - # @return [::String] - # The resource ID of the AnnotationSpec that had been identified. - # @!attribute [rw] display_name - # @return [::String] - # The display name of the AnnotationSpec that had been identified. - # @!attribute [rw] bounding_box - # @return [::Google::Cloud::VisionAI::V1::VideoObjectTrackingPredictionResult::BoundingBox] - # Boundingbox. - # @!attribute [rw] confidence - # @return [::Float] - # The Model's confidence in correction of this identification, higher - # value means higher confidence. - # @!attribute [rw] track_id - # @return [::Integer] - # The same object may be identified on muitiple frames which are typical - # adjacent. The set of frames where a particular object has been detected - # form a track. This track_id can be used to trace down all frames for an - # detected object. - class DetectedObject - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Prediction output format for Video Classification. - # @!attribute [rw] segment_start_time - # @return [::Google::Protobuf::Timestamp] - # The beginning, inclusive, of the video's time segment in which the - # classifications have been identified. - # @!attribute [rw] segment_end_time - # @return [::Google::Protobuf::Timestamp] - # The end, inclusive, of the video's time segment in which the - # classifications have been identified. Particularly, if the end is the same - # as the start, it means the identification happens on a specific video - # frame. - # @!attribute [rw] classifications - # @return [::Array<::Google::Cloud::VisionAI::V1::VideoClassificationPredictionResult::IdentifiedClassification>] - # All of the classifications identified in the time range. - class VideoClassificationPredictionResult - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Each IdentifiedClassification is one particular identification of an - # classification specified with the AnnotationSpec id and display_name, - # and the associated confidence score. - # @!attribute [rw] id - # @return [::String] - # The resource ID of the AnnotationSpec that had been identified. - # @!attribute [rw] display_name - # @return [::String] - # The display name of the AnnotationSpec that had been identified. - # @!attribute [rw] confidence - # @return [::Float] - # The Model's confidence in correction of this identification, higher - # value means higher confidence. - class IdentifiedClassification - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # The prediction result proto for occupancy counting. - # @!attribute [rw] current_time - # @return [::Google::Protobuf::Timestamp] - # Current timestamp. - # @!attribute [rw] identified_boxes - # @return [::Array<::Google::Cloud::VisionAI::V1::OccupancyCountingPredictionResult::IdentifiedBox>] - # A list of identified boxes. - # @!attribute [rw] stats - # @return [::Google::Cloud::VisionAI::V1::OccupancyCountingPredictionResult::Stats] - # Detection statistics. - # @!attribute [rw] track_info - # @return [::Array<::Google::Cloud::VisionAI::V1::OccupancyCountingPredictionResult::TrackInfo>] - # Track related information. All the tracks that are live at this timestamp. - # It only exists if tracking is enabled. - # @!attribute [rw] dwell_time_info - # @return [::Array<::Google::Cloud::VisionAI::V1::OccupancyCountingPredictionResult::DwellTimeInfo>] - # Dwell time related information. All the tracks that are live in a given - # zone with a start and end dwell time timestamp - # @!attribute [rw] pts - # @return [::Integer] - # The presentation timestamp of the frame. - class OccupancyCountingPredictionResult - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The entity info for annotations from occupancy counting operator. - # @!attribute [rw] label_id - # @return [::Integer] - # Label id. - # @!attribute [rw] label_string - # @return [::String] - # Human readable string of the label. - class Entity - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Identified box contains location and the entity of the object. - # @!attribute [rw] box_id - # @return [::Integer] - # An unique id for this box. - # @!attribute [rw] normalized_bounding_box - # @return [::Google::Cloud::VisionAI::V1::OccupancyCountingPredictionResult::IdentifiedBox::NormalizedBoundingBox] - # Bounding Box in the normalized coordinates. - # @!attribute [rw] score - # @return [::Float] - # Confidence score associated with this box. - # @!attribute [rw] entity - # @return [::Google::Cloud::VisionAI::V1::OccupancyCountingPredictionResult::Entity] - # Entity of this box. - # @!attribute [rw] track_id - # @return [::Integer] - # An unique id to identify a track. It should be consistent across frames. - # It only exists if tracking is enabled. - class IdentifiedBox - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Bounding Box in the normalized coordinates. - # @!attribute [rw] xmin - # @return [::Float] - # Min in x coordinate. - # @!attribute [rw] ymin - # @return [::Float] - # Min in y coordinate. - # @!attribute [rw] width - # @return [::Float] - # Width of the bounding box. - # @!attribute [rw] height - # @return [::Float] - # Height of the bounding box. - class NormalizedBoundingBox - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # The statistics info for annotations from occupancy counting operator. - # @!attribute [rw] full_frame_count - # @return [::Array<::Google::Cloud::VisionAI::V1::OccupancyCountingPredictionResult::Stats::ObjectCount>] - # Counts of the full frame. - # @!attribute [rw] crossing_line_counts - # @return [::Array<::Google::Cloud::VisionAI::V1::OccupancyCountingPredictionResult::Stats::CrossingLineCount>] - # Crossing line counts. - # @!attribute [rw] active_zone_counts - # @return [::Array<::Google::Cloud::VisionAI::V1::OccupancyCountingPredictionResult::Stats::ActiveZoneCount>] - # Active zone counts. - class Stats - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The object info and instant count for annotations from occupancy counting - # operator. - # @!attribute [rw] entity - # @return [::Google::Cloud::VisionAI::V1::OccupancyCountingPredictionResult::Entity] - # Entity of this object. - # @!attribute [rw] count - # @return [::Integer] - # Count of the object. - class ObjectCount - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The object info and accumulated count for annotations from occupancy - # counting operator. - # @!attribute [rw] start_time - # @return [::Google::Protobuf::Timestamp] - # The start time of the accumulated count. - # @!attribute [rw] object_count - # @return [::Google::Cloud::VisionAI::V1::OccupancyCountingPredictionResult::Stats::ObjectCount] - # The object count for the accumulated count. - class AccumulatedObjectCount - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Message for Crossing line count. - # @!attribute [rw] annotation - # @return [::Google::Cloud::VisionAI::V1::StreamAnnotation] - # Line annotation from the user. - # @!attribute [rw] positive_direction_counts - # @return [::Array<::Google::Cloud::VisionAI::V1::OccupancyCountingPredictionResult::Stats::ObjectCount>] - # The direction that follows the right hand rule. - # @!attribute [rw] negative_direction_counts - # @return [::Array<::Google::Cloud::VisionAI::V1::OccupancyCountingPredictionResult::Stats::ObjectCount>] - # The direction that is opposite to the right hand rule. - # @!attribute [rw] accumulated_positive_direction_counts - # @return [::Array<::Google::Cloud::VisionAI::V1::OccupancyCountingPredictionResult::Stats::AccumulatedObjectCount>] - # The accumulated positive count. - # @!attribute [rw] accumulated_negative_direction_counts - # @return [::Array<::Google::Cloud::VisionAI::V1::OccupancyCountingPredictionResult::Stats::AccumulatedObjectCount>] - # The accumulated negative count. - class CrossingLineCount - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Message for the active zone count. - # @!attribute [rw] annotation - # @return [::Google::Cloud::VisionAI::V1::StreamAnnotation] - # Active zone annotation from the user. - # @!attribute [rw] counts - # @return [::Array<::Google::Cloud::VisionAI::V1::OccupancyCountingPredictionResult::Stats::ObjectCount>] - # Counts in the zone. - class ActiveZoneCount - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # The track info for annotations from occupancy counting operator. - # @!attribute [rw] track_id - # @return [::String] - # An unique id to identify a track. It should be consistent across frames. - # @!attribute [rw] start_time - # @return [::Google::Protobuf::Timestamp] - # Start timestamp of this track. - class TrackInfo - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The dwell time info for annotations from occupancy counting operator. - # @!attribute [rw] track_id - # @return [::String] - # An unique id to identify a track. It should be consistent across frames. - # @!attribute [rw] zone_id - # @return [::String] - # The unique id for the zone in which the object is dwelling/waiting. - # @!attribute [rw] dwell_start_time - # @return [::Google::Protobuf::Timestamp] - # The beginning time when a dwelling object has been identified in a zone. - # @!attribute [rw] dwell_end_time - # @return [::Google::Protobuf::Timestamp] - # The end time when a dwelling object has exited in a zone. - class DwellTimeInfo - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # message about annotations about Vision AI stream resource. - # @!attribute [rw] active_zone - # @return [::Google::Cloud::VisionAI::V1::NormalizedPolygon] - # Annotation for type ACTIVE_ZONE - # - # Note: The following fields are mutually exclusive: `active_zone`, `crossing_line`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] crossing_line - # @return [::Google::Cloud::VisionAI::V1::NormalizedPolyline] - # Annotation for type CROSSING_LINE - # - # Note: The following fields are mutually exclusive: `crossing_line`, `active_zone`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] id - # @return [::String] - # ID of the annotation. It must be unique when used in the certain context. - # For example, all the annotations to one input streams of a Vision AI - # application. - # @!attribute [rw] display_name - # @return [::String] - # User-friendly name for the annotation. - # @!attribute [rw] source_stream - # @return [::String] - # The Vision AI stream resource name. - # @!attribute [rw] type - # @return [::Google::Cloud::VisionAI::V1::StreamAnnotationType] - # The actual type of Annotation. - class StreamAnnotation - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A wrapper of repeated StreamAnnotation. - # @!attribute [rw] stream_annotations - # @return [::Array<::Google::Cloud::VisionAI::V1::StreamAnnotation>] - # Multiple annotations. - class StreamAnnotations - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Normalized Polygon. - # @!attribute [rw] normalized_vertices - # @return [::Array<::Google::Cloud::VisionAI::V1::NormalizedVertex>] - # The bounding polygon normalized vertices. Top left corner of the image - # will be [0, 0]. - class NormalizedPolygon - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Normalized Pplyline, which represents a curve consisting of connected - # straight-line segments. - # @!attribute [rw] normalized_vertices - # @return [::Array<::Google::Cloud::VisionAI::V1::NormalizedVertex>] - # A sequence of vertices connected by straight lines. - class NormalizedPolyline - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A vertex represents a 2D point in the image. - # NOTE: the normalized vertex coordinates are relative to the original image - # and range from 0 to 1. - # @!attribute [rw] x - # @return [::Float] - # X coordinate. - # @!attribute [rw] y - # @return [::Float] - # Y coordinate. - class NormalizedVertex - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Message of essential metadata of App Platform. - # This message is usually attached to a certain processor output annotation for - # customer to identify the source of the data. - # @!attribute [rw] application - # @return [::String] - # The application resource name. - # @!attribute [rw] instance_id - # @return [::String] - # The instance resource id. Instance is the nested resource of application - # under collection 'instances'. - # @!attribute [rw] node - # @return [::String] - # The node name of the application graph. - # @!attribute [rw] processor - # @return [::String] - # The referred processor resource name of the application node. - class AppPlatformMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # For any cloud function based customer processing logic, customer's cloud - # function is expected to receive AppPlatformCloudFunctionRequest as request - # and send back AppPlatformCloudFunctionResponse as response. - # Message of request from AppPlatform to Cloud Function. - # @!attribute [rw] app_platform_metadata - # @return [::Google::Cloud::VisionAI::V1::AppPlatformMetadata] - # The metadata of the AppPlatform for customer to identify the source of the - # payload. - # @!attribute [rw] annotations - # @return [::Array<::Google::Cloud::VisionAI::V1::AppPlatformCloudFunctionRequest::StructedInputAnnotation>] - # The actual annotations to be processed by the customized Cloud Function. - class AppPlatformCloudFunctionRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # A general annotation message that uses struct format to represent different - # concrete annotation protobufs. - # @!attribute [rw] ingestion_time_micros - # @return [::Integer] - # The ingestion time of the current annotation. - # @!attribute [rw] annotation - # @return [::Google::Protobuf::Struct] - # The struct format of the actual annotation. - class StructedInputAnnotation - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Message of the response from customer's Cloud Function to AppPlatform. - # @!attribute [rw] annotations - # @return [::Array<::Google::Cloud::VisionAI::V1::AppPlatformCloudFunctionResponse::StructedOutputAnnotation>] - # The modified annotations that is returned back to AppPlatform. - # If the annotations fields are empty, then those annotations will be dropped - # by AppPlatform. - # @!attribute [rw] annotation_passthrough - # @return [::Boolean] - # If set to true, AppPlatform will use original annotations instead of - # dropping them, even if it is empty in the annotations filed. - # @!attribute [rw] events - # @return [::Array<::Google::Cloud::VisionAI::V1::AppPlatformEventBody>] - # The event notifications that is returned back to AppPlatform. Typically it - # will then be configured to be consumed/forwared to a operator that handles - # events, such as Pub/Sub operator. - class AppPlatformCloudFunctionResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # A general annotation message that uses struct format to represent different - # concrete annotation protobufs. - # @!attribute [rw] annotation - # @return [::Google::Protobuf::Struct] - # The struct format of the actual annotation. - class StructedOutputAnnotation - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Message of content of appPlatform event - # @!attribute [rw] event_message - # @return [::String] - # Human readable string of the event like "There are more than 6 people in - # the scene". or "Shelf is empty!". - # @!attribute [rw] payload - # @return [::Google::Protobuf::Struct] - # For the case of Pub/Sub, it will be stored in the message attributes. - # ​​pubsub.proto - # @!attribute [rw] event_id - # @return [::String] - # User defined Event Id, used to classify event, within a delivery interval, - # events from the same application instance with the same id will be - # de-duplicated & only first one will be sent out. Empty event_id will be - # treated as "". - class AppPlatformEventBody - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Enum describing all possible types of a stream annotation. - module StreamAnnotationType - # Type UNSPECIFIED. - STREAM_ANNOTATION_TYPE_UNSPECIFIED = 0 - - # active_zone annotation defines a polygon on top of the content from an - # image/video based stream, following processing will only focus on the - # content inside the active zone. - STREAM_ANNOTATION_TYPE_ACTIVE_ZONE = 1 - - # crossing_line annotation defines a polyline on top of the content from an - # image/video based Vision AI stream, events happening across the line will - # be captured. For example, the counts of people who goes acroos the line - # in Occupancy Analytic Processor. - STREAM_ANNOTATION_TYPE_CROSSING_LINE = 2 - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/proto_docs/google/cloud/visionai/v1/common.rb b/owl-bot-staging/google-cloud-vision_ai-v1/proto_docs/google/cloud/visionai/v1/common.rb deleted file mode 100644 index 2af1e72486bf..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/proto_docs/google/cloud/visionai/v1/common.rb +++ /dev/null @@ -1,134 +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 VisionAI - module V1 - # Message describing the Cluster object. - # @!attribute [r] name - # @return [::String] - # Output only. Name of the resource. - # @!attribute [r] create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The create timestamp. - # @!attribute [r] update_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The update timestamp. - # @!attribute [rw] labels - # @return [::Google::Protobuf::Map{::String => ::String}] - # Labels as key value pairs - # @!attribute [rw] annotations - # @return [::Google::Protobuf::Map{::String => ::String}] - # Annotations to allow clients to store small amounts of arbitrary data. - # @!attribute [r] dataplane_service_endpoint - # @return [::String] - # Output only. The DNS name of the data plane service - # @!attribute [r] state - # @return [::Google::Cloud::VisionAI::V1::Cluster::State] - # Output only. The current state of the cluster. - # @!attribute [r] psc_target - # @return [::String] - # Output only. The private service connection service target name. - class Cluster - 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 - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class AnnotationsEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The current state of the cluster. - module State - # Not set. - STATE_UNSPECIFIED = 0 - - # The PROVISIONING state indicates the cluster is being created. - PROVISIONING = 1 - - # The RUNNING state indicates the cluster has been created and is fully - # usable. - RUNNING = 2 - - # The STOPPING state indicates the cluster is being deleted. - STOPPING = 3 - - # The ERROR state indicates the cluster is unusable. It will be - # automatically deleted. - ERROR = 4 - end - end - - # Represents the metadata of the long-running operation. - # @!attribute [r] create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time the operation was created. - # @!attribute [r] end_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time the operation finished running. - # @!attribute [r] target - # @return [::String] - # Output only. Server-defined resource path for the target of the operation. - # @!attribute [r] verb - # @return [::String] - # Output only. Name of the verb executed by the operation. - # @!attribute [r] status_message - # @return [::String] - # Output only. Human-readable status of the operation, if any. - # @!attribute [r] requested_cancellation - # @return [::Boolean] - # Output only. Identifies whether the user has requested cancellation - # of the operation. Operations that have successfully been cancelled - # have [Operation.error][] value with a - # {::Google::Rpc::Status#code google.rpc.Status.code} of 1, corresponding to - # `Code.CANCELLED`. - # @!attribute [r] api_version - # @return [::String] - # Output only. API version used to start the operation. - class OperationMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The Google Cloud Storage location for the input content. - # @!attribute [rw] uris - # @return [::Array<::String>] - # Required. References to a Google Cloud Storage paths. - class GcsSource - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/proto_docs/google/cloud/visionai/v1/health_service.rb b/owl-bot-staging/google-cloud-vision_ai-v1/proto_docs/google/cloud/visionai/v1/health_service.rb deleted file mode 100644 index 2a2afdedf640..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/proto_docs/google/cloud/visionai/v1/health_service.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 VisionAI - module V1 - # HealthCheckRequest is the request message for Check. - # @!attribute [rw] cluster - # @return [::String] - # The parent of the resource. - class HealthCheckRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # HealthCheckResponse is the response message for Check. - # @!attribute [rw] healthy - # @return [::Boolean] - # Indicates whether the cluster is in healthy state or not. - # @!attribute [rw] reason - # @return [::String] - # Reason of why the cluster is in unhealthy state. - # @!attribute [rw] cluster_info - # @return [::Google::Cloud::VisionAI::V1::ClusterInfo] - # Other information of the cluster client may be interested. - class HealthCheckResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # @!attribute [rw] streams_count - # @return [::Integer] - # The number of active streams in the cluster. - # @!attribute [rw] processes_count - # @return [::Integer] - # The number of active processes in the cluster. - class ClusterInfo - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/proto_docs/google/cloud/visionai/v1/lva.rb b/owl-bot-staging/google-cloud-vision_ai-v1/proto_docs/google/cloud/visionai/v1/lva.rb deleted file mode 100644 index 105bb33e2a19..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/proto_docs/google/cloud/visionai/v1/lva.rb +++ /dev/null @@ -1,353 +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 VisionAI - module V1 - # Defines the interface of an Operator. - # - # Arguments to an operator are input/output streams that are getting - # processesed/returned while attributes are fixed configuration parameters. - # @!attribute [rw] operator - # @return [::String] - # The name of this operator. - # - # Tentatively [A-Z][a-zA-Z0-9]*, e.g., BboxCounter, PetDetector, - # PetDetector1. - # @!attribute [rw] input_args - # @return [::Array<::Google::Cloud::VisionAI::V1::OperatorDefinition::ArgumentDefinition>] - # Declares input arguments. - # @!attribute [rw] output_args - # @return [::Array<::Google::Cloud::VisionAI::V1::OperatorDefinition::ArgumentDefinition>] - # Declares output arguments. - # @!attribute [rw] attributes - # @return [::Array<::Google::Cloud::VisionAI::V1::OperatorDefinition::AttributeDefinition>] - # Declares the attributes. - # @!attribute [rw] resources - # @return [::Google::Cloud::VisionAI::V1::ResourceSpecification] - # The resources for running the operator. - # @!attribute [rw] short_description - # @return [::String] - # Short description of the operator. - # @!attribute [rw] description - # @return [::String] - # Full description of the operator. - class OperatorDefinition - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Defines an argument to an operator. - # - # Used for both inputs and outputs. - # @!attribute [rw] argument - # @return [::String] - # The name of the argument. - # - # Tentatively [a-z]([_a-z0-9]*[a-z0-9])?, e.g., video, audio, - # high_fps_frame. - # @!attribute [rw] type - # @return [::String] - # The data type of the argument. - # - # This should match the textual representation of a stream/Packet type. - class ArgumentDefinition - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Defines an attribute of an operator. - # @!attribute [rw] attribute - # @return [::String] - # The name of the attribute. - # - # Tentatively [a-z]([_a-z0-9]*[a-z0-9])?, e.g., max_frames_per_video, - # resize_height. - # @!attribute [rw] type - # @return [::String] - # The type of this attribute. - # - # See attribute_value.proto for possibilities. - # @!attribute [rw] default_value - # @return [::Google::Cloud::VisionAI::V1::AttributeValue] - # The default value for the attribute. - class AttributeDefinition - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # ResourceSpec collects a set of resources that can - # be used to specify requests and requirements. - # - # Note: Highly experimental as this can be runtime dependent. - # Can use the "extras" field to experiment first before trying - # to abstract it. - # @!attribute [rw] cpu - # @return [::String] - # CPU specification. - # - # Examples: - # "100m", "0.5", "1", "2", ... correspond to - # 0.1, half, 1, or 2 cpus. - # - # Leave empty to let the system decide. - # - # Note that this does *not* determine the cpu vender/make, - # or its underlying clock speed and specific SIMD features. - # It is only the amount time it requires in timeslicing. - # @!attribute [rw] cpu_limits - # @return [::String] - # CPU limit. - # - # Examples: - # "100m", "0.5", "1", "2", ... correspond to - # 0.1, half, 1, or 2 cpus. - # - # Leave empty to indicate no limit. - # @!attribute [rw] memory - # @return [::String] - # Memory specification (in bytes). - # - # Examples: - # "128974848", "129e6", "129M", "123Mi", ... correspond to - # 128974848 bytes, 129000000 bytes, 129 mebibytes, 123 megabytes. - # - # Leave empty to let the system decide. - # @!attribute [rw] memory_limits - # @return [::String] - # Memory usage limits. - # - # Examples: - # "128974848", "129e6", "129M", "123Mi", ... correspond to - # 128974848 bytes, 129000000 bytes, 129 mebibytes, 123 megabytes. - # - # Leave empty to indicate no limit. - # @!attribute [rw] gpus - # @return [::Integer] - # Number of gpus. - # @!attribute [rw] latency_budget_ms - # @return [::Integer] - # The maximum latency that this operator may use to process an element. - # - # If non positive, then a system default will be used. - # Operator developers should arrange for the system compute resources to be - # aligned with this latency budget; e.g. if you want a ML model to produce - # results within 500ms, then you should make sure you request enough - # cpu/gpu/memory to achieve that. - class ResourceSpecification - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Represents an actual value of an operator attribute. - # @!attribute [rw] i - # @return [::Integer] - # int. - # - # Note: The following fields are mutually exclusive: `i`, `f`, `b`, `s`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] f - # @return [::Float] - # float. - # - # Note: The following fields are mutually exclusive: `f`, `i`, `b`, `s`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] b - # @return [::Boolean] - # bool. - # - # Note: The following fields are mutually exclusive: `b`, `i`, `f`, `s`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] s - # @return [::String] - # string. - # - # Note: The following fields are mutually exclusive: `s`, `i`, `f`, `b`. If a field in that set is populated, all other fields in the set will automatically be cleared. - class AttributeValue - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Defines an Analyzer. - # - # An analyzer processes data from its input streams using the logic defined in - # the Operator that it represents. Of course, it produces data for the output - # streams declared in the Operator. - # @!attribute [rw] analyzer - # @return [::String] - # The name of this analyzer. - # - # Tentatively [a-z][a-z0-9]*(_[a-z0-9]+)*. - # @!attribute [rw] operator - # @return [::String] - # The name of the operator that this analyzer runs. - # - # Must match the name of a supported operator. - # @!attribute [rw] inputs - # @return [::Array<::Google::Cloud::VisionAI::V1::AnalyzerDefinition::StreamInput>] - # Input streams. - # @!attribute [rw] attrs - # @return [::Google::Protobuf::Map{::String => ::Google::Cloud::VisionAI::V1::AttributeValue}] - # The attribute values that this analyzer applies to the operator. - # - # Supply a mapping between the attribute names and the actual value you wish - # to apply. If an attribute name is omitted, then it will take a - # preconfigured default value. - # @!attribute [rw] debug_options - # @return [::Google::Cloud::VisionAI::V1::AnalyzerDefinition::DebugOptions] - # Debug options. - # @!attribute [rw] operator_option - # @return [::Google::Cloud::VisionAI::V1::AnalyzerDefinition::OperatorOption] - # Operator option. - class AnalyzerDefinition - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The inputs to this analyzer. - # - # We accept input name references of the following form: - # : - # - # Example: - # - # Suppose you had an operator named "SomeOp" that has 2 output - # arguments, the first of which is named "foo" and the second of which is - # named "bar", and an operator named "MyOp" that accepts 2 inputs. - # - # Also suppose that there is an analyzer named "some-analyzer" that is - # running "SomeOp" and another analyzer named "my-analyzer" running "MyOp". - # - # To indicate that "my-analyzer" is to consume "some-analyzer"'s "foo" - # output as its first input and "some-analyzer"'s "bar" output as its - # second input, you can set this field to the following: - # input = ["some-analyzer:foo", "some-analyzer:bar"] - # @!attribute [rw] input - # @return [::String] - # The name of the stream input (as discussed above). - class StreamInput - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Options available for debugging purposes only. - # @!attribute [rw] environment_variables - # @return [::Google::Protobuf::Map{::String => ::String}] - # Environment variables. - class DebugOptions - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class EnvironmentVariablesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Option related to the operator. - # @!attribute [rw] tag - # @return [::String] - # Tag of the operator. - # @!attribute [rw] registry - # @return [::String] - # Registry of the operator. e.g. public, dev. - class OperatorOption - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::Google::Cloud::VisionAI::V1::AttributeValue] - class AttrsEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Defines a full analysis. - # - # This is a description of the overall live analytics pipeline. - # You may think of this as an edge list representation of a multigraph. - # - # This may be directly authored by a human in protobuf textformat, or it may be - # generated by a programming API (perhaps Python or JavaScript depending on - # context). - # @!attribute [rw] analyzers - # @return [::Array<::Google::Cloud::VisionAI::V1::AnalyzerDefinition>] - # Analyzer definitions. - class AnalysisDefinition - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Message describing the status of the Process. - # @!attribute [rw] state - # @return [::Google::Cloud::VisionAI::V1::RunStatus::State] - # The state of the Process. - # @!attribute [rw] reason - # @return [::String] - # The reason of becoming the state. - class RunStatus - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # State represents the running status of the Process. - module State - # State is unspecified. - STATE_UNSPECIFIED = 0 - - # INITIALIZING means the Process is scheduled but yet ready to handle - # real traffic. - INITIALIZING = 1 - - # RUNNING means the Process is up running and handling traffic. - RUNNING = 2 - - # COMPLETED means the Process has completed the processing, especially - # for non-streaming use case. - COMPLETED = 3 - - # FAILED means the Process failed to complete the processing. - FAILED = 4 - - # PENDING means the Process is created but yet to be scheduled. - PENDING = 5 - end - end - - # RunMode represents the mode to launch the Process on. - module RunMode - # Mode is unspecified. - RUN_MODE_UNSPECIFIED = 0 - - # Live mode. Meaning the Process is launched to handle live video - # source, and possible packet drops are expected. - LIVE = 1 - - # Submission mode. Meaning the Process is launched to handle bounded video - # files, with no packet drop. Completion status is tracked. - SUBMISSION = 2 - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/proto_docs/google/cloud/visionai/v1/lva_resources.rb b/owl-bot-staging/google-cloud-vision_ai-v1/proto_docs/google/cloud/visionai/v1/lva_resources.rb deleted file mode 100644 index c6639a717f8b..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/proto_docs/google/cloud/visionai/v1/lva_resources.rb +++ /dev/null @@ -1,167 +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 VisionAI - module V1 - # Message describing the Operator object. - # @!attribute [rw] name - # @return [::String] - # Name of the resource. - # @!attribute [r] create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The create timestamp. - # @!attribute [r] update_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The update timestamp. - # @!attribute [rw] labels - # @return [::Google::Protobuf::Map{::String => ::String}] - # Labels as key value pairs. - # @!attribute [rw] operator_definition - # @return [::Google::Cloud::VisionAI::V1::OperatorDefinition] - # The definition of the operator. - # @!attribute [rw] docker_image - # @return [::String] - # The link to the docker image of the operator. - class Operator - 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 - end - - # Message describing the Analysis object. - # @!attribute [rw] name - # @return [::String] - # The name of resource. - # @!attribute [r] create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The create timestamp. - # @!attribute [r] update_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The update timestamp. - # @!attribute [rw] labels - # @return [::Google::Protobuf::Map{::String => ::String}] - # Labels as key value pairs. - # @!attribute [rw] analysis_definition - # @return [::Google::Cloud::VisionAI::V1::AnalysisDefinition] - # The definition of the analysis. - # @!attribute [rw] input_streams_mapping - # @return [::Google::Protobuf::Map{::String => ::String}] - # Map from the input parameter in the definition to the real stream. - # E.g., suppose you had a stream source operator named "input-0" and you try - # to receive from the real stream "stream-0". You can add the following - # mapping: [input-0: stream-0]. - # @!attribute [rw] output_streams_mapping - # @return [::Google::Protobuf::Map{::String => ::String}] - # Map from the output parameter in the definition to the real stream. - # E.g., suppose you had a stream sink operator named "output-0" and you try - # to send to the real stream "stream-0". You can add the following - # mapping: [output-0: stream-0]. - # @!attribute [rw] disable_event_watch - # @return [::Boolean] - # Boolean flag to indicate whether you would like to disable the ability - # to automatically start a Process when new event happening in the input - # Stream. If you would like to start a Process manually, the field needs - # to be set to true. - class Analysis - 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 - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class InputStreamsMappingEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class OutputStreamsMappingEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Message describing the Process object. - # @!attribute [rw] name - # @return [::String] - # The name of resource. - # @!attribute [r] create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The create timestamp. - # @!attribute [r] update_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The update timestamp. - # @!attribute [rw] analysis - # @return [::String] - # Required. Reference to an existing Analysis resource. - # @!attribute [rw] attribute_overrides - # @return [::Array<::String>] - # Optional. Attribute overrides of the Analyzers. - # Format for each single override item: - # "\\{analyzer_name}:\\{attribute_key}=\\{value}" - # @!attribute [rw] run_status - # @return [::Google::Cloud::VisionAI::V1::RunStatus] - # Optional. Status of the Process. - # @!attribute [rw] run_mode - # @return [::Google::Cloud::VisionAI::V1::RunMode] - # Optional. Run mode of the Process. - # @!attribute [rw] event_id - # @return [::String] - # Optional. Event ID of the input/output streams. - # This is useful when you have a StreamSource/StreamSink operator in the - # Analysis, and you want to manually specify the Event to read from/write to. - # @!attribute [rw] batch_id - # @return [::String] - # Optional. Optional: Batch ID of the Process. - # @!attribute [rw] retry_count - # @return [::Integer] - # Optional. Optional: The number of retries for a process in submission mode - # the system should try before declaring failure. By default, no retry will - # be performed. - class Process - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/proto_docs/google/cloud/visionai/v1/lva_service.rb b/owl-bot-staging/google-cloud-vision_ai-v1/proto_docs/google/cloud/visionai/v1/lva_service.rb deleted file mode 100644 index f7c9c879b595..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/proto_docs/google/cloud/visionai/v1/lva_service.rb +++ /dev/null @@ -1,543 +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 VisionAI - module V1 - # Message for requesting list of Operators. - # @!attribute [rw] parent - # @return [::String] - # Required. Parent value for ListOperatorsRequest. - # @!attribute [rw] page_size - # @return [::Integer] - # Requested page size. Server may return fewer items than requested. - # If unspecified, server will pick an appropriate default. - # @!attribute [rw] page_token - # @return [::String] - # A token identifying a page of results the server should return. - # @!attribute [rw] filter - # @return [::String] - # Filtering results. - # @!attribute [rw] order_by - # @return [::String] - # Hint for how to order the results. - class ListOperatorsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Message for response to listing Operators. - # @!attribute [rw] operators - # @return [::Array<::Google::Cloud::VisionAI::V1::Operator>] - # The list of Operator - # @!attribute [rw] next_page_token - # @return [::String] - # A token identifying a page of results the server should return. - # @!attribute [rw] unreachable - # @return [::Array<::String>] - # Locations that could not be reached. - class ListOperatorsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Message for getting a Operator. - # @!attribute [rw] name - # @return [::String] - # Required. Name of the resource. - class GetOperatorRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Message for creating a Operator. - # @!attribute [rw] parent - # @return [::String] - # Required. Value for parent. - # @!attribute [rw] operator_id - # @return [::String] - # Required. Id of the requesting object. - # @!attribute [rw] operator - # @return [::Google::Cloud::VisionAI::V1::Operator] - # Required. The resource being created. - # @!attribute [rw] request_id - # @return [::String] - # Optional. An optional request ID to identify requests. Specify a unique - # request ID so that if you must retry your request, the server will know to - # ignore the request if it has already been completed. The server will - # guarantee that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request ID, - # the server can check if original operation with the same request ID was - # received, and if so, will ignore the second request. This prevents clients - # from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - class CreateOperatorRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Message for updating a Operator. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # Required. Field mask is used to specify the fields to be overwritten in the - # Operator resource by the update. - # The fields specified in the update_mask are relative to the resource, not - # the full request. A field will be overwritten if it is in the mask. If the - # user does not provide a mask then all fields will be overwritten. - # @!attribute [rw] operator - # @return [::Google::Cloud::VisionAI::V1::Operator] - # Required. The resource being updated - # @!attribute [rw] request_id - # @return [::String] - # Optional. An optional request ID to identify requests. Specify a unique - # request ID so that if you must retry your request, the server will know to - # ignore the request if it has already been completed. The server will - # guarantee that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request ID, - # the server can check if original operation with the same request ID was - # received, and if so, will ignore the second request. This prevents clients - # from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - class UpdateOperatorRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Message for deleting a Operator - # @!attribute [rw] name - # @return [::String] - # Required. Name of the resource - # @!attribute [rw] request_id - # @return [::String] - # Optional. An optional request ID to identify requests. Specify a unique - # request ID so that if you must retry your request, the server will know to - # ignore the request if it has already been completed. The server will - # guarantee that for at least 60 minutes after the first request. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request ID, - # the server can check if original operation with the same request ID was - # received, and if so, will ignore the second request. This prevents clients - # from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - class DeleteOperatorRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Message for requesting list of Analyses - # @!attribute [rw] parent - # @return [::String] - # Required. Parent value for ListAnalysesRequest - # @!attribute [rw] page_size - # @return [::Integer] - # Requested page size. Server may return fewer items than requested. - # If unspecified, server will pick an appropriate default. - # @!attribute [rw] page_token - # @return [::String] - # A token identifying a page of results the server should return. - # @!attribute [rw] filter - # @return [::String] - # Filtering results - # @!attribute [rw] order_by - # @return [::String] - # Hint for how to order the results - class ListAnalysesRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Message for response to listing Analyses - # @!attribute [rw] analyses - # @return [::Array<::Google::Cloud::VisionAI::V1::Analysis>] - # The list of Analysis - # @!attribute [rw] next_page_token - # @return [::String] - # A token identifying a page of results the server should return. - # @!attribute [rw] unreachable - # @return [::Array<::String>] - # Locations that could not be reached. - class ListAnalysesResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Message for getting an Analysis. - # @!attribute [rw] name - # @return [::String] - # Required. Name of the resource. - class GetAnalysisRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Message for creating an Analysis. - # @!attribute [rw] parent - # @return [::String] - # Required. Value for parent. - # @!attribute [rw] analysis_id - # @return [::String] - # Required. Id of the requesting object. - # @!attribute [rw] analysis - # @return [::Google::Cloud::VisionAI::V1::Analysis] - # Required. The resource being created. - # @!attribute [rw] request_id - # @return [::String] - # Optional. An optional request ID to identify requests. Specify a unique - # request ID so that if you must retry your request, the server will know to - # ignore the request if it has already been completed. The server will - # guarantee that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request ID, - # the server can check if original operation with the same request ID was - # received, and if so, will ignore the second request. This prevents clients - # from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - class CreateAnalysisRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Message for updating an Analysis. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # Required. Field mask is used to specify the fields to be overwritten in the - # Analysis resource by the update. - # The fields specified in the update_mask are relative to the resource, not - # the full request. A field will be overwritten if it is in the mask. If the - # user does not provide a mask then all fields will be overwritten. - # @!attribute [rw] analysis - # @return [::Google::Cloud::VisionAI::V1::Analysis] - # Required. The resource being updated. - # @!attribute [rw] request_id - # @return [::String] - # Optional. An optional request ID to identify requests. Specify a unique - # request ID so that if you must retry your request, the server will know to - # ignore the request if it has already been completed. The server will - # guarantee that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request ID, - # the server can check if original operation with the same request ID was - # received, and if so, will ignore the second request. This prevents clients - # from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - class UpdateAnalysisRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Message for deleting an Analysis. - # @!attribute [rw] name - # @return [::String] - # Required. Name of the resource. - # @!attribute [rw] request_id - # @return [::String] - # Optional. An optional request ID to identify requests. Specify a unique - # request ID so that if you must retry your request, the server will know to - # ignore the request if it has already been completed. The server will - # guarantee that for at least 60 minutes after the first request. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request ID, - # the server can check if original operation with the same request ID was - # received, and if so, will ignore the second request. This prevents clients - # from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - class DeleteAnalysisRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Message for requesting list of Processes. - # @!attribute [rw] parent - # @return [::String] - # Required. Parent value for ListProcessesRequest. - # @!attribute [rw] page_size - # @return [::Integer] - # Requested page size. Server may return fewer items than requested. - # If unspecified, server will pick an appropriate default. - # @!attribute [rw] page_token - # @return [::String] - # A token identifying a page of results the server should return. - # @!attribute [rw] filter - # @return [::String] - # Filtering results - # @!attribute [rw] order_by - # @return [::String] - # Hint for how to order the results - class ListProcessesRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Message for response to listing Processes. - # @!attribute [rw] processes - # @return [::Array<::Google::Cloud::VisionAI::V1::Process>] - # The list of Processes. - # @!attribute [rw] next_page_token - # @return [::String] - # A token identifying a page of results the server should return. - # @!attribute [rw] unreachable - # @return [::Array<::String>] - # Locations that could not be reached. - class ListProcessesResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Message for getting a Process. - # @!attribute [rw] name - # @return [::String] - # Required. Name of the resource. - class GetProcessRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Message for creating a Process. - # @!attribute [rw] parent - # @return [::String] - # Required. Value for parent. - # @!attribute [rw] process_id - # @return [::String] - # Required. Id of the requesting object. - # @!attribute [rw] process - # @return [::Google::Cloud::VisionAI::V1::Process] - # Required. The resource being created. - # @!attribute [rw] request_id - # @return [::String] - # Optional. An optional request ID to identify requests. Specify a unique - # request ID so that if you must retry your request, the server will know to - # ignore the request if it has already been completed. The server will - # guarantee that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request ID, - # the server can check if original operation with the same request ID was - # received, and if so, will ignore the second request. This prevents clients - # from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - class CreateProcessRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Message for updating a Process. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # Required. Field mask is used to specify the fields to be overwritten in the - # Process resource by the update. - # The fields specified in the update_mask are relative to the resource, not - # the full request. A field will be overwritten if it is in the mask. If the - # user does not provide a mask then all fields will be overwritten. - # @!attribute [rw] process - # @return [::Google::Cloud::VisionAI::V1::Process] - # Required. The resource being updated. - # @!attribute [rw] request_id - # @return [::String] - # Optional. An optional request ID to identify requests. Specify a unique - # request ID so that if you must retry your request, the server will know to - # ignore the request if it has already been completed. The server will - # guarantee that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request ID, - # the server can check if original operation with the same request ID was - # received, and if so, will ignore the second request. This prevents clients - # from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - class UpdateProcessRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Message for deleting a Process. - # @!attribute [rw] name - # @return [::String] - # Required. Name of the resource. - # @!attribute [rw] request_id - # @return [::String] - # Optional. An optional request ID to identify requests. Specify a unique - # request ID so that if you must retry your request, the server will know to - # ignore the request if it has already been completed. The server will - # guarantee that for at least 60 minutes after the first request. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request ID, - # the server can check if original operation with the same request ID was - # received, and if so, will ignore the second request. This prevents clients - # from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - class DeleteProcessRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for running the processes in a batch. - # @!attribute [rw] parent - # @return [::String] - # Required. The parent resource shared by all processes being created. - # @!attribute [rw] requests - # @return [::Array<::Google::Cloud::VisionAI::V1::CreateProcessRequest>] - # Required. The create process requests. - # @!attribute [rw] options - # @return [::Google::Cloud::VisionAI::V1::BatchRunProcessRequest::BatchRunProcessOptions] - # Optional. Options for batch processes. - # @!attribute [r] batch_id - # @return [::String] - # Output only. The batch ID. - class BatchRunProcessRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Options for batch processes. - # @!attribute [rw] retry_count - # @return [::Integer] - # The retry counts per process. Default: 3. - # @!attribute [rw] batch_size - # @return [::Integer] - # The batch size. Default: 5, maximum: 100. - class BatchRunProcessOptions - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Response message for running the processes in a batch. - # @!attribute [rw] batch_id - # @return [::String] - # The batch ID. - # @!attribute [rw] processes - # @return [::Array<::Google::Cloud::VisionAI::V1::Process>] - # Processes created. - class BatchRunProcessResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for querying operator info. - # @!attribute [rw] parent - # @return [::String] - # Required. Parent value for ResolveOperatorInfoRequest. - # @!attribute [rw] queries - # @return [::Array<::Google::Cloud::VisionAI::V1::OperatorQuery>] - # Required. The operator queries. - class ResolveOperatorInfoRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # OperatorQuery represents one query to a Operator. - # @!attribute [rw] operator - # @return [::String] - # Required. The canonical Name of the operator. e.g. OccupancyCounting. - # @!attribute [rw] tag - # @return [::String] - # Optional. Tag of the operator. - # @!attribute [rw] registry - # @return [::Google::Cloud::VisionAI::V1::Registry] - # Optional. Registry of the operator. - class OperatorQuery - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message of ResolveOperatorInfo API. - # @!attribute [rw] operators - # @return [::Array<::Google::Cloud::VisionAI::V1::Operator>] - # Operators with detailed information. - class ResolveOperatorInfoResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message of ListPublicOperatorsRequest API. - # @!attribute [rw] parent - # @return [::String] - # Required. Parent value for ListPublicOperatorsRequest. - # @!attribute [rw] page_size - # @return [::Integer] - # Requested page size. Server may return fewer items than requested. - # If unspecified, server will pick an appropriate default. - # @!attribute [rw] page_token - # @return [::String] - # A token identifying a page of results the server should return. - # @!attribute [rw] filter - # @return [::String] - # Filtering results. - # @!attribute [rw] order_by - # @return [::String] - # Hint for how to order the results. - class ListPublicOperatorsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message of ListPublicOperators API. - # @!attribute [rw] operators - # @return [::Array<::Google::Cloud::VisionAI::V1::Operator>] - # The list of Operator - # @!attribute [rw] next_page_token - # @return [::String] - # A token identifying a page of results the server should return. - class ListPublicOperatorsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The enum of the types of the Registry. - module Registry - # Registry is unspecified. - REGISTRY_UNSPECIFIED = 0 - - # Public Registry containing the public Operators released by Google. - PUBLIC = 1 - - # Private Registry containing the local registered operators. - PRIVATE = 2 - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/proto_docs/google/cloud/visionai/v1/platform.rb b/owl-bot-staging/google-cloud-vision_ai-v1/proto_docs/google/cloud/visionai/v1/platform.rb deleted file mode 100644 index ebe9fd6f5730..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/proto_docs/google/cloud/visionai/v1/platform.rb +++ /dev/null @@ -1,2272 +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 VisionAI - module V1 - # Message for DeleteApplicationInstance Response. - class DeleteApplicationInstancesResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Message for CreateApplicationInstance Response. - class CreateApplicationInstancesResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Message for UpdateApplicationInstances Response. - class UpdateApplicationInstancesResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Message for adding stream input to an Application. - # @!attribute [rw] name - # @return [::String] - # Required. the name of the application to retrieve. - # Format: - # "projects/\\{project}/locations/\\{location}/applications/\\{application}" - # @!attribute [rw] application_instances - # @return [::Array<::Google::Cloud::VisionAI::V1::ApplicationInstance>] - # Required. The resources being created. - # @!attribute [rw] request_id - # @return [::String] - # Optional. An optional request ID to identify requests. Specify a unique - # request ID so that if you must retry your request, the server will know to - # ignore the request if it has already been completed. The server will - # guarantee that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - class CreateApplicationInstancesRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Message for removing stream input from an Application. - # @!attribute [rw] name - # @return [::String] - # Required. the name of the application to retrieve. - # Format: - # "projects/\\{project}/locations/\\{location}/applications/\\{application}" - # @!attribute [rw] instance_ids - # @return [::Array<::String>] - # Required. Id of the requesting object. - # @!attribute [rw] request_id - # @return [::String] - # Optional. An optional request ID to identify requests. Specify a unique - # request ID so that if you must retry your request, the server will know to - # ignore the request if it has already been completed. The server will - # guarantee that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - class DeleteApplicationInstancesRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # RPC Request Messages. - # Message for DeployApplication Response. - class DeployApplicationResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Message for UndeployApplication Response. - class UndeployApplicationResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Message for RemoveApplicationStreamInput Response. - class RemoveApplicationStreamInputResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Message for AddApplicationStreamInput Response. - class AddApplicationStreamInputResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Message for AddApplicationStreamInput Response. - class UpdateApplicationStreamInputResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Message for requesting list of Applications. - # @!attribute [rw] parent - # @return [::String] - # Required. Parent value for ListApplicationsRequest. - # @!attribute [rw] page_size - # @return [::Integer] - # Requested page size. Server may return fewer items than requested. - # If unspecified, server will pick an appropriate default. - # @!attribute [rw] page_token - # @return [::String] - # A token identifying a page of results the server should return. - # @!attribute [rw] filter - # @return [::String] - # Filtering results. - # @!attribute [rw] order_by - # @return [::String] - # Hint for how to order the results. - class ListApplicationsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Message for response to listing Applications. - # @!attribute [rw] applications - # @return [::Array<::Google::Cloud::VisionAI::V1::Application>] - # The list of Application. - # @!attribute [rw] next_page_token - # @return [::String] - # A token identifying a page of results the server should return. - # @!attribute [rw] unreachable - # @return [::Array<::String>] - # Locations that could not be reached. - class ListApplicationsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Message for getting a Application. - # @!attribute [rw] name - # @return [::String] - # Required. Name of the resource. - class GetApplicationRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Message for creating a Application. - # @!attribute [rw] parent - # @return [::String] - # Required. Value for parent. - # @!attribute [rw] application_id - # @return [::String] - # Required. Id of the requesting object. - # @!attribute [rw] application - # @return [::Google::Cloud::VisionAI::V1::Application] - # Required. The resource being created. - # @!attribute [rw] request_id - # @return [::String] - # Optional. An optional request ID to identify requests. Specify a unique - # request ID so that if you must retry your request, the server will know to - # ignore the request if it has already been completed. The server will - # guarantee that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - class CreateApplicationRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Message for updating an Application. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # Optional. Field mask is used to specify the fields to be overwritten in the - # Application resource by the update. - # The fields specified in the update_mask are relative to the resource, not - # the full request. A field will be overwritten if it is in the mask. If the - # user does not provide a mask then all fields will be overwritten. - # @!attribute [rw] application - # @return [::Google::Cloud::VisionAI::V1::Application] - # Required. The resource being updated. - # @!attribute [rw] request_id - # @return [::String] - # Optional. An optional request ID to identify requests. Specify a unique - # request ID so that if you must retry your request, the server will know to - # ignore the request if it has already been completed. The server will - # guarantee that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - class UpdateApplicationRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Message for deleting an Application. - # @!attribute [rw] name - # @return [::String] - # Required. Name of the resource. - # @!attribute [rw] request_id - # @return [::String] - # Optional. An optional request ID to identify requests. Specify a unique - # request ID so that if you must retry your request, the server will know to - # ignore the request if it has already been completed. The server will - # guarantee that for at least 60 minutes after the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @!attribute [rw] force - # @return [::Boolean] - # Optional. If set to true, any instances and drafts from this application - # will also be deleted. (Otherwise, the request will only work if the - # application has no instances and drafts.) - class DeleteApplicationRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Message for deploying an Application. - # @!attribute [rw] name - # @return [::String] - # Required. the name of the application to retrieve. - # Format: - # "projects/\\{project}/locations/\\{location}/applications/\\{application}" - # @!attribute [rw] validate_only - # @return [::Boolean] - # If set, validate the request and preview the application graph, but do not - # actually deploy it. - # @!attribute [rw] request_id - # @return [::String] - # Optional. An optional request ID to identify requests. Specify a unique - # request ID so that if you must retry your request, the server will know to - # ignore the request if it has already been completed. The server will - # guarantee that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @!attribute [rw] enable_monitoring - # @return [::Boolean] - # Optional. Whether or not to enable monitoring for the application on - # deployment. - class DeployApplicationRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Message for undeploying an Application. - # @!attribute [rw] name - # @return [::String] - # Required. the name of the application to retrieve. - # Format: - # "projects/\\{project}/locations/\\{location}/applications/\\{application}" - # @!attribute [rw] request_id - # @return [::String] - # Optional. An optional request ID to identify requests. Specify a unique - # request ID so that if you must retry your request, the server will know to - # ignore the request if it has already been completed. The server will - # guarantee that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - class UndeployApplicationRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Message about a single stream input config. - # @!attribute [rw] stream_with_annotation - # @return [::Google::Cloud::VisionAI::V1::StreamWithAnnotation] - class ApplicationStreamInput - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Message for adding stream input to an Application. - # @!attribute [rw] name - # @return [::String] - # Required. the name of the application to retrieve. - # Format: - # "projects/\\{project}/locations/\\{location}/applications/\\{application}" - # @!attribute [rw] application_stream_inputs - # @return [::Array<::Google::Cloud::VisionAI::V1::ApplicationStreamInput>] - # The stream inputs to add, the stream resource name is the key of each - # StreamInput, and it must be unique within each application. - # @!attribute [rw] request_id - # @return [::String] - # Optional. An optional request ID to identify requests. Specify a unique - # request ID so that if you must retry your request, the server will know to - # ignore the request if it has already been completed. The server will - # guarantee that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - class AddApplicationStreamInputRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Message for updating stream input to an Application. - # @!attribute [rw] name - # @return [::String] - # Required. the name of the application to retrieve. - # Format: - # "projects/\\{project}/locations/\\{location}/applications/\\{application}" - # @!attribute [rw] application_stream_inputs - # @return [::Array<::Google::Cloud::VisionAI::V1::ApplicationStreamInput>] - # The stream inputs to update, the stream resource name is the key of each - # StreamInput, and it must be unique within each application. - # @!attribute [rw] request_id - # @return [::String] - # Optional. An optional request ID to identify requests. Specify a unique - # request ID so that if you must retry your request, the server will know to - # ignore the request if it has already been completed. The server will - # guarantee that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @!attribute [rw] allow_missing - # @return [::Boolean] - # If true, UpdateApplicationStreamInput will insert stream input to - # application even if the target stream is not included in the application. - class UpdateApplicationStreamInputRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Message for removing stream input from an Application. - # @!attribute [rw] name - # @return [::String] - # Required. the name of the application to retrieve. - # Format: - # "projects/\\{project}/locations/\\{location}/applications/\\{application}" - # @!attribute [rw] target_stream_inputs - # @return [::Array<::Google::Cloud::VisionAI::V1::RemoveApplicationStreamInputRequest::TargetStreamInput>] - # The target stream to remove. - # @!attribute [rw] request_id - # @return [::String] - # Optional. An optional request ID to identify requests. Specify a unique - # request ID so that if you must retry your request, the server will know to - # ignore the request if it has already been completed. The server will - # guarantee that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - class RemoveApplicationStreamInputRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Message about target streamInput to remove. - # @!attribute [rw] stream - # @return [::String] - class TargetStreamInput - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Message for requesting list of Instances. - # @!attribute [rw] parent - # @return [::String] - # Required. Parent value for ListInstancesRequest. - # @!attribute [rw] page_size - # @return [::Integer] - # Requested page size. Server may return fewer items than requested. - # If unspecified, server will pick an appropriate default. - # @!attribute [rw] page_token - # @return [::String] - # A token identifying a page of results the server should return. - # @!attribute [rw] filter - # @return [::String] - # Filtering results. - # @!attribute [rw] order_by - # @return [::String] - # Hint for how to order the results. - class ListInstancesRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Message for response to listing Instances. - # @!attribute [rw] instances - # @return [::Array<::Google::Cloud::VisionAI::V1::Instance>] - # The list of Instance. - # @!attribute [rw] next_page_token - # @return [::String] - # A token identifying a page of results the server should return. - # @!attribute [rw] unreachable - # @return [::Array<::String>] - # Locations that could not be reached. - class ListInstancesResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Message for getting a Instance. - # @!attribute [rw] name - # @return [::String] - # Required. Name of the resource. - class GetInstanceRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Message for requesting list of Drafts. - # @!attribute [rw] parent - # @return [::String] - # Required. Parent value for ListDraftsRequest. - # @!attribute [rw] page_size - # @return [::Integer] - # Requested page size. Server may return fewer items than requested. - # If unspecified, server will pick an appropriate default. - # @!attribute [rw] page_token - # @return [::String] - # A token identifying a page of results the server should return. - # @!attribute [rw] filter - # @return [::String] - # Filtering results. - # @!attribute [rw] order_by - # @return [::String] - # Hint for how to order the results. - class ListDraftsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Message for response to listing Drafts. - # @!attribute [rw] drafts - # @return [::Array<::Google::Cloud::VisionAI::V1::Draft>] - # The list of Draft. - # @!attribute [rw] next_page_token - # @return [::String] - # A token identifying a page of results the server should return. - # @!attribute [rw] unreachable - # @return [::Array<::String>] - # Locations that could not be reached. - class ListDraftsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Message for getting a Draft. - # @!attribute [rw] name - # @return [::String] - # Required. Name of the resource. - class GetDraftRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Message for creating a Draft. - # @!attribute [rw] parent - # @return [::String] - # Required. Value for parent. - # @!attribute [rw] draft_id - # @return [::String] - # Required. Id of the requesting object. - # @!attribute [rw] draft - # @return [::Google::Cloud::VisionAI::V1::Draft] - # Required. The resource being created. - # @!attribute [rw] request_id - # @return [::String] - # Optional. An optional request ID to identify requests. Specify a unique - # request ID so that if you must retry your request, the server will know to - # ignore the request if it has already been completed. The server will - # guarantee that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - class CreateDraftRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Message for updating a Draft. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # Optional. Field mask is used to specify the fields to be overwritten in the - # Draft resource by the update. - # The fields specified in the update_mask are relative to the resource, not - # the full request. A field will be overwritten if it is in the mask. If the - # user does not provide a mask then all fields will be overwritten. - # @!attribute [rw] draft - # @return [::Google::Cloud::VisionAI::V1::Draft] - # Required. The resource being updated. - # @!attribute [rw] request_id - # @return [::String] - # Optional. An optional request ID to identify requests. Specify a unique - # request ID so that if you must retry your request, the server will know to - # ignore the request if it has already been completed. The server will - # guarantee that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @!attribute [rw] allow_missing - # @return [::Boolean] - # If true, UpdateDraftRequest will create one resource if the target resource - # doesn't exist, this time, the field_mask will be ignored. - class UpdateDraftRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Message for updating an ApplicationInstance. - # @!attribute [rw] name - # @return [::String] - # Required. the name of the application to retrieve. - # Format: - # "projects/\\{project}/locations/\\{location}/applications/\\{application}" - # @!attribute [rw] application_instances - # @return [::Array<::Google::Cloud::VisionAI::V1::UpdateApplicationInstancesRequest::UpdateApplicationInstance>] - # @!attribute [rw] request_id - # @return [::String] - # Optional. An optional request ID to identify requests. Specify a unique - # request ID so that if you must retry your request, the server will know to - # ignore the request if it has already been completed. The server will - # guarantee that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @!attribute [rw] allow_missing - # @return [::Boolean] - # If true, Update Request will create one resource if the target resource - # doesn't exist, this time, the field_mask will be ignored. - class UpdateApplicationInstancesRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # Optional. Field mask is used to specify the fields to be overwritten in - # the Draft resource by the update. The fields specified in the update_mask - # are relative to the resource, not the full request. A field will be - # overwritten if it is in the mask. If the user does not provide a mask - # then all fields will be overwritten. - # @!attribute [rw] instance - # @return [::Google::Cloud::VisionAI::V1::Instance] - # Required. The resource being updated. - # @!attribute [rw] instance_id - # @return [::String] - # Required. The id of the instance. - class UpdateApplicationInstance - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Message for deleting a Draft. - # @!attribute [rw] name - # @return [::String] - # Required. Name of the resource. - # @!attribute [rw] request_id - # @return [::String] - # Optional. An optional request ID to identify requests. Specify a unique - # request ID so that if you must retry your request, the server will know to - # ignore the request if it has already been completed. The server will - # guarantee that for at least 60 minutes after the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - class DeleteDraftRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Message for requesting list of Processors. - # @!attribute [rw] parent - # @return [::String] - # Required. Parent value for ListProcessorsRequest. - # @!attribute [rw] page_size - # @return [::Integer] - # Requested page size. Server may return fewer items than requested. - # If unspecified, server will pick an appropriate default. - # @!attribute [rw] page_token - # @return [::String] - # A token identifying a page of results the server should return. - # @!attribute [rw] filter - # @return [::String] - # Filtering results. - # @!attribute [rw] order_by - # @return [::String] - # Hint for how to order the results. - class ListProcessorsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Message for response to listing Processors. - # @!attribute [rw] processors - # @return [::Array<::Google::Cloud::VisionAI::V1::Processor>] - # The list of Processor. - # @!attribute [rw] next_page_token - # @return [::String] - # A token identifying a page of results the server should return. - # @!attribute [rw] unreachable - # @return [::Array<::String>] - # Locations that could not be reached. - class ListProcessorsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request Message for listing Prebuilt Processors. - # @!attribute [rw] parent - # @return [::String] - # Required. Parent path. - class ListPrebuiltProcessorsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response Message for listing Prebuilt Processors. - # @!attribute [rw] processors - # @return [::Array<::Google::Cloud::VisionAI::V1::Processor>] - # The list of Processor. - class ListPrebuiltProcessorsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Message for getting a Processor. - # @!attribute [rw] name - # @return [::String] - # Required. Name of the resource. - class GetProcessorRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Message for creating a Processor. - # @!attribute [rw] parent - # @return [::String] - # Required. Value for parent. - # @!attribute [rw] processor_id - # @return [::String] - # Required. Id of the requesting object. - # @!attribute [rw] processor - # @return [::Google::Cloud::VisionAI::V1::Processor] - # Required. The resource being created. - # @!attribute [rw] request_id - # @return [::String] - # Optional. An optional request ID to identify requests. Specify a unique - # request ID so that if you must retry your request, the server will know to - # ignore the request if it has already been completed. The server will - # guarantee that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - class CreateProcessorRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Message for updating a Processor. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # Optional. Field mask is used to specify the fields to be overwritten in the - # Processor resource by the update. - # The fields specified in the update_mask are relative to the resource, not - # the full request. A field will be overwritten if it is in the mask. If the - # user does not provide a mask then all fields will be overwritten. - # @!attribute [rw] processor - # @return [::Google::Cloud::VisionAI::V1::Processor] - # Required. The resource being updated. - # @!attribute [rw] request_id - # @return [::String] - # Optional. An optional request ID to identify requests. Specify a unique - # request ID so that if you must retry your request, the server will know to - # ignore the request if it has already been completed. The server will - # guarantee that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - class UpdateProcessorRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Message for deleting a Processor. - # @!attribute [rw] name - # @return [::String] - # Required. Name of the resource - # @!attribute [rw] request_id - # @return [::String] - # Optional. An optional request ID to identify requests. Specify a unique - # request ID so that if you must retry your request, the server will know to - # ignore the request if it has already been completed. The server will - # guarantee that for at least 60 minutes after the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - class DeleteProcessorRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Message describing Application object - # @!attribute [rw] name - # @return [::String] - # name of resource - # @!attribute [r] create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. [Output only] Create timestamp - # @!attribute [r] update_time - # @return [::Google::Protobuf::Timestamp] - # Output only. [Output only] Update timestamp - # @!attribute [rw] labels - # @return [::Google::Protobuf::Map{::String => ::String}] - # Labels as key value pairs - # @!attribute [rw] display_name - # @return [::String] - # Required. A user friendly display name for the solution. - # @!attribute [rw] description - # @return [::String] - # A description for this application. - # @!attribute [rw] application_configs - # @return [::Google::Cloud::VisionAI::V1::ApplicationConfigs] - # Application graph configuration. - # @!attribute [r] runtime_info - # @return [::Google::Cloud::VisionAI::V1::Application::ApplicationRuntimeInfo] - # Output only. Application graph runtime info. Only exists when application - # state equals to DEPLOYED. - # @!attribute [r] state - # @return [::Google::Cloud::VisionAI::V1::Application::State] - # Output only. State of the application. - # @!attribute [rw] billing_mode - # @return [::Google::Cloud::VisionAI::V1::Application::BillingMode] - # Billing mode of the application. - class Application - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Message storing the runtime information of the application. - # @!attribute [rw] deploy_time - # @return [::Google::Protobuf::Timestamp] - # Timestamp when the engine be deployed - # @!attribute [rw] global_output_resources - # @return [::Array<::Google::Cloud::VisionAI::V1::Application::ApplicationRuntimeInfo::GlobalOutputResource>] - # Globally created resources like warehouse dataschemas. - # @!attribute [rw] monitoring_config - # @return [::Google::Cloud::VisionAI::V1::Application::ApplicationRuntimeInfo::MonitoringConfig] - # Monitoring-related configuration for this application. - class ApplicationRuntimeInfo - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Message about output resources from application. - # @!attribute [rw] output_resource - # @return [::String] - # The full resource name of the outputted resources. - # @!attribute [rw] producer_node - # @return [::String] - # The name of graph node who produces the output resource name. - # For example: - # output_resource: - # /projects/123/locations/us-central1/corpora/my-corpus/dataSchemas/my-schema - # producer_node: occupancy-count - # @!attribute [rw] key - # @return [::String] - # The key of the output resource, it has to be unique within the same - # producer node. One producer node can output several output resources, - # the key can be used to match corresponding output resources. - class GlobalOutputResource - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Monitoring-related configuration for an application. - # @!attribute [rw] enabled - # @return [::Boolean] - # Whether this application has monitoring enabled. - class MonitoringConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class LabelsEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # State of the Application - module State - # The default value. This value is used if the state is omitted. - STATE_UNSPECIFIED = 0 - - # State CREATED. - CREATED = 1 - - # State DEPLOYING. - DEPLOYING = 2 - - # State DEPLOYED. - DEPLOYED = 3 - - # State UNDEPLOYING. - UNDEPLOYING = 4 - - # State DELETED. - DELETED = 5 - - # State ERROR. - ERROR = 6 - - # State CREATING. - CREATING = 7 - - # State Updating. - UPDATING = 8 - - # State Deleting. - DELETING = 9 - - # State Fixing. - FIXING = 10 - end - - # Billing mode of the Application - module BillingMode - # The default value. - BILLING_MODE_UNSPECIFIED = 0 - - # Pay as you go billing mode. - PAYG = 1 - - # Monthly billing mode. - MONTHLY = 2 - end - end - - # Message storing the graph of the application. - # @!attribute [rw] nodes - # @return [::Array<::Google::Cloud::VisionAI::V1::Node>] - # A list of nodes in the application graph. - # @!attribute [rw] event_delivery_config - # @return [::Google::Cloud::VisionAI::V1::ApplicationConfigs::EventDeliveryConfig] - # Event-related configuration for this application. - class ApplicationConfigs - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # message storing the config for event delivery - # @!attribute [rw] channel - # @return [::String] - # The delivery channel for the event notification, only pub/sub topic is - # supported now. - # Example channel: - # [//pubsub.googleapis.com/projects/visionai-testing-stable/topics/test-topic] - # @!attribute [rw] minimal_delivery_interval - # @return [::Google::Protobuf::Duration] - # The expected delivery interval for the same event. The same event won't - # be notified multiple times during this internal event that it is - # happening multiple times during the period of time.The same event is - # identified by . - class EventDeliveryConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Message describing node object. - # @!attribute [rw] output_all_output_channels_to_stream - # @return [::Boolean] - # By default, the output of the node will only be available to downstream - # nodes. To consume the direct output from the application node, the output - # must be sent to Vision AI Streams at first. - # - # By setting output_all_output_channels_to_stream to true, App Platform - # will automatically send all the outputs of the current node to Vision AI - # Stream resources (one stream per output channel). The output stream - # resource will be created by App Platform automatically during deployment - # and deleted after application un-deployment. - # Note that this config applies to all the Application Instances. - # - # The output stream can be override at instance level by - # configuring the `output_resources` section of Instance resource. - # `producer_node` should be current node, `output_resource_binding` should - # be the output channel name (or leave it blank if there is only 1 output - # channel of the processor) and `output_resource` should be the target - # output stream. - # @!attribute [rw] name - # @return [::String] - # Required. A unique name for the node. - # @!attribute [rw] display_name - # @return [::String] - # A user friendly display name for the node. - # @!attribute [rw] node_config - # @return [::Google::Cloud::VisionAI::V1::ProcessorConfig] - # Node config. - # @!attribute [rw] processor - # @return [::String] - # Processor name refer to the chosen processor resource. - # @!attribute [rw] parents - # @return [::Array<::Google::Cloud::VisionAI::V1::Node::InputEdge>] - # Parent node. Input node should not have parent node. For V1 Alpha1/Beta - # only media warehouse node can have multiple parents, other types of nodes - # will only have one parent. - class Node - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Message describing one edge pointing into a node. - # @!attribute [rw] parent_node - # @return [::String] - # The name of the parent node. - # @!attribute [rw] parent_output_channel - # @return [::String] - # The connected output artifact of the parent node. - # It can be omitted if target processor only has 1 output artifact. - # @!attribute [rw] connected_input_channel - # @return [::String] - # The connected input channel of the current node's processor. - # It can be omitted if target processor only has 1 input channel. - class InputEdge - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Message describing Draft object - # @!attribute [rw] name - # @return [::String] - # name of resource - # @!attribute [r] create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. [Output only] Create timestamp - # @!attribute [r] update_time - # @return [::Google::Protobuf::Timestamp] - # Output only. [Output only] Create timestamp - # @!attribute [rw] labels - # @return [::Google::Protobuf::Map{::String => ::String}] - # Labels as key value pairs - # @!attribute [rw] display_name - # @return [::String] - # Required. A user friendly display name for the solution. - # @!attribute [rw] description - # @return [::String] - # A description for this application. - # @!attribute [rw] draft_application_configs - # @return [::Google::Cloud::VisionAI::V1::ApplicationConfigs] - # The draft application configs which haven't been updated to an application. - class Draft - 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 - end - - # Message describing Instance object - # Next ID: 12 - # @!attribute [r] name - # @return [::String] - # Output only. name of resource - # @!attribute [r] create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. [Output only] Create timestamp - # @!attribute [r] update_time - # @return [::Google::Protobuf::Timestamp] - # Output only. [Output only] Update timestamp - # @!attribute [rw] labels - # @return [::Google::Protobuf::Map{::String => ::String}] - # Labels as key value pairs - # @!attribute [rw] display_name - # @return [::String] - # Required. A user friendly display name for the solution. - # @!attribute [rw] description - # @return [::String] - # A description for this instance. - # @!attribute [rw] instance_type - # @return [::Google::Cloud::VisionAI::V1::Instance::InstanceType] - # The instance type for the current instance. - # @!attribute [rw] input_resources - # @return [::Array<::Google::Cloud::VisionAI::V1::Instance::InputResource>] - # The input resources for the current application instance. - # For example: - # input_resources: - # visionai.googleapis.com/v1/projects/123/locations/us-central1/clusters/456/streams/stream-a - # @!attribute [rw] output_resources - # @return [::Array<::Google::Cloud::VisionAI::V1::Instance::OutputResource>] - # All the output resources associated to one application instance. - # @!attribute [rw] state - # @return [::Google::Cloud::VisionAI::V1::Instance::State] - # State of the instance. - class Instance - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Message of input resource used in one application instance. - # @!attribute [rw] input_resource - # @return [::String] - # The direct input resource name. - # If the instance type is STREAMING_PREDICTION, the input resource is in - # format of - # "projects/123/locations/us-central1/clusters/456/streams/stream-a". - # If the instance type is BATCH_PREDICTION from Cloud Storage input - # container, the input resource is in format of "gs://bucket-a". - # - # Note: The following fields are mutually exclusive: `input_resource`, `annotated_stream`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] annotated_stream - # @deprecated This field is deprecated and may be removed in the next major version update. - # @return [::Google::Cloud::VisionAI::V1::StreamWithAnnotation] - # If the input resource is VisionAI Stream, the associated annotations - # can be specified using annotated_stream instead. - # - # Note: The following fields are mutually exclusive: `annotated_stream`, `input_resource`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] data_type - # @return [::Google::Cloud::VisionAI::V1::DataType] - # Data type for the current input resource. - # @!attribute [rw] consumer_node - # @return [::String] - # The name of graph node who receives the input resource. - # For example: - # input_resource: - # visionai.googleapis.com/v1/projects/123/locations/us-central1/clusters/456/streams/input-stream-a - # consumer_node: stream-input - # @!attribute [rw] input_resource_binding - # @return [::String] - # The specific input resource binding which will consume the current Input - # Resource, can be ignored is there is only 1 input binding. - # @!attribute [rw] annotations - # @return [::Google::Cloud::VisionAI::V1::ResourceAnnotations] - # Contains resource annotations. - class InputResource - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Message of output resource used in one application instance. - # @!attribute [rw] output_resource - # @return [::String] - # The output resource name for the current application instance. - # @!attribute [rw] producer_node - # @return [::String] - # The name of graph node who produces the output resource name. - # For example: - # output_resource: - # /projects/123/locations/us-central1/clusters/456/streams/output-application-789-stream-a-occupancy-counting - # producer_node: occupancy-counting - # @!attribute [rw] output_resource_binding - # @return [::String] - # The specific output resource binding which produces the current - # OutputResource. - # @!attribute [r] is_temporary - # @return [::Boolean] - # Output only. Whether the output resource is temporary which means the - # resource is generated during the deployment of the application. Temporary - # resource will be deleted during the undeployment of the application. - # @!attribute [r] autogen - # @return [::Boolean] - # Output only. Whether the output resource is created automatically by the - # Vision AI App Platform. - class OutputResource - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class LabelsEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # All the supported instance types. - module InstanceType - # Unspecified instance type. - # If the instance type is not specified, the default one is - # STREAMING_PREDICTION. - INSTANCE_TYPE_UNSPECIFIED = 0 - - # Instance type for streaming prediction. - STREAMING_PREDICTION = 1 - - # Instance type for batch prediction. - BATCH_PREDICTION = 2 - - # Instance type for online prediction. - ONLINE_PREDICTION = 3 - end - - # State of the Instance - module State - # The default value. This value is used if the state is omitted. - STATE_UNSPECIFIED = 0 - - # State CREATING. - CREATING = 1 - - # State CREATED. - CREATED = 2 - - # State DEPLOYING. - DEPLOYING = 3 - - # State DEPLOYED. - DEPLOYED = 4 - - # State UNDEPLOYING. - UNDEPLOYING = 5 - - # State DELETED. - DELETED = 6 - - # State ERROR. - ERROR = 7 - - # State Updating - UPDATING = 8 - - # State Deleting. - DELETING = 9 - - # State Fixing. - FIXING = 10 - - # State Finished. - FINISHED = 11 - end - end - - # Message for creating a Instance. - # @!attribute [rw] instance_id - # @return [::String] - # Required. Id of the requesting object. - # @!attribute [rw] instance - # @return [::Google::Cloud::VisionAI::V1::Instance] - # Required. The resource being created. - class ApplicationInstance - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Message describing Processor object. - # Next ID: 19 - # @!attribute [rw] name - # @return [::String] - # name of resource. - # @!attribute [r] create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. [Output only] Create timestamp. - # @!attribute [r] update_time - # @return [::Google::Protobuf::Timestamp] - # Output only. [Output only] Update timestamp. - # @!attribute [rw] labels - # @return [::Google::Protobuf::Map{::String => ::String}] - # Labels as key value pairs. - # @!attribute [rw] display_name - # @return [::String] - # Required. A user friendly display name for the processor. - # @!attribute [rw] description - # @return [::String] - # Illustrative sentences for describing the functionality of the processor. - # @!attribute [r] processor_type - # @return [::Google::Cloud::VisionAI::V1::Processor::ProcessorType] - # Output only. Processor Type. - # @!attribute [rw] model_type - # @return [::Google::Cloud::VisionAI::V1::ModelType] - # Model Type. - # @!attribute [rw] custom_processor_source_info - # @return [::Google::Cloud::VisionAI::V1::CustomProcessorSourceInfo] - # Source info for customer created processor. - # @!attribute [r] state - # @return [::Google::Cloud::VisionAI::V1::Processor::ProcessorState] - # Output only. State of the Processor. - # @!attribute [r] processor_io_spec - # @return [::Google::Cloud::VisionAI::V1::ProcessorIOSpec] - # Output only. [Output only] The input / output specifications of a - # processor, each type of processor has fixed input / output specs which - # cannot be altered by customer. - # @!attribute [r] configuration_typeurl - # @return [::String] - # Output only. The corresponding configuration can be used in the Application - # to customize the behavior of the processor. - # @!attribute [r] supported_annotation_types - # @return [::Array<::Google::Cloud::VisionAI::V1::StreamAnnotationType>] - # @!attribute [rw] supports_post_processing - # @return [::Boolean] - # Indicates if the processor supports post processing. - # @!attribute [rw] supported_instance_types - # @return [::Array<::Google::Cloud::VisionAI::V1::Instance::InstanceType>] - # Which instance types this processor supports; if empty, this default to - # STREAMING_PREDICTION. - class Processor - 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 - - # Type - module ProcessorType - # Processor Type UNSPECIFIED. - PROCESSOR_TYPE_UNSPECIFIED = 0 - - # Processor Type PRETRAINED. - # Pretrained processor is developed by Vision AI App Platform with - # state-of-the-art vision data processing functionality, like occupancy - # counting or person blur. Pretrained processor is usually publicly - # available. - PRETRAINED = 1 - - # Processor Type CUSTOM. - # Custom processors are specialized processors which are either uploaded by - # customers or imported from other GCP platform (for example Vertex AI). - # Custom processor is only visible to the creator. - CUSTOM = 2 - - # Processor Type CONNECTOR. - # Connector processors are special processors which perform I/O for the - # application, they do not processing the data but either deliver the data - # to other processors or receive data from other processors. - CONNECTOR = 3 - end - - module ProcessorState - # Unspecified Processor state. - PROCESSOR_STATE_UNSPECIFIED = 0 - - # Processor is being created (not ready for use). - CREATING = 1 - - # Processor is and ready for use. - ACTIVE = 2 - - # Processor is being deleted (not ready for use). - DELETING = 3 - - # Processor deleted or creation failed . - FAILED = 4 - end - end - - # Message describing the input / output specifications of a processor. - # @!attribute [rw] graph_input_channel_specs - # @return [::Array<::Google::Cloud::VisionAI::V1::ProcessorIOSpec::GraphInputChannelSpec>] - # For processors with input_channel_specs, the processor must be explicitly - # connected to another processor. - # @!attribute [rw] graph_output_channel_specs - # @return [::Array<::Google::Cloud::VisionAI::V1::ProcessorIOSpec::GraphOutputChannelSpec>] - # The output artifact specifications for the current processor. - # @!attribute [rw] instance_resource_input_binding_specs - # @return [::Array<::Google::Cloud::VisionAI::V1::ProcessorIOSpec::InstanceResourceInputBindingSpec>] - # The input resource that needs to be fed from the application instance. - # @!attribute [rw] instance_resource_output_binding_specs - # @return [::Array<::Google::Cloud::VisionAI::V1::ProcessorIOSpec::InstanceResourceOutputBindingSpec>] - # The output resource that the processor will generate per instance. - # Other than the explicitly listed output bindings here, all the processors' - # GraphOutputChannels can be binded to stream resource. The bind name then is - # the same as the GraphOutputChannel's name. - class ProcessorIOSpec - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Message for input channel specification. - # @!attribute [rw] name - # @return [::String] - # The name of the current input channel. - # @!attribute [rw] data_type - # @return [::Google::Cloud::VisionAI::V1::DataType] - # The data types of the current input channel. - # When this field has more than 1 value, it means this input channel can be - # connected to either of these different data types. - # @!attribute [rw] accepted_data_type_uris - # @return [::Array<::String>] - # If specified, only those detailed data types can be connected to the - # processor. For example, jpeg stream for MEDIA, or PredictionResult proto - # for PROTO type. If unspecified, then any proto is accepted. - # @!attribute [rw] required - # @return [::Boolean] - # Whether the current input channel is required by the processor. - # For example, for a processor with required video input and optional audio - # input, if video input is missing, the application will be rejected while - # the audio input can be missing as long as the video input exists. - # @!attribute [rw] max_connection_allowed - # @return [::Integer] - # How many input edges can be connected to this input channel. 0 means - # unlimited. - class GraphInputChannelSpec - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Message for output channel specification. - # @!attribute [rw] name - # @return [::String] - # The name of the current output channel. - # @!attribute [rw] data_type - # @return [::Google::Cloud::VisionAI::V1::DataType] - # The data type of the current output channel. - # @!attribute [rw] data_type_uri - # @return [::String] - class GraphOutputChannelSpec - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Message for instance resource channel specification. - # External resources are virtual nodes which are not expressed in the - # application graph. Each processor expresses its out-graph spec, so customer - # is able to override the external source or destinations to the - # @!attribute [rw] config_type_uri - # @return [::String] - # The configuration proto that includes the Googleapis resources. I.e. - # type.googleapis.com/google.cloud.vision.v1.StreamWithAnnotation - # - # Note: The following fields are mutually exclusive: `config_type_uri`, `resource_type_uri`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] resource_type_uri - # @return [::String] - # The direct type url of Googleapis resource. i.e. - # type.googleapis.com/google.cloud.vision.v1.Asset - # - # Note: The following fields are mutually exclusive: `resource_type_uri`, `config_type_uri`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] name - # @return [::String] - # Name of the input binding, unique within the processor. - class InstanceResourceInputBindingSpec - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # @!attribute [rw] name - # @return [::String] - # Name of the output binding, unique within the processor. - # @!attribute [rw] resource_type_uri - # @return [::String] - # The resource type uri of the acceptable output resource. - # @!attribute [rw] explicit - # @return [::Boolean] - # Whether the output resource needs to be explicitly set in the instance. - # If it is false, the processor will automatically generate it if required. - class InstanceResourceOutputBindingSpec - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Describes the source info for a custom processor. - # @!attribute [rw] vertex_model - # @return [::String] - # The resource name original model hosted in the vertex AI platform. - # - # Note: The following fields are mutually exclusive: `vertex_model`, `product_recognizer_artifact`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] product_recognizer_artifact - # @return [::Google::Cloud::VisionAI::V1::CustomProcessorSourceInfo::ProductRecognizerArtifact] - # Artifact for product recognizer. - # - # Note: The following fields are mutually exclusive: `product_recognizer_artifact`, `vertex_model`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] source_type - # @return [::Google::Cloud::VisionAI::V1::CustomProcessorSourceInfo::SourceType] - # The original product which holds the custom processor's functionality. - # @!attribute [r] additional_info - # @return [::Google::Protobuf::Map{::String => ::String}] - # Output only. Additional info related to the imported custom processor. - # Data is filled in by app platform during the processor creation. - # @!attribute [rw] model_schema - # @return [::Google::Cloud::VisionAI::V1::CustomProcessorSourceInfo::ModelSchema] - # Model schema files which specifies the signature of the model. - # For VERTEX_CUSTOM models, instances schema is required. - # If instances schema is not specified during the processor creation, - # VisionAI Platform will try to get it from Vertex, if it doesn't exist, the - # creation will fail. - class CustomProcessorSourceInfo - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Message describes product recognizer artifact. - # @!attribute [rw] retail_product_recognition_index - # @return [::String] - # Required. Resource name of RetailProductRecognitionIndex. - # Format is - # 'projects/*/locations/*/retailCatalogs/*/retailProductRecognitionIndexes/*' - # @!attribute [rw] vertex_model - # @return [::String] - # Optional. The resource name of embedding model hosted in Vertex AI - # Platform. - class ProductRecognizerArtifact - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The schema is defined as an OpenAPI 3.0.2 [Schema - # Object](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.2.md#schemaObject). - # @!attribute [rw] instances_schema - # @return [::Google::Cloud::VisionAI::V1::GcsSource] - # Cloud Storage location to a YAML file that defines the format of a single - # instance used in prediction and explanation requests. - # @!attribute [rw] parameters_schema - # @return [::Google::Cloud::VisionAI::V1::GcsSource] - # Cloud Storage location to a YAML file that defines the prediction and - # explanation parameters. - # @!attribute [rw] predictions_schema - # @return [::Google::Cloud::VisionAI::V1::GcsSource] - # Cloud Storage location to a YAML file that defines the format of a single - # prediction or explanation. - class ModelSchema - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class AdditionalInfoEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Source type of the imported custom processor. - module SourceType - # Source type unspecified. - SOURCE_TYPE_UNSPECIFIED = 0 - - # Custom processors coming from Vertex AutoML product. - VERTEX_AUTOML = 1 - - # Custom processors coming from general custom models from Vertex. - VERTEX_CUSTOM = 2 - - # Source for Product Recognizer. - PRODUCT_RECOGNIZER = 3 - end - end - - # Next ID: 35 - # @!attribute [rw] video_stream_input_config - # @return [::Google::Cloud::VisionAI::V1::VideoStreamInputConfig] - # Configs of stream input processor. - # - # Note: The following fields are mutually exclusive: `video_stream_input_config`, `ai_enabled_devices_input_config`, `media_warehouse_config`, `person_blur_config`, `occupancy_count_config`, `person_vehicle_detection_config`, `vertex_automl_vision_config`, `vertex_automl_video_config`, `vertex_custom_config`, `general_object_detection_config`, `big_query_config`, `gcs_output_config`, `product_recognizer_config`, `personal_protective_equipment_detection_config`, `tag_recognizer_config`, `universal_input_config`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] ai_enabled_devices_input_config - # @return [::Google::Cloud::VisionAI::V1::AIEnabledDevicesInputConfig] - # Config of AI-enabled input devices. - # - # Note: The following fields are mutually exclusive: `ai_enabled_devices_input_config`, `video_stream_input_config`, `media_warehouse_config`, `person_blur_config`, `occupancy_count_config`, `person_vehicle_detection_config`, `vertex_automl_vision_config`, `vertex_automl_video_config`, `vertex_custom_config`, `general_object_detection_config`, `big_query_config`, `gcs_output_config`, `product_recognizer_config`, `personal_protective_equipment_detection_config`, `tag_recognizer_config`, `universal_input_config`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] media_warehouse_config - # @return [::Google::Cloud::VisionAI::V1::MediaWarehouseConfig] - # Configs of media warehouse processor. - # - # Note: The following fields are mutually exclusive: `media_warehouse_config`, `video_stream_input_config`, `ai_enabled_devices_input_config`, `person_blur_config`, `occupancy_count_config`, `person_vehicle_detection_config`, `vertex_automl_vision_config`, `vertex_automl_video_config`, `vertex_custom_config`, `general_object_detection_config`, `big_query_config`, `gcs_output_config`, `product_recognizer_config`, `personal_protective_equipment_detection_config`, `tag_recognizer_config`, `universal_input_config`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] person_blur_config - # @return [::Google::Cloud::VisionAI::V1::PersonBlurConfig] - # Configs of person blur processor. - # - # Note: The following fields are mutually exclusive: `person_blur_config`, `video_stream_input_config`, `ai_enabled_devices_input_config`, `media_warehouse_config`, `occupancy_count_config`, `person_vehicle_detection_config`, `vertex_automl_vision_config`, `vertex_automl_video_config`, `vertex_custom_config`, `general_object_detection_config`, `big_query_config`, `gcs_output_config`, `product_recognizer_config`, `personal_protective_equipment_detection_config`, `tag_recognizer_config`, `universal_input_config`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] occupancy_count_config - # @return [::Google::Cloud::VisionAI::V1::OccupancyCountConfig] - # Configs of occupancy count processor. - # - # Note: The following fields are mutually exclusive: `occupancy_count_config`, `video_stream_input_config`, `ai_enabled_devices_input_config`, `media_warehouse_config`, `person_blur_config`, `person_vehicle_detection_config`, `vertex_automl_vision_config`, `vertex_automl_video_config`, `vertex_custom_config`, `general_object_detection_config`, `big_query_config`, `gcs_output_config`, `product_recognizer_config`, `personal_protective_equipment_detection_config`, `tag_recognizer_config`, `universal_input_config`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] person_vehicle_detection_config - # @return [::Google::Cloud::VisionAI::V1::PersonVehicleDetectionConfig] - # Configs of Person Vehicle Detection processor. - # - # Note: The following fields are mutually exclusive: `person_vehicle_detection_config`, `video_stream_input_config`, `ai_enabled_devices_input_config`, `media_warehouse_config`, `person_blur_config`, `occupancy_count_config`, `vertex_automl_vision_config`, `vertex_automl_video_config`, `vertex_custom_config`, `general_object_detection_config`, `big_query_config`, `gcs_output_config`, `product_recognizer_config`, `personal_protective_equipment_detection_config`, `tag_recognizer_config`, `universal_input_config`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] vertex_automl_vision_config - # @return [::Google::Cloud::VisionAI::V1::VertexAutoMLVisionConfig] - # Configs of Vertex AutoML vision processor. - # - # Note: The following fields are mutually exclusive: `vertex_automl_vision_config`, `video_stream_input_config`, `ai_enabled_devices_input_config`, `media_warehouse_config`, `person_blur_config`, `occupancy_count_config`, `person_vehicle_detection_config`, `vertex_automl_video_config`, `vertex_custom_config`, `general_object_detection_config`, `big_query_config`, `gcs_output_config`, `product_recognizer_config`, `personal_protective_equipment_detection_config`, `tag_recognizer_config`, `universal_input_config`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] vertex_automl_video_config - # @return [::Google::Cloud::VisionAI::V1::VertexAutoMLVideoConfig] - # Configs of Vertex AutoML video processor. - # - # Note: The following fields are mutually exclusive: `vertex_automl_video_config`, `video_stream_input_config`, `ai_enabled_devices_input_config`, `media_warehouse_config`, `person_blur_config`, `occupancy_count_config`, `person_vehicle_detection_config`, `vertex_automl_vision_config`, `vertex_custom_config`, `general_object_detection_config`, `big_query_config`, `gcs_output_config`, `product_recognizer_config`, `personal_protective_equipment_detection_config`, `tag_recognizer_config`, `universal_input_config`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] vertex_custom_config - # @return [::Google::Cloud::VisionAI::V1::VertexCustomConfig] - # Configs of Vertex Custom processor. - # - # Note: The following fields are mutually exclusive: `vertex_custom_config`, `video_stream_input_config`, `ai_enabled_devices_input_config`, `media_warehouse_config`, `person_blur_config`, `occupancy_count_config`, `person_vehicle_detection_config`, `vertex_automl_vision_config`, `vertex_automl_video_config`, `general_object_detection_config`, `big_query_config`, `gcs_output_config`, `product_recognizer_config`, `personal_protective_equipment_detection_config`, `tag_recognizer_config`, `universal_input_config`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] general_object_detection_config - # @return [::Google::Cloud::VisionAI::V1::GeneralObjectDetectionConfig] - # Configs of General Object Detection processor. - # - # Note: The following fields are mutually exclusive: `general_object_detection_config`, `video_stream_input_config`, `ai_enabled_devices_input_config`, `media_warehouse_config`, `person_blur_config`, `occupancy_count_config`, `person_vehicle_detection_config`, `vertex_automl_vision_config`, `vertex_automl_video_config`, `vertex_custom_config`, `big_query_config`, `gcs_output_config`, `product_recognizer_config`, `personal_protective_equipment_detection_config`, `tag_recognizer_config`, `universal_input_config`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] big_query_config - # @return [::Google::Cloud::VisionAI::V1::BigQueryConfig] - # Configs of BigQuery processor. - # - # Note: The following fields are mutually exclusive: `big_query_config`, `video_stream_input_config`, `ai_enabled_devices_input_config`, `media_warehouse_config`, `person_blur_config`, `occupancy_count_config`, `person_vehicle_detection_config`, `vertex_automl_vision_config`, `vertex_automl_video_config`, `vertex_custom_config`, `general_object_detection_config`, `gcs_output_config`, `product_recognizer_config`, `personal_protective_equipment_detection_config`, `tag_recognizer_config`, `universal_input_config`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] gcs_output_config - # @return [::Google::Cloud::VisionAI::V1::GcsOutputConfig] - # Configs of Cloud Storage output processor. - # - # Note: The following fields are mutually exclusive: `gcs_output_config`, `video_stream_input_config`, `ai_enabled_devices_input_config`, `media_warehouse_config`, `person_blur_config`, `occupancy_count_config`, `person_vehicle_detection_config`, `vertex_automl_vision_config`, `vertex_automl_video_config`, `vertex_custom_config`, `general_object_detection_config`, `big_query_config`, `product_recognizer_config`, `personal_protective_equipment_detection_config`, `tag_recognizer_config`, `universal_input_config`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] product_recognizer_config - # @return [::Google::Cloud::VisionAI::V1::ProductRecognizerConfig] - # Runtime configs of Product Recognizer processor. - # - # Note: The following fields are mutually exclusive: `product_recognizer_config`, `video_stream_input_config`, `ai_enabled_devices_input_config`, `media_warehouse_config`, `person_blur_config`, `occupancy_count_config`, `person_vehicle_detection_config`, `vertex_automl_vision_config`, `vertex_automl_video_config`, `vertex_custom_config`, `general_object_detection_config`, `big_query_config`, `gcs_output_config`, `personal_protective_equipment_detection_config`, `tag_recognizer_config`, `universal_input_config`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] personal_protective_equipment_detection_config - # @return [::Google::Cloud::VisionAI::V1::PersonalProtectiveEquipmentDetectionConfig] - # Configs of personal_protective_equipment_detection_config - # - # Note: The following fields are mutually exclusive: `personal_protective_equipment_detection_config`, `video_stream_input_config`, `ai_enabled_devices_input_config`, `media_warehouse_config`, `person_blur_config`, `occupancy_count_config`, `person_vehicle_detection_config`, `vertex_automl_vision_config`, `vertex_automl_video_config`, `vertex_custom_config`, `general_object_detection_config`, `big_query_config`, `gcs_output_config`, `product_recognizer_config`, `tag_recognizer_config`, `universal_input_config`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] tag_recognizer_config - # @return [::Google::Cloud::VisionAI::V1::TagRecognizerConfig] - # Runtime configs of Tag Recognizer processor. - # - # Note: The following fields are mutually exclusive: `tag_recognizer_config`, `video_stream_input_config`, `ai_enabled_devices_input_config`, `media_warehouse_config`, `person_blur_config`, `occupancy_count_config`, `person_vehicle_detection_config`, `vertex_automl_vision_config`, `vertex_automl_video_config`, `vertex_custom_config`, `general_object_detection_config`, `big_query_config`, `gcs_output_config`, `product_recognizer_config`, `personal_protective_equipment_detection_config`, `universal_input_config`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] universal_input_config - # @return [::Google::Cloud::VisionAI::V1::UniversalInputConfig] - # Runtime configs of UniversalInput processor. - # - # Note: The following fields are mutually exclusive: `universal_input_config`, `video_stream_input_config`, `ai_enabled_devices_input_config`, `media_warehouse_config`, `person_blur_config`, `occupancy_count_config`, `person_vehicle_detection_config`, `vertex_automl_vision_config`, `vertex_automl_video_config`, `vertex_custom_config`, `general_object_detection_config`, `big_query_config`, `gcs_output_config`, `product_recognizer_config`, `personal_protective_equipment_detection_config`, `tag_recognizer_config`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] experimental_config - # @return [::Google::Protobuf::Struct] - # Experimental configurations. Structured object containing not-yet-stable - # processor parameters. - class ProcessorConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Message describing Vision AI stream with application specific annotations. - # All the StreamAnnotation object inside this message MUST have unique id. - # @!attribute [rw] stream - # @return [::String] - # Vision AI Stream resource name. - # @!attribute [rw] application_annotations - # @return [::Array<::Google::Cloud::VisionAI::V1::StreamAnnotation>] - # Annotations that will be applied to the whole application. - # @!attribute [rw] node_annotations - # @return [::Array<::Google::Cloud::VisionAI::V1::StreamWithAnnotation::NodeAnnotation>] - # Annotations that will be applied to the specific node of the application. - # If the same type of the annotations is applied to both application and - # node, the node annotation will be added in addition to the global - # application one. - # For example, if there is one active zone annotation for the whole - # application and one active zone annotation for the Occupancy Analytic - # processor, then the Occupancy Analytic processor will have two active zones - # defined. - class StreamWithAnnotation - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Message describing annotations specific to application node. - # @!attribute [rw] node - # @return [::String] - # The node name of the application graph. - # @!attribute [rw] annotations - # @return [::Array<::Google::Cloud::VisionAI::V1::StreamAnnotation>] - # The node specific stream annotations. - class NodeAnnotation - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Message describing annotations specific to application node. - # This message is a duplication of StreamWithAnnotation.NodeAnnotation. - # @!attribute [rw] node - # @return [::String] - # The node name of the application graph. - # @!attribute [rw] annotations - # @return [::Array<::Google::Cloud::VisionAI::V1::StreamAnnotation>] - # The node specific stream annotations. - class ApplicationNodeAnnotation - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Message describing general annotation for resources. - # @!attribute [rw] application_annotations - # @return [::Array<::Google::Cloud::VisionAI::V1::StreamAnnotation>] - # Annotations that will be applied to the whole application. - # @!attribute [rw] node_annotations - # @return [::Array<::Google::Cloud::VisionAI::V1::ApplicationNodeAnnotation>] - # Annotations that will be applied to the specific node of the application. - # If the same type of the annotations is applied to both application and - # node, the node annotation will be added in addition to the global - # application one. - # For example, if there is one active zone annotation for the whole - # application and one active zone annotation for the Occupancy Analytic - # processor, then the Occupancy Analytic processor will have two active zones - # defined. - class ResourceAnnotations - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Message describing Video Stream Input Config. - # This message should only be used as a placeholder for builtin:stream-input - # processor, actual stream binding should be specified using corresponding - # API. - # @!attribute [rw] streams - # @deprecated This field is deprecated and may be removed in the next major version update. - # @return [::Array<::String>] - # @!attribute [rw] streams_with_annotation - # @deprecated This field is deprecated and may be removed in the next major version update. - # @return [::Array<::Google::Cloud::VisionAI::V1::StreamWithAnnotation>] - class VideoStreamInputConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Message describing AI-enabled Devices Input Config. - class AIEnabledDevicesInputConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Message describing MediaWarehouseConfig. - # @!attribute [rw] corpus - # @return [::String] - # Resource name of the Media Warehouse corpus. - # Format: - # projects/$\\{project_id}/locations/$\\{location_id}/corpora/$\\{corpus_id} - # @!attribute [rw] region - # @deprecated This field is deprecated and may be removed in the next major version update. - # @return [::String] - # Deprecated. - # @!attribute [rw] ttl - # @return [::Google::Protobuf::Duration] - # The duration for which all media assets, associated metadata, and search - # documents can exist. - class MediaWarehouseConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Message describing FaceBlurConfig. - # @!attribute [rw] person_blur_type - # @return [::Google::Cloud::VisionAI::V1::PersonBlurConfig::PersonBlurType] - # Person blur type. - # @!attribute [rw] faces_only - # @return [::Boolean] - # Whether only blur faces other than the whole object in the processor. - class PersonBlurConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Type of Person Blur - module PersonBlurType - # PersonBlur Type UNSPECIFIED. - PERSON_BLUR_TYPE_UNSPECIFIED = 0 - - # FaceBlur Type full occlusion. - FULL_OCCULUSION = 1 - - # FaceBlur Type blur filter. - BLUR_FILTER = 2 - end - end - - # Message describing OccupancyCountConfig. - # @!attribute [rw] enable_people_counting - # @return [::Boolean] - # Whether to count the appearances of people, output counts have 'people' as - # the key. - # @!attribute [rw] enable_vehicle_counting - # @return [::Boolean] - # Whether to count the appearances of vehicles, output counts will have - # 'vehicle' as the key. - # @!attribute [rw] enable_dwelling_time_tracking - # @return [::Boolean] - # Whether to track each invidual object's loitering time inside the scene or - # specific zone. - class OccupancyCountConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Message describing PersonVehicleDetectionConfig. - # @!attribute [rw] enable_people_counting - # @return [::Boolean] - # At least one of enable_people_counting and enable_vehicle_counting fields - # must be set to true. - # Whether to count the appearances of people, output counts have 'people' as - # the key. - # @!attribute [rw] enable_vehicle_counting - # @return [::Boolean] - # Whether to count the appearances of vehicles, output counts will have - # 'vehicle' as the key. - class PersonVehicleDetectionConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Message describing PersonalProtectiveEquipmentDetectionConfig. - # @!attribute [rw] enable_face_coverage_detection - # @return [::Boolean] - # Whether to enable face coverage detection. - # @!attribute [rw] enable_head_coverage_detection - # @return [::Boolean] - # Whether to enable head coverage detection. - # @!attribute [rw] enable_hands_coverage_detection - # @return [::Boolean] - # Whether to enable hands coverage detection. - class PersonalProtectiveEquipmentDetectionConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Message of configurations for General Object Detection processor. - class GeneralObjectDetectionConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Message of configurations for BigQuery processor. - # @!attribute [rw] table - # @return [::String] - # BigQuery table resource for Vision AI Platform to ingest annotations to. - # @!attribute [rw] cloud_function_mapping - # @return [::Google::Protobuf::Map{::String => ::String}] - # Data Schema - # By default, Vision AI Application will try to write annotations to the - # target BigQuery table using the following schema: - # - # ingestion_time: TIMESTAMP, the ingestion time of the original data. - # - # application: STRING, name of the application which produces the annotation. - # - # instance: STRING, Id of the instance which produces the annotation. - # - # node: STRING, name of the application graph node which produces the - # annotation. - # - # annotation: STRING or JSON, the actual annotation protobuf will be - # converted to json string with bytes field as 64 encoded string. It can be - # written to both String or Json type column. - # - # To forward annotation data to an existing BigQuery table, customer needs to - # make sure the compatibility of the schema. - # The map maps application node name to its corresponding cloud function - # endpoint to transform the annotations directly to the - # google.cloud.bigquery.storage.v1.AppendRowsRequest (only avro_rows or - # proto_rows should be set). If configured, annotations produced by - # corresponding application node will sent to the Cloud Function at first - # before be forwarded to BigQuery. - # - # If the default table schema doesn't fit, customer is able to transform the - # annotation output from Vision AI Application to arbitrary BigQuery table - # schema with CloudFunction. - # * The cloud function will receive AppPlatformCloudFunctionRequest where - # the annotations field will be the json format of Vision AI annotation. - # * The cloud function should return AppPlatformCloudFunctionResponse with - # AppendRowsRequest stored in the annotations field. - # * To drop the annotation, simply clear the annotations field in the - # returned AppPlatformCloudFunctionResponse. - # @!attribute [rw] create_default_table_if_not_exists - # @return [::Boolean] - # If true, App Platform will create the BigQuery DataSet and the - # BigQuery Table with default schema if the specified table doesn't exist. - # This doesn't work if any cloud function customized schema is specified - # since the system doesn't know your desired schema. - # JSON column will be used in the default table created by App Platform. - class BigQueryConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class CloudFunctionMappingEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Message of configurations of Vertex AutoML Vision Processors. - # @!attribute [rw] confidence_threshold - # @return [::Float] - # Only entities with higher score than the threshold will be returned. - # Value 0.0 means to return all the detected entities. - # @!attribute [rw] max_predictions - # @return [::Integer] - # At most this many predictions will be returned per output frame. - # Value 0 means to return all the detected entities. - class VertexAutoMLVisionConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Message describing VertexAutoMLVideoConfig. - # @!attribute [rw] confidence_threshold - # @return [::Float] - # Only entities with higher score than the threshold will be returned. - # Value 0.0 means returns all the detected entities. - # @!attribute [rw] blocked_labels - # @return [::Array<::String>] - # Labels specified in this field won't be returned. - # @!attribute [rw] max_predictions - # @return [::Integer] - # At most this many predictions will be returned per output frame. - # Value 0 means to return all the detected entities. - # @!attribute [rw] bounding_box_size_limit - # @return [::Float] - # Only Bounding Box whose size is larger than this limit will be returned. - # Object Tracking only. - # Value 0.0 means to return all the detected entities. - class VertexAutoMLVideoConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Message describing VertexCustomConfig. - # @!attribute [rw] max_prediction_fps - # @return [::Integer] - # The max prediction frame per second. This attribute sets how fast the - # operator sends prediction requests to Vertex AI endpoint. Default value is - # 0, which means there is no max prediction fps limit. The operator sends - # prediction requests at input fps. - # @!attribute [rw] dedicated_resources - # @return [::Google::Cloud::VisionAI::V1::DedicatedResources] - # A description of resources that are dedicated to the DeployedModel, and - # that need a higher degree of manual configuration. - # @!attribute [rw] post_processing_cloud_function - # @return [::String] - # If not empty, the prediction result will be sent to the specified cloud - # function for post processing. - # * The cloud function will receive AppPlatformCloudFunctionRequest where - # the annotations field will be the json format of proto PredictResponse. - # * The cloud function should return AppPlatformCloudFunctionResponse with - # PredictResponse stored in the annotations field. - # * To drop the prediction output, simply clear the payload field in the - # returned AppPlatformCloudFunctionResponse. - # @!attribute [rw] attach_application_metadata - # @return [::Boolean] - # If true, the prediction request received by custom model will also contain - # metadata with the following schema: - # 'appPlatformMetadata': { - # 'ingestionTime': DOUBLE; (UNIX timestamp) - # 'application': STRING; - # 'instanceId': STRING; - # 'node': STRING; - # 'processor': STRING; - # } - # @!attribute [rw] dynamic_config_input_topic - # @return [::String] - # Optional. By setting the configuration_input_topic, processor will - # subscribe to given topic, only pub/sub topic is supported now. Example - # channel: - # //pubsub.googleapis.com/projects/visionai-testing-stable/topics/test-topic - # message schema should be: - # message Message { - # // The ID of the stream that associates with the application instance. - # string stream_id = 1; - # // The target fps. By default, the custom processor will *not* send any - # data to the Vertex Prediction container. Note that once the - # dynamic_config_input_topic is set, max_prediction_fps will not work and be - # preceded by the fps set inside the topic. - # int32 fps = 2; - # } - class VertexCustomConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Message describing GcsOutputConfig. - # @!attribute [rw] gcs_path - # @return [::String] - # The Cloud Storage path for Vision AI Platform to ingest annotations to. - class GcsOutputConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Message describing UniversalInputConfig. - class UniversalInputConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Specification of a single machine. - # @!attribute [rw] machine_type - # @return [::String] - # Immutable. The type of the machine. - # - # See the [list of machine types supported for - # prediction](https://cloud.google.com/vertex-ai/docs/predictions/configure-compute#machine-types) - # - # See the [list of machine types supported for custom - # training](https://cloud.google.com/vertex-ai/docs/training/configure-compute#machine-types). - # - # For [DeployedModel][] this field is optional, and the default - # value is `n1-standard-2`. For [BatchPredictionJob][] or as part of - # [WorkerPoolSpec][] this field is required. - # @!attribute [rw] accelerator_type - # @return [::Google::Cloud::VisionAI::V1::AcceleratorType] - # Immutable. The type of accelerator(s) that may be attached to the machine - # as per - # {::Google::Cloud::VisionAI::V1::MachineSpec#accelerator_count accelerator_count}. - # @!attribute [rw] accelerator_count - # @return [::Integer] - # The number of accelerators to attach to the machine. - class MachineSpec - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The metric specification that defines the target resource utilization - # (CPU utilization, accelerator's duty cycle, and so on) for calculating the - # desired replica count. - # @!attribute [rw] metric_name - # @return [::String] - # Required. The resource metric name. - # Supported metrics: - # - # * For Online Prediction: - # * `aiplatform.googleapis.com/prediction/online/accelerator/duty_cycle` - # * `aiplatform.googleapis.com/prediction/online/cpu/utilization` - # @!attribute [rw] target - # @return [::Integer] - # The target resource utilization in percentage (1% - 100%) for the given - # metric; once the real usage deviates from the target by a certain - # percentage, the machine replicas change. The default value is 60 - # (representing 60%) if not provided. - class AutoscalingMetricSpec - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A description of resources that are dedicated to a DeployedModel, and - # that need a higher degree of manual configuration. - # @!attribute [rw] machine_spec - # @return [::Google::Cloud::VisionAI::V1::MachineSpec] - # Required. Immutable. The specification of a single machine used by the - # prediction. - # @!attribute [rw] min_replica_count - # @return [::Integer] - # Required. Immutable. The minimum number of machine replicas this - # DeployedModel will be always deployed on. This value must be greater than - # or equal to 1. - # - # If traffic against the DeployedModel increases, it may dynamically be - # deployed onto more replicas, and as traffic decreases, some of these extra - # replicas may be freed. - # @!attribute [rw] max_replica_count - # @return [::Integer] - # Immutable. The maximum number of replicas this DeployedModel may be - # deployed on when the traffic against it increases. If the requested value - # is too large, the deployment will error, but if deployment succeeds then - # the ability to scale the model to that many replicas is guaranteed (barring - # service outages). If traffic against the DeployedModel increases beyond - # what its replicas at maximum may handle, a portion of the traffic will be - # dropped. If this value is not provided, will use - # {::Google::Cloud::VisionAI::V1::DedicatedResources#min_replica_count min_replica_count} - # as the default value. - # - # The value of this field impacts the charge against Vertex CPU and GPU - # quotas. Specifically, you will be charged for max_replica_count * - # number of cores in the selected machine type) and (max_replica_count * - # number of GPUs per replica in the selected machine type). - # @!attribute [rw] autoscaling_metric_specs - # @return [::Array<::Google::Cloud::VisionAI::V1::AutoscalingMetricSpec>] - # Immutable. The metric specifications that overrides a resource - # utilization metric (CPU utilization, accelerator's duty cycle, and so on) - # target value (default to 60 if not set). At most one entry is allowed per - # metric. - # - # If - # {::Google::Cloud::VisionAI::V1::MachineSpec#accelerator_count machine_spec.accelerator_count} - # is above 0, the autoscaling will be based on both CPU utilization and - # accelerator's duty cycle metrics and scale up when either metrics exceeds - # its target value while scale down if both metrics are under their target - # value. The default target value is 60 for both metrics. - # - # If - # {::Google::Cloud::VisionAI::V1::MachineSpec#accelerator_count machine_spec.accelerator_count} - # is 0, the autoscaling will be based on CPU utilization metric only with - # default target value 60 if not explicitly set. - # - # For example, in the case of Online Prediction, if you want to override - # target CPU utilization to 80, you should set - # {::Google::Cloud::VisionAI::V1::AutoscalingMetricSpec#metric_name autoscaling_metric_specs.metric_name} - # to `aiplatform.googleapis.com/prediction/online/cpu/utilization` and - # {::Google::Cloud::VisionAI::V1::AutoscalingMetricSpec#target autoscaling_metric_specs.target} - # to `80`. - class DedicatedResources - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Message describing ProductRecognizerConfig. - # @!attribute [rw] retail_endpoint - # @return [::String] - # The resource name of retail endpoint to use. - # @!attribute [rw] recognition_confidence_threshold - # @return [::Float] - # Confidence threshold to filter detection results. If not set, a system - # default value will be used. - class ProductRecognizerConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Message describing TagRecognizerConfig. - # @!attribute [rw] entity_detection_confidence_threshold - # @return [::Float] - # Confidence threshold to filter detection results. If not set, a system - # default value will be used. - # @!attribute [rw] tag_parsing_config - # @return [::Google::Cloud::VisionAI::V1::TagParsingConfig] - # Configuration to customize how tags are parsed. - class TagRecognizerConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Configuration for tag parsing. - # @!attribute [rw] entity_parsing_configs - # @return [::Array<::Google::Cloud::VisionAI::V1::TagParsingConfig::EntityParsingConfig>] - # Each tag entity class may have an optional EntityParsingConfig which is - # used to help parse the entities of the class. - class TagParsingConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Configuration for parsing a tag entity class. - # @!attribute [rw] entity_class - # @return [::String] - # Required. The tag entity class name. This should match the class name - # produced by the tag entity detection model. - # @!attribute [rw] regex - # @return [::String] - # Optional. An regular expression hint. - # @!attribute [rw] entity_matching_strategy - # @return [::Google::Cloud::VisionAI::V1::TagParsingConfig::EntityParsingConfig::EntityMatchingStrategy] - # Optional. Entity matching strategy. - class EntityParsingConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Type of entity matching strategy. - module EntityMatchingStrategy - # If unspecified, multi-line matching will be used by default. - ENTITY_MATCHING_STRATEGY_UNSPECIFIED = 0 - - # Matches multiple lines of text. - MULTI_LINE_MATCHING = 1 - - # Matches the line with the maximum overlap area with entity bounding - # box. - MAX_OVERLAP_AREA = 2 - end - end - end - - # All the supported model types in Vision AI App Platform. - module ModelType - # Processor Type UNSPECIFIED. - MODEL_TYPE_UNSPECIFIED = 0 - - # Model Type Image Classification. - IMAGE_CLASSIFICATION = 1 - - # Model Type Object Detection. - OBJECT_DETECTION = 2 - - # Model Type Video Classification. - VIDEO_CLASSIFICATION = 3 - - # Model Type Object Tracking. - VIDEO_OBJECT_TRACKING = 4 - - # Model Type Action Recognition. - VIDEO_ACTION_RECOGNITION = 5 - - # Model Type Occupancy Counting. - OCCUPANCY_COUNTING = 6 - - # Model Type Person Blur. - PERSON_BLUR = 7 - - # Model Type Vertex Custom. - VERTEX_CUSTOM = 8 - - # Model Type Product Recognizer. - PRODUCT_RECOGNIZER = 9 - - # Model Type Tag Recognizer. - TAG_RECOGNIZER = 10 - - # Model Type SynthID. - SYNTH_ID = 15 - end - - # Represents a hardware accelerator type. - module AcceleratorType - # Unspecified accelerator type, which means no accelerator. - ACCELERATOR_TYPE_UNSPECIFIED = 0 - - # Nvidia Tesla K80 GPU. - NVIDIA_TESLA_K80 = 1 - - # Nvidia Tesla P100 GPU. - NVIDIA_TESLA_P100 = 2 - - # Nvidia Tesla V100 GPU. - NVIDIA_TESLA_V100 = 3 - - # Nvidia Tesla P4 GPU. - NVIDIA_TESLA_P4 = 4 - - # Nvidia Tesla T4 GPU. - NVIDIA_TESLA_T4 = 5 - - # Nvidia Tesla A100 GPU. - NVIDIA_TESLA_A100 = 8 - - # TPU v2. - TPU_V2 = 6 - - # TPU v3. - TPU_V3 = 7 - end - - # All supported data types. - module DataType - # The default value of DataType. - DATA_TYPE_UNSPECIFIED = 0 - - # Video data type like H264. - VIDEO = 1 - - # Image data type. - IMAGE = 3 - - # Protobuf data type, usually used for general data blob. - PROTO = 2 - - # A placeholder data type, applicable for the universal input processor which - # supports any data type. This will be instantiated and replaced by a - # concrete underlying `DataType` during instance deployment. - PLACEHOLDER = 4 - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/proto_docs/google/cloud/visionai/v1/streaming_resources.rb b/owl-bot-staging/google-cloud-vision_ai-v1/proto_docs/google/cloud/visionai/v1/streaming_resources.rb deleted file mode 100644 index 8d513760f9bf..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/proto_docs/google/cloud/visionai/v1/streaming_resources.rb +++ /dev/null @@ -1,182 +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 VisionAI - module V1 - # The descriptor for a gstreamer buffer payload. - # @!attribute [rw] caps_string - # @return [::String] - # The caps string of the payload. - # @!attribute [rw] is_key_frame - # @return [::Boolean] - # Whether the buffer is a key frame. - # @!attribute [rw] pts_time - # @return [::Google::Protobuf::Timestamp] - # PTS of the frame. - # @!attribute [rw] dts_time - # @return [::Google::Protobuf::Timestamp] - # DTS of the frame. - # @!attribute [rw] duration - # @return [::Google::Protobuf::Duration] - # Duration of the frame. - class GstreamerBufferDescriptor - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The descriptor for a raw image. - # @!attribute [rw] format - # @return [::String] - # Raw image format. Its possible values are: "srgb". - # @!attribute [rw] height - # @return [::Integer] - # The height of the image. - # @!attribute [rw] width - # @return [::Integer] - # The width of the image. - class RawImageDescriptor - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The message that represents the data type of a packet. - # @!attribute [rw] type_class - # @return [::String] - # The type class of the packet. Its possible values are: - # "gst", "protobuf", and "string". - # @!attribute [rw] type_descriptor - # @return [::Google::Cloud::VisionAI::V1::PacketType::TypeDescriptor] - # The type descriptor. - class PacketType - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The message that fully specifies the type of the packet. - # @!attribute [rw] gstreamer_buffer_descriptor - # @return [::Google::Cloud::VisionAI::V1::GstreamerBufferDescriptor] - # GstreamerBufferDescriptor is the descriptor for gstreamer buffer type. - # - # Note: The following fields are mutually exclusive: `gstreamer_buffer_descriptor`, `raw_image_descriptor`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] raw_image_descriptor - # @return [::Google::Cloud::VisionAI::V1::RawImageDescriptor] - # RawImageDescriptor is the descriptor for the raw image type. - # - # Note: The following fields are mutually exclusive: `raw_image_descriptor`, `gstreamer_buffer_descriptor`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] type - # @return [::String] - # The type of the packet. Its possible values is codec dependent. - # - # The fully qualified type name is always the concatenation of the - # value in `type_class` together with the value in `type`, separated by a - # '/'. - # - # Note that specific codecs can define their own type hierarchy, and so the - # type string here can in fact be separated by multiple '/'s of its own. - # - # Please see the open source SDK for specific codec documentation. - class TypeDescriptor - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # The message that represents server metadata. - # @!attribute [rw] offset - # @return [::Integer] - # The offset position for the packet in its stream. - # @!attribute [rw] ingest_time - # @return [::Google::Protobuf::Timestamp] - # The timestamp at which the stream server receives this packet. This is - # based on the local clock of on the server side. It is guaranteed to be - # monotonically increasing for the packets within each session; however - # this timestamp is not comparable across packets sent to the same stream - # different sessions. Session here refers to one individual gRPC streaming - # request to the stream server. - class ServerMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The message that represents series metadata. - # @!attribute [rw] series - # @return [::String] - # Series name. It's in the format of - # "projects/\\{project}/locations/\\{location}/clusters/\\{cluster}/series/\\{stream}". - class SeriesMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The message that represents packet header. - # @!attribute [rw] capture_time - # @return [::Google::Protobuf::Timestamp] - # Input only. The capture time of the packet. - # @!attribute [rw] type - # @return [::Google::Cloud::VisionAI::V1::PacketType] - # Input only. Immutable. The type of the payload. - # @!attribute [rw] metadata - # @return [::Google::Protobuf::Struct] - # Input only. This field is for users to attach user managed metadata. - # @!attribute [r] server_metadata - # @return [::Google::Cloud::VisionAI::V1::ServerMetadata] - # Output only. Metadata that the server appends to each packet before sending - # it to receivers. You don't need to set a value for this field when sending - # packets. - # @!attribute [rw] series_metadata - # @return [::Google::Cloud::VisionAI::V1::SeriesMetadata] - # Input only. Immutable. Metadata that the server needs to know where to - # write the packets to. It's only required for the first packet. - # @!attribute [rw] flags - # @return [::Integer] - # Immutable. Packet flag set. SDK will set the flag automatically. - # @!attribute [rw] trace_context - # @return [::String] - # Immutable. Header string for tracing across services. It should be set when - # the packet is first arrived in the stream server. - # - # The input format is a lowercase hex string: - # - version_id: 1 byte, currently must be zero - hex encoded (2 characters) - # - trace_id: 16 bytes (opaque blob) - hex encoded (32 characters) - # - span_id: 8 bytes (opaque blob) - hex encoded (16 characters) - # - trace_options: 1 byte (LSB means tracing enabled) - hex encoded (2 - # characters) - # Example: "00-404142434445464748494a4b4c4d4e4f-6162636465666768-01" - # v trace_id span_id options - class PacketHeader - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The quanta of datum that the series accepts. - # @!attribute [rw] header - # @return [::Google::Cloud::VisionAI::V1::PacketHeader] - # The packet header. - # @!attribute [rw] payload - # @return [::String] - # The payload of the packet. - class Packet - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/proto_docs/google/cloud/visionai/v1/streaming_service.rb b/owl-bot-staging/google-cloud-vision_ai-v1/proto_docs/google/cloud/visionai/v1/streaming_service.rb deleted file mode 100644 index 146610b2eb83..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/proto_docs/google/cloud/visionai/v1/streaming_service.rb +++ /dev/null @@ -1,425 +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 VisionAI - module V1 - # Request message for ReceiveEvents. - # @!attribute [rw] setup_request - # @return [::Google::Cloud::VisionAI::V1::ReceiveEventsRequest::SetupRequest] - # The setup request to setup the RPC connection. - # - # Note: The following fields are mutually exclusive: `setup_request`, `commit_request`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] commit_request - # @return [::Google::Cloud::VisionAI::V1::CommitRequest] - # This request checkpoints the consumer's read progress. - # - # Note: The following fields are mutually exclusive: `commit_request`, `setup_request`. If a field in that set is populated, all other fields in the set will automatically be cleared. - class ReceiveEventsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # SetupRequest is the first message sent to the service to setup the RPC - # connection. - # @!attribute [rw] cluster - # @return [::String] - # The cluster name. - # @!attribute [rw] stream - # @return [::String] - # The stream name. The service will return the events for the given stream. - # @!attribute [rw] receiver - # @return [::String] - # A name for the receiver to self-identify. - # - # This is used to keep track of a receiver's read progress. - # @!attribute [rw] controlled_mode - # @return [::Google::Cloud::VisionAI::V1::ControlledMode] - # Controller mode configuration for receiving events from the server. - # @!attribute [rw] heartbeat_interval - # @return [::Google::Protobuf::Duration] - # The maximum duration of server silence before the client determines the - # server unreachable. - # - # The client must either receive an `Event` update or a heart beat message - # before this duration expires; otherwise, the client will automatically - # cancel the current connection and retry. - # @!attribute [rw] writes_done_grace_period - # @return [::Google::Protobuf::Duration] - # The grace period after which a `writes_done_request` is issued, that a - # `WritesDone` is expected from the client. - # - # The server is free to cancel the RPC should this expire. - # - # A system default will be chosen if unset. - class SetupRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # The event update message. - # @!attribute [rw] stream - # @return [::String] - # The name of the stream that the event is attached to. - # @!attribute [rw] event - # @return [::String] - # The name of the event. - # @!attribute [rw] series - # @return [::String] - # The name of the series. - # @!attribute [rw] update_time - # @return [::Google::Protobuf::Timestamp] - # The timestamp when the Event update happens. - # @!attribute [rw] offset - # @return [::Integer] - # The offset of the message that will be used to acknowledge of the message - # receiving. - class EventUpdate - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Control message for a ReceiveEventsResponse. - # @!attribute [rw] heartbeat - # @return [::Boolean] - # A server heartbeat. - # - # Note: The following fields are mutually exclusive: `heartbeat`, `writes_done_request`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] writes_done_request - # @return [::Boolean] - # A request to the receiver to complete any final writes followed by a - # `WritesDone`; e.g. issue any final `CommitRequest`s. - # - # May be ignored if `WritesDone` has already been issued at any point - # prior to receiving this message. - # - # If `WritesDone` does not get issued, then the server will forcefully - # cancel the connection, and the receiver will likely receive an - # uninformative after `Read` returns `false` and `Finish` is called. - # - # Note: The following fields are mutually exclusive: `writes_done_request`, `heartbeat`. If a field in that set is populated, all other fields in the set will automatically be cleared. - class ReceiveEventsControlResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for the ReceiveEvents. - # @!attribute [rw] event_update - # @return [::Google::Cloud::VisionAI::V1::EventUpdate] - # The event update message. - # - # Note: The following fields are mutually exclusive: `event_update`, `control`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] control - # @return [::Google::Cloud::VisionAI::V1::ReceiveEventsControlResponse] - # A control message from the server. - # - # Note: The following fields are mutually exclusive: `control`, `event_update`. If a field in that set is populated, all other fields in the set will automatically be cleared. - class ReceiveEventsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The lease message. - # @!attribute [rw] id - # @return [::String] - # The lease id. - # @!attribute [rw] series - # @return [::String] - # The series name. - # @!attribute [rw] owner - # @return [::String] - # The owner name. - # @!attribute [rw] expire_time - # @return [::Google::Protobuf::Timestamp] - # The lease expire time. - # @!attribute [rw] lease_type - # @return [::Google::Cloud::VisionAI::V1::LeaseType] - # The lease type. - class Lease - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for acquiring a lease. - # @!attribute [rw] series - # @return [::String] - # The series name. - # @!attribute [rw] owner - # @return [::String] - # The owner name. - # @!attribute [rw] term - # @return [::Google::Protobuf::Duration] - # The lease term. - # @!attribute [rw] lease_type - # @return [::Google::Cloud::VisionAI::V1::LeaseType] - # The lease type. - class AcquireLeaseRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for renewing a lease. - # @!attribute [rw] id - # @return [::String] - # Lease id. - # @!attribute [rw] series - # @return [::String] - # Series name. - # @!attribute [rw] owner - # @return [::String] - # Lease owner. - # @!attribute [rw] term - # @return [::Google::Protobuf::Duration] - # Lease term. - class RenewLeaseRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for releasing lease. - # @!attribute [rw] id - # @return [::String] - # Lease id. - # @!attribute [rw] series - # @return [::String] - # Series name. - # @!attribute [rw] owner - # @return [::String] - # Lease owner. - class ReleaseLeaseRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for release lease. - class ReleaseLeaseResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # RequestMetadata is the metadata message for the request. - # @!attribute [rw] stream - # @return [::String] - # Stream name. - # @!attribute [rw] event - # @return [::String] - # Evevt name. - # @!attribute [rw] series - # @return [::String] - # Series name. - # @!attribute [rw] lease_id - # @return [::String] - # Lease id. - # @!attribute [rw] owner - # @return [::String] - # Owner name. - # @!attribute [rw] lease_term - # @return [::Google::Protobuf::Duration] - # Lease term specifies how long the client wants the session to be maintained - # by the server after the client leaves. If the lease term is not set, the - # server will release the session immediately and the client cannot reconnect - # to the same session later. - class RequestMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for sending packets. - # @!attribute [rw] packet - # @return [::Google::Cloud::VisionAI::V1::Packet] - # Packets sent over the streaming rpc. - # - # Note: The following fields are mutually exclusive: `packet`, `metadata`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] metadata - # @return [::Google::Cloud::VisionAI::V1::RequestMetadata] - # The first message of the streaming rpc including the request metadata. - # - # Note: The following fields are mutually exclusive: `metadata`, `packet`. If a field in that set is populated, all other fields in the set will automatically be cleared. - class SendPacketsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for sending packets. - class SendPacketsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for receiving packets. - # @!attribute [rw] setup_request - # @return [::Google::Cloud::VisionAI::V1::ReceivePacketsRequest::SetupRequest] - # The request to setup the initial state of session. - # - # The client must send and only send this as the first message. - # - # Note: The following fields are mutually exclusive: `setup_request`, `commit_request`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] commit_request - # @return [::Google::Cloud::VisionAI::V1::CommitRequest] - # This request checkpoints the consumer's read progress. - # - # Note: The following fields are mutually exclusive: `commit_request`, `setup_request`. If a field in that set is populated, all other fields in the set will automatically be cleared. - class ReceivePacketsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The message specifying the initial settings for the ReceivePackets session. - # @!attribute [rw] eager_receive_mode - # @return [::Google::Cloud::VisionAI::V1::EagerMode] - # Options for configuring eager mode. - # - # Note: The following fields are mutually exclusive: `eager_receive_mode`, `controlled_receive_mode`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] controlled_receive_mode - # @return [::Google::Cloud::VisionAI::V1::ControlledMode] - # Options for configuring controlled mode. - # - # Note: The following fields are mutually exclusive: `controlled_receive_mode`, `eager_receive_mode`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] metadata - # @return [::Google::Cloud::VisionAI::V1::RequestMetadata] - # The configurations that specify where packets are retrieved. - # @!attribute [rw] receiver - # @return [::String] - # A name for the receiver to self-identify. - # - # This is used to keep track of a receiver's read progress. - # @!attribute [rw] heartbeat_interval - # @return [::Google::Protobuf::Duration] - # The maximum duration of server silence before the client determines the - # server unreachable. - # - # The client must either receive a `Packet` or a heart beat message before - # this duration expires; otherwise, the client will automatically cancel - # the current connection and retry. - # @!attribute [rw] writes_done_grace_period - # @return [::Google::Protobuf::Duration] - # The grace period after which a `writes_done_request` is issued, that a - # `WritesDone` is expected from the client. - # - # The server is free to cancel the RPC should this expire. - # - # A system default will be chosen if unset. - class SetupRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Control message for a ReceivePacketsResponse. - # @!attribute [rw] heartbeat - # @return [::Boolean] - # A server heartbeat. - # - # Note: The following fields are mutually exclusive: `heartbeat`, `writes_done_request`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] writes_done_request - # @return [::Boolean] - # A request to the receiver to complete any final writes followed by a - # `WritesDone`; e.g. issue any final `CommitRequest`s. - # - # May be ignored if `WritesDone` has already been issued at any point - # prior to receiving this message. - # - # If `WritesDone` does not get issued, then the server will forcefully - # cancel the connection, and the receiver will likely receive an - # uninformative after `Read` returns `false` and `Finish` is called. - # - # Note: The following fields are mutually exclusive: `writes_done_request`, `heartbeat`. If a field in that set is populated, all other fields in the set will automatically be cleared. - class ReceivePacketsControlResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message from ReceivePackets. - # @!attribute [rw] packet - # @return [::Google::Cloud::VisionAI::V1::Packet] - # A genuine data payload originating from the sender. - # - # Note: The following fields are mutually exclusive: `packet`, `control`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] control - # @return [::Google::Cloud::VisionAI::V1::ReceivePacketsControlResponse] - # A control message from the server. - # - # Note: The following fields are mutually exclusive: `control`, `packet`. If a field in that set is populated, all other fields in the set will automatically be cleared. - class ReceivePacketsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The options for receiver under the eager mode. - class EagerMode - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The options for receiver under the controlled mode. - # @!attribute [rw] starting_logical_offset - # @return [::String] - # This can be set to the following logical starting points: - # - # "begin": This will read from the earliest available message. - # - # "most-recent": This will read from the latest available message. - # - # "end": This will read only future messages. - # - # "stored": This will resume reads one past the last committed offset. - # It is the only option that resumes progress; all others - # jump unilaterally. - # @!attribute [rw] fallback_starting_offset - # @return [::String] - # This is the logical starting point to fallback upon should the - # specified starting offset be unavailable. - # - # This can be one of the following values: - # - # "begin": This will read from the earliest available message. - # - # "end": This will read only future messages. - class ControlledMode - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The message for explicitly committing the read progress. - # - # This may only be used when `ReceivePacketsControlledMode` is set in the - # initial setup request. - # @!attribute [rw] offset - # @return [::Integer] - # The offset to commit. - class CommitRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The lease type. - module LeaseType - # Lease type unspecified. - LEASE_TYPE_UNSPECIFIED = 0 - - # Lease for stream reader. - LEASE_TYPE_READER = 1 - - # Lease for stream writer. - LEASE_TYPE_WRITER = 2 - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/proto_docs/google/cloud/visionai/v1/streams_resources.rb b/owl-bot-staging/google-cloud-vision_ai-v1/proto_docs/google/cloud/visionai/v1/streams_resources.rb deleted file mode 100644 index 3277a81932f8..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/proto_docs/google/cloud/visionai/v1/streams_resources.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 Cloud - module VisionAI - module V1 - # Message describing the Stream object. The Stream and the Event resources are - # many to many; i.e., each Stream resource can associate to many Event - # resources and each Event resource can associate to many Stream resources. - # @!attribute [rw] name - # @return [::String] - # Name of the resource. - # @!attribute [r] create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The create timestamp. - # @!attribute [r] update_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The update timestamp. - # @!attribute [rw] labels - # @return [::Google::Protobuf::Map{::String => ::String}] - # Labels as key value pairs. - # @!attribute [rw] annotations - # @return [::Google::Protobuf::Map{::String => ::String}] - # Annotations to allow clients to store small amounts of arbitrary data. - # @!attribute [rw] display_name - # @return [::String] - # The display name for the stream resource. - # @!attribute [rw] enable_hls_playback - # @return [::Boolean] - # Whether to enable the HLS playback service on this stream. - # @!attribute [rw] media_warehouse_asset - # @return [::String] - # The name of the media warehouse asset for long term storage of stream data. - # Format: projects/$\\{p_id}/locations/$\\{l_id}/corpora/$\\{c_id}/assets/$\\{a_id} - # Remain empty if the media warehouse storage is not needed for the stream. - class Stream - 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 - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class AnnotationsEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Message describing the Event object. - # @!attribute [rw] name - # @return [::String] - # Name of the resource. - # @!attribute [r] create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The create timestamp. - # @!attribute [r] update_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The update timestamp. - # @!attribute [rw] labels - # @return [::Google::Protobuf::Map{::String => ::String}] - # Labels as key value pairs. - # @!attribute [rw] annotations - # @return [::Google::Protobuf::Map{::String => ::String}] - # Annotations to allow clients to store small amounts of arbitrary data. - # @!attribute [rw] alignment_clock - # @return [::Google::Cloud::VisionAI::V1::Event::Clock] - # The clock used for joining streams. - # @!attribute [rw] grace_period - # @return [::Google::Protobuf::Duration] - # Grace period for cleaning up the event. This is the time the controller - # waits for before deleting the event. During this period, if there is any - # active channel on the event. The deletion of the event after grace_period - # will be ignored. - class Event - 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 - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class AnnotationsEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Clock that will be used for joining streams. - module Clock - # Clock is not specified. - CLOCK_UNSPECIFIED = 0 - - # Use the timestamp when the data is captured. Clients need to sync the - # clock. - CAPTURE = 1 - - # Use the timestamp when the data is received. - INGEST = 2 - end - end - - # Message describing the Series object. - # @!attribute [rw] name - # @return [::String] - # Name of the resource. - # @!attribute [r] create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The create timestamp. - # @!attribute [r] update_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The update timestamp. - # @!attribute [rw] labels - # @return [::Google::Protobuf::Map{::String => ::String}] - # Labels as key value pairs. - # @!attribute [rw] annotations - # @return [::Google::Protobuf::Map{::String => ::String}] - # Annotations to allow clients to store small amounts of arbitrary data. - # @!attribute [rw] stream - # @return [::String] - # Required. Stream that is associated with this series. - # @!attribute [rw] event - # @return [::String] - # Required. Event that is associated with this series. - class Series - 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 - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class AnnotationsEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Message describing the Channel object. - # @!attribute [rw] name - # @return [::String] - # Name of the resource. - # @!attribute [r] create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The create timestamp. - # @!attribute [r] update_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The update timestamp. - # @!attribute [rw] labels - # @return [::Google::Protobuf::Map{::String => ::String}] - # Labels as key value pairs. - # @!attribute [rw] annotations - # @return [::Google::Protobuf::Map{::String => ::String}] - # Annotations to allow clients to store small amounts of arbitrary data. - # @!attribute [rw] stream - # @return [::String] - # Required. Stream that is associated with this series. - # @!attribute [rw] event - # @return [::String] - # Required. Event that is associated with this series. - class Channel - 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 - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class AnnotationsEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/proto_docs/google/cloud/visionai/v1/streams_service.rb b/owl-bot-staging/google-cloud-vision_ai-v1/proto_docs/google/cloud/visionai/v1/streams_service.rb deleted file mode 100644 index 8b52b330d685..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/proto_docs/google/cloud/visionai/v1/streams_service.rb +++ /dev/null @@ -1,644 +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 VisionAI - module V1 - # Message for requesting list of Clusters. - # @!attribute [rw] parent - # @return [::String] - # Required. Parent value for ListClustersRequest. - # @!attribute [rw] page_size - # @return [::Integer] - # Requested page size. Server may return fewer items than requested. - # If unspecified, server will pick an appropriate default. - # @!attribute [rw] page_token - # @return [::String] - # A token identifying a page of results the server should return. - # @!attribute [rw] filter - # @return [::String] - # Filtering results. - # @!attribute [rw] order_by - # @return [::String] - # Hint for how to order the results. - class ListClustersRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Message for response to listing Clusters. - # @!attribute [rw] clusters - # @return [::Array<::Google::Cloud::VisionAI::V1::Cluster>] - # The list of Cluster. - # @!attribute [rw] next_page_token - # @return [::String] - # A token identifying a page of results the server should return. - # @!attribute [rw] unreachable - # @return [::Array<::String>] - # Locations that could not be reached. - class ListClustersResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Message for getting a Cluster. - # @!attribute [rw] name - # @return [::String] - # Required. Name of the resource. - class GetClusterRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Message for creating a Cluster. - # @!attribute [rw] parent - # @return [::String] - # Required. Value for parent. - # @!attribute [rw] cluster_id - # @return [::String] - # Required. Id of the requesting object. - # @!attribute [rw] cluster - # @return [::Google::Cloud::VisionAI::V1::Cluster] - # Required. The resource being created. - # @!attribute [rw] request_id - # @return [::String] - # Optional. An optional request ID to identify requests. Specify a unique - # request ID so that if you must retry your request, the server will know to - # ignore the request if it has already been completed. The server will - # guarantee that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request ID, - # the server can check if original operation with the same request ID was - # received, and if so, will ignore the second request. This prevents clients - # from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - class CreateClusterRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Message for updating a Cluster. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # Required. Field mask is used to specify the fields to be overwritten in the - # Cluster resource by the update. - # The fields specified in the update_mask are relative to the resource, not - # the full request. A field will be overwritten if it is in the mask. If the - # user does not provide a mask then all fields will be overwritten. - # @!attribute [rw] cluster - # @return [::Google::Cloud::VisionAI::V1::Cluster] - # Required. The resource being updated - # @!attribute [rw] request_id - # @return [::String] - # Optional. An optional request ID to identify requests. Specify a unique - # request ID so that if you must retry your request, the server will know to - # ignore the request if it has already been completed. The server will - # guarantee that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request ID, - # the server can check if original operation with the same request ID was - # received, and if so, will ignore the second request. This prevents clients - # from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - class UpdateClusterRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Message for deleting a Cluster. - # @!attribute [rw] name - # @return [::String] - # Required. Name of the resource - # @!attribute [rw] request_id - # @return [::String] - # Optional. An optional request ID to identify requests. Specify a unique - # request ID so that if you must retry your request, the server will know to - # ignore the request if it has already been completed. The server will - # guarantee that for at least 60 minutes after the first request. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request ID, - # the server can check if original operation with the same request ID was - # received, and if so, will ignore the second request. This prevents clients - # from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - class DeleteClusterRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Message for requesting list of Streams. - # @!attribute [rw] parent - # @return [::String] - # Required. Parent value for ListStreamsRequest. - # @!attribute [rw] page_size - # @return [::Integer] - # Requested page size. Server may return fewer items than requested. - # If unspecified, server will pick an appropriate default. - # @!attribute [rw] page_token - # @return [::String] - # A token identifying a page of results the server should return. - # @!attribute [rw] filter - # @return [::String] - # Filtering results. - # @!attribute [rw] order_by - # @return [::String] - # Hint for how to order the results. - class ListStreamsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Message for response to listing Streams. - # @!attribute [rw] streams - # @return [::Array<::Google::Cloud::VisionAI::V1::Stream>] - # The list of Stream. - # @!attribute [rw] next_page_token - # @return [::String] - # A token identifying a page of results the server should return. - # @!attribute [rw] unreachable - # @return [::Array<::String>] - # Locations that could not be reached. - class ListStreamsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Message for getting a Stream. - # @!attribute [rw] name - # @return [::String] - # Required. Name of the resource. - class GetStreamRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Message for creating a Stream. - # @!attribute [rw] parent - # @return [::String] - # Required. Value for parent. - # @!attribute [rw] stream_id - # @return [::String] - # Required. Id of the requesting object. - # @!attribute [rw] stream - # @return [::Google::Cloud::VisionAI::V1::Stream] - # Required. The resource being created. - # @!attribute [rw] request_id - # @return [::String] - # Optional. An optional request ID to identify requests. Specify a unique - # request ID so that if you must retry your request, the server will know to - # ignore the request if it has already been completed. The server will - # guarantee that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request ID, - # the server can check if original operation with the same request ID was - # received, and if so, will ignore the second request. This prevents clients - # from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - class CreateStreamRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Message for updating a Stream. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # Required. Field mask is used to specify the fields to be overwritten in the - # Stream resource by the update. - # The fields specified in the update_mask are relative to the resource, not - # the full request. A field will be overwritten if it is in the mask. If the - # user does not provide a mask then all fields will be overwritten. - # @!attribute [rw] stream - # @return [::Google::Cloud::VisionAI::V1::Stream] - # Required. The resource being updated. - # @!attribute [rw] request_id - # @return [::String] - # Optional. An optional request ID to identify requests. Specify a unique - # request ID so that if you must retry your request, the server will know to - # ignore the request if it has already been completed. The server will - # guarantee that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request ID, - # the server can check if original operation with the same request ID was - # received, and if so, will ignore the second request. This prevents clients - # from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - class UpdateStreamRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Message for deleting a Stream. - # @!attribute [rw] name - # @return [::String] - # Required. Name of the resource. - # @!attribute [rw] request_id - # @return [::String] - # Optional. An optional request ID to identify requests. Specify a unique - # request ID so that if you must retry your request, the server will know to - # ignore the request if it has already been completed. The server will - # guarantee that for at least 60 minutes after the first request. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request ID, - # the server can check if original operation with the same request ID was - # received, and if so, will ignore the second request. This prevents clients - # from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - class DeleteStreamRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Message for getting the thumbnail of a Stream. - # @!attribute [rw] stream - # @return [::String] - # Required. The name of the stream for to get the thumbnail from. - # @!attribute [rw] gcs_object_name - # @return [::String] - # Required. The name of the GCS object to store the thumbnail image. - # @!attribute [rw] event - # @return [::String] - # Optional. The name of the event. If unspecified, the thumbnail will be - # retrieved from the latest event. - # @!attribute [rw] request_id - # @return [::String] - # Optional. An optional request ID to identify the requests. Specify a unique - # request ID so that if you must retry your request, the server will know to - # ignore the request if it has already been completed. The server will - # guarantee that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request ID, - # the server can check if original operation with the same request ID was - # received, and if so, will ignore the second request. This prevents clients - # from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - class GetStreamThumbnailRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Message for the response of GetStreamThumbnail. The empty response message - # indicates the thumbnail image has been uploaded to GCS successfully. - class GetStreamThumbnailResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for getting the auth token to access the stream HLS contents. - # @!attribute [rw] stream - # @return [::String] - # Required. The name of the stream. - class GenerateStreamHlsTokenRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for GenerateStreamHlsToken. - # @!attribute [rw] token - # @return [::String] - # The generated JWT token. - # - # The caller should insert this token to the authorization header of the HTTP - # requests to get the HLS playlist manifest and the video chunks. - # eg: curl -H "Authorization: Bearer $TOKEN" - # https://domain.com/test-stream.playback/master.m3u8 - # @!attribute [rw] expiration_time - # @return [::Google::Protobuf::Timestamp] - # The expiration time of the token. - class GenerateStreamHlsTokenResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Message for requesting list of Events. - # @!attribute [rw] parent - # @return [::String] - # Required. Parent value for ListEventsRequest. - # @!attribute [rw] page_size - # @return [::Integer] - # Requested page size. Server may return fewer items than requested. - # If unspecified, server will pick an appropriate default. - # @!attribute [rw] page_token - # @return [::String] - # A token identifying a page of results the server should return. - # @!attribute [rw] filter - # @return [::String] - # Filtering results. - # @!attribute [rw] order_by - # @return [::String] - # Hint for how to order the results. - class ListEventsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Message for response to listing Events. - # @!attribute [rw] events - # @return [::Array<::Google::Cloud::VisionAI::V1::Event>] - # The list of Event. - # @!attribute [rw] next_page_token - # @return [::String] - # A token identifying a page of results the server should return. - # @!attribute [rw] unreachable - # @return [::Array<::String>] - # Locations that could not be reached. - class ListEventsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Message for getting a Event. - # @!attribute [rw] name - # @return [::String] - # Required. Name of the resource. - class GetEventRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Message for creating a Event. - # @!attribute [rw] parent - # @return [::String] - # Required. Value for parent. - # @!attribute [rw] event_id - # @return [::String] - # Required. Id of the requesting object. - # @!attribute [rw] event - # @return [::Google::Cloud::VisionAI::V1::Event] - # Required. The resource being created. - # @!attribute [rw] request_id - # @return [::String] - # Optional. An optional request ID to identify requests. Specify a unique - # request ID so that if you must retry your request, the server will know to - # ignore the request if it has already been completed. The server will - # guarantee that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request ID, - # the server can check if original operation with the same request ID was - # received, and if so, will ignore the second request. This prevents clients - # from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - class CreateEventRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Message for updating a Event. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # Required. Field mask is used to specify the fields to be overwritten in the - # Event resource by the update. - # The fields specified in the update_mask are relative to the resource, not - # the full request. A field will be overwritten if it is in the mask. If the - # user does not provide a mask then all fields will be overwritten. - # @!attribute [rw] event - # @return [::Google::Cloud::VisionAI::V1::Event] - # Required. The resource being updated. - # @!attribute [rw] request_id - # @return [::String] - # Optional. An optional request ID to identify requests. Specify a unique - # request ID so that if you must retry your request, the server will know to - # ignore the request if it has already been completed. The server will - # guarantee that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request ID, - # the server can check if original operation with the same request ID was - # received, and if so, will ignore the second request. This prevents clients - # from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - class UpdateEventRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Message for deleting a Event. - # @!attribute [rw] name - # @return [::String] - # Required. Name of the resource. - # @!attribute [rw] request_id - # @return [::String] - # Optional. An optional request ID to identify requests. Specify a unique - # request ID so that if you must retry your request, the server will know to - # ignore the request if it has already been completed. The server will - # guarantee that for at least 60 minutes after the first request. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request ID, - # the server can check if original operation with the same request ID was - # received, and if so, will ignore the second request. This prevents clients - # from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - class DeleteEventRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Message for requesting list of Series. - # @!attribute [rw] parent - # @return [::String] - # Required. Parent value for ListSeriesRequest. - # @!attribute [rw] page_size - # @return [::Integer] - # Requested page size. Server may return fewer items than requested. - # If unspecified, server will pick an appropriate default. - # @!attribute [rw] page_token - # @return [::String] - # A token identifying a page of results the server should return. - # @!attribute [rw] filter - # @return [::String] - # Filtering results. - # @!attribute [rw] order_by - # @return [::String] - # Hint for how to order the results. - class ListSeriesRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Message for response to listing Series. - # @!attribute [rw] series - # @return [::Array<::Google::Cloud::VisionAI::V1::Series>] - # The list of Series. - # @!attribute [rw] next_page_token - # @return [::String] - # A token identifying a page of results the server should return. - # @!attribute [rw] unreachable - # @return [::Array<::String>] - # Locations that could not be reached. - class ListSeriesResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Message for getting a Series. - # @!attribute [rw] name - # @return [::String] - # Required. Name of the resource. - class GetSeriesRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Message for creating a Series. - # @!attribute [rw] parent - # @return [::String] - # Required. Value for parent. - # @!attribute [rw] series_id - # @return [::String] - # Required. Id of the requesting object. - # @!attribute [rw] series - # @return [::Google::Cloud::VisionAI::V1::Series] - # Required. The resource being created. - # @!attribute [rw] request_id - # @return [::String] - # Optional. An optional request ID to identify requests. Specify a unique - # request ID so that if you must retry your request, the server will know to - # ignore the request if it has already been completed. The server will - # guarantee that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request ID, - # the server can check if original operation with the same request ID was - # received, and if so, will ignore the second request. This prevents clients - # from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - class CreateSeriesRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Message for updating a Series. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # Required. Field mask is used to specify the fields to be overwritten in the - # Series resource by the update. The fields specified in the update_mask are - # relative to the resource, not the full request. A field will be overwritten - # if it is in the mask. If the user does not provide a mask then all fields - # will be overwritten. - # @!attribute [rw] series - # @return [::Google::Cloud::VisionAI::V1::Series] - # Required. The resource being updated - # @!attribute [rw] request_id - # @return [::String] - # Optional. An optional request ID to identify requests. Specify a unique - # request ID so that if you must retry your request, the server will know to - # ignore the request if it has already been completed. The server will - # guarantee that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request ID, - # the server can check if original operation with the same request ID was - # received, and if so, will ignore the second request. This prevents clients - # from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - class UpdateSeriesRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Message for deleting a Series. - # @!attribute [rw] name - # @return [::String] - # Required. Name of the resource. - # @!attribute [rw] request_id - # @return [::String] - # Optional. An optional request ID to identify requests. Specify a unique - # request ID so that if you must retry your request, the server will know to - # ignore the request if it has already been completed. The server will - # guarantee that for at least 60 minutes after the first request. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request ID, - # the server can check if original operation with the same request ID was - # received, and if so, will ignore the second request. This prevents clients - # from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - class DeleteSeriesRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Message for materializing a channel. - # @!attribute [rw] parent - # @return [::String] - # Required. Value for parent. - # @!attribute [rw] channel_id - # @return [::String] - # Required. Id of the channel. - # @!attribute [rw] channel - # @return [::Google::Cloud::VisionAI::V1::Channel] - # Required. The resource being created. - # @!attribute [rw] request_id - # @return [::String] - # Optional. An optional request ID to identify requests. Specify a unique - # request ID so that if you must retry your request, the server will know to - # ignore the request if it has already been completed. The server will - # guarantee that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request ID, - # the server can check if original operation with the same request ID was - # received, and if so, will ignore the second request. This prevents clients - # from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - class MaterializeChannelRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/proto_docs/google/cloud/visionai/v1/warehouse.rb b/owl-bot-staging/google-cloud-vision_ai-v1/proto_docs/google/cloud/visionai/v1/warehouse.rb deleted file mode 100644 index 595a71637888..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/proto_docs/google/cloud/visionai/v1/warehouse.rb +++ /dev/null @@ -1,3119 +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 VisionAI - module V1 - # Request message for CreateAssetRequest. - # @!attribute [rw] parent - # @return [::String] - # Required. The parent resource where this asset will be created. - # Format: - # `projects/{project_number}/locations/{location_id}/corpora/{corpus_id}` - # @!attribute [rw] asset - # @return [::Google::Cloud::VisionAI::V1::Asset] - # Required. The asset to create. - # @!attribute [rw] asset_id - # @return [::String] - # Optional. The ID to use for the asset, which will become the final - # component of the asset's resource name if user choose to specify. - # Otherwise, asset id will be generated by system. - # - # This value should be up to 63 characters, and valid characters - # are /[a-z][0-9]-/. The first character must be a letter, the last could be - # a letter or a number. - class CreateAssetRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for GetAsset. - # @!attribute [rw] name - # @return [::String] - # Required. The name of the asset to retrieve. - # Format: - # projects/\\{project_number}/locations/\\{location}/corpora/\\{corpus}/assets/\\{asset} - class GetAssetRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for ListAssets. - # @!attribute [rw] parent - # @return [::String] - # Required. The parent, which owns this collection of assets. - # Format: - # `projects/{project_number}/locations/{location}/corpora/{corpus}` - # @!attribute [rw] page_size - # @return [::Integer] - # The maximum number of assets to return. The service may return fewer than - # this value. - # If unspecified, at most 50 assets will be returned. - # The maximum value is 1000; values above 1000 will be coerced to 1000. - # @!attribute [rw] page_token - # @return [::String] - # A page token, received from a previous `ListAssets` call. - # Provide this to retrieve the subsequent page. - # - # When paginating, all other parameters provided to `ListAssets` must match - # the call that provided the page token. - # @!attribute [rw] filter - # @return [::String] - # The filter applied to the returned list. - # Only the following filterings are supported: - # "assets_with_contents = true", which returns assets with contents uploaded; - # "assets_with_contents = false", which returns assets without contents. - class ListAssetsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for ListAssets. - # @!attribute [rw] assets - # @return [::Array<::Google::Cloud::VisionAI::V1::Asset>] - # The assets from the specified corpus. - # @!attribute [rw] next_page_token - # @return [::String] - # A token, which can be sent as `page_token` to retrieve the next page. - # If this field is omitted, there are no subsequent pages. - class ListAssetsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for UpdateAsset. - # @!attribute [rw] asset - # @return [::Google::Cloud::VisionAI::V1::Asset] - # Required. The asset to update. - # - # The asset's `name` field is used to identify the asset to be updated. - # Format: - # `projects/{project_number}/locations/{location}/corpora/{corpus}/assets/{asset}` - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # The list of fields to be updated. - class UpdateAssetRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for DeleteAsset. - # @!attribute [rw] name - # @return [::String] - # Required. The name of the asset to delete. - # Format: - # `projects/{project_number}/locations/{location}/corpora/{corpus}/assets/{asset}` - class DeleteAssetRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The source of the asset. - # @!attribute [rw] asset_gcs_source - # @return [::Google::Cloud::VisionAI::V1::AssetSource::AssetGcsSource] - # The source of the asset is from Cloud Storage. - # - # Note: The following fields are mutually exclusive: `asset_gcs_source`, `asset_content_data`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] asset_content_data - # @return [::Google::Cloud::VisionAI::V1::AssetSource::AssetContentData] - # The source of the asset is from content bytes. - # - # Note: The following fields are mutually exclusive: `asset_content_data`, `asset_gcs_source`. If a field in that set is populated, all other fields in the set will automatically be cleared. - class AssetSource - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The asset source is from Cloud Storage. - # @!attribute [rw] gcs_uri - # @return [::String] - # Cloud storage uri. - class AssetGcsSource - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The content of the asset. - # @!attribute [rw] asset_content_data - # @return [::String] - class AssetContentData - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Request message for UploadAsset. - # @!attribute [rw] name - # @return [::String] - # Required. The resource name of the asset to upload. - # Format: - # `projects/{project_number}/locations/{location_id}/corpora/{corpus_id}/assets/{asset_id}` - # @!attribute [rw] asset_source - # @return [::Google::Cloud::VisionAI::V1::AssetSource] - # The source of the asset. - class UploadAssetRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for UploadAsset. - class UploadAssetResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Metadata for UploadAsset. - # @!attribute [rw] start_time - # @return [::Google::Protobuf::Timestamp] - # The start time of the operation. - # @!attribute [rw] update_time - # @return [::Google::Protobuf::Timestamp] - # The update time of the operation. - class UploadAssetMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for GenerateRetrievalUrl API. - # @!attribute [rw] name - # @return [::String] - # Required. The resource name of the asset to request signed url for. - # Format: - # `projects/{project_number}/locations/{location_id}/corpora/{corpus_id}/assets/{asset_id}` - class GenerateRetrievalUrlRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for GenerateRetrievalUrl API. - # @!attribute [rw] signed_uri - # @return [::String] - # A signed url to download the content of the asset. - class GenerateRetrievalUrlResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # An asset is a resource in corpus. It represents a media object inside corpus, - # contains metadata and another resource annotation. Different feature could be - # applied to the asset to generate annotations. User could specified annotation - # related to the target asset. - # @!attribute [rw] name - # @return [::String] - # Resource name of the asset. - # Format: - # `projects/{project_number}/locations/{location_id}/corpora/{corpus_id}/assets/{asset_id}` - # @!attribute [rw] ttl - # @return [::Google::Protobuf::Duration] - # The duration for which all media assets, associated metadata, and search - # documents can exist. If not set, then it will using the default ttl in the - # parent corpus resource. - # @!attribute [r] asset_gcs_source - # @return [::Google::Cloud::VisionAI::V1::AssetSource::AssetGcsSource] - # Output only. The original cloud storage source uri that is associated with - # this asset. - class Asset - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for AnalyzeAsset. - # @!attribute [rw] name - # @return [::String] - # Required. The resource name of the asset to analyze. - # Format: - # `projects/{project_number}/locations/{location_id}/corpora/{corpus_id}/assets/{asset_id}` - class AnalyzeAssetRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Metadata for AnalyzeAsset. - # @!attribute [rw] analysis_status - # @return [::Array<::Google::Cloud::VisionAI::V1::AnalyzeAssetMetadata::AnalysisStatus>] - # The status of analysis on all search capabilities. - # @!attribute [rw] start_time - # @return [::Google::Protobuf::Timestamp] - # The start time of the operation. - # @!attribute [rw] update_time - # @return [::Google::Protobuf::Timestamp] - # The update time of the operation. - class AnalyzeAssetMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The status of analysis on each search capability. - # @!attribute [rw] state - # @return [::Google::Cloud::VisionAI::V1::AnalyzeAssetMetadata::AnalysisStatus::State] - # @!attribute [rw] status_message - # @return [::String] - # @!attribute [rw] search_capability - # @return [::Google::Cloud::VisionAI::V1::SearchCapability] - # The search capability requested. - class AnalysisStatus - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The state of the search capability. - module State - # The default process state should never happen. - STATE_UNSPECIFIED = 0 - - # The ml model analysis is in progress. - IN_PROGRESS = 1 - - # The ml model analysis is successfully done. - SUCCEEDED = 2 - - # The ml model analysis failed. - FAILED = 3 - end - end - end - - # Response message for AnalyzeAsset. - class AnalyzeAssetResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The status of indexing for the asset. - # @!attribute [r] state - # @return [::Google::Cloud::VisionAI::V1::IndexingStatus::State] - # Output only. State of this asset's indexing. - # @!attribute [rw] status_message - # @return [::String] - # Detailed message describing the state. - class IndexingStatus - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # State enum for this asset's indexing. - module State - # The default process state should never happen. - STATE_UNSPECIFIED = 0 - - # The indexing is in progress. - IN_PROGRESS = 1 - - # The process is successfully done. - SUCCEEDED = 2 - - # The process failed. - FAILED = 3 - end - end - - # Request message for IndexAsset. - # @!attribute [rw] name - # @return [::String] - # Required. The resource name of the asset to index. - # Format: - # `projects/{project_number}/locations/{location_id}/corpora/{corpus_id}/assets/{asset_id}` - # @!attribute [rw] index - # @return [::String] - # Optional. The name of the index. - # Format: - # `projects/{project_number}/locations/{location}/corpora/{corpus}/indexes/{index}` - class IndexAssetRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Metadata for IndexAsset. - # @!attribute [rw] status - # @return [::Google::Cloud::VisionAI::V1::IndexingStatus] - # The status of indexing this asset. - # @!attribute [rw] start_time - # @return [::Google::Protobuf::Timestamp] - # The start time of the operation. - # @!attribute [rw] update_time - # @return [::Google::Protobuf::Timestamp] - # The update time of the operation. - class IndexAssetMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for IndexAsset. - class IndexAssetResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for RemoveIndexAsset. - # @!attribute [rw] name - # @return [::String] - # Required. The resource name of the asset to index. - # Format: - # `projects/{project_number}/locations/{location_id}/corpora/{corpus_id}/assets/{asset_id}` - # @!attribute [rw] index - # @return [::String] - # Optional. The name of the index. - # Format: - # `projects/{project_number}/locations/{location}/corpora/{corpus}/indexes/{index}` - class RemoveIndexAssetRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Metadata for RemoveIndexAsset. - # @!attribute [rw] indexing_status - # @return [::Google::Cloud::VisionAI::V1::IndexingStatus] - # The status of indexing this asset. - # @!attribute [rw] start_time - # @return [::Google::Protobuf::Timestamp] - # The start time of the operation. - # @!attribute [rw] update_time - # @return [::Google::Protobuf::Timestamp] - # The update time of the operation. - class RemoveIndexAssetMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for RemoveIndexAsset. - class RemoveIndexAssetResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # An IndexedAsset is an asset that the index is built upon. - # @!attribute [rw] index - # @return [::String] - # Required. The index that this indexed asset belongs to. - # Format: - # `projects/{project_number}/locations/{location}/corpora/{corpus}/indexes/{index}` - # @!attribute [rw] asset - # @return [::String] - # Required. The resource name of the asset. - # Format: - # `projects/{project_number}/locations/{location_id}/corpora/{corpus_id}/assets/{asset_id}` - # @!attribute [r] create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The create timestamp. - # @!attribute [r] update_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The update timestamp. - class IndexedAsset - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for ViewIndexedAssets. - # @!attribute [rw] index - # @return [::String] - # Required. The index that owns this collection of assets. - # Format: - # `projects/{project_number}/locations/{location}/corpora/{corpus}/indexes/{index}` - # @!attribute [rw] page_size - # @return [::Integer] - # The maximum number of assets to return. The service may return fewer than - # this value. - # If unspecified, at most 50 assets will be returned. - # The maximum value is 1000; values above 1000 will be coerced to 1000. - # @!attribute [rw] page_token - # @return [::String] - # A page token, received from a previous `ViewIndexedAssets` call. - # Provide this to retrieve the subsequent page. - # - # When paginating, all other parameters provided to `ViewIndexedAssets` must - # match the call that provided the page token. - # @!attribute [rw] filter - # @return [::String] - # The filter applied to the returned list. - # Only the following filterings are supported: - # "asset_id = xxxx", which returns asset with specified id. - # "asset_id = xxxx, yyyy, zzzz", which returns assets with specified ids. - class ViewIndexedAssetsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for ViewIndexedAssets. - # @!attribute [rw] indexed_assets - # @return [::Array<::Google::Cloud::VisionAI::V1::IndexedAsset>] - # The assets from the specified index. - # @!attribute [rw] next_page_token - # @return [::String] - # A token, which can be sent as `page_token` to retrieve the next page. - # If this field is omitted, there are no subsequent pages. - class ViewIndexedAssetsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message of CreateCorpus API. - # @!attribute [rw] parent - # @return [::String] - # Required. Form: `projects/{project_number}/locations/{location_id}` - # @!attribute [rw] corpus - # @return [::Google::Cloud::VisionAI::V1::Corpus] - # Required. The corpus to be created. - class CreateCorpusRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Metadata for CreateCorpus API. - # @!attribute [rw] create_time - # @return [::Google::Protobuf::Timestamp] - # The create time of the create corpus operation. - # @!attribute [rw] update_time - # @return [::Google::Protobuf::Timestamp] - # The update time of the create corpus operation. - class CreateCorpusMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The capability and metadata of search capability. - # @!attribute [rw] type - # @return [::Google::Cloud::VisionAI::V1::SearchCapability::Type] - # The search capability to enable. - class SearchCapability - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Capability to perform different search on assets. - module Type - # Unspecified search capability, should never be used. - TYPE_UNSPECIFIED = 0 - - # Embedding search. - EMBEDDING_SEARCH = 1 - end - end - - # Setting for search capability to enable. - # @!attribute [rw] search_capabilities - # @return [::Array<::Google::Cloud::VisionAI::V1::SearchCapability>] - # The metadata of search capability to enable. - class SearchCapabilitySetting - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Metadata message for CreateCollectionRequest - # @!attribute [rw] operation_metadata - # @return [::Google::Cloud::VisionAI::V1::OperationMetadata] - # Common metadata of the long-running operation. - class CreateCollectionMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for CreateCollection. - # @!attribute [rw] parent - # @return [::String] - # Required. The parent resource where this collection will be created. - # Format: `projects/{project_number}/locations/{location}/corpora/{corpus}` - # @!attribute [rw] collection - # @return [::Google::Cloud::VisionAI::V1::Collection] - # Required. The collection resource to be created. - # @!attribute [rw] collection_id - # @return [::String] - # Optional. The ID to use for the collection, which will become the final - # component of the resource name if user choose to specify. Otherwise, - # collection id will be generated by system. - # - # This value should be up to 55 characters, and valid characters - # are /[a-z][0-9]-/. The first character must be a letter, the last could be - # a letter or a number. - class CreateCollectionRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Metadata message for DeleteCollectionRequest - # @!attribute [rw] operation_metadata - # @return [::Google::Cloud::VisionAI::V1::OperationMetadata] - # Common metadata of the long-running operation. - class DeleteCollectionMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for DeleteCollectionRequest. - # @!attribute [rw] name - # @return [::String] - # Required. The name of the collection to delete. Format: - # `projects/{project_number}/locations/{location}/corpora/{corpus}/collections/{collection}` - class DeleteCollectionRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for GetCollectionRequest. - # @!attribute [rw] name - # @return [::String] - # Required. The name of the collection to retrieve. Format: - # `projects/{project_number}/locations/{location}/corpora/{corpus}/collections/{collection}` - class GetCollectionRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for UpdateCollectionRequest. - # @!attribute [rw] collection - # @return [::Google::Cloud::VisionAI::V1::Collection] - # Required. The collection to update. - # - # The collection's `name` field is used to identify the collection to be - # updated. Format: - # `projects/{project_number}/locations/{location}/corpora/{corpus}/collections/{collection}` - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # The list of fields to be updated. - # - Unset `update_mask` or set `update_mask` to be a single "*" only will - # update all updatable fields with the value provided in `collection`. - # - To update `display_name` value to empty string, set it in the - # `collection` - # to empty string, and set `update_mask` with "display_name". Same applies - # to other updatable string fields in the `collection`. - class UpdateCollectionRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for ListCollections. - # @!attribute [rw] parent - # @return [::String] - # Required. The parent corpus. Format: - # `projects/{project_number}/locations/{location}/corpora/{corpus}` - # @!attribute [rw] page_size - # @return [::Integer] - # The maximum number of collections to return. The service may return fewer - # than this value. If unspecified, at most 50 collections will be returned. - # The maximum value is 1000; values above 1000 will be coerced to 1000. - # @!attribute [rw] page_token - # @return [::String] - # A page token, received from a previous `ListCollectionsRequest` call. - # Provide this to retrieve the subsequent page. - # - # When paginating, all other parameters provided to `ListCollectionsRequest` - # must match the call that provided the page token. - class ListCollectionsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for ListCollections. - # @!attribute [rw] collections - # @return [::Array<::Google::Cloud::VisionAI::V1::Collection>] - # The collections from the specified corpus. - # @!attribute [rw] next_page_token - # @return [::String] - # A token, which can be sent as `page_token` to retrieve the next page. - # If this field is omitted, there are no subsequent pages. - class ListCollectionsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for AddCollectionItem. - # @!attribute [rw] item - # @return [::Google::Cloud::VisionAI::V1::CollectionItem] - # Required. The item to be added. - class AddCollectionItemRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for AddCollectionItem. - # @!attribute [rw] item - # @return [::Google::Cloud::VisionAI::V1::CollectionItem] - # The item that has already been added. - class AddCollectionItemResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for RemoveCollectionItem. - # @!attribute [rw] item - # @return [::Google::Cloud::VisionAI::V1::CollectionItem] - # Required. The item to be removed. - class RemoveCollectionItemRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for RemoveCollectionItem. - # @!attribute [rw] item - # @return [::Google::Cloud::VisionAI::V1::CollectionItem] - # The item that has already been removed. - class RemoveCollectionItemResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for ViewCollectionItems. - # @!attribute [rw] collection - # @return [::String] - # Required. The collection to view. Format: - # `projects/{project_number}/locations/{location}/corpora/{corpus}/collections/{collection}` - # @!attribute [rw] page_size - # @return [::Integer] - # The maximum number of collections to return. The service may return fewer - # than this value. If unspecified, at most 50 collections will be returned. - # The maximum value is 1000; values above 1000 will be coerced to 1000. - # @!attribute [rw] page_token - # @return [::String] - # A page token, received from a previous `ViewCollectionItemsRequest` call. - # Provide this to retrieve the subsequent page. - # - # When paginating, all other parameters provided to - # `ViewCollectionItemsRequest` must match the call that provided the page - # token. - class ViewCollectionItemsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for ViewCollectionItems. - # @!attribute [rw] items - # @return [::Array<::Google::Cloud::VisionAI::V1::CollectionItem>] - # The items from the specified collection. - # @!attribute [rw] next_page_token - # @return [::String] - # A token, which can be sent as `page_token` to retrieve the next page. - # If this field is omitted, there are no subsequent pages. - class ViewCollectionItemsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A collection is a resource in a corpus. It serves as a container of - # references to original resources. - # @!attribute [r] name - # @return [::String] - # Output only. Resource name of the collection. Format: - # `projects/{project_number}/locations/{location}/corpora/{corpus}/collections/{collection}` - # @!attribute [rw] display_name - # @return [::String] - # Optional. The collection name for displaying. - # The name can be up to 256 characters long. - # @!attribute [rw] description - # @return [::String] - # Optional. Description of the collection. Can be up to 25000 characters - # long. - class Collection - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A CollectionItem is an item in a collection. - # Each item is a reference to the original resource in a collection. - # @!attribute [rw] collection - # @return [::String] - # Required. The collection name that this item belongs to. Format: - # `projects/{project_number}/locations/{location}/corpora/{corpus}/collections/{collection}` - # @!attribute [rw] type - # @return [::Google::Cloud::VisionAI::V1::CollectionItem::Type] - # Required. The type of item. - # @!attribute [rw] item_resource - # @return [::String] - # Required. The name of the CollectionItem. Its format depends on the `type` - # above. For ASSET: - # `projects/{project_number}/locations/{location}/corpora/{corpus}/assets/{asset}` - class CollectionItem - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # CollectionItem types. - module Type - # The default type of item should never happen. - TYPE_UNSPECIFIED = 0 - - # Asset type item. - ASSET = 1 - end - end - - # Message for creating an Index. - # @!attribute [rw] parent - # @return [::String] - # Required. Value for the parent. The resource name of the Corpus under which - # this index is created. Format: - # `projects/{project_number}/locations/{location_id}/corpora/{corpus_id}` - # @!attribute [rw] index_id - # @return [::String] - # Optional. The ID for the index. This will become the final resource name - # for the index. If the user does not specify this value, it will be - # generated by system. - # - # This value should be up to 63 characters, and valid characters - # are /[a-z][0-9]-/. The first character must be a letter, the last could be - # a letter or a number. - # @!attribute [rw] index - # @return [::Google::Cloud::VisionAI::V1::Index] - # Required. The index being created. - class CreateIndexRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Metadata message for CreateIndexRequest - # @!attribute [rw] operation_metadata - # @return [::Google::Cloud::VisionAI::V1::OperationMetadata] - # Common metadata of the long-running operation. - class CreateIndexMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for UpdateIndex. - # @!attribute [rw] index - # @return [::Google::Cloud::VisionAI::V1::Index] - # Required. The resource being updated. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # Required. Field mask is used to specify the fields to be overwritten in the - # Index resource by the update. The fields specified in the update_mask are - # relative to the resource, not the full request. A field of the resource - # will be overwritten if it is in the mask. Empty field mask is not allowed. - # If the mask is "*", it triggers a full update of the index, and also a - # whole rebuild of index data. - class UpdateIndexRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Metadata message for UpdateIndexRequest - # @!attribute [rw] operation_metadata - # @return [::Google::Cloud::VisionAI::V1::OperationMetadata] - # Common metadata of the long-running operation. - class UpdateIndexMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for getting an Index. - # @!attribute [rw] name - # @return [::String] - # Required. Name of the Index resource. - # Format: - # `projects/{project_number}/locations/{location}/corpora/{corpus}/indexes/{index}` - class GetIndexRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for listing Indexes. - # @!attribute [rw] parent - # @return [::String] - # Required. The parent corpus that owns this collection of indexes. - # Format: - # `projects/{project_number}/locations/{location}/corpora/{corpus}` - # @!attribute [rw] page_size - # @return [::Integer] - # The maximum number of indexes to return. The service may return fewer than - # this value. - # If unspecified, at most 50 indexes will be returned. - # The maximum value is 1000; values above 1000 will be coerced to 1000. - # @!attribute [rw] page_token - # @return [::String] - # A page token, received from a previous `ListIndexes` call. - # Provide this to retrieve the subsequent page. - # - # When paginating, all other parameters provided to `ListIndexes` must match - # the call that provided the page token. - class ListIndexesRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for ListIndexes. - # @!attribute [rw] indexes - # @return [::Array<::Google::Cloud::VisionAI::V1::Index>] - # The indexes under the specified corpus. - # @!attribute [rw] next_page_token - # @return [::String] - # A token, which can be sent as `page_token` to retrieve the next page. - # If this field is omitted, there are no subsequent pages. - class ListIndexesResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for DeleteIndex. - # @!attribute [rw] name - # @return [::String] - # Required. The name of the index to delete. - # Format: - # `projects/{project_number}/locations/{location}/corpora/{corpus}/indexes/{index}` - class DeleteIndexRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Metadata message for DeleteIndexRequest - class DeleteIndexMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # An Index is a resource in Corpus. It contains an indexed version of the - # assets and annotations. When deployed to an endpoint, it will allow users to - # search the Index. - # @!attribute [rw] entire_corpus - # @return [::Boolean] - # Include all assets under the corpus. - # @!attribute [r] name - # @return [::String] - # Output only. Resource name of the Index resource. - # Format: - # `projects/{project_number}/locations/{location_id}/corpora/{corpus_id}/indexes/{index_id}` - # @!attribute [rw] display_name - # @return [::String] - # Optional. Optional user-specified display name of the index. - # @!attribute [rw] description - # @return [::String] - # Optional. Optional description of the index. - # @!attribute [r] state - # @return [::Google::Cloud::VisionAI::V1::Index::State] - # Output only. State of the index. - # @!attribute [r] create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The create timestamp. - # @!attribute [r] update_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The update timestamp. - # @!attribute [r] deployed_indexes - # @return [::Array<::Google::Cloud::VisionAI::V1::DeployedIndexReference>] - # Output only. References to the deployed index instance. - # Index of VIDEO_ON_DEMAND corpus can have at most one deployed index. - # Index of IMAGE corpus can have multiple deployed indexes. - # @!attribute [r] satisfies_pzs - # @return [::Boolean] - # Output only. This boolean field is only set for projects that have Physical - # Zone Separation enabled via an Org Policy constraint. It is set to true - # when the index is a valid zone separated index and false if it isn't. - # @!attribute [r] satisfies_pzi - # @return [::Boolean] - # Output only. This boolean field is only set for projects that have Physical - # Zone Isolation enabled via an Org Policy constraint. It is set to true when - # the index is a valid zone isolated index and false if it isn't. - class Index - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Enum representing the different states through which an Index might cycle - # during its lifetime. - module State - # The default value. Should not be used. - STATE_UNSPECIFIED = 0 - - # State CREATING. - CREATING = 1 - - # State CREATED. - CREATED = 2 - - # State UPDATING. - UPDATING = 3 - end - end - - # Points to a DeployedIndex. - # @!attribute [rw] index_endpoint - # @return [::String] - # Immutable. A resource name of the IndexEndpoint. - class DeployedIndexReference - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Corpus is a set of media contents for management. - # Within a corpus, media shares the same data schema. Search is also restricted - # within a single corpus. - # @!attribute [rw] name - # @return [::String] - # Resource name of the corpus. - # Format: - # `projects/{project_number}/locations/{location_id}/corpora/{corpus_id}` - # @!attribute [rw] display_name - # @return [::String] - # Required. The corpus name to shown in the UI. The name can be up to 32 - # characters long. - # @!attribute [rw] description - # @return [::String] - # Optional. Description of the corpus. Can be up to 25000 characters long. - # @!attribute [rw] default_ttl - # @return [::Google::Protobuf::Duration] - # Optional. The default TTL value for all assets under the corpus without a - # asset level user-defined TTL. For STREAM_VIDEO type corpora, this is - # required and the maximum allowed - # default_ttl is 10 years. - # @!attribute [rw] type - # @return [::Google::Cloud::VisionAI::V1::Corpus::Type] - # Optional. Type of the asset inside corpus. - # @!attribute [rw] search_capability_setting - # @return [::Google::Cloud::VisionAI::V1::SearchCapabilitySetting] - # Default search capability setting on corpus level. - # @!attribute [r] satisfies_pzs - # @return [::Boolean] - # Output only. This boolean field is only set for projects that have Physical - # Zone Separation enabled via an Org Policy constraint. It is set to true - # when the corpus is a valid zone separated corpus and false if it isn't. - # @!attribute [r] satisfies_pzi - # @return [::Boolean] - # Output only. This boolean field is only set for projects that have Physical - # Zone Isolation enabled via an Org Policy constraint. It is set to true when - # the corpus is a valid zone isolated corpus and false if it isn't. - class Corpus - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Type of the asset inside the corpus. - module Type - # The default type, not supposed to be used. If this default type is used, - # the corpus will be created as STREAM_VIDEO corpus. - TYPE_UNSPECIFIED = 0 - - # Asset is a live streaming video. - STREAM_VIDEO = 1 - - # Asset is an image. - IMAGE = 2 - - # Asset is a batch video. - VIDEO_ON_DEMAND = 3 - end - end - - # Request message for GetCorpus. - # @!attribute [rw] name - # @return [::String] - # Required. The resource name of the corpus to retrieve. - class GetCorpusRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for UpdateCorpus. - # @!attribute [rw] corpus - # @return [::Google::Cloud::VisionAI::V1::Corpus] - # Required. The corpus which replaces the resource on the server. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # The list of fields to be updated. - class UpdateCorpusRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for ListCorpora. - # @!attribute [rw] parent - # @return [::String] - # Required. The resource name of the project from which to list corpora. - # @!attribute [rw] page_size - # @return [::Integer] - # Requested page size. API may return fewer results than requested. - # If negative, INVALID_ARGUMENT error will be returned. - # If unspecified or 0, API will pick a default size, which is 10. - # If the requested page size is larger than the maximum size, API will pick - # use the maximum size, which is 20. - # @!attribute [rw] page_token - # @return [::String] - # A token identifying a page of results for the server to return. - # Typically obtained via - # {::Google::Cloud::VisionAI::V1::ListCorporaResponse#next_page_token ListCorporaResponse.next_page_token} - # of the previous - # {::Google::Cloud::VisionAI::V1::Warehouse::Client#list_corpora Warehouse.ListCorpora} - # call. - # @!attribute [rw] filter - # @return [::String] - # The filter applied to the returned corpora list. - # Only the following restrictions are supported: - # `type=`, - # `type!=`. - class ListCorporaRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for ListCorpora. - # @!attribute [rw] corpora - # @return [::Array<::Google::Cloud::VisionAI::V1::Corpus>] - # The corpora in the project. - # @!attribute [rw] next_page_token - # @return [::String] - # A token to retrieve next page of results. - # Pass to - # {::Google::Cloud::VisionAI::V1::ListCorporaRequest#page_token ListCorporaRequest.page_token} - # to obtain that page. - class ListCorporaResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for DeleteCorpus. - # @!attribute [rw] name - # @return [::String] - # Required. The resource name of the corpus to delete. - class DeleteCorpusRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for AnalyzeCorpus. - # @!attribute [rw] name - # @return [::String] - # Required. The parent corpus resource where the assets will be analyzed. - # Format: - # `projects/{project_number}/locations/{location_id}/corpora/{corpus_id}` - class AnalyzeCorpusRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The metadata message for AnalyzeCorpus LRO. - # @!attribute [rw] metadata - # @return [::Google::Cloud::VisionAI::V1::OperationMetadata] - # The metadata of the operation. - class AnalyzeCorpusMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The response message for AnalyzeCorpus LRO. - class AnalyzeCorpusResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for CreateDataSchema. - # @!attribute [rw] parent - # @return [::String] - # Required. The parent resource where this data schema will be created. - # Format: - # `projects/{project_number}/locations/{location_id}/corpora/{corpus_id}` - # @!attribute [rw] data_schema - # @return [::Google::Cloud::VisionAI::V1::DataSchema] - # Required. The data schema to create. - class CreateDataSchemaRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Data schema indicates how the user specified annotation is interpreted in the - # system. - # @!attribute [rw] name - # @return [::String] - # Resource name of the data schema in the form of: - # `projects/{project_number}/locations/{location}/corpora/{corpus}/dataSchemas/{data_schema}` - # where \\{data_schema} part should be the same as the `key` field below. - # @!attribute [rw] key - # @return [::String] - # Required. The key of this data schema. This key should be matching the key - # of user specified annotation and unique inside corpus. This value can be up - # to 63 characters, and valid characters are /[a-z][0-9]-/. The first - # character must be a letter, the last could be a letter or a number. - # @!attribute [rw] schema_details - # @return [::Google::Cloud::VisionAI::V1::DataSchemaDetails] - # The schema details mapping to the key. - class DataSchema - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Data schema details indicates the data type and the data struct corresponding - # to the key of user specified annotation. - # @!attribute [rw] type - # @return [::Google::Cloud::VisionAI::V1::DataSchemaDetails::DataType] - # Type of the annotation. - # @!attribute [rw] proto_any_config - # @return [::Google::Cloud::VisionAI::V1::DataSchemaDetails::ProtoAnyConfig] - # Config for protobuf any type. - # @!attribute [rw] list_config - # @return [::Google::Cloud::VisionAI::V1::DataSchemaDetails::ListConfig] - # Config for List data type. - # @!attribute [rw] customized_struct_config - # @return [::Google::Cloud::VisionAI::V1::DataSchemaDetails::CustomizedStructConfig] - # Config for CustomizedStruct data type. - # @!attribute [rw] granularity - # @return [::Google::Cloud::VisionAI::V1::DataSchemaDetails::Granularity] - # The granularity associated with this DataSchema. - # @!attribute [rw] search_strategy - # @return [::Google::Cloud::VisionAI::V1::DataSchemaDetails::SearchStrategy] - # The search strategy to be applied on the `key` above. - class DataSchemaDetails - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The configuration for `PROTO_ANY` data type. - # @!attribute [rw] type_uri - # @return [::String] - # The type URI of the proto message. - class ProtoAnyConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The configuration for `LIST` data type. - # @!attribute [rw] value_schema - # @return [::Google::Cloud::VisionAI::V1::DataSchemaDetails] - # The value's data schema in the list. - class ListConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The configuration for `CUSTOMIZED_STRUCT` data type. - # @!attribute [rw] field_schemas - # @return [::Google::Protobuf::Map{::String => ::Google::Cloud::VisionAI::V1::DataSchemaDetails}] - # Direct child elements data schemas. - class CustomizedStructConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::Google::Cloud::VisionAI::V1::DataSchemaDetails] - class FieldSchemasEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # The search strategy for annotations value of the `key`. - # @!attribute [rw] search_strategy_type - # @return [::Google::Cloud::VisionAI::V1::DataSchemaDetails::SearchStrategy::SearchStrategyType] - # The type of search strategy to be applied on the `key` above. - # The allowed `search_strategy_type` is different for different data types, - # which is documented in the DataSchemaDetails.DataType. Specifying - # unsupported `search_strategy_type` for data types will result in - # INVALID_ARGUMENT error. - # @!attribute [rw] confidence_score_index_config - # @return [::Google::Cloud::VisionAI::V1::DataSchemaDetails::SearchStrategy::ConfidenceScoreIndexConfig] - # Optional. Configs the path to the confidence score, and the threshold. - # Only if the score is greater than the threshold, current field will be - # built into the index. Only applies to leaf nodes using EXACT_SEARCH or - # SMART_SEARCH. - class SearchStrategy - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Filter on the confidence score. Only adds to index if the confidence - # score is higher than the threshold. - # Example data schema: - # key: "name-confidence-pair" - # type: CUSTOMIZED_STRUCT - # granularity: GRANULARITY_PARTITION_LEVEL - # customized_struct_config { - # field_schemas { - # key: "name" - # type: STRING - # granularity: GRANULARITY_PARTITION_LEVEL - # search_strategy { - # search_strategy_type: SMART_SEARCH - # confidence_score_index_config { - # field_path: "name-confidence-pair.score" - # threshold: 0.6 - # } - # } - # } - # field_schemas { - # key: "score" - # type: FLOAT - # granularity: GRANULARITY_PARTITION_LEVEL - # } - # } - # This means only "name" with score > 0.6 will be indexed. - # @!attribute [rw] field_path - # @return [::String] - # Required. The path to the confidence score field. It is a string that - # concatenates all the data schema keys along the path. See the example - # above. If the data schema contains LIST, use '_ENTRIES' to concatenate. - # Example data schema contains a list: - # "key": "list-name-score", - # "schemaDetails": { - # "type": "LIST", - # "granularity": "GRANULARITY_PARTITION_LEVEL", - # "listConfig": { - # "valueSchema": { - # "type": "CUSTOMIZED_STRUCT", - # "granularity": "GRANULARITY_PARTITION_LEVEL", - # "customizedStructConfig": { - # "fieldSchemas": { - # "name": { - # "type": "STRING", - # "granularity": "GRANULARITY_PARTITION_LEVEL", - # "searchStrategy": { - # "searchStrategyType": "SMART_SEARCH" - # "confidence_score_index_config": { - # "field_path": "list-name-score._ENTRIES.score", - # "threshold": "0.9", - # } - # } - # }, - # "score": { - # "type": "FLOAT", - # "granularity": "GRANULARITY_PARTITION_LEVEL", - # } - # } - # } - # } - # } - # } - # @!attribute [rw] threshold - # @return [::Float] - # Required. The threshold. - class ConfidenceScoreIndexConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The types of search strategies to be applied on the annotation key. - module SearchStrategyType - # Annotatation values of the `key` above will not be searchable. - NO_SEARCH = 0 - - # When searching with `key`, the value must be exactly as the annotation - # value that has been ingested. - EXACT_SEARCH = 1 - - # When searching with `key`, Warehouse will perform broad search based on - # semantic of the annotation value. - SMART_SEARCH = 2 - end - end - - # Data type of the annotation. - module DataType - # Unspecified type. - DATA_TYPE_UNSPECIFIED = 0 - - # Integer type. - # Allowed search strategies: - # - DataSchema.SearchStrategy.NO_SEARCH, - # - DataSchema.SearchStrategy.EXACT_SEARCH. - # Supports query by IntRangeArray. - INTEGER = 1 - - # Float type. - # Allowed search strategies: - # - DataSchema.SearchStrategy.NO_SEARCH, - # - DataSchema.SearchStrategy.EXACT_SEARCH. - # Supports query by FloatRangeArray. - FLOAT = 2 - - # String type. - # Allowed search strategies: - # - DataSchema.SearchStrategy.NO_SEARCH, - # - DataSchema.SearchStrategy.EXACT_SEARCH, - # - DataSchema.SearchStrategy.SMART_SEARCH. - STRING = 3 - - # Supported formats: - # %Y-%m-%dT%H:%M:%E*S%E*z (absl::RFC3339_full) - # %Y-%m-%dT%H:%M:%E*S - # %Y-%m-%dT%H:%M%E*z - # %Y-%m-%dT%H:%M - # %Y-%m-%dT%H%E*z - # %Y-%m-%dT%H - # %Y-%m-%d%E*z - # %Y-%m-%d - # %Y-%m - # %Y - # Allowed search strategies: - # - DataSchema.SearchStrategy.NO_SEARCH, - # - DataSchema.SearchStrategy.EXACT_SEARCH. - # Supports query by DateTimeRangeArray. - DATETIME = 5 - - # Geo coordinate type. - # Allowed search strategies: - # - DataSchema.SearchStrategy.NO_SEARCH, - # - DataSchema.SearchStrategy.EXACT_SEARCH. - # Supports query by GeoLocationArray. - GEO_COORDINATE = 7 - - # Type to pass any proto as available in annotations.proto. Only use - # internally. - # Available proto types and its corresponding search behavior: - # - ImageObjectDetectionPredictionResult, allows SMART_SEARCH on - # display_names and NO_SEARCH. - # - ClassificationPredictionResult, allows SMART_SEARCH on display_names - # and NO_SEARCH. - # - ImageSegmentationPredictionResult, allows NO_SEARCH. - # - VideoActionRecognitionPredictionResult, allows SMART_SEARCH on - # display_name and NO_SEARCH. - # - VideoObjectTrackingPredictionResult, allows SMART_SEARCH on - # display_name and NO_SEARCH. - # - VideoClassificationPredictionResult, allows SMART_SEARCH on - # display_name and NO_SEARCH. - # - OccupancyCountingPredictionResult, allows EXACT_SEARCH on - # stats.full_frame_count.count and NO_SEARCH. - # - ObjectDetectionPredictionResult, allows SMART_SEARCH on - # identified_boxes.entity.label_string and NO_SEARCH. - PROTO_ANY = 8 - - # Boolean type. - # Allowed search strategies: - # - DataSchema.SearchStrategy.NO_SEARCH, - # - DataSchema.SearchStrategy.EXACT_SEARCH. - BOOLEAN = 9 - - # List type. - # - Each element in the list must be of the exact same data schema; - # otherwise, they are invalid arguments. - # - List level cannot set search strategy. Leaf node level can do. - # - Elements cannot be another list (no list of list). - # - Elements can be CUSTOMIZED_STRUCT, and max number of layers is 10. - LIST = 10 - - # Struct type. - # - SearchStrategy: - # * Data Schema that's CUSTOMIZED_STRUCT cannot set search strategy. - # * Leaf-node elements allow setting search strategy based on element's - # SearchStrategy restriction. - # - Nested layer restrictions: - # * Data Schema that's CUSTOMIZED_STRUCT allows its fields to be of - # CUSTOMIZED_STRUCT as well, but the overall layers restriction is 10. - CUSTOMIZED_STRUCT = 6 - end - - # The granularity of annotations under this DataSchema. - module Granularity - # Unspecified granularity. - GRANULARITY_UNSPECIFIED = 0 - - # Asset-level granularity (annotations must not contain partition info). - GRANULARITY_ASSET_LEVEL = 1 - - # Partition-level granularity (annotations must contain partition info). - GRANULARITY_PARTITION_LEVEL = 2 - end - end - - # Request message for UpdateDataSchema. - # @!attribute [rw] data_schema - # @return [::Google::Cloud::VisionAI::V1::DataSchema] - # Required. The data schema's `name` field is used to identify the data - # schema to be updated. Format: - # `projects/{project_number}/locations/{location}/corpora/{corpus}/dataSchemas/{data_schema}` - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # The list of fields to be updated. - class UpdateDataSchemaRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for GetDataSchema. - # @!attribute [rw] name - # @return [::String] - # Required. The name of the data schema to retrieve. - # Format: - # `projects/{project_number}/locations/{location_id}/corpora/{corpus_id}/dataSchemas/{data_schema_id}` - class GetDataSchemaRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for DeleteDataSchema. - # @!attribute [rw] name - # @return [::String] - # Required. The name of the data schema to delete. - # Format: - # `projects/{project_number}/locations/{location_id}/corpora/{corpus_id}/dataSchemas/{data_schema_id}` - class DeleteDataSchemaRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for ListDataSchemas. - # @!attribute [rw] parent - # @return [::String] - # Required. The parent, which owns this collection of data schemas. - # Format: - # `projects/{project_number}/locations/{location_id}/corpora/{corpus_id}` - # @!attribute [rw] page_size - # @return [::Integer] - # The maximum number of data schemas to return. The service may return fewer - # than this value. If unspecified, at most 50 data schemas will be returned. - # The maximum value is 1000; values above 1000 will be coerced to 1000. - # @!attribute [rw] page_token - # @return [::String] - # A page token, received from a previous `ListDataSchemas` call. - # Provide this to retrieve the subsequent page. - # - # When paginating, all other parameters provided to `ListDataSchemas` must - # match the call that provided the page token. - class ListDataSchemasRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for ListDataSchemas. - # @!attribute [rw] data_schemas - # @return [::Array<::Google::Cloud::VisionAI::V1::DataSchema>] - # The data schemas from the specified corpus. - # @!attribute [rw] next_page_token - # @return [::String] - # A token, which can be sent as `page_token` to retrieve the next page. - # If this field is omitted, there are no subsequent pages. - class ListDataSchemasResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for CreateAnnotation. - # @!attribute [rw] parent - # @return [::String] - # Required. The parent resource where this annotation will be created. - # Format: - # `projects/{project_number}/locations/{location_id}/corpora/{corpus_id}/assets/{asset_id}` - # @!attribute [rw] annotation - # @return [::Google::Cloud::VisionAI::V1::Annotation] - # Required. The annotation to create. - # @!attribute [rw] annotation_id - # @return [::String] - # Optional. The ID to use for the annotation, which will become the final - # component of the annotation's resource name if user choose to specify. - # Otherwise, annotation id will be generated by system. - # - # This value should be up to 63 characters, and valid characters - # are /[a-z][0-9]-/. The first character must be a letter, the last could be - # a letter or a number. - class CreateAnnotationRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # An annotation is a resource in asset. It represents a key-value mapping of - # content in asset. - # @!attribute [rw] name - # @return [::String] - # Resource name of the annotation. - # Format: - # `projects/{project_number}/locations/{location}/corpora/{corpus}/assets/{asset}/annotations/{annotation}` - # @!attribute [rw] user_specified_annotation - # @return [::Google::Cloud::VisionAI::V1::UserSpecifiedAnnotation] - # User provided annotation. - class Annotation - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Annotation provided by users. - # @!attribute [rw] key - # @return [::String] - # Required. Key of the annotation. The key must be set with type by - # CreateDataSchema. - # @!attribute [rw] value - # @return [::Google::Cloud::VisionAI::V1::AnnotationValue] - # Value of the annotation. The value must be able to convert - # to the type according to the data schema. - # @!attribute [rw] partition - # @return [::Google::Cloud::VisionAI::V1::Partition] - # Partition information in time and space for the sub-asset level annotation. - class UserSpecifiedAnnotation - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Location Coordinate Representation - # @!attribute [rw] latitude - # @return [::Float] - # Latitude Coordinate. Degrees [-90 .. 90] - # @!attribute [rw] longitude - # @return [::Float] - # Longitude Coordinate. Degrees [-180 .. 180] - class GeoCoordinate - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Value of annotation, including all types available in data schema. - # @!attribute [rw] int_value - # @return [::Integer] - # Value of int type annotation. - # - # Note: The following fields are mutually exclusive: `int_value`, `float_value`, `str_value`, `datetime_value`, `geo_coordinate`, `proto_any_value`, `bool_value`, `customized_struct_data_value`, `list_value`, `customized_struct_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] float_value - # @return [::Float] - # Value of float type annotation. - # - # Note: The following fields are mutually exclusive: `float_value`, `int_value`, `str_value`, `datetime_value`, `geo_coordinate`, `proto_any_value`, `bool_value`, `customized_struct_data_value`, `list_value`, `customized_struct_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] str_value - # @return [::String] - # Value of string type annotation. - # - # Note: The following fields are mutually exclusive: `str_value`, `int_value`, `float_value`, `datetime_value`, `geo_coordinate`, `proto_any_value`, `bool_value`, `customized_struct_data_value`, `list_value`, `customized_struct_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] datetime_value - # @return [::String] - # Value of date time type annotation. - # - # Note: The following fields are mutually exclusive: `datetime_value`, `int_value`, `float_value`, `str_value`, `geo_coordinate`, `proto_any_value`, `bool_value`, `customized_struct_data_value`, `list_value`, `customized_struct_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] geo_coordinate - # @return [::Google::Cloud::VisionAI::V1::GeoCoordinate] - # Value of geo coordinate type annotation. - # - # Note: The following fields are mutually exclusive: `geo_coordinate`, `int_value`, `float_value`, `str_value`, `datetime_value`, `proto_any_value`, `bool_value`, `customized_struct_data_value`, `list_value`, `customized_struct_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] proto_any_value - # @return [::Google::Protobuf::Any] - # Value of any proto value. - # - # Note: The following fields are mutually exclusive: `proto_any_value`, `int_value`, `float_value`, `str_value`, `datetime_value`, `geo_coordinate`, `bool_value`, `customized_struct_data_value`, `list_value`, `customized_struct_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] bool_value - # @return [::Boolean] - # Value of boolean type annotation. - # - # Note: The following fields are mutually exclusive: `bool_value`, `int_value`, `float_value`, `str_value`, `datetime_value`, `geo_coordinate`, `proto_any_value`, `customized_struct_data_value`, `list_value`, `customized_struct_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] customized_struct_data_value - # @return [::Google::Protobuf::Struct] - # Value of customized struct annotation. This field does not have effects. - # Use customized_struct_value instead for customized struct annotation. - # - # Note: The following fields are mutually exclusive: `customized_struct_data_value`, `int_value`, `float_value`, `str_value`, `datetime_value`, `geo_coordinate`, `proto_any_value`, `bool_value`, `list_value`, `customized_struct_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] list_value - # @return [::Google::Cloud::VisionAI::V1::AnnotationList] - # Value of list type annotation. - # - # Note: The following fields are mutually exclusive: `list_value`, `int_value`, `float_value`, `str_value`, `datetime_value`, `geo_coordinate`, `proto_any_value`, `bool_value`, `customized_struct_data_value`, `customized_struct_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] customized_struct_value - # @return [::Google::Cloud::VisionAI::V1::AnnotationCustomizedStruct] - # Value of custom struct type annotation. - # - # Note: The following fields are mutually exclusive: `customized_struct_value`, `int_value`, `float_value`, `str_value`, `datetime_value`, `geo_coordinate`, `proto_any_value`, `bool_value`, `customized_struct_data_value`, `list_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. - class AnnotationValue - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # List representation in annotation. - # @!attribute [rw] values - # @return [::Array<::Google::Cloud::VisionAI::V1::AnnotationValue>] - # The values of `LIST` data type annotation. - class AnnotationList - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Customized struct represnation in annotation. - # @!attribute [rw] elements - # @return [::Google::Protobuf::Map{::String => ::Google::Cloud::VisionAI::V1::AnnotationValue}] - # A map from elements' keys to element's annotation value. - class AnnotationCustomizedStruct - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::Google::Cloud::VisionAI::V1::AnnotationValue] - class ElementsEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Request message for GetAnnotation API. - # @!attribute [rw] parent - # @return [::String] - # The parent, which owns this collection of annotations. - # Format: - # `projects/{project_number}/locations/{location}/corpora/{corpus}/assets/{asset}` - # @!attribute [rw] page_size - # @return [::Integer] - # The maximum number of annotations to return. The service may return fewer - # than this value. If unspecified, at most 50 annotations will be returned. - # The maximum value is 1000; values above 1000 will be coerced to 1000. - # @!attribute [rw] page_token - # @return [::String] - # A page token, received from a previous `ListAnnotations` call. - # Provide this to retrieve the subsequent page. - # - # When paginating, all other parameters provided to `ListAnnotations` must - # match the call that provided the page token. - # @!attribute [rw] filter - # @return [::String] - # The filter applied to the returned list. - # We only support filtering for the following fields: - # For corpus of STREAM_VIDEO type: - # `partition.temporal_partition.start_time`, - # `partition.temporal_partition.end_time`, and `key`. - # For corpus of VIDEO_ON_DEMAND type, - # `partition.relative_temporal_partition.start_offset`, - # `partition.relative_temporal_partition.end_offset`, and `key`. - # For corpus of IMAGE type, only `key` is supported. - # Timestamps are specified in the RFC-3339 format, and only one restriction - # may be applied per field, joined by conjunctions. - # Format: - # "partition.temporal_partition.start_time > "2012-04-21T11:30:00-04:00" AND - # partition.temporal_partition.end_time < "2012-04-22T11:30:00-04:00" AND - # key = "example_key"" - class ListAnnotationsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for ListAnnotations API. - # @!attribute [rw] annotations - # @return [::Array<::Google::Cloud::VisionAI::V1::Annotation>] - # The annotations from the specified asset. - # @!attribute [rw] next_page_token - # @return [::String] - # A token, which can be sent as `page_token` to retrieve the next page. - # If this field is omitted, there are no subsequent pages. - class ListAnnotationsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for GetAnnotation API. - # @!attribute [rw] name - # @return [::String] - # Required. The name of the annotation to retrieve. - # Format: - # `projects/{project_number}/locations/{location}/corpora/{corpus}/assets/{asset}/annotations/{annotation}` - class GetAnnotationRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for UpdateAnnotation API. - # @!attribute [rw] annotation - # @return [::Google::Cloud::VisionAI::V1::Annotation] - # Required. The annotation to update. - # The annotation's `name` field is used to identify the annotation to be - # updated. Format: - # `projects/{project_number}/locations/{location}/corpora/{corpus}/assets/{asset}/annotations/{annotation}` - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # The list of fields to be updated. - class UpdateAnnotationRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for DeleteAnnotation API. - # @!attribute [rw] name - # @return [::String] - # Required. The name of the annotation to delete. - # Format: - # `projects/{project_number}/locations/{location}/corpora/{corpus}/assets/{asset}/annotations/{annotation}` - class DeleteAnnotationRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The request message for ImportAssets. - # @!attribute [rw] assets_gcs_uri - # @return [::String] - # The file contains all assets information to be imported. - # * The file is in JSONL format. - # * Each line corresponding to one asset. - # * Each line will be converted into InputImageAsset proto. - # @!attribute [rw] parent - # @return [::String] - # Required. The parent corpus resource where the assets will be imported. - # Format: - # `projects/{project_number}/locations/{location_id}/corpora/{corpus_id}` - class ImportAssetsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The metadata message for ImportAssets LRO. - # @!attribute [rw] metadata - # @return [::Google::Cloud::VisionAI::V1::OperationMetadata] - # The metadata of the operation. - # @!attribute [rw] status - # @return [::Google::Cloud::VisionAI::V1::BatchOperationStatus] - # The importing status including partial failures, if the implementation can - # provide such information during the progress of the ImportAssets. - class ImportAssetsMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The batch operation status. - # @!attribute [rw] success_count - # @return [::Integer] - # The count of assets (together with their annotations if any) successfully - # ingested. - # @!attribute [rw] failure_count - # @return [::Integer] - # The count of assets failed to ingested; it might be due to the annotation - # ingestion error. - class BatchOperationStatus - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The response message for ImportAssets LRO. - class ImportAssetsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for CreateSearchConfig. - # @!attribute [rw] parent - # @return [::String] - # Required. The parent resource where this search configuration will be - # created. Format: - # `projects/{project_number}/locations/{location_id}/corpora/{corpus_id}` - # @!attribute [rw] search_config - # @return [::Google::Cloud::VisionAI::V1::SearchConfig] - # Required. The search config to create. - # @!attribute [rw] search_config_id - # @return [::String] - # Required. ID to use for the new search config. Will become the final - # component of the SearchConfig's resource name. This value should be up to - # 63 characters, and valid characters are /[a-z][0-9]-_/. The first character - # must be a letter, the last could be a letter or a number. - class CreateSearchConfigRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for UpdateSearchConfig. - # @!attribute [rw] search_config - # @return [::Google::Cloud::VisionAI::V1::SearchConfig] - # Required. The search configuration to update. - # - # The search configuration's `name` field is used to identify the resource to - # be updated. Format: - # `projects/{project_number}/locations/{location}/corpora/{corpus}/searchConfigs/{search_config}` - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # The list of fields to be updated. If left unset, all field paths will be - # updated/overwritten. - class UpdateSearchConfigRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for GetSearchConfig. - # @!attribute [rw] name - # @return [::String] - # Required. The name of the search configuration to retrieve. - # Format: - # `projects/{project_number}/locations/{location}/corpora/{corpus}/searchConfigs/{search_config}` - class GetSearchConfigRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for DeleteSearchConfig. - # @!attribute [rw] name - # @return [::String] - # Required. The name of the search configuration to delete. - # Format: - # `projects/{project_number}/locations/{location}/corpora/{corpus}/searchConfigs/{search_config}` - class DeleteSearchConfigRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for ListSearchConfigs. - # @!attribute [rw] parent - # @return [::String] - # Required. The parent, which owns this collection of search configurations. - # Format: - # `projects/{project_number}/locations/{location}/corpora/{corpus}` - # @!attribute [rw] page_size - # @return [::Integer] - # The maximum number of search configurations to return. The service may - # return fewer than this value. If unspecified, a page size of 50 will be - # used. The maximum value is 1000; values above 1000 will be coerced to 1000. - # @!attribute [rw] page_token - # @return [::String] - # A page token, received from a previous `ListSearchConfigs` call. - # Provide this to retrieve the subsequent page. - # - # When paginating, all other parameters provided to - # `ListSearchConfigs` must match the call that provided the page - # token. - class ListSearchConfigsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for ListSearchConfigs. - # @!attribute [rw] search_configs - # @return [::Array<::Google::Cloud::VisionAI::V1::SearchConfig>] - # The search configurations from the specified corpus. - # @!attribute [rw] next_page_token - # @return [::String] - # A token, which can be sent as `page_token` to retrieve the next page. - # If this field is omitted, there are no subsequent pages. - class ListSearchConfigsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # SearchConfig stores different properties that will affect search - # behaviors and search results. - # @!attribute [rw] name - # @return [::String] - # Resource name of the search configuration. - # For CustomSearchCriteria, search_config would be the search - # operator name. For Facets, search_config would be the facet - # dimension name. - # Format: - # `projects/{project_number}/locations/{location}/corpora/{corpus}/searchConfigs/{search_config}` - # @!attribute [rw] facet_property - # @return [::Google::Cloud::VisionAI::V1::FacetProperty] - # Establishes a FacetDimension and associated specifications. - # @!attribute [rw] search_criteria_property - # @return [::Google::Cloud::VisionAI::V1::SearchCriteriaProperty] - # Creates a mapping between a custom SearchCriteria and one or more UGA keys. - class SearchConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Message representing IndexEndpoint resource. Indexes are deployed into it. - # @!attribute [r] name - # @return [::String] - # Output only. Resource name of the IndexEndpoint. - # Format: - # `projects/{project}/locations/{location}/indexEndpoints/{index_endpoint_id}` - # @!attribute [rw] display_name - # @return [::String] - # Optional. Display name of the IndexEndpoint. Can be up to 32 characters - # long. - # @!attribute [rw] description - # @return [::String] - # Optional. Description of the IndexEndpoint. Can be up to 25000 characters - # long. - # @!attribute [r] deployed_index - # @return [::Google::Cloud::VisionAI::V1::DeployedIndex] - # Output only. The Index deployed in this IndexEndpoint. - # @!attribute [r] state - # @return [::Google::Cloud::VisionAI::V1::IndexEndpoint::State] - # Output only. IndexEndpoint state. - # @!attribute [rw] labels - # @return [::Google::Protobuf::Map{::String => ::String}] - # Optional. The labels applied to a resource must meet the following - # requirements: - # - # * Each resource can have multiple labels, up to a maximum of 64. - # * Each label must be a key-value pair. - # * Keys have a minimum length of 1 character and a maximum length of 63 - # characters and cannot be empty. Values can be empty and have a maximum - # length of 63 characters. - # * Keys and values can contain only lowercase letters, numeric characters, - # underscores, and dashes. All characters must use UTF-8 encoding, and - # international characters are allowed. - # * The key portion of a label must be unique. However, you can use the same - # key with multiple resources. - # * Keys must start with a lowercase letter or international character. - # - # See [Google Cloud - # Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements) - # for more details. - # @!attribute [r] create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. Create timestamp. - # @!attribute [r] update_time - # @return [::Google::Protobuf::Timestamp] - # Output only. Update timestamp. - # @!attribute [r] satisfies_pzs - # @return [::Boolean] - # Output only. This boolean field is only set for projects that have Physical - # Zone Separation enabled via an Org Policy constraint. It is set to true - # when the index endpoint is a valid zone separated index endpoint and false - # if it isn't. - # @!attribute [r] satisfies_pzi - # @return [::Boolean] - # Output only. This boolean field is only set for projects that have Physical - # Zone Isolation enabled via an Org Policy constraint. It is set to true when - # the index endpoint is a valid zone isolated index endpoint and false if it - # isn't. - class IndexEndpoint - 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 - - # IndexEndpoint stage. - module State - # The default value. Should not be used. - STATE_UNSPECIFIED = 0 - - # State CREATING. - CREATING = 1 - - # State CREATED. - CREATED = 2 - - # State UPDATING. - UPDATING = 3 - - # State FAILED. - FAILED = 4 - end - end - - # Request message for CreateIndexEndpoint. - # @!attribute [rw] parent - # @return [::String] - # Required. Format: `projects/{project}/locations/{location}` - # @!attribute [rw] index_endpoint_id - # @return [::String] - # Optional. The ID to use for the IndexEndpoint, which will become the final - # component of the IndexEndpoint's resource name if the user specifies it. - # Otherwise, IndexEndpoint id will be autogenerated. - # - # This value should be up to 63 characters, and valid characters - # are a-z, 0-9 and dash (-). The first character must be a letter, the last - # must be a letter or a number. - # @!attribute [rw] index_endpoint - # @return [::Google::Cloud::VisionAI::V1::IndexEndpoint] - # Required. The resource being created. - class CreateIndexEndpointRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Metadata message for CreateIndexEndpoint. - # @!attribute [rw] operation_metadata - # @return [::Google::Cloud::VisionAI::V1::OperationMetadata] - # Common metadata of the long-running operation. - class CreateIndexEndpointMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for GetIndexEndpoint. - # @!attribute [rw] name - # @return [::String] - # Required. Name of the IndexEndpoint resource. - class GetIndexEndpointRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for ListIndexEndpoints. - # @!attribute [rw] parent - # @return [::String] - # Required. Format: `projects/{project}/locations/{location}` - # @!attribute [rw] page_size - # @return [::Integer] - # Optional. Requested page size. Server may return fewer items than - # requested. The service may return fewer than this value. If unspecified, a - # page size of 50 will be used. The maximum value is 1000; values above 1000 - # will be coerced to 1000. - # @!attribute [rw] page_token - # @return [::String] - # Optional. A token identifying a page of results the server should return. - # @!attribute [rw] filter - # @return [::String] - # Optional. The filter applied to the returned list. - # We only support filtering for the `deployed_image_index.image_index` field. - # However, to filter by a corpus instead of an image index, simply use - # `deployed_image_index.corpus`, which will return all endpoints with - # `deployed_image_index.image_index` inside of the given corpus. - # A basic filter on image index would look like: - # deployed_image_index.image_index = - # "projects/123/locations/us-central1/corpora/my_corpus/imageIndexes/my_image_index" - # A basic filter on corpus would look like: - # deployed_image_index.corpus = - # "projects/123/locations/us-central1/corpora/my_corpus" - class ListIndexEndpointsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for ListIndexEndpoints. - # @!attribute [rw] index_endpoints - # @return [::Array<::Google::Cloud::VisionAI::V1::IndexEndpoint>] - # The list of IndexEndpoints. - # @!attribute [rw] next_page_token - # @return [::String] - # A token identifying a page of results the server should return. - class ListIndexEndpointsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for UpdateIndexEndpoint. - # @!attribute [rw] index_endpoint - # @return [::Google::Cloud::VisionAI::V1::IndexEndpoint] - # Required. The resource being updated. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # Required. Field mask is used to specify the fields to be overwritten in the - # IndexEndpoint resource by the update. - # The fields specified in the update_mask are relative to the resource, not - # the full request. - # A field of the resource will be overwritten if it is in the mask. - # Empty field mask is not allowed. - # If the mask is "*", then this is a full replacement of the resource. - class UpdateIndexEndpointRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Metadata message for UpdateIndexEndpoint. - # @!attribute [rw] operation_metadata - # @return [::Google::Cloud::VisionAI::V1::OperationMetadata] - # Common metadata of the long-running operation. - class UpdateIndexEndpointMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for DeleteIndexEndpoint. - # @!attribute [rw] name - # @return [::String] - # Required. Name of the resource. - class DeleteIndexEndpointRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Metadata message for DeleteIndexEndpoint. - # @!attribute [rw] operation_metadata - # @return [::Google::Cloud::VisionAI::V1::OperationMetadata] - # Common metadata of the long-running operation. - class DeleteIndexEndpointMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for DeployIndex. - # @!attribute [rw] index_endpoint - # @return [::String] - # Required. IndexEndpoint the index is deployed to. - # Format: - # `projects/{project}/locations/{location}/indexEndpoints/{index_endpoint}` - # @!attribute [rw] deployed_index - # @return [::Google::Cloud::VisionAI::V1::DeployedIndex] - # Required. Index to deploy. - class DeployIndexRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # DeployIndex response once the operation is done. - class DeployIndexResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Metadata message for DeployIndex. - # @!attribute [rw] operation_metadata - # @return [::Google::Cloud::VisionAI::V1::OperationMetadata] - # Common metadata of the long-running operation. - # @!attribute [r] deployed_index - # @return [::String] - # Output only. The index being deployed. - class DeployIndexMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Metadata message for UndeployIndex. - # @!attribute [rw] operation_metadata - # @return [::Google::Cloud::VisionAI::V1::OperationMetadata] - # Common metadata of the long-running operation. - # @!attribute [r] deployed_index - # @return [::String] - # Output only. The index being undeployed. - class UndeployIndexMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for UndeployIndexEndpoint. - # @!attribute [rw] index_endpoint - # @return [::String] - # Required. Resource name of the IndexEndpoint resource on which the - # undeployment will act. Format: - # `projects/{project}/locations/{location}/indexEndpoints/{index_endpoint}` - class UndeployIndexRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # UndeployIndex response once the operation is done. - class UndeployIndexResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A deployment of an Index. - # @!attribute [rw] index - # @return [::String] - # Required. Name of the deployed Index. - # Format: - # `projects/{project_number}/locations/{location_id}/corpora/{corpus_id}/indexes/{index_id}` - class DeployedIndex - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Central configuration for a facet. - # @!attribute [rw] fixed_range_bucket_spec - # @return [::Google::Cloud::VisionAI::V1::FacetProperty::FixedRangeBucketSpec] - # Fixed range facet bucket config. - # - # Note: The following fields are mutually exclusive: `fixed_range_bucket_spec`, `custom_range_bucket_spec`, `datetime_bucket_spec`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] custom_range_bucket_spec - # @return [::Google::Cloud::VisionAI::V1::FacetProperty::CustomRangeBucketSpec] - # Custom range facet bucket config. - # - # Note: The following fields are mutually exclusive: `custom_range_bucket_spec`, `fixed_range_bucket_spec`, `datetime_bucket_spec`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] datetime_bucket_spec - # @return [::Google::Cloud::VisionAI::V1::FacetProperty::DateTimeBucketSpec] - # Datetime range facet bucket config. - # - # Note: The following fields are mutually exclusive: `datetime_bucket_spec`, `fixed_range_bucket_spec`, `custom_range_bucket_spec`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] mapped_fields - # @return [::Array<::String>] - # Name of the facets, which are the dimensions users want to use to refine - # search results. `mapped_fields` will match UserSpecifiedDataSchema keys. - # - # For example, user can add a bunch of UGAs with the same key, such as - # player:adam, player:bob, player:charles. When multiple mapped_fields are - # specified, will merge their value together as final facet value. E.g. - # home_team: a, home_team:b, away_team:a, away_team:c, when facet_field = - # [home_team, away_team], facet_value will be [a, b, c]. - # - # UNLESS this is a 1:1 facet dimension (mapped_fields.size() == 1) AND the - # mapped_field equals the parent SearchConfig.name, the parent must - # also contain a SearchCriteriaProperty that maps to the same fields. - # mapped_fields must not be empty. - # @!attribute [rw] display_name - # @return [::String] - # Display name of the facet. To be used by UI for facet rendering. - # @!attribute [rw] result_size - # @return [::Integer] - # Maximum number of unique bucket to return for one facet. Bucket number can - # be large for high-cardinality facet such as "player". We only return top-n - # most related ones to user. If it's <= 0, the server will decide the - # appropriate result_size. - # @!attribute [rw] bucket_type - # @return [::Google::Cloud::VisionAI::V1::FacetBucketType] - # Facet bucket type e.g. value, range. - class FacetProperty - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # If bucket type is FIXED_RANGE, specify how values are bucketized. Use - # FixedRangeBucketSpec when you want to create multiple buckets with equal - # granularities. Using integer bucket value as an example, when - # bucket_start = 0, bucket_granularity = 10, bucket_count = 5, this facet - # will be aggregated via the following buckets: - # [-inf, 0), [0, 10), [10, 20), [20, 30), [30, inf). - # Notably, bucket_count <= 1 is an invalid spec. - # @!attribute [rw] bucket_start - # @return [::Google::Cloud::VisionAI::V1::FacetValue] - # Lower bound of the bucket. NOTE: Only integer type is currently supported - # for this field. - # @!attribute [rw] bucket_granularity - # @return [::Google::Cloud::VisionAI::V1::FacetValue] - # Bucket granularity. NOTE: Only integer type is currently supported for - # this field. - # @!attribute [rw] bucket_count - # @return [::Integer] - # Total number of buckets. - class FixedRangeBucketSpec - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # If bucket type is CUSTOM_RANGE, specify how values are bucketized. Use - # integer bucket value as an example, when the endpoints are 0, 10, 100, and - # 1000, we will generate the following facets: - # [-inf, 0), [0, 10), [10, 100), [100, 1000), [1000, inf). - # Notably: - # - endpoints must be listed in ascending order. Otherwise, the SearchConfig - # API will reject the facet config. - # - < 1 endpoints is an invalid spec. - # @!attribute [rw] endpoints - # @return [::Array<::Google::Cloud::VisionAI::V1::FacetValue>] - # Currently, only integer type is supported for this field. - class CustomRangeBucketSpec - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # If bucket type is DATE, specify how date values are bucketized. - # @!attribute [rw] granularity - # @return [::Google::Cloud::VisionAI::V1::FacetProperty::DateTimeBucketSpec::Granularity] - # Granularity of date type facet. - class DateTimeBucketSpec - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Granularity enum for the datetime bucket. - module Granularity - # Unspecified granularity. - GRANULARITY_UNSPECIFIED = 0 - - # Granularity is year. - YEAR = 1 - - # Granularity is month. - MONTH = 2 - - # Granularity is day. - DAY = 3 - end - end - end - - # Search resource: SearchHypernym. - # For example, - # { hypernym: "vehicle" - # hyponyms: ["sedan", "truck"] } - # This means in SMART_SEARCH mode, searching for "vehicle" will also return - # results with "sedan" or "truck" as annotations. - # @!attribute [rw] name - # @return [::String] - # Resource name of the SearchHypernym. - # Format: - # `projects/{project_number}/locations/{location}/corpora/{corpus}/searchHypernyms/{search_hypernym}` - # @!attribute [rw] hypernym - # @return [::String] - # Optional. The hypernym. - # @!attribute [rw] hyponyms - # @return [::Array<::String>] - # Optional. Hyponyms that the hypernym is mapped to. - class SearchHypernym - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for creating SearchHypernym. - # @!attribute [rw] parent - # @return [::String] - # Required. The parent resource where this SearchHypernym will be created. - # Format: `projects/{project_number}/locations/{location}/corpora/{corpus}` - # @!attribute [rw] search_hypernym - # @return [::Google::Cloud::VisionAI::V1::SearchHypernym] - # Required. The SearchHypernym to create. - # @!attribute [rw] search_hypernym_id - # @return [::String] - # Optional. The search hypernym id. - # If omitted, a random UUID will be generated. - class CreateSearchHypernymRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for updating SearchHypernym. - # @!attribute [rw] search_hypernym - # @return [::Google::Cloud::VisionAI::V1::SearchHypernym] - # Required. The SearchHypernym to update. - # The search hypernym's `name` field is used to identify the search hypernym - # to be updated. Format: - # `projects/{project_number}/locations/{location}/corpora/{corpus}/searchHypernyms/{search_hypernym}` - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # The list of fields to be updated. If left unset, all field paths will be - # updated/overwritten. - class UpdateSearchHypernymRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for getting SearchHypernym. - # @!attribute [rw] name - # @return [::String] - # Required. The name of the SearchHypernym to retrieve. - # Format: - # `projects/{project_number}/locations/{location}/corpora/{corpus}/searchHypernyms/{search_hypernym}` - class GetSearchHypernymRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for deleting SearchHypernym. - # @!attribute [rw] name - # @return [::String] - # Required. The name of the SearchHypernym to delete. - # Format: - # `projects/{project_number}/locations/{location}/corpora/{corpus}/searchHypernyms/{search_hypernym}` - class DeleteSearchHypernymRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for listing SearchHypernyms. - # @!attribute [rw] parent - # @return [::String] - # Required. The parent, which owns this collection of SearchHypernyms. - # Format: - # `projects/{project_number}/locations/{location}/corpora/{corpus}` - # @!attribute [rw] page_size - # @return [::Integer] - # The maximum number of SearchHypernyms returned. The service may - # return fewer than this value. If unspecified, a page size of 50 will be - # used. The maximum value is 1000; values above 1000 will be coerced to 1000. - # @!attribute [rw] page_token - # @return [::String] - # A page token, received from a previous `SearchHypernym` call. - # Provide this to retrieve the subsequent page. - # - # When paginating, all other parameters provided to - # `SearchHypernym` must match the call that provided the page - # token. - class ListSearchHypernymsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for listing SearchHypernyms. - # @!attribute [rw] search_hypernyms - # @return [::Array<::Google::Cloud::VisionAI::V1::SearchHypernym>] - # The SearchHypernyms from the specified corpus. - # @!attribute [rw] next_page_token - # @return [::String] - # A token, which can be sent as `page_token` to retrieve the next page. - # If this field is omitted, there are no subsequent pages. - class ListSearchHypernymsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Central configuration for custom search criteria. - # @!attribute [rw] mapped_fields - # @return [::Array<::String>] - # Each mapped_field corresponds to a UGA key. To understand how this property - # works, take the following example. In the SearchConfig table, the - # user adds this entry: - # search_config { - # name: "person" - # search_criteria_property { - # mapped_fields: "player" - # mapped_fields: "coach" - # } - # } - # - # Now, when a user issues a query like: - # criteria { - # field: "person" - # text_array { - # txt_values: "Tom Brady" - # txt_values: "Bill Belichick" - # } - # } - # - # MWH search will return search documents where (player=Tom Brady || - # coach=Tom Brady || player=Bill Belichick || coach=Bill Belichick). - class SearchCriteriaProperty - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Definition of a single value with generic type. - # @!attribute [rw] string_value - # @return [::String] - # String type value. - # - # Note: The following fields are mutually exclusive: `string_value`, `integer_value`, `datetime_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] integer_value - # @return [::Integer] - # Integer type value. - # - # Note: The following fields are mutually exclusive: `integer_value`, `string_value`, `datetime_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] datetime_value - # @return [::Google::Type::DateTime] - # Datetime type value. - # - # Note: The following fields are mutually exclusive: `datetime_value`, `string_value`, `integer_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. - class FacetValue - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Holds the facet value, selections state, and metadata. - # @!attribute [rw] value - # @return [::Google::Cloud::VisionAI::V1::FacetValue] - # Singular value. - # - # Note: The following fields are mutually exclusive: `value`, `range`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] range - # @return [::Google::Cloud::VisionAI::V1::FacetBucket::Range] - # Range value. - # - # Note: The following fields are mutually exclusive: `range`, `value`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] selected - # @return [::Boolean] - # Whether one facet bucket is selected. This field represents user's facet - # selection. It is set by frontend in SearchVideosRequest. - class FacetBucket - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The range of values [start, end) for which faceting is applied. - # @!attribute [rw] start - # @return [::Google::Cloud::VisionAI::V1::FacetValue] - # Start of the range. Non-existence indicates some bound (e.g. -inf). - # @!attribute [rw] end - # @return [::Google::Cloud::VisionAI::V1::FacetValue] - # End of the range. Non-existence indicates some bound (e.g. inf). - class Range - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # A group of facet buckets to be passed back and forth between backend & - # frontend. - # @!attribute [rw] facet_id - # @return [::String] - # Unique id of the facet group. - # @!attribute [rw] display_name - # @return [::String] - # Display name of the facet. To be used by UI for facet rendering. - # @!attribute [rw] buckets - # @return [::Array<::Google::Cloud::VisionAI::V1::FacetBucket>] - # Buckets associated with the facet. E.g. for "Team" facet, the bucket - # can be 49ers, patriots, etc. - # @!attribute [rw] bucket_type - # @return [::Google::Cloud::VisionAI::V1::FacetBucketType] - # Facet bucket type. - # @!attribute [rw] fetch_matched_annotations - # @return [::Boolean] - # If true, return query matched annotations for this facet group's selection. - # This option is only applicable for facets based on partition level - # annotations. It supports the following facet values: - # - INTEGER - # - STRING (DataSchema.SearchStrategy.EXACT_SEARCH only) - class FacetGroup - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for IngestAsset API. - # @!attribute [rw] config - # @return [::Google::Cloud::VisionAI::V1::IngestAssetRequest::Config] - # Provides information for the data and the asset resource name that the - # data belongs to. The first `IngestAssetRequest` message must only contain - # a `Config` message. - # - # Note: The following fields are mutually exclusive: `config`, `time_indexed_data`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] time_indexed_data - # @return [::Google::Cloud::VisionAI::V1::IngestAssetRequest::TimeIndexedData] - # Data to be ingested. - # - # Note: The following fields are mutually exclusive: `time_indexed_data`, `config`. If a field in that set is populated, all other fields in the set will automatically be cleared. - class IngestAssetRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Configuration for the data. - # @!attribute [rw] video_type - # @return [::Google::Cloud::VisionAI::V1::IngestAssetRequest::Config::VideoType] - # Type information for video data. - # @!attribute [rw] asset - # @return [::String] - # Required. The resource name of the asset that the ingested data belongs - # to. - class Config - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Type information for video data. - # @!attribute [rw] container_format - # @return [::Google::Cloud::VisionAI::V1::IngestAssetRequest::Config::VideoType::ContainerFormat] - # Container format of the video data. - class VideoType - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Container format of the video. - module ContainerFormat - # The default type, not supposed to be used. - CONTAINER_FORMAT_UNSPECIFIED = 0 - - # Mp4 container format. - CONTAINER_FORMAT_MP4 = 1 - end - end - end - - # Contains the data and the corresponding time range this data is for. - # @!attribute [rw] data - # @return [::String] - # Data to be ingested. - # @!attribute [rw] temporal_partition - # @return [::Google::Cloud::VisionAI::V1::Partition::TemporalPartition] - # Time range of the data. - class TimeIndexedData - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Response message for IngestAsset API. - # @!attribute [rw] successfully_ingested_partition - # @return [::Google::Cloud::VisionAI::V1::Partition::TemporalPartition] - # Time range of the data that has been successfully ingested. - class IngestAssetResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for ClipAsset API. - # @!attribute [rw] name - # @return [::String] - # Required. The resource name of the asset to request clips for. - # Format: - # `projects/{project_number}/locations/{location_id}/corpora/{corpus_id}/assets/{asset_id}` - # @!attribute [rw] temporal_partition - # @return [::Google::Cloud::VisionAI::V1::Partition::TemporalPartition] - # Required. The time range to request clips for. - class ClipAssetRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for ClipAsset API. - # @!attribute [rw] time_indexed_uris - # @return [::Array<::Google::Cloud::VisionAI::V1::ClipAssetResponse::TimeIndexedUri>] - # A list of signed uris to download the video clips that cover the requested - # time range ordered by time. - class ClipAssetResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Signed uri with corresponding time range. - # @!attribute [rw] temporal_partition - # @return [::Google::Cloud::VisionAI::V1::Partition::TemporalPartition] - # Time range of the video that the uri is for. - # @!attribute [rw] uri - # @return [::String] - # Signed uri to download the video clip. - class TimeIndexedUri - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Request message for GenerateHlsUri API. - # @!attribute [rw] name - # @return [::String] - # Required. The resource name of the asset to request clips for. - # Format: - # `projects/{project_number}/locations/{location_id}/corpora/{corpus_id}/assets/{asset_id}` - # @!attribute [rw] temporal_partitions - # @return [::Array<::Google::Cloud::VisionAI::V1::Partition::TemporalPartition>] - # The time range to request clips for. Will be ignored if `get_live_view` is - # set to True. The total time range requested should be smaller than 24h. - # @!attribute [rw] live_view_enabled - # @return [::Boolean] - # Option to exclusively show a livestream of the asset with up to 3 minutes - # of backlog data. - class GenerateHlsUriRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for GenerateHlsUri API. - # @!attribute [rw] uri - # @return [::String] - # A signed uri to download the HLS manifest corresponding to the requested - # times. - # @!attribute [rw] temporal_partitions - # @return [::Array<::Google::Cloud::VisionAI::V1::Partition::TemporalPartition>] - # A list of temporal partitions of the content returned in the order they - # appear in the stream. - class GenerateHlsUriResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for SearchAssets. - # @!attribute [rw] schema_key_sorting_strategy - # @return [::Google::Cloud::VisionAI::V1::SchemaKeySortingStrategy] - # Sort by the value under the data schema key. - # @!attribute [rw] corpus - # @return [::String] - # Required. The parent corpus to search. - # Format: `projects/{project_id}/locations/{location_id}/corpora/{corpus_id}' - # @!attribute [rw] page_size - # @return [::Integer] - # The number of results to be returned in this page. If it's 0, the server - # will decide the appropriate page_size. - # @!attribute [rw] page_token - # @return [::String] - # The continuation token to fetch the next page. If empty, it means it is - # fetching the first page. - # @!attribute [rw] content_time_ranges - # @return [::Google::Cloud::VisionAI::V1::DateTimeRangeArray] - # Time ranges that matching video content must fall within. If no ranges are - # provided, there will be no time restriction. This field is treated just - # like the criteria below, but defined separately for convenience as it is - # used frequently. Note that if the end_time is in the future, it will be - # clamped to the time the request was received. - # @!attribute [rw] criteria - # @return [::Array<::Google::Cloud::VisionAI::V1::Criteria>] - # Criteria applied to search results. - # @!attribute [rw] facet_selections - # @return [::Array<::Google::Cloud::VisionAI::V1::FacetGroup>] - # Stores most recent facet selection state. Only facet groups with user's - # selection will be presented here. Selection state is either selected or - # unselected. Only selected facet buckets will be used as search criteria. - # @!attribute [rw] result_annotation_keys - # @return [::Array<::String>] - # A list of annotation keys to specify the annotations to be retrieved and - # returned with each search result. - # Annotation granularity must be GRANULARITY_ASSET_LEVEL and its search - # strategy must not be NO_SEARCH. - # @!attribute [rw] search_query - # @return [::String] - # Global search query. Allows user to search assets without needing to - # specify which field the value belongs to. - class SearchAssetsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for SearchIndexEndpoint. - # @!attribute [rw] image_query - # @return [::Google::Cloud::VisionAI::V1::ImageQuery] - # An image-only query. - # - # Note: The following fields are mutually exclusive: `image_query`, `text_query`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] text_query - # @return [::String] - # A text-only query. - # - # Note: The following fields are mutually exclusive: `text_query`, `image_query`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] index_endpoint - # @return [::String] - # Required. The index endpoint to search. - # Format: - # `projects/{project_id}/locations/{location_id}/indexEndpoints/{index_endpoint_id}' - # @!attribute [rw] criteria - # @return [::Array<::Google::Cloud::VisionAI::V1::Criteria>] - # Criteria applied to search results. - # @!attribute [rw] exclusion_criteria - # @return [::Array<::Google::Cloud::VisionAI::V1::Criteria>] - # Criteria to exclude from search results. - # Note that `fetch_matched_annotations` will be ignored. - # @!attribute [rw] page_size - # @return [::Integer] - # Requested page size. API may return fewer results than requested. - # If negative, INVALID_ARGUMENT error will be returned. - # If unspecified or 0, API will pick a default size, which is 10. - # If the requested page size is larger than the maximum size, API will pick - # the maximum size, which is 200. - # @!attribute [rw] page_token - # @return [::String] - # The continuation token to fetch the next page. If empty, it means it is - # fetching the first page. - class SearchIndexEndpointRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Image query for search endpoint request. - # @!attribute [rw] input_image - # @return [::String] - # Input image in raw bytes. - # - # Note: The following fields are mutually exclusive: `input_image`, `asset`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] asset - # @return [::String] - # Resource name of the asset. Only supported in IMAGE corpus type. - # Format: - # `projects/{project_number}/locations/{location_id}/corpora/{corpus_id}/assets/{asset_id}` - # - # Note: The following fields are mutually exclusive: `asset`, `input_image`. If a field in that set is populated, all other fields in the set will automatically be cleared. - class ImageQuery - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A strategy to specify how to sort by data schema key. - # @!attribute [rw] options - # @return [::Array<::Google::Cloud::VisionAI::V1::SchemaKeySortingStrategy::Option>] - # Options in the front have high priority than those in the back. - class SchemaKeySortingStrategy - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Option for one data schema key. - # @!attribute [rw] data_schema_key - # @return [::String] - # The data used to sort. - # @!attribute [rw] sort_decreasing - # @return [::Boolean] - # Whether to sort in decreasing order or increasing order. - # By default, results are sorted in incresing order. - # @!attribute [rw] aggregate_method - # @return [::Google::Cloud::VisionAI::V1::SchemaKeySortingStrategy::Option::AggregateMethod] - # Aggregate method for the current data schema key. - class Option - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # When one result has multiple values with the same key, specify - # which value is used to sort. By default, AGGREGATE_METHOD_LARGEST - # is used when results are sorted in decreasing order, - # AGGREGATE_METHOD_SMALLEST is used when results are sorted in - # incresing order. - module AggregateMethod - # The unspecified aggregate method will be overwritten as mentioned - # above. - AGGREGATE_METHOD_UNSPECIFIED = 0 - - # Take the (lexicographical or numerical) largest value to sort. - AGGREGATE_METHOD_LARGEST = 1 - - # Take the (lexicographical or numerical) smallest value to sort. - AGGREGATE_METHOD_SMALLEST = 2 - end - end - end - - # The metadata for DeleteAsset API that embeds in - # {::Google::Longrunning::Operation#metadata metadata} field. - class DeleteAssetMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Stores the criteria-annotation matching results for each search result item. - # @!attribute [rw] criteria - # @return [::Google::Cloud::VisionAI::V1::Criteria] - # The criteria used for matching. It can be an input search criteria or a - # criteria converted from a facet selection. - # @!attribute [rw] matched_annotations - # @return [::Array<::Google::Cloud::VisionAI::V1::Annotation>] - # Matched annotations for the criteria. - # @!attribute [rw] status - # @return [::Google::Rpc::Status] - # Status of the match result. Possible values: - # FAILED_PRECONDITION - the criteria is not eligible for match. - # OK - matching is performed. - class AnnotationMatchingResult - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Search result contains asset name and corresponding time ranges. - # @!attribute [rw] asset - # @return [::String] - # The resource name of the asset. - # Format: - # `projects/{project_number}/locations/{location_id}/corpora/{corpus_id}/assets/{asset_id}` - # @!attribute [rw] segments - # @deprecated This field is deprecated and may be removed in the next major version update. - # @return [::Array<::Google::Cloud::VisionAI::V1::Partition::TemporalPartition>] - # The matched asset segments. - # Deprecated: please use singular `segment` field. - # @!attribute [rw] segment - # @return [::Google::Cloud::VisionAI::V1::Partition::TemporalPartition] - # The matched asset segment. - # @!attribute [rw] relevance - # @return [::Float] - # Available to IMAGE corpus types. - # Relevance of this `SearchResultItem` to user search query (text query or - # image query). - # By default this represents cosine similarity between the query and the - # retrieved media content. The value is in the range of [-1, 1]. - # Note that search ranking is not only decided by this relevance score, but - # also other factors such as the match of annotations. - # @!attribute [rw] requested_annotations - # @return [::Array<::Google::Cloud::VisionAI::V1::Annotation>] - # Search result annotations specified by result_annotation_keys in search - # request. - # @!attribute [rw] annotation_matching_results - # @return [::Array<::Google::Cloud::VisionAI::V1::AnnotationMatchingResult>] - # Criteria or facet-selection based annotation matching results associated to - # this search result item. Only contains results for criteria or - # facet_selections with fetch_matched_annotations=true. - class SearchResultItem - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for SearchAssets. - # @!attribute [rw] search_result_items - # @return [::Array<::Google::Cloud::VisionAI::V1::SearchResultItem>] - # Returned search results. - # @!attribute [rw] next_page_token - # @return [::String] - # The next-page continuation token. - # @!attribute [rw] facet_results - # @return [::Array<::Google::Cloud::VisionAI::V1::FacetGroup>] - # Facet search results of a given query, which contains user's - # already-selected facet values and updated facet search results. - class SearchAssetsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for SearchIndexEndpoint. - # @!attribute [rw] search_result_items - # @return [::Array<::Google::Cloud::VisionAI::V1::SearchResultItem>] - # Returned search results. - # @!attribute [rw] next_page_token - # @return [::String] - # The next-page continuation token. - # If this field is omitted, there are no subsequent pages. - class SearchIndexEndpointResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Integer range type. - # @!attribute [rw] start - # @return [::Integer] - # Start of the int range. - # @!attribute [rw] end - # @return [::Integer] - # End of the int range. - class IntRange - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Float range type. - # @!attribute [rw] start - # @return [::Float] - # Start of the float range. - # @!attribute [rw] end - # @return [::Float] - # End of the float range. - class FloatRange - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A list of string-type values. - # @!attribute [rw] txt_values - # @return [::Array<::String>] - # String type values. - class StringArray - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A list of integer range values. - # @!attribute [rw] int_ranges - # @return [::Array<::Google::Cloud::VisionAI::V1::IntRange>] - # Int range values. - class IntRangeArray - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A list of float range values. - # @!attribute [rw] float_ranges - # @return [::Array<::Google::Cloud::VisionAI::V1::FloatRange>] - # Float range values. - class FloatRangeArray - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Datetime range type. - # @!attribute [rw] start - # @return [::Google::Type::DateTime] - # Start date time. - # @!attribute [rw] end - # @return [::Google::Type::DateTime] - # End data time. - class DateTimeRange - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A list of datetime range values. - # @!attribute [rw] date_time_ranges - # @return [::Array<::Google::Cloud::VisionAI::V1::DateTimeRange>] - # Date time ranges. - class DateTimeRangeArray - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Representation of a circle area. - # @!attribute [rw] latitude - # @return [::Float] - # Latitude of circle area's center. Degrees [-90 .. 90] - # @!attribute [rw] longitude - # @return [::Float] - # Longitude of circle area's center. Degrees [-180 .. 180] - # @!attribute [rw] radius_meter - # @return [::Float] - # Radius of the circle area in meters. - class CircleArea - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A list of locations. - # @!attribute [rw] circle_areas - # @return [::Array<::Google::Cloud::VisionAI::V1::CircleArea>] - # A list of circle areas. - class GeoLocationArray - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # @!attribute [rw] value - # @return [::Boolean] - class BoolValue - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Filter criteria applied to current search results. - # @!attribute [rw] text_array - # @return [::Google::Cloud::VisionAI::V1::StringArray] - # The text values associated with the field. - # - # Note: The following fields are mutually exclusive: `text_array`, `int_range_array`, `float_range_array`, `date_time_range_array`, `geo_location_array`, `bool_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] int_range_array - # @return [::Google::Cloud::VisionAI::V1::IntRangeArray] - # The integer ranges associated with the field. - # - # Note: The following fields are mutually exclusive: `int_range_array`, `text_array`, `float_range_array`, `date_time_range_array`, `geo_location_array`, `bool_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] float_range_array - # @return [::Google::Cloud::VisionAI::V1::FloatRangeArray] - # The float ranges associated with the field. - # - # Note: The following fields are mutually exclusive: `float_range_array`, `text_array`, `int_range_array`, `date_time_range_array`, `geo_location_array`, `bool_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] date_time_range_array - # @return [::Google::Cloud::VisionAI::V1::DateTimeRangeArray] - # The datetime ranges associated with the field. - # - # Note: The following fields are mutually exclusive: `date_time_range_array`, `text_array`, `int_range_array`, `float_range_array`, `geo_location_array`, `bool_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] geo_location_array - # @return [::Google::Cloud::VisionAI::V1::GeoLocationArray] - # Geo Location array. - # - # Note: The following fields are mutually exclusive: `geo_location_array`, `text_array`, `int_range_array`, `float_range_array`, `date_time_range_array`, `bool_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] bool_value - # @return [::Google::Cloud::VisionAI::V1::BoolValue] - # A Boolean value. - # - # Note: The following fields are mutually exclusive: `bool_value`, `text_array`, `int_range_array`, `float_range_array`, `date_time_range_array`, `geo_location_array`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] field - # @return [::String] - # The UGA field or ML field to apply filtering criteria. - # @!attribute [rw] fetch_matched_annotations - # @return [::Boolean] - # If true, return query matched annotations for this criteria. - # This option is only applicable for inclusion criteria, i.e., not exclusion - # criteria, with partition level annotations. It supports the following data - # types: - # - INTEGER - # - FLOAT - # - STRING (DataSchema.SearchStrategy.EXACT_SEARCH only) - # - BOOLEAN - class Criteria - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Partition to specify the partition in time and space for sub-asset level - # annotation. - # @!attribute [rw] temporal_partition - # @return [::Google::Cloud::VisionAI::V1::Partition::TemporalPartition] - # Partition of asset in time. - # @!attribute [rw] spatial_partition - # @return [::Google::Cloud::VisionAI::V1::Partition::SpatialPartition] - # Partition of asset in space. - # @!attribute [rw] relative_temporal_partition - # @return [::Google::Cloud::VisionAI::V1::Partition::RelativeTemporalPartition] - # Partition of asset in time. - class Partition - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Partition of asset in UTC Epoch time. Supported by STREAM_VIDEO corpus - # type. - # @!attribute [rw] start_time - # @return [::Google::Protobuf::Timestamp] - # Start time of the partition. - # @!attribute [rw] end_time - # @return [::Google::Protobuf::Timestamp] - # End time of the partition. - class TemporalPartition - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Partition of asset in space. - # @!attribute [rw] x_min - # @return [::Integer] - # The minimum x coordinate value. - # @!attribute [rw] y_min - # @return [::Integer] - # The minimum y coordinate value. - # @!attribute [rw] x_max - # @return [::Integer] - # The maximum x coordinate value. - # @!attribute [rw] y_max - # @return [::Integer] - # The maximum y coordinate value. - class SpatialPartition - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Partition of asset in relative time. Supported by VIDEO_ON_DEMAND corpus - # type. - # @!attribute [rw] start_offset - # @return [::Google::Protobuf::Duration] - # Start time offset of the partition. - # @!attribute [rw] end_offset - # @return [::Google::Protobuf::Duration] - # End time offset of the partition. - class RelativeTemporalPartition - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Different types for a facet bucket. - module FacetBucketType - # Unspecified type. - FACET_BUCKET_TYPE_UNSPECIFIED = 0 - - # Value type. - FACET_BUCKET_TYPE_VALUE = 1 - - # Datetime type. - FACET_BUCKET_TYPE_DATETIME = 2 - - # Fixed Range type. - FACET_BUCKET_TYPE_FIXED_RANGE = 3 - - # Custom Range type. - FACET_BUCKET_TYPE_CUSTOM_RANGE = 4 - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/proto_docs/google/longrunning/operations.rb b/owl-bot-staging/google-cloud-vision_ai-v1/proto_docs/google/longrunning/operations.rb deleted file mode 100644 index 7a757f512165..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-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-vision_ai-v1/proto_docs/google/protobuf/any.rb b/owl-bot-staging/google-cloud-vision_ai-v1/proto_docs/google/protobuf/any.rb deleted file mode 100644 index 58691995f02e..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-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-vision_ai-v1/proto_docs/google/protobuf/duration.rb b/owl-bot-staging/google-cloud-vision_ai-v1/proto_docs/google/protobuf/duration.rb deleted file mode 100644 index ea59f1f91daf..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-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-vision_ai-v1/proto_docs/google/protobuf/empty.rb b/owl-bot-staging/google-cloud-vision_ai-v1/proto_docs/google/protobuf/empty.rb deleted file mode 100644 index 83e4481834a6..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-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-vision_ai-v1/proto_docs/google/protobuf/field_mask.rb b/owl-bot-staging/google-cloud-vision_ai-v1/proto_docs/google/protobuf/field_mask.rb deleted file mode 100644 index 7f3ffc78601a..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-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-vision_ai-v1/proto_docs/google/protobuf/struct.rb b/owl-bot-staging/google-cloud-vision_ai-v1/proto_docs/google/protobuf/struct.rb deleted file mode 100644 index 39e1aca868d2..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/proto_docs/google/protobuf/struct.rb +++ /dev/null @@ -1,108 +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 - # `Struct` represents a structured data value, consisting of fields - # which map to dynamically typed values. In some languages, `Struct` - # might be supported by a native representation. For example, in - # scripting languages like JS a struct is represented as an - # object. The details of that representation are described together - # with the proto support for the language. - # - # The JSON representation for `Struct` is JSON object. - # @!attribute [rw] fields - # @return [::Google::Protobuf::Map{::String => ::Google::Protobuf::Value}] - # Unordered map of dynamically typed values. - class Struct - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::Google::Protobuf::Value] - class FieldsEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # `Value` represents a dynamically typed value which can be either - # null, a number, a string, a boolean, a recursive struct value, or a - # list of values. A producer of value is expected to set one of these - # variants. Absence of any variant indicates an error. - # - # The JSON representation for `Value` is JSON value. - # @!attribute [rw] null_value - # @return [::Google::Protobuf::NullValue] - # Represents a null value. - # - # Note: The following fields are mutually exclusive: `null_value`, `number_value`, `string_value`, `bool_value`, `struct_value`, `list_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] number_value - # @return [::Float] - # Represents a double value. - # - # Note: The following fields are mutually exclusive: `number_value`, `null_value`, `string_value`, `bool_value`, `struct_value`, `list_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] string_value - # @return [::String] - # Represents a string value. - # - # Note: The following fields are mutually exclusive: `string_value`, `null_value`, `number_value`, `bool_value`, `struct_value`, `list_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] bool_value - # @return [::Boolean] - # Represents a boolean value. - # - # Note: The following fields are mutually exclusive: `bool_value`, `null_value`, `number_value`, `string_value`, `struct_value`, `list_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] struct_value - # @return [::Google::Protobuf::Struct] - # Represents a structured value. - # - # Note: The following fields are mutually exclusive: `struct_value`, `null_value`, `number_value`, `string_value`, `bool_value`, `list_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] list_value - # @return [::Google::Protobuf::ListValue] - # Represents a repeated `Value`. - # - # Note: The following fields are mutually exclusive: `list_value`, `null_value`, `number_value`, `string_value`, `bool_value`, `struct_value`. If a field in that set is populated, all other fields in the set will automatically be cleared. - class Value - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # `ListValue` is a wrapper around a repeated field of values. - # - # The JSON representation for `ListValue` is JSON array. - # @!attribute [rw] values - # @return [::Array<::Google::Protobuf::Value>] - # Repeated field of dynamically typed values. - class ListValue - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # `NullValue` is a singleton enumeration to represent the null value for the - # `Value` type union. - # - # The JSON representation for `NullValue` is JSON `null`. - module NullValue - # Null value. - NULL_VALUE = 0 - end - end -end diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/proto_docs/google/protobuf/timestamp.rb b/owl-bot-staging/google-cloud-vision_ai-v1/proto_docs/google/protobuf/timestamp.rb deleted file mode 100644 index 74352be9c58c..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-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-vision_ai-v1/proto_docs/google/rpc/status.rb b/owl-bot-staging/google-cloud-vision_ai-v1/proto_docs/google/rpc/status.rb deleted file mode 100644 index c1a1c07eb2db..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-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-vision_ai-v1/proto_docs/google/type/datetime.rb b/owl-bot-staging/google-cloud-vision_ai-v1/proto_docs/google/type/datetime.rb deleted file mode 100644 index 10625864f3dd..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/proto_docs/google/type/datetime.rb +++ /dev/null @@ -1,104 +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 civil time (or occasionally physical time). - # - # This type can represent a civil time in one of a few possible ways: - # - # * When utc_offset is set and time_zone is unset: a civil time on a calendar - # day with a particular offset from UTC. - # * When time_zone is set and utc_offset is unset: a civil time on a calendar - # day in a particular time zone. - # * When neither time_zone nor utc_offset is set: a civil time on a calendar - # day in local time. - # - # The date is relative to the Proleptic Gregorian Calendar. - # - # If year, month, or day are 0, the DateTime is considered not to have a - # specific year, month, or day respectively. - # - # This type may also be used to represent a physical time if all the date and - # time fields are set and either case of the `time_offset` oneof is set. - # Consider using `Timestamp` message for physical time instead. If your use - # case also would like to store the user's timezone, that can be done in - # another field. - # - # This type is more flexible than some applications may want. Make sure to - # document and validate your application's limitations. - # @!attribute [rw] year - # @return [::Integer] - # Optional. Year of date. Must be from 1 to 9999, or 0 if specifying a - # datetime without a year. - # @!attribute [rw] month - # @return [::Integer] - # Optional. Month of year. Must be from 1 to 12, or 0 if specifying a - # datetime without a month. - # @!attribute [rw] day - # @return [::Integer] - # Optional. Day of month. Must be from 1 to 31 and valid for the year and - # month, or 0 if specifying a datetime without a day. - # @!attribute [rw] hours - # @return [::Integer] - # Optional. Hours of day in 24 hour format. Should be from 0 to 23, defaults - # to 0 (midnight). An API may choose to allow the value "24:00:00" for - # scenarios like business closing time. - # @!attribute [rw] minutes - # @return [::Integer] - # Optional. Minutes of hour of day. Must be from 0 to 59, defaults to 0. - # @!attribute [rw] seconds - # @return [::Integer] - # Optional. Seconds of minutes of the time. Must normally be from 0 to 59, - # defaults to 0. An API may allow the value 60 if it allows leap-seconds. - # @!attribute [rw] nanos - # @return [::Integer] - # Optional. Fractions of seconds in nanoseconds. Must be from 0 to - # 999,999,999, defaults to 0. - # @!attribute [rw] utc_offset - # @return [::Google::Protobuf::Duration] - # UTC offset. Must be whole seconds, between -18 hours and +18 hours. - # For example, a UTC offset of -4:00 would be represented as - # { seconds: -14400 }. - # - # Note: The following fields are mutually exclusive: `utc_offset`, `time_zone`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] time_zone - # @return [::Google::Type::TimeZone] - # Time zone. - # - # Note: The following fields are mutually exclusive: `time_zone`, `utc_offset`. If a field in that set is populated, all other fields in the set will automatically be cleared. - class DateTime - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Represents a time zone from the - # [IANA Time Zone Database](https://www.iana.org/time-zones). - # @!attribute [rw] id - # @return [::String] - # IANA Time Zone Database time zone. For example "America/New_York". - # @!attribute [rw] version - # @return [::String] - # Optional. IANA Time Zone Database version number. For example "2019a". - class TimeZone - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/proto_docs/google/type/expr.rb b/owl-bot-staging/google-cloud-vision_ai-v1/proto_docs/google/type/expr.rb deleted file mode 100644 index 53e7733b6592..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-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-vision_ai-v1/snippets/Gemfile b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/Gemfile deleted file mode 100644 index 1f7273bfe476..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-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-vision_ai-v1", path: "../" -else - gem "google-cloud-vision_ai-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-vision_ai-v1/snippets/app_platform/add_application_stream_input.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/app_platform/add_application_stream_input.rb deleted file mode 100644 index cff2b1ac2448..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/app_platform/add_application_stream_input.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 visionai_v1_generated_AppPlatform_AddApplicationStreamInput_sync] -require "google/cloud/vision_ai/v1" - -## -# Snippet for the add_application_stream_input call in the AppPlatform 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::VisionAI::V1::AppPlatform::Client#add_application_stream_input. -# -def add_application_stream_input - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VisionAI::V1::AppPlatform::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VisionAI::V1::AddApplicationStreamInputRequest.new - - # Call the add_application_stream_input method. - result = client.add_application_stream_input 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 visionai_v1_generated_AppPlatform_AddApplicationStreamInput_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/app_platform/create_application.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/app_platform/create_application.rb deleted file mode 100644 index 47a03d65deff..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/app_platform/create_application.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 visionai_v1_generated_AppPlatform_CreateApplication_sync] -require "google/cloud/vision_ai/v1" - -## -# Snippet for the create_application call in the AppPlatform 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::VisionAI::V1::AppPlatform::Client#create_application. -# -def create_application - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VisionAI::V1::AppPlatform::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VisionAI::V1::CreateApplicationRequest.new - - # Call the create_application method. - result = client.create_application 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 visionai_v1_generated_AppPlatform_CreateApplication_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/app_platform/create_application_instances.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/app_platform/create_application_instances.rb deleted file mode 100644 index 70281108dc39..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/app_platform/create_application_instances.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 visionai_v1_generated_AppPlatform_CreateApplicationInstances_sync] -require "google/cloud/vision_ai/v1" - -## -# Snippet for the create_application_instances call in the AppPlatform 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::VisionAI::V1::AppPlatform::Client#create_application_instances. -# -def create_application_instances - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VisionAI::V1::AppPlatform::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VisionAI::V1::CreateApplicationInstancesRequest.new - - # Call the create_application_instances method. - result = client.create_application_instances 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 visionai_v1_generated_AppPlatform_CreateApplicationInstances_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/app_platform/create_draft.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/app_platform/create_draft.rb deleted file mode 100644 index f1bdc48ea055..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/app_platform/create_draft.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 visionai_v1_generated_AppPlatform_CreateDraft_sync] -require "google/cloud/vision_ai/v1" - -## -# Snippet for the create_draft call in the AppPlatform 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::VisionAI::V1::AppPlatform::Client#create_draft. -# -def create_draft - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VisionAI::V1::AppPlatform::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VisionAI::V1::CreateDraftRequest.new - - # Call the create_draft method. - result = client.create_draft 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 visionai_v1_generated_AppPlatform_CreateDraft_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/app_platform/create_processor.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/app_platform/create_processor.rb deleted file mode 100644 index 3eb4005576c6..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/app_platform/create_processor.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 visionai_v1_generated_AppPlatform_CreateProcessor_sync] -require "google/cloud/vision_ai/v1" - -## -# Snippet for the create_processor call in the AppPlatform 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::VisionAI::V1::AppPlatform::Client#create_processor. -# -def create_processor - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VisionAI::V1::AppPlatform::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VisionAI::V1::CreateProcessorRequest.new - - # Call the create_processor method. - result = client.create_processor 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 visionai_v1_generated_AppPlatform_CreateProcessor_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/app_platform/delete_application.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/app_platform/delete_application.rb deleted file mode 100644 index a48b8c9beaf1..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/app_platform/delete_application.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 visionai_v1_generated_AppPlatform_DeleteApplication_sync] -require "google/cloud/vision_ai/v1" - -## -# Snippet for the delete_application call in the AppPlatform 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::VisionAI::V1::AppPlatform::Client#delete_application. -# -def delete_application - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VisionAI::V1::AppPlatform::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VisionAI::V1::DeleteApplicationRequest.new - - # Call the delete_application method. - result = client.delete_application 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 visionai_v1_generated_AppPlatform_DeleteApplication_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/app_platform/delete_application_instances.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/app_platform/delete_application_instances.rb deleted file mode 100644 index e39663a160eb..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/app_platform/delete_application_instances.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 visionai_v1_generated_AppPlatform_DeleteApplicationInstances_sync] -require "google/cloud/vision_ai/v1" - -## -# Snippet for the delete_application_instances call in the AppPlatform 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::VisionAI::V1::AppPlatform::Client#delete_application_instances. -# -def delete_application_instances - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VisionAI::V1::AppPlatform::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VisionAI::V1::DeleteApplicationInstancesRequest.new - - # Call the delete_application_instances method. - result = client.delete_application_instances 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 visionai_v1_generated_AppPlatform_DeleteApplicationInstances_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/app_platform/delete_draft.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/app_platform/delete_draft.rb deleted file mode 100644 index c4283f226e3a..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/app_platform/delete_draft.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 visionai_v1_generated_AppPlatform_DeleteDraft_sync] -require "google/cloud/vision_ai/v1" - -## -# Snippet for the delete_draft call in the AppPlatform 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::VisionAI::V1::AppPlatform::Client#delete_draft. -# -def delete_draft - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VisionAI::V1::AppPlatform::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VisionAI::V1::DeleteDraftRequest.new - - # Call the delete_draft method. - result = client.delete_draft 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 visionai_v1_generated_AppPlatform_DeleteDraft_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/app_platform/delete_processor.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/app_platform/delete_processor.rb deleted file mode 100644 index 5e1a1ac02268..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/app_platform/delete_processor.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 visionai_v1_generated_AppPlatform_DeleteProcessor_sync] -require "google/cloud/vision_ai/v1" - -## -# Snippet for the delete_processor call in the AppPlatform 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::VisionAI::V1::AppPlatform::Client#delete_processor. -# -def delete_processor - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VisionAI::V1::AppPlatform::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VisionAI::V1::DeleteProcessorRequest.new - - # Call the delete_processor method. - result = client.delete_processor 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 visionai_v1_generated_AppPlatform_DeleteProcessor_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/app_platform/deploy_application.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/app_platform/deploy_application.rb deleted file mode 100644 index b7f83b961a53..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/app_platform/deploy_application.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 visionai_v1_generated_AppPlatform_DeployApplication_sync] -require "google/cloud/vision_ai/v1" - -## -# Snippet for the deploy_application call in the AppPlatform 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::VisionAI::V1::AppPlatform::Client#deploy_application. -# -def deploy_application - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VisionAI::V1::AppPlatform::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VisionAI::V1::DeployApplicationRequest.new - - # Call the deploy_application method. - result = client.deploy_application 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 visionai_v1_generated_AppPlatform_DeployApplication_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/app_platform/get_application.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/app_platform/get_application.rb deleted file mode 100644 index 8f041c313f10..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/app_platform/get_application.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 visionai_v1_generated_AppPlatform_GetApplication_sync] -require "google/cloud/vision_ai/v1" - -## -# Snippet for the get_application call in the AppPlatform 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::VisionAI::V1::AppPlatform::Client#get_application. -# -def get_application - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VisionAI::V1::AppPlatform::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VisionAI::V1::GetApplicationRequest.new - - # Call the get_application method. - result = client.get_application request - - # The returned object is of type Google::Cloud::VisionAI::V1::Application. - p result -end -# [END visionai_v1_generated_AppPlatform_GetApplication_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/app_platform/get_draft.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/app_platform/get_draft.rb deleted file mode 100644 index cc311a561e07..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/app_platform/get_draft.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 visionai_v1_generated_AppPlatform_GetDraft_sync] -require "google/cloud/vision_ai/v1" - -## -# Snippet for the get_draft call in the AppPlatform 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::VisionAI::V1::AppPlatform::Client#get_draft. -# -def get_draft - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VisionAI::V1::AppPlatform::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VisionAI::V1::GetDraftRequest.new - - # Call the get_draft method. - result = client.get_draft request - - # The returned object is of type Google::Cloud::VisionAI::V1::Draft. - p result -end -# [END visionai_v1_generated_AppPlatform_GetDraft_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/app_platform/get_instance.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/app_platform/get_instance.rb deleted file mode 100644 index 759c4abd1259..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/app_platform/get_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 visionai_v1_generated_AppPlatform_GetInstance_sync] -require "google/cloud/vision_ai/v1" - -## -# Snippet for the get_instance call in the AppPlatform 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::VisionAI::V1::AppPlatform::Client#get_instance. -# -def get_instance - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VisionAI::V1::AppPlatform::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VisionAI::V1::GetInstanceRequest.new - - # Call the get_instance method. - result = client.get_instance request - - # The returned object is of type Google::Cloud::VisionAI::V1::Instance. - p result -end -# [END visionai_v1_generated_AppPlatform_GetInstance_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/app_platform/get_processor.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/app_platform/get_processor.rb deleted file mode 100644 index c7df60a5fb04..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/app_platform/get_processor.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 visionai_v1_generated_AppPlatform_GetProcessor_sync] -require "google/cloud/vision_ai/v1" - -## -# Snippet for the get_processor call in the AppPlatform 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::VisionAI::V1::AppPlatform::Client#get_processor. -# -def get_processor - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VisionAI::V1::AppPlatform::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VisionAI::V1::GetProcessorRequest.new - - # Call the get_processor method. - result = client.get_processor request - - # The returned object is of type Google::Cloud::VisionAI::V1::Processor. - p result -end -# [END visionai_v1_generated_AppPlatform_GetProcessor_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/app_platform/list_applications.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/app_platform/list_applications.rb deleted file mode 100644 index 4fa1147ffe1a..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/app_platform/list_applications.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 visionai_v1_generated_AppPlatform_ListApplications_sync] -require "google/cloud/vision_ai/v1" - -## -# Snippet for the list_applications call in the AppPlatform 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::VisionAI::V1::AppPlatform::Client#list_applications. -# -def list_applications - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VisionAI::V1::AppPlatform::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VisionAI::V1::ListApplicationsRequest.new - - # Call the list_applications method. - result = client.list_applications 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::VisionAI::V1::Application. - p item - end -end -# [END visionai_v1_generated_AppPlatform_ListApplications_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/app_platform/list_drafts.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/app_platform/list_drafts.rb deleted file mode 100644 index 948d4d4686ae..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/app_platform/list_drafts.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 visionai_v1_generated_AppPlatform_ListDrafts_sync] -require "google/cloud/vision_ai/v1" - -## -# Snippet for the list_drafts call in the AppPlatform 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::VisionAI::V1::AppPlatform::Client#list_drafts. -# -def list_drafts - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VisionAI::V1::AppPlatform::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VisionAI::V1::ListDraftsRequest.new - - # Call the list_drafts method. - result = client.list_drafts 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::VisionAI::V1::Draft. - p item - end -end -# [END visionai_v1_generated_AppPlatform_ListDrafts_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/app_platform/list_instances.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/app_platform/list_instances.rb deleted file mode 100644 index ad30667c2e29..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/app_platform/list_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 visionai_v1_generated_AppPlatform_ListInstances_sync] -require "google/cloud/vision_ai/v1" - -## -# Snippet for the list_instances call in the AppPlatform 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::VisionAI::V1::AppPlatform::Client#list_instances. -# -def list_instances - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VisionAI::V1::AppPlatform::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VisionAI::V1::ListInstancesRequest.new - - # Call the list_instances method. - result = client.list_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::VisionAI::V1::Instance. - p item - end -end -# [END visionai_v1_generated_AppPlatform_ListInstances_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/app_platform/list_prebuilt_processors.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/app_platform/list_prebuilt_processors.rb deleted file mode 100644 index ee3949fa6b38..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/app_platform/list_prebuilt_processors.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 visionai_v1_generated_AppPlatform_ListPrebuiltProcessors_sync] -require "google/cloud/vision_ai/v1" - -## -# Snippet for the list_prebuilt_processors call in the AppPlatform 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::VisionAI::V1::AppPlatform::Client#list_prebuilt_processors. -# -def list_prebuilt_processors - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VisionAI::V1::AppPlatform::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VisionAI::V1::ListPrebuiltProcessorsRequest.new - - # Call the list_prebuilt_processors method. - result = client.list_prebuilt_processors request - - # The returned object is of type Google::Cloud::VisionAI::V1::ListPrebuiltProcessorsResponse. - p result -end -# [END visionai_v1_generated_AppPlatform_ListPrebuiltProcessors_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/app_platform/list_processors.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/app_platform/list_processors.rb deleted file mode 100644 index f99a9b7a8370..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/app_platform/list_processors.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 visionai_v1_generated_AppPlatform_ListProcessors_sync] -require "google/cloud/vision_ai/v1" - -## -# Snippet for the list_processors call in the AppPlatform 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::VisionAI::V1::AppPlatform::Client#list_processors. -# -def list_processors - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VisionAI::V1::AppPlatform::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VisionAI::V1::ListProcessorsRequest.new - - # Call the list_processors method. - result = client.list_processors 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::VisionAI::V1::Processor. - p item - end -end -# [END visionai_v1_generated_AppPlatform_ListProcessors_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/app_platform/remove_application_stream_input.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/app_platform/remove_application_stream_input.rb deleted file mode 100644 index 7bd4748965f5..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/app_platform/remove_application_stream_input.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 visionai_v1_generated_AppPlatform_RemoveApplicationStreamInput_sync] -require "google/cloud/vision_ai/v1" - -## -# Snippet for the remove_application_stream_input call in the AppPlatform 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::VisionAI::V1::AppPlatform::Client#remove_application_stream_input. -# -def remove_application_stream_input - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VisionAI::V1::AppPlatform::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VisionAI::V1::RemoveApplicationStreamInputRequest.new - - # Call the remove_application_stream_input method. - result = client.remove_application_stream_input 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 visionai_v1_generated_AppPlatform_RemoveApplicationStreamInput_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/app_platform/undeploy_application.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/app_platform/undeploy_application.rb deleted file mode 100644 index 9203bb582196..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/app_platform/undeploy_application.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 visionai_v1_generated_AppPlatform_UndeployApplication_sync] -require "google/cloud/vision_ai/v1" - -## -# Snippet for the undeploy_application call in the AppPlatform 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::VisionAI::V1::AppPlatform::Client#undeploy_application. -# -def undeploy_application - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VisionAI::V1::AppPlatform::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VisionAI::V1::UndeployApplicationRequest.new - - # Call the undeploy_application method. - result = client.undeploy_application 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 visionai_v1_generated_AppPlatform_UndeployApplication_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/app_platform/update_application.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/app_platform/update_application.rb deleted file mode 100644 index 33cdcaa705a3..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/app_platform/update_application.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 visionai_v1_generated_AppPlatform_UpdateApplication_sync] -require "google/cloud/vision_ai/v1" - -## -# Snippet for the update_application call in the AppPlatform 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::VisionAI::V1::AppPlatform::Client#update_application. -# -def update_application - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VisionAI::V1::AppPlatform::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VisionAI::V1::UpdateApplicationRequest.new - - # Call the update_application method. - result = client.update_application 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 visionai_v1_generated_AppPlatform_UpdateApplication_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/app_platform/update_application_instances.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/app_platform/update_application_instances.rb deleted file mode 100644 index de9dbf28977d..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/app_platform/update_application_instances.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 visionai_v1_generated_AppPlatform_UpdateApplicationInstances_sync] -require "google/cloud/vision_ai/v1" - -## -# Snippet for the update_application_instances call in the AppPlatform 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::VisionAI::V1::AppPlatform::Client#update_application_instances. -# -def update_application_instances - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VisionAI::V1::AppPlatform::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VisionAI::V1::UpdateApplicationInstancesRequest.new - - # Call the update_application_instances method. - result = client.update_application_instances 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 visionai_v1_generated_AppPlatform_UpdateApplicationInstances_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/app_platform/update_application_stream_input.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/app_platform/update_application_stream_input.rb deleted file mode 100644 index 299de2b97c72..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/app_platform/update_application_stream_input.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 visionai_v1_generated_AppPlatform_UpdateApplicationStreamInput_sync] -require "google/cloud/vision_ai/v1" - -## -# Snippet for the update_application_stream_input call in the AppPlatform 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::VisionAI::V1::AppPlatform::Client#update_application_stream_input. -# -def update_application_stream_input - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VisionAI::V1::AppPlatform::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VisionAI::V1::UpdateApplicationStreamInputRequest.new - - # Call the update_application_stream_input method. - result = client.update_application_stream_input 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 visionai_v1_generated_AppPlatform_UpdateApplicationStreamInput_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/app_platform/update_draft.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/app_platform/update_draft.rb deleted file mode 100644 index 079460e32a6f..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/app_platform/update_draft.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 visionai_v1_generated_AppPlatform_UpdateDraft_sync] -require "google/cloud/vision_ai/v1" - -## -# Snippet for the update_draft call in the AppPlatform 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::VisionAI::V1::AppPlatform::Client#update_draft. -# -def update_draft - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VisionAI::V1::AppPlatform::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VisionAI::V1::UpdateDraftRequest.new - - # Call the update_draft method. - result = client.update_draft 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 visionai_v1_generated_AppPlatform_UpdateDraft_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/app_platform/update_processor.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/app_platform/update_processor.rb deleted file mode 100644 index e4176ac23ed3..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/app_platform/update_processor.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 visionai_v1_generated_AppPlatform_UpdateProcessor_sync] -require "google/cloud/vision_ai/v1" - -## -# Snippet for the update_processor call in the AppPlatform 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::VisionAI::V1::AppPlatform::Client#update_processor. -# -def update_processor - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VisionAI::V1::AppPlatform::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VisionAI::V1::UpdateProcessorRequest.new - - # Call the update_processor method. - result = client.update_processor 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 visionai_v1_generated_AppPlatform_UpdateProcessor_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/health_check_service/health_check.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/health_check_service/health_check.rb deleted file mode 100644 index d64d81bbd491..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/health_check_service/health_check.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 visionai_v1_generated_HealthCheckService_HealthCheck_sync] -require "google/cloud/vision_ai/v1" - -## -# Snippet for the health_check call in the HealthCheckService 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::VisionAI::V1::HealthCheckService::Client#health_check. -# -def health_check - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VisionAI::V1::HealthCheckService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VisionAI::V1::HealthCheckRequest.new - - # Call the health_check method. - result = client.health_check request - - # The returned object is of type Google::Cloud::VisionAI::V1::HealthCheckResponse. - p result -end -# [END visionai_v1_generated_HealthCheckService_HealthCheck_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/live_video_analytics/batch_run_process.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/live_video_analytics/batch_run_process.rb deleted file mode 100644 index aa4f4f87f202..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/live_video_analytics/batch_run_process.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 visionai_v1_generated_LiveVideoAnalytics_BatchRunProcess_sync] -require "google/cloud/vision_ai/v1" - -## -# Snippet for the batch_run_process call in the LiveVideoAnalytics 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::VisionAI::V1::LiveVideoAnalytics::Client#batch_run_process. -# -def batch_run_process - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VisionAI::V1::BatchRunProcessRequest.new - - # Call the batch_run_process method. - result = client.batch_run_process 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 visionai_v1_generated_LiveVideoAnalytics_BatchRunProcess_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/live_video_analytics/create_analysis.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/live_video_analytics/create_analysis.rb deleted file mode 100644 index f7f1700eb4d3..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/live_video_analytics/create_analysis.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 visionai_v1_generated_LiveVideoAnalytics_CreateAnalysis_sync] -require "google/cloud/vision_ai/v1" - -## -# Snippet for the create_analysis call in the LiveVideoAnalytics 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::VisionAI::V1::LiveVideoAnalytics::Client#create_analysis. -# -def create_analysis - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VisionAI::V1::CreateAnalysisRequest.new - - # Call the create_analysis method. - result = client.create_analysis 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 visionai_v1_generated_LiveVideoAnalytics_CreateAnalysis_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/live_video_analytics/create_operator.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/live_video_analytics/create_operator.rb deleted file mode 100644 index 94fe9a947e9f..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/live_video_analytics/create_operator.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 visionai_v1_generated_LiveVideoAnalytics_CreateOperator_sync] -require "google/cloud/vision_ai/v1" - -## -# Snippet for the create_operator call in the LiveVideoAnalytics 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::VisionAI::V1::LiveVideoAnalytics::Client#create_operator. -# -def create_operator - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VisionAI::V1::CreateOperatorRequest.new - - # Call the create_operator method. - result = client.create_operator 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 visionai_v1_generated_LiveVideoAnalytics_CreateOperator_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/live_video_analytics/create_process.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/live_video_analytics/create_process.rb deleted file mode 100644 index 08deac783fa3..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/live_video_analytics/create_process.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 visionai_v1_generated_LiveVideoAnalytics_CreateProcess_sync] -require "google/cloud/vision_ai/v1" - -## -# Snippet for the create_process call in the LiveVideoAnalytics 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::VisionAI::V1::LiveVideoAnalytics::Client#create_process. -# -def create_process - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VisionAI::V1::CreateProcessRequest.new - - # Call the create_process method. - result = client.create_process 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 visionai_v1_generated_LiveVideoAnalytics_CreateProcess_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/live_video_analytics/delete_analysis.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/live_video_analytics/delete_analysis.rb deleted file mode 100644 index adbcedb7a095..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/live_video_analytics/delete_analysis.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 visionai_v1_generated_LiveVideoAnalytics_DeleteAnalysis_sync] -require "google/cloud/vision_ai/v1" - -## -# Snippet for the delete_analysis call in the LiveVideoAnalytics 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::VisionAI::V1::LiveVideoAnalytics::Client#delete_analysis. -# -def delete_analysis - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VisionAI::V1::DeleteAnalysisRequest.new - - # Call the delete_analysis method. - result = client.delete_analysis 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 visionai_v1_generated_LiveVideoAnalytics_DeleteAnalysis_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/live_video_analytics/delete_operator.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/live_video_analytics/delete_operator.rb deleted file mode 100644 index 553cc77ca231..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/live_video_analytics/delete_operator.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 visionai_v1_generated_LiveVideoAnalytics_DeleteOperator_sync] -require "google/cloud/vision_ai/v1" - -## -# Snippet for the delete_operator call in the LiveVideoAnalytics 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::VisionAI::V1::LiveVideoAnalytics::Client#delete_operator. -# -def delete_operator - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VisionAI::V1::DeleteOperatorRequest.new - - # Call the delete_operator method. - result = client.delete_operator 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 visionai_v1_generated_LiveVideoAnalytics_DeleteOperator_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/live_video_analytics/delete_process.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/live_video_analytics/delete_process.rb deleted file mode 100644 index d60508365caa..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/live_video_analytics/delete_process.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 visionai_v1_generated_LiveVideoAnalytics_DeleteProcess_sync] -require "google/cloud/vision_ai/v1" - -## -# Snippet for the delete_process call in the LiveVideoAnalytics 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::VisionAI::V1::LiveVideoAnalytics::Client#delete_process. -# -def delete_process - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VisionAI::V1::DeleteProcessRequest.new - - # Call the delete_process method. - result = client.delete_process 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 visionai_v1_generated_LiveVideoAnalytics_DeleteProcess_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/live_video_analytics/get_analysis.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/live_video_analytics/get_analysis.rb deleted file mode 100644 index 6fc2ed9e371f..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/live_video_analytics/get_analysis.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 visionai_v1_generated_LiveVideoAnalytics_GetAnalysis_sync] -require "google/cloud/vision_ai/v1" - -## -# Snippet for the get_analysis call in the LiveVideoAnalytics 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::VisionAI::V1::LiveVideoAnalytics::Client#get_analysis. -# -def get_analysis - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VisionAI::V1::GetAnalysisRequest.new - - # Call the get_analysis method. - result = client.get_analysis request - - # The returned object is of type Google::Cloud::VisionAI::V1::Analysis. - p result -end -# [END visionai_v1_generated_LiveVideoAnalytics_GetAnalysis_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/live_video_analytics/get_operator.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/live_video_analytics/get_operator.rb deleted file mode 100644 index 43482ce03fcf..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/live_video_analytics/get_operator.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 visionai_v1_generated_LiveVideoAnalytics_GetOperator_sync] -require "google/cloud/vision_ai/v1" - -## -# Snippet for the get_operator call in the LiveVideoAnalytics 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::VisionAI::V1::LiveVideoAnalytics::Client#get_operator. -# -def get_operator - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VisionAI::V1::GetOperatorRequest.new - - # Call the get_operator method. - result = client.get_operator request - - # The returned object is of type Google::Cloud::VisionAI::V1::Operator. - p result -end -# [END visionai_v1_generated_LiveVideoAnalytics_GetOperator_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/live_video_analytics/get_process.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/live_video_analytics/get_process.rb deleted file mode 100644 index 762c69901bd3..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/live_video_analytics/get_process.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 visionai_v1_generated_LiveVideoAnalytics_GetProcess_sync] -require "google/cloud/vision_ai/v1" - -## -# Snippet for the get_process call in the LiveVideoAnalytics 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::VisionAI::V1::LiveVideoAnalytics::Client#get_process. -# -def get_process - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VisionAI::V1::GetProcessRequest.new - - # Call the get_process method. - result = client.get_process request - - # The returned object is of type Google::Cloud::VisionAI::V1::Process. - p result -end -# [END visionai_v1_generated_LiveVideoAnalytics_GetProcess_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/live_video_analytics/list_analyses.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/live_video_analytics/list_analyses.rb deleted file mode 100644 index 2e9b43c1ea5d..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/live_video_analytics/list_analyses.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 visionai_v1_generated_LiveVideoAnalytics_ListAnalyses_sync] -require "google/cloud/vision_ai/v1" - -## -# Snippet for the list_analyses call in the LiveVideoAnalytics 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::VisionAI::V1::LiveVideoAnalytics::Client#list_analyses. -# -def list_analyses - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VisionAI::V1::ListAnalysesRequest.new - - # Call the list_analyses method. - result = client.list_analyses 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::VisionAI::V1::Analysis. - p item - end -end -# [END visionai_v1_generated_LiveVideoAnalytics_ListAnalyses_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/live_video_analytics/list_operators.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/live_video_analytics/list_operators.rb deleted file mode 100644 index 4ef18f2fa64e..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/live_video_analytics/list_operators.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 visionai_v1_generated_LiveVideoAnalytics_ListOperators_sync] -require "google/cloud/vision_ai/v1" - -## -# Snippet for the list_operators call in the LiveVideoAnalytics 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::VisionAI::V1::LiveVideoAnalytics::Client#list_operators. -# -def list_operators - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VisionAI::V1::ListOperatorsRequest.new - - # Call the list_operators method. - result = client.list_operators 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::VisionAI::V1::Operator. - p item - end -end -# [END visionai_v1_generated_LiveVideoAnalytics_ListOperators_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/live_video_analytics/list_processes.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/live_video_analytics/list_processes.rb deleted file mode 100644 index ac2efe0deed8..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/live_video_analytics/list_processes.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 visionai_v1_generated_LiveVideoAnalytics_ListProcesses_sync] -require "google/cloud/vision_ai/v1" - -## -# Snippet for the list_processes call in the LiveVideoAnalytics 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::VisionAI::V1::LiveVideoAnalytics::Client#list_processes. -# -def list_processes - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VisionAI::V1::ListProcessesRequest.new - - # Call the list_processes method. - result = client.list_processes 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::VisionAI::V1::Process. - p item - end -end -# [END visionai_v1_generated_LiveVideoAnalytics_ListProcesses_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/live_video_analytics/list_public_operators.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/live_video_analytics/list_public_operators.rb deleted file mode 100644 index c5df10beff27..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/live_video_analytics/list_public_operators.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 visionai_v1_generated_LiveVideoAnalytics_ListPublicOperators_sync] -require "google/cloud/vision_ai/v1" - -## -# Snippet for the list_public_operators call in the LiveVideoAnalytics 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::VisionAI::V1::LiveVideoAnalytics::Client#list_public_operators. -# -def list_public_operators - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VisionAI::V1::ListPublicOperatorsRequest.new - - # Call the list_public_operators method. - result = client.list_public_operators 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::VisionAI::V1::Operator. - p item - end -end -# [END visionai_v1_generated_LiveVideoAnalytics_ListPublicOperators_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/live_video_analytics/resolve_operator_info.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/live_video_analytics/resolve_operator_info.rb deleted file mode 100644 index 368dfd43795b..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/live_video_analytics/resolve_operator_info.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 visionai_v1_generated_LiveVideoAnalytics_ResolveOperatorInfo_sync] -require "google/cloud/vision_ai/v1" - -## -# Snippet for the resolve_operator_info call in the LiveVideoAnalytics 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::VisionAI::V1::LiveVideoAnalytics::Client#resolve_operator_info. -# -def resolve_operator_info - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VisionAI::V1::ResolveOperatorInfoRequest.new - - # Call the resolve_operator_info method. - result = client.resolve_operator_info request - - # The returned object is of type Google::Cloud::VisionAI::V1::ResolveOperatorInfoResponse. - p result -end -# [END visionai_v1_generated_LiveVideoAnalytics_ResolveOperatorInfo_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/live_video_analytics/update_analysis.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/live_video_analytics/update_analysis.rb deleted file mode 100644 index be34d28b3897..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/live_video_analytics/update_analysis.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 visionai_v1_generated_LiveVideoAnalytics_UpdateAnalysis_sync] -require "google/cloud/vision_ai/v1" - -## -# Snippet for the update_analysis call in the LiveVideoAnalytics 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::VisionAI::V1::LiveVideoAnalytics::Client#update_analysis. -# -def update_analysis - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VisionAI::V1::UpdateAnalysisRequest.new - - # Call the update_analysis method. - result = client.update_analysis 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 visionai_v1_generated_LiveVideoAnalytics_UpdateAnalysis_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/live_video_analytics/update_operator.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/live_video_analytics/update_operator.rb deleted file mode 100644 index 3314af94668c..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/live_video_analytics/update_operator.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 visionai_v1_generated_LiveVideoAnalytics_UpdateOperator_sync] -require "google/cloud/vision_ai/v1" - -## -# Snippet for the update_operator call in the LiveVideoAnalytics 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::VisionAI::V1::LiveVideoAnalytics::Client#update_operator. -# -def update_operator - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VisionAI::V1::UpdateOperatorRequest.new - - # Call the update_operator method. - result = client.update_operator 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 visionai_v1_generated_LiveVideoAnalytics_UpdateOperator_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/live_video_analytics/update_process.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/live_video_analytics/update_process.rb deleted file mode 100644 index 588b991e8e20..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/live_video_analytics/update_process.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 visionai_v1_generated_LiveVideoAnalytics_UpdateProcess_sync] -require "google/cloud/vision_ai/v1" - -## -# Snippet for the update_process call in the LiveVideoAnalytics 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::VisionAI::V1::LiveVideoAnalytics::Client#update_process. -# -def update_process - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VisionAI::V1::UpdateProcessRequest.new - - # Call the update_process method. - result = client.update_process 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 visionai_v1_generated_LiveVideoAnalytics_UpdateProcess_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/snippet_metadata_google.cloud.visionai.v1.json b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/snippet_metadata_google.cloud.visionai.v1.json deleted file mode 100644 index 919d69b51a62..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/snippet_metadata_google.cloud.visionai.v1.json +++ /dev/null @@ -1,5495 +0,0 @@ -{ - "client_library": { - "name": "google-cloud-vision_ai-v1", - "version": "", - "language": "RUBY", - "apis": [ - { - "id": "google.cloud.visionai.v1", - "version": "v1" - } - ] - }, - "snippets": [ - { - "region_tag": "visionai_v1_generated_LiveVideoAnalytics_ListPublicOperators_sync", - "title": "Snippet for the list_public_operators call in the LiveVideoAnalytics service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client#list_public_operators.", - "file": "live_video_analytics/list_public_operators.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_public_operators", - "full_name": "::Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client#list_public_operators", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VisionAI::V1::ListPublicOperatorsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::VisionAI::V1::ListPublicOperatorsResponse", - "client": { - "short_name": "LiveVideoAnalytics::Client", - "full_name": "::Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client" - }, - "method": { - "short_name": "ListPublicOperators", - "full_name": "google.cloud.visionai.v1.LiveVideoAnalytics.ListPublicOperators", - "service": { - "short_name": "LiveVideoAnalytics", - "full_name": "google.cloud.visionai.v1.LiveVideoAnalytics" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "visionai_v1_generated_LiveVideoAnalytics_ResolveOperatorInfo_sync", - "title": "Snippet for the resolve_operator_info call in the LiveVideoAnalytics service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client#resolve_operator_info.", - "file": "live_video_analytics/resolve_operator_info.rb", - "language": "RUBY", - "client_method": { - "short_name": "resolve_operator_info", - "full_name": "::Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client#resolve_operator_info", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VisionAI::V1::ResolveOperatorInfoRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::VisionAI::V1::ResolveOperatorInfoResponse", - "client": { - "short_name": "LiveVideoAnalytics::Client", - "full_name": "::Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client" - }, - "method": { - "short_name": "ResolveOperatorInfo", - "full_name": "google.cloud.visionai.v1.LiveVideoAnalytics.ResolveOperatorInfo", - "service": { - "short_name": "LiveVideoAnalytics", - "full_name": "google.cloud.visionai.v1.LiveVideoAnalytics" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "visionai_v1_generated_LiveVideoAnalytics_ListOperators_sync", - "title": "Snippet for the list_operators call in the LiveVideoAnalytics service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client#list_operators.", - "file": "live_video_analytics/list_operators.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_operators", - "full_name": "::Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client#list_operators", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VisionAI::V1::ListOperatorsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::VisionAI::V1::ListOperatorsResponse", - "client": { - "short_name": "LiveVideoAnalytics::Client", - "full_name": "::Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client" - }, - "method": { - "short_name": "ListOperators", - "full_name": "google.cloud.visionai.v1.LiveVideoAnalytics.ListOperators", - "service": { - "short_name": "LiveVideoAnalytics", - "full_name": "google.cloud.visionai.v1.LiveVideoAnalytics" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "visionai_v1_generated_LiveVideoAnalytics_GetOperator_sync", - "title": "Snippet for the get_operator call in the LiveVideoAnalytics service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client#get_operator.", - "file": "live_video_analytics/get_operator.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_operator", - "full_name": "::Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client#get_operator", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VisionAI::V1::GetOperatorRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::VisionAI::V1::Operator", - "client": { - "short_name": "LiveVideoAnalytics::Client", - "full_name": "::Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client" - }, - "method": { - "short_name": "GetOperator", - "full_name": "google.cloud.visionai.v1.LiveVideoAnalytics.GetOperator", - "service": { - "short_name": "LiveVideoAnalytics", - "full_name": "google.cloud.visionai.v1.LiveVideoAnalytics" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "visionai_v1_generated_LiveVideoAnalytics_CreateOperator_sync", - "title": "Snippet for the create_operator call in the LiveVideoAnalytics service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client#create_operator.", - "file": "live_video_analytics/create_operator.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_operator", - "full_name": "::Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client#create_operator", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VisionAI::V1::CreateOperatorRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "LiveVideoAnalytics::Client", - "full_name": "::Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client" - }, - "method": { - "short_name": "CreateOperator", - "full_name": "google.cloud.visionai.v1.LiveVideoAnalytics.CreateOperator", - "service": { - "short_name": "LiveVideoAnalytics", - "full_name": "google.cloud.visionai.v1.LiveVideoAnalytics" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "visionai_v1_generated_LiveVideoAnalytics_UpdateOperator_sync", - "title": "Snippet for the update_operator call in the LiveVideoAnalytics service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client#update_operator.", - "file": "live_video_analytics/update_operator.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_operator", - "full_name": "::Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client#update_operator", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VisionAI::V1::UpdateOperatorRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "LiveVideoAnalytics::Client", - "full_name": "::Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client" - }, - "method": { - "short_name": "UpdateOperator", - "full_name": "google.cloud.visionai.v1.LiveVideoAnalytics.UpdateOperator", - "service": { - "short_name": "LiveVideoAnalytics", - "full_name": "google.cloud.visionai.v1.LiveVideoAnalytics" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "visionai_v1_generated_LiveVideoAnalytics_DeleteOperator_sync", - "title": "Snippet for the delete_operator call in the LiveVideoAnalytics service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client#delete_operator.", - "file": "live_video_analytics/delete_operator.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_operator", - "full_name": "::Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client#delete_operator", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VisionAI::V1::DeleteOperatorRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "LiveVideoAnalytics::Client", - "full_name": "::Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client" - }, - "method": { - "short_name": "DeleteOperator", - "full_name": "google.cloud.visionai.v1.LiveVideoAnalytics.DeleteOperator", - "service": { - "short_name": "LiveVideoAnalytics", - "full_name": "google.cloud.visionai.v1.LiveVideoAnalytics" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "visionai_v1_generated_LiveVideoAnalytics_ListAnalyses_sync", - "title": "Snippet for the list_analyses call in the LiveVideoAnalytics service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client#list_analyses.", - "file": "live_video_analytics/list_analyses.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_analyses", - "full_name": "::Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client#list_analyses", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VisionAI::V1::ListAnalysesRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::VisionAI::V1::ListAnalysesResponse", - "client": { - "short_name": "LiveVideoAnalytics::Client", - "full_name": "::Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client" - }, - "method": { - "short_name": "ListAnalyses", - "full_name": "google.cloud.visionai.v1.LiveVideoAnalytics.ListAnalyses", - "service": { - "short_name": "LiveVideoAnalytics", - "full_name": "google.cloud.visionai.v1.LiveVideoAnalytics" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "visionai_v1_generated_LiveVideoAnalytics_GetAnalysis_sync", - "title": "Snippet for the get_analysis call in the LiveVideoAnalytics service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client#get_analysis.", - "file": "live_video_analytics/get_analysis.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_analysis", - "full_name": "::Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client#get_analysis", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VisionAI::V1::GetAnalysisRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::VisionAI::V1::Analysis", - "client": { - "short_name": "LiveVideoAnalytics::Client", - "full_name": "::Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client" - }, - "method": { - "short_name": "GetAnalysis", - "full_name": "google.cloud.visionai.v1.LiveVideoAnalytics.GetAnalysis", - "service": { - "short_name": "LiveVideoAnalytics", - "full_name": "google.cloud.visionai.v1.LiveVideoAnalytics" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "visionai_v1_generated_LiveVideoAnalytics_CreateAnalysis_sync", - "title": "Snippet for the create_analysis call in the LiveVideoAnalytics service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client#create_analysis.", - "file": "live_video_analytics/create_analysis.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_analysis", - "full_name": "::Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client#create_analysis", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VisionAI::V1::CreateAnalysisRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "LiveVideoAnalytics::Client", - "full_name": "::Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client" - }, - "method": { - "short_name": "CreateAnalysis", - "full_name": "google.cloud.visionai.v1.LiveVideoAnalytics.CreateAnalysis", - "service": { - "short_name": "LiveVideoAnalytics", - "full_name": "google.cloud.visionai.v1.LiveVideoAnalytics" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "visionai_v1_generated_LiveVideoAnalytics_UpdateAnalysis_sync", - "title": "Snippet for the update_analysis call in the LiveVideoAnalytics service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client#update_analysis.", - "file": "live_video_analytics/update_analysis.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_analysis", - "full_name": "::Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client#update_analysis", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VisionAI::V1::UpdateAnalysisRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "LiveVideoAnalytics::Client", - "full_name": "::Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client" - }, - "method": { - "short_name": "UpdateAnalysis", - "full_name": "google.cloud.visionai.v1.LiveVideoAnalytics.UpdateAnalysis", - "service": { - "short_name": "LiveVideoAnalytics", - "full_name": "google.cloud.visionai.v1.LiveVideoAnalytics" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "visionai_v1_generated_LiveVideoAnalytics_DeleteAnalysis_sync", - "title": "Snippet for the delete_analysis call in the LiveVideoAnalytics service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client#delete_analysis.", - "file": "live_video_analytics/delete_analysis.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_analysis", - "full_name": "::Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client#delete_analysis", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VisionAI::V1::DeleteAnalysisRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "LiveVideoAnalytics::Client", - "full_name": "::Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client" - }, - "method": { - "short_name": "DeleteAnalysis", - "full_name": "google.cloud.visionai.v1.LiveVideoAnalytics.DeleteAnalysis", - "service": { - "short_name": "LiveVideoAnalytics", - "full_name": "google.cloud.visionai.v1.LiveVideoAnalytics" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "visionai_v1_generated_LiveVideoAnalytics_ListProcesses_sync", - "title": "Snippet for the list_processes call in the LiveVideoAnalytics service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client#list_processes.", - "file": "live_video_analytics/list_processes.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_processes", - "full_name": "::Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client#list_processes", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VisionAI::V1::ListProcessesRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::VisionAI::V1::ListProcessesResponse", - "client": { - "short_name": "LiveVideoAnalytics::Client", - "full_name": "::Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client" - }, - "method": { - "short_name": "ListProcesses", - "full_name": "google.cloud.visionai.v1.LiveVideoAnalytics.ListProcesses", - "service": { - "short_name": "LiveVideoAnalytics", - "full_name": "google.cloud.visionai.v1.LiveVideoAnalytics" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "visionai_v1_generated_LiveVideoAnalytics_GetProcess_sync", - "title": "Snippet for the get_process call in the LiveVideoAnalytics service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client#get_process.", - "file": "live_video_analytics/get_process.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_process", - "full_name": "::Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client#get_process", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VisionAI::V1::GetProcessRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::VisionAI::V1::Process", - "client": { - "short_name": "LiveVideoAnalytics::Client", - "full_name": "::Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client" - }, - "method": { - "short_name": "GetProcess", - "full_name": "google.cloud.visionai.v1.LiveVideoAnalytics.GetProcess", - "service": { - "short_name": "LiveVideoAnalytics", - "full_name": "google.cloud.visionai.v1.LiveVideoAnalytics" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "visionai_v1_generated_LiveVideoAnalytics_CreateProcess_sync", - "title": "Snippet for the create_process call in the LiveVideoAnalytics service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client#create_process.", - "file": "live_video_analytics/create_process.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_process", - "full_name": "::Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client#create_process", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VisionAI::V1::CreateProcessRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "LiveVideoAnalytics::Client", - "full_name": "::Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client" - }, - "method": { - "short_name": "CreateProcess", - "full_name": "google.cloud.visionai.v1.LiveVideoAnalytics.CreateProcess", - "service": { - "short_name": "LiveVideoAnalytics", - "full_name": "google.cloud.visionai.v1.LiveVideoAnalytics" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "visionai_v1_generated_LiveVideoAnalytics_UpdateProcess_sync", - "title": "Snippet for the update_process call in the LiveVideoAnalytics service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client#update_process.", - "file": "live_video_analytics/update_process.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_process", - "full_name": "::Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client#update_process", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VisionAI::V1::UpdateProcessRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "LiveVideoAnalytics::Client", - "full_name": "::Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client" - }, - "method": { - "short_name": "UpdateProcess", - "full_name": "google.cloud.visionai.v1.LiveVideoAnalytics.UpdateProcess", - "service": { - "short_name": "LiveVideoAnalytics", - "full_name": "google.cloud.visionai.v1.LiveVideoAnalytics" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "visionai_v1_generated_LiveVideoAnalytics_DeleteProcess_sync", - "title": "Snippet for the delete_process call in the LiveVideoAnalytics service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client#delete_process.", - "file": "live_video_analytics/delete_process.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_process", - "full_name": "::Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client#delete_process", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VisionAI::V1::DeleteProcessRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "LiveVideoAnalytics::Client", - "full_name": "::Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client" - }, - "method": { - "short_name": "DeleteProcess", - "full_name": "google.cloud.visionai.v1.LiveVideoAnalytics.DeleteProcess", - "service": { - "short_name": "LiveVideoAnalytics", - "full_name": "google.cloud.visionai.v1.LiveVideoAnalytics" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "visionai_v1_generated_LiveVideoAnalytics_BatchRunProcess_sync", - "title": "Snippet for the batch_run_process call in the LiveVideoAnalytics service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client#batch_run_process.", - "file": "live_video_analytics/batch_run_process.rb", - "language": "RUBY", - "client_method": { - "short_name": "batch_run_process", - "full_name": "::Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client#batch_run_process", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VisionAI::V1::BatchRunProcessRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "LiveVideoAnalytics::Client", - "full_name": "::Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client" - }, - "method": { - "short_name": "BatchRunProcess", - "full_name": "google.cloud.visionai.v1.LiveVideoAnalytics.BatchRunProcess", - "service": { - "short_name": "LiveVideoAnalytics", - "full_name": "google.cloud.visionai.v1.LiveVideoAnalytics" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "visionai_v1_generated_AppPlatform_ListApplications_sync", - "title": "Snippet for the list_applications call in the AppPlatform service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::AppPlatform::Client#list_applications.", - "file": "app_platform/list_applications.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_applications", - "full_name": "::Google::Cloud::VisionAI::V1::AppPlatform::Client#list_applications", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VisionAI::V1::ListApplicationsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::VisionAI::V1::ListApplicationsResponse", - "client": { - "short_name": "AppPlatform::Client", - "full_name": "::Google::Cloud::VisionAI::V1::AppPlatform::Client" - }, - "method": { - "short_name": "ListApplications", - "full_name": "google.cloud.visionai.v1.AppPlatform.ListApplications", - "service": { - "short_name": "AppPlatform", - "full_name": "google.cloud.visionai.v1.AppPlatform" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "visionai_v1_generated_AppPlatform_GetApplication_sync", - "title": "Snippet for the get_application call in the AppPlatform service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::AppPlatform::Client#get_application.", - "file": "app_platform/get_application.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_application", - "full_name": "::Google::Cloud::VisionAI::V1::AppPlatform::Client#get_application", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VisionAI::V1::GetApplicationRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::VisionAI::V1::Application", - "client": { - "short_name": "AppPlatform::Client", - "full_name": "::Google::Cloud::VisionAI::V1::AppPlatform::Client" - }, - "method": { - "short_name": "GetApplication", - "full_name": "google.cloud.visionai.v1.AppPlatform.GetApplication", - "service": { - "short_name": "AppPlatform", - "full_name": "google.cloud.visionai.v1.AppPlatform" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "visionai_v1_generated_AppPlatform_CreateApplication_sync", - "title": "Snippet for the create_application call in the AppPlatform service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::AppPlatform::Client#create_application.", - "file": "app_platform/create_application.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_application", - "full_name": "::Google::Cloud::VisionAI::V1::AppPlatform::Client#create_application", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VisionAI::V1::CreateApplicationRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "AppPlatform::Client", - "full_name": "::Google::Cloud::VisionAI::V1::AppPlatform::Client" - }, - "method": { - "short_name": "CreateApplication", - "full_name": "google.cloud.visionai.v1.AppPlatform.CreateApplication", - "service": { - "short_name": "AppPlatform", - "full_name": "google.cloud.visionai.v1.AppPlatform" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "visionai_v1_generated_AppPlatform_UpdateApplication_sync", - "title": "Snippet for the update_application call in the AppPlatform service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::AppPlatform::Client#update_application.", - "file": "app_platform/update_application.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_application", - "full_name": "::Google::Cloud::VisionAI::V1::AppPlatform::Client#update_application", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VisionAI::V1::UpdateApplicationRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "AppPlatform::Client", - "full_name": "::Google::Cloud::VisionAI::V1::AppPlatform::Client" - }, - "method": { - "short_name": "UpdateApplication", - "full_name": "google.cloud.visionai.v1.AppPlatform.UpdateApplication", - "service": { - "short_name": "AppPlatform", - "full_name": "google.cloud.visionai.v1.AppPlatform" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "visionai_v1_generated_AppPlatform_DeleteApplication_sync", - "title": "Snippet for the delete_application call in the AppPlatform service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::AppPlatform::Client#delete_application.", - "file": "app_platform/delete_application.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_application", - "full_name": "::Google::Cloud::VisionAI::V1::AppPlatform::Client#delete_application", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VisionAI::V1::DeleteApplicationRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "AppPlatform::Client", - "full_name": "::Google::Cloud::VisionAI::V1::AppPlatform::Client" - }, - "method": { - "short_name": "DeleteApplication", - "full_name": "google.cloud.visionai.v1.AppPlatform.DeleteApplication", - "service": { - "short_name": "AppPlatform", - "full_name": "google.cloud.visionai.v1.AppPlatform" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "visionai_v1_generated_AppPlatform_DeployApplication_sync", - "title": "Snippet for the deploy_application call in the AppPlatform service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::AppPlatform::Client#deploy_application.", - "file": "app_platform/deploy_application.rb", - "language": "RUBY", - "client_method": { - "short_name": "deploy_application", - "full_name": "::Google::Cloud::VisionAI::V1::AppPlatform::Client#deploy_application", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VisionAI::V1::DeployApplicationRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "AppPlatform::Client", - "full_name": "::Google::Cloud::VisionAI::V1::AppPlatform::Client" - }, - "method": { - "short_name": "DeployApplication", - "full_name": "google.cloud.visionai.v1.AppPlatform.DeployApplication", - "service": { - "short_name": "AppPlatform", - "full_name": "google.cloud.visionai.v1.AppPlatform" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "visionai_v1_generated_AppPlatform_UndeployApplication_sync", - "title": "Snippet for the undeploy_application call in the AppPlatform service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::AppPlatform::Client#undeploy_application.", - "file": "app_platform/undeploy_application.rb", - "language": "RUBY", - "client_method": { - "short_name": "undeploy_application", - "full_name": "::Google::Cloud::VisionAI::V1::AppPlatform::Client#undeploy_application", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VisionAI::V1::UndeployApplicationRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "AppPlatform::Client", - "full_name": "::Google::Cloud::VisionAI::V1::AppPlatform::Client" - }, - "method": { - "short_name": "UndeployApplication", - "full_name": "google.cloud.visionai.v1.AppPlatform.UndeployApplication", - "service": { - "short_name": "AppPlatform", - "full_name": "google.cloud.visionai.v1.AppPlatform" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "visionai_v1_generated_AppPlatform_AddApplicationStreamInput_sync", - "title": "Snippet for the add_application_stream_input call in the AppPlatform service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::AppPlatform::Client#add_application_stream_input.", - "file": "app_platform/add_application_stream_input.rb", - "language": "RUBY", - "client_method": { - "short_name": "add_application_stream_input", - "full_name": "::Google::Cloud::VisionAI::V1::AppPlatform::Client#add_application_stream_input", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VisionAI::V1::AddApplicationStreamInputRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "AppPlatform::Client", - "full_name": "::Google::Cloud::VisionAI::V1::AppPlatform::Client" - }, - "method": { - "short_name": "AddApplicationStreamInput", - "full_name": "google.cloud.visionai.v1.AppPlatform.AddApplicationStreamInput", - "service": { - "short_name": "AppPlatform", - "full_name": "google.cloud.visionai.v1.AppPlatform" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "visionai_v1_generated_AppPlatform_RemoveApplicationStreamInput_sync", - "title": "Snippet for the remove_application_stream_input call in the AppPlatform service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::AppPlatform::Client#remove_application_stream_input.", - "file": "app_platform/remove_application_stream_input.rb", - "language": "RUBY", - "client_method": { - "short_name": "remove_application_stream_input", - "full_name": "::Google::Cloud::VisionAI::V1::AppPlatform::Client#remove_application_stream_input", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VisionAI::V1::RemoveApplicationStreamInputRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "AppPlatform::Client", - "full_name": "::Google::Cloud::VisionAI::V1::AppPlatform::Client" - }, - "method": { - "short_name": "RemoveApplicationStreamInput", - "full_name": "google.cloud.visionai.v1.AppPlatform.RemoveApplicationStreamInput", - "service": { - "short_name": "AppPlatform", - "full_name": "google.cloud.visionai.v1.AppPlatform" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "visionai_v1_generated_AppPlatform_UpdateApplicationStreamInput_sync", - "title": "Snippet for the update_application_stream_input call in the AppPlatform service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::AppPlatform::Client#update_application_stream_input.", - "file": "app_platform/update_application_stream_input.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_application_stream_input", - "full_name": "::Google::Cloud::VisionAI::V1::AppPlatform::Client#update_application_stream_input", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VisionAI::V1::UpdateApplicationStreamInputRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "AppPlatform::Client", - "full_name": "::Google::Cloud::VisionAI::V1::AppPlatform::Client" - }, - "method": { - "short_name": "UpdateApplicationStreamInput", - "full_name": "google.cloud.visionai.v1.AppPlatform.UpdateApplicationStreamInput", - "service": { - "short_name": "AppPlatform", - "full_name": "google.cloud.visionai.v1.AppPlatform" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "visionai_v1_generated_AppPlatform_ListInstances_sync", - "title": "Snippet for the list_instances call in the AppPlatform service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::AppPlatform::Client#list_instances.", - "file": "app_platform/list_instances.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_instances", - "full_name": "::Google::Cloud::VisionAI::V1::AppPlatform::Client#list_instances", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VisionAI::V1::ListInstancesRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::VisionAI::V1::ListInstancesResponse", - "client": { - "short_name": "AppPlatform::Client", - "full_name": "::Google::Cloud::VisionAI::V1::AppPlatform::Client" - }, - "method": { - "short_name": "ListInstances", - "full_name": "google.cloud.visionai.v1.AppPlatform.ListInstances", - "service": { - "short_name": "AppPlatform", - "full_name": "google.cloud.visionai.v1.AppPlatform" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "visionai_v1_generated_AppPlatform_GetInstance_sync", - "title": "Snippet for the get_instance call in the AppPlatform service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::AppPlatform::Client#get_instance.", - "file": "app_platform/get_instance.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_instance", - "full_name": "::Google::Cloud::VisionAI::V1::AppPlatform::Client#get_instance", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VisionAI::V1::GetInstanceRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::VisionAI::V1::Instance", - "client": { - "short_name": "AppPlatform::Client", - "full_name": "::Google::Cloud::VisionAI::V1::AppPlatform::Client" - }, - "method": { - "short_name": "GetInstance", - "full_name": "google.cloud.visionai.v1.AppPlatform.GetInstance", - "service": { - "short_name": "AppPlatform", - "full_name": "google.cloud.visionai.v1.AppPlatform" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "visionai_v1_generated_AppPlatform_CreateApplicationInstances_sync", - "title": "Snippet for the create_application_instances call in the AppPlatform service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::AppPlatform::Client#create_application_instances.", - "file": "app_platform/create_application_instances.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_application_instances", - "full_name": "::Google::Cloud::VisionAI::V1::AppPlatform::Client#create_application_instances", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VisionAI::V1::CreateApplicationInstancesRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "AppPlatform::Client", - "full_name": "::Google::Cloud::VisionAI::V1::AppPlatform::Client" - }, - "method": { - "short_name": "CreateApplicationInstances", - "full_name": "google.cloud.visionai.v1.AppPlatform.CreateApplicationInstances", - "service": { - "short_name": "AppPlatform", - "full_name": "google.cloud.visionai.v1.AppPlatform" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "visionai_v1_generated_AppPlatform_DeleteApplicationInstances_sync", - "title": "Snippet for the delete_application_instances call in the AppPlatform service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::AppPlatform::Client#delete_application_instances.", - "file": "app_platform/delete_application_instances.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_application_instances", - "full_name": "::Google::Cloud::VisionAI::V1::AppPlatform::Client#delete_application_instances", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VisionAI::V1::DeleteApplicationInstancesRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "AppPlatform::Client", - "full_name": "::Google::Cloud::VisionAI::V1::AppPlatform::Client" - }, - "method": { - "short_name": "DeleteApplicationInstances", - "full_name": "google.cloud.visionai.v1.AppPlatform.DeleteApplicationInstances", - "service": { - "short_name": "AppPlatform", - "full_name": "google.cloud.visionai.v1.AppPlatform" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "visionai_v1_generated_AppPlatform_UpdateApplicationInstances_sync", - "title": "Snippet for the update_application_instances call in the AppPlatform service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::AppPlatform::Client#update_application_instances.", - "file": "app_platform/update_application_instances.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_application_instances", - "full_name": "::Google::Cloud::VisionAI::V1::AppPlatform::Client#update_application_instances", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VisionAI::V1::UpdateApplicationInstancesRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "AppPlatform::Client", - "full_name": "::Google::Cloud::VisionAI::V1::AppPlatform::Client" - }, - "method": { - "short_name": "UpdateApplicationInstances", - "full_name": "google.cloud.visionai.v1.AppPlatform.UpdateApplicationInstances", - "service": { - "short_name": "AppPlatform", - "full_name": "google.cloud.visionai.v1.AppPlatform" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "visionai_v1_generated_AppPlatform_ListDrafts_sync", - "title": "Snippet for the list_drafts call in the AppPlatform service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::AppPlatform::Client#list_drafts.", - "file": "app_platform/list_drafts.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_drafts", - "full_name": "::Google::Cloud::VisionAI::V1::AppPlatform::Client#list_drafts", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VisionAI::V1::ListDraftsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::VisionAI::V1::ListDraftsResponse", - "client": { - "short_name": "AppPlatform::Client", - "full_name": "::Google::Cloud::VisionAI::V1::AppPlatform::Client" - }, - "method": { - "short_name": "ListDrafts", - "full_name": "google.cloud.visionai.v1.AppPlatform.ListDrafts", - "service": { - "short_name": "AppPlatform", - "full_name": "google.cloud.visionai.v1.AppPlatform" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "visionai_v1_generated_AppPlatform_GetDraft_sync", - "title": "Snippet for the get_draft call in the AppPlatform service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::AppPlatform::Client#get_draft.", - "file": "app_platform/get_draft.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_draft", - "full_name": "::Google::Cloud::VisionAI::V1::AppPlatform::Client#get_draft", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VisionAI::V1::GetDraftRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::VisionAI::V1::Draft", - "client": { - "short_name": "AppPlatform::Client", - "full_name": "::Google::Cloud::VisionAI::V1::AppPlatform::Client" - }, - "method": { - "short_name": "GetDraft", - "full_name": "google.cloud.visionai.v1.AppPlatform.GetDraft", - "service": { - "short_name": "AppPlatform", - "full_name": "google.cloud.visionai.v1.AppPlatform" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "visionai_v1_generated_AppPlatform_CreateDraft_sync", - "title": "Snippet for the create_draft call in the AppPlatform service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::AppPlatform::Client#create_draft.", - "file": "app_platform/create_draft.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_draft", - "full_name": "::Google::Cloud::VisionAI::V1::AppPlatform::Client#create_draft", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VisionAI::V1::CreateDraftRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "AppPlatform::Client", - "full_name": "::Google::Cloud::VisionAI::V1::AppPlatform::Client" - }, - "method": { - "short_name": "CreateDraft", - "full_name": "google.cloud.visionai.v1.AppPlatform.CreateDraft", - "service": { - "short_name": "AppPlatform", - "full_name": "google.cloud.visionai.v1.AppPlatform" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "visionai_v1_generated_AppPlatform_UpdateDraft_sync", - "title": "Snippet for the update_draft call in the AppPlatform service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::AppPlatform::Client#update_draft.", - "file": "app_platform/update_draft.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_draft", - "full_name": "::Google::Cloud::VisionAI::V1::AppPlatform::Client#update_draft", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VisionAI::V1::UpdateDraftRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "AppPlatform::Client", - "full_name": "::Google::Cloud::VisionAI::V1::AppPlatform::Client" - }, - "method": { - "short_name": "UpdateDraft", - "full_name": "google.cloud.visionai.v1.AppPlatform.UpdateDraft", - "service": { - "short_name": "AppPlatform", - "full_name": "google.cloud.visionai.v1.AppPlatform" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "visionai_v1_generated_AppPlatform_DeleteDraft_sync", - "title": "Snippet for the delete_draft call in the AppPlatform service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::AppPlatform::Client#delete_draft.", - "file": "app_platform/delete_draft.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_draft", - "full_name": "::Google::Cloud::VisionAI::V1::AppPlatform::Client#delete_draft", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VisionAI::V1::DeleteDraftRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "AppPlatform::Client", - "full_name": "::Google::Cloud::VisionAI::V1::AppPlatform::Client" - }, - "method": { - "short_name": "DeleteDraft", - "full_name": "google.cloud.visionai.v1.AppPlatform.DeleteDraft", - "service": { - "short_name": "AppPlatform", - "full_name": "google.cloud.visionai.v1.AppPlatform" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "visionai_v1_generated_AppPlatform_ListProcessors_sync", - "title": "Snippet for the list_processors call in the AppPlatform service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::AppPlatform::Client#list_processors.", - "file": "app_platform/list_processors.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_processors", - "full_name": "::Google::Cloud::VisionAI::V1::AppPlatform::Client#list_processors", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VisionAI::V1::ListProcessorsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::VisionAI::V1::ListProcessorsResponse", - "client": { - "short_name": "AppPlatform::Client", - "full_name": "::Google::Cloud::VisionAI::V1::AppPlatform::Client" - }, - "method": { - "short_name": "ListProcessors", - "full_name": "google.cloud.visionai.v1.AppPlatform.ListProcessors", - "service": { - "short_name": "AppPlatform", - "full_name": "google.cloud.visionai.v1.AppPlatform" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "visionai_v1_generated_AppPlatform_ListPrebuiltProcessors_sync", - "title": "Snippet for the list_prebuilt_processors call in the AppPlatform service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::AppPlatform::Client#list_prebuilt_processors.", - "file": "app_platform/list_prebuilt_processors.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_prebuilt_processors", - "full_name": "::Google::Cloud::VisionAI::V1::AppPlatform::Client#list_prebuilt_processors", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VisionAI::V1::ListPrebuiltProcessorsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::VisionAI::V1::ListPrebuiltProcessorsResponse", - "client": { - "short_name": "AppPlatform::Client", - "full_name": "::Google::Cloud::VisionAI::V1::AppPlatform::Client" - }, - "method": { - "short_name": "ListPrebuiltProcessors", - "full_name": "google.cloud.visionai.v1.AppPlatform.ListPrebuiltProcessors", - "service": { - "short_name": "AppPlatform", - "full_name": "google.cloud.visionai.v1.AppPlatform" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "visionai_v1_generated_AppPlatform_GetProcessor_sync", - "title": "Snippet for the get_processor call in the AppPlatform service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::AppPlatform::Client#get_processor.", - "file": "app_platform/get_processor.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_processor", - "full_name": "::Google::Cloud::VisionAI::V1::AppPlatform::Client#get_processor", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VisionAI::V1::GetProcessorRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::VisionAI::V1::Processor", - "client": { - "short_name": "AppPlatform::Client", - "full_name": "::Google::Cloud::VisionAI::V1::AppPlatform::Client" - }, - "method": { - "short_name": "GetProcessor", - "full_name": "google.cloud.visionai.v1.AppPlatform.GetProcessor", - "service": { - "short_name": "AppPlatform", - "full_name": "google.cloud.visionai.v1.AppPlatform" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "visionai_v1_generated_AppPlatform_CreateProcessor_sync", - "title": "Snippet for the create_processor call in the AppPlatform service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::AppPlatform::Client#create_processor.", - "file": "app_platform/create_processor.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_processor", - "full_name": "::Google::Cloud::VisionAI::V1::AppPlatform::Client#create_processor", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VisionAI::V1::CreateProcessorRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "AppPlatform::Client", - "full_name": "::Google::Cloud::VisionAI::V1::AppPlatform::Client" - }, - "method": { - "short_name": "CreateProcessor", - "full_name": "google.cloud.visionai.v1.AppPlatform.CreateProcessor", - "service": { - "short_name": "AppPlatform", - "full_name": "google.cloud.visionai.v1.AppPlatform" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "visionai_v1_generated_AppPlatform_UpdateProcessor_sync", - "title": "Snippet for the update_processor call in the AppPlatform service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::AppPlatform::Client#update_processor.", - "file": "app_platform/update_processor.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_processor", - "full_name": "::Google::Cloud::VisionAI::V1::AppPlatform::Client#update_processor", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VisionAI::V1::UpdateProcessorRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "AppPlatform::Client", - "full_name": "::Google::Cloud::VisionAI::V1::AppPlatform::Client" - }, - "method": { - "short_name": "UpdateProcessor", - "full_name": "google.cloud.visionai.v1.AppPlatform.UpdateProcessor", - "service": { - "short_name": "AppPlatform", - "full_name": "google.cloud.visionai.v1.AppPlatform" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "visionai_v1_generated_AppPlatform_DeleteProcessor_sync", - "title": "Snippet for the delete_processor call in the AppPlatform service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::AppPlatform::Client#delete_processor.", - "file": "app_platform/delete_processor.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_processor", - "full_name": "::Google::Cloud::VisionAI::V1::AppPlatform::Client#delete_processor", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VisionAI::V1::DeleteProcessorRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "AppPlatform::Client", - "full_name": "::Google::Cloud::VisionAI::V1::AppPlatform::Client" - }, - "method": { - "short_name": "DeleteProcessor", - "full_name": "google.cloud.visionai.v1.AppPlatform.DeleteProcessor", - "service": { - "short_name": "AppPlatform", - "full_name": "google.cloud.visionai.v1.AppPlatform" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "visionai_v1_generated_StreamingService_SendPackets_sync", - "title": "Snippet for the send_packets call in the StreamingService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::StreamingService::Client#send_packets.", - "file": "streaming_service/send_packets.rb", - "language": "RUBY", - "client_method": { - "short_name": "send_packets", - "full_name": "::Google::Cloud::VisionAI::V1::StreamingService::Client#send_packets", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VisionAI::V1::SendPacketsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::VisionAI::V1::SendPacketsResponse", - "client": { - "short_name": "StreamingService::Client", - "full_name": "::Google::Cloud::VisionAI::V1::StreamingService::Client" - }, - "method": { - "short_name": "SendPackets", - "full_name": "google.cloud.visionai.v1.StreamingService.SendPackets", - "service": { - "short_name": "StreamingService", - "full_name": "google.cloud.visionai.v1.StreamingService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 55, - "type": "FULL" - } - ] - }, - { - "region_tag": "visionai_v1_generated_StreamingService_ReceivePackets_sync", - "title": "Snippet for the receive_packets call in the StreamingService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::StreamingService::Client#receive_packets.", - "file": "streaming_service/receive_packets.rb", - "language": "RUBY", - "client_method": { - "short_name": "receive_packets", - "full_name": "::Google::Cloud::VisionAI::V1::StreamingService::Client#receive_packets", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VisionAI::V1::ReceivePacketsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::VisionAI::V1::ReceivePacketsResponse", - "client": { - "short_name": "StreamingService::Client", - "full_name": "::Google::Cloud::VisionAI::V1::StreamingService::Client" - }, - "method": { - "short_name": "ReceivePackets", - "full_name": "google.cloud.visionai.v1.StreamingService.ReceivePackets", - "service": { - "short_name": "StreamingService", - "full_name": "google.cloud.visionai.v1.StreamingService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 55, - "type": "FULL" - } - ] - }, - { - "region_tag": "visionai_v1_generated_StreamingService_ReceiveEvents_sync", - "title": "Snippet for the receive_events call in the StreamingService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::StreamingService::Client#receive_events.", - "file": "streaming_service/receive_events.rb", - "language": "RUBY", - "client_method": { - "short_name": "receive_events", - "full_name": "::Google::Cloud::VisionAI::V1::StreamingService::Client#receive_events", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VisionAI::V1::ReceiveEventsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::VisionAI::V1::ReceiveEventsResponse", - "client": { - "short_name": "StreamingService::Client", - "full_name": "::Google::Cloud::VisionAI::V1::StreamingService::Client" - }, - "method": { - "short_name": "ReceiveEvents", - "full_name": "google.cloud.visionai.v1.StreamingService.ReceiveEvents", - "service": { - "short_name": "StreamingService", - "full_name": "google.cloud.visionai.v1.StreamingService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 55, - "type": "FULL" - } - ] - }, - { - "region_tag": "visionai_v1_generated_StreamingService_AcquireLease_sync", - "title": "Snippet for the acquire_lease call in the StreamingService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::StreamingService::Client#acquire_lease.", - "file": "streaming_service/acquire_lease.rb", - "language": "RUBY", - "client_method": { - "short_name": "acquire_lease", - "full_name": "::Google::Cloud::VisionAI::V1::StreamingService::Client#acquire_lease", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VisionAI::V1::AcquireLeaseRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::VisionAI::V1::Lease", - "client": { - "short_name": "StreamingService::Client", - "full_name": "::Google::Cloud::VisionAI::V1::StreamingService::Client" - }, - "method": { - "short_name": "AcquireLease", - "full_name": "google.cloud.visionai.v1.StreamingService.AcquireLease", - "service": { - "short_name": "StreamingService", - "full_name": "google.cloud.visionai.v1.StreamingService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "visionai_v1_generated_StreamingService_RenewLease_sync", - "title": "Snippet for the renew_lease call in the StreamingService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::StreamingService::Client#renew_lease.", - "file": "streaming_service/renew_lease.rb", - "language": "RUBY", - "client_method": { - "short_name": "renew_lease", - "full_name": "::Google::Cloud::VisionAI::V1::StreamingService::Client#renew_lease", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VisionAI::V1::RenewLeaseRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::VisionAI::V1::Lease", - "client": { - "short_name": "StreamingService::Client", - "full_name": "::Google::Cloud::VisionAI::V1::StreamingService::Client" - }, - "method": { - "short_name": "RenewLease", - "full_name": "google.cloud.visionai.v1.StreamingService.RenewLease", - "service": { - "short_name": "StreamingService", - "full_name": "google.cloud.visionai.v1.StreamingService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "visionai_v1_generated_StreamingService_ReleaseLease_sync", - "title": "Snippet for the release_lease call in the StreamingService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::StreamingService::Client#release_lease.", - "file": "streaming_service/release_lease.rb", - "language": "RUBY", - "client_method": { - "short_name": "release_lease", - "full_name": "::Google::Cloud::VisionAI::V1::StreamingService::Client#release_lease", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VisionAI::V1::ReleaseLeaseRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::VisionAI::V1::ReleaseLeaseResponse", - "client": { - "short_name": "StreamingService::Client", - "full_name": "::Google::Cloud::VisionAI::V1::StreamingService::Client" - }, - "method": { - "short_name": "ReleaseLease", - "full_name": "google.cloud.visionai.v1.StreamingService.ReleaseLease", - "service": { - "short_name": "StreamingService", - "full_name": "google.cloud.visionai.v1.StreamingService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "visionai_v1_generated_StreamsService_ListClusters_sync", - "title": "Snippet for the list_clusters call in the StreamsService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::StreamsService::Client#list_clusters.", - "file": "streams_service/list_clusters.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_clusters", - "full_name": "::Google::Cloud::VisionAI::V1::StreamsService::Client#list_clusters", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VisionAI::V1::ListClustersRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::VisionAI::V1::ListClustersResponse", - "client": { - "short_name": "StreamsService::Client", - "full_name": "::Google::Cloud::VisionAI::V1::StreamsService::Client" - }, - "method": { - "short_name": "ListClusters", - "full_name": "google.cloud.visionai.v1.StreamsService.ListClusters", - "service": { - "short_name": "StreamsService", - "full_name": "google.cloud.visionai.v1.StreamsService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "visionai_v1_generated_StreamsService_GetCluster_sync", - "title": "Snippet for the get_cluster call in the StreamsService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::StreamsService::Client#get_cluster.", - "file": "streams_service/get_cluster.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_cluster", - "full_name": "::Google::Cloud::VisionAI::V1::StreamsService::Client#get_cluster", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VisionAI::V1::GetClusterRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::VisionAI::V1::Cluster", - "client": { - "short_name": "StreamsService::Client", - "full_name": "::Google::Cloud::VisionAI::V1::StreamsService::Client" - }, - "method": { - "short_name": "GetCluster", - "full_name": "google.cloud.visionai.v1.StreamsService.GetCluster", - "service": { - "short_name": "StreamsService", - "full_name": "google.cloud.visionai.v1.StreamsService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "visionai_v1_generated_StreamsService_CreateCluster_sync", - "title": "Snippet for the create_cluster call in the StreamsService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::StreamsService::Client#create_cluster.", - "file": "streams_service/create_cluster.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_cluster", - "full_name": "::Google::Cloud::VisionAI::V1::StreamsService::Client#create_cluster", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VisionAI::V1::CreateClusterRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "StreamsService::Client", - "full_name": "::Google::Cloud::VisionAI::V1::StreamsService::Client" - }, - "method": { - "short_name": "CreateCluster", - "full_name": "google.cloud.visionai.v1.StreamsService.CreateCluster", - "service": { - "short_name": "StreamsService", - "full_name": "google.cloud.visionai.v1.StreamsService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "visionai_v1_generated_StreamsService_UpdateCluster_sync", - "title": "Snippet for the update_cluster call in the StreamsService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::StreamsService::Client#update_cluster.", - "file": "streams_service/update_cluster.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_cluster", - "full_name": "::Google::Cloud::VisionAI::V1::StreamsService::Client#update_cluster", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VisionAI::V1::UpdateClusterRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "StreamsService::Client", - "full_name": "::Google::Cloud::VisionAI::V1::StreamsService::Client" - }, - "method": { - "short_name": "UpdateCluster", - "full_name": "google.cloud.visionai.v1.StreamsService.UpdateCluster", - "service": { - "short_name": "StreamsService", - "full_name": "google.cloud.visionai.v1.StreamsService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "visionai_v1_generated_StreamsService_DeleteCluster_sync", - "title": "Snippet for the delete_cluster call in the StreamsService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::StreamsService::Client#delete_cluster.", - "file": "streams_service/delete_cluster.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_cluster", - "full_name": "::Google::Cloud::VisionAI::V1::StreamsService::Client#delete_cluster", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VisionAI::V1::DeleteClusterRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "StreamsService::Client", - "full_name": "::Google::Cloud::VisionAI::V1::StreamsService::Client" - }, - "method": { - "short_name": "DeleteCluster", - "full_name": "google.cloud.visionai.v1.StreamsService.DeleteCluster", - "service": { - "short_name": "StreamsService", - "full_name": "google.cloud.visionai.v1.StreamsService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "visionai_v1_generated_StreamsService_ListStreams_sync", - "title": "Snippet for the list_streams call in the StreamsService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::StreamsService::Client#list_streams.", - "file": "streams_service/list_streams.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_streams", - "full_name": "::Google::Cloud::VisionAI::V1::StreamsService::Client#list_streams", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VisionAI::V1::ListStreamsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::VisionAI::V1::ListStreamsResponse", - "client": { - "short_name": "StreamsService::Client", - "full_name": "::Google::Cloud::VisionAI::V1::StreamsService::Client" - }, - "method": { - "short_name": "ListStreams", - "full_name": "google.cloud.visionai.v1.StreamsService.ListStreams", - "service": { - "short_name": "StreamsService", - "full_name": "google.cloud.visionai.v1.StreamsService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "visionai_v1_generated_StreamsService_GetStream_sync", - "title": "Snippet for the get_stream call in the StreamsService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::StreamsService::Client#get_stream.", - "file": "streams_service/get_stream.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_stream", - "full_name": "::Google::Cloud::VisionAI::V1::StreamsService::Client#get_stream", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VisionAI::V1::GetStreamRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::VisionAI::V1::Stream", - "client": { - "short_name": "StreamsService::Client", - "full_name": "::Google::Cloud::VisionAI::V1::StreamsService::Client" - }, - "method": { - "short_name": "GetStream", - "full_name": "google.cloud.visionai.v1.StreamsService.GetStream", - "service": { - "short_name": "StreamsService", - "full_name": "google.cloud.visionai.v1.StreamsService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "visionai_v1_generated_StreamsService_CreateStream_sync", - "title": "Snippet for the create_stream call in the StreamsService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::StreamsService::Client#create_stream.", - "file": "streams_service/create_stream.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_stream", - "full_name": "::Google::Cloud::VisionAI::V1::StreamsService::Client#create_stream", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VisionAI::V1::CreateStreamRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "StreamsService::Client", - "full_name": "::Google::Cloud::VisionAI::V1::StreamsService::Client" - }, - "method": { - "short_name": "CreateStream", - "full_name": "google.cloud.visionai.v1.StreamsService.CreateStream", - "service": { - "short_name": "StreamsService", - "full_name": "google.cloud.visionai.v1.StreamsService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "visionai_v1_generated_StreamsService_UpdateStream_sync", - "title": "Snippet for the update_stream call in the StreamsService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::StreamsService::Client#update_stream.", - "file": "streams_service/update_stream.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_stream", - "full_name": "::Google::Cloud::VisionAI::V1::StreamsService::Client#update_stream", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VisionAI::V1::UpdateStreamRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "StreamsService::Client", - "full_name": "::Google::Cloud::VisionAI::V1::StreamsService::Client" - }, - "method": { - "short_name": "UpdateStream", - "full_name": "google.cloud.visionai.v1.StreamsService.UpdateStream", - "service": { - "short_name": "StreamsService", - "full_name": "google.cloud.visionai.v1.StreamsService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "visionai_v1_generated_StreamsService_DeleteStream_sync", - "title": "Snippet for the delete_stream call in the StreamsService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::StreamsService::Client#delete_stream.", - "file": "streams_service/delete_stream.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_stream", - "full_name": "::Google::Cloud::VisionAI::V1::StreamsService::Client#delete_stream", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VisionAI::V1::DeleteStreamRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "StreamsService::Client", - "full_name": "::Google::Cloud::VisionAI::V1::StreamsService::Client" - }, - "method": { - "short_name": "DeleteStream", - "full_name": "google.cloud.visionai.v1.StreamsService.DeleteStream", - "service": { - "short_name": "StreamsService", - "full_name": "google.cloud.visionai.v1.StreamsService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "visionai_v1_generated_StreamsService_GetStreamThumbnail_sync", - "title": "Snippet for the get_stream_thumbnail call in the StreamsService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::StreamsService::Client#get_stream_thumbnail.", - "file": "streams_service/get_stream_thumbnail.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_stream_thumbnail", - "full_name": "::Google::Cloud::VisionAI::V1::StreamsService::Client#get_stream_thumbnail", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VisionAI::V1::GetStreamThumbnailRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "StreamsService::Client", - "full_name": "::Google::Cloud::VisionAI::V1::StreamsService::Client" - }, - "method": { - "short_name": "GetStreamThumbnail", - "full_name": "google.cloud.visionai.v1.StreamsService.GetStreamThumbnail", - "service": { - "short_name": "StreamsService", - "full_name": "google.cloud.visionai.v1.StreamsService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "visionai_v1_generated_StreamsService_GenerateStreamHlsToken_sync", - "title": "Snippet for the generate_stream_hls_token call in the StreamsService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::StreamsService::Client#generate_stream_hls_token.", - "file": "streams_service/generate_stream_hls_token.rb", - "language": "RUBY", - "client_method": { - "short_name": "generate_stream_hls_token", - "full_name": "::Google::Cloud::VisionAI::V1::StreamsService::Client#generate_stream_hls_token", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VisionAI::V1::GenerateStreamHlsTokenRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::VisionAI::V1::GenerateStreamHlsTokenResponse", - "client": { - "short_name": "StreamsService::Client", - "full_name": "::Google::Cloud::VisionAI::V1::StreamsService::Client" - }, - "method": { - "short_name": "GenerateStreamHlsToken", - "full_name": "google.cloud.visionai.v1.StreamsService.GenerateStreamHlsToken", - "service": { - "short_name": "StreamsService", - "full_name": "google.cloud.visionai.v1.StreamsService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "visionai_v1_generated_StreamsService_ListEvents_sync", - "title": "Snippet for the list_events call in the StreamsService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::StreamsService::Client#list_events.", - "file": "streams_service/list_events.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_events", - "full_name": "::Google::Cloud::VisionAI::V1::StreamsService::Client#list_events", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VisionAI::V1::ListEventsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::VisionAI::V1::ListEventsResponse", - "client": { - "short_name": "StreamsService::Client", - "full_name": "::Google::Cloud::VisionAI::V1::StreamsService::Client" - }, - "method": { - "short_name": "ListEvents", - "full_name": "google.cloud.visionai.v1.StreamsService.ListEvents", - "service": { - "short_name": "StreamsService", - "full_name": "google.cloud.visionai.v1.StreamsService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "visionai_v1_generated_StreamsService_GetEvent_sync", - "title": "Snippet for the get_event call in the StreamsService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::StreamsService::Client#get_event.", - "file": "streams_service/get_event.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_event", - "full_name": "::Google::Cloud::VisionAI::V1::StreamsService::Client#get_event", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VisionAI::V1::GetEventRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::VisionAI::V1::Event", - "client": { - "short_name": "StreamsService::Client", - "full_name": "::Google::Cloud::VisionAI::V1::StreamsService::Client" - }, - "method": { - "short_name": "GetEvent", - "full_name": "google.cloud.visionai.v1.StreamsService.GetEvent", - "service": { - "short_name": "StreamsService", - "full_name": "google.cloud.visionai.v1.StreamsService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "visionai_v1_generated_StreamsService_CreateEvent_sync", - "title": "Snippet for the create_event call in the StreamsService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::StreamsService::Client#create_event.", - "file": "streams_service/create_event.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_event", - "full_name": "::Google::Cloud::VisionAI::V1::StreamsService::Client#create_event", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VisionAI::V1::CreateEventRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "StreamsService::Client", - "full_name": "::Google::Cloud::VisionAI::V1::StreamsService::Client" - }, - "method": { - "short_name": "CreateEvent", - "full_name": "google.cloud.visionai.v1.StreamsService.CreateEvent", - "service": { - "short_name": "StreamsService", - "full_name": "google.cloud.visionai.v1.StreamsService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "visionai_v1_generated_StreamsService_UpdateEvent_sync", - "title": "Snippet for the update_event call in the StreamsService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::StreamsService::Client#update_event.", - "file": "streams_service/update_event.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_event", - "full_name": "::Google::Cloud::VisionAI::V1::StreamsService::Client#update_event", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VisionAI::V1::UpdateEventRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "StreamsService::Client", - "full_name": "::Google::Cloud::VisionAI::V1::StreamsService::Client" - }, - "method": { - "short_name": "UpdateEvent", - "full_name": "google.cloud.visionai.v1.StreamsService.UpdateEvent", - "service": { - "short_name": "StreamsService", - "full_name": "google.cloud.visionai.v1.StreamsService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "visionai_v1_generated_StreamsService_DeleteEvent_sync", - "title": "Snippet for the delete_event call in the StreamsService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::StreamsService::Client#delete_event.", - "file": "streams_service/delete_event.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_event", - "full_name": "::Google::Cloud::VisionAI::V1::StreamsService::Client#delete_event", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VisionAI::V1::DeleteEventRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "StreamsService::Client", - "full_name": "::Google::Cloud::VisionAI::V1::StreamsService::Client" - }, - "method": { - "short_name": "DeleteEvent", - "full_name": "google.cloud.visionai.v1.StreamsService.DeleteEvent", - "service": { - "short_name": "StreamsService", - "full_name": "google.cloud.visionai.v1.StreamsService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "visionai_v1_generated_StreamsService_ListSeries_sync", - "title": "Snippet for the list_series call in the StreamsService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::StreamsService::Client#list_series.", - "file": "streams_service/list_series.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_series", - "full_name": "::Google::Cloud::VisionAI::V1::StreamsService::Client#list_series", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VisionAI::V1::ListSeriesRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::VisionAI::V1::ListSeriesResponse", - "client": { - "short_name": "StreamsService::Client", - "full_name": "::Google::Cloud::VisionAI::V1::StreamsService::Client" - }, - "method": { - "short_name": "ListSeries", - "full_name": "google.cloud.visionai.v1.StreamsService.ListSeries", - "service": { - "short_name": "StreamsService", - "full_name": "google.cloud.visionai.v1.StreamsService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "visionai_v1_generated_StreamsService_GetSeries_sync", - "title": "Snippet for the get_series call in the StreamsService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::StreamsService::Client#get_series.", - "file": "streams_service/get_series.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_series", - "full_name": "::Google::Cloud::VisionAI::V1::StreamsService::Client#get_series", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VisionAI::V1::GetSeriesRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::VisionAI::V1::Series", - "client": { - "short_name": "StreamsService::Client", - "full_name": "::Google::Cloud::VisionAI::V1::StreamsService::Client" - }, - "method": { - "short_name": "GetSeries", - "full_name": "google.cloud.visionai.v1.StreamsService.GetSeries", - "service": { - "short_name": "StreamsService", - "full_name": "google.cloud.visionai.v1.StreamsService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "visionai_v1_generated_StreamsService_CreateSeries_sync", - "title": "Snippet for the create_series call in the StreamsService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::StreamsService::Client#create_series.", - "file": "streams_service/create_series.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_series", - "full_name": "::Google::Cloud::VisionAI::V1::StreamsService::Client#create_series", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VisionAI::V1::CreateSeriesRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "StreamsService::Client", - "full_name": "::Google::Cloud::VisionAI::V1::StreamsService::Client" - }, - "method": { - "short_name": "CreateSeries", - "full_name": "google.cloud.visionai.v1.StreamsService.CreateSeries", - "service": { - "short_name": "StreamsService", - "full_name": "google.cloud.visionai.v1.StreamsService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "visionai_v1_generated_StreamsService_UpdateSeries_sync", - "title": "Snippet for the update_series call in the StreamsService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::StreamsService::Client#update_series.", - "file": "streams_service/update_series.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_series", - "full_name": "::Google::Cloud::VisionAI::V1::StreamsService::Client#update_series", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VisionAI::V1::UpdateSeriesRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "StreamsService::Client", - "full_name": "::Google::Cloud::VisionAI::V1::StreamsService::Client" - }, - "method": { - "short_name": "UpdateSeries", - "full_name": "google.cloud.visionai.v1.StreamsService.UpdateSeries", - "service": { - "short_name": "StreamsService", - "full_name": "google.cloud.visionai.v1.StreamsService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "visionai_v1_generated_StreamsService_DeleteSeries_sync", - "title": "Snippet for the delete_series call in the StreamsService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::StreamsService::Client#delete_series.", - "file": "streams_service/delete_series.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_series", - "full_name": "::Google::Cloud::VisionAI::V1::StreamsService::Client#delete_series", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VisionAI::V1::DeleteSeriesRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "StreamsService::Client", - "full_name": "::Google::Cloud::VisionAI::V1::StreamsService::Client" - }, - "method": { - "short_name": "DeleteSeries", - "full_name": "google.cloud.visionai.v1.StreamsService.DeleteSeries", - "service": { - "short_name": "StreamsService", - "full_name": "google.cloud.visionai.v1.StreamsService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "visionai_v1_generated_StreamsService_MaterializeChannel_sync", - "title": "Snippet for the materialize_channel call in the StreamsService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::StreamsService::Client#materialize_channel.", - "file": "streams_service/materialize_channel.rb", - "language": "RUBY", - "client_method": { - "short_name": "materialize_channel", - "full_name": "::Google::Cloud::VisionAI::V1::StreamsService::Client#materialize_channel", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VisionAI::V1::MaterializeChannelRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "StreamsService::Client", - "full_name": "::Google::Cloud::VisionAI::V1::StreamsService::Client" - }, - "method": { - "short_name": "MaterializeChannel", - "full_name": "google.cloud.visionai.v1.StreamsService.MaterializeChannel", - "service": { - "short_name": "StreamsService", - "full_name": "google.cloud.visionai.v1.StreamsService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "visionai_v1_generated_Warehouse_CreateAsset_sync", - "title": "Snippet for the create_asset call in the Warehouse service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::Warehouse::Client#create_asset.", - "file": "warehouse/create_asset.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_asset", - "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client#create_asset", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VisionAI::V1::CreateAssetRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::VisionAI::V1::Asset", - "client": { - "short_name": "Warehouse::Client", - "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client" - }, - "method": { - "short_name": "CreateAsset", - "full_name": "google.cloud.visionai.v1.Warehouse.CreateAsset", - "service": { - "short_name": "Warehouse", - "full_name": "google.cloud.visionai.v1.Warehouse" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "visionai_v1_generated_Warehouse_UpdateAsset_sync", - "title": "Snippet for the update_asset call in the Warehouse service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::Warehouse::Client#update_asset.", - "file": "warehouse/update_asset.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_asset", - "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client#update_asset", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VisionAI::V1::UpdateAssetRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::VisionAI::V1::Asset", - "client": { - "short_name": "Warehouse::Client", - "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client" - }, - "method": { - "short_name": "UpdateAsset", - "full_name": "google.cloud.visionai.v1.Warehouse.UpdateAsset", - "service": { - "short_name": "Warehouse", - "full_name": "google.cloud.visionai.v1.Warehouse" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "visionai_v1_generated_Warehouse_GetAsset_sync", - "title": "Snippet for the get_asset call in the Warehouse service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::Warehouse::Client#get_asset.", - "file": "warehouse/get_asset.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_asset", - "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client#get_asset", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VisionAI::V1::GetAssetRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::VisionAI::V1::Asset", - "client": { - "short_name": "Warehouse::Client", - "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client" - }, - "method": { - "short_name": "GetAsset", - "full_name": "google.cloud.visionai.v1.Warehouse.GetAsset", - "service": { - "short_name": "Warehouse", - "full_name": "google.cloud.visionai.v1.Warehouse" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "visionai_v1_generated_Warehouse_ListAssets_sync", - "title": "Snippet for the list_assets call in the Warehouse service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::Warehouse::Client#list_assets.", - "file": "warehouse/list_assets.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_assets", - "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client#list_assets", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VisionAI::V1::ListAssetsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::VisionAI::V1::ListAssetsResponse", - "client": { - "short_name": "Warehouse::Client", - "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client" - }, - "method": { - "short_name": "ListAssets", - "full_name": "google.cloud.visionai.v1.Warehouse.ListAssets", - "service": { - "short_name": "Warehouse", - "full_name": "google.cloud.visionai.v1.Warehouse" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "visionai_v1_generated_Warehouse_DeleteAsset_sync", - "title": "Snippet for the delete_asset call in the Warehouse service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::Warehouse::Client#delete_asset.", - "file": "warehouse/delete_asset.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_asset", - "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client#delete_asset", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VisionAI::V1::DeleteAssetRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "Warehouse::Client", - "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client" - }, - "method": { - "short_name": "DeleteAsset", - "full_name": "google.cloud.visionai.v1.Warehouse.DeleteAsset", - "service": { - "short_name": "Warehouse", - "full_name": "google.cloud.visionai.v1.Warehouse" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "visionai_v1_generated_Warehouse_UploadAsset_sync", - "title": "Snippet for the upload_asset call in the Warehouse service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::Warehouse::Client#upload_asset.", - "file": "warehouse/upload_asset.rb", - "language": "RUBY", - "client_method": { - "short_name": "upload_asset", - "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client#upload_asset", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VisionAI::V1::UploadAssetRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "Warehouse::Client", - "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client" - }, - "method": { - "short_name": "UploadAsset", - "full_name": "google.cloud.visionai.v1.Warehouse.UploadAsset", - "service": { - "short_name": "Warehouse", - "full_name": "google.cloud.visionai.v1.Warehouse" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "visionai_v1_generated_Warehouse_GenerateRetrievalUrl_sync", - "title": "Snippet for the generate_retrieval_url call in the Warehouse service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::Warehouse::Client#generate_retrieval_url.", - "file": "warehouse/generate_retrieval_url.rb", - "language": "RUBY", - "client_method": { - "short_name": "generate_retrieval_url", - "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client#generate_retrieval_url", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VisionAI::V1::GenerateRetrievalUrlRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::VisionAI::V1::GenerateRetrievalUrlResponse", - "client": { - "short_name": "Warehouse::Client", - "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client" - }, - "method": { - "short_name": "GenerateRetrievalUrl", - "full_name": "google.cloud.visionai.v1.Warehouse.GenerateRetrievalUrl", - "service": { - "short_name": "Warehouse", - "full_name": "google.cloud.visionai.v1.Warehouse" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "visionai_v1_generated_Warehouse_AnalyzeAsset_sync", - "title": "Snippet for the analyze_asset call in the Warehouse service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::Warehouse::Client#analyze_asset.", - "file": "warehouse/analyze_asset.rb", - "language": "RUBY", - "client_method": { - "short_name": "analyze_asset", - "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client#analyze_asset", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VisionAI::V1::AnalyzeAssetRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "Warehouse::Client", - "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client" - }, - "method": { - "short_name": "AnalyzeAsset", - "full_name": "google.cloud.visionai.v1.Warehouse.AnalyzeAsset", - "service": { - "short_name": "Warehouse", - "full_name": "google.cloud.visionai.v1.Warehouse" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "visionai_v1_generated_Warehouse_IndexAsset_sync", - "title": "Snippet for the index_asset call in the Warehouse service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::Warehouse::Client#index_asset.", - "file": "warehouse/index_asset.rb", - "language": "RUBY", - "client_method": { - "short_name": "index_asset", - "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client#index_asset", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VisionAI::V1::IndexAssetRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "Warehouse::Client", - "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client" - }, - "method": { - "short_name": "IndexAsset", - "full_name": "google.cloud.visionai.v1.Warehouse.IndexAsset", - "service": { - "short_name": "Warehouse", - "full_name": "google.cloud.visionai.v1.Warehouse" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "visionai_v1_generated_Warehouse_RemoveIndexAsset_sync", - "title": "Snippet for the remove_index_asset call in the Warehouse service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::Warehouse::Client#remove_index_asset.", - "file": "warehouse/remove_index_asset.rb", - "language": "RUBY", - "client_method": { - "short_name": "remove_index_asset", - "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client#remove_index_asset", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VisionAI::V1::RemoveIndexAssetRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "Warehouse::Client", - "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client" - }, - "method": { - "short_name": "RemoveIndexAsset", - "full_name": "google.cloud.visionai.v1.Warehouse.RemoveIndexAsset", - "service": { - "short_name": "Warehouse", - "full_name": "google.cloud.visionai.v1.Warehouse" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "visionai_v1_generated_Warehouse_ViewIndexedAssets_sync", - "title": "Snippet for the view_indexed_assets call in the Warehouse service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::Warehouse::Client#view_indexed_assets.", - "file": "warehouse/view_indexed_assets.rb", - "language": "RUBY", - "client_method": { - "short_name": "view_indexed_assets", - "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client#view_indexed_assets", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VisionAI::V1::ViewIndexedAssetsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::VisionAI::V1::ViewIndexedAssetsResponse", - "client": { - "short_name": "Warehouse::Client", - "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client" - }, - "method": { - "short_name": "ViewIndexedAssets", - "full_name": "google.cloud.visionai.v1.Warehouse.ViewIndexedAssets", - "service": { - "short_name": "Warehouse", - "full_name": "google.cloud.visionai.v1.Warehouse" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "visionai_v1_generated_Warehouse_CreateIndex_sync", - "title": "Snippet for the create_index call in the Warehouse service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::Warehouse::Client#create_index.", - "file": "warehouse/create_index.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_index", - "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client#create_index", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VisionAI::V1::CreateIndexRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "Warehouse::Client", - "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client" - }, - "method": { - "short_name": "CreateIndex", - "full_name": "google.cloud.visionai.v1.Warehouse.CreateIndex", - "service": { - "short_name": "Warehouse", - "full_name": "google.cloud.visionai.v1.Warehouse" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "visionai_v1_generated_Warehouse_UpdateIndex_sync", - "title": "Snippet for the update_index call in the Warehouse service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::Warehouse::Client#update_index.", - "file": "warehouse/update_index.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_index", - "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client#update_index", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VisionAI::V1::UpdateIndexRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "Warehouse::Client", - "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client" - }, - "method": { - "short_name": "UpdateIndex", - "full_name": "google.cloud.visionai.v1.Warehouse.UpdateIndex", - "service": { - "short_name": "Warehouse", - "full_name": "google.cloud.visionai.v1.Warehouse" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "visionai_v1_generated_Warehouse_GetIndex_sync", - "title": "Snippet for the get_index call in the Warehouse service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::Warehouse::Client#get_index.", - "file": "warehouse/get_index.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_index", - "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client#get_index", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VisionAI::V1::GetIndexRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::VisionAI::V1::Index", - "client": { - "short_name": "Warehouse::Client", - "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client" - }, - "method": { - "short_name": "GetIndex", - "full_name": "google.cloud.visionai.v1.Warehouse.GetIndex", - "service": { - "short_name": "Warehouse", - "full_name": "google.cloud.visionai.v1.Warehouse" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "visionai_v1_generated_Warehouse_ListIndexes_sync", - "title": "Snippet for the list_indexes call in the Warehouse service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::Warehouse::Client#list_indexes.", - "file": "warehouse/list_indexes.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_indexes", - "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client#list_indexes", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VisionAI::V1::ListIndexesRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::VisionAI::V1::ListIndexesResponse", - "client": { - "short_name": "Warehouse::Client", - "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client" - }, - "method": { - "short_name": "ListIndexes", - "full_name": "google.cloud.visionai.v1.Warehouse.ListIndexes", - "service": { - "short_name": "Warehouse", - "full_name": "google.cloud.visionai.v1.Warehouse" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "visionai_v1_generated_Warehouse_DeleteIndex_sync", - "title": "Snippet for the delete_index call in the Warehouse service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::Warehouse::Client#delete_index.", - "file": "warehouse/delete_index.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_index", - "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client#delete_index", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VisionAI::V1::DeleteIndexRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "Warehouse::Client", - "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client" - }, - "method": { - "short_name": "DeleteIndex", - "full_name": "google.cloud.visionai.v1.Warehouse.DeleteIndex", - "service": { - "short_name": "Warehouse", - "full_name": "google.cloud.visionai.v1.Warehouse" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "visionai_v1_generated_Warehouse_CreateCorpus_sync", - "title": "Snippet for the create_corpus call in the Warehouse service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::Warehouse::Client#create_corpus.", - "file": "warehouse/create_corpus.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_corpus", - "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client#create_corpus", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VisionAI::V1::CreateCorpusRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "Warehouse::Client", - "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client" - }, - "method": { - "short_name": "CreateCorpus", - "full_name": "google.cloud.visionai.v1.Warehouse.CreateCorpus", - "service": { - "short_name": "Warehouse", - "full_name": "google.cloud.visionai.v1.Warehouse" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "visionai_v1_generated_Warehouse_GetCorpus_sync", - "title": "Snippet for the get_corpus call in the Warehouse service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::Warehouse::Client#get_corpus.", - "file": "warehouse/get_corpus.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_corpus", - "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client#get_corpus", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VisionAI::V1::GetCorpusRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::VisionAI::V1::Corpus", - "client": { - "short_name": "Warehouse::Client", - "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client" - }, - "method": { - "short_name": "GetCorpus", - "full_name": "google.cloud.visionai.v1.Warehouse.GetCorpus", - "service": { - "short_name": "Warehouse", - "full_name": "google.cloud.visionai.v1.Warehouse" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "visionai_v1_generated_Warehouse_UpdateCorpus_sync", - "title": "Snippet for the update_corpus call in the Warehouse service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::Warehouse::Client#update_corpus.", - "file": "warehouse/update_corpus.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_corpus", - "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client#update_corpus", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VisionAI::V1::UpdateCorpusRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::VisionAI::V1::Corpus", - "client": { - "short_name": "Warehouse::Client", - "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client" - }, - "method": { - "short_name": "UpdateCorpus", - "full_name": "google.cloud.visionai.v1.Warehouse.UpdateCorpus", - "service": { - "short_name": "Warehouse", - "full_name": "google.cloud.visionai.v1.Warehouse" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "visionai_v1_generated_Warehouse_ListCorpora_sync", - "title": "Snippet for the list_corpora call in the Warehouse service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::Warehouse::Client#list_corpora.", - "file": "warehouse/list_corpora.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_corpora", - "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client#list_corpora", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VisionAI::V1::ListCorporaRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::VisionAI::V1::ListCorporaResponse", - "client": { - "short_name": "Warehouse::Client", - "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client" - }, - "method": { - "short_name": "ListCorpora", - "full_name": "google.cloud.visionai.v1.Warehouse.ListCorpora", - "service": { - "short_name": "Warehouse", - "full_name": "google.cloud.visionai.v1.Warehouse" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "visionai_v1_generated_Warehouse_DeleteCorpus_sync", - "title": "Snippet for the delete_corpus call in the Warehouse service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::Warehouse::Client#delete_corpus.", - "file": "warehouse/delete_corpus.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_corpus", - "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client#delete_corpus", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VisionAI::V1::DeleteCorpusRequest", - "name": "request" - } - ], - "result_type": "::Google::Protobuf::Empty", - "client": { - "short_name": "Warehouse::Client", - "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client" - }, - "method": { - "short_name": "DeleteCorpus", - "full_name": "google.cloud.visionai.v1.Warehouse.DeleteCorpus", - "service": { - "short_name": "Warehouse", - "full_name": "google.cloud.visionai.v1.Warehouse" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "visionai_v1_generated_Warehouse_AnalyzeCorpus_sync", - "title": "Snippet for the analyze_corpus call in the Warehouse service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::Warehouse::Client#analyze_corpus.", - "file": "warehouse/analyze_corpus.rb", - "language": "RUBY", - "client_method": { - "short_name": "analyze_corpus", - "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client#analyze_corpus", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VisionAI::V1::AnalyzeCorpusRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "Warehouse::Client", - "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client" - }, - "method": { - "short_name": "AnalyzeCorpus", - "full_name": "google.cloud.visionai.v1.Warehouse.AnalyzeCorpus", - "service": { - "short_name": "Warehouse", - "full_name": "google.cloud.visionai.v1.Warehouse" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "visionai_v1_generated_Warehouse_CreateDataSchema_sync", - "title": "Snippet for the create_data_schema call in the Warehouse service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::Warehouse::Client#create_data_schema.", - "file": "warehouse/create_data_schema.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_data_schema", - "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client#create_data_schema", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VisionAI::V1::CreateDataSchemaRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::VisionAI::V1::DataSchema", - "client": { - "short_name": "Warehouse::Client", - "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client" - }, - "method": { - "short_name": "CreateDataSchema", - "full_name": "google.cloud.visionai.v1.Warehouse.CreateDataSchema", - "service": { - "short_name": "Warehouse", - "full_name": "google.cloud.visionai.v1.Warehouse" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "visionai_v1_generated_Warehouse_UpdateDataSchema_sync", - "title": "Snippet for the update_data_schema call in the Warehouse service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::Warehouse::Client#update_data_schema.", - "file": "warehouse/update_data_schema.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_data_schema", - "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client#update_data_schema", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VisionAI::V1::UpdateDataSchemaRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::VisionAI::V1::DataSchema", - "client": { - "short_name": "Warehouse::Client", - "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client" - }, - "method": { - "short_name": "UpdateDataSchema", - "full_name": "google.cloud.visionai.v1.Warehouse.UpdateDataSchema", - "service": { - "short_name": "Warehouse", - "full_name": "google.cloud.visionai.v1.Warehouse" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "visionai_v1_generated_Warehouse_GetDataSchema_sync", - "title": "Snippet for the get_data_schema call in the Warehouse service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::Warehouse::Client#get_data_schema.", - "file": "warehouse/get_data_schema.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_data_schema", - "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client#get_data_schema", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VisionAI::V1::GetDataSchemaRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::VisionAI::V1::DataSchema", - "client": { - "short_name": "Warehouse::Client", - "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client" - }, - "method": { - "short_name": "GetDataSchema", - "full_name": "google.cloud.visionai.v1.Warehouse.GetDataSchema", - "service": { - "short_name": "Warehouse", - "full_name": "google.cloud.visionai.v1.Warehouse" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "visionai_v1_generated_Warehouse_DeleteDataSchema_sync", - "title": "Snippet for the delete_data_schema call in the Warehouse service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::Warehouse::Client#delete_data_schema.", - "file": "warehouse/delete_data_schema.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_data_schema", - "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client#delete_data_schema", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VisionAI::V1::DeleteDataSchemaRequest", - "name": "request" - } - ], - "result_type": "::Google::Protobuf::Empty", - "client": { - "short_name": "Warehouse::Client", - "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client" - }, - "method": { - "short_name": "DeleteDataSchema", - "full_name": "google.cloud.visionai.v1.Warehouse.DeleteDataSchema", - "service": { - "short_name": "Warehouse", - "full_name": "google.cloud.visionai.v1.Warehouse" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "visionai_v1_generated_Warehouse_ListDataSchemas_sync", - "title": "Snippet for the list_data_schemas call in the Warehouse service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::Warehouse::Client#list_data_schemas.", - "file": "warehouse/list_data_schemas.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_data_schemas", - "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client#list_data_schemas", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VisionAI::V1::ListDataSchemasRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::VisionAI::V1::ListDataSchemasResponse", - "client": { - "short_name": "Warehouse::Client", - "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client" - }, - "method": { - "short_name": "ListDataSchemas", - "full_name": "google.cloud.visionai.v1.Warehouse.ListDataSchemas", - "service": { - "short_name": "Warehouse", - "full_name": "google.cloud.visionai.v1.Warehouse" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "visionai_v1_generated_Warehouse_CreateAnnotation_sync", - "title": "Snippet for the create_annotation call in the Warehouse service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::Warehouse::Client#create_annotation.", - "file": "warehouse/create_annotation.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_annotation", - "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client#create_annotation", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VisionAI::V1::CreateAnnotationRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::VisionAI::V1::Annotation", - "client": { - "short_name": "Warehouse::Client", - "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client" - }, - "method": { - "short_name": "CreateAnnotation", - "full_name": "google.cloud.visionai.v1.Warehouse.CreateAnnotation", - "service": { - "short_name": "Warehouse", - "full_name": "google.cloud.visionai.v1.Warehouse" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "visionai_v1_generated_Warehouse_GetAnnotation_sync", - "title": "Snippet for the get_annotation call in the Warehouse service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::Warehouse::Client#get_annotation.", - "file": "warehouse/get_annotation.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_annotation", - "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client#get_annotation", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VisionAI::V1::GetAnnotationRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::VisionAI::V1::Annotation", - "client": { - "short_name": "Warehouse::Client", - "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client" - }, - "method": { - "short_name": "GetAnnotation", - "full_name": "google.cloud.visionai.v1.Warehouse.GetAnnotation", - "service": { - "short_name": "Warehouse", - "full_name": "google.cloud.visionai.v1.Warehouse" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "visionai_v1_generated_Warehouse_ListAnnotations_sync", - "title": "Snippet for the list_annotations call in the Warehouse service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::Warehouse::Client#list_annotations.", - "file": "warehouse/list_annotations.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_annotations", - "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client#list_annotations", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VisionAI::V1::ListAnnotationsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::VisionAI::V1::ListAnnotationsResponse", - "client": { - "short_name": "Warehouse::Client", - "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client" - }, - "method": { - "short_name": "ListAnnotations", - "full_name": "google.cloud.visionai.v1.Warehouse.ListAnnotations", - "service": { - "short_name": "Warehouse", - "full_name": "google.cloud.visionai.v1.Warehouse" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "visionai_v1_generated_Warehouse_UpdateAnnotation_sync", - "title": "Snippet for the update_annotation call in the Warehouse service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::Warehouse::Client#update_annotation.", - "file": "warehouse/update_annotation.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_annotation", - "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client#update_annotation", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VisionAI::V1::UpdateAnnotationRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::VisionAI::V1::Annotation", - "client": { - "short_name": "Warehouse::Client", - "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client" - }, - "method": { - "short_name": "UpdateAnnotation", - "full_name": "google.cloud.visionai.v1.Warehouse.UpdateAnnotation", - "service": { - "short_name": "Warehouse", - "full_name": "google.cloud.visionai.v1.Warehouse" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "visionai_v1_generated_Warehouse_DeleteAnnotation_sync", - "title": "Snippet for the delete_annotation call in the Warehouse service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::Warehouse::Client#delete_annotation.", - "file": "warehouse/delete_annotation.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_annotation", - "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client#delete_annotation", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VisionAI::V1::DeleteAnnotationRequest", - "name": "request" - } - ], - "result_type": "::Google::Protobuf::Empty", - "client": { - "short_name": "Warehouse::Client", - "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client" - }, - "method": { - "short_name": "DeleteAnnotation", - "full_name": "google.cloud.visionai.v1.Warehouse.DeleteAnnotation", - "service": { - "short_name": "Warehouse", - "full_name": "google.cloud.visionai.v1.Warehouse" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "visionai_v1_generated_Warehouse_IngestAsset_sync", - "title": "Snippet for the ingest_asset call in the Warehouse service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::Warehouse::Client#ingest_asset.", - "file": "warehouse/ingest_asset.rb", - "language": "RUBY", - "client_method": { - "short_name": "ingest_asset", - "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client#ingest_asset", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VisionAI::V1::IngestAssetRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::VisionAI::V1::IngestAssetResponse", - "client": { - "short_name": "Warehouse::Client", - "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client" - }, - "method": { - "short_name": "IngestAsset", - "full_name": "google.cloud.visionai.v1.Warehouse.IngestAsset", - "service": { - "short_name": "Warehouse", - "full_name": "google.cloud.visionai.v1.Warehouse" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 55, - "type": "FULL" - } - ] - }, - { - "region_tag": "visionai_v1_generated_Warehouse_ClipAsset_sync", - "title": "Snippet for the clip_asset call in the Warehouse service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::Warehouse::Client#clip_asset.", - "file": "warehouse/clip_asset.rb", - "language": "RUBY", - "client_method": { - "short_name": "clip_asset", - "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client#clip_asset", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VisionAI::V1::ClipAssetRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::VisionAI::V1::ClipAssetResponse", - "client": { - "short_name": "Warehouse::Client", - "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client" - }, - "method": { - "short_name": "ClipAsset", - "full_name": "google.cloud.visionai.v1.Warehouse.ClipAsset", - "service": { - "short_name": "Warehouse", - "full_name": "google.cloud.visionai.v1.Warehouse" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "visionai_v1_generated_Warehouse_GenerateHlsUri_sync", - "title": "Snippet for the generate_hls_uri call in the Warehouse service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::Warehouse::Client#generate_hls_uri.", - "file": "warehouse/generate_hls_uri.rb", - "language": "RUBY", - "client_method": { - "short_name": "generate_hls_uri", - "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client#generate_hls_uri", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VisionAI::V1::GenerateHlsUriRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::VisionAI::V1::GenerateHlsUriResponse", - "client": { - "short_name": "Warehouse::Client", - "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client" - }, - "method": { - "short_name": "GenerateHlsUri", - "full_name": "google.cloud.visionai.v1.Warehouse.GenerateHlsUri", - "service": { - "short_name": "Warehouse", - "full_name": "google.cloud.visionai.v1.Warehouse" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "visionai_v1_generated_Warehouse_ImportAssets_sync", - "title": "Snippet for the import_assets call in the Warehouse service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::Warehouse::Client#import_assets.", - "file": "warehouse/import_assets.rb", - "language": "RUBY", - "client_method": { - "short_name": "import_assets", - "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client#import_assets", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VisionAI::V1::ImportAssetsRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "Warehouse::Client", - "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client" - }, - "method": { - "short_name": "ImportAssets", - "full_name": "google.cloud.visionai.v1.Warehouse.ImportAssets", - "service": { - "short_name": "Warehouse", - "full_name": "google.cloud.visionai.v1.Warehouse" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "visionai_v1_generated_Warehouse_CreateSearchConfig_sync", - "title": "Snippet for the create_search_config call in the Warehouse service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::Warehouse::Client#create_search_config.", - "file": "warehouse/create_search_config.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_search_config", - "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client#create_search_config", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VisionAI::V1::CreateSearchConfigRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::VisionAI::V1::SearchConfig", - "client": { - "short_name": "Warehouse::Client", - "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client" - }, - "method": { - "short_name": "CreateSearchConfig", - "full_name": "google.cloud.visionai.v1.Warehouse.CreateSearchConfig", - "service": { - "short_name": "Warehouse", - "full_name": "google.cloud.visionai.v1.Warehouse" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "visionai_v1_generated_Warehouse_UpdateSearchConfig_sync", - "title": "Snippet for the update_search_config call in the Warehouse service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::Warehouse::Client#update_search_config.", - "file": "warehouse/update_search_config.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_search_config", - "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client#update_search_config", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VisionAI::V1::UpdateSearchConfigRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::VisionAI::V1::SearchConfig", - "client": { - "short_name": "Warehouse::Client", - "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client" - }, - "method": { - "short_name": "UpdateSearchConfig", - "full_name": "google.cloud.visionai.v1.Warehouse.UpdateSearchConfig", - "service": { - "short_name": "Warehouse", - "full_name": "google.cloud.visionai.v1.Warehouse" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "visionai_v1_generated_Warehouse_GetSearchConfig_sync", - "title": "Snippet for the get_search_config call in the Warehouse service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::Warehouse::Client#get_search_config.", - "file": "warehouse/get_search_config.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_search_config", - "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client#get_search_config", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VisionAI::V1::GetSearchConfigRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::VisionAI::V1::SearchConfig", - "client": { - "short_name": "Warehouse::Client", - "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client" - }, - "method": { - "short_name": "GetSearchConfig", - "full_name": "google.cloud.visionai.v1.Warehouse.GetSearchConfig", - "service": { - "short_name": "Warehouse", - "full_name": "google.cloud.visionai.v1.Warehouse" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "visionai_v1_generated_Warehouse_DeleteSearchConfig_sync", - "title": "Snippet for the delete_search_config call in the Warehouse service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::Warehouse::Client#delete_search_config.", - "file": "warehouse/delete_search_config.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_search_config", - "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client#delete_search_config", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VisionAI::V1::DeleteSearchConfigRequest", - "name": "request" - } - ], - "result_type": "::Google::Protobuf::Empty", - "client": { - "short_name": "Warehouse::Client", - "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client" - }, - "method": { - "short_name": "DeleteSearchConfig", - "full_name": "google.cloud.visionai.v1.Warehouse.DeleteSearchConfig", - "service": { - "short_name": "Warehouse", - "full_name": "google.cloud.visionai.v1.Warehouse" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "visionai_v1_generated_Warehouse_ListSearchConfigs_sync", - "title": "Snippet for the list_search_configs call in the Warehouse service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::Warehouse::Client#list_search_configs.", - "file": "warehouse/list_search_configs.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_search_configs", - "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client#list_search_configs", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VisionAI::V1::ListSearchConfigsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::VisionAI::V1::ListSearchConfigsResponse", - "client": { - "short_name": "Warehouse::Client", - "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client" - }, - "method": { - "short_name": "ListSearchConfigs", - "full_name": "google.cloud.visionai.v1.Warehouse.ListSearchConfigs", - "service": { - "short_name": "Warehouse", - "full_name": "google.cloud.visionai.v1.Warehouse" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "visionai_v1_generated_Warehouse_CreateSearchHypernym_sync", - "title": "Snippet for the create_search_hypernym call in the Warehouse service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::Warehouse::Client#create_search_hypernym.", - "file": "warehouse/create_search_hypernym.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_search_hypernym", - "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client#create_search_hypernym", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VisionAI::V1::CreateSearchHypernymRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::VisionAI::V1::SearchHypernym", - "client": { - "short_name": "Warehouse::Client", - "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client" - }, - "method": { - "short_name": "CreateSearchHypernym", - "full_name": "google.cloud.visionai.v1.Warehouse.CreateSearchHypernym", - "service": { - "short_name": "Warehouse", - "full_name": "google.cloud.visionai.v1.Warehouse" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "visionai_v1_generated_Warehouse_UpdateSearchHypernym_sync", - "title": "Snippet for the update_search_hypernym call in the Warehouse service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::Warehouse::Client#update_search_hypernym.", - "file": "warehouse/update_search_hypernym.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_search_hypernym", - "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client#update_search_hypernym", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VisionAI::V1::UpdateSearchHypernymRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::VisionAI::V1::SearchHypernym", - "client": { - "short_name": "Warehouse::Client", - "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client" - }, - "method": { - "short_name": "UpdateSearchHypernym", - "full_name": "google.cloud.visionai.v1.Warehouse.UpdateSearchHypernym", - "service": { - "short_name": "Warehouse", - "full_name": "google.cloud.visionai.v1.Warehouse" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "visionai_v1_generated_Warehouse_GetSearchHypernym_sync", - "title": "Snippet for the get_search_hypernym call in the Warehouse service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::Warehouse::Client#get_search_hypernym.", - "file": "warehouse/get_search_hypernym.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_search_hypernym", - "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client#get_search_hypernym", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VisionAI::V1::GetSearchHypernymRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::VisionAI::V1::SearchHypernym", - "client": { - "short_name": "Warehouse::Client", - "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client" - }, - "method": { - "short_name": "GetSearchHypernym", - "full_name": "google.cloud.visionai.v1.Warehouse.GetSearchHypernym", - "service": { - "short_name": "Warehouse", - "full_name": "google.cloud.visionai.v1.Warehouse" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "visionai_v1_generated_Warehouse_DeleteSearchHypernym_sync", - "title": "Snippet for the delete_search_hypernym call in the Warehouse service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::Warehouse::Client#delete_search_hypernym.", - "file": "warehouse/delete_search_hypernym.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_search_hypernym", - "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client#delete_search_hypernym", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VisionAI::V1::DeleteSearchHypernymRequest", - "name": "request" - } - ], - "result_type": "::Google::Protobuf::Empty", - "client": { - "short_name": "Warehouse::Client", - "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client" - }, - "method": { - "short_name": "DeleteSearchHypernym", - "full_name": "google.cloud.visionai.v1.Warehouse.DeleteSearchHypernym", - "service": { - "short_name": "Warehouse", - "full_name": "google.cloud.visionai.v1.Warehouse" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "visionai_v1_generated_Warehouse_ListSearchHypernyms_sync", - "title": "Snippet for the list_search_hypernyms call in the Warehouse service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::Warehouse::Client#list_search_hypernyms.", - "file": "warehouse/list_search_hypernyms.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_search_hypernyms", - "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client#list_search_hypernyms", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VisionAI::V1::ListSearchHypernymsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::VisionAI::V1::ListSearchHypernymsResponse", - "client": { - "short_name": "Warehouse::Client", - "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client" - }, - "method": { - "short_name": "ListSearchHypernyms", - "full_name": "google.cloud.visionai.v1.Warehouse.ListSearchHypernyms", - "service": { - "short_name": "Warehouse", - "full_name": "google.cloud.visionai.v1.Warehouse" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "visionai_v1_generated_Warehouse_SearchAssets_sync", - "title": "Snippet for the search_assets call in the Warehouse service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::Warehouse::Client#search_assets.", - "file": "warehouse/search_assets.rb", - "language": "RUBY", - "client_method": { - "short_name": "search_assets", - "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client#search_assets", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VisionAI::V1::SearchAssetsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::VisionAI::V1::SearchAssetsResponse", - "client": { - "short_name": "Warehouse::Client", - "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client" - }, - "method": { - "short_name": "SearchAssets", - "full_name": "google.cloud.visionai.v1.Warehouse.SearchAssets", - "service": { - "short_name": "Warehouse", - "full_name": "google.cloud.visionai.v1.Warehouse" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "visionai_v1_generated_Warehouse_SearchIndexEndpoint_sync", - "title": "Snippet for the search_index_endpoint call in the Warehouse service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::Warehouse::Client#search_index_endpoint.", - "file": "warehouse/search_index_endpoint.rb", - "language": "RUBY", - "client_method": { - "short_name": "search_index_endpoint", - "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client#search_index_endpoint", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VisionAI::V1::SearchIndexEndpointRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::VisionAI::V1::SearchIndexEndpointResponse", - "client": { - "short_name": "Warehouse::Client", - "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client" - }, - "method": { - "short_name": "SearchIndexEndpoint", - "full_name": "google.cloud.visionai.v1.Warehouse.SearchIndexEndpoint", - "service": { - "short_name": "Warehouse", - "full_name": "google.cloud.visionai.v1.Warehouse" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "visionai_v1_generated_Warehouse_CreateIndexEndpoint_sync", - "title": "Snippet for the create_index_endpoint call in the Warehouse service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::Warehouse::Client#create_index_endpoint.", - "file": "warehouse/create_index_endpoint.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_index_endpoint", - "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client#create_index_endpoint", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VisionAI::V1::CreateIndexEndpointRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "Warehouse::Client", - "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client" - }, - "method": { - "short_name": "CreateIndexEndpoint", - "full_name": "google.cloud.visionai.v1.Warehouse.CreateIndexEndpoint", - "service": { - "short_name": "Warehouse", - "full_name": "google.cloud.visionai.v1.Warehouse" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "visionai_v1_generated_Warehouse_GetIndexEndpoint_sync", - "title": "Snippet for the get_index_endpoint call in the Warehouse service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::Warehouse::Client#get_index_endpoint.", - "file": "warehouse/get_index_endpoint.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_index_endpoint", - "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client#get_index_endpoint", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VisionAI::V1::GetIndexEndpointRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::VisionAI::V1::IndexEndpoint", - "client": { - "short_name": "Warehouse::Client", - "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client" - }, - "method": { - "short_name": "GetIndexEndpoint", - "full_name": "google.cloud.visionai.v1.Warehouse.GetIndexEndpoint", - "service": { - "short_name": "Warehouse", - "full_name": "google.cloud.visionai.v1.Warehouse" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "visionai_v1_generated_Warehouse_ListIndexEndpoints_sync", - "title": "Snippet for the list_index_endpoints call in the Warehouse service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::Warehouse::Client#list_index_endpoints.", - "file": "warehouse/list_index_endpoints.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_index_endpoints", - "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client#list_index_endpoints", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VisionAI::V1::ListIndexEndpointsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::VisionAI::V1::ListIndexEndpointsResponse", - "client": { - "short_name": "Warehouse::Client", - "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client" - }, - "method": { - "short_name": "ListIndexEndpoints", - "full_name": "google.cloud.visionai.v1.Warehouse.ListIndexEndpoints", - "service": { - "short_name": "Warehouse", - "full_name": "google.cloud.visionai.v1.Warehouse" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "visionai_v1_generated_Warehouse_UpdateIndexEndpoint_sync", - "title": "Snippet for the update_index_endpoint call in the Warehouse service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::Warehouse::Client#update_index_endpoint.", - "file": "warehouse/update_index_endpoint.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_index_endpoint", - "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client#update_index_endpoint", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VisionAI::V1::UpdateIndexEndpointRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "Warehouse::Client", - "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client" - }, - "method": { - "short_name": "UpdateIndexEndpoint", - "full_name": "google.cloud.visionai.v1.Warehouse.UpdateIndexEndpoint", - "service": { - "short_name": "Warehouse", - "full_name": "google.cloud.visionai.v1.Warehouse" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "visionai_v1_generated_Warehouse_DeleteIndexEndpoint_sync", - "title": "Snippet for the delete_index_endpoint call in the Warehouse service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::Warehouse::Client#delete_index_endpoint.", - "file": "warehouse/delete_index_endpoint.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_index_endpoint", - "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client#delete_index_endpoint", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VisionAI::V1::DeleteIndexEndpointRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "Warehouse::Client", - "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client" - }, - "method": { - "short_name": "DeleteIndexEndpoint", - "full_name": "google.cloud.visionai.v1.Warehouse.DeleteIndexEndpoint", - "service": { - "short_name": "Warehouse", - "full_name": "google.cloud.visionai.v1.Warehouse" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "visionai_v1_generated_Warehouse_DeployIndex_sync", - "title": "Snippet for the deploy_index call in the Warehouse service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::Warehouse::Client#deploy_index.", - "file": "warehouse/deploy_index.rb", - "language": "RUBY", - "client_method": { - "short_name": "deploy_index", - "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client#deploy_index", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VisionAI::V1::DeployIndexRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "Warehouse::Client", - "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client" - }, - "method": { - "short_name": "DeployIndex", - "full_name": "google.cloud.visionai.v1.Warehouse.DeployIndex", - "service": { - "short_name": "Warehouse", - "full_name": "google.cloud.visionai.v1.Warehouse" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "visionai_v1_generated_Warehouse_UndeployIndex_sync", - "title": "Snippet for the undeploy_index call in the Warehouse service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::Warehouse::Client#undeploy_index.", - "file": "warehouse/undeploy_index.rb", - "language": "RUBY", - "client_method": { - "short_name": "undeploy_index", - "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client#undeploy_index", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VisionAI::V1::UndeployIndexRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "Warehouse::Client", - "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client" - }, - "method": { - "short_name": "UndeployIndex", - "full_name": "google.cloud.visionai.v1.Warehouse.UndeployIndex", - "service": { - "short_name": "Warehouse", - "full_name": "google.cloud.visionai.v1.Warehouse" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "visionai_v1_generated_Warehouse_CreateCollection_sync", - "title": "Snippet for the create_collection call in the Warehouse service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::Warehouse::Client#create_collection.", - "file": "warehouse/create_collection.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_collection", - "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client#create_collection", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VisionAI::V1::CreateCollectionRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "Warehouse::Client", - "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client" - }, - "method": { - "short_name": "CreateCollection", - "full_name": "google.cloud.visionai.v1.Warehouse.CreateCollection", - "service": { - "short_name": "Warehouse", - "full_name": "google.cloud.visionai.v1.Warehouse" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "visionai_v1_generated_Warehouse_DeleteCollection_sync", - "title": "Snippet for the delete_collection call in the Warehouse service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::Warehouse::Client#delete_collection.", - "file": "warehouse/delete_collection.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_collection", - "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client#delete_collection", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VisionAI::V1::DeleteCollectionRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "Warehouse::Client", - "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client" - }, - "method": { - "short_name": "DeleteCollection", - "full_name": "google.cloud.visionai.v1.Warehouse.DeleteCollection", - "service": { - "short_name": "Warehouse", - "full_name": "google.cloud.visionai.v1.Warehouse" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "visionai_v1_generated_Warehouse_GetCollection_sync", - "title": "Snippet for the get_collection call in the Warehouse service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::Warehouse::Client#get_collection.", - "file": "warehouse/get_collection.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_collection", - "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client#get_collection", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VisionAI::V1::GetCollectionRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::VisionAI::V1::Collection", - "client": { - "short_name": "Warehouse::Client", - "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client" - }, - "method": { - "short_name": "GetCollection", - "full_name": "google.cloud.visionai.v1.Warehouse.GetCollection", - "service": { - "short_name": "Warehouse", - "full_name": "google.cloud.visionai.v1.Warehouse" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "visionai_v1_generated_Warehouse_UpdateCollection_sync", - "title": "Snippet for the update_collection call in the Warehouse service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::Warehouse::Client#update_collection.", - "file": "warehouse/update_collection.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_collection", - "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client#update_collection", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VisionAI::V1::UpdateCollectionRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::VisionAI::V1::Collection", - "client": { - "short_name": "Warehouse::Client", - "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client" - }, - "method": { - "short_name": "UpdateCollection", - "full_name": "google.cloud.visionai.v1.Warehouse.UpdateCollection", - "service": { - "short_name": "Warehouse", - "full_name": "google.cloud.visionai.v1.Warehouse" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "visionai_v1_generated_Warehouse_ListCollections_sync", - "title": "Snippet for the list_collections call in the Warehouse service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::Warehouse::Client#list_collections.", - "file": "warehouse/list_collections.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_collections", - "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client#list_collections", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VisionAI::V1::ListCollectionsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::VisionAI::V1::ListCollectionsResponse", - "client": { - "short_name": "Warehouse::Client", - "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client" - }, - "method": { - "short_name": "ListCollections", - "full_name": "google.cloud.visionai.v1.Warehouse.ListCollections", - "service": { - "short_name": "Warehouse", - "full_name": "google.cloud.visionai.v1.Warehouse" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "visionai_v1_generated_Warehouse_AddCollectionItem_sync", - "title": "Snippet for the add_collection_item call in the Warehouse service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::Warehouse::Client#add_collection_item.", - "file": "warehouse/add_collection_item.rb", - "language": "RUBY", - "client_method": { - "short_name": "add_collection_item", - "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client#add_collection_item", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VisionAI::V1::AddCollectionItemRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::VisionAI::V1::AddCollectionItemResponse", - "client": { - "short_name": "Warehouse::Client", - "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client" - }, - "method": { - "short_name": "AddCollectionItem", - "full_name": "google.cloud.visionai.v1.Warehouse.AddCollectionItem", - "service": { - "short_name": "Warehouse", - "full_name": "google.cloud.visionai.v1.Warehouse" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "visionai_v1_generated_Warehouse_RemoveCollectionItem_sync", - "title": "Snippet for the remove_collection_item call in the Warehouse service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::Warehouse::Client#remove_collection_item.", - "file": "warehouse/remove_collection_item.rb", - "language": "RUBY", - "client_method": { - "short_name": "remove_collection_item", - "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client#remove_collection_item", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VisionAI::V1::RemoveCollectionItemRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::VisionAI::V1::RemoveCollectionItemResponse", - "client": { - "short_name": "Warehouse::Client", - "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client" - }, - "method": { - "short_name": "RemoveCollectionItem", - "full_name": "google.cloud.visionai.v1.Warehouse.RemoveCollectionItem", - "service": { - "short_name": "Warehouse", - "full_name": "google.cloud.visionai.v1.Warehouse" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "visionai_v1_generated_Warehouse_ViewCollectionItems_sync", - "title": "Snippet for the view_collection_items call in the Warehouse service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::Warehouse::Client#view_collection_items.", - "file": "warehouse/view_collection_items.rb", - "language": "RUBY", - "client_method": { - "short_name": "view_collection_items", - "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client#view_collection_items", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VisionAI::V1::ViewCollectionItemsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::VisionAI::V1::ViewCollectionItemsResponse", - "client": { - "short_name": "Warehouse::Client", - "full_name": "::Google::Cloud::VisionAI::V1::Warehouse::Client" - }, - "method": { - "short_name": "ViewCollectionItems", - "full_name": "google.cloud.visionai.v1.Warehouse.ViewCollectionItems", - "service": { - "short_name": "Warehouse", - "full_name": "google.cloud.visionai.v1.Warehouse" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "visionai_v1_generated_HealthCheckService_HealthCheck_sync", - "title": "Snippet for the health_check call in the HealthCheckService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VisionAI::V1::HealthCheckService::Client#health_check.", - "file": "health_check_service/health_check.rb", - "language": "RUBY", - "client_method": { - "short_name": "health_check", - "full_name": "::Google::Cloud::VisionAI::V1::HealthCheckService::Client#health_check", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VisionAI::V1::HealthCheckRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::VisionAI::V1::HealthCheckResponse", - "client": { - "short_name": "HealthCheckService::Client", - "full_name": "::Google::Cloud::VisionAI::V1::HealthCheckService::Client" - }, - "method": { - "short_name": "HealthCheck", - "full_name": "google.cloud.visionai.v1.HealthCheckService.HealthCheck", - "service": { - "short_name": "HealthCheckService", - "full_name": "google.cloud.visionai.v1.HealthCheckService" - } - } - }, - "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-vision_ai-v1/snippets/streaming_service/acquire_lease.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/streaming_service/acquire_lease.rb deleted file mode 100644 index e31c0226534a..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/streaming_service/acquire_lease.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 visionai_v1_generated_StreamingService_AcquireLease_sync] -require "google/cloud/vision_ai/v1" - -## -# Snippet for the acquire_lease call in the StreamingService 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::VisionAI::V1::StreamingService::Client#acquire_lease. -# -def acquire_lease - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VisionAI::V1::StreamingService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VisionAI::V1::AcquireLeaseRequest.new - - # Call the acquire_lease method. - result = client.acquire_lease request - - # The returned object is of type Google::Cloud::VisionAI::V1::Lease. - p result -end -# [END visionai_v1_generated_StreamingService_AcquireLease_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/streaming_service/receive_events.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/streaming_service/receive_events.rb deleted file mode 100644 index 1dbbe3d1ae7d..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/streaming_service/receive_events.rb +++ /dev/null @@ -1,56 +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 visionai_v1_generated_StreamingService_ReceiveEvents_sync] -require "google/cloud/vision_ai/v1" - -## -# Snippet for the receive_events call in the StreamingService 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::VisionAI::V1::StreamingService::Client#receive_events. -# -def receive_events - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VisionAI::V1::StreamingService::Client.new - - # Create an input stream. - input = Gapic::StreamInput.new - - # Call the receive_events method to start streaming. - output = client.receive_events input - - # Send requests on the stream. For each request object, set fields by - # passing keyword arguments. Be sure to close the stream when done. - input << Google::Cloud::VisionAI::V1::ReceiveEventsRequest.new - input << Google::Cloud::VisionAI::V1::ReceiveEventsRequest.new - input.close - - # The returned object is a streamed enumerable yielding elements of type - # ::Google::Cloud::VisionAI::V1::ReceiveEventsResponse - output.each do |current_response| - p current_response - end -end -# [END visionai_v1_generated_StreamingService_ReceiveEvents_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/streaming_service/receive_packets.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/streaming_service/receive_packets.rb deleted file mode 100644 index a2066f31b1fe..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/streaming_service/receive_packets.rb +++ /dev/null @@ -1,56 +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 visionai_v1_generated_StreamingService_ReceivePackets_sync] -require "google/cloud/vision_ai/v1" - -## -# Snippet for the receive_packets call in the StreamingService 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::VisionAI::V1::StreamingService::Client#receive_packets. -# -def receive_packets - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VisionAI::V1::StreamingService::Client.new - - # Create an input stream. - input = Gapic::StreamInput.new - - # Call the receive_packets method to start streaming. - output = client.receive_packets input - - # Send requests on the stream. For each request object, set fields by - # passing keyword arguments. Be sure to close the stream when done. - input << Google::Cloud::VisionAI::V1::ReceivePacketsRequest.new - input << Google::Cloud::VisionAI::V1::ReceivePacketsRequest.new - input.close - - # The returned object is a streamed enumerable yielding elements of type - # ::Google::Cloud::VisionAI::V1::ReceivePacketsResponse - output.each do |current_response| - p current_response - end -end -# [END visionai_v1_generated_StreamingService_ReceivePackets_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/streaming_service/release_lease.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/streaming_service/release_lease.rb deleted file mode 100644 index 0a0ac7c37fbc..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/streaming_service/release_lease.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 visionai_v1_generated_StreamingService_ReleaseLease_sync] -require "google/cloud/vision_ai/v1" - -## -# Snippet for the release_lease call in the StreamingService 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::VisionAI::V1::StreamingService::Client#release_lease. -# -def release_lease - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VisionAI::V1::StreamingService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VisionAI::V1::ReleaseLeaseRequest.new - - # Call the release_lease method. - result = client.release_lease request - - # The returned object is of type Google::Cloud::VisionAI::V1::ReleaseLeaseResponse. - p result -end -# [END visionai_v1_generated_StreamingService_ReleaseLease_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/streaming_service/renew_lease.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/streaming_service/renew_lease.rb deleted file mode 100644 index e02d97d10e9e..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/streaming_service/renew_lease.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 visionai_v1_generated_StreamingService_RenewLease_sync] -require "google/cloud/vision_ai/v1" - -## -# Snippet for the renew_lease call in the StreamingService 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::VisionAI::V1::StreamingService::Client#renew_lease. -# -def renew_lease - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VisionAI::V1::StreamingService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VisionAI::V1::RenewLeaseRequest.new - - # Call the renew_lease method. - result = client.renew_lease request - - # The returned object is of type Google::Cloud::VisionAI::V1::Lease. - p result -end -# [END visionai_v1_generated_StreamingService_RenewLease_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/streaming_service/send_packets.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/streaming_service/send_packets.rb deleted file mode 100644 index ad93bf715db5..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/streaming_service/send_packets.rb +++ /dev/null @@ -1,56 +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 visionai_v1_generated_StreamingService_SendPackets_sync] -require "google/cloud/vision_ai/v1" - -## -# Snippet for the send_packets call in the StreamingService 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::VisionAI::V1::StreamingService::Client#send_packets. -# -def send_packets - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VisionAI::V1::StreamingService::Client.new - - # Create an input stream. - input = Gapic::StreamInput.new - - # Call the send_packets method to start streaming. - output = client.send_packets input - - # Send requests on the stream. For each request object, set fields by - # passing keyword arguments. Be sure to close the stream when done. - input << Google::Cloud::VisionAI::V1::SendPacketsRequest.new - input << Google::Cloud::VisionAI::V1::SendPacketsRequest.new - input.close - - # The returned object is a streamed enumerable yielding elements of type - # ::Google::Cloud::VisionAI::V1::SendPacketsResponse - output.each do |current_response| - p current_response - end -end -# [END visionai_v1_generated_StreamingService_SendPackets_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/streams_service/create_cluster.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/streams_service/create_cluster.rb deleted file mode 100644 index a459e6a3c502..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/streams_service/create_cluster.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 visionai_v1_generated_StreamsService_CreateCluster_sync] -require "google/cloud/vision_ai/v1" - -## -# Snippet for the create_cluster call in the StreamsService 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::VisionAI::V1::StreamsService::Client#create_cluster. -# -def create_cluster - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VisionAI::V1::StreamsService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VisionAI::V1::CreateClusterRequest.new - - # Call the create_cluster method. - result = client.create_cluster 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 visionai_v1_generated_StreamsService_CreateCluster_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/streams_service/create_event.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/streams_service/create_event.rb deleted file mode 100644 index 09f48f7898c3..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/streams_service/create_event.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 visionai_v1_generated_StreamsService_CreateEvent_sync] -require "google/cloud/vision_ai/v1" - -## -# Snippet for the create_event call in the StreamsService 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::VisionAI::V1::StreamsService::Client#create_event. -# -def create_event - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VisionAI::V1::StreamsService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VisionAI::V1::CreateEventRequest.new - - # Call the create_event method. - result = client.create_event 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 visionai_v1_generated_StreamsService_CreateEvent_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/streams_service/create_series.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/streams_service/create_series.rb deleted file mode 100644 index 8366f5829502..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/streams_service/create_series.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 visionai_v1_generated_StreamsService_CreateSeries_sync] -require "google/cloud/vision_ai/v1" - -## -# Snippet for the create_series call in the StreamsService 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::VisionAI::V1::StreamsService::Client#create_series. -# -def create_series - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VisionAI::V1::StreamsService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VisionAI::V1::CreateSeriesRequest.new - - # Call the create_series method. - result = client.create_series 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 visionai_v1_generated_StreamsService_CreateSeries_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/streams_service/create_stream.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/streams_service/create_stream.rb deleted file mode 100644 index 89fd97681025..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/streams_service/create_stream.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 visionai_v1_generated_StreamsService_CreateStream_sync] -require "google/cloud/vision_ai/v1" - -## -# Snippet for the create_stream call in the StreamsService 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::VisionAI::V1::StreamsService::Client#create_stream. -# -def create_stream - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VisionAI::V1::StreamsService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VisionAI::V1::CreateStreamRequest.new - - # Call the create_stream method. - result = client.create_stream 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 visionai_v1_generated_StreamsService_CreateStream_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/streams_service/delete_cluster.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/streams_service/delete_cluster.rb deleted file mode 100644 index 5b5f84742166..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/streams_service/delete_cluster.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 visionai_v1_generated_StreamsService_DeleteCluster_sync] -require "google/cloud/vision_ai/v1" - -## -# Snippet for the delete_cluster call in the StreamsService 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::VisionAI::V1::StreamsService::Client#delete_cluster. -# -def delete_cluster - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VisionAI::V1::StreamsService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VisionAI::V1::DeleteClusterRequest.new - - # Call the delete_cluster method. - result = client.delete_cluster 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 visionai_v1_generated_StreamsService_DeleteCluster_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/streams_service/delete_event.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/streams_service/delete_event.rb deleted file mode 100644 index 1e1d1873c2dd..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/streams_service/delete_event.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 visionai_v1_generated_StreamsService_DeleteEvent_sync] -require "google/cloud/vision_ai/v1" - -## -# Snippet for the delete_event call in the StreamsService 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::VisionAI::V1::StreamsService::Client#delete_event. -# -def delete_event - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VisionAI::V1::StreamsService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VisionAI::V1::DeleteEventRequest.new - - # Call the delete_event method. - result = client.delete_event 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 visionai_v1_generated_StreamsService_DeleteEvent_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/streams_service/delete_series.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/streams_service/delete_series.rb deleted file mode 100644 index ba26c57c5f7f..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/streams_service/delete_series.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 visionai_v1_generated_StreamsService_DeleteSeries_sync] -require "google/cloud/vision_ai/v1" - -## -# Snippet for the delete_series call in the StreamsService 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::VisionAI::V1::StreamsService::Client#delete_series. -# -def delete_series - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VisionAI::V1::StreamsService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VisionAI::V1::DeleteSeriesRequest.new - - # Call the delete_series method. - result = client.delete_series 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 visionai_v1_generated_StreamsService_DeleteSeries_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/streams_service/delete_stream.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/streams_service/delete_stream.rb deleted file mode 100644 index 9fdc4d5cbcfa..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/streams_service/delete_stream.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 visionai_v1_generated_StreamsService_DeleteStream_sync] -require "google/cloud/vision_ai/v1" - -## -# Snippet for the delete_stream call in the StreamsService 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::VisionAI::V1::StreamsService::Client#delete_stream. -# -def delete_stream - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VisionAI::V1::StreamsService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VisionAI::V1::DeleteStreamRequest.new - - # Call the delete_stream method. - result = client.delete_stream 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 visionai_v1_generated_StreamsService_DeleteStream_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/streams_service/generate_stream_hls_token.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/streams_service/generate_stream_hls_token.rb deleted file mode 100644 index 397fa47013c2..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/streams_service/generate_stream_hls_token.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 visionai_v1_generated_StreamsService_GenerateStreamHlsToken_sync] -require "google/cloud/vision_ai/v1" - -## -# Snippet for the generate_stream_hls_token call in the StreamsService 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::VisionAI::V1::StreamsService::Client#generate_stream_hls_token. -# -def generate_stream_hls_token - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VisionAI::V1::StreamsService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VisionAI::V1::GenerateStreamHlsTokenRequest.new - - # Call the generate_stream_hls_token method. - result = client.generate_stream_hls_token request - - # The returned object is of type Google::Cloud::VisionAI::V1::GenerateStreamHlsTokenResponse. - p result -end -# [END visionai_v1_generated_StreamsService_GenerateStreamHlsToken_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/streams_service/get_cluster.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/streams_service/get_cluster.rb deleted file mode 100644 index 9a0df18b4b77..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/streams_service/get_cluster.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 visionai_v1_generated_StreamsService_GetCluster_sync] -require "google/cloud/vision_ai/v1" - -## -# Snippet for the get_cluster call in the StreamsService 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::VisionAI::V1::StreamsService::Client#get_cluster. -# -def get_cluster - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VisionAI::V1::StreamsService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VisionAI::V1::GetClusterRequest.new - - # Call the get_cluster method. - result = client.get_cluster request - - # The returned object is of type Google::Cloud::VisionAI::V1::Cluster. - p result -end -# [END visionai_v1_generated_StreamsService_GetCluster_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/streams_service/get_event.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/streams_service/get_event.rb deleted file mode 100644 index dc7e587b8004..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/streams_service/get_event.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 visionai_v1_generated_StreamsService_GetEvent_sync] -require "google/cloud/vision_ai/v1" - -## -# Snippet for the get_event call in the StreamsService 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::VisionAI::V1::StreamsService::Client#get_event. -# -def get_event - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VisionAI::V1::StreamsService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VisionAI::V1::GetEventRequest.new - - # Call the get_event method. - result = client.get_event request - - # The returned object is of type Google::Cloud::VisionAI::V1::Event. - p result -end -# [END visionai_v1_generated_StreamsService_GetEvent_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/streams_service/get_series.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/streams_service/get_series.rb deleted file mode 100644 index c5822841aaa8..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/streams_service/get_series.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 visionai_v1_generated_StreamsService_GetSeries_sync] -require "google/cloud/vision_ai/v1" - -## -# Snippet for the get_series call in the StreamsService 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::VisionAI::V1::StreamsService::Client#get_series. -# -def get_series - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VisionAI::V1::StreamsService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VisionAI::V1::GetSeriesRequest.new - - # Call the get_series method. - result = client.get_series request - - # The returned object is of type Google::Cloud::VisionAI::V1::Series. - p result -end -# [END visionai_v1_generated_StreamsService_GetSeries_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/streams_service/get_stream.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/streams_service/get_stream.rb deleted file mode 100644 index 338c34bc457f..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/streams_service/get_stream.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 visionai_v1_generated_StreamsService_GetStream_sync] -require "google/cloud/vision_ai/v1" - -## -# Snippet for the get_stream call in the StreamsService 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::VisionAI::V1::StreamsService::Client#get_stream. -# -def get_stream - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VisionAI::V1::StreamsService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VisionAI::V1::GetStreamRequest.new - - # Call the get_stream method. - result = client.get_stream request - - # The returned object is of type Google::Cloud::VisionAI::V1::Stream. - p result -end -# [END visionai_v1_generated_StreamsService_GetStream_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/streams_service/get_stream_thumbnail.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/streams_service/get_stream_thumbnail.rb deleted file mode 100644 index 3df4d5d427e0..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/streams_service/get_stream_thumbnail.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 visionai_v1_generated_StreamsService_GetStreamThumbnail_sync] -require "google/cloud/vision_ai/v1" - -## -# Snippet for the get_stream_thumbnail call in the StreamsService 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::VisionAI::V1::StreamsService::Client#get_stream_thumbnail. -# -def get_stream_thumbnail - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VisionAI::V1::StreamsService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VisionAI::V1::GetStreamThumbnailRequest.new - - # Call the get_stream_thumbnail method. - result = client.get_stream_thumbnail 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 visionai_v1_generated_StreamsService_GetStreamThumbnail_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/streams_service/list_clusters.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/streams_service/list_clusters.rb deleted file mode 100644 index bb488a80ce3b..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/streams_service/list_clusters.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 visionai_v1_generated_StreamsService_ListClusters_sync] -require "google/cloud/vision_ai/v1" - -## -# Snippet for the list_clusters call in the StreamsService 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::VisionAI::V1::StreamsService::Client#list_clusters. -# -def list_clusters - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VisionAI::V1::StreamsService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VisionAI::V1::ListClustersRequest.new - - # Call the list_clusters method. - result = client.list_clusters 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::VisionAI::V1::Cluster. - p item - end -end -# [END visionai_v1_generated_StreamsService_ListClusters_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/streams_service/list_events.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/streams_service/list_events.rb deleted file mode 100644 index ed5c416e8825..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/streams_service/list_events.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 visionai_v1_generated_StreamsService_ListEvents_sync] -require "google/cloud/vision_ai/v1" - -## -# Snippet for the list_events call in the StreamsService 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::VisionAI::V1::StreamsService::Client#list_events. -# -def list_events - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VisionAI::V1::StreamsService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VisionAI::V1::ListEventsRequest.new - - # Call the list_events method. - result = client.list_events 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::VisionAI::V1::Event. - p item - end -end -# [END visionai_v1_generated_StreamsService_ListEvents_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/streams_service/list_series.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/streams_service/list_series.rb deleted file mode 100644 index b13253651d25..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/streams_service/list_series.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 visionai_v1_generated_StreamsService_ListSeries_sync] -require "google/cloud/vision_ai/v1" - -## -# Snippet for the list_series call in the StreamsService 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::VisionAI::V1::StreamsService::Client#list_series. -# -def list_series - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VisionAI::V1::StreamsService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VisionAI::V1::ListSeriesRequest.new - - # Call the list_series method. - result = client.list_series 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::VisionAI::V1::Series. - p item - end -end -# [END visionai_v1_generated_StreamsService_ListSeries_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/streams_service/list_streams.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/streams_service/list_streams.rb deleted file mode 100644 index 95386372f76b..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/streams_service/list_streams.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 visionai_v1_generated_StreamsService_ListStreams_sync] -require "google/cloud/vision_ai/v1" - -## -# Snippet for the list_streams call in the StreamsService 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::VisionAI::V1::StreamsService::Client#list_streams. -# -def list_streams - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VisionAI::V1::StreamsService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VisionAI::V1::ListStreamsRequest.new - - # Call the list_streams method. - result = client.list_streams 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::VisionAI::V1::Stream. - p item - end -end -# [END visionai_v1_generated_StreamsService_ListStreams_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/streams_service/materialize_channel.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/streams_service/materialize_channel.rb deleted file mode 100644 index 7c98cfcfc234..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/streams_service/materialize_channel.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 visionai_v1_generated_StreamsService_MaterializeChannel_sync] -require "google/cloud/vision_ai/v1" - -## -# Snippet for the materialize_channel call in the StreamsService 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::VisionAI::V1::StreamsService::Client#materialize_channel. -# -def materialize_channel - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VisionAI::V1::StreamsService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VisionAI::V1::MaterializeChannelRequest.new - - # Call the materialize_channel method. - result = client.materialize_channel 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 visionai_v1_generated_StreamsService_MaterializeChannel_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/streams_service/update_cluster.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/streams_service/update_cluster.rb deleted file mode 100644 index ce056cc5e29e..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/streams_service/update_cluster.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 visionai_v1_generated_StreamsService_UpdateCluster_sync] -require "google/cloud/vision_ai/v1" - -## -# Snippet for the update_cluster call in the StreamsService 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::VisionAI::V1::StreamsService::Client#update_cluster. -# -def update_cluster - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VisionAI::V1::StreamsService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VisionAI::V1::UpdateClusterRequest.new - - # Call the update_cluster method. - result = client.update_cluster 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 visionai_v1_generated_StreamsService_UpdateCluster_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/streams_service/update_event.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/streams_service/update_event.rb deleted file mode 100644 index d0811f946a30..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/streams_service/update_event.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 visionai_v1_generated_StreamsService_UpdateEvent_sync] -require "google/cloud/vision_ai/v1" - -## -# Snippet for the update_event call in the StreamsService 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::VisionAI::V1::StreamsService::Client#update_event. -# -def update_event - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VisionAI::V1::StreamsService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VisionAI::V1::UpdateEventRequest.new - - # Call the update_event method. - result = client.update_event 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 visionai_v1_generated_StreamsService_UpdateEvent_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/streams_service/update_series.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/streams_service/update_series.rb deleted file mode 100644 index 239f446d2c0b..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/streams_service/update_series.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 visionai_v1_generated_StreamsService_UpdateSeries_sync] -require "google/cloud/vision_ai/v1" - -## -# Snippet for the update_series call in the StreamsService 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::VisionAI::V1::StreamsService::Client#update_series. -# -def update_series - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VisionAI::V1::StreamsService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VisionAI::V1::UpdateSeriesRequest.new - - # Call the update_series method. - result = client.update_series 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 visionai_v1_generated_StreamsService_UpdateSeries_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/streams_service/update_stream.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/streams_service/update_stream.rb deleted file mode 100644 index 35c887431415..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/streams_service/update_stream.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 visionai_v1_generated_StreamsService_UpdateStream_sync] -require "google/cloud/vision_ai/v1" - -## -# Snippet for the update_stream call in the StreamsService 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::VisionAI::V1::StreamsService::Client#update_stream. -# -def update_stream - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VisionAI::V1::StreamsService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VisionAI::V1::UpdateStreamRequest.new - - # Call the update_stream method. - result = client.update_stream 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 visionai_v1_generated_StreamsService_UpdateStream_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/add_collection_item.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/add_collection_item.rb deleted file mode 100644 index 7543d0295185..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/add_collection_item.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 visionai_v1_generated_Warehouse_AddCollectionItem_sync] -require "google/cloud/vision_ai/v1" - -## -# Snippet for the add_collection_item call in the Warehouse 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::VisionAI::V1::Warehouse::Client#add_collection_item. -# -def add_collection_item - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VisionAI::V1::Warehouse::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VisionAI::V1::AddCollectionItemRequest.new - - # Call the add_collection_item method. - result = client.add_collection_item request - - # The returned object is of type Google::Cloud::VisionAI::V1::AddCollectionItemResponse. - p result -end -# [END visionai_v1_generated_Warehouse_AddCollectionItem_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/analyze_asset.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/analyze_asset.rb deleted file mode 100644 index 6759f3c175fd..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/analyze_asset.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 visionai_v1_generated_Warehouse_AnalyzeAsset_sync] -require "google/cloud/vision_ai/v1" - -## -# Snippet for the analyze_asset call in the Warehouse 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::VisionAI::V1::Warehouse::Client#analyze_asset. -# -def analyze_asset - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VisionAI::V1::Warehouse::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VisionAI::V1::AnalyzeAssetRequest.new - - # Call the analyze_asset method. - result = client.analyze_asset 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 visionai_v1_generated_Warehouse_AnalyzeAsset_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/analyze_corpus.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/analyze_corpus.rb deleted file mode 100644 index 56672690156a..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/analyze_corpus.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 visionai_v1_generated_Warehouse_AnalyzeCorpus_sync] -require "google/cloud/vision_ai/v1" - -## -# Snippet for the analyze_corpus call in the Warehouse 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::VisionAI::V1::Warehouse::Client#analyze_corpus. -# -def analyze_corpus - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VisionAI::V1::Warehouse::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VisionAI::V1::AnalyzeCorpusRequest.new - - # Call the analyze_corpus method. - result = client.analyze_corpus 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 visionai_v1_generated_Warehouse_AnalyzeCorpus_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/clip_asset.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/clip_asset.rb deleted file mode 100644 index fcbd3d39313b..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/clip_asset.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 visionai_v1_generated_Warehouse_ClipAsset_sync] -require "google/cloud/vision_ai/v1" - -## -# Snippet for the clip_asset call in the Warehouse 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::VisionAI::V1::Warehouse::Client#clip_asset. -# -def clip_asset - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VisionAI::V1::Warehouse::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VisionAI::V1::ClipAssetRequest.new - - # Call the clip_asset method. - result = client.clip_asset request - - # The returned object is of type Google::Cloud::VisionAI::V1::ClipAssetResponse. - p result -end -# [END visionai_v1_generated_Warehouse_ClipAsset_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/create_annotation.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/create_annotation.rb deleted file mode 100644 index a62a765d295e..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/create_annotation.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 visionai_v1_generated_Warehouse_CreateAnnotation_sync] -require "google/cloud/vision_ai/v1" - -## -# Snippet for the create_annotation call in the Warehouse 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::VisionAI::V1::Warehouse::Client#create_annotation. -# -def create_annotation - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VisionAI::V1::Warehouse::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VisionAI::V1::CreateAnnotationRequest.new - - # Call the create_annotation method. - result = client.create_annotation request - - # The returned object is of type Google::Cloud::VisionAI::V1::Annotation. - p result -end -# [END visionai_v1_generated_Warehouse_CreateAnnotation_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/create_asset.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/create_asset.rb deleted file mode 100644 index 61ffc440d3c6..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/create_asset.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 visionai_v1_generated_Warehouse_CreateAsset_sync] -require "google/cloud/vision_ai/v1" - -## -# Snippet for the create_asset call in the Warehouse 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::VisionAI::V1::Warehouse::Client#create_asset. -# -def create_asset - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VisionAI::V1::Warehouse::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VisionAI::V1::CreateAssetRequest.new - - # Call the create_asset method. - result = client.create_asset request - - # The returned object is of type Google::Cloud::VisionAI::V1::Asset. - p result -end -# [END visionai_v1_generated_Warehouse_CreateAsset_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/create_collection.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/create_collection.rb deleted file mode 100644 index 9210da1576e0..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/create_collection.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 visionai_v1_generated_Warehouse_CreateCollection_sync] -require "google/cloud/vision_ai/v1" - -## -# Snippet for the create_collection call in the Warehouse 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::VisionAI::V1::Warehouse::Client#create_collection. -# -def create_collection - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VisionAI::V1::Warehouse::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VisionAI::V1::CreateCollectionRequest.new - - # Call the create_collection method. - result = client.create_collection 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 visionai_v1_generated_Warehouse_CreateCollection_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/create_corpus.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/create_corpus.rb deleted file mode 100644 index a71363888ee6..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/create_corpus.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 visionai_v1_generated_Warehouse_CreateCorpus_sync] -require "google/cloud/vision_ai/v1" - -## -# Snippet for the create_corpus call in the Warehouse 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::VisionAI::V1::Warehouse::Client#create_corpus. -# -def create_corpus - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VisionAI::V1::Warehouse::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VisionAI::V1::CreateCorpusRequest.new - - # Call the create_corpus method. - result = client.create_corpus 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 visionai_v1_generated_Warehouse_CreateCorpus_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/create_data_schema.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/create_data_schema.rb deleted file mode 100644 index 00fc7e77ffa8..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/create_data_schema.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 visionai_v1_generated_Warehouse_CreateDataSchema_sync] -require "google/cloud/vision_ai/v1" - -## -# Snippet for the create_data_schema call in the Warehouse 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::VisionAI::V1::Warehouse::Client#create_data_schema. -# -def create_data_schema - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VisionAI::V1::Warehouse::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VisionAI::V1::CreateDataSchemaRequest.new - - # Call the create_data_schema method. - result = client.create_data_schema request - - # The returned object is of type Google::Cloud::VisionAI::V1::DataSchema. - p result -end -# [END visionai_v1_generated_Warehouse_CreateDataSchema_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/create_index.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/create_index.rb deleted file mode 100644 index e2566a698de8..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/create_index.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 visionai_v1_generated_Warehouse_CreateIndex_sync] -require "google/cloud/vision_ai/v1" - -## -# Snippet for the create_index call in the Warehouse 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::VisionAI::V1::Warehouse::Client#create_index. -# -def create_index - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VisionAI::V1::Warehouse::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VisionAI::V1::CreateIndexRequest.new - - # Call the create_index method. - result = client.create_index 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 visionai_v1_generated_Warehouse_CreateIndex_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/create_index_endpoint.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/create_index_endpoint.rb deleted file mode 100644 index 695f24b1fab2..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/create_index_endpoint.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 visionai_v1_generated_Warehouse_CreateIndexEndpoint_sync] -require "google/cloud/vision_ai/v1" - -## -# Snippet for the create_index_endpoint call in the Warehouse 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::VisionAI::V1::Warehouse::Client#create_index_endpoint. -# -def create_index_endpoint - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VisionAI::V1::Warehouse::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VisionAI::V1::CreateIndexEndpointRequest.new - - # Call the create_index_endpoint method. - result = client.create_index_endpoint 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 visionai_v1_generated_Warehouse_CreateIndexEndpoint_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/create_search_config.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/create_search_config.rb deleted file mode 100644 index 957ddb90ee4f..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/create_search_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 visionai_v1_generated_Warehouse_CreateSearchConfig_sync] -require "google/cloud/vision_ai/v1" - -## -# Snippet for the create_search_config call in the Warehouse 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::VisionAI::V1::Warehouse::Client#create_search_config. -# -def create_search_config - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VisionAI::V1::Warehouse::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VisionAI::V1::CreateSearchConfigRequest.new - - # Call the create_search_config method. - result = client.create_search_config request - - # The returned object is of type Google::Cloud::VisionAI::V1::SearchConfig. - p result -end -# [END visionai_v1_generated_Warehouse_CreateSearchConfig_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/create_search_hypernym.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/create_search_hypernym.rb deleted file mode 100644 index 345c8da59d2f..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/create_search_hypernym.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 visionai_v1_generated_Warehouse_CreateSearchHypernym_sync] -require "google/cloud/vision_ai/v1" - -## -# Snippet for the create_search_hypernym call in the Warehouse 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::VisionAI::V1::Warehouse::Client#create_search_hypernym. -# -def create_search_hypernym - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VisionAI::V1::Warehouse::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VisionAI::V1::CreateSearchHypernymRequest.new - - # Call the create_search_hypernym method. - result = client.create_search_hypernym request - - # The returned object is of type Google::Cloud::VisionAI::V1::SearchHypernym. - p result -end -# [END visionai_v1_generated_Warehouse_CreateSearchHypernym_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/delete_annotation.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/delete_annotation.rb deleted file mode 100644 index f67d2d0c5785..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/delete_annotation.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 visionai_v1_generated_Warehouse_DeleteAnnotation_sync] -require "google/cloud/vision_ai/v1" - -## -# Snippet for the delete_annotation call in the Warehouse 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::VisionAI::V1::Warehouse::Client#delete_annotation. -# -def delete_annotation - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VisionAI::V1::Warehouse::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VisionAI::V1::DeleteAnnotationRequest.new - - # Call the delete_annotation method. - result = client.delete_annotation request - - # The returned object is of type Google::Protobuf::Empty. - p result -end -# [END visionai_v1_generated_Warehouse_DeleteAnnotation_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/delete_asset.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/delete_asset.rb deleted file mode 100644 index 75ea7cad5721..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/delete_asset.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 visionai_v1_generated_Warehouse_DeleteAsset_sync] -require "google/cloud/vision_ai/v1" - -## -# Snippet for the delete_asset call in the Warehouse 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::VisionAI::V1::Warehouse::Client#delete_asset. -# -def delete_asset - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VisionAI::V1::Warehouse::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VisionAI::V1::DeleteAssetRequest.new - - # Call the delete_asset method. - result = client.delete_asset 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 visionai_v1_generated_Warehouse_DeleteAsset_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/delete_collection.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/delete_collection.rb deleted file mode 100644 index ac1d5a5d0b71..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/delete_collection.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 visionai_v1_generated_Warehouse_DeleteCollection_sync] -require "google/cloud/vision_ai/v1" - -## -# Snippet for the delete_collection call in the Warehouse 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::VisionAI::V1::Warehouse::Client#delete_collection. -# -def delete_collection - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VisionAI::V1::Warehouse::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VisionAI::V1::DeleteCollectionRequest.new - - # Call the delete_collection method. - result = client.delete_collection 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 visionai_v1_generated_Warehouse_DeleteCollection_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/delete_corpus.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/delete_corpus.rb deleted file mode 100644 index 577feab9a30b..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/delete_corpus.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 visionai_v1_generated_Warehouse_DeleteCorpus_sync] -require "google/cloud/vision_ai/v1" - -## -# Snippet for the delete_corpus call in the Warehouse 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::VisionAI::V1::Warehouse::Client#delete_corpus. -# -def delete_corpus - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VisionAI::V1::Warehouse::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VisionAI::V1::DeleteCorpusRequest.new - - # Call the delete_corpus method. - result = client.delete_corpus request - - # The returned object is of type Google::Protobuf::Empty. - p result -end -# [END visionai_v1_generated_Warehouse_DeleteCorpus_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/delete_data_schema.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/delete_data_schema.rb deleted file mode 100644 index e862ecc39f53..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/delete_data_schema.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 visionai_v1_generated_Warehouse_DeleteDataSchema_sync] -require "google/cloud/vision_ai/v1" - -## -# Snippet for the delete_data_schema call in the Warehouse 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::VisionAI::V1::Warehouse::Client#delete_data_schema. -# -def delete_data_schema - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VisionAI::V1::Warehouse::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VisionAI::V1::DeleteDataSchemaRequest.new - - # Call the delete_data_schema method. - result = client.delete_data_schema request - - # The returned object is of type Google::Protobuf::Empty. - p result -end -# [END visionai_v1_generated_Warehouse_DeleteDataSchema_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/delete_index.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/delete_index.rb deleted file mode 100644 index a259d1af1f86..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/delete_index.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 visionai_v1_generated_Warehouse_DeleteIndex_sync] -require "google/cloud/vision_ai/v1" - -## -# Snippet for the delete_index call in the Warehouse 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::VisionAI::V1::Warehouse::Client#delete_index. -# -def delete_index - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VisionAI::V1::Warehouse::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VisionAI::V1::DeleteIndexRequest.new - - # Call the delete_index method. - result = client.delete_index 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 visionai_v1_generated_Warehouse_DeleteIndex_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/delete_index_endpoint.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/delete_index_endpoint.rb deleted file mode 100644 index 17d3d327c3d9..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/delete_index_endpoint.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 visionai_v1_generated_Warehouse_DeleteIndexEndpoint_sync] -require "google/cloud/vision_ai/v1" - -## -# Snippet for the delete_index_endpoint call in the Warehouse 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::VisionAI::V1::Warehouse::Client#delete_index_endpoint. -# -def delete_index_endpoint - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VisionAI::V1::Warehouse::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VisionAI::V1::DeleteIndexEndpointRequest.new - - # Call the delete_index_endpoint method. - result = client.delete_index_endpoint 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 visionai_v1_generated_Warehouse_DeleteIndexEndpoint_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/delete_search_config.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/delete_search_config.rb deleted file mode 100644 index 1f71387752d9..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/delete_search_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 visionai_v1_generated_Warehouse_DeleteSearchConfig_sync] -require "google/cloud/vision_ai/v1" - -## -# Snippet for the delete_search_config call in the Warehouse 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::VisionAI::V1::Warehouse::Client#delete_search_config. -# -def delete_search_config - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VisionAI::V1::Warehouse::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VisionAI::V1::DeleteSearchConfigRequest.new - - # Call the delete_search_config method. - result = client.delete_search_config request - - # The returned object is of type Google::Protobuf::Empty. - p result -end -# [END visionai_v1_generated_Warehouse_DeleteSearchConfig_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/delete_search_hypernym.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/delete_search_hypernym.rb deleted file mode 100644 index 56192f4c5cb8..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/delete_search_hypernym.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 visionai_v1_generated_Warehouse_DeleteSearchHypernym_sync] -require "google/cloud/vision_ai/v1" - -## -# Snippet for the delete_search_hypernym call in the Warehouse 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::VisionAI::V1::Warehouse::Client#delete_search_hypernym. -# -def delete_search_hypernym - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VisionAI::V1::Warehouse::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VisionAI::V1::DeleteSearchHypernymRequest.new - - # Call the delete_search_hypernym method. - result = client.delete_search_hypernym request - - # The returned object is of type Google::Protobuf::Empty. - p result -end -# [END visionai_v1_generated_Warehouse_DeleteSearchHypernym_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/deploy_index.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/deploy_index.rb deleted file mode 100644 index fc231810d759..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/deploy_index.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 visionai_v1_generated_Warehouse_DeployIndex_sync] -require "google/cloud/vision_ai/v1" - -## -# Snippet for the deploy_index call in the Warehouse 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::VisionAI::V1::Warehouse::Client#deploy_index. -# -def deploy_index - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VisionAI::V1::Warehouse::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VisionAI::V1::DeployIndexRequest.new - - # Call the deploy_index method. - result = client.deploy_index 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 visionai_v1_generated_Warehouse_DeployIndex_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/generate_hls_uri.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/generate_hls_uri.rb deleted file mode 100644 index 2186064e5617..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/generate_hls_uri.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 visionai_v1_generated_Warehouse_GenerateHlsUri_sync] -require "google/cloud/vision_ai/v1" - -## -# Snippet for the generate_hls_uri call in the Warehouse 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::VisionAI::V1::Warehouse::Client#generate_hls_uri. -# -def generate_hls_uri - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VisionAI::V1::Warehouse::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VisionAI::V1::GenerateHlsUriRequest.new - - # Call the generate_hls_uri method. - result = client.generate_hls_uri request - - # The returned object is of type Google::Cloud::VisionAI::V1::GenerateHlsUriResponse. - p result -end -# [END visionai_v1_generated_Warehouse_GenerateHlsUri_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/generate_retrieval_url.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/generate_retrieval_url.rb deleted file mode 100644 index 0e226cc39f4b..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/generate_retrieval_url.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 visionai_v1_generated_Warehouse_GenerateRetrievalUrl_sync] -require "google/cloud/vision_ai/v1" - -## -# Snippet for the generate_retrieval_url call in the Warehouse 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::VisionAI::V1::Warehouse::Client#generate_retrieval_url. -# -def generate_retrieval_url - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VisionAI::V1::Warehouse::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VisionAI::V1::GenerateRetrievalUrlRequest.new - - # Call the generate_retrieval_url method. - result = client.generate_retrieval_url request - - # The returned object is of type Google::Cloud::VisionAI::V1::GenerateRetrievalUrlResponse. - p result -end -# [END visionai_v1_generated_Warehouse_GenerateRetrievalUrl_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/get_annotation.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/get_annotation.rb deleted file mode 100644 index d172d458d07f..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/get_annotation.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 visionai_v1_generated_Warehouse_GetAnnotation_sync] -require "google/cloud/vision_ai/v1" - -## -# Snippet for the get_annotation call in the Warehouse 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::VisionAI::V1::Warehouse::Client#get_annotation. -# -def get_annotation - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VisionAI::V1::Warehouse::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VisionAI::V1::GetAnnotationRequest.new - - # Call the get_annotation method. - result = client.get_annotation request - - # The returned object is of type Google::Cloud::VisionAI::V1::Annotation. - p result -end -# [END visionai_v1_generated_Warehouse_GetAnnotation_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/get_asset.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/get_asset.rb deleted file mode 100644 index 8e9bf93d6c8e..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/get_asset.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 visionai_v1_generated_Warehouse_GetAsset_sync] -require "google/cloud/vision_ai/v1" - -## -# Snippet for the get_asset call in the Warehouse 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::VisionAI::V1::Warehouse::Client#get_asset. -# -def get_asset - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VisionAI::V1::Warehouse::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VisionAI::V1::GetAssetRequest.new - - # Call the get_asset method. - result = client.get_asset request - - # The returned object is of type Google::Cloud::VisionAI::V1::Asset. - p result -end -# [END visionai_v1_generated_Warehouse_GetAsset_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/get_collection.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/get_collection.rb deleted file mode 100644 index 23b92eee4508..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/get_collection.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 visionai_v1_generated_Warehouse_GetCollection_sync] -require "google/cloud/vision_ai/v1" - -## -# Snippet for the get_collection call in the Warehouse 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::VisionAI::V1::Warehouse::Client#get_collection. -# -def get_collection - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VisionAI::V1::Warehouse::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VisionAI::V1::GetCollectionRequest.new - - # Call the get_collection method. - result = client.get_collection request - - # The returned object is of type Google::Cloud::VisionAI::V1::Collection. - p result -end -# [END visionai_v1_generated_Warehouse_GetCollection_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/get_corpus.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/get_corpus.rb deleted file mode 100644 index 6a22887fca28..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/get_corpus.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 visionai_v1_generated_Warehouse_GetCorpus_sync] -require "google/cloud/vision_ai/v1" - -## -# Snippet for the get_corpus call in the Warehouse 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::VisionAI::V1::Warehouse::Client#get_corpus. -# -def get_corpus - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VisionAI::V1::Warehouse::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VisionAI::V1::GetCorpusRequest.new - - # Call the get_corpus method. - result = client.get_corpus request - - # The returned object is of type Google::Cloud::VisionAI::V1::Corpus. - p result -end -# [END visionai_v1_generated_Warehouse_GetCorpus_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/get_data_schema.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/get_data_schema.rb deleted file mode 100644 index 6ea36076a235..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/get_data_schema.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 visionai_v1_generated_Warehouse_GetDataSchema_sync] -require "google/cloud/vision_ai/v1" - -## -# Snippet for the get_data_schema call in the Warehouse 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::VisionAI::V1::Warehouse::Client#get_data_schema. -# -def get_data_schema - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VisionAI::V1::Warehouse::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VisionAI::V1::GetDataSchemaRequest.new - - # Call the get_data_schema method. - result = client.get_data_schema request - - # The returned object is of type Google::Cloud::VisionAI::V1::DataSchema. - p result -end -# [END visionai_v1_generated_Warehouse_GetDataSchema_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/get_index.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/get_index.rb deleted file mode 100644 index ad2ebb971432..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/get_index.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 visionai_v1_generated_Warehouse_GetIndex_sync] -require "google/cloud/vision_ai/v1" - -## -# Snippet for the get_index call in the Warehouse 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::VisionAI::V1::Warehouse::Client#get_index. -# -def get_index - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VisionAI::V1::Warehouse::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VisionAI::V1::GetIndexRequest.new - - # Call the get_index method. - result = client.get_index request - - # The returned object is of type Google::Cloud::VisionAI::V1::Index. - p result -end -# [END visionai_v1_generated_Warehouse_GetIndex_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/get_index_endpoint.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/get_index_endpoint.rb deleted file mode 100644 index 09ab4efe5e57..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/get_index_endpoint.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 visionai_v1_generated_Warehouse_GetIndexEndpoint_sync] -require "google/cloud/vision_ai/v1" - -## -# Snippet for the get_index_endpoint call in the Warehouse 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::VisionAI::V1::Warehouse::Client#get_index_endpoint. -# -def get_index_endpoint - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VisionAI::V1::Warehouse::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VisionAI::V1::GetIndexEndpointRequest.new - - # Call the get_index_endpoint method. - result = client.get_index_endpoint request - - # The returned object is of type Google::Cloud::VisionAI::V1::IndexEndpoint. - p result -end -# [END visionai_v1_generated_Warehouse_GetIndexEndpoint_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/get_search_config.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/get_search_config.rb deleted file mode 100644 index 1d5d4e3d38e6..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/get_search_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 visionai_v1_generated_Warehouse_GetSearchConfig_sync] -require "google/cloud/vision_ai/v1" - -## -# Snippet for the get_search_config call in the Warehouse 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::VisionAI::V1::Warehouse::Client#get_search_config. -# -def get_search_config - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VisionAI::V1::Warehouse::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VisionAI::V1::GetSearchConfigRequest.new - - # Call the get_search_config method. - result = client.get_search_config request - - # The returned object is of type Google::Cloud::VisionAI::V1::SearchConfig. - p result -end -# [END visionai_v1_generated_Warehouse_GetSearchConfig_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/get_search_hypernym.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/get_search_hypernym.rb deleted file mode 100644 index e6274e953754..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/get_search_hypernym.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 visionai_v1_generated_Warehouse_GetSearchHypernym_sync] -require "google/cloud/vision_ai/v1" - -## -# Snippet for the get_search_hypernym call in the Warehouse 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::VisionAI::V1::Warehouse::Client#get_search_hypernym. -# -def get_search_hypernym - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VisionAI::V1::Warehouse::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VisionAI::V1::GetSearchHypernymRequest.new - - # Call the get_search_hypernym method. - result = client.get_search_hypernym request - - # The returned object is of type Google::Cloud::VisionAI::V1::SearchHypernym. - p result -end -# [END visionai_v1_generated_Warehouse_GetSearchHypernym_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/import_assets.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/import_assets.rb deleted file mode 100644 index 37a4f97dd04f..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/import_assets.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 visionai_v1_generated_Warehouse_ImportAssets_sync] -require "google/cloud/vision_ai/v1" - -## -# Snippet for the import_assets call in the Warehouse 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::VisionAI::V1::Warehouse::Client#import_assets. -# -def import_assets - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VisionAI::V1::Warehouse::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VisionAI::V1::ImportAssetsRequest.new - - # Call the import_assets method. - result = client.import_assets 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 visionai_v1_generated_Warehouse_ImportAssets_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/index_asset.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/index_asset.rb deleted file mode 100644 index c60b09267253..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/index_asset.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 visionai_v1_generated_Warehouse_IndexAsset_sync] -require "google/cloud/vision_ai/v1" - -## -# Snippet for the index_asset call in the Warehouse 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::VisionAI::V1::Warehouse::Client#index_asset. -# -def index_asset - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VisionAI::V1::Warehouse::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VisionAI::V1::IndexAssetRequest.new - - # Call the index_asset method. - result = client.index_asset 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 visionai_v1_generated_Warehouse_IndexAsset_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/ingest_asset.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/ingest_asset.rb deleted file mode 100644 index 0788e3149c94..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/ingest_asset.rb +++ /dev/null @@ -1,56 +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 visionai_v1_generated_Warehouse_IngestAsset_sync] -require "google/cloud/vision_ai/v1" - -## -# Snippet for the ingest_asset call in the Warehouse 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::VisionAI::V1::Warehouse::Client#ingest_asset. -# -def ingest_asset - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VisionAI::V1::Warehouse::Client.new - - # Create an input stream. - input = Gapic::StreamInput.new - - # Call the ingest_asset method to start streaming. - output = client.ingest_asset input - - # Send requests on the stream. For each request object, set fields by - # passing keyword arguments. Be sure to close the stream when done. - input << Google::Cloud::VisionAI::V1::IngestAssetRequest.new - input << Google::Cloud::VisionAI::V1::IngestAssetRequest.new - input.close - - # The returned object is a streamed enumerable yielding elements of type - # ::Google::Cloud::VisionAI::V1::IngestAssetResponse - output.each do |current_response| - p current_response - end -end -# [END visionai_v1_generated_Warehouse_IngestAsset_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/list_annotations.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/list_annotations.rb deleted file mode 100644 index 5a3bc27d12bf..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/list_annotations.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 visionai_v1_generated_Warehouse_ListAnnotations_sync] -require "google/cloud/vision_ai/v1" - -## -# Snippet for the list_annotations call in the Warehouse 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::VisionAI::V1::Warehouse::Client#list_annotations. -# -def list_annotations - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VisionAI::V1::Warehouse::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VisionAI::V1::ListAnnotationsRequest.new - - # Call the list_annotations method. - result = client.list_annotations 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::VisionAI::V1::Annotation. - p item - end -end -# [END visionai_v1_generated_Warehouse_ListAnnotations_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/list_assets.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/list_assets.rb deleted file mode 100644 index a101fc07114e..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/list_assets.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 visionai_v1_generated_Warehouse_ListAssets_sync] -require "google/cloud/vision_ai/v1" - -## -# Snippet for the list_assets call in the Warehouse 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::VisionAI::V1::Warehouse::Client#list_assets. -# -def list_assets - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VisionAI::V1::Warehouse::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VisionAI::V1::ListAssetsRequest.new - - # Call the list_assets method. - result = client.list_assets 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::VisionAI::V1::Asset. - p item - end -end -# [END visionai_v1_generated_Warehouse_ListAssets_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/list_collections.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/list_collections.rb deleted file mode 100644 index 4681d06db76d..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/list_collections.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 visionai_v1_generated_Warehouse_ListCollections_sync] -require "google/cloud/vision_ai/v1" - -## -# Snippet for the list_collections call in the Warehouse 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::VisionAI::V1::Warehouse::Client#list_collections. -# -def list_collections - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VisionAI::V1::Warehouse::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VisionAI::V1::ListCollectionsRequest.new - - # Call the list_collections method. - result = client.list_collections 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::VisionAI::V1::Collection. - p item - end -end -# [END visionai_v1_generated_Warehouse_ListCollections_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/list_corpora.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/list_corpora.rb deleted file mode 100644 index e7c8edd062e1..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/list_corpora.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 visionai_v1_generated_Warehouse_ListCorpora_sync] -require "google/cloud/vision_ai/v1" - -## -# Snippet for the list_corpora call in the Warehouse 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::VisionAI::V1::Warehouse::Client#list_corpora. -# -def list_corpora - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VisionAI::V1::Warehouse::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VisionAI::V1::ListCorporaRequest.new - - # Call the list_corpora method. - result = client.list_corpora 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::VisionAI::V1::Corpus. - p item - end -end -# [END visionai_v1_generated_Warehouse_ListCorpora_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/list_data_schemas.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/list_data_schemas.rb deleted file mode 100644 index 18cd0ad1b0b5..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/list_data_schemas.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 visionai_v1_generated_Warehouse_ListDataSchemas_sync] -require "google/cloud/vision_ai/v1" - -## -# Snippet for the list_data_schemas call in the Warehouse 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::VisionAI::V1::Warehouse::Client#list_data_schemas. -# -def list_data_schemas - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VisionAI::V1::Warehouse::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VisionAI::V1::ListDataSchemasRequest.new - - # Call the list_data_schemas method. - result = client.list_data_schemas 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::VisionAI::V1::DataSchema. - p item - end -end -# [END visionai_v1_generated_Warehouse_ListDataSchemas_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/list_index_endpoints.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/list_index_endpoints.rb deleted file mode 100644 index 274bfabd03a6..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/list_index_endpoints.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 visionai_v1_generated_Warehouse_ListIndexEndpoints_sync] -require "google/cloud/vision_ai/v1" - -## -# Snippet for the list_index_endpoints call in the Warehouse 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::VisionAI::V1::Warehouse::Client#list_index_endpoints. -# -def list_index_endpoints - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VisionAI::V1::Warehouse::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VisionAI::V1::ListIndexEndpointsRequest.new - - # Call the list_index_endpoints method. - result = client.list_index_endpoints 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::VisionAI::V1::IndexEndpoint. - p item - end -end -# [END visionai_v1_generated_Warehouse_ListIndexEndpoints_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/list_indexes.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/list_indexes.rb deleted file mode 100644 index fe91e984704a..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/list_indexes.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 visionai_v1_generated_Warehouse_ListIndexes_sync] -require "google/cloud/vision_ai/v1" - -## -# Snippet for the list_indexes call in the Warehouse 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::VisionAI::V1::Warehouse::Client#list_indexes. -# -def list_indexes - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VisionAI::V1::Warehouse::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VisionAI::V1::ListIndexesRequest.new - - # Call the list_indexes method. - result = client.list_indexes 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::VisionAI::V1::Index. - p item - end -end -# [END visionai_v1_generated_Warehouse_ListIndexes_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/list_search_configs.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/list_search_configs.rb deleted file mode 100644 index 537e8564796e..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/list_search_configs.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 visionai_v1_generated_Warehouse_ListSearchConfigs_sync] -require "google/cloud/vision_ai/v1" - -## -# Snippet for the list_search_configs call in the Warehouse 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::VisionAI::V1::Warehouse::Client#list_search_configs. -# -def list_search_configs - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VisionAI::V1::Warehouse::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VisionAI::V1::ListSearchConfigsRequest.new - - # Call the list_search_configs method. - result = client.list_search_configs 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::VisionAI::V1::SearchConfig. - p item - end -end -# [END visionai_v1_generated_Warehouse_ListSearchConfigs_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/list_search_hypernyms.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/list_search_hypernyms.rb deleted file mode 100644 index 592ca481c67a..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/list_search_hypernyms.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 visionai_v1_generated_Warehouse_ListSearchHypernyms_sync] -require "google/cloud/vision_ai/v1" - -## -# Snippet for the list_search_hypernyms call in the Warehouse 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::VisionAI::V1::Warehouse::Client#list_search_hypernyms. -# -def list_search_hypernyms - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VisionAI::V1::Warehouse::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VisionAI::V1::ListSearchHypernymsRequest.new - - # Call the list_search_hypernyms method. - result = client.list_search_hypernyms 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::VisionAI::V1::SearchHypernym. - p item - end -end -# [END visionai_v1_generated_Warehouse_ListSearchHypernyms_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/remove_collection_item.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/remove_collection_item.rb deleted file mode 100644 index f3235f3e1006..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/remove_collection_item.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 visionai_v1_generated_Warehouse_RemoveCollectionItem_sync] -require "google/cloud/vision_ai/v1" - -## -# Snippet for the remove_collection_item call in the Warehouse 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::VisionAI::V1::Warehouse::Client#remove_collection_item. -# -def remove_collection_item - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VisionAI::V1::Warehouse::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VisionAI::V1::RemoveCollectionItemRequest.new - - # Call the remove_collection_item method. - result = client.remove_collection_item request - - # The returned object is of type Google::Cloud::VisionAI::V1::RemoveCollectionItemResponse. - p result -end -# [END visionai_v1_generated_Warehouse_RemoveCollectionItem_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/remove_index_asset.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/remove_index_asset.rb deleted file mode 100644 index f9746297cbd9..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/remove_index_asset.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 visionai_v1_generated_Warehouse_RemoveIndexAsset_sync] -require "google/cloud/vision_ai/v1" - -## -# Snippet for the remove_index_asset call in the Warehouse 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::VisionAI::V1::Warehouse::Client#remove_index_asset. -# -def remove_index_asset - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VisionAI::V1::Warehouse::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VisionAI::V1::RemoveIndexAssetRequest.new - - # Call the remove_index_asset method. - result = client.remove_index_asset 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 visionai_v1_generated_Warehouse_RemoveIndexAsset_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/search_assets.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/search_assets.rb deleted file mode 100644 index 8e6cbea7eee8..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/search_assets.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 visionai_v1_generated_Warehouse_SearchAssets_sync] -require "google/cloud/vision_ai/v1" - -## -# Snippet for the search_assets call in the Warehouse 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::VisionAI::V1::Warehouse::Client#search_assets. -# -def search_assets - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VisionAI::V1::Warehouse::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VisionAI::V1::SearchAssetsRequest.new - - # Call the search_assets method. - result = client.search_assets 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::VisionAI::V1::SearchResultItem. - p item - end -end -# [END visionai_v1_generated_Warehouse_SearchAssets_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/search_index_endpoint.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/search_index_endpoint.rb deleted file mode 100644 index e8ab8b2385cc..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/search_index_endpoint.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 visionai_v1_generated_Warehouse_SearchIndexEndpoint_sync] -require "google/cloud/vision_ai/v1" - -## -# Snippet for the search_index_endpoint call in the Warehouse 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::VisionAI::V1::Warehouse::Client#search_index_endpoint. -# -def search_index_endpoint - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VisionAI::V1::Warehouse::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VisionAI::V1::SearchIndexEndpointRequest.new - - # Call the search_index_endpoint method. - result = client.search_index_endpoint 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::VisionAI::V1::SearchResultItem. - p item - end -end -# [END visionai_v1_generated_Warehouse_SearchIndexEndpoint_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/undeploy_index.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/undeploy_index.rb deleted file mode 100644 index 781e146dd029..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/undeploy_index.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 visionai_v1_generated_Warehouse_UndeployIndex_sync] -require "google/cloud/vision_ai/v1" - -## -# Snippet for the undeploy_index call in the Warehouse 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::VisionAI::V1::Warehouse::Client#undeploy_index. -# -def undeploy_index - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VisionAI::V1::Warehouse::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VisionAI::V1::UndeployIndexRequest.new - - # Call the undeploy_index method. - result = client.undeploy_index 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 visionai_v1_generated_Warehouse_UndeployIndex_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/update_annotation.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/update_annotation.rb deleted file mode 100644 index e1f8ef9eef68..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/update_annotation.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 visionai_v1_generated_Warehouse_UpdateAnnotation_sync] -require "google/cloud/vision_ai/v1" - -## -# Snippet for the update_annotation call in the Warehouse 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::VisionAI::V1::Warehouse::Client#update_annotation. -# -def update_annotation - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VisionAI::V1::Warehouse::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VisionAI::V1::UpdateAnnotationRequest.new - - # Call the update_annotation method. - result = client.update_annotation request - - # The returned object is of type Google::Cloud::VisionAI::V1::Annotation. - p result -end -# [END visionai_v1_generated_Warehouse_UpdateAnnotation_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/update_asset.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/update_asset.rb deleted file mode 100644 index 1aba38e1656c..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/update_asset.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 visionai_v1_generated_Warehouse_UpdateAsset_sync] -require "google/cloud/vision_ai/v1" - -## -# Snippet for the update_asset call in the Warehouse 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::VisionAI::V1::Warehouse::Client#update_asset. -# -def update_asset - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VisionAI::V1::Warehouse::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VisionAI::V1::UpdateAssetRequest.new - - # Call the update_asset method. - result = client.update_asset request - - # The returned object is of type Google::Cloud::VisionAI::V1::Asset. - p result -end -# [END visionai_v1_generated_Warehouse_UpdateAsset_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/update_collection.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/update_collection.rb deleted file mode 100644 index 13d6a1040d9d..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/update_collection.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 visionai_v1_generated_Warehouse_UpdateCollection_sync] -require "google/cloud/vision_ai/v1" - -## -# Snippet for the update_collection call in the Warehouse 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::VisionAI::V1::Warehouse::Client#update_collection. -# -def update_collection - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VisionAI::V1::Warehouse::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VisionAI::V1::UpdateCollectionRequest.new - - # Call the update_collection method. - result = client.update_collection request - - # The returned object is of type Google::Cloud::VisionAI::V1::Collection. - p result -end -# [END visionai_v1_generated_Warehouse_UpdateCollection_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/update_corpus.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/update_corpus.rb deleted file mode 100644 index 4914f1b00e17..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/update_corpus.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 visionai_v1_generated_Warehouse_UpdateCorpus_sync] -require "google/cloud/vision_ai/v1" - -## -# Snippet for the update_corpus call in the Warehouse 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::VisionAI::V1::Warehouse::Client#update_corpus. -# -def update_corpus - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VisionAI::V1::Warehouse::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VisionAI::V1::UpdateCorpusRequest.new - - # Call the update_corpus method. - result = client.update_corpus request - - # The returned object is of type Google::Cloud::VisionAI::V1::Corpus. - p result -end -# [END visionai_v1_generated_Warehouse_UpdateCorpus_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/update_data_schema.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/update_data_schema.rb deleted file mode 100644 index c517d4d8c7f1..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/update_data_schema.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 visionai_v1_generated_Warehouse_UpdateDataSchema_sync] -require "google/cloud/vision_ai/v1" - -## -# Snippet for the update_data_schema call in the Warehouse 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::VisionAI::V1::Warehouse::Client#update_data_schema. -# -def update_data_schema - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VisionAI::V1::Warehouse::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VisionAI::V1::UpdateDataSchemaRequest.new - - # Call the update_data_schema method. - result = client.update_data_schema request - - # The returned object is of type Google::Cloud::VisionAI::V1::DataSchema. - p result -end -# [END visionai_v1_generated_Warehouse_UpdateDataSchema_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/update_index.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/update_index.rb deleted file mode 100644 index ba0ab104e62e..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/update_index.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 visionai_v1_generated_Warehouse_UpdateIndex_sync] -require "google/cloud/vision_ai/v1" - -## -# Snippet for the update_index call in the Warehouse 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::VisionAI::V1::Warehouse::Client#update_index. -# -def update_index - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VisionAI::V1::Warehouse::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VisionAI::V1::UpdateIndexRequest.new - - # Call the update_index method. - result = client.update_index 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 visionai_v1_generated_Warehouse_UpdateIndex_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/update_index_endpoint.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/update_index_endpoint.rb deleted file mode 100644 index d29fe60bfd8c..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/update_index_endpoint.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 visionai_v1_generated_Warehouse_UpdateIndexEndpoint_sync] -require "google/cloud/vision_ai/v1" - -## -# Snippet for the update_index_endpoint call in the Warehouse 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::VisionAI::V1::Warehouse::Client#update_index_endpoint. -# -def update_index_endpoint - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VisionAI::V1::Warehouse::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VisionAI::V1::UpdateIndexEndpointRequest.new - - # Call the update_index_endpoint method. - result = client.update_index_endpoint 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 visionai_v1_generated_Warehouse_UpdateIndexEndpoint_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/update_search_config.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/update_search_config.rb deleted file mode 100644 index e728c509312a..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/update_search_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 visionai_v1_generated_Warehouse_UpdateSearchConfig_sync] -require "google/cloud/vision_ai/v1" - -## -# Snippet for the update_search_config call in the Warehouse 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::VisionAI::V1::Warehouse::Client#update_search_config. -# -def update_search_config - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VisionAI::V1::Warehouse::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VisionAI::V1::UpdateSearchConfigRequest.new - - # Call the update_search_config method. - result = client.update_search_config request - - # The returned object is of type Google::Cloud::VisionAI::V1::SearchConfig. - p result -end -# [END visionai_v1_generated_Warehouse_UpdateSearchConfig_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/update_search_hypernym.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/update_search_hypernym.rb deleted file mode 100644 index 269d1a7a4150..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/update_search_hypernym.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 visionai_v1_generated_Warehouse_UpdateSearchHypernym_sync] -require "google/cloud/vision_ai/v1" - -## -# Snippet for the update_search_hypernym call in the Warehouse 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::VisionAI::V1::Warehouse::Client#update_search_hypernym. -# -def update_search_hypernym - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VisionAI::V1::Warehouse::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VisionAI::V1::UpdateSearchHypernymRequest.new - - # Call the update_search_hypernym method. - result = client.update_search_hypernym request - - # The returned object is of type Google::Cloud::VisionAI::V1::SearchHypernym. - p result -end -# [END visionai_v1_generated_Warehouse_UpdateSearchHypernym_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/upload_asset.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/upload_asset.rb deleted file mode 100644 index 5be01151eaeb..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/upload_asset.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 visionai_v1_generated_Warehouse_UploadAsset_sync] -require "google/cloud/vision_ai/v1" - -## -# Snippet for the upload_asset call in the Warehouse 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::VisionAI::V1::Warehouse::Client#upload_asset. -# -def upload_asset - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VisionAI::V1::Warehouse::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VisionAI::V1::UploadAssetRequest.new - - # Call the upload_asset method. - result = client.upload_asset 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 visionai_v1_generated_Warehouse_UploadAsset_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/view_collection_items.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/view_collection_items.rb deleted file mode 100644 index 8b1b7f690add..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/view_collection_items.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 visionai_v1_generated_Warehouse_ViewCollectionItems_sync] -require "google/cloud/vision_ai/v1" - -## -# Snippet for the view_collection_items call in the Warehouse 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::VisionAI::V1::Warehouse::Client#view_collection_items. -# -def view_collection_items - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VisionAI::V1::Warehouse::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VisionAI::V1::ViewCollectionItemsRequest.new - - # Call the view_collection_items method. - result = client.view_collection_items 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::VisionAI::V1::CollectionItem. - p item - end -end -# [END visionai_v1_generated_Warehouse_ViewCollectionItems_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/view_indexed_assets.rb b/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/view_indexed_assets.rb deleted file mode 100644 index d806b79f3155..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/snippets/warehouse/view_indexed_assets.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 visionai_v1_generated_Warehouse_ViewIndexedAssets_sync] -require "google/cloud/vision_ai/v1" - -## -# Snippet for the view_indexed_assets call in the Warehouse 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::VisionAI::V1::Warehouse::Client#view_indexed_assets. -# -def view_indexed_assets - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VisionAI::V1::Warehouse::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VisionAI::V1::ViewIndexedAssetsRequest.new - - # Call the view_indexed_assets method. - result = client.view_indexed_assets 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::VisionAI::V1::IndexedAsset. - p item - end -end -# [END visionai_v1_generated_Warehouse_ViewIndexedAssets_sync] diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/test/google/cloud/vision_ai/v1/app_platform_operations_test.rb b/owl-bot-staging/google-cloud-vision_ai-v1/test/google/cloud/vision_ai/v1/app_platform_operations_test.rb deleted file mode 100644 index 96119834349a..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/test/google/cloud/vision_ai/v1/app_platform_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/visionai/v1/platform_pb" -require "google/cloud/visionai/v1/platform_services_pb" -require "google/cloud/vision_ai/v1/app_platform" - -class ::Google::Cloud::VisionAI::V1::AppPlatform::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::VisionAI::V1::AppPlatform::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::VisionAI::V1::AppPlatform::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::VisionAI::V1::AppPlatform::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::VisionAI::V1::AppPlatform::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::VisionAI::V1::AppPlatform::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::VisionAI::V1::AppPlatform::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::VisionAI::V1::AppPlatform::Operations::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/test/google/cloud/vision_ai/v1/app_platform_paths_test.rb b/owl-bot-staging/google-cloud-vision_ai-v1/test/google/cloud/vision_ai/v1/app_platform_paths_test.rb deleted file mode 100644 index 0722bae45465..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/test/google/cloud/vision_ai/v1/app_platform_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/vision_ai/v1/app_platform" - -class ::Google::Cloud::VisionAI::V1::AppPlatform::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_application_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::VisionAI::V1::AppPlatform::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.application_path project: "value0", location: "value1", application: "value2" - assert_equal "projects/value0/locations/value1/applications/value2", path - end - end - - def test_draft_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::VisionAI::V1::AppPlatform::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.draft_path project: "value0", location: "value1", application: "value2", draft: "value3" - assert_equal "projects/value0/locations/value1/applications/value2/drafts/value3", path - end - end - - def test_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::VisionAI::V1::AppPlatform::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.instance_path project: "value0", location: "value1", application: "value2", instance: "value3" - assert_equal "projects/value0/locations/value1/applications/value2/instances/value3", 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::VisionAI::V1::AppPlatform::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_processor_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::VisionAI::V1::AppPlatform::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.processor_path project: "value0", location: "value1", processor: "value2" - assert_equal "projects/value0/locations/value1/processors/value2", path - end - end - - def test_stream_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::VisionAI::V1::AppPlatform::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.stream_path project: "value0", location: "value1", cluster: "value2", stream: "value3" - assert_equal "projects/value0/locations/value1/clusters/value2/streams/value3", path - end - end -end diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/test/google/cloud/vision_ai/v1/app_platform_rest_test.rb b/owl-bot-staging/google-cloud-vision_ai-v1/test/google/cloud/vision_ai/v1/app_platform_rest_test.rb deleted file mode 100644 index edaf23b96d0e..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/test/google/cloud/vision_ai/v1/app_platform_rest_test.rb +++ /dev/null @@ -1,1557 +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/visionai/v1/platform_pb" -require "google/cloud/vision_ai/v1/app_platform/rest" - - -class ::Google::Cloud::VisionAI::V1::AppPlatform::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_applications - # Create test objects. - client_result = ::Google::Cloud::VisionAI::V1::ListApplicationsResponse.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_applications_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::VisionAI::V1::AppPlatform::Rest::ServiceStub.stub :transcode_list_applications_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_applications_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::AppPlatform::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_applications({ 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_applications 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_applications ::Google::Cloud::VisionAI::V1::ListApplicationsRequest.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_applications({ 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_applications(::Google::Cloud::VisionAI::V1::ListApplicationsRequest.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_applications_client_stub.call_count - end - end - end - - def test_get_application - # Create test objects. - client_result = ::Google::Cloud::VisionAI::V1::Application.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_application_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::VisionAI::V1::AppPlatform::Rest::ServiceStub.stub :transcode_get_application_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_application_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::AppPlatform::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_application({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_application name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_application ::Google::Cloud::VisionAI::V1::GetApplicationRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_application({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_application(::Google::Cloud::VisionAI::V1::GetApplicationRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_application_client_stub.call_count - end - end - end - - def test_create_application - # 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" - application_id = "hello world" - application = {} - request_id = "hello world" - - create_application_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::VisionAI::V1::AppPlatform::Rest::ServiceStub.stub :transcode_create_application_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_application_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::AppPlatform::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_application({ parent: parent, application_id: application_id, application: application, request_id: request_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_application parent: parent, application_id: application_id, application: application, request_id: request_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_application ::Google::Cloud::VisionAI::V1::CreateApplicationRequest.new(parent: parent, application_id: application_id, application: application, request_id: request_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_application({ parent: parent, application_id: application_id, application: application, request_id: request_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_application(::Google::Cloud::VisionAI::V1::CreateApplicationRequest.new(parent: parent, application_id: application_id, application: application, request_id: request_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_application_client_stub.call_count - end - end - end - - def test_update_application - # 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. - update_mask = {} - application = {} - request_id = "hello world" - - update_application_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::VisionAI::V1::AppPlatform::Rest::ServiceStub.stub :transcode_update_application_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_application_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::AppPlatform::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.update_application({ update_mask: update_mask, application: application, request_id: request_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.update_application update_mask: update_mask, application: application, request_id: request_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.update_application ::Google::Cloud::VisionAI::V1::UpdateApplicationRequest.new(update_mask: update_mask, application: application, request_id: request_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.update_application({ update_mask: update_mask, application: application, request_id: request_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.update_application(::Google::Cloud::VisionAI::V1::UpdateApplicationRequest.new(update_mask: update_mask, application: application, request_id: request_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, update_application_client_stub.call_count - end - end - end - - def test_delete_application - # 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" - request_id = "hello world" - force = true - - delete_application_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::VisionAI::V1::AppPlatform::Rest::ServiceStub.stub :transcode_delete_application_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_application_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::AppPlatform::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.delete_application({ name: name, request_id: request_id, force: force }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.delete_application name: name, request_id: request_id, force: force do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.delete_application ::Google::Cloud::VisionAI::V1::DeleteApplicationRequest.new(name: name, request_id: request_id, force: force) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.delete_application({ name: name, request_id: request_id, force: force }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.delete_application(::Google::Cloud::VisionAI::V1::DeleteApplicationRequest.new(name: name, request_id: request_id, force: force), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, delete_application_client_stub.call_count - end - end - end - - def test_deploy_application - # 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" - validate_only = true - request_id = "hello world" - enable_monitoring = true - - deploy_application_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::VisionAI::V1::AppPlatform::Rest::ServiceStub.stub :transcode_deploy_application_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, deploy_application_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::AppPlatform::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.deploy_application({ name: name, validate_only: validate_only, request_id: request_id, enable_monitoring: enable_monitoring }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.deploy_application name: name, validate_only: validate_only, request_id: request_id, enable_monitoring: enable_monitoring do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.deploy_application ::Google::Cloud::VisionAI::V1::DeployApplicationRequest.new(name: name, validate_only: validate_only, request_id: request_id, enable_monitoring: enable_monitoring) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.deploy_application({ name: name, validate_only: validate_only, request_id: request_id, enable_monitoring: enable_monitoring }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.deploy_application(::Google::Cloud::VisionAI::V1::DeployApplicationRequest.new(name: name, validate_only: validate_only, request_id: request_id, enable_monitoring: enable_monitoring), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, deploy_application_client_stub.call_count - end - end - end - - def test_undeploy_application - # 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" - request_id = "hello world" - - undeploy_application_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::VisionAI::V1::AppPlatform::Rest::ServiceStub.stub :transcode_undeploy_application_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, undeploy_application_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::AppPlatform::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.undeploy_application({ name: name, request_id: request_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.undeploy_application name: name, request_id: request_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.undeploy_application ::Google::Cloud::VisionAI::V1::UndeployApplicationRequest.new(name: name, request_id: request_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.undeploy_application({ name: name, request_id: request_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.undeploy_application(::Google::Cloud::VisionAI::V1::UndeployApplicationRequest.new(name: name, request_id: request_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, undeploy_application_client_stub.call_count - end - end - end - - def test_add_application_stream_input - # 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" - application_stream_inputs = [{}] - request_id = "hello world" - - add_application_stream_input_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::VisionAI::V1::AppPlatform::Rest::ServiceStub.stub :transcode_add_application_stream_input_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, add_application_stream_input_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::AppPlatform::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.add_application_stream_input({ name: name, application_stream_inputs: application_stream_inputs, request_id: request_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.add_application_stream_input name: name, application_stream_inputs: application_stream_inputs, request_id: request_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.add_application_stream_input ::Google::Cloud::VisionAI::V1::AddApplicationStreamInputRequest.new(name: name, application_stream_inputs: application_stream_inputs, request_id: request_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.add_application_stream_input({ name: name, application_stream_inputs: application_stream_inputs, request_id: request_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.add_application_stream_input(::Google::Cloud::VisionAI::V1::AddApplicationStreamInputRequest.new(name: name, application_stream_inputs: application_stream_inputs, request_id: request_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, add_application_stream_input_client_stub.call_count - end - end - end - - def test_remove_application_stream_input - # 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" - target_stream_inputs = [{}] - request_id = "hello world" - - remove_application_stream_input_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::VisionAI::V1::AppPlatform::Rest::ServiceStub.stub :transcode_remove_application_stream_input_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, remove_application_stream_input_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::AppPlatform::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.remove_application_stream_input({ name: name, target_stream_inputs: target_stream_inputs, request_id: request_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.remove_application_stream_input name: name, target_stream_inputs: target_stream_inputs, request_id: request_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.remove_application_stream_input ::Google::Cloud::VisionAI::V1::RemoveApplicationStreamInputRequest.new(name: name, target_stream_inputs: target_stream_inputs, request_id: request_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.remove_application_stream_input({ name: name, target_stream_inputs: target_stream_inputs, request_id: request_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.remove_application_stream_input(::Google::Cloud::VisionAI::V1::RemoveApplicationStreamInputRequest.new(name: name, target_stream_inputs: target_stream_inputs, request_id: request_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, remove_application_stream_input_client_stub.call_count - end - end - end - - def test_update_application_stream_input - # 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" - application_stream_inputs = [{}] - request_id = "hello world" - allow_missing = true - - update_application_stream_input_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::VisionAI::V1::AppPlatform::Rest::ServiceStub.stub :transcode_update_application_stream_input_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_application_stream_input_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::AppPlatform::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.update_application_stream_input({ name: name, application_stream_inputs: application_stream_inputs, request_id: request_id, allow_missing: allow_missing }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.update_application_stream_input name: name, application_stream_inputs: application_stream_inputs, request_id: request_id, allow_missing: allow_missing do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.update_application_stream_input ::Google::Cloud::VisionAI::V1::UpdateApplicationStreamInputRequest.new(name: name, application_stream_inputs: application_stream_inputs, request_id: request_id, allow_missing: allow_missing) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.update_application_stream_input({ name: name, application_stream_inputs: application_stream_inputs, request_id: request_id, allow_missing: allow_missing }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.update_application_stream_input(::Google::Cloud::VisionAI::V1::UpdateApplicationStreamInputRequest.new(name: name, application_stream_inputs: application_stream_inputs, request_id: request_id, allow_missing: allow_missing), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, update_application_stream_input_client_stub.call_count - end - end - end - - def test_list_instances - # Create test objects. - client_result = ::Google::Cloud::VisionAI::V1::ListInstancesResponse.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_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::VisionAI::V1::AppPlatform::Rest::ServiceStub.stub :transcode_list_instances_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_instances_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::AppPlatform::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_instances({ 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_instances 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_instances ::Google::Cloud::VisionAI::V1::ListInstancesRequest.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_instances({ 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_instances(::Google::Cloud::VisionAI::V1::ListInstancesRequest.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_instances_client_stub.call_count - end - end - end - - def test_get_instance - # Create test objects. - client_result = ::Google::Cloud::VisionAI::V1::Instance.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_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::VisionAI::V1::AppPlatform::Rest::ServiceStub.stub :transcode_get_instance_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_instance_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::AppPlatform::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_instance({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_instance name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_instance ::Google::Cloud::VisionAI::V1::GetInstanceRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_instance({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_instance(::Google::Cloud::VisionAI::V1::GetInstanceRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_instance_client_stub.call_count - end - end - end - - def test_create_application_instances - # 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" - application_instances = [{}] - request_id = "hello world" - - create_application_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::VisionAI::V1::AppPlatform::Rest::ServiceStub.stub :transcode_create_application_instances_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_application_instances_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::AppPlatform::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_application_instances({ name: name, application_instances: application_instances, request_id: request_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_application_instances name: name, application_instances: application_instances, request_id: request_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_application_instances ::Google::Cloud::VisionAI::V1::CreateApplicationInstancesRequest.new(name: name, application_instances: application_instances, request_id: request_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_application_instances({ name: name, application_instances: application_instances, request_id: request_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_application_instances(::Google::Cloud::VisionAI::V1::CreateApplicationInstancesRequest.new(name: name, application_instances: application_instances, request_id: request_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_application_instances_client_stub.call_count - end - end - end - - def test_delete_application_instances - # 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" - instance_ids = ["hello world"] - request_id = "hello world" - - delete_application_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::VisionAI::V1::AppPlatform::Rest::ServiceStub.stub :transcode_delete_application_instances_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_application_instances_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::AppPlatform::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.delete_application_instances({ name: name, instance_ids: instance_ids, request_id: request_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.delete_application_instances name: name, instance_ids: instance_ids, request_id: request_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.delete_application_instances ::Google::Cloud::VisionAI::V1::DeleteApplicationInstancesRequest.new(name: name, instance_ids: instance_ids, request_id: request_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.delete_application_instances({ name: name, instance_ids: instance_ids, request_id: request_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.delete_application_instances(::Google::Cloud::VisionAI::V1::DeleteApplicationInstancesRequest.new(name: name, instance_ids: instance_ids, request_id: request_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, delete_application_instances_client_stub.call_count - end - end - end - - def test_update_application_instances - # 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" - application_instances = [{}] - request_id = "hello world" - allow_missing = true - - update_application_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::VisionAI::V1::AppPlatform::Rest::ServiceStub.stub :transcode_update_application_instances_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_application_instances_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::AppPlatform::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.update_application_instances({ name: name, application_instances: application_instances, request_id: request_id, allow_missing: allow_missing }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.update_application_instances name: name, application_instances: application_instances, request_id: request_id, allow_missing: allow_missing do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.update_application_instances ::Google::Cloud::VisionAI::V1::UpdateApplicationInstancesRequest.new(name: name, application_instances: application_instances, request_id: request_id, allow_missing: allow_missing) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.update_application_instances({ name: name, application_instances: application_instances, request_id: request_id, allow_missing: allow_missing }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.update_application_instances(::Google::Cloud::VisionAI::V1::UpdateApplicationInstancesRequest.new(name: name, application_instances: application_instances, request_id: request_id, allow_missing: allow_missing), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, update_application_instances_client_stub.call_count - end - end - end - - def test_list_drafts - # Create test objects. - client_result = ::Google::Cloud::VisionAI::V1::ListDraftsResponse.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_drafts_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::VisionAI::V1::AppPlatform::Rest::ServiceStub.stub :transcode_list_drafts_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_drafts_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::AppPlatform::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_drafts({ 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_drafts 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_drafts ::Google::Cloud::VisionAI::V1::ListDraftsRequest.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_drafts({ 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_drafts(::Google::Cloud::VisionAI::V1::ListDraftsRequest.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_drafts_client_stub.call_count - end - end - end - - def test_get_draft - # Create test objects. - client_result = ::Google::Cloud::VisionAI::V1::Draft.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_draft_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::VisionAI::V1::AppPlatform::Rest::ServiceStub.stub :transcode_get_draft_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_draft_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::AppPlatform::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_draft({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_draft name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_draft ::Google::Cloud::VisionAI::V1::GetDraftRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_draft({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_draft(::Google::Cloud::VisionAI::V1::GetDraftRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_draft_client_stub.call_count - end - end - end - - def test_create_draft - # 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" - draft_id = "hello world" - draft = {} - request_id = "hello world" - - create_draft_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::VisionAI::V1::AppPlatform::Rest::ServiceStub.stub :transcode_create_draft_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_draft_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::AppPlatform::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_draft({ parent: parent, draft_id: draft_id, draft: draft, request_id: request_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_draft parent: parent, draft_id: draft_id, draft: draft, request_id: request_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_draft ::Google::Cloud::VisionAI::V1::CreateDraftRequest.new(parent: parent, draft_id: draft_id, draft: draft, request_id: request_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_draft({ parent: parent, draft_id: draft_id, draft: draft, request_id: request_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_draft(::Google::Cloud::VisionAI::V1::CreateDraftRequest.new(parent: parent, draft_id: draft_id, draft: draft, request_id: request_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_draft_client_stub.call_count - end - end - end - - def test_update_draft - # 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. - update_mask = {} - draft = {} - request_id = "hello world" - allow_missing = true - - update_draft_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::VisionAI::V1::AppPlatform::Rest::ServiceStub.stub :transcode_update_draft_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_draft_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::AppPlatform::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.update_draft({ update_mask: update_mask, draft: draft, request_id: request_id, allow_missing: allow_missing }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.update_draft update_mask: update_mask, draft: draft, request_id: request_id, allow_missing: allow_missing do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.update_draft ::Google::Cloud::VisionAI::V1::UpdateDraftRequest.new(update_mask: update_mask, draft: draft, request_id: request_id, allow_missing: allow_missing) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.update_draft({ update_mask: update_mask, draft: draft, request_id: request_id, allow_missing: allow_missing }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.update_draft(::Google::Cloud::VisionAI::V1::UpdateDraftRequest.new(update_mask: update_mask, draft: draft, request_id: request_id, allow_missing: allow_missing), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, update_draft_client_stub.call_count - end - end - end - - def test_delete_draft - # 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" - request_id = "hello world" - - delete_draft_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::VisionAI::V1::AppPlatform::Rest::ServiceStub.stub :transcode_delete_draft_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_draft_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::AppPlatform::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.delete_draft({ name: name, request_id: request_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.delete_draft name: name, request_id: request_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.delete_draft ::Google::Cloud::VisionAI::V1::DeleteDraftRequest.new(name: name, request_id: request_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.delete_draft({ name: name, request_id: request_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.delete_draft(::Google::Cloud::VisionAI::V1::DeleteDraftRequest.new(name: name, request_id: request_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, delete_draft_client_stub.call_count - end - end - end - - def test_list_processors - # Create test objects. - client_result = ::Google::Cloud::VisionAI::V1::ListProcessorsResponse.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_processors_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::VisionAI::V1::AppPlatform::Rest::ServiceStub.stub :transcode_list_processors_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_processors_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::AppPlatform::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_processors({ 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_processors 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_processors ::Google::Cloud::VisionAI::V1::ListProcessorsRequest.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_processors({ 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_processors(::Google::Cloud::VisionAI::V1::ListProcessorsRequest.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_processors_client_stub.call_count - end - end - end - - def test_list_prebuilt_processors - # Create test objects. - client_result = ::Google::Cloud::VisionAI::V1::ListPrebuiltProcessorsResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - - list_prebuilt_processors_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::VisionAI::V1::AppPlatform::Rest::ServiceStub.stub :transcode_list_prebuilt_processors_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_prebuilt_processors_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::AppPlatform::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_prebuilt_processors({ parent: parent }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.list_prebuilt_processors parent: parent do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.list_prebuilt_processors ::Google::Cloud::VisionAI::V1::ListPrebuiltProcessorsRequest.new(parent: parent) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.list_prebuilt_processors({ parent: parent }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.list_prebuilt_processors(::Google::Cloud::VisionAI::V1::ListPrebuiltProcessorsRequest.new(parent: parent), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, list_prebuilt_processors_client_stub.call_count - end - end - end - - def test_get_processor - # Create test objects. - client_result = ::Google::Cloud::VisionAI::V1::Processor.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_processor_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::VisionAI::V1::AppPlatform::Rest::ServiceStub.stub :transcode_get_processor_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_processor_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::AppPlatform::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_processor({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_processor name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_processor ::Google::Cloud::VisionAI::V1::GetProcessorRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_processor({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_processor(::Google::Cloud::VisionAI::V1::GetProcessorRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_processor_client_stub.call_count - end - end - end - - def test_create_processor - # 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" - processor_id = "hello world" - processor = {} - request_id = "hello world" - - create_processor_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::VisionAI::V1::AppPlatform::Rest::ServiceStub.stub :transcode_create_processor_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_processor_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::AppPlatform::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_processor({ parent: parent, processor_id: processor_id, processor: processor, request_id: request_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_processor parent: parent, processor_id: processor_id, processor: processor, request_id: request_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_processor ::Google::Cloud::VisionAI::V1::CreateProcessorRequest.new(parent: parent, processor_id: processor_id, processor: processor, request_id: request_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_processor({ parent: parent, processor_id: processor_id, processor: processor, request_id: request_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_processor(::Google::Cloud::VisionAI::V1::CreateProcessorRequest.new(parent: parent, processor_id: processor_id, processor: processor, request_id: request_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_processor_client_stub.call_count - end - end - end - - def test_update_processor - # 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. - update_mask = {} - processor = {} - request_id = "hello world" - - update_processor_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::VisionAI::V1::AppPlatform::Rest::ServiceStub.stub :transcode_update_processor_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_processor_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::AppPlatform::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.update_processor({ update_mask: update_mask, processor: processor, request_id: request_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.update_processor update_mask: update_mask, processor: processor, request_id: request_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.update_processor ::Google::Cloud::VisionAI::V1::UpdateProcessorRequest.new(update_mask: update_mask, processor: processor, request_id: request_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.update_processor({ update_mask: update_mask, processor: processor, request_id: request_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.update_processor(::Google::Cloud::VisionAI::V1::UpdateProcessorRequest.new(update_mask: update_mask, processor: processor, request_id: request_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, update_processor_client_stub.call_count - end - end - end - - def test_delete_processor - # 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" - request_id = "hello world" - - delete_processor_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::VisionAI::V1::AppPlatform::Rest::ServiceStub.stub :transcode_delete_processor_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_processor_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::AppPlatform::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.delete_processor({ name: name, request_id: request_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.delete_processor name: name, request_id: request_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.delete_processor ::Google::Cloud::VisionAI::V1::DeleteProcessorRequest.new(name: name, request_id: request_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.delete_processor({ name: name, request_id: request_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.delete_processor(::Google::Cloud::VisionAI::V1::DeleteProcessorRequest.new(name: name, request_id: request_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, delete_processor_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::VisionAI::V1::AppPlatform::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::VisionAI::V1::AppPlatform::Rest::Client::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/test/google/cloud/vision_ai/v1/app_platform_test.rb b/owl-bot-staging/google-cloud-vision_ai-v1/test/google/cloud/vision_ai/v1/app_platform_test.rb deleted file mode 100644 index b99b3f3a85ab..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/test/google/cloud/vision_ai/v1/app_platform_test.rb +++ /dev/null @@ -1,1839 +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/visionai/v1/platform_pb" -require "google/cloud/vision_ai/v1/app_platform" - -class ::Google::Cloud::VisionAI::V1::AppPlatform::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_applications - # Create GRPC objects. - grpc_response = ::Google::Cloud::VisionAI::V1::ListApplicationsResponse.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_applications_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_applications, name - assert_kind_of ::Google::Cloud::VisionAI::V1::ListApplicationsRequest, 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_applications_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::AppPlatform::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_applications({ 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_applications 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_applications ::Google::Cloud::VisionAI::V1::ListApplicationsRequest.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_applications({ 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_applications(::Google::Cloud::VisionAI::V1::ListApplicationsRequest.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_applications_client_stub.call_rpc_count - end - end - - def test_get_application - # Create GRPC objects. - grpc_response = ::Google::Cloud::VisionAI::V1::Application.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_application_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_application, name - assert_kind_of ::Google::Cloud::VisionAI::V1::GetApplicationRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_application_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::AppPlatform::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_application({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_application name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_application ::Google::Cloud::VisionAI::V1::GetApplicationRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_application({ 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_application(::Google::Cloud::VisionAI::V1::GetApplicationRequest.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_application_client_stub.call_rpc_count - end - end - - def test_create_application - # 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" - application_id = "hello world" - application = {} - request_id = "hello world" - - create_application_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_application, name - assert_kind_of ::Google::Cloud::VisionAI::V1::CreateApplicationRequest, request - assert_equal "hello world", request["parent"] - assert_equal "hello world", request["application_id"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::VisionAI::V1::Application), request["application"] - assert_equal "hello world", request["request_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_application_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::AppPlatform::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_application({ parent: parent, application_id: application_id, application: application, request_id: request_id }) 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_application parent: parent, application_id: application_id, application: application, request_id: request_id 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_application ::Google::Cloud::VisionAI::V1::CreateApplicationRequest.new(parent: parent, application_id: application_id, application: application, request_id: request_id) 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_application({ parent: parent, application_id: application_id, application: application, request_id: request_id }, 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_application(::Google::Cloud::VisionAI::V1::CreateApplicationRequest.new(parent: parent, application_id: application_id, application: application, request_id: request_id), 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_application_client_stub.call_rpc_count - end - end - - def test_update_application - # 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. - update_mask = {} - application = {} - request_id = "hello world" - - update_application_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_application, name - assert_kind_of ::Google::Cloud::VisionAI::V1::UpdateApplicationRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::VisionAI::V1::Application), request["application"] - assert_equal "hello world", request["request_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_application_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::AppPlatform::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_application({ update_mask: update_mask, application: application, request_id: request_id }) 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.update_application update_mask: update_mask, application: application, request_id: request_id 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.update_application ::Google::Cloud::VisionAI::V1::UpdateApplicationRequest.new(update_mask: update_mask, application: application, request_id: request_id) 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.update_application({ update_mask: update_mask, application: application, request_id: request_id }, 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.update_application(::Google::Cloud::VisionAI::V1::UpdateApplicationRequest.new(update_mask: update_mask, application: application, request_id: request_id), 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, update_application_client_stub.call_rpc_count - end - end - - def test_delete_application - # 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" - request_id = "hello world" - force = true - - delete_application_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_application, name - assert_kind_of ::Google::Cloud::VisionAI::V1::DeleteApplicationRequest, request - assert_equal "hello world", request["name"] - assert_equal "hello world", request["request_id"] - assert_equal true, request["force"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_application_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::AppPlatform::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_application({ name: name, request_id: request_id, force: force }) 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_application name: name, request_id: request_id, force: force 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_application ::Google::Cloud::VisionAI::V1::DeleteApplicationRequest.new(name: name, request_id: request_id, force: force) 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_application({ name: name, request_id: request_id, force: force }, 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_application(::Google::Cloud::VisionAI::V1::DeleteApplicationRequest.new(name: name, request_id: request_id, force: force), 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_application_client_stub.call_rpc_count - end - end - - def test_deploy_application - # 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" - validate_only = true - request_id = "hello world" - enable_monitoring = true - - deploy_application_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :deploy_application, name - assert_kind_of ::Google::Cloud::VisionAI::V1::DeployApplicationRequest, request - assert_equal "hello world", request["name"] - assert_equal true, request["validate_only"] - assert_equal "hello world", request["request_id"] - assert_equal true, request["enable_monitoring"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, deploy_application_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::AppPlatform::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.deploy_application({ name: name, validate_only: validate_only, request_id: request_id, enable_monitoring: enable_monitoring }) 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.deploy_application name: name, validate_only: validate_only, request_id: request_id, enable_monitoring: enable_monitoring 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.deploy_application ::Google::Cloud::VisionAI::V1::DeployApplicationRequest.new(name: name, validate_only: validate_only, request_id: request_id, enable_monitoring: enable_monitoring) 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.deploy_application({ name: name, validate_only: validate_only, request_id: request_id, enable_monitoring: enable_monitoring }, 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.deploy_application(::Google::Cloud::VisionAI::V1::DeployApplicationRequest.new(name: name, validate_only: validate_only, request_id: request_id, enable_monitoring: enable_monitoring), 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, deploy_application_client_stub.call_rpc_count - end - end - - def test_undeploy_application - # 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" - request_id = "hello world" - - undeploy_application_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :undeploy_application, name - assert_kind_of ::Google::Cloud::VisionAI::V1::UndeployApplicationRequest, request - assert_equal "hello world", request["name"] - assert_equal "hello world", request["request_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, undeploy_application_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::AppPlatform::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.undeploy_application({ name: name, request_id: request_id }) 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.undeploy_application name: name, request_id: request_id 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.undeploy_application ::Google::Cloud::VisionAI::V1::UndeployApplicationRequest.new(name: name, request_id: request_id) 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.undeploy_application({ name: name, request_id: request_id }, 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.undeploy_application(::Google::Cloud::VisionAI::V1::UndeployApplicationRequest.new(name: name, request_id: request_id), 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, undeploy_application_client_stub.call_rpc_count - end - end - - def test_add_application_stream_input - # 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" - application_stream_inputs = [{}] - request_id = "hello world" - - add_application_stream_input_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :add_application_stream_input, name - assert_kind_of ::Google::Cloud::VisionAI::V1::AddApplicationStreamInputRequest, request - assert_equal "hello world", request["name"] - assert_kind_of ::Google::Cloud::VisionAI::V1::ApplicationStreamInput, request["application_stream_inputs"].first - assert_equal "hello world", request["request_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, add_application_stream_input_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::AppPlatform::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.add_application_stream_input({ name: name, application_stream_inputs: application_stream_inputs, request_id: request_id }) 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.add_application_stream_input name: name, application_stream_inputs: application_stream_inputs, request_id: request_id 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.add_application_stream_input ::Google::Cloud::VisionAI::V1::AddApplicationStreamInputRequest.new(name: name, application_stream_inputs: application_stream_inputs, request_id: request_id) 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.add_application_stream_input({ name: name, application_stream_inputs: application_stream_inputs, request_id: request_id }, 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.add_application_stream_input(::Google::Cloud::VisionAI::V1::AddApplicationStreamInputRequest.new(name: name, application_stream_inputs: application_stream_inputs, request_id: request_id), 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, add_application_stream_input_client_stub.call_rpc_count - end - end - - def test_remove_application_stream_input - # 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" - target_stream_inputs = [{}] - request_id = "hello world" - - remove_application_stream_input_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :remove_application_stream_input, name - assert_kind_of ::Google::Cloud::VisionAI::V1::RemoveApplicationStreamInputRequest, request - assert_equal "hello world", request["name"] - assert_kind_of ::Google::Cloud::VisionAI::V1::RemoveApplicationStreamInputRequest::TargetStreamInput, request["target_stream_inputs"].first - assert_equal "hello world", request["request_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, remove_application_stream_input_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::AppPlatform::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.remove_application_stream_input({ name: name, target_stream_inputs: target_stream_inputs, request_id: request_id }) 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.remove_application_stream_input name: name, target_stream_inputs: target_stream_inputs, request_id: request_id 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.remove_application_stream_input ::Google::Cloud::VisionAI::V1::RemoveApplicationStreamInputRequest.new(name: name, target_stream_inputs: target_stream_inputs, request_id: request_id) 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.remove_application_stream_input({ name: name, target_stream_inputs: target_stream_inputs, request_id: request_id }, 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.remove_application_stream_input(::Google::Cloud::VisionAI::V1::RemoveApplicationStreamInputRequest.new(name: name, target_stream_inputs: target_stream_inputs, request_id: request_id), 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, remove_application_stream_input_client_stub.call_rpc_count - end - end - - def test_update_application_stream_input - # 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" - application_stream_inputs = [{}] - request_id = "hello world" - allow_missing = true - - update_application_stream_input_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_application_stream_input, name - assert_kind_of ::Google::Cloud::VisionAI::V1::UpdateApplicationStreamInputRequest, request - assert_equal "hello world", request["name"] - assert_kind_of ::Google::Cloud::VisionAI::V1::ApplicationStreamInput, request["application_stream_inputs"].first - assert_equal "hello world", request["request_id"] - assert_equal true, request["allow_missing"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_application_stream_input_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::AppPlatform::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_application_stream_input({ name: name, application_stream_inputs: application_stream_inputs, request_id: request_id, allow_missing: allow_missing }) 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.update_application_stream_input name: name, application_stream_inputs: application_stream_inputs, request_id: request_id, allow_missing: allow_missing 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.update_application_stream_input ::Google::Cloud::VisionAI::V1::UpdateApplicationStreamInputRequest.new(name: name, application_stream_inputs: application_stream_inputs, request_id: request_id, allow_missing: allow_missing) 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.update_application_stream_input({ name: name, application_stream_inputs: application_stream_inputs, request_id: request_id, allow_missing: allow_missing }, 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.update_application_stream_input(::Google::Cloud::VisionAI::V1::UpdateApplicationStreamInputRequest.new(name: name, application_stream_inputs: application_stream_inputs, request_id: request_id, allow_missing: allow_missing), 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, update_application_stream_input_client_stub.call_rpc_count - end - end - - def test_list_instances - # Create GRPC objects. - grpc_response = ::Google::Cloud::VisionAI::V1::ListInstancesResponse.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_instances_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_instances, name - assert_kind_of ::Google::Cloud::VisionAI::V1::ListInstancesRequest, 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_instances_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::AppPlatform::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_instances({ 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_instances 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_instances ::Google::Cloud::VisionAI::V1::ListInstancesRequest.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_instances({ 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_instances(::Google::Cloud::VisionAI::V1::ListInstancesRequest.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_instances_client_stub.call_rpc_count - end - end - - def test_get_instance - # Create GRPC objects. - grpc_response = ::Google::Cloud::VisionAI::V1::Instance.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_instance_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_instance, name - assert_kind_of ::Google::Cloud::VisionAI::V1::GetInstanceRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_instance_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::AppPlatform::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_instance({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_instance name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_instance ::Google::Cloud::VisionAI::V1::GetInstanceRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_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_instance(::Google::Cloud::VisionAI::V1::GetInstanceRequest.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_instance_client_stub.call_rpc_count - end - end - - def test_create_application_instances - # 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" - application_instances = [{}] - request_id = "hello world" - - create_application_instances_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_application_instances, name - assert_kind_of ::Google::Cloud::VisionAI::V1::CreateApplicationInstancesRequest, request - assert_equal "hello world", request["name"] - assert_kind_of ::Google::Cloud::VisionAI::V1::ApplicationInstance, request["application_instances"].first - assert_equal "hello world", request["request_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_application_instances_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::AppPlatform::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_application_instances({ name: name, application_instances: application_instances, request_id: request_id }) 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_application_instances name: name, application_instances: application_instances, request_id: request_id 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_application_instances ::Google::Cloud::VisionAI::V1::CreateApplicationInstancesRequest.new(name: name, application_instances: application_instances, request_id: request_id) 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_application_instances({ name: name, application_instances: application_instances, request_id: request_id }, 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_application_instances(::Google::Cloud::VisionAI::V1::CreateApplicationInstancesRequest.new(name: name, application_instances: application_instances, request_id: request_id), 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_application_instances_client_stub.call_rpc_count - end - end - - def test_delete_application_instances - # 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" - instance_ids = ["hello world"] - request_id = "hello world" - - delete_application_instances_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_application_instances, name - assert_kind_of ::Google::Cloud::VisionAI::V1::DeleteApplicationInstancesRequest, request - assert_equal "hello world", request["name"] - assert_equal ["hello world"], request["instance_ids"] - assert_equal "hello world", request["request_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_application_instances_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::AppPlatform::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_application_instances({ name: name, instance_ids: instance_ids, request_id: request_id }) 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_application_instances name: name, instance_ids: instance_ids, request_id: request_id 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_application_instances ::Google::Cloud::VisionAI::V1::DeleteApplicationInstancesRequest.new(name: name, instance_ids: instance_ids, request_id: request_id) 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_application_instances({ name: name, instance_ids: instance_ids, request_id: request_id }, 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_application_instances(::Google::Cloud::VisionAI::V1::DeleteApplicationInstancesRequest.new(name: name, instance_ids: instance_ids, request_id: request_id), 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_application_instances_client_stub.call_rpc_count - end - end - - def test_update_application_instances - # 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" - application_instances = [{}] - request_id = "hello world" - allow_missing = true - - update_application_instances_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_application_instances, name - assert_kind_of ::Google::Cloud::VisionAI::V1::UpdateApplicationInstancesRequest, request - assert_equal "hello world", request["name"] - assert_kind_of ::Google::Cloud::VisionAI::V1::UpdateApplicationInstancesRequest::UpdateApplicationInstance, request["application_instances"].first - assert_equal "hello world", request["request_id"] - assert_equal true, request["allow_missing"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_application_instances_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::AppPlatform::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_application_instances({ name: name, application_instances: application_instances, request_id: request_id, allow_missing: allow_missing }) 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.update_application_instances name: name, application_instances: application_instances, request_id: request_id, allow_missing: allow_missing 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.update_application_instances ::Google::Cloud::VisionAI::V1::UpdateApplicationInstancesRequest.new(name: name, application_instances: application_instances, request_id: request_id, allow_missing: allow_missing) 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.update_application_instances({ name: name, application_instances: application_instances, request_id: request_id, allow_missing: allow_missing }, 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.update_application_instances(::Google::Cloud::VisionAI::V1::UpdateApplicationInstancesRequest.new(name: name, application_instances: application_instances, request_id: request_id, allow_missing: allow_missing), 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, update_application_instances_client_stub.call_rpc_count - end - end - - def test_list_drafts - # Create GRPC objects. - grpc_response = ::Google::Cloud::VisionAI::V1::ListDraftsResponse.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_drafts_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_drafts, name - assert_kind_of ::Google::Cloud::VisionAI::V1::ListDraftsRequest, 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_drafts_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::AppPlatform::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_drafts({ 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_drafts 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_drafts ::Google::Cloud::VisionAI::V1::ListDraftsRequest.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_drafts({ 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_drafts(::Google::Cloud::VisionAI::V1::ListDraftsRequest.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_drafts_client_stub.call_rpc_count - end - end - - def test_get_draft - # Create GRPC objects. - grpc_response = ::Google::Cloud::VisionAI::V1::Draft.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_draft_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_draft, name - assert_kind_of ::Google::Cloud::VisionAI::V1::GetDraftRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_draft_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::AppPlatform::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_draft({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_draft name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_draft ::Google::Cloud::VisionAI::V1::GetDraftRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_draft({ 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_draft(::Google::Cloud::VisionAI::V1::GetDraftRequest.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_draft_client_stub.call_rpc_count - end - end - - def test_create_draft - # 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" - draft_id = "hello world" - draft = {} - request_id = "hello world" - - create_draft_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_draft, name - assert_kind_of ::Google::Cloud::VisionAI::V1::CreateDraftRequest, request - assert_equal "hello world", request["parent"] - assert_equal "hello world", request["draft_id"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::VisionAI::V1::Draft), request["draft"] - assert_equal "hello world", request["request_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_draft_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::AppPlatform::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_draft({ parent: parent, draft_id: draft_id, draft: draft, request_id: request_id }) 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_draft parent: parent, draft_id: draft_id, draft: draft, request_id: request_id 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_draft ::Google::Cloud::VisionAI::V1::CreateDraftRequest.new(parent: parent, draft_id: draft_id, draft: draft, request_id: request_id) 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_draft({ parent: parent, draft_id: draft_id, draft: draft, request_id: request_id }, 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_draft(::Google::Cloud::VisionAI::V1::CreateDraftRequest.new(parent: parent, draft_id: draft_id, draft: draft, request_id: request_id), 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_draft_client_stub.call_rpc_count - end - end - - def test_update_draft - # 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. - update_mask = {} - draft = {} - request_id = "hello world" - allow_missing = true - - update_draft_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_draft, name - assert_kind_of ::Google::Cloud::VisionAI::V1::UpdateDraftRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::VisionAI::V1::Draft), request["draft"] - assert_equal "hello world", request["request_id"] - assert_equal true, request["allow_missing"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_draft_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::AppPlatform::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_draft({ update_mask: update_mask, draft: draft, request_id: request_id, allow_missing: allow_missing }) 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.update_draft update_mask: update_mask, draft: draft, request_id: request_id, allow_missing: allow_missing 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.update_draft ::Google::Cloud::VisionAI::V1::UpdateDraftRequest.new(update_mask: update_mask, draft: draft, request_id: request_id, allow_missing: allow_missing) 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.update_draft({ update_mask: update_mask, draft: draft, request_id: request_id, allow_missing: allow_missing }, 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.update_draft(::Google::Cloud::VisionAI::V1::UpdateDraftRequest.new(update_mask: update_mask, draft: draft, request_id: request_id, allow_missing: allow_missing), 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, update_draft_client_stub.call_rpc_count - end - end - - def test_delete_draft - # 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" - request_id = "hello world" - - delete_draft_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_draft, name - assert_kind_of ::Google::Cloud::VisionAI::V1::DeleteDraftRequest, request - assert_equal "hello world", request["name"] - assert_equal "hello world", request["request_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_draft_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::AppPlatform::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_draft({ name: name, request_id: request_id }) 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_draft name: name, request_id: request_id 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_draft ::Google::Cloud::VisionAI::V1::DeleteDraftRequest.new(name: name, request_id: request_id) 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_draft({ name: name, request_id: request_id }, 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_draft(::Google::Cloud::VisionAI::V1::DeleteDraftRequest.new(name: name, request_id: request_id), 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_draft_client_stub.call_rpc_count - end - end - - def test_list_processors - # Create GRPC objects. - grpc_response = ::Google::Cloud::VisionAI::V1::ListProcessorsResponse.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_processors_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_processors, name - assert_kind_of ::Google::Cloud::VisionAI::V1::ListProcessorsRequest, 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_processors_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::AppPlatform::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_processors({ 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_processors 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_processors ::Google::Cloud::VisionAI::V1::ListProcessorsRequest.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_processors({ 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_processors(::Google::Cloud::VisionAI::V1::ListProcessorsRequest.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_processors_client_stub.call_rpc_count - end - end - - def test_list_prebuilt_processors - # Create GRPC objects. - grpc_response = ::Google::Cloud::VisionAI::V1::ListPrebuiltProcessorsResponse.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" - - list_prebuilt_processors_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_prebuilt_processors, name - assert_kind_of ::Google::Cloud::VisionAI::V1::ListPrebuiltProcessorsRequest, request - assert_equal "hello world", request["parent"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_prebuilt_processors_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::AppPlatform::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_prebuilt_processors({ parent: parent }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.list_prebuilt_processors parent: parent do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.list_prebuilt_processors ::Google::Cloud::VisionAI::V1::ListPrebuiltProcessorsRequest.new(parent: parent) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.list_prebuilt_processors({ parent: parent }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.list_prebuilt_processors(::Google::Cloud::VisionAI::V1::ListPrebuiltProcessorsRequest.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, list_prebuilt_processors_client_stub.call_rpc_count - end - end - - def test_get_processor - # Create GRPC objects. - grpc_response = ::Google::Cloud::VisionAI::V1::Processor.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_processor_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_processor, name - assert_kind_of ::Google::Cloud::VisionAI::V1::GetProcessorRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_processor_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::AppPlatform::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_processor({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_processor name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_processor ::Google::Cloud::VisionAI::V1::GetProcessorRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_processor({ 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_processor(::Google::Cloud::VisionAI::V1::GetProcessorRequest.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_processor_client_stub.call_rpc_count - end - end - - def test_create_processor - # 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" - processor_id = "hello world" - processor = {} - request_id = "hello world" - - create_processor_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_processor, name - assert_kind_of ::Google::Cloud::VisionAI::V1::CreateProcessorRequest, request - assert_equal "hello world", request["parent"] - assert_equal "hello world", request["processor_id"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::VisionAI::V1::Processor), request["processor"] - assert_equal "hello world", request["request_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_processor_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::AppPlatform::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_processor({ parent: parent, processor_id: processor_id, processor: processor, request_id: request_id }) 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_processor parent: parent, processor_id: processor_id, processor: processor, request_id: request_id 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_processor ::Google::Cloud::VisionAI::V1::CreateProcessorRequest.new(parent: parent, processor_id: processor_id, processor: processor, request_id: request_id) 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_processor({ parent: parent, processor_id: processor_id, processor: processor, request_id: request_id }, 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_processor(::Google::Cloud::VisionAI::V1::CreateProcessorRequest.new(parent: parent, processor_id: processor_id, processor: processor, request_id: request_id), 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_processor_client_stub.call_rpc_count - end - end - - def test_update_processor - # 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. - update_mask = {} - processor = {} - request_id = "hello world" - - update_processor_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_processor, name - assert_kind_of ::Google::Cloud::VisionAI::V1::UpdateProcessorRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::VisionAI::V1::Processor), request["processor"] - assert_equal "hello world", request["request_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_processor_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::AppPlatform::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_processor({ update_mask: update_mask, processor: processor, request_id: request_id }) 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.update_processor update_mask: update_mask, processor: processor, request_id: request_id 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.update_processor ::Google::Cloud::VisionAI::V1::UpdateProcessorRequest.new(update_mask: update_mask, processor: processor, request_id: request_id) 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.update_processor({ update_mask: update_mask, processor: processor, request_id: request_id }, 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.update_processor(::Google::Cloud::VisionAI::V1::UpdateProcessorRequest.new(update_mask: update_mask, processor: processor, request_id: request_id), 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, update_processor_client_stub.call_rpc_count - end - end - - def test_delete_processor - # 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" - request_id = "hello world" - - delete_processor_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_processor, name - assert_kind_of ::Google::Cloud::VisionAI::V1::DeleteProcessorRequest, request - assert_equal "hello world", request["name"] - assert_equal "hello world", request["request_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_processor_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::AppPlatform::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_processor({ name: name, request_id: request_id }) 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_processor name: name, request_id: request_id 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_processor ::Google::Cloud::VisionAI::V1::DeleteProcessorRequest.new(name: name, request_id: request_id) 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_processor({ name: name, request_id: request_id }, 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_processor(::Google::Cloud::VisionAI::V1::DeleteProcessorRequest.new(name: name, request_id: request_id), 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_processor_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::VisionAI::V1::AppPlatform::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::VisionAI::V1::AppPlatform::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::VisionAI::V1::AppPlatform::Client.new do |config| - config.credentials = creds - end - assert_kind_of ::Google::Cloud::VisionAI::V1::AppPlatform::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::VisionAI::V1::AppPlatform::Client.new do |config| - config.credentials = grpc_channel - end - end - - assert_kind_of ::Google::Cloud::VisionAI::V1::AppPlatform::Operations, client.operations_client - end -end diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/test/google/cloud/vision_ai/v1/health_check_service_paths_test.rb b/owl-bot-staging/google-cloud-vision_ai-v1/test/google/cloud/vision_ai/v1/health_check_service_paths_test.rb deleted file mode 100644 index aa5292b8c2a7..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/test/google/cloud/vision_ai/v1/health_check_service_paths_test.rb +++ /dev/null @@ -1,55 +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/vision_ai/v1/health_check_service" - -class ::Google::Cloud::VisionAI::V1::HealthCheckService::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_cluster_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::VisionAI::V1::HealthCheckService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.cluster_path project: "value0", location: "value1", cluster: "value2" - assert_equal "projects/value0/locations/value1/clusters/value2", path - end - end -end diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/test/google/cloud/vision_ai/v1/health_check_service_rest_test.rb b/owl-bot-staging/google-cloud-vision_ai-v1/test/google/cloud/vision_ai/v1/health_check_service_rest_test.rb deleted file mode 100644 index c65284b162ca..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/test/google/cloud/vision_ai/v1/health_check_service_rest_test.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! - -require "helper" -require "gapic/rest" -require "google/cloud/visionai/v1/health_service_pb" -require "google/cloud/vision_ai/v1/health_check_service/rest" - - -class ::Google::Cloud::VisionAI::V1::HealthCheckService::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_health_check - # Create test objects. - client_result = ::Google::Cloud::VisionAI::V1::HealthCheckResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - cluster = "hello world" - - health_check_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::VisionAI::V1::HealthCheckService::Rest::ServiceStub.stub :transcode_health_check_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, health_check_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::HealthCheckService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.health_check({ cluster: cluster }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.health_check cluster: cluster do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.health_check ::Google::Cloud::VisionAI::V1::HealthCheckRequest.new(cluster: cluster) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.health_check({ cluster: cluster }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.health_check(::Google::Cloud::VisionAI::V1::HealthCheckRequest.new(cluster: cluster), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, health_check_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::VisionAI::V1::HealthCheckService::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::VisionAI::V1::HealthCheckService::Rest::Client::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/test/google/cloud/vision_ai/v1/health_check_service_test.rb b/owl-bot-staging/google-cloud-vision_ai-v1/test/google/cloud/vision_ai/v1/health_check_service_test.rb deleted file mode 100644 index 23fa3b5e6890..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/test/google/cloud/vision_ai/v1/health_check_service_test.rb +++ /dev/null @@ -1,162 +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/visionai/v1/health_service_pb" -require "google/cloud/vision_ai/v1/health_check_service" - -class ::Google::Cloud::VisionAI::V1::HealthCheckService::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_health_check - # Create GRPC objects. - grpc_response = ::Google::Cloud::VisionAI::V1::HealthCheckResponse.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. - cluster = "hello world" - - health_check_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :health_check, name - assert_kind_of ::Google::Cloud::VisionAI::V1::HealthCheckRequest, request - assert_equal "hello world", request["cluster"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, health_check_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::HealthCheckService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.health_check({ cluster: cluster }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.health_check cluster: cluster do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.health_check ::Google::Cloud::VisionAI::V1::HealthCheckRequest.new(cluster: cluster) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.health_check({ cluster: cluster }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.health_check(::Google::Cloud::VisionAI::V1::HealthCheckRequest.new(cluster: cluster), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, health_check_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::VisionAI::V1::HealthCheckService::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::VisionAI::V1::HealthCheckService::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::VisionAI::V1::HealthCheckService::Client.new do |config| - config.credentials = creds - end - assert_kind_of ::Google::Cloud::VisionAI::V1::HealthCheckService::Client, client - assert_equal creds, client.configure.credentials - end - end -end diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/test/google/cloud/vision_ai/v1/live_video_analytics_operations_test.rb b/owl-bot-staging/google-cloud-vision_ai-v1/test/google/cloud/vision_ai/v1/live_video_analytics_operations_test.rb deleted file mode 100644 index ff6b3c5d53f4..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/test/google/cloud/vision_ai/v1/live_video_analytics_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/visionai/v1/lva_service_pb" -require "google/cloud/visionai/v1/lva_service_services_pb" -require "google/cloud/vision_ai/v1/live_video_analytics" - -class ::Google::Cloud::VisionAI::V1::LiveVideoAnalytics::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::VisionAI::V1::LiveVideoAnalytics::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::VisionAI::V1::LiveVideoAnalytics::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::VisionAI::V1::LiveVideoAnalytics::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::VisionAI::V1::LiveVideoAnalytics::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::VisionAI::V1::LiveVideoAnalytics::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::VisionAI::V1::LiveVideoAnalytics::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::VisionAI::V1::LiveVideoAnalytics::Operations::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/test/google/cloud/vision_ai/v1/live_video_analytics_paths_test.rb b/owl-bot-staging/google-cloud-vision_ai-v1/test/google/cloud/vision_ai/v1/live_video_analytics_paths_test.rb deleted file mode 100644 index 42cb1104561f..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/test/google/cloud/vision_ai/v1/live_video_analytics_paths_test.rb +++ /dev/null @@ -1,103 +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/vision_ai/v1/live_video_analytics" - -class ::Google::Cloud::VisionAI::V1::LiveVideoAnalytics::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_analysis_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.analysis_path project: "value0", location: "value1", cluster: "value2", analysis: "value3" - assert_equal "projects/value0/locations/value1/clusters/value2/analyses/value3", path - end - end - - def test_cluster_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.cluster_path project: "value0", location: "value1", cluster: "value2" - assert_equal "projects/value0/locations/value1/clusters/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::VisionAI::V1::LiveVideoAnalytics::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_operator_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.operator_path project: "value0", location: "value1", operator: "value2" - assert_equal "projects/value0/locations/value1/operators/value2", path - end - end - - def test_process_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.process_path project: "value0", location: "value1", cluster: "value2", process: "value3" - assert_equal "projects/value0/locations/value1/clusters/value2/processes/value3", path - end - end -end diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/test/google/cloud/vision_ai/v1/live_video_analytics_rest_test.rb b/owl-bot-staging/google-cloud-vision_ai-v1/test/google/cloud/vision_ai/v1/live_video_analytics_rest_test.rb deleted file mode 100644 index 28486f672da7..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/test/google/cloud/vision_ai/v1/live_video_analytics_rest_test.rb +++ /dev/null @@ -1,1109 +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/visionai/v1/lva_service_pb" -require "google/cloud/vision_ai/v1/live_video_analytics/rest" - - -class ::Google::Cloud::VisionAI::V1::LiveVideoAnalytics::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_public_operators - # Create test objects. - client_result = ::Google::Cloud::VisionAI::V1::ListPublicOperatorsResponse.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_public_operators_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::VisionAI::V1::LiveVideoAnalytics::Rest::ServiceStub.stub :transcode_list_public_operators_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_public_operators_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_public_operators({ 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_public_operators 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_public_operators ::Google::Cloud::VisionAI::V1::ListPublicOperatorsRequest.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_public_operators({ 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_public_operators(::Google::Cloud::VisionAI::V1::ListPublicOperatorsRequest.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_public_operators_client_stub.call_count - end - end - end - - def test_resolve_operator_info - # Create test objects. - client_result = ::Google::Cloud::VisionAI::V1::ResolveOperatorInfoResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - queries = [{}] - - resolve_operator_info_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::VisionAI::V1::LiveVideoAnalytics::Rest::ServiceStub.stub :transcode_resolve_operator_info_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, resolve_operator_info_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.resolve_operator_info({ parent: parent, queries: queries }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.resolve_operator_info parent: parent, queries: queries do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.resolve_operator_info ::Google::Cloud::VisionAI::V1::ResolveOperatorInfoRequest.new(parent: parent, queries: queries) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.resolve_operator_info({ parent: parent, queries: queries }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.resolve_operator_info(::Google::Cloud::VisionAI::V1::ResolveOperatorInfoRequest.new(parent: parent, queries: queries), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, resolve_operator_info_client_stub.call_count - end - end - end - - def test_list_operators - # Create test objects. - client_result = ::Google::Cloud::VisionAI::V1::ListOperatorsResponse.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_operators_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::VisionAI::V1::LiveVideoAnalytics::Rest::ServiceStub.stub :transcode_list_operators_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_operators_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_operators({ 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_operators 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_operators ::Google::Cloud::VisionAI::V1::ListOperatorsRequest.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_operators({ 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_operators(::Google::Cloud::VisionAI::V1::ListOperatorsRequest.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_operators_client_stub.call_count - end - end - end - - def test_get_operator - # Create test objects. - client_result = ::Google::Cloud::VisionAI::V1::Operator.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_operator_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::VisionAI::V1::LiveVideoAnalytics::Rest::ServiceStub.stub :transcode_get_operator_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_operator_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_operator({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_operator name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_operator ::Google::Cloud::VisionAI::V1::GetOperatorRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_operator({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_operator(::Google::Cloud::VisionAI::V1::GetOperatorRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_operator_client_stub.call_count - end - end - end - - def test_create_operator - # 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" - operator_id = "hello world" - operator = {} - request_id = "hello world" - - create_operator_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::VisionAI::V1::LiveVideoAnalytics::Rest::ServiceStub.stub :transcode_create_operator_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_operator_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_operator({ parent: parent, operator_id: operator_id, operator: operator, request_id: request_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_operator parent: parent, operator_id: operator_id, operator: operator, request_id: request_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_operator ::Google::Cloud::VisionAI::V1::CreateOperatorRequest.new(parent: parent, operator_id: operator_id, operator: operator, request_id: request_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_operator({ parent: parent, operator_id: operator_id, operator: operator, request_id: request_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_operator(::Google::Cloud::VisionAI::V1::CreateOperatorRequest.new(parent: parent, operator_id: operator_id, operator: operator, request_id: request_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_operator_client_stub.call_count - end - end - end - - def test_update_operator - # 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. - update_mask = {} - operator = {} - request_id = "hello world" - - update_operator_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::VisionAI::V1::LiveVideoAnalytics::Rest::ServiceStub.stub :transcode_update_operator_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_operator_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.update_operator({ update_mask: update_mask, operator: operator, request_id: request_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.update_operator update_mask: update_mask, operator: operator, request_id: request_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.update_operator ::Google::Cloud::VisionAI::V1::UpdateOperatorRequest.new(update_mask: update_mask, operator: operator, request_id: request_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.update_operator({ update_mask: update_mask, operator: operator, request_id: request_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.update_operator(::Google::Cloud::VisionAI::V1::UpdateOperatorRequest.new(update_mask: update_mask, operator: operator, request_id: request_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, update_operator_client_stub.call_count - end - end - end - - def test_delete_operator - # 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" - request_id = "hello world" - - delete_operator_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::VisionAI::V1::LiveVideoAnalytics::Rest::ServiceStub.stub :transcode_delete_operator_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_operator_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.delete_operator({ name: name, request_id: request_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.delete_operator name: name, request_id: request_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.delete_operator ::Google::Cloud::VisionAI::V1::DeleteOperatorRequest.new(name: name, request_id: request_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.delete_operator({ name: name, request_id: request_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.delete_operator(::Google::Cloud::VisionAI::V1::DeleteOperatorRequest.new(name: name, request_id: request_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, delete_operator_client_stub.call_count - end - end - end - - def test_list_analyses - # Create test objects. - client_result = ::Google::Cloud::VisionAI::V1::ListAnalysesResponse.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_analyses_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::VisionAI::V1::LiveVideoAnalytics::Rest::ServiceStub.stub :transcode_list_analyses_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_analyses_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_analyses({ 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_analyses 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_analyses ::Google::Cloud::VisionAI::V1::ListAnalysesRequest.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_analyses({ 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_analyses(::Google::Cloud::VisionAI::V1::ListAnalysesRequest.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_analyses_client_stub.call_count - end - end - end - - def test_get_analysis - # Create test objects. - client_result = ::Google::Cloud::VisionAI::V1::Analysis.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_analysis_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::VisionAI::V1::LiveVideoAnalytics::Rest::ServiceStub.stub :transcode_get_analysis_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_analysis_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_analysis({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_analysis name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_analysis ::Google::Cloud::VisionAI::V1::GetAnalysisRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_analysis({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_analysis(::Google::Cloud::VisionAI::V1::GetAnalysisRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_analysis_client_stub.call_count - end - end - end - - def test_create_analysis - # 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" - analysis_id = "hello world" - analysis = {} - request_id = "hello world" - - create_analysis_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::VisionAI::V1::LiveVideoAnalytics::Rest::ServiceStub.stub :transcode_create_analysis_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_analysis_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_analysis({ parent: parent, analysis_id: analysis_id, analysis: analysis, request_id: request_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_analysis parent: parent, analysis_id: analysis_id, analysis: analysis, request_id: request_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_analysis ::Google::Cloud::VisionAI::V1::CreateAnalysisRequest.new(parent: parent, analysis_id: analysis_id, analysis: analysis, request_id: request_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_analysis({ parent: parent, analysis_id: analysis_id, analysis: analysis, request_id: request_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_analysis(::Google::Cloud::VisionAI::V1::CreateAnalysisRequest.new(parent: parent, analysis_id: analysis_id, analysis: analysis, request_id: request_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_analysis_client_stub.call_count - end - end - end - - def test_update_analysis - # 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. - update_mask = {} - analysis = {} - request_id = "hello world" - - update_analysis_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::VisionAI::V1::LiveVideoAnalytics::Rest::ServiceStub.stub :transcode_update_analysis_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_analysis_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.update_analysis({ update_mask: update_mask, analysis: analysis, request_id: request_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.update_analysis update_mask: update_mask, analysis: analysis, request_id: request_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.update_analysis ::Google::Cloud::VisionAI::V1::UpdateAnalysisRequest.new(update_mask: update_mask, analysis: analysis, request_id: request_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.update_analysis({ update_mask: update_mask, analysis: analysis, request_id: request_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.update_analysis(::Google::Cloud::VisionAI::V1::UpdateAnalysisRequest.new(update_mask: update_mask, analysis: analysis, request_id: request_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, update_analysis_client_stub.call_count - end - end - end - - def test_delete_analysis - # 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" - request_id = "hello world" - - delete_analysis_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::VisionAI::V1::LiveVideoAnalytics::Rest::ServiceStub.stub :transcode_delete_analysis_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_analysis_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.delete_analysis({ name: name, request_id: request_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.delete_analysis name: name, request_id: request_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.delete_analysis ::Google::Cloud::VisionAI::V1::DeleteAnalysisRequest.new(name: name, request_id: request_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.delete_analysis({ name: name, request_id: request_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.delete_analysis(::Google::Cloud::VisionAI::V1::DeleteAnalysisRequest.new(name: name, request_id: request_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, delete_analysis_client_stub.call_count - end - end - end - - def test_list_processes - # Create test objects. - client_result = ::Google::Cloud::VisionAI::V1::ListProcessesResponse.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_processes_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::VisionAI::V1::LiveVideoAnalytics::Rest::ServiceStub.stub :transcode_list_processes_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_processes_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_processes({ 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_processes 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_processes ::Google::Cloud::VisionAI::V1::ListProcessesRequest.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_processes({ 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_processes(::Google::Cloud::VisionAI::V1::ListProcessesRequest.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_processes_client_stub.call_count - end - end - end - - def test_get_process - # Create test objects. - client_result = ::Google::Cloud::VisionAI::V1::Process.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_process_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::VisionAI::V1::LiveVideoAnalytics::Rest::ServiceStub.stub :transcode_get_process_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_process_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_process({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_process name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_process ::Google::Cloud::VisionAI::V1::GetProcessRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_process({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_process(::Google::Cloud::VisionAI::V1::GetProcessRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_process_client_stub.call_count - end - end - end - - def test_create_process - # 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" - process_id = "hello world" - process = {} - request_id = "hello world" - - create_process_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::VisionAI::V1::LiveVideoAnalytics::Rest::ServiceStub.stub :transcode_create_process_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_process_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_process({ parent: parent, process_id: process_id, process: process, request_id: request_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_process parent: parent, process_id: process_id, process: process, request_id: request_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_process ::Google::Cloud::VisionAI::V1::CreateProcessRequest.new(parent: parent, process_id: process_id, process: process, request_id: request_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_process({ parent: parent, process_id: process_id, process: process, request_id: request_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_process(::Google::Cloud::VisionAI::V1::CreateProcessRequest.new(parent: parent, process_id: process_id, process: process, request_id: request_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_process_client_stub.call_count - end - end - end - - def test_update_process - # 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. - update_mask = {} - process = {} - request_id = "hello world" - - update_process_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::VisionAI::V1::LiveVideoAnalytics::Rest::ServiceStub.stub :transcode_update_process_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_process_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.update_process({ update_mask: update_mask, process: process, request_id: request_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.update_process update_mask: update_mask, process: process, request_id: request_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.update_process ::Google::Cloud::VisionAI::V1::UpdateProcessRequest.new(update_mask: update_mask, process: process, request_id: request_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.update_process({ update_mask: update_mask, process: process, request_id: request_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.update_process(::Google::Cloud::VisionAI::V1::UpdateProcessRequest.new(update_mask: update_mask, process: process, request_id: request_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, update_process_client_stub.call_count - end - end - end - - def test_delete_process - # 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" - request_id = "hello world" - - delete_process_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::VisionAI::V1::LiveVideoAnalytics::Rest::ServiceStub.stub :transcode_delete_process_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_process_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.delete_process({ name: name, request_id: request_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.delete_process name: name, request_id: request_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.delete_process ::Google::Cloud::VisionAI::V1::DeleteProcessRequest.new(name: name, request_id: request_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.delete_process({ name: name, request_id: request_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.delete_process(::Google::Cloud::VisionAI::V1::DeleteProcessRequest.new(name: name, request_id: request_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, delete_process_client_stub.call_count - end - end - end - - def test_batch_run_process - # 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" - requests = [{}] - options = {} - batch_id = "hello world" - - batch_run_process_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::VisionAI::V1::LiveVideoAnalytics::Rest::ServiceStub.stub :transcode_batch_run_process_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, batch_run_process_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.batch_run_process({ parent: parent, requests: requests, options: options, batch_id: batch_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.batch_run_process parent: parent, requests: requests, options: options, batch_id: batch_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.batch_run_process ::Google::Cloud::VisionAI::V1::BatchRunProcessRequest.new(parent: parent, requests: requests, options: options, batch_id: batch_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.batch_run_process({ parent: parent, requests: requests, options: options, batch_id: batch_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.batch_run_process(::Google::Cloud::VisionAI::V1::BatchRunProcessRequest.new(parent: parent, requests: requests, options: options, batch_id: batch_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, batch_run_process_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::VisionAI::V1::LiveVideoAnalytics::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::VisionAI::V1::LiveVideoAnalytics::Rest::Client::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/test/google/cloud/vision_ai/v1/live_video_analytics_test.rb b/owl-bot-staging/google-cloud-vision_ai-v1/test/google/cloud/vision_ai/v1/live_video_analytics_test.rb deleted file mode 100644 index df33afa7ecf5..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/test/google/cloud/vision_ai/v1/live_video_analytics_test.rb +++ /dev/null @@ -1,1308 +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/visionai/v1/lva_service_pb" -require "google/cloud/vision_ai/v1/live_video_analytics" - -class ::Google::Cloud::VisionAI::V1::LiveVideoAnalytics::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_public_operators - # Create GRPC objects. - grpc_response = ::Google::Cloud::VisionAI::V1::ListPublicOperatorsResponse.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_public_operators_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_public_operators, name - assert_kind_of ::Google::Cloud::VisionAI::V1::ListPublicOperatorsRequest, 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_public_operators_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_public_operators({ 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_public_operators 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_public_operators ::Google::Cloud::VisionAI::V1::ListPublicOperatorsRequest.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_public_operators({ 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_public_operators(::Google::Cloud::VisionAI::V1::ListPublicOperatorsRequest.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_public_operators_client_stub.call_rpc_count - end - end - - def test_resolve_operator_info - # Create GRPC objects. - grpc_response = ::Google::Cloud::VisionAI::V1::ResolveOperatorInfoResponse.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" - queries = [{}] - - resolve_operator_info_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :resolve_operator_info, name - assert_kind_of ::Google::Cloud::VisionAI::V1::ResolveOperatorInfoRequest, request - assert_equal "hello world", request["parent"] - assert_kind_of ::Google::Cloud::VisionAI::V1::OperatorQuery, request["queries"].first - refute_nil options - end - - Gapic::ServiceStub.stub :new, resolve_operator_info_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.resolve_operator_info({ parent: parent, queries: queries }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.resolve_operator_info parent: parent, queries: queries do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.resolve_operator_info ::Google::Cloud::VisionAI::V1::ResolveOperatorInfoRequest.new(parent: parent, queries: queries) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.resolve_operator_info({ parent: parent, queries: queries }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.resolve_operator_info(::Google::Cloud::VisionAI::V1::ResolveOperatorInfoRequest.new(parent: parent, queries: queries), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, resolve_operator_info_client_stub.call_rpc_count - end - end - - def test_list_operators - # Create GRPC objects. - grpc_response = ::Google::Cloud::VisionAI::V1::ListOperatorsResponse.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_operators_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_operators, name - assert_kind_of ::Google::Cloud::VisionAI::V1::ListOperatorsRequest, 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_operators_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_operators({ 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_operators 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_operators ::Google::Cloud::VisionAI::V1::ListOperatorsRequest.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_operators({ 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_operators(::Google::Cloud::VisionAI::V1::ListOperatorsRequest.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_operators_client_stub.call_rpc_count - end - end - - def test_get_operator - # Create GRPC objects. - grpc_response = ::Google::Cloud::VisionAI::V1::Operator.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_operator_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_operator, name - assert_kind_of ::Google::Cloud::VisionAI::V1::GetOperatorRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_operator_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_operator({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_operator name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_operator ::Google::Cloud::VisionAI::V1::GetOperatorRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_operator({ 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_operator(::Google::Cloud::VisionAI::V1::GetOperatorRequest.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_operator_client_stub.call_rpc_count - end - end - - def test_create_operator - # 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" - operator_id = "hello world" - operator = {} - request_id = "hello world" - - create_operator_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_operator, name - assert_kind_of ::Google::Cloud::VisionAI::V1::CreateOperatorRequest, request - assert_equal "hello world", request["parent"] - assert_equal "hello world", request["operator_id"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::VisionAI::V1::Operator), request["operator"] - assert_equal "hello world", request["request_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_operator_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_operator({ parent: parent, operator_id: operator_id, operator: operator, request_id: request_id }) 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_operator parent: parent, operator_id: operator_id, operator: operator, request_id: request_id 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_operator ::Google::Cloud::VisionAI::V1::CreateOperatorRequest.new(parent: parent, operator_id: operator_id, operator: operator, request_id: request_id) 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_operator({ parent: parent, operator_id: operator_id, operator: operator, request_id: request_id }, 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_operator(::Google::Cloud::VisionAI::V1::CreateOperatorRequest.new(parent: parent, operator_id: operator_id, operator: operator, request_id: request_id), 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_operator_client_stub.call_rpc_count - end - end - - def test_update_operator - # 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. - update_mask = {} - operator = {} - request_id = "hello world" - - update_operator_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_operator, name - assert_kind_of ::Google::Cloud::VisionAI::V1::UpdateOperatorRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::VisionAI::V1::Operator), request["operator"] - assert_equal "hello world", request["request_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_operator_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_operator({ update_mask: update_mask, operator: operator, request_id: request_id }) 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.update_operator update_mask: update_mask, operator: operator, request_id: request_id 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.update_operator ::Google::Cloud::VisionAI::V1::UpdateOperatorRequest.new(update_mask: update_mask, operator: operator, request_id: request_id) 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.update_operator({ update_mask: update_mask, operator: operator, request_id: request_id }, 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.update_operator(::Google::Cloud::VisionAI::V1::UpdateOperatorRequest.new(update_mask: update_mask, operator: operator, request_id: request_id), 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, update_operator_client_stub.call_rpc_count - end - end - - def test_delete_operator - # 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" - request_id = "hello world" - - delete_operator_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_operator, name - assert_kind_of ::Google::Cloud::VisionAI::V1::DeleteOperatorRequest, request - assert_equal "hello world", request["name"] - assert_equal "hello world", request["request_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_operator_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_operator({ name: name, request_id: request_id }) 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_operator name: name, request_id: request_id 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_operator ::Google::Cloud::VisionAI::V1::DeleteOperatorRequest.new(name: name, request_id: request_id) 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_operator({ name: name, request_id: request_id }, 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_operator(::Google::Cloud::VisionAI::V1::DeleteOperatorRequest.new(name: name, request_id: request_id), 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_operator_client_stub.call_rpc_count - end - end - - def test_list_analyses - # Create GRPC objects. - grpc_response = ::Google::Cloud::VisionAI::V1::ListAnalysesResponse.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_analyses_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_analyses, name - assert_kind_of ::Google::Cloud::VisionAI::V1::ListAnalysesRequest, 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_analyses_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_analyses({ 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_analyses 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_analyses ::Google::Cloud::VisionAI::V1::ListAnalysesRequest.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_analyses({ 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_analyses(::Google::Cloud::VisionAI::V1::ListAnalysesRequest.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_analyses_client_stub.call_rpc_count - end - end - - def test_get_analysis - # Create GRPC objects. - grpc_response = ::Google::Cloud::VisionAI::V1::Analysis.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_analysis_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_analysis, name - assert_kind_of ::Google::Cloud::VisionAI::V1::GetAnalysisRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_analysis_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_analysis({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_analysis name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_analysis ::Google::Cloud::VisionAI::V1::GetAnalysisRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_analysis({ 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_analysis(::Google::Cloud::VisionAI::V1::GetAnalysisRequest.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_analysis_client_stub.call_rpc_count - end - end - - def test_create_analysis - # 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" - analysis_id = "hello world" - analysis = {} - request_id = "hello world" - - create_analysis_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_analysis, name - assert_kind_of ::Google::Cloud::VisionAI::V1::CreateAnalysisRequest, request - assert_equal "hello world", request["parent"] - assert_equal "hello world", request["analysis_id"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::VisionAI::V1::Analysis), request["analysis"] - assert_equal "hello world", request["request_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_analysis_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_analysis({ parent: parent, analysis_id: analysis_id, analysis: analysis, request_id: request_id }) 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_analysis parent: parent, analysis_id: analysis_id, analysis: analysis, request_id: request_id 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_analysis ::Google::Cloud::VisionAI::V1::CreateAnalysisRequest.new(parent: parent, analysis_id: analysis_id, analysis: analysis, request_id: request_id) 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_analysis({ parent: parent, analysis_id: analysis_id, analysis: analysis, request_id: request_id }, 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_analysis(::Google::Cloud::VisionAI::V1::CreateAnalysisRequest.new(parent: parent, analysis_id: analysis_id, analysis: analysis, request_id: request_id), 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_analysis_client_stub.call_rpc_count - end - end - - def test_update_analysis - # 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. - update_mask = {} - analysis = {} - request_id = "hello world" - - update_analysis_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_analysis, name - assert_kind_of ::Google::Cloud::VisionAI::V1::UpdateAnalysisRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::VisionAI::V1::Analysis), request["analysis"] - assert_equal "hello world", request["request_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_analysis_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_analysis({ update_mask: update_mask, analysis: analysis, request_id: request_id }) 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.update_analysis update_mask: update_mask, analysis: analysis, request_id: request_id 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.update_analysis ::Google::Cloud::VisionAI::V1::UpdateAnalysisRequest.new(update_mask: update_mask, analysis: analysis, request_id: request_id) 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.update_analysis({ update_mask: update_mask, analysis: analysis, request_id: request_id }, 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.update_analysis(::Google::Cloud::VisionAI::V1::UpdateAnalysisRequest.new(update_mask: update_mask, analysis: analysis, request_id: request_id), 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, update_analysis_client_stub.call_rpc_count - end - end - - def test_delete_analysis - # 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" - request_id = "hello world" - - delete_analysis_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_analysis, name - assert_kind_of ::Google::Cloud::VisionAI::V1::DeleteAnalysisRequest, request - assert_equal "hello world", request["name"] - assert_equal "hello world", request["request_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_analysis_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_analysis({ name: name, request_id: request_id }) 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_analysis name: name, request_id: request_id 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_analysis ::Google::Cloud::VisionAI::V1::DeleteAnalysisRequest.new(name: name, request_id: request_id) 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_analysis({ name: name, request_id: request_id }, 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_analysis(::Google::Cloud::VisionAI::V1::DeleteAnalysisRequest.new(name: name, request_id: request_id), 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_analysis_client_stub.call_rpc_count - end - end - - def test_list_processes - # Create GRPC objects. - grpc_response = ::Google::Cloud::VisionAI::V1::ListProcessesResponse.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_processes_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_processes, name - assert_kind_of ::Google::Cloud::VisionAI::V1::ListProcessesRequest, 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_processes_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_processes({ 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_processes 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_processes ::Google::Cloud::VisionAI::V1::ListProcessesRequest.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_processes({ 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_processes(::Google::Cloud::VisionAI::V1::ListProcessesRequest.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_processes_client_stub.call_rpc_count - end - end - - def test_get_process - # Create GRPC objects. - grpc_response = ::Google::Cloud::VisionAI::V1::Process.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_process_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_process, name - assert_kind_of ::Google::Cloud::VisionAI::V1::GetProcessRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_process_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_process({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_process name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_process ::Google::Cloud::VisionAI::V1::GetProcessRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_process({ 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_process(::Google::Cloud::VisionAI::V1::GetProcessRequest.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_process_client_stub.call_rpc_count - end - end - - def test_create_process - # 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" - process_id = "hello world" - process = {} - request_id = "hello world" - - create_process_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_process, name - assert_kind_of ::Google::Cloud::VisionAI::V1::CreateProcessRequest, request - assert_equal "hello world", request["parent"] - assert_equal "hello world", request["process_id"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::VisionAI::V1::Process), request["process"] - assert_equal "hello world", request["request_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_process_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_process({ parent: parent, process_id: process_id, process: process, request_id: request_id }) 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_process parent: parent, process_id: process_id, process: process, request_id: request_id 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_process ::Google::Cloud::VisionAI::V1::CreateProcessRequest.new(parent: parent, process_id: process_id, process: process, request_id: request_id) 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_process({ parent: parent, process_id: process_id, process: process, request_id: request_id }, 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_process(::Google::Cloud::VisionAI::V1::CreateProcessRequest.new(parent: parent, process_id: process_id, process: process, request_id: request_id), 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_process_client_stub.call_rpc_count - end - end - - def test_update_process - # 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. - update_mask = {} - process = {} - request_id = "hello world" - - update_process_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_process, name - assert_kind_of ::Google::Cloud::VisionAI::V1::UpdateProcessRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::VisionAI::V1::Process), request["process"] - assert_equal "hello world", request["request_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_process_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_process({ update_mask: update_mask, process: process, request_id: request_id }) 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.update_process update_mask: update_mask, process: process, request_id: request_id 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.update_process ::Google::Cloud::VisionAI::V1::UpdateProcessRequest.new(update_mask: update_mask, process: process, request_id: request_id) 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.update_process({ update_mask: update_mask, process: process, request_id: request_id }, 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.update_process(::Google::Cloud::VisionAI::V1::UpdateProcessRequest.new(update_mask: update_mask, process: process, request_id: request_id), 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, update_process_client_stub.call_rpc_count - end - end - - def test_delete_process - # 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" - request_id = "hello world" - - delete_process_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_process, name - assert_kind_of ::Google::Cloud::VisionAI::V1::DeleteProcessRequest, request - assert_equal "hello world", request["name"] - assert_equal "hello world", request["request_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_process_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_process({ name: name, request_id: request_id }) 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_process name: name, request_id: request_id 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_process ::Google::Cloud::VisionAI::V1::DeleteProcessRequest.new(name: name, request_id: request_id) 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_process({ name: name, request_id: request_id }, 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_process(::Google::Cloud::VisionAI::V1::DeleteProcessRequest.new(name: name, request_id: request_id), 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_process_client_stub.call_rpc_count - end - end - - def test_batch_run_process - # 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" - requests = [{}] - options = {} - batch_id = "hello world" - - batch_run_process_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :batch_run_process, name - assert_kind_of ::Google::Cloud::VisionAI::V1::BatchRunProcessRequest, request - assert_equal "hello world", request["parent"] - assert_kind_of ::Google::Cloud::VisionAI::V1::CreateProcessRequest, request["requests"].first - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::VisionAI::V1::BatchRunProcessRequest::BatchRunProcessOptions), request["options"] - assert_equal "hello world", request["batch_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, batch_run_process_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.batch_run_process({ parent: parent, requests: requests, options: options, batch_id: batch_id }) 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.batch_run_process parent: parent, requests: requests, options: options, batch_id: batch_id 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.batch_run_process ::Google::Cloud::VisionAI::V1::BatchRunProcessRequest.new(parent: parent, requests: requests, options: options, batch_id: batch_id) 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.batch_run_process({ parent: parent, requests: requests, options: options, batch_id: batch_id }, 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.batch_run_process(::Google::Cloud::VisionAI::V1::BatchRunProcessRequest.new(parent: parent, requests: requests, options: options, batch_id: batch_id), 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, batch_run_process_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::VisionAI::V1::LiveVideoAnalytics::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::VisionAI::V1::LiveVideoAnalytics::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::VisionAI::V1::LiveVideoAnalytics::Client.new do |config| - config.credentials = creds - end - assert_kind_of ::Google::Cloud::VisionAI::V1::LiveVideoAnalytics::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::VisionAI::V1::LiveVideoAnalytics::Client.new do |config| - config.credentials = grpc_channel - end - end - - assert_kind_of ::Google::Cloud::VisionAI::V1::LiveVideoAnalytics::Operations, client.operations_client - end -end diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/test/google/cloud/vision_ai/v1/streaming_service_paths_test.rb b/owl-bot-staging/google-cloud-vision_ai-v1/test/google/cloud/vision_ai/v1/streaming_service_paths_test.rb deleted file mode 100644 index 43fffa383f81..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/test/google/cloud/vision_ai/v1/streaming_service_paths_test.rb +++ /dev/null @@ -1,55 +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/vision_ai/v1/streaming_service" - -class ::Google::Cloud::VisionAI::V1::StreamingService::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_series_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::VisionAI::V1::StreamingService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.series_path project: "value0", location: "value1", cluster: "value2", series: "value3" - assert_equal "projects/value0/locations/value1/clusters/value2/series/value3", path - end - end -end diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/test/google/cloud/vision_ai/v1/streaming_service_rest_test.rb b/owl-bot-staging/google-cloud-vision_ai-v1/test/google/cloud/vision_ai/v1/streaming_service_rest_test.rb deleted file mode 100644 index 3a5a2b04ea7f..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/test/google/cloud/vision_ai/v1/streaming_service_rest_test.rb +++ /dev/null @@ -1,269 +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/visionai/v1/streaming_service_pb" -require "google/cloud/vision_ai/v1/streaming_service/rest" - - -class ::Google::Cloud::VisionAI::V1::StreamingService::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_acquire_lease - # Create test objects. - client_result = ::Google::Cloud::VisionAI::V1::Lease.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - series = "hello world" - owner = "hello world" - term = {} - lease_type = :LEASE_TYPE_UNSPECIFIED - - acquire_lease_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::VisionAI::V1::StreamingService::Rest::ServiceStub.stub :transcode_acquire_lease_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, acquire_lease_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::StreamingService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.acquire_lease({ series: series, owner: owner, term: term, lease_type: lease_type }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.acquire_lease series: series, owner: owner, term: term, lease_type: lease_type do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.acquire_lease ::Google::Cloud::VisionAI::V1::AcquireLeaseRequest.new(series: series, owner: owner, term: term, lease_type: lease_type) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.acquire_lease({ series: series, owner: owner, term: term, lease_type: lease_type }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.acquire_lease(::Google::Cloud::VisionAI::V1::AcquireLeaseRequest.new(series: series, owner: owner, term: term, lease_type: lease_type), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, acquire_lease_client_stub.call_count - end - end - end - - def test_renew_lease - # Create test objects. - client_result = ::Google::Cloud::VisionAI::V1::Lease.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - id = "hello world" - series = "hello world" - owner = "hello world" - term = {} - - renew_lease_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::VisionAI::V1::StreamingService::Rest::ServiceStub.stub :transcode_renew_lease_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, renew_lease_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::StreamingService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.renew_lease({ id: id, series: series, owner: owner, term: term }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.renew_lease id: id, series: series, owner: owner, term: term do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.renew_lease ::Google::Cloud::VisionAI::V1::RenewLeaseRequest.new(id: id, series: series, owner: owner, term: term) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.renew_lease({ id: id, series: series, owner: owner, term: term }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.renew_lease(::Google::Cloud::VisionAI::V1::RenewLeaseRequest.new(id: id, series: series, owner: owner, term: term), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, renew_lease_client_stub.call_count - end - end - end - - def test_release_lease - # Create test objects. - client_result = ::Google::Cloud::VisionAI::V1::ReleaseLeaseResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - id = "hello world" - series = "hello world" - owner = "hello world" - - release_lease_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::VisionAI::V1::StreamingService::Rest::ServiceStub.stub :transcode_release_lease_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, release_lease_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::StreamingService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.release_lease({ id: id, series: series, owner: owner }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.release_lease id: id, series: series, owner: owner do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.release_lease ::Google::Cloud::VisionAI::V1::ReleaseLeaseRequest.new(id: id, series: series, owner: owner) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.release_lease({ id: id, series: series, owner: owner }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.release_lease(::Google::Cloud::VisionAI::V1::ReleaseLeaseRequest.new(id: id, series: series, owner: owner), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, release_lease_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::VisionAI::V1::StreamingService::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::VisionAI::V1::StreamingService::Rest::Client::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/test/google/cloud/vision_ai/v1/streaming_service_test.rb b/owl-bot-staging/google-cloud-vision_ai-v1/test/google/cloud/vision_ai/v1/streaming_service_test.rb deleted file mode 100644 index 323bb0bfdfd5..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/test/google/cloud/vision_ai/v1/streaming_service_test.rb +++ /dev/null @@ -1,561 +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/visionai/v1/streaming_service_pb" -require "google/cloud/vision_ai/v1/streaming_service" - -class ::Google::Cloud::VisionAI::V1::StreamingService::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_send_packets - # Create GRPC objects. - grpc_response = ::Google::Cloud::VisionAI::V1::SendPacketsResponse.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 bidi streaming method. - packet = {} - - send_packets_client_stub = ClientStub.new [grpc_response].to_enum, grpc_operation do |name, request, options:| - assert_equal :send_packets, name - assert_kind_of Enumerable, request - refute_nil options - request - end - - Gapic::ServiceStub.stub :new, send_packets_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::StreamingService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use enumerable object with hash and protobuf object. - request_hash = { packet: packet } - request_proto = ::Google::Cloud::VisionAI::V1::SendPacketsRequest.new packet: packet - enum_input = [request_hash, request_proto].to_enum - client.send_packets enum_input do |response, operation| - assert_kind_of Enumerable, response - response.to_a.each do |r| - assert_kind_of ::Google::Cloud::VisionAI::V1::SendPacketsResponse, r - end - assert_equal grpc_operation, operation - end - - # Use stream input object (from gapic-common). - request_hash = { packet: packet } - request_proto = ::Google::Cloud::VisionAI::V1::SendPacketsRequest.new packet: packet - stream_input = Gapic::StreamInput.new - client.send_packets stream_input do |response, operation| - assert_kind_of Enumerable, response - response.to_a.each do |r| - assert_kind_of ::Google::Cloud::VisionAI::V1::SendPacketsResponse, r - end - assert_equal grpc_operation, operation - end - stream_input << request_hash - stream_input << request_proto - stream_input.close - - # Use enumerable object with hash and protobuf object with options. - request_hash = { packet: packet } - request_proto = ::Google::Cloud::VisionAI::V1::SendPacketsRequest.new packet: packet - enum_input = [request_hash, request_proto].to_enum - client.send_packets enum_input, grpc_options do |response, operation| - assert_kind_of Enumerable, response - response.to_a.each do |r| - assert_kind_of ::Google::Cloud::VisionAI::V1::SendPacketsResponse, r - end - assert_equal grpc_operation, operation - end - - # Use stream input object (from gapic-common) with options. - request_hash = { packet: packet } - request_proto = ::Google::Cloud::VisionAI::V1::SendPacketsRequest.new packet: packet - stream_input = Gapic::StreamInput.new - client.send_packets stream_input, grpc_options do |response, operation| - assert_kind_of Enumerable, response - response.to_a.each do |r| - assert_kind_of ::Google::Cloud::VisionAI::V1::SendPacketsResponse, r - end - assert_equal grpc_operation, operation - end - stream_input << request_hash - stream_input << request_proto - stream_input.close - - # Verify method calls - assert_equal 4, send_packets_client_stub.call_rpc_count - send_packets_client_stub.requests.each do |request| - request.to_a.each do |r| - assert_kind_of ::Google::Cloud::VisionAI::V1::SendPacketsRequest, r - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::VisionAI::V1::Packet), r["packet"] - assert_equal :packet, r.request - end - end - end - end - - def test_receive_packets - # Create GRPC objects. - grpc_response = ::Google::Cloud::VisionAI::V1::ReceivePacketsResponse.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 bidi streaming method. - setup_request = {} - - receive_packets_client_stub = ClientStub.new [grpc_response].to_enum, grpc_operation do |name, request, options:| - assert_equal :receive_packets, name - assert_kind_of Enumerable, request - refute_nil options - request - end - - Gapic::ServiceStub.stub :new, receive_packets_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::StreamingService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use enumerable object with hash and protobuf object. - request_hash = { setup_request: setup_request } - request_proto = ::Google::Cloud::VisionAI::V1::ReceivePacketsRequest.new setup_request: setup_request - enum_input = [request_hash, request_proto].to_enum - client.receive_packets enum_input do |response, operation| - assert_kind_of Enumerable, response - response.to_a.each do |r| - assert_kind_of ::Google::Cloud::VisionAI::V1::ReceivePacketsResponse, r - end - assert_equal grpc_operation, operation - end - - # Use stream input object (from gapic-common). - request_hash = { setup_request: setup_request } - request_proto = ::Google::Cloud::VisionAI::V1::ReceivePacketsRequest.new setup_request: setup_request - stream_input = Gapic::StreamInput.new - client.receive_packets stream_input do |response, operation| - assert_kind_of Enumerable, response - response.to_a.each do |r| - assert_kind_of ::Google::Cloud::VisionAI::V1::ReceivePacketsResponse, r - end - assert_equal grpc_operation, operation - end - stream_input << request_hash - stream_input << request_proto - stream_input.close - - # Use enumerable object with hash and protobuf object with options. - request_hash = { setup_request: setup_request } - request_proto = ::Google::Cloud::VisionAI::V1::ReceivePacketsRequest.new setup_request: setup_request - enum_input = [request_hash, request_proto].to_enum - client.receive_packets enum_input, grpc_options do |response, operation| - assert_kind_of Enumerable, response - response.to_a.each do |r| - assert_kind_of ::Google::Cloud::VisionAI::V1::ReceivePacketsResponse, r - end - assert_equal grpc_operation, operation - end - - # Use stream input object (from gapic-common) with options. - request_hash = { setup_request: setup_request } - request_proto = ::Google::Cloud::VisionAI::V1::ReceivePacketsRequest.new setup_request: setup_request - stream_input = Gapic::StreamInput.new - client.receive_packets stream_input, grpc_options do |response, operation| - assert_kind_of Enumerable, response - response.to_a.each do |r| - assert_kind_of ::Google::Cloud::VisionAI::V1::ReceivePacketsResponse, r - end - assert_equal grpc_operation, operation - end - stream_input << request_hash - stream_input << request_proto - stream_input.close - - # Verify method calls - assert_equal 4, receive_packets_client_stub.call_rpc_count - receive_packets_client_stub.requests.each do |request| - request.to_a.each do |r| - assert_kind_of ::Google::Cloud::VisionAI::V1::ReceivePacketsRequest, r - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::VisionAI::V1::ReceivePacketsRequest::SetupRequest), r["setup_request"] - assert_equal :setup_request, r.request - end - end - end - end - - def test_receive_events - # Create GRPC objects. - grpc_response = ::Google::Cloud::VisionAI::V1::ReceiveEventsResponse.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 bidi streaming method. - setup_request = {} - - receive_events_client_stub = ClientStub.new [grpc_response].to_enum, grpc_operation do |name, request, options:| - assert_equal :receive_events, name - assert_kind_of Enumerable, request - refute_nil options - request - end - - Gapic::ServiceStub.stub :new, receive_events_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::StreamingService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use enumerable object with hash and protobuf object. - request_hash = { setup_request: setup_request } - request_proto = ::Google::Cloud::VisionAI::V1::ReceiveEventsRequest.new setup_request: setup_request - enum_input = [request_hash, request_proto].to_enum - client.receive_events enum_input do |response, operation| - assert_kind_of Enumerable, response - response.to_a.each do |r| - assert_kind_of ::Google::Cloud::VisionAI::V1::ReceiveEventsResponse, r - end - assert_equal grpc_operation, operation - end - - # Use stream input object (from gapic-common). - request_hash = { setup_request: setup_request } - request_proto = ::Google::Cloud::VisionAI::V1::ReceiveEventsRequest.new setup_request: setup_request - stream_input = Gapic::StreamInput.new - client.receive_events stream_input do |response, operation| - assert_kind_of Enumerable, response - response.to_a.each do |r| - assert_kind_of ::Google::Cloud::VisionAI::V1::ReceiveEventsResponse, r - end - assert_equal grpc_operation, operation - end - stream_input << request_hash - stream_input << request_proto - stream_input.close - - # Use enumerable object with hash and protobuf object with options. - request_hash = { setup_request: setup_request } - request_proto = ::Google::Cloud::VisionAI::V1::ReceiveEventsRequest.new setup_request: setup_request - enum_input = [request_hash, request_proto].to_enum - client.receive_events enum_input, grpc_options do |response, operation| - assert_kind_of Enumerable, response - response.to_a.each do |r| - assert_kind_of ::Google::Cloud::VisionAI::V1::ReceiveEventsResponse, r - end - assert_equal grpc_operation, operation - end - - # Use stream input object (from gapic-common) with options. - request_hash = { setup_request: setup_request } - request_proto = ::Google::Cloud::VisionAI::V1::ReceiveEventsRequest.new setup_request: setup_request - stream_input = Gapic::StreamInput.new - client.receive_events stream_input, grpc_options do |response, operation| - assert_kind_of Enumerable, response - response.to_a.each do |r| - assert_kind_of ::Google::Cloud::VisionAI::V1::ReceiveEventsResponse, r - end - assert_equal grpc_operation, operation - end - stream_input << request_hash - stream_input << request_proto - stream_input.close - - # Verify method calls - assert_equal 4, receive_events_client_stub.call_rpc_count - receive_events_client_stub.requests.each do |request| - request.to_a.each do |r| - assert_kind_of ::Google::Cloud::VisionAI::V1::ReceiveEventsRequest, r - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::VisionAI::V1::ReceiveEventsRequest::SetupRequest), r["setup_request"] - assert_equal :setup_request, r.request - end - end - end - end - - def test_acquire_lease - # Create GRPC objects. - grpc_response = ::Google::Cloud::VisionAI::V1::Lease.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. - series = "hello world" - owner = "hello world" - term = {} - lease_type = :LEASE_TYPE_UNSPECIFIED - - acquire_lease_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :acquire_lease, name - assert_kind_of ::Google::Cloud::VisionAI::V1::AcquireLeaseRequest, request - assert_equal "hello world", request["series"] - assert_equal "hello world", request["owner"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Duration), request["term"] - assert_equal :LEASE_TYPE_UNSPECIFIED, request["lease_type"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, acquire_lease_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::StreamingService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.acquire_lease({ series: series, owner: owner, term: term, lease_type: lease_type }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.acquire_lease series: series, owner: owner, term: term, lease_type: lease_type do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.acquire_lease ::Google::Cloud::VisionAI::V1::AcquireLeaseRequest.new(series: series, owner: owner, term: term, lease_type: lease_type) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.acquire_lease({ series: series, owner: owner, term: term, lease_type: lease_type }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.acquire_lease(::Google::Cloud::VisionAI::V1::AcquireLeaseRequest.new(series: series, owner: owner, term: term, lease_type: lease_type), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, acquire_lease_client_stub.call_rpc_count - end - end - - def test_renew_lease - # Create GRPC objects. - grpc_response = ::Google::Cloud::VisionAI::V1::Lease.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. - id = "hello world" - series = "hello world" - owner = "hello world" - term = {} - - renew_lease_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :renew_lease, name - assert_kind_of ::Google::Cloud::VisionAI::V1::RenewLeaseRequest, request - assert_equal "hello world", request["id"] - assert_equal "hello world", request["series"] - assert_equal "hello world", request["owner"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Duration), request["term"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, renew_lease_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::StreamingService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.renew_lease({ id: id, series: series, owner: owner, term: term }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.renew_lease id: id, series: series, owner: owner, term: term do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.renew_lease ::Google::Cloud::VisionAI::V1::RenewLeaseRequest.new(id: id, series: series, owner: owner, term: term) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.renew_lease({ id: id, series: series, owner: owner, term: term }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.renew_lease(::Google::Cloud::VisionAI::V1::RenewLeaseRequest.new(id: id, series: series, owner: owner, term: term), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, renew_lease_client_stub.call_rpc_count - end - end - - def test_release_lease - # Create GRPC objects. - grpc_response = ::Google::Cloud::VisionAI::V1::ReleaseLeaseResponse.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. - id = "hello world" - series = "hello world" - owner = "hello world" - - release_lease_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :release_lease, name - assert_kind_of ::Google::Cloud::VisionAI::V1::ReleaseLeaseRequest, request - assert_equal "hello world", request["id"] - assert_equal "hello world", request["series"] - assert_equal "hello world", request["owner"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, release_lease_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::StreamingService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.release_lease({ id: id, series: series, owner: owner }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.release_lease id: id, series: series, owner: owner do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.release_lease ::Google::Cloud::VisionAI::V1::ReleaseLeaseRequest.new(id: id, series: series, owner: owner) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.release_lease({ id: id, series: series, owner: owner }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.release_lease(::Google::Cloud::VisionAI::V1::ReleaseLeaseRequest.new(id: id, series: series, owner: owner), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, release_lease_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::VisionAI::V1::StreamingService::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::VisionAI::V1::StreamingService::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::VisionAI::V1::StreamingService::Client.new do |config| - config.credentials = creds - end - assert_kind_of ::Google::Cloud::VisionAI::V1::StreamingService::Client, client - assert_equal creds, client.configure.credentials - end - end -end diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/test/google/cloud/vision_ai/v1/streams_service_operations_test.rb b/owl-bot-staging/google-cloud-vision_ai-v1/test/google/cloud/vision_ai/v1/streams_service_operations_test.rb deleted file mode 100644 index 01a34ec6e4b0..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/test/google/cloud/vision_ai/v1/streams_service_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/visionai/v1/streams_service_pb" -require "google/cloud/visionai/v1/streams_service_services_pb" -require "google/cloud/vision_ai/v1/streams_service" - -class ::Google::Cloud::VisionAI::V1::StreamsService::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::VisionAI::V1::StreamsService::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::VisionAI::V1::StreamsService::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::VisionAI::V1::StreamsService::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::VisionAI::V1::StreamsService::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::VisionAI::V1::StreamsService::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::VisionAI::V1::StreamsService::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::VisionAI::V1::StreamsService::Operations::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/test/google/cloud/vision_ai/v1/streams_service_paths_test.rb b/owl-bot-staging/google-cloud-vision_ai-v1/test/google/cloud/vision_ai/v1/streams_service_paths_test.rb deleted file mode 100644 index 90d31f94d99a..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/test/google/cloud/vision_ai/v1/streams_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/vision_ai/v1/streams_service" - -class ::Google::Cloud::VisionAI::V1::StreamsService::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_channel_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::VisionAI::V1::StreamsService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.channel_path project: "value0", location: "value1", cluster: "value2", channel: "value3" - assert_equal "projects/value0/locations/value1/clusters/value2/channels/value3", path - end - end - - def test_cluster_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::VisionAI::V1::StreamsService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.cluster_path project: "value0", location: "value1", cluster: "value2" - assert_equal "projects/value0/locations/value1/clusters/value2", path - end - end - - def test_event_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::VisionAI::V1::StreamsService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.event_path project: "value0", location: "value1", cluster: "value2", event: "value3" - assert_equal "projects/value0/locations/value1/clusters/value2/events/value3", 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::VisionAI::V1::StreamsService::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_series_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::VisionAI::V1::StreamsService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.series_path project: "value0", location: "value1", cluster: "value2", series: "value3" - assert_equal "projects/value0/locations/value1/clusters/value2/series/value3", path - end - end - - def test_stream_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::VisionAI::V1::StreamsService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.stream_path project: "value0", location: "value1", cluster: "value2", stream: "value3" - assert_equal "projects/value0/locations/value1/clusters/value2/streams/value3", path - end - end -end diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/test/google/cloud/vision_ai/v1/streams_service_rest_test.rb b/owl-bot-staging/google-cloud-vision_ai-v1/test/google/cloud/vision_ai/v1/streams_service_rest_test.rb deleted file mode 100644 index 8fb9c187c413..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/test/google/cloud/vision_ai/v1/streams_service_rest_test.rb +++ /dev/null @@ -1,1387 +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/visionai/v1/streams_service_pb" -require "google/cloud/vision_ai/v1/streams_service/rest" - - -class ::Google::Cloud::VisionAI::V1::StreamsService::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_clusters - # Create test objects. - client_result = ::Google::Cloud::VisionAI::V1::ListClustersResponse.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_clusters_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::VisionAI::V1::StreamsService::Rest::ServiceStub.stub :transcode_list_clusters_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_clusters_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::StreamsService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_clusters({ 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_clusters 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_clusters ::Google::Cloud::VisionAI::V1::ListClustersRequest.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_clusters({ 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_clusters(::Google::Cloud::VisionAI::V1::ListClustersRequest.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_clusters_client_stub.call_count - end - end - end - - def test_get_cluster - # Create test objects. - client_result = ::Google::Cloud::VisionAI::V1::Cluster.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_cluster_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::VisionAI::V1::StreamsService::Rest::ServiceStub.stub :transcode_get_cluster_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_cluster_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::StreamsService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_cluster({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_cluster name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_cluster ::Google::Cloud::VisionAI::V1::GetClusterRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_cluster({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_cluster(::Google::Cloud::VisionAI::V1::GetClusterRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_cluster_client_stub.call_count - end - end - end - - def test_create_cluster - # 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" - cluster_id = "hello world" - cluster = {} - request_id = "hello world" - - create_cluster_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::VisionAI::V1::StreamsService::Rest::ServiceStub.stub :transcode_create_cluster_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_cluster_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::StreamsService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_cluster({ parent: parent, cluster_id: cluster_id, cluster: cluster, request_id: request_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_cluster parent: parent, cluster_id: cluster_id, cluster: cluster, request_id: request_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_cluster ::Google::Cloud::VisionAI::V1::CreateClusterRequest.new(parent: parent, cluster_id: cluster_id, cluster: cluster, request_id: request_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_cluster({ parent: parent, cluster_id: cluster_id, cluster: cluster, request_id: request_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_cluster(::Google::Cloud::VisionAI::V1::CreateClusterRequest.new(parent: parent, cluster_id: cluster_id, cluster: cluster, request_id: request_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_cluster_client_stub.call_count - end - end - end - - def test_update_cluster - # 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. - update_mask = {} - cluster = {} - request_id = "hello world" - - update_cluster_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::VisionAI::V1::StreamsService::Rest::ServiceStub.stub :transcode_update_cluster_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_cluster_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::StreamsService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.update_cluster({ update_mask: update_mask, cluster: cluster, request_id: request_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.update_cluster update_mask: update_mask, cluster: cluster, request_id: request_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.update_cluster ::Google::Cloud::VisionAI::V1::UpdateClusterRequest.new(update_mask: update_mask, cluster: cluster, request_id: request_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.update_cluster({ update_mask: update_mask, cluster: cluster, request_id: request_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.update_cluster(::Google::Cloud::VisionAI::V1::UpdateClusterRequest.new(update_mask: update_mask, cluster: cluster, request_id: request_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, update_cluster_client_stub.call_count - end - end - end - - def test_delete_cluster - # 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" - request_id = "hello world" - - delete_cluster_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::VisionAI::V1::StreamsService::Rest::ServiceStub.stub :transcode_delete_cluster_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_cluster_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::StreamsService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.delete_cluster({ name: name, request_id: request_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.delete_cluster name: name, request_id: request_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.delete_cluster ::Google::Cloud::VisionAI::V1::DeleteClusterRequest.new(name: name, request_id: request_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.delete_cluster({ name: name, request_id: request_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.delete_cluster(::Google::Cloud::VisionAI::V1::DeleteClusterRequest.new(name: name, request_id: request_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, delete_cluster_client_stub.call_count - end - end - end - - def test_list_streams - # Create test objects. - client_result = ::Google::Cloud::VisionAI::V1::ListStreamsResponse.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_streams_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::VisionAI::V1::StreamsService::Rest::ServiceStub.stub :transcode_list_streams_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_streams_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::StreamsService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_streams({ 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_streams 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_streams ::Google::Cloud::VisionAI::V1::ListStreamsRequest.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_streams({ 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_streams(::Google::Cloud::VisionAI::V1::ListStreamsRequest.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_streams_client_stub.call_count - end - end - end - - def test_get_stream - # Create test objects. - client_result = ::Google::Cloud::VisionAI::V1::Stream.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_stream_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::VisionAI::V1::StreamsService::Rest::ServiceStub.stub :transcode_get_stream_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_stream_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::StreamsService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_stream({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_stream name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_stream ::Google::Cloud::VisionAI::V1::GetStreamRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_stream({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_stream(::Google::Cloud::VisionAI::V1::GetStreamRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_stream_client_stub.call_count - end - end - end - - def test_create_stream - # 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" - stream_id = "hello world" - stream = {} - request_id = "hello world" - - create_stream_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::VisionAI::V1::StreamsService::Rest::ServiceStub.stub :transcode_create_stream_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_stream_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::StreamsService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_stream({ parent: parent, stream_id: stream_id, stream: stream, request_id: request_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_stream parent: parent, stream_id: stream_id, stream: stream, request_id: request_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_stream ::Google::Cloud::VisionAI::V1::CreateStreamRequest.new(parent: parent, stream_id: stream_id, stream: stream, request_id: request_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_stream({ parent: parent, stream_id: stream_id, stream: stream, request_id: request_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_stream(::Google::Cloud::VisionAI::V1::CreateStreamRequest.new(parent: parent, stream_id: stream_id, stream: stream, request_id: request_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_stream_client_stub.call_count - end - end - end - - def test_update_stream - # 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. - update_mask = {} - stream = {} - request_id = "hello world" - - update_stream_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::VisionAI::V1::StreamsService::Rest::ServiceStub.stub :transcode_update_stream_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_stream_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::StreamsService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.update_stream({ update_mask: update_mask, stream: stream, request_id: request_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.update_stream update_mask: update_mask, stream: stream, request_id: request_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.update_stream ::Google::Cloud::VisionAI::V1::UpdateStreamRequest.new(update_mask: update_mask, stream: stream, request_id: request_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.update_stream({ update_mask: update_mask, stream: stream, request_id: request_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.update_stream(::Google::Cloud::VisionAI::V1::UpdateStreamRequest.new(update_mask: update_mask, stream: stream, request_id: request_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, update_stream_client_stub.call_count - end - end - end - - def test_delete_stream - # 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" - request_id = "hello world" - - delete_stream_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::VisionAI::V1::StreamsService::Rest::ServiceStub.stub :transcode_delete_stream_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_stream_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::StreamsService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.delete_stream({ name: name, request_id: request_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.delete_stream name: name, request_id: request_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.delete_stream ::Google::Cloud::VisionAI::V1::DeleteStreamRequest.new(name: name, request_id: request_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.delete_stream({ name: name, request_id: request_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.delete_stream(::Google::Cloud::VisionAI::V1::DeleteStreamRequest.new(name: name, request_id: request_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, delete_stream_client_stub.call_count - end - end - end - - def test_get_stream_thumbnail - # 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. - stream = "hello world" - gcs_object_name = "hello world" - event = "hello world" - request_id = "hello world" - - get_stream_thumbnail_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::VisionAI::V1::StreamsService::Rest::ServiceStub.stub :transcode_get_stream_thumbnail_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_stream_thumbnail_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::StreamsService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_stream_thumbnail({ stream: stream, gcs_object_name: gcs_object_name, event: event, request_id: request_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_stream_thumbnail stream: stream, gcs_object_name: gcs_object_name, event: event, request_id: request_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_stream_thumbnail ::Google::Cloud::VisionAI::V1::GetStreamThumbnailRequest.new(stream: stream, gcs_object_name: gcs_object_name, event: event, request_id: request_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_stream_thumbnail({ stream: stream, gcs_object_name: gcs_object_name, event: event, request_id: request_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_stream_thumbnail(::Google::Cloud::VisionAI::V1::GetStreamThumbnailRequest.new(stream: stream, gcs_object_name: gcs_object_name, event: event, request_id: request_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_stream_thumbnail_client_stub.call_count - end - end - end - - def test_generate_stream_hls_token - # Create test objects. - client_result = ::Google::Cloud::VisionAI::V1::GenerateStreamHlsTokenResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - stream = "hello world" - - generate_stream_hls_token_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::VisionAI::V1::StreamsService::Rest::ServiceStub.stub :transcode_generate_stream_hls_token_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, generate_stream_hls_token_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::StreamsService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.generate_stream_hls_token({ stream: stream }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.generate_stream_hls_token stream: stream do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.generate_stream_hls_token ::Google::Cloud::VisionAI::V1::GenerateStreamHlsTokenRequest.new(stream: stream) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.generate_stream_hls_token({ stream: stream }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.generate_stream_hls_token(::Google::Cloud::VisionAI::V1::GenerateStreamHlsTokenRequest.new(stream: stream), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, generate_stream_hls_token_client_stub.call_count - end - end - end - - def test_list_events - # Create test objects. - client_result = ::Google::Cloud::VisionAI::V1::ListEventsResponse.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_events_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::VisionAI::V1::StreamsService::Rest::ServiceStub.stub :transcode_list_events_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_events_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::StreamsService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_events({ 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_events 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_events ::Google::Cloud::VisionAI::V1::ListEventsRequest.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_events({ 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_events(::Google::Cloud::VisionAI::V1::ListEventsRequest.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_events_client_stub.call_count - end - end - end - - def test_get_event - # Create test objects. - client_result = ::Google::Cloud::VisionAI::V1::Event.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_event_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::VisionAI::V1::StreamsService::Rest::ServiceStub.stub :transcode_get_event_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_event_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::StreamsService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_event({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_event name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_event ::Google::Cloud::VisionAI::V1::GetEventRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_event({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_event(::Google::Cloud::VisionAI::V1::GetEventRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_event_client_stub.call_count - end - end - end - - def test_create_event - # 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" - event_id = "hello world" - event = {} - request_id = "hello world" - - create_event_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::VisionAI::V1::StreamsService::Rest::ServiceStub.stub :transcode_create_event_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_event_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::StreamsService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_event({ parent: parent, event_id: event_id, event: event, request_id: request_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_event parent: parent, event_id: event_id, event: event, request_id: request_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_event ::Google::Cloud::VisionAI::V1::CreateEventRequest.new(parent: parent, event_id: event_id, event: event, request_id: request_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_event({ parent: parent, event_id: event_id, event: event, request_id: request_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_event(::Google::Cloud::VisionAI::V1::CreateEventRequest.new(parent: parent, event_id: event_id, event: event, request_id: request_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_event_client_stub.call_count - end - end - end - - def test_update_event - # 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. - update_mask = {} - event = {} - request_id = "hello world" - - update_event_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::VisionAI::V1::StreamsService::Rest::ServiceStub.stub :transcode_update_event_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_event_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::StreamsService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.update_event({ update_mask: update_mask, event: event, request_id: request_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.update_event update_mask: update_mask, event: event, request_id: request_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.update_event ::Google::Cloud::VisionAI::V1::UpdateEventRequest.new(update_mask: update_mask, event: event, request_id: request_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.update_event({ update_mask: update_mask, event: event, request_id: request_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.update_event(::Google::Cloud::VisionAI::V1::UpdateEventRequest.new(update_mask: update_mask, event: event, request_id: request_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, update_event_client_stub.call_count - end - end - end - - def test_delete_event - # 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" - request_id = "hello world" - - delete_event_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::VisionAI::V1::StreamsService::Rest::ServiceStub.stub :transcode_delete_event_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_event_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::StreamsService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.delete_event({ name: name, request_id: request_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.delete_event name: name, request_id: request_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.delete_event ::Google::Cloud::VisionAI::V1::DeleteEventRequest.new(name: name, request_id: request_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.delete_event({ name: name, request_id: request_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.delete_event(::Google::Cloud::VisionAI::V1::DeleteEventRequest.new(name: name, request_id: request_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, delete_event_client_stub.call_count - end - end - end - - def test_list_series - # Create test objects. - client_result = ::Google::Cloud::VisionAI::V1::ListSeriesResponse.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_series_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::VisionAI::V1::StreamsService::Rest::ServiceStub.stub :transcode_list_series_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_series_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::StreamsService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_series({ 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_series 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_series ::Google::Cloud::VisionAI::V1::ListSeriesRequest.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_series({ 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_series(::Google::Cloud::VisionAI::V1::ListSeriesRequest.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_series_client_stub.call_count - end - end - end - - def test_get_series - # Create test objects. - client_result = ::Google::Cloud::VisionAI::V1::Series.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_series_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::VisionAI::V1::StreamsService::Rest::ServiceStub.stub :transcode_get_series_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_series_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::StreamsService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_series({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_series name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_series ::Google::Cloud::VisionAI::V1::GetSeriesRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_series({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_series(::Google::Cloud::VisionAI::V1::GetSeriesRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_series_client_stub.call_count - end - end - end - - def test_create_series - # 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" - series_id = "hello world" - series = {} - request_id = "hello world" - - create_series_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::VisionAI::V1::StreamsService::Rest::ServiceStub.stub :transcode_create_series_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_series_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::StreamsService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_series({ parent: parent, series_id: series_id, series: series, request_id: request_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_series parent: parent, series_id: series_id, series: series, request_id: request_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_series ::Google::Cloud::VisionAI::V1::CreateSeriesRequest.new(parent: parent, series_id: series_id, series: series, request_id: request_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_series({ parent: parent, series_id: series_id, series: series, request_id: request_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_series(::Google::Cloud::VisionAI::V1::CreateSeriesRequest.new(parent: parent, series_id: series_id, series: series, request_id: request_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_series_client_stub.call_count - end - end - end - - def test_update_series - # 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. - update_mask = {} - series = {} - request_id = "hello world" - - update_series_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::VisionAI::V1::StreamsService::Rest::ServiceStub.stub :transcode_update_series_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_series_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::StreamsService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.update_series({ update_mask: update_mask, series: series, request_id: request_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.update_series update_mask: update_mask, series: series, request_id: request_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.update_series ::Google::Cloud::VisionAI::V1::UpdateSeriesRequest.new(update_mask: update_mask, series: series, request_id: request_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.update_series({ update_mask: update_mask, series: series, request_id: request_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.update_series(::Google::Cloud::VisionAI::V1::UpdateSeriesRequest.new(update_mask: update_mask, series: series, request_id: request_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, update_series_client_stub.call_count - end - end - end - - def test_delete_series - # 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" - request_id = "hello world" - - delete_series_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::VisionAI::V1::StreamsService::Rest::ServiceStub.stub :transcode_delete_series_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_series_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::StreamsService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.delete_series({ name: name, request_id: request_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.delete_series name: name, request_id: request_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.delete_series ::Google::Cloud::VisionAI::V1::DeleteSeriesRequest.new(name: name, request_id: request_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.delete_series({ name: name, request_id: request_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.delete_series(::Google::Cloud::VisionAI::V1::DeleteSeriesRequest.new(name: name, request_id: request_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, delete_series_client_stub.call_count - end - end - end - - def test_materialize_channel - # 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" - channel_id = "hello world" - channel = {} - request_id = "hello world" - - materialize_channel_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::VisionAI::V1::StreamsService::Rest::ServiceStub.stub :transcode_materialize_channel_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, materialize_channel_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::StreamsService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.materialize_channel({ parent: parent, channel_id: channel_id, channel: channel, request_id: request_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.materialize_channel parent: parent, channel_id: channel_id, channel: channel, request_id: request_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.materialize_channel ::Google::Cloud::VisionAI::V1::MaterializeChannelRequest.new(parent: parent, channel_id: channel_id, channel: channel, request_id: request_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.materialize_channel({ parent: parent, channel_id: channel_id, channel: channel, request_id: request_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.materialize_channel(::Google::Cloud::VisionAI::V1::MaterializeChannelRequest.new(parent: parent, channel_id: channel_id, channel: channel, request_id: request_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, materialize_channel_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::VisionAI::V1::StreamsService::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::VisionAI::V1::StreamsService::Rest::Client::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/test/google/cloud/vision_ai/v1/streams_service_test.rb b/owl-bot-staging/google-cloud-vision_ai-v1/test/google/cloud/vision_ai/v1/streams_service_test.rb deleted file mode 100644 index 1ff94304b96e..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/test/google/cloud/vision_ai/v1/streams_service_test.rb +++ /dev/null @@ -1,1634 +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/visionai/v1/streams_service_pb" -require "google/cloud/vision_ai/v1/streams_service" - -class ::Google::Cloud::VisionAI::V1::StreamsService::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_clusters - # Create GRPC objects. - grpc_response = ::Google::Cloud::VisionAI::V1::ListClustersResponse.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_clusters_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_clusters, name - assert_kind_of ::Google::Cloud::VisionAI::V1::ListClustersRequest, 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_clusters_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::StreamsService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_clusters({ 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_clusters 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_clusters ::Google::Cloud::VisionAI::V1::ListClustersRequest.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_clusters({ 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_clusters(::Google::Cloud::VisionAI::V1::ListClustersRequest.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_clusters_client_stub.call_rpc_count - end - end - - def test_get_cluster - # Create GRPC objects. - grpc_response = ::Google::Cloud::VisionAI::V1::Cluster.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_cluster_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_cluster, name - assert_kind_of ::Google::Cloud::VisionAI::V1::GetClusterRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_cluster_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::StreamsService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_cluster({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_cluster name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_cluster ::Google::Cloud::VisionAI::V1::GetClusterRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_cluster({ 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_cluster(::Google::Cloud::VisionAI::V1::GetClusterRequest.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_cluster_client_stub.call_rpc_count - end - end - - def test_create_cluster - # 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" - cluster_id = "hello world" - cluster = {} - request_id = "hello world" - - create_cluster_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_cluster, name - assert_kind_of ::Google::Cloud::VisionAI::V1::CreateClusterRequest, request - assert_equal "hello world", request["parent"] - assert_equal "hello world", request["cluster_id"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::VisionAI::V1::Cluster), request["cluster"] - assert_equal "hello world", request["request_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_cluster_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::StreamsService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_cluster({ parent: parent, cluster_id: cluster_id, cluster: cluster, request_id: request_id }) 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_cluster parent: parent, cluster_id: cluster_id, cluster: cluster, request_id: request_id 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_cluster ::Google::Cloud::VisionAI::V1::CreateClusterRequest.new(parent: parent, cluster_id: cluster_id, cluster: cluster, request_id: request_id) 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_cluster({ parent: parent, cluster_id: cluster_id, cluster: cluster, request_id: request_id }, 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_cluster(::Google::Cloud::VisionAI::V1::CreateClusterRequest.new(parent: parent, cluster_id: cluster_id, cluster: cluster, request_id: request_id), 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_cluster_client_stub.call_rpc_count - end - end - - def test_update_cluster - # 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. - update_mask = {} - cluster = {} - request_id = "hello world" - - update_cluster_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_cluster, name - assert_kind_of ::Google::Cloud::VisionAI::V1::UpdateClusterRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::VisionAI::V1::Cluster), request["cluster"] - assert_equal "hello world", request["request_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_cluster_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::StreamsService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_cluster({ update_mask: update_mask, cluster: cluster, request_id: request_id }) 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.update_cluster update_mask: update_mask, cluster: cluster, request_id: request_id 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.update_cluster ::Google::Cloud::VisionAI::V1::UpdateClusterRequest.new(update_mask: update_mask, cluster: cluster, request_id: request_id) 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.update_cluster({ update_mask: update_mask, cluster: cluster, request_id: request_id }, 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.update_cluster(::Google::Cloud::VisionAI::V1::UpdateClusterRequest.new(update_mask: update_mask, cluster: cluster, request_id: request_id), 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, update_cluster_client_stub.call_rpc_count - end - end - - def test_delete_cluster - # 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" - request_id = "hello world" - - delete_cluster_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_cluster, name - assert_kind_of ::Google::Cloud::VisionAI::V1::DeleteClusterRequest, request - assert_equal "hello world", request["name"] - assert_equal "hello world", request["request_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_cluster_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::StreamsService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_cluster({ name: name, request_id: request_id }) 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_cluster name: name, request_id: request_id 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_cluster ::Google::Cloud::VisionAI::V1::DeleteClusterRequest.new(name: name, request_id: request_id) 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_cluster({ name: name, request_id: request_id }, 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_cluster(::Google::Cloud::VisionAI::V1::DeleteClusterRequest.new(name: name, request_id: request_id), 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_cluster_client_stub.call_rpc_count - end - end - - def test_list_streams - # Create GRPC objects. - grpc_response = ::Google::Cloud::VisionAI::V1::ListStreamsResponse.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_streams_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_streams, name - assert_kind_of ::Google::Cloud::VisionAI::V1::ListStreamsRequest, 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_streams_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::StreamsService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_streams({ 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_streams 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_streams ::Google::Cloud::VisionAI::V1::ListStreamsRequest.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_streams({ 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_streams(::Google::Cloud::VisionAI::V1::ListStreamsRequest.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_streams_client_stub.call_rpc_count - end - end - - def test_get_stream - # Create GRPC objects. - grpc_response = ::Google::Cloud::VisionAI::V1::Stream.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_stream_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_stream, name - assert_kind_of ::Google::Cloud::VisionAI::V1::GetStreamRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_stream_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::StreamsService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_stream({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_stream name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_stream ::Google::Cloud::VisionAI::V1::GetStreamRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_stream({ 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_stream(::Google::Cloud::VisionAI::V1::GetStreamRequest.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_stream_client_stub.call_rpc_count - end - end - - def test_create_stream - # 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" - stream_id = "hello world" - stream = {} - request_id = "hello world" - - create_stream_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_stream, name - assert_kind_of ::Google::Cloud::VisionAI::V1::CreateStreamRequest, request - assert_equal "hello world", request["parent"] - assert_equal "hello world", request["stream_id"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::VisionAI::V1::Stream), request["stream"] - assert_equal "hello world", request["request_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_stream_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::StreamsService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_stream({ parent: parent, stream_id: stream_id, stream: stream, request_id: request_id }) 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_stream parent: parent, stream_id: stream_id, stream: stream, request_id: request_id 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_stream ::Google::Cloud::VisionAI::V1::CreateStreamRequest.new(parent: parent, stream_id: stream_id, stream: stream, request_id: request_id) 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_stream({ parent: parent, stream_id: stream_id, stream: stream, request_id: request_id }, 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_stream(::Google::Cloud::VisionAI::V1::CreateStreamRequest.new(parent: parent, stream_id: stream_id, stream: stream, request_id: request_id), 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_stream_client_stub.call_rpc_count - end - end - - def test_update_stream - # 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. - update_mask = {} - stream = {} - request_id = "hello world" - - update_stream_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_stream, name - assert_kind_of ::Google::Cloud::VisionAI::V1::UpdateStreamRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::VisionAI::V1::Stream), request["stream"] - assert_equal "hello world", request["request_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_stream_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::StreamsService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_stream({ update_mask: update_mask, stream: stream, request_id: request_id }) 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.update_stream update_mask: update_mask, stream: stream, request_id: request_id 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.update_stream ::Google::Cloud::VisionAI::V1::UpdateStreamRequest.new(update_mask: update_mask, stream: stream, request_id: request_id) 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.update_stream({ update_mask: update_mask, stream: stream, request_id: request_id }, 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.update_stream(::Google::Cloud::VisionAI::V1::UpdateStreamRequest.new(update_mask: update_mask, stream: stream, request_id: request_id), 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, update_stream_client_stub.call_rpc_count - end - end - - def test_delete_stream - # 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" - request_id = "hello world" - - delete_stream_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_stream, name - assert_kind_of ::Google::Cloud::VisionAI::V1::DeleteStreamRequest, request - assert_equal "hello world", request["name"] - assert_equal "hello world", request["request_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_stream_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::StreamsService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_stream({ name: name, request_id: request_id }) 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_stream name: name, request_id: request_id 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_stream ::Google::Cloud::VisionAI::V1::DeleteStreamRequest.new(name: name, request_id: request_id) 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_stream({ name: name, request_id: request_id }, 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_stream(::Google::Cloud::VisionAI::V1::DeleteStreamRequest.new(name: name, request_id: request_id), 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_stream_client_stub.call_rpc_count - end - end - - def test_get_stream_thumbnail - # 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. - stream = "hello world" - gcs_object_name = "hello world" - event = "hello world" - request_id = "hello world" - - get_stream_thumbnail_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_stream_thumbnail, name - assert_kind_of ::Google::Cloud::VisionAI::V1::GetStreamThumbnailRequest, request - assert_equal "hello world", request["stream"] - assert_equal "hello world", request["gcs_object_name"] - assert_equal "hello world", request["event"] - assert_equal "hello world", request["request_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_stream_thumbnail_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::StreamsService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_stream_thumbnail({ stream: stream, gcs_object_name: gcs_object_name, event: event, request_id: request_id }) 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_stream_thumbnail stream: stream, gcs_object_name: gcs_object_name, event: event, request_id: request_id 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_stream_thumbnail ::Google::Cloud::VisionAI::V1::GetStreamThumbnailRequest.new(stream: stream, gcs_object_name: gcs_object_name, event: event, request_id: request_id) 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_stream_thumbnail({ stream: stream, gcs_object_name: gcs_object_name, event: event, request_id: request_id }, 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_stream_thumbnail(::Google::Cloud::VisionAI::V1::GetStreamThumbnailRequest.new(stream: stream, gcs_object_name: gcs_object_name, event: event, request_id: request_id), 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_stream_thumbnail_client_stub.call_rpc_count - end - end - - def test_generate_stream_hls_token - # Create GRPC objects. - grpc_response = ::Google::Cloud::VisionAI::V1::GenerateStreamHlsTokenResponse.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. - stream = "hello world" - - generate_stream_hls_token_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :generate_stream_hls_token, name - assert_kind_of ::Google::Cloud::VisionAI::V1::GenerateStreamHlsTokenRequest, request - assert_equal "hello world", request["stream"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, generate_stream_hls_token_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::StreamsService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.generate_stream_hls_token({ stream: stream }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.generate_stream_hls_token stream: stream do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.generate_stream_hls_token ::Google::Cloud::VisionAI::V1::GenerateStreamHlsTokenRequest.new(stream: stream) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.generate_stream_hls_token({ stream: stream }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.generate_stream_hls_token(::Google::Cloud::VisionAI::V1::GenerateStreamHlsTokenRequest.new(stream: stream), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, generate_stream_hls_token_client_stub.call_rpc_count - end - end - - def test_list_events - # Create GRPC objects. - grpc_response = ::Google::Cloud::VisionAI::V1::ListEventsResponse.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_events_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_events, name - assert_kind_of ::Google::Cloud::VisionAI::V1::ListEventsRequest, 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_events_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::StreamsService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_events({ 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_events 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_events ::Google::Cloud::VisionAI::V1::ListEventsRequest.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_events({ 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_events(::Google::Cloud::VisionAI::V1::ListEventsRequest.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_events_client_stub.call_rpc_count - end - end - - def test_get_event - # Create GRPC objects. - grpc_response = ::Google::Cloud::VisionAI::V1::Event.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_event_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_event, name - assert_kind_of ::Google::Cloud::VisionAI::V1::GetEventRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_event_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::StreamsService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_event({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_event name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_event ::Google::Cloud::VisionAI::V1::GetEventRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_event({ 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_event(::Google::Cloud::VisionAI::V1::GetEventRequest.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_event_client_stub.call_rpc_count - end - end - - def test_create_event - # 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" - event_id = "hello world" - event = {} - request_id = "hello world" - - create_event_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_event, name - assert_kind_of ::Google::Cloud::VisionAI::V1::CreateEventRequest, request - assert_equal "hello world", request["parent"] - assert_equal "hello world", request["event_id"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::VisionAI::V1::Event), request["event"] - assert_equal "hello world", request["request_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_event_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::StreamsService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_event({ parent: parent, event_id: event_id, event: event, request_id: request_id }) 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_event parent: parent, event_id: event_id, event: event, request_id: request_id 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_event ::Google::Cloud::VisionAI::V1::CreateEventRequest.new(parent: parent, event_id: event_id, event: event, request_id: request_id) 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_event({ parent: parent, event_id: event_id, event: event, request_id: request_id }, 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_event(::Google::Cloud::VisionAI::V1::CreateEventRequest.new(parent: parent, event_id: event_id, event: event, request_id: request_id), 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_event_client_stub.call_rpc_count - end - end - - def test_update_event - # 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. - update_mask = {} - event = {} - request_id = "hello world" - - update_event_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_event, name - assert_kind_of ::Google::Cloud::VisionAI::V1::UpdateEventRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::VisionAI::V1::Event), request["event"] - assert_equal "hello world", request["request_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_event_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::StreamsService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_event({ update_mask: update_mask, event: event, request_id: request_id }) 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.update_event update_mask: update_mask, event: event, request_id: request_id 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.update_event ::Google::Cloud::VisionAI::V1::UpdateEventRequest.new(update_mask: update_mask, event: event, request_id: request_id) 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.update_event({ update_mask: update_mask, event: event, request_id: request_id }, 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.update_event(::Google::Cloud::VisionAI::V1::UpdateEventRequest.new(update_mask: update_mask, event: event, request_id: request_id), 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, update_event_client_stub.call_rpc_count - end - end - - def test_delete_event - # 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" - request_id = "hello world" - - delete_event_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_event, name - assert_kind_of ::Google::Cloud::VisionAI::V1::DeleteEventRequest, request - assert_equal "hello world", request["name"] - assert_equal "hello world", request["request_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_event_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::StreamsService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_event({ name: name, request_id: request_id }) 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_event name: name, request_id: request_id 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_event ::Google::Cloud::VisionAI::V1::DeleteEventRequest.new(name: name, request_id: request_id) 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_event({ name: name, request_id: request_id }, 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_event(::Google::Cloud::VisionAI::V1::DeleteEventRequest.new(name: name, request_id: request_id), 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_event_client_stub.call_rpc_count - end - end - - def test_list_series - # Create GRPC objects. - grpc_response = ::Google::Cloud::VisionAI::V1::ListSeriesResponse.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_series_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_series, name - assert_kind_of ::Google::Cloud::VisionAI::V1::ListSeriesRequest, 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_series_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::StreamsService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_series({ 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_series 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_series ::Google::Cloud::VisionAI::V1::ListSeriesRequest.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_series({ 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_series(::Google::Cloud::VisionAI::V1::ListSeriesRequest.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_series_client_stub.call_rpc_count - end - end - - def test_get_series - # Create GRPC objects. - grpc_response = ::Google::Cloud::VisionAI::V1::Series.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_series_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_series, name - assert_kind_of ::Google::Cloud::VisionAI::V1::GetSeriesRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_series_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::StreamsService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_series({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_series name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_series ::Google::Cloud::VisionAI::V1::GetSeriesRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_series({ 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_series(::Google::Cloud::VisionAI::V1::GetSeriesRequest.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_series_client_stub.call_rpc_count - end - end - - def test_create_series - # 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" - series_id = "hello world" - series = {} - request_id = "hello world" - - create_series_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_series, name - assert_kind_of ::Google::Cloud::VisionAI::V1::CreateSeriesRequest, request - assert_equal "hello world", request["parent"] - assert_equal "hello world", request["series_id"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::VisionAI::V1::Series), request["series"] - assert_equal "hello world", request["request_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_series_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::StreamsService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_series({ parent: parent, series_id: series_id, series: series, request_id: request_id }) 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_series parent: parent, series_id: series_id, series: series, request_id: request_id 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_series ::Google::Cloud::VisionAI::V1::CreateSeriesRequest.new(parent: parent, series_id: series_id, series: series, request_id: request_id) 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_series({ parent: parent, series_id: series_id, series: series, request_id: request_id }, 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_series(::Google::Cloud::VisionAI::V1::CreateSeriesRequest.new(parent: parent, series_id: series_id, series: series, request_id: request_id), 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_series_client_stub.call_rpc_count - end - end - - def test_update_series - # 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. - update_mask = {} - series = {} - request_id = "hello world" - - update_series_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_series, name - assert_kind_of ::Google::Cloud::VisionAI::V1::UpdateSeriesRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::VisionAI::V1::Series), request["series"] - assert_equal "hello world", request["request_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_series_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::StreamsService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_series({ update_mask: update_mask, series: series, request_id: request_id }) 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.update_series update_mask: update_mask, series: series, request_id: request_id 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.update_series ::Google::Cloud::VisionAI::V1::UpdateSeriesRequest.new(update_mask: update_mask, series: series, request_id: request_id) 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.update_series({ update_mask: update_mask, series: series, request_id: request_id }, 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.update_series(::Google::Cloud::VisionAI::V1::UpdateSeriesRequest.new(update_mask: update_mask, series: series, request_id: request_id), 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, update_series_client_stub.call_rpc_count - end - end - - def test_delete_series - # 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" - request_id = "hello world" - - delete_series_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_series, name - assert_kind_of ::Google::Cloud::VisionAI::V1::DeleteSeriesRequest, request - assert_equal "hello world", request["name"] - assert_equal "hello world", request["request_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_series_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::StreamsService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_series({ name: name, request_id: request_id }) 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_series name: name, request_id: request_id 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_series ::Google::Cloud::VisionAI::V1::DeleteSeriesRequest.new(name: name, request_id: request_id) 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_series({ name: name, request_id: request_id }, 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_series(::Google::Cloud::VisionAI::V1::DeleteSeriesRequest.new(name: name, request_id: request_id), 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_series_client_stub.call_rpc_count - end - end - - def test_materialize_channel - # 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" - channel_id = "hello world" - channel = {} - request_id = "hello world" - - materialize_channel_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :materialize_channel, name - assert_kind_of ::Google::Cloud::VisionAI::V1::MaterializeChannelRequest, request - assert_equal "hello world", request["parent"] - assert_equal "hello world", request["channel_id"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::VisionAI::V1::Channel), request["channel"] - assert_equal "hello world", request["request_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, materialize_channel_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::StreamsService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.materialize_channel({ parent: parent, channel_id: channel_id, channel: channel, request_id: request_id }) 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.materialize_channel parent: parent, channel_id: channel_id, channel: channel, request_id: request_id 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.materialize_channel ::Google::Cloud::VisionAI::V1::MaterializeChannelRequest.new(parent: parent, channel_id: channel_id, channel: channel, request_id: request_id) 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.materialize_channel({ parent: parent, channel_id: channel_id, channel: channel, request_id: request_id }, 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.materialize_channel(::Google::Cloud::VisionAI::V1::MaterializeChannelRequest.new(parent: parent, channel_id: channel_id, channel: channel, request_id: request_id), 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, materialize_channel_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::VisionAI::V1::StreamsService::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::VisionAI::V1::StreamsService::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::VisionAI::V1::StreamsService::Client.new do |config| - config.credentials = creds - end - assert_kind_of ::Google::Cloud::VisionAI::V1::StreamsService::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::VisionAI::V1::StreamsService::Client.new do |config| - config.credentials = grpc_channel - end - end - - assert_kind_of ::Google::Cloud::VisionAI::V1::StreamsService::Operations, client.operations_client - end -end diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/test/google/cloud/vision_ai/v1/warehouse_operations_test.rb b/owl-bot-staging/google-cloud-vision_ai-v1/test/google/cloud/vision_ai/v1/warehouse_operations_test.rb deleted file mode 100644 index 7c3e8737b0a0..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/test/google/cloud/vision_ai/v1/warehouse_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/visionai/v1/warehouse_pb" -require "google/cloud/visionai/v1/warehouse_services_pb" -require "google/cloud/vision_ai/v1/warehouse" - -class ::Google::Cloud::VisionAI::V1::Warehouse::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::VisionAI::V1::Warehouse::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::VisionAI::V1::Warehouse::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::VisionAI::V1::Warehouse::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::VisionAI::V1::Warehouse::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::VisionAI::V1::Warehouse::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::VisionAI::V1::Warehouse::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::VisionAI::V1::Warehouse::Operations::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/test/google/cloud/vision_ai/v1/warehouse_paths_test.rb b/owl-bot-staging/google-cloud-vision_ai-v1/test/google/cloud/vision_ai/v1/warehouse_paths_test.rb deleted file mode 100644 index 360f337ee401..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/test/google/cloud/vision_ai/v1/warehouse_paths_test.rb +++ /dev/null @@ -1,163 +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/vision_ai/v1/warehouse" - -class ::Google::Cloud::VisionAI::V1::Warehouse::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_annotation_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::VisionAI::V1::Warehouse::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.annotation_path project_number: "value0", location: "value1", corpus: "value2", asset: "value3", annotation: "value4" - assert_equal "projects/value0/locations/value1/corpora/value2/assets/value3/annotations/value4", path - end - end - - def test_asset_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::VisionAI::V1::Warehouse::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.asset_path project_number: "value0", location: "value1", corpus: "value2", asset: "value3" - assert_equal "projects/value0/locations/value1/corpora/value2/assets/value3", path - end - end - - def test_collection_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::VisionAI::V1::Warehouse::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.collection_path project_number: "value0", location: "value1", corpus: "value2", collection: "value3" - assert_equal "projects/value0/locations/value1/corpora/value2/collections/value3", path - end - end - - def test_corpus_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::VisionAI::V1::Warehouse::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.corpus_path project_number: "value0", location: "value1", corpus: "value2" - assert_equal "projects/value0/locations/value1/corpora/value2", path - end - end - - def test_data_schema_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::VisionAI::V1::Warehouse::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.data_schema_path project_number: "value0", location: "value1", corpus: "value2", data_schema: "value3" - assert_equal "projects/value0/locations/value1/corpora/value2/dataSchemas/value3", path - end - end - - def test_index_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::VisionAI::V1::Warehouse::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.index_path project_number: "value0", location: "value1", corpus: "value2", index: "value3" - assert_equal "projects/value0/locations/value1/corpora/value2/indexes/value3", path - end - end - - def test_index_endpoint_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::VisionAI::V1::Warehouse::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.index_endpoint_path project: "value0", location: "value1", index_endpoint: "value2" - assert_equal "projects/value0/locations/value1/indexEndpoints/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::VisionAI::V1::Warehouse::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_search_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::VisionAI::V1::Warehouse::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.search_config_path project_number: "value0", location: "value1", corpus: "value2", search_config: "value3" - assert_equal "projects/value0/locations/value1/corpora/value2/searchConfigs/value3", path - end - end - - def test_search_hypernym_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::VisionAI::V1::Warehouse::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.search_hypernym_path project_number: "value0", location: "value1", corpus: "value2", search_hypernym: "value3" - assert_equal "projects/value0/locations/value1/corpora/value2/searchHypernyms/value3", path - end - end -end diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/test/google/cloud/vision_ai/v1/warehouse_rest_test.rb b/owl-bot-staging/google-cloud-vision_ai-v1/test/google/cloud/vision_ai/v1/warehouse_rest_test.rb deleted file mode 100644 index 3ec5308b7cde..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/test/google/cloud/vision_ai/v1/warehouse_rest_test.rb +++ /dev/null @@ -1,3520 +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/visionai/v1/warehouse_pb" -require "google/cloud/vision_ai/v1/warehouse/rest" - - -class ::Google::Cloud::VisionAI::V1::Warehouse::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_asset - # Create test objects. - client_result = ::Google::Cloud::VisionAI::V1::Asset.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - asset = {} - asset_id = "hello world" - - create_asset_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::VisionAI::V1::Warehouse::Rest::ServiceStub.stub :transcode_create_asset_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_asset_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_asset({ parent: parent, asset: asset, asset_id: asset_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_asset parent: parent, asset: asset, asset_id: asset_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_asset ::Google::Cloud::VisionAI::V1::CreateAssetRequest.new(parent: parent, asset: asset, asset_id: asset_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_asset({ parent: parent, asset: asset, asset_id: asset_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_asset(::Google::Cloud::VisionAI::V1::CreateAssetRequest.new(parent: parent, asset: asset, asset_id: asset_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_asset_client_stub.call_count - end - end - end - - def test_update_asset - # Create test objects. - client_result = ::Google::Cloud::VisionAI::V1::Asset.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - asset = {} - update_mask = {} - - update_asset_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::VisionAI::V1::Warehouse::Rest::ServiceStub.stub :transcode_update_asset_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_asset_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.update_asset({ asset: asset, update_mask: update_mask }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.update_asset asset: asset, update_mask: update_mask do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.update_asset ::Google::Cloud::VisionAI::V1::UpdateAssetRequest.new(asset: asset, update_mask: update_mask) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.update_asset({ asset: asset, update_mask: update_mask }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.update_asset(::Google::Cloud::VisionAI::V1::UpdateAssetRequest.new(asset: asset, update_mask: update_mask), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, update_asset_client_stub.call_count - end - end - end - - def test_get_asset - # Create test objects. - client_result = ::Google::Cloud::VisionAI::V1::Asset.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_asset_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::VisionAI::V1::Warehouse::Rest::ServiceStub.stub :transcode_get_asset_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_asset_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_asset({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_asset name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_asset ::Google::Cloud::VisionAI::V1::GetAssetRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_asset({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_asset(::Google::Cloud::VisionAI::V1::GetAssetRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_asset_client_stub.call_count - end - end - end - - def test_list_assets - # Create test objects. - client_result = ::Google::Cloud::VisionAI::V1::ListAssetsResponse.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_assets_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::VisionAI::V1::Warehouse::Rest::ServiceStub.stub :transcode_list_assets_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_assets_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_assets({ 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_assets 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_assets ::Google::Cloud::VisionAI::V1::ListAssetsRequest.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_assets({ 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_assets(::Google::Cloud::VisionAI::V1::ListAssetsRequest.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_assets_client_stub.call_count - end - end - end - - def test_delete_asset - # 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_asset_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::VisionAI::V1::Warehouse::Rest::ServiceStub.stub :transcode_delete_asset_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_asset_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.delete_asset({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.delete_asset name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.delete_asset ::Google::Cloud::VisionAI::V1::DeleteAssetRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.delete_asset({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.delete_asset(::Google::Cloud::VisionAI::V1::DeleteAssetRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, delete_asset_client_stub.call_count - end - end - end - - def test_upload_asset - # 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" - asset_source = {} - - upload_asset_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::VisionAI::V1::Warehouse::Rest::ServiceStub.stub :transcode_upload_asset_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, upload_asset_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.upload_asset({ name: name, asset_source: asset_source }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.upload_asset name: name, asset_source: asset_source do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.upload_asset ::Google::Cloud::VisionAI::V1::UploadAssetRequest.new(name: name, asset_source: asset_source) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.upload_asset({ name: name, asset_source: asset_source }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.upload_asset(::Google::Cloud::VisionAI::V1::UploadAssetRequest.new(name: name, asset_source: asset_source), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, upload_asset_client_stub.call_count - end - end - end - - def test_generate_retrieval_url - # Create test objects. - client_result = ::Google::Cloud::VisionAI::V1::GenerateRetrievalUrlResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - generate_retrieval_url_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::VisionAI::V1::Warehouse::Rest::ServiceStub.stub :transcode_generate_retrieval_url_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, generate_retrieval_url_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.generate_retrieval_url({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.generate_retrieval_url name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.generate_retrieval_url ::Google::Cloud::VisionAI::V1::GenerateRetrievalUrlRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.generate_retrieval_url({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.generate_retrieval_url(::Google::Cloud::VisionAI::V1::GenerateRetrievalUrlRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, generate_retrieval_url_client_stub.call_count - end - end - end - - def test_analyze_asset - # 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" - - analyze_asset_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::VisionAI::V1::Warehouse::Rest::ServiceStub.stub :transcode_analyze_asset_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, analyze_asset_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.analyze_asset({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.analyze_asset name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.analyze_asset ::Google::Cloud::VisionAI::V1::AnalyzeAssetRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.analyze_asset({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.analyze_asset(::Google::Cloud::VisionAI::V1::AnalyzeAssetRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, analyze_asset_client_stub.call_count - end - end - end - - def test_index_asset - # 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" - index = "hello world" - - index_asset_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::VisionAI::V1::Warehouse::Rest::ServiceStub.stub :transcode_index_asset_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, index_asset_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.index_asset({ name: name, index: index }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.index_asset name: name, index: index do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.index_asset ::Google::Cloud::VisionAI::V1::IndexAssetRequest.new(name: name, index: index) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.index_asset({ name: name, index: index }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.index_asset(::Google::Cloud::VisionAI::V1::IndexAssetRequest.new(name: name, index: index), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, index_asset_client_stub.call_count - end - end - end - - def test_remove_index_asset - # 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" - index = "hello world" - - remove_index_asset_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::VisionAI::V1::Warehouse::Rest::ServiceStub.stub :transcode_remove_index_asset_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, remove_index_asset_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.remove_index_asset({ name: name, index: index }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.remove_index_asset name: name, index: index do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.remove_index_asset ::Google::Cloud::VisionAI::V1::RemoveIndexAssetRequest.new(name: name, index: index) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.remove_index_asset({ name: name, index: index }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.remove_index_asset(::Google::Cloud::VisionAI::V1::RemoveIndexAssetRequest.new(name: name, index: index), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, remove_index_asset_client_stub.call_count - end - end - end - - def test_view_indexed_assets - # Create test objects. - client_result = ::Google::Cloud::VisionAI::V1::ViewIndexedAssetsResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - index = "hello world" - page_size = 42 - page_token = "hello world" - filter = "hello world" - - view_indexed_assets_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::VisionAI::V1::Warehouse::Rest::ServiceStub.stub :transcode_view_indexed_assets_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, view_indexed_assets_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.view_indexed_assets({ index: index, 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.view_indexed_assets index: index, 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.view_indexed_assets ::Google::Cloud::VisionAI::V1::ViewIndexedAssetsRequest.new(index: index, 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.view_indexed_assets({ index: index, 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.view_indexed_assets(::Google::Cloud::VisionAI::V1::ViewIndexedAssetsRequest.new(index: index, 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, view_indexed_assets_client_stub.call_count - end - end - end - - def test_create_index - # 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" - index_id = "hello world" - index = {} - - create_index_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::VisionAI::V1::Warehouse::Rest::ServiceStub.stub :transcode_create_index_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_index_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_index({ parent: parent, index_id: index_id, index: index }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_index parent: parent, index_id: index_id, index: index do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_index ::Google::Cloud::VisionAI::V1::CreateIndexRequest.new(parent: parent, index_id: index_id, index: index) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_index({ parent: parent, index_id: index_id, index: index }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_index(::Google::Cloud::VisionAI::V1::CreateIndexRequest.new(parent: parent, index_id: index_id, index: index), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_index_client_stub.call_count - end - end - end - - def test_update_index - # 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. - index = {} - update_mask = {} - - update_index_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::VisionAI::V1::Warehouse::Rest::ServiceStub.stub :transcode_update_index_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_index_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.update_index({ index: index, update_mask: update_mask }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.update_index index: index, update_mask: update_mask do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.update_index ::Google::Cloud::VisionAI::V1::UpdateIndexRequest.new(index: index, update_mask: update_mask) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.update_index({ index: index, update_mask: update_mask }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.update_index(::Google::Cloud::VisionAI::V1::UpdateIndexRequest.new(index: index, update_mask: update_mask), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, update_index_client_stub.call_count - end - end - end - - def test_get_index - # Create test objects. - client_result = ::Google::Cloud::VisionAI::V1::Index.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_index_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::VisionAI::V1::Warehouse::Rest::ServiceStub.stub :transcode_get_index_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_index_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_index({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_index name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_index ::Google::Cloud::VisionAI::V1::GetIndexRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_index({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_index(::Google::Cloud::VisionAI::V1::GetIndexRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_index_client_stub.call_count - end - end - end - - def test_list_indexes - # Create test objects. - client_result = ::Google::Cloud::VisionAI::V1::ListIndexesResponse.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_indexes_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::VisionAI::V1::Warehouse::Rest::ServiceStub.stub :transcode_list_indexes_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_indexes_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_indexes({ 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_indexes 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_indexes ::Google::Cloud::VisionAI::V1::ListIndexesRequest.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_indexes({ 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_indexes(::Google::Cloud::VisionAI::V1::ListIndexesRequest.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_indexes_client_stub.call_count - end - end - end - - def test_delete_index - # 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_index_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::VisionAI::V1::Warehouse::Rest::ServiceStub.stub :transcode_delete_index_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_index_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.delete_index({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.delete_index name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.delete_index ::Google::Cloud::VisionAI::V1::DeleteIndexRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.delete_index({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.delete_index(::Google::Cloud::VisionAI::V1::DeleteIndexRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, delete_index_client_stub.call_count - end - end - end - - def test_create_corpus - # 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" - corpus = {} - - create_corpus_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::VisionAI::V1::Warehouse::Rest::ServiceStub.stub :transcode_create_corpus_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_corpus_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_corpus({ parent: parent, corpus: corpus }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_corpus parent: parent, corpus: corpus do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_corpus ::Google::Cloud::VisionAI::V1::CreateCorpusRequest.new(parent: parent, corpus: corpus) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_corpus({ parent: parent, corpus: corpus }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_corpus(::Google::Cloud::VisionAI::V1::CreateCorpusRequest.new(parent: parent, corpus: corpus), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_corpus_client_stub.call_count - end - end - end - - def test_get_corpus - # Create test objects. - client_result = ::Google::Cloud::VisionAI::V1::Corpus.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_corpus_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::VisionAI::V1::Warehouse::Rest::ServiceStub.stub :transcode_get_corpus_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_corpus_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_corpus({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_corpus name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_corpus ::Google::Cloud::VisionAI::V1::GetCorpusRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_corpus({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_corpus(::Google::Cloud::VisionAI::V1::GetCorpusRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_corpus_client_stub.call_count - end - end - end - - def test_update_corpus - # Create test objects. - client_result = ::Google::Cloud::VisionAI::V1::Corpus.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - corpus = {} - update_mask = {} - - update_corpus_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::VisionAI::V1::Warehouse::Rest::ServiceStub.stub :transcode_update_corpus_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_corpus_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.update_corpus({ corpus: corpus, update_mask: update_mask }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.update_corpus corpus: corpus, update_mask: update_mask do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.update_corpus ::Google::Cloud::VisionAI::V1::UpdateCorpusRequest.new(corpus: corpus, update_mask: update_mask) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.update_corpus({ corpus: corpus, update_mask: update_mask }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.update_corpus(::Google::Cloud::VisionAI::V1::UpdateCorpusRequest.new(corpus: corpus, update_mask: update_mask), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, update_corpus_client_stub.call_count - end - end - end - - def test_list_corpora - # Create test objects. - client_result = ::Google::Cloud::VisionAI::V1::ListCorporaResponse.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_corpora_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::VisionAI::V1::Warehouse::Rest::ServiceStub.stub :transcode_list_corpora_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_corpora_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_corpora({ 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_corpora 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_corpora ::Google::Cloud::VisionAI::V1::ListCorporaRequest.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_corpora({ 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_corpora(::Google::Cloud::VisionAI::V1::ListCorporaRequest.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_corpora_client_stub.call_count - end - end - end - - def test_delete_corpus - # 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_corpus_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::VisionAI::V1::Warehouse::Rest::ServiceStub.stub :transcode_delete_corpus_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_corpus_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.delete_corpus({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.delete_corpus name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.delete_corpus ::Google::Cloud::VisionAI::V1::DeleteCorpusRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.delete_corpus({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.delete_corpus(::Google::Cloud::VisionAI::V1::DeleteCorpusRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, delete_corpus_client_stub.call_count - end - end - end - - def test_analyze_corpus - # 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" - - analyze_corpus_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::VisionAI::V1::Warehouse::Rest::ServiceStub.stub :transcode_analyze_corpus_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, analyze_corpus_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.analyze_corpus({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.analyze_corpus name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.analyze_corpus ::Google::Cloud::VisionAI::V1::AnalyzeCorpusRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.analyze_corpus({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.analyze_corpus(::Google::Cloud::VisionAI::V1::AnalyzeCorpusRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, analyze_corpus_client_stub.call_count - end - end - end - - def test_create_data_schema - # Create test objects. - client_result = ::Google::Cloud::VisionAI::V1::DataSchema.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - data_schema = {} - - create_data_schema_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::VisionAI::V1::Warehouse::Rest::ServiceStub.stub :transcode_create_data_schema_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_data_schema_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_data_schema({ parent: parent, data_schema: data_schema }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_data_schema parent: parent, data_schema: data_schema do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_data_schema ::Google::Cloud::VisionAI::V1::CreateDataSchemaRequest.new(parent: parent, data_schema: data_schema) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_data_schema({ parent: parent, data_schema: data_schema }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_data_schema(::Google::Cloud::VisionAI::V1::CreateDataSchemaRequest.new(parent: parent, data_schema: data_schema), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_data_schema_client_stub.call_count - end - end - end - - def test_update_data_schema - # Create test objects. - client_result = ::Google::Cloud::VisionAI::V1::DataSchema.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - data_schema = {} - update_mask = {} - - update_data_schema_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::VisionAI::V1::Warehouse::Rest::ServiceStub.stub :transcode_update_data_schema_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_data_schema_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.update_data_schema({ data_schema: data_schema, update_mask: update_mask }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.update_data_schema data_schema: data_schema, update_mask: update_mask do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.update_data_schema ::Google::Cloud::VisionAI::V1::UpdateDataSchemaRequest.new(data_schema: data_schema, update_mask: update_mask) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.update_data_schema({ data_schema: data_schema, update_mask: update_mask }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.update_data_schema(::Google::Cloud::VisionAI::V1::UpdateDataSchemaRequest.new(data_schema: data_schema, update_mask: update_mask), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, update_data_schema_client_stub.call_count - end - end - end - - def test_get_data_schema - # Create test objects. - client_result = ::Google::Cloud::VisionAI::V1::DataSchema.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_data_schema_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::VisionAI::V1::Warehouse::Rest::ServiceStub.stub :transcode_get_data_schema_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_data_schema_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_data_schema({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_data_schema name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_data_schema ::Google::Cloud::VisionAI::V1::GetDataSchemaRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_data_schema({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_data_schema(::Google::Cloud::VisionAI::V1::GetDataSchemaRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_data_schema_client_stub.call_count - end - end - end - - def test_delete_data_schema - # 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_data_schema_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::VisionAI::V1::Warehouse::Rest::ServiceStub.stub :transcode_delete_data_schema_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_data_schema_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.delete_data_schema({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.delete_data_schema name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.delete_data_schema ::Google::Cloud::VisionAI::V1::DeleteDataSchemaRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.delete_data_schema({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.delete_data_schema(::Google::Cloud::VisionAI::V1::DeleteDataSchemaRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, delete_data_schema_client_stub.call_count - end - end - end - - def test_list_data_schemas - # Create test objects. - client_result = ::Google::Cloud::VisionAI::V1::ListDataSchemasResponse.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_data_schemas_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::VisionAI::V1::Warehouse::Rest::ServiceStub.stub :transcode_list_data_schemas_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_data_schemas_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_data_schemas({ 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_data_schemas 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_data_schemas ::Google::Cloud::VisionAI::V1::ListDataSchemasRequest.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_data_schemas({ 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_data_schemas(::Google::Cloud::VisionAI::V1::ListDataSchemasRequest.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_data_schemas_client_stub.call_count - end - end - end - - def test_create_annotation - # Create test objects. - client_result = ::Google::Cloud::VisionAI::V1::Annotation.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - annotation = {} - annotation_id = "hello world" - - create_annotation_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::VisionAI::V1::Warehouse::Rest::ServiceStub.stub :transcode_create_annotation_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_annotation_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_annotation({ parent: parent, annotation: annotation, annotation_id: annotation_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_annotation parent: parent, annotation: annotation, annotation_id: annotation_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_annotation ::Google::Cloud::VisionAI::V1::CreateAnnotationRequest.new(parent: parent, annotation: annotation, annotation_id: annotation_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_annotation({ parent: parent, annotation: annotation, annotation_id: annotation_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_annotation(::Google::Cloud::VisionAI::V1::CreateAnnotationRequest.new(parent: parent, annotation: annotation, annotation_id: annotation_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_annotation_client_stub.call_count - end - end - end - - def test_get_annotation - # Create test objects. - client_result = ::Google::Cloud::VisionAI::V1::Annotation.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_annotation_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::VisionAI::V1::Warehouse::Rest::ServiceStub.stub :transcode_get_annotation_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_annotation_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_annotation({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_annotation name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_annotation ::Google::Cloud::VisionAI::V1::GetAnnotationRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_annotation({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_annotation(::Google::Cloud::VisionAI::V1::GetAnnotationRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_annotation_client_stub.call_count - end - end - end - - def test_list_annotations - # Create test objects. - client_result = ::Google::Cloud::VisionAI::V1::ListAnnotationsResponse.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_annotations_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::VisionAI::V1::Warehouse::Rest::ServiceStub.stub :transcode_list_annotations_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_annotations_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_annotations({ 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_annotations 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_annotations ::Google::Cloud::VisionAI::V1::ListAnnotationsRequest.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_annotations({ 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_annotations(::Google::Cloud::VisionAI::V1::ListAnnotationsRequest.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_annotations_client_stub.call_count - end - end - end - - def test_update_annotation - # Create test objects. - client_result = ::Google::Cloud::VisionAI::V1::Annotation.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - annotation = {} - update_mask = {} - - update_annotation_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::VisionAI::V1::Warehouse::Rest::ServiceStub.stub :transcode_update_annotation_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_annotation_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.update_annotation({ annotation: annotation, update_mask: update_mask }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.update_annotation annotation: annotation, update_mask: update_mask do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.update_annotation ::Google::Cloud::VisionAI::V1::UpdateAnnotationRequest.new(annotation: annotation, update_mask: update_mask) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.update_annotation({ annotation: annotation, update_mask: update_mask }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.update_annotation(::Google::Cloud::VisionAI::V1::UpdateAnnotationRequest.new(annotation: annotation, update_mask: update_mask), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, update_annotation_client_stub.call_count - end - end - end - - def test_delete_annotation - # 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_annotation_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::VisionAI::V1::Warehouse::Rest::ServiceStub.stub :transcode_delete_annotation_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_annotation_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.delete_annotation({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.delete_annotation name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.delete_annotation ::Google::Cloud::VisionAI::V1::DeleteAnnotationRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.delete_annotation({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.delete_annotation(::Google::Cloud::VisionAI::V1::DeleteAnnotationRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, delete_annotation_client_stub.call_count - end - end - end - - def test_clip_asset - # Create test objects. - client_result = ::Google::Cloud::VisionAI::V1::ClipAssetResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - temporal_partition = {} - - clip_asset_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::VisionAI::V1::Warehouse::Rest::ServiceStub.stub :transcode_clip_asset_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, clip_asset_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.clip_asset({ name: name, temporal_partition: temporal_partition }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.clip_asset name: name, temporal_partition: temporal_partition do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.clip_asset ::Google::Cloud::VisionAI::V1::ClipAssetRequest.new(name: name, temporal_partition: temporal_partition) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.clip_asset({ name: name, temporal_partition: temporal_partition }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.clip_asset(::Google::Cloud::VisionAI::V1::ClipAssetRequest.new(name: name, temporal_partition: temporal_partition), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, clip_asset_client_stub.call_count - end - end - end - - def test_generate_hls_uri - # Create test objects. - client_result = ::Google::Cloud::VisionAI::V1::GenerateHlsUriResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - temporal_partitions = [{}] - live_view_enabled = true - - generate_hls_uri_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::VisionAI::V1::Warehouse::Rest::ServiceStub.stub :transcode_generate_hls_uri_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, generate_hls_uri_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.generate_hls_uri({ name: name, temporal_partitions: temporal_partitions, live_view_enabled: live_view_enabled }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.generate_hls_uri name: name, temporal_partitions: temporal_partitions, live_view_enabled: live_view_enabled do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.generate_hls_uri ::Google::Cloud::VisionAI::V1::GenerateHlsUriRequest.new(name: name, temporal_partitions: temporal_partitions, live_view_enabled: live_view_enabled) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.generate_hls_uri({ name: name, temporal_partitions: temporal_partitions, live_view_enabled: live_view_enabled }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.generate_hls_uri(::Google::Cloud::VisionAI::V1::GenerateHlsUriRequest.new(name: name, temporal_partitions: temporal_partitions, live_view_enabled: live_view_enabled), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, generate_hls_uri_client_stub.call_count - end - end - end - - def test_import_assets - # 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. - assets_gcs_uri = "hello world" - parent = "hello world" - - import_assets_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::VisionAI::V1::Warehouse::Rest::ServiceStub.stub :transcode_import_assets_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, import_assets_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.import_assets({ assets_gcs_uri: assets_gcs_uri, parent: parent }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.import_assets assets_gcs_uri: assets_gcs_uri, parent: parent do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.import_assets ::Google::Cloud::VisionAI::V1::ImportAssetsRequest.new(assets_gcs_uri: assets_gcs_uri, parent: parent) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.import_assets({ assets_gcs_uri: assets_gcs_uri, parent: parent }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.import_assets(::Google::Cloud::VisionAI::V1::ImportAssetsRequest.new(assets_gcs_uri: assets_gcs_uri, parent: parent), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, import_assets_client_stub.call_count - end - end - end - - def test_create_search_config - # Create test objects. - client_result = ::Google::Cloud::VisionAI::V1::SearchConfig.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - search_config = {} - search_config_id = "hello world" - - create_search_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::VisionAI::V1::Warehouse::Rest::ServiceStub.stub :transcode_create_search_config_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_search_config_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_search_config({ parent: parent, search_config: search_config, search_config_id: search_config_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_search_config parent: parent, search_config: search_config, search_config_id: search_config_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_search_config ::Google::Cloud::VisionAI::V1::CreateSearchConfigRequest.new(parent: parent, search_config: search_config, search_config_id: search_config_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_search_config({ parent: parent, search_config: search_config, search_config_id: search_config_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_search_config(::Google::Cloud::VisionAI::V1::CreateSearchConfigRequest.new(parent: parent, search_config: search_config, search_config_id: search_config_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_search_config_client_stub.call_count - end - end - end - - def test_update_search_config - # Create test objects. - client_result = ::Google::Cloud::VisionAI::V1::SearchConfig.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - search_config = {} - update_mask = {} - - update_search_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::VisionAI::V1::Warehouse::Rest::ServiceStub.stub :transcode_update_search_config_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_search_config_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.update_search_config({ search_config: search_config, update_mask: update_mask }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.update_search_config search_config: search_config, update_mask: update_mask do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.update_search_config ::Google::Cloud::VisionAI::V1::UpdateSearchConfigRequest.new(search_config: search_config, update_mask: update_mask) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.update_search_config({ search_config: search_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_search_config(::Google::Cloud::VisionAI::V1::UpdateSearchConfigRequest.new(search_config: search_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_search_config_client_stub.call_count - end - end - end - - def test_get_search_config - # Create test objects. - client_result = ::Google::Cloud::VisionAI::V1::SearchConfig.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_search_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::VisionAI::V1::Warehouse::Rest::ServiceStub.stub :transcode_get_search_config_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_search_config_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_search_config({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_search_config name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_search_config ::Google::Cloud::VisionAI::V1::GetSearchConfigRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_search_config({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_search_config(::Google::Cloud::VisionAI::V1::GetSearchConfigRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_search_config_client_stub.call_count - end - end - end - - def test_delete_search_config - # 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_search_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::VisionAI::V1::Warehouse::Rest::ServiceStub.stub :transcode_delete_search_config_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_search_config_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.delete_search_config({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.delete_search_config name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.delete_search_config ::Google::Cloud::VisionAI::V1::DeleteSearchConfigRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.delete_search_config({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.delete_search_config(::Google::Cloud::VisionAI::V1::DeleteSearchConfigRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, delete_search_config_client_stub.call_count - end - end - end - - def test_list_search_configs - # Create test objects. - client_result = ::Google::Cloud::VisionAI::V1::ListSearchConfigsResponse.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_search_configs_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::VisionAI::V1::Warehouse::Rest::ServiceStub.stub :transcode_list_search_configs_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_search_configs_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_search_configs({ 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_search_configs 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_search_configs ::Google::Cloud::VisionAI::V1::ListSearchConfigsRequest.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_search_configs({ 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_search_configs(::Google::Cloud::VisionAI::V1::ListSearchConfigsRequest.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_search_configs_client_stub.call_count - end - end - end - - def test_create_search_hypernym - # Create test objects. - client_result = ::Google::Cloud::VisionAI::V1::SearchHypernym.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - search_hypernym = {} - search_hypernym_id = "hello world" - - create_search_hypernym_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::VisionAI::V1::Warehouse::Rest::ServiceStub.stub :transcode_create_search_hypernym_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_search_hypernym_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_search_hypernym({ parent: parent, search_hypernym: search_hypernym, search_hypernym_id: search_hypernym_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_search_hypernym parent: parent, search_hypernym: search_hypernym, search_hypernym_id: search_hypernym_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_search_hypernym ::Google::Cloud::VisionAI::V1::CreateSearchHypernymRequest.new(parent: parent, search_hypernym: search_hypernym, search_hypernym_id: search_hypernym_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_search_hypernym({ parent: parent, search_hypernym: search_hypernym, search_hypernym_id: search_hypernym_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_search_hypernym(::Google::Cloud::VisionAI::V1::CreateSearchHypernymRequest.new(parent: parent, search_hypernym: search_hypernym, search_hypernym_id: search_hypernym_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_search_hypernym_client_stub.call_count - end - end - end - - def test_update_search_hypernym - # Create test objects. - client_result = ::Google::Cloud::VisionAI::V1::SearchHypernym.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - search_hypernym = {} - update_mask = {} - - update_search_hypernym_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::VisionAI::V1::Warehouse::Rest::ServiceStub.stub :transcode_update_search_hypernym_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_search_hypernym_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.update_search_hypernym({ search_hypernym: search_hypernym, update_mask: update_mask }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.update_search_hypernym search_hypernym: search_hypernym, update_mask: update_mask do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.update_search_hypernym ::Google::Cloud::VisionAI::V1::UpdateSearchHypernymRequest.new(search_hypernym: search_hypernym, update_mask: update_mask) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.update_search_hypernym({ search_hypernym: search_hypernym, update_mask: update_mask }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.update_search_hypernym(::Google::Cloud::VisionAI::V1::UpdateSearchHypernymRequest.new(search_hypernym: search_hypernym, update_mask: update_mask), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, update_search_hypernym_client_stub.call_count - end - end - end - - def test_get_search_hypernym - # Create test objects. - client_result = ::Google::Cloud::VisionAI::V1::SearchHypernym.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_search_hypernym_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::VisionAI::V1::Warehouse::Rest::ServiceStub.stub :transcode_get_search_hypernym_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_search_hypernym_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_search_hypernym({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_search_hypernym name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_search_hypernym ::Google::Cloud::VisionAI::V1::GetSearchHypernymRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_search_hypernym({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_search_hypernym(::Google::Cloud::VisionAI::V1::GetSearchHypernymRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_search_hypernym_client_stub.call_count - end - end - end - - def test_delete_search_hypernym - # 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_search_hypernym_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::VisionAI::V1::Warehouse::Rest::ServiceStub.stub :transcode_delete_search_hypernym_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_search_hypernym_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.delete_search_hypernym({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.delete_search_hypernym name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.delete_search_hypernym ::Google::Cloud::VisionAI::V1::DeleteSearchHypernymRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.delete_search_hypernym({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.delete_search_hypernym(::Google::Cloud::VisionAI::V1::DeleteSearchHypernymRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, delete_search_hypernym_client_stub.call_count - end - end - end - - def test_list_search_hypernyms - # Create test objects. - client_result = ::Google::Cloud::VisionAI::V1::ListSearchHypernymsResponse.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_search_hypernyms_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::VisionAI::V1::Warehouse::Rest::ServiceStub.stub :transcode_list_search_hypernyms_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_search_hypernyms_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_search_hypernyms({ 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_search_hypernyms 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_search_hypernyms ::Google::Cloud::VisionAI::V1::ListSearchHypernymsRequest.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_search_hypernyms({ 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_search_hypernyms(::Google::Cloud::VisionAI::V1::ListSearchHypernymsRequest.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_search_hypernyms_client_stub.call_count - end - end - end - - def test_search_assets - # Create test objects. - client_result = ::Google::Cloud::VisionAI::V1::SearchAssetsResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - schema_key_sorting_strategy = {} - corpus = "hello world" - page_size = 42 - page_token = "hello world" - content_time_ranges = {} - criteria = [{}] - facet_selections = [{}] - result_annotation_keys = ["hello world"] - search_query = "hello world" - - search_assets_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::VisionAI::V1::Warehouse::Rest::ServiceStub.stub :transcode_search_assets_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, search_assets_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.search_assets({ schema_key_sorting_strategy: schema_key_sorting_strategy, corpus: corpus, page_size: page_size, page_token: page_token, content_time_ranges: content_time_ranges, criteria: criteria, facet_selections: facet_selections, result_annotation_keys: result_annotation_keys, search_query: search_query }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.search_assets schema_key_sorting_strategy: schema_key_sorting_strategy, corpus: corpus, page_size: page_size, page_token: page_token, content_time_ranges: content_time_ranges, criteria: criteria, facet_selections: facet_selections, result_annotation_keys: result_annotation_keys, search_query: search_query do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.search_assets ::Google::Cloud::VisionAI::V1::SearchAssetsRequest.new(schema_key_sorting_strategy: schema_key_sorting_strategy, corpus: corpus, page_size: page_size, page_token: page_token, content_time_ranges: content_time_ranges, criteria: criteria, facet_selections: facet_selections, result_annotation_keys: result_annotation_keys, search_query: search_query) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.search_assets({ schema_key_sorting_strategy: schema_key_sorting_strategy, corpus: corpus, page_size: page_size, page_token: page_token, content_time_ranges: content_time_ranges, criteria: criteria, facet_selections: facet_selections, result_annotation_keys: result_annotation_keys, search_query: search_query }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.search_assets(::Google::Cloud::VisionAI::V1::SearchAssetsRequest.new(schema_key_sorting_strategy: schema_key_sorting_strategy, corpus: corpus, page_size: page_size, page_token: page_token, content_time_ranges: content_time_ranges, criteria: criteria, facet_selections: facet_selections, result_annotation_keys: result_annotation_keys, search_query: search_query), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, search_assets_client_stub.call_count - end - end - end - - def test_search_index_endpoint - # Create test objects. - client_result = ::Google::Cloud::VisionAI::V1::SearchIndexEndpointResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - image_query = {} - index_endpoint = "hello world" - criteria = [{}] - exclusion_criteria = [{}] - page_size = 42 - page_token = "hello world" - - search_index_endpoint_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::VisionAI::V1::Warehouse::Rest::ServiceStub.stub :transcode_search_index_endpoint_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, search_index_endpoint_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.search_index_endpoint({ image_query: image_query, index_endpoint: index_endpoint, criteria: criteria, exclusion_criteria: exclusion_criteria, page_size: page_size, page_token: page_token }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.search_index_endpoint image_query: image_query, index_endpoint: index_endpoint, criteria: criteria, exclusion_criteria: exclusion_criteria, page_size: page_size, page_token: page_token do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.search_index_endpoint ::Google::Cloud::VisionAI::V1::SearchIndexEndpointRequest.new(image_query: image_query, index_endpoint: index_endpoint, criteria: criteria, exclusion_criteria: exclusion_criteria, 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.search_index_endpoint({ image_query: image_query, index_endpoint: index_endpoint, criteria: criteria, exclusion_criteria: exclusion_criteria, 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.search_index_endpoint(::Google::Cloud::VisionAI::V1::SearchIndexEndpointRequest.new(image_query: image_query, index_endpoint: index_endpoint, criteria: criteria, exclusion_criteria: exclusion_criteria, 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, search_index_endpoint_client_stub.call_count - end - end - end - - def test_create_index_endpoint - # 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" - index_endpoint_id = "hello world" - index_endpoint = {} - - create_index_endpoint_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::VisionAI::V1::Warehouse::Rest::ServiceStub.stub :transcode_create_index_endpoint_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_index_endpoint_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_index_endpoint({ parent: parent, index_endpoint_id: index_endpoint_id, index_endpoint: index_endpoint }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_index_endpoint parent: parent, index_endpoint_id: index_endpoint_id, index_endpoint: index_endpoint do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_index_endpoint ::Google::Cloud::VisionAI::V1::CreateIndexEndpointRequest.new(parent: parent, index_endpoint_id: index_endpoint_id, index_endpoint: index_endpoint) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_index_endpoint({ parent: parent, index_endpoint_id: index_endpoint_id, index_endpoint: index_endpoint }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_index_endpoint(::Google::Cloud::VisionAI::V1::CreateIndexEndpointRequest.new(parent: parent, index_endpoint_id: index_endpoint_id, index_endpoint: index_endpoint), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_index_endpoint_client_stub.call_count - end - end - end - - def test_get_index_endpoint - # Create test objects. - client_result = ::Google::Cloud::VisionAI::V1::IndexEndpoint.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_index_endpoint_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::VisionAI::V1::Warehouse::Rest::ServiceStub.stub :transcode_get_index_endpoint_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_index_endpoint_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_index_endpoint({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_index_endpoint name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_index_endpoint ::Google::Cloud::VisionAI::V1::GetIndexEndpointRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_index_endpoint({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_index_endpoint(::Google::Cloud::VisionAI::V1::GetIndexEndpointRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_index_endpoint_client_stub.call_count - end - end - end - - def test_list_index_endpoints - # Create test objects. - client_result = ::Google::Cloud::VisionAI::V1::ListIndexEndpointsResponse.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_index_endpoints_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::VisionAI::V1::Warehouse::Rest::ServiceStub.stub :transcode_list_index_endpoints_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_index_endpoints_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_index_endpoints({ 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_index_endpoints 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_index_endpoints ::Google::Cloud::VisionAI::V1::ListIndexEndpointsRequest.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_index_endpoints({ 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_index_endpoints(::Google::Cloud::VisionAI::V1::ListIndexEndpointsRequest.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_index_endpoints_client_stub.call_count - end - end - end - - def test_update_index_endpoint - # 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. - index_endpoint = {} - update_mask = {} - - update_index_endpoint_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::VisionAI::V1::Warehouse::Rest::ServiceStub.stub :transcode_update_index_endpoint_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_index_endpoint_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.update_index_endpoint({ index_endpoint: index_endpoint, update_mask: update_mask }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.update_index_endpoint index_endpoint: index_endpoint, update_mask: update_mask do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.update_index_endpoint ::Google::Cloud::VisionAI::V1::UpdateIndexEndpointRequest.new(index_endpoint: index_endpoint, update_mask: update_mask) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.update_index_endpoint({ index_endpoint: index_endpoint, update_mask: update_mask }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.update_index_endpoint(::Google::Cloud::VisionAI::V1::UpdateIndexEndpointRequest.new(index_endpoint: index_endpoint, update_mask: update_mask), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, update_index_endpoint_client_stub.call_count - end - end - end - - def test_delete_index_endpoint - # 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_index_endpoint_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::VisionAI::V1::Warehouse::Rest::ServiceStub.stub :transcode_delete_index_endpoint_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_index_endpoint_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.delete_index_endpoint({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.delete_index_endpoint name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.delete_index_endpoint ::Google::Cloud::VisionAI::V1::DeleteIndexEndpointRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.delete_index_endpoint({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.delete_index_endpoint(::Google::Cloud::VisionAI::V1::DeleteIndexEndpointRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, delete_index_endpoint_client_stub.call_count - end - end - end - - def test_deploy_index - # 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. - index_endpoint = "hello world" - deployed_index = {} - - deploy_index_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::VisionAI::V1::Warehouse::Rest::ServiceStub.stub :transcode_deploy_index_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, deploy_index_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.deploy_index({ index_endpoint: index_endpoint, deployed_index: deployed_index }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.deploy_index index_endpoint: index_endpoint, deployed_index: deployed_index do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.deploy_index ::Google::Cloud::VisionAI::V1::DeployIndexRequest.new(index_endpoint: index_endpoint, deployed_index: deployed_index) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.deploy_index({ index_endpoint: index_endpoint, deployed_index: deployed_index }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.deploy_index(::Google::Cloud::VisionAI::V1::DeployIndexRequest.new(index_endpoint: index_endpoint, deployed_index: deployed_index), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, deploy_index_client_stub.call_count - end - end - end - - def test_undeploy_index - # 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. - index_endpoint = "hello world" - - undeploy_index_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::VisionAI::V1::Warehouse::Rest::ServiceStub.stub :transcode_undeploy_index_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, undeploy_index_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.undeploy_index({ index_endpoint: index_endpoint }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.undeploy_index index_endpoint: index_endpoint do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.undeploy_index ::Google::Cloud::VisionAI::V1::UndeployIndexRequest.new(index_endpoint: index_endpoint) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.undeploy_index({ index_endpoint: index_endpoint }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.undeploy_index(::Google::Cloud::VisionAI::V1::UndeployIndexRequest.new(index_endpoint: index_endpoint), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, undeploy_index_client_stub.call_count - end - end - end - - def test_create_collection - # 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" - collection = {} - collection_id = "hello world" - - create_collection_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::VisionAI::V1::Warehouse::Rest::ServiceStub.stub :transcode_create_collection_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_collection_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_collection({ parent: parent, collection: collection, collection_id: collection_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_collection parent: parent, collection: collection, collection_id: collection_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_collection ::Google::Cloud::VisionAI::V1::CreateCollectionRequest.new(parent: parent, collection: collection, collection_id: collection_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_collection({ parent: parent, collection: collection, collection_id: collection_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_collection(::Google::Cloud::VisionAI::V1::CreateCollectionRequest.new(parent: parent, collection: collection, collection_id: collection_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_collection_client_stub.call_count - end - end - end - - def test_delete_collection - # 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_collection_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::VisionAI::V1::Warehouse::Rest::ServiceStub.stub :transcode_delete_collection_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_collection_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.delete_collection({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.delete_collection name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.delete_collection ::Google::Cloud::VisionAI::V1::DeleteCollectionRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.delete_collection({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.delete_collection(::Google::Cloud::VisionAI::V1::DeleteCollectionRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, delete_collection_client_stub.call_count - end - end - end - - def test_get_collection - # Create test objects. - client_result = ::Google::Cloud::VisionAI::V1::Collection.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_collection_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::VisionAI::V1::Warehouse::Rest::ServiceStub.stub :transcode_get_collection_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_collection_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_collection({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_collection name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_collection ::Google::Cloud::VisionAI::V1::GetCollectionRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_collection({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_collection(::Google::Cloud::VisionAI::V1::GetCollectionRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_collection_client_stub.call_count - end - end - end - - def test_update_collection - # Create test objects. - client_result = ::Google::Cloud::VisionAI::V1::Collection.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - collection = {} - update_mask = {} - - update_collection_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::VisionAI::V1::Warehouse::Rest::ServiceStub.stub :transcode_update_collection_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_collection_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.update_collection({ collection: collection, update_mask: update_mask }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.update_collection collection: collection, update_mask: update_mask do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.update_collection ::Google::Cloud::VisionAI::V1::UpdateCollectionRequest.new(collection: collection, update_mask: update_mask) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.update_collection({ collection: collection, update_mask: update_mask }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.update_collection(::Google::Cloud::VisionAI::V1::UpdateCollectionRequest.new(collection: collection, update_mask: update_mask), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, update_collection_client_stub.call_count - end - end - end - - def test_list_collections - # Create test objects. - client_result = ::Google::Cloud::VisionAI::V1::ListCollectionsResponse.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_collections_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::VisionAI::V1::Warehouse::Rest::ServiceStub.stub :transcode_list_collections_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_collections_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_collections({ 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_collections 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_collections ::Google::Cloud::VisionAI::V1::ListCollectionsRequest.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_collections({ 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_collections(::Google::Cloud::VisionAI::V1::ListCollectionsRequest.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_collections_client_stub.call_count - end - end - end - - def test_add_collection_item - # Create test objects. - client_result = ::Google::Cloud::VisionAI::V1::AddCollectionItemResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - item = {} - - add_collection_item_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::VisionAI::V1::Warehouse::Rest::ServiceStub.stub :transcode_add_collection_item_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, add_collection_item_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.add_collection_item({ item: item }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.add_collection_item item: item do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.add_collection_item ::Google::Cloud::VisionAI::V1::AddCollectionItemRequest.new(item: item) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.add_collection_item({ item: item }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.add_collection_item(::Google::Cloud::VisionAI::V1::AddCollectionItemRequest.new(item: item), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, add_collection_item_client_stub.call_count - end - end - end - - def test_remove_collection_item - # Create test objects. - client_result = ::Google::Cloud::VisionAI::V1::RemoveCollectionItemResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - item = {} - - remove_collection_item_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::VisionAI::V1::Warehouse::Rest::ServiceStub.stub :transcode_remove_collection_item_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, remove_collection_item_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.remove_collection_item({ item: item }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.remove_collection_item item: item do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.remove_collection_item ::Google::Cloud::VisionAI::V1::RemoveCollectionItemRequest.new(item: item) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.remove_collection_item({ item: item }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.remove_collection_item(::Google::Cloud::VisionAI::V1::RemoveCollectionItemRequest.new(item: item), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, remove_collection_item_client_stub.call_count - end - end - end - - def test_view_collection_items - # Create test objects. - client_result = ::Google::Cloud::VisionAI::V1::ViewCollectionItemsResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - collection = "hello world" - page_size = 42 - page_token = "hello world" - - view_collection_items_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::VisionAI::V1::Warehouse::Rest::ServiceStub.stub :transcode_view_collection_items_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, view_collection_items_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::Warehouse::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.view_collection_items({ collection: collection, page_size: page_size, page_token: page_token }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.view_collection_items collection: collection, page_size: page_size, page_token: page_token do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.view_collection_items ::Google::Cloud::VisionAI::V1::ViewCollectionItemsRequest.new(collection: collection, 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.view_collection_items({ collection: collection, 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.view_collection_items(::Google::Cloud::VisionAI::V1::ViewCollectionItemsRequest.new(collection: collection, 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, view_collection_items_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::VisionAI::V1::Warehouse::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::VisionAI::V1::Warehouse::Rest::Client::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/test/google/cloud/vision_ai/v1/warehouse_test.rb b/owl-bot-staging/google-cloud-vision_ai-v1/test/google/cloud/vision_ai/v1/warehouse_test.rb deleted file mode 100644 index d8ace2295146..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/test/google/cloud/vision_ai/v1/warehouse_test.rb +++ /dev/null @@ -1,4111 +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/visionai/v1/warehouse_pb" -require "google/cloud/vision_ai/v1/warehouse" - -class ::Google::Cloud::VisionAI::V1::Warehouse::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_asset - # Create GRPC objects. - grpc_response = ::Google::Cloud::VisionAI::V1::Asset.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" - asset = {} - asset_id = "hello world" - - create_asset_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_asset, name - assert_kind_of ::Google::Cloud::VisionAI::V1::CreateAssetRequest, request - assert_equal "hello world", request["parent"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::VisionAI::V1::Asset), request["asset"] - assert_equal "hello world", request["asset_id"] - assert request.has_asset_id? - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_asset_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::Warehouse::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_asset({ parent: parent, asset: asset, asset_id: asset_id }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.create_asset parent: parent, asset: asset, asset_id: asset_id do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.create_asset ::Google::Cloud::VisionAI::V1::CreateAssetRequest.new(parent: parent, asset: asset, asset_id: asset_id) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.create_asset({ parent: parent, asset: asset, asset_id: asset_id }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.create_asset(::Google::Cloud::VisionAI::V1::CreateAssetRequest.new(parent: parent, asset: asset, asset_id: asset_id), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, create_asset_client_stub.call_rpc_count - end - end - - def test_update_asset - # Create GRPC objects. - grpc_response = ::Google::Cloud::VisionAI::V1::Asset.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. - asset = {} - update_mask = {} - - update_asset_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_asset, name - assert_kind_of ::Google::Cloud::VisionAI::V1::UpdateAssetRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::VisionAI::V1::Asset), request["asset"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_asset_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::Warehouse::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_asset({ asset: asset, update_mask: update_mask }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.update_asset asset: asset, update_mask: update_mask do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.update_asset ::Google::Cloud::VisionAI::V1::UpdateAssetRequest.new(asset: asset, 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_asset({ asset: asset, 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_asset(::Google::Cloud::VisionAI::V1::UpdateAssetRequest.new(asset: asset, 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_asset_client_stub.call_rpc_count - end - end - - def test_get_asset - # Create GRPC objects. - grpc_response = ::Google::Cloud::VisionAI::V1::Asset.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_asset_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_asset, name - assert_kind_of ::Google::Cloud::VisionAI::V1::GetAssetRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_asset_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::Warehouse::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_asset({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_asset name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_asset ::Google::Cloud::VisionAI::V1::GetAssetRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_asset({ 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_asset(::Google::Cloud::VisionAI::V1::GetAssetRequest.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_asset_client_stub.call_rpc_count - end - end - - def test_list_assets - # Create GRPC objects. - grpc_response = ::Google::Cloud::VisionAI::V1::ListAssetsResponse.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_assets_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_assets, name - assert_kind_of ::Google::Cloud::VisionAI::V1::ListAssetsRequest, 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_assets_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::Warehouse::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_assets({ 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_assets 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_assets ::Google::Cloud::VisionAI::V1::ListAssetsRequest.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_assets({ 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_assets(::Google::Cloud::VisionAI::V1::ListAssetsRequest.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_assets_client_stub.call_rpc_count - end - end - - def test_delete_asset - # 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_asset_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_asset, name - assert_kind_of ::Google::Cloud::VisionAI::V1::DeleteAssetRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_asset_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::Warehouse::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_asset({ 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_asset 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_asset ::Google::Cloud::VisionAI::V1::DeleteAssetRequest.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_asset({ 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_asset(::Google::Cloud::VisionAI::V1::DeleteAssetRequest.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_asset_client_stub.call_rpc_count - end - end - - def test_upload_asset - # 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" - asset_source = {} - - upload_asset_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :upload_asset, name - assert_kind_of ::Google::Cloud::VisionAI::V1::UploadAssetRequest, request - assert_equal "hello world", request["name"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::VisionAI::V1::AssetSource), request["asset_source"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, upload_asset_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::Warehouse::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.upload_asset({ name: name, asset_source: asset_source }) 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.upload_asset name: name, asset_source: asset_source 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.upload_asset ::Google::Cloud::VisionAI::V1::UploadAssetRequest.new(name: name, asset_source: asset_source) 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.upload_asset({ name: name, asset_source: asset_source }, 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.upload_asset(::Google::Cloud::VisionAI::V1::UploadAssetRequest.new(name: name, asset_source: asset_source), 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, upload_asset_client_stub.call_rpc_count - end - end - - def test_generate_retrieval_url - # Create GRPC objects. - grpc_response = ::Google::Cloud::VisionAI::V1::GenerateRetrievalUrlResponse.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" - - generate_retrieval_url_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :generate_retrieval_url, name - assert_kind_of ::Google::Cloud::VisionAI::V1::GenerateRetrievalUrlRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, generate_retrieval_url_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::Warehouse::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.generate_retrieval_url({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.generate_retrieval_url name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.generate_retrieval_url ::Google::Cloud::VisionAI::V1::GenerateRetrievalUrlRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.generate_retrieval_url({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.generate_retrieval_url(::Google::Cloud::VisionAI::V1::GenerateRetrievalUrlRequest.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, generate_retrieval_url_client_stub.call_rpc_count - end - end - - def test_analyze_asset - # 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" - - analyze_asset_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :analyze_asset, name - assert_kind_of ::Google::Cloud::VisionAI::V1::AnalyzeAssetRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, analyze_asset_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::Warehouse::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.analyze_asset({ 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.analyze_asset 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.analyze_asset ::Google::Cloud::VisionAI::V1::AnalyzeAssetRequest.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.analyze_asset({ 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.analyze_asset(::Google::Cloud::VisionAI::V1::AnalyzeAssetRequest.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, analyze_asset_client_stub.call_rpc_count - end - end - - def test_index_asset - # 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" - index = "hello world" - - index_asset_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :index_asset, name - assert_kind_of ::Google::Cloud::VisionAI::V1::IndexAssetRequest, request - assert_equal "hello world", request["name"] - assert_equal "hello world", request["index"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, index_asset_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::Warehouse::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.index_asset({ name: name, index: index }) 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.index_asset name: name, index: index 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.index_asset ::Google::Cloud::VisionAI::V1::IndexAssetRequest.new(name: name, index: index) 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.index_asset({ name: name, index: index }, 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.index_asset(::Google::Cloud::VisionAI::V1::IndexAssetRequest.new(name: name, index: index), 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, index_asset_client_stub.call_rpc_count - end - end - - def test_remove_index_asset - # 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" - index = "hello world" - - remove_index_asset_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :remove_index_asset, name - assert_kind_of ::Google::Cloud::VisionAI::V1::RemoveIndexAssetRequest, request - assert_equal "hello world", request["name"] - assert_equal "hello world", request["index"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, remove_index_asset_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::Warehouse::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.remove_index_asset({ name: name, index: index }) 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.remove_index_asset name: name, index: index 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.remove_index_asset ::Google::Cloud::VisionAI::V1::RemoveIndexAssetRequest.new(name: name, index: index) 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.remove_index_asset({ name: name, index: index }, 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.remove_index_asset(::Google::Cloud::VisionAI::V1::RemoveIndexAssetRequest.new(name: name, index: index), 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, remove_index_asset_client_stub.call_rpc_count - end - end - - def test_view_indexed_assets - # Create GRPC objects. - grpc_response = ::Google::Cloud::VisionAI::V1::ViewIndexedAssetsResponse.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. - index = "hello world" - page_size = 42 - page_token = "hello world" - filter = "hello world" - - view_indexed_assets_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :view_indexed_assets, name - assert_kind_of ::Google::Cloud::VisionAI::V1::ViewIndexedAssetsRequest, request - assert_equal "hello world", request["index"] - 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, view_indexed_assets_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::Warehouse::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.view_indexed_assets({ index: index, 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.view_indexed_assets index: index, 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.view_indexed_assets ::Google::Cloud::VisionAI::V1::ViewIndexedAssetsRequest.new(index: index, 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.view_indexed_assets({ index: index, 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.view_indexed_assets(::Google::Cloud::VisionAI::V1::ViewIndexedAssetsRequest.new(index: index, 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, view_indexed_assets_client_stub.call_rpc_count - end - end - - def test_create_index - # 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" - index_id = "hello world" - index = {} - - create_index_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_index, name - assert_kind_of ::Google::Cloud::VisionAI::V1::CreateIndexRequest, request - assert_equal "hello world", request["parent"] - assert_equal "hello world", request["index_id"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::VisionAI::V1::Index), request["index"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_index_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::Warehouse::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_index({ parent: parent, index_id: index_id, index: index }) 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_index parent: parent, index_id: index_id, index: index 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_index ::Google::Cloud::VisionAI::V1::CreateIndexRequest.new(parent: parent, index_id: index_id, index: index) 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_index({ parent: parent, index_id: index_id, index: index }, 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_index(::Google::Cloud::VisionAI::V1::CreateIndexRequest.new(parent: parent, index_id: index_id, index: index), 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_index_client_stub.call_rpc_count - end - end - - def test_update_index - # 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. - index = {} - update_mask = {} - - update_index_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_index, name - assert_kind_of ::Google::Cloud::VisionAI::V1::UpdateIndexRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::VisionAI::V1::Index), request["index"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_index_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::Warehouse::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_index({ index: index, update_mask: update_mask }) 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.update_index index: index, update_mask: update_mask 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.update_index ::Google::Cloud::VisionAI::V1::UpdateIndexRequest.new(index: index, update_mask: update_mask) 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.update_index({ index: index, update_mask: update_mask }, 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.update_index(::Google::Cloud::VisionAI::V1::UpdateIndexRequest.new(index: index, update_mask: update_mask), 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, update_index_client_stub.call_rpc_count - end - end - - def test_get_index - # Create GRPC objects. - grpc_response = ::Google::Cloud::VisionAI::V1::Index.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_index_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_index, name - assert_kind_of ::Google::Cloud::VisionAI::V1::GetIndexRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_index_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::Warehouse::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_index({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_index name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_index ::Google::Cloud::VisionAI::V1::GetIndexRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_index({ 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_index(::Google::Cloud::VisionAI::V1::GetIndexRequest.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_index_client_stub.call_rpc_count - end - end - - def test_list_indexes - # Create GRPC objects. - grpc_response = ::Google::Cloud::VisionAI::V1::ListIndexesResponse.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_indexes_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_indexes, name - assert_kind_of ::Google::Cloud::VisionAI::V1::ListIndexesRequest, 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_indexes_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::Warehouse::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_indexes({ 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_indexes 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_indexes ::Google::Cloud::VisionAI::V1::ListIndexesRequest.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_indexes({ 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_indexes(::Google::Cloud::VisionAI::V1::ListIndexesRequest.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_indexes_client_stub.call_rpc_count - end - end - - def test_delete_index - # 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_index_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_index, name - assert_kind_of ::Google::Cloud::VisionAI::V1::DeleteIndexRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_index_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::Warehouse::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_index({ 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_index 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_index ::Google::Cloud::VisionAI::V1::DeleteIndexRequest.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_index({ 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_index(::Google::Cloud::VisionAI::V1::DeleteIndexRequest.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_index_client_stub.call_rpc_count - end - end - - def test_create_corpus - # 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" - corpus = {} - - create_corpus_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_corpus, name - assert_kind_of ::Google::Cloud::VisionAI::V1::CreateCorpusRequest, request - assert_equal "hello world", request["parent"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::VisionAI::V1::Corpus), request["corpus"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_corpus_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::Warehouse::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_corpus({ parent: parent, corpus: corpus }) 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_corpus parent: parent, corpus: corpus 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_corpus ::Google::Cloud::VisionAI::V1::CreateCorpusRequest.new(parent: parent, corpus: corpus) 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_corpus({ parent: parent, corpus: corpus }, 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_corpus(::Google::Cloud::VisionAI::V1::CreateCorpusRequest.new(parent: parent, corpus: corpus), 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_corpus_client_stub.call_rpc_count - end - end - - def test_get_corpus - # Create GRPC objects. - grpc_response = ::Google::Cloud::VisionAI::V1::Corpus.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_corpus_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_corpus, name - assert_kind_of ::Google::Cloud::VisionAI::V1::GetCorpusRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_corpus_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::Warehouse::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_corpus({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_corpus name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_corpus ::Google::Cloud::VisionAI::V1::GetCorpusRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_corpus({ 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_corpus(::Google::Cloud::VisionAI::V1::GetCorpusRequest.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_corpus_client_stub.call_rpc_count - end - end - - def test_update_corpus - # Create GRPC objects. - grpc_response = ::Google::Cloud::VisionAI::V1::Corpus.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. - corpus = {} - update_mask = {} - - update_corpus_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_corpus, name - assert_kind_of ::Google::Cloud::VisionAI::V1::UpdateCorpusRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::VisionAI::V1::Corpus), request["corpus"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_corpus_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::Warehouse::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_corpus({ corpus: corpus, update_mask: update_mask }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.update_corpus corpus: corpus, update_mask: update_mask do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.update_corpus ::Google::Cloud::VisionAI::V1::UpdateCorpusRequest.new(corpus: corpus, 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_corpus({ corpus: corpus, 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_corpus(::Google::Cloud::VisionAI::V1::UpdateCorpusRequest.new(corpus: corpus, 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_corpus_client_stub.call_rpc_count - end - end - - def test_list_corpora - # Create GRPC objects. - grpc_response = ::Google::Cloud::VisionAI::V1::ListCorporaResponse.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_corpora_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_corpora, name - assert_kind_of ::Google::Cloud::VisionAI::V1::ListCorporaRequest, 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_corpora_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::Warehouse::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_corpora({ 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_corpora 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_corpora ::Google::Cloud::VisionAI::V1::ListCorporaRequest.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_corpora({ 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_corpora(::Google::Cloud::VisionAI::V1::ListCorporaRequest.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_corpora_client_stub.call_rpc_count - end - end - - def test_delete_corpus - # 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_corpus_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_corpus, name - assert_kind_of ::Google::Cloud::VisionAI::V1::DeleteCorpusRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_corpus_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::Warehouse::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_corpus({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.delete_corpus name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.delete_corpus ::Google::Cloud::VisionAI::V1::DeleteCorpusRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.delete_corpus({ 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_corpus(::Google::Cloud::VisionAI::V1::DeleteCorpusRequest.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_corpus_client_stub.call_rpc_count - end - end - - def test_analyze_corpus - # 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" - - analyze_corpus_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :analyze_corpus, name - assert_kind_of ::Google::Cloud::VisionAI::V1::AnalyzeCorpusRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, analyze_corpus_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::Warehouse::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.analyze_corpus({ 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.analyze_corpus 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.analyze_corpus ::Google::Cloud::VisionAI::V1::AnalyzeCorpusRequest.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.analyze_corpus({ 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.analyze_corpus(::Google::Cloud::VisionAI::V1::AnalyzeCorpusRequest.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, analyze_corpus_client_stub.call_rpc_count - end - end - - def test_create_data_schema - # Create GRPC objects. - grpc_response = ::Google::Cloud::VisionAI::V1::DataSchema.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" - data_schema = {} - - create_data_schema_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_data_schema, name - assert_kind_of ::Google::Cloud::VisionAI::V1::CreateDataSchemaRequest, request - assert_equal "hello world", request["parent"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::VisionAI::V1::DataSchema), request["data_schema"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_data_schema_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::Warehouse::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_data_schema({ parent: parent, data_schema: data_schema }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.create_data_schema parent: parent, data_schema: data_schema do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.create_data_schema ::Google::Cloud::VisionAI::V1::CreateDataSchemaRequest.new(parent: parent, data_schema: data_schema) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.create_data_schema({ parent: parent, data_schema: data_schema }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.create_data_schema(::Google::Cloud::VisionAI::V1::CreateDataSchemaRequest.new(parent: parent, data_schema: data_schema), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, create_data_schema_client_stub.call_rpc_count - end - end - - def test_update_data_schema - # Create GRPC objects. - grpc_response = ::Google::Cloud::VisionAI::V1::DataSchema.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. - data_schema = {} - update_mask = {} - - update_data_schema_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_data_schema, name - assert_kind_of ::Google::Cloud::VisionAI::V1::UpdateDataSchemaRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::VisionAI::V1::DataSchema), request["data_schema"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_data_schema_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::Warehouse::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_data_schema({ data_schema: data_schema, update_mask: update_mask }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.update_data_schema data_schema: data_schema, update_mask: update_mask do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.update_data_schema ::Google::Cloud::VisionAI::V1::UpdateDataSchemaRequest.new(data_schema: data_schema, 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_data_schema({ data_schema: data_schema, 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_data_schema(::Google::Cloud::VisionAI::V1::UpdateDataSchemaRequest.new(data_schema: data_schema, 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_data_schema_client_stub.call_rpc_count - end - end - - def test_get_data_schema - # Create GRPC objects. - grpc_response = ::Google::Cloud::VisionAI::V1::DataSchema.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_data_schema_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_data_schema, name - assert_kind_of ::Google::Cloud::VisionAI::V1::GetDataSchemaRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_data_schema_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::Warehouse::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_data_schema({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_data_schema name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_data_schema ::Google::Cloud::VisionAI::V1::GetDataSchemaRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_data_schema({ 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_data_schema(::Google::Cloud::VisionAI::V1::GetDataSchemaRequest.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_data_schema_client_stub.call_rpc_count - end - end - - def test_delete_data_schema - # 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_data_schema_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_data_schema, name - assert_kind_of ::Google::Cloud::VisionAI::V1::DeleteDataSchemaRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_data_schema_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::Warehouse::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_data_schema({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.delete_data_schema name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.delete_data_schema ::Google::Cloud::VisionAI::V1::DeleteDataSchemaRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.delete_data_schema({ 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_data_schema(::Google::Cloud::VisionAI::V1::DeleteDataSchemaRequest.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_data_schema_client_stub.call_rpc_count - end - end - - def test_list_data_schemas - # Create GRPC objects. - grpc_response = ::Google::Cloud::VisionAI::V1::ListDataSchemasResponse.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_data_schemas_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_data_schemas, name - assert_kind_of ::Google::Cloud::VisionAI::V1::ListDataSchemasRequest, 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_data_schemas_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::Warehouse::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_data_schemas({ 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_data_schemas 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_data_schemas ::Google::Cloud::VisionAI::V1::ListDataSchemasRequest.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_data_schemas({ 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_data_schemas(::Google::Cloud::VisionAI::V1::ListDataSchemasRequest.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_data_schemas_client_stub.call_rpc_count - end - end - - def test_create_annotation - # Create GRPC objects. - grpc_response = ::Google::Cloud::VisionAI::V1::Annotation.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" - annotation = {} - annotation_id = "hello world" - - create_annotation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_annotation, name - assert_kind_of ::Google::Cloud::VisionAI::V1::CreateAnnotationRequest, request - assert_equal "hello world", request["parent"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::VisionAI::V1::Annotation), request["annotation"] - assert_equal "hello world", request["annotation_id"] - assert request.has_annotation_id? - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_annotation_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::Warehouse::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_annotation({ parent: parent, annotation: annotation, annotation_id: annotation_id }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.create_annotation parent: parent, annotation: annotation, annotation_id: annotation_id do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.create_annotation ::Google::Cloud::VisionAI::V1::CreateAnnotationRequest.new(parent: parent, annotation: annotation, annotation_id: annotation_id) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.create_annotation({ parent: parent, annotation: annotation, annotation_id: annotation_id }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.create_annotation(::Google::Cloud::VisionAI::V1::CreateAnnotationRequest.new(parent: parent, annotation: annotation, annotation_id: annotation_id), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, create_annotation_client_stub.call_rpc_count - end - end - - def test_get_annotation - # Create GRPC objects. - grpc_response = ::Google::Cloud::VisionAI::V1::Annotation.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_annotation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_annotation, name - assert_kind_of ::Google::Cloud::VisionAI::V1::GetAnnotationRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_annotation_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::Warehouse::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_annotation({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_annotation name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_annotation ::Google::Cloud::VisionAI::V1::GetAnnotationRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_annotation({ 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_annotation(::Google::Cloud::VisionAI::V1::GetAnnotationRequest.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_annotation_client_stub.call_rpc_count - end - end - - def test_list_annotations - # Create GRPC objects. - grpc_response = ::Google::Cloud::VisionAI::V1::ListAnnotationsResponse.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_annotations_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_annotations, name - assert_kind_of ::Google::Cloud::VisionAI::V1::ListAnnotationsRequest, 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_annotations_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::Warehouse::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_annotations({ 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_annotations 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_annotations ::Google::Cloud::VisionAI::V1::ListAnnotationsRequest.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_annotations({ 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_annotations(::Google::Cloud::VisionAI::V1::ListAnnotationsRequest.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_annotations_client_stub.call_rpc_count - end - end - - def test_update_annotation - # Create GRPC objects. - grpc_response = ::Google::Cloud::VisionAI::V1::Annotation.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. - annotation = {} - update_mask = {} - - update_annotation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_annotation, name - assert_kind_of ::Google::Cloud::VisionAI::V1::UpdateAnnotationRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::VisionAI::V1::Annotation), request["annotation"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_annotation_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::Warehouse::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_annotation({ annotation: annotation, update_mask: update_mask }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.update_annotation annotation: annotation, update_mask: update_mask do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.update_annotation ::Google::Cloud::VisionAI::V1::UpdateAnnotationRequest.new(annotation: annotation, 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_annotation({ annotation: annotation, 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_annotation(::Google::Cloud::VisionAI::V1::UpdateAnnotationRequest.new(annotation: annotation, 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_annotation_client_stub.call_rpc_count - end - end - - def test_delete_annotation - # 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_annotation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_annotation, name - assert_kind_of ::Google::Cloud::VisionAI::V1::DeleteAnnotationRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_annotation_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::Warehouse::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_annotation({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.delete_annotation name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.delete_annotation ::Google::Cloud::VisionAI::V1::DeleteAnnotationRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.delete_annotation({ 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_annotation(::Google::Cloud::VisionAI::V1::DeleteAnnotationRequest.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_annotation_client_stub.call_rpc_count - end - end - - def test_ingest_asset - # Create GRPC objects. - grpc_response = ::Google::Cloud::VisionAI::V1::IngestAssetResponse.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 bidi streaming method. - config = {} - - ingest_asset_client_stub = ClientStub.new [grpc_response].to_enum, grpc_operation do |name, request, options:| - assert_equal :ingest_asset, name - assert_kind_of Enumerable, request - refute_nil options - request - end - - Gapic::ServiceStub.stub :new, ingest_asset_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::Warehouse::Client.new do |config| - config.credentials = grpc_channel - end - - # Use enumerable object with hash and protobuf object. - request_hash = { config: config } - request_proto = ::Google::Cloud::VisionAI::V1::IngestAssetRequest.new config: config - enum_input = [request_hash, request_proto].to_enum - client.ingest_asset enum_input do |response, operation| - assert_kind_of Enumerable, response - response.to_a.each do |r| - assert_kind_of ::Google::Cloud::VisionAI::V1::IngestAssetResponse, r - end - assert_equal grpc_operation, operation - end - - # Use stream input object (from gapic-common). - request_hash = { config: config } - request_proto = ::Google::Cloud::VisionAI::V1::IngestAssetRequest.new config: config - stream_input = Gapic::StreamInput.new - client.ingest_asset stream_input do |response, operation| - assert_kind_of Enumerable, response - response.to_a.each do |r| - assert_kind_of ::Google::Cloud::VisionAI::V1::IngestAssetResponse, r - end - assert_equal grpc_operation, operation - end - stream_input << request_hash - stream_input << request_proto - stream_input.close - - # Use enumerable object with hash and protobuf object with options. - request_hash = { config: config } - request_proto = ::Google::Cloud::VisionAI::V1::IngestAssetRequest.new config: config - enum_input = [request_hash, request_proto].to_enum - client.ingest_asset enum_input, grpc_options do |response, operation| - assert_kind_of Enumerable, response - response.to_a.each do |r| - assert_kind_of ::Google::Cloud::VisionAI::V1::IngestAssetResponse, r - end - assert_equal grpc_operation, operation - end - - # Use stream input object (from gapic-common) with options. - request_hash = { config: config } - request_proto = ::Google::Cloud::VisionAI::V1::IngestAssetRequest.new config: config - stream_input = Gapic::StreamInput.new - client.ingest_asset stream_input, grpc_options do |response, operation| - assert_kind_of Enumerable, response - response.to_a.each do |r| - assert_kind_of ::Google::Cloud::VisionAI::V1::IngestAssetResponse, r - end - assert_equal grpc_operation, operation - end - stream_input << request_hash - stream_input << request_proto - stream_input.close - - # Verify method calls - assert_equal 4, ingest_asset_client_stub.call_rpc_count - ingest_asset_client_stub.requests.each do |request| - request.to_a.each do |r| - assert_kind_of ::Google::Cloud::VisionAI::V1::IngestAssetRequest, r - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::VisionAI::V1::IngestAssetRequest::Config), r["config"] - assert_equal :config, r.streaming_request - end - end - end - end - - def test_clip_asset - # Create GRPC objects. - grpc_response = ::Google::Cloud::VisionAI::V1::ClipAssetResponse.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" - temporal_partition = {} - - clip_asset_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :clip_asset, name - assert_kind_of ::Google::Cloud::VisionAI::V1::ClipAssetRequest, request - assert_equal "hello world", request["name"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::VisionAI::V1::Partition::TemporalPartition), request["temporal_partition"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, clip_asset_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::Warehouse::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.clip_asset({ name: name, temporal_partition: temporal_partition }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.clip_asset name: name, temporal_partition: temporal_partition do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.clip_asset ::Google::Cloud::VisionAI::V1::ClipAssetRequest.new(name: name, temporal_partition: temporal_partition) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.clip_asset({ name: name, temporal_partition: temporal_partition }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.clip_asset(::Google::Cloud::VisionAI::V1::ClipAssetRequest.new(name: name, temporal_partition: temporal_partition), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, clip_asset_client_stub.call_rpc_count - end - end - - def test_generate_hls_uri - # Create GRPC objects. - grpc_response = ::Google::Cloud::VisionAI::V1::GenerateHlsUriResponse.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" - temporal_partitions = [{}] - live_view_enabled = true - - generate_hls_uri_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :generate_hls_uri, name - assert_kind_of ::Google::Cloud::VisionAI::V1::GenerateHlsUriRequest, request - assert_equal "hello world", request["name"] - assert_kind_of ::Google::Cloud::VisionAI::V1::Partition::TemporalPartition, request["temporal_partitions"].first - assert_equal true, request["live_view_enabled"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, generate_hls_uri_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::Warehouse::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.generate_hls_uri({ name: name, temporal_partitions: temporal_partitions, live_view_enabled: live_view_enabled }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.generate_hls_uri name: name, temporal_partitions: temporal_partitions, live_view_enabled: live_view_enabled do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.generate_hls_uri ::Google::Cloud::VisionAI::V1::GenerateHlsUriRequest.new(name: name, temporal_partitions: temporal_partitions, live_view_enabled: live_view_enabled) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.generate_hls_uri({ name: name, temporal_partitions: temporal_partitions, live_view_enabled: live_view_enabled }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.generate_hls_uri(::Google::Cloud::VisionAI::V1::GenerateHlsUriRequest.new(name: name, temporal_partitions: temporal_partitions, live_view_enabled: live_view_enabled), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, generate_hls_uri_client_stub.call_rpc_count - end - end - - def test_import_assets - # 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. - assets_gcs_uri = "hello world" - parent = "hello world" - - import_assets_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :import_assets, name - assert_kind_of ::Google::Cloud::VisionAI::V1::ImportAssetsRequest, request - assert_equal "hello world", request["assets_gcs_uri"] - assert_equal :assets_gcs_uri, request.source - assert_equal "hello world", request["parent"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, import_assets_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::Warehouse::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.import_assets({ assets_gcs_uri: assets_gcs_uri, parent: parent }) 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.import_assets assets_gcs_uri: assets_gcs_uri, parent: parent 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.import_assets ::Google::Cloud::VisionAI::V1::ImportAssetsRequest.new(assets_gcs_uri: assets_gcs_uri, parent: parent) 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.import_assets({ assets_gcs_uri: assets_gcs_uri, parent: parent }, 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.import_assets(::Google::Cloud::VisionAI::V1::ImportAssetsRequest.new(assets_gcs_uri: assets_gcs_uri, parent: parent), 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, import_assets_client_stub.call_rpc_count - end - end - - def test_create_search_config - # Create GRPC objects. - grpc_response = ::Google::Cloud::VisionAI::V1::SearchConfig.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" - search_config = {} - search_config_id = "hello world" - - create_search_config_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_search_config, name - assert_kind_of ::Google::Cloud::VisionAI::V1::CreateSearchConfigRequest, request - assert_equal "hello world", request["parent"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::VisionAI::V1::SearchConfig), request["search_config"] - assert_equal "hello world", request["search_config_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_search_config_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::Warehouse::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_search_config({ parent: parent, search_config: search_config, search_config_id: search_config_id }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.create_search_config parent: parent, search_config: search_config, search_config_id: search_config_id do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.create_search_config ::Google::Cloud::VisionAI::V1::CreateSearchConfigRequest.new(parent: parent, search_config: search_config, search_config_id: search_config_id) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.create_search_config({ parent: parent, search_config: search_config, search_config_id: search_config_id }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.create_search_config(::Google::Cloud::VisionAI::V1::CreateSearchConfigRequest.new(parent: parent, search_config: search_config, search_config_id: search_config_id), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, create_search_config_client_stub.call_rpc_count - end - end - - def test_update_search_config - # Create GRPC objects. - grpc_response = ::Google::Cloud::VisionAI::V1::SearchConfig.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. - search_config = {} - update_mask = {} - - update_search_config_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_search_config, name - assert_kind_of ::Google::Cloud::VisionAI::V1::UpdateSearchConfigRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::VisionAI::V1::SearchConfig), request["search_config"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_search_config_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::Warehouse::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_search_config({ search_config: search_config, update_mask: update_mask }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.update_search_config search_config: search_config, update_mask: update_mask do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.update_search_config ::Google::Cloud::VisionAI::V1::UpdateSearchConfigRequest.new(search_config: search_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_search_config({ search_config: search_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_search_config(::Google::Cloud::VisionAI::V1::UpdateSearchConfigRequest.new(search_config: search_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_search_config_client_stub.call_rpc_count - end - end - - def test_get_search_config - # Create GRPC objects. - grpc_response = ::Google::Cloud::VisionAI::V1::SearchConfig.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_search_config_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_search_config, name - assert_kind_of ::Google::Cloud::VisionAI::V1::GetSearchConfigRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_search_config_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::Warehouse::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_search_config({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_search_config name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_search_config ::Google::Cloud::VisionAI::V1::GetSearchConfigRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_search_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_search_config(::Google::Cloud::VisionAI::V1::GetSearchConfigRequest.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_search_config_client_stub.call_rpc_count - end - end - - def test_delete_search_config - # 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_search_config_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_search_config, name - assert_kind_of ::Google::Cloud::VisionAI::V1::DeleteSearchConfigRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_search_config_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::Warehouse::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_search_config({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.delete_search_config name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.delete_search_config ::Google::Cloud::VisionAI::V1::DeleteSearchConfigRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.delete_search_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.delete_search_config(::Google::Cloud::VisionAI::V1::DeleteSearchConfigRequest.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_search_config_client_stub.call_rpc_count - end - end - - def test_list_search_configs - # Create GRPC objects. - grpc_response = ::Google::Cloud::VisionAI::V1::ListSearchConfigsResponse.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_search_configs_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_search_configs, name - assert_kind_of ::Google::Cloud::VisionAI::V1::ListSearchConfigsRequest, 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_search_configs_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::Warehouse::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_search_configs({ 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_search_configs 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_search_configs ::Google::Cloud::VisionAI::V1::ListSearchConfigsRequest.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_search_configs({ 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_search_configs(::Google::Cloud::VisionAI::V1::ListSearchConfigsRequest.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_search_configs_client_stub.call_rpc_count - end - end - - def test_create_search_hypernym - # Create GRPC objects. - grpc_response = ::Google::Cloud::VisionAI::V1::SearchHypernym.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" - search_hypernym = {} - search_hypernym_id = "hello world" - - create_search_hypernym_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_search_hypernym, name - assert_kind_of ::Google::Cloud::VisionAI::V1::CreateSearchHypernymRequest, request - assert_equal "hello world", request["parent"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::VisionAI::V1::SearchHypernym), request["search_hypernym"] - assert_equal "hello world", request["search_hypernym_id"] - assert request.has_search_hypernym_id? - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_search_hypernym_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::Warehouse::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_search_hypernym({ parent: parent, search_hypernym: search_hypernym, search_hypernym_id: search_hypernym_id }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.create_search_hypernym parent: parent, search_hypernym: search_hypernym, search_hypernym_id: search_hypernym_id do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.create_search_hypernym ::Google::Cloud::VisionAI::V1::CreateSearchHypernymRequest.new(parent: parent, search_hypernym: search_hypernym, search_hypernym_id: search_hypernym_id) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.create_search_hypernym({ parent: parent, search_hypernym: search_hypernym, search_hypernym_id: search_hypernym_id }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.create_search_hypernym(::Google::Cloud::VisionAI::V1::CreateSearchHypernymRequest.new(parent: parent, search_hypernym: search_hypernym, search_hypernym_id: search_hypernym_id), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, create_search_hypernym_client_stub.call_rpc_count - end - end - - def test_update_search_hypernym - # Create GRPC objects. - grpc_response = ::Google::Cloud::VisionAI::V1::SearchHypernym.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. - search_hypernym = {} - update_mask = {} - - update_search_hypernym_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_search_hypernym, name - assert_kind_of ::Google::Cloud::VisionAI::V1::UpdateSearchHypernymRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::VisionAI::V1::SearchHypernym), request["search_hypernym"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_search_hypernym_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::Warehouse::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_search_hypernym({ search_hypernym: search_hypernym, update_mask: update_mask }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.update_search_hypernym search_hypernym: search_hypernym, update_mask: update_mask do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.update_search_hypernym ::Google::Cloud::VisionAI::V1::UpdateSearchHypernymRequest.new(search_hypernym: search_hypernym, 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_search_hypernym({ search_hypernym: search_hypernym, 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_search_hypernym(::Google::Cloud::VisionAI::V1::UpdateSearchHypernymRequest.new(search_hypernym: search_hypernym, 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_search_hypernym_client_stub.call_rpc_count - end - end - - def test_get_search_hypernym - # Create GRPC objects. - grpc_response = ::Google::Cloud::VisionAI::V1::SearchHypernym.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_search_hypernym_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_search_hypernym, name - assert_kind_of ::Google::Cloud::VisionAI::V1::GetSearchHypernymRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_search_hypernym_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::Warehouse::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_search_hypernym({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_search_hypernym name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_search_hypernym ::Google::Cloud::VisionAI::V1::GetSearchHypernymRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_search_hypernym({ 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_search_hypernym(::Google::Cloud::VisionAI::V1::GetSearchHypernymRequest.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_search_hypernym_client_stub.call_rpc_count - end - end - - def test_delete_search_hypernym - # 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_search_hypernym_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_search_hypernym, name - assert_kind_of ::Google::Cloud::VisionAI::V1::DeleteSearchHypernymRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_search_hypernym_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::Warehouse::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_search_hypernym({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.delete_search_hypernym name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.delete_search_hypernym ::Google::Cloud::VisionAI::V1::DeleteSearchHypernymRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.delete_search_hypernym({ 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_search_hypernym(::Google::Cloud::VisionAI::V1::DeleteSearchHypernymRequest.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_search_hypernym_client_stub.call_rpc_count - end - end - - def test_list_search_hypernyms - # Create GRPC objects. - grpc_response = ::Google::Cloud::VisionAI::V1::ListSearchHypernymsResponse.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_search_hypernyms_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_search_hypernyms, name - assert_kind_of ::Google::Cloud::VisionAI::V1::ListSearchHypernymsRequest, 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_search_hypernyms_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::Warehouse::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_search_hypernyms({ 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_search_hypernyms 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_search_hypernyms ::Google::Cloud::VisionAI::V1::ListSearchHypernymsRequest.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_search_hypernyms({ 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_search_hypernyms(::Google::Cloud::VisionAI::V1::ListSearchHypernymsRequest.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_search_hypernyms_client_stub.call_rpc_count - end - end - - def test_search_assets - # Create GRPC objects. - grpc_response = ::Google::Cloud::VisionAI::V1::SearchAssetsResponse.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. - schema_key_sorting_strategy = {} - corpus = "hello world" - page_size = 42 - page_token = "hello world" - content_time_ranges = {} - criteria = [{}] - facet_selections = [{}] - result_annotation_keys = ["hello world"] - search_query = "hello world" - - search_assets_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :search_assets, name - assert_kind_of ::Google::Cloud::VisionAI::V1::SearchAssetsRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::VisionAI::V1::SchemaKeySortingStrategy), request["schema_key_sorting_strategy"] - assert_equal :schema_key_sorting_strategy, request.sort_spec - assert_equal "hello world", request["corpus"] - assert_equal 42, request["page_size"] - assert_equal "hello world", request["page_token"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::VisionAI::V1::DateTimeRangeArray), request["content_time_ranges"] - assert_kind_of ::Google::Cloud::VisionAI::V1::Criteria, request["criteria"].first - assert_kind_of ::Google::Cloud::VisionAI::V1::FacetGroup, request["facet_selections"].first - assert_equal ["hello world"], request["result_annotation_keys"] - assert_equal "hello world", request["search_query"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, search_assets_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::Warehouse::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.search_assets({ schema_key_sorting_strategy: schema_key_sorting_strategy, corpus: corpus, page_size: page_size, page_token: page_token, content_time_ranges: content_time_ranges, criteria: criteria, facet_selections: facet_selections, result_annotation_keys: result_annotation_keys, search_query: search_query }) 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.search_assets schema_key_sorting_strategy: schema_key_sorting_strategy, corpus: corpus, page_size: page_size, page_token: page_token, content_time_ranges: content_time_ranges, criteria: criteria, facet_selections: facet_selections, result_annotation_keys: result_annotation_keys, search_query: search_query 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.search_assets ::Google::Cloud::VisionAI::V1::SearchAssetsRequest.new(schema_key_sorting_strategy: schema_key_sorting_strategy, corpus: corpus, page_size: page_size, page_token: page_token, content_time_ranges: content_time_ranges, criteria: criteria, facet_selections: facet_selections, result_annotation_keys: result_annotation_keys, search_query: search_query) 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.search_assets({ schema_key_sorting_strategy: schema_key_sorting_strategy, corpus: corpus, page_size: page_size, page_token: page_token, content_time_ranges: content_time_ranges, criteria: criteria, facet_selections: facet_selections, result_annotation_keys: result_annotation_keys, search_query: search_query }, 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.search_assets(::Google::Cloud::VisionAI::V1::SearchAssetsRequest.new(schema_key_sorting_strategy: schema_key_sorting_strategy, corpus: corpus, page_size: page_size, page_token: page_token, content_time_ranges: content_time_ranges, criteria: criteria, facet_selections: facet_selections, result_annotation_keys: result_annotation_keys, search_query: search_query), 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, search_assets_client_stub.call_rpc_count - end - end - - def test_search_index_endpoint - # Create GRPC objects. - grpc_response = ::Google::Cloud::VisionAI::V1::SearchIndexEndpointResponse.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. - image_query = {} - index_endpoint = "hello world" - criteria = [{}] - exclusion_criteria = [{}] - page_size = 42 - page_token = "hello world" - - search_index_endpoint_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :search_index_endpoint, name - assert_kind_of ::Google::Cloud::VisionAI::V1::SearchIndexEndpointRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::VisionAI::V1::ImageQuery), request["image_query"] - assert_equal :image_query, request.query - assert_equal "hello world", request["index_endpoint"] - assert_kind_of ::Google::Cloud::VisionAI::V1::Criteria, request["criteria"].first - assert_kind_of ::Google::Cloud::VisionAI::V1::Criteria, request["exclusion_criteria"].first - assert_equal 42, request["page_size"] - assert_equal "hello world", request["page_token"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, search_index_endpoint_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::Warehouse::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.search_index_endpoint({ image_query: image_query, index_endpoint: index_endpoint, criteria: criteria, exclusion_criteria: exclusion_criteria, 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.search_index_endpoint image_query: image_query, index_endpoint: index_endpoint, criteria: criteria, exclusion_criteria: exclusion_criteria, 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.search_index_endpoint ::Google::Cloud::VisionAI::V1::SearchIndexEndpointRequest.new(image_query: image_query, index_endpoint: index_endpoint, criteria: criteria, exclusion_criteria: exclusion_criteria, 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.search_index_endpoint({ image_query: image_query, index_endpoint: index_endpoint, criteria: criteria, exclusion_criteria: exclusion_criteria, 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.search_index_endpoint(::Google::Cloud::VisionAI::V1::SearchIndexEndpointRequest.new(image_query: image_query, index_endpoint: index_endpoint, criteria: criteria, exclusion_criteria: exclusion_criteria, 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, search_index_endpoint_client_stub.call_rpc_count - end - end - - def test_create_index_endpoint - # 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" - index_endpoint_id = "hello world" - index_endpoint = {} - - create_index_endpoint_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_index_endpoint, name - assert_kind_of ::Google::Cloud::VisionAI::V1::CreateIndexEndpointRequest, request - assert_equal "hello world", request["parent"] - assert_equal "hello world", request["index_endpoint_id"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::VisionAI::V1::IndexEndpoint), request["index_endpoint"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_index_endpoint_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::Warehouse::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_index_endpoint({ parent: parent, index_endpoint_id: index_endpoint_id, index_endpoint: index_endpoint }) 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_index_endpoint parent: parent, index_endpoint_id: index_endpoint_id, index_endpoint: index_endpoint 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_index_endpoint ::Google::Cloud::VisionAI::V1::CreateIndexEndpointRequest.new(parent: parent, index_endpoint_id: index_endpoint_id, index_endpoint: index_endpoint) 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_index_endpoint({ parent: parent, index_endpoint_id: index_endpoint_id, index_endpoint: index_endpoint }, 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_index_endpoint(::Google::Cloud::VisionAI::V1::CreateIndexEndpointRequest.new(parent: parent, index_endpoint_id: index_endpoint_id, index_endpoint: index_endpoint), 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_index_endpoint_client_stub.call_rpc_count - end - end - - def test_get_index_endpoint - # Create GRPC objects. - grpc_response = ::Google::Cloud::VisionAI::V1::IndexEndpoint.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_index_endpoint_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_index_endpoint, name - assert_kind_of ::Google::Cloud::VisionAI::V1::GetIndexEndpointRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_index_endpoint_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::Warehouse::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_index_endpoint({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_index_endpoint name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_index_endpoint ::Google::Cloud::VisionAI::V1::GetIndexEndpointRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_index_endpoint({ 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_index_endpoint(::Google::Cloud::VisionAI::V1::GetIndexEndpointRequest.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_index_endpoint_client_stub.call_rpc_count - end - end - - def test_list_index_endpoints - # Create GRPC objects. - grpc_response = ::Google::Cloud::VisionAI::V1::ListIndexEndpointsResponse.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_index_endpoints_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_index_endpoints, name - assert_kind_of ::Google::Cloud::VisionAI::V1::ListIndexEndpointsRequest, 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_index_endpoints_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::Warehouse::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_index_endpoints({ 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_index_endpoints 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_index_endpoints ::Google::Cloud::VisionAI::V1::ListIndexEndpointsRequest.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_index_endpoints({ 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_index_endpoints(::Google::Cloud::VisionAI::V1::ListIndexEndpointsRequest.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_index_endpoints_client_stub.call_rpc_count - end - end - - def test_update_index_endpoint - # 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. - index_endpoint = {} - update_mask = {} - - update_index_endpoint_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_index_endpoint, name - assert_kind_of ::Google::Cloud::VisionAI::V1::UpdateIndexEndpointRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::VisionAI::V1::IndexEndpoint), request["index_endpoint"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_index_endpoint_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::Warehouse::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_index_endpoint({ index_endpoint: index_endpoint, update_mask: update_mask }) 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.update_index_endpoint index_endpoint: index_endpoint, update_mask: update_mask 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.update_index_endpoint ::Google::Cloud::VisionAI::V1::UpdateIndexEndpointRequest.new(index_endpoint: index_endpoint, update_mask: update_mask) 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.update_index_endpoint({ index_endpoint: index_endpoint, update_mask: update_mask }, 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.update_index_endpoint(::Google::Cloud::VisionAI::V1::UpdateIndexEndpointRequest.new(index_endpoint: index_endpoint, update_mask: update_mask), 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, update_index_endpoint_client_stub.call_rpc_count - end - end - - def test_delete_index_endpoint - # 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_index_endpoint_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_index_endpoint, name - assert_kind_of ::Google::Cloud::VisionAI::V1::DeleteIndexEndpointRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_index_endpoint_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::Warehouse::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_index_endpoint({ 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_index_endpoint 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_index_endpoint ::Google::Cloud::VisionAI::V1::DeleteIndexEndpointRequest.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_index_endpoint({ 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_index_endpoint(::Google::Cloud::VisionAI::V1::DeleteIndexEndpointRequest.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_index_endpoint_client_stub.call_rpc_count - end - end - - def test_deploy_index - # 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. - index_endpoint = "hello world" - deployed_index = {} - - deploy_index_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :deploy_index, name - assert_kind_of ::Google::Cloud::VisionAI::V1::DeployIndexRequest, request - assert_equal "hello world", request["index_endpoint"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::VisionAI::V1::DeployedIndex), request["deployed_index"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, deploy_index_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::Warehouse::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.deploy_index({ index_endpoint: index_endpoint, deployed_index: deployed_index }) 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.deploy_index index_endpoint: index_endpoint, deployed_index: deployed_index 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.deploy_index ::Google::Cloud::VisionAI::V1::DeployIndexRequest.new(index_endpoint: index_endpoint, deployed_index: deployed_index) 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.deploy_index({ index_endpoint: index_endpoint, deployed_index: deployed_index }, 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.deploy_index(::Google::Cloud::VisionAI::V1::DeployIndexRequest.new(index_endpoint: index_endpoint, deployed_index: deployed_index), 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, deploy_index_client_stub.call_rpc_count - end - end - - def test_undeploy_index - # 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. - index_endpoint = "hello world" - - undeploy_index_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :undeploy_index, name - assert_kind_of ::Google::Cloud::VisionAI::V1::UndeployIndexRequest, request - assert_equal "hello world", request["index_endpoint"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, undeploy_index_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::Warehouse::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.undeploy_index({ index_endpoint: index_endpoint }) 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.undeploy_index index_endpoint: index_endpoint 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.undeploy_index ::Google::Cloud::VisionAI::V1::UndeployIndexRequest.new(index_endpoint: index_endpoint) 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.undeploy_index({ index_endpoint: index_endpoint }, 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.undeploy_index(::Google::Cloud::VisionAI::V1::UndeployIndexRequest.new(index_endpoint: index_endpoint), 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, undeploy_index_client_stub.call_rpc_count - end - end - - def test_create_collection - # 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" - collection = {} - collection_id = "hello world" - - create_collection_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_collection, name - assert_kind_of ::Google::Cloud::VisionAI::V1::CreateCollectionRequest, request - assert_equal "hello world", request["parent"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::VisionAI::V1::Collection), request["collection"] - assert_equal "hello world", request["collection_id"] - assert request.has_collection_id? - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_collection_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::Warehouse::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_collection({ parent: parent, collection: collection, collection_id: collection_id }) 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_collection parent: parent, collection: collection, collection_id: collection_id 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_collection ::Google::Cloud::VisionAI::V1::CreateCollectionRequest.new(parent: parent, collection: collection, collection_id: collection_id) 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_collection({ parent: parent, collection: collection, collection_id: collection_id }, 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_collection(::Google::Cloud::VisionAI::V1::CreateCollectionRequest.new(parent: parent, collection: collection, collection_id: collection_id), 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_collection_client_stub.call_rpc_count - end - end - - def test_delete_collection - # 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_collection_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_collection, name - assert_kind_of ::Google::Cloud::VisionAI::V1::DeleteCollectionRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_collection_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::Warehouse::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_collection({ 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_collection 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_collection ::Google::Cloud::VisionAI::V1::DeleteCollectionRequest.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_collection({ 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_collection(::Google::Cloud::VisionAI::V1::DeleteCollectionRequest.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_collection_client_stub.call_rpc_count - end - end - - def test_get_collection - # Create GRPC objects. - grpc_response = ::Google::Cloud::VisionAI::V1::Collection.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_collection_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_collection, name - assert_kind_of ::Google::Cloud::VisionAI::V1::GetCollectionRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_collection_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::Warehouse::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_collection({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_collection name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_collection ::Google::Cloud::VisionAI::V1::GetCollectionRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_collection({ 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_collection(::Google::Cloud::VisionAI::V1::GetCollectionRequest.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_collection_client_stub.call_rpc_count - end - end - - def test_update_collection - # Create GRPC objects. - grpc_response = ::Google::Cloud::VisionAI::V1::Collection.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. - collection = {} - update_mask = {} - - update_collection_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_collection, name - assert_kind_of ::Google::Cloud::VisionAI::V1::UpdateCollectionRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::VisionAI::V1::Collection), request["collection"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_collection_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::Warehouse::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_collection({ collection: collection, update_mask: update_mask }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.update_collection collection: collection, update_mask: update_mask do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.update_collection ::Google::Cloud::VisionAI::V1::UpdateCollectionRequest.new(collection: collection, 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_collection({ collection: collection, 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_collection(::Google::Cloud::VisionAI::V1::UpdateCollectionRequest.new(collection: collection, 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_collection_client_stub.call_rpc_count - end - end - - def test_list_collections - # Create GRPC objects. - grpc_response = ::Google::Cloud::VisionAI::V1::ListCollectionsResponse.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_collections_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_collections, name - assert_kind_of ::Google::Cloud::VisionAI::V1::ListCollectionsRequest, 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_collections_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::Warehouse::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_collections({ 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_collections 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_collections ::Google::Cloud::VisionAI::V1::ListCollectionsRequest.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_collections({ 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_collections(::Google::Cloud::VisionAI::V1::ListCollectionsRequest.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_collections_client_stub.call_rpc_count - end - end - - def test_add_collection_item - # Create GRPC objects. - grpc_response = ::Google::Cloud::VisionAI::V1::AddCollectionItemResponse.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. - item = {} - - add_collection_item_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :add_collection_item, name - assert_kind_of ::Google::Cloud::VisionAI::V1::AddCollectionItemRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::VisionAI::V1::CollectionItem), request["item"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, add_collection_item_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::Warehouse::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.add_collection_item({ item: item }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.add_collection_item item: item do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.add_collection_item ::Google::Cloud::VisionAI::V1::AddCollectionItemRequest.new(item: item) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.add_collection_item({ item: item }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.add_collection_item(::Google::Cloud::VisionAI::V1::AddCollectionItemRequest.new(item: item), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, add_collection_item_client_stub.call_rpc_count - end - end - - def test_remove_collection_item - # Create GRPC objects. - grpc_response = ::Google::Cloud::VisionAI::V1::RemoveCollectionItemResponse.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. - item = {} - - remove_collection_item_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :remove_collection_item, name - assert_kind_of ::Google::Cloud::VisionAI::V1::RemoveCollectionItemRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::VisionAI::V1::CollectionItem), request["item"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, remove_collection_item_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::Warehouse::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.remove_collection_item({ item: item }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.remove_collection_item item: item do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.remove_collection_item ::Google::Cloud::VisionAI::V1::RemoveCollectionItemRequest.new(item: item) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.remove_collection_item({ item: item }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.remove_collection_item(::Google::Cloud::VisionAI::V1::RemoveCollectionItemRequest.new(item: item), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, remove_collection_item_client_stub.call_rpc_count - end - end - - def test_view_collection_items - # Create GRPC objects. - grpc_response = ::Google::Cloud::VisionAI::V1::ViewCollectionItemsResponse.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. - collection = "hello world" - page_size = 42 - page_token = "hello world" - - view_collection_items_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :view_collection_items, name - assert_kind_of ::Google::Cloud::VisionAI::V1::ViewCollectionItemsRequest, request - assert_equal "hello world", request["collection"] - assert_equal 42, request["page_size"] - assert_equal "hello world", request["page_token"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, view_collection_items_client_stub do - # Create client - client = ::Google::Cloud::VisionAI::V1::Warehouse::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.view_collection_items({ collection: collection, 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.view_collection_items collection: collection, 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.view_collection_items ::Google::Cloud::VisionAI::V1::ViewCollectionItemsRequest.new(collection: collection, 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.view_collection_items({ collection: collection, 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.view_collection_items(::Google::Cloud::VisionAI::V1::ViewCollectionItemsRequest.new(collection: collection, 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, view_collection_items_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::VisionAI::V1::Warehouse::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::VisionAI::V1::Warehouse::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::VisionAI::V1::Warehouse::Client.new do |config| - config.credentials = creds - end - assert_kind_of ::Google::Cloud::VisionAI::V1::Warehouse::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::VisionAI::V1::Warehouse::Client.new do |config| - config.credentials = grpc_channel - end - end - - assert_kind_of ::Google::Cloud::VisionAI::V1::Warehouse::Operations, client.operations_client - end -end diff --git a/owl-bot-staging/google-cloud-vision_ai-v1/test/helper.rb b/owl-bot-staging/google-cloud-vision_ai-v1/test/helper.rb deleted file mode 100644 index 672b337030e7..000000000000 --- a/owl-bot-staging/google-cloud-vision_ai-v1/test/helper.rb +++ /dev/null @@ -1,26 +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/mock" -require "minitest/rg" - -require "grpc" - -require "ostruct" diff --git a/owl-bot-staging/google-cloud-vm_migration-v1/.gitignore b/owl-bot-staging/google-cloud-vm_migration-v1/.gitignore deleted file mode 100644 index 0135b6bc6cfc..000000000000 --- a/owl-bot-staging/google-cloud-vm_migration-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-vm_migration-v1/.repo-metadata.json b/owl-bot-staging/google-cloud-vm_migration-v1/.repo-metadata.json deleted file mode 100644 index e41ca8a989ff..000000000000 --- a/owl-bot-staging/google-cloud-vm_migration-v1/.repo-metadata.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "api_id": "vmmigration.googleapis.com", - "api_shortname": "vmmigration", - "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-vm_migration-v1/latest", - "distribution_name": "google-cloud-vm_migration-v1", - "is_cloud": true, - "language": "ruby", - "name": "vmmigration", - "name_pretty": "Migrate for Compute Engine V1 API", - "product_documentation": "https://cloud.google.com/migrate/compute-engine/", - "release_level": "unreleased", - "repo": "googleapis/google-cloud-ruby", - "requires_billing": true, - "ruby-cloud-description": "Migrate for Compute Engine enables you to migrate (Lift and Shift) your virtual machines (VMs), with minor automatic modifications, from your source environment to Google Compute Engine. Note that google-cloud-vm_migration-v1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-vm_migration instead. See the readme for more details.", - "ruby-cloud-product-url": "https://cloud.google.com/migrate/compute-engine/", - "ruby-cloud-namespace-override": "VmMigration=VMMigration", - "library_type": "GAPIC_AUTO" -} diff --git a/owl-bot-staging/google-cloud-vm_migration-v1/.rubocop.yml b/owl-bot-staging/google-cloud-vm_migration-v1/.rubocop.yml deleted file mode 100644 index ed368c04ab68..000000000000 --- a/owl-bot-staging/google-cloud-vm_migration-v1/.rubocop.yml +++ /dev/null @@ -1,33 +0,0 @@ -inherit_gem: - google-style: google-style.yml - -AllCops: - Exclude: - - "google-cloud-vm_migration-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-vm_migration-v1.rb" diff --git a/owl-bot-staging/google-cloud-vm_migration-v1/.toys.rb b/owl-bot-staging/google-cloud-vm_migration-v1/.toys.rb deleted file mode 100644 index 177e22456e8a..000000000000 --- a/owl-bot-staging/google-cloud-vm_migration-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-vm_migration-v1/.yardopts b/owl-bot-staging/google-cloud-vm_migration-v1/.yardopts deleted file mode 100644 index db8f3461869c..000000000000 --- a/owl-bot-staging/google-cloud-vm_migration-v1/.yardopts +++ /dev/null @@ -1,12 +0,0 @@ ---no-private ---title="Migrate for Compute Engine 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-vm_migration-v1/AUTHENTICATION.md b/owl-bot-staging/google-cloud-vm_migration-v1/AUTHENTICATION.md deleted file mode 100644 index 1b07ac625571..000000000000 --- a/owl-bot-staging/google-cloud-vm_migration-v1/AUTHENTICATION.md +++ /dev/null @@ -1,122 +0,0 @@ -# Authentication - -The recommended way to authenticate to the google-cloud-vm_migration-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-vm_migration-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/vm_migration/v1" - -client = ::Google::Cloud::VMMigration::V1::VMMigration::Client.new do |config| - config.credentials = "path/to/credentialfile.json" -end -``` - -To configure a credentials file globally for all clients: - -```ruby -require "google/cloud/vm_migration/v1" - -::Google::Cloud::VMMigration::V1::VMMigration::Client.configure do |config| - config.credentials = "path/to/credentialfile.json" -end - -client = ::Google::Cloud::VMMigration::V1::VMMigration::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-vm_migration-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/vm_migration/v1" - -ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" - -client = ::Google::Cloud::VMMigration::V1::VMMigration::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-vm_migration-v1/CHANGELOG.md b/owl-bot-staging/google-cloud-vm_migration-v1/CHANGELOG.md deleted file mode 100644 index f88957a62ba2..000000000000 --- a/owl-bot-staging/google-cloud-vm_migration-v1/CHANGELOG.md +++ /dev/null @@ -1,2 +0,0 @@ -# Release History - diff --git a/owl-bot-staging/google-cloud-vm_migration-v1/Gemfile b/owl-bot-staging/google-cloud-vm_migration-v1/Gemfile deleted file mode 100644 index 1d08558908d8..000000000000 --- a/owl-bot-staging/google-cloud-vm_migration-v1/Gemfile +++ /dev/null @@ -1,14 +0,0 @@ -source "https://rubygems.org" - -gemspec - -gem "google-style", "~> 1.32.0" -gem "irb", "~> 1.17" -gem "minitest", "~> 6.0.2" -gem "minitest-focus", "~> 1.4" -gem "minitest-mock", "~> 5.27" -gem "minitest-rg", "~> 5.3" -gem "ostruct", "~> 0.5.5" -gem "rake", ">= 13.0" -gem "redcarpet", "~> 3.6" -gem "yard", "~> 0.9" diff --git a/owl-bot-staging/google-cloud-vm_migration-v1/LICENSE.md b/owl-bot-staging/google-cloud-vm_migration-v1/LICENSE.md deleted file mode 100644 index c261857ba6ad..000000000000 --- a/owl-bot-staging/google-cloud-vm_migration-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-vm_migration-v1/README.md b/owl-bot-staging/google-cloud-vm_migration-v1/README.md deleted file mode 100644 index 2679aab0cbec..000000000000 --- a/owl-bot-staging/google-cloud-vm_migration-v1/README.md +++ /dev/null @@ -1,154 +0,0 @@ -# Ruby Client for the Migrate for Compute Engine V1 API - -Use the Migrate to Virtual Machines API to programmatically migrate workloads. - -Migrate for Compute Engine enables you to migrate (Lift and Shift) your virtual machines (VMs), with minor automatic modifications, from your source environment to Google Compute Engine. - -https://github.com/googleapis/google-cloud-ruby - -This gem is a _versioned_ client. It provides basic client classes for a -specific version of the Migrate for Compute Engine V1 API. Most users should consider using -the main client gem, -[google-cloud-vm_migration](https://rubygems.org/gems/google-cloud-vm_migration). -See the section below titled *Which client should I use?* for more information. - -## Installation - -``` -$ gem install google-cloud-vm_migration-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/vmmigration.googleapis.com) -1. [Set up authentication.](AUTHENTICATION.md) - -## Quick Start - -```ruby -require "google/cloud/vm_migration/v1" - -client = ::Google::Cloud::VMMigration::V1::VMMigration::Client.new -request = ::Google::Cloud::VMMigration::V1::ListSourcesRequest.new # (request fields as keyword arguments...) -response = client.list_sources request -``` - -View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-vm_migration-v1/latest) -for class and method documentation. - -See also the [Product Documentation](https://cloud.google.com/migrate/compute-engine/) -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/vm_migration/v1" -require "logger" - -client = ::Google::Cloud::VMMigration::V1::VMMigration::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-vm_migration`, -and lower-level _versioned_ client libraries with names such as -`google-cloud-vm_migration-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-vm_migration`. -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-vm_migration-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-vm_migration-v1/Rakefile b/owl-bot-staging/google-cloud-vm_migration-v1/Rakefile deleted file mode 100644 index cf4bd28134dd..000000000000 --- a/owl-bot-staging/google-cloud-vm_migration-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-vm_migration-v1 acceptance tests." -task :acceptance, :project, :keyfile do |t, args| - project = args[:project] - project ||= - ENV["GOOGLE_CLOUD_TEST_PROJECT"] || - ENV["GCLOUD_TEST_PROJECT"] - keyfile = args[:keyfile] - keyfile ||= - ENV["GOOGLE_CLOUD_TEST_KEYFILE"] || - ENV["GCLOUD_TEST_KEYFILE"] - if keyfile - keyfile = File.read keyfile - else - keyfile ||= - ENV["GOOGLE_CLOUD_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 GOOGLE_CLOUD_TEST_PROJECT=test123 GOOGLE_CLOUD_TEST_KEYFILE=/path/to/keyfile.json rake acceptance" - end - require "google/cloud/vm_migration/v1/vm_migration/credentials" - ::Google::Cloud::VMMigration::V1::VMMigration::Credentials.env_vars.each do |path| - ENV[path] = nil - end - ENV["GOOGLE_CLOUD_PROJECT"] = project - ENV["GOOGLE_CLOUD_TEST_PROJECT"] = project - ENV["GOOGLE_CLOUD_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-vm_migration-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-vm_migration-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-vm_migration-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-vm_migration-v1 gem does not have doctest tests." -end - -desc "Run the CI build" -task :ci do - header "BUILDING google-cloud-vm_migration-v1" - header "google-cloud-vm_migration-v1 rubocop", "*" - Rake::Task[:rubocop].invoke - header "google-cloud-vm_migration-v1 yard", "*" - Rake::Task[:yard].invoke - header "google-cloud-vm_migration-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-vm_migration-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-vm_migration-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-vm_migration-v1/gapic_metadata.json b/owl-bot-staging/google-cloud-vm_migration-v1/gapic_metadata.json deleted file mode 100644 index fca98208a8d8..000000000000 --- a/owl-bot-staging/google-cloud-vm_migration-v1/gapic_metadata.json +++ /dev/null @@ -1,328 +0,0 @@ -{ - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", - "language": "ruby", - "protoPackage": "google.cloud.vmmigration.v1", - "libraryPackage": "::Google::Cloud::VMMigration::V1", - "services": { - "VmMigration": { - "clients": { - "grpc": { - "libraryClient": "::Google::Cloud::VMMigration::V1::VMMigration::Client", - "rpcs": { - "ListSources": { - "methods": [ - "list_sources" - ] - }, - "GetSource": { - "methods": [ - "get_source" - ] - }, - "CreateSource": { - "methods": [ - "create_source" - ] - }, - "UpdateSource": { - "methods": [ - "update_source" - ] - }, - "DeleteSource": { - "methods": [ - "delete_source" - ] - }, - "FetchInventory": { - "methods": [ - "fetch_inventory" - ] - }, - "FetchStorageInventory": { - "methods": [ - "fetch_storage_inventory" - ] - }, - "ListUtilizationReports": { - "methods": [ - "list_utilization_reports" - ] - }, - "GetUtilizationReport": { - "methods": [ - "get_utilization_report" - ] - }, - "CreateUtilizationReport": { - "methods": [ - "create_utilization_report" - ] - }, - "DeleteUtilizationReport": { - "methods": [ - "delete_utilization_report" - ] - }, - "ListDatacenterConnectors": { - "methods": [ - "list_datacenter_connectors" - ] - }, - "GetDatacenterConnector": { - "methods": [ - "get_datacenter_connector" - ] - }, - "CreateDatacenterConnector": { - "methods": [ - "create_datacenter_connector" - ] - }, - "DeleteDatacenterConnector": { - "methods": [ - "delete_datacenter_connector" - ] - }, - "UpgradeAppliance": { - "methods": [ - "upgrade_appliance" - ] - }, - "CreateMigratingVm": { - "methods": [ - "create_migrating_vm" - ] - }, - "ListMigratingVms": { - "methods": [ - "list_migrating_vms" - ] - }, - "GetMigratingVm": { - "methods": [ - "get_migrating_vm" - ] - }, - "UpdateMigratingVm": { - "methods": [ - "update_migrating_vm" - ] - }, - "DeleteMigratingVm": { - "methods": [ - "delete_migrating_vm" - ] - }, - "StartMigration": { - "methods": [ - "start_migration" - ] - }, - "ResumeMigration": { - "methods": [ - "resume_migration" - ] - }, - "PauseMigration": { - "methods": [ - "pause_migration" - ] - }, - "FinalizeMigration": { - "methods": [ - "finalize_migration" - ] - }, - "ExtendMigration": { - "methods": [ - "extend_migration" - ] - }, - "CreateCloneJob": { - "methods": [ - "create_clone_job" - ] - }, - "CancelCloneJob": { - "methods": [ - "cancel_clone_job" - ] - }, - "ListCloneJobs": { - "methods": [ - "list_clone_jobs" - ] - }, - "GetCloneJob": { - "methods": [ - "get_clone_job" - ] - }, - "CreateCutoverJob": { - "methods": [ - "create_cutover_job" - ] - }, - "CancelCutoverJob": { - "methods": [ - "cancel_cutover_job" - ] - }, - "ListCutoverJobs": { - "methods": [ - "list_cutover_jobs" - ] - }, - "GetCutoverJob": { - "methods": [ - "get_cutover_job" - ] - }, - "ListGroups": { - "methods": [ - "list_groups" - ] - }, - "GetGroup": { - "methods": [ - "get_group" - ] - }, - "CreateGroup": { - "methods": [ - "create_group" - ] - }, - "UpdateGroup": { - "methods": [ - "update_group" - ] - }, - "DeleteGroup": { - "methods": [ - "delete_group" - ] - }, - "AddGroupMigration": { - "methods": [ - "add_group_migration" - ] - }, - "RemoveGroupMigration": { - "methods": [ - "remove_group_migration" - ] - }, - "ListTargetProjects": { - "methods": [ - "list_target_projects" - ] - }, - "GetTargetProject": { - "methods": [ - "get_target_project" - ] - }, - "CreateTargetProject": { - "methods": [ - "create_target_project" - ] - }, - "UpdateTargetProject": { - "methods": [ - "update_target_project" - ] - }, - "DeleteTargetProject": { - "methods": [ - "delete_target_project" - ] - }, - "ListReplicationCycles": { - "methods": [ - "list_replication_cycles" - ] - }, - "GetReplicationCycle": { - "methods": [ - "get_replication_cycle" - ] - }, - "ListImageImports": { - "methods": [ - "list_image_imports" - ] - }, - "GetImageImport": { - "methods": [ - "get_image_import" - ] - }, - "CreateImageImport": { - "methods": [ - "create_image_import" - ] - }, - "DeleteImageImport": { - "methods": [ - "delete_image_import" - ] - }, - "ListImageImportJobs": { - "methods": [ - "list_image_import_jobs" - ] - }, - "GetImageImportJob": { - "methods": [ - "get_image_import_job" - ] - }, - "CancelImageImportJob": { - "methods": [ - "cancel_image_import_job" - ] - }, - "CreateDiskMigrationJob": { - "methods": [ - "create_disk_migration_job" - ] - }, - "ListDiskMigrationJobs": { - "methods": [ - "list_disk_migration_jobs" - ] - }, - "GetDiskMigrationJob": { - "methods": [ - "get_disk_migration_job" - ] - }, - "UpdateDiskMigrationJob": { - "methods": [ - "update_disk_migration_job" - ] - }, - "DeleteDiskMigrationJob": { - "methods": [ - "delete_disk_migration_job" - ] - }, - "RunDiskMigrationJob": { - "methods": [ - "run_disk_migration_job" - ] - }, - "CancelDiskMigrationJob": { - "methods": [ - "cancel_disk_migration_job" - ] - } - } - } - } - } - } -} diff --git a/owl-bot-staging/google-cloud-vm_migration-v1/google-cloud-vm_migration-v1.gemspec b/owl-bot-staging/google-cloud-vm_migration-v1/google-cloud-vm_migration-v1.gemspec deleted file mode 100644 index edd25868427c..000000000000 --- a/owl-bot-staging/google-cloud-vm_migration-v1/google-cloud-vm_migration-v1.gemspec +++ /dev/null @@ -1,30 +0,0 @@ -# -*- ruby -*- -# encoding: utf-8 - -require File.expand_path("lib/google/cloud/vm_migration/v1/version", __dir__) - -Gem::Specification.new do |gem| - gem.name = "google-cloud-vm_migration-v1" - gem.version = Google::Cloud::VMMigration::V1::VERSION - - gem.authors = ["Google LLC"] - gem.email = "googleapis-packages@google.com" - gem.description = "Migrate for Compute Engine enables you to migrate (Lift and Shift) your virtual machines (VMs), with minor automatic modifications, from your source environment to Google Compute Engine. Note that google-cloud-vm_migration-v1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-vm_migration instead. See the readme for more details." - gem.summary = "Use the Migrate to Virtual Machines API to programmatically migrate workloads." - 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.2" - - 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 "grpc-google-iam-v1", "~> 1.11" -end diff --git a/owl-bot-staging/google-cloud-vm_migration-v1/lib/google-cloud-vm_migration-v1.rb b/owl-bot-staging/google-cloud-vm_migration-v1/lib/google-cloud-vm_migration-v1.rb deleted file mode 100644 index 04975c68877a..000000000000 --- a/owl-bot-staging/google-cloud-vm_migration-v1/lib/google-cloud-vm_migration-v1.rb +++ /dev/null @@ -1,22 +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/vm_migration/v1" -# require "google/iam/v1" diff --git a/owl-bot-staging/google-cloud-vm_migration-v1/lib/google/cloud/vm_migration/v1.rb b/owl-bot-staging/google-cloud-vm_migration-v1/lib/google/cloud/vm_migration/v1.rb deleted file mode 100644 index b8a6cc16fb6f..000000000000 --- a/owl-bot-staging/google-cloud-vm_migration-v1/lib/google/cloud/vm_migration/v1.rb +++ /dev/null @@ -1,45 +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/vm_migration/v1/vm_migration" -require "google/cloud/vm_migration/v1/version" - -module Google - module Cloud - module VMMigration - ## - # API client module. - # - # @example Load this package, including all its services, and instantiate a gRPC client - # - # require "google/cloud/vm_migration/v1" - # client = ::Google::Cloud::VMMigration::V1::VMMigration::Client.new - # - # @example Load this package, including all its services, and instantiate a REST client - # - # require "google/cloud/vm_migration/v1" - # client = ::Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new - # - module V1 - end - end - end -end - -helper_path = ::File.join __dir__, "v1", "_helpers.rb" -require "google/cloud/vm_migration/v1/_helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-vm_migration-v1/lib/google/cloud/vm_migration/v1/bindings_override.rb b/owl-bot-staging/google-cloud-vm_migration-v1/lib/google/cloud/vm_migration/v1/bindings_override.rb deleted file mode 100644 index a2afa26a3b79..000000000000 --- a/owl-bot-staging/google-cloud-vm_migration-v1/lib/google/cloud/vm_migration/v1/bindings_override.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! - -require "gapic/rest" - -module Google - module Cloud - module VMMigration - ## - # @example Loading just the REST part of this package, including all its services, and instantiating a REST client - # - # require "google/cloud/vm_migration/v1/rest" - # client = ::Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new - # - module V1 - ## - # @private - # Initialize the mixin bindings configuration - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "VMMigration"] - 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 - end - yield @configure if block_given? - @configure - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-vm_migration-v1/lib/google/cloud/vm_migration/v1/rest.rb b/owl-bot-staging/google-cloud-vm_migration-v1/lib/google/cloud/vm_migration/v1/rest.rb deleted file mode 100644 index 4685fa902488..000000000000 --- a/owl-bot-staging/google-cloud-vm_migration-v1/lib/google/cloud/vm_migration/v1/rest.rb +++ /dev/null @@ -1,38 +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/vm_migration/v1/vm_migration/rest" -require "google/cloud/vm_migration/v1/bindings_override" -require "google/cloud/vm_migration/v1/version" - -module Google - module Cloud - module VMMigration - ## - # To load just the REST part of this package, including all its services, and instantiate a REST client: - # - # @example - # - # require "google/cloud/vm_migration/v1/rest" - # client = ::Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new - # - module V1 - end - end - end -end diff --git a/owl-bot-staging/google-cloud-vm_migration-v1/lib/google/cloud/vm_migration/v1/version.rb b/owl-bot-staging/google-cloud-vm_migration-v1/lib/google/cloud/vm_migration/v1/version.rb deleted file mode 100644 index a9da1f8b2936..000000000000 --- a/owl-bot-staging/google-cloud-vm_migration-v1/lib/google/cloud/vm_migration/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 VMMigration - module V1 - VERSION = "0.0.1" - end - end - end -end diff --git a/owl-bot-staging/google-cloud-vm_migration-v1/lib/google/cloud/vm_migration/v1/vm_migration.rb b/owl-bot-staging/google-cloud-vm_migration-v1/lib/google/cloud/vm_migration/v1/vm_migration.rb deleted file mode 100644 index dc908ff6c0cb..000000000000 --- a/owl-bot-staging/google-cloud-vm_migration-v1/lib/google/cloud/vm_migration/v1/vm_migration.rb +++ /dev/null @@ -1,56 +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/vm_migration/v1/version" - -require "google/cloud/vm_migration/v1/vm_migration/credentials" -require "google/cloud/vm_migration/v1/vm_migration/paths" -require "google/cloud/vm_migration/v1/vm_migration/operations" -require "google/cloud/vm_migration/v1/vm_migration/client" -require "google/cloud/vm_migration/v1/vm_migration/rest" - -module Google - module Cloud - module VMMigration - module V1 - ## - # VM Migration Service - # - # @example Load this service and instantiate a gRPC client - # - # require "google/cloud/vm_migration/v1/vm_migration" - # client = ::Google::Cloud::VMMigration::V1::VMMigration::Client.new - # - # @example Load this service and instantiate a REST client - # - # require "google/cloud/vm_migration/v1/vm_migration/rest" - # client = ::Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new - # - module VMMigration - end - end - end - end -end - -helper_path = ::File.join __dir__, "vm_migration", "helpers.rb" -require "google/cloud/vm_migration/v1/vm_migration/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-vm_migration-v1/lib/google/cloud/vm_migration/v1/vm_migration/client.rb b/owl-bot-staging/google-cloud-vm_migration-v1/lib/google/cloud/vm_migration/v1/vm_migration/client.rb deleted file mode 100644 index 28b07bf0ae98..000000000000 --- a/owl-bot-staging/google-cloud-vm_migration-v1/lib/google/cloud/vm_migration/v1/vm_migration/client.rb +++ /dev/null @@ -1,7173 +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/vmmigration/v1/vmmigration_pb" -require "google/cloud/location" - -module Google - module Cloud - module VMMigration - module V1 - module VMMigration - ## - # Client for the VmMigration service. - # - # VM Migration Service - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "vmmigration.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :vm_migration_stub - - ## - # Configure the VmMigration Client class. - # - # See {::Google::Cloud::VMMigration::V1::VMMigration::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all VmMigration clients - # ::Google::Cloud::VMMigration::V1::VMMigration::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", "VMMigration", "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.timeout = 60.0 - - default_config.rpcs.create_source.timeout = 900.0 - - default_config.rpcs.fetch_inventory.timeout = 300.0 - - default_config.rpcs.create_utilization_report.timeout = 300.0 - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the VmMigration 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::VMMigration::V1::VMMigration::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 - @vm_migration_stub.universe_domain - end - - ## - # Create a new VmMigration client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::VMMigration::V1::VMMigration::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::VMMigration::V1::VMMigration::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the VmMigration 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/vmmigration/v1/vmmigration_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 - - @vm_migration_stub = ::Gapic::ServiceStub.new( - ::Google::Cloud::VMMigration::V1::VmMigration::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 - ) - - @vm_migration_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 = @vm_migration_stub.endpoint - config.universe_domain = @vm_migration_stub.universe_domain - config.logger = @vm_migration_stub.logger if config.respond_to? :logger= - end - end - - ## - # Get the associated client for long-running operations. - # - # @return [::Google::Cloud::VMMigration::V1::VMMigration::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 - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @vm_migration_stub.logger - end - - # Service calls - - ## - # Lists Sources in a given project and location. - # - # @overload list_sources(request, options = nil) - # Pass arguments to `list_sources` via a request object, either of type - # {::Google::Cloud::VMMigration::V1::ListSourcesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VMMigration::V1::ListSourcesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_sources(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) - # Pass arguments to `list_sources` via keyword arguments. Note that at - # least one keyword argument is 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 parent, which owns this collection of sources. - # @param page_size [::Integer] - # Optional. The maximum number of sources to return. The service may return - # fewer than this value. If unspecified, at most 500 sources will be - # returned. The maximum value is 1000; values above 1000 will be coerced to - # 1000. - # @param page_token [::String] - # Required. A page token, received from a previous `ListSources` call. - # Provide this to retrieve the subsequent page. - # - # When paginating, all other parameters provided to `ListSources` must - # match the call that provided the page token. - # @param filter [::String] - # Optional. The filter request. - # @param order_by [::String] - # Optional. the order by fields for the result. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::VMMigration::V1::Source>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::VMMigration::V1::Source>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/vm_migration/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VMMigration::V1::VMMigration::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VMMigration::V1::ListSourcesRequest.new - # - # # Call the list_sources method. - # result = client.list_sources 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::VMMigration::V1::Source. - # p item - # end - # - def list_sources request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::ListSourcesRequest - - # Converts hash 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_sources.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::VMMigration::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_sources.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_sources.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vm_migration_stub.call_rpc :list_sources, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @vm_migration_stub, :list_sources, 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 - - ## - # Gets details of a single Source. - # - # @overload get_source(request, options = nil) - # Pass arguments to `get_source` via a request object, either of type - # {::Google::Cloud::VMMigration::V1::GetSourceRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VMMigration::V1::GetSourceRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_source(name: nil) - # Pass arguments to `get_source` via keyword arguments. Note that at - # least one keyword argument is 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 Source name. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::VMMigration::V1::Source] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::VMMigration::V1::Source] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/vm_migration/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VMMigration::V1::VMMigration::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VMMigration::V1::GetSourceRequest.new - # - # # Call the get_source method. - # result = client.get_source request - # - # # The returned object is of type Google::Cloud::VMMigration::V1::Source. - # p result - # - def get_source request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::GetSourceRequest - - # Converts hash 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_source.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::VMMigration::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_source.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_source.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vm_migration_stub.call_rpc :get_source, 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 Source in a given project and location. - # - # @overload create_source(request, options = nil) - # Pass arguments to `create_source` via a request object, either of type - # {::Google::Cloud::VMMigration::V1::CreateSourceRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VMMigration::V1::CreateSourceRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_source(parent: nil, source_id: nil, source: nil, request_id: nil) - # Pass arguments to `create_source` via keyword arguments. Note that at - # least one keyword argument is 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 Source's parent. - # @param source_id [::String] - # Required. The source identifier. - # @param source [::Google::Cloud::VMMigration::V1::Source, ::Hash] - # Required. The create request body. - # @param request_id [::String] - # A request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server will guarantee - # that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # - # @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/vm_migration/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VMMigration::V1::VMMigration::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VMMigration::V1::CreateSourceRequest.new - # - # # Call the create_source method. - # result = client.create_source 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_source request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::CreateSourceRequest - - # Converts hash 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_source.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::VMMigration::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_source.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_source.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vm_migration_stub.call_rpc :create_source, 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 - - ## - # Updates the parameters of a single Source. - # - # @overload update_source(request, options = nil) - # Pass arguments to `update_source` via a request object, either of type - # {::Google::Cloud::VMMigration::V1::UpdateSourceRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VMMigration::V1::UpdateSourceRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_source(update_mask: nil, source: nil, request_id: nil) - # Pass arguments to `update_source` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Field mask is used to specify the fields to be overwritten in the - # Source resource by the update. - # The fields specified in the update_mask are relative to the resource, not - # the full request. A field will be overwritten if it is in the mask. If the - # user does not provide a mask then all fields will be overwritten. - # @param source [::Google::Cloud::VMMigration::V1::Source, ::Hash] - # Required. The update request body. - # @param request_id [::String] - # A request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server will guarantee - # that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # - # @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/vm_migration/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VMMigration::V1::VMMigration::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VMMigration::V1::UpdateSourceRequest.new - # - # # Call the update_source method. - # result = client.update_source 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 update_source request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::UpdateSourceRequest - - # Converts hash 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_source.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::VMMigration::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.source&.name - header_params["source.name"] = request.source.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_source.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_source.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vm_migration_stub.call_rpc :update_source, 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 single Source. - # - # @overload delete_source(request, options = nil) - # Pass arguments to `delete_source` via a request object, either of type - # {::Google::Cloud::VMMigration::V1::DeleteSourceRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VMMigration::V1::DeleteSourceRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_source(name: nil, request_id: nil) - # Pass arguments to `delete_source` via keyword arguments. Note that at - # least one keyword argument is 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 Source name. - # @param request_id [::String] - # Optional. A request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server will guarantee - # that for at least 60 minutes after the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # - # @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/vm_migration/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VMMigration::V1::VMMigration::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VMMigration::V1::DeleteSourceRequest.new - # - # # Call the delete_source method. - # result = client.delete_source 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_source request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::DeleteSourceRequest - - # Converts hash 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_source.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::VMMigration::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_source.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_source.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vm_migration_stub.call_rpc :delete_source, 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 - - ## - # List remote source's inventory of VMs. - # The remote source is the onprem vCenter (remote in the sense it's not in - # Compute Engine). The inventory describes the list of existing VMs in that - # source. Note that this operation lists the VMs on the remote source, as - # opposed to listing the MigratingVms resources in the vmmigration service. - # - # @overload fetch_inventory(request, options = nil) - # Pass arguments to `fetch_inventory` via a request object, either of type - # {::Google::Cloud::VMMigration::V1::FetchInventoryRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VMMigration::V1::FetchInventoryRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload fetch_inventory(source: nil, force_refresh: nil) - # Pass arguments to `fetch_inventory` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param source [::String] - # Required. The name of the Source. - # @param force_refresh [::Boolean] - # If this flag is set to true, the source will be queried instead of using - # cached results. Using this flag will make the call slower. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::VMMigration::V1::FetchInventoryResponse] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::VMMigration::V1::FetchInventoryResponse] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/vm_migration/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VMMigration::V1::VMMigration::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VMMigration::V1::FetchInventoryRequest.new - # - # # Call the fetch_inventory method. - # result = client.fetch_inventory request - # - # # The returned object is of type Google::Cloud::VMMigration::V1::FetchInventoryResponse. - # p result - # - def fetch_inventory request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::FetchInventoryRequest - - # Converts hash 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.fetch_inventory.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::VMMigration::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.source - header_params["source"] = request.source - 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.fetch_inventory.timeout, - metadata: metadata, - retry_policy: @config.rpcs.fetch_inventory.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vm_migration_stub.call_rpc :fetch_inventory, 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 - - ## - # List remote source's inventory of storage resources. - # The remote source is another cloud vendor (e.g. AWS, Azure). - # The inventory describes the list of existing storage resources in that - # source. Note that this operation lists the resources on the remote source, - # as opposed to listing the MigratingVms resources in the vmmigration - # service. - # - # @overload fetch_storage_inventory(request, options = nil) - # Pass arguments to `fetch_storage_inventory` via a request object, either of type - # {::Google::Cloud::VMMigration::V1::FetchStorageInventoryRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VMMigration::V1::FetchStorageInventoryRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload fetch_storage_inventory(source: nil, type: nil, force_refresh: nil, page_size: nil, page_token: nil) - # Pass arguments to `fetch_storage_inventory` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param source [::String] - # Required. The name of the Source. - # @param type [::Google::Cloud::VMMigration::V1::FetchStorageInventoryRequest::StorageType] - # Required. The type of the storage inventory to fetch. - # @param force_refresh [::Boolean] - # Optional. If this flag is set to true, the source will be queried instead - # of using cached results. Using this flag will make the call slower. - # @param page_size [::Integer] - # Optional. The maximum number of VMs to return. The service may return - # fewer than this value. - # @param page_token [::String] - # Optional. A page token, received from a previous `FetchStorageInventory` - # call. Provide this to retrieve the subsequent page. When paginating, all - # other parameters provided to `FetchStorageInventory` must match the call - # that provided the page token. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::VMMigration::V1::SourceStorageResource>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::VMMigration::V1::SourceStorageResource>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/vm_migration/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VMMigration::V1::VMMigration::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VMMigration::V1::FetchStorageInventoryRequest.new - # - # # Call the fetch_storage_inventory method. - # result = client.fetch_storage_inventory 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::VMMigration::V1::SourceStorageResource. - # p item - # end - # - def fetch_storage_inventory request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::FetchStorageInventoryRequest - - # Converts hash 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.fetch_storage_inventory.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::VMMigration::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.source - header_params["source"] = request.source - 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.fetch_storage_inventory.timeout, - metadata: metadata, - retry_policy: @config.rpcs.fetch_storage_inventory.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vm_migration_stub.call_rpc :fetch_storage_inventory, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @vm_migration_stub, :fetch_storage_inventory, 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 Utilization Reports of the given Source. - # - # @overload list_utilization_reports(request, options = nil) - # Pass arguments to `list_utilization_reports` via a request object, either of type - # {::Google::Cloud::VMMigration::V1::ListUtilizationReportsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VMMigration::V1::ListUtilizationReportsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_utilization_reports(parent: nil, view: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) - # Pass arguments to `list_utilization_reports` via keyword arguments. Note that at - # least one keyword argument is 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 Utilization Reports parent. - # @param view [::Google::Cloud::VMMigration::V1::UtilizationReportView] - # Optional. The level of details of each report. - # Defaults to BASIC. - # @param page_size [::Integer] - # Optional. The maximum number of reports to return. The service may return - # fewer than this value. If unspecified, at most 500 reports will be - # returned. The maximum value is 1000; values above 1000 will be coerced to - # 1000. - # @param page_token [::String] - # Required. A page token, received from a previous `ListUtilizationReports` - # call. Provide this to retrieve the subsequent page. - # - # When paginating, all other parameters provided to `ListUtilizationReports` - # must match the call that provided the page token. - # @param filter [::String] - # Optional. The filter request. - # @param order_by [::String] - # Optional. the order by fields for the result. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::VMMigration::V1::UtilizationReport>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::VMMigration::V1::UtilizationReport>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/vm_migration/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VMMigration::V1::VMMigration::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VMMigration::V1::ListUtilizationReportsRequest.new - # - # # Call the list_utilization_reports method. - # result = client.list_utilization_reports 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::VMMigration::V1::UtilizationReport. - # p item - # end - # - def list_utilization_reports request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::ListUtilizationReportsRequest - - # Converts hash 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_utilization_reports.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::VMMigration::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_utilization_reports.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_utilization_reports.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vm_migration_stub.call_rpc :list_utilization_reports, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @vm_migration_stub, :list_utilization_reports, 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 - - ## - # Gets a single Utilization Report. - # - # @overload get_utilization_report(request, options = nil) - # Pass arguments to `get_utilization_report` via a request object, either of type - # {::Google::Cloud::VMMigration::V1::GetUtilizationReportRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VMMigration::V1::GetUtilizationReportRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_utilization_report(name: nil, view: nil) - # Pass arguments to `get_utilization_report` via keyword arguments. Note that at - # least one keyword argument is 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 Utilization Report name. - # @param view [::Google::Cloud::VMMigration::V1::UtilizationReportView] - # Optional. The level of details of the report. - # Defaults to FULL - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::VMMigration::V1::UtilizationReport] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::VMMigration::V1::UtilizationReport] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/vm_migration/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VMMigration::V1::VMMigration::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VMMigration::V1::GetUtilizationReportRequest.new - # - # # Call the get_utilization_report method. - # result = client.get_utilization_report request - # - # # The returned object is of type Google::Cloud::VMMigration::V1::UtilizationReport. - # p result - # - def get_utilization_report request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::GetUtilizationReportRequest - - # Converts hash 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_utilization_report.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::VMMigration::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_utilization_report.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_utilization_report.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vm_migration_stub.call_rpc :get_utilization_report, 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 UtilizationReport. - # - # @overload create_utilization_report(request, options = nil) - # Pass arguments to `create_utilization_report` via a request object, either of type - # {::Google::Cloud::VMMigration::V1::CreateUtilizationReportRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VMMigration::V1::CreateUtilizationReportRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_utilization_report(parent: nil, utilization_report: nil, utilization_report_id: nil, request_id: nil) - # Pass arguments to `create_utilization_report` via keyword arguments. Note that at - # least one keyword argument is 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 Utilization Report's parent. - # @param utilization_report [::Google::Cloud::VMMigration::V1::UtilizationReport, ::Hash] - # Required. The report to create. - # @param utilization_report_id [::String] - # Required. The ID to use for the report, which will become the final - # component of the reports's resource name. - # - # This value maximum length is 63 characters, and valid characters - # are /[a-z][0-9]-/. It must start with an english letter and must not - # end with a hyphen. - # @param request_id [::String] - # A request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server will guarantee - # that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # - # @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/vm_migration/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VMMigration::V1::VMMigration::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VMMigration::V1::CreateUtilizationReportRequest.new - # - # # Call the create_utilization_report method. - # result = client.create_utilization_report 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_utilization_report request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::CreateUtilizationReportRequest - - # Converts hash 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_utilization_report.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::VMMigration::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_utilization_report.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_utilization_report.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vm_migration_stub.call_rpc :create_utilization_report, 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 single Utilization Report. - # - # @overload delete_utilization_report(request, options = nil) - # Pass arguments to `delete_utilization_report` via a request object, either of type - # {::Google::Cloud::VMMigration::V1::DeleteUtilizationReportRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VMMigration::V1::DeleteUtilizationReportRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_utilization_report(name: nil, request_id: nil) - # Pass arguments to `delete_utilization_report` via keyword arguments. Note that at - # least one keyword argument is 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 Utilization Report name. - # @param request_id [::String] - # Optional. A request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server will guarantee - # that for at least 60 minutes after the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # - # @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/vm_migration/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VMMigration::V1::VMMigration::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VMMigration::V1::DeleteUtilizationReportRequest.new - # - # # Call the delete_utilization_report method. - # result = client.delete_utilization_report 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_utilization_report request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::DeleteUtilizationReportRequest - - # Converts hash 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_utilization_report.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::VMMigration::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_utilization_report.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_utilization_report.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vm_migration_stub.call_rpc :delete_utilization_report, 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 - - ## - # Lists DatacenterConnectors in a given Source. - # - # @overload list_datacenter_connectors(request, options = nil) - # Pass arguments to `list_datacenter_connectors` via a request object, either of type - # {::Google::Cloud::VMMigration::V1::ListDatacenterConnectorsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VMMigration::V1::ListDatacenterConnectorsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_datacenter_connectors(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) - # Pass arguments to `list_datacenter_connectors` via keyword arguments. Note that at - # least one keyword argument is 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 parent, which owns this collection of connectors. - # @param page_size [::Integer] - # Optional. The maximum number of connectors to return. The service may - # return fewer than this value. If unspecified, at most 500 sources will be - # returned. The maximum value is 1000; values above 1000 will be coerced to - # 1000. - # @param page_token [::String] - # Required. A page token, received from a previous `ListDatacenterConnectors` - # call. Provide this to retrieve the subsequent page. - # - # When paginating, all other parameters provided to - # `ListDatacenterConnectors` must match the call that provided the page - # token. - # @param filter [::String] - # Optional. The filter request. - # @param order_by [::String] - # Optional. the order by fields for the result. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::VMMigration::V1::DatacenterConnector>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::VMMigration::V1::DatacenterConnector>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/vm_migration/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VMMigration::V1::VMMigration::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VMMigration::V1::ListDatacenterConnectorsRequest.new - # - # # Call the list_datacenter_connectors method. - # result = client.list_datacenter_connectors 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::VMMigration::V1::DatacenterConnector. - # p item - # end - # - def list_datacenter_connectors request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::ListDatacenterConnectorsRequest - - # Converts hash 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_datacenter_connectors.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::VMMigration::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_datacenter_connectors.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_datacenter_connectors.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vm_migration_stub.call_rpc :list_datacenter_connectors, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @vm_migration_stub, :list_datacenter_connectors, 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 - - ## - # Gets details of a single DatacenterConnector. - # - # @overload get_datacenter_connector(request, options = nil) - # Pass arguments to `get_datacenter_connector` via a request object, either of type - # {::Google::Cloud::VMMigration::V1::GetDatacenterConnectorRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VMMigration::V1::GetDatacenterConnectorRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_datacenter_connector(name: nil) - # Pass arguments to `get_datacenter_connector` via keyword arguments. Note that at - # least one keyword argument is 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 name of the DatacenterConnector. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::VMMigration::V1::DatacenterConnector] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::VMMigration::V1::DatacenterConnector] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/vm_migration/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VMMigration::V1::VMMigration::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VMMigration::V1::GetDatacenterConnectorRequest.new - # - # # Call the get_datacenter_connector method. - # result = client.get_datacenter_connector request - # - # # The returned object is of type Google::Cloud::VMMigration::V1::DatacenterConnector. - # p result - # - def get_datacenter_connector request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::GetDatacenterConnectorRequest - - # Converts hash 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_datacenter_connector.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::VMMigration::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_datacenter_connector.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_datacenter_connector.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vm_migration_stub.call_rpc :get_datacenter_connector, 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 DatacenterConnector in a given Source. - # - # @overload create_datacenter_connector(request, options = nil) - # Pass arguments to `create_datacenter_connector` via a request object, either of type - # {::Google::Cloud::VMMigration::V1::CreateDatacenterConnectorRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VMMigration::V1::CreateDatacenterConnectorRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_datacenter_connector(parent: nil, datacenter_connector_id: nil, datacenter_connector: nil, request_id: nil) - # Pass arguments to `create_datacenter_connector` via keyword arguments. Note that at - # least one keyword argument is 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 DatacenterConnector's parent. - # Required. The Source in where the new DatacenterConnector will be created. - # For example: - # `projects/my-project/locations/us-central1/sources/my-source` - # @param datacenter_connector_id [::String] - # Required. The datacenterConnector identifier. - # @param datacenter_connector [::Google::Cloud::VMMigration::V1::DatacenterConnector, ::Hash] - # Required. The create request body. - # @param request_id [::String] - # A request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server will guarantee - # that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # - # @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/vm_migration/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VMMigration::V1::VMMigration::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VMMigration::V1::CreateDatacenterConnectorRequest.new - # - # # Call the create_datacenter_connector method. - # result = client.create_datacenter_connector 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_datacenter_connector request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::CreateDatacenterConnectorRequest - - # Converts hash 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_datacenter_connector.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::VMMigration::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_datacenter_connector.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_datacenter_connector.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vm_migration_stub.call_rpc :create_datacenter_connector, 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 single DatacenterConnector. - # - # @overload delete_datacenter_connector(request, options = nil) - # Pass arguments to `delete_datacenter_connector` via a request object, either of type - # {::Google::Cloud::VMMigration::V1::DeleteDatacenterConnectorRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VMMigration::V1::DeleteDatacenterConnectorRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_datacenter_connector(name: nil, request_id: nil) - # Pass arguments to `delete_datacenter_connector` via keyword arguments. Note that at - # least one keyword argument is 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 DatacenterConnector name. - # @param request_id [::String] - # A request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server will guarantee - # that for at least 60 minutes after the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # - # @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/vm_migration/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VMMigration::V1::VMMigration::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VMMigration::V1::DeleteDatacenterConnectorRequest.new - # - # # Call the delete_datacenter_connector method. - # result = client.delete_datacenter_connector 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_datacenter_connector request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::DeleteDatacenterConnectorRequest - - # Converts hash 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_datacenter_connector.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::VMMigration::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_datacenter_connector.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_datacenter_connector.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vm_migration_stub.call_rpc :delete_datacenter_connector, 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 - - ## - # Upgrades the appliance relate to this DatacenterConnector to the in-place - # updateable version. - # - # @overload upgrade_appliance(request, options = nil) - # Pass arguments to `upgrade_appliance` via a request object, either of type - # {::Google::Cloud::VMMigration::V1::UpgradeApplianceRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VMMigration::V1::UpgradeApplianceRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload upgrade_appliance(datacenter_connector: nil, request_id: nil) - # Pass arguments to `upgrade_appliance` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param datacenter_connector [::String] - # Required. The DatacenterConnector name. - # @param request_id [::String] - # A request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server will guarantee - # that for at least 60 minutes after the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # - # @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/vm_migration/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VMMigration::V1::VMMigration::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VMMigration::V1::UpgradeApplianceRequest.new - # - # # Call the upgrade_appliance method. - # result = client.upgrade_appliance 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 upgrade_appliance request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::UpgradeApplianceRequest - - # Converts hash 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.upgrade_appliance.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::VMMigration::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.datacenter_connector - header_params["datacenter_connector"] = request.datacenter_connector - 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.upgrade_appliance.timeout, - metadata: metadata, - retry_policy: @config.rpcs.upgrade_appliance.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vm_migration_stub.call_rpc :upgrade_appliance, 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 MigratingVm in a given Source. - # - # @overload create_migrating_vm(request, options = nil) - # Pass arguments to `create_migrating_vm` via a request object, either of type - # {::Google::Cloud::VMMigration::V1::CreateMigratingVmRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VMMigration::V1::CreateMigratingVmRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_migrating_vm(parent: nil, migrating_vm_id: nil, migrating_vm: nil, request_id: nil) - # Pass arguments to `create_migrating_vm` via keyword arguments. Note that at - # least one keyword argument is 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 MigratingVm's parent. - # @param migrating_vm_id [::String] - # Required. The migratingVm identifier. - # @param migrating_vm [::Google::Cloud::VMMigration::V1::MigratingVm, ::Hash] - # Required. The create request body. - # @param request_id [::String] - # A request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server will guarantee - # that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # - # @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/vm_migration/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VMMigration::V1::VMMigration::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VMMigration::V1::CreateMigratingVmRequest.new - # - # # Call the create_migrating_vm method. - # result = client.create_migrating_vm 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_migrating_vm request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::CreateMigratingVmRequest - - # Converts hash 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_migrating_vm.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::VMMigration::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_migrating_vm.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_migrating_vm.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vm_migration_stub.call_rpc :create_migrating_vm, 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 - - ## - # Lists MigratingVms in a given Source. - # - # @overload list_migrating_vms(request, options = nil) - # Pass arguments to `list_migrating_vms` via a request object, either of type - # {::Google::Cloud::VMMigration::V1::ListMigratingVmsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VMMigration::V1::ListMigratingVmsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_migrating_vms(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil, view: nil) - # Pass arguments to `list_migrating_vms` via keyword arguments. Note that at - # least one keyword argument is 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 parent, which owns this collection of MigratingVms. - # @param page_size [::Integer] - # Optional. The maximum number of migrating VMs to return. The service may - # return fewer than this value. If unspecified, at most 500 migrating VMs - # will be returned. The maximum value is 1000; values above 1000 will be - # coerced to 1000. - # @param page_token [::String] - # Required. A page token, received from a previous `ListMigratingVms` call. - # Provide this to retrieve the subsequent page. - # - # When paginating, all other parameters provided to `ListMigratingVms` - # must match the call that provided the page token. - # @param filter [::String] - # Optional. The filter request. - # @param order_by [::String] - # Optional. the order by fields for the result. - # @param view [::Google::Cloud::VMMigration::V1::MigratingVmView] - # Optional. The level of details of each migrating VM. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::VMMigration::V1::MigratingVm>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::VMMigration::V1::MigratingVm>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/vm_migration/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VMMigration::V1::VMMigration::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VMMigration::V1::ListMigratingVmsRequest.new - # - # # Call the list_migrating_vms method. - # result = client.list_migrating_vms 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::VMMigration::V1::MigratingVm. - # p item - # end - # - def list_migrating_vms request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::ListMigratingVmsRequest - - # Converts hash 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_migrating_vms.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::VMMigration::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_migrating_vms.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_migrating_vms.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vm_migration_stub.call_rpc :list_migrating_vms, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @vm_migration_stub, :list_migrating_vms, 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 - - ## - # Gets details of a single MigratingVm. - # - # @overload get_migrating_vm(request, options = nil) - # Pass arguments to `get_migrating_vm` via a request object, either of type - # {::Google::Cloud::VMMigration::V1::GetMigratingVmRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VMMigration::V1::GetMigratingVmRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_migrating_vm(name: nil, view: nil) - # Pass arguments to `get_migrating_vm` via keyword arguments. Note that at - # least one keyword argument is 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 name of the MigratingVm. - # @param view [::Google::Cloud::VMMigration::V1::MigratingVmView] - # Optional. The level of details of the migrating VM. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::VMMigration::V1::MigratingVm] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::VMMigration::V1::MigratingVm] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/vm_migration/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VMMigration::V1::VMMigration::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VMMigration::V1::GetMigratingVmRequest.new - # - # # Call the get_migrating_vm method. - # result = client.get_migrating_vm request - # - # # The returned object is of type Google::Cloud::VMMigration::V1::MigratingVm. - # p result - # - def get_migrating_vm request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::GetMigratingVmRequest - - # Converts hash 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_migrating_vm.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::VMMigration::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_migrating_vm.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_migrating_vm.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vm_migration_stub.call_rpc :get_migrating_vm, 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 parameters of a single MigratingVm. - # - # @overload update_migrating_vm(request, options = nil) - # Pass arguments to `update_migrating_vm` via a request object, either of type - # {::Google::Cloud::VMMigration::V1::UpdateMigratingVmRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VMMigration::V1::UpdateMigratingVmRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_migrating_vm(update_mask: nil, migrating_vm: nil, request_id: nil) - # Pass arguments to `update_migrating_vm` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Field mask is used to specify the fields to be overwritten in the - # MigratingVm resource by the update. - # The fields specified in the update_mask are relative to the resource, not - # the full request. A field will be overwritten if it is in the mask. If the - # user does not provide a mask then all fields will be overwritten. - # @param migrating_vm [::Google::Cloud::VMMigration::V1::MigratingVm, ::Hash] - # Required. The update request body. - # @param request_id [::String] - # A request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server will guarantee - # that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # - # @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/vm_migration/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VMMigration::V1::VMMigration::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VMMigration::V1::UpdateMigratingVmRequest.new - # - # # Call the update_migrating_vm method. - # result = client.update_migrating_vm 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 update_migrating_vm request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::UpdateMigratingVmRequest - - # Converts hash 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_migrating_vm.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::VMMigration::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.migrating_vm&.name - header_params["migrating_vm.name"] = request.migrating_vm.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_migrating_vm.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_migrating_vm.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vm_migration_stub.call_rpc :update_migrating_vm, 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 single MigratingVm. - # - # @overload delete_migrating_vm(request, options = nil) - # Pass arguments to `delete_migrating_vm` via a request object, either of type - # {::Google::Cloud::VMMigration::V1::DeleteMigratingVmRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VMMigration::V1::DeleteMigratingVmRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_migrating_vm(name: nil) - # Pass arguments to `delete_migrating_vm` via keyword arguments. Note that at - # least one keyword argument is 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 name of the MigratingVm. - # - # @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/vm_migration/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VMMigration::V1::VMMigration::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VMMigration::V1::DeleteMigratingVmRequest.new - # - # # Call the delete_migrating_vm method. - # result = client.delete_migrating_vm 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_migrating_vm request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::DeleteMigratingVmRequest - - # Converts hash 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_migrating_vm.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::VMMigration::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_migrating_vm.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_migrating_vm.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vm_migration_stub.call_rpc :delete_migrating_vm, 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 - - ## - # Starts migration for a VM. Starts the process of uploading - # data and creating snapshots, in replication cycles scheduled by the policy. - # - # @overload start_migration(request, options = nil) - # Pass arguments to `start_migration` via a request object, either of type - # {::Google::Cloud::VMMigration::V1::StartMigrationRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VMMigration::V1::StartMigrationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload start_migration(migrating_vm: nil) - # Pass arguments to `start_migration` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param migrating_vm [::String] - # Required. The name of the MigratingVm. - # - # @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/vm_migration/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VMMigration::V1::VMMigration::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VMMigration::V1::StartMigrationRequest.new - # - # # Call the start_migration method. - # result = client.start_migration 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 start_migration request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::StartMigrationRequest - - # Converts hash 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.start_migration.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::VMMigration::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.migrating_vm - header_params["migrating_vm"] = request.migrating_vm - 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.start_migration.timeout, - metadata: metadata, - retry_policy: @config.rpcs.start_migration.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vm_migration_stub.call_rpc :start_migration, 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 - - ## - # Resumes a migration for a VM. When called on a paused migration, will start - # the process of uploading data and creating snapshots; when called on a - # completed cut-over migration, will update the migration to active state and - # start the process of uploading data and creating snapshots. - # - # @overload resume_migration(request, options = nil) - # Pass arguments to `resume_migration` via a request object, either of type - # {::Google::Cloud::VMMigration::V1::ResumeMigrationRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VMMigration::V1::ResumeMigrationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload resume_migration(migrating_vm: nil) - # Pass arguments to `resume_migration` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param migrating_vm [::String] - # Required. The name of the MigratingVm. - # - # @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/vm_migration/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VMMigration::V1::VMMigration::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VMMigration::V1::ResumeMigrationRequest.new - # - # # Call the resume_migration method. - # result = client.resume_migration 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 resume_migration request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::ResumeMigrationRequest - - # Converts hash 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.resume_migration.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::VMMigration::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.migrating_vm - header_params["migrating_vm"] = request.migrating_vm - 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.resume_migration.timeout, - metadata: metadata, - retry_policy: @config.rpcs.resume_migration.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vm_migration_stub.call_rpc :resume_migration, 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 - - ## - # Pauses a migration for a VM. If cycle tasks are running they will be - # cancelled, preserving source task data. Further replication cycles will not - # be triggered while the VM is paused. - # - # @overload pause_migration(request, options = nil) - # Pass arguments to `pause_migration` via a request object, either of type - # {::Google::Cloud::VMMigration::V1::PauseMigrationRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VMMigration::V1::PauseMigrationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload pause_migration(migrating_vm: nil) - # Pass arguments to `pause_migration` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param migrating_vm [::String] - # Required. The name of the MigratingVm. - # - # @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/vm_migration/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VMMigration::V1::VMMigration::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VMMigration::V1::PauseMigrationRequest.new - # - # # Call the pause_migration method. - # result = client.pause_migration 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 pause_migration request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::PauseMigrationRequest - - # Converts hash 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.pause_migration.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::VMMigration::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.migrating_vm - header_params["migrating_vm"] = request.migrating_vm - 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.pause_migration.timeout, - metadata: metadata, - retry_policy: @config.rpcs.pause_migration.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vm_migration_stub.call_rpc :pause_migration, 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 - - ## - # Marks a migration as completed, deleting migration resources that are no - # longer being used. Only applicable after cutover is done. - # - # @overload finalize_migration(request, options = nil) - # Pass arguments to `finalize_migration` via a request object, either of type - # {::Google::Cloud::VMMigration::V1::FinalizeMigrationRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VMMigration::V1::FinalizeMigrationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload finalize_migration(migrating_vm: nil) - # Pass arguments to `finalize_migration` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param migrating_vm [::String] - # Required. The name of the MigratingVm. - # - # @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/vm_migration/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VMMigration::V1::VMMigration::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VMMigration::V1::FinalizeMigrationRequest.new - # - # # Call the finalize_migration method. - # result = client.finalize_migration 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 finalize_migration request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::FinalizeMigrationRequest - - # Converts hash 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.finalize_migration.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::VMMigration::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.migrating_vm - header_params["migrating_vm"] = request.migrating_vm - 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.finalize_migration.timeout, - metadata: metadata, - retry_policy: @config.rpcs.finalize_migration.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vm_migration_stub.call_rpc :finalize_migration, 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 - - ## - # Extend the migrating VM time to live. - # - # @overload extend_migration(request, options = nil) - # Pass arguments to `extend_migration` via a request object, either of type - # {::Google::Cloud::VMMigration::V1::ExtendMigrationRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VMMigration::V1::ExtendMigrationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload extend_migration(migrating_vm: nil) - # Pass arguments to `extend_migration` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param migrating_vm [::String] - # Required. The name of the MigratingVm. - # - # @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/vm_migration/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VMMigration::V1::VMMigration::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VMMigration::V1::ExtendMigrationRequest.new - # - # # Call the extend_migration method. - # result = client.extend_migration 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 extend_migration request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::ExtendMigrationRequest - - # Converts hash 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.extend_migration.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::VMMigration::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.migrating_vm - header_params["migrating_vm"] = request.migrating_vm - 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.extend_migration.timeout, - metadata: metadata, - retry_policy: @config.rpcs.extend_migration.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vm_migration_stub.call_rpc :extend_migration, 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 - - ## - # Initiates a Clone of a specific migrating VM. - # - # @overload create_clone_job(request, options = nil) - # Pass arguments to `create_clone_job` via a request object, either of type - # {::Google::Cloud::VMMigration::V1::CreateCloneJobRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VMMigration::V1::CreateCloneJobRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_clone_job(parent: nil, clone_job_id: nil, clone_job: nil, request_id: nil) - # Pass arguments to `create_clone_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 Clone's parent. - # @param clone_job_id [::String] - # Required. The clone job identifier. - # @param clone_job [::Google::Cloud::VMMigration::V1::CloneJob, ::Hash] - # Required. The clone request body. - # @param request_id [::String] - # A request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server will guarantee - # that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # - # @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/vm_migration/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VMMigration::V1::VMMigration::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VMMigration::V1::CreateCloneJobRequest.new - # - # # Call the create_clone_job method. - # result = client.create_clone_job 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_clone_job request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::CreateCloneJobRequest - - # Converts hash 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_clone_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::VMMigration::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_clone_job.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_clone_job.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vm_migration_stub.call_rpc :create_clone_job, 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 - - ## - # Initiates the cancellation of a running clone job. - # - # @overload cancel_clone_job(request, options = nil) - # Pass arguments to `cancel_clone_job` via a request object, either of type - # {::Google::Cloud::VMMigration::V1::CancelCloneJobRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VMMigration::V1::CancelCloneJobRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_clone_job(name: nil) - # Pass arguments to `cancel_clone_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 clone job id - # - # @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/vm_migration/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VMMigration::V1::VMMigration::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VMMigration::V1::CancelCloneJobRequest.new - # - # # Call the cancel_clone_job method. - # result = client.cancel_clone_job 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 cancel_clone_job request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::CancelCloneJobRequest - - # Converts hash 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_clone_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::VMMigration::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_clone_job.timeout, - metadata: metadata, - retry_policy: @config.rpcs.cancel_clone_job.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vm_migration_stub.call_rpc :cancel_clone_job, 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 - - ## - # Lists the CloneJobs of a migrating VM. Only 25 most recent CloneJobs are - # listed. - # - # @overload list_clone_jobs(request, options = nil) - # Pass arguments to `list_clone_jobs` via a request object, either of type - # {::Google::Cloud::VMMigration::V1::ListCloneJobsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VMMigration::V1::ListCloneJobsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_clone_jobs(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) - # Pass arguments to `list_clone_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 parent, which owns this collection of source VMs. - # @param page_size [::Integer] - # Optional. The maximum number of clone jobs to return. The service may - # return fewer than this value. If unspecified, at most 500 clone jobs will - # be returned. The maximum value is 1000; values above 1000 will be coerced - # to 1000. - # @param page_token [::String] - # Required. A page token, received from a previous `ListCloneJobs` call. - # Provide this to retrieve the subsequent page. - # - # When paginating, all other parameters provided to `ListCloneJobs` must - # match the call that provided the page token. - # @param filter [::String] - # Optional. The filter request. - # @param order_by [::String] - # Optional. the order by fields for the result. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::VMMigration::V1::CloneJob>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::VMMigration::V1::CloneJob>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/vm_migration/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VMMigration::V1::VMMigration::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VMMigration::V1::ListCloneJobsRequest.new - # - # # Call the list_clone_jobs method. - # result = client.list_clone_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::VMMigration::V1::CloneJob. - # p item - # end - # - def list_clone_jobs request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::ListCloneJobsRequest - - # Converts hash 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_clone_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::VMMigration::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_clone_jobs.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_clone_jobs.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vm_migration_stub.call_rpc :list_clone_jobs, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @vm_migration_stub, :list_clone_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 - - ## - # Gets details of a single CloneJob. - # - # @overload get_clone_job(request, options = nil) - # Pass arguments to `get_clone_job` via a request object, either of type - # {::Google::Cloud::VMMigration::V1::GetCloneJobRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VMMigration::V1::GetCloneJobRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_clone_job(name: nil) - # Pass arguments to `get_clone_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 name of the CloneJob. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::VMMigration::V1::CloneJob] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::VMMigration::V1::CloneJob] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/vm_migration/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VMMigration::V1::VMMigration::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VMMigration::V1::GetCloneJobRequest.new - # - # # Call the get_clone_job method. - # result = client.get_clone_job request - # - # # The returned object is of type Google::Cloud::VMMigration::V1::CloneJob. - # p result - # - def get_clone_job request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::GetCloneJobRequest - - # Converts hash 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_clone_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::VMMigration::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_clone_job.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_clone_job.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vm_migration_stub.call_rpc :get_clone_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 - - ## - # Initiates a Cutover of a specific migrating VM. - # The returned LRO is completed when the cutover job resource is created - # and the job is initiated. - # - # @overload create_cutover_job(request, options = nil) - # Pass arguments to `create_cutover_job` via a request object, either of type - # {::Google::Cloud::VMMigration::V1::CreateCutoverJobRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VMMigration::V1::CreateCutoverJobRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_cutover_job(parent: nil, cutover_job_id: nil, cutover_job: nil, request_id: nil) - # Pass arguments to `create_cutover_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 Cutover's parent. - # @param cutover_job_id [::String] - # Required. The cutover job identifier. - # @param cutover_job [::Google::Cloud::VMMigration::V1::CutoverJob, ::Hash] - # Required. The cutover request body. - # @param request_id [::String] - # A request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server will guarantee - # that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # - # @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/vm_migration/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VMMigration::V1::VMMigration::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VMMigration::V1::CreateCutoverJobRequest.new - # - # # Call the create_cutover_job method. - # result = client.create_cutover_job 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_cutover_job request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::CreateCutoverJobRequest - - # Converts hash 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_cutover_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::VMMigration::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_cutover_job.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_cutover_job.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vm_migration_stub.call_rpc :create_cutover_job, 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 - - ## - # Initiates the cancellation of a running cutover job. - # - # @overload cancel_cutover_job(request, options = nil) - # Pass arguments to `cancel_cutover_job` via a request object, either of type - # {::Google::Cloud::VMMigration::V1::CancelCutoverJobRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VMMigration::V1::CancelCutoverJobRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_cutover_job(name: nil) - # Pass arguments to `cancel_cutover_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 cutover job id - # - # @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/vm_migration/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VMMigration::V1::VMMigration::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VMMigration::V1::CancelCutoverJobRequest.new - # - # # Call the cancel_cutover_job method. - # result = client.cancel_cutover_job 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 cancel_cutover_job request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::CancelCutoverJobRequest - - # Converts hash 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_cutover_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::VMMigration::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_cutover_job.timeout, - metadata: metadata, - retry_policy: @config.rpcs.cancel_cutover_job.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vm_migration_stub.call_rpc :cancel_cutover_job, 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 - - ## - # Lists the CutoverJobs of a migrating VM. Only 25 most recent CutoverJobs - # are listed. - # - # @overload list_cutover_jobs(request, options = nil) - # Pass arguments to `list_cutover_jobs` via a request object, either of type - # {::Google::Cloud::VMMigration::V1::ListCutoverJobsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VMMigration::V1::ListCutoverJobsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_cutover_jobs(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) - # Pass arguments to `list_cutover_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 parent, which owns this collection of migrating VMs. - # @param page_size [::Integer] - # Optional. The maximum number of cutover jobs to return. The service may - # return fewer than this value. If unspecified, at most 500 cutover jobs will - # be returned. The maximum value is 1000; values above 1000 will be coerced - # to 1000. - # @param page_token [::String] - # Required. A page token, received from a previous `ListCutoverJobs` call. - # Provide this to retrieve the subsequent page. - # - # When paginating, all other parameters provided to `ListCutoverJobs` must - # match the call that provided the page token. - # @param filter [::String] - # Optional. The filter request. - # @param order_by [::String] - # Optional. the order by fields for the result. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::VMMigration::V1::CutoverJob>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::VMMigration::V1::CutoverJob>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/vm_migration/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VMMigration::V1::VMMigration::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VMMigration::V1::ListCutoverJobsRequest.new - # - # # Call the list_cutover_jobs method. - # result = client.list_cutover_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::VMMigration::V1::CutoverJob. - # p item - # end - # - def list_cutover_jobs request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::ListCutoverJobsRequest - - # Converts hash 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_cutover_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::VMMigration::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_cutover_jobs.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_cutover_jobs.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vm_migration_stub.call_rpc :list_cutover_jobs, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @vm_migration_stub, :list_cutover_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 - - ## - # Gets details of a single CutoverJob. - # - # @overload get_cutover_job(request, options = nil) - # Pass arguments to `get_cutover_job` via a request object, either of type - # {::Google::Cloud::VMMigration::V1::GetCutoverJobRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VMMigration::V1::GetCutoverJobRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_cutover_job(name: nil) - # Pass arguments to `get_cutover_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 name of the CutoverJob. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::VMMigration::V1::CutoverJob] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::VMMigration::V1::CutoverJob] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/vm_migration/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VMMigration::V1::VMMigration::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VMMigration::V1::GetCutoverJobRequest.new - # - # # Call the get_cutover_job method. - # result = client.get_cutover_job request - # - # # The returned object is of type Google::Cloud::VMMigration::V1::CutoverJob. - # p result - # - def get_cutover_job request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::GetCutoverJobRequest - - # Converts hash 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_cutover_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::VMMigration::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_cutover_job.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_cutover_job.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vm_migration_stub.call_rpc :get_cutover_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 - - ## - # Lists Groups in a given project and location. - # - # @overload list_groups(request, options = nil) - # Pass arguments to `list_groups` via a request object, either of type - # {::Google::Cloud::VMMigration::V1::ListGroupsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VMMigration::V1::ListGroupsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_groups(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) - # Pass arguments to `list_groups` via keyword arguments. Note that at - # least one keyword argument is 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 parent, which owns this collection of groups. - # @param page_size [::Integer] - # Optional. The maximum number of groups to return. The service may return - # fewer than this value. If unspecified, at most 500 groups will be - # returned. The maximum value is 1000; values above 1000 will be coerced to - # 1000. - # @param page_token [::String] - # Required. A page token, received from a previous `ListGroups` call. - # Provide this to retrieve the subsequent page. - # - # When paginating, all other parameters provided to `ListGroups` must - # match the call that provided the page token. - # @param filter [::String] - # Optional. The filter request. - # @param order_by [::String] - # Optional. the order by fields for the result. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::VMMigration::V1::Group>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::VMMigration::V1::Group>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/vm_migration/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VMMigration::V1::VMMigration::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VMMigration::V1::ListGroupsRequest.new - # - # # Call the list_groups method. - # result = client.list_groups 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::VMMigration::V1::Group. - # p item - # end - # - def list_groups request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::ListGroupsRequest - - # Converts hash 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_groups.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::VMMigration::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_groups.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_groups.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vm_migration_stub.call_rpc :list_groups, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @vm_migration_stub, :list_groups, 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 - - ## - # Gets details of a single Group. - # - # @overload get_group(request, options = nil) - # Pass arguments to `get_group` via a request object, either of type - # {::Google::Cloud::VMMigration::V1::GetGroupRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VMMigration::V1::GetGroupRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_group(name: nil) - # Pass arguments to `get_group` via keyword arguments. Note that at - # least one keyword argument is 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 group name. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::VMMigration::V1::Group] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::VMMigration::V1::Group] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/vm_migration/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VMMigration::V1::VMMigration::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VMMigration::V1::GetGroupRequest.new - # - # # Call the get_group method. - # result = client.get_group request - # - # # The returned object is of type Google::Cloud::VMMigration::V1::Group. - # p result - # - def get_group request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::GetGroupRequest - - # Converts hash 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_group.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::VMMigration::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_group.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_group.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vm_migration_stub.call_rpc :get_group, 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 Group in a given project and location. - # - # @overload create_group(request, options = nil) - # Pass arguments to `create_group` via a request object, either of type - # {::Google::Cloud::VMMigration::V1::CreateGroupRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VMMigration::V1::CreateGroupRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_group(parent: nil, group_id: nil, group: nil, request_id: nil) - # Pass arguments to `create_group` via keyword arguments. Note that at - # least one keyword argument is 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 Group's parent. - # @param group_id [::String] - # Required. The group identifier. - # @param group [::Google::Cloud::VMMigration::V1::Group, ::Hash] - # Required. The create request body. - # @param request_id [::String] - # A request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server will guarantee - # that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # - # @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/vm_migration/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VMMigration::V1::VMMigration::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VMMigration::V1::CreateGroupRequest.new - # - # # Call the create_group method. - # result = client.create_group 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_group request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::CreateGroupRequest - - # Converts hash 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_group.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::VMMigration::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_group.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_group.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vm_migration_stub.call_rpc :create_group, 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 - - ## - # Updates the parameters of a single Group. - # - # @overload update_group(request, options = nil) - # Pass arguments to `update_group` via a request object, either of type - # {::Google::Cloud::VMMigration::V1::UpdateGroupRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VMMigration::V1::UpdateGroupRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_group(update_mask: nil, group: nil, request_id: nil) - # Pass arguments to `update_group` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Field mask is used to specify the fields to be overwritten in the - # Group resource by the update. - # The fields specified in the update_mask are relative to the resource, not - # the full request. A field will be overwritten if it is in the mask. If the - # user does not provide a mask then all fields will be overwritten. - # @param group [::Google::Cloud::VMMigration::V1::Group, ::Hash] - # Required. The update request body. - # @param request_id [::String] - # A request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server will guarantee - # that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # - # @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/vm_migration/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VMMigration::V1::VMMigration::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VMMigration::V1::UpdateGroupRequest.new - # - # # Call the update_group method. - # result = client.update_group 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 update_group request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::UpdateGroupRequest - - # Converts hash 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_group.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::VMMigration::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.group&.name - header_params["group.name"] = request.group.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_group.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_group.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vm_migration_stub.call_rpc :update_group, 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 single Group. - # - # @overload delete_group(request, options = nil) - # Pass arguments to `delete_group` via a request object, either of type - # {::Google::Cloud::VMMigration::V1::DeleteGroupRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VMMigration::V1::DeleteGroupRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_group(name: nil, request_id: nil) - # Pass arguments to `delete_group` via keyword arguments. Note that at - # least one keyword argument is 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 Group name. - # @param request_id [::String] - # Optional. A request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server will guarantee - # that for at least 60 minutes after the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # - # @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/vm_migration/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VMMigration::V1::VMMigration::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VMMigration::V1::DeleteGroupRequest.new - # - # # Call the delete_group method. - # result = client.delete_group 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_group request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::DeleteGroupRequest - - # Converts hash 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_group.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::VMMigration::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_group.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_group.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vm_migration_stub.call_rpc :delete_group, 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 - - ## - # Adds a MigratingVm to a Group. - # - # @overload add_group_migration(request, options = nil) - # Pass arguments to `add_group_migration` via a request object, either of type - # {::Google::Cloud::VMMigration::V1::AddGroupMigrationRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VMMigration::V1::AddGroupMigrationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload add_group_migration(group: nil, migrating_vm: nil) - # Pass arguments to `add_group_migration` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param group [::String] - # Required. The full path name of the Group to add to. - # @param migrating_vm [::String] - # The full path name of the MigratingVm to add. - # - # @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/vm_migration/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VMMigration::V1::VMMigration::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VMMigration::V1::AddGroupMigrationRequest.new - # - # # Call the add_group_migration method. - # result = client.add_group_migration 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 add_group_migration request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::AddGroupMigrationRequest - - # Converts hash 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.add_group_migration.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::VMMigration::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.group - header_params["group"] = request.group - 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.add_group_migration.timeout, - metadata: metadata, - retry_policy: @config.rpcs.add_group_migration.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vm_migration_stub.call_rpc :add_group_migration, 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 - - ## - # Removes a MigratingVm from a Group. - # - # @overload remove_group_migration(request, options = nil) - # Pass arguments to `remove_group_migration` via a request object, either of type - # {::Google::Cloud::VMMigration::V1::RemoveGroupMigrationRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VMMigration::V1::RemoveGroupMigrationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload remove_group_migration(group: nil, migrating_vm: nil) - # Pass arguments to `remove_group_migration` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param group [::String] - # Required. The name of the Group. - # @param migrating_vm [::String] - # The MigratingVm to remove. - # - # @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/vm_migration/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VMMigration::V1::VMMigration::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VMMigration::V1::RemoveGroupMigrationRequest.new - # - # # Call the remove_group_migration method. - # result = client.remove_group_migration 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 remove_group_migration request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::RemoveGroupMigrationRequest - - # Converts hash 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.remove_group_migration.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::VMMigration::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.group - header_params["group"] = request.group - 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.remove_group_migration.timeout, - metadata: metadata, - retry_policy: @config.rpcs.remove_group_migration.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vm_migration_stub.call_rpc :remove_group_migration, 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 - - ## - # Lists TargetProjects in a given project. - # - # NOTE: TargetProject is a global resource; hence the only supported value - # for location is `global`. - # - # @overload list_target_projects(request, options = nil) - # Pass arguments to `list_target_projects` via a request object, either of type - # {::Google::Cloud::VMMigration::V1::ListTargetProjectsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VMMigration::V1::ListTargetProjectsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_target_projects(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) - # Pass arguments to `list_target_projects` via keyword arguments. Note that at - # least one keyword argument is 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 parent, which owns this collection of targets. - # @param page_size [::Integer] - # Optional. The maximum number of targets to return. The service may return - # fewer than this value. If unspecified, at most 500 targets will be - # returned. The maximum value is 1000; values above 1000 will be coerced to - # 1000. - # @param page_token [::String] - # Required. A page token, received from a previous `ListTargets` call. - # Provide this to retrieve the subsequent page. - # - # When paginating, all other parameters provided to `ListTargets` must - # match the call that provided the page token. - # @param filter [::String] - # Optional. The filter request. - # @param order_by [::String] - # Optional. the order by fields for the result. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::VMMigration::V1::TargetProject>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::VMMigration::V1::TargetProject>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/vm_migration/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VMMigration::V1::VMMigration::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VMMigration::V1::ListTargetProjectsRequest.new - # - # # Call the list_target_projects method. - # result = client.list_target_projects 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::VMMigration::V1::TargetProject. - # p item - # end - # - def list_target_projects request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::ListTargetProjectsRequest - - # Converts hash 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_target_projects.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::VMMigration::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_target_projects.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_target_projects.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vm_migration_stub.call_rpc :list_target_projects, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @vm_migration_stub, :list_target_projects, 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 - - ## - # Gets details of a single TargetProject. - # - # NOTE: TargetProject is a global resource; hence the only supported value - # for location is `global`. - # - # @overload get_target_project(request, options = nil) - # Pass arguments to `get_target_project` via a request object, either of type - # {::Google::Cloud::VMMigration::V1::GetTargetProjectRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VMMigration::V1::GetTargetProjectRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_target_project(name: nil) - # Pass arguments to `get_target_project` via keyword arguments. Note that at - # least one keyword argument is 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 TargetProject name. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::VMMigration::V1::TargetProject] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::VMMigration::V1::TargetProject] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/vm_migration/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VMMigration::V1::VMMigration::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VMMigration::V1::GetTargetProjectRequest.new - # - # # Call the get_target_project method. - # result = client.get_target_project request - # - # # The returned object is of type Google::Cloud::VMMigration::V1::TargetProject. - # p result - # - def get_target_project request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::GetTargetProjectRequest - - # Converts hash 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_target_project.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::VMMigration::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_target_project.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_target_project.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vm_migration_stub.call_rpc :get_target_project, 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 TargetProject in a given project. - # - # NOTE: TargetProject is a global resource; hence the only supported value - # for location is `global`. - # - # @overload create_target_project(request, options = nil) - # Pass arguments to `create_target_project` via a request object, either of type - # {::Google::Cloud::VMMigration::V1::CreateTargetProjectRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VMMigration::V1::CreateTargetProjectRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_target_project(parent: nil, target_project_id: nil, target_project: nil, request_id: nil) - # Pass arguments to `create_target_project` via keyword arguments. Note that at - # least one keyword argument is 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 TargetProject's parent. - # @param target_project_id [::String] - # Required. The target_project identifier. - # @param target_project [::Google::Cloud::VMMigration::V1::TargetProject, ::Hash] - # Required. The create request body. - # @param request_id [::String] - # A request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server will guarantee - # that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # - # @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/vm_migration/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VMMigration::V1::VMMigration::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VMMigration::V1::CreateTargetProjectRequest.new - # - # # Call the create_target_project method. - # result = client.create_target_project 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_target_project request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::CreateTargetProjectRequest - - # Converts hash 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_target_project.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::VMMigration::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_target_project.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_target_project.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vm_migration_stub.call_rpc :create_target_project, 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 - - ## - # Updates the parameters of a single TargetProject. - # - # NOTE: TargetProject is a global resource; hence the only supported value - # for location is `global`. - # - # @overload update_target_project(request, options = nil) - # Pass arguments to `update_target_project` via a request object, either of type - # {::Google::Cloud::VMMigration::V1::UpdateTargetProjectRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VMMigration::V1::UpdateTargetProjectRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_target_project(update_mask: nil, target_project: nil, request_id: nil) - # Pass arguments to `update_target_project` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Field mask is used to specify the fields to be overwritten in the - # TargetProject resource by the update. - # The fields specified in the update_mask are relative to the resource, not - # the full request. A field will be overwritten if it is in the mask. If the - # user does not provide a mask then all fields will be overwritten. - # @param target_project [::Google::Cloud::VMMigration::V1::TargetProject, ::Hash] - # Required. The update request body. - # @param request_id [::String] - # A request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server will guarantee - # that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # - # @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/vm_migration/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VMMigration::V1::VMMigration::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VMMigration::V1::UpdateTargetProjectRequest.new - # - # # Call the update_target_project method. - # result = client.update_target_project 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 update_target_project request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::UpdateTargetProjectRequest - - # Converts hash 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_target_project.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::VMMigration::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.target_project&.name - header_params["target_project.name"] = request.target_project.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_target_project.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_target_project.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vm_migration_stub.call_rpc :update_target_project, 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 single TargetProject. - # - # NOTE: TargetProject is a global resource; hence the only supported value - # for location is `global`. - # - # @overload delete_target_project(request, options = nil) - # Pass arguments to `delete_target_project` via a request object, either of type - # {::Google::Cloud::VMMigration::V1::DeleteTargetProjectRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VMMigration::V1::DeleteTargetProjectRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_target_project(name: nil, request_id: nil) - # Pass arguments to `delete_target_project` via keyword arguments. Note that at - # least one keyword argument is 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 TargetProject name. - # @param request_id [::String] - # Optional. A request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server will guarantee - # that for at least 60 minutes after the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # - # @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/vm_migration/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VMMigration::V1::VMMigration::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VMMigration::V1::DeleteTargetProjectRequest.new - # - # # Call the delete_target_project method. - # result = client.delete_target_project 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_target_project request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::DeleteTargetProjectRequest - - # Converts hash 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_target_project.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::VMMigration::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_target_project.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_target_project.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vm_migration_stub.call_rpc :delete_target_project, 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 - - ## - # Lists ReplicationCycles in a given MigratingVM. - # - # @overload list_replication_cycles(request, options = nil) - # Pass arguments to `list_replication_cycles` via a request object, either of type - # {::Google::Cloud::VMMigration::V1::ListReplicationCyclesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VMMigration::V1::ListReplicationCyclesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_replication_cycles(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) - # Pass arguments to `list_replication_cycles` via keyword arguments. Note that at - # least one keyword argument is 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 parent, which owns this collection of ReplicationCycles. - # @param page_size [::Integer] - # Optional. The maximum number of replication cycles to return. The service - # may return fewer than this value. If unspecified, at most 100 migrating VMs - # will be returned. The maximum value is 100; values above 100 will be - # coerced to 100. - # @param page_token [::String] - # Required. A page token, received from a previous `ListReplicationCycles` - # call. Provide this to retrieve the subsequent page. - # - # When paginating, all other parameters provided to `ListReplicationCycles` - # must match the call that provided the page token. - # @param filter [::String] - # Optional. The filter request. - # @param order_by [::String] - # Optional. the order by fields for the result. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::VMMigration::V1::ReplicationCycle>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::VMMigration::V1::ReplicationCycle>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/vm_migration/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VMMigration::V1::VMMigration::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VMMigration::V1::ListReplicationCyclesRequest.new - # - # # Call the list_replication_cycles method. - # result = client.list_replication_cycles 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::VMMigration::V1::ReplicationCycle. - # p item - # end - # - def list_replication_cycles request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::ListReplicationCyclesRequest - - # Converts hash 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_replication_cycles.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::VMMigration::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_replication_cycles.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_replication_cycles.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vm_migration_stub.call_rpc :list_replication_cycles, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @vm_migration_stub, :list_replication_cycles, 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 - - ## - # Gets details of a single ReplicationCycle. - # - # @overload get_replication_cycle(request, options = nil) - # Pass arguments to `get_replication_cycle` via a request object, either of type - # {::Google::Cloud::VMMigration::V1::GetReplicationCycleRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VMMigration::V1::GetReplicationCycleRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_replication_cycle(name: nil) - # Pass arguments to `get_replication_cycle` via keyword arguments. Note that at - # least one keyword argument is 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 name of the ReplicationCycle. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::VMMigration::V1::ReplicationCycle] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::VMMigration::V1::ReplicationCycle] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/vm_migration/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VMMigration::V1::VMMigration::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VMMigration::V1::GetReplicationCycleRequest.new - # - # # Call the get_replication_cycle method. - # result = client.get_replication_cycle request - # - # # The returned object is of type Google::Cloud::VMMigration::V1::ReplicationCycle. - # p result - # - def get_replication_cycle request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::GetReplicationCycleRequest - - # Converts hash 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_replication_cycle.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::VMMigration::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_replication_cycle.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_replication_cycle.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vm_migration_stub.call_rpc :get_replication_cycle, 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 ImageImports in a given project. - # - # @overload list_image_imports(request, options = nil) - # Pass arguments to `list_image_imports` via a request object, either of type - # {::Google::Cloud::VMMigration::V1::ListImageImportsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VMMigration::V1::ListImageImportsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_image_imports(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) - # Pass arguments to `list_image_imports` via keyword arguments. Note that at - # least one keyword argument is 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 parent, which owns this collection of targets. - # @param page_size [::Integer] - # Optional. The maximum number of targets to return. The service may return - # fewer than this value. If unspecified, at most 500 targets will be - # returned. The maximum value is 1000; values above 1000 will be coerced to - # 1000. - # @param page_token [::String] - # Optional. A page token, received from a previous `ListImageImports` call. - # Provide this to retrieve the subsequent page. - # - # When paginating, all other parameters provided to `ListImageImports` must - # match the call that provided the page token. - # @param filter [::String] - # Optional. The filter request (according to AIP-160). - # @param order_by [::String] - # Optional. The order by fields for the result (according to AIP-132). - # Currently ordering is only possible by "name" field. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::VMMigration::V1::ImageImport>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::VMMigration::V1::ImageImport>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/vm_migration/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VMMigration::V1::VMMigration::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VMMigration::V1::ListImageImportsRequest.new - # - # # Call the list_image_imports method. - # result = client.list_image_imports 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::VMMigration::V1::ImageImport. - # p item - # end - # - def list_image_imports request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::ListImageImportsRequest - - # Converts hash 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_image_imports.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::VMMigration::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_image_imports.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_image_imports.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vm_migration_stub.call_rpc :list_image_imports, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @vm_migration_stub, :list_image_imports, 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 - - ## - # Gets details of a single ImageImport. - # - # @overload get_image_import(request, options = nil) - # Pass arguments to `get_image_import` via a request object, either of type - # {::Google::Cloud::VMMigration::V1::GetImageImportRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VMMigration::V1::GetImageImportRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_image_import(name: nil) - # Pass arguments to `get_image_import` via keyword arguments. Note that at - # least one keyword argument is 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 ImageImport name. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::VMMigration::V1::ImageImport] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::VMMigration::V1::ImageImport] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/vm_migration/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VMMigration::V1::VMMigration::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VMMigration::V1::GetImageImportRequest.new - # - # # Call the get_image_import method. - # result = client.get_image_import request - # - # # The returned object is of type Google::Cloud::VMMigration::V1::ImageImport. - # p result - # - def get_image_import request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::GetImageImportRequest - - # Converts hash 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_image_import.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::VMMigration::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_image_import.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_image_import.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vm_migration_stub.call_rpc :get_image_import, 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 ImageImport in a given project. - # - # @overload create_image_import(request, options = nil) - # Pass arguments to `create_image_import` via a request object, either of type - # {::Google::Cloud::VMMigration::V1::CreateImageImportRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VMMigration::V1::CreateImageImportRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_image_import(parent: nil, image_import_id: nil, image_import: nil, request_id: nil) - # Pass arguments to `create_image_import` via keyword arguments. Note that at - # least one keyword argument is 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 ImageImport's parent. - # @param image_import_id [::String] - # Required. The image import identifier. - # This value maximum length is 63 characters, and valid characters are - # /[a-z][0-9]-/. It must start with an english letter and must not end with a - # hyphen. - # @param image_import [::Google::Cloud::VMMigration::V1::ImageImport, ::Hash] - # Required. The create request body. - # @param request_id [::String] - # Optional. A request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server will guarantee - # that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # - # @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/vm_migration/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VMMigration::V1::VMMigration::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VMMigration::V1::CreateImageImportRequest.new - # - # # Call the create_image_import method. - # result = client.create_image_import 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_image_import request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::CreateImageImportRequest - - # Converts hash 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_image_import.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::VMMigration::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_image_import.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_image_import.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vm_migration_stub.call_rpc :create_image_import, 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 single ImageImport. - # - # @overload delete_image_import(request, options = nil) - # Pass arguments to `delete_image_import` via a request object, either of type - # {::Google::Cloud::VMMigration::V1::DeleteImageImportRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VMMigration::V1::DeleteImageImportRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_image_import(name: nil, request_id: nil) - # Pass arguments to `delete_image_import` via keyword arguments. Note that at - # least one keyword argument is 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 ImageImport name. - # @param request_id [::String] - # Optional. A request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server will guarantee - # that for at least 60 minutes after the first request. - # - # For example, consider a situation where you make an initial request and t - # he request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # - # @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/vm_migration/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VMMigration::V1::VMMigration::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VMMigration::V1::DeleteImageImportRequest.new - # - # # Call the delete_image_import method. - # result = client.delete_image_import 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_image_import request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::DeleteImageImportRequest - - # Converts hash 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_image_import.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::VMMigration::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_image_import.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_image_import.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vm_migration_stub.call_rpc :delete_image_import, 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 - - ## - # Lists ImageImportJobs in a given project. - # - # @overload list_image_import_jobs(request, options = nil) - # Pass arguments to `list_image_import_jobs` via a request object, either of type - # {::Google::Cloud::VMMigration::V1::ListImageImportJobsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VMMigration::V1::ListImageImportJobsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_image_import_jobs(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) - # Pass arguments to `list_image_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 parent, which owns this collection of targets. - # @param page_size [::Integer] - # Optional. The maximum number of targets to return. The service may return - # fewer than this value. If unspecified, at most 500 targets will be - # returned. The maximum value is 1000; values above 1000 will be coerced to - # 1000. - # @param page_token [::String] - # Optional. A page token, received from a previous `ListImageImportJobs` - # call. Provide this to retrieve the subsequent page. - # - # When paginating, all other parameters provided to `ListImageImportJobs` - # must match the call that provided the page token. - # @param filter [::String] - # Optional. The filter request (according to AIP-160). - # @param order_by [::String] - # Optional. The order by fields for the result (according to AIP-132). - # Currently ordering is only possible by "name" field. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::VMMigration::V1::ImageImportJob>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::VMMigration::V1::ImageImportJob>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/vm_migration/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VMMigration::V1::VMMigration::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VMMigration::V1::ListImageImportJobsRequest.new - # - # # Call the list_image_import_jobs method. - # result = client.list_image_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::VMMigration::V1::ImageImportJob. - # p item - # end - # - def list_image_import_jobs request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::ListImageImportJobsRequest - - # Converts hash 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_image_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::VMMigration::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_image_import_jobs.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_image_import_jobs.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vm_migration_stub.call_rpc :list_image_import_jobs, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @vm_migration_stub, :list_image_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 - - ## - # Gets details of a single ImageImportJob. - # - # @overload get_image_import_job(request, options = nil) - # Pass arguments to `get_image_import_job` via a request object, either of type - # {::Google::Cloud::VMMigration::V1::GetImageImportJobRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VMMigration::V1::GetImageImportJobRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_image_import_job(name: nil) - # Pass arguments to `get_image_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 ImageImportJob name. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::VMMigration::V1::ImageImportJob] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::VMMigration::V1::ImageImportJob] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/vm_migration/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VMMigration::V1::VMMigration::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VMMigration::V1::GetImageImportJobRequest.new - # - # # Call the get_image_import_job method. - # result = client.get_image_import_job request - # - # # The returned object is of type Google::Cloud::VMMigration::V1::ImageImportJob. - # p result - # - def get_image_import_job request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::GetImageImportJobRequest - - # Converts hash 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_image_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::VMMigration::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_image_import_job.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_image_import_job.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vm_migration_stub.call_rpc :get_image_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 - - ## - # Initiates the cancellation of a running ImageImportJob. - # - # @overload cancel_image_import_job(request, options = nil) - # Pass arguments to `cancel_image_import_job` via a request object, either of type - # {::Google::Cloud::VMMigration::V1::CancelImageImportJobRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VMMigration::V1::CancelImageImportJobRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_image_import_job(name: nil) - # Pass arguments to `cancel_image_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 image import job id. - # - # @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/vm_migration/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VMMigration::V1::VMMigration::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VMMigration::V1::CancelImageImportJobRequest.new - # - # # Call the cancel_image_import_job method. - # result = client.cancel_image_import_job 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 cancel_image_import_job request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::CancelImageImportJobRequest - - # Converts hash 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_image_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::VMMigration::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_image_import_job.timeout, - metadata: metadata, - retry_policy: @config.rpcs.cancel_image_import_job.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vm_migration_stub.call_rpc :cancel_image_import_job, 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 disk migration job in a given Source. - # - # @overload create_disk_migration_job(request, options = nil) - # Pass arguments to `create_disk_migration_job` via a request object, either of type - # {::Google::Cloud::VMMigration::V1::CreateDiskMigrationJobRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VMMigration::V1::CreateDiskMigrationJobRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_disk_migration_job(parent: nil, disk_migration_job_id: nil, disk_migration_job: nil, request_id: nil) - # Pass arguments to `create_disk_migration_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 DiskMigrationJob's parent. - # @param disk_migration_job_id [::String] - # Required. The DiskMigrationJob identifier. - # The maximum length of this value is 63 characters. - # Valid characters are lower case Latin letters, digits and hyphen. - # It must start with a Latin letter and must not end with a hyphen. - # @param disk_migration_job [::Google::Cloud::VMMigration::V1::DiskMigrationJob, ::Hash] - # Required. The create request body. - # @param request_id [::String] - # Optional. A request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server will guarantee - # that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and - # the request timed out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # - # @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/vm_migration/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VMMigration::V1::VMMigration::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VMMigration::V1::CreateDiskMigrationJobRequest.new - # - # # Call the create_disk_migration_job method. - # result = client.create_disk_migration_job 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_disk_migration_job request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::CreateDiskMigrationJobRequest - - # Converts hash 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_disk_migration_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::VMMigration::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_disk_migration_job.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_disk_migration_job.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vm_migration_stub.call_rpc :create_disk_migration_job, 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 - - ## - # Lists DiskMigrationJobs in a given Source. - # - # @overload list_disk_migration_jobs(request, options = nil) - # Pass arguments to `list_disk_migration_jobs` via a request object, either of type - # {::Google::Cloud::VMMigration::V1::ListDiskMigrationJobsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VMMigration::V1::ListDiskMigrationJobsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_disk_migration_jobs(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) - # Pass arguments to `list_disk_migration_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 parent, which owns this collection of DiskMigrationJobs. - # @param page_size [::Integer] - # Optional. The maximum number of disk migration jobs to return. The service - # may return fewer than this value. If unspecified, at most 500 - # disk migration jobs will be returned. - # The maximum value is 1000; values above 1000 will be coerced to 1000. - # @param page_token [::String] - # Optional. A page token, received from a previous `ListDiskMigrationJobs` - # call. Provide this to retrieve the subsequent page. - # - # When paginating, all parameters provided to `ListDiskMigrationJobs` - # except `page_size` must match the call that provided the page token. - # @param filter [::String] - # Optional. The filter request (according to AIP-160). - # @param order_by [::String] - # Optional. Ordering of the result list. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::VMMigration::V1::DiskMigrationJob>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::VMMigration::V1::DiskMigrationJob>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/vm_migration/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VMMigration::V1::VMMigration::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VMMigration::V1::ListDiskMigrationJobsRequest.new - # - # # Call the list_disk_migration_jobs method. - # result = client.list_disk_migration_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::VMMigration::V1::DiskMigrationJob. - # p item - # end - # - def list_disk_migration_jobs request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::ListDiskMigrationJobsRequest - - # Converts hash 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_disk_migration_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::VMMigration::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_disk_migration_jobs.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_disk_migration_jobs.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vm_migration_stub.call_rpc :list_disk_migration_jobs, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @vm_migration_stub, :list_disk_migration_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 - - ## - # Gets details of a single DiskMigrationJob. - # - # @overload get_disk_migration_job(request, options = nil) - # Pass arguments to `get_disk_migration_job` via a request object, either of type - # {::Google::Cloud::VMMigration::V1::GetDiskMigrationJobRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VMMigration::V1::GetDiskMigrationJobRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_disk_migration_job(name: nil) - # Pass arguments to `get_disk_migration_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 name of the DiskMigrationJob. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::VMMigration::V1::DiskMigrationJob] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::VMMigration::V1::DiskMigrationJob] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/vm_migration/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VMMigration::V1::VMMigration::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VMMigration::V1::GetDiskMigrationJobRequest.new - # - # # Call the get_disk_migration_job method. - # result = client.get_disk_migration_job request - # - # # The returned object is of type Google::Cloud::VMMigration::V1::DiskMigrationJob. - # p result - # - def get_disk_migration_job request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::GetDiskMigrationJobRequest - - # Converts hash 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_disk_migration_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::VMMigration::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_disk_migration_job.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_disk_migration_job.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vm_migration_stub.call_rpc :get_disk_migration_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 - - ## - # Updates the parameters of a single DiskMigrationJob. - # - # @overload update_disk_migration_job(request, options = nil) - # Pass arguments to `update_disk_migration_job` via a request object, either of type - # {::Google::Cloud::VMMigration::V1::UpdateDiskMigrationJobRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VMMigration::V1::UpdateDiskMigrationJobRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_disk_migration_job(update_mask: nil, disk_migration_job: nil, request_id: nil) - # Pass arguments to `update_disk_migration_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 update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Optional. Field mask is used to specify the fields to be overwritten in the - # DiskMigrationJob resource by the update. - # The fields specified in the update_mask are relative to the resource, not - # the full request. A field will be overwritten if it is in the mask. If the - # user does not provide a mask, then a mask equivalent to all fields that are - # populated (have a non-empty value), will be implied. - # @param disk_migration_job [::Google::Cloud::VMMigration::V1::DiskMigrationJob, ::Hash] - # Required. The update request body. - # @param request_id [::String] - # Optional. A request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server will guarantee - # that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and - # the request timed out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # - # @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/vm_migration/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VMMigration::V1::VMMigration::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VMMigration::V1::UpdateDiskMigrationJobRequest.new - # - # # Call the update_disk_migration_job method. - # result = client.update_disk_migration_job 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 update_disk_migration_job request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::UpdateDiskMigrationJobRequest - - # Converts hash 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_disk_migration_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::VMMigration::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.disk_migration_job&.name - header_params["disk_migration_job.name"] = request.disk_migration_job.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_disk_migration_job.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_disk_migration_job.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vm_migration_stub.call_rpc :update_disk_migration_job, 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 single DiskMigrationJob. - # - # @overload delete_disk_migration_job(request, options = nil) - # Pass arguments to `delete_disk_migration_job` via a request object, either of type - # {::Google::Cloud::VMMigration::V1::DeleteDiskMigrationJobRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VMMigration::V1::DeleteDiskMigrationJobRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_disk_migration_job(name: nil) - # Pass arguments to `delete_disk_migration_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 name of the DiskMigrationJob. - # - # @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/vm_migration/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VMMigration::V1::VMMigration::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VMMigration::V1::DeleteDiskMigrationJobRequest.new - # - # # Call the delete_disk_migration_job method. - # result = client.delete_disk_migration_job 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_disk_migration_job request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::DeleteDiskMigrationJobRequest - - # Converts hash 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_disk_migration_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::VMMigration::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_disk_migration_job.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_disk_migration_job.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vm_migration_stub.call_rpc :delete_disk_migration_job, 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 - - ## - # Runs the disk migration job. - # - # @overload run_disk_migration_job(request, options = nil) - # Pass arguments to `run_disk_migration_job` via a request object, either of type - # {::Google::Cloud::VMMigration::V1::RunDiskMigrationJobRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VMMigration::V1::RunDiskMigrationJobRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload run_disk_migration_job(name: nil) - # Pass arguments to `run_disk_migration_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 name of the DiskMigrationJob. - # - # @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/vm_migration/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VMMigration::V1::VMMigration::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VMMigration::V1::RunDiskMigrationJobRequest.new - # - # # Call the run_disk_migration_job method. - # result = client.run_disk_migration_job 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 run_disk_migration_job request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::RunDiskMigrationJobRequest - - # Converts hash 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.run_disk_migration_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::VMMigration::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.run_disk_migration_job.timeout, - metadata: metadata, - retry_policy: @config.rpcs.run_disk_migration_job.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vm_migration_stub.call_rpc :run_disk_migration_job, 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 - - ## - # Cancels the disk migration job. - # - # @overload cancel_disk_migration_job(request, options = nil) - # Pass arguments to `cancel_disk_migration_job` via a request object, either of type - # {::Google::Cloud::VMMigration::V1::CancelDiskMigrationJobRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VMMigration::V1::CancelDiskMigrationJobRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_disk_migration_job(name: nil) - # Pass arguments to `cancel_disk_migration_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 name of the DiskMigrationJob. - # - # @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/vm_migration/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VMMigration::V1::VMMigration::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VMMigration::V1::CancelDiskMigrationJobRequest.new - # - # # Call the cancel_disk_migration_job method. - # result = client.cancel_disk_migration_job 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 cancel_disk_migration_job request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::CancelDiskMigrationJobRequest - - # Converts hash 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_disk_migration_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::VMMigration::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_disk_migration_job.timeout, - metadata: metadata, - retry_policy: @config.rpcs.cancel_disk_migration_job.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vm_migration_stub.call_rpc :cancel_disk_migration_job, 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 VmMigration API. - # - # This class represents the configuration for VmMigration, - # 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::VMMigration::V1::VMMigration::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_sources to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::VMMigration::V1::VMMigration::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_sources.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::VMMigration::V1::VMMigration::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_sources.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::VMMigration::V1::VMMigration::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 = "vmmigration.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 VmMigration 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_sources` - # @return [::Gapic::Config::Method] - # - attr_reader :list_sources - ## - # RPC-specific configuration for `get_source` - # @return [::Gapic::Config::Method] - # - attr_reader :get_source - ## - # RPC-specific configuration for `create_source` - # @return [::Gapic::Config::Method] - # - attr_reader :create_source - ## - # RPC-specific configuration for `update_source` - # @return [::Gapic::Config::Method] - # - attr_reader :update_source - ## - # RPC-specific configuration for `delete_source` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_source - ## - # RPC-specific configuration for `fetch_inventory` - # @return [::Gapic::Config::Method] - # - attr_reader :fetch_inventory - ## - # RPC-specific configuration for `fetch_storage_inventory` - # @return [::Gapic::Config::Method] - # - attr_reader :fetch_storage_inventory - ## - # RPC-specific configuration for `list_utilization_reports` - # @return [::Gapic::Config::Method] - # - attr_reader :list_utilization_reports - ## - # RPC-specific configuration for `get_utilization_report` - # @return [::Gapic::Config::Method] - # - attr_reader :get_utilization_report - ## - # RPC-specific configuration for `create_utilization_report` - # @return [::Gapic::Config::Method] - # - attr_reader :create_utilization_report - ## - # RPC-specific configuration for `delete_utilization_report` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_utilization_report - ## - # RPC-specific configuration for `list_datacenter_connectors` - # @return [::Gapic::Config::Method] - # - attr_reader :list_datacenter_connectors - ## - # RPC-specific configuration for `get_datacenter_connector` - # @return [::Gapic::Config::Method] - # - attr_reader :get_datacenter_connector - ## - # RPC-specific configuration for `create_datacenter_connector` - # @return [::Gapic::Config::Method] - # - attr_reader :create_datacenter_connector - ## - # RPC-specific configuration for `delete_datacenter_connector` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_datacenter_connector - ## - # RPC-specific configuration for `upgrade_appliance` - # @return [::Gapic::Config::Method] - # - attr_reader :upgrade_appliance - ## - # RPC-specific configuration for `create_migrating_vm` - # @return [::Gapic::Config::Method] - # - attr_reader :create_migrating_vm - ## - # RPC-specific configuration for `list_migrating_vms` - # @return [::Gapic::Config::Method] - # - attr_reader :list_migrating_vms - ## - # RPC-specific configuration for `get_migrating_vm` - # @return [::Gapic::Config::Method] - # - attr_reader :get_migrating_vm - ## - # RPC-specific configuration for `update_migrating_vm` - # @return [::Gapic::Config::Method] - # - attr_reader :update_migrating_vm - ## - # RPC-specific configuration for `delete_migrating_vm` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_migrating_vm - ## - # RPC-specific configuration for `start_migration` - # @return [::Gapic::Config::Method] - # - attr_reader :start_migration - ## - # RPC-specific configuration for `resume_migration` - # @return [::Gapic::Config::Method] - # - attr_reader :resume_migration - ## - # RPC-specific configuration for `pause_migration` - # @return [::Gapic::Config::Method] - # - attr_reader :pause_migration - ## - # RPC-specific configuration for `finalize_migration` - # @return [::Gapic::Config::Method] - # - attr_reader :finalize_migration - ## - # RPC-specific configuration for `extend_migration` - # @return [::Gapic::Config::Method] - # - attr_reader :extend_migration - ## - # RPC-specific configuration for `create_clone_job` - # @return [::Gapic::Config::Method] - # - attr_reader :create_clone_job - ## - # RPC-specific configuration for `cancel_clone_job` - # @return [::Gapic::Config::Method] - # - attr_reader :cancel_clone_job - ## - # RPC-specific configuration for `list_clone_jobs` - # @return [::Gapic::Config::Method] - # - attr_reader :list_clone_jobs - ## - # RPC-specific configuration for `get_clone_job` - # @return [::Gapic::Config::Method] - # - attr_reader :get_clone_job - ## - # RPC-specific configuration for `create_cutover_job` - # @return [::Gapic::Config::Method] - # - attr_reader :create_cutover_job - ## - # RPC-specific configuration for `cancel_cutover_job` - # @return [::Gapic::Config::Method] - # - attr_reader :cancel_cutover_job - ## - # RPC-specific configuration for `list_cutover_jobs` - # @return [::Gapic::Config::Method] - # - attr_reader :list_cutover_jobs - ## - # RPC-specific configuration for `get_cutover_job` - # @return [::Gapic::Config::Method] - # - attr_reader :get_cutover_job - ## - # RPC-specific configuration for `list_groups` - # @return [::Gapic::Config::Method] - # - attr_reader :list_groups - ## - # RPC-specific configuration for `get_group` - # @return [::Gapic::Config::Method] - # - attr_reader :get_group - ## - # RPC-specific configuration for `create_group` - # @return [::Gapic::Config::Method] - # - attr_reader :create_group - ## - # RPC-specific configuration for `update_group` - # @return [::Gapic::Config::Method] - # - attr_reader :update_group - ## - # RPC-specific configuration for `delete_group` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_group - ## - # RPC-specific configuration for `add_group_migration` - # @return [::Gapic::Config::Method] - # - attr_reader :add_group_migration - ## - # RPC-specific configuration for `remove_group_migration` - # @return [::Gapic::Config::Method] - # - attr_reader :remove_group_migration - ## - # RPC-specific configuration for `list_target_projects` - # @return [::Gapic::Config::Method] - # - attr_reader :list_target_projects - ## - # RPC-specific configuration for `get_target_project` - # @return [::Gapic::Config::Method] - # - attr_reader :get_target_project - ## - # RPC-specific configuration for `create_target_project` - # @return [::Gapic::Config::Method] - # - attr_reader :create_target_project - ## - # RPC-specific configuration for `update_target_project` - # @return [::Gapic::Config::Method] - # - attr_reader :update_target_project - ## - # RPC-specific configuration for `delete_target_project` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_target_project - ## - # RPC-specific configuration for `list_replication_cycles` - # @return [::Gapic::Config::Method] - # - attr_reader :list_replication_cycles - ## - # RPC-specific configuration for `get_replication_cycle` - # @return [::Gapic::Config::Method] - # - attr_reader :get_replication_cycle - ## - # RPC-specific configuration for `list_image_imports` - # @return [::Gapic::Config::Method] - # - attr_reader :list_image_imports - ## - # RPC-specific configuration for `get_image_import` - # @return [::Gapic::Config::Method] - # - attr_reader :get_image_import - ## - # RPC-specific configuration for `create_image_import` - # @return [::Gapic::Config::Method] - # - attr_reader :create_image_import - ## - # RPC-specific configuration for `delete_image_import` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_image_import - ## - # RPC-specific configuration for `list_image_import_jobs` - # @return [::Gapic::Config::Method] - # - attr_reader :list_image_import_jobs - ## - # RPC-specific configuration for `get_image_import_job` - # @return [::Gapic::Config::Method] - # - attr_reader :get_image_import_job - ## - # RPC-specific configuration for `cancel_image_import_job` - # @return [::Gapic::Config::Method] - # - attr_reader :cancel_image_import_job - ## - # RPC-specific configuration for `create_disk_migration_job` - # @return [::Gapic::Config::Method] - # - attr_reader :create_disk_migration_job - ## - # RPC-specific configuration for `list_disk_migration_jobs` - # @return [::Gapic::Config::Method] - # - attr_reader :list_disk_migration_jobs - ## - # RPC-specific configuration for `get_disk_migration_job` - # @return [::Gapic::Config::Method] - # - attr_reader :get_disk_migration_job - ## - # RPC-specific configuration for `update_disk_migration_job` - # @return [::Gapic::Config::Method] - # - attr_reader :update_disk_migration_job - ## - # RPC-specific configuration for `delete_disk_migration_job` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_disk_migration_job - ## - # RPC-specific configuration for `run_disk_migration_job` - # @return [::Gapic::Config::Method] - # - attr_reader :run_disk_migration_job - ## - # RPC-specific configuration for `cancel_disk_migration_job` - # @return [::Gapic::Config::Method] - # - attr_reader :cancel_disk_migration_job - - # @private - def initialize parent_rpcs = nil - list_sources_config = parent_rpcs.list_sources if parent_rpcs.respond_to? :list_sources - @list_sources = ::Gapic::Config::Method.new list_sources_config - get_source_config = parent_rpcs.get_source if parent_rpcs.respond_to? :get_source - @get_source = ::Gapic::Config::Method.new get_source_config - create_source_config = parent_rpcs.create_source if parent_rpcs.respond_to? :create_source - @create_source = ::Gapic::Config::Method.new create_source_config - update_source_config = parent_rpcs.update_source if parent_rpcs.respond_to? :update_source - @update_source = ::Gapic::Config::Method.new update_source_config - delete_source_config = parent_rpcs.delete_source if parent_rpcs.respond_to? :delete_source - @delete_source = ::Gapic::Config::Method.new delete_source_config - fetch_inventory_config = parent_rpcs.fetch_inventory if parent_rpcs.respond_to? :fetch_inventory - @fetch_inventory = ::Gapic::Config::Method.new fetch_inventory_config - fetch_storage_inventory_config = parent_rpcs.fetch_storage_inventory if parent_rpcs.respond_to? :fetch_storage_inventory - @fetch_storage_inventory = ::Gapic::Config::Method.new fetch_storage_inventory_config - list_utilization_reports_config = parent_rpcs.list_utilization_reports if parent_rpcs.respond_to? :list_utilization_reports - @list_utilization_reports = ::Gapic::Config::Method.new list_utilization_reports_config - get_utilization_report_config = parent_rpcs.get_utilization_report if parent_rpcs.respond_to? :get_utilization_report - @get_utilization_report = ::Gapic::Config::Method.new get_utilization_report_config - create_utilization_report_config = parent_rpcs.create_utilization_report if parent_rpcs.respond_to? :create_utilization_report - @create_utilization_report = ::Gapic::Config::Method.new create_utilization_report_config - delete_utilization_report_config = parent_rpcs.delete_utilization_report if parent_rpcs.respond_to? :delete_utilization_report - @delete_utilization_report = ::Gapic::Config::Method.new delete_utilization_report_config - list_datacenter_connectors_config = parent_rpcs.list_datacenter_connectors if parent_rpcs.respond_to? :list_datacenter_connectors - @list_datacenter_connectors = ::Gapic::Config::Method.new list_datacenter_connectors_config - get_datacenter_connector_config = parent_rpcs.get_datacenter_connector if parent_rpcs.respond_to? :get_datacenter_connector - @get_datacenter_connector = ::Gapic::Config::Method.new get_datacenter_connector_config - create_datacenter_connector_config = parent_rpcs.create_datacenter_connector if parent_rpcs.respond_to? :create_datacenter_connector - @create_datacenter_connector = ::Gapic::Config::Method.new create_datacenter_connector_config - delete_datacenter_connector_config = parent_rpcs.delete_datacenter_connector if parent_rpcs.respond_to? :delete_datacenter_connector - @delete_datacenter_connector = ::Gapic::Config::Method.new delete_datacenter_connector_config - upgrade_appliance_config = parent_rpcs.upgrade_appliance if parent_rpcs.respond_to? :upgrade_appliance - @upgrade_appliance = ::Gapic::Config::Method.new upgrade_appliance_config - create_migrating_vm_config = parent_rpcs.create_migrating_vm if parent_rpcs.respond_to? :create_migrating_vm - @create_migrating_vm = ::Gapic::Config::Method.new create_migrating_vm_config - list_migrating_vms_config = parent_rpcs.list_migrating_vms if parent_rpcs.respond_to? :list_migrating_vms - @list_migrating_vms = ::Gapic::Config::Method.new list_migrating_vms_config - get_migrating_vm_config = parent_rpcs.get_migrating_vm if parent_rpcs.respond_to? :get_migrating_vm - @get_migrating_vm = ::Gapic::Config::Method.new get_migrating_vm_config - update_migrating_vm_config = parent_rpcs.update_migrating_vm if parent_rpcs.respond_to? :update_migrating_vm - @update_migrating_vm = ::Gapic::Config::Method.new update_migrating_vm_config - delete_migrating_vm_config = parent_rpcs.delete_migrating_vm if parent_rpcs.respond_to? :delete_migrating_vm - @delete_migrating_vm = ::Gapic::Config::Method.new delete_migrating_vm_config - start_migration_config = parent_rpcs.start_migration if parent_rpcs.respond_to? :start_migration - @start_migration = ::Gapic::Config::Method.new start_migration_config - resume_migration_config = parent_rpcs.resume_migration if parent_rpcs.respond_to? :resume_migration - @resume_migration = ::Gapic::Config::Method.new resume_migration_config - pause_migration_config = parent_rpcs.pause_migration if parent_rpcs.respond_to? :pause_migration - @pause_migration = ::Gapic::Config::Method.new pause_migration_config - finalize_migration_config = parent_rpcs.finalize_migration if parent_rpcs.respond_to? :finalize_migration - @finalize_migration = ::Gapic::Config::Method.new finalize_migration_config - extend_migration_config = parent_rpcs.extend_migration if parent_rpcs.respond_to? :extend_migration - @extend_migration = ::Gapic::Config::Method.new extend_migration_config - create_clone_job_config = parent_rpcs.create_clone_job if parent_rpcs.respond_to? :create_clone_job - @create_clone_job = ::Gapic::Config::Method.new create_clone_job_config - cancel_clone_job_config = parent_rpcs.cancel_clone_job if parent_rpcs.respond_to? :cancel_clone_job - @cancel_clone_job = ::Gapic::Config::Method.new cancel_clone_job_config - list_clone_jobs_config = parent_rpcs.list_clone_jobs if parent_rpcs.respond_to? :list_clone_jobs - @list_clone_jobs = ::Gapic::Config::Method.new list_clone_jobs_config - get_clone_job_config = parent_rpcs.get_clone_job if parent_rpcs.respond_to? :get_clone_job - @get_clone_job = ::Gapic::Config::Method.new get_clone_job_config - create_cutover_job_config = parent_rpcs.create_cutover_job if parent_rpcs.respond_to? :create_cutover_job - @create_cutover_job = ::Gapic::Config::Method.new create_cutover_job_config - cancel_cutover_job_config = parent_rpcs.cancel_cutover_job if parent_rpcs.respond_to? :cancel_cutover_job - @cancel_cutover_job = ::Gapic::Config::Method.new cancel_cutover_job_config - list_cutover_jobs_config = parent_rpcs.list_cutover_jobs if parent_rpcs.respond_to? :list_cutover_jobs - @list_cutover_jobs = ::Gapic::Config::Method.new list_cutover_jobs_config - get_cutover_job_config = parent_rpcs.get_cutover_job if parent_rpcs.respond_to? :get_cutover_job - @get_cutover_job = ::Gapic::Config::Method.new get_cutover_job_config - list_groups_config = parent_rpcs.list_groups if parent_rpcs.respond_to? :list_groups - @list_groups = ::Gapic::Config::Method.new list_groups_config - get_group_config = parent_rpcs.get_group if parent_rpcs.respond_to? :get_group - @get_group = ::Gapic::Config::Method.new get_group_config - create_group_config = parent_rpcs.create_group if parent_rpcs.respond_to? :create_group - @create_group = ::Gapic::Config::Method.new create_group_config - update_group_config = parent_rpcs.update_group if parent_rpcs.respond_to? :update_group - @update_group = ::Gapic::Config::Method.new update_group_config - delete_group_config = parent_rpcs.delete_group if parent_rpcs.respond_to? :delete_group - @delete_group = ::Gapic::Config::Method.new delete_group_config - add_group_migration_config = parent_rpcs.add_group_migration if parent_rpcs.respond_to? :add_group_migration - @add_group_migration = ::Gapic::Config::Method.new add_group_migration_config - remove_group_migration_config = parent_rpcs.remove_group_migration if parent_rpcs.respond_to? :remove_group_migration - @remove_group_migration = ::Gapic::Config::Method.new remove_group_migration_config - list_target_projects_config = parent_rpcs.list_target_projects if parent_rpcs.respond_to? :list_target_projects - @list_target_projects = ::Gapic::Config::Method.new list_target_projects_config - get_target_project_config = parent_rpcs.get_target_project if parent_rpcs.respond_to? :get_target_project - @get_target_project = ::Gapic::Config::Method.new get_target_project_config - create_target_project_config = parent_rpcs.create_target_project if parent_rpcs.respond_to? :create_target_project - @create_target_project = ::Gapic::Config::Method.new create_target_project_config - update_target_project_config = parent_rpcs.update_target_project if parent_rpcs.respond_to? :update_target_project - @update_target_project = ::Gapic::Config::Method.new update_target_project_config - delete_target_project_config = parent_rpcs.delete_target_project if parent_rpcs.respond_to? :delete_target_project - @delete_target_project = ::Gapic::Config::Method.new delete_target_project_config - list_replication_cycles_config = parent_rpcs.list_replication_cycles if parent_rpcs.respond_to? :list_replication_cycles - @list_replication_cycles = ::Gapic::Config::Method.new list_replication_cycles_config - get_replication_cycle_config = parent_rpcs.get_replication_cycle if parent_rpcs.respond_to? :get_replication_cycle - @get_replication_cycle = ::Gapic::Config::Method.new get_replication_cycle_config - list_image_imports_config = parent_rpcs.list_image_imports if parent_rpcs.respond_to? :list_image_imports - @list_image_imports = ::Gapic::Config::Method.new list_image_imports_config - get_image_import_config = parent_rpcs.get_image_import if parent_rpcs.respond_to? :get_image_import - @get_image_import = ::Gapic::Config::Method.new get_image_import_config - create_image_import_config = parent_rpcs.create_image_import if parent_rpcs.respond_to? :create_image_import - @create_image_import = ::Gapic::Config::Method.new create_image_import_config - delete_image_import_config = parent_rpcs.delete_image_import if parent_rpcs.respond_to? :delete_image_import - @delete_image_import = ::Gapic::Config::Method.new delete_image_import_config - list_image_import_jobs_config = parent_rpcs.list_image_import_jobs if parent_rpcs.respond_to? :list_image_import_jobs - @list_image_import_jobs = ::Gapic::Config::Method.new list_image_import_jobs_config - get_image_import_job_config = parent_rpcs.get_image_import_job if parent_rpcs.respond_to? :get_image_import_job - @get_image_import_job = ::Gapic::Config::Method.new get_image_import_job_config - cancel_image_import_job_config = parent_rpcs.cancel_image_import_job if parent_rpcs.respond_to? :cancel_image_import_job - @cancel_image_import_job = ::Gapic::Config::Method.new cancel_image_import_job_config - create_disk_migration_job_config = parent_rpcs.create_disk_migration_job if parent_rpcs.respond_to? :create_disk_migration_job - @create_disk_migration_job = ::Gapic::Config::Method.new create_disk_migration_job_config - list_disk_migration_jobs_config = parent_rpcs.list_disk_migration_jobs if parent_rpcs.respond_to? :list_disk_migration_jobs - @list_disk_migration_jobs = ::Gapic::Config::Method.new list_disk_migration_jobs_config - get_disk_migration_job_config = parent_rpcs.get_disk_migration_job if parent_rpcs.respond_to? :get_disk_migration_job - @get_disk_migration_job = ::Gapic::Config::Method.new get_disk_migration_job_config - update_disk_migration_job_config = parent_rpcs.update_disk_migration_job if parent_rpcs.respond_to? :update_disk_migration_job - @update_disk_migration_job = ::Gapic::Config::Method.new update_disk_migration_job_config - delete_disk_migration_job_config = parent_rpcs.delete_disk_migration_job if parent_rpcs.respond_to? :delete_disk_migration_job - @delete_disk_migration_job = ::Gapic::Config::Method.new delete_disk_migration_job_config - run_disk_migration_job_config = parent_rpcs.run_disk_migration_job if parent_rpcs.respond_to? :run_disk_migration_job - @run_disk_migration_job = ::Gapic::Config::Method.new run_disk_migration_job_config - cancel_disk_migration_job_config = parent_rpcs.cancel_disk_migration_job if parent_rpcs.respond_to? :cancel_disk_migration_job - @cancel_disk_migration_job = ::Gapic::Config::Method.new cancel_disk_migration_job_config - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-vm_migration-v1/lib/google/cloud/vm_migration/v1/vm_migration/credentials.rb b/owl-bot-staging/google-cloud-vm_migration-v1/lib/google/cloud/vm_migration/v1/vm_migration/credentials.rb deleted file mode 100644 index a7e66e21fae2..000000000000 --- a/owl-bot-staging/google-cloud-vm_migration-v1/lib/google/cloud/vm_migration/v1/vm_migration/credentials.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! - -require "googleauth" - -module Google - module Cloud - module VMMigration - module V1 - module VMMigration - # Credentials for the VmMigration API. - class Credentials < ::Google::Auth::Credentials - self.scope = [ - "https://www.googleapis.com/auth/cloud-platform" - ] - self.env_vars = [ - "GOOGLE_CLOUD_CREDENTIALS", - "GOOGLE_CLOUD_KEYFILE", - "GCLOUD_KEYFILE", - "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-vm_migration-v1/lib/google/cloud/vm_migration/v1/vm_migration/operations.rb b/owl-bot-staging/google-cloud-vm_migration-v1/lib/google/cloud/vm_migration/v1/vm_migration/operations.rb deleted file mode 100644 index e506697a45da..000000000000 --- a/owl-bot-staging/google-cloud-vm_migration-v1/lib/google/cloud/vm_migration/v1/vm_migration/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 VMMigration - module V1 - module VMMigration - # Service that implements Longrunning Operations API. - class Operations - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "vmmigration.$UNIVERSE_DOMAIN$" - - # @private - attr_reader :operations_stub - - ## - # Configuration for the VmMigration 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 VmMigration 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::VMMigration::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::VMMigration::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::VMMigration::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::VMMigration::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::VMMigration::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 = "vmmigration.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-vm_migration-v1/lib/google/cloud/vm_migration/v1/vm_migration/paths.rb b/owl-bot-staging/google-cloud-vm_migration-v1/lib/google/cloud/vm_migration/v1/vm_migration/paths.rb deleted file mode 100644 index ac9c03a4c553..000000000000 --- a/owl-bot-staging/google-cloud-vm_migration-v1/lib/google/cloud/vm_migration/v1/vm_migration/paths.rb +++ /dev/null @@ -1,355 +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 VMMigration - module V1 - module VMMigration - # Path helper methods for the VmMigration API. - module Paths - ## - # Create a fully-qualified CloneJob resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/sources/{source}/migratingVms/{migrating_vm}/cloneJobs/{clone_job}` - # - # @param project [String] - # @param location [String] - # @param source [String] - # @param migrating_vm [String] - # @param clone_job [String] - # - # @return [::String] - def clone_job_path project:, location:, source:, migrating_vm:, clone_job: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "source cannot contain /" if source.to_s.include? "/" - raise ::ArgumentError, "migrating_vm cannot contain /" if migrating_vm.to_s.include? "/" - - "projects/#{project}/locations/#{location}/sources/#{source}/migratingVms/#{migrating_vm}/cloneJobs/#{clone_job}" - end - - ## - # 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 CutoverJob resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/sources/{source}/migratingVms/{migrating_vm}/cutoverJobs/{cutover_job}` - # - # @param project [String] - # @param location [String] - # @param source [String] - # @param migrating_vm [String] - # @param cutover_job [String] - # - # @return [::String] - def cutover_job_path project:, location:, source:, migrating_vm:, cutover_job: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "source cannot contain /" if source.to_s.include? "/" - raise ::ArgumentError, "migrating_vm cannot contain /" if migrating_vm.to_s.include? "/" - - "projects/#{project}/locations/#{location}/sources/#{source}/migratingVms/#{migrating_vm}/cutoverJobs/#{cutover_job}" - end - - ## - # Create a fully-qualified DatacenterConnector resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/sources/{source}/datacenterConnectors/{datacenter_connector}` - # - # @param project [String] - # @param location [String] - # @param source [String] - # @param datacenter_connector [String] - # - # @return [::String] - def datacenter_connector_path project:, location:, source:, datacenter_connector: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "source cannot contain /" if source.to_s.include? "/" - - "projects/#{project}/locations/#{location}/sources/#{source}/datacenterConnectors/#{datacenter_connector}" - end - - ## - # Create a fully-qualified DiskMigrationJob resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/sources/{source}/diskMigrationJobs/{disk_migration_job}` - # - # @param project [String] - # @param location [String] - # @param source [String] - # @param disk_migration_job [String] - # - # @return [::String] - def disk_migration_job_path project:, location:, source:, disk_migration_job: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "source cannot contain /" if source.to_s.include? "/" - - "projects/#{project}/locations/#{location}/sources/#{source}/diskMigrationJobs/#{disk_migration_job}" - end - - ## - # Create a fully-qualified Group resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/groups/{group}` - # - # @param project [String] - # @param location [String] - # @param group [String] - # - # @return [::String] - def group_path project:, location:, group: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/groups/#{group}" - end - - ## - # Create a fully-qualified Image resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/global/images/{image}` - # - # @param project [String] - # @param image [String] - # - # @return [::String] - def image_path project:, image: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - - "projects/#{project}/global/images/#{image}" - end - - ## - # Create a fully-qualified ImageImport resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/imageImports/{job}` - # - # @param project [String] - # @param location [String] - # @param job [String] - # - # @return [::String] - def image_import_path project:, location:, job: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/imageImports/#{job}" - end - - ## - # Create a fully-qualified ImageImportJob resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/imageImports/{job}/imageImportJobs/{result}` - # - # @param project [String] - # @param location [String] - # @param job [String] - # @param result [String] - # - # @return [::String] - def image_import_job_path project:, location:, job:, result: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "job cannot contain /" if job.to_s.include? "/" - - "projects/#{project}/locations/#{location}/imageImports/#{job}/imageImportJobs/#{result}" - 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 MigratingVm resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/sources/{source}/migratingVms/{migrating_vm}` - # - # @param project [String] - # @param location [String] - # @param source [String] - # @param migrating_vm [String] - # - # @return [::String] - def migrating_vm_path project:, location:, source:, migrating_vm: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "source cannot contain /" if source.to_s.include? "/" - - "projects/#{project}/locations/#{location}/sources/#{source}/migratingVms/#{migrating_vm}" - end - - ## - # Create a fully-qualified ReplicationCycle resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/sources/{source}/migratingVms/{migrating_vm}/replicationCycles/{replication_cycle}` - # - # @param project [String] - # @param location [String] - # @param source [String] - # @param migrating_vm [String] - # @param replication_cycle [String] - # - # @return [::String] - def replication_cycle_path project:, location:, source:, migrating_vm:, replication_cycle: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "source cannot contain /" if source.to_s.include? "/" - raise ::ArgumentError, "migrating_vm cannot contain /" if migrating_vm.to_s.include? "/" - - "projects/#{project}/locations/#{location}/sources/#{source}/migratingVms/#{migrating_vm}/replicationCycles/#{replication_cycle}" - end - - ## - # Create a fully-qualified ServiceAccount resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/serviceAccounts/{service_account}` - # - # @param project [String] - # @param service_account [String] - # - # @return [::String] - def service_account_path project:, service_account: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - - "projects/#{project}/serviceAccounts/#{service_account}" - end - - ## - # Create a fully-qualified Source resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/sources/{source}` - # - # @param project [String] - # @param location [String] - # @param source [String] - # - # @return [::String] - def source_path project:, location:, source: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/sources/#{source}" - end - - ## - # Create a fully-qualified TargetProject resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/targetProjects/{target_project}` - # - # @param project [String] - # @param location [String] - # @param target_project [String] - # - # @return [::String] - def target_project_path project:, location:, target_project: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/targetProjects/#{target_project}" - end - - ## - # Create a fully-qualified UtilizationReport resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/sources/{source}/utilizationReports/{utilization_report}` - # - # @param project [String] - # @param location [String] - # @param source [String] - # @param utilization_report [String] - # - # @return [::String] - def utilization_report_path project:, location:, source:, utilization_report: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "source cannot contain /" if source.to_s.include? "/" - - "projects/#{project}/locations/#{location}/sources/#{source}/utilizationReports/#{utilization_report}" - end - - extend self - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-vm_migration-v1/lib/google/cloud/vm_migration/v1/vm_migration/rest.rb b/owl-bot-staging/google-cloud-vm_migration-v1/lib/google/cloud/vm_migration/v1/vm_migration/rest.rb deleted file mode 100644 index 96d212cd440f..000000000000 --- a/owl-bot-staging/google-cloud-vm_migration-v1/lib/google/cloud/vm_migration/v1/vm_migration/rest.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! - -require "gapic/rest" -require "gapic/config" -require "gapic/config/method" - -require "google/cloud/vm_migration/v1/version" -require "google/cloud/vm_migration/v1/bindings_override" - -require "google/cloud/vm_migration/v1/vm_migration/credentials" -require "google/cloud/vm_migration/v1/vm_migration/paths" -require "google/cloud/vm_migration/v1/vm_migration/rest/operations" -require "google/cloud/vm_migration/v1/vm_migration/rest/client" - -module Google - module Cloud - module VMMigration - module V1 - ## - # VM Migration Service - # - # To load this service and instantiate a REST client: - # - # require "google/cloud/vm_migration/v1/vm_migration/rest" - # client = ::Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new - # - module VMMigration - # Client for the REST transport - module Rest - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "rest", "helpers.rb" -require "google/cloud/vm_migration/v1/vm_migration/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-vm_migration-v1/lib/google/cloud/vm_migration/v1/vm_migration/rest/client.rb b/owl-bot-staging/google-cloud-vm_migration-v1/lib/google/cloud/vm_migration/v1/vm_migration/rest/client.rb deleted file mode 100644 index 3fd2441a1728..000000000000 --- a/owl-bot-staging/google-cloud-vm_migration-v1/lib/google/cloud/vm_migration/v1/vm_migration/rest/client.rb +++ /dev/null @@ -1,6704 +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/vmmigration/v1/vmmigration_pb" -require "google/cloud/vm_migration/v1/vm_migration/rest/service_stub" -require "google/cloud/location/rest" - -module Google - module Cloud - module VMMigration - module V1 - module VMMigration - module Rest - ## - # REST client for the VmMigration service. - # - # VM Migration Service - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "vmmigration.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :vm_migration_stub - - ## - # Configure the VmMigration Client class. - # - # See {::Google::Cloud::VMMigration::V1::VMMigration::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all VmMigration clients - # ::Google::Cloud::VMMigration::V1::VMMigration::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", "VMMigration", "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.timeout = 60.0 - - default_config.rpcs.create_source.timeout = 900.0 - - default_config.rpcs.fetch_inventory.timeout = 300.0 - - default_config.rpcs.create_utilization_report.timeout = 300.0 - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the VmMigration 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::VMMigration::V1::VMMigration::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 - @vm_migration_stub.universe_domain - end - - ## - # Create a new VmMigration REST client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the VmMigration 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::VMMigration::V1::VMMigration::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 - - @vm_migration_stub = ::Google::Cloud::VMMigration::V1::VMMigration::Rest::ServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials, - logger: @config.logger - ) - - @vm_migration_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 = @vm_migration_stub.endpoint - config.universe_domain = @vm_migration_stub.universe_domain - config.bindings_override = @config.bindings_override - config.logger = @vm_migration_stub.logger if config.respond_to? :logger= - end - end - - ## - # Get the associated client for long-running operations. - # - # @return [::Google::Cloud::VMMigration::V1::VMMigration::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 - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @vm_migration_stub.logger - end - - # Service calls - - ## - # Lists Sources in a given project and location. - # - # @overload list_sources(request, options = nil) - # Pass arguments to `list_sources` via a request object, either of type - # {::Google::Cloud::VMMigration::V1::ListSourcesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VMMigration::V1::ListSourcesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_sources(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) - # Pass arguments to `list_sources` via keyword arguments. Note that at - # least one keyword argument is 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 parent, which owns this collection of sources. - # @param page_size [::Integer] - # Optional. The maximum number of sources to return. The service may return - # fewer than this value. If unspecified, at most 500 sources will be - # returned. The maximum value is 1000; values above 1000 will be coerced to - # 1000. - # @param page_token [::String] - # Required. A page token, received from a previous `ListSources` call. - # Provide this to retrieve the subsequent page. - # - # When paginating, all other parameters provided to `ListSources` must - # match the call that provided the page token. - # @param filter [::String] - # Optional. The filter request. - # @param order_by [::String] - # Optional. the order by fields for the result. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::VMMigration::V1::Source>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::VMMigration::V1::Source>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/vm_migration/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VMMigration::V1::ListSourcesRequest.new - # - # # Call the list_sources method. - # result = client.list_sources 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::VMMigration::V1::Source. - # p item - # end - # - def list_sources request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::ListSourcesRequest - - # Converts hash 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_sources.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::VMMigration::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_sources.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_sources.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vm_migration_stub.list_sources request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @vm_migration_stub, :list_sources, "sources", 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 details of a single Source. - # - # @overload get_source(request, options = nil) - # Pass arguments to `get_source` via a request object, either of type - # {::Google::Cloud::VMMigration::V1::GetSourceRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VMMigration::V1::GetSourceRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_source(name: nil) - # Pass arguments to `get_source` via keyword arguments. Note that at - # least one keyword argument is 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 Source name. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::VMMigration::V1::Source] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::VMMigration::V1::Source] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/vm_migration/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VMMigration::V1::GetSourceRequest.new - # - # # Call the get_source method. - # result = client.get_source request - # - # # The returned object is of type Google::Cloud::VMMigration::V1::Source. - # p result - # - def get_source request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::GetSourceRequest - - # Converts hash 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_source.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::VMMigration::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_source.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_source.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vm_migration_stub.get_source 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 Source in a given project and location. - # - # @overload create_source(request, options = nil) - # Pass arguments to `create_source` via a request object, either of type - # {::Google::Cloud::VMMigration::V1::CreateSourceRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VMMigration::V1::CreateSourceRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_source(parent: nil, source_id: nil, source: nil, request_id: nil) - # Pass arguments to `create_source` via keyword arguments. Note that at - # least one keyword argument is 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 Source's parent. - # @param source_id [::String] - # Required. The source identifier. - # @param source [::Google::Cloud::VMMigration::V1::Source, ::Hash] - # Required. The create request body. - # @param request_id [::String] - # A request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server will guarantee - # that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @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/vm_migration/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VMMigration::V1::CreateSourceRequest.new - # - # # Call the create_source method. - # result = client.create_source 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_source request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::CreateSourceRequest - - # Converts hash 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_source.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::VMMigration::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_source.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_source.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vm_migration_stub.create_source 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 - - ## - # Updates the parameters of a single Source. - # - # @overload update_source(request, options = nil) - # Pass arguments to `update_source` via a request object, either of type - # {::Google::Cloud::VMMigration::V1::UpdateSourceRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VMMigration::V1::UpdateSourceRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_source(update_mask: nil, source: nil, request_id: nil) - # Pass arguments to `update_source` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Field mask is used to specify the fields to be overwritten in the - # Source resource by the update. - # The fields specified in the update_mask are relative to the resource, not - # the full request. A field will be overwritten if it is in the mask. If the - # user does not provide a mask then all fields will be overwritten. - # @param source [::Google::Cloud::VMMigration::V1::Source, ::Hash] - # Required. The update request body. - # @param request_id [::String] - # A request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server will guarantee - # that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @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/vm_migration/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VMMigration::V1::UpdateSourceRequest.new - # - # # Call the update_source method. - # result = client.update_source 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 update_source request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::UpdateSourceRequest - - # Converts hash 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_source.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::VMMigration::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_source.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_source.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vm_migration_stub.update_source 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 single Source. - # - # @overload delete_source(request, options = nil) - # Pass arguments to `delete_source` via a request object, either of type - # {::Google::Cloud::VMMigration::V1::DeleteSourceRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VMMigration::V1::DeleteSourceRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_source(name: nil, request_id: nil) - # Pass arguments to `delete_source` via keyword arguments. Note that at - # least one keyword argument is 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 Source name. - # @param request_id [::String] - # Optional. A request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server will guarantee - # that for at least 60 minutes after the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @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/vm_migration/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VMMigration::V1::DeleteSourceRequest.new - # - # # Call the delete_source method. - # result = client.delete_source 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_source request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::DeleteSourceRequest - - # Converts hash 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_source.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::VMMigration::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_source.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_source.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vm_migration_stub.delete_source 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 - - ## - # List remote source's inventory of VMs. - # The remote source is the onprem vCenter (remote in the sense it's not in - # Compute Engine). The inventory describes the list of existing VMs in that - # source. Note that this operation lists the VMs on the remote source, as - # opposed to listing the MigratingVms resources in the vmmigration service. - # - # @overload fetch_inventory(request, options = nil) - # Pass arguments to `fetch_inventory` via a request object, either of type - # {::Google::Cloud::VMMigration::V1::FetchInventoryRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VMMigration::V1::FetchInventoryRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload fetch_inventory(source: nil, force_refresh: nil) - # Pass arguments to `fetch_inventory` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param source [::String] - # Required. The name of the Source. - # @param force_refresh [::Boolean] - # If this flag is set to true, the source will be queried instead of using - # cached results. Using this flag will make the call slower. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::VMMigration::V1::FetchInventoryResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::VMMigration::V1::FetchInventoryResponse] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/vm_migration/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VMMigration::V1::FetchInventoryRequest.new - # - # # Call the fetch_inventory method. - # result = client.fetch_inventory request - # - # # The returned object is of type Google::Cloud::VMMigration::V1::FetchInventoryResponse. - # p result - # - def fetch_inventory request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::FetchInventoryRequest - - # Converts hash 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.fetch_inventory.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::VMMigration::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.fetch_inventory.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.fetch_inventory.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vm_migration_stub.fetch_inventory 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 - - ## - # List remote source's inventory of storage resources. - # The remote source is another cloud vendor (e.g. AWS, Azure). - # The inventory describes the list of existing storage resources in that - # source. Note that this operation lists the resources on the remote source, - # as opposed to listing the MigratingVms resources in the vmmigration - # service. - # - # @overload fetch_storage_inventory(request, options = nil) - # Pass arguments to `fetch_storage_inventory` via a request object, either of type - # {::Google::Cloud::VMMigration::V1::FetchStorageInventoryRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VMMigration::V1::FetchStorageInventoryRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload fetch_storage_inventory(source: nil, type: nil, force_refresh: nil, page_size: nil, page_token: nil) - # Pass arguments to `fetch_storage_inventory` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param source [::String] - # Required. The name of the Source. - # @param type [::Google::Cloud::VMMigration::V1::FetchStorageInventoryRequest::StorageType] - # Required. The type of the storage inventory to fetch. - # @param force_refresh [::Boolean] - # Optional. If this flag is set to true, the source will be queried instead - # of using cached results. Using this flag will make the call slower. - # @param page_size [::Integer] - # Optional. The maximum number of VMs to return. The service may return - # fewer than this value. - # @param page_token [::String] - # Optional. A page token, received from a previous `FetchStorageInventory` - # call. Provide this to retrieve the subsequent page. When paginating, all - # other parameters provided to `FetchStorageInventory` must match the call - # that provided the page token. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::VMMigration::V1::SourceStorageResource>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::VMMigration::V1::SourceStorageResource>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/vm_migration/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VMMigration::V1::FetchStorageInventoryRequest.new - # - # # Call the fetch_storage_inventory method. - # result = client.fetch_storage_inventory 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::VMMigration::V1::SourceStorageResource. - # p item - # end - # - def fetch_storage_inventory request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::FetchStorageInventoryRequest - - # Converts hash 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.fetch_storage_inventory.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::VMMigration::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.fetch_storage_inventory.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.fetch_storage_inventory.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vm_migration_stub.fetch_storage_inventory request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @vm_migration_stub, :fetch_storage_inventory, "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 - - ## - # Lists Utilization Reports of the given Source. - # - # @overload list_utilization_reports(request, options = nil) - # Pass arguments to `list_utilization_reports` via a request object, either of type - # {::Google::Cloud::VMMigration::V1::ListUtilizationReportsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VMMigration::V1::ListUtilizationReportsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_utilization_reports(parent: nil, view: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) - # Pass arguments to `list_utilization_reports` via keyword arguments. Note that at - # least one keyword argument is 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 Utilization Reports parent. - # @param view [::Google::Cloud::VMMigration::V1::UtilizationReportView] - # Optional. The level of details of each report. - # Defaults to BASIC. - # @param page_size [::Integer] - # Optional. The maximum number of reports to return. The service may return - # fewer than this value. If unspecified, at most 500 reports will be - # returned. The maximum value is 1000; values above 1000 will be coerced to - # 1000. - # @param page_token [::String] - # Required. A page token, received from a previous `ListUtilizationReports` - # call. Provide this to retrieve the subsequent page. - # - # When paginating, all other parameters provided to `ListUtilizationReports` - # must match the call that provided the page token. - # @param filter [::String] - # Optional. The filter request. - # @param order_by [::String] - # Optional. the order by fields for the result. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::VMMigration::V1::UtilizationReport>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::VMMigration::V1::UtilizationReport>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/vm_migration/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VMMigration::V1::ListUtilizationReportsRequest.new - # - # # Call the list_utilization_reports method. - # result = client.list_utilization_reports 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::VMMigration::V1::UtilizationReport. - # p item - # end - # - def list_utilization_reports request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::ListUtilizationReportsRequest - - # Converts hash 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_utilization_reports.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::VMMigration::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_utilization_reports.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_utilization_reports.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vm_migration_stub.list_utilization_reports request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @vm_migration_stub, :list_utilization_reports, "utilization_reports", 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 a single Utilization Report. - # - # @overload get_utilization_report(request, options = nil) - # Pass arguments to `get_utilization_report` via a request object, either of type - # {::Google::Cloud::VMMigration::V1::GetUtilizationReportRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VMMigration::V1::GetUtilizationReportRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_utilization_report(name: nil, view: nil) - # Pass arguments to `get_utilization_report` via keyword arguments. Note that at - # least one keyword argument is 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 Utilization Report name. - # @param view [::Google::Cloud::VMMigration::V1::UtilizationReportView] - # Optional. The level of details of the report. - # Defaults to FULL - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::VMMigration::V1::UtilizationReport] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::VMMigration::V1::UtilizationReport] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/vm_migration/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VMMigration::V1::GetUtilizationReportRequest.new - # - # # Call the get_utilization_report method. - # result = client.get_utilization_report request - # - # # The returned object is of type Google::Cloud::VMMigration::V1::UtilizationReport. - # p result - # - def get_utilization_report request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::GetUtilizationReportRequest - - # Converts hash 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_utilization_report.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::VMMigration::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_utilization_report.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_utilization_report.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vm_migration_stub.get_utilization_report 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 UtilizationReport. - # - # @overload create_utilization_report(request, options = nil) - # Pass arguments to `create_utilization_report` via a request object, either of type - # {::Google::Cloud::VMMigration::V1::CreateUtilizationReportRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VMMigration::V1::CreateUtilizationReportRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_utilization_report(parent: nil, utilization_report: nil, utilization_report_id: nil, request_id: nil) - # Pass arguments to `create_utilization_report` via keyword arguments. Note that at - # least one keyword argument is 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 Utilization Report's parent. - # @param utilization_report [::Google::Cloud::VMMigration::V1::UtilizationReport, ::Hash] - # Required. The report to create. - # @param utilization_report_id [::String] - # Required. The ID to use for the report, which will become the final - # component of the reports's resource name. - # - # This value maximum length is 63 characters, and valid characters - # are /[a-z][0-9]-/. It must start with an english letter and must not - # end with a hyphen. - # @param request_id [::String] - # A request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server will guarantee - # that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @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/vm_migration/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VMMigration::V1::CreateUtilizationReportRequest.new - # - # # Call the create_utilization_report method. - # result = client.create_utilization_report 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_utilization_report request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::CreateUtilizationReportRequest - - # Converts hash 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_utilization_report.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::VMMigration::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_utilization_report.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_utilization_report.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vm_migration_stub.create_utilization_report 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 single Utilization Report. - # - # @overload delete_utilization_report(request, options = nil) - # Pass arguments to `delete_utilization_report` via a request object, either of type - # {::Google::Cloud::VMMigration::V1::DeleteUtilizationReportRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VMMigration::V1::DeleteUtilizationReportRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_utilization_report(name: nil, request_id: nil) - # Pass arguments to `delete_utilization_report` via keyword arguments. Note that at - # least one keyword argument is 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 Utilization Report name. - # @param request_id [::String] - # Optional. A request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server will guarantee - # that for at least 60 minutes after the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @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/vm_migration/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VMMigration::V1::DeleteUtilizationReportRequest.new - # - # # Call the delete_utilization_report method. - # result = client.delete_utilization_report 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_utilization_report request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::DeleteUtilizationReportRequest - - # Converts hash 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_utilization_report.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::VMMigration::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_utilization_report.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_utilization_report.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vm_migration_stub.delete_utilization_report 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 - - ## - # Lists DatacenterConnectors in a given Source. - # - # @overload list_datacenter_connectors(request, options = nil) - # Pass arguments to `list_datacenter_connectors` via a request object, either of type - # {::Google::Cloud::VMMigration::V1::ListDatacenterConnectorsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VMMigration::V1::ListDatacenterConnectorsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_datacenter_connectors(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) - # Pass arguments to `list_datacenter_connectors` via keyword arguments. Note that at - # least one keyword argument is 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 parent, which owns this collection of connectors. - # @param page_size [::Integer] - # Optional. The maximum number of connectors to return. The service may - # return fewer than this value. If unspecified, at most 500 sources will be - # returned. The maximum value is 1000; values above 1000 will be coerced to - # 1000. - # @param page_token [::String] - # Required. A page token, received from a previous `ListDatacenterConnectors` - # call. Provide this to retrieve the subsequent page. - # - # When paginating, all other parameters provided to - # `ListDatacenterConnectors` must match the call that provided the page - # token. - # @param filter [::String] - # Optional. The filter request. - # @param order_by [::String] - # Optional. the order by fields for the result. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::VMMigration::V1::DatacenterConnector>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::VMMigration::V1::DatacenterConnector>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/vm_migration/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VMMigration::V1::ListDatacenterConnectorsRequest.new - # - # # Call the list_datacenter_connectors method. - # result = client.list_datacenter_connectors 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::VMMigration::V1::DatacenterConnector. - # p item - # end - # - def list_datacenter_connectors request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::ListDatacenterConnectorsRequest - - # Converts hash 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_datacenter_connectors.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::VMMigration::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_datacenter_connectors.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_datacenter_connectors.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vm_migration_stub.list_datacenter_connectors request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @vm_migration_stub, :list_datacenter_connectors, "datacenter_connectors", 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 details of a single DatacenterConnector. - # - # @overload get_datacenter_connector(request, options = nil) - # Pass arguments to `get_datacenter_connector` via a request object, either of type - # {::Google::Cloud::VMMigration::V1::GetDatacenterConnectorRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VMMigration::V1::GetDatacenterConnectorRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_datacenter_connector(name: nil) - # Pass arguments to `get_datacenter_connector` via keyword arguments. Note that at - # least one keyword argument is 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 name of the DatacenterConnector. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::VMMigration::V1::DatacenterConnector] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::VMMigration::V1::DatacenterConnector] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/vm_migration/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VMMigration::V1::GetDatacenterConnectorRequest.new - # - # # Call the get_datacenter_connector method. - # result = client.get_datacenter_connector request - # - # # The returned object is of type Google::Cloud::VMMigration::V1::DatacenterConnector. - # p result - # - def get_datacenter_connector request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::GetDatacenterConnectorRequest - - # Converts hash 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_datacenter_connector.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::VMMigration::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_datacenter_connector.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_datacenter_connector.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vm_migration_stub.get_datacenter_connector 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 DatacenterConnector in a given Source. - # - # @overload create_datacenter_connector(request, options = nil) - # Pass arguments to `create_datacenter_connector` via a request object, either of type - # {::Google::Cloud::VMMigration::V1::CreateDatacenterConnectorRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VMMigration::V1::CreateDatacenterConnectorRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_datacenter_connector(parent: nil, datacenter_connector_id: nil, datacenter_connector: nil, request_id: nil) - # Pass arguments to `create_datacenter_connector` via keyword arguments. Note that at - # least one keyword argument is 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 DatacenterConnector's parent. - # Required. The Source in where the new DatacenterConnector will be created. - # For example: - # `projects/my-project/locations/us-central1/sources/my-source` - # @param datacenter_connector_id [::String] - # Required. The datacenterConnector identifier. - # @param datacenter_connector [::Google::Cloud::VMMigration::V1::DatacenterConnector, ::Hash] - # Required. The create request body. - # @param request_id [::String] - # A request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server will guarantee - # that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @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/vm_migration/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VMMigration::V1::CreateDatacenterConnectorRequest.new - # - # # Call the create_datacenter_connector method. - # result = client.create_datacenter_connector 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_datacenter_connector request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::CreateDatacenterConnectorRequest - - # Converts hash 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_datacenter_connector.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::VMMigration::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_datacenter_connector.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_datacenter_connector.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vm_migration_stub.create_datacenter_connector 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 single DatacenterConnector. - # - # @overload delete_datacenter_connector(request, options = nil) - # Pass arguments to `delete_datacenter_connector` via a request object, either of type - # {::Google::Cloud::VMMigration::V1::DeleteDatacenterConnectorRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VMMigration::V1::DeleteDatacenterConnectorRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_datacenter_connector(name: nil, request_id: nil) - # Pass arguments to `delete_datacenter_connector` via keyword arguments. Note that at - # least one keyword argument is 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 DatacenterConnector name. - # @param request_id [::String] - # A request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server will guarantee - # that for at least 60 minutes after the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @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/vm_migration/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VMMigration::V1::DeleteDatacenterConnectorRequest.new - # - # # Call the delete_datacenter_connector method. - # result = client.delete_datacenter_connector 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_datacenter_connector request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::DeleteDatacenterConnectorRequest - - # Converts hash 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_datacenter_connector.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::VMMigration::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_datacenter_connector.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_datacenter_connector.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vm_migration_stub.delete_datacenter_connector 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 - - ## - # Upgrades the appliance relate to this DatacenterConnector to the in-place - # updateable version. - # - # @overload upgrade_appliance(request, options = nil) - # Pass arguments to `upgrade_appliance` via a request object, either of type - # {::Google::Cloud::VMMigration::V1::UpgradeApplianceRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VMMigration::V1::UpgradeApplianceRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload upgrade_appliance(datacenter_connector: nil, request_id: nil) - # Pass arguments to `upgrade_appliance` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param datacenter_connector [::String] - # Required. The DatacenterConnector name. - # @param request_id [::String] - # A request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server will guarantee - # that for at least 60 minutes after the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @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/vm_migration/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VMMigration::V1::UpgradeApplianceRequest.new - # - # # Call the upgrade_appliance method. - # result = client.upgrade_appliance 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 upgrade_appliance request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::UpgradeApplianceRequest - - # Converts hash 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.upgrade_appliance.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::VMMigration::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.upgrade_appliance.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.upgrade_appliance.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vm_migration_stub.upgrade_appliance 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 MigratingVm in a given Source. - # - # @overload create_migrating_vm(request, options = nil) - # Pass arguments to `create_migrating_vm` via a request object, either of type - # {::Google::Cloud::VMMigration::V1::CreateMigratingVmRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VMMigration::V1::CreateMigratingVmRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_migrating_vm(parent: nil, migrating_vm_id: nil, migrating_vm: nil, request_id: nil) - # Pass arguments to `create_migrating_vm` via keyword arguments. Note that at - # least one keyword argument is 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 MigratingVm's parent. - # @param migrating_vm_id [::String] - # Required. The migratingVm identifier. - # @param migrating_vm [::Google::Cloud::VMMigration::V1::MigratingVm, ::Hash] - # Required. The create request body. - # @param request_id [::String] - # A request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server will guarantee - # that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @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/vm_migration/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VMMigration::V1::CreateMigratingVmRequest.new - # - # # Call the create_migrating_vm method. - # result = client.create_migrating_vm 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_migrating_vm request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::CreateMigratingVmRequest - - # Converts hash 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_migrating_vm.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::VMMigration::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_migrating_vm.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_migrating_vm.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vm_migration_stub.create_migrating_vm 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 - - ## - # Lists MigratingVms in a given Source. - # - # @overload list_migrating_vms(request, options = nil) - # Pass arguments to `list_migrating_vms` via a request object, either of type - # {::Google::Cloud::VMMigration::V1::ListMigratingVmsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VMMigration::V1::ListMigratingVmsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_migrating_vms(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil, view: nil) - # Pass arguments to `list_migrating_vms` via keyword arguments. Note that at - # least one keyword argument is 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 parent, which owns this collection of MigratingVms. - # @param page_size [::Integer] - # Optional. The maximum number of migrating VMs to return. The service may - # return fewer than this value. If unspecified, at most 500 migrating VMs - # will be returned. The maximum value is 1000; values above 1000 will be - # coerced to 1000. - # @param page_token [::String] - # Required. A page token, received from a previous `ListMigratingVms` call. - # Provide this to retrieve the subsequent page. - # - # When paginating, all other parameters provided to `ListMigratingVms` - # must match the call that provided the page token. - # @param filter [::String] - # Optional. The filter request. - # @param order_by [::String] - # Optional. the order by fields for the result. - # @param view [::Google::Cloud::VMMigration::V1::MigratingVmView] - # Optional. The level of details of each migrating VM. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::VMMigration::V1::MigratingVm>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::VMMigration::V1::MigratingVm>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/vm_migration/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VMMigration::V1::ListMigratingVmsRequest.new - # - # # Call the list_migrating_vms method. - # result = client.list_migrating_vms 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::VMMigration::V1::MigratingVm. - # p item - # end - # - def list_migrating_vms request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::ListMigratingVmsRequest - - # Converts hash 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_migrating_vms.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::VMMigration::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_migrating_vms.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_migrating_vms.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vm_migration_stub.list_migrating_vms request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @vm_migration_stub, :list_migrating_vms, "migrating_vms", 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 details of a single MigratingVm. - # - # @overload get_migrating_vm(request, options = nil) - # Pass arguments to `get_migrating_vm` via a request object, either of type - # {::Google::Cloud::VMMigration::V1::GetMigratingVmRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VMMigration::V1::GetMigratingVmRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_migrating_vm(name: nil, view: nil) - # Pass arguments to `get_migrating_vm` via keyword arguments. Note that at - # least one keyword argument is 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 name of the MigratingVm. - # @param view [::Google::Cloud::VMMigration::V1::MigratingVmView] - # Optional. The level of details of the migrating VM. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::VMMigration::V1::MigratingVm] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::VMMigration::V1::MigratingVm] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/vm_migration/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VMMigration::V1::GetMigratingVmRequest.new - # - # # Call the get_migrating_vm method. - # result = client.get_migrating_vm request - # - # # The returned object is of type Google::Cloud::VMMigration::V1::MigratingVm. - # p result - # - def get_migrating_vm request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::GetMigratingVmRequest - - # Converts hash 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_migrating_vm.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::VMMigration::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_migrating_vm.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_migrating_vm.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vm_migration_stub.get_migrating_vm 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 parameters of a single MigratingVm. - # - # @overload update_migrating_vm(request, options = nil) - # Pass arguments to `update_migrating_vm` via a request object, either of type - # {::Google::Cloud::VMMigration::V1::UpdateMigratingVmRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VMMigration::V1::UpdateMigratingVmRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_migrating_vm(update_mask: nil, migrating_vm: nil, request_id: nil) - # Pass arguments to `update_migrating_vm` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Field mask is used to specify the fields to be overwritten in the - # MigratingVm resource by the update. - # The fields specified in the update_mask are relative to the resource, not - # the full request. A field will be overwritten if it is in the mask. If the - # user does not provide a mask then all fields will be overwritten. - # @param migrating_vm [::Google::Cloud::VMMigration::V1::MigratingVm, ::Hash] - # Required. The update request body. - # @param request_id [::String] - # A request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server will guarantee - # that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @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/vm_migration/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VMMigration::V1::UpdateMigratingVmRequest.new - # - # # Call the update_migrating_vm method. - # result = client.update_migrating_vm 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 update_migrating_vm request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::UpdateMigratingVmRequest - - # Converts hash 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_migrating_vm.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::VMMigration::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_migrating_vm.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_migrating_vm.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vm_migration_stub.update_migrating_vm 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 single MigratingVm. - # - # @overload delete_migrating_vm(request, options = nil) - # Pass arguments to `delete_migrating_vm` via a request object, either of type - # {::Google::Cloud::VMMigration::V1::DeleteMigratingVmRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VMMigration::V1::DeleteMigratingVmRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_migrating_vm(name: nil) - # Pass arguments to `delete_migrating_vm` via keyword arguments. Note that at - # least one keyword argument is 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 name of the MigratingVm. - # @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/vm_migration/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VMMigration::V1::DeleteMigratingVmRequest.new - # - # # Call the delete_migrating_vm method. - # result = client.delete_migrating_vm 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_migrating_vm request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::DeleteMigratingVmRequest - - # Converts hash 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_migrating_vm.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::VMMigration::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_migrating_vm.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_migrating_vm.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vm_migration_stub.delete_migrating_vm 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 - - ## - # Starts migration for a VM. Starts the process of uploading - # data and creating snapshots, in replication cycles scheduled by the policy. - # - # @overload start_migration(request, options = nil) - # Pass arguments to `start_migration` via a request object, either of type - # {::Google::Cloud::VMMigration::V1::StartMigrationRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VMMigration::V1::StartMigrationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload start_migration(migrating_vm: nil) - # Pass arguments to `start_migration` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param migrating_vm [::String] - # Required. The name of the MigratingVm. - # @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/vm_migration/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VMMigration::V1::StartMigrationRequest.new - # - # # Call the start_migration method. - # result = client.start_migration 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 start_migration request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::StartMigrationRequest - - # Converts hash 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.start_migration.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::VMMigration::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.start_migration.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.start_migration.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vm_migration_stub.start_migration 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 - - ## - # Resumes a migration for a VM. When called on a paused migration, will start - # the process of uploading data and creating snapshots; when called on a - # completed cut-over migration, will update the migration to active state and - # start the process of uploading data and creating snapshots. - # - # @overload resume_migration(request, options = nil) - # Pass arguments to `resume_migration` via a request object, either of type - # {::Google::Cloud::VMMigration::V1::ResumeMigrationRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VMMigration::V1::ResumeMigrationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload resume_migration(migrating_vm: nil) - # Pass arguments to `resume_migration` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param migrating_vm [::String] - # Required. The name of the MigratingVm. - # @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/vm_migration/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VMMigration::V1::ResumeMigrationRequest.new - # - # # Call the resume_migration method. - # result = client.resume_migration 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 resume_migration request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::ResumeMigrationRequest - - # Converts hash 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.resume_migration.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::VMMigration::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.resume_migration.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.resume_migration.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vm_migration_stub.resume_migration 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 - - ## - # Pauses a migration for a VM. If cycle tasks are running they will be - # cancelled, preserving source task data. Further replication cycles will not - # be triggered while the VM is paused. - # - # @overload pause_migration(request, options = nil) - # Pass arguments to `pause_migration` via a request object, either of type - # {::Google::Cloud::VMMigration::V1::PauseMigrationRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VMMigration::V1::PauseMigrationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload pause_migration(migrating_vm: nil) - # Pass arguments to `pause_migration` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param migrating_vm [::String] - # Required. The name of the MigratingVm. - # @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/vm_migration/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VMMigration::V1::PauseMigrationRequest.new - # - # # Call the pause_migration method. - # result = client.pause_migration 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 pause_migration request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::PauseMigrationRequest - - # Converts hash 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.pause_migration.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::VMMigration::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.pause_migration.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.pause_migration.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vm_migration_stub.pause_migration 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 - - ## - # Marks a migration as completed, deleting migration resources that are no - # longer being used. Only applicable after cutover is done. - # - # @overload finalize_migration(request, options = nil) - # Pass arguments to `finalize_migration` via a request object, either of type - # {::Google::Cloud::VMMigration::V1::FinalizeMigrationRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VMMigration::V1::FinalizeMigrationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload finalize_migration(migrating_vm: nil) - # Pass arguments to `finalize_migration` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param migrating_vm [::String] - # Required. The name of the MigratingVm. - # @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/vm_migration/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VMMigration::V1::FinalizeMigrationRequest.new - # - # # Call the finalize_migration method. - # result = client.finalize_migration 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 finalize_migration request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::FinalizeMigrationRequest - - # Converts hash 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.finalize_migration.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::VMMigration::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.finalize_migration.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.finalize_migration.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vm_migration_stub.finalize_migration 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 - - ## - # Extend the migrating VM time to live. - # - # @overload extend_migration(request, options = nil) - # Pass arguments to `extend_migration` via a request object, either of type - # {::Google::Cloud::VMMigration::V1::ExtendMigrationRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VMMigration::V1::ExtendMigrationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload extend_migration(migrating_vm: nil) - # Pass arguments to `extend_migration` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param migrating_vm [::String] - # Required. The name of the MigratingVm. - # @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/vm_migration/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VMMigration::V1::ExtendMigrationRequest.new - # - # # Call the extend_migration method. - # result = client.extend_migration 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 extend_migration request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::ExtendMigrationRequest - - # Converts hash 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.extend_migration.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::VMMigration::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.extend_migration.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.extend_migration.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vm_migration_stub.extend_migration 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 - - ## - # Initiates a Clone of a specific migrating VM. - # - # @overload create_clone_job(request, options = nil) - # Pass arguments to `create_clone_job` via a request object, either of type - # {::Google::Cloud::VMMigration::V1::CreateCloneJobRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VMMigration::V1::CreateCloneJobRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_clone_job(parent: nil, clone_job_id: nil, clone_job: nil, request_id: nil) - # Pass arguments to `create_clone_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 Clone's parent. - # @param clone_job_id [::String] - # Required. The clone job identifier. - # @param clone_job [::Google::Cloud::VMMigration::V1::CloneJob, ::Hash] - # Required. The clone request body. - # @param request_id [::String] - # A request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server will guarantee - # that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @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/vm_migration/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VMMigration::V1::CreateCloneJobRequest.new - # - # # Call the create_clone_job method. - # result = client.create_clone_job 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_clone_job request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::CreateCloneJobRequest - - # Converts hash 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_clone_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::VMMigration::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_clone_job.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_clone_job.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vm_migration_stub.create_clone_job 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 - - ## - # Initiates the cancellation of a running clone job. - # - # @overload cancel_clone_job(request, options = nil) - # Pass arguments to `cancel_clone_job` via a request object, either of type - # {::Google::Cloud::VMMigration::V1::CancelCloneJobRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VMMigration::V1::CancelCloneJobRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_clone_job(name: nil) - # Pass arguments to `cancel_clone_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 clone job id - # @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/vm_migration/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VMMigration::V1::CancelCloneJobRequest.new - # - # # Call the cancel_clone_job method. - # result = client.cancel_clone_job 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 cancel_clone_job request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::CancelCloneJobRequest - - # Converts hash 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_clone_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::VMMigration::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_clone_job.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.cancel_clone_job.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vm_migration_stub.cancel_clone_job 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 - - ## - # Lists the CloneJobs of a migrating VM. Only 25 most recent CloneJobs are - # listed. - # - # @overload list_clone_jobs(request, options = nil) - # Pass arguments to `list_clone_jobs` via a request object, either of type - # {::Google::Cloud::VMMigration::V1::ListCloneJobsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VMMigration::V1::ListCloneJobsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_clone_jobs(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) - # Pass arguments to `list_clone_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 parent, which owns this collection of source VMs. - # @param page_size [::Integer] - # Optional. The maximum number of clone jobs to return. The service may - # return fewer than this value. If unspecified, at most 500 clone jobs will - # be returned. The maximum value is 1000; values above 1000 will be coerced - # to 1000. - # @param page_token [::String] - # Required. A page token, received from a previous `ListCloneJobs` call. - # Provide this to retrieve the subsequent page. - # - # When paginating, all other parameters provided to `ListCloneJobs` must - # match the call that provided the page token. - # @param filter [::String] - # Optional. The filter request. - # @param order_by [::String] - # Optional. the order by fields for the result. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::VMMigration::V1::CloneJob>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::VMMigration::V1::CloneJob>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/vm_migration/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VMMigration::V1::ListCloneJobsRequest.new - # - # # Call the list_clone_jobs method. - # result = client.list_clone_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::VMMigration::V1::CloneJob. - # p item - # end - # - def list_clone_jobs request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::ListCloneJobsRequest - - # Converts hash 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_clone_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::VMMigration::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_clone_jobs.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_clone_jobs.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vm_migration_stub.list_clone_jobs request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @vm_migration_stub, :list_clone_jobs, "clone_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 - - ## - # Gets details of a single CloneJob. - # - # @overload get_clone_job(request, options = nil) - # Pass arguments to `get_clone_job` via a request object, either of type - # {::Google::Cloud::VMMigration::V1::GetCloneJobRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VMMigration::V1::GetCloneJobRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_clone_job(name: nil) - # Pass arguments to `get_clone_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 name of the CloneJob. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::VMMigration::V1::CloneJob] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::VMMigration::V1::CloneJob] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/vm_migration/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VMMigration::V1::GetCloneJobRequest.new - # - # # Call the get_clone_job method. - # result = client.get_clone_job request - # - # # The returned object is of type Google::Cloud::VMMigration::V1::CloneJob. - # p result - # - def get_clone_job request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::GetCloneJobRequest - - # Converts hash 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_clone_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::VMMigration::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_clone_job.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_clone_job.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vm_migration_stub.get_clone_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 - - ## - # Initiates a Cutover of a specific migrating VM. - # The returned LRO is completed when the cutover job resource is created - # and the job is initiated. - # - # @overload create_cutover_job(request, options = nil) - # Pass arguments to `create_cutover_job` via a request object, either of type - # {::Google::Cloud::VMMigration::V1::CreateCutoverJobRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VMMigration::V1::CreateCutoverJobRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_cutover_job(parent: nil, cutover_job_id: nil, cutover_job: nil, request_id: nil) - # Pass arguments to `create_cutover_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 Cutover's parent. - # @param cutover_job_id [::String] - # Required. The cutover job identifier. - # @param cutover_job [::Google::Cloud::VMMigration::V1::CutoverJob, ::Hash] - # Required. The cutover request body. - # @param request_id [::String] - # A request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server will guarantee - # that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @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/vm_migration/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VMMigration::V1::CreateCutoverJobRequest.new - # - # # Call the create_cutover_job method. - # result = client.create_cutover_job 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_cutover_job request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::CreateCutoverJobRequest - - # Converts hash 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_cutover_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::VMMigration::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_cutover_job.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_cutover_job.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vm_migration_stub.create_cutover_job 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 - - ## - # Initiates the cancellation of a running cutover job. - # - # @overload cancel_cutover_job(request, options = nil) - # Pass arguments to `cancel_cutover_job` via a request object, either of type - # {::Google::Cloud::VMMigration::V1::CancelCutoverJobRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VMMigration::V1::CancelCutoverJobRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_cutover_job(name: nil) - # Pass arguments to `cancel_cutover_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 cutover job id - # @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/vm_migration/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VMMigration::V1::CancelCutoverJobRequest.new - # - # # Call the cancel_cutover_job method. - # result = client.cancel_cutover_job 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 cancel_cutover_job request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::CancelCutoverJobRequest - - # Converts hash 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_cutover_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::VMMigration::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_cutover_job.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.cancel_cutover_job.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vm_migration_stub.cancel_cutover_job 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 - - ## - # Lists the CutoverJobs of a migrating VM. Only 25 most recent CutoverJobs - # are listed. - # - # @overload list_cutover_jobs(request, options = nil) - # Pass arguments to `list_cutover_jobs` via a request object, either of type - # {::Google::Cloud::VMMigration::V1::ListCutoverJobsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VMMigration::V1::ListCutoverJobsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_cutover_jobs(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) - # Pass arguments to `list_cutover_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 parent, which owns this collection of migrating VMs. - # @param page_size [::Integer] - # Optional. The maximum number of cutover jobs to return. The service may - # return fewer than this value. If unspecified, at most 500 cutover jobs will - # be returned. The maximum value is 1000; values above 1000 will be coerced - # to 1000. - # @param page_token [::String] - # Required. A page token, received from a previous `ListCutoverJobs` call. - # Provide this to retrieve the subsequent page. - # - # When paginating, all other parameters provided to `ListCutoverJobs` must - # match the call that provided the page token. - # @param filter [::String] - # Optional. The filter request. - # @param order_by [::String] - # Optional. the order by fields for the result. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::VMMigration::V1::CutoverJob>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::VMMigration::V1::CutoverJob>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/vm_migration/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VMMigration::V1::ListCutoverJobsRequest.new - # - # # Call the list_cutover_jobs method. - # result = client.list_cutover_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::VMMigration::V1::CutoverJob. - # p item - # end - # - def list_cutover_jobs request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::ListCutoverJobsRequest - - # Converts hash 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_cutover_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::VMMigration::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_cutover_jobs.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_cutover_jobs.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vm_migration_stub.list_cutover_jobs request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @vm_migration_stub, :list_cutover_jobs, "cutover_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 - - ## - # Gets details of a single CutoverJob. - # - # @overload get_cutover_job(request, options = nil) - # Pass arguments to `get_cutover_job` via a request object, either of type - # {::Google::Cloud::VMMigration::V1::GetCutoverJobRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VMMigration::V1::GetCutoverJobRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_cutover_job(name: nil) - # Pass arguments to `get_cutover_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 name of the CutoverJob. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::VMMigration::V1::CutoverJob] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::VMMigration::V1::CutoverJob] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/vm_migration/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VMMigration::V1::GetCutoverJobRequest.new - # - # # Call the get_cutover_job method. - # result = client.get_cutover_job request - # - # # The returned object is of type Google::Cloud::VMMigration::V1::CutoverJob. - # p result - # - def get_cutover_job request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::GetCutoverJobRequest - - # Converts hash 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_cutover_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::VMMigration::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_cutover_job.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_cutover_job.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vm_migration_stub.get_cutover_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 - - ## - # Lists Groups in a given project and location. - # - # @overload list_groups(request, options = nil) - # Pass arguments to `list_groups` via a request object, either of type - # {::Google::Cloud::VMMigration::V1::ListGroupsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VMMigration::V1::ListGroupsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_groups(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) - # Pass arguments to `list_groups` via keyword arguments. Note that at - # least one keyword argument is 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 parent, which owns this collection of groups. - # @param page_size [::Integer] - # Optional. The maximum number of groups to return. The service may return - # fewer than this value. If unspecified, at most 500 groups will be - # returned. The maximum value is 1000; values above 1000 will be coerced to - # 1000. - # @param page_token [::String] - # Required. A page token, received from a previous `ListGroups` call. - # Provide this to retrieve the subsequent page. - # - # When paginating, all other parameters provided to `ListGroups` must - # match the call that provided the page token. - # @param filter [::String] - # Optional. The filter request. - # @param order_by [::String] - # Optional. the order by fields for the result. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::VMMigration::V1::Group>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::VMMigration::V1::Group>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/vm_migration/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VMMigration::V1::ListGroupsRequest.new - # - # # Call the list_groups method. - # result = client.list_groups 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::VMMigration::V1::Group. - # p item - # end - # - def list_groups request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::ListGroupsRequest - - # Converts hash 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_groups.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::VMMigration::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_groups.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_groups.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vm_migration_stub.list_groups request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @vm_migration_stub, :list_groups, "groups", 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 details of a single Group. - # - # @overload get_group(request, options = nil) - # Pass arguments to `get_group` via a request object, either of type - # {::Google::Cloud::VMMigration::V1::GetGroupRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VMMigration::V1::GetGroupRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_group(name: nil) - # Pass arguments to `get_group` via keyword arguments. Note that at - # least one keyword argument is 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 group name. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::VMMigration::V1::Group] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::VMMigration::V1::Group] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/vm_migration/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VMMigration::V1::GetGroupRequest.new - # - # # Call the get_group method. - # result = client.get_group request - # - # # The returned object is of type Google::Cloud::VMMigration::V1::Group. - # p result - # - def get_group request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::GetGroupRequest - - # Converts hash 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_group.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::VMMigration::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_group.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_group.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vm_migration_stub.get_group 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 Group in a given project and location. - # - # @overload create_group(request, options = nil) - # Pass arguments to `create_group` via a request object, either of type - # {::Google::Cloud::VMMigration::V1::CreateGroupRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VMMigration::V1::CreateGroupRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_group(parent: nil, group_id: nil, group: nil, request_id: nil) - # Pass arguments to `create_group` via keyword arguments. Note that at - # least one keyword argument is 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 Group's parent. - # @param group_id [::String] - # Required. The group identifier. - # @param group [::Google::Cloud::VMMigration::V1::Group, ::Hash] - # Required. The create request body. - # @param request_id [::String] - # A request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server will guarantee - # that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @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/vm_migration/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VMMigration::V1::CreateGroupRequest.new - # - # # Call the create_group method. - # result = client.create_group 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_group request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::CreateGroupRequest - - # Converts hash 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_group.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::VMMigration::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_group.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_group.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vm_migration_stub.create_group 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 - - ## - # Updates the parameters of a single Group. - # - # @overload update_group(request, options = nil) - # Pass arguments to `update_group` via a request object, either of type - # {::Google::Cloud::VMMigration::V1::UpdateGroupRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VMMigration::V1::UpdateGroupRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_group(update_mask: nil, group: nil, request_id: nil) - # Pass arguments to `update_group` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Field mask is used to specify the fields to be overwritten in the - # Group resource by the update. - # The fields specified in the update_mask are relative to the resource, not - # the full request. A field will be overwritten if it is in the mask. If the - # user does not provide a mask then all fields will be overwritten. - # @param group [::Google::Cloud::VMMigration::V1::Group, ::Hash] - # Required. The update request body. - # @param request_id [::String] - # A request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server will guarantee - # that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @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/vm_migration/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VMMigration::V1::UpdateGroupRequest.new - # - # # Call the update_group method. - # result = client.update_group 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 update_group request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::UpdateGroupRequest - - # Converts hash 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_group.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::VMMigration::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_group.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_group.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vm_migration_stub.update_group 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 single Group. - # - # @overload delete_group(request, options = nil) - # Pass arguments to `delete_group` via a request object, either of type - # {::Google::Cloud::VMMigration::V1::DeleteGroupRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VMMigration::V1::DeleteGroupRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_group(name: nil, request_id: nil) - # Pass arguments to `delete_group` via keyword arguments. Note that at - # least one keyword argument is 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 Group name. - # @param request_id [::String] - # Optional. A request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server will guarantee - # that for at least 60 minutes after the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @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/vm_migration/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VMMigration::V1::DeleteGroupRequest.new - # - # # Call the delete_group method. - # result = client.delete_group 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_group request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::DeleteGroupRequest - - # Converts hash 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_group.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::VMMigration::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_group.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_group.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vm_migration_stub.delete_group 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 - - ## - # Adds a MigratingVm to a Group. - # - # @overload add_group_migration(request, options = nil) - # Pass arguments to `add_group_migration` via a request object, either of type - # {::Google::Cloud::VMMigration::V1::AddGroupMigrationRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VMMigration::V1::AddGroupMigrationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload add_group_migration(group: nil, migrating_vm: nil) - # Pass arguments to `add_group_migration` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param group [::String] - # Required. The full path name of the Group to add to. - # @param migrating_vm [::String] - # The full path name of the MigratingVm to add. - # @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/vm_migration/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VMMigration::V1::AddGroupMigrationRequest.new - # - # # Call the add_group_migration method. - # result = client.add_group_migration 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 add_group_migration request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::AddGroupMigrationRequest - - # Converts hash 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.add_group_migration.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::VMMigration::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.add_group_migration.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.add_group_migration.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vm_migration_stub.add_group_migration 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 - - ## - # Removes a MigratingVm from a Group. - # - # @overload remove_group_migration(request, options = nil) - # Pass arguments to `remove_group_migration` via a request object, either of type - # {::Google::Cloud::VMMigration::V1::RemoveGroupMigrationRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VMMigration::V1::RemoveGroupMigrationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload remove_group_migration(group: nil, migrating_vm: nil) - # Pass arguments to `remove_group_migration` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param group [::String] - # Required. The name of the Group. - # @param migrating_vm [::String] - # The MigratingVm to remove. - # @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/vm_migration/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VMMigration::V1::RemoveGroupMigrationRequest.new - # - # # Call the remove_group_migration method. - # result = client.remove_group_migration 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 remove_group_migration request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::RemoveGroupMigrationRequest - - # Converts hash 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.remove_group_migration.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::VMMigration::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.remove_group_migration.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.remove_group_migration.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vm_migration_stub.remove_group_migration 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 - - ## - # Lists TargetProjects in a given project. - # - # NOTE: TargetProject is a global resource; hence the only supported value - # for location is `global`. - # - # @overload list_target_projects(request, options = nil) - # Pass arguments to `list_target_projects` via a request object, either of type - # {::Google::Cloud::VMMigration::V1::ListTargetProjectsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VMMigration::V1::ListTargetProjectsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_target_projects(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) - # Pass arguments to `list_target_projects` via keyword arguments. Note that at - # least one keyword argument is 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 parent, which owns this collection of targets. - # @param page_size [::Integer] - # Optional. The maximum number of targets to return. The service may return - # fewer than this value. If unspecified, at most 500 targets will be - # returned. The maximum value is 1000; values above 1000 will be coerced to - # 1000. - # @param page_token [::String] - # Required. A page token, received from a previous `ListTargets` call. - # Provide this to retrieve the subsequent page. - # - # When paginating, all other parameters provided to `ListTargets` must - # match the call that provided the page token. - # @param filter [::String] - # Optional. The filter request. - # @param order_by [::String] - # Optional. the order by fields for the result. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::VMMigration::V1::TargetProject>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::VMMigration::V1::TargetProject>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/vm_migration/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VMMigration::V1::ListTargetProjectsRequest.new - # - # # Call the list_target_projects method. - # result = client.list_target_projects 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::VMMigration::V1::TargetProject. - # p item - # end - # - def list_target_projects request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::ListTargetProjectsRequest - - # Converts hash 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_target_projects.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::VMMigration::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_target_projects.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_target_projects.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vm_migration_stub.list_target_projects request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @vm_migration_stub, :list_target_projects, "target_projects", 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 details of a single TargetProject. - # - # NOTE: TargetProject is a global resource; hence the only supported value - # for location is `global`. - # - # @overload get_target_project(request, options = nil) - # Pass arguments to `get_target_project` via a request object, either of type - # {::Google::Cloud::VMMigration::V1::GetTargetProjectRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VMMigration::V1::GetTargetProjectRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_target_project(name: nil) - # Pass arguments to `get_target_project` via keyword arguments. Note that at - # least one keyword argument is 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 TargetProject name. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::VMMigration::V1::TargetProject] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::VMMigration::V1::TargetProject] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/vm_migration/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VMMigration::V1::GetTargetProjectRequest.new - # - # # Call the get_target_project method. - # result = client.get_target_project request - # - # # The returned object is of type Google::Cloud::VMMigration::V1::TargetProject. - # p result - # - def get_target_project request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::GetTargetProjectRequest - - # Converts hash 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_target_project.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::VMMigration::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_target_project.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_target_project.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vm_migration_stub.get_target_project 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 TargetProject in a given project. - # - # NOTE: TargetProject is a global resource; hence the only supported value - # for location is `global`. - # - # @overload create_target_project(request, options = nil) - # Pass arguments to `create_target_project` via a request object, either of type - # {::Google::Cloud::VMMigration::V1::CreateTargetProjectRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VMMigration::V1::CreateTargetProjectRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_target_project(parent: nil, target_project_id: nil, target_project: nil, request_id: nil) - # Pass arguments to `create_target_project` via keyword arguments. Note that at - # least one keyword argument is 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 TargetProject's parent. - # @param target_project_id [::String] - # Required. The target_project identifier. - # @param target_project [::Google::Cloud::VMMigration::V1::TargetProject, ::Hash] - # Required. The create request body. - # @param request_id [::String] - # A request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server will guarantee - # that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @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/vm_migration/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VMMigration::V1::CreateTargetProjectRequest.new - # - # # Call the create_target_project method. - # result = client.create_target_project 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_target_project request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::CreateTargetProjectRequest - - # Converts hash 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_target_project.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::VMMigration::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_target_project.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_target_project.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vm_migration_stub.create_target_project 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 - - ## - # Updates the parameters of a single TargetProject. - # - # NOTE: TargetProject is a global resource; hence the only supported value - # for location is `global`. - # - # @overload update_target_project(request, options = nil) - # Pass arguments to `update_target_project` via a request object, either of type - # {::Google::Cloud::VMMigration::V1::UpdateTargetProjectRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VMMigration::V1::UpdateTargetProjectRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_target_project(update_mask: nil, target_project: nil, request_id: nil) - # Pass arguments to `update_target_project` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Field mask is used to specify the fields to be overwritten in the - # TargetProject resource by the update. - # The fields specified in the update_mask are relative to the resource, not - # the full request. A field will be overwritten if it is in the mask. If the - # user does not provide a mask then all fields will be overwritten. - # @param target_project [::Google::Cloud::VMMigration::V1::TargetProject, ::Hash] - # Required. The update request body. - # @param request_id [::String] - # A request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server will guarantee - # that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @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/vm_migration/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VMMigration::V1::UpdateTargetProjectRequest.new - # - # # Call the update_target_project method. - # result = client.update_target_project 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 update_target_project request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::UpdateTargetProjectRequest - - # Converts hash 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_target_project.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::VMMigration::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_target_project.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_target_project.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vm_migration_stub.update_target_project 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 single TargetProject. - # - # NOTE: TargetProject is a global resource; hence the only supported value - # for location is `global`. - # - # @overload delete_target_project(request, options = nil) - # Pass arguments to `delete_target_project` via a request object, either of type - # {::Google::Cloud::VMMigration::V1::DeleteTargetProjectRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VMMigration::V1::DeleteTargetProjectRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_target_project(name: nil, request_id: nil) - # Pass arguments to `delete_target_project` via keyword arguments. Note that at - # least one keyword argument is 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 TargetProject name. - # @param request_id [::String] - # Optional. A request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server will guarantee - # that for at least 60 minutes after the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @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/vm_migration/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VMMigration::V1::DeleteTargetProjectRequest.new - # - # # Call the delete_target_project method. - # result = client.delete_target_project 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_target_project request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::DeleteTargetProjectRequest - - # Converts hash 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_target_project.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::VMMigration::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_target_project.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_target_project.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vm_migration_stub.delete_target_project 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 - - ## - # Lists ReplicationCycles in a given MigratingVM. - # - # @overload list_replication_cycles(request, options = nil) - # Pass arguments to `list_replication_cycles` via a request object, either of type - # {::Google::Cloud::VMMigration::V1::ListReplicationCyclesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VMMigration::V1::ListReplicationCyclesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_replication_cycles(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) - # Pass arguments to `list_replication_cycles` via keyword arguments. Note that at - # least one keyword argument is 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 parent, which owns this collection of ReplicationCycles. - # @param page_size [::Integer] - # Optional. The maximum number of replication cycles to return. The service - # may return fewer than this value. If unspecified, at most 100 migrating VMs - # will be returned. The maximum value is 100; values above 100 will be - # coerced to 100. - # @param page_token [::String] - # Required. A page token, received from a previous `ListReplicationCycles` - # call. Provide this to retrieve the subsequent page. - # - # When paginating, all other parameters provided to `ListReplicationCycles` - # must match the call that provided the page token. - # @param filter [::String] - # Optional. The filter request. - # @param order_by [::String] - # Optional. the order by fields for the result. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::VMMigration::V1::ReplicationCycle>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::VMMigration::V1::ReplicationCycle>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/vm_migration/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VMMigration::V1::ListReplicationCyclesRequest.new - # - # # Call the list_replication_cycles method. - # result = client.list_replication_cycles 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::VMMigration::V1::ReplicationCycle. - # p item - # end - # - def list_replication_cycles request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::ListReplicationCyclesRequest - - # Converts hash 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_replication_cycles.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::VMMigration::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_replication_cycles.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_replication_cycles.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vm_migration_stub.list_replication_cycles request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @vm_migration_stub, :list_replication_cycles, "replication_cycles", 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 details of a single ReplicationCycle. - # - # @overload get_replication_cycle(request, options = nil) - # Pass arguments to `get_replication_cycle` via a request object, either of type - # {::Google::Cloud::VMMigration::V1::GetReplicationCycleRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VMMigration::V1::GetReplicationCycleRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_replication_cycle(name: nil) - # Pass arguments to `get_replication_cycle` via keyword arguments. Note that at - # least one keyword argument is 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 name of the ReplicationCycle. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::VMMigration::V1::ReplicationCycle] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::VMMigration::V1::ReplicationCycle] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/vm_migration/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VMMigration::V1::GetReplicationCycleRequest.new - # - # # Call the get_replication_cycle method. - # result = client.get_replication_cycle request - # - # # The returned object is of type Google::Cloud::VMMigration::V1::ReplicationCycle. - # p result - # - def get_replication_cycle request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::GetReplicationCycleRequest - - # Converts hash 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_replication_cycle.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::VMMigration::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_replication_cycle.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_replication_cycle.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vm_migration_stub.get_replication_cycle 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 ImageImports in a given project. - # - # @overload list_image_imports(request, options = nil) - # Pass arguments to `list_image_imports` via a request object, either of type - # {::Google::Cloud::VMMigration::V1::ListImageImportsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VMMigration::V1::ListImageImportsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_image_imports(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) - # Pass arguments to `list_image_imports` via keyword arguments. Note that at - # least one keyword argument is 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 parent, which owns this collection of targets. - # @param page_size [::Integer] - # Optional. The maximum number of targets to return. The service may return - # fewer than this value. If unspecified, at most 500 targets will be - # returned. The maximum value is 1000; values above 1000 will be coerced to - # 1000. - # @param page_token [::String] - # Optional. A page token, received from a previous `ListImageImports` call. - # Provide this to retrieve the subsequent page. - # - # When paginating, all other parameters provided to `ListImageImports` must - # match the call that provided the page token. - # @param filter [::String] - # Optional. The filter request (according to AIP-160). - # @param order_by [::String] - # Optional. The order by fields for the result (according to AIP-132). - # Currently ordering is only possible by "name" field. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::VMMigration::V1::ImageImport>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::VMMigration::V1::ImageImport>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/vm_migration/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VMMigration::V1::ListImageImportsRequest.new - # - # # Call the list_image_imports method. - # result = client.list_image_imports 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::VMMigration::V1::ImageImport. - # p item - # end - # - def list_image_imports request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::ListImageImportsRequest - - # Converts hash 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_image_imports.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::VMMigration::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_image_imports.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_image_imports.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vm_migration_stub.list_image_imports request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @vm_migration_stub, :list_image_imports, "image_imports", 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 details of a single ImageImport. - # - # @overload get_image_import(request, options = nil) - # Pass arguments to `get_image_import` via a request object, either of type - # {::Google::Cloud::VMMigration::V1::GetImageImportRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VMMigration::V1::GetImageImportRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_image_import(name: nil) - # Pass arguments to `get_image_import` via keyword arguments. Note that at - # least one keyword argument is 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 ImageImport name. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::VMMigration::V1::ImageImport] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::VMMigration::V1::ImageImport] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/vm_migration/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VMMigration::V1::GetImageImportRequest.new - # - # # Call the get_image_import method. - # result = client.get_image_import request - # - # # The returned object is of type Google::Cloud::VMMigration::V1::ImageImport. - # p result - # - def get_image_import request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::GetImageImportRequest - - # Converts hash 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_image_import.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::VMMigration::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_image_import.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_image_import.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vm_migration_stub.get_image_import 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 ImageImport in a given project. - # - # @overload create_image_import(request, options = nil) - # Pass arguments to `create_image_import` via a request object, either of type - # {::Google::Cloud::VMMigration::V1::CreateImageImportRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VMMigration::V1::CreateImageImportRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_image_import(parent: nil, image_import_id: nil, image_import: nil, request_id: nil) - # Pass arguments to `create_image_import` via keyword arguments. Note that at - # least one keyword argument is 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 ImageImport's parent. - # @param image_import_id [::String] - # Required. The image import identifier. - # This value maximum length is 63 characters, and valid characters are - # /[a-z][0-9]-/. It must start with an english letter and must not end with a - # hyphen. - # @param image_import [::Google::Cloud::VMMigration::V1::ImageImport, ::Hash] - # Required. The create request body. - # @param request_id [::String] - # Optional. A request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server will guarantee - # that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @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/vm_migration/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VMMigration::V1::CreateImageImportRequest.new - # - # # Call the create_image_import method. - # result = client.create_image_import 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_image_import request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::CreateImageImportRequest - - # Converts hash 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_image_import.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::VMMigration::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_image_import.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_image_import.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vm_migration_stub.create_image_import 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 single ImageImport. - # - # @overload delete_image_import(request, options = nil) - # Pass arguments to `delete_image_import` via a request object, either of type - # {::Google::Cloud::VMMigration::V1::DeleteImageImportRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VMMigration::V1::DeleteImageImportRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_image_import(name: nil, request_id: nil) - # Pass arguments to `delete_image_import` via keyword arguments. Note that at - # least one keyword argument is 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 ImageImport name. - # @param request_id [::String] - # Optional. A request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server will guarantee - # that for at least 60 minutes after the first request. - # - # For example, consider a situation where you make an initial request and t - # he request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @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/vm_migration/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VMMigration::V1::DeleteImageImportRequest.new - # - # # Call the delete_image_import method. - # result = client.delete_image_import 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_image_import request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::DeleteImageImportRequest - - # Converts hash 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_image_import.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::VMMigration::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_image_import.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_image_import.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vm_migration_stub.delete_image_import 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 - - ## - # Lists ImageImportJobs in a given project. - # - # @overload list_image_import_jobs(request, options = nil) - # Pass arguments to `list_image_import_jobs` via a request object, either of type - # {::Google::Cloud::VMMigration::V1::ListImageImportJobsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VMMigration::V1::ListImageImportJobsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_image_import_jobs(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) - # Pass arguments to `list_image_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 parent, which owns this collection of targets. - # @param page_size [::Integer] - # Optional. The maximum number of targets to return. The service may return - # fewer than this value. If unspecified, at most 500 targets will be - # returned. The maximum value is 1000; values above 1000 will be coerced to - # 1000. - # @param page_token [::String] - # Optional. A page token, received from a previous `ListImageImportJobs` - # call. Provide this to retrieve the subsequent page. - # - # When paginating, all other parameters provided to `ListImageImportJobs` - # must match the call that provided the page token. - # @param filter [::String] - # Optional. The filter request (according to AIP-160). - # @param order_by [::String] - # Optional. The order by fields for the result (according to AIP-132). - # Currently ordering is only possible by "name" field. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::VMMigration::V1::ImageImportJob>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::VMMigration::V1::ImageImportJob>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/vm_migration/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VMMigration::V1::ListImageImportJobsRequest.new - # - # # Call the list_image_import_jobs method. - # result = client.list_image_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::VMMigration::V1::ImageImportJob. - # p item - # end - # - def list_image_import_jobs request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::ListImageImportJobsRequest - - # Converts hash 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_image_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::VMMigration::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_image_import_jobs.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_image_import_jobs.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vm_migration_stub.list_image_import_jobs request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @vm_migration_stub, :list_image_import_jobs, "image_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 - - ## - # Gets details of a single ImageImportJob. - # - # @overload get_image_import_job(request, options = nil) - # Pass arguments to `get_image_import_job` via a request object, either of type - # {::Google::Cloud::VMMigration::V1::GetImageImportJobRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VMMigration::V1::GetImageImportJobRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_image_import_job(name: nil) - # Pass arguments to `get_image_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 ImageImportJob name. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::VMMigration::V1::ImageImportJob] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::VMMigration::V1::ImageImportJob] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/vm_migration/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VMMigration::V1::GetImageImportJobRequest.new - # - # # Call the get_image_import_job method. - # result = client.get_image_import_job request - # - # # The returned object is of type Google::Cloud::VMMigration::V1::ImageImportJob. - # p result - # - def get_image_import_job request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::GetImageImportJobRequest - - # Converts hash 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_image_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::VMMigration::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_image_import_job.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_image_import_job.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vm_migration_stub.get_image_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 - - ## - # Initiates the cancellation of a running ImageImportJob. - # - # @overload cancel_image_import_job(request, options = nil) - # Pass arguments to `cancel_image_import_job` via a request object, either of type - # {::Google::Cloud::VMMigration::V1::CancelImageImportJobRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VMMigration::V1::CancelImageImportJobRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_image_import_job(name: nil) - # Pass arguments to `cancel_image_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 image import job id. - # @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/vm_migration/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VMMigration::V1::CancelImageImportJobRequest.new - # - # # Call the cancel_image_import_job method. - # result = client.cancel_image_import_job 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 cancel_image_import_job request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::CancelImageImportJobRequest - - # Converts hash 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_image_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::VMMigration::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_image_import_job.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.cancel_image_import_job.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vm_migration_stub.cancel_image_import_job 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 disk migration job in a given Source. - # - # @overload create_disk_migration_job(request, options = nil) - # Pass arguments to `create_disk_migration_job` via a request object, either of type - # {::Google::Cloud::VMMigration::V1::CreateDiskMigrationJobRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VMMigration::V1::CreateDiskMigrationJobRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_disk_migration_job(parent: nil, disk_migration_job_id: nil, disk_migration_job: nil, request_id: nil) - # Pass arguments to `create_disk_migration_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 DiskMigrationJob's parent. - # @param disk_migration_job_id [::String] - # Required. The DiskMigrationJob identifier. - # The maximum length of this value is 63 characters. - # Valid characters are lower case Latin letters, digits and hyphen. - # It must start with a Latin letter and must not end with a hyphen. - # @param disk_migration_job [::Google::Cloud::VMMigration::V1::DiskMigrationJob, ::Hash] - # Required. The create request body. - # @param request_id [::String] - # Optional. A request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server will guarantee - # that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and - # the request timed out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @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/vm_migration/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VMMigration::V1::CreateDiskMigrationJobRequest.new - # - # # Call the create_disk_migration_job method. - # result = client.create_disk_migration_job 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_disk_migration_job request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::CreateDiskMigrationJobRequest - - # Converts hash 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_disk_migration_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::VMMigration::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_disk_migration_job.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_disk_migration_job.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vm_migration_stub.create_disk_migration_job 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 - - ## - # Lists DiskMigrationJobs in a given Source. - # - # @overload list_disk_migration_jobs(request, options = nil) - # Pass arguments to `list_disk_migration_jobs` via a request object, either of type - # {::Google::Cloud::VMMigration::V1::ListDiskMigrationJobsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VMMigration::V1::ListDiskMigrationJobsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_disk_migration_jobs(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) - # Pass arguments to `list_disk_migration_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 parent, which owns this collection of DiskMigrationJobs. - # @param page_size [::Integer] - # Optional. The maximum number of disk migration jobs to return. The service - # may return fewer than this value. If unspecified, at most 500 - # disk migration jobs will be returned. - # The maximum value is 1000; values above 1000 will be coerced to 1000. - # @param page_token [::String] - # Optional. A page token, received from a previous `ListDiskMigrationJobs` - # call. Provide this to retrieve the subsequent page. - # - # When paginating, all parameters provided to `ListDiskMigrationJobs` - # except `page_size` must match the call that provided the page token. - # @param filter [::String] - # Optional. The filter request (according to AIP-160). - # @param order_by [::String] - # Optional. Ordering of the result list. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::VMMigration::V1::DiskMigrationJob>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::VMMigration::V1::DiskMigrationJob>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/vm_migration/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VMMigration::V1::ListDiskMigrationJobsRequest.new - # - # # Call the list_disk_migration_jobs method. - # result = client.list_disk_migration_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::VMMigration::V1::DiskMigrationJob. - # p item - # end - # - def list_disk_migration_jobs request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::ListDiskMigrationJobsRequest - - # Converts hash 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_disk_migration_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::VMMigration::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_disk_migration_jobs.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_disk_migration_jobs.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vm_migration_stub.list_disk_migration_jobs request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @vm_migration_stub, :list_disk_migration_jobs, "disk_migration_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 - - ## - # Gets details of a single DiskMigrationJob. - # - # @overload get_disk_migration_job(request, options = nil) - # Pass arguments to `get_disk_migration_job` via a request object, either of type - # {::Google::Cloud::VMMigration::V1::GetDiskMigrationJobRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VMMigration::V1::GetDiskMigrationJobRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_disk_migration_job(name: nil) - # Pass arguments to `get_disk_migration_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 name of the DiskMigrationJob. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::VMMigration::V1::DiskMigrationJob] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::VMMigration::V1::DiskMigrationJob] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/vm_migration/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VMMigration::V1::GetDiskMigrationJobRequest.new - # - # # Call the get_disk_migration_job method. - # result = client.get_disk_migration_job request - # - # # The returned object is of type Google::Cloud::VMMigration::V1::DiskMigrationJob. - # p result - # - def get_disk_migration_job request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::GetDiskMigrationJobRequest - - # Converts hash 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_disk_migration_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::VMMigration::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_disk_migration_job.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_disk_migration_job.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vm_migration_stub.get_disk_migration_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 - - ## - # Updates the parameters of a single DiskMigrationJob. - # - # @overload update_disk_migration_job(request, options = nil) - # Pass arguments to `update_disk_migration_job` via a request object, either of type - # {::Google::Cloud::VMMigration::V1::UpdateDiskMigrationJobRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VMMigration::V1::UpdateDiskMigrationJobRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_disk_migration_job(update_mask: nil, disk_migration_job: nil, request_id: nil) - # Pass arguments to `update_disk_migration_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 update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Optional. Field mask is used to specify the fields to be overwritten in the - # DiskMigrationJob resource by the update. - # The fields specified in the update_mask are relative to the resource, not - # the full request. A field will be overwritten if it is in the mask. If the - # user does not provide a mask, then a mask equivalent to all fields that are - # populated (have a non-empty value), will be implied. - # @param disk_migration_job [::Google::Cloud::VMMigration::V1::DiskMigrationJob, ::Hash] - # Required. The update request body. - # @param request_id [::String] - # Optional. A request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server will guarantee - # that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and - # the request timed out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @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/vm_migration/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VMMigration::V1::UpdateDiskMigrationJobRequest.new - # - # # Call the update_disk_migration_job method. - # result = client.update_disk_migration_job 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 update_disk_migration_job request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::UpdateDiskMigrationJobRequest - - # Converts hash 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_disk_migration_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::VMMigration::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_disk_migration_job.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_disk_migration_job.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vm_migration_stub.update_disk_migration_job 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 single DiskMigrationJob. - # - # @overload delete_disk_migration_job(request, options = nil) - # Pass arguments to `delete_disk_migration_job` via a request object, either of type - # {::Google::Cloud::VMMigration::V1::DeleteDiskMigrationJobRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VMMigration::V1::DeleteDiskMigrationJobRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_disk_migration_job(name: nil) - # Pass arguments to `delete_disk_migration_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 name of the DiskMigrationJob. - # @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/vm_migration/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VMMigration::V1::DeleteDiskMigrationJobRequest.new - # - # # Call the delete_disk_migration_job method. - # result = client.delete_disk_migration_job 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_disk_migration_job request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::DeleteDiskMigrationJobRequest - - # Converts hash 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_disk_migration_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::VMMigration::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_disk_migration_job.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_disk_migration_job.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vm_migration_stub.delete_disk_migration_job 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 - - ## - # Runs the disk migration job. - # - # @overload run_disk_migration_job(request, options = nil) - # Pass arguments to `run_disk_migration_job` via a request object, either of type - # {::Google::Cloud::VMMigration::V1::RunDiskMigrationJobRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VMMigration::V1::RunDiskMigrationJobRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload run_disk_migration_job(name: nil) - # Pass arguments to `run_disk_migration_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 name of the DiskMigrationJob. - # @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/vm_migration/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VMMigration::V1::RunDiskMigrationJobRequest.new - # - # # Call the run_disk_migration_job method. - # result = client.run_disk_migration_job 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 run_disk_migration_job request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::RunDiskMigrationJobRequest - - # Converts hash 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.run_disk_migration_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::VMMigration::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.run_disk_migration_job.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.run_disk_migration_job.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vm_migration_stub.run_disk_migration_job 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 - - ## - # Cancels the disk migration job. - # - # @overload cancel_disk_migration_job(request, options = nil) - # Pass arguments to `cancel_disk_migration_job` via a request object, either of type - # {::Google::Cloud::VMMigration::V1::CancelDiskMigrationJobRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VMMigration::V1::CancelDiskMigrationJobRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_disk_migration_job(name: nil) - # Pass arguments to `cancel_disk_migration_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 name of the DiskMigrationJob. - # @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/vm_migration/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VMMigration::V1::CancelDiskMigrationJobRequest.new - # - # # Call the cancel_disk_migration_job method. - # result = client.cancel_disk_migration_job 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 cancel_disk_migration_job request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VMMigration::V1::CancelDiskMigrationJobRequest - - # Converts hash 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_disk_migration_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::VMMigration::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_disk_migration_job.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.cancel_disk_migration_job.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vm_migration_stub.cancel_disk_migration_job 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 - - ## - # Configuration class for the VmMigration REST API. - # - # This class represents the configuration for VmMigration 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::VMMigration::V1::VMMigration::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_sources to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_sources.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_sources.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 = "vmmigration.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 VmMigration 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_sources` - # @return [::Gapic::Config::Method] - # - attr_reader :list_sources - ## - # RPC-specific configuration for `get_source` - # @return [::Gapic::Config::Method] - # - attr_reader :get_source - ## - # RPC-specific configuration for `create_source` - # @return [::Gapic::Config::Method] - # - attr_reader :create_source - ## - # RPC-specific configuration for `update_source` - # @return [::Gapic::Config::Method] - # - attr_reader :update_source - ## - # RPC-specific configuration for `delete_source` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_source - ## - # RPC-specific configuration for `fetch_inventory` - # @return [::Gapic::Config::Method] - # - attr_reader :fetch_inventory - ## - # RPC-specific configuration for `fetch_storage_inventory` - # @return [::Gapic::Config::Method] - # - attr_reader :fetch_storage_inventory - ## - # RPC-specific configuration for `list_utilization_reports` - # @return [::Gapic::Config::Method] - # - attr_reader :list_utilization_reports - ## - # RPC-specific configuration for `get_utilization_report` - # @return [::Gapic::Config::Method] - # - attr_reader :get_utilization_report - ## - # RPC-specific configuration for `create_utilization_report` - # @return [::Gapic::Config::Method] - # - attr_reader :create_utilization_report - ## - # RPC-specific configuration for `delete_utilization_report` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_utilization_report - ## - # RPC-specific configuration for `list_datacenter_connectors` - # @return [::Gapic::Config::Method] - # - attr_reader :list_datacenter_connectors - ## - # RPC-specific configuration for `get_datacenter_connector` - # @return [::Gapic::Config::Method] - # - attr_reader :get_datacenter_connector - ## - # RPC-specific configuration for `create_datacenter_connector` - # @return [::Gapic::Config::Method] - # - attr_reader :create_datacenter_connector - ## - # RPC-specific configuration for `delete_datacenter_connector` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_datacenter_connector - ## - # RPC-specific configuration for `upgrade_appliance` - # @return [::Gapic::Config::Method] - # - attr_reader :upgrade_appliance - ## - # RPC-specific configuration for `create_migrating_vm` - # @return [::Gapic::Config::Method] - # - attr_reader :create_migrating_vm - ## - # RPC-specific configuration for `list_migrating_vms` - # @return [::Gapic::Config::Method] - # - attr_reader :list_migrating_vms - ## - # RPC-specific configuration for `get_migrating_vm` - # @return [::Gapic::Config::Method] - # - attr_reader :get_migrating_vm - ## - # RPC-specific configuration for `update_migrating_vm` - # @return [::Gapic::Config::Method] - # - attr_reader :update_migrating_vm - ## - # RPC-specific configuration for `delete_migrating_vm` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_migrating_vm - ## - # RPC-specific configuration for `start_migration` - # @return [::Gapic::Config::Method] - # - attr_reader :start_migration - ## - # RPC-specific configuration for `resume_migration` - # @return [::Gapic::Config::Method] - # - attr_reader :resume_migration - ## - # RPC-specific configuration for `pause_migration` - # @return [::Gapic::Config::Method] - # - attr_reader :pause_migration - ## - # RPC-specific configuration for `finalize_migration` - # @return [::Gapic::Config::Method] - # - attr_reader :finalize_migration - ## - # RPC-specific configuration for `extend_migration` - # @return [::Gapic::Config::Method] - # - attr_reader :extend_migration - ## - # RPC-specific configuration for `create_clone_job` - # @return [::Gapic::Config::Method] - # - attr_reader :create_clone_job - ## - # RPC-specific configuration for `cancel_clone_job` - # @return [::Gapic::Config::Method] - # - attr_reader :cancel_clone_job - ## - # RPC-specific configuration for `list_clone_jobs` - # @return [::Gapic::Config::Method] - # - attr_reader :list_clone_jobs - ## - # RPC-specific configuration for `get_clone_job` - # @return [::Gapic::Config::Method] - # - attr_reader :get_clone_job - ## - # RPC-specific configuration for `create_cutover_job` - # @return [::Gapic::Config::Method] - # - attr_reader :create_cutover_job - ## - # RPC-specific configuration for `cancel_cutover_job` - # @return [::Gapic::Config::Method] - # - attr_reader :cancel_cutover_job - ## - # RPC-specific configuration for `list_cutover_jobs` - # @return [::Gapic::Config::Method] - # - attr_reader :list_cutover_jobs - ## - # RPC-specific configuration for `get_cutover_job` - # @return [::Gapic::Config::Method] - # - attr_reader :get_cutover_job - ## - # RPC-specific configuration for `list_groups` - # @return [::Gapic::Config::Method] - # - attr_reader :list_groups - ## - # RPC-specific configuration for `get_group` - # @return [::Gapic::Config::Method] - # - attr_reader :get_group - ## - # RPC-specific configuration for `create_group` - # @return [::Gapic::Config::Method] - # - attr_reader :create_group - ## - # RPC-specific configuration for `update_group` - # @return [::Gapic::Config::Method] - # - attr_reader :update_group - ## - # RPC-specific configuration for `delete_group` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_group - ## - # RPC-specific configuration for `add_group_migration` - # @return [::Gapic::Config::Method] - # - attr_reader :add_group_migration - ## - # RPC-specific configuration for `remove_group_migration` - # @return [::Gapic::Config::Method] - # - attr_reader :remove_group_migration - ## - # RPC-specific configuration for `list_target_projects` - # @return [::Gapic::Config::Method] - # - attr_reader :list_target_projects - ## - # RPC-specific configuration for `get_target_project` - # @return [::Gapic::Config::Method] - # - attr_reader :get_target_project - ## - # RPC-specific configuration for `create_target_project` - # @return [::Gapic::Config::Method] - # - attr_reader :create_target_project - ## - # RPC-specific configuration for `update_target_project` - # @return [::Gapic::Config::Method] - # - attr_reader :update_target_project - ## - # RPC-specific configuration for `delete_target_project` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_target_project - ## - # RPC-specific configuration for `list_replication_cycles` - # @return [::Gapic::Config::Method] - # - attr_reader :list_replication_cycles - ## - # RPC-specific configuration for `get_replication_cycle` - # @return [::Gapic::Config::Method] - # - attr_reader :get_replication_cycle - ## - # RPC-specific configuration for `list_image_imports` - # @return [::Gapic::Config::Method] - # - attr_reader :list_image_imports - ## - # RPC-specific configuration for `get_image_import` - # @return [::Gapic::Config::Method] - # - attr_reader :get_image_import - ## - # RPC-specific configuration for `create_image_import` - # @return [::Gapic::Config::Method] - # - attr_reader :create_image_import - ## - # RPC-specific configuration for `delete_image_import` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_image_import - ## - # RPC-specific configuration for `list_image_import_jobs` - # @return [::Gapic::Config::Method] - # - attr_reader :list_image_import_jobs - ## - # RPC-specific configuration for `get_image_import_job` - # @return [::Gapic::Config::Method] - # - attr_reader :get_image_import_job - ## - # RPC-specific configuration for `cancel_image_import_job` - # @return [::Gapic::Config::Method] - # - attr_reader :cancel_image_import_job - ## - # RPC-specific configuration for `create_disk_migration_job` - # @return [::Gapic::Config::Method] - # - attr_reader :create_disk_migration_job - ## - # RPC-specific configuration for `list_disk_migration_jobs` - # @return [::Gapic::Config::Method] - # - attr_reader :list_disk_migration_jobs - ## - # RPC-specific configuration for `get_disk_migration_job` - # @return [::Gapic::Config::Method] - # - attr_reader :get_disk_migration_job - ## - # RPC-specific configuration for `update_disk_migration_job` - # @return [::Gapic::Config::Method] - # - attr_reader :update_disk_migration_job - ## - # RPC-specific configuration for `delete_disk_migration_job` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_disk_migration_job - ## - # RPC-specific configuration for `run_disk_migration_job` - # @return [::Gapic::Config::Method] - # - attr_reader :run_disk_migration_job - ## - # RPC-specific configuration for `cancel_disk_migration_job` - # @return [::Gapic::Config::Method] - # - attr_reader :cancel_disk_migration_job - - # @private - def initialize parent_rpcs = nil - list_sources_config = parent_rpcs.list_sources if parent_rpcs.respond_to? :list_sources - @list_sources = ::Gapic::Config::Method.new list_sources_config - get_source_config = parent_rpcs.get_source if parent_rpcs.respond_to? :get_source - @get_source = ::Gapic::Config::Method.new get_source_config - create_source_config = parent_rpcs.create_source if parent_rpcs.respond_to? :create_source - @create_source = ::Gapic::Config::Method.new create_source_config - update_source_config = parent_rpcs.update_source if parent_rpcs.respond_to? :update_source - @update_source = ::Gapic::Config::Method.new update_source_config - delete_source_config = parent_rpcs.delete_source if parent_rpcs.respond_to? :delete_source - @delete_source = ::Gapic::Config::Method.new delete_source_config - fetch_inventory_config = parent_rpcs.fetch_inventory if parent_rpcs.respond_to? :fetch_inventory - @fetch_inventory = ::Gapic::Config::Method.new fetch_inventory_config - fetch_storage_inventory_config = parent_rpcs.fetch_storage_inventory if parent_rpcs.respond_to? :fetch_storage_inventory - @fetch_storage_inventory = ::Gapic::Config::Method.new fetch_storage_inventory_config - list_utilization_reports_config = parent_rpcs.list_utilization_reports if parent_rpcs.respond_to? :list_utilization_reports - @list_utilization_reports = ::Gapic::Config::Method.new list_utilization_reports_config - get_utilization_report_config = parent_rpcs.get_utilization_report if parent_rpcs.respond_to? :get_utilization_report - @get_utilization_report = ::Gapic::Config::Method.new get_utilization_report_config - create_utilization_report_config = parent_rpcs.create_utilization_report if parent_rpcs.respond_to? :create_utilization_report - @create_utilization_report = ::Gapic::Config::Method.new create_utilization_report_config - delete_utilization_report_config = parent_rpcs.delete_utilization_report if parent_rpcs.respond_to? :delete_utilization_report - @delete_utilization_report = ::Gapic::Config::Method.new delete_utilization_report_config - list_datacenter_connectors_config = parent_rpcs.list_datacenter_connectors if parent_rpcs.respond_to? :list_datacenter_connectors - @list_datacenter_connectors = ::Gapic::Config::Method.new list_datacenter_connectors_config - get_datacenter_connector_config = parent_rpcs.get_datacenter_connector if parent_rpcs.respond_to? :get_datacenter_connector - @get_datacenter_connector = ::Gapic::Config::Method.new get_datacenter_connector_config - create_datacenter_connector_config = parent_rpcs.create_datacenter_connector if parent_rpcs.respond_to? :create_datacenter_connector - @create_datacenter_connector = ::Gapic::Config::Method.new create_datacenter_connector_config - delete_datacenter_connector_config = parent_rpcs.delete_datacenter_connector if parent_rpcs.respond_to? :delete_datacenter_connector - @delete_datacenter_connector = ::Gapic::Config::Method.new delete_datacenter_connector_config - upgrade_appliance_config = parent_rpcs.upgrade_appliance if parent_rpcs.respond_to? :upgrade_appliance - @upgrade_appliance = ::Gapic::Config::Method.new upgrade_appliance_config - create_migrating_vm_config = parent_rpcs.create_migrating_vm if parent_rpcs.respond_to? :create_migrating_vm - @create_migrating_vm = ::Gapic::Config::Method.new create_migrating_vm_config - list_migrating_vms_config = parent_rpcs.list_migrating_vms if parent_rpcs.respond_to? :list_migrating_vms - @list_migrating_vms = ::Gapic::Config::Method.new list_migrating_vms_config - get_migrating_vm_config = parent_rpcs.get_migrating_vm if parent_rpcs.respond_to? :get_migrating_vm - @get_migrating_vm = ::Gapic::Config::Method.new get_migrating_vm_config - update_migrating_vm_config = parent_rpcs.update_migrating_vm if parent_rpcs.respond_to? :update_migrating_vm - @update_migrating_vm = ::Gapic::Config::Method.new update_migrating_vm_config - delete_migrating_vm_config = parent_rpcs.delete_migrating_vm if parent_rpcs.respond_to? :delete_migrating_vm - @delete_migrating_vm = ::Gapic::Config::Method.new delete_migrating_vm_config - start_migration_config = parent_rpcs.start_migration if parent_rpcs.respond_to? :start_migration - @start_migration = ::Gapic::Config::Method.new start_migration_config - resume_migration_config = parent_rpcs.resume_migration if parent_rpcs.respond_to? :resume_migration - @resume_migration = ::Gapic::Config::Method.new resume_migration_config - pause_migration_config = parent_rpcs.pause_migration if parent_rpcs.respond_to? :pause_migration - @pause_migration = ::Gapic::Config::Method.new pause_migration_config - finalize_migration_config = parent_rpcs.finalize_migration if parent_rpcs.respond_to? :finalize_migration - @finalize_migration = ::Gapic::Config::Method.new finalize_migration_config - extend_migration_config = parent_rpcs.extend_migration if parent_rpcs.respond_to? :extend_migration - @extend_migration = ::Gapic::Config::Method.new extend_migration_config - create_clone_job_config = parent_rpcs.create_clone_job if parent_rpcs.respond_to? :create_clone_job - @create_clone_job = ::Gapic::Config::Method.new create_clone_job_config - cancel_clone_job_config = parent_rpcs.cancel_clone_job if parent_rpcs.respond_to? :cancel_clone_job - @cancel_clone_job = ::Gapic::Config::Method.new cancel_clone_job_config - list_clone_jobs_config = parent_rpcs.list_clone_jobs if parent_rpcs.respond_to? :list_clone_jobs - @list_clone_jobs = ::Gapic::Config::Method.new list_clone_jobs_config - get_clone_job_config = parent_rpcs.get_clone_job if parent_rpcs.respond_to? :get_clone_job - @get_clone_job = ::Gapic::Config::Method.new get_clone_job_config - create_cutover_job_config = parent_rpcs.create_cutover_job if parent_rpcs.respond_to? :create_cutover_job - @create_cutover_job = ::Gapic::Config::Method.new create_cutover_job_config - cancel_cutover_job_config = parent_rpcs.cancel_cutover_job if parent_rpcs.respond_to? :cancel_cutover_job - @cancel_cutover_job = ::Gapic::Config::Method.new cancel_cutover_job_config - list_cutover_jobs_config = parent_rpcs.list_cutover_jobs if parent_rpcs.respond_to? :list_cutover_jobs - @list_cutover_jobs = ::Gapic::Config::Method.new list_cutover_jobs_config - get_cutover_job_config = parent_rpcs.get_cutover_job if parent_rpcs.respond_to? :get_cutover_job - @get_cutover_job = ::Gapic::Config::Method.new get_cutover_job_config - list_groups_config = parent_rpcs.list_groups if parent_rpcs.respond_to? :list_groups - @list_groups = ::Gapic::Config::Method.new list_groups_config - get_group_config = parent_rpcs.get_group if parent_rpcs.respond_to? :get_group - @get_group = ::Gapic::Config::Method.new get_group_config - create_group_config = parent_rpcs.create_group if parent_rpcs.respond_to? :create_group - @create_group = ::Gapic::Config::Method.new create_group_config - update_group_config = parent_rpcs.update_group if parent_rpcs.respond_to? :update_group - @update_group = ::Gapic::Config::Method.new update_group_config - delete_group_config = parent_rpcs.delete_group if parent_rpcs.respond_to? :delete_group - @delete_group = ::Gapic::Config::Method.new delete_group_config - add_group_migration_config = parent_rpcs.add_group_migration if parent_rpcs.respond_to? :add_group_migration - @add_group_migration = ::Gapic::Config::Method.new add_group_migration_config - remove_group_migration_config = parent_rpcs.remove_group_migration if parent_rpcs.respond_to? :remove_group_migration - @remove_group_migration = ::Gapic::Config::Method.new remove_group_migration_config - list_target_projects_config = parent_rpcs.list_target_projects if parent_rpcs.respond_to? :list_target_projects - @list_target_projects = ::Gapic::Config::Method.new list_target_projects_config - get_target_project_config = parent_rpcs.get_target_project if parent_rpcs.respond_to? :get_target_project - @get_target_project = ::Gapic::Config::Method.new get_target_project_config - create_target_project_config = parent_rpcs.create_target_project if parent_rpcs.respond_to? :create_target_project - @create_target_project = ::Gapic::Config::Method.new create_target_project_config - update_target_project_config = parent_rpcs.update_target_project if parent_rpcs.respond_to? :update_target_project - @update_target_project = ::Gapic::Config::Method.new update_target_project_config - delete_target_project_config = parent_rpcs.delete_target_project if parent_rpcs.respond_to? :delete_target_project - @delete_target_project = ::Gapic::Config::Method.new delete_target_project_config - list_replication_cycles_config = parent_rpcs.list_replication_cycles if parent_rpcs.respond_to? :list_replication_cycles - @list_replication_cycles = ::Gapic::Config::Method.new list_replication_cycles_config - get_replication_cycle_config = parent_rpcs.get_replication_cycle if parent_rpcs.respond_to? :get_replication_cycle - @get_replication_cycle = ::Gapic::Config::Method.new get_replication_cycle_config - list_image_imports_config = parent_rpcs.list_image_imports if parent_rpcs.respond_to? :list_image_imports - @list_image_imports = ::Gapic::Config::Method.new list_image_imports_config - get_image_import_config = parent_rpcs.get_image_import if parent_rpcs.respond_to? :get_image_import - @get_image_import = ::Gapic::Config::Method.new get_image_import_config - create_image_import_config = parent_rpcs.create_image_import if parent_rpcs.respond_to? :create_image_import - @create_image_import = ::Gapic::Config::Method.new create_image_import_config - delete_image_import_config = parent_rpcs.delete_image_import if parent_rpcs.respond_to? :delete_image_import - @delete_image_import = ::Gapic::Config::Method.new delete_image_import_config - list_image_import_jobs_config = parent_rpcs.list_image_import_jobs if parent_rpcs.respond_to? :list_image_import_jobs - @list_image_import_jobs = ::Gapic::Config::Method.new list_image_import_jobs_config - get_image_import_job_config = parent_rpcs.get_image_import_job if parent_rpcs.respond_to? :get_image_import_job - @get_image_import_job = ::Gapic::Config::Method.new get_image_import_job_config - cancel_image_import_job_config = parent_rpcs.cancel_image_import_job if parent_rpcs.respond_to? :cancel_image_import_job - @cancel_image_import_job = ::Gapic::Config::Method.new cancel_image_import_job_config - create_disk_migration_job_config = parent_rpcs.create_disk_migration_job if parent_rpcs.respond_to? :create_disk_migration_job - @create_disk_migration_job = ::Gapic::Config::Method.new create_disk_migration_job_config - list_disk_migration_jobs_config = parent_rpcs.list_disk_migration_jobs if parent_rpcs.respond_to? :list_disk_migration_jobs - @list_disk_migration_jobs = ::Gapic::Config::Method.new list_disk_migration_jobs_config - get_disk_migration_job_config = parent_rpcs.get_disk_migration_job if parent_rpcs.respond_to? :get_disk_migration_job - @get_disk_migration_job = ::Gapic::Config::Method.new get_disk_migration_job_config - update_disk_migration_job_config = parent_rpcs.update_disk_migration_job if parent_rpcs.respond_to? :update_disk_migration_job - @update_disk_migration_job = ::Gapic::Config::Method.new update_disk_migration_job_config - delete_disk_migration_job_config = parent_rpcs.delete_disk_migration_job if parent_rpcs.respond_to? :delete_disk_migration_job - @delete_disk_migration_job = ::Gapic::Config::Method.new delete_disk_migration_job_config - run_disk_migration_job_config = parent_rpcs.run_disk_migration_job if parent_rpcs.respond_to? :run_disk_migration_job - @run_disk_migration_job = ::Gapic::Config::Method.new run_disk_migration_job_config - cancel_disk_migration_job_config = parent_rpcs.cancel_disk_migration_job if parent_rpcs.respond_to? :cancel_disk_migration_job - @cancel_disk_migration_job = ::Gapic::Config::Method.new cancel_disk_migration_job_config - - yield self if block_given? - end - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-vm_migration-v1/lib/google/cloud/vm_migration/v1/vm_migration/rest/operations.rb b/owl-bot-staging/google-cloud-vm_migration-v1/lib/google/cloud/vm_migration/v1/vm_migration/rest/operations.rb deleted file mode 100644 index e562fae43b9f..000000000000 --- a/owl-bot-staging/google-cloud-vm_migration-v1/lib/google/cloud/vm_migration/v1/vm_migration/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 VMMigration - module V1 - module VMMigration - module Rest - # Service that implements Longrunning Operations API. - class Operations - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "vmmigration.$UNIVERSE_DOMAIN$" - - # @private - attr_reader :operations_stub - - ## - # Configuration for the VmMigration 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 VmMigration 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::VMMigration::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::VMMigration::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::VMMigration::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::VMMigration::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 = "vmmigration.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}/operations", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/?$}, 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{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] - ] - ) - 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{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-vm_migration-v1/lib/google/cloud/vm_migration/v1/vm_migration/rest/service_stub.rb b/owl-bot-staging/google-cloud-vm_migration-v1/lib/google/cloud/vm_migration/v1/vm_migration/rest/service_stub.rb deleted file mode 100644 index fd5382c1721f..000000000000 --- a/owl-bot-staging/google-cloud-vm_migration-v1/lib/google/cloud/vm_migration/v1/vm_migration/rest/service_stub.rb +++ /dev/null @@ -1,3891 +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/vmmigration/v1/vmmigration_pb" - -module Google - module Cloud - module VMMigration - module V1 - module VMMigration - module Rest - ## - # REST service stub for the VmMigration 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_sources REST call - # - # @param request_pb [::Google::Cloud::VMMigration::V1::ListSourcesRequest] - # 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::VMMigration::V1::ListSourcesResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::VMMigration::V1::ListSourcesResponse] - # A result object deserialized from the server's reply - def list_sources request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_sources_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_sources", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::VMMigration::V1::ListSourcesResponse.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_source REST call - # - # @param request_pb [::Google::Cloud::VMMigration::V1::GetSourceRequest] - # 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::VMMigration::V1::Source] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::VMMigration::V1::Source] - # A result object deserialized from the server's reply - def get_source request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_source_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_source", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::VMMigration::V1::Source.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_source REST call - # - # @param request_pb [::Google::Cloud::VMMigration::V1::CreateSourceRequest] - # 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_source request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_source_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_source", - 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 update_source REST call - # - # @param request_pb [::Google::Cloud::VMMigration::V1::UpdateSourceRequest] - # 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 update_source request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_source_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_source", - 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_source REST call - # - # @param request_pb [::Google::Cloud::VMMigration::V1::DeleteSourceRequest] - # 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_source request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_delete_source_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_source", - 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 fetch_inventory REST call - # - # @param request_pb [::Google::Cloud::VMMigration::V1::FetchInventoryRequest] - # 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::VMMigration::V1::FetchInventoryResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::VMMigration::V1::FetchInventoryResponse] - # A result object deserialized from the server's reply - def fetch_inventory request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_fetch_inventory_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: "fetch_inventory", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::VMMigration::V1::FetchInventoryResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the fetch_storage_inventory REST call - # - # @param request_pb [::Google::Cloud::VMMigration::V1::FetchStorageInventoryRequest] - # 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::VMMigration::V1::FetchStorageInventoryResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::VMMigration::V1::FetchStorageInventoryResponse] - # A result object deserialized from the server's reply - def fetch_storage_inventory request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_fetch_storage_inventory_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: "fetch_storage_inventory", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::VMMigration::V1::FetchStorageInventoryResponse.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_utilization_reports REST call - # - # @param request_pb [::Google::Cloud::VMMigration::V1::ListUtilizationReportsRequest] - # 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::VMMigration::V1::ListUtilizationReportsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::VMMigration::V1::ListUtilizationReportsResponse] - # A result object deserialized from the server's reply - def list_utilization_reports request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_utilization_reports_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_utilization_reports", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::VMMigration::V1::ListUtilizationReportsResponse.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_utilization_report REST call - # - # @param request_pb [::Google::Cloud::VMMigration::V1::GetUtilizationReportRequest] - # 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::VMMigration::V1::UtilizationReport] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::VMMigration::V1::UtilizationReport] - # A result object deserialized from the server's reply - def get_utilization_report request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_utilization_report_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_utilization_report", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::VMMigration::V1::UtilizationReport.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_utilization_report REST call - # - # @param request_pb [::Google::Cloud::VMMigration::V1::CreateUtilizationReportRequest] - # 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_utilization_report request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_utilization_report_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_utilization_report", - 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_utilization_report REST call - # - # @param request_pb [::Google::Cloud::VMMigration::V1::DeleteUtilizationReportRequest] - # 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_utilization_report request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_delete_utilization_report_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_utilization_report", - 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 list_datacenter_connectors REST call - # - # @param request_pb [::Google::Cloud::VMMigration::V1::ListDatacenterConnectorsRequest] - # 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::VMMigration::V1::ListDatacenterConnectorsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::VMMigration::V1::ListDatacenterConnectorsResponse] - # A result object deserialized from the server's reply - def list_datacenter_connectors request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_datacenter_connectors_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_datacenter_connectors", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::VMMigration::V1::ListDatacenterConnectorsResponse.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_datacenter_connector REST call - # - # @param request_pb [::Google::Cloud::VMMigration::V1::GetDatacenterConnectorRequest] - # 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::VMMigration::V1::DatacenterConnector] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::VMMigration::V1::DatacenterConnector] - # A result object deserialized from the server's reply - def get_datacenter_connector request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_datacenter_connector_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_datacenter_connector", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::VMMigration::V1::DatacenterConnector.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_datacenter_connector REST call - # - # @param request_pb [::Google::Cloud::VMMigration::V1::CreateDatacenterConnectorRequest] - # 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_datacenter_connector request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_datacenter_connector_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_datacenter_connector", - 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_datacenter_connector REST call - # - # @param request_pb [::Google::Cloud::VMMigration::V1::DeleteDatacenterConnectorRequest] - # 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_datacenter_connector request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_delete_datacenter_connector_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_datacenter_connector", - 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 upgrade_appliance REST call - # - # @param request_pb [::Google::Cloud::VMMigration::V1::UpgradeApplianceRequest] - # 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 upgrade_appliance request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_upgrade_appliance_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: "upgrade_appliance", - 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_migrating_vm REST call - # - # @param request_pb [::Google::Cloud::VMMigration::V1::CreateMigratingVmRequest] - # 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_migrating_vm request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_migrating_vm_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_migrating_vm", - 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 list_migrating_vms REST call - # - # @param request_pb [::Google::Cloud::VMMigration::V1::ListMigratingVmsRequest] - # 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::VMMigration::V1::ListMigratingVmsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::VMMigration::V1::ListMigratingVmsResponse] - # A result object deserialized from the server's reply - def list_migrating_vms request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_migrating_vms_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_migrating_vms", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::VMMigration::V1::ListMigratingVmsResponse.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_migrating_vm REST call - # - # @param request_pb [::Google::Cloud::VMMigration::V1::GetMigratingVmRequest] - # 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::VMMigration::V1::MigratingVm] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::VMMigration::V1::MigratingVm] - # A result object deserialized from the server's reply - def get_migrating_vm request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_migrating_vm_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_migrating_vm", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::VMMigration::V1::MigratingVm.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_migrating_vm REST call - # - # @param request_pb [::Google::Cloud::VMMigration::V1::UpdateMigratingVmRequest] - # 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 update_migrating_vm request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_migrating_vm_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_migrating_vm", - 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_migrating_vm REST call - # - # @param request_pb [::Google::Cloud::VMMigration::V1::DeleteMigratingVmRequest] - # 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_migrating_vm request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_delete_migrating_vm_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_migrating_vm", - 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 start_migration REST call - # - # @param request_pb [::Google::Cloud::VMMigration::V1::StartMigrationRequest] - # 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 start_migration request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_start_migration_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: "start_migration", - 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 resume_migration REST call - # - # @param request_pb [::Google::Cloud::VMMigration::V1::ResumeMigrationRequest] - # 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 resume_migration request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_resume_migration_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: "resume_migration", - 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 pause_migration REST call - # - # @param request_pb [::Google::Cloud::VMMigration::V1::PauseMigrationRequest] - # 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 pause_migration request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_pause_migration_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: "pause_migration", - 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 finalize_migration REST call - # - # @param request_pb [::Google::Cloud::VMMigration::V1::FinalizeMigrationRequest] - # 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 finalize_migration request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_finalize_migration_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: "finalize_migration", - 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 extend_migration REST call - # - # @param request_pb [::Google::Cloud::VMMigration::V1::ExtendMigrationRequest] - # 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 extend_migration request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_extend_migration_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: "extend_migration", - 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_clone_job REST call - # - # @param request_pb [::Google::Cloud::VMMigration::V1::CreateCloneJobRequest] - # 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_clone_job request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_clone_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_clone_job", - 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 cancel_clone_job REST call - # - # @param request_pb [::Google::Cloud::VMMigration::V1::CancelCloneJobRequest] - # 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 cancel_clone_job request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_cancel_clone_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: "cancel_clone_job", - 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 list_clone_jobs REST call - # - # @param request_pb [::Google::Cloud::VMMigration::V1::ListCloneJobsRequest] - # 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::VMMigration::V1::ListCloneJobsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::VMMigration::V1::ListCloneJobsResponse] - # A result object deserialized from the server's reply - def list_clone_jobs request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_clone_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_clone_jobs", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::VMMigration::V1::ListCloneJobsResponse.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_clone_job REST call - # - # @param request_pb [::Google::Cloud::VMMigration::V1::GetCloneJobRequest] - # 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::VMMigration::V1::CloneJob] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::VMMigration::V1::CloneJob] - # A result object deserialized from the server's reply - def get_clone_job request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_clone_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_clone_job", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::VMMigration::V1::CloneJob.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_cutover_job REST call - # - # @param request_pb [::Google::Cloud::VMMigration::V1::CreateCutoverJobRequest] - # 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_cutover_job request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_cutover_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_cutover_job", - 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 cancel_cutover_job REST call - # - # @param request_pb [::Google::Cloud::VMMigration::V1::CancelCutoverJobRequest] - # 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 cancel_cutover_job request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_cancel_cutover_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: "cancel_cutover_job", - 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 list_cutover_jobs REST call - # - # @param request_pb [::Google::Cloud::VMMigration::V1::ListCutoverJobsRequest] - # 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::VMMigration::V1::ListCutoverJobsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::VMMigration::V1::ListCutoverJobsResponse] - # A result object deserialized from the server's reply - def list_cutover_jobs request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_cutover_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_cutover_jobs", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::VMMigration::V1::ListCutoverJobsResponse.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_cutover_job REST call - # - # @param request_pb [::Google::Cloud::VMMigration::V1::GetCutoverJobRequest] - # 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::VMMigration::V1::CutoverJob] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::VMMigration::V1::CutoverJob] - # A result object deserialized from the server's reply - def get_cutover_job request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_cutover_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_cutover_job", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::VMMigration::V1::CutoverJob.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_groups REST call - # - # @param request_pb [::Google::Cloud::VMMigration::V1::ListGroupsRequest] - # 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::VMMigration::V1::ListGroupsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::VMMigration::V1::ListGroupsResponse] - # A result object deserialized from the server's reply - def list_groups request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_groups_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_groups", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::VMMigration::V1::ListGroupsResponse.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_group REST call - # - # @param request_pb [::Google::Cloud::VMMigration::V1::GetGroupRequest] - # 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::VMMigration::V1::Group] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::VMMigration::V1::Group] - # A result object deserialized from the server's reply - def get_group request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_group_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_group", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::VMMigration::V1::Group.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_group REST call - # - # @param request_pb [::Google::Cloud::VMMigration::V1::CreateGroupRequest] - # 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_group request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_group_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_group", - 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 update_group REST call - # - # @param request_pb [::Google::Cloud::VMMigration::V1::UpdateGroupRequest] - # 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 update_group request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_group_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_group", - 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_group REST call - # - # @param request_pb [::Google::Cloud::VMMigration::V1::DeleteGroupRequest] - # 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_group request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_delete_group_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_group", - 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 add_group_migration REST call - # - # @param request_pb [::Google::Cloud::VMMigration::V1::AddGroupMigrationRequest] - # 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 add_group_migration request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_add_group_migration_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: "add_group_migration", - 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 remove_group_migration REST call - # - # @param request_pb [::Google::Cloud::VMMigration::V1::RemoveGroupMigrationRequest] - # 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 remove_group_migration request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_remove_group_migration_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: "remove_group_migration", - 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 list_target_projects REST call - # - # @param request_pb [::Google::Cloud::VMMigration::V1::ListTargetProjectsRequest] - # 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::VMMigration::V1::ListTargetProjectsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::VMMigration::V1::ListTargetProjectsResponse] - # A result object deserialized from the server's reply - def list_target_projects request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_target_projects_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_target_projects", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::VMMigration::V1::ListTargetProjectsResponse.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_target_project REST call - # - # @param request_pb [::Google::Cloud::VMMigration::V1::GetTargetProjectRequest] - # 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::VMMigration::V1::TargetProject] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::VMMigration::V1::TargetProject] - # A result object deserialized from the server's reply - def get_target_project request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_target_project_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_target_project", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::VMMigration::V1::TargetProject.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_target_project REST call - # - # @param request_pb [::Google::Cloud::VMMigration::V1::CreateTargetProjectRequest] - # 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_target_project request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_target_project_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_target_project", - 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 update_target_project REST call - # - # @param request_pb [::Google::Cloud::VMMigration::V1::UpdateTargetProjectRequest] - # 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 update_target_project request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_target_project_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_target_project", - 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_target_project REST call - # - # @param request_pb [::Google::Cloud::VMMigration::V1::DeleteTargetProjectRequest] - # 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_target_project request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_delete_target_project_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_target_project", - 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 list_replication_cycles REST call - # - # @param request_pb [::Google::Cloud::VMMigration::V1::ListReplicationCyclesRequest] - # 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::VMMigration::V1::ListReplicationCyclesResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::VMMigration::V1::ListReplicationCyclesResponse] - # A result object deserialized from the server's reply - def list_replication_cycles request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_replication_cycles_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_replication_cycles", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::VMMigration::V1::ListReplicationCyclesResponse.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_replication_cycle REST call - # - # @param request_pb [::Google::Cloud::VMMigration::V1::GetReplicationCycleRequest] - # 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::VMMigration::V1::ReplicationCycle] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::VMMigration::V1::ReplicationCycle] - # A result object deserialized from the server's reply - def get_replication_cycle request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_replication_cycle_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_replication_cycle", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::VMMigration::V1::ReplicationCycle.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_image_imports REST call - # - # @param request_pb [::Google::Cloud::VMMigration::V1::ListImageImportsRequest] - # 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::VMMigration::V1::ListImageImportsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::VMMigration::V1::ListImageImportsResponse] - # A result object deserialized from the server's reply - def list_image_imports request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_image_imports_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_image_imports", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::VMMigration::V1::ListImageImportsResponse.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_image_import REST call - # - # @param request_pb [::Google::Cloud::VMMigration::V1::GetImageImportRequest] - # 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::VMMigration::V1::ImageImport] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::VMMigration::V1::ImageImport] - # A result object deserialized from the server's reply - def get_image_import request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_image_import_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_image_import", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::VMMigration::V1::ImageImport.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_image_import REST call - # - # @param request_pb [::Google::Cloud::VMMigration::V1::CreateImageImportRequest] - # 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_image_import request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_image_import_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_image_import", - 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_image_import REST call - # - # @param request_pb [::Google::Cloud::VMMigration::V1::DeleteImageImportRequest] - # 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_image_import request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_delete_image_import_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_image_import", - 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 list_image_import_jobs REST call - # - # @param request_pb [::Google::Cloud::VMMigration::V1::ListImageImportJobsRequest] - # 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::VMMigration::V1::ListImageImportJobsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::VMMigration::V1::ListImageImportJobsResponse] - # A result object deserialized from the server's reply - def list_image_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_image_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_image_import_jobs", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::VMMigration::V1::ListImageImportJobsResponse.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_image_import_job REST call - # - # @param request_pb [::Google::Cloud::VMMigration::V1::GetImageImportJobRequest] - # 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::VMMigration::V1::ImageImportJob] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::VMMigration::V1::ImageImportJob] - # A result object deserialized from the server's reply - def get_image_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_image_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_image_import_job", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::VMMigration::V1::ImageImportJob.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_image_import_job REST call - # - # @param request_pb [::Google::Cloud::VMMigration::V1::CancelImageImportJobRequest] - # 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 cancel_image_import_job request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_cancel_image_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: "cancel_image_import_job", - 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_disk_migration_job REST call - # - # @param request_pb [::Google::Cloud::VMMigration::V1::CreateDiskMigrationJobRequest] - # 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_disk_migration_job request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_disk_migration_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_disk_migration_job", - 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 list_disk_migration_jobs REST call - # - # @param request_pb [::Google::Cloud::VMMigration::V1::ListDiskMigrationJobsRequest] - # 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::VMMigration::V1::ListDiskMigrationJobsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::VMMigration::V1::ListDiskMigrationJobsResponse] - # A result object deserialized from the server's reply - def list_disk_migration_jobs request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_disk_migration_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_disk_migration_jobs", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::VMMigration::V1::ListDiskMigrationJobsResponse.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_disk_migration_job REST call - # - # @param request_pb [::Google::Cloud::VMMigration::V1::GetDiskMigrationJobRequest] - # 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::VMMigration::V1::DiskMigrationJob] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::VMMigration::V1::DiskMigrationJob] - # A result object deserialized from the server's reply - def get_disk_migration_job request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_disk_migration_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_disk_migration_job", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::VMMigration::V1::DiskMigrationJob.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_disk_migration_job REST call - # - # @param request_pb [::Google::Cloud::VMMigration::V1::UpdateDiskMigrationJobRequest] - # 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 update_disk_migration_job request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_disk_migration_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: "update_disk_migration_job", - 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_disk_migration_job REST call - # - # @param request_pb [::Google::Cloud::VMMigration::V1::DeleteDiskMigrationJobRequest] - # 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_disk_migration_job request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_delete_disk_migration_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: "delete_disk_migration_job", - 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 run_disk_migration_job REST call - # - # @param request_pb [::Google::Cloud::VMMigration::V1::RunDiskMigrationJobRequest] - # 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 run_disk_migration_job request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_run_disk_migration_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: "run_disk_migration_job", - 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 cancel_disk_migration_job REST call - # - # @param request_pb [::Google::Cloud::VMMigration::V1::CancelDiskMigrationJobRequest] - # 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 cancel_disk_migration_job request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_cancel_disk_migration_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: "cancel_disk_migration_job", - 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 - - ## - # @private - # - # GRPC transcoding helper method for the list_sources REST call - # - # @param request_pb [::Google::Cloud::VMMigration::V1::ListSourcesRequest] - # 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_sources_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/sources", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_source REST call - # - # @param request_pb [::Google::Cloud::VMMigration::V1::GetSourceRequest] - # 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_source_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/sources/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the create_source REST call - # - # @param request_pb [::Google::Cloud::VMMigration::V1::CreateSourceRequest] - # 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_source_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}/sources", - body: "source", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_source REST call - # - # @param request_pb [::Google::Cloud::VMMigration::V1::UpdateSourceRequest] - # 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_source_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v1/{source.name}", - body: "source", - matches: [ - ["source.name", %r{^projects/[^/]+/locations/[^/]+/sources/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_source REST call - # - # @param request_pb [::Google::Cloud::VMMigration::V1::DeleteSourceRequest] - # 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_source_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/sources/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the fetch_inventory REST call - # - # @param request_pb [::Google::Cloud::VMMigration::V1::FetchInventoryRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_fetch_inventory_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{source}:fetchInventory", - matches: [ - ["source", %r{^projects/[^/]+/locations/[^/]+/sources/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the fetch_storage_inventory REST call - # - # @param request_pb [::Google::Cloud::VMMigration::V1::FetchStorageInventoryRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_fetch_storage_inventory_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{source}:fetchStorageInventory", - matches: [ - ["source", %r{^projects/[^/]+/locations/[^/]+/sources/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_utilization_reports REST call - # - # @param request_pb [::Google::Cloud::VMMigration::V1::ListUtilizationReportsRequest] - # 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_utilization_reports_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/utilizationReports", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/sources/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_utilization_report REST call - # - # @param request_pb [::Google::Cloud::VMMigration::V1::GetUtilizationReportRequest] - # 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_utilization_report_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/sources/[^/]+/utilizationReports/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the create_utilization_report REST call - # - # @param request_pb [::Google::Cloud::VMMigration::V1::CreateUtilizationReportRequest] - # 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_utilization_report_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}/utilizationReports", - body: "utilization_report", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/sources/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_utilization_report REST call - # - # @param request_pb [::Google::Cloud::VMMigration::V1::DeleteUtilizationReportRequest] - # 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_utilization_report_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/sources/[^/]+/utilizationReports/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_datacenter_connectors REST call - # - # @param request_pb [::Google::Cloud::VMMigration::V1::ListDatacenterConnectorsRequest] - # 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_datacenter_connectors_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/datacenterConnectors", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/sources/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_datacenter_connector REST call - # - # @param request_pb [::Google::Cloud::VMMigration::V1::GetDatacenterConnectorRequest] - # 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_datacenter_connector_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/sources/[^/]+/datacenterConnectors/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the create_datacenter_connector REST call - # - # @param request_pb [::Google::Cloud::VMMigration::V1::CreateDatacenterConnectorRequest] - # 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_datacenter_connector_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}/datacenterConnectors", - body: "datacenter_connector", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/sources/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_datacenter_connector REST call - # - # @param request_pb [::Google::Cloud::VMMigration::V1::DeleteDatacenterConnectorRequest] - # 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_datacenter_connector_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/sources/[^/]+/datacenterConnectors/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the upgrade_appliance REST call - # - # @param request_pb [::Google::Cloud::VMMigration::V1::UpgradeApplianceRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_upgrade_appliance_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{datacenter_connector}:upgradeAppliance", - body: "*", - matches: [ - ["datacenter_connector", %r{^projects/[^/]+/locations/[^/]+/sources/[^/]+/datacenterConnectors/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the create_migrating_vm REST call - # - # @param request_pb [::Google::Cloud::VMMigration::V1::CreateMigratingVmRequest] - # 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_migrating_vm_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}/migratingVms", - body: "migrating_vm", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/sources/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_migrating_vms REST call - # - # @param request_pb [::Google::Cloud::VMMigration::V1::ListMigratingVmsRequest] - # 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_migrating_vms_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/migratingVms", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/sources/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_migrating_vm REST call - # - # @param request_pb [::Google::Cloud::VMMigration::V1::GetMigratingVmRequest] - # 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_migrating_vm_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/sources/[^/]+/migratingVms/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_migrating_vm REST call - # - # @param request_pb [::Google::Cloud::VMMigration::V1::UpdateMigratingVmRequest] - # 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_migrating_vm_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v1/{migrating_vm.name}", - body: "migrating_vm", - matches: [ - ["migrating_vm.name", %r{^projects/[^/]+/locations/[^/]+/sources/[^/]+/migratingVms/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_migrating_vm REST call - # - # @param request_pb [::Google::Cloud::VMMigration::V1::DeleteMigratingVmRequest] - # 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_migrating_vm_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/sources/[^/]+/migratingVms/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the start_migration REST call - # - # @param request_pb [::Google::Cloud::VMMigration::V1::StartMigrationRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_start_migration_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{migrating_vm}:startMigration", - body: "*", - matches: [ - ["migrating_vm", %r{^projects/[^/]+/locations/[^/]+/sources/[^/]+/migratingVms/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the resume_migration REST call - # - # @param request_pb [::Google::Cloud::VMMigration::V1::ResumeMigrationRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_resume_migration_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{migrating_vm}:resumeMigration", - body: "*", - matches: [ - ["migrating_vm", %r{^projects/[^/]+/locations/[^/]+/sources/[^/]+/migratingVms/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the pause_migration REST call - # - # @param request_pb [::Google::Cloud::VMMigration::V1::PauseMigrationRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_pause_migration_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{migrating_vm}:pauseMigration", - body: "*", - matches: [ - ["migrating_vm", %r{^projects/[^/]+/locations/[^/]+/sources/[^/]+/migratingVms/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the finalize_migration REST call - # - # @param request_pb [::Google::Cloud::VMMigration::V1::FinalizeMigrationRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_finalize_migration_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{migrating_vm}:finalizeMigration", - body: "*", - matches: [ - ["migrating_vm", %r{^projects/[^/]+/locations/[^/]+/sources/[^/]+/migratingVms/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the extend_migration REST call - # - # @param request_pb [::Google::Cloud::VMMigration::V1::ExtendMigrationRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_extend_migration_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{migrating_vm}:extendMigration", - body: "*", - matches: [ - ["migrating_vm", %r{^projects/[^/]+/locations/[^/]+/sources/[^/]+/migratingVms/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the create_clone_job REST call - # - # @param request_pb [::Google::Cloud::VMMigration::V1::CreateCloneJobRequest] - # 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_clone_job_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}/cloneJobs", - body: "clone_job", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/sources/[^/]+/migratingVms/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the cancel_clone_job REST call - # - # @param request_pb [::Google::Cloud::VMMigration::V1::CancelCloneJobRequest] - # 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_clone_job_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:cancel", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/sources/[^/]+/migratingVms/[^/]+/cloneJobs/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_clone_jobs REST call - # - # @param request_pb [::Google::Cloud::VMMigration::V1::ListCloneJobsRequest] - # 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_clone_jobs_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/cloneJobs", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/sources/[^/]+/migratingVms/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_clone_job REST call - # - # @param request_pb [::Google::Cloud::VMMigration::V1::GetCloneJobRequest] - # 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_clone_job_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/sources/[^/]+/migratingVms/[^/]+/cloneJobs/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the create_cutover_job REST call - # - # @param request_pb [::Google::Cloud::VMMigration::V1::CreateCutoverJobRequest] - # 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_cutover_job_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}/cutoverJobs", - body: "cutover_job", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/sources/[^/]+/migratingVms/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the cancel_cutover_job REST call - # - # @param request_pb [::Google::Cloud::VMMigration::V1::CancelCutoverJobRequest] - # 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_cutover_job_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:cancel", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/sources/[^/]+/migratingVms/[^/]+/cutoverJobs/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_cutover_jobs REST call - # - # @param request_pb [::Google::Cloud::VMMigration::V1::ListCutoverJobsRequest] - # 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_cutover_jobs_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/cutoverJobs", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/sources/[^/]+/migratingVms/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_cutover_job REST call - # - # @param request_pb [::Google::Cloud::VMMigration::V1::GetCutoverJobRequest] - # 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_cutover_job_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/sources/[^/]+/migratingVms/[^/]+/cutoverJobs/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_groups REST call - # - # @param request_pb [::Google::Cloud::VMMigration::V1::ListGroupsRequest] - # 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_groups_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/groups", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_group REST call - # - # @param request_pb [::Google::Cloud::VMMigration::V1::GetGroupRequest] - # 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_group_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/groups/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the create_group REST call - # - # @param request_pb [::Google::Cloud::VMMigration::V1::CreateGroupRequest] - # 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_group_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}/groups", - body: "group", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_group REST call - # - # @param request_pb [::Google::Cloud::VMMigration::V1::UpdateGroupRequest] - # 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_group_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v1/{group.name}", - body: "group", - matches: [ - ["group.name", %r{^projects/[^/]+/locations/[^/]+/groups/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_group REST call - # - # @param request_pb [::Google::Cloud::VMMigration::V1::DeleteGroupRequest] - # 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_group_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/groups/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the add_group_migration REST call - # - # @param request_pb [::Google::Cloud::VMMigration::V1::AddGroupMigrationRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_add_group_migration_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{group}:addGroupMigration", - body: "*", - matches: [ - ["group", %r{^projects/[^/]+/locations/[^/]+/groups/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the remove_group_migration REST call - # - # @param request_pb [::Google::Cloud::VMMigration::V1::RemoveGroupMigrationRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_remove_group_migration_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{group}:removeGroupMigration", - body: "*", - matches: [ - ["group", %r{^projects/[^/]+/locations/[^/]+/groups/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_target_projects REST call - # - # @param request_pb [::Google::Cloud::VMMigration::V1::ListTargetProjectsRequest] - # 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_target_projects_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/targetProjects", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_target_project REST call - # - # @param request_pb [::Google::Cloud::VMMigration::V1::GetTargetProjectRequest] - # 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_target_project_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/targetProjects/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the create_target_project REST call - # - # @param request_pb [::Google::Cloud::VMMigration::V1::CreateTargetProjectRequest] - # 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_target_project_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}/targetProjects", - body: "target_project", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_target_project REST call - # - # @param request_pb [::Google::Cloud::VMMigration::V1::UpdateTargetProjectRequest] - # 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_target_project_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v1/{target_project.name}", - body: "target_project", - matches: [ - ["target_project.name", %r{^projects/[^/]+/locations/[^/]+/targetProjects/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_target_project REST call - # - # @param request_pb [::Google::Cloud::VMMigration::V1::DeleteTargetProjectRequest] - # 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_target_project_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/targetProjects/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_replication_cycles REST call - # - # @param request_pb [::Google::Cloud::VMMigration::V1::ListReplicationCyclesRequest] - # 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_replication_cycles_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/replicationCycles", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/sources/[^/]+/migratingVms/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_replication_cycle REST call - # - # @param request_pb [::Google::Cloud::VMMigration::V1::GetReplicationCycleRequest] - # 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_replication_cycle_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/sources/[^/]+/migratingVms/[^/]+/replicationCycles/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_image_imports REST call - # - # @param request_pb [::Google::Cloud::VMMigration::V1::ListImageImportsRequest] - # 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_image_imports_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/imageImports", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_image_import REST call - # - # @param request_pb [::Google::Cloud::VMMigration::V1::GetImageImportRequest] - # 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_image_import_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/imageImports/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the create_image_import REST call - # - # @param request_pb [::Google::Cloud::VMMigration::V1::CreateImageImportRequest] - # 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_image_import_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}/imageImports", - body: "image_import", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_image_import REST call - # - # @param request_pb [::Google::Cloud::VMMigration::V1::DeleteImageImportRequest] - # 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_image_import_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/imageImports/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_image_import_jobs REST call - # - # @param request_pb [::Google::Cloud::VMMigration::V1::ListImageImportJobsRequest] - # 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_image_import_jobs_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/imageImportJobs", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/imageImports/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_image_import_job REST call - # - # @param request_pb [::Google::Cloud::VMMigration::V1::GetImageImportJobRequest] - # 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_image_import_job_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/imageImports/[^/]+/imageImportJobs/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the cancel_image_import_job REST call - # - # @param request_pb [::Google::Cloud::VMMigration::V1::CancelImageImportJobRequest] - # 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_image_import_job_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:cancel", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/imageImports/[^/]+/imageImportJobs/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the create_disk_migration_job REST call - # - # @param request_pb [::Google::Cloud::VMMigration::V1::CreateDiskMigrationJobRequest] - # 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_disk_migration_job_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}/diskMigrationJobs", - body: "disk_migration_job", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/sources/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_disk_migration_jobs REST call - # - # @param request_pb [::Google::Cloud::VMMigration::V1::ListDiskMigrationJobsRequest] - # 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_disk_migration_jobs_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/diskMigrationJobs", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/sources/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_disk_migration_job REST call - # - # @param request_pb [::Google::Cloud::VMMigration::V1::GetDiskMigrationJobRequest] - # 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_disk_migration_job_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/sources/[^/]+/diskMigrationJobs/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_disk_migration_job REST call - # - # @param request_pb [::Google::Cloud::VMMigration::V1::UpdateDiskMigrationJobRequest] - # 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_disk_migration_job_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v1/{disk_migration_job.name}", - body: "disk_migration_job", - matches: [ - ["disk_migration_job.name", %r{^projects/[^/]+/locations/[^/]+/sources/[^/]+/diskMigrationJobs/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_disk_migration_job REST call - # - # @param request_pb [::Google::Cloud::VMMigration::V1::DeleteDiskMigrationJobRequest] - # 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_disk_migration_job_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/sources/[^/]+/diskMigrationJobs/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the run_disk_migration_job REST call - # - # @param request_pb [::Google::Cloud::VMMigration::V1::RunDiskMigrationJobRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_run_disk_migration_job_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:run", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/sources/[^/]+/diskMigrationJobs/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the cancel_disk_migration_job REST call - # - # @param request_pb [::Google::Cloud::VMMigration::V1::CancelDiskMigrationJobRequest] - # 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_disk_migration_job_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:cancel", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/sources/[^/]+/diskMigrationJobs/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-vm_migration-v1/lib/google/cloud/vmmigration/v1/vmmigration_pb.rb b/owl-bot-staging/google-cloud-vm_migration-v1/lib/google/cloud/vmmigration/v1/vmmigration_pb.rb deleted file mode 100644 index d63ea10afb7f..000000000000 --- a/owl-bot-staging/google-cloud-vm_migration-v1/lib/google/cloud/vmmigration/v1/vmmigration_pb.rb +++ /dev/null @@ -1,262 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/vmmigration/v1/vmmigration.proto - -require 'google/protobuf' - -require 'google/api/annotations_pb' -require 'google/api/client_pb' -require 'google/api/field_behavior_pb' -require 'google/api/field_info_pb' -require 'google/api/resource_pb' -require 'google/longrunning/operations_pb' -require 'google/protobuf/duration_pb' -require 'google/protobuf/empty_pb' -require 'google/protobuf/field_mask_pb' -require 'google/protobuf/timestamp_pb' -require 'google/rpc/error_details_pb' -require 'google/rpc/status_pb' - - -descriptor_data = "\n-google/cloud/vmmigration/v1/vmmigration.proto\x12\x1bgoogle.cloud.vmmigration.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x1bgoogle/api/field_info.proto\x1a\x19google/api/resource.proto\x1a#google/longrunning/operations.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x1egoogle/rpc/error_details.proto\x1a\x17google/rpc/status.proto\"\xd8\x05\n\x10ReplicationCycle\x12\x0c\n\x04name\x18\r \x01(\t\x12\x14\n\x0c\x63ycle_number\x18\n \x01(\x05\x12.\n\nstart_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12,\n\x08\x65nd_time\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x37\n\x14total_pause_duration\x18\x07 \x01(\x0b\x32\x19.google.protobuf.Duration\x12\x1c\n\x10progress_percent\x18\x05 \x01(\x05\x42\x02\x18\x01\x12\x35\n\x05steps\x18\t \x03(\x0b\x32&.google.cloud.vmmigration.v1.CycleStep\x12\x42\n\x05state\x18\x0b \x01(\x0e\x32\x33.google.cloud.vmmigration.v1.ReplicationCycle.State\x12&\n\x05\x65rror\x18\x0c \x01(\x0b\x32\x12.google.rpc.StatusB\x03\xe0\x41\x03\x12\x44\n\x08warnings\x18\x0e \x03(\x0b\x32-.google.cloud.vmmigration.v1.MigrationWarningB\x03\xe0\x41\x03\"R\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0b\n\x07RUNNING\x10\x01\x12\n\n\x06PAUSED\x10\x02\x12\n\n\x06\x46\x41ILED\x10\x03\x12\r\n\tSUCCEEDED\x10\x04:\xad\x01\xea\x41\xa9\x01\n+vmmigration.googleapis.com/ReplicationCycle\x12zprojects/{project}/locations/{location}/sources/{source}/migratingVms/{migrating_vm}/replicationCycles/{replication_cycle}\"\xe0\x02\n\tCycleStep\x12\\\n\x18initializing_replication\x18\x03 \x01(\x0b\x32\x38.google.cloud.vmmigration.v1.InitializingReplicationStepH\x00\x12\x43\n\x0breplicating\x18\x04 \x01(\x0b\x32,.google.cloud.vmmigration.v1.ReplicatingStepH\x00\x12J\n\x0fpost_processing\x18\x05 \x01(\x0b\x32/.google.cloud.vmmigration.v1.PostProcessingStepH\x00\x12.\n\nstart_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12,\n\x08\x65nd_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x06\n\x04step\"\x1d\n\x1bInitializingReplicationStep\"\xa9\x01\n\x0fReplicatingStep\x12\x13\n\x0btotal_bytes\x18\x01 \x01(\x03\x12\x18\n\x10replicated_bytes\x18\x02 \x01(\x03\x12\x31\n)last_two_minutes_average_bytes_per_second\x18\x03 \x01(\x03\x12\x34\n,last_thirty_minutes_average_bytes_per_second\x18\x04 \x01(\x03\"\x14\n\x12PostProcessingStep\"E\n\x0fReplicationSync\x12\x32\n\x0elast_sync_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"\xd9\x10\n\x0bMigratingVm\x12\x62\n\x1e\x63ompute_engine_target_defaults\x18\x1a \x01(\x0b\x32\x38.google.cloud.vmmigration.v1.ComputeEngineTargetDefaultsH\x00\x12m\n$compute_engine_disks_target_defaults\x18\" \x01(\x0b\x32=.google.cloud.vmmigration.v1.ComputeEngineDisksTargetDefaultsH\x00\x12[\n\x18vmware_source_vm_details\x18\x1c \x01(\x0b\x32\x32.google.cloud.vmmigration.v1.VmwareSourceVmDetailsB\x03\xe0\x41\x03H\x01\x12U\n\x15\x61ws_source_vm_details\x18\x1d \x01(\x0b\x32/.google.cloud.vmmigration.v1.AwsSourceVmDetailsB\x03\xe0\x41\x03H\x01\x12Y\n\x17\x61zure_source_vm_details\x18\x1e \x01(\x0b\x32\x31.google.cloud.vmmigration.v1.AzureSourceVmDetailsB\x03\xe0\x41\x03H\x01\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x14\n\x0csource_vm_id\x18\x02 \x01(\t\x12\x14\n\x0c\x64isplay_name\x18\x12 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x03 \x01(\t\x12;\n\x06policy\x18\x08 \x01(\x0b\x32+.google.cloud.vmmigration.v1.SchedulePolicy\x12\x34\n\x0b\x63reate_time\x18\t \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\n \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x44\n\tlast_sync\x18\x0b \x01(\x0b\x32,.google.cloud.vmmigration.v1.ReplicationSyncB\x03\xe0\x41\x03\x12\x42\n\x05state\x18\x17 \x01(\x0e\x32..google.cloud.vmmigration.v1.MigratingVm.StateB\x03\xe0\x41\x03\x12\x33\n\nstate_time\x18\x16 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12M\n\x11\x63urrent_sync_info\x18\r \x01(\x0b\x32-.google.cloud.vmmigration.v1.ReplicationCycleB\x03\xe0\x41\x03\x12R\n\x16last_replication_cycle\x18 \x01(\x0b\x32-.google.cloud.vmmigration.v1.ReplicationCycleB\x03\xe0\x41\x03\x12\x37\n\x05group\x18\x0f \x01(\tB(\xe0\x41\x03\xfa\x41\"\x12 vmmigration.googleapis.com/Group\x12\x44\n\x06labels\x18\x10 \x03(\x0b\x32\x34.google.cloud.vmmigration.v1.MigratingVm.LabelsEntry\x12\x45\n\x11recent_clone_jobs\x18\x11 \x03(\x0b\x32%.google.cloud.vmmigration.v1.CloneJobB\x03\xe0\x41\x03\x12&\n\x05\x65rror\x18\x13 \x01(\x0b\x32\x12.google.rpc.StatusB\x03\xe0\x41\x03\x12I\n\x13recent_cutover_jobs\x18\x14 \x03(\x0b\x32\'.google.cloud.vmmigration.v1.CutoverJobB\x03\xe0\x41\x03\x12K\n\x10\x63utover_forecast\x18! \x01(\x0b\x32,.google.cloud.vmmigration.v1.CutoverForecastB\x03\xe0\x41\x03\x12L\n\nexpiration\x18% \x01(\x0b\x32\x33.google.cloud.vmmigration.v1.MigratingVm.ExpirationB\x03\xe0\x41\x03\x1ay\n\nExpiration\x12\x34\n\x0b\x65xpire_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x1c\n\x0f\x65xtension_count\x18\x02 \x01(\x05\x42\x03\xe0\x41\x03\x12\x17\n\nextendable\x18\x03 \x01(\x08\x42\x03\xe0\x41\x03\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\xdb\x01\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0b\n\x07PENDING\x10\x01\x12\t\n\x05READY\x10\x02\x12\x0e\n\nFIRST_SYNC\x10\x03\x12\n\n\x06\x41\x43TIVE\x10\x04\x12\x10\n\x0c\x43UTTING_OVER\x10\x07\x12\x0b\n\x07\x43UTOVER\x10\x08\x12\x0e\n\nFINAL_SYNC\x10\t\x12\n\n\x06PAUSED\x10\n\x12\x0e\n\nFINALIZING\x10\x0b\x12\r\n\tFINALIZED\x10\x0c\x12\t\n\x05\x45RROR\x10\r\x12\x0b\n\x07\x45XPIRED\x10\x0e\x12\x15\n\x11\x46INALIZED_EXPIRED\x10\x11:\x81\x01\xea\x41~\n&vmmigration.googleapis.com/MigratingVm\x12Tprojects/{project}/locations/{location}/sources/{source}/migratingVms/{migrating_vm}B\x14\n\x12target_vm_defaultsB\x13\n\x11source_vm_details\"Y\n\x0f\x43utoverForecast\x12\x46\n\x1e\x65stimated_cutover_job_duration\x18\x01 \x01(\x0b\x32\x19.google.protobuf.DurationB\x03\xe0\x41\x03\"\xeb\x06\n\x08\x43loneJob\x12\x65\n\x1d\x63ompute_engine_target_details\x18\x14 \x01(\x0b\x32\x37.google.cloud.vmmigration.v1.ComputeEngineTargetDetailsB\x03\xe0\x41\x03H\x00\x12p\n#compute_engine_disks_target_details\x18\x19 \x01(\x0b\x32<.google.cloud.vmmigration.v1.ComputeEngineDisksTargetDetailsB\x03\xe0\x41\x03H\x00\x12\x34\n\x0b\x63reate_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x31\n\x08\x65nd_time\x18\x16 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x11\n\x04name\x18\x03 \x01(\tB\x03\xe0\x41\x03\x12?\n\x05state\x18\x0c \x01(\x0e\x32+.google.cloud.vmmigration.v1.CloneJob.StateB\x03\xe0\x41\x03\x12\x33\n\nstate_time\x18\x0e \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12&\n\x05\x65rror\x18\x11 \x01(\x0b\x32\x12.google.rpc.StatusB\x03\xe0\x41\x03\x12:\n\x05steps\x18\x17 \x03(\x0b\x32&.google.cloud.vmmigration.v1.CloneStepB\x03\xe0\x41\x03\"\x82\x01\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0b\n\x07PENDING\x10\x01\x12\n\n\x06\x41\x43TIVE\x10\x02\x12\n\n\x06\x46\x41ILED\x10\x03\x12\r\n\tSUCCEEDED\x10\x04\x12\r\n\tCANCELLED\x10\x05\x12\x0e\n\nCANCELLING\x10\x06\x12\x0f\n\x0b\x41\x44\x41PTING_OS\x10\x07:\x95\x01\xea\x41\x91\x01\n#vmmigration.googleapis.com/CloneJob\x12jprojects/{project}/locations/{location}/sources/{source}/migratingVms/{migrating_vm}/cloneJobs/{clone_job}B\x13\n\x11target_vm_details\"\xe5\x02\n\tCloneStep\x12\x42\n\x0b\x61\x64\x61pting_os\x18\x03 \x01(\x0b\x32+.google.cloud.vmmigration.v1.AdaptingOSStepH\x00\x12O\n\x12preparing_vm_disks\x18\x04 \x01(\x0b\x32\x31.google.cloud.vmmigration.v1.PreparingVMDisksStepH\x00\x12]\n\x19instantiating_migrated_vm\x18\x05 \x01(\x0b\x32\x38.google.cloud.vmmigration.v1.InstantiatingMigratedVMStepH\x00\x12.\n\nstart_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12,\n\x08\x65nd_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x06\n\x04step\"\x10\n\x0e\x41\x64\x61ptingOSStep\"\x16\n\x14PreparingVMDisksStep\"\x1d\n\x1bInstantiatingMigratedVMStep\"\xb2\x07\n\nCutoverJob\x12\x65\n\x1d\x63ompute_engine_target_details\x18\x0e \x01(\x0b\x32\x37.google.cloud.vmmigration.v1.ComputeEngineTargetDetailsB\x03\xe0\x41\x03H\x00\x12p\n#compute_engine_disks_target_details\x18\x14 \x01(\x0b\x32<.google.cloud.vmmigration.v1.ComputeEngineDisksTargetDetailsB\x03\xe0\x41\x03H\x00\x12\x34\n\x0b\x63reate_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x31\n\x08\x65nd_time\x18\x10 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x11\n\x04name\x18\x03 \x01(\tB\x03\xe0\x41\x03\x12\x41\n\x05state\x18\x05 \x01(\x0e\x32-.google.cloud.vmmigration.v1.CutoverJob.StateB\x03\xe0\x41\x03\x12\x33\n\nstate_time\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x1d\n\x10progress_percent\x18\r \x01(\x05\x42\x03\xe0\x41\x03\x12&\n\x05\x65rror\x18\t \x01(\x0b\x32\x12.google.rpc.StatusB\x03\xe0\x41\x03\x12\x1a\n\rstate_message\x18\n \x01(\tB\x03\xe0\x41\x03\x12<\n\x05steps\x18\x11 \x03(\x0b\x32(.google.cloud.vmmigration.v1.CutoverStepB\x03\xe0\x41\x03\"\x82\x01\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0b\n\x07PENDING\x10\x01\x12\n\n\x06\x46\x41ILED\x10\x02\x12\r\n\tSUCCEEDED\x10\x03\x12\r\n\tCANCELLED\x10\x04\x12\x0e\n\nCANCELLING\x10\x05\x12\n\n\x06\x41\x43TIVE\x10\x06\x12\x0f\n\x0b\x41\x44\x41PTING_OS\x10\x07:\x9b\x01\xea\x41\x97\x01\n%vmmigration.googleapis.com/CutoverJob\x12nprojects/{project}/locations/{location}/sources/{source}/migratingVms/{migrating_vm}/cutoverJobs/{cutover_job}B\x13\n\x11target_vm_details\"\x97\x04\n\x0b\x43utoverStep\x12S\n\x1aprevious_replication_cycle\x18\x03 \x01(\x0b\x32-.google.cloud.vmmigration.v1.ReplicationCycleH\x00\x12X\n\x17shutting_down_source_vm\x18\x04 \x01(\x0b\x32\x35.google.cloud.vmmigration.v1.ShuttingDownSourceVMStepH\x00\x12\x43\n\nfinal_sync\x18\x05 \x01(\x0b\x32-.google.cloud.vmmigration.v1.ReplicationCycleH\x00\x12O\n\x12preparing_vm_disks\x18\x06 \x01(\x0b\x32\x31.google.cloud.vmmigration.v1.PreparingVMDisksStepH\x00\x12]\n\x19instantiating_migrated_vm\x18\x07 \x01(\x0b\x32\x38.google.cloud.vmmigration.v1.InstantiatingMigratedVMStepH\x00\x12.\n\nstart_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12,\n\x08\x65nd_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x06\n\x04step\"\x1a\n\x18ShuttingDownSourceVMStep\"\xc2\x01\n\x15\x43reateCloneJobRequest\x12;\n\x06parent\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\x12#vmmigration.googleapis.com/CloneJob\x12\x19\n\x0c\x63lone_job_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12=\n\tclone_job\x18\x03 \x01(\x0b\x32%.google.cloud.vmmigration.v1.CloneJobB\x03\xe0\x41\x02\x12\x12\n\nrequest_id\x18\x04 \x01(\t\"R\n\x15\x43\x61ncelCloneJobRequest\x12\x39\n\x04name\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\n#vmmigration.googleapis.com/CloneJob\"\x18\n\x16\x43\x61ncelCloneJobResponse\"\xb0\x01\n\x14ListCloneJobsRequest\x12;\n\x06parent\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\x12#vmmigration.googleapis.com/CloneJob\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\x02\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\x15ListCloneJobsResponse\x12>\n\nclone_jobs\x18\x01 \x03(\x0b\x32%.google.cloud.vmmigration.v1.CloneJobB\x03\xe0\x41\x03\x12\x1c\n\x0fnext_page_token\x18\x02 \x01(\tB\x03\xe0\x41\x03\x12\x18\n\x0bunreachable\x18\x03 \x03(\tB\x03\xe0\x41\x03\"O\n\x12GetCloneJobRequest\x12\x39\n\x04name\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\n#vmmigration.googleapis.com/CloneJob\"\x89\x05\n\x06Source\x12\x42\n\x06vmware\x18\n \x01(\x0b\x32\x30.google.cloud.vmmigration.v1.VmwareSourceDetailsH\x00\x12<\n\x03\x61ws\x18\x0c \x01(\x0b\x32-.google.cloud.vmmigration.v1.AwsSourceDetailsH\x00\x12@\n\x05\x61zure\x18\r \x01(\x0b\x32/.google.cloud.vmmigration.v1.AzureSourceDetailsH\x00\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\x12\x34\n\x0bupdate_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12?\n\x06labels\x18\x04 \x03(\x0b\x32/.google.cloud.vmmigration.v1.Source.LabelsEntry\x12\x13\n\x0b\x64\x65scription\x18\x06 \x01(\t\x12\x43\n\nencryption\x18\x0e \x01(\x0b\x32\'.google.cloud.vmmigration.v1.EncryptionB\x06\xe0\x41\x01\xe0\x41\x05\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01:`\xea\x41]\n!vmmigration.googleapis.com/Source\x12\x38projects/{project}/locations/{location}/sources/{source}B\x10\n\x0esource_details\"H\n\nEncryption\x12:\n\x07kms_key\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!cloudkms.googleapis.com/CryptoKey\"\x85\x01\n\x13VmwareSourceDetails\x12\x10\n\x08username\x18\x01 \x01(\t\x12\x15\n\x08password\x18\x02 \x01(\tB\x03\xe0\x41\x04\x12\x12\n\nvcenter_ip\x18\x03 \x01(\t\x12\x12\n\nthumbprint\x18\x04 \x01(\t\x12\x1d\n\x15resolved_vcenter_host\x18\x05 \x01(\t\"\xb5\x06\n\x10\x41wsSourceDetails\x12^\n\x10\x61\x63\x63\x65ss_key_creds\x18\x0b \x01(\x0b\x32\x42.google.cloud.vmmigration.v1.AwsSourceDetails.AccessKeyCredentialsH\x00\x12\x17\n\naws_region\x18\x03 \x01(\tB\x03\xe0\x41\x05\x12G\n\x05state\x18\x04 \x01(\x0e\x32\x33.google.cloud.vmmigration.v1.AwsSourceDetails.StateB\x03\xe0\x41\x03\x12&\n\x05\x65rror\x18\x05 \x01(\x0b\x32\x12.google.rpc.StatusB\x03\xe0\x41\x03\x12M\n\x12inventory_tag_list\x18\n \x03(\x0b\x32\x31.google.cloud.vmmigration.v1.AwsSourceDetails.Tag\x12&\n\x1einventory_security_group_names\x18\x07 \x03(\t\x12t\n\x1dmigration_resources_user_tags\x18\x08 \x03(\x0b\x32M.google.cloud.vmmigration.v1.AwsSourceDetails.MigrationResourcesUserTagsEntry\x12\x16\n\tpublic_ip\x18\t \x01(\tB\x03\xe0\x41\x03\x1ai\n\x14\x41\x63\x63\x65ssKeyCredentials\x12\x15\n\raccess_key_id\x18\x01 \x01(\t\x12\x1e\n\x11secret_access_key\x18\x02 \x01(\tB\x03\xe0\x41\x04\x12\x1a\n\rsession_token\x18\x03 \x01(\tB\x03\xe0\x41\x04\x1a+\n\x03Tag\x12\x10\n\x03key\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x12\n\x05value\x18\x02 \x01(\tB\x03\xe0\x41\x02\x1a\x41\n\x1fMigrationResourcesUserTagsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"C\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0b\n\x07PENDING\x10\x01\x12\n\n\x06\x46\x41ILED\x10\x02\x12\n\n\x06\x41\x43TIVE\x10\x03\x42\x12\n\x10\x63redentials_type\"\xbb\x05\n\x12\x41zureSourceDetails\x12\x66\n\x13\x63lient_secret_creds\x18\t \x01(\x0b\x32G.google.cloud.vmmigration.v1.AzureSourceDetails.ClientSecretCredentialsH\x00\x12\x1c\n\x0fsubscription_id\x18\x01 \x01(\tB\x03\xe0\x41\x05\x12\x1b\n\x0e\x61zure_location\x18\x05 \x01(\tB\x03\xe0\x41\x05\x12I\n\x05state\x18\x06 \x01(\x0e\x32\x35.google.cloud.vmmigration.v1.AzureSourceDetails.StateB\x03\xe0\x41\x03\x12&\n\x05\x65rror\x18\x07 \x01(\x0b\x32\x12.google.rpc.StatusB\x03\xe0\x41\x03\x12v\n\x1dmigration_resources_user_tags\x18\x08 \x03(\x0b\x32O.google.cloud.vmmigration.v1.AzureSourceDetails.MigrationResourcesUserTagsEntry\x12\x1e\n\x11resource_group_id\x18\n \x01(\tB\x03\xe0\x41\x03\x1a[\n\x17\x43lientSecretCredentials\x12\x11\n\ttenant_id\x18\x01 \x01(\t\x12\x11\n\tclient_id\x18\x02 \x01(\t\x12\x1a\n\rclient_secret\x18\x03 \x01(\tB\x03\xe0\x41\x04\x1a\x41\n\x1fMigrationResourcesUserTagsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"C\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0b\n\x07PENDING\x10\x01\x12\n\n\x06\x46\x41ILED\x10\x02\x12\n\n\x06\x41\x43TIVE\x10\x03\x42\x12\n\x10\x63redentials_type\"\xfa\x06\n\x13\x44\x61tacenterConnector\x12\x34\n\x0b\x63reate_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x11\n\x04name\x18\x03 \x01(\tB\x03\xe0\x41\x03\x12\x1c\n\x0fregistration_id\x18\x0c \x01(\tB\x03\xe0\x41\x05\x12\x17\n\x0fservice_account\x18\x05 \x01(\t\x12\x0f\n\x07version\x18\x06 \x01(\t\x12\x13\n\x06\x62ucket\x18\n \x01(\tB\x03\xe0\x41\x03\x12J\n\x05state\x18\x07 \x01(\x0e\x32\x36.google.cloud.vmmigration.v1.DatacenterConnector.StateB\x03\xe0\x41\x03\x12\x33\n\nstate_time\x18\x08 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12&\n\x05\x65rror\x18\x0b \x01(\x0b\x32\x12.google.rpc.StatusB\x03\xe0\x41\x03\x12-\n appliance_infrastructure_version\x18\r \x01(\tB\x03\xe0\x41\x03\x12\'\n\x1a\x61ppliance_software_version\x18\x0e \x01(\tB\x03\xe0\x41\x03\x12N\n\x12\x61vailable_versions\x18\x0f \x01(\x0b\x32-.google.cloud.vmmigration.v1.AvailableUpdatesB\x03\xe0\x41\x03\x12G\n\x0eupgrade_status\x18\x10 \x01(\x0b\x32*.google.cloud.vmmigration.v1.UpgradeStatusB\x03\xe0\x41\x03\"P\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0b\n\x07PENDING\x10\x01\x12\x0b\n\x07OFFLINE\x10\x02\x12\n\n\x06\x46\x41ILED\x10\x03\x12\n\n\x06\x41\x43TIVE\x10\x04:\x9a\x01\xea\x41\x96\x01\n.vmmigration.googleapis.com/DatacenterConnector\x12\x64projects/{project}/locations/{location}/sources/{source}/datacenterConnectors/{datacenter_connector}\"\x9b\x02\n\rUpgradeStatus\x12\x0f\n\x07version\x18\x01 \x01(\t\x12?\n\x05state\x18\x02 \x01(\x0e\x32\x30.google.cloud.vmmigration.v1.UpgradeStatus.State\x12&\n\x05\x65rror\x18\x03 \x01(\x0b\x32\x12.google.rpc.StatusB\x03\xe0\x41\x03\x12.\n\nstart_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x18\n\x10previous_version\x18\x05 \x01(\t\"F\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0b\n\x07RUNNING\x10\x01\x12\n\n\x06\x46\x41ILED\x10\x02\x12\r\n\tSUCCEEDED\x10\x03\"\xab\x01\n\x10\x41vailableUpdates\x12O\n\x18new_deployable_appliance\x18\x01 \x01(\x0b\x32-.google.cloud.vmmigration.v1.ApplianceVersion\x12\x46\n\x0fin_place_update\x18\x02 \x01(\x0b\x32-.google.cloud.vmmigration.v1.ApplianceVersion\"]\n\x10\x41pplianceVersion\x12\x0f\n\x07version\x18\x01 \x01(\t\x12\x0b\n\x03uri\x18\x02 \x01(\t\x12\x10\n\x08\x63ritical\x18\x03 \x01(\x08\x12\x19\n\x11release_notes_uri\x18\x04 \x01(\t\"\xac\x01\n\x12ListSourcesRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\x12!vmmigration.googleapis.com/Source\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\x02\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\"\x88\x01\n\x13ListSourcesResponse\x12\x39\n\x07sources\x18\x01 \x03(\x0b\x32#.google.cloud.vmmigration.v1.SourceB\x03\xe0\x41\x03\x12\x1c\n\x0fnext_page_token\x18\x02 \x01(\tB\x03\xe0\x41\x03\x12\x18\n\x0bunreachable\x18\x03 \x03(\tB\x03\xe0\x41\x03\"K\n\x10GetSourceRequest\x12\x37\n\x04name\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!vmmigration.googleapis.com/Source\"\xb6\x01\n\x13\x43reateSourceRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\x12!vmmigration.googleapis.com/Source\x12\x16\n\tsource_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x38\n\x06source\x18\x03 \x01(\x0b\x32#.google.cloud.vmmigration.v1.SourceB\x03\xe0\x41\x02\x12\x12\n\nrequest_id\x18\x04 \x01(\t\"\x94\x01\n\x13UpdateSourceRequest\x12/\n\x0bupdate_mask\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\x12\x38\n\x06source\x18\x02 \x01(\x0b\x32#.google.cloud.vmmigration.v1.SourceB\x03\xe0\x41\x02\x12\x12\n\nrequest_id\x18\x03 \x01(\t\"g\n\x13\x44\x65leteSourceRequest\x12\x37\n\x04name\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!vmmigration.googleapis.com/Source\x12\x17\n\nrequest_id\x18\x02 \x01(\tB\x03\xe0\x41\x01\"i\n\x15\x46\x65tchInventoryRequest\x12\x39\n\x06source\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!vmmigration.googleapis.com/Source\x12\x15\n\rforce_refresh\x18\x02 \x01(\x08\"\xde\x05\n\x0fVmwareVmDetails\x12\r\n\x05vm_id\x18\x01 \x01(\t\x12\x15\n\rdatacenter_id\x18\x02 \x01(\t\x12\x1e\n\x16\x64\x61tacenter_description\x18\x03 \x01(\t\x12\x0c\n\x04uuid\x18\x04 \x01(\t\x12\x14\n\x0c\x64isplay_name\x18\x05 \x01(\t\x12L\n\x0bpower_state\x18\x06 \x01(\x0e\x32\x37.google.cloud.vmmigration.v1.VmwareVmDetails.PowerState\x12\x11\n\tcpu_count\x18\x07 \x01(\x05\x12\x11\n\tmemory_mb\x18\x08 \x01(\x05\x12\x12\n\ndisk_count\x18\t \x01(\x05\x12\x1c\n\x14\x63ommitted_storage_mb\x18\x0c \x01(\x03\x12\x19\n\x11guest_description\x18\x0b \x01(\t\x12Q\n\x0b\x62oot_option\x18\r \x01(\x0e\x32\x37.google.cloud.vmmigration.v1.VmwareVmDetails.BootOptionB\x03\xe0\x41\x03\x12V\n\x0c\x61rchitecture\x18\x0e \x01(\x0e\x32;.google.cloud.vmmigration.v1.VmwareVmDetails.VmArchitectureB\x03\xe0\x41\x03\"I\n\nPowerState\x12\x1b\n\x17POWER_STATE_UNSPECIFIED\x10\x00\x12\x06\n\x02ON\x10\x01\x12\x07\n\x03OFF\x10\x02\x12\r\n\tSUSPENDED\x10\x03\"<\n\nBootOption\x12\x1b\n\x17\x42OOT_OPTION_UNSPECIFIED\x10\x00\x12\x07\n\x03\x45\x46I\x10\x01\x12\x08\n\x04\x42IOS\x10\x02\"l\n\x0eVmArchitecture\x12\x1f\n\x1bVM_ARCHITECTURE_UNSPECIFIED\x10\x00\x12\x1e\n\x1aVM_ARCHITECTURE_X86_FAMILY\x10\x01\x12\x19\n\x15VM_ARCHITECTURE_ARM64\x10\x02\"\xef\x08\n\x0c\x41wsVmDetails\x12\r\n\x05vm_id\x18\x01 \x01(\t\x12\x14\n\x0c\x64isplay_name\x18\x02 \x01(\t\x12\x11\n\tsource_id\x18\x03 \x01(\t\x12\x1a\n\x12source_description\x18\x04 \x01(\t\x12N\n\x0bpower_state\x18\x05 \x01(\x0e\x32\x34.google.cloud.vmmigration.v1.AwsVmDetails.PowerStateB\x03\xe0\x41\x03\x12\x11\n\tcpu_count\x18\x06 \x01(\x05\x12\x11\n\tmemory_mb\x18\x07 \x01(\x05\x12\x12\n\ndisk_count\x18\x08 \x01(\x05\x12\x1c\n\x14\x63ommitted_storage_mb\x18\t \x01(\x03\x12\x16\n\x0eos_description\x18\n \x01(\t\x12I\n\x0b\x62oot_option\x18\x0b \x01(\x0e\x32\x34.google.cloud.vmmigration.v1.AwsVmDetails.BootOption\x12\x15\n\rinstance_type\x18\x0c \x01(\t\x12\x0e\n\x06vpc_id\x18\r \x01(\t\x12\x46\n\x0fsecurity_groups\x18\x0e \x03(\x0b\x32-.google.cloud.vmmigration.v1.AwsSecurityGroup\x12\x41\n\x04tags\x18\x0f \x03(\x0b\x32\x33.google.cloud.vmmigration.v1.AwsVmDetails.TagsEntry\x12\x0c\n\x04zone\x18\x10 \x01(\t\x12[\n\x13virtualization_type\x18\x11 \x01(\x0e\x32>.google.cloud.vmmigration.v1.AwsVmDetails.VmVirtualizationType\x12N\n\x0c\x61rchitecture\x18\x12 \x01(\x0e\x32\x38.google.cloud.vmmigration.v1.AwsVmDetails.VmArchitecture\x12\x12\n\nvcpu_count\x18\x13 \x01(\x05\x1a+\n\tTagsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"V\n\nPowerState\x12\x1b\n\x17POWER_STATE_UNSPECIFIED\x10\x00\x12\x06\n\x02ON\x10\x01\x12\x07\n\x03OFF\x10\x02\x12\r\n\tSUSPENDED\x10\x03\x12\x0b\n\x07PENDING\x10\x04\"<\n\nBootOption\x12\x1b\n\x17\x42OOT_OPTION_UNSPECIFIED\x10\x00\x12\x07\n\x03\x45\x46I\x10\x01\x12\x08\n\x04\x42IOS\x10\x02\"X\n\x14VmVirtualizationType\x12&\n\"VM_VIRTUALIZATION_TYPE_UNSPECIFIED\x10\x00\x12\x07\n\x03HVM\x10\x01\x12\x0f\n\x0bPARAVIRTUAL\x10\x02\"b\n\x0eVmArchitecture\x12\x1f\n\x1bVM_ARCHITECTURE_UNSPECIFIED\x10\x00\x12\x08\n\x04I386\x10\x01\x12\n\n\x06X86_64\x10\x02\x12\t\n\x05\x41RM64\x10\x03\x12\x0e\n\nX86_64_MAC\x10\x04\",\n\x10\x41wsSecurityGroup\x12\n\n\x02id\x18\x01 \x01(\t\x12\x0c\n\x04name\x18\x02 \x01(\t\"\xce\t\n\x0e\x41zureVmDetails\x12\r\n\x05vm_id\x18\x01 \x01(\t\x12K\n\x0bpower_state\x18\x02 \x01(\x0e\x32\x36.google.cloud.vmmigration.v1.AzureVmDetails.PowerState\x12\x0f\n\x07vm_size\x18\x03 \x01(\t\x12\x11\n\tcpu_count\x18\x04 \x01(\x05\x12\x11\n\tmemory_mb\x18\x05 \x01(\x05\x12\x12\n\ndisk_count\x18\x06 \x01(\x05\x12\x1c\n\x14\x63ommitted_storage_mb\x18\x07 \x01(\x03\x12\x43\n\x07os_disk\x18\x08 \x01(\x0b\x32\x32.google.cloud.vmmigration.v1.AzureVmDetails.OSDisk\x12?\n\x05\x64isks\x18\t \x03(\x0b\x32\x30.google.cloud.vmmigration.v1.AzureVmDetails.Disk\x12Q\n\x0eos_description\x18\n \x01(\x0b\x32\x39.google.cloud.vmmigration.v1.AzureVmDetails.OSDescription\x12K\n\x0b\x62oot_option\x18\x0b \x01(\x0e\x32\x36.google.cloud.vmmigration.v1.AzureVmDetails.BootOption\x12\x43\n\x04tags\x18\x0c \x03(\x0b\x32\x35.google.cloud.vmmigration.v1.AzureVmDetails.TagsEntry\x12\x15\n\rcomputer_name\x18\r \x01(\t\x12P\n\x0c\x61rchitecture\x18\x0e \x01(\x0e\x32:.google.cloud.vmmigration.v1.AzureVmDetails.VmArchitecture\x1a\x35\n\x06OSDisk\x12\x0c\n\x04type\x18\x01 \x01(\t\x12\x0c\n\x04name\x18\x02 \x01(\t\x12\x0f\n\x07size_gb\x18\x03 \x01(\x05\x1a\x32\n\x04\x44isk\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x0f\n\x07size_gb\x18\x02 \x01(\x05\x12\x0b\n\x03lun\x18\x03 \x01(\x05\x1aM\n\rOSDescription\x12\x0c\n\x04type\x18\x01 \x01(\t\x12\x11\n\tpublisher\x18\x02 \x01(\t\x12\r\n\x05offer\x18\x03 \x01(\t\x12\x0c\n\x04plan\x18\x04 \x01(\t\x1a+\n\tTagsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\x8f\x01\n\nPowerState\x12\x1b\n\x17POWER_STATE_UNSPECIFIED\x10\x00\x12\x0c\n\x08STARTING\x10\x01\x12\x0b\n\x07RUNNING\x10\x02\x12\x0c\n\x08STOPPING\x10\x03\x12\x0b\n\x07STOPPED\x10\x04\x12\x10\n\x0c\x44\x45\x41LLOCATING\x10\x05\x12\x0f\n\x0b\x44\x45\x41LLOCATED\x10\x06\x12\x0b\n\x07UNKNOWN\x10\x07\"<\n\nBootOption\x12\x1b\n\x17\x42OOT_OPTION_UNSPECIFIED\x10\x00\x12\x07\n\x03\x45\x46I\x10\x01\x12\x08\n\x04\x42IOS\x10\x02\"l\n\x0eVmArchitecture\x12\x1f\n\x1bVM_ARCHITECTURE_UNSPECIFIED\x10\x00\x12\x1e\n\x1aVM_ARCHITECTURE_X86_FAMILY\x10\x01\x12\x19\n\x15VM_ARCHITECTURE_ARM64\x10\x02\"Q\n\x10VmwareVmsDetails\x12=\n\x07\x64\x65tails\x18\x01 \x03(\x0b\x32,.google.cloud.vmmigration.v1.VmwareVmDetails\"K\n\rAwsVmsDetails\x12:\n\x07\x64\x65tails\x18\x01 \x03(\x0b\x32).google.cloud.vmmigration.v1.AwsVmDetails\"O\n\x0f\x41zureVmsDetails\x12<\n\x07\x64\x65tails\x18\x01 \x03(\x0b\x32+.google.cloud.vmmigration.v1.AzureVmDetails\"\xa2\x02\n\x16\x46\x65tchInventoryResponse\x12\x43\n\nvmware_vms\x18\x01 \x01(\x0b\x32-.google.cloud.vmmigration.v1.VmwareVmsDetailsH\x00\x12=\n\x07\x61ws_vms\x18\x03 \x01(\x0b\x32*.google.cloud.vmmigration.v1.AwsVmsDetailsH\x00\x12\x41\n\tazure_vms\x18\x05 \x01(\x0b\x32,.google.cloud.vmmigration.v1.AzureVmsDetailsH\x00\x12\x34\n\x0bupdate_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x42\x0b\n\tSourceVms\"\xc7\x02\n\x1c\x46\x65tchStorageInventoryRequest\x12\x39\n\x06source\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!vmmigration.googleapis.com/Source\x12X\n\x04type\x18\x02 \x01(\x0e\x32\x45.google.cloud.vmmigration.v1.FetchStorageInventoryRequest.StorageTypeB\x03\xe0\x41\x02\x12\x1a\n\rforce_refresh\x18\x03 \x01(\x08\x42\x03\xe0\x41\x01\x12\x16\n\tpage_size\x18\x04 \x01(\x05\x42\x03\xe0\x41\x01\x12\x17\n\npage_token\x18\x05 \x01(\tB\x03\xe0\x41\x01\"E\n\x0bStorageType\x12\x1c\n\x18STORAGE_TYPE_UNSPECIFIED\x10\x00\x12\t\n\x05\x44ISKS\x10\x01\x12\r\n\tSNAPSHOTS\x10\x02\"\xba\x01\n\x1d\x46\x65tchStorageInventoryResponse\x12\x45\n\tresources\x18\x01 \x03(\x0b\x32\x32.google.cloud.vmmigration.v1.SourceStorageResource\x12\x34\n\x0bupdate_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x1c\n\x0fnext_page_token\x18\x03 \x01(\tB\x03\xe0\x41\x03\"y\n\x15SourceStorageResource\x12M\n\x10\x61ws_disk_details\x18\x01 \x01(\x0b\x32\x31.google.cloud.vmmigration.v1.AwsSourceDiskDetailsH\x00\x42\x11\n\x0fStorageResource\"\x9c\x06\n\x11UtilizationReport\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x14\n\x0c\x64isplay_name\x18\x02 \x01(\t\x12H\n\x05state\x18\x03 \x01(\x0e\x32\x34.google.cloud.vmmigration.v1.UtilizationReport.StateB\x03\xe0\x41\x03\x12\x33\n\nstate_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12&\n\x05\x65rror\x18\x05 \x01(\x0b\x32\x12.google.rpc.StatusB\x03\xe0\x41\x03\x12\x34\n\x0b\x63reate_time\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12L\n\ntime_frame\x18\x07 \x01(\x0e\x32\x38.google.cloud.vmmigration.v1.UtilizationReport.TimeFrame\x12\x37\n\x0e\x66rame_end_time\x18\x08 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x15\n\x08vm_count\x18\t \x01(\x05\x42\x03\xe0\x41\x03\x12;\n\x03vms\x18\n \x03(\x0b\x32..google.cloud.vmmigration.v1.VmUtilizationInfo\"G\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0c\n\x08\x43REATING\x10\x01\x12\r\n\tSUCCEEDED\x10\x02\x12\n\n\x06\x46\x41ILED\x10\x03\"F\n\tTimeFrame\x12\x1a\n\x16TIME_FRAME_UNSPECIFIED\x10\x00\x12\x08\n\x04WEEK\x10\x01\x12\t\n\x05MONTH\x10\x02\x12\x08\n\x04YEAR\x10\x03:\x94\x01\xea\x41\x90\x01\n,vmmigration.googleapis.com/UtilizationReport\x12`projects/{project}/locations/{location}/sources/{source}/utilizationReports/{utilization_report}\"\xc2\x01\n\x11VmUtilizationInfo\x12I\n\x11vmware_vm_details\x18\x01 \x01(\x0b\x32,.google.cloud.vmmigration.v1.VmwareVmDetailsH\x00\x12\r\n\x05vm_id\x18\x03 \x01(\t\x12\x46\n\x0butilization\x18\x02 \x01(\x0b\x32\x31.google.cloud.vmmigration.v1.VmUtilizationMetricsB\x0b\n\tVmDetails\"\x98\x02\n\x14VmUtilizationMetrics\x12\x17\n\x0f\x63pu_max_percent\x18\t \x01(\x05\x12\x1b\n\x13\x63pu_average_percent\x18\n \x01(\x05\x12\x1a\n\x12memory_max_percent\x18\x0b \x01(\x05\x12\x1e\n\x16memory_average_percent\x18\x0c \x01(\x05\x12\x1d\n\x15\x64isk_io_rate_max_kbps\x18\r \x01(\x03\x12!\n\x19\x64isk_io_rate_average_kbps\x18\x0e \x01(\x03\x12#\n\x1bnetwork_throughput_max_kbps\x18\x0f \x01(\x03\x12\'\n\x1fnetwork_throughput_average_kbps\x18\x10 \x01(\x03\"\x89\x02\n\x1dListUtilizationReportsRequest\x12\x44\n\x06parent\x18\x01 \x01(\tB4\xe0\x41\x02\xfa\x41.\x12,vmmigration.googleapis.com/UtilizationReport\x12\x45\n\x04view\x18\x02 \x01(\x0e\x32\x32.google.cloud.vmmigration.v1.UtilizationReportViewB\x03\xe0\x41\x01\x12\x16\n\tpage_size\x18\x03 \x01(\x05\x42\x03\xe0\x41\x01\x12\x17\n\npage_token\x18\x04 \x01(\tB\x03\xe0\x41\x02\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\"\xaa\x01\n\x1eListUtilizationReportsResponse\x12P\n\x13utilization_reports\x18\x01 \x03(\x0b\x32..google.cloud.vmmigration.v1.UtilizationReportB\x03\xe0\x41\x03\x12\x1c\n\x0fnext_page_token\x18\x02 \x01(\tB\x03\xe0\x41\x03\x12\x18\n\x0bunreachable\x18\x03 \x03(\tB\x03\xe0\x41\x03\"\xa8\x01\n\x1bGetUtilizationReportRequest\x12\x42\n\x04name\x18\x01 \x01(\tB4\xe0\x41\x02\xfa\x41.\n,vmmigration.googleapis.com/UtilizationReport\x12\x45\n\x04view\x18\x02 \x01(\x0e\x32\x32.google.cloud.vmmigration.v1.UtilizationReportViewB\x03\xe0\x41\x01\"\xef\x01\n\x1e\x43reateUtilizationReportRequest\x12\x44\n\x06parent\x18\x01 \x01(\tB4\xe0\x41\x02\xfa\x41.\x12,vmmigration.googleapis.com/UtilizationReport\x12O\n\x12utilization_report\x18\x02 \x01(\x0b\x32..google.cloud.vmmigration.v1.UtilizationReportB\x03\xe0\x41\x02\x12\"\n\x15utilization_report_id\x18\x03 \x01(\tB\x03\xe0\x41\x02\x12\x12\n\nrequest_id\x18\x04 \x01(\t\"}\n\x1e\x44\x65leteUtilizationReportRequest\x12\x42\n\x04name\x18\x01 \x01(\tB4\xe0\x41\x02\xfa\x41.\n,vmmigration.googleapis.com/UtilizationReport\x12\x17\n\nrequest_id\x18\x02 \x01(\tB\x03\xe0\x41\x01\"\xb0\x01\n ListDatacenterConnectorsResponse\x12T\n\x15\x64\x61tacenter_connectors\x18\x01 \x03(\x0b\x32\x30.google.cloud.vmmigration.v1.DatacenterConnectorB\x03\xe0\x41\x03\x12\x1c\n\x0fnext_page_token\x18\x02 \x01(\tB\x03\xe0\x41\x03\x12\x18\n\x0bunreachable\x18\x03 \x03(\tB\x03\xe0\x41\x03\"e\n\x1dGetDatacenterConnectorRequest\x12\x44\n\x04name\x18\x01 \x01(\tB6\xe0\x41\x02\xfa\x41\x30\n.vmmigration.googleapis.com/DatacenterConnector\"\xf9\x01\n CreateDatacenterConnectorRequest\x12\x46\n\x06parent\x18\x01 \x01(\tB6\xe0\x41\x02\xfa\x41\x30\x12.vmmigration.googleapis.com/DatacenterConnector\x12$\n\x17\x64\x61tacenter_connector_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12S\n\x14\x64\x61tacenter_connector\x18\x03 \x01(\x0b\x32\x30.google.cloud.vmmigration.v1.DatacenterConnectorB\x03\xe0\x41\x02\x12\x12\n\nrequest_id\x18\x04 \x01(\t\"|\n DeleteDatacenterConnectorRequest\x12\x44\n\x04name\x18\x01 \x01(\tB6\xe0\x41\x02\xfa\x41\x30\n.vmmigration.googleapis.com/DatacenterConnector\x12\x12\n\nrequest_id\x18\x02 \x01(\t\"\x83\x01\n\x17UpgradeApplianceRequest\x12T\n\x14\x64\x61tacenter_connector\x18\x01 \x01(\tB6\xe0\x41\x02\xfa\x41\x30\n.vmmigration.googleapis.com/DatacenterConnector\x12\x12\n\nrequest_id\x18\x02 \x01(\t\"\x1a\n\x18UpgradeApplianceResponse\"\xc6\x01\n\x1fListDatacenterConnectorsRequest\x12\x46\n\x06parent\x18\x01 \x01(\tB6\xe0\x41\x02\xfa\x41\x30\x12.vmmigration.googleapis.com/DatacenterConnector\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\x02\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\"\xe8\n\n\x1b\x43omputeEngineTargetDefaults\x12\x0f\n\x07vm_name\x18\x01 \x01(\t\x12\x45\n\x0etarget_project\x18\x02 \x01(\tB-\xfa\x41*\n(vmmigration.googleapis.com/TargetProject\x12\x0c\n\x04zone\x18\x03 \x01(\t\x12\x1b\n\x13machine_type_series\x18\x04 \x01(\t\x12\x14\n\x0cmachine_type\x18\x05 \x01(\t\x12\x14\n\x0cnetwork_tags\x18\x06 \x03(\t\x12I\n\x12network_interfaces\x18\x07 \x03(\x0b\x32-.google.cloud.vmmigration.v1.NetworkInterface\x12\x1c\n\x0fservice_account\x18\x08 \x01(\tB\x03\xe0\x41\x01\x12\x45\n\tdisk_type\x18\t \x01(\x0e\x32\x32.google.cloud.vmmigration.v1.ComputeEngineDiskType\x12T\n\x06labels\x18\n \x03(\x0b\x32\x44.google.cloud.vmmigration.v1.ComputeEngineTargetDefaults.LabelsEntry\x12K\n\x0clicense_type\x18\x0b \x01(\x0e\x32\x35.google.cloud.vmmigration.v1.ComputeEngineLicenseType\x12I\n\x0f\x61pplied_license\x18\x0c \x01(\x0b\x32+.google.cloud.vmmigration.v1.AppliedLicenseB\x03\xe0\x41\x03\x12J\n\x12\x63ompute_scheduling\x18\r \x01(\x0b\x32..google.cloud.vmmigration.v1.ComputeScheduling\x12\x13\n\x0bsecure_boot\x18\x0e \x01(\x08\x12\x18\n\x0b\x65nable_vtpm\x18\x15 \x01(\x08\x42\x03\xe0\x41\x01\x12(\n\x1b\x65nable_integrity_monitoring\x18\x16 \x01(\x08\x42\x03\xe0\x41\x01\x12N\n\x0b\x62oot_option\x18\x0f \x01(\x0e\x32\x34.google.cloud.vmmigration.v1.ComputeEngineBootOptionB\x03\xe0\x41\x03\x12X\n\x08metadata\x18\x10 \x03(\x0b\x32\x46.google.cloud.vmmigration.v1.ComputeEngineTargetDefaults.MetadataEntry\x12\x1b\n\x13\x61\x64\x64itional_licenses\x18\x11 \x03(\t\x12\x10\n\x08hostname\x18\x12 \x01(\t\x12\x43\n\nencryption\x18\x13 \x01(\x0b\x32\'.google.cloud.vmmigration.v1.EncryptionB\x06\xe0\x41\x01\xe0\x41\x05\x12I\n\x0f\x62oot_conversion\x18\x14 \x01(\x0e\x32+.google.cloud.vmmigration.v1.BootConversionB\x03\xe0\x41\x01\x12R\n\x14\x61\x64\x61ptation_modifiers\x18\x17 \x03(\x0b\x32/.google.cloud.vmmigration.v1.AdaptationModifierB\x03\xe0\x41\x01\x12\x1f\n\x12\x64isk_replica_zones\x18\x18 \x03(\tB\x03\xe0\x41\x01\x12\x19\n\x0cstorage_pool\x18\x19 \x01(\tB\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\x1a/\n\rMetadataEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"?\n\x12\x41\x64\x61ptationModifier\x12\x15\n\x08modifier\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12\x12\n\x05value\x18\x02 \x01(\tB\x03\xe0\x41\x01\"\x9d\n\n\x1a\x43omputeEngineTargetDetails\x12\x0f\n\x07vm_name\x18\x01 \x01(\t\x12\x0f\n\x07project\x18\x02 \x01(\t\x12\x0c\n\x04zone\x18\x03 \x01(\t\x12\x1b\n\x13machine_type_series\x18\x04 \x01(\t\x12\x14\n\x0cmachine_type\x18\x05 \x01(\t\x12\x14\n\x0cnetwork_tags\x18\x06 \x03(\t\x12I\n\x12network_interfaces\x18\x07 \x03(\x0b\x32-.google.cloud.vmmigration.v1.NetworkInterface\x12\x17\n\x0fservice_account\x18\x08 \x01(\t\x12\x45\n\tdisk_type\x18\t \x01(\x0e\x32\x32.google.cloud.vmmigration.v1.ComputeEngineDiskType\x12S\n\x06labels\x18\n \x03(\x0b\x32\x43.google.cloud.vmmigration.v1.ComputeEngineTargetDetails.LabelsEntry\x12K\n\x0clicense_type\x18\x0b \x01(\x0e\x32\x35.google.cloud.vmmigration.v1.ComputeEngineLicenseType\x12\x44\n\x0f\x61pplied_license\x18\x0c \x01(\x0b\x32+.google.cloud.vmmigration.v1.AppliedLicense\x12J\n\x12\x63ompute_scheduling\x18\r \x01(\x0b\x32..google.cloud.vmmigration.v1.ComputeScheduling\x12\x13\n\x0bsecure_boot\x18\x0e \x01(\x08\x12\x18\n\x0b\x65nable_vtpm\x18\x15 \x01(\x08\x42\x03\xe0\x41\x01\x12(\n\x1b\x65nable_integrity_monitoring\x18\x16 \x01(\x08\x42\x03\xe0\x41\x01\x12I\n\x0b\x62oot_option\x18\x0f \x01(\x0e\x32\x34.google.cloud.vmmigration.v1.ComputeEngineBootOption\x12W\n\x08metadata\x18\x10 \x03(\x0b\x32\x45.google.cloud.vmmigration.v1.ComputeEngineTargetDetails.MetadataEntry\x12\x1b\n\x13\x61\x64\x64itional_licenses\x18\x11 \x03(\t\x12\x10\n\x08hostname\x18\x12 \x01(\t\x12@\n\nencryption\x18\x13 \x01(\x0b\x32\'.google.cloud.vmmigration.v1.EncryptionB\x03\xe0\x41\x01\x12I\n\x0f\x62oot_conversion\x18\x14 \x01(\x0e\x32+.google.cloud.vmmigration.v1.BootConversionB\x03\xe0\x41\x01\x12R\n\x14\x61\x64\x61ptation_modifiers\x18\x17 \x03(\x0b\x32/.google.cloud.vmmigration.v1.AdaptationModifierB\x03\xe0\x41\x01\x12\x1f\n\x12\x64isk_replica_zones\x18\x18 \x03(\tB\x03\xe0\x41\x01\x12\x19\n\x0cstorage_pool\x18\x19 \x01(\tB\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\x1a/\n\rMetadataEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\xc7\x01\n\x10NetworkInterface\x12\x14\n\x07network\x18\x01 \x01(\tB\x03\xe0\x41\x01\x12\x17\n\nsubnetwork\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x18\n\x0binternal_ip\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12\x18\n\x0b\x65xternal_ip\x18\x04 \x01(\tB\x03\xe0\x41\x01\x12P\n\x0cnetwork_tier\x18\x05 \x01(\x0e\x32\x35.google.cloud.vmmigration.v1.ComputeEngineNetworkTierB\x03\xe0\x41\x01\"\xa0\x01\n\x0e\x41ppliedLicense\x12>\n\x04type\x18\x01 \x01(\x0e\x32\x30.google.cloud.vmmigration.v1.AppliedLicense.Type\x12\x12\n\nos_license\x18\x02 \x01(\t\":\n\x04Type\x12\x14\n\x10TYPE_UNSPECIFIED\x10\x00\x12\x08\n\x04NONE\x10\x01\x12\x08\n\x04PAYG\x10\x02\x12\x08\n\x04\x42YOL\x10\x03\"\xbf\x01\n\x16SchedulingNodeAffinity\x12\x0b\n\x03key\x18\x01 \x01(\t\x12N\n\x08operator\x18\x02 \x01(\x0e\x32<.google.cloud.vmmigration.v1.SchedulingNodeAffinity.Operator\x12\x0e\n\x06values\x18\x03 \x03(\t\"8\n\x08Operator\x12\x18\n\x14OPERATOR_UNSPECIFIED\x10\x00\x12\x06\n\x02IN\x10\x01\x12\n\n\x06NOT_IN\x10\x02\"\xdd\x03\n\x11\x43omputeScheduling\x12]\n\x13on_host_maintenance\x18\x01 \x01(\x0e\x32@.google.cloud.vmmigration.v1.ComputeScheduling.OnHostMaintenance\x12P\n\x0crestart_type\x18\x05 \x01(\x0e\x32:.google.cloud.vmmigration.v1.ComputeScheduling.RestartType\x12L\n\x0fnode_affinities\x18\x03 \x03(\x0b\x32\x33.google.cloud.vmmigration.v1.SchedulingNodeAffinity\x12\x15\n\rmin_node_cpus\x18\x04 \x01(\x05\"T\n\x11OnHostMaintenance\x12#\n\x1fON_HOST_MAINTENANCE_UNSPECIFIED\x10\x00\x12\r\n\tTERMINATE\x10\x01\x12\x0b\n\x07MIGRATE\x10\x02\"\\\n\x0bRestartType\x12\x1c\n\x18RESTART_TYPE_UNSPECIFIED\x10\x00\x12\x15\n\x11\x41UTOMATIC_RESTART\x10\x01\x12\x18\n\x14NO_AUTOMATIC_RESTART\x10\x02\"\x92\x03\n ComputeEngineDisksTargetDefaults\x12\x0e\n\x04zone\x18\x02 \x01(\tH\x00\x12_\n\x15\x64isks_target_defaults\x18\x05 \x01(\x0b\x32>.google.cloud.vmmigration.v1.DisksMigrationDisksTargetDefaultsH\x01\x12Y\n\x12vm_target_defaults\x18\x06 \x01(\x0b\x32;.google.cloud.vmmigration.v1.DisksMigrationVmTargetDefaultsH\x01\x12\x45\n\x0etarget_project\x18\x01 \x01(\tB-\xfa\x41*\n(vmmigration.googleapis.com/TargetProject\x12\x42\n\x05\x64isks\x18\x04 \x03(\x0b\x32\x33.google.cloud.vmmigration.v1.PersistentDiskDefaultsB\n\n\x08locationB\x0b\n\tvm_target\"\xcf\x03\n\x16PersistentDiskDefaults\x12\x1f\n\x12source_disk_number\x18\x01 \x01(\x05\x42\x03\xe0\x41\x02\x12\x16\n\tdisk_name\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x45\n\tdisk_type\x18\x03 \x01(\x0e\x32\x32.google.cloud.vmmigration.v1.ComputeEngineDiskType\x12\x64\n\x11\x61\x64\x64itional_labels\x18\x04 \x03(\x0b\x32I.google.cloud.vmmigration.v1.PersistentDiskDefaults.AdditionalLabelsEntry\x12@\n\nencryption\x18\x05 \x01(\x0b\x32\'.google.cloud.vmmigration.v1.EncryptionB\x03\xe0\x41\x01\x12T\n\x15vm_attachment_details\x18\x06 \x01(\x0b\x32\x30.google.cloud.vmmigration.v1.VmAttachmentDetailsB\x03\xe0\x41\x01\x1a\x37\n\x15\x41\x64\x64itionalLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"/\n\x13VmAttachmentDetails\x12\x18\n\x0b\x64\x65vice_name\x18\x01 \x01(\tB\x03\xe0\x41\x01\"#\n!DisksMigrationDisksTargetDefaults\"\x96\x07\n\x1e\x44isksMigrationVmTargetDefaults\x12\x14\n\x07vm_name\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12 \n\x13machine_type_series\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x19\n\x0cmachine_type\x18\x03 \x01(\tB\x03\xe0\x41\x02\x12\x19\n\x0cnetwork_tags\x18\x04 \x03(\tB\x03\xe0\x41\x01\x12N\n\x12network_interfaces\x18\x05 \x03(\x0b\x32-.google.cloud.vmmigration.v1.NetworkInterfaceB\x03\xe0\x41\x01\x12\x1c\n\x0fservice_account\x18\x06 \x01(\tB\x03\xe0\x41\x01\x12O\n\x12\x63ompute_scheduling\x18\x07 \x01(\x0b\x32..google.cloud.vmmigration.v1.ComputeSchedulingB\x03\xe0\x41\x01\x12\x18\n\x0bsecure_boot\x18\x08 \x01(\x08\x42\x03\xe0\x41\x01\x12\x18\n\x0b\x65nable_vtpm\x18\x10 \x01(\x08\x42\x03\xe0\x41\x01\x12(\n\x1b\x65nable_integrity_monitoring\x18\x11 \x01(\x08\x42\x03\xe0\x41\x01\x12`\n\x08metadata\x18\n \x03(\x0b\x32I.google.cloud.vmmigration.v1.DisksMigrationVmTargetDefaults.MetadataEntryB\x03\xe0\x41\x01\x12 \n\x13\x61\x64\x64itional_licenses\x18\x0b \x03(\tB\x03\xe0\x41\x01\x12\x15\n\x08hostname\x18\x0c \x01(\tB\x03\xe0\x41\x01\x12\\\n\x06labels\x18\r \x03(\x0b\x32G.google.cloud.vmmigration.v1.DisksMigrationVmTargetDefaults.LabelsEntryB\x03\xe0\x41\x01\x12N\n\x12\x62oot_disk_defaults\x18\x0e \x01(\x0b\x32-.google.cloud.vmmigration.v1.BootDiskDefaultsB\x03\xe0\x41\x01\x12@\n\nencryption\x18\x0f \x01(\x0b\x32\'.google.cloud.vmmigration.v1.EncryptionB\x03\xe0\x41\x01\x1a/\n\rMetadataEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\xff\x02\n\x10\x42ootDiskDefaults\x12P\n\x05image\x18\x03 \x01(\x0b\x32?.google.cloud.vmmigration.v1.BootDiskDefaults.DiskImageDefaultsH\x00\x12\x16\n\tdisk_name\x18\x01 \x01(\tB\x03\xe0\x41\x01\x12J\n\tdisk_type\x18\x02 \x01(\x0e\x32\x32.google.cloud.vmmigration.v1.ComputeEngineDiskTypeB\x03\xe0\x41\x01\x12\x18\n\x0b\x64\x65vice_name\x18\x04 \x01(\tB\x03\xe0\x41\x01\x12@\n\nencryption\x18\x05 \x01(\x0b\x32\'.google.cloud.vmmigration.v1.EncryptionB\x03\xe0\x41\x01\x1aO\n\x11\x44iskImageDefaults\x12:\n\x0csource_image\x18\x01 \x01(\tB$\xe0\x41\x02\xfa\x41\x1e\n\x1c\x63ompute.googleapis.com/ImageB\x08\n\x06source\"\xa2\x02\n\x1f\x43omputeEngineDisksTargetDetails\x12]\n\x14\x64isks_target_details\x18\x05 \x01(\x0b\x32=.google.cloud.vmmigration.v1.DisksMigrationDisksTargetDetailsH\x00\x12W\n\x11vm_target_details\x18\x06 \x01(\x0b\x32:.google.cloud.vmmigration.v1.DisksMigrationVmTargetDetailsH\x00\x12:\n\x05\x64isks\x18\x01 \x03(\x0b\x32+.google.cloud.vmmigration.v1.PersistentDiskB\x0b\n\tvm_target\">\n\x0ePersistentDisk\x12\x1a\n\x12source_disk_number\x18\x01 \x01(\x05\x12\x10\n\x08\x64isk_uri\x18\x02 \x01(\t\"\"\n DisksMigrationDisksTargetDetails\"4\n\x1d\x44isksMigrationVmTargetDetails\x12\x13\n\x06vm_uri\x18\x01 \x01(\tB\x03\xe0\x41\x03\"^\n\x0eSchedulePolicy\x12\x30\n\ridle_duration\x18\x01 \x01(\x0b\x32\x19.google.protobuf.Duration\x12\x1a\n\x12skip_os_adaptation\x18\x02 \x01(\x08\"\xd1\x01\n\x18\x43reateMigratingVmRequest\x12>\n\x06parent\x18\x01 \x01(\tB.\xe0\x41\x02\xfa\x41(\x12&vmmigration.googleapis.com/MigratingVm\x12\x1c\n\x0fmigrating_vm_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x43\n\x0cmigrating_vm\x18\x03 \x01(\x0b\x32(.google.cloud.vmmigration.v1.MigratingVmB\x03\xe0\x41\x02\x12\x12\n\nrequest_id\x18\x04 \x01(\t\"\xf7\x01\n\x17ListMigratingVmsRequest\x12>\n\x06parent\x18\x01 \x01(\tB.\xe0\x41\x02\xfa\x41(\x12&vmmigration.googleapis.com/MigratingVm\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\x02\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?\n\x04view\x18\x06 \x01(\x0e\x32,.google.cloud.vmmigration.v1.MigratingVmViewB\x03\xe0\x41\x01\"\x98\x01\n\x18ListMigratingVmsResponse\x12\x44\n\rmigrating_vms\x18\x01 \x03(\x0b\x32(.google.cloud.vmmigration.v1.MigratingVmB\x03\xe0\x41\x03\x12\x1c\n\x0fnext_page_token\x18\x02 \x01(\tB\x03\xe0\x41\x03\x12\x18\n\x0bunreachable\x18\x03 \x03(\tB\x03\xe0\x41\x03\"\x96\x01\n\x15GetMigratingVmRequest\x12<\n\x04name\x18\x01 \x01(\tB.\xe0\x41\x02\xfa\x41(\n&vmmigration.googleapis.com/MigratingVm\x12?\n\x04view\x18\x02 \x01(\x0e\x32,.google.cloud.vmmigration.v1.MigratingVmViewB\x03\xe0\x41\x01\"\xa4\x01\n\x18UpdateMigratingVmRequest\x12/\n\x0bupdate_mask\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\x12\x43\n\x0cmigrating_vm\x18\x02 \x01(\x0b\x32(.google.cloud.vmmigration.v1.MigratingVmB\x03\xe0\x41\x02\x12\x12\n\nrequest_id\x18\x03 \x01(\t\"X\n\x18\x44\x65leteMigratingVmRequest\x12<\n\x04name\x18\x01 \x01(\tB.\xe0\x41\x02\xfa\x41(\n&vmmigration.googleapis.com/MigratingVm\"]\n\x15StartMigrationRequest\x12\x44\n\x0cmigrating_vm\x18\x01 \x01(\tB.\xe0\x41\x02\xfa\x41(\n&vmmigration.googleapis.com/MigratingVm\"\x18\n\x16StartMigrationResponse\"]\n\x15PauseMigrationRequest\x12\x44\n\x0cmigrating_vm\x18\x01 \x01(\tB.\xe0\x41\x02\xfa\x41(\n&vmmigration.googleapis.com/MigratingVm\"\x18\n\x16PauseMigrationResponse\"^\n\x16ResumeMigrationRequest\x12\x44\n\x0cmigrating_vm\x18\x01 \x01(\tB.\xe0\x41\x02\xfa\x41(\n&vmmigration.googleapis.com/MigratingVm\"\x19\n\x17ResumeMigrationResponse\"`\n\x18\x46inalizeMigrationRequest\x12\x44\n\x0cmigrating_vm\x18\x01 \x01(\tB.\xe0\x41\x02\xfa\x41(\n&vmmigration.googleapis.com/MigratingVm\"^\n\x16\x45xtendMigrationRequest\x12\x44\n\x0cmigrating_vm\x18\x01 \x01(\tB.\xe0\x41\x02\xfa\x41(\n&vmmigration.googleapis.com/MigratingVm\"\x19\n\x17\x45xtendMigrationResponse\"\x1b\n\x19\x46inalizeMigrationResponse\"\xb1\x02\n\rTargetProject\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x14\n\x07project\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x13\n\x0b\x64\x65scription\x18\x03 \x01(\t\x12\x34\n\x0b\x63reate_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03:v\xea\x41s\n(vmmigration.googleapis.com/TargetProject\x12Gprojects/{project}/locations/{location}/targetProjects/{target_project}\"Y\n\x17GetTargetProjectRequest\x12>\n\x04name\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(vmmigration.googleapis.com/TargetProject\"\xba\x01\n\x19ListTargetProjectsRequest\x12@\n\x06parent\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\x12(vmmigration.googleapis.com/TargetProject\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\x02\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\"\x9e\x01\n\x1aListTargetProjectsResponse\x12H\n\x0ftarget_projects\x18\x01 \x03(\x0b\x32*.google.cloud.vmmigration.v1.TargetProjectB\x03\xe0\x41\x03\x12\x1c\n\x0fnext_page_token\x18\x02 \x01(\tB\x03\xe0\x41\x03\x12\x18\n\x0bunreachable\x18\x03 \x03(\tB\x03\xe0\x41\x03\"\xdb\x01\n\x1a\x43reateTargetProjectRequest\x12@\n\x06parent\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\x12(vmmigration.googleapis.com/TargetProject\x12\x1e\n\x11target_project_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12G\n\x0etarget_project\x18\x03 \x01(\x0b\x32*.google.cloud.vmmigration.v1.TargetProjectB\x03\xe0\x41\x02\x12\x12\n\nrequest_id\x18\x04 \x01(\t\"\xaa\x01\n\x1aUpdateTargetProjectRequest\x12/\n\x0bupdate_mask\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\x12G\n\x0etarget_project\x18\x02 \x01(\x0b\x32*.google.cloud.vmmigration.v1.TargetProjectB\x03\xe0\x41\x02\x12\x12\n\nrequest_id\x18\x03 \x01(\t\"u\n\x1a\x44\x65leteTargetProjectRequest\x12>\n\x04name\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(vmmigration.googleapis.com/TargetProject\x12\x17\n\nrequest_id\x18\x02 \x01(\tB\x03\xe0\x41\x01\"\xea\x03\n\x05Group\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\x12\x34\n\x0bupdate_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x13\n\x0b\x64\x65scription\x18\x04 \x01(\t\x12\x14\n\x0c\x64isplay_name\x18\x05 \x01(\t\x12Z\n\x15migration_target_type\x18\x06 \x01(\x0e\x32\x36.google.cloud.vmmigration.v1.Group.MigrationTargetTypeB\x03\xe0\x41\x05\"|\n\x13MigrationTargetType\x12%\n!MIGRATION_TARGET_TYPE_UNSPECIFIED\x10\x00\x12\x1d\n\x19MIGRATION_TARGET_TYPE_GCE\x10\x01\x12\x1f\n\x1bMIGRATION_TARGET_TYPE_DISKS\x10\x02:]\xea\x41Z\n vmmigration.googleapis.com/Group\x12\x36projects/{project}/locations/{location}/groups/{group}\"\xaa\x01\n\x11ListGroupsRequest\x12\x38\n\x06parent\x18\x01 \x01(\tB(\xe0\x41\x02\xfa\x41\"\x12 vmmigration.googleapis.com/Group\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\x02\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\"\x85\x01\n\x12ListGroupsResponse\x12\x37\n\x06groups\x18\x01 \x03(\x0b\x32\".google.cloud.vmmigration.v1.GroupB\x03\xe0\x41\x03\x12\x1c\n\x0fnext_page_token\x18\x02 \x01(\tB\x03\xe0\x41\x03\x12\x18\n\x0bunreachable\x18\x03 \x03(\tB\x03\xe0\x41\x03\"I\n\x0fGetGroupRequest\x12\x36\n\x04name\x18\x01 \x01(\tB(\xe0\x41\x02\xfa\x41\"\n vmmigration.googleapis.com/Group\"\xb1\x01\n\x12\x43reateGroupRequest\x12\x38\n\x06parent\x18\x01 \x01(\tB(\xe0\x41\x02\xfa\x41\"\x12 vmmigration.googleapis.com/Group\x12\x15\n\x08group_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x36\n\x05group\x18\x03 \x01(\x0b\x32\".google.cloud.vmmigration.v1.GroupB\x03\xe0\x41\x02\x12\x12\n\nrequest_id\x18\x04 \x01(\t\"\x91\x01\n\x12UpdateGroupRequest\x12/\n\x0bupdate_mask\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\x12\x36\n\x05group\x18\x02 \x01(\x0b\x32\".google.cloud.vmmigration.v1.GroupB\x03\xe0\x41\x02\x12\x12\n\nrequest_id\x18\x03 \x01(\t\"e\n\x12\x44\x65leteGroupRequest\x12\x36\n\x04name\x18\x01 \x01(\tB(\xe0\x41\x02\xfa\x41\"\n vmmigration.googleapis.com/Group\x12\x17\n\nrequest_id\x18\x02 \x01(\tB\x03\xe0\x41\x01\"\x96\x01\n\x18\x41\x64\x64GroupMigrationRequest\x12\x37\n\x05group\x18\x01 \x01(\tB(\xe0\x41\x02\xfa\x41\"\n vmmigration.googleapis.com/Group\x12\x41\n\x0cmigrating_vm\x18\x02 \x01(\tB+\xfa\x41(\n&vmmigration.googleapis.com/MigratingVm\"\x1b\n\x19\x41\x64\x64GroupMigrationResponse\"\x99\x01\n\x1bRemoveGroupMigrationRequest\x12\x37\n\x05group\x18\x01 \x01(\tB(\xe0\x41\x02\xfa\x41\"\n vmmigration.googleapis.com/Group\x12\x41\n\x0cmigrating_vm\x18\x02 \x01(\tB+\xfa\x41(\n&vmmigration.googleapis.com/MigratingVm\"\x1e\n\x1cRemoveGroupMigrationResponse\"\xcc\x01\n\x17\x43reateCutoverJobRequest\x12=\n\x06parent\x18\x01 \x01(\tB-\xe0\x41\x02\xfa\x41\'\x12%vmmigration.googleapis.com/CutoverJob\x12\x1b\n\x0e\x63utover_job_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x41\n\x0b\x63utover_job\x18\x03 \x01(\x0b\x32\'.google.cloud.vmmigration.v1.CutoverJobB\x03\xe0\x41\x02\x12\x12\n\nrequest_id\x18\x04 \x01(\t\"V\n\x17\x43\x61ncelCutoverJobRequest\x12;\n\x04name\x18\x01 \x01(\tB-\xe0\x41\x02\xfa\x41\'\n%vmmigration.googleapis.com/CutoverJob\"\x1a\n\x18\x43\x61ncelCutoverJobResponse\"\xb4\x01\n\x16ListCutoverJobsRequest\x12=\n\x06parent\x18\x01 \x01(\tB-\xe0\x41\x02\xfa\x41\'\x12%vmmigration.googleapis.com/CutoverJob\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\x02\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\"\x95\x01\n\x17ListCutoverJobsResponse\x12\x42\n\x0c\x63utover_jobs\x18\x01 \x03(\x0b\x32\'.google.cloud.vmmigration.v1.CutoverJobB\x03\xe0\x41\x03\x12\x1c\n\x0fnext_page_token\x18\x02 \x01(\tB\x03\xe0\x41\x03\x12\x18\n\x0bunreachable\x18\x03 \x03(\tB\x03\xe0\x41\x03\"S\n\x14GetCutoverJobRequest\x12;\n\x04name\x18\x01 \x01(\tB-\xe0\x41\x02\xfa\x41\'\n%vmmigration.googleapis.com/CutoverJob\"\x80\x02\n\x11OperationMetadata\x12\x34\n\x0b\x63reate_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x31\n\x08\x65nd_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x13\n\x06target\x18\x03 \x01(\tB\x03\xe0\x41\x03\x12\x11\n\x04verb\x18\x04 \x01(\tB\x03\xe0\x41\x03\x12\x1b\n\x0estatus_message\x18\x05 \x01(\tB\x03\xe0\x41\x03\x12#\n\x16requested_cancellation\x18\x06 \x01(\x08\x42\x03\xe0\x41\x03\x12\x18\n\x0b\x61pi_version\x18\x07 \x01(\tB\x03\xe0\x41\x03\"\xf1\x04\n\x0eMigrationError\x12H\n\x04\x63ode\x18\x01 \x01(\x0e\x32\x35.google.cloud.vmmigration.v1.MigrationError.ErrorCodeB\x03\xe0\x41\x03\x12\x38\n\rerror_message\x18\x02 \x01(\x0b\x32\x1c.google.rpc.LocalizedMessageB\x03\xe0\x41\x03\x12\x36\n\x0b\x61\x63tion_item\x18\x03 \x01(\x0b\x32\x1c.google.rpc.LocalizedMessageB\x03\xe0\x41\x03\x12.\n\nhelp_links\x18\x04 \x03(\x0b\x32\x15.google.rpc.Help.LinkB\x03\xe0\x41\x03\x12\x33\n\nerror_time\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\"\xbd\x02\n\tErrorCode\x12\x1a\n\x16\x45RROR_CODE_UNSPECIFIED\x10\x00\x12\x11\n\rUNKNOWN_ERROR\x10\x01\x12\x1b\n\x17SOURCE_VALIDATION_ERROR\x10\x02\x12\x1c\n\x18SOURCE_REPLICATION_ERROR\x10\x03\x12\x1c\n\x18TARGET_REPLICATION_ERROR\x10\x04\x12\x17\n\x13OS_ADAPTATION_ERROR\x10\x05\x12\x0f\n\x0b\x43LONE_ERROR\x10\x06\x12\x11\n\rCUTOVER_ERROR\x10\x07\x12\x1c\n\x18UTILIZATION_REPORT_ERROR\x10\x08\x12\x1b\n\x17\x41PPLIANCE_UPGRADE_ERROR\x10\t\x12\x16\n\x12IMAGE_IMPORT_ERROR\x10\n\x12\x18\n\x14\x44ISK_MIGRATION_ERROR\x10\x0b\"\xf6\x02\n\x10MigrationWarning\x12G\n\x04\x63ode\x18\x01 \x01(\x0e\x32\x39.google.cloud.vmmigration.v1.MigrationWarning.WarningCode\x12:\n\x0fwarning_message\x18\x02 \x01(\x0b\x32\x1c.google.rpc.LocalizedMessageB\x03\xe0\x41\x03\x12\x36\n\x0b\x61\x63tion_item\x18\x03 \x01(\x0b\x32\x1c.google.rpc.LocalizedMessageB\x03\xe0\x41\x03\x12.\n\nhelp_links\x18\x04 \x03(\x0b\x32\x15.google.rpc.Help.LinkB\x03\xe0\x41\x03\x12\x30\n\x0cwarning_time\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"C\n\x0bWarningCode\x12\x1c\n\x18WARNING_CODE_UNSPECIFIED\x10\x00\x12\x16\n\x12\x41\x44\x41PTATION_WARNING\x10\x01\"\x95\x04\n\x15VmwareSourceVmDetails\x12R\n\x08\x66irmware\x18\x01 \x01(\x0e\x32;.google.cloud.vmmigration.v1.VmwareSourceVmDetails.FirmwareB\x03\xe0\x41\x03\x12$\n\x17\x63ommitted_storage_bytes\x18\x02 \x01(\x03\x42\x03\xe0\x41\x03\x12X\n\x05\x64isks\x18\x03 \x03(\x0b\x32\x44.google.cloud.vmmigration.v1.VmwareSourceVmDetails.VmwareDiskDetailsB\x03\xe0\x41\x03\x12N\n\x14vm_capabilities_info\x18\x05 \x01(\x0b\x32+.google.cloud.vmmigration.v1.VmCapabilitiesB\x03\xe0\x41\x03\x12\x46\n\x0c\x61rchitecture\x18\x06 \x01(\x0e\x32+.google.cloud.vmmigration.v1.VmArchitectureB\x03\xe0\x41\x03\x1aW\n\x11VmwareDiskDetails\x12\x18\n\x0b\x64isk_number\x18\x01 \x01(\x05\x42\x03\xe0\x41\x03\x12\x14\n\x07size_gb\x18\x02 \x01(\x03\x42\x03\xe0\x41\x03\x12\x12\n\x05label\x18\x03 \x01(\tB\x03\xe0\x41\x03\"7\n\x08\x46irmware\x12\x18\n\x14\x46IRMWARE_UNSPECIFIED\x10\x00\x12\x07\n\x03\x45\x46I\x10\x01\x12\x08\n\x04\x42IOS\x10\x02\"\x8a\x04\n\x12\x41wsSourceVmDetails\x12O\n\x08\x66irmware\x18\x01 \x01(\x0e\x32\x38.google.cloud.vmmigration.v1.AwsSourceVmDetails.FirmwareB\x03\xe0\x41\x03\x12$\n\x17\x63ommitted_storage_bytes\x18\x02 \x01(\x03\x42\x03\xe0\x41\x03\x12R\n\x05\x64isks\x18\x03 \x03(\x0b\x32>.google.cloud.vmmigration.v1.AwsSourceVmDetails.AwsDiskDetailsB\x03\xe0\x41\x03\x12N\n\x14vm_capabilities_info\x18\x05 \x01(\x0b\x32+.google.cloud.vmmigration.v1.VmCapabilitiesB\x03\xe0\x41\x03\x12\x46\n\x0c\x61rchitecture\x18\x06 \x01(\x0e\x32+.google.cloud.vmmigration.v1.VmArchitectureB\x03\xe0\x41\x03\x1aX\n\x0e\x41wsDiskDetails\x12\x18\n\x0b\x64isk_number\x18\x01 \x01(\x05\x42\x03\xe0\x41\x03\x12\x16\n\tvolume_id\x18\x02 \x01(\tB\x03\xe0\x41\x03\x12\x14\n\x07size_gb\x18\x03 \x01(\x03\x42\x03\xe0\x41\x03\"7\n\x08\x46irmware\x12\x18\n\x14\x46IRMWARE_UNSPECIFIED\x10\x00\x12\x07\n\x03\x45\x46I\x10\x01\x12\x08\n\x04\x42IOS\x10\x02\"\x92\x04\n\x14\x41zureSourceVmDetails\x12Q\n\x08\x66irmware\x18\x01 \x01(\x0e\x32:.google.cloud.vmmigration.v1.AzureSourceVmDetails.FirmwareB\x03\xe0\x41\x03\x12$\n\x17\x63ommitted_storage_bytes\x18\x02 \x01(\x03\x42\x03\xe0\x41\x03\x12V\n\x05\x64isks\x18\x03 \x03(\x0b\x32\x42.google.cloud.vmmigration.v1.AzureSourceVmDetails.AzureDiskDetailsB\x03\xe0\x41\x03\x12N\n\x14vm_capabilities_info\x18\x05 \x01(\x0b\x32+.google.cloud.vmmigration.v1.VmCapabilitiesB\x03\xe0\x41\x03\x12\x46\n\x0c\x61rchitecture\x18\x06 \x01(\x0e\x32+.google.cloud.vmmigration.v1.VmArchitectureB\x03\xe0\x41\x03\x1aX\n\x10\x41zureDiskDetails\x12\x18\n\x0b\x64isk_number\x18\x01 \x01(\x05\x42\x03\xe0\x41\x03\x12\x14\n\x07\x64isk_id\x18\x02 \x01(\tB\x03\xe0\x41\x03\x12\x14\n\x07size_gb\x18\x03 \x01(\x03\x42\x03\xe0\x41\x03\"7\n\x08\x46irmware\x12\x18\n\x14\x46IRMWARE_UNSPECIFIED\x10\x00\x12\x07\n\x03\x45\x46I\x10\x01\x12\x08\n\x04\x42IOS\x10\x02\"\xc0\x01\n\x1cListReplicationCyclesRequest\x12\x43\n\x06parent\x18\x01 \x01(\tB3\xe0\x41\x02\xfa\x41-\x12+vmmigration.googleapis.com/ReplicationCycle\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\x02\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\"\xa7\x01\n\x1dListReplicationCyclesResponse\x12N\n\x12replication_cycles\x18\x01 \x03(\x0b\x32-.google.cloud.vmmigration.v1.ReplicationCycleB\x03\xe0\x41\x03\x12\x1c\n\x0fnext_page_token\x18\x02 \x01(\tB\x03\xe0\x41\x03\x12\x18\n\x0bunreachable\x18\x03 \x03(\tB\x03\xe0\x41\x03\"_\n\x1aGetReplicationCycleRequest\x12\x41\n\x04name\x18\x01 \x01(\tB3\xe0\x41\x02\xfa\x41-\n+vmmigration.googleapis.com/ReplicationCycle\"\xa7\x01\n\x0eVmCapabilities\x12J\n\x0fos_capabilities\x18\x01 \x03(\x0e\x32).google.cloud.vmmigration.v1.OsCapabilityB\x06\xe0\x41\x03\xe0\x41\x06\x12I\n last_os_capabilities_update_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\"\xf6\x04\n\x0bImageImport\x12 \n\x11\x63loud_storage_uri\x18\x02 \x01(\tB\x03\xe0\x41\x05H\x00\x12^\n\x1a\x64isk_image_target_defaults\x18\x04 \x01(\x0b\x32\x33.google.cloud.vmmigration.v1.DiskImageTargetDetailsB\x03\xe0\x41\x05H\x01\x12\x64\n\x1dmachine_image_target_defaults\x18\x07 \x01(\x0b\x32\x36.google.cloud.vmmigration.v1.MachineImageTargetDetailsB\x03\xe0\x41\x05H\x01\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x34\n\x0b\x63reate_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12R\n\x18recent_image_import_jobs\x18\x05 \x03(\x0b\x32+.google.cloud.vmmigration.v1.ImageImportJobB\x03\xe0\x41\x03\x12@\n\nencryption\x18\x06 \x01(\x0b\x32\'.google.cloud.vmmigration.v1.EncryptionB\x03\xe0\x41\x05:\x82\x01\xea\x41\x7f\n&vmmigration.googleapis.com/ImageImport\x12:projects/{project}/locations/{location}/imageImports/{job}*\x0cimageImports2\x0bimageImportB\x08\n\x06sourceB\x11\n\x0ftarget_defaults\"\xc2\x07\n\x0eImageImportJob\x12 \n\x11\x63loud_storage_uri\x18\n \x01(\tB\x03\xe0\x41\x03H\x00\x12]\n\x19\x64isk_image_target_details\x18\x03 \x01(\x0b\x32\x33.google.cloud.vmmigration.v1.DiskImageTargetDetailsB\x03\xe0\x41\x03H\x01\x12\x63\n\x1cmachine_image_target_details\x18\x0b \x01(\x0b\x32\x36.google.cloud.vmmigration.v1.MachineImageTargetDetailsB\x03\xe0\x41\x03H\x01\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x1e\n\x11\x63reated_resources\x18\x02 \x03(\tB\x03\xe0\x41\x03\x12\x45\n\x05state\x18\x04 \x01(\x0e\x32\x31.google.cloud.vmmigration.v1.ImageImportJob.StateB\x03\xe0\x41\x03\x12\x34\n\x0b\x63reate_time\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x31\n\x08\x65nd_time\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\'\n\x06\x65rrors\x18\x07 \x03(\x0b\x32\x12.google.rpc.StatusB\x03\xe0\x41\x03\x12\x44\n\x08warnings\x18\x08 \x03(\x0b\x32-.google.cloud.vmmigration.v1.MigrationWarningB\x03\xe0\x41\x03\x12@\n\x05steps\x18\t \x03(\x0b\x32,.google.cloud.vmmigration.v1.ImageImportStepB\x03\xe0\x41\x03\"r\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0b\n\x07PENDING\x10\x01\x12\x0b\n\x07RUNNING\x10\x02\x12\r\n\tSUCCEEDED\x10\x03\x12\n\n\x06\x46\x41ILED\x10\x04\x12\x0e\n\nCANCELLING\x10\x05\x12\r\n\tCANCELLED\x10\x06:\xa5\x01\xea\x41\xa1\x01\n)vmmigration.googleapis.com/ImageImportJob\x12Sprojects/{project}/locations/{location}/imageImports/{job}/imageImportJobs/{result}*\x0fimageImportJobs2\x0eimageImportJobB\x08\n\x06sourceB\x10\n\x0etarget_details\"\xbb\x03\n\x0fImageImportStep\x12P\n\x0cinitializing\x18\x03 \x01(\x0b\x32\x38.google.cloud.vmmigration.v1.InitializingImageImportStepH\x00\x12X\n\x14loading_source_files\x18\x04 \x01(\x0b\x32\x38.google.cloud.vmmigration.v1.LoadingImageSourceFilesStepH\x00\x12\x42\n\x0b\x61\x64\x61pting_os\x18\x05 \x01(\x0b\x32+.google.cloud.vmmigration.v1.AdaptingOSStepH\x00\x12H\n\x0e\x63reating_image\x18\x06 \x01(\x0b\x32..google.cloud.vmmigration.v1.CreatingImageStepH\x00\x12\x33\n\nstart_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x31\n\x08\x65nd_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x42\x06\n\x04step\"\x1d\n\x1bInitializingImageImportStep\"\x1d\n\x1bLoadingImageSourceFilesStep\"\x13\n\x11\x43reatingImageStep\"\x96\x05\n\x16\x44iskImageTargetDetails\x12g\n\x18os_adaptation_parameters\x18\x0b \x01(\x0b\x32>.google.cloud.vmmigration.v1.ImageImportOsAdaptationParametersB\x03\xe0\x41\x01H\x00\x12W\n\x16\x64\x61ta_disk_image_import\x18\x0c \x01(\x0b\x32\x30.google.cloud.vmmigration.v1.DataDiskImageImportB\x03\xe0\x41\x01H\x00\x12\x17\n\nimage_name\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12H\n\x0etarget_project\x18\x02 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(vmmigration.googleapis.com/TargetProject\x12\x18\n\x0b\x64\x65scription\x18\x05 \x01(\tB\x03\xe0\x41\x01\x12\x18\n\x0b\x66\x61mily_name\x18\x06 \x01(\tB\x03\xe0\x41\x01\x12T\n\x06labels\x18\x07 \x03(\x0b\x32?.google.cloud.vmmigration.v1.DiskImageTargetDetails.LabelsEntryB\x03\xe0\x41\x01\x12 \n\x13\x61\x64\x64itional_licenses\x18\x08 \x03(\tB\x03\xe0\x41\x01\x12\"\n\x15single_region_storage\x18\t \x01(\x08\x42\x03\xe0\x41\x01\x12@\n\nencryption\x18\n \x01(\x0b\x32\'.google.cloud.vmmigration.v1.EncryptionB\x03\xe0\x41\x05\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x42\x16\n\x14os_adaptation_config\"\xfc\x07\n\x19MachineImageTargetDetails\x12g\n\x18os_adaptation_parameters\x18\x03 \x01(\x0b\x32>.google.cloud.vmmigration.v1.ImageImportOsAdaptationParametersB\x03\xe0\x41\x01H\x00\x12P\n\x12skip_os_adaptation\x18\x10 \x01(\x0b\x32-.google.cloud.vmmigration.v1.SkipOsAdaptationB\x03\xe0\x41\x01H\x00\x12\x1f\n\x12machine_image_name\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12H\n\x0etarget_project\x18\x02 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(vmmigration.googleapis.com/TargetProject\x12\x18\n\x0b\x64\x65scription\x18\x04 \x01(\tB\x03\xe0\x41\x01\x12\"\n\x15single_region_storage\x18\x05 \x01(\x08\x42\x03\xe0\x41\x01\x12@\n\nencryption\x18\x06 \x01(\x0b\x32\'.google.cloud.vmmigration.v1.EncryptionB\x03\xe0\x41\x05\x12m\n\"machine_image_parameters_overrides\x18\x07 \x01(\x0b\x32<.google.cloud.vmmigration.v1.MachineImageParametersOverridesB\x03\xe0\x41\x01\x12I\n\x0fservice_account\x18\x08 \x01(\x0b\x32+.google.cloud.vmmigration.v1.ServiceAccountB\x03\xe0\x41\x01\x12 \n\x13\x61\x64\x64itional_licenses\x18\t \x03(\tB\x03\xe0\x41\x01\x12W\n\x06labels\x18\n \x03(\x0b\x32\x42.google.cloud.vmmigration.v1.MachineImageTargetDetails.LabelsEntryB\x03\xe0\x41\x01\x12\x11\n\x04tags\x18\x0b \x03(\tB\x03\xe0\x41\x01\x12Z\n\x18shielded_instance_config\x18\x0c \x01(\x0b\x32\x33.google.cloud.vmmigration.v1.ShieldedInstanceConfigB\x03\xe0\x41\x01\x12N\n\x12network_interfaces\x18\r \x03(\x0b\x32-.google.cloud.vmmigration.v1.NetworkInterfaceB\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\x42\x16\n\x14os_adaptation_config\"_\n\x0eServiceAccount\x12\x38\n\x05\x65mail\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!iam.googleapis.com/ServiceAccount\x12\x13\n\x06scopes\x18\x02 \x03(\tB\x03\xe0\x41\x01\"\xf6\x01\n\x16ShieldedInstanceConfig\x12X\n\x0bsecure_boot\x18\x01 \x01(\x0e\x32>.google.cloud.vmmigration.v1.ShieldedInstanceConfig.SecureBootB\x03\xe0\x41\x01\x12\x18\n\x0b\x65nable_vtpm\x18\x02 \x01(\x08\x42\x03\xe0\x41\x01\x12(\n\x1b\x65nable_integrity_monitoring\x18\x03 \x01(\x08\x42\x03\xe0\x41\x01\">\n\nSecureBoot\x12\x1b\n\x17SECURE_BOOT_UNSPECIFIED\x10\x00\x12\x08\n\x04TRUE\x10\x01\x12\t\n\x05\x46\x41LSE\x10\x02\"<\n\x1fMachineImageParametersOverrides\x12\x19\n\x0cmachine_type\x18\x01 \x01(\tB\x03\xe0\x41\x01\"\xad\x02\n!ImageImportOsAdaptationParameters\x12\x17\n\ngeneralize\x18\x01 \x01(\x08\x42\x03\xe0\x41\x01\x12P\n\x0clicense_type\x18\x02 \x01(\x0e\x32\x35.google.cloud.vmmigration.v1.ComputeEngineLicenseTypeB\x03\xe0\x41\x01\x12I\n\x0f\x62oot_conversion\x18\x03 \x01(\x0e\x32+.google.cloud.vmmigration.v1.BootConversionB\x03\xe0\x41\x01\x12R\n\x14\x61\x64\x61ptation_modifiers\x18\x04 \x03(\x0b\x32/.google.cloud.vmmigration.v1.AdaptationModifierB\x03\xe0\x41\x01\"5\n\x13\x44\x61taDiskImageImport\x12\x1e\n\x11guest_os_features\x18\x01 \x03(\tB\x03\xe0\x41\x01\"\x12\n\x10SkipOsAdaptation\"U\n\x15GetImageImportRequest\x12<\n\x04name\x18\x01 \x01(\tB.\xe0\x41\x02\xfa\x41(\n&vmmigration.googleapis.com/ImageImport\"\xb6\x01\n\x17ListImageImportsRequest\x12>\n\x06parent\x18\x01 \x01(\tB.\xe0\x41\x02\xfa\x41(\x12&vmmigration.googleapis.com/ImageImport\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\"\x98\x01\n\x18ListImageImportsResponse\x12\x44\n\rimage_imports\x18\x01 \x03(\x0b\x32(.google.cloud.vmmigration.v1.ImageImportB\x03\xe0\x41\x03\x12\x1c\n\x0fnext_page_token\x18\x02 \x01(\tB\x03\xe0\x41\x03\x12\x18\n\x0bunreachable\x18\x03 \x03(\tB\x03\xe0\x41\x03\"\xd6\x01\n\x18\x43reateImageImportRequest\x12>\n\x06parent\x18\x01 \x01(\tB.\xe0\x41\x02\xfa\x41(\x12&vmmigration.googleapis.com/ImageImport\x12\x1c\n\x0fimage_import_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x43\n\x0cimage_import\x18\x03 \x01(\x0b\x32(.google.cloud.vmmigration.v1.ImageImportB\x03\xe0\x41\x02\x12\x17\n\nrequest_id\x18\x04 \x01(\tB\x03\xe0\x41\x01\"q\n\x18\x44\x65leteImageImportRequest\x12<\n\x04name\x18\x01 \x01(\tB.\xe0\x41\x02\xfa\x41(\n&vmmigration.googleapis.com/ImageImport\x12\x17\n\nrequest_id\x18\x02 \x01(\tB\x03\xe0\x41\x01\"[\n\x18GetImageImportJobRequest\x12?\n\x04name\x18\x01 \x01(\tB1\xe0\x41\x02\xfa\x41+\n)vmmigration.googleapis.com/ImageImportJob\"\xbc\x01\n\x1aListImageImportJobsRequest\x12\x41\n\x06parent\x18\x01 \x01(\tB1\xe0\x41\x02\xfa\x41+\x12)vmmigration.googleapis.com/ImageImportJob\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\"\xa2\x01\n\x1bListImageImportJobsResponse\x12K\n\x11image_import_jobs\x18\x01 \x03(\x0b\x32+.google.cloud.vmmigration.v1.ImageImportJobB\x03\xe0\x41\x03\x12\x1c\n\x0fnext_page_token\x18\x02 \x01(\tB\x03\xe0\x41\x03\x12\x18\n\x0bunreachable\x18\x03 \x03(\tB\x03\xe0\x41\x03\"^\n\x1b\x43\x61ncelImageImportJobRequest\x12?\n\x04name\x18\x01 \x01(\tB1\xe0\x41\x02\xfa\x41+\n)vmmigration.googleapis.com/ImageImportJob\"\x1e\n\x1c\x43\x61ncelImageImportJobResponse\"\xbc\x06\n\x10\x44iskMigrationJob\x12T\n\x17\x61ws_source_disk_details\x18\x02 \x01(\x0b\x32\x31.google.cloud.vmmigration.v1.AwsSourceDiskDetailsH\x00\x12\x14\n\x04name\x18\x01 \x01(\tB\x06\xe0\x41\x08\xe0\x41\x03\x12W\n\x0etarget_details\x18\x03 \x01(\x0b\x32:.google.cloud.vmmigration.v1.DiskMigrationJobTargetDetailsB\x03\xe0\x41\x02\x12\x34\n\x0b\x63reate_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12G\n\x05state\x18\x06 \x01(\x0e\x32\x33.google.cloud.vmmigration.v1.DiskMigrationJob.StateB\x03\xe0\x41\x03\x12\'\n\x06\x65rrors\x18\x07 \x03(\x0b\x32\x12.google.rpc.StatusB\x03\xe0\x41\x03\x12\x42\n\x05steps\x18\x08 \x03(\x0b\x32..google.cloud.vmmigration.v1.DiskMigrationStepB\x03\xe0\x41\x03\"p\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\t\n\x05READY\x10\x01\x12\x0b\n\x07RUNNING\x10\x03\x12\r\n\tSUCCEEDED\x10\x04\x12\x0e\n\nCANCELLING\x10\x05\x12\r\n\tCANCELLED\x10\x06\x12\n\n\x06\x46\x41ILED\x10\x07:\xb7\x01\xea\x41\xb3\x01\n+vmmigration.googleapis.com/DiskMigrationJob\x12_projects/{project}/locations/{location}/sources/{source}/diskMigrationJobs/{disk_migration_job}*\x11\x64iskMigrationJobs2\x10\x64iskMigrationJobB\x15\n\x13source_disk_details\"\x95\x03\n\x1d\x44iskMigrationJobTargetDetails\x12J\n\x0btarget_disk\x18\x08 \x01(\x0b\x32..google.cloud.vmmigration.v1.ComputeEngineDiskB\x03\xe0\x41\x02H\x00\x12H\n\x0etarget_project\x18\x02 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(vmmigration.googleapis.com/TargetProject\x12[\n\x06labels\x18\x06 \x03(\x0b\x32\x46.google.cloud.vmmigration.v1.DiskMigrationJobTargetDetails.LabelsEntryB\x03\xe0\x41\x01\x12@\n\nencryption\x18\x07 \x01(\x0b\x32\'.google.cloud.vmmigration.v1.EncryptionB\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\x42\x10\n\x0etarget_storage\"\xaa\x03\n\x11\x44iskMigrationStep\x12\x64\n\x1d\x63reating_source_disk_snapshot\x18\x03 \x01(\x0b\x32;.google.cloud.vmmigration.v1.CreatingSourceDiskSnapshotStepH\x00\x12\x62\n\x1c\x63opying_source_disk_snapshot\x18\x04 \x01(\x0b\x32:.google.cloud.vmmigration.v1.CopyingSourceDiskSnapshotStepH\x00\x12[\n\x18provisioning_target_disk\x18\x05 \x01(\x0b\x32\x37.google.cloud.vmmigration.v1.ProvisioningTargetDiskStepH\x00\x12\x33\n\nstart_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x31\n\x08\x65nd_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x42\x06\n\x04step\" \n\x1e\x43reatingSourceDiskSnapshotStep\"\x1f\n\x1d\x43opyingSourceDiskSnapshotStep\"\x1c\n\x1aProvisioningTargetDiskStep\"\xf0\x01\n\x11\x43omputeEngineDisk\x12\x14\n\x07\x64isk_id\x18\x01 \x01(\tB\x03\xe0\x41\x01\x12\x37\n\x04zone\x18\x02 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\x12@\n\rreplica_zones\x18\x03 \x03(\tB)\xe0\x41\x01\xfa\x41#\n!locations.googleapis.com/Location\x12J\n\tdisk_type\x18\x04 \x01(\x0e\x32\x32.google.cloud.vmmigration.v1.ComputeEngineDiskTypeB\x03\xe0\x41\x02\"\xfa\x02\n\x14\x41wsSourceDiskDetails\x12\x16\n\tvolume_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x15\n\x08size_gib\x18\x02 \x01(\x03\x42\x03\xe0\x41\x03\x12Q\n\tdisk_type\x18\x03 \x01(\x0e\x32\x36.google.cloud.vmmigration.v1.AwsSourceDiskDetails.TypeB\x06\xe0\x41\x01\xe0\x41\x03\x12Q\n\x04tags\x18\x04 \x03(\x0b\x32;.google.cloud.vmmigration.v1.AwsSourceDiskDetails.TagsEntryB\x06\xe0\x41\x01\xe0\x41\x03\x1a+\n\tTagsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"`\n\x04Type\x12\x14\n\x10TYPE_UNSPECIFIED\x10\x00\x12\x07\n\x03GP2\x10\x01\x12\x07\n\x03GP3\x10\x02\x12\x07\n\x03IO1\x10\x03\x12\x07\n\x03IO2\x10\x04\x12\x07\n\x03ST1\x10\x05\x12\x07\n\x03SC1\x10\x06\x12\x0c\n\x08STANDARD\x10\x07\"\xf9\x01\n\x1d\x43reateDiskMigrationJobRequest\x12\x43\n\x06parent\x18\x01 \x01(\tB3\xe0\x41\x02\xfa\x41-\x12+vmmigration.googleapis.com/DiskMigrationJob\x12\"\n\x15\x64isk_migration_job_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12N\n\x12\x64isk_migration_job\x18\x03 \x01(\x0b\x32-.google.cloud.vmmigration.v1.DiskMigrationJobB\x03\xe0\x41\x02\x12\x1f\n\nrequest_id\x18\x04 \x01(\tB\x0b\xe0\x41\x01\xe2\x8c\xcf\xd7\x08\x02\x08\x01\"\xc0\x01\n\x1cListDiskMigrationJobsRequest\x12\x43\n\x06parent\x18\x01 \x01(\tB3\xe0\x41\x02\xfa\x41-\x12+vmmigration.googleapis.com/DiskMigrationJob\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\"\xd1\x01\n\x1dListDiskMigrationJobsResponse\x12O\n\x13\x64isk_migration_jobs\x18\x01 \x03(\x0b\x32-.google.cloud.vmmigration.v1.DiskMigrationJobB\x03\xe0\x41\x03\x12\x1f\n\x0fnext_page_token\x18\x02 \x01(\tB\x06\xe0\x41\x03\xe0\x41\x01\x12>\n\x0bunreachable\x18\x03 \x03(\tB)\xe0\x41\x03\xfa\x41#\n!locations.googleapis.com/Location\"_\n\x1aGetDiskMigrationJobRequest\x12\x41\n\x04name\x18\x01 \x01(\tB3\xe0\x41\x02\xfa\x41-\n+vmmigration.googleapis.com/DiskMigrationJob\"\xc6\x01\n\x1dUpdateDiskMigrationJobRequest\x12\x34\n\x0bupdate_mask\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x01\x12N\n\x12\x64isk_migration_job\x18\x02 \x01(\x0b\x32-.google.cloud.vmmigration.v1.DiskMigrationJobB\x03\xe0\x41\x02\x12\x1f\n\nrequest_id\x18\x03 \x01(\tB\x0b\xe0\x41\x01\xe2\x8c\xcf\xd7\x08\x02\x08\x01\"b\n\x1d\x44\x65leteDiskMigrationJobRequest\x12\x41\n\x04name\x18\x01 \x01(\tB3\xe0\x41\x02\xfa\x41-\n+vmmigration.googleapis.com/DiskMigrationJob\"_\n\x1aRunDiskMigrationJobRequest\x12\x41\n\x04name\x18\x01 \x01(\tB3\xe0\x41\x02\xfa\x41-\n+vmmigration.googleapis.com/DiskMigrationJob\"\x1d\n\x1bRunDiskMigrationJobResponse\"b\n\x1d\x43\x61ncelDiskMigrationJobRequest\x12\x41\n\x04name\x18\x01 \x01(\tB3\xe0\x41\x02\xfa\x41-\n+vmmigration.googleapis.com/DiskMigrationJob\" \n\x1e\x43\x61ncelDiskMigrationJobResponse*\xe2\x01\n\x15\x43omputeEngineDiskType\x12(\n$COMPUTE_ENGINE_DISK_TYPE_UNSPECIFIED\x10\x00\x12%\n!COMPUTE_ENGINE_DISK_TYPE_STANDARD\x10\x01\x12 \n\x1c\x43OMPUTE_ENGINE_DISK_TYPE_SSD\x10\x02\x12%\n!COMPUTE_ENGINE_DISK_TYPE_BALANCED\x10\x03\x12/\n+COMPUTE_ENGINE_DISK_TYPE_HYPERDISK_BALANCED\x10\x04*\x8f\x01\n\x18\x43omputeEngineLicenseType\x12\'\n#COMPUTE_ENGINE_LICENSE_TYPE_DEFAULT\x10\x00\x12$\n COMPUTE_ENGINE_LICENSE_TYPE_PAYG\x10\x01\x12$\n COMPUTE_ENGINE_LICENSE_TYPE_BYOL\x10\x02*\x8e\x01\n\x17\x43omputeEngineBootOption\x12*\n&COMPUTE_ENGINE_BOOT_OPTION_UNSPECIFIED\x10\x00\x12\"\n\x1e\x43OMPUTE_ENGINE_BOOT_OPTION_EFI\x10\x01\x12#\n\x1f\x43OMPUTE_ENGINE_BOOT_OPTION_BIOS\x10\x02*\xa9\x01\n\x0cOsCapability\x12\x1d\n\x19OS_CAPABILITY_UNSPECIFIED\x10\x00\x12%\n!OS_CAPABILITY_NVME_STORAGE_ACCESS\x10\x01\x12)\n%OS_CAPABILITY_GVNIC_NETWORK_INTERFACE\x10\x02\x12(\n$OS_CAPABILITY_IDPF_NETWORK_INTERFACE\x10\x03*L\n\x0e\x42ootConversion\x12\x1f\n\x1b\x42OOT_CONVERSION_UNSPECIFIED\x10\x00\x12\x08\n\x04NONE\x10\x01\x12\x0f\n\x0b\x42IOS_TO_EFI\x10\x02*U\n\x15UtilizationReportView\x12\'\n#UTILIZATION_REPORT_VIEW_UNSPECIFIED\x10\x00\x12\t\n\x05\x42\x41SIC\x10\x01\x12\x08\n\x04\x46ULL\x10\x02*m\n\x0fMigratingVmView\x12!\n\x1dMIGRATING_VM_VIEW_UNSPECIFIED\x10\x00\x12\x1b\n\x17MIGRATING_VM_VIEW_BASIC\x10\x01\x12\x1a\n\x16MIGRATING_VM_VIEW_FULL\x10\x02*l\n\x0eVmArchitecture\x12\x1f\n\x1bVM_ARCHITECTURE_UNSPECIFIED\x10\x00\x12\x1e\n\x1aVM_ARCHITECTURE_X86_FAMILY\x10\x01\x12\x19\n\x15VM_ARCHITECTURE_ARM64\x10\x02*|\n\x18\x43omputeEngineNetworkTier\x12+\n\'COMPUTE_ENGINE_NETWORK_TIER_UNSPECIFIED\x10\x00\x12\x19\n\x15NETWORK_TIER_STANDARD\x10\x01\x12\x18\n\x14NETWORK_TIER_PREMIUM\x10\x02\x32\xebp\n\x0bVmMigration\x12\xae\x01\n\x0bListSources\x12/.google.cloud.vmmigration.v1.ListSourcesRequest\x1a\x30.google.cloud.vmmigration.v1.ListSourcesResponse\"<\xda\x41\x06parent\x82\xd3\xe4\x93\x02-\x12+/v1/{parent=projects/*/locations/*}/sources\x12\x9b\x01\n\tGetSource\x12-.google.cloud.vmmigration.v1.GetSourceRequest\x1a#.google.cloud.vmmigration.v1.Source\":\xda\x41\x04name\x82\xd3\xe4\x93\x02-\x12+/v1/{name=projects/*/locations/*/sources/*}\x12\xd4\x01\n\x0c\x43reateSource\x12\x30.google.cloud.vmmigration.v1.CreateSourceRequest\x1a\x1d.google.longrunning.Operation\"s\xca\x41\x1b\n\x06Source\x12\x11OperationMetadata\xda\x41\x17parent,source,source_id\x82\xd3\xe4\x93\x02\x35\"+/v1/{parent=projects/*/locations/*}/sources:\x06source\x12\xd6\x01\n\x0cUpdateSource\x12\x30.google.cloud.vmmigration.v1.UpdateSourceRequest\x1a\x1d.google.longrunning.Operation\"u\xca\x41\x1b\n\x06Source\x12\x11OperationMetadata\xda\x41\x12source,update_mask\x82\xd3\xe4\x93\x02<22/v1/{source.name=projects/*/locations/*/sources/*}:\x06source\x12\xc8\x01\n\x0c\x44\x65leteSource\x12\x30.google.cloud.vmmigration.v1.DeleteSourceRequest\x1a\x1d.google.longrunning.Operation\"g\xca\x41*\n\x15google.protobuf.Empty\x12\x11OperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02-*+/v1/{name=projects/*/locations/*/sources/*}\x12\xc8\x01\n\x0e\x46\x65tchInventory\x12\x32.google.cloud.vmmigration.v1.FetchInventoryRequest\x1a\x33.google.cloud.vmmigration.v1.FetchInventoryResponse\"M\xda\x41\x06source\x82\xd3\xe4\x93\x02>\x12 e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets the access control policy for a resource. - # Returns an empty policy if the resource exists and does not have a policy - # set. - # - # @overload get_iam_policy(request, options = nil) - # Pass arguments to `get_iam_policy` via a request object, either of type - # {::Google::Iam::V1::GetIamPolicyRequest} or an equivalent Hash. - # - # @param request [::Google::Iam::V1::GetIamPolicyRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_iam_policy(resource: nil, options: nil) - # Pass arguments to `get_iam_policy` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param resource [::String] - # REQUIRED: The resource for which the policy is being requested. - # See the operation documentation for the appropriate value for this field. - # @param options [::Google::Iam::V1::GetPolicyOptions, ::Hash] - # OPTIONAL: A `GetPolicyOptions` object for specifying options to - # `GetIamPolicy`. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Iam::V1::Policy] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Iam::V1::Policy] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/iam/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Iam::V1::IAMPolicy::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Iam::V1::GetIamPolicyRequest.new - # - # # Call the get_iam_policy method. - # result = client.get_iam_policy request - # - # # The returned object is of type Google::Iam::V1::Policy. - # p result - # - def get_iam_policy request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::GetIamPolicyRequest - - # Converts hash 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_iam_policy.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::VMMigration::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.resource - header_params["resource"] = request.resource - 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_iam_policy.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_iam_policy.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @iam_policy_stub.call_rpc :get_iam_policy, 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 permissions that a caller has on the specified resource. - # If the resource does not exist, this will return an empty set of - # permissions, not a `NOT_FOUND` error. - # - # Note: This operation is designed to be used for building permission-aware - # UIs and command-line tools, not for authorization checking. This operation - # may "fail open" without warning. - # - # @overload test_iam_permissions(request, options = nil) - # Pass arguments to `test_iam_permissions` via a request object, either of type - # {::Google::Iam::V1::TestIamPermissionsRequest} or an equivalent Hash. - # - # @param request [::Google::Iam::V1::TestIamPermissionsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload test_iam_permissions(resource: nil, permissions: nil) - # Pass arguments to `test_iam_permissions` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param resource [::String] - # REQUIRED: The resource for which the policy detail is being requested. - # See the operation documentation for the appropriate value for this field. - # @param permissions [::Array<::String>] - # The set of permissions to check for the `resource`. Permissions with - # wildcards (such as '*' or 'storage.*') are not allowed. For more - # information see - # [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Iam::V1::TestIamPermissionsResponse] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Iam::V1::TestIamPermissionsResponse] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/iam/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Iam::V1::IAMPolicy::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Iam::V1::TestIamPermissionsRequest.new - # - # # Call the test_iam_permissions method. - # result = client.test_iam_permissions request - # - # # The returned object is of type Google::Iam::V1::TestIamPermissionsResponse. - # p result - # - def test_iam_permissions request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::TestIamPermissionsRequest - - # Converts hash 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.test_iam_permissions.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::VMMigration::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.resource - header_params["resource"] = request.resource - 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.test_iam_permissions.timeout, - metadata: metadata, - retry_policy: @config.rpcs.test_iam_permissions.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @iam_policy_stub.call_rpc :test_iam_permissions, 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 IAMPolicy API. - # - # This class represents the configuration for IAMPolicy, - # 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::Iam::V1::IAMPolicy::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 - # # set_iam_policy to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Iam::V1::IAMPolicy::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.set_iam_policy.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Iam::V1::IAMPolicy::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.set_iam_policy.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::Iam::V1::IAMPolicy::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 = "iam-meta-api.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 IAMPolicy 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 `set_iam_policy` - # @return [::Gapic::Config::Method] - # - attr_reader :set_iam_policy - ## - # RPC-specific configuration for `get_iam_policy` - # @return [::Gapic::Config::Method] - # - attr_reader :get_iam_policy - ## - # RPC-specific configuration for `test_iam_permissions` - # @return [::Gapic::Config::Method] - # - attr_reader :test_iam_permissions - - # @private - def initialize parent_rpcs = nil - set_iam_policy_config = parent_rpcs.set_iam_policy if parent_rpcs.respond_to? :set_iam_policy - @set_iam_policy = ::Gapic::Config::Method.new set_iam_policy_config - get_iam_policy_config = parent_rpcs.get_iam_policy if parent_rpcs.respond_to? :get_iam_policy - @get_iam_policy = ::Gapic::Config::Method.new get_iam_policy_config - test_iam_permissions_config = parent_rpcs.test_iam_permissions if parent_rpcs.respond_to? :test_iam_permissions - @test_iam_permissions = ::Gapic::Config::Method.new test_iam_permissions_config - - yield self if block_given? - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-vm_migration-v1/lib/google/iam/v1/iam_policy/credentials.rb b/owl-bot-staging/google-cloud-vm_migration-v1/lib/google/iam/v1/iam_policy/credentials.rb deleted file mode 100644 index ae4df78450b3..000000000000 --- a/owl-bot-staging/google-cloud-vm_migration-v1/lib/google/iam/v1/iam_policy/credentials.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 "googleauth" - -module Google - module Iam - module V1 - module IAMPolicy - # Credentials for the IAMPolicy API. - class Credentials < ::Google::Auth::Credentials - self.env_vars = [ - "GOOGLE_CLOUD_CREDENTIALS", - "GOOGLE_CLOUD_KEYFILE", - "GCLOUD_KEYFILE", - "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 diff --git a/owl-bot-staging/google-cloud-vm_migration-v1/lib/google/iam/v1/iam_policy/rest.rb b/owl-bot-staging/google-cloud-vm_migration-v1/lib/google/iam/v1/iam_policy/rest.rb deleted file mode 100644 index 25a28cce69c7..000000000000 --- a/owl-bot-staging/google-cloud-vm_migration-v1/lib/google/iam/v1/iam_policy/rest.rb +++ /dev/null @@ -1,74 +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/vm_migration/v1/version" -require "google/iam/v1/bindings_override" - -require "google/iam/v1/iam_policy/credentials" -require "google/iam/v1/iam_policy/rest/client" - -module Google - module Iam - module V1 - ## - # API Overview - # - # Manages Identity and Access Management (IAM) policies. - # - # Any implementation of an API that offers access control features - # implements the google.iam.v1.IAMPolicy interface. - # - # ## Data model - # - # Access control is applied when a principal (user or service account), takes - # some action on a resource exposed by a service. Resources, identified by - # URI-like names, are the unit of access control specification. Service - # implementations can choose the granularity of access control and the - # supported permissions for their resources. - # For example one database service may allow access control to be - # specified only at the Table level, whereas another might allow access control - # to also be specified at the Column level. - # - # ## Policy Structure - # - # See google.iam.v1.Policy - # - # This is intentionally not a CRUD style API because access control policies - # are created and deleted implicitly with the resources to which they are - # attached. - # - # To load this service and instantiate a REST client: - # - # require "google/iam/v1/iam_policy/rest" - # client = ::Google::Iam::V1::IAMPolicy::Rest::Client.new - # - module IAMPolicy - # Client for the REST transport - module Rest - end - end - end - end -end - -helper_path = ::File.join __dir__, "rest", "helpers.rb" -require "google/iam/v1/iam_policy/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-vm_migration-v1/lib/google/iam/v1/iam_policy/rest/client.rb b/owl-bot-staging/google-cloud-vm_migration-v1/lib/google/iam/v1/iam_policy/rest/client.rb deleted file mode 100644 index 7fd6f1f09943..000000000000 --- a/owl-bot-staging/google-cloud-vm_migration-v1/lib/google/iam/v1/iam_policy/rest/client.rb +++ /dev/null @@ -1,671 +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/iam/v1/iam_policy_pb" -require "google/iam/v1/iam_policy/rest/service_stub" -require "google/cloud/location/rest" - -module Google - module Iam - module V1 - module IAMPolicy - module Rest - ## - # REST client for the IAMPolicy service. - # - # API Overview - # - # Manages Identity and Access Management (IAM) policies. - # - # Any implementation of an API that offers access control features - # implements the google.iam.v1.IAMPolicy interface. - # - # ## Data model - # - # Access control is applied when a principal (user or service account), takes - # some action on a resource exposed by a service. Resources, identified by - # URI-like names, are the unit of access control specification. Service - # implementations can choose the granularity of access control and the - # supported permissions for their resources. - # For example one database service may allow access control to be - # specified only at the Table level, whereas another might allow access control - # to also be specified at the Column level. - # - # ## Policy Structure - # - # See google.iam.v1.Policy - # - # This is intentionally not a CRUD style API because access control policies - # are created and deleted implicitly with the resources to which they are - # attached. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "iam-meta-api.$UNIVERSE_DOMAIN$" - - # @private - attr_reader :iam_policy_stub - - ## - # Configure the IAMPolicy Client class. - # - # See {::Google::Iam::V1::IAMPolicy::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all IAMPolicy clients - # ::Google::Iam::V1::IAMPolicy::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", "Iam", "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 - end - yield @configure if block_given? - @configure - end - - ## - # Configure the IAMPolicy 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::Iam::V1::IAMPolicy::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 - @iam_policy_stub.universe_domain - end - - ## - # Create a new IAMPolicy REST client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Iam::V1::IAMPolicy::Rest::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Iam::V1::IAMPolicy::Rest::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the IAMPolicy 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 - - @iam_policy_stub = ::Google::Iam::V1::IAMPolicy::Rest::ServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials, - logger: @config.logger - ) - - @iam_policy_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 = @iam_policy_stub.endpoint - config.universe_domain = @iam_policy_stub.universe_domain - config.bindings_override = @config.bindings_override - config.logger = @iam_policy_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 - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @iam_policy_stub.logger - end - - # Service calls - - ## - # Sets the access control policy on the specified resource. Replaces any - # existing policy. - # - # Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` errors. - # - # @overload set_iam_policy(request, options = nil) - # Pass arguments to `set_iam_policy` via a request object, either of type - # {::Google::Iam::V1::SetIamPolicyRequest} or an equivalent Hash. - # - # @param request [::Google::Iam::V1::SetIamPolicyRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload set_iam_policy(resource: nil, policy: nil, update_mask: nil) - # Pass arguments to `set_iam_policy` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param resource [::String] - # REQUIRED: The resource for which the policy is being specified. - # See the operation documentation for the appropriate value for this field. - # @param policy [::Google::Iam::V1::Policy, ::Hash] - # REQUIRED: The complete policy to be applied to the `resource`. The size of - # the policy is limited to a few 10s of KB. An empty policy is a - # valid policy but certain Cloud Platform services (such as Projects) - # might reject them. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only - # the fields in the mask will be modified. If no mask is provided, the - # following default mask is used: - # - # `paths: "bindings, etag"` - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Iam::V1::Policy] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Iam::V1::Policy] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/iam/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Iam::V1::IAMPolicy::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Iam::V1::SetIamPolicyRequest.new - # - # # Call the set_iam_policy method. - # result = client.set_iam_policy request - # - # # The returned object is of type Google::Iam::V1::Policy. - # p result - # - def set_iam_policy request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::SetIamPolicyRequest - - # Converts hash 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.set_iam_policy.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::VMMigration::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.set_iam_policy.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.set_iam_policy.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @iam_policy_stub.set_iam_policy 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 - - ## - # Gets the access control policy for a resource. - # Returns an empty policy if the resource exists and does not have a policy - # set. - # - # @overload get_iam_policy(request, options = nil) - # Pass arguments to `get_iam_policy` via a request object, either of type - # {::Google::Iam::V1::GetIamPolicyRequest} or an equivalent Hash. - # - # @param request [::Google::Iam::V1::GetIamPolicyRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_iam_policy(resource: nil, options: nil) - # Pass arguments to `get_iam_policy` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param resource [::String] - # REQUIRED: The resource for which the policy is being requested. - # See the operation documentation for the appropriate value for this field. - # @param options [::Google::Iam::V1::GetPolicyOptions, ::Hash] - # OPTIONAL: A `GetPolicyOptions` object for specifying options to - # `GetIamPolicy`. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Iam::V1::Policy] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Iam::V1::Policy] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/iam/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Iam::V1::IAMPolicy::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Iam::V1::GetIamPolicyRequest.new - # - # # Call the get_iam_policy method. - # result = client.get_iam_policy request - # - # # The returned object is of type Google::Iam::V1::Policy. - # p result - # - def get_iam_policy request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::GetIamPolicyRequest - - # Converts hash 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_iam_policy.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::VMMigration::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_iam_policy.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_iam_policy.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @iam_policy_stub.get_iam_policy 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 permissions that a caller has on the specified resource. - # If the resource does not exist, this will return an empty set of - # permissions, not a `NOT_FOUND` error. - # - # Note: This operation is designed to be used for building permission-aware - # UIs and command-line tools, not for authorization checking. This operation - # may "fail open" without warning. - # - # @overload test_iam_permissions(request, options = nil) - # Pass arguments to `test_iam_permissions` via a request object, either of type - # {::Google::Iam::V1::TestIamPermissionsRequest} or an equivalent Hash. - # - # @param request [::Google::Iam::V1::TestIamPermissionsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload test_iam_permissions(resource: nil, permissions: nil) - # Pass arguments to `test_iam_permissions` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param resource [::String] - # REQUIRED: The resource for which the policy detail is being requested. - # See the operation documentation for the appropriate value for this field. - # @param permissions [::Array<::String>] - # The set of permissions to check for the `resource`. Permissions with - # wildcards (such as '*' or 'storage.*') are not allowed. For more - # information see - # [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Iam::V1::TestIamPermissionsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Iam::V1::TestIamPermissionsResponse] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/iam/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Iam::V1::IAMPolicy::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Iam::V1::TestIamPermissionsRequest.new - # - # # Call the test_iam_permissions method. - # result = client.test_iam_permissions request - # - # # The returned object is of type Google::Iam::V1::TestIamPermissionsResponse. - # p result - # - def test_iam_permissions request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::TestIamPermissionsRequest - - # Converts hash 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.test_iam_permissions.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::VMMigration::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.test_iam_permissions.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.test_iam_permissions.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @iam_policy_stub.test_iam_permissions 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 IAMPolicy REST API. - # - # This class represents the configuration for IAMPolicy 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::Iam::V1::IAMPolicy::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 - # # set_iam_policy to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Iam::V1::IAMPolicy::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.set_iam_policy.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Iam::V1::IAMPolicy::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.set_iam_policy.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 = "iam-meta-api.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 IAMPolicy 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 `set_iam_policy` - # @return [::Gapic::Config::Method] - # - attr_reader :set_iam_policy - ## - # RPC-specific configuration for `get_iam_policy` - # @return [::Gapic::Config::Method] - # - attr_reader :get_iam_policy - ## - # RPC-specific configuration for `test_iam_permissions` - # @return [::Gapic::Config::Method] - # - attr_reader :test_iam_permissions - - # @private - def initialize parent_rpcs = nil - set_iam_policy_config = parent_rpcs.set_iam_policy if parent_rpcs.respond_to? :set_iam_policy - @set_iam_policy = ::Gapic::Config::Method.new set_iam_policy_config - get_iam_policy_config = parent_rpcs.get_iam_policy if parent_rpcs.respond_to? :get_iam_policy - @get_iam_policy = ::Gapic::Config::Method.new get_iam_policy_config - test_iam_permissions_config = parent_rpcs.test_iam_permissions if parent_rpcs.respond_to? :test_iam_permissions - @test_iam_permissions = ::Gapic::Config::Method.new test_iam_permissions_config - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-vm_migration-v1/lib/google/iam/v1/iam_policy/rest/service_stub.rb b/owl-bot-staging/google-cloud-vm_migration-v1/lib/google/iam/v1/iam_policy/rest/service_stub.rb deleted file mode 100644 index 0a767ec9f84a..000000000000 --- a/owl-bot-staging/google-cloud-vm_migration-v1/lib/google/iam/v1/iam_policy/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/iam/v1/iam_policy_pb" - -module Google - module Iam - module V1 - module IAMPolicy - module Rest - ## - # REST service stub for the IAMPolicy 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 set_iam_policy REST call - # - # @param request_pb [::Google::Iam::V1::SetIamPolicyRequest] - # 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::Iam::V1::Policy] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Iam::V1::Policy] - # A result object deserialized from the server's reply - def set_iam_policy request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_set_iam_policy_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: "set_iam_policy", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Iam::V1::Policy.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_iam_policy REST call - # - # @param request_pb [::Google::Iam::V1::GetIamPolicyRequest] - # 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::Iam::V1::Policy] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Iam::V1::Policy] - # A result object deserialized from the server's reply - def get_iam_policy request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_iam_policy_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_iam_policy", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Iam::V1::Policy.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the test_iam_permissions REST call - # - # @param request_pb [::Google::Iam::V1::TestIamPermissionsRequest] - # 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::Iam::V1::TestIamPermissionsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Iam::V1::TestIamPermissionsResponse] - # A result object deserialized from the server's reply - def test_iam_permissions request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_test_iam_permissions_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: "test_iam_permissions", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Iam::V1::TestIamPermissionsResponse.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 set_iam_policy REST call - # - # @param request_pb [::Google::Iam::V1::SetIamPolicyRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_set_iam_policy_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{resource}:setIamPolicy", - body: "*", - matches: [ - ["resource", %r{^.*$}, true] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_iam_policy REST call - # - # @param request_pb [::Google::Iam::V1::GetIamPolicyRequest] - # 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_iam_policy_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{resource}:getIamPolicy", - body: "*", - matches: [ - ["resource", %r{^.*$}, true] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the test_iam_permissions REST call - # - # @param request_pb [::Google::Iam::V1::TestIamPermissionsRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_test_iam_permissions_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{resource}:testIamPermissions", - body: "*", - matches: [ - ["resource", %r{^.*$}, true] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-vm_migration-v1/lib/google/iam/v1/rest.rb b/owl-bot-staging/google-cloud-vm_migration-v1/lib/google/iam/v1/rest.rb deleted file mode 100644 index c43b181b146c..000000000000 --- a/owl-bot-staging/google-cloud-vm_migration-v1/lib/google/iam/v1/rest.rb +++ /dev/null @@ -1,36 +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/iam/v1/iam_policy/rest" -require "google/iam/v1/bindings_override" -require "google/cloud/vm_migration/v1/version" - -module Google - module Iam - ## - # To load just the REST part of this package, including all its services, and instantiate a REST client: - # - # @example - # - # require "google/iam/v1/rest" - # client = ::Google::Iam::V1::IAMPolicy::Rest::Client.new - # - module V1 - end - end -end diff --git a/owl-bot-staging/google-cloud-vm_migration-v1/proto_docs/README.md b/owl-bot-staging/google-cloud-vm_migration-v1/proto_docs/README.md deleted file mode 100644 index f5158dc80a37..000000000000 --- a/owl-bot-staging/google-cloud-vm_migration-v1/proto_docs/README.md +++ /dev/null @@ -1,4 +0,0 @@ -# Migrate for Compute Engine 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-vm_migration-v1/proto_docs/google/api/client.rb b/owl-bot-staging/google-cloud-vm_migration-v1/proto_docs/google/api/client.rb deleted file mode 100644 index 3ab0b096d445..000000000000 --- a/owl-bot-staging/google-cloud-vm_migration-v1/proto_docs/google/api/client.rb +++ /dev/null @@ -1,593 +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. - # - # Note: This field should not be used in most cases. - 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: - # library_settings: - # 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. - # @!attribute [rw] library_package - # @return [::String] - # The package name to use in Php. Clobbers the php_namespace option - # set in the protobuf. This should be used **only** by APIs - # who have already set the language_settings.php.package_name" field - # in gapic.yaml. API teams should use the protobuf php_namespace option - # where possible. - # - # Example of a YAML configuration:: - # - # publishing: - # library_settings: - # php_settings: - # library_package: Google\Cloud\PubSub\V1 - 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. - # - # Example: - # - # 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 - # @!attribute [rw] batching - # @return [::Google::Api::BatchingConfigProto] - # Batching configuration for an API method in client libraries. - # - # Example of a YAML configuration: - # - # publishing: - # method_settings: - # - selector: google.example.v1.ExampleService.BatchCreateExample - # batching: - # element_count_threshold: 1000 - # request_byte_threshold: 100000000 - # delay_threshold_millis: 10 - 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. - # - # Note: This feature should not be used in most cases. - # @!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 - - # `BatchingConfigProto` defines the batching configuration for an API method. - # @!attribute [rw] thresholds - # @return [::Google::Api::BatchingSettingsProto] - # The thresholds which trigger a batched request to be sent. - # @!attribute [rw] batch_descriptor - # @return [::Google::Api::BatchingDescriptorProto] - # The request and response fields used in batching. - class BatchingConfigProto - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # `BatchingSettingsProto` specifies a set of batching thresholds, each of - # which acts as a trigger to send a batch of messages as a request. At least - # one threshold must be positive nonzero. - # @!attribute [rw] element_count_threshold - # @return [::Integer] - # The number of elements of a field collected into a batch which, if - # exceeded, causes the batch to be sent. - # @!attribute [rw] request_byte_threshold - # @return [::Integer] - # The aggregated size of the batched field which, if exceeded, causes the - # batch to be sent. This size is computed by aggregating the sizes of the - # request field to be batched, not of the entire request message. - # @!attribute [rw] delay_threshold - # @return [::Google::Protobuf::Duration] - # The duration after which a batch should be sent, starting from the addition - # of the first message to that batch. - # @!attribute [rw] element_count_limit - # @return [::Integer] - # The maximum number of elements collected in a batch that could be accepted - # by server. - # @!attribute [rw] request_byte_limit - # @return [::Integer] - # The maximum size of the request that could be accepted by server. - # @!attribute [rw] flow_control_element_limit - # @return [::Integer] - # The maximum number of elements allowed by flow control. - # @!attribute [rw] flow_control_byte_limit - # @return [::Integer] - # The maximum size of data allowed by flow control. - # @!attribute [rw] flow_control_limit_exceeded_behavior - # @return [::Google::Api::FlowControlLimitExceededBehaviorProto] - # The behavior to take when the flow control limit is exceeded. - class BatchingSettingsProto - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # `BatchingDescriptorProto` specifies the fields of the request message to be - # used for batching, and, optionally, the fields of the response message to be - # used for demultiplexing. - # @!attribute [rw] batched_field - # @return [::String] - # The repeated field in the request message to be aggregated by batching. - # @!attribute [rw] discriminator_fields - # @return [::Array<::String>] - # A list of the fields in the request message. Two requests will be batched - # together only if the values of every field specified in - # `request_discriminator_fields` is equal between the two requests. - # @!attribute [rw] subresponse_field - # @return [::String] - # Optional. When present, indicates the field in the response message to be - # used to demultiplex the response into multiple response messages, in - # correspondence with the multiple request messages originally batched - # together. - class BatchingDescriptorProto - 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 - - # The behavior to take when the flow control limit is exceeded. - module FlowControlLimitExceededBehaviorProto - # Default behavior, system-defined. - UNSET_BEHAVIOR = 0 - - # Stop operation, raise error. - THROW_EXCEPTION = 1 - - # Pause operation until limit clears. - BLOCK = 2 - - # Continue operation, disregard limit. - IGNORE = 3 - end - end -end diff --git a/owl-bot-staging/google-cloud-vm_migration-v1/proto_docs/google/api/field_behavior.rb b/owl-bot-staging/google-cloud-vm_migration-v1/proto_docs/google/api/field_behavior.rb deleted file mode 100644 index 582be187d115..000000000000 --- a/owl-bot-staging/google-cloud-vm_migration-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-vm_migration-v1/proto_docs/google/api/field_info.rb b/owl-bot-staging/google-cloud-vm_migration-v1/proto_docs/google/api/field_info.rb deleted file mode 100644 index 0f5acf0a5538..000000000000 --- a/owl-bot-staging/google-cloud-vm_migration-v1/proto_docs/google/api/field_info.rb +++ /dev/null @@ -1,88 +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 - # Rich semantic information of an API field beyond basic typing. - # @!attribute [rw] format - # @return [::Google::Api::FieldInfo::Format] - # The standard format of a field value. This does not explicitly configure - # any API consumer, just documents the API's format for the field it is - # applied to. - # @!attribute [rw] referenced_types - # @return [::Array<::Google::Api::TypeReference>] - # The type(s) that the annotated, generic field may represent. - # - # Currently, this must only be used on fields of type `google.protobuf.Any`. - # Supporting other generic types may be considered in the future. - class FieldInfo - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The standard format of a field value. The supported formats are all backed - # by either an RFC defined by the IETF or a Google-defined AIP. - module Format - # Default, unspecified value. - FORMAT_UNSPECIFIED = 0 - - # Universally Unique Identifier, version 4, value as defined by - # https://datatracker.ietf.org/doc/html/rfc4122. The value may be - # normalized to entirely lowercase letters. For example, the value - # `F47AC10B-58CC-0372-8567-0E02B2C3D479` would be normalized to - # `f47ac10b-58cc-0372-8567-0e02b2c3d479`. - UUID4 = 1 - - # Internet Protocol v4 value as defined by [RFC - # 791](https://datatracker.ietf.org/doc/html/rfc791). The value may be - # condensed, with leading zeros in each octet stripped. For example, - # `001.022.233.040` would be condensed to `1.22.233.40`. - IPV4 = 2 - - # Internet Protocol v6 value as defined by [RFC - # 2460](https://datatracker.ietf.org/doc/html/rfc2460). The value may be - # normalized to entirely lowercase letters with zeros compressed, following - # [RFC 5952](https://datatracker.ietf.org/doc/html/rfc5952). For example, - # the value `2001:0DB8:0::0` would be normalized to `2001:db8::`. - IPV6 = 3 - - # An IP address in either v4 or v6 format as described by the individual - # values defined herein. See the comments on the IPV4 and IPV6 types for - # allowed normalizations of each. - IPV4_OR_IPV6 = 4 - end - end - - # A reference to a message type, for use in {::Google::Api::FieldInfo FieldInfo}. - # @!attribute [rw] type_name - # @return [::String] - # The name of the type that the annotated, generic field may represent. - # If the type is in the same protobuf package, the value can be the simple - # message name e.g., `"MyMessage"`. Otherwise, the value must be the - # fully-qualified message name e.g., `"google.library.v1.Book"`. - # - # If the type(s) are unknown to the service (e.g. the field accepts generic - # user input), use the wildcard `"*"` to denote this behavior. - # - # See [AIP-202](https://google.aip.dev/202#type-references) for more details. - class TypeReference - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-vm_migration-v1/proto_docs/google/api/launch_stage.rb b/owl-bot-staging/google-cloud-vm_migration-v1/proto_docs/google/api/launch_stage.rb deleted file mode 100644 index 9392a413fb1b..000000000000 --- a/owl-bot-staging/google-cloud-vm_migration-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-vm_migration-v1/proto_docs/google/api/resource.rb b/owl-bot-staging/google-cloud-vm_migration-v1/proto_docs/google/api/resource.rb deleted file mode 100644 index 25dec4847ac1..000000000000 --- a/owl-bot-staging/google-cloud-vm_migration-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-vm_migration-v1/proto_docs/google/cloud/vmmigration/v1/vmmigration.rb b/owl-bot-staging/google-cloud-vm_migration-v1/proto_docs/google/cloud/vmmigration/v1/vmmigration.rb deleted file mode 100644 index 3619ed09a8ed..000000000000 --- a/owl-bot-staging/google-cloud-vm_migration-v1/proto_docs/google/cloud/vmmigration/v1/vmmigration.rb +++ /dev/null @@ -1,4882 +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 VMMigration - module V1 - # ReplicationCycle contains information about the current replication cycle - # status. - # @!attribute [rw] name - # @return [::String] - # The identifier of the ReplicationCycle. - # @!attribute [rw] cycle_number - # @return [::Integer] - # The cycle's ordinal number. - # @!attribute [rw] start_time - # @return [::Google::Protobuf::Timestamp] - # The time the replication cycle has started. - # @!attribute [rw] end_time - # @return [::Google::Protobuf::Timestamp] - # The time the replication cycle has ended. - # @!attribute [rw] total_pause_duration - # @return [::Google::Protobuf::Duration] - # The accumulated duration the replication cycle was paused. - # @!attribute [rw] progress_percent - # @deprecated This field is deprecated and may be removed in the next major version update. - # @return [::Integer] - # The current progress in percentage of this cycle. - # Was replaced by 'steps' field, which breaks down the cycle progression more - # accurately. - # @!attribute [rw] steps - # @return [::Array<::Google::Cloud::VMMigration::V1::CycleStep>] - # The cycle's steps list representing its progress. - # @!attribute [rw] state - # @return [::Google::Cloud::VMMigration::V1::ReplicationCycle::State] - # State of the ReplicationCycle. - # @!attribute [r] error - # @return [::Google::Rpc::Status] - # Output only. Provides details on the state of the cycle in case of an - # error. - # @!attribute [r] warnings - # @return [::Array<::Google::Cloud::VMMigration::V1::MigrationWarning>] - # Output only. Warnings that occurred during the cycle. - class ReplicationCycle - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Possible states of a replication cycle. - module State - # The state is unknown. This is used for API compatibility only and is not - # used by the system. - STATE_UNSPECIFIED = 0 - - # The replication cycle is running. - RUNNING = 1 - - # The replication cycle is paused. - PAUSED = 2 - - # The replication cycle finished with errors. - FAILED = 3 - - # The replication cycle finished successfully. - SUCCEEDED = 4 - end - end - - # CycleStep holds information about a step progress. - # @!attribute [rw] initializing_replication - # @return [::Google::Cloud::VMMigration::V1::InitializingReplicationStep] - # Initializing replication step. - # - # Note: The following fields are mutually exclusive: `initializing_replication`, `replicating`, `post_processing`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] replicating - # @return [::Google::Cloud::VMMigration::V1::ReplicatingStep] - # Replicating step. - # - # Note: The following fields are mutually exclusive: `replicating`, `initializing_replication`, `post_processing`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] post_processing - # @return [::Google::Cloud::VMMigration::V1::PostProcessingStep] - # Post processing step. - # - # Note: The following fields are mutually exclusive: `post_processing`, `initializing_replication`, `replicating`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] start_time - # @return [::Google::Protobuf::Timestamp] - # The time the cycle step has started. - # @!attribute [rw] end_time - # @return [::Google::Protobuf::Timestamp] - # The time the cycle step has ended. - class CycleStep - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # InitializingReplicationStep contains specific step details. - class InitializingReplicationStep - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # ReplicatingStep contains specific step details. - # @!attribute [rw] total_bytes - # @return [::Integer] - # Total bytes to be handled in the step. - # @!attribute [rw] replicated_bytes - # @return [::Integer] - # Replicated bytes in the step. - # @!attribute [rw] last_two_minutes_average_bytes_per_second - # @return [::Integer] - # The source disks replication rate for the last 2 minutes in bytes per - # second. - # @!attribute [rw] last_thirty_minutes_average_bytes_per_second - # @return [::Integer] - # The source disks replication rate for the last 30 minutes in bytes per - # second. - class ReplicatingStep - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # PostProcessingStep contains specific step details. - class PostProcessingStep - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # ReplicationSync contain information about the last replica sync to the cloud. - # @!attribute [rw] last_sync_time - # @return [::Google::Protobuf::Timestamp] - # The most updated snapshot created time in the source that finished - # replication. - class ReplicationSync - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # MigratingVm describes the VM that will be migrated from a Source environment - # and its replication state. - # @!attribute [rw] compute_engine_target_defaults - # @return [::Google::Cloud::VMMigration::V1::ComputeEngineTargetDefaults] - # Details of the target VM in Compute Engine. - # - # Note: The following fields are mutually exclusive: `compute_engine_target_defaults`, `compute_engine_disks_target_defaults`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] compute_engine_disks_target_defaults - # @return [::Google::Cloud::VMMigration::V1::ComputeEngineDisksTargetDefaults] - # Details of the target Persistent Disks in Compute Engine. - # - # Note: The following fields are mutually exclusive: `compute_engine_disks_target_defaults`, `compute_engine_target_defaults`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [r] vmware_source_vm_details - # @return [::Google::Cloud::VMMigration::V1::VmwareSourceVmDetails] - # Output only. Details of the VM from a Vmware source. - # - # Note: The following fields are mutually exclusive: `vmware_source_vm_details`, `aws_source_vm_details`, `azure_source_vm_details`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [r] aws_source_vm_details - # @return [::Google::Cloud::VMMigration::V1::AwsSourceVmDetails] - # Output only. Details of the VM from an AWS source. - # - # Note: The following fields are mutually exclusive: `aws_source_vm_details`, `vmware_source_vm_details`, `azure_source_vm_details`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [r] azure_source_vm_details - # @return [::Google::Cloud::VMMigration::V1::AzureSourceVmDetails] - # Output only. Details of the VM from an Azure source. - # - # Note: The following fields are mutually exclusive: `azure_source_vm_details`, `vmware_source_vm_details`, `aws_source_vm_details`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [r] name - # @return [::String] - # Output only. The identifier of the MigratingVm. - # @!attribute [rw] source_vm_id - # @return [::String] - # The unique ID of the VM in the source. - # The VM's name in vSphere can be changed, so this is not the VM's name but - # rather its moRef id. This id is of the form vm-. - # @!attribute [rw] display_name - # @return [::String] - # The display name attached to the MigratingVm by the user. - # @!attribute [rw] description - # @return [::String] - # The description attached to the migrating VM by the user. - # @!attribute [rw] policy - # @return [::Google::Cloud::VMMigration::V1::SchedulePolicy] - # The replication schedule policy. - # @!attribute [r] create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time the migrating VM was created (this refers to this - # resource and not to the time it was installed in the source). - # @!attribute [r] update_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The last time the migrating VM resource was updated. - # @!attribute [r] last_sync - # @return [::Google::Cloud::VMMigration::V1::ReplicationSync] - # Output only. The most updated snapshot created time in the source that - # finished replication. - # @!attribute [r] state - # @return [::Google::Cloud::VMMigration::V1::MigratingVm::State] - # Output only. State of the MigratingVm. - # @!attribute [r] state_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The last time the migrating VM state was updated. - # @!attribute [r] current_sync_info - # @return [::Google::Cloud::VMMigration::V1::ReplicationCycle] - # Output only. Details of the current running replication cycle. - # @!attribute [r] last_replication_cycle - # @return [::Google::Cloud::VMMigration::V1::ReplicationCycle] - # Output only. Details of the last replication cycle. This will be updated - # whenever a replication cycle is finished and is not to be confused with - # last_sync which is only updated on successful replication cycles. - # @!attribute [r] group - # @return [::String] - # Output only. The group this migrating vm is included in, if any. The group - # is represented by the full path of the appropriate - # {::Google::Cloud::VMMigration::V1::Group Group} resource. - # @!attribute [rw] labels - # @return [::Google::Protobuf::Map{::String => ::String}] - # The labels of the migrating VM. - # @!attribute [r] recent_clone_jobs - # @return [::Array<::Google::Cloud::VMMigration::V1::CloneJob>] - # Output only. The recent {::Google::Cloud::VMMigration::V1::CloneJob clone jobs} - # performed on the migrating VM. This field holds the vm's last completed - # clone job and the vm's running clone job, if one exists. - # Note: To have this field populated you need to explicitly request it via - # the "view" parameter of the Get/List request. - # @!attribute [r] error - # @return [::Google::Rpc::Status] - # Output only. Provides details on the state of the Migrating VM in case of - # an error in replication. - # @!attribute [r] recent_cutover_jobs - # @return [::Array<::Google::Cloud::VMMigration::V1::CutoverJob>] - # Output only. The recent cutover jobs performed on the migrating VM. - # This field holds the vm's last completed cutover job and the vm's - # running cutover job, if one exists. - # Note: To have this field populated you need to explicitly request it via - # the "view" parameter of the Get/List request. - # @!attribute [r] cutover_forecast - # @return [::Google::Cloud::VMMigration::V1::CutoverForecast] - # Output only. Provides details of future CutoverJobs of a MigratingVm. - # Set to empty when cutover forecast is unavailable. - # @!attribute [r] expiration - # @return [::Google::Cloud::VMMigration::V1::MigratingVm::Expiration] - # Output only. Provides details about the expiration state of the migrating - # VM. - class MigratingVm - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Expiration holds information about the expiration of a MigratingVm. - # @!attribute [r] expire_time - # @return [::Google::Protobuf::Timestamp] - # Output only. Timestamp of when this resource is considered expired. - # @!attribute [r] extension_count - # @return [::Integer] - # Output only. The number of times expiration was extended. - # @!attribute [r] extendable - # @return [::Boolean] - # Output only. Describes whether the expiration can be extended. - class Expiration - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class LabelsEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The possible values of the state/health of source VM. - module State - # The state was not sampled by the health checks yet. - STATE_UNSPECIFIED = 0 - - # The VM in the source is being verified. - PENDING = 1 - - # The source VM was verified, and it's ready to start replication. - READY = 2 - - # Migration is going through the first sync cycle. - FIRST_SYNC = 3 - - # The replication is active, and it's running or scheduled to run. - ACTIVE = 4 - - # The source VM is being turned off, and a final replication is currently - # running. - CUTTING_OVER = 7 - - # The source VM was stopped and replicated. The replication is currently - # paused. - CUTOVER = 8 - - # A cutover job is active and replication cycle is running the final sync. - FINAL_SYNC = 9 - - # The replication was paused by the user and no cycles are scheduled to - # run. - PAUSED = 10 - - # The migrating VM is being finalized and migration resources are being - # removed. - FINALIZING = 11 - - # The replication process is done. The migrating VM is finalized and no - # longer consumes billable resources. - FINALIZED = 12 - - # The replication process encountered an unrecoverable error and was - # aborted. - ERROR = 13 - - # The migrating VM has passed its expiration date. It might be possible to - # bring it back to "Active" state by updating the TTL field. For more - # information, see the documentation. - EXPIRED = 14 - - # The migrating VM's has been finalized and migration resources have been - # removed. - FINALIZED_EXPIRED = 17 - end - end - - # CutoverForecast holds information about future CutoverJobs of a MigratingVm. - # @!attribute [r] estimated_cutover_job_duration - # @return [::Google::Protobuf::Duration] - # Output only. Estimation of the CutoverJob duration. - class CutoverForecast - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # CloneJob describes the process of creating a clone of a - # {::Google::Cloud::VMMigration::V1::MigratingVm MigratingVM} to the - # requested target based on the latest successful uploaded snapshots. - # While the migration cycles of a MigratingVm take place, it is possible to - # verify the uploaded VM can be started in the cloud, by creating a clone. The - # clone can be created without any downtime, and it is created using the latest - # snapshots which are already in the cloud. The cloneJob is only responsible - # for its work, not its products, which means once it is finished, it will - # never touch the instance it created. It will only delete it in case of the - # CloneJob being cancelled or upon failure to clone. - # @!attribute [r] compute_engine_target_details - # @return [::Google::Cloud::VMMigration::V1::ComputeEngineTargetDetails] - # Output only. Details of the target VM in Compute Engine. - # - # Note: The following fields are mutually exclusive: `compute_engine_target_details`, `compute_engine_disks_target_details`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [r] compute_engine_disks_target_details - # @return [::Google::Cloud::VMMigration::V1::ComputeEngineDisksTargetDetails] - # Output only. Details of the target Persistent Disks in Compute Engine. - # - # Note: The following fields are mutually exclusive: `compute_engine_disks_target_details`, `compute_engine_target_details`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [r] create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time the clone job was created (as an API call, not when - # it was actually created in the target). - # @!attribute [r] end_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time the clone job was ended. - # @!attribute [r] name - # @return [::String] - # Output only. The name of the clone. - # @!attribute [r] state - # @return [::Google::Cloud::VMMigration::V1::CloneJob::State] - # Output only. State of the clone job. - # @!attribute [r] state_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time the state was last updated. - # @!attribute [r] error - # @return [::Google::Rpc::Status] - # Output only. Provides details for the errors that led to the Clone Job's - # state. - # @!attribute [r] steps - # @return [::Array<::Google::Cloud::VMMigration::V1::CloneStep>] - # Output only. The clone steps list representing its progress. - class CloneJob - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Possible states of the clone job. - module State - # The state is unknown. This is used for API compatibility only and is not - # used by the system. - STATE_UNSPECIFIED = 0 - - # The clone job has not yet started. - PENDING = 1 - - # The clone job is active and running. - ACTIVE = 2 - - # The clone job finished with errors. - FAILED = 3 - - # The clone job finished successfully. - SUCCEEDED = 4 - - # The clone job was cancelled. - CANCELLED = 5 - - # The clone job is being cancelled. - CANCELLING = 6 - - # OS adaptation is running as part of the clone job to generate license. - ADAPTING_OS = 7 - end - end - - # CloneStep holds information about the clone step progress. - # @!attribute [rw] adapting_os - # @return [::Google::Cloud::VMMigration::V1::AdaptingOSStep] - # Adapting OS step. - # - # Note: The following fields are mutually exclusive: `adapting_os`, `preparing_vm_disks`, `instantiating_migrated_vm`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] preparing_vm_disks - # @return [::Google::Cloud::VMMigration::V1::PreparingVMDisksStep] - # Preparing VM disks step. - # - # Note: The following fields are mutually exclusive: `preparing_vm_disks`, `adapting_os`, `instantiating_migrated_vm`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] instantiating_migrated_vm - # @return [::Google::Cloud::VMMigration::V1::InstantiatingMigratedVMStep] - # Instantiating migrated VM step. - # - # Note: The following fields are mutually exclusive: `instantiating_migrated_vm`, `adapting_os`, `preparing_vm_disks`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] start_time - # @return [::Google::Protobuf::Timestamp] - # The time the step has started. - # @!attribute [rw] end_time - # @return [::Google::Protobuf::Timestamp] - # The time the step has ended. - class CloneStep - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # AdaptingOSStep contains specific step details. - class AdaptingOSStep - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # PreparingVMDisksStep contains specific step details. - class PreparingVMDisksStep - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # InstantiatingMigratedVMStep contains specific step details. - class InstantiatingMigratedVMStep - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # CutoverJob message describes a cutover of a migrating VM. The CutoverJob is - # the operation of shutting down the VM, creating a snapshot and - # cloning the VM using the replicated snapshot. - # @!attribute [r] compute_engine_target_details - # @return [::Google::Cloud::VMMigration::V1::ComputeEngineTargetDetails] - # Output only. Details of the target VM in Compute Engine. - # - # Note: The following fields are mutually exclusive: `compute_engine_target_details`, `compute_engine_disks_target_details`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [r] compute_engine_disks_target_details - # @return [::Google::Cloud::VMMigration::V1::ComputeEngineDisksTargetDetails] - # Output only. Details of the target Persistent Disks in Compute Engine. - # - # Note: The following fields are mutually exclusive: `compute_engine_disks_target_details`, `compute_engine_target_details`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [r] create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time the cutover job was created (as an API call, not when - # it was actually created in the target). - # @!attribute [r] end_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time the cutover job had finished. - # @!attribute [r] name - # @return [::String] - # Output only. The name of the cutover job. - # @!attribute [r] state - # @return [::Google::Cloud::VMMigration::V1::CutoverJob::State] - # Output only. State of the cutover job. - # @!attribute [r] state_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time the state was last updated. - # @!attribute [r] progress_percent - # @return [::Integer] - # Output only. The current progress in percentage of the cutover job. - # @!attribute [r] error - # @return [::Google::Rpc::Status] - # Output only. Provides details for the errors that led to the Cutover Job's - # state. - # @!attribute [r] state_message - # @return [::String] - # Output only. A message providing possible extra details about the current - # state. - # @!attribute [r] steps - # @return [::Array<::Google::Cloud::VMMigration::V1::CutoverStep>] - # Output only. The cutover steps list representing its progress. - class CutoverJob - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Possible states of the cutover job. - module State - # The state is unknown. This is used for API compatibility only and is not - # used by the system. - STATE_UNSPECIFIED = 0 - - # The cutover job has not yet started. - PENDING = 1 - - # The cutover job finished with errors. - FAILED = 2 - - # The cutover job finished successfully. - SUCCEEDED = 3 - - # The cutover job was cancelled. - CANCELLED = 4 - - # The cutover job is being cancelled. - CANCELLING = 5 - - # The cutover job is active and running. - ACTIVE = 6 - - # OS adaptation is running as part of the cutover job to generate license. - ADAPTING_OS = 7 - end - end - - # CutoverStep holds information about the cutover step progress. - # @!attribute [rw] previous_replication_cycle - # @return [::Google::Cloud::VMMigration::V1::ReplicationCycle] - # A replication cycle prior cutover step. - # - # Note: The following fields are mutually exclusive: `previous_replication_cycle`, `shutting_down_source_vm`, `final_sync`, `preparing_vm_disks`, `instantiating_migrated_vm`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] shutting_down_source_vm - # @return [::Google::Cloud::VMMigration::V1::ShuttingDownSourceVMStep] - # Shutting down VM step. - # - # Note: The following fields are mutually exclusive: `shutting_down_source_vm`, `previous_replication_cycle`, `final_sync`, `preparing_vm_disks`, `instantiating_migrated_vm`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] final_sync - # @return [::Google::Cloud::VMMigration::V1::ReplicationCycle] - # Final sync step. - # - # Note: The following fields are mutually exclusive: `final_sync`, `previous_replication_cycle`, `shutting_down_source_vm`, `preparing_vm_disks`, `instantiating_migrated_vm`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] preparing_vm_disks - # @return [::Google::Cloud::VMMigration::V1::PreparingVMDisksStep] - # Preparing VM disks step. - # - # Note: The following fields are mutually exclusive: `preparing_vm_disks`, `previous_replication_cycle`, `shutting_down_source_vm`, `final_sync`, `instantiating_migrated_vm`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] instantiating_migrated_vm - # @return [::Google::Cloud::VMMigration::V1::InstantiatingMigratedVMStep] - # Instantiating migrated VM step. - # - # Note: The following fields are mutually exclusive: `instantiating_migrated_vm`, `previous_replication_cycle`, `shutting_down_source_vm`, `final_sync`, `preparing_vm_disks`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] start_time - # @return [::Google::Protobuf::Timestamp] - # The time the step has started. - # @!attribute [rw] end_time - # @return [::Google::Protobuf::Timestamp] - # The time the step has ended. - class CutoverStep - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # ShuttingDownSourceVMStep contains specific step details. - class ShuttingDownSourceVMStep - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for 'CreateCloneJob' request. - # @!attribute [rw] parent - # @return [::String] - # Required. The Clone's parent. - # @!attribute [rw] clone_job_id - # @return [::String] - # Required. The clone job identifier. - # @!attribute [rw] clone_job - # @return [::Google::Cloud::VMMigration::V1::CloneJob] - # Required. The clone request body. - # @!attribute [rw] request_id - # @return [::String] - # A request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server will guarantee - # that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - class CreateCloneJobRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for 'CancelCloneJob' request. - # @!attribute [rw] name - # @return [::String] - # Required. The clone job id - class CancelCloneJobRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for 'CancelCloneJob' request. - class CancelCloneJobResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for 'ListCloneJobsRequest' request. - # @!attribute [rw] parent - # @return [::String] - # Required. The parent, which owns this collection of source VMs. - # @!attribute [rw] page_size - # @return [::Integer] - # Optional. The maximum number of clone jobs to return. The service may - # return fewer than this value. If unspecified, at most 500 clone jobs will - # be returned. The maximum value is 1000; values above 1000 will be coerced - # to 1000. - # @!attribute [rw] page_token - # @return [::String] - # Required. A page token, received from a previous `ListCloneJobs` call. - # Provide this to retrieve the subsequent page. - # - # When paginating, all other parameters provided to `ListCloneJobs` must - # match the call that provided the page token. - # @!attribute [rw] filter - # @return [::String] - # Optional. The filter request. - # @!attribute [rw] order_by - # @return [::String] - # Optional. the order by fields for the result. - class ListCloneJobsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for 'ListCloneJobs' request. - # @!attribute [r] clone_jobs - # @return [::Array<::Google::Cloud::VMMigration::V1::CloneJob>] - # Output only. The list of clone jobs response. - # @!attribute [r] next_page_token - # @return [::String] - # Output only. A token, which can be sent as `page_token` to retrieve the - # next page. If this field is omitted, there are no subsequent pages. - # @!attribute [r] unreachable - # @return [::Array<::String>] - # Output only. Locations that could not be reached. - class ListCloneJobsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for 'GetCloneJob' request. - # @!attribute [rw] name - # @return [::String] - # Required. The name of the CloneJob. - class GetCloneJobRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Source message describes a specific vm migration Source resource. It contains - # the source environment information. - # @!attribute [rw] vmware - # @return [::Google::Cloud::VMMigration::V1::VmwareSourceDetails] - # Vmware type source details. - # - # Note: The following fields are mutually exclusive: `vmware`, `aws`, `azure`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] aws - # @return [::Google::Cloud::VMMigration::V1::AwsSourceDetails] - # AWS type source details. - # - # Note: The following fields are mutually exclusive: `aws`, `vmware`, `azure`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] azure - # @return [::Google::Cloud::VMMigration::V1::AzureSourceDetails] - # Azure type source details. - # - # Note: The following fields are mutually exclusive: `azure`, `vmware`, `aws`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [r] name - # @return [::String] - # Output only. The Source name. - # @!attribute [r] create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The create time timestamp. - # @!attribute [r] update_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The update time timestamp. - # @!attribute [rw] labels - # @return [::Google::Protobuf::Map{::String => ::String}] - # The labels of the source. - # @!attribute [rw] description - # @return [::String] - # User-provided description of the source. - # @!attribute [rw] encryption - # @return [::Google::Cloud::VMMigration::V1::Encryption] - # Optional. Immutable. The encryption details of the source data stored by - # the service. - class Source - 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 - end - - # Encryption message describes the details of the applied encryption. - # @!attribute [rw] kms_key - # @return [::String] - # Required. The name of the encryption key that is stored in Google Cloud - # KMS. - class Encryption - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # VmwareSourceDetails message describes a specific source details for the - # vmware source type. - # @!attribute [rw] username - # @return [::String] - # The credentials username. - # @!attribute [rw] password - # @return [::String] - # Input only. The credentials password. This is write only and can not be - # read in a GET operation. - # @!attribute [rw] vcenter_ip - # @return [::String] - # The ip address of the vcenter this Source represents. - # @!attribute [rw] thumbprint - # @return [::String] - # The thumbprint representing the certificate for the vcenter. - # @!attribute [rw] resolved_vcenter_host - # @return [::String] - # The hostname of the vcenter. - class VmwareSourceDetails - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # AwsSourceDetails message describes a specific source details for the - # AWS source type. - # @!attribute [rw] access_key_creds - # @return [::Google::Cloud::VMMigration::V1::AwsSourceDetails::AccessKeyCredentials] - # AWS Credentials using access key id and secret. - # @!attribute [rw] aws_region - # @return [::String] - # Immutable. The AWS region that the source VMs will be migrated from. - # @!attribute [r] state - # @return [::Google::Cloud::VMMigration::V1::AwsSourceDetails::State] - # Output only. State of the source as determined by the health check. - # @!attribute [r] error - # @return [::Google::Rpc::Status] - # Output only. Provides details on the state of the Source in case of an - # error. - # @!attribute [rw] inventory_tag_list - # @return [::Array<::Google::Cloud::VMMigration::V1::AwsSourceDetails::Tag>] - # AWS resource tags to limit the scope of the source inventory. - # @!attribute [rw] inventory_security_group_names - # @return [::Array<::String>] - # AWS security group names to limit the scope of the source - # inventory. - # @!attribute [rw] migration_resources_user_tags - # @return [::Google::Protobuf::Map{::String => ::String}] - # User specified tags to add to every M2VM generated resource in AWS. - # These tags will be set in addition to the default tags that are set as part - # of the migration process. The tags must not begin with the reserved prefix - # `m2vm`. - # @!attribute [r] public_ip - # @return [::String] - # Output only. The source's public IP. All communication initiated by this - # source will originate from this IP. - class AwsSourceDetails - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Message describing AWS Credentials using access key id and secret. - # @!attribute [rw] access_key_id - # @return [::String] - # AWS access key ID. - # @!attribute [rw] secret_access_key - # @return [::String] - # Input only. AWS secret access key. - # @!attribute [rw] session_token - # @return [::String] - # Input only. AWS session token. - # Used only when AWS security token service (STS) is responsible for - # creating the temporary credentials. - class AccessKeyCredentials - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Tag is an AWS tag representation. - # @!attribute [rw] key - # @return [::String] - # Required. Key of tag. - # @!attribute [rw] value - # @return [::String] - # Required. Value of tag. - class Tag - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class MigrationResourcesUserTagsEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The possible values of the state. - module State - # The state is unknown. This is used for API compatibility only and is not - # used by the system. - STATE_UNSPECIFIED = 0 - - # The state was not sampled by the health checks yet. - PENDING = 1 - - # The source is available but might not be usable yet due to invalid - # credentials or another reason. - # The error message will contain further details. - FAILED = 2 - - # The source exists and its credentials were verified. - ACTIVE = 3 - end - end - - # AzureSourceDetails message describes a specific source details for the - # Azure source type. - # @!attribute [rw] client_secret_creds - # @return [::Google::Cloud::VMMigration::V1::AzureSourceDetails::ClientSecretCredentials] - # Azure Credentials using tenant ID, client ID and secret. - # @!attribute [rw] subscription_id - # @return [::String] - # Immutable. Azure subscription ID. - # @!attribute [rw] azure_location - # @return [::String] - # Immutable. The Azure location (region) that the source VMs will be migrated - # from. - # @!attribute [r] state - # @return [::Google::Cloud::VMMigration::V1::AzureSourceDetails::State] - # Output only. State of the source as determined by the health check. - # @!attribute [r] error - # @return [::Google::Rpc::Status] - # Output only. Provides details on the state of the Source in case of an - # error. - # @!attribute [rw] migration_resources_user_tags - # @return [::Google::Protobuf::Map{::String => ::String}] - # User specified tags to add to every M2VM generated resource in Azure. - # These tags will be set in addition to the default tags that are set as part - # of the migration process. The tags must not begin with the reserved prefix - # `m4ce` or `m2vm`. - # @!attribute [r] resource_group_id - # @return [::String] - # Output only. The ID of the Azure resource group that contains all resources - # related to the migration process of this source. - class AzureSourceDetails - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Message describing Azure Credentials using tenant ID, client ID and secret. - # @!attribute [rw] tenant_id - # @return [::String] - # Azure tenant ID. - # @!attribute [rw] client_id - # @return [::String] - # Azure client ID. - # @!attribute [rw] client_secret - # @return [::String] - # Input only. Azure client secret. - class ClientSecretCredentials - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class MigrationResourcesUserTagsEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The possible values of the state. - module State - # The state is unknown. This is used for API compatibility only and is not - # used by the system. - STATE_UNSPECIFIED = 0 - - # The state was not sampled by the health checks yet. - PENDING = 1 - - # The source is available but might not be usable yet due to invalid - # credentials or another reason. - # The error message will contain further details. - FAILED = 2 - - # The source exists and its credentials were verified. - ACTIVE = 3 - end - end - - # DatacenterConnector message describes a connector between the Source and - # Google Cloud, which is installed on a vmware datacenter (an OVA vm installed - # by the user) to connect the Datacenter to Google Cloud and support vm - # migration data transfer. - # @!attribute [r] create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time the connector was created (as an API call, not when - # it was actually installed). - # @!attribute [r] update_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The last time the connector was updated with an API call. - # @!attribute [r] name - # @return [::String] - # Output only. The connector's name. - # @!attribute [rw] registration_id - # @return [::String] - # Immutable. A unique key for this connector. This key is internal to the OVA - # connector and is supplied with its creation during the registration process - # and can not be modified. - # @!attribute [rw] service_account - # @return [::String] - # The service account to use in the connector when communicating with the - # cloud. - # @!attribute [rw] version - # @return [::String] - # The version running in the DatacenterConnector. This is supplied by the OVA - # connector during the registration process and can not be modified. - # @!attribute [r] bucket - # @return [::String] - # Output only. The communication channel between the datacenter connector and - # Google Cloud. - # @!attribute [r] state - # @return [::Google::Cloud::VMMigration::V1::DatacenterConnector::State] - # Output only. State of the DatacenterConnector, as determined by the health - # checks. - # @!attribute [r] state_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time the state was last set. - # @!attribute [r] error - # @return [::Google::Rpc::Status] - # Output only. Provides details on the state of the Datacenter Connector in - # case of an error. - # @!attribute [r] appliance_infrastructure_version - # @return [::String] - # Output only. Appliance OVA version. - # This is the OVA which is manually installed by the user and contains the - # infrastructure for the automatically updatable components on the appliance. - # @!attribute [r] appliance_software_version - # @return [::String] - # Output only. Appliance last installed update bundle version. - # This is the version of the automatically updatable components on the - # appliance. - # @!attribute [r] available_versions - # @return [::Google::Cloud::VMMigration::V1::AvailableUpdates] - # Output only. The available versions for updating this appliance. - # @!attribute [r] upgrade_status - # @return [::Google::Cloud::VMMigration::V1::UpgradeStatus] - # Output only. The status of the current / last upgradeAppliance operation. - class DatacenterConnector - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The possible values of the state. - module State - # The state is unknown. This is used for API compatibility only and is not - # used by the system. - STATE_UNSPECIFIED = 0 - - # The state was not sampled by the health checks yet. - PENDING = 1 - - # The source was sampled by health checks and is not available. - OFFLINE = 2 - - # The source is available but might not be usable yet due to unvalidated - # credentials or another reason. The credentials referred to are the ones - # to the Source. The error message will contain further details. - FAILED = 3 - - # The source exists and its credentials were verified. - ACTIVE = 4 - end - end - - # UpgradeStatus contains information about upgradeAppliance operation. - # @!attribute [rw] version - # @return [::String] - # The version to upgrade to. - # @!attribute [rw] state - # @return [::Google::Cloud::VMMigration::V1::UpgradeStatus::State] - # The state of the upgradeAppliance operation. - # @!attribute [r] error - # @return [::Google::Rpc::Status] - # Output only. Provides details on the state of the upgrade operation in case - # of an error. - # @!attribute [rw] start_time - # @return [::Google::Protobuf::Timestamp] - # The time the operation was started. - # @!attribute [rw] previous_version - # @return [::String] - # The version from which we upgraded. - class UpgradeStatus - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The possible values of the state. - module State - # The state was not sampled by the health checks yet. - STATE_UNSPECIFIED = 0 - - # The upgrade has started. - RUNNING = 1 - - # The upgrade failed. - FAILED = 2 - - # The upgrade finished successfully. - SUCCEEDED = 3 - end - end - - # Holds information about the available versions for upgrade. - # @!attribute [rw] new_deployable_appliance - # @return [::Google::Cloud::VMMigration::V1::ApplianceVersion] - # The newest deployable version of the appliance. - # The current appliance can't be updated into this version, and the owner - # must manually deploy this OVA to a new appliance. - # @!attribute [rw] in_place_update - # @return [::Google::Cloud::VMMigration::V1::ApplianceVersion] - # The latest version for in place update. - # The current appliance can be updated to this version using the API or m4c - # CLI. - class AvailableUpdates - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Describes an appliance version. - # @!attribute [rw] version - # @return [::String] - # The appliance version. - # @!attribute [rw] uri - # @return [::String] - # A link for downloading the version. - # @!attribute [rw] critical - # @return [::Boolean] - # Determine whether it's critical to upgrade the appliance to this version. - # @!attribute [rw] release_notes_uri - # @return [::String] - # Link to a page that contains the version release notes. - class ApplianceVersion - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for 'ListSources' request. - # @!attribute [rw] parent - # @return [::String] - # Required. The parent, which owns this collection of sources. - # @!attribute [rw] page_size - # @return [::Integer] - # Optional. The maximum number of sources to return. The service may return - # fewer than this value. If unspecified, at most 500 sources will be - # returned. The maximum value is 1000; values above 1000 will be coerced to - # 1000. - # @!attribute [rw] page_token - # @return [::String] - # Required. A page token, received from a previous `ListSources` call. - # Provide this to retrieve the subsequent page. - # - # When paginating, all other parameters provided to `ListSources` must - # match the call that provided the page token. - # @!attribute [rw] filter - # @return [::String] - # Optional. The filter request. - # @!attribute [rw] order_by - # @return [::String] - # Optional. the order by fields for the result. - class ListSourcesRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for 'ListSources' request. - # @!attribute [r] sources - # @return [::Array<::Google::Cloud::VMMigration::V1::Source>] - # Output only. The list of sources response. - # @!attribute [r] next_page_token - # @return [::String] - # Output only. A token, which can be sent as `page_token` to retrieve the - # next page. If this field is omitted, there are no subsequent pages. - # @!attribute [r] unreachable - # @return [::Array<::String>] - # Output only. Locations that could not be reached. - class ListSourcesResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for 'GetSource' request. - # @!attribute [rw] name - # @return [::String] - # Required. The Source name. - class GetSourceRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for 'CreateSource' request. - # @!attribute [rw] parent - # @return [::String] - # Required. The Source's parent. - # @!attribute [rw] source_id - # @return [::String] - # Required. The source identifier. - # @!attribute [rw] source - # @return [::Google::Cloud::VMMigration::V1::Source] - # Required. The create request body. - # @!attribute [rw] request_id - # @return [::String] - # A request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server will guarantee - # that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - class CreateSourceRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Update message for 'UpdateSources' request. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # Field mask is used to specify the fields to be overwritten in the - # Source resource by the update. - # The fields specified in the update_mask are relative to the resource, not - # the full request. A field will be overwritten if it is in the mask. If the - # user does not provide a mask then all fields will be overwritten. - # @!attribute [rw] source - # @return [::Google::Cloud::VMMigration::V1::Source] - # Required. The update request body. - # @!attribute [rw] request_id - # @return [::String] - # A request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server will guarantee - # that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - class UpdateSourceRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for 'DeleteSource' request. - # @!attribute [rw] name - # @return [::String] - # Required. The Source name. - # @!attribute [rw] request_id - # @return [::String] - # Optional. A request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server will guarantee - # that for at least 60 minutes after the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - class DeleteSourceRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::VMMigration::V1::VMMigration::Client#fetch_inventory fetchInventory}. - # @!attribute [rw] source - # @return [::String] - # Required. The name of the Source. - # @!attribute [rw] force_refresh - # @return [::Boolean] - # If this flag is set to true, the source will be queried instead of using - # cached results. Using this flag will make the call slower. - class FetchInventoryRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # VmwareVmDetails describes a VM in vCenter. - # @!attribute [rw] vm_id - # @return [::String] - # The VM's id in the source (note that this is not the MigratingVm's id). - # This is the moref id of the VM. - # @!attribute [rw] datacenter_id - # @return [::String] - # The id of the vCenter's datacenter this VM is contained in. - # @!attribute [rw] datacenter_description - # @return [::String] - # The descriptive name of the vCenter's datacenter this VM is contained in. - # @!attribute [rw] uuid - # @return [::String] - # The unique identifier of the VM in vCenter. - # @!attribute [rw] display_name - # @return [::String] - # The display name of the VM. Note that this is not necessarily unique. - # @!attribute [rw] power_state - # @return [::Google::Cloud::VMMigration::V1::VmwareVmDetails::PowerState] - # The power state of the VM at the moment list was taken. - # @!attribute [rw] cpu_count - # @return [::Integer] - # The number of cpus in the VM. - # @!attribute [rw] memory_mb - # @return [::Integer] - # The size of the memory of the VM in MB. - # @!attribute [rw] disk_count - # @return [::Integer] - # The number of disks the VM has. - # @!attribute [rw] committed_storage_mb - # @return [::Integer] - # The total size of the storage allocated to the VM in MB. - # @!attribute [rw] guest_description - # @return [::String] - # The VM's OS. See for example - # https://vdc-repo.vmware.com/vmwb-repository/dcr-public/da47f910-60ac-438b-8b9b-6122f4d14524/16b7274a-bf8b-4b4c-a05e-746f2aa93c8c/doc/vim.vm.GuestOsDescriptor.GuestOsIdentifier.html - # for types of strings this might hold. - # @!attribute [r] boot_option - # @return [::Google::Cloud::VMMigration::V1::VmwareVmDetails::BootOption] - # Output only. The VM Boot Option. - # @!attribute [r] architecture - # @return [::Google::Cloud::VMMigration::V1::VmwareVmDetails::VmArchitecture] - # Output only. The CPU architecture. - class VmwareVmDetails - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Possible values for the power state of the VM. - module PowerState - # Power state is not specified. - POWER_STATE_UNSPECIFIED = 0 - - # The VM is turned ON. - ON = 1 - - # The VM is turned OFF. - OFF = 2 - - # The VM is suspended. This is similar to hibernation or sleep mode. - SUSPENDED = 3 - end - - # Possible values for vm boot option. - module BootOption - # The boot option is unknown. - BOOT_OPTION_UNSPECIFIED = 0 - - # The boot option is EFI. - EFI = 1 - - # The boot option is BIOS. - BIOS = 2 - end - - # Possible values for the VM architecture. - module VmArchitecture - # The architecture is unknown. - VM_ARCHITECTURE_UNSPECIFIED = 0 - - # The architecture is one of the x86 architectures. - VM_ARCHITECTURE_X86_FAMILY = 1 - - # The architecture is ARM64. - VM_ARCHITECTURE_ARM64 = 2 - end - end - - # AwsVmDetails describes a VM in AWS. - # @!attribute [rw] vm_id - # @return [::String] - # The VM ID in AWS. - # @!attribute [rw] display_name - # @return [::String] - # The display name of the VM. Note that this value is not necessarily unique. - # @!attribute [rw] source_id - # @return [::String] - # The id of the AWS's source this VM is connected to. - # @!attribute [rw] source_description - # @return [::String] - # The descriptive name of the AWS's source this VM is connected to. - # @!attribute [r] power_state - # @return [::Google::Cloud::VMMigration::V1::AwsVmDetails::PowerState] - # Output only. The power state of the VM at the moment list was taken. - # @!attribute [rw] cpu_count - # @return [::Integer] - # The number of CPU cores the VM has. - # @!attribute [rw] memory_mb - # @return [::Integer] - # The memory size of the VM in MB. - # @!attribute [rw] disk_count - # @return [::Integer] - # The number of disks the VM has. - # @!attribute [rw] committed_storage_mb - # @return [::Integer] - # The total size of the storage allocated to the VM in MB. - # @!attribute [rw] os_description - # @return [::String] - # The VM's OS. - # @!attribute [rw] boot_option - # @return [::Google::Cloud::VMMigration::V1::AwsVmDetails::BootOption] - # The VM Boot Option. - # @!attribute [rw] instance_type - # @return [::String] - # The instance type of the VM. - # @!attribute [rw] vpc_id - # @return [::String] - # The VPC ID the VM belongs to. - # @!attribute [rw] security_groups - # @return [::Array<::Google::Cloud::VMMigration::V1::AwsSecurityGroup>] - # The security groups the VM belongs to. - # @!attribute [rw] tags - # @return [::Google::Protobuf::Map{::String => ::String}] - # The tags of the VM. - # @!attribute [rw] zone - # @return [::String] - # The AWS zone of the VM. - # @!attribute [rw] virtualization_type - # @return [::Google::Cloud::VMMigration::V1::AwsVmDetails::VmVirtualizationType] - # The virtualization type. - # @!attribute [rw] architecture - # @return [::Google::Cloud::VMMigration::V1::AwsVmDetails::VmArchitecture] - # The CPU architecture. - # @!attribute [rw] vcpu_count - # @return [::Integer] - # The number of vCPUs the VM has. It is calculated as the - # number of CPU cores * threads per CPU the VM has. - class AwsVmDetails - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class TagsEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Possible values for the power state of the VM. - module PowerState - # Power state is not specified. - POWER_STATE_UNSPECIFIED = 0 - - # The VM is turned on. - ON = 1 - - # The VM is turned off. - OFF = 2 - - # The VM is suspended. This is similar to hibernation or sleep - # mode. - SUSPENDED = 3 - - # The VM is starting. - PENDING = 4 - end - - # The possible values for the vm boot option. - module BootOption - # The boot option is unknown. - BOOT_OPTION_UNSPECIFIED = 0 - - # The boot option is UEFI. - EFI = 1 - - # The boot option is LEGACY-BIOS. - BIOS = 2 - end - - # Possible values for the virtualization types of the VM. - module VmVirtualizationType - # The virtualization type is unknown. - VM_VIRTUALIZATION_TYPE_UNSPECIFIED = 0 - - # The virtualziation type is HVM. - HVM = 1 - - # The virtualziation type is PARAVIRTUAL. - PARAVIRTUAL = 2 - end - - # Possible values for the architectures of the VM. - module VmArchitecture - # The architecture is unknown. - VM_ARCHITECTURE_UNSPECIFIED = 0 - - # The architecture is I386. - I386 = 1 - - # The architecture is X86_64. - X86_64 = 2 - - # The architecture is ARM64. - ARM64 = 3 - - # The architecture is X86_64_MAC. - X86_64_MAC = 4 - end - end - - # AwsSecurityGroup describes a security group of an AWS VM. - # @!attribute [rw] id - # @return [::String] - # The AWS security group id. - # @!attribute [rw] name - # @return [::String] - # The AWS security group name. - class AwsSecurityGroup - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # AzureVmDetails describes a VM in Azure. - # @!attribute [rw] vm_id - # @return [::String] - # The VM full path in Azure. - # @!attribute [rw] power_state - # @return [::Google::Cloud::VMMigration::V1::AzureVmDetails::PowerState] - # The power state of the VM at the moment list was taken. - # @!attribute [rw] vm_size - # @return [::String] - # VM size as configured in Azure. Determines the VM's hardware spec. - # @!attribute [rw] cpu_count - # @return [::Integer] - # The number of cpus the VM has. - # @!attribute [rw] memory_mb - # @return [::Integer] - # The memory size of the VM in MB. - # @!attribute [rw] disk_count - # @return [::Integer] - # The number of disks the VM has, including OS disk. - # @!attribute [rw] committed_storage_mb - # @return [::Integer] - # The total size of the storage allocated to the VM in MB. - # @!attribute [rw] os_disk - # @return [::Google::Cloud::VMMigration::V1::AzureVmDetails::OSDisk] - # Description of the OS disk. - # @!attribute [rw] disks - # @return [::Array<::Google::Cloud::VMMigration::V1::AzureVmDetails::Disk>] - # Description of the data disks. - # @!attribute [rw] os_description - # @return [::Google::Cloud::VMMigration::V1::AzureVmDetails::OSDescription] - # Description of the OS. - # @!attribute [rw] boot_option - # @return [::Google::Cloud::VMMigration::V1::AzureVmDetails::BootOption] - # The VM Boot Option. - # @!attribute [rw] tags - # @return [::Google::Protobuf::Map{::String => ::String}] - # The tags of the VM. - # @!attribute [rw] computer_name - # @return [::String] - # The VM's ComputerName. - # @!attribute [rw] architecture - # @return [::Google::Cloud::VMMigration::V1::AzureVmDetails::VmArchitecture] - # The CPU architecture. - class AzureVmDetails - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # A message describing the OS disk. - # @!attribute [rw] type - # @return [::String] - # The disk's type. - # @!attribute [rw] name - # @return [::String] - # The disk's full name. - # @!attribute [rw] size_gb - # @return [::Integer] - # The disk's size in GB. - class OSDisk - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A message describing a data disk. - # @!attribute [rw] name - # @return [::String] - # The disk name. - # @!attribute [rw] size_gb - # @return [::Integer] - # The disk size in GB. - # @!attribute [rw] lun - # @return [::Integer] - # The disk's Logical Unit Number (LUN). - class Disk - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A message describing the VM's OS. Including OS, Publisher, Offer and Plan - # if applicable. - # @!attribute [rw] type - # @return [::String] - # OS type. - # @!attribute [rw] publisher - # @return [::String] - # OS publisher. - # @!attribute [rw] offer - # @return [::String] - # OS offer. - # @!attribute [rw] plan - # @return [::String] - # OS plan. - class OSDescription - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class TagsEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Possible values for the power state of the VM. - module PowerState - # Power state is not specified. - POWER_STATE_UNSPECIFIED = 0 - - # The VM is starting. - STARTING = 1 - - # The VM is running. - RUNNING = 2 - - # The VM is stopping. - STOPPING = 3 - - # The VM is stopped. - STOPPED = 4 - - # The VM is deallocating. - DEALLOCATING = 5 - - # The VM is deallocated. - DEALLOCATED = 6 - - # The VM's power state is unknown. - UNKNOWN = 7 - end - - # The possible values for the vm boot option. - module BootOption - # The boot option is unknown. - BOOT_OPTION_UNSPECIFIED = 0 - - # The boot option is UEFI. - EFI = 1 - - # The boot option is BIOS. - BIOS = 2 - end - - # Possible values for the VM architecture. - module VmArchitecture - # The architecture is unknown. - VM_ARCHITECTURE_UNSPECIFIED = 0 - - # The architecture is one of the x86 architectures. - VM_ARCHITECTURE_X86_FAMILY = 1 - - # The architecture is ARM64. - VM_ARCHITECTURE_ARM64 = 2 - end - end - - # VmwareVmsDetails describes VMs in vCenter. - # @!attribute [rw] details - # @return [::Array<::Google::Cloud::VMMigration::V1::VmwareVmDetails>] - # The details of the vmware VMs. - class VmwareVmsDetails - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # AWSVmsDetails describes VMs in AWS. - # @!attribute [rw] details - # @return [::Array<::Google::Cloud::VMMigration::V1::AwsVmDetails>] - # The details of the AWS VMs. - class AwsVmsDetails - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # AzureVmsDetails describes VMs in Azure. - # @!attribute [rw] details - # @return [::Array<::Google::Cloud::VMMigration::V1::AzureVmDetails>] - # The details of the Azure VMs. - class AzureVmsDetails - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for - # {::Google::Cloud::VMMigration::V1::VMMigration::Client#fetch_inventory fetchInventory}. - # @!attribute [rw] vmware_vms - # @return [::Google::Cloud::VMMigration::V1::VmwareVmsDetails] - # The description of the VMs in a Source of type Vmware. - # - # Note: The following fields are mutually exclusive: `vmware_vms`, `aws_vms`, `azure_vms`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] aws_vms - # @return [::Google::Cloud::VMMigration::V1::AwsVmsDetails] - # The description of the VMs in a Source of type AWS. - # - # Note: The following fields are mutually exclusive: `aws_vms`, `vmware_vms`, `azure_vms`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] azure_vms - # @return [::Google::Cloud::VMMigration::V1::AzureVmsDetails] - # The description of the VMs in a Source of type Azure. - # - # Note: The following fields are mutually exclusive: `azure_vms`, `vmware_vms`, `aws_vms`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [r] update_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The timestamp when the source was last queried (if the result - # is from the cache). - class FetchInventoryResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::VMMigration::V1::VMMigration::Client#fetch_storage_inventory fetchStorageInventory}. - # @!attribute [rw] source - # @return [::String] - # Required. The name of the Source. - # @!attribute [rw] type - # @return [::Google::Cloud::VMMigration::V1::FetchStorageInventoryRequest::StorageType] - # Required. The type of the storage inventory to fetch. - # @!attribute [rw] force_refresh - # @return [::Boolean] - # Optional. If this flag is set to true, the source will be queried instead - # of using cached results. Using this flag will make the call slower. - # @!attribute [rw] page_size - # @return [::Integer] - # Optional. The maximum number of VMs to return. The service may return - # fewer than this value. - # @!attribute [rw] page_token - # @return [::String] - # Optional. A page token, received from a previous `FetchStorageInventory` - # call. Provide this to retrieve the subsequent page. When paginating, all - # other parameters provided to `FetchStorageInventory` must match the call - # that provided the page token. - class FetchStorageInventoryRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The type of the storage inventory to fetch. - module StorageType - # The type is unspecified. - STORAGE_TYPE_UNSPECIFIED = 0 - - # The type is disks. - DISKS = 1 - - # The type is snapshots. - SNAPSHOTS = 2 - end - end - - # Response message for - # {::Google::Cloud::VMMigration::V1::VMMigration::Client#fetch_storage_inventory fetchStorageInventory}. - # @!attribute [rw] resources - # @return [::Array<::Google::Cloud::VMMigration::V1::SourceStorageResource>] - # The list of storage resources in the source. - # @!attribute [r] update_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The timestamp when the source was last queried (if the result - # is from the cache). - # @!attribute [r] next_page_token - # @return [::String] - # Output only. A token, which can be sent as `page_token` to retrieve the - # next page. If this field is omitted, there are no subsequent pages. - class FetchStorageInventoryResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # SourceStorageResource describes a storage resource in the source. - # @!attribute [rw] aws_disk_details - # @return [::Google::Cloud::VMMigration::V1::AwsSourceDiskDetails] - # Source AWS volume details. - class SourceStorageResource - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Utilization report details the utilization (CPU, memory, etc.) of selected - # source VMs. - # @!attribute [r] name - # @return [::String] - # Output only. The report unique name. - # @!attribute [rw] display_name - # @return [::String] - # The report display name, as assigned by the user. - # @!attribute [r] state - # @return [::Google::Cloud::VMMigration::V1::UtilizationReport::State] - # Output only. Current state of the report. - # @!attribute [r] state_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time the state was last set. - # @!attribute [r] error - # @return [::Google::Rpc::Status] - # Output only. Provides details on the state of the report in case of an - # error. - # @!attribute [r] create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time the report was created (this refers to the time of - # the request, not the time the report creation completed). - # @!attribute [rw] time_frame - # @return [::Google::Cloud::VMMigration::V1::UtilizationReport::TimeFrame] - # Time frame of the report. - # @!attribute [r] frame_end_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The point in time when the time frame ends. Notice that the - # time frame is counted backwards. For instance if the "frame_end_time" value - # is 2021/01/20 and the time frame is WEEK then the report covers the week - # between 2021/01/20 and 2021/01/14. - # @!attribute [r] vm_count - # @return [::Integer] - # Output only. Total number of VMs included in the report. - # @!attribute [rw] vms - # @return [::Array<::Google::Cloud::VMMigration::V1::VmUtilizationInfo>] - # List of utilization information per VM. - # When sent as part of the request, the "vm_id" field is used in order to - # specify which VMs to include in the report. In that case all other fields - # are ignored. - class UtilizationReport - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Utilization report state. - module State - # The state is unknown. This value is not in use. - STATE_UNSPECIFIED = 0 - - # The report is in the making. - CREATING = 1 - - # Report creation completed successfully. - SUCCEEDED = 2 - - # Report creation failed. - FAILED = 3 - end - - # Report time frame options. - module TimeFrame - # The time frame was not specified and will default to WEEK. - TIME_FRAME_UNSPECIFIED = 0 - - # One week. - WEEK = 1 - - # One month. - MONTH = 2 - - # One year. - YEAR = 3 - end - end - - # Utilization information of a single VM. - # @!attribute [rw] vmware_vm_details - # @return [::Google::Cloud::VMMigration::V1::VmwareVmDetails] - # The description of the VM in a Source of type Vmware. - # @!attribute [rw] vm_id - # @return [::String] - # The VM's ID in the source. - # @!attribute [rw] utilization - # @return [::Google::Cloud::VMMigration::V1::VmUtilizationMetrics] - # Utilization metrics for this VM. - class VmUtilizationInfo - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Utilization metrics values for a single VM. - # @!attribute [rw] cpu_max_percent - # @return [::Integer] - # Max CPU usage, percent. - # @!attribute [rw] cpu_average_percent - # @return [::Integer] - # Average CPU usage, percent. - # @!attribute [rw] memory_max_percent - # @return [::Integer] - # Max memory usage, percent. - # @!attribute [rw] memory_average_percent - # @return [::Integer] - # Average memory usage, percent. - # @!attribute [rw] disk_io_rate_max_kbps - # @return [::Integer] - # Max disk IO rate, in kilobytes per second. - # @!attribute [rw] disk_io_rate_average_kbps - # @return [::Integer] - # Average disk IO rate, in kilobytes per second. - # @!attribute [rw] network_throughput_max_kbps - # @return [::Integer] - # Max network throughput (combined transmit-rates and receive-rates), in - # kilobytes per second. - # @!attribute [rw] network_throughput_average_kbps - # @return [::Integer] - # Average network throughput (combined transmit-rates and receive-rates), in - # kilobytes per second. - class VmUtilizationMetrics - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for 'ListUtilizationReports' request. - # @!attribute [rw] parent - # @return [::String] - # Required. The Utilization Reports parent. - # @!attribute [rw] view - # @return [::Google::Cloud::VMMigration::V1::UtilizationReportView] - # Optional. The level of details of each report. - # Defaults to BASIC. - # @!attribute [rw] page_size - # @return [::Integer] - # Optional. The maximum number of reports to return. The service may return - # fewer than this value. If unspecified, at most 500 reports will be - # returned. The maximum value is 1000; values above 1000 will be coerced to - # 1000. - # @!attribute [rw] page_token - # @return [::String] - # Required. A page token, received from a previous `ListUtilizationReports` - # call. Provide this to retrieve the subsequent page. - # - # When paginating, all other parameters provided to `ListUtilizationReports` - # must match the call that provided the page token. - # @!attribute [rw] filter - # @return [::String] - # Optional. The filter request. - # @!attribute [rw] order_by - # @return [::String] - # Optional. the order by fields for the result. - class ListUtilizationReportsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for 'ListUtilizationReports' request. - # @!attribute [r] utilization_reports - # @return [::Array<::Google::Cloud::VMMigration::V1::UtilizationReport>] - # Output only. The list of reports. - # @!attribute [r] next_page_token - # @return [::String] - # Output only. A token, which can be sent as `page_token` to retrieve the - # next page. If this field is omitted, there are no subsequent pages. - # @!attribute [r] unreachable - # @return [::Array<::String>] - # Output only. Locations that could not be reached. - class ListUtilizationReportsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for 'GetUtilizationReport' request. - # @!attribute [rw] name - # @return [::String] - # Required. The Utilization Report name. - # @!attribute [rw] view - # @return [::Google::Cloud::VMMigration::V1::UtilizationReportView] - # Optional. The level of details of the report. - # Defaults to FULL - class GetUtilizationReportRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for 'CreateUtilizationReport' request. - # @!attribute [rw] parent - # @return [::String] - # Required. The Utilization Report's parent. - # @!attribute [rw] utilization_report - # @return [::Google::Cloud::VMMigration::V1::UtilizationReport] - # Required. The report to create. - # @!attribute [rw] utilization_report_id - # @return [::String] - # Required. The ID to use for the report, which will become the final - # component of the reports's resource name. - # - # This value maximum length is 63 characters, and valid characters - # are /[a-z][0-9]-/. It must start with an english letter and must not - # end with a hyphen. - # @!attribute [rw] request_id - # @return [::String] - # A request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server will guarantee - # that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - class CreateUtilizationReportRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for 'DeleteUtilizationReport' request. - # @!attribute [rw] name - # @return [::String] - # Required. The Utilization Report name. - # @!attribute [rw] request_id - # @return [::String] - # Optional. A request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server will guarantee - # that for at least 60 minutes after the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - class DeleteUtilizationReportRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for 'ListDatacenterConnectors' request. - # @!attribute [r] datacenter_connectors - # @return [::Array<::Google::Cloud::VMMigration::V1::DatacenterConnector>] - # Output only. The list of sources response. - # @!attribute [r] next_page_token - # @return [::String] - # Output only. A token, which can be sent as `page_token` to retrieve the - # next page. If this field is omitted, there are no subsequent pages. - # @!attribute [r] unreachable - # @return [::Array<::String>] - # Output only. Locations that could not be reached. - class ListDatacenterConnectorsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for 'GetDatacenterConnector' request. - # @!attribute [rw] name - # @return [::String] - # Required. The name of the DatacenterConnector. - class GetDatacenterConnectorRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for 'CreateDatacenterConnector' request. - # @!attribute [rw] parent - # @return [::String] - # Required. The DatacenterConnector's parent. - # Required. The Source in where the new DatacenterConnector will be created. - # For example: - # `projects/my-project/locations/us-central1/sources/my-source` - # @!attribute [rw] datacenter_connector_id - # @return [::String] - # Required. The datacenterConnector identifier. - # @!attribute [rw] datacenter_connector - # @return [::Google::Cloud::VMMigration::V1::DatacenterConnector] - # Required. The create request body. - # @!attribute [rw] request_id - # @return [::String] - # A request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server will guarantee - # that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - class CreateDatacenterConnectorRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for 'DeleteDatacenterConnector' request. - # @!attribute [rw] name - # @return [::String] - # Required. The DatacenterConnector name. - # @!attribute [rw] request_id - # @return [::String] - # A request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server will guarantee - # that for at least 60 minutes after the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - class DeleteDatacenterConnectorRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for 'UpgradeAppliance' request. - # @!attribute [rw] datacenter_connector - # @return [::String] - # Required. The DatacenterConnector name. - # @!attribute [rw] request_id - # @return [::String] - # A request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server will guarantee - # that for at least 60 minutes after the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - class UpgradeApplianceRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for 'UpgradeAppliance' request. - class UpgradeApplianceResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for 'ListDatacenterConnectors' request. - # @!attribute [rw] parent - # @return [::String] - # Required. The parent, which owns this collection of connectors. - # @!attribute [rw] page_size - # @return [::Integer] - # Optional. The maximum number of connectors to return. The service may - # return fewer than this value. If unspecified, at most 500 sources will be - # returned. The maximum value is 1000; values above 1000 will be coerced to - # 1000. - # @!attribute [rw] page_token - # @return [::String] - # Required. A page token, received from a previous `ListDatacenterConnectors` - # call. Provide this to retrieve the subsequent page. - # - # When paginating, all other parameters provided to - # `ListDatacenterConnectors` must match the call that provided the page - # token. - # @!attribute [rw] filter - # @return [::String] - # Optional. The filter request. - # @!attribute [rw] order_by - # @return [::String] - # Optional. the order by fields for the result. - class ListDatacenterConnectorsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # ComputeEngineTargetDefaults is a collection of details for creating a VM in a - # target Compute Engine project. - # @!attribute [rw] vm_name - # @return [::String] - # The name of the VM to create. - # @!attribute [rw] target_project - # @return [::String] - # The full path of the resource of type TargetProject which represents the - # Compute Engine project in which to create this VM. - # @!attribute [rw] zone - # @return [::String] - # The zone in which to create the VM. - # @!attribute [rw] machine_type_series - # @return [::String] - # The machine type series to create the VM with. - # @!attribute [rw] machine_type - # @return [::String] - # The machine type to create the VM with. - # @!attribute [rw] network_tags - # @return [::Array<::String>] - # A list of network tags to associate with the VM. - # @!attribute [rw] network_interfaces - # @return [::Array<::Google::Cloud::VMMigration::V1::NetworkInterface>] - # List of NICs connected to this VM. - # @!attribute [rw] service_account - # @return [::String] - # Optional. The service account to associate the VM with. - # @!attribute [rw] disk_type - # @return [::Google::Cloud::VMMigration::V1::ComputeEngineDiskType] - # The disk type to use in the VM. - # @!attribute [rw] labels - # @return [::Google::Protobuf::Map{::String => ::String}] - # A map of labels to associate with the VM. - # @!attribute [rw] license_type - # @return [::Google::Cloud::VMMigration::V1::ComputeEngineLicenseType] - # The license type to use in OS adaptation. - # @!attribute [r] applied_license - # @return [::Google::Cloud::VMMigration::V1::AppliedLicense] - # Output only. The OS license returned from the adaptation module report. - # @!attribute [rw] compute_scheduling - # @return [::Google::Cloud::VMMigration::V1::ComputeScheduling] - # Compute instance scheduling information (if empty default is used). - # @!attribute [rw] secure_boot - # @return [::Boolean] - # Defines whether the instance has Secure Boot enabled. - # This can be set to true only if the VM boot option is EFI. - # @!attribute [rw] enable_vtpm - # @return [::Boolean] - # Optional. Defines whether the instance has vTPM enabled. - # This can be set to true only if the VM boot option is EFI. - # @!attribute [rw] enable_integrity_monitoring - # @return [::Boolean] - # Optional. Defines whether the instance has integrity monitoring enabled. - # This can be set to true only if the VM boot option is EFI, and vTPM is - # enabled. - # @!attribute [r] boot_option - # @return [::Google::Cloud::VMMigration::V1::ComputeEngineBootOption] - # Output only. The VM Boot Option, as set in the source VM. - # @!attribute [rw] metadata - # @return [::Google::Protobuf::Map{::String => ::String}] - # The metadata key/value pairs to assign to the VM. - # @!attribute [rw] additional_licenses - # @return [::Array<::String>] - # Additional licenses to assign to the VM. - # @!attribute [rw] hostname - # @return [::String] - # The hostname to assign to the VM. - # @!attribute [rw] encryption - # @return [::Google::Cloud::VMMigration::V1::Encryption] - # Optional. Immutable. The encryption to apply to the VM disks. - # @!attribute [rw] boot_conversion - # @return [::Google::Cloud::VMMigration::V1::BootConversion] - # Optional. By default the virtual machine will keep its existing boot - # option. Setting this property will trigger an internal process which will - # convert the virtual machine from using the existing boot option to another. - # @!attribute [rw] adaptation_modifiers - # @return [::Array<::Google::Cloud::VMMigration::V1::AdaptationModifier>] - # Optional. AdaptationModifiers are the set of modifiers used during OS - # adaptation. - # @!attribute [rw] disk_replica_zones - # @return [::Array<::String>] - # Optional. Additional replica zones of the target regional disks. - # If this list is not empty a regional disk will be created. The first - # supported zone would be the one stated in the - # {::Google::Cloud::VMMigration::V1::ComputeEngineTargetDefaults#zone zone} field. - # The rest are taken from this list. Please refer to the [regional disk - # creation - # API](https://cloud.google.com/compute/docs/regions-zones/global-regional-zonal-resources) - # for further details about regional vs zonal disks. If not specified, a - # zonal disk will be created in the same zone the VM is created. - # @!attribute [rw] storage_pool - # @return [::String] - # Optional. If specified this will be the storage pool in which the disk is - # created. This is the full path of the storage pool resource, for example: - # "projects/my-project/zones/us-central1-a/storagePools/my-storage-pool". - # The storage pool must be in the same project and zone as the target disks. - # The storage pool's type must match the disk type. - class ComputeEngineTargetDefaults - 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 - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class MetadataEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # AdaptationModifier a modifier to be used for configuration of the OS - # adaptation process. - # @!attribute [rw] modifier - # @return [::String] - # Optional. The modifier name. - # @!attribute [rw] value - # @return [::String] - # Optional. The value of the modifier. - # The actual value depends on the modifier and can also be empty. - class AdaptationModifier - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # ComputeEngineTargetDetails is a collection of details for creating a VM in a - # target Compute Engine project. - # @!attribute [rw] vm_name - # @return [::String] - # The name of the VM to create. - # @!attribute [rw] project - # @return [::String] - # The Google Cloud target project ID or project name. - # @!attribute [rw] zone - # @return [::String] - # The zone in which to create the VM. - # @!attribute [rw] machine_type_series - # @return [::String] - # The machine type series to create the VM with. - # @!attribute [rw] machine_type - # @return [::String] - # The machine type to create the VM with. - # @!attribute [rw] network_tags - # @return [::Array<::String>] - # A list of network tags to associate with the VM. - # @!attribute [rw] network_interfaces - # @return [::Array<::Google::Cloud::VMMigration::V1::NetworkInterface>] - # List of NICs connected to this VM. - # @!attribute [rw] service_account - # @return [::String] - # The service account to associate the VM with. - # @!attribute [rw] disk_type - # @return [::Google::Cloud::VMMigration::V1::ComputeEngineDiskType] - # The disk type to use in the VM. - # @!attribute [rw] labels - # @return [::Google::Protobuf::Map{::String => ::String}] - # A map of labels to associate with the VM. - # @!attribute [rw] license_type - # @return [::Google::Cloud::VMMigration::V1::ComputeEngineLicenseType] - # The license type to use in OS adaptation. - # @!attribute [rw] applied_license - # @return [::Google::Cloud::VMMigration::V1::AppliedLicense] - # The OS license returned from the adaptation module report. - # @!attribute [rw] compute_scheduling - # @return [::Google::Cloud::VMMigration::V1::ComputeScheduling] - # Compute instance scheduling information (if empty default is used). - # @!attribute [rw] secure_boot - # @return [::Boolean] - # Defines whether the instance has Secure Boot enabled. - # This can be set to true only if the VM boot option is EFI. - # @!attribute [rw] enable_vtpm - # @return [::Boolean] - # Optional. Defines whether the instance has vTPM enabled. - # @!attribute [rw] enable_integrity_monitoring - # @return [::Boolean] - # Optional. Defines whether the instance has integrity monitoring enabled. - # @!attribute [rw] boot_option - # @return [::Google::Cloud::VMMigration::V1::ComputeEngineBootOption] - # The VM Boot Option, as set in the source VM. - # @!attribute [rw] metadata - # @return [::Google::Protobuf::Map{::String => ::String}] - # The metadata key/value pairs to assign to the VM. - # @!attribute [rw] additional_licenses - # @return [::Array<::String>] - # Additional licenses to assign to the VM. - # @!attribute [rw] hostname - # @return [::String] - # The hostname to assign to the VM. - # @!attribute [rw] encryption - # @return [::Google::Cloud::VMMigration::V1::Encryption] - # Optional. The encryption to apply to the VM disks. - # @!attribute [rw] boot_conversion - # @return [::Google::Cloud::VMMigration::V1::BootConversion] - # Optional. By default the virtual machine will keep its existing boot - # option. Setting this property will trigger an internal process which will - # convert the virtual machine from using the existing boot option to another. - # @!attribute [rw] adaptation_modifiers - # @return [::Array<::Google::Cloud::VMMigration::V1::AdaptationModifier>] - # Optional. Modifiers to be used as configuration of the OS adaptation - # process. - # @!attribute [rw] disk_replica_zones - # @return [::Array<::String>] - # Optional. Additional replica zones of the target regional disks. - # If this list is not empty a regional disk will be created. The first - # supported zone would be the one stated in the - # {::Google::Cloud::VMMigration::V1::ComputeEngineTargetDetails#zone zone} field. - # The rest are taken from this list. Please refer to the [regional disk - # creation - # API](https://cloud.google.com/compute/docs/regions-zones/global-regional-zonal-resources) - # for further details about regional vs zonal disks. If not specified, a - # zonal disk will be created in the same zone the VM is created. - # @!attribute [rw] storage_pool - # @return [::String] - # Optional. The storage pool used for the VM disks. - # If specified this will be the storage pool in which the disk is created. - # This is the full path of the storage pool resource, for example: - # "projects/my-project/zones/us-central1-a/storagePools/my-storage-pool". - # The storage pool must be in the same project and zone as the target disks. - # The storage pool's type must match the disk type. - class ComputeEngineTargetDetails - 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 - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class MetadataEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # NetworkInterface represents a NIC of a VM. - # @!attribute [rw] network - # @return [::String] - # Optional. The network to connect the NIC to. - # @!attribute [rw] subnetwork - # @return [::String] - # Optional. The subnetwork to connect the NIC to. - # @!attribute [rw] internal_ip - # @return [::String] - # Optional. The internal IP to define in the NIC. - # The formats accepted are: `ephemeral` \ ipv4 address \ a named address - # resource full path. - # @!attribute [rw] external_ip - # @return [::String] - # Optional. The external IP to define in the NIC. - # @!attribute [rw] network_tier - # @return [::Google::Cloud::VMMigration::V1::ComputeEngineNetworkTier] - # Optional. The networking tier used for optimizing connectivity between - # instances and systems on the internet. Applies only for external ephemeral - # IP addresses. If left empty, will default to PREMIUM. - class NetworkInterface - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # AppliedLicense holds the license data returned by adaptation module report. - # @!attribute [rw] type - # @return [::Google::Cloud::VMMigration::V1::AppliedLicense::Type] - # The license type that was used in OS adaptation. - # @!attribute [rw] os_license - # @return [::String] - # The OS license returned from the adaptation module's report. - class AppliedLicense - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # License types used in OS adaptation. - module Type - # Unspecified license for the OS. - TYPE_UNSPECIFIED = 0 - - # No license available for the OS. - NONE = 1 - - # The license type is Pay As You Go license type. - PAYG = 2 - - # The license type is Bring Your Own License type. - BYOL = 3 - end - end - - # Node Affinity: the configuration of desired nodes onto which this Instance - # could be scheduled. Based on - # https://cloud.google.com/compute/docs/reference/rest/v1/instances/setScheduling - # @!attribute [rw] key - # @return [::String] - # The label key of Node resource to reference. - # @!attribute [rw] operator - # @return [::Google::Cloud::VMMigration::V1::SchedulingNodeAffinity::Operator] - # The operator to use for the node resources specified in the `values` - # parameter. - # @!attribute [rw] values - # @return [::Array<::String>] - # Corresponds to the label values of Node resource. - class SchedulingNodeAffinity - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Possible types of node selection operators. Valid operators are IN for - # affinity and NOT_IN for anti-affinity. - module Operator - # An unknown, unexpected behavior. - OPERATOR_UNSPECIFIED = 0 - - # The node resource group should be in these resources affinity. - IN = 1 - - # The node resource group should not be in these resources affinity. - NOT_IN = 2 - end - end - - # Scheduling information for VM on maintenance/restart behaviour and - # node allocation in sole tenant nodes. - # Options for instance behavior when the host machine undergoes - # maintenance that may temporarily impact instance performance. - # @!attribute [rw] on_host_maintenance - # @return [::Google::Cloud::VMMigration::V1::ComputeScheduling::OnHostMaintenance] - # How the instance should behave when the host machine undergoes - # maintenance that may temporarily impact instance performance. - # @!attribute [rw] restart_type - # @return [::Google::Cloud::VMMigration::V1::ComputeScheduling::RestartType] - # Whether the Instance should be automatically restarted whenever it is - # terminated by Compute Engine (not terminated by user). - # This configuration is identical to `automaticRestart` field in Compute - # Engine create instance under scheduling. - # It was changed to an enum (instead of a boolean) to match the default - # value in Compute Engine which is automatic restart. - # @!attribute [rw] node_affinities - # @return [::Array<::Google::Cloud::VMMigration::V1::SchedulingNodeAffinity>] - # A set of node affinity and anti-affinity configurations for sole tenant - # nodes. - # @!attribute [rw] min_node_cpus - # @return [::Integer] - # The minimum number of virtual CPUs this instance will consume when - # running on a sole-tenant node. Ignored if no node_affinites are - # configured. - class ComputeScheduling - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - module OnHostMaintenance - # An unknown, unexpected behavior. - ON_HOST_MAINTENANCE_UNSPECIFIED = 0 - - # Terminate the instance when the host machine undergoes maintenance. - TERMINATE = 1 - - # Migrate the instance when the host machine undergoes maintenance. - MIGRATE = 2 - end - - # Defines whether the Instance should be automatically restarted whenever - # it is terminated by Compute Engine (not terminated by user). - module RestartType - # Unspecified behavior. This will use the default. - RESTART_TYPE_UNSPECIFIED = 0 - - # The Instance should be automatically restarted whenever it is - # terminated by Compute Engine. - AUTOMATIC_RESTART = 1 - - # The Instance isn't automatically restarted whenever it is - # terminated by Compute Engine. - NO_AUTOMATIC_RESTART = 2 - end - end - - # ComputeEngineDisksTargetDefaults is a collection of details for creating - # Persistent Disks in a target Compute Engine project. - # @!attribute [rw] zone - # @return [::String] - # The zone in which to create the Persistent Disks. - # @!attribute [rw] disks_target_defaults - # @return [::Google::Cloud::VMMigration::V1::DisksMigrationDisksTargetDefaults] - # Details of the disk only migration target. - # - # Note: The following fields are mutually exclusive: `disks_target_defaults`, `vm_target_defaults`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] vm_target_defaults - # @return [::Google::Cloud::VMMigration::V1::DisksMigrationVmTargetDefaults] - # Details of the VM migration target. - # - # Note: The following fields are mutually exclusive: `vm_target_defaults`, `disks_target_defaults`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] target_project - # @return [::String] - # The full path of the resource of type TargetProject which represents the - # Compute Engine project in which to create the Persistent Disks. - # @!attribute [rw] disks - # @return [::Array<::Google::Cloud::VMMigration::V1::PersistentDiskDefaults>] - # The details of each Persistent Disk to create. - class ComputeEngineDisksTargetDefaults - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Details for creation of a Persistent Disk. - # @!attribute [rw] source_disk_number - # @return [::Integer] - # Required. The ordinal number of the source VM disk. - # @!attribute [rw] disk_name - # @return [::String] - # Optional. The name of the Persistent Disk to create. - # @!attribute [rw] disk_type - # @return [::Google::Cloud::VMMigration::V1::ComputeEngineDiskType] - # The disk type to use. - # @!attribute [rw] additional_labels - # @return [::Google::Protobuf::Map{::String => ::String}] - # A map of labels to associate with the Persistent Disk. - # @!attribute [rw] encryption - # @return [::Google::Cloud::VMMigration::V1::Encryption] - # Optional. The encryption to apply to the disk. - # @!attribute [rw] vm_attachment_details - # @return [::Google::Cloud::VMMigration::V1::VmAttachmentDetails] - # Optional. Details for attachment of the disk to a VM. - # Used when the disk is set to be attached to a target VM. - class PersistentDiskDefaults - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class AdditionalLabelsEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Details for attachment of the disk to a VM. - # @!attribute [rw] device_name - # @return [::String] - # Optional. Specifies a unique device name of your choice that is reflected - # into the /dev/disk/by-id/google-* tree of a Linux operating system running - # within the instance. If not specified, the server chooses a default device - # name to apply to this disk, in the form persistent-disk-x, where x is a - # number assigned by Google Compute Engine. This field is only applicable for - # persistent disks. - class VmAttachmentDetails - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Details for a disk only migration. - class DisksMigrationDisksTargetDefaults - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Details for creation of a VM that migrated data disks will be attached to. - # @!attribute [rw] vm_name - # @return [::String] - # Required. The name of the VM to create. - # @!attribute [rw] machine_type_series - # @return [::String] - # Optional. The machine type series to create the VM with. - # For presentation only. - # @!attribute [rw] machine_type - # @return [::String] - # Required. The machine type to create the VM with. - # @!attribute [rw] network_tags - # @return [::Array<::String>] - # Optional. A list of network tags to associate with the VM. - # @!attribute [rw] network_interfaces - # @return [::Array<::Google::Cloud::VMMigration::V1::NetworkInterface>] - # Optional. NICs to attach to the VM. - # @!attribute [rw] service_account - # @return [::String] - # Optional. The service account to associate the VM with. - # @!attribute [rw] compute_scheduling - # @return [::Google::Cloud::VMMigration::V1::ComputeScheduling] - # Optional. Compute instance scheduling information (if empty default is - # used). - # @!attribute [rw] secure_boot - # @return [::Boolean] - # Optional. Defines whether the instance has Secure Boot enabled. - # This can be set to true only if the VM boot option is EFI. - # @!attribute [rw] enable_vtpm - # @return [::Boolean] - # Optional. Defines whether the instance has vTPM enabled. - # @!attribute [rw] enable_integrity_monitoring - # @return [::Boolean] - # Optional. Defines whether the instance has integrity monitoring enabled. - # @!attribute [rw] metadata - # @return [::Google::Protobuf::Map{::String => ::String}] - # Optional. The metadata key/value pairs to assign to the VM. - # @!attribute [rw] additional_licenses - # @return [::Array<::String>] - # Optional. Additional licenses to assign to the VM. - # @!attribute [rw] hostname - # @return [::String] - # Optional. The hostname to assign to the VM. - # @!attribute [rw] labels - # @return [::Google::Protobuf::Map{::String => ::String}] - # Optional. A map of labels to associate with the VM. - # @!attribute [rw] boot_disk_defaults - # @return [::Google::Cloud::VMMigration::V1::BootDiskDefaults] - # Optional. Details of the boot disk of the VM. - # @!attribute [rw] encryption - # @return [::Google::Cloud::VMMigration::V1::Encryption] - # Optional. The encryption to apply to the VM. - class DisksMigrationVmTargetDefaults - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class MetadataEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class LabelsEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # BootDiskDefaults hold information about the boot disk of a VM. - # @!attribute [rw] image - # @return [::Google::Cloud::VMMigration::V1::BootDiskDefaults::DiskImageDefaults] - # The image to use when creating the disk. - # @!attribute [rw] disk_name - # @return [::String] - # Optional. The name of the disk. - # @!attribute [rw] disk_type - # @return [::Google::Cloud::VMMigration::V1::ComputeEngineDiskType] - # Optional. The type of disk provisioning to use for the VM. - # @!attribute [rw] device_name - # @return [::String] - # Optional. Specifies a unique device name of your choice that is reflected - # into the /dev/disk/by-id/google-* tree of a Linux operating system running - # within the instance. If not specified, the server chooses a default device - # name to apply to this disk, in the form persistent-disk-x, where x is a - # number assigned by Google Compute Engine. This field is only applicable for - # persistent disks. - # @!attribute [rw] encryption - # @return [::Google::Cloud::VMMigration::V1::Encryption] - # Optional. The encryption to apply to the boot disk. - class BootDiskDefaults - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Contains details about the image source used to create the disk. - # @!attribute [rw] source_image - # @return [::String] - # Required. The Image resource used when creating the disk. - class DiskImageDefaults - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # ComputeEngineDisksTargetDetails is a collection of created Persistent Disks - # details. - # @!attribute [rw] disks_target_details - # @return [::Google::Cloud::VMMigration::V1::DisksMigrationDisksTargetDetails] - # Details of the disks-only migration target. - # - # Note: The following fields are mutually exclusive: `disks_target_details`, `vm_target_details`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] vm_target_details - # @return [::Google::Cloud::VMMigration::V1::DisksMigrationVmTargetDetails] - # Details for the VM the migrated data disks are attached to. - # - # Note: The following fields are mutually exclusive: `vm_target_details`, `disks_target_details`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] disks - # @return [::Array<::Google::Cloud::VMMigration::V1::PersistentDisk>] - # The details of each created Persistent Disk. - class ComputeEngineDisksTargetDetails - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Details of a created Persistent Disk. - # @!attribute [rw] source_disk_number - # @return [::Integer] - # The ordinal number of the source VM disk. - # @!attribute [rw] disk_uri - # @return [::String] - # The URI of the Persistent Disk. - class PersistentDisk - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Details for a disks-only migration. - class DisksMigrationDisksTargetDetails - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Details for the VM created VM as part of disks migration. - # @!attribute [r] vm_uri - # @return [::String] - # Output only. The URI of the Compute Engine VM. - class DisksMigrationVmTargetDetails - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A policy for scheduling replications. - # @!attribute [rw] idle_duration - # @return [::Google::Protobuf::Duration] - # The idle duration between replication stages. - # @!attribute [rw] skip_os_adaptation - # @return [::Boolean] - # A flag to indicate whether to skip OS adaptation during the replication - # sync. OS adaptation is a process where the VM's operating system undergoes - # changes and adaptations to fully function on Compute Engine. - class SchedulePolicy - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for 'CreateMigratingVm' request. - # @!attribute [rw] parent - # @return [::String] - # Required. The MigratingVm's parent. - # @!attribute [rw] migrating_vm_id - # @return [::String] - # Required. The migratingVm identifier. - # @!attribute [rw] migrating_vm - # @return [::Google::Cloud::VMMigration::V1::MigratingVm] - # Required. The create request body. - # @!attribute [rw] request_id - # @return [::String] - # A request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server will guarantee - # that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - class CreateMigratingVmRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for 'LisMigratingVmsRequest' request. - # @!attribute [rw] parent - # @return [::String] - # Required. The parent, which owns this collection of MigratingVms. - # @!attribute [rw] page_size - # @return [::Integer] - # Optional. The maximum number of migrating VMs to return. The service may - # return fewer than this value. If unspecified, at most 500 migrating VMs - # will be returned. The maximum value is 1000; values above 1000 will be - # coerced to 1000. - # @!attribute [rw] page_token - # @return [::String] - # Required. A page token, received from a previous `ListMigratingVms` call. - # Provide this to retrieve the subsequent page. - # - # When paginating, all other parameters provided to `ListMigratingVms` - # must match the call that provided the page token. - # @!attribute [rw] filter - # @return [::String] - # Optional. The filter request. - # @!attribute [rw] order_by - # @return [::String] - # Optional. the order by fields for the result. - # @!attribute [rw] view - # @return [::Google::Cloud::VMMigration::V1::MigratingVmView] - # Optional. The level of details of each migrating VM. - class ListMigratingVmsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for 'ListMigratingVms' request. - # @!attribute [r] migrating_vms - # @return [::Array<::Google::Cloud::VMMigration::V1::MigratingVm>] - # Output only. The list of Migrating VMs response. - # @!attribute [r] next_page_token - # @return [::String] - # Output only. A token, which can be sent as `page_token` to retrieve the - # next page. If this field is omitted, there are no subsequent pages. - # @!attribute [r] unreachable - # @return [::Array<::String>] - # Output only. Locations that could not be reached. - class ListMigratingVmsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for 'GetMigratingVm' request. - # @!attribute [rw] name - # @return [::String] - # Required. The name of the MigratingVm. - # @!attribute [rw] view - # @return [::Google::Cloud::VMMigration::V1::MigratingVmView] - # Optional. The level of details of the migrating VM. - class GetMigratingVmRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for 'UpdateMigratingVm' request. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # Field mask is used to specify the fields to be overwritten in the - # MigratingVm resource by the update. - # The fields specified in the update_mask are relative to the resource, not - # the full request. A field will be overwritten if it is in the mask. If the - # user does not provide a mask then all fields will be overwritten. - # @!attribute [rw] migrating_vm - # @return [::Google::Cloud::VMMigration::V1::MigratingVm] - # Required. The update request body. - # @!attribute [rw] request_id - # @return [::String] - # A request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server will guarantee - # that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - class UpdateMigratingVmRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for 'DeleteMigratingVm' request. - # @!attribute [rw] name - # @return [::String] - # Required. The name of the MigratingVm. - class DeleteMigratingVmRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for 'StartMigrationRequest' request. - # @!attribute [rw] migrating_vm - # @return [::String] - # Required. The name of the MigratingVm. - class StartMigrationRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for 'StartMigration' request. - class StartMigrationResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for 'PauseMigration' request. - # @!attribute [rw] migrating_vm - # @return [::String] - # Required. The name of the MigratingVm. - class PauseMigrationRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for 'PauseMigration' request. - class PauseMigrationResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for 'ResumeMigration' request. - # @!attribute [rw] migrating_vm - # @return [::String] - # Required. The name of the MigratingVm. - class ResumeMigrationRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for 'ResumeMigration' request. - class ResumeMigrationResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for 'FinalizeMigration' request. - # @!attribute [rw] migrating_vm - # @return [::String] - # Required. The name of the MigratingVm. - class FinalizeMigrationRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for 'ExtendMigrationRequest' request. - # @!attribute [rw] migrating_vm - # @return [::String] - # Required. The name of the MigratingVm. - class ExtendMigrationRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for 'ExtendMigration' request. - class ExtendMigrationResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for 'FinalizeMigration' request. - class FinalizeMigrationResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # TargetProject message represents a target Compute Engine project for a - # migration or a clone. - # @!attribute [r] name - # @return [::String] - # Output only. The name of the target project. - # @!attribute [rw] project - # @return [::String] - # Required. The target project ID (number) or project name. - # @!attribute [rw] description - # @return [::String] - # The target project's description. - # @!attribute [r] create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time this target project resource was created (not related - # to when the Compute Engine project it points to was created). - # @!attribute [r] update_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The last time the target project resource was updated. - class TargetProject - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for 'GetTargetProject' call. - # @!attribute [rw] name - # @return [::String] - # Required. The TargetProject name. - class GetTargetProjectRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for 'ListTargetProjects' call. - # @!attribute [rw] parent - # @return [::String] - # Required. The parent, which owns this collection of targets. - # @!attribute [rw] page_size - # @return [::Integer] - # Optional. The maximum number of targets to return. The service may return - # fewer than this value. If unspecified, at most 500 targets will be - # returned. The maximum value is 1000; values above 1000 will be coerced to - # 1000. - # @!attribute [rw] page_token - # @return [::String] - # Required. A page token, received from a previous `ListTargets` call. - # Provide this to retrieve the subsequent page. - # - # When paginating, all other parameters provided to `ListTargets` must - # match the call that provided the page token. - # @!attribute [rw] filter - # @return [::String] - # Optional. The filter request. - # @!attribute [rw] order_by - # @return [::String] - # Optional. the order by fields for the result. - class ListTargetProjectsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for 'ListTargetProjects' call. - # @!attribute [r] target_projects - # @return [::Array<::Google::Cloud::VMMigration::V1::TargetProject>] - # Output only. The list of target response. - # @!attribute [r] next_page_token - # @return [::String] - # Output only. A token, which can be sent as `page_token` to retrieve the - # next page. If this field is omitted, there are no subsequent pages. - # @!attribute [r] unreachable - # @return [::Array<::String>] - # Output only. Locations that could not be reached. - class ListTargetProjectsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for 'CreateTargetProject' request. - # @!attribute [rw] parent - # @return [::String] - # Required. The TargetProject's parent. - # @!attribute [rw] target_project_id - # @return [::String] - # Required. The target_project identifier. - # @!attribute [rw] target_project - # @return [::Google::Cloud::VMMigration::V1::TargetProject] - # Required. The create request body. - # @!attribute [rw] request_id - # @return [::String] - # A request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server will guarantee - # that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - class CreateTargetProjectRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Update message for 'UpdateTargetProject' request. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # Field mask is used to specify the fields to be overwritten in the - # TargetProject resource by the update. - # The fields specified in the update_mask are relative to the resource, not - # the full request. A field will be overwritten if it is in the mask. If the - # user does not provide a mask then all fields will be overwritten. - # @!attribute [rw] target_project - # @return [::Google::Cloud::VMMigration::V1::TargetProject] - # Required. The update request body. - # @!attribute [rw] request_id - # @return [::String] - # A request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server will guarantee - # that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - class UpdateTargetProjectRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for 'DeleteTargetProject' request. - # @!attribute [rw] name - # @return [::String] - # Required. The TargetProject name. - # @!attribute [rw] request_id - # @return [::String] - # Optional. A request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server will guarantee - # that for at least 60 minutes after the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - class DeleteTargetProjectRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Describes message for 'Group' resource. The Group is a collections of several - # MigratingVms. - # @!attribute [r] name - # @return [::String] - # Output only. The Group name. - # @!attribute [r] create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The create time timestamp. - # @!attribute [r] update_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The update time timestamp. - # @!attribute [rw] description - # @return [::String] - # User-provided description of the group. - # @!attribute [rw] display_name - # @return [::String] - # Display name is a user defined name for this group which can be updated. - # @!attribute [rw] migration_target_type - # @return [::Google::Cloud::VMMigration::V1::Group::MigrationTargetType] - # Immutable. The target type of this group. - class Group - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The possible types of the group. - module MigrationTargetType - # Group type is not specified. This defaults to Compute Engine targets. - MIGRATION_TARGET_TYPE_UNSPECIFIED = 0 - - # All MigratingVMs in the group must have Compute Engine targets. - MIGRATION_TARGET_TYPE_GCE = 1 - - # All MigratingVMs in the group must have Compute Engine Disks targets. - MIGRATION_TARGET_TYPE_DISKS = 2 - end - end - - # Request message for 'ListGroups' request. - # @!attribute [rw] parent - # @return [::String] - # Required. The parent, which owns this collection of groups. - # @!attribute [rw] page_size - # @return [::Integer] - # Optional. The maximum number of groups to return. The service may return - # fewer than this value. If unspecified, at most 500 groups will be - # returned. The maximum value is 1000; values above 1000 will be coerced to - # 1000. - # @!attribute [rw] page_token - # @return [::String] - # Required. A page token, received from a previous `ListGroups` call. - # Provide this to retrieve the subsequent page. - # - # When paginating, all other parameters provided to `ListGroups` must - # match the call that provided the page token. - # @!attribute [rw] filter - # @return [::String] - # Optional. The filter request. - # @!attribute [rw] order_by - # @return [::String] - # Optional. the order by fields for the result. - class ListGroupsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for 'ListGroups' request. - # @!attribute [r] groups - # @return [::Array<::Google::Cloud::VMMigration::V1::Group>] - # Output only. The list of groups response. - # @!attribute [r] next_page_token - # @return [::String] - # Output only. A token, which can be sent as `page_token` to retrieve the - # next page. If this field is omitted, there are no subsequent pages. - # @!attribute [r] unreachable - # @return [::Array<::String>] - # Output only. Locations that could not be reached. - class ListGroupsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for 'GetGroup' request. - # @!attribute [rw] name - # @return [::String] - # Required. The group name. - class GetGroupRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for 'CreateGroup' request. - # @!attribute [rw] parent - # @return [::String] - # Required. The Group's parent. - # @!attribute [rw] group_id - # @return [::String] - # Required. The group identifier. - # @!attribute [rw] group - # @return [::Google::Cloud::VMMigration::V1::Group] - # Required. The create request body. - # @!attribute [rw] request_id - # @return [::String] - # A request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server will guarantee - # that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - class CreateGroupRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Update message for 'UpdateGroups' request. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # Field mask is used to specify the fields to be overwritten in the - # Group resource by the update. - # The fields specified in the update_mask are relative to the resource, not - # the full request. A field will be overwritten if it is in the mask. If the - # user does not provide a mask then all fields will be overwritten. - # @!attribute [rw] group - # @return [::Google::Cloud::VMMigration::V1::Group] - # Required. The update request body. - # @!attribute [rw] request_id - # @return [::String] - # A request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server will guarantee - # that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - class UpdateGroupRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for 'DeleteGroup' request. - # @!attribute [rw] name - # @return [::String] - # Required. The Group name. - # @!attribute [rw] request_id - # @return [::String] - # Optional. A request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server will guarantee - # that for at least 60 minutes after the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - class DeleteGroupRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for 'AddGroupMigration' request. - # @!attribute [rw] group - # @return [::String] - # Required. The full path name of the Group to add to. - # @!attribute [rw] migrating_vm - # @return [::String] - # The full path name of the MigratingVm to add. - class AddGroupMigrationRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for 'AddGroupMigration' request. - class AddGroupMigrationResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for 'RemoveMigration' request. - # @!attribute [rw] group - # @return [::String] - # Required. The name of the Group. - # @!attribute [rw] migrating_vm - # @return [::String] - # The MigratingVm to remove. - class RemoveGroupMigrationRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for 'RemoveMigration' request. - class RemoveGroupMigrationResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for 'CreateCutoverJob' request. - # @!attribute [rw] parent - # @return [::String] - # Required. The Cutover's parent. - # @!attribute [rw] cutover_job_id - # @return [::String] - # Required. The cutover job identifier. - # @!attribute [rw] cutover_job - # @return [::Google::Cloud::VMMigration::V1::CutoverJob] - # Required. The cutover request body. - # @!attribute [rw] request_id - # @return [::String] - # A request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server will guarantee - # that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - class CreateCutoverJobRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for 'CancelCutoverJob' request. - # @!attribute [rw] name - # @return [::String] - # Required. The cutover job id - class CancelCutoverJobRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for 'CancelCutoverJob' request. - class CancelCutoverJobResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for 'ListCutoverJobsRequest' request. - # @!attribute [rw] parent - # @return [::String] - # Required. The parent, which owns this collection of migrating VMs. - # @!attribute [rw] page_size - # @return [::Integer] - # Optional. The maximum number of cutover jobs to return. The service may - # return fewer than this value. If unspecified, at most 500 cutover jobs will - # be returned. The maximum value is 1000; values above 1000 will be coerced - # to 1000. - # @!attribute [rw] page_token - # @return [::String] - # Required. A page token, received from a previous `ListCutoverJobs` call. - # Provide this to retrieve the subsequent page. - # - # When paginating, all other parameters provided to `ListCutoverJobs` must - # match the call that provided the page token. - # @!attribute [rw] filter - # @return [::String] - # Optional. The filter request. - # @!attribute [rw] order_by - # @return [::String] - # Optional. the order by fields for the result. - class ListCutoverJobsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for 'ListCutoverJobs' request. - # @!attribute [r] cutover_jobs - # @return [::Array<::Google::Cloud::VMMigration::V1::CutoverJob>] - # Output only. The list of cutover jobs response. - # @!attribute [r] next_page_token - # @return [::String] - # Output only. A token, which can be sent as `page_token` to retrieve the - # next page. If this field is omitted, there are no subsequent pages. - # @!attribute [r] unreachable - # @return [::Array<::String>] - # Output only. Locations that could not be reached. - class ListCutoverJobsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for 'GetCutoverJob' request. - # @!attribute [rw] name - # @return [::String] - # Required. The name of the CutoverJob. - class GetCutoverJobRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Represents the metadata of the long-running operation. - # @!attribute [r] create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time the operation was created. - # @!attribute [r] end_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time the operation finished running. - # @!attribute [r] target - # @return [::String] - # Output only. Server-defined resource path for the target of the operation. - # @!attribute [r] verb - # @return [::String] - # Output only. Name of the verb executed by the operation. - # @!attribute [r] status_message - # @return [::String] - # Output only. Human-readable status of the operation, if any. - # @!attribute [r] requested_cancellation - # @return [::Boolean] - # Output only. Identifies whether the user has requested cancellation - # of the operation. Operations that have successfully been cancelled - # have [Operation.error][] value with a - # {::Google::Rpc::Status#code google.rpc.Status.code} of 1, corresponding to - # `Code.CANCELLED`. - # @!attribute [r] api_version - # @return [::String] - # Output only. API version used to start the operation. - class OperationMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Represents migration resource error information that can be used with - # google.rpc.Status message. MigrationError is used to present the user with - # error information in migration operations. - # @!attribute [r] code - # @return [::Google::Cloud::VMMigration::V1::MigrationError::ErrorCode] - # Output only. The error code. - # @!attribute [r] error_message - # @return [::Google::Rpc::LocalizedMessage] - # Output only. The localized error message. - # @!attribute [r] action_item - # @return [::Google::Rpc::LocalizedMessage] - # Output only. Suggested action for solving the error. - # @!attribute [r] help_links - # @return [::Array<::Google::Rpc::Help::Link>] - # Output only. URL(s) pointing to additional information on handling the - # current error. - # @!attribute [r] error_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time the error occurred. - class MigrationError - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Represents resource error codes. - module ErrorCode - # Default value. This value is not used. - ERROR_CODE_UNSPECIFIED = 0 - - # Migrate to Virtual Machines encountered an unknown error. - UNKNOWN_ERROR = 1 - - # Migrate to Virtual Machines encountered an error while validating - # replication source health. - SOURCE_VALIDATION_ERROR = 2 - - # Migrate to Virtual Machines encountered an error during source data - # operation. - SOURCE_REPLICATION_ERROR = 3 - - # Migrate to Virtual Machines encountered an error during target data - # operation. - TARGET_REPLICATION_ERROR = 4 - - # Migrate to Virtual Machines encountered an error during OS adaptation. - OS_ADAPTATION_ERROR = 5 - - # Migrate to Virtual Machines encountered an error in clone operation. - CLONE_ERROR = 6 - - # Migrate to Virtual Machines encountered an error in cutover operation. - CUTOVER_ERROR = 7 - - # Migrate to Virtual Machines encountered an error during utilization - # report creation. - UTILIZATION_REPORT_ERROR = 8 - - # Migrate to Virtual Machines encountered an error during appliance - # upgrade. - APPLIANCE_UPGRADE_ERROR = 9 - - # Migrate to Virtual Machines encountered an error in image import - # operation. - IMAGE_IMPORT_ERROR = 10 - - # Migrate to Virtual Machines encountered an error in disk migration - # operation. - DISK_MIGRATION_ERROR = 11 - end - end - - # Represents migration resource warning information that can be used with - # google.rpc.Status message. MigrationWarning is used to present the user with - # warning information in migration operations. - # @!attribute [rw] code - # @return [::Google::Cloud::VMMigration::V1::MigrationWarning::WarningCode] - # The warning code. - # @!attribute [r] warning_message - # @return [::Google::Rpc::LocalizedMessage] - # Output only. The localized warning message. - # @!attribute [r] action_item - # @return [::Google::Rpc::LocalizedMessage] - # Output only. Suggested action for solving the warning. - # @!attribute [r] help_links - # @return [::Array<::Google::Rpc::Help::Link>] - # Output only. URL(s) pointing to additional information on handling the - # current warning. - # @!attribute [rw] warning_time - # @return [::Google::Protobuf::Timestamp] - # The time the warning occurred. - class MigrationWarning - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Represents possible warning codes. - module WarningCode - # Default value. This value is not used. - WARNING_CODE_UNSPECIFIED = 0 - - # A warning originated from OS Adaptation. - ADAPTATION_WARNING = 1 - end - end - - # Represent the source Vmware VM details. - # @!attribute [r] firmware - # @return [::Google::Cloud::VMMigration::V1::VmwareSourceVmDetails::Firmware] - # Output only. The firmware type of the source VM. - # @!attribute [r] committed_storage_bytes - # @return [::Integer] - # Output only. The total size of the disks being migrated in bytes. - # @!attribute [r] disks - # @return [::Array<::Google::Cloud::VMMigration::V1::VmwareSourceVmDetails::VmwareDiskDetails>] - # Output only. The disks attached to the source VM. - # @!attribute [r] vm_capabilities_info - # @return [::Google::Cloud::VMMigration::V1::VmCapabilities] - # Output only. Information about VM capabilities needed for some Compute - # Engine features. - # @!attribute [r] architecture - # @return [::Google::Cloud::VMMigration::V1::VmArchitecture] - # Output only. The VM architecture. - class VmwareSourceVmDetails - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The details of a Vmware VM disk. - # @!attribute [r] disk_number - # @return [::Integer] - # Output only. The ordinal number of the disk. - # @!attribute [r] size_gb - # @return [::Integer] - # Output only. Size in GB. - # @!attribute [r] label - # @return [::String] - # Output only. The disk label. - class VmwareDiskDetails - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Possible values for Vmware VM firmware. - module Firmware - # The firmware is unknown. - FIRMWARE_UNSPECIFIED = 0 - - # The firmware is EFI. - EFI = 1 - - # The firmware is BIOS. - BIOS = 2 - end - end - - # Represent the source AWS VM details. - # @!attribute [r] firmware - # @return [::Google::Cloud::VMMigration::V1::AwsSourceVmDetails::Firmware] - # Output only. The firmware type of the source VM. - # @!attribute [r] committed_storage_bytes - # @return [::Integer] - # Output only. The total size of the disks being migrated in bytes. - # @!attribute [r] disks - # @return [::Array<::Google::Cloud::VMMigration::V1::AwsSourceVmDetails::AwsDiskDetails>] - # Output only. The disks attached to the source VM. - # @!attribute [r] vm_capabilities_info - # @return [::Google::Cloud::VMMigration::V1::VmCapabilities] - # Output only. Information about VM capabilities needed for some Compute - # Engine features. - # @!attribute [r] architecture - # @return [::Google::Cloud::VMMigration::V1::VmArchitecture] - # Output only. The VM architecture. - class AwsSourceVmDetails - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The details of an AWS instance disk. - # @!attribute [r] disk_number - # @return [::Integer] - # Output only. The ordinal number of the disk. - # @!attribute [r] volume_id - # @return [::String] - # Output only. AWS volume ID. - # @!attribute [r] size_gb - # @return [::Integer] - # Output only. Size in GB. - class AwsDiskDetails - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Possible values for AWS VM firmware. - module Firmware - # The firmware is unknown. - FIRMWARE_UNSPECIFIED = 0 - - # The firmware is EFI. - EFI = 1 - - # The firmware is BIOS. - BIOS = 2 - end - end - - # Represent the source Azure VM details. - # @!attribute [r] firmware - # @return [::Google::Cloud::VMMigration::V1::AzureSourceVmDetails::Firmware] - # Output only. The firmware type of the source VM. - # @!attribute [r] committed_storage_bytes - # @return [::Integer] - # Output only. The total size of the disks being migrated in bytes. - # @!attribute [r] disks - # @return [::Array<::Google::Cloud::VMMigration::V1::AzureSourceVmDetails::AzureDiskDetails>] - # Output only. The disks attached to the source VM. - # @!attribute [r] vm_capabilities_info - # @return [::Google::Cloud::VMMigration::V1::VmCapabilities] - # Output only. Information about VM capabilities needed for some Compute - # Engine features. - # @!attribute [r] architecture - # @return [::Google::Cloud::VMMigration::V1::VmArchitecture] - # Output only. The VM architecture. - class AzureSourceVmDetails - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The details of an Azure VM disk. - # @!attribute [r] disk_number - # @return [::Integer] - # Output only. The ordinal number of the disk. - # @!attribute [r] disk_id - # @return [::String] - # Output only. Azure disk ID. - # @!attribute [r] size_gb - # @return [::Integer] - # Output only. Size in GB. - class AzureDiskDetails - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Possible values for Azure VM firmware. - module Firmware - # The firmware is unknown. - FIRMWARE_UNSPECIFIED = 0 - - # The firmware is EFI. - EFI = 1 - - # The firmware is BIOS. - BIOS = 2 - end - end - - # Request message for 'LisReplicationCyclesRequest' request. - # @!attribute [rw] parent - # @return [::String] - # Required. The parent, which owns this collection of ReplicationCycles. - # @!attribute [rw] page_size - # @return [::Integer] - # Optional. The maximum number of replication cycles to return. The service - # may return fewer than this value. If unspecified, at most 100 migrating VMs - # will be returned. The maximum value is 100; values above 100 will be - # coerced to 100. - # @!attribute [rw] page_token - # @return [::String] - # Required. A page token, received from a previous `ListReplicationCycles` - # call. Provide this to retrieve the subsequent page. - # - # When paginating, all other parameters provided to `ListReplicationCycles` - # must match the call that provided the page token. - # @!attribute [rw] filter - # @return [::String] - # Optional. The filter request. - # @!attribute [rw] order_by - # @return [::String] - # Optional. the order by fields for the result. - class ListReplicationCyclesRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for 'ListReplicationCycles' request. - # @!attribute [r] replication_cycles - # @return [::Array<::Google::Cloud::VMMigration::V1::ReplicationCycle>] - # Output only. The list of replication cycles response. - # @!attribute [r] next_page_token - # @return [::String] - # Output only. A token, which can be sent as `page_token` to retrieve the - # next page. If this field is omitted, there are no subsequent pages. - # @!attribute [r] unreachable - # @return [::Array<::String>] - # Output only. Locations that could not be reached. - class ListReplicationCyclesResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for 'GetReplicationCycle' request. - # @!attribute [rw] name - # @return [::String] - # Required. The name of the ReplicationCycle. - class GetReplicationCycleRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Migrating VM source information about the VM capabilities needed for some - # Compute Engine features. - # @!attribute [r] os_capabilities - # @return [::Array<::Google::Cloud::VMMigration::V1::OsCapability>] - # Output only. Unordered list. List of certain VM OS capabilities needed for - # some Compute Engine features. - # @!attribute [r] last_os_capabilities_update_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The last time OS capabilities list was updated. - class VmCapabilities - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # ImageImport describes the configuration of the image import to run. - # @!attribute [rw] cloud_storage_uri - # @return [::String] - # Immutable. The path to the Cloud Storage file from which the image should - # be imported. - # @!attribute [rw] disk_image_target_defaults - # @return [::Google::Cloud::VMMigration::V1::DiskImageTargetDetails] - # Immutable. Target details for importing a disk image, will be used by - # ImageImportJob. - # - # Note: The following fields are mutually exclusive: `disk_image_target_defaults`, `machine_image_target_defaults`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] machine_image_target_defaults - # @return [::Google::Cloud::VMMigration::V1::MachineImageTargetDetails] - # Immutable. Target details for importing a machine image, will be used by - # ImageImportJob. - # - # Note: The following fields are mutually exclusive: `machine_image_target_defaults`, `disk_image_target_defaults`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [r] name - # @return [::String] - # Output only. The resource path of the ImageImport. - # @!attribute [r] create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time the image import was created. - # @!attribute [r] recent_image_import_jobs - # @return [::Array<::Google::Cloud::VMMigration::V1::ImageImportJob>] - # Output only. The result of the most recent runs for this ImageImport. All - # jobs for this ImageImport can be listed via ListImageImportJobs. - # @!attribute [rw] encryption - # @return [::Google::Cloud::VMMigration::V1::Encryption] - # Immutable. The encryption details used by the image import process during - # the image adaptation for Compute Engine. - class ImageImport - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # ImageImportJob describes the progress and result of an image import. - # @!attribute [r] cloud_storage_uri - # @return [::String] - # Output only. The path to the Cloud Storage file from which the image - # should be imported. - # @!attribute [r] disk_image_target_details - # @return [::Google::Cloud::VMMigration::V1::DiskImageTargetDetails] - # Output only. Target details used to import a disk image. - # - # Note: The following fields are mutually exclusive: `disk_image_target_details`, `machine_image_target_details`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [r] machine_image_target_details - # @return [::Google::Cloud::VMMigration::V1::MachineImageTargetDetails] - # Output only. Target details used to import a machine image. - # - # Note: The following fields are mutually exclusive: `machine_image_target_details`, `disk_image_target_details`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [r] name - # @return [::String] - # Output only. The resource path of the ImageImportJob. - # @!attribute [r] created_resources - # @return [::Array<::String>] - # Output only. The resource paths of the resources created by the image - # import job. - # @!attribute [r] state - # @return [::Google::Cloud::VMMigration::V1::ImageImportJob::State] - # Output only. The state of the image import. - # @!attribute [r] create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time the image import was created (as an API call, not - # when it was actually created in the target). - # @!attribute [r] end_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time the image import was ended. - # @!attribute [r] errors - # @return [::Array<::Google::Rpc::Status>] - # Output only. Provides details on the error that led to the image import - # state in case of an error. - # @!attribute [r] warnings - # @return [::Array<::Google::Cloud::VMMigration::V1::MigrationWarning>] - # Output only. Warnings that occurred during the image import. - # @!attribute [r] steps - # @return [::Array<::Google::Cloud::VMMigration::V1::ImageImportStep>] - # Output only. The image import steps list representing its progress. - class ImageImportJob - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Possible states of the image import. - module State - # The state is unknown. - STATE_UNSPECIFIED = 0 - - # The image import has not yet started. - PENDING = 1 - - # The image import is active and running. - RUNNING = 2 - - # The image import has finished successfully. - SUCCEEDED = 3 - - # The image import has finished with errors. - FAILED = 4 - - # The image import is being cancelled. - CANCELLING = 5 - - # The image import was cancelled. - CANCELLED = 6 - end - end - - # ImageImportStep holds information about the image import step progress. - # @!attribute [rw] initializing - # @return [::Google::Cloud::VMMigration::V1::InitializingImageImportStep] - # Initializing step. - # - # Note: The following fields are mutually exclusive: `initializing`, `loading_source_files`, `adapting_os`, `creating_image`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] loading_source_files - # @return [::Google::Cloud::VMMigration::V1::LoadingImageSourceFilesStep] - # Loading source files step. - # - # Note: The following fields are mutually exclusive: `loading_source_files`, `initializing`, `adapting_os`, `creating_image`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] adapting_os - # @return [::Google::Cloud::VMMigration::V1::AdaptingOSStep] - # Adapting OS step. - # - # Note: The following fields are mutually exclusive: `adapting_os`, `initializing`, `loading_source_files`, `creating_image`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] creating_image - # @return [::Google::Cloud::VMMigration::V1::CreatingImageStep] - # Creating image step. - # - # Note: The following fields are mutually exclusive: `creating_image`, `initializing`, `loading_source_files`, `adapting_os`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [r] start_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time the step has started. - # @!attribute [r] end_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time the step has ended. - class ImageImportStep - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # InitializingImageImportStep contains specific step details. - class InitializingImageImportStep - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # LoadingImageSourceFilesStep contains specific step details. - class LoadingImageSourceFilesStep - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # CreatingImageStep contains specific step details. - class CreatingImageStep - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The target details of the image resource that will be created by the import - # job. - # @!attribute [rw] os_adaptation_parameters - # @return [::Google::Cloud::VMMigration::V1::ImageImportOsAdaptationParameters] - # Optional. Use to set the parameters relevant for the OS adaptation - # process. - # - # Note: The following fields are mutually exclusive: `os_adaptation_parameters`, `data_disk_image_import`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] data_disk_image_import - # @return [::Google::Cloud::VMMigration::V1::DataDiskImageImport] - # Optional. Use to skip OS adaptation process. - # - # Note: The following fields are mutually exclusive: `data_disk_image_import`, `os_adaptation_parameters`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] image_name - # @return [::String] - # Required. The name of the image to be created. - # @!attribute [rw] target_project - # @return [::String] - # Required. Reference to the TargetProject resource that represents the - # target project in which the imported image will be created. - # @!attribute [rw] description - # @return [::String] - # Optional. An optional description of the image. - # @!attribute [rw] family_name - # @return [::String] - # Optional. The name of the image family to which the new image belongs. - # @!attribute [rw] labels - # @return [::Google::Protobuf::Map{::String => ::String}] - # Optional. A map of labels to associate with the image. - # @!attribute [rw] additional_licenses - # @return [::Array<::String>] - # Optional. Additional licenses to assign to the image. - # Format: - # https://www.googleapis.com/compute/v1/projects/PROJECT_ID/global/licenses/LICENSE_NAME - # Or - # https://www.googleapis.com/compute/beta/projects/PROJECT_ID/global/licenses/LICENSE_NAME - # @!attribute [rw] single_region_storage - # @return [::Boolean] - # Optional. Set to true to set the image storageLocations to the single - # region of the import job. When false, the closest multi-region is selected. - # @!attribute [rw] encryption - # @return [::Google::Cloud::VMMigration::V1::Encryption] - # Immutable. The encryption to apply to the image. - class DiskImageTargetDetails - 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 - end - - # The target details of the machine image resource that will be created by the - # image import job. - # @!attribute [rw] os_adaptation_parameters - # @return [::Google::Cloud::VMMigration::V1::ImageImportOsAdaptationParameters] - # Optional. Use to set the parameters relevant for the OS adaptation - # process. - # - # Note: The following fields are mutually exclusive: `os_adaptation_parameters`, `skip_os_adaptation`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] skip_os_adaptation - # @return [::Google::Cloud::VMMigration::V1::SkipOsAdaptation] - # Optional. Use to skip OS adaptation process. - # - # Note: The following fields are mutually exclusive: `skip_os_adaptation`, `os_adaptation_parameters`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] machine_image_name - # @return [::String] - # Required. The name of the machine image to be created. - # @!attribute [rw] target_project - # @return [::String] - # Required. Reference to the TargetProject resource that represents the - # target project in which the imported machine image will be created. - # @!attribute [rw] description - # @return [::String] - # Optional. An optional description of the machine image. - # @!attribute [rw] single_region_storage - # @return [::Boolean] - # Optional. Set to true to set the machine image storageLocations to the - # single region of the import job. When false, the closest multi-region is - # selected. - # @!attribute [rw] encryption - # @return [::Google::Cloud::VMMigration::V1::Encryption] - # Immutable. The encryption to apply to the machine image. - # If the Image Import resource has an encryption, this field must be set to - # the same encryption key. - # @!attribute [rw] machine_image_parameters_overrides - # @return [::Google::Cloud::VMMigration::V1::MachineImageParametersOverrides] - # Optional. Parameters overriding decisions based on the source machine image - # configurations. - # @!attribute [rw] service_account - # @return [::Google::Cloud::VMMigration::V1::ServiceAccount] - # Optional. The service account to assign to the instance created by the - # machine image. - # @!attribute [rw] additional_licenses - # @return [::Array<::String>] - # Optional. Additional licenses to assign to the instance created by the - # machine image. Format: - # https://www.googleapis.com/compute/v1/projects/PROJECT_ID/global/licenses/LICENSE_NAME - # Or - # https://www.googleapis.com/compute/beta/projects/PROJECT_ID/global/licenses/LICENSE_NAME - # @!attribute [rw] labels - # @return [::Google::Protobuf::Map{::String => ::String}] - # Optional. The labels to apply to the instance created by the machine image. - # @!attribute [rw] tags - # @return [::Array<::String>] - # Optional. The tags to apply to the instance created by the machine image. - # @!attribute [rw] shielded_instance_config - # @return [::Google::Cloud::VMMigration::V1::ShieldedInstanceConfig] - # Optional. Shielded instance configuration. - # @!attribute [rw] network_interfaces - # @return [::Array<::Google::Cloud::VMMigration::V1::NetworkInterface>] - # Optional. The network interfaces to create with the instance created by the - # machine image. Internal and external IP addresses, and network tiers are - # ignored for machine image import. - class MachineImageTargetDetails - 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 - end - - # Service account to assign to the instance created by the machine image. - # @!attribute [rw] email - # @return [::String] - # Required. The email address of the service account. - # @!attribute [rw] scopes - # @return [::Array<::String>] - # Optional. The list of scopes to be made available for this service account. - class ServiceAccount - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Shielded instance configuration. - # @!attribute [rw] secure_boot - # @return [::Google::Cloud::VMMigration::V1::ShieldedInstanceConfig::SecureBoot] - # Optional. Defines whether the instance created by the machine image has - # Secure Boot enabled. This can be set to true only if the image boot option - # is EFI. - # @!attribute [rw] enable_vtpm - # @return [::Boolean] - # Optional. Defines whether the instance created by the machine image has - # vTPM enabled. This can be set to true only if the image boot option is EFI. - # @!attribute [rw] enable_integrity_monitoring - # @return [::Boolean] - # Optional. Defines whether the instance created by the machine image has - # integrity monitoring enabled. This can be set to true only if the image - # boot option is EFI, and vTPM is enabled. - class ShieldedInstanceConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Possible values for secure boot. - module SecureBoot - # No explicit value is selected. Will use the configuration of the source - # (if exists, otherwise the default will be false). - SECURE_BOOT_UNSPECIFIED = 0 - - # Use secure boot. This can be set to true only if the image boot option is - # EFI. - TRUE = 1 - - # Do not use secure boot. - FALSE = 2 - end - end - - # Parameters overriding decisions based on the source machine image - # configurations. - # @!attribute [rw] machine_type - # @return [::String] - # Optional. The machine type to create the MachineImage with. - # If empty, the service will choose a relevant machine type based on the - # information from the source image. - # For more information about machine types, please refer to - # https://cloud.google.com/compute/docs/machine-resource. - class MachineImageParametersOverrides - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Parameters affecting the OS adaptation process. - # @!attribute [rw] generalize - # @return [::Boolean] - # Optional. Set to true in order to generalize the imported image. - # The generalization process enables co-existence of multiple VMs created - # from the same image. - # For Windows, generalizing the image removes computer-specific information - # such as installed drivers and the computer security identifier (SID). - # @!attribute [rw] license_type - # @return [::Google::Cloud::VMMigration::V1::ComputeEngineLicenseType] - # Optional. Choose which type of license to apply to the imported image. - # @!attribute [rw] boot_conversion - # @return [::Google::Cloud::VMMigration::V1::BootConversion] - # Optional. By default the image will keep its existing boot option. Setting - # this property will trigger an internal process which will convert the - # image from using the existing boot option to another. - # The size of the boot disk might be increased to allow the conversion - # @!attribute [rw] adaptation_modifiers - # @return [::Array<::Google::Cloud::VMMigration::V1::AdaptationModifier>] - # Optional. Modifiers to be used as configuration of the OS adaptation - # process. - class ImageImportOsAdaptationParameters - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Used when the image import is not using OS adaptation process. - # @!attribute [rw] guest_os_features - # @return [::Array<::String>] - # Optional. A list of guest OS features to apply to the imported image. These - # features are flags that are used by Compute Engine to enable certain - # capabilities for virtual machine instances that are created from the image. - # - # This field does not change the OS of the image; it only marks the image - # with the specified features. The user must ensure that the OS is - # compatible with the features. - # - # For a list of available features, see - # https://cloud.google.com/compute/docs/images/create-custom#guest-os-features. - class DataDiskImageImport - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Mentions that the machine image import is not using OS adaptation process. - class SkipOsAdaptation - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for 'GetImageImport' call. - # @!attribute [rw] name - # @return [::String] - # Required. The ImageImport name. - class GetImageImportRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for 'ListImageImports' call. - # @!attribute [rw] parent - # @return [::String] - # Required. The parent, which owns this collection of targets. - # @!attribute [rw] page_size - # @return [::Integer] - # Optional. The maximum number of targets to return. The service may return - # fewer than this value. If unspecified, at most 500 targets will be - # returned. The maximum value is 1000; values above 1000 will be coerced to - # 1000. - # @!attribute [rw] page_token - # @return [::String] - # Optional. A page token, received from a previous `ListImageImports` call. - # Provide this to retrieve the subsequent page. - # - # When paginating, all other parameters provided to `ListImageImports` must - # match the call that provided the page token. - # @!attribute [rw] filter - # @return [::String] - # Optional. The filter request (according to AIP-160). - # @!attribute [rw] order_by - # @return [::String] - # Optional. The order by fields for the result (according to AIP-132). - # Currently ordering is only possible by "name" field. - class ListImageImportsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for 'ListImageImports' call. - # @!attribute [r] image_imports - # @return [::Array<::Google::Cloud::VMMigration::V1::ImageImport>] - # Output only. The list of target response. - # @!attribute [r] next_page_token - # @return [::String] - # Output only. A token, which can be sent as `page_token` to retrieve the - # next page. If this field is omitted, there are no subsequent pages. - # @!attribute [r] unreachable - # @return [::Array<::String>] - # Output only. Locations that could not be reached. - class ListImageImportsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for 'CreateImageImport' request. - # @!attribute [rw] parent - # @return [::String] - # Required. The ImageImport's parent. - # @!attribute [rw] image_import_id - # @return [::String] - # Required. The image import identifier. - # This value maximum length is 63 characters, and valid characters are - # /[a-z][0-9]-/. It must start with an english letter and must not end with a - # hyphen. - # @!attribute [rw] image_import - # @return [::Google::Cloud::VMMigration::V1::ImageImport] - # Required. The create request body. - # @!attribute [rw] request_id - # @return [::String] - # Optional. A request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server will guarantee - # that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and - # the request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - class CreateImageImportRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for 'DeleteImageImport' request. - # @!attribute [rw] name - # @return [::String] - # Required. The ImageImport name. - # @!attribute [rw] request_id - # @return [::String] - # Optional. A request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server will guarantee - # that for at least 60 minutes after the first request. - # - # For example, consider a situation where you make an initial request and t - # he request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - class DeleteImageImportRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for 'GetImageImportJob' call. - # @!attribute [rw] name - # @return [::String] - # Required. The ImageImportJob name. - class GetImageImportJobRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for 'ListImageImportJobs' call. - # @!attribute [rw] parent - # @return [::String] - # Required. The parent, which owns this collection of targets. - # @!attribute [rw] page_size - # @return [::Integer] - # Optional. The maximum number of targets to return. The service may return - # fewer than this value. If unspecified, at most 500 targets will be - # returned. The maximum value is 1000; values above 1000 will be coerced to - # 1000. - # @!attribute [rw] page_token - # @return [::String] - # Optional. A page token, received from a previous `ListImageImportJobs` - # call. Provide this to retrieve the subsequent page. - # - # When paginating, all other parameters provided to `ListImageImportJobs` - # must match the call that provided the page token. - # @!attribute [rw] filter - # @return [::String] - # Optional. The filter request (according to AIP-160). - # @!attribute [rw] order_by - # @return [::String] - # Optional. The order by fields for the result (according to AIP-132). - # Currently ordering is only possible by "name" field. - class ListImageImportJobsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for 'ListImageImportJobs' call. - # @!attribute [r] image_import_jobs - # @return [::Array<::Google::Cloud::VMMigration::V1::ImageImportJob>] - # Output only. The list of target response. - # @!attribute [r] next_page_token - # @return [::String] - # Output only. A token, which can be sent as `page_token` to retrieve the - # next page. If this field is omitted, there are no subsequent pages. - # @!attribute [r] unreachable - # @return [::Array<::String>] - # Output only. Locations that could not be reached. - class ListImageImportJobsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for 'CancelImageImportJob' request. - # @!attribute [rw] name - # @return [::String] - # Required. The image import job id. - class CancelImageImportJobRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for 'CancelImageImportJob' request. - class CancelImageImportJobResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Describes the disk which will be migrated from the source environment. - # The source disk has to be unattached. - # @!attribute [rw] aws_source_disk_details - # @return [::Google::Cloud::VMMigration::V1::AwsSourceDiskDetails] - # Details of the unattached AWS source disk. - # @!attribute [r] name - # @return [::String] - # Output only. Identifier. The identifier of the DiskMigrationJob. - # @!attribute [rw] target_details - # @return [::Google::Cloud::VMMigration::V1::DiskMigrationJobTargetDetails] - # Required. Details of the target Disk in Compute Engine. - # @!attribute [r] create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time the DiskMigrationJob resource was created. - # @!attribute [r] update_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The last time the DiskMigrationJob resource was updated. - # @!attribute [r] state - # @return [::Google::Cloud::VMMigration::V1::DiskMigrationJob::State] - # Output only. State of the DiskMigrationJob. - # @!attribute [r] errors - # @return [::Array<::Google::Rpc::Status>] - # Output only. Provides details on the errors that led to the disk migration - # job's state in case of an error. - # @!attribute [r] steps - # @return [::Array<::Google::Cloud::VMMigration::V1::DiskMigrationStep>] - # Output only. The disk migration steps list representing its progress. - class DiskMigrationJob - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The possible values of the state/health of DiskMigrationJob. - module State - # The state is unspecified. This is not in use. - STATE_UNSPECIFIED = 0 - - # The initial state of the disk migration. - # In this state the customers can update the target details. - READY = 1 - - # The migration is active, and it's running or scheduled to run. - RUNNING = 3 - - # The migration completed successfully. - SUCCEEDED = 4 - - # Migration cancellation was initiated. - CANCELLING = 5 - - # The migration was cancelled. - CANCELLED = 6 - - # The migration process encountered an unrecoverable error and was aborted. - FAILED = 7 - end - end - - # Details of the target disk in Compute Engine. - # @!attribute [rw] target_disk - # @return [::Google::Cloud::VMMigration::V1::ComputeEngineDisk] - # Required. The target disk. - # @!attribute [rw] target_project - # @return [::String] - # Required. The name of the resource of type TargetProject which represents - # the Compute Engine project in which to create the disk. Should be of the - # form: projects/\\{project}/locations/global/targetProjects/\\{target-project} - # @!attribute [rw] labels - # @return [::Google::Protobuf::Map{::String => ::String}] - # Optional. A map of labels to associate with the disk. - # @!attribute [rw] encryption - # @return [::Google::Cloud::VMMigration::V1::Encryption] - # Optional. The encryption to apply to the disk. - # If the DiskMigrationJob parent Source resource has an encryption, this - # field must be set to the same encryption key. - class DiskMigrationJobTargetDetails - 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 - end - - # DiskMigrationStep holds information about the disk migration step progress. - # @!attribute [rw] creating_source_disk_snapshot - # @return [::Google::Cloud::VMMigration::V1::CreatingSourceDiskSnapshotStep] - # Creating source disk snapshot step. - # - # Note: The following fields are mutually exclusive: `creating_source_disk_snapshot`, `copying_source_disk_snapshot`, `provisioning_target_disk`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] copying_source_disk_snapshot - # @return [::Google::Cloud::VMMigration::V1::CopyingSourceDiskSnapshotStep] - # Copying source disk snapshot step. - # - # Note: The following fields are mutually exclusive: `copying_source_disk_snapshot`, `creating_source_disk_snapshot`, `provisioning_target_disk`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] provisioning_target_disk - # @return [::Google::Cloud::VMMigration::V1::ProvisioningTargetDiskStep] - # Creating target disk step. - # - # Note: The following fields are mutually exclusive: `provisioning_target_disk`, `creating_source_disk_snapshot`, `copying_source_disk_snapshot`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [r] start_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time the step has started. - # @!attribute [r] end_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time the step has ended. - class DiskMigrationStep - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # CreatingSourceDiskSnapshotStep contains specific step details. - class CreatingSourceDiskSnapshotStep - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # CopyingSourceDiskSnapshotStep contains specific step details. - class CopyingSourceDiskSnapshotStep - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # ProvisioningTargetDiskStep contains specific step details. - class ProvisioningTargetDiskStep - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Compute Engine disk target details. - # @!attribute [rw] disk_id - # @return [::String] - # Optional. Target Compute Engine Disk ID. - # This is the resource ID segment of the Compute Engine Disk to create. - # In the resource name compute/v1/projects/\\{project}/zones/\\{zone}/disks/disk1 - # "disk1" is the resource ID for the disk. - # @!attribute [rw] zone - # @return [::String] - # Required. The Compute Engine zone in which to create the disk. Should be of - # the form: projects/\\{target-project}/locations/\\{zone} - # @!attribute [rw] replica_zones - # @return [::Array<::String>] - # Optional. Replication zones of the regional disk. Should be of the form: - # projects/\\{target-project}/locations/\\{replica-zone} - # Currently only one replica zone is supported. - # @!attribute [rw] disk_type - # @return [::Google::Cloud::VMMigration::V1::ComputeEngineDiskType] - # Required. The disk type to use. - class ComputeEngineDisk - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Represents the source AWS Disk details. - # @!attribute [rw] volume_id - # @return [::String] - # Required. AWS volume ID. - # @!attribute [r] size_gib - # @return [::Integer] - # Output only. Size in GiB. - # @!attribute [r] disk_type - # @return [::Google::Cloud::VMMigration::V1::AwsSourceDiskDetails::Type] - # Optional. Output only. Disk type. - # @!attribute [r] tags - # @return [::Google::Protobuf::Map{::String => ::String}] - # Optional. Output only. A map of AWS volume tags. - class AwsSourceDiskDetails - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class TagsEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Possible values for disk types. - module Type - # Unspecified AWS disk type. Should not be used. - TYPE_UNSPECIFIED = 0 - - # GP2 disk type. - GP2 = 1 - - # GP3 disk type. - GP3 = 2 - - # IO1 disk type. - IO1 = 3 - - # IO2 disk type. - IO2 = 4 - - # ST1 disk type. - ST1 = 5 - - # SC1 disk type. - SC1 = 6 - - # Standard disk type. - STANDARD = 7 - end - end - - # Request message for 'CreateDiskMigrationJob' request. - # @!attribute [rw] parent - # @return [::String] - # Required. The DiskMigrationJob's parent. - # @!attribute [rw] disk_migration_job_id - # @return [::String] - # Required. The DiskMigrationJob identifier. - # The maximum length of this value is 63 characters. - # Valid characters are lower case Latin letters, digits and hyphen. - # It must start with a Latin letter and must not end with a hyphen. - # @!attribute [rw] disk_migration_job - # @return [::Google::Cloud::VMMigration::V1::DiskMigrationJob] - # Required. The create request body. - # @!attribute [rw] request_id - # @return [::String] - # Optional. A request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server will guarantee - # that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and - # the request timed out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - class CreateDiskMigrationJobRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for 'ListDiskMigrationJobsRequest' request. - # @!attribute [rw] parent - # @return [::String] - # Required. The parent, which owns this collection of DiskMigrationJobs. - # @!attribute [rw] page_size - # @return [::Integer] - # Optional. The maximum number of disk migration jobs to return. The service - # may return fewer than this value. If unspecified, at most 500 - # disk migration jobs will be returned. - # The maximum value is 1000; values above 1000 will be coerced to 1000. - # @!attribute [rw] page_token - # @return [::String] - # Optional. A page token, received from a previous `ListDiskMigrationJobs` - # call. Provide this to retrieve the subsequent page. - # - # When paginating, all parameters provided to `ListDiskMigrationJobs` - # except `page_size` must match the call that provided the page token. - # @!attribute [rw] filter - # @return [::String] - # Optional. The filter request (according to AIP-160). - # @!attribute [rw] order_by - # @return [::String] - # Optional. Ordering of the result list. - class ListDiskMigrationJobsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for 'ListDiskMigrationJobs' request. - # @!attribute [r] disk_migration_jobs - # @return [::Array<::Google::Cloud::VMMigration::V1::DiskMigrationJob>] - # Output only. The list of the disk migration jobs. - # @!attribute [r] next_page_token - # @return [::String] - # Optional. Output only. A token, which can be sent as `page_token` to - # retrieve the next page. If this field is omitted, there are no subsequent - # pages. - # @!attribute [r] unreachable - # @return [::Array<::String>] - # Output only. Locations that could not be reached. - class ListDiskMigrationJobsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for 'GetDiskMigrationJob' request. - # @!attribute [rw] name - # @return [::String] - # Required. The name of the DiskMigrationJob. - class GetDiskMigrationJobRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for 'UpdateDiskMigrationJob' request. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # Optional. Field mask is used to specify the fields to be overwritten in the - # DiskMigrationJob resource by the update. - # The fields specified in the update_mask are relative to the resource, not - # the full request. A field will be overwritten if it is in the mask. If the - # user does not provide a mask, then a mask equivalent to all fields that are - # populated (have a non-empty value), will be implied. - # @!attribute [rw] disk_migration_job - # @return [::Google::Cloud::VMMigration::V1::DiskMigrationJob] - # Required. The update request body. - # @!attribute [rw] request_id - # @return [::String] - # Optional. A request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server will guarantee - # that for at least 60 minutes since the first request. - # - # For example, consider a situation where you make an initial request and - # the request timed out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - class UpdateDiskMigrationJobRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for 'DeleteDiskMigrationJob' request. - # @!attribute [rw] name - # @return [::String] - # Required. The name of the DiskMigrationJob. - class DeleteDiskMigrationJobRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for 'RunDiskMigrationJobRequest' request. - # @!attribute [rw] name - # @return [::String] - # Required. The name of the DiskMigrationJob. - class RunDiskMigrationJobRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for 'RunDiskMigrationJob' request. - class RunDiskMigrationJobResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for 'CancelDiskMigrationJob' request. - # @!attribute [rw] name - # @return [::String] - # Required. The name of the DiskMigrationJob. - class CancelDiskMigrationJobRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for 'CancelDiskMigrationJob' request. - class CancelDiskMigrationJobResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Types of disks supported for Compute Engine VM. - module ComputeEngineDiskType - # An unspecified disk type. Will be used as STANDARD. - COMPUTE_ENGINE_DISK_TYPE_UNSPECIFIED = 0 - - # A Standard disk type. - COMPUTE_ENGINE_DISK_TYPE_STANDARD = 1 - - # SSD hard disk type. - COMPUTE_ENGINE_DISK_TYPE_SSD = 2 - - # An alternative to SSD persistent disks that balance performance and - # cost. - COMPUTE_ENGINE_DISK_TYPE_BALANCED = 3 - - # Hyperdisk balanced disk type. - COMPUTE_ENGINE_DISK_TYPE_HYPERDISK_BALANCED = 4 - end - - # Types of licenses used in OS adaptation. - module ComputeEngineLicenseType - # The license type is the default for the OS. - COMPUTE_ENGINE_LICENSE_TYPE_DEFAULT = 0 - - # The license type is Pay As You Go license type. - COMPUTE_ENGINE_LICENSE_TYPE_PAYG = 1 - - # The license type is Bring Your Own License type. - COMPUTE_ENGINE_LICENSE_TYPE_BYOL = 2 - end - - # Possible values for vm boot option. - module ComputeEngineBootOption - # The boot option is unknown. - COMPUTE_ENGINE_BOOT_OPTION_UNSPECIFIED = 0 - - # The boot option is EFI. - COMPUTE_ENGINE_BOOT_OPTION_EFI = 1 - - # The boot option is BIOS. - COMPUTE_ENGINE_BOOT_OPTION_BIOS = 2 - end - - # VM operating system (OS) capabilities needed for determining compatibility - # with Compute Engine features supported by the migration. - module OsCapability - # This is for API compatibility only and is not in use. - OS_CAPABILITY_UNSPECIFIED = 0 - - # NVMe driver installed and the VM can use NVMe PD or local SSD. - OS_CAPABILITY_NVME_STORAGE_ACCESS = 1 - - # gVNIC virtual NIC driver supported. - OS_CAPABILITY_GVNIC_NETWORK_INTERFACE = 2 - - # IDPF virtual NIC driver supported. - OS_CAPABILITY_IDPF_NETWORK_INTERFACE = 3 - end - - # Possible boot options conversions. - module BootConversion - # Unspecified conversion type. - BOOT_CONVERSION_UNSPECIFIED = 0 - - # No conversion. - NONE = 1 - - # Convert from BIOS to EFI. - BIOS_TO_EFI = 2 - end - - # Controls the level of details of a Utilization Report. - module UtilizationReportView - # The default / unset value. - # The API will default to FULL on single report request and BASIC for - # multiple reports request. - UTILIZATION_REPORT_VIEW_UNSPECIFIED = 0 - - # Get the report metadata, without the list of VMs and their utilization - # info. - BASIC = 1 - - # Include everything. - FULL = 2 - end - - # Controls the level of details of a Migrating VM. - module MigratingVmView - # View is unspecified. The API will fallback to the default value. - MIGRATING_VM_VIEW_UNSPECIFIED = 0 - - # Get the migrating VM basic details. - # The basic details do not include the recent clone jobs and recent cutover - # jobs lists. - MIGRATING_VM_VIEW_BASIC = 1 - - # Include everything. - MIGRATING_VM_VIEW_FULL = 2 - end - - # Possible values for the VM architecture. - module VmArchitecture - # The architecture is unknown. - VM_ARCHITECTURE_UNSPECIFIED = 0 - - # The architecture is one of the x86 architectures. - VM_ARCHITECTURE_X86_FAMILY = 1 - - # The architecture is ARM64. - VM_ARCHITECTURE_ARM64 = 2 - end - - # Describes the networking tier used for configuring network access - # configuration. - module ComputeEngineNetworkTier - # An unspecified network tier. Will be used as PREMIUM. - COMPUTE_ENGINE_NETWORK_TIER_UNSPECIFIED = 0 - - # A standard network tier. - NETWORK_TIER_STANDARD = 1 - - # A premium network tier. - NETWORK_TIER_PREMIUM = 2 - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-vm_migration-v1/proto_docs/google/iam/v1/iam_policy.rb b/owl-bot-staging/google-cloud-vm_migration-v1/proto_docs/google/iam/v1/iam_policy.rb deleted file mode 100644 index 5445c77f8258..000000000000 --- a/owl-bot-staging/google-cloud-vm_migration-v1/proto_docs/google/iam/v1/iam_policy.rb +++ /dev/null @@ -1,87 +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 Iam - module V1 - # Request message for `SetIamPolicy` method. - # @!attribute [rw] resource - # @return [::String] - # REQUIRED: The resource for which the policy is being specified. - # See the operation documentation for the appropriate value for this field. - # @!attribute [rw] policy - # @return [::Google::Iam::V1::Policy] - # REQUIRED: The complete policy to be applied to the `resource`. The size of - # the policy is limited to a few 10s of KB. An empty policy is a - # valid policy but certain Cloud Platform services (such as Projects) - # might reject them. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only - # the fields in the mask will be modified. If no mask is provided, the - # following default mask is used: - # - # `paths: "bindings, etag"` - class SetIamPolicyRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for `GetIamPolicy` method. - # @!attribute [rw] resource - # @return [::String] - # REQUIRED: The resource for which the policy is being requested. - # See the operation documentation for the appropriate value for this field. - # @!attribute [rw] options - # @return [::Google::Iam::V1::GetPolicyOptions] - # OPTIONAL: A `GetPolicyOptions` object for specifying options to - # `GetIamPolicy`. - class GetIamPolicyRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for `TestIamPermissions` method. - # @!attribute [rw] resource - # @return [::String] - # REQUIRED: The resource for which the policy detail is being requested. - # See the operation documentation for the appropriate value for this field. - # @!attribute [rw] permissions - # @return [::Array<::String>] - # The set of permissions to check for the `resource`. Permissions with - # wildcards (such as '*' or 'storage.*') are not allowed. For more - # information see - # [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). - class TestIamPermissionsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for `TestIamPermissions` method. - # @!attribute [rw] permissions - # @return [::Array<::String>] - # A subset of `TestPermissionsRequest.permissions` that the caller is - # allowed. - class TestIamPermissionsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end -end diff --git a/owl-bot-staging/google-cloud-vm_migration-v1/proto_docs/google/iam/v1/options.rb b/owl-bot-staging/google-cloud-vm_migration-v1/proto_docs/google/iam/v1/options.rb deleted file mode 100644 index 60713d995b86..000000000000 --- a/owl-bot-staging/google-cloud-vm_migration-v1/proto_docs/google/iam/v1/options.rb +++ /dev/null @@ -1,50 +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 Iam - module V1 - # Encapsulates settings provided to GetIamPolicy. - # @!attribute [rw] requested_policy_version - # @return [::Integer] - # Optional. The maximum policy version that will be used to format the - # policy. - # - # Valid values are 0, 1, and 3. Requests specifying an invalid value will be - # rejected. - # - # Requests for policies with any conditional role bindings must specify - # version 3. Policies with no conditional role bindings may specify any valid - # value or leave the field unset. - # - # The policy in the response might use the policy version that you specified, - # or it might use a lower policy version. For example, if you specify version - # 3, but the policy has no conditional role bindings, the response uses - # version 1. - # - # To learn which resources support conditions in their IAM policies, see the - # [IAM - # documentation](https://cloud.google.com/iam/help/conditions/resource-policies). - class GetPolicyOptions - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end -end diff --git a/owl-bot-staging/google-cloud-vm_migration-v1/proto_docs/google/iam/v1/policy.rb b/owl-bot-staging/google-cloud-vm_migration-v1/proto_docs/google/iam/v1/policy.rb deleted file mode 100644 index 999575b797df..000000000000 --- a/owl-bot-staging/google-cloud-vm_migration-v1/proto_docs/google/iam/v1/policy.rb +++ /dev/null @@ -1,426 +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 Iam - module V1 - # An Identity and Access Management (IAM) policy, which specifies access - # controls for Google Cloud resources. - # - # - # A `Policy` is a collection of `bindings`. A `binding` binds one or more - # `members`, or principals, to a single `role`. Principals can be user - # accounts, service accounts, Google groups, and domains (such as G Suite). A - # `role` is a named list of permissions; each `role` can be an IAM predefined - # role or a user-created custom role. - # - # For some types of Google Cloud resources, a `binding` can also specify a - # `condition`, which is a logical expression that allows access to a resource - # only if the expression evaluates to `true`. A condition can add constraints - # based on attributes of the request, the resource, or both. To learn which - # resources support conditions in their IAM policies, see the - # [IAM - # documentation](https://cloud.google.com/iam/help/conditions/resource-policies). - # - # **JSON example:** - # - # ``` - # { - # "bindings": [ - # { - # "role": "roles/resourcemanager.organizationAdmin", - # "members": [ - # "user:mike@example.com", - # "group:admins@example.com", - # "domain:google.com", - # "serviceAccount:my-project-id@appspot.gserviceaccount.com" - # ] - # }, - # { - # "role": "roles/resourcemanager.organizationViewer", - # "members": [ - # "user:eve@example.com" - # ], - # "condition": { - # "title": "expirable access", - # "description": "Does not grant access after Sep 2020", - # "expression": "request.time < - # timestamp('2020-10-01T00:00:00.000Z')", - # } - # } - # ], - # "etag": "BwWWja0YfJA=", - # "version": 3 - # } - # ``` - # - # **YAML example:** - # - # ``` - # bindings: - # - members: - # - user:mike@example.com - # - group:admins@example.com - # - domain:google.com - # - serviceAccount:my-project-id@appspot.gserviceaccount.com - # role: roles/resourcemanager.organizationAdmin - # - members: - # - user:eve@example.com - # role: roles/resourcemanager.organizationViewer - # condition: - # title: expirable access - # description: Does not grant access after Sep 2020 - # expression: request.time < timestamp('2020-10-01T00:00:00.000Z') - # etag: BwWWja0YfJA= - # version: 3 - # ``` - # - # For a description of IAM and its features, see the - # [IAM documentation](https://cloud.google.com/iam/docs/). - # @!attribute [rw] version - # @return [::Integer] - # Specifies the format of the policy. - # - # Valid values are `0`, `1`, and `3`. Requests that specify an invalid value - # are rejected. - # - # Any operation that affects conditional role bindings must specify version - # `3`. This requirement applies to the following operations: - # - # * Getting a policy that includes a conditional role binding - # * Adding a conditional role binding to a policy - # * Changing a conditional role binding in a policy - # * Removing any role binding, with or without a condition, from a policy - # that includes conditions - # - # **Important:** If you use IAM Conditions, you must include the `etag` field - # whenever you call `setIamPolicy`. If you omit this field, then IAM allows - # you to overwrite a version `3` policy with a version `1` policy, and all of - # the conditions in the version `3` policy are lost. - # - # If a policy does not include any conditions, operations on that policy may - # specify any valid version or leave the field unset. - # - # To learn which resources support conditions in their IAM policies, see the - # [IAM - # documentation](https://cloud.google.com/iam/help/conditions/resource-policies). - # @!attribute [rw] bindings - # @return [::Array<::Google::Iam::V1::Binding>] - # Associates a list of `members`, or principals, with a `role`. Optionally, - # may specify a `condition` that determines how and when the `bindings` are - # applied. Each of the `bindings` must contain at least one principal. - # - # The `bindings` in a `Policy` can refer to up to 1,500 principals; up to 250 - # of these principals can be Google groups. Each occurrence of a principal - # counts towards these limits. For example, if the `bindings` grant 50 - # different roles to `user:alice@example.com`, and not to any other - # principal, then you can add another 1,450 principals to the `bindings` in - # the `Policy`. - # @!attribute [rw] audit_configs - # @return [::Array<::Google::Iam::V1::AuditConfig>] - # Specifies cloud audit logging configuration for this policy. - # @!attribute [rw] etag - # @return [::String] - # `etag` is used for optimistic concurrency control as a way to help - # prevent simultaneous updates of a policy from overwriting each other. - # It is strongly suggested that systems make use of the `etag` in the - # read-modify-write cycle to perform policy updates in order to avoid race - # conditions: An `etag` is returned in the response to `getIamPolicy`, and - # systems are expected to put that etag in the request to `setIamPolicy` to - # ensure that their change will be applied to the same version of the policy. - # - # **Important:** If you use IAM Conditions, you must include the `etag` field - # whenever you call `setIamPolicy`. If you omit this field, then IAM allows - # you to overwrite a version `3` policy with a version `1` policy, and all of - # the conditions in the version `3` policy are lost. - class Policy - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Associates `members`, or principals, with a `role`. - # @!attribute [rw] role - # @return [::String] - # Role that is assigned to the list of `members`, or principals. - # For example, `roles/viewer`, `roles/editor`, or `roles/owner`. - # @!attribute [rw] members - # @return [::Array<::String>] - # Specifies the principals requesting access for a Google Cloud resource. - # `members` can have the following values: - # - # * `allUsers`: A special identifier that represents anyone who is - # on the internet; with or without a Google account. - # - # * `allAuthenticatedUsers`: A special identifier that represents anyone - # who is authenticated with a Google account or a service account. - # - # * `user:{emailid}`: An email address that represents a specific Google - # account. For example, `alice@example.com` . - # - # - # * `serviceAccount:{emailid}`: An email address that represents a service - # account. For example, `my-other-app@appspot.gserviceaccount.com`. - # - # * `group:{emailid}`: An email address that represents a Google group. - # For example, `admins@example.com`. - # - # * `deleted:user:{emailid}?uid={uniqueid}`: An email address (plus unique - # identifier) representing a user that has been recently deleted. For - # example, `alice@example.com?uid=123456789012345678901`. If the user is - # recovered, this value reverts to `user:{emailid}` and the recovered user - # retains the role in the binding. - # - # * `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address (plus - # unique identifier) representing a service account that has been recently - # deleted. For example, - # `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`. - # If the service account is undeleted, this value reverts to - # `serviceAccount:{emailid}` and the undeleted service account retains the - # role in the binding. - # - # * `deleted:group:{emailid}?uid={uniqueid}`: An email address (plus unique - # identifier) representing a Google group that has been recently - # deleted. For example, `admins@example.com?uid=123456789012345678901`. If - # the group is recovered, this value reverts to `group:{emailid}` and the - # recovered group retains the role in the binding. - # - # - # * `domain:{domain}`: The G Suite domain (primary) that represents all the - # users of that domain. For example, `google.com` or `example.com`. - # @!attribute [rw] condition - # @return [::Google::Type::Expr] - # The condition that is associated with this binding. - # - # If the condition evaluates to `true`, then this binding applies to the - # current request. - # - # If the condition evaluates to `false`, then this binding does not apply to - # the current request. However, a different role binding might grant the same - # role to one or more of the principals in this binding. - # - # To learn which resources support conditions in their IAM policies, see the - # [IAM - # documentation](https://cloud.google.com/iam/help/conditions/resource-policies). - class Binding - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Specifies the audit configuration for a service. - # The configuration determines which permission types are logged, and what - # identities, if any, are exempted from logging. - # An AuditConfig must have one or more AuditLogConfigs. - # - # If there are AuditConfigs for both `allServices` and a specific service, - # the union of the two AuditConfigs is used for that service: the log_types - # specified in each AuditConfig are enabled, and the exempted_members in each - # AuditLogConfig are exempted. - # - # Example Policy with multiple AuditConfigs: - # - # { - # "audit_configs": [ - # { - # "service": "allServices", - # "audit_log_configs": [ - # { - # "log_type": "DATA_READ", - # "exempted_members": [ - # "user:jose@example.com" - # ] - # }, - # { - # "log_type": "DATA_WRITE" - # }, - # { - # "log_type": "ADMIN_READ" - # } - # ] - # }, - # { - # "service": "sampleservice.googleapis.com", - # "audit_log_configs": [ - # { - # "log_type": "DATA_READ" - # }, - # { - # "log_type": "DATA_WRITE", - # "exempted_members": [ - # "user:aliya@example.com" - # ] - # } - # ] - # } - # ] - # } - # - # For sampleservice, this policy enables DATA_READ, DATA_WRITE and ADMIN_READ - # logging. It also exempts `jose@example.com` from DATA_READ logging, and - # `aliya@example.com` from DATA_WRITE logging. - # @!attribute [rw] service - # @return [::String] - # Specifies a service that will be enabled for audit logging. - # For example, `storage.googleapis.com`, `cloudsql.googleapis.com`. - # `allServices` is a special value that covers all services. - # @!attribute [rw] audit_log_configs - # @return [::Array<::Google::Iam::V1::AuditLogConfig>] - # The configuration for logging of each type of permission. - class AuditConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Provides the configuration for logging a type of permissions. - # Example: - # - # { - # "audit_log_configs": [ - # { - # "log_type": "DATA_READ", - # "exempted_members": [ - # "user:jose@example.com" - # ] - # }, - # { - # "log_type": "DATA_WRITE" - # } - # ] - # } - # - # This enables 'DATA_READ' and 'DATA_WRITE' logging, while exempting - # jose@example.com from DATA_READ logging. - # @!attribute [rw] log_type - # @return [::Google::Iam::V1::AuditLogConfig::LogType] - # The log type that this config enables. - # @!attribute [rw] exempted_members - # @return [::Array<::String>] - # Specifies the identities that do not cause logging for this type of - # permission. - # Follows the same format of - # [Binding.members][google.iam.v1.Binding.members]. - class AuditLogConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The list of valid permission types for which logging can be configured. - # Admin writes are always logged, and are not configurable. - module LogType - # Default case. Should never be this. - LOG_TYPE_UNSPECIFIED = 0 - - # Admin reads. Example: CloudIAM getIamPolicy - ADMIN_READ = 1 - - # Data writes. Example: CloudSQL Users create - DATA_WRITE = 2 - - # Data reads. Example: CloudSQL Users list - DATA_READ = 3 - end - end - - # The difference delta between two policies. - # @!attribute [rw] binding_deltas - # @return [::Array<::Google::Iam::V1::BindingDelta>] - # The delta for Bindings between two policies. - # @!attribute [rw] audit_config_deltas - # @return [::Array<::Google::Iam::V1::AuditConfigDelta>] - # The delta for AuditConfigs between two policies. - class PolicyDelta - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # One delta entry for Binding. Each individual change (only one member in each - # entry) to a binding will be a separate entry. - # @!attribute [rw] action - # @return [::Google::Iam::V1::BindingDelta::Action] - # The action that was performed on a Binding. - # Required - # @!attribute [rw] role - # @return [::String] - # Role that is assigned to `members`. - # For example, `roles/viewer`, `roles/editor`, or `roles/owner`. - # Required - # @!attribute [rw] member - # @return [::String] - # A single identity requesting access for a Google Cloud resource. - # Follows the same format of Binding.members. - # Required - # @!attribute [rw] condition - # @return [::Google::Type::Expr] - # The condition that is associated with this binding. - class BindingDelta - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The type of action performed on a Binding in a policy. - module Action - # Unspecified. - ACTION_UNSPECIFIED = 0 - - # Addition of a Binding. - ADD = 1 - - # Removal of a Binding. - REMOVE = 2 - end - end - - # One delta entry for AuditConfig. Each individual change (only one - # exempted_member in each entry) to a AuditConfig will be a separate entry. - # @!attribute [rw] action - # @return [::Google::Iam::V1::AuditConfigDelta::Action] - # The action that was performed on an audit configuration in a policy. - # Required - # @!attribute [rw] service - # @return [::String] - # Specifies a service that was configured for Cloud Audit Logging. - # For example, `storage.googleapis.com`, `cloudsql.googleapis.com`. - # `allServices` is a special value that covers all services. - # Required - # @!attribute [rw] exempted_member - # @return [::String] - # A single identity that is exempted from "data access" audit - # logging for the `service` specified above. - # Follows the same format of Binding.members. - # @!attribute [rw] log_type - # @return [::String] - # Specifies the log_type that was be enabled. ADMIN_ACTIVITY is always - # enabled, and cannot be configured. - # Required - class AuditConfigDelta - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The type of action performed on an audit configuration in a policy. - module Action - # Unspecified. - ACTION_UNSPECIFIED = 0 - - # Addition of an audit configuration. - ADD = 1 - - # Removal of an audit configuration. - REMOVE = 2 - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-vm_migration-v1/proto_docs/google/longrunning/operations.rb b/owl-bot-staging/google-cloud-vm_migration-v1/proto_docs/google/longrunning/operations.rb deleted file mode 100644 index 7a757f512165..000000000000 --- a/owl-bot-staging/google-cloud-vm_migration-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-vm_migration-v1/proto_docs/google/protobuf/any.rb b/owl-bot-staging/google-cloud-vm_migration-v1/proto_docs/google/protobuf/any.rb deleted file mode 100644 index 58691995f02e..000000000000 --- a/owl-bot-staging/google-cloud-vm_migration-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-vm_migration-v1/proto_docs/google/protobuf/duration.rb b/owl-bot-staging/google-cloud-vm_migration-v1/proto_docs/google/protobuf/duration.rb deleted file mode 100644 index ea59f1f91daf..000000000000 --- a/owl-bot-staging/google-cloud-vm_migration-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-vm_migration-v1/proto_docs/google/protobuf/empty.rb b/owl-bot-staging/google-cloud-vm_migration-v1/proto_docs/google/protobuf/empty.rb deleted file mode 100644 index 83e4481834a6..000000000000 --- a/owl-bot-staging/google-cloud-vm_migration-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-vm_migration-v1/proto_docs/google/protobuf/field_mask.rb b/owl-bot-staging/google-cloud-vm_migration-v1/proto_docs/google/protobuf/field_mask.rb deleted file mode 100644 index 7f3ffc78601a..000000000000 --- a/owl-bot-staging/google-cloud-vm_migration-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-vm_migration-v1/proto_docs/google/protobuf/timestamp.rb b/owl-bot-staging/google-cloud-vm_migration-v1/proto_docs/google/protobuf/timestamp.rb deleted file mode 100644 index 74352be9c58c..000000000000 --- a/owl-bot-staging/google-cloud-vm_migration-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-vm_migration-v1/proto_docs/google/rpc/error_details.rb b/owl-bot-staging/google-cloud-vm_migration-v1/proto_docs/google/rpc/error_details.rb deleted file mode 100644 index 507d2b54094a..000000000000 --- a/owl-bot-staging/google-cloud-vm_migration-v1/proto_docs/google/rpc/error_details.rb +++ /dev/null @@ -1,420 +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 - # Describes the cause of the error with structured details. - # - # Example of an error when contacting the "pubsub.googleapis.com" API when it - # is not enabled: - # - # { "reason": "API_DISABLED" - # "domain": "googleapis.com" - # "metadata": { - # "resource": "projects/123", - # "service": "pubsub.googleapis.com" - # } - # } - # - # This response indicates that the pubsub.googleapis.com API is not enabled. - # - # Example of an error that is returned when attempting to create a Spanner - # instance in a region that is out of stock: - # - # { "reason": "STOCKOUT" - # "domain": "spanner.googleapis.com", - # "metadata": { - # "availableRegions": "us-central1,us-east2" - # } - # } - # @!attribute [rw] reason - # @return [::String] - # The reason of the error. This is a constant value that identifies the - # proximate cause of the error. Error reasons are unique within a particular - # domain of errors. This should be at most 63 characters and match a - # regular expression of `[A-Z][A-Z0-9_]+[A-Z0-9]`, which represents - # UPPER_SNAKE_CASE. - # @!attribute [rw] domain - # @return [::String] - # The logical grouping to which the "reason" belongs. The error domain - # is typically the registered service name of the tool or product that - # generates the error. Example: "pubsub.googleapis.com". If the error is - # generated by some common infrastructure, the error domain must be a - # globally unique value that identifies the infrastructure. For Google API - # infrastructure, the error domain is "googleapis.com". - # @!attribute [rw] metadata - # @return [::Google::Protobuf::Map{::String => ::String}] - # Additional structured details about this error. - # - # Keys must match a regular expression of `[a-z][a-zA-Z0-9-_]+` but should - # ideally be lowerCamelCase. Also, they must be limited to 64 characters in - # length. When identifying the current value of an exceeded limit, the units - # should be contained in the key, not the value. For example, rather than - # `{"instanceLimit": "100/request"}`, should be returned as, - # `{"instanceLimitPerRequest": "100"}`, if the client exceeds the number of - # instances that can be created in a single (batch) request. - class ErrorInfo - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class MetadataEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Describes when the clients can retry a failed request. Clients could ignore - # the recommendation here or retry when this information is missing from error - # responses. - # - # It's always recommended that clients should use exponential backoff when - # retrying. - # - # Clients should wait until `retry_delay` amount of time has passed since - # receiving the error response before retrying. If retrying requests also - # fail, clients should use an exponential backoff scheme to gradually increase - # the delay between retries based on `retry_delay`, until either a maximum - # number of retries have been reached or a maximum retry delay cap has been - # reached. - # @!attribute [rw] retry_delay - # @return [::Google::Protobuf::Duration] - # Clients should wait at least this long between retrying the same request. - class RetryInfo - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Describes additional debugging info. - # @!attribute [rw] stack_entries - # @return [::Array<::String>] - # The stack trace entries indicating where the error occurred. - # @!attribute [rw] detail - # @return [::String] - # Additional debugging information provided by the server. - class DebugInfo - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Describes how a quota check failed. - # - # For example if a daily limit was exceeded for the calling project, - # a service could respond with a QuotaFailure detail containing the project - # id and the description of the quota limit that was exceeded. If the - # calling project hasn't enabled the service in the developer console, then - # a service could respond with the project id and set `service_disabled` - # to true. - # - # Also see RetryInfo and Help types for other details about handling a - # quota failure. - # @!attribute [rw] violations - # @return [::Array<::Google::Rpc::QuotaFailure::Violation>] - # Describes all quota violations. - class QuotaFailure - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # A message type used to describe a single quota violation. For example, a - # daily quota or a custom quota that was exceeded. - # @!attribute [rw] subject - # @return [::String] - # The subject on which the quota check failed. - # For example, "clientip:" or "project:". - # @!attribute [rw] description - # @return [::String] - # A description of how the quota check failed. Clients can use this - # description to find more about the quota configuration in the service's - # public documentation, or find the relevant quota limit to adjust through - # developer console. - # - # For example: "Service disabled" or "Daily Limit for read operations - # exceeded". - # @!attribute [rw] api_service - # @return [::String] - # The API Service from which the `QuotaFailure.Violation` orginates. In - # some cases, Quota issues originate from an API Service other than the one - # that was called. In other words, a dependency of the called API Service - # could be the cause of the `QuotaFailure`, and this field would have the - # dependency API service name. - # - # For example, if the called API is Kubernetes Engine API - # (container.googleapis.com), and a quota violation occurs in the - # Kubernetes Engine API itself, this field would be - # "container.googleapis.com". On the other hand, if the quota violation - # occurs when the Kubernetes Engine API creates VMs in the Compute Engine - # API (compute.googleapis.com), this field would be - # "compute.googleapis.com". - # @!attribute [rw] quota_metric - # @return [::String] - # The metric of the violated quota. A quota metric is a named counter to - # measure usage, such as API requests or CPUs. When an activity occurs in a - # service, such as Virtual Machine allocation, one or more quota metrics - # may be affected. - # - # For example, "compute.googleapis.com/cpus_per_vm_family", - # "storage.googleapis.com/internet_egress_bandwidth". - # @!attribute [rw] quota_id - # @return [::String] - # The id of the violated quota. Also know as "limit name", this is the - # unique identifier of a quota in the context of an API service. - # - # For example, "CPUS-PER-VM-FAMILY-per-project-region". - # @!attribute [rw] quota_dimensions - # @return [::Google::Protobuf::Map{::String => ::String}] - # The dimensions of the violated quota. Every non-global quota is enforced - # on a set of dimensions. While quota metric defines what to count, the - # dimensions specify for what aspects the counter should be increased. - # - # For example, the quota "CPUs per region per VM family" enforces a limit - # on the metric "compute.googleapis.com/cpus_per_vm_family" on dimensions - # "region" and "vm_family". And if the violation occurred in region - # "us-central1" and for VM family "n1", the quota_dimensions would be, - # - # { - # "region": "us-central1", - # "vm_family": "n1", - # } - # - # When a quota is enforced globally, the quota_dimensions would always be - # empty. - # @!attribute [rw] quota_value - # @return [::Integer] - # The enforced quota value at the time of the `QuotaFailure`. - # - # For example, if the enforced quota value at the time of the - # `QuotaFailure` on the number of CPUs is "10", then the value of this - # field would reflect this quantity. - # @!attribute [rw] future_quota_value - # @return [::Integer] - # The new quota value being rolled out at the time of the violation. At the - # completion of the rollout, this value will be enforced in place of - # quota_value. If no rollout is in progress at the time of the violation, - # this field is not set. - # - # For example, if at the time of the violation a rollout is in progress - # changing the number of CPUs quota from 10 to 20, 20 would be the value of - # this field. - class Violation - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class QuotaDimensionsEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - - # Describes what preconditions have failed. - # - # For example, if an RPC failed because it required the Terms of Service to be - # acknowledged, it could list the terms of service violation in the - # PreconditionFailure message. - # @!attribute [rw] violations - # @return [::Array<::Google::Rpc::PreconditionFailure::Violation>] - # Describes all precondition violations. - class PreconditionFailure - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # A message type used to describe a single precondition failure. - # @!attribute [rw] type - # @return [::String] - # The type of PreconditionFailure. We recommend using a service-specific - # enum type to define the supported precondition violation subjects. For - # example, "TOS" for "Terms of Service violation". - # @!attribute [rw] subject - # @return [::String] - # The subject, relative to the type, that failed. - # For example, "google.com/cloud" relative to the "TOS" type would indicate - # which terms of service is being referenced. - # @!attribute [rw] description - # @return [::String] - # A description of how the precondition failed. Developers can use this - # description to understand how to fix the failure. - # - # For example: "Terms of service not accepted". - class Violation - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Describes violations in a client request. This error type focuses on the - # syntactic aspects of the request. - # @!attribute [rw] field_violations - # @return [::Array<::Google::Rpc::BadRequest::FieldViolation>] - # Describes all violations in a client request. - class BadRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # A message type used to describe a single bad request field. - # @!attribute [rw] field - # @return [::String] - # A path that leads to a field in the request body. The value will be a - # sequence of dot-separated identifiers that identify a protocol buffer - # field. - # - # Consider the following: - # - # message CreateContactRequest { - # message EmailAddress { - # enum Type { - # TYPE_UNSPECIFIED = 0; - # HOME = 1; - # WORK = 2; - # } - # - # optional string email = 1; - # repeated EmailType type = 2; - # } - # - # string full_name = 1; - # repeated EmailAddress email_addresses = 2; - # } - # - # In this example, in proto `field` could take one of the following values: - # - # * `full_name` for a violation in the `full_name` value - # * `email_addresses[0].email` for a violation in the `email` field of the - # first `email_addresses` message - # * `email_addresses[2].type[1]` for a violation in the second `type` - # value in the third `email_addresses` message. - # - # In JSON, the same values are represented as: - # - # * `fullName` for a violation in the `fullName` value - # * `emailAddresses[0].email` for a violation in the `email` field of the - # first `emailAddresses` message - # * `emailAddresses[2].type[1]` for a violation in the second `type` - # value in the third `emailAddresses` message. - # @!attribute [rw] description - # @return [::String] - # A description of why the request element is bad. - # @!attribute [rw] reason - # @return [::String] - # The reason of the field-level error. This is a constant value that - # identifies the proximate cause of the field-level error. It should - # uniquely identify the type of the FieldViolation within the scope of the - # google.rpc.ErrorInfo.domain. This should be at most 63 - # characters and match a regular expression of `[A-Z][A-Z0-9_]+[A-Z0-9]`, - # which represents UPPER_SNAKE_CASE. - # @!attribute [rw] localized_message - # @return [::Google::Rpc::LocalizedMessage] - # Provides a localized error message for field-level errors that is safe to - # return to the API consumer. - class FieldViolation - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Contains metadata about the request that clients can attach when filing a bug - # or providing other forms of feedback. - # @!attribute [rw] request_id - # @return [::String] - # An opaque string that should only be interpreted by the service generating - # it. For example, it can be used to identify requests in the service's logs. - # @!attribute [rw] serving_data - # @return [::String] - # Any data that was used to serve this request. For example, an encrypted - # stack trace that can be sent back to the service provider for debugging. - class RequestInfo - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Describes the resource that is being accessed. - # @!attribute [rw] resource_type - # @return [::String] - # A name for the type of resource being accessed, e.g. "sql table", - # "cloud storage bucket", "file", "Google calendar"; or the type URL - # of the resource: e.g. "type.googleapis.com/google.pubsub.v1.Topic". - # @!attribute [rw] resource_name - # @return [::String] - # The name of the resource being accessed. For example, a shared calendar - # name: "example.com_4fghdhgsrgh@group.calendar.google.com", if the current - # error is - # [google.rpc.Code.PERMISSION_DENIED][google.rpc.Code.PERMISSION_DENIED]. - # @!attribute [rw] owner - # @return [::String] - # The owner of the resource (optional). - # For example, "user:" or "project:". - # @!attribute [rw] description - # @return [::String] - # Describes what error is encountered when accessing this resource. - # For example, updating a cloud project may require the `writer` permission - # on the developer console project. - class ResourceInfo - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Provides links to documentation or for performing an out of band action. - # - # For example, if a quota check failed with an error indicating the calling - # project hasn't enabled the accessed service, this can contain a URL pointing - # directly to the right place in the developer console to flip the bit. - # @!attribute [rw] links - # @return [::Array<::Google::Rpc::Help::Link>] - # URL(s) pointing to additional information on handling the current error. - class Help - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Describes a URL link. - # @!attribute [rw] description - # @return [::String] - # Describes what the link offers. - # @!attribute [rw] url - # @return [::String] - # The URL of the link. - class Link - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Provides a localized error message that is safe to return to the user - # which can be attached to an RPC error. - # @!attribute [rw] locale - # @return [::String] - # The locale used following the specification defined at - # https://www.rfc-editor.org/rfc/bcp/bcp47.txt. - # Examples are: "en-US", "fr-CH", "es-MX" - # @!attribute [rw] message - # @return [::String] - # The localized error message in the above locale. - class LocalizedMessage - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-vm_migration-v1/proto_docs/google/rpc/status.rb b/owl-bot-staging/google-cloud-vm_migration-v1/proto_docs/google/rpc/status.rb deleted file mode 100644 index c1a1c07eb2db..000000000000 --- a/owl-bot-staging/google-cloud-vm_migration-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-vm_migration-v1/proto_docs/google/type/expr.rb b/owl-bot-staging/google-cloud-vm_migration-v1/proto_docs/google/type/expr.rb deleted file mode 100644 index 53e7733b6592..000000000000 --- a/owl-bot-staging/google-cloud-vm_migration-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-vm_migration-v1/snippets/Gemfile b/owl-bot-staging/google-cloud-vm_migration-v1/snippets/Gemfile deleted file mode 100644 index 02cd5c2e3673..000000000000 --- a/owl-bot-staging/google-cloud-vm_migration-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-vm_migration-v1", path: "../" -else - gem "google-cloud-vm_migration-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-vm_migration-v1/snippets/iam_policy/get_iam_policy.rb b/owl-bot-staging/google-cloud-vm_migration-v1/snippets/iam_policy/get_iam_policy.rb deleted file mode 100644 index 3ebfe81dd14c..000000000000 --- a/owl-bot-staging/google-cloud-vm_migration-v1/snippets/iam_policy/get_iam_policy.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 vmmigration_v1_generated_IAMPolicy_GetIamPolicy_sync] -require "google/iam/v1" - -## -# Snippet for the get_iam_policy call in the IAMPolicy 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::Iam::V1::IAMPolicy::Client#get_iam_policy. -# -def get_iam_policy - # Create a client object. The client can be reused for multiple calls. - client = Google::Iam::V1::IAMPolicy::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Iam::V1::GetIamPolicyRequest.new - - # Call the get_iam_policy method. - result = client.get_iam_policy request - - # The returned object is of type Google::Iam::V1::Policy. - p result -end -# [END vmmigration_v1_generated_IAMPolicy_GetIamPolicy_sync] diff --git a/owl-bot-staging/google-cloud-vm_migration-v1/snippets/iam_policy/set_iam_policy.rb b/owl-bot-staging/google-cloud-vm_migration-v1/snippets/iam_policy/set_iam_policy.rb deleted file mode 100644 index eeeac89c8e95..000000000000 --- a/owl-bot-staging/google-cloud-vm_migration-v1/snippets/iam_policy/set_iam_policy.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 vmmigration_v1_generated_IAMPolicy_SetIamPolicy_sync] -require "google/iam/v1" - -## -# Snippet for the set_iam_policy call in the IAMPolicy 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::Iam::V1::IAMPolicy::Client#set_iam_policy. -# -def set_iam_policy - # Create a client object. The client can be reused for multiple calls. - client = Google::Iam::V1::IAMPolicy::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Iam::V1::SetIamPolicyRequest.new - - # Call the set_iam_policy method. - result = client.set_iam_policy request - - # The returned object is of type Google::Iam::V1::Policy. - p result -end -# [END vmmigration_v1_generated_IAMPolicy_SetIamPolicy_sync] diff --git a/owl-bot-staging/google-cloud-vm_migration-v1/snippets/iam_policy/test_iam_permissions.rb b/owl-bot-staging/google-cloud-vm_migration-v1/snippets/iam_policy/test_iam_permissions.rb deleted file mode 100644 index ef4eeafad7d0..000000000000 --- a/owl-bot-staging/google-cloud-vm_migration-v1/snippets/iam_policy/test_iam_permissions.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 vmmigration_v1_generated_IAMPolicy_TestIamPermissions_sync] -require "google/iam/v1" - -## -# Snippet for the test_iam_permissions call in the IAMPolicy 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::Iam::V1::IAMPolicy::Client#test_iam_permissions. -# -def test_iam_permissions - # Create a client object. The client can be reused for multiple calls. - client = Google::Iam::V1::IAMPolicy::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Iam::V1::TestIamPermissionsRequest.new - - # Call the test_iam_permissions method. - result = client.test_iam_permissions request - - # The returned object is of type Google::Iam::V1::TestIamPermissionsResponse. - p result -end -# [END vmmigration_v1_generated_IAMPolicy_TestIamPermissions_sync] diff --git a/owl-bot-staging/google-cloud-vm_migration-v1/snippets/snippet_metadata_google.cloud.vmmigration.v1.json b/owl-bot-staging/google-cloud-vm_migration-v1/snippets/snippet_metadata_google.cloud.vmmigration.v1.json deleted file mode 100644 index 8ccbb24bf2d8..000000000000 --- a/owl-bot-staging/google-cloud-vm_migration-v1/snippets/snippet_metadata_google.cloud.vmmigration.v1.json +++ /dev/null @@ -1,2495 +0,0 @@ -{ - "client_library": { - "name": "google-cloud-vm_migration-v1", - "version": "", - "language": "RUBY", - "apis": [ - { - "id": "google.cloud.vmmigration.v1", - "version": "v1" - } - ] - }, - "snippets": [ - { - "region_tag": "vmmigration_v1_generated_VMMigration_ListSources_sync", - "title": "Snippet for the list_sources call in the VMMigration service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VMMigration::V1::VMMigration::Client#list_sources.", - "file": "vm_migration/list_sources.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_sources", - "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client#list_sources", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VMMigration::V1::ListSourcesRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::VMMigration::V1::ListSourcesResponse", - "client": { - "short_name": "VMMigration::Client", - "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client" - }, - "method": { - "short_name": "ListSources", - "full_name": "google.cloud.vmmigration.v1.VmMigration.ListSources", - "service": { - "short_name": "VmMigration", - "full_name": "google.cloud.vmmigration.v1.VmMigration" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "vmmigration_v1_generated_VMMigration_GetSource_sync", - "title": "Snippet for the get_source call in the VMMigration service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VMMigration::V1::VMMigration::Client#get_source.", - "file": "vm_migration/get_source.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_source", - "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client#get_source", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VMMigration::V1::GetSourceRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::VMMigration::V1::Source", - "client": { - "short_name": "VMMigration::Client", - "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client" - }, - "method": { - "short_name": "GetSource", - "full_name": "google.cloud.vmmigration.v1.VmMigration.GetSource", - "service": { - "short_name": "VmMigration", - "full_name": "google.cloud.vmmigration.v1.VmMigration" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "vmmigration_v1_generated_VMMigration_CreateSource_sync", - "title": "Snippet for the create_source call in the VMMigration service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VMMigration::V1::VMMigration::Client#create_source.", - "file": "vm_migration/create_source.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_source", - "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client#create_source", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VMMigration::V1::CreateSourceRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "VMMigration::Client", - "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client" - }, - "method": { - "short_name": "CreateSource", - "full_name": "google.cloud.vmmigration.v1.VmMigration.CreateSource", - "service": { - "short_name": "VmMigration", - "full_name": "google.cloud.vmmigration.v1.VmMigration" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "vmmigration_v1_generated_VMMigration_UpdateSource_sync", - "title": "Snippet for the update_source call in the VMMigration service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VMMigration::V1::VMMigration::Client#update_source.", - "file": "vm_migration/update_source.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_source", - "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client#update_source", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VMMigration::V1::UpdateSourceRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "VMMigration::Client", - "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client" - }, - "method": { - "short_name": "UpdateSource", - "full_name": "google.cloud.vmmigration.v1.VmMigration.UpdateSource", - "service": { - "short_name": "VmMigration", - "full_name": "google.cloud.vmmigration.v1.VmMigration" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "vmmigration_v1_generated_VMMigration_DeleteSource_sync", - "title": "Snippet for the delete_source call in the VMMigration service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VMMigration::V1::VMMigration::Client#delete_source.", - "file": "vm_migration/delete_source.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_source", - "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client#delete_source", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VMMigration::V1::DeleteSourceRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "VMMigration::Client", - "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client" - }, - "method": { - "short_name": "DeleteSource", - "full_name": "google.cloud.vmmigration.v1.VmMigration.DeleteSource", - "service": { - "short_name": "VmMigration", - "full_name": "google.cloud.vmmigration.v1.VmMigration" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "vmmigration_v1_generated_VMMigration_FetchInventory_sync", - "title": "Snippet for the fetch_inventory call in the VMMigration service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VMMigration::V1::VMMigration::Client#fetch_inventory.", - "file": "vm_migration/fetch_inventory.rb", - "language": "RUBY", - "client_method": { - "short_name": "fetch_inventory", - "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client#fetch_inventory", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VMMigration::V1::FetchInventoryRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::VMMigration::V1::FetchInventoryResponse", - "client": { - "short_name": "VMMigration::Client", - "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client" - }, - "method": { - "short_name": "FetchInventory", - "full_name": "google.cloud.vmmigration.v1.VmMigration.FetchInventory", - "service": { - "short_name": "VmMigration", - "full_name": "google.cloud.vmmigration.v1.VmMigration" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "vmmigration_v1_generated_VMMigration_FetchStorageInventory_sync", - "title": "Snippet for the fetch_storage_inventory call in the VMMigration service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VMMigration::V1::VMMigration::Client#fetch_storage_inventory.", - "file": "vm_migration/fetch_storage_inventory.rb", - "language": "RUBY", - "client_method": { - "short_name": "fetch_storage_inventory", - "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client#fetch_storage_inventory", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VMMigration::V1::FetchStorageInventoryRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::VMMigration::V1::FetchStorageInventoryResponse", - "client": { - "short_name": "VMMigration::Client", - "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client" - }, - "method": { - "short_name": "FetchStorageInventory", - "full_name": "google.cloud.vmmigration.v1.VmMigration.FetchStorageInventory", - "service": { - "short_name": "VmMigration", - "full_name": "google.cloud.vmmigration.v1.VmMigration" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "vmmigration_v1_generated_VMMigration_ListUtilizationReports_sync", - "title": "Snippet for the list_utilization_reports call in the VMMigration service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VMMigration::V1::VMMigration::Client#list_utilization_reports.", - "file": "vm_migration/list_utilization_reports.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_utilization_reports", - "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client#list_utilization_reports", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VMMigration::V1::ListUtilizationReportsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::VMMigration::V1::ListUtilizationReportsResponse", - "client": { - "short_name": "VMMigration::Client", - "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client" - }, - "method": { - "short_name": "ListUtilizationReports", - "full_name": "google.cloud.vmmigration.v1.VmMigration.ListUtilizationReports", - "service": { - "short_name": "VmMigration", - "full_name": "google.cloud.vmmigration.v1.VmMigration" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "vmmigration_v1_generated_VMMigration_GetUtilizationReport_sync", - "title": "Snippet for the get_utilization_report call in the VMMigration service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VMMigration::V1::VMMigration::Client#get_utilization_report.", - "file": "vm_migration/get_utilization_report.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_utilization_report", - "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client#get_utilization_report", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VMMigration::V1::GetUtilizationReportRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::VMMigration::V1::UtilizationReport", - "client": { - "short_name": "VMMigration::Client", - "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client" - }, - "method": { - "short_name": "GetUtilizationReport", - "full_name": "google.cloud.vmmigration.v1.VmMigration.GetUtilizationReport", - "service": { - "short_name": "VmMigration", - "full_name": "google.cloud.vmmigration.v1.VmMigration" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "vmmigration_v1_generated_VMMigration_CreateUtilizationReport_sync", - "title": "Snippet for the create_utilization_report call in the VMMigration service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VMMigration::V1::VMMigration::Client#create_utilization_report.", - "file": "vm_migration/create_utilization_report.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_utilization_report", - "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client#create_utilization_report", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VMMigration::V1::CreateUtilizationReportRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "VMMigration::Client", - "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client" - }, - "method": { - "short_name": "CreateUtilizationReport", - "full_name": "google.cloud.vmmigration.v1.VmMigration.CreateUtilizationReport", - "service": { - "short_name": "VmMigration", - "full_name": "google.cloud.vmmigration.v1.VmMigration" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "vmmigration_v1_generated_VMMigration_DeleteUtilizationReport_sync", - "title": "Snippet for the delete_utilization_report call in the VMMigration service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VMMigration::V1::VMMigration::Client#delete_utilization_report.", - "file": "vm_migration/delete_utilization_report.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_utilization_report", - "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client#delete_utilization_report", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VMMigration::V1::DeleteUtilizationReportRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "VMMigration::Client", - "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client" - }, - "method": { - "short_name": "DeleteUtilizationReport", - "full_name": "google.cloud.vmmigration.v1.VmMigration.DeleteUtilizationReport", - "service": { - "short_name": "VmMigration", - "full_name": "google.cloud.vmmigration.v1.VmMigration" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "vmmigration_v1_generated_VMMigration_ListDatacenterConnectors_sync", - "title": "Snippet for the list_datacenter_connectors call in the VMMigration service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VMMigration::V1::VMMigration::Client#list_datacenter_connectors.", - "file": "vm_migration/list_datacenter_connectors.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_datacenter_connectors", - "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client#list_datacenter_connectors", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VMMigration::V1::ListDatacenterConnectorsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::VMMigration::V1::ListDatacenterConnectorsResponse", - "client": { - "short_name": "VMMigration::Client", - "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client" - }, - "method": { - "short_name": "ListDatacenterConnectors", - "full_name": "google.cloud.vmmigration.v1.VmMigration.ListDatacenterConnectors", - "service": { - "short_name": "VmMigration", - "full_name": "google.cloud.vmmigration.v1.VmMigration" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "vmmigration_v1_generated_VMMigration_GetDatacenterConnector_sync", - "title": "Snippet for the get_datacenter_connector call in the VMMigration service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VMMigration::V1::VMMigration::Client#get_datacenter_connector.", - "file": "vm_migration/get_datacenter_connector.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_datacenter_connector", - "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client#get_datacenter_connector", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VMMigration::V1::GetDatacenterConnectorRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::VMMigration::V1::DatacenterConnector", - "client": { - "short_name": "VMMigration::Client", - "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client" - }, - "method": { - "short_name": "GetDatacenterConnector", - "full_name": "google.cloud.vmmigration.v1.VmMigration.GetDatacenterConnector", - "service": { - "short_name": "VmMigration", - "full_name": "google.cloud.vmmigration.v1.VmMigration" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "vmmigration_v1_generated_VMMigration_CreateDatacenterConnector_sync", - "title": "Snippet for the create_datacenter_connector call in the VMMigration service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VMMigration::V1::VMMigration::Client#create_datacenter_connector.", - "file": "vm_migration/create_datacenter_connector.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_datacenter_connector", - "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client#create_datacenter_connector", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VMMigration::V1::CreateDatacenterConnectorRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "VMMigration::Client", - "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client" - }, - "method": { - "short_name": "CreateDatacenterConnector", - "full_name": "google.cloud.vmmigration.v1.VmMigration.CreateDatacenterConnector", - "service": { - "short_name": "VmMigration", - "full_name": "google.cloud.vmmigration.v1.VmMigration" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "vmmigration_v1_generated_VMMigration_DeleteDatacenterConnector_sync", - "title": "Snippet for the delete_datacenter_connector call in the VMMigration service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VMMigration::V1::VMMigration::Client#delete_datacenter_connector.", - "file": "vm_migration/delete_datacenter_connector.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_datacenter_connector", - "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client#delete_datacenter_connector", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VMMigration::V1::DeleteDatacenterConnectorRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "VMMigration::Client", - "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client" - }, - "method": { - "short_name": "DeleteDatacenterConnector", - "full_name": "google.cloud.vmmigration.v1.VmMigration.DeleteDatacenterConnector", - "service": { - "short_name": "VmMigration", - "full_name": "google.cloud.vmmigration.v1.VmMigration" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "vmmigration_v1_generated_VMMigration_UpgradeAppliance_sync", - "title": "Snippet for the upgrade_appliance call in the VMMigration service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VMMigration::V1::VMMigration::Client#upgrade_appliance.", - "file": "vm_migration/upgrade_appliance.rb", - "language": "RUBY", - "client_method": { - "short_name": "upgrade_appliance", - "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client#upgrade_appliance", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VMMigration::V1::UpgradeApplianceRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "VMMigration::Client", - "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client" - }, - "method": { - "short_name": "UpgradeAppliance", - "full_name": "google.cloud.vmmigration.v1.VmMigration.UpgradeAppliance", - "service": { - "short_name": "VmMigration", - "full_name": "google.cloud.vmmigration.v1.VmMigration" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "vmmigration_v1_generated_VMMigration_CreateMigratingVm_sync", - "title": "Snippet for the create_migrating_vm call in the VMMigration service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VMMigration::V1::VMMigration::Client#create_migrating_vm.", - "file": "vm_migration/create_migrating_vm.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_migrating_vm", - "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client#create_migrating_vm", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VMMigration::V1::CreateMigratingVmRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "VMMigration::Client", - "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client" - }, - "method": { - "short_name": "CreateMigratingVm", - "full_name": "google.cloud.vmmigration.v1.VmMigration.CreateMigratingVm", - "service": { - "short_name": "VmMigration", - "full_name": "google.cloud.vmmigration.v1.VmMigration" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "vmmigration_v1_generated_VMMigration_ListMigratingVms_sync", - "title": "Snippet for the list_migrating_vms call in the VMMigration service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VMMigration::V1::VMMigration::Client#list_migrating_vms.", - "file": "vm_migration/list_migrating_vms.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_migrating_vms", - "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client#list_migrating_vms", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VMMigration::V1::ListMigratingVmsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::VMMigration::V1::ListMigratingVmsResponse", - "client": { - "short_name": "VMMigration::Client", - "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client" - }, - "method": { - "short_name": "ListMigratingVms", - "full_name": "google.cloud.vmmigration.v1.VmMigration.ListMigratingVms", - "service": { - "short_name": "VmMigration", - "full_name": "google.cloud.vmmigration.v1.VmMigration" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "vmmigration_v1_generated_VMMigration_GetMigratingVm_sync", - "title": "Snippet for the get_migrating_vm call in the VMMigration service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VMMigration::V1::VMMigration::Client#get_migrating_vm.", - "file": "vm_migration/get_migrating_vm.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_migrating_vm", - "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client#get_migrating_vm", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VMMigration::V1::GetMigratingVmRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::VMMigration::V1::MigratingVm", - "client": { - "short_name": "VMMigration::Client", - "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client" - }, - "method": { - "short_name": "GetMigratingVm", - "full_name": "google.cloud.vmmigration.v1.VmMigration.GetMigratingVm", - "service": { - "short_name": "VmMigration", - "full_name": "google.cloud.vmmigration.v1.VmMigration" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "vmmigration_v1_generated_VMMigration_UpdateMigratingVm_sync", - "title": "Snippet for the update_migrating_vm call in the VMMigration service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VMMigration::V1::VMMigration::Client#update_migrating_vm.", - "file": "vm_migration/update_migrating_vm.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_migrating_vm", - "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client#update_migrating_vm", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VMMigration::V1::UpdateMigratingVmRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "VMMigration::Client", - "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client" - }, - "method": { - "short_name": "UpdateMigratingVm", - "full_name": "google.cloud.vmmigration.v1.VmMigration.UpdateMigratingVm", - "service": { - "short_name": "VmMigration", - "full_name": "google.cloud.vmmigration.v1.VmMigration" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "vmmigration_v1_generated_VMMigration_DeleteMigratingVm_sync", - "title": "Snippet for the delete_migrating_vm call in the VMMigration service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VMMigration::V1::VMMigration::Client#delete_migrating_vm.", - "file": "vm_migration/delete_migrating_vm.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_migrating_vm", - "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client#delete_migrating_vm", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VMMigration::V1::DeleteMigratingVmRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "VMMigration::Client", - "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client" - }, - "method": { - "short_name": "DeleteMigratingVm", - "full_name": "google.cloud.vmmigration.v1.VmMigration.DeleteMigratingVm", - "service": { - "short_name": "VmMigration", - "full_name": "google.cloud.vmmigration.v1.VmMigration" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "vmmigration_v1_generated_VMMigration_StartMigration_sync", - "title": "Snippet for the start_migration call in the VMMigration service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VMMigration::V1::VMMigration::Client#start_migration.", - "file": "vm_migration/start_migration.rb", - "language": "RUBY", - "client_method": { - "short_name": "start_migration", - "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client#start_migration", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VMMigration::V1::StartMigrationRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "VMMigration::Client", - "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client" - }, - "method": { - "short_name": "StartMigration", - "full_name": "google.cloud.vmmigration.v1.VmMigration.StartMigration", - "service": { - "short_name": "VmMigration", - "full_name": "google.cloud.vmmigration.v1.VmMigration" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "vmmigration_v1_generated_VMMigration_ResumeMigration_sync", - "title": "Snippet for the resume_migration call in the VMMigration service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VMMigration::V1::VMMigration::Client#resume_migration.", - "file": "vm_migration/resume_migration.rb", - "language": "RUBY", - "client_method": { - "short_name": "resume_migration", - "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client#resume_migration", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VMMigration::V1::ResumeMigrationRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "VMMigration::Client", - "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client" - }, - "method": { - "short_name": "ResumeMigration", - "full_name": "google.cloud.vmmigration.v1.VmMigration.ResumeMigration", - "service": { - "short_name": "VmMigration", - "full_name": "google.cloud.vmmigration.v1.VmMigration" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "vmmigration_v1_generated_VMMigration_PauseMigration_sync", - "title": "Snippet for the pause_migration call in the VMMigration service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VMMigration::V1::VMMigration::Client#pause_migration.", - "file": "vm_migration/pause_migration.rb", - "language": "RUBY", - "client_method": { - "short_name": "pause_migration", - "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client#pause_migration", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VMMigration::V1::PauseMigrationRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "VMMigration::Client", - "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client" - }, - "method": { - "short_name": "PauseMigration", - "full_name": "google.cloud.vmmigration.v1.VmMigration.PauseMigration", - "service": { - "short_name": "VmMigration", - "full_name": "google.cloud.vmmigration.v1.VmMigration" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "vmmigration_v1_generated_VMMigration_FinalizeMigration_sync", - "title": "Snippet for the finalize_migration call in the VMMigration service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VMMigration::V1::VMMigration::Client#finalize_migration.", - "file": "vm_migration/finalize_migration.rb", - "language": "RUBY", - "client_method": { - "short_name": "finalize_migration", - "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client#finalize_migration", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VMMigration::V1::FinalizeMigrationRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "VMMigration::Client", - "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client" - }, - "method": { - "short_name": "FinalizeMigration", - "full_name": "google.cloud.vmmigration.v1.VmMigration.FinalizeMigration", - "service": { - "short_name": "VmMigration", - "full_name": "google.cloud.vmmigration.v1.VmMigration" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "vmmigration_v1_generated_VMMigration_ExtendMigration_sync", - "title": "Snippet for the extend_migration call in the VMMigration service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VMMigration::V1::VMMigration::Client#extend_migration.", - "file": "vm_migration/extend_migration.rb", - "language": "RUBY", - "client_method": { - "short_name": "extend_migration", - "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client#extend_migration", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VMMigration::V1::ExtendMigrationRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "VMMigration::Client", - "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client" - }, - "method": { - "short_name": "ExtendMigration", - "full_name": "google.cloud.vmmigration.v1.VmMigration.ExtendMigration", - "service": { - "short_name": "VmMigration", - "full_name": "google.cloud.vmmigration.v1.VmMigration" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "vmmigration_v1_generated_VMMigration_CreateCloneJob_sync", - "title": "Snippet for the create_clone_job call in the VMMigration service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VMMigration::V1::VMMigration::Client#create_clone_job.", - "file": "vm_migration/create_clone_job.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_clone_job", - "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client#create_clone_job", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VMMigration::V1::CreateCloneJobRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "VMMigration::Client", - "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client" - }, - "method": { - "short_name": "CreateCloneJob", - "full_name": "google.cloud.vmmigration.v1.VmMigration.CreateCloneJob", - "service": { - "short_name": "VmMigration", - "full_name": "google.cloud.vmmigration.v1.VmMigration" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "vmmigration_v1_generated_VMMigration_CancelCloneJob_sync", - "title": "Snippet for the cancel_clone_job call in the VMMigration service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VMMigration::V1::VMMigration::Client#cancel_clone_job.", - "file": "vm_migration/cancel_clone_job.rb", - "language": "RUBY", - "client_method": { - "short_name": "cancel_clone_job", - "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client#cancel_clone_job", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VMMigration::V1::CancelCloneJobRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "VMMigration::Client", - "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client" - }, - "method": { - "short_name": "CancelCloneJob", - "full_name": "google.cloud.vmmigration.v1.VmMigration.CancelCloneJob", - "service": { - "short_name": "VmMigration", - "full_name": "google.cloud.vmmigration.v1.VmMigration" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "vmmigration_v1_generated_VMMigration_ListCloneJobs_sync", - "title": "Snippet for the list_clone_jobs call in the VMMigration service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VMMigration::V1::VMMigration::Client#list_clone_jobs.", - "file": "vm_migration/list_clone_jobs.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_clone_jobs", - "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client#list_clone_jobs", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VMMigration::V1::ListCloneJobsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::VMMigration::V1::ListCloneJobsResponse", - "client": { - "short_name": "VMMigration::Client", - "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client" - }, - "method": { - "short_name": "ListCloneJobs", - "full_name": "google.cloud.vmmigration.v1.VmMigration.ListCloneJobs", - "service": { - "short_name": "VmMigration", - "full_name": "google.cloud.vmmigration.v1.VmMigration" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "vmmigration_v1_generated_VMMigration_GetCloneJob_sync", - "title": "Snippet for the get_clone_job call in the VMMigration service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VMMigration::V1::VMMigration::Client#get_clone_job.", - "file": "vm_migration/get_clone_job.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_clone_job", - "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client#get_clone_job", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VMMigration::V1::GetCloneJobRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::VMMigration::V1::CloneJob", - "client": { - "short_name": "VMMigration::Client", - "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client" - }, - "method": { - "short_name": "GetCloneJob", - "full_name": "google.cloud.vmmigration.v1.VmMigration.GetCloneJob", - "service": { - "short_name": "VmMigration", - "full_name": "google.cloud.vmmigration.v1.VmMigration" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "vmmigration_v1_generated_VMMigration_CreateCutoverJob_sync", - "title": "Snippet for the create_cutover_job call in the VMMigration service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VMMigration::V1::VMMigration::Client#create_cutover_job.", - "file": "vm_migration/create_cutover_job.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_cutover_job", - "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client#create_cutover_job", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VMMigration::V1::CreateCutoverJobRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "VMMigration::Client", - "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client" - }, - "method": { - "short_name": "CreateCutoverJob", - "full_name": "google.cloud.vmmigration.v1.VmMigration.CreateCutoverJob", - "service": { - "short_name": "VmMigration", - "full_name": "google.cloud.vmmigration.v1.VmMigration" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "vmmigration_v1_generated_VMMigration_CancelCutoverJob_sync", - "title": "Snippet for the cancel_cutover_job call in the VMMigration service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VMMigration::V1::VMMigration::Client#cancel_cutover_job.", - "file": "vm_migration/cancel_cutover_job.rb", - "language": "RUBY", - "client_method": { - "short_name": "cancel_cutover_job", - "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client#cancel_cutover_job", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VMMigration::V1::CancelCutoverJobRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "VMMigration::Client", - "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client" - }, - "method": { - "short_name": "CancelCutoverJob", - "full_name": "google.cloud.vmmigration.v1.VmMigration.CancelCutoverJob", - "service": { - "short_name": "VmMigration", - "full_name": "google.cloud.vmmigration.v1.VmMigration" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "vmmigration_v1_generated_VMMigration_ListCutoverJobs_sync", - "title": "Snippet for the list_cutover_jobs call in the VMMigration service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VMMigration::V1::VMMigration::Client#list_cutover_jobs.", - "file": "vm_migration/list_cutover_jobs.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_cutover_jobs", - "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client#list_cutover_jobs", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VMMigration::V1::ListCutoverJobsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::VMMigration::V1::ListCutoverJobsResponse", - "client": { - "short_name": "VMMigration::Client", - "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client" - }, - "method": { - "short_name": "ListCutoverJobs", - "full_name": "google.cloud.vmmigration.v1.VmMigration.ListCutoverJobs", - "service": { - "short_name": "VmMigration", - "full_name": "google.cloud.vmmigration.v1.VmMigration" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "vmmigration_v1_generated_VMMigration_GetCutoverJob_sync", - "title": "Snippet for the get_cutover_job call in the VMMigration service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VMMigration::V1::VMMigration::Client#get_cutover_job.", - "file": "vm_migration/get_cutover_job.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_cutover_job", - "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client#get_cutover_job", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VMMigration::V1::GetCutoverJobRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::VMMigration::V1::CutoverJob", - "client": { - "short_name": "VMMigration::Client", - "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client" - }, - "method": { - "short_name": "GetCutoverJob", - "full_name": "google.cloud.vmmigration.v1.VmMigration.GetCutoverJob", - "service": { - "short_name": "VmMigration", - "full_name": "google.cloud.vmmigration.v1.VmMigration" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "vmmigration_v1_generated_VMMigration_ListGroups_sync", - "title": "Snippet for the list_groups call in the VMMigration service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VMMigration::V1::VMMigration::Client#list_groups.", - "file": "vm_migration/list_groups.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_groups", - "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client#list_groups", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VMMigration::V1::ListGroupsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::VMMigration::V1::ListGroupsResponse", - "client": { - "short_name": "VMMigration::Client", - "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client" - }, - "method": { - "short_name": "ListGroups", - "full_name": "google.cloud.vmmigration.v1.VmMigration.ListGroups", - "service": { - "short_name": "VmMigration", - "full_name": "google.cloud.vmmigration.v1.VmMigration" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "vmmigration_v1_generated_VMMigration_GetGroup_sync", - "title": "Snippet for the get_group call in the VMMigration service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VMMigration::V1::VMMigration::Client#get_group.", - "file": "vm_migration/get_group.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_group", - "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client#get_group", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VMMigration::V1::GetGroupRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::VMMigration::V1::Group", - "client": { - "short_name": "VMMigration::Client", - "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client" - }, - "method": { - "short_name": "GetGroup", - "full_name": "google.cloud.vmmigration.v1.VmMigration.GetGroup", - "service": { - "short_name": "VmMigration", - "full_name": "google.cloud.vmmigration.v1.VmMigration" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "vmmigration_v1_generated_VMMigration_CreateGroup_sync", - "title": "Snippet for the create_group call in the VMMigration service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VMMigration::V1::VMMigration::Client#create_group.", - "file": "vm_migration/create_group.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_group", - "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client#create_group", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VMMigration::V1::CreateGroupRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "VMMigration::Client", - "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client" - }, - "method": { - "short_name": "CreateGroup", - "full_name": "google.cloud.vmmigration.v1.VmMigration.CreateGroup", - "service": { - "short_name": "VmMigration", - "full_name": "google.cloud.vmmigration.v1.VmMigration" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "vmmigration_v1_generated_VMMigration_UpdateGroup_sync", - "title": "Snippet for the update_group call in the VMMigration service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VMMigration::V1::VMMigration::Client#update_group.", - "file": "vm_migration/update_group.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_group", - "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client#update_group", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VMMigration::V1::UpdateGroupRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "VMMigration::Client", - "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client" - }, - "method": { - "short_name": "UpdateGroup", - "full_name": "google.cloud.vmmigration.v1.VmMigration.UpdateGroup", - "service": { - "short_name": "VmMigration", - "full_name": "google.cloud.vmmigration.v1.VmMigration" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "vmmigration_v1_generated_VMMigration_DeleteGroup_sync", - "title": "Snippet for the delete_group call in the VMMigration service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VMMigration::V1::VMMigration::Client#delete_group.", - "file": "vm_migration/delete_group.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_group", - "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client#delete_group", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VMMigration::V1::DeleteGroupRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "VMMigration::Client", - "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client" - }, - "method": { - "short_name": "DeleteGroup", - "full_name": "google.cloud.vmmigration.v1.VmMigration.DeleteGroup", - "service": { - "short_name": "VmMigration", - "full_name": "google.cloud.vmmigration.v1.VmMigration" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "vmmigration_v1_generated_VMMigration_AddGroupMigration_sync", - "title": "Snippet for the add_group_migration call in the VMMigration service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VMMigration::V1::VMMigration::Client#add_group_migration.", - "file": "vm_migration/add_group_migration.rb", - "language": "RUBY", - "client_method": { - "short_name": "add_group_migration", - "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client#add_group_migration", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VMMigration::V1::AddGroupMigrationRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "VMMigration::Client", - "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client" - }, - "method": { - "short_name": "AddGroupMigration", - "full_name": "google.cloud.vmmigration.v1.VmMigration.AddGroupMigration", - "service": { - "short_name": "VmMigration", - "full_name": "google.cloud.vmmigration.v1.VmMigration" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "vmmigration_v1_generated_VMMigration_RemoveGroupMigration_sync", - "title": "Snippet for the remove_group_migration call in the VMMigration service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VMMigration::V1::VMMigration::Client#remove_group_migration.", - "file": "vm_migration/remove_group_migration.rb", - "language": "RUBY", - "client_method": { - "short_name": "remove_group_migration", - "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client#remove_group_migration", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VMMigration::V1::RemoveGroupMigrationRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "VMMigration::Client", - "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client" - }, - "method": { - "short_name": "RemoveGroupMigration", - "full_name": "google.cloud.vmmigration.v1.VmMigration.RemoveGroupMigration", - "service": { - "short_name": "VmMigration", - "full_name": "google.cloud.vmmigration.v1.VmMigration" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "vmmigration_v1_generated_VMMigration_ListTargetProjects_sync", - "title": "Snippet for the list_target_projects call in the VMMigration service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VMMigration::V1::VMMigration::Client#list_target_projects.", - "file": "vm_migration/list_target_projects.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_target_projects", - "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client#list_target_projects", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VMMigration::V1::ListTargetProjectsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::VMMigration::V1::ListTargetProjectsResponse", - "client": { - "short_name": "VMMigration::Client", - "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client" - }, - "method": { - "short_name": "ListTargetProjects", - "full_name": "google.cloud.vmmigration.v1.VmMigration.ListTargetProjects", - "service": { - "short_name": "VmMigration", - "full_name": "google.cloud.vmmigration.v1.VmMigration" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "vmmigration_v1_generated_VMMigration_GetTargetProject_sync", - "title": "Snippet for the get_target_project call in the VMMigration service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VMMigration::V1::VMMigration::Client#get_target_project.", - "file": "vm_migration/get_target_project.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_target_project", - "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client#get_target_project", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VMMigration::V1::GetTargetProjectRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::VMMigration::V1::TargetProject", - "client": { - "short_name": "VMMigration::Client", - "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client" - }, - "method": { - "short_name": "GetTargetProject", - "full_name": "google.cloud.vmmigration.v1.VmMigration.GetTargetProject", - "service": { - "short_name": "VmMigration", - "full_name": "google.cloud.vmmigration.v1.VmMigration" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "vmmigration_v1_generated_VMMigration_CreateTargetProject_sync", - "title": "Snippet for the create_target_project call in the VMMigration service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VMMigration::V1::VMMigration::Client#create_target_project.", - "file": "vm_migration/create_target_project.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_target_project", - "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client#create_target_project", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VMMigration::V1::CreateTargetProjectRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "VMMigration::Client", - "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client" - }, - "method": { - "short_name": "CreateTargetProject", - "full_name": "google.cloud.vmmigration.v1.VmMigration.CreateTargetProject", - "service": { - "short_name": "VmMigration", - "full_name": "google.cloud.vmmigration.v1.VmMigration" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "vmmigration_v1_generated_VMMigration_UpdateTargetProject_sync", - "title": "Snippet for the update_target_project call in the VMMigration service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VMMigration::V1::VMMigration::Client#update_target_project.", - "file": "vm_migration/update_target_project.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_target_project", - "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client#update_target_project", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VMMigration::V1::UpdateTargetProjectRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "VMMigration::Client", - "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client" - }, - "method": { - "short_name": "UpdateTargetProject", - "full_name": "google.cloud.vmmigration.v1.VmMigration.UpdateTargetProject", - "service": { - "short_name": "VmMigration", - "full_name": "google.cloud.vmmigration.v1.VmMigration" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "vmmigration_v1_generated_VMMigration_DeleteTargetProject_sync", - "title": "Snippet for the delete_target_project call in the VMMigration service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VMMigration::V1::VMMigration::Client#delete_target_project.", - "file": "vm_migration/delete_target_project.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_target_project", - "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client#delete_target_project", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VMMigration::V1::DeleteTargetProjectRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "VMMigration::Client", - "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client" - }, - "method": { - "short_name": "DeleteTargetProject", - "full_name": "google.cloud.vmmigration.v1.VmMigration.DeleteTargetProject", - "service": { - "short_name": "VmMigration", - "full_name": "google.cloud.vmmigration.v1.VmMigration" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "vmmigration_v1_generated_VMMigration_ListReplicationCycles_sync", - "title": "Snippet for the list_replication_cycles call in the VMMigration service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VMMigration::V1::VMMigration::Client#list_replication_cycles.", - "file": "vm_migration/list_replication_cycles.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_replication_cycles", - "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client#list_replication_cycles", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VMMigration::V1::ListReplicationCyclesRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::VMMigration::V1::ListReplicationCyclesResponse", - "client": { - "short_name": "VMMigration::Client", - "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client" - }, - "method": { - "short_name": "ListReplicationCycles", - "full_name": "google.cloud.vmmigration.v1.VmMigration.ListReplicationCycles", - "service": { - "short_name": "VmMigration", - "full_name": "google.cloud.vmmigration.v1.VmMigration" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "vmmigration_v1_generated_VMMigration_GetReplicationCycle_sync", - "title": "Snippet for the get_replication_cycle call in the VMMigration service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VMMigration::V1::VMMigration::Client#get_replication_cycle.", - "file": "vm_migration/get_replication_cycle.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_replication_cycle", - "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client#get_replication_cycle", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VMMigration::V1::GetReplicationCycleRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::VMMigration::V1::ReplicationCycle", - "client": { - "short_name": "VMMigration::Client", - "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client" - }, - "method": { - "short_name": "GetReplicationCycle", - "full_name": "google.cloud.vmmigration.v1.VmMigration.GetReplicationCycle", - "service": { - "short_name": "VmMigration", - "full_name": "google.cloud.vmmigration.v1.VmMigration" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "vmmigration_v1_generated_VMMigration_ListImageImports_sync", - "title": "Snippet for the list_image_imports call in the VMMigration service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VMMigration::V1::VMMigration::Client#list_image_imports.", - "file": "vm_migration/list_image_imports.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_image_imports", - "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client#list_image_imports", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VMMigration::V1::ListImageImportsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::VMMigration::V1::ListImageImportsResponse", - "client": { - "short_name": "VMMigration::Client", - "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client" - }, - "method": { - "short_name": "ListImageImports", - "full_name": "google.cloud.vmmigration.v1.VmMigration.ListImageImports", - "service": { - "short_name": "VmMigration", - "full_name": "google.cloud.vmmigration.v1.VmMigration" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "vmmigration_v1_generated_VMMigration_GetImageImport_sync", - "title": "Snippet for the get_image_import call in the VMMigration service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VMMigration::V1::VMMigration::Client#get_image_import.", - "file": "vm_migration/get_image_import.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_image_import", - "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client#get_image_import", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VMMigration::V1::GetImageImportRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::VMMigration::V1::ImageImport", - "client": { - "short_name": "VMMigration::Client", - "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client" - }, - "method": { - "short_name": "GetImageImport", - "full_name": "google.cloud.vmmigration.v1.VmMigration.GetImageImport", - "service": { - "short_name": "VmMigration", - "full_name": "google.cloud.vmmigration.v1.VmMigration" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "vmmigration_v1_generated_VMMigration_CreateImageImport_sync", - "title": "Snippet for the create_image_import call in the VMMigration service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VMMigration::V1::VMMigration::Client#create_image_import.", - "file": "vm_migration/create_image_import.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_image_import", - "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client#create_image_import", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VMMigration::V1::CreateImageImportRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "VMMigration::Client", - "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client" - }, - "method": { - "short_name": "CreateImageImport", - "full_name": "google.cloud.vmmigration.v1.VmMigration.CreateImageImport", - "service": { - "short_name": "VmMigration", - "full_name": "google.cloud.vmmigration.v1.VmMigration" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "vmmigration_v1_generated_VMMigration_DeleteImageImport_sync", - "title": "Snippet for the delete_image_import call in the VMMigration service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VMMigration::V1::VMMigration::Client#delete_image_import.", - "file": "vm_migration/delete_image_import.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_image_import", - "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client#delete_image_import", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VMMigration::V1::DeleteImageImportRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "VMMigration::Client", - "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client" - }, - "method": { - "short_name": "DeleteImageImport", - "full_name": "google.cloud.vmmigration.v1.VmMigration.DeleteImageImport", - "service": { - "short_name": "VmMigration", - "full_name": "google.cloud.vmmigration.v1.VmMigration" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "vmmigration_v1_generated_VMMigration_ListImageImportJobs_sync", - "title": "Snippet for the list_image_import_jobs call in the VMMigration service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VMMigration::V1::VMMigration::Client#list_image_import_jobs.", - "file": "vm_migration/list_image_import_jobs.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_image_import_jobs", - "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client#list_image_import_jobs", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VMMigration::V1::ListImageImportJobsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::VMMigration::V1::ListImageImportJobsResponse", - "client": { - "short_name": "VMMigration::Client", - "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client" - }, - "method": { - "short_name": "ListImageImportJobs", - "full_name": "google.cloud.vmmigration.v1.VmMigration.ListImageImportJobs", - "service": { - "short_name": "VmMigration", - "full_name": "google.cloud.vmmigration.v1.VmMigration" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "vmmigration_v1_generated_VMMigration_GetImageImportJob_sync", - "title": "Snippet for the get_image_import_job call in the VMMigration service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VMMigration::V1::VMMigration::Client#get_image_import_job.", - "file": "vm_migration/get_image_import_job.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_image_import_job", - "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client#get_image_import_job", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VMMigration::V1::GetImageImportJobRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::VMMigration::V1::ImageImportJob", - "client": { - "short_name": "VMMigration::Client", - "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client" - }, - "method": { - "short_name": "GetImageImportJob", - "full_name": "google.cloud.vmmigration.v1.VmMigration.GetImageImportJob", - "service": { - "short_name": "VmMigration", - "full_name": "google.cloud.vmmigration.v1.VmMigration" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "vmmigration_v1_generated_VMMigration_CancelImageImportJob_sync", - "title": "Snippet for the cancel_image_import_job call in the VMMigration service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VMMigration::V1::VMMigration::Client#cancel_image_import_job.", - "file": "vm_migration/cancel_image_import_job.rb", - "language": "RUBY", - "client_method": { - "short_name": "cancel_image_import_job", - "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client#cancel_image_import_job", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VMMigration::V1::CancelImageImportJobRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "VMMigration::Client", - "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client" - }, - "method": { - "short_name": "CancelImageImportJob", - "full_name": "google.cloud.vmmigration.v1.VmMigration.CancelImageImportJob", - "service": { - "short_name": "VmMigration", - "full_name": "google.cloud.vmmigration.v1.VmMigration" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "vmmigration_v1_generated_VMMigration_CreateDiskMigrationJob_sync", - "title": "Snippet for the create_disk_migration_job call in the VMMigration service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VMMigration::V1::VMMigration::Client#create_disk_migration_job.", - "file": "vm_migration/create_disk_migration_job.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_disk_migration_job", - "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client#create_disk_migration_job", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VMMigration::V1::CreateDiskMigrationJobRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "VMMigration::Client", - "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client" - }, - "method": { - "short_name": "CreateDiskMigrationJob", - "full_name": "google.cloud.vmmigration.v1.VmMigration.CreateDiskMigrationJob", - "service": { - "short_name": "VmMigration", - "full_name": "google.cloud.vmmigration.v1.VmMigration" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "vmmigration_v1_generated_VMMigration_ListDiskMigrationJobs_sync", - "title": "Snippet for the list_disk_migration_jobs call in the VMMigration service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VMMigration::V1::VMMigration::Client#list_disk_migration_jobs.", - "file": "vm_migration/list_disk_migration_jobs.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_disk_migration_jobs", - "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client#list_disk_migration_jobs", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VMMigration::V1::ListDiskMigrationJobsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::VMMigration::V1::ListDiskMigrationJobsResponse", - "client": { - "short_name": "VMMigration::Client", - "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client" - }, - "method": { - "short_name": "ListDiskMigrationJobs", - "full_name": "google.cloud.vmmigration.v1.VmMigration.ListDiskMigrationJobs", - "service": { - "short_name": "VmMigration", - "full_name": "google.cloud.vmmigration.v1.VmMigration" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "vmmigration_v1_generated_VMMigration_GetDiskMigrationJob_sync", - "title": "Snippet for the get_disk_migration_job call in the VMMigration service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VMMigration::V1::VMMigration::Client#get_disk_migration_job.", - "file": "vm_migration/get_disk_migration_job.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_disk_migration_job", - "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client#get_disk_migration_job", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VMMigration::V1::GetDiskMigrationJobRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::VMMigration::V1::DiskMigrationJob", - "client": { - "short_name": "VMMigration::Client", - "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client" - }, - "method": { - "short_name": "GetDiskMigrationJob", - "full_name": "google.cloud.vmmigration.v1.VmMigration.GetDiskMigrationJob", - "service": { - "short_name": "VmMigration", - "full_name": "google.cloud.vmmigration.v1.VmMigration" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "vmmigration_v1_generated_VMMigration_UpdateDiskMigrationJob_sync", - "title": "Snippet for the update_disk_migration_job call in the VMMigration service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VMMigration::V1::VMMigration::Client#update_disk_migration_job.", - "file": "vm_migration/update_disk_migration_job.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_disk_migration_job", - "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client#update_disk_migration_job", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VMMigration::V1::UpdateDiskMigrationJobRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "VMMigration::Client", - "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client" - }, - "method": { - "short_name": "UpdateDiskMigrationJob", - "full_name": "google.cloud.vmmigration.v1.VmMigration.UpdateDiskMigrationJob", - "service": { - "short_name": "VmMigration", - "full_name": "google.cloud.vmmigration.v1.VmMigration" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "vmmigration_v1_generated_VMMigration_DeleteDiskMigrationJob_sync", - "title": "Snippet for the delete_disk_migration_job call in the VMMigration service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VMMigration::V1::VMMigration::Client#delete_disk_migration_job.", - "file": "vm_migration/delete_disk_migration_job.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_disk_migration_job", - "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client#delete_disk_migration_job", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VMMigration::V1::DeleteDiskMigrationJobRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "VMMigration::Client", - "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client" - }, - "method": { - "short_name": "DeleteDiskMigrationJob", - "full_name": "google.cloud.vmmigration.v1.VmMigration.DeleteDiskMigrationJob", - "service": { - "short_name": "VmMigration", - "full_name": "google.cloud.vmmigration.v1.VmMigration" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "vmmigration_v1_generated_VMMigration_RunDiskMigrationJob_sync", - "title": "Snippet for the run_disk_migration_job call in the VMMigration service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VMMigration::V1::VMMigration::Client#run_disk_migration_job.", - "file": "vm_migration/run_disk_migration_job.rb", - "language": "RUBY", - "client_method": { - "short_name": "run_disk_migration_job", - "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client#run_disk_migration_job", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VMMigration::V1::RunDiskMigrationJobRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "VMMigration::Client", - "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client" - }, - "method": { - "short_name": "RunDiskMigrationJob", - "full_name": "google.cloud.vmmigration.v1.VmMigration.RunDiskMigrationJob", - "service": { - "short_name": "VmMigration", - "full_name": "google.cloud.vmmigration.v1.VmMigration" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "vmmigration_v1_generated_VMMigration_CancelDiskMigrationJob_sync", - "title": "Snippet for the cancel_disk_migration_job call in the VMMigration service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VMMigration::V1::VMMigration::Client#cancel_disk_migration_job.", - "file": "vm_migration/cancel_disk_migration_job.rb", - "language": "RUBY", - "client_method": { - "short_name": "cancel_disk_migration_job", - "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client#cancel_disk_migration_job", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VMMigration::V1::CancelDiskMigrationJobRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "VMMigration::Client", - "full_name": "::Google::Cloud::VMMigration::V1::VMMigration::Client" - }, - "method": { - "short_name": "CancelDiskMigrationJob", - "full_name": "google.cloud.vmmigration.v1.VmMigration.CancelDiskMigrationJob", - "service": { - "short_name": "VmMigration", - "full_name": "google.cloud.vmmigration.v1.VmMigration" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - } - ] -} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-vm_migration-v1/snippets/snippet_metadata_google.iam.v1.json b/owl-bot-staging/google-cloud-vm_migration-v1/snippets/snippet_metadata_google.iam.v1.json deleted file mode 100644 index 63b1831d7897..000000000000 --- a/owl-bot-staging/google-cloud-vm_migration-v1/snippets/snippet_metadata_google.iam.v1.json +++ /dev/null @@ -1,135 +0,0 @@ -{ - "client_library": { - "name": "google-cloud-vm_migration-v1", - "version": "", - "language": "RUBY", - "apis": [ - { - "id": "google.iam.v1", - "version": "v1" - } - ] - }, - "snippets": [ - { - "region_tag": "vmmigration_v1_generated_IAMPolicy_SetIamPolicy_sync", - "title": "Snippet for the set_iam_policy call in the IAMPolicy service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Iam::V1::IAMPolicy::Client#set_iam_policy.", - "file": "iam_policy/set_iam_policy.rb", - "language": "RUBY", - "client_method": { - "short_name": "set_iam_policy", - "full_name": "::Google::Iam::V1::IAMPolicy::Client#set_iam_policy", - "async": false, - "parameters": [ - { - "type": "::Google::Iam::V1::SetIamPolicyRequest", - "name": "request" - } - ], - "result_type": "::Google::Iam::V1::Policy", - "client": { - "short_name": "IAMPolicy::Client", - "full_name": "::Google::Iam::V1::IAMPolicy::Client" - }, - "method": { - "short_name": "SetIamPolicy", - "full_name": "google.iam.v1.IAMPolicy.SetIamPolicy", - "service": { - "short_name": "IAMPolicy", - "full_name": "google.iam.v1.IAMPolicy" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "vmmigration_v1_generated_IAMPolicy_GetIamPolicy_sync", - "title": "Snippet for the get_iam_policy call in the IAMPolicy service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Iam::V1::IAMPolicy::Client#get_iam_policy.", - "file": "iam_policy/get_iam_policy.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_iam_policy", - "full_name": "::Google::Iam::V1::IAMPolicy::Client#get_iam_policy", - "async": false, - "parameters": [ - { - "type": "::Google::Iam::V1::GetIamPolicyRequest", - "name": "request" - } - ], - "result_type": "::Google::Iam::V1::Policy", - "client": { - "short_name": "IAMPolicy::Client", - "full_name": "::Google::Iam::V1::IAMPolicy::Client" - }, - "method": { - "short_name": "GetIamPolicy", - "full_name": "google.iam.v1.IAMPolicy.GetIamPolicy", - "service": { - "short_name": "IAMPolicy", - "full_name": "google.iam.v1.IAMPolicy" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "vmmigration_v1_generated_IAMPolicy_TestIamPermissions_sync", - "title": "Snippet for the test_iam_permissions call in the IAMPolicy service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Iam::V1::IAMPolicy::Client#test_iam_permissions.", - "file": "iam_policy/test_iam_permissions.rb", - "language": "RUBY", - "client_method": { - "short_name": "test_iam_permissions", - "full_name": "::Google::Iam::V1::IAMPolicy::Client#test_iam_permissions", - "async": false, - "parameters": [ - { - "type": "::Google::Iam::V1::TestIamPermissionsRequest", - "name": "request" - } - ], - "result_type": "::Google::Iam::V1::TestIamPermissionsResponse", - "client": { - "short_name": "IAMPolicy::Client", - "full_name": "::Google::Iam::V1::IAMPolicy::Client" - }, - "method": { - "short_name": "TestIamPermissions", - "full_name": "google.iam.v1.IAMPolicy.TestIamPermissions", - "service": { - "short_name": "IAMPolicy", - "full_name": "google.iam.v1.IAMPolicy" - } - } - }, - "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-vm_migration-v1/snippets/vm_migration/add_group_migration.rb b/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/add_group_migration.rb deleted file mode 100644 index bcdab386d788..000000000000 --- a/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/add_group_migration.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 vmmigration_v1_generated_VMMigration_AddGroupMigration_sync] -require "google/cloud/vm_migration/v1" - -## -# Snippet for the add_group_migration call in the VMMigration 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::VMMigration::V1::VMMigration::Client#add_group_migration. -# -def add_group_migration - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VMMigration::V1::VMMigration::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VMMigration::V1::AddGroupMigrationRequest.new - - # Call the add_group_migration method. - result = client.add_group_migration 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 vmmigration_v1_generated_VMMigration_AddGroupMigration_sync] diff --git a/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/cancel_clone_job.rb b/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/cancel_clone_job.rb deleted file mode 100644 index e793d11e9e04..000000000000 --- a/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/cancel_clone_job.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 vmmigration_v1_generated_VMMigration_CancelCloneJob_sync] -require "google/cloud/vm_migration/v1" - -## -# Snippet for the cancel_clone_job call in the VMMigration 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::VMMigration::V1::VMMigration::Client#cancel_clone_job. -# -def cancel_clone_job - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VMMigration::V1::VMMigration::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VMMigration::V1::CancelCloneJobRequest.new - - # Call the cancel_clone_job method. - result = client.cancel_clone_job 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 vmmigration_v1_generated_VMMigration_CancelCloneJob_sync] diff --git a/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/cancel_cutover_job.rb b/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/cancel_cutover_job.rb deleted file mode 100644 index 0a836e519364..000000000000 --- a/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/cancel_cutover_job.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 vmmigration_v1_generated_VMMigration_CancelCutoverJob_sync] -require "google/cloud/vm_migration/v1" - -## -# Snippet for the cancel_cutover_job call in the VMMigration 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::VMMigration::V1::VMMigration::Client#cancel_cutover_job. -# -def cancel_cutover_job - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VMMigration::V1::VMMigration::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VMMigration::V1::CancelCutoverJobRequest.new - - # Call the cancel_cutover_job method. - result = client.cancel_cutover_job 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 vmmigration_v1_generated_VMMigration_CancelCutoverJob_sync] diff --git a/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/cancel_disk_migration_job.rb b/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/cancel_disk_migration_job.rb deleted file mode 100644 index 557ea30873d5..000000000000 --- a/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/cancel_disk_migration_job.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 vmmigration_v1_generated_VMMigration_CancelDiskMigrationJob_sync] -require "google/cloud/vm_migration/v1" - -## -# Snippet for the cancel_disk_migration_job call in the VMMigration 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::VMMigration::V1::VMMigration::Client#cancel_disk_migration_job. -# -def cancel_disk_migration_job - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VMMigration::V1::VMMigration::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VMMigration::V1::CancelDiskMigrationJobRequest.new - - # Call the cancel_disk_migration_job method. - result = client.cancel_disk_migration_job 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 vmmigration_v1_generated_VMMigration_CancelDiskMigrationJob_sync] diff --git a/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/cancel_image_import_job.rb b/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/cancel_image_import_job.rb deleted file mode 100644 index 7abf2958c3da..000000000000 --- a/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/cancel_image_import_job.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 vmmigration_v1_generated_VMMigration_CancelImageImportJob_sync] -require "google/cloud/vm_migration/v1" - -## -# Snippet for the cancel_image_import_job call in the VMMigration 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::VMMigration::V1::VMMigration::Client#cancel_image_import_job. -# -def cancel_image_import_job - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VMMigration::V1::VMMigration::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VMMigration::V1::CancelImageImportJobRequest.new - - # Call the cancel_image_import_job method. - result = client.cancel_image_import_job 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 vmmigration_v1_generated_VMMigration_CancelImageImportJob_sync] diff --git a/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/create_clone_job.rb b/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/create_clone_job.rb deleted file mode 100644 index c62d263a6f24..000000000000 --- a/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/create_clone_job.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 vmmigration_v1_generated_VMMigration_CreateCloneJob_sync] -require "google/cloud/vm_migration/v1" - -## -# Snippet for the create_clone_job call in the VMMigration 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::VMMigration::V1::VMMigration::Client#create_clone_job. -# -def create_clone_job - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VMMigration::V1::VMMigration::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VMMigration::V1::CreateCloneJobRequest.new - - # Call the create_clone_job method. - result = client.create_clone_job 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 vmmigration_v1_generated_VMMigration_CreateCloneJob_sync] diff --git a/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/create_cutover_job.rb b/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/create_cutover_job.rb deleted file mode 100644 index d082d0bba831..000000000000 --- a/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/create_cutover_job.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 vmmigration_v1_generated_VMMigration_CreateCutoverJob_sync] -require "google/cloud/vm_migration/v1" - -## -# Snippet for the create_cutover_job call in the VMMigration 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::VMMigration::V1::VMMigration::Client#create_cutover_job. -# -def create_cutover_job - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VMMigration::V1::VMMigration::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VMMigration::V1::CreateCutoverJobRequest.new - - # Call the create_cutover_job method. - result = client.create_cutover_job 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 vmmigration_v1_generated_VMMigration_CreateCutoverJob_sync] diff --git a/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/create_datacenter_connector.rb b/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/create_datacenter_connector.rb deleted file mode 100644 index a810e989fcb4..000000000000 --- a/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/create_datacenter_connector.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 vmmigration_v1_generated_VMMigration_CreateDatacenterConnector_sync] -require "google/cloud/vm_migration/v1" - -## -# Snippet for the create_datacenter_connector call in the VMMigration 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::VMMigration::V1::VMMigration::Client#create_datacenter_connector. -# -def create_datacenter_connector - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VMMigration::V1::VMMigration::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VMMigration::V1::CreateDatacenterConnectorRequest.new - - # Call the create_datacenter_connector method. - result = client.create_datacenter_connector 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 vmmigration_v1_generated_VMMigration_CreateDatacenterConnector_sync] diff --git a/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/create_disk_migration_job.rb b/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/create_disk_migration_job.rb deleted file mode 100644 index 8e62d6d32b39..000000000000 --- a/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/create_disk_migration_job.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 vmmigration_v1_generated_VMMigration_CreateDiskMigrationJob_sync] -require "google/cloud/vm_migration/v1" - -## -# Snippet for the create_disk_migration_job call in the VMMigration 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::VMMigration::V1::VMMigration::Client#create_disk_migration_job. -# -def create_disk_migration_job - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VMMigration::V1::VMMigration::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VMMigration::V1::CreateDiskMigrationJobRequest.new - - # Call the create_disk_migration_job method. - result = client.create_disk_migration_job 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 vmmigration_v1_generated_VMMigration_CreateDiskMigrationJob_sync] diff --git a/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/create_group.rb b/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/create_group.rb deleted file mode 100644 index 59e62ea9b21e..000000000000 --- a/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/create_group.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 vmmigration_v1_generated_VMMigration_CreateGroup_sync] -require "google/cloud/vm_migration/v1" - -## -# Snippet for the create_group call in the VMMigration 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::VMMigration::V1::VMMigration::Client#create_group. -# -def create_group - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VMMigration::V1::VMMigration::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VMMigration::V1::CreateGroupRequest.new - - # Call the create_group method. - result = client.create_group 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 vmmigration_v1_generated_VMMigration_CreateGroup_sync] diff --git a/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/create_image_import.rb b/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/create_image_import.rb deleted file mode 100644 index f82c328d5019..000000000000 --- a/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/create_image_import.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 vmmigration_v1_generated_VMMigration_CreateImageImport_sync] -require "google/cloud/vm_migration/v1" - -## -# Snippet for the create_image_import call in the VMMigration 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::VMMigration::V1::VMMigration::Client#create_image_import. -# -def create_image_import - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VMMigration::V1::VMMigration::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VMMigration::V1::CreateImageImportRequest.new - - # Call the create_image_import method. - result = client.create_image_import 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 vmmigration_v1_generated_VMMigration_CreateImageImport_sync] diff --git a/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/create_migrating_vm.rb b/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/create_migrating_vm.rb deleted file mode 100644 index fc9a4416562c..000000000000 --- a/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/create_migrating_vm.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 vmmigration_v1_generated_VMMigration_CreateMigratingVm_sync] -require "google/cloud/vm_migration/v1" - -## -# Snippet for the create_migrating_vm call in the VMMigration 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::VMMigration::V1::VMMigration::Client#create_migrating_vm. -# -def create_migrating_vm - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VMMigration::V1::VMMigration::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VMMigration::V1::CreateMigratingVmRequest.new - - # Call the create_migrating_vm method. - result = client.create_migrating_vm 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 vmmigration_v1_generated_VMMigration_CreateMigratingVm_sync] diff --git a/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/create_source.rb b/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/create_source.rb deleted file mode 100644 index d986b8366a38..000000000000 --- a/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/create_source.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 vmmigration_v1_generated_VMMigration_CreateSource_sync] -require "google/cloud/vm_migration/v1" - -## -# Snippet for the create_source call in the VMMigration 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::VMMigration::V1::VMMigration::Client#create_source. -# -def create_source - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VMMigration::V1::VMMigration::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VMMigration::V1::CreateSourceRequest.new - - # Call the create_source method. - result = client.create_source 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 vmmigration_v1_generated_VMMigration_CreateSource_sync] diff --git a/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/create_target_project.rb b/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/create_target_project.rb deleted file mode 100644 index 9d1cca127852..000000000000 --- a/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/create_target_project.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 vmmigration_v1_generated_VMMigration_CreateTargetProject_sync] -require "google/cloud/vm_migration/v1" - -## -# Snippet for the create_target_project call in the VMMigration 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::VMMigration::V1::VMMigration::Client#create_target_project. -# -def create_target_project - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VMMigration::V1::VMMigration::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VMMigration::V1::CreateTargetProjectRequest.new - - # Call the create_target_project method. - result = client.create_target_project 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 vmmigration_v1_generated_VMMigration_CreateTargetProject_sync] diff --git a/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/create_utilization_report.rb b/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/create_utilization_report.rb deleted file mode 100644 index 009399161a85..000000000000 --- a/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/create_utilization_report.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 vmmigration_v1_generated_VMMigration_CreateUtilizationReport_sync] -require "google/cloud/vm_migration/v1" - -## -# Snippet for the create_utilization_report call in the VMMigration 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::VMMigration::V1::VMMigration::Client#create_utilization_report. -# -def create_utilization_report - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VMMigration::V1::VMMigration::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VMMigration::V1::CreateUtilizationReportRequest.new - - # Call the create_utilization_report method. - result = client.create_utilization_report 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 vmmigration_v1_generated_VMMigration_CreateUtilizationReport_sync] diff --git a/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/delete_datacenter_connector.rb b/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/delete_datacenter_connector.rb deleted file mode 100644 index 463fe61c20dc..000000000000 --- a/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/delete_datacenter_connector.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 vmmigration_v1_generated_VMMigration_DeleteDatacenterConnector_sync] -require "google/cloud/vm_migration/v1" - -## -# Snippet for the delete_datacenter_connector call in the VMMigration 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::VMMigration::V1::VMMigration::Client#delete_datacenter_connector. -# -def delete_datacenter_connector - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VMMigration::V1::VMMigration::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VMMigration::V1::DeleteDatacenterConnectorRequest.new - - # Call the delete_datacenter_connector method. - result = client.delete_datacenter_connector 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 vmmigration_v1_generated_VMMigration_DeleteDatacenterConnector_sync] diff --git a/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/delete_disk_migration_job.rb b/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/delete_disk_migration_job.rb deleted file mode 100644 index d3a9d8adbddc..000000000000 --- a/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/delete_disk_migration_job.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 vmmigration_v1_generated_VMMigration_DeleteDiskMigrationJob_sync] -require "google/cloud/vm_migration/v1" - -## -# Snippet for the delete_disk_migration_job call in the VMMigration 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::VMMigration::V1::VMMigration::Client#delete_disk_migration_job. -# -def delete_disk_migration_job - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VMMigration::V1::VMMigration::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VMMigration::V1::DeleteDiskMigrationJobRequest.new - - # Call the delete_disk_migration_job method. - result = client.delete_disk_migration_job 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 vmmigration_v1_generated_VMMigration_DeleteDiskMigrationJob_sync] diff --git a/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/delete_group.rb b/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/delete_group.rb deleted file mode 100644 index b11d471f8967..000000000000 --- a/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/delete_group.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 vmmigration_v1_generated_VMMigration_DeleteGroup_sync] -require "google/cloud/vm_migration/v1" - -## -# Snippet for the delete_group call in the VMMigration 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::VMMigration::V1::VMMigration::Client#delete_group. -# -def delete_group - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VMMigration::V1::VMMigration::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VMMigration::V1::DeleteGroupRequest.new - - # Call the delete_group method. - result = client.delete_group 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 vmmigration_v1_generated_VMMigration_DeleteGroup_sync] diff --git a/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/delete_image_import.rb b/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/delete_image_import.rb deleted file mode 100644 index 383e4f3c5c83..000000000000 --- a/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/delete_image_import.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 vmmigration_v1_generated_VMMigration_DeleteImageImport_sync] -require "google/cloud/vm_migration/v1" - -## -# Snippet for the delete_image_import call in the VMMigration 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::VMMigration::V1::VMMigration::Client#delete_image_import. -# -def delete_image_import - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VMMigration::V1::VMMigration::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VMMigration::V1::DeleteImageImportRequest.new - - # Call the delete_image_import method. - result = client.delete_image_import 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 vmmigration_v1_generated_VMMigration_DeleteImageImport_sync] diff --git a/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/delete_migrating_vm.rb b/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/delete_migrating_vm.rb deleted file mode 100644 index 21b470d541ed..000000000000 --- a/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/delete_migrating_vm.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 vmmigration_v1_generated_VMMigration_DeleteMigratingVm_sync] -require "google/cloud/vm_migration/v1" - -## -# Snippet for the delete_migrating_vm call in the VMMigration 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::VMMigration::V1::VMMigration::Client#delete_migrating_vm. -# -def delete_migrating_vm - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VMMigration::V1::VMMigration::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VMMigration::V1::DeleteMigratingVmRequest.new - - # Call the delete_migrating_vm method. - result = client.delete_migrating_vm 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 vmmigration_v1_generated_VMMigration_DeleteMigratingVm_sync] diff --git a/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/delete_source.rb b/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/delete_source.rb deleted file mode 100644 index 5cb042230fe5..000000000000 --- a/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/delete_source.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 vmmigration_v1_generated_VMMigration_DeleteSource_sync] -require "google/cloud/vm_migration/v1" - -## -# Snippet for the delete_source call in the VMMigration 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::VMMigration::V1::VMMigration::Client#delete_source. -# -def delete_source - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VMMigration::V1::VMMigration::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VMMigration::V1::DeleteSourceRequest.new - - # Call the delete_source method. - result = client.delete_source 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 vmmigration_v1_generated_VMMigration_DeleteSource_sync] diff --git a/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/delete_target_project.rb b/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/delete_target_project.rb deleted file mode 100644 index 6b22965699c2..000000000000 --- a/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/delete_target_project.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 vmmigration_v1_generated_VMMigration_DeleteTargetProject_sync] -require "google/cloud/vm_migration/v1" - -## -# Snippet for the delete_target_project call in the VMMigration 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::VMMigration::V1::VMMigration::Client#delete_target_project. -# -def delete_target_project - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VMMigration::V1::VMMigration::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VMMigration::V1::DeleteTargetProjectRequest.new - - # Call the delete_target_project method. - result = client.delete_target_project 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 vmmigration_v1_generated_VMMigration_DeleteTargetProject_sync] diff --git a/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/delete_utilization_report.rb b/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/delete_utilization_report.rb deleted file mode 100644 index 44307f345d74..000000000000 --- a/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/delete_utilization_report.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 vmmigration_v1_generated_VMMigration_DeleteUtilizationReport_sync] -require "google/cloud/vm_migration/v1" - -## -# Snippet for the delete_utilization_report call in the VMMigration 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::VMMigration::V1::VMMigration::Client#delete_utilization_report. -# -def delete_utilization_report - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VMMigration::V1::VMMigration::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VMMigration::V1::DeleteUtilizationReportRequest.new - - # Call the delete_utilization_report method. - result = client.delete_utilization_report 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 vmmigration_v1_generated_VMMigration_DeleteUtilizationReport_sync] diff --git a/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/extend_migration.rb b/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/extend_migration.rb deleted file mode 100644 index 1bc8e4287a4b..000000000000 --- a/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/extend_migration.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 vmmigration_v1_generated_VMMigration_ExtendMigration_sync] -require "google/cloud/vm_migration/v1" - -## -# Snippet for the extend_migration call in the VMMigration 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::VMMigration::V1::VMMigration::Client#extend_migration. -# -def extend_migration - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VMMigration::V1::VMMigration::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VMMigration::V1::ExtendMigrationRequest.new - - # Call the extend_migration method. - result = client.extend_migration 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 vmmigration_v1_generated_VMMigration_ExtendMigration_sync] diff --git a/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/fetch_inventory.rb b/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/fetch_inventory.rb deleted file mode 100644 index e146b1dcaa6a..000000000000 --- a/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/fetch_inventory.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 vmmigration_v1_generated_VMMigration_FetchInventory_sync] -require "google/cloud/vm_migration/v1" - -## -# Snippet for the fetch_inventory call in the VMMigration 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::VMMigration::V1::VMMigration::Client#fetch_inventory. -# -def fetch_inventory - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VMMigration::V1::VMMigration::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VMMigration::V1::FetchInventoryRequest.new - - # Call the fetch_inventory method. - result = client.fetch_inventory request - - # The returned object is of type Google::Cloud::VMMigration::V1::FetchInventoryResponse. - p result -end -# [END vmmigration_v1_generated_VMMigration_FetchInventory_sync] diff --git a/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/fetch_storage_inventory.rb b/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/fetch_storage_inventory.rb deleted file mode 100644 index 8d61792b3235..000000000000 --- a/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/fetch_storage_inventory.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 vmmigration_v1_generated_VMMigration_FetchStorageInventory_sync] -require "google/cloud/vm_migration/v1" - -## -# Snippet for the fetch_storage_inventory call in the VMMigration 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::VMMigration::V1::VMMigration::Client#fetch_storage_inventory. -# -def fetch_storage_inventory - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VMMigration::V1::VMMigration::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VMMigration::V1::FetchStorageInventoryRequest.new - - # Call the fetch_storage_inventory method. - result = client.fetch_storage_inventory 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::VMMigration::V1::SourceStorageResource. - p item - end -end -# [END vmmigration_v1_generated_VMMigration_FetchStorageInventory_sync] diff --git a/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/finalize_migration.rb b/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/finalize_migration.rb deleted file mode 100644 index de0124a90c4f..000000000000 --- a/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/finalize_migration.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 vmmigration_v1_generated_VMMigration_FinalizeMigration_sync] -require "google/cloud/vm_migration/v1" - -## -# Snippet for the finalize_migration call in the VMMigration 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::VMMigration::V1::VMMigration::Client#finalize_migration. -# -def finalize_migration - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VMMigration::V1::VMMigration::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VMMigration::V1::FinalizeMigrationRequest.new - - # Call the finalize_migration method. - result = client.finalize_migration 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 vmmigration_v1_generated_VMMigration_FinalizeMigration_sync] diff --git a/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/get_clone_job.rb b/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/get_clone_job.rb deleted file mode 100644 index db517389451a..000000000000 --- a/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/get_clone_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 vmmigration_v1_generated_VMMigration_GetCloneJob_sync] -require "google/cloud/vm_migration/v1" - -## -# Snippet for the get_clone_job call in the VMMigration 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::VMMigration::V1::VMMigration::Client#get_clone_job. -# -def get_clone_job - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VMMigration::V1::VMMigration::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VMMigration::V1::GetCloneJobRequest.new - - # Call the get_clone_job method. - result = client.get_clone_job request - - # The returned object is of type Google::Cloud::VMMigration::V1::CloneJob. - p result -end -# [END vmmigration_v1_generated_VMMigration_GetCloneJob_sync] diff --git a/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/get_cutover_job.rb b/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/get_cutover_job.rb deleted file mode 100644 index 0cd6af194485..000000000000 --- a/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/get_cutover_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 vmmigration_v1_generated_VMMigration_GetCutoverJob_sync] -require "google/cloud/vm_migration/v1" - -## -# Snippet for the get_cutover_job call in the VMMigration 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::VMMigration::V1::VMMigration::Client#get_cutover_job. -# -def get_cutover_job - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VMMigration::V1::VMMigration::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VMMigration::V1::GetCutoverJobRequest.new - - # Call the get_cutover_job method. - result = client.get_cutover_job request - - # The returned object is of type Google::Cloud::VMMigration::V1::CutoverJob. - p result -end -# [END vmmigration_v1_generated_VMMigration_GetCutoverJob_sync] diff --git a/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/get_datacenter_connector.rb b/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/get_datacenter_connector.rb deleted file mode 100644 index a31d233c4c6e..000000000000 --- a/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/get_datacenter_connector.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 vmmigration_v1_generated_VMMigration_GetDatacenterConnector_sync] -require "google/cloud/vm_migration/v1" - -## -# Snippet for the get_datacenter_connector call in the VMMigration 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::VMMigration::V1::VMMigration::Client#get_datacenter_connector. -# -def get_datacenter_connector - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VMMigration::V1::VMMigration::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VMMigration::V1::GetDatacenterConnectorRequest.new - - # Call the get_datacenter_connector method. - result = client.get_datacenter_connector request - - # The returned object is of type Google::Cloud::VMMigration::V1::DatacenterConnector. - p result -end -# [END vmmigration_v1_generated_VMMigration_GetDatacenterConnector_sync] diff --git a/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/get_disk_migration_job.rb b/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/get_disk_migration_job.rb deleted file mode 100644 index cbe4542f985f..000000000000 --- a/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/get_disk_migration_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 vmmigration_v1_generated_VMMigration_GetDiskMigrationJob_sync] -require "google/cloud/vm_migration/v1" - -## -# Snippet for the get_disk_migration_job call in the VMMigration 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::VMMigration::V1::VMMigration::Client#get_disk_migration_job. -# -def get_disk_migration_job - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VMMigration::V1::VMMigration::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VMMigration::V1::GetDiskMigrationJobRequest.new - - # Call the get_disk_migration_job method. - result = client.get_disk_migration_job request - - # The returned object is of type Google::Cloud::VMMigration::V1::DiskMigrationJob. - p result -end -# [END vmmigration_v1_generated_VMMigration_GetDiskMigrationJob_sync] diff --git a/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/get_group.rb b/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/get_group.rb deleted file mode 100644 index 65e2b20dfb80..000000000000 --- a/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/get_group.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 vmmigration_v1_generated_VMMigration_GetGroup_sync] -require "google/cloud/vm_migration/v1" - -## -# Snippet for the get_group call in the VMMigration 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::VMMigration::V1::VMMigration::Client#get_group. -# -def get_group - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VMMigration::V1::VMMigration::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VMMigration::V1::GetGroupRequest.new - - # Call the get_group method. - result = client.get_group request - - # The returned object is of type Google::Cloud::VMMigration::V1::Group. - p result -end -# [END vmmigration_v1_generated_VMMigration_GetGroup_sync] diff --git a/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/get_image_import.rb b/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/get_image_import.rb deleted file mode 100644 index e1feb7535061..000000000000 --- a/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/get_image_import.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 vmmigration_v1_generated_VMMigration_GetImageImport_sync] -require "google/cloud/vm_migration/v1" - -## -# Snippet for the get_image_import call in the VMMigration 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::VMMigration::V1::VMMigration::Client#get_image_import. -# -def get_image_import - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VMMigration::V1::VMMigration::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VMMigration::V1::GetImageImportRequest.new - - # Call the get_image_import method. - result = client.get_image_import request - - # The returned object is of type Google::Cloud::VMMigration::V1::ImageImport. - p result -end -# [END vmmigration_v1_generated_VMMigration_GetImageImport_sync] diff --git a/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/get_image_import_job.rb b/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/get_image_import_job.rb deleted file mode 100644 index ece7476fe926..000000000000 --- a/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/get_image_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 vmmigration_v1_generated_VMMigration_GetImageImportJob_sync] -require "google/cloud/vm_migration/v1" - -## -# Snippet for the get_image_import_job call in the VMMigration 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::VMMigration::V1::VMMigration::Client#get_image_import_job. -# -def get_image_import_job - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VMMigration::V1::VMMigration::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VMMigration::V1::GetImageImportJobRequest.new - - # Call the get_image_import_job method. - result = client.get_image_import_job request - - # The returned object is of type Google::Cloud::VMMigration::V1::ImageImportJob. - p result -end -# [END vmmigration_v1_generated_VMMigration_GetImageImportJob_sync] diff --git a/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/get_migrating_vm.rb b/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/get_migrating_vm.rb deleted file mode 100644 index 859d96d2c15d..000000000000 --- a/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/get_migrating_vm.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 vmmigration_v1_generated_VMMigration_GetMigratingVm_sync] -require "google/cloud/vm_migration/v1" - -## -# Snippet for the get_migrating_vm call in the VMMigration 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::VMMigration::V1::VMMigration::Client#get_migrating_vm. -# -def get_migrating_vm - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VMMigration::V1::VMMigration::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VMMigration::V1::GetMigratingVmRequest.new - - # Call the get_migrating_vm method. - result = client.get_migrating_vm request - - # The returned object is of type Google::Cloud::VMMigration::V1::MigratingVm. - p result -end -# [END vmmigration_v1_generated_VMMigration_GetMigratingVm_sync] diff --git a/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/get_replication_cycle.rb b/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/get_replication_cycle.rb deleted file mode 100644 index dcc435bb380a..000000000000 --- a/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/get_replication_cycle.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 vmmigration_v1_generated_VMMigration_GetReplicationCycle_sync] -require "google/cloud/vm_migration/v1" - -## -# Snippet for the get_replication_cycle call in the VMMigration 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::VMMigration::V1::VMMigration::Client#get_replication_cycle. -# -def get_replication_cycle - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VMMigration::V1::VMMigration::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VMMigration::V1::GetReplicationCycleRequest.new - - # Call the get_replication_cycle method. - result = client.get_replication_cycle request - - # The returned object is of type Google::Cloud::VMMigration::V1::ReplicationCycle. - p result -end -# [END vmmigration_v1_generated_VMMigration_GetReplicationCycle_sync] diff --git a/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/get_source.rb b/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/get_source.rb deleted file mode 100644 index 65922a3256be..000000000000 --- a/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/get_source.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 vmmigration_v1_generated_VMMigration_GetSource_sync] -require "google/cloud/vm_migration/v1" - -## -# Snippet for the get_source call in the VMMigration 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::VMMigration::V1::VMMigration::Client#get_source. -# -def get_source - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VMMigration::V1::VMMigration::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VMMigration::V1::GetSourceRequest.new - - # Call the get_source method. - result = client.get_source request - - # The returned object is of type Google::Cloud::VMMigration::V1::Source. - p result -end -# [END vmmigration_v1_generated_VMMigration_GetSource_sync] diff --git a/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/get_target_project.rb b/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/get_target_project.rb deleted file mode 100644 index 23f5cdaab240..000000000000 --- a/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/get_target_project.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 vmmigration_v1_generated_VMMigration_GetTargetProject_sync] -require "google/cloud/vm_migration/v1" - -## -# Snippet for the get_target_project call in the VMMigration 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::VMMigration::V1::VMMigration::Client#get_target_project. -# -def get_target_project - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VMMigration::V1::VMMigration::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VMMigration::V1::GetTargetProjectRequest.new - - # Call the get_target_project method. - result = client.get_target_project request - - # The returned object is of type Google::Cloud::VMMigration::V1::TargetProject. - p result -end -# [END vmmigration_v1_generated_VMMigration_GetTargetProject_sync] diff --git a/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/get_utilization_report.rb b/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/get_utilization_report.rb deleted file mode 100644 index 96169dfd79e6..000000000000 --- a/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/get_utilization_report.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 vmmigration_v1_generated_VMMigration_GetUtilizationReport_sync] -require "google/cloud/vm_migration/v1" - -## -# Snippet for the get_utilization_report call in the VMMigration 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::VMMigration::V1::VMMigration::Client#get_utilization_report. -# -def get_utilization_report - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VMMigration::V1::VMMigration::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VMMigration::V1::GetUtilizationReportRequest.new - - # Call the get_utilization_report method. - result = client.get_utilization_report request - - # The returned object is of type Google::Cloud::VMMigration::V1::UtilizationReport. - p result -end -# [END vmmigration_v1_generated_VMMigration_GetUtilizationReport_sync] diff --git a/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/list_clone_jobs.rb b/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/list_clone_jobs.rb deleted file mode 100644 index fa1aee940d78..000000000000 --- a/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/list_clone_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 vmmigration_v1_generated_VMMigration_ListCloneJobs_sync] -require "google/cloud/vm_migration/v1" - -## -# Snippet for the list_clone_jobs call in the VMMigration 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::VMMigration::V1::VMMigration::Client#list_clone_jobs. -# -def list_clone_jobs - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VMMigration::V1::VMMigration::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VMMigration::V1::ListCloneJobsRequest.new - - # Call the list_clone_jobs method. - result = client.list_clone_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::VMMigration::V1::CloneJob. - p item - end -end -# [END vmmigration_v1_generated_VMMigration_ListCloneJobs_sync] diff --git a/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/list_cutover_jobs.rb b/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/list_cutover_jobs.rb deleted file mode 100644 index 5d4c02a21363..000000000000 --- a/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/list_cutover_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 vmmigration_v1_generated_VMMigration_ListCutoverJobs_sync] -require "google/cloud/vm_migration/v1" - -## -# Snippet for the list_cutover_jobs call in the VMMigration 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::VMMigration::V1::VMMigration::Client#list_cutover_jobs. -# -def list_cutover_jobs - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VMMigration::V1::VMMigration::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VMMigration::V1::ListCutoverJobsRequest.new - - # Call the list_cutover_jobs method. - result = client.list_cutover_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::VMMigration::V1::CutoverJob. - p item - end -end -# [END vmmigration_v1_generated_VMMigration_ListCutoverJobs_sync] diff --git a/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/list_datacenter_connectors.rb b/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/list_datacenter_connectors.rb deleted file mode 100644 index 71a339726c05..000000000000 --- a/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/list_datacenter_connectors.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 vmmigration_v1_generated_VMMigration_ListDatacenterConnectors_sync] -require "google/cloud/vm_migration/v1" - -## -# Snippet for the list_datacenter_connectors call in the VMMigration 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::VMMigration::V1::VMMigration::Client#list_datacenter_connectors. -# -def list_datacenter_connectors - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VMMigration::V1::VMMigration::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VMMigration::V1::ListDatacenterConnectorsRequest.new - - # Call the list_datacenter_connectors method. - result = client.list_datacenter_connectors 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::VMMigration::V1::DatacenterConnector. - p item - end -end -# [END vmmigration_v1_generated_VMMigration_ListDatacenterConnectors_sync] diff --git a/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/list_disk_migration_jobs.rb b/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/list_disk_migration_jobs.rb deleted file mode 100644 index d64cd963c363..000000000000 --- a/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/list_disk_migration_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 vmmigration_v1_generated_VMMigration_ListDiskMigrationJobs_sync] -require "google/cloud/vm_migration/v1" - -## -# Snippet for the list_disk_migration_jobs call in the VMMigration 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::VMMigration::V1::VMMigration::Client#list_disk_migration_jobs. -# -def list_disk_migration_jobs - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VMMigration::V1::VMMigration::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VMMigration::V1::ListDiskMigrationJobsRequest.new - - # Call the list_disk_migration_jobs method. - result = client.list_disk_migration_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::VMMigration::V1::DiskMigrationJob. - p item - end -end -# [END vmmigration_v1_generated_VMMigration_ListDiskMigrationJobs_sync] diff --git a/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/list_groups.rb b/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/list_groups.rb deleted file mode 100644 index a7729ec666d8..000000000000 --- a/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/list_groups.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 vmmigration_v1_generated_VMMigration_ListGroups_sync] -require "google/cloud/vm_migration/v1" - -## -# Snippet for the list_groups call in the VMMigration 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::VMMigration::V1::VMMigration::Client#list_groups. -# -def list_groups - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VMMigration::V1::VMMigration::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VMMigration::V1::ListGroupsRequest.new - - # Call the list_groups method. - result = client.list_groups 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::VMMigration::V1::Group. - p item - end -end -# [END vmmigration_v1_generated_VMMigration_ListGroups_sync] diff --git a/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/list_image_import_jobs.rb b/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/list_image_import_jobs.rb deleted file mode 100644 index 96ce3be98fa4..000000000000 --- a/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/list_image_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 vmmigration_v1_generated_VMMigration_ListImageImportJobs_sync] -require "google/cloud/vm_migration/v1" - -## -# Snippet for the list_image_import_jobs call in the VMMigration 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::VMMigration::V1::VMMigration::Client#list_image_import_jobs. -# -def list_image_import_jobs - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VMMigration::V1::VMMigration::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VMMigration::V1::ListImageImportJobsRequest.new - - # Call the list_image_import_jobs method. - result = client.list_image_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::VMMigration::V1::ImageImportJob. - p item - end -end -# [END vmmigration_v1_generated_VMMigration_ListImageImportJobs_sync] diff --git a/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/list_image_imports.rb b/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/list_image_imports.rb deleted file mode 100644 index 905e6270d997..000000000000 --- a/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/list_image_imports.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 vmmigration_v1_generated_VMMigration_ListImageImports_sync] -require "google/cloud/vm_migration/v1" - -## -# Snippet for the list_image_imports call in the VMMigration 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::VMMigration::V1::VMMigration::Client#list_image_imports. -# -def list_image_imports - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VMMigration::V1::VMMigration::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VMMigration::V1::ListImageImportsRequest.new - - # Call the list_image_imports method. - result = client.list_image_imports 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::VMMigration::V1::ImageImport. - p item - end -end -# [END vmmigration_v1_generated_VMMigration_ListImageImports_sync] diff --git a/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/list_migrating_vms.rb b/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/list_migrating_vms.rb deleted file mode 100644 index ead9293bc12c..000000000000 --- a/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/list_migrating_vms.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 vmmigration_v1_generated_VMMigration_ListMigratingVms_sync] -require "google/cloud/vm_migration/v1" - -## -# Snippet for the list_migrating_vms call in the VMMigration 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::VMMigration::V1::VMMigration::Client#list_migrating_vms. -# -def list_migrating_vms - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VMMigration::V1::VMMigration::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VMMigration::V1::ListMigratingVmsRequest.new - - # Call the list_migrating_vms method. - result = client.list_migrating_vms 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::VMMigration::V1::MigratingVm. - p item - end -end -# [END vmmigration_v1_generated_VMMigration_ListMigratingVms_sync] diff --git a/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/list_replication_cycles.rb b/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/list_replication_cycles.rb deleted file mode 100644 index 7637076854bf..000000000000 --- a/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/list_replication_cycles.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 vmmigration_v1_generated_VMMigration_ListReplicationCycles_sync] -require "google/cloud/vm_migration/v1" - -## -# Snippet for the list_replication_cycles call in the VMMigration 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::VMMigration::V1::VMMigration::Client#list_replication_cycles. -# -def list_replication_cycles - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VMMigration::V1::VMMigration::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VMMigration::V1::ListReplicationCyclesRequest.new - - # Call the list_replication_cycles method. - result = client.list_replication_cycles 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::VMMigration::V1::ReplicationCycle. - p item - end -end -# [END vmmigration_v1_generated_VMMigration_ListReplicationCycles_sync] diff --git a/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/list_sources.rb b/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/list_sources.rb deleted file mode 100644 index 11ca8fc0fdaf..000000000000 --- a/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/list_sources.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 vmmigration_v1_generated_VMMigration_ListSources_sync] -require "google/cloud/vm_migration/v1" - -## -# Snippet for the list_sources call in the VMMigration 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::VMMigration::V1::VMMigration::Client#list_sources. -# -def list_sources - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VMMigration::V1::VMMigration::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VMMigration::V1::ListSourcesRequest.new - - # Call the list_sources method. - result = client.list_sources 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::VMMigration::V1::Source. - p item - end -end -# [END vmmigration_v1_generated_VMMigration_ListSources_sync] diff --git a/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/list_target_projects.rb b/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/list_target_projects.rb deleted file mode 100644 index 2062be038e5c..000000000000 --- a/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/list_target_projects.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 vmmigration_v1_generated_VMMigration_ListTargetProjects_sync] -require "google/cloud/vm_migration/v1" - -## -# Snippet for the list_target_projects call in the VMMigration 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::VMMigration::V1::VMMigration::Client#list_target_projects. -# -def list_target_projects - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VMMigration::V1::VMMigration::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VMMigration::V1::ListTargetProjectsRequest.new - - # Call the list_target_projects method. - result = client.list_target_projects 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::VMMigration::V1::TargetProject. - p item - end -end -# [END vmmigration_v1_generated_VMMigration_ListTargetProjects_sync] diff --git a/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/list_utilization_reports.rb b/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/list_utilization_reports.rb deleted file mode 100644 index 600cd348203d..000000000000 --- a/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/list_utilization_reports.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 vmmigration_v1_generated_VMMigration_ListUtilizationReports_sync] -require "google/cloud/vm_migration/v1" - -## -# Snippet for the list_utilization_reports call in the VMMigration 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::VMMigration::V1::VMMigration::Client#list_utilization_reports. -# -def list_utilization_reports - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VMMigration::V1::VMMigration::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VMMigration::V1::ListUtilizationReportsRequest.new - - # Call the list_utilization_reports method. - result = client.list_utilization_reports 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::VMMigration::V1::UtilizationReport. - p item - end -end -# [END vmmigration_v1_generated_VMMigration_ListUtilizationReports_sync] diff --git a/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/pause_migration.rb b/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/pause_migration.rb deleted file mode 100644 index 75f9d9040507..000000000000 --- a/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/pause_migration.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 vmmigration_v1_generated_VMMigration_PauseMigration_sync] -require "google/cloud/vm_migration/v1" - -## -# Snippet for the pause_migration call in the VMMigration 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::VMMigration::V1::VMMigration::Client#pause_migration. -# -def pause_migration - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VMMigration::V1::VMMigration::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VMMigration::V1::PauseMigrationRequest.new - - # Call the pause_migration method. - result = client.pause_migration 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 vmmigration_v1_generated_VMMigration_PauseMigration_sync] diff --git a/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/remove_group_migration.rb b/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/remove_group_migration.rb deleted file mode 100644 index 57f34577f8e4..000000000000 --- a/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/remove_group_migration.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 vmmigration_v1_generated_VMMigration_RemoveGroupMigration_sync] -require "google/cloud/vm_migration/v1" - -## -# Snippet for the remove_group_migration call in the VMMigration 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::VMMigration::V1::VMMigration::Client#remove_group_migration. -# -def remove_group_migration - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VMMigration::V1::VMMigration::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VMMigration::V1::RemoveGroupMigrationRequest.new - - # Call the remove_group_migration method. - result = client.remove_group_migration 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 vmmigration_v1_generated_VMMigration_RemoveGroupMigration_sync] diff --git a/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/resume_migration.rb b/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/resume_migration.rb deleted file mode 100644 index bf0c8f916147..000000000000 --- a/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/resume_migration.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 vmmigration_v1_generated_VMMigration_ResumeMigration_sync] -require "google/cloud/vm_migration/v1" - -## -# Snippet for the resume_migration call in the VMMigration 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::VMMigration::V1::VMMigration::Client#resume_migration. -# -def resume_migration - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VMMigration::V1::VMMigration::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VMMigration::V1::ResumeMigrationRequest.new - - # Call the resume_migration method. - result = client.resume_migration 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 vmmigration_v1_generated_VMMigration_ResumeMigration_sync] diff --git a/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/run_disk_migration_job.rb b/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/run_disk_migration_job.rb deleted file mode 100644 index eb8896ebb979..000000000000 --- a/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/run_disk_migration_job.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 vmmigration_v1_generated_VMMigration_RunDiskMigrationJob_sync] -require "google/cloud/vm_migration/v1" - -## -# Snippet for the run_disk_migration_job call in the VMMigration 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::VMMigration::V1::VMMigration::Client#run_disk_migration_job. -# -def run_disk_migration_job - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VMMigration::V1::VMMigration::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VMMigration::V1::RunDiskMigrationJobRequest.new - - # Call the run_disk_migration_job method. - result = client.run_disk_migration_job 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 vmmigration_v1_generated_VMMigration_RunDiskMigrationJob_sync] diff --git a/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/start_migration.rb b/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/start_migration.rb deleted file mode 100644 index a7793e5d81f0..000000000000 --- a/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/start_migration.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 vmmigration_v1_generated_VMMigration_StartMigration_sync] -require "google/cloud/vm_migration/v1" - -## -# Snippet for the start_migration call in the VMMigration 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::VMMigration::V1::VMMigration::Client#start_migration. -# -def start_migration - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VMMigration::V1::VMMigration::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VMMigration::V1::StartMigrationRequest.new - - # Call the start_migration method. - result = client.start_migration 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 vmmigration_v1_generated_VMMigration_StartMigration_sync] diff --git a/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/update_disk_migration_job.rb b/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/update_disk_migration_job.rb deleted file mode 100644 index 91385e19ef0c..000000000000 --- a/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/update_disk_migration_job.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 vmmigration_v1_generated_VMMigration_UpdateDiskMigrationJob_sync] -require "google/cloud/vm_migration/v1" - -## -# Snippet for the update_disk_migration_job call in the VMMigration 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::VMMigration::V1::VMMigration::Client#update_disk_migration_job. -# -def update_disk_migration_job - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VMMigration::V1::VMMigration::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VMMigration::V1::UpdateDiskMigrationJobRequest.new - - # Call the update_disk_migration_job method. - result = client.update_disk_migration_job 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 vmmigration_v1_generated_VMMigration_UpdateDiskMigrationJob_sync] diff --git a/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/update_group.rb b/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/update_group.rb deleted file mode 100644 index 0557b00ade9f..000000000000 --- a/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/update_group.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 vmmigration_v1_generated_VMMigration_UpdateGroup_sync] -require "google/cloud/vm_migration/v1" - -## -# Snippet for the update_group call in the VMMigration 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::VMMigration::V1::VMMigration::Client#update_group. -# -def update_group - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VMMigration::V1::VMMigration::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VMMigration::V1::UpdateGroupRequest.new - - # Call the update_group method. - result = client.update_group 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 vmmigration_v1_generated_VMMigration_UpdateGroup_sync] diff --git a/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/update_migrating_vm.rb b/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/update_migrating_vm.rb deleted file mode 100644 index 20606fa68627..000000000000 --- a/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/update_migrating_vm.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 vmmigration_v1_generated_VMMigration_UpdateMigratingVm_sync] -require "google/cloud/vm_migration/v1" - -## -# Snippet for the update_migrating_vm call in the VMMigration 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::VMMigration::V1::VMMigration::Client#update_migrating_vm. -# -def update_migrating_vm - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VMMigration::V1::VMMigration::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VMMigration::V1::UpdateMigratingVmRequest.new - - # Call the update_migrating_vm method. - result = client.update_migrating_vm 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 vmmigration_v1_generated_VMMigration_UpdateMigratingVm_sync] diff --git a/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/update_source.rb b/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/update_source.rb deleted file mode 100644 index dcccdce9407c..000000000000 --- a/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/update_source.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 vmmigration_v1_generated_VMMigration_UpdateSource_sync] -require "google/cloud/vm_migration/v1" - -## -# Snippet for the update_source call in the VMMigration 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::VMMigration::V1::VMMigration::Client#update_source. -# -def update_source - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VMMigration::V1::VMMigration::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VMMigration::V1::UpdateSourceRequest.new - - # Call the update_source method. - result = client.update_source 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 vmmigration_v1_generated_VMMigration_UpdateSource_sync] diff --git a/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/update_target_project.rb b/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/update_target_project.rb deleted file mode 100644 index 8d452955f061..000000000000 --- a/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/update_target_project.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 vmmigration_v1_generated_VMMigration_UpdateTargetProject_sync] -require "google/cloud/vm_migration/v1" - -## -# Snippet for the update_target_project call in the VMMigration 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::VMMigration::V1::VMMigration::Client#update_target_project. -# -def update_target_project - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VMMigration::V1::VMMigration::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VMMigration::V1::UpdateTargetProjectRequest.new - - # Call the update_target_project method. - result = client.update_target_project 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 vmmigration_v1_generated_VMMigration_UpdateTargetProject_sync] diff --git a/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/upgrade_appliance.rb b/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/upgrade_appliance.rb deleted file mode 100644 index a9c4dfa983e0..000000000000 --- a/owl-bot-staging/google-cloud-vm_migration-v1/snippets/vm_migration/upgrade_appliance.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 vmmigration_v1_generated_VMMigration_UpgradeAppliance_sync] -require "google/cloud/vm_migration/v1" - -## -# Snippet for the upgrade_appliance call in the VMMigration 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::VMMigration::V1::VMMigration::Client#upgrade_appliance. -# -def upgrade_appliance - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VMMigration::V1::VMMigration::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VMMigration::V1::UpgradeApplianceRequest.new - - # Call the upgrade_appliance method. - result = client.upgrade_appliance 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 vmmigration_v1_generated_VMMigration_UpgradeAppliance_sync] diff --git a/owl-bot-staging/google-cloud-vm_migration-v1/test/google/cloud/vm_migration/v1/vm_migration_operations_test.rb b/owl-bot-staging/google-cloud-vm_migration-v1/test/google/cloud/vm_migration/v1/vm_migration_operations_test.rb deleted file mode 100644 index 098a9eb56abb..000000000000 --- a/owl-bot-staging/google-cloud-vm_migration-v1/test/google/cloud/vm_migration/v1/vm_migration_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/vmmigration/v1/vmmigration_pb" -require "google/cloud/vmmigration/v1/vmmigration_services_pb" -require "google/cloud/vm_migration/v1/vm_migration" - -class ::Google::Cloud::VMMigration::V1::VMMigration::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::VMMigration::V1::VMMigration::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::VMMigration::V1::VMMigration::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::VMMigration::V1::VMMigration::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::VMMigration::V1::VMMigration::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::VMMigration::V1::VMMigration::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::VMMigration::V1::VMMigration::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::VMMigration::V1::VMMigration::Operations::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-vm_migration-v1/test/google/cloud/vm_migration/v1/vm_migration_paths_test.rb b/owl-bot-staging/google-cloud-vm_migration-v1/test/google/cloud/vm_migration/v1/vm_migration_paths_test.rb deleted file mode 100644 index 8708c9a2d23c..000000000000 --- a/owl-bot-staging/google-cloud-vm_migration-v1/test/google/cloud/vm_migration/v1/vm_migration_paths_test.rb +++ /dev/null @@ -1,235 +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/vm_migration/v1/vm_migration" - -class ::Google::Cloud::VMMigration::V1::VMMigration::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_clone_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::VMMigration::V1::VMMigration::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.clone_job_path project: "value0", location: "value1", source: "value2", migrating_vm: "value3", clone_job: "value4" - assert_equal "projects/value0/locations/value1/sources/value2/migratingVms/value3/cloneJobs/value4", path - 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::VMMigration::V1::VMMigration::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_cutover_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::VMMigration::V1::VMMigration::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.cutover_job_path project: "value0", location: "value1", source: "value2", migrating_vm: "value3", cutover_job: "value4" - assert_equal "projects/value0/locations/value1/sources/value2/migratingVms/value3/cutoverJobs/value4", path - end - end - - def test_datacenter_connector_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::VMMigration::V1::VMMigration::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.datacenter_connector_path project: "value0", location: "value1", source: "value2", datacenter_connector: "value3" - assert_equal "projects/value0/locations/value1/sources/value2/datacenterConnectors/value3", path - end - end - - def test_disk_migration_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::VMMigration::V1::VMMigration::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.disk_migration_job_path project: "value0", location: "value1", source: "value2", disk_migration_job: "value3" - assert_equal "projects/value0/locations/value1/sources/value2/diskMigrationJobs/value3", path - end - end - - def test_group_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::VMMigration::V1::VMMigration::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.group_path project: "value0", location: "value1", group: "value2" - assert_equal "projects/value0/locations/value1/groups/value2", path - end - end - - def test_image_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::VMMigration::V1::VMMigration::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.image_path project: "value0", image: "value1" - assert_equal "projects/value0/global/images/value1", path - end - end - - def test_image_import_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::VMMigration::V1::VMMigration::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.image_import_path project: "value0", location: "value1", job: "value2" - assert_equal "projects/value0/locations/value1/imageImports/value2", path - end - end - - def test_image_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::VMMigration::V1::VMMigration::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.image_import_job_path project: "value0", location: "value1", job: "value2", result: "value3" - assert_equal "projects/value0/locations/value1/imageImports/value2/imageImportJobs/value3", 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::VMMigration::V1::VMMigration::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_migrating_vm_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::VMMigration::V1::VMMigration::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.migrating_vm_path project: "value0", location: "value1", source: "value2", migrating_vm: "value3" - assert_equal "projects/value0/locations/value1/sources/value2/migratingVms/value3", path - end - end - - def test_replication_cycle_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::VMMigration::V1::VMMigration::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.replication_cycle_path project: "value0", location: "value1", source: "value2", migrating_vm: "value3", replication_cycle: "value4" - assert_equal "projects/value0/locations/value1/sources/value2/migratingVms/value3/replicationCycles/value4", path - end - end - - def test_service_account_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::VMMigration::V1::VMMigration::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.service_account_path project: "value0", service_account: "value1" - assert_equal "projects/value0/serviceAccounts/value1", path - end - end - - def test_source_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::VMMigration::V1::VMMigration::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.source_path project: "value0", location: "value1", source: "value2" - assert_equal "projects/value0/locations/value1/sources/value2", path - end - end - - def test_target_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::VMMigration::V1::VMMigration::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.target_project_path project: "value0", location: "value1", target_project: "value2" - assert_equal "projects/value0/locations/value1/targetProjects/value2", path - end - end - - def test_utilization_report_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::VMMigration::V1::VMMigration::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.utilization_report_path project: "value0", location: "value1", source: "value2", utilization_report: "value3" - assert_equal "projects/value0/locations/value1/sources/value2/utilizationReports/value3", path - end - end -end diff --git a/owl-bot-staging/google-cloud-vm_migration-v1/test/google/cloud/vm_migration/v1/vm_migration_rest_test.rb b/owl-bot-staging/google-cloud-vm_migration-v1/test/google/cloud/vm_migration/v1/vm_migration_rest_test.rb deleted file mode 100644 index 5e96e39d496f..000000000000 --- a/owl-bot-staging/google-cloud-vm_migration-v1/test/google/cloud/vm_migration/v1/vm_migration_rest_test.rb +++ /dev/null @@ -1,3553 +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/vmmigration/v1/vmmigration_pb" -require "google/cloud/vm_migration/v1/vm_migration/rest" - - -class ::Google::Cloud::VMMigration::V1::VMMigration::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_sources - # Create test objects. - client_result = ::Google::Cloud::VMMigration::V1::ListSourcesResponse.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_sources_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::VMMigration::V1::VMMigration::Rest::ServiceStub.stub :transcode_list_sources_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_sources_client_stub do - # Create client - client = ::Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_sources({ 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_sources 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_sources ::Google::Cloud::VMMigration::V1::ListSourcesRequest.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_sources({ 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_sources(::Google::Cloud::VMMigration::V1::ListSourcesRequest.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_sources_client_stub.call_count - end - end - end - - def test_get_source - # Create test objects. - client_result = ::Google::Cloud::VMMigration::V1::Source.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_source_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::VMMigration::V1::VMMigration::Rest::ServiceStub.stub :transcode_get_source_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_source_client_stub do - # Create client - client = ::Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_source({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_source name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_source ::Google::Cloud::VMMigration::V1::GetSourceRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_source({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_source(::Google::Cloud::VMMigration::V1::GetSourceRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_source_client_stub.call_count - end - end - end - - def test_create_source - # 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" - source_id = "hello world" - source = {} - request_id = "hello world" - - create_source_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::VMMigration::V1::VMMigration::Rest::ServiceStub.stub :transcode_create_source_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_source_client_stub do - # Create client - client = ::Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_source({ parent: parent, source_id: source_id, source: source, request_id: request_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_source parent: parent, source_id: source_id, source: source, request_id: request_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_source ::Google::Cloud::VMMigration::V1::CreateSourceRequest.new(parent: parent, source_id: source_id, source: source, request_id: request_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_source({ parent: parent, source_id: source_id, source: source, request_id: request_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_source(::Google::Cloud::VMMigration::V1::CreateSourceRequest.new(parent: parent, source_id: source_id, source: source, request_id: request_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_source_client_stub.call_count - end - end - end - - def test_update_source - # 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. - update_mask = {} - source = {} - request_id = "hello world" - - update_source_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::VMMigration::V1::VMMigration::Rest::ServiceStub.stub :transcode_update_source_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_source_client_stub do - # Create client - client = ::Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.update_source({ update_mask: update_mask, source: source, request_id: request_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.update_source update_mask: update_mask, source: source, request_id: request_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.update_source ::Google::Cloud::VMMigration::V1::UpdateSourceRequest.new(update_mask: update_mask, source: source, request_id: request_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.update_source({ update_mask: update_mask, source: source, request_id: request_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.update_source(::Google::Cloud::VMMigration::V1::UpdateSourceRequest.new(update_mask: update_mask, source: source, request_id: request_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, update_source_client_stub.call_count - end - end - end - - def test_delete_source - # 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" - request_id = "hello world" - - delete_source_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::VMMigration::V1::VMMigration::Rest::ServiceStub.stub :transcode_delete_source_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_source_client_stub do - # Create client - client = ::Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.delete_source({ name: name, request_id: request_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.delete_source name: name, request_id: request_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.delete_source ::Google::Cloud::VMMigration::V1::DeleteSourceRequest.new(name: name, request_id: request_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.delete_source({ name: name, request_id: request_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.delete_source(::Google::Cloud::VMMigration::V1::DeleteSourceRequest.new(name: name, request_id: request_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, delete_source_client_stub.call_count - end - end - end - - def test_fetch_inventory - # Create test objects. - client_result = ::Google::Cloud::VMMigration::V1::FetchInventoryResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - source = "hello world" - force_refresh = true - - fetch_inventory_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::VMMigration::V1::VMMigration::Rest::ServiceStub.stub :transcode_fetch_inventory_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, fetch_inventory_client_stub do - # Create client - client = ::Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.fetch_inventory({ source: source, force_refresh: force_refresh }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.fetch_inventory source: source, force_refresh: force_refresh do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.fetch_inventory ::Google::Cloud::VMMigration::V1::FetchInventoryRequest.new(source: source, force_refresh: force_refresh) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.fetch_inventory({ source: source, force_refresh: force_refresh }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.fetch_inventory(::Google::Cloud::VMMigration::V1::FetchInventoryRequest.new(source: source, force_refresh: force_refresh), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, fetch_inventory_client_stub.call_count - end - end - end - - def test_fetch_storage_inventory - # Create test objects. - client_result = ::Google::Cloud::VMMigration::V1::FetchStorageInventoryResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - source = "hello world" - type = :STORAGE_TYPE_UNSPECIFIED - force_refresh = true - page_size = 42 - page_token = "hello world" - - fetch_storage_inventory_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::VMMigration::V1::VMMigration::Rest::ServiceStub.stub :transcode_fetch_storage_inventory_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, fetch_storage_inventory_client_stub do - # Create client - client = ::Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.fetch_storage_inventory({ source: source, type: type, force_refresh: force_refresh, page_size: page_size, page_token: page_token }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.fetch_storage_inventory source: source, type: type, force_refresh: force_refresh, page_size: page_size, page_token: page_token do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.fetch_storage_inventory ::Google::Cloud::VMMigration::V1::FetchStorageInventoryRequest.new(source: source, type: type, force_refresh: force_refresh, 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.fetch_storage_inventory({ source: source, type: type, force_refresh: force_refresh, 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.fetch_storage_inventory(::Google::Cloud::VMMigration::V1::FetchStorageInventoryRequest.new(source: source, type: type, force_refresh: force_refresh, 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, fetch_storage_inventory_client_stub.call_count - end - end - end - - def test_list_utilization_reports - # Create test objects. - client_result = ::Google::Cloud::VMMigration::V1::ListUtilizationReportsResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - view = :UTILIZATION_REPORT_VIEW_UNSPECIFIED - page_size = 42 - page_token = "hello world" - filter = "hello world" - order_by = "hello world" - - list_utilization_reports_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::VMMigration::V1::VMMigration::Rest::ServiceStub.stub :transcode_list_utilization_reports_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_utilization_reports_client_stub do - # Create client - client = ::Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_utilization_reports({ parent: parent, view: view, 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_utilization_reports parent: parent, view: view, 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_utilization_reports ::Google::Cloud::VMMigration::V1::ListUtilizationReportsRequest.new(parent: parent, view: view, 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_utilization_reports({ parent: parent, view: view, 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_utilization_reports(::Google::Cloud::VMMigration::V1::ListUtilizationReportsRequest.new(parent: parent, view: view, 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_utilization_reports_client_stub.call_count - end - end - end - - def test_get_utilization_report - # Create test objects. - client_result = ::Google::Cloud::VMMigration::V1::UtilizationReport.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - view = :UTILIZATION_REPORT_VIEW_UNSPECIFIED - - get_utilization_report_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::VMMigration::V1::VMMigration::Rest::ServiceStub.stub :transcode_get_utilization_report_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_utilization_report_client_stub do - # Create client - client = ::Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_utilization_report({ name: name, view: view }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_utilization_report name: name, view: view do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_utilization_report ::Google::Cloud::VMMigration::V1::GetUtilizationReportRequest.new(name: name, view: view) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_utilization_report({ name: name, view: view }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_utilization_report(::Google::Cloud::VMMigration::V1::GetUtilizationReportRequest.new(name: name, view: view), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_utilization_report_client_stub.call_count - end - end - end - - def test_create_utilization_report - # 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" - utilization_report = {} - utilization_report_id = "hello world" - request_id = "hello world" - - create_utilization_report_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::VMMigration::V1::VMMigration::Rest::ServiceStub.stub :transcode_create_utilization_report_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_utilization_report_client_stub do - # Create client - client = ::Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_utilization_report({ parent: parent, utilization_report: utilization_report, utilization_report_id: utilization_report_id, request_id: request_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_utilization_report parent: parent, utilization_report: utilization_report, utilization_report_id: utilization_report_id, request_id: request_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_utilization_report ::Google::Cloud::VMMigration::V1::CreateUtilizationReportRequest.new(parent: parent, utilization_report: utilization_report, utilization_report_id: utilization_report_id, request_id: request_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_utilization_report({ parent: parent, utilization_report: utilization_report, utilization_report_id: utilization_report_id, request_id: request_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_utilization_report(::Google::Cloud::VMMigration::V1::CreateUtilizationReportRequest.new(parent: parent, utilization_report: utilization_report, utilization_report_id: utilization_report_id, request_id: request_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_utilization_report_client_stub.call_count - end - end - end - - def test_delete_utilization_report - # 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" - request_id = "hello world" - - delete_utilization_report_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::VMMigration::V1::VMMigration::Rest::ServiceStub.stub :transcode_delete_utilization_report_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_utilization_report_client_stub do - # Create client - client = ::Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.delete_utilization_report({ name: name, request_id: request_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.delete_utilization_report name: name, request_id: request_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.delete_utilization_report ::Google::Cloud::VMMigration::V1::DeleteUtilizationReportRequest.new(name: name, request_id: request_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.delete_utilization_report({ name: name, request_id: request_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.delete_utilization_report(::Google::Cloud::VMMigration::V1::DeleteUtilizationReportRequest.new(name: name, request_id: request_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, delete_utilization_report_client_stub.call_count - end - end - end - - def test_list_datacenter_connectors - # Create test objects. - client_result = ::Google::Cloud::VMMigration::V1::ListDatacenterConnectorsResponse.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_datacenter_connectors_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::VMMigration::V1::VMMigration::Rest::ServiceStub.stub :transcode_list_datacenter_connectors_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_datacenter_connectors_client_stub do - # Create client - client = ::Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_datacenter_connectors({ 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_datacenter_connectors 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_datacenter_connectors ::Google::Cloud::VMMigration::V1::ListDatacenterConnectorsRequest.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_datacenter_connectors({ 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_datacenter_connectors(::Google::Cloud::VMMigration::V1::ListDatacenterConnectorsRequest.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_datacenter_connectors_client_stub.call_count - end - end - end - - def test_get_datacenter_connector - # Create test objects. - client_result = ::Google::Cloud::VMMigration::V1::DatacenterConnector.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_datacenter_connector_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::VMMigration::V1::VMMigration::Rest::ServiceStub.stub :transcode_get_datacenter_connector_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_datacenter_connector_client_stub do - # Create client - client = ::Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_datacenter_connector({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_datacenter_connector name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_datacenter_connector ::Google::Cloud::VMMigration::V1::GetDatacenterConnectorRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_datacenter_connector({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_datacenter_connector(::Google::Cloud::VMMigration::V1::GetDatacenterConnectorRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_datacenter_connector_client_stub.call_count - end - end - end - - def test_create_datacenter_connector - # 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" - datacenter_connector_id = "hello world" - datacenter_connector = {} - request_id = "hello world" - - create_datacenter_connector_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::VMMigration::V1::VMMigration::Rest::ServiceStub.stub :transcode_create_datacenter_connector_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_datacenter_connector_client_stub do - # Create client - client = ::Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_datacenter_connector({ parent: parent, datacenter_connector_id: datacenter_connector_id, datacenter_connector: datacenter_connector, request_id: request_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_datacenter_connector parent: parent, datacenter_connector_id: datacenter_connector_id, datacenter_connector: datacenter_connector, request_id: request_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_datacenter_connector ::Google::Cloud::VMMigration::V1::CreateDatacenterConnectorRequest.new(parent: parent, datacenter_connector_id: datacenter_connector_id, datacenter_connector: datacenter_connector, request_id: request_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_datacenter_connector({ parent: parent, datacenter_connector_id: datacenter_connector_id, datacenter_connector: datacenter_connector, request_id: request_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_datacenter_connector(::Google::Cloud::VMMigration::V1::CreateDatacenterConnectorRequest.new(parent: parent, datacenter_connector_id: datacenter_connector_id, datacenter_connector: datacenter_connector, request_id: request_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_datacenter_connector_client_stub.call_count - end - end - end - - def test_delete_datacenter_connector - # 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" - request_id = "hello world" - - delete_datacenter_connector_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::VMMigration::V1::VMMigration::Rest::ServiceStub.stub :transcode_delete_datacenter_connector_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_datacenter_connector_client_stub do - # Create client - client = ::Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.delete_datacenter_connector({ name: name, request_id: request_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.delete_datacenter_connector name: name, request_id: request_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.delete_datacenter_connector ::Google::Cloud::VMMigration::V1::DeleteDatacenterConnectorRequest.new(name: name, request_id: request_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.delete_datacenter_connector({ name: name, request_id: request_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.delete_datacenter_connector(::Google::Cloud::VMMigration::V1::DeleteDatacenterConnectorRequest.new(name: name, request_id: request_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, delete_datacenter_connector_client_stub.call_count - end - end - end - - def test_upgrade_appliance - # 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. - datacenter_connector = "hello world" - request_id = "hello world" - - upgrade_appliance_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::VMMigration::V1::VMMigration::Rest::ServiceStub.stub :transcode_upgrade_appliance_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, upgrade_appliance_client_stub do - # Create client - client = ::Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.upgrade_appliance({ datacenter_connector: datacenter_connector, request_id: request_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.upgrade_appliance datacenter_connector: datacenter_connector, request_id: request_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.upgrade_appliance ::Google::Cloud::VMMigration::V1::UpgradeApplianceRequest.new(datacenter_connector: datacenter_connector, request_id: request_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.upgrade_appliance({ datacenter_connector: datacenter_connector, request_id: request_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.upgrade_appliance(::Google::Cloud::VMMigration::V1::UpgradeApplianceRequest.new(datacenter_connector: datacenter_connector, request_id: request_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, upgrade_appliance_client_stub.call_count - end - end - end - - def test_create_migrating_vm - # 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" - migrating_vm_id = "hello world" - migrating_vm = {} - request_id = "hello world" - - create_migrating_vm_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::VMMigration::V1::VMMigration::Rest::ServiceStub.stub :transcode_create_migrating_vm_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_migrating_vm_client_stub do - # Create client - client = ::Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_migrating_vm({ parent: parent, migrating_vm_id: migrating_vm_id, migrating_vm: migrating_vm, request_id: request_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_migrating_vm parent: parent, migrating_vm_id: migrating_vm_id, migrating_vm: migrating_vm, request_id: request_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_migrating_vm ::Google::Cloud::VMMigration::V1::CreateMigratingVmRequest.new(parent: parent, migrating_vm_id: migrating_vm_id, migrating_vm: migrating_vm, request_id: request_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_migrating_vm({ parent: parent, migrating_vm_id: migrating_vm_id, migrating_vm: migrating_vm, request_id: request_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_migrating_vm(::Google::Cloud::VMMigration::V1::CreateMigratingVmRequest.new(parent: parent, migrating_vm_id: migrating_vm_id, migrating_vm: migrating_vm, request_id: request_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_migrating_vm_client_stub.call_count - end - end - end - - def test_list_migrating_vms - # Create test objects. - client_result = ::Google::Cloud::VMMigration::V1::ListMigratingVmsResponse.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" - view = :MIGRATING_VM_VIEW_UNSPECIFIED - - list_migrating_vms_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::VMMigration::V1::VMMigration::Rest::ServiceStub.stub :transcode_list_migrating_vms_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_migrating_vms_client_stub do - # Create client - client = ::Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_migrating_vms({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by, view: view }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.list_migrating_vms parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by, view: view do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.list_migrating_vms ::Google::Cloud::VMMigration::V1::ListMigratingVmsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by, view: view) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.list_migrating_vms({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by, view: view }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.list_migrating_vms(::Google::Cloud::VMMigration::V1::ListMigratingVmsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by, view: view), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, list_migrating_vms_client_stub.call_count - end - end - end - - def test_get_migrating_vm - # Create test objects. - client_result = ::Google::Cloud::VMMigration::V1::MigratingVm.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - view = :MIGRATING_VM_VIEW_UNSPECIFIED - - get_migrating_vm_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::VMMigration::V1::VMMigration::Rest::ServiceStub.stub :transcode_get_migrating_vm_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_migrating_vm_client_stub do - # Create client - client = ::Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_migrating_vm({ name: name, view: view }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_migrating_vm name: name, view: view do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_migrating_vm ::Google::Cloud::VMMigration::V1::GetMigratingVmRequest.new(name: name, view: view) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_migrating_vm({ name: name, view: view }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_migrating_vm(::Google::Cloud::VMMigration::V1::GetMigratingVmRequest.new(name: name, view: view), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_migrating_vm_client_stub.call_count - end - end - end - - def test_update_migrating_vm - # 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. - update_mask = {} - migrating_vm = {} - request_id = "hello world" - - update_migrating_vm_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::VMMigration::V1::VMMigration::Rest::ServiceStub.stub :transcode_update_migrating_vm_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_migrating_vm_client_stub do - # Create client - client = ::Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.update_migrating_vm({ update_mask: update_mask, migrating_vm: migrating_vm, request_id: request_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.update_migrating_vm update_mask: update_mask, migrating_vm: migrating_vm, request_id: request_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.update_migrating_vm ::Google::Cloud::VMMigration::V1::UpdateMigratingVmRequest.new(update_mask: update_mask, migrating_vm: migrating_vm, request_id: request_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.update_migrating_vm({ update_mask: update_mask, migrating_vm: migrating_vm, request_id: request_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.update_migrating_vm(::Google::Cloud::VMMigration::V1::UpdateMigratingVmRequest.new(update_mask: update_mask, migrating_vm: migrating_vm, request_id: request_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, update_migrating_vm_client_stub.call_count - end - end - end - - def test_delete_migrating_vm - # 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_migrating_vm_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::VMMigration::V1::VMMigration::Rest::ServiceStub.stub :transcode_delete_migrating_vm_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_migrating_vm_client_stub do - # Create client - client = ::Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.delete_migrating_vm({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.delete_migrating_vm name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.delete_migrating_vm ::Google::Cloud::VMMigration::V1::DeleteMigratingVmRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.delete_migrating_vm({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.delete_migrating_vm(::Google::Cloud::VMMigration::V1::DeleteMigratingVmRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, delete_migrating_vm_client_stub.call_count - end - end - end - - def test_start_migration - # 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. - migrating_vm = "hello world" - - start_migration_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::VMMigration::V1::VMMigration::Rest::ServiceStub.stub :transcode_start_migration_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, start_migration_client_stub do - # Create client - client = ::Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.start_migration({ migrating_vm: migrating_vm }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.start_migration migrating_vm: migrating_vm do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.start_migration ::Google::Cloud::VMMigration::V1::StartMigrationRequest.new(migrating_vm: migrating_vm) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.start_migration({ migrating_vm: migrating_vm }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.start_migration(::Google::Cloud::VMMigration::V1::StartMigrationRequest.new(migrating_vm: migrating_vm), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, start_migration_client_stub.call_count - end - end - end - - def test_resume_migration - # 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. - migrating_vm = "hello world" - - resume_migration_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::VMMigration::V1::VMMigration::Rest::ServiceStub.stub :transcode_resume_migration_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, resume_migration_client_stub do - # Create client - client = ::Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.resume_migration({ migrating_vm: migrating_vm }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.resume_migration migrating_vm: migrating_vm do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.resume_migration ::Google::Cloud::VMMigration::V1::ResumeMigrationRequest.new(migrating_vm: migrating_vm) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.resume_migration({ migrating_vm: migrating_vm }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.resume_migration(::Google::Cloud::VMMigration::V1::ResumeMigrationRequest.new(migrating_vm: migrating_vm), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, resume_migration_client_stub.call_count - end - end - end - - def test_pause_migration - # 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. - migrating_vm = "hello world" - - pause_migration_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::VMMigration::V1::VMMigration::Rest::ServiceStub.stub :transcode_pause_migration_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, pause_migration_client_stub do - # Create client - client = ::Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.pause_migration({ migrating_vm: migrating_vm }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.pause_migration migrating_vm: migrating_vm do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.pause_migration ::Google::Cloud::VMMigration::V1::PauseMigrationRequest.new(migrating_vm: migrating_vm) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.pause_migration({ migrating_vm: migrating_vm }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.pause_migration(::Google::Cloud::VMMigration::V1::PauseMigrationRequest.new(migrating_vm: migrating_vm), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, pause_migration_client_stub.call_count - end - end - end - - def test_finalize_migration - # 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. - migrating_vm = "hello world" - - finalize_migration_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::VMMigration::V1::VMMigration::Rest::ServiceStub.stub :transcode_finalize_migration_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, finalize_migration_client_stub do - # Create client - client = ::Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.finalize_migration({ migrating_vm: migrating_vm }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.finalize_migration migrating_vm: migrating_vm do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.finalize_migration ::Google::Cloud::VMMigration::V1::FinalizeMigrationRequest.new(migrating_vm: migrating_vm) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.finalize_migration({ migrating_vm: migrating_vm }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.finalize_migration(::Google::Cloud::VMMigration::V1::FinalizeMigrationRequest.new(migrating_vm: migrating_vm), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, finalize_migration_client_stub.call_count - end - end - end - - def test_extend_migration - # 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. - migrating_vm = "hello world" - - extend_migration_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::VMMigration::V1::VMMigration::Rest::ServiceStub.stub :transcode_extend_migration_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, extend_migration_client_stub do - # Create client - client = ::Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.extend_migration({ migrating_vm: migrating_vm }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.extend_migration migrating_vm: migrating_vm do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.extend_migration ::Google::Cloud::VMMigration::V1::ExtendMigrationRequest.new(migrating_vm: migrating_vm) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.extend_migration({ migrating_vm: migrating_vm }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.extend_migration(::Google::Cloud::VMMigration::V1::ExtendMigrationRequest.new(migrating_vm: migrating_vm), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, extend_migration_client_stub.call_count - end - end - end - - def test_create_clone_job - # 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" - clone_job_id = "hello world" - clone_job = {} - request_id = "hello world" - - create_clone_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::VMMigration::V1::VMMigration::Rest::ServiceStub.stub :transcode_create_clone_job_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_clone_job_client_stub do - # Create client - client = ::Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_clone_job({ parent: parent, clone_job_id: clone_job_id, clone_job: clone_job, request_id: request_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_clone_job parent: parent, clone_job_id: clone_job_id, clone_job: clone_job, request_id: request_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_clone_job ::Google::Cloud::VMMigration::V1::CreateCloneJobRequest.new(parent: parent, clone_job_id: clone_job_id, clone_job: clone_job, request_id: request_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_clone_job({ parent: parent, clone_job_id: clone_job_id, clone_job: clone_job, request_id: request_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_clone_job(::Google::Cloud::VMMigration::V1::CreateCloneJobRequest.new(parent: parent, clone_job_id: clone_job_id, clone_job: clone_job, request_id: request_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_clone_job_client_stub.call_count - end - end - end - - def test_cancel_clone_job - # 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" - - cancel_clone_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::VMMigration::V1::VMMigration::Rest::ServiceStub.stub :transcode_cancel_clone_job_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, cancel_clone_job_client_stub do - # Create client - client = ::Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.cancel_clone_job({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.cancel_clone_job name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.cancel_clone_job ::Google::Cloud::VMMigration::V1::CancelCloneJobRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.cancel_clone_job({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.cancel_clone_job(::Google::Cloud::VMMigration::V1::CancelCloneJobRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, cancel_clone_job_client_stub.call_count - end - end - end - - def test_list_clone_jobs - # Create test objects. - client_result = ::Google::Cloud::VMMigration::V1::ListCloneJobsResponse.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_clone_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::VMMigration::V1::VMMigration::Rest::ServiceStub.stub :transcode_list_clone_jobs_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_clone_jobs_client_stub do - # Create client - client = ::Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_clone_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_clone_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_clone_jobs ::Google::Cloud::VMMigration::V1::ListCloneJobsRequest.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_clone_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_clone_jobs(::Google::Cloud::VMMigration::V1::ListCloneJobsRequest.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_clone_jobs_client_stub.call_count - end - end - end - - def test_get_clone_job - # Create test objects. - client_result = ::Google::Cloud::VMMigration::V1::CloneJob.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_clone_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::VMMigration::V1::VMMigration::Rest::ServiceStub.stub :transcode_get_clone_job_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_clone_job_client_stub do - # Create client - client = ::Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_clone_job({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_clone_job name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_clone_job ::Google::Cloud::VMMigration::V1::GetCloneJobRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_clone_job({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_clone_job(::Google::Cloud::VMMigration::V1::GetCloneJobRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_clone_job_client_stub.call_count - end - end - end - - def test_create_cutover_job - # 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" - cutover_job_id = "hello world" - cutover_job = {} - request_id = "hello world" - - create_cutover_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::VMMigration::V1::VMMigration::Rest::ServiceStub.stub :transcode_create_cutover_job_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_cutover_job_client_stub do - # Create client - client = ::Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_cutover_job({ parent: parent, cutover_job_id: cutover_job_id, cutover_job: cutover_job, request_id: request_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_cutover_job parent: parent, cutover_job_id: cutover_job_id, cutover_job: cutover_job, request_id: request_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_cutover_job ::Google::Cloud::VMMigration::V1::CreateCutoverJobRequest.new(parent: parent, cutover_job_id: cutover_job_id, cutover_job: cutover_job, request_id: request_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_cutover_job({ parent: parent, cutover_job_id: cutover_job_id, cutover_job: cutover_job, request_id: request_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_cutover_job(::Google::Cloud::VMMigration::V1::CreateCutoverJobRequest.new(parent: parent, cutover_job_id: cutover_job_id, cutover_job: cutover_job, request_id: request_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_cutover_job_client_stub.call_count - end - end - end - - def test_cancel_cutover_job - # 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" - - cancel_cutover_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::VMMigration::V1::VMMigration::Rest::ServiceStub.stub :transcode_cancel_cutover_job_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, cancel_cutover_job_client_stub do - # Create client - client = ::Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.cancel_cutover_job({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.cancel_cutover_job name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.cancel_cutover_job ::Google::Cloud::VMMigration::V1::CancelCutoverJobRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.cancel_cutover_job({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.cancel_cutover_job(::Google::Cloud::VMMigration::V1::CancelCutoverJobRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, cancel_cutover_job_client_stub.call_count - end - end - end - - def test_list_cutover_jobs - # Create test objects. - client_result = ::Google::Cloud::VMMigration::V1::ListCutoverJobsResponse.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_cutover_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::VMMigration::V1::VMMigration::Rest::ServiceStub.stub :transcode_list_cutover_jobs_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_cutover_jobs_client_stub do - # Create client - client = ::Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_cutover_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_cutover_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_cutover_jobs ::Google::Cloud::VMMigration::V1::ListCutoverJobsRequest.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_cutover_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_cutover_jobs(::Google::Cloud::VMMigration::V1::ListCutoverJobsRequest.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_cutover_jobs_client_stub.call_count - end - end - end - - def test_get_cutover_job - # Create test objects. - client_result = ::Google::Cloud::VMMigration::V1::CutoverJob.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_cutover_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::VMMigration::V1::VMMigration::Rest::ServiceStub.stub :transcode_get_cutover_job_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_cutover_job_client_stub do - # Create client - client = ::Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_cutover_job({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_cutover_job name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_cutover_job ::Google::Cloud::VMMigration::V1::GetCutoverJobRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_cutover_job({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_cutover_job(::Google::Cloud::VMMigration::V1::GetCutoverJobRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_cutover_job_client_stub.call_count - end - end - end - - def test_list_groups - # Create test objects. - client_result = ::Google::Cloud::VMMigration::V1::ListGroupsResponse.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_groups_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::VMMigration::V1::VMMigration::Rest::ServiceStub.stub :transcode_list_groups_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_groups_client_stub do - # Create client - client = ::Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_groups({ 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_groups 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_groups ::Google::Cloud::VMMigration::V1::ListGroupsRequest.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_groups({ 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_groups(::Google::Cloud::VMMigration::V1::ListGroupsRequest.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_groups_client_stub.call_count - end - end - end - - def test_get_group - # Create test objects. - client_result = ::Google::Cloud::VMMigration::V1::Group.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_group_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::VMMigration::V1::VMMigration::Rest::ServiceStub.stub :transcode_get_group_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_group_client_stub do - # Create client - client = ::Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_group({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_group name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_group ::Google::Cloud::VMMigration::V1::GetGroupRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_group({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_group(::Google::Cloud::VMMigration::V1::GetGroupRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_group_client_stub.call_count - end - end - end - - def test_create_group - # 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" - group_id = "hello world" - group = {} - request_id = "hello world" - - create_group_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::VMMigration::V1::VMMigration::Rest::ServiceStub.stub :transcode_create_group_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_group_client_stub do - # Create client - client = ::Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_group({ parent: parent, group_id: group_id, group: group, request_id: request_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_group parent: parent, group_id: group_id, group: group, request_id: request_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_group ::Google::Cloud::VMMigration::V1::CreateGroupRequest.new(parent: parent, group_id: group_id, group: group, request_id: request_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_group({ parent: parent, group_id: group_id, group: group, request_id: request_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_group(::Google::Cloud::VMMigration::V1::CreateGroupRequest.new(parent: parent, group_id: group_id, group: group, request_id: request_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_group_client_stub.call_count - end - end - end - - def test_update_group - # 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. - update_mask = {} - group = {} - request_id = "hello world" - - update_group_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::VMMigration::V1::VMMigration::Rest::ServiceStub.stub :transcode_update_group_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_group_client_stub do - # Create client - client = ::Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.update_group({ update_mask: update_mask, group: group, request_id: request_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.update_group update_mask: update_mask, group: group, request_id: request_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.update_group ::Google::Cloud::VMMigration::V1::UpdateGroupRequest.new(update_mask: update_mask, group: group, request_id: request_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.update_group({ update_mask: update_mask, group: group, request_id: request_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.update_group(::Google::Cloud::VMMigration::V1::UpdateGroupRequest.new(update_mask: update_mask, group: group, request_id: request_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, update_group_client_stub.call_count - end - end - end - - def test_delete_group - # 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" - request_id = "hello world" - - delete_group_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::VMMigration::V1::VMMigration::Rest::ServiceStub.stub :transcode_delete_group_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_group_client_stub do - # Create client - client = ::Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.delete_group({ name: name, request_id: request_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.delete_group name: name, request_id: request_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.delete_group ::Google::Cloud::VMMigration::V1::DeleteGroupRequest.new(name: name, request_id: request_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.delete_group({ name: name, request_id: request_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.delete_group(::Google::Cloud::VMMigration::V1::DeleteGroupRequest.new(name: name, request_id: request_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, delete_group_client_stub.call_count - end - end - end - - def test_add_group_migration - # 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. - group = "hello world" - migrating_vm = "hello world" - - add_group_migration_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::VMMigration::V1::VMMigration::Rest::ServiceStub.stub :transcode_add_group_migration_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, add_group_migration_client_stub do - # Create client - client = ::Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.add_group_migration({ group: group, migrating_vm: migrating_vm }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.add_group_migration group: group, migrating_vm: migrating_vm do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.add_group_migration ::Google::Cloud::VMMigration::V1::AddGroupMigrationRequest.new(group: group, migrating_vm: migrating_vm) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.add_group_migration({ group: group, migrating_vm: migrating_vm }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.add_group_migration(::Google::Cloud::VMMigration::V1::AddGroupMigrationRequest.new(group: group, migrating_vm: migrating_vm), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, add_group_migration_client_stub.call_count - end - end - end - - def test_remove_group_migration - # 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. - group = "hello world" - migrating_vm = "hello world" - - remove_group_migration_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::VMMigration::V1::VMMigration::Rest::ServiceStub.stub :transcode_remove_group_migration_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, remove_group_migration_client_stub do - # Create client - client = ::Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.remove_group_migration({ group: group, migrating_vm: migrating_vm }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.remove_group_migration group: group, migrating_vm: migrating_vm do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.remove_group_migration ::Google::Cloud::VMMigration::V1::RemoveGroupMigrationRequest.new(group: group, migrating_vm: migrating_vm) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.remove_group_migration({ group: group, migrating_vm: migrating_vm }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.remove_group_migration(::Google::Cloud::VMMigration::V1::RemoveGroupMigrationRequest.new(group: group, migrating_vm: migrating_vm), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, remove_group_migration_client_stub.call_count - end - end - end - - def test_list_target_projects - # Create test objects. - client_result = ::Google::Cloud::VMMigration::V1::ListTargetProjectsResponse.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_target_projects_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::VMMigration::V1::VMMigration::Rest::ServiceStub.stub :transcode_list_target_projects_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_target_projects_client_stub do - # Create client - client = ::Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_target_projects({ 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_target_projects 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_target_projects ::Google::Cloud::VMMigration::V1::ListTargetProjectsRequest.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_target_projects({ 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_target_projects(::Google::Cloud::VMMigration::V1::ListTargetProjectsRequest.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_target_projects_client_stub.call_count - end - end - end - - def test_get_target_project - # Create test objects. - client_result = ::Google::Cloud::VMMigration::V1::TargetProject.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_target_project_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::VMMigration::V1::VMMigration::Rest::ServiceStub.stub :transcode_get_target_project_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_target_project_client_stub do - # Create client - client = ::Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_target_project({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_target_project name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_target_project ::Google::Cloud::VMMigration::V1::GetTargetProjectRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_target_project({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_target_project(::Google::Cloud::VMMigration::V1::GetTargetProjectRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_target_project_client_stub.call_count - end - end - end - - def test_create_target_project - # 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" - target_project_id = "hello world" - target_project = {} - request_id = "hello world" - - create_target_project_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::VMMigration::V1::VMMigration::Rest::ServiceStub.stub :transcode_create_target_project_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_target_project_client_stub do - # Create client - client = ::Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_target_project({ parent: parent, target_project_id: target_project_id, target_project: target_project, request_id: request_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_target_project parent: parent, target_project_id: target_project_id, target_project: target_project, request_id: request_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_target_project ::Google::Cloud::VMMigration::V1::CreateTargetProjectRequest.new(parent: parent, target_project_id: target_project_id, target_project: target_project, request_id: request_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_target_project({ parent: parent, target_project_id: target_project_id, target_project: target_project, request_id: request_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_target_project(::Google::Cloud::VMMigration::V1::CreateTargetProjectRequest.new(parent: parent, target_project_id: target_project_id, target_project: target_project, request_id: request_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_target_project_client_stub.call_count - end - end - end - - def test_update_target_project - # 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. - update_mask = {} - target_project = {} - request_id = "hello world" - - update_target_project_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::VMMigration::V1::VMMigration::Rest::ServiceStub.stub :transcode_update_target_project_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_target_project_client_stub do - # Create client - client = ::Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.update_target_project({ update_mask: update_mask, target_project: target_project, request_id: request_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.update_target_project update_mask: update_mask, target_project: target_project, request_id: request_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.update_target_project ::Google::Cloud::VMMigration::V1::UpdateTargetProjectRequest.new(update_mask: update_mask, target_project: target_project, request_id: request_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.update_target_project({ update_mask: update_mask, target_project: target_project, request_id: request_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.update_target_project(::Google::Cloud::VMMigration::V1::UpdateTargetProjectRequest.new(update_mask: update_mask, target_project: target_project, request_id: request_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, update_target_project_client_stub.call_count - end - end - end - - def test_delete_target_project - # 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" - request_id = "hello world" - - delete_target_project_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::VMMigration::V1::VMMigration::Rest::ServiceStub.stub :transcode_delete_target_project_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_target_project_client_stub do - # Create client - client = ::Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.delete_target_project({ name: name, request_id: request_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.delete_target_project name: name, request_id: request_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.delete_target_project ::Google::Cloud::VMMigration::V1::DeleteTargetProjectRequest.new(name: name, request_id: request_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.delete_target_project({ name: name, request_id: request_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.delete_target_project(::Google::Cloud::VMMigration::V1::DeleteTargetProjectRequest.new(name: name, request_id: request_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, delete_target_project_client_stub.call_count - end - end - end - - def test_list_replication_cycles - # Create test objects. - client_result = ::Google::Cloud::VMMigration::V1::ListReplicationCyclesResponse.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_replication_cycles_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::VMMigration::V1::VMMigration::Rest::ServiceStub.stub :transcode_list_replication_cycles_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_replication_cycles_client_stub do - # Create client - client = ::Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_replication_cycles({ 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_replication_cycles 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_replication_cycles ::Google::Cloud::VMMigration::V1::ListReplicationCyclesRequest.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_replication_cycles({ 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_replication_cycles(::Google::Cloud::VMMigration::V1::ListReplicationCyclesRequest.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_replication_cycles_client_stub.call_count - end - end - end - - def test_get_replication_cycle - # Create test objects. - client_result = ::Google::Cloud::VMMigration::V1::ReplicationCycle.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_replication_cycle_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::VMMigration::V1::VMMigration::Rest::ServiceStub.stub :transcode_get_replication_cycle_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_replication_cycle_client_stub do - # Create client - client = ::Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_replication_cycle({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_replication_cycle name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_replication_cycle ::Google::Cloud::VMMigration::V1::GetReplicationCycleRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_replication_cycle({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_replication_cycle(::Google::Cloud::VMMigration::V1::GetReplicationCycleRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_replication_cycle_client_stub.call_count - end - end - end - - def test_list_image_imports - # Create test objects. - client_result = ::Google::Cloud::VMMigration::V1::ListImageImportsResponse.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_image_imports_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::VMMigration::V1::VMMigration::Rest::ServiceStub.stub :transcode_list_image_imports_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_image_imports_client_stub do - # Create client - client = ::Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_image_imports({ 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_image_imports 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_image_imports ::Google::Cloud::VMMigration::V1::ListImageImportsRequest.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_image_imports({ 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_image_imports(::Google::Cloud::VMMigration::V1::ListImageImportsRequest.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_image_imports_client_stub.call_count - end - end - end - - def test_get_image_import - # Create test objects. - client_result = ::Google::Cloud::VMMigration::V1::ImageImport.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_image_import_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::VMMigration::V1::VMMigration::Rest::ServiceStub.stub :transcode_get_image_import_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_image_import_client_stub do - # Create client - client = ::Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_image_import({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_image_import name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_image_import ::Google::Cloud::VMMigration::V1::GetImageImportRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_image_import({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_image_import(::Google::Cloud::VMMigration::V1::GetImageImportRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_image_import_client_stub.call_count - end - end - end - - def test_create_image_import - # 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" - image_import_id = "hello world" - image_import = {} - request_id = "hello world" - - create_image_import_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::VMMigration::V1::VMMigration::Rest::ServiceStub.stub :transcode_create_image_import_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_image_import_client_stub do - # Create client - client = ::Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_image_import({ parent: parent, image_import_id: image_import_id, image_import: image_import, request_id: request_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_image_import parent: parent, image_import_id: image_import_id, image_import: image_import, request_id: request_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_image_import ::Google::Cloud::VMMigration::V1::CreateImageImportRequest.new(parent: parent, image_import_id: image_import_id, image_import: image_import, request_id: request_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_image_import({ parent: parent, image_import_id: image_import_id, image_import: image_import, request_id: request_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_image_import(::Google::Cloud::VMMigration::V1::CreateImageImportRequest.new(parent: parent, image_import_id: image_import_id, image_import: image_import, request_id: request_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_image_import_client_stub.call_count - end - end - end - - def test_delete_image_import - # 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" - request_id = "hello world" - - delete_image_import_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::VMMigration::V1::VMMigration::Rest::ServiceStub.stub :transcode_delete_image_import_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_image_import_client_stub do - # Create client - client = ::Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.delete_image_import({ name: name, request_id: request_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.delete_image_import name: name, request_id: request_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.delete_image_import ::Google::Cloud::VMMigration::V1::DeleteImageImportRequest.new(name: name, request_id: request_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.delete_image_import({ name: name, request_id: request_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.delete_image_import(::Google::Cloud::VMMigration::V1::DeleteImageImportRequest.new(name: name, request_id: request_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, delete_image_import_client_stub.call_count - end - end - end - - def test_list_image_import_jobs - # Create test objects. - client_result = ::Google::Cloud::VMMigration::V1::ListImageImportJobsResponse.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_image_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::VMMigration::V1::VMMigration::Rest::ServiceStub.stub :transcode_list_image_import_jobs_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_image_import_jobs_client_stub do - # Create client - client = ::Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_image_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_image_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_image_import_jobs ::Google::Cloud::VMMigration::V1::ListImageImportJobsRequest.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_image_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_image_import_jobs(::Google::Cloud::VMMigration::V1::ListImageImportJobsRequest.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_image_import_jobs_client_stub.call_count - end - end - end - - def test_get_image_import_job - # Create test objects. - client_result = ::Google::Cloud::VMMigration::V1::ImageImportJob.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_image_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::VMMigration::V1::VMMigration::Rest::ServiceStub.stub :transcode_get_image_import_job_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_image_import_job_client_stub do - # Create client - client = ::Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_image_import_job({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_image_import_job name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_image_import_job ::Google::Cloud::VMMigration::V1::GetImageImportJobRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_image_import_job({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_image_import_job(::Google::Cloud::VMMigration::V1::GetImageImportJobRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_image_import_job_client_stub.call_count - end - end - end - - def test_cancel_image_import_job - # 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" - - cancel_image_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::VMMigration::V1::VMMigration::Rest::ServiceStub.stub :transcode_cancel_image_import_job_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, cancel_image_import_job_client_stub do - # Create client - client = ::Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.cancel_image_import_job({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.cancel_image_import_job name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.cancel_image_import_job ::Google::Cloud::VMMigration::V1::CancelImageImportJobRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.cancel_image_import_job({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.cancel_image_import_job(::Google::Cloud::VMMigration::V1::CancelImageImportJobRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, cancel_image_import_job_client_stub.call_count - end - end - end - - def test_create_disk_migration_job - # 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" - disk_migration_job_id = "hello world" - disk_migration_job = {} - request_id = "hello world" - - create_disk_migration_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::VMMigration::V1::VMMigration::Rest::ServiceStub.stub :transcode_create_disk_migration_job_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_disk_migration_job_client_stub do - # Create client - client = ::Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_disk_migration_job({ parent: parent, disk_migration_job_id: disk_migration_job_id, disk_migration_job: disk_migration_job, request_id: request_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_disk_migration_job parent: parent, disk_migration_job_id: disk_migration_job_id, disk_migration_job: disk_migration_job, request_id: request_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_disk_migration_job ::Google::Cloud::VMMigration::V1::CreateDiskMigrationJobRequest.new(parent: parent, disk_migration_job_id: disk_migration_job_id, disk_migration_job: disk_migration_job, request_id: request_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_disk_migration_job({ parent: parent, disk_migration_job_id: disk_migration_job_id, disk_migration_job: disk_migration_job, request_id: request_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_disk_migration_job(::Google::Cloud::VMMigration::V1::CreateDiskMigrationJobRequest.new(parent: parent, disk_migration_job_id: disk_migration_job_id, disk_migration_job: disk_migration_job, request_id: request_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_disk_migration_job_client_stub.call_count - end - end - end - - def test_list_disk_migration_jobs - # Create test objects. - client_result = ::Google::Cloud::VMMigration::V1::ListDiskMigrationJobsResponse.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_disk_migration_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::VMMigration::V1::VMMigration::Rest::ServiceStub.stub :transcode_list_disk_migration_jobs_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_disk_migration_jobs_client_stub do - # Create client - client = ::Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_disk_migration_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_disk_migration_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_disk_migration_jobs ::Google::Cloud::VMMigration::V1::ListDiskMigrationJobsRequest.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_disk_migration_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_disk_migration_jobs(::Google::Cloud::VMMigration::V1::ListDiskMigrationJobsRequest.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_disk_migration_jobs_client_stub.call_count - end - end - end - - def test_get_disk_migration_job - # Create test objects. - client_result = ::Google::Cloud::VMMigration::V1::DiskMigrationJob.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_disk_migration_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::VMMigration::V1::VMMigration::Rest::ServiceStub.stub :transcode_get_disk_migration_job_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_disk_migration_job_client_stub do - # Create client - client = ::Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_disk_migration_job({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_disk_migration_job name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_disk_migration_job ::Google::Cloud::VMMigration::V1::GetDiskMigrationJobRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_disk_migration_job({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_disk_migration_job(::Google::Cloud::VMMigration::V1::GetDiskMigrationJobRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_disk_migration_job_client_stub.call_count - end - end - end - - def test_update_disk_migration_job - # 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. - update_mask = {} - disk_migration_job = {} - request_id = "hello world" - - update_disk_migration_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::VMMigration::V1::VMMigration::Rest::ServiceStub.stub :transcode_update_disk_migration_job_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_disk_migration_job_client_stub do - # Create client - client = ::Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.update_disk_migration_job({ update_mask: update_mask, disk_migration_job: disk_migration_job, request_id: request_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.update_disk_migration_job update_mask: update_mask, disk_migration_job: disk_migration_job, request_id: request_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.update_disk_migration_job ::Google::Cloud::VMMigration::V1::UpdateDiskMigrationJobRequest.new(update_mask: update_mask, disk_migration_job: disk_migration_job, request_id: request_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.update_disk_migration_job({ update_mask: update_mask, disk_migration_job: disk_migration_job, request_id: request_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.update_disk_migration_job(::Google::Cloud::VMMigration::V1::UpdateDiskMigrationJobRequest.new(update_mask: update_mask, disk_migration_job: disk_migration_job, request_id: request_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, update_disk_migration_job_client_stub.call_count - end - end - end - - def test_delete_disk_migration_job - # 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_disk_migration_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::VMMigration::V1::VMMigration::Rest::ServiceStub.stub :transcode_delete_disk_migration_job_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_disk_migration_job_client_stub do - # Create client - client = ::Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.delete_disk_migration_job({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.delete_disk_migration_job name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.delete_disk_migration_job ::Google::Cloud::VMMigration::V1::DeleteDiskMigrationJobRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.delete_disk_migration_job({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.delete_disk_migration_job(::Google::Cloud::VMMigration::V1::DeleteDiskMigrationJobRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, delete_disk_migration_job_client_stub.call_count - end - end - end - - def test_run_disk_migration_job - # 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" - - run_disk_migration_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::VMMigration::V1::VMMigration::Rest::ServiceStub.stub :transcode_run_disk_migration_job_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, run_disk_migration_job_client_stub do - # Create client - client = ::Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.run_disk_migration_job({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.run_disk_migration_job name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.run_disk_migration_job ::Google::Cloud::VMMigration::V1::RunDiskMigrationJobRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.run_disk_migration_job({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.run_disk_migration_job(::Google::Cloud::VMMigration::V1::RunDiskMigrationJobRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, run_disk_migration_job_client_stub.call_count - end - end - end - - def test_cancel_disk_migration_job - # 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" - - cancel_disk_migration_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::VMMigration::V1::VMMigration::Rest::ServiceStub.stub :transcode_cancel_disk_migration_job_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, cancel_disk_migration_job_client_stub do - # Create client - client = ::Google::Cloud::VMMigration::V1::VMMigration::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.cancel_disk_migration_job({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.cancel_disk_migration_job name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.cancel_disk_migration_job ::Google::Cloud::VMMigration::V1::CancelDiskMigrationJobRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.cancel_disk_migration_job({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.cancel_disk_migration_job(::Google::Cloud::VMMigration::V1::CancelDiskMigrationJobRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, cancel_disk_migration_job_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::VMMigration::V1::VMMigration::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::VMMigration::V1::VMMigration::Rest::Client::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-vm_migration-v1/test/google/cloud/vm_migration/v1/vm_migration_test.rb b/owl-bot-staging/google-cloud-vm_migration-v1/test/google/cloud/vm_migration/v1/vm_migration_test.rb deleted file mode 100644 index 944b1448a6ae..000000000000 --- a/owl-bot-staging/google-cloud-vm_migration-v1/test/google/cloud/vm_migration/v1/vm_migration_test.rb +++ /dev/null @@ -1,4171 +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/vmmigration/v1/vmmigration_pb" -require "google/cloud/vm_migration/v1/vm_migration" - -class ::Google::Cloud::VMMigration::V1::VMMigration::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_sources - # Create GRPC objects. - grpc_response = ::Google::Cloud::VMMigration::V1::ListSourcesResponse.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_sources_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_sources, name - assert_kind_of ::Google::Cloud::VMMigration::V1::ListSourcesRequest, 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_sources_client_stub do - # Create client - client = ::Google::Cloud::VMMigration::V1::VMMigration::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_sources({ 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_sources 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_sources ::Google::Cloud::VMMigration::V1::ListSourcesRequest.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_sources({ 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_sources(::Google::Cloud::VMMigration::V1::ListSourcesRequest.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_sources_client_stub.call_rpc_count - end - end - - def test_get_source - # Create GRPC objects. - grpc_response = ::Google::Cloud::VMMigration::V1::Source.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_source_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_source, name - assert_kind_of ::Google::Cloud::VMMigration::V1::GetSourceRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_source_client_stub do - # Create client - client = ::Google::Cloud::VMMigration::V1::VMMigration::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_source({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_source name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_source ::Google::Cloud::VMMigration::V1::GetSourceRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_source({ 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_source(::Google::Cloud::VMMigration::V1::GetSourceRequest.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_source_client_stub.call_rpc_count - end - end - - def test_create_source - # 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" - source_id = "hello world" - source = {} - request_id = "hello world" - - create_source_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_source, name - assert_kind_of ::Google::Cloud::VMMigration::V1::CreateSourceRequest, request - assert_equal "hello world", request["parent"] - assert_equal "hello world", request["source_id"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::VMMigration::V1::Source), request["source"] - assert_equal "hello world", request["request_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_source_client_stub do - # Create client - client = ::Google::Cloud::VMMigration::V1::VMMigration::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_source({ parent: parent, source_id: source_id, source: source, request_id: request_id }) 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_source parent: parent, source_id: source_id, source: source, request_id: request_id 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_source ::Google::Cloud::VMMigration::V1::CreateSourceRequest.new(parent: parent, source_id: source_id, source: source, request_id: request_id) 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_source({ parent: parent, source_id: source_id, source: source, request_id: request_id }, 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_source(::Google::Cloud::VMMigration::V1::CreateSourceRequest.new(parent: parent, source_id: source_id, source: source, request_id: request_id), 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_source_client_stub.call_rpc_count - end - end - - def test_update_source - # 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. - update_mask = {} - source = {} - request_id = "hello world" - - update_source_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_source, name - assert_kind_of ::Google::Cloud::VMMigration::V1::UpdateSourceRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::VMMigration::V1::Source), request["source"] - assert_equal "hello world", request["request_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_source_client_stub do - # Create client - client = ::Google::Cloud::VMMigration::V1::VMMigration::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_source({ update_mask: update_mask, source: source, request_id: request_id }) 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.update_source update_mask: update_mask, source: source, request_id: request_id 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.update_source ::Google::Cloud::VMMigration::V1::UpdateSourceRequest.new(update_mask: update_mask, source: source, request_id: request_id) 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.update_source({ update_mask: update_mask, source: source, request_id: request_id }, 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.update_source(::Google::Cloud::VMMigration::V1::UpdateSourceRequest.new(update_mask: update_mask, source: source, request_id: request_id), 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, update_source_client_stub.call_rpc_count - end - end - - def test_delete_source - # 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" - request_id = "hello world" - - delete_source_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_source, name - assert_kind_of ::Google::Cloud::VMMigration::V1::DeleteSourceRequest, request - assert_equal "hello world", request["name"] - assert_equal "hello world", request["request_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_source_client_stub do - # Create client - client = ::Google::Cloud::VMMigration::V1::VMMigration::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_source({ name: name, request_id: request_id }) 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_source name: name, request_id: request_id 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_source ::Google::Cloud::VMMigration::V1::DeleteSourceRequest.new(name: name, request_id: request_id) 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_source({ name: name, request_id: request_id }, 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_source(::Google::Cloud::VMMigration::V1::DeleteSourceRequest.new(name: name, request_id: request_id), 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_source_client_stub.call_rpc_count - end - end - - def test_fetch_inventory - # Create GRPC objects. - grpc_response = ::Google::Cloud::VMMigration::V1::FetchInventoryResponse.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. - source = "hello world" - force_refresh = true - - fetch_inventory_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :fetch_inventory, name - assert_kind_of ::Google::Cloud::VMMigration::V1::FetchInventoryRequest, request - assert_equal "hello world", request["source"] - assert_equal true, request["force_refresh"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, fetch_inventory_client_stub do - # Create client - client = ::Google::Cloud::VMMigration::V1::VMMigration::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.fetch_inventory({ source: source, force_refresh: force_refresh }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.fetch_inventory source: source, force_refresh: force_refresh do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.fetch_inventory ::Google::Cloud::VMMigration::V1::FetchInventoryRequest.new(source: source, force_refresh: force_refresh) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.fetch_inventory({ source: source, force_refresh: force_refresh }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.fetch_inventory(::Google::Cloud::VMMigration::V1::FetchInventoryRequest.new(source: source, force_refresh: force_refresh), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, fetch_inventory_client_stub.call_rpc_count - end - end - - def test_fetch_storage_inventory - # Create GRPC objects. - grpc_response = ::Google::Cloud::VMMigration::V1::FetchStorageInventoryResponse.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. - source = "hello world" - type = :STORAGE_TYPE_UNSPECIFIED - force_refresh = true - page_size = 42 - page_token = "hello world" - - fetch_storage_inventory_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :fetch_storage_inventory, name - assert_kind_of ::Google::Cloud::VMMigration::V1::FetchStorageInventoryRequest, request - assert_equal "hello world", request["source"] - assert_equal :STORAGE_TYPE_UNSPECIFIED, request["type"] - assert_equal true, request["force_refresh"] - assert_equal 42, request["page_size"] - assert_equal "hello world", request["page_token"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, fetch_storage_inventory_client_stub do - # Create client - client = ::Google::Cloud::VMMigration::V1::VMMigration::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.fetch_storage_inventory({ source: source, type: type, force_refresh: force_refresh, 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.fetch_storage_inventory source: source, type: type, force_refresh: force_refresh, 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.fetch_storage_inventory ::Google::Cloud::VMMigration::V1::FetchStorageInventoryRequest.new(source: source, type: type, force_refresh: force_refresh, 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.fetch_storage_inventory({ source: source, type: type, force_refresh: force_refresh, 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.fetch_storage_inventory(::Google::Cloud::VMMigration::V1::FetchStorageInventoryRequest.new(source: source, type: type, force_refresh: force_refresh, 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, fetch_storage_inventory_client_stub.call_rpc_count - end - end - - def test_list_utilization_reports - # Create GRPC objects. - grpc_response = ::Google::Cloud::VMMigration::V1::ListUtilizationReportsResponse.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" - view = :UTILIZATION_REPORT_VIEW_UNSPECIFIED - page_size = 42 - page_token = "hello world" - filter = "hello world" - order_by = "hello world" - - list_utilization_reports_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_utilization_reports, name - assert_kind_of ::Google::Cloud::VMMigration::V1::ListUtilizationReportsRequest, request - assert_equal "hello world", request["parent"] - assert_equal :UTILIZATION_REPORT_VIEW_UNSPECIFIED, request["view"] - 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_utilization_reports_client_stub do - # Create client - client = ::Google::Cloud::VMMigration::V1::VMMigration::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_utilization_reports({ parent: parent, view: view, 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_utilization_reports parent: parent, view: view, 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_utilization_reports ::Google::Cloud::VMMigration::V1::ListUtilizationReportsRequest.new(parent: parent, view: view, 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_utilization_reports({ parent: parent, view: view, 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_utilization_reports(::Google::Cloud::VMMigration::V1::ListUtilizationReportsRequest.new(parent: parent, view: view, 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_utilization_reports_client_stub.call_rpc_count - end - end - - def test_get_utilization_report - # Create GRPC objects. - grpc_response = ::Google::Cloud::VMMigration::V1::UtilizationReport.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" - view = :UTILIZATION_REPORT_VIEW_UNSPECIFIED - - get_utilization_report_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_utilization_report, name - assert_kind_of ::Google::Cloud::VMMigration::V1::GetUtilizationReportRequest, request - assert_equal "hello world", request["name"] - assert_equal :UTILIZATION_REPORT_VIEW_UNSPECIFIED, request["view"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_utilization_report_client_stub do - # Create client - client = ::Google::Cloud::VMMigration::V1::VMMigration::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_utilization_report({ name: name, view: view }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_utilization_report name: name, view: view do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_utilization_report ::Google::Cloud::VMMigration::V1::GetUtilizationReportRequest.new(name: name, view: view) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_utilization_report({ name: name, view: view }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_utilization_report(::Google::Cloud::VMMigration::V1::GetUtilizationReportRequest.new(name: name, view: view), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, get_utilization_report_client_stub.call_rpc_count - end - end - - def test_create_utilization_report - # 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" - utilization_report = {} - utilization_report_id = "hello world" - request_id = "hello world" - - create_utilization_report_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_utilization_report, name - assert_kind_of ::Google::Cloud::VMMigration::V1::CreateUtilizationReportRequest, request - assert_equal "hello world", request["parent"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::VMMigration::V1::UtilizationReport), request["utilization_report"] - assert_equal "hello world", request["utilization_report_id"] - assert_equal "hello world", request["request_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_utilization_report_client_stub do - # Create client - client = ::Google::Cloud::VMMigration::V1::VMMigration::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_utilization_report({ parent: parent, utilization_report: utilization_report, utilization_report_id: utilization_report_id, request_id: request_id }) 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_utilization_report parent: parent, utilization_report: utilization_report, utilization_report_id: utilization_report_id, request_id: request_id 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_utilization_report ::Google::Cloud::VMMigration::V1::CreateUtilizationReportRequest.new(parent: parent, utilization_report: utilization_report, utilization_report_id: utilization_report_id, request_id: request_id) 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_utilization_report({ parent: parent, utilization_report: utilization_report, utilization_report_id: utilization_report_id, request_id: request_id }, 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_utilization_report(::Google::Cloud::VMMigration::V1::CreateUtilizationReportRequest.new(parent: parent, utilization_report: utilization_report, utilization_report_id: utilization_report_id, request_id: request_id), 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_utilization_report_client_stub.call_rpc_count - end - end - - def test_delete_utilization_report - # 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" - request_id = "hello world" - - delete_utilization_report_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_utilization_report, name - assert_kind_of ::Google::Cloud::VMMigration::V1::DeleteUtilizationReportRequest, request - assert_equal "hello world", request["name"] - assert_equal "hello world", request["request_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_utilization_report_client_stub do - # Create client - client = ::Google::Cloud::VMMigration::V1::VMMigration::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_utilization_report({ name: name, request_id: request_id }) 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_utilization_report name: name, request_id: request_id 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_utilization_report ::Google::Cloud::VMMigration::V1::DeleteUtilizationReportRequest.new(name: name, request_id: request_id) 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_utilization_report({ name: name, request_id: request_id }, 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_utilization_report(::Google::Cloud::VMMigration::V1::DeleteUtilizationReportRequest.new(name: name, request_id: request_id), 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_utilization_report_client_stub.call_rpc_count - end - end - - def test_list_datacenter_connectors - # Create GRPC objects. - grpc_response = ::Google::Cloud::VMMigration::V1::ListDatacenterConnectorsResponse.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_datacenter_connectors_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_datacenter_connectors, name - assert_kind_of ::Google::Cloud::VMMigration::V1::ListDatacenterConnectorsRequest, 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_datacenter_connectors_client_stub do - # Create client - client = ::Google::Cloud::VMMigration::V1::VMMigration::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_datacenter_connectors({ 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_datacenter_connectors 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_datacenter_connectors ::Google::Cloud::VMMigration::V1::ListDatacenterConnectorsRequest.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_datacenter_connectors({ 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_datacenter_connectors(::Google::Cloud::VMMigration::V1::ListDatacenterConnectorsRequest.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_datacenter_connectors_client_stub.call_rpc_count - end - end - - def test_get_datacenter_connector - # Create GRPC objects. - grpc_response = ::Google::Cloud::VMMigration::V1::DatacenterConnector.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_datacenter_connector_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_datacenter_connector, name - assert_kind_of ::Google::Cloud::VMMigration::V1::GetDatacenterConnectorRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_datacenter_connector_client_stub do - # Create client - client = ::Google::Cloud::VMMigration::V1::VMMigration::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_datacenter_connector({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_datacenter_connector name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_datacenter_connector ::Google::Cloud::VMMigration::V1::GetDatacenterConnectorRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_datacenter_connector({ 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_datacenter_connector(::Google::Cloud::VMMigration::V1::GetDatacenterConnectorRequest.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_datacenter_connector_client_stub.call_rpc_count - end - end - - def test_create_datacenter_connector - # 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" - datacenter_connector_id = "hello world" - datacenter_connector = {} - request_id = "hello world" - - create_datacenter_connector_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_datacenter_connector, name - assert_kind_of ::Google::Cloud::VMMigration::V1::CreateDatacenterConnectorRequest, request - assert_equal "hello world", request["parent"] - assert_equal "hello world", request["datacenter_connector_id"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::VMMigration::V1::DatacenterConnector), request["datacenter_connector"] - assert_equal "hello world", request["request_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_datacenter_connector_client_stub do - # Create client - client = ::Google::Cloud::VMMigration::V1::VMMigration::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_datacenter_connector({ parent: parent, datacenter_connector_id: datacenter_connector_id, datacenter_connector: datacenter_connector, request_id: request_id }) 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_datacenter_connector parent: parent, datacenter_connector_id: datacenter_connector_id, datacenter_connector: datacenter_connector, request_id: request_id 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_datacenter_connector ::Google::Cloud::VMMigration::V1::CreateDatacenterConnectorRequest.new(parent: parent, datacenter_connector_id: datacenter_connector_id, datacenter_connector: datacenter_connector, request_id: request_id) 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_datacenter_connector({ parent: parent, datacenter_connector_id: datacenter_connector_id, datacenter_connector: datacenter_connector, request_id: request_id }, 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_datacenter_connector(::Google::Cloud::VMMigration::V1::CreateDatacenterConnectorRequest.new(parent: parent, datacenter_connector_id: datacenter_connector_id, datacenter_connector: datacenter_connector, request_id: request_id), 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_datacenter_connector_client_stub.call_rpc_count - end - end - - def test_delete_datacenter_connector - # 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" - request_id = "hello world" - - delete_datacenter_connector_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_datacenter_connector, name - assert_kind_of ::Google::Cloud::VMMigration::V1::DeleteDatacenterConnectorRequest, request - assert_equal "hello world", request["name"] - assert_equal "hello world", request["request_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_datacenter_connector_client_stub do - # Create client - client = ::Google::Cloud::VMMigration::V1::VMMigration::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_datacenter_connector({ name: name, request_id: request_id }) 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_datacenter_connector name: name, request_id: request_id 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_datacenter_connector ::Google::Cloud::VMMigration::V1::DeleteDatacenterConnectorRequest.new(name: name, request_id: request_id) 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_datacenter_connector({ name: name, request_id: request_id }, 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_datacenter_connector(::Google::Cloud::VMMigration::V1::DeleteDatacenterConnectorRequest.new(name: name, request_id: request_id), 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_datacenter_connector_client_stub.call_rpc_count - end - end - - def test_upgrade_appliance - # 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. - datacenter_connector = "hello world" - request_id = "hello world" - - upgrade_appliance_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :upgrade_appliance, name - assert_kind_of ::Google::Cloud::VMMigration::V1::UpgradeApplianceRequest, request - assert_equal "hello world", request["datacenter_connector"] - assert_equal "hello world", request["request_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, upgrade_appliance_client_stub do - # Create client - client = ::Google::Cloud::VMMigration::V1::VMMigration::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.upgrade_appliance({ datacenter_connector: datacenter_connector, request_id: request_id }) 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.upgrade_appliance datacenter_connector: datacenter_connector, request_id: request_id 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.upgrade_appliance ::Google::Cloud::VMMigration::V1::UpgradeApplianceRequest.new(datacenter_connector: datacenter_connector, request_id: request_id) 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.upgrade_appliance({ datacenter_connector: datacenter_connector, request_id: request_id }, 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.upgrade_appliance(::Google::Cloud::VMMigration::V1::UpgradeApplianceRequest.new(datacenter_connector: datacenter_connector, request_id: request_id), 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, upgrade_appliance_client_stub.call_rpc_count - end - end - - def test_create_migrating_vm - # 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" - migrating_vm_id = "hello world" - migrating_vm = {} - request_id = "hello world" - - create_migrating_vm_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_migrating_vm, name - assert_kind_of ::Google::Cloud::VMMigration::V1::CreateMigratingVmRequest, request - assert_equal "hello world", request["parent"] - assert_equal "hello world", request["migrating_vm_id"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::VMMigration::V1::MigratingVm), request["migrating_vm"] - assert_equal "hello world", request["request_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_migrating_vm_client_stub do - # Create client - client = ::Google::Cloud::VMMigration::V1::VMMigration::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_migrating_vm({ parent: parent, migrating_vm_id: migrating_vm_id, migrating_vm: migrating_vm, request_id: request_id }) 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_migrating_vm parent: parent, migrating_vm_id: migrating_vm_id, migrating_vm: migrating_vm, request_id: request_id 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_migrating_vm ::Google::Cloud::VMMigration::V1::CreateMigratingVmRequest.new(parent: parent, migrating_vm_id: migrating_vm_id, migrating_vm: migrating_vm, request_id: request_id) 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_migrating_vm({ parent: parent, migrating_vm_id: migrating_vm_id, migrating_vm: migrating_vm, request_id: request_id }, 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_migrating_vm(::Google::Cloud::VMMigration::V1::CreateMigratingVmRequest.new(parent: parent, migrating_vm_id: migrating_vm_id, migrating_vm: migrating_vm, request_id: request_id), 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_migrating_vm_client_stub.call_rpc_count - end - end - - def test_list_migrating_vms - # Create GRPC objects. - grpc_response = ::Google::Cloud::VMMigration::V1::ListMigratingVmsResponse.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" - view = :MIGRATING_VM_VIEW_UNSPECIFIED - - list_migrating_vms_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_migrating_vms, name - assert_kind_of ::Google::Cloud::VMMigration::V1::ListMigratingVmsRequest, 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 :MIGRATING_VM_VIEW_UNSPECIFIED, request["view"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_migrating_vms_client_stub do - # Create client - client = ::Google::Cloud::VMMigration::V1::VMMigration::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_migrating_vms({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by, view: view }) 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_migrating_vms parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by, view: view 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_migrating_vms ::Google::Cloud::VMMigration::V1::ListMigratingVmsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by, view: view) 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_migrating_vms({ parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by, view: view }, 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_migrating_vms(::Google::Cloud::VMMigration::V1::ListMigratingVmsRequest.new(parent: parent, page_size: page_size, page_token: page_token, filter: filter, order_by: order_by, view: view), 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_migrating_vms_client_stub.call_rpc_count - end - end - - def test_get_migrating_vm - # Create GRPC objects. - grpc_response = ::Google::Cloud::VMMigration::V1::MigratingVm.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" - view = :MIGRATING_VM_VIEW_UNSPECIFIED - - get_migrating_vm_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_migrating_vm, name - assert_kind_of ::Google::Cloud::VMMigration::V1::GetMigratingVmRequest, request - assert_equal "hello world", request["name"] - assert_equal :MIGRATING_VM_VIEW_UNSPECIFIED, request["view"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_migrating_vm_client_stub do - # Create client - client = ::Google::Cloud::VMMigration::V1::VMMigration::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_migrating_vm({ name: name, view: view }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_migrating_vm name: name, view: view do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_migrating_vm ::Google::Cloud::VMMigration::V1::GetMigratingVmRequest.new(name: name, view: view) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_migrating_vm({ name: name, view: view }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_migrating_vm(::Google::Cloud::VMMigration::V1::GetMigratingVmRequest.new(name: name, view: view), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, get_migrating_vm_client_stub.call_rpc_count - end - end - - def test_update_migrating_vm - # 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. - update_mask = {} - migrating_vm = {} - request_id = "hello world" - - update_migrating_vm_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_migrating_vm, name - assert_kind_of ::Google::Cloud::VMMigration::V1::UpdateMigratingVmRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::VMMigration::V1::MigratingVm), request["migrating_vm"] - assert_equal "hello world", request["request_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_migrating_vm_client_stub do - # Create client - client = ::Google::Cloud::VMMigration::V1::VMMigration::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_migrating_vm({ update_mask: update_mask, migrating_vm: migrating_vm, request_id: request_id }) 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.update_migrating_vm update_mask: update_mask, migrating_vm: migrating_vm, request_id: request_id 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.update_migrating_vm ::Google::Cloud::VMMigration::V1::UpdateMigratingVmRequest.new(update_mask: update_mask, migrating_vm: migrating_vm, request_id: request_id) 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.update_migrating_vm({ update_mask: update_mask, migrating_vm: migrating_vm, request_id: request_id }, 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.update_migrating_vm(::Google::Cloud::VMMigration::V1::UpdateMigratingVmRequest.new(update_mask: update_mask, migrating_vm: migrating_vm, request_id: request_id), 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, update_migrating_vm_client_stub.call_rpc_count - end - end - - def test_delete_migrating_vm - # 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_migrating_vm_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_migrating_vm, name - assert_kind_of ::Google::Cloud::VMMigration::V1::DeleteMigratingVmRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_migrating_vm_client_stub do - # Create client - client = ::Google::Cloud::VMMigration::V1::VMMigration::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_migrating_vm({ 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_migrating_vm 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_migrating_vm ::Google::Cloud::VMMigration::V1::DeleteMigratingVmRequest.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_migrating_vm({ 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_migrating_vm(::Google::Cloud::VMMigration::V1::DeleteMigratingVmRequest.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_migrating_vm_client_stub.call_rpc_count - end - end - - def test_start_migration - # 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. - migrating_vm = "hello world" - - start_migration_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :start_migration, name - assert_kind_of ::Google::Cloud::VMMigration::V1::StartMigrationRequest, request - assert_equal "hello world", request["migrating_vm"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, start_migration_client_stub do - # Create client - client = ::Google::Cloud::VMMigration::V1::VMMigration::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.start_migration({ migrating_vm: migrating_vm }) 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.start_migration migrating_vm: migrating_vm 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.start_migration ::Google::Cloud::VMMigration::V1::StartMigrationRequest.new(migrating_vm: migrating_vm) 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.start_migration({ migrating_vm: migrating_vm }, 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.start_migration(::Google::Cloud::VMMigration::V1::StartMigrationRequest.new(migrating_vm: migrating_vm), 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, start_migration_client_stub.call_rpc_count - end - end - - def test_resume_migration - # 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. - migrating_vm = "hello world" - - resume_migration_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :resume_migration, name - assert_kind_of ::Google::Cloud::VMMigration::V1::ResumeMigrationRequest, request - assert_equal "hello world", request["migrating_vm"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, resume_migration_client_stub do - # Create client - client = ::Google::Cloud::VMMigration::V1::VMMigration::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.resume_migration({ migrating_vm: migrating_vm }) 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.resume_migration migrating_vm: migrating_vm 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.resume_migration ::Google::Cloud::VMMigration::V1::ResumeMigrationRequest.new(migrating_vm: migrating_vm) 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.resume_migration({ migrating_vm: migrating_vm }, 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.resume_migration(::Google::Cloud::VMMigration::V1::ResumeMigrationRequest.new(migrating_vm: migrating_vm), 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, resume_migration_client_stub.call_rpc_count - end - end - - def test_pause_migration - # 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. - migrating_vm = "hello world" - - pause_migration_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :pause_migration, name - assert_kind_of ::Google::Cloud::VMMigration::V1::PauseMigrationRequest, request - assert_equal "hello world", request["migrating_vm"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, pause_migration_client_stub do - # Create client - client = ::Google::Cloud::VMMigration::V1::VMMigration::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.pause_migration({ migrating_vm: migrating_vm }) 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.pause_migration migrating_vm: migrating_vm 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.pause_migration ::Google::Cloud::VMMigration::V1::PauseMigrationRequest.new(migrating_vm: migrating_vm) 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.pause_migration({ migrating_vm: migrating_vm }, 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.pause_migration(::Google::Cloud::VMMigration::V1::PauseMigrationRequest.new(migrating_vm: migrating_vm), 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, pause_migration_client_stub.call_rpc_count - end - end - - def test_finalize_migration - # 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. - migrating_vm = "hello world" - - finalize_migration_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :finalize_migration, name - assert_kind_of ::Google::Cloud::VMMigration::V1::FinalizeMigrationRequest, request - assert_equal "hello world", request["migrating_vm"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, finalize_migration_client_stub do - # Create client - client = ::Google::Cloud::VMMigration::V1::VMMigration::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.finalize_migration({ migrating_vm: migrating_vm }) 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.finalize_migration migrating_vm: migrating_vm 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.finalize_migration ::Google::Cloud::VMMigration::V1::FinalizeMigrationRequest.new(migrating_vm: migrating_vm) 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.finalize_migration({ migrating_vm: migrating_vm }, 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.finalize_migration(::Google::Cloud::VMMigration::V1::FinalizeMigrationRequest.new(migrating_vm: migrating_vm), 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, finalize_migration_client_stub.call_rpc_count - end - end - - def test_extend_migration - # 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. - migrating_vm = "hello world" - - extend_migration_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :extend_migration, name - assert_kind_of ::Google::Cloud::VMMigration::V1::ExtendMigrationRequest, request - assert_equal "hello world", request["migrating_vm"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, extend_migration_client_stub do - # Create client - client = ::Google::Cloud::VMMigration::V1::VMMigration::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.extend_migration({ migrating_vm: migrating_vm }) 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.extend_migration migrating_vm: migrating_vm 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.extend_migration ::Google::Cloud::VMMigration::V1::ExtendMigrationRequest.new(migrating_vm: migrating_vm) 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.extend_migration({ migrating_vm: migrating_vm }, 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.extend_migration(::Google::Cloud::VMMigration::V1::ExtendMigrationRequest.new(migrating_vm: migrating_vm), 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, extend_migration_client_stub.call_rpc_count - end - end - - def test_create_clone_job - # 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" - clone_job_id = "hello world" - clone_job = {} - request_id = "hello world" - - create_clone_job_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_clone_job, name - assert_kind_of ::Google::Cloud::VMMigration::V1::CreateCloneJobRequest, request - assert_equal "hello world", request["parent"] - assert_equal "hello world", request["clone_job_id"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::VMMigration::V1::CloneJob), request["clone_job"] - assert_equal "hello world", request["request_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_clone_job_client_stub do - # Create client - client = ::Google::Cloud::VMMigration::V1::VMMigration::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_clone_job({ parent: parent, clone_job_id: clone_job_id, clone_job: clone_job, request_id: request_id }) 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_clone_job parent: parent, clone_job_id: clone_job_id, clone_job: clone_job, request_id: request_id 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_clone_job ::Google::Cloud::VMMigration::V1::CreateCloneJobRequest.new(parent: parent, clone_job_id: clone_job_id, clone_job: clone_job, request_id: request_id) 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_clone_job({ parent: parent, clone_job_id: clone_job_id, clone_job: clone_job, request_id: request_id }, 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_clone_job(::Google::Cloud::VMMigration::V1::CreateCloneJobRequest.new(parent: parent, clone_job_id: clone_job_id, clone_job: clone_job, request_id: request_id), 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_clone_job_client_stub.call_rpc_count - end - end - - def test_cancel_clone_job - # 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" - - cancel_clone_job_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :cancel_clone_job, name - assert_kind_of ::Google::Cloud::VMMigration::V1::CancelCloneJobRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, cancel_clone_job_client_stub do - # Create client - client = ::Google::Cloud::VMMigration::V1::VMMigration::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.cancel_clone_job({ 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.cancel_clone_job 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.cancel_clone_job ::Google::Cloud::VMMigration::V1::CancelCloneJobRequest.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.cancel_clone_job({ 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.cancel_clone_job(::Google::Cloud::VMMigration::V1::CancelCloneJobRequest.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, cancel_clone_job_client_stub.call_rpc_count - end - end - - def test_list_clone_jobs - # Create GRPC objects. - grpc_response = ::Google::Cloud::VMMigration::V1::ListCloneJobsResponse.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_clone_jobs_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_clone_jobs, name - assert_kind_of ::Google::Cloud::VMMigration::V1::ListCloneJobsRequest, 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_clone_jobs_client_stub do - # Create client - client = ::Google::Cloud::VMMigration::V1::VMMigration::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_clone_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_clone_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_clone_jobs ::Google::Cloud::VMMigration::V1::ListCloneJobsRequest.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_clone_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_clone_jobs(::Google::Cloud::VMMigration::V1::ListCloneJobsRequest.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_clone_jobs_client_stub.call_rpc_count - end - end - - def test_get_clone_job - # Create GRPC objects. - grpc_response = ::Google::Cloud::VMMigration::V1::CloneJob.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_clone_job_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_clone_job, name - assert_kind_of ::Google::Cloud::VMMigration::V1::GetCloneJobRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_clone_job_client_stub do - # Create client - client = ::Google::Cloud::VMMigration::V1::VMMigration::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_clone_job({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_clone_job name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_clone_job ::Google::Cloud::VMMigration::V1::GetCloneJobRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_clone_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_clone_job(::Google::Cloud::VMMigration::V1::GetCloneJobRequest.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_clone_job_client_stub.call_rpc_count - end - end - - def test_create_cutover_job - # 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" - cutover_job_id = "hello world" - cutover_job = {} - request_id = "hello world" - - create_cutover_job_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_cutover_job, name - assert_kind_of ::Google::Cloud::VMMigration::V1::CreateCutoverJobRequest, request - assert_equal "hello world", request["parent"] - assert_equal "hello world", request["cutover_job_id"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::VMMigration::V1::CutoverJob), request["cutover_job"] - assert_equal "hello world", request["request_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_cutover_job_client_stub do - # Create client - client = ::Google::Cloud::VMMigration::V1::VMMigration::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_cutover_job({ parent: parent, cutover_job_id: cutover_job_id, cutover_job: cutover_job, request_id: request_id }) 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_cutover_job parent: parent, cutover_job_id: cutover_job_id, cutover_job: cutover_job, request_id: request_id 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_cutover_job ::Google::Cloud::VMMigration::V1::CreateCutoverJobRequest.new(parent: parent, cutover_job_id: cutover_job_id, cutover_job: cutover_job, request_id: request_id) 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_cutover_job({ parent: parent, cutover_job_id: cutover_job_id, cutover_job: cutover_job, request_id: request_id }, 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_cutover_job(::Google::Cloud::VMMigration::V1::CreateCutoverJobRequest.new(parent: parent, cutover_job_id: cutover_job_id, cutover_job: cutover_job, request_id: request_id), 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_cutover_job_client_stub.call_rpc_count - end - end - - def test_cancel_cutover_job - # 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" - - cancel_cutover_job_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :cancel_cutover_job, name - assert_kind_of ::Google::Cloud::VMMigration::V1::CancelCutoverJobRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, cancel_cutover_job_client_stub do - # Create client - client = ::Google::Cloud::VMMigration::V1::VMMigration::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.cancel_cutover_job({ 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.cancel_cutover_job 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.cancel_cutover_job ::Google::Cloud::VMMigration::V1::CancelCutoverJobRequest.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.cancel_cutover_job({ 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.cancel_cutover_job(::Google::Cloud::VMMigration::V1::CancelCutoverJobRequest.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, cancel_cutover_job_client_stub.call_rpc_count - end - end - - def test_list_cutover_jobs - # Create GRPC objects. - grpc_response = ::Google::Cloud::VMMigration::V1::ListCutoverJobsResponse.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_cutover_jobs_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_cutover_jobs, name - assert_kind_of ::Google::Cloud::VMMigration::V1::ListCutoverJobsRequest, 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_cutover_jobs_client_stub do - # Create client - client = ::Google::Cloud::VMMigration::V1::VMMigration::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_cutover_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_cutover_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_cutover_jobs ::Google::Cloud::VMMigration::V1::ListCutoverJobsRequest.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_cutover_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_cutover_jobs(::Google::Cloud::VMMigration::V1::ListCutoverJobsRequest.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_cutover_jobs_client_stub.call_rpc_count - end - end - - def test_get_cutover_job - # Create GRPC objects. - grpc_response = ::Google::Cloud::VMMigration::V1::CutoverJob.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_cutover_job_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_cutover_job, name - assert_kind_of ::Google::Cloud::VMMigration::V1::GetCutoverJobRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_cutover_job_client_stub do - # Create client - client = ::Google::Cloud::VMMigration::V1::VMMigration::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_cutover_job({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_cutover_job name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_cutover_job ::Google::Cloud::VMMigration::V1::GetCutoverJobRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_cutover_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_cutover_job(::Google::Cloud::VMMigration::V1::GetCutoverJobRequest.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_cutover_job_client_stub.call_rpc_count - end - end - - def test_list_groups - # Create GRPC objects. - grpc_response = ::Google::Cloud::VMMigration::V1::ListGroupsResponse.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_groups_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_groups, name - assert_kind_of ::Google::Cloud::VMMigration::V1::ListGroupsRequest, 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_groups_client_stub do - # Create client - client = ::Google::Cloud::VMMigration::V1::VMMigration::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_groups({ 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_groups 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_groups ::Google::Cloud::VMMigration::V1::ListGroupsRequest.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_groups({ 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_groups(::Google::Cloud::VMMigration::V1::ListGroupsRequest.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_groups_client_stub.call_rpc_count - end - end - - def test_get_group - # Create GRPC objects. - grpc_response = ::Google::Cloud::VMMigration::V1::Group.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_group_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_group, name - assert_kind_of ::Google::Cloud::VMMigration::V1::GetGroupRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_group_client_stub do - # Create client - client = ::Google::Cloud::VMMigration::V1::VMMigration::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_group({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_group name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_group ::Google::Cloud::VMMigration::V1::GetGroupRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_group({ 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_group(::Google::Cloud::VMMigration::V1::GetGroupRequest.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_group_client_stub.call_rpc_count - end - end - - def test_create_group - # 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" - group_id = "hello world" - group = {} - request_id = "hello world" - - create_group_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_group, name - assert_kind_of ::Google::Cloud::VMMigration::V1::CreateGroupRequest, request - assert_equal "hello world", request["parent"] - assert_equal "hello world", request["group_id"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::VMMigration::V1::Group), request["group"] - assert_equal "hello world", request["request_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_group_client_stub do - # Create client - client = ::Google::Cloud::VMMigration::V1::VMMigration::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_group({ parent: parent, group_id: group_id, group: group, request_id: request_id }) 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_group parent: parent, group_id: group_id, group: group, request_id: request_id 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_group ::Google::Cloud::VMMigration::V1::CreateGroupRequest.new(parent: parent, group_id: group_id, group: group, request_id: request_id) 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_group({ parent: parent, group_id: group_id, group: group, request_id: request_id }, 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_group(::Google::Cloud::VMMigration::V1::CreateGroupRequest.new(parent: parent, group_id: group_id, group: group, request_id: request_id), 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_group_client_stub.call_rpc_count - end - end - - def test_update_group - # 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. - update_mask = {} - group = {} - request_id = "hello world" - - update_group_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_group, name - assert_kind_of ::Google::Cloud::VMMigration::V1::UpdateGroupRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::VMMigration::V1::Group), request["group"] - assert_equal "hello world", request["request_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_group_client_stub do - # Create client - client = ::Google::Cloud::VMMigration::V1::VMMigration::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_group({ update_mask: update_mask, group: group, request_id: request_id }) 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.update_group update_mask: update_mask, group: group, request_id: request_id 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.update_group ::Google::Cloud::VMMigration::V1::UpdateGroupRequest.new(update_mask: update_mask, group: group, request_id: request_id) 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.update_group({ update_mask: update_mask, group: group, request_id: request_id }, 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.update_group(::Google::Cloud::VMMigration::V1::UpdateGroupRequest.new(update_mask: update_mask, group: group, request_id: request_id), 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, update_group_client_stub.call_rpc_count - end - end - - def test_delete_group - # 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" - request_id = "hello world" - - delete_group_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_group, name - assert_kind_of ::Google::Cloud::VMMigration::V1::DeleteGroupRequest, request - assert_equal "hello world", request["name"] - assert_equal "hello world", request["request_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_group_client_stub do - # Create client - client = ::Google::Cloud::VMMigration::V1::VMMigration::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_group({ name: name, request_id: request_id }) 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_group name: name, request_id: request_id 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_group ::Google::Cloud::VMMigration::V1::DeleteGroupRequest.new(name: name, request_id: request_id) 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_group({ name: name, request_id: request_id }, 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_group(::Google::Cloud::VMMigration::V1::DeleteGroupRequest.new(name: name, request_id: request_id), 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_group_client_stub.call_rpc_count - end - end - - def test_add_group_migration - # 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. - group = "hello world" - migrating_vm = "hello world" - - add_group_migration_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :add_group_migration, name - assert_kind_of ::Google::Cloud::VMMigration::V1::AddGroupMigrationRequest, request - assert_equal "hello world", request["group"] - assert_equal "hello world", request["migrating_vm"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, add_group_migration_client_stub do - # Create client - client = ::Google::Cloud::VMMigration::V1::VMMigration::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.add_group_migration({ group: group, migrating_vm: migrating_vm }) 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.add_group_migration group: group, migrating_vm: migrating_vm 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.add_group_migration ::Google::Cloud::VMMigration::V1::AddGroupMigrationRequest.new(group: group, migrating_vm: migrating_vm) 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.add_group_migration({ group: group, migrating_vm: migrating_vm }, 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.add_group_migration(::Google::Cloud::VMMigration::V1::AddGroupMigrationRequest.new(group: group, migrating_vm: migrating_vm), 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, add_group_migration_client_stub.call_rpc_count - end - end - - def test_remove_group_migration - # 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. - group = "hello world" - migrating_vm = "hello world" - - remove_group_migration_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :remove_group_migration, name - assert_kind_of ::Google::Cloud::VMMigration::V1::RemoveGroupMigrationRequest, request - assert_equal "hello world", request["group"] - assert_equal "hello world", request["migrating_vm"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, remove_group_migration_client_stub do - # Create client - client = ::Google::Cloud::VMMigration::V1::VMMigration::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.remove_group_migration({ group: group, migrating_vm: migrating_vm }) 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.remove_group_migration group: group, migrating_vm: migrating_vm 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.remove_group_migration ::Google::Cloud::VMMigration::V1::RemoveGroupMigrationRequest.new(group: group, migrating_vm: migrating_vm) 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.remove_group_migration({ group: group, migrating_vm: migrating_vm }, 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.remove_group_migration(::Google::Cloud::VMMigration::V1::RemoveGroupMigrationRequest.new(group: group, migrating_vm: migrating_vm), 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, remove_group_migration_client_stub.call_rpc_count - end - end - - def test_list_target_projects - # Create GRPC objects. - grpc_response = ::Google::Cloud::VMMigration::V1::ListTargetProjectsResponse.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_target_projects_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_target_projects, name - assert_kind_of ::Google::Cloud::VMMigration::V1::ListTargetProjectsRequest, 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_target_projects_client_stub do - # Create client - client = ::Google::Cloud::VMMigration::V1::VMMigration::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_target_projects({ 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_target_projects 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_target_projects ::Google::Cloud::VMMigration::V1::ListTargetProjectsRequest.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_target_projects({ 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_target_projects(::Google::Cloud::VMMigration::V1::ListTargetProjectsRequest.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_target_projects_client_stub.call_rpc_count - end - end - - def test_get_target_project - # Create GRPC objects. - grpc_response = ::Google::Cloud::VMMigration::V1::TargetProject.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_target_project_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_target_project, name - assert_kind_of ::Google::Cloud::VMMigration::V1::GetTargetProjectRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_target_project_client_stub do - # Create client - client = ::Google::Cloud::VMMigration::V1::VMMigration::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_target_project({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_target_project name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_target_project ::Google::Cloud::VMMigration::V1::GetTargetProjectRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_target_project({ 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_target_project(::Google::Cloud::VMMigration::V1::GetTargetProjectRequest.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_target_project_client_stub.call_rpc_count - end - end - - def test_create_target_project - # 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" - target_project_id = "hello world" - target_project = {} - request_id = "hello world" - - create_target_project_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_target_project, name - assert_kind_of ::Google::Cloud::VMMigration::V1::CreateTargetProjectRequest, request - assert_equal "hello world", request["parent"] - assert_equal "hello world", request["target_project_id"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::VMMigration::V1::TargetProject), request["target_project"] - assert_equal "hello world", request["request_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_target_project_client_stub do - # Create client - client = ::Google::Cloud::VMMigration::V1::VMMigration::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_target_project({ parent: parent, target_project_id: target_project_id, target_project: target_project, request_id: request_id }) 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_target_project parent: parent, target_project_id: target_project_id, target_project: target_project, request_id: request_id 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_target_project ::Google::Cloud::VMMigration::V1::CreateTargetProjectRequest.new(parent: parent, target_project_id: target_project_id, target_project: target_project, request_id: request_id) 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_target_project({ parent: parent, target_project_id: target_project_id, target_project: target_project, request_id: request_id }, 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_target_project(::Google::Cloud::VMMigration::V1::CreateTargetProjectRequest.new(parent: parent, target_project_id: target_project_id, target_project: target_project, request_id: request_id), 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_target_project_client_stub.call_rpc_count - end - end - - def test_update_target_project - # 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. - update_mask = {} - target_project = {} - request_id = "hello world" - - update_target_project_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_target_project, name - assert_kind_of ::Google::Cloud::VMMigration::V1::UpdateTargetProjectRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::VMMigration::V1::TargetProject), request["target_project"] - assert_equal "hello world", request["request_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_target_project_client_stub do - # Create client - client = ::Google::Cloud::VMMigration::V1::VMMigration::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_target_project({ update_mask: update_mask, target_project: target_project, request_id: request_id }) 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.update_target_project update_mask: update_mask, target_project: target_project, request_id: request_id 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.update_target_project ::Google::Cloud::VMMigration::V1::UpdateTargetProjectRequest.new(update_mask: update_mask, target_project: target_project, request_id: request_id) 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.update_target_project({ update_mask: update_mask, target_project: target_project, request_id: request_id }, 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.update_target_project(::Google::Cloud::VMMigration::V1::UpdateTargetProjectRequest.new(update_mask: update_mask, target_project: target_project, request_id: request_id), 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, update_target_project_client_stub.call_rpc_count - end - end - - def test_delete_target_project - # 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" - request_id = "hello world" - - delete_target_project_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_target_project, name - assert_kind_of ::Google::Cloud::VMMigration::V1::DeleteTargetProjectRequest, request - assert_equal "hello world", request["name"] - assert_equal "hello world", request["request_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_target_project_client_stub do - # Create client - client = ::Google::Cloud::VMMigration::V1::VMMigration::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_target_project({ name: name, request_id: request_id }) 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_target_project name: name, request_id: request_id 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_target_project ::Google::Cloud::VMMigration::V1::DeleteTargetProjectRequest.new(name: name, request_id: request_id) 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_target_project({ name: name, request_id: request_id }, 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_target_project(::Google::Cloud::VMMigration::V1::DeleteTargetProjectRequest.new(name: name, request_id: request_id), 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_target_project_client_stub.call_rpc_count - end - end - - def test_list_replication_cycles - # Create GRPC objects. - grpc_response = ::Google::Cloud::VMMigration::V1::ListReplicationCyclesResponse.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_replication_cycles_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_replication_cycles, name - assert_kind_of ::Google::Cloud::VMMigration::V1::ListReplicationCyclesRequest, 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_replication_cycles_client_stub do - # Create client - client = ::Google::Cloud::VMMigration::V1::VMMigration::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_replication_cycles({ 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_replication_cycles 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_replication_cycles ::Google::Cloud::VMMigration::V1::ListReplicationCyclesRequest.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_replication_cycles({ 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_replication_cycles(::Google::Cloud::VMMigration::V1::ListReplicationCyclesRequest.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_replication_cycles_client_stub.call_rpc_count - end - end - - def test_get_replication_cycle - # Create GRPC objects. - grpc_response = ::Google::Cloud::VMMigration::V1::ReplicationCycle.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_replication_cycle_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_replication_cycle, name - assert_kind_of ::Google::Cloud::VMMigration::V1::GetReplicationCycleRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_replication_cycle_client_stub do - # Create client - client = ::Google::Cloud::VMMigration::V1::VMMigration::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_replication_cycle({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_replication_cycle name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_replication_cycle ::Google::Cloud::VMMigration::V1::GetReplicationCycleRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_replication_cycle({ 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_replication_cycle(::Google::Cloud::VMMigration::V1::GetReplicationCycleRequest.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_replication_cycle_client_stub.call_rpc_count - end - end - - def test_list_image_imports - # Create GRPC objects. - grpc_response = ::Google::Cloud::VMMigration::V1::ListImageImportsResponse.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_image_imports_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_image_imports, name - assert_kind_of ::Google::Cloud::VMMigration::V1::ListImageImportsRequest, 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_image_imports_client_stub do - # Create client - client = ::Google::Cloud::VMMigration::V1::VMMigration::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_image_imports({ 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_image_imports 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_image_imports ::Google::Cloud::VMMigration::V1::ListImageImportsRequest.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_image_imports({ 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_image_imports(::Google::Cloud::VMMigration::V1::ListImageImportsRequest.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_image_imports_client_stub.call_rpc_count - end - end - - def test_get_image_import - # Create GRPC objects. - grpc_response = ::Google::Cloud::VMMigration::V1::ImageImport.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_image_import_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_image_import, name - assert_kind_of ::Google::Cloud::VMMigration::V1::GetImageImportRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_image_import_client_stub do - # Create client - client = ::Google::Cloud::VMMigration::V1::VMMigration::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_image_import({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_image_import name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_image_import ::Google::Cloud::VMMigration::V1::GetImageImportRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_image_import({ 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_image_import(::Google::Cloud::VMMigration::V1::GetImageImportRequest.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_image_import_client_stub.call_rpc_count - end - end - - def test_create_image_import - # 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" - image_import_id = "hello world" - image_import = {} - request_id = "hello world" - - create_image_import_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_image_import, name - assert_kind_of ::Google::Cloud::VMMigration::V1::CreateImageImportRequest, request - assert_equal "hello world", request["parent"] - assert_equal "hello world", request["image_import_id"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::VMMigration::V1::ImageImport), request["image_import"] - assert_equal "hello world", request["request_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_image_import_client_stub do - # Create client - client = ::Google::Cloud::VMMigration::V1::VMMigration::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_image_import({ parent: parent, image_import_id: image_import_id, image_import: image_import, request_id: request_id }) 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_image_import parent: parent, image_import_id: image_import_id, image_import: image_import, request_id: request_id 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_image_import ::Google::Cloud::VMMigration::V1::CreateImageImportRequest.new(parent: parent, image_import_id: image_import_id, image_import: image_import, request_id: request_id) 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_image_import({ parent: parent, image_import_id: image_import_id, image_import: image_import, request_id: request_id }, 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_image_import(::Google::Cloud::VMMigration::V1::CreateImageImportRequest.new(parent: parent, image_import_id: image_import_id, image_import: image_import, request_id: request_id), 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_image_import_client_stub.call_rpc_count - end - end - - def test_delete_image_import - # 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" - request_id = "hello world" - - delete_image_import_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_image_import, name - assert_kind_of ::Google::Cloud::VMMigration::V1::DeleteImageImportRequest, request - assert_equal "hello world", request["name"] - assert_equal "hello world", request["request_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_image_import_client_stub do - # Create client - client = ::Google::Cloud::VMMigration::V1::VMMigration::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_image_import({ name: name, request_id: request_id }) 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_image_import name: name, request_id: request_id 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_image_import ::Google::Cloud::VMMigration::V1::DeleteImageImportRequest.new(name: name, request_id: request_id) 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_image_import({ name: name, request_id: request_id }, 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_image_import(::Google::Cloud::VMMigration::V1::DeleteImageImportRequest.new(name: name, request_id: request_id), 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_image_import_client_stub.call_rpc_count - end - end - - def test_list_image_import_jobs - # Create GRPC objects. - grpc_response = ::Google::Cloud::VMMigration::V1::ListImageImportJobsResponse.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_image_import_jobs_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_image_import_jobs, name - assert_kind_of ::Google::Cloud::VMMigration::V1::ListImageImportJobsRequest, 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_image_import_jobs_client_stub do - # Create client - client = ::Google::Cloud::VMMigration::V1::VMMigration::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_image_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_image_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_image_import_jobs ::Google::Cloud::VMMigration::V1::ListImageImportJobsRequest.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_image_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_image_import_jobs(::Google::Cloud::VMMigration::V1::ListImageImportJobsRequest.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_image_import_jobs_client_stub.call_rpc_count - end - end - - def test_get_image_import_job - # Create GRPC objects. - grpc_response = ::Google::Cloud::VMMigration::V1::ImageImportJob.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_image_import_job_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_image_import_job, name - assert_kind_of ::Google::Cloud::VMMigration::V1::GetImageImportJobRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_image_import_job_client_stub do - # Create client - client = ::Google::Cloud::VMMigration::V1::VMMigration::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_image_import_job({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_image_import_job name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_image_import_job ::Google::Cloud::VMMigration::V1::GetImageImportJobRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_image_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_image_import_job(::Google::Cloud::VMMigration::V1::GetImageImportJobRequest.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_image_import_job_client_stub.call_rpc_count - end - end - - def test_cancel_image_import_job - # 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" - - cancel_image_import_job_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :cancel_image_import_job, name - assert_kind_of ::Google::Cloud::VMMigration::V1::CancelImageImportJobRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, cancel_image_import_job_client_stub do - # Create client - client = ::Google::Cloud::VMMigration::V1::VMMigration::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.cancel_image_import_job({ 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.cancel_image_import_job 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.cancel_image_import_job ::Google::Cloud::VMMigration::V1::CancelImageImportJobRequest.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.cancel_image_import_job({ 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.cancel_image_import_job(::Google::Cloud::VMMigration::V1::CancelImageImportJobRequest.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, cancel_image_import_job_client_stub.call_rpc_count - end - end - - def test_create_disk_migration_job - # 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" - disk_migration_job_id = "hello world" - disk_migration_job = {} - request_id = "hello world" - - create_disk_migration_job_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_disk_migration_job, name - assert_kind_of ::Google::Cloud::VMMigration::V1::CreateDiskMigrationJobRequest, request - assert_equal "hello world", request["parent"] - assert_equal "hello world", request["disk_migration_job_id"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::VMMigration::V1::DiskMigrationJob), request["disk_migration_job"] - assert_equal "hello world", request["request_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_disk_migration_job_client_stub do - # Create client - client = ::Google::Cloud::VMMigration::V1::VMMigration::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_disk_migration_job({ parent: parent, disk_migration_job_id: disk_migration_job_id, disk_migration_job: disk_migration_job, request_id: request_id }) 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_disk_migration_job parent: parent, disk_migration_job_id: disk_migration_job_id, disk_migration_job: disk_migration_job, request_id: request_id 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_disk_migration_job ::Google::Cloud::VMMigration::V1::CreateDiskMigrationJobRequest.new(parent: parent, disk_migration_job_id: disk_migration_job_id, disk_migration_job: disk_migration_job, request_id: request_id) 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_disk_migration_job({ parent: parent, disk_migration_job_id: disk_migration_job_id, disk_migration_job: disk_migration_job, request_id: request_id }, 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_disk_migration_job(::Google::Cloud::VMMigration::V1::CreateDiskMigrationJobRequest.new(parent: parent, disk_migration_job_id: disk_migration_job_id, disk_migration_job: disk_migration_job, request_id: request_id), 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_disk_migration_job_client_stub.call_rpc_count - end - end - - def test_list_disk_migration_jobs - # Create GRPC objects. - grpc_response = ::Google::Cloud::VMMigration::V1::ListDiskMigrationJobsResponse.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_disk_migration_jobs_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_disk_migration_jobs, name - assert_kind_of ::Google::Cloud::VMMigration::V1::ListDiskMigrationJobsRequest, 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_disk_migration_jobs_client_stub do - # Create client - client = ::Google::Cloud::VMMigration::V1::VMMigration::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_disk_migration_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_disk_migration_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_disk_migration_jobs ::Google::Cloud::VMMigration::V1::ListDiskMigrationJobsRequest.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_disk_migration_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_disk_migration_jobs(::Google::Cloud::VMMigration::V1::ListDiskMigrationJobsRequest.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_disk_migration_jobs_client_stub.call_rpc_count - end - end - - def test_get_disk_migration_job - # Create GRPC objects. - grpc_response = ::Google::Cloud::VMMigration::V1::DiskMigrationJob.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_disk_migration_job_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_disk_migration_job, name - assert_kind_of ::Google::Cloud::VMMigration::V1::GetDiskMigrationJobRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_disk_migration_job_client_stub do - # Create client - client = ::Google::Cloud::VMMigration::V1::VMMigration::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_disk_migration_job({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_disk_migration_job name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_disk_migration_job ::Google::Cloud::VMMigration::V1::GetDiskMigrationJobRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_disk_migration_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_disk_migration_job(::Google::Cloud::VMMigration::V1::GetDiskMigrationJobRequest.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_disk_migration_job_client_stub.call_rpc_count - end - end - - def test_update_disk_migration_job - # 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. - update_mask = {} - disk_migration_job = {} - request_id = "hello world" - - update_disk_migration_job_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_disk_migration_job, name - assert_kind_of ::Google::Cloud::VMMigration::V1::UpdateDiskMigrationJobRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::VMMigration::V1::DiskMigrationJob), request["disk_migration_job"] - assert_equal "hello world", request["request_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_disk_migration_job_client_stub do - # Create client - client = ::Google::Cloud::VMMigration::V1::VMMigration::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_disk_migration_job({ update_mask: update_mask, disk_migration_job: disk_migration_job, request_id: request_id }) 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.update_disk_migration_job update_mask: update_mask, disk_migration_job: disk_migration_job, request_id: request_id 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.update_disk_migration_job ::Google::Cloud::VMMigration::V1::UpdateDiskMigrationJobRequest.new(update_mask: update_mask, disk_migration_job: disk_migration_job, request_id: request_id) 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.update_disk_migration_job({ update_mask: update_mask, disk_migration_job: disk_migration_job, request_id: request_id }, 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.update_disk_migration_job(::Google::Cloud::VMMigration::V1::UpdateDiskMigrationJobRequest.new(update_mask: update_mask, disk_migration_job: disk_migration_job, request_id: request_id), 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, update_disk_migration_job_client_stub.call_rpc_count - end - end - - def test_delete_disk_migration_job - # 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_disk_migration_job_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_disk_migration_job, name - assert_kind_of ::Google::Cloud::VMMigration::V1::DeleteDiskMigrationJobRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_disk_migration_job_client_stub do - # Create client - client = ::Google::Cloud::VMMigration::V1::VMMigration::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_disk_migration_job({ 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_disk_migration_job 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_disk_migration_job ::Google::Cloud::VMMigration::V1::DeleteDiskMigrationJobRequest.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_disk_migration_job({ 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_disk_migration_job(::Google::Cloud::VMMigration::V1::DeleteDiskMigrationJobRequest.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_disk_migration_job_client_stub.call_rpc_count - end - end - - def test_run_disk_migration_job - # 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" - - run_disk_migration_job_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :run_disk_migration_job, name - assert_kind_of ::Google::Cloud::VMMigration::V1::RunDiskMigrationJobRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, run_disk_migration_job_client_stub do - # Create client - client = ::Google::Cloud::VMMigration::V1::VMMigration::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.run_disk_migration_job({ 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.run_disk_migration_job 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.run_disk_migration_job ::Google::Cloud::VMMigration::V1::RunDiskMigrationJobRequest.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.run_disk_migration_job({ 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.run_disk_migration_job(::Google::Cloud::VMMigration::V1::RunDiskMigrationJobRequest.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, run_disk_migration_job_client_stub.call_rpc_count - end - end - - def test_cancel_disk_migration_job - # 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" - - cancel_disk_migration_job_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :cancel_disk_migration_job, name - assert_kind_of ::Google::Cloud::VMMigration::V1::CancelDiskMigrationJobRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, cancel_disk_migration_job_client_stub do - # Create client - client = ::Google::Cloud::VMMigration::V1::VMMigration::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.cancel_disk_migration_job({ 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.cancel_disk_migration_job 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.cancel_disk_migration_job ::Google::Cloud::VMMigration::V1::CancelDiskMigrationJobRequest.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.cancel_disk_migration_job({ 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.cancel_disk_migration_job(::Google::Cloud::VMMigration::V1::CancelDiskMigrationJobRequest.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, cancel_disk_migration_job_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::VMMigration::V1::VMMigration::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::VMMigration::V1::VMMigration::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::VMMigration::V1::VMMigration::Client.new do |config| - config.credentials = creds - end - assert_kind_of ::Google::Cloud::VMMigration::V1::VMMigration::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::VMMigration::V1::VMMigration::Client.new do |config| - config.credentials = grpc_channel - end - end - - assert_kind_of ::Google::Cloud::VMMigration::V1::VMMigration::Operations, client.operations_client - end -end diff --git a/owl-bot-staging/google-cloud-vm_migration-v1/test/google/iam/v1/iam_policy_rest_test.rb b/owl-bot-staging/google-cloud-vm_migration-v1/test/google/iam/v1/iam_policy_rest_test.rb deleted file mode 100644 index 5872de89cd6b..000000000000 --- a/owl-bot-staging/google-cloud-vm_migration-v1/test/google/iam/v1/iam_policy_rest_test.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 "helper" -require "gapic/rest" -require "google/iam/v1/iam_policy_pb" -require "google/iam/v1/iam_policy/rest" - - -class ::Google::Iam::V1::IAMPolicy::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_set_iam_policy - # Create test objects. - client_result = ::Google::Iam::V1::Policy.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - resource = "hello world" - policy = {} - update_mask = {} - - set_iam_policy_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::Iam::V1::IAMPolicy::Rest::ServiceStub.stub :transcode_set_iam_policy_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, set_iam_policy_client_stub do - # Create client - client = ::Google::Iam::V1::IAMPolicy::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.set_iam_policy({ resource: resource, policy: policy, update_mask: update_mask }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.set_iam_policy resource: resource, policy: policy, update_mask: update_mask do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.set_iam_policy ::Google::Iam::V1::SetIamPolicyRequest.new(resource: resource, policy: policy, update_mask: update_mask) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.set_iam_policy({ resource: resource, policy: policy, update_mask: update_mask }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.set_iam_policy(::Google::Iam::V1::SetIamPolicyRequest.new(resource: resource, policy: policy, update_mask: update_mask), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, set_iam_policy_client_stub.call_count - end - end - end - - def test_get_iam_policy - # Create test objects. - client_result = ::Google::Iam::V1::Policy.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - resource = "hello world" - options = {} - - get_iam_policy_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::Iam::V1::IAMPolicy::Rest::ServiceStub.stub :transcode_get_iam_policy_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_iam_policy_client_stub do - # Create client - client = ::Google::Iam::V1::IAMPolicy::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_iam_policy({ resource: resource, options: options }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_iam_policy resource: resource, options: options do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_iam_policy ::Google::Iam::V1::GetIamPolicyRequest.new(resource: resource, options: options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_iam_policy({ resource: resource, options: options }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_iam_policy(::Google::Iam::V1::GetIamPolicyRequest.new(resource: resource, options: options), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_iam_policy_client_stub.call_count - end - end - end - - def test_test_iam_permissions - # Create test objects. - client_result = ::Google::Iam::V1::TestIamPermissionsResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - resource = "hello world" - permissions = ["hello world"] - - test_iam_permissions_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::Iam::V1::IAMPolicy::Rest::ServiceStub.stub :transcode_test_iam_permissions_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, test_iam_permissions_client_stub do - # Create client - client = ::Google::Iam::V1::IAMPolicy::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.test_iam_permissions({ resource: resource, permissions: permissions }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.test_iam_permissions resource: resource, permissions: permissions do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.test_iam_permissions ::Google::Iam::V1::TestIamPermissionsRequest.new(resource: resource, permissions: permissions) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.test_iam_permissions({ resource: resource, permissions: permissions }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.test_iam_permissions(::Google::Iam::V1::TestIamPermissionsRequest.new(resource: resource, permissions: permissions), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, test_iam_permissions_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::Iam::V1::IAMPolicy::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::Iam::V1::IAMPolicy::Rest::Client::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-vm_migration-v1/test/google/iam/v1/iam_policy_test.rb b/owl-bot-staging/google-cloud-vm_migration-v1/test/google/iam/v1/iam_policy_test.rb deleted file mode 100644 index fbfb3e8939bd..000000000000 --- a/owl-bot-staging/google-cloud-vm_migration-v1/test/google/iam/v1/iam_policy_test.rb +++ /dev/null @@ -1,286 +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/iam/v1/iam_policy_pb" -require "google/iam/v1/iam_policy" - -class ::Google::Iam::V1::IAMPolicy::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_set_iam_policy - # Create GRPC objects. - grpc_response = ::Google::Iam::V1::Policy.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. - resource = "hello world" - policy = {} - update_mask = {} - - set_iam_policy_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :set_iam_policy, name - assert_kind_of ::Google::Iam::V1::SetIamPolicyRequest, request - assert_equal "hello world", request["resource"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Iam::V1::Policy), request["policy"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, set_iam_policy_client_stub do - # Create client - client = ::Google::Iam::V1::IAMPolicy::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.set_iam_policy({ resource: resource, policy: policy, update_mask: update_mask }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.set_iam_policy resource: resource, policy: policy, update_mask: update_mask do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.set_iam_policy ::Google::Iam::V1::SetIamPolicyRequest.new(resource: resource, policy: policy, update_mask: update_mask) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.set_iam_policy({ resource: resource, policy: policy, 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.set_iam_policy(::Google::Iam::V1::SetIamPolicyRequest.new(resource: resource, policy: policy, 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, set_iam_policy_client_stub.call_rpc_count - end - end - - def test_get_iam_policy - # Create GRPC objects. - grpc_response = ::Google::Iam::V1::Policy.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. - resource = "hello world" - options = {} - - get_iam_policy_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_iam_policy, name - assert_kind_of ::Google::Iam::V1::GetIamPolicyRequest, request - assert_equal "hello world", request["resource"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Iam::V1::GetPolicyOptions), request["options"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_iam_policy_client_stub do - # Create client - client = ::Google::Iam::V1::IAMPolicy::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_iam_policy({ resource: resource, options: options }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_iam_policy resource: resource, options: options do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_iam_policy ::Google::Iam::V1::GetIamPolicyRequest.new(resource: resource, options: options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_iam_policy({ resource: resource, options: options }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_iam_policy(::Google::Iam::V1::GetIamPolicyRequest.new(resource: resource, options: options), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, get_iam_policy_client_stub.call_rpc_count - end - end - - def test_test_iam_permissions - # Create GRPC objects. - grpc_response = ::Google::Iam::V1::TestIamPermissionsResponse.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. - resource = "hello world" - permissions = ["hello world"] - - test_iam_permissions_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :test_iam_permissions, name - assert_kind_of ::Google::Iam::V1::TestIamPermissionsRequest, request - assert_equal "hello world", request["resource"] - assert_equal ["hello world"], request["permissions"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, test_iam_permissions_client_stub do - # Create client - client = ::Google::Iam::V1::IAMPolicy::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.test_iam_permissions({ resource: resource, permissions: permissions }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.test_iam_permissions resource: resource, permissions: permissions do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.test_iam_permissions ::Google::Iam::V1::TestIamPermissionsRequest.new(resource: resource, permissions: permissions) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.test_iam_permissions({ resource: resource, permissions: permissions }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.test_iam_permissions(::Google::Iam::V1::TestIamPermissionsRequest.new(resource: resource, permissions: permissions), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, test_iam_permissions_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::Iam::V1::IAMPolicy::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::Iam::V1::IAMPolicy::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::Iam::V1::IAMPolicy::Client.new do |config| - config.credentials = creds - end - assert_kind_of ::Google::Iam::V1::IAMPolicy::Client, client - assert_equal creds, client.configure.credentials - end - end -end diff --git a/owl-bot-staging/google-cloud-vm_migration-v1/test/helper.rb b/owl-bot-staging/google-cloud-vm_migration-v1/test/helper.rb deleted file mode 100644 index 672b337030e7..000000000000 --- a/owl-bot-staging/google-cloud-vm_migration-v1/test/helper.rb +++ /dev/null @@ -1,26 +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/mock" -require "minitest/rg" - -require "grpc" - -require "ostruct" diff --git a/owl-bot-staging/google-cloud-vmware_engine-v1/.gitignore b/owl-bot-staging/google-cloud-vmware_engine-v1/.gitignore deleted file mode 100644 index 0135b6bc6cfc..000000000000 --- a/owl-bot-staging/google-cloud-vmware_engine-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-vmware_engine-v1/.repo-metadata.json b/owl-bot-staging/google-cloud-vmware_engine-v1/.repo-metadata.json deleted file mode 100644 index d8fd8229f9bc..000000000000 --- a/owl-bot-staging/google-cloud-vmware_engine-v1/.repo-metadata.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "api_id": "vmwareengine.googleapis.com", - "api_shortname": "vmwareengine", - "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-vmware_engine-v1/latest", - "distribution_name": "google-cloud-vmware_engine-v1", - "is_cloud": true, - "language": "ruby", - "name": "vmwareengine", - "name_pretty": "Google Cloud VMware Engine V1 API", - "product_documentation": "https://cloud.google.com/vmware-engine/", - "release_level": "unreleased", - "repo": "googleapis/google-cloud-ruby", - "requires_billing": true, - "ruby-cloud-description": "Google Cloud VMware Engine is a fully managed service that lets you run the VMware platform in Google Cloud. VMware Engine provides you with VMware operational continuity so you can benefit from a cloud consumption model and lower your total cost of ownership. VMware Engine also offers on-demand provisioning, pay-as-you-grow, and capacity optimization. Note that google-cloud-vmware_engine-v1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-vmware_engine instead. See the readme for more details.", - "ruby-cloud-product-url": "https://cloud.google.com/vmware-engine/", - "library_type": "GAPIC_AUTO" -} diff --git a/owl-bot-staging/google-cloud-vmware_engine-v1/.rubocop.yml b/owl-bot-staging/google-cloud-vmware_engine-v1/.rubocop.yml deleted file mode 100644 index a4fe906d500e..000000000000 --- a/owl-bot-staging/google-cloud-vmware_engine-v1/.rubocop.yml +++ /dev/null @@ -1,33 +0,0 @@ -inherit_gem: - google-style: google-style.yml - -AllCops: - Exclude: - - "google-cloud-vmware_engine-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-vmware_engine-v1.rb" diff --git a/owl-bot-staging/google-cloud-vmware_engine-v1/.toys.rb b/owl-bot-staging/google-cloud-vmware_engine-v1/.toys.rb deleted file mode 100644 index 177e22456e8a..000000000000 --- a/owl-bot-staging/google-cloud-vmware_engine-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-vmware_engine-v1/.yardopts b/owl-bot-staging/google-cloud-vmware_engine-v1/.yardopts deleted file mode 100644 index 6d00e01349e8..000000000000 --- a/owl-bot-staging/google-cloud-vmware_engine-v1/.yardopts +++ /dev/null @@ -1,12 +0,0 @@ ---no-private ---title="Google Cloud VMware Engine 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-vmware_engine-v1/AUTHENTICATION.md b/owl-bot-staging/google-cloud-vmware_engine-v1/AUTHENTICATION.md deleted file mode 100644 index f30fd6722b36..000000000000 --- a/owl-bot-staging/google-cloud-vmware_engine-v1/AUTHENTICATION.md +++ /dev/null @@ -1,122 +0,0 @@ -# Authentication - -The recommended way to authenticate to the google-cloud-vmware_engine-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-vmware_engine-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/vmware_engine/v1" - -client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new do |config| - config.credentials = "path/to/credentialfile.json" -end -``` - -To configure a credentials file globally for all clients: - -```ruby -require "google/cloud/vmware_engine/v1" - -::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.configure do |config| - config.credentials = "path/to/credentialfile.json" -end - -client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::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-vmware_engine-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/vmware_engine/v1" - -ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" - -client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::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-vmware_engine-v1/CHANGELOG.md b/owl-bot-staging/google-cloud-vmware_engine-v1/CHANGELOG.md deleted file mode 100644 index f88957a62ba2..000000000000 --- a/owl-bot-staging/google-cloud-vmware_engine-v1/CHANGELOG.md +++ /dev/null @@ -1,2 +0,0 @@ -# Release History - diff --git a/owl-bot-staging/google-cloud-vmware_engine-v1/Gemfile b/owl-bot-staging/google-cloud-vmware_engine-v1/Gemfile deleted file mode 100644 index 1d08558908d8..000000000000 --- a/owl-bot-staging/google-cloud-vmware_engine-v1/Gemfile +++ /dev/null @@ -1,14 +0,0 @@ -source "https://rubygems.org" - -gemspec - -gem "google-style", "~> 1.32.0" -gem "irb", "~> 1.17" -gem "minitest", "~> 6.0.2" -gem "minitest-focus", "~> 1.4" -gem "minitest-mock", "~> 5.27" -gem "minitest-rg", "~> 5.3" -gem "ostruct", "~> 0.5.5" -gem "rake", ">= 13.0" -gem "redcarpet", "~> 3.6" -gem "yard", "~> 0.9" diff --git a/owl-bot-staging/google-cloud-vmware_engine-v1/LICENSE.md b/owl-bot-staging/google-cloud-vmware_engine-v1/LICENSE.md deleted file mode 100644 index c261857ba6ad..000000000000 --- a/owl-bot-staging/google-cloud-vmware_engine-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-vmware_engine-v1/README.md b/owl-bot-staging/google-cloud-vmware_engine-v1/README.md deleted file mode 100644 index 92d3fb6249c6..000000000000 --- a/owl-bot-staging/google-cloud-vmware_engine-v1/README.md +++ /dev/null @@ -1,154 +0,0 @@ -# Ruby Client for the Google Cloud VMware Engine V1 API - -The Google VMware Engine API lets you programmatically manage VMware environments. - -Google Cloud VMware Engine is a fully managed service that lets you run the VMware platform in Google Cloud. VMware Engine provides you with VMware operational continuity so you can benefit from a cloud consumption model and lower your total cost of ownership. VMware Engine also offers on-demand provisioning, pay-as-you-grow, and capacity optimization. - -https://github.com/googleapis/google-cloud-ruby - -This gem is a _versioned_ client. It provides basic client classes for a -specific version of the Google Cloud VMware Engine V1 API. Most users should consider using -the main client gem, -[google-cloud-vmware_engine](https://rubygems.org/gems/google-cloud-vmware_engine). -See the section below titled *Which client should I use?* for more information. - -## Installation - -``` -$ gem install google-cloud-vmware_engine-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/vmwareengine.googleapis.com) -1. [Set up authentication.](AUTHENTICATION.md) - -## Quick Start - -```ruby -require "google/cloud/vmware_engine/v1" - -client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new -request = ::Google::Cloud::VmwareEngine::V1::ListPrivateCloudsRequest.new # (request fields as keyword arguments...) -response = client.list_private_clouds request -``` - -View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-vmware_engine-v1/latest) -for class and method documentation. - -See also the [Product Documentation](https://cloud.google.com/vmware-engine/) -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/vmware_engine/v1" -require "logger" - -client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::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-vmware_engine`, -and lower-level _versioned_ client libraries with names such as -`google-cloud-vmware_engine-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-vmware_engine`. -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-vmware_engine-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-vmware_engine-v1/Rakefile b/owl-bot-staging/google-cloud-vmware_engine-v1/Rakefile deleted file mode 100644 index a494aa71fb5a..000000000000 --- a/owl-bot-staging/google-cloud-vmware_engine-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-vmware_engine-v1 acceptance tests." -task :acceptance, :project, :keyfile do |t, args| - project = args[:project] - project ||= - ENV["GOOGLE_CLOUD_TEST_PROJECT"] || - ENV["GCLOUD_TEST_PROJECT"] - keyfile = args[:keyfile] - keyfile ||= - ENV["GOOGLE_CLOUD_TEST_KEYFILE"] || - ENV["GCLOUD_TEST_KEYFILE"] - if keyfile - keyfile = File.read keyfile - else - keyfile ||= - ENV["GOOGLE_CLOUD_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 GOOGLE_CLOUD_TEST_PROJECT=test123 GOOGLE_CLOUD_TEST_KEYFILE=/path/to/keyfile.json rake acceptance" - end - require "google/cloud/vmware_engine/v1/vmware_engine/credentials" - ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Credentials.env_vars.each do |path| - ENV[path] = nil - end - ENV["GOOGLE_CLOUD_PROJECT"] = project - ENV["GOOGLE_CLOUD_TEST_PROJECT"] = project - ENV["GOOGLE_CLOUD_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-vmware_engine-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-vmware_engine-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-vmware_engine-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-vmware_engine-v1 gem does not have doctest tests." -end - -desc "Run the CI build" -task :ci do - header "BUILDING google-cloud-vmware_engine-v1" - header "google-cloud-vmware_engine-v1 rubocop", "*" - Rake::Task[:rubocop].invoke - header "google-cloud-vmware_engine-v1 yard", "*" - Rake::Task[:yard].invoke - header "google-cloud-vmware_engine-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-vmware_engine-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-vmware_engine-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-vmware_engine-v1/gapic_metadata.json b/owl-bot-staging/google-cloud-vmware_engine-v1/gapic_metadata.json deleted file mode 100644 index f4a1a19554a2..000000000000 --- a/owl-bot-staging/google-cloud-vmware_engine-v1/gapic_metadata.json +++ /dev/null @@ -1,388 +0,0 @@ -{ - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", - "language": "ruby", - "protoPackage": "google.cloud.vmwareengine.v1", - "libraryPackage": "::Google::Cloud::VmwareEngine::V1", - "services": { - "VmwareEngine": { - "clients": { - "grpc": { - "libraryClient": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client", - "rpcs": { - "ListPrivateClouds": { - "methods": [ - "list_private_clouds" - ] - }, - "GetPrivateCloud": { - "methods": [ - "get_private_cloud" - ] - }, - "CreatePrivateCloud": { - "methods": [ - "create_private_cloud" - ] - }, - "UpdatePrivateCloud": { - "methods": [ - "update_private_cloud" - ] - }, - "DeletePrivateCloud": { - "methods": [ - "delete_private_cloud" - ] - }, - "UndeletePrivateCloud": { - "methods": [ - "undelete_private_cloud" - ] - }, - "ListClusters": { - "methods": [ - "list_clusters" - ] - }, - "GetCluster": { - "methods": [ - "get_cluster" - ] - }, - "CreateCluster": { - "methods": [ - "create_cluster" - ] - }, - "UpdateCluster": { - "methods": [ - "update_cluster" - ] - }, - "DeleteCluster": { - "methods": [ - "delete_cluster" - ] - }, - "ListNodes": { - "methods": [ - "list_nodes" - ] - }, - "GetNode": { - "methods": [ - "get_node" - ] - }, - "ListExternalAddresses": { - "methods": [ - "list_external_addresses" - ] - }, - "FetchNetworkPolicyExternalAddresses": { - "methods": [ - "fetch_network_policy_external_addresses" - ] - }, - "GetExternalAddress": { - "methods": [ - "get_external_address" - ] - }, - "CreateExternalAddress": { - "methods": [ - "create_external_address" - ] - }, - "UpdateExternalAddress": { - "methods": [ - "update_external_address" - ] - }, - "DeleteExternalAddress": { - "methods": [ - "delete_external_address" - ] - }, - "ListSubnets": { - "methods": [ - "list_subnets" - ] - }, - "GetSubnet": { - "methods": [ - "get_subnet" - ] - }, - "UpdateSubnet": { - "methods": [ - "update_subnet" - ] - }, - "ListExternalAccessRules": { - "methods": [ - "list_external_access_rules" - ] - }, - "GetExternalAccessRule": { - "methods": [ - "get_external_access_rule" - ] - }, - "CreateExternalAccessRule": { - "methods": [ - "create_external_access_rule" - ] - }, - "UpdateExternalAccessRule": { - "methods": [ - "update_external_access_rule" - ] - }, - "DeleteExternalAccessRule": { - "methods": [ - "delete_external_access_rule" - ] - }, - "ListLoggingServers": { - "methods": [ - "list_logging_servers" - ] - }, - "GetLoggingServer": { - "methods": [ - "get_logging_server" - ] - }, - "CreateLoggingServer": { - "methods": [ - "create_logging_server" - ] - }, - "UpdateLoggingServer": { - "methods": [ - "update_logging_server" - ] - }, - "DeleteLoggingServer": { - "methods": [ - "delete_logging_server" - ] - }, - "ListNodeTypes": { - "methods": [ - "list_node_types" - ] - }, - "GetNodeType": { - "methods": [ - "get_node_type" - ] - }, - "ShowNsxCredentials": { - "methods": [ - "show_nsx_credentials" - ] - }, - "ShowVcenterCredentials": { - "methods": [ - "show_vcenter_credentials" - ] - }, - "ResetNsxCredentials": { - "methods": [ - "reset_nsx_credentials" - ] - }, - "ResetVcenterCredentials": { - "methods": [ - "reset_vcenter_credentials" - ] - }, - "GetDnsForwarding": { - "methods": [ - "get_dns_forwarding" - ] - }, - "UpdateDnsForwarding": { - "methods": [ - "update_dns_forwarding" - ] - }, - "GetNetworkPeering": { - "methods": [ - "get_network_peering" - ] - }, - "ListNetworkPeerings": { - "methods": [ - "list_network_peerings" - ] - }, - "CreateNetworkPeering": { - "methods": [ - "create_network_peering" - ] - }, - "DeleteNetworkPeering": { - "methods": [ - "delete_network_peering" - ] - }, - "UpdateNetworkPeering": { - "methods": [ - "update_network_peering" - ] - }, - "ListPeeringRoutes": { - "methods": [ - "list_peering_routes" - ] - }, - "CreateHcxActivationKey": { - "methods": [ - "create_hcx_activation_key" - ] - }, - "ListHcxActivationKeys": { - "methods": [ - "list_hcx_activation_keys" - ] - }, - "GetHcxActivationKey": { - "methods": [ - "get_hcx_activation_key" - ] - }, - "GetNetworkPolicy": { - "methods": [ - "get_network_policy" - ] - }, - "ListNetworkPolicies": { - "methods": [ - "list_network_policies" - ] - }, - "CreateNetworkPolicy": { - "methods": [ - "create_network_policy" - ] - }, - "UpdateNetworkPolicy": { - "methods": [ - "update_network_policy" - ] - }, - "DeleteNetworkPolicy": { - "methods": [ - "delete_network_policy" - ] - }, - "ListManagementDnsZoneBindings": { - "methods": [ - "list_management_dns_zone_bindings" - ] - }, - "GetManagementDnsZoneBinding": { - "methods": [ - "get_management_dns_zone_binding" - ] - }, - "CreateManagementDnsZoneBinding": { - "methods": [ - "create_management_dns_zone_binding" - ] - }, - "UpdateManagementDnsZoneBinding": { - "methods": [ - "update_management_dns_zone_binding" - ] - }, - "DeleteManagementDnsZoneBinding": { - "methods": [ - "delete_management_dns_zone_binding" - ] - }, - "RepairManagementDnsZoneBinding": { - "methods": [ - "repair_management_dns_zone_binding" - ] - }, - "CreateVmwareEngineNetwork": { - "methods": [ - "create_vmware_engine_network" - ] - }, - "UpdateVmwareEngineNetwork": { - "methods": [ - "update_vmware_engine_network" - ] - }, - "DeleteVmwareEngineNetwork": { - "methods": [ - "delete_vmware_engine_network" - ] - }, - "GetVmwareEngineNetwork": { - "methods": [ - "get_vmware_engine_network" - ] - }, - "ListVmwareEngineNetworks": { - "methods": [ - "list_vmware_engine_networks" - ] - }, - "CreatePrivateConnection": { - "methods": [ - "create_private_connection" - ] - }, - "GetPrivateConnection": { - "methods": [ - "get_private_connection" - ] - }, - "ListPrivateConnections": { - "methods": [ - "list_private_connections" - ] - }, - "UpdatePrivateConnection": { - "methods": [ - "update_private_connection" - ] - }, - "DeletePrivateConnection": { - "methods": [ - "delete_private_connection" - ] - }, - "ListPrivateConnectionPeeringRoutes": { - "methods": [ - "list_private_connection_peering_routes" - ] - }, - "GrantDnsBindPermission": { - "methods": [ - "grant_dns_bind_permission" - ] - }, - "GetDnsBindPermission": { - "methods": [ - "get_dns_bind_permission" - ] - }, - "RevokeDnsBindPermission": { - "methods": [ - "revoke_dns_bind_permission" - ] - } - } - } - } - } - } -} diff --git a/owl-bot-staging/google-cloud-vmware_engine-v1/google-cloud-vmware_engine-v1.gemspec b/owl-bot-staging/google-cloud-vmware_engine-v1/google-cloud-vmware_engine-v1.gemspec deleted file mode 100644 index 202574bb1ae1..000000000000 --- a/owl-bot-staging/google-cloud-vmware_engine-v1/google-cloud-vmware_engine-v1.gemspec +++ /dev/null @@ -1,30 +0,0 @@ -# -*- ruby -*- -# encoding: utf-8 - -require File.expand_path("lib/google/cloud/vmware_engine/v1/version", __dir__) - -Gem::Specification.new do |gem| - gem.name = "google-cloud-vmware_engine-v1" - gem.version = Google::Cloud::VmwareEngine::V1::VERSION - - gem.authors = ["Google LLC"] - gem.email = "googleapis-packages@google.com" - gem.description = "Google Cloud VMware Engine is a fully managed service that lets you run the VMware platform in Google Cloud. VMware Engine provides you with VMware operational continuity so you can benefit from a cloud consumption model and lower your total cost of ownership. VMware Engine also offers on-demand provisioning, pay-as-you-grow, and capacity optimization. Note that google-cloud-vmware_engine-v1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-vmware_engine instead. See the readme for more details." - gem.summary = "The Google VMware Engine API lets you programmatically manage VMware environments." - 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.2" - - 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-vmware_engine-v1/lib/google-cloud-vmware_engine-v1.rb b/owl-bot-staging/google-cloud-vmware_engine-v1/lib/google-cloud-vmware_engine-v1.rb deleted file mode 100644 index 98be00c68860..000000000000 --- a/owl-bot-staging/google-cloud-vmware_engine-v1/lib/google-cloud-vmware_engine-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/vmware_engine/v1" diff --git a/owl-bot-staging/google-cloud-vmware_engine-v1/lib/google/cloud/vmware_engine/v1.rb b/owl-bot-staging/google-cloud-vmware_engine-v1/lib/google/cloud/vmware_engine/v1.rb deleted file mode 100644 index accd8b68428a..000000000000 --- a/owl-bot-staging/google-cloud-vmware_engine-v1/lib/google/cloud/vmware_engine/v1.rb +++ /dev/null @@ -1,45 +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/vmware_engine/v1/vmware_engine" -require "google/cloud/vmware_engine/v1/version" - -module Google - module Cloud - module VmwareEngine - ## - # API client module. - # - # @example Load this package, including all its services, and instantiate a gRPC client - # - # require "google/cloud/vmware_engine/v1" - # client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new - # - # @example Load this package, including all its services, and instantiate a REST client - # - # require "google/cloud/vmware_engine/v1" - # client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new - # - module V1 - end - end - end -end - -helper_path = ::File.join __dir__, "v1", "_helpers.rb" -require "google/cloud/vmware_engine/v1/_helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-vmware_engine-v1/lib/google/cloud/vmware_engine/v1/bindings_override.rb b/owl-bot-staging/google-cloud-vmware_engine-v1/lib/google/cloud/vmware_engine/v1/bindings_override.rb deleted file mode 100644 index 865c8a08b7c0..000000000000 --- a/owl-bot-staging/google-cloud-vmware_engine-v1/lib/google/cloud/vmware_engine/v1/bindings_override.rb +++ /dev/null @@ -1,156 +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 VmwareEngine - ## - # @example Loading just the REST part of this package, including all its services, and instantiating a REST client - # - # require "google/cloud/vmware_engine/v1/rest" - # client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new - # - module V1 - ## - # @private - # Initialize the mixin bindings configuration - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "VmwareEngine"] - 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/[^/]+/privateClouds/[^/]+/?$}, false] - ], - body: nil - ), - Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( - uri_method: :get, - uri_template: "/v1/{resource}:getIamPolicy", - matches: [ - ["resource", %r{^projects/[^/]+/locations/[^/]+/privateClouds/[^/]+/clusters/[^/]+/?$}, false] - ], - body: nil - ), - Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( - uri_method: :get, - uri_template: "/v1/{resource}:getIamPolicy", - matches: [ - ["resource", %r{^projects/[^/]+/locations/[^/]+/privateClouds/[^/]+/hcxActivationKeys/[^/]+/?$}, 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/[^/]+/privateClouds/[^/]+/?$}, false] - ], - body: "*" - ), - Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( - uri_method: :post, - uri_template: "/v1/{resource}:setIamPolicy", - matches: [ - ["resource", %r{^projects/[^/]+/locations/[^/]+/privateClouds/[^/]+/clusters/[^/]+/?$}, false] - ], - body: "*" - ), - Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( - uri_method: :post, - uri_template: "/v1/{resource}:setIamPolicy", - matches: [ - ["resource", %r{^projects/[^/]+/locations/[^/]+/privateClouds/[^/]+/hcxActivationKeys/[^/]+/?$}, 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/[^/]+/privateClouds/[^/]+/?$}, false] - ], - body: "*" - ), - Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( - uri_method: :post, - uri_template: "/v1/{resource}:testIamPermissions", - matches: [ - ["resource", %r{^projects/[^/]+/locations/[^/]+/privateClouds/[^/]+/clusters/[^/]+/?$}, false] - ], - body: "*" - ), - Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( - uri_method: :post, - uri_template: "/v1/{resource}:testIamPermissions", - matches: [ - ["resource", %r{^projects/[^/]+/locations/[^/]+/privateClouds/[^/]+/hcxActivationKeys/[^/]+/?$}, false] - ], - body: "*" - ) - ] - default_config - end - yield @configure if block_given? - @configure - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-vmware_engine-v1/lib/google/cloud/vmware_engine/v1/rest.rb b/owl-bot-staging/google-cloud-vmware_engine-v1/lib/google/cloud/vmware_engine/v1/rest.rb deleted file mode 100644 index 858b1670df46..000000000000 --- a/owl-bot-staging/google-cloud-vmware_engine-v1/lib/google/cloud/vmware_engine/v1/rest.rb +++ /dev/null @@ -1,38 +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/vmware_engine/v1/vmware_engine/rest" -require "google/cloud/vmware_engine/v1/bindings_override" -require "google/cloud/vmware_engine/v1/version" - -module Google - module Cloud - module VmwareEngine - ## - # To load just the REST part of this package, including all its services, and instantiate a REST client: - # - # @example - # - # require "google/cloud/vmware_engine/v1/rest" - # client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new - # - module V1 - end - end - end -end diff --git a/owl-bot-staging/google-cloud-vmware_engine-v1/lib/google/cloud/vmware_engine/v1/version.rb b/owl-bot-staging/google-cloud-vmware_engine-v1/lib/google/cloud/vmware_engine/v1/version.rb deleted file mode 100644 index 378acc320ce6..000000000000 --- a/owl-bot-staging/google-cloud-vmware_engine-v1/lib/google/cloud/vmware_engine/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 VmwareEngine - module V1 - VERSION = "0.0.1" - end - end - end -end diff --git a/owl-bot-staging/google-cloud-vmware_engine-v1/lib/google/cloud/vmware_engine/v1/vmware_engine.rb b/owl-bot-staging/google-cloud-vmware_engine-v1/lib/google/cloud/vmware_engine/v1/vmware_engine.rb deleted file mode 100644 index 5b51604741d6..000000000000 --- a/owl-bot-staging/google-cloud-vmware_engine-v1/lib/google/cloud/vmware_engine/v1/vmware_engine.rb +++ /dev/null @@ -1,56 +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/vmware_engine/v1/version" - -require "google/cloud/vmware_engine/v1/vmware_engine/credentials" -require "google/cloud/vmware_engine/v1/vmware_engine/paths" -require "google/cloud/vmware_engine/v1/vmware_engine/operations" -require "google/cloud/vmware_engine/v1/vmware_engine/client" -require "google/cloud/vmware_engine/v1/vmware_engine/rest" - -module Google - module Cloud - module VmwareEngine - module V1 - ## - # VMwareEngine manages VMware's private clusters in the Cloud. - # - # @example Load this service and instantiate a gRPC client - # - # require "google/cloud/vmware_engine/v1/vmware_engine" - # client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new - # - # @example Load this service and instantiate a REST client - # - # require "google/cloud/vmware_engine/v1/vmware_engine/rest" - # client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new - # - module VmwareEngine - end - end - end - end -end - -helper_path = ::File.join __dir__, "vmware_engine", "helpers.rb" -require "google/cloud/vmware_engine/v1/vmware_engine/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-vmware_engine-v1/lib/google/cloud/vmware_engine/v1/vmware_engine/client.rb b/owl-bot-staging/google-cloud-vmware_engine-v1/lib/google/cloud/vmware_engine/v1/vmware_engine/client.rb deleted file mode 100644 index fd7b76579e68..000000000000 --- a/owl-bot-staging/google-cloud-vmware_engine-v1/lib/google/cloud/vmware_engine/v1/vmware_engine/client.rb +++ /dev/null @@ -1,9555 +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/vmwareengine/v1/vmwareengine_pb" -require "google/cloud/location" -require "google/iam/v1" - -module Google - module Cloud - module VmwareEngine - module V1 - module VmwareEngine - ## - # Client for the VmwareEngine service. - # - # VMwareEngine manages VMware's private clusters in the Cloud. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "vmwareengine.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :vmware_engine_stub - - ## - # Configure the VmwareEngine Client class. - # - # See {::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all VmwareEngine clients - # ::Google::Cloud::VmwareEngine::V1::VmwareEngine::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", "VmwareEngine", "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.timeout = 120.0 - - default_config.rpcs.list_private_clouds.timeout = 120.0 - default_config.rpcs.list_private_clouds.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.get_private_cloud.timeout = 120.0 - default_config.rpcs.get_private_cloud.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.list_clusters.timeout = 120.0 - default_config.rpcs.list_clusters.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.get_cluster.timeout = 120.0 - default_config.rpcs.get_cluster.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.list_nodes.timeout = 120.0 - default_config.rpcs.list_nodes.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.get_node.timeout = 120.0 - default_config.rpcs.get_node.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.list_external_addresses.timeout = 120.0 - default_config.rpcs.list_external_addresses.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.get_external_address.timeout = 120.0 - default_config.rpcs.get_external_address.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.list_subnets.timeout = 120.0 - default_config.rpcs.list_subnets.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.get_subnet.timeout = 120.0 - default_config.rpcs.get_subnet.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.update_subnet.timeout = 60.0 - - default_config.rpcs.list_external_access_rules.timeout = 120.0 - default_config.rpcs.list_external_access_rules.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.get_external_access_rule.timeout = 120.0 - default_config.rpcs.get_external_access_rule.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.list_logging_servers.timeout = 120.0 - default_config.rpcs.list_logging_servers.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.get_logging_server.timeout = 120.0 - default_config.rpcs.get_logging_server.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.list_node_types.timeout = 120.0 - default_config.rpcs.list_node_types.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.get_node_type.timeout = 120.0 - default_config.rpcs.get_node_type.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.show_nsx_credentials.timeout = 120.0 - default_config.rpcs.show_nsx_credentials.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.show_vcenter_credentials.timeout = 120.0 - default_config.rpcs.show_vcenter_credentials.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.get_dns_forwarding.timeout = 120.0 - default_config.rpcs.get_dns_forwarding.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.get_network_peering.timeout = 120.0 - default_config.rpcs.get_network_peering.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.list_network_peerings.timeout = 120.0 - default_config.rpcs.list_network_peerings.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.list_peering_routes.timeout = 120.0 - default_config.rpcs.list_peering_routes.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.list_hcx_activation_keys.timeout = 120.0 - default_config.rpcs.list_hcx_activation_keys.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.get_hcx_activation_key.timeout = 120.0 - default_config.rpcs.get_hcx_activation_key.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.get_network_policy.timeout = 120.0 - default_config.rpcs.get_network_policy.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.list_network_policies.timeout = 120.0 - default_config.rpcs.list_network_policies.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.list_management_dns_zone_bindings.timeout = 120.0 - default_config.rpcs.list_management_dns_zone_bindings.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.get_management_dns_zone_binding.timeout = 120.0 - default_config.rpcs.get_management_dns_zone_binding.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.get_vmware_engine_network.timeout = 120.0 - default_config.rpcs.get_vmware_engine_network.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.list_vmware_engine_networks.timeout = 120.0 - default_config.rpcs.list_vmware_engine_networks.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.get_private_connection.timeout = 120.0 - default_config.rpcs.get_private_connection.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.list_private_connections.timeout = 120.0 - default_config.rpcs.list_private_connections.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.list_private_connection_peering_routes.timeout = 120.0 - default_config.rpcs.list_private_connection_peering_routes.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.get_dns_bind_permission.timeout = 120.0 - default_config.rpcs.get_dns_bind_permission.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the VmwareEngine 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::VmwareEngine::V1::VmwareEngine::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 - @vmware_engine_stub.universe_domain - end - - ## - # Create a new VmwareEngine client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the VmwareEngine 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/vmwareengine/v1/vmwareengine_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 - - @vmware_engine_stub = ::Gapic::ServiceStub.new( - ::Google::Cloud::VmwareEngine::V1::VmwareEngine::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 - ) - - @vmware_engine_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 = @vmware_engine_stub.endpoint - config.universe_domain = @vmware_engine_stub.universe_domain - config.logger = @vmware_engine_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 = @vmware_engine_stub.endpoint - config.universe_domain = @vmware_engine_stub.universe_domain - config.logger = @vmware_engine_stub.logger if config.respond_to? :logger= - end - end - - ## - # Get the associated client for long-running operations. - # - # @return [::Google::Cloud::VmwareEngine::V1::VmwareEngine::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 - @vmware_engine_stub.logger - end - - # Service calls - - ## - # Lists `PrivateCloud` resources in a given project and location. - # - # @overload list_private_clouds(request, options = nil) - # Pass arguments to `list_private_clouds` via a request object, either of type - # {::Google::Cloud::VmwareEngine::V1::ListPrivateCloudsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VmwareEngine::V1::ListPrivateCloudsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_private_clouds(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) - # Pass arguments to `list_private_clouds` via keyword arguments. Note that at - # least one keyword argument is 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 private cloud to be queried for - # clusters. Resource names are schemeless URIs that follow the conventions in - # https://cloud.google.com/apis/design/resource_names. - # For example: - # `projects/my-project/locations/us-central1-a` - # @param page_size [::Integer] - # The maximum number of private clouds to return in one page. - # The service may return fewer than this value. - # The maximum value is coerced to 1000. - # The default value of this field is 500. - # @param page_token [::String] - # A page token, received from a previous `ListPrivateClouds` call. - # Provide this to retrieve the subsequent page. - # - # When paginating, all other parameters provided to `ListPrivateClouds` must - # match the call that provided the page token. - # @param filter [::String] - # A filter expression that matches resources returned in the response. - # The expression must specify the field name, a comparison operator, and the - # value that you want to use for filtering. The value must be a string, a - # number, or a boolean. The comparison operator must be `=`, `!=`, `>`, or - # `<`. - # - # For example, if you are filtering a list of private clouds, you can exclude - # the ones named `example-pc` by specifying `name != "example-pc"`. - # - # You can also filter nested fields. For example, you could specify - # `networkConfig.managementCidr = "192.168.0.0/24"` to include private clouds - # only if they have a matching address in their network configuration. - # - # To filter on multiple expressions, provide each separate expression within - # parentheses. For example: - # ``` - # (name = "example-pc") - # (createTime > "2021-04-12T08:15:10.40Z") - # ``` - # - # By default, each expression is an `AND` expression. However, you can - # include `AND` and `OR` expressions explicitly. For example: - # ``` - # (name = "private-cloud-1") AND - # (createTime > "2021-04-12T08:15:10.40Z") OR - # (name = "private-cloud-2") - # ``` - # @param order_by [::String] - # Sorts list results by a certain order. By default, returned results are - # ordered by `name` in ascending order. You can also sort results in - # descending order based on the `name` value using `orderBy="name desc"`. - # Currently, only ordering by `name` is supported. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::VmwareEngine::V1::PrivateCloud>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::VmwareEngine::V1::PrivateCloud>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/vmware_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VmwareEngine::V1::ListPrivateCloudsRequest.new - # - # # Call the list_private_clouds method. - # result = client.list_private_clouds 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::VmwareEngine::V1::PrivateCloud. - # p item - # end - # - def list_private_clouds request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::ListPrivateCloudsRequest - - # Converts hash 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_private_clouds.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::VmwareEngine::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_private_clouds.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_private_clouds.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vmware_engine_stub.call_rpc :list_private_clouds, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @vmware_engine_stub, :list_private_clouds, 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 - - ## - # Retrieves a `PrivateCloud` resource by its resource name. - # - # @overload get_private_cloud(request, options = nil) - # Pass arguments to `get_private_cloud` via a request object, either of type - # {::Google::Cloud::VmwareEngine::V1::GetPrivateCloudRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VmwareEngine::V1::GetPrivateCloudRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_private_cloud(name: nil) - # Pass arguments to `get_private_cloud` via keyword arguments. Note that at - # least one keyword argument is 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 private cloud to retrieve. - # Resource names are schemeless URIs that follow the conventions in - # https://cloud.google.com/apis/design/resource_names. - # For example: - # `projects/my-project/locations/us-central1-a/privateClouds/my-cloud` - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::VmwareEngine::V1::PrivateCloud] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::VmwareEngine::V1::PrivateCloud] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/vmware_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VmwareEngine::V1::GetPrivateCloudRequest.new - # - # # Call the get_private_cloud method. - # result = client.get_private_cloud request - # - # # The returned object is of type Google::Cloud::VmwareEngine::V1::PrivateCloud. - # p result - # - def get_private_cloud request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::GetPrivateCloudRequest - - # Converts hash 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_private_cloud.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::VmwareEngine::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_private_cloud.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_private_cloud.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vmware_engine_stub.call_rpc :get_private_cloud, 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 `PrivateCloud` resource in a given project and location. - # Private clouds of type `STANDARD` and - # `TIME_LIMITED` are zonal resources, `STRETCHED` private clouds are - # regional. - # Creating a private cloud also creates a [management - # cluster](https://cloud.google.com/vmware-engine/docs/concepts-vmware-components) - # for that private cloud. - # - # @overload create_private_cloud(request, options = nil) - # Pass arguments to `create_private_cloud` via a request object, either of type - # {::Google::Cloud::VmwareEngine::V1::CreatePrivateCloudRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VmwareEngine::V1::CreatePrivateCloudRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_private_cloud(parent: nil, private_cloud_id: nil, private_cloud: nil, request_id: nil, validate_only: nil) - # Pass arguments to `create_private_cloud` via keyword arguments. Note that at - # least one keyword argument is 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 to create the new - # private cloud in. Resource names are schemeless URIs that follow the - # conventions in https://cloud.google.com/apis/design/resource_names. - # For example: - # `projects/my-project/locations/us-central1-a` - # @param private_cloud_id [::String] - # Required. The user-provided identifier of the private cloud to be created. - # This identifier must be unique among each `PrivateCloud` within the parent - # and becomes the final token in the name URI. - # The identifier must meet the following requirements: - # - # * Only contains 1-63 alphanumeric characters and hyphens - # * Begins with an alphabetical character - # * Ends with a non-hyphen character - # * Not formatted as a UUID - # * Complies with [RFC 1034](https://datatracker.ietf.org/doc/html/rfc1034) - # (section 3.5) - # @param private_cloud [::Google::Cloud::VmwareEngine::V1::PrivateCloud, ::Hash] - # Required. The initial description of the new private cloud. - # @param request_id [::String] - # Optional. The request ID must be a valid UUID with the exception that zero - # UUID is not supported (00000000-0000-0000-0000-000000000000). - # @param validate_only [::Boolean] - # Optional. True if you want the request to be validated and not executed; - # false otherwise. - # - # @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/vmware_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VmwareEngine::V1::CreatePrivateCloudRequest.new - # - # # Call the create_private_cloud method. - # result = client.create_private_cloud 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_private_cloud request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::CreatePrivateCloudRequest - - # Converts hash 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_private_cloud.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::VmwareEngine::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_private_cloud.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_private_cloud.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vmware_engine_stub.call_rpc :create_private_cloud, 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 - - ## - # Modifies a `PrivateCloud` resource. Only the following fields can be - # updated: `description`. - # Only fields specified in `updateMask` are applied. - # - # During operation processing, the resource is temporarily in the `ACTIVE` - # state before the operation fully completes. For that period of time, you - # can't update the resource. Use the operation status to determine when the - # processing fully completes. - # - # @overload update_private_cloud(request, options = nil) - # Pass arguments to `update_private_cloud` via a request object, either of type - # {::Google::Cloud::VmwareEngine::V1::UpdatePrivateCloudRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VmwareEngine::V1::UpdatePrivateCloudRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_private_cloud(private_cloud: nil, update_mask: nil, request_id: nil) - # Pass arguments to `update_private_cloud` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param private_cloud [::Google::Cloud::VmwareEngine::V1::PrivateCloud, ::Hash] - # Required. Private cloud description. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Required. Field mask is used to specify the fields to be overwritten in the - # `PrivateCloud` resource by the update. The fields specified in `updateMask` - # are relative to the resource, not the full request. A field will be - # overwritten if it is in the mask. If the user does not provide a mask then - # all fields will be overwritten. - # @param request_id [::String] - # Optional. The request ID must be a valid UUID with the exception that zero - # UUID is not supported (00000000-0000-0000-0000-000000000000). - # - # @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/vmware_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VmwareEngine::V1::UpdatePrivateCloudRequest.new - # - # # Call the update_private_cloud method. - # result = client.update_private_cloud 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 update_private_cloud request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::UpdatePrivateCloudRequest - - # Converts hash 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_private_cloud.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::VmwareEngine::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.private_cloud&.name - header_params["private_cloud.name"] = request.private_cloud.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_private_cloud.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_private_cloud.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vmware_engine_stub.call_rpc :update_private_cloud, 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 - - ## - # Schedules a `PrivateCloud` resource for deletion. - # - # A `PrivateCloud` resource scheduled for deletion has `PrivateCloud.state` - # set to `DELETED` and `expireTime` set to the time when deletion is final - # and can no longer be reversed. The delete operation is marked as done - # as soon as the `PrivateCloud` is successfully scheduled for deletion - # (this also applies when `delayHours` is set to zero), and the operation is - # not kept in pending state until `PrivateCloud` is purged. - # `PrivateCloud` can be restored using `UndeletePrivateCloud` method before - # the `expireTime` elapses. When `expireTime` is reached, deletion is final - # and all private cloud resources are irreversibly removed and billing stops. - # During the final removal process, `PrivateCloud.state` is set to `PURGING`. - # `PrivateCloud` can be polled using standard `GET` method for the whole - # period of deletion and purging. It will not be returned only - # when it is completely purged. - # - # @overload delete_private_cloud(request, options = nil) - # Pass arguments to `delete_private_cloud` via a request object, either of type - # {::Google::Cloud::VmwareEngine::V1::DeletePrivateCloudRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VmwareEngine::V1::DeletePrivateCloudRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_private_cloud(name: nil, request_id: nil, force: nil, delay_hours: nil) - # Pass arguments to `delete_private_cloud` via keyword arguments. Note that at - # least one keyword argument is 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 private cloud to delete. - # Resource names are schemeless URIs that follow the conventions in - # https://cloud.google.com/apis/design/resource_names. - # For example: - # `projects/my-project/locations/us-central1-a/privateClouds/my-cloud` - # @param request_id [::String] - # Optional. The request ID must be a valid UUID with the exception that zero - # UUID is not supported (00000000-0000-0000-0000-000000000000). - # @param force [::Boolean] - # Optional. If set to true, cascade delete is enabled and all children of - # this private cloud resource are also deleted. When this flag is set to - # false, the private cloud will not be deleted if there are any children - # other than the management cluster. The management cluster is always - # deleted. - # @param delay_hours [::Integer] - # Optional. Time delay of the deletion specified in hours. The default value - # is `3`. Specifying a non-zero value for this field changes the value of - # `PrivateCloud.state` to `DELETED` and sets `expire_time` to the planned - # deletion time. Deletion can be cancelled before `expire_time` elapses using - # {::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#undelete_private_cloud VmwareEngine.UndeletePrivateCloud}. - # Specifying a value of `0` for this field instead begins the deletion - # process and ceases billing immediately. During the final deletion process, - # the value of `PrivateCloud.state` becomes `PURGING`. - # - # @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/vmware_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VmwareEngine::V1::DeletePrivateCloudRequest.new - # - # # Call the delete_private_cloud method. - # result = client.delete_private_cloud 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_private_cloud request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::DeletePrivateCloudRequest - - # Converts hash 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_private_cloud.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::VmwareEngine::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_private_cloud.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_private_cloud.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vmware_engine_stub.call_rpc :delete_private_cloud, 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 - - ## - # Restores a private cloud that was previously scheduled for deletion by - # `DeletePrivateCloud`. A `PrivateCloud` resource scheduled for deletion has - # `PrivateCloud.state` set to `DELETED` and `PrivateCloud.expireTime` set to - # the time when deletion can no longer be reversed. - # - # @overload undelete_private_cloud(request, options = nil) - # Pass arguments to `undelete_private_cloud` via a request object, either of type - # {::Google::Cloud::VmwareEngine::V1::UndeletePrivateCloudRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VmwareEngine::V1::UndeletePrivateCloudRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload undelete_private_cloud(name: nil, request_id: nil) - # Pass arguments to `undelete_private_cloud` via keyword arguments. Note that at - # least one keyword argument is 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 private cloud scheduled for deletion. - # Resource names are schemeless URIs that follow the conventions in - # https://cloud.google.com/apis/design/resource_names. - # For example: - # `projects/my-project/locations/us-central1-a/privateClouds/my-cloud` - # @param request_id [::String] - # Optional. The request ID must be a valid UUID with the exception that zero - # UUID is not supported (00000000-0000-0000-0000-000000000000). - # - # @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/vmware_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VmwareEngine::V1::UndeletePrivateCloudRequest.new - # - # # Call the undelete_private_cloud method. - # result = client.undelete_private_cloud 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 undelete_private_cloud request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::UndeletePrivateCloudRequest - - # Converts hash 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.undelete_private_cloud.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::VmwareEngine::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.undelete_private_cloud.timeout, - metadata: metadata, - retry_policy: @config.rpcs.undelete_private_cloud.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vmware_engine_stub.call_rpc :undelete_private_cloud, 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 - - ## - # Lists `Cluster` resources in a given private cloud. - # - # @overload list_clusters(request, options = nil) - # Pass arguments to `list_clusters` via a request object, either of type - # {::Google::Cloud::VmwareEngine::V1::ListClustersRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VmwareEngine::V1::ListClustersRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_clusters(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) - # Pass arguments to `list_clusters` via keyword arguments. Note that at - # least one keyword argument is 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 private cloud to query for clusters. - # Resource names are schemeless URIs that follow the conventions in - # https://cloud.google.com/apis/design/resource_names. - # For example: - # `projects/my-project/locations/us-central1-a/privateClouds/my-cloud` - # @param page_size [::Integer] - # The maximum number of clusters to return in one page. - # The service may return fewer than this value. - # The maximum value is coerced to 1000. - # The default value of this field is 500. - # @param page_token [::String] - # A page token, received from a previous `ListClusters` call. - # Provide this to retrieve the subsequent page. - # - # When paginating, all other parameters provided to `ListClusters` - # must match the call that provided the page token. - # @param filter [::String] - # To filter on multiple expressions, provide each separate expression within - # parentheses. For example: - # ``` - # (name = "example-cluster") - # (nodeCount = "3") - # ``` - # - # By default, each expression is an `AND` expression. However, you can - # include `AND` and `OR` expressions explicitly. For example: - # ``` - # (name = "example-cluster-1") AND - # (createTime > "2021-04-12T08:15:10.40Z") OR - # (name = "example-cluster-2") - # ``` - # @param order_by [::String] - # Sorts list results by a certain order. By default, returned results are - # ordered by `name` in ascending order. You can also sort results in - # descending order based on the `name` value using `orderBy="name desc"`. - # Currently, only ordering by `name` is supported. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::VmwareEngine::V1::Cluster>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::VmwareEngine::V1::Cluster>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/vmware_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VmwareEngine::V1::ListClustersRequest.new - # - # # Call the list_clusters method. - # result = client.list_clusters 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::VmwareEngine::V1::Cluster. - # p item - # end - # - def list_clusters request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::ListClustersRequest - - # Converts hash 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_clusters.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::VmwareEngine::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_clusters.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_clusters.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vmware_engine_stub.call_rpc :list_clusters, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @vmware_engine_stub, :list_clusters, 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 - - ## - # Retrieves a `Cluster` resource by its resource name. - # - # @overload get_cluster(request, options = nil) - # Pass arguments to `get_cluster` via a request object, either of type - # {::Google::Cloud::VmwareEngine::V1::GetClusterRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VmwareEngine::V1::GetClusterRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_cluster(name: nil) - # Pass arguments to `get_cluster` via keyword arguments. Note that at - # least one keyword argument is 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 cluster resource name to retrieve. - # Resource names are schemeless URIs that follow the conventions in - # https://cloud.google.com/apis/design/resource_names. - # For example: - # `projects/my-project/locations/us-central1-a/privateClouds/my-cloud/clusters/my-cluster` - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::VmwareEngine::V1::Cluster] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::VmwareEngine::V1::Cluster] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/vmware_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VmwareEngine::V1::GetClusterRequest.new - # - # # Call the get_cluster method. - # result = client.get_cluster request - # - # # The returned object is of type Google::Cloud::VmwareEngine::V1::Cluster. - # p result - # - def get_cluster request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::GetClusterRequest - - # Converts hash 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_cluster.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::VmwareEngine::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_cluster.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_cluster.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vmware_engine_stub.call_rpc :get_cluster, 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 cluster in a given private cloud. - # Creating a new cluster provides additional nodes for - # use in the parent private cloud and requires sufficient [node - # quota](https://cloud.google.com/vmware-engine/quotas). - # - # @overload create_cluster(request, options = nil) - # Pass arguments to `create_cluster` via a request object, either of type - # {::Google::Cloud::VmwareEngine::V1::CreateClusterRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VmwareEngine::V1::CreateClusterRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_cluster(parent: nil, cluster_id: nil, cluster: nil, request_id: nil, validate_only: nil) - # Pass arguments to `create_cluster` via keyword arguments. Note that at - # least one keyword argument is 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 private cloud to create a new cluster - # in. Resource names are schemeless URIs that follow the conventions in - # https://cloud.google.com/apis/design/resource_names. - # For example: - # `projects/my-project/locations/us-central1-a/privateClouds/my-cloud` - # @param cluster_id [::String] - # Required. The user-provided identifier of the new `Cluster`. - # This identifier must be unique among clusters within the parent and becomes - # the final token in the name URI. - # The identifier must meet the following requirements: - # - # * Only contains 1-63 alphanumeric characters and hyphens - # * Begins with an alphabetical character - # * Ends with a non-hyphen character - # * Not formatted as a UUID - # * Complies with [RFC 1034](https://datatracker.ietf.org/doc/html/rfc1034) - # (section 3.5) - # @param cluster [::Google::Cloud::VmwareEngine::V1::Cluster, ::Hash] - # Required. The initial description of the new cluster. - # @param request_id [::String] - # Optional. The request ID must be a valid UUID with the exception that zero - # UUID is not supported (00000000-0000-0000-0000-000000000000). - # @param validate_only [::Boolean] - # Optional. True if you want the request to be validated and not executed; - # false otherwise. - # - # @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/vmware_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VmwareEngine::V1::CreateClusterRequest.new - # - # # Call the create_cluster method. - # result = client.create_cluster 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_cluster request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::CreateClusterRequest - - # Converts hash 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_cluster.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::VmwareEngine::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_cluster.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_cluster.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vmware_engine_stub.call_rpc :create_cluster, 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 - - ## - # Modifies a `Cluster` resource. Only fields specified in `updateMask` are - # applied. - # - # During operation processing, the resource is temporarily in the `ACTIVE` - # state before the operation fully completes. For that period of time, you - # can't update the resource. Use the operation status to determine when the - # processing fully completes. - # - # @overload update_cluster(request, options = nil) - # Pass arguments to `update_cluster` via a request object, either of type - # {::Google::Cloud::VmwareEngine::V1::UpdateClusterRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VmwareEngine::V1::UpdateClusterRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_cluster(update_mask: nil, cluster: nil, request_id: nil, validate_only: nil) - # Pass arguments to `update_cluster` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Required. Field mask is used to specify the fields to be overwritten in the - # `Cluster` resource by the update. The fields specified in the `updateMask` - # are relative to the resource, not the full request. A field will be - # overwritten if it is in the mask. If the user does not provide a mask then - # all fields will be overwritten. - # @param cluster [::Google::Cloud::VmwareEngine::V1::Cluster, ::Hash] - # Required. The description of the cluster. - # @param request_id [::String] - # Optional. The request ID must be a valid UUID with the exception that - # zero UUID is not supported (00000000-0000-0000-0000-000000000000). - # @param validate_only [::Boolean] - # Optional. True if you want the request to be validated and not executed; - # false otherwise. - # - # @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/vmware_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VmwareEngine::V1::UpdateClusterRequest.new - # - # # Call the update_cluster method. - # result = client.update_cluster 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 update_cluster request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::UpdateClusterRequest - - # Converts hash 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_cluster.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::VmwareEngine::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.cluster&.name - header_params["cluster.name"] = request.cluster.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_cluster.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_cluster.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vmware_engine_stub.call_rpc :update_cluster, 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 `Cluster` resource. To avoid unintended data loss, migrate or - # gracefully shut down any workloads running on the cluster before deletion. - # You cannot delete the management cluster of a private cloud using this - # method. - # - # @overload delete_cluster(request, options = nil) - # Pass arguments to `delete_cluster` via a request object, either of type - # {::Google::Cloud::VmwareEngine::V1::DeleteClusterRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VmwareEngine::V1::DeleteClusterRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_cluster(name: nil, request_id: nil) - # Pass arguments to `delete_cluster` via keyword arguments. Note that at - # least one keyword argument is 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 cluster to delete. - # Resource names are schemeless URIs that follow the conventions in - # https://cloud.google.com/apis/design/resource_names. - # For example: - # `projects/my-project/locations/us-central1-a/privateClouds/my-cloud/clusters/my-cluster` - # @param request_id [::String] - # Optional. The request ID must be a valid UUID with the exception that zero - # UUID is not supported (00000000-0000-0000-0000-000000000000). - # - # @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/vmware_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VmwareEngine::V1::DeleteClusterRequest.new - # - # # Call the delete_cluster method. - # result = client.delete_cluster 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_cluster request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::DeleteClusterRequest - - # Converts hash 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_cluster.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::VmwareEngine::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_cluster.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_cluster.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vmware_engine_stub.call_rpc :delete_cluster, 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 - - ## - # Lists nodes in a given cluster. - # - # @overload list_nodes(request, options = nil) - # Pass arguments to `list_nodes` via a request object, either of type - # {::Google::Cloud::VmwareEngine::V1::ListNodesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VmwareEngine::V1::ListNodesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_nodes(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_nodes` via keyword arguments. Note that at - # least one keyword argument is 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 cluster to be queried for nodes. - # Resource names are schemeless URIs that follow the conventions in - # https://cloud.google.com/apis/design/resource_names. - # For example: - # `projects/my-project/locations/us-central1-a/privateClouds/my-cloud/clusters/my-cluster` - # @param page_size [::Integer] - # The maximum number of nodes to return in one page. - # The service may return fewer than this value. - # The maximum value is coerced to 1000. - # The default value of this field is 500. - # @param page_token [::String] - # A page token, received from a previous `ListNodes` call. - # Provide this to retrieve the subsequent page. - # - # When paginating, all other parameters provided to - # `ListNodes` must match the call that provided the page - # token. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::VmwareEngine::V1::Node>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::VmwareEngine::V1::Node>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/vmware_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VmwareEngine::V1::ListNodesRequest.new - # - # # Call the list_nodes method. - # result = client.list_nodes 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::VmwareEngine::V1::Node. - # p item - # end - # - def list_nodes request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::ListNodesRequest - - # Converts hash 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_nodes.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::VmwareEngine::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_nodes.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_nodes.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vmware_engine_stub.call_rpc :list_nodes, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @vmware_engine_stub, :list_nodes, 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 - - ## - # Gets details of a single node. - # - # @overload get_node(request, options = nil) - # Pass arguments to `get_node` via a request object, either of type - # {::Google::Cloud::VmwareEngine::V1::GetNodeRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VmwareEngine::V1::GetNodeRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_node(name: nil) - # Pass arguments to `get_node` via keyword arguments. Note that at - # least one keyword argument is 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 node to retrieve. - # For example: - # `projects/{project}/locations/{location}/privateClouds/{private_cloud}/clusters/{cluster}/nodes/{node}` - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::VmwareEngine::V1::Node] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::VmwareEngine::V1::Node] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/vmware_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VmwareEngine::V1::GetNodeRequest.new - # - # # Call the get_node method. - # result = client.get_node request - # - # # The returned object is of type Google::Cloud::VmwareEngine::V1::Node. - # p result - # - def get_node request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::GetNodeRequest - - # Converts hash 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_node.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::VmwareEngine::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_node.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_node.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vmware_engine_stub.call_rpc :get_node, 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 external IP addresses assigned to VMware workload VMs in a given - # private cloud. - # - # @overload list_external_addresses(request, options = nil) - # Pass arguments to `list_external_addresses` via a request object, either of type - # {::Google::Cloud::VmwareEngine::V1::ListExternalAddressesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VmwareEngine::V1::ListExternalAddressesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_external_addresses(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) - # Pass arguments to `list_external_addresses` via keyword arguments. Note that at - # least one keyword argument is 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 private cloud to be queried for - # external IP addresses. - # Resource names are schemeless URIs that follow the conventions in - # https://cloud.google.com/apis/design/resource_names. - # For example: - # `projects/my-project/locations/us-central1-a/privateClouds/my-cloud` - # @param page_size [::Integer] - # The maximum number of external IP addresses to return in one page. - # The service may return fewer than this value. - # The maximum value is coerced to 1000. - # The default value of this field is 500. - # @param page_token [::String] - # A page token, received from a previous `ListExternalAddresses` call. - # Provide this to retrieve the subsequent page. - # - # When paginating, all other parameters provided to - # `ListExternalAddresses` must match the call that provided the page token. - # @param filter [::String] - # A filter expression that matches resources returned in the response. - # The expression must specify the field name, a comparison - # operator, and the value that you want to use for filtering. The value - # must be a string, a number, or a boolean. The comparison operator - # must be `=`, `!=`, `>`, or `<`. - # - # For example, if you are filtering a list of IP addresses, you can - # exclude the ones named `example-ip` by specifying - # `name != "example-ip"`. - # - # To filter on multiple expressions, provide each separate expression within - # parentheses. For example: - # ``` - # (name = "example-ip") - # (createTime > "2021-04-12T08:15:10.40Z") - # ``` - # - # By default, each expression is an `AND` expression. However, you - # can include `AND` and `OR` expressions explicitly. - # For example: - # ``` - # (name = "example-ip-1") AND - # (createTime > "2021-04-12T08:15:10.40Z") OR - # (name = "example-ip-2") - # ``` - # @param order_by [::String] - # Sorts list results by a certain order. By default, returned results - # are ordered by `name` in ascending order. - # You can also sort results in descending order based on the `name` value - # using `orderBy="name desc"`. - # Currently, only ordering by `name` is supported. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::VmwareEngine::V1::ExternalAddress>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::VmwareEngine::V1::ExternalAddress>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/vmware_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VmwareEngine::V1::ListExternalAddressesRequest.new - # - # # Call the list_external_addresses method. - # result = client.list_external_addresses 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::VmwareEngine::V1::ExternalAddress. - # p item - # end - # - def list_external_addresses request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::ListExternalAddressesRequest - - # Converts hash 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_external_addresses.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::VmwareEngine::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_external_addresses.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_external_addresses.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vmware_engine_stub.call_rpc :list_external_addresses, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @vmware_engine_stub, :list_external_addresses, 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 external IP addresses assigned to VMware workload VMs within the - # scope of the given network policy. - # - # @overload fetch_network_policy_external_addresses(request, options = nil) - # Pass arguments to `fetch_network_policy_external_addresses` via a request object, either of type - # {::Google::Cloud::VmwareEngine::V1::FetchNetworkPolicyExternalAddressesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VmwareEngine::V1::FetchNetworkPolicyExternalAddressesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload fetch_network_policy_external_addresses(network_policy: nil, page_size: nil, page_token: nil) - # Pass arguments to `fetch_network_policy_external_addresses` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param network_policy [::String] - # Required. The resource name of the network policy to query for assigned - # external IP addresses. Resource names are schemeless URIs that follow the - # conventions in https://cloud.google.com/apis/design/resource_names. For - # example: - # `projects/my-project/locations/us-central1/networkPolicies/my-policy` - # @param page_size [::Integer] - # The maximum number of external IP addresses to return in one page. - # The service may return fewer than this value. - # The maximum value is coerced to 1000. - # The default value of this field is 500. - # @param page_token [::String] - # A page token, received from a previous - # `FetchNetworkPolicyExternalAddresses` call. Provide this to retrieve the - # subsequent page. - # - # When paginating, all parameters provided to - # `FetchNetworkPolicyExternalAddresses`, except for `page_size` and - # `page_token`, must match the call that provided the page token. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::VmwareEngine::V1::ExternalAddress>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::VmwareEngine::V1::ExternalAddress>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/vmware_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VmwareEngine::V1::FetchNetworkPolicyExternalAddressesRequest.new - # - # # Call the fetch_network_policy_external_addresses method. - # result = client.fetch_network_policy_external_addresses 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::VmwareEngine::V1::ExternalAddress. - # p item - # end - # - def fetch_network_policy_external_addresses request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::FetchNetworkPolicyExternalAddressesRequest - - # Converts hash 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.fetch_network_policy_external_addresses.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::VmwareEngine::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.network_policy - header_params["network_policy"] = request.network_policy - 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.fetch_network_policy_external_addresses.timeout, - metadata: metadata, - retry_policy: @config.rpcs.fetch_network_policy_external_addresses.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vmware_engine_stub.call_rpc :fetch_network_policy_external_addresses, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @vmware_engine_stub, :fetch_network_policy_external_addresses, 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 - - ## - # Gets details of a single external IP address. - # - # @overload get_external_address(request, options = nil) - # Pass arguments to `get_external_address` via a request object, either of type - # {::Google::Cloud::VmwareEngine::V1::GetExternalAddressRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VmwareEngine::V1::GetExternalAddressRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_external_address(name: nil) - # Pass arguments to `get_external_address` via keyword arguments. Note that at - # least one keyword argument is 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 external IP address to retrieve. - # Resource names are schemeless URIs that follow the conventions in - # https://cloud.google.com/apis/design/resource_names. - # For example: - # `projects/my-project/locations/us-central1-a/privateClouds/my-cloud/externalAddresses/my-ip` - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::VmwareEngine::V1::ExternalAddress] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::VmwareEngine::V1::ExternalAddress] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/vmware_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VmwareEngine::V1::GetExternalAddressRequest.new - # - # # Call the get_external_address method. - # result = client.get_external_address request - # - # # The returned object is of type Google::Cloud::VmwareEngine::V1::ExternalAddress. - # p result - # - def get_external_address request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::GetExternalAddressRequest - - # Converts hash 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_external_address.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::VmwareEngine::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_external_address.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_external_address.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vmware_engine_stub.call_rpc :get_external_address, 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 `ExternalAddress` resource in a given private cloud. The - # network policy that corresponds to the private cloud must have the external - # IP address network service enabled (`NetworkPolicy.external_ip`). - # - # @overload create_external_address(request, options = nil) - # Pass arguments to `create_external_address` via a request object, either of type - # {::Google::Cloud::VmwareEngine::V1::CreateExternalAddressRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VmwareEngine::V1::CreateExternalAddressRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_external_address(parent: nil, external_address: nil, external_address_id: nil, request_id: nil) - # Pass arguments to `create_external_address` via keyword arguments. Note that at - # least one keyword argument is 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 private cloud - # to create a new external IP address in. - # Resource names are schemeless URIs that follow the conventions in - # https://cloud.google.com/apis/design/resource_names. - # For example: - # `projects/my-project/locations/us-central1-a/privateClouds/my-cloud` - # @param external_address [::Google::Cloud::VmwareEngine::V1::ExternalAddress, ::Hash] - # Required. The initial description of a new external IP address. - # @param external_address_id [::String] - # Required. The user-provided identifier of the `ExternalAddress` to be - # created. This identifier must be unique among `ExternalAddress` resources - # within the parent and becomes the final token in the name URI. The - # identifier must meet the following requirements: - # - # * Only contains 1-63 alphanumeric characters and hyphens - # * Begins with an alphabetical character - # * Ends with a non-hyphen character - # * Not formatted as a UUID - # * Complies with [RFC 1034](https://datatracker.ietf.org/doc/html/rfc1034) - # (section 3.5) - # @param request_id [::String] - # Optional. A request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server guarantees that a - # request doesn't result in creation of duplicate commitments for at least 60 - # minutes. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request ID, - # the server can check if the original operation with the same request ID was - # received, and if so, will ignore the second request. This prevents clients - # from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # - # @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/vmware_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VmwareEngine::V1::CreateExternalAddressRequest.new - # - # # Call the create_external_address method. - # result = client.create_external_address 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_external_address request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::CreateExternalAddressRequest - - # Converts hash 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_external_address.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::VmwareEngine::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_external_address.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_external_address.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vmware_engine_stub.call_rpc :create_external_address, 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 - - ## - # Updates the parameters of a single external IP address. - # Only fields specified in `update_mask` are applied. - # - # During operation processing, the resource is temporarily in the `ACTIVE` - # state before the operation fully completes. For that period of time, you - # can't update the resource. Use the operation status to determine when the - # processing fully completes. - # - # @overload update_external_address(request, options = nil) - # Pass arguments to `update_external_address` via a request object, either of type - # {::Google::Cloud::VmwareEngine::V1::UpdateExternalAddressRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VmwareEngine::V1::UpdateExternalAddressRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_external_address(update_mask: nil, external_address: nil, request_id: nil) - # Pass arguments to `update_external_address` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Required. Field mask is used to specify the fields to be overwritten in the - # `ExternalAddress` resource by the update. - # The fields specified in the `update_mask` are relative to the resource, not - # the full request. A field will be overwritten if it is in the mask. If the - # user does not provide a mask then all fields will be overwritten. - # @param external_address [::Google::Cloud::VmwareEngine::V1::ExternalAddress, ::Hash] - # Required. External IP address description. - # @param request_id [::String] - # Optional. A request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server guarantees that a - # request doesn't result in creation of duplicate commitments for at least 60 - # minutes. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request ID, - # the server can check if the original operation with the same request ID was - # received, and if so, will ignore the second request. This prevents clients - # from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # - # @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/vmware_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VmwareEngine::V1::UpdateExternalAddressRequest.new - # - # # Call the update_external_address method. - # result = client.update_external_address 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 update_external_address request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::UpdateExternalAddressRequest - - # Converts hash 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_external_address.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::VmwareEngine::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.external_address&.name - header_params["external_address.name"] = request.external_address.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_external_address.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_external_address.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vmware_engine_stub.call_rpc :update_external_address, 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 single external IP address. When you delete an external IP - # address, connectivity between the external IP address and the corresponding - # internal IP address is lost. - # - # @overload delete_external_address(request, options = nil) - # Pass arguments to `delete_external_address` via a request object, either of type - # {::Google::Cloud::VmwareEngine::V1::DeleteExternalAddressRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VmwareEngine::V1::DeleteExternalAddressRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_external_address(name: nil, request_id: nil) - # Pass arguments to `delete_external_address` via keyword arguments. Note that at - # least one keyword argument is 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 external IP address to delete. - # Resource names are schemeless URIs that follow the conventions in - # https://cloud.google.com/apis/design/resource_names. - # For example: - # `projects/my-project/locations/us-central1-a/privateClouds/my-cloud/externalAddresses/my-ip` - # @param request_id [::String] - # Optional. A request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server guarantees that a - # request doesn't result in creation of duplicate commitments for at least 60 - # minutes. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request - # ID, the server can check if the original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # - # @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/vmware_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VmwareEngine::V1::DeleteExternalAddressRequest.new - # - # # Call the delete_external_address method. - # result = client.delete_external_address 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_external_address request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::DeleteExternalAddressRequest - - # Converts hash 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_external_address.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::VmwareEngine::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_external_address.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_external_address.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vmware_engine_stub.call_rpc :delete_external_address, 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 - - ## - # Lists subnets in a given private cloud. - # - # @overload list_subnets(request, options = nil) - # Pass arguments to `list_subnets` via a request object, either of type - # {::Google::Cloud::VmwareEngine::V1::ListSubnetsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VmwareEngine::V1::ListSubnetsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_subnets(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_subnets` via keyword arguments. Note that at - # least one keyword argument is 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 private cloud to be queried for - # subnets. - # Resource names are schemeless URIs that follow the conventions in - # https://cloud.google.com/apis/design/resource_names. - # For example: - # `projects/my-project/locations/us-central1-a/privateClouds/my-cloud` - # @param page_size [::Integer] - # The maximum number of subnets to return in one page. - # The service may return fewer than this value. - # The maximum value is coerced to 1000. - # The default value of this field is 500. - # @param page_token [::String] - # A page token, received from a previous `ListSubnetsRequest` call. - # Provide this to retrieve the subsequent page. - # - # When paginating, all other parameters provided to - # `ListSubnetsRequest` must match the call that provided the page token. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::VmwareEngine::V1::Subnet>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::VmwareEngine::V1::Subnet>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/vmware_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VmwareEngine::V1::ListSubnetsRequest.new - # - # # Call the list_subnets method. - # result = client.list_subnets 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::VmwareEngine::V1::Subnet. - # p item - # end - # - def list_subnets request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::ListSubnetsRequest - - # Converts hash 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_subnets.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::VmwareEngine::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_subnets.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_subnets.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vmware_engine_stub.call_rpc :list_subnets, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @vmware_engine_stub, :list_subnets, 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 - - ## - # Gets details of a single subnet. - # - # @overload get_subnet(request, options = nil) - # Pass arguments to `get_subnet` via a request object, either of type - # {::Google::Cloud::VmwareEngine::V1::GetSubnetRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VmwareEngine::V1::GetSubnetRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_subnet(name: nil) - # Pass arguments to `get_subnet` via keyword arguments. Note that at - # least one keyword argument is 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 subnet to retrieve. - # Resource names are schemeless URIs that follow the conventions in - # https://cloud.google.com/apis/design/resource_names. - # For example: - # `projects/my-project/locations/us-central1-a/privateClouds/my-cloud/subnets/my-subnet` - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::VmwareEngine::V1::Subnet] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::VmwareEngine::V1::Subnet] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/vmware_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VmwareEngine::V1::GetSubnetRequest.new - # - # # Call the get_subnet method. - # result = client.get_subnet request - # - # # The returned object is of type Google::Cloud::VmwareEngine::V1::Subnet. - # p result - # - def get_subnet request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::GetSubnetRequest - - # Converts hash 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_subnet.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::VmwareEngine::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_subnet.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_subnet.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vmware_engine_stub.call_rpc :get_subnet, 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 parameters of a single subnet. Only fields specified in - # `update_mask` are applied. - # - # *Note*: This API is synchronous and always returns a successful - # `google.longrunning.Operation` (LRO). The returned LRO will only have - # `done` and `response` fields. - # - # @overload update_subnet(request, options = nil) - # Pass arguments to `update_subnet` via a request object, either of type - # {::Google::Cloud::VmwareEngine::V1::UpdateSubnetRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VmwareEngine::V1::UpdateSubnetRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_subnet(update_mask: nil, subnet: nil) - # Pass arguments to `update_subnet` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Required. Field mask is used to specify the fields to be overwritten in the - # `Subnet` resource by the update. - # The fields specified in the `update_mask` are relative to the resource, not - # the full request. A field will be overwritten if it is in the mask. If the - # user does not provide a mask then all fields will be overwritten. - # @param subnet [::Google::Cloud::VmwareEngine::V1::Subnet, ::Hash] - # Required. Subnet description. - # - # @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/vmware_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VmwareEngine::V1::UpdateSubnetRequest.new - # - # # Call the update_subnet method. - # result = client.update_subnet 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 update_subnet request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::UpdateSubnetRequest - - # Converts hash 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_subnet.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::VmwareEngine::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.subnet&.name - header_params["subnet.name"] = request.subnet.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_subnet.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_subnet.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vmware_engine_stub.call_rpc :update_subnet, 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 - - ## - # Lists `ExternalAccessRule` resources in the specified network policy. - # - # @overload list_external_access_rules(request, options = nil) - # Pass arguments to `list_external_access_rules` via a request object, either of type - # {::Google::Cloud::VmwareEngine::V1::ListExternalAccessRulesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VmwareEngine::V1::ListExternalAccessRulesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_external_access_rules(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) - # Pass arguments to `list_external_access_rules` via keyword arguments. Note that at - # least one keyword argument is 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 network policy to query for external - # access firewall rules. Resource names are schemeless URIs that follow the - # conventions in https://cloud.google.com/apis/design/resource_names. For - # example: - # `projects/my-project/locations/us-central1/networkPolicies/my-policy` - # @param page_size [::Integer] - # The maximum number of external access rules to return in one page. - # The service may return fewer than this value. - # The maximum value is coerced to 1000. - # The default value of this field is 500. - # @param page_token [::String] - # A page token, received from a previous `ListExternalAccessRulesRequest` - # call. Provide this to retrieve the subsequent page. - # - # When paginating, all other parameters provided to - # `ListExternalAccessRulesRequest` must match the call that provided the page - # token. - # @param filter [::String] - # A filter expression that matches resources returned in the response. - # The expression must specify the field name, a comparison - # operator, and the value that you want to use for filtering. The value - # must be a string, a number, or a boolean. The comparison operator - # must be `=`, `!=`, `>`, or `<`. - # - # For example, if you are filtering a list of external access rules, you can - # exclude the ones named `example-rule` by specifying - # `name != "example-rule"`. - # - # To filter on multiple expressions, provide each separate expression within - # parentheses. For example: - # ``` - # (name = "example-rule") - # (createTime > "2021-04-12T08:15:10.40Z") - # ``` - # - # By default, each expression is an `AND` expression. However, you - # can include `AND` and `OR` expressions explicitly. - # For example: - # ``` - # (name = "example-rule-1") AND - # (createTime > "2021-04-12T08:15:10.40Z") OR - # (name = "example-rule-2") - # ``` - # @param order_by [::String] - # Sorts list results by a certain order. By default, returned results - # are ordered by `name` in ascending order. - # You can also sort results in descending order based on the `name` value - # using `orderBy="name desc"`. - # Currently, only ordering by `name` is supported. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::VmwareEngine::V1::ExternalAccessRule>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::VmwareEngine::V1::ExternalAccessRule>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/vmware_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VmwareEngine::V1::ListExternalAccessRulesRequest.new - # - # # Call the list_external_access_rules method. - # result = client.list_external_access_rules 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::VmwareEngine::V1::ExternalAccessRule. - # p item - # end - # - def list_external_access_rules request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::ListExternalAccessRulesRequest - - # Converts hash 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_external_access_rules.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::VmwareEngine::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_external_access_rules.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_external_access_rules.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vmware_engine_stub.call_rpc :list_external_access_rules, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @vmware_engine_stub, :list_external_access_rules, 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 - - ## - # Gets details of a single external access rule. - # - # @overload get_external_access_rule(request, options = nil) - # Pass arguments to `get_external_access_rule` via a request object, either of type - # {::Google::Cloud::VmwareEngine::V1::GetExternalAccessRuleRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VmwareEngine::V1::GetExternalAccessRuleRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_external_access_rule(name: nil) - # Pass arguments to `get_external_access_rule` via keyword arguments. Note that at - # least one keyword argument is 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 external access firewall rule to - # retrieve. Resource names are schemeless URIs that follow the conventions in - # https://cloud.google.com/apis/design/resource_names. - # For example: - # `projects/my-project/locations/us-central1/networkPolicies/my-policy/externalAccessRules/my-rule` - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::VmwareEngine::V1::ExternalAccessRule] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::VmwareEngine::V1::ExternalAccessRule] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/vmware_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VmwareEngine::V1::GetExternalAccessRuleRequest.new - # - # # Call the get_external_access_rule method. - # result = client.get_external_access_rule request - # - # # The returned object is of type Google::Cloud::VmwareEngine::V1::ExternalAccessRule. - # p result - # - def get_external_access_rule request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::GetExternalAccessRuleRequest - - # Converts hash 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_external_access_rule.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::VmwareEngine::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_external_access_rule.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_external_access_rule.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vmware_engine_stub.call_rpc :get_external_access_rule, 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 external access rule in a given network policy. - # - # @overload create_external_access_rule(request, options = nil) - # Pass arguments to `create_external_access_rule` via a request object, either of type - # {::Google::Cloud::VmwareEngine::V1::CreateExternalAccessRuleRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VmwareEngine::V1::CreateExternalAccessRuleRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_external_access_rule(parent: nil, external_access_rule: nil, external_access_rule_id: nil, request_id: nil) - # Pass arguments to `create_external_access_rule` via keyword arguments. Note that at - # least one keyword argument is 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 network policy - # to create a new external access firewall rule in. - # Resource names are schemeless URIs that follow the conventions in - # https://cloud.google.com/apis/design/resource_names. - # For example: - # `projects/my-project/locations/us-central1/networkPolicies/my-policy` - # @param external_access_rule [::Google::Cloud::VmwareEngine::V1::ExternalAccessRule, ::Hash] - # Required. The initial description of a new external access rule. - # @param external_access_rule_id [::String] - # Required. The user-provided identifier of the `ExternalAccessRule` to be - # created. This identifier must be unique among `ExternalAccessRule` - # resources within the parent and becomes the final token in the name URI. - # The identifier must meet the following requirements: - # - # * Only contains 1-63 alphanumeric characters and hyphens - # * Begins with an alphabetical character - # * Ends with a non-hyphen character - # * Not formatted as a UUID - # * Complies with [RFC 1034](https://datatracker.ietf.org/doc/html/rfc1034) - # (section 3.5) - # @param request_id [::String] - # A request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server guarantees that a - # request doesn't result in creation of duplicate commitments for at least 60 - # minutes. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request ID, - # the server can check if the original operation with the same request ID was - # received, and if so, will ignore the second request. This prevents clients - # from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # - # @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/vmware_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VmwareEngine::V1::CreateExternalAccessRuleRequest.new - # - # # Call the create_external_access_rule method. - # result = client.create_external_access_rule 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_external_access_rule request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::CreateExternalAccessRuleRequest - - # Converts hash 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_external_access_rule.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::VmwareEngine::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_external_access_rule.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_external_access_rule.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vmware_engine_stub.call_rpc :create_external_access_rule, 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 - - ## - # Updates the parameters of a single external access rule. - # Only fields specified in `update_mask` are applied. - # - # @overload update_external_access_rule(request, options = nil) - # Pass arguments to `update_external_access_rule` via a request object, either of type - # {::Google::Cloud::VmwareEngine::V1::UpdateExternalAccessRuleRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VmwareEngine::V1::UpdateExternalAccessRuleRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_external_access_rule(update_mask: nil, external_access_rule: nil, request_id: nil) - # Pass arguments to `update_external_access_rule` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Required. Field mask is used to specify the fields to be overwritten in the - # `ExternalAccessRule` resource by the update. - # The fields specified in the `update_mask` are relative to the resource, not - # the full request. A field will be overwritten if it is in the mask. If the - # user does not provide a mask then all fields will be overwritten. - # @param external_access_rule [::Google::Cloud::VmwareEngine::V1::ExternalAccessRule, ::Hash] - # Required. Description of the external access rule. - # @param request_id [::String] - # Optional. A request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server guarantees that a - # request doesn't result in creation of duplicate commitments for at least 60 - # minutes. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request ID, - # the server can check if the original operation with the same request ID was - # received, and if so, will ignore the second request. This prevents clients - # from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # - # @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/vmware_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VmwareEngine::V1::UpdateExternalAccessRuleRequest.new - # - # # Call the update_external_access_rule method. - # result = client.update_external_access_rule 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 update_external_access_rule request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::UpdateExternalAccessRuleRequest - - # Converts hash 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_external_access_rule.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::VmwareEngine::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.external_access_rule&.name - header_params["external_access_rule.name"] = request.external_access_rule.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_external_access_rule.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_external_access_rule.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vmware_engine_stub.call_rpc :update_external_access_rule, 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 single external access rule. - # - # @overload delete_external_access_rule(request, options = nil) - # Pass arguments to `delete_external_access_rule` via a request object, either of type - # {::Google::Cloud::VmwareEngine::V1::DeleteExternalAccessRuleRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VmwareEngine::V1::DeleteExternalAccessRuleRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_external_access_rule(name: nil, request_id: nil) - # Pass arguments to `delete_external_access_rule` via keyword arguments. Note that at - # least one keyword argument is 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 external access firewall rule to delete. - # Resource names are schemeless URIs that follow the conventions in - # https://cloud.google.com/apis/design/resource_names. - # For example: - # `projects/my-project/locations/us-central1/networkPolicies/my-policy/externalAccessRules/my-rule` - # @param request_id [::String] - # Optional. A request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server guarantees that a - # request doesn't result in creation of duplicate commitments for at least 60 - # minutes. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request - # ID, the server can check if the original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # - # @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/vmware_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VmwareEngine::V1::DeleteExternalAccessRuleRequest.new - # - # # Call the delete_external_access_rule method. - # result = client.delete_external_access_rule 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_external_access_rule request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::DeleteExternalAccessRuleRequest - - # Converts hash 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_external_access_rule.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::VmwareEngine::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_external_access_rule.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_external_access_rule.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vmware_engine_stub.call_rpc :delete_external_access_rule, 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 - - ## - # Lists logging servers configured for a given private - # cloud. - # - # @overload list_logging_servers(request, options = nil) - # Pass arguments to `list_logging_servers` via a request object, either of type - # {::Google::Cloud::VmwareEngine::V1::ListLoggingServersRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VmwareEngine::V1::ListLoggingServersRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_logging_servers(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) - # Pass arguments to `list_logging_servers` via keyword arguments. Note that at - # least one keyword argument is 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 private cloud to be queried for - # logging servers. - # Resource names are schemeless URIs that follow the conventions in - # https://cloud.google.com/apis/design/resource_names. - # For example: - # `projects/my-project/locations/us-central1-a/privateClouds/my-cloud` - # @param page_size [::Integer] - # The maximum number of logging servers to return in one page. - # The service may return fewer than this value. - # The maximum value is coerced to 1000. - # The default value of this field is 500. - # @param page_token [::String] - # A page token, received from a previous `ListLoggingServersRequest` call. - # Provide this to retrieve the subsequent page. - # - # When paginating, all other parameters provided to - # `ListLoggingServersRequest` must match the call that provided the page - # token. - # @param filter [::String] - # A filter expression that matches resources returned in the response. - # The expression must specify the field name, a comparison - # operator, and the value that you want to use for filtering. The value - # must be a string, a number, or a boolean. The comparison operator - # must be `=`, `!=`, `>`, or `<`. - # - # For example, if you are filtering a list of logging servers, you can - # exclude the ones named `example-server` by specifying - # `name != "example-server"`. - # - # To filter on multiple expressions, provide each separate expression within - # parentheses. For example: - # ``` - # (name = "example-server") - # (createTime > "2021-04-12T08:15:10.40Z") - # ``` - # - # By default, each expression is an `AND` expression. However, you - # can include `AND` and `OR` expressions explicitly. - # For example: - # ``` - # (name = "example-server-1") AND - # (createTime > "2021-04-12T08:15:10.40Z") OR - # (name = "example-server-2") - # ``` - # @param order_by [::String] - # Sorts list results by a certain order. By default, returned results - # are ordered by `name` in ascending order. - # You can also sort results in descending order based on the `name` value - # using `orderBy="name desc"`. - # Currently, only ordering by `name` is supported. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::VmwareEngine::V1::LoggingServer>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::VmwareEngine::V1::LoggingServer>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/vmware_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VmwareEngine::V1::ListLoggingServersRequest.new - # - # # Call the list_logging_servers method. - # result = client.list_logging_servers 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::VmwareEngine::V1::LoggingServer. - # p item - # end - # - def list_logging_servers request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::ListLoggingServersRequest - - # Converts hash 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_logging_servers.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::VmwareEngine::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_logging_servers.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_logging_servers.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vmware_engine_stub.call_rpc :list_logging_servers, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @vmware_engine_stub, :list_logging_servers, 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 - - ## - # Gets details of a logging server. - # - # @overload get_logging_server(request, options = nil) - # Pass arguments to `get_logging_server` via a request object, either of type - # {::Google::Cloud::VmwareEngine::V1::GetLoggingServerRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VmwareEngine::V1::GetLoggingServerRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_logging_server(name: nil) - # Pass arguments to `get_logging_server` via keyword arguments. Note that at - # least one keyword argument is 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 Logging Server to retrieve. - # Resource names are schemeless URIs that follow the conventions in - # https://cloud.google.com/apis/design/resource_names. - # For example: - # `projects/my-project/locations/us-central1-a/privateClouds/my-cloud/loggingServers/my-logging-server` - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::VmwareEngine::V1::LoggingServer] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::VmwareEngine::V1::LoggingServer] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/vmware_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VmwareEngine::V1::GetLoggingServerRequest.new - # - # # Call the get_logging_server method. - # result = client.get_logging_server request - # - # # The returned object is of type Google::Cloud::VmwareEngine::V1::LoggingServer. - # p result - # - def get_logging_server request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::GetLoggingServerRequest - - # Converts hash 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_logging_server.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::VmwareEngine::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_logging_server.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_logging_server.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vmware_engine_stub.call_rpc :get_logging_server, 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 logging server for a given private cloud. - # - # @overload create_logging_server(request, options = nil) - # Pass arguments to `create_logging_server` via a request object, either of type - # {::Google::Cloud::VmwareEngine::V1::CreateLoggingServerRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VmwareEngine::V1::CreateLoggingServerRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_logging_server(parent: nil, logging_server: nil, logging_server_id: nil, request_id: nil) - # Pass arguments to `create_logging_server` via keyword arguments. Note that at - # least one keyword argument is 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 private cloud - # to create a new Logging Server in. - # Resource names are schemeless URIs that follow the conventions in - # https://cloud.google.com/apis/design/resource_names. - # For example: - # `projects/my-project/locations/us-central1-a/privateClouds/my-cloud` - # @param logging_server [::Google::Cloud::VmwareEngine::V1::LoggingServer, ::Hash] - # Required. The initial description of a new logging server. - # @param logging_server_id [::String] - # Required. The user-provided identifier of the `LoggingServer` to be - # created. This identifier must be unique among `LoggingServer` resources - # within the parent and becomes the final token in the name URI. - # The identifier must meet the following requirements: - # - # * Only contains 1-63 alphanumeric characters and hyphens - # * Begins with an alphabetical character - # * Ends with a non-hyphen character - # * Not formatted as a UUID - # * Complies with [RFC 1034](https://datatracker.ietf.org/doc/html/rfc1034) - # (section 3.5) - # @param request_id [::String] - # Optional. A request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server guarantees that a - # request doesn't result in creation of duplicate commitments for at least 60 - # minutes. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request ID, - # the server can check if original operation with the same request ID was - # received, and if so, will ignore the second request. This prevents clients - # from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # - # @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/vmware_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VmwareEngine::V1::CreateLoggingServerRequest.new - # - # # Call the create_logging_server method. - # result = client.create_logging_server 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_logging_server request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::CreateLoggingServerRequest - - # Converts hash 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_logging_server.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::VmwareEngine::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_logging_server.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_logging_server.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vmware_engine_stub.call_rpc :create_logging_server, 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 - - ## - # Updates the parameters of a single logging server. - # Only fields specified in `update_mask` are applied. - # - # @overload update_logging_server(request, options = nil) - # Pass arguments to `update_logging_server` via a request object, either of type - # {::Google::Cloud::VmwareEngine::V1::UpdateLoggingServerRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VmwareEngine::V1::UpdateLoggingServerRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_logging_server(update_mask: nil, logging_server: nil, request_id: nil) - # Pass arguments to `update_logging_server` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Required. Field mask is used to specify the fields to be overwritten in the - # `LoggingServer` resource by the update. - # The fields specified in the `update_mask` are relative to the resource, not - # the full request. A field will be overwritten if it is in the mask. If the - # user does not provide a mask then all fields will be overwritten. - # @param logging_server [::Google::Cloud::VmwareEngine::V1::LoggingServer, ::Hash] - # Required. Logging server description. - # @param request_id [::String] - # Optional. A request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server guarantees that a - # request doesn't result in creation of duplicate commitments for at least 60 - # minutes. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request ID, - # the server can check if original operation with the same request ID was - # received, and if so, will ignore the second request. This prevents clients - # from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # - # @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/vmware_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VmwareEngine::V1::UpdateLoggingServerRequest.new - # - # # Call the update_logging_server method. - # result = client.update_logging_server 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 update_logging_server request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::UpdateLoggingServerRequest - - # Converts hash 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_logging_server.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::VmwareEngine::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.logging_server&.name - header_params["logging_server.name"] = request.logging_server.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_logging_server.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_logging_server.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vmware_engine_stub.call_rpc :update_logging_server, 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 single logging server. - # - # @overload delete_logging_server(request, options = nil) - # Pass arguments to `delete_logging_server` via a request object, either of type - # {::Google::Cloud::VmwareEngine::V1::DeleteLoggingServerRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VmwareEngine::V1::DeleteLoggingServerRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_logging_server(name: nil, request_id: nil) - # Pass arguments to `delete_logging_server` via keyword arguments. Note that at - # least one keyword argument is 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 logging server to delete. - # Resource names are schemeless URIs that follow the conventions in - # https://cloud.google.com/apis/design/resource_names. - # For example: - # `projects/my-project/locations/us-central1-a/privateClouds/my-cloud/loggingServers/my-logging-server` - # @param request_id [::String] - # Optional. A request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server guarantees that a - # request doesn't result in creation of duplicate commitments for at least 60 - # minutes. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # - # @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/vmware_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VmwareEngine::V1::DeleteLoggingServerRequest.new - # - # # Call the delete_logging_server method. - # result = client.delete_logging_server 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_logging_server request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::DeleteLoggingServerRequest - - # Converts hash 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_logging_server.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::VmwareEngine::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_logging_server.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_logging_server.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vmware_engine_stub.call_rpc :delete_logging_server, 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 - - ## - # Lists node types - # - # @overload list_node_types(request, options = nil) - # Pass arguments to `list_node_types` via a request object, either of type - # {::Google::Cloud::VmwareEngine::V1::ListNodeTypesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VmwareEngine::V1::ListNodeTypesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_node_types(parent: nil, page_size: nil, page_token: nil, filter: nil) - # Pass arguments to `list_node_types` via keyword arguments. Note that at - # least one keyword argument is 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 to be queried for node types. - # Resource names are schemeless URIs that follow the conventions in - # https://cloud.google.com/apis/design/resource_names. - # For example: - # `projects/my-project/locations/us-central1-a` - # @param page_size [::Integer] - # The maximum number of node types to return in one page. - # The service may return fewer than this value. - # The maximum value is coerced to 1000. - # The default value of this field is 500. - # @param page_token [::String] - # A page token, received from a previous `ListNodeTypes` call. - # Provide this to retrieve the subsequent page. - # - # When paginating, all other parameters provided to - # `ListNodeTypes` must match the call that provided the page token. - # @param filter [::String] - # A filter expression that matches resources returned in the response. - # The expression must specify the field name, a comparison - # operator, and the value that you want to use for filtering. The value - # must be a string, a number, or a boolean. The comparison operator - # must be `=`, `!=`, `>`, or `<`. - # - # For example, if you are filtering a list of node types, you can - # exclude the ones named `standard-72` by specifying - # `name != "standard-72"`. - # - # To filter on multiple expressions, provide each separate expression within - # parentheses. For example: - # ``` - # (name = "standard-72") - # (virtual_cpu_count > 2) - # ``` - # - # By default, each expression is an `AND` expression. However, you - # can include `AND` and `OR` expressions explicitly. - # For example: - # ``` - # (name = "standard-96") AND - # (virtual_cpu_count > 2) OR - # (name = "standard-72") - # ``` - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::VmwareEngine::V1::NodeType>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::VmwareEngine::V1::NodeType>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/vmware_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VmwareEngine::V1::ListNodeTypesRequest.new - # - # # Call the list_node_types method. - # result = client.list_node_types 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::VmwareEngine::V1::NodeType. - # p item - # end - # - def list_node_types request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::ListNodeTypesRequest - - # Converts hash 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_node_types.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::VmwareEngine::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_node_types.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_node_types.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vmware_engine_stub.call_rpc :list_node_types, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @vmware_engine_stub, :list_node_types, 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 - - ## - # Gets details of a single `NodeType`. - # - # @overload get_node_type(request, options = nil) - # Pass arguments to `get_node_type` via a request object, either of type - # {::Google::Cloud::VmwareEngine::V1::GetNodeTypeRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VmwareEngine::V1::GetNodeTypeRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_node_type(name: nil) - # Pass arguments to `get_node_type` via keyword arguments. Note that at - # least one keyword argument is 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 node type to retrieve. - # Resource names are schemeless URIs that follow the conventions in - # https://cloud.google.com/apis/design/resource_names. - # For example: - # `projects/my-proj/locations/us-central1-a/nodeTypes/standard-72` - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::VmwareEngine::V1::NodeType] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::VmwareEngine::V1::NodeType] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/vmware_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VmwareEngine::V1::GetNodeTypeRequest.new - # - # # Call the get_node_type method. - # result = client.get_node_type request - # - # # The returned object is of type Google::Cloud::VmwareEngine::V1::NodeType. - # p result - # - def get_node_type request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::GetNodeTypeRequest - - # Converts hash 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_node_type.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::VmwareEngine::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_node_type.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_node_type.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vmware_engine_stub.call_rpc :get_node_type, 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 - - ## - # Gets details of credentials for NSX appliance. - # - # @overload show_nsx_credentials(request, options = nil) - # Pass arguments to `show_nsx_credentials` via a request object, either of type - # {::Google::Cloud::VmwareEngine::V1::ShowNsxCredentialsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VmwareEngine::V1::ShowNsxCredentialsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_nsx_credentials(private_cloud: nil) - # Pass arguments to `show_nsx_credentials` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param private_cloud [::String] - # Required. The resource name of the private cloud - # to be queried for credentials. - # Resource names are schemeless URIs that follow the conventions in - # https://cloud.google.com/apis/design/resource_names. - # For example: - # `projects/my-project/locations/us-central1-a/privateClouds/my-cloud` - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::VmwareEngine::V1::Credentials] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::VmwareEngine::V1::Credentials] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/vmware_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VmwareEngine::V1::ShowNsxCredentialsRequest.new - # - # # Call the show_nsx_credentials method. - # result = client.show_nsx_credentials request - # - # # The returned object is of type Google::Cloud::VmwareEngine::V1::Credentials. - # p result - # - def show_nsx_credentials request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::ShowNsxCredentialsRequest - - # Converts hash 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_nsx_credentials.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::VmwareEngine::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.private_cloud - header_params["private_cloud"] = request.private_cloud - 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_nsx_credentials.timeout, - metadata: metadata, - retry_policy: @config.rpcs.show_nsx_credentials.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vmware_engine_stub.call_rpc :show_nsx_credentials, 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 - - ## - # Gets details of credentials for Vcenter appliance. - # - # @overload show_vcenter_credentials(request, options = nil) - # Pass arguments to `show_vcenter_credentials` via a request object, either of type - # {::Google::Cloud::VmwareEngine::V1::ShowVcenterCredentialsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VmwareEngine::V1::ShowVcenterCredentialsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_vcenter_credentials(private_cloud: nil, username: nil) - # Pass arguments to `show_vcenter_credentials` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param private_cloud [::String] - # Required. The resource name of the private cloud - # to be queried for credentials. - # Resource names are schemeless URIs that follow the conventions in - # https://cloud.google.com/apis/design/resource_names. - # For example: - # `projects/my-project/locations/us-central1-a/privateClouds/my-cloud` - # @param username [::String] - # Optional. The username of the user to be queried for credentials. - # The default value of this field is CloudOwner@gve.local. - # The provided value must be one of the following: - # CloudOwner@gve.local, - # solution-user-01@gve.local, - # solution-user-02@gve.local, - # solution-user-03@gve.local, - # solution-user-04@gve.local, - # solution-user-05@gve.local, - # zertoadmin@gve.local. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::VmwareEngine::V1::Credentials] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::VmwareEngine::V1::Credentials] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/vmware_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VmwareEngine::V1::ShowVcenterCredentialsRequest.new - # - # # Call the show_vcenter_credentials method. - # result = client.show_vcenter_credentials request - # - # # The returned object is of type Google::Cloud::VmwareEngine::V1::Credentials. - # p result - # - def show_vcenter_credentials request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::ShowVcenterCredentialsRequest - - # Converts hash 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_vcenter_credentials.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::VmwareEngine::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.private_cloud - header_params["private_cloud"] = request.private_cloud - 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_vcenter_credentials.timeout, - metadata: metadata, - retry_policy: @config.rpcs.show_vcenter_credentials.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vmware_engine_stub.call_rpc :show_vcenter_credentials, 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 - - ## - # Resets credentials of the NSX appliance. - # - # @overload reset_nsx_credentials(request, options = nil) - # Pass arguments to `reset_nsx_credentials` via a request object, either of type - # {::Google::Cloud::VmwareEngine::V1::ResetNsxCredentialsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VmwareEngine::V1::ResetNsxCredentialsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload reset_nsx_credentials(private_cloud: nil, request_id: nil) - # Pass arguments to `reset_nsx_credentials` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param private_cloud [::String] - # Required. The resource name of the private cloud - # to reset credentials for. - # Resource names are schemeless URIs that follow the conventions in - # https://cloud.google.com/apis/design/resource_names. - # For example: - # `projects/my-project/locations/us-central1-a/privateClouds/my-cloud` - # @param request_id [::String] - # Optional. A request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server guarantees that a - # request doesn't result in creation of duplicate commitments for at least 60 - # minutes. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # - # @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/vmware_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VmwareEngine::V1::ResetNsxCredentialsRequest.new - # - # # Call the reset_nsx_credentials method. - # result = client.reset_nsx_credentials 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 reset_nsx_credentials request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::ResetNsxCredentialsRequest - - # Converts hash 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.reset_nsx_credentials.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::VmwareEngine::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.private_cloud - header_params["private_cloud"] = request.private_cloud - 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.reset_nsx_credentials.timeout, - metadata: metadata, - retry_policy: @config.rpcs.reset_nsx_credentials.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vmware_engine_stub.call_rpc :reset_nsx_credentials, 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 - - ## - # Resets credentials of the Vcenter appliance. - # - # @overload reset_vcenter_credentials(request, options = nil) - # Pass arguments to `reset_vcenter_credentials` via a request object, either of type - # {::Google::Cloud::VmwareEngine::V1::ResetVcenterCredentialsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VmwareEngine::V1::ResetVcenterCredentialsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload reset_vcenter_credentials(private_cloud: nil, request_id: nil, username: nil) - # Pass arguments to `reset_vcenter_credentials` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param private_cloud [::String] - # Required. The resource name of the private cloud - # to reset credentials for. - # Resource names are schemeless URIs that follow the conventions in - # https://cloud.google.com/apis/design/resource_names. - # For example: - # `projects/my-project/locations/us-central1-a/privateClouds/my-cloud` - # @param request_id [::String] - # Optional. A request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server guarantees that a - # request doesn't result in creation of duplicate commitments for at least 60 - # minutes. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @param username [::String] - # Optional. The username of the user to be to reset the credentials. - # The default value of this field is CloudOwner@gve.local. - # The provided value should be one of the following: - # solution-user-01@gve.local, - # solution-user-02@gve.local, - # solution-user-03@gve.local, - # solution-user-04@gve.local, - # solution-user-05@gve.local, - # zertoadmin@gve.local. - # - # @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/vmware_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VmwareEngine::V1::ResetVcenterCredentialsRequest.new - # - # # Call the reset_vcenter_credentials method. - # result = client.reset_vcenter_credentials 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 reset_vcenter_credentials request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::ResetVcenterCredentialsRequest - - # Converts hash 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.reset_vcenter_credentials.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::VmwareEngine::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.private_cloud - header_params["private_cloud"] = request.private_cloud - 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.reset_vcenter_credentials.timeout, - metadata: metadata, - retry_policy: @config.rpcs.reset_vcenter_credentials.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vmware_engine_stub.call_rpc :reset_vcenter_credentials, 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 - - ## - # Gets details of the `DnsForwarding` config. - # - # @overload get_dns_forwarding(request, options = nil) - # Pass arguments to `get_dns_forwarding` via a request object, either of type - # {::Google::Cloud::VmwareEngine::V1::GetDnsForwardingRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VmwareEngine::V1::GetDnsForwardingRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_dns_forwarding(name: nil) - # Pass arguments to `get_dns_forwarding` via keyword arguments. Note that at - # least one keyword argument is 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 a `DnsForwarding` to retrieve. - # Resource names are schemeless URIs that follow the conventions in - # https://cloud.google.com/apis/design/resource_names. - # For example: - # `projects/my-project/locations/us-central1-a/privateClouds/my-cloud/dnsForwarding` - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::VmwareEngine::V1::DnsForwarding] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::VmwareEngine::V1::DnsForwarding] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/vmware_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VmwareEngine::V1::GetDnsForwardingRequest.new - # - # # Call the get_dns_forwarding method. - # result = client.get_dns_forwarding request - # - # # The returned object is of type Google::Cloud::VmwareEngine::V1::DnsForwarding. - # p result - # - def get_dns_forwarding request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::GetDnsForwardingRequest - - # Converts hash 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_dns_forwarding.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::VmwareEngine::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_dns_forwarding.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_dns_forwarding.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vmware_engine_stub.call_rpc :get_dns_forwarding, 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 parameters of the `DnsForwarding` config, like associated - # domains. Only fields specified in `update_mask` are applied. - # - # @overload update_dns_forwarding(request, options = nil) - # Pass arguments to `update_dns_forwarding` via a request object, either of type - # {::Google::Cloud::VmwareEngine::V1::UpdateDnsForwardingRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VmwareEngine::V1::UpdateDnsForwardingRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_dns_forwarding(dns_forwarding: nil, update_mask: nil, request_id: nil) - # Pass arguments to `update_dns_forwarding` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param dns_forwarding [::Google::Cloud::VmwareEngine::V1::DnsForwarding, ::Hash] - # Required. DnsForwarding config details. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Required. Field mask is used to specify the fields to be overwritten in the - # `DnsForwarding` resource by the update. - # The fields specified in the `update_mask` are relative to the resource, not - # the full request. A field will be overwritten if it is in the mask. If the - # user does not provide a mask then all fields will be overwritten. - # @param request_id [::String] - # Optional. A request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server guarantees that a - # request doesn't result in creation of duplicate commitments for at least 60 - # minutes. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request ID, - # the server can check if original operation with the same request ID was - # received, and if so, will ignore the second request. This prevents clients - # from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # - # @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/vmware_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VmwareEngine::V1::UpdateDnsForwardingRequest.new - # - # # Call the update_dns_forwarding method. - # result = client.update_dns_forwarding 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 update_dns_forwarding request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::UpdateDnsForwardingRequest - - # Converts hash 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_dns_forwarding.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::VmwareEngine::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.dns_forwarding&.name - header_params["dns_forwarding.name"] = request.dns_forwarding.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_dns_forwarding.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_dns_forwarding.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vmware_engine_stub.call_rpc :update_dns_forwarding, 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 - - ## - # Retrieves a `NetworkPeering` resource by its resource name. The resource - # contains details of the network peering, such as peered - # networks, import and export custom route configurations, and peering state. - # NetworkPeering is a global resource and location can only be global. - # - # @overload get_network_peering(request, options = nil) - # Pass arguments to `get_network_peering` via a request object, either of type - # {::Google::Cloud::VmwareEngine::V1::GetNetworkPeeringRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VmwareEngine::V1::GetNetworkPeeringRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_network_peering(name: nil) - # Pass arguments to `get_network_peering` via keyword arguments. Note that at - # least one keyword argument is 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 network peering to retrieve. - # Resource names are schemeless URIs that follow the conventions in - # https://cloud.google.com/apis/design/resource_names. - # For example: - # `projects/my-project/locations/global/networkPeerings/my-peering` - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::VmwareEngine::V1::NetworkPeering] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::VmwareEngine::V1::NetworkPeering] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/vmware_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VmwareEngine::V1::GetNetworkPeeringRequest.new - # - # # Call the get_network_peering method. - # result = client.get_network_peering request - # - # # The returned object is of type Google::Cloud::VmwareEngine::V1::NetworkPeering. - # p result - # - def get_network_peering request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::GetNetworkPeeringRequest - - # Converts hash 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_network_peering.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::VmwareEngine::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_network_peering.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_network_peering.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vmware_engine_stub.call_rpc :get_network_peering, 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 `NetworkPeering` resources in a given project. NetworkPeering is a - # global resource and location can only be global. - # - # @overload list_network_peerings(request, options = nil) - # Pass arguments to `list_network_peerings` via a request object, either of type - # {::Google::Cloud::VmwareEngine::V1::ListNetworkPeeringsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VmwareEngine::V1::ListNetworkPeeringsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_network_peerings(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) - # Pass arguments to `list_network_peerings` via keyword arguments. Note that at - # least one keyword argument is 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 (global) to query for - # network peerings. Resource names are schemeless URIs that follow the - # conventions in https://cloud.google.com/apis/design/resource_names. For - # example: `projects/my-project/locations/global` - # @param page_size [::Integer] - # The maximum number of network peerings to return in one page. - # The maximum value is coerced to 1000. - # The default value of this field is 500. - # @param page_token [::String] - # A page token, received from a previous `ListNetworkPeerings` call. - # Provide this to retrieve the subsequent page. - # - # When paginating, all other parameters provided to - # `ListNetworkPeerings` must match the call that provided the page - # token. - # @param filter [::String] - # A filter expression that matches resources returned in the response. - # The expression must specify the field name, a comparison - # operator, and the value that you want to use for filtering. The value - # must be a string, a number, or a boolean. The comparison operator - # must be `=`, `!=`, `>`, or `<`. - # - # For example, if you are filtering a list of network peerings, you can - # exclude the ones named `example-peering` by specifying - # `name != "example-peering"`. - # - # To filter on multiple expressions, provide each separate expression within - # parentheses. For example: - # ``` - # (name = "example-peering") - # (createTime > "2021-04-12T08:15:10.40Z") - # ``` - # - # By default, each expression is an `AND` expression. However, you - # can include `AND` and `OR` expressions explicitly. - # For example: - # ``` - # (name = "example-peering-1") AND - # (createTime > "2021-04-12T08:15:10.40Z") OR - # (name = "example-peering-2") - # ``` - # @param order_by [::String] - # Sorts list results by a certain order. By default, returned results - # are ordered by `name` in ascending order. - # You can also sort results in descending order based on the `name` value - # using `orderBy="name desc"`. - # Currently, only ordering by `name` is supported. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::VmwareEngine::V1::NetworkPeering>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::VmwareEngine::V1::NetworkPeering>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/vmware_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VmwareEngine::V1::ListNetworkPeeringsRequest.new - # - # # Call the list_network_peerings method. - # result = client.list_network_peerings 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::VmwareEngine::V1::NetworkPeering. - # p item - # end - # - def list_network_peerings request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::ListNetworkPeeringsRequest - - # Converts hash 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_network_peerings.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::VmwareEngine::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_network_peerings.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_network_peerings.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vmware_engine_stub.call_rpc :list_network_peerings, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @vmware_engine_stub, :list_network_peerings, 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 - - ## - # Creates a new network peering between the peer network and VMware Engine - # network provided in a `NetworkPeering` resource. NetworkPeering is a - # global resource and location can only be global. - # - # @overload create_network_peering(request, options = nil) - # Pass arguments to `create_network_peering` via a request object, either of type - # {::Google::Cloud::VmwareEngine::V1::CreateNetworkPeeringRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VmwareEngine::V1::CreateNetworkPeeringRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_network_peering(parent: nil, network_peering_id: nil, network_peering: nil, request_id: nil) - # Pass arguments to `create_network_peering` via keyword arguments. Note that at - # least one keyword argument is 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 to create the new network - # peering in. This value is always `global`, because `NetworkPeering` is a - # global resource. Resource names are schemeless URIs that follow the - # conventions in https://cloud.google.com/apis/design/resource_names. For - # example: `projects/my-project/locations/global` - # @param network_peering_id [::String] - # Required. The user-provided identifier of the new `NetworkPeering`. - # This identifier must be unique among `NetworkPeering` resources within the - # parent and becomes the final token in the name URI. - # The identifier must meet the following requirements: - # - # * Only contains 1-63 alphanumeric characters and hyphens - # * Begins with an alphabetical character - # * Ends with a non-hyphen character - # * Not formatted as a UUID - # * Complies with [RFC 1034](https://datatracker.ietf.org/doc/html/rfc1034) - # (section 3.5) - # @param network_peering [::Google::Cloud::VmwareEngine::V1::NetworkPeering, ::Hash] - # Required. The initial description of the new network peering. - # @param request_id [::String] - # Optional. A request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server guarantees that a - # request doesn't result in creation of duplicate commitments for at least 60 - # minutes. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # - # @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/vmware_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VmwareEngine::V1::CreateNetworkPeeringRequest.new - # - # # Call the create_network_peering method. - # result = client.create_network_peering 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_network_peering request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::CreateNetworkPeeringRequest - - # Converts hash 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_network_peering.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::VmwareEngine::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_network_peering.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_network_peering.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vmware_engine_stub.call_rpc :create_network_peering, 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 `NetworkPeering` resource. When a network peering is deleted for - # a VMware Engine network, the peer network becomes inaccessible to that - # VMware Engine network. NetworkPeering is a global resource and location can - # only be global. - # - # @overload delete_network_peering(request, options = nil) - # Pass arguments to `delete_network_peering` via a request object, either of type - # {::Google::Cloud::VmwareEngine::V1::DeleteNetworkPeeringRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VmwareEngine::V1::DeleteNetworkPeeringRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_network_peering(name: nil, request_id: nil) - # Pass arguments to `delete_network_peering` via keyword arguments. Note that at - # least one keyword argument is 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 network peering to be deleted. - # Resource names are schemeless URIs that follow the conventions in - # https://cloud.google.com/apis/design/resource_names. - # For example: - # `projects/my-project/locations/global/networkPeerings/my-peering` - # @param request_id [::String] - # Optional. A request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server guarantees that a - # request doesn't result in creation of duplicate commitments for at least 60 - # minutes. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # - # @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/vmware_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VmwareEngine::V1::DeleteNetworkPeeringRequest.new - # - # # Call the delete_network_peering method. - # result = client.delete_network_peering 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_network_peering request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::DeleteNetworkPeeringRequest - - # Converts hash 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_network_peering.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::VmwareEngine::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_network_peering.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_network_peering.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vmware_engine_stub.call_rpc :delete_network_peering, 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 - - ## - # Modifies a `NetworkPeering` resource. Only the `description` field can be - # updated. Only fields specified in `updateMask` are applied. NetworkPeering - # is a global resource and location can only be global. - # - # @overload update_network_peering(request, options = nil) - # Pass arguments to `update_network_peering` via a request object, either of type - # {::Google::Cloud::VmwareEngine::V1::UpdateNetworkPeeringRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VmwareEngine::V1::UpdateNetworkPeeringRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_network_peering(network_peering: nil, update_mask: nil, request_id: nil) - # Pass arguments to `update_network_peering` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param network_peering [::Google::Cloud::VmwareEngine::V1::NetworkPeering, ::Hash] - # Required. Network peering description. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Required. Field mask is used to specify the fields to be overwritten in the - # `NetworkPeering` resource by the update. - # The fields specified in the `update_mask` are relative to the resource, not - # the full request. A field will be overwritten if it is in the mask. If the - # user does not provide a mask then all fields will be overwritten. - # @param request_id [::String] - # Optional. A request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server guarantees that a - # request doesn't result in creation of duplicate commitments for at least 60 - # minutes. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # - # @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/vmware_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VmwareEngine::V1::UpdateNetworkPeeringRequest.new - # - # # Call the update_network_peering method. - # result = client.update_network_peering 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 update_network_peering request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::UpdateNetworkPeeringRequest - - # Converts hash 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_network_peering.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::VmwareEngine::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.network_peering&.name - header_params["network_peering.name"] = request.network_peering.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_network_peering.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_network_peering.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vmware_engine_stub.call_rpc :update_network_peering, 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 - - ## - # Lists the network peering routes exchanged over a peering connection. - # NetworkPeering is a global resource and location can only be global. - # - # @overload list_peering_routes(request, options = nil) - # Pass arguments to `list_peering_routes` via a request object, either of type - # {::Google::Cloud::VmwareEngine::V1::ListPeeringRoutesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VmwareEngine::V1::ListPeeringRoutesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_peering_routes(parent: nil, page_size: nil, page_token: nil, filter: nil) - # Pass arguments to `list_peering_routes` via keyword arguments. Note that at - # least one keyword argument is 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 network peering to retrieve peering - # routes from. Resource names are schemeless URIs that follow the conventions - # in https://cloud.google.com/apis/design/resource_names. For example: - # `projects/my-project/locations/global/networkPeerings/my-peering` - # @param page_size [::Integer] - # The maximum number of peering routes to return in one page. - # The service may return fewer than this value. - # The maximum value is coerced to 1000. - # The default value of this field is 500. - # @param page_token [::String] - # A page token, received from a previous `ListPeeringRoutes` call. - # Provide this to retrieve the subsequent page. - # When paginating, all other parameters provided to `ListPeeringRoutes` must - # match the call that provided the page token. - # @param filter [::String] - # A filter expression that matches resources returned in the response. - # Currently, only filtering on the `direction` field is supported. To return - # routes imported from the peer network, provide "direction=INCOMING". To - # return routes exported from the VMware Engine network, provide - # "direction=OUTGOING". Other filter expressions return an error. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::VmwareEngine::V1::PeeringRoute>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::VmwareEngine::V1::PeeringRoute>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/vmware_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VmwareEngine::V1::ListPeeringRoutesRequest.new - # - # # Call the list_peering_routes method. - # result = client.list_peering_routes 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::VmwareEngine::V1::PeeringRoute. - # p item - # end - # - def list_peering_routes request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::ListPeeringRoutesRequest - - # Converts hash 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_peering_routes.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::VmwareEngine::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_peering_routes.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_peering_routes.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vmware_engine_stub.call_rpc :list_peering_routes, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @vmware_engine_stub, :list_peering_routes, 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 - - ## - # Creates a new HCX activation key in a given private cloud. - # - # @overload create_hcx_activation_key(request, options = nil) - # Pass arguments to `create_hcx_activation_key` via a request object, either of type - # {::Google::Cloud::VmwareEngine::V1::CreateHcxActivationKeyRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VmwareEngine::V1::CreateHcxActivationKeyRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_hcx_activation_key(parent: nil, hcx_activation_key: nil, hcx_activation_key_id: nil, request_id: nil) - # Pass arguments to `create_hcx_activation_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 resource name of the private cloud to create the key for. - # Resource names are schemeless URIs that follow the conventions in - # https://cloud.google.com/apis/design/resource_names. - # For example: - # `projects/my-project/locations/us-central1/privateClouds/my-cloud` - # @param hcx_activation_key [::Google::Cloud::VmwareEngine::V1::HcxActivationKey, ::Hash] - # Required. The initial description of a new HCX activation key. When - # creating a new key, this field must be an empty object. - # @param hcx_activation_key_id [::String] - # Required. The user-provided identifier of the `HcxActivationKey` to be - # created. This identifier must be unique among `HcxActivationKey` resources - # within the parent and becomes the final token in the name URI. - # The identifier must meet the following requirements: - # - # * Only contains 1-63 alphanumeric characters and hyphens - # * Begins with an alphabetical character - # * Ends with a non-hyphen character - # * Not formatted as a UUID - # * Complies with [RFC 1034](https://datatracker.ietf.org/doc/html/rfc1034) - # (section 3.5) - # @param request_id [::String] - # A request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server guarantees that a - # request doesn't result in creation of duplicate commitments for at least 60 - # minutes. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request ID, - # the server can check if original operation with the same request ID was - # received, and if so, will ignore the second request. This prevents clients - # from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # - # @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/vmware_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VmwareEngine::V1::CreateHcxActivationKeyRequest.new - # - # # Call the create_hcx_activation_key method. - # result = client.create_hcx_activation_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 create_hcx_activation_key request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::CreateHcxActivationKeyRequest - - # Converts hash 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_hcx_activation_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::VmwareEngine::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_hcx_activation_key.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_hcx_activation_key.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vmware_engine_stub.call_rpc :create_hcx_activation_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 - - ## - # Lists `HcxActivationKey` resources in a given private cloud. - # - # @overload list_hcx_activation_keys(request, options = nil) - # Pass arguments to `list_hcx_activation_keys` via a request object, either of type - # {::Google::Cloud::VmwareEngine::V1::ListHcxActivationKeysRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VmwareEngine::V1::ListHcxActivationKeysRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_hcx_activation_keys(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_hcx_activation_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 private cloud - # to be queried for HCX activation keys. - # Resource names are schemeless URIs that follow the conventions in - # https://cloud.google.com/apis/design/resource_names. - # For example: - # `projects/my-project/locations/us-central1/privateClouds/my-cloud` - # @param page_size [::Integer] - # The maximum number of HCX activation keys to return in one page. - # The service may return fewer than this value. - # The maximum value is coerced to 1000. - # The default value of this field is 500. - # @param page_token [::String] - # A page token, received from a previous `ListHcxActivationKeys` call. - # Provide this to retrieve the subsequent page. - # - # When paginating, all other parameters provided to - # `ListHcxActivationKeys` must match the call that provided the page - # token. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::VmwareEngine::V1::HcxActivationKey>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::VmwareEngine::V1::HcxActivationKey>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/vmware_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VmwareEngine::V1::ListHcxActivationKeysRequest.new - # - # # Call the list_hcx_activation_keys method. - # result = client.list_hcx_activation_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::VmwareEngine::V1::HcxActivationKey. - # p item - # end - # - def list_hcx_activation_keys request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::ListHcxActivationKeysRequest - - # Converts hash 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_hcx_activation_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::VmwareEngine::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_hcx_activation_keys.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_hcx_activation_keys.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vmware_engine_stub.call_rpc :list_hcx_activation_keys, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @vmware_engine_stub, :list_hcx_activation_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 - - ## - # Retrieves a `HcxActivationKey` resource by its resource name. - # - # @overload get_hcx_activation_key(request, options = nil) - # Pass arguments to `get_hcx_activation_key` via a request object, either of type - # {::Google::Cloud::VmwareEngine::V1::GetHcxActivationKeyRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VmwareEngine::V1::GetHcxActivationKeyRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_hcx_activation_key(name: nil) - # Pass arguments to `get_hcx_activation_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 resource name of the HCX activation key to retrieve. - # Resource names are schemeless URIs that follow the conventions in - # https://cloud.google.com/apis/design/resource_names. - # For example: - # `projects/my-project/locations/us-central1/privateClouds/my-cloud/hcxActivationKeys/my-key` - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::VmwareEngine::V1::HcxActivationKey] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::VmwareEngine::V1::HcxActivationKey] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/vmware_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VmwareEngine::V1::GetHcxActivationKeyRequest.new - # - # # Call the get_hcx_activation_key method. - # result = client.get_hcx_activation_key request - # - # # The returned object is of type Google::Cloud::VmwareEngine::V1::HcxActivationKey. - # p result - # - def get_hcx_activation_key request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::GetHcxActivationKeyRequest - - # Converts hash 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_hcx_activation_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::VmwareEngine::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_hcx_activation_key.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_hcx_activation_key.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vmware_engine_stub.call_rpc :get_hcx_activation_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 - - ## - # Retrieves a `NetworkPolicy` resource by its resource name. - # - # @overload get_network_policy(request, options = nil) - # Pass arguments to `get_network_policy` via a request object, either of type - # {::Google::Cloud::VmwareEngine::V1::GetNetworkPolicyRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VmwareEngine::V1::GetNetworkPolicyRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_network_policy(name: nil) - # Pass arguments to `get_network_policy` via keyword arguments. Note that at - # least one keyword argument is 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 network policy to retrieve. - # Resource names are schemeless URIs that follow the conventions in - # https://cloud.google.com/apis/design/resource_names. - # For example: - # `projects/my-project/locations/us-central1/networkPolicies/my-network-policy` - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::VmwareEngine::V1::NetworkPolicy] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::VmwareEngine::V1::NetworkPolicy] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/vmware_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VmwareEngine::V1::GetNetworkPolicyRequest.new - # - # # Call the get_network_policy method. - # result = client.get_network_policy request - # - # # The returned object is of type Google::Cloud::VmwareEngine::V1::NetworkPolicy. - # p result - # - def get_network_policy request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::GetNetworkPolicyRequest - - # Converts hash 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_network_policy.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::VmwareEngine::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_network_policy.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_network_policy.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vmware_engine_stub.call_rpc :get_network_policy, 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 `NetworkPolicy` resources in a specified project and location. - # - # @overload list_network_policies(request, options = nil) - # Pass arguments to `list_network_policies` via a request object, either of type - # {::Google::Cloud::VmwareEngine::V1::ListNetworkPoliciesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VmwareEngine::V1::ListNetworkPoliciesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_network_policies(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) - # Pass arguments to `list_network_policies` via keyword arguments. Note that at - # least one keyword argument is 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 (region) to query for - # network policies. Resource names are schemeless URIs that follow the - # conventions in https://cloud.google.com/apis/design/resource_names. For - # example: `projects/my-project/locations/us-central1` - # @param page_size [::Integer] - # The maximum number of network policies to return in one page. - # The service may return fewer than this value. - # The maximum value is coerced to 1000. - # The default value of this field is 500. - # @param page_token [::String] - # A page token, received from a previous `ListNetworkPolicies` call. - # Provide this to retrieve the subsequent page. - # - # When paginating, all other parameters provided to - # `ListNetworkPolicies` must match the call that provided the page - # token. - # @param filter [::String] - # A filter expression that matches resources returned in the response. - # The expression must specify the field name, a comparison - # operator, and the value that you want to use for filtering. The value - # must be a string, a number, or a boolean. The comparison operator - # must be `=`, `!=`, `>`, or `<`. - # - # For example, if you are filtering a list of network policies, you can - # exclude the ones named `example-policy` by specifying - # `name != "example-policy"`. - # - # To filter on multiple expressions, provide each separate expression within - # parentheses. For example: - # ``` - # (name = "example-policy") - # (createTime > "2021-04-12T08:15:10.40Z") - # ``` - # - # By default, each expression is an `AND` expression. However, you - # can include `AND` and `OR` expressions explicitly. - # For example: - # ``` - # (name = "example-policy-1") AND - # (createTime > "2021-04-12T08:15:10.40Z") OR - # (name = "example-policy-2") - # ``` - # @param order_by [::String] - # Sorts list results by a certain order. By default, returned results - # are ordered by `name` in ascending order. - # You can also sort results in descending order based on the `name` value - # using `orderBy="name desc"`. - # Currently, only ordering by `name` is supported. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::VmwareEngine::V1::NetworkPolicy>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::VmwareEngine::V1::NetworkPolicy>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/vmware_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VmwareEngine::V1::ListNetworkPoliciesRequest.new - # - # # Call the list_network_policies method. - # result = client.list_network_policies 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::VmwareEngine::V1::NetworkPolicy. - # p item - # end - # - def list_network_policies request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::ListNetworkPoliciesRequest - - # Converts hash 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_network_policies.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::VmwareEngine::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_network_policies.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_network_policies.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vmware_engine_stub.call_rpc :list_network_policies, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @vmware_engine_stub, :list_network_policies, 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 - - ## - # Creates a new network policy in a given VMware Engine network of a - # project and location (region). A new network policy cannot be created if - # another network policy already exists in the same scope. - # - # @overload create_network_policy(request, options = nil) - # Pass arguments to `create_network_policy` via a request object, either of type - # {::Google::Cloud::VmwareEngine::V1::CreateNetworkPolicyRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VmwareEngine::V1::CreateNetworkPolicyRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_network_policy(parent: nil, network_policy_id: nil, network_policy: nil, request_id: nil) - # Pass arguments to `create_network_policy` via keyword arguments. Note that at - # least one keyword argument is 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 (region) - # to create the new network policy in. - # Resource names are schemeless URIs that follow the conventions in - # https://cloud.google.com/apis/design/resource_names. - # For example: - # `projects/my-project/locations/us-central1` - # @param network_policy_id [::String] - # Required. The user-provided identifier of the network policy to be created. - # This identifier must be unique within parent - # `projects/{my-project}/locations/{us-central1}/networkPolicies` and becomes - # the final token in the name URI. - # The identifier must meet the following requirements: - # - # * Only contains 1-63 alphanumeric characters and hyphens - # * Begins with an alphabetical character - # * Ends with a non-hyphen character - # * Not formatted as a UUID - # * Complies with [RFC 1034](https://datatracker.ietf.org/doc/html/rfc1034) - # (section 3.5) - # @param network_policy [::Google::Cloud::VmwareEngine::V1::NetworkPolicy, ::Hash] - # Required. The network policy configuration to use in the request. - # @param request_id [::String] - # Optional. A request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server guarantees that a - # request doesn't result in creation of duplicate commitments for at least 60 - # minutes. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # - # @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/vmware_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VmwareEngine::V1::CreateNetworkPolicyRequest.new - # - # # Call the create_network_policy method. - # result = client.create_network_policy 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_network_policy request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::CreateNetworkPolicyRequest - - # Converts hash 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_network_policy.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::VmwareEngine::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_network_policy.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_network_policy.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vmware_engine_stub.call_rpc :create_network_policy, 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 - - ## - # Modifies a `NetworkPolicy` resource. Only the following fields can be - # updated: `internet_access`, `external_ip`, `edge_services_cidr`. - # Only fields specified in `updateMask` are applied. When updating a network - # policy, the external IP network service can only be disabled if there are - # no external IP addresses present in the scope of the policy. Also, a - # `NetworkService` cannot be updated when `NetworkService.state` is set - # to `RECONCILING`. - # - # During operation processing, the resource is temporarily in the `ACTIVE` - # state before the operation fully completes. For that period of time, you - # can't update the resource. Use the operation status to determine when the - # processing fully completes. - # - # @overload update_network_policy(request, options = nil) - # Pass arguments to `update_network_policy` via a request object, either of type - # {::Google::Cloud::VmwareEngine::V1::UpdateNetworkPolicyRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VmwareEngine::V1::UpdateNetworkPolicyRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_network_policy(network_policy: nil, update_mask: nil, request_id: nil) - # Pass arguments to `update_network_policy` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param network_policy [::Google::Cloud::VmwareEngine::V1::NetworkPolicy, ::Hash] - # Required. Network policy description. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Required. Field mask is used to specify the fields to be overwritten in the - # `NetworkPolicy` resource by the update. - # The fields specified in the `update_mask` are relative to the resource, not - # the full request. A field will be overwritten if it is in the mask. If the - # user does not provide a mask then all fields will be overwritten. - # @param request_id [::String] - # Optional. A request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server guarantees that a - # request doesn't result in creation of duplicate commitments for at least 60 - # minutes. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # - # @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/vmware_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VmwareEngine::V1::UpdateNetworkPolicyRequest.new - # - # # Call the update_network_policy method. - # result = client.update_network_policy 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 update_network_policy request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::UpdateNetworkPolicyRequest - - # Converts hash 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_network_policy.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::VmwareEngine::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.network_policy&.name - header_params["network_policy.name"] = request.network_policy.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_network_policy.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_network_policy.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vmware_engine_stub.call_rpc :update_network_policy, 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 `NetworkPolicy` resource. A network policy cannot be deleted - # when `NetworkService.state` is set to `RECONCILING` for either its external - # IP or internet access service. - # - # @overload delete_network_policy(request, options = nil) - # Pass arguments to `delete_network_policy` via a request object, either of type - # {::Google::Cloud::VmwareEngine::V1::DeleteNetworkPolicyRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VmwareEngine::V1::DeleteNetworkPolicyRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_network_policy(name: nil, request_id: nil) - # Pass arguments to `delete_network_policy` via keyword arguments. Note that at - # least one keyword argument is 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 network policy to delete. - # Resource names are schemeless URIs that follow the conventions in - # https://cloud.google.com/apis/design/resource_names. - # For example: - # `projects/my-project/locations/us-central1/networkPolicies/my-network-policy` - # @param request_id [::String] - # Optional. A request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server guarantees that a - # request doesn't result in creation of duplicate commitments for at least 60 - # minutes. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # - # @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/vmware_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VmwareEngine::V1::DeleteNetworkPolicyRequest.new - # - # # Call the delete_network_policy method. - # result = client.delete_network_policy 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_network_policy request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::DeleteNetworkPolicyRequest - - # Converts hash 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_network_policy.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::VmwareEngine::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_network_policy.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_network_policy.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vmware_engine_stub.call_rpc :delete_network_policy, 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 - - ## - # Lists Consumer VPCs bound to Management DNS Zone of a given private cloud. - # - # @overload list_management_dns_zone_bindings(request, options = nil) - # Pass arguments to `list_management_dns_zone_bindings` via a request object, either of type - # {::Google::Cloud::VmwareEngine::V1::ListManagementDnsZoneBindingsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VmwareEngine::V1::ListManagementDnsZoneBindingsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_management_dns_zone_bindings(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) - # Pass arguments to `list_management_dns_zone_bindings` via keyword arguments. Note that at - # least one keyword argument is 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 private cloud to be queried for - # management DNS zone bindings. - # Resource names are schemeless URIs that follow the conventions in - # https://cloud.google.com/apis/design/resource_names. - # For example: - # `projects/my-project/locations/us-central1-a/privateClouds/my-cloud` - # @param page_size [::Integer] - # The maximum number of management DNS zone bindings to return in one page. - # The service may return fewer than this value. - # The maximum value is coerced to 1000. - # The default value of this field is 500. - # @param page_token [::String] - # A page token, received from a previous `ListManagementDnsZoneBindings` - # call. Provide this to retrieve the subsequent page. - # - # When paginating, all other parameters provided to - # `ListManagementDnsZoneBindings` must match the call that provided the page - # token. - # @param filter [::String] - # A filter expression that matches resources returned in the response. - # The expression must specify the field name, a comparison - # operator, and the value that you want to use for filtering. The value - # must be a string, a number, or a boolean. The comparison operator - # must be `=`, `!=`, `>`, or `<`. - # - # For example, if you are filtering a list of Management DNS Zone Bindings, - # you can exclude the ones named `example-management-dns-zone-binding` by - # specifying `name != "example-management-dns-zone-binding"`. - # - # To filter on multiple expressions, provide each separate expression within - # parentheses. For example: - # ``` - # (name = "example-management-dns-zone-binding") - # (createTime > "2021-04-12T08:15:10.40Z") - # ``` - # - # By default, each expression is an `AND` expression. However, you - # can include `AND` and `OR` expressions explicitly. - # For example: - # ``` - # (name = "example-management-dns-zone-binding-1") AND - # (createTime > "2021-04-12T08:15:10.40Z") OR - # (name = "example-management-dns-zone-binding-2") - # ``` - # @param order_by [::String] - # Sorts list results by a certain order. By default, returned results - # are ordered by `name` in ascending order. - # You can also sort results in descending order based on the `name` value - # using `orderBy="name desc"`. - # Currently, only ordering by `name` is supported. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::VmwareEngine::V1::ManagementDnsZoneBinding>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::VmwareEngine::V1::ManagementDnsZoneBinding>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/vmware_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VmwareEngine::V1::ListManagementDnsZoneBindingsRequest.new - # - # # Call the list_management_dns_zone_bindings method. - # result = client.list_management_dns_zone_bindings 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::VmwareEngine::V1::ManagementDnsZoneBinding. - # p item - # end - # - def list_management_dns_zone_bindings request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::ListManagementDnsZoneBindingsRequest - - # Converts hash 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_management_dns_zone_bindings.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::VmwareEngine::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_management_dns_zone_bindings.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_management_dns_zone_bindings.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vmware_engine_stub.call_rpc :list_management_dns_zone_bindings, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @vmware_engine_stub, :list_management_dns_zone_bindings, 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 - - ## - # Retrieves a 'ManagementDnsZoneBinding' resource by its resource name. - # - # @overload get_management_dns_zone_binding(request, options = nil) - # Pass arguments to `get_management_dns_zone_binding` via a request object, either of type - # {::Google::Cloud::VmwareEngine::V1::GetManagementDnsZoneBindingRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VmwareEngine::V1::GetManagementDnsZoneBindingRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_management_dns_zone_binding(name: nil) - # Pass arguments to `get_management_dns_zone_binding` via keyword arguments. Note that at - # least one keyword argument is 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 management DNS zone binding to - # retrieve. Resource names are schemeless URIs that follow the conventions in - # https://cloud.google.com/apis/design/resource_names. - # For example: - # `projects/my-project/locations/us-central1-a/privateClouds/my-cloud/managementDnsZoneBindings/my-management-dns-zone-binding` - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::VmwareEngine::V1::ManagementDnsZoneBinding] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::VmwareEngine::V1::ManagementDnsZoneBinding] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/vmware_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VmwareEngine::V1::GetManagementDnsZoneBindingRequest.new - # - # # Call the get_management_dns_zone_binding method. - # result = client.get_management_dns_zone_binding request - # - # # The returned object is of type Google::Cloud::VmwareEngine::V1::ManagementDnsZoneBinding. - # p result - # - def get_management_dns_zone_binding request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::GetManagementDnsZoneBindingRequest - - # Converts hash 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_management_dns_zone_binding.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::VmwareEngine::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_management_dns_zone_binding.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_management_dns_zone_binding.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vmware_engine_stub.call_rpc :get_management_dns_zone_binding, 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 `ManagementDnsZoneBinding` resource in a private cloud. - # This RPC creates the DNS binding and the resource that represents the - # DNS binding of the consumer VPC network to the management DNS zone. A - # management DNS zone is the Cloud DNS cross-project binding zone that - # VMware Engine creates for each private cloud. It contains FQDNs and - # corresponding IP addresses for the private cloud's ESXi hosts and - # management VM appliances like vCenter and NSX Manager. - # - # @overload create_management_dns_zone_binding(request, options = nil) - # Pass arguments to `create_management_dns_zone_binding` via a request object, either of type - # {::Google::Cloud::VmwareEngine::V1::CreateManagementDnsZoneBindingRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VmwareEngine::V1::CreateManagementDnsZoneBindingRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_management_dns_zone_binding(parent: nil, management_dns_zone_binding: nil, management_dns_zone_binding_id: nil, request_id: nil) - # Pass arguments to `create_management_dns_zone_binding` via keyword arguments. Note that at - # least one keyword argument is 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 private cloud - # to create a new management DNS zone binding for. - # Resource names are schemeless URIs that follow the conventions in - # https://cloud.google.com/apis/design/resource_names. - # For example: - # `projects/my-project/locations/us-central1-a/privateClouds/my-cloud` - # @param management_dns_zone_binding [::Google::Cloud::VmwareEngine::V1::ManagementDnsZoneBinding, ::Hash] - # Required. The initial values for a new management DNS zone binding. - # @param management_dns_zone_binding_id [::String] - # Required. The user-provided identifier of the `ManagementDnsZoneBinding` - # resource to be created. This identifier must be unique among - # `ManagementDnsZoneBinding` resources within the parent and becomes the - # final token in the name URI. The identifier must meet the following - # requirements: - # - # * Only contains 1-63 alphanumeric characters and hyphens - # * Begins with an alphabetical character - # * Ends with a non-hyphen character - # * Not formatted as a UUID - # * Complies with [RFC 1034](https://datatracker.ietf.org/doc/html/rfc1034) - # (section 3.5) - # @param request_id [::String] - # Optional. A request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server guarantees that a - # request doesn't result in creation of duplicate commitments for at least 60 - # minutes. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request ID, - # the server can check if the original operation with the same request ID was - # received, and if so, will ignore the second request. This prevents clients - # from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # - # @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/vmware_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VmwareEngine::V1::CreateManagementDnsZoneBindingRequest.new - # - # # Call the create_management_dns_zone_binding method. - # result = client.create_management_dns_zone_binding 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_management_dns_zone_binding request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::CreateManagementDnsZoneBindingRequest - - # Converts hash 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_management_dns_zone_binding.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::VmwareEngine::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_management_dns_zone_binding.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_management_dns_zone_binding.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vmware_engine_stub.call_rpc :create_management_dns_zone_binding, 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 - - ## - # Updates a `ManagementDnsZoneBinding` resource. - # Only fields specified in `update_mask` are applied. - # - # @overload update_management_dns_zone_binding(request, options = nil) - # Pass arguments to `update_management_dns_zone_binding` via a request object, either of type - # {::Google::Cloud::VmwareEngine::V1::UpdateManagementDnsZoneBindingRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VmwareEngine::V1::UpdateManagementDnsZoneBindingRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_management_dns_zone_binding(update_mask: nil, management_dns_zone_binding: nil, request_id: nil) - # Pass arguments to `update_management_dns_zone_binding` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Required. Field mask is used to specify the fields to be overwritten in the - # `ManagementDnsZoneBinding` resource by the update. - # The fields specified in the `update_mask` are relative to the resource, not - # the full request. A field will be overwritten if it is in the mask. If the - # user does not provide a mask then all fields will be overwritten. - # @param management_dns_zone_binding [::Google::Cloud::VmwareEngine::V1::ManagementDnsZoneBinding, ::Hash] - # Required. New values to update the management DNS zone binding with. - # @param request_id [::String] - # Optional. A request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server guarantees that a - # request doesn't result in creation of duplicate commitments for at least 60 - # minutes. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request ID, - # the server can check if the original operation with the same request ID was - # received, and if so, will ignore the second request. This prevents clients - # from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # - # @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/vmware_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VmwareEngine::V1::UpdateManagementDnsZoneBindingRequest.new - # - # # Call the update_management_dns_zone_binding method. - # result = client.update_management_dns_zone_binding 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 update_management_dns_zone_binding request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::UpdateManagementDnsZoneBindingRequest - - # Converts hash 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_management_dns_zone_binding.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::VmwareEngine::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.management_dns_zone_binding&.name - header_params["management_dns_zone_binding.name"] = request.management_dns_zone_binding.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_management_dns_zone_binding.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_management_dns_zone_binding.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vmware_engine_stub.call_rpc :update_management_dns_zone_binding, 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 `ManagementDnsZoneBinding` resource. When a management DNS zone - # binding is deleted, the corresponding consumer VPC network is no longer - # bound to the management DNS zone. - # - # @overload delete_management_dns_zone_binding(request, options = nil) - # Pass arguments to `delete_management_dns_zone_binding` via a request object, either of type - # {::Google::Cloud::VmwareEngine::V1::DeleteManagementDnsZoneBindingRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VmwareEngine::V1::DeleteManagementDnsZoneBindingRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_management_dns_zone_binding(name: nil, request_id: nil) - # Pass arguments to `delete_management_dns_zone_binding` via keyword arguments. Note that at - # least one keyword argument is 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 management DNS zone binding to delete. - # Resource names are schemeless URIs that follow the conventions in - # https://cloud.google.com/apis/design/resource_names. - # For example: - # `projects/my-project/locations/us-central1-a/privateClouds/my-cloud/managementDnsZoneBindings/my-management-dns-zone-binding` - # @param request_id [::String] - # Optional. A request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server guarantees that a - # request doesn't result in creation of duplicate commitments for at least 60 - # minutes. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request - # ID, the server can check if the original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # - # @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/vmware_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VmwareEngine::V1::DeleteManagementDnsZoneBindingRequest.new - # - # # Call the delete_management_dns_zone_binding method. - # result = client.delete_management_dns_zone_binding 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_management_dns_zone_binding request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::DeleteManagementDnsZoneBindingRequest - - # Converts hash 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_management_dns_zone_binding.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::VmwareEngine::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_management_dns_zone_binding.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_management_dns_zone_binding.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vmware_engine_stub.call_rpc :delete_management_dns_zone_binding, 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 - - ## - # Retries to create a `ManagementDnsZoneBinding` resource that is - # in failed state. - # - # @overload repair_management_dns_zone_binding(request, options = nil) - # Pass arguments to `repair_management_dns_zone_binding` via a request object, either of type - # {::Google::Cloud::VmwareEngine::V1::RepairManagementDnsZoneBindingRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VmwareEngine::V1::RepairManagementDnsZoneBindingRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload repair_management_dns_zone_binding(name: nil, request_id: nil) - # Pass arguments to `repair_management_dns_zone_binding` via keyword arguments. Note that at - # least one keyword argument is 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 management DNS zone binding to repair. - # Resource names are schemeless URIs that follow the conventions in - # https://cloud.google.com/apis/design/resource_names. - # For example: - # `projects/my-project/locations/us-central1-a/privateClouds/my-cloud/managementDnsZoneBindings/my-management-dns-zone-binding` - # @param request_id [::String] - # Optional. A request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server guarantees that a - # request doesn't result in creation of duplicate commitments for at least 60 - # minutes. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request ID, - # the server can check if the original operation with the same request ID was - # received, and if so, will ignore the second request. This prevents clients - # from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # - # @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/vmware_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VmwareEngine::V1::RepairManagementDnsZoneBindingRequest.new - # - # # Call the repair_management_dns_zone_binding method. - # result = client.repair_management_dns_zone_binding 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 repair_management_dns_zone_binding request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::RepairManagementDnsZoneBindingRequest - - # Converts hash 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.repair_management_dns_zone_binding.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::VmwareEngine::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.repair_management_dns_zone_binding.timeout, - metadata: metadata, - retry_policy: @config.rpcs.repair_management_dns_zone_binding.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vmware_engine_stub.call_rpc :repair_management_dns_zone_binding, 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 VMware Engine network that can be used by a private cloud. - # - # @overload create_vmware_engine_network(request, options = nil) - # Pass arguments to `create_vmware_engine_network` via a request object, either of type - # {::Google::Cloud::VmwareEngine::V1::CreateVmwareEngineNetworkRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VmwareEngine::V1::CreateVmwareEngineNetworkRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_vmware_engine_network(parent: nil, vmware_engine_network_id: nil, vmware_engine_network: nil, request_id: nil) - # Pass arguments to `create_vmware_engine_network` via keyword arguments. Note that at - # least one keyword argument is 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 to create the new VMware Engine - # network in. A VMware Engine network of type - # `LEGACY` is a regional resource, and a VMware - # Engine network of type `STANDARD` is a global resource. - # Resource names are schemeless URIs that follow the conventions in - # https://cloud.google.com/apis/design/resource_names. For example: - # `projects/my-project/locations/global` - # @param vmware_engine_network_id [::String] - # Required. The user-provided identifier of the new VMware Engine network. - # This identifier must be unique among VMware Engine network resources - # within the parent and becomes the final token in the name URI. The - # identifier must meet the following requirements: - # - # * For networks of type LEGACY, adheres to the format: - # `{region-id}-default`. Replace `{region-id}` with the region where you want - # to create the VMware Engine network. For example, "us-central1-default". - # * Only contains 1-63 alphanumeric characters and hyphens - # * Begins with an alphabetical character - # * Ends with a non-hyphen character - # * Not formatted as a UUID - # * Complies with [RFC 1034](https://datatracker.ietf.org/doc/html/rfc1034) - # (section 3.5) - # @param vmware_engine_network [::Google::Cloud::VmwareEngine::V1::VmwareEngineNetwork, ::Hash] - # Required. The initial description of the new VMware Engine network. - # @param request_id [::String] - # Optional. A request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server guarantees that a - # request doesn't result in creation of duplicate commitments for at least 60 - # minutes. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # - # @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/vmware_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VmwareEngine::V1::CreateVmwareEngineNetworkRequest.new - # - # # Call the create_vmware_engine_network method. - # result = client.create_vmware_engine_network 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_vmware_engine_network request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::CreateVmwareEngineNetworkRequest - - # Converts hash 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_vmware_engine_network.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::VmwareEngine::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_vmware_engine_network.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_vmware_engine_network.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vmware_engine_stub.call_rpc :create_vmware_engine_network, 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 - - ## - # Modifies a VMware Engine network resource. Only the following fields can be - # updated: `description`. Only fields specified in `updateMask` are - # applied. - # - # @overload update_vmware_engine_network(request, options = nil) - # Pass arguments to `update_vmware_engine_network` via a request object, either of type - # {::Google::Cloud::VmwareEngine::V1::UpdateVmwareEngineNetworkRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VmwareEngine::V1::UpdateVmwareEngineNetworkRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_vmware_engine_network(vmware_engine_network: nil, update_mask: nil, request_id: nil) - # Pass arguments to `update_vmware_engine_network` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param vmware_engine_network [::Google::Cloud::VmwareEngine::V1::VmwareEngineNetwork, ::Hash] - # Required. VMware Engine network description. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Required. Field mask is used to specify the fields to be overwritten in the - # VMware Engine network resource by the update. - # The fields specified in the `update_mask` are relative to the resource, not - # the full request. A field will be overwritten if it is in the mask. If the - # user does not provide a mask then all fields will be overwritten. Only the - # following fields can be updated: `description`. - # @param request_id [::String] - # Optional. A request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server guarantees that a - # request doesn't result in creation of duplicate commitments for at least 60 - # minutes. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # - # @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/vmware_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VmwareEngine::V1::UpdateVmwareEngineNetworkRequest.new - # - # # Call the update_vmware_engine_network method. - # result = client.update_vmware_engine_network 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 update_vmware_engine_network request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::UpdateVmwareEngineNetworkRequest - - # Converts hash 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_vmware_engine_network.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::VmwareEngine::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.vmware_engine_network&.name - header_params["vmware_engine_network.name"] = request.vmware_engine_network.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_vmware_engine_network.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_vmware_engine_network.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vmware_engine_stub.call_rpc :update_vmware_engine_network, 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 `VmwareEngineNetwork` resource. You can only delete a VMware - # Engine network after all resources that refer to it are deleted. For - # example, a private cloud, a network peering, and a network policy can all - # refer to the same VMware Engine network. - # - # @overload delete_vmware_engine_network(request, options = nil) - # Pass arguments to `delete_vmware_engine_network` via a request object, either of type - # {::Google::Cloud::VmwareEngine::V1::DeleteVmwareEngineNetworkRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VmwareEngine::V1::DeleteVmwareEngineNetworkRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_vmware_engine_network(name: nil, request_id: nil, etag: nil) - # Pass arguments to `delete_vmware_engine_network` via keyword arguments. Note that at - # least one keyword argument is 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 VMware Engine network to be deleted. - # Resource names are schemeless URIs that follow the conventions in - # https://cloud.google.com/apis/design/resource_names. - # For example: - # `projects/my-project/locations/global/vmwareEngineNetworks/my-network` - # @param request_id [::String] - # Optional. A request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server guarantees that a - # request doesn't result in creation of duplicate commitments for at least 60 - # minutes. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @param etag [::String] - # Optional. Checksum used to ensure that the user-provided value is up to - # date before the server processes the request. The server compares provided - # checksum with the current checksum of the resource. If the user-provided - # value is out of date, this request returns an `ABORTED` error. - # - # @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/vmware_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VmwareEngine::V1::DeleteVmwareEngineNetworkRequest.new - # - # # Call the delete_vmware_engine_network method. - # result = client.delete_vmware_engine_network 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_vmware_engine_network request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::DeleteVmwareEngineNetworkRequest - - # Converts hash 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_vmware_engine_network.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::VmwareEngine::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_vmware_engine_network.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_vmware_engine_network.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vmware_engine_stub.call_rpc :delete_vmware_engine_network, 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 - - ## - # Retrieves a `VmwareEngineNetwork` resource by its resource name. The - # resource contains details of the VMware Engine network, such as its VMware - # Engine network type, peered networks in a service project, and state - # (for example, `CREATING`, `ACTIVE`, `DELETING`). - # - # @overload get_vmware_engine_network(request, options = nil) - # Pass arguments to `get_vmware_engine_network` via a request object, either of type - # {::Google::Cloud::VmwareEngine::V1::GetVmwareEngineNetworkRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VmwareEngine::V1::GetVmwareEngineNetworkRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_vmware_engine_network(name: nil) - # Pass arguments to `get_vmware_engine_network` via keyword arguments. Note that at - # least one keyword argument is 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 VMware Engine network to retrieve. - # Resource names are schemeless URIs that follow the conventions in - # https://cloud.google.com/apis/design/resource_names. - # For example: - # `projects/my-project/locations/global/vmwareEngineNetworks/my-network` - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::VmwareEngine::V1::VmwareEngineNetwork] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::VmwareEngine::V1::VmwareEngineNetwork] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/vmware_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VmwareEngine::V1::GetVmwareEngineNetworkRequest.new - # - # # Call the get_vmware_engine_network method. - # result = client.get_vmware_engine_network request - # - # # The returned object is of type Google::Cloud::VmwareEngine::V1::VmwareEngineNetwork. - # p result - # - def get_vmware_engine_network request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::GetVmwareEngineNetworkRequest - - # Converts hash 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_vmware_engine_network.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::VmwareEngine::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_vmware_engine_network.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_vmware_engine_network.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vmware_engine_stub.call_rpc :get_vmware_engine_network, 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 `VmwareEngineNetwork` resources in a given project and location. - # - # @overload list_vmware_engine_networks(request, options = nil) - # Pass arguments to `list_vmware_engine_networks` via a request object, either of type - # {::Google::Cloud::VmwareEngine::V1::ListVmwareEngineNetworksRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VmwareEngine::V1::ListVmwareEngineNetworksRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_vmware_engine_networks(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) - # Pass arguments to `list_vmware_engine_networks` via keyword arguments. Note that at - # least one keyword argument is 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 to query for - # VMware Engine networks. Resource names are schemeless URIs that follow the - # conventions in https://cloud.google.com/apis/design/resource_names. For - # example: `projects/my-project/locations/global` - # @param page_size [::Integer] - # The maximum number of results to return in one page. - # The maximum value is coerced to 1000. - # The default value of this field is 500. - # @param page_token [::String] - # A page token, received from a previous `ListVmwareEngineNetworks` call. - # Provide this to retrieve the subsequent page. - # - # When paginating, all other parameters provided to - # `ListVmwareEngineNetworks` must match the call that provided the page - # token. - # @param filter [::String] - # A filter expression that matches resources returned in the response. - # The expression must specify the field name, a comparison - # operator, and the value that you want to use for filtering. The value - # must be a string, a number, or a boolean. The comparison operator - # must be `=`, `!=`, `>`, or `<`. - # - # For example, if you are filtering a list of network peerings, you can - # exclude the ones named `example-network` by specifying - # `name != "example-network"`. - # - # To filter on multiple expressions, provide each separate expression within - # parentheses. For example: - # ``` - # (name = "example-network") - # (createTime > "2021-04-12T08:15:10.40Z") - # ``` - # - # By default, each expression is an `AND` expression. However, you - # can include `AND` and `OR` expressions explicitly. - # For example: - # ``` - # (name = "example-network-1") AND - # (createTime > "2021-04-12T08:15:10.40Z") OR - # (name = "example-network-2") - # ``` - # @param order_by [::String] - # Sorts list results by a certain order. By default, returned results - # are ordered by `name` in ascending order. - # You can also sort results in descending order based on the `name` value - # using `orderBy="name desc"`. - # Currently, only ordering by `name` is supported. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::VmwareEngine::V1::VmwareEngineNetwork>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::VmwareEngine::V1::VmwareEngineNetwork>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/vmware_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VmwareEngine::V1::ListVmwareEngineNetworksRequest.new - # - # # Call the list_vmware_engine_networks method. - # result = client.list_vmware_engine_networks 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::VmwareEngine::V1::VmwareEngineNetwork. - # p item - # end - # - def list_vmware_engine_networks request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::ListVmwareEngineNetworksRequest - - # Converts hash 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_vmware_engine_networks.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::VmwareEngine::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_vmware_engine_networks.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_vmware_engine_networks.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vmware_engine_stub.call_rpc :list_vmware_engine_networks, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @vmware_engine_stub, :list_vmware_engine_networks, 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 - - ## - # Creates a new private connection that can be used for accessing private - # Clouds. - # - # @overload create_private_connection(request, options = nil) - # Pass arguments to `create_private_connection` via a request object, either of type - # {::Google::Cloud::VmwareEngine::V1::CreatePrivateConnectionRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VmwareEngine::V1::CreatePrivateConnectionRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_private_connection(parent: nil, private_connection_id: nil, private_connection: nil, request_id: nil) - # Pass arguments to `create_private_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 to create the new private - # connection in. Private connection is a regional resource. - # Resource names are schemeless URIs that follow the conventions in - # https://cloud.google.com/apis/design/resource_names. For example: - # `projects/my-project/locations/us-central1` - # @param private_connection_id [::String] - # Required. The user-provided identifier of the new private connection. - # This identifier must be unique among private connection resources - # within the parent and becomes the final token in the name URI. The - # identifier must meet the following requirements: - # - # * Only contains 1-63 alphanumeric characters and hyphens - # * Begins with an alphabetical character - # * Ends with a non-hyphen character - # * Not formatted as a UUID - # * Complies with [RFC 1034](https://datatracker.ietf.org/doc/html/rfc1034) - # (section 3.5) - # @param private_connection [::Google::Cloud::VmwareEngine::V1::PrivateConnection, ::Hash] - # Required. The initial description of the new private connection. - # @param request_id [::String] - # Optional. A request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server guarantees that a - # request doesn't result in creation of duplicate commitments for at least 60 - # minutes. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # - # @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/vmware_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VmwareEngine::V1::CreatePrivateConnectionRequest.new - # - # # Call the create_private_connection method. - # result = client.create_private_connection 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_private_connection request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::CreatePrivateConnectionRequest - - # Converts hash 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_private_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::VmwareEngine::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_private_connection.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_private_connection.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vmware_engine_stub.call_rpc :create_private_connection, 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 - - ## - # Retrieves a `PrivateConnection` resource by its resource name. The resource - # contains details of the private connection, such as connected - # network, routing mode and state. - # - # @overload get_private_connection(request, options = nil) - # Pass arguments to `get_private_connection` via a request object, either of type - # {::Google::Cloud::VmwareEngine::V1::GetPrivateConnectionRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VmwareEngine::V1::GetPrivateConnectionRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_private_connection(name: nil) - # Pass arguments to `get_private_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 resource name of the private connection to retrieve. - # Resource names are schemeless URIs that follow the conventions in - # https://cloud.google.com/apis/design/resource_names. - # For example: - # `projects/my-project/locations/us-central1/privateConnections/my-connection` - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::VmwareEngine::V1::PrivateConnection] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::VmwareEngine::V1::PrivateConnection] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/vmware_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VmwareEngine::V1::GetPrivateConnectionRequest.new - # - # # Call the get_private_connection method. - # result = client.get_private_connection request - # - # # The returned object is of type Google::Cloud::VmwareEngine::V1::PrivateConnection. - # p result - # - def get_private_connection request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::GetPrivateConnectionRequest - - # Converts hash 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_private_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::VmwareEngine::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_private_connection.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_private_connection.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vmware_engine_stub.call_rpc :get_private_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 - - ## - # Lists `PrivateConnection` resources in a given project and location. - # - # @overload list_private_connections(request, options = nil) - # Pass arguments to `list_private_connections` via a request object, either of type - # {::Google::Cloud::VmwareEngine::V1::ListPrivateConnectionsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VmwareEngine::V1::ListPrivateConnectionsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_private_connections(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) - # Pass arguments to `list_private_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 to query for - # private connections. Resource names are schemeless URIs that follow the - # conventions in https://cloud.google.com/apis/design/resource_names. For - # example: `projects/my-project/locations/us-central1` - # @param page_size [::Integer] - # The maximum number of private connections to return in one page. - # The maximum value is coerced to 1000. - # The default value of this field is 500. - # @param page_token [::String] - # A page token, received from a previous `ListPrivateConnections` call. - # Provide this to retrieve the subsequent page. - # - # When paginating, all other parameters provided to - # `ListPrivateConnections` must match the call that provided the page - # token. - # @param filter [::String] - # A filter expression that matches resources returned in the response. - # The expression must specify the field name, a comparison - # operator, and the value that you want to use for filtering. The value - # must be a string, a number, or a boolean. The comparison operator - # must be `=`, `!=`, `>`, or `<`. - # - # For example, if you are filtering a list of private connections, you can - # exclude the ones named `example-connection` by specifying - # `name != "example-connection"`. - # - # To filter on multiple expressions, provide each separate expression within - # parentheses. For example: - # ``` - # (name = "example-connection") - # (createTime > "2022-09-22T08:15:10.40Z") - # ``` - # - # By default, each expression is an `AND` expression. However, you - # can include `AND` and `OR` expressions explicitly. - # For example: - # ``` - # (name = "example-connection-1") AND - # (createTime > "2021-04-12T08:15:10.40Z") OR - # (name = "example-connection-2") - # ``` - # @param order_by [::String] - # Sorts list results by a certain order. By default, returned results - # are ordered by `name` in ascending order. - # You can also sort results in descending order based on the `name` value - # using `orderBy="name desc"`. - # Currently, only ordering by `name` is supported. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::VmwareEngine::V1::PrivateConnection>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::VmwareEngine::V1::PrivateConnection>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/vmware_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VmwareEngine::V1::ListPrivateConnectionsRequest.new - # - # # Call the list_private_connections method. - # result = client.list_private_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::VmwareEngine::V1::PrivateConnection. - # p item - # end - # - def list_private_connections request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::ListPrivateConnectionsRequest - - # Converts hash 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_private_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::VmwareEngine::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_private_connections.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_private_connections.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vmware_engine_stub.call_rpc :list_private_connections, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @vmware_engine_stub, :list_private_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 - - ## - # Modifies a `PrivateConnection` resource. Only `description` and - # `routing_mode` fields can be updated. Only fields specified in `updateMask` - # are applied. - # - # @overload update_private_connection(request, options = nil) - # Pass arguments to `update_private_connection` via a request object, either of type - # {::Google::Cloud::VmwareEngine::V1::UpdatePrivateConnectionRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VmwareEngine::V1::UpdatePrivateConnectionRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_private_connection(private_connection: nil, update_mask: nil, request_id: nil) - # Pass arguments to `update_private_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 private_connection [::Google::Cloud::VmwareEngine::V1::PrivateConnection, ::Hash] - # Required. Private connection description. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Required. Field mask is used to specify the fields to be overwritten in the - # `PrivateConnection` resource by the update. - # The fields specified in the `update_mask` are relative to the resource, not - # the full request. A field will be overwritten if it is in the mask. If the - # user does not provide a mask then all fields will be overwritten. - # @param request_id [::String] - # Optional. A request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server guarantees that a - # request doesn't result in creation of duplicate commitments for at least 60 - # minutes. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # - # @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/vmware_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VmwareEngine::V1::UpdatePrivateConnectionRequest.new - # - # # Call the update_private_connection method. - # result = client.update_private_connection 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 update_private_connection request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::UpdatePrivateConnectionRequest - - # Converts hash 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_private_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::VmwareEngine::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.private_connection&.name - header_params["private_connection.name"] = request.private_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_private_connection.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_private_connection.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vmware_engine_stub.call_rpc :update_private_connection, 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 `PrivateConnection` resource. When a private connection is - # deleted for a VMware Engine network, the connected network becomes - # inaccessible to that VMware Engine network. - # - # @overload delete_private_connection(request, options = nil) - # Pass arguments to `delete_private_connection` via a request object, either of type - # {::Google::Cloud::VmwareEngine::V1::DeletePrivateConnectionRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VmwareEngine::V1::DeletePrivateConnectionRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_private_connection(name: nil, request_id: nil) - # Pass arguments to `delete_private_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 resource name of the private connection to be deleted. - # Resource names are schemeless URIs that follow the conventions in - # https://cloud.google.com/apis/design/resource_names. - # For example: - # `projects/my-project/locations/us-central1/privateConnections/my-connection` - # @param request_id [::String] - # Optional. A request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server guarantees that a - # request doesn't result in creation of duplicate commitments for at least 60 - # minutes. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # - # @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/vmware_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VmwareEngine::V1::DeletePrivateConnectionRequest.new - # - # # Call the delete_private_connection method. - # result = client.delete_private_connection 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_private_connection request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::DeletePrivateConnectionRequest - - # Converts hash 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_private_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::VmwareEngine::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_private_connection.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_private_connection.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vmware_engine_stub.call_rpc :delete_private_connection, 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 - - ## - # Lists the private connection routes exchanged over a peering connection. - # - # @overload list_private_connection_peering_routes(request, options = nil) - # Pass arguments to `list_private_connection_peering_routes` via a request object, either of type - # {::Google::Cloud::VmwareEngine::V1::ListPrivateConnectionPeeringRoutesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VmwareEngine::V1::ListPrivateConnectionPeeringRoutesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_private_connection_peering_routes(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_private_connection_peering_routes` via keyword arguments. Note that at - # least one keyword argument is 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 private connection to retrieve peering - # routes from. Resource names are schemeless URIs that follow the conventions - # in https://cloud.google.com/apis/design/resource_names. For example: - # `projects/my-project/locations/us-west1/privateConnections/my-connection` - # @param page_size [::Integer] - # The maximum number of peering routes to return in one page. - # The service may return fewer than this value. - # The maximum value is coerced to 1000. - # The default value of this field is 500. - # @param page_token [::String] - # A page token, received from a previous `ListPrivateConnectionPeeringRoutes` - # call. Provide this to retrieve the subsequent page. When paginating, all - # other parameters provided to `ListPrivateConnectionPeeringRoutes` must - # match the call that provided the page token. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::VmwareEngine::V1::PeeringRoute>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::VmwareEngine::V1::PeeringRoute>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/vmware_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VmwareEngine::V1::ListPrivateConnectionPeeringRoutesRequest.new - # - # # Call the list_private_connection_peering_routes method. - # result = client.list_private_connection_peering_routes 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::VmwareEngine::V1::PeeringRoute. - # p item - # end - # - def list_private_connection_peering_routes request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::ListPrivateConnectionPeeringRoutesRequest - - # Converts hash 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_private_connection_peering_routes.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::VmwareEngine::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_private_connection_peering_routes.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_private_connection_peering_routes.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vmware_engine_stub.call_rpc :list_private_connection_peering_routes, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @vmware_engine_stub, :list_private_connection_peering_routes, 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 - - ## - # Grants the bind permission to the customer provided principal(user / - # service account) to bind their DNS zone with the intranet VPC associated - # with the project. DnsBindPermission is a global resource and location can - # only be global. - # - # @overload grant_dns_bind_permission(request, options = nil) - # Pass arguments to `grant_dns_bind_permission` via a request object, either of type - # {::Google::Cloud::VmwareEngine::V1::GrantDnsBindPermissionRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VmwareEngine::V1::GrantDnsBindPermissionRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload grant_dns_bind_permission(name: nil, principal: nil, request_id: nil) - # Pass arguments to `grant_dns_bind_permission` via keyword arguments. Note that at - # least one keyword argument is 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 name of the resource which stores the users/service accounts - # having the permission to bind to the corresponding intranet VPC of the - # consumer project. DnsBindPermission is a global resource. Resource names - # are schemeless URIs that follow the conventions in - # https://cloud.google.com/apis/design/resource_names. For example: - # `projects/my-project/locations/global/dnsBindPermission` - # @param principal [::Google::Cloud::VmwareEngine::V1::Principal, ::Hash] - # Required. The consumer provided user/service account which needs to be - # granted permission to bind with the intranet VPC corresponding to the - # consumer project. - # @param request_id [::String] - # Optional. A request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server guarantees that a - # request doesn't result in creation of duplicate commitments for at least 60 - # minutes. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # - # @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/vmware_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VmwareEngine::V1::GrantDnsBindPermissionRequest.new - # - # # Call the grant_dns_bind_permission method. - # result = client.grant_dns_bind_permission 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 grant_dns_bind_permission request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::GrantDnsBindPermissionRequest - - # Converts hash 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.grant_dns_bind_permission.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::VmwareEngine::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.grant_dns_bind_permission.timeout, - metadata: metadata, - retry_policy: @config.rpcs.grant_dns_bind_permission.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vmware_engine_stub.call_rpc :grant_dns_bind_permission, 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 - - ## - # Gets all the principals having bind permission on the intranet VPC - # associated with the consumer project granted by the Grant API. - # DnsBindPermission is a global resource and location can only be global. - # - # @overload get_dns_bind_permission(request, options = nil) - # Pass arguments to `get_dns_bind_permission` via a request object, either of type - # {::Google::Cloud::VmwareEngine::V1::GetDnsBindPermissionRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VmwareEngine::V1::GetDnsBindPermissionRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_dns_bind_permission(name: nil) - # Pass arguments to `get_dns_bind_permission` via keyword arguments. Note that at - # least one keyword argument is 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 name of the resource which stores the users/service accounts - # having the permission to bind to the corresponding intranet VPC of the - # consumer project. DnsBindPermission is a global resource. Resource names - # are schemeless URIs that follow the conventions in - # https://cloud.google.com/apis/design/resource_names. For example: - # `projects/my-project/locations/global/dnsBindPermission` - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::VmwareEngine::V1::DnsBindPermission] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::VmwareEngine::V1::DnsBindPermission] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/vmware_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VmwareEngine::V1::GetDnsBindPermissionRequest.new - # - # # Call the get_dns_bind_permission method. - # result = client.get_dns_bind_permission request - # - # # The returned object is of type Google::Cloud::VmwareEngine::V1::DnsBindPermission. - # p result - # - def get_dns_bind_permission request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::GetDnsBindPermissionRequest - - # Converts hash 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_dns_bind_permission.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::VmwareEngine::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_dns_bind_permission.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_dns_bind_permission.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vmware_engine_stub.call_rpc :get_dns_bind_permission, 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 - - ## - # Revokes the bind permission from the customer provided principal(user / - # service account) on the intranet VPC associated with the consumer project. - # DnsBindPermission is a global resource and location can only be global. - # - # @overload revoke_dns_bind_permission(request, options = nil) - # Pass arguments to `revoke_dns_bind_permission` via a request object, either of type - # {::Google::Cloud::VmwareEngine::V1::RevokeDnsBindPermissionRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VmwareEngine::V1::RevokeDnsBindPermissionRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload revoke_dns_bind_permission(name: nil, principal: nil, request_id: nil) - # Pass arguments to `revoke_dns_bind_permission` via keyword arguments. Note that at - # least one keyword argument is 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 name of the resource which stores the users/service accounts - # having the permission to bind to the corresponding intranet VPC of the - # consumer project. DnsBindPermission is a global resource. Resource names - # are schemeless URIs that follow the conventions in - # https://cloud.google.com/apis/design/resource_names. For example: - # `projects/my-project/locations/global/dnsBindPermission` - # @param principal [::Google::Cloud::VmwareEngine::V1::Principal, ::Hash] - # Required. The consumer provided user/service account which needs to be - # granted permission to bind with the intranet VPC corresponding to the - # consumer project. - # @param request_id [::String] - # Optional. A request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server guarantees that a - # request doesn't result in creation of duplicate commitments for at least 60 - # minutes. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # - # @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/vmware_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VmwareEngine::V1::RevokeDnsBindPermissionRequest.new - # - # # Call the revoke_dns_bind_permission method. - # result = client.revoke_dns_bind_permission 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 revoke_dns_bind_permission request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::RevokeDnsBindPermissionRequest - - # Converts hash 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.revoke_dns_bind_permission.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::VmwareEngine::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.revoke_dns_bind_permission.timeout, - metadata: metadata, - retry_policy: @config.rpcs.revoke_dns_bind_permission.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vmware_engine_stub.call_rpc :revoke_dns_bind_permission, 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 VmwareEngine API. - # - # This class represents the configuration for VmwareEngine, - # 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::VmwareEngine::V1::VmwareEngine::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_private_clouds to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_private_clouds.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_private_clouds.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::VmwareEngine::V1::VmwareEngine::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 = "vmwareengine.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 VmwareEngine 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_private_clouds` - # @return [::Gapic::Config::Method] - # - attr_reader :list_private_clouds - ## - # RPC-specific configuration for `get_private_cloud` - # @return [::Gapic::Config::Method] - # - attr_reader :get_private_cloud - ## - # RPC-specific configuration for `create_private_cloud` - # @return [::Gapic::Config::Method] - # - attr_reader :create_private_cloud - ## - # RPC-specific configuration for `update_private_cloud` - # @return [::Gapic::Config::Method] - # - attr_reader :update_private_cloud - ## - # RPC-specific configuration for `delete_private_cloud` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_private_cloud - ## - # RPC-specific configuration for `undelete_private_cloud` - # @return [::Gapic::Config::Method] - # - attr_reader :undelete_private_cloud - ## - # RPC-specific configuration for `list_clusters` - # @return [::Gapic::Config::Method] - # - attr_reader :list_clusters - ## - # RPC-specific configuration for `get_cluster` - # @return [::Gapic::Config::Method] - # - attr_reader :get_cluster - ## - # RPC-specific configuration for `create_cluster` - # @return [::Gapic::Config::Method] - # - attr_reader :create_cluster - ## - # RPC-specific configuration for `update_cluster` - # @return [::Gapic::Config::Method] - # - attr_reader :update_cluster - ## - # RPC-specific configuration for `delete_cluster` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_cluster - ## - # RPC-specific configuration for `list_nodes` - # @return [::Gapic::Config::Method] - # - attr_reader :list_nodes - ## - # RPC-specific configuration for `get_node` - # @return [::Gapic::Config::Method] - # - attr_reader :get_node - ## - # RPC-specific configuration for `list_external_addresses` - # @return [::Gapic::Config::Method] - # - attr_reader :list_external_addresses - ## - # RPC-specific configuration for `fetch_network_policy_external_addresses` - # @return [::Gapic::Config::Method] - # - attr_reader :fetch_network_policy_external_addresses - ## - # RPC-specific configuration for `get_external_address` - # @return [::Gapic::Config::Method] - # - attr_reader :get_external_address - ## - # RPC-specific configuration for `create_external_address` - # @return [::Gapic::Config::Method] - # - attr_reader :create_external_address - ## - # RPC-specific configuration for `update_external_address` - # @return [::Gapic::Config::Method] - # - attr_reader :update_external_address - ## - # RPC-specific configuration for `delete_external_address` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_external_address - ## - # RPC-specific configuration for `list_subnets` - # @return [::Gapic::Config::Method] - # - attr_reader :list_subnets - ## - # RPC-specific configuration for `get_subnet` - # @return [::Gapic::Config::Method] - # - attr_reader :get_subnet - ## - # RPC-specific configuration for `update_subnet` - # @return [::Gapic::Config::Method] - # - attr_reader :update_subnet - ## - # RPC-specific configuration for `list_external_access_rules` - # @return [::Gapic::Config::Method] - # - attr_reader :list_external_access_rules - ## - # RPC-specific configuration for `get_external_access_rule` - # @return [::Gapic::Config::Method] - # - attr_reader :get_external_access_rule - ## - # RPC-specific configuration for `create_external_access_rule` - # @return [::Gapic::Config::Method] - # - attr_reader :create_external_access_rule - ## - # RPC-specific configuration for `update_external_access_rule` - # @return [::Gapic::Config::Method] - # - attr_reader :update_external_access_rule - ## - # RPC-specific configuration for `delete_external_access_rule` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_external_access_rule - ## - # RPC-specific configuration for `list_logging_servers` - # @return [::Gapic::Config::Method] - # - attr_reader :list_logging_servers - ## - # RPC-specific configuration for `get_logging_server` - # @return [::Gapic::Config::Method] - # - attr_reader :get_logging_server - ## - # RPC-specific configuration for `create_logging_server` - # @return [::Gapic::Config::Method] - # - attr_reader :create_logging_server - ## - # RPC-specific configuration for `update_logging_server` - # @return [::Gapic::Config::Method] - # - attr_reader :update_logging_server - ## - # RPC-specific configuration for `delete_logging_server` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_logging_server - ## - # RPC-specific configuration for `list_node_types` - # @return [::Gapic::Config::Method] - # - attr_reader :list_node_types - ## - # RPC-specific configuration for `get_node_type` - # @return [::Gapic::Config::Method] - # - attr_reader :get_node_type - ## - # RPC-specific configuration for `show_nsx_credentials` - # @return [::Gapic::Config::Method] - # - attr_reader :show_nsx_credentials - ## - # RPC-specific configuration for `show_vcenter_credentials` - # @return [::Gapic::Config::Method] - # - attr_reader :show_vcenter_credentials - ## - # RPC-specific configuration for `reset_nsx_credentials` - # @return [::Gapic::Config::Method] - # - attr_reader :reset_nsx_credentials - ## - # RPC-specific configuration for `reset_vcenter_credentials` - # @return [::Gapic::Config::Method] - # - attr_reader :reset_vcenter_credentials - ## - # RPC-specific configuration for `get_dns_forwarding` - # @return [::Gapic::Config::Method] - # - attr_reader :get_dns_forwarding - ## - # RPC-specific configuration for `update_dns_forwarding` - # @return [::Gapic::Config::Method] - # - attr_reader :update_dns_forwarding - ## - # RPC-specific configuration for `get_network_peering` - # @return [::Gapic::Config::Method] - # - attr_reader :get_network_peering - ## - # RPC-specific configuration for `list_network_peerings` - # @return [::Gapic::Config::Method] - # - attr_reader :list_network_peerings - ## - # RPC-specific configuration for `create_network_peering` - # @return [::Gapic::Config::Method] - # - attr_reader :create_network_peering - ## - # RPC-specific configuration for `delete_network_peering` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_network_peering - ## - # RPC-specific configuration for `update_network_peering` - # @return [::Gapic::Config::Method] - # - attr_reader :update_network_peering - ## - # RPC-specific configuration for `list_peering_routes` - # @return [::Gapic::Config::Method] - # - attr_reader :list_peering_routes - ## - # RPC-specific configuration for `create_hcx_activation_key` - # @return [::Gapic::Config::Method] - # - attr_reader :create_hcx_activation_key - ## - # RPC-specific configuration for `list_hcx_activation_keys` - # @return [::Gapic::Config::Method] - # - attr_reader :list_hcx_activation_keys - ## - # RPC-specific configuration for `get_hcx_activation_key` - # @return [::Gapic::Config::Method] - # - attr_reader :get_hcx_activation_key - ## - # RPC-specific configuration for `get_network_policy` - # @return [::Gapic::Config::Method] - # - attr_reader :get_network_policy - ## - # RPC-specific configuration for `list_network_policies` - # @return [::Gapic::Config::Method] - # - attr_reader :list_network_policies - ## - # RPC-specific configuration for `create_network_policy` - # @return [::Gapic::Config::Method] - # - attr_reader :create_network_policy - ## - # RPC-specific configuration for `update_network_policy` - # @return [::Gapic::Config::Method] - # - attr_reader :update_network_policy - ## - # RPC-specific configuration for `delete_network_policy` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_network_policy - ## - # RPC-specific configuration for `list_management_dns_zone_bindings` - # @return [::Gapic::Config::Method] - # - attr_reader :list_management_dns_zone_bindings - ## - # RPC-specific configuration for `get_management_dns_zone_binding` - # @return [::Gapic::Config::Method] - # - attr_reader :get_management_dns_zone_binding - ## - # RPC-specific configuration for `create_management_dns_zone_binding` - # @return [::Gapic::Config::Method] - # - attr_reader :create_management_dns_zone_binding - ## - # RPC-specific configuration for `update_management_dns_zone_binding` - # @return [::Gapic::Config::Method] - # - attr_reader :update_management_dns_zone_binding - ## - # RPC-specific configuration for `delete_management_dns_zone_binding` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_management_dns_zone_binding - ## - # RPC-specific configuration for `repair_management_dns_zone_binding` - # @return [::Gapic::Config::Method] - # - attr_reader :repair_management_dns_zone_binding - ## - # RPC-specific configuration for `create_vmware_engine_network` - # @return [::Gapic::Config::Method] - # - attr_reader :create_vmware_engine_network - ## - # RPC-specific configuration for `update_vmware_engine_network` - # @return [::Gapic::Config::Method] - # - attr_reader :update_vmware_engine_network - ## - # RPC-specific configuration for `delete_vmware_engine_network` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_vmware_engine_network - ## - # RPC-specific configuration for `get_vmware_engine_network` - # @return [::Gapic::Config::Method] - # - attr_reader :get_vmware_engine_network - ## - # RPC-specific configuration for `list_vmware_engine_networks` - # @return [::Gapic::Config::Method] - # - attr_reader :list_vmware_engine_networks - ## - # RPC-specific configuration for `create_private_connection` - # @return [::Gapic::Config::Method] - # - attr_reader :create_private_connection - ## - # RPC-specific configuration for `get_private_connection` - # @return [::Gapic::Config::Method] - # - attr_reader :get_private_connection - ## - # RPC-specific configuration for `list_private_connections` - # @return [::Gapic::Config::Method] - # - attr_reader :list_private_connections - ## - # RPC-specific configuration for `update_private_connection` - # @return [::Gapic::Config::Method] - # - attr_reader :update_private_connection - ## - # RPC-specific configuration for `delete_private_connection` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_private_connection - ## - # RPC-specific configuration for `list_private_connection_peering_routes` - # @return [::Gapic::Config::Method] - # - attr_reader :list_private_connection_peering_routes - ## - # RPC-specific configuration for `grant_dns_bind_permission` - # @return [::Gapic::Config::Method] - # - attr_reader :grant_dns_bind_permission - ## - # RPC-specific configuration for `get_dns_bind_permission` - # @return [::Gapic::Config::Method] - # - attr_reader :get_dns_bind_permission - ## - # RPC-specific configuration for `revoke_dns_bind_permission` - # @return [::Gapic::Config::Method] - # - attr_reader :revoke_dns_bind_permission - - # @private - def initialize parent_rpcs = nil - list_private_clouds_config = parent_rpcs.list_private_clouds if parent_rpcs.respond_to? :list_private_clouds - @list_private_clouds = ::Gapic::Config::Method.new list_private_clouds_config - get_private_cloud_config = parent_rpcs.get_private_cloud if parent_rpcs.respond_to? :get_private_cloud - @get_private_cloud = ::Gapic::Config::Method.new get_private_cloud_config - create_private_cloud_config = parent_rpcs.create_private_cloud if parent_rpcs.respond_to? :create_private_cloud - @create_private_cloud = ::Gapic::Config::Method.new create_private_cloud_config - update_private_cloud_config = parent_rpcs.update_private_cloud if parent_rpcs.respond_to? :update_private_cloud - @update_private_cloud = ::Gapic::Config::Method.new update_private_cloud_config - delete_private_cloud_config = parent_rpcs.delete_private_cloud if parent_rpcs.respond_to? :delete_private_cloud - @delete_private_cloud = ::Gapic::Config::Method.new delete_private_cloud_config - undelete_private_cloud_config = parent_rpcs.undelete_private_cloud if parent_rpcs.respond_to? :undelete_private_cloud - @undelete_private_cloud = ::Gapic::Config::Method.new undelete_private_cloud_config - list_clusters_config = parent_rpcs.list_clusters if parent_rpcs.respond_to? :list_clusters - @list_clusters = ::Gapic::Config::Method.new list_clusters_config - get_cluster_config = parent_rpcs.get_cluster if parent_rpcs.respond_to? :get_cluster - @get_cluster = ::Gapic::Config::Method.new get_cluster_config - create_cluster_config = parent_rpcs.create_cluster if parent_rpcs.respond_to? :create_cluster - @create_cluster = ::Gapic::Config::Method.new create_cluster_config - update_cluster_config = parent_rpcs.update_cluster if parent_rpcs.respond_to? :update_cluster - @update_cluster = ::Gapic::Config::Method.new update_cluster_config - delete_cluster_config = parent_rpcs.delete_cluster if parent_rpcs.respond_to? :delete_cluster - @delete_cluster = ::Gapic::Config::Method.new delete_cluster_config - list_nodes_config = parent_rpcs.list_nodes if parent_rpcs.respond_to? :list_nodes - @list_nodes = ::Gapic::Config::Method.new list_nodes_config - get_node_config = parent_rpcs.get_node if parent_rpcs.respond_to? :get_node - @get_node = ::Gapic::Config::Method.new get_node_config - list_external_addresses_config = parent_rpcs.list_external_addresses if parent_rpcs.respond_to? :list_external_addresses - @list_external_addresses = ::Gapic::Config::Method.new list_external_addresses_config - fetch_network_policy_external_addresses_config = parent_rpcs.fetch_network_policy_external_addresses if parent_rpcs.respond_to? :fetch_network_policy_external_addresses - @fetch_network_policy_external_addresses = ::Gapic::Config::Method.new fetch_network_policy_external_addresses_config - get_external_address_config = parent_rpcs.get_external_address if parent_rpcs.respond_to? :get_external_address - @get_external_address = ::Gapic::Config::Method.new get_external_address_config - create_external_address_config = parent_rpcs.create_external_address if parent_rpcs.respond_to? :create_external_address - @create_external_address = ::Gapic::Config::Method.new create_external_address_config - update_external_address_config = parent_rpcs.update_external_address if parent_rpcs.respond_to? :update_external_address - @update_external_address = ::Gapic::Config::Method.new update_external_address_config - delete_external_address_config = parent_rpcs.delete_external_address if parent_rpcs.respond_to? :delete_external_address - @delete_external_address = ::Gapic::Config::Method.new delete_external_address_config - list_subnets_config = parent_rpcs.list_subnets if parent_rpcs.respond_to? :list_subnets - @list_subnets = ::Gapic::Config::Method.new list_subnets_config - get_subnet_config = parent_rpcs.get_subnet if parent_rpcs.respond_to? :get_subnet - @get_subnet = ::Gapic::Config::Method.new get_subnet_config - update_subnet_config = parent_rpcs.update_subnet if parent_rpcs.respond_to? :update_subnet - @update_subnet = ::Gapic::Config::Method.new update_subnet_config - list_external_access_rules_config = parent_rpcs.list_external_access_rules if parent_rpcs.respond_to? :list_external_access_rules - @list_external_access_rules = ::Gapic::Config::Method.new list_external_access_rules_config - get_external_access_rule_config = parent_rpcs.get_external_access_rule if parent_rpcs.respond_to? :get_external_access_rule - @get_external_access_rule = ::Gapic::Config::Method.new get_external_access_rule_config - create_external_access_rule_config = parent_rpcs.create_external_access_rule if parent_rpcs.respond_to? :create_external_access_rule - @create_external_access_rule = ::Gapic::Config::Method.new create_external_access_rule_config - update_external_access_rule_config = parent_rpcs.update_external_access_rule if parent_rpcs.respond_to? :update_external_access_rule - @update_external_access_rule = ::Gapic::Config::Method.new update_external_access_rule_config - delete_external_access_rule_config = parent_rpcs.delete_external_access_rule if parent_rpcs.respond_to? :delete_external_access_rule - @delete_external_access_rule = ::Gapic::Config::Method.new delete_external_access_rule_config - list_logging_servers_config = parent_rpcs.list_logging_servers if parent_rpcs.respond_to? :list_logging_servers - @list_logging_servers = ::Gapic::Config::Method.new list_logging_servers_config - get_logging_server_config = parent_rpcs.get_logging_server if parent_rpcs.respond_to? :get_logging_server - @get_logging_server = ::Gapic::Config::Method.new get_logging_server_config - create_logging_server_config = parent_rpcs.create_logging_server if parent_rpcs.respond_to? :create_logging_server - @create_logging_server = ::Gapic::Config::Method.new create_logging_server_config - update_logging_server_config = parent_rpcs.update_logging_server if parent_rpcs.respond_to? :update_logging_server - @update_logging_server = ::Gapic::Config::Method.new update_logging_server_config - delete_logging_server_config = parent_rpcs.delete_logging_server if parent_rpcs.respond_to? :delete_logging_server - @delete_logging_server = ::Gapic::Config::Method.new delete_logging_server_config - list_node_types_config = parent_rpcs.list_node_types if parent_rpcs.respond_to? :list_node_types - @list_node_types = ::Gapic::Config::Method.new list_node_types_config - get_node_type_config = parent_rpcs.get_node_type if parent_rpcs.respond_to? :get_node_type - @get_node_type = ::Gapic::Config::Method.new get_node_type_config - show_nsx_credentials_config = parent_rpcs.show_nsx_credentials if parent_rpcs.respond_to? :show_nsx_credentials - @show_nsx_credentials = ::Gapic::Config::Method.new show_nsx_credentials_config - show_vcenter_credentials_config = parent_rpcs.show_vcenter_credentials if parent_rpcs.respond_to? :show_vcenter_credentials - @show_vcenter_credentials = ::Gapic::Config::Method.new show_vcenter_credentials_config - reset_nsx_credentials_config = parent_rpcs.reset_nsx_credentials if parent_rpcs.respond_to? :reset_nsx_credentials - @reset_nsx_credentials = ::Gapic::Config::Method.new reset_nsx_credentials_config - reset_vcenter_credentials_config = parent_rpcs.reset_vcenter_credentials if parent_rpcs.respond_to? :reset_vcenter_credentials - @reset_vcenter_credentials = ::Gapic::Config::Method.new reset_vcenter_credentials_config - get_dns_forwarding_config = parent_rpcs.get_dns_forwarding if parent_rpcs.respond_to? :get_dns_forwarding - @get_dns_forwarding = ::Gapic::Config::Method.new get_dns_forwarding_config - update_dns_forwarding_config = parent_rpcs.update_dns_forwarding if parent_rpcs.respond_to? :update_dns_forwarding - @update_dns_forwarding = ::Gapic::Config::Method.new update_dns_forwarding_config - get_network_peering_config = parent_rpcs.get_network_peering if parent_rpcs.respond_to? :get_network_peering - @get_network_peering = ::Gapic::Config::Method.new get_network_peering_config - list_network_peerings_config = parent_rpcs.list_network_peerings if parent_rpcs.respond_to? :list_network_peerings - @list_network_peerings = ::Gapic::Config::Method.new list_network_peerings_config - create_network_peering_config = parent_rpcs.create_network_peering if parent_rpcs.respond_to? :create_network_peering - @create_network_peering = ::Gapic::Config::Method.new create_network_peering_config - delete_network_peering_config = parent_rpcs.delete_network_peering if parent_rpcs.respond_to? :delete_network_peering - @delete_network_peering = ::Gapic::Config::Method.new delete_network_peering_config - update_network_peering_config = parent_rpcs.update_network_peering if parent_rpcs.respond_to? :update_network_peering - @update_network_peering = ::Gapic::Config::Method.new update_network_peering_config - list_peering_routes_config = parent_rpcs.list_peering_routes if parent_rpcs.respond_to? :list_peering_routes - @list_peering_routes = ::Gapic::Config::Method.new list_peering_routes_config - create_hcx_activation_key_config = parent_rpcs.create_hcx_activation_key if parent_rpcs.respond_to? :create_hcx_activation_key - @create_hcx_activation_key = ::Gapic::Config::Method.new create_hcx_activation_key_config - list_hcx_activation_keys_config = parent_rpcs.list_hcx_activation_keys if parent_rpcs.respond_to? :list_hcx_activation_keys - @list_hcx_activation_keys = ::Gapic::Config::Method.new list_hcx_activation_keys_config - get_hcx_activation_key_config = parent_rpcs.get_hcx_activation_key if parent_rpcs.respond_to? :get_hcx_activation_key - @get_hcx_activation_key = ::Gapic::Config::Method.new get_hcx_activation_key_config - get_network_policy_config = parent_rpcs.get_network_policy if parent_rpcs.respond_to? :get_network_policy - @get_network_policy = ::Gapic::Config::Method.new get_network_policy_config - list_network_policies_config = parent_rpcs.list_network_policies if parent_rpcs.respond_to? :list_network_policies - @list_network_policies = ::Gapic::Config::Method.new list_network_policies_config - create_network_policy_config = parent_rpcs.create_network_policy if parent_rpcs.respond_to? :create_network_policy - @create_network_policy = ::Gapic::Config::Method.new create_network_policy_config - update_network_policy_config = parent_rpcs.update_network_policy if parent_rpcs.respond_to? :update_network_policy - @update_network_policy = ::Gapic::Config::Method.new update_network_policy_config - delete_network_policy_config = parent_rpcs.delete_network_policy if parent_rpcs.respond_to? :delete_network_policy - @delete_network_policy = ::Gapic::Config::Method.new delete_network_policy_config - list_management_dns_zone_bindings_config = parent_rpcs.list_management_dns_zone_bindings if parent_rpcs.respond_to? :list_management_dns_zone_bindings - @list_management_dns_zone_bindings = ::Gapic::Config::Method.new list_management_dns_zone_bindings_config - get_management_dns_zone_binding_config = parent_rpcs.get_management_dns_zone_binding if parent_rpcs.respond_to? :get_management_dns_zone_binding - @get_management_dns_zone_binding = ::Gapic::Config::Method.new get_management_dns_zone_binding_config - create_management_dns_zone_binding_config = parent_rpcs.create_management_dns_zone_binding if parent_rpcs.respond_to? :create_management_dns_zone_binding - @create_management_dns_zone_binding = ::Gapic::Config::Method.new create_management_dns_zone_binding_config - update_management_dns_zone_binding_config = parent_rpcs.update_management_dns_zone_binding if parent_rpcs.respond_to? :update_management_dns_zone_binding - @update_management_dns_zone_binding = ::Gapic::Config::Method.new update_management_dns_zone_binding_config - delete_management_dns_zone_binding_config = parent_rpcs.delete_management_dns_zone_binding if parent_rpcs.respond_to? :delete_management_dns_zone_binding - @delete_management_dns_zone_binding = ::Gapic::Config::Method.new delete_management_dns_zone_binding_config - repair_management_dns_zone_binding_config = parent_rpcs.repair_management_dns_zone_binding if parent_rpcs.respond_to? :repair_management_dns_zone_binding - @repair_management_dns_zone_binding = ::Gapic::Config::Method.new repair_management_dns_zone_binding_config - create_vmware_engine_network_config = parent_rpcs.create_vmware_engine_network if parent_rpcs.respond_to? :create_vmware_engine_network - @create_vmware_engine_network = ::Gapic::Config::Method.new create_vmware_engine_network_config - update_vmware_engine_network_config = parent_rpcs.update_vmware_engine_network if parent_rpcs.respond_to? :update_vmware_engine_network - @update_vmware_engine_network = ::Gapic::Config::Method.new update_vmware_engine_network_config - delete_vmware_engine_network_config = parent_rpcs.delete_vmware_engine_network if parent_rpcs.respond_to? :delete_vmware_engine_network - @delete_vmware_engine_network = ::Gapic::Config::Method.new delete_vmware_engine_network_config - get_vmware_engine_network_config = parent_rpcs.get_vmware_engine_network if parent_rpcs.respond_to? :get_vmware_engine_network - @get_vmware_engine_network = ::Gapic::Config::Method.new get_vmware_engine_network_config - list_vmware_engine_networks_config = parent_rpcs.list_vmware_engine_networks if parent_rpcs.respond_to? :list_vmware_engine_networks - @list_vmware_engine_networks = ::Gapic::Config::Method.new list_vmware_engine_networks_config - create_private_connection_config = parent_rpcs.create_private_connection if parent_rpcs.respond_to? :create_private_connection - @create_private_connection = ::Gapic::Config::Method.new create_private_connection_config - get_private_connection_config = parent_rpcs.get_private_connection if parent_rpcs.respond_to? :get_private_connection - @get_private_connection = ::Gapic::Config::Method.new get_private_connection_config - list_private_connections_config = parent_rpcs.list_private_connections if parent_rpcs.respond_to? :list_private_connections - @list_private_connections = ::Gapic::Config::Method.new list_private_connections_config - update_private_connection_config = parent_rpcs.update_private_connection if parent_rpcs.respond_to? :update_private_connection - @update_private_connection = ::Gapic::Config::Method.new update_private_connection_config - delete_private_connection_config = parent_rpcs.delete_private_connection if parent_rpcs.respond_to? :delete_private_connection - @delete_private_connection = ::Gapic::Config::Method.new delete_private_connection_config - list_private_connection_peering_routes_config = parent_rpcs.list_private_connection_peering_routes if parent_rpcs.respond_to? :list_private_connection_peering_routes - @list_private_connection_peering_routes = ::Gapic::Config::Method.new list_private_connection_peering_routes_config - grant_dns_bind_permission_config = parent_rpcs.grant_dns_bind_permission if parent_rpcs.respond_to? :grant_dns_bind_permission - @grant_dns_bind_permission = ::Gapic::Config::Method.new grant_dns_bind_permission_config - get_dns_bind_permission_config = parent_rpcs.get_dns_bind_permission if parent_rpcs.respond_to? :get_dns_bind_permission - @get_dns_bind_permission = ::Gapic::Config::Method.new get_dns_bind_permission_config - revoke_dns_bind_permission_config = parent_rpcs.revoke_dns_bind_permission if parent_rpcs.respond_to? :revoke_dns_bind_permission - @revoke_dns_bind_permission = ::Gapic::Config::Method.new revoke_dns_bind_permission_config - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-vmware_engine-v1/lib/google/cloud/vmware_engine/v1/vmware_engine/credentials.rb b/owl-bot-staging/google-cloud-vmware_engine-v1/lib/google/cloud/vmware_engine/v1/vmware_engine/credentials.rb deleted file mode 100644 index 3315e3ee7355..000000000000 --- a/owl-bot-staging/google-cloud-vmware_engine-v1/lib/google/cloud/vmware_engine/v1/vmware_engine/credentials.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! - -require "googleauth" - -module Google - module Cloud - module VmwareEngine - module V1 - module VmwareEngine - # Credentials for the VmwareEngine API. - class Credentials < ::Google::Auth::Credentials - self.scope = [ - "https://www.googleapis.com/auth/cloud-platform" - ] - self.env_vars = [ - "GOOGLE_CLOUD_CREDENTIALS", - "GOOGLE_CLOUD_KEYFILE", - "GCLOUD_KEYFILE", - "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-vmware_engine-v1/lib/google/cloud/vmware_engine/v1/vmware_engine/operations.rb b/owl-bot-staging/google-cloud-vmware_engine-v1/lib/google/cloud/vmware_engine/v1/vmware_engine/operations.rb deleted file mode 100644 index d8e3a093e6d2..000000000000 --- a/owl-bot-staging/google-cloud-vmware_engine-v1/lib/google/cloud/vmware_engine/v1/vmware_engine/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 VmwareEngine - module V1 - module VmwareEngine - # Service that implements Longrunning Operations API. - class Operations - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "vmwareengine.$UNIVERSE_DOMAIN$" - - # @private - attr_reader :operations_stub - - ## - # Configuration for the VmwareEngine 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 VmwareEngine 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::VmwareEngine::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::VmwareEngine::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::VmwareEngine::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::VmwareEngine::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::VmwareEngine::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 = "vmwareengine.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-vmware_engine-v1/lib/google/cloud/vmware_engine/v1/vmware_engine/paths.rb b/owl-bot-staging/google-cloud-vmware_engine-v1/lib/google/cloud/vmware_engine/v1/vmware_engine/paths.rb deleted file mode 100644 index 230fafe081b5..000000000000 --- a/owl-bot-staging/google-cloud-vmware_engine-v1/lib/google/cloud/vmware_engine/v1/vmware_engine/paths.rb +++ /dev/null @@ -1,387 +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 VmwareEngine - module V1 - module VmwareEngine - # Path helper methods for the VmwareEngine API. - module Paths - ## - # Create a fully-qualified Cluster resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/privateClouds/{private_cloud}/clusters/{cluster}` - # - # @param project [String] - # @param location [String] - # @param private_cloud [String] - # @param cluster [String] - # - # @return [::String] - def cluster_path project:, location:, private_cloud:, cluster: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "private_cloud cannot contain /" if private_cloud.to_s.include? "/" - - "projects/#{project}/locations/#{location}/privateClouds/#{private_cloud}/clusters/#{cluster}" - end - - ## - # Create a fully-qualified DnsBindPermission resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/dnsBindPermission` - # - # @param project [String] - # @param location [String] - # - # @return [::String] - def dns_bind_permission_path project:, location: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - - "projects/#{project}/locations/#{location}/dnsBindPermission" - end - - ## - # Create a fully-qualified DnsForwarding resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/privateClouds/{private_cloud}/dnsForwarding` - # - # @param project [String] - # @param location [String] - # @param private_cloud [String] - # - # @return [::String] - def dns_forwarding_path project:, location:, private_cloud: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/privateClouds/#{private_cloud}/dnsForwarding" - end - - ## - # Create a fully-qualified ExternalAccessRule resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/networkPolicies/{network_policy}/externalAccessRules/{external_access_rule}` - # - # @param project [String] - # @param location [String] - # @param network_policy [String] - # @param external_access_rule [String] - # - # @return [::String] - def external_access_rule_path project:, location:, network_policy:, external_access_rule: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "network_policy cannot contain /" if network_policy.to_s.include? "/" - - "projects/#{project}/locations/#{location}/networkPolicies/#{network_policy}/externalAccessRules/#{external_access_rule}" - end - - ## - # Create a fully-qualified ExternalAddress resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/privateClouds/{private_cloud}/externalAddresses/{external_address}` - # - # @param project [String] - # @param location [String] - # @param private_cloud [String] - # @param external_address [String] - # - # @return [::String] - def external_address_path project:, location:, private_cloud:, external_address: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "private_cloud cannot contain /" if private_cloud.to_s.include? "/" - - "projects/#{project}/locations/#{location}/privateClouds/#{private_cloud}/externalAddresses/#{external_address}" - end - - ## - # Create a fully-qualified HcxActivationKey resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/privateClouds/{private_cloud}/hcxActivationKeys/{hcx_activation_key}` - # - # @param project [String] - # @param location [String] - # @param private_cloud [String] - # @param hcx_activation_key [String] - # - # @return [::String] - def hcx_activation_key_path project:, location:, private_cloud:, hcx_activation_key: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "private_cloud cannot contain /" if private_cloud.to_s.include? "/" - - "projects/#{project}/locations/#{location}/privateClouds/#{private_cloud}/hcxActivationKeys/#{hcx_activation_key}" - 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 LoggingServer resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/privateClouds/{private_cloud}/loggingServers/{logging_server}` - # - # @param project [String] - # @param location [String] - # @param private_cloud [String] - # @param logging_server [String] - # - # @return [::String] - def logging_server_path project:, location:, private_cloud:, logging_server: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "private_cloud cannot contain /" if private_cloud.to_s.include? "/" - - "projects/#{project}/locations/#{location}/privateClouds/#{private_cloud}/loggingServers/#{logging_server}" - end - - ## - # Create a fully-qualified ManagementDnsZoneBinding resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/privateClouds/{private_cloud}/managementDnsZoneBindings/{management_dns_zone_binding}` - # - # @param project [String] - # @param location [String] - # @param private_cloud [String] - # @param management_dns_zone_binding [String] - # - # @return [::String] - def management_dns_zone_binding_path project:, location:, private_cloud:, management_dns_zone_binding: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "private_cloud cannot contain /" if private_cloud.to_s.include? "/" - - "projects/#{project}/locations/#{location}/privateClouds/#{private_cloud}/managementDnsZoneBindings/#{management_dns_zone_binding}" - end - - ## - # Create a fully-qualified Network resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/global/networks/{network}` - # - # @param project [String] - # @param network [String] - # - # @return [::String] - def network_path project:, network: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - - "projects/#{project}/global/networks/#{network}" - end - - ## - # Create a fully-qualified NetworkPeering resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/networkPeerings/{network_peering}` - # - # @param project [String] - # @param location [String] - # @param network_peering [String] - # - # @return [::String] - def network_peering_path project:, location:, network_peering: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/networkPeerings/#{network_peering}" - end - - ## - # Create a fully-qualified NetworkPolicy resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/networkPolicies/{network_policy}` - # - # @param project [String] - # @param location [String] - # @param network_policy [String] - # - # @return [::String] - def network_policy_path project:, location:, network_policy: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/networkPolicies/#{network_policy}" - end - - ## - # Create a fully-qualified Node resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/privateClouds/{private_cloud}/clusters/{cluster}/nodes/{node}` - # - # @param project [String] - # @param location [String] - # @param private_cloud [String] - # @param cluster [String] - # @param node [String] - # - # @return [::String] - def node_path project:, location:, private_cloud:, cluster:, node: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "private_cloud cannot contain /" if private_cloud.to_s.include? "/" - raise ::ArgumentError, "cluster cannot contain /" if cluster.to_s.include? "/" - - "projects/#{project}/locations/#{location}/privateClouds/#{private_cloud}/clusters/#{cluster}/nodes/#{node}" - end - - ## - # Create a fully-qualified NodeType resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/nodeTypes/{node_type}` - # - # @param project [String] - # @param location [String] - # @param node_type [String] - # - # @return [::String] - def node_type_path project:, location:, node_type: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/nodeTypes/#{node_type}" - end - - ## - # Create a fully-qualified PrivateCloud resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/privateClouds/{private_cloud}` - # - # @param project [String] - # @param location [String] - # @param private_cloud [String] - # - # @return [::String] - def private_cloud_path project:, location:, private_cloud: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/privateClouds/#{private_cloud}" - end - - ## - # Create a fully-qualified PrivateConnection resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/privateConnections/{private_connection}` - # - # @param project [String] - # @param location [String] - # @param private_connection [String] - # - # @return [::String] - def private_connection_path project:, location:, private_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}/privateConnections/#{private_connection}" - end - - ## - # Create a fully-qualified Subnet resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/privateClouds/{private_cloud}/subnets/{subnet}` - # - # @param project [String] - # @param location [String] - # @param private_cloud [String] - # @param subnet [String] - # - # @return [::String] - def subnet_path project:, location:, private_cloud:, subnet: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "private_cloud cannot contain /" if private_cloud.to_s.include? "/" - - "projects/#{project}/locations/#{location}/privateClouds/#{private_cloud}/subnets/#{subnet}" - end - - ## - # Create a fully-qualified VmwareEngineNetwork resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/vmwareEngineNetworks/{vmware_engine_network}` - # - # @param project [String] - # @param location [String] - # @param vmware_engine_network [String] - # - # @return [::String] - def vmware_engine_network_path project:, location:, vmware_engine_network: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/vmwareEngineNetworks/#{vmware_engine_network}" - end - - extend self - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-vmware_engine-v1/lib/google/cloud/vmware_engine/v1/vmware_engine/rest.rb b/owl-bot-staging/google-cloud-vmware_engine-v1/lib/google/cloud/vmware_engine/v1/vmware_engine/rest.rb deleted file mode 100644 index 9fde2076af48..000000000000 --- a/owl-bot-staging/google-cloud-vmware_engine-v1/lib/google/cloud/vmware_engine/v1/vmware_engine/rest.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! - -require "gapic/rest" -require "gapic/config" -require "gapic/config/method" - -require "google/cloud/vmware_engine/v1/version" -require "google/cloud/vmware_engine/v1/bindings_override" - -require "google/cloud/vmware_engine/v1/vmware_engine/credentials" -require "google/cloud/vmware_engine/v1/vmware_engine/paths" -require "google/cloud/vmware_engine/v1/vmware_engine/rest/operations" -require "google/cloud/vmware_engine/v1/vmware_engine/rest/client" - -module Google - module Cloud - module VmwareEngine - module V1 - ## - # VMwareEngine manages VMware's private clusters in the Cloud. - # - # To load this service and instantiate a REST client: - # - # require "google/cloud/vmware_engine/v1/vmware_engine/rest" - # client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new - # - module VmwareEngine - # Client for the REST transport - module Rest - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "rest", "helpers.rb" -require "google/cloud/vmware_engine/v1/vmware_engine/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-vmware_engine-v1/lib/google/cloud/vmware_engine/v1/vmware_engine/rest/client.rb b/owl-bot-staging/google-cloud-vmware_engine-v1/lib/google/cloud/vmware_engine/v1/vmware_engine/rest/client.rb deleted file mode 100644 index 00b805fa8c3c..000000000000 --- a/owl-bot-staging/google-cloud-vmware_engine-v1/lib/google/cloud/vmware_engine/v1/vmware_engine/rest/client.rb +++ /dev/null @@ -1,9003 +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/vmwareengine/v1/vmwareengine_pb" -require "google/cloud/vmware_engine/v1/vmware_engine/rest/service_stub" -require "google/cloud/location/rest" -require "google/iam/v1/rest" - -module Google - module Cloud - module VmwareEngine - module V1 - module VmwareEngine - module Rest - ## - # REST client for the VmwareEngine service. - # - # VMwareEngine manages VMware's private clusters in the Cloud. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "vmwareengine.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :vmware_engine_stub - - ## - # Configure the VmwareEngine Client class. - # - # See {::Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all VmwareEngine clients - # ::Google::Cloud::VmwareEngine::V1::VmwareEngine::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", "VmwareEngine", "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.timeout = 120.0 - - default_config.rpcs.list_private_clouds.timeout = 120.0 - default_config.rpcs.list_private_clouds.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.get_private_cloud.timeout = 120.0 - default_config.rpcs.get_private_cloud.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.list_clusters.timeout = 120.0 - default_config.rpcs.list_clusters.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.get_cluster.timeout = 120.0 - default_config.rpcs.get_cluster.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.list_nodes.timeout = 120.0 - default_config.rpcs.list_nodes.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.get_node.timeout = 120.0 - default_config.rpcs.get_node.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.list_external_addresses.timeout = 120.0 - default_config.rpcs.list_external_addresses.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.get_external_address.timeout = 120.0 - default_config.rpcs.get_external_address.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.list_subnets.timeout = 120.0 - default_config.rpcs.list_subnets.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.get_subnet.timeout = 120.0 - default_config.rpcs.get_subnet.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.update_subnet.timeout = 60.0 - - default_config.rpcs.list_external_access_rules.timeout = 120.0 - default_config.rpcs.list_external_access_rules.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.get_external_access_rule.timeout = 120.0 - default_config.rpcs.get_external_access_rule.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.list_logging_servers.timeout = 120.0 - default_config.rpcs.list_logging_servers.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.get_logging_server.timeout = 120.0 - default_config.rpcs.get_logging_server.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.list_node_types.timeout = 120.0 - default_config.rpcs.list_node_types.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.get_node_type.timeout = 120.0 - default_config.rpcs.get_node_type.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.show_nsx_credentials.timeout = 120.0 - default_config.rpcs.show_nsx_credentials.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.show_vcenter_credentials.timeout = 120.0 - default_config.rpcs.show_vcenter_credentials.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.get_dns_forwarding.timeout = 120.0 - default_config.rpcs.get_dns_forwarding.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.get_network_peering.timeout = 120.0 - default_config.rpcs.get_network_peering.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.list_network_peerings.timeout = 120.0 - default_config.rpcs.list_network_peerings.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.list_peering_routes.timeout = 120.0 - default_config.rpcs.list_peering_routes.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.list_hcx_activation_keys.timeout = 120.0 - default_config.rpcs.list_hcx_activation_keys.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.get_hcx_activation_key.timeout = 120.0 - default_config.rpcs.get_hcx_activation_key.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.get_network_policy.timeout = 120.0 - default_config.rpcs.get_network_policy.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.list_network_policies.timeout = 120.0 - default_config.rpcs.list_network_policies.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.list_management_dns_zone_bindings.timeout = 120.0 - default_config.rpcs.list_management_dns_zone_bindings.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.get_management_dns_zone_binding.timeout = 120.0 - default_config.rpcs.get_management_dns_zone_binding.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.get_vmware_engine_network.timeout = 120.0 - default_config.rpcs.get_vmware_engine_network.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.list_vmware_engine_networks.timeout = 120.0 - default_config.rpcs.list_vmware_engine_networks.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.get_private_connection.timeout = 120.0 - default_config.rpcs.get_private_connection.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.list_private_connections.timeout = 120.0 - default_config.rpcs.list_private_connections.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.list_private_connection_peering_routes.timeout = 120.0 - default_config.rpcs.list_private_connection_peering_routes.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.get_dns_bind_permission.timeout = 120.0 - default_config.rpcs.get_dns_bind_permission.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the VmwareEngine 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::VmwareEngine::V1::VmwareEngine::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 - @vmware_engine_stub.universe_domain - end - - ## - # Create a new VmwareEngine REST client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the VmwareEngine 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::VmwareEngine::V1::VmwareEngine::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 - - @vmware_engine_stub = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::ServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials, - logger: @config.logger - ) - - @vmware_engine_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 = @vmware_engine_stub.endpoint - config.universe_domain = @vmware_engine_stub.universe_domain - config.bindings_override = @config.bindings_override - config.logger = @vmware_engine_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 = @vmware_engine_stub.endpoint - config.universe_domain = @vmware_engine_stub.universe_domain - config.bindings_override = @config.bindings_override - config.logger = @vmware_engine_stub.logger if config.respond_to? :logger= - end - end - - ## - # Get the associated client for long-running operations. - # - # @return [::Google::Cloud::VmwareEngine::V1::VmwareEngine::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 - @vmware_engine_stub.logger - end - - # Service calls - - ## - # Lists `PrivateCloud` resources in a given project and location. - # - # @overload list_private_clouds(request, options = nil) - # Pass arguments to `list_private_clouds` via a request object, either of type - # {::Google::Cloud::VmwareEngine::V1::ListPrivateCloudsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VmwareEngine::V1::ListPrivateCloudsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_private_clouds(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) - # Pass arguments to `list_private_clouds` via keyword arguments. Note that at - # least one keyword argument is 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 private cloud to be queried for - # clusters. Resource names are schemeless URIs that follow the conventions in - # https://cloud.google.com/apis/design/resource_names. - # For example: - # `projects/my-project/locations/us-central1-a` - # @param page_size [::Integer] - # The maximum number of private clouds to return in one page. - # The service may return fewer than this value. - # The maximum value is coerced to 1000. - # The default value of this field is 500. - # @param page_token [::String] - # A page token, received from a previous `ListPrivateClouds` call. - # Provide this to retrieve the subsequent page. - # - # When paginating, all other parameters provided to `ListPrivateClouds` must - # match the call that provided the page token. - # @param filter [::String] - # A filter expression that matches resources returned in the response. - # The expression must specify the field name, a comparison operator, and the - # value that you want to use for filtering. The value must be a string, a - # number, or a boolean. The comparison operator must be `=`, `!=`, `>`, or - # `<`. - # - # For example, if you are filtering a list of private clouds, you can exclude - # the ones named `example-pc` by specifying `name != "example-pc"`. - # - # You can also filter nested fields. For example, you could specify - # `networkConfig.managementCidr = "192.168.0.0/24"` to include private clouds - # only if they have a matching address in their network configuration. - # - # To filter on multiple expressions, provide each separate expression within - # parentheses. For example: - # ``` - # (name = "example-pc") - # (createTime > "2021-04-12T08:15:10.40Z") - # ``` - # - # By default, each expression is an `AND` expression. However, you can - # include `AND` and `OR` expressions explicitly. For example: - # ``` - # (name = "private-cloud-1") AND - # (createTime > "2021-04-12T08:15:10.40Z") OR - # (name = "private-cloud-2") - # ``` - # @param order_by [::String] - # Sorts list results by a certain order. By default, returned results are - # ordered by `name` in ascending order. You can also sort results in - # descending order based on the `name` value using `orderBy="name desc"`. - # Currently, only ordering by `name` is supported. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::VmwareEngine::V1::PrivateCloud>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::VmwareEngine::V1::PrivateCloud>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/vmware_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VmwareEngine::V1::ListPrivateCloudsRequest.new - # - # # Call the list_private_clouds method. - # result = client.list_private_clouds 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::VmwareEngine::V1::PrivateCloud. - # p item - # end - # - def list_private_clouds request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::ListPrivateCloudsRequest - - # Converts hash 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_private_clouds.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::VmwareEngine::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_private_clouds.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_private_clouds.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vmware_engine_stub.list_private_clouds request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @vmware_engine_stub, :list_private_clouds, "private_clouds", 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 - - ## - # Retrieves a `PrivateCloud` resource by its resource name. - # - # @overload get_private_cloud(request, options = nil) - # Pass arguments to `get_private_cloud` via a request object, either of type - # {::Google::Cloud::VmwareEngine::V1::GetPrivateCloudRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VmwareEngine::V1::GetPrivateCloudRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_private_cloud(name: nil) - # Pass arguments to `get_private_cloud` via keyword arguments. Note that at - # least one keyword argument is 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 private cloud to retrieve. - # Resource names are schemeless URIs that follow the conventions in - # https://cloud.google.com/apis/design/resource_names. - # For example: - # `projects/my-project/locations/us-central1-a/privateClouds/my-cloud` - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::VmwareEngine::V1::PrivateCloud] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::VmwareEngine::V1::PrivateCloud] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/vmware_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VmwareEngine::V1::GetPrivateCloudRequest.new - # - # # Call the get_private_cloud method. - # result = client.get_private_cloud request - # - # # The returned object is of type Google::Cloud::VmwareEngine::V1::PrivateCloud. - # p result - # - def get_private_cloud request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::GetPrivateCloudRequest - - # Converts hash 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_private_cloud.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::VmwareEngine::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_private_cloud.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_private_cloud.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vmware_engine_stub.get_private_cloud 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 `PrivateCloud` resource in a given project and location. - # Private clouds of type `STANDARD` and - # `TIME_LIMITED` are zonal resources, `STRETCHED` private clouds are - # regional. - # Creating a private cloud also creates a [management - # cluster](https://cloud.google.com/vmware-engine/docs/concepts-vmware-components) - # for that private cloud. - # - # @overload create_private_cloud(request, options = nil) - # Pass arguments to `create_private_cloud` via a request object, either of type - # {::Google::Cloud::VmwareEngine::V1::CreatePrivateCloudRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VmwareEngine::V1::CreatePrivateCloudRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_private_cloud(parent: nil, private_cloud_id: nil, private_cloud: nil, request_id: nil, validate_only: nil) - # Pass arguments to `create_private_cloud` via keyword arguments. Note that at - # least one keyword argument is 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 to create the new - # private cloud in. Resource names are schemeless URIs that follow the - # conventions in https://cloud.google.com/apis/design/resource_names. - # For example: - # `projects/my-project/locations/us-central1-a` - # @param private_cloud_id [::String] - # Required. The user-provided identifier of the private cloud to be created. - # This identifier must be unique among each `PrivateCloud` within the parent - # and becomes the final token in the name URI. - # The identifier must meet the following requirements: - # - # * Only contains 1-63 alphanumeric characters and hyphens - # * Begins with an alphabetical character - # * Ends with a non-hyphen character - # * Not formatted as a UUID - # * Complies with [RFC 1034](https://datatracker.ietf.org/doc/html/rfc1034) - # (section 3.5) - # @param private_cloud [::Google::Cloud::VmwareEngine::V1::PrivateCloud, ::Hash] - # Required. The initial description of the new private cloud. - # @param request_id [::String] - # Optional. The request ID must be a valid UUID with the exception that zero - # UUID is not supported (00000000-0000-0000-0000-000000000000). - # @param validate_only [::Boolean] - # Optional. True if you want the request to be validated and not executed; - # false otherwise. - # @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/vmware_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VmwareEngine::V1::CreatePrivateCloudRequest.new - # - # # Call the create_private_cloud method. - # result = client.create_private_cloud 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_private_cloud request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::CreatePrivateCloudRequest - - # Converts hash 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_private_cloud.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::VmwareEngine::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_private_cloud.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_private_cloud.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vmware_engine_stub.create_private_cloud 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 - - ## - # Modifies a `PrivateCloud` resource. Only the following fields can be - # updated: `description`. - # Only fields specified in `updateMask` are applied. - # - # During operation processing, the resource is temporarily in the `ACTIVE` - # state before the operation fully completes. For that period of time, you - # can't update the resource. Use the operation status to determine when the - # processing fully completes. - # - # @overload update_private_cloud(request, options = nil) - # Pass arguments to `update_private_cloud` via a request object, either of type - # {::Google::Cloud::VmwareEngine::V1::UpdatePrivateCloudRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VmwareEngine::V1::UpdatePrivateCloudRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_private_cloud(private_cloud: nil, update_mask: nil, request_id: nil) - # Pass arguments to `update_private_cloud` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param private_cloud [::Google::Cloud::VmwareEngine::V1::PrivateCloud, ::Hash] - # Required. Private cloud description. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Required. Field mask is used to specify the fields to be overwritten in the - # `PrivateCloud` resource by the update. The fields specified in `updateMask` - # are relative to the resource, not the full request. A field will be - # overwritten if it is in the mask. If the user does not provide a mask then - # all fields will be overwritten. - # @param request_id [::String] - # Optional. The request ID must be a valid UUID with the exception that zero - # UUID is not supported (00000000-0000-0000-0000-000000000000). - # @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/vmware_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VmwareEngine::V1::UpdatePrivateCloudRequest.new - # - # # Call the update_private_cloud method. - # result = client.update_private_cloud 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 update_private_cloud request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::UpdatePrivateCloudRequest - - # Converts hash 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_private_cloud.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::VmwareEngine::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_private_cloud.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_private_cloud.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vmware_engine_stub.update_private_cloud 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 - - ## - # Schedules a `PrivateCloud` resource for deletion. - # - # A `PrivateCloud` resource scheduled for deletion has `PrivateCloud.state` - # set to `DELETED` and `expireTime` set to the time when deletion is final - # and can no longer be reversed. The delete operation is marked as done - # as soon as the `PrivateCloud` is successfully scheduled for deletion - # (this also applies when `delayHours` is set to zero), and the operation is - # not kept in pending state until `PrivateCloud` is purged. - # `PrivateCloud` can be restored using `UndeletePrivateCloud` method before - # the `expireTime` elapses. When `expireTime` is reached, deletion is final - # and all private cloud resources are irreversibly removed and billing stops. - # During the final removal process, `PrivateCloud.state` is set to `PURGING`. - # `PrivateCloud` can be polled using standard `GET` method for the whole - # period of deletion and purging. It will not be returned only - # when it is completely purged. - # - # @overload delete_private_cloud(request, options = nil) - # Pass arguments to `delete_private_cloud` via a request object, either of type - # {::Google::Cloud::VmwareEngine::V1::DeletePrivateCloudRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VmwareEngine::V1::DeletePrivateCloudRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_private_cloud(name: nil, request_id: nil, force: nil, delay_hours: nil) - # Pass arguments to `delete_private_cloud` via keyword arguments. Note that at - # least one keyword argument is 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 private cloud to delete. - # Resource names are schemeless URIs that follow the conventions in - # https://cloud.google.com/apis/design/resource_names. - # For example: - # `projects/my-project/locations/us-central1-a/privateClouds/my-cloud` - # @param request_id [::String] - # Optional. The request ID must be a valid UUID with the exception that zero - # UUID is not supported (00000000-0000-0000-0000-000000000000). - # @param force [::Boolean] - # Optional. If set to true, cascade delete is enabled and all children of - # this private cloud resource are also deleted. When this flag is set to - # false, the private cloud will not be deleted if there are any children - # other than the management cluster. The management cluster is always - # deleted. - # @param delay_hours [::Integer] - # Optional. Time delay of the deletion specified in hours. The default value - # is `3`. Specifying a non-zero value for this field changes the value of - # `PrivateCloud.state` to `DELETED` and sets `expire_time` to the planned - # deletion time. Deletion can be cancelled before `expire_time` elapses using - # {::Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client#undelete_private_cloud VmwareEngine.UndeletePrivateCloud}. - # Specifying a value of `0` for this field instead begins the deletion - # process and ceases billing immediately. During the final deletion process, - # the value of `PrivateCloud.state` becomes `PURGING`. - # @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/vmware_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VmwareEngine::V1::DeletePrivateCloudRequest.new - # - # # Call the delete_private_cloud method. - # result = client.delete_private_cloud 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_private_cloud request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::DeletePrivateCloudRequest - - # Converts hash 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_private_cloud.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::VmwareEngine::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_private_cloud.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_private_cloud.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vmware_engine_stub.delete_private_cloud 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 - - ## - # Restores a private cloud that was previously scheduled for deletion by - # `DeletePrivateCloud`. A `PrivateCloud` resource scheduled for deletion has - # `PrivateCloud.state` set to `DELETED` and `PrivateCloud.expireTime` set to - # the time when deletion can no longer be reversed. - # - # @overload undelete_private_cloud(request, options = nil) - # Pass arguments to `undelete_private_cloud` via a request object, either of type - # {::Google::Cloud::VmwareEngine::V1::UndeletePrivateCloudRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VmwareEngine::V1::UndeletePrivateCloudRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload undelete_private_cloud(name: nil, request_id: nil) - # Pass arguments to `undelete_private_cloud` via keyword arguments. Note that at - # least one keyword argument is 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 private cloud scheduled for deletion. - # Resource names are schemeless URIs that follow the conventions in - # https://cloud.google.com/apis/design/resource_names. - # For example: - # `projects/my-project/locations/us-central1-a/privateClouds/my-cloud` - # @param request_id [::String] - # Optional. The request ID must be a valid UUID with the exception that zero - # UUID is not supported (00000000-0000-0000-0000-000000000000). - # @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/vmware_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VmwareEngine::V1::UndeletePrivateCloudRequest.new - # - # # Call the undelete_private_cloud method. - # result = client.undelete_private_cloud 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 undelete_private_cloud request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::UndeletePrivateCloudRequest - - # Converts hash 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.undelete_private_cloud.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::VmwareEngine::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.undelete_private_cloud.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.undelete_private_cloud.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vmware_engine_stub.undelete_private_cloud 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 - - ## - # Lists `Cluster` resources in a given private cloud. - # - # @overload list_clusters(request, options = nil) - # Pass arguments to `list_clusters` via a request object, either of type - # {::Google::Cloud::VmwareEngine::V1::ListClustersRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VmwareEngine::V1::ListClustersRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_clusters(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) - # Pass arguments to `list_clusters` via keyword arguments. Note that at - # least one keyword argument is 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 private cloud to query for clusters. - # Resource names are schemeless URIs that follow the conventions in - # https://cloud.google.com/apis/design/resource_names. - # For example: - # `projects/my-project/locations/us-central1-a/privateClouds/my-cloud` - # @param page_size [::Integer] - # The maximum number of clusters to return in one page. - # The service may return fewer than this value. - # The maximum value is coerced to 1000. - # The default value of this field is 500. - # @param page_token [::String] - # A page token, received from a previous `ListClusters` call. - # Provide this to retrieve the subsequent page. - # - # When paginating, all other parameters provided to `ListClusters` - # must match the call that provided the page token. - # @param filter [::String] - # To filter on multiple expressions, provide each separate expression within - # parentheses. For example: - # ``` - # (name = "example-cluster") - # (nodeCount = "3") - # ``` - # - # By default, each expression is an `AND` expression. However, you can - # include `AND` and `OR` expressions explicitly. For example: - # ``` - # (name = "example-cluster-1") AND - # (createTime > "2021-04-12T08:15:10.40Z") OR - # (name = "example-cluster-2") - # ``` - # @param order_by [::String] - # Sorts list results by a certain order. By default, returned results are - # ordered by `name` in ascending order. You can also sort results in - # descending order based on the `name` value using `orderBy="name desc"`. - # Currently, only ordering by `name` is supported. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::VmwareEngine::V1::Cluster>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::VmwareEngine::V1::Cluster>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/vmware_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VmwareEngine::V1::ListClustersRequest.new - # - # # Call the list_clusters method. - # result = client.list_clusters 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::VmwareEngine::V1::Cluster. - # p item - # end - # - def list_clusters request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::ListClustersRequest - - # Converts hash 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_clusters.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::VmwareEngine::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_clusters.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_clusters.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vmware_engine_stub.list_clusters request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @vmware_engine_stub, :list_clusters, "clusters", 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 - - ## - # Retrieves a `Cluster` resource by its resource name. - # - # @overload get_cluster(request, options = nil) - # Pass arguments to `get_cluster` via a request object, either of type - # {::Google::Cloud::VmwareEngine::V1::GetClusterRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VmwareEngine::V1::GetClusterRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_cluster(name: nil) - # Pass arguments to `get_cluster` via keyword arguments. Note that at - # least one keyword argument is 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 cluster resource name to retrieve. - # Resource names are schemeless URIs that follow the conventions in - # https://cloud.google.com/apis/design/resource_names. - # For example: - # `projects/my-project/locations/us-central1-a/privateClouds/my-cloud/clusters/my-cluster` - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::VmwareEngine::V1::Cluster] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::VmwareEngine::V1::Cluster] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/vmware_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VmwareEngine::V1::GetClusterRequest.new - # - # # Call the get_cluster method. - # result = client.get_cluster request - # - # # The returned object is of type Google::Cloud::VmwareEngine::V1::Cluster. - # p result - # - def get_cluster request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::GetClusterRequest - - # Converts hash 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_cluster.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::VmwareEngine::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_cluster.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_cluster.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vmware_engine_stub.get_cluster 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 cluster in a given private cloud. - # Creating a new cluster provides additional nodes for - # use in the parent private cloud and requires sufficient [node - # quota](https://cloud.google.com/vmware-engine/quotas). - # - # @overload create_cluster(request, options = nil) - # Pass arguments to `create_cluster` via a request object, either of type - # {::Google::Cloud::VmwareEngine::V1::CreateClusterRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VmwareEngine::V1::CreateClusterRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_cluster(parent: nil, cluster_id: nil, cluster: nil, request_id: nil, validate_only: nil) - # Pass arguments to `create_cluster` via keyword arguments. Note that at - # least one keyword argument is 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 private cloud to create a new cluster - # in. Resource names are schemeless URIs that follow the conventions in - # https://cloud.google.com/apis/design/resource_names. - # For example: - # `projects/my-project/locations/us-central1-a/privateClouds/my-cloud` - # @param cluster_id [::String] - # Required. The user-provided identifier of the new `Cluster`. - # This identifier must be unique among clusters within the parent and becomes - # the final token in the name URI. - # The identifier must meet the following requirements: - # - # * Only contains 1-63 alphanumeric characters and hyphens - # * Begins with an alphabetical character - # * Ends with a non-hyphen character - # * Not formatted as a UUID - # * Complies with [RFC 1034](https://datatracker.ietf.org/doc/html/rfc1034) - # (section 3.5) - # @param cluster [::Google::Cloud::VmwareEngine::V1::Cluster, ::Hash] - # Required. The initial description of the new cluster. - # @param request_id [::String] - # Optional. The request ID must be a valid UUID with the exception that zero - # UUID is not supported (00000000-0000-0000-0000-000000000000). - # @param validate_only [::Boolean] - # Optional. True if you want the request to be validated and not executed; - # false otherwise. - # @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/vmware_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VmwareEngine::V1::CreateClusterRequest.new - # - # # Call the create_cluster method. - # result = client.create_cluster 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_cluster request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::CreateClusterRequest - - # Converts hash 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_cluster.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::VmwareEngine::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_cluster.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_cluster.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vmware_engine_stub.create_cluster 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 - - ## - # Modifies a `Cluster` resource. Only fields specified in `updateMask` are - # applied. - # - # During operation processing, the resource is temporarily in the `ACTIVE` - # state before the operation fully completes. For that period of time, you - # can't update the resource. Use the operation status to determine when the - # processing fully completes. - # - # @overload update_cluster(request, options = nil) - # Pass arguments to `update_cluster` via a request object, either of type - # {::Google::Cloud::VmwareEngine::V1::UpdateClusterRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VmwareEngine::V1::UpdateClusterRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_cluster(update_mask: nil, cluster: nil, request_id: nil, validate_only: nil) - # Pass arguments to `update_cluster` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Required. Field mask is used to specify the fields to be overwritten in the - # `Cluster` resource by the update. The fields specified in the `updateMask` - # are relative to the resource, not the full request. A field will be - # overwritten if it is in the mask. If the user does not provide a mask then - # all fields will be overwritten. - # @param cluster [::Google::Cloud::VmwareEngine::V1::Cluster, ::Hash] - # Required. The description of the cluster. - # @param request_id [::String] - # Optional. The request ID must be a valid UUID with the exception that - # zero UUID is not supported (00000000-0000-0000-0000-000000000000). - # @param validate_only [::Boolean] - # Optional. True if you want the request to be validated and not executed; - # false otherwise. - # @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/vmware_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VmwareEngine::V1::UpdateClusterRequest.new - # - # # Call the update_cluster method. - # result = client.update_cluster 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 update_cluster request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::UpdateClusterRequest - - # Converts hash 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_cluster.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::VmwareEngine::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_cluster.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_cluster.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vmware_engine_stub.update_cluster 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 `Cluster` resource. To avoid unintended data loss, migrate or - # gracefully shut down any workloads running on the cluster before deletion. - # You cannot delete the management cluster of a private cloud using this - # method. - # - # @overload delete_cluster(request, options = nil) - # Pass arguments to `delete_cluster` via a request object, either of type - # {::Google::Cloud::VmwareEngine::V1::DeleteClusterRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VmwareEngine::V1::DeleteClusterRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_cluster(name: nil, request_id: nil) - # Pass arguments to `delete_cluster` via keyword arguments. Note that at - # least one keyword argument is 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 cluster to delete. - # Resource names are schemeless URIs that follow the conventions in - # https://cloud.google.com/apis/design/resource_names. - # For example: - # `projects/my-project/locations/us-central1-a/privateClouds/my-cloud/clusters/my-cluster` - # @param request_id [::String] - # Optional. The request ID must be a valid UUID with the exception that zero - # UUID is not supported (00000000-0000-0000-0000-000000000000). - # @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/vmware_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VmwareEngine::V1::DeleteClusterRequest.new - # - # # Call the delete_cluster method. - # result = client.delete_cluster 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_cluster request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::DeleteClusterRequest - - # Converts hash 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_cluster.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::VmwareEngine::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_cluster.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_cluster.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vmware_engine_stub.delete_cluster 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 - - ## - # Lists nodes in a given cluster. - # - # @overload list_nodes(request, options = nil) - # Pass arguments to `list_nodes` via a request object, either of type - # {::Google::Cloud::VmwareEngine::V1::ListNodesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VmwareEngine::V1::ListNodesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_nodes(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_nodes` via keyword arguments. Note that at - # least one keyword argument is 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 cluster to be queried for nodes. - # Resource names are schemeless URIs that follow the conventions in - # https://cloud.google.com/apis/design/resource_names. - # For example: - # `projects/my-project/locations/us-central1-a/privateClouds/my-cloud/clusters/my-cluster` - # @param page_size [::Integer] - # The maximum number of nodes to return in one page. - # The service may return fewer than this value. - # The maximum value is coerced to 1000. - # The default value of this field is 500. - # @param page_token [::String] - # A page token, received from a previous `ListNodes` call. - # Provide this to retrieve the subsequent page. - # - # When paginating, all other parameters provided to - # `ListNodes` must match the call that provided the page - # token. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::VmwareEngine::V1::Node>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::VmwareEngine::V1::Node>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/vmware_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VmwareEngine::V1::ListNodesRequest.new - # - # # Call the list_nodes method. - # result = client.list_nodes 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::VmwareEngine::V1::Node. - # p item - # end - # - def list_nodes request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::ListNodesRequest - - # Converts hash 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_nodes.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::VmwareEngine::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_nodes.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_nodes.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vmware_engine_stub.list_nodes request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @vmware_engine_stub, :list_nodes, "nodes", 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 details of a single node. - # - # @overload get_node(request, options = nil) - # Pass arguments to `get_node` via a request object, either of type - # {::Google::Cloud::VmwareEngine::V1::GetNodeRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VmwareEngine::V1::GetNodeRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_node(name: nil) - # Pass arguments to `get_node` via keyword arguments. Note that at - # least one keyword argument is 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 node to retrieve. - # For example: - # `projects/{project}/locations/{location}/privateClouds/{private_cloud}/clusters/{cluster}/nodes/{node}` - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::VmwareEngine::V1::Node] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::VmwareEngine::V1::Node] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/vmware_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VmwareEngine::V1::GetNodeRequest.new - # - # # Call the get_node method. - # result = client.get_node request - # - # # The returned object is of type Google::Cloud::VmwareEngine::V1::Node. - # p result - # - def get_node request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::GetNodeRequest - - # Converts hash 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_node.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::VmwareEngine::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_node.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_node.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vmware_engine_stub.get_node 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 external IP addresses assigned to VMware workload VMs in a given - # private cloud. - # - # @overload list_external_addresses(request, options = nil) - # Pass arguments to `list_external_addresses` via a request object, either of type - # {::Google::Cloud::VmwareEngine::V1::ListExternalAddressesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VmwareEngine::V1::ListExternalAddressesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_external_addresses(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) - # Pass arguments to `list_external_addresses` via keyword arguments. Note that at - # least one keyword argument is 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 private cloud to be queried for - # external IP addresses. - # Resource names are schemeless URIs that follow the conventions in - # https://cloud.google.com/apis/design/resource_names. - # For example: - # `projects/my-project/locations/us-central1-a/privateClouds/my-cloud` - # @param page_size [::Integer] - # The maximum number of external IP addresses to return in one page. - # The service may return fewer than this value. - # The maximum value is coerced to 1000. - # The default value of this field is 500. - # @param page_token [::String] - # A page token, received from a previous `ListExternalAddresses` call. - # Provide this to retrieve the subsequent page. - # - # When paginating, all other parameters provided to - # `ListExternalAddresses` must match the call that provided the page token. - # @param filter [::String] - # A filter expression that matches resources returned in the response. - # The expression must specify the field name, a comparison - # operator, and the value that you want to use for filtering. The value - # must be a string, a number, or a boolean. The comparison operator - # must be `=`, `!=`, `>`, or `<`. - # - # For example, if you are filtering a list of IP addresses, you can - # exclude the ones named `example-ip` by specifying - # `name != "example-ip"`. - # - # To filter on multiple expressions, provide each separate expression within - # parentheses. For example: - # ``` - # (name = "example-ip") - # (createTime > "2021-04-12T08:15:10.40Z") - # ``` - # - # By default, each expression is an `AND` expression. However, you - # can include `AND` and `OR` expressions explicitly. - # For example: - # ``` - # (name = "example-ip-1") AND - # (createTime > "2021-04-12T08:15:10.40Z") OR - # (name = "example-ip-2") - # ``` - # @param order_by [::String] - # Sorts list results by a certain order. By default, returned results - # are ordered by `name` in ascending order. - # You can also sort results in descending order based on the `name` value - # using `orderBy="name desc"`. - # Currently, only ordering by `name` is supported. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::VmwareEngine::V1::ExternalAddress>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::VmwareEngine::V1::ExternalAddress>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/vmware_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VmwareEngine::V1::ListExternalAddressesRequest.new - # - # # Call the list_external_addresses method. - # result = client.list_external_addresses 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::VmwareEngine::V1::ExternalAddress. - # p item - # end - # - def list_external_addresses request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::ListExternalAddressesRequest - - # Converts hash 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_external_addresses.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::VmwareEngine::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_external_addresses.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_external_addresses.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vmware_engine_stub.list_external_addresses request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @vmware_engine_stub, :list_external_addresses, "external_addresses", 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 external IP addresses assigned to VMware workload VMs within the - # scope of the given network policy. - # - # @overload fetch_network_policy_external_addresses(request, options = nil) - # Pass arguments to `fetch_network_policy_external_addresses` via a request object, either of type - # {::Google::Cloud::VmwareEngine::V1::FetchNetworkPolicyExternalAddressesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VmwareEngine::V1::FetchNetworkPolicyExternalAddressesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload fetch_network_policy_external_addresses(network_policy: nil, page_size: nil, page_token: nil) - # Pass arguments to `fetch_network_policy_external_addresses` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param network_policy [::String] - # Required. The resource name of the network policy to query for assigned - # external IP addresses. Resource names are schemeless URIs that follow the - # conventions in https://cloud.google.com/apis/design/resource_names. For - # example: - # `projects/my-project/locations/us-central1/networkPolicies/my-policy` - # @param page_size [::Integer] - # The maximum number of external IP addresses to return in one page. - # The service may return fewer than this value. - # The maximum value is coerced to 1000. - # The default value of this field is 500. - # @param page_token [::String] - # A page token, received from a previous - # `FetchNetworkPolicyExternalAddresses` call. Provide this to retrieve the - # subsequent page. - # - # When paginating, all parameters provided to - # `FetchNetworkPolicyExternalAddresses`, except for `page_size` and - # `page_token`, must match the call that provided the page token. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::VmwareEngine::V1::ExternalAddress>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::VmwareEngine::V1::ExternalAddress>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/vmware_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VmwareEngine::V1::FetchNetworkPolicyExternalAddressesRequest.new - # - # # Call the fetch_network_policy_external_addresses method. - # result = client.fetch_network_policy_external_addresses 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::VmwareEngine::V1::ExternalAddress. - # p item - # end - # - def fetch_network_policy_external_addresses request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::FetchNetworkPolicyExternalAddressesRequest - - # Converts hash 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.fetch_network_policy_external_addresses.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::VmwareEngine::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.fetch_network_policy_external_addresses.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.fetch_network_policy_external_addresses.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vmware_engine_stub.fetch_network_policy_external_addresses request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @vmware_engine_stub, :fetch_network_policy_external_addresses, "external_addresses", 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 details of a single external IP address. - # - # @overload get_external_address(request, options = nil) - # Pass arguments to `get_external_address` via a request object, either of type - # {::Google::Cloud::VmwareEngine::V1::GetExternalAddressRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VmwareEngine::V1::GetExternalAddressRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_external_address(name: nil) - # Pass arguments to `get_external_address` via keyword arguments. Note that at - # least one keyword argument is 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 external IP address to retrieve. - # Resource names are schemeless URIs that follow the conventions in - # https://cloud.google.com/apis/design/resource_names. - # For example: - # `projects/my-project/locations/us-central1-a/privateClouds/my-cloud/externalAddresses/my-ip` - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::VmwareEngine::V1::ExternalAddress] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::VmwareEngine::V1::ExternalAddress] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/vmware_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VmwareEngine::V1::GetExternalAddressRequest.new - # - # # Call the get_external_address method. - # result = client.get_external_address request - # - # # The returned object is of type Google::Cloud::VmwareEngine::V1::ExternalAddress. - # p result - # - def get_external_address request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::GetExternalAddressRequest - - # Converts hash 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_external_address.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::VmwareEngine::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_external_address.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_external_address.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vmware_engine_stub.get_external_address 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 `ExternalAddress` resource in a given private cloud. The - # network policy that corresponds to the private cloud must have the external - # IP address network service enabled (`NetworkPolicy.external_ip`). - # - # @overload create_external_address(request, options = nil) - # Pass arguments to `create_external_address` via a request object, either of type - # {::Google::Cloud::VmwareEngine::V1::CreateExternalAddressRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VmwareEngine::V1::CreateExternalAddressRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_external_address(parent: nil, external_address: nil, external_address_id: nil, request_id: nil) - # Pass arguments to `create_external_address` via keyword arguments. Note that at - # least one keyword argument is 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 private cloud - # to create a new external IP address in. - # Resource names are schemeless URIs that follow the conventions in - # https://cloud.google.com/apis/design/resource_names. - # For example: - # `projects/my-project/locations/us-central1-a/privateClouds/my-cloud` - # @param external_address [::Google::Cloud::VmwareEngine::V1::ExternalAddress, ::Hash] - # Required. The initial description of a new external IP address. - # @param external_address_id [::String] - # Required. The user-provided identifier of the `ExternalAddress` to be - # created. This identifier must be unique among `ExternalAddress` resources - # within the parent and becomes the final token in the name URI. The - # identifier must meet the following requirements: - # - # * Only contains 1-63 alphanumeric characters and hyphens - # * Begins with an alphabetical character - # * Ends with a non-hyphen character - # * Not formatted as a UUID - # * Complies with [RFC 1034](https://datatracker.ietf.org/doc/html/rfc1034) - # (section 3.5) - # @param request_id [::String] - # Optional. A request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server guarantees that a - # request doesn't result in creation of duplicate commitments for at least 60 - # minutes. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request ID, - # the server can check if the original operation with the same request ID was - # received, and if so, will ignore the second request. This prevents clients - # from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @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/vmware_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VmwareEngine::V1::CreateExternalAddressRequest.new - # - # # Call the create_external_address method. - # result = client.create_external_address 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_external_address request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::CreateExternalAddressRequest - - # Converts hash 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_external_address.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::VmwareEngine::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_external_address.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_external_address.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vmware_engine_stub.create_external_address 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 - - ## - # Updates the parameters of a single external IP address. - # Only fields specified in `update_mask` are applied. - # - # During operation processing, the resource is temporarily in the `ACTIVE` - # state before the operation fully completes. For that period of time, you - # can't update the resource. Use the operation status to determine when the - # processing fully completes. - # - # @overload update_external_address(request, options = nil) - # Pass arguments to `update_external_address` via a request object, either of type - # {::Google::Cloud::VmwareEngine::V1::UpdateExternalAddressRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VmwareEngine::V1::UpdateExternalAddressRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_external_address(update_mask: nil, external_address: nil, request_id: nil) - # Pass arguments to `update_external_address` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Required. Field mask is used to specify the fields to be overwritten in the - # `ExternalAddress` resource by the update. - # The fields specified in the `update_mask` are relative to the resource, not - # the full request. A field will be overwritten if it is in the mask. If the - # user does not provide a mask then all fields will be overwritten. - # @param external_address [::Google::Cloud::VmwareEngine::V1::ExternalAddress, ::Hash] - # Required. External IP address description. - # @param request_id [::String] - # Optional. A request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server guarantees that a - # request doesn't result in creation of duplicate commitments for at least 60 - # minutes. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request ID, - # the server can check if the original operation with the same request ID was - # received, and if so, will ignore the second request. This prevents clients - # from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @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/vmware_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VmwareEngine::V1::UpdateExternalAddressRequest.new - # - # # Call the update_external_address method. - # result = client.update_external_address 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 update_external_address request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::UpdateExternalAddressRequest - - # Converts hash 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_external_address.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::VmwareEngine::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_external_address.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_external_address.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vmware_engine_stub.update_external_address 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 single external IP address. When you delete an external IP - # address, connectivity between the external IP address and the corresponding - # internal IP address is lost. - # - # @overload delete_external_address(request, options = nil) - # Pass arguments to `delete_external_address` via a request object, either of type - # {::Google::Cloud::VmwareEngine::V1::DeleteExternalAddressRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VmwareEngine::V1::DeleteExternalAddressRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_external_address(name: nil, request_id: nil) - # Pass arguments to `delete_external_address` via keyword arguments. Note that at - # least one keyword argument is 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 external IP address to delete. - # Resource names are schemeless URIs that follow the conventions in - # https://cloud.google.com/apis/design/resource_names. - # For example: - # `projects/my-project/locations/us-central1-a/privateClouds/my-cloud/externalAddresses/my-ip` - # @param request_id [::String] - # Optional. A request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server guarantees that a - # request doesn't result in creation of duplicate commitments for at least 60 - # minutes. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request - # ID, the server can check if the original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @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/vmware_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VmwareEngine::V1::DeleteExternalAddressRequest.new - # - # # Call the delete_external_address method. - # result = client.delete_external_address 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_external_address request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::DeleteExternalAddressRequest - - # Converts hash 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_external_address.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::VmwareEngine::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_external_address.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_external_address.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vmware_engine_stub.delete_external_address 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 - - ## - # Lists subnets in a given private cloud. - # - # @overload list_subnets(request, options = nil) - # Pass arguments to `list_subnets` via a request object, either of type - # {::Google::Cloud::VmwareEngine::V1::ListSubnetsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VmwareEngine::V1::ListSubnetsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_subnets(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_subnets` via keyword arguments. Note that at - # least one keyword argument is 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 private cloud to be queried for - # subnets. - # Resource names are schemeless URIs that follow the conventions in - # https://cloud.google.com/apis/design/resource_names. - # For example: - # `projects/my-project/locations/us-central1-a/privateClouds/my-cloud` - # @param page_size [::Integer] - # The maximum number of subnets to return in one page. - # The service may return fewer than this value. - # The maximum value is coerced to 1000. - # The default value of this field is 500. - # @param page_token [::String] - # A page token, received from a previous `ListSubnetsRequest` call. - # Provide this to retrieve the subsequent page. - # - # When paginating, all other parameters provided to - # `ListSubnetsRequest` must match the call that provided the page token. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::VmwareEngine::V1::Subnet>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::VmwareEngine::V1::Subnet>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/vmware_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VmwareEngine::V1::ListSubnetsRequest.new - # - # # Call the list_subnets method. - # result = client.list_subnets 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::VmwareEngine::V1::Subnet. - # p item - # end - # - def list_subnets request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::ListSubnetsRequest - - # Converts hash 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_subnets.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::VmwareEngine::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_subnets.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_subnets.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vmware_engine_stub.list_subnets request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @vmware_engine_stub, :list_subnets, "subnets", 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 details of a single subnet. - # - # @overload get_subnet(request, options = nil) - # Pass arguments to `get_subnet` via a request object, either of type - # {::Google::Cloud::VmwareEngine::V1::GetSubnetRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VmwareEngine::V1::GetSubnetRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_subnet(name: nil) - # Pass arguments to `get_subnet` via keyword arguments. Note that at - # least one keyword argument is 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 subnet to retrieve. - # Resource names are schemeless URIs that follow the conventions in - # https://cloud.google.com/apis/design/resource_names. - # For example: - # `projects/my-project/locations/us-central1-a/privateClouds/my-cloud/subnets/my-subnet` - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::VmwareEngine::V1::Subnet] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::VmwareEngine::V1::Subnet] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/vmware_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VmwareEngine::V1::GetSubnetRequest.new - # - # # Call the get_subnet method. - # result = client.get_subnet request - # - # # The returned object is of type Google::Cloud::VmwareEngine::V1::Subnet. - # p result - # - def get_subnet request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::GetSubnetRequest - - # Converts hash 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_subnet.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::VmwareEngine::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_subnet.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_subnet.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vmware_engine_stub.get_subnet 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 parameters of a single subnet. Only fields specified in - # `update_mask` are applied. - # - # *Note*: This API is synchronous and always returns a successful - # `google.longrunning.Operation` (LRO). The returned LRO will only have - # `done` and `response` fields. - # - # @overload update_subnet(request, options = nil) - # Pass arguments to `update_subnet` via a request object, either of type - # {::Google::Cloud::VmwareEngine::V1::UpdateSubnetRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VmwareEngine::V1::UpdateSubnetRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_subnet(update_mask: nil, subnet: nil) - # Pass arguments to `update_subnet` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Required. Field mask is used to specify the fields to be overwritten in the - # `Subnet` resource by the update. - # The fields specified in the `update_mask` are relative to the resource, not - # the full request. A field will be overwritten if it is in the mask. If the - # user does not provide a mask then all fields will be overwritten. - # @param subnet [::Google::Cloud::VmwareEngine::V1::Subnet, ::Hash] - # Required. Subnet description. - # @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/vmware_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VmwareEngine::V1::UpdateSubnetRequest.new - # - # # Call the update_subnet method. - # result = client.update_subnet 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 update_subnet request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::UpdateSubnetRequest - - # Converts hash 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_subnet.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::VmwareEngine::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_subnet.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_subnet.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vmware_engine_stub.update_subnet 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 - - ## - # Lists `ExternalAccessRule` resources in the specified network policy. - # - # @overload list_external_access_rules(request, options = nil) - # Pass arguments to `list_external_access_rules` via a request object, either of type - # {::Google::Cloud::VmwareEngine::V1::ListExternalAccessRulesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VmwareEngine::V1::ListExternalAccessRulesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_external_access_rules(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) - # Pass arguments to `list_external_access_rules` via keyword arguments. Note that at - # least one keyword argument is 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 network policy to query for external - # access firewall rules. Resource names are schemeless URIs that follow the - # conventions in https://cloud.google.com/apis/design/resource_names. For - # example: - # `projects/my-project/locations/us-central1/networkPolicies/my-policy` - # @param page_size [::Integer] - # The maximum number of external access rules to return in one page. - # The service may return fewer than this value. - # The maximum value is coerced to 1000. - # The default value of this field is 500. - # @param page_token [::String] - # A page token, received from a previous `ListExternalAccessRulesRequest` - # call. Provide this to retrieve the subsequent page. - # - # When paginating, all other parameters provided to - # `ListExternalAccessRulesRequest` must match the call that provided the page - # token. - # @param filter [::String] - # A filter expression that matches resources returned in the response. - # The expression must specify the field name, a comparison - # operator, and the value that you want to use for filtering. The value - # must be a string, a number, or a boolean. The comparison operator - # must be `=`, `!=`, `>`, or `<`. - # - # For example, if you are filtering a list of external access rules, you can - # exclude the ones named `example-rule` by specifying - # `name != "example-rule"`. - # - # To filter on multiple expressions, provide each separate expression within - # parentheses. For example: - # ``` - # (name = "example-rule") - # (createTime > "2021-04-12T08:15:10.40Z") - # ``` - # - # By default, each expression is an `AND` expression. However, you - # can include `AND` and `OR` expressions explicitly. - # For example: - # ``` - # (name = "example-rule-1") AND - # (createTime > "2021-04-12T08:15:10.40Z") OR - # (name = "example-rule-2") - # ``` - # @param order_by [::String] - # Sorts list results by a certain order. By default, returned results - # are ordered by `name` in ascending order. - # You can also sort results in descending order based on the `name` value - # using `orderBy="name desc"`. - # Currently, only ordering by `name` is supported. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::VmwareEngine::V1::ExternalAccessRule>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::VmwareEngine::V1::ExternalAccessRule>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/vmware_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VmwareEngine::V1::ListExternalAccessRulesRequest.new - # - # # Call the list_external_access_rules method. - # result = client.list_external_access_rules 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::VmwareEngine::V1::ExternalAccessRule. - # p item - # end - # - def list_external_access_rules request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::ListExternalAccessRulesRequest - - # Converts hash 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_external_access_rules.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::VmwareEngine::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_external_access_rules.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_external_access_rules.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vmware_engine_stub.list_external_access_rules request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @vmware_engine_stub, :list_external_access_rules, "external_access_rules", 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 details of a single external access rule. - # - # @overload get_external_access_rule(request, options = nil) - # Pass arguments to `get_external_access_rule` via a request object, either of type - # {::Google::Cloud::VmwareEngine::V1::GetExternalAccessRuleRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VmwareEngine::V1::GetExternalAccessRuleRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_external_access_rule(name: nil) - # Pass arguments to `get_external_access_rule` via keyword arguments. Note that at - # least one keyword argument is 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 external access firewall rule to - # retrieve. Resource names are schemeless URIs that follow the conventions in - # https://cloud.google.com/apis/design/resource_names. - # For example: - # `projects/my-project/locations/us-central1/networkPolicies/my-policy/externalAccessRules/my-rule` - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::VmwareEngine::V1::ExternalAccessRule] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::VmwareEngine::V1::ExternalAccessRule] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/vmware_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VmwareEngine::V1::GetExternalAccessRuleRequest.new - # - # # Call the get_external_access_rule method. - # result = client.get_external_access_rule request - # - # # The returned object is of type Google::Cloud::VmwareEngine::V1::ExternalAccessRule. - # p result - # - def get_external_access_rule request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::GetExternalAccessRuleRequest - - # Converts hash 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_external_access_rule.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::VmwareEngine::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_external_access_rule.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_external_access_rule.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vmware_engine_stub.get_external_access_rule 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 external access rule in a given network policy. - # - # @overload create_external_access_rule(request, options = nil) - # Pass arguments to `create_external_access_rule` via a request object, either of type - # {::Google::Cloud::VmwareEngine::V1::CreateExternalAccessRuleRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VmwareEngine::V1::CreateExternalAccessRuleRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_external_access_rule(parent: nil, external_access_rule: nil, external_access_rule_id: nil, request_id: nil) - # Pass arguments to `create_external_access_rule` via keyword arguments. Note that at - # least one keyword argument is 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 network policy - # to create a new external access firewall rule in. - # Resource names are schemeless URIs that follow the conventions in - # https://cloud.google.com/apis/design/resource_names. - # For example: - # `projects/my-project/locations/us-central1/networkPolicies/my-policy` - # @param external_access_rule [::Google::Cloud::VmwareEngine::V1::ExternalAccessRule, ::Hash] - # Required. The initial description of a new external access rule. - # @param external_access_rule_id [::String] - # Required. The user-provided identifier of the `ExternalAccessRule` to be - # created. This identifier must be unique among `ExternalAccessRule` - # resources within the parent and becomes the final token in the name URI. - # The identifier must meet the following requirements: - # - # * Only contains 1-63 alphanumeric characters and hyphens - # * Begins with an alphabetical character - # * Ends with a non-hyphen character - # * Not formatted as a UUID - # * Complies with [RFC 1034](https://datatracker.ietf.org/doc/html/rfc1034) - # (section 3.5) - # @param request_id [::String] - # A request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server guarantees that a - # request doesn't result in creation of duplicate commitments for at least 60 - # minutes. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request ID, - # the server can check if the original operation with the same request ID was - # received, and if so, will ignore the second request. This prevents clients - # from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @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/vmware_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VmwareEngine::V1::CreateExternalAccessRuleRequest.new - # - # # Call the create_external_access_rule method. - # result = client.create_external_access_rule 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_external_access_rule request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::CreateExternalAccessRuleRequest - - # Converts hash 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_external_access_rule.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::VmwareEngine::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_external_access_rule.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_external_access_rule.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vmware_engine_stub.create_external_access_rule 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 - - ## - # Updates the parameters of a single external access rule. - # Only fields specified in `update_mask` are applied. - # - # @overload update_external_access_rule(request, options = nil) - # Pass arguments to `update_external_access_rule` via a request object, either of type - # {::Google::Cloud::VmwareEngine::V1::UpdateExternalAccessRuleRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VmwareEngine::V1::UpdateExternalAccessRuleRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_external_access_rule(update_mask: nil, external_access_rule: nil, request_id: nil) - # Pass arguments to `update_external_access_rule` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Required. Field mask is used to specify the fields to be overwritten in the - # `ExternalAccessRule` resource by the update. - # The fields specified in the `update_mask` are relative to the resource, not - # the full request. A field will be overwritten if it is in the mask. If the - # user does not provide a mask then all fields will be overwritten. - # @param external_access_rule [::Google::Cloud::VmwareEngine::V1::ExternalAccessRule, ::Hash] - # Required. Description of the external access rule. - # @param request_id [::String] - # Optional. A request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server guarantees that a - # request doesn't result in creation of duplicate commitments for at least 60 - # minutes. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request ID, - # the server can check if the original operation with the same request ID was - # received, and if so, will ignore the second request. This prevents clients - # from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @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/vmware_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VmwareEngine::V1::UpdateExternalAccessRuleRequest.new - # - # # Call the update_external_access_rule method. - # result = client.update_external_access_rule 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 update_external_access_rule request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::UpdateExternalAccessRuleRequest - - # Converts hash 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_external_access_rule.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::VmwareEngine::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_external_access_rule.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_external_access_rule.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vmware_engine_stub.update_external_access_rule 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 single external access rule. - # - # @overload delete_external_access_rule(request, options = nil) - # Pass arguments to `delete_external_access_rule` via a request object, either of type - # {::Google::Cloud::VmwareEngine::V1::DeleteExternalAccessRuleRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VmwareEngine::V1::DeleteExternalAccessRuleRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_external_access_rule(name: nil, request_id: nil) - # Pass arguments to `delete_external_access_rule` via keyword arguments. Note that at - # least one keyword argument is 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 external access firewall rule to delete. - # Resource names are schemeless URIs that follow the conventions in - # https://cloud.google.com/apis/design/resource_names. - # For example: - # `projects/my-project/locations/us-central1/networkPolicies/my-policy/externalAccessRules/my-rule` - # @param request_id [::String] - # Optional. A request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server guarantees that a - # request doesn't result in creation of duplicate commitments for at least 60 - # minutes. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request - # ID, the server can check if the original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @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/vmware_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VmwareEngine::V1::DeleteExternalAccessRuleRequest.new - # - # # Call the delete_external_access_rule method. - # result = client.delete_external_access_rule 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_external_access_rule request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::DeleteExternalAccessRuleRequest - - # Converts hash 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_external_access_rule.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::VmwareEngine::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_external_access_rule.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_external_access_rule.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vmware_engine_stub.delete_external_access_rule 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 - - ## - # Lists logging servers configured for a given private - # cloud. - # - # @overload list_logging_servers(request, options = nil) - # Pass arguments to `list_logging_servers` via a request object, either of type - # {::Google::Cloud::VmwareEngine::V1::ListLoggingServersRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VmwareEngine::V1::ListLoggingServersRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_logging_servers(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) - # Pass arguments to `list_logging_servers` via keyword arguments. Note that at - # least one keyword argument is 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 private cloud to be queried for - # logging servers. - # Resource names are schemeless URIs that follow the conventions in - # https://cloud.google.com/apis/design/resource_names. - # For example: - # `projects/my-project/locations/us-central1-a/privateClouds/my-cloud` - # @param page_size [::Integer] - # The maximum number of logging servers to return in one page. - # The service may return fewer than this value. - # The maximum value is coerced to 1000. - # The default value of this field is 500. - # @param page_token [::String] - # A page token, received from a previous `ListLoggingServersRequest` call. - # Provide this to retrieve the subsequent page. - # - # When paginating, all other parameters provided to - # `ListLoggingServersRequest` must match the call that provided the page - # token. - # @param filter [::String] - # A filter expression that matches resources returned in the response. - # The expression must specify the field name, a comparison - # operator, and the value that you want to use for filtering. The value - # must be a string, a number, or a boolean. The comparison operator - # must be `=`, `!=`, `>`, or `<`. - # - # For example, if you are filtering a list of logging servers, you can - # exclude the ones named `example-server` by specifying - # `name != "example-server"`. - # - # To filter on multiple expressions, provide each separate expression within - # parentheses. For example: - # ``` - # (name = "example-server") - # (createTime > "2021-04-12T08:15:10.40Z") - # ``` - # - # By default, each expression is an `AND` expression. However, you - # can include `AND` and `OR` expressions explicitly. - # For example: - # ``` - # (name = "example-server-1") AND - # (createTime > "2021-04-12T08:15:10.40Z") OR - # (name = "example-server-2") - # ``` - # @param order_by [::String] - # Sorts list results by a certain order. By default, returned results - # are ordered by `name` in ascending order. - # You can also sort results in descending order based on the `name` value - # using `orderBy="name desc"`. - # Currently, only ordering by `name` is supported. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::VmwareEngine::V1::LoggingServer>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::VmwareEngine::V1::LoggingServer>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/vmware_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VmwareEngine::V1::ListLoggingServersRequest.new - # - # # Call the list_logging_servers method. - # result = client.list_logging_servers 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::VmwareEngine::V1::LoggingServer. - # p item - # end - # - def list_logging_servers request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::ListLoggingServersRequest - - # Converts hash 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_logging_servers.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::VmwareEngine::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_logging_servers.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_logging_servers.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vmware_engine_stub.list_logging_servers request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @vmware_engine_stub, :list_logging_servers, "logging_servers", 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 details of a logging server. - # - # @overload get_logging_server(request, options = nil) - # Pass arguments to `get_logging_server` via a request object, either of type - # {::Google::Cloud::VmwareEngine::V1::GetLoggingServerRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VmwareEngine::V1::GetLoggingServerRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_logging_server(name: nil) - # Pass arguments to `get_logging_server` via keyword arguments. Note that at - # least one keyword argument is 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 Logging Server to retrieve. - # Resource names are schemeless URIs that follow the conventions in - # https://cloud.google.com/apis/design/resource_names. - # For example: - # `projects/my-project/locations/us-central1-a/privateClouds/my-cloud/loggingServers/my-logging-server` - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::VmwareEngine::V1::LoggingServer] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::VmwareEngine::V1::LoggingServer] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/vmware_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VmwareEngine::V1::GetLoggingServerRequest.new - # - # # Call the get_logging_server method. - # result = client.get_logging_server request - # - # # The returned object is of type Google::Cloud::VmwareEngine::V1::LoggingServer. - # p result - # - def get_logging_server request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::GetLoggingServerRequest - - # Converts hash 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_logging_server.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::VmwareEngine::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_logging_server.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_logging_server.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vmware_engine_stub.get_logging_server 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 logging server for a given private cloud. - # - # @overload create_logging_server(request, options = nil) - # Pass arguments to `create_logging_server` via a request object, either of type - # {::Google::Cloud::VmwareEngine::V1::CreateLoggingServerRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VmwareEngine::V1::CreateLoggingServerRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_logging_server(parent: nil, logging_server: nil, logging_server_id: nil, request_id: nil) - # Pass arguments to `create_logging_server` via keyword arguments. Note that at - # least one keyword argument is 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 private cloud - # to create a new Logging Server in. - # Resource names are schemeless URIs that follow the conventions in - # https://cloud.google.com/apis/design/resource_names. - # For example: - # `projects/my-project/locations/us-central1-a/privateClouds/my-cloud` - # @param logging_server [::Google::Cloud::VmwareEngine::V1::LoggingServer, ::Hash] - # Required. The initial description of a new logging server. - # @param logging_server_id [::String] - # Required. The user-provided identifier of the `LoggingServer` to be - # created. This identifier must be unique among `LoggingServer` resources - # within the parent and becomes the final token in the name URI. - # The identifier must meet the following requirements: - # - # * Only contains 1-63 alphanumeric characters and hyphens - # * Begins with an alphabetical character - # * Ends with a non-hyphen character - # * Not formatted as a UUID - # * Complies with [RFC 1034](https://datatracker.ietf.org/doc/html/rfc1034) - # (section 3.5) - # @param request_id [::String] - # Optional. A request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server guarantees that a - # request doesn't result in creation of duplicate commitments for at least 60 - # minutes. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request ID, - # the server can check if original operation with the same request ID was - # received, and if so, will ignore the second request. This prevents clients - # from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @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/vmware_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VmwareEngine::V1::CreateLoggingServerRequest.new - # - # # Call the create_logging_server method. - # result = client.create_logging_server 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_logging_server request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::CreateLoggingServerRequest - - # Converts hash 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_logging_server.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::VmwareEngine::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_logging_server.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_logging_server.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vmware_engine_stub.create_logging_server 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 - - ## - # Updates the parameters of a single logging server. - # Only fields specified in `update_mask` are applied. - # - # @overload update_logging_server(request, options = nil) - # Pass arguments to `update_logging_server` via a request object, either of type - # {::Google::Cloud::VmwareEngine::V1::UpdateLoggingServerRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VmwareEngine::V1::UpdateLoggingServerRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_logging_server(update_mask: nil, logging_server: nil, request_id: nil) - # Pass arguments to `update_logging_server` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Required. Field mask is used to specify the fields to be overwritten in the - # `LoggingServer` resource by the update. - # The fields specified in the `update_mask` are relative to the resource, not - # the full request. A field will be overwritten if it is in the mask. If the - # user does not provide a mask then all fields will be overwritten. - # @param logging_server [::Google::Cloud::VmwareEngine::V1::LoggingServer, ::Hash] - # Required. Logging server description. - # @param request_id [::String] - # Optional. A request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server guarantees that a - # request doesn't result in creation of duplicate commitments for at least 60 - # minutes. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request ID, - # the server can check if original operation with the same request ID was - # received, and if so, will ignore the second request. This prevents clients - # from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @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/vmware_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VmwareEngine::V1::UpdateLoggingServerRequest.new - # - # # Call the update_logging_server method. - # result = client.update_logging_server 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 update_logging_server request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::UpdateLoggingServerRequest - - # Converts hash 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_logging_server.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::VmwareEngine::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_logging_server.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_logging_server.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vmware_engine_stub.update_logging_server 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 single logging server. - # - # @overload delete_logging_server(request, options = nil) - # Pass arguments to `delete_logging_server` via a request object, either of type - # {::Google::Cloud::VmwareEngine::V1::DeleteLoggingServerRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VmwareEngine::V1::DeleteLoggingServerRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_logging_server(name: nil, request_id: nil) - # Pass arguments to `delete_logging_server` via keyword arguments. Note that at - # least one keyword argument is 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 logging server to delete. - # Resource names are schemeless URIs that follow the conventions in - # https://cloud.google.com/apis/design/resource_names. - # For example: - # `projects/my-project/locations/us-central1-a/privateClouds/my-cloud/loggingServers/my-logging-server` - # @param request_id [::String] - # Optional. A request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server guarantees that a - # request doesn't result in creation of duplicate commitments for at least 60 - # minutes. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @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/vmware_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VmwareEngine::V1::DeleteLoggingServerRequest.new - # - # # Call the delete_logging_server method. - # result = client.delete_logging_server 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_logging_server request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::DeleteLoggingServerRequest - - # Converts hash 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_logging_server.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::VmwareEngine::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_logging_server.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_logging_server.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vmware_engine_stub.delete_logging_server 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 - - ## - # Lists node types - # - # @overload list_node_types(request, options = nil) - # Pass arguments to `list_node_types` via a request object, either of type - # {::Google::Cloud::VmwareEngine::V1::ListNodeTypesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VmwareEngine::V1::ListNodeTypesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_node_types(parent: nil, page_size: nil, page_token: nil, filter: nil) - # Pass arguments to `list_node_types` via keyword arguments. Note that at - # least one keyword argument is 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 to be queried for node types. - # Resource names are schemeless URIs that follow the conventions in - # https://cloud.google.com/apis/design/resource_names. - # For example: - # `projects/my-project/locations/us-central1-a` - # @param page_size [::Integer] - # The maximum number of node types to return in one page. - # The service may return fewer than this value. - # The maximum value is coerced to 1000. - # The default value of this field is 500. - # @param page_token [::String] - # A page token, received from a previous `ListNodeTypes` call. - # Provide this to retrieve the subsequent page. - # - # When paginating, all other parameters provided to - # `ListNodeTypes` must match the call that provided the page token. - # @param filter [::String] - # A filter expression that matches resources returned in the response. - # The expression must specify the field name, a comparison - # operator, and the value that you want to use for filtering. The value - # must be a string, a number, or a boolean. The comparison operator - # must be `=`, `!=`, `>`, or `<`. - # - # For example, if you are filtering a list of node types, you can - # exclude the ones named `standard-72` by specifying - # `name != "standard-72"`. - # - # To filter on multiple expressions, provide each separate expression within - # parentheses. For example: - # ``` - # (name = "standard-72") - # (virtual_cpu_count > 2) - # ``` - # - # By default, each expression is an `AND` expression. However, you - # can include `AND` and `OR` expressions explicitly. - # For example: - # ``` - # (name = "standard-96") AND - # (virtual_cpu_count > 2) OR - # (name = "standard-72") - # ``` - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::VmwareEngine::V1::NodeType>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::VmwareEngine::V1::NodeType>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/vmware_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VmwareEngine::V1::ListNodeTypesRequest.new - # - # # Call the list_node_types method. - # result = client.list_node_types 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::VmwareEngine::V1::NodeType. - # p item - # end - # - def list_node_types request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::ListNodeTypesRequest - - # Converts hash 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_node_types.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::VmwareEngine::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_node_types.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_node_types.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vmware_engine_stub.list_node_types request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @vmware_engine_stub, :list_node_types, "node_types", 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 details of a single `NodeType`. - # - # @overload get_node_type(request, options = nil) - # Pass arguments to `get_node_type` via a request object, either of type - # {::Google::Cloud::VmwareEngine::V1::GetNodeTypeRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VmwareEngine::V1::GetNodeTypeRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_node_type(name: nil) - # Pass arguments to `get_node_type` via keyword arguments. Note that at - # least one keyword argument is 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 node type to retrieve. - # Resource names are schemeless URIs that follow the conventions in - # https://cloud.google.com/apis/design/resource_names. - # For example: - # `projects/my-proj/locations/us-central1-a/nodeTypes/standard-72` - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::VmwareEngine::V1::NodeType] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::VmwareEngine::V1::NodeType] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/vmware_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VmwareEngine::V1::GetNodeTypeRequest.new - # - # # Call the get_node_type method. - # result = client.get_node_type request - # - # # The returned object is of type Google::Cloud::VmwareEngine::V1::NodeType. - # p result - # - def get_node_type request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::GetNodeTypeRequest - - # Converts hash 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_node_type.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::VmwareEngine::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_node_type.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_node_type.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vmware_engine_stub.get_node_type 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 - - ## - # Gets details of credentials for NSX appliance. - # - # @overload show_nsx_credentials(request, options = nil) - # Pass arguments to `show_nsx_credentials` via a request object, either of type - # {::Google::Cloud::VmwareEngine::V1::ShowNsxCredentialsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VmwareEngine::V1::ShowNsxCredentialsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_nsx_credentials(private_cloud: nil) - # Pass arguments to `show_nsx_credentials` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param private_cloud [::String] - # Required. The resource name of the private cloud - # to be queried for credentials. - # Resource names are schemeless URIs that follow the conventions in - # https://cloud.google.com/apis/design/resource_names. - # For example: - # `projects/my-project/locations/us-central1-a/privateClouds/my-cloud` - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::VmwareEngine::V1::Credentials] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::VmwareEngine::V1::Credentials] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/vmware_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VmwareEngine::V1::ShowNsxCredentialsRequest.new - # - # # Call the show_nsx_credentials method. - # result = client.show_nsx_credentials request - # - # # The returned object is of type Google::Cloud::VmwareEngine::V1::Credentials. - # p result - # - def show_nsx_credentials request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::ShowNsxCredentialsRequest - - # Converts hash 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_nsx_credentials.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::VmwareEngine::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_nsx_credentials.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.show_nsx_credentials.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vmware_engine_stub.show_nsx_credentials 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 - - ## - # Gets details of credentials for Vcenter appliance. - # - # @overload show_vcenter_credentials(request, options = nil) - # Pass arguments to `show_vcenter_credentials` via a request object, either of type - # {::Google::Cloud::VmwareEngine::V1::ShowVcenterCredentialsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VmwareEngine::V1::ShowVcenterCredentialsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_vcenter_credentials(private_cloud: nil, username: nil) - # Pass arguments to `show_vcenter_credentials` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param private_cloud [::String] - # Required. The resource name of the private cloud - # to be queried for credentials. - # Resource names are schemeless URIs that follow the conventions in - # https://cloud.google.com/apis/design/resource_names. - # For example: - # `projects/my-project/locations/us-central1-a/privateClouds/my-cloud` - # @param username [::String] - # Optional. The username of the user to be queried for credentials. - # The default value of this field is CloudOwner@gve.local. - # The provided value must be one of the following: - # CloudOwner@gve.local, - # solution-user-01@gve.local, - # solution-user-02@gve.local, - # solution-user-03@gve.local, - # solution-user-04@gve.local, - # solution-user-05@gve.local, - # zertoadmin@gve.local. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::VmwareEngine::V1::Credentials] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::VmwareEngine::V1::Credentials] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/vmware_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VmwareEngine::V1::ShowVcenterCredentialsRequest.new - # - # # Call the show_vcenter_credentials method. - # result = client.show_vcenter_credentials request - # - # # The returned object is of type Google::Cloud::VmwareEngine::V1::Credentials. - # p result - # - def show_vcenter_credentials request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::ShowVcenterCredentialsRequest - - # Converts hash 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_vcenter_credentials.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::VmwareEngine::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_vcenter_credentials.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.show_vcenter_credentials.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vmware_engine_stub.show_vcenter_credentials 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 - - ## - # Resets credentials of the NSX appliance. - # - # @overload reset_nsx_credentials(request, options = nil) - # Pass arguments to `reset_nsx_credentials` via a request object, either of type - # {::Google::Cloud::VmwareEngine::V1::ResetNsxCredentialsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VmwareEngine::V1::ResetNsxCredentialsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload reset_nsx_credentials(private_cloud: nil, request_id: nil) - # Pass arguments to `reset_nsx_credentials` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param private_cloud [::String] - # Required. The resource name of the private cloud - # to reset credentials for. - # Resource names are schemeless URIs that follow the conventions in - # https://cloud.google.com/apis/design/resource_names. - # For example: - # `projects/my-project/locations/us-central1-a/privateClouds/my-cloud` - # @param request_id [::String] - # Optional. A request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server guarantees that a - # request doesn't result in creation of duplicate commitments for at least 60 - # minutes. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @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/vmware_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VmwareEngine::V1::ResetNsxCredentialsRequest.new - # - # # Call the reset_nsx_credentials method. - # result = client.reset_nsx_credentials 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 reset_nsx_credentials request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::ResetNsxCredentialsRequest - - # Converts hash 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.reset_nsx_credentials.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::VmwareEngine::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.reset_nsx_credentials.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.reset_nsx_credentials.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vmware_engine_stub.reset_nsx_credentials 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 - - ## - # Resets credentials of the Vcenter appliance. - # - # @overload reset_vcenter_credentials(request, options = nil) - # Pass arguments to `reset_vcenter_credentials` via a request object, either of type - # {::Google::Cloud::VmwareEngine::V1::ResetVcenterCredentialsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VmwareEngine::V1::ResetVcenterCredentialsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload reset_vcenter_credentials(private_cloud: nil, request_id: nil, username: nil) - # Pass arguments to `reset_vcenter_credentials` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param private_cloud [::String] - # Required. The resource name of the private cloud - # to reset credentials for. - # Resource names are schemeless URIs that follow the conventions in - # https://cloud.google.com/apis/design/resource_names. - # For example: - # `projects/my-project/locations/us-central1-a/privateClouds/my-cloud` - # @param request_id [::String] - # Optional. A request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server guarantees that a - # request doesn't result in creation of duplicate commitments for at least 60 - # minutes. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @param username [::String] - # Optional. The username of the user to be to reset the credentials. - # The default value of this field is CloudOwner@gve.local. - # The provided value should be one of the following: - # solution-user-01@gve.local, - # solution-user-02@gve.local, - # solution-user-03@gve.local, - # solution-user-04@gve.local, - # solution-user-05@gve.local, - # zertoadmin@gve.local. - # @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/vmware_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VmwareEngine::V1::ResetVcenterCredentialsRequest.new - # - # # Call the reset_vcenter_credentials method. - # result = client.reset_vcenter_credentials 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 reset_vcenter_credentials request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::ResetVcenterCredentialsRequest - - # Converts hash 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.reset_vcenter_credentials.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::VmwareEngine::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.reset_vcenter_credentials.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.reset_vcenter_credentials.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vmware_engine_stub.reset_vcenter_credentials 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 - - ## - # Gets details of the `DnsForwarding` config. - # - # @overload get_dns_forwarding(request, options = nil) - # Pass arguments to `get_dns_forwarding` via a request object, either of type - # {::Google::Cloud::VmwareEngine::V1::GetDnsForwardingRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VmwareEngine::V1::GetDnsForwardingRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_dns_forwarding(name: nil) - # Pass arguments to `get_dns_forwarding` via keyword arguments. Note that at - # least one keyword argument is 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 a `DnsForwarding` to retrieve. - # Resource names are schemeless URIs that follow the conventions in - # https://cloud.google.com/apis/design/resource_names. - # For example: - # `projects/my-project/locations/us-central1-a/privateClouds/my-cloud/dnsForwarding` - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::VmwareEngine::V1::DnsForwarding] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::VmwareEngine::V1::DnsForwarding] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/vmware_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VmwareEngine::V1::GetDnsForwardingRequest.new - # - # # Call the get_dns_forwarding method. - # result = client.get_dns_forwarding request - # - # # The returned object is of type Google::Cloud::VmwareEngine::V1::DnsForwarding. - # p result - # - def get_dns_forwarding request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::GetDnsForwardingRequest - - # Converts hash 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_dns_forwarding.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::VmwareEngine::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_dns_forwarding.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_dns_forwarding.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vmware_engine_stub.get_dns_forwarding 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 parameters of the `DnsForwarding` config, like associated - # domains. Only fields specified in `update_mask` are applied. - # - # @overload update_dns_forwarding(request, options = nil) - # Pass arguments to `update_dns_forwarding` via a request object, either of type - # {::Google::Cloud::VmwareEngine::V1::UpdateDnsForwardingRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VmwareEngine::V1::UpdateDnsForwardingRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_dns_forwarding(dns_forwarding: nil, update_mask: nil, request_id: nil) - # Pass arguments to `update_dns_forwarding` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param dns_forwarding [::Google::Cloud::VmwareEngine::V1::DnsForwarding, ::Hash] - # Required. DnsForwarding config details. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Required. Field mask is used to specify the fields to be overwritten in the - # `DnsForwarding` resource by the update. - # The fields specified in the `update_mask` are relative to the resource, not - # the full request. A field will be overwritten if it is in the mask. If the - # user does not provide a mask then all fields will be overwritten. - # @param request_id [::String] - # Optional. A request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server guarantees that a - # request doesn't result in creation of duplicate commitments for at least 60 - # minutes. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request ID, - # the server can check if original operation with the same request ID was - # received, and if so, will ignore the second request. This prevents clients - # from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @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/vmware_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VmwareEngine::V1::UpdateDnsForwardingRequest.new - # - # # Call the update_dns_forwarding method. - # result = client.update_dns_forwarding 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 update_dns_forwarding request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::UpdateDnsForwardingRequest - - # Converts hash 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_dns_forwarding.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::VmwareEngine::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_dns_forwarding.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_dns_forwarding.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vmware_engine_stub.update_dns_forwarding 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 - - ## - # Retrieves a `NetworkPeering` resource by its resource name. The resource - # contains details of the network peering, such as peered - # networks, import and export custom route configurations, and peering state. - # NetworkPeering is a global resource and location can only be global. - # - # @overload get_network_peering(request, options = nil) - # Pass arguments to `get_network_peering` via a request object, either of type - # {::Google::Cloud::VmwareEngine::V1::GetNetworkPeeringRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VmwareEngine::V1::GetNetworkPeeringRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_network_peering(name: nil) - # Pass arguments to `get_network_peering` via keyword arguments. Note that at - # least one keyword argument is 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 network peering to retrieve. - # Resource names are schemeless URIs that follow the conventions in - # https://cloud.google.com/apis/design/resource_names. - # For example: - # `projects/my-project/locations/global/networkPeerings/my-peering` - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::VmwareEngine::V1::NetworkPeering] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::VmwareEngine::V1::NetworkPeering] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/vmware_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VmwareEngine::V1::GetNetworkPeeringRequest.new - # - # # Call the get_network_peering method. - # result = client.get_network_peering request - # - # # The returned object is of type Google::Cloud::VmwareEngine::V1::NetworkPeering. - # p result - # - def get_network_peering request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::GetNetworkPeeringRequest - - # Converts hash 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_network_peering.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::VmwareEngine::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_network_peering.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_network_peering.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vmware_engine_stub.get_network_peering 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 `NetworkPeering` resources in a given project. NetworkPeering is a - # global resource and location can only be global. - # - # @overload list_network_peerings(request, options = nil) - # Pass arguments to `list_network_peerings` via a request object, either of type - # {::Google::Cloud::VmwareEngine::V1::ListNetworkPeeringsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VmwareEngine::V1::ListNetworkPeeringsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_network_peerings(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) - # Pass arguments to `list_network_peerings` via keyword arguments. Note that at - # least one keyword argument is 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 (global) to query for - # network peerings. Resource names are schemeless URIs that follow the - # conventions in https://cloud.google.com/apis/design/resource_names. For - # example: `projects/my-project/locations/global` - # @param page_size [::Integer] - # The maximum number of network peerings to return in one page. - # The maximum value is coerced to 1000. - # The default value of this field is 500. - # @param page_token [::String] - # A page token, received from a previous `ListNetworkPeerings` call. - # Provide this to retrieve the subsequent page. - # - # When paginating, all other parameters provided to - # `ListNetworkPeerings` must match the call that provided the page - # token. - # @param filter [::String] - # A filter expression that matches resources returned in the response. - # The expression must specify the field name, a comparison - # operator, and the value that you want to use for filtering. The value - # must be a string, a number, or a boolean. The comparison operator - # must be `=`, `!=`, `>`, or `<`. - # - # For example, if you are filtering a list of network peerings, you can - # exclude the ones named `example-peering` by specifying - # `name != "example-peering"`. - # - # To filter on multiple expressions, provide each separate expression within - # parentheses. For example: - # ``` - # (name = "example-peering") - # (createTime > "2021-04-12T08:15:10.40Z") - # ``` - # - # By default, each expression is an `AND` expression. However, you - # can include `AND` and `OR` expressions explicitly. - # For example: - # ``` - # (name = "example-peering-1") AND - # (createTime > "2021-04-12T08:15:10.40Z") OR - # (name = "example-peering-2") - # ``` - # @param order_by [::String] - # Sorts list results by a certain order. By default, returned results - # are ordered by `name` in ascending order. - # You can also sort results in descending order based on the `name` value - # using `orderBy="name desc"`. - # Currently, only ordering by `name` is supported. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::VmwareEngine::V1::NetworkPeering>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::VmwareEngine::V1::NetworkPeering>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/vmware_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VmwareEngine::V1::ListNetworkPeeringsRequest.new - # - # # Call the list_network_peerings method. - # result = client.list_network_peerings 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::VmwareEngine::V1::NetworkPeering. - # p item - # end - # - def list_network_peerings request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::ListNetworkPeeringsRequest - - # Converts hash 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_network_peerings.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::VmwareEngine::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_network_peerings.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_network_peerings.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vmware_engine_stub.list_network_peerings request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @vmware_engine_stub, :list_network_peerings, "network_peerings", 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 - - ## - # Creates a new network peering between the peer network and VMware Engine - # network provided in a `NetworkPeering` resource. NetworkPeering is a - # global resource and location can only be global. - # - # @overload create_network_peering(request, options = nil) - # Pass arguments to `create_network_peering` via a request object, either of type - # {::Google::Cloud::VmwareEngine::V1::CreateNetworkPeeringRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VmwareEngine::V1::CreateNetworkPeeringRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_network_peering(parent: nil, network_peering_id: nil, network_peering: nil, request_id: nil) - # Pass arguments to `create_network_peering` via keyword arguments. Note that at - # least one keyword argument is 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 to create the new network - # peering in. This value is always `global`, because `NetworkPeering` is a - # global resource. Resource names are schemeless URIs that follow the - # conventions in https://cloud.google.com/apis/design/resource_names. For - # example: `projects/my-project/locations/global` - # @param network_peering_id [::String] - # Required. The user-provided identifier of the new `NetworkPeering`. - # This identifier must be unique among `NetworkPeering` resources within the - # parent and becomes the final token in the name URI. - # The identifier must meet the following requirements: - # - # * Only contains 1-63 alphanumeric characters and hyphens - # * Begins with an alphabetical character - # * Ends with a non-hyphen character - # * Not formatted as a UUID - # * Complies with [RFC 1034](https://datatracker.ietf.org/doc/html/rfc1034) - # (section 3.5) - # @param network_peering [::Google::Cloud::VmwareEngine::V1::NetworkPeering, ::Hash] - # Required. The initial description of the new network peering. - # @param request_id [::String] - # Optional. A request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server guarantees that a - # request doesn't result in creation of duplicate commitments for at least 60 - # minutes. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @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/vmware_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VmwareEngine::V1::CreateNetworkPeeringRequest.new - # - # # Call the create_network_peering method. - # result = client.create_network_peering 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_network_peering request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::CreateNetworkPeeringRequest - - # Converts hash 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_network_peering.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::VmwareEngine::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_network_peering.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_network_peering.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vmware_engine_stub.create_network_peering 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 `NetworkPeering` resource. When a network peering is deleted for - # a VMware Engine network, the peer network becomes inaccessible to that - # VMware Engine network. NetworkPeering is a global resource and location can - # only be global. - # - # @overload delete_network_peering(request, options = nil) - # Pass arguments to `delete_network_peering` via a request object, either of type - # {::Google::Cloud::VmwareEngine::V1::DeleteNetworkPeeringRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VmwareEngine::V1::DeleteNetworkPeeringRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_network_peering(name: nil, request_id: nil) - # Pass arguments to `delete_network_peering` via keyword arguments. Note that at - # least one keyword argument is 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 network peering to be deleted. - # Resource names are schemeless URIs that follow the conventions in - # https://cloud.google.com/apis/design/resource_names. - # For example: - # `projects/my-project/locations/global/networkPeerings/my-peering` - # @param request_id [::String] - # Optional. A request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server guarantees that a - # request doesn't result in creation of duplicate commitments for at least 60 - # minutes. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @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/vmware_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VmwareEngine::V1::DeleteNetworkPeeringRequest.new - # - # # Call the delete_network_peering method. - # result = client.delete_network_peering 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_network_peering request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::DeleteNetworkPeeringRequest - - # Converts hash 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_network_peering.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::VmwareEngine::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_network_peering.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_network_peering.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vmware_engine_stub.delete_network_peering 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 - - ## - # Modifies a `NetworkPeering` resource. Only the `description` field can be - # updated. Only fields specified in `updateMask` are applied. NetworkPeering - # is a global resource and location can only be global. - # - # @overload update_network_peering(request, options = nil) - # Pass arguments to `update_network_peering` via a request object, either of type - # {::Google::Cloud::VmwareEngine::V1::UpdateNetworkPeeringRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VmwareEngine::V1::UpdateNetworkPeeringRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_network_peering(network_peering: nil, update_mask: nil, request_id: nil) - # Pass arguments to `update_network_peering` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param network_peering [::Google::Cloud::VmwareEngine::V1::NetworkPeering, ::Hash] - # Required. Network peering description. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Required. Field mask is used to specify the fields to be overwritten in the - # `NetworkPeering` resource by the update. - # The fields specified in the `update_mask` are relative to the resource, not - # the full request. A field will be overwritten if it is in the mask. If the - # user does not provide a mask then all fields will be overwritten. - # @param request_id [::String] - # Optional. A request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server guarantees that a - # request doesn't result in creation of duplicate commitments for at least 60 - # minutes. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @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/vmware_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VmwareEngine::V1::UpdateNetworkPeeringRequest.new - # - # # Call the update_network_peering method. - # result = client.update_network_peering 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 update_network_peering request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::UpdateNetworkPeeringRequest - - # Converts hash 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_network_peering.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::VmwareEngine::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_network_peering.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_network_peering.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vmware_engine_stub.update_network_peering 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 - - ## - # Lists the network peering routes exchanged over a peering connection. - # NetworkPeering is a global resource and location can only be global. - # - # @overload list_peering_routes(request, options = nil) - # Pass arguments to `list_peering_routes` via a request object, either of type - # {::Google::Cloud::VmwareEngine::V1::ListPeeringRoutesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VmwareEngine::V1::ListPeeringRoutesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_peering_routes(parent: nil, page_size: nil, page_token: nil, filter: nil) - # Pass arguments to `list_peering_routes` via keyword arguments. Note that at - # least one keyword argument is 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 network peering to retrieve peering - # routes from. Resource names are schemeless URIs that follow the conventions - # in https://cloud.google.com/apis/design/resource_names. For example: - # `projects/my-project/locations/global/networkPeerings/my-peering` - # @param page_size [::Integer] - # The maximum number of peering routes to return in one page. - # The service may return fewer than this value. - # The maximum value is coerced to 1000. - # The default value of this field is 500. - # @param page_token [::String] - # A page token, received from a previous `ListPeeringRoutes` call. - # Provide this to retrieve the subsequent page. - # When paginating, all other parameters provided to `ListPeeringRoutes` must - # match the call that provided the page token. - # @param filter [::String] - # A filter expression that matches resources returned in the response. - # Currently, only filtering on the `direction` field is supported. To return - # routes imported from the peer network, provide "direction=INCOMING". To - # return routes exported from the VMware Engine network, provide - # "direction=OUTGOING". Other filter expressions return an error. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::VmwareEngine::V1::PeeringRoute>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::VmwareEngine::V1::PeeringRoute>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/vmware_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VmwareEngine::V1::ListPeeringRoutesRequest.new - # - # # Call the list_peering_routes method. - # result = client.list_peering_routes 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::VmwareEngine::V1::PeeringRoute. - # p item - # end - # - def list_peering_routes request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::ListPeeringRoutesRequest - - # Converts hash 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_peering_routes.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::VmwareEngine::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_peering_routes.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_peering_routes.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vmware_engine_stub.list_peering_routes request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @vmware_engine_stub, :list_peering_routes, "peering_routes", 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 - - ## - # Creates a new HCX activation key in a given private cloud. - # - # @overload create_hcx_activation_key(request, options = nil) - # Pass arguments to `create_hcx_activation_key` via a request object, either of type - # {::Google::Cloud::VmwareEngine::V1::CreateHcxActivationKeyRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VmwareEngine::V1::CreateHcxActivationKeyRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_hcx_activation_key(parent: nil, hcx_activation_key: nil, hcx_activation_key_id: nil, request_id: nil) - # Pass arguments to `create_hcx_activation_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 resource name of the private cloud to create the key for. - # Resource names are schemeless URIs that follow the conventions in - # https://cloud.google.com/apis/design/resource_names. - # For example: - # `projects/my-project/locations/us-central1/privateClouds/my-cloud` - # @param hcx_activation_key [::Google::Cloud::VmwareEngine::V1::HcxActivationKey, ::Hash] - # Required. The initial description of a new HCX activation key. When - # creating a new key, this field must be an empty object. - # @param hcx_activation_key_id [::String] - # Required. The user-provided identifier of the `HcxActivationKey` to be - # created. This identifier must be unique among `HcxActivationKey` resources - # within the parent and becomes the final token in the name URI. - # The identifier must meet the following requirements: - # - # * Only contains 1-63 alphanumeric characters and hyphens - # * Begins with an alphabetical character - # * Ends with a non-hyphen character - # * Not formatted as a UUID - # * Complies with [RFC 1034](https://datatracker.ietf.org/doc/html/rfc1034) - # (section 3.5) - # @param request_id [::String] - # A request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server guarantees that a - # request doesn't result in creation of duplicate commitments for at least 60 - # minutes. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request ID, - # the server can check if original operation with the same request ID was - # received, and if so, will ignore the second request. This prevents clients - # from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @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/vmware_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VmwareEngine::V1::CreateHcxActivationKeyRequest.new - # - # # Call the create_hcx_activation_key method. - # result = client.create_hcx_activation_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 create_hcx_activation_key request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::CreateHcxActivationKeyRequest - - # Converts hash 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_hcx_activation_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::VmwareEngine::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_hcx_activation_key.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_hcx_activation_key.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vmware_engine_stub.create_hcx_activation_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 - - ## - # Lists `HcxActivationKey` resources in a given private cloud. - # - # @overload list_hcx_activation_keys(request, options = nil) - # Pass arguments to `list_hcx_activation_keys` via a request object, either of type - # {::Google::Cloud::VmwareEngine::V1::ListHcxActivationKeysRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VmwareEngine::V1::ListHcxActivationKeysRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_hcx_activation_keys(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_hcx_activation_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 private cloud - # to be queried for HCX activation keys. - # Resource names are schemeless URIs that follow the conventions in - # https://cloud.google.com/apis/design/resource_names. - # For example: - # `projects/my-project/locations/us-central1/privateClouds/my-cloud` - # @param page_size [::Integer] - # The maximum number of HCX activation keys to return in one page. - # The service may return fewer than this value. - # The maximum value is coerced to 1000. - # The default value of this field is 500. - # @param page_token [::String] - # A page token, received from a previous `ListHcxActivationKeys` call. - # Provide this to retrieve the subsequent page. - # - # When paginating, all other parameters provided to - # `ListHcxActivationKeys` must match the call that provided the page - # token. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::VmwareEngine::V1::HcxActivationKey>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::VmwareEngine::V1::HcxActivationKey>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/vmware_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VmwareEngine::V1::ListHcxActivationKeysRequest.new - # - # # Call the list_hcx_activation_keys method. - # result = client.list_hcx_activation_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::VmwareEngine::V1::HcxActivationKey. - # p item - # end - # - def list_hcx_activation_keys request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::ListHcxActivationKeysRequest - - # Converts hash 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_hcx_activation_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::VmwareEngine::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_hcx_activation_keys.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_hcx_activation_keys.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vmware_engine_stub.list_hcx_activation_keys request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @vmware_engine_stub, :list_hcx_activation_keys, "hcx_activation_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 - - ## - # Retrieves a `HcxActivationKey` resource by its resource name. - # - # @overload get_hcx_activation_key(request, options = nil) - # Pass arguments to `get_hcx_activation_key` via a request object, either of type - # {::Google::Cloud::VmwareEngine::V1::GetHcxActivationKeyRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VmwareEngine::V1::GetHcxActivationKeyRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_hcx_activation_key(name: nil) - # Pass arguments to `get_hcx_activation_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 resource name of the HCX activation key to retrieve. - # Resource names are schemeless URIs that follow the conventions in - # https://cloud.google.com/apis/design/resource_names. - # For example: - # `projects/my-project/locations/us-central1/privateClouds/my-cloud/hcxActivationKeys/my-key` - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::VmwareEngine::V1::HcxActivationKey] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::VmwareEngine::V1::HcxActivationKey] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/vmware_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VmwareEngine::V1::GetHcxActivationKeyRequest.new - # - # # Call the get_hcx_activation_key method. - # result = client.get_hcx_activation_key request - # - # # The returned object is of type Google::Cloud::VmwareEngine::V1::HcxActivationKey. - # p result - # - def get_hcx_activation_key request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::GetHcxActivationKeyRequest - - # Converts hash 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_hcx_activation_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::VmwareEngine::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_hcx_activation_key.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_hcx_activation_key.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vmware_engine_stub.get_hcx_activation_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 - - ## - # Retrieves a `NetworkPolicy` resource by its resource name. - # - # @overload get_network_policy(request, options = nil) - # Pass arguments to `get_network_policy` via a request object, either of type - # {::Google::Cloud::VmwareEngine::V1::GetNetworkPolicyRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VmwareEngine::V1::GetNetworkPolicyRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_network_policy(name: nil) - # Pass arguments to `get_network_policy` via keyword arguments. Note that at - # least one keyword argument is 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 network policy to retrieve. - # Resource names are schemeless URIs that follow the conventions in - # https://cloud.google.com/apis/design/resource_names. - # For example: - # `projects/my-project/locations/us-central1/networkPolicies/my-network-policy` - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::VmwareEngine::V1::NetworkPolicy] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::VmwareEngine::V1::NetworkPolicy] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/vmware_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VmwareEngine::V1::GetNetworkPolicyRequest.new - # - # # Call the get_network_policy method. - # result = client.get_network_policy request - # - # # The returned object is of type Google::Cloud::VmwareEngine::V1::NetworkPolicy. - # p result - # - def get_network_policy request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::GetNetworkPolicyRequest - - # Converts hash 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_network_policy.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::VmwareEngine::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_network_policy.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_network_policy.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vmware_engine_stub.get_network_policy 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 `NetworkPolicy` resources in a specified project and location. - # - # @overload list_network_policies(request, options = nil) - # Pass arguments to `list_network_policies` via a request object, either of type - # {::Google::Cloud::VmwareEngine::V1::ListNetworkPoliciesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VmwareEngine::V1::ListNetworkPoliciesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_network_policies(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) - # Pass arguments to `list_network_policies` via keyword arguments. Note that at - # least one keyword argument is 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 (region) to query for - # network policies. Resource names are schemeless URIs that follow the - # conventions in https://cloud.google.com/apis/design/resource_names. For - # example: `projects/my-project/locations/us-central1` - # @param page_size [::Integer] - # The maximum number of network policies to return in one page. - # The service may return fewer than this value. - # The maximum value is coerced to 1000. - # The default value of this field is 500. - # @param page_token [::String] - # A page token, received from a previous `ListNetworkPolicies` call. - # Provide this to retrieve the subsequent page. - # - # When paginating, all other parameters provided to - # `ListNetworkPolicies` must match the call that provided the page - # token. - # @param filter [::String] - # A filter expression that matches resources returned in the response. - # The expression must specify the field name, a comparison - # operator, and the value that you want to use for filtering. The value - # must be a string, a number, or a boolean. The comparison operator - # must be `=`, `!=`, `>`, or `<`. - # - # For example, if you are filtering a list of network policies, you can - # exclude the ones named `example-policy` by specifying - # `name != "example-policy"`. - # - # To filter on multiple expressions, provide each separate expression within - # parentheses. For example: - # ``` - # (name = "example-policy") - # (createTime > "2021-04-12T08:15:10.40Z") - # ``` - # - # By default, each expression is an `AND` expression. However, you - # can include `AND` and `OR` expressions explicitly. - # For example: - # ``` - # (name = "example-policy-1") AND - # (createTime > "2021-04-12T08:15:10.40Z") OR - # (name = "example-policy-2") - # ``` - # @param order_by [::String] - # Sorts list results by a certain order. By default, returned results - # are ordered by `name` in ascending order. - # You can also sort results in descending order based on the `name` value - # using `orderBy="name desc"`. - # Currently, only ordering by `name` is supported. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::VmwareEngine::V1::NetworkPolicy>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::VmwareEngine::V1::NetworkPolicy>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/vmware_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VmwareEngine::V1::ListNetworkPoliciesRequest.new - # - # # Call the list_network_policies method. - # result = client.list_network_policies 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::VmwareEngine::V1::NetworkPolicy. - # p item - # end - # - def list_network_policies request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::ListNetworkPoliciesRequest - - # Converts hash 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_network_policies.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::VmwareEngine::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_network_policies.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_network_policies.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vmware_engine_stub.list_network_policies request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @vmware_engine_stub, :list_network_policies, "network_policies", 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 - - ## - # Creates a new network policy in a given VMware Engine network of a - # project and location (region). A new network policy cannot be created if - # another network policy already exists in the same scope. - # - # @overload create_network_policy(request, options = nil) - # Pass arguments to `create_network_policy` via a request object, either of type - # {::Google::Cloud::VmwareEngine::V1::CreateNetworkPolicyRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VmwareEngine::V1::CreateNetworkPolicyRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_network_policy(parent: nil, network_policy_id: nil, network_policy: nil, request_id: nil) - # Pass arguments to `create_network_policy` via keyword arguments. Note that at - # least one keyword argument is 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 (region) - # to create the new network policy in. - # Resource names are schemeless URIs that follow the conventions in - # https://cloud.google.com/apis/design/resource_names. - # For example: - # `projects/my-project/locations/us-central1` - # @param network_policy_id [::String] - # Required. The user-provided identifier of the network policy to be created. - # This identifier must be unique within parent - # `projects/{my-project}/locations/{us-central1}/networkPolicies` and becomes - # the final token in the name URI. - # The identifier must meet the following requirements: - # - # * Only contains 1-63 alphanumeric characters and hyphens - # * Begins with an alphabetical character - # * Ends with a non-hyphen character - # * Not formatted as a UUID - # * Complies with [RFC 1034](https://datatracker.ietf.org/doc/html/rfc1034) - # (section 3.5) - # @param network_policy [::Google::Cloud::VmwareEngine::V1::NetworkPolicy, ::Hash] - # Required. The network policy configuration to use in the request. - # @param request_id [::String] - # Optional. A request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server guarantees that a - # request doesn't result in creation of duplicate commitments for at least 60 - # minutes. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @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/vmware_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VmwareEngine::V1::CreateNetworkPolicyRequest.new - # - # # Call the create_network_policy method. - # result = client.create_network_policy 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_network_policy request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::CreateNetworkPolicyRequest - - # Converts hash 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_network_policy.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::VmwareEngine::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_network_policy.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_network_policy.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vmware_engine_stub.create_network_policy 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 - - ## - # Modifies a `NetworkPolicy` resource. Only the following fields can be - # updated: `internet_access`, `external_ip`, `edge_services_cidr`. - # Only fields specified in `updateMask` are applied. When updating a network - # policy, the external IP network service can only be disabled if there are - # no external IP addresses present in the scope of the policy. Also, a - # `NetworkService` cannot be updated when `NetworkService.state` is set - # to `RECONCILING`. - # - # During operation processing, the resource is temporarily in the `ACTIVE` - # state before the operation fully completes. For that period of time, you - # can't update the resource. Use the operation status to determine when the - # processing fully completes. - # - # @overload update_network_policy(request, options = nil) - # Pass arguments to `update_network_policy` via a request object, either of type - # {::Google::Cloud::VmwareEngine::V1::UpdateNetworkPolicyRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VmwareEngine::V1::UpdateNetworkPolicyRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_network_policy(network_policy: nil, update_mask: nil, request_id: nil) - # Pass arguments to `update_network_policy` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param network_policy [::Google::Cloud::VmwareEngine::V1::NetworkPolicy, ::Hash] - # Required. Network policy description. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Required. Field mask is used to specify the fields to be overwritten in the - # `NetworkPolicy` resource by the update. - # The fields specified in the `update_mask` are relative to the resource, not - # the full request. A field will be overwritten if it is in the mask. If the - # user does not provide a mask then all fields will be overwritten. - # @param request_id [::String] - # Optional. A request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server guarantees that a - # request doesn't result in creation of duplicate commitments for at least 60 - # minutes. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @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/vmware_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VmwareEngine::V1::UpdateNetworkPolicyRequest.new - # - # # Call the update_network_policy method. - # result = client.update_network_policy 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 update_network_policy request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::UpdateNetworkPolicyRequest - - # Converts hash 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_network_policy.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::VmwareEngine::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_network_policy.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_network_policy.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vmware_engine_stub.update_network_policy 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 `NetworkPolicy` resource. A network policy cannot be deleted - # when `NetworkService.state` is set to `RECONCILING` for either its external - # IP or internet access service. - # - # @overload delete_network_policy(request, options = nil) - # Pass arguments to `delete_network_policy` via a request object, either of type - # {::Google::Cloud::VmwareEngine::V1::DeleteNetworkPolicyRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VmwareEngine::V1::DeleteNetworkPolicyRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_network_policy(name: nil, request_id: nil) - # Pass arguments to `delete_network_policy` via keyword arguments. Note that at - # least one keyword argument is 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 network policy to delete. - # Resource names are schemeless URIs that follow the conventions in - # https://cloud.google.com/apis/design/resource_names. - # For example: - # `projects/my-project/locations/us-central1/networkPolicies/my-network-policy` - # @param request_id [::String] - # Optional. A request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server guarantees that a - # request doesn't result in creation of duplicate commitments for at least 60 - # minutes. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @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/vmware_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VmwareEngine::V1::DeleteNetworkPolicyRequest.new - # - # # Call the delete_network_policy method. - # result = client.delete_network_policy 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_network_policy request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::DeleteNetworkPolicyRequest - - # Converts hash 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_network_policy.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::VmwareEngine::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_network_policy.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_network_policy.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vmware_engine_stub.delete_network_policy 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 - - ## - # Lists Consumer VPCs bound to Management DNS Zone of a given private cloud. - # - # @overload list_management_dns_zone_bindings(request, options = nil) - # Pass arguments to `list_management_dns_zone_bindings` via a request object, either of type - # {::Google::Cloud::VmwareEngine::V1::ListManagementDnsZoneBindingsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VmwareEngine::V1::ListManagementDnsZoneBindingsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_management_dns_zone_bindings(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) - # Pass arguments to `list_management_dns_zone_bindings` via keyword arguments. Note that at - # least one keyword argument is 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 private cloud to be queried for - # management DNS zone bindings. - # Resource names are schemeless URIs that follow the conventions in - # https://cloud.google.com/apis/design/resource_names. - # For example: - # `projects/my-project/locations/us-central1-a/privateClouds/my-cloud` - # @param page_size [::Integer] - # The maximum number of management DNS zone bindings to return in one page. - # The service may return fewer than this value. - # The maximum value is coerced to 1000. - # The default value of this field is 500. - # @param page_token [::String] - # A page token, received from a previous `ListManagementDnsZoneBindings` - # call. Provide this to retrieve the subsequent page. - # - # When paginating, all other parameters provided to - # `ListManagementDnsZoneBindings` must match the call that provided the page - # token. - # @param filter [::String] - # A filter expression that matches resources returned in the response. - # The expression must specify the field name, a comparison - # operator, and the value that you want to use for filtering. The value - # must be a string, a number, or a boolean. The comparison operator - # must be `=`, `!=`, `>`, or `<`. - # - # For example, if you are filtering a list of Management DNS Zone Bindings, - # you can exclude the ones named `example-management-dns-zone-binding` by - # specifying `name != "example-management-dns-zone-binding"`. - # - # To filter on multiple expressions, provide each separate expression within - # parentheses. For example: - # ``` - # (name = "example-management-dns-zone-binding") - # (createTime > "2021-04-12T08:15:10.40Z") - # ``` - # - # By default, each expression is an `AND` expression. However, you - # can include `AND` and `OR` expressions explicitly. - # For example: - # ``` - # (name = "example-management-dns-zone-binding-1") AND - # (createTime > "2021-04-12T08:15:10.40Z") OR - # (name = "example-management-dns-zone-binding-2") - # ``` - # @param order_by [::String] - # Sorts list results by a certain order. By default, returned results - # are ordered by `name` in ascending order. - # You can also sort results in descending order based on the `name` value - # using `orderBy="name desc"`. - # Currently, only ordering by `name` is supported. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::VmwareEngine::V1::ManagementDnsZoneBinding>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::VmwareEngine::V1::ManagementDnsZoneBinding>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/vmware_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VmwareEngine::V1::ListManagementDnsZoneBindingsRequest.new - # - # # Call the list_management_dns_zone_bindings method. - # result = client.list_management_dns_zone_bindings 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::VmwareEngine::V1::ManagementDnsZoneBinding. - # p item - # end - # - def list_management_dns_zone_bindings request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::ListManagementDnsZoneBindingsRequest - - # Converts hash 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_management_dns_zone_bindings.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::VmwareEngine::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_management_dns_zone_bindings.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_management_dns_zone_bindings.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vmware_engine_stub.list_management_dns_zone_bindings request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @vmware_engine_stub, :list_management_dns_zone_bindings, "management_dns_zone_bindings", 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 - - ## - # Retrieves a 'ManagementDnsZoneBinding' resource by its resource name. - # - # @overload get_management_dns_zone_binding(request, options = nil) - # Pass arguments to `get_management_dns_zone_binding` via a request object, either of type - # {::Google::Cloud::VmwareEngine::V1::GetManagementDnsZoneBindingRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VmwareEngine::V1::GetManagementDnsZoneBindingRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_management_dns_zone_binding(name: nil) - # Pass arguments to `get_management_dns_zone_binding` via keyword arguments. Note that at - # least one keyword argument is 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 management DNS zone binding to - # retrieve. Resource names are schemeless URIs that follow the conventions in - # https://cloud.google.com/apis/design/resource_names. - # For example: - # `projects/my-project/locations/us-central1-a/privateClouds/my-cloud/managementDnsZoneBindings/my-management-dns-zone-binding` - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::VmwareEngine::V1::ManagementDnsZoneBinding] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::VmwareEngine::V1::ManagementDnsZoneBinding] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/vmware_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VmwareEngine::V1::GetManagementDnsZoneBindingRequest.new - # - # # Call the get_management_dns_zone_binding method. - # result = client.get_management_dns_zone_binding request - # - # # The returned object is of type Google::Cloud::VmwareEngine::V1::ManagementDnsZoneBinding. - # p result - # - def get_management_dns_zone_binding request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::GetManagementDnsZoneBindingRequest - - # Converts hash 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_management_dns_zone_binding.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::VmwareEngine::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_management_dns_zone_binding.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_management_dns_zone_binding.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vmware_engine_stub.get_management_dns_zone_binding 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 `ManagementDnsZoneBinding` resource in a private cloud. - # This RPC creates the DNS binding and the resource that represents the - # DNS binding of the consumer VPC network to the management DNS zone. A - # management DNS zone is the Cloud DNS cross-project binding zone that - # VMware Engine creates for each private cloud. It contains FQDNs and - # corresponding IP addresses for the private cloud's ESXi hosts and - # management VM appliances like vCenter and NSX Manager. - # - # @overload create_management_dns_zone_binding(request, options = nil) - # Pass arguments to `create_management_dns_zone_binding` via a request object, either of type - # {::Google::Cloud::VmwareEngine::V1::CreateManagementDnsZoneBindingRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VmwareEngine::V1::CreateManagementDnsZoneBindingRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_management_dns_zone_binding(parent: nil, management_dns_zone_binding: nil, management_dns_zone_binding_id: nil, request_id: nil) - # Pass arguments to `create_management_dns_zone_binding` via keyword arguments. Note that at - # least one keyword argument is 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 private cloud - # to create a new management DNS zone binding for. - # Resource names are schemeless URIs that follow the conventions in - # https://cloud.google.com/apis/design/resource_names. - # For example: - # `projects/my-project/locations/us-central1-a/privateClouds/my-cloud` - # @param management_dns_zone_binding [::Google::Cloud::VmwareEngine::V1::ManagementDnsZoneBinding, ::Hash] - # Required. The initial values for a new management DNS zone binding. - # @param management_dns_zone_binding_id [::String] - # Required. The user-provided identifier of the `ManagementDnsZoneBinding` - # resource to be created. This identifier must be unique among - # `ManagementDnsZoneBinding` resources within the parent and becomes the - # final token in the name URI. The identifier must meet the following - # requirements: - # - # * Only contains 1-63 alphanumeric characters and hyphens - # * Begins with an alphabetical character - # * Ends with a non-hyphen character - # * Not formatted as a UUID - # * Complies with [RFC 1034](https://datatracker.ietf.org/doc/html/rfc1034) - # (section 3.5) - # @param request_id [::String] - # Optional. A request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server guarantees that a - # request doesn't result in creation of duplicate commitments for at least 60 - # minutes. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request ID, - # the server can check if the original operation with the same request ID was - # received, and if so, will ignore the second request. This prevents clients - # from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @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/vmware_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VmwareEngine::V1::CreateManagementDnsZoneBindingRequest.new - # - # # Call the create_management_dns_zone_binding method. - # result = client.create_management_dns_zone_binding 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_management_dns_zone_binding request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::CreateManagementDnsZoneBindingRequest - - # Converts hash 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_management_dns_zone_binding.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::VmwareEngine::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_management_dns_zone_binding.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_management_dns_zone_binding.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vmware_engine_stub.create_management_dns_zone_binding 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 - - ## - # Updates a `ManagementDnsZoneBinding` resource. - # Only fields specified in `update_mask` are applied. - # - # @overload update_management_dns_zone_binding(request, options = nil) - # Pass arguments to `update_management_dns_zone_binding` via a request object, either of type - # {::Google::Cloud::VmwareEngine::V1::UpdateManagementDnsZoneBindingRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VmwareEngine::V1::UpdateManagementDnsZoneBindingRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_management_dns_zone_binding(update_mask: nil, management_dns_zone_binding: nil, request_id: nil) - # Pass arguments to `update_management_dns_zone_binding` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Required. Field mask is used to specify the fields to be overwritten in the - # `ManagementDnsZoneBinding` resource by the update. - # The fields specified in the `update_mask` are relative to the resource, not - # the full request. A field will be overwritten if it is in the mask. If the - # user does not provide a mask then all fields will be overwritten. - # @param management_dns_zone_binding [::Google::Cloud::VmwareEngine::V1::ManagementDnsZoneBinding, ::Hash] - # Required. New values to update the management DNS zone binding with. - # @param request_id [::String] - # Optional. A request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server guarantees that a - # request doesn't result in creation of duplicate commitments for at least 60 - # minutes. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request ID, - # the server can check if the original operation with the same request ID was - # received, and if so, will ignore the second request. This prevents clients - # from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @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/vmware_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VmwareEngine::V1::UpdateManagementDnsZoneBindingRequest.new - # - # # Call the update_management_dns_zone_binding method. - # result = client.update_management_dns_zone_binding 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 update_management_dns_zone_binding request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::UpdateManagementDnsZoneBindingRequest - - # Converts hash 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_management_dns_zone_binding.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::VmwareEngine::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_management_dns_zone_binding.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_management_dns_zone_binding.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vmware_engine_stub.update_management_dns_zone_binding 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 `ManagementDnsZoneBinding` resource. When a management DNS zone - # binding is deleted, the corresponding consumer VPC network is no longer - # bound to the management DNS zone. - # - # @overload delete_management_dns_zone_binding(request, options = nil) - # Pass arguments to `delete_management_dns_zone_binding` via a request object, either of type - # {::Google::Cloud::VmwareEngine::V1::DeleteManagementDnsZoneBindingRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VmwareEngine::V1::DeleteManagementDnsZoneBindingRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_management_dns_zone_binding(name: nil, request_id: nil) - # Pass arguments to `delete_management_dns_zone_binding` via keyword arguments. Note that at - # least one keyword argument is 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 management DNS zone binding to delete. - # Resource names are schemeless URIs that follow the conventions in - # https://cloud.google.com/apis/design/resource_names. - # For example: - # `projects/my-project/locations/us-central1-a/privateClouds/my-cloud/managementDnsZoneBindings/my-management-dns-zone-binding` - # @param request_id [::String] - # Optional. A request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server guarantees that a - # request doesn't result in creation of duplicate commitments for at least 60 - # minutes. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request - # ID, the server can check if the original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @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/vmware_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VmwareEngine::V1::DeleteManagementDnsZoneBindingRequest.new - # - # # Call the delete_management_dns_zone_binding method. - # result = client.delete_management_dns_zone_binding 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_management_dns_zone_binding request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::DeleteManagementDnsZoneBindingRequest - - # Converts hash 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_management_dns_zone_binding.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::VmwareEngine::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_management_dns_zone_binding.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_management_dns_zone_binding.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vmware_engine_stub.delete_management_dns_zone_binding 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 - - ## - # Retries to create a `ManagementDnsZoneBinding` resource that is - # in failed state. - # - # @overload repair_management_dns_zone_binding(request, options = nil) - # Pass arguments to `repair_management_dns_zone_binding` via a request object, either of type - # {::Google::Cloud::VmwareEngine::V1::RepairManagementDnsZoneBindingRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VmwareEngine::V1::RepairManagementDnsZoneBindingRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload repair_management_dns_zone_binding(name: nil, request_id: nil) - # Pass arguments to `repair_management_dns_zone_binding` via keyword arguments. Note that at - # least one keyword argument is 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 management DNS zone binding to repair. - # Resource names are schemeless URIs that follow the conventions in - # https://cloud.google.com/apis/design/resource_names. - # For example: - # `projects/my-project/locations/us-central1-a/privateClouds/my-cloud/managementDnsZoneBindings/my-management-dns-zone-binding` - # @param request_id [::String] - # Optional. A request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server guarantees that a - # request doesn't result in creation of duplicate commitments for at least 60 - # minutes. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request ID, - # the server can check if the original operation with the same request ID was - # received, and if so, will ignore the second request. This prevents clients - # from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @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/vmware_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VmwareEngine::V1::RepairManagementDnsZoneBindingRequest.new - # - # # Call the repair_management_dns_zone_binding method. - # result = client.repair_management_dns_zone_binding 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 repair_management_dns_zone_binding request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::RepairManagementDnsZoneBindingRequest - - # Converts hash 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.repair_management_dns_zone_binding.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::VmwareEngine::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.repair_management_dns_zone_binding.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.repair_management_dns_zone_binding.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vmware_engine_stub.repair_management_dns_zone_binding 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 VMware Engine network that can be used by a private cloud. - # - # @overload create_vmware_engine_network(request, options = nil) - # Pass arguments to `create_vmware_engine_network` via a request object, either of type - # {::Google::Cloud::VmwareEngine::V1::CreateVmwareEngineNetworkRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VmwareEngine::V1::CreateVmwareEngineNetworkRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_vmware_engine_network(parent: nil, vmware_engine_network_id: nil, vmware_engine_network: nil, request_id: nil) - # Pass arguments to `create_vmware_engine_network` via keyword arguments. Note that at - # least one keyword argument is 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 to create the new VMware Engine - # network in. A VMware Engine network of type - # `LEGACY` is a regional resource, and a VMware - # Engine network of type `STANDARD` is a global resource. - # Resource names are schemeless URIs that follow the conventions in - # https://cloud.google.com/apis/design/resource_names. For example: - # `projects/my-project/locations/global` - # @param vmware_engine_network_id [::String] - # Required. The user-provided identifier of the new VMware Engine network. - # This identifier must be unique among VMware Engine network resources - # within the parent and becomes the final token in the name URI. The - # identifier must meet the following requirements: - # - # * For networks of type LEGACY, adheres to the format: - # `{region-id}-default`. Replace `{region-id}` with the region where you want - # to create the VMware Engine network. For example, "us-central1-default". - # * Only contains 1-63 alphanumeric characters and hyphens - # * Begins with an alphabetical character - # * Ends with a non-hyphen character - # * Not formatted as a UUID - # * Complies with [RFC 1034](https://datatracker.ietf.org/doc/html/rfc1034) - # (section 3.5) - # @param vmware_engine_network [::Google::Cloud::VmwareEngine::V1::VmwareEngineNetwork, ::Hash] - # Required. The initial description of the new VMware Engine network. - # @param request_id [::String] - # Optional. A request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server guarantees that a - # request doesn't result in creation of duplicate commitments for at least 60 - # minutes. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @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/vmware_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VmwareEngine::V1::CreateVmwareEngineNetworkRequest.new - # - # # Call the create_vmware_engine_network method. - # result = client.create_vmware_engine_network 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_vmware_engine_network request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::CreateVmwareEngineNetworkRequest - - # Converts hash 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_vmware_engine_network.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::VmwareEngine::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_vmware_engine_network.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_vmware_engine_network.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vmware_engine_stub.create_vmware_engine_network 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 - - ## - # Modifies a VMware Engine network resource. Only the following fields can be - # updated: `description`. Only fields specified in `updateMask` are - # applied. - # - # @overload update_vmware_engine_network(request, options = nil) - # Pass arguments to `update_vmware_engine_network` via a request object, either of type - # {::Google::Cloud::VmwareEngine::V1::UpdateVmwareEngineNetworkRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VmwareEngine::V1::UpdateVmwareEngineNetworkRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_vmware_engine_network(vmware_engine_network: nil, update_mask: nil, request_id: nil) - # Pass arguments to `update_vmware_engine_network` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param vmware_engine_network [::Google::Cloud::VmwareEngine::V1::VmwareEngineNetwork, ::Hash] - # Required. VMware Engine network description. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Required. Field mask is used to specify the fields to be overwritten in the - # VMware Engine network resource by the update. - # The fields specified in the `update_mask` are relative to the resource, not - # the full request. A field will be overwritten if it is in the mask. If the - # user does not provide a mask then all fields will be overwritten. Only the - # following fields can be updated: `description`. - # @param request_id [::String] - # Optional. A request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server guarantees that a - # request doesn't result in creation of duplicate commitments for at least 60 - # minutes. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @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/vmware_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VmwareEngine::V1::UpdateVmwareEngineNetworkRequest.new - # - # # Call the update_vmware_engine_network method. - # result = client.update_vmware_engine_network 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 update_vmware_engine_network request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::UpdateVmwareEngineNetworkRequest - - # Converts hash 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_vmware_engine_network.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::VmwareEngine::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_vmware_engine_network.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_vmware_engine_network.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vmware_engine_stub.update_vmware_engine_network 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 `VmwareEngineNetwork` resource. You can only delete a VMware - # Engine network after all resources that refer to it are deleted. For - # example, a private cloud, a network peering, and a network policy can all - # refer to the same VMware Engine network. - # - # @overload delete_vmware_engine_network(request, options = nil) - # Pass arguments to `delete_vmware_engine_network` via a request object, either of type - # {::Google::Cloud::VmwareEngine::V1::DeleteVmwareEngineNetworkRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VmwareEngine::V1::DeleteVmwareEngineNetworkRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_vmware_engine_network(name: nil, request_id: nil, etag: nil) - # Pass arguments to `delete_vmware_engine_network` via keyword arguments. Note that at - # least one keyword argument is 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 VMware Engine network to be deleted. - # Resource names are schemeless URIs that follow the conventions in - # https://cloud.google.com/apis/design/resource_names. - # For example: - # `projects/my-project/locations/global/vmwareEngineNetworks/my-network` - # @param request_id [::String] - # Optional. A request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server guarantees that a - # request doesn't result in creation of duplicate commitments for at least 60 - # minutes. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @param etag [::String] - # Optional. Checksum used to ensure that the user-provided value is up to - # date before the server processes the request. The server compares provided - # checksum with the current checksum of the resource. If the user-provided - # value is out of date, this request returns an `ABORTED` error. - # @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/vmware_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VmwareEngine::V1::DeleteVmwareEngineNetworkRequest.new - # - # # Call the delete_vmware_engine_network method. - # result = client.delete_vmware_engine_network 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_vmware_engine_network request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::DeleteVmwareEngineNetworkRequest - - # Converts hash 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_vmware_engine_network.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::VmwareEngine::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_vmware_engine_network.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_vmware_engine_network.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vmware_engine_stub.delete_vmware_engine_network 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 - - ## - # Retrieves a `VmwareEngineNetwork` resource by its resource name. The - # resource contains details of the VMware Engine network, such as its VMware - # Engine network type, peered networks in a service project, and state - # (for example, `CREATING`, `ACTIVE`, `DELETING`). - # - # @overload get_vmware_engine_network(request, options = nil) - # Pass arguments to `get_vmware_engine_network` via a request object, either of type - # {::Google::Cloud::VmwareEngine::V1::GetVmwareEngineNetworkRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VmwareEngine::V1::GetVmwareEngineNetworkRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_vmware_engine_network(name: nil) - # Pass arguments to `get_vmware_engine_network` via keyword arguments. Note that at - # least one keyword argument is 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 VMware Engine network to retrieve. - # Resource names are schemeless URIs that follow the conventions in - # https://cloud.google.com/apis/design/resource_names. - # For example: - # `projects/my-project/locations/global/vmwareEngineNetworks/my-network` - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::VmwareEngine::V1::VmwareEngineNetwork] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::VmwareEngine::V1::VmwareEngineNetwork] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/vmware_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VmwareEngine::V1::GetVmwareEngineNetworkRequest.new - # - # # Call the get_vmware_engine_network method. - # result = client.get_vmware_engine_network request - # - # # The returned object is of type Google::Cloud::VmwareEngine::V1::VmwareEngineNetwork. - # p result - # - def get_vmware_engine_network request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::GetVmwareEngineNetworkRequest - - # Converts hash 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_vmware_engine_network.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::VmwareEngine::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_vmware_engine_network.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_vmware_engine_network.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vmware_engine_stub.get_vmware_engine_network 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 `VmwareEngineNetwork` resources in a given project and location. - # - # @overload list_vmware_engine_networks(request, options = nil) - # Pass arguments to `list_vmware_engine_networks` via a request object, either of type - # {::Google::Cloud::VmwareEngine::V1::ListVmwareEngineNetworksRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VmwareEngine::V1::ListVmwareEngineNetworksRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_vmware_engine_networks(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) - # Pass arguments to `list_vmware_engine_networks` via keyword arguments. Note that at - # least one keyword argument is 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 to query for - # VMware Engine networks. Resource names are schemeless URIs that follow the - # conventions in https://cloud.google.com/apis/design/resource_names. For - # example: `projects/my-project/locations/global` - # @param page_size [::Integer] - # The maximum number of results to return in one page. - # The maximum value is coerced to 1000. - # The default value of this field is 500. - # @param page_token [::String] - # A page token, received from a previous `ListVmwareEngineNetworks` call. - # Provide this to retrieve the subsequent page. - # - # When paginating, all other parameters provided to - # `ListVmwareEngineNetworks` must match the call that provided the page - # token. - # @param filter [::String] - # A filter expression that matches resources returned in the response. - # The expression must specify the field name, a comparison - # operator, and the value that you want to use for filtering. The value - # must be a string, a number, or a boolean. The comparison operator - # must be `=`, `!=`, `>`, or `<`. - # - # For example, if you are filtering a list of network peerings, you can - # exclude the ones named `example-network` by specifying - # `name != "example-network"`. - # - # To filter on multiple expressions, provide each separate expression within - # parentheses. For example: - # ``` - # (name = "example-network") - # (createTime > "2021-04-12T08:15:10.40Z") - # ``` - # - # By default, each expression is an `AND` expression. However, you - # can include `AND` and `OR` expressions explicitly. - # For example: - # ``` - # (name = "example-network-1") AND - # (createTime > "2021-04-12T08:15:10.40Z") OR - # (name = "example-network-2") - # ``` - # @param order_by [::String] - # Sorts list results by a certain order. By default, returned results - # are ordered by `name` in ascending order. - # You can also sort results in descending order based on the `name` value - # using `orderBy="name desc"`. - # Currently, only ordering by `name` is supported. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::VmwareEngine::V1::VmwareEngineNetwork>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::VmwareEngine::V1::VmwareEngineNetwork>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/vmware_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VmwareEngine::V1::ListVmwareEngineNetworksRequest.new - # - # # Call the list_vmware_engine_networks method. - # result = client.list_vmware_engine_networks 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::VmwareEngine::V1::VmwareEngineNetwork. - # p item - # end - # - def list_vmware_engine_networks request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::ListVmwareEngineNetworksRequest - - # Converts hash 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_vmware_engine_networks.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::VmwareEngine::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_vmware_engine_networks.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_vmware_engine_networks.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vmware_engine_stub.list_vmware_engine_networks request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @vmware_engine_stub, :list_vmware_engine_networks, "vmware_engine_networks", 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 - - ## - # Creates a new private connection that can be used for accessing private - # Clouds. - # - # @overload create_private_connection(request, options = nil) - # Pass arguments to `create_private_connection` via a request object, either of type - # {::Google::Cloud::VmwareEngine::V1::CreatePrivateConnectionRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VmwareEngine::V1::CreatePrivateConnectionRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_private_connection(parent: nil, private_connection_id: nil, private_connection: nil, request_id: nil) - # Pass arguments to `create_private_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 to create the new private - # connection in. Private connection is a regional resource. - # Resource names are schemeless URIs that follow the conventions in - # https://cloud.google.com/apis/design/resource_names. For example: - # `projects/my-project/locations/us-central1` - # @param private_connection_id [::String] - # Required. The user-provided identifier of the new private connection. - # This identifier must be unique among private connection resources - # within the parent and becomes the final token in the name URI. The - # identifier must meet the following requirements: - # - # * Only contains 1-63 alphanumeric characters and hyphens - # * Begins with an alphabetical character - # * Ends with a non-hyphen character - # * Not formatted as a UUID - # * Complies with [RFC 1034](https://datatracker.ietf.org/doc/html/rfc1034) - # (section 3.5) - # @param private_connection [::Google::Cloud::VmwareEngine::V1::PrivateConnection, ::Hash] - # Required. The initial description of the new private connection. - # @param request_id [::String] - # Optional. A request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server guarantees that a - # request doesn't result in creation of duplicate commitments for at least 60 - # minutes. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @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/vmware_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VmwareEngine::V1::CreatePrivateConnectionRequest.new - # - # # Call the create_private_connection method. - # result = client.create_private_connection 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_private_connection request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::CreatePrivateConnectionRequest - - # Converts hash 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_private_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::VmwareEngine::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_private_connection.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_private_connection.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vmware_engine_stub.create_private_connection 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 - - ## - # Retrieves a `PrivateConnection` resource by its resource name. The resource - # contains details of the private connection, such as connected - # network, routing mode and state. - # - # @overload get_private_connection(request, options = nil) - # Pass arguments to `get_private_connection` via a request object, either of type - # {::Google::Cloud::VmwareEngine::V1::GetPrivateConnectionRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VmwareEngine::V1::GetPrivateConnectionRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_private_connection(name: nil) - # Pass arguments to `get_private_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 resource name of the private connection to retrieve. - # Resource names are schemeless URIs that follow the conventions in - # https://cloud.google.com/apis/design/resource_names. - # For example: - # `projects/my-project/locations/us-central1/privateConnections/my-connection` - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::VmwareEngine::V1::PrivateConnection] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::VmwareEngine::V1::PrivateConnection] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/vmware_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VmwareEngine::V1::GetPrivateConnectionRequest.new - # - # # Call the get_private_connection method. - # result = client.get_private_connection request - # - # # The returned object is of type Google::Cloud::VmwareEngine::V1::PrivateConnection. - # p result - # - def get_private_connection request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::GetPrivateConnectionRequest - - # Converts hash 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_private_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::VmwareEngine::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_private_connection.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_private_connection.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vmware_engine_stub.get_private_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 - - ## - # Lists `PrivateConnection` resources in a given project and location. - # - # @overload list_private_connections(request, options = nil) - # Pass arguments to `list_private_connections` via a request object, either of type - # {::Google::Cloud::VmwareEngine::V1::ListPrivateConnectionsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VmwareEngine::V1::ListPrivateConnectionsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_private_connections(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) - # Pass arguments to `list_private_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 to query for - # private connections. Resource names are schemeless URIs that follow the - # conventions in https://cloud.google.com/apis/design/resource_names. For - # example: `projects/my-project/locations/us-central1` - # @param page_size [::Integer] - # The maximum number of private connections to return in one page. - # The maximum value is coerced to 1000. - # The default value of this field is 500. - # @param page_token [::String] - # A page token, received from a previous `ListPrivateConnections` call. - # Provide this to retrieve the subsequent page. - # - # When paginating, all other parameters provided to - # `ListPrivateConnections` must match the call that provided the page - # token. - # @param filter [::String] - # A filter expression that matches resources returned in the response. - # The expression must specify the field name, a comparison - # operator, and the value that you want to use for filtering. The value - # must be a string, a number, or a boolean. The comparison operator - # must be `=`, `!=`, `>`, or `<`. - # - # For example, if you are filtering a list of private connections, you can - # exclude the ones named `example-connection` by specifying - # `name != "example-connection"`. - # - # To filter on multiple expressions, provide each separate expression within - # parentheses. For example: - # ``` - # (name = "example-connection") - # (createTime > "2022-09-22T08:15:10.40Z") - # ``` - # - # By default, each expression is an `AND` expression. However, you - # can include `AND` and `OR` expressions explicitly. - # For example: - # ``` - # (name = "example-connection-1") AND - # (createTime > "2021-04-12T08:15:10.40Z") OR - # (name = "example-connection-2") - # ``` - # @param order_by [::String] - # Sorts list results by a certain order. By default, returned results - # are ordered by `name` in ascending order. - # You can also sort results in descending order based on the `name` value - # using `orderBy="name desc"`. - # Currently, only ordering by `name` is supported. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::VmwareEngine::V1::PrivateConnection>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::VmwareEngine::V1::PrivateConnection>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/vmware_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VmwareEngine::V1::ListPrivateConnectionsRequest.new - # - # # Call the list_private_connections method. - # result = client.list_private_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::VmwareEngine::V1::PrivateConnection. - # p item - # end - # - def list_private_connections request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::ListPrivateConnectionsRequest - - # Converts hash 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_private_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::VmwareEngine::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_private_connections.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_private_connections.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vmware_engine_stub.list_private_connections request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @vmware_engine_stub, :list_private_connections, "private_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 - - ## - # Modifies a `PrivateConnection` resource. Only `description` and - # `routing_mode` fields can be updated. Only fields specified in `updateMask` - # are applied. - # - # @overload update_private_connection(request, options = nil) - # Pass arguments to `update_private_connection` via a request object, either of type - # {::Google::Cloud::VmwareEngine::V1::UpdatePrivateConnectionRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VmwareEngine::V1::UpdatePrivateConnectionRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_private_connection(private_connection: nil, update_mask: nil, request_id: nil) - # Pass arguments to `update_private_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 private_connection [::Google::Cloud::VmwareEngine::V1::PrivateConnection, ::Hash] - # Required. Private connection description. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Required. Field mask is used to specify the fields to be overwritten in the - # `PrivateConnection` resource by the update. - # The fields specified in the `update_mask` are relative to the resource, not - # the full request. A field will be overwritten if it is in the mask. If the - # user does not provide a mask then all fields will be overwritten. - # @param request_id [::String] - # Optional. A request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server guarantees that a - # request doesn't result in creation of duplicate commitments for at least 60 - # minutes. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @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/vmware_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VmwareEngine::V1::UpdatePrivateConnectionRequest.new - # - # # Call the update_private_connection method. - # result = client.update_private_connection 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 update_private_connection request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::UpdatePrivateConnectionRequest - - # Converts hash 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_private_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::VmwareEngine::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_private_connection.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_private_connection.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vmware_engine_stub.update_private_connection 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 `PrivateConnection` resource. When a private connection is - # deleted for a VMware Engine network, the connected network becomes - # inaccessible to that VMware Engine network. - # - # @overload delete_private_connection(request, options = nil) - # Pass arguments to `delete_private_connection` via a request object, either of type - # {::Google::Cloud::VmwareEngine::V1::DeletePrivateConnectionRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VmwareEngine::V1::DeletePrivateConnectionRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_private_connection(name: nil, request_id: nil) - # Pass arguments to `delete_private_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 resource name of the private connection to be deleted. - # Resource names are schemeless URIs that follow the conventions in - # https://cloud.google.com/apis/design/resource_names. - # For example: - # `projects/my-project/locations/us-central1/privateConnections/my-connection` - # @param request_id [::String] - # Optional. A request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server guarantees that a - # request doesn't result in creation of duplicate commitments for at least 60 - # minutes. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @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/vmware_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VmwareEngine::V1::DeletePrivateConnectionRequest.new - # - # # Call the delete_private_connection method. - # result = client.delete_private_connection 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_private_connection request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::DeletePrivateConnectionRequest - - # Converts hash 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_private_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::VmwareEngine::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_private_connection.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_private_connection.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vmware_engine_stub.delete_private_connection 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 - - ## - # Lists the private connection routes exchanged over a peering connection. - # - # @overload list_private_connection_peering_routes(request, options = nil) - # Pass arguments to `list_private_connection_peering_routes` via a request object, either of type - # {::Google::Cloud::VmwareEngine::V1::ListPrivateConnectionPeeringRoutesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VmwareEngine::V1::ListPrivateConnectionPeeringRoutesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_private_connection_peering_routes(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_private_connection_peering_routes` via keyword arguments. Note that at - # least one keyword argument is 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 private connection to retrieve peering - # routes from. Resource names are schemeless URIs that follow the conventions - # in https://cloud.google.com/apis/design/resource_names. For example: - # `projects/my-project/locations/us-west1/privateConnections/my-connection` - # @param page_size [::Integer] - # The maximum number of peering routes to return in one page. - # The service may return fewer than this value. - # The maximum value is coerced to 1000. - # The default value of this field is 500. - # @param page_token [::String] - # A page token, received from a previous `ListPrivateConnectionPeeringRoutes` - # call. Provide this to retrieve the subsequent page. When paginating, all - # other parameters provided to `ListPrivateConnectionPeeringRoutes` must - # match the call that provided the page token. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::VmwareEngine::V1::PeeringRoute>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::VmwareEngine::V1::PeeringRoute>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/vmware_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VmwareEngine::V1::ListPrivateConnectionPeeringRoutesRequest.new - # - # # Call the list_private_connection_peering_routes method. - # result = client.list_private_connection_peering_routes 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::VmwareEngine::V1::PeeringRoute. - # p item - # end - # - def list_private_connection_peering_routes request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::ListPrivateConnectionPeeringRoutesRequest - - # Converts hash 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_private_connection_peering_routes.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::VmwareEngine::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_private_connection_peering_routes.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_private_connection_peering_routes.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vmware_engine_stub.list_private_connection_peering_routes request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @vmware_engine_stub, :list_private_connection_peering_routes, "peering_routes", 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 - - ## - # Grants the bind permission to the customer provided principal(user / - # service account) to bind their DNS zone with the intranet VPC associated - # with the project. DnsBindPermission is a global resource and location can - # only be global. - # - # @overload grant_dns_bind_permission(request, options = nil) - # Pass arguments to `grant_dns_bind_permission` via a request object, either of type - # {::Google::Cloud::VmwareEngine::V1::GrantDnsBindPermissionRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VmwareEngine::V1::GrantDnsBindPermissionRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload grant_dns_bind_permission(name: nil, principal: nil, request_id: nil) - # Pass arguments to `grant_dns_bind_permission` via keyword arguments. Note that at - # least one keyword argument is 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 name of the resource which stores the users/service accounts - # having the permission to bind to the corresponding intranet VPC of the - # consumer project. DnsBindPermission is a global resource. Resource names - # are schemeless URIs that follow the conventions in - # https://cloud.google.com/apis/design/resource_names. For example: - # `projects/my-project/locations/global/dnsBindPermission` - # @param principal [::Google::Cloud::VmwareEngine::V1::Principal, ::Hash] - # Required. The consumer provided user/service account which needs to be - # granted permission to bind with the intranet VPC corresponding to the - # consumer project. - # @param request_id [::String] - # Optional. A request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server guarantees that a - # request doesn't result in creation of duplicate commitments for at least 60 - # minutes. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @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/vmware_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VmwareEngine::V1::GrantDnsBindPermissionRequest.new - # - # # Call the grant_dns_bind_permission method. - # result = client.grant_dns_bind_permission 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 grant_dns_bind_permission request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::GrantDnsBindPermissionRequest - - # Converts hash 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.grant_dns_bind_permission.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::VmwareEngine::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.grant_dns_bind_permission.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.grant_dns_bind_permission.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vmware_engine_stub.grant_dns_bind_permission 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 - - ## - # Gets all the principals having bind permission on the intranet VPC - # associated with the consumer project granted by the Grant API. - # DnsBindPermission is a global resource and location can only be global. - # - # @overload get_dns_bind_permission(request, options = nil) - # Pass arguments to `get_dns_bind_permission` via a request object, either of type - # {::Google::Cloud::VmwareEngine::V1::GetDnsBindPermissionRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VmwareEngine::V1::GetDnsBindPermissionRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_dns_bind_permission(name: nil) - # Pass arguments to `get_dns_bind_permission` via keyword arguments. Note that at - # least one keyword argument is 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 name of the resource which stores the users/service accounts - # having the permission to bind to the corresponding intranet VPC of the - # consumer project. DnsBindPermission is a global resource. Resource names - # are schemeless URIs that follow the conventions in - # https://cloud.google.com/apis/design/resource_names. For example: - # `projects/my-project/locations/global/dnsBindPermission` - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::VmwareEngine::V1::DnsBindPermission] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::VmwareEngine::V1::DnsBindPermission] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/vmware_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VmwareEngine::V1::GetDnsBindPermissionRequest.new - # - # # Call the get_dns_bind_permission method. - # result = client.get_dns_bind_permission request - # - # # The returned object is of type Google::Cloud::VmwareEngine::V1::DnsBindPermission. - # p result - # - def get_dns_bind_permission request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::GetDnsBindPermissionRequest - - # Converts hash 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_dns_bind_permission.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::VmwareEngine::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_dns_bind_permission.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_dns_bind_permission.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vmware_engine_stub.get_dns_bind_permission 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 - - ## - # Revokes the bind permission from the customer provided principal(user / - # service account) on the intranet VPC associated with the consumer project. - # DnsBindPermission is a global resource and location can only be global. - # - # @overload revoke_dns_bind_permission(request, options = nil) - # Pass arguments to `revoke_dns_bind_permission` via a request object, either of type - # {::Google::Cloud::VmwareEngine::V1::RevokeDnsBindPermissionRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VmwareEngine::V1::RevokeDnsBindPermissionRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload revoke_dns_bind_permission(name: nil, principal: nil, request_id: nil) - # Pass arguments to `revoke_dns_bind_permission` via keyword arguments. Note that at - # least one keyword argument is 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 name of the resource which stores the users/service accounts - # having the permission to bind to the corresponding intranet VPC of the - # consumer project. DnsBindPermission is a global resource. Resource names - # are schemeless URIs that follow the conventions in - # https://cloud.google.com/apis/design/resource_names. For example: - # `projects/my-project/locations/global/dnsBindPermission` - # @param principal [::Google::Cloud::VmwareEngine::V1::Principal, ::Hash] - # Required. The consumer provided user/service account which needs to be - # granted permission to bind with the intranet VPC corresponding to the - # consumer project. - # @param request_id [::String] - # Optional. A request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server guarantees that a - # request doesn't result in creation of duplicate commitments for at least 60 - # minutes. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @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/vmware_engine/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VmwareEngine::V1::RevokeDnsBindPermissionRequest.new - # - # # Call the revoke_dns_bind_permission method. - # result = client.revoke_dns_bind_permission 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 revoke_dns_bind_permission request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VmwareEngine::V1::RevokeDnsBindPermissionRequest - - # Converts hash 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.revoke_dns_bind_permission.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::VmwareEngine::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.revoke_dns_bind_permission.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.revoke_dns_bind_permission.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vmware_engine_stub.revoke_dns_bind_permission 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 - - ## - # Configuration class for the VmwareEngine REST API. - # - # This class represents the configuration for VmwareEngine 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::VmwareEngine::V1::VmwareEngine::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_private_clouds to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_private_clouds.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_private_clouds.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 = "vmwareengine.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 VmwareEngine 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_private_clouds` - # @return [::Gapic::Config::Method] - # - attr_reader :list_private_clouds - ## - # RPC-specific configuration for `get_private_cloud` - # @return [::Gapic::Config::Method] - # - attr_reader :get_private_cloud - ## - # RPC-specific configuration for `create_private_cloud` - # @return [::Gapic::Config::Method] - # - attr_reader :create_private_cloud - ## - # RPC-specific configuration for `update_private_cloud` - # @return [::Gapic::Config::Method] - # - attr_reader :update_private_cloud - ## - # RPC-specific configuration for `delete_private_cloud` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_private_cloud - ## - # RPC-specific configuration for `undelete_private_cloud` - # @return [::Gapic::Config::Method] - # - attr_reader :undelete_private_cloud - ## - # RPC-specific configuration for `list_clusters` - # @return [::Gapic::Config::Method] - # - attr_reader :list_clusters - ## - # RPC-specific configuration for `get_cluster` - # @return [::Gapic::Config::Method] - # - attr_reader :get_cluster - ## - # RPC-specific configuration for `create_cluster` - # @return [::Gapic::Config::Method] - # - attr_reader :create_cluster - ## - # RPC-specific configuration for `update_cluster` - # @return [::Gapic::Config::Method] - # - attr_reader :update_cluster - ## - # RPC-specific configuration for `delete_cluster` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_cluster - ## - # RPC-specific configuration for `list_nodes` - # @return [::Gapic::Config::Method] - # - attr_reader :list_nodes - ## - # RPC-specific configuration for `get_node` - # @return [::Gapic::Config::Method] - # - attr_reader :get_node - ## - # RPC-specific configuration for `list_external_addresses` - # @return [::Gapic::Config::Method] - # - attr_reader :list_external_addresses - ## - # RPC-specific configuration for `fetch_network_policy_external_addresses` - # @return [::Gapic::Config::Method] - # - attr_reader :fetch_network_policy_external_addresses - ## - # RPC-specific configuration for `get_external_address` - # @return [::Gapic::Config::Method] - # - attr_reader :get_external_address - ## - # RPC-specific configuration for `create_external_address` - # @return [::Gapic::Config::Method] - # - attr_reader :create_external_address - ## - # RPC-specific configuration for `update_external_address` - # @return [::Gapic::Config::Method] - # - attr_reader :update_external_address - ## - # RPC-specific configuration for `delete_external_address` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_external_address - ## - # RPC-specific configuration for `list_subnets` - # @return [::Gapic::Config::Method] - # - attr_reader :list_subnets - ## - # RPC-specific configuration for `get_subnet` - # @return [::Gapic::Config::Method] - # - attr_reader :get_subnet - ## - # RPC-specific configuration for `update_subnet` - # @return [::Gapic::Config::Method] - # - attr_reader :update_subnet - ## - # RPC-specific configuration for `list_external_access_rules` - # @return [::Gapic::Config::Method] - # - attr_reader :list_external_access_rules - ## - # RPC-specific configuration for `get_external_access_rule` - # @return [::Gapic::Config::Method] - # - attr_reader :get_external_access_rule - ## - # RPC-specific configuration for `create_external_access_rule` - # @return [::Gapic::Config::Method] - # - attr_reader :create_external_access_rule - ## - # RPC-specific configuration for `update_external_access_rule` - # @return [::Gapic::Config::Method] - # - attr_reader :update_external_access_rule - ## - # RPC-specific configuration for `delete_external_access_rule` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_external_access_rule - ## - # RPC-specific configuration for `list_logging_servers` - # @return [::Gapic::Config::Method] - # - attr_reader :list_logging_servers - ## - # RPC-specific configuration for `get_logging_server` - # @return [::Gapic::Config::Method] - # - attr_reader :get_logging_server - ## - # RPC-specific configuration for `create_logging_server` - # @return [::Gapic::Config::Method] - # - attr_reader :create_logging_server - ## - # RPC-specific configuration for `update_logging_server` - # @return [::Gapic::Config::Method] - # - attr_reader :update_logging_server - ## - # RPC-specific configuration for `delete_logging_server` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_logging_server - ## - # RPC-specific configuration for `list_node_types` - # @return [::Gapic::Config::Method] - # - attr_reader :list_node_types - ## - # RPC-specific configuration for `get_node_type` - # @return [::Gapic::Config::Method] - # - attr_reader :get_node_type - ## - # RPC-specific configuration for `show_nsx_credentials` - # @return [::Gapic::Config::Method] - # - attr_reader :show_nsx_credentials - ## - # RPC-specific configuration for `show_vcenter_credentials` - # @return [::Gapic::Config::Method] - # - attr_reader :show_vcenter_credentials - ## - # RPC-specific configuration for `reset_nsx_credentials` - # @return [::Gapic::Config::Method] - # - attr_reader :reset_nsx_credentials - ## - # RPC-specific configuration for `reset_vcenter_credentials` - # @return [::Gapic::Config::Method] - # - attr_reader :reset_vcenter_credentials - ## - # RPC-specific configuration for `get_dns_forwarding` - # @return [::Gapic::Config::Method] - # - attr_reader :get_dns_forwarding - ## - # RPC-specific configuration for `update_dns_forwarding` - # @return [::Gapic::Config::Method] - # - attr_reader :update_dns_forwarding - ## - # RPC-specific configuration for `get_network_peering` - # @return [::Gapic::Config::Method] - # - attr_reader :get_network_peering - ## - # RPC-specific configuration for `list_network_peerings` - # @return [::Gapic::Config::Method] - # - attr_reader :list_network_peerings - ## - # RPC-specific configuration for `create_network_peering` - # @return [::Gapic::Config::Method] - # - attr_reader :create_network_peering - ## - # RPC-specific configuration for `delete_network_peering` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_network_peering - ## - # RPC-specific configuration for `update_network_peering` - # @return [::Gapic::Config::Method] - # - attr_reader :update_network_peering - ## - # RPC-specific configuration for `list_peering_routes` - # @return [::Gapic::Config::Method] - # - attr_reader :list_peering_routes - ## - # RPC-specific configuration for `create_hcx_activation_key` - # @return [::Gapic::Config::Method] - # - attr_reader :create_hcx_activation_key - ## - # RPC-specific configuration for `list_hcx_activation_keys` - # @return [::Gapic::Config::Method] - # - attr_reader :list_hcx_activation_keys - ## - # RPC-specific configuration for `get_hcx_activation_key` - # @return [::Gapic::Config::Method] - # - attr_reader :get_hcx_activation_key - ## - # RPC-specific configuration for `get_network_policy` - # @return [::Gapic::Config::Method] - # - attr_reader :get_network_policy - ## - # RPC-specific configuration for `list_network_policies` - # @return [::Gapic::Config::Method] - # - attr_reader :list_network_policies - ## - # RPC-specific configuration for `create_network_policy` - # @return [::Gapic::Config::Method] - # - attr_reader :create_network_policy - ## - # RPC-specific configuration for `update_network_policy` - # @return [::Gapic::Config::Method] - # - attr_reader :update_network_policy - ## - # RPC-specific configuration for `delete_network_policy` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_network_policy - ## - # RPC-specific configuration for `list_management_dns_zone_bindings` - # @return [::Gapic::Config::Method] - # - attr_reader :list_management_dns_zone_bindings - ## - # RPC-specific configuration for `get_management_dns_zone_binding` - # @return [::Gapic::Config::Method] - # - attr_reader :get_management_dns_zone_binding - ## - # RPC-specific configuration for `create_management_dns_zone_binding` - # @return [::Gapic::Config::Method] - # - attr_reader :create_management_dns_zone_binding - ## - # RPC-specific configuration for `update_management_dns_zone_binding` - # @return [::Gapic::Config::Method] - # - attr_reader :update_management_dns_zone_binding - ## - # RPC-specific configuration for `delete_management_dns_zone_binding` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_management_dns_zone_binding - ## - # RPC-specific configuration for `repair_management_dns_zone_binding` - # @return [::Gapic::Config::Method] - # - attr_reader :repair_management_dns_zone_binding - ## - # RPC-specific configuration for `create_vmware_engine_network` - # @return [::Gapic::Config::Method] - # - attr_reader :create_vmware_engine_network - ## - # RPC-specific configuration for `update_vmware_engine_network` - # @return [::Gapic::Config::Method] - # - attr_reader :update_vmware_engine_network - ## - # RPC-specific configuration for `delete_vmware_engine_network` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_vmware_engine_network - ## - # RPC-specific configuration for `get_vmware_engine_network` - # @return [::Gapic::Config::Method] - # - attr_reader :get_vmware_engine_network - ## - # RPC-specific configuration for `list_vmware_engine_networks` - # @return [::Gapic::Config::Method] - # - attr_reader :list_vmware_engine_networks - ## - # RPC-specific configuration for `create_private_connection` - # @return [::Gapic::Config::Method] - # - attr_reader :create_private_connection - ## - # RPC-specific configuration for `get_private_connection` - # @return [::Gapic::Config::Method] - # - attr_reader :get_private_connection - ## - # RPC-specific configuration for `list_private_connections` - # @return [::Gapic::Config::Method] - # - attr_reader :list_private_connections - ## - # RPC-specific configuration for `update_private_connection` - # @return [::Gapic::Config::Method] - # - attr_reader :update_private_connection - ## - # RPC-specific configuration for `delete_private_connection` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_private_connection - ## - # RPC-specific configuration for `list_private_connection_peering_routes` - # @return [::Gapic::Config::Method] - # - attr_reader :list_private_connection_peering_routes - ## - # RPC-specific configuration for `grant_dns_bind_permission` - # @return [::Gapic::Config::Method] - # - attr_reader :grant_dns_bind_permission - ## - # RPC-specific configuration for `get_dns_bind_permission` - # @return [::Gapic::Config::Method] - # - attr_reader :get_dns_bind_permission - ## - # RPC-specific configuration for `revoke_dns_bind_permission` - # @return [::Gapic::Config::Method] - # - attr_reader :revoke_dns_bind_permission - - # @private - def initialize parent_rpcs = nil - list_private_clouds_config = parent_rpcs.list_private_clouds if parent_rpcs.respond_to? :list_private_clouds - @list_private_clouds = ::Gapic::Config::Method.new list_private_clouds_config - get_private_cloud_config = parent_rpcs.get_private_cloud if parent_rpcs.respond_to? :get_private_cloud - @get_private_cloud = ::Gapic::Config::Method.new get_private_cloud_config - create_private_cloud_config = parent_rpcs.create_private_cloud if parent_rpcs.respond_to? :create_private_cloud - @create_private_cloud = ::Gapic::Config::Method.new create_private_cloud_config - update_private_cloud_config = parent_rpcs.update_private_cloud if parent_rpcs.respond_to? :update_private_cloud - @update_private_cloud = ::Gapic::Config::Method.new update_private_cloud_config - delete_private_cloud_config = parent_rpcs.delete_private_cloud if parent_rpcs.respond_to? :delete_private_cloud - @delete_private_cloud = ::Gapic::Config::Method.new delete_private_cloud_config - undelete_private_cloud_config = parent_rpcs.undelete_private_cloud if parent_rpcs.respond_to? :undelete_private_cloud - @undelete_private_cloud = ::Gapic::Config::Method.new undelete_private_cloud_config - list_clusters_config = parent_rpcs.list_clusters if parent_rpcs.respond_to? :list_clusters - @list_clusters = ::Gapic::Config::Method.new list_clusters_config - get_cluster_config = parent_rpcs.get_cluster if parent_rpcs.respond_to? :get_cluster - @get_cluster = ::Gapic::Config::Method.new get_cluster_config - create_cluster_config = parent_rpcs.create_cluster if parent_rpcs.respond_to? :create_cluster - @create_cluster = ::Gapic::Config::Method.new create_cluster_config - update_cluster_config = parent_rpcs.update_cluster if parent_rpcs.respond_to? :update_cluster - @update_cluster = ::Gapic::Config::Method.new update_cluster_config - delete_cluster_config = parent_rpcs.delete_cluster if parent_rpcs.respond_to? :delete_cluster - @delete_cluster = ::Gapic::Config::Method.new delete_cluster_config - list_nodes_config = parent_rpcs.list_nodes if parent_rpcs.respond_to? :list_nodes - @list_nodes = ::Gapic::Config::Method.new list_nodes_config - get_node_config = parent_rpcs.get_node if parent_rpcs.respond_to? :get_node - @get_node = ::Gapic::Config::Method.new get_node_config - list_external_addresses_config = parent_rpcs.list_external_addresses if parent_rpcs.respond_to? :list_external_addresses - @list_external_addresses = ::Gapic::Config::Method.new list_external_addresses_config - fetch_network_policy_external_addresses_config = parent_rpcs.fetch_network_policy_external_addresses if parent_rpcs.respond_to? :fetch_network_policy_external_addresses - @fetch_network_policy_external_addresses = ::Gapic::Config::Method.new fetch_network_policy_external_addresses_config - get_external_address_config = parent_rpcs.get_external_address if parent_rpcs.respond_to? :get_external_address - @get_external_address = ::Gapic::Config::Method.new get_external_address_config - create_external_address_config = parent_rpcs.create_external_address if parent_rpcs.respond_to? :create_external_address - @create_external_address = ::Gapic::Config::Method.new create_external_address_config - update_external_address_config = parent_rpcs.update_external_address if parent_rpcs.respond_to? :update_external_address - @update_external_address = ::Gapic::Config::Method.new update_external_address_config - delete_external_address_config = parent_rpcs.delete_external_address if parent_rpcs.respond_to? :delete_external_address - @delete_external_address = ::Gapic::Config::Method.new delete_external_address_config - list_subnets_config = parent_rpcs.list_subnets if parent_rpcs.respond_to? :list_subnets - @list_subnets = ::Gapic::Config::Method.new list_subnets_config - get_subnet_config = parent_rpcs.get_subnet if parent_rpcs.respond_to? :get_subnet - @get_subnet = ::Gapic::Config::Method.new get_subnet_config - update_subnet_config = parent_rpcs.update_subnet if parent_rpcs.respond_to? :update_subnet - @update_subnet = ::Gapic::Config::Method.new update_subnet_config - list_external_access_rules_config = parent_rpcs.list_external_access_rules if parent_rpcs.respond_to? :list_external_access_rules - @list_external_access_rules = ::Gapic::Config::Method.new list_external_access_rules_config - get_external_access_rule_config = parent_rpcs.get_external_access_rule if parent_rpcs.respond_to? :get_external_access_rule - @get_external_access_rule = ::Gapic::Config::Method.new get_external_access_rule_config - create_external_access_rule_config = parent_rpcs.create_external_access_rule if parent_rpcs.respond_to? :create_external_access_rule - @create_external_access_rule = ::Gapic::Config::Method.new create_external_access_rule_config - update_external_access_rule_config = parent_rpcs.update_external_access_rule if parent_rpcs.respond_to? :update_external_access_rule - @update_external_access_rule = ::Gapic::Config::Method.new update_external_access_rule_config - delete_external_access_rule_config = parent_rpcs.delete_external_access_rule if parent_rpcs.respond_to? :delete_external_access_rule - @delete_external_access_rule = ::Gapic::Config::Method.new delete_external_access_rule_config - list_logging_servers_config = parent_rpcs.list_logging_servers if parent_rpcs.respond_to? :list_logging_servers - @list_logging_servers = ::Gapic::Config::Method.new list_logging_servers_config - get_logging_server_config = parent_rpcs.get_logging_server if parent_rpcs.respond_to? :get_logging_server - @get_logging_server = ::Gapic::Config::Method.new get_logging_server_config - create_logging_server_config = parent_rpcs.create_logging_server if parent_rpcs.respond_to? :create_logging_server - @create_logging_server = ::Gapic::Config::Method.new create_logging_server_config - update_logging_server_config = parent_rpcs.update_logging_server if parent_rpcs.respond_to? :update_logging_server - @update_logging_server = ::Gapic::Config::Method.new update_logging_server_config - delete_logging_server_config = parent_rpcs.delete_logging_server if parent_rpcs.respond_to? :delete_logging_server - @delete_logging_server = ::Gapic::Config::Method.new delete_logging_server_config - list_node_types_config = parent_rpcs.list_node_types if parent_rpcs.respond_to? :list_node_types - @list_node_types = ::Gapic::Config::Method.new list_node_types_config - get_node_type_config = parent_rpcs.get_node_type if parent_rpcs.respond_to? :get_node_type - @get_node_type = ::Gapic::Config::Method.new get_node_type_config - show_nsx_credentials_config = parent_rpcs.show_nsx_credentials if parent_rpcs.respond_to? :show_nsx_credentials - @show_nsx_credentials = ::Gapic::Config::Method.new show_nsx_credentials_config - show_vcenter_credentials_config = parent_rpcs.show_vcenter_credentials if parent_rpcs.respond_to? :show_vcenter_credentials - @show_vcenter_credentials = ::Gapic::Config::Method.new show_vcenter_credentials_config - reset_nsx_credentials_config = parent_rpcs.reset_nsx_credentials if parent_rpcs.respond_to? :reset_nsx_credentials - @reset_nsx_credentials = ::Gapic::Config::Method.new reset_nsx_credentials_config - reset_vcenter_credentials_config = parent_rpcs.reset_vcenter_credentials if parent_rpcs.respond_to? :reset_vcenter_credentials - @reset_vcenter_credentials = ::Gapic::Config::Method.new reset_vcenter_credentials_config - get_dns_forwarding_config = parent_rpcs.get_dns_forwarding if parent_rpcs.respond_to? :get_dns_forwarding - @get_dns_forwarding = ::Gapic::Config::Method.new get_dns_forwarding_config - update_dns_forwarding_config = parent_rpcs.update_dns_forwarding if parent_rpcs.respond_to? :update_dns_forwarding - @update_dns_forwarding = ::Gapic::Config::Method.new update_dns_forwarding_config - get_network_peering_config = parent_rpcs.get_network_peering if parent_rpcs.respond_to? :get_network_peering - @get_network_peering = ::Gapic::Config::Method.new get_network_peering_config - list_network_peerings_config = parent_rpcs.list_network_peerings if parent_rpcs.respond_to? :list_network_peerings - @list_network_peerings = ::Gapic::Config::Method.new list_network_peerings_config - create_network_peering_config = parent_rpcs.create_network_peering if parent_rpcs.respond_to? :create_network_peering - @create_network_peering = ::Gapic::Config::Method.new create_network_peering_config - delete_network_peering_config = parent_rpcs.delete_network_peering if parent_rpcs.respond_to? :delete_network_peering - @delete_network_peering = ::Gapic::Config::Method.new delete_network_peering_config - update_network_peering_config = parent_rpcs.update_network_peering if parent_rpcs.respond_to? :update_network_peering - @update_network_peering = ::Gapic::Config::Method.new update_network_peering_config - list_peering_routes_config = parent_rpcs.list_peering_routes if parent_rpcs.respond_to? :list_peering_routes - @list_peering_routes = ::Gapic::Config::Method.new list_peering_routes_config - create_hcx_activation_key_config = parent_rpcs.create_hcx_activation_key if parent_rpcs.respond_to? :create_hcx_activation_key - @create_hcx_activation_key = ::Gapic::Config::Method.new create_hcx_activation_key_config - list_hcx_activation_keys_config = parent_rpcs.list_hcx_activation_keys if parent_rpcs.respond_to? :list_hcx_activation_keys - @list_hcx_activation_keys = ::Gapic::Config::Method.new list_hcx_activation_keys_config - get_hcx_activation_key_config = parent_rpcs.get_hcx_activation_key if parent_rpcs.respond_to? :get_hcx_activation_key - @get_hcx_activation_key = ::Gapic::Config::Method.new get_hcx_activation_key_config - get_network_policy_config = parent_rpcs.get_network_policy if parent_rpcs.respond_to? :get_network_policy - @get_network_policy = ::Gapic::Config::Method.new get_network_policy_config - list_network_policies_config = parent_rpcs.list_network_policies if parent_rpcs.respond_to? :list_network_policies - @list_network_policies = ::Gapic::Config::Method.new list_network_policies_config - create_network_policy_config = parent_rpcs.create_network_policy if parent_rpcs.respond_to? :create_network_policy - @create_network_policy = ::Gapic::Config::Method.new create_network_policy_config - update_network_policy_config = parent_rpcs.update_network_policy if parent_rpcs.respond_to? :update_network_policy - @update_network_policy = ::Gapic::Config::Method.new update_network_policy_config - delete_network_policy_config = parent_rpcs.delete_network_policy if parent_rpcs.respond_to? :delete_network_policy - @delete_network_policy = ::Gapic::Config::Method.new delete_network_policy_config - list_management_dns_zone_bindings_config = parent_rpcs.list_management_dns_zone_bindings if parent_rpcs.respond_to? :list_management_dns_zone_bindings - @list_management_dns_zone_bindings = ::Gapic::Config::Method.new list_management_dns_zone_bindings_config - get_management_dns_zone_binding_config = parent_rpcs.get_management_dns_zone_binding if parent_rpcs.respond_to? :get_management_dns_zone_binding - @get_management_dns_zone_binding = ::Gapic::Config::Method.new get_management_dns_zone_binding_config - create_management_dns_zone_binding_config = parent_rpcs.create_management_dns_zone_binding if parent_rpcs.respond_to? :create_management_dns_zone_binding - @create_management_dns_zone_binding = ::Gapic::Config::Method.new create_management_dns_zone_binding_config - update_management_dns_zone_binding_config = parent_rpcs.update_management_dns_zone_binding if parent_rpcs.respond_to? :update_management_dns_zone_binding - @update_management_dns_zone_binding = ::Gapic::Config::Method.new update_management_dns_zone_binding_config - delete_management_dns_zone_binding_config = parent_rpcs.delete_management_dns_zone_binding if parent_rpcs.respond_to? :delete_management_dns_zone_binding - @delete_management_dns_zone_binding = ::Gapic::Config::Method.new delete_management_dns_zone_binding_config - repair_management_dns_zone_binding_config = parent_rpcs.repair_management_dns_zone_binding if parent_rpcs.respond_to? :repair_management_dns_zone_binding - @repair_management_dns_zone_binding = ::Gapic::Config::Method.new repair_management_dns_zone_binding_config - create_vmware_engine_network_config = parent_rpcs.create_vmware_engine_network if parent_rpcs.respond_to? :create_vmware_engine_network - @create_vmware_engine_network = ::Gapic::Config::Method.new create_vmware_engine_network_config - update_vmware_engine_network_config = parent_rpcs.update_vmware_engine_network if parent_rpcs.respond_to? :update_vmware_engine_network - @update_vmware_engine_network = ::Gapic::Config::Method.new update_vmware_engine_network_config - delete_vmware_engine_network_config = parent_rpcs.delete_vmware_engine_network if parent_rpcs.respond_to? :delete_vmware_engine_network - @delete_vmware_engine_network = ::Gapic::Config::Method.new delete_vmware_engine_network_config - get_vmware_engine_network_config = parent_rpcs.get_vmware_engine_network if parent_rpcs.respond_to? :get_vmware_engine_network - @get_vmware_engine_network = ::Gapic::Config::Method.new get_vmware_engine_network_config - list_vmware_engine_networks_config = parent_rpcs.list_vmware_engine_networks if parent_rpcs.respond_to? :list_vmware_engine_networks - @list_vmware_engine_networks = ::Gapic::Config::Method.new list_vmware_engine_networks_config - create_private_connection_config = parent_rpcs.create_private_connection if parent_rpcs.respond_to? :create_private_connection - @create_private_connection = ::Gapic::Config::Method.new create_private_connection_config - get_private_connection_config = parent_rpcs.get_private_connection if parent_rpcs.respond_to? :get_private_connection - @get_private_connection = ::Gapic::Config::Method.new get_private_connection_config - list_private_connections_config = parent_rpcs.list_private_connections if parent_rpcs.respond_to? :list_private_connections - @list_private_connections = ::Gapic::Config::Method.new list_private_connections_config - update_private_connection_config = parent_rpcs.update_private_connection if parent_rpcs.respond_to? :update_private_connection - @update_private_connection = ::Gapic::Config::Method.new update_private_connection_config - delete_private_connection_config = parent_rpcs.delete_private_connection if parent_rpcs.respond_to? :delete_private_connection - @delete_private_connection = ::Gapic::Config::Method.new delete_private_connection_config - list_private_connection_peering_routes_config = parent_rpcs.list_private_connection_peering_routes if parent_rpcs.respond_to? :list_private_connection_peering_routes - @list_private_connection_peering_routes = ::Gapic::Config::Method.new list_private_connection_peering_routes_config - grant_dns_bind_permission_config = parent_rpcs.grant_dns_bind_permission if parent_rpcs.respond_to? :grant_dns_bind_permission - @grant_dns_bind_permission = ::Gapic::Config::Method.new grant_dns_bind_permission_config - get_dns_bind_permission_config = parent_rpcs.get_dns_bind_permission if parent_rpcs.respond_to? :get_dns_bind_permission - @get_dns_bind_permission = ::Gapic::Config::Method.new get_dns_bind_permission_config - revoke_dns_bind_permission_config = parent_rpcs.revoke_dns_bind_permission if parent_rpcs.respond_to? :revoke_dns_bind_permission - @revoke_dns_bind_permission = ::Gapic::Config::Method.new revoke_dns_bind_permission_config - - yield self if block_given? - end - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-vmware_engine-v1/lib/google/cloud/vmware_engine/v1/vmware_engine/rest/operations.rb b/owl-bot-staging/google-cloud-vmware_engine-v1/lib/google/cloud/vmware_engine/v1/vmware_engine/rest/operations.rb deleted file mode 100644 index 81efa22fb432..000000000000 --- a/owl-bot-staging/google-cloud-vmware_engine-v1/lib/google/cloud/vmware_engine/v1/vmware_engine/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 VmwareEngine - module V1 - module VmwareEngine - module Rest - # Service that implements Longrunning Operations API. - class Operations - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "vmwareengine.$UNIVERSE_DOMAIN$" - - # @private - attr_reader :operations_stub - - ## - # Configuration for the VmwareEngine 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 VmwareEngine 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::VmwareEngine::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::VmwareEngine::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::VmwareEngine::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::VmwareEngine::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 = "vmwareengine.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}/operations", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/?$}, 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{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] - ] - ) - 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-vmware_engine-v1/lib/google/cloud/vmware_engine/v1/vmware_engine/rest/service_stub.rb b/owl-bot-staging/google-cloud-vmware_engine-v1/lib/google/cloud/vmware_engine/v1/vmware_engine/rest/service_stub.rb deleted file mode 100644 index 90096c6693c3..000000000000 --- a/owl-bot-staging/google-cloud-vmware_engine-v1/lib/google/cloud/vmware_engine/v1/vmware_engine/rest/service_stub.rb +++ /dev/null @@ -1,4624 +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/vmwareengine/v1/vmwareengine_pb" - -module Google - module Cloud - module VmwareEngine - module V1 - module VmwareEngine - module Rest - ## - # REST service stub for the VmwareEngine 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_private_clouds REST call - # - # @param request_pb [::Google::Cloud::VmwareEngine::V1::ListPrivateCloudsRequest] - # 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::VmwareEngine::V1::ListPrivateCloudsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::VmwareEngine::V1::ListPrivateCloudsResponse] - # A result object deserialized from the server's reply - def list_private_clouds request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_private_clouds_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_private_clouds", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::VmwareEngine::V1::ListPrivateCloudsResponse.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_private_cloud REST call - # - # @param request_pb [::Google::Cloud::VmwareEngine::V1::GetPrivateCloudRequest] - # 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::VmwareEngine::V1::PrivateCloud] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::VmwareEngine::V1::PrivateCloud] - # A result object deserialized from the server's reply - def get_private_cloud request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_private_cloud_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_private_cloud", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::VmwareEngine::V1::PrivateCloud.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_private_cloud REST call - # - # @param request_pb [::Google::Cloud::VmwareEngine::V1::CreatePrivateCloudRequest] - # 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_private_cloud request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_private_cloud_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_private_cloud", - 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 update_private_cloud REST call - # - # @param request_pb [::Google::Cloud::VmwareEngine::V1::UpdatePrivateCloudRequest] - # 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 update_private_cloud request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_private_cloud_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_private_cloud", - 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_private_cloud REST call - # - # @param request_pb [::Google::Cloud::VmwareEngine::V1::DeletePrivateCloudRequest] - # 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_private_cloud request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_delete_private_cloud_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_private_cloud", - 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 undelete_private_cloud REST call - # - # @param request_pb [::Google::Cloud::VmwareEngine::V1::UndeletePrivateCloudRequest] - # 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 undelete_private_cloud request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_undelete_private_cloud_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: "undelete_private_cloud", - 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 list_clusters REST call - # - # @param request_pb [::Google::Cloud::VmwareEngine::V1::ListClustersRequest] - # 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::VmwareEngine::V1::ListClustersResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::VmwareEngine::V1::ListClustersResponse] - # A result object deserialized from the server's reply - def list_clusters request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_clusters_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_clusters", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::VmwareEngine::V1::ListClustersResponse.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_cluster REST call - # - # @param request_pb [::Google::Cloud::VmwareEngine::V1::GetClusterRequest] - # 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::VmwareEngine::V1::Cluster] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::VmwareEngine::V1::Cluster] - # A result object deserialized from the server's reply - def get_cluster request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_cluster_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_cluster", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::VmwareEngine::V1::Cluster.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_cluster REST call - # - # @param request_pb [::Google::Cloud::VmwareEngine::V1::CreateClusterRequest] - # 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_cluster request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_cluster_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_cluster", - 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 update_cluster REST call - # - # @param request_pb [::Google::Cloud::VmwareEngine::V1::UpdateClusterRequest] - # 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 update_cluster request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_cluster_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_cluster", - 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_cluster REST call - # - # @param request_pb [::Google::Cloud::VmwareEngine::V1::DeleteClusterRequest] - # 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_cluster request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_delete_cluster_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_cluster", - 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 list_nodes REST call - # - # @param request_pb [::Google::Cloud::VmwareEngine::V1::ListNodesRequest] - # 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::VmwareEngine::V1::ListNodesResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::VmwareEngine::V1::ListNodesResponse] - # A result object deserialized from the server's reply - def list_nodes request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_nodes_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_nodes", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::VmwareEngine::V1::ListNodesResponse.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_node REST call - # - # @param request_pb [::Google::Cloud::VmwareEngine::V1::GetNodeRequest] - # 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::VmwareEngine::V1::Node] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::VmwareEngine::V1::Node] - # A result object deserialized from the server's reply - def get_node request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_node_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_node", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::VmwareEngine::V1::Node.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_external_addresses REST call - # - # @param request_pb [::Google::Cloud::VmwareEngine::V1::ListExternalAddressesRequest] - # 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::VmwareEngine::V1::ListExternalAddressesResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::VmwareEngine::V1::ListExternalAddressesResponse] - # A result object deserialized from the server's reply - def list_external_addresses request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_external_addresses_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_external_addresses", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::VmwareEngine::V1::ListExternalAddressesResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the fetch_network_policy_external_addresses REST call - # - # @param request_pb [::Google::Cloud::VmwareEngine::V1::FetchNetworkPolicyExternalAddressesRequest] - # 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::VmwareEngine::V1::FetchNetworkPolicyExternalAddressesResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::VmwareEngine::V1::FetchNetworkPolicyExternalAddressesResponse] - # A result object deserialized from the server's reply - def fetch_network_policy_external_addresses request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_fetch_network_policy_external_addresses_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: "fetch_network_policy_external_addresses", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::VmwareEngine::V1::FetchNetworkPolicyExternalAddressesResponse.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_external_address REST call - # - # @param request_pb [::Google::Cloud::VmwareEngine::V1::GetExternalAddressRequest] - # 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::VmwareEngine::V1::ExternalAddress] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::VmwareEngine::V1::ExternalAddress] - # A result object deserialized from the server's reply - def get_external_address request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_external_address_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_external_address", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::VmwareEngine::V1::ExternalAddress.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_external_address REST call - # - # @param request_pb [::Google::Cloud::VmwareEngine::V1::CreateExternalAddressRequest] - # 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_external_address request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_external_address_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_external_address", - 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 update_external_address REST call - # - # @param request_pb [::Google::Cloud::VmwareEngine::V1::UpdateExternalAddressRequest] - # 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 update_external_address request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_external_address_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_external_address", - 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_external_address REST call - # - # @param request_pb [::Google::Cloud::VmwareEngine::V1::DeleteExternalAddressRequest] - # 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_external_address request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_delete_external_address_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_external_address", - 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 list_subnets REST call - # - # @param request_pb [::Google::Cloud::VmwareEngine::V1::ListSubnetsRequest] - # 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::VmwareEngine::V1::ListSubnetsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::VmwareEngine::V1::ListSubnetsResponse] - # A result object deserialized from the server's reply - def list_subnets request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_subnets_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_subnets", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::VmwareEngine::V1::ListSubnetsResponse.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_subnet REST call - # - # @param request_pb [::Google::Cloud::VmwareEngine::V1::GetSubnetRequest] - # 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::VmwareEngine::V1::Subnet] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::VmwareEngine::V1::Subnet] - # A result object deserialized from the server's reply - def get_subnet request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_subnet_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_subnet", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::VmwareEngine::V1::Subnet.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_subnet REST call - # - # @param request_pb [::Google::Cloud::VmwareEngine::V1::UpdateSubnetRequest] - # 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 update_subnet request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_subnet_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_subnet", - 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 list_external_access_rules REST call - # - # @param request_pb [::Google::Cloud::VmwareEngine::V1::ListExternalAccessRulesRequest] - # 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::VmwareEngine::V1::ListExternalAccessRulesResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::VmwareEngine::V1::ListExternalAccessRulesResponse] - # A result object deserialized from the server's reply - def list_external_access_rules request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_external_access_rules_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_external_access_rules", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::VmwareEngine::V1::ListExternalAccessRulesResponse.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_external_access_rule REST call - # - # @param request_pb [::Google::Cloud::VmwareEngine::V1::GetExternalAccessRuleRequest] - # 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::VmwareEngine::V1::ExternalAccessRule] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::VmwareEngine::V1::ExternalAccessRule] - # A result object deserialized from the server's reply - def get_external_access_rule request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_external_access_rule_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_external_access_rule", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::VmwareEngine::V1::ExternalAccessRule.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_external_access_rule REST call - # - # @param request_pb [::Google::Cloud::VmwareEngine::V1::CreateExternalAccessRuleRequest] - # 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_external_access_rule request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_external_access_rule_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_external_access_rule", - 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 update_external_access_rule REST call - # - # @param request_pb [::Google::Cloud::VmwareEngine::V1::UpdateExternalAccessRuleRequest] - # 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 update_external_access_rule request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_external_access_rule_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_external_access_rule", - 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_external_access_rule REST call - # - # @param request_pb [::Google::Cloud::VmwareEngine::V1::DeleteExternalAccessRuleRequest] - # 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_external_access_rule request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_delete_external_access_rule_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_external_access_rule", - 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 list_logging_servers REST call - # - # @param request_pb [::Google::Cloud::VmwareEngine::V1::ListLoggingServersRequest] - # 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::VmwareEngine::V1::ListLoggingServersResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::VmwareEngine::V1::ListLoggingServersResponse] - # A result object deserialized from the server's reply - def list_logging_servers request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_logging_servers_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_logging_servers", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::VmwareEngine::V1::ListLoggingServersResponse.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_logging_server REST call - # - # @param request_pb [::Google::Cloud::VmwareEngine::V1::GetLoggingServerRequest] - # 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::VmwareEngine::V1::LoggingServer] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::VmwareEngine::V1::LoggingServer] - # A result object deserialized from the server's reply - def get_logging_server request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_logging_server_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_logging_server", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::VmwareEngine::V1::LoggingServer.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_logging_server REST call - # - # @param request_pb [::Google::Cloud::VmwareEngine::V1::CreateLoggingServerRequest] - # 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_logging_server request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_logging_server_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_logging_server", - 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 update_logging_server REST call - # - # @param request_pb [::Google::Cloud::VmwareEngine::V1::UpdateLoggingServerRequest] - # 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 update_logging_server request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_logging_server_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_logging_server", - 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_logging_server REST call - # - # @param request_pb [::Google::Cloud::VmwareEngine::V1::DeleteLoggingServerRequest] - # 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_logging_server request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_delete_logging_server_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_logging_server", - 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 list_node_types REST call - # - # @param request_pb [::Google::Cloud::VmwareEngine::V1::ListNodeTypesRequest] - # 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::VmwareEngine::V1::ListNodeTypesResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::VmwareEngine::V1::ListNodeTypesResponse] - # A result object deserialized from the server's reply - def list_node_types request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_node_types_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_node_types", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::VmwareEngine::V1::ListNodeTypesResponse.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_node_type REST call - # - # @param request_pb [::Google::Cloud::VmwareEngine::V1::GetNodeTypeRequest] - # 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::VmwareEngine::V1::NodeType] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::VmwareEngine::V1::NodeType] - # A result object deserialized from the server's reply - def get_node_type request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_node_type_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_node_type", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::VmwareEngine::V1::NodeType.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_nsx_credentials REST call - # - # @param request_pb [::Google::Cloud::VmwareEngine::V1::ShowNsxCredentialsRequest] - # 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::VmwareEngine::V1::Credentials] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::VmwareEngine::V1::Credentials] - # A result object deserialized from the server's reply - def show_nsx_credentials request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_show_nsx_credentials_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_nsx_credentials", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::VmwareEngine::V1::Credentials.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_vcenter_credentials REST call - # - # @param request_pb [::Google::Cloud::VmwareEngine::V1::ShowVcenterCredentialsRequest] - # 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::VmwareEngine::V1::Credentials] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::VmwareEngine::V1::Credentials] - # A result object deserialized from the server's reply - def show_vcenter_credentials request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_show_vcenter_credentials_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_vcenter_credentials", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::VmwareEngine::V1::Credentials.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the reset_nsx_credentials REST call - # - # @param request_pb [::Google::Cloud::VmwareEngine::V1::ResetNsxCredentialsRequest] - # 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 reset_nsx_credentials request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_reset_nsx_credentials_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: "reset_nsx_credentials", - 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 reset_vcenter_credentials REST call - # - # @param request_pb [::Google::Cloud::VmwareEngine::V1::ResetVcenterCredentialsRequest] - # 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 reset_vcenter_credentials request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_reset_vcenter_credentials_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: "reset_vcenter_credentials", - 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_dns_forwarding REST call - # - # @param request_pb [::Google::Cloud::VmwareEngine::V1::GetDnsForwardingRequest] - # 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::VmwareEngine::V1::DnsForwarding] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::VmwareEngine::V1::DnsForwarding] - # A result object deserialized from the server's reply - def get_dns_forwarding request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_dns_forwarding_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_dns_forwarding", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::VmwareEngine::V1::DnsForwarding.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_dns_forwarding REST call - # - # @param request_pb [::Google::Cloud::VmwareEngine::V1::UpdateDnsForwardingRequest] - # 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 update_dns_forwarding request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_dns_forwarding_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_dns_forwarding", - 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_network_peering REST call - # - # @param request_pb [::Google::Cloud::VmwareEngine::V1::GetNetworkPeeringRequest] - # 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::VmwareEngine::V1::NetworkPeering] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::VmwareEngine::V1::NetworkPeering] - # A result object deserialized from the server's reply - def get_network_peering request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_network_peering_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_network_peering", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::VmwareEngine::V1::NetworkPeering.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_network_peerings REST call - # - # @param request_pb [::Google::Cloud::VmwareEngine::V1::ListNetworkPeeringsRequest] - # 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::VmwareEngine::V1::ListNetworkPeeringsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::VmwareEngine::V1::ListNetworkPeeringsResponse] - # A result object deserialized from the server's reply - def list_network_peerings request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_network_peerings_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_network_peerings", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::VmwareEngine::V1::ListNetworkPeeringsResponse.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_network_peering REST call - # - # @param request_pb [::Google::Cloud::VmwareEngine::V1::CreateNetworkPeeringRequest] - # 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_network_peering request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_network_peering_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_network_peering", - 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_network_peering REST call - # - # @param request_pb [::Google::Cloud::VmwareEngine::V1::DeleteNetworkPeeringRequest] - # 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_network_peering request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_delete_network_peering_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_network_peering", - 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 update_network_peering REST call - # - # @param request_pb [::Google::Cloud::VmwareEngine::V1::UpdateNetworkPeeringRequest] - # 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 update_network_peering request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_network_peering_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_network_peering", - 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 list_peering_routes REST call - # - # @param request_pb [::Google::Cloud::VmwareEngine::V1::ListPeeringRoutesRequest] - # 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::VmwareEngine::V1::ListPeeringRoutesResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::VmwareEngine::V1::ListPeeringRoutesResponse] - # A result object deserialized from the server's reply - def list_peering_routes request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_peering_routes_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_peering_routes", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::VmwareEngine::V1::ListPeeringRoutesResponse.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_hcx_activation_key REST call - # - # @param request_pb [::Google::Cloud::VmwareEngine::V1::CreateHcxActivationKeyRequest] - # 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_hcx_activation_key request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_hcx_activation_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_hcx_activation_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 list_hcx_activation_keys REST call - # - # @param request_pb [::Google::Cloud::VmwareEngine::V1::ListHcxActivationKeysRequest] - # 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::VmwareEngine::V1::ListHcxActivationKeysResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::VmwareEngine::V1::ListHcxActivationKeysResponse] - # A result object deserialized from the server's reply - def list_hcx_activation_keys request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_hcx_activation_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_hcx_activation_keys", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::VmwareEngine::V1::ListHcxActivationKeysResponse.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_hcx_activation_key REST call - # - # @param request_pb [::Google::Cloud::VmwareEngine::V1::GetHcxActivationKeyRequest] - # 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::VmwareEngine::V1::HcxActivationKey] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::VmwareEngine::V1::HcxActivationKey] - # A result object deserialized from the server's reply - def get_hcx_activation_key request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_hcx_activation_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_hcx_activation_key", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::VmwareEngine::V1::HcxActivationKey.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_network_policy REST call - # - # @param request_pb [::Google::Cloud::VmwareEngine::V1::GetNetworkPolicyRequest] - # 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::VmwareEngine::V1::NetworkPolicy] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::VmwareEngine::V1::NetworkPolicy] - # A result object deserialized from the server's reply - def get_network_policy request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_network_policy_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_network_policy", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::VmwareEngine::V1::NetworkPolicy.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_network_policies REST call - # - # @param request_pb [::Google::Cloud::VmwareEngine::V1::ListNetworkPoliciesRequest] - # 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::VmwareEngine::V1::ListNetworkPoliciesResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::VmwareEngine::V1::ListNetworkPoliciesResponse] - # A result object deserialized from the server's reply - def list_network_policies request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_network_policies_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_network_policies", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::VmwareEngine::V1::ListNetworkPoliciesResponse.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_network_policy REST call - # - # @param request_pb [::Google::Cloud::VmwareEngine::V1::CreateNetworkPolicyRequest] - # 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_network_policy request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_network_policy_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_network_policy", - 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 update_network_policy REST call - # - # @param request_pb [::Google::Cloud::VmwareEngine::V1::UpdateNetworkPolicyRequest] - # 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 update_network_policy request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_network_policy_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_network_policy", - 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_network_policy REST call - # - # @param request_pb [::Google::Cloud::VmwareEngine::V1::DeleteNetworkPolicyRequest] - # 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_network_policy request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_delete_network_policy_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_network_policy", - 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 list_management_dns_zone_bindings REST call - # - # @param request_pb [::Google::Cloud::VmwareEngine::V1::ListManagementDnsZoneBindingsRequest] - # 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::VmwareEngine::V1::ListManagementDnsZoneBindingsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::VmwareEngine::V1::ListManagementDnsZoneBindingsResponse] - # A result object deserialized from the server's reply - def list_management_dns_zone_bindings request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_management_dns_zone_bindings_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_management_dns_zone_bindings", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::VmwareEngine::V1::ListManagementDnsZoneBindingsResponse.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_management_dns_zone_binding REST call - # - # @param request_pb [::Google::Cloud::VmwareEngine::V1::GetManagementDnsZoneBindingRequest] - # 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::VmwareEngine::V1::ManagementDnsZoneBinding] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::VmwareEngine::V1::ManagementDnsZoneBinding] - # A result object deserialized from the server's reply - def get_management_dns_zone_binding request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_management_dns_zone_binding_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_management_dns_zone_binding", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::VmwareEngine::V1::ManagementDnsZoneBinding.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_management_dns_zone_binding REST call - # - # @param request_pb [::Google::Cloud::VmwareEngine::V1::CreateManagementDnsZoneBindingRequest] - # 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_management_dns_zone_binding request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_management_dns_zone_binding_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_management_dns_zone_binding", - 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 update_management_dns_zone_binding REST call - # - # @param request_pb [::Google::Cloud::VmwareEngine::V1::UpdateManagementDnsZoneBindingRequest] - # 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 update_management_dns_zone_binding request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_management_dns_zone_binding_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_management_dns_zone_binding", - 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_management_dns_zone_binding REST call - # - # @param request_pb [::Google::Cloud::VmwareEngine::V1::DeleteManagementDnsZoneBindingRequest] - # 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_management_dns_zone_binding request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_delete_management_dns_zone_binding_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_management_dns_zone_binding", - 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 repair_management_dns_zone_binding REST call - # - # @param request_pb [::Google::Cloud::VmwareEngine::V1::RepairManagementDnsZoneBindingRequest] - # 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 repair_management_dns_zone_binding request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_repair_management_dns_zone_binding_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: "repair_management_dns_zone_binding", - 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_vmware_engine_network REST call - # - # @param request_pb [::Google::Cloud::VmwareEngine::V1::CreateVmwareEngineNetworkRequest] - # 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_vmware_engine_network request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_vmware_engine_network_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_vmware_engine_network", - 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 update_vmware_engine_network REST call - # - # @param request_pb [::Google::Cloud::VmwareEngine::V1::UpdateVmwareEngineNetworkRequest] - # 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 update_vmware_engine_network request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_vmware_engine_network_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_vmware_engine_network", - 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_vmware_engine_network REST call - # - # @param request_pb [::Google::Cloud::VmwareEngine::V1::DeleteVmwareEngineNetworkRequest] - # 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_vmware_engine_network request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_delete_vmware_engine_network_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_vmware_engine_network", - 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_vmware_engine_network REST call - # - # @param request_pb [::Google::Cloud::VmwareEngine::V1::GetVmwareEngineNetworkRequest] - # 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::VmwareEngine::V1::VmwareEngineNetwork] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::VmwareEngine::V1::VmwareEngineNetwork] - # A result object deserialized from the server's reply - def get_vmware_engine_network request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_vmware_engine_network_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_vmware_engine_network", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::VmwareEngine::V1::VmwareEngineNetwork.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_vmware_engine_networks REST call - # - # @param request_pb [::Google::Cloud::VmwareEngine::V1::ListVmwareEngineNetworksRequest] - # 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::VmwareEngine::V1::ListVmwareEngineNetworksResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::VmwareEngine::V1::ListVmwareEngineNetworksResponse] - # A result object deserialized from the server's reply - def list_vmware_engine_networks request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_vmware_engine_networks_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_vmware_engine_networks", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::VmwareEngine::V1::ListVmwareEngineNetworksResponse.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_private_connection REST call - # - # @param request_pb [::Google::Cloud::VmwareEngine::V1::CreatePrivateConnectionRequest] - # 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_private_connection request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_private_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_private_connection", - 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_private_connection REST call - # - # @param request_pb [::Google::Cloud::VmwareEngine::V1::GetPrivateConnectionRequest] - # 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::VmwareEngine::V1::PrivateConnection] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::VmwareEngine::V1::PrivateConnection] - # A result object deserialized from the server's reply - def get_private_connection request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_private_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_private_connection", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::VmwareEngine::V1::PrivateConnection.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_private_connections REST call - # - # @param request_pb [::Google::Cloud::VmwareEngine::V1::ListPrivateConnectionsRequest] - # 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::VmwareEngine::V1::ListPrivateConnectionsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::VmwareEngine::V1::ListPrivateConnectionsResponse] - # A result object deserialized from the server's reply - def list_private_connections request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_private_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_private_connections", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::VmwareEngine::V1::ListPrivateConnectionsResponse.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_private_connection REST call - # - # @param request_pb [::Google::Cloud::VmwareEngine::V1::UpdatePrivateConnectionRequest] - # 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 update_private_connection request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_private_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_private_connection", - 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_private_connection REST call - # - # @param request_pb [::Google::Cloud::VmwareEngine::V1::DeletePrivateConnectionRequest] - # 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_private_connection request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_delete_private_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: "delete_private_connection", - 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 list_private_connection_peering_routes REST call - # - # @param request_pb [::Google::Cloud::VmwareEngine::V1::ListPrivateConnectionPeeringRoutesRequest] - # 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::VmwareEngine::V1::ListPrivateConnectionPeeringRoutesResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::VmwareEngine::V1::ListPrivateConnectionPeeringRoutesResponse] - # A result object deserialized from the server's reply - def list_private_connection_peering_routes request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_private_connection_peering_routes_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_private_connection_peering_routes", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::VmwareEngine::V1::ListPrivateConnectionPeeringRoutesResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the grant_dns_bind_permission REST call - # - # @param request_pb [::Google::Cloud::VmwareEngine::V1::GrantDnsBindPermissionRequest] - # 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 grant_dns_bind_permission request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_grant_dns_bind_permission_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: "grant_dns_bind_permission", - 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_dns_bind_permission REST call - # - # @param request_pb [::Google::Cloud::VmwareEngine::V1::GetDnsBindPermissionRequest] - # 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::VmwareEngine::V1::DnsBindPermission] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::VmwareEngine::V1::DnsBindPermission] - # A result object deserialized from the server's reply - def get_dns_bind_permission request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_dns_bind_permission_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_dns_bind_permission", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::VmwareEngine::V1::DnsBindPermission.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the revoke_dns_bind_permission REST call - # - # @param request_pb [::Google::Cloud::VmwareEngine::V1::RevokeDnsBindPermissionRequest] - # 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 revoke_dns_bind_permission request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_revoke_dns_bind_permission_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: "revoke_dns_bind_permission", - 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 - - ## - # @private - # - # GRPC transcoding helper method for the list_private_clouds REST call - # - # @param request_pb [::Google::Cloud::VmwareEngine::V1::ListPrivateCloudsRequest] - # 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_private_clouds_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/privateClouds", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_private_cloud REST call - # - # @param request_pb [::Google::Cloud::VmwareEngine::V1::GetPrivateCloudRequest] - # 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_private_cloud_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/privateClouds/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the create_private_cloud REST call - # - # @param request_pb [::Google::Cloud::VmwareEngine::V1::CreatePrivateCloudRequest] - # 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_private_cloud_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}/privateClouds", - body: "private_cloud", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_private_cloud REST call - # - # @param request_pb [::Google::Cloud::VmwareEngine::V1::UpdatePrivateCloudRequest] - # 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_private_cloud_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v1/{private_cloud.name}", - body: "private_cloud", - matches: [ - ["private_cloud.name", %r{^projects/[^/]+/locations/[^/]+/privateClouds/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_private_cloud REST call - # - # @param request_pb [::Google::Cloud::VmwareEngine::V1::DeletePrivateCloudRequest] - # 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_private_cloud_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/privateClouds/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the undelete_private_cloud REST call - # - # @param request_pb [::Google::Cloud::VmwareEngine::V1::UndeletePrivateCloudRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_undelete_private_cloud_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:undelete", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/privateClouds/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_clusters REST call - # - # @param request_pb [::Google::Cloud::VmwareEngine::V1::ListClustersRequest] - # 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_clusters_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/clusters", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/privateClouds/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_cluster REST call - # - # @param request_pb [::Google::Cloud::VmwareEngine::V1::GetClusterRequest] - # 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_cluster_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/privateClouds/[^/]+/clusters/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the create_cluster REST call - # - # @param request_pb [::Google::Cloud::VmwareEngine::V1::CreateClusterRequest] - # 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_cluster_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}/clusters", - body: "cluster", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/privateClouds/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_cluster REST call - # - # @param request_pb [::Google::Cloud::VmwareEngine::V1::UpdateClusterRequest] - # 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_cluster_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v1/{cluster.name}", - body: "cluster", - matches: [ - ["cluster.name", %r{^projects/[^/]+/locations/[^/]+/privateClouds/[^/]+/clusters/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_cluster REST call - # - # @param request_pb [::Google::Cloud::VmwareEngine::V1::DeleteClusterRequest] - # 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_cluster_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/privateClouds/[^/]+/clusters/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_nodes REST call - # - # @param request_pb [::Google::Cloud::VmwareEngine::V1::ListNodesRequest] - # 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_nodes_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/nodes", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/privateClouds/[^/]+/clusters/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_node REST call - # - # @param request_pb [::Google::Cloud::VmwareEngine::V1::GetNodeRequest] - # 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_node_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/privateClouds/[^/]+/clusters/[^/]+/nodes/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_external_addresses REST call - # - # @param request_pb [::Google::Cloud::VmwareEngine::V1::ListExternalAddressesRequest] - # 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_external_addresses_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/externalAddresses", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/privateClouds/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the fetch_network_policy_external_addresses REST call - # - # @param request_pb [::Google::Cloud::VmwareEngine::V1::FetchNetworkPolicyExternalAddressesRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_fetch_network_policy_external_addresses_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{network_policy}:fetchExternalAddresses", - matches: [ - ["network_policy", %r{^projects/[^/]+/locations/[^/]+/networkPolicies/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_external_address REST call - # - # @param request_pb [::Google::Cloud::VmwareEngine::V1::GetExternalAddressRequest] - # 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_external_address_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/privateClouds/[^/]+/externalAddresses/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the create_external_address REST call - # - # @param request_pb [::Google::Cloud::VmwareEngine::V1::CreateExternalAddressRequest] - # 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_external_address_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}/externalAddresses", - body: "external_address", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/privateClouds/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_external_address REST call - # - # @param request_pb [::Google::Cloud::VmwareEngine::V1::UpdateExternalAddressRequest] - # 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_external_address_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v1/{external_address.name}", - body: "external_address", - matches: [ - ["external_address.name", %r{^projects/[^/]+/locations/[^/]+/privateClouds/[^/]+/externalAddresses/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_external_address REST call - # - # @param request_pb [::Google::Cloud::VmwareEngine::V1::DeleteExternalAddressRequest] - # 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_external_address_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/privateClouds/[^/]+/externalAddresses/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_subnets REST call - # - # @param request_pb [::Google::Cloud::VmwareEngine::V1::ListSubnetsRequest] - # 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_subnets_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/subnets", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/privateClouds/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_subnet REST call - # - # @param request_pb [::Google::Cloud::VmwareEngine::V1::GetSubnetRequest] - # 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_subnet_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/privateClouds/[^/]+/subnets/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_subnet REST call - # - # @param request_pb [::Google::Cloud::VmwareEngine::V1::UpdateSubnetRequest] - # 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_subnet_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v1/{subnet.name}", - body: "subnet", - matches: [ - ["subnet.name", %r{^projects/[^/]+/locations/[^/]+/privateClouds/[^/]+/subnets/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_external_access_rules REST call - # - # @param request_pb [::Google::Cloud::VmwareEngine::V1::ListExternalAccessRulesRequest] - # 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_external_access_rules_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/externalAccessRules", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/networkPolicies/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_external_access_rule REST call - # - # @param request_pb [::Google::Cloud::VmwareEngine::V1::GetExternalAccessRuleRequest] - # 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_external_access_rule_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/networkPolicies/[^/]+/externalAccessRules/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the create_external_access_rule REST call - # - # @param request_pb [::Google::Cloud::VmwareEngine::V1::CreateExternalAccessRuleRequest] - # 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_external_access_rule_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}/externalAccessRules", - body: "external_access_rule", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/networkPolicies/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_external_access_rule REST call - # - # @param request_pb [::Google::Cloud::VmwareEngine::V1::UpdateExternalAccessRuleRequest] - # 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_external_access_rule_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v1/{external_access_rule.name}", - body: "external_access_rule", - matches: [ - ["external_access_rule.name", %r{^projects/[^/]+/locations/[^/]+/networkPolicies/[^/]+/externalAccessRules/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_external_access_rule REST call - # - # @param request_pb [::Google::Cloud::VmwareEngine::V1::DeleteExternalAccessRuleRequest] - # 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_external_access_rule_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/networkPolicies/[^/]+/externalAccessRules/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_logging_servers REST call - # - # @param request_pb [::Google::Cloud::VmwareEngine::V1::ListLoggingServersRequest] - # 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_logging_servers_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/loggingServers", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/privateClouds/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_logging_server REST call - # - # @param request_pb [::Google::Cloud::VmwareEngine::V1::GetLoggingServerRequest] - # 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_logging_server_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/privateClouds/[^/]+/loggingServers/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the create_logging_server REST call - # - # @param request_pb [::Google::Cloud::VmwareEngine::V1::CreateLoggingServerRequest] - # 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_logging_server_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}/loggingServers", - body: "logging_server", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/privateClouds/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_logging_server REST call - # - # @param request_pb [::Google::Cloud::VmwareEngine::V1::UpdateLoggingServerRequest] - # 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_logging_server_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v1/{logging_server.name}", - body: "logging_server", - matches: [ - ["logging_server.name", %r{^projects/[^/]+/locations/[^/]+/privateClouds/[^/]+/loggingServers/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_logging_server REST call - # - # @param request_pb [::Google::Cloud::VmwareEngine::V1::DeleteLoggingServerRequest] - # 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_logging_server_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/privateClouds/[^/]+/loggingServers/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_node_types REST call - # - # @param request_pb [::Google::Cloud::VmwareEngine::V1::ListNodeTypesRequest] - # 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_node_types_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/nodeTypes", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_node_type REST call - # - # @param request_pb [::Google::Cloud::VmwareEngine::V1::GetNodeTypeRequest] - # 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_node_type_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/nodeTypes/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the show_nsx_credentials REST call - # - # @param request_pb [::Google::Cloud::VmwareEngine::V1::ShowNsxCredentialsRequest] - # 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_nsx_credentials_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{private_cloud}:showNsxCredentials", - matches: [ - ["private_cloud", %r{^projects/[^/]+/locations/[^/]+/privateClouds/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the show_vcenter_credentials REST call - # - # @param request_pb [::Google::Cloud::VmwareEngine::V1::ShowVcenterCredentialsRequest] - # 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_vcenter_credentials_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{private_cloud}:showVcenterCredentials", - matches: [ - ["private_cloud", %r{^projects/[^/]+/locations/[^/]+/privateClouds/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the reset_nsx_credentials REST call - # - # @param request_pb [::Google::Cloud::VmwareEngine::V1::ResetNsxCredentialsRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_reset_nsx_credentials_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{private_cloud}:resetNsxCredentials", - body: "*", - matches: [ - ["private_cloud", %r{^projects/[^/]+/locations/[^/]+/privateClouds/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the reset_vcenter_credentials REST call - # - # @param request_pb [::Google::Cloud::VmwareEngine::V1::ResetVcenterCredentialsRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_reset_vcenter_credentials_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{private_cloud}:resetVcenterCredentials", - body: "*", - matches: [ - ["private_cloud", %r{^projects/[^/]+/locations/[^/]+/privateClouds/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_dns_forwarding REST call - # - # @param request_pb [::Google::Cloud::VmwareEngine::V1::GetDnsForwardingRequest] - # 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_dns_forwarding_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/privateClouds/[^/]+/dnsForwarding/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_dns_forwarding REST call - # - # @param request_pb [::Google::Cloud::VmwareEngine::V1::UpdateDnsForwardingRequest] - # 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_dns_forwarding_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v1/{dns_forwarding.name}", - body: "dns_forwarding", - matches: [ - ["dns_forwarding.name", %r{^projects/[^/]+/locations/[^/]+/privateClouds/[^/]+/dnsForwarding/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_network_peering REST call - # - # @param request_pb [::Google::Cloud::VmwareEngine::V1::GetNetworkPeeringRequest] - # 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_network_peering_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/networkPeerings/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_network_peerings REST call - # - # @param request_pb [::Google::Cloud::VmwareEngine::V1::ListNetworkPeeringsRequest] - # 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_network_peerings_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/networkPeerings", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the create_network_peering REST call - # - # @param request_pb [::Google::Cloud::VmwareEngine::V1::CreateNetworkPeeringRequest] - # 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_network_peering_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}/networkPeerings", - body: "network_peering", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_network_peering REST call - # - # @param request_pb [::Google::Cloud::VmwareEngine::V1::DeleteNetworkPeeringRequest] - # 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_network_peering_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/networkPeerings/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_network_peering REST call - # - # @param request_pb [::Google::Cloud::VmwareEngine::V1::UpdateNetworkPeeringRequest] - # 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_network_peering_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v1/{network_peering.name}", - body: "network_peering", - matches: [ - ["network_peering.name", %r{^projects/[^/]+/locations/[^/]+/networkPeerings/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_peering_routes REST call - # - # @param request_pb [::Google::Cloud::VmwareEngine::V1::ListPeeringRoutesRequest] - # 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_peering_routes_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/peeringRoutes", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/networkPeerings/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the create_hcx_activation_key REST call - # - # @param request_pb [::Google::Cloud::VmwareEngine::V1::CreateHcxActivationKeyRequest] - # 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_hcx_activation_key_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}/hcxActivationKeys", - body: "hcx_activation_key", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/privateClouds/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_hcx_activation_keys REST call - # - # @param request_pb [::Google::Cloud::VmwareEngine::V1::ListHcxActivationKeysRequest] - # 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_hcx_activation_keys_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/hcxActivationKeys", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/privateClouds/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_hcx_activation_key REST call - # - # @param request_pb [::Google::Cloud::VmwareEngine::V1::GetHcxActivationKeyRequest] - # 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_hcx_activation_key_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/privateClouds/[^/]+/hcxActivationKeys/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_network_policy REST call - # - # @param request_pb [::Google::Cloud::VmwareEngine::V1::GetNetworkPolicyRequest] - # 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_network_policy_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/networkPolicies/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_network_policies REST call - # - # @param request_pb [::Google::Cloud::VmwareEngine::V1::ListNetworkPoliciesRequest] - # 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_network_policies_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/networkPolicies", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the create_network_policy REST call - # - # @param request_pb [::Google::Cloud::VmwareEngine::V1::CreateNetworkPolicyRequest] - # 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_network_policy_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}/networkPolicies", - body: "network_policy", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_network_policy REST call - # - # @param request_pb [::Google::Cloud::VmwareEngine::V1::UpdateNetworkPolicyRequest] - # 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_network_policy_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v1/{network_policy.name}", - body: "network_policy", - matches: [ - ["network_policy.name", %r{^projects/[^/]+/locations/[^/]+/networkPolicies/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_network_policy REST call - # - # @param request_pb [::Google::Cloud::VmwareEngine::V1::DeleteNetworkPolicyRequest] - # 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_network_policy_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/networkPolicies/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_management_dns_zone_bindings REST call - # - # @param request_pb [::Google::Cloud::VmwareEngine::V1::ListManagementDnsZoneBindingsRequest] - # 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_management_dns_zone_bindings_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/managementDnsZoneBindings", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/privateClouds/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_management_dns_zone_binding REST call - # - # @param request_pb [::Google::Cloud::VmwareEngine::V1::GetManagementDnsZoneBindingRequest] - # 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_management_dns_zone_binding_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/privateClouds/[^/]+/managementDnsZoneBindings/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the create_management_dns_zone_binding REST call - # - # @param request_pb [::Google::Cloud::VmwareEngine::V1::CreateManagementDnsZoneBindingRequest] - # 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_management_dns_zone_binding_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}/managementDnsZoneBindings", - body: "management_dns_zone_binding", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/privateClouds/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_management_dns_zone_binding REST call - # - # @param request_pb [::Google::Cloud::VmwareEngine::V1::UpdateManagementDnsZoneBindingRequest] - # 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_management_dns_zone_binding_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v1/{management_dns_zone_binding.name}", - body: "management_dns_zone_binding", - matches: [ - ["management_dns_zone_binding.name", %r{^projects/[^/]+/locations/[^/]+/privateClouds/[^/]+/managementDnsZoneBindings/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_management_dns_zone_binding REST call - # - # @param request_pb [::Google::Cloud::VmwareEngine::V1::DeleteManagementDnsZoneBindingRequest] - # 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_management_dns_zone_binding_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/privateClouds/[^/]+/managementDnsZoneBindings/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the repair_management_dns_zone_binding REST call - # - # @param request_pb [::Google::Cloud::VmwareEngine::V1::RepairManagementDnsZoneBindingRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_repair_management_dns_zone_binding_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:repair", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/privateClouds/[^/]+/managementDnsZoneBindings/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the create_vmware_engine_network REST call - # - # @param request_pb [::Google::Cloud::VmwareEngine::V1::CreateVmwareEngineNetworkRequest] - # 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_vmware_engine_network_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}/vmwareEngineNetworks", - body: "vmware_engine_network", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_vmware_engine_network REST call - # - # @param request_pb [::Google::Cloud::VmwareEngine::V1::UpdateVmwareEngineNetworkRequest] - # 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_vmware_engine_network_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v1/{vmware_engine_network.name}", - body: "vmware_engine_network", - matches: [ - ["vmware_engine_network.name", %r{^projects/[^/]+/locations/[^/]+/vmwareEngineNetworks/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_vmware_engine_network REST call - # - # @param request_pb [::Google::Cloud::VmwareEngine::V1::DeleteVmwareEngineNetworkRequest] - # 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_vmware_engine_network_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/vmwareEngineNetworks/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_vmware_engine_network REST call - # - # @param request_pb [::Google::Cloud::VmwareEngine::V1::GetVmwareEngineNetworkRequest] - # 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_vmware_engine_network_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/vmwareEngineNetworks/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_vmware_engine_networks REST call - # - # @param request_pb [::Google::Cloud::VmwareEngine::V1::ListVmwareEngineNetworksRequest] - # 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_vmware_engine_networks_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/vmwareEngineNetworks", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the create_private_connection REST call - # - # @param request_pb [::Google::Cloud::VmwareEngine::V1::CreatePrivateConnectionRequest] - # 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_private_connection_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}/privateConnections", - body: "private_connection", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_private_connection REST call - # - # @param request_pb [::Google::Cloud::VmwareEngine::V1::GetPrivateConnectionRequest] - # 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_private_connection_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/privateConnections/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_private_connections REST call - # - # @param request_pb [::Google::Cloud::VmwareEngine::V1::ListPrivateConnectionsRequest] - # 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_private_connections_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/privateConnections", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_private_connection REST call - # - # @param request_pb [::Google::Cloud::VmwareEngine::V1::UpdatePrivateConnectionRequest] - # 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_private_connection_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v1/{private_connection.name}", - body: "private_connection", - matches: [ - ["private_connection.name", %r{^projects/[^/]+/locations/[^/]+/privateConnections/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_private_connection REST call - # - # @param request_pb [::Google::Cloud::VmwareEngine::V1::DeletePrivateConnectionRequest] - # 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_private_connection_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/privateConnections/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_private_connection_peering_routes REST call - # - # @param request_pb [::Google::Cloud::VmwareEngine::V1::ListPrivateConnectionPeeringRoutesRequest] - # 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_private_connection_peering_routes_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/peeringRoutes", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/privateConnections/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the grant_dns_bind_permission REST call - # - # @param request_pb [::Google::Cloud::VmwareEngine::V1::GrantDnsBindPermissionRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_grant_dns_bind_permission_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:grant", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/dnsBindPermission/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_dns_bind_permission REST call - # - # @param request_pb [::Google::Cloud::VmwareEngine::V1::GetDnsBindPermissionRequest] - # 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_dns_bind_permission_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/dnsBindPermission/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the revoke_dns_bind_permission REST call - # - # @param request_pb [::Google::Cloud::VmwareEngine::V1::RevokeDnsBindPermissionRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_revoke_dns_bind_permission_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:revoke", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/dnsBindPermission/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-vmware_engine-v1/lib/google/cloud/vmwareengine/v1/vmwareengine_pb.rb b/owl-bot-staging/google-cloud-vmware_engine-v1/lib/google/cloud/vmwareengine/v1/vmwareengine_pb.rb deleted file mode 100644 index 4fae75039dc3..000000000000 --- a/owl-bot-staging/google-cloud-vmware_engine-v1/lib/google/cloud/vmwareengine/v1/vmwareengine_pb.rb +++ /dev/null @@ -1,123 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/vmwareengine/v1/vmwareengine.proto - -require 'google/protobuf' - -require 'google/api/annotations_pb' -require 'google/api/client_pb' -require 'google/api/field_behavior_pb' -require 'google/api/field_info_pb' -require 'google/api/resource_pb' -require 'google/cloud/vmwareengine/v1/vmwareengine_resources_pb' -require 'google/longrunning/operations_pb' -require 'google/protobuf/empty_pb' -require 'google/protobuf/field_mask_pb' -require 'google/protobuf/timestamp_pb' - - -descriptor_data = "\n/google/cloud/vmwareengine/v1/vmwareengine.proto\x12\x1cgoogle.cloud.vmwareengine.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x1bgoogle/api/field_info.proto\x1a\x19google/api/resource.proto\x1a\x39google/cloud/vmwareengine/v1/vmwareengine_resources.proto\x1a#google/longrunning/operations.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\x9e\x01\n\x18ListPrivateCloudsRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\x12\x0e\n\x06\x66ilter\x18\x04 \x01(\t\x12\x10\n\x08order_by\x18\x05 \x01(\t\"\x8d\x01\n\x19ListPrivateCloudsResponse\x12\x42\n\x0eprivate_clouds\x18\x01 \x03(\x0b\x32*.google.cloud.vmwareengine.v1.PrivateCloud\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x13\n\x0bunreachable\x18\x03 \x03(\t\"X\n\x16GetPrivateCloudRequest\x12>\n\x04name\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(vmwareengine.googleapis.com/PrivateCloud\"\xf2\x01\n\x19\x43reatePrivateCloudRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\x12\x1d\n\x10private_cloud_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x46\n\rprivate_cloud\x18\x03 \x01(\x0b\x32*.google.cloud.vmwareengine.v1.PrivateCloudB\x03\xe0\x41\x02\x12\x17\n\nrequest_id\x18\x04 \x01(\tB\x03\xe0\x41\x01\x12\x1a\n\rvalidate_only\x18\x05 \x01(\x08\x42\x03\xe0\x41\x01\"\xb2\x01\n\x19UpdatePrivateCloudRequest\x12\x46\n\rprivate_cloud\x18\x01 \x01(\x0b\x32*.google.cloud.vmwareengine.v1.PrivateCloudB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\x12\x17\n\nrequest_id\x18\x03 \x01(\tB\x03\xe0\x41\x01\"\xb7\x01\n\x19\x44\x65letePrivateCloudRequest\x12>\n\x04name\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(vmwareengine.googleapis.com/PrivateCloud\x12\x17\n\nrequest_id\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x12\n\x05\x66orce\x18\x03 \x01(\x08\x42\x03\xe0\x41\x01\x12\x1d\n\x0b\x64\x65lay_hours\x18\x04 \x01(\x05\x42\x03\xe0\x41\x01H\x00\x88\x01\x01\x42\x0e\n\x0c_delay_hours\"v\n\x1bUndeletePrivateCloudRequest\x12>\n\x04name\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(vmwareengine.googleapis.com/PrivateCloud\x12\x17\n\nrequest_id\x18\x02 \x01(\tB\x03\xe0\x41\x01\"\xa0\x01\n\x13ListClustersRequest\x12@\n\x06parent\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(vmwareengine.googleapis.com/PrivateCloud\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\x12\x0e\n\x06\x66ilter\x18\x04 \x01(\t\x12\x10\n\x08order_by\x18\x05 \x01(\t\"}\n\x14ListClustersResponse\x12\x37\n\x08\x63lusters\x18\x01 \x03(\x0b\x32%.google.cloud.vmwareengine.v1.Cluster\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x13\n\x0bunreachable\x18\x03 \x03(\t\"N\n\x11GetClusterRequest\x12\x39\n\x04name\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\n#vmwareengine.googleapis.com/Cluster\"\xe3\x01\n\x14\x43reateClusterRequest\x12@\n\x06parent\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(vmwareengine.googleapis.com/PrivateCloud\x12\x17\n\ncluster_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12;\n\x07\x63luster\x18\x03 \x01(\x0b\x32%.google.cloud.vmwareengine.v1.ClusterB\x03\xe0\x41\x02\x12\x17\n\nrequest_id\x18\x04 \x01(\tB\x03\xe0\x41\x01\x12\x1a\n\rvalidate_only\x18\x05 \x01(\x08\x42\x03\xe0\x41\x01\"\xbe\x01\n\x14UpdateClusterRequest\x12\x34\n\x0bupdate_mask\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\x12;\n\x07\x63luster\x18\x02 \x01(\x0b\x32%.google.cloud.vmwareengine.v1.ClusterB\x03\xe0\x41\x02\x12\x17\n\nrequest_id\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12\x1a\n\rvalidate_only\x18\x04 \x01(\x08\x42\x03\xe0\x41\x01\"j\n\x14\x44\x65leteClusterRequest\x12\x39\n\x04name\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\n#vmwareengine.googleapis.com/Cluster\x12\x17\n\nrequest_id\x18\x02 \x01(\tB\x03\xe0\x41\x01\"v\n\x10ListNodesRequest\x12;\n\x06parent\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\n#vmwareengine.googleapis.com/Cluster\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\"_\n\x11ListNodesResponse\x12\x31\n\x05nodes\x18\x01 \x03(\x0b\x32\".google.cloud.vmwareengine.v1.Node\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"H\n\x0eGetNodeRequest\x12\x36\n\x04name\x18\x01 \x01(\tB(\xe0\x41\x02\xfa\x41\"\n vmwareengine.googleapis.com/Node\"\xa9\x01\n\x1cListExternalAddressesRequest\x12@\n\x06parent\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(vmwareengine.googleapis.com/PrivateCloud\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\x12\x0e\n\x06\x66ilter\x18\x04 \x01(\t\x12\x10\n\x08order_by\x18\x05 \x01(\t\"\x98\x01\n\x1dListExternalAddressesResponse\x12I\n\x12\x65xternal_addresses\x18\x01 \x03(\x0b\x32-.google.cloud.vmwareengine.v1.ExternalAddress\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x13\n\x0bunreachable\x18\x03 \x03(\t\"\x9e\x01\n*FetchNetworkPolicyExternalAddressesRequest\x12I\n\x0enetwork_policy\x18\x01 \x01(\tB1\xe0\x41\x02\xfa\x41+\n)vmwareengine.googleapis.com/NetworkPolicy\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\"\x91\x01\n+FetchNetworkPolicyExternalAddressesResponse\x12I\n\x12\x65xternal_addresses\x18\x01 \x03(\x0b\x32-.google.cloud.vmwareengine.v1.ExternalAddress\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"^\n\x19GetExternalAddressRequest\x12\x41\n\x04name\x18\x01 \x01(\tB3\xe0\x41\x02\xfa\x41-\n+vmwareengine.googleapis.com/ExternalAddress\"\xe9\x01\n\x1c\x43reateExternalAddressRequest\x12@\n\x06parent\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(vmwareengine.googleapis.com/PrivateCloud\x12L\n\x10\x65xternal_address\x18\x02 \x01(\x0b\x32-.google.cloud.vmwareengine.v1.ExternalAddressB\x03\xe0\x41\x02\x12 \n\x13\x65xternal_address_id\x18\x03 \x01(\tB\x03\xe0\x41\x02\x12\x17\n\nrequest_id\x18\x04 \x01(\tB\x03\xe0\x41\x01\"\xbb\x01\n\x1cUpdateExternalAddressRequest\x12\x34\n\x0bupdate_mask\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\x12L\n\x10\x65xternal_address\x18\x02 \x01(\x0b\x32-.google.cloud.vmwareengine.v1.ExternalAddressB\x03\xe0\x41\x02\x12\x17\n\nrequest_id\x18\x03 \x01(\tB\x03\xe0\x41\x01\"z\n\x1c\x44\x65leteExternalAddressRequest\x12\x41\n\x04name\x18\x01 \x01(\tB3\xe0\x41\x02\xfa\x41-\n+vmwareengine.googleapis.com/ExternalAddress\x12\x17\n\nrequest_id\x18\x02 \x01(\tB\x03\xe0\x41\x01\"}\n\x12ListSubnetsRequest\x12@\n\x06parent\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(vmwareengine.googleapis.com/PrivateCloud\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\"z\n\x13ListSubnetsResponse\x12\x35\n\x07subnets\x18\x01 \x03(\x0b\x32$.google.cloud.vmwareengine.v1.Subnet\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x13\n\x0bunreachable\x18\x03 \x03(\t\"L\n\x10GetSubnetRequest\x12\x38\n\x04name\x18\x01 \x01(\tB*\xe0\x41\x02\xfa\x41$\n\"vmwareengine.googleapis.com/Subnet\"\x86\x01\n\x13UpdateSubnetRequest\x12\x34\n\x0bupdate_mask\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\x12\x39\n\x06subnet\x18\x02 \x01(\x0b\x32$.google.cloud.vmwareengine.v1.SubnetB\x03\xe0\x41\x02\"\xac\x01\n\x1eListExternalAccessRulesRequest\x12\x41\n\x06parent\x18\x01 \x01(\tB1\xe0\x41\x02\xfa\x41+\n)vmwareengine.googleapis.com/NetworkPolicy\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\x12\x0e\n\x06\x66ilter\x18\x04 \x01(\t\x12\x10\n\x08order_by\x18\x05 \x01(\t\"\xa0\x01\n\x1fListExternalAccessRulesResponse\x12O\n\x15\x65xternal_access_rules\x18\x01 \x03(\x0b\x32\x30.google.cloud.vmwareengine.v1.ExternalAccessRule\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x13\n\x0bunreachable\x18\x03 \x03(\t\"d\n\x1cGetExternalAccessRuleRequest\x12\x44\n\x04name\x18\x01 \x01(\tB6\xe0\x41\x02\xfa\x41\x30\n.vmwareengine.googleapis.com/ExternalAccessRule\"\xf3\x01\n\x1f\x43reateExternalAccessRuleRequest\x12\x41\n\x06parent\x18\x01 \x01(\tB1\xe0\x41\x02\xfa\x41+\n)vmwareengine.googleapis.com/NetworkPolicy\x12S\n\x14\x65xternal_access_rule\x18\x02 \x01(\x0b\x32\x30.google.cloud.vmwareengine.v1.ExternalAccessRuleB\x03\xe0\x41\x02\x12$\n\x17\x65xternal_access_rule_id\x18\x03 \x01(\tB\x03\xe0\x41\x02\x12\x12\n\nrequest_id\x18\x04 \x01(\t\"\xc5\x01\n\x1fUpdateExternalAccessRuleRequest\x12\x34\n\x0bupdate_mask\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\x12S\n\x14\x65xternal_access_rule\x18\x02 \x01(\x0b\x32\x30.google.cloud.vmwareengine.v1.ExternalAccessRuleB\x03\xe0\x41\x02\x12\x17\n\nrequest_id\x18\x03 \x01(\tB\x03\xe0\x41\x01\"\x80\x01\n\x1f\x44\x65leteExternalAccessRuleRequest\x12\x44\n\x04name\x18\x01 \x01(\tB6\xe0\x41\x02\xfa\x41\x30\n.vmwareengine.googleapis.com/ExternalAccessRule\x12\x17\n\nrequest_id\x18\x02 \x01(\tB\x03\xe0\x41\x01\"\xa6\x01\n\x19ListLoggingServersRequest\x12@\n\x06parent\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(vmwareengine.googleapis.com/PrivateCloud\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\x12\x0e\n\x06\x66ilter\x18\x04 \x01(\t\x12\x10\n\x08order_by\x18\x05 \x01(\t\"\x90\x01\n\x1aListLoggingServersResponse\x12\x44\n\x0flogging_servers\x18\x01 \x03(\x0b\x32+.google.cloud.vmwareengine.v1.LoggingServer\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x13\n\x0bunreachable\x18\x03 \x03(\t\"Z\n\x17GetLoggingServerRequest\x12?\n\x04name\x18\x01 \x01(\tB1\xe0\x41\x02\xfa\x41+\n)vmwareengine.googleapis.com/LoggingServer\"\xe1\x01\n\x1a\x43reateLoggingServerRequest\x12@\n\x06parent\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(vmwareengine.googleapis.com/PrivateCloud\x12H\n\x0elogging_server\x18\x02 \x01(\x0b\x32+.google.cloud.vmwareengine.v1.LoggingServerB\x03\xe0\x41\x02\x12\x1e\n\x11logging_server_id\x18\x03 \x01(\tB\x03\xe0\x41\x02\x12\x17\n\nrequest_id\x18\x04 \x01(\tB\x03\xe0\x41\x01\"\xb5\x01\n\x1aUpdateLoggingServerRequest\x12\x34\n\x0bupdate_mask\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\x12H\n\x0elogging_server\x18\x02 \x01(\x0b\x32+.google.cloud.vmwareengine.v1.LoggingServerB\x03\xe0\x41\x02\x12\x17\n\nrequest_id\x18\x03 \x01(\tB\x03\xe0\x41\x01\"v\n\x1a\x44\x65leteLoggingServerRequest\x12?\n\x04name\x18\x01 \x01(\tB1\xe0\x41\x02\xfa\x41+\n)vmwareengine.googleapis.com/LoggingServer\x12\x17\n\nrequest_id\x18\x02 \x01(\tB\x03\xe0\x41\x01\"\x80\x02\n\x11OperationMetadata\x12\x34\n\x0b\x63reate_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x31\n\x08\x65nd_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x13\n\x06target\x18\x03 \x01(\tB\x03\xe0\x41\x03\x12\x11\n\x04verb\x18\x04 \x01(\tB\x03\xe0\x41\x03\x12\x1b\n\x0estatus_message\x18\x05 \x01(\tB\x03\xe0\x41\x03\x12#\n\x16requested_cancellation\x18\x06 \x01(\x08\x42\x03\xe0\x41\x03\x12\x18\n\x0b\x61pi_version\x18\x07 \x01(\tB\x03\xe0\x41\x03\"\x88\x01\n\x14ListNodeTypesRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\x12\x0e\n\x06\x66ilter\x18\x04 \x01(\t\"\x81\x01\n\x15ListNodeTypesResponse\x12:\n\nnode_types\x18\x01 \x03(\x0b\x32&.google.cloud.vmwareengine.v1.NodeType\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x13\n\x0bunreachable\x18\x03 \x03(\t\"P\n\x12GetNodeTypeRequest\x12:\n\x04name\x18\x01 \x01(\tB,\xe0\x41\x02\xfa\x41&\n$vmwareengine.googleapis.com/NodeType\"d\n\x19ShowNsxCredentialsRequest\x12G\n\rprivate_cloud\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(vmwareengine.googleapis.com/PrivateCloud\"\x7f\n\x1dShowVcenterCredentialsRequest\x12G\n\rprivate_cloud\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(vmwareengine.googleapis.com/PrivateCloud\x12\x15\n\x08username\x18\x02 \x01(\tB\x03\xe0\x41\x01\"~\n\x1aResetNsxCredentialsRequest\x12G\n\rprivate_cloud\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(vmwareengine.googleapis.com/PrivateCloud\x12\x17\n\nrequest_id\x18\x02 \x01(\tB\x03\xe0\x41\x01\"\x99\x01\n\x1eResetVcenterCredentialsRequest\x12G\n\rprivate_cloud\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(vmwareengine.googleapis.com/PrivateCloud\x12\x17\n\nrequest_id\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x15\n\x08username\x18\x03 \x01(\tB\x03\xe0\x41\x01\"\x9a\x01\n\x1dListHcxActivationKeysResponse\x12K\n\x13hcx_activation_keys\x18\x01 \x03(\x0b\x32..google.cloud.vmwareengine.v1.HcxActivationKey\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x13\n\x0bunreachable\x18\x03 \x03(\t\"\x87\x01\n\x1cListHcxActivationKeysRequest\x12@\n\x06parent\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(vmwareengine.googleapis.com/PrivateCloud\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\"`\n\x1aGetHcxActivationKeyRequest\x12\x42\n\x04name\x18\x01 \x01(\tB4\xe0\x41\x02\xfa\x41.\n,vmwareengine.googleapis.com/HcxActivationKey\"\xea\x01\n\x1d\x43reateHcxActivationKeyRequest\x12@\n\x06parent\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(vmwareengine.googleapis.com/PrivateCloud\x12O\n\x12hcx_activation_key\x18\x02 \x01(\x0b\x32..google.cloud.vmwareengine.v1.HcxActivationKeyB\x03\xe0\x41\x02\x12\"\n\x15hcx_activation_key_id\x18\x03 \x01(\tB\x03\xe0\x41\x02\x12\x12\n\nrequest_id\x18\x04 \x01(\t\"Z\n\x17GetDnsForwardingRequest\x12?\n\x04name\x18\x01 \x01(\tB1\xe0\x41\x02\xfa\x41+\n)vmwareengine.googleapis.com/DnsForwarding\"\xb5\x01\n\x1aUpdateDnsForwardingRequest\x12H\n\x0e\x64ns_forwarding\x18\x01 \x01(\x0b\x32+.google.cloud.vmwareengine.v1.DnsForwardingB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\x12\x17\n\nrequest_id\x18\x03 \x01(\tB\x03\xe0\x41\x01\"\xde\x01\n\x1b\x43reateNetworkPeeringRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\x12\x1f\n\x12network_peering_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12J\n\x0fnetwork_peering\x18\x03 \x01(\x0b\x32,.google.cloud.vmwareengine.v1.NetworkPeeringB\x03\xe0\x41\x02\x12\x17\n\nrequest_id\x18\x04 \x01(\tB\x03\xe0\x41\x01\"x\n\x1b\x44\x65leteNetworkPeeringRequest\x12@\n\x04name\x18\x01 \x01(\tB2\xe0\x41\x02\xfa\x41,\n*vmwareengine.googleapis.com/NetworkPeering\x12\x17\n\nrequest_id\x18\x02 \x01(\tB\x03\xe0\x41\x01\"\\\n\x18GetNetworkPeeringRequest\x12@\n\x04name\x18\x01 \x01(\tB2\xe0\x41\x02\xfa\x41,\n*vmwareengine.googleapis.com/NetworkPeering\"\xa9\x01\n\x1aListNetworkPeeringsRequest\x12\x42\n\x06parent\x18\x01 \x01(\tB2\xe0\x41\x02\xfa\x41,\x12*vmwareengine.googleapis.com/NetworkPeering\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\x12\x0e\n\x06\x66ilter\x18\x04 \x01(\t\x12\x10\n\x08order_by\x18\x05 \x01(\t\"\xb8\x01\n\x1bUpdateNetworkPeeringRequest\x12J\n\x0fnetwork_peering\x18\x01 \x01(\x0b\x32,.google.cloud.vmwareengine.v1.NetworkPeeringB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\x12\x17\n\nrequest_id\x18\x03 \x01(\tB\x03\xe0\x41\x01\"\x93\x01\n\x1bListNetworkPeeringsResponse\x12\x46\n\x10network_peerings\x18\x01 \x03(\x0b\x32,.google.cloud.vmwareengine.v1.NetworkPeering\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x13\n\x0bunreachable\x18\x03 \x03(\t\"\x95\x01\n\x18ListPeeringRoutesRequest\x12\x42\n\x06parent\x18\x01 \x01(\tB2\xe0\x41\x02\xfa\x41,\n*vmwareengine.googleapis.com/NetworkPeering\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\x12\x0e\n\x06\x66ilter\x18\x06 \x01(\t\"x\n\x19ListPeeringRoutesResponse\x12\x42\n\x0epeering_routes\x18\x01 \x03(\x0b\x32*.google.cloud.vmwareengine.v1.PeeringRoute\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\xa8\x01\n\x1aListNetworkPoliciesRequest\x12\x41\n\x06parent\x18\x01 \x01(\tB1\xe0\x41\x02\xfa\x41+\x12)vmwareengine.googleapis.com/NetworkPolicy\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\x12\x0e\n\x06\x66ilter\x18\x04 \x01(\t\x12\x10\n\x08order_by\x18\x05 \x01(\t\"\x92\x01\n\x1bListNetworkPoliciesResponse\x12\x45\n\x10network_policies\x18\x01 \x03(\x0b\x32+.google.cloud.vmwareengine.v1.NetworkPolicy\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x13\n\x0bunreachable\x18\x03 \x03(\t\"Z\n\x17GetNetworkPolicyRequest\x12?\n\x04name\x18\x01 \x01(\tB1\xe0\x41\x02\xfa\x41+\n)vmwareengine.googleapis.com/NetworkPolicy\"\xb5\x01\n\x1aUpdateNetworkPolicyRequest\x12H\n\x0enetwork_policy\x18\x01 \x01(\x0b\x32+.google.cloud.vmwareengine.v1.NetworkPolicyB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\x12\x17\n\nrequest_id\x18\x03 \x01(\tB\x03\xe0\x41\x01\"\xe2\x01\n\x1a\x43reateNetworkPolicyRequest\x12\x41\n\x06parent\x18\x01 \x01(\tB1\xe0\x41\x02\xfa\x41+\x12)vmwareengine.googleapis.com/NetworkPolicy\x12\x1e\n\x11network_policy_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12H\n\x0enetwork_policy\x18\x03 \x01(\x0b\x32+.google.cloud.vmwareengine.v1.NetworkPolicyB\x03\xe0\x41\x02\x12\x17\n\nrequest_id\x18\x04 \x01(\tB\x03\xe0\x41\x01\"v\n\x1a\x44\x65leteNetworkPolicyRequest\x12?\n\x04name\x18\x01 \x01(\tB1\xe0\x41\x02\xfa\x41+\n)vmwareengine.googleapis.com/NetworkPolicy\x12\x17\n\nrequest_id\x18\x02 \x01(\tB\x03\xe0\x41\x01\"\xb1\x01\n$ListManagementDnsZoneBindingsRequest\x12@\n\x06parent\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(vmwareengine.googleapis.com/PrivateCloud\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\x12\x0e\n\x06\x66ilter\x18\x04 \x01(\t\x12\x10\n\x08order_by\x18\x05 \x01(\t\"\xb3\x01\n%ListManagementDnsZoneBindingsResponse\x12\\\n\x1cmanagement_dns_zone_bindings\x18\x01 \x03(\x0b\x32\x36.google.cloud.vmwareengine.v1.ManagementDnsZoneBinding\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x13\n\x0bunreachable\x18\x03 \x03(\t\"p\n\"GetManagementDnsZoneBindingRequest\x12J\n\x04name\x18\x01 \x01(\tB<\xe0\x41\x02\xfa\x41\x36\n4vmwareengine.googleapis.com/ManagementDnsZoneBinding\"\x91\x02\n%CreateManagementDnsZoneBindingRequest\x12@\n\x06parent\x18\x01 \x01(\tB0\xe0\x41\x02\xfa\x41*\n(vmwareengine.googleapis.com/PrivateCloud\x12`\n\x1bmanagement_dns_zone_binding\x18\x02 \x01(\x0b\x32\x36.google.cloud.vmwareengine.v1.ManagementDnsZoneBindingB\x03\xe0\x41\x02\x12+\n\x1emanagement_dns_zone_binding_id\x18\x03 \x01(\tB\x03\xe0\x41\x02\x12\x17\n\nrequest_id\x18\x04 \x01(\tB\x03\xe0\x41\x01\"\xd8\x01\n%UpdateManagementDnsZoneBindingRequest\x12\x34\n\x0bupdate_mask\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\x12`\n\x1bmanagement_dns_zone_binding\x18\x02 \x01(\x0b\x32\x36.google.cloud.vmwareengine.v1.ManagementDnsZoneBindingB\x03\xe0\x41\x02\x12\x17\n\nrequest_id\x18\x03 \x01(\tB\x03\xe0\x41\x01\"\x8c\x01\n%DeleteManagementDnsZoneBindingRequest\x12J\n\x04name\x18\x01 \x01(\tB<\xe0\x41\x02\xfa\x41\x36\n4vmwareengine.googleapis.com/ManagementDnsZoneBinding\x12\x17\n\nrequest_id\x18\x02 \x01(\tB\x03\xe0\x41\x01\"\x8c\x01\n%RepairManagementDnsZoneBindingRequest\x12J\n\x04name\x18\x01 \x01(\tB<\xe0\x41\x02\xfa\x41\x36\n4vmwareengine.googleapis.com/ManagementDnsZoneBinding\x12\x17\n\nrequest_id\x18\x02 \x01(\tB\x03\xe0\x41\x01\"\x82\x02\n CreateVmwareEngineNetworkRequest\x12G\n\x06parent\x18\x01 \x01(\tB7\xe0\x41\x02\xfa\x41\x31\x12/vmwareengine.googleapis.com/VmwareEngineNetwork\x12%\n\x18vmware_engine_network_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12U\n\x15vmware_engine_network\x18\x03 \x01(\x0b\x32\x31.google.cloud.vmwareengine.v1.VmwareEngineNetworkB\x03\xe0\x41\x02\x12\x17\n\nrequest_id\x18\x04 \x01(\tB\x03\xe0\x41\x01\"\xc8\x01\n UpdateVmwareEngineNetworkRequest\x12U\n\x15vmware_engine_network\x18\x01 \x01(\x0b\x32\x31.google.cloud.vmwareengine.v1.VmwareEngineNetworkB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\x12\x17\n\nrequest_id\x18\x03 \x01(\tB\x03\xe0\x41\x01\"\x95\x01\n DeleteVmwareEngineNetworkRequest\x12\x45\n\x04name\x18\x01 \x01(\tB7\xe0\x41\x02\xfa\x41\x31\n/vmwareengine.googleapis.com/VmwareEngineNetwork\x12\x17\n\nrequest_id\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x11\n\x04\x65tag\x18\x03 \x01(\tB\x03\xe0\x41\x01\"f\n\x1dGetVmwareEngineNetworkRequest\x12\x45\n\x04name\x18\x01 \x01(\tB7\xe0\x41\x02\xfa\x41\x31\n/vmwareengine.googleapis.com/VmwareEngineNetwork\"\xa5\x01\n\x1fListVmwareEngineNetworksRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\x12\x0e\n\x06\x66ilter\x18\x04 \x01(\t\x12\x10\n\x08order_by\x18\x05 \x01(\t\"\xa3\x01\n ListVmwareEngineNetworksResponse\x12Q\n\x16vmware_engine_networks\x18\x01 \x03(\x0b\x32\x31.google.cloud.vmwareengine.v1.VmwareEngineNetwork\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x13\n\x0bunreachable\x18\x03 \x03(\t\"\xf6\x01\n\x1e\x43reatePrivateConnectionRequest\x12\x45\n\x06parent\x18\x01 \x01(\tB5\xe0\x41\x02\xfa\x41/\x12-vmwareengine.googleapis.com/PrivateConnection\x12\"\n\x15private_connection_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12P\n\x12private_connection\x18\x03 \x01(\x0b\x32/.google.cloud.vmwareengine.v1.PrivateConnectionB\x03\xe0\x41\x02\x12\x17\n\nrequest_id\x18\x04 \x01(\tB\x03\xe0\x41\x01\"b\n\x1bGetPrivateConnectionRequest\x12\x43\n\x04name\x18\x01 \x01(\tB5\xe0\x41\x02\xfa\x41/\n-vmwareengine.googleapis.com/PrivateConnection\"\xaf\x01\n\x1dListPrivateConnectionsRequest\x12\x45\n\x06parent\x18\x01 \x01(\tB5\xe0\x41\x02\xfa\x41/\x12-vmwareengine.googleapis.com/PrivateConnection\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\x12\x0e\n\x06\x66ilter\x18\x04 \x01(\t\x12\x10\n\x08order_by\x18\x05 \x01(\t\"\x9c\x01\n\x1eListPrivateConnectionsResponse\x12L\n\x13private_connections\x18\x01 \x03(\x0b\x32/.google.cloud.vmwareengine.v1.PrivateConnection\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x13\n\x0bunreachable\x18\x03 \x03(\t\"\xc1\x01\n\x1eUpdatePrivateConnectionRequest\x12P\n\x12private_connection\x18\x01 \x01(\x0b\x32/.google.cloud.vmwareengine.v1.PrivateConnectionB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\x12\x17\n\nrequest_id\x18\x03 \x01(\tB\x03\xe0\x41\x01\"~\n\x1e\x44\x65letePrivateConnectionRequest\x12\x43\n\x04name\x18\x01 \x01(\tB5\xe0\x41\x02\xfa\x41/\n-vmwareengine.googleapis.com/PrivateConnection\x12\x17\n\nrequest_id\x18\x02 \x01(\tB\x03\xe0\x41\x01\"\x99\x01\n)ListPrivateConnectionPeeringRoutesRequest\x12\x45\n\x06parent\x18\x01 \x01(\tB5\xe0\x41\x02\xfa\x41/\n-vmwareengine.googleapis.com/PrivateConnection\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\"\x89\x01\n*ListPrivateConnectionPeeringRoutesResponse\x12\x42\n\x0epeering_routes\x18\x01 \x03(\x0b\x32*.google.cloud.vmwareengine.v1.PeeringRoute\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\xbe\x01\n\x1dGrantDnsBindPermissionRequest\x12\x43\n\x04name\x18\x01 \x01(\tB5\xe0\x41\x02\xfa\x41/\n-vmwareengine.googleapis.com/DnsBindPermission\x12?\n\tprincipal\x18\x02 \x01(\x0b\x32\'.google.cloud.vmwareengine.v1.PrincipalB\x03\xe0\x41\x02\x12\x17\n\nrequest_id\x18\x03 \x01(\tB\x03\xe0\x41\x01\"\xbf\x01\n\x1eRevokeDnsBindPermissionRequest\x12\x43\n\x04name\x18\x01 \x01(\tB5\xe0\x41\x02\xfa\x41/\n-vmwareengine.googleapis.com/DnsBindPermission\x12?\n\tprincipal\x18\x02 \x01(\x0b\x32\'.google.cloud.vmwareengine.v1.PrincipalB\x03\xe0\x41\x02\x12\x17\n\nrequest_id\x18\x03 \x01(\tB\x03\xe0\x41\x01\"b\n\x1bGetDnsBindPermissionRequest\x12\x43\n\x04name\x18\x01 \x01(\tB5\xe0\x41\x02\xfa\x41/\n-vmwareengine.googleapis.com/DnsBindPermission2\xdc\x8e\x01\n\x0cVmwareEngine\x12\xc8\x01\n\x11ListPrivateClouds\x12\x36.google.cloud.vmwareengine.v1.ListPrivateCloudsRequest\x1a\x37.google.cloud.vmwareengine.v1.ListPrivateCloudsResponse\"B\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x33\x12\x31/v1/{parent=projects/*/locations/*}/privateClouds\x12\xb5\x01\n\x0fGetPrivateCloud\x12\x34.google.cloud.vmwareengine.v1.GetPrivateCloudRequest\x1a*.google.cloud.vmwareengine.v1.PrivateCloud\"@\xda\x41\x04name\x82\xd3\xe4\x93\x02\x33\x12\x31/v1/{name=projects/*/locations/*/privateClouds/*}\x12\x83\x02\n\x12\x43reatePrivateCloud\x12\x37.google.cloud.vmwareengine.v1.CreatePrivateCloudRequest\x1a\x1d.google.longrunning.Operation\"\x94\x01\xca\x41!\n\x0cPrivateCloud\x12\x11OperationMetadata\xda\x41%parent,private_cloud,private_cloud_id\x82\xd3\xe4\x93\x02\x42\"1/v1/{parent=projects/*/locations/*}/privateClouds:\rprivate_cloud\x12\x85\x02\n\x12UpdatePrivateCloud\x12\x37.google.cloud.vmwareengine.v1.UpdatePrivateCloudRequest\x1a\x1d.google.longrunning.Operation\"\x96\x01\xca\x41!\n\x0cPrivateCloud\x12\x11OperationMetadata\xda\x41\x19private_cloud,update_mask\x82\xd3\xe4\x93\x02P2?/v1/{private_cloud.name=projects/*/locations/*/privateClouds/*}:\rprivate_cloud\x12\xd2\x01\n\x12\x44\x65letePrivateCloud\x12\x37.google.cloud.vmwareengine.v1.DeletePrivateCloudRequest\x1a\x1d.google.longrunning.Operation\"d\xca\x41!\n\x0cPrivateCloud\x12\x11OperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02\x33*1/v1/{name=projects/*/locations/*/privateClouds/*}\x12\xe2\x01\n\x14UndeletePrivateCloud\x12\x39.google.cloud.vmwareengine.v1.UndeletePrivateCloudRequest\x1a\x1d.google.longrunning.Operation\"p\xca\x41!\n\x0cPrivateCloud\x12\x11OperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02?\":/v1/{name=projects/*/locations/*/privateClouds/*}:undelete:\x01*\x12\xc4\x01\n\x0cListClusters\x12\x31.google.cloud.vmwareengine.v1.ListClustersRequest\x1a\x32.google.cloud.vmwareengine.v1.ListClustersResponse\"M\xda\x41\x06parent\x82\xd3\xe4\x93\x02>\x12\x12*\xda\x41\x06parent\x82\xd3\xe4\x93\x02/\x12-/v1/{parent=projects/*/locations/*}/nodeTypes\x12\xa5\x01\n\x0bGetNodeType\x12\x30.google.cloud.vmwareengine.v1.GetNodeTypeRequest\x1a&.google.cloud.vmwareengine.v1.NodeType\"<\xda\x41\x04name\x82\xd3\xe4\x93\x02/\x12-/v1/{name=projects/*/locations/*/nodeTypes/*}\x12\xdf\x01\n\x12ShowNsxCredentials\x12\x37.google.cloud.vmwareengine.v1.ShowNsxCredentialsRequest\x1a).google.cloud.vmwareengine.v1.Credentials\"e\xda\x41\rprivate_cloud\x82\xd3\xe4\x93\x02O\x12M/v1/{private_cloud=projects/*/locations/*/privateClouds/*}:showNsxCredentials\x12\xeb\x01\n\x16ShowVcenterCredentials\x12;.google.cloud.vmwareengine.v1.ShowVcenterCredentialsRequest\x1a).google.cloud.vmwareengine.v1.Credentials\"i\xda\x41\rprivate_cloud\x82\xd3\xe4\x93\x02S\x12Q/v1/{private_cloud=projects/*/locations/*/privateClouds/*}:showVcenterCredentials\x12\xfe\x01\n\x13ResetNsxCredentials\x12\x38.google.cloud.vmwareengine.v1.ResetNsxCredentialsRequest\x1a\x1d.google.longrunning.Operation\"\x8d\x01\xca\x41!\n\x0cPrivateCloud\x12\x11OperationMetadata\xda\x41\rprivate_cloud\x82\xd3\xe4\x93\x02S\"N/v1/{private_cloud=projects/*/locations/*/privateClouds/*}:resetNsxCredentials:\x01*\x12\x8a\x02\n\x17ResetVcenterCredentials\x12<.google.cloud.vmwareengine.v1.ResetVcenterCredentialsRequest\x1a\x1d.google.longrunning.Operation\"\x91\x01\xca\x41!\n\x0cPrivateCloud\x12\x11OperationMetadata\xda\x41\rprivate_cloud\x82\xd3\xe4\x93\x02W\"R/v1/{private_cloud=projects/*/locations/*/privateClouds/*}:resetVcenterCredentials:\x01*\x12\xc6\x01\n\x10GetDnsForwarding\x12\x35.google.cloud.vmwareengine.v1.GetDnsForwardingRequest\x1a+.google.cloud.vmwareengine.v1.DnsForwarding\"N\xda\x41\x04name\x82\xd3\xe4\x93\x02\x41\x12?/v1/{name=projects/*/locations/*/privateClouds/*/dnsForwarding}\x12\x99\x02\n\x13UpdateDnsForwarding\x12\x38.google.cloud.vmwareengine.v1.UpdateDnsForwardingRequest\x1a\x1d.google.longrunning.Operation\"\xa8\x01\xca\x41\"\n\rDnsForwarding\x12\x11OperationMetadata\xda\x41\x1a\x64ns_forwarding,update_mask\x82\xd3\xe4\x93\x02`2N/v1/{dns_forwarding.name=projects/*/locations/*/privateClouds/*/dnsForwarding}:\x0e\x64ns_forwarding\x12\xbd\x01\n\x11GetNetworkPeering\x12\x36.google.cloud.vmwareengine.v1.GetNetworkPeeringRequest\x1a,.google.cloud.vmwareengine.v1.NetworkPeering\"B\xda\x41\x04name\x82\xd3\xe4\x93\x02\x35\x12\x33/v1/{name=projects/*/locations/*/networkPeerings/*}\x12\xd0\x01\n\x13ListNetworkPeerings\x12\x38.google.cloud.vmwareengine.v1.ListNetworkPeeringsRequest\x1a\x39.google.cloud.vmwareengine.v1.ListNetworkPeeringsResponse\"D\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x35\x12\x33/v1/{parent=projects/*/locations/*}/networkPeerings\x12\x91\x02\n\x14\x43reateNetworkPeering\x12\x39.google.cloud.vmwareengine.v1.CreateNetworkPeeringRequest\x1a\x1d.google.longrunning.Operation\"\x9e\x01\xca\x41#\n\x0eNetworkPeering\x12\x11OperationMetadata\xda\x41)parent,network_peering,network_peering_id\x82\xd3\xe4\x93\x02\x46\"3/v1/{parent=projects/*/locations/*}/networkPeerings:\x0fnetwork_peering\x12\xe1\x01\n\x14\x44\x65leteNetworkPeering\x12\x39.google.cloud.vmwareengine.v1.DeleteNetworkPeeringRequest\x1a\x1d.google.longrunning.Operation\"o\xca\x41*\n\x15google.protobuf.Empty\x12\x11OperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02\x35*3/v1/{name=projects/*/locations/*/networkPeerings/*}\x12\x93\x02\n\x14UpdateNetworkPeering\x12\x39.google.cloud.vmwareengine.v1.UpdateNetworkPeeringRequest\x1a\x1d.google.longrunning.Operation\"\xa0\x01\xca\x41#\n\x0eNetworkPeering\x12\x11OperationMetadata\xda\x41\x1bnetwork_peering,update_mask\x82\xd3\xe4\x93\x02V2C/v1/{network_peering.name=projects/*/locations/*/networkPeerings/*}:\x0fnetwork_peering\x12\xda\x01\n\x11ListPeeringRoutes\x12\x36.google.cloud.vmwareengine.v1.ListPeeringRoutesRequest\x1a\x37.google.cloud.vmwareengine.v1.ListPeeringRoutesResponse\"T\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x45\x12\x43/v1/{parent=projects/*/locations/*/networkPeerings/*}/peeringRoutes\x12\xb2\x02\n\x16\x43reateHcxActivationKey\x12;.google.cloud.vmwareengine.v1.CreateHcxActivationKeyRequest\x1a\x1d.google.longrunning.Operation\"\xbb\x01\xca\x41%\n\x10HcxActivationKey\x12\x11OperationMetadata\xda\x41/parent,hcx_activation_key,hcx_activation_key_id\x82\xd3\xe4\x93\x02[\"E/v1/{parent=projects/*/locations/*/privateClouds/*}/hcxActivationKeys:\x12hcx_activation_key\x12\xe8\x01\n\x15ListHcxActivationKeys\x12:.google.cloud.vmwareengine.v1.ListHcxActivationKeysRequest\x1a;.google.cloud.vmwareengine.v1.ListHcxActivationKeysResponse\"V\xda\x41\x06parent\x82\xd3\xe4\x93\x02G\x12\x45/v1/{parent=projects/*/locations/*/privateClouds/*}/hcxActivationKeys\x12\xd5\x01\n\x13GetHcxActivationKey\x12\x38.google.cloud.vmwareengine.v1.GetHcxActivationKeyRequest\x1a..google.cloud.vmwareengine.v1.HcxActivationKey\"T\xda\x41\x04name\x82\xd3\xe4\x93\x02G\x12\x45/v1/{name=projects/*/locations/*/privateClouds/*/hcxActivationKeys/*}\x12\xba\x01\n\x10GetNetworkPolicy\x12\x35.google.cloud.vmwareengine.v1.GetNetworkPolicyRequest\x1a+.google.cloud.vmwareengine.v1.NetworkPolicy\"B\xda\x41\x04name\x82\xd3\xe4\x93\x02\x35\x12\x33/v1/{name=projects/*/locations/*/networkPolicies/*}\x12\xd0\x01\n\x13ListNetworkPolicies\x12\x38.google.cloud.vmwareengine.v1.ListNetworkPoliciesRequest\x1a\x39.google.cloud.vmwareengine.v1.ListNetworkPoliciesResponse\"D\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x35\x12\x33/v1/{parent=projects/*/locations/*}/networkPolicies\x12\x8b\x02\n\x13\x43reateNetworkPolicy\x12\x38.google.cloud.vmwareengine.v1.CreateNetworkPolicyRequest\x1a\x1d.google.longrunning.Operation\"\x9a\x01\xca\x41\"\n\rNetworkPolicy\x12\x11OperationMetadata\xda\x41\'parent,network_policy,network_policy_id\x82\xd3\xe4\x93\x02\x45\"3/v1/{parent=projects/*/locations/*}/networkPolicies:\x0enetwork_policy\x12\x8d\x02\n\x13UpdateNetworkPolicy\x12\x38.google.cloud.vmwareengine.v1.UpdateNetworkPolicyRequest\x1a\x1d.google.longrunning.Operation\"\x9c\x01\xca\x41\"\n\rNetworkPolicy\x12\x11OperationMetadata\xda\x41\x1anetwork_policy,update_mask\x82\xd3\xe4\x93\x02T2B/v1/{network_policy.name=projects/*/locations/*/networkPolicies/*}:\x0enetwork_policy\x12\xdf\x01\n\x13\x44\x65leteNetworkPolicy\x12\x38.google.cloud.vmwareengine.v1.DeleteNetworkPolicyRequest\x1a\x1d.google.longrunning.Operation\"o\xca\x41*\n\x15google.protobuf.Empty\x12\x11OperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02\x35*3/v1/{name=projects/*/locations/*/networkPolicies/*}\x12\x88\x02\n\x1dListManagementDnsZoneBindings\x12\x42.google.cloud.vmwareengine.v1.ListManagementDnsZoneBindingsRequest\x1a\x43.google.cloud.vmwareengine.v1.ListManagementDnsZoneBindingsResponse\"^\xda\x41\x06parent\x82\xd3\xe4\x93\x02O\x12M/v1/{parent=projects/*/locations/*/privateClouds/*}/managementDnsZoneBindings\x12\xf5\x01\n\x1bGetManagementDnsZoneBinding\x12@.google.cloud.vmwareengine.v1.GetManagementDnsZoneBindingRequest\x1a\x36.google.cloud.vmwareengine.v1.ManagementDnsZoneBinding\"\\\xda\x41\x04name\x82\xd3\xe4\x93\x02O\x12M/v1/{name=projects/*/locations/*/privateClouds/*/managementDnsZoneBindings/*}\x12\xed\x02\n\x1e\x43reateManagementDnsZoneBinding\x12\x43.google.cloud.vmwareengine.v1.CreateManagementDnsZoneBindingRequest\x1a\x1d.google.longrunning.Operation\"\xe6\x01\xca\x41-\n\x18ManagementDnsZoneBinding\x12\x11OperationMetadata\xda\x41\x41parent,management_dns_zone_binding,management_dns_zone_binding_id\x82\xd3\xe4\x93\x02l\"M/v1/{parent=projects/*/locations/*/privateClouds/*}/managementDnsZoneBindings:\x1bmanagement_dns_zone_binding\x12\xf0\x02\n\x1eUpdateManagementDnsZoneBinding\x12\x43.google.cloud.vmwareengine.v1.UpdateManagementDnsZoneBindingRequest\x1a\x1d.google.longrunning.Operation\"\xe9\x01\xca\x41-\n\x18ManagementDnsZoneBinding\x12\x11OperationMetadata\xda\x41\'management_dns_zone_binding,update_mask\x82\xd3\xe4\x93\x02\x88\x01\x32i/v1/{management_dns_zone_binding.name=projects/*/locations/*/privateClouds/*/managementDnsZoneBindings/*}:\x1bmanagement_dns_zone_binding\x12\x90\x02\n\x1e\x44\x65leteManagementDnsZoneBinding\x12\x43.google.cloud.vmwareengine.v1.DeleteManagementDnsZoneBindingRequest\x1a\x1d.google.longrunning.Operation\"\x89\x01\xca\x41*\n\x15google.protobuf.Empty\x12\x11OperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02O*M/v1/{name=projects/*/locations/*/privateClouds/*/managementDnsZoneBindings/*}\x12\x9d\x02\n\x1eRepairManagementDnsZoneBinding\x12\x43.google.cloud.vmwareengine.v1.RepairManagementDnsZoneBindingRequest\x1a\x1d.google.longrunning.Operation\"\x96\x01\xca\x41-\n\x18ManagementDnsZoneBinding\x12\x11OperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02Y\"T/v1/{name=projects/*/locations/*/privateClouds/*/managementDnsZoneBindings/*}:repair:\x01*\x12\xb7\x02\n\x19\x43reateVmwareEngineNetwork\x12>.google.cloud.vmwareengine.v1.CreateVmwareEngineNetworkRequest\x1a\x1d.google.longrunning.Operation\"\xba\x01\xca\x41(\n\x13VmwareEngineNetwork\x12\x11OperationMetadata\xda\x41\x35parent,vmware_engine_network,vmware_engine_network_id\x82\xd3\xe4\x93\x02Q\"8/v1/{parent=projects/*/locations/*}/vmwareEngineNetworks:\x15vmware_engine_network\x12\xb9\x02\n\x19UpdateVmwareEngineNetwork\x12>.google.cloud.vmwareengine.v1.UpdateVmwareEngineNetworkRequest\x1a\x1d.google.longrunning.Operation\"\xbc\x01\xca\x41(\n\x13VmwareEngineNetwork\x12\x11OperationMetadata\xda\x41!vmware_engine_network,update_mask\x82\xd3\xe4\x93\x02g2N/v1/{vmware_engine_network.name=projects/*/locations/*/vmwareEngineNetworks/*}:\x15vmware_engine_network\x12\xf0\x01\n\x19\x44\x65leteVmwareEngineNetwork\x12>.google.cloud.vmwareengine.v1.DeleteVmwareEngineNetworkRequest\x1a\x1d.google.longrunning.Operation\"t\xca\x41*\n\x15google.protobuf.Empty\x12\x11OperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02:*8/v1/{name=projects/*/locations/*/vmwareEngineNetworks/*}\x12\xd1\x01\n\x16GetVmwareEngineNetwork\x12;.google.cloud.vmwareengine.v1.GetVmwareEngineNetworkRequest\x1a\x31.google.cloud.vmwareengine.v1.VmwareEngineNetwork\"G\xda\x41\x04name\x82\xd3\xe4\x93\x02:\x12\x38/v1/{name=projects/*/locations/*/vmwareEngineNetworks/*}\x12\xe4\x01\n\x18ListVmwareEngineNetworks\x12=.google.cloud.vmwareengine.v1.ListVmwareEngineNetworksRequest\x1a>.google.cloud.vmwareengine.v1.ListVmwareEngineNetworksResponse\"I\xda\x41\x06parent\x82\xd3\xe4\x93\x02:\x12\x38/v1/{parent=projects/*/locations/*}/vmwareEngineNetworks\x12\xa6\x02\n\x17\x43reatePrivateConnection\x12<.google.cloud.vmwareengine.v1.CreatePrivateConnectionRequest\x1a\x1d.google.longrunning.Operation\"\xad\x01\xca\x41&\n\x11PrivateConnection\x12\x11OperationMetadata\xda\x41/parent,private_connection,private_connection_id\x82\xd3\xe4\x93\x02L\"6/v1/{parent=projects/*/locations/*}/privateConnections:\x12private_connection\x12\xc9\x01\n\x14GetPrivateConnection\x12\x39.google.cloud.vmwareengine.v1.GetPrivateConnectionRequest\x1a/.google.cloud.vmwareengine.v1.PrivateConnection\"E\xda\x41\x04name\x82\xd3\xe4\x93\x02\x38\x12\x36/v1/{name=projects/*/locations/*/privateConnections/*}\x12\xdc\x01\n\x16ListPrivateConnections\x12;.google.cloud.vmwareengine.v1.ListPrivateConnectionsRequest\x1a<.google.cloud.vmwareengine.v1.ListPrivateConnectionsResponse\"G\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x38\x12\x36/v1/{parent=projects/*/locations/*}/privateConnections\x12\xa8\x02\n\x17UpdatePrivateConnection\x12<.google.cloud.vmwareengine.v1.UpdatePrivateConnectionRequest\x1a\x1d.google.longrunning.Operation\"\xaf\x01\xca\x41&\n\x11PrivateConnection\x12\x11OperationMetadata\xda\x41\x1eprivate_connection,update_mask\x82\xd3\xe4\x93\x02_2I/v1/{private_connection.name=projects/*/locations/*/privateConnections/*}:\x12private_connection\x12\xea\x01\n\x17\x44\x65letePrivateConnection\x12<.google.cloud.vmwareengine.v1.DeletePrivateConnectionRequest\x1a\x1d.google.longrunning.Operation\"r\xca\x41*\n\x15google.protobuf.Empty\x12\x11OperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02\x38*6/v1/{name=projects/*/locations/*/privateConnections/*}\x12\x90\x02\n\"ListPrivateConnectionPeeringRoutes\x12G.google.cloud.vmwareengine.v1.ListPrivateConnectionPeeringRoutesRequest\x1aH.google.cloud.vmwareengine.v1.ListPrivateConnectionPeeringRoutesResponse\"W\xda\x41\x06parent\x82\xd3\xe4\x93\x02H\x12\x46/v1/{parent=projects/*/locations/*/privateConnections/*}/peeringRoutes\x12\xf4\x01\n\x16GrantDnsBindPermission\x12;.google.cloud.vmwareengine.v1.GrantDnsBindPermissionRequest\x1a\x1d.google.longrunning.Operation\"~\xca\x41&\n\x11\x44nsBindPermission\x12\x11OperationMetadata\xda\x41\x0ename,principal\x82\xd3\xe4\x93\x02>\"9/v1/{name=projects/*/locations/*/dnsBindPermission}:grant:\x01*\x12\xc6\x01\n\x14GetDnsBindPermission\x12\x39.google.cloud.vmwareengine.v1.GetDnsBindPermissionRequest\x1a/.google.cloud.vmwareengine.v1.DnsBindPermission\"B\xda\x41\x04name\x82\xd3\xe4\x93\x02\x35\x12\x33/v1/{name=projects/*/locations/*/dnsBindPermission}\x12\xf7\x01\n\x17RevokeDnsBindPermission\x12<.google.cloud.vmwareengine.v1.RevokeDnsBindPermissionRequest\x1a\x1d.google.longrunning.Operation\"\x7f\xca\x41&\n\x11\x44nsBindPermission\x12\x11OperationMetadata\xda\x41\x0ename,principal\x82\xd3\xe4\x93\x02?\":/v1/{name=projects/*/locations/*/dnsBindPermission}:revoke:\x01*\x1aO\xca\x41\x1bvmwareengine.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\xae\x02\n com.google.cloud.vmwareengine.v1B\x11VmwareengineProtoP\x01ZDcloud.google.com/go/vmwareengine/apiv1/vmwareenginepb;vmwareenginepb\xaa\x02\x1cGoogle.Cloud.VmwareEngine.V1\xca\x02\x1cGoogle\\Cloud\\VmwareEngine\\V1\xea\x02\x1fGoogle::Cloud::VmwareEngine::V1\xea\x41N\n\x1e\x63ompute.googleapis.com/Network\x12,projects/{project}/global/networks/{network}b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module VmwareEngine - module V1 - ListPrivateCloudsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.ListPrivateCloudsRequest").msgclass - ListPrivateCloudsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.ListPrivateCloudsResponse").msgclass - GetPrivateCloudRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.GetPrivateCloudRequest").msgclass - CreatePrivateCloudRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.CreatePrivateCloudRequest").msgclass - UpdatePrivateCloudRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.UpdatePrivateCloudRequest").msgclass - DeletePrivateCloudRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.DeletePrivateCloudRequest").msgclass - UndeletePrivateCloudRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.UndeletePrivateCloudRequest").msgclass - ListClustersRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.ListClustersRequest").msgclass - ListClustersResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.ListClustersResponse").msgclass - GetClusterRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.GetClusterRequest").msgclass - CreateClusterRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.CreateClusterRequest").msgclass - UpdateClusterRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.UpdateClusterRequest").msgclass - DeleteClusterRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.DeleteClusterRequest").msgclass - ListNodesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.ListNodesRequest").msgclass - ListNodesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.ListNodesResponse").msgclass - GetNodeRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.GetNodeRequest").msgclass - ListExternalAddressesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.ListExternalAddressesRequest").msgclass - ListExternalAddressesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.ListExternalAddressesResponse").msgclass - FetchNetworkPolicyExternalAddressesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.FetchNetworkPolicyExternalAddressesRequest").msgclass - FetchNetworkPolicyExternalAddressesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.FetchNetworkPolicyExternalAddressesResponse").msgclass - GetExternalAddressRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.GetExternalAddressRequest").msgclass - CreateExternalAddressRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.CreateExternalAddressRequest").msgclass - UpdateExternalAddressRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.UpdateExternalAddressRequest").msgclass - DeleteExternalAddressRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.DeleteExternalAddressRequest").msgclass - ListSubnetsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.ListSubnetsRequest").msgclass - ListSubnetsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.ListSubnetsResponse").msgclass - GetSubnetRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.GetSubnetRequest").msgclass - UpdateSubnetRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.UpdateSubnetRequest").msgclass - ListExternalAccessRulesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.ListExternalAccessRulesRequest").msgclass - ListExternalAccessRulesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.ListExternalAccessRulesResponse").msgclass - GetExternalAccessRuleRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.GetExternalAccessRuleRequest").msgclass - CreateExternalAccessRuleRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.CreateExternalAccessRuleRequest").msgclass - UpdateExternalAccessRuleRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.UpdateExternalAccessRuleRequest").msgclass - DeleteExternalAccessRuleRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.DeleteExternalAccessRuleRequest").msgclass - ListLoggingServersRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.ListLoggingServersRequest").msgclass - ListLoggingServersResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.ListLoggingServersResponse").msgclass - GetLoggingServerRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.GetLoggingServerRequest").msgclass - CreateLoggingServerRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.CreateLoggingServerRequest").msgclass - UpdateLoggingServerRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.UpdateLoggingServerRequest").msgclass - DeleteLoggingServerRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.DeleteLoggingServerRequest").msgclass - OperationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.OperationMetadata").msgclass - ListNodeTypesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.ListNodeTypesRequest").msgclass - ListNodeTypesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.ListNodeTypesResponse").msgclass - GetNodeTypeRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.GetNodeTypeRequest").msgclass - ShowNsxCredentialsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.ShowNsxCredentialsRequest").msgclass - ShowVcenterCredentialsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.ShowVcenterCredentialsRequest").msgclass - ResetNsxCredentialsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.ResetNsxCredentialsRequest").msgclass - ResetVcenterCredentialsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.ResetVcenterCredentialsRequest").msgclass - ListHcxActivationKeysResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.ListHcxActivationKeysResponse").msgclass - ListHcxActivationKeysRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.ListHcxActivationKeysRequest").msgclass - GetHcxActivationKeyRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.GetHcxActivationKeyRequest").msgclass - CreateHcxActivationKeyRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.CreateHcxActivationKeyRequest").msgclass - GetDnsForwardingRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.GetDnsForwardingRequest").msgclass - UpdateDnsForwardingRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.UpdateDnsForwardingRequest").msgclass - CreateNetworkPeeringRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.CreateNetworkPeeringRequest").msgclass - DeleteNetworkPeeringRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.DeleteNetworkPeeringRequest").msgclass - GetNetworkPeeringRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.GetNetworkPeeringRequest").msgclass - ListNetworkPeeringsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.ListNetworkPeeringsRequest").msgclass - UpdateNetworkPeeringRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.UpdateNetworkPeeringRequest").msgclass - ListNetworkPeeringsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.ListNetworkPeeringsResponse").msgclass - ListPeeringRoutesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.ListPeeringRoutesRequest").msgclass - ListPeeringRoutesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.ListPeeringRoutesResponse").msgclass - ListNetworkPoliciesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.ListNetworkPoliciesRequest").msgclass - ListNetworkPoliciesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.ListNetworkPoliciesResponse").msgclass - GetNetworkPolicyRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.GetNetworkPolicyRequest").msgclass - UpdateNetworkPolicyRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.UpdateNetworkPolicyRequest").msgclass - CreateNetworkPolicyRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.CreateNetworkPolicyRequest").msgclass - DeleteNetworkPolicyRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.DeleteNetworkPolicyRequest").msgclass - ListManagementDnsZoneBindingsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.ListManagementDnsZoneBindingsRequest").msgclass - ListManagementDnsZoneBindingsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.ListManagementDnsZoneBindingsResponse").msgclass - GetManagementDnsZoneBindingRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.GetManagementDnsZoneBindingRequest").msgclass - CreateManagementDnsZoneBindingRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.CreateManagementDnsZoneBindingRequest").msgclass - UpdateManagementDnsZoneBindingRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.UpdateManagementDnsZoneBindingRequest").msgclass - DeleteManagementDnsZoneBindingRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.DeleteManagementDnsZoneBindingRequest").msgclass - RepairManagementDnsZoneBindingRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.RepairManagementDnsZoneBindingRequest").msgclass - CreateVmwareEngineNetworkRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.CreateVmwareEngineNetworkRequest").msgclass - UpdateVmwareEngineNetworkRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.UpdateVmwareEngineNetworkRequest").msgclass - DeleteVmwareEngineNetworkRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.DeleteVmwareEngineNetworkRequest").msgclass - GetVmwareEngineNetworkRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.GetVmwareEngineNetworkRequest").msgclass - ListVmwareEngineNetworksRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.ListVmwareEngineNetworksRequest").msgclass - ListVmwareEngineNetworksResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.ListVmwareEngineNetworksResponse").msgclass - CreatePrivateConnectionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.CreatePrivateConnectionRequest").msgclass - GetPrivateConnectionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.GetPrivateConnectionRequest").msgclass - ListPrivateConnectionsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.ListPrivateConnectionsRequest").msgclass - ListPrivateConnectionsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.ListPrivateConnectionsResponse").msgclass - UpdatePrivateConnectionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.UpdatePrivateConnectionRequest").msgclass - DeletePrivateConnectionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.DeletePrivateConnectionRequest").msgclass - ListPrivateConnectionPeeringRoutesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.ListPrivateConnectionPeeringRoutesRequest").msgclass - ListPrivateConnectionPeeringRoutesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.ListPrivateConnectionPeeringRoutesResponse").msgclass - GrantDnsBindPermissionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.GrantDnsBindPermissionRequest").msgclass - RevokeDnsBindPermissionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.RevokeDnsBindPermissionRequest").msgclass - GetDnsBindPermissionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.GetDnsBindPermissionRequest").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-vmware_engine-v1/lib/google/cloud/vmwareengine/v1/vmwareengine_resources_pb.rb b/owl-bot-staging/google-cloud-vmware_engine-v1/lib/google/cloud/vmwareengine/v1/vmwareengine_resources_pb.rb deleted file mode 100644 index dfe653fa01c6..000000000000 --- a/owl-bot-staging/google-cloud-vmware_engine-v1/lib/google/cloud/vmwareengine/v1/vmwareengine_resources_pb.rb +++ /dev/null @@ -1,90 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/vmwareengine/v1/vmwareengine_resources.proto - -require 'google/protobuf' - -require 'google/api/field_behavior_pb' -require 'google/api/field_info_pb' -require 'google/api/resource_pb' -require 'google/protobuf/duration_pb' -require 'google/protobuf/timestamp_pb' - - -descriptor_data = "\n9google/cloud/vmwareengine/v1/vmwareengine_resources.proto\x12\x1cgoogle.cloud.vmwareengine.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x1bgoogle/api/field_info.proto\x1a\x19google/api/resource.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xb6\x02\n\rNetworkConfig\x12\x1c\n\x0fmanagement_cidr\x18\x04 \x01(\tB\x03\xe0\x41\x02\x12V\n\x15vmware_engine_network\x18\x05 \x01(\tB7\xe0\x41\x01\xfa\x41\x31\n/vmwareengine.googleapis.com/VmwareEngineNetwork\x12`\n\x1fvmware_engine_network_canonical\x18\x06 \x01(\tB7\xe0\x41\x03\xfa\x41\x31\n/vmwareengine.googleapis.com/VmwareEngineNetwork\x12\x31\n$management_ip_address_layout_version\x18\x08 \x01(\x05\x42\x03\xe0\x41\x03\x12\x1a\n\rdns_server_ip\x18\t \x01(\tB\x03\xe0\x41\x03\"I\n\x0eNodeTypeConfig\x12\x17\n\nnode_count\x18\x01 \x01(\x05\x42\x03\xe0\x41\x02\x12\x1e\n\x11\x63ustom_core_count\x18\x02 \x01(\x05\x42\x03\xe0\x41\x01\"\xa6\x01\n\x16StretchedClusterConfig\x12\x45\n\x12preferred_location\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\x12\x45\n\x12secondary_location\x18\x02 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\"\xfd\n\n\x0cPrivateCloud\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\x12\x34\n\x0bupdate_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0b\x64\x65lete_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\x44\n\x05state\x18\x08 \x01(\x0e\x32\x30.google.cloud.vmwareengine.v1.PrivateCloud.StateB\x03\xe0\x41\x03\x12H\n\x0enetwork_config\x18\t \x01(\x0b\x32+.google.cloud.vmwareengine.v1.NetworkConfigB\x03\xe0\x41\x02\x12`\n\x12management_cluster\x18\n \x01(\x0b\x32<.google.cloud.vmwareengine.v1.PrivateCloud.ManagementClusterB\x06\xe0\x41\x04\xe0\x41\x02\x12\x13\n\x0b\x64\x65scription\x18\x0b \x01(\t\x12\x33\n\x03hcx\x18\x11 \x01(\x0b\x32!.google.cloud.vmwareengine.v1.HcxB\x03\xe0\x41\x03\x12\x33\n\x03nsx\x18\x12 \x01(\x0b\x32!.google.cloud.vmwareengine.v1.NsxB\x03\xe0\x41\x03\x12;\n\x07vcenter\x18\x13 \x01(\x0b\x32%.google.cloud.vmwareengine.v1.VcenterB\x03\xe0\x41\x03\x12\x10\n\x03uid\x18\x14 \x01(\tB\x03\xe0\x41\x03\x12\x42\n\x04type\x18\x16 \x01(\x0e\x32/.google.cloud.vmwareengine.v1.PrivateCloud.TypeB\x03\xe0\x41\x01\x1a\xe2\x02\n\x11ManagementCluster\x12\x17\n\ncluster_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12q\n\x11node_type_configs\x18\x07 \x03(\x0b\x32Q.google.cloud.vmwareengine.v1.PrivateCloud.ManagementCluster.NodeTypeConfigsEntryB\x03\xe0\x41\x02\x12[\n\x18stretched_cluster_config\x18\x08 \x01(\x0b\x32\x34.google.cloud.vmwareengine.v1.StretchedClusterConfigB\x03\xe0\x41\x01\x1a\x64\n\x14NodeTypeConfigsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12;\n\x05value\x18\x02 \x01(\x0b\x32,.google.cloud.vmwareengine.v1.NodeTypeConfig:\x02\x38\x01\"l\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\n\n\x06\x41\x43TIVE\x10\x01\x12\x0c\n\x08\x43REATING\x10\x02\x12\x0c\n\x08UPDATING\x10\x03\x12\n\n\x06\x46\x41ILED\x10\x05\x12\x0b\n\x07\x44\x45LETED\x10\x06\x12\x0b\n\x07PURGING\x10\x07\"5\n\x04Type\x12\x0c\n\x08STANDARD\x10\x00\x12\x10\n\x0cTIME_LIMITED\x10\x01\x12\r\n\tSTRETCHED\x10\x02:t\xea\x41q\n(vmwareengine.googleapis.com/PrivateCloud\x12\x45projects/{project}/locations/{location}/privateClouds/{private_cloud}\"\xd3\x06\n\x07\x43luster\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\x12\x34\n\x0bupdate_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12?\n\x05state\x18\x06 \x01(\x0e\x32+.google.cloud.vmwareengine.v1.Cluster.StateB\x03\xe0\x41\x03\x12\x17\n\nmanagement\x18\x07 \x01(\x08\x42\x03\xe0\x41\x03\x12T\n\x14\x61utoscaling_settings\x18\x12 \x01(\x0b\x32\x31.google.cloud.vmwareengine.v1.AutoscalingSettingsB\x03\xe0\x41\x01\x12\x10\n\x03uid\x18\x0e \x01(\tB\x03\xe0\x41\x03\x12Z\n\x11node_type_configs\x18\x10 \x03(\x0b\x32:.google.cloud.vmwareengine.v1.Cluster.NodeTypeConfigsEntryB\x03\xe0\x41\x02\x12[\n\x18stretched_cluster_config\x18\x11 \x01(\x0b\x32\x34.google.cloud.vmwareengine.v1.StretchedClusterConfigB\x03\xe0\x41\x01\x1a\x64\n\x14NodeTypeConfigsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12;\n\x05value\x18\x02 \x01(\x0b\x32,.google.cloud.vmwareengine.v1.NodeTypeConfig:\x02\x38\x01\"c\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\n\n\x06\x41\x43TIVE\x10\x01\x12\x0c\n\x08\x43REATING\x10\x02\x12\x0c\n\x08UPDATING\x10\x03\x12\x0c\n\x08\x44\x45LETING\x10\x04\x12\r\n\tREPAIRING\x10\x05:\x82\x01\xea\x41\x7f\n#vmwareengine.googleapis.com/Cluster\x12Xprojects/{project}/locations/{location}/privateClouds/{private_cloud}/clusters/{cluster}\"\xba\x03\n\x04Node\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x11\n\x04\x66qdn\x18\x02 \x01(\tB\x03\xe0\x41\x03\x12\x18\n\x0binternal_ip\x18\x03 \x01(\tB\x03\xe0\x41\x03\x12\x19\n\x0cnode_type_id\x18\x04 \x01(\tB\x03\xe0\x41\x03\x12\x14\n\x07version\x18\x05 \x01(\tB\x03\xe0\x41\x03\x12\x1e\n\x11\x63ustom_core_count\x18\x06 \x01(\x03\x42\x03\xe0\x41\x03\x12<\n\x05state\x18\x07 \x01(\x0e\x32(.google.cloud.vmwareengine.v1.Node.StateB\x03\xe0\x41\x03\"S\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\n\n\x06\x41\x43TIVE\x10\x01\x12\x0c\n\x08\x43REATING\x10\x02\x12\n\n\x06\x46\x41ILED\x10\x03\x12\r\n\tUPGRADING\x10\x04:\x8d\x01\xea\x41\x89\x01\n vmwareengine.googleapis.com/Node\x12\x65projects/{project}/locations/{location}/privateClouds/{private_cloud}/clusters/{cluster}/nodes/{node}\"\xa5\x04\n\x0f\x45xternalAddress\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\x12\x34\n\x0bupdate_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x13\n\x0binternal_ip\x18\x06 \x01(\t\x12\x18\n\x0b\x65xternal_ip\x18\x07 \x01(\tB\x03\xe0\x41\x03\x12G\n\x05state\x18\x08 \x01(\x0e\x32\x33.google.cloud.vmwareengine.v1.ExternalAddress.StateB\x03\xe0\x41\x03\x12\x10\n\x03uid\x18\t \x01(\tB\x03\xe0\x41\x03\x12\x13\n\x0b\x64\x65scription\x18\x0b \x01(\t\"T\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\n\n\x06\x41\x43TIVE\x10\x01\x12\x0c\n\x08\x43REATING\x10\x02\x12\x0c\n\x08UPDATING\x10\x03\x12\x0c\n\x08\x44\x45LETING\x10\x04:\x9d\x01\xea\x41\x99\x01\n+vmwareengine.googleapis.com/ExternalAddress\x12jprojects/{project}/locations/{location}/privateClouds/{private_cloud}/externalAddresses/{external_address}\"\xa3\x03\n\x06Subnet\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x15\n\rip_cidr_range\x18\x07 \x01(\t\x12\x12\n\ngateway_ip\x18\x08 \x01(\t\x12\x11\n\x04type\x18\x0b \x01(\tB\x03\xe0\x41\x03\x12>\n\x05state\x18\r \x01(\x0e\x32*.google.cloud.vmwareengine.v1.Subnet.StateB\x03\xe0\x41\x03\x12\x14\n\x07vlan_id\x18\x10 \x01(\x05\x42\x03\xe0\x41\x03\"q\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\n\n\x06\x41\x43TIVE\x10\x01\x12\x0c\n\x08\x43REATING\x10\x02\x12\x0c\n\x08UPDATING\x10\x03\x12\x0c\n\x08\x44\x45LETING\x10\x04\x12\x0f\n\x0bRECONCILING\x10\x05\x12\n\n\x06\x46\x41ILED\x10\x06:\x7f\xea\x41|\n\"vmwareengine.googleapis.com/Subnet\x12Vprojects/{project}/locations/{location}/privateClouds/{private_cloud}/subnets/{subnet}\"\xa5\x08\n\x12\x45xternalAccessRule\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\x12\x34\n\x0bupdate_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x13\n\x0b\x64\x65scription\x18\x05 \x01(\t\x12\x10\n\x08priority\x18\x06 \x01(\x05\x12G\n\x06\x61\x63tion\x18\x07 \x01(\x0e\x32\x37.google.cloud.vmwareengine.v1.ExternalAccessRule.Action\x12\x13\n\x0bip_protocol\x18\x08 \x01(\t\x12R\n\x10source_ip_ranges\x18\t \x03(\x0b\x32\x38.google.cloud.vmwareengine.v1.ExternalAccessRule.IpRange\x12\x14\n\x0csource_ports\x18\n \x03(\t\x12W\n\x15\x64\x65stination_ip_ranges\x18\x0b \x03(\x0b\x32\x38.google.cloud.vmwareengine.v1.ExternalAccessRule.IpRange\x12\x19\n\x11\x64\x65stination_ports\x18\x0c \x03(\t\x12J\n\x05state\x18\r \x01(\x0e\x32\x36.google.cloud.vmwareengine.v1.ExternalAccessRule.StateB\x03\xe0\x41\x03\x12\x10\n\x03uid\x18\x0e \x01(\tB\x03\xe0\x41\x03\x1a\x95\x01\n\x07IpRange\x12\x14\n\nip_address\x18\x01 \x01(\tH\x00\x12\x1a\n\x10ip_address_range\x18\x02 \x01(\tH\x00\x12L\n\x10\x65xternal_address\x18\x03 \x01(\tB0\xfa\x41-\n+vmwareengine.googleapis.com/ExternalAddressH\x00\x42\n\n\x08ip_range\"5\n\x06\x41\x63tion\x12\x16\n\x12\x41\x43TION_UNSPECIFIED\x10\x00\x12\t\n\x05\x41LLOW\x10\x01\x12\x08\n\x04\x44\x45NY\x10\x02\"T\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\n\n\x06\x41\x43TIVE\x10\x01\x12\x0c\n\x08\x43REATING\x10\x02\x12\x0c\n\x08UPDATING\x10\x03\x12\x0c\n\x08\x44\x45LETING\x10\x04:\xa9\x01\xea\x41\xa5\x01\n.vmwareengine.googleapis.com/ExternalAccessRule\x12sprojects/{project}/locations/{location}/networkPolicies/{network_policy}/externalAccessRules/{external_access_rule}\"\x95\x05\n\rLoggingServer\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\x12\x34\n\x0bupdate_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x15\n\x08hostname\x18\x05 \x01(\tB\x03\xe0\x41\x02\x12\x11\n\x04port\x18\x07 \x01(\x05\x42\x03\xe0\x41\x02\x12K\n\x08protocol\x18\x06 \x01(\x0e\x32\x34.google.cloud.vmwareengine.v1.LoggingServer.ProtocolB\x03\xe0\x41\x02\x12P\n\x0bsource_type\x18\n \x01(\x0e\x32\x36.google.cloud.vmwareengine.v1.LoggingServer.SourceTypeB\x03\xe0\x41\x02\x12\x10\n\x03uid\x18\x08 \x01(\tB\x03\xe0\x41\x03\"R\n\x08Protocol\x12\x18\n\x14PROTOCOL_UNSPECIFIED\x10\x00\x12\x07\n\x03UDP\x10\x01\x12\x07\n\x03TCP\x10\x02\x12\x07\n\x03TLS\x10\x03\x12\x07\n\x03SSL\x10\x04\x12\x08\n\x04RELP\x10\x05\"=\n\nSourceType\x12\x1b\n\x17SOURCE_TYPE_UNSPECIFIED\x10\x00\x12\x08\n\x04\x45SXI\x10\x01\x12\x08\n\x04VCSA\x10\x02:\x96\x01\xea\x41\x92\x01\n)vmwareengine.googleapis.com/LoggingServer\x12\x65projects/{project}/locations/{location}/privateClouds/{private_cloud}/loggingServers/{logging_server}\"\xff\x04\n\x08NodeType\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x19\n\x0cnode_type_id\x18\x02 \x01(\tB\x03\xe0\x41\x03\x12\x19\n\x0c\x64isplay_name\x18\x03 \x01(\tB\x03\xe0\x41\x03\x12\x1e\n\x11virtual_cpu_count\x18\x04 \x01(\x05\x42\x03\xe0\x41\x03\x12\x1d\n\x10total_core_count\x18\x05 \x01(\x05\x42\x03\xe0\x41\x03\x12\x16\n\tmemory_gb\x18\x07 \x01(\x05\x42\x03\xe0\x41\x03\x12\x19\n\x0c\x64isk_size_gb\x18\x08 \x01(\x05\x42\x03\xe0\x41\x03\x12)\n\x1c\x61vailable_custom_core_counts\x18\x0b \x03(\x05\x42\x03\xe0\x41\x03\x12>\n\x04kind\x18\x0c \x01(\x0e\x32+.google.cloud.vmwareengine.v1.NodeType.KindB\x03\xe0\x41\x03\x12\x15\n\x08\x66\x61milies\x18\r \x03(\tB\x03\xe0\x41\x03\x12L\n\x0c\x63\x61pabilities\x18\x0e \x03(\x0e\x32\x31.google.cloud.vmwareengine.v1.NodeType.CapabilityB\x03\xe0\x41\x03\"<\n\x04Kind\x12\x14\n\x10KIND_UNSPECIFIED\x10\x00\x12\x0c\n\x08STANDARD\x10\x01\x12\x10\n\x0cSTORAGE_ONLY\x10\x02\"@\n\nCapability\x12\x1a\n\x16\x43\x41PABILITY_UNSPECIFIED\x10\x00\x12\x16\n\x12STRETCHED_CLUSTERS\x10\x01:h\xea\x41\x65\n$vmwareengine.googleapis.com/NodeType\x12=projects/{project}/locations/{location}/nodeTypes/{node_type}\"1\n\x0b\x43redentials\x12\x10\n\x08username\x18\x01 \x01(\t\x12\x10\n\x08password\x18\x02 \x01(\t\"\xc2\x03\n\x10HcxActivationKey\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\x12H\n\x05state\x18\x03 \x01(\x0e\x32\x34.google.cloud.vmwareengine.v1.HcxActivationKey.StateB\x03\xe0\x41\x03\x12\x1b\n\x0e\x61\x63tivation_key\x18\x04 \x01(\tB\x03\xe0\x41\x03\x12\x10\n\x03uid\x18\x05 \x01(\tB\x03\xe0\x41\x03\"I\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\r\n\tAVAILABLE\x10\x01\x12\x0c\n\x08\x43ONSUMED\x10\x02\x12\x0c\n\x08\x43REATING\x10\x03:\xa0\x01\xea\x41\x9c\x01\n,vmwareengine.googleapis.com/HcxActivationKey\x12lprojects/{project}/locations/{location}/privateClouds/{private_cloud}/hcxActivationKeys/{hcx_activation_key}\"\xc0\x01\n\x03Hcx\x12\x13\n\x0binternal_ip\x18\x02 \x01(\t\x12\x0f\n\x07version\x18\x04 \x01(\t\x12;\n\x05state\x18\x05 \x01(\x0e\x32\'.google.cloud.vmwareengine.v1.Hcx.StateB\x03\xe0\x41\x03\x12\x0c\n\x04\x66qdn\x18\x06 \x01(\t\"H\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\n\n\x06\x41\x43TIVE\x10\x01\x12\x0c\n\x08\x43REATING\x10\x02\x12\x0e\n\nACTIVATING\x10\x03\"\xb0\x01\n\x03Nsx\x12\x13\n\x0binternal_ip\x18\x02 \x01(\t\x12\x0f\n\x07version\x18\x04 \x01(\t\x12;\n\x05state\x18\x05 \x01(\x0e\x32\'.google.cloud.vmwareengine.v1.Nsx.StateB\x03\xe0\x41\x03\x12\x0c\n\x04\x66qdn\x18\x06 \x01(\t\"8\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\n\n\x06\x41\x43TIVE\x10\x01\x12\x0c\n\x08\x43REATING\x10\x02\"\xb8\x01\n\x07Vcenter\x12\x13\n\x0binternal_ip\x18\x02 \x01(\t\x12\x0f\n\x07version\x18\x04 \x01(\t\x12?\n\x05state\x18\x05 \x01(\x0e\x32+.google.cloud.vmwareengine.v1.Vcenter.StateB\x03\xe0\x41\x03\x12\x0c\n\x04\x66qdn\x18\x06 \x01(\t\"8\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\n\n\x06\x41\x43TIVE\x10\x01\x12\x0c\n\x08\x43REATING\x10\x02\"\x9b\x07\n\x13\x41utoscalingSettings\x12m\n\x14\x61utoscaling_policies\x18\x01 \x03(\x0b\x32J.google.cloud.vmwareengine.v1.AutoscalingSettings.AutoscalingPoliciesEntryB\x03\xe0\x41\x02\x12#\n\x16min_cluster_node_count\x18\x02 \x01(\x05\x42\x03\xe0\x41\x01\x12#\n\x16max_cluster_node_count\x18\x03 \x01(\x05\x42\x03\xe0\x41\x01\x12\x38\n\x10\x63ool_down_period\x18\x04 \x01(\x0b\x32\x19.google.protobuf.DurationB\x03\xe0\x41\x01\x1a;\n\nThresholds\x12\x16\n\tscale_out\x18\x01 \x01(\x05\x42\x03\xe0\x41\x02\x12\x15\n\x08scale_in\x18\x02 \x01(\x05\x42\x03\xe0\x41\x02\x1a\xd2\x03\n\x11\x41utoscalingPolicy\x12\x19\n\x0cnode_type_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x1b\n\x0escale_out_size\x18\x02 \x01(\x05\x42\x03\xe0\x41\x02\x12Y\n\x0e\x63pu_thresholds\x18\x0b \x01(\x0b\x32<.google.cloud.vmwareengine.v1.AutoscalingSettings.ThresholdsB\x03\xe0\x41\x01\x12\x64\n\x19granted_memory_thresholds\x18\x0c \x01(\x0b\x32<.google.cloud.vmwareengine.v1.AutoscalingSettings.ThresholdsB\x03\xe0\x41\x01\x12\x65\n\x1a\x63onsumed_memory_thresholds\x18\r \x01(\x0b\x32<.google.cloud.vmwareengine.v1.AutoscalingSettings.ThresholdsB\x03\xe0\x41\x01\x12]\n\x12storage_thresholds\x18\x0e \x01(\x0b\x32<.google.cloud.vmwareengine.v1.AutoscalingSettings.ThresholdsB\x03\xe0\x41\x01\x1a\x7f\n\x18\x41utoscalingPoliciesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12R\n\x05value\x18\x02 \x01(\x0b\x32\x43.google.cloud.vmwareengine.v1.AutoscalingSettings.AutoscalingPolicy:\x02\x38\x01\"\xb2\x03\n\rDnsForwarding\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\x12\x34\n\x0bupdate_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12Y\n\x10\x66orwarding_rules\x18\x04 \x03(\x0b\x32:.google.cloud.vmwareengine.v1.DnsForwarding.ForwardingRuleB\x03\xe0\x41\x02\x1a@\n\x0e\x46orwardingRule\x12\x13\n\x06\x64omain\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x19\n\x0cname_servers\x18\x02 \x03(\tB\x03\xe0\x41\x02:\x84\x01\xea\x41\x80\x01\n)vmwareengine.googleapis.com/DnsForwarding\x12Sprojects/{project}/locations/{location}/privateClouds/{private_cloud}/dnsForwarding\"\xc4\n\n\x0eNetworkPeering\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\x12\x34\n\x0bupdate_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x19\n\x0cpeer_network\x18\x05 \x01(\tB\x03\xe0\x41\x02\x12&\n\x14\x65xport_custom_routes\x18\x08 \x01(\x08\x42\x03\xe0\x41\x01H\x00\x88\x01\x01\x12&\n\x14import_custom_routes\x18\t \x01(\x08\x42\x03\xe0\x41\x01H\x01\x88\x01\x01\x12(\n\x16\x65xchange_subnet_routes\x18\n \x01(\x08\x42\x03\xe0\x41\x01H\x02\x88\x01\x01\x12\x35\n#export_custom_routes_with_public_ip\x18\x0b \x01(\x08\x42\x03\xe0\x41\x01H\x03\x88\x01\x01\x12\x35\n#import_custom_routes_with_public_ip\x18\x0c \x01(\x08\x42\x03\xe0\x41\x01H\x04\x88\x01\x01\x12\x46\n\x05state\x18\r \x01(\x0e\x32\x32.google.cloud.vmwareengine.v1.NetworkPeering.StateB\x03\xe0\x41\x03\x12\x1a\n\rstate_details\x18\x07 \x01(\tB\x03\xe0\x41\x03\x12\x15\n\x08peer_mtu\x18\x0e \x01(\x05\x42\x03\xe0\x41\x01\x12\\\n\x11peer_network_type\x18\x10 \x01(\x0e\x32<.google.cloud.vmwareengine.v1.NetworkPeering.PeerNetworkTypeB\x03\xe0\x41\x02\x12\x10\n\x03uid\x18\x11 \x01(\tB\x03\xe0\x41\x03\x12V\n\x15vmware_engine_network\x18\x14 \x01(\tB7\xe0\x41\x02\xfa\x41\x31\n/vmwareengine.googleapis.com/VmwareEngineNetwork\x12\x18\n\x0b\x64\x65scription\x18\x15 \x01(\tB\x03\xe0\x41\x01\"T\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0c\n\x08INACTIVE\x10\x01\x12\n\n\x06\x41\x43TIVE\x10\x02\x12\x0c\n\x08\x43REATING\x10\x03\x12\x0c\n\x08\x44\x45LETING\x10\x04\"\xe3\x01\n\x0fPeerNetworkType\x12!\n\x1dPEER_NETWORK_TYPE_UNSPECIFIED\x10\x00\x12\x0c\n\x08STANDARD\x10\x01\x12\x19\n\x15VMWARE_ENGINE_NETWORK\x10\x02\x12\x1b\n\x17PRIVATE_SERVICES_ACCESS\x10\x03\x12\x18\n\x14NETAPP_CLOUD_VOLUMES\x10\x04\x12\x17\n\x13THIRD_PARTY_SERVICE\x10\x05\x12\x13\n\x0f\x44\x45LL_POWERSCALE\x10\x06\x12\x1f\n\x1bGOOGLE_CLOUD_NETAPP_VOLUMES\x10\x07:z\xea\x41w\n*vmwareengine.googleapis.com/NetworkPeering\x12Iprojects/{project}/locations/{location}/networkPeerings/{network_peering}B\x17\n\x15_export_custom_routesB\x17\n\x15_import_custom_routesB\x19\n\x17_exchange_subnet_routesB&\n$_export_custom_routes_with_public_ipB&\n$_import_custom_routes_with_public_ip\"\xb6\x03\n\x0cPeeringRoute\x12\x17\n\ndest_range\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x42\n\x04type\x18\x02 \x01(\x0e\x32/.google.cloud.vmwareengine.v1.PeeringRoute.TypeB\x03\xe0\x41\x03\x12\x1c\n\x0fnext_hop_region\x18\x03 \x01(\tB\x03\xe0\x41\x03\x12\x15\n\x08priority\x18\x04 \x01(\x03\x42\x03\xe0\x41\x03\x12\x15\n\x08imported\x18\x05 \x01(\x08\x42\x03\xe0\x41\x03\x12L\n\tdirection\x18\x06 \x01(\x0e\x32\x34.google.cloud.vmwareengine.v1.PeeringRoute.DirectionB\x03\xe0\x41\x03\"k\n\x04Type\x12\x14\n\x10TYPE_UNSPECIFIED\x10\x00\x12\x19\n\x15\x44YNAMIC_PEERING_ROUTE\x10\x01\x12\x18\n\x14STATIC_PEERING_ROUTE\x10\x02\x12\x18\n\x14SUBNET_PEERING_ROUTE\x10\x03\"B\n\tDirection\x12\x19\n\x15\x44IRECTION_UNSPECIFIED\x10\x00\x12\x0c\n\x08INCOMING\x10\x01\x12\x0c\n\x08OUTGOING\x10\x02\"\xff\x06\n\rNetworkPolicy\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\x12\x34\n\x0bupdate_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12S\n\x0finternet_access\x18\x06 \x01(\x0b\x32:.google.cloud.vmwareengine.v1.NetworkPolicy.NetworkService\x12O\n\x0b\x65xternal_ip\x18\x07 \x01(\x0b\x32:.google.cloud.vmwareengine.v1.NetworkPolicy.NetworkService\x12\x1f\n\x12\x65\x64ge_services_cidr\x18\t \x01(\tB\x03\xe0\x41\x02\x12\x10\n\x03uid\x18\n \x01(\tB\x03\xe0\x41\x03\x12V\n\x15vmware_engine_network\x18\x0c \x01(\tB7\xe0\x41\x01\xfa\x41\x31\n/vmwareengine.googleapis.com/VmwareEngineNetwork\x12\x18\n\x0b\x64\x65scription\x18\r \x01(\tB\x03\xe0\x41\x01\x12`\n\x1fvmware_engine_network_canonical\x18\x0e \x01(\tB7\xe0\x41\x03\xfa\x41\x31\n/vmwareengine.googleapis.com/VmwareEngineNetwork\x1a\xc7\x01\n\x0eNetworkService\x12\x0f\n\x07\x65nabled\x18\x01 \x01(\x08\x12T\n\x05state\x18\x02 \x01(\x0e\x32@.google.cloud.vmwareengine.v1.NetworkPolicy.NetworkService.StateB\x03\xe0\x41\x03\"N\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x11\n\rUNPROVISIONED\x10\x01\x12\x0f\n\x0bRECONCILING\x10\x02\x12\n\n\x06\x41\x43TIVE\x10\x03:x\xea\x41u\n)vmwareengine.googleapis.com/NetworkPolicy\x12Hprojects/{project}/locations/{location}/networkPolicies/{network_policy}\"\xd3\x05\n\x18ManagementDnsZoneBinding\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\x12\x34\n\x0bupdate_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12P\n\x05state\x18\x08 \x01(\x0e\x32<.google.cloud.vmwareengine.v1.ManagementDnsZoneBinding.StateB\x03\xe0\x41\x03\x12\x13\n\x0b\x64\x65scription\x18\r \x01(\t\x12:\n\x0bvpc_network\x18\x0e \x01(\tB#\xfa\x41 \n\x1e\x63ompute.googleapis.com/NetworkH\x00\x12U\n\x15vmware_engine_network\x18\x0f \x01(\tB4\xfa\x41\x31\n/vmwareengine.googleapis.com/VmwareEngineNetworkH\x00\x12\x10\n\x03uid\x18\t \x01(\tB\x03\xe0\x41\x03\"`\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\n\n\x06\x41\x43TIVE\x10\x01\x12\x0c\n\x08\x43REATING\x10\x02\x12\x0c\n\x08UPDATING\x10\x03\x12\x0c\n\x08\x44\x45LETING\x10\x04\x12\n\n\x06\x46\x41ILED\x10\x05:\xb9\x01\xea\x41\xb5\x01\n4vmwareengine.googleapis.com/ManagementDnsZoneBinding\x12}projects/{project}/locations/{location}/privateClouds/{private_cloud}/managementDnsZoneBindings/{management_dns_zone_binding}B\x0e\n\x0c\x62ind_network\"\xc0\x07\n\x13VmwareEngineNetwork\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\x12\x34\n\x0bupdate_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x13\n\x0b\x64\x65scription\x18\x05 \x01(\t\x12W\n\x0cvpc_networks\x18\x06 \x03(\x0b\x32<.google.cloud.vmwareengine.v1.VmwareEngineNetwork.VpcNetworkB\x03\xe0\x41\x03\x12K\n\x05state\x18\x07 \x01(\x0e\x32\x37.google.cloud.vmwareengine.v1.VmwareEngineNetwork.StateB\x03\xe0\x41\x03\x12I\n\x04type\x18\x08 \x01(\x0e\x32\x36.google.cloud.vmwareengine.v1.VmwareEngineNetwork.TypeB\x03\xe0\x41\x02\x12\x10\n\x03uid\x18\t \x01(\tB\x03\xe0\x41\x03\x12\x0c\n\x04\x65tag\x18\n \x01(\t\x1a\xe7\x01\n\nVpcNetwork\x12T\n\x04type\x18\x01 \x01(\x0e\x32\x41.google.cloud.vmwareengine.v1.VmwareEngineNetwork.VpcNetwork.TypeB\x03\xe0\x41\x03\x12\x37\n\x07network\x18\x02 \x01(\tB&\xe0\x41\x03\xfa\x41 \n\x1e\x63ompute.googleapis.com/Network\"J\n\x04Type\x12\x14\n\x10TYPE_UNSPECIFIED\x10\x00\x12\x0c\n\x08INTRANET\x10\x01\x12\x0c\n\x08INTERNET\x10\x02\x12\x10\n\x0cGOOGLE_CLOUD\x10\x03\"T\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0c\n\x08\x43REATING\x10\x01\x12\n\n\x06\x41\x43TIVE\x10\x02\x12\x0c\n\x08UPDATING\x10\x03\x12\x0c\n\x08\x44\x45LETING\x10\x04\"6\n\x04Type\x12\x14\n\x10TYPE_UNSPECIFIED\x10\x00\x12\n\n\x06LEGACY\x10\x01\x12\x0c\n\x08STANDARD\x10\x02:\x8b\x01\xea\x41\x87\x01\n/vmwareengine.googleapis.com/VmwareEngineNetwork\x12Tprojects/{project}/locations/{location}/vmwareEngineNetworks/{vmware_engine_network}\"\xb7\n\n\x11PrivateConnection\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\x12\x34\n\x0bupdate_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x18\n\x0b\x64\x65scription\x18\x04 \x01(\tB\x03\xe0\x41\x01\x12I\n\x05state\x18\x05 \x01(\x0e\x32\x35.google.cloud.vmwareengine.v1.PrivateConnection.StateB\x03\xe0\x41\x03\x12V\n\x15vmware_engine_network\x18\x08 \x01(\tB7\xe0\x41\x02\xfa\x41\x31\n/vmwareengine.googleapis.com/VmwareEngineNetwork\x12`\n\x1fvmware_engine_network_canonical\x18\t \x01(\tB7\xe0\x41\x03\xfa\x41\x31\n/vmwareengine.googleapis.com/VmwareEngineNetwork\x12G\n\x04type\x18\n \x01(\x0e\x32\x34.google.cloud.vmwareengine.v1.PrivateConnection.TypeB\x03\xe0\x41\x02\x12\x17\n\npeering_id\x18\x0c \x01(\tB\x03\xe0\x41\x03\x12V\n\x0crouting_mode\x18\r \x01(\x0e\x32;.google.cloud.vmwareengine.v1.PrivateConnection.RoutingModeB\x03\xe0\x41\x01\x12\x10\n\x03uid\x18\x0e \x01(\tB\x03\xe0\x41\x03\x12?\n\x0fservice_network\x18\x10 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1e\x63ompute.googleapis.com/Network\x12X\n\rpeering_state\x18\x11 \x01(\x0e\x32<.google.cloud.vmwareengine.v1.PrivateConnection.PeeringStateB\x03\xe0\x41\x03\"s\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0c\n\x08\x43REATING\x10\x01\x12\n\n\x06\x41\x43TIVE\x10\x02\x12\x0c\n\x08UPDATING\x10\x03\x12\x0c\n\x08\x44\x45LETING\x10\x04\x12\x11\n\rUNPROVISIONED\x10\x05\x12\n\n\x06\x46\x41ILED\x10\x06\"\x80\x01\n\x04Type\x12\x14\n\x10TYPE_UNSPECIFIED\x10\x00\x12\x1a\n\x16PRIVATE_SERVICE_ACCESS\x10\x01\x12\x18\n\x14NETAPP_CLOUD_VOLUMES\x10\x02\x12\x13\n\x0f\x44\x45LL_POWERSCALE\x10\x03\x12\x17\n\x13THIRD_PARTY_SERVICE\x10\x04\"E\n\x0bRoutingMode\x12\x1c\n\x18ROUTING_MODE_UNSPECIFIED\x10\x00\x12\n\n\x06GLOBAL\x10\x01\x12\x0c\n\x08REGIONAL\x10\x02\"W\n\x0cPeeringState\x12\x1d\n\x19PEERING_STATE_UNSPECIFIED\x10\x00\x12\x12\n\x0ePEERING_ACTIVE\x10\x01\x12\x14\n\x10PEERING_INACTIVE\x10\x02:\x84\x01\xea\x41\x80\x01\n-vmwareengine.googleapis.com/PrivateConnection\x12Oprojects/{project}/locations/{location}/privateConnections/{private_connection}\"\xaa\x01\n\x10LocationMetadata\x12T\n\x0c\x63\x61pabilities\x18\x01 \x03(\x0e\x32\x39.google.cloud.vmwareengine.v1.LocationMetadata.CapabilityB\x03\xe0\x41\x03\"@\n\nCapability\x12\x1a\n\x16\x43\x41PABILITY_UNSPECIFIED\x10\x00\x12\x16\n\x12STRETCHED_CLUSTERS\x10\x01\"\xd7\x01\n\x11\x44nsBindPermission\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12@\n\nprincipals\x18\x02 \x03(\x0b\x32\'.google.cloud.vmwareengine.v1.PrincipalB\x03\xe0\x41\x03:m\xea\x41j\n-vmwareengine.googleapis.com/DnsBindPermission\x12\x39projects/{project}/locations/{location}/dnsBindPermission\"C\n\tPrincipal\x12\x0e\n\x04user\x18\x01 \x01(\tH\x00\x12\x19\n\x0fservice_account\x18\x02 \x01(\tH\x00\x42\x0b\n\tprincipalB\xe6\x01\n com.google.cloud.vmwareengine.v1B\x1aVmwareengineResourcesProtoP\x01ZDcloud.google.com/go/vmwareengine/apiv1/vmwareenginepb;vmwareenginepb\xaa\x02\x1cGoogle.Cloud.VmwareEngine.V1\xca\x02\x1cGoogle\\Cloud\\VmwareEngine\\V1\xea\x02\x1fGoogle::Cloud::VmwareEngine::V1b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module VmwareEngine - module V1 - NetworkConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.NetworkConfig").msgclass - NodeTypeConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.NodeTypeConfig").msgclass - StretchedClusterConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.StretchedClusterConfig").msgclass - PrivateCloud = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.PrivateCloud").msgclass - PrivateCloud::ManagementCluster = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.PrivateCloud.ManagementCluster").msgclass - PrivateCloud::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.PrivateCloud.State").enummodule - PrivateCloud::Type = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.PrivateCloud.Type").enummodule - Cluster = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.Cluster").msgclass - Cluster::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.Cluster.State").enummodule - Node = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.Node").msgclass - Node::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.Node.State").enummodule - ExternalAddress = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.ExternalAddress").msgclass - ExternalAddress::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.ExternalAddress.State").enummodule - Subnet = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.Subnet").msgclass - Subnet::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.Subnet.State").enummodule - ExternalAccessRule = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.ExternalAccessRule").msgclass - ExternalAccessRule::IpRange = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.ExternalAccessRule.IpRange").msgclass - ExternalAccessRule::Action = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.ExternalAccessRule.Action").enummodule - ExternalAccessRule::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.ExternalAccessRule.State").enummodule - LoggingServer = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.LoggingServer").msgclass - LoggingServer::Protocol = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.LoggingServer.Protocol").enummodule - LoggingServer::SourceType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.LoggingServer.SourceType").enummodule - NodeType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.NodeType").msgclass - NodeType::Kind = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.NodeType.Kind").enummodule - NodeType::Capability = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.NodeType.Capability").enummodule - Credentials = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.Credentials").msgclass - HcxActivationKey = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.HcxActivationKey").msgclass - HcxActivationKey::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.HcxActivationKey.State").enummodule - Hcx = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.Hcx").msgclass - Hcx::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.Hcx.State").enummodule - Nsx = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.Nsx").msgclass - Nsx::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.Nsx.State").enummodule - Vcenter = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.Vcenter").msgclass - Vcenter::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.Vcenter.State").enummodule - AutoscalingSettings = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.AutoscalingSettings").msgclass - AutoscalingSettings::Thresholds = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.AutoscalingSettings.Thresholds").msgclass - AutoscalingSettings::AutoscalingPolicy = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.AutoscalingSettings.AutoscalingPolicy").msgclass - DnsForwarding = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.DnsForwarding").msgclass - DnsForwarding::ForwardingRule = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.DnsForwarding.ForwardingRule").msgclass - NetworkPeering = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.NetworkPeering").msgclass - NetworkPeering::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.NetworkPeering.State").enummodule - NetworkPeering::PeerNetworkType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.NetworkPeering.PeerNetworkType").enummodule - PeeringRoute = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.PeeringRoute").msgclass - PeeringRoute::Type = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.PeeringRoute.Type").enummodule - PeeringRoute::Direction = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.PeeringRoute.Direction").enummodule - NetworkPolicy = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.NetworkPolicy").msgclass - NetworkPolicy::NetworkService = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.NetworkPolicy.NetworkService").msgclass - NetworkPolicy::NetworkService::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.NetworkPolicy.NetworkService.State").enummodule - ManagementDnsZoneBinding = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.ManagementDnsZoneBinding").msgclass - ManagementDnsZoneBinding::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.ManagementDnsZoneBinding.State").enummodule - VmwareEngineNetwork = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.VmwareEngineNetwork").msgclass - VmwareEngineNetwork::VpcNetwork = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.VmwareEngineNetwork.VpcNetwork").msgclass - VmwareEngineNetwork::VpcNetwork::Type = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.VmwareEngineNetwork.VpcNetwork.Type").enummodule - VmwareEngineNetwork::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.VmwareEngineNetwork.State").enummodule - VmwareEngineNetwork::Type = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.VmwareEngineNetwork.Type").enummodule - PrivateConnection = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.PrivateConnection").msgclass - PrivateConnection::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.PrivateConnection.State").enummodule - PrivateConnection::Type = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.PrivateConnection.Type").enummodule - PrivateConnection::RoutingMode = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.PrivateConnection.RoutingMode").enummodule - PrivateConnection::PeeringState = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.PrivateConnection.PeeringState").enummodule - LocationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.LocationMetadata").msgclass - LocationMetadata::Capability = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.LocationMetadata.Capability").enummodule - DnsBindPermission = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.DnsBindPermission").msgclass - Principal = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vmwareengine.v1.Principal").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-vmware_engine-v1/lib/google/cloud/vmwareengine/v1/vmwareengine_services_pb.rb b/owl-bot-staging/google-cloud-vmware_engine-v1/lib/google/cloud/vmwareengine/v1/vmwareengine_services_pb.rb deleted file mode 100644 index b9f2781df554..000000000000 --- a/owl-bot-staging/google-cloud-vmware_engine-v1/lib/google/cloud/vmwareengine/v1/vmwareengine_services_pb.rb +++ /dev/null @@ -1,313 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# Source: google/cloud/vmwareengine/v1/vmwareengine.proto for package 'Google.Cloud.VmwareEngine.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/vmwareengine/v1/vmwareengine_pb' - -module Google - module Cloud - module VmwareEngine - module V1 - module VmwareEngine - # VMwareEngine manages VMware's private clusters in the Cloud. - class Service - - include ::GRPC::GenericService - - self.marshal_class_method = :encode - self.unmarshal_class_method = :decode - self.service_name = 'google.cloud.vmwareengine.v1.VmwareEngine' - - # Lists `PrivateCloud` resources in a given project and location. - rpc :ListPrivateClouds, ::Google::Cloud::VmwareEngine::V1::ListPrivateCloudsRequest, ::Google::Cloud::VmwareEngine::V1::ListPrivateCloudsResponse - # Retrieves a `PrivateCloud` resource by its resource name. - rpc :GetPrivateCloud, ::Google::Cloud::VmwareEngine::V1::GetPrivateCloudRequest, ::Google::Cloud::VmwareEngine::V1::PrivateCloud - # Creates a new `PrivateCloud` resource in a given project and location. - # Private clouds of type `STANDARD` and - # `TIME_LIMITED` are zonal resources, `STRETCHED` private clouds are - # regional. - # Creating a private cloud also creates a [management - # cluster](https://cloud.google.com/vmware-engine/docs/concepts-vmware-components) - # for that private cloud. - rpc :CreatePrivateCloud, ::Google::Cloud::VmwareEngine::V1::CreatePrivateCloudRequest, ::Google::Longrunning::Operation - # Modifies a `PrivateCloud` resource. Only the following fields can be - # updated: `description`. - # Only fields specified in `updateMask` are applied. - # - # During operation processing, the resource is temporarily in the `ACTIVE` - # state before the operation fully completes. For that period of time, you - # can't update the resource. Use the operation status to determine when the - # processing fully completes. - rpc :UpdatePrivateCloud, ::Google::Cloud::VmwareEngine::V1::UpdatePrivateCloudRequest, ::Google::Longrunning::Operation - # Schedules a `PrivateCloud` resource for deletion. - # - # A `PrivateCloud` resource scheduled for deletion has `PrivateCloud.state` - # set to `DELETED` and `expireTime` set to the time when deletion is final - # and can no longer be reversed. The delete operation is marked as done - # as soon as the `PrivateCloud` is successfully scheduled for deletion - # (this also applies when `delayHours` is set to zero), and the operation is - # not kept in pending state until `PrivateCloud` is purged. - # `PrivateCloud` can be restored using `UndeletePrivateCloud` method before - # the `expireTime` elapses. When `expireTime` is reached, deletion is final - # and all private cloud resources are irreversibly removed and billing stops. - # During the final removal process, `PrivateCloud.state` is set to `PURGING`. - # `PrivateCloud` can be polled using standard `GET` method for the whole - # period of deletion and purging. It will not be returned only - # when it is completely purged. - rpc :DeletePrivateCloud, ::Google::Cloud::VmwareEngine::V1::DeletePrivateCloudRequest, ::Google::Longrunning::Operation - # Restores a private cloud that was previously scheduled for deletion by - # `DeletePrivateCloud`. A `PrivateCloud` resource scheduled for deletion has - # `PrivateCloud.state` set to `DELETED` and `PrivateCloud.expireTime` set to - # the time when deletion can no longer be reversed. - rpc :UndeletePrivateCloud, ::Google::Cloud::VmwareEngine::V1::UndeletePrivateCloudRequest, ::Google::Longrunning::Operation - # Lists `Cluster` resources in a given private cloud. - rpc :ListClusters, ::Google::Cloud::VmwareEngine::V1::ListClustersRequest, ::Google::Cloud::VmwareEngine::V1::ListClustersResponse - # Retrieves a `Cluster` resource by its resource name. - rpc :GetCluster, ::Google::Cloud::VmwareEngine::V1::GetClusterRequest, ::Google::Cloud::VmwareEngine::V1::Cluster - # Creates a new cluster in a given private cloud. - # Creating a new cluster provides additional nodes for - # use in the parent private cloud and requires sufficient [node - # quota](https://cloud.google.com/vmware-engine/quotas). - rpc :CreateCluster, ::Google::Cloud::VmwareEngine::V1::CreateClusterRequest, ::Google::Longrunning::Operation - # Modifies a `Cluster` resource. Only fields specified in `updateMask` are - # applied. - # - # During operation processing, the resource is temporarily in the `ACTIVE` - # state before the operation fully completes. For that period of time, you - # can't update the resource. Use the operation status to determine when the - # processing fully completes. - rpc :UpdateCluster, ::Google::Cloud::VmwareEngine::V1::UpdateClusterRequest, ::Google::Longrunning::Operation - # Deletes a `Cluster` resource. To avoid unintended data loss, migrate or - # gracefully shut down any workloads running on the cluster before deletion. - # You cannot delete the management cluster of a private cloud using this - # method. - rpc :DeleteCluster, ::Google::Cloud::VmwareEngine::V1::DeleteClusterRequest, ::Google::Longrunning::Operation - # Lists nodes in a given cluster. - rpc :ListNodes, ::Google::Cloud::VmwareEngine::V1::ListNodesRequest, ::Google::Cloud::VmwareEngine::V1::ListNodesResponse - # Gets details of a single node. - rpc :GetNode, ::Google::Cloud::VmwareEngine::V1::GetNodeRequest, ::Google::Cloud::VmwareEngine::V1::Node - # Lists external IP addresses assigned to VMware workload VMs in a given - # private cloud. - rpc :ListExternalAddresses, ::Google::Cloud::VmwareEngine::V1::ListExternalAddressesRequest, ::Google::Cloud::VmwareEngine::V1::ListExternalAddressesResponse - # Lists external IP addresses assigned to VMware workload VMs within the - # scope of the given network policy. - rpc :FetchNetworkPolicyExternalAddresses, ::Google::Cloud::VmwareEngine::V1::FetchNetworkPolicyExternalAddressesRequest, ::Google::Cloud::VmwareEngine::V1::FetchNetworkPolicyExternalAddressesResponse - # Gets details of a single external IP address. - rpc :GetExternalAddress, ::Google::Cloud::VmwareEngine::V1::GetExternalAddressRequest, ::Google::Cloud::VmwareEngine::V1::ExternalAddress - # Creates a new `ExternalAddress` resource in a given private cloud. The - # network policy that corresponds to the private cloud must have the external - # IP address network service enabled (`NetworkPolicy.external_ip`). - rpc :CreateExternalAddress, ::Google::Cloud::VmwareEngine::V1::CreateExternalAddressRequest, ::Google::Longrunning::Operation - # Updates the parameters of a single external IP address. - # Only fields specified in `update_mask` are applied. - # - # During operation processing, the resource is temporarily in the `ACTIVE` - # state before the operation fully completes. For that period of time, you - # can't update the resource. Use the operation status to determine when the - # processing fully completes. - rpc :UpdateExternalAddress, ::Google::Cloud::VmwareEngine::V1::UpdateExternalAddressRequest, ::Google::Longrunning::Operation - # Deletes a single external IP address. When you delete an external IP - # address, connectivity between the external IP address and the corresponding - # internal IP address is lost. - rpc :DeleteExternalAddress, ::Google::Cloud::VmwareEngine::V1::DeleteExternalAddressRequest, ::Google::Longrunning::Operation - # Lists subnets in a given private cloud. - rpc :ListSubnets, ::Google::Cloud::VmwareEngine::V1::ListSubnetsRequest, ::Google::Cloud::VmwareEngine::V1::ListSubnetsResponse - # Gets details of a single subnet. - rpc :GetSubnet, ::Google::Cloud::VmwareEngine::V1::GetSubnetRequest, ::Google::Cloud::VmwareEngine::V1::Subnet - # Updates the parameters of a single subnet. Only fields specified in - # `update_mask` are applied. - # - # *Note*: This API is synchronous and always returns a successful - # `google.longrunning.Operation` (LRO). The returned LRO will only have - # `done` and `response` fields. - rpc :UpdateSubnet, ::Google::Cloud::VmwareEngine::V1::UpdateSubnetRequest, ::Google::Longrunning::Operation - # Lists `ExternalAccessRule` resources in the specified network policy. - rpc :ListExternalAccessRules, ::Google::Cloud::VmwareEngine::V1::ListExternalAccessRulesRequest, ::Google::Cloud::VmwareEngine::V1::ListExternalAccessRulesResponse - # Gets details of a single external access rule. - rpc :GetExternalAccessRule, ::Google::Cloud::VmwareEngine::V1::GetExternalAccessRuleRequest, ::Google::Cloud::VmwareEngine::V1::ExternalAccessRule - # Creates a new external access rule in a given network policy. - rpc :CreateExternalAccessRule, ::Google::Cloud::VmwareEngine::V1::CreateExternalAccessRuleRequest, ::Google::Longrunning::Operation - # Updates the parameters of a single external access rule. - # Only fields specified in `update_mask` are applied. - rpc :UpdateExternalAccessRule, ::Google::Cloud::VmwareEngine::V1::UpdateExternalAccessRuleRequest, ::Google::Longrunning::Operation - # Deletes a single external access rule. - rpc :DeleteExternalAccessRule, ::Google::Cloud::VmwareEngine::V1::DeleteExternalAccessRuleRequest, ::Google::Longrunning::Operation - # Lists logging servers configured for a given private - # cloud. - rpc :ListLoggingServers, ::Google::Cloud::VmwareEngine::V1::ListLoggingServersRequest, ::Google::Cloud::VmwareEngine::V1::ListLoggingServersResponse - # Gets details of a logging server. - rpc :GetLoggingServer, ::Google::Cloud::VmwareEngine::V1::GetLoggingServerRequest, ::Google::Cloud::VmwareEngine::V1::LoggingServer - # Create a new logging server for a given private cloud. - rpc :CreateLoggingServer, ::Google::Cloud::VmwareEngine::V1::CreateLoggingServerRequest, ::Google::Longrunning::Operation - # Updates the parameters of a single logging server. - # Only fields specified in `update_mask` are applied. - rpc :UpdateLoggingServer, ::Google::Cloud::VmwareEngine::V1::UpdateLoggingServerRequest, ::Google::Longrunning::Operation - # Deletes a single logging server. - rpc :DeleteLoggingServer, ::Google::Cloud::VmwareEngine::V1::DeleteLoggingServerRequest, ::Google::Longrunning::Operation - # Lists node types - rpc :ListNodeTypes, ::Google::Cloud::VmwareEngine::V1::ListNodeTypesRequest, ::Google::Cloud::VmwareEngine::V1::ListNodeTypesResponse - # Gets details of a single `NodeType`. - rpc :GetNodeType, ::Google::Cloud::VmwareEngine::V1::GetNodeTypeRequest, ::Google::Cloud::VmwareEngine::V1::NodeType - # Gets details of credentials for NSX appliance. - rpc :ShowNsxCredentials, ::Google::Cloud::VmwareEngine::V1::ShowNsxCredentialsRequest, ::Google::Cloud::VmwareEngine::V1::Credentials - # Gets details of credentials for Vcenter appliance. - rpc :ShowVcenterCredentials, ::Google::Cloud::VmwareEngine::V1::ShowVcenterCredentialsRequest, ::Google::Cloud::VmwareEngine::V1::Credentials - # Resets credentials of the NSX appliance. - rpc :ResetNsxCredentials, ::Google::Cloud::VmwareEngine::V1::ResetNsxCredentialsRequest, ::Google::Longrunning::Operation - # Resets credentials of the Vcenter appliance. - rpc :ResetVcenterCredentials, ::Google::Cloud::VmwareEngine::V1::ResetVcenterCredentialsRequest, ::Google::Longrunning::Operation - # Gets details of the `DnsForwarding` config. - rpc :GetDnsForwarding, ::Google::Cloud::VmwareEngine::V1::GetDnsForwardingRequest, ::Google::Cloud::VmwareEngine::V1::DnsForwarding - # Updates the parameters of the `DnsForwarding` config, like associated - # domains. Only fields specified in `update_mask` are applied. - rpc :UpdateDnsForwarding, ::Google::Cloud::VmwareEngine::V1::UpdateDnsForwardingRequest, ::Google::Longrunning::Operation - # Retrieves a `NetworkPeering` resource by its resource name. The resource - # contains details of the network peering, such as peered - # networks, import and export custom route configurations, and peering state. - # NetworkPeering is a global resource and location can only be global. - rpc :GetNetworkPeering, ::Google::Cloud::VmwareEngine::V1::GetNetworkPeeringRequest, ::Google::Cloud::VmwareEngine::V1::NetworkPeering - # Lists `NetworkPeering` resources in a given project. NetworkPeering is a - # global resource and location can only be global. - rpc :ListNetworkPeerings, ::Google::Cloud::VmwareEngine::V1::ListNetworkPeeringsRequest, ::Google::Cloud::VmwareEngine::V1::ListNetworkPeeringsResponse - # Creates a new network peering between the peer network and VMware Engine - # network provided in a `NetworkPeering` resource. NetworkPeering is a - # global resource and location can only be global. - rpc :CreateNetworkPeering, ::Google::Cloud::VmwareEngine::V1::CreateNetworkPeeringRequest, ::Google::Longrunning::Operation - # Deletes a `NetworkPeering` resource. When a network peering is deleted for - # a VMware Engine network, the peer network becomes inaccessible to that - # VMware Engine network. NetworkPeering is a global resource and location can - # only be global. - rpc :DeleteNetworkPeering, ::Google::Cloud::VmwareEngine::V1::DeleteNetworkPeeringRequest, ::Google::Longrunning::Operation - # Modifies a `NetworkPeering` resource. Only the `description` field can be - # updated. Only fields specified in `updateMask` are applied. NetworkPeering - # is a global resource and location can only be global. - rpc :UpdateNetworkPeering, ::Google::Cloud::VmwareEngine::V1::UpdateNetworkPeeringRequest, ::Google::Longrunning::Operation - # Lists the network peering routes exchanged over a peering connection. - # NetworkPeering is a global resource and location can only be global. - rpc :ListPeeringRoutes, ::Google::Cloud::VmwareEngine::V1::ListPeeringRoutesRequest, ::Google::Cloud::VmwareEngine::V1::ListPeeringRoutesResponse - # Creates a new HCX activation key in a given private cloud. - rpc :CreateHcxActivationKey, ::Google::Cloud::VmwareEngine::V1::CreateHcxActivationKeyRequest, ::Google::Longrunning::Operation - # Lists `HcxActivationKey` resources in a given private cloud. - rpc :ListHcxActivationKeys, ::Google::Cloud::VmwareEngine::V1::ListHcxActivationKeysRequest, ::Google::Cloud::VmwareEngine::V1::ListHcxActivationKeysResponse - # Retrieves a `HcxActivationKey` resource by its resource name. - rpc :GetHcxActivationKey, ::Google::Cloud::VmwareEngine::V1::GetHcxActivationKeyRequest, ::Google::Cloud::VmwareEngine::V1::HcxActivationKey - # Retrieves a `NetworkPolicy` resource by its resource name. - rpc :GetNetworkPolicy, ::Google::Cloud::VmwareEngine::V1::GetNetworkPolicyRequest, ::Google::Cloud::VmwareEngine::V1::NetworkPolicy - # Lists `NetworkPolicy` resources in a specified project and location. - rpc :ListNetworkPolicies, ::Google::Cloud::VmwareEngine::V1::ListNetworkPoliciesRequest, ::Google::Cloud::VmwareEngine::V1::ListNetworkPoliciesResponse - # Creates a new network policy in a given VMware Engine network of a - # project and location (region). A new network policy cannot be created if - # another network policy already exists in the same scope. - rpc :CreateNetworkPolicy, ::Google::Cloud::VmwareEngine::V1::CreateNetworkPolicyRequest, ::Google::Longrunning::Operation - # Modifies a `NetworkPolicy` resource. Only the following fields can be - # updated: `internet_access`, `external_ip`, `edge_services_cidr`. - # Only fields specified in `updateMask` are applied. When updating a network - # policy, the external IP network service can only be disabled if there are - # no external IP addresses present in the scope of the policy. Also, a - # `NetworkService` cannot be updated when `NetworkService.state` is set - # to `RECONCILING`. - # - # During operation processing, the resource is temporarily in the `ACTIVE` - # state before the operation fully completes. For that period of time, you - # can't update the resource. Use the operation status to determine when the - # processing fully completes. - rpc :UpdateNetworkPolicy, ::Google::Cloud::VmwareEngine::V1::UpdateNetworkPolicyRequest, ::Google::Longrunning::Operation - # Deletes a `NetworkPolicy` resource. A network policy cannot be deleted - # when `NetworkService.state` is set to `RECONCILING` for either its external - # IP or internet access service. - rpc :DeleteNetworkPolicy, ::Google::Cloud::VmwareEngine::V1::DeleteNetworkPolicyRequest, ::Google::Longrunning::Operation - # Lists Consumer VPCs bound to Management DNS Zone of a given private cloud. - rpc :ListManagementDnsZoneBindings, ::Google::Cloud::VmwareEngine::V1::ListManagementDnsZoneBindingsRequest, ::Google::Cloud::VmwareEngine::V1::ListManagementDnsZoneBindingsResponse - # Retrieves a 'ManagementDnsZoneBinding' resource by its resource name. - rpc :GetManagementDnsZoneBinding, ::Google::Cloud::VmwareEngine::V1::GetManagementDnsZoneBindingRequest, ::Google::Cloud::VmwareEngine::V1::ManagementDnsZoneBinding - # Creates a new `ManagementDnsZoneBinding` resource in a private cloud. - # This RPC creates the DNS binding and the resource that represents the - # DNS binding of the consumer VPC network to the management DNS zone. A - # management DNS zone is the Cloud DNS cross-project binding zone that - # VMware Engine creates for each private cloud. It contains FQDNs and - # corresponding IP addresses for the private cloud's ESXi hosts and - # management VM appliances like vCenter and NSX Manager. - rpc :CreateManagementDnsZoneBinding, ::Google::Cloud::VmwareEngine::V1::CreateManagementDnsZoneBindingRequest, ::Google::Longrunning::Operation - # Updates a `ManagementDnsZoneBinding` resource. - # Only fields specified in `update_mask` are applied. - rpc :UpdateManagementDnsZoneBinding, ::Google::Cloud::VmwareEngine::V1::UpdateManagementDnsZoneBindingRequest, ::Google::Longrunning::Operation - # Deletes a `ManagementDnsZoneBinding` resource. When a management DNS zone - # binding is deleted, the corresponding consumer VPC network is no longer - # bound to the management DNS zone. - rpc :DeleteManagementDnsZoneBinding, ::Google::Cloud::VmwareEngine::V1::DeleteManagementDnsZoneBindingRequest, ::Google::Longrunning::Operation - # Retries to create a `ManagementDnsZoneBinding` resource that is - # in failed state. - rpc :RepairManagementDnsZoneBinding, ::Google::Cloud::VmwareEngine::V1::RepairManagementDnsZoneBindingRequest, ::Google::Longrunning::Operation - # Creates a new VMware Engine network that can be used by a private cloud. - rpc :CreateVmwareEngineNetwork, ::Google::Cloud::VmwareEngine::V1::CreateVmwareEngineNetworkRequest, ::Google::Longrunning::Operation - # Modifies a VMware Engine network resource. Only the following fields can be - # updated: `description`. Only fields specified in `updateMask` are - # applied. - rpc :UpdateVmwareEngineNetwork, ::Google::Cloud::VmwareEngine::V1::UpdateVmwareEngineNetworkRequest, ::Google::Longrunning::Operation - # Deletes a `VmwareEngineNetwork` resource. You can only delete a VMware - # Engine network after all resources that refer to it are deleted. For - # example, a private cloud, a network peering, and a network policy can all - # refer to the same VMware Engine network. - rpc :DeleteVmwareEngineNetwork, ::Google::Cloud::VmwareEngine::V1::DeleteVmwareEngineNetworkRequest, ::Google::Longrunning::Operation - # Retrieves a `VmwareEngineNetwork` resource by its resource name. The - # resource contains details of the VMware Engine network, such as its VMware - # Engine network type, peered networks in a service project, and state - # (for example, `CREATING`, `ACTIVE`, `DELETING`). - rpc :GetVmwareEngineNetwork, ::Google::Cloud::VmwareEngine::V1::GetVmwareEngineNetworkRequest, ::Google::Cloud::VmwareEngine::V1::VmwareEngineNetwork - # Lists `VmwareEngineNetwork` resources in a given project and location. - rpc :ListVmwareEngineNetworks, ::Google::Cloud::VmwareEngine::V1::ListVmwareEngineNetworksRequest, ::Google::Cloud::VmwareEngine::V1::ListVmwareEngineNetworksResponse - # Creates a new private connection that can be used for accessing private - # Clouds. - rpc :CreatePrivateConnection, ::Google::Cloud::VmwareEngine::V1::CreatePrivateConnectionRequest, ::Google::Longrunning::Operation - # Retrieves a `PrivateConnection` resource by its resource name. The resource - # contains details of the private connection, such as connected - # network, routing mode and state. - rpc :GetPrivateConnection, ::Google::Cloud::VmwareEngine::V1::GetPrivateConnectionRequest, ::Google::Cloud::VmwareEngine::V1::PrivateConnection - # Lists `PrivateConnection` resources in a given project and location. - rpc :ListPrivateConnections, ::Google::Cloud::VmwareEngine::V1::ListPrivateConnectionsRequest, ::Google::Cloud::VmwareEngine::V1::ListPrivateConnectionsResponse - # Modifies a `PrivateConnection` resource. Only `description` and - # `routing_mode` fields can be updated. Only fields specified in `updateMask` - # are applied. - rpc :UpdatePrivateConnection, ::Google::Cloud::VmwareEngine::V1::UpdatePrivateConnectionRequest, ::Google::Longrunning::Operation - # Deletes a `PrivateConnection` resource. When a private connection is - # deleted for a VMware Engine network, the connected network becomes - # inaccessible to that VMware Engine network. - rpc :DeletePrivateConnection, ::Google::Cloud::VmwareEngine::V1::DeletePrivateConnectionRequest, ::Google::Longrunning::Operation - # Lists the private connection routes exchanged over a peering connection. - rpc :ListPrivateConnectionPeeringRoutes, ::Google::Cloud::VmwareEngine::V1::ListPrivateConnectionPeeringRoutesRequest, ::Google::Cloud::VmwareEngine::V1::ListPrivateConnectionPeeringRoutesResponse - # Grants the bind permission to the customer provided principal(user / - # service account) to bind their DNS zone with the intranet VPC associated - # with the project. DnsBindPermission is a global resource and location can - # only be global. - rpc :GrantDnsBindPermission, ::Google::Cloud::VmwareEngine::V1::GrantDnsBindPermissionRequest, ::Google::Longrunning::Operation - # Gets all the principals having bind permission on the intranet VPC - # associated with the consumer project granted by the Grant API. - # DnsBindPermission is a global resource and location can only be global. - rpc :GetDnsBindPermission, ::Google::Cloud::VmwareEngine::V1::GetDnsBindPermissionRequest, ::Google::Cloud::VmwareEngine::V1::DnsBindPermission - # Revokes the bind permission from the customer provided principal(user / - # service account) on the intranet VPC associated with the consumer project. - # DnsBindPermission is a global resource and location can only be global. - rpc :RevokeDnsBindPermission, ::Google::Cloud::VmwareEngine::V1::RevokeDnsBindPermissionRequest, ::Google::Longrunning::Operation - end - - Stub = Service.rpc_stub_class - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-vmware_engine-v1/proto_docs/README.md b/owl-bot-staging/google-cloud-vmware_engine-v1/proto_docs/README.md deleted file mode 100644 index 14206f5cd85e..000000000000 --- a/owl-bot-staging/google-cloud-vmware_engine-v1/proto_docs/README.md +++ /dev/null @@ -1,4 +0,0 @@ -# Google Cloud VMware Engine 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-vmware_engine-v1/proto_docs/google/api/client.rb b/owl-bot-staging/google-cloud-vmware_engine-v1/proto_docs/google/api/client.rb deleted file mode 100644 index 3ab0b096d445..000000000000 --- a/owl-bot-staging/google-cloud-vmware_engine-v1/proto_docs/google/api/client.rb +++ /dev/null @@ -1,593 +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. - # - # Note: This field should not be used in most cases. - 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: - # library_settings: - # 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. - # @!attribute [rw] library_package - # @return [::String] - # The package name to use in Php. Clobbers the php_namespace option - # set in the protobuf. This should be used **only** by APIs - # who have already set the language_settings.php.package_name" field - # in gapic.yaml. API teams should use the protobuf php_namespace option - # where possible. - # - # Example of a YAML configuration:: - # - # publishing: - # library_settings: - # php_settings: - # library_package: Google\Cloud\PubSub\V1 - 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. - # - # Example: - # - # 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 - # @!attribute [rw] batching - # @return [::Google::Api::BatchingConfigProto] - # Batching configuration for an API method in client libraries. - # - # Example of a YAML configuration: - # - # publishing: - # method_settings: - # - selector: google.example.v1.ExampleService.BatchCreateExample - # batching: - # element_count_threshold: 1000 - # request_byte_threshold: 100000000 - # delay_threshold_millis: 10 - 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. - # - # Note: This feature should not be used in most cases. - # @!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 - - # `BatchingConfigProto` defines the batching configuration for an API method. - # @!attribute [rw] thresholds - # @return [::Google::Api::BatchingSettingsProto] - # The thresholds which trigger a batched request to be sent. - # @!attribute [rw] batch_descriptor - # @return [::Google::Api::BatchingDescriptorProto] - # The request and response fields used in batching. - class BatchingConfigProto - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # `BatchingSettingsProto` specifies a set of batching thresholds, each of - # which acts as a trigger to send a batch of messages as a request. At least - # one threshold must be positive nonzero. - # @!attribute [rw] element_count_threshold - # @return [::Integer] - # The number of elements of a field collected into a batch which, if - # exceeded, causes the batch to be sent. - # @!attribute [rw] request_byte_threshold - # @return [::Integer] - # The aggregated size of the batched field which, if exceeded, causes the - # batch to be sent. This size is computed by aggregating the sizes of the - # request field to be batched, not of the entire request message. - # @!attribute [rw] delay_threshold - # @return [::Google::Protobuf::Duration] - # The duration after which a batch should be sent, starting from the addition - # of the first message to that batch. - # @!attribute [rw] element_count_limit - # @return [::Integer] - # The maximum number of elements collected in a batch that could be accepted - # by server. - # @!attribute [rw] request_byte_limit - # @return [::Integer] - # The maximum size of the request that could be accepted by server. - # @!attribute [rw] flow_control_element_limit - # @return [::Integer] - # The maximum number of elements allowed by flow control. - # @!attribute [rw] flow_control_byte_limit - # @return [::Integer] - # The maximum size of data allowed by flow control. - # @!attribute [rw] flow_control_limit_exceeded_behavior - # @return [::Google::Api::FlowControlLimitExceededBehaviorProto] - # The behavior to take when the flow control limit is exceeded. - class BatchingSettingsProto - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # `BatchingDescriptorProto` specifies the fields of the request message to be - # used for batching, and, optionally, the fields of the response message to be - # used for demultiplexing. - # @!attribute [rw] batched_field - # @return [::String] - # The repeated field in the request message to be aggregated by batching. - # @!attribute [rw] discriminator_fields - # @return [::Array<::String>] - # A list of the fields in the request message. Two requests will be batched - # together only if the values of every field specified in - # `request_discriminator_fields` is equal between the two requests. - # @!attribute [rw] subresponse_field - # @return [::String] - # Optional. When present, indicates the field in the response message to be - # used to demultiplex the response into multiple response messages, in - # correspondence with the multiple request messages originally batched - # together. - class BatchingDescriptorProto - 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 - - # The behavior to take when the flow control limit is exceeded. - module FlowControlLimitExceededBehaviorProto - # Default behavior, system-defined. - UNSET_BEHAVIOR = 0 - - # Stop operation, raise error. - THROW_EXCEPTION = 1 - - # Pause operation until limit clears. - BLOCK = 2 - - # Continue operation, disregard limit. - IGNORE = 3 - end - end -end diff --git a/owl-bot-staging/google-cloud-vmware_engine-v1/proto_docs/google/api/field_behavior.rb b/owl-bot-staging/google-cloud-vmware_engine-v1/proto_docs/google/api/field_behavior.rb deleted file mode 100644 index 582be187d115..000000000000 --- a/owl-bot-staging/google-cloud-vmware_engine-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-vmware_engine-v1/proto_docs/google/api/field_info.rb b/owl-bot-staging/google-cloud-vmware_engine-v1/proto_docs/google/api/field_info.rb deleted file mode 100644 index 0f5acf0a5538..000000000000 --- a/owl-bot-staging/google-cloud-vmware_engine-v1/proto_docs/google/api/field_info.rb +++ /dev/null @@ -1,88 +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 - # Rich semantic information of an API field beyond basic typing. - # @!attribute [rw] format - # @return [::Google::Api::FieldInfo::Format] - # The standard format of a field value. This does not explicitly configure - # any API consumer, just documents the API's format for the field it is - # applied to. - # @!attribute [rw] referenced_types - # @return [::Array<::Google::Api::TypeReference>] - # The type(s) that the annotated, generic field may represent. - # - # Currently, this must only be used on fields of type `google.protobuf.Any`. - # Supporting other generic types may be considered in the future. - class FieldInfo - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The standard format of a field value. The supported formats are all backed - # by either an RFC defined by the IETF or a Google-defined AIP. - module Format - # Default, unspecified value. - FORMAT_UNSPECIFIED = 0 - - # Universally Unique Identifier, version 4, value as defined by - # https://datatracker.ietf.org/doc/html/rfc4122. The value may be - # normalized to entirely lowercase letters. For example, the value - # `F47AC10B-58CC-0372-8567-0E02B2C3D479` would be normalized to - # `f47ac10b-58cc-0372-8567-0e02b2c3d479`. - UUID4 = 1 - - # Internet Protocol v4 value as defined by [RFC - # 791](https://datatracker.ietf.org/doc/html/rfc791). The value may be - # condensed, with leading zeros in each octet stripped. For example, - # `001.022.233.040` would be condensed to `1.22.233.40`. - IPV4 = 2 - - # Internet Protocol v6 value as defined by [RFC - # 2460](https://datatracker.ietf.org/doc/html/rfc2460). The value may be - # normalized to entirely lowercase letters with zeros compressed, following - # [RFC 5952](https://datatracker.ietf.org/doc/html/rfc5952). For example, - # the value `2001:0DB8:0::0` would be normalized to `2001:db8::`. - IPV6 = 3 - - # An IP address in either v4 or v6 format as described by the individual - # values defined herein. See the comments on the IPV4 and IPV6 types for - # allowed normalizations of each. - IPV4_OR_IPV6 = 4 - end - end - - # A reference to a message type, for use in {::Google::Api::FieldInfo FieldInfo}. - # @!attribute [rw] type_name - # @return [::String] - # The name of the type that the annotated, generic field may represent. - # If the type is in the same protobuf package, the value can be the simple - # message name e.g., `"MyMessage"`. Otherwise, the value must be the - # fully-qualified message name e.g., `"google.library.v1.Book"`. - # - # If the type(s) are unknown to the service (e.g. the field accepts generic - # user input), use the wildcard `"*"` to denote this behavior. - # - # See [AIP-202](https://google.aip.dev/202#type-references) for more details. - class TypeReference - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end -end diff --git a/owl-bot-staging/google-cloud-vmware_engine-v1/proto_docs/google/api/launch_stage.rb b/owl-bot-staging/google-cloud-vmware_engine-v1/proto_docs/google/api/launch_stage.rb deleted file mode 100644 index 9392a413fb1b..000000000000 --- a/owl-bot-staging/google-cloud-vmware_engine-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-vmware_engine-v1/proto_docs/google/api/resource.rb b/owl-bot-staging/google-cloud-vmware_engine-v1/proto_docs/google/api/resource.rb deleted file mode 100644 index 25dec4847ac1..000000000000 --- a/owl-bot-staging/google-cloud-vmware_engine-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-vmware_engine-v1/proto_docs/google/cloud/vmwareengine/v1/vmwareengine.rb b/owl-bot-staging/google-cloud-vmware_engine-v1/proto_docs/google/cloud/vmwareengine/v1/vmwareengine.rb deleted file mode 100644 index 8a6e3f9ee9d2..000000000000 --- a/owl-bot-staging/google-cloud-vmware_engine-v1/proto_docs/google/cloud/vmwareengine/v1/vmwareengine.rb +++ /dev/null @@ -1,2791 +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 VmwareEngine - module V1 - # Request message for - # {::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#list_private_clouds VmwareEngine.ListPrivateClouds} - # @!attribute [rw] parent - # @return [::String] - # Required. The resource name of the private cloud to be queried for - # clusters. Resource names are schemeless URIs that follow the conventions in - # https://cloud.google.com/apis/design/resource_names. - # For example: - # `projects/my-project/locations/us-central1-a` - # @!attribute [rw] page_size - # @return [::Integer] - # The maximum number of private clouds to return in one page. - # The service may return fewer than this value. - # The maximum value is coerced to 1000. - # The default value of this field is 500. - # @!attribute [rw] page_token - # @return [::String] - # A page token, received from a previous `ListPrivateClouds` call. - # Provide this to retrieve the subsequent page. - # - # When paginating, all other parameters provided to `ListPrivateClouds` must - # match the call that provided the page token. - # @!attribute [rw] filter - # @return [::String] - # A filter expression that matches resources returned in the response. - # The expression must specify the field name, a comparison operator, and the - # value that you want to use for filtering. The value must be a string, a - # number, or a boolean. The comparison operator must be `=`, `!=`, `>`, or - # `<`. - # - # For example, if you are filtering a list of private clouds, you can exclude - # the ones named `example-pc` by specifying `name != "example-pc"`. - # - # You can also filter nested fields. For example, you could specify - # `networkConfig.managementCidr = "192.168.0.0/24"` to include private clouds - # only if they have a matching address in their network configuration. - # - # To filter on multiple expressions, provide each separate expression within - # parentheses. For example: - # ``` - # (name = "example-pc") - # (createTime > "2021-04-12T08:15:10.40Z") - # ``` - # - # By default, each expression is an `AND` expression. However, you can - # include `AND` and `OR` expressions explicitly. For example: - # ``` - # (name = "private-cloud-1") AND - # (createTime > "2021-04-12T08:15:10.40Z") OR - # (name = "private-cloud-2") - # ``` - # @!attribute [rw] order_by - # @return [::String] - # Sorts list results by a certain order. By default, returned results are - # ordered by `name` in ascending order. You can also sort results in - # descending order based on the `name` value using `orderBy="name desc"`. - # Currently, only ordering by `name` is supported. - class ListPrivateCloudsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for - # {::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#list_private_clouds VmwareEngine.ListPrivateClouds} - # @!attribute [rw] private_clouds - # @return [::Array<::Google::Cloud::VmwareEngine::V1::PrivateCloud>] - # A list of private clouds. - # @!attribute [rw] next_page_token - # @return [::String] - # A token, which can be sent as `page_token` to retrieve the next page. - # If this field is omitted, there are no subsequent pages. - # @!attribute [rw] unreachable - # @return [::Array<::String>] - # Locations that could not be reached when making an aggregated query using - # wildcards. - class ListPrivateCloudsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#get_private_cloud VmwareEngine.GetPrivateCloud} - # @!attribute [rw] name - # @return [::String] - # Required. The resource name of the private cloud to retrieve. - # Resource names are schemeless URIs that follow the conventions in - # https://cloud.google.com/apis/design/resource_names. - # For example: - # `projects/my-project/locations/us-central1-a/privateClouds/my-cloud` - class GetPrivateCloudRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#create_private_cloud VmwareEngine.CreatePrivateCloud} - # @!attribute [rw] parent - # @return [::String] - # Required. The resource name of the location to create the new - # private cloud in. Resource names are schemeless URIs that follow the - # conventions in https://cloud.google.com/apis/design/resource_names. - # For example: - # `projects/my-project/locations/us-central1-a` - # @!attribute [rw] private_cloud_id - # @return [::String] - # Required. The user-provided identifier of the private cloud to be created. - # This identifier must be unique among each `PrivateCloud` within the parent - # and becomes the final token in the name URI. - # The identifier must meet the following requirements: - # - # * Only contains 1-63 alphanumeric characters and hyphens - # * Begins with an alphabetical character - # * Ends with a non-hyphen character - # * Not formatted as a UUID - # * Complies with [RFC 1034](https://datatracker.ietf.org/doc/html/rfc1034) - # (section 3.5) - # @!attribute [rw] private_cloud - # @return [::Google::Cloud::VmwareEngine::V1::PrivateCloud] - # Required. The initial description of the new private cloud. - # @!attribute [rw] request_id - # @return [::String] - # Optional. The request ID must be a valid UUID with the exception that zero - # UUID is not supported (00000000-0000-0000-0000-000000000000). - # @!attribute [rw] validate_only - # @return [::Boolean] - # Optional. True if you want the request to be validated and not executed; - # false otherwise. - class CreatePrivateCloudRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#update_private_cloud VmwareEngine.UpdatePrivateCloud} - # @!attribute [rw] private_cloud - # @return [::Google::Cloud::VmwareEngine::V1::PrivateCloud] - # Required. Private cloud description. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # Required. Field mask is used to specify the fields to be overwritten in the - # `PrivateCloud` resource by the update. The fields specified in `updateMask` - # are relative to the resource, not the full request. A field will be - # overwritten if it is in the mask. If the user does not provide a mask then - # all fields will be overwritten. - # @!attribute [rw] request_id - # @return [::String] - # Optional. The request ID must be a valid UUID with the exception that zero - # UUID is not supported (00000000-0000-0000-0000-000000000000). - class UpdatePrivateCloudRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#delete_private_cloud VmwareEngine.DeletePrivateCloud} - # @!attribute [rw] name - # @return [::String] - # Required. The resource name of the private cloud to delete. - # Resource names are schemeless URIs that follow the conventions in - # https://cloud.google.com/apis/design/resource_names. - # For example: - # `projects/my-project/locations/us-central1-a/privateClouds/my-cloud` - # @!attribute [rw] request_id - # @return [::String] - # Optional. The request ID must be a valid UUID with the exception that zero - # UUID is not supported (00000000-0000-0000-0000-000000000000). - # @!attribute [rw] force - # @return [::Boolean] - # Optional. If set to true, cascade delete is enabled and all children of - # this private cloud resource are also deleted. When this flag is set to - # false, the private cloud will not be deleted if there are any children - # other than the management cluster. The management cluster is always - # deleted. - # @!attribute [rw] delay_hours - # @return [::Integer] - # Optional. Time delay of the deletion specified in hours. The default value - # is `3`. Specifying a non-zero value for this field changes the value of - # `PrivateCloud.state` to `DELETED` and sets `expire_time` to the planned - # deletion time. Deletion can be cancelled before `expire_time` elapses using - # {::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#undelete_private_cloud VmwareEngine.UndeletePrivateCloud}. - # Specifying a value of `0` for this field instead begins the deletion - # process and ceases billing immediately. During the final deletion process, - # the value of `PrivateCloud.state` becomes `PURGING`. - class DeletePrivateCloudRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#undelete_private_cloud VmwareEngine.UndeletePrivateCloud} - # @!attribute [rw] name - # @return [::String] - # Required. The resource name of the private cloud scheduled for deletion. - # Resource names are schemeless URIs that follow the conventions in - # https://cloud.google.com/apis/design/resource_names. - # For example: - # `projects/my-project/locations/us-central1-a/privateClouds/my-cloud` - # @!attribute [rw] request_id - # @return [::String] - # Optional. The request ID must be a valid UUID with the exception that zero - # UUID is not supported (00000000-0000-0000-0000-000000000000). - class UndeletePrivateCloudRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#list_clusters VmwareEngine.ListClusters} - # @!attribute [rw] parent - # @return [::String] - # Required. The resource name of the private cloud to query for clusters. - # Resource names are schemeless URIs that follow the conventions in - # https://cloud.google.com/apis/design/resource_names. - # For example: - # `projects/my-project/locations/us-central1-a/privateClouds/my-cloud` - # @!attribute [rw] page_size - # @return [::Integer] - # The maximum number of clusters to return in one page. - # The service may return fewer than this value. - # The maximum value is coerced to 1000. - # The default value of this field is 500. - # @!attribute [rw] page_token - # @return [::String] - # A page token, received from a previous `ListClusters` call. - # Provide this to retrieve the subsequent page. - # - # When paginating, all other parameters provided to `ListClusters` - # must match the call that provided the page token. - # @!attribute [rw] filter - # @return [::String] - # To filter on multiple expressions, provide each separate expression within - # parentheses. For example: - # ``` - # (name = "example-cluster") - # (nodeCount = "3") - # ``` - # - # By default, each expression is an `AND` expression. However, you can - # include `AND` and `OR` expressions explicitly. For example: - # ``` - # (name = "example-cluster-1") AND - # (createTime > "2021-04-12T08:15:10.40Z") OR - # (name = "example-cluster-2") - # ``` - # @!attribute [rw] order_by - # @return [::String] - # Sorts list results by a certain order. By default, returned results are - # ordered by `name` in ascending order. You can also sort results in - # descending order based on the `name` value using `orderBy="name desc"`. - # Currently, only ordering by `name` is supported. - class ListClustersRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for - # {::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#list_clusters VmwareEngine.ListClusters} - # @!attribute [rw] clusters - # @return [::Array<::Google::Cloud::VmwareEngine::V1::Cluster>] - # A list of private cloud clusters. - # @!attribute [rw] next_page_token - # @return [::String] - # A token, which can be sent as `page_token` to retrieve the next page. - # If this field is omitted, there are no subsequent pages. - # @!attribute [rw] unreachable - # @return [::Array<::String>] - # Locations that could not be reached when making an aggregated query using - # wildcards. - class ListClustersResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#get_cluster VmwareEngine.GetCluster} - # @!attribute [rw] name - # @return [::String] - # Required. The cluster resource name to retrieve. - # Resource names are schemeless URIs that follow the conventions in - # https://cloud.google.com/apis/design/resource_names. - # For example: - # `projects/my-project/locations/us-central1-a/privateClouds/my-cloud/clusters/my-cluster` - class GetClusterRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#create_cluster VmwareEngine.CreateCluster} - # @!attribute [rw] parent - # @return [::String] - # Required. The resource name of the private cloud to create a new cluster - # in. Resource names are schemeless URIs that follow the conventions in - # https://cloud.google.com/apis/design/resource_names. - # For example: - # `projects/my-project/locations/us-central1-a/privateClouds/my-cloud` - # @!attribute [rw] cluster_id - # @return [::String] - # Required. The user-provided identifier of the new `Cluster`. - # This identifier must be unique among clusters within the parent and becomes - # the final token in the name URI. - # The identifier must meet the following requirements: - # - # * Only contains 1-63 alphanumeric characters and hyphens - # * Begins with an alphabetical character - # * Ends with a non-hyphen character - # * Not formatted as a UUID - # * Complies with [RFC 1034](https://datatracker.ietf.org/doc/html/rfc1034) - # (section 3.5) - # @!attribute [rw] cluster - # @return [::Google::Cloud::VmwareEngine::V1::Cluster] - # Required. The initial description of the new cluster. - # @!attribute [rw] request_id - # @return [::String] - # Optional. The request ID must be a valid UUID with the exception that zero - # UUID is not supported (00000000-0000-0000-0000-000000000000). - # @!attribute [rw] validate_only - # @return [::Boolean] - # Optional. True if you want the request to be validated and not executed; - # false otherwise. - class CreateClusterRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#update_cluster VmwareEngine.UpdateCluster} - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # Required. Field mask is used to specify the fields to be overwritten in the - # `Cluster` resource by the update. The fields specified in the `updateMask` - # are relative to the resource, not the full request. A field will be - # overwritten if it is in the mask. If the user does not provide a mask then - # all fields will be overwritten. - # @!attribute [rw] cluster - # @return [::Google::Cloud::VmwareEngine::V1::Cluster] - # Required. The description of the cluster. - # @!attribute [rw] request_id - # @return [::String] - # Optional. The request ID must be a valid UUID with the exception that - # zero UUID is not supported (00000000-0000-0000-0000-000000000000). - # @!attribute [rw] validate_only - # @return [::Boolean] - # Optional. True if you want the request to be validated and not executed; - # false otherwise. - class UpdateClusterRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#delete_cluster VmwareEngine.DeleteCluster} - # @!attribute [rw] name - # @return [::String] - # Required. The resource name of the cluster to delete. - # Resource names are schemeless URIs that follow the conventions in - # https://cloud.google.com/apis/design/resource_names. - # For example: - # `projects/my-project/locations/us-central1-a/privateClouds/my-cloud/clusters/my-cluster` - # @!attribute [rw] request_id - # @return [::String] - # Optional. The request ID must be a valid UUID with the exception that zero - # UUID is not supported (00000000-0000-0000-0000-000000000000). - class DeleteClusterRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#list_nodes VmwareEngine.ListNodes} - # @!attribute [rw] parent - # @return [::String] - # Required. The resource name of the cluster to be queried for nodes. - # Resource names are schemeless URIs that follow the conventions in - # https://cloud.google.com/apis/design/resource_names. - # For example: - # `projects/my-project/locations/us-central1-a/privateClouds/my-cloud/clusters/my-cluster` - # @!attribute [rw] page_size - # @return [::Integer] - # The maximum number of nodes to return in one page. - # The service may return fewer than this value. - # The maximum value is coerced to 1000. - # The default value of this field is 500. - # @!attribute [rw] page_token - # @return [::String] - # A page token, received from a previous `ListNodes` call. - # Provide this to retrieve the subsequent page. - # - # When paginating, all other parameters provided to - # `ListNodes` must match the call that provided the page - # token. - class ListNodesRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for - # {::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#list_nodes VmwareEngine.ListNodes} - # @!attribute [rw] nodes - # @return [::Array<::Google::Cloud::VmwareEngine::V1::Node>] - # The nodes. - # @!attribute [rw] next_page_token - # @return [::String] - # A token, which can be sent as `page_token` to retrieve the next page. - # If this field is omitted, there are no subsequent pages. - class ListNodesResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#get_node VmwareEngine.GetNode} - # @!attribute [rw] name - # @return [::String] - # Required. The resource name of the node to retrieve. - # For example: - # `projects/{project}/locations/{location}/privateClouds/{private_cloud}/clusters/{cluster}/nodes/{node}` - class GetNodeRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#list_external_addresses VmwareEngine.ListExternalAddresses} - # @!attribute [rw] parent - # @return [::String] - # Required. The resource name of the private cloud to be queried for - # external IP addresses. - # Resource names are schemeless URIs that follow the conventions in - # https://cloud.google.com/apis/design/resource_names. - # For example: - # `projects/my-project/locations/us-central1-a/privateClouds/my-cloud` - # @!attribute [rw] page_size - # @return [::Integer] - # The maximum number of external IP addresses to return in one page. - # The service may return fewer than this value. - # The maximum value is coerced to 1000. - # The default value of this field is 500. - # @!attribute [rw] page_token - # @return [::String] - # A page token, received from a previous `ListExternalAddresses` call. - # Provide this to retrieve the subsequent page. - # - # When paginating, all other parameters provided to - # `ListExternalAddresses` must match the call that provided the page token. - # @!attribute [rw] filter - # @return [::String] - # A filter expression that matches resources returned in the response. - # The expression must specify the field name, a comparison - # operator, and the value that you want to use for filtering. The value - # must be a string, a number, or a boolean. The comparison operator - # must be `=`, `!=`, `>`, or `<`. - # - # For example, if you are filtering a list of IP addresses, you can - # exclude the ones named `example-ip` by specifying - # `name != "example-ip"`. - # - # To filter on multiple expressions, provide each separate expression within - # parentheses. For example: - # ``` - # (name = "example-ip") - # (createTime > "2021-04-12T08:15:10.40Z") - # ``` - # - # By default, each expression is an `AND` expression. However, you - # can include `AND` and `OR` expressions explicitly. - # For example: - # ``` - # (name = "example-ip-1") AND - # (createTime > "2021-04-12T08:15:10.40Z") OR - # (name = "example-ip-2") - # ``` - # @!attribute [rw] order_by - # @return [::String] - # Sorts list results by a certain order. By default, returned results - # are ordered by `name` in ascending order. - # You can also sort results in descending order based on the `name` value - # using `orderBy="name desc"`. - # Currently, only ordering by `name` is supported. - class ListExternalAddressesRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for - # {::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#list_external_addresses VmwareEngine.ListExternalAddresses} - # @!attribute [rw] external_addresses - # @return [::Array<::Google::Cloud::VmwareEngine::V1::ExternalAddress>] - # A list of external IP addresses. - # @!attribute [rw] next_page_token - # @return [::String] - # A token, which can be sent as `page_token` to retrieve the next page. - # If this field is omitted, there are no subsequent pages. - # @!attribute [rw] unreachable - # @return [::Array<::String>] - # Locations that could not be reached when making an aggregated query using - # wildcards. - class ListExternalAddressesResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#fetch_network_policy_external_addresses VmwareEngine.FetchNetworkPolicyExternalAddresses} - # @!attribute [rw] network_policy - # @return [::String] - # Required. The resource name of the network policy to query for assigned - # external IP addresses. Resource names are schemeless URIs that follow the - # conventions in https://cloud.google.com/apis/design/resource_names. For - # example: - # `projects/my-project/locations/us-central1/networkPolicies/my-policy` - # @!attribute [rw] page_size - # @return [::Integer] - # The maximum number of external IP addresses to return in one page. - # The service may return fewer than this value. - # The maximum value is coerced to 1000. - # The default value of this field is 500. - # @!attribute [rw] page_token - # @return [::String] - # A page token, received from a previous - # `FetchNetworkPolicyExternalAddresses` call. Provide this to retrieve the - # subsequent page. - # - # When paginating, all parameters provided to - # `FetchNetworkPolicyExternalAddresses`, except for `page_size` and - # `page_token`, must match the call that provided the page token. - class FetchNetworkPolicyExternalAddressesRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for - # {::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#fetch_network_policy_external_addresses VmwareEngine.FetchNetworkPolicyExternalAddresses} - # @!attribute [rw] external_addresses - # @return [::Array<::Google::Cloud::VmwareEngine::V1::ExternalAddress>] - # A list of external IP addresses assigned to VMware workload VMs within the - # scope of the given network policy. - # @!attribute [rw] next_page_token - # @return [::String] - # A token, which can be sent as `page_token` to retrieve the next page. - # If this field is omitted, there are no subsequent pages. - class FetchNetworkPolicyExternalAddressesResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#get_external_address VmwareEngine.GetExternalAddress} - # @!attribute [rw] name - # @return [::String] - # Required. The resource name of the external IP address to retrieve. - # Resource names are schemeless URIs that follow the conventions in - # https://cloud.google.com/apis/design/resource_names. - # For example: - # `projects/my-project/locations/us-central1-a/privateClouds/my-cloud/externalAddresses/my-ip` - class GetExternalAddressRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#create_external_address VmwareEngine.CreateExternalAddress} - # @!attribute [rw] parent - # @return [::String] - # Required. The resource name of the private cloud - # to create a new external IP address in. - # Resource names are schemeless URIs that follow the conventions in - # https://cloud.google.com/apis/design/resource_names. - # For example: - # `projects/my-project/locations/us-central1-a/privateClouds/my-cloud` - # @!attribute [rw] external_address - # @return [::Google::Cloud::VmwareEngine::V1::ExternalAddress] - # Required. The initial description of a new external IP address. - # @!attribute [rw] external_address_id - # @return [::String] - # Required. The user-provided identifier of the `ExternalAddress` to be - # created. This identifier must be unique among `ExternalAddress` resources - # within the parent and becomes the final token in the name URI. The - # identifier must meet the following requirements: - # - # * Only contains 1-63 alphanumeric characters and hyphens - # * Begins with an alphabetical character - # * Ends with a non-hyphen character - # * Not formatted as a UUID - # * Complies with [RFC 1034](https://datatracker.ietf.org/doc/html/rfc1034) - # (section 3.5) - # @!attribute [rw] request_id - # @return [::String] - # Optional. A request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server guarantees that a - # request doesn't result in creation of duplicate commitments for at least 60 - # minutes. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request ID, - # the server can check if the original operation with the same request ID was - # received, and if so, will ignore the second request. This prevents clients - # from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - class CreateExternalAddressRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#update_external_address VmwareEngine.UpdateExternalAddress} - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # Required. Field mask is used to specify the fields to be overwritten in the - # `ExternalAddress` resource by the update. - # The fields specified in the `update_mask` are relative to the resource, not - # the full request. A field will be overwritten if it is in the mask. If the - # user does not provide a mask then all fields will be overwritten. - # @!attribute [rw] external_address - # @return [::Google::Cloud::VmwareEngine::V1::ExternalAddress] - # Required. External IP address description. - # @!attribute [rw] request_id - # @return [::String] - # Optional. A request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server guarantees that a - # request doesn't result in creation of duplicate commitments for at least 60 - # minutes. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request ID, - # the server can check if the original operation with the same request ID was - # received, and if so, will ignore the second request. This prevents clients - # from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - class UpdateExternalAddressRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#delete_external_address VmwareEngine.DeleteExternalAddress} - # @!attribute [rw] name - # @return [::String] - # Required. The resource name of the external IP address to delete. - # Resource names are schemeless URIs that follow the conventions in - # https://cloud.google.com/apis/design/resource_names. - # For example: - # `projects/my-project/locations/us-central1-a/privateClouds/my-cloud/externalAddresses/my-ip` - # @!attribute [rw] request_id - # @return [::String] - # Optional. A request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server guarantees that a - # request doesn't result in creation of duplicate commitments for at least 60 - # minutes. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request - # ID, the server can check if the original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - class DeleteExternalAddressRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#list_subnets VmwareEngine.ListSubnets} - # @!attribute [rw] parent - # @return [::String] - # Required. The resource name of the private cloud to be queried for - # subnets. - # Resource names are schemeless URIs that follow the conventions in - # https://cloud.google.com/apis/design/resource_names. - # For example: - # `projects/my-project/locations/us-central1-a/privateClouds/my-cloud` - # @!attribute [rw] page_size - # @return [::Integer] - # The maximum number of subnets to return in one page. - # The service may return fewer than this value. - # The maximum value is coerced to 1000. - # The default value of this field is 500. - # @!attribute [rw] page_token - # @return [::String] - # A page token, received from a previous `ListSubnetsRequest` call. - # Provide this to retrieve the subsequent page. - # - # When paginating, all other parameters provided to - # `ListSubnetsRequest` must match the call that provided the page token. - class ListSubnetsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for - # {::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#list_subnets VmwareEngine.ListSubnets} - # @!attribute [rw] subnets - # @return [::Array<::Google::Cloud::VmwareEngine::V1::Subnet>] - # A list of subnets. - # @!attribute [rw] next_page_token - # @return [::String] - # A token, which can be sent as `page_token` to retrieve the next page. - # If this field is omitted, there are no subsequent pages. - # @!attribute [rw] unreachable - # @return [::Array<::String>] - # Locations that could not be reached when making an aggregated query using - # wildcards. - class ListSubnetsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#get_subnet VmwareEngine.GetSubnet} - # @!attribute [rw] name - # @return [::String] - # Required. The resource name of the subnet to retrieve. - # Resource names are schemeless URIs that follow the conventions in - # https://cloud.google.com/apis/design/resource_names. - # For example: - # `projects/my-project/locations/us-central1-a/privateClouds/my-cloud/subnets/my-subnet` - class GetSubnetRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#update_subnet VmwareEngine.UpdateSubnet} - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # Required. Field mask is used to specify the fields to be overwritten in the - # `Subnet` resource by the update. - # The fields specified in the `update_mask` are relative to the resource, not - # the full request. A field will be overwritten if it is in the mask. If the - # user does not provide a mask then all fields will be overwritten. - # @!attribute [rw] subnet - # @return [::Google::Cloud::VmwareEngine::V1::Subnet] - # Required. Subnet description. - class UpdateSubnetRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#list_external_access_rules VmwareEngine.ListExternalAccessRules} - # @!attribute [rw] parent - # @return [::String] - # Required. The resource name of the network policy to query for external - # access firewall rules. Resource names are schemeless URIs that follow the - # conventions in https://cloud.google.com/apis/design/resource_names. For - # example: - # `projects/my-project/locations/us-central1/networkPolicies/my-policy` - # @!attribute [rw] page_size - # @return [::Integer] - # The maximum number of external access rules to return in one page. - # The service may return fewer than this value. - # The maximum value is coerced to 1000. - # The default value of this field is 500. - # @!attribute [rw] page_token - # @return [::String] - # A page token, received from a previous `ListExternalAccessRulesRequest` - # call. Provide this to retrieve the subsequent page. - # - # When paginating, all other parameters provided to - # `ListExternalAccessRulesRequest` must match the call that provided the page - # token. - # @!attribute [rw] filter - # @return [::String] - # A filter expression that matches resources returned in the response. - # The expression must specify the field name, a comparison - # operator, and the value that you want to use for filtering. The value - # must be a string, a number, or a boolean. The comparison operator - # must be `=`, `!=`, `>`, or `<`. - # - # For example, if you are filtering a list of external access rules, you can - # exclude the ones named `example-rule` by specifying - # `name != "example-rule"`. - # - # To filter on multiple expressions, provide each separate expression within - # parentheses. For example: - # ``` - # (name = "example-rule") - # (createTime > "2021-04-12T08:15:10.40Z") - # ``` - # - # By default, each expression is an `AND` expression. However, you - # can include `AND` and `OR` expressions explicitly. - # For example: - # ``` - # (name = "example-rule-1") AND - # (createTime > "2021-04-12T08:15:10.40Z") OR - # (name = "example-rule-2") - # ``` - # @!attribute [rw] order_by - # @return [::String] - # Sorts list results by a certain order. By default, returned results - # are ordered by `name` in ascending order. - # You can also sort results in descending order based on the `name` value - # using `orderBy="name desc"`. - # Currently, only ordering by `name` is supported. - class ListExternalAccessRulesRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for - # {::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#list_external_access_rules VmwareEngine.ListExternalAccessRules} - # @!attribute [rw] external_access_rules - # @return [::Array<::Google::Cloud::VmwareEngine::V1::ExternalAccessRule>] - # A list of external access firewall rules. - # @!attribute [rw] next_page_token - # @return [::String] - # A token, which can be sent as `page_token` to retrieve the next page. - # If this field is omitted, there are no subsequent pages. - # @!attribute [rw] unreachable - # @return [::Array<::String>] - # Locations that could not be reached when making an aggregated query using - # wildcards. - class ListExternalAccessRulesResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#get_external_access_rule VmwareEngine.GetExternalAccessRule} - # @!attribute [rw] name - # @return [::String] - # Required. The resource name of the external access firewall rule to - # retrieve. Resource names are schemeless URIs that follow the conventions in - # https://cloud.google.com/apis/design/resource_names. - # For example: - # `projects/my-project/locations/us-central1/networkPolicies/my-policy/externalAccessRules/my-rule` - class GetExternalAccessRuleRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#create_external_access_rule VmwareEngine.CreateExternalAccessRule} - # @!attribute [rw] parent - # @return [::String] - # Required. The resource name of the network policy - # to create a new external access firewall rule in. - # Resource names are schemeless URIs that follow the conventions in - # https://cloud.google.com/apis/design/resource_names. - # For example: - # `projects/my-project/locations/us-central1/networkPolicies/my-policy` - # @!attribute [rw] external_access_rule - # @return [::Google::Cloud::VmwareEngine::V1::ExternalAccessRule] - # Required. The initial description of a new external access rule. - # @!attribute [rw] external_access_rule_id - # @return [::String] - # Required. The user-provided identifier of the `ExternalAccessRule` to be - # created. This identifier must be unique among `ExternalAccessRule` - # resources within the parent and becomes the final token in the name URI. - # The identifier must meet the following requirements: - # - # * Only contains 1-63 alphanumeric characters and hyphens - # * Begins with an alphabetical character - # * Ends with a non-hyphen character - # * Not formatted as a UUID - # * Complies with [RFC 1034](https://datatracker.ietf.org/doc/html/rfc1034) - # (section 3.5) - # @!attribute [rw] request_id - # @return [::String] - # A request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server guarantees that a - # request doesn't result in creation of duplicate commitments for at least 60 - # minutes. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request ID, - # the server can check if the original operation with the same request ID was - # received, and if so, will ignore the second request. This prevents clients - # from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - class CreateExternalAccessRuleRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#update_external_access_rule VmwareEngine.UpdateExternalAccessRule} - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # Required. Field mask is used to specify the fields to be overwritten in the - # `ExternalAccessRule` resource by the update. - # The fields specified in the `update_mask` are relative to the resource, not - # the full request. A field will be overwritten if it is in the mask. If the - # user does not provide a mask then all fields will be overwritten. - # @!attribute [rw] external_access_rule - # @return [::Google::Cloud::VmwareEngine::V1::ExternalAccessRule] - # Required. Description of the external access rule. - # @!attribute [rw] request_id - # @return [::String] - # Optional. A request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server guarantees that a - # request doesn't result in creation of duplicate commitments for at least 60 - # minutes. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request ID, - # the server can check if the original operation with the same request ID was - # received, and if so, will ignore the second request. This prevents clients - # from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - class UpdateExternalAccessRuleRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#delete_external_access_rule VmwareEngine.DeleteExternalAccessRule} - # @!attribute [rw] name - # @return [::String] - # Required. The resource name of the external access firewall rule to delete. - # Resource names are schemeless URIs that follow the conventions in - # https://cloud.google.com/apis/design/resource_names. - # For example: - # `projects/my-project/locations/us-central1/networkPolicies/my-policy/externalAccessRules/my-rule` - # @!attribute [rw] request_id - # @return [::String] - # Optional. A request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server guarantees that a - # request doesn't result in creation of duplicate commitments for at least 60 - # minutes. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request - # ID, the server can check if the original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - class DeleteExternalAccessRuleRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#list_logging_servers VmwareEngine.ListLoggingServers} - # @!attribute [rw] parent - # @return [::String] - # Required. The resource name of the private cloud to be queried for - # logging servers. - # Resource names are schemeless URIs that follow the conventions in - # https://cloud.google.com/apis/design/resource_names. - # For example: - # `projects/my-project/locations/us-central1-a/privateClouds/my-cloud` - # @!attribute [rw] page_size - # @return [::Integer] - # The maximum number of logging servers to return in one page. - # The service may return fewer than this value. - # The maximum value is coerced to 1000. - # The default value of this field is 500. - # @!attribute [rw] page_token - # @return [::String] - # A page token, received from a previous `ListLoggingServersRequest` call. - # Provide this to retrieve the subsequent page. - # - # When paginating, all other parameters provided to - # `ListLoggingServersRequest` must match the call that provided the page - # token. - # @!attribute [rw] filter - # @return [::String] - # A filter expression that matches resources returned in the response. - # The expression must specify the field name, a comparison - # operator, and the value that you want to use for filtering. The value - # must be a string, a number, or a boolean. The comparison operator - # must be `=`, `!=`, `>`, or `<`. - # - # For example, if you are filtering a list of logging servers, you can - # exclude the ones named `example-server` by specifying - # `name != "example-server"`. - # - # To filter on multiple expressions, provide each separate expression within - # parentheses. For example: - # ``` - # (name = "example-server") - # (createTime > "2021-04-12T08:15:10.40Z") - # ``` - # - # By default, each expression is an `AND` expression. However, you - # can include `AND` and `OR` expressions explicitly. - # For example: - # ``` - # (name = "example-server-1") AND - # (createTime > "2021-04-12T08:15:10.40Z") OR - # (name = "example-server-2") - # ``` - # @!attribute [rw] order_by - # @return [::String] - # Sorts list results by a certain order. By default, returned results - # are ordered by `name` in ascending order. - # You can also sort results in descending order based on the `name` value - # using `orderBy="name desc"`. - # Currently, only ordering by `name` is supported. - class ListLoggingServersRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for - # {::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#list_logging_servers VmwareEngine.ListLoggingServers} - # @!attribute [rw] logging_servers - # @return [::Array<::Google::Cloud::VmwareEngine::V1::LoggingServer>] - # A list of Logging Servers. - # @!attribute [rw] next_page_token - # @return [::String] - # A token, which can be send as `page_token` to retrieve the next page. - # If this field is omitted, there are no subsequent pages. - # @!attribute [rw] unreachable - # @return [::Array<::String>] - # Locations that could not be reached when making an aggregated query using - # wildcards. - class ListLoggingServersResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#get_logging_server VmwareEngine.GetLoggingServer} - # @!attribute [rw] name - # @return [::String] - # Required. The resource name of the Logging Server to retrieve. - # Resource names are schemeless URIs that follow the conventions in - # https://cloud.google.com/apis/design/resource_names. - # For example: - # `projects/my-project/locations/us-central1-a/privateClouds/my-cloud/loggingServers/my-logging-server` - class GetLoggingServerRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#create_logging_server VmwareEngine.CreateLoggingServer} - # @!attribute [rw] parent - # @return [::String] - # Required. The resource name of the private cloud - # to create a new Logging Server in. - # Resource names are schemeless URIs that follow the conventions in - # https://cloud.google.com/apis/design/resource_names. - # For example: - # `projects/my-project/locations/us-central1-a/privateClouds/my-cloud` - # @!attribute [rw] logging_server - # @return [::Google::Cloud::VmwareEngine::V1::LoggingServer] - # Required. The initial description of a new logging server. - # @!attribute [rw] logging_server_id - # @return [::String] - # Required. The user-provided identifier of the `LoggingServer` to be - # created. This identifier must be unique among `LoggingServer` resources - # within the parent and becomes the final token in the name URI. - # The identifier must meet the following requirements: - # - # * Only contains 1-63 alphanumeric characters and hyphens - # * Begins with an alphabetical character - # * Ends with a non-hyphen character - # * Not formatted as a UUID - # * Complies with [RFC 1034](https://datatracker.ietf.org/doc/html/rfc1034) - # (section 3.5) - # @!attribute [rw] request_id - # @return [::String] - # Optional. A request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server guarantees that a - # request doesn't result in creation of duplicate commitments for at least 60 - # minutes. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request ID, - # the server can check if original operation with the same request ID was - # received, and if so, will ignore the second request. This prevents clients - # from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - class CreateLoggingServerRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#update_logging_server VmwareEngine.UpdateLoggingServer} - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # Required. Field mask is used to specify the fields to be overwritten in the - # `LoggingServer` resource by the update. - # The fields specified in the `update_mask` are relative to the resource, not - # the full request. A field will be overwritten if it is in the mask. If the - # user does not provide a mask then all fields will be overwritten. - # @!attribute [rw] logging_server - # @return [::Google::Cloud::VmwareEngine::V1::LoggingServer] - # Required. Logging server description. - # @!attribute [rw] request_id - # @return [::String] - # Optional. A request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server guarantees that a - # request doesn't result in creation of duplicate commitments for at least 60 - # minutes. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request ID, - # the server can check if original operation with the same request ID was - # received, and if so, will ignore the second request. This prevents clients - # from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - class UpdateLoggingServerRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#delete_logging_server VmwareEngine.DeleteLoggingServer} - # @!attribute [rw] name - # @return [::String] - # Required. The resource name of the logging server to delete. - # Resource names are schemeless URIs that follow the conventions in - # https://cloud.google.com/apis/design/resource_names. - # For example: - # `projects/my-project/locations/us-central1-a/privateClouds/my-cloud/loggingServers/my-logging-server` - # @!attribute [rw] request_id - # @return [::String] - # Optional. A request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server guarantees that a - # request doesn't result in creation of duplicate commitments for at least 60 - # minutes. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - class DeleteLoggingServerRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Represents the metadata of the long-running operation. - # @!attribute [r] create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time the operation was created. - # @!attribute [r] end_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time the operation finished running. - # @!attribute [r] target - # @return [::String] - # Output only. Server-defined resource path for the target of the operation. - # @!attribute [r] verb - # @return [::String] - # Output only. Name of the verb executed by the operation. - # @!attribute [r] status_message - # @return [::String] - # Output only. Human-readable status of the operation, if any. - # @!attribute [r] requested_cancellation - # @return [::Boolean] - # Output only. True if the user has requested cancellation - # of the operation; false otherwise. - # Operations that have successfully been cancelled - # have [Operation.error][] value with a - # {::Google::Rpc::Status#code google.rpc.Status.code} of 1, corresponding to - # `Code.CANCELLED`. - # @!attribute [r] api_version - # @return [::String] - # Output only. API version used to start the operation. - class OperationMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#list_node_types VmwareEngine.ListNodeTypes} - # @!attribute [rw] parent - # @return [::String] - # Required. The resource name of the location to be queried for node types. - # Resource names are schemeless URIs that follow the conventions in - # https://cloud.google.com/apis/design/resource_names. - # For example: - # `projects/my-project/locations/us-central1-a` - # @!attribute [rw] page_size - # @return [::Integer] - # The maximum number of node types to return in one page. - # The service may return fewer than this value. - # The maximum value is coerced to 1000. - # The default value of this field is 500. - # @!attribute [rw] page_token - # @return [::String] - # A page token, received from a previous `ListNodeTypes` call. - # Provide this to retrieve the subsequent page. - # - # When paginating, all other parameters provided to - # `ListNodeTypes` must match the call that provided the page token. - # @!attribute [rw] filter - # @return [::String] - # A filter expression that matches resources returned in the response. - # The expression must specify the field name, a comparison - # operator, and the value that you want to use for filtering. The value - # must be a string, a number, or a boolean. The comparison operator - # must be `=`, `!=`, `>`, or `<`. - # - # For example, if you are filtering a list of node types, you can - # exclude the ones named `standard-72` by specifying - # `name != "standard-72"`. - # - # To filter on multiple expressions, provide each separate expression within - # parentheses. For example: - # ``` - # (name = "standard-72") - # (virtual_cpu_count > 2) - # ``` - # - # By default, each expression is an `AND` expression. However, you - # can include `AND` and `OR` expressions explicitly. - # For example: - # ``` - # (name = "standard-96") AND - # (virtual_cpu_count > 2) OR - # (name = "standard-72") - # ``` - class ListNodeTypesRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for - # {::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#list_node_types VmwareEngine.ListNodeTypes} - # @!attribute [rw] node_types - # @return [::Array<::Google::Cloud::VmwareEngine::V1::NodeType>] - # A list of Node Types. - # @!attribute [rw] next_page_token - # @return [::String] - # A token, which can be sent as `page_token` to retrieve the next page. - # If this field is omitted, there are no subsequent pages. - # @!attribute [rw] unreachable - # @return [::Array<::String>] - # Locations that could not be reached when making an aggregated query using - # wildcards. - class ListNodeTypesResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#get_node_type VmwareEngine.GetNodeType} - # @!attribute [rw] name - # @return [::String] - # Required. The resource name of the node type to retrieve. - # Resource names are schemeless URIs that follow the conventions in - # https://cloud.google.com/apis/design/resource_names. - # For example: - # `projects/my-proj/locations/us-central1-a/nodeTypes/standard-72` - class GetNodeTypeRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#show_nsx_credentials VmwareEngine.ShowNsxCredentials} - # @!attribute [rw] private_cloud - # @return [::String] - # Required. The resource name of the private cloud - # to be queried for credentials. - # Resource names are schemeless URIs that follow the conventions in - # https://cloud.google.com/apis/design/resource_names. - # For example: - # `projects/my-project/locations/us-central1-a/privateClouds/my-cloud` - class ShowNsxCredentialsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#show_vcenter_credentials VmwareEngine.ShowVcenterCredentials} - # @!attribute [rw] private_cloud - # @return [::String] - # Required. The resource name of the private cloud - # to be queried for credentials. - # Resource names are schemeless URIs that follow the conventions in - # https://cloud.google.com/apis/design/resource_names. - # For example: - # `projects/my-project/locations/us-central1-a/privateClouds/my-cloud` - # @!attribute [rw] username - # @return [::String] - # Optional. The username of the user to be queried for credentials. - # The default value of this field is CloudOwner@gve.local. - # The provided value must be one of the following: - # CloudOwner@gve.local, - # solution-user-01@gve.local, - # solution-user-02@gve.local, - # solution-user-03@gve.local, - # solution-user-04@gve.local, - # solution-user-05@gve.local, - # zertoadmin@gve.local. - class ShowVcenterCredentialsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#reset_nsx_credentials VmwareEngine.ResetNsxCredentials} - # @!attribute [rw] private_cloud - # @return [::String] - # Required. The resource name of the private cloud - # to reset credentials for. - # Resource names are schemeless URIs that follow the conventions in - # https://cloud.google.com/apis/design/resource_names. - # For example: - # `projects/my-project/locations/us-central1-a/privateClouds/my-cloud` - # @!attribute [rw] request_id - # @return [::String] - # Optional. A request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server guarantees that a - # request doesn't result in creation of duplicate commitments for at least 60 - # minutes. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - class ResetNsxCredentialsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#reset_vcenter_credentials VmwareEngine.ResetVcenterCredentials} - # @!attribute [rw] private_cloud - # @return [::String] - # Required. The resource name of the private cloud - # to reset credentials for. - # Resource names are schemeless URIs that follow the conventions in - # https://cloud.google.com/apis/design/resource_names. - # For example: - # `projects/my-project/locations/us-central1-a/privateClouds/my-cloud` - # @!attribute [rw] request_id - # @return [::String] - # Optional. A request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server guarantees that a - # request doesn't result in creation of duplicate commitments for at least 60 - # minutes. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @!attribute [rw] username - # @return [::String] - # Optional. The username of the user to be to reset the credentials. - # The default value of this field is CloudOwner@gve.local. - # The provided value should be one of the following: - # solution-user-01@gve.local, - # solution-user-02@gve.local, - # solution-user-03@gve.local, - # solution-user-04@gve.local, - # solution-user-05@gve.local, - # zertoadmin@gve.local. - class ResetVcenterCredentialsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for - # {::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#list_hcx_activation_keys VmwareEngine.ListHcxActivationKeys} - # @!attribute [rw] hcx_activation_keys - # @return [::Array<::Google::Cloud::VmwareEngine::V1::HcxActivationKey>] - # List of HCX activation keys. - # @!attribute [rw] next_page_token - # @return [::String] - # A token, which can be sent as `page_token` to retrieve the next page. - # If this field is omitted, there are no subsequent pages. - # @!attribute [rw] unreachable - # @return [::Array<::String>] - # Locations that could not be reached when making an aggregated query using - # wildcards. - class ListHcxActivationKeysResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#list_hcx_activation_keys VmwareEngine.ListHcxActivationKeys} - # @!attribute [rw] parent - # @return [::String] - # Required. The resource name of the private cloud - # to be queried for HCX activation keys. - # Resource names are schemeless URIs that follow the conventions in - # https://cloud.google.com/apis/design/resource_names. - # For example: - # `projects/my-project/locations/us-central1/privateClouds/my-cloud` - # @!attribute [rw] page_size - # @return [::Integer] - # The maximum number of HCX activation keys to return in one page. - # The service may return fewer than this value. - # The maximum value is coerced to 1000. - # The default value of this field is 500. - # @!attribute [rw] page_token - # @return [::String] - # A page token, received from a previous `ListHcxActivationKeys` call. - # Provide this to retrieve the subsequent page. - # - # When paginating, all other parameters provided to - # `ListHcxActivationKeys` must match the call that provided the page - # token. - class ListHcxActivationKeysRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for [VmwareEngine.GetHcxActivationKeys][] - # @!attribute [rw] name - # @return [::String] - # Required. The resource name of the HCX activation key to retrieve. - # Resource names are schemeless URIs that follow the conventions in - # https://cloud.google.com/apis/design/resource_names. - # For example: - # `projects/my-project/locations/us-central1/privateClouds/my-cloud/hcxActivationKeys/my-key` - class GetHcxActivationKeyRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#create_hcx_activation_key VmwareEngine.CreateHcxActivationKey} - # @!attribute [rw] parent - # @return [::String] - # Required. The resource name of the private cloud to create the key for. - # Resource names are schemeless URIs that follow the conventions in - # https://cloud.google.com/apis/design/resource_names. - # For example: - # `projects/my-project/locations/us-central1/privateClouds/my-cloud` - # @!attribute [rw] hcx_activation_key - # @return [::Google::Cloud::VmwareEngine::V1::HcxActivationKey] - # Required. The initial description of a new HCX activation key. When - # creating a new key, this field must be an empty object. - # @!attribute [rw] hcx_activation_key_id - # @return [::String] - # Required. The user-provided identifier of the `HcxActivationKey` to be - # created. This identifier must be unique among `HcxActivationKey` resources - # within the parent and becomes the final token in the name URI. - # The identifier must meet the following requirements: - # - # * Only contains 1-63 alphanumeric characters and hyphens - # * Begins with an alphabetical character - # * Ends with a non-hyphen character - # * Not formatted as a UUID - # * Complies with [RFC 1034](https://datatracker.ietf.org/doc/html/rfc1034) - # (section 3.5) - # @!attribute [rw] request_id - # @return [::String] - # A request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server guarantees that a - # request doesn't result in creation of duplicate commitments for at least 60 - # minutes. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request ID, - # the server can check if original operation with the same request ID was - # received, and if so, will ignore the second request. This prevents clients - # from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - class CreateHcxActivationKeyRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#get_dns_forwarding VmwareEngine.GetDnsForwarding} - # @!attribute [rw] name - # @return [::String] - # Required. The resource name of a `DnsForwarding` to retrieve. - # Resource names are schemeless URIs that follow the conventions in - # https://cloud.google.com/apis/design/resource_names. - # For example: - # `projects/my-project/locations/us-central1-a/privateClouds/my-cloud/dnsForwarding` - class GetDnsForwardingRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#update_dns_forwarding VmwareEngine.UpdateDnsForwarding} - # @!attribute [rw] dns_forwarding - # @return [::Google::Cloud::VmwareEngine::V1::DnsForwarding] - # Required. DnsForwarding config details. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # Required. Field mask is used to specify the fields to be overwritten in the - # `DnsForwarding` resource by the update. - # The fields specified in the `update_mask` are relative to the resource, not - # the full request. A field will be overwritten if it is in the mask. If the - # user does not provide a mask then all fields will be overwritten. - # @!attribute [rw] request_id - # @return [::String] - # Optional. A request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server guarantees that a - # request doesn't result in creation of duplicate commitments for at least 60 - # minutes. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request ID, - # the server can check if original operation with the same request ID was - # received, and if so, will ignore the second request. This prevents clients - # from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - class UpdateDnsForwardingRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#create_network_peering VmwareEngine.CreateNetworkPeering} - # @!attribute [rw] parent - # @return [::String] - # Required. The resource name of the location to create the new network - # peering in. This value is always `global`, because `NetworkPeering` is a - # global resource. Resource names are schemeless URIs that follow the - # conventions in https://cloud.google.com/apis/design/resource_names. For - # example: `projects/my-project/locations/global` - # @!attribute [rw] network_peering_id - # @return [::String] - # Required. The user-provided identifier of the new `NetworkPeering`. - # This identifier must be unique among `NetworkPeering` resources within the - # parent and becomes the final token in the name URI. - # The identifier must meet the following requirements: - # - # * Only contains 1-63 alphanumeric characters and hyphens - # * Begins with an alphabetical character - # * Ends with a non-hyphen character - # * Not formatted as a UUID - # * Complies with [RFC 1034](https://datatracker.ietf.org/doc/html/rfc1034) - # (section 3.5) - # @!attribute [rw] network_peering - # @return [::Google::Cloud::VmwareEngine::V1::NetworkPeering] - # Required. The initial description of the new network peering. - # @!attribute [rw] request_id - # @return [::String] - # Optional. A request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server guarantees that a - # request doesn't result in creation of duplicate commitments for at least 60 - # minutes. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - class CreateNetworkPeeringRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#delete_network_peering VmwareEngine.DeleteNetworkPeering} - # @!attribute [rw] name - # @return [::String] - # Required. The resource name of the network peering to be deleted. - # Resource names are schemeless URIs that follow the conventions in - # https://cloud.google.com/apis/design/resource_names. - # For example: - # `projects/my-project/locations/global/networkPeerings/my-peering` - # @!attribute [rw] request_id - # @return [::String] - # Optional. A request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server guarantees that a - # request doesn't result in creation of duplicate commitments for at least 60 - # minutes. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - class DeleteNetworkPeeringRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#get_network_peering VmwareEngine.GetNetworkPeering} - # @!attribute [rw] name - # @return [::String] - # Required. The resource name of the network peering to retrieve. - # Resource names are schemeless URIs that follow the conventions in - # https://cloud.google.com/apis/design/resource_names. - # For example: - # `projects/my-project/locations/global/networkPeerings/my-peering` - class GetNetworkPeeringRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#list_network_peerings VmwareEngine.ListNetworkPeerings} - # @!attribute [rw] parent - # @return [::String] - # Required. The resource name of the location (global) to query for - # network peerings. Resource names are schemeless URIs that follow the - # conventions in https://cloud.google.com/apis/design/resource_names. For - # example: `projects/my-project/locations/global` - # @!attribute [rw] page_size - # @return [::Integer] - # The maximum number of network peerings to return in one page. - # The maximum value is coerced to 1000. - # The default value of this field is 500. - # @!attribute [rw] page_token - # @return [::String] - # A page token, received from a previous `ListNetworkPeerings` call. - # Provide this to retrieve the subsequent page. - # - # When paginating, all other parameters provided to - # `ListNetworkPeerings` must match the call that provided the page - # token. - # @!attribute [rw] filter - # @return [::String] - # A filter expression that matches resources returned in the response. - # The expression must specify the field name, a comparison - # operator, and the value that you want to use for filtering. The value - # must be a string, a number, or a boolean. The comparison operator - # must be `=`, `!=`, `>`, or `<`. - # - # For example, if you are filtering a list of network peerings, you can - # exclude the ones named `example-peering` by specifying - # `name != "example-peering"`. - # - # To filter on multiple expressions, provide each separate expression within - # parentheses. For example: - # ``` - # (name = "example-peering") - # (createTime > "2021-04-12T08:15:10.40Z") - # ``` - # - # By default, each expression is an `AND` expression. However, you - # can include `AND` and `OR` expressions explicitly. - # For example: - # ``` - # (name = "example-peering-1") AND - # (createTime > "2021-04-12T08:15:10.40Z") OR - # (name = "example-peering-2") - # ``` - # @!attribute [rw] order_by - # @return [::String] - # Sorts list results by a certain order. By default, returned results - # are ordered by `name` in ascending order. - # You can also sort results in descending order based on the `name` value - # using `orderBy="name desc"`. - # Currently, only ordering by `name` is supported. - class ListNetworkPeeringsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#update_network_peering VmwareEngine.UpdateNetworkPeering} - # @!attribute [rw] network_peering - # @return [::Google::Cloud::VmwareEngine::V1::NetworkPeering] - # Required. Network peering description. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # Required. Field mask is used to specify the fields to be overwritten in the - # `NetworkPeering` resource by the update. - # The fields specified in the `update_mask` are relative to the resource, not - # the full request. A field will be overwritten if it is in the mask. If the - # user does not provide a mask then all fields will be overwritten. - # @!attribute [rw] request_id - # @return [::String] - # Optional. A request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server guarantees that a - # request doesn't result in creation of duplicate commitments for at least 60 - # minutes. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - class UpdateNetworkPeeringRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for - # {::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#list_network_peerings VmwareEngine.ListNetworkPeerings} - # @!attribute [rw] network_peerings - # @return [::Array<::Google::Cloud::VmwareEngine::V1::NetworkPeering>] - # A list of network peerings. - # @!attribute [rw] next_page_token - # @return [::String] - # A token, which can be sent as `page_token` to retrieve the next page. - # If this field is omitted, there are no subsequent pages. - # @!attribute [rw] unreachable - # @return [::Array<::String>] - # Unreachable resources. - class ListNetworkPeeringsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#list_peering_routes VmwareEngine.ListPeeringRoutes} - # @!attribute [rw] parent - # @return [::String] - # Required. The resource name of the network peering to retrieve peering - # routes from. Resource names are schemeless URIs that follow the conventions - # in https://cloud.google.com/apis/design/resource_names. For example: - # `projects/my-project/locations/global/networkPeerings/my-peering` - # @!attribute [rw] page_size - # @return [::Integer] - # The maximum number of peering routes to return in one page. - # The service may return fewer than this value. - # The maximum value is coerced to 1000. - # The default value of this field is 500. - # @!attribute [rw] page_token - # @return [::String] - # A page token, received from a previous `ListPeeringRoutes` call. - # Provide this to retrieve the subsequent page. - # When paginating, all other parameters provided to `ListPeeringRoutes` must - # match the call that provided the page token. - # @!attribute [rw] filter - # @return [::String] - # A filter expression that matches resources returned in the response. - # Currently, only filtering on the `direction` field is supported. To return - # routes imported from the peer network, provide "direction=INCOMING". To - # return routes exported from the VMware Engine network, provide - # "direction=OUTGOING". Other filter expressions return an error. - class ListPeeringRoutesRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for - # {::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#list_peering_routes VmwareEngine.ListPeeringRoutes} - # @!attribute [rw] peering_routes - # @return [::Array<::Google::Cloud::VmwareEngine::V1::PeeringRoute>] - # A list of peering routes. - # @!attribute [rw] next_page_token - # @return [::String] - # A token, which can be sent as `page_token` to retrieve the next page. - # If this field is omitted, there are no subsequent pages. - class ListPeeringRoutesResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#list_network_policies VmwareEngine.ListNetworkPolicies} - # @!attribute [rw] parent - # @return [::String] - # Required. The resource name of the location (region) to query for - # network policies. Resource names are schemeless URIs that follow the - # conventions in https://cloud.google.com/apis/design/resource_names. For - # example: `projects/my-project/locations/us-central1` - # @!attribute [rw] page_size - # @return [::Integer] - # The maximum number of network policies to return in one page. - # The service may return fewer than this value. - # The maximum value is coerced to 1000. - # The default value of this field is 500. - # @!attribute [rw] page_token - # @return [::String] - # A page token, received from a previous `ListNetworkPolicies` call. - # Provide this to retrieve the subsequent page. - # - # When paginating, all other parameters provided to - # `ListNetworkPolicies` must match the call that provided the page - # token. - # @!attribute [rw] filter - # @return [::String] - # A filter expression that matches resources returned in the response. - # The expression must specify the field name, a comparison - # operator, and the value that you want to use for filtering. The value - # must be a string, a number, or a boolean. The comparison operator - # must be `=`, `!=`, `>`, or `<`. - # - # For example, if you are filtering a list of network policies, you can - # exclude the ones named `example-policy` by specifying - # `name != "example-policy"`. - # - # To filter on multiple expressions, provide each separate expression within - # parentheses. For example: - # ``` - # (name = "example-policy") - # (createTime > "2021-04-12T08:15:10.40Z") - # ``` - # - # By default, each expression is an `AND` expression. However, you - # can include `AND` and `OR` expressions explicitly. - # For example: - # ``` - # (name = "example-policy-1") AND - # (createTime > "2021-04-12T08:15:10.40Z") OR - # (name = "example-policy-2") - # ``` - # @!attribute [rw] order_by - # @return [::String] - # Sorts list results by a certain order. By default, returned results - # are ordered by `name` in ascending order. - # You can also sort results in descending order based on the `name` value - # using `orderBy="name desc"`. - # Currently, only ordering by `name` is supported. - class ListNetworkPoliciesRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for - # {::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#list_network_policies VmwareEngine.ListNetworkPolicies} - # @!attribute [rw] network_policies - # @return [::Array<::Google::Cloud::VmwareEngine::V1::NetworkPolicy>] - # A list of network policies. - # @!attribute [rw] next_page_token - # @return [::String] - # A token, which can be send as `page_token` to retrieve the next page. - # If this field is omitted, there are no subsequent pages. - # @!attribute [rw] unreachable - # @return [::Array<::String>] - # Locations that could not be reached when making an aggregated query using - # wildcards. - class ListNetworkPoliciesResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#get_network_policy VmwareEngine.GetNetworkPolicy} - # @!attribute [rw] name - # @return [::String] - # Required. The resource name of the network policy to retrieve. - # Resource names are schemeless URIs that follow the conventions in - # https://cloud.google.com/apis/design/resource_names. - # For example: - # `projects/my-project/locations/us-central1/networkPolicies/my-network-policy` - class GetNetworkPolicyRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#update_network_policy VmwareEngine.UpdateNetworkPolicy} - # @!attribute [rw] network_policy - # @return [::Google::Cloud::VmwareEngine::V1::NetworkPolicy] - # Required. Network policy description. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # Required. Field mask is used to specify the fields to be overwritten in the - # `NetworkPolicy` resource by the update. - # The fields specified in the `update_mask` are relative to the resource, not - # the full request. A field will be overwritten if it is in the mask. If the - # user does not provide a mask then all fields will be overwritten. - # @!attribute [rw] request_id - # @return [::String] - # Optional. A request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server guarantees that a - # request doesn't result in creation of duplicate commitments for at least 60 - # minutes. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - class UpdateNetworkPolicyRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#create_network_policy VmwareEngine.CreateNetworkPolicy} - # @!attribute [rw] parent - # @return [::String] - # Required. The resource name of the location (region) - # to create the new network policy in. - # Resource names are schemeless URIs that follow the conventions in - # https://cloud.google.com/apis/design/resource_names. - # For example: - # `projects/my-project/locations/us-central1` - # @!attribute [rw] network_policy_id - # @return [::String] - # Required. The user-provided identifier of the network policy to be created. - # This identifier must be unique within parent - # `projects/{my-project}/locations/{us-central1}/networkPolicies` and becomes - # the final token in the name URI. - # The identifier must meet the following requirements: - # - # * Only contains 1-63 alphanumeric characters and hyphens - # * Begins with an alphabetical character - # * Ends with a non-hyphen character - # * Not formatted as a UUID - # * Complies with [RFC 1034](https://datatracker.ietf.org/doc/html/rfc1034) - # (section 3.5) - # @!attribute [rw] network_policy - # @return [::Google::Cloud::VmwareEngine::V1::NetworkPolicy] - # Required. The network policy configuration to use in the request. - # @!attribute [rw] request_id - # @return [::String] - # Optional. A request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server guarantees that a - # request doesn't result in creation of duplicate commitments for at least 60 - # minutes. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - class CreateNetworkPolicyRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#delete_network_policy VmwareEngine.DeleteNetworkPolicy} - # @!attribute [rw] name - # @return [::String] - # Required. The resource name of the network policy to delete. - # Resource names are schemeless URIs that follow the conventions in - # https://cloud.google.com/apis/design/resource_names. - # For example: - # `projects/my-project/locations/us-central1/networkPolicies/my-network-policy` - # @!attribute [rw] request_id - # @return [::String] - # Optional. A request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server guarantees that a - # request doesn't result in creation of duplicate commitments for at least 60 - # minutes. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - class DeleteNetworkPolicyRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#list_management_dns_zone_bindings VmwareEngine.ListManagementDnsZoneBindings} - # @!attribute [rw] parent - # @return [::String] - # Required. The resource name of the private cloud to be queried for - # management DNS zone bindings. - # Resource names are schemeless URIs that follow the conventions in - # https://cloud.google.com/apis/design/resource_names. - # For example: - # `projects/my-project/locations/us-central1-a/privateClouds/my-cloud` - # @!attribute [rw] page_size - # @return [::Integer] - # The maximum number of management DNS zone bindings to return in one page. - # The service may return fewer than this value. - # The maximum value is coerced to 1000. - # The default value of this field is 500. - # @!attribute [rw] page_token - # @return [::String] - # A page token, received from a previous `ListManagementDnsZoneBindings` - # call. Provide this to retrieve the subsequent page. - # - # When paginating, all other parameters provided to - # `ListManagementDnsZoneBindings` must match the call that provided the page - # token. - # @!attribute [rw] filter - # @return [::String] - # A filter expression that matches resources returned in the response. - # The expression must specify the field name, a comparison - # operator, and the value that you want to use for filtering. The value - # must be a string, a number, or a boolean. The comparison operator - # must be `=`, `!=`, `>`, or `<`. - # - # For example, if you are filtering a list of Management DNS Zone Bindings, - # you can exclude the ones named `example-management-dns-zone-binding` by - # specifying `name != "example-management-dns-zone-binding"`. - # - # To filter on multiple expressions, provide each separate expression within - # parentheses. For example: - # ``` - # (name = "example-management-dns-zone-binding") - # (createTime > "2021-04-12T08:15:10.40Z") - # ``` - # - # By default, each expression is an `AND` expression. However, you - # can include `AND` and `OR` expressions explicitly. - # For example: - # ``` - # (name = "example-management-dns-zone-binding-1") AND - # (createTime > "2021-04-12T08:15:10.40Z") OR - # (name = "example-management-dns-zone-binding-2") - # ``` - # @!attribute [rw] order_by - # @return [::String] - # Sorts list results by a certain order. By default, returned results - # are ordered by `name` in ascending order. - # You can also sort results in descending order based on the `name` value - # using `orderBy="name desc"`. - # Currently, only ordering by `name` is supported. - class ListManagementDnsZoneBindingsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for - # {::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#list_management_dns_zone_bindings VmwareEngine.ListManagementDnsZoneBindings} - # @!attribute [rw] management_dns_zone_bindings - # @return [::Array<::Google::Cloud::VmwareEngine::V1::ManagementDnsZoneBinding>] - # A list of management DNS zone bindings. - # @!attribute [rw] next_page_token - # @return [::String] - # A token, which can be sent as `page_token` to retrieve the next page. - # If this field is omitted, there are no subsequent pages. - # @!attribute [rw] unreachable - # @return [::Array<::String>] - # Locations that could not be reached when making an aggregated query using - # wildcards. - class ListManagementDnsZoneBindingsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#get_management_dns_zone_binding VmwareEngine.GetManagementDnsZoneBinding} - # @!attribute [rw] name - # @return [::String] - # Required. The resource name of the management DNS zone binding to - # retrieve. Resource names are schemeless URIs that follow the conventions in - # https://cloud.google.com/apis/design/resource_names. - # For example: - # `projects/my-project/locations/us-central1-a/privateClouds/my-cloud/managementDnsZoneBindings/my-management-dns-zone-binding` - class GetManagementDnsZoneBindingRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for [VmwareEngine.CreateManagementDnsZoneBindings][] - # @!attribute [rw] parent - # @return [::String] - # Required. The resource name of the private cloud - # to create a new management DNS zone binding for. - # Resource names are schemeless URIs that follow the conventions in - # https://cloud.google.com/apis/design/resource_names. - # For example: - # `projects/my-project/locations/us-central1-a/privateClouds/my-cloud` - # @!attribute [rw] management_dns_zone_binding - # @return [::Google::Cloud::VmwareEngine::V1::ManagementDnsZoneBinding] - # Required. The initial values for a new management DNS zone binding. - # @!attribute [rw] management_dns_zone_binding_id - # @return [::String] - # Required. The user-provided identifier of the `ManagementDnsZoneBinding` - # resource to be created. This identifier must be unique among - # `ManagementDnsZoneBinding` resources within the parent and becomes the - # final token in the name URI. The identifier must meet the following - # requirements: - # - # * Only contains 1-63 alphanumeric characters and hyphens - # * Begins with an alphabetical character - # * Ends with a non-hyphen character - # * Not formatted as a UUID - # * Complies with [RFC 1034](https://datatracker.ietf.org/doc/html/rfc1034) - # (section 3.5) - # @!attribute [rw] request_id - # @return [::String] - # Optional. A request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server guarantees that a - # request doesn't result in creation of duplicate commitments for at least 60 - # minutes. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request ID, - # the server can check if the original operation with the same request ID was - # received, and if so, will ignore the second request. This prevents clients - # from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - class CreateManagementDnsZoneBindingRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#update_management_dns_zone_binding VmwareEngine.UpdateManagementDnsZoneBinding} - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # Required. Field mask is used to specify the fields to be overwritten in the - # `ManagementDnsZoneBinding` resource by the update. - # The fields specified in the `update_mask` are relative to the resource, not - # the full request. A field will be overwritten if it is in the mask. If the - # user does not provide a mask then all fields will be overwritten. - # @!attribute [rw] management_dns_zone_binding - # @return [::Google::Cloud::VmwareEngine::V1::ManagementDnsZoneBinding] - # Required. New values to update the management DNS zone binding with. - # @!attribute [rw] request_id - # @return [::String] - # Optional. A request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server guarantees that a - # request doesn't result in creation of duplicate commitments for at least 60 - # minutes. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request ID, - # the server can check if the original operation with the same request ID was - # received, and if so, will ignore the second request. This prevents clients - # from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - class UpdateManagementDnsZoneBindingRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#delete_management_dns_zone_binding VmwareEngine.DeleteManagementDnsZoneBinding} - # @!attribute [rw] name - # @return [::String] - # Required. The resource name of the management DNS zone binding to delete. - # Resource names are schemeless URIs that follow the conventions in - # https://cloud.google.com/apis/design/resource_names. - # For example: - # `projects/my-project/locations/us-central1-a/privateClouds/my-cloud/managementDnsZoneBindings/my-management-dns-zone-binding` - # @!attribute [rw] request_id - # @return [::String] - # Optional. A request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server guarantees that a - # request doesn't result in creation of duplicate commitments for at least 60 - # minutes. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request - # ID, the server can check if the original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - class DeleteManagementDnsZoneBindingRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for [VmwareEngine.RepairManagementDnsZoneBindings][] - # @!attribute [rw] name - # @return [::String] - # Required. The resource name of the management DNS zone binding to repair. - # Resource names are schemeless URIs that follow the conventions in - # https://cloud.google.com/apis/design/resource_names. - # For example: - # `projects/my-project/locations/us-central1-a/privateClouds/my-cloud/managementDnsZoneBindings/my-management-dns-zone-binding` - # @!attribute [rw] request_id - # @return [::String] - # Optional. A request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server guarantees that a - # request doesn't result in creation of duplicate commitments for at least 60 - # minutes. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request ID, - # the server can check if the original operation with the same request ID was - # received, and if so, will ignore the second request. This prevents clients - # from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - class RepairManagementDnsZoneBindingRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#create_vmware_engine_network VmwareEngine.CreateVmwareEngineNetwork} - # @!attribute [rw] parent - # @return [::String] - # Required. The resource name of the location to create the new VMware Engine - # network in. A VMware Engine network of type - # `LEGACY` is a regional resource, and a VMware - # Engine network of type `STANDARD` is a global resource. - # Resource names are schemeless URIs that follow the conventions in - # https://cloud.google.com/apis/design/resource_names. For example: - # `projects/my-project/locations/global` - # @!attribute [rw] vmware_engine_network_id - # @return [::String] - # Required. The user-provided identifier of the new VMware Engine network. - # This identifier must be unique among VMware Engine network resources - # within the parent and becomes the final token in the name URI. The - # identifier must meet the following requirements: - # - # * For networks of type LEGACY, adheres to the format: - # `{region-id}-default`. Replace `{region-id}` with the region where you want - # to create the VMware Engine network. For example, "us-central1-default". - # * Only contains 1-63 alphanumeric characters and hyphens - # * Begins with an alphabetical character - # * Ends with a non-hyphen character - # * Not formatted as a UUID - # * Complies with [RFC 1034](https://datatracker.ietf.org/doc/html/rfc1034) - # (section 3.5) - # @!attribute [rw] vmware_engine_network - # @return [::Google::Cloud::VmwareEngine::V1::VmwareEngineNetwork] - # Required. The initial description of the new VMware Engine network. - # @!attribute [rw] request_id - # @return [::String] - # Optional. A request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server guarantees that a - # request doesn't result in creation of duplicate commitments for at least 60 - # minutes. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - class CreateVmwareEngineNetworkRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#update_vmware_engine_network VmwareEngine.UpdateVmwareEngineNetwork} - # @!attribute [rw] vmware_engine_network - # @return [::Google::Cloud::VmwareEngine::V1::VmwareEngineNetwork] - # Required. VMware Engine network description. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # Required. Field mask is used to specify the fields to be overwritten in the - # VMware Engine network resource by the update. - # The fields specified in the `update_mask` are relative to the resource, not - # the full request. A field will be overwritten if it is in the mask. If the - # user does not provide a mask then all fields will be overwritten. Only the - # following fields can be updated: `description`. - # @!attribute [rw] request_id - # @return [::String] - # Optional. A request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server guarantees that a - # request doesn't result in creation of duplicate commitments for at least 60 - # minutes. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - class UpdateVmwareEngineNetworkRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#delete_vmware_engine_network VmwareEngine.DeleteVmwareEngineNetwork} - # @!attribute [rw] name - # @return [::String] - # Required. The resource name of the VMware Engine network to be deleted. - # Resource names are schemeless URIs that follow the conventions in - # https://cloud.google.com/apis/design/resource_names. - # For example: - # `projects/my-project/locations/global/vmwareEngineNetworks/my-network` - # @!attribute [rw] request_id - # @return [::String] - # Optional. A request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server guarantees that a - # request doesn't result in creation of duplicate commitments for at least 60 - # minutes. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - # @!attribute [rw] etag - # @return [::String] - # Optional. Checksum used to ensure that the user-provided value is up to - # date before the server processes the request. The server compares provided - # checksum with the current checksum of the resource. If the user-provided - # value is out of date, this request returns an `ABORTED` error. - class DeleteVmwareEngineNetworkRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#get_vmware_engine_network VmwareEngine.GetVmwareEngineNetwork} - # @!attribute [rw] name - # @return [::String] - # Required. The resource name of the VMware Engine network to retrieve. - # Resource names are schemeless URIs that follow the conventions in - # https://cloud.google.com/apis/design/resource_names. - # For example: - # `projects/my-project/locations/global/vmwareEngineNetworks/my-network` - class GetVmwareEngineNetworkRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#list_vmware_engine_networks VmwareEngine.ListVmwareEngineNetworks} - # @!attribute [rw] parent - # @return [::String] - # Required. The resource name of the location to query for - # VMware Engine networks. Resource names are schemeless URIs that follow the - # conventions in https://cloud.google.com/apis/design/resource_names. For - # example: `projects/my-project/locations/global` - # @!attribute [rw] page_size - # @return [::Integer] - # The maximum number of results to return in one page. - # The maximum value is coerced to 1000. - # The default value of this field is 500. - # @!attribute [rw] page_token - # @return [::String] - # A page token, received from a previous `ListVmwareEngineNetworks` call. - # Provide this to retrieve the subsequent page. - # - # When paginating, all other parameters provided to - # `ListVmwareEngineNetworks` must match the call that provided the page - # token. - # @!attribute [rw] filter - # @return [::String] - # A filter expression that matches resources returned in the response. - # The expression must specify the field name, a comparison - # operator, and the value that you want to use for filtering. The value - # must be a string, a number, or a boolean. The comparison operator - # must be `=`, `!=`, `>`, or `<`. - # - # For example, if you are filtering a list of network peerings, you can - # exclude the ones named `example-network` by specifying - # `name != "example-network"`. - # - # To filter on multiple expressions, provide each separate expression within - # parentheses. For example: - # ``` - # (name = "example-network") - # (createTime > "2021-04-12T08:15:10.40Z") - # ``` - # - # By default, each expression is an `AND` expression. However, you - # can include `AND` and `OR` expressions explicitly. - # For example: - # ``` - # (name = "example-network-1") AND - # (createTime > "2021-04-12T08:15:10.40Z") OR - # (name = "example-network-2") - # ``` - # @!attribute [rw] order_by - # @return [::String] - # Sorts list results by a certain order. By default, returned results - # are ordered by `name` in ascending order. - # You can also sort results in descending order based on the `name` value - # using `orderBy="name desc"`. - # Currently, only ordering by `name` is supported. - class ListVmwareEngineNetworksRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for - # {::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#list_vmware_engine_networks VmwareEngine.ListVmwareEngineNetworks} - # @!attribute [rw] vmware_engine_networks - # @return [::Array<::Google::Cloud::VmwareEngine::V1::VmwareEngineNetwork>] - # A list of VMware Engine networks. - # @!attribute [rw] next_page_token - # @return [::String] - # A token, which can be sent as `page_token` to retrieve the next page. - # If this field is omitted, there are no subsequent pages. - # @!attribute [rw] unreachable - # @return [::Array<::String>] - # Unreachable resources. - class ListVmwareEngineNetworksResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#create_private_connection VmwareEngine.CreatePrivateConnection} - # @!attribute [rw] parent - # @return [::String] - # Required. The resource name of the location to create the new private - # connection in. Private connection is a regional resource. - # Resource names are schemeless URIs that follow the conventions in - # https://cloud.google.com/apis/design/resource_names. For example: - # `projects/my-project/locations/us-central1` - # @!attribute [rw] private_connection_id - # @return [::String] - # Required. The user-provided identifier of the new private connection. - # This identifier must be unique among private connection resources - # within the parent and becomes the final token in the name URI. The - # identifier must meet the following requirements: - # - # * Only contains 1-63 alphanumeric characters and hyphens - # * Begins with an alphabetical character - # * Ends with a non-hyphen character - # * Not formatted as a UUID - # * Complies with [RFC 1034](https://datatracker.ietf.org/doc/html/rfc1034) - # (section 3.5) - # @!attribute [rw] private_connection - # @return [::Google::Cloud::VmwareEngine::V1::PrivateConnection] - # Required. The initial description of the new private connection. - # @!attribute [rw] request_id - # @return [::String] - # Optional. A request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server guarantees that a - # request doesn't result in creation of duplicate commitments for at least 60 - # minutes. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - class CreatePrivateConnectionRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#get_private_connection VmwareEngine.GetPrivateConnection} - # @!attribute [rw] name - # @return [::String] - # Required. The resource name of the private connection to retrieve. - # Resource names are schemeless URIs that follow the conventions in - # https://cloud.google.com/apis/design/resource_names. - # For example: - # `projects/my-project/locations/us-central1/privateConnections/my-connection` - class GetPrivateConnectionRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#list_private_connections VmwareEngine.ListPrivateConnections} - # @!attribute [rw] parent - # @return [::String] - # Required. The resource name of the location to query for - # private connections. Resource names are schemeless URIs that follow the - # conventions in https://cloud.google.com/apis/design/resource_names. For - # example: `projects/my-project/locations/us-central1` - # @!attribute [rw] page_size - # @return [::Integer] - # The maximum number of private connections to return in one page. - # The maximum value is coerced to 1000. - # The default value of this field is 500. - # @!attribute [rw] page_token - # @return [::String] - # A page token, received from a previous `ListPrivateConnections` call. - # Provide this to retrieve the subsequent page. - # - # When paginating, all other parameters provided to - # `ListPrivateConnections` must match the call that provided the page - # token. - # @!attribute [rw] filter - # @return [::String] - # A filter expression that matches resources returned in the response. - # The expression must specify the field name, a comparison - # operator, and the value that you want to use for filtering. The value - # must be a string, a number, or a boolean. The comparison operator - # must be `=`, `!=`, `>`, or `<`. - # - # For example, if you are filtering a list of private connections, you can - # exclude the ones named `example-connection` by specifying - # `name != "example-connection"`. - # - # To filter on multiple expressions, provide each separate expression within - # parentheses. For example: - # ``` - # (name = "example-connection") - # (createTime > "2022-09-22T08:15:10.40Z") - # ``` - # - # By default, each expression is an `AND` expression. However, you - # can include `AND` and `OR` expressions explicitly. - # For example: - # ``` - # (name = "example-connection-1") AND - # (createTime > "2021-04-12T08:15:10.40Z") OR - # (name = "example-connection-2") - # ``` - # @!attribute [rw] order_by - # @return [::String] - # Sorts list results by a certain order. By default, returned results - # are ordered by `name` in ascending order. - # You can also sort results in descending order based on the `name` value - # using `orderBy="name desc"`. - # Currently, only ordering by `name` is supported. - class ListPrivateConnectionsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for - # {::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#list_private_connections VmwareEngine.ListPrivateConnections} - # @!attribute [rw] private_connections - # @return [::Array<::Google::Cloud::VmwareEngine::V1::PrivateConnection>] - # A list of private connections. - # @!attribute [rw] next_page_token - # @return [::String] - # A token, which can be sent as `page_token` to retrieve the next page. - # If this field is omitted, there are no subsequent pages. - # @!attribute [rw] unreachable - # @return [::Array<::String>] - # Unreachable resources. - class ListPrivateConnectionsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#update_private_connection VmwareEngine.UpdatePrivateConnection} - # @!attribute [rw] private_connection - # @return [::Google::Cloud::VmwareEngine::V1::PrivateConnection] - # Required. Private connection description. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # Required. Field mask is used to specify the fields to be overwritten in the - # `PrivateConnection` resource by the update. - # The fields specified in the `update_mask` are relative to the resource, not - # the full request. A field will be overwritten if it is in the mask. If the - # user does not provide a mask then all fields will be overwritten. - # @!attribute [rw] request_id - # @return [::String] - # Optional. A request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server guarantees that a - # request doesn't result in creation of duplicate commitments for at least 60 - # minutes. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - class UpdatePrivateConnectionRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#delete_private_connection VmwareEngine.DeletePrivateConnection} - # @!attribute [rw] name - # @return [::String] - # Required. The resource name of the private connection to be deleted. - # Resource names are schemeless URIs that follow the conventions in - # https://cloud.google.com/apis/design/resource_names. - # For example: - # `projects/my-project/locations/us-central1/privateConnections/my-connection` - # @!attribute [rw] request_id - # @return [::String] - # Optional. A request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server guarantees that a - # request doesn't result in creation of duplicate commitments for at least 60 - # minutes. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - class DeletePrivateConnectionRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#list_private_connection_peering_routes VmwareEngine.ListPrivateConnectionPeeringRoutes} - # @!attribute [rw] parent - # @return [::String] - # Required. The resource name of the private connection to retrieve peering - # routes from. Resource names are schemeless URIs that follow the conventions - # in https://cloud.google.com/apis/design/resource_names. For example: - # `projects/my-project/locations/us-west1/privateConnections/my-connection` - # @!attribute [rw] page_size - # @return [::Integer] - # The maximum number of peering routes to return in one page. - # The service may return fewer than this value. - # The maximum value is coerced to 1000. - # The default value of this field is 500. - # @!attribute [rw] page_token - # @return [::String] - # A page token, received from a previous `ListPrivateConnectionPeeringRoutes` - # call. Provide this to retrieve the subsequent page. When paginating, all - # other parameters provided to `ListPrivateConnectionPeeringRoutes` must - # match the call that provided the page token. - class ListPrivateConnectionPeeringRoutesRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for - # {::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#list_private_connection_peering_routes VmwareEngine.ListPrivateConnectionPeeringRoutes} - # @!attribute [rw] peering_routes - # @return [::Array<::Google::Cloud::VmwareEngine::V1::PeeringRoute>] - # A list of peering routes. - # @!attribute [rw] next_page_token - # @return [::String] - # A token, which can be sent as `page_token` to retrieve the next page. - # If this field is omitted, there are no subsequent pages. - class ListPrivateConnectionPeeringRoutesResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#grant_dns_bind_permission VmwareEngine.GrantDnsBindPermission} - # @!attribute [rw] name - # @return [::String] - # Required. The name of the resource which stores the users/service accounts - # having the permission to bind to the corresponding intranet VPC of the - # consumer project. DnsBindPermission is a global resource. Resource names - # are schemeless URIs that follow the conventions in - # https://cloud.google.com/apis/design/resource_names. For example: - # `projects/my-project/locations/global/dnsBindPermission` - # @!attribute [rw] principal - # @return [::Google::Cloud::VmwareEngine::V1::Principal] - # Required. The consumer provided user/service account which needs to be - # granted permission to bind with the intranet VPC corresponding to the - # consumer project. - # @!attribute [rw] request_id - # @return [::String] - # Optional. A request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server guarantees that a - # request doesn't result in creation of duplicate commitments for at least 60 - # minutes. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - class GrantDnsBindPermissionRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#revoke_dns_bind_permission VmwareEngine.RevokeDnsBindPermission} - # @!attribute [rw] name - # @return [::String] - # Required. The name of the resource which stores the users/service accounts - # having the permission to bind to the corresponding intranet VPC of the - # consumer project. DnsBindPermission is a global resource. Resource names - # are schemeless URIs that follow the conventions in - # https://cloud.google.com/apis/design/resource_names. For example: - # `projects/my-project/locations/global/dnsBindPermission` - # @!attribute [rw] principal - # @return [::Google::Cloud::VmwareEngine::V1::Principal] - # Required. The consumer provided user/service account which needs to be - # granted permission to bind with the intranet VPC corresponding to the - # consumer project. - # @!attribute [rw] request_id - # @return [::String] - # Optional. A request ID to identify requests. Specify a unique request ID - # so that if you must retry your request, the server will know to ignore - # the request if it has already been completed. The server guarantees that a - # request doesn't result in creation of duplicate commitments for at least 60 - # minutes. - # - # For example, consider a situation where you make an initial request and the - # request times out. If you make the request again with the same request - # ID, the server can check if original operation with the same request ID - # was received, and if so, will ignore the second request. This prevents - # clients from accidentally creating duplicate commitments. - # - # The request ID must be a valid UUID with the exception that zero UUID is - # not supported (00000000-0000-0000-0000-000000000000). - class RevokeDnsBindPermissionRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for - # {::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#get_dns_bind_permission VmwareEngine.GetDnsBindPermission} - # @!attribute [rw] name - # @return [::String] - # Required. The name of the resource which stores the users/service accounts - # having the permission to bind to the corresponding intranet VPC of the - # consumer project. DnsBindPermission is a global resource. Resource names - # are schemeless URIs that follow the conventions in - # https://cloud.google.com/apis/design/resource_names. For example: - # `projects/my-project/locations/global/dnsBindPermission` - class GetDnsBindPermissionRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-vmware_engine-v1/proto_docs/google/cloud/vmwareengine/v1/vmwareengine_resources.rb b/owl-bot-staging/google-cloud-vmware_engine-v1/proto_docs/google/cloud/vmwareengine/v1/vmwareengine_resources.rb deleted file mode 100644 index a9c4dd2b03ab..000000000000 --- a/owl-bot-staging/google-cloud-vmware_engine-v1/proto_docs/google/cloud/vmwareengine/v1/vmwareengine_resources.rb +++ /dev/null @@ -1,1690 +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 VmwareEngine - module V1 - # Network configuration in the consumer project - # with which the peering has to be done. - # @!attribute [rw] management_cidr - # @return [::String] - # Required. Management CIDR used by VMware management appliances. - # @!attribute [rw] vmware_engine_network - # @return [::String] - # Optional. The relative resource name of the VMware Engine network attached - # to the private cloud. Specify the name in the following form: - # `projects/{project}/locations/{location}/vmwareEngineNetworks/{vmware_engine_network_id}` - # where `{project}` can either be a project number or a project ID. - # @!attribute [r] vmware_engine_network_canonical - # @return [::String] - # Output only. The canonical name of the VMware Engine network in the form: - # `projects/{project_number}/locations/{location}/vmwareEngineNetworks/{vmware_engine_network_id}` - # @!attribute [r] management_ip_address_layout_version - # @return [::Integer] - # Output only. The IP address layout version of the management IP address - # range. Possible versions include: - # * `managementIpAddressLayoutVersion=1`: Indicates the legacy IP address - # layout used by some existing private clouds. This is no longer supported - # for new private clouds as it does not support all features. - # * `managementIpAddressLayoutVersion=2`: Indicates the latest IP address - # layout used by all newly created private clouds. This version supports all - # current features. - # @!attribute [r] dns_server_ip - # @return [::String] - # Output only. DNS Server IP of the Private Cloud. - # All DNS queries can be forwarded to this address for name resolution of - # Private Cloud's management entities like vCenter, NSX-T Manager and - # ESXi hosts. - class NetworkConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Information about the type and number of nodes associated with the cluster. - # @!attribute [rw] node_count - # @return [::Integer] - # Required. The number of nodes of this type in the cluster - # @!attribute [rw] custom_core_count - # @return [::Integer] - # Optional. Customized number of cores available to each node of the type. - # This number must always be one of `nodeType.availableCustomCoreCounts`. - # If zero is provided max value from `nodeType.availableCustomCoreCounts` - # will be used. - class NodeTypeConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Configuration of a stretched cluster. - # @!attribute [rw] preferred_location - # @return [::String] - # Required. Zone that will remain operational when connection between the two - # zones is lost. Specify the resource name of a zone that belongs to the - # region of the private cloud. For example: - # `projects/{project}/locations/europe-west3-a` where `{project}` can either - # be a project number or a project ID. - # @!attribute [rw] secondary_location - # @return [::String] - # Required. Additional zone for a higher level of availability and load - # balancing. Specify the resource name of a zone that belongs to the region - # of the private cloud. For example: - # `projects/{project}/locations/europe-west3-b` where `{project}` can either - # be a project number or a project ID. - class StretchedClusterConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Represents a private cloud resource. Private clouds of type `STANDARD` and - # `TIME_LIMITED` are zonal resources, `STRETCHED` private clouds are - # regional. - # @!attribute [r] name - # @return [::String] - # Output only. The resource name of this private cloud. - # Resource names are schemeless URIs that follow the conventions in - # https://cloud.google.com/apis/design/resource_names. - # For example: - # `projects/my-project/locations/us-central1-a/privateClouds/my-cloud` - # @!attribute [r] create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. Creation time of this resource. - # @!attribute [r] update_time - # @return [::Google::Protobuf::Timestamp] - # Output only. Last update time of this resource. - # @!attribute [r] delete_time - # @return [::Google::Protobuf::Timestamp] - # Output only. Time when the resource was scheduled for deletion. - # @!attribute [r] expire_time - # @return [::Google::Protobuf::Timestamp] - # Output only. Time when the resource will be irreversibly deleted. - # @!attribute [r] state - # @return [::Google::Cloud::VmwareEngine::V1::PrivateCloud::State] - # Output only. State of the resource. New values may be added to this enum - # when appropriate. - # @!attribute [rw] network_config - # @return [::Google::Cloud::VmwareEngine::V1::NetworkConfig] - # Required. Network configuration of the private cloud. - # @!attribute [rw] management_cluster - # @return [::Google::Cloud::VmwareEngine::V1::PrivateCloud::ManagementCluster] - # Required. Input only. The management cluster for this private cloud. - # This field is required during creation of the private cloud to provide - # details for the default cluster. - # - # The following fields can't be changed after private cloud creation: - # `ManagementCluster.clusterId`, `ManagementCluster.nodeTypeId`. - # @!attribute [rw] description - # @return [::String] - # User-provided description for this private cloud. - # @!attribute [r] hcx - # @return [::Google::Cloud::VmwareEngine::V1::Hcx] - # Output only. HCX appliance. - # @!attribute [r] nsx - # @return [::Google::Cloud::VmwareEngine::V1::Nsx] - # Output only. NSX appliance. - # @!attribute [r] vcenter - # @return [::Google::Cloud::VmwareEngine::V1::Vcenter] - # Output only. Vcenter appliance. - # @!attribute [r] uid - # @return [::String] - # Output only. System-generated unique identifier for the resource. - # @!attribute [rw] type - # @return [::Google::Cloud::VmwareEngine::V1::PrivateCloud::Type] - # Optional. Type of the private cloud. Defaults to STANDARD. - class PrivateCloud - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Management cluster configuration. - # @!attribute [rw] cluster_id - # @return [::String] - # Required. The user-provided identifier of the new `Cluster`. - # The identifier must meet the following requirements: - # - # * Only contains 1-63 alphanumeric characters and hyphens - # * Begins with an alphabetical character - # * Ends with a non-hyphen character - # * Not formatted as a UUID - # * Complies with [RFC - # 1034](https://datatracker.ietf.org/doc/html/rfc1034) (section 3.5) - # @!attribute [rw] node_type_configs - # @return [::Google::Protobuf::Map{::String => ::Google::Cloud::VmwareEngine::V1::NodeTypeConfig}] - # Required. The map of cluster node types in this cluster, where the key is - # canonical identifier of the node type (corresponds to the `NodeType`). - # @!attribute [rw] stretched_cluster_config - # @return [::Google::Cloud::VmwareEngine::V1::StretchedClusterConfig] - # Optional. Configuration of a stretched cluster. Required for STRETCHED - # private clouds. - class ManagementCluster - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::Google::Cloud::VmwareEngine::V1::NodeTypeConfig] - class NodeTypeConfigsEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Enum State defines possible states of private clouds. - module State - # The default value. This value should never be used. - STATE_UNSPECIFIED = 0 - - # The private cloud is ready. - ACTIVE = 1 - - # The private cloud is being created. - CREATING = 2 - - # The private cloud is being updated. - UPDATING = 3 - - # The private cloud is in failed state. - FAILED = 5 - - # The private cloud is scheduled for deletion. The deletion process can be - # cancelled by using the corresponding undelete method. - DELETED = 6 - - # The private cloud is irreversibly deleted and is being removed from the - # system. - PURGING = 7 - end - - # Enum Type defines private cloud type. - module Type - # Standard private is a zonal resource, with 3+ nodes. Default type. - STANDARD = 0 - - # Time limited private cloud is a zonal resource, can have only 1 node and - # has limited life span. Will be deleted after defined period of time, - # can be converted into standard private cloud by expanding it up to 3 - # or more nodes. - TIME_LIMITED = 1 - - # Stretched private cloud is a regional resource with redundancy, - # with a minimum of 6 nodes, nodes count has to be even. - STRETCHED = 2 - end - end - - # A cluster in a private cloud. - # @!attribute [r] name - # @return [::String] - # Output only. The resource name of this cluster. - # Resource names are schemeless URIs that follow the conventions in - # https://cloud.google.com/apis/design/resource_names. - # For example: - # `projects/my-project/locations/us-central1-a/privateClouds/my-cloud/clusters/my-cluster` - # @!attribute [r] create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. Creation time of this resource. - # @!attribute [r] update_time - # @return [::Google::Protobuf::Timestamp] - # Output only. Last update time of this resource. - # @!attribute [r] state - # @return [::Google::Cloud::VmwareEngine::V1::Cluster::State] - # Output only. State of the resource. - # @!attribute [r] management - # @return [::Boolean] - # Output only. True if the cluster is a management cluster; false otherwise. - # There can only be one management cluster in a private cloud - # and it has to be the first one. - # @!attribute [rw] autoscaling_settings - # @return [::Google::Cloud::VmwareEngine::V1::AutoscalingSettings] - # Optional. Configuration of the autoscaling applied to this cluster. - # @!attribute [r] uid - # @return [::String] - # Output only. System-generated unique identifier for the resource. - # @!attribute [rw] node_type_configs - # @return [::Google::Protobuf::Map{::String => ::Google::Cloud::VmwareEngine::V1::NodeTypeConfig}] - # Required. The map of cluster node types in this cluster, where the key is - # canonical identifier of the node type (corresponds to the `NodeType`). - # @!attribute [rw] stretched_cluster_config - # @return [::Google::Cloud::VmwareEngine::V1::StretchedClusterConfig] - # Optional. Configuration of a stretched cluster. Required for clusters that - # belong to a STRETCHED private cloud. - class Cluster - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::Google::Cloud::VmwareEngine::V1::NodeTypeConfig] - class NodeTypeConfigsEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Enum State defines possible states of private cloud clusters. - module State - # The default value. This value should never be used. - STATE_UNSPECIFIED = 0 - - # The Cluster is operational and can be used by the user. - ACTIVE = 1 - - # The Cluster is being deployed. - CREATING = 2 - - # Adding or removing of a node to the cluster, any other cluster specific - # updates. - UPDATING = 3 - - # The Cluster is being deleted. - DELETING = 4 - - # The Cluster is undergoing maintenance, for example: a failed node is - # getting replaced. - REPAIRING = 5 - end - end - - # Node in a cluster. - # @!attribute [r] name - # @return [::String] - # Output only. The resource name of this node. - # Resource names are schemeless URIs that follow the conventions in - # https://cloud.google.com/apis/design/resource_names. - # For example: - # projects/my-project/locations/us-central1-a/privateClouds/my-cloud/clusters/my-cluster/nodes/my-node - # @!attribute [r] fqdn - # @return [::String] - # Output only. Fully qualified domain name of the node. - # @!attribute [r] internal_ip - # @return [::String] - # Output only. Internal IP address of the node. - # @!attribute [r] node_type_id - # @return [::String] - # Output only. The canonical identifier of the node type (corresponds to the - # `NodeType`). - # For example: standard-72. - # @!attribute [r] version - # @return [::String] - # Output only. The version number of the VMware ESXi - # management component in this cluster. - # @!attribute [r] custom_core_count - # @return [::Integer] - # Output only. Customized number of cores - # @!attribute [r] state - # @return [::Google::Cloud::VmwareEngine::V1::Node::State] - # Output only. The state of the appliance. - class Node - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Enum State defines possible states of a node in a cluster. - module State - # The default value. This value should never be used. - STATE_UNSPECIFIED = 0 - - # Node is operational and can be used by the user. - ACTIVE = 1 - - # Node is being provisioned. - CREATING = 2 - - # Node is in a failed state. - FAILED = 3 - - # Node is undergoing maintenance, e.g.: during private cloud upgrade. - UPGRADING = 4 - end - end - - # Represents an allocated external IP address and its corresponding internal IP - # address in a private cloud. - # @!attribute [r] name - # @return [::String] - # Output only. The resource name of this external IP address. - # Resource names are schemeless URIs that follow the conventions in - # https://cloud.google.com/apis/design/resource_names. - # For example: - # `projects/my-project/locations/us-central1-a/privateClouds/my-cloud/externalAddresses/my-address` - # @!attribute [r] create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. Creation time of this resource. - # @!attribute [r] update_time - # @return [::Google::Protobuf::Timestamp] - # Output only. Last update time of this resource. - # @!attribute [rw] internal_ip - # @return [::String] - # The internal IP address of a workload VM. - # @!attribute [r] external_ip - # @return [::String] - # Output only. The external IP address of a workload VM. - # @!attribute [r] state - # @return [::Google::Cloud::VmwareEngine::V1::ExternalAddress::State] - # Output only. The state of the resource. - # @!attribute [r] uid - # @return [::String] - # Output only. System-generated unique identifier for the resource. - # @!attribute [rw] description - # @return [::String] - # User-provided description for this resource. - class ExternalAddress - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Enum State defines possible states of external addresses. - module State - # The default value. This value should never be used. - STATE_UNSPECIFIED = 0 - - # The address is ready. - ACTIVE = 1 - - # The address is being created. - CREATING = 2 - - # The address is being updated. - UPDATING = 3 - - # The address is being deleted. - DELETING = 4 - end - end - - # Subnet in a private cloud. Either `management` subnets (such as vMotion) that - # are read-only, or `userDefined`, which can also be updated. - # @!attribute [r] name - # @return [::String] - # Output only. The resource name of this subnet. - # Resource names are schemeless URIs that follow the conventions in - # https://cloud.google.com/apis/design/resource_names. - # For example: - # `projects/my-project/locations/us-central1-a/privateClouds/my-cloud/subnets/my-subnet` - # @!attribute [rw] ip_cidr_range - # @return [::String] - # The IP address range of the subnet in CIDR format '10.0.0.0/24'. - # @!attribute [rw] gateway_ip - # @return [::String] - # The IP address of the gateway of this subnet. - # Must fall within the IP prefix defined above. - # @!attribute [r] type - # @return [::String] - # Output only. The type of the subnet. For example "management" or - # "userDefined". - # @!attribute [r] state - # @return [::Google::Cloud::VmwareEngine::V1::Subnet::State] - # Output only. The state of the resource. - # @!attribute [r] vlan_id - # @return [::Integer] - # Output only. VLAN ID of the VLAN on which the subnet is configured - class Subnet - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Defines possible states of subnets. - module State - # The default value. This value should never be used. - STATE_UNSPECIFIED = 0 - - # The subnet is ready. - ACTIVE = 1 - - # The subnet is being created. - CREATING = 2 - - # The subnet is being updated. - UPDATING = 3 - - # The subnet is being deleted. - DELETING = 4 - - # Changes requested in the last operation are being propagated. - RECONCILING = 5 - - # Last operation on the subnet did not succeed. Subnet's payload is - # reverted back to its most recent working state. - FAILED = 6 - end - end - - # External access firewall rules for filtering incoming traffic destined to - # `ExternalAddress` resources. - # @!attribute [r] name - # @return [::String] - # Output only. The resource name of this external access rule. - # Resource names are schemeless URIs that follow the conventions in - # https://cloud.google.com/apis/design/resource_names. - # For example: - # `projects/my-project/locations/us-central1/networkPolicies/my-policy/externalAccessRules/my-rule` - # @!attribute [r] create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. Creation time of this resource. - # @!attribute [r] update_time - # @return [::Google::Protobuf::Timestamp] - # Output only. Last update time of this resource. - # @!attribute [rw] description - # @return [::String] - # User-provided description for this external access rule. - # @!attribute [rw] priority - # @return [::Integer] - # External access rule priority, which determines the external access rule to - # use when multiple rules apply. If multiple rules have the same priority, - # their ordering is non-deterministic. If specific ordering is required, - # assign unique priorities to enforce such ordering. The external access rule - # priority is an integer from 100 to 4096, both inclusive. Lower integers - # indicate higher precedence. For example, a rule with priority `100` has - # higher precedence than a rule with priority `101`. - # @!attribute [rw] action - # @return [::Google::Cloud::VmwareEngine::V1::ExternalAccessRule::Action] - # The action that the external access rule performs. - # @!attribute [rw] ip_protocol - # @return [::String] - # The IP protocol to which the external access rule applies. This value can - # be one of the following three protocol strings (not case-sensitive): - # `tcp`, `udp`, or `icmp`. - # @!attribute [rw] source_ip_ranges - # @return [::Array<::Google::Cloud::VmwareEngine::V1::ExternalAccessRule::IpRange>] - # If source ranges are specified, the external access rule applies only to - # traffic that has a source IP address in these ranges. These ranges can - # either be expressed in the CIDR format or as an IP address. As only inbound - # rules are supported, `ExternalAddress` resources cannot be the source IP - # addresses of an external access rule. To match all source addresses, - # specify `0.0.0.0/0`. - # @!attribute [rw] source_ports - # @return [::Array<::String>] - # A list of source ports to which the external access rule applies. This - # field is only applicable for the UDP or TCP protocol. - # Each entry must be either an integer or a range. For example: `["22"]`, - # `["80","443"]`, or `["12345-12349"]`. To match all source ports, specify - # `["0-65535"]`. - # @!attribute [rw] destination_ip_ranges - # @return [::Array<::Google::Cloud::VmwareEngine::V1::ExternalAccessRule::IpRange>] - # If destination ranges are specified, the external access rule applies only - # to the traffic that has a destination IP address in these ranges. The - # specified IP addresses must have reserved external IP addresses in the - # scope of the parent network policy. To match all external IP addresses in - # the scope of the parent network policy, specify `0.0.0.0/0`. To match a - # specific external IP address, specify it using the - # `IpRange.external_address` property. - # @!attribute [rw] destination_ports - # @return [::Array<::String>] - # A list of destination ports to which the external access rule applies. This - # field is only applicable for the UDP or TCP protocol. - # Each entry must be either an integer or a range. For example: `["22"]`, - # `["80","443"]`, or `["12345-12349"]`. To match all destination ports, - # specify `["0-65535"]`. - # @!attribute [r] state - # @return [::Google::Cloud::VmwareEngine::V1::ExternalAccessRule::State] - # Output only. The state of the resource. - # @!attribute [r] uid - # @return [::String] - # Output only. System-generated unique identifier for the resource. - class ExternalAccessRule - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # An IP range provided in any one of the supported formats. - # @!attribute [rw] ip_address - # @return [::String] - # A single IP address. For example: `10.0.0.5`. - # - # Note: The following fields are mutually exclusive: `ip_address`, `ip_address_range`, `external_address`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] ip_address_range - # @return [::String] - # An IP address range in the CIDR format. For example: `10.0.0.0/24`. - # - # Note: The following fields are mutually exclusive: `ip_address_range`, `ip_address`, `external_address`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] external_address - # @return [::String] - # The name of an `ExternalAddress` resource. The external address must - # have been reserved in the scope of this external access rule's parent - # network policy. Provide the external address name in the form of - # `projects/{project}/locations/{location}/privateClouds/{private_cloud}/externalAddresses/{external_address}`. - # For example: - # `projects/my-project/locations/us-central1-a/privateClouds/my-cloud/externalAddresses/my-address`. - # - # Note: The following fields are mutually exclusive: `external_address`, `ip_address`, `ip_address_range`. If a field in that set is populated, all other fields in the set will automatically be cleared. - class IpRange - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Action determines whether the external access rule permits or blocks - # traffic, subject to the other components of the rule matching the traffic. - module Action - # Defaults to allow. - ACTION_UNSPECIFIED = 0 - - # Allows connections that match the other specified components. - ALLOW = 1 - - # Blocks connections that match the other specified components. - DENY = 2 - end - - # Defines possible states of external access firewall rules. - module State - # The default value. This value is used if the state is omitted. - STATE_UNSPECIFIED = 0 - - # The rule is ready. - ACTIVE = 1 - - # The rule is being created. - CREATING = 2 - - # The rule is being updated. - UPDATING = 3 - - # The rule is being deleted. - DELETING = 4 - end - end - - # Logging server to receive vCenter or ESXi logs. - # @!attribute [r] name - # @return [::String] - # Output only. The resource name of this logging server. - # Resource names are schemeless URIs that follow the conventions in - # https://cloud.google.com/apis/design/resource_names. - # For example: - # `projects/my-project/locations/us-central1-a/privateClouds/my-cloud/loggingServers/my-logging-server` - # @!attribute [r] create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. Creation time of this resource. - # @!attribute [r] update_time - # @return [::Google::Protobuf::Timestamp] - # Output only. Last update time of this resource. - # @!attribute [rw] hostname - # @return [::String] - # Required. Fully-qualified domain name (FQDN) or IP Address of the logging - # server. - # @!attribute [rw] port - # @return [::Integer] - # Required. Port number at which the logging server receives logs. - # @!attribute [rw] protocol - # @return [::Google::Cloud::VmwareEngine::V1::LoggingServer::Protocol] - # Required. Protocol used by vCenter to send logs to a logging server. - # @!attribute [rw] source_type - # @return [::Google::Cloud::VmwareEngine::V1::LoggingServer::SourceType] - # Required. The type of component that produces logs that will be forwarded - # to this logging server. - # @!attribute [r] uid - # @return [::String] - # Output only. System-generated unique identifier for the resource. - class LoggingServer - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Defines possible protocols used to send logs to - # a logging server. - module Protocol - # Unspecified communications protocol. This is the default value. - PROTOCOL_UNSPECIFIED = 0 - - # UDP - UDP = 1 - - # TCP - TCP = 2 - - # TLS - TLS = 3 - - # SSL - SSL = 4 - - # RELP - RELP = 5 - end - - # Defines possible types of component that produces logs. - module SourceType - # The default value. This value should never be used. - SOURCE_TYPE_UNSPECIFIED = 0 - - # Logs produced by ESXI hosts - ESXI = 1 - - # Logs produced by vCenter server - VCSA = 2 - end - end - - # Describes node type. - # @!attribute [r] name - # @return [::String] - # Output only. The resource name of this node type. - # Resource names are schemeless URIs that follow the conventions in - # https://cloud.google.com/apis/design/resource_names. - # For example: - # `projects/my-proj/locations/us-central1-a/nodeTypes/standard-72` - # @!attribute [r] node_type_id - # @return [::String] - # Output only. The canonical identifier of the node type - # (corresponds to the `NodeType`). For example: standard-72. - # @!attribute [r] display_name - # @return [::String] - # Output only. The friendly name for this node type. - # For example: ve1-standard-72 - # @!attribute [r] virtual_cpu_count - # @return [::Integer] - # Output only. The total number of virtual CPUs in a single node. - # @!attribute [r] total_core_count - # @return [::Integer] - # Output only. The total number of CPU cores in a single node. - # @!attribute [r] memory_gb - # @return [::Integer] - # Output only. The amount of physical memory available, defined in GB. - # @!attribute [r] disk_size_gb - # @return [::Integer] - # Output only. The amount of storage available, defined in GB. - # @!attribute [r] available_custom_core_counts - # @return [::Array<::Integer>] - # Output only. List of possible values of custom core count. - # @!attribute [r] kind - # @return [::Google::Cloud::VmwareEngine::V1::NodeType::Kind] - # Output only. The type of the resource. - # @!attribute [r] families - # @return [::Array<::String>] - # Output only. Families of the node type. - # For node types to be in the same cluster - # they must share at least one element in the `families`. - # @!attribute [r] capabilities - # @return [::Array<::Google::Cloud::VmwareEngine::V1::NodeType::Capability>] - # Output only. Capabilities of this node type. - class NodeType - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Enum Kind defines possible types of a NodeType. - module Kind - # The default value. This value should never be used. - KIND_UNSPECIFIED = 0 - - # Standard HCI node. - STANDARD = 1 - - # Storage only Node. - STORAGE_ONLY = 2 - end - - # Capability of a node type. - module Capability - # The default value. This value is used if the capability is omitted or - # unknown. - CAPABILITY_UNSPECIFIED = 0 - - # This node type supports stretch clusters. - STRETCHED_CLUSTERS = 1 - end - end - - # Credentials for a private cloud. - # @!attribute [rw] username - # @return [::String] - # Initial username. - # @!attribute [rw] password - # @return [::String] - # Initial password. - class Credentials - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # HCX activation key. A default key is created during - # private cloud provisioning, but this behavior is subject to change - # and you should always verify active keys. - # Use - # {::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#list_hcx_activation_keys VmwareEngine.ListHcxActivationKeys} - # to retrieve existing keys and - # {::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#create_hcx_activation_key VmwareEngine.CreateHcxActivationKey} - # to create new ones. - # @!attribute [r] name - # @return [::String] - # Output only. The resource name of this HcxActivationKey. - # Resource names are schemeless URIs that follow the conventions in - # https://cloud.google.com/apis/design/resource_names. - # For example: - # `projects/my-project/locations/us-central1/privateClouds/my-cloud/hcxActivationKeys/my-key` - # @!attribute [r] create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. Creation time of HCX activation key. - # @!attribute [r] state - # @return [::Google::Cloud::VmwareEngine::V1::HcxActivationKey::State] - # Output only. State of HCX activation key. - # @!attribute [r] activation_key - # @return [::String] - # Output only. HCX activation key. - # @!attribute [r] uid - # @return [::String] - # Output only. System-generated unique identifier for the resource. - class HcxActivationKey - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # State of HCX activation key - module State - # Unspecified state. - STATE_UNSPECIFIED = 0 - - # State of a newly generated activation key. - AVAILABLE = 1 - - # State of key when it has been used to activate HCX appliance. - CONSUMED = 2 - - # State of key when it is being created. - CREATING = 3 - end - end - - # Details about a HCX Cloud Manager appliance. - # @!attribute [rw] internal_ip - # @return [::String] - # Internal IP address of the appliance. - # @!attribute [rw] version - # @return [::String] - # Version of the appliance. - # @!attribute [r] state - # @return [::Google::Cloud::VmwareEngine::V1::Hcx::State] - # Output only. The state of the appliance. - # @!attribute [rw] fqdn - # @return [::String] - # Fully qualified domain name of the appliance. - class Hcx - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # State of the appliance - module State - # Unspecified appliance state. This is the default value. - STATE_UNSPECIFIED = 0 - - # The appliance is operational and can be used. - ACTIVE = 1 - - # The appliance is being deployed. - CREATING = 2 - - # The appliance is being activated. - ACTIVATING = 3 - end - end - - # Details about a NSX Manager appliance. - # @!attribute [rw] internal_ip - # @return [::String] - # Internal IP address of the appliance. - # @!attribute [rw] version - # @return [::String] - # Version of the appliance. - # @!attribute [r] state - # @return [::Google::Cloud::VmwareEngine::V1::Nsx::State] - # Output only. The state of the appliance. - # @!attribute [rw] fqdn - # @return [::String] - # Fully qualified domain name of the appliance. - class Nsx - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # State of the appliance - module State - # Unspecified appliance state. This is the default value. - STATE_UNSPECIFIED = 0 - - # The appliance is operational and can be used. - ACTIVE = 1 - - # The appliance is being deployed. - CREATING = 2 - end - end - - # Details about a vCenter Server management appliance. - # @!attribute [rw] internal_ip - # @return [::String] - # Internal IP address of the appliance. - # @!attribute [rw] version - # @return [::String] - # Version of the appliance. - # @!attribute [r] state - # @return [::Google::Cloud::VmwareEngine::V1::Vcenter::State] - # Output only. The state of the appliance. - # @!attribute [rw] fqdn - # @return [::String] - # Fully qualified domain name of the appliance. - class Vcenter - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # State of the appliance - module State - # Unspecified appliance state. This is the default value. - STATE_UNSPECIFIED = 0 - - # The appliance is operational and can be used. - ACTIVE = 1 - - # The appliance is being deployed. - CREATING = 2 - end - end - - # Autoscaling settings define the rules used by VMware Engine to - # automatically scale-out and scale-in the clusters in a private cloud. - # @!attribute [rw] autoscaling_policies - # @return [::Google::Protobuf::Map{::String => ::Google::Cloud::VmwareEngine::V1::AutoscalingSettings::AutoscalingPolicy}] - # Required. The map with autoscaling policies applied to the cluster. - # The key is the identifier of the policy. - # It must meet the following requirements: - # - # * Only contains 1-63 alphanumeric characters and hyphens - # * Begins with an alphabetical character - # * Ends with a non-hyphen character - # * Not formatted as a UUID - # * Complies with [RFC - # 1034](https://datatracker.ietf.org/doc/html/rfc1034) (section 3.5) - # - # Currently there map must contain only one element - # that describes the autoscaling policy for compute nodes. - # @!attribute [rw] min_cluster_node_count - # @return [::Integer] - # Optional. Minimum number of nodes of any type in a cluster. - # If not specified the default limits apply. - # @!attribute [rw] max_cluster_node_count - # @return [::Integer] - # Optional. Maximum number of nodes of any type in a cluster. - # If not specified the default limits apply. - # @!attribute [rw] cool_down_period - # @return [::Google::Protobuf::Duration] - # Optional. The minimum duration between consecutive autoscale operations. - # It starts once addition or removal of nodes is fully completed. - # Defaults to 30 minutes if not specified. Cool down period must be in whole - # minutes (for example, 30, 31, 50, 180 minutes). - class AutoscalingSettings - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Thresholds define the utilization of resources triggering - # scale-out and scale-in operations. - # @!attribute [rw] scale_out - # @return [::Integer] - # Required. The utilization triggering the scale-out operation in percent. - # @!attribute [rw] scale_in - # @return [::Integer] - # Required. The utilization triggering the scale-in operation in percent. - class Thresholds - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Autoscaling policy describes the behavior of the autoscaling - # with respect to the resource utilization. - # The scale-out operation is initiated if the utilization - # exceeds ANY of the respective thresholds. - # The scale-in operation is initiated if the utilization - # is below ALL of the respective thresholds. - # @!attribute [rw] node_type_id - # @return [::String] - # Required. The canonical identifier of the node type to add or remove. - # Corresponds to the `NodeType`. - # @!attribute [rw] scale_out_size - # @return [::Integer] - # Required. Number of nodes to add to a cluster during a scale-out - # operation. Must be divisible by 2 for stretched clusters. During a - # scale-in operation only one node (or 2 for stretched clusters) are - # removed in a single iteration. - # @!attribute [rw] cpu_thresholds - # @return [::Google::Cloud::VmwareEngine::V1::AutoscalingSettings::Thresholds] - # Optional. Utilization thresholds pertaining to CPU utilization. - # @!attribute [rw] granted_memory_thresholds - # @return [::Google::Cloud::VmwareEngine::V1::AutoscalingSettings::Thresholds] - # Optional. Utilization thresholds pertaining to amount of granted memory. - # @!attribute [rw] consumed_memory_thresholds - # @return [::Google::Cloud::VmwareEngine::V1::AutoscalingSettings::Thresholds] - # Optional. Utilization thresholds pertaining to amount of consumed memory. - # @!attribute [rw] storage_thresholds - # @return [::Google::Cloud::VmwareEngine::V1::AutoscalingSettings::Thresholds] - # Optional. Utilization thresholds pertaining to amount of consumed - # storage. - class AutoscalingPolicy - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::Google::Cloud::VmwareEngine::V1::AutoscalingSettings::AutoscalingPolicy] - class AutoscalingPoliciesEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # DNS forwarding config. - # This config defines a list of domain to name server mappings, - # and is attached to the private cloud for custom domain resolution. - # @!attribute [r] name - # @return [::String] - # Output only. The resource name of this DNS profile. - # Resource names are schemeless URIs that follow the conventions in - # https://cloud.google.com/apis/design/resource_names. - # For example: - # `projects/my-project/locations/us-central1-a/privateClouds/my-cloud/dnsForwarding` - # @!attribute [r] create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. Creation time of this resource. - # @!attribute [r] update_time - # @return [::Google::Protobuf::Timestamp] - # Output only. Last update time of this resource. - # @!attribute [rw] forwarding_rules - # @return [::Array<::Google::Cloud::VmwareEngine::V1::DnsForwarding::ForwardingRule>] - # Required. List of domain mappings to configure - class DnsForwarding - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # A forwarding rule is a mapping of a `domain` to `name_servers`. - # This mapping allows VMware Engine to resolve domains for attached private - # clouds by forwarding DNS requests for a given domain to the specified - # nameservers. - # @!attribute [rw] domain - # @return [::String] - # Required. Domain used to resolve a `name_servers` list. - # @!attribute [rw] name_servers - # @return [::Array<::String>] - # Required. List of DNS servers to use for domain resolution - class ForwardingRule - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Details of a network peering. - # @!attribute [r] name - # @return [::String] - # Output only. The resource name of the network peering. NetworkPeering is a - # global resource and location can only be global. Resource names are - # scheme-less URIs that follow the conventions in - # https://cloud.google.com/apis/design/resource_names. - # For example: - # `projects/my-project/locations/global/networkPeerings/my-peering` - # @!attribute [r] create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. Creation time of this resource. - # @!attribute [r] update_time - # @return [::Google::Protobuf::Timestamp] - # Output only. Last update time of this resource. - # @!attribute [rw] peer_network - # @return [::String] - # Required. The relative resource name of the network to peer with - # a standard VMware Engine network. The provided network can be a - # consumer VPC network or another standard VMware Engine network. If the - # `peer_network_type` is VMWARE_ENGINE_NETWORK, specify the name in the form: - # `projects/{project}/locations/global/vmwareEngineNetworks/{vmware_engine_network_id}`. - # Otherwise specify the name in the form: - # `projects/{project}/global/networks/{network_id}`, where - # `{project}` can either be a project number or a project ID. - # @!attribute [rw] export_custom_routes - # @return [::Boolean] - # Optional. True if custom routes are exported to the peered network; - # false otherwise. The default value is true. - # @!attribute [rw] import_custom_routes - # @return [::Boolean] - # Optional. True if custom routes are imported from the peered network; - # false otherwise. The default value is true. - # @!attribute [rw] exchange_subnet_routes - # @return [::Boolean] - # Optional. True if full mesh connectivity is created and managed - # automatically between peered networks; false otherwise. Currently this - # field is always true because Google Compute Engine automatically creates - # and manages subnetwork routes between two VPC networks when peering state - # is 'ACTIVE'. - # @!attribute [rw] export_custom_routes_with_public_ip - # @return [::Boolean] - # Optional. True if all subnet routes with a public IP address range are - # exported; false otherwise. The default value is true. IPv4 special-use - # ranges (https://en.wikipedia.org/wiki/IPv4#Special_addresses) are always - # exported to peers and are not controlled by this field. - # @!attribute [rw] import_custom_routes_with_public_ip - # @return [::Boolean] - # Optional. True if all subnet routes with public IP address range are - # imported; false otherwise. The default value is true. IPv4 special-use - # ranges (https://en.wikipedia.org/wiki/IPv4#Special_addresses) are always - # imported to peers and are not controlled by this field. - # @!attribute [r] state - # @return [::Google::Cloud::VmwareEngine::V1::NetworkPeering::State] - # Output only. State of the network peering. This field - # has a value of 'ACTIVE' when there's a matching configuration in the peer - # network. New values may be added to this enum when appropriate. - # @!attribute [r] state_details - # @return [::String] - # Output only. Output Only. Details about the current state of the network - # peering. - # @!attribute [rw] peer_mtu - # @return [::Integer] - # Optional. Maximum transmission unit (MTU) in bytes. - # The default value is `1500`. If a value of `0` is provided for this field, - # VMware Engine uses the default value instead. - # @!attribute [rw] peer_network_type - # @return [::Google::Cloud::VmwareEngine::V1::NetworkPeering::PeerNetworkType] - # Required. The type of the network to peer with the VMware Engine network. - # @!attribute [r] uid - # @return [::String] - # Output only. System-generated unique identifier for the resource. - # @!attribute [rw] vmware_engine_network - # @return [::String] - # Required. The relative resource name of the VMware Engine network. - # Specify the name in the following form: - # `projects/{project}/locations/{location}/vmwareEngineNetworks/{vmware_engine_network_id}` - # where `{project}` can either be a project number or a project ID. - # @!attribute [rw] description - # @return [::String] - # Optional. User-provided description for this network peering. - class NetworkPeering - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Possible states of a network peering. - module State - # Unspecified network peering state. This is the default value. - STATE_UNSPECIFIED = 0 - - # The peering is not active. - INACTIVE = 1 - - # The peering is active. - ACTIVE = 2 - - # The peering is being created. - CREATING = 3 - - # The peering is being deleted. - DELETING = 4 - end - - # Type or purpose of the network peering connection. - module PeerNetworkType - # Unspecified - PEER_NETWORK_TYPE_UNSPECIFIED = 0 - - # Peering connection used for connecting to another VPC network established - # by the same user. For example, a peering connection to another VPC - # network in the same project or to an on-premises network. - STANDARD = 1 - - # Peering connection used for connecting to another VMware Engine network. - VMWARE_ENGINE_NETWORK = 2 - - # Peering connection used for establishing [private services - # access](https://cloud.google.com/vpc/docs/private-services-access). - PRIVATE_SERVICES_ACCESS = 3 - - # Peering connection used for connecting to NetApp Cloud Volumes. - NETAPP_CLOUD_VOLUMES = 4 - - # Peering connection used for connecting to third-party services. Most - # third-party services require manual setup of reverse peering on the VPC - # network associated with the third-party service. - THIRD_PARTY_SERVICE = 5 - - # Peering connection used for connecting to Dell PowerScale Filers - DELL_POWERSCALE = 6 - - # Peering connection used for connecting to Google Cloud NetApp Volumes. - GOOGLE_CLOUD_NETAPP_VOLUMES = 7 - end - end - - # Exchanged network peering route. - # @!attribute [r] dest_range - # @return [::String] - # Output only. Destination range of the peering route in CIDR notation. - # @!attribute [r] type - # @return [::Google::Cloud::VmwareEngine::V1::PeeringRoute::Type] - # Output only. Type of the route in the peer VPC network. - # @!attribute [r] next_hop_region - # @return [::String] - # Output only. Region containing the next hop of the peering route. This - # field only applies to dynamic routes in the peer VPC network. - # @!attribute [r] priority - # @return [::Integer] - # Output only. The priority of the peering route. - # @!attribute [r] imported - # @return [::Boolean] - # Output only. True if the peering route has been imported from a peered - # VPC network; false otherwise. The import happens if the field - # `NetworkPeering.importCustomRoutes` is true for this network, - # `NetworkPeering.exportCustomRoutes` is true for the peer VPC network, and - # the import does not result in a route conflict. - # @!attribute [r] direction - # @return [::Google::Cloud::VmwareEngine::V1::PeeringRoute::Direction] - # Output only. Direction of the routes exchanged with the peer network, from - # the VMware Engine network perspective: - # - # * Routes of direction `INCOMING` are imported from the peer network. - # * Routes of direction `OUTGOING` are exported from the intranet VPC network - # of the VMware Engine network. - class PeeringRoute - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The type of the peering route. - module Type - # Unspecified peering route type. This is the default value. - TYPE_UNSPECIFIED = 0 - - # Dynamic routes in the peer network. - DYNAMIC_PEERING_ROUTE = 1 - - # Static routes in the peer network. - STATIC_PEERING_ROUTE = 2 - - # Created, updated, and removed automatically by Google Cloud when subnets - # are created, modified, or deleted in the peer network. - SUBNET_PEERING_ROUTE = 3 - end - - # The direction of the exchanged routes. - module Direction - # Unspecified exchanged routes direction. This is default. - DIRECTION_UNSPECIFIED = 0 - - # Routes imported from the peer network. - INCOMING = 1 - - # Routes exported to the peer network. - OUTGOING = 2 - end - end - - # Represents a network policy resource. Network policies are regional - # resources. You can use a network policy to enable or disable internet access - # and external IP access. Network policies are associated with a VMware Engine - # network, which might span across regions. For a given region, a network - # policy applies to all private clouds in the VMware Engine network associated - # with the policy. - # @!attribute [r] name - # @return [::String] - # Output only. The resource name of this network policy. - # Resource names are schemeless URIs that follow the conventions in - # https://cloud.google.com/apis/design/resource_names. - # For example: - # `projects/my-project/locations/us-central1/networkPolicies/my-network-policy` - # @!attribute [r] create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. Creation time of this resource. - # @!attribute [r] update_time - # @return [::Google::Protobuf::Timestamp] - # Output only. Last update time of this resource. - # @!attribute [rw] internet_access - # @return [::Google::Cloud::VmwareEngine::V1::NetworkPolicy::NetworkService] - # Network service that allows VMware workloads to access the internet. - # @!attribute [rw] external_ip - # @return [::Google::Cloud::VmwareEngine::V1::NetworkPolicy::NetworkService] - # Network service that allows External IP addresses to be assigned to VMware - # workloads. This service can only be enabled when `internet_access` is also - # enabled. - # @!attribute [rw] edge_services_cidr - # @return [::String] - # Required. IP address range in CIDR notation used to create internet access - # and external IP access. An RFC 1918 CIDR block, with a "/26" prefix, is - # required. The range cannot overlap with any prefixes either in the consumer - # VPC network or in use by the private clouds attached to that VPC network. - # @!attribute [r] uid - # @return [::String] - # Output only. System-generated unique identifier for the resource. - # @!attribute [rw] vmware_engine_network - # @return [::String] - # Optional. The relative resource name of the VMware Engine network. - # Specify the name in the following form: - # `projects/{project}/locations/{location}/vmwareEngineNetworks/{vmware_engine_network_id}` - # where `{project}` can either be a project number or a project ID. - # @!attribute [rw] description - # @return [::String] - # Optional. User-provided description for this network policy. - # @!attribute [r] vmware_engine_network_canonical - # @return [::String] - # Output only. The canonical name of the VMware Engine network in the form: - # `projects/{project_number}/locations/{location}/vmwareEngineNetworks/{vmware_engine_network_id}` - class NetworkPolicy - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Represents a network service that is managed by a `NetworkPolicy` resource. - # A network service provides a way to control an aspect of external access to - # VMware workloads. For example, whether the VMware workloads in the - # private clouds governed by a network policy can access or be accessed from - # the internet. - # @!attribute [rw] enabled - # @return [::Boolean] - # True if the service is enabled; false otherwise. - # @!attribute [r] state - # @return [::Google::Cloud::VmwareEngine::V1::NetworkPolicy::NetworkService::State] - # Output only. State of the service. New values may be added to this enum - # when appropriate. - class NetworkService - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Enum State defines possible states of a network policy controlled - # service. - module State - # Unspecified service state. This is the default value. - STATE_UNSPECIFIED = 0 - - # Service is not provisioned. - UNPROVISIONED = 1 - - # Service is in the process of being provisioned/deprovisioned. - RECONCILING = 2 - - # Service is active. - ACTIVE = 3 - end - end - end - - # Represents a binding between a network and the management DNS zone. - # A management DNS zone is the Cloud DNS cross-project binding zone that - # VMware Engine creates for each private cloud. It contains FQDNs and - # corresponding IP addresses for the private cloud's ESXi hosts and management - # VM appliances like vCenter and NSX Manager. - # @!attribute [r] name - # @return [::String] - # Output only. The resource name of this binding. - # Resource names are schemeless URIs that follow the conventions in - # https://cloud.google.com/apis/design/resource_names. - # For example: - # `projects/my-project/locations/us-central1-a/privateClouds/my-cloud/managementDnsZoneBindings/my-management-dns-zone-binding` - # @!attribute [r] create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. Creation time of this resource. - # @!attribute [r] update_time - # @return [::Google::Protobuf::Timestamp] - # Output only. Last update time of this resource. - # @!attribute [r] state - # @return [::Google::Cloud::VmwareEngine::V1::ManagementDnsZoneBinding::State] - # Output only. The state of the resource. - # @!attribute [rw] description - # @return [::String] - # User-provided description for this resource. - # @!attribute [rw] vpc_network - # @return [::String] - # Network to bind is a standard consumer VPC. - # Specify the name in the following form for consumer - # VPC network: `projects/{project}/global/networks/{network_id}`. - # `{project}` can either be a project number or a project ID. - # - # Note: The following fields are mutually exclusive: `vpc_network`, `vmware_engine_network`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] vmware_engine_network - # @return [::String] - # Network to bind is a VMware Engine network. - # Specify the name in the following form for VMware engine network: - # `projects/{project}/locations/global/vmwareEngineNetworks/{vmware_engine_network_id}`. - # `{project}` can either be a project number or a project ID. - # - # Note: The following fields are mutually exclusive: `vmware_engine_network`, `vpc_network`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [r] uid - # @return [::String] - # Output only. System-generated unique identifier for the resource. - class ManagementDnsZoneBinding - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Enum State defines possible states of binding between the consumer VPC - # network and the management DNS zone. - module State - # The default value. This value should never be used. - STATE_UNSPECIFIED = 0 - - # The binding is ready. - ACTIVE = 1 - - # The binding is being created. - CREATING = 2 - - # The binding is being updated. - UPDATING = 3 - - # The binding is being deleted. - DELETING = 4 - - # The binding has failed. - FAILED = 5 - end - end - - # VMware Engine network resource that provides connectivity for VMware Engine - # private clouds. - # @!attribute [r] name - # @return [::String] - # Output only. The resource name of the VMware Engine network. - # Resource names are schemeless URIs that follow the conventions in - # https://cloud.google.com/apis/design/resource_names. - # For example: - # `projects/my-project/locations/global/vmwareEngineNetworks/my-network` - # @!attribute [r] create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. Creation time of this resource. - # @!attribute [r] update_time - # @return [::Google::Protobuf::Timestamp] - # Output only. Last update time of this resource. - # @!attribute [rw] description - # @return [::String] - # User-provided description for this VMware Engine network. - # @!attribute [r] vpc_networks - # @return [::Array<::Google::Cloud::VmwareEngine::V1::VmwareEngineNetwork::VpcNetwork>] - # Output only. VMware Engine service VPC networks that provide connectivity - # from a private cloud to customer projects, the internet, and other Google - # Cloud services. - # @!attribute [r] state - # @return [::Google::Cloud::VmwareEngine::V1::VmwareEngineNetwork::State] - # Output only. State of the VMware Engine network. - # @!attribute [rw] type - # @return [::Google::Cloud::VmwareEngine::V1::VmwareEngineNetwork::Type] - # Required. VMware Engine network type. - # @!attribute [r] uid - # @return [::String] - # Output only. System-generated unique identifier for the resource. - # @!attribute [rw] etag - # @return [::String] - # Checksum that may be sent on update and delete requests to ensure that the - # user-provided value is up to date before the server processes a request. - # The server computes checksums based on the value of other fields in the - # request. - class VmwareEngineNetwork - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Represents a VMware Engine VPC network that is managed by a - # VMware Engine network resource. - # @!attribute [r] type - # @return [::Google::Cloud::VmwareEngine::V1::VmwareEngineNetwork::VpcNetwork::Type] - # Output only. Type of VPC network (INTRANET, INTERNET, or - # GOOGLE_CLOUD) - # @!attribute [r] network - # @return [::String] - # Output only. The relative resource name of the service VPC network this - # VMware Engine network is attached to. For example: - # `projects/123123/global/networks/my-network` - class VpcNetwork - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Enum Type defines possible types of a VMware Engine network controlled - # service. - module Type - # The default value. This value should never be used. - TYPE_UNSPECIFIED = 0 - - # VPC network that will be peered with a consumer VPC network or the - # intranet VPC of another VMware Engine network. Access a private cloud - # through Compute Engine VMs on a peered VPC network or an on-premises - # resource connected to a peered consumer VPC network. - INTRANET = 1 - - # VPC network used for internet access to and from a private cloud. - INTERNET = 2 - - # VPC network used for access to Google Cloud services like - # Cloud Storage. - GOOGLE_CLOUD = 3 - end - end - - # Enum State defines possible states of VMware Engine network. - module State - # The default value. This value is used if the state is omitted. - STATE_UNSPECIFIED = 0 - - # The VMware Engine network is being created. - CREATING = 1 - - # The VMware Engine network is ready. - ACTIVE = 2 - - # The VMware Engine network is being updated. - UPDATING = 3 - - # The VMware Engine network is being deleted. - DELETING = 4 - end - - # Enum Type defines possible types of VMware Engine network. - module Type - # The default value. This value should never be used. - TYPE_UNSPECIFIED = 0 - - # Network type used by private clouds created in projects without a network - # of type `STANDARD`. This network type is no longer used for new VMware - # Engine private cloud deployments. - LEGACY = 1 - - # Standard network type used for private cloud connectivity. - STANDARD = 2 - end - end - - # Private connection resource that provides connectivity for VMware Engine - # private clouds. - # @!attribute [r] name - # @return [::String] - # Output only. The resource name of the private connection. - # Resource names are schemeless URIs that follow the conventions in - # https://cloud.google.com/apis/design/resource_names. - # For example: - # `projects/my-project/locations/us-central1/privateConnections/my-connection` - # @!attribute [r] create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. Creation time of this resource. - # @!attribute [r] update_time - # @return [::Google::Protobuf::Timestamp] - # Output only. Last update time of this resource. - # @!attribute [rw] description - # @return [::String] - # Optional. User-provided description for this private connection. - # @!attribute [r] state - # @return [::Google::Cloud::VmwareEngine::V1::PrivateConnection::State] - # Output only. State of the private connection. - # @!attribute [rw] vmware_engine_network - # @return [::String] - # Required. The relative resource name of Legacy VMware Engine network. - # Specify the name in the following form: - # `projects/{project}/locations/{location}/vmwareEngineNetworks/{vmware_engine_network_id}` - # where `{project}`, `{location}` will be same as specified in private - # connection resource name and `{vmware_engine_network_id}` will be in the - # form of `{location}`-default e.g. - # projects/project/locations/us-central1/vmwareEngineNetworks/us-central1-default. - # @!attribute [r] vmware_engine_network_canonical - # @return [::String] - # Output only. The canonical name of the VMware Engine network in the form: - # `projects/{project_number}/locations/{location}/vmwareEngineNetworks/{vmware_engine_network_id}` - # @!attribute [rw] type - # @return [::Google::Cloud::VmwareEngine::V1::PrivateConnection::Type] - # Required. Private connection type. - # @!attribute [r] peering_id - # @return [::String] - # Output only. VPC network peering id between given network VPC and - # VMwareEngineNetwork. - # @!attribute [rw] routing_mode - # @return [::Google::Cloud::VmwareEngine::V1::PrivateConnection::RoutingMode] - # Optional. Routing Mode. - # Default value is set to GLOBAL. - # For type = PRIVATE_SERVICE_ACCESS, this field can be set to GLOBAL or - # REGIONAL, for other types only GLOBAL is supported. - # @!attribute [r] uid - # @return [::String] - # Output only. System-generated unique identifier for the resource. - # @!attribute [rw] service_network - # @return [::String] - # Required. Service network to create private connection. - # Specify the name in the following form: - # `projects/{project}/global/networks/{network_id}` - # For type = PRIVATE_SERVICE_ACCESS, this field represents servicenetworking - # VPC, e.g. projects/project-tp/global/networks/servicenetworking. - # For type = NETAPP_CLOUD_VOLUME, this field represents NetApp service VPC, - # e.g. projects/project-tp/global/networks/netapp-tenant-vpc. - # For type = DELL_POWERSCALE, this field represent Dell service VPC, e.g. - # projects/project-tp/global/networks/dell-tenant-vpc. - # For type= THIRD_PARTY_SERVICE, this field could represent a consumer VPC or - # any other producer VPC to which the VMware Engine Network needs to be - # connected, e.g. projects/project/global/networks/vpc. - # @!attribute [r] peering_state - # @return [::Google::Cloud::VmwareEngine::V1::PrivateConnection::PeeringState] - # Output only. Peering state between service network and VMware Engine - # network. - class PrivateConnection - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Enum State defines possible states of private connection. - module State - # The default value. This value is used if the state is omitted. - STATE_UNSPECIFIED = 0 - - # The private connection is being created. - CREATING = 1 - - # The private connection is ready. - ACTIVE = 2 - - # The private connection is being updated. - UPDATING = 3 - - # The private connection is being deleted. - DELETING = 4 - - # The private connection is not provisioned, since no private cloud is - # present for which this private connection is needed. - UNPROVISIONED = 5 - - # The private connection is in failed state. - FAILED = 6 - end - - # Enum Type defines possible types of private connection. - module Type - # The default value. This value should never be used. - TYPE_UNSPECIFIED = 0 - - # Connection used for establishing [private services - # access](https://cloud.google.com/vpc/docs/private-services-access). - PRIVATE_SERVICE_ACCESS = 1 - - # Connection used for connecting to NetApp Cloud Volumes. - NETAPP_CLOUD_VOLUMES = 2 - - # Connection used for connecting to Dell PowerScale. - DELL_POWERSCALE = 3 - - # Connection used for connecting to third-party services. - THIRD_PARTY_SERVICE = 4 - end - - # Possible types for RoutingMode - module RoutingMode - # The default value. This value should never be used. - ROUTING_MODE_UNSPECIFIED = 0 - - # Global Routing Mode - GLOBAL = 1 - - # Regional Routing Mode - REGIONAL = 2 - end - - # Enum PeeringState defines the possible states of peering between service - # network and the vpc network peered to service network - module PeeringState - # The default value. This value is used if the peering state is omitted or - # unknown. - PEERING_STATE_UNSPECIFIED = 0 - - # The peering is in active state. - PEERING_ACTIVE = 1 - - # The peering is in inactive state. - PEERING_INACTIVE = 2 - end - end - - # VmwareEngine specific metadata for the given - # [google.cloud.location.Location][google.cloud.location.Location]. It is - # returned as a content of the `google.cloud.location.Location.metadata` field. - # @!attribute [r] capabilities - # @return [::Array<::Google::Cloud::VmwareEngine::V1::LocationMetadata::Capability>] - # Output only. Capabilities of this location. - class LocationMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Capability of a location. - module Capability - # The default value. This value is used if the capability is omitted or - # unknown. - CAPABILITY_UNSPECIFIED = 0 - - # Stretch clusters are supported in this location. - STRETCHED_CLUSTERS = 1 - end - end - - # DnsBindPermission resource that contains the accounts having the consumer DNS - # bind permission on the corresponding intranet VPC of the consumer project. - # @!attribute [r] name - # @return [::String] - # Required. Output only. The name of the resource which stores the - # users/service accounts having the permission to bind to the corresponding - # intranet VPC of the consumer project. DnsBindPermission is a global - # resource and location can only be global. Resource names are schemeless - # URIs that follow the conventions in - # https://cloud.google.com/apis/design/resource_names. For example: - # `projects/my-project/locations/global/dnsBindPermission` - # @!attribute [r] principals - # @return [::Array<::Google::Cloud::VmwareEngine::V1::Principal>] - # Output only. Users/Service accounts which have access for binding on the - # intranet VPC project corresponding to the consumer project. - class DnsBindPermission - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Users/Service accounts which have access for DNS binding on the intranet - # VPC corresponding to the consumer project. - # @!attribute [rw] user - # @return [::String] - # The user who needs to be granted permission. - # - # Note: The following fields are mutually exclusive: `user`, `service_account`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] service_account - # @return [::String] - # The service account which needs to be granted the permission. - # - # Note: The following fields are mutually exclusive: `service_account`, `user`. If a field in that set is populated, all other fields in the set will automatically be cleared. - class Principal - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-vmware_engine-v1/proto_docs/google/longrunning/operations.rb b/owl-bot-staging/google-cloud-vmware_engine-v1/proto_docs/google/longrunning/operations.rb deleted file mode 100644 index 7a757f512165..000000000000 --- a/owl-bot-staging/google-cloud-vmware_engine-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-vmware_engine-v1/proto_docs/google/protobuf/any.rb b/owl-bot-staging/google-cloud-vmware_engine-v1/proto_docs/google/protobuf/any.rb deleted file mode 100644 index 58691995f02e..000000000000 --- a/owl-bot-staging/google-cloud-vmware_engine-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-vmware_engine-v1/proto_docs/google/protobuf/duration.rb b/owl-bot-staging/google-cloud-vmware_engine-v1/proto_docs/google/protobuf/duration.rb deleted file mode 100644 index ea59f1f91daf..000000000000 --- a/owl-bot-staging/google-cloud-vmware_engine-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-vmware_engine-v1/proto_docs/google/protobuf/empty.rb b/owl-bot-staging/google-cloud-vmware_engine-v1/proto_docs/google/protobuf/empty.rb deleted file mode 100644 index 83e4481834a6..000000000000 --- a/owl-bot-staging/google-cloud-vmware_engine-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-vmware_engine-v1/proto_docs/google/protobuf/field_mask.rb b/owl-bot-staging/google-cloud-vmware_engine-v1/proto_docs/google/protobuf/field_mask.rb deleted file mode 100644 index 7f3ffc78601a..000000000000 --- a/owl-bot-staging/google-cloud-vmware_engine-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-vmware_engine-v1/proto_docs/google/protobuf/timestamp.rb b/owl-bot-staging/google-cloud-vmware_engine-v1/proto_docs/google/protobuf/timestamp.rb deleted file mode 100644 index 74352be9c58c..000000000000 --- a/owl-bot-staging/google-cloud-vmware_engine-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-vmware_engine-v1/proto_docs/google/rpc/status.rb b/owl-bot-staging/google-cloud-vmware_engine-v1/proto_docs/google/rpc/status.rb deleted file mode 100644 index c1a1c07eb2db..000000000000 --- a/owl-bot-staging/google-cloud-vmware_engine-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-vmware_engine-v1/proto_docs/google/type/expr.rb b/owl-bot-staging/google-cloud-vmware_engine-v1/proto_docs/google/type/expr.rb deleted file mode 100644 index 53e7733b6592..000000000000 --- a/owl-bot-staging/google-cloud-vmware_engine-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-vmware_engine-v1/snippets/Gemfile b/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/Gemfile deleted file mode 100644 index 2e62d5506757..000000000000 --- a/owl-bot-staging/google-cloud-vmware_engine-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-vmware_engine-v1", path: "../" -else - gem "google-cloud-vmware_engine-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-vmware_engine-v1/snippets/snippet_metadata_google.cloud.vmwareengine.v1.json b/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/snippet_metadata_google.cloud.vmwareengine.v1.json deleted file mode 100644 index 9515e08a2d2e..000000000000 --- a/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/snippet_metadata_google.cloud.vmwareengine.v1.json +++ /dev/null @@ -1,2975 +0,0 @@ -{ - "client_library": { - "name": "google-cloud-vmware_engine-v1", - "version": "", - "language": "RUBY", - "apis": [ - { - "id": "google.cloud.vmwareengine.v1", - "version": "v1" - } - ] - }, - "snippets": [ - { - "region_tag": "vmwareengine_v1_generated_VmwareEngine_ListPrivateClouds_sync", - "title": "Snippet for the list_private_clouds call in the VmwareEngine service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#list_private_clouds.", - "file": "vmware_engine/list_private_clouds.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_private_clouds", - "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#list_private_clouds", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VmwareEngine::V1::ListPrivateCloudsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::VmwareEngine::V1::ListPrivateCloudsResponse", - "client": { - "short_name": "VmwareEngine::Client", - "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client" - }, - "method": { - "short_name": "ListPrivateClouds", - "full_name": "google.cloud.vmwareengine.v1.VmwareEngine.ListPrivateClouds", - "service": { - "short_name": "VmwareEngine", - "full_name": "google.cloud.vmwareengine.v1.VmwareEngine" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "vmwareengine_v1_generated_VmwareEngine_GetPrivateCloud_sync", - "title": "Snippet for the get_private_cloud call in the VmwareEngine service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#get_private_cloud.", - "file": "vmware_engine/get_private_cloud.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_private_cloud", - "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#get_private_cloud", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VmwareEngine::V1::GetPrivateCloudRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::VmwareEngine::V1::PrivateCloud", - "client": { - "short_name": "VmwareEngine::Client", - "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client" - }, - "method": { - "short_name": "GetPrivateCloud", - "full_name": "google.cloud.vmwareengine.v1.VmwareEngine.GetPrivateCloud", - "service": { - "short_name": "VmwareEngine", - "full_name": "google.cloud.vmwareengine.v1.VmwareEngine" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "vmwareengine_v1_generated_VmwareEngine_CreatePrivateCloud_sync", - "title": "Snippet for the create_private_cloud call in the VmwareEngine service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#create_private_cloud.", - "file": "vmware_engine/create_private_cloud.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_private_cloud", - "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#create_private_cloud", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VmwareEngine::V1::CreatePrivateCloudRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "VmwareEngine::Client", - "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client" - }, - "method": { - "short_name": "CreatePrivateCloud", - "full_name": "google.cloud.vmwareengine.v1.VmwareEngine.CreatePrivateCloud", - "service": { - "short_name": "VmwareEngine", - "full_name": "google.cloud.vmwareengine.v1.VmwareEngine" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "vmwareengine_v1_generated_VmwareEngine_UpdatePrivateCloud_sync", - "title": "Snippet for the update_private_cloud call in the VmwareEngine service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#update_private_cloud.", - "file": "vmware_engine/update_private_cloud.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_private_cloud", - "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#update_private_cloud", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VmwareEngine::V1::UpdatePrivateCloudRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "VmwareEngine::Client", - "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client" - }, - "method": { - "short_name": "UpdatePrivateCloud", - "full_name": "google.cloud.vmwareengine.v1.VmwareEngine.UpdatePrivateCloud", - "service": { - "short_name": "VmwareEngine", - "full_name": "google.cloud.vmwareengine.v1.VmwareEngine" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "vmwareengine_v1_generated_VmwareEngine_DeletePrivateCloud_sync", - "title": "Snippet for the delete_private_cloud call in the VmwareEngine service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#delete_private_cloud.", - "file": "vmware_engine/delete_private_cloud.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_private_cloud", - "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#delete_private_cloud", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VmwareEngine::V1::DeletePrivateCloudRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "VmwareEngine::Client", - "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client" - }, - "method": { - "short_name": "DeletePrivateCloud", - "full_name": "google.cloud.vmwareengine.v1.VmwareEngine.DeletePrivateCloud", - "service": { - "short_name": "VmwareEngine", - "full_name": "google.cloud.vmwareengine.v1.VmwareEngine" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "vmwareengine_v1_generated_VmwareEngine_UndeletePrivateCloud_sync", - "title": "Snippet for the undelete_private_cloud call in the VmwareEngine service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#undelete_private_cloud.", - "file": "vmware_engine/undelete_private_cloud.rb", - "language": "RUBY", - "client_method": { - "short_name": "undelete_private_cloud", - "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#undelete_private_cloud", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VmwareEngine::V1::UndeletePrivateCloudRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "VmwareEngine::Client", - "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client" - }, - "method": { - "short_name": "UndeletePrivateCloud", - "full_name": "google.cloud.vmwareengine.v1.VmwareEngine.UndeletePrivateCloud", - "service": { - "short_name": "VmwareEngine", - "full_name": "google.cloud.vmwareengine.v1.VmwareEngine" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "vmwareengine_v1_generated_VmwareEngine_ListClusters_sync", - "title": "Snippet for the list_clusters call in the VmwareEngine service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#list_clusters.", - "file": "vmware_engine/list_clusters.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_clusters", - "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#list_clusters", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VmwareEngine::V1::ListClustersRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::VmwareEngine::V1::ListClustersResponse", - "client": { - "short_name": "VmwareEngine::Client", - "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client" - }, - "method": { - "short_name": "ListClusters", - "full_name": "google.cloud.vmwareengine.v1.VmwareEngine.ListClusters", - "service": { - "short_name": "VmwareEngine", - "full_name": "google.cloud.vmwareengine.v1.VmwareEngine" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "vmwareengine_v1_generated_VmwareEngine_GetCluster_sync", - "title": "Snippet for the get_cluster call in the VmwareEngine service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#get_cluster.", - "file": "vmware_engine/get_cluster.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_cluster", - "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#get_cluster", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VmwareEngine::V1::GetClusterRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::VmwareEngine::V1::Cluster", - "client": { - "short_name": "VmwareEngine::Client", - "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client" - }, - "method": { - "short_name": "GetCluster", - "full_name": "google.cloud.vmwareengine.v1.VmwareEngine.GetCluster", - "service": { - "short_name": "VmwareEngine", - "full_name": "google.cloud.vmwareengine.v1.VmwareEngine" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "vmwareengine_v1_generated_VmwareEngine_CreateCluster_sync", - "title": "Snippet for the create_cluster call in the VmwareEngine service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#create_cluster.", - "file": "vmware_engine/create_cluster.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_cluster", - "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#create_cluster", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VmwareEngine::V1::CreateClusterRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "VmwareEngine::Client", - "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client" - }, - "method": { - "short_name": "CreateCluster", - "full_name": "google.cloud.vmwareengine.v1.VmwareEngine.CreateCluster", - "service": { - "short_name": "VmwareEngine", - "full_name": "google.cloud.vmwareengine.v1.VmwareEngine" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "vmwareengine_v1_generated_VmwareEngine_UpdateCluster_sync", - "title": "Snippet for the update_cluster call in the VmwareEngine service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#update_cluster.", - "file": "vmware_engine/update_cluster.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_cluster", - "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#update_cluster", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VmwareEngine::V1::UpdateClusterRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "VmwareEngine::Client", - "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client" - }, - "method": { - "short_name": "UpdateCluster", - "full_name": "google.cloud.vmwareengine.v1.VmwareEngine.UpdateCluster", - "service": { - "short_name": "VmwareEngine", - "full_name": "google.cloud.vmwareengine.v1.VmwareEngine" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "vmwareengine_v1_generated_VmwareEngine_DeleteCluster_sync", - "title": "Snippet for the delete_cluster call in the VmwareEngine service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#delete_cluster.", - "file": "vmware_engine/delete_cluster.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_cluster", - "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#delete_cluster", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VmwareEngine::V1::DeleteClusterRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "VmwareEngine::Client", - "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client" - }, - "method": { - "short_name": "DeleteCluster", - "full_name": "google.cloud.vmwareengine.v1.VmwareEngine.DeleteCluster", - "service": { - "short_name": "VmwareEngine", - "full_name": "google.cloud.vmwareengine.v1.VmwareEngine" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "vmwareengine_v1_generated_VmwareEngine_ListNodes_sync", - "title": "Snippet for the list_nodes call in the VmwareEngine service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#list_nodes.", - "file": "vmware_engine/list_nodes.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_nodes", - "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#list_nodes", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VmwareEngine::V1::ListNodesRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::VmwareEngine::V1::ListNodesResponse", - "client": { - "short_name": "VmwareEngine::Client", - "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client" - }, - "method": { - "short_name": "ListNodes", - "full_name": "google.cloud.vmwareengine.v1.VmwareEngine.ListNodes", - "service": { - "short_name": "VmwareEngine", - "full_name": "google.cloud.vmwareengine.v1.VmwareEngine" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "vmwareengine_v1_generated_VmwareEngine_GetNode_sync", - "title": "Snippet for the get_node call in the VmwareEngine service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#get_node.", - "file": "vmware_engine/get_node.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_node", - "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#get_node", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VmwareEngine::V1::GetNodeRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::VmwareEngine::V1::Node", - "client": { - "short_name": "VmwareEngine::Client", - "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client" - }, - "method": { - "short_name": "GetNode", - "full_name": "google.cloud.vmwareengine.v1.VmwareEngine.GetNode", - "service": { - "short_name": "VmwareEngine", - "full_name": "google.cloud.vmwareengine.v1.VmwareEngine" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "vmwareengine_v1_generated_VmwareEngine_ListExternalAddresses_sync", - "title": "Snippet for the list_external_addresses call in the VmwareEngine service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#list_external_addresses.", - "file": "vmware_engine/list_external_addresses.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_external_addresses", - "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#list_external_addresses", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VmwareEngine::V1::ListExternalAddressesRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::VmwareEngine::V1::ListExternalAddressesResponse", - "client": { - "short_name": "VmwareEngine::Client", - "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client" - }, - "method": { - "short_name": "ListExternalAddresses", - "full_name": "google.cloud.vmwareengine.v1.VmwareEngine.ListExternalAddresses", - "service": { - "short_name": "VmwareEngine", - "full_name": "google.cloud.vmwareengine.v1.VmwareEngine" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "vmwareengine_v1_generated_VmwareEngine_FetchNetworkPolicyExternalAddresses_sync", - "title": "Snippet for the fetch_network_policy_external_addresses call in the VmwareEngine service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#fetch_network_policy_external_addresses.", - "file": "vmware_engine/fetch_network_policy_external_addresses.rb", - "language": "RUBY", - "client_method": { - "short_name": "fetch_network_policy_external_addresses", - "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#fetch_network_policy_external_addresses", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VmwareEngine::V1::FetchNetworkPolicyExternalAddressesRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::VmwareEngine::V1::FetchNetworkPolicyExternalAddressesResponse", - "client": { - "short_name": "VmwareEngine::Client", - "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client" - }, - "method": { - "short_name": "FetchNetworkPolicyExternalAddresses", - "full_name": "google.cloud.vmwareengine.v1.VmwareEngine.FetchNetworkPolicyExternalAddresses", - "service": { - "short_name": "VmwareEngine", - "full_name": "google.cloud.vmwareengine.v1.VmwareEngine" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "vmwareengine_v1_generated_VmwareEngine_GetExternalAddress_sync", - "title": "Snippet for the get_external_address call in the VmwareEngine service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#get_external_address.", - "file": "vmware_engine/get_external_address.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_external_address", - "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#get_external_address", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VmwareEngine::V1::GetExternalAddressRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::VmwareEngine::V1::ExternalAddress", - "client": { - "short_name": "VmwareEngine::Client", - "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client" - }, - "method": { - "short_name": "GetExternalAddress", - "full_name": "google.cloud.vmwareengine.v1.VmwareEngine.GetExternalAddress", - "service": { - "short_name": "VmwareEngine", - "full_name": "google.cloud.vmwareengine.v1.VmwareEngine" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "vmwareengine_v1_generated_VmwareEngine_CreateExternalAddress_sync", - "title": "Snippet for the create_external_address call in the VmwareEngine service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#create_external_address.", - "file": "vmware_engine/create_external_address.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_external_address", - "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#create_external_address", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VmwareEngine::V1::CreateExternalAddressRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "VmwareEngine::Client", - "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client" - }, - "method": { - "short_name": "CreateExternalAddress", - "full_name": "google.cloud.vmwareengine.v1.VmwareEngine.CreateExternalAddress", - "service": { - "short_name": "VmwareEngine", - "full_name": "google.cloud.vmwareengine.v1.VmwareEngine" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "vmwareengine_v1_generated_VmwareEngine_UpdateExternalAddress_sync", - "title": "Snippet for the update_external_address call in the VmwareEngine service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#update_external_address.", - "file": "vmware_engine/update_external_address.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_external_address", - "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#update_external_address", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VmwareEngine::V1::UpdateExternalAddressRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "VmwareEngine::Client", - "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client" - }, - "method": { - "short_name": "UpdateExternalAddress", - "full_name": "google.cloud.vmwareengine.v1.VmwareEngine.UpdateExternalAddress", - "service": { - "short_name": "VmwareEngine", - "full_name": "google.cloud.vmwareengine.v1.VmwareEngine" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "vmwareengine_v1_generated_VmwareEngine_DeleteExternalAddress_sync", - "title": "Snippet for the delete_external_address call in the VmwareEngine service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#delete_external_address.", - "file": "vmware_engine/delete_external_address.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_external_address", - "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#delete_external_address", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VmwareEngine::V1::DeleteExternalAddressRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "VmwareEngine::Client", - "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client" - }, - "method": { - "short_name": "DeleteExternalAddress", - "full_name": "google.cloud.vmwareengine.v1.VmwareEngine.DeleteExternalAddress", - "service": { - "short_name": "VmwareEngine", - "full_name": "google.cloud.vmwareengine.v1.VmwareEngine" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "vmwareengine_v1_generated_VmwareEngine_ListSubnets_sync", - "title": "Snippet for the list_subnets call in the VmwareEngine service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#list_subnets.", - "file": "vmware_engine/list_subnets.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_subnets", - "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#list_subnets", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VmwareEngine::V1::ListSubnetsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::VmwareEngine::V1::ListSubnetsResponse", - "client": { - "short_name": "VmwareEngine::Client", - "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client" - }, - "method": { - "short_name": "ListSubnets", - "full_name": "google.cloud.vmwareengine.v1.VmwareEngine.ListSubnets", - "service": { - "short_name": "VmwareEngine", - "full_name": "google.cloud.vmwareengine.v1.VmwareEngine" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "vmwareengine_v1_generated_VmwareEngine_GetSubnet_sync", - "title": "Snippet for the get_subnet call in the VmwareEngine service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#get_subnet.", - "file": "vmware_engine/get_subnet.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_subnet", - "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#get_subnet", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VmwareEngine::V1::GetSubnetRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::VmwareEngine::V1::Subnet", - "client": { - "short_name": "VmwareEngine::Client", - "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client" - }, - "method": { - "short_name": "GetSubnet", - "full_name": "google.cloud.vmwareengine.v1.VmwareEngine.GetSubnet", - "service": { - "short_name": "VmwareEngine", - "full_name": "google.cloud.vmwareengine.v1.VmwareEngine" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "vmwareengine_v1_generated_VmwareEngine_UpdateSubnet_sync", - "title": "Snippet for the update_subnet call in the VmwareEngine service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#update_subnet.", - "file": "vmware_engine/update_subnet.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_subnet", - "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#update_subnet", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VmwareEngine::V1::UpdateSubnetRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "VmwareEngine::Client", - "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client" - }, - "method": { - "short_name": "UpdateSubnet", - "full_name": "google.cloud.vmwareengine.v1.VmwareEngine.UpdateSubnet", - "service": { - "short_name": "VmwareEngine", - "full_name": "google.cloud.vmwareengine.v1.VmwareEngine" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "vmwareengine_v1_generated_VmwareEngine_ListExternalAccessRules_sync", - "title": "Snippet for the list_external_access_rules call in the VmwareEngine service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#list_external_access_rules.", - "file": "vmware_engine/list_external_access_rules.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_external_access_rules", - "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#list_external_access_rules", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VmwareEngine::V1::ListExternalAccessRulesRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::VmwareEngine::V1::ListExternalAccessRulesResponse", - "client": { - "short_name": "VmwareEngine::Client", - "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client" - }, - "method": { - "short_name": "ListExternalAccessRules", - "full_name": "google.cloud.vmwareengine.v1.VmwareEngine.ListExternalAccessRules", - "service": { - "short_name": "VmwareEngine", - "full_name": "google.cloud.vmwareengine.v1.VmwareEngine" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "vmwareengine_v1_generated_VmwareEngine_GetExternalAccessRule_sync", - "title": "Snippet for the get_external_access_rule call in the VmwareEngine service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#get_external_access_rule.", - "file": "vmware_engine/get_external_access_rule.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_external_access_rule", - "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#get_external_access_rule", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VmwareEngine::V1::GetExternalAccessRuleRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::VmwareEngine::V1::ExternalAccessRule", - "client": { - "short_name": "VmwareEngine::Client", - "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client" - }, - "method": { - "short_name": "GetExternalAccessRule", - "full_name": "google.cloud.vmwareengine.v1.VmwareEngine.GetExternalAccessRule", - "service": { - "short_name": "VmwareEngine", - "full_name": "google.cloud.vmwareengine.v1.VmwareEngine" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "vmwareengine_v1_generated_VmwareEngine_CreateExternalAccessRule_sync", - "title": "Snippet for the create_external_access_rule call in the VmwareEngine service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#create_external_access_rule.", - "file": "vmware_engine/create_external_access_rule.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_external_access_rule", - "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#create_external_access_rule", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VmwareEngine::V1::CreateExternalAccessRuleRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "VmwareEngine::Client", - "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client" - }, - "method": { - "short_name": "CreateExternalAccessRule", - "full_name": "google.cloud.vmwareengine.v1.VmwareEngine.CreateExternalAccessRule", - "service": { - "short_name": "VmwareEngine", - "full_name": "google.cloud.vmwareengine.v1.VmwareEngine" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "vmwareengine_v1_generated_VmwareEngine_UpdateExternalAccessRule_sync", - "title": "Snippet for the update_external_access_rule call in the VmwareEngine service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#update_external_access_rule.", - "file": "vmware_engine/update_external_access_rule.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_external_access_rule", - "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#update_external_access_rule", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VmwareEngine::V1::UpdateExternalAccessRuleRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "VmwareEngine::Client", - "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client" - }, - "method": { - "short_name": "UpdateExternalAccessRule", - "full_name": "google.cloud.vmwareengine.v1.VmwareEngine.UpdateExternalAccessRule", - "service": { - "short_name": "VmwareEngine", - "full_name": "google.cloud.vmwareengine.v1.VmwareEngine" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "vmwareengine_v1_generated_VmwareEngine_DeleteExternalAccessRule_sync", - "title": "Snippet for the delete_external_access_rule call in the VmwareEngine service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#delete_external_access_rule.", - "file": "vmware_engine/delete_external_access_rule.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_external_access_rule", - "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#delete_external_access_rule", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VmwareEngine::V1::DeleteExternalAccessRuleRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "VmwareEngine::Client", - "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client" - }, - "method": { - "short_name": "DeleteExternalAccessRule", - "full_name": "google.cloud.vmwareengine.v1.VmwareEngine.DeleteExternalAccessRule", - "service": { - "short_name": "VmwareEngine", - "full_name": "google.cloud.vmwareengine.v1.VmwareEngine" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "vmwareengine_v1_generated_VmwareEngine_ListLoggingServers_sync", - "title": "Snippet for the list_logging_servers call in the VmwareEngine service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#list_logging_servers.", - "file": "vmware_engine/list_logging_servers.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_logging_servers", - "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#list_logging_servers", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VmwareEngine::V1::ListLoggingServersRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::VmwareEngine::V1::ListLoggingServersResponse", - "client": { - "short_name": "VmwareEngine::Client", - "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client" - }, - "method": { - "short_name": "ListLoggingServers", - "full_name": "google.cloud.vmwareengine.v1.VmwareEngine.ListLoggingServers", - "service": { - "short_name": "VmwareEngine", - "full_name": "google.cloud.vmwareengine.v1.VmwareEngine" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "vmwareengine_v1_generated_VmwareEngine_GetLoggingServer_sync", - "title": "Snippet for the get_logging_server call in the VmwareEngine service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#get_logging_server.", - "file": "vmware_engine/get_logging_server.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_logging_server", - "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#get_logging_server", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VmwareEngine::V1::GetLoggingServerRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::VmwareEngine::V1::LoggingServer", - "client": { - "short_name": "VmwareEngine::Client", - "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client" - }, - "method": { - "short_name": "GetLoggingServer", - "full_name": "google.cloud.vmwareengine.v1.VmwareEngine.GetLoggingServer", - "service": { - "short_name": "VmwareEngine", - "full_name": "google.cloud.vmwareengine.v1.VmwareEngine" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "vmwareengine_v1_generated_VmwareEngine_CreateLoggingServer_sync", - "title": "Snippet for the create_logging_server call in the VmwareEngine service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#create_logging_server.", - "file": "vmware_engine/create_logging_server.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_logging_server", - "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#create_logging_server", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VmwareEngine::V1::CreateLoggingServerRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "VmwareEngine::Client", - "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client" - }, - "method": { - "short_name": "CreateLoggingServer", - "full_name": "google.cloud.vmwareengine.v1.VmwareEngine.CreateLoggingServer", - "service": { - "short_name": "VmwareEngine", - "full_name": "google.cloud.vmwareengine.v1.VmwareEngine" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "vmwareengine_v1_generated_VmwareEngine_UpdateLoggingServer_sync", - "title": "Snippet for the update_logging_server call in the VmwareEngine service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#update_logging_server.", - "file": "vmware_engine/update_logging_server.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_logging_server", - "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#update_logging_server", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VmwareEngine::V1::UpdateLoggingServerRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "VmwareEngine::Client", - "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client" - }, - "method": { - "short_name": "UpdateLoggingServer", - "full_name": "google.cloud.vmwareengine.v1.VmwareEngine.UpdateLoggingServer", - "service": { - "short_name": "VmwareEngine", - "full_name": "google.cloud.vmwareengine.v1.VmwareEngine" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "vmwareengine_v1_generated_VmwareEngine_DeleteLoggingServer_sync", - "title": "Snippet for the delete_logging_server call in the VmwareEngine service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#delete_logging_server.", - "file": "vmware_engine/delete_logging_server.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_logging_server", - "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#delete_logging_server", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VmwareEngine::V1::DeleteLoggingServerRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "VmwareEngine::Client", - "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client" - }, - "method": { - "short_name": "DeleteLoggingServer", - "full_name": "google.cloud.vmwareengine.v1.VmwareEngine.DeleteLoggingServer", - "service": { - "short_name": "VmwareEngine", - "full_name": "google.cloud.vmwareengine.v1.VmwareEngine" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "vmwareengine_v1_generated_VmwareEngine_ListNodeTypes_sync", - "title": "Snippet for the list_node_types call in the VmwareEngine service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#list_node_types.", - "file": "vmware_engine/list_node_types.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_node_types", - "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#list_node_types", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VmwareEngine::V1::ListNodeTypesRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::VmwareEngine::V1::ListNodeTypesResponse", - "client": { - "short_name": "VmwareEngine::Client", - "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client" - }, - "method": { - "short_name": "ListNodeTypes", - "full_name": "google.cloud.vmwareengine.v1.VmwareEngine.ListNodeTypes", - "service": { - "short_name": "VmwareEngine", - "full_name": "google.cloud.vmwareengine.v1.VmwareEngine" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "vmwareengine_v1_generated_VmwareEngine_GetNodeType_sync", - "title": "Snippet for the get_node_type call in the VmwareEngine service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#get_node_type.", - "file": "vmware_engine/get_node_type.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_node_type", - "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#get_node_type", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VmwareEngine::V1::GetNodeTypeRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::VmwareEngine::V1::NodeType", - "client": { - "short_name": "VmwareEngine::Client", - "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client" - }, - "method": { - "short_name": "GetNodeType", - "full_name": "google.cloud.vmwareengine.v1.VmwareEngine.GetNodeType", - "service": { - "short_name": "VmwareEngine", - "full_name": "google.cloud.vmwareengine.v1.VmwareEngine" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "vmwareengine_v1_generated_VmwareEngine_ShowNsxCredentials_sync", - "title": "Snippet for the show_nsx_credentials call in the VmwareEngine service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#show_nsx_credentials.", - "file": "vmware_engine/show_nsx_credentials.rb", - "language": "RUBY", - "client_method": { - "short_name": "show_nsx_credentials", - "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#show_nsx_credentials", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VmwareEngine::V1::ShowNsxCredentialsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::VmwareEngine::V1::Credentials", - "client": { - "short_name": "VmwareEngine::Client", - "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client" - }, - "method": { - "short_name": "ShowNsxCredentials", - "full_name": "google.cloud.vmwareengine.v1.VmwareEngine.ShowNsxCredentials", - "service": { - "short_name": "VmwareEngine", - "full_name": "google.cloud.vmwareengine.v1.VmwareEngine" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "vmwareengine_v1_generated_VmwareEngine_ShowVcenterCredentials_sync", - "title": "Snippet for the show_vcenter_credentials call in the VmwareEngine service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#show_vcenter_credentials.", - "file": "vmware_engine/show_vcenter_credentials.rb", - "language": "RUBY", - "client_method": { - "short_name": "show_vcenter_credentials", - "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#show_vcenter_credentials", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VmwareEngine::V1::ShowVcenterCredentialsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::VmwareEngine::V1::Credentials", - "client": { - "short_name": "VmwareEngine::Client", - "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client" - }, - "method": { - "short_name": "ShowVcenterCredentials", - "full_name": "google.cloud.vmwareengine.v1.VmwareEngine.ShowVcenterCredentials", - "service": { - "short_name": "VmwareEngine", - "full_name": "google.cloud.vmwareengine.v1.VmwareEngine" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "vmwareengine_v1_generated_VmwareEngine_ResetNsxCredentials_sync", - "title": "Snippet for the reset_nsx_credentials call in the VmwareEngine service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#reset_nsx_credentials.", - "file": "vmware_engine/reset_nsx_credentials.rb", - "language": "RUBY", - "client_method": { - "short_name": "reset_nsx_credentials", - "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#reset_nsx_credentials", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VmwareEngine::V1::ResetNsxCredentialsRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "VmwareEngine::Client", - "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client" - }, - "method": { - "short_name": "ResetNsxCredentials", - "full_name": "google.cloud.vmwareengine.v1.VmwareEngine.ResetNsxCredentials", - "service": { - "short_name": "VmwareEngine", - "full_name": "google.cloud.vmwareengine.v1.VmwareEngine" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "vmwareengine_v1_generated_VmwareEngine_ResetVcenterCredentials_sync", - "title": "Snippet for the reset_vcenter_credentials call in the VmwareEngine service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#reset_vcenter_credentials.", - "file": "vmware_engine/reset_vcenter_credentials.rb", - "language": "RUBY", - "client_method": { - "short_name": "reset_vcenter_credentials", - "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#reset_vcenter_credentials", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VmwareEngine::V1::ResetVcenterCredentialsRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "VmwareEngine::Client", - "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client" - }, - "method": { - "short_name": "ResetVcenterCredentials", - "full_name": "google.cloud.vmwareengine.v1.VmwareEngine.ResetVcenterCredentials", - "service": { - "short_name": "VmwareEngine", - "full_name": "google.cloud.vmwareengine.v1.VmwareEngine" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "vmwareengine_v1_generated_VmwareEngine_GetDnsForwarding_sync", - "title": "Snippet for the get_dns_forwarding call in the VmwareEngine service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#get_dns_forwarding.", - "file": "vmware_engine/get_dns_forwarding.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_dns_forwarding", - "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#get_dns_forwarding", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VmwareEngine::V1::GetDnsForwardingRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::VmwareEngine::V1::DnsForwarding", - "client": { - "short_name": "VmwareEngine::Client", - "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client" - }, - "method": { - "short_name": "GetDnsForwarding", - "full_name": "google.cloud.vmwareengine.v1.VmwareEngine.GetDnsForwarding", - "service": { - "short_name": "VmwareEngine", - "full_name": "google.cloud.vmwareengine.v1.VmwareEngine" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "vmwareengine_v1_generated_VmwareEngine_UpdateDnsForwarding_sync", - "title": "Snippet for the update_dns_forwarding call in the VmwareEngine service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#update_dns_forwarding.", - "file": "vmware_engine/update_dns_forwarding.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_dns_forwarding", - "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#update_dns_forwarding", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VmwareEngine::V1::UpdateDnsForwardingRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "VmwareEngine::Client", - "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client" - }, - "method": { - "short_name": "UpdateDnsForwarding", - "full_name": "google.cloud.vmwareengine.v1.VmwareEngine.UpdateDnsForwarding", - "service": { - "short_name": "VmwareEngine", - "full_name": "google.cloud.vmwareengine.v1.VmwareEngine" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "vmwareengine_v1_generated_VmwareEngine_GetNetworkPeering_sync", - "title": "Snippet for the get_network_peering call in the VmwareEngine service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#get_network_peering.", - "file": "vmware_engine/get_network_peering.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_network_peering", - "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#get_network_peering", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VmwareEngine::V1::GetNetworkPeeringRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::VmwareEngine::V1::NetworkPeering", - "client": { - "short_name": "VmwareEngine::Client", - "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client" - }, - "method": { - "short_name": "GetNetworkPeering", - "full_name": "google.cloud.vmwareengine.v1.VmwareEngine.GetNetworkPeering", - "service": { - "short_name": "VmwareEngine", - "full_name": "google.cloud.vmwareengine.v1.VmwareEngine" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "vmwareengine_v1_generated_VmwareEngine_ListNetworkPeerings_sync", - "title": "Snippet for the list_network_peerings call in the VmwareEngine service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#list_network_peerings.", - "file": "vmware_engine/list_network_peerings.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_network_peerings", - "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#list_network_peerings", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VmwareEngine::V1::ListNetworkPeeringsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::VmwareEngine::V1::ListNetworkPeeringsResponse", - "client": { - "short_name": "VmwareEngine::Client", - "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client" - }, - "method": { - "short_name": "ListNetworkPeerings", - "full_name": "google.cloud.vmwareengine.v1.VmwareEngine.ListNetworkPeerings", - "service": { - "short_name": "VmwareEngine", - "full_name": "google.cloud.vmwareengine.v1.VmwareEngine" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "vmwareengine_v1_generated_VmwareEngine_CreateNetworkPeering_sync", - "title": "Snippet for the create_network_peering call in the VmwareEngine service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#create_network_peering.", - "file": "vmware_engine/create_network_peering.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_network_peering", - "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#create_network_peering", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VmwareEngine::V1::CreateNetworkPeeringRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "VmwareEngine::Client", - "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client" - }, - "method": { - "short_name": "CreateNetworkPeering", - "full_name": "google.cloud.vmwareengine.v1.VmwareEngine.CreateNetworkPeering", - "service": { - "short_name": "VmwareEngine", - "full_name": "google.cloud.vmwareengine.v1.VmwareEngine" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "vmwareengine_v1_generated_VmwareEngine_DeleteNetworkPeering_sync", - "title": "Snippet for the delete_network_peering call in the VmwareEngine service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#delete_network_peering.", - "file": "vmware_engine/delete_network_peering.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_network_peering", - "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#delete_network_peering", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VmwareEngine::V1::DeleteNetworkPeeringRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "VmwareEngine::Client", - "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client" - }, - "method": { - "short_name": "DeleteNetworkPeering", - "full_name": "google.cloud.vmwareengine.v1.VmwareEngine.DeleteNetworkPeering", - "service": { - "short_name": "VmwareEngine", - "full_name": "google.cloud.vmwareengine.v1.VmwareEngine" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "vmwareengine_v1_generated_VmwareEngine_UpdateNetworkPeering_sync", - "title": "Snippet for the update_network_peering call in the VmwareEngine service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#update_network_peering.", - "file": "vmware_engine/update_network_peering.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_network_peering", - "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#update_network_peering", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VmwareEngine::V1::UpdateNetworkPeeringRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "VmwareEngine::Client", - "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client" - }, - "method": { - "short_name": "UpdateNetworkPeering", - "full_name": "google.cloud.vmwareengine.v1.VmwareEngine.UpdateNetworkPeering", - "service": { - "short_name": "VmwareEngine", - "full_name": "google.cloud.vmwareengine.v1.VmwareEngine" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "vmwareengine_v1_generated_VmwareEngine_ListPeeringRoutes_sync", - "title": "Snippet for the list_peering_routes call in the VmwareEngine service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#list_peering_routes.", - "file": "vmware_engine/list_peering_routes.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_peering_routes", - "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#list_peering_routes", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VmwareEngine::V1::ListPeeringRoutesRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::VmwareEngine::V1::ListPeeringRoutesResponse", - "client": { - "short_name": "VmwareEngine::Client", - "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client" - }, - "method": { - "short_name": "ListPeeringRoutes", - "full_name": "google.cloud.vmwareengine.v1.VmwareEngine.ListPeeringRoutes", - "service": { - "short_name": "VmwareEngine", - "full_name": "google.cloud.vmwareengine.v1.VmwareEngine" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "vmwareengine_v1_generated_VmwareEngine_CreateHcxActivationKey_sync", - "title": "Snippet for the create_hcx_activation_key call in the VmwareEngine service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#create_hcx_activation_key.", - "file": "vmware_engine/create_hcx_activation_key.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_hcx_activation_key", - "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#create_hcx_activation_key", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VmwareEngine::V1::CreateHcxActivationKeyRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "VmwareEngine::Client", - "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client" - }, - "method": { - "short_name": "CreateHcxActivationKey", - "full_name": "google.cloud.vmwareengine.v1.VmwareEngine.CreateHcxActivationKey", - "service": { - "short_name": "VmwareEngine", - "full_name": "google.cloud.vmwareengine.v1.VmwareEngine" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "vmwareengine_v1_generated_VmwareEngine_ListHcxActivationKeys_sync", - "title": "Snippet for the list_hcx_activation_keys call in the VmwareEngine service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#list_hcx_activation_keys.", - "file": "vmware_engine/list_hcx_activation_keys.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_hcx_activation_keys", - "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#list_hcx_activation_keys", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VmwareEngine::V1::ListHcxActivationKeysRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::VmwareEngine::V1::ListHcxActivationKeysResponse", - "client": { - "short_name": "VmwareEngine::Client", - "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client" - }, - "method": { - "short_name": "ListHcxActivationKeys", - "full_name": "google.cloud.vmwareengine.v1.VmwareEngine.ListHcxActivationKeys", - "service": { - "short_name": "VmwareEngine", - "full_name": "google.cloud.vmwareengine.v1.VmwareEngine" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "vmwareengine_v1_generated_VmwareEngine_GetHcxActivationKey_sync", - "title": "Snippet for the get_hcx_activation_key call in the VmwareEngine service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#get_hcx_activation_key.", - "file": "vmware_engine/get_hcx_activation_key.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_hcx_activation_key", - "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#get_hcx_activation_key", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VmwareEngine::V1::GetHcxActivationKeyRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::VmwareEngine::V1::HcxActivationKey", - "client": { - "short_name": "VmwareEngine::Client", - "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client" - }, - "method": { - "short_name": "GetHcxActivationKey", - "full_name": "google.cloud.vmwareengine.v1.VmwareEngine.GetHcxActivationKey", - "service": { - "short_name": "VmwareEngine", - "full_name": "google.cloud.vmwareengine.v1.VmwareEngine" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "vmwareengine_v1_generated_VmwareEngine_GetNetworkPolicy_sync", - "title": "Snippet for the get_network_policy call in the VmwareEngine service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#get_network_policy.", - "file": "vmware_engine/get_network_policy.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_network_policy", - "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#get_network_policy", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VmwareEngine::V1::GetNetworkPolicyRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::VmwareEngine::V1::NetworkPolicy", - "client": { - "short_name": "VmwareEngine::Client", - "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client" - }, - "method": { - "short_name": "GetNetworkPolicy", - "full_name": "google.cloud.vmwareengine.v1.VmwareEngine.GetNetworkPolicy", - "service": { - "short_name": "VmwareEngine", - "full_name": "google.cloud.vmwareengine.v1.VmwareEngine" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "vmwareengine_v1_generated_VmwareEngine_ListNetworkPolicies_sync", - "title": "Snippet for the list_network_policies call in the VmwareEngine service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#list_network_policies.", - "file": "vmware_engine/list_network_policies.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_network_policies", - "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#list_network_policies", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VmwareEngine::V1::ListNetworkPoliciesRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::VmwareEngine::V1::ListNetworkPoliciesResponse", - "client": { - "short_name": "VmwareEngine::Client", - "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client" - }, - "method": { - "short_name": "ListNetworkPolicies", - "full_name": "google.cloud.vmwareengine.v1.VmwareEngine.ListNetworkPolicies", - "service": { - "short_name": "VmwareEngine", - "full_name": "google.cloud.vmwareengine.v1.VmwareEngine" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "vmwareengine_v1_generated_VmwareEngine_CreateNetworkPolicy_sync", - "title": "Snippet for the create_network_policy call in the VmwareEngine service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#create_network_policy.", - "file": "vmware_engine/create_network_policy.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_network_policy", - "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#create_network_policy", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VmwareEngine::V1::CreateNetworkPolicyRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "VmwareEngine::Client", - "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client" - }, - "method": { - "short_name": "CreateNetworkPolicy", - "full_name": "google.cloud.vmwareengine.v1.VmwareEngine.CreateNetworkPolicy", - "service": { - "short_name": "VmwareEngine", - "full_name": "google.cloud.vmwareengine.v1.VmwareEngine" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "vmwareengine_v1_generated_VmwareEngine_UpdateNetworkPolicy_sync", - "title": "Snippet for the update_network_policy call in the VmwareEngine service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#update_network_policy.", - "file": "vmware_engine/update_network_policy.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_network_policy", - "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#update_network_policy", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VmwareEngine::V1::UpdateNetworkPolicyRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "VmwareEngine::Client", - "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client" - }, - "method": { - "short_name": "UpdateNetworkPolicy", - "full_name": "google.cloud.vmwareengine.v1.VmwareEngine.UpdateNetworkPolicy", - "service": { - "short_name": "VmwareEngine", - "full_name": "google.cloud.vmwareengine.v1.VmwareEngine" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "vmwareengine_v1_generated_VmwareEngine_DeleteNetworkPolicy_sync", - "title": "Snippet for the delete_network_policy call in the VmwareEngine service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#delete_network_policy.", - "file": "vmware_engine/delete_network_policy.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_network_policy", - "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#delete_network_policy", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VmwareEngine::V1::DeleteNetworkPolicyRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "VmwareEngine::Client", - "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client" - }, - "method": { - "short_name": "DeleteNetworkPolicy", - "full_name": "google.cloud.vmwareengine.v1.VmwareEngine.DeleteNetworkPolicy", - "service": { - "short_name": "VmwareEngine", - "full_name": "google.cloud.vmwareengine.v1.VmwareEngine" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "vmwareengine_v1_generated_VmwareEngine_ListManagementDnsZoneBindings_sync", - "title": "Snippet for the list_management_dns_zone_bindings call in the VmwareEngine service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#list_management_dns_zone_bindings.", - "file": "vmware_engine/list_management_dns_zone_bindings.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_management_dns_zone_bindings", - "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#list_management_dns_zone_bindings", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VmwareEngine::V1::ListManagementDnsZoneBindingsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::VmwareEngine::V1::ListManagementDnsZoneBindingsResponse", - "client": { - "short_name": "VmwareEngine::Client", - "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client" - }, - "method": { - "short_name": "ListManagementDnsZoneBindings", - "full_name": "google.cloud.vmwareengine.v1.VmwareEngine.ListManagementDnsZoneBindings", - "service": { - "short_name": "VmwareEngine", - "full_name": "google.cloud.vmwareengine.v1.VmwareEngine" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "vmwareengine_v1_generated_VmwareEngine_GetManagementDnsZoneBinding_sync", - "title": "Snippet for the get_management_dns_zone_binding call in the VmwareEngine service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#get_management_dns_zone_binding.", - "file": "vmware_engine/get_management_dns_zone_binding.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_management_dns_zone_binding", - "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#get_management_dns_zone_binding", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VmwareEngine::V1::GetManagementDnsZoneBindingRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::VmwareEngine::V1::ManagementDnsZoneBinding", - "client": { - "short_name": "VmwareEngine::Client", - "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client" - }, - "method": { - "short_name": "GetManagementDnsZoneBinding", - "full_name": "google.cloud.vmwareengine.v1.VmwareEngine.GetManagementDnsZoneBinding", - "service": { - "short_name": "VmwareEngine", - "full_name": "google.cloud.vmwareengine.v1.VmwareEngine" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "vmwareengine_v1_generated_VmwareEngine_CreateManagementDnsZoneBinding_sync", - "title": "Snippet for the create_management_dns_zone_binding call in the VmwareEngine service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#create_management_dns_zone_binding.", - "file": "vmware_engine/create_management_dns_zone_binding.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_management_dns_zone_binding", - "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#create_management_dns_zone_binding", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VmwareEngine::V1::CreateManagementDnsZoneBindingRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "VmwareEngine::Client", - "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client" - }, - "method": { - "short_name": "CreateManagementDnsZoneBinding", - "full_name": "google.cloud.vmwareengine.v1.VmwareEngine.CreateManagementDnsZoneBinding", - "service": { - "short_name": "VmwareEngine", - "full_name": "google.cloud.vmwareengine.v1.VmwareEngine" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "vmwareengine_v1_generated_VmwareEngine_UpdateManagementDnsZoneBinding_sync", - "title": "Snippet for the update_management_dns_zone_binding call in the VmwareEngine service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#update_management_dns_zone_binding.", - "file": "vmware_engine/update_management_dns_zone_binding.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_management_dns_zone_binding", - "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#update_management_dns_zone_binding", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VmwareEngine::V1::UpdateManagementDnsZoneBindingRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "VmwareEngine::Client", - "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client" - }, - "method": { - "short_name": "UpdateManagementDnsZoneBinding", - "full_name": "google.cloud.vmwareengine.v1.VmwareEngine.UpdateManagementDnsZoneBinding", - "service": { - "short_name": "VmwareEngine", - "full_name": "google.cloud.vmwareengine.v1.VmwareEngine" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "vmwareengine_v1_generated_VmwareEngine_DeleteManagementDnsZoneBinding_sync", - "title": "Snippet for the delete_management_dns_zone_binding call in the VmwareEngine service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#delete_management_dns_zone_binding.", - "file": "vmware_engine/delete_management_dns_zone_binding.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_management_dns_zone_binding", - "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#delete_management_dns_zone_binding", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VmwareEngine::V1::DeleteManagementDnsZoneBindingRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "VmwareEngine::Client", - "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client" - }, - "method": { - "short_name": "DeleteManagementDnsZoneBinding", - "full_name": "google.cloud.vmwareengine.v1.VmwareEngine.DeleteManagementDnsZoneBinding", - "service": { - "short_name": "VmwareEngine", - "full_name": "google.cloud.vmwareengine.v1.VmwareEngine" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "vmwareengine_v1_generated_VmwareEngine_RepairManagementDnsZoneBinding_sync", - "title": "Snippet for the repair_management_dns_zone_binding call in the VmwareEngine service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#repair_management_dns_zone_binding.", - "file": "vmware_engine/repair_management_dns_zone_binding.rb", - "language": "RUBY", - "client_method": { - "short_name": "repair_management_dns_zone_binding", - "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#repair_management_dns_zone_binding", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VmwareEngine::V1::RepairManagementDnsZoneBindingRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "VmwareEngine::Client", - "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client" - }, - "method": { - "short_name": "RepairManagementDnsZoneBinding", - "full_name": "google.cloud.vmwareengine.v1.VmwareEngine.RepairManagementDnsZoneBinding", - "service": { - "short_name": "VmwareEngine", - "full_name": "google.cloud.vmwareengine.v1.VmwareEngine" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "vmwareengine_v1_generated_VmwareEngine_CreateVmwareEngineNetwork_sync", - "title": "Snippet for the create_vmware_engine_network call in the VmwareEngine service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#create_vmware_engine_network.", - "file": "vmware_engine/create_vmware_engine_network.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_vmware_engine_network", - "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#create_vmware_engine_network", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VmwareEngine::V1::CreateVmwareEngineNetworkRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "VmwareEngine::Client", - "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client" - }, - "method": { - "short_name": "CreateVmwareEngineNetwork", - "full_name": "google.cloud.vmwareengine.v1.VmwareEngine.CreateVmwareEngineNetwork", - "service": { - "short_name": "VmwareEngine", - "full_name": "google.cloud.vmwareengine.v1.VmwareEngine" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "vmwareengine_v1_generated_VmwareEngine_UpdateVmwareEngineNetwork_sync", - "title": "Snippet for the update_vmware_engine_network call in the VmwareEngine service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#update_vmware_engine_network.", - "file": "vmware_engine/update_vmware_engine_network.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_vmware_engine_network", - "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#update_vmware_engine_network", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VmwareEngine::V1::UpdateVmwareEngineNetworkRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "VmwareEngine::Client", - "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client" - }, - "method": { - "short_name": "UpdateVmwareEngineNetwork", - "full_name": "google.cloud.vmwareengine.v1.VmwareEngine.UpdateVmwareEngineNetwork", - "service": { - "short_name": "VmwareEngine", - "full_name": "google.cloud.vmwareengine.v1.VmwareEngine" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "vmwareengine_v1_generated_VmwareEngine_DeleteVmwareEngineNetwork_sync", - "title": "Snippet for the delete_vmware_engine_network call in the VmwareEngine service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#delete_vmware_engine_network.", - "file": "vmware_engine/delete_vmware_engine_network.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_vmware_engine_network", - "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#delete_vmware_engine_network", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VmwareEngine::V1::DeleteVmwareEngineNetworkRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "VmwareEngine::Client", - "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client" - }, - "method": { - "short_name": "DeleteVmwareEngineNetwork", - "full_name": "google.cloud.vmwareengine.v1.VmwareEngine.DeleteVmwareEngineNetwork", - "service": { - "short_name": "VmwareEngine", - "full_name": "google.cloud.vmwareengine.v1.VmwareEngine" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "vmwareengine_v1_generated_VmwareEngine_GetVmwareEngineNetwork_sync", - "title": "Snippet for the get_vmware_engine_network call in the VmwareEngine service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#get_vmware_engine_network.", - "file": "vmware_engine/get_vmware_engine_network.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_vmware_engine_network", - "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#get_vmware_engine_network", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VmwareEngine::V1::GetVmwareEngineNetworkRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::VmwareEngine::V1::VmwareEngineNetwork", - "client": { - "short_name": "VmwareEngine::Client", - "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client" - }, - "method": { - "short_name": "GetVmwareEngineNetwork", - "full_name": "google.cloud.vmwareengine.v1.VmwareEngine.GetVmwareEngineNetwork", - "service": { - "short_name": "VmwareEngine", - "full_name": "google.cloud.vmwareengine.v1.VmwareEngine" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "vmwareengine_v1_generated_VmwareEngine_ListVmwareEngineNetworks_sync", - "title": "Snippet for the list_vmware_engine_networks call in the VmwareEngine service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#list_vmware_engine_networks.", - "file": "vmware_engine/list_vmware_engine_networks.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_vmware_engine_networks", - "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#list_vmware_engine_networks", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VmwareEngine::V1::ListVmwareEngineNetworksRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::VmwareEngine::V1::ListVmwareEngineNetworksResponse", - "client": { - "short_name": "VmwareEngine::Client", - "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client" - }, - "method": { - "short_name": "ListVmwareEngineNetworks", - "full_name": "google.cloud.vmwareengine.v1.VmwareEngine.ListVmwareEngineNetworks", - "service": { - "short_name": "VmwareEngine", - "full_name": "google.cloud.vmwareengine.v1.VmwareEngine" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "vmwareengine_v1_generated_VmwareEngine_CreatePrivateConnection_sync", - "title": "Snippet for the create_private_connection call in the VmwareEngine service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#create_private_connection.", - "file": "vmware_engine/create_private_connection.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_private_connection", - "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#create_private_connection", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VmwareEngine::V1::CreatePrivateConnectionRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "VmwareEngine::Client", - "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client" - }, - "method": { - "short_name": "CreatePrivateConnection", - "full_name": "google.cloud.vmwareengine.v1.VmwareEngine.CreatePrivateConnection", - "service": { - "short_name": "VmwareEngine", - "full_name": "google.cloud.vmwareengine.v1.VmwareEngine" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "vmwareengine_v1_generated_VmwareEngine_GetPrivateConnection_sync", - "title": "Snippet for the get_private_connection call in the VmwareEngine service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#get_private_connection.", - "file": "vmware_engine/get_private_connection.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_private_connection", - "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#get_private_connection", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VmwareEngine::V1::GetPrivateConnectionRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::VmwareEngine::V1::PrivateConnection", - "client": { - "short_name": "VmwareEngine::Client", - "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client" - }, - "method": { - "short_name": "GetPrivateConnection", - "full_name": "google.cloud.vmwareengine.v1.VmwareEngine.GetPrivateConnection", - "service": { - "short_name": "VmwareEngine", - "full_name": "google.cloud.vmwareengine.v1.VmwareEngine" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "vmwareengine_v1_generated_VmwareEngine_ListPrivateConnections_sync", - "title": "Snippet for the list_private_connections call in the VmwareEngine service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#list_private_connections.", - "file": "vmware_engine/list_private_connections.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_private_connections", - "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#list_private_connections", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VmwareEngine::V1::ListPrivateConnectionsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::VmwareEngine::V1::ListPrivateConnectionsResponse", - "client": { - "short_name": "VmwareEngine::Client", - "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client" - }, - "method": { - "short_name": "ListPrivateConnections", - "full_name": "google.cloud.vmwareengine.v1.VmwareEngine.ListPrivateConnections", - "service": { - "short_name": "VmwareEngine", - "full_name": "google.cloud.vmwareengine.v1.VmwareEngine" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "vmwareengine_v1_generated_VmwareEngine_UpdatePrivateConnection_sync", - "title": "Snippet for the update_private_connection call in the VmwareEngine service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#update_private_connection.", - "file": "vmware_engine/update_private_connection.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_private_connection", - "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#update_private_connection", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VmwareEngine::V1::UpdatePrivateConnectionRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "VmwareEngine::Client", - "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client" - }, - "method": { - "short_name": "UpdatePrivateConnection", - "full_name": "google.cloud.vmwareengine.v1.VmwareEngine.UpdatePrivateConnection", - "service": { - "short_name": "VmwareEngine", - "full_name": "google.cloud.vmwareengine.v1.VmwareEngine" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "vmwareengine_v1_generated_VmwareEngine_DeletePrivateConnection_sync", - "title": "Snippet for the delete_private_connection call in the VmwareEngine service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#delete_private_connection.", - "file": "vmware_engine/delete_private_connection.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_private_connection", - "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#delete_private_connection", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VmwareEngine::V1::DeletePrivateConnectionRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "VmwareEngine::Client", - "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client" - }, - "method": { - "short_name": "DeletePrivateConnection", - "full_name": "google.cloud.vmwareengine.v1.VmwareEngine.DeletePrivateConnection", - "service": { - "short_name": "VmwareEngine", - "full_name": "google.cloud.vmwareengine.v1.VmwareEngine" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "vmwareengine_v1_generated_VmwareEngine_ListPrivateConnectionPeeringRoutes_sync", - "title": "Snippet for the list_private_connection_peering_routes call in the VmwareEngine service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#list_private_connection_peering_routes.", - "file": "vmware_engine/list_private_connection_peering_routes.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_private_connection_peering_routes", - "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#list_private_connection_peering_routes", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VmwareEngine::V1::ListPrivateConnectionPeeringRoutesRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::VmwareEngine::V1::ListPrivateConnectionPeeringRoutesResponse", - "client": { - "short_name": "VmwareEngine::Client", - "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client" - }, - "method": { - "short_name": "ListPrivateConnectionPeeringRoutes", - "full_name": "google.cloud.vmwareengine.v1.VmwareEngine.ListPrivateConnectionPeeringRoutes", - "service": { - "short_name": "VmwareEngine", - "full_name": "google.cloud.vmwareengine.v1.VmwareEngine" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "vmwareengine_v1_generated_VmwareEngine_GrantDnsBindPermission_sync", - "title": "Snippet for the grant_dns_bind_permission call in the VmwareEngine service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#grant_dns_bind_permission.", - "file": "vmware_engine/grant_dns_bind_permission.rb", - "language": "RUBY", - "client_method": { - "short_name": "grant_dns_bind_permission", - "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#grant_dns_bind_permission", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VmwareEngine::V1::GrantDnsBindPermissionRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "VmwareEngine::Client", - "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client" - }, - "method": { - "short_name": "GrantDnsBindPermission", - "full_name": "google.cloud.vmwareengine.v1.VmwareEngine.GrantDnsBindPermission", - "service": { - "short_name": "VmwareEngine", - "full_name": "google.cloud.vmwareengine.v1.VmwareEngine" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "vmwareengine_v1_generated_VmwareEngine_GetDnsBindPermission_sync", - "title": "Snippet for the get_dns_bind_permission call in the VmwareEngine service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#get_dns_bind_permission.", - "file": "vmware_engine/get_dns_bind_permission.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_dns_bind_permission", - "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#get_dns_bind_permission", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VmwareEngine::V1::GetDnsBindPermissionRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::VmwareEngine::V1::DnsBindPermission", - "client": { - "short_name": "VmwareEngine::Client", - "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client" - }, - "method": { - "short_name": "GetDnsBindPermission", - "full_name": "google.cloud.vmwareengine.v1.VmwareEngine.GetDnsBindPermission", - "service": { - "short_name": "VmwareEngine", - "full_name": "google.cloud.vmwareengine.v1.VmwareEngine" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "vmwareengine_v1_generated_VmwareEngine_RevokeDnsBindPermission_sync", - "title": "Snippet for the revoke_dns_bind_permission call in the VmwareEngine service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#revoke_dns_bind_permission.", - "file": "vmware_engine/revoke_dns_bind_permission.rb", - "language": "RUBY", - "client_method": { - "short_name": "revoke_dns_bind_permission", - "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client#revoke_dns_bind_permission", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VmwareEngine::V1::RevokeDnsBindPermissionRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "VmwareEngine::Client", - "full_name": "::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client" - }, - "method": { - "short_name": "RevokeDnsBindPermission", - "full_name": "google.cloud.vmwareengine.v1.VmwareEngine.RevokeDnsBindPermission", - "service": { - "short_name": "VmwareEngine", - "full_name": "google.cloud.vmwareengine.v1.VmwareEngine" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - } - ] -} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/create_cluster.rb b/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/create_cluster.rb deleted file mode 100644 index c1d3b448c05c..000000000000 --- a/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/create_cluster.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 vmwareengine_v1_generated_VmwareEngine_CreateCluster_sync] -require "google/cloud/vmware_engine/v1" - -## -# Snippet for the create_cluster call in the VmwareEngine 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::VmwareEngine::V1::VmwareEngine::Client#create_cluster. -# -def create_cluster - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VmwareEngine::V1::CreateClusterRequest.new - - # Call the create_cluster method. - result = client.create_cluster 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 vmwareengine_v1_generated_VmwareEngine_CreateCluster_sync] diff --git a/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/create_external_access_rule.rb b/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/create_external_access_rule.rb deleted file mode 100644 index 8ee5aac97ef9..000000000000 --- a/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/create_external_access_rule.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 vmwareengine_v1_generated_VmwareEngine_CreateExternalAccessRule_sync] -require "google/cloud/vmware_engine/v1" - -## -# Snippet for the create_external_access_rule call in the VmwareEngine 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::VmwareEngine::V1::VmwareEngine::Client#create_external_access_rule. -# -def create_external_access_rule - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VmwareEngine::V1::CreateExternalAccessRuleRequest.new - - # Call the create_external_access_rule method. - result = client.create_external_access_rule 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 vmwareengine_v1_generated_VmwareEngine_CreateExternalAccessRule_sync] diff --git a/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/create_external_address.rb b/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/create_external_address.rb deleted file mode 100644 index 40b8e4135dff..000000000000 --- a/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/create_external_address.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 vmwareengine_v1_generated_VmwareEngine_CreateExternalAddress_sync] -require "google/cloud/vmware_engine/v1" - -## -# Snippet for the create_external_address call in the VmwareEngine 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::VmwareEngine::V1::VmwareEngine::Client#create_external_address. -# -def create_external_address - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VmwareEngine::V1::CreateExternalAddressRequest.new - - # Call the create_external_address method. - result = client.create_external_address 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 vmwareengine_v1_generated_VmwareEngine_CreateExternalAddress_sync] diff --git a/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/create_hcx_activation_key.rb b/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/create_hcx_activation_key.rb deleted file mode 100644 index ccfa0e7407e3..000000000000 --- a/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/create_hcx_activation_key.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 vmwareengine_v1_generated_VmwareEngine_CreateHcxActivationKey_sync] -require "google/cloud/vmware_engine/v1" - -## -# Snippet for the create_hcx_activation_key call in the VmwareEngine 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::VmwareEngine::V1::VmwareEngine::Client#create_hcx_activation_key. -# -def create_hcx_activation_key - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VmwareEngine::V1::CreateHcxActivationKeyRequest.new - - # Call the create_hcx_activation_key method. - result = client.create_hcx_activation_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 vmwareengine_v1_generated_VmwareEngine_CreateHcxActivationKey_sync] diff --git a/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/create_logging_server.rb b/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/create_logging_server.rb deleted file mode 100644 index 6f0b22a73980..000000000000 --- a/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/create_logging_server.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 vmwareengine_v1_generated_VmwareEngine_CreateLoggingServer_sync] -require "google/cloud/vmware_engine/v1" - -## -# Snippet for the create_logging_server call in the VmwareEngine 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::VmwareEngine::V1::VmwareEngine::Client#create_logging_server. -# -def create_logging_server - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VmwareEngine::V1::CreateLoggingServerRequest.new - - # Call the create_logging_server method. - result = client.create_logging_server 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 vmwareengine_v1_generated_VmwareEngine_CreateLoggingServer_sync] diff --git a/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/create_management_dns_zone_binding.rb b/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/create_management_dns_zone_binding.rb deleted file mode 100644 index 705320379d75..000000000000 --- a/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/create_management_dns_zone_binding.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 vmwareengine_v1_generated_VmwareEngine_CreateManagementDnsZoneBinding_sync] -require "google/cloud/vmware_engine/v1" - -## -# Snippet for the create_management_dns_zone_binding call in the VmwareEngine 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::VmwareEngine::V1::VmwareEngine::Client#create_management_dns_zone_binding. -# -def create_management_dns_zone_binding - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VmwareEngine::V1::CreateManagementDnsZoneBindingRequest.new - - # Call the create_management_dns_zone_binding method. - result = client.create_management_dns_zone_binding 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 vmwareengine_v1_generated_VmwareEngine_CreateManagementDnsZoneBinding_sync] diff --git a/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/create_network_peering.rb b/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/create_network_peering.rb deleted file mode 100644 index 7547d9392753..000000000000 --- a/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/create_network_peering.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 vmwareengine_v1_generated_VmwareEngine_CreateNetworkPeering_sync] -require "google/cloud/vmware_engine/v1" - -## -# Snippet for the create_network_peering call in the VmwareEngine 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::VmwareEngine::V1::VmwareEngine::Client#create_network_peering. -# -def create_network_peering - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VmwareEngine::V1::CreateNetworkPeeringRequest.new - - # Call the create_network_peering method. - result = client.create_network_peering 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 vmwareengine_v1_generated_VmwareEngine_CreateNetworkPeering_sync] diff --git a/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/create_network_policy.rb b/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/create_network_policy.rb deleted file mode 100644 index 86f1818e50be..000000000000 --- a/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/create_network_policy.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 vmwareengine_v1_generated_VmwareEngine_CreateNetworkPolicy_sync] -require "google/cloud/vmware_engine/v1" - -## -# Snippet for the create_network_policy call in the VmwareEngine 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::VmwareEngine::V1::VmwareEngine::Client#create_network_policy. -# -def create_network_policy - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VmwareEngine::V1::CreateNetworkPolicyRequest.new - - # Call the create_network_policy method. - result = client.create_network_policy 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 vmwareengine_v1_generated_VmwareEngine_CreateNetworkPolicy_sync] diff --git a/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/create_private_cloud.rb b/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/create_private_cloud.rb deleted file mode 100644 index 894c286acc03..000000000000 --- a/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/create_private_cloud.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 vmwareengine_v1_generated_VmwareEngine_CreatePrivateCloud_sync] -require "google/cloud/vmware_engine/v1" - -## -# Snippet for the create_private_cloud call in the VmwareEngine 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::VmwareEngine::V1::VmwareEngine::Client#create_private_cloud. -# -def create_private_cloud - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VmwareEngine::V1::CreatePrivateCloudRequest.new - - # Call the create_private_cloud method. - result = client.create_private_cloud 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 vmwareengine_v1_generated_VmwareEngine_CreatePrivateCloud_sync] diff --git a/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/create_private_connection.rb b/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/create_private_connection.rb deleted file mode 100644 index 9d5ce8c5422b..000000000000 --- a/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/create_private_connection.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 vmwareengine_v1_generated_VmwareEngine_CreatePrivateConnection_sync] -require "google/cloud/vmware_engine/v1" - -## -# Snippet for the create_private_connection call in the VmwareEngine 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::VmwareEngine::V1::VmwareEngine::Client#create_private_connection. -# -def create_private_connection - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VmwareEngine::V1::CreatePrivateConnectionRequest.new - - # Call the create_private_connection method. - result = client.create_private_connection 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 vmwareengine_v1_generated_VmwareEngine_CreatePrivateConnection_sync] diff --git a/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/create_vmware_engine_network.rb b/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/create_vmware_engine_network.rb deleted file mode 100644 index c1866d22fd37..000000000000 --- a/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/create_vmware_engine_network.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 vmwareengine_v1_generated_VmwareEngine_CreateVmwareEngineNetwork_sync] -require "google/cloud/vmware_engine/v1" - -## -# Snippet for the create_vmware_engine_network call in the VmwareEngine 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::VmwareEngine::V1::VmwareEngine::Client#create_vmware_engine_network. -# -def create_vmware_engine_network - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VmwareEngine::V1::CreateVmwareEngineNetworkRequest.new - - # Call the create_vmware_engine_network method. - result = client.create_vmware_engine_network 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 vmwareengine_v1_generated_VmwareEngine_CreateVmwareEngineNetwork_sync] diff --git a/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/delete_cluster.rb b/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/delete_cluster.rb deleted file mode 100644 index 1e33f442bf74..000000000000 --- a/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/delete_cluster.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 vmwareengine_v1_generated_VmwareEngine_DeleteCluster_sync] -require "google/cloud/vmware_engine/v1" - -## -# Snippet for the delete_cluster call in the VmwareEngine 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::VmwareEngine::V1::VmwareEngine::Client#delete_cluster. -# -def delete_cluster - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VmwareEngine::V1::DeleteClusterRequest.new - - # Call the delete_cluster method. - result = client.delete_cluster 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 vmwareengine_v1_generated_VmwareEngine_DeleteCluster_sync] diff --git a/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/delete_external_access_rule.rb b/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/delete_external_access_rule.rb deleted file mode 100644 index 0dfb467dae50..000000000000 --- a/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/delete_external_access_rule.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 vmwareengine_v1_generated_VmwareEngine_DeleteExternalAccessRule_sync] -require "google/cloud/vmware_engine/v1" - -## -# Snippet for the delete_external_access_rule call in the VmwareEngine 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::VmwareEngine::V1::VmwareEngine::Client#delete_external_access_rule. -# -def delete_external_access_rule - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VmwareEngine::V1::DeleteExternalAccessRuleRequest.new - - # Call the delete_external_access_rule method. - result = client.delete_external_access_rule 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 vmwareengine_v1_generated_VmwareEngine_DeleteExternalAccessRule_sync] diff --git a/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/delete_external_address.rb b/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/delete_external_address.rb deleted file mode 100644 index 502564662bc7..000000000000 --- a/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/delete_external_address.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 vmwareengine_v1_generated_VmwareEngine_DeleteExternalAddress_sync] -require "google/cloud/vmware_engine/v1" - -## -# Snippet for the delete_external_address call in the VmwareEngine 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::VmwareEngine::V1::VmwareEngine::Client#delete_external_address. -# -def delete_external_address - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VmwareEngine::V1::DeleteExternalAddressRequest.new - - # Call the delete_external_address method. - result = client.delete_external_address 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 vmwareengine_v1_generated_VmwareEngine_DeleteExternalAddress_sync] diff --git a/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/delete_logging_server.rb b/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/delete_logging_server.rb deleted file mode 100644 index 08a25d05493c..000000000000 --- a/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/delete_logging_server.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 vmwareengine_v1_generated_VmwareEngine_DeleteLoggingServer_sync] -require "google/cloud/vmware_engine/v1" - -## -# Snippet for the delete_logging_server call in the VmwareEngine 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::VmwareEngine::V1::VmwareEngine::Client#delete_logging_server. -# -def delete_logging_server - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VmwareEngine::V1::DeleteLoggingServerRequest.new - - # Call the delete_logging_server method. - result = client.delete_logging_server 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 vmwareengine_v1_generated_VmwareEngine_DeleteLoggingServer_sync] diff --git a/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/delete_management_dns_zone_binding.rb b/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/delete_management_dns_zone_binding.rb deleted file mode 100644 index 2a8869d82c59..000000000000 --- a/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/delete_management_dns_zone_binding.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 vmwareengine_v1_generated_VmwareEngine_DeleteManagementDnsZoneBinding_sync] -require "google/cloud/vmware_engine/v1" - -## -# Snippet for the delete_management_dns_zone_binding call in the VmwareEngine 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::VmwareEngine::V1::VmwareEngine::Client#delete_management_dns_zone_binding. -# -def delete_management_dns_zone_binding - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VmwareEngine::V1::DeleteManagementDnsZoneBindingRequest.new - - # Call the delete_management_dns_zone_binding method. - result = client.delete_management_dns_zone_binding 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 vmwareengine_v1_generated_VmwareEngine_DeleteManagementDnsZoneBinding_sync] diff --git a/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/delete_network_peering.rb b/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/delete_network_peering.rb deleted file mode 100644 index 9bbf47b03d87..000000000000 --- a/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/delete_network_peering.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 vmwareengine_v1_generated_VmwareEngine_DeleteNetworkPeering_sync] -require "google/cloud/vmware_engine/v1" - -## -# Snippet for the delete_network_peering call in the VmwareEngine 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::VmwareEngine::V1::VmwareEngine::Client#delete_network_peering. -# -def delete_network_peering - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VmwareEngine::V1::DeleteNetworkPeeringRequest.new - - # Call the delete_network_peering method. - result = client.delete_network_peering 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 vmwareengine_v1_generated_VmwareEngine_DeleteNetworkPeering_sync] diff --git a/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/delete_network_policy.rb b/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/delete_network_policy.rb deleted file mode 100644 index 290a6046b537..000000000000 --- a/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/delete_network_policy.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 vmwareengine_v1_generated_VmwareEngine_DeleteNetworkPolicy_sync] -require "google/cloud/vmware_engine/v1" - -## -# Snippet for the delete_network_policy call in the VmwareEngine 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::VmwareEngine::V1::VmwareEngine::Client#delete_network_policy. -# -def delete_network_policy - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VmwareEngine::V1::DeleteNetworkPolicyRequest.new - - # Call the delete_network_policy method. - result = client.delete_network_policy 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 vmwareengine_v1_generated_VmwareEngine_DeleteNetworkPolicy_sync] diff --git a/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/delete_private_cloud.rb b/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/delete_private_cloud.rb deleted file mode 100644 index da468a8decca..000000000000 --- a/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/delete_private_cloud.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 vmwareengine_v1_generated_VmwareEngine_DeletePrivateCloud_sync] -require "google/cloud/vmware_engine/v1" - -## -# Snippet for the delete_private_cloud call in the VmwareEngine 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::VmwareEngine::V1::VmwareEngine::Client#delete_private_cloud. -# -def delete_private_cloud - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VmwareEngine::V1::DeletePrivateCloudRequest.new - - # Call the delete_private_cloud method. - result = client.delete_private_cloud 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 vmwareengine_v1_generated_VmwareEngine_DeletePrivateCloud_sync] diff --git a/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/delete_private_connection.rb b/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/delete_private_connection.rb deleted file mode 100644 index 02677b314501..000000000000 --- a/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/delete_private_connection.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 vmwareengine_v1_generated_VmwareEngine_DeletePrivateConnection_sync] -require "google/cloud/vmware_engine/v1" - -## -# Snippet for the delete_private_connection call in the VmwareEngine 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::VmwareEngine::V1::VmwareEngine::Client#delete_private_connection. -# -def delete_private_connection - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VmwareEngine::V1::DeletePrivateConnectionRequest.new - - # Call the delete_private_connection method. - result = client.delete_private_connection 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 vmwareengine_v1_generated_VmwareEngine_DeletePrivateConnection_sync] diff --git a/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/delete_vmware_engine_network.rb b/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/delete_vmware_engine_network.rb deleted file mode 100644 index db97d515645b..000000000000 --- a/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/delete_vmware_engine_network.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 vmwareengine_v1_generated_VmwareEngine_DeleteVmwareEngineNetwork_sync] -require "google/cloud/vmware_engine/v1" - -## -# Snippet for the delete_vmware_engine_network call in the VmwareEngine 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::VmwareEngine::V1::VmwareEngine::Client#delete_vmware_engine_network. -# -def delete_vmware_engine_network - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VmwareEngine::V1::DeleteVmwareEngineNetworkRequest.new - - # Call the delete_vmware_engine_network method. - result = client.delete_vmware_engine_network 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 vmwareengine_v1_generated_VmwareEngine_DeleteVmwareEngineNetwork_sync] diff --git a/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/fetch_network_policy_external_addresses.rb b/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/fetch_network_policy_external_addresses.rb deleted file mode 100644 index a684ee02bf9c..000000000000 --- a/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/fetch_network_policy_external_addresses.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 vmwareengine_v1_generated_VmwareEngine_FetchNetworkPolicyExternalAddresses_sync] -require "google/cloud/vmware_engine/v1" - -## -# Snippet for the fetch_network_policy_external_addresses call in the VmwareEngine 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::VmwareEngine::V1::VmwareEngine::Client#fetch_network_policy_external_addresses. -# -def fetch_network_policy_external_addresses - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VmwareEngine::V1::FetchNetworkPolicyExternalAddressesRequest.new - - # Call the fetch_network_policy_external_addresses method. - result = client.fetch_network_policy_external_addresses 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::VmwareEngine::V1::ExternalAddress. - p item - end -end -# [END vmwareengine_v1_generated_VmwareEngine_FetchNetworkPolicyExternalAddresses_sync] diff --git a/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/get_cluster.rb b/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/get_cluster.rb deleted file mode 100644 index 6abc99ffb6a0..000000000000 --- a/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/get_cluster.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 vmwareengine_v1_generated_VmwareEngine_GetCluster_sync] -require "google/cloud/vmware_engine/v1" - -## -# Snippet for the get_cluster call in the VmwareEngine 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::VmwareEngine::V1::VmwareEngine::Client#get_cluster. -# -def get_cluster - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VmwareEngine::V1::GetClusterRequest.new - - # Call the get_cluster method. - result = client.get_cluster request - - # The returned object is of type Google::Cloud::VmwareEngine::V1::Cluster. - p result -end -# [END vmwareengine_v1_generated_VmwareEngine_GetCluster_sync] diff --git a/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/get_dns_bind_permission.rb b/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/get_dns_bind_permission.rb deleted file mode 100644 index 60679492c7dc..000000000000 --- a/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/get_dns_bind_permission.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 vmwareengine_v1_generated_VmwareEngine_GetDnsBindPermission_sync] -require "google/cloud/vmware_engine/v1" - -## -# Snippet for the get_dns_bind_permission call in the VmwareEngine 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::VmwareEngine::V1::VmwareEngine::Client#get_dns_bind_permission. -# -def get_dns_bind_permission - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VmwareEngine::V1::GetDnsBindPermissionRequest.new - - # Call the get_dns_bind_permission method. - result = client.get_dns_bind_permission request - - # The returned object is of type Google::Cloud::VmwareEngine::V1::DnsBindPermission. - p result -end -# [END vmwareengine_v1_generated_VmwareEngine_GetDnsBindPermission_sync] diff --git a/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/get_dns_forwarding.rb b/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/get_dns_forwarding.rb deleted file mode 100644 index 1f3200ffbbfd..000000000000 --- a/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/get_dns_forwarding.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 vmwareengine_v1_generated_VmwareEngine_GetDnsForwarding_sync] -require "google/cloud/vmware_engine/v1" - -## -# Snippet for the get_dns_forwarding call in the VmwareEngine 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::VmwareEngine::V1::VmwareEngine::Client#get_dns_forwarding. -# -def get_dns_forwarding - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VmwareEngine::V1::GetDnsForwardingRequest.new - - # Call the get_dns_forwarding method. - result = client.get_dns_forwarding request - - # The returned object is of type Google::Cloud::VmwareEngine::V1::DnsForwarding. - p result -end -# [END vmwareengine_v1_generated_VmwareEngine_GetDnsForwarding_sync] diff --git a/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/get_external_access_rule.rb b/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/get_external_access_rule.rb deleted file mode 100644 index 5c8da5284071..000000000000 --- a/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/get_external_access_rule.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 vmwareengine_v1_generated_VmwareEngine_GetExternalAccessRule_sync] -require "google/cloud/vmware_engine/v1" - -## -# Snippet for the get_external_access_rule call in the VmwareEngine 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::VmwareEngine::V1::VmwareEngine::Client#get_external_access_rule. -# -def get_external_access_rule - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VmwareEngine::V1::GetExternalAccessRuleRequest.new - - # Call the get_external_access_rule method. - result = client.get_external_access_rule request - - # The returned object is of type Google::Cloud::VmwareEngine::V1::ExternalAccessRule. - p result -end -# [END vmwareengine_v1_generated_VmwareEngine_GetExternalAccessRule_sync] diff --git a/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/get_external_address.rb b/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/get_external_address.rb deleted file mode 100644 index d6a0f6b95f53..000000000000 --- a/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/get_external_address.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 vmwareengine_v1_generated_VmwareEngine_GetExternalAddress_sync] -require "google/cloud/vmware_engine/v1" - -## -# Snippet for the get_external_address call in the VmwareEngine 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::VmwareEngine::V1::VmwareEngine::Client#get_external_address. -# -def get_external_address - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VmwareEngine::V1::GetExternalAddressRequest.new - - # Call the get_external_address method. - result = client.get_external_address request - - # The returned object is of type Google::Cloud::VmwareEngine::V1::ExternalAddress. - p result -end -# [END vmwareengine_v1_generated_VmwareEngine_GetExternalAddress_sync] diff --git a/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/get_hcx_activation_key.rb b/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/get_hcx_activation_key.rb deleted file mode 100644 index b10579599794..000000000000 --- a/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/get_hcx_activation_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 vmwareengine_v1_generated_VmwareEngine_GetHcxActivationKey_sync] -require "google/cloud/vmware_engine/v1" - -## -# Snippet for the get_hcx_activation_key call in the VmwareEngine 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::VmwareEngine::V1::VmwareEngine::Client#get_hcx_activation_key. -# -def get_hcx_activation_key - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VmwareEngine::V1::GetHcxActivationKeyRequest.new - - # Call the get_hcx_activation_key method. - result = client.get_hcx_activation_key request - - # The returned object is of type Google::Cloud::VmwareEngine::V1::HcxActivationKey. - p result -end -# [END vmwareengine_v1_generated_VmwareEngine_GetHcxActivationKey_sync] diff --git a/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/get_logging_server.rb b/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/get_logging_server.rb deleted file mode 100644 index a7ee3f508b4d..000000000000 --- a/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/get_logging_server.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 vmwareengine_v1_generated_VmwareEngine_GetLoggingServer_sync] -require "google/cloud/vmware_engine/v1" - -## -# Snippet for the get_logging_server call in the VmwareEngine 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::VmwareEngine::V1::VmwareEngine::Client#get_logging_server. -# -def get_logging_server - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VmwareEngine::V1::GetLoggingServerRequest.new - - # Call the get_logging_server method. - result = client.get_logging_server request - - # The returned object is of type Google::Cloud::VmwareEngine::V1::LoggingServer. - p result -end -# [END vmwareengine_v1_generated_VmwareEngine_GetLoggingServer_sync] diff --git a/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/get_management_dns_zone_binding.rb b/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/get_management_dns_zone_binding.rb deleted file mode 100644 index 6eb63dd0d81d..000000000000 --- a/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/get_management_dns_zone_binding.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 vmwareengine_v1_generated_VmwareEngine_GetManagementDnsZoneBinding_sync] -require "google/cloud/vmware_engine/v1" - -## -# Snippet for the get_management_dns_zone_binding call in the VmwareEngine 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::VmwareEngine::V1::VmwareEngine::Client#get_management_dns_zone_binding. -# -def get_management_dns_zone_binding - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VmwareEngine::V1::GetManagementDnsZoneBindingRequest.new - - # Call the get_management_dns_zone_binding method. - result = client.get_management_dns_zone_binding request - - # The returned object is of type Google::Cloud::VmwareEngine::V1::ManagementDnsZoneBinding. - p result -end -# [END vmwareengine_v1_generated_VmwareEngine_GetManagementDnsZoneBinding_sync] diff --git a/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/get_network_peering.rb b/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/get_network_peering.rb deleted file mode 100644 index 811421641e9f..000000000000 --- a/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/get_network_peering.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 vmwareengine_v1_generated_VmwareEngine_GetNetworkPeering_sync] -require "google/cloud/vmware_engine/v1" - -## -# Snippet for the get_network_peering call in the VmwareEngine 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::VmwareEngine::V1::VmwareEngine::Client#get_network_peering. -# -def get_network_peering - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VmwareEngine::V1::GetNetworkPeeringRequest.new - - # Call the get_network_peering method. - result = client.get_network_peering request - - # The returned object is of type Google::Cloud::VmwareEngine::V1::NetworkPeering. - p result -end -# [END vmwareengine_v1_generated_VmwareEngine_GetNetworkPeering_sync] diff --git a/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/get_network_policy.rb b/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/get_network_policy.rb deleted file mode 100644 index 72d4fcb4e2a5..000000000000 --- a/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/get_network_policy.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 vmwareengine_v1_generated_VmwareEngine_GetNetworkPolicy_sync] -require "google/cloud/vmware_engine/v1" - -## -# Snippet for the get_network_policy call in the VmwareEngine 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::VmwareEngine::V1::VmwareEngine::Client#get_network_policy. -# -def get_network_policy - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VmwareEngine::V1::GetNetworkPolicyRequest.new - - # Call the get_network_policy method. - result = client.get_network_policy request - - # The returned object is of type Google::Cloud::VmwareEngine::V1::NetworkPolicy. - p result -end -# [END vmwareengine_v1_generated_VmwareEngine_GetNetworkPolicy_sync] diff --git a/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/get_node.rb b/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/get_node.rb deleted file mode 100644 index 7e1f1af0378b..000000000000 --- a/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/get_node.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 vmwareengine_v1_generated_VmwareEngine_GetNode_sync] -require "google/cloud/vmware_engine/v1" - -## -# Snippet for the get_node call in the VmwareEngine 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::VmwareEngine::V1::VmwareEngine::Client#get_node. -# -def get_node - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VmwareEngine::V1::GetNodeRequest.new - - # Call the get_node method. - result = client.get_node request - - # The returned object is of type Google::Cloud::VmwareEngine::V1::Node. - p result -end -# [END vmwareengine_v1_generated_VmwareEngine_GetNode_sync] diff --git a/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/get_node_type.rb b/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/get_node_type.rb deleted file mode 100644 index 0a56485917ff..000000000000 --- a/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/get_node_type.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 vmwareengine_v1_generated_VmwareEngine_GetNodeType_sync] -require "google/cloud/vmware_engine/v1" - -## -# Snippet for the get_node_type call in the VmwareEngine 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::VmwareEngine::V1::VmwareEngine::Client#get_node_type. -# -def get_node_type - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VmwareEngine::V1::GetNodeTypeRequest.new - - # Call the get_node_type method. - result = client.get_node_type request - - # The returned object is of type Google::Cloud::VmwareEngine::V1::NodeType. - p result -end -# [END vmwareengine_v1_generated_VmwareEngine_GetNodeType_sync] diff --git a/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/get_private_cloud.rb b/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/get_private_cloud.rb deleted file mode 100644 index 0f387793c62a..000000000000 --- a/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/get_private_cloud.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 vmwareengine_v1_generated_VmwareEngine_GetPrivateCloud_sync] -require "google/cloud/vmware_engine/v1" - -## -# Snippet for the get_private_cloud call in the VmwareEngine 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::VmwareEngine::V1::VmwareEngine::Client#get_private_cloud. -# -def get_private_cloud - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VmwareEngine::V1::GetPrivateCloudRequest.new - - # Call the get_private_cloud method. - result = client.get_private_cloud request - - # The returned object is of type Google::Cloud::VmwareEngine::V1::PrivateCloud. - p result -end -# [END vmwareengine_v1_generated_VmwareEngine_GetPrivateCloud_sync] diff --git a/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/get_private_connection.rb b/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/get_private_connection.rb deleted file mode 100644 index 663702bf7df3..000000000000 --- a/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/get_private_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 vmwareengine_v1_generated_VmwareEngine_GetPrivateConnection_sync] -require "google/cloud/vmware_engine/v1" - -## -# Snippet for the get_private_connection call in the VmwareEngine 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::VmwareEngine::V1::VmwareEngine::Client#get_private_connection. -# -def get_private_connection - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VmwareEngine::V1::GetPrivateConnectionRequest.new - - # Call the get_private_connection method. - result = client.get_private_connection request - - # The returned object is of type Google::Cloud::VmwareEngine::V1::PrivateConnection. - p result -end -# [END vmwareengine_v1_generated_VmwareEngine_GetPrivateConnection_sync] diff --git a/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/get_subnet.rb b/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/get_subnet.rb deleted file mode 100644 index 994eefdd422d..000000000000 --- a/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/get_subnet.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 vmwareengine_v1_generated_VmwareEngine_GetSubnet_sync] -require "google/cloud/vmware_engine/v1" - -## -# Snippet for the get_subnet call in the VmwareEngine 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::VmwareEngine::V1::VmwareEngine::Client#get_subnet. -# -def get_subnet - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VmwareEngine::V1::GetSubnetRequest.new - - # Call the get_subnet method. - result = client.get_subnet request - - # The returned object is of type Google::Cloud::VmwareEngine::V1::Subnet. - p result -end -# [END vmwareengine_v1_generated_VmwareEngine_GetSubnet_sync] diff --git a/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/get_vmware_engine_network.rb b/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/get_vmware_engine_network.rb deleted file mode 100644 index f7b1a8dfa0fe..000000000000 --- a/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/get_vmware_engine_network.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 vmwareengine_v1_generated_VmwareEngine_GetVmwareEngineNetwork_sync] -require "google/cloud/vmware_engine/v1" - -## -# Snippet for the get_vmware_engine_network call in the VmwareEngine 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::VmwareEngine::V1::VmwareEngine::Client#get_vmware_engine_network. -# -def get_vmware_engine_network - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VmwareEngine::V1::GetVmwareEngineNetworkRequest.new - - # Call the get_vmware_engine_network method. - result = client.get_vmware_engine_network request - - # The returned object is of type Google::Cloud::VmwareEngine::V1::VmwareEngineNetwork. - p result -end -# [END vmwareengine_v1_generated_VmwareEngine_GetVmwareEngineNetwork_sync] diff --git a/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/grant_dns_bind_permission.rb b/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/grant_dns_bind_permission.rb deleted file mode 100644 index cd8f39bf2e04..000000000000 --- a/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/grant_dns_bind_permission.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 vmwareengine_v1_generated_VmwareEngine_GrantDnsBindPermission_sync] -require "google/cloud/vmware_engine/v1" - -## -# Snippet for the grant_dns_bind_permission call in the VmwareEngine 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::VmwareEngine::V1::VmwareEngine::Client#grant_dns_bind_permission. -# -def grant_dns_bind_permission - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VmwareEngine::V1::GrantDnsBindPermissionRequest.new - - # Call the grant_dns_bind_permission method. - result = client.grant_dns_bind_permission 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 vmwareengine_v1_generated_VmwareEngine_GrantDnsBindPermission_sync] diff --git a/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/list_clusters.rb b/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/list_clusters.rb deleted file mode 100644 index 76733bf18bce..000000000000 --- a/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/list_clusters.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 vmwareengine_v1_generated_VmwareEngine_ListClusters_sync] -require "google/cloud/vmware_engine/v1" - -## -# Snippet for the list_clusters call in the VmwareEngine 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::VmwareEngine::V1::VmwareEngine::Client#list_clusters. -# -def list_clusters - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VmwareEngine::V1::ListClustersRequest.new - - # Call the list_clusters method. - result = client.list_clusters 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::VmwareEngine::V1::Cluster. - p item - end -end -# [END vmwareengine_v1_generated_VmwareEngine_ListClusters_sync] diff --git a/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/list_external_access_rules.rb b/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/list_external_access_rules.rb deleted file mode 100644 index 2267ce286f6f..000000000000 --- a/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/list_external_access_rules.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 vmwareengine_v1_generated_VmwareEngine_ListExternalAccessRules_sync] -require "google/cloud/vmware_engine/v1" - -## -# Snippet for the list_external_access_rules call in the VmwareEngine 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::VmwareEngine::V1::VmwareEngine::Client#list_external_access_rules. -# -def list_external_access_rules - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VmwareEngine::V1::ListExternalAccessRulesRequest.new - - # Call the list_external_access_rules method. - result = client.list_external_access_rules 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::VmwareEngine::V1::ExternalAccessRule. - p item - end -end -# [END vmwareengine_v1_generated_VmwareEngine_ListExternalAccessRules_sync] diff --git a/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/list_external_addresses.rb b/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/list_external_addresses.rb deleted file mode 100644 index 363ec3743256..000000000000 --- a/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/list_external_addresses.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 vmwareengine_v1_generated_VmwareEngine_ListExternalAddresses_sync] -require "google/cloud/vmware_engine/v1" - -## -# Snippet for the list_external_addresses call in the VmwareEngine 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::VmwareEngine::V1::VmwareEngine::Client#list_external_addresses. -# -def list_external_addresses - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VmwareEngine::V1::ListExternalAddressesRequest.new - - # Call the list_external_addresses method. - result = client.list_external_addresses 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::VmwareEngine::V1::ExternalAddress. - p item - end -end -# [END vmwareengine_v1_generated_VmwareEngine_ListExternalAddresses_sync] diff --git a/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/list_hcx_activation_keys.rb b/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/list_hcx_activation_keys.rb deleted file mode 100644 index 56576409e6c4..000000000000 --- a/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/list_hcx_activation_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 vmwareengine_v1_generated_VmwareEngine_ListHcxActivationKeys_sync] -require "google/cloud/vmware_engine/v1" - -## -# Snippet for the list_hcx_activation_keys call in the VmwareEngine 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::VmwareEngine::V1::VmwareEngine::Client#list_hcx_activation_keys. -# -def list_hcx_activation_keys - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VmwareEngine::V1::ListHcxActivationKeysRequest.new - - # Call the list_hcx_activation_keys method. - result = client.list_hcx_activation_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::VmwareEngine::V1::HcxActivationKey. - p item - end -end -# [END vmwareengine_v1_generated_VmwareEngine_ListHcxActivationKeys_sync] diff --git a/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/list_logging_servers.rb b/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/list_logging_servers.rb deleted file mode 100644 index 96abe00561a5..000000000000 --- a/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/list_logging_servers.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 vmwareengine_v1_generated_VmwareEngine_ListLoggingServers_sync] -require "google/cloud/vmware_engine/v1" - -## -# Snippet for the list_logging_servers call in the VmwareEngine 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::VmwareEngine::V1::VmwareEngine::Client#list_logging_servers. -# -def list_logging_servers - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VmwareEngine::V1::ListLoggingServersRequest.new - - # Call the list_logging_servers method. - result = client.list_logging_servers 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::VmwareEngine::V1::LoggingServer. - p item - end -end -# [END vmwareengine_v1_generated_VmwareEngine_ListLoggingServers_sync] diff --git a/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/list_management_dns_zone_bindings.rb b/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/list_management_dns_zone_bindings.rb deleted file mode 100644 index 9183d165c8ec..000000000000 --- a/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/list_management_dns_zone_bindings.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 vmwareengine_v1_generated_VmwareEngine_ListManagementDnsZoneBindings_sync] -require "google/cloud/vmware_engine/v1" - -## -# Snippet for the list_management_dns_zone_bindings call in the VmwareEngine 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::VmwareEngine::V1::VmwareEngine::Client#list_management_dns_zone_bindings. -# -def list_management_dns_zone_bindings - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VmwareEngine::V1::ListManagementDnsZoneBindingsRequest.new - - # Call the list_management_dns_zone_bindings method. - result = client.list_management_dns_zone_bindings 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::VmwareEngine::V1::ManagementDnsZoneBinding. - p item - end -end -# [END vmwareengine_v1_generated_VmwareEngine_ListManagementDnsZoneBindings_sync] diff --git a/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/list_network_peerings.rb b/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/list_network_peerings.rb deleted file mode 100644 index 150bb1c12485..000000000000 --- a/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/list_network_peerings.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 vmwareengine_v1_generated_VmwareEngine_ListNetworkPeerings_sync] -require "google/cloud/vmware_engine/v1" - -## -# Snippet for the list_network_peerings call in the VmwareEngine 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::VmwareEngine::V1::VmwareEngine::Client#list_network_peerings. -# -def list_network_peerings - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VmwareEngine::V1::ListNetworkPeeringsRequest.new - - # Call the list_network_peerings method. - result = client.list_network_peerings 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::VmwareEngine::V1::NetworkPeering. - p item - end -end -# [END vmwareengine_v1_generated_VmwareEngine_ListNetworkPeerings_sync] diff --git a/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/list_network_policies.rb b/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/list_network_policies.rb deleted file mode 100644 index 2aceb11e3161..000000000000 --- a/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/list_network_policies.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 vmwareengine_v1_generated_VmwareEngine_ListNetworkPolicies_sync] -require "google/cloud/vmware_engine/v1" - -## -# Snippet for the list_network_policies call in the VmwareEngine 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::VmwareEngine::V1::VmwareEngine::Client#list_network_policies. -# -def list_network_policies - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VmwareEngine::V1::ListNetworkPoliciesRequest.new - - # Call the list_network_policies method. - result = client.list_network_policies 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::VmwareEngine::V1::NetworkPolicy. - p item - end -end -# [END vmwareengine_v1_generated_VmwareEngine_ListNetworkPolicies_sync] diff --git a/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/list_node_types.rb b/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/list_node_types.rb deleted file mode 100644 index 89c4b160b77d..000000000000 --- a/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/list_node_types.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 vmwareengine_v1_generated_VmwareEngine_ListNodeTypes_sync] -require "google/cloud/vmware_engine/v1" - -## -# Snippet for the list_node_types call in the VmwareEngine 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::VmwareEngine::V1::VmwareEngine::Client#list_node_types. -# -def list_node_types - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VmwareEngine::V1::ListNodeTypesRequest.new - - # Call the list_node_types method. - result = client.list_node_types 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::VmwareEngine::V1::NodeType. - p item - end -end -# [END vmwareengine_v1_generated_VmwareEngine_ListNodeTypes_sync] diff --git a/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/list_nodes.rb b/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/list_nodes.rb deleted file mode 100644 index feba4cc45e28..000000000000 --- a/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/list_nodes.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 vmwareengine_v1_generated_VmwareEngine_ListNodes_sync] -require "google/cloud/vmware_engine/v1" - -## -# Snippet for the list_nodes call in the VmwareEngine 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::VmwareEngine::V1::VmwareEngine::Client#list_nodes. -# -def list_nodes - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VmwareEngine::V1::ListNodesRequest.new - - # Call the list_nodes method. - result = client.list_nodes 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::VmwareEngine::V1::Node. - p item - end -end -# [END vmwareengine_v1_generated_VmwareEngine_ListNodes_sync] diff --git a/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/list_peering_routes.rb b/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/list_peering_routes.rb deleted file mode 100644 index f645bfbba771..000000000000 --- a/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/list_peering_routes.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 vmwareengine_v1_generated_VmwareEngine_ListPeeringRoutes_sync] -require "google/cloud/vmware_engine/v1" - -## -# Snippet for the list_peering_routes call in the VmwareEngine 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::VmwareEngine::V1::VmwareEngine::Client#list_peering_routes. -# -def list_peering_routes - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VmwareEngine::V1::ListPeeringRoutesRequest.new - - # Call the list_peering_routes method. - result = client.list_peering_routes 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::VmwareEngine::V1::PeeringRoute. - p item - end -end -# [END vmwareengine_v1_generated_VmwareEngine_ListPeeringRoutes_sync] diff --git a/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/list_private_clouds.rb b/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/list_private_clouds.rb deleted file mode 100644 index eeb2216d2366..000000000000 --- a/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/list_private_clouds.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 vmwareengine_v1_generated_VmwareEngine_ListPrivateClouds_sync] -require "google/cloud/vmware_engine/v1" - -## -# Snippet for the list_private_clouds call in the VmwareEngine 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::VmwareEngine::V1::VmwareEngine::Client#list_private_clouds. -# -def list_private_clouds - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VmwareEngine::V1::ListPrivateCloudsRequest.new - - # Call the list_private_clouds method. - result = client.list_private_clouds 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::VmwareEngine::V1::PrivateCloud. - p item - end -end -# [END vmwareengine_v1_generated_VmwareEngine_ListPrivateClouds_sync] diff --git a/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/list_private_connection_peering_routes.rb b/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/list_private_connection_peering_routes.rb deleted file mode 100644 index 49d5011f9a8f..000000000000 --- a/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/list_private_connection_peering_routes.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 vmwareengine_v1_generated_VmwareEngine_ListPrivateConnectionPeeringRoutes_sync] -require "google/cloud/vmware_engine/v1" - -## -# Snippet for the list_private_connection_peering_routes call in the VmwareEngine 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::VmwareEngine::V1::VmwareEngine::Client#list_private_connection_peering_routes. -# -def list_private_connection_peering_routes - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VmwareEngine::V1::ListPrivateConnectionPeeringRoutesRequest.new - - # Call the list_private_connection_peering_routes method. - result = client.list_private_connection_peering_routes 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::VmwareEngine::V1::PeeringRoute. - p item - end -end -# [END vmwareengine_v1_generated_VmwareEngine_ListPrivateConnectionPeeringRoutes_sync] diff --git a/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/list_private_connections.rb b/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/list_private_connections.rb deleted file mode 100644 index af827ee6ed71..000000000000 --- a/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/list_private_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 vmwareengine_v1_generated_VmwareEngine_ListPrivateConnections_sync] -require "google/cloud/vmware_engine/v1" - -## -# Snippet for the list_private_connections call in the VmwareEngine 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::VmwareEngine::V1::VmwareEngine::Client#list_private_connections. -# -def list_private_connections - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VmwareEngine::V1::ListPrivateConnectionsRequest.new - - # Call the list_private_connections method. - result = client.list_private_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::VmwareEngine::V1::PrivateConnection. - p item - end -end -# [END vmwareengine_v1_generated_VmwareEngine_ListPrivateConnections_sync] diff --git a/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/list_subnets.rb b/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/list_subnets.rb deleted file mode 100644 index 1e189f43ebf6..000000000000 --- a/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/list_subnets.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 vmwareengine_v1_generated_VmwareEngine_ListSubnets_sync] -require "google/cloud/vmware_engine/v1" - -## -# Snippet for the list_subnets call in the VmwareEngine 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::VmwareEngine::V1::VmwareEngine::Client#list_subnets. -# -def list_subnets - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VmwareEngine::V1::ListSubnetsRequest.new - - # Call the list_subnets method. - result = client.list_subnets 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::VmwareEngine::V1::Subnet. - p item - end -end -# [END vmwareengine_v1_generated_VmwareEngine_ListSubnets_sync] diff --git a/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/list_vmware_engine_networks.rb b/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/list_vmware_engine_networks.rb deleted file mode 100644 index 143d875b947c..000000000000 --- a/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/list_vmware_engine_networks.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 vmwareengine_v1_generated_VmwareEngine_ListVmwareEngineNetworks_sync] -require "google/cloud/vmware_engine/v1" - -## -# Snippet for the list_vmware_engine_networks call in the VmwareEngine 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::VmwareEngine::V1::VmwareEngine::Client#list_vmware_engine_networks. -# -def list_vmware_engine_networks - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VmwareEngine::V1::ListVmwareEngineNetworksRequest.new - - # Call the list_vmware_engine_networks method. - result = client.list_vmware_engine_networks 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::VmwareEngine::V1::VmwareEngineNetwork. - p item - end -end -# [END vmwareengine_v1_generated_VmwareEngine_ListVmwareEngineNetworks_sync] diff --git a/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/repair_management_dns_zone_binding.rb b/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/repair_management_dns_zone_binding.rb deleted file mode 100644 index 4d6b6e44c1e8..000000000000 --- a/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/repair_management_dns_zone_binding.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 vmwareengine_v1_generated_VmwareEngine_RepairManagementDnsZoneBinding_sync] -require "google/cloud/vmware_engine/v1" - -## -# Snippet for the repair_management_dns_zone_binding call in the VmwareEngine 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::VmwareEngine::V1::VmwareEngine::Client#repair_management_dns_zone_binding. -# -def repair_management_dns_zone_binding - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VmwareEngine::V1::RepairManagementDnsZoneBindingRequest.new - - # Call the repair_management_dns_zone_binding method. - result = client.repair_management_dns_zone_binding 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 vmwareengine_v1_generated_VmwareEngine_RepairManagementDnsZoneBinding_sync] diff --git a/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/reset_nsx_credentials.rb b/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/reset_nsx_credentials.rb deleted file mode 100644 index 11bc2e6fd0e3..000000000000 --- a/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/reset_nsx_credentials.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 vmwareengine_v1_generated_VmwareEngine_ResetNsxCredentials_sync] -require "google/cloud/vmware_engine/v1" - -## -# Snippet for the reset_nsx_credentials call in the VmwareEngine 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::VmwareEngine::V1::VmwareEngine::Client#reset_nsx_credentials. -# -def reset_nsx_credentials - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VmwareEngine::V1::ResetNsxCredentialsRequest.new - - # Call the reset_nsx_credentials method. - result = client.reset_nsx_credentials 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 vmwareengine_v1_generated_VmwareEngine_ResetNsxCredentials_sync] diff --git a/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/reset_vcenter_credentials.rb b/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/reset_vcenter_credentials.rb deleted file mode 100644 index ceab7a4dce15..000000000000 --- a/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/reset_vcenter_credentials.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 vmwareengine_v1_generated_VmwareEngine_ResetVcenterCredentials_sync] -require "google/cloud/vmware_engine/v1" - -## -# Snippet for the reset_vcenter_credentials call in the VmwareEngine 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::VmwareEngine::V1::VmwareEngine::Client#reset_vcenter_credentials. -# -def reset_vcenter_credentials - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VmwareEngine::V1::ResetVcenterCredentialsRequest.new - - # Call the reset_vcenter_credentials method. - result = client.reset_vcenter_credentials 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 vmwareengine_v1_generated_VmwareEngine_ResetVcenterCredentials_sync] diff --git a/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/revoke_dns_bind_permission.rb b/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/revoke_dns_bind_permission.rb deleted file mode 100644 index cde973c17390..000000000000 --- a/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/revoke_dns_bind_permission.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 vmwareengine_v1_generated_VmwareEngine_RevokeDnsBindPermission_sync] -require "google/cloud/vmware_engine/v1" - -## -# Snippet for the revoke_dns_bind_permission call in the VmwareEngine 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::VmwareEngine::V1::VmwareEngine::Client#revoke_dns_bind_permission. -# -def revoke_dns_bind_permission - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VmwareEngine::V1::RevokeDnsBindPermissionRequest.new - - # Call the revoke_dns_bind_permission method. - result = client.revoke_dns_bind_permission 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 vmwareengine_v1_generated_VmwareEngine_RevokeDnsBindPermission_sync] diff --git a/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/show_nsx_credentials.rb b/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/show_nsx_credentials.rb deleted file mode 100644 index 53f526a4b605..000000000000 --- a/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/show_nsx_credentials.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 vmwareengine_v1_generated_VmwareEngine_ShowNsxCredentials_sync] -require "google/cloud/vmware_engine/v1" - -## -# Snippet for the show_nsx_credentials call in the VmwareEngine 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::VmwareEngine::V1::VmwareEngine::Client#show_nsx_credentials. -# -def show_nsx_credentials - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VmwareEngine::V1::ShowNsxCredentialsRequest.new - - # Call the show_nsx_credentials method. - result = client.show_nsx_credentials request - - # The returned object is of type Google::Cloud::VmwareEngine::V1::Credentials. - p result -end -# [END vmwareengine_v1_generated_VmwareEngine_ShowNsxCredentials_sync] diff --git a/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/show_vcenter_credentials.rb b/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/show_vcenter_credentials.rb deleted file mode 100644 index cae36f6ea2d5..000000000000 --- a/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/show_vcenter_credentials.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 vmwareengine_v1_generated_VmwareEngine_ShowVcenterCredentials_sync] -require "google/cloud/vmware_engine/v1" - -## -# Snippet for the show_vcenter_credentials call in the VmwareEngine 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::VmwareEngine::V1::VmwareEngine::Client#show_vcenter_credentials. -# -def show_vcenter_credentials - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VmwareEngine::V1::ShowVcenterCredentialsRequest.new - - # Call the show_vcenter_credentials method. - result = client.show_vcenter_credentials request - - # The returned object is of type Google::Cloud::VmwareEngine::V1::Credentials. - p result -end -# [END vmwareengine_v1_generated_VmwareEngine_ShowVcenterCredentials_sync] diff --git a/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/undelete_private_cloud.rb b/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/undelete_private_cloud.rb deleted file mode 100644 index 7425b33d28eb..000000000000 --- a/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/undelete_private_cloud.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 vmwareengine_v1_generated_VmwareEngine_UndeletePrivateCloud_sync] -require "google/cloud/vmware_engine/v1" - -## -# Snippet for the undelete_private_cloud call in the VmwareEngine 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::VmwareEngine::V1::VmwareEngine::Client#undelete_private_cloud. -# -def undelete_private_cloud - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VmwareEngine::V1::UndeletePrivateCloudRequest.new - - # Call the undelete_private_cloud method. - result = client.undelete_private_cloud 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 vmwareengine_v1_generated_VmwareEngine_UndeletePrivateCloud_sync] diff --git a/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/update_cluster.rb b/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/update_cluster.rb deleted file mode 100644 index 38b7e52760c4..000000000000 --- a/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/update_cluster.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 vmwareengine_v1_generated_VmwareEngine_UpdateCluster_sync] -require "google/cloud/vmware_engine/v1" - -## -# Snippet for the update_cluster call in the VmwareEngine 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::VmwareEngine::V1::VmwareEngine::Client#update_cluster. -# -def update_cluster - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VmwareEngine::V1::UpdateClusterRequest.new - - # Call the update_cluster method. - result = client.update_cluster 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 vmwareengine_v1_generated_VmwareEngine_UpdateCluster_sync] diff --git a/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/update_dns_forwarding.rb b/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/update_dns_forwarding.rb deleted file mode 100644 index 0ad70f87133b..000000000000 --- a/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/update_dns_forwarding.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 vmwareengine_v1_generated_VmwareEngine_UpdateDnsForwarding_sync] -require "google/cloud/vmware_engine/v1" - -## -# Snippet for the update_dns_forwarding call in the VmwareEngine 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::VmwareEngine::V1::VmwareEngine::Client#update_dns_forwarding. -# -def update_dns_forwarding - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VmwareEngine::V1::UpdateDnsForwardingRequest.new - - # Call the update_dns_forwarding method. - result = client.update_dns_forwarding 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 vmwareengine_v1_generated_VmwareEngine_UpdateDnsForwarding_sync] diff --git a/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/update_external_access_rule.rb b/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/update_external_access_rule.rb deleted file mode 100644 index 899f50154332..000000000000 --- a/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/update_external_access_rule.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 vmwareengine_v1_generated_VmwareEngine_UpdateExternalAccessRule_sync] -require "google/cloud/vmware_engine/v1" - -## -# Snippet for the update_external_access_rule call in the VmwareEngine 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::VmwareEngine::V1::VmwareEngine::Client#update_external_access_rule. -# -def update_external_access_rule - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VmwareEngine::V1::UpdateExternalAccessRuleRequest.new - - # Call the update_external_access_rule method. - result = client.update_external_access_rule 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 vmwareengine_v1_generated_VmwareEngine_UpdateExternalAccessRule_sync] diff --git a/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/update_external_address.rb b/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/update_external_address.rb deleted file mode 100644 index 90d96464fa2d..000000000000 --- a/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/update_external_address.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 vmwareengine_v1_generated_VmwareEngine_UpdateExternalAddress_sync] -require "google/cloud/vmware_engine/v1" - -## -# Snippet for the update_external_address call in the VmwareEngine 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::VmwareEngine::V1::VmwareEngine::Client#update_external_address. -# -def update_external_address - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VmwareEngine::V1::UpdateExternalAddressRequest.new - - # Call the update_external_address method. - result = client.update_external_address 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 vmwareengine_v1_generated_VmwareEngine_UpdateExternalAddress_sync] diff --git a/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/update_logging_server.rb b/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/update_logging_server.rb deleted file mode 100644 index 911eeb0de84b..000000000000 --- a/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/update_logging_server.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 vmwareengine_v1_generated_VmwareEngine_UpdateLoggingServer_sync] -require "google/cloud/vmware_engine/v1" - -## -# Snippet for the update_logging_server call in the VmwareEngine 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::VmwareEngine::V1::VmwareEngine::Client#update_logging_server. -# -def update_logging_server - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VmwareEngine::V1::UpdateLoggingServerRequest.new - - # Call the update_logging_server method. - result = client.update_logging_server 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 vmwareengine_v1_generated_VmwareEngine_UpdateLoggingServer_sync] diff --git a/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/update_management_dns_zone_binding.rb b/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/update_management_dns_zone_binding.rb deleted file mode 100644 index 7665aa045b97..000000000000 --- a/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/update_management_dns_zone_binding.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 vmwareengine_v1_generated_VmwareEngine_UpdateManagementDnsZoneBinding_sync] -require "google/cloud/vmware_engine/v1" - -## -# Snippet for the update_management_dns_zone_binding call in the VmwareEngine 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::VmwareEngine::V1::VmwareEngine::Client#update_management_dns_zone_binding. -# -def update_management_dns_zone_binding - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VmwareEngine::V1::UpdateManagementDnsZoneBindingRequest.new - - # Call the update_management_dns_zone_binding method. - result = client.update_management_dns_zone_binding 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 vmwareengine_v1_generated_VmwareEngine_UpdateManagementDnsZoneBinding_sync] diff --git a/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/update_network_peering.rb b/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/update_network_peering.rb deleted file mode 100644 index 09c5ea08042e..000000000000 --- a/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/update_network_peering.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 vmwareengine_v1_generated_VmwareEngine_UpdateNetworkPeering_sync] -require "google/cloud/vmware_engine/v1" - -## -# Snippet for the update_network_peering call in the VmwareEngine 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::VmwareEngine::V1::VmwareEngine::Client#update_network_peering. -# -def update_network_peering - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VmwareEngine::V1::UpdateNetworkPeeringRequest.new - - # Call the update_network_peering method. - result = client.update_network_peering 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 vmwareengine_v1_generated_VmwareEngine_UpdateNetworkPeering_sync] diff --git a/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/update_network_policy.rb b/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/update_network_policy.rb deleted file mode 100644 index a4360cd07ab0..000000000000 --- a/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/update_network_policy.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 vmwareengine_v1_generated_VmwareEngine_UpdateNetworkPolicy_sync] -require "google/cloud/vmware_engine/v1" - -## -# Snippet for the update_network_policy call in the VmwareEngine 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::VmwareEngine::V1::VmwareEngine::Client#update_network_policy. -# -def update_network_policy - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VmwareEngine::V1::UpdateNetworkPolicyRequest.new - - # Call the update_network_policy method. - result = client.update_network_policy 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 vmwareengine_v1_generated_VmwareEngine_UpdateNetworkPolicy_sync] diff --git a/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/update_private_cloud.rb b/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/update_private_cloud.rb deleted file mode 100644 index 04389ad9d673..000000000000 --- a/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/update_private_cloud.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 vmwareengine_v1_generated_VmwareEngine_UpdatePrivateCloud_sync] -require "google/cloud/vmware_engine/v1" - -## -# Snippet for the update_private_cloud call in the VmwareEngine 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::VmwareEngine::V1::VmwareEngine::Client#update_private_cloud. -# -def update_private_cloud - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VmwareEngine::V1::UpdatePrivateCloudRequest.new - - # Call the update_private_cloud method. - result = client.update_private_cloud 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 vmwareengine_v1_generated_VmwareEngine_UpdatePrivateCloud_sync] diff --git a/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/update_private_connection.rb b/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/update_private_connection.rb deleted file mode 100644 index 3b3f4109f00e..000000000000 --- a/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/update_private_connection.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 vmwareengine_v1_generated_VmwareEngine_UpdatePrivateConnection_sync] -require "google/cloud/vmware_engine/v1" - -## -# Snippet for the update_private_connection call in the VmwareEngine 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::VmwareEngine::V1::VmwareEngine::Client#update_private_connection. -# -def update_private_connection - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VmwareEngine::V1::UpdatePrivateConnectionRequest.new - - # Call the update_private_connection method. - result = client.update_private_connection 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 vmwareengine_v1_generated_VmwareEngine_UpdatePrivateConnection_sync] diff --git a/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/update_subnet.rb b/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/update_subnet.rb deleted file mode 100644 index 6178fa50930b..000000000000 --- a/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/update_subnet.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 vmwareengine_v1_generated_VmwareEngine_UpdateSubnet_sync] -require "google/cloud/vmware_engine/v1" - -## -# Snippet for the update_subnet call in the VmwareEngine 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::VmwareEngine::V1::VmwareEngine::Client#update_subnet. -# -def update_subnet - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VmwareEngine::V1::UpdateSubnetRequest.new - - # Call the update_subnet method. - result = client.update_subnet 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 vmwareengine_v1_generated_VmwareEngine_UpdateSubnet_sync] diff --git a/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/update_vmware_engine_network.rb b/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/update_vmware_engine_network.rb deleted file mode 100644 index 75c548dd649a..000000000000 --- a/owl-bot-staging/google-cloud-vmware_engine-v1/snippets/vmware_engine/update_vmware_engine_network.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 vmwareengine_v1_generated_VmwareEngine_UpdateVmwareEngineNetwork_sync] -require "google/cloud/vmware_engine/v1" - -## -# Snippet for the update_vmware_engine_network call in the VmwareEngine 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::VmwareEngine::V1::VmwareEngine::Client#update_vmware_engine_network. -# -def update_vmware_engine_network - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VmwareEngine::V1::UpdateVmwareEngineNetworkRequest.new - - # Call the update_vmware_engine_network method. - result = client.update_vmware_engine_network 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 vmwareengine_v1_generated_VmwareEngine_UpdateVmwareEngineNetwork_sync] diff --git a/owl-bot-staging/google-cloud-vmware_engine-v1/test/google/cloud/vmware_engine/v1/vmware_engine_operations_test.rb b/owl-bot-staging/google-cloud-vmware_engine-v1/test/google/cloud/vmware_engine/v1/vmware_engine_operations_test.rb deleted file mode 100644 index dc60dddb354f..000000000000 --- a/owl-bot-staging/google-cloud-vmware_engine-v1/test/google/cloud/vmware_engine/v1/vmware_engine_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/vmwareengine/v1/vmwareengine_pb" -require "google/cloud/vmwareengine/v1/vmwareengine_services_pb" -require "google/cloud/vmware_engine/v1/vmware_engine" - -class ::Google::Cloud::VmwareEngine::V1::VmwareEngine::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::VmwareEngine::V1::VmwareEngine::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::VmwareEngine::V1::VmwareEngine::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::VmwareEngine::V1::VmwareEngine::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::VmwareEngine::V1::VmwareEngine::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::VmwareEngine::V1::VmwareEngine::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::VmwareEngine::V1::VmwareEngine::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::VmwareEngine::V1::VmwareEngine::Operations::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-vmware_engine-v1/test/google/cloud/vmware_engine/v1/vmware_engine_paths_test.rb b/owl-bot-staging/google-cloud-vmware_engine-v1/test/google/cloud/vmware_engine/v1/vmware_engine_paths_test.rb deleted file mode 100644 index 5e079f9a19f2..000000000000 --- a/owl-bot-staging/google-cloud-vmware_engine-v1/test/google/cloud/vmware_engine/v1/vmware_engine_paths_test.rb +++ /dev/null @@ -1,259 +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/vmware_engine/v1/vmware_engine" - -class ::Google::Cloud::VmwareEngine::V1::VmwareEngine::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_cluster_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.cluster_path project: "value0", location: "value1", private_cloud: "value2", cluster: "value3" - assert_equal "projects/value0/locations/value1/privateClouds/value2/clusters/value3", path - end - end - - def test_dns_bind_permission_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.dns_bind_permission_path project: "value0", location: "value1" - assert_equal "projects/value0/locations/value1/dnsBindPermission", path - end - end - - def test_dns_forwarding_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.dns_forwarding_path project: "value0", location: "value1", private_cloud: "value2" - assert_equal "projects/value0/locations/value1/privateClouds/value2/dnsForwarding", path - end - end - - def test_external_access_rule_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.external_access_rule_path project: "value0", location: "value1", network_policy: "value2", external_access_rule: "value3" - assert_equal "projects/value0/locations/value1/networkPolicies/value2/externalAccessRules/value3", path - end - end - - def test_external_address_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.external_address_path project: "value0", location: "value1", private_cloud: "value2", external_address: "value3" - assert_equal "projects/value0/locations/value1/privateClouds/value2/externalAddresses/value3", path - end - end - - def test_hcx_activation_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::VmwareEngine::V1::VmwareEngine::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.hcx_activation_key_path project: "value0", location: "value1", private_cloud: "value2", hcx_activation_key: "value3" - assert_equal "projects/value0/locations/value1/privateClouds/value2/hcxActivationKeys/value3", 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::VmwareEngine::V1::VmwareEngine::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_logging_server_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.logging_server_path project: "value0", location: "value1", private_cloud: "value2", logging_server: "value3" - assert_equal "projects/value0/locations/value1/privateClouds/value2/loggingServers/value3", path - end - end - - def test_management_dns_zone_binding_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.management_dns_zone_binding_path project: "value0", location: "value1", private_cloud: "value2", management_dns_zone_binding: "value3" - assert_equal "projects/value0/locations/value1/privateClouds/value2/managementDnsZoneBindings/value3", path - end - end - - def test_network_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.network_path project: "value0", network: "value1" - assert_equal "projects/value0/global/networks/value1", path - end - end - - def test_network_peering_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.network_peering_path project: "value0", location: "value1", network_peering: "value2" - assert_equal "projects/value0/locations/value1/networkPeerings/value2", path - end - end - - def test_network_policy_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.network_policy_path project: "value0", location: "value1", network_policy: "value2" - assert_equal "projects/value0/locations/value1/networkPolicies/value2", path - end - end - - def test_node_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.node_path project: "value0", location: "value1", private_cloud: "value2", cluster: "value3", node: "value4" - assert_equal "projects/value0/locations/value1/privateClouds/value2/clusters/value3/nodes/value4", path - end - end - - def test_node_type_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.node_type_path project: "value0", location: "value1", node_type: "value2" - assert_equal "projects/value0/locations/value1/nodeTypes/value2", path - end - end - - def test_private_cloud_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.private_cloud_path project: "value0", location: "value1", private_cloud: "value2" - assert_equal "projects/value0/locations/value1/privateClouds/value2", path - end - end - - def test_private_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::VmwareEngine::V1::VmwareEngine::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.private_connection_path project: "value0", location: "value1", private_connection: "value2" - assert_equal "projects/value0/locations/value1/privateConnections/value2", path - end - end - - def test_subnet_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.subnet_path project: "value0", location: "value1", private_cloud: "value2", subnet: "value3" - assert_equal "projects/value0/locations/value1/privateClouds/value2/subnets/value3", path - end - end - - def test_vmware_engine_network_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.vmware_engine_network_path project: "value0", location: "value1", vmware_engine_network: "value2" - assert_equal "projects/value0/locations/value1/vmwareEngineNetworks/value2", path - end - end -end diff --git a/owl-bot-staging/google-cloud-vmware_engine-v1/test/google/cloud/vmware_engine/v1/vmware_engine_rest_test.rb b/owl-bot-staging/google-cloud-vmware_engine-v1/test/google/cloud/vmware_engine/v1/vmware_engine_rest_test.rb deleted file mode 100644 index f6e8df4f3a3a..000000000000 --- a/owl-bot-staging/google-cloud-vmware_engine-v1/test/google/cloud/vmware_engine/v1/vmware_engine_rest_test.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 "helper" -require "gapic/rest" -require "google/cloud/vmwareengine/v1/vmwareengine_pb" -require "google/cloud/vmware_engine/v1/vmware_engine/rest" - - -class ::Google::Cloud::VmwareEngine::V1::VmwareEngine::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_private_clouds - # Create test objects. - client_result = ::Google::Cloud::VmwareEngine::V1::ListPrivateCloudsResponse.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_private_clouds_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::VmwareEngine::V1::VmwareEngine::Rest::ServiceStub.stub :transcode_list_private_clouds_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_private_clouds_client_stub do - # Create client - client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_private_clouds({ 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_private_clouds 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_private_clouds ::Google::Cloud::VmwareEngine::V1::ListPrivateCloudsRequest.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_private_clouds({ 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_private_clouds(::Google::Cloud::VmwareEngine::V1::ListPrivateCloudsRequest.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_private_clouds_client_stub.call_count - end - end - end - - def test_get_private_cloud - # Create test objects. - client_result = ::Google::Cloud::VmwareEngine::V1::PrivateCloud.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_private_cloud_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::VmwareEngine::V1::VmwareEngine::Rest::ServiceStub.stub :transcode_get_private_cloud_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_private_cloud_client_stub do - # Create client - client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_private_cloud({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_private_cloud name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_private_cloud ::Google::Cloud::VmwareEngine::V1::GetPrivateCloudRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_private_cloud({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_private_cloud(::Google::Cloud::VmwareEngine::V1::GetPrivateCloudRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_private_cloud_client_stub.call_count - end - end - end - - def test_create_private_cloud - # 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" - private_cloud_id = "hello world" - private_cloud = {} - request_id = "hello world" - validate_only = true - - create_private_cloud_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::VmwareEngine::V1::VmwareEngine::Rest::ServiceStub.stub :transcode_create_private_cloud_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_private_cloud_client_stub do - # Create client - client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_private_cloud({ parent: parent, private_cloud_id: private_cloud_id, private_cloud: private_cloud, request_id: request_id, validate_only: validate_only }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_private_cloud parent: parent, private_cloud_id: private_cloud_id, private_cloud: private_cloud, request_id: request_id, validate_only: validate_only do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_private_cloud ::Google::Cloud::VmwareEngine::V1::CreatePrivateCloudRequest.new(parent: parent, private_cloud_id: private_cloud_id, private_cloud: private_cloud, request_id: request_id, validate_only: validate_only) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_private_cloud({ parent: parent, private_cloud_id: private_cloud_id, private_cloud: private_cloud, request_id: request_id, validate_only: validate_only }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_private_cloud(::Google::Cloud::VmwareEngine::V1::CreatePrivateCloudRequest.new(parent: parent, private_cloud_id: private_cloud_id, private_cloud: private_cloud, request_id: request_id, validate_only: validate_only), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_private_cloud_client_stub.call_count - end - end - end - - def test_update_private_cloud - # 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. - private_cloud = {} - update_mask = {} - request_id = "hello world" - - update_private_cloud_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::VmwareEngine::V1::VmwareEngine::Rest::ServiceStub.stub :transcode_update_private_cloud_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_private_cloud_client_stub do - # Create client - client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.update_private_cloud({ private_cloud: private_cloud, update_mask: update_mask, request_id: request_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.update_private_cloud private_cloud: private_cloud, update_mask: update_mask, request_id: request_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.update_private_cloud ::Google::Cloud::VmwareEngine::V1::UpdatePrivateCloudRequest.new(private_cloud: private_cloud, update_mask: update_mask, request_id: request_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.update_private_cloud({ private_cloud: private_cloud, update_mask: update_mask, request_id: request_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.update_private_cloud(::Google::Cloud::VmwareEngine::V1::UpdatePrivateCloudRequest.new(private_cloud: private_cloud, update_mask: update_mask, request_id: request_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, update_private_cloud_client_stub.call_count - end - end - end - - def test_delete_private_cloud - # 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" - request_id = "hello world" - force = true - delay_hours = 42 - - delete_private_cloud_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::VmwareEngine::V1::VmwareEngine::Rest::ServiceStub.stub :transcode_delete_private_cloud_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_private_cloud_client_stub do - # Create client - client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.delete_private_cloud({ name: name, request_id: request_id, force: force, delay_hours: delay_hours }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.delete_private_cloud name: name, request_id: request_id, force: force, delay_hours: delay_hours do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.delete_private_cloud ::Google::Cloud::VmwareEngine::V1::DeletePrivateCloudRequest.new(name: name, request_id: request_id, force: force, delay_hours: delay_hours) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.delete_private_cloud({ name: name, request_id: request_id, force: force, delay_hours: delay_hours }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.delete_private_cloud(::Google::Cloud::VmwareEngine::V1::DeletePrivateCloudRequest.new(name: name, request_id: request_id, force: force, delay_hours: delay_hours), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, delete_private_cloud_client_stub.call_count - end - end - end - - def test_undelete_private_cloud - # 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" - request_id = "hello world" - - undelete_private_cloud_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::VmwareEngine::V1::VmwareEngine::Rest::ServiceStub.stub :transcode_undelete_private_cloud_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, undelete_private_cloud_client_stub do - # Create client - client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.undelete_private_cloud({ name: name, request_id: request_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.undelete_private_cloud name: name, request_id: request_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.undelete_private_cloud ::Google::Cloud::VmwareEngine::V1::UndeletePrivateCloudRequest.new(name: name, request_id: request_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.undelete_private_cloud({ name: name, request_id: request_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.undelete_private_cloud(::Google::Cloud::VmwareEngine::V1::UndeletePrivateCloudRequest.new(name: name, request_id: request_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, undelete_private_cloud_client_stub.call_count - end - end - end - - def test_list_clusters - # Create test objects. - client_result = ::Google::Cloud::VmwareEngine::V1::ListClustersResponse.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_clusters_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::VmwareEngine::V1::VmwareEngine::Rest::ServiceStub.stub :transcode_list_clusters_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_clusters_client_stub do - # Create client - client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_clusters({ 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_clusters 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_clusters ::Google::Cloud::VmwareEngine::V1::ListClustersRequest.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_clusters({ 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_clusters(::Google::Cloud::VmwareEngine::V1::ListClustersRequest.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_clusters_client_stub.call_count - end - end - end - - def test_get_cluster - # Create test objects. - client_result = ::Google::Cloud::VmwareEngine::V1::Cluster.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_cluster_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::VmwareEngine::V1::VmwareEngine::Rest::ServiceStub.stub :transcode_get_cluster_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_cluster_client_stub do - # Create client - client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_cluster({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_cluster name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_cluster ::Google::Cloud::VmwareEngine::V1::GetClusterRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_cluster({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_cluster(::Google::Cloud::VmwareEngine::V1::GetClusterRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_cluster_client_stub.call_count - end - end - end - - def test_create_cluster - # 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" - cluster_id = "hello world" - cluster = {} - request_id = "hello world" - validate_only = true - - create_cluster_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::VmwareEngine::V1::VmwareEngine::Rest::ServiceStub.stub :transcode_create_cluster_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_cluster_client_stub do - # Create client - client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_cluster({ parent: parent, cluster_id: cluster_id, cluster: cluster, request_id: request_id, validate_only: validate_only }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_cluster parent: parent, cluster_id: cluster_id, cluster: cluster, request_id: request_id, validate_only: validate_only do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_cluster ::Google::Cloud::VmwareEngine::V1::CreateClusterRequest.new(parent: parent, cluster_id: cluster_id, cluster: cluster, request_id: request_id, validate_only: validate_only) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_cluster({ parent: parent, cluster_id: cluster_id, cluster: cluster, request_id: request_id, validate_only: validate_only }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_cluster(::Google::Cloud::VmwareEngine::V1::CreateClusterRequest.new(parent: parent, cluster_id: cluster_id, cluster: cluster, request_id: request_id, validate_only: validate_only), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_cluster_client_stub.call_count - end - end - end - - def test_update_cluster - # 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. - update_mask = {} - cluster = {} - request_id = "hello world" - validate_only = true - - update_cluster_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::VmwareEngine::V1::VmwareEngine::Rest::ServiceStub.stub :transcode_update_cluster_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_cluster_client_stub do - # Create client - client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.update_cluster({ update_mask: update_mask, cluster: cluster, request_id: request_id, validate_only: validate_only }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.update_cluster update_mask: update_mask, cluster: cluster, request_id: request_id, validate_only: validate_only do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.update_cluster ::Google::Cloud::VmwareEngine::V1::UpdateClusterRequest.new(update_mask: update_mask, cluster: cluster, request_id: request_id, validate_only: validate_only) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.update_cluster({ update_mask: update_mask, cluster: cluster, request_id: request_id, validate_only: validate_only }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.update_cluster(::Google::Cloud::VmwareEngine::V1::UpdateClusterRequest.new(update_mask: update_mask, cluster: cluster, request_id: request_id, validate_only: validate_only), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, update_cluster_client_stub.call_count - end - end - end - - def test_delete_cluster - # 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" - request_id = "hello world" - - delete_cluster_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::VmwareEngine::V1::VmwareEngine::Rest::ServiceStub.stub :transcode_delete_cluster_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_cluster_client_stub do - # Create client - client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.delete_cluster({ name: name, request_id: request_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.delete_cluster name: name, request_id: request_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.delete_cluster ::Google::Cloud::VmwareEngine::V1::DeleteClusterRequest.new(name: name, request_id: request_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.delete_cluster({ name: name, request_id: request_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.delete_cluster(::Google::Cloud::VmwareEngine::V1::DeleteClusterRequest.new(name: name, request_id: request_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, delete_cluster_client_stub.call_count - end - end - end - - def test_list_nodes - # Create test objects. - client_result = ::Google::Cloud::VmwareEngine::V1::ListNodesResponse.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_nodes_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::VmwareEngine::V1::VmwareEngine::Rest::ServiceStub.stub :transcode_list_nodes_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_nodes_client_stub do - # Create client - client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_nodes({ 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_nodes 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_nodes ::Google::Cloud::VmwareEngine::V1::ListNodesRequest.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_nodes({ 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_nodes(::Google::Cloud::VmwareEngine::V1::ListNodesRequest.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_nodes_client_stub.call_count - end - end - end - - def test_get_node - # Create test objects. - client_result = ::Google::Cloud::VmwareEngine::V1::Node.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_node_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::VmwareEngine::V1::VmwareEngine::Rest::ServiceStub.stub :transcode_get_node_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_node_client_stub do - # Create client - client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_node({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_node name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_node ::Google::Cloud::VmwareEngine::V1::GetNodeRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_node({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_node(::Google::Cloud::VmwareEngine::V1::GetNodeRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_node_client_stub.call_count - end - end - end - - def test_list_external_addresses - # Create test objects. - client_result = ::Google::Cloud::VmwareEngine::V1::ListExternalAddressesResponse.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_external_addresses_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::VmwareEngine::V1::VmwareEngine::Rest::ServiceStub.stub :transcode_list_external_addresses_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_external_addresses_client_stub do - # Create client - client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_external_addresses({ 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_external_addresses 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_external_addresses ::Google::Cloud::VmwareEngine::V1::ListExternalAddressesRequest.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_external_addresses({ 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_external_addresses(::Google::Cloud::VmwareEngine::V1::ListExternalAddressesRequest.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_external_addresses_client_stub.call_count - end - end - end - - def test_fetch_network_policy_external_addresses - # Create test objects. - client_result = ::Google::Cloud::VmwareEngine::V1::FetchNetworkPolicyExternalAddressesResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - network_policy = "hello world" - page_size = 42 - page_token = "hello world" - - fetch_network_policy_external_addresses_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::VmwareEngine::V1::VmwareEngine::Rest::ServiceStub.stub :transcode_fetch_network_policy_external_addresses_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, fetch_network_policy_external_addresses_client_stub do - # Create client - client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.fetch_network_policy_external_addresses({ network_policy: network_policy, page_size: page_size, page_token: page_token }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.fetch_network_policy_external_addresses network_policy: network_policy, page_size: page_size, page_token: page_token do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.fetch_network_policy_external_addresses ::Google::Cloud::VmwareEngine::V1::FetchNetworkPolicyExternalAddressesRequest.new(network_policy: network_policy, 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.fetch_network_policy_external_addresses({ network_policy: network_policy, 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.fetch_network_policy_external_addresses(::Google::Cloud::VmwareEngine::V1::FetchNetworkPolicyExternalAddressesRequest.new(network_policy: network_policy, 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, fetch_network_policy_external_addresses_client_stub.call_count - end - end - end - - def test_get_external_address - # Create test objects. - client_result = ::Google::Cloud::VmwareEngine::V1::ExternalAddress.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_external_address_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::VmwareEngine::V1::VmwareEngine::Rest::ServiceStub.stub :transcode_get_external_address_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_external_address_client_stub do - # Create client - client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_external_address({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_external_address name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_external_address ::Google::Cloud::VmwareEngine::V1::GetExternalAddressRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_external_address({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_external_address(::Google::Cloud::VmwareEngine::V1::GetExternalAddressRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_external_address_client_stub.call_count - end - end - end - - def test_create_external_address - # 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" - external_address = {} - external_address_id = "hello world" - request_id = "hello world" - - create_external_address_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::VmwareEngine::V1::VmwareEngine::Rest::ServiceStub.stub :transcode_create_external_address_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_external_address_client_stub do - # Create client - client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_external_address({ parent: parent, external_address: external_address, external_address_id: external_address_id, request_id: request_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_external_address parent: parent, external_address: external_address, external_address_id: external_address_id, request_id: request_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_external_address ::Google::Cloud::VmwareEngine::V1::CreateExternalAddressRequest.new(parent: parent, external_address: external_address, external_address_id: external_address_id, request_id: request_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_external_address({ parent: parent, external_address: external_address, external_address_id: external_address_id, request_id: request_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_external_address(::Google::Cloud::VmwareEngine::V1::CreateExternalAddressRequest.new(parent: parent, external_address: external_address, external_address_id: external_address_id, request_id: request_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_external_address_client_stub.call_count - end - end - end - - def test_update_external_address - # 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. - update_mask = {} - external_address = {} - request_id = "hello world" - - update_external_address_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::VmwareEngine::V1::VmwareEngine::Rest::ServiceStub.stub :transcode_update_external_address_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_external_address_client_stub do - # Create client - client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.update_external_address({ update_mask: update_mask, external_address: external_address, request_id: request_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.update_external_address update_mask: update_mask, external_address: external_address, request_id: request_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.update_external_address ::Google::Cloud::VmwareEngine::V1::UpdateExternalAddressRequest.new(update_mask: update_mask, external_address: external_address, request_id: request_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.update_external_address({ update_mask: update_mask, external_address: external_address, request_id: request_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.update_external_address(::Google::Cloud::VmwareEngine::V1::UpdateExternalAddressRequest.new(update_mask: update_mask, external_address: external_address, request_id: request_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, update_external_address_client_stub.call_count - end - end - end - - def test_delete_external_address - # 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" - request_id = "hello world" - - delete_external_address_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::VmwareEngine::V1::VmwareEngine::Rest::ServiceStub.stub :transcode_delete_external_address_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_external_address_client_stub do - # Create client - client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.delete_external_address({ name: name, request_id: request_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.delete_external_address name: name, request_id: request_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.delete_external_address ::Google::Cloud::VmwareEngine::V1::DeleteExternalAddressRequest.new(name: name, request_id: request_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.delete_external_address({ name: name, request_id: request_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.delete_external_address(::Google::Cloud::VmwareEngine::V1::DeleteExternalAddressRequest.new(name: name, request_id: request_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, delete_external_address_client_stub.call_count - end - end - end - - def test_list_subnets - # Create test objects. - client_result = ::Google::Cloud::VmwareEngine::V1::ListSubnetsResponse.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_subnets_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::VmwareEngine::V1::VmwareEngine::Rest::ServiceStub.stub :transcode_list_subnets_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_subnets_client_stub do - # Create client - client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_subnets({ 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_subnets 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_subnets ::Google::Cloud::VmwareEngine::V1::ListSubnetsRequest.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_subnets({ 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_subnets(::Google::Cloud::VmwareEngine::V1::ListSubnetsRequest.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_subnets_client_stub.call_count - end - end - end - - def test_get_subnet - # Create test objects. - client_result = ::Google::Cloud::VmwareEngine::V1::Subnet.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_subnet_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::VmwareEngine::V1::VmwareEngine::Rest::ServiceStub.stub :transcode_get_subnet_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_subnet_client_stub do - # Create client - client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_subnet({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_subnet name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_subnet ::Google::Cloud::VmwareEngine::V1::GetSubnetRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_subnet({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_subnet(::Google::Cloud::VmwareEngine::V1::GetSubnetRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_subnet_client_stub.call_count - end - end - end - - def test_update_subnet - # 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. - update_mask = {} - subnet = {} - - update_subnet_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::VmwareEngine::V1::VmwareEngine::Rest::ServiceStub.stub :transcode_update_subnet_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_subnet_client_stub do - # Create client - client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.update_subnet({ update_mask: update_mask, subnet: subnet }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.update_subnet update_mask: update_mask, subnet: subnet do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.update_subnet ::Google::Cloud::VmwareEngine::V1::UpdateSubnetRequest.new(update_mask: update_mask, subnet: subnet) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.update_subnet({ update_mask: update_mask, subnet: subnet }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.update_subnet(::Google::Cloud::VmwareEngine::V1::UpdateSubnetRequest.new(update_mask: update_mask, subnet: subnet), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, update_subnet_client_stub.call_count - end - end - end - - def test_list_external_access_rules - # Create test objects. - client_result = ::Google::Cloud::VmwareEngine::V1::ListExternalAccessRulesResponse.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_external_access_rules_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::VmwareEngine::V1::VmwareEngine::Rest::ServiceStub.stub :transcode_list_external_access_rules_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_external_access_rules_client_stub do - # Create client - client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_external_access_rules({ 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_external_access_rules 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_external_access_rules ::Google::Cloud::VmwareEngine::V1::ListExternalAccessRulesRequest.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_external_access_rules({ 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_external_access_rules(::Google::Cloud::VmwareEngine::V1::ListExternalAccessRulesRequest.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_external_access_rules_client_stub.call_count - end - end - end - - def test_get_external_access_rule - # Create test objects. - client_result = ::Google::Cloud::VmwareEngine::V1::ExternalAccessRule.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_external_access_rule_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::VmwareEngine::V1::VmwareEngine::Rest::ServiceStub.stub :transcode_get_external_access_rule_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_external_access_rule_client_stub do - # Create client - client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_external_access_rule({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_external_access_rule name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_external_access_rule ::Google::Cloud::VmwareEngine::V1::GetExternalAccessRuleRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_external_access_rule({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_external_access_rule(::Google::Cloud::VmwareEngine::V1::GetExternalAccessRuleRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_external_access_rule_client_stub.call_count - end - end - end - - def test_create_external_access_rule - # 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" - external_access_rule = {} - external_access_rule_id = "hello world" - request_id = "hello world" - - create_external_access_rule_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::VmwareEngine::V1::VmwareEngine::Rest::ServiceStub.stub :transcode_create_external_access_rule_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_external_access_rule_client_stub do - # Create client - client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_external_access_rule({ parent: parent, external_access_rule: external_access_rule, external_access_rule_id: external_access_rule_id, request_id: request_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_external_access_rule parent: parent, external_access_rule: external_access_rule, external_access_rule_id: external_access_rule_id, request_id: request_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_external_access_rule ::Google::Cloud::VmwareEngine::V1::CreateExternalAccessRuleRequest.new(parent: parent, external_access_rule: external_access_rule, external_access_rule_id: external_access_rule_id, request_id: request_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_external_access_rule({ parent: parent, external_access_rule: external_access_rule, external_access_rule_id: external_access_rule_id, request_id: request_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_external_access_rule(::Google::Cloud::VmwareEngine::V1::CreateExternalAccessRuleRequest.new(parent: parent, external_access_rule: external_access_rule, external_access_rule_id: external_access_rule_id, request_id: request_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_external_access_rule_client_stub.call_count - end - end - end - - def test_update_external_access_rule - # 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. - update_mask = {} - external_access_rule = {} - request_id = "hello world" - - update_external_access_rule_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::VmwareEngine::V1::VmwareEngine::Rest::ServiceStub.stub :transcode_update_external_access_rule_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_external_access_rule_client_stub do - # Create client - client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.update_external_access_rule({ update_mask: update_mask, external_access_rule: external_access_rule, request_id: request_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.update_external_access_rule update_mask: update_mask, external_access_rule: external_access_rule, request_id: request_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.update_external_access_rule ::Google::Cloud::VmwareEngine::V1::UpdateExternalAccessRuleRequest.new(update_mask: update_mask, external_access_rule: external_access_rule, request_id: request_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.update_external_access_rule({ update_mask: update_mask, external_access_rule: external_access_rule, request_id: request_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.update_external_access_rule(::Google::Cloud::VmwareEngine::V1::UpdateExternalAccessRuleRequest.new(update_mask: update_mask, external_access_rule: external_access_rule, request_id: request_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, update_external_access_rule_client_stub.call_count - end - end - end - - def test_delete_external_access_rule - # 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" - request_id = "hello world" - - delete_external_access_rule_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::VmwareEngine::V1::VmwareEngine::Rest::ServiceStub.stub :transcode_delete_external_access_rule_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_external_access_rule_client_stub do - # Create client - client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.delete_external_access_rule({ name: name, request_id: request_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.delete_external_access_rule name: name, request_id: request_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.delete_external_access_rule ::Google::Cloud::VmwareEngine::V1::DeleteExternalAccessRuleRequest.new(name: name, request_id: request_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.delete_external_access_rule({ name: name, request_id: request_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.delete_external_access_rule(::Google::Cloud::VmwareEngine::V1::DeleteExternalAccessRuleRequest.new(name: name, request_id: request_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, delete_external_access_rule_client_stub.call_count - end - end - end - - def test_list_logging_servers - # Create test objects. - client_result = ::Google::Cloud::VmwareEngine::V1::ListLoggingServersResponse.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_logging_servers_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::VmwareEngine::V1::VmwareEngine::Rest::ServiceStub.stub :transcode_list_logging_servers_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_logging_servers_client_stub do - # Create client - client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_logging_servers({ 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_logging_servers 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_logging_servers ::Google::Cloud::VmwareEngine::V1::ListLoggingServersRequest.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_logging_servers({ 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_logging_servers(::Google::Cloud::VmwareEngine::V1::ListLoggingServersRequest.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_logging_servers_client_stub.call_count - end - end - end - - def test_get_logging_server - # Create test objects. - client_result = ::Google::Cloud::VmwareEngine::V1::LoggingServer.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_logging_server_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::VmwareEngine::V1::VmwareEngine::Rest::ServiceStub.stub :transcode_get_logging_server_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_logging_server_client_stub do - # Create client - client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_logging_server({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_logging_server name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_logging_server ::Google::Cloud::VmwareEngine::V1::GetLoggingServerRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_logging_server({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_logging_server(::Google::Cloud::VmwareEngine::V1::GetLoggingServerRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_logging_server_client_stub.call_count - end - end - end - - def test_create_logging_server - # 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" - logging_server = {} - logging_server_id = "hello world" - request_id = "hello world" - - create_logging_server_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::VmwareEngine::V1::VmwareEngine::Rest::ServiceStub.stub :transcode_create_logging_server_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_logging_server_client_stub do - # Create client - client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_logging_server({ parent: parent, logging_server: logging_server, logging_server_id: logging_server_id, request_id: request_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_logging_server parent: parent, logging_server: logging_server, logging_server_id: logging_server_id, request_id: request_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_logging_server ::Google::Cloud::VmwareEngine::V1::CreateLoggingServerRequest.new(parent: parent, logging_server: logging_server, logging_server_id: logging_server_id, request_id: request_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_logging_server({ parent: parent, logging_server: logging_server, logging_server_id: logging_server_id, request_id: request_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_logging_server(::Google::Cloud::VmwareEngine::V1::CreateLoggingServerRequest.new(parent: parent, logging_server: logging_server, logging_server_id: logging_server_id, request_id: request_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_logging_server_client_stub.call_count - end - end - end - - def test_update_logging_server - # 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. - update_mask = {} - logging_server = {} - request_id = "hello world" - - update_logging_server_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::VmwareEngine::V1::VmwareEngine::Rest::ServiceStub.stub :transcode_update_logging_server_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_logging_server_client_stub do - # Create client - client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.update_logging_server({ update_mask: update_mask, logging_server: logging_server, request_id: request_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.update_logging_server update_mask: update_mask, logging_server: logging_server, request_id: request_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.update_logging_server ::Google::Cloud::VmwareEngine::V1::UpdateLoggingServerRequest.new(update_mask: update_mask, logging_server: logging_server, request_id: request_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.update_logging_server({ update_mask: update_mask, logging_server: logging_server, request_id: request_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.update_logging_server(::Google::Cloud::VmwareEngine::V1::UpdateLoggingServerRequest.new(update_mask: update_mask, logging_server: logging_server, request_id: request_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, update_logging_server_client_stub.call_count - end - end - end - - def test_delete_logging_server - # 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" - request_id = "hello world" - - delete_logging_server_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::VmwareEngine::V1::VmwareEngine::Rest::ServiceStub.stub :transcode_delete_logging_server_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_logging_server_client_stub do - # Create client - client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.delete_logging_server({ name: name, request_id: request_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.delete_logging_server name: name, request_id: request_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.delete_logging_server ::Google::Cloud::VmwareEngine::V1::DeleteLoggingServerRequest.new(name: name, request_id: request_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.delete_logging_server({ name: name, request_id: request_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.delete_logging_server(::Google::Cloud::VmwareEngine::V1::DeleteLoggingServerRequest.new(name: name, request_id: request_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, delete_logging_server_client_stub.call_count - end - end - end - - def test_list_node_types - # Create test objects. - client_result = ::Google::Cloud::VmwareEngine::V1::ListNodeTypesResponse.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_node_types_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::VmwareEngine::V1::VmwareEngine::Rest::ServiceStub.stub :transcode_list_node_types_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_node_types_client_stub do - # Create client - client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_node_types({ 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_node_types 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_node_types ::Google::Cloud::VmwareEngine::V1::ListNodeTypesRequest.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_node_types({ 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_node_types(::Google::Cloud::VmwareEngine::V1::ListNodeTypesRequest.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_node_types_client_stub.call_count - end - end - end - - def test_get_node_type - # Create test objects. - client_result = ::Google::Cloud::VmwareEngine::V1::NodeType.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_node_type_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::VmwareEngine::V1::VmwareEngine::Rest::ServiceStub.stub :transcode_get_node_type_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_node_type_client_stub do - # Create client - client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_node_type({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_node_type name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_node_type ::Google::Cloud::VmwareEngine::V1::GetNodeTypeRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_node_type({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_node_type(::Google::Cloud::VmwareEngine::V1::GetNodeTypeRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_node_type_client_stub.call_count - end - end - end - - def test_show_nsx_credentials - # Create test objects. - client_result = ::Google::Cloud::VmwareEngine::V1::Credentials.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - private_cloud = "hello world" - - show_nsx_credentials_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::VmwareEngine::V1::VmwareEngine::Rest::ServiceStub.stub :transcode_show_nsx_credentials_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, show_nsx_credentials_client_stub do - # Create client - client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.show_nsx_credentials({ private_cloud: private_cloud }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.show_nsx_credentials private_cloud: private_cloud do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.show_nsx_credentials ::Google::Cloud::VmwareEngine::V1::ShowNsxCredentialsRequest.new(private_cloud: private_cloud) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.show_nsx_credentials({ private_cloud: private_cloud }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.show_nsx_credentials(::Google::Cloud::VmwareEngine::V1::ShowNsxCredentialsRequest.new(private_cloud: private_cloud), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, show_nsx_credentials_client_stub.call_count - end - end - end - - def test_show_vcenter_credentials - # Create test objects. - client_result = ::Google::Cloud::VmwareEngine::V1::Credentials.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - private_cloud = "hello world" - username = "hello world" - - show_vcenter_credentials_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::VmwareEngine::V1::VmwareEngine::Rest::ServiceStub.stub :transcode_show_vcenter_credentials_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, show_vcenter_credentials_client_stub do - # Create client - client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.show_vcenter_credentials({ private_cloud: private_cloud, username: username }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.show_vcenter_credentials private_cloud: private_cloud, username: username do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.show_vcenter_credentials ::Google::Cloud::VmwareEngine::V1::ShowVcenterCredentialsRequest.new(private_cloud: private_cloud, username: username) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.show_vcenter_credentials({ private_cloud: private_cloud, username: username }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.show_vcenter_credentials(::Google::Cloud::VmwareEngine::V1::ShowVcenterCredentialsRequest.new(private_cloud: private_cloud, username: username), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, show_vcenter_credentials_client_stub.call_count - end - end - end - - def test_reset_nsx_credentials - # 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. - private_cloud = "hello world" - request_id = "hello world" - - reset_nsx_credentials_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::VmwareEngine::V1::VmwareEngine::Rest::ServiceStub.stub :transcode_reset_nsx_credentials_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, reset_nsx_credentials_client_stub do - # Create client - client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.reset_nsx_credentials({ private_cloud: private_cloud, request_id: request_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.reset_nsx_credentials private_cloud: private_cloud, request_id: request_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.reset_nsx_credentials ::Google::Cloud::VmwareEngine::V1::ResetNsxCredentialsRequest.new(private_cloud: private_cloud, request_id: request_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.reset_nsx_credentials({ private_cloud: private_cloud, request_id: request_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.reset_nsx_credentials(::Google::Cloud::VmwareEngine::V1::ResetNsxCredentialsRequest.new(private_cloud: private_cloud, request_id: request_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, reset_nsx_credentials_client_stub.call_count - end - end - end - - def test_reset_vcenter_credentials - # 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. - private_cloud = "hello world" - request_id = "hello world" - username = "hello world" - - reset_vcenter_credentials_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::VmwareEngine::V1::VmwareEngine::Rest::ServiceStub.stub :transcode_reset_vcenter_credentials_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, reset_vcenter_credentials_client_stub do - # Create client - client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.reset_vcenter_credentials({ private_cloud: private_cloud, request_id: request_id, username: username }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.reset_vcenter_credentials private_cloud: private_cloud, request_id: request_id, username: username do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.reset_vcenter_credentials ::Google::Cloud::VmwareEngine::V1::ResetVcenterCredentialsRequest.new(private_cloud: private_cloud, request_id: request_id, username: username) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.reset_vcenter_credentials({ private_cloud: private_cloud, request_id: request_id, username: username }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.reset_vcenter_credentials(::Google::Cloud::VmwareEngine::V1::ResetVcenterCredentialsRequest.new(private_cloud: private_cloud, request_id: request_id, username: username), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, reset_vcenter_credentials_client_stub.call_count - end - end - end - - def test_get_dns_forwarding - # Create test objects. - client_result = ::Google::Cloud::VmwareEngine::V1::DnsForwarding.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_dns_forwarding_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::VmwareEngine::V1::VmwareEngine::Rest::ServiceStub.stub :transcode_get_dns_forwarding_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_dns_forwarding_client_stub do - # Create client - client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_dns_forwarding({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_dns_forwarding name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_dns_forwarding ::Google::Cloud::VmwareEngine::V1::GetDnsForwardingRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_dns_forwarding({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_dns_forwarding(::Google::Cloud::VmwareEngine::V1::GetDnsForwardingRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_dns_forwarding_client_stub.call_count - end - end - end - - def test_update_dns_forwarding - # 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. - dns_forwarding = {} - update_mask = {} - request_id = "hello world" - - update_dns_forwarding_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::VmwareEngine::V1::VmwareEngine::Rest::ServiceStub.stub :transcode_update_dns_forwarding_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_dns_forwarding_client_stub do - # Create client - client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.update_dns_forwarding({ dns_forwarding: dns_forwarding, update_mask: update_mask, request_id: request_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.update_dns_forwarding dns_forwarding: dns_forwarding, update_mask: update_mask, request_id: request_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.update_dns_forwarding ::Google::Cloud::VmwareEngine::V1::UpdateDnsForwardingRequest.new(dns_forwarding: dns_forwarding, update_mask: update_mask, request_id: request_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.update_dns_forwarding({ dns_forwarding: dns_forwarding, update_mask: update_mask, request_id: request_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.update_dns_forwarding(::Google::Cloud::VmwareEngine::V1::UpdateDnsForwardingRequest.new(dns_forwarding: dns_forwarding, update_mask: update_mask, request_id: request_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, update_dns_forwarding_client_stub.call_count - end - end - end - - def test_get_network_peering - # Create test objects. - client_result = ::Google::Cloud::VmwareEngine::V1::NetworkPeering.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_network_peering_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::VmwareEngine::V1::VmwareEngine::Rest::ServiceStub.stub :transcode_get_network_peering_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_network_peering_client_stub do - # Create client - client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_network_peering({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_network_peering name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_network_peering ::Google::Cloud::VmwareEngine::V1::GetNetworkPeeringRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_network_peering({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_network_peering(::Google::Cloud::VmwareEngine::V1::GetNetworkPeeringRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_network_peering_client_stub.call_count - end - end - end - - def test_list_network_peerings - # Create test objects. - client_result = ::Google::Cloud::VmwareEngine::V1::ListNetworkPeeringsResponse.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_network_peerings_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::VmwareEngine::V1::VmwareEngine::Rest::ServiceStub.stub :transcode_list_network_peerings_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_network_peerings_client_stub do - # Create client - client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_network_peerings({ 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_network_peerings 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_network_peerings ::Google::Cloud::VmwareEngine::V1::ListNetworkPeeringsRequest.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_network_peerings({ 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_network_peerings(::Google::Cloud::VmwareEngine::V1::ListNetworkPeeringsRequest.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_network_peerings_client_stub.call_count - end - end - end - - def test_create_network_peering - # 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" - network_peering_id = "hello world" - network_peering = {} - request_id = "hello world" - - create_network_peering_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::VmwareEngine::V1::VmwareEngine::Rest::ServiceStub.stub :transcode_create_network_peering_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_network_peering_client_stub do - # Create client - client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_network_peering({ parent: parent, network_peering_id: network_peering_id, network_peering: network_peering, request_id: request_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_network_peering parent: parent, network_peering_id: network_peering_id, network_peering: network_peering, request_id: request_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_network_peering ::Google::Cloud::VmwareEngine::V1::CreateNetworkPeeringRequest.new(parent: parent, network_peering_id: network_peering_id, network_peering: network_peering, request_id: request_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_network_peering({ parent: parent, network_peering_id: network_peering_id, network_peering: network_peering, request_id: request_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_network_peering(::Google::Cloud::VmwareEngine::V1::CreateNetworkPeeringRequest.new(parent: parent, network_peering_id: network_peering_id, network_peering: network_peering, request_id: request_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_network_peering_client_stub.call_count - end - end - end - - def test_delete_network_peering - # 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" - request_id = "hello world" - - delete_network_peering_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::VmwareEngine::V1::VmwareEngine::Rest::ServiceStub.stub :transcode_delete_network_peering_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_network_peering_client_stub do - # Create client - client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.delete_network_peering({ name: name, request_id: request_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.delete_network_peering name: name, request_id: request_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.delete_network_peering ::Google::Cloud::VmwareEngine::V1::DeleteNetworkPeeringRequest.new(name: name, request_id: request_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.delete_network_peering({ name: name, request_id: request_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.delete_network_peering(::Google::Cloud::VmwareEngine::V1::DeleteNetworkPeeringRequest.new(name: name, request_id: request_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, delete_network_peering_client_stub.call_count - end - end - end - - def test_update_network_peering - # 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. - network_peering = {} - update_mask = {} - request_id = "hello world" - - update_network_peering_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::VmwareEngine::V1::VmwareEngine::Rest::ServiceStub.stub :transcode_update_network_peering_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_network_peering_client_stub do - # Create client - client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.update_network_peering({ network_peering: network_peering, update_mask: update_mask, request_id: request_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.update_network_peering network_peering: network_peering, update_mask: update_mask, request_id: request_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.update_network_peering ::Google::Cloud::VmwareEngine::V1::UpdateNetworkPeeringRequest.new(network_peering: network_peering, update_mask: update_mask, request_id: request_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.update_network_peering({ network_peering: network_peering, update_mask: update_mask, request_id: request_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.update_network_peering(::Google::Cloud::VmwareEngine::V1::UpdateNetworkPeeringRequest.new(network_peering: network_peering, update_mask: update_mask, request_id: request_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, update_network_peering_client_stub.call_count - end - end - end - - def test_list_peering_routes - # Create test objects. - client_result = ::Google::Cloud::VmwareEngine::V1::ListPeeringRoutesResponse.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_peering_routes_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::VmwareEngine::V1::VmwareEngine::Rest::ServiceStub.stub :transcode_list_peering_routes_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_peering_routes_client_stub do - # Create client - client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_peering_routes({ 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_peering_routes 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_peering_routes ::Google::Cloud::VmwareEngine::V1::ListPeeringRoutesRequest.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_peering_routes({ 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_peering_routes(::Google::Cloud::VmwareEngine::V1::ListPeeringRoutesRequest.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_peering_routes_client_stub.call_count - end - end - end - - def test_create_hcx_activation_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. - parent = "hello world" - hcx_activation_key = {} - hcx_activation_key_id = "hello world" - request_id = "hello world" - - create_hcx_activation_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::VmwareEngine::V1::VmwareEngine::Rest::ServiceStub.stub :transcode_create_hcx_activation_key_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_hcx_activation_key_client_stub do - # Create client - client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_hcx_activation_key({ parent: parent, hcx_activation_key: hcx_activation_key, hcx_activation_key_id: hcx_activation_key_id, request_id: request_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_hcx_activation_key parent: parent, hcx_activation_key: hcx_activation_key, hcx_activation_key_id: hcx_activation_key_id, request_id: request_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_hcx_activation_key ::Google::Cloud::VmwareEngine::V1::CreateHcxActivationKeyRequest.new(parent: parent, hcx_activation_key: hcx_activation_key, hcx_activation_key_id: hcx_activation_key_id, request_id: request_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_hcx_activation_key({ parent: parent, hcx_activation_key: hcx_activation_key, hcx_activation_key_id: hcx_activation_key_id, request_id: request_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_hcx_activation_key(::Google::Cloud::VmwareEngine::V1::CreateHcxActivationKeyRequest.new(parent: parent, hcx_activation_key: hcx_activation_key, hcx_activation_key_id: hcx_activation_key_id, request_id: request_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_hcx_activation_key_client_stub.call_count - end - end - end - - def test_list_hcx_activation_keys - # Create test objects. - client_result = ::Google::Cloud::VmwareEngine::V1::ListHcxActivationKeysResponse.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_hcx_activation_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::VmwareEngine::V1::VmwareEngine::Rest::ServiceStub.stub :transcode_list_hcx_activation_keys_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_hcx_activation_keys_client_stub do - # Create client - client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_hcx_activation_keys({ 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_hcx_activation_keys 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_hcx_activation_keys ::Google::Cloud::VmwareEngine::V1::ListHcxActivationKeysRequest.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_hcx_activation_keys({ 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_hcx_activation_keys(::Google::Cloud::VmwareEngine::V1::ListHcxActivationKeysRequest.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_hcx_activation_keys_client_stub.call_count - end - end - end - - def test_get_hcx_activation_key - # Create test objects. - client_result = ::Google::Cloud::VmwareEngine::V1::HcxActivationKey.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_hcx_activation_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::VmwareEngine::V1::VmwareEngine::Rest::ServiceStub.stub :transcode_get_hcx_activation_key_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_hcx_activation_key_client_stub do - # Create client - client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_hcx_activation_key({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_hcx_activation_key name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_hcx_activation_key ::Google::Cloud::VmwareEngine::V1::GetHcxActivationKeyRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_hcx_activation_key({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_hcx_activation_key(::Google::Cloud::VmwareEngine::V1::GetHcxActivationKeyRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_hcx_activation_key_client_stub.call_count - end - end - end - - def test_get_network_policy - # Create test objects. - client_result = ::Google::Cloud::VmwareEngine::V1::NetworkPolicy.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_network_policy_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::VmwareEngine::V1::VmwareEngine::Rest::ServiceStub.stub :transcode_get_network_policy_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_network_policy_client_stub do - # Create client - client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_network_policy({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_network_policy name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_network_policy ::Google::Cloud::VmwareEngine::V1::GetNetworkPolicyRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_network_policy({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_network_policy(::Google::Cloud::VmwareEngine::V1::GetNetworkPolicyRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_network_policy_client_stub.call_count - end - end - end - - def test_list_network_policies - # Create test objects. - client_result = ::Google::Cloud::VmwareEngine::V1::ListNetworkPoliciesResponse.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_network_policies_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::VmwareEngine::V1::VmwareEngine::Rest::ServiceStub.stub :transcode_list_network_policies_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_network_policies_client_stub do - # Create client - client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_network_policies({ 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_network_policies 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_network_policies ::Google::Cloud::VmwareEngine::V1::ListNetworkPoliciesRequest.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_network_policies({ 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_network_policies(::Google::Cloud::VmwareEngine::V1::ListNetworkPoliciesRequest.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_network_policies_client_stub.call_count - end - end - end - - def test_create_network_policy - # 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" - network_policy_id = "hello world" - network_policy = {} - request_id = "hello world" - - create_network_policy_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::VmwareEngine::V1::VmwareEngine::Rest::ServiceStub.stub :transcode_create_network_policy_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_network_policy_client_stub do - # Create client - client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_network_policy({ parent: parent, network_policy_id: network_policy_id, network_policy: network_policy, request_id: request_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_network_policy parent: parent, network_policy_id: network_policy_id, network_policy: network_policy, request_id: request_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_network_policy ::Google::Cloud::VmwareEngine::V1::CreateNetworkPolicyRequest.new(parent: parent, network_policy_id: network_policy_id, network_policy: network_policy, request_id: request_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_network_policy({ parent: parent, network_policy_id: network_policy_id, network_policy: network_policy, request_id: request_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_network_policy(::Google::Cloud::VmwareEngine::V1::CreateNetworkPolicyRequest.new(parent: parent, network_policy_id: network_policy_id, network_policy: network_policy, request_id: request_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_network_policy_client_stub.call_count - end - end - end - - def test_update_network_policy - # 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. - network_policy = {} - update_mask = {} - request_id = "hello world" - - update_network_policy_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::VmwareEngine::V1::VmwareEngine::Rest::ServiceStub.stub :transcode_update_network_policy_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_network_policy_client_stub do - # Create client - client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.update_network_policy({ network_policy: network_policy, update_mask: update_mask, request_id: request_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.update_network_policy network_policy: network_policy, update_mask: update_mask, request_id: request_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.update_network_policy ::Google::Cloud::VmwareEngine::V1::UpdateNetworkPolicyRequest.new(network_policy: network_policy, update_mask: update_mask, request_id: request_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.update_network_policy({ network_policy: network_policy, update_mask: update_mask, request_id: request_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.update_network_policy(::Google::Cloud::VmwareEngine::V1::UpdateNetworkPolicyRequest.new(network_policy: network_policy, update_mask: update_mask, request_id: request_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, update_network_policy_client_stub.call_count - end - end - end - - def test_delete_network_policy - # 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" - request_id = "hello world" - - delete_network_policy_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::VmwareEngine::V1::VmwareEngine::Rest::ServiceStub.stub :transcode_delete_network_policy_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_network_policy_client_stub do - # Create client - client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.delete_network_policy({ name: name, request_id: request_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.delete_network_policy name: name, request_id: request_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.delete_network_policy ::Google::Cloud::VmwareEngine::V1::DeleteNetworkPolicyRequest.new(name: name, request_id: request_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.delete_network_policy({ name: name, request_id: request_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.delete_network_policy(::Google::Cloud::VmwareEngine::V1::DeleteNetworkPolicyRequest.new(name: name, request_id: request_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, delete_network_policy_client_stub.call_count - end - end - end - - def test_list_management_dns_zone_bindings - # Create test objects. - client_result = ::Google::Cloud::VmwareEngine::V1::ListManagementDnsZoneBindingsResponse.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_management_dns_zone_bindings_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::VmwareEngine::V1::VmwareEngine::Rest::ServiceStub.stub :transcode_list_management_dns_zone_bindings_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_management_dns_zone_bindings_client_stub do - # Create client - client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_management_dns_zone_bindings({ 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_management_dns_zone_bindings 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_management_dns_zone_bindings ::Google::Cloud::VmwareEngine::V1::ListManagementDnsZoneBindingsRequest.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_management_dns_zone_bindings({ 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_management_dns_zone_bindings(::Google::Cloud::VmwareEngine::V1::ListManagementDnsZoneBindingsRequest.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_management_dns_zone_bindings_client_stub.call_count - end - end - end - - def test_get_management_dns_zone_binding - # Create test objects. - client_result = ::Google::Cloud::VmwareEngine::V1::ManagementDnsZoneBinding.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_management_dns_zone_binding_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::VmwareEngine::V1::VmwareEngine::Rest::ServiceStub.stub :transcode_get_management_dns_zone_binding_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_management_dns_zone_binding_client_stub do - # Create client - client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_management_dns_zone_binding({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_management_dns_zone_binding name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_management_dns_zone_binding ::Google::Cloud::VmwareEngine::V1::GetManagementDnsZoneBindingRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_management_dns_zone_binding({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_management_dns_zone_binding(::Google::Cloud::VmwareEngine::V1::GetManagementDnsZoneBindingRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_management_dns_zone_binding_client_stub.call_count - end - end - end - - def test_create_management_dns_zone_binding - # 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" - management_dns_zone_binding = {} - management_dns_zone_binding_id = "hello world" - request_id = "hello world" - - create_management_dns_zone_binding_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::VmwareEngine::V1::VmwareEngine::Rest::ServiceStub.stub :transcode_create_management_dns_zone_binding_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_management_dns_zone_binding_client_stub do - # Create client - client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_management_dns_zone_binding({ parent: parent, management_dns_zone_binding: management_dns_zone_binding, management_dns_zone_binding_id: management_dns_zone_binding_id, request_id: request_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_management_dns_zone_binding parent: parent, management_dns_zone_binding: management_dns_zone_binding, management_dns_zone_binding_id: management_dns_zone_binding_id, request_id: request_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_management_dns_zone_binding ::Google::Cloud::VmwareEngine::V1::CreateManagementDnsZoneBindingRequest.new(parent: parent, management_dns_zone_binding: management_dns_zone_binding, management_dns_zone_binding_id: management_dns_zone_binding_id, request_id: request_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_management_dns_zone_binding({ parent: parent, management_dns_zone_binding: management_dns_zone_binding, management_dns_zone_binding_id: management_dns_zone_binding_id, request_id: request_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_management_dns_zone_binding(::Google::Cloud::VmwareEngine::V1::CreateManagementDnsZoneBindingRequest.new(parent: parent, management_dns_zone_binding: management_dns_zone_binding, management_dns_zone_binding_id: management_dns_zone_binding_id, request_id: request_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_management_dns_zone_binding_client_stub.call_count - end - end - end - - def test_update_management_dns_zone_binding - # 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. - update_mask = {} - management_dns_zone_binding = {} - request_id = "hello world" - - update_management_dns_zone_binding_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::VmwareEngine::V1::VmwareEngine::Rest::ServiceStub.stub :transcode_update_management_dns_zone_binding_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_management_dns_zone_binding_client_stub do - # Create client - client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.update_management_dns_zone_binding({ update_mask: update_mask, management_dns_zone_binding: management_dns_zone_binding, request_id: request_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.update_management_dns_zone_binding update_mask: update_mask, management_dns_zone_binding: management_dns_zone_binding, request_id: request_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.update_management_dns_zone_binding ::Google::Cloud::VmwareEngine::V1::UpdateManagementDnsZoneBindingRequest.new(update_mask: update_mask, management_dns_zone_binding: management_dns_zone_binding, request_id: request_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.update_management_dns_zone_binding({ update_mask: update_mask, management_dns_zone_binding: management_dns_zone_binding, request_id: request_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.update_management_dns_zone_binding(::Google::Cloud::VmwareEngine::V1::UpdateManagementDnsZoneBindingRequest.new(update_mask: update_mask, management_dns_zone_binding: management_dns_zone_binding, request_id: request_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, update_management_dns_zone_binding_client_stub.call_count - end - end - end - - def test_delete_management_dns_zone_binding - # 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" - request_id = "hello world" - - delete_management_dns_zone_binding_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::VmwareEngine::V1::VmwareEngine::Rest::ServiceStub.stub :transcode_delete_management_dns_zone_binding_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_management_dns_zone_binding_client_stub do - # Create client - client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.delete_management_dns_zone_binding({ name: name, request_id: request_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.delete_management_dns_zone_binding name: name, request_id: request_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.delete_management_dns_zone_binding ::Google::Cloud::VmwareEngine::V1::DeleteManagementDnsZoneBindingRequest.new(name: name, request_id: request_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.delete_management_dns_zone_binding({ name: name, request_id: request_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.delete_management_dns_zone_binding(::Google::Cloud::VmwareEngine::V1::DeleteManagementDnsZoneBindingRequest.new(name: name, request_id: request_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, delete_management_dns_zone_binding_client_stub.call_count - end - end - end - - def test_repair_management_dns_zone_binding - # 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" - request_id = "hello world" - - repair_management_dns_zone_binding_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::VmwareEngine::V1::VmwareEngine::Rest::ServiceStub.stub :transcode_repair_management_dns_zone_binding_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, repair_management_dns_zone_binding_client_stub do - # Create client - client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.repair_management_dns_zone_binding({ name: name, request_id: request_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.repair_management_dns_zone_binding name: name, request_id: request_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.repair_management_dns_zone_binding ::Google::Cloud::VmwareEngine::V1::RepairManagementDnsZoneBindingRequest.new(name: name, request_id: request_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.repair_management_dns_zone_binding({ name: name, request_id: request_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.repair_management_dns_zone_binding(::Google::Cloud::VmwareEngine::V1::RepairManagementDnsZoneBindingRequest.new(name: name, request_id: request_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, repair_management_dns_zone_binding_client_stub.call_count - end - end - end - - def test_create_vmware_engine_network - # 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" - vmware_engine_network_id = "hello world" - vmware_engine_network = {} - request_id = "hello world" - - create_vmware_engine_network_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::VmwareEngine::V1::VmwareEngine::Rest::ServiceStub.stub :transcode_create_vmware_engine_network_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_vmware_engine_network_client_stub do - # Create client - client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_vmware_engine_network({ parent: parent, vmware_engine_network_id: vmware_engine_network_id, vmware_engine_network: vmware_engine_network, request_id: request_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_vmware_engine_network parent: parent, vmware_engine_network_id: vmware_engine_network_id, vmware_engine_network: vmware_engine_network, request_id: request_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_vmware_engine_network ::Google::Cloud::VmwareEngine::V1::CreateVmwareEngineNetworkRequest.new(parent: parent, vmware_engine_network_id: vmware_engine_network_id, vmware_engine_network: vmware_engine_network, request_id: request_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_vmware_engine_network({ parent: parent, vmware_engine_network_id: vmware_engine_network_id, vmware_engine_network: vmware_engine_network, request_id: request_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_vmware_engine_network(::Google::Cloud::VmwareEngine::V1::CreateVmwareEngineNetworkRequest.new(parent: parent, vmware_engine_network_id: vmware_engine_network_id, vmware_engine_network: vmware_engine_network, request_id: request_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_vmware_engine_network_client_stub.call_count - end - end - end - - def test_update_vmware_engine_network - # 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. - vmware_engine_network = {} - update_mask = {} - request_id = "hello world" - - update_vmware_engine_network_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::VmwareEngine::V1::VmwareEngine::Rest::ServiceStub.stub :transcode_update_vmware_engine_network_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_vmware_engine_network_client_stub do - # Create client - client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.update_vmware_engine_network({ vmware_engine_network: vmware_engine_network, update_mask: update_mask, request_id: request_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.update_vmware_engine_network vmware_engine_network: vmware_engine_network, update_mask: update_mask, request_id: request_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.update_vmware_engine_network ::Google::Cloud::VmwareEngine::V1::UpdateVmwareEngineNetworkRequest.new(vmware_engine_network: vmware_engine_network, update_mask: update_mask, request_id: request_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.update_vmware_engine_network({ vmware_engine_network: vmware_engine_network, update_mask: update_mask, request_id: request_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.update_vmware_engine_network(::Google::Cloud::VmwareEngine::V1::UpdateVmwareEngineNetworkRequest.new(vmware_engine_network: vmware_engine_network, update_mask: update_mask, request_id: request_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, update_vmware_engine_network_client_stub.call_count - end - end - end - - def test_delete_vmware_engine_network - # 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" - request_id = "hello world" - etag = "hello world" - - delete_vmware_engine_network_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::VmwareEngine::V1::VmwareEngine::Rest::ServiceStub.stub :transcode_delete_vmware_engine_network_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_vmware_engine_network_client_stub do - # Create client - client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.delete_vmware_engine_network({ name: name, request_id: request_id, etag: etag }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.delete_vmware_engine_network name: name, request_id: request_id, etag: etag do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.delete_vmware_engine_network ::Google::Cloud::VmwareEngine::V1::DeleteVmwareEngineNetworkRequest.new(name: name, request_id: request_id, etag: etag) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.delete_vmware_engine_network({ name: name, request_id: request_id, etag: etag }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.delete_vmware_engine_network(::Google::Cloud::VmwareEngine::V1::DeleteVmwareEngineNetworkRequest.new(name: name, request_id: request_id, etag: etag), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, delete_vmware_engine_network_client_stub.call_count - end - end - end - - def test_get_vmware_engine_network - # Create test objects. - client_result = ::Google::Cloud::VmwareEngine::V1::VmwareEngineNetwork.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_vmware_engine_network_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::VmwareEngine::V1::VmwareEngine::Rest::ServiceStub.stub :transcode_get_vmware_engine_network_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_vmware_engine_network_client_stub do - # Create client - client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_vmware_engine_network({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_vmware_engine_network name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_vmware_engine_network ::Google::Cloud::VmwareEngine::V1::GetVmwareEngineNetworkRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_vmware_engine_network({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_vmware_engine_network(::Google::Cloud::VmwareEngine::V1::GetVmwareEngineNetworkRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_vmware_engine_network_client_stub.call_count - end - end - end - - def test_list_vmware_engine_networks - # Create test objects. - client_result = ::Google::Cloud::VmwareEngine::V1::ListVmwareEngineNetworksResponse.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_vmware_engine_networks_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::VmwareEngine::V1::VmwareEngine::Rest::ServiceStub.stub :transcode_list_vmware_engine_networks_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_vmware_engine_networks_client_stub do - # Create client - client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_vmware_engine_networks({ 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_vmware_engine_networks 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_vmware_engine_networks ::Google::Cloud::VmwareEngine::V1::ListVmwareEngineNetworksRequest.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_vmware_engine_networks({ 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_vmware_engine_networks(::Google::Cloud::VmwareEngine::V1::ListVmwareEngineNetworksRequest.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_vmware_engine_networks_client_stub.call_count - end - end - end - - def test_create_private_connection - # 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" - private_connection_id = "hello world" - private_connection = {} - request_id = "hello world" - - create_private_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::VmwareEngine::V1::VmwareEngine::Rest::ServiceStub.stub :transcode_create_private_connection_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_private_connection_client_stub do - # Create client - client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_private_connection({ parent: parent, private_connection_id: private_connection_id, private_connection: private_connection, request_id: request_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_private_connection parent: parent, private_connection_id: private_connection_id, private_connection: private_connection, request_id: request_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_private_connection ::Google::Cloud::VmwareEngine::V1::CreatePrivateConnectionRequest.new(parent: parent, private_connection_id: private_connection_id, private_connection: private_connection, request_id: request_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_private_connection({ parent: parent, private_connection_id: private_connection_id, private_connection: private_connection, request_id: request_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_private_connection(::Google::Cloud::VmwareEngine::V1::CreatePrivateConnectionRequest.new(parent: parent, private_connection_id: private_connection_id, private_connection: private_connection, request_id: request_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_private_connection_client_stub.call_count - end - end - end - - def test_get_private_connection - # Create test objects. - client_result = ::Google::Cloud::VmwareEngine::V1::PrivateConnection.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_private_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::VmwareEngine::V1::VmwareEngine::Rest::ServiceStub.stub :transcode_get_private_connection_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_private_connection_client_stub do - # Create client - client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_private_connection({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_private_connection name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_private_connection ::Google::Cloud::VmwareEngine::V1::GetPrivateConnectionRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_private_connection({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_private_connection(::Google::Cloud::VmwareEngine::V1::GetPrivateConnectionRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_private_connection_client_stub.call_count - end - end - end - - def test_list_private_connections - # Create test objects. - client_result = ::Google::Cloud::VmwareEngine::V1::ListPrivateConnectionsResponse.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_private_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::VmwareEngine::V1::VmwareEngine::Rest::ServiceStub.stub :transcode_list_private_connections_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_private_connections_client_stub do - # Create client - client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_private_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_private_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_private_connections ::Google::Cloud::VmwareEngine::V1::ListPrivateConnectionsRequest.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_private_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_private_connections(::Google::Cloud::VmwareEngine::V1::ListPrivateConnectionsRequest.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_private_connections_client_stub.call_count - end - end - end - - def test_update_private_connection - # 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. - private_connection = {} - update_mask = {} - request_id = "hello world" - - update_private_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::VmwareEngine::V1::VmwareEngine::Rest::ServiceStub.stub :transcode_update_private_connection_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_private_connection_client_stub do - # Create client - client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.update_private_connection({ private_connection: private_connection, update_mask: update_mask, request_id: request_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.update_private_connection private_connection: private_connection, update_mask: update_mask, request_id: request_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.update_private_connection ::Google::Cloud::VmwareEngine::V1::UpdatePrivateConnectionRequest.new(private_connection: private_connection, update_mask: update_mask, request_id: request_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.update_private_connection({ private_connection: private_connection, update_mask: update_mask, request_id: request_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.update_private_connection(::Google::Cloud::VmwareEngine::V1::UpdatePrivateConnectionRequest.new(private_connection: private_connection, update_mask: update_mask, request_id: request_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, update_private_connection_client_stub.call_count - end - end - end - - def test_delete_private_connection - # 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" - request_id = "hello world" - - delete_private_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::VmwareEngine::V1::VmwareEngine::Rest::ServiceStub.stub :transcode_delete_private_connection_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_private_connection_client_stub do - # Create client - client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.delete_private_connection({ name: name, request_id: request_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.delete_private_connection name: name, request_id: request_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.delete_private_connection ::Google::Cloud::VmwareEngine::V1::DeletePrivateConnectionRequest.new(name: name, request_id: request_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.delete_private_connection({ name: name, request_id: request_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.delete_private_connection(::Google::Cloud::VmwareEngine::V1::DeletePrivateConnectionRequest.new(name: name, request_id: request_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, delete_private_connection_client_stub.call_count - end - end - end - - def test_list_private_connection_peering_routes - # Create test objects. - client_result = ::Google::Cloud::VmwareEngine::V1::ListPrivateConnectionPeeringRoutesResponse.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_private_connection_peering_routes_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::VmwareEngine::V1::VmwareEngine::Rest::ServiceStub.stub :transcode_list_private_connection_peering_routes_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_private_connection_peering_routes_client_stub do - # Create client - client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_private_connection_peering_routes({ 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_private_connection_peering_routes 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_private_connection_peering_routes ::Google::Cloud::VmwareEngine::V1::ListPrivateConnectionPeeringRoutesRequest.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_private_connection_peering_routes({ 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_private_connection_peering_routes(::Google::Cloud::VmwareEngine::V1::ListPrivateConnectionPeeringRoutesRequest.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_private_connection_peering_routes_client_stub.call_count - end - end - end - - def test_grant_dns_bind_permission - # 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" - principal = {} - request_id = "hello world" - - grant_dns_bind_permission_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::VmwareEngine::V1::VmwareEngine::Rest::ServiceStub.stub :transcode_grant_dns_bind_permission_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, grant_dns_bind_permission_client_stub do - # Create client - client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.grant_dns_bind_permission({ name: name, principal: principal, request_id: request_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.grant_dns_bind_permission name: name, principal: principal, request_id: request_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.grant_dns_bind_permission ::Google::Cloud::VmwareEngine::V1::GrantDnsBindPermissionRequest.new(name: name, principal: principal, request_id: request_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.grant_dns_bind_permission({ name: name, principal: principal, request_id: request_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.grant_dns_bind_permission(::Google::Cloud::VmwareEngine::V1::GrantDnsBindPermissionRequest.new(name: name, principal: principal, request_id: request_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, grant_dns_bind_permission_client_stub.call_count - end - end - end - - def test_get_dns_bind_permission - # Create test objects. - client_result = ::Google::Cloud::VmwareEngine::V1::DnsBindPermission.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_dns_bind_permission_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::VmwareEngine::V1::VmwareEngine::Rest::ServiceStub.stub :transcode_get_dns_bind_permission_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_dns_bind_permission_client_stub do - # Create client - client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_dns_bind_permission({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_dns_bind_permission name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_dns_bind_permission ::Google::Cloud::VmwareEngine::V1::GetDnsBindPermissionRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_dns_bind_permission({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_dns_bind_permission(::Google::Cloud::VmwareEngine::V1::GetDnsBindPermissionRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_dns_bind_permission_client_stub.call_count - end - end - end - - def test_revoke_dns_bind_permission - # 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" - principal = {} - request_id = "hello world" - - revoke_dns_bind_permission_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::VmwareEngine::V1::VmwareEngine::Rest::ServiceStub.stub :transcode_revoke_dns_bind_permission_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, revoke_dns_bind_permission_client_stub do - # Create client - client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.revoke_dns_bind_permission({ name: name, principal: principal, request_id: request_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.revoke_dns_bind_permission name: name, principal: principal, request_id: request_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.revoke_dns_bind_permission ::Google::Cloud::VmwareEngine::V1::RevokeDnsBindPermissionRequest.new(name: name, principal: principal, request_id: request_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.revoke_dns_bind_permission({ name: name, principal: principal, request_id: request_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.revoke_dns_bind_permission(::Google::Cloud::VmwareEngine::V1::RevokeDnsBindPermissionRequest.new(name: name, principal: principal, request_id: request_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, revoke_dns_bind_permission_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::VmwareEngine::V1::VmwareEngine::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::VmwareEngine::V1::VmwareEngine::Rest::Client::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-vmware_engine-v1/test/google/cloud/vmware_engine/v1/vmware_engine_test.rb b/owl-bot-staging/google-cloud-vmware_engine-v1/test/google/cloud/vmware_engine/v1/vmware_engine_test.rb deleted file mode 100644 index 354662f546d4..000000000000 --- a/owl-bot-staging/google-cloud-vmware_engine-v1/test/google/cloud/vmware_engine/v1/vmware_engine_test.rb +++ /dev/null @@ -1,4967 +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/vmwareengine/v1/vmwareengine_pb" -require "google/cloud/vmware_engine/v1/vmware_engine" - -class ::Google::Cloud::VmwareEngine::V1::VmwareEngine::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_private_clouds - # Create GRPC objects. - grpc_response = ::Google::Cloud::VmwareEngine::V1::ListPrivateCloudsResponse.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_private_clouds_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_private_clouds, name - assert_kind_of ::Google::Cloud::VmwareEngine::V1::ListPrivateCloudsRequest, 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_private_clouds_client_stub do - # Create client - client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_private_clouds({ 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_private_clouds 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_private_clouds ::Google::Cloud::VmwareEngine::V1::ListPrivateCloudsRequest.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_private_clouds({ 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_private_clouds(::Google::Cloud::VmwareEngine::V1::ListPrivateCloudsRequest.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_private_clouds_client_stub.call_rpc_count - end - end - - def test_get_private_cloud - # Create GRPC objects. - grpc_response = ::Google::Cloud::VmwareEngine::V1::PrivateCloud.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_private_cloud_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_private_cloud, name - assert_kind_of ::Google::Cloud::VmwareEngine::V1::GetPrivateCloudRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_private_cloud_client_stub do - # Create client - client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_private_cloud({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_private_cloud name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_private_cloud ::Google::Cloud::VmwareEngine::V1::GetPrivateCloudRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_private_cloud({ 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_private_cloud(::Google::Cloud::VmwareEngine::V1::GetPrivateCloudRequest.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_private_cloud_client_stub.call_rpc_count - end - end - - def test_create_private_cloud - # 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" - private_cloud_id = "hello world" - private_cloud = {} - request_id = "hello world" - validate_only = true - - create_private_cloud_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_private_cloud, name - assert_kind_of ::Google::Cloud::VmwareEngine::V1::CreatePrivateCloudRequest, request - assert_equal "hello world", request["parent"] - assert_equal "hello world", request["private_cloud_id"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::VmwareEngine::V1::PrivateCloud), request["private_cloud"] - assert_equal "hello world", request["request_id"] - assert_equal true, request["validate_only"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_private_cloud_client_stub do - # Create client - client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_private_cloud({ parent: parent, private_cloud_id: private_cloud_id, private_cloud: private_cloud, request_id: request_id, validate_only: validate_only }) 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_private_cloud parent: parent, private_cloud_id: private_cloud_id, private_cloud: private_cloud, request_id: request_id, validate_only: validate_only 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_private_cloud ::Google::Cloud::VmwareEngine::V1::CreatePrivateCloudRequest.new(parent: parent, private_cloud_id: private_cloud_id, private_cloud: private_cloud, request_id: request_id, validate_only: validate_only) 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_private_cloud({ parent: parent, private_cloud_id: private_cloud_id, private_cloud: private_cloud, request_id: request_id, validate_only: validate_only }, 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_private_cloud(::Google::Cloud::VmwareEngine::V1::CreatePrivateCloudRequest.new(parent: parent, private_cloud_id: private_cloud_id, private_cloud: private_cloud, request_id: request_id, validate_only: validate_only), 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_private_cloud_client_stub.call_rpc_count - end - end - - def test_update_private_cloud - # 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. - private_cloud = {} - update_mask = {} - request_id = "hello world" - - update_private_cloud_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_private_cloud, name - assert_kind_of ::Google::Cloud::VmwareEngine::V1::UpdatePrivateCloudRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::VmwareEngine::V1::PrivateCloud), request["private_cloud"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - assert_equal "hello world", request["request_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_private_cloud_client_stub do - # Create client - client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_private_cloud({ private_cloud: private_cloud, update_mask: update_mask, request_id: request_id }) 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.update_private_cloud private_cloud: private_cloud, update_mask: update_mask, request_id: request_id 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.update_private_cloud ::Google::Cloud::VmwareEngine::V1::UpdatePrivateCloudRequest.new(private_cloud: private_cloud, update_mask: update_mask, request_id: request_id) 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.update_private_cloud({ private_cloud: private_cloud, update_mask: update_mask, request_id: request_id }, 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.update_private_cloud(::Google::Cloud::VmwareEngine::V1::UpdatePrivateCloudRequest.new(private_cloud: private_cloud, update_mask: update_mask, request_id: request_id), 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, update_private_cloud_client_stub.call_rpc_count - end - end - - def test_delete_private_cloud - # 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" - request_id = "hello world" - force = true - delay_hours = 42 - - delete_private_cloud_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_private_cloud, name - assert_kind_of ::Google::Cloud::VmwareEngine::V1::DeletePrivateCloudRequest, request - assert_equal "hello world", request["name"] - assert_equal "hello world", request["request_id"] - assert_equal true, request["force"] - assert_equal 42, request["delay_hours"] - assert request.has_delay_hours? - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_private_cloud_client_stub do - # Create client - client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_private_cloud({ name: name, request_id: request_id, force: force, delay_hours: delay_hours }) 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_private_cloud name: name, request_id: request_id, force: force, delay_hours: delay_hours 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_private_cloud ::Google::Cloud::VmwareEngine::V1::DeletePrivateCloudRequest.new(name: name, request_id: request_id, force: force, delay_hours: delay_hours) 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_private_cloud({ name: name, request_id: request_id, force: force, delay_hours: delay_hours }, 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_private_cloud(::Google::Cloud::VmwareEngine::V1::DeletePrivateCloudRequest.new(name: name, request_id: request_id, force: force, delay_hours: delay_hours), 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_private_cloud_client_stub.call_rpc_count - end - end - - def test_undelete_private_cloud - # 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" - request_id = "hello world" - - undelete_private_cloud_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :undelete_private_cloud, name - assert_kind_of ::Google::Cloud::VmwareEngine::V1::UndeletePrivateCloudRequest, request - assert_equal "hello world", request["name"] - assert_equal "hello world", request["request_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, undelete_private_cloud_client_stub do - # Create client - client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.undelete_private_cloud({ name: name, request_id: request_id }) 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.undelete_private_cloud name: name, request_id: request_id 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.undelete_private_cloud ::Google::Cloud::VmwareEngine::V1::UndeletePrivateCloudRequest.new(name: name, request_id: request_id) 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.undelete_private_cloud({ name: name, request_id: request_id }, 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.undelete_private_cloud(::Google::Cloud::VmwareEngine::V1::UndeletePrivateCloudRequest.new(name: name, request_id: request_id), 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, undelete_private_cloud_client_stub.call_rpc_count - end - end - - def test_list_clusters - # Create GRPC objects. - grpc_response = ::Google::Cloud::VmwareEngine::V1::ListClustersResponse.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_clusters_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_clusters, name - assert_kind_of ::Google::Cloud::VmwareEngine::V1::ListClustersRequest, 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_clusters_client_stub do - # Create client - client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_clusters({ 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_clusters 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_clusters ::Google::Cloud::VmwareEngine::V1::ListClustersRequest.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_clusters({ 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_clusters(::Google::Cloud::VmwareEngine::V1::ListClustersRequest.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_clusters_client_stub.call_rpc_count - end - end - - def test_get_cluster - # Create GRPC objects. - grpc_response = ::Google::Cloud::VmwareEngine::V1::Cluster.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_cluster_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_cluster, name - assert_kind_of ::Google::Cloud::VmwareEngine::V1::GetClusterRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_cluster_client_stub do - # Create client - client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_cluster({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_cluster name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_cluster ::Google::Cloud::VmwareEngine::V1::GetClusterRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_cluster({ 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_cluster(::Google::Cloud::VmwareEngine::V1::GetClusterRequest.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_cluster_client_stub.call_rpc_count - end - end - - def test_create_cluster - # 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" - cluster_id = "hello world" - cluster = {} - request_id = "hello world" - validate_only = true - - create_cluster_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_cluster, name - assert_kind_of ::Google::Cloud::VmwareEngine::V1::CreateClusterRequest, request - assert_equal "hello world", request["parent"] - assert_equal "hello world", request["cluster_id"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::VmwareEngine::V1::Cluster), request["cluster"] - assert_equal "hello world", request["request_id"] - assert_equal true, request["validate_only"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_cluster_client_stub do - # Create client - client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_cluster({ parent: parent, cluster_id: cluster_id, cluster: cluster, request_id: request_id, validate_only: validate_only }) 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_cluster parent: parent, cluster_id: cluster_id, cluster: cluster, request_id: request_id, validate_only: validate_only 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_cluster ::Google::Cloud::VmwareEngine::V1::CreateClusterRequest.new(parent: parent, cluster_id: cluster_id, cluster: cluster, request_id: request_id, validate_only: validate_only) 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_cluster({ parent: parent, cluster_id: cluster_id, cluster: cluster, request_id: request_id, validate_only: validate_only }, 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_cluster(::Google::Cloud::VmwareEngine::V1::CreateClusterRequest.new(parent: parent, cluster_id: cluster_id, cluster: cluster, request_id: request_id, validate_only: validate_only), 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_cluster_client_stub.call_rpc_count - end - end - - def test_update_cluster - # 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. - update_mask = {} - cluster = {} - request_id = "hello world" - validate_only = true - - update_cluster_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_cluster, name - assert_kind_of ::Google::Cloud::VmwareEngine::V1::UpdateClusterRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::VmwareEngine::V1::Cluster), request["cluster"] - assert_equal "hello world", request["request_id"] - assert_equal true, request["validate_only"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_cluster_client_stub do - # Create client - client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_cluster({ update_mask: update_mask, cluster: cluster, request_id: request_id, validate_only: validate_only }) 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.update_cluster update_mask: update_mask, cluster: cluster, request_id: request_id, validate_only: validate_only 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.update_cluster ::Google::Cloud::VmwareEngine::V1::UpdateClusterRequest.new(update_mask: update_mask, cluster: cluster, request_id: request_id, validate_only: validate_only) 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.update_cluster({ update_mask: update_mask, cluster: cluster, request_id: request_id, validate_only: validate_only }, 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.update_cluster(::Google::Cloud::VmwareEngine::V1::UpdateClusterRequest.new(update_mask: update_mask, cluster: cluster, request_id: request_id, validate_only: validate_only), 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, update_cluster_client_stub.call_rpc_count - end - end - - def test_delete_cluster - # 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" - request_id = "hello world" - - delete_cluster_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_cluster, name - assert_kind_of ::Google::Cloud::VmwareEngine::V1::DeleteClusterRequest, request - assert_equal "hello world", request["name"] - assert_equal "hello world", request["request_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_cluster_client_stub do - # Create client - client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_cluster({ name: name, request_id: request_id }) 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_cluster name: name, request_id: request_id 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_cluster ::Google::Cloud::VmwareEngine::V1::DeleteClusterRequest.new(name: name, request_id: request_id) 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_cluster({ name: name, request_id: request_id }, 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_cluster(::Google::Cloud::VmwareEngine::V1::DeleteClusterRequest.new(name: name, request_id: request_id), 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_cluster_client_stub.call_rpc_count - end - end - - def test_list_nodes - # Create GRPC objects. - grpc_response = ::Google::Cloud::VmwareEngine::V1::ListNodesResponse.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_nodes_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_nodes, name - assert_kind_of ::Google::Cloud::VmwareEngine::V1::ListNodesRequest, 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_nodes_client_stub do - # Create client - client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_nodes({ 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_nodes 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_nodes ::Google::Cloud::VmwareEngine::V1::ListNodesRequest.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_nodes({ 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_nodes(::Google::Cloud::VmwareEngine::V1::ListNodesRequest.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_nodes_client_stub.call_rpc_count - end - end - - def test_get_node - # Create GRPC objects. - grpc_response = ::Google::Cloud::VmwareEngine::V1::Node.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_node_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_node, name - assert_kind_of ::Google::Cloud::VmwareEngine::V1::GetNodeRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_node_client_stub do - # Create client - client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_node({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_node name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_node ::Google::Cloud::VmwareEngine::V1::GetNodeRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_node({ 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_node(::Google::Cloud::VmwareEngine::V1::GetNodeRequest.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_node_client_stub.call_rpc_count - end - end - - def test_list_external_addresses - # Create GRPC objects. - grpc_response = ::Google::Cloud::VmwareEngine::V1::ListExternalAddressesResponse.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_external_addresses_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_external_addresses, name - assert_kind_of ::Google::Cloud::VmwareEngine::V1::ListExternalAddressesRequest, 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_external_addresses_client_stub do - # Create client - client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_external_addresses({ 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_external_addresses 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_external_addresses ::Google::Cloud::VmwareEngine::V1::ListExternalAddressesRequest.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_external_addresses({ 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_external_addresses(::Google::Cloud::VmwareEngine::V1::ListExternalAddressesRequest.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_external_addresses_client_stub.call_rpc_count - end - end - - def test_fetch_network_policy_external_addresses - # Create GRPC objects. - grpc_response = ::Google::Cloud::VmwareEngine::V1::FetchNetworkPolicyExternalAddressesResponse.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. - network_policy = "hello world" - page_size = 42 - page_token = "hello world" - - fetch_network_policy_external_addresses_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :fetch_network_policy_external_addresses, name - assert_kind_of ::Google::Cloud::VmwareEngine::V1::FetchNetworkPolicyExternalAddressesRequest, request - assert_equal "hello world", request["network_policy"] - assert_equal 42, request["page_size"] - assert_equal "hello world", request["page_token"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, fetch_network_policy_external_addresses_client_stub do - # Create client - client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.fetch_network_policy_external_addresses({ network_policy: network_policy, 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.fetch_network_policy_external_addresses network_policy: network_policy, 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.fetch_network_policy_external_addresses ::Google::Cloud::VmwareEngine::V1::FetchNetworkPolicyExternalAddressesRequest.new(network_policy: network_policy, 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.fetch_network_policy_external_addresses({ network_policy: network_policy, 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.fetch_network_policy_external_addresses(::Google::Cloud::VmwareEngine::V1::FetchNetworkPolicyExternalAddressesRequest.new(network_policy: network_policy, 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, fetch_network_policy_external_addresses_client_stub.call_rpc_count - end - end - - def test_get_external_address - # Create GRPC objects. - grpc_response = ::Google::Cloud::VmwareEngine::V1::ExternalAddress.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_external_address_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_external_address, name - assert_kind_of ::Google::Cloud::VmwareEngine::V1::GetExternalAddressRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_external_address_client_stub do - # Create client - client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_external_address({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_external_address name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_external_address ::Google::Cloud::VmwareEngine::V1::GetExternalAddressRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_external_address({ 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_external_address(::Google::Cloud::VmwareEngine::V1::GetExternalAddressRequest.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_external_address_client_stub.call_rpc_count - end - end - - def test_create_external_address - # 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" - external_address = {} - external_address_id = "hello world" - request_id = "hello world" - - create_external_address_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_external_address, name - assert_kind_of ::Google::Cloud::VmwareEngine::V1::CreateExternalAddressRequest, request - assert_equal "hello world", request["parent"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::VmwareEngine::V1::ExternalAddress), request["external_address"] - assert_equal "hello world", request["external_address_id"] - assert_equal "hello world", request["request_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_external_address_client_stub do - # Create client - client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_external_address({ parent: parent, external_address: external_address, external_address_id: external_address_id, request_id: request_id }) 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_external_address parent: parent, external_address: external_address, external_address_id: external_address_id, request_id: request_id 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_external_address ::Google::Cloud::VmwareEngine::V1::CreateExternalAddressRequest.new(parent: parent, external_address: external_address, external_address_id: external_address_id, request_id: request_id) 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_external_address({ parent: parent, external_address: external_address, external_address_id: external_address_id, request_id: request_id }, 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_external_address(::Google::Cloud::VmwareEngine::V1::CreateExternalAddressRequest.new(parent: parent, external_address: external_address, external_address_id: external_address_id, request_id: request_id), 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_external_address_client_stub.call_rpc_count - end - end - - def test_update_external_address - # 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. - update_mask = {} - external_address = {} - request_id = "hello world" - - update_external_address_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_external_address, name - assert_kind_of ::Google::Cloud::VmwareEngine::V1::UpdateExternalAddressRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::VmwareEngine::V1::ExternalAddress), request["external_address"] - assert_equal "hello world", request["request_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_external_address_client_stub do - # Create client - client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_external_address({ update_mask: update_mask, external_address: external_address, request_id: request_id }) 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.update_external_address update_mask: update_mask, external_address: external_address, request_id: request_id 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.update_external_address ::Google::Cloud::VmwareEngine::V1::UpdateExternalAddressRequest.new(update_mask: update_mask, external_address: external_address, request_id: request_id) 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.update_external_address({ update_mask: update_mask, external_address: external_address, request_id: request_id }, 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.update_external_address(::Google::Cloud::VmwareEngine::V1::UpdateExternalAddressRequest.new(update_mask: update_mask, external_address: external_address, request_id: request_id), 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, update_external_address_client_stub.call_rpc_count - end - end - - def test_delete_external_address - # 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" - request_id = "hello world" - - delete_external_address_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_external_address, name - assert_kind_of ::Google::Cloud::VmwareEngine::V1::DeleteExternalAddressRequest, request - assert_equal "hello world", request["name"] - assert_equal "hello world", request["request_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_external_address_client_stub do - # Create client - client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_external_address({ name: name, request_id: request_id }) 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_external_address name: name, request_id: request_id 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_external_address ::Google::Cloud::VmwareEngine::V1::DeleteExternalAddressRequest.new(name: name, request_id: request_id) 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_external_address({ name: name, request_id: request_id }, 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_external_address(::Google::Cloud::VmwareEngine::V1::DeleteExternalAddressRequest.new(name: name, request_id: request_id), 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_external_address_client_stub.call_rpc_count - end - end - - def test_list_subnets - # Create GRPC objects. - grpc_response = ::Google::Cloud::VmwareEngine::V1::ListSubnetsResponse.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_subnets_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_subnets, name - assert_kind_of ::Google::Cloud::VmwareEngine::V1::ListSubnetsRequest, 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_subnets_client_stub do - # Create client - client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_subnets({ 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_subnets 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_subnets ::Google::Cloud::VmwareEngine::V1::ListSubnetsRequest.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_subnets({ 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_subnets(::Google::Cloud::VmwareEngine::V1::ListSubnetsRequest.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_subnets_client_stub.call_rpc_count - end - end - - def test_get_subnet - # Create GRPC objects. - grpc_response = ::Google::Cloud::VmwareEngine::V1::Subnet.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_subnet_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_subnet, name - assert_kind_of ::Google::Cloud::VmwareEngine::V1::GetSubnetRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_subnet_client_stub do - # Create client - client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_subnet({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_subnet name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_subnet ::Google::Cloud::VmwareEngine::V1::GetSubnetRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_subnet({ 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_subnet(::Google::Cloud::VmwareEngine::V1::GetSubnetRequest.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_subnet_client_stub.call_rpc_count - end - end - - def test_update_subnet - # 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. - update_mask = {} - subnet = {} - - update_subnet_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_subnet, name - assert_kind_of ::Google::Cloud::VmwareEngine::V1::UpdateSubnetRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::VmwareEngine::V1::Subnet), request["subnet"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_subnet_client_stub do - # Create client - client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_subnet({ update_mask: update_mask, subnet: subnet }) 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.update_subnet update_mask: update_mask, subnet: subnet 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.update_subnet ::Google::Cloud::VmwareEngine::V1::UpdateSubnetRequest.new(update_mask: update_mask, subnet: subnet) 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.update_subnet({ update_mask: update_mask, subnet: subnet }, 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.update_subnet(::Google::Cloud::VmwareEngine::V1::UpdateSubnetRequest.new(update_mask: update_mask, subnet: subnet), 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, update_subnet_client_stub.call_rpc_count - end - end - - def test_list_external_access_rules - # Create GRPC objects. - grpc_response = ::Google::Cloud::VmwareEngine::V1::ListExternalAccessRulesResponse.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_external_access_rules_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_external_access_rules, name - assert_kind_of ::Google::Cloud::VmwareEngine::V1::ListExternalAccessRulesRequest, 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_external_access_rules_client_stub do - # Create client - client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_external_access_rules({ 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_external_access_rules 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_external_access_rules ::Google::Cloud::VmwareEngine::V1::ListExternalAccessRulesRequest.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_external_access_rules({ 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_external_access_rules(::Google::Cloud::VmwareEngine::V1::ListExternalAccessRulesRequest.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_external_access_rules_client_stub.call_rpc_count - end - end - - def test_get_external_access_rule - # Create GRPC objects. - grpc_response = ::Google::Cloud::VmwareEngine::V1::ExternalAccessRule.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_external_access_rule_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_external_access_rule, name - assert_kind_of ::Google::Cloud::VmwareEngine::V1::GetExternalAccessRuleRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_external_access_rule_client_stub do - # Create client - client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_external_access_rule({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_external_access_rule name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_external_access_rule ::Google::Cloud::VmwareEngine::V1::GetExternalAccessRuleRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_external_access_rule({ 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_external_access_rule(::Google::Cloud::VmwareEngine::V1::GetExternalAccessRuleRequest.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_external_access_rule_client_stub.call_rpc_count - end - end - - def test_create_external_access_rule - # 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" - external_access_rule = {} - external_access_rule_id = "hello world" - request_id = "hello world" - - create_external_access_rule_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_external_access_rule, name - assert_kind_of ::Google::Cloud::VmwareEngine::V1::CreateExternalAccessRuleRequest, request - assert_equal "hello world", request["parent"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::VmwareEngine::V1::ExternalAccessRule), request["external_access_rule"] - assert_equal "hello world", request["external_access_rule_id"] - assert_equal "hello world", request["request_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_external_access_rule_client_stub do - # Create client - client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_external_access_rule({ parent: parent, external_access_rule: external_access_rule, external_access_rule_id: external_access_rule_id, request_id: request_id }) 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_external_access_rule parent: parent, external_access_rule: external_access_rule, external_access_rule_id: external_access_rule_id, request_id: request_id 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_external_access_rule ::Google::Cloud::VmwareEngine::V1::CreateExternalAccessRuleRequest.new(parent: parent, external_access_rule: external_access_rule, external_access_rule_id: external_access_rule_id, request_id: request_id) 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_external_access_rule({ parent: parent, external_access_rule: external_access_rule, external_access_rule_id: external_access_rule_id, request_id: request_id }, 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_external_access_rule(::Google::Cloud::VmwareEngine::V1::CreateExternalAccessRuleRequest.new(parent: parent, external_access_rule: external_access_rule, external_access_rule_id: external_access_rule_id, request_id: request_id), 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_external_access_rule_client_stub.call_rpc_count - end - end - - def test_update_external_access_rule - # 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. - update_mask = {} - external_access_rule = {} - request_id = "hello world" - - update_external_access_rule_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_external_access_rule, name - assert_kind_of ::Google::Cloud::VmwareEngine::V1::UpdateExternalAccessRuleRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::VmwareEngine::V1::ExternalAccessRule), request["external_access_rule"] - assert_equal "hello world", request["request_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_external_access_rule_client_stub do - # Create client - client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_external_access_rule({ update_mask: update_mask, external_access_rule: external_access_rule, request_id: request_id }) 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.update_external_access_rule update_mask: update_mask, external_access_rule: external_access_rule, request_id: request_id 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.update_external_access_rule ::Google::Cloud::VmwareEngine::V1::UpdateExternalAccessRuleRequest.new(update_mask: update_mask, external_access_rule: external_access_rule, request_id: request_id) 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.update_external_access_rule({ update_mask: update_mask, external_access_rule: external_access_rule, request_id: request_id }, 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.update_external_access_rule(::Google::Cloud::VmwareEngine::V1::UpdateExternalAccessRuleRequest.new(update_mask: update_mask, external_access_rule: external_access_rule, request_id: request_id), 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, update_external_access_rule_client_stub.call_rpc_count - end - end - - def test_delete_external_access_rule - # 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" - request_id = "hello world" - - delete_external_access_rule_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_external_access_rule, name - assert_kind_of ::Google::Cloud::VmwareEngine::V1::DeleteExternalAccessRuleRequest, request - assert_equal "hello world", request["name"] - assert_equal "hello world", request["request_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_external_access_rule_client_stub do - # Create client - client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_external_access_rule({ name: name, request_id: request_id }) 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_external_access_rule name: name, request_id: request_id 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_external_access_rule ::Google::Cloud::VmwareEngine::V1::DeleteExternalAccessRuleRequest.new(name: name, request_id: request_id) 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_external_access_rule({ name: name, request_id: request_id }, 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_external_access_rule(::Google::Cloud::VmwareEngine::V1::DeleteExternalAccessRuleRequest.new(name: name, request_id: request_id), 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_external_access_rule_client_stub.call_rpc_count - end - end - - def test_list_logging_servers - # Create GRPC objects. - grpc_response = ::Google::Cloud::VmwareEngine::V1::ListLoggingServersResponse.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_logging_servers_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_logging_servers, name - assert_kind_of ::Google::Cloud::VmwareEngine::V1::ListLoggingServersRequest, 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_logging_servers_client_stub do - # Create client - client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_logging_servers({ 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_logging_servers 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_logging_servers ::Google::Cloud::VmwareEngine::V1::ListLoggingServersRequest.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_logging_servers({ 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_logging_servers(::Google::Cloud::VmwareEngine::V1::ListLoggingServersRequest.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_logging_servers_client_stub.call_rpc_count - end - end - - def test_get_logging_server - # Create GRPC objects. - grpc_response = ::Google::Cloud::VmwareEngine::V1::LoggingServer.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_logging_server_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_logging_server, name - assert_kind_of ::Google::Cloud::VmwareEngine::V1::GetLoggingServerRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_logging_server_client_stub do - # Create client - client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_logging_server({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_logging_server name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_logging_server ::Google::Cloud::VmwareEngine::V1::GetLoggingServerRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_logging_server({ 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_logging_server(::Google::Cloud::VmwareEngine::V1::GetLoggingServerRequest.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_logging_server_client_stub.call_rpc_count - end - end - - def test_create_logging_server - # 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" - logging_server = {} - logging_server_id = "hello world" - request_id = "hello world" - - create_logging_server_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_logging_server, name - assert_kind_of ::Google::Cloud::VmwareEngine::V1::CreateLoggingServerRequest, request - assert_equal "hello world", request["parent"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::VmwareEngine::V1::LoggingServer), request["logging_server"] - assert_equal "hello world", request["logging_server_id"] - assert_equal "hello world", request["request_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_logging_server_client_stub do - # Create client - client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_logging_server({ parent: parent, logging_server: logging_server, logging_server_id: logging_server_id, request_id: request_id }) 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_logging_server parent: parent, logging_server: logging_server, logging_server_id: logging_server_id, request_id: request_id 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_logging_server ::Google::Cloud::VmwareEngine::V1::CreateLoggingServerRequest.new(parent: parent, logging_server: logging_server, logging_server_id: logging_server_id, request_id: request_id) 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_logging_server({ parent: parent, logging_server: logging_server, logging_server_id: logging_server_id, request_id: request_id }, 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_logging_server(::Google::Cloud::VmwareEngine::V1::CreateLoggingServerRequest.new(parent: parent, logging_server: logging_server, logging_server_id: logging_server_id, request_id: request_id), 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_logging_server_client_stub.call_rpc_count - end - end - - def test_update_logging_server - # 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. - update_mask = {} - logging_server = {} - request_id = "hello world" - - update_logging_server_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_logging_server, name - assert_kind_of ::Google::Cloud::VmwareEngine::V1::UpdateLoggingServerRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::VmwareEngine::V1::LoggingServer), request["logging_server"] - assert_equal "hello world", request["request_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_logging_server_client_stub do - # Create client - client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_logging_server({ update_mask: update_mask, logging_server: logging_server, request_id: request_id }) 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.update_logging_server update_mask: update_mask, logging_server: logging_server, request_id: request_id 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.update_logging_server ::Google::Cloud::VmwareEngine::V1::UpdateLoggingServerRequest.new(update_mask: update_mask, logging_server: logging_server, request_id: request_id) 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.update_logging_server({ update_mask: update_mask, logging_server: logging_server, request_id: request_id }, 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.update_logging_server(::Google::Cloud::VmwareEngine::V1::UpdateLoggingServerRequest.new(update_mask: update_mask, logging_server: logging_server, request_id: request_id), 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, update_logging_server_client_stub.call_rpc_count - end - end - - def test_delete_logging_server - # 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" - request_id = "hello world" - - delete_logging_server_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_logging_server, name - assert_kind_of ::Google::Cloud::VmwareEngine::V1::DeleteLoggingServerRequest, request - assert_equal "hello world", request["name"] - assert_equal "hello world", request["request_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_logging_server_client_stub do - # Create client - client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_logging_server({ name: name, request_id: request_id }) 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_logging_server name: name, request_id: request_id 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_logging_server ::Google::Cloud::VmwareEngine::V1::DeleteLoggingServerRequest.new(name: name, request_id: request_id) 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_logging_server({ name: name, request_id: request_id }, 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_logging_server(::Google::Cloud::VmwareEngine::V1::DeleteLoggingServerRequest.new(name: name, request_id: request_id), 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_logging_server_client_stub.call_rpc_count - end - end - - def test_list_node_types - # Create GRPC objects. - grpc_response = ::Google::Cloud::VmwareEngine::V1::ListNodeTypesResponse.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_node_types_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_node_types, name - assert_kind_of ::Google::Cloud::VmwareEngine::V1::ListNodeTypesRequest, 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_node_types_client_stub do - # Create client - client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_node_types({ 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_node_types 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_node_types ::Google::Cloud::VmwareEngine::V1::ListNodeTypesRequest.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_node_types({ 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_node_types(::Google::Cloud::VmwareEngine::V1::ListNodeTypesRequest.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_node_types_client_stub.call_rpc_count - end - end - - def test_get_node_type - # Create GRPC objects. - grpc_response = ::Google::Cloud::VmwareEngine::V1::NodeType.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_node_type_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_node_type, name - assert_kind_of ::Google::Cloud::VmwareEngine::V1::GetNodeTypeRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_node_type_client_stub do - # Create client - client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_node_type({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_node_type name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_node_type ::Google::Cloud::VmwareEngine::V1::GetNodeTypeRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_node_type({ 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_node_type(::Google::Cloud::VmwareEngine::V1::GetNodeTypeRequest.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_node_type_client_stub.call_rpc_count - end - end - - def test_show_nsx_credentials - # Create GRPC objects. - grpc_response = ::Google::Cloud::VmwareEngine::V1::Credentials.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. - private_cloud = "hello world" - - show_nsx_credentials_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :show_nsx_credentials, name - assert_kind_of ::Google::Cloud::VmwareEngine::V1::ShowNsxCredentialsRequest, request - assert_equal "hello world", request["private_cloud"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, show_nsx_credentials_client_stub do - # Create client - client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.show_nsx_credentials({ private_cloud: private_cloud }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.show_nsx_credentials private_cloud: private_cloud do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.show_nsx_credentials ::Google::Cloud::VmwareEngine::V1::ShowNsxCredentialsRequest.new(private_cloud: private_cloud) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.show_nsx_credentials({ private_cloud: private_cloud }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.show_nsx_credentials(::Google::Cloud::VmwareEngine::V1::ShowNsxCredentialsRequest.new(private_cloud: private_cloud), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, show_nsx_credentials_client_stub.call_rpc_count - end - end - - def test_show_vcenter_credentials - # Create GRPC objects. - grpc_response = ::Google::Cloud::VmwareEngine::V1::Credentials.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. - private_cloud = "hello world" - username = "hello world" - - show_vcenter_credentials_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :show_vcenter_credentials, name - assert_kind_of ::Google::Cloud::VmwareEngine::V1::ShowVcenterCredentialsRequest, request - assert_equal "hello world", request["private_cloud"] - assert_equal "hello world", request["username"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, show_vcenter_credentials_client_stub do - # Create client - client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.show_vcenter_credentials({ private_cloud: private_cloud, username: username }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.show_vcenter_credentials private_cloud: private_cloud, username: username do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.show_vcenter_credentials ::Google::Cloud::VmwareEngine::V1::ShowVcenterCredentialsRequest.new(private_cloud: private_cloud, username: username) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.show_vcenter_credentials({ private_cloud: private_cloud, username: username }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.show_vcenter_credentials(::Google::Cloud::VmwareEngine::V1::ShowVcenterCredentialsRequest.new(private_cloud: private_cloud, username: username), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, show_vcenter_credentials_client_stub.call_rpc_count - end - end - - def test_reset_nsx_credentials - # 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. - private_cloud = "hello world" - request_id = "hello world" - - reset_nsx_credentials_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :reset_nsx_credentials, name - assert_kind_of ::Google::Cloud::VmwareEngine::V1::ResetNsxCredentialsRequest, request - assert_equal "hello world", request["private_cloud"] - assert_equal "hello world", request["request_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, reset_nsx_credentials_client_stub do - # Create client - client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.reset_nsx_credentials({ private_cloud: private_cloud, request_id: request_id }) 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.reset_nsx_credentials private_cloud: private_cloud, request_id: request_id 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.reset_nsx_credentials ::Google::Cloud::VmwareEngine::V1::ResetNsxCredentialsRequest.new(private_cloud: private_cloud, request_id: request_id) 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.reset_nsx_credentials({ private_cloud: private_cloud, request_id: request_id }, 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.reset_nsx_credentials(::Google::Cloud::VmwareEngine::V1::ResetNsxCredentialsRequest.new(private_cloud: private_cloud, request_id: request_id), 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, reset_nsx_credentials_client_stub.call_rpc_count - end - end - - def test_reset_vcenter_credentials - # 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. - private_cloud = "hello world" - request_id = "hello world" - username = "hello world" - - reset_vcenter_credentials_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :reset_vcenter_credentials, name - assert_kind_of ::Google::Cloud::VmwareEngine::V1::ResetVcenterCredentialsRequest, request - assert_equal "hello world", request["private_cloud"] - assert_equal "hello world", request["request_id"] - assert_equal "hello world", request["username"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, reset_vcenter_credentials_client_stub do - # Create client - client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.reset_vcenter_credentials({ private_cloud: private_cloud, request_id: request_id, username: username }) 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.reset_vcenter_credentials private_cloud: private_cloud, request_id: request_id, username: username 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.reset_vcenter_credentials ::Google::Cloud::VmwareEngine::V1::ResetVcenterCredentialsRequest.new(private_cloud: private_cloud, request_id: request_id, username: username) 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.reset_vcenter_credentials({ private_cloud: private_cloud, request_id: request_id, username: username }, 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.reset_vcenter_credentials(::Google::Cloud::VmwareEngine::V1::ResetVcenterCredentialsRequest.new(private_cloud: private_cloud, request_id: request_id, username: username), 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, reset_vcenter_credentials_client_stub.call_rpc_count - end - end - - def test_get_dns_forwarding - # Create GRPC objects. - grpc_response = ::Google::Cloud::VmwareEngine::V1::DnsForwarding.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_dns_forwarding_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_dns_forwarding, name - assert_kind_of ::Google::Cloud::VmwareEngine::V1::GetDnsForwardingRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_dns_forwarding_client_stub do - # Create client - client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_dns_forwarding({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_dns_forwarding name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_dns_forwarding ::Google::Cloud::VmwareEngine::V1::GetDnsForwardingRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_dns_forwarding({ 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_dns_forwarding(::Google::Cloud::VmwareEngine::V1::GetDnsForwardingRequest.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_dns_forwarding_client_stub.call_rpc_count - end - end - - def test_update_dns_forwarding - # 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. - dns_forwarding = {} - update_mask = {} - request_id = "hello world" - - update_dns_forwarding_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_dns_forwarding, name - assert_kind_of ::Google::Cloud::VmwareEngine::V1::UpdateDnsForwardingRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::VmwareEngine::V1::DnsForwarding), request["dns_forwarding"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - assert_equal "hello world", request["request_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_dns_forwarding_client_stub do - # Create client - client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_dns_forwarding({ dns_forwarding: dns_forwarding, update_mask: update_mask, request_id: request_id }) 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.update_dns_forwarding dns_forwarding: dns_forwarding, update_mask: update_mask, request_id: request_id 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.update_dns_forwarding ::Google::Cloud::VmwareEngine::V1::UpdateDnsForwardingRequest.new(dns_forwarding: dns_forwarding, update_mask: update_mask, request_id: request_id) 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.update_dns_forwarding({ dns_forwarding: dns_forwarding, update_mask: update_mask, request_id: request_id }, 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.update_dns_forwarding(::Google::Cloud::VmwareEngine::V1::UpdateDnsForwardingRequest.new(dns_forwarding: dns_forwarding, update_mask: update_mask, request_id: request_id), 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, update_dns_forwarding_client_stub.call_rpc_count - end - end - - def test_get_network_peering - # Create GRPC objects. - grpc_response = ::Google::Cloud::VmwareEngine::V1::NetworkPeering.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_network_peering_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_network_peering, name - assert_kind_of ::Google::Cloud::VmwareEngine::V1::GetNetworkPeeringRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_network_peering_client_stub do - # Create client - client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_network_peering({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_network_peering name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_network_peering ::Google::Cloud::VmwareEngine::V1::GetNetworkPeeringRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_network_peering({ 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_network_peering(::Google::Cloud::VmwareEngine::V1::GetNetworkPeeringRequest.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_network_peering_client_stub.call_rpc_count - end - end - - def test_list_network_peerings - # Create GRPC objects. - grpc_response = ::Google::Cloud::VmwareEngine::V1::ListNetworkPeeringsResponse.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_network_peerings_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_network_peerings, name - assert_kind_of ::Google::Cloud::VmwareEngine::V1::ListNetworkPeeringsRequest, 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_network_peerings_client_stub do - # Create client - client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_network_peerings({ 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_network_peerings 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_network_peerings ::Google::Cloud::VmwareEngine::V1::ListNetworkPeeringsRequest.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_network_peerings({ 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_network_peerings(::Google::Cloud::VmwareEngine::V1::ListNetworkPeeringsRequest.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_network_peerings_client_stub.call_rpc_count - end - end - - def test_create_network_peering - # 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" - network_peering_id = "hello world" - network_peering = {} - request_id = "hello world" - - create_network_peering_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_network_peering, name - assert_kind_of ::Google::Cloud::VmwareEngine::V1::CreateNetworkPeeringRequest, request - assert_equal "hello world", request["parent"] - assert_equal "hello world", request["network_peering_id"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::VmwareEngine::V1::NetworkPeering), request["network_peering"] - assert_equal "hello world", request["request_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_network_peering_client_stub do - # Create client - client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_network_peering({ parent: parent, network_peering_id: network_peering_id, network_peering: network_peering, request_id: request_id }) 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_network_peering parent: parent, network_peering_id: network_peering_id, network_peering: network_peering, request_id: request_id 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_network_peering ::Google::Cloud::VmwareEngine::V1::CreateNetworkPeeringRequest.new(parent: parent, network_peering_id: network_peering_id, network_peering: network_peering, request_id: request_id) 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_network_peering({ parent: parent, network_peering_id: network_peering_id, network_peering: network_peering, request_id: request_id }, 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_network_peering(::Google::Cloud::VmwareEngine::V1::CreateNetworkPeeringRequest.new(parent: parent, network_peering_id: network_peering_id, network_peering: network_peering, request_id: request_id), 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_network_peering_client_stub.call_rpc_count - end - end - - def test_delete_network_peering - # 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" - request_id = "hello world" - - delete_network_peering_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_network_peering, name - assert_kind_of ::Google::Cloud::VmwareEngine::V1::DeleteNetworkPeeringRequest, request - assert_equal "hello world", request["name"] - assert_equal "hello world", request["request_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_network_peering_client_stub do - # Create client - client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_network_peering({ name: name, request_id: request_id }) 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_network_peering name: name, request_id: request_id 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_network_peering ::Google::Cloud::VmwareEngine::V1::DeleteNetworkPeeringRequest.new(name: name, request_id: request_id) 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_network_peering({ name: name, request_id: request_id }, 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_network_peering(::Google::Cloud::VmwareEngine::V1::DeleteNetworkPeeringRequest.new(name: name, request_id: request_id), 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_network_peering_client_stub.call_rpc_count - end - end - - def test_update_network_peering - # 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. - network_peering = {} - update_mask = {} - request_id = "hello world" - - update_network_peering_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_network_peering, name - assert_kind_of ::Google::Cloud::VmwareEngine::V1::UpdateNetworkPeeringRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::VmwareEngine::V1::NetworkPeering), request["network_peering"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - assert_equal "hello world", request["request_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_network_peering_client_stub do - # Create client - client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_network_peering({ network_peering: network_peering, update_mask: update_mask, request_id: request_id }) 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.update_network_peering network_peering: network_peering, update_mask: update_mask, request_id: request_id 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.update_network_peering ::Google::Cloud::VmwareEngine::V1::UpdateNetworkPeeringRequest.new(network_peering: network_peering, update_mask: update_mask, request_id: request_id) 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.update_network_peering({ network_peering: network_peering, update_mask: update_mask, request_id: request_id }, 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.update_network_peering(::Google::Cloud::VmwareEngine::V1::UpdateNetworkPeeringRequest.new(network_peering: network_peering, update_mask: update_mask, request_id: request_id), 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, update_network_peering_client_stub.call_rpc_count - end - end - - def test_list_peering_routes - # Create GRPC objects. - grpc_response = ::Google::Cloud::VmwareEngine::V1::ListPeeringRoutesResponse.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_peering_routes_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_peering_routes, name - assert_kind_of ::Google::Cloud::VmwareEngine::V1::ListPeeringRoutesRequest, 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_peering_routes_client_stub do - # Create client - client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_peering_routes({ 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_peering_routes 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_peering_routes ::Google::Cloud::VmwareEngine::V1::ListPeeringRoutesRequest.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_peering_routes({ 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_peering_routes(::Google::Cloud::VmwareEngine::V1::ListPeeringRoutesRequest.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_peering_routes_client_stub.call_rpc_count - end - end - - def test_create_hcx_activation_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. - parent = "hello world" - hcx_activation_key = {} - hcx_activation_key_id = "hello world" - request_id = "hello world" - - create_hcx_activation_key_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_hcx_activation_key, name - assert_kind_of ::Google::Cloud::VmwareEngine::V1::CreateHcxActivationKeyRequest, request - assert_equal "hello world", request["parent"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::VmwareEngine::V1::HcxActivationKey), request["hcx_activation_key"] - assert_equal "hello world", request["hcx_activation_key_id"] - assert_equal "hello world", request["request_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_hcx_activation_key_client_stub do - # Create client - client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_hcx_activation_key({ parent: parent, hcx_activation_key: hcx_activation_key, hcx_activation_key_id: hcx_activation_key_id, request_id: request_id }) 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_hcx_activation_key parent: parent, hcx_activation_key: hcx_activation_key, hcx_activation_key_id: hcx_activation_key_id, request_id: request_id 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_hcx_activation_key ::Google::Cloud::VmwareEngine::V1::CreateHcxActivationKeyRequest.new(parent: parent, hcx_activation_key: hcx_activation_key, hcx_activation_key_id: hcx_activation_key_id, request_id: request_id) 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_hcx_activation_key({ parent: parent, hcx_activation_key: hcx_activation_key, hcx_activation_key_id: hcx_activation_key_id, request_id: request_id }, 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_hcx_activation_key(::Google::Cloud::VmwareEngine::V1::CreateHcxActivationKeyRequest.new(parent: parent, hcx_activation_key: hcx_activation_key, hcx_activation_key_id: hcx_activation_key_id, request_id: request_id), 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_hcx_activation_key_client_stub.call_rpc_count - end - end - - def test_list_hcx_activation_keys - # Create GRPC objects. - grpc_response = ::Google::Cloud::VmwareEngine::V1::ListHcxActivationKeysResponse.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_hcx_activation_keys_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_hcx_activation_keys, name - assert_kind_of ::Google::Cloud::VmwareEngine::V1::ListHcxActivationKeysRequest, 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_hcx_activation_keys_client_stub do - # Create client - client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_hcx_activation_keys({ 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_hcx_activation_keys 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_hcx_activation_keys ::Google::Cloud::VmwareEngine::V1::ListHcxActivationKeysRequest.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_hcx_activation_keys({ 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_hcx_activation_keys(::Google::Cloud::VmwareEngine::V1::ListHcxActivationKeysRequest.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_hcx_activation_keys_client_stub.call_rpc_count - end - end - - def test_get_hcx_activation_key - # Create GRPC objects. - grpc_response = ::Google::Cloud::VmwareEngine::V1::HcxActivationKey.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_hcx_activation_key_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_hcx_activation_key, name - assert_kind_of ::Google::Cloud::VmwareEngine::V1::GetHcxActivationKeyRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_hcx_activation_key_client_stub do - # Create client - client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_hcx_activation_key({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_hcx_activation_key name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_hcx_activation_key ::Google::Cloud::VmwareEngine::V1::GetHcxActivationKeyRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_hcx_activation_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_hcx_activation_key(::Google::Cloud::VmwareEngine::V1::GetHcxActivationKeyRequest.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_hcx_activation_key_client_stub.call_rpc_count - end - end - - def test_get_network_policy - # Create GRPC objects. - grpc_response = ::Google::Cloud::VmwareEngine::V1::NetworkPolicy.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_network_policy_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_network_policy, name - assert_kind_of ::Google::Cloud::VmwareEngine::V1::GetNetworkPolicyRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_network_policy_client_stub do - # Create client - client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_network_policy({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_network_policy name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_network_policy ::Google::Cloud::VmwareEngine::V1::GetNetworkPolicyRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_network_policy({ 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_network_policy(::Google::Cloud::VmwareEngine::V1::GetNetworkPolicyRequest.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_network_policy_client_stub.call_rpc_count - end - end - - def test_list_network_policies - # Create GRPC objects. - grpc_response = ::Google::Cloud::VmwareEngine::V1::ListNetworkPoliciesResponse.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_network_policies_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_network_policies, name - assert_kind_of ::Google::Cloud::VmwareEngine::V1::ListNetworkPoliciesRequest, 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_network_policies_client_stub do - # Create client - client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_network_policies({ 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_network_policies 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_network_policies ::Google::Cloud::VmwareEngine::V1::ListNetworkPoliciesRequest.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_network_policies({ 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_network_policies(::Google::Cloud::VmwareEngine::V1::ListNetworkPoliciesRequest.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_network_policies_client_stub.call_rpc_count - end - end - - def test_create_network_policy - # 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" - network_policy_id = "hello world" - network_policy = {} - request_id = "hello world" - - create_network_policy_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_network_policy, name - assert_kind_of ::Google::Cloud::VmwareEngine::V1::CreateNetworkPolicyRequest, request - assert_equal "hello world", request["parent"] - assert_equal "hello world", request["network_policy_id"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::VmwareEngine::V1::NetworkPolicy), request["network_policy"] - assert_equal "hello world", request["request_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_network_policy_client_stub do - # Create client - client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_network_policy({ parent: parent, network_policy_id: network_policy_id, network_policy: network_policy, request_id: request_id }) 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_network_policy parent: parent, network_policy_id: network_policy_id, network_policy: network_policy, request_id: request_id 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_network_policy ::Google::Cloud::VmwareEngine::V1::CreateNetworkPolicyRequest.new(parent: parent, network_policy_id: network_policy_id, network_policy: network_policy, request_id: request_id) 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_network_policy({ parent: parent, network_policy_id: network_policy_id, network_policy: network_policy, request_id: request_id }, 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_network_policy(::Google::Cloud::VmwareEngine::V1::CreateNetworkPolicyRequest.new(parent: parent, network_policy_id: network_policy_id, network_policy: network_policy, request_id: request_id), 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_network_policy_client_stub.call_rpc_count - end - end - - def test_update_network_policy - # 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. - network_policy = {} - update_mask = {} - request_id = "hello world" - - update_network_policy_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_network_policy, name - assert_kind_of ::Google::Cloud::VmwareEngine::V1::UpdateNetworkPolicyRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::VmwareEngine::V1::NetworkPolicy), request["network_policy"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - assert_equal "hello world", request["request_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_network_policy_client_stub do - # Create client - client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_network_policy({ network_policy: network_policy, update_mask: update_mask, request_id: request_id }) 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.update_network_policy network_policy: network_policy, update_mask: update_mask, request_id: request_id 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.update_network_policy ::Google::Cloud::VmwareEngine::V1::UpdateNetworkPolicyRequest.new(network_policy: network_policy, update_mask: update_mask, request_id: request_id) 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.update_network_policy({ network_policy: network_policy, update_mask: update_mask, request_id: request_id }, 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.update_network_policy(::Google::Cloud::VmwareEngine::V1::UpdateNetworkPolicyRequest.new(network_policy: network_policy, update_mask: update_mask, request_id: request_id), 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, update_network_policy_client_stub.call_rpc_count - end - end - - def test_delete_network_policy - # 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" - request_id = "hello world" - - delete_network_policy_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_network_policy, name - assert_kind_of ::Google::Cloud::VmwareEngine::V1::DeleteNetworkPolicyRequest, request - assert_equal "hello world", request["name"] - assert_equal "hello world", request["request_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_network_policy_client_stub do - # Create client - client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_network_policy({ name: name, request_id: request_id }) 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_network_policy name: name, request_id: request_id 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_network_policy ::Google::Cloud::VmwareEngine::V1::DeleteNetworkPolicyRequest.new(name: name, request_id: request_id) 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_network_policy({ name: name, request_id: request_id }, 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_network_policy(::Google::Cloud::VmwareEngine::V1::DeleteNetworkPolicyRequest.new(name: name, request_id: request_id), 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_network_policy_client_stub.call_rpc_count - end - end - - def test_list_management_dns_zone_bindings - # Create GRPC objects. - grpc_response = ::Google::Cloud::VmwareEngine::V1::ListManagementDnsZoneBindingsResponse.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_management_dns_zone_bindings_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_management_dns_zone_bindings, name - assert_kind_of ::Google::Cloud::VmwareEngine::V1::ListManagementDnsZoneBindingsRequest, 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_management_dns_zone_bindings_client_stub do - # Create client - client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_management_dns_zone_bindings({ 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_management_dns_zone_bindings 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_management_dns_zone_bindings ::Google::Cloud::VmwareEngine::V1::ListManagementDnsZoneBindingsRequest.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_management_dns_zone_bindings({ 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_management_dns_zone_bindings(::Google::Cloud::VmwareEngine::V1::ListManagementDnsZoneBindingsRequest.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_management_dns_zone_bindings_client_stub.call_rpc_count - end - end - - def test_get_management_dns_zone_binding - # Create GRPC objects. - grpc_response = ::Google::Cloud::VmwareEngine::V1::ManagementDnsZoneBinding.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_management_dns_zone_binding_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_management_dns_zone_binding, name - assert_kind_of ::Google::Cloud::VmwareEngine::V1::GetManagementDnsZoneBindingRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_management_dns_zone_binding_client_stub do - # Create client - client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_management_dns_zone_binding({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_management_dns_zone_binding name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_management_dns_zone_binding ::Google::Cloud::VmwareEngine::V1::GetManagementDnsZoneBindingRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_management_dns_zone_binding({ 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_management_dns_zone_binding(::Google::Cloud::VmwareEngine::V1::GetManagementDnsZoneBindingRequest.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_management_dns_zone_binding_client_stub.call_rpc_count - end - end - - def test_create_management_dns_zone_binding - # 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" - management_dns_zone_binding = {} - management_dns_zone_binding_id = "hello world" - request_id = "hello world" - - create_management_dns_zone_binding_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_management_dns_zone_binding, name - assert_kind_of ::Google::Cloud::VmwareEngine::V1::CreateManagementDnsZoneBindingRequest, request - assert_equal "hello world", request["parent"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::VmwareEngine::V1::ManagementDnsZoneBinding), request["management_dns_zone_binding"] - assert_equal "hello world", request["management_dns_zone_binding_id"] - assert_equal "hello world", request["request_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_management_dns_zone_binding_client_stub do - # Create client - client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_management_dns_zone_binding({ parent: parent, management_dns_zone_binding: management_dns_zone_binding, management_dns_zone_binding_id: management_dns_zone_binding_id, request_id: request_id }) 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_management_dns_zone_binding parent: parent, management_dns_zone_binding: management_dns_zone_binding, management_dns_zone_binding_id: management_dns_zone_binding_id, request_id: request_id 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_management_dns_zone_binding ::Google::Cloud::VmwareEngine::V1::CreateManagementDnsZoneBindingRequest.new(parent: parent, management_dns_zone_binding: management_dns_zone_binding, management_dns_zone_binding_id: management_dns_zone_binding_id, request_id: request_id) 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_management_dns_zone_binding({ parent: parent, management_dns_zone_binding: management_dns_zone_binding, management_dns_zone_binding_id: management_dns_zone_binding_id, request_id: request_id }, 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_management_dns_zone_binding(::Google::Cloud::VmwareEngine::V1::CreateManagementDnsZoneBindingRequest.new(parent: parent, management_dns_zone_binding: management_dns_zone_binding, management_dns_zone_binding_id: management_dns_zone_binding_id, request_id: request_id), 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_management_dns_zone_binding_client_stub.call_rpc_count - end - end - - def test_update_management_dns_zone_binding - # 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. - update_mask = {} - management_dns_zone_binding = {} - request_id = "hello world" - - update_management_dns_zone_binding_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_management_dns_zone_binding, name - assert_kind_of ::Google::Cloud::VmwareEngine::V1::UpdateManagementDnsZoneBindingRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::VmwareEngine::V1::ManagementDnsZoneBinding), request["management_dns_zone_binding"] - assert_equal "hello world", request["request_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_management_dns_zone_binding_client_stub do - # Create client - client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_management_dns_zone_binding({ update_mask: update_mask, management_dns_zone_binding: management_dns_zone_binding, request_id: request_id }) 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.update_management_dns_zone_binding update_mask: update_mask, management_dns_zone_binding: management_dns_zone_binding, request_id: request_id 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.update_management_dns_zone_binding ::Google::Cloud::VmwareEngine::V1::UpdateManagementDnsZoneBindingRequest.new(update_mask: update_mask, management_dns_zone_binding: management_dns_zone_binding, request_id: request_id) 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.update_management_dns_zone_binding({ update_mask: update_mask, management_dns_zone_binding: management_dns_zone_binding, request_id: request_id }, 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.update_management_dns_zone_binding(::Google::Cloud::VmwareEngine::V1::UpdateManagementDnsZoneBindingRequest.new(update_mask: update_mask, management_dns_zone_binding: management_dns_zone_binding, request_id: request_id), 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, update_management_dns_zone_binding_client_stub.call_rpc_count - end - end - - def test_delete_management_dns_zone_binding - # 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" - request_id = "hello world" - - delete_management_dns_zone_binding_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_management_dns_zone_binding, name - assert_kind_of ::Google::Cloud::VmwareEngine::V1::DeleteManagementDnsZoneBindingRequest, request - assert_equal "hello world", request["name"] - assert_equal "hello world", request["request_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_management_dns_zone_binding_client_stub do - # Create client - client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_management_dns_zone_binding({ name: name, request_id: request_id }) 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_management_dns_zone_binding name: name, request_id: request_id 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_management_dns_zone_binding ::Google::Cloud::VmwareEngine::V1::DeleteManagementDnsZoneBindingRequest.new(name: name, request_id: request_id) 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_management_dns_zone_binding({ name: name, request_id: request_id }, 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_management_dns_zone_binding(::Google::Cloud::VmwareEngine::V1::DeleteManagementDnsZoneBindingRequest.new(name: name, request_id: request_id), 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_management_dns_zone_binding_client_stub.call_rpc_count - end - end - - def test_repair_management_dns_zone_binding - # 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" - request_id = "hello world" - - repair_management_dns_zone_binding_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :repair_management_dns_zone_binding, name - assert_kind_of ::Google::Cloud::VmwareEngine::V1::RepairManagementDnsZoneBindingRequest, request - assert_equal "hello world", request["name"] - assert_equal "hello world", request["request_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, repair_management_dns_zone_binding_client_stub do - # Create client - client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.repair_management_dns_zone_binding({ name: name, request_id: request_id }) 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.repair_management_dns_zone_binding name: name, request_id: request_id 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.repair_management_dns_zone_binding ::Google::Cloud::VmwareEngine::V1::RepairManagementDnsZoneBindingRequest.new(name: name, request_id: request_id) 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.repair_management_dns_zone_binding({ name: name, request_id: request_id }, 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.repair_management_dns_zone_binding(::Google::Cloud::VmwareEngine::V1::RepairManagementDnsZoneBindingRequest.new(name: name, request_id: request_id), 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, repair_management_dns_zone_binding_client_stub.call_rpc_count - end - end - - def test_create_vmware_engine_network - # 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" - vmware_engine_network_id = "hello world" - vmware_engine_network = {} - request_id = "hello world" - - create_vmware_engine_network_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_vmware_engine_network, name - assert_kind_of ::Google::Cloud::VmwareEngine::V1::CreateVmwareEngineNetworkRequest, request - assert_equal "hello world", request["parent"] - assert_equal "hello world", request["vmware_engine_network_id"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::VmwareEngine::V1::VmwareEngineNetwork), request["vmware_engine_network"] - assert_equal "hello world", request["request_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_vmware_engine_network_client_stub do - # Create client - client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_vmware_engine_network({ parent: parent, vmware_engine_network_id: vmware_engine_network_id, vmware_engine_network: vmware_engine_network, request_id: request_id }) 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_vmware_engine_network parent: parent, vmware_engine_network_id: vmware_engine_network_id, vmware_engine_network: vmware_engine_network, request_id: request_id 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_vmware_engine_network ::Google::Cloud::VmwareEngine::V1::CreateVmwareEngineNetworkRequest.new(parent: parent, vmware_engine_network_id: vmware_engine_network_id, vmware_engine_network: vmware_engine_network, request_id: request_id) 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_vmware_engine_network({ parent: parent, vmware_engine_network_id: vmware_engine_network_id, vmware_engine_network: vmware_engine_network, request_id: request_id }, 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_vmware_engine_network(::Google::Cloud::VmwareEngine::V1::CreateVmwareEngineNetworkRequest.new(parent: parent, vmware_engine_network_id: vmware_engine_network_id, vmware_engine_network: vmware_engine_network, request_id: request_id), 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_vmware_engine_network_client_stub.call_rpc_count - end - end - - def test_update_vmware_engine_network - # 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. - vmware_engine_network = {} - update_mask = {} - request_id = "hello world" - - update_vmware_engine_network_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_vmware_engine_network, name - assert_kind_of ::Google::Cloud::VmwareEngine::V1::UpdateVmwareEngineNetworkRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::VmwareEngine::V1::VmwareEngineNetwork), request["vmware_engine_network"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - assert_equal "hello world", request["request_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_vmware_engine_network_client_stub do - # Create client - client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_vmware_engine_network({ vmware_engine_network: vmware_engine_network, update_mask: update_mask, request_id: request_id }) 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.update_vmware_engine_network vmware_engine_network: vmware_engine_network, update_mask: update_mask, request_id: request_id 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.update_vmware_engine_network ::Google::Cloud::VmwareEngine::V1::UpdateVmwareEngineNetworkRequest.new(vmware_engine_network: vmware_engine_network, update_mask: update_mask, request_id: request_id) 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.update_vmware_engine_network({ vmware_engine_network: vmware_engine_network, update_mask: update_mask, request_id: request_id }, 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.update_vmware_engine_network(::Google::Cloud::VmwareEngine::V1::UpdateVmwareEngineNetworkRequest.new(vmware_engine_network: vmware_engine_network, update_mask: update_mask, request_id: request_id), 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, update_vmware_engine_network_client_stub.call_rpc_count - end - end - - def test_delete_vmware_engine_network - # 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" - request_id = "hello world" - etag = "hello world" - - delete_vmware_engine_network_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_vmware_engine_network, name - assert_kind_of ::Google::Cloud::VmwareEngine::V1::DeleteVmwareEngineNetworkRequest, request - assert_equal "hello world", request["name"] - assert_equal "hello world", request["request_id"] - assert_equal "hello world", request["etag"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_vmware_engine_network_client_stub do - # Create client - client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_vmware_engine_network({ name: name, request_id: request_id, etag: etag }) 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_vmware_engine_network name: name, request_id: request_id, etag: etag 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_vmware_engine_network ::Google::Cloud::VmwareEngine::V1::DeleteVmwareEngineNetworkRequest.new(name: name, request_id: request_id, etag: etag) 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_vmware_engine_network({ name: name, request_id: request_id, etag: etag }, 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_vmware_engine_network(::Google::Cloud::VmwareEngine::V1::DeleteVmwareEngineNetworkRequest.new(name: name, request_id: request_id, etag: etag), 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_vmware_engine_network_client_stub.call_rpc_count - end - end - - def test_get_vmware_engine_network - # Create GRPC objects. - grpc_response = ::Google::Cloud::VmwareEngine::V1::VmwareEngineNetwork.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_vmware_engine_network_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_vmware_engine_network, name - assert_kind_of ::Google::Cloud::VmwareEngine::V1::GetVmwareEngineNetworkRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_vmware_engine_network_client_stub do - # Create client - client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_vmware_engine_network({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_vmware_engine_network name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_vmware_engine_network ::Google::Cloud::VmwareEngine::V1::GetVmwareEngineNetworkRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_vmware_engine_network({ 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_vmware_engine_network(::Google::Cloud::VmwareEngine::V1::GetVmwareEngineNetworkRequest.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_vmware_engine_network_client_stub.call_rpc_count - end - end - - def test_list_vmware_engine_networks - # Create GRPC objects. - grpc_response = ::Google::Cloud::VmwareEngine::V1::ListVmwareEngineNetworksResponse.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_vmware_engine_networks_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_vmware_engine_networks, name - assert_kind_of ::Google::Cloud::VmwareEngine::V1::ListVmwareEngineNetworksRequest, 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_vmware_engine_networks_client_stub do - # Create client - client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_vmware_engine_networks({ 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_vmware_engine_networks 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_vmware_engine_networks ::Google::Cloud::VmwareEngine::V1::ListVmwareEngineNetworksRequest.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_vmware_engine_networks({ 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_vmware_engine_networks(::Google::Cloud::VmwareEngine::V1::ListVmwareEngineNetworksRequest.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_vmware_engine_networks_client_stub.call_rpc_count - end - end - - def test_create_private_connection - # 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" - private_connection_id = "hello world" - private_connection = {} - request_id = "hello world" - - create_private_connection_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_private_connection, name - assert_kind_of ::Google::Cloud::VmwareEngine::V1::CreatePrivateConnectionRequest, request - assert_equal "hello world", request["parent"] - assert_equal "hello world", request["private_connection_id"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::VmwareEngine::V1::PrivateConnection), request["private_connection"] - assert_equal "hello world", request["request_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_private_connection_client_stub do - # Create client - client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_private_connection({ parent: parent, private_connection_id: private_connection_id, private_connection: private_connection, request_id: request_id }) 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_private_connection parent: parent, private_connection_id: private_connection_id, private_connection: private_connection, request_id: request_id 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_private_connection ::Google::Cloud::VmwareEngine::V1::CreatePrivateConnectionRequest.new(parent: parent, private_connection_id: private_connection_id, private_connection: private_connection, request_id: request_id) 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_private_connection({ parent: parent, private_connection_id: private_connection_id, private_connection: private_connection, request_id: request_id }, 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_private_connection(::Google::Cloud::VmwareEngine::V1::CreatePrivateConnectionRequest.new(parent: parent, private_connection_id: private_connection_id, private_connection: private_connection, request_id: request_id), 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_private_connection_client_stub.call_rpc_count - end - end - - def test_get_private_connection - # Create GRPC objects. - grpc_response = ::Google::Cloud::VmwareEngine::V1::PrivateConnection.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_private_connection_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_private_connection, name - assert_kind_of ::Google::Cloud::VmwareEngine::V1::GetPrivateConnectionRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_private_connection_client_stub do - # Create client - client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_private_connection({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_private_connection name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_private_connection ::Google::Cloud::VmwareEngine::V1::GetPrivateConnectionRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_private_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_private_connection(::Google::Cloud::VmwareEngine::V1::GetPrivateConnectionRequest.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_private_connection_client_stub.call_rpc_count - end - end - - def test_list_private_connections - # Create GRPC objects. - grpc_response = ::Google::Cloud::VmwareEngine::V1::ListPrivateConnectionsResponse.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_private_connections_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_private_connections, name - assert_kind_of ::Google::Cloud::VmwareEngine::V1::ListPrivateConnectionsRequest, 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_private_connections_client_stub do - # Create client - client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_private_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_private_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_private_connections ::Google::Cloud::VmwareEngine::V1::ListPrivateConnectionsRequest.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_private_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_private_connections(::Google::Cloud::VmwareEngine::V1::ListPrivateConnectionsRequest.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_private_connections_client_stub.call_rpc_count - end - end - - def test_update_private_connection - # 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. - private_connection = {} - update_mask = {} - request_id = "hello world" - - update_private_connection_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_private_connection, name - assert_kind_of ::Google::Cloud::VmwareEngine::V1::UpdatePrivateConnectionRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::VmwareEngine::V1::PrivateConnection), request["private_connection"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - assert_equal "hello world", request["request_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_private_connection_client_stub do - # Create client - client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_private_connection({ private_connection: private_connection, update_mask: update_mask, request_id: request_id }) 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.update_private_connection private_connection: private_connection, update_mask: update_mask, request_id: request_id 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.update_private_connection ::Google::Cloud::VmwareEngine::V1::UpdatePrivateConnectionRequest.new(private_connection: private_connection, update_mask: update_mask, request_id: request_id) 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.update_private_connection({ private_connection: private_connection, update_mask: update_mask, request_id: request_id }, 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.update_private_connection(::Google::Cloud::VmwareEngine::V1::UpdatePrivateConnectionRequest.new(private_connection: private_connection, update_mask: update_mask, request_id: request_id), 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, update_private_connection_client_stub.call_rpc_count - end - end - - def test_delete_private_connection - # 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" - request_id = "hello world" - - delete_private_connection_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_private_connection, name - assert_kind_of ::Google::Cloud::VmwareEngine::V1::DeletePrivateConnectionRequest, request - assert_equal "hello world", request["name"] - assert_equal "hello world", request["request_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_private_connection_client_stub do - # Create client - client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_private_connection({ name: name, request_id: request_id }) 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_private_connection name: name, request_id: request_id 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_private_connection ::Google::Cloud::VmwareEngine::V1::DeletePrivateConnectionRequest.new(name: name, request_id: request_id) 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_private_connection({ name: name, request_id: request_id }, 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_private_connection(::Google::Cloud::VmwareEngine::V1::DeletePrivateConnectionRequest.new(name: name, request_id: request_id), 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_private_connection_client_stub.call_rpc_count - end - end - - def test_list_private_connection_peering_routes - # Create GRPC objects. - grpc_response = ::Google::Cloud::VmwareEngine::V1::ListPrivateConnectionPeeringRoutesResponse.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_private_connection_peering_routes_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_private_connection_peering_routes, name - assert_kind_of ::Google::Cloud::VmwareEngine::V1::ListPrivateConnectionPeeringRoutesRequest, 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_private_connection_peering_routes_client_stub do - # Create client - client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_private_connection_peering_routes({ 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_private_connection_peering_routes 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_private_connection_peering_routes ::Google::Cloud::VmwareEngine::V1::ListPrivateConnectionPeeringRoutesRequest.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_private_connection_peering_routes({ 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_private_connection_peering_routes(::Google::Cloud::VmwareEngine::V1::ListPrivateConnectionPeeringRoutesRequest.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_private_connection_peering_routes_client_stub.call_rpc_count - end - end - - def test_grant_dns_bind_permission - # 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" - principal = {} - request_id = "hello world" - - grant_dns_bind_permission_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :grant_dns_bind_permission, name - assert_kind_of ::Google::Cloud::VmwareEngine::V1::GrantDnsBindPermissionRequest, request - assert_equal "hello world", request["name"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::VmwareEngine::V1::Principal), request["principal"] - assert_equal "hello world", request["request_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, grant_dns_bind_permission_client_stub do - # Create client - client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.grant_dns_bind_permission({ name: name, principal: principal, request_id: request_id }) 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.grant_dns_bind_permission name: name, principal: principal, request_id: request_id 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.grant_dns_bind_permission ::Google::Cloud::VmwareEngine::V1::GrantDnsBindPermissionRequest.new(name: name, principal: principal, request_id: request_id) 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.grant_dns_bind_permission({ name: name, principal: principal, request_id: request_id }, 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.grant_dns_bind_permission(::Google::Cloud::VmwareEngine::V1::GrantDnsBindPermissionRequest.new(name: name, principal: principal, request_id: request_id), 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, grant_dns_bind_permission_client_stub.call_rpc_count - end - end - - def test_get_dns_bind_permission - # Create GRPC objects. - grpc_response = ::Google::Cloud::VmwareEngine::V1::DnsBindPermission.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_dns_bind_permission_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_dns_bind_permission, name - assert_kind_of ::Google::Cloud::VmwareEngine::V1::GetDnsBindPermissionRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_dns_bind_permission_client_stub do - # Create client - client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_dns_bind_permission({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_dns_bind_permission name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_dns_bind_permission ::Google::Cloud::VmwareEngine::V1::GetDnsBindPermissionRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_dns_bind_permission({ 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_dns_bind_permission(::Google::Cloud::VmwareEngine::V1::GetDnsBindPermissionRequest.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_dns_bind_permission_client_stub.call_rpc_count - end - end - - def test_revoke_dns_bind_permission - # 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" - principal = {} - request_id = "hello world" - - revoke_dns_bind_permission_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :revoke_dns_bind_permission, name - assert_kind_of ::Google::Cloud::VmwareEngine::V1::RevokeDnsBindPermissionRequest, request - assert_equal "hello world", request["name"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::VmwareEngine::V1::Principal), request["principal"] - assert_equal "hello world", request["request_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, revoke_dns_bind_permission_client_stub do - # Create client - client = ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.revoke_dns_bind_permission({ name: name, principal: principal, request_id: request_id }) 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.revoke_dns_bind_permission name: name, principal: principal, request_id: request_id 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.revoke_dns_bind_permission ::Google::Cloud::VmwareEngine::V1::RevokeDnsBindPermissionRequest.new(name: name, principal: principal, request_id: request_id) 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.revoke_dns_bind_permission({ name: name, principal: principal, request_id: request_id }, 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.revoke_dns_bind_permission(::Google::Cloud::VmwareEngine::V1::RevokeDnsBindPermissionRequest.new(name: name, principal: principal, request_id: request_id), 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, revoke_dns_bind_permission_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::VmwareEngine::V1::VmwareEngine::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::VmwareEngine::V1::VmwareEngine::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::VmwareEngine::V1::VmwareEngine::Client.new do |config| - config.credentials = creds - end - assert_kind_of ::Google::Cloud::VmwareEngine::V1::VmwareEngine::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::VmwareEngine::V1::VmwareEngine::Client.new do |config| - config.credentials = grpc_channel - end - end - - assert_kind_of ::Google::Cloud::VmwareEngine::V1::VmwareEngine::Operations, client.operations_client - end -end diff --git a/owl-bot-staging/google-cloud-vmware_engine-v1/test/helper.rb b/owl-bot-staging/google-cloud-vmware_engine-v1/test/helper.rb deleted file mode 100644 index 672b337030e7..000000000000 --- a/owl-bot-staging/google-cloud-vmware_engine-v1/test/helper.rb +++ /dev/null @@ -1,26 +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/mock" -require "minitest/rg" - -require "grpc" - -require "ostruct" diff --git a/owl-bot-staging/google-cloud-vpc_access-v1/.gitignore b/owl-bot-staging/google-cloud-vpc_access-v1/.gitignore deleted file mode 100644 index 0135b6bc6cfc..000000000000 --- a/owl-bot-staging/google-cloud-vpc_access-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-vpc_access-v1/.repo-metadata.json b/owl-bot-staging/google-cloud-vpc_access-v1/.repo-metadata.json deleted file mode 100644 index 555203aea0e8..000000000000 --- a/owl-bot-staging/google-cloud-vpc_access-v1/.repo-metadata.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "api_id": "vpcaccess.googleapis.com", - "api_shortname": "vpcaccess", - "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-vpc_access-v1/latest", - "distribution_name": "google-cloud-vpc_access-v1", - "is_cloud": true, - "language": "ruby", - "name": "vpcaccess", - "name_pretty": "Serverless VPC Access V1 API", - "product_documentation": "https://cloud.google.com/vpc/docs/serverless-vpc-access", - "release_level": "unreleased", - "repo": "googleapis/google-cloud-ruby", - "requires_billing": true, - "ruby-cloud-description": "Serverless VPC Access enables you to connect from a serverless environment on Google Cloud (Cloud Run, Cloud Functions, or the App Engine standard environment) directly to your VPC network. This connection makes it possible for your serverless environment to access Compute Engine VM instances, Memorystore instances, and any other resources with an internal IP address. Note that google-cloud-vpc_access-v1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-vpc_access instead. See the readme for more details.", - "ruby-cloud-env-prefix": "VPC_ACCESS", - "ruby-cloud-product-url": "https://cloud.google.com/vpc/docs/serverless-vpc-access", - "library_type": "GAPIC_AUTO" -} diff --git a/owl-bot-staging/google-cloud-vpc_access-v1/.rubocop.yml b/owl-bot-staging/google-cloud-vpc_access-v1/.rubocop.yml deleted file mode 100644 index 5d9ab3a8534f..000000000000 --- a/owl-bot-staging/google-cloud-vpc_access-v1/.rubocop.yml +++ /dev/null @@ -1,33 +0,0 @@ -inherit_gem: - google-style: google-style.yml - -AllCops: - Exclude: - - "google-cloud-vpc_access-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-vpc_access-v1.rb" diff --git a/owl-bot-staging/google-cloud-vpc_access-v1/.toys.rb b/owl-bot-staging/google-cloud-vpc_access-v1/.toys.rb deleted file mode 100644 index 177e22456e8a..000000000000 --- a/owl-bot-staging/google-cloud-vpc_access-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-vpc_access-v1/.yardopts b/owl-bot-staging/google-cloud-vpc_access-v1/.yardopts deleted file mode 100644 index 18b7b8796058..000000000000 --- a/owl-bot-staging/google-cloud-vpc_access-v1/.yardopts +++ /dev/null @@ -1,12 +0,0 @@ ---no-private ---title="Serverless VPC Access 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-vpc_access-v1/AUTHENTICATION.md b/owl-bot-staging/google-cloud-vpc_access-v1/AUTHENTICATION.md deleted file mode 100644 index 0a3414fbad29..000000000000 --- a/owl-bot-staging/google-cloud-vpc_access-v1/AUTHENTICATION.md +++ /dev/null @@ -1,122 +0,0 @@ -# Authentication - -The recommended way to authenticate to the google-cloud-vpc_access-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-vpc_access-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/vpc_access/v1" - -client = ::Google::Cloud::VpcAccess::V1::VpcAccessService::Client.new do |config| - config.credentials = "path/to/credentialfile.json" -end -``` - -To configure a credentials file globally for all clients: - -```ruby -require "google/cloud/vpc_access/v1" - -::Google::Cloud::VpcAccess::V1::VpcAccessService::Client.configure do |config| - config.credentials = "path/to/credentialfile.json" -end - -client = ::Google::Cloud::VpcAccess::V1::VpcAccessService::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-vpc_access-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/vpc_access/v1" - -ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" - -client = ::Google::Cloud::VpcAccess::V1::VpcAccessService::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-vpc_access-v1/CHANGELOG.md b/owl-bot-staging/google-cloud-vpc_access-v1/CHANGELOG.md deleted file mode 100644 index f88957a62ba2..000000000000 --- a/owl-bot-staging/google-cloud-vpc_access-v1/CHANGELOG.md +++ /dev/null @@ -1,2 +0,0 @@ -# Release History - diff --git a/owl-bot-staging/google-cloud-vpc_access-v1/Gemfile b/owl-bot-staging/google-cloud-vpc_access-v1/Gemfile deleted file mode 100644 index 1d08558908d8..000000000000 --- a/owl-bot-staging/google-cloud-vpc_access-v1/Gemfile +++ /dev/null @@ -1,14 +0,0 @@ -source "https://rubygems.org" - -gemspec - -gem "google-style", "~> 1.32.0" -gem "irb", "~> 1.17" -gem "minitest", "~> 6.0.2" -gem "minitest-focus", "~> 1.4" -gem "minitest-mock", "~> 5.27" -gem "minitest-rg", "~> 5.3" -gem "ostruct", "~> 0.5.5" -gem "rake", ">= 13.0" -gem "redcarpet", "~> 3.6" -gem "yard", "~> 0.9" diff --git a/owl-bot-staging/google-cloud-vpc_access-v1/LICENSE.md b/owl-bot-staging/google-cloud-vpc_access-v1/LICENSE.md deleted file mode 100644 index c261857ba6ad..000000000000 --- a/owl-bot-staging/google-cloud-vpc_access-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-vpc_access-v1/README.md b/owl-bot-staging/google-cloud-vpc_access-v1/README.md deleted file mode 100644 index f3ab3b89c390..000000000000 --- a/owl-bot-staging/google-cloud-vpc_access-v1/README.md +++ /dev/null @@ -1,154 +0,0 @@ -# Ruby Client for the Serverless VPC Access V1 API - -API for managing VPC access connectors. - -Serverless VPC Access enables you to connect from a serverless environment on Google Cloud (Cloud Run, Cloud Functions, or the App Engine standard environment) directly to your VPC network. This connection makes it possible for your serverless environment to access Compute Engine VM instances, Memorystore instances, and any other resources with an internal IP address. - -https://github.com/googleapis/google-cloud-ruby - -This gem is a _versioned_ client. It provides basic client classes for a -specific version of the Serverless VPC Access V1 API. Most users should consider using -the main client gem, -[google-cloud-vpc_access](https://rubygems.org/gems/google-cloud-vpc_access). -See the section below titled *Which client should I use?* for more information. - -## Installation - -``` -$ gem install google-cloud-vpc_access-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/vpcaccess.googleapis.com) -1. [Set up authentication.](AUTHENTICATION.md) - -## Quick Start - -```ruby -require "google/cloud/vpc_access/v1" - -client = ::Google::Cloud::VpcAccess::V1::VpcAccessService::Client.new -request = ::Google::Cloud::VpcAccess::V1::CreateConnectorRequest.new # (request fields as keyword arguments...) -response = client.create_connector request -``` - -View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-vpc_access-v1/latest) -for class and method documentation. - -See also the [Product Documentation](https://cloud.google.com/vpc/docs/serverless-vpc-access) -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/vpc_access/v1" -require "logger" - -client = ::Google::Cloud::VpcAccess::V1::VpcAccessService::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-vpc_access`, -and lower-level _versioned_ client libraries with names such as -`google-cloud-vpc_access-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-vpc_access`. -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-vpc_access-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-vpc_access-v1/Rakefile b/owl-bot-staging/google-cloud-vpc_access-v1/Rakefile deleted file mode 100644 index e8bc005d5a03..000000000000 --- a/owl-bot-staging/google-cloud-vpc_access-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-vpc_access-v1 acceptance tests." -task :acceptance, :project, :keyfile do |t, args| - project = args[:project] - project ||= - ENV["VPC_ACCESS_TEST_PROJECT"] || - ENV["GCLOUD_TEST_PROJECT"] - keyfile = args[:keyfile] - keyfile ||= - ENV["VPC_ACCESS_TEST_KEYFILE"] || - ENV["GCLOUD_TEST_KEYFILE"] - if keyfile - keyfile = File.read keyfile - else - keyfile ||= - ENV["VPC_ACCESS_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 VPC_ACCESS_TEST_PROJECT=test123 VPC_ACCESS_TEST_KEYFILE=/path/to/keyfile.json rake acceptance" - end - require "google/cloud/vpc_access/v1/vpc_access_service/credentials" - ::Google::Cloud::VpcAccess::V1::VpcAccessService::Credentials.env_vars.each do |path| - ENV[path] = nil - end - ENV["VPC_ACCESS_PROJECT"] = project - ENV["VPC_ACCESS_TEST_PROJECT"] = project - ENV["VPC_ACCESS_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-vpc_access-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-vpc_access-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-vpc_access-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-vpc_access-v1 gem does not have doctest tests." -end - -desc "Run the CI build" -task :ci do - header "BUILDING google-cloud-vpc_access-v1" - header "google-cloud-vpc_access-v1 rubocop", "*" - Rake::Task[:rubocop].invoke - header "google-cloud-vpc_access-v1 yard", "*" - Rake::Task[:yard].invoke - header "google-cloud-vpc_access-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-vpc_access-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-vpc_access-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-vpc_access-v1/gapic_metadata.json b/owl-bot-staging/google-cloud-vpc_access-v1/gapic_metadata.json deleted file mode 100644 index 2dae0b91baaf..000000000000 --- a/owl-bot-staging/google-cloud-vpc_access-v1/gapic_metadata.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", - "language": "ruby", - "protoPackage": "google.cloud.vpcaccess.v1", - "libraryPackage": "::Google::Cloud::VpcAccess::V1", - "services": { - "VpcAccessService": { - "clients": { - "grpc": { - "libraryClient": "::Google::Cloud::VpcAccess::V1::VpcAccessService::Client", - "rpcs": { - "CreateConnector": { - "methods": [ - "create_connector" - ] - }, - "GetConnector": { - "methods": [ - "get_connector" - ] - }, - "ListConnectors": { - "methods": [ - "list_connectors" - ] - }, - "DeleteConnector": { - "methods": [ - "delete_connector" - ] - } - } - } - } - } - } -} diff --git a/owl-bot-staging/google-cloud-vpc_access-v1/google-cloud-vpc_access-v1.gemspec b/owl-bot-staging/google-cloud-vpc_access-v1/google-cloud-vpc_access-v1.gemspec deleted file mode 100644 index 6f98e60fcf08..000000000000 --- a/owl-bot-staging/google-cloud-vpc_access-v1/google-cloud-vpc_access-v1.gemspec +++ /dev/null @@ -1,29 +0,0 @@ -# -*- ruby -*- -# encoding: utf-8 - -require File.expand_path("lib/google/cloud/vpc_access/v1/version", __dir__) - -Gem::Specification.new do |gem| - gem.name = "google-cloud-vpc_access-v1" - gem.version = Google::Cloud::VpcAccess::V1::VERSION - - gem.authors = ["Google LLC"] - gem.email = "googleapis-packages@google.com" - gem.description = "Serverless VPC Access enables you to connect from a serverless environment on Google Cloud (Cloud Run, Cloud Functions, or the App Engine standard environment) directly to your VPC network. This connection makes it possible for your serverless environment to access Compute Engine VM instances, Memorystore instances, and any other resources with an internal IP address. Note that google-cloud-vpc_access-v1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-vpc_access instead. See the readme for more details." - gem.summary = "API for managing VPC access connectors." - 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.2" - - gem.add_dependency "gapic-common", "~> 1.2" - gem.add_dependency "google-cloud-errors", "~> 1.0" - gem.add_dependency "google-cloud-location", "~> 1.0" -end diff --git a/owl-bot-staging/google-cloud-vpc_access-v1/lib/google-cloud-vpc_access-v1.rb b/owl-bot-staging/google-cloud-vpc_access-v1/lib/google-cloud-vpc_access-v1.rb deleted file mode 100644 index dd22501e9404..000000000000 --- a/owl-bot-staging/google-cloud-vpc_access-v1/lib/google-cloud-vpc_access-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/vpc_access/v1" diff --git a/owl-bot-staging/google-cloud-vpc_access-v1/lib/google/cloud/vpc_access/v1.rb b/owl-bot-staging/google-cloud-vpc_access-v1/lib/google/cloud/vpc_access/v1.rb deleted file mode 100644 index 927136b99d80..000000000000 --- a/owl-bot-staging/google-cloud-vpc_access-v1/lib/google/cloud/vpc_access/v1.rb +++ /dev/null @@ -1,45 +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/vpc_access/v1/vpc_access_service" -require "google/cloud/vpc_access/v1/version" - -module Google - module Cloud - module VpcAccess - ## - # API client module. - # - # @example Load this package, including all its services, and instantiate a gRPC client - # - # require "google/cloud/vpc_access/v1" - # client = ::Google::Cloud::VpcAccess::V1::VpcAccessService::Client.new - # - # @example Load this package, including all its services, and instantiate a REST client - # - # require "google/cloud/vpc_access/v1" - # client = ::Google::Cloud::VpcAccess::V1::VpcAccessService::Rest::Client.new - # - module V1 - end - end - end -end - -helper_path = ::File.join __dir__, "v1", "_helpers.rb" -require "google/cloud/vpc_access/v1/_helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-vpc_access-v1/lib/google/cloud/vpc_access/v1/bindings_override.rb b/owl-bot-staging/google-cloud-vpc_access-v1/lib/google/cloud/vpc_access/v1/bindings_override.rb deleted file mode 100644 index 3da4e39390e9..000000000000 --- a/owl-bot-staging/google-cloud-vpc_access-v1/lib/google/cloud/vpc_access/v1/bindings_override.rb +++ /dev/null @@ -1,64 +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 VpcAccess - ## - # @example Loading just the REST part of this package, including all its services, and instantiating a REST client - # - # require "google/cloud/vpc_access/v1/rest" - # client = ::Google::Cloud::VpcAccess::V1::VpcAccessService::Rest::Client.new - # - module V1 - ## - # @private - # Initialize the mixin bindings configuration - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "VpcAccess"] - 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.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 - end - yield @configure if block_given? - @configure - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-vpc_access-v1/lib/google/cloud/vpc_access/v1/rest.rb b/owl-bot-staging/google-cloud-vpc_access-v1/lib/google/cloud/vpc_access/v1/rest.rb deleted file mode 100644 index 998323ec2725..000000000000 --- a/owl-bot-staging/google-cloud-vpc_access-v1/lib/google/cloud/vpc_access/v1/rest.rb +++ /dev/null @@ -1,38 +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/vpc_access/v1/vpc_access_service/rest" -require "google/cloud/vpc_access/v1/bindings_override" -require "google/cloud/vpc_access/v1/version" - -module Google - module Cloud - module VpcAccess - ## - # To load just the REST part of this package, including all its services, and instantiate a REST client: - # - # @example - # - # require "google/cloud/vpc_access/v1/rest" - # client = ::Google::Cloud::VpcAccess::V1::VpcAccessService::Rest::Client.new - # - module V1 - end - end - end -end diff --git a/owl-bot-staging/google-cloud-vpc_access-v1/lib/google/cloud/vpc_access/v1/version.rb b/owl-bot-staging/google-cloud-vpc_access-v1/lib/google/cloud/vpc_access/v1/version.rb deleted file mode 100644 index 3348f75044ad..000000000000 --- a/owl-bot-staging/google-cloud-vpc_access-v1/lib/google/cloud/vpc_access/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 VpcAccess - module V1 - VERSION = "0.0.1" - end - end - end -end diff --git a/owl-bot-staging/google-cloud-vpc_access-v1/lib/google/cloud/vpc_access/v1/vpc_access_service.rb b/owl-bot-staging/google-cloud-vpc_access-v1/lib/google/cloud/vpc_access/v1/vpc_access_service.rb deleted file mode 100644 index b1274c5f41a2..000000000000 --- a/owl-bot-staging/google-cloud-vpc_access-v1/lib/google/cloud/vpc_access/v1/vpc_access_service.rb +++ /dev/null @@ -1,58 +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/vpc_access/v1/version" - -require "google/cloud/vpc_access/v1/vpc_access_service/credentials" -require "google/cloud/vpc_access/v1/vpc_access_service/paths" -require "google/cloud/vpc_access/v1/vpc_access_service/operations" -require "google/cloud/vpc_access/v1/vpc_access_service/client" -require "google/cloud/vpc_access/v1/vpc_access_service/rest" - -module Google - module Cloud - module VpcAccess - module V1 - ## - # Serverless VPC Access API allows users to create and manage connectors for - # App Engine, Cloud Functions and Cloud Run to have internal connections to - # Virtual Private Cloud networks. - # - # @example Load this service and instantiate a gRPC client - # - # require "google/cloud/vpc_access/v1/vpc_access_service" - # client = ::Google::Cloud::VpcAccess::V1::VpcAccessService::Client.new - # - # @example Load this service and instantiate a REST client - # - # require "google/cloud/vpc_access/v1/vpc_access_service/rest" - # client = ::Google::Cloud::VpcAccess::V1::VpcAccessService::Rest::Client.new - # - module VpcAccessService - end - end - end - end -end - -helper_path = ::File.join __dir__, "vpc_access_service", "helpers.rb" -require "google/cloud/vpc_access/v1/vpc_access_service/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-vpc_access-v1/lib/google/cloud/vpc_access/v1/vpc_access_service/client.rb b/owl-bot-staging/google-cloud-vpc_access-v1/lib/google/cloud/vpc_access/v1/vpc_access_service/client.rb deleted file mode 100644 index 3ec4e8d43b00..000000000000 --- a/owl-bot-staging/google-cloud-vpc_access-v1/lib/google/cloud/vpc_access/v1/vpc_access_service/client.rb +++ /dev/null @@ -1,830 +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/vpcaccess/v1/vpc_access_pb" -require "google/cloud/location" - -module Google - module Cloud - module VpcAccess - module V1 - module VpcAccessService - ## - # Client for the VpcAccessService service. - # - # Serverless VPC Access API allows users to create and manage connectors for - # App Engine, Cloud Functions and Cloud Run to have internal connections to - # Virtual Private Cloud networks. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "vpcaccess.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :vpc_access_service_stub - - ## - # Configure the VpcAccessService Client class. - # - # See {::Google::Cloud::VpcAccess::V1::VpcAccessService::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all VpcAccessService clients - # ::Google::Cloud::VpcAccess::V1::VpcAccessService::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", "VpcAccess", "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.timeout = 60.0 - default_config.retry_policy = { - initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 2] - } - - default_config.rpcs.create_connector.timeout = 60.0 - - default_config.rpcs.get_connector.timeout = 60.0 - - default_config.rpcs.list_connectors.timeout = 60.0 - - default_config.rpcs.delete_connector.timeout = 60.0 - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the VpcAccessService 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::VpcAccess::V1::VpcAccessService::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 - @vpc_access_service_stub.universe_domain - end - - ## - # Create a new VpcAccessService client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::VpcAccess::V1::VpcAccessService::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::VpcAccess::V1::VpcAccessService::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the VpcAccessService 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/vpcaccess/v1/vpc_access_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 - - @vpc_access_service_stub = ::Gapic::ServiceStub.new( - ::Google::Cloud::VpcAccess::V1::VpcAccessService::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 - ) - - @vpc_access_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 = @vpc_access_service_stub.endpoint - config.universe_domain = @vpc_access_service_stub.universe_domain - config.logger = @vpc_access_service_stub.logger if config.respond_to? :logger= - end - end - - ## - # Get the associated client for long-running operations. - # - # @return [::Google::Cloud::VpcAccess::V1::VpcAccessService::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 - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @vpc_access_service_stub.logger - end - - # Service calls - - ## - # Creates a Serverless VPC Access connector, returns an operation. - # - # @overload create_connector(request, options = nil) - # Pass arguments to `create_connector` via a request object, either of type - # {::Google::Cloud::VpcAccess::V1::CreateConnectorRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VpcAccess::V1::CreateConnectorRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_connector(parent: nil, connector_id: nil, connector: nil) - # Pass arguments to `create_connector` via keyword arguments. Note that at - # least one keyword argument is 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 and location in which the configuration should be created, - # specified in the format `projects/*/locations/*`. - # @param connector_id [::String] - # Required. The ID to use for this connector. - # @param connector [::Google::Cloud::VpcAccess::V1::Connector, ::Hash] - # Required. Resource 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/vpc_access/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VpcAccess::V1::VpcAccessService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VpcAccess::V1::CreateConnectorRequest.new - # - # # Call the create_connector method. - # result = client.create_connector 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_connector request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VpcAccess::V1::CreateConnectorRequest - - # Converts hash 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_connector.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::VpcAccess::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_connector.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_connector.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vpc_access_service_stub.call_rpc :create_connector, 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 - - ## - # Gets a Serverless VPC Access connector. Returns NOT_FOUND if the resource - # does not exist. - # - # @overload get_connector(request, options = nil) - # Pass arguments to `get_connector` via a request object, either of type - # {::Google::Cloud::VpcAccess::V1::GetConnectorRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VpcAccess::V1::GetConnectorRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_connector(name: nil) - # Pass arguments to `get_connector` via keyword arguments. Note that at - # least one keyword argument is 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 a Serverless VPC Access connector to get. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::VpcAccess::V1::Connector] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::VpcAccess::V1::Connector] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/vpc_access/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VpcAccess::V1::VpcAccessService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VpcAccess::V1::GetConnectorRequest.new - # - # # Call the get_connector method. - # result = client.get_connector request - # - # # The returned object is of type Google::Cloud::VpcAccess::V1::Connector. - # p result - # - def get_connector request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VpcAccess::V1::GetConnectorRequest - - # Converts hash 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_connector.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::VpcAccess::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_connector.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_connector.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vpc_access_service_stub.call_rpc :get_connector, 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 Serverless VPC Access connectors. - # - # @overload list_connectors(request, options = nil) - # Pass arguments to `list_connectors` via a request object, either of type - # {::Google::Cloud::VpcAccess::V1::ListConnectorsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VpcAccess::V1::ListConnectorsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_connectors(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_connectors` via keyword arguments. Note that at - # least one keyword argument is 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 and location from which the routes should be listed. - # @param page_size [::Integer] - # Maximum number of functions to return per call. - # @param page_token [::String] - # Continuation token. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::VpcAccess::V1::Connector>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::VpcAccess::V1::Connector>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/vpc_access/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VpcAccess::V1::VpcAccessService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VpcAccess::V1::ListConnectorsRequest.new - # - # # Call the list_connectors method. - # result = client.list_connectors 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::VpcAccess::V1::Connector. - # p item - # end - # - def list_connectors request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VpcAccess::V1::ListConnectorsRequest - - # Converts hash 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_connectors.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::VpcAccess::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_connectors.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_connectors.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vpc_access_service_stub.call_rpc :list_connectors, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @vpc_access_service_stub, :list_connectors, 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 Serverless VPC Access connector. Returns NOT_FOUND if the - # resource does not exist. - # - # @overload delete_connector(request, options = nil) - # Pass arguments to `delete_connector` via a request object, either of type - # {::Google::Cloud::VpcAccess::V1::DeleteConnectorRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VpcAccess::V1::DeleteConnectorRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_connector(name: nil) - # Pass arguments to `delete_connector` via keyword arguments. Note that at - # least one keyword argument is 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 a Serverless VPC Access connector 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/vpc_access/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VpcAccess::V1::VpcAccessService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VpcAccess::V1::DeleteConnectorRequest.new - # - # # Call the delete_connector method. - # result = client.delete_connector 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_connector request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VpcAccess::V1::DeleteConnectorRequest - - # Converts hash 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_connector.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::VpcAccess::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_connector.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_connector.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vpc_access_service_stub.call_rpc :delete_connector, 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 VpcAccessService API. - # - # This class represents the configuration for VpcAccessService, - # 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::VpcAccess::V1::VpcAccessService::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_connector to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::VpcAccess::V1::VpcAccessService::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.create_connector.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::VpcAccess::V1::VpcAccessService::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.create_connector.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::VpcAccess::V1::VpcAccessService::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 = "vpcaccess.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 VpcAccessService 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_connector` - # @return [::Gapic::Config::Method] - # - attr_reader :create_connector - ## - # RPC-specific configuration for `get_connector` - # @return [::Gapic::Config::Method] - # - attr_reader :get_connector - ## - # RPC-specific configuration for `list_connectors` - # @return [::Gapic::Config::Method] - # - attr_reader :list_connectors - ## - # RPC-specific configuration for `delete_connector` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_connector - - # @private - def initialize parent_rpcs = nil - create_connector_config = parent_rpcs.create_connector if parent_rpcs.respond_to? :create_connector - @create_connector = ::Gapic::Config::Method.new create_connector_config - get_connector_config = parent_rpcs.get_connector if parent_rpcs.respond_to? :get_connector - @get_connector = ::Gapic::Config::Method.new get_connector_config - list_connectors_config = parent_rpcs.list_connectors if parent_rpcs.respond_to? :list_connectors - @list_connectors = ::Gapic::Config::Method.new list_connectors_config - delete_connector_config = parent_rpcs.delete_connector if parent_rpcs.respond_to? :delete_connector - @delete_connector = ::Gapic::Config::Method.new delete_connector_config - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-vpc_access-v1/lib/google/cloud/vpc_access/v1/vpc_access_service/credentials.rb b/owl-bot-staging/google-cloud-vpc_access-v1/lib/google/cloud/vpc_access/v1/vpc_access_service/credentials.rb deleted file mode 100644 index cb40b03f48ad..000000000000 --- a/owl-bot-staging/google-cloud-vpc_access-v1/lib/google/cloud/vpc_access/v1/vpc_access_service/credentials.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! - -require "googleauth" - -module Google - module Cloud - module VpcAccess - module V1 - module VpcAccessService - # Credentials for the VpcAccessService API. - class Credentials < ::Google::Auth::Credentials - self.scope = [ - "https://www.googleapis.com/auth/cloud-platform" - ] - self.env_vars = [ - "VPC_ACCESS_CREDENTIALS", - "VPC_ACCESS_KEYFILE", - "GOOGLE_CLOUD_CREDENTIALS", - "GOOGLE_CLOUD_KEYFILE", - "GCLOUD_KEYFILE", - "VPC_ACCESS_CREDENTIALS_JSON", - "VPC_ACCESS_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-vpc_access-v1/lib/google/cloud/vpc_access/v1/vpc_access_service/operations.rb b/owl-bot-staging/google-cloud-vpc_access-v1/lib/google/cloud/vpc_access/v1/vpc_access_service/operations.rb deleted file mode 100644 index 0680a1f755d1..000000000000 --- a/owl-bot-staging/google-cloud-vpc_access-v1/lib/google/cloud/vpc_access/v1/vpc_access_service/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 VpcAccess - module V1 - module VpcAccessService - # Service that implements Longrunning Operations API. - class Operations - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "vpcaccess.$UNIVERSE_DOMAIN$" - - # @private - attr_reader :operations_stub - - ## - # Configuration for the VpcAccessService 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 VpcAccessService 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::VpcAccess::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::VpcAccess::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::VpcAccess::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::VpcAccess::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::VpcAccess::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 = "vpcaccess.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-vpc_access-v1/lib/google/cloud/vpc_access/v1/vpc_access_service/paths.rb b/owl-bot-staging/google-cloud-vpc_access-v1/lib/google/cloud/vpc_access/v1/vpc_access_service/paths.rb deleted file mode 100644 index 83b10fa7cd6a..000000000000 --- a/owl-bot-staging/google-cloud-vpc_access-v1/lib/google/cloud/vpc_access/v1/vpc_access_service/paths.rb +++ /dev/null @@ -1,69 +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 VpcAccess - module V1 - module VpcAccessService - # Path helper methods for the VpcAccessService API. - module Paths - ## - # Create a fully-qualified Connector resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/connectors/{connector}` - # - # @param project [String] - # @param location [String] - # @param connector [String] - # - # @return [::String] - def connector_path project:, location:, connector: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/connectors/#{connector}" - 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-vpc_access-v1/lib/google/cloud/vpc_access/v1/vpc_access_service/rest.rb b/owl-bot-staging/google-cloud-vpc_access-v1/lib/google/cloud/vpc_access/v1/vpc_access_service/rest.rb deleted file mode 100644 index 4ab07e129b6a..000000000000 --- a/owl-bot-staging/google-cloud-vpc_access-v1/lib/google/cloud/vpc_access/v1/vpc_access_service/rest.rb +++ /dev/null @@ -1,56 +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/vpc_access/v1/version" -require "google/cloud/vpc_access/v1/bindings_override" - -require "google/cloud/vpc_access/v1/vpc_access_service/credentials" -require "google/cloud/vpc_access/v1/vpc_access_service/paths" -require "google/cloud/vpc_access/v1/vpc_access_service/rest/operations" -require "google/cloud/vpc_access/v1/vpc_access_service/rest/client" - -module Google - module Cloud - module VpcAccess - module V1 - ## - # Serverless VPC Access API allows users to create and manage connectors for - # App Engine, Cloud Functions and Cloud Run to have internal connections to - # Virtual Private Cloud networks. - # - # To load this service and instantiate a REST client: - # - # require "google/cloud/vpc_access/v1/vpc_access_service/rest" - # client = ::Google::Cloud::VpcAccess::V1::VpcAccessService::Rest::Client.new - # - module VpcAccessService - # Client for the REST transport - module Rest - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "rest", "helpers.rb" -require "google/cloud/vpc_access/v1/vpc_access_service/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-vpc_access-v1/lib/google/cloud/vpc_access/v1/vpc_access_service/rest/client.rb b/owl-bot-staging/google-cloud-vpc_access-v1/lib/google/cloud/vpc_access/v1/vpc_access_service/rest/client.rb deleted file mode 100644 index 461527c82fd1..000000000000 --- a/owl-bot-staging/google-cloud-vpc_access-v1/lib/google/cloud/vpc_access/v1/vpc_access_service/rest/client.rb +++ /dev/null @@ -1,767 +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/vpcaccess/v1/vpc_access_pb" -require "google/cloud/vpc_access/v1/vpc_access_service/rest/service_stub" -require "google/cloud/location/rest" - -module Google - module Cloud - module VpcAccess - module V1 - module VpcAccessService - module Rest - ## - # REST client for the VpcAccessService service. - # - # Serverless VPC Access API allows users to create and manage connectors for - # App Engine, Cloud Functions and Cloud Run to have internal connections to - # Virtual Private Cloud networks. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "vpcaccess.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :vpc_access_service_stub - - ## - # Configure the VpcAccessService Client class. - # - # See {::Google::Cloud::VpcAccess::V1::VpcAccessService::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all VpcAccessService clients - # ::Google::Cloud::VpcAccess::V1::VpcAccessService::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", "VpcAccess", "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.timeout = 60.0 - default_config.retry_policy = { - initial_delay: 1.0, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 2] - } - - default_config.rpcs.create_connector.timeout = 60.0 - - default_config.rpcs.get_connector.timeout = 60.0 - - default_config.rpcs.list_connectors.timeout = 60.0 - - default_config.rpcs.delete_connector.timeout = 60.0 - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the VpcAccessService 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::VpcAccess::V1::VpcAccessService::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 - @vpc_access_service_stub.universe_domain - end - - ## - # Create a new VpcAccessService REST client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::VpcAccess::V1::VpcAccessService::Rest::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::VpcAccess::V1::VpcAccessService::Rest::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the VpcAccessService 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::VpcAccess::V1::VpcAccessService::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 - - @vpc_access_service_stub = ::Google::Cloud::VpcAccess::V1::VpcAccessService::Rest::ServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials, - logger: @config.logger - ) - - @vpc_access_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 = @vpc_access_service_stub.endpoint - config.universe_domain = @vpc_access_service_stub.universe_domain - config.bindings_override = @config.bindings_override - config.logger = @vpc_access_service_stub.logger if config.respond_to? :logger= - end - end - - ## - # Get the associated client for long-running operations. - # - # @return [::Google::Cloud::VpcAccess::V1::VpcAccessService::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 - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @vpc_access_service_stub.logger - end - - # Service calls - - ## - # Creates a Serverless VPC Access connector, returns an operation. - # - # @overload create_connector(request, options = nil) - # Pass arguments to `create_connector` via a request object, either of type - # {::Google::Cloud::VpcAccess::V1::CreateConnectorRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VpcAccess::V1::CreateConnectorRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_connector(parent: nil, connector_id: nil, connector: nil) - # Pass arguments to `create_connector` via keyword arguments. Note that at - # least one keyword argument is 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 and location in which the configuration should be created, - # specified in the format `projects/*/locations/*`. - # @param connector_id [::String] - # Required. The ID to use for this connector. - # @param connector [::Google::Cloud::VpcAccess::V1::Connector, ::Hash] - # Required. Resource 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/vpc_access/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VpcAccess::V1::VpcAccessService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VpcAccess::V1::CreateConnectorRequest.new - # - # # Call the create_connector method. - # result = client.create_connector 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_connector request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VpcAccess::V1::CreateConnectorRequest - - # Converts hash 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_connector.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::VpcAccess::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_connector.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_connector.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vpc_access_service_stub.create_connector 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 - - ## - # Gets a Serverless VPC Access connector. Returns NOT_FOUND if the resource - # does not exist. - # - # @overload get_connector(request, options = nil) - # Pass arguments to `get_connector` via a request object, either of type - # {::Google::Cloud::VpcAccess::V1::GetConnectorRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VpcAccess::V1::GetConnectorRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_connector(name: nil) - # Pass arguments to `get_connector` via keyword arguments. Note that at - # least one keyword argument is 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 a Serverless VPC Access connector to get. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::VpcAccess::V1::Connector] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::VpcAccess::V1::Connector] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/vpc_access/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VpcAccess::V1::VpcAccessService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VpcAccess::V1::GetConnectorRequest.new - # - # # Call the get_connector method. - # result = client.get_connector request - # - # # The returned object is of type Google::Cloud::VpcAccess::V1::Connector. - # p result - # - def get_connector request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VpcAccess::V1::GetConnectorRequest - - # Converts hash 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_connector.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::VpcAccess::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_connector.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_connector.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vpc_access_service_stub.get_connector 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 Serverless VPC Access connectors. - # - # @overload list_connectors(request, options = nil) - # Pass arguments to `list_connectors` via a request object, either of type - # {::Google::Cloud::VpcAccess::V1::ListConnectorsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VpcAccess::V1::ListConnectorsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_connectors(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_connectors` via keyword arguments. Note that at - # least one keyword argument is 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 and location from which the routes should be listed. - # @param page_size [::Integer] - # Maximum number of functions to return per call. - # @param page_token [::String] - # Continuation token. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::VpcAccess::V1::Connector>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::VpcAccess::V1::Connector>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/vpc_access/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VpcAccess::V1::VpcAccessService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VpcAccess::V1::ListConnectorsRequest.new - # - # # Call the list_connectors method. - # result = client.list_connectors 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::VpcAccess::V1::Connector. - # p item - # end - # - def list_connectors request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VpcAccess::V1::ListConnectorsRequest - - # Converts hash 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_connectors.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::VpcAccess::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_connectors.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_connectors.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vpc_access_service_stub.list_connectors request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @vpc_access_service_stub, :list_connectors, "connectors", 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 Serverless VPC Access connector. Returns NOT_FOUND if the - # resource does not exist. - # - # @overload delete_connector(request, options = nil) - # Pass arguments to `delete_connector` via a request object, either of type - # {::Google::Cloud::VpcAccess::V1::DeleteConnectorRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::VpcAccess::V1::DeleteConnectorRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_connector(name: nil) - # Pass arguments to `delete_connector` via keyword arguments. Note that at - # least one keyword argument is 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 a Serverless VPC Access connector 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/vpc_access/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::VpcAccess::V1::VpcAccessService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::VpcAccess::V1::DeleteConnectorRequest.new - # - # # Call the delete_connector method. - # result = client.delete_connector 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_connector request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::VpcAccess::V1::DeleteConnectorRequest - - # Converts hash 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_connector.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::VpcAccess::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_connector.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_connector.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @vpc_access_service_stub.delete_connector 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 - - ## - # Configuration class for the VpcAccessService REST API. - # - # This class represents the configuration for VpcAccessService 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::VpcAccess::V1::VpcAccessService::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_connector to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::VpcAccess::V1::VpcAccessService::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.create_connector.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::VpcAccess::V1::VpcAccessService::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.create_connector.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 = "vpcaccess.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 VpcAccessService 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_connector` - # @return [::Gapic::Config::Method] - # - attr_reader :create_connector - ## - # RPC-specific configuration for `get_connector` - # @return [::Gapic::Config::Method] - # - attr_reader :get_connector - ## - # RPC-specific configuration for `list_connectors` - # @return [::Gapic::Config::Method] - # - attr_reader :list_connectors - ## - # RPC-specific configuration for `delete_connector` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_connector - - # @private - def initialize parent_rpcs = nil - create_connector_config = parent_rpcs.create_connector if parent_rpcs.respond_to? :create_connector - @create_connector = ::Gapic::Config::Method.new create_connector_config - get_connector_config = parent_rpcs.get_connector if parent_rpcs.respond_to? :get_connector - @get_connector = ::Gapic::Config::Method.new get_connector_config - list_connectors_config = parent_rpcs.list_connectors if parent_rpcs.respond_to? :list_connectors - @list_connectors = ::Gapic::Config::Method.new list_connectors_config - delete_connector_config = parent_rpcs.delete_connector if parent_rpcs.respond_to? :delete_connector - @delete_connector = ::Gapic::Config::Method.new delete_connector_config - - yield self if block_given? - end - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-vpc_access-v1/lib/google/cloud/vpc_access/v1/vpc_access_service/rest/operations.rb b/owl-bot-staging/google-cloud-vpc_access-v1/lib/google/cloud/vpc_access/v1/vpc_access_service/rest/operations.rb deleted file mode 100644 index 55477e7f6600..000000000000 --- a/owl-bot-staging/google-cloud-vpc_access-v1/lib/google/cloud/vpc_access/v1/vpc_access_service/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 VpcAccess - module V1 - module VpcAccessService - module Rest - # Service that implements Longrunning Operations API. - class Operations - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "vpcaccess.$UNIVERSE_DOMAIN$" - - # @private - attr_reader :operations_stub - - ## - # Configuration for the VpcAccessService 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 VpcAccessService 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::VpcAccess::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::VpcAccess::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::VpcAccess::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::VpcAccess::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 = "vpcaccess.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}/operations", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/?$}, 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-vpc_access-v1/lib/google/cloud/vpc_access/v1/vpc_access_service/rest/service_stub.rb b/owl-bot-staging/google-cloud-vpc_access-v1/lib/google/cloud/vpc_access/v1/vpc_access_service/rest/service_stub.rb deleted file mode 100644 index e7aeac787a8c..000000000000 --- a/owl-bot-staging/google-cloud-vpc_access-v1/lib/google/cloud/vpc_access/v1/vpc_access_service/rest/service_stub.rb +++ /dev/null @@ -1,326 +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/vpcaccess/v1/vpc_access_pb" - -module Google - module Cloud - module VpcAccess - module V1 - module VpcAccessService - module Rest - ## - # REST service stub for the VpcAccessService 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_connector REST call - # - # @param request_pb [::Google::Cloud::VpcAccess::V1::CreateConnectorRequest] - # 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_connector request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_connector_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_connector", - 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_connector REST call - # - # @param request_pb [::Google::Cloud::VpcAccess::V1::GetConnectorRequest] - # 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::VpcAccess::V1::Connector] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::VpcAccess::V1::Connector] - # A result object deserialized from the server's reply - def get_connector request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_connector_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_connector", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::VpcAccess::V1::Connector.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_connectors REST call - # - # @param request_pb [::Google::Cloud::VpcAccess::V1::ListConnectorsRequest] - # 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::VpcAccess::V1::ListConnectorsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::VpcAccess::V1::ListConnectorsResponse] - # A result object deserialized from the server's reply - def list_connectors request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_connectors_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_connectors", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::VpcAccess::V1::ListConnectorsResponse.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_connector REST call - # - # @param request_pb [::Google::Cloud::VpcAccess::V1::DeleteConnectorRequest] - # 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_connector request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_delete_connector_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_connector", - 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 - - ## - # @private - # - # GRPC transcoding helper method for the create_connector REST call - # - # @param request_pb [::Google::Cloud::VpcAccess::V1::CreateConnectorRequest] - # 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_connector_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}/connectors", - body: "connector", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_connector REST call - # - # @param request_pb [::Google::Cloud::VpcAccess::V1::GetConnectorRequest] - # 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_connector_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/connectors/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_connectors REST call - # - # @param request_pb [::Google::Cloud::VpcAccess::V1::ListConnectorsRequest] - # 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_connectors_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/connectors", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_connector REST call - # - # @param request_pb [::Google::Cloud::VpcAccess::V1::DeleteConnectorRequest] - # 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_connector_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/connectors/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-vpc_access-v1/lib/google/cloud/vpcaccess/v1/vpc_access_pb.rb b/owl-bot-staging/google-cloud-vpc_access-v1/lib/google/cloud/vpcaccess/v1/vpc_access_pb.rb deleted file mode 100644 index b39bea6a1825..000000000000 --- a/owl-bot-staging/google-cloud-vpc_access-v1/lib/google/cloud/vpcaccess/v1/vpc_access_pb.rb +++ /dev/null @@ -1,36 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/vpcaccess/v1/vpc_access.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/timestamp_pb' - - -descriptor_data = "\n*google/cloud/vpcaccess/v1/vpc_access.proto\x12\x19google.cloud.vpcaccess.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\x1fgoogle/protobuf/timestamp.proto\"\xc8\x04\n\tConnector\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x0f\n\x07network\x18\x02 \x01(\t\x12\x15\n\rip_cidr_range\x18\x03 \x01(\t\x12>\n\x05state\x18\x04 \x01(\x0e\x32*.google.cloud.vpcaccess.v1.Connector.StateB\x03\xe0\x41\x03\x12\x16\n\x0emin_throughput\x18\x05 \x01(\x05\x12\x16\n\x0emax_throughput\x18\x06 \x01(\x05\x12\x1f\n\x12\x63onnected_projects\x18\x07 \x03(\tB\x03\xe0\x41\x03\x12;\n\x06subnet\x18\x08 \x01(\x0b\x32+.google.cloud.vpcaccess.v1.Connector.Subnet\x12\x14\n\x0cmachine_type\x18\n \x01(\t\x12\x15\n\rmin_instances\x18\x0b \x01(\x05\x12\x15\n\rmax_instances\x18\x0c \x01(\x05\x1a*\n\x06Subnet\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x12\n\nproject_id\x18\x02 \x01(\t\"^\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\t\n\x05READY\x10\x01\x12\x0c\n\x08\x43REATING\x10\x02\x12\x0c\n\x08\x44\x45LETING\x10\x03\x12\t\n\x05\x45RROR\x10\x04\x12\x0c\n\x08UPDATING\x10\x05:g\xea\x41\x64\n\"vpcaccess.googleapis.com/Connector\x12>projects/{project}/locations/{location}/connectors/{connector}\"\xac\x01\n\x16\x43reateConnectorRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\x12\x19\n\x0c\x63onnector_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12<\n\tconnector\x18\x03 \x01(\x0b\x32$.google.cloud.vpcaccess.v1.ConnectorB\x03\xe0\x41\x02\"O\n\x13GetConnectorRequest\x12\x38\n\x04name\x18\x01 \x01(\tB*\xe0\x41\x02\xfa\x41$\n\"vpcaccess.googleapis.com/Connector\"y\n\x15ListConnectorsRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\"k\n\x16ListConnectorsResponse\x12\x38\n\nconnectors\x18\x01 \x03(\x0b\x32$.google.cloud.vpcaccess.v1.Connector\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"R\n\x16\x44\x65leteConnectorRequest\x12\x38\n\x04name\x18\x01 \x01(\tB*\xe0\x41\x02\xfa\x41$\n\"vpcaccess.googleapis.com/Connector\"\xcd\x01\n\x11OperationMetadata\x12\x13\n\x06method\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\x12\x31\n\x08\x65nd_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12:\n\x06target\x18\x05 \x01(\tB*\xe0\x41\x03\xfa\x41$\n\"vpcaccess.googleapis.com/Connector2\xfc\x06\n\x10VpcAccessService\x12\xe8\x01\n\x0f\x43reateConnector\x12\x31.google.cloud.vpcaccess.v1.CreateConnectorRequest\x1a\x1d.google.longrunning.Operation\"\x82\x01\xca\x41\x1e\n\tConnector\x12\x11OperationMetadata\xda\x41\x1dparent,connector_id,connector\x82\xd3\xe4\x93\x02;\"./v1/{parent=projects/*/locations/*}/connectors:\tconnector\x12\xa3\x01\n\x0cGetConnector\x12..google.cloud.vpcaccess.v1.GetConnectorRequest\x1a$.google.cloud.vpcaccess.v1.Connector\"=\xda\x41\x04name\x82\xd3\xe4\x93\x02\x30\x12./v1/{name=projects/*/locations/*/connectors/*}\x12\xb6\x01\n\x0eListConnectors\x12\x30.google.cloud.vpcaccess.v1.ListConnectorsRequest\x1a\x31.google.cloud.vpcaccess.v1.ListConnectorsResponse\"?\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x30\x12./v1/{parent=projects/*/locations/*}/connectors\x12\xcf\x01\n\x0f\x44\x65leteConnector\x12\x31.google.cloud.vpcaccess.v1.DeleteConnectorRequest\x1a\x1d.google.longrunning.Operation\"j\xca\x41*\n\x15google.protobuf.Empty\x12\x11OperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02\x30*./v1/{name=projects/*/locations/*/connectors/*}\x1aL\xca\x41\x18vpcaccess.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\xc5\x01\n\x1d\x63om.google.cloud.vpcaccess.v1B\x0eVpcAccessProtoP\x01Z;cloud.google.com/go/vpcaccess/apiv1/vpcaccesspb;vpcaccesspb\xaa\x02\x19Google.Cloud.VpcAccess.V1\xca\x02\x19Google\\Cloud\\VpcAccess\\V1\xea\x02\x1cGoogle::Cloud::VpcAccess::V1b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module VpcAccess - module V1 - Connector = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vpcaccess.v1.Connector").msgclass - Connector::Subnet = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vpcaccess.v1.Connector.Subnet").msgclass - Connector::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vpcaccess.v1.Connector.State").enummodule - CreateConnectorRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vpcaccess.v1.CreateConnectorRequest").msgclass - GetConnectorRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vpcaccess.v1.GetConnectorRequest").msgclass - ListConnectorsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vpcaccess.v1.ListConnectorsRequest").msgclass - ListConnectorsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vpcaccess.v1.ListConnectorsResponse").msgclass - DeleteConnectorRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vpcaccess.v1.DeleteConnectorRequest").msgclass - OperationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.vpcaccess.v1.OperationMetadata").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-vpc_access-v1/lib/google/cloud/vpcaccess/v1/vpc_access_services_pb.rb b/owl-bot-staging/google-cloud-vpc_access-v1/lib/google/cloud/vpcaccess/v1/vpc_access_services_pb.rb deleted file mode 100644 index f53da11be9ff..000000000000 --- a/owl-bot-staging/google-cloud-vpc_access-v1/lib/google/cloud/vpcaccess/v1/vpc_access_services_pb.rb +++ /dev/null @@ -1,55 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# Source: google/cloud/vpcaccess/v1/vpc_access.proto for package 'Google.Cloud.VpcAccess.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/vpcaccess/v1/vpc_access_pb' - -module Google - module Cloud - module VpcAccess - module V1 - module VpcAccessService - # Serverless VPC Access API allows users to create and manage connectors for - # App Engine, Cloud Functions and Cloud Run to have internal connections to - # Virtual Private Cloud networks. - class Service - - include ::GRPC::GenericService - - self.marshal_class_method = :encode - self.unmarshal_class_method = :decode - self.service_name = 'google.cloud.vpcaccess.v1.VpcAccessService' - - # Creates a Serverless VPC Access connector, returns an operation. - rpc :CreateConnector, ::Google::Cloud::VpcAccess::V1::CreateConnectorRequest, ::Google::Longrunning::Operation - # Gets a Serverless VPC Access connector. Returns NOT_FOUND if the resource - # does not exist. - rpc :GetConnector, ::Google::Cloud::VpcAccess::V1::GetConnectorRequest, ::Google::Cloud::VpcAccess::V1::Connector - # Lists Serverless VPC Access connectors. - rpc :ListConnectors, ::Google::Cloud::VpcAccess::V1::ListConnectorsRequest, ::Google::Cloud::VpcAccess::V1::ListConnectorsResponse - # Deletes a Serverless VPC Access connector. Returns NOT_FOUND if the - # resource does not exist. - rpc :DeleteConnector, ::Google::Cloud::VpcAccess::V1::DeleteConnectorRequest, ::Google::Longrunning::Operation - end - - Stub = Service.rpc_stub_class - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-vpc_access-v1/proto_docs/README.md b/owl-bot-staging/google-cloud-vpc_access-v1/proto_docs/README.md deleted file mode 100644 index 9bc43f1e670f..000000000000 --- a/owl-bot-staging/google-cloud-vpc_access-v1/proto_docs/README.md +++ /dev/null @@ -1,4 +0,0 @@ -# Serverless VPC Access 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-vpc_access-v1/proto_docs/google/api/client.rb b/owl-bot-staging/google-cloud-vpc_access-v1/proto_docs/google/api/client.rb deleted file mode 100644 index 3ab0b096d445..000000000000 --- a/owl-bot-staging/google-cloud-vpc_access-v1/proto_docs/google/api/client.rb +++ /dev/null @@ -1,593 +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. - # - # Note: This field should not be used in most cases. - 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: - # library_settings: - # 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. - # @!attribute [rw] library_package - # @return [::String] - # The package name to use in Php. Clobbers the php_namespace option - # set in the protobuf. This should be used **only** by APIs - # who have already set the language_settings.php.package_name" field - # in gapic.yaml. API teams should use the protobuf php_namespace option - # where possible. - # - # Example of a YAML configuration:: - # - # publishing: - # library_settings: - # php_settings: - # library_package: Google\Cloud\PubSub\V1 - 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. - # - # Example: - # - # 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 - # @!attribute [rw] batching - # @return [::Google::Api::BatchingConfigProto] - # Batching configuration for an API method in client libraries. - # - # Example of a YAML configuration: - # - # publishing: - # method_settings: - # - selector: google.example.v1.ExampleService.BatchCreateExample - # batching: - # element_count_threshold: 1000 - # request_byte_threshold: 100000000 - # delay_threshold_millis: 10 - 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. - # - # Note: This feature should not be used in most cases. - # @!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 - - # `BatchingConfigProto` defines the batching configuration for an API method. - # @!attribute [rw] thresholds - # @return [::Google::Api::BatchingSettingsProto] - # The thresholds which trigger a batched request to be sent. - # @!attribute [rw] batch_descriptor - # @return [::Google::Api::BatchingDescriptorProto] - # The request and response fields used in batching. - class BatchingConfigProto - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # `BatchingSettingsProto` specifies a set of batching thresholds, each of - # which acts as a trigger to send a batch of messages as a request. At least - # one threshold must be positive nonzero. - # @!attribute [rw] element_count_threshold - # @return [::Integer] - # The number of elements of a field collected into a batch which, if - # exceeded, causes the batch to be sent. - # @!attribute [rw] request_byte_threshold - # @return [::Integer] - # The aggregated size of the batched field which, if exceeded, causes the - # batch to be sent. This size is computed by aggregating the sizes of the - # request field to be batched, not of the entire request message. - # @!attribute [rw] delay_threshold - # @return [::Google::Protobuf::Duration] - # The duration after which a batch should be sent, starting from the addition - # of the first message to that batch. - # @!attribute [rw] element_count_limit - # @return [::Integer] - # The maximum number of elements collected in a batch that could be accepted - # by server. - # @!attribute [rw] request_byte_limit - # @return [::Integer] - # The maximum size of the request that could be accepted by server. - # @!attribute [rw] flow_control_element_limit - # @return [::Integer] - # The maximum number of elements allowed by flow control. - # @!attribute [rw] flow_control_byte_limit - # @return [::Integer] - # The maximum size of data allowed by flow control. - # @!attribute [rw] flow_control_limit_exceeded_behavior - # @return [::Google::Api::FlowControlLimitExceededBehaviorProto] - # The behavior to take when the flow control limit is exceeded. - class BatchingSettingsProto - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # `BatchingDescriptorProto` specifies the fields of the request message to be - # used for batching, and, optionally, the fields of the response message to be - # used for demultiplexing. - # @!attribute [rw] batched_field - # @return [::String] - # The repeated field in the request message to be aggregated by batching. - # @!attribute [rw] discriminator_fields - # @return [::Array<::String>] - # A list of the fields in the request message. Two requests will be batched - # together only if the values of every field specified in - # `request_discriminator_fields` is equal between the two requests. - # @!attribute [rw] subresponse_field - # @return [::String] - # Optional. When present, indicates the field in the response message to be - # used to demultiplex the response into multiple response messages, in - # correspondence with the multiple request messages originally batched - # together. - class BatchingDescriptorProto - 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 - - # The behavior to take when the flow control limit is exceeded. - module FlowControlLimitExceededBehaviorProto - # Default behavior, system-defined. - UNSET_BEHAVIOR = 0 - - # Stop operation, raise error. - THROW_EXCEPTION = 1 - - # Pause operation until limit clears. - BLOCK = 2 - - # Continue operation, disregard limit. - IGNORE = 3 - end - end -end diff --git a/owl-bot-staging/google-cloud-vpc_access-v1/proto_docs/google/api/field_behavior.rb b/owl-bot-staging/google-cloud-vpc_access-v1/proto_docs/google/api/field_behavior.rb deleted file mode 100644 index 582be187d115..000000000000 --- a/owl-bot-staging/google-cloud-vpc_access-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-vpc_access-v1/proto_docs/google/api/launch_stage.rb b/owl-bot-staging/google-cloud-vpc_access-v1/proto_docs/google/api/launch_stage.rb deleted file mode 100644 index 9392a413fb1b..000000000000 --- a/owl-bot-staging/google-cloud-vpc_access-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-vpc_access-v1/proto_docs/google/api/resource.rb b/owl-bot-staging/google-cloud-vpc_access-v1/proto_docs/google/api/resource.rb deleted file mode 100644 index 25dec4847ac1..000000000000 --- a/owl-bot-staging/google-cloud-vpc_access-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-vpc_access-v1/proto_docs/google/cloud/vpcaccess/v1/vpc_access.rb b/owl-bot-staging/google-cloud-vpc_access-v1/proto_docs/google/cloud/vpcaccess/v1/vpc_access.rb deleted file mode 100644 index c0249c575e05..000000000000 --- a/owl-bot-staging/google-cloud-vpc_access-v1/proto_docs/google/cloud/vpcaccess/v1/vpc_access.rb +++ /dev/null @@ -1,185 +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 VpcAccess - module V1 - # Definition of a Serverless VPC Access connector. - # @!attribute [rw] name - # @return [::String] - # The resource name in the format `projects/*/locations/*/connectors/*`. - # @!attribute [rw] network - # @return [::String] - # Name of a VPC network. - # @!attribute [rw] ip_cidr_range - # @return [::String] - # The range of internal addresses that follows RFC 4632 notation. - # Example: `10.132.0.0/28`. - # @!attribute [r] state - # @return [::Google::Cloud::VpcAccess::V1::Connector::State] - # Output only. State of the VPC access connector. - # @!attribute [rw] min_throughput - # @return [::Integer] - # Minimum throughput of the connector in Mbps. Default and min is 200. - # @!attribute [rw] max_throughput - # @return [::Integer] - # Maximum throughput of the connector in Mbps. Default is 300, max is 1000. - # @!attribute [r] connected_projects - # @return [::Array<::String>] - # Output only. List of projects using the connector. - # @!attribute [rw] subnet - # @return [::Google::Cloud::VpcAccess::V1::Connector::Subnet] - # The subnet in which to house the VPC Access Connector. - # @!attribute [rw] machine_type - # @return [::String] - # Machine type of VM Instance underlying connector. Default is e2-micro - # @!attribute [rw] min_instances - # @return [::Integer] - # Minimum value of instances in autoscaling group underlying the connector. - # @!attribute [rw] max_instances - # @return [::Integer] - # Maximum value of instances in autoscaling group underlying the connector. - class Connector - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The subnet in which to house the connector - # @!attribute [rw] name - # @return [::String] - # Subnet name (relative, not fully qualified). - # E.g. if the full subnet selfLink is - # https://compute.googleapis.com/compute/v1/projects/\\{project}/regions/\\{region}/subnetworks/\\{subnetName} - # the correct input for this field would be \\{subnetName} - # @!attribute [rw] project_id - # @return [::String] - # Project in which the subnet exists. - # If not set, this project is assumed to be the project for which - # the connector create request was issued. - class Subnet - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # State of a connector. - module State - # Invalid state. - STATE_UNSPECIFIED = 0 - - # Connector is deployed and ready to receive traffic. - READY = 1 - - # An Insert operation is in progress. Transient condition. - CREATING = 2 - - # A Delete operation is in progress. Transient condition. - DELETING = 3 - - # Connector is in a bad state, manual deletion recommended. - ERROR = 4 - - # The connector is being updated. - UPDATING = 5 - end - end - - # Request for creating a Serverless VPC Access connector. - # @!attribute [rw] parent - # @return [::String] - # Required. The project and location in which the configuration should be created, - # specified in the format `projects/*/locations/*`. - # @!attribute [rw] connector_id - # @return [::String] - # Required. The ID to use for this connector. - # @!attribute [rw] connector - # @return [::Google::Cloud::VpcAccess::V1::Connector] - # Required. Resource to create. - class CreateConnectorRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request for getting a Serverless VPC Access connector. - # @!attribute [rw] name - # @return [::String] - # Required. Name of a Serverless VPC Access connector to get. - class GetConnectorRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request for listing Serverless VPC Access connectors in a location. - # @!attribute [rw] parent - # @return [::String] - # Required. The project and location from which the routes should be listed. - # @!attribute [rw] page_size - # @return [::Integer] - # Maximum number of functions to return per call. - # @!attribute [rw] page_token - # @return [::String] - # Continuation token. - class ListConnectorsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response for listing Serverless VPC Access connectors. - # @!attribute [rw] connectors - # @return [::Array<::Google::Cloud::VpcAccess::V1::Connector>] - # List of Serverless VPC Access connectors. - # @!attribute [rw] next_page_token - # @return [::String] - # Continuation token. - class ListConnectorsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request for deleting a Serverless VPC Access connector. - # @!attribute [rw] name - # @return [::String] - # Required. Name of a Serverless VPC Access connector to delete. - class DeleteConnectorRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Metadata for google.longrunning.Operation. - # @!attribute [r] method - # @return [::String] - # Output only. Method that initiated the operation e.g. - # google.cloud.vpcaccess.v1.Connectors.CreateConnector. - # @!attribute [r] create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. Time when the operation was created. - # @!attribute [r] end_time - # @return [::Google::Protobuf::Timestamp] - # Output only. Time when the operation completed. - # @!attribute [r] target - # @return [::String] - # Output only. Name of the resource that this operation is acting on e.g. - # projects/my-project/locations/us-central1/connectors/v1. - class OperationMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-vpc_access-v1/proto_docs/google/longrunning/operations.rb b/owl-bot-staging/google-cloud-vpc_access-v1/proto_docs/google/longrunning/operations.rb deleted file mode 100644 index 7a757f512165..000000000000 --- a/owl-bot-staging/google-cloud-vpc_access-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-vpc_access-v1/proto_docs/google/protobuf/any.rb b/owl-bot-staging/google-cloud-vpc_access-v1/proto_docs/google/protobuf/any.rb deleted file mode 100644 index 58691995f02e..000000000000 --- a/owl-bot-staging/google-cloud-vpc_access-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-vpc_access-v1/proto_docs/google/protobuf/duration.rb b/owl-bot-staging/google-cloud-vpc_access-v1/proto_docs/google/protobuf/duration.rb deleted file mode 100644 index ea59f1f91daf..000000000000 --- a/owl-bot-staging/google-cloud-vpc_access-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-vpc_access-v1/proto_docs/google/protobuf/empty.rb b/owl-bot-staging/google-cloud-vpc_access-v1/proto_docs/google/protobuf/empty.rb deleted file mode 100644 index 83e4481834a6..000000000000 --- a/owl-bot-staging/google-cloud-vpc_access-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-vpc_access-v1/proto_docs/google/protobuf/timestamp.rb b/owl-bot-staging/google-cloud-vpc_access-v1/proto_docs/google/protobuf/timestamp.rb deleted file mode 100644 index 74352be9c58c..000000000000 --- a/owl-bot-staging/google-cloud-vpc_access-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-vpc_access-v1/proto_docs/google/rpc/status.rb b/owl-bot-staging/google-cloud-vpc_access-v1/proto_docs/google/rpc/status.rb deleted file mode 100644 index c1a1c07eb2db..000000000000 --- a/owl-bot-staging/google-cloud-vpc_access-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-vpc_access-v1/snippets/Gemfile b/owl-bot-staging/google-cloud-vpc_access-v1/snippets/Gemfile deleted file mode 100644 index 2797ddedd3b9..000000000000 --- a/owl-bot-staging/google-cloud-vpc_access-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-vpc_access-v1", path: "../" -else - gem "google-cloud-vpc_access-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-vpc_access-v1/snippets/snippet_metadata_google.cloud.vpcaccess.v1.json b/owl-bot-staging/google-cloud-vpc_access-v1/snippets/snippet_metadata_google.cloud.vpcaccess.v1.json deleted file mode 100644 index fe9e53321b02..000000000000 --- a/owl-bot-staging/google-cloud-vpc_access-v1/snippets/snippet_metadata_google.cloud.vpcaccess.v1.json +++ /dev/null @@ -1,175 +0,0 @@ -{ - "client_library": { - "name": "google-cloud-vpc_access-v1", - "version": "", - "language": "RUBY", - "apis": [ - { - "id": "google.cloud.vpcaccess.v1", - "version": "v1" - } - ] - }, - "snippets": [ - { - "region_tag": "vpcaccess_v1_generated_VpcAccessService_CreateConnector_sync", - "title": "Snippet for the create_connector call in the VpcAccessService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VpcAccess::V1::VpcAccessService::Client#create_connector.", - "file": "vpc_access_service/create_connector.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_connector", - "full_name": "::Google::Cloud::VpcAccess::V1::VpcAccessService::Client#create_connector", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VpcAccess::V1::CreateConnectorRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "VpcAccessService::Client", - "full_name": "::Google::Cloud::VpcAccess::V1::VpcAccessService::Client" - }, - "method": { - "short_name": "CreateConnector", - "full_name": "google.cloud.vpcaccess.v1.VpcAccessService.CreateConnector", - "service": { - "short_name": "VpcAccessService", - "full_name": "google.cloud.vpcaccess.v1.VpcAccessService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "vpcaccess_v1_generated_VpcAccessService_GetConnector_sync", - "title": "Snippet for the get_connector call in the VpcAccessService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VpcAccess::V1::VpcAccessService::Client#get_connector.", - "file": "vpc_access_service/get_connector.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_connector", - "full_name": "::Google::Cloud::VpcAccess::V1::VpcAccessService::Client#get_connector", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VpcAccess::V1::GetConnectorRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::VpcAccess::V1::Connector", - "client": { - "short_name": "VpcAccessService::Client", - "full_name": "::Google::Cloud::VpcAccess::V1::VpcAccessService::Client" - }, - "method": { - "short_name": "GetConnector", - "full_name": "google.cloud.vpcaccess.v1.VpcAccessService.GetConnector", - "service": { - "short_name": "VpcAccessService", - "full_name": "google.cloud.vpcaccess.v1.VpcAccessService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "vpcaccess_v1_generated_VpcAccessService_ListConnectors_sync", - "title": "Snippet for the list_connectors call in the VpcAccessService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VpcAccess::V1::VpcAccessService::Client#list_connectors.", - "file": "vpc_access_service/list_connectors.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_connectors", - "full_name": "::Google::Cloud::VpcAccess::V1::VpcAccessService::Client#list_connectors", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VpcAccess::V1::ListConnectorsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::VpcAccess::V1::ListConnectorsResponse", - "client": { - "short_name": "VpcAccessService::Client", - "full_name": "::Google::Cloud::VpcAccess::V1::VpcAccessService::Client" - }, - "method": { - "short_name": "ListConnectors", - "full_name": "google.cloud.vpcaccess.v1.VpcAccessService.ListConnectors", - "service": { - "short_name": "VpcAccessService", - "full_name": "google.cloud.vpcaccess.v1.VpcAccessService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "vpcaccess_v1_generated_VpcAccessService_DeleteConnector_sync", - "title": "Snippet for the delete_connector call in the VpcAccessService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::VpcAccess::V1::VpcAccessService::Client#delete_connector.", - "file": "vpc_access_service/delete_connector.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_connector", - "full_name": "::Google::Cloud::VpcAccess::V1::VpcAccessService::Client#delete_connector", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::VpcAccess::V1::DeleteConnectorRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "VpcAccessService::Client", - "full_name": "::Google::Cloud::VpcAccess::V1::VpcAccessService::Client" - }, - "method": { - "short_name": "DeleteConnector", - "full_name": "google.cloud.vpcaccess.v1.VpcAccessService.DeleteConnector", - "service": { - "short_name": "VpcAccessService", - "full_name": "google.cloud.vpcaccess.v1.VpcAccessService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - } - ] -} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-vpc_access-v1/snippets/vpc_access_service/create_connector.rb b/owl-bot-staging/google-cloud-vpc_access-v1/snippets/vpc_access_service/create_connector.rb deleted file mode 100644 index 9d4b5a326409..000000000000 --- a/owl-bot-staging/google-cloud-vpc_access-v1/snippets/vpc_access_service/create_connector.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 vpcaccess_v1_generated_VpcAccessService_CreateConnector_sync] -require "google/cloud/vpc_access/v1" - -## -# Snippet for the create_connector call in the VpcAccessService 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::VpcAccess::V1::VpcAccessService::Client#create_connector. -# -def create_connector - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VpcAccess::V1::VpcAccessService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VpcAccess::V1::CreateConnectorRequest.new - - # Call the create_connector method. - result = client.create_connector 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 vpcaccess_v1_generated_VpcAccessService_CreateConnector_sync] diff --git a/owl-bot-staging/google-cloud-vpc_access-v1/snippets/vpc_access_service/delete_connector.rb b/owl-bot-staging/google-cloud-vpc_access-v1/snippets/vpc_access_service/delete_connector.rb deleted file mode 100644 index 7f7359c63908..000000000000 --- a/owl-bot-staging/google-cloud-vpc_access-v1/snippets/vpc_access_service/delete_connector.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 vpcaccess_v1_generated_VpcAccessService_DeleteConnector_sync] -require "google/cloud/vpc_access/v1" - -## -# Snippet for the delete_connector call in the VpcAccessService 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::VpcAccess::V1::VpcAccessService::Client#delete_connector. -# -def delete_connector - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VpcAccess::V1::VpcAccessService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VpcAccess::V1::DeleteConnectorRequest.new - - # Call the delete_connector method. - result = client.delete_connector 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 vpcaccess_v1_generated_VpcAccessService_DeleteConnector_sync] diff --git a/owl-bot-staging/google-cloud-vpc_access-v1/snippets/vpc_access_service/get_connector.rb b/owl-bot-staging/google-cloud-vpc_access-v1/snippets/vpc_access_service/get_connector.rb deleted file mode 100644 index 6f68789450d6..000000000000 --- a/owl-bot-staging/google-cloud-vpc_access-v1/snippets/vpc_access_service/get_connector.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 vpcaccess_v1_generated_VpcAccessService_GetConnector_sync] -require "google/cloud/vpc_access/v1" - -## -# Snippet for the get_connector call in the VpcAccessService 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::VpcAccess::V1::VpcAccessService::Client#get_connector. -# -def get_connector - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VpcAccess::V1::VpcAccessService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VpcAccess::V1::GetConnectorRequest.new - - # Call the get_connector method. - result = client.get_connector request - - # The returned object is of type Google::Cloud::VpcAccess::V1::Connector. - p result -end -# [END vpcaccess_v1_generated_VpcAccessService_GetConnector_sync] diff --git a/owl-bot-staging/google-cloud-vpc_access-v1/snippets/vpc_access_service/list_connectors.rb b/owl-bot-staging/google-cloud-vpc_access-v1/snippets/vpc_access_service/list_connectors.rb deleted file mode 100644 index 0d7049d755ab..000000000000 --- a/owl-bot-staging/google-cloud-vpc_access-v1/snippets/vpc_access_service/list_connectors.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 vpcaccess_v1_generated_VpcAccessService_ListConnectors_sync] -require "google/cloud/vpc_access/v1" - -## -# Snippet for the list_connectors call in the VpcAccessService 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::VpcAccess::V1::VpcAccessService::Client#list_connectors. -# -def list_connectors - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::VpcAccess::V1::VpcAccessService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::VpcAccess::V1::ListConnectorsRequest.new - - # Call the list_connectors method. - result = client.list_connectors 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::VpcAccess::V1::Connector. - p item - end -end -# [END vpcaccess_v1_generated_VpcAccessService_ListConnectors_sync] diff --git a/owl-bot-staging/google-cloud-vpc_access-v1/test/google/cloud/vpc_access/v1/vpc_access_service_operations_test.rb b/owl-bot-staging/google-cloud-vpc_access-v1/test/google/cloud/vpc_access/v1/vpc_access_service_operations_test.rb deleted file mode 100644 index 6f68f498f052..000000000000 --- a/owl-bot-staging/google-cloud-vpc_access-v1/test/google/cloud/vpc_access/v1/vpc_access_service_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/vpcaccess/v1/vpc_access_pb" -require "google/cloud/vpcaccess/v1/vpc_access_services_pb" -require "google/cloud/vpc_access/v1/vpc_access_service" - -class ::Google::Cloud::VpcAccess::V1::VpcAccessService::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::VpcAccess::V1::VpcAccessService::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::VpcAccess::V1::VpcAccessService::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::VpcAccess::V1::VpcAccessService::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::VpcAccess::V1::VpcAccessService::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::VpcAccess::V1::VpcAccessService::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::VpcAccess::V1::VpcAccessService::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::VpcAccess::V1::VpcAccessService::Operations::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-vpc_access-v1/test/google/cloud/vpc_access/v1/vpc_access_service_paths_test.rb b/owl-bot-staging/google-cloud-vpc_access-v1/test/google/cloud/vpc_access/v1/vpc_access_service_paths_test.rb deleted file mode 100644 index 9ba18e2eb3d5..000000000000 --- a/owl-bot-staging/google-cloud-vpc_access-v1/test/google/cloud/vpc_access/v1/vpc_access_service_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/vpc_access/v1/vpc_access_service" - -class ::Google::Cloud::VpcAccess::V1::VpcAccessService::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_connector_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::VpcAccess::V1::VpcAccessService::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.connector_path project: "value0", location: "value1", connector: "value2" - assert_equal "projects/value0/locations/value1/connectors/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::VpcAccess::V1::VpcAccessService::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-vpc_access-v1/test/google/cloud/vpc_access/v1/vpc_access_service_rest_test.rb b/owl-bot-staging/google-cloud-vpc_access-v1/test/google/cloud/vpc_access/v1/vpc_access_service_rest_test.rb deleted file mode 100644 index 6b6f716024fe..000000000000 --- a/owl-bot-staging/google-cloud-vpc_access-v1/test/google/cloud/vpc_access/v1/vpc_access_service_rest_test.rb +++ /dev/null @@ -1,319 +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/vpcaccess/v1/vpc_access_pb" -require "google/cloud/vpc_access/v1/vpc_access_service/rest" - - -class ::Google::Cloud::VpcAccess::V1::VpcAccessService::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_connector - # 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" - connector_id = "hello world" - connector = {} - - create_connector_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::VpcAccess::V1::VpcAccessService::Rest::ServiceStub.stub :transcode_create_connector_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_connector_client_stub do - # Create client - client = ::Google::Cloud::VpcAccess::V1::VpcAccessService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_connector({ parent: parent, connector_id: connector_id, connector: connector }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_connector parent: parent, connector_id: connector_id, connector: connector do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_connector ::Google::Cloud::VpcAccess::V1::CreateConnectorRequest.new(parent: parent, connector_id: connector_id, connector: connector) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_connector({ parent: parent, connector_id: connector_id, connector: connector }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_connector(::Google::Cloud::VpcAccess::V1::CreateConnectorRequest.new(parent: parent, connector_id: connector_id, connector: connector), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_connector_client_stub.call_count - end - end - end - - def test_get_connector - # Create test objects. - client_result = ::Google::Cloud::VpcAccess::V1::Connector.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_connector_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::VpcAccess::V1::VpcAccessService::Rest::ServiceStub.stub :transcode_get_connector_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_connector_client_stub do - # Create client - client = ::Google::Cloud::VpcAccess::V1::VpcAccessService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_connector({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_connector name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_connector ::Google::Cloud::VpcAccess::V1::GetConnectorRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_connector({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_connector(::Google::Cloud::VpcAccess::V1::GetConnectorRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_connector_client_stub.call_count - end - end - end - - def test_list_connectors - # Create test objects. - client_result = ::Google::Cloud::VpcAccess::V1::ListConnectorsResponse.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_connectors_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::VpcAccess::V1::VpcAccessService::Rest::ServiceStub.stub :transcode_list_connectors_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_connectors_client_stub do - # Create client - client = ::Google::Cloud::VpcAccess::V1::VpcAccessService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_connectors({ 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_connectors 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_connectors ::Google::Cloud::VpcAccess::V1::ListConnectorsRequest.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_connectors({ 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_connectors(::Google::Cloud::VpcAccess::V1::ListConnectorsRequest.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_connectors_client_stub.call_count - end - end - end - - def test_delete_connector - # 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_connector_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::VpcAccess::V1::VpcAccessService::Rest::ServiceStub.stub :transcode_delete_connector_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_connector_client_stub do - # Create client - client = ::Google::Cloud::VpcAccess::V1::VpcAccessService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.delete_connector({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.delete_connector name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.delete_connector ::Google::Cloud::VpcAccess::V1::DeleteConnectorRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.delete_connector({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.delete_connector(::Google::Cloud::VpcAccess::V1::DeleteConnectorRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, delete_connector_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::VpcAccess::V1::VpcAccessService::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::VpcAccess::V1::VpcAccessService::Rest::Client::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-vpc_access-v1/test/google/cloud/vpc_access/v1/vpc_access_service_test.rb b/owl-bot-staging/google-cloud-vpc_access-v1/test/google/cloud/vpc_access/v1/vpc_access_service_test.rb deleted file mode 100644 index 2c8083f3cb82..000000000000 --- a/owl-bot-staging/google-cloud-vpc_access-v1/test/google/cloud/vpc_access/v1/vpc_access_service_test.rb +++ /dev/null @@ -1,373 +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/vpcaccess/v1/vpc_access_pb" -require "google/cloud/vpc_access/v1/vpc_access_service" - -class ::Google::Cloud::VpcAccess::V1::VpcAccessService::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_connector - # 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" - connector_id = "hello world" - connector = {} - - create_connector_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_connector, name - assert_kind_of ::Google::Cloud::VpcAccess::V1::CreateConnectorRequest, request - assert_equal "hello world", request["parent"] - assert_equal "hello world", request["connector_id"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::VpcAccess::V1::Connector), request["connector"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_connector_client_stub do - # Create client - client = ::Google::Cloud::VpcAccess::V1::VpcAccessService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_connector({ parent: parent, connector_id: connector_id, connector: connector }) 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_connector parent: parent, connector_id: connector_id, connector: connector 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_connector ::Google::Cloud::VpcAccess::V1::CreateConnectorRequest.new(parent: parent, connector_id: connector_id, connector: connector) 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_connector({ parent: parent, connector_id: connector_id, connector: connector }, 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_connector(::Google::Cloud::VpcAccess::V1::CreateConnectorRequest.new(parent: parent, connector_id: connector_id, connector: connector), 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_connector_client_stub.call_rpc_count - end - end - - def test_get_connector - # Create GRPC objects. - grpc_response = ::Google::Cloud::VpcAccess::V1::Connector.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_connector_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_connector, name - assert_kind_of ::Google::Cloud::VpcAccess::V1::GetConnectorRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_connector_client_stub do - # Create client - client = ::Google::Cloud::VpcAccess::V1::VpcAccessService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_connector({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_connector name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_connector ::Google::Cloud::VpcAccess::V1::GetConnectorRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_connector({ 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_connector(::Google::Cloud::VpcAccess::V1::GetConnectorRequest.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_connector_client_stub.call_rpc_count - end - end - - def test_list_connectors - # Create GRPC objects. - grpc_response = ::Google::Cloud::VpcAccess::V1::ListConnectorsResponse.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_connectors_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_connectors, name - assert_kind_of ::Google::Cloud::VpcAccess::V1::ListConnectorsRequest, 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_connectors_client_stub do - # Create client - client = ::Google::Cloud::VpcAccess::V1::VpcAccessService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_connectors({ 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_connectors 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_connectors ::Google::Cloud::VpcAccess::V1::ListConnectorsRequest.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_connectors({ 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_connectors(::Google::Cloud::VpcAccess::V1::ListConnectorsRequest.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_connectors_client_stub.call_rpc_count - end - end - - def test_delete_connector - # 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_connector_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_connector, name - assert_kind_of ::Google::Cloud::VpcAccess::V1::DeleteConnectorRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_connector_client_stub do - # Create client - client = ::Google::Cloud::VpcAccess::V1::VpcAccessService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_connector({ 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_connector 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_connector ::Google::Cloud::VpcAccess::V1::DeleteConnectorRequest.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_connector({ 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_connector(::Google::Cloud::VpcAccess::V1::DeleteConnectorRequest.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_connector_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::VpcAccess::V1::VpcAccessService::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::VpcAccess::V1::VpcAccessService::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::VpcAccess::V1::VpcAccessService::Client.new do |config| - config.credentials = creds - end - assert_kind_of ::Google::Cloud::VpcAccess::V1::VpcAccessService::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::VpcAccess::V1::VpcAccessService::Client.new do |config| - config.credentials = grpc_channel - end - end - - assert_kind_of ::Google::Cloud::VpcAccess::V1::VpcAccessService::Operations, client.operations_client - end -end diff --git a/owl-bot-staging/google-cloud-vpc_access-v1/test/helper.rb b/owl-bot-staging/google-cloud-vpc_access-v1/test/helper.rb deleted file mode 100644 index 672b337030e7..000000000000 --- a/owl-bot-staging/google-cloud-vpc_access-v1/test/helper.rb +++ /dev/null @@ -1,26 +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/mock" -require "minitest/rg" - -require "grpc" - -require "ostruct" diff --git a/owl-bot-staging/google-cloud-web_risk-v1/.gitignore b/owl-bot-staging/google-cloud-web_risk-v1/.gitignore deleted file mode 100644 index 0135b6bc6cfc..000000000000 --- a/owl-bot-staging/google-cloud-web_risk-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-web_risk-v1/.repo-metadata.json b/owl-bot-staging/google-cloud-web_risk-v1/.repo-metadata.json deleted file mode 100644 index 643cdaf4e9c4..000000000000 --- a/owl-bot-staging/google-cloud-web_risk-v1/.repo-metadata.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "api_id": "webrisk.googleapis.com", - "api_shortname": "webrisk", - "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-web_risk-v1/latest", - "distribution_name": "google-cloud-web_risk-v1", - "is_cloud": true, - "language": "ruby", - "name": "webrisk", - "name_pretty": "Web Risk V1 API", - "product_documentation": "https://cloud.google.com/web-risk", - "release_level": "unreleased", - "repo": "googleapis/google-cloud-ruby", - "requires_billing": true, - "ruby-cloud-description": "Web Risk is an enterprise security product that lets your client applications check URLs against Google's constantly updated lists of unsafe web resources. Note that google-cloud-web_risk-v1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-web_risk instead. See the readme for more details.", - "ruby-cloud-env-prefix": "WEBRISK", - "ruby-cloud-product-url": "https://cloud.google.com/web-risk", - "library_type": "GAPIC_AUTO" -} diff --git a/owl-bot-staging/google-cloud-web_risk-v1/.rubocop.yml b/owl-bot-staging/google-cloud-web_risk-v1/.rubocop.yml deleted file mode 100644 index 8f9201883964..000000000000 --- a/owl-bot-staging/google-cloud-web_risk-v1/.rubocop.yml +++ /dev/null @@ -1,33 +0,0 @@ -inherit_gem: - google-style: google-style.yml - -AllCops: - Exclude: - - "google-cloud-web_risk-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-web_risk-v1.rb" diff --git a/owl-bot-staging/google-cloud-web_risk-v1/.toys.rb b/owl-bot-staging/google-cloud-web_risk-v1/.toys.rb deleted file mode 100644 index 177e22456e8a..000000000000 --- a/owl-bot-staging/google-cloud-web_risk-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-web_risk-v1/.yardopts b/owl-bot-staging/google-cloud-web_risk-v1/.yardopts deleted file mode 100644 index ec02341dae2a..000000000000 --- a/owl-bot-staging/google-cloud-web_risk-v1/.yardopts +++ /dev/null @@ -1,12 +0,0 @@ ---no-private ---title="Web Risk 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-web_risk-v1/AUTHENTICATION.md b/owl-bot-staging/google-cloud-web_risk-v1/AUTHENTICATION.md deleted file mode 100644 index 5cc149dffad2..000000000000 --- a/owl-bot-staging/google-cloud-web_risk-v1/AUTHENTICATION.md +++ /dev/null @@ -1,122 +0,0 @@ -# Authentication - -The recommended way to authenticate to the google-cloud-web_risk-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-web_risk-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/web_risk/v1" - -client = ::Google::Cloud::WebRisk::V1::WebRiskService::Client.new do |config| - config.credentials = "path/to/credentialfile.json" -end -``` - -To configure a credentials file globally for all clients: - -```ruby -require "google/cloud/web_risk/v1" - -::Google::Cloud::WebRisk::V1::WebRiskService::Client.configure do |config| - config.credentials = "path/to/credentialfile.json" -end - -client = ::Google::Cloud::WebRisk::V1::WebRiskService::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-web_risk-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/web_risk/v1" - -ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" - -client = ::Google::Cloud::WebRisk::V1::WebRiskService::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-web_risk-v1/CHANGELOG.md b/owl-bot-staging/google-cloud-web_risk-v1/CHANGELOG.md deleted file mode 100644 index f88957a62ba2..000000000000 --- a/owl-bot-staging/google-cloud-web_risk-v1/CHANGELOG.md +++ /dev/null @@ -1,2 +0,0 @@ -# Release History - diff --git a/owl-bot-staging/google-cloud-web_risk-v1/Gemfile b/owl-bot-staging/google-cloud-web_risk-v1/Gemfile deleted file mode 100644 index 1d08558908d8..000000000000 --- a/owl-bot-staging/google-cloud-web_risk-v1/Gemfile +++ /dev/null @@ -1,14 +0,0 @@ -source "https://rubygems.org" - -gemspec - -gem "google-style", "~> 1.32.0" -gem "irb", "~> 1.17" -gem "minitest", "~> 6.0.2" -gem "minitest-focus", "~> 1.4" -gem "minitest-mock", "~> 5.27" -gem "minitest-rg", "~> 5.3" -gem "ostruct", "~> 0.5.5" -gem "rake", ">= 13.0" -gem "redcarpet", "~> 3.6" -gem "yard", "~> 0.9" diff --git a/owl-bot-staging/google-cloud-web_risk-v1/LICENSE.md b/owl-bot-staging/google-cloud-web_risk-v1/LICENSE.md deleted file mode 100644 index c261857ba6ad..000000000000 --- a/owl-bot-staging/google-cloud-web_risk-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-web_risk-v1/README.md b/owl-bot-staging/google-cloud-web_risk-v1/README.md deleted file mode 100644 index b372abe1f580..000000000000 --- a/owl-bot-staging/google-cloud-web_risk-v1/README.md +++ /dev/null @@ -1,154 +0,0 @@ -# Ruby Client for the Web Risk V1 API - -API Client library for the Web Risk V1 API - -Web Risk is an enterprise security product that lets your client applications check URLs against Google's constantly updated lists of unsafe web resources. - -https://github.com/googleapis/google-cloud-ruby - -This gem is a _versioned_ client. It provides basic client classes for a -specific version of the Web Risk V1 API. Most users should consider using -the main client gem, -[google-cloud-web_risk](https://rubygems.org/gems/google-cloud-web_risk). -See the section below titled *Which client should I use?* for more information. - -## Installation - -``` -$ gem install google-cloud-web_risk-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/webrisk.googleapis.com) -1. [Set up authentication.](AUTHENTICATION.md) - -## Quick Start - -```ruby -require "google/cloud/web_risk/v1" - -client = ::Google::Cloud::WebRisk::V1::WebRiskService::Client.new -request = ::Google::Cloud::WebRisk::V1::ComputeThreatListDiffRequest.new # (request fields as keyword arguments...) -response = client.compute_threat_list_diff request -``` - -View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-web_risk-v1/latest) -for class and method documentation. - -See also the [Product Documentation](https://cloud.google.com/web-risk) -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/web_risk/v1" -require "logger" - -client = ::Google::Cloud::WebRisk::V1::WebRiskService::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-web_risk`, -and lower-level _versioned_ client libraries with names such as -`google-cloud-web_risk-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-web_risk`. -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-web_risk-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-web_risk-v1/Rakefile b/owl-bot-staging/google-cloud-web_risk-v1/Rakefile deleted file mode 100644 index 1b6fd789ed60..000000000000 --- a/owl-bot-staging/google-cloud-web_risk-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-web_risk-v1 acceptance tests." -task :acceptance, :project, :keyfile do |t, args| - project = args[:project] - project ||= - ENV["WEBRISK_TEST_PROJECT"] || - ENV["GCLOUD_TEST_PROJECT"] - keyfile = args[:keyfile] - keyfile ||= - ENV["WEBRISK_TEST_KEYFILE"] || - ENV["GCLOUD_TEST_KEYFILE"] - if keyfile - keyfile = File.read keyfile - else - keyfile ||= - ENV["WEBRISK_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 WEBRISK_TEST_PROJECT=test123 WEBRISK_TEST_KEYFILE=/path/to/keyfile.json rake acceptance" - end - require "google/cloud/web_risk/v1/web_risk_service/credentials" - ::Google::Cloud::WebRisk::V1::WebRiskService::Credentials.env_vars.each do |path| - ENV[path] = nil - end - ENV["WEBRISK_PROJECT"] = project - ENV["WEBRISK_TEST_PROJECT"] = project - ENV["WEBRISK_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-web_risk-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-web_risk-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-web_risk-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-web_risk-v1 gem does not have doctest tests." -end - -desc "Run the CI build" -task :ci do - header "BUILDING google-cloud-web_risk-v1" - header "google-cloud-web_risk-v1 rubocop", "*" - Rake::Task[:rubocop].invoke - header "google-cloud-web_risk-v1 yard", "*" - Rake::Task[:yard].invoke - header "google-cloud-web_risk-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-web_risk-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-web_risk-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-web_risk-v1/gapic_metadata.json b/owl-bot-staging/google-cloud-web_risk-v1/gapic_metadata.json deleted file mode 100644 index 2a721b8d290c..000000000000 --- a/owl-bot-staging/google-cloud-web_risk-v1/gapic_metadata.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", - "language": "ruby", - "protoPackage": "google.cloud.webrisk.v1", - "libraryPackage": "::Google::Cloud::WebRisk::V1", - "services": { - "WebRiskService": { - "clients": { - "grpc": { - "libraryClient": "::Google::Cloud::WebRisk::V1::WebRiskService::Client", - "rpcs": { - "ComputeThreatListDiff": { - "methods": [ - "compute_threat_list_diff" - ] - }, - "SearchUris": { - "methods": [ - "search_uris" - ] - }, - "SearchHashes": { - "methods": [ - "search_hashes" - ] - }, - "CreateSubmission": { - "methods": [ - "create_submission" - ] - }, - "SubmitUri": { - "methods": [ - "submit_uri" - ] - } - } - } - } - } - } -} diff --git a/owl-bot-staging/google-cloud-web_risk-v1/google-cloud-web_risk-v1.gemspec b/owl-bot-staging/google-cloud-web_risk-v1/google-cloud-web_risk-v1.gemspec deleted file mode 100644 index 8e819e3122b0..000000000000 --- a/owl-bot-staging/google-cloud-web_risk-v1/google-cloud-web_risk-v1.gemspec +++ /dev/null @@ -1,28 +0,0 @@ -# -*- ruby -*- -# encoding: utf-8 - -require File.expand_path("lib/google/cloud/web_risk/v1/version", __dir__) - -Gem::Specification.new do |gem| - gem.name = "google-cloud-web_risk-v1" - gem.version = Google::Cloud::WebRisk::V1::VERSION - - gem.authors = ["Google LLC"] - gem.email = "googleapis-packages@google.com" - gem.description = "Web Risk is an enterprise security product that lets your client applications check URLs against Google's constantly updated lists of unsafe web resources. Note that google-cloud-web_risk-v1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-web_risk instead. See the readme for more details." - gem.summary = "API Client library for the Web Risk V1 API" - 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.2" - - gem.add_dependency "gapic-common", "~> 1.2" - gem.add_dependency "google-cloud-errors", "~> 1.0" -end diff --git a/owl-bot-staging/google-cloud-web_risk-v1/lib/google-cloud-web_risk-v1.rb b/owl-bot-staging/google-cloud-web_risk-v1/lib/google-cloud-web_risk-v1.rb deleted file mode 100644 index e475a4250097..000000000000 --- a/owl-bot-staging/google-cloud-web_risk-v1/lib/google-cloud-web_risk-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/web_risk/v1" diff --git a/owl-bot-staging/google-cloud-web_risk-v1/lib/google/cloud/web_risk/v1.rb b/owl-bot-staging/google-cloud-web_risk-v1/lib/google/cloud/web_risk/v1.rb deleted file mode 100644 index ad12e150fde4..000000000000 --- a/owl-bot-staging/google-cloud-web_risk-v1/lib/google/cloud/web_risk/v1.rb +++ /dev/null @@ -1,45 +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/web_risk/v1/web_risk_service" -require "google/cloud/web_risk/v1/version" - -module Google - module Cloud - module WebRisk - ## - # API client module. - # - # @example Load this package, including all its services, and instantiate a gRPC client - # - # require "google/cloud/web_risk/v1" - # client = ::Google::Cloud::WebRisk::V1::WebRiskService::Client.new - # - # @example Load this package, including all its services, and instantiate a REST client - # - # require "google/cloud/web_risk/v1" - # client = ::Google::Cloud::WebRisk::V1::WebRiskService::Rest::Client.new - # - module V1 - end - end - end -end - -helper_path = ::File.join __dir__, "v1", "_helpers.rb" -require "google/cloud/web_risk/v1/_helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-web_risk-v1/lib/google/cloud/web_risk/v1/rest.rb b/owl-bot-staging/google-cloud-web_risk-v1/lib/google/cloud/web_risk/v1/rest.rb deleted file mode 100644 index 5b0f7ea9f037..000000000000 --- a/owl-bot-staging/google-cloud-web_risk-v1/lib/google/cloud/web_risk/v1/rest.rb +++ /dev/null @@ -1,37 +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/web_risk/v1/web_risk_service/rest" -require "google/cloud/web_risk/v1/version" - -module Google - module Cloud - module WebRisk - ## - # To load just the REST part of this package, including all its services, and instantiate a REST client: - # - # @example - # - # require "google/cloud/web_risk/v1/rest" - # client = ::Google::Cloud::WebRisk::V1::WebRiskService::Rest::Client.new - # - module V1 - end - end - end -end diff --git a/owl-bot-staging/google-cloud-web_risk-v1/lib/google/cloud/web_risk/v1/version.rb b/owl-bot-staging/google-cloud-web_risk-v1/lib/google/cloud/web_risk/v1/version.rb deleted file mode 100644 index 0cb886f79570..000000000000 --- a/owl-bot-staging/google-cloud-web_risk-v1/lib/google/cloud/web_risk/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 WebRisk - module V1 - VERSION = "0.0.1" - end - end - end -end diff --git a/owl-bot-staging/google-cloud-web_risk-v1/lib/google/cloud/web_risk/v1/web_risk_service.rb b/owl-bot-staging/google-cloud-web_risk-v1/lib/google/cloud/web_risk/v1/web_risk_service.rb deleted file mode 100644 index 02e972cd1c09..000000000000 --- a/owl-bot-staging/google-cloud-web_risk-v1/lib/google/cloud/web_risk/v1/web_risk_service.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/common" -require "gapic/config" -require "gapic/config/method" - -require "google/cloud/web_risk/v1/version" - -require "google/cloud/web_risk/v1/web_risk_service/credentials" -require "google/cloud/web_risk/v1/web_risk_service/paths" -require "google/cloud/web_risk/v1/web_risk_service/operations" -require "google/cloud/web_risk/v1/web_risk_service/client" -require "google/cloud/web_risk/v1/web_risk_service/rest" - -module Google - module Cloud - module WebRisk - module V1 - ## - # Web Risk API defines an interface to detect malicious URLs on your - # website and in client applications. - # - # @example Load this service and instantiate a gRPC client - # - # require "google/cloud/web_risk/v1/web_risk_service" - # client = ::Google::Cloud::WebRisk::V1::WebRiskService::Client.new - # - # @example Load this service and instantiate a REST client - # - # require "google/cloud/web_risk/v1/web_risk_service/rest" - # client = ::Google::Cloud::WebRisk::V1::WebRiskService::Rest::Client.new - # - module WebRiskService - end - end - end - end -end - -helper_path = ::File.join __dir__, "web_risk_service", "helpers.rb" -require "google/cloud/web_risk/v1/web_risk_service/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-web_risk-v1/lib/google/cloud/web_risk/v1/web_risk_service/client.rb b/owl-bot-staging/google-cloud-web_risk-v1/lib/google/cloud/web_risk/v1/web_risk_service/client.rb deleted file mode 100644 index b0f4624a8848..000000000000 --- a/owl-bot-staging/google-cloud-web_risk-v1/lib/google/cloud/web_risk/v1/web_risk_service/client.rb +++ /dev/null @@ -1,916 +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/webrisk/v1/webrisk_pb" - -module Google - module Cloud - module WebRisk - module V1 - module WebRiskService - ## - # Client for the WebRiskService service. - # - # Web Risk API defines an interface to detect malicious URLs on your - # website and in client applications. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "webrisk.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :web_risk_service_stub - - ## - # Configure the WebRiskService Client class. - # - # See {::Google::Cloud::WebRisk::V1::WebRiskService::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all WebRiskService clients - # ::Google::Cloud::WebRisk::V1::WebRiskService::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", "WebRisk", "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.compute_threat_list_diff.timeout = 600.0 - default_config.rpcs.compute_threat_list_diff.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.search_uris.timeout = 600.0 - default_config.rpcs.search_uris.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.search_hashes.timeout = 600.0 - default_config.rpcs.search_hashes.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.create_submission.timeout = 600.0 - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the WebRiskService 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::WebRisk::V1::WebRiskService::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 - @web_risk_service_stub.universe_domain - end - - ## - # Create a new WebRiskService client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::WebRisk::V1::WebRiskService::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::WebRisk::V1::WebRiskService::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the WebRiskService 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/webrisk/v1/webrisk_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 - - @web_risk_service_stub = ::Gapic::ServiceStub.new( - ::Google::Cloud::WebRisk::V1::WebRiskService::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 - ) - - @web_risk_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 - end - - ## - # Get the associated client for long-running operations. - # - # @return [::Google::Cloud::WebRisk::V1::WebRiskService::Operations] - # - attr_reader :operations_client - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @web_risk_service_stub.logger - end - - # Service calls - - ## - # Gets the most recent threat list diffs. These diffs should be applied to - # a local database of hashes to keep it up-to-date. If the local database is - # empty or excessively out-of-date, a complete snapshot of the database will - # be returned. This Method only updates a single ThreatList at a time. To - # update multiple ThreatList databases, this method needs to be called once - # for each list. - # - # @overload compute_threat_list_diff(request, options = nil) - # Pass arguments to `compute_threat_list_diff` via a request object, either of type - # {::Google::Cloud::WebRisk::V1::ComputeThreatListDiffRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::WebRisk::V1::ComputeThreatListDiffRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload compute_threat_list_diff(threat_type: nil, version_token: nil, constraints: nil) - # Pass arguments to `compute_threat_list_diff` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param threat_type [::Google::Cloud::WebRisk::V1::ThreatType] - # Required. The threat list to update. Only a single ThreatType should be - # specified per request. If you want to handle multiple ThreatTypes, you must - # make one request per ThreatType. - # @param version_token [::String] - # The current version token of the client for the requested list (the - # client version that was received from the last successful diff). - # If the client does not have a version token (this is the first time calling - # ComputeThreatListDiff), this may be left empty and a full database - # snapshot will be returned. - # @param constraints [::Google::Cloud::WebRisk::V1::ComputeThreatListDiffRequest::Constraints, ::Hash] - # Required. The constraints associated with this request. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::WebRisk::V1::ComputeThreatListDiffResponse] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::WebRisk::V1::ComputeThreatListDiffResponse] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/web_risk/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::WebRisk::V1::WebRiskService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::WebRisk::V1::ComputeThreatListDiffRequest.new - # - # # Call the compute_threat_list_diff method. - # result = client.compute_threat_list_diff request - # - # # The returned object is of type Google::Cloud::WebRisk::V1::ComputeThreatListDiffResponse. - # p result - # - def compute_threat_list_diff request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::WebRisk::V1::ComputeThreatListDiffRequest - - # Converts hash 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.compute_threat_list_diff.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::WebRisk::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.compute_threat_list_diff.timeout, - metadata: metadata, - retry_policy: @config.rpcs.compute_threat_list_diff.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @web_risk_service_stub.call_rpc :compute_threat_list_diff, 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 - - ## - # This method is used to check whether a URI is on a given threatList. - # Multiple threatLists may be searched in a single query. - # The response will list all requested threatLists the URI was found to - # match. If the URI is not found on any of the requested ThreatList an - # empty response will be returned. - # - # @overload search_uris(request, options = nil) - # Pass arguments to `search_uris` via a request object, either of type - # {::Google::Cloud::WebRisk::V1::SearchUrisRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::WebRisk::V1::SearchUrisRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload search_uris(uri: nil, threat_types: nil) - # Pass arguments to `search_uris` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param uri [::String] - # Required. The URI to be checked for matches. - # @param threat_types [::Array<::Google::Cloud::WebRisk::V1::ThreatType>] - # Required. The ThreatLists to search in. Multiple ThreatLists may be - # specified. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::WebRisk::V1::SearchUrisResponse] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::WebRisk::V1::SearchUrisResponse] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/web_risk/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::WebRisk::V1::WebRiskService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::WebRisk::V1::SearchUrisRequest.new - # - # # Call the search_uris method. - # result = client.search_uris request - # - # # The returned object is of type Google::Cloud::WebRisk::V1::SearchUrisResponse. - # p result - # - def search_uris request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::WebRisk::V1::SearchUrisRequest - - # Converts hash 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.search_uris.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::WebRisk::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.search_uris.timeout, - metadata: metadata, - retry_policy: @config.rpcs.search_uris.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @web_risk_service_stub.call_rpc :search_uris, 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 - - ## - # Gets the full hashes that match the requested hash prefix. - # This is used after a hash prefix is looked up in a threatList - # and there is a match. The client side threatList only holds partial hashes - # so the client must query this method to determine if there is a full - # hash match of a threat. - # - # @overload search_hashes(request, options = nil) - # Pass arguments to `search_hashes` via a request object, either of type - # {::Google::Cloud::WebRisk::V1::SearchHashesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::WebRisk::V1::SearchHashesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload search_hashes(hash_prefix: nil, threat_types: nil) - # Pass arguments to `search_hashes` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param hash_prefix [::String] - # A hash prefix, consisting of the most significant 4-32 bytes of a SHA256 - # hash. For JSON requests, this field is base64-encoded. - # Note that if this parameter is provided by a URI, it must be encoded using - # the web safe base64 variant (RFC 4648). - # @param threat_types [::Array<::Google::Cloud::WebRisk::V1::ThreatType>] - # Required. The ThreatLists to search in. Multiple ThreatLists may be - # specified. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::WebRisk::V1::SearchHashesResponse] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::WebRisk::V1::SearchHashesResponse] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/web_risk/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::WebRisk::V1::WebRiskService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::WebRisk::V1::SearchHashesRequest.new - # - # # Call the search_hashes method. - # result = client.search_hashes request - # - # # The returned object is of type Google::Cloud::WebRisk::V1::SearchHashesResponse. - # p result - # - def search_hashes request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::WebRisk::V1::SearchHashesRequest - - # Converts hash 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.search_hashes.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::WebRisk::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.search_hashes.timeout, - metadata: metadata, - retry_policy: @config.rpcs.search_hashes.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @web_risk_service_stub.call_rpc :search_hashes, 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 Submission of a URI suspected of containing phishing content to - # be reviewed. If the result verifies the existence of malicious phishing - # content, the site will be added to the [Google's Social Engineering - # lists](https://support.google.com/webmasters/answer/6350487/) in order to - # protect users that could get exposed to this threat in the future. Only - # allowlisted projects can use this method during Early Access. Please reach - # out to Sales or your customer engineer to obtain access. - # - # @overload create_submission(request, options = nil) - # Pass arguments to `create_submission` via a request object, either of type - # {::Google::Cloud::WebRisk::V1::CreateSubmissionRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::WebRisk::V1::CreateSubmissionRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_submission(parent: nil, submission: nil) - # Pass arguments to `create_submission` via keyword arguments. Note that at - # least one keyword argument is 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 name of the project that is making the submission. This - # string is in the format "projects/\\{project_number}". - # @param submission [::Google::Cloud::WebRisk::V1::Submission, ::Hash] - # Required. The submission that contains the content of the phishing report. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::WebRisk::V1::Submission] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::WebRisk::V1::Submission] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/web_risk/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::WebRisk::V1::WebRiskService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::WebRisk::V1::CreateSubmissionRequest.new - # - # # Call the create_submission method. - # result = client.create_submission request - # - # # The returned object is of type Google::Cloud::WebRisk::V1::Submission. - # p result - # - def create_submission request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::WebRisk::V1::CreateSubmissionRequest - - # Converts hash 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_submission.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::WebRisk::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_submission.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_submission.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @web_risk_service_stub.call_rpc :create_submission, 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 - - ## - # Submits a URI suspected of containing malicious content to be reviewed. - # Returns a google.longrunning.Operation which, once the review is complete, - # is updated with its result. You can use the [Pub/Sub API] - # (https://cloud.google.com/pubsub) to receive notifications for the returned - # Operation. If the result verifies the existence of malicious content, the - # site will be added to the [Google's Social Engineering lists] - # (https://support.google.com/webmasters/answer/6350487/) in order to - # protect users that could get exposed to this threat in the future. Only - # allowlisted projects can use this method during Early Access. Please reach - # out to Sales or your customer engineer to obtain access. - # - # @overload submit_uri(request, options = nil) - # Pass arguments to `submit_uri` via a request object, either of type - # {::Google::Cloud::WebRisk::V1::SubmitUriRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::WebRisk::V1::SubmitUriRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload submit_uri(parent: nil, submission: nil, threat_info: nil, threat_discovery: nil) - # Pass arguments to `submit_uri` via keyword arguments. Note that at - # least one keyword argument is 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 name of the project that is making the submission. This - # string is in the format "projects/\\{project_number}". - # @param submission [::Google::Cloud::WebRisk::V1::Submission, ::Hash] - # Required. The submission that contains the URI to be scanned. - # @param threat_info [::Google::Cloud::WebRisk::V1::ThreatInfo, ::Hash] - # Provides additional information about the submission. - # @param threat_discovery [::Google::Cloud::WebRisk::V1::ThreatDiscovery, ::Hash] - # Provides additional information about how the submission was discovered. - # - # @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/web_risk/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::WebRisk::V1::WebRiskService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::WebRisk::V1::SubmitUriRequest.new - # - # # Call the submit_uri method. - # result = client.submit_uri 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 submit_uri request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::WebRisk::V1::SubmitUriRequest - - # Converts hash 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.submit_uri.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::WebRisk::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.submit_uri.timeout, - metadata: metadata, - retry_policy: @config.rpcs.submit_uri.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @web_risk_service_stub.call_rpc :submit_uri, 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 WebRiskService API. - # - # This class represents the configuration for WebRiskService, - # 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::WebRisk::V1::WebRiskService::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 - # # compute_threat_list_diff to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::WebRisk::V1::WebRiskService::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.compute_threat_list_diff.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::WebRisk::V1::WebRiskService::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.compute_threat_list_diff.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::WebRisk::V1::WebRiskService::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 = "webrisk.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 WebRiskService 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 `compute_threat_list_diff` - # @return [::Gapic::Config::Method] - # - attr_reader :compute_threat_list_diff - ## - # RPC-specific configuration for `search_uris` - # @return [::Gapic::Config::Method] - # - attr_reader :search_uris - ## - # RPC-specific configuration for `search_hashes` - # @return [::Gapic::Config::Method] - # - attr_reader :search_hashes - ## - # RPC-specific configuration for `create_submission` - # @return [::Gapic::Config::Method] - # - attr_reader :create_submission - ## - # RPC-specific configuration for `submit_uri` - # @return [::Gapic::Config::Method] - # - attr_reader :submit_uri - - # @private - def initialize parent_rpcs = nil - compute_threat_list_diff_config = parent_rpcs.compute_threat_list_diff if parent_rpcs.respond_to? :compute_threat_list_diff - @compute_threat_list_diff = ::Gapic::Config::Method.new compute_threat_list_diff_config - search_uris_config = parent_rpcs.search_uris if parent_rpcs.respond_to? :search_uris - @search_uris = ::Gapic::Config::Method.new search_uris_config - search_hashes_config = parent_rpcs.search_hashes if parent_rpcs.respond_to? :search_hashes - @search_hashes = ::Gapic::Config::Method.new search_hashes_config - create_submission_config = parent_rpcs.create_submission if parent_rpcs.respond_to? :create_submission - @create_submission = ::Gapic::Config::Method.new create_submission_config - submit_uri_config = parent_rpcs.submit_uri if parent_rpcs.respond_to? :submit_uri - @submit_uri = ::Gapic::Config::Method.new submit_uri_config - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-web_risk-v1/lib/google/cloud/web_risk/v1/web_risk_service/credentials.rb b/owl-bot-staging/google-cloud-web_risk-v1/lib/google/cloud/web_risk/v1/web_risk_service/credentials.rb deleted file mode 100644 index dbc56f07610b..000000000000 --- a/owl-bot-staging/google-cloud-web_risk-v1/lib/google/cloud/web_risk/v1/web_risk_service/credentials.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! - -require "googleauth" - -module Google - module Cloud - module WebRisk - module V1 - module WebRiskService - # Credentials for the WebRiskService API. - class Credentials < ::Google::Auth::Credentials - self.scope = [ - "https://www.googleapis.com/auth/cloud-platform" - ] - self.env_vars = [ - "WEBRISK_CREDENTIALS", - "WEBRISK_KEYFILE", - "GOOGLE_CLOUD_CREDENTIALS", - "GOOGLE_CLOUD_KEYFILE", - "GCLOUD_KEYFILE", - "WEBRISK_CREDENTIALS_JSON", - "WEBRISK_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-web_risk-v1/lib/google/cloud/web_risk/v1/web_risk_service/operations.rb b/owl-bot-staging/google-cloud-web_risk-v1/lib/google/cloud/web_risk/v1/web_risk_service/operations.rb deleted file mode 100644 index 0c9945f420ed..000000000000 --- a/owl-bot-staging/google-cloud-web_risk-v1/lib/google/cloud/web_risk/v1/web_risk_service/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 WebRisk - module V1 - module WebRiskService - # Service that implements Longrunning Operations API. - class Operations - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "webrisk.$UNIVERSE_DOMAIN$" - - # @private - attr_reader :operations_stub - - ## - # Configuration for the WebRiskService 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 WebRiskService 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::WebRisk::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::WebRisk::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::WebRisk::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::WebRisk::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::WebRisk::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 = "webrisk.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-web_risk-v1/lib/google/cloud/web_risk/v1/web_risk_service/paths.rb b/owl-bot-staging/google-cloud-web_risk-v1/lib/google/cloud/web_risk/v1/web_risk_service/paths.rb deleted file mode 100644 index b788c51e20cd..000000000000 --- a/owl-bot-staging/google-cloud-web_risk-v1/lib/google/cloud/web_risk/v1/web_risk_service/paths.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! - - -module Google - module Cloud - module WebRisk - module V1 - module WebRiskService - # Path helper methods for the WebRiskService API. - module Paths - ## - # 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-web_risk-v1/lib/google/cloud/web_risk/v1/web_risk_service/rest.rb b/owl-bot-staging/google-cloud-web_risk-v1/lib/google/cloud/web_risk/v1/web_risk_service/rest.rb deleted file mode 100644 index 0c1cf72ecccb..000000000000 --- a/owl-bot-staging/google-cloud-web_risk-v1/lib/google/cloud/web_risk/v1/web_risk_service/rest.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! - -require "gapic/rest" -require "gapic/config" -require "gapic/config/method" - -require "google/cloud/web_risk/v1/version" - -require "google/cloud/web_risk/v1/web_risk_service/credentials" -require "google/cloud/web_risk/v1/web_risk_service/paths" -require "google/cloud/web_risk/v1/web_risk_service/rest/operations" -require "google/cloud/web_risk/v1/web_risk_service/rest/client" - -module Google - module Cloud - module WebRisk - module V1 - ## - # Web Risk API defines an interface to detect malicious URLs on your - # website and in client applications. - # - # To load this service and instantiate a REST client: - # - # require "google/cloud/web_risk/v1/web_risk_service/rest" - # client = ::Google::Cloud::WebRisk::V1::WebRiskService::Rest::Client.new - # - module WebRiskService - # Client for the REST transport - module Rest - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "rest", "helpers.rb" -require "google/cloud/web_risk/v1/web_risk_service/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-web_risk-v1/lib/google/cloud/web_risk/v1/web_risk_service/rest/client.rb b/owl-bot-staging/google-cloud-web_risk-v1/lib/google/cloud/web_risk/v1/web_risk_service/rest/client.rb deleted file mode 100644 index ee5ae8088b9d..000000000000 --- a/owl-bot-staging/google-cloud-web_risk-v1/lib/google/cloud/web_risk/v1/web_risk_service/rest/client.rb +++ /dev/null @@ -1,862 +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/webrisk/v1/webrisk_pb" -require "google/cloud/web_risk/v1/web_risk_service/rest/service_stub" - -module Google - module Cloud - module WebRisk - module V1 - module WebRiskService - module Rest - ## - # REST client for the WebRiskService service. - # - # Web Risk API defines an interface to detect malicious URLs on your - # website and in client applications. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "webrisk.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :web_risk_service_stub - - ## - # Configure the WebRiskService Client class. - # - # See {::Google::Cloud::WebRisk::V1::WebRiskService::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all WebRiskService clients - # ::Google::Cloud::WebRisk::V1::WebRiskService::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", "WebRisk", "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.compute_threat_list_diff.timeout = 600.0 - default_config.rpcs.compute_threat_list_diff.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.search_uris.timeout = 600.0 - default_config.rpcs.search_uris.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.search_hashes.timeout = 600.0 - default_config.rpcs.search_hashes.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.create_submission.timeout = 600.0 - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the WebRiskService 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::WebRisk::V1::WebRiskService::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 - @web_risk_service_stub.universe_domain - end - - ## - # Create a new WebRiskService REST client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::WebRisk::V1::WebRiskService::Rest::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::WebRisk::V1::WebRiskService::Rest::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the WebRiskService 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::WebRisk::V1::WebRiskService::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 - - @web_risk_service_stub = ::Google::Cloud::WebRisk::V1::WebRiskService::Rest::ServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials, - logger: @config.logger - ) - - @web_risk_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 - end - - ## - # Get the associated client for long-running operations. - # - # @return [::Google::Cloud::WebRisk::V1::WebRiskService::Rest::Operations] - # - attr_reader :operations_client - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @web_risk_service_stub.logger - end - - # Service calls - - ## - # Gets the most recent threat list diffs. These diffs should be applied to - # a local database of hashes to keep it up-to-date. If the local database is - # empty or excessively out-of-date, a complete snapshot of the database will - # be returned. This Method only updates a single ThreatList at a time. To - # update multiple ThreatList databases, this method needs to be called once - # for each list. - # - # @overload compute_threat_list_diff(request, options = nil) - # Pass arguments to `compute_threat_list_diff` via a request object, either of type - # {::Google::Cloud::WebRisk::V1::ComputeThreatListDiffRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::WebRisk::V1::ComputeThreatListDiffRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload compute_threat_list_diff(threat_type: nil, version_token: nil, constraints: nil) - # Pass arguments to `compute_threat_list_diff` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param threat_type [::Google::Cloud::WebRisk::V1::ThreatType] - # Required. The threat list to update. Only a single ThreatType should be - # specified per request. If you want to handle multiple ThreatTypes, you must - # make one request per ThreatType. - # @param version_token [::String] - # The current version token of the client for the requested list (the - # client version that was received from the last successful diff). - # If the client does not have a version token (this is the first time calling - # ComputeThreatListDiff), this may be left empty and a full database - # snapshot will be returned. - # @param constraints [::Google::Cloud::WebRisk::V1::ComputeThreatListDiffRequest::Constraints, ::Hash] - # Required. The constraints associated with this request. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::WebRisk::V1::ComputeThreatListDiffResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::WebRisk::V1::ComputeThreatListDiffResponse] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/web_risk/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::WebRisk::V1::WebRiskService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::WebRisk::V1::ComputeThreatListDiffRequest.new - # - # # Call the compute_threat_list_diff method. - # result = client.compute_threat_list_diff request - # - # # The returned object is of type Google::Cloud::WebRisk::V1::ComputeThreatListDiffResponse. - # p result - # - def compute_threat_list_diff request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::WebRisk::V1::ComputeThreatListDiffRequest - - # Converts hash 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.compute_threat_list_diff.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::WebRisk::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.compute_threat_list_diff.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.compute_threat_list_diff.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @web_risk_service_stub.compute_threat_list_diff 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 - - ## - # This method is used to check whether a URI is on a given threatList. - # Multiple threatLists may be searched in a single query. - # The response will list all requested threatLists the URI was found to - # match. If the URI is not found on any of the requested ThreatList an - # empty response will be returned. - # - # @overload search_uris(request, options = nil) - # Pass arguments to `search_uris` via a request object, either of type - # {::Google::Cloud::WebRisk::V1::SearchUrisRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::WebRisk::V1::SearchUrisRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload search_uris(uri: nil, threat_types: nil) - # Pass arguments to `search_uris` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param uri [::String] - # Required. The URI to be checked for matches. - # @param threat_types [::Array<::Google::Cloud::WebRisk::V1::ThreatType>] - # Required. The ThreatLists to search in. Multiple ThreatLists may be - # specified. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::WebRisk::V1::SearchUrisResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::WebRisk::V1::SearchUrisResponse] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/web_risk/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::WebRisk::V1::WebRiskService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::WebRisk::V1::SearchUrisRequest.new - # - # # Call the search_uris method. - # result = client.search_uris request - # - # # The returned object is of type Google::Cloud::WebRisk::V1::SearchUrisResponse. - # p result - # - def search_uris request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::WebRisk::V1::SearchUrisRequest - - # Converts hash 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.search_uris.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::WebRisk::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.search_uris.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.search_uris.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @web_risk_service_stub.search_uris 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 - - ## - # Gets the full hashes that match the requested hash prefix. - # This is used after a hash prefix is looked up in a threatList - # and there is a match. The client side threatList only holds partial hashes - # so the client must query this method to determine if there is a full - # hash match of a threat. - # - # @overload search_hashes(request, options = nil) - # Pass arguments to `search_hashes` via a request object, either of type - # {::Google::Cloud::WebRisk::V1::SearchHashesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::WebRisk::V1::SearchHashesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload search_hashes(hash_prefix: nil, threat_types: nil) - # Pass arguments to `search_hashes` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param hash_prefix [::String] - # A hash prefix, consisting of the most significant 4-32 bytes of a SHA256 - # hash. For JSON requests, this field is base64-encoded. - # Note that if this parameter is provided by a URI, it must be encoded using - # the web safe base64 variant (RFC 4648). - # @param threat_types [::Array<::Google::Cloud::WebRisk::V1::ThreatType>] - # Required. The ThreatLists to search in. Multiple ThreatLists may be - # specified. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::WebRisk::V1::SearchHashesResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::WebRisk::V1::SearchHashesResponse] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/web_risk/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::WebRisk::V1::WebRiskService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::WebRisk::V1::SearchHashesRequest.new - # - # # Call the search_hashes method. - # result = client.search_hashes request - # - # # The returned object is of type Google::Cloud::WebRisk::V1::SearchHashesResponse. - # p result - # - def search_hashes request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::WebRisk::V1::SearchHashesRequest - - # Converts hash 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.search_hashes.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::WebRisk::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.search_hashes.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.search_hashes.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @web_risk_service_stub.search_hashes 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 Submission of a URI suspected of containing phishing content to - # be reviewed. If the result verifies the existence of malicious phishing - # content, the site will be added to the [Google's Social Engineering - # lists](https://support.google.com/webmasters/answer/6350487/) in order to - # protect users that could get exposed to this threat in the future. Only - # allowlisted projects can use this method during Early Access. Please reach - # out to Sales or your customer engineer to obtain access. - # - # @overload create_submission(request, options = nil) - # Pass arguments to `create_submission` via a request object, either of type - # {::Google::Cloud::WebRisk::V1::CreateSubmissionRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::WebRisk::V1::CreateSubmissionRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_submission(parent: nil, submission: nil) - # Pass arguments to `create_submission` via keyword arguments. Note that at - # least one keyword argument is 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 name of the project that is making the submission. This - # string is in the format "projects/\\{project_number}". - # @param submission [::Google::Cloud::WebRisk::V1::Submission, ::Hash] - # Required. The submission that contains the content of the phishing report. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::WebRisk::V1::Submission] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::WebRisk::V1::Submission] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/web_risk/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::WebRisk::V1::WebRiskService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::WebRisk::V1::CreateSubmissionRequest.new - # - # # Call the create_submission method. - # result = client.create_submission request - # - # # The returned object is of type Google::Cloud::WebRisk::V1::Submission. - # p result - # - def create_submission request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::WebRisk::V1::CreateSubmissionRequest - - # Converts hash 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_submission.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::WebRisk::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_submission.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_submission.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @web_risk_service_stub.create_submission 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 - - ## - # Submits a URI suspected of containing malicious content to be reviewed. - # Returns a google.longrunning.Operation which, once the review is complete, - # is updated with its result. You can use the [Pub/Sub API] - # (https://cloud.google.com/pubsub) to receive notifications for the returned - # Operation. If the result verifies the existence of malicious content, the - # site will be added to the [Google's Social Engineering lists] - # (https://support.google.com/webmasters/answer/6350487/) in order to - # protect users that could get exposed to this threat in the future. Only - # allowlisted projects can use this method during Early Access. Please reach - # out to Sales or your customer engineer to obtain access. - # - # @overload submit_uri(request, options = nil) - # Pass arguments to `submit_uri` via a request object, either of type - # {::Google::Cloud::WebRisk::V1::SubmitUriRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::WebRisk::V1::SubmitUriRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload submit_uri(parent: nil, submission: nil, threat_info: nil, threat_discovery: nil) - # Pass arguments to `submit_uri` via keyword arguments. Note that at - # least one keyword argument is 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 name of the project that is making the submission. This - # string is in the format "projects/\\{project_number}". - # @param submission [::Google::Cloud::WebRisk::V1::Submission, ::Hash] - # Required. The submission that contains the URI to be scanned. - # @param threat_info [::Google::Cloud::WebRisk::V1::ThreatInfo, ::Hash] - # Provides additional information about the submission. - # @param threat_discovery [::Google::Cloud::WebRisk::V1::ThreatDiscovery, ::Hash] - # Provides additional information about how the submission was discovered. - # @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/web_risk/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::WebRisk::V1::WebRiskService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::WebRisk::V1::SubmitUriRequest.new - # - # # Call the submit_uri method. - # result = client.submit_uri 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 submit_uri request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::WebRisk::V1::SubmitUriRequest - - # Converts hash 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.submit_uri.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::WebRisk::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.submit_uri.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.submit_uri.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @web_risk_service_stub.submit_uri 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 - - ## - # Configuration class for the WebRiskService REST API. - # - # This class represents the configuration for WebRiskService 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::WebRisk::V1::WebRiskService::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 - # # compute_threat_list_diff to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::WebRisk::V1::WebRiskService::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.compute_threat_list_diff.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::WebRisk::V1::WebRiskService::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.compute_threat_list_diff.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 = "webrisk.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 WebRiskService 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 `compute_threat_list_diff` - # @return [::Gapic::Config::Method] - # - attr_reader :compute_threat_list_diff - ## - # RPC-specific configuration for `search_uris` - # @return [::Gapic::Config::Method] - # - attr_reader :search_uris - ## - # RPC-specific configuration for `search_hashes` - # @return [::Gapic::Config::Method] - # - attr_reader :search_hashes - ## - # RPC-specific configuration for `create_submission` - # @return [::Gapic::Config::Method] - # - attr_reader :create_submission - ## - # RPC-specific configuration for `submit_uri` - # @return [::Gapic::Config::Method] - # - attr_reader :submit_uri - - # @private - def initialize parent_rpcs = nil - compute_threat_list_diff_config = parent_rpcs.compute_threat_list_diff if parent_rpcs.respond_to? :compute_threat_list_diff - @compute_threat_list_diff = ::Gapic::Config::Method.new compute_threat_list_diff_config - search_uris_config = parent_rpcs.search_uris if parent_rpcs.respond_to? :search_uris - @search_uris = ::Gapic::Config::Method.new search_uris_config - search_hashes_config = parent_rpcs.search_hashes if parent_rpcs.respond_to? :search_hashes - @search_hashes = ::Gapic::Config::Method.new search_hashes_config - create_submission_config = parent_rpcs.create_submission if parent_rpcs.respond_to? :create_submission - @create_submission = ::Gapic::Config::Method.new create_submission_config - submit_uri_config = parent_rpcs.submit_uri if parent_rpcs.respond_to? :submit_uri - @submit_uri = ::Gapic::Config::Method.new submit_uri_config - - yield self if block_given? - end - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-web_risk-v1/lib/google/cloud/web_risk/v1/web_risk_service/rest/operations.rb b/owl-bot-staging/google-cloud-web_risk-v1/lib/google/cloud/web_risk/v1/web_risk_service/rest/operations.rb deleted file mode 100644 index 1c9a2c9901a1..000000000000 --- a/owl-bot-staging/google-cloud-web_risk-v1/lib/google/cloud/web_risk/v1/web_risk_service/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 WebRisk - module V1 - module WebRiskService - module Rest - # Service that implements Longrunning Operations API. - class Operations - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "webrisk.$UNIVERSE_DOMAIN$" - - # @private - attr_reader :operations_stub - - ## - # Configuration for the WebRiskService 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 WebRiskService 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::WebRisk::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::WebRisk::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::WebRisk::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::WebRisk::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 = "webrisk.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}/operations", - matches: [ - ["name", %r{^projects/[^/]+/?$}, 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/[^/]+/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{^projects/[^/]+/operations/[^/]+/?$}, false] - ] - ) - 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{^projects/[^/]+/operations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-web_risk-v1/lib/google/cloud/web_risk/v1/web_risk_service/rest/service_stub.rb b/owl-bot-staging/google-cloud-web_risk-v1/lib/google/cloud/web_risk/v1/web_risk_service/rest/service_stub.rb deleted file mode 100644 index f1c555943374..000000000000 --- a/owl-bot-staging/google-cloud-web_risk-v1/lib/google/cloud/web_risk/v1/web_risk_service/rest/service_stub.rb +++ /dev/null @@ -1,382 +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/webrisk/v1/webrisk_pb" - -module Google - module Cloud - module WebRisk - module V1 - module WebRiskService - module Rest - ## - # REST service stub for the WebRiskService 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 compute_threat_list_diff REST call - # - # @param request_pb [::Google::Cloud::WebRisk::V1::ComputeThreatListDiffRequest] - # 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::WebRisk::V1::ComputeThreatListDiffResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::WebRisk::V1::ComputeThreatListDiffResponse] - # A result object deserialized from the server's reply - def compute_threat_list_diff request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_compute_threat_list_diff_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: "compute_threat_list_diff", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::WebRisk::V1::ComputeThreatListDiffResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the search_uris REST call - # - # @param request_pb [::Google::Cloud::WebRisk::V1::SearchUrisRequest] - # 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::WebRisk::V1::SearchUrisResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::WebRisk::V1::SearchUrisResponse] - # A result object deserialized from the server's reply - def search_uris request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_search_uris_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: "search_uris", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::WebRisk::V1::SearchUrisResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the search_hashes REST call - # - # @param request_pb [::Google::Cloud::WebRisk::V1::SearchHashesRequest] - # 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::WebRisk::V1::SearchHashesResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::WebRisk::V1::SearchHashesResponse] - # A result object deserialized from the server's reply - def search_hashes request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_search_hashes_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: "search_hashes", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::WebRisk::V1::SearchHashesResponse.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_submission REST call - # - # @param request_pb [::Google::Cloud::WebRisk::V1::CreateSubmissionRequest] - # 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::WebRisk::V1::Submission] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::WebRisk::V1::Submission] - # A result object deserialized from the server's reply - def create_submission request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_submission_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_submission", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::WebRisk::V1::Submission.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the submit_uri REST call - # - # @param request_pb [::Google::Cloud::WebRisk::V1::SubmitUriRequest] - # 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 submit_uri request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_submit_uri_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: "submit_uri", - 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 - - ## - # @private - # - # GRPC transcoding helper method for the compute_threat_list_diff REST call - # - # @param request_pb [::Google::Cloud::WebRisk::V1::ComputeThreatListDiffRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_compute_threat_list_diff_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/threatLists:computeDiff", - matches: [] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the search_uris REST call - # - # @param request_pb [::Google::Cloud::WebRisk::V1::SearchUrisRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_search_uris_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/uris:search", - matches: [] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the search_hashes REST call - # - # @param request_pb [::Google::Cloud::WebRisk::V1::SearchHashesRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_search_hashes_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/hashes:search", - matches: [] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the create_submission REST call - # - # @param request_pb [::Google::Cloud::WebRisk::V1::CreateSubmissionRequest] - # 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_submission_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}/submissions", - body: "submission", - matches: [ - ["parent", %r{^projects/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the submit_uri REST call - # - # @param request_pb [::Google::Cloud::WebRisk::V1::SubmitUriRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_submit_uri_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}/uris:submit", - body: "*", - 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-web_risk-v1/lib/google/cloud/webrisk/v1/webrisk_pb.rb b/owl-bot-staging/google-cloud-web_risk-v1/lib/google/cloud/webrisk/v1/webrisk_pb.rb deleted file mode 100644 index bcf892102ed2..000000000000 --- a/owl-bot-staging/google-cloud-web_risk-v1/lib/google/cloud/webrisk/v1/webrisk_pb.rb +++ /dev/null @@ -1,58 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/webrisk/v1/webrisk.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/timestamp_pb' - - -descriptor_data = "\n%google/cloud/webrisk/v1/webrisk.proto\x12\x17google.cloud.webrisk.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\x1fgoogle/protobuf/timestamp.proto\"\xe3\x02\n\x1c\x43omputeThreatListDiffRequest\x12=\n\x0bthreat_type\x18\x01 \x01(\x0e\x32#.google.cloud.webrisk.v1.ThreatTypeB\x03\xe0\x41\x02\x12\x15\n\rversion_token\x18\x02 \x01(\x0c\x12[\n\x0b\x63onstraints\x18\x03 \x01(\x0b\x32\x41.google.cloud.webrisk.v1.ComputeThreatListDiffRequest.ConstraintsB\x03\xe0\x41\x02\x1a\x8f\x01\n\x0b\x43onstraints\x12\x18\n\x10max_diff_entries\x18\x01 \x01(\x05\x12\x1c\n\x14max_database_entries\x18\x02 \x01(\x05\x12H\n\x16supported_compressions\x18\x03 \x03(\x0e\x32(.google.cloud.webrisk.v1.CompressionType\"\x86\x04\n\x1d\x43omputeThreatListDiffResponse\x12Z\n\rresponse_type\x18\x04 \x01(\x0e\x32\x43.google.cloud.webrisk.v1.ComputeThreatListDiffResponse.ResponseType\x12@\n\tadditions\x18\x05 \x01(\x0b\x32-.google.cloud.webrisk.v1.ThreatEntryAdditions\x12>\n\x08removals\x18\x06 \x01(\x0b\x32,.google.cloud.webrisk.v1.ThreatEntryRemovals\x12\x19\n\x11new_version_token\x18\x07 \x01(\x0c\x12Q\n\x08\x63hecksum\x18\x08 \x01(\x0b\x32?.google.cloud.webrisk.v1.ComputeThreatListDiffResponse.Checksum\x12\x39\n\x15recommended_next_diff\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x1a\x1a\n\x08\x43hecksum\x12\x0e\n\x06sha256\x18\x01 \x01(\x0c\"B\n\x0cResponseType\x12\x1d\n\x19RESPONSE_TYPE_UNSPECIFIED\x10\x00\x12\x08\n\x04\x44IFF\x10\x01\x12\t\n\x05RESET\x10\x02\"e\n\x11SearchUrisRequest\x12\x10\n\x03uri\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12>\n\x0cthreat_types\x18\x02 \x03(\x0e\x32#.google.cloud.webrisk.v1.ThreatTypeB\x03\xe0\x41\x02\"\xd4\x01\n\x12SearchUrisResponse\x12\x45\n\x06threat\x18\x01 \x01(\x0b\x32\x35.google.cloud.webrisk.v1.SearchUrisResponse.ThreatUri\x1aw\n\tThreatUri\x12\x39\n\x0cthreat_types\x18\x01 \x03(\x0e\x32#.google.cloud.webrisk.v1.ThreatType\x12/\n\x0b\x65xpire_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"j\n\x13SearchHashesRequest\x12\x13\n\x0bhash_prefix\x18\x01 \x01(\x0c\x12>\n\x0cthreat_types\x18\x02 \x03(\x0e\x32#.google.cloud.webrisk.v1.ThreatTypeB\x03\xe0\x41\x02\"\xa4\x02\n\x14SearchHashesResponse\x12I\n\x07threats\x18\x01 \x03(\x0b\x32\x38.google.cloud.webrisk.v1.SearchHashesResponse.ThreatHash\x12\x38\n\x14negative_expire_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x1a\x86\x01\n\nThreatHash\x12\x39\n\x0cthreat_types\x18\x01 \x03(\x0e\x32#.google.cloud.webrisk.v1.ThreatType\x12\x0c\n\x04hash\x18\x02 \x01(\x0c\x12/\n\x0b\x65xpire_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"\x8f\x01\n\x14ThreatEntryAdditions\x12\x36\n\nraw_hashes\x18\x01 \x03(\x0b\x32\".google.cloud.webrisk.v1.RawHashes\x12?\n\x0brice_hashes\x18\x02 \x01(\x0b\x32*.google.cloud.webrisk.v1.RiceDeltaEncoding\"\x91\x01\n\x13ThreatEntryRemovals\x12\x38\n\x0braw_indices\x18\x01 \x01(\x0b\x32#.google.cloud.webrisk.v1.RawIndices\x12@\n\x0crice_indices\x18\x02 \x01(\x0b\x32*.google.cloud.webrisk.v1.RiceDeltaEncoding\"\x1d\n\nRawIndices\x12\x0f\n\x07indices\x18\x01 \x03(\x05\"4\n\tRawHashes\x12\x13\n\x0bprefix_size\x18\x01 \x01(\x05\x12\x12\n\nraw_hashes\x18\x02 \x01(\x0c\"k\n\x11RiceDeltaEncoding\x12\x13\n\x0b\x66irst_value\x18\x01 \x01(\x03\x12\x16\n\x0erice_parameter\x18\x02 \x01(\x05\x12\x13\n\x0b\x65ntry_count\x18\x03 \x01(\x05\x12\x14\n\x0c\x65ncoded_data\x18\x04 \x01(\x0c\"^\n\nSubmission\x12\x10\n\x03uri\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12>\n\x0cthreat_types\x18\x02 \x03(\x0e\x32#.google.cloud.webrisk.v1.ThreatTypeB\x03\xe0\x41\x03\"\xa5\x06\n\nThreatInfo\x12\x41\n\nabuse_type\x18\x01 \x01(\x0e\x32-.google.cloud.webrisk.v1.ThreatInfo.AbuseType\x12I\n\x11threat_confidence\x18\x02 \x01(\x0b\x32..google.cloud.webrisk.v1.ThreatInfo.Confidence\x12U\n\x14threat_justification\x18\x03 \x01(\x0b\x32\x37.google.cloud.webrisk.v1.ThreatInfo.ThreatJustification\x1a\xcb\x01\n\nConfidence\x12\x0f\n\x05score\x18\x01 \x01(\x02H\x00\x12O\n\x05level\x18\x02 \x01(\x0e\x32>.google.cloud.webrisk.v1.ThreatInfo.Confidence.ConfidenceLevelH\x00\"R\n\x0f\x43onfidenceLevel\x12 \n\x1c\x43ONFIDENCE_LEVEL_UNSPECIFIED\x10\x00\x12\x07\n\x03LOW\x10\x01\x12\n\n\x06MEDIUM\x10\x02\x12\x08\n\x04HIGH\x10\x03\x42\x07\n\x05value\x1a\xfe\x01\n\x13ThreatJustification\x12Z\n\x06labels\x18\x01 \x03(\x0e\x32J.google.cloud.webrisk.v1.ThreatInfo.ThreatJustification.JustificationLabel\x12\x10\n\x08\x63omments\x18\x02 \x03(\t\"y\n\x12JustificationLabel\x12#\n\x1fJUSTIFICATION_LABEL_UNSPECIFIED\x10\x00\x12\x17\n\x13MANUAL_VERIFICATION\x10\x01\x12\x0f\n\x0bUSER_REPORT\x10\x02\x12\x14\n\x10\x41UTOMATED_REPORT\x10\x03\"c\n\tAbuseType\x12\x1a\n\x16\x41\x42USE_TYPE_UNSPECIFIED\x10\x00\x12\x0b\n\x07MALWARE\x10\x01\x12\x16\n\x12SOCIAL_ENGINEERING\x10\x02\x12\x15\n\x11UNWANTED_SOFTWARE\x10\x03\"\xc0\x01\n\x0fThreatDiscovery\x12\x43\n\x08platform\x18\x01 \x01(\x0e\x32\x31.google.cloud.webrisk.v1.ThreatDiscovery.Platform\x12\x14\n\x0cregion_codes\x18\x02 \x03(\t\"R\n\x08Platform\x12\x18\n\x14PLATFORM_UNSPECIFIED\x10\x00\x12\x0b\n\x07\x41NDROID\x10\x01\x12\x07\n\x03IOS\x10\x02\x12\t\n\x05MACOS\x10\x03\x12\x0b\n\x07WINDOWS\x10\x04\"\x9c\x01\n\x17\x43reateSubmissionRequest\x12\x43\n\x06parent\x18\x01 \x01(\tB3\xe0\x41\x02\xfa\x41-\n+cloudresourcemanager.googleapis.com/Project\x12<\n\nsubmission\x18\x02 \x01(\x0b\x32#.google.cloud.webrisk.v1.SubmissionB\x03\xe0\x41\x02\"\x93\x02\n\x10SubmitUriRequest\x12\x43\n\x06parent\x18\x01 \x01(\tB3\xe0\x41\x02\xfa\x41-\n+cloudresourcemanager.googleapis.com/Project\x12<\n\nsubmission\x18\x02 \x01(\x0b\x32#.google.cloud.webrisk.v1.SubmissionB\x03\xe0\x41\x02\x12\x38\n\x0bthreat_info\x18\x03 \x01(\x0b\x32#.google.cloud.webrisk.v1.ThreatInfo\x12\x42\n\x10threat_discovery\x18\x04 \x01(\x0b\x32(.google.cloud.webrisk.v1.ThreatDiscovery\"\x99\x02\n\x11SubmitUriMetadata\x12?\n\x05state\x18\x01 \x01(\x0e\x32\x30.google.cloud.webrisk.v1.SubmitUriMetadata.State\x12/\n\x0b\x63reate_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12/\n\x0bupdate_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"a\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0b\n\x07RUNNING\x10\x01\x12\r\n\tSUCCEEDED\x10\x02\x12\r\n\tCANCELLED\x10\x03\x12\n\n\x06\x46\x41ILED\x10\x04\x12\n\n\x06\x43LOSED\x10\x05*\x8f\x01\n\nThreatType\x12\x1b\n\x17THREAT_TYPE_UNSPECIFIED\x10\x00\x12\x0b\n\x07MALWARE\x10\x01\x12\x16\n\x12SOCIAL_ENGINEERING\x10\x02\x12\x15\n\x11UNWANTED_SOFTWARE\x10\x03\x12(\n$SOCIAL_ENGINEERING_EXTENDED_COVERAGE\x10\x04*F\n\x0f\x43ompressionType\x12 \n\x1c\x43OMPRESSION_TYPE_UNSPECIFIED\x10\x00\x12\x07\n\x03RAW\x10\x01\x12\x08\n\x04RICE\x10\x02\x32\xe1\x07\n\x0eWebRiskService\x12\xd3\x01\n\x15\x43omputeThreatListDiff\x12\x35.google.cloud.webrisk.v1.ComputeThreatListDiffRequest\x1a\x36.google.cloud.webrisk.v1.ComputeThreatListDiffResponse\"K\xda\x41%threat_type,version_token,constraints\x82\xd3\xe4\x93\x02\x1d\x12\x1b/v1/threatLists:computeDiff\x12\x91\x01\n\nSearchUris\x12*.google.cloud.webrisk.v1.SearchUrisRequest\x1a+.google.cloud.webrisk.v1.SearchUrisResponse\"*\xda\x41\x10uri,threat_types\x82\xd3\xe4\x93\x02\x11\x12\x0f/v1/uris:search\x12\xa1\x01\n\x0cSearchHashes\x12,.google.cloud.webrisk.v1.SearchHashesRequest\x1a-.google.cloud.webrisk.v1.SearchHashesResponse\"4\xda\x41\x18hash_prefix,threat_types\x82\xd3\xe4\x93\x02\x13\x12\x11/v1/hashes:search\x12\xb6\x01\n\x10\x43reateSubmission\x12\x30.google.cloud.webrisk.v1.CreateSubmissionRequest\x1a#.google.cloud.webrisk.v1.Submission\"K\xda\x41\x11parent,submission\x82\xd3\xe4\x93\x02\x31\"#/v1/{parent=projects/*}/submissions:\nsubmission\x12\xbb\x01\n\tSubmitUri\x12).google.cloud.webrisk.v1.SubmitUriRequest\x1a\x1d.google.longrunning.Operation\"d\xca\x41\x1f\n\nSubmission\x12\x11SubmitUriMetadata\xda\x41\x11parent,submission\x82\xd3\xe4\x93\x02(\"#/v1/{parent=projects/*}/uris:submit:\x01*\x1aJ\xca\x41\x16webrisk.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\xb6\x01\n\x15\x63om.google.webrisk.v1B\x0cWebRiskProtoP\x01Z5cloud.google.com/go/webrisk/apiv1/webriskpb;webriskpb\xa2\x02\x04GCWR\xaa\x02\x17Google.Cloud.WebRisk.V1\xca\x02\x17Google\\Cloud\\WebRisk\\V1\xea\x02\x1aGoogle::Cloud::WebRisk::V1b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module WebRisk - module V1 - ComputeThreatListDiffRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.webrisk.v1.ComputeThreatListDiffRequest").msgclass - ComputeThreatListDiffRequest::Constraints = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.webrisk.v1.ComputeThreatListDiffRequest.Constraints").msgclass - ComputeThreatListDiffResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.webrisk.v1.ComputeThreatListDiffResponse").msgclass - ComputeThreatListDiffResponse::Checksum = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.webrisk.v1.ComputeThreatListDiffResponse.Checksum").msgclass - ComputeThreatListDiffResponse::ResponseType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.webrisk.v1.ComputeThreatListDiffResponse.ResponseType").enummodule - SearchUrisRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.webrisk.v1.SearchUrisRequest").msgclass - SearchUrisResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.webrisk.v1.SearchUrisResponse").msgclass - SearchUrisResponse::ThreatUri = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.webrisk.v1.SearchUrisResponse.ThreatUri").msgclass - SearchHashesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.webrisk.v1.SearchHashesRequest").msgclass - SearchHashesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.webrisk.v1.SearchHashesResponse").msgclass - SearchHashesResponse::ThreatHash = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.webrisk.v1.SearchHashesResponse.ThreatHash").msgclass - ThreatEntryAdditions = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.webrisk.v1.ThreatEntryAdditions").msgclass - ThreatEntryRemovals = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.webrisk.v1.ThreatEntryRemovals").msgclass - RawIndices = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.webrisk.v1.RawIndices").msgclass - RawHashes = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.webrisk.v1.RawHashes").msgclass - RiceDeltaEncoding = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.webrisk.v1.RiceDeltaEncoding").msgclass - Submission = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.webrisk.v1.Submission").msgclass - ThreatInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.webrisk.v1.ThreatInfo").msgclass - ThreatInfo::Confidence = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.webrisk.v1.ThreatInfo.Confidence").msgclass - ThreatInfo::Confidence::ConfidenceLevel = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.webrisk.v1.ThreatInfo.Confidence.ConfidenceLevel").enummodule - ThreatInfo::ThreatJustification = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.webrisk.v1.ThreatInfo.ThreatJustification").msgclass - ThreatInfo::ThreatJustification::JustificationLabel = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.webrisk.v1.ThreatInfo.ThreatJustification.JustificationLabel").enummodule - ThreatInfo::AbuseType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.webrisk.v1.ThreatInfo.AbuseType").enummodule - ThreatDiscovery = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.webrisk.v1.ThreatDiscovery").msgclass - ThreatDiscovery::Platform = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.webrisk.v1.ThreatDiscovery.Platform").enummodule - CreateSubmissionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.webrisk.v1.CreateSubmissionRequest").msgclass - SubmitUriRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.webrisk.v1.SubmitUriRequest").msgclass - SubmitUriMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.webrisk.v1.SubmitUriMetadata").msgclass - SubmitUriMetadata::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.webrisk.v1.SubmitUriMetadata.State").enummodule - ThreatType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.webrisk.v1.ThreatType").enummodule - CompressionType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.webrisk.v1.CompressionType").enummodule - end - end - end -end diff --git a/owl-bot-staging/google-cloud-web_risk-v1/lib/google/cloud/webrisk/v1/webrisk_services_pb.rb b/owl-bot-staging/google-cloud-web_risk-v1/lib/google/cloud/webrisk/v1/webrisk_services_pb.rb deleted file mode 100644 index c3a55b60711c..000000000000 --- a/owl-bot-staging/google-cloud-web_risk-v1/lib/google/cloud/webrisk/v1/webrisk_services_pb.rb +++ /dev/null @@ -1,82 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# Source: google/cloud/webrisk/v1/webrisk.proto for package 'Google.Cloud.WebRisk.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/webrisk/v1/webrisk_pb' - -module Google - module Cloud - module WebRisk - module V1 - module WebRiskService - # Web Risk API defines an interface to detect malicious URLs on your - # website and in client applications. - class Service - - include ::GRPC::GenericService - - self.marshal_class_method = :encode - self.unmarshal_class_method = :decode - self.service_name = 'google.cloud.webrisk.v1.WebRiskService' - - # Gets the most recent threat list diffs. These diffs should be applied to - # a local database of hashes to keep it up-to-date. If the local database is - # empty or excessively out-of-date, a complete snapshot of the database will - # be returned. This Method only updates a single ThreatList at a time. To - # update multiple ThreatList databases, this method needs to be called once - # for each list. - rpc :ComputeThreatListDiff, ::Google::Cloud::WebRisk::V1::ComputeThreatListDiffRequest, ::Google::Cloud::WebRisk::V1::ComputeThreatListDiffResponse - # This method is used to check whether a URI is on a given threatList. - # Multiple threatLists may be searched in a single query. - # The response will list all requested threatLists the URI was found to - # match. If the URI is not found on any of the requested ThreatList an - # empty response will be returned. - rpc :SearchUris, ::Google::Cloud::WebRisk::V1::SearchUrisRequest, ::Google::Cloud::WebRisk::V1::SearchUrisResponse - # Gets the full hashes that match the requested hash prefix. - # This is used after a hash prefix is looked up in a threatList - # and there is a match. The client side threatList only holds partial hashes - # so the client must query this method to determine if there is a full - # hash match of a threat. - rpc :SearchHashes, ::Google::Cloud::WebRisk::V1::SearchHashesRequest, ::Google::Cloud::WebRisk::V1::SearchHashesResponse - # Creates a Submission of a URI suspected of containing phishing content to - # be reviewed. If the result verifies the existence of malicious phishing - # content, the site will be added to the [Google's Social Engineering - # lists](https://support.google.com/webmasters/answer/6350487/) in order to - # protect users that could get exposed to this threat in the future. Only - # allowlisted projects can use this method during Early Access. Please reach - # out to Sales or your customer engineer to obtain access. - rpc :CreateSubmission, ::Google::Cloud::WebRisk::V1::CreateSubmissionRequest, ::Google::Cloud::WebRisk::V1::Submission - # Submits a URI suspected of containing malicious content to be reviewed. - # Returns a google.longrunning.Operation which, once the review is complete, - # is updated with its result. You can use the [Pub/Sub API] - # (https://cloud.google.com/pubsub) to receive notifications for the returned - # Operation. If the result verifies the existence of malicious content, the - # site will be added to the [Google's Social Engineering lists] - # (https://support.google.com/webmasters/answer/6350487/) in order to - # protect users that could get exposed to this threat in the future. Only - # allowlisted projects can use this method during Early Access. Please reach - # out to Sales or your customer engineer to obtain access. - rpc :SubmitUri, ::Google::Cloud::WebRisk::V1::SubmitUriRequest, ::Google::Longrunning::Operation - end - - Stub = Service.rpc_stub_class - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-web_risk-v1/proto_docs/README.md b/owl-bot-staging/google-cloud-web_risk-v1/proto_docs/README.md deleted file mode 100644 index 3b26f78c15d7..000000000000 --- a/owl-bot-staging/google-cloud-web_risk-v1/proto_docs/README.md +++ /dev/null @@ -1,4 +0,0 @@ -# Web Risk 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-web_risk-v1/proto_docs/google/api/client.rb b/owl-bot-staging/google-cloud-web_risk-v1/proto_docs/google/api/client.rb deleted file mode 100644 index 3ab0b096d445..000000000000 --- a/owl-bot-staging/google-cloud-web_risk-v1/proto_docs/google/api/client.rb +++ /dev/null @@ -1,593 +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. - # - # Note: This field should not be used in most cases. - 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: - # library_settings: - # 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. - # @!attribute [rw] library_package - # @return [::String] - # The package name to use in Php. Clobbers the php_namespace option - # set in the protobuf. This should be used **only** by APIs - # who have already set the language_settings.php.package_name" field - # in gapic.yaml. API teams should use the protobuf php_namespace option - # where possible. - # - # Example of a YAML configuration:: - # - # publishing: - # library_settings: - # php_settings: - # library_package: Google\Cloud\PubSub\V1 - 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. - # - # Example: - # - # 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 - # @!attribute [rw] batching - # @return [::Google::Api::BatchingConfigProto] - # Batching configuration for an API method in client libraries. - # - # Example of a YAML configuration: - # - # publishing: - # method_settings: - # - selector: google.example.v1.ExampleService.BatchCreateExample - # batching: - # element_count_threshold: 1000 - # request_byte_threshold: 100000000 - # delay_threshold_millis: 10 - 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. - # - # Note: This feature should not be used in most cases. - # @!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 - - # `BatchingConfigProto` defines the batching configuration for an API method. - # @!attribute [rw] thresholds - # @return [::Google::Api::BatchingSettingsProto] - # The thresholds which trigger a batched request to be sent. - # @!attribute [rw] batch_descriptor - # @return [::Google::Api::BatchingDescriptorProto] - # The request and response fields used in batching. - class BatchingConfigProto - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # `BatchingSettingsProto` specifies a set of batching thresholds, each of - # which acts as a trigger to send a batch of messages as a request. At least - # one threshold must be positive nonzero. - # @!attribute [rw] element_count_threshold - # @return [::Integer] - # The number of elements of a field collected into a batch which, if - # exceeded, causes the batch to be sent. - # @!attribute [rw] request_byte_threshold - # @return [::Integer] - # The aggregated size of the batched field which, if exceeded, causes the - # batch to be sent. This size is computed by aggregating the sizes of the - # request field to be batched, not of the entire request message. - # @!attribute [rw] delay_threshold - # @return [::Google::Protobuf::Duration] - # The duration after which a batch should be sent, starting from the addition - # of the first message to that batch. - # @!attribute [rw] element_count_limit - # @return [::Integer] - # The maximum number of elements collected in a batch that could be accepted - # by server. - # @!attribute [rw] request_byte_limit - # @return [::Integer] - # The maximum size of the request that could be accepted by server. - # @!attribute [rw] flow_control_element_limit - # @return [::Integer] - # The maximum number of elements allowed by flow control. - # @!attribute [rw] flow_control_byte_limit - # @return [::Integer] - # The maximum size of data allowed by flow control. - # @!attribute [rw] flow_control_limit_exceeded_behavior - # @return [::Google::Api::FlowControlLimitExceededBehaviorProto] - # The behavior to take when the flow control limit is exceeded. - class BatchingSettingsProto - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # `BatchingDescriptorProto` specifies the fields of the request message to be - # used for batching, and, optionally, the fields of the response message to be - # used for demultiplexing. - # @!attribute [rw] batched_field - # @return [::String] - # The repeated field in the request message to be aggregated by batching. - # @!attribute [rw] discriminator_fields - # @return [::Array<::String>] - # A list of the fields in the request message. Two requests will be batched - # together only if the values of every field specified in - # `request_discriminator_fields` is equal between the two requests. - # @!attribute [rw] subresponse_field - # @return [::String] - # Optional. When present, indicates the field in the response message to be - # used to demultiplex the response into multiple response messages, in - # correspondence with the multiple request messages originally batched - # together. - class BatchingDescriptorProto - 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 - - # The behavior to take when the flow control limit is exceeded. - module FlowControlLimitExceededBehaviorProto - # Default behavior, system-defined. - UNSET_BEHAVIOR = 0 - - # Stop operation, raise error. - THROW_EXCEPTION = 1 - - # Pause operation until limit clears. - BLOCK = 2 - - # Continue operation, disregard limit. - IGNORE = 3 - end - end -end diff --git a/owl-bot-staging/google-cloud-web_risk-v1/proto_docs/google/api/field_behavior.rb b/owl-bot-staging/google-cloud-web_risk-v1/proto_docs/google/api/field_behavior.rb deleted file mode 100644 index 582be187d115..000000000000 --- a/owl-bot-staging/google-cloud-web_risk-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-web_risk-v1/proto_docs/google/api/launch_stage.rb b/owl-bot-staging/google-cloud-web_risk-v1/proto_docs/google/api/launch_stage.rb deleted file mode 100644 index 9392a413fb1b..000000000000 --- a/owl-bot-staging/google-cloud-web_risk-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-web_risk-v1/proto_docs/google/api/resource.rb b/owl-bot-staging/google-cloud-web_risk-v1/proto_docs/google/api/resource.rb deleted file mode 100644 index 25dec4847ac1..000000000000 --- a/owl-bot-staging/google-cloud-web_risk-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-web_risk-v1/proto_docs/google/cloud/webrisk/v1/webrisk.rb b/owl-bot-staging/google-cloud-web_risk-v1/proto_docs/google/cloud/webrisk/v1/webrisk.rb deleted file mode 100644 index bf4b11141acb..000000000000 --- a/owl-bot-staging/google-cloud-web_risk-v1/proto_docs/google/cloud/webrisk/v1/webrisk.rb +++ /dev/null @@ -1,528 +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 WebRisk - module V1 - # Describes an API diff request. - # @!attribute [rw] threat_type - # @return [::Google::Cloud::WebRisk::V1::ThreatType] - # Required. The threat list to update. Only a single ThreatType should be - # specified per request. If you want to handle multiple ThreatTypes, you must - # make one request per ThreatType. - # @!attribute [rw] version_token - # @return [::String] - # The current version token of the client for the requested list (the - # client version that was received from the last successful diff). - # If the client does not have a version token (this is the first time calling - # ComputeThreatListDiff), this may be left empty and a full database - # snapshot will be returned. - # @!attribute [rw] constraints - # @return [::Google::Cloud::WebRisk::V1::ComputeThreatListDiffRequest::Constraints] - # Required. The constraints associated with this request. - class ComputeThreatListDiffRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The constraints for this diff. - # @!attribute [rw] max_diff_entries - # @return [::Integer] - # The maximum size in number of entries. The diff will not contain more - # entries than this value. This should be a power of 2 between 2**10 and - # 2**20. If zero, no diff size limit is set. - # @!attribute [rw] max_database_entries - # @return [::Integer] - # Sets the maximum number of entries that the client is willing to have - # in the local database. This should be a power of 2 between 2**10 and - # 2**20. If zero, no database size limit is set. - # @!attribute [rw] supported_compressions - # @return [::Array<::Google::Cloud::WebRisk::V1::CompressionType>] - # The compression types supported by the client. - class Constraints - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # @!attribute [rw] response_type - # @return [::Google::Cloud::WebRisk::V1::ComputeThreatListDiffResponse::ResponseType] - # The type of response. This may indicate that an action must be taken by the - # client when the response is received. - # @!attribute [rw] additions - # @return [::Google::Cloud::WebRisk::V1::ThreatEntryAdditions] - # A set of entries to add to a local threat type's list. - # @!attribute [rw] removals - # @return [::Google::Cloud::WebRisk::V1::ThreatEntryRemovals] - # A set of entries to remove from a local threat type's list. - # This field may be empty. - # @!attribute [rw] new_version_token - # @return [::String] - # The new opaque client version token. This should be retained by the client - # and passed into the next call of ComputeThreatListDiff as 'version_token'. - # A separate version token should be stored and used for each threatList. - # @!attribute [rw] checksum - # @return [::Google::Cloud::WebRisk::V1::ComputeThreatListDiffResponse::Checksum] - # The expected SHA256 hash of the client state; that is, of the sorted list - # of all hashes present in the database after applying the provided diff. - # If the client state doesn't match the expected state, the client must - # discard this diff and retry later. - # @!attribute [rw] recommended_next_diff - # @return [::Google::Protobuf::Timestamp] - # The soonest the client should wait before issuing any diff - # request. Querying sooner is unlikely to produce a meaningful diff. - # Waiting longer is acceptable considering the use case. - # If this field is not set clients may update as soon as they want. - class ComputeThreatListDiffResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The expected state of a client's local database. - # @!attribute [rw] sha256 - # @return [::String] - # The SHA256 hash of the client state; that is, of the sorted list of all - # hashes present in the database. - class Checksum - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The type of response sent to the client. - module ResponseType - # Unknown. - RESPONSE_TYPE_UNSPECIFIED = 0 - - # Partial updates are applied to the client's existing local database. - DIFF = 1 - - # Full updates resets the client's entire local database. This means - # that either the client had no state, was seriously out-of-date, - # or the client is believed to be corrupt. - RESET = 2 - end - end - - # Request to check URI entries against threatLists. - # @!attribute [rw] uri - # @return [::String] - # Required. The URI to be checked for matches. - # @!attribute [rw] threat_types - # @return [::Array<::Google::Cloud::WebRisk::V1::ThreatType>] - # Required. The ThreatLists to search in. Multiple ThreatLists may be - # specified. - class SearchUrisRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # @!attribute [rw] threat - # @return [::Google::Cloud::WebRisk::V1::SearchUrisResponse::ThreatUri] - # The threat list matches. This might be empty if the URI is on no list. - class SearchUrisResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Contains threat information on a matching uri. - # @!attribute [rw] threat_types - # @return [::Array<::Google::Cloud::WebRisk::V1::ThreatType>] - # The ThreatList this threat belongs to. - # @!attribute [rw] expire_time - # @return [::Google::Protobuf::Timestamp] - # The cache lifetime for the returned match. Clients must not cache this - # response past this timestamp to avoid false positives. - class ThreatUri - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Request to return full hashes matched by the provided hash prefixes. - # @!attribute [rw] hash_prefix - # @return [::String] - # A hash prefix, consisting of the most significant 4-32 bytes of a SHA256 - # hash. For JSON requests, this field is base64-encoded. - # Note that if this parameter is provided by a URI, it must be encoded using - # the web safe base64 variant (RFC 4648). - # @!attribute [rw] threat_types - # @return [::Array<::Google::Cloud::WebRisk::V1::ThreatType>] - # Required. The ThreatLists to search in. Multiple ThreatLists may be - # specified. - class SearchHashesRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # @!attribute [rw] threats - # @return [::Array<::Google::Cloud::WebRisk::V1::SearchHashesResponse::ThreatHash>] - # The full hashes that matched the requested prefixes. - # The hash will be populated in the key. - # @!attribute [rw] negative_expire_time - # @return [::Google::Protobuf::Timestamp] - # For requested entities that did not match the threat list, how long to - # cache the response until. - class SearchHashesResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Contains threat information on a matching hash. - # @!attribute [rw] threat_types - # @return [::Array<::Google::Cloud::WebRisk::V1::ThreatType>] - # The ThreatList this threat belongs to. - # This must contain at least one entry. - # @!attribute [rw] hash - # @return [::String] - # A 32 byte SHA256 hash. This field is in binary format. For JSON - # requests, hashes are base64-encoded. - # @!attribute [rw] expire_time - # @return [::Google::Protobuf::Timestamp] - # The cache lifetime for the returned match. Clients must not cache this - # response past this timestamp to avoid false positives. - class ThreatHash - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Contains the set of entries to add to a local database. - # May contain a combination of compressed and raw data in a single response. - # @!attribute [rw] raw_hashes - # @return [::Array<::Google::Cloud::WebRisk::V1::RawHashes>] - # The raw SHA256-formatted entries. - # Repeated to allow returning sets of hashes with different prefix sizes. - # @!attribute [rw] rice_hashes - # @return [::Google::Cloud::WebRisk::V1::RiceDeltaEncoding] - # The encoded 4-byte prefixes of SHA256-formatted entries, using a - # Golomb-Rice encoding. The hashes are converted to uint32, sorted in - # ascending order, then delta encoded and stored as encoded_data. - class ThreatEntryAdditions - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Contains the set of entries to remove from a local database. - # @!attribute [rw] raw_indices - # @return [::Google::Cloud::WebRisk::V1::RawIndices] - # The raw removal indices for a local list. - # @!attribute [rw] rice_indices - # @return [::Google::Cloud::WebRisk::V1::RiceDeltaEncoding] - # The encoded local, lexicographically-sorted list indices, using a - # Golomb-Rice encoding. Used for sending compressed removal indices. The - # removal indices (uint32) are sorted in ascending order, then delta encoded - # and stored as encoded_data. - class ThreatEntryRemovals - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A set of raw indices to remove from a local list. - # @!attribute [rw] indices - # @return [::Array<::Integer>] - # The indices to remove from a lexicographically-sorted local list. - class RawIndices - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The uncompressed threat entries in hash format. - # Hashes can be anywhere from 4 to 32 bytes in size. A large majority are 4 - # bytes, but some hashes are lengthened if they collide with the hash of a - # popular URI. - # - # Used for sending ThreatEntryAdditons to clients that do not support - # compression, or when sending non-4-byte hashes to clients that do support - # compression. - # @!attribute [rw] prefix_size - # @return [::Integer] - # The number of bytes for each prefix encoded below. This field can be - # anywhere from 4 (shortest prefix) to 32 (full SHA256 hash). - # In practice this is almost always 4, except in exceptional circumstances. - # @!attribute [rw] raw_hashes - # @return [::String] - # The hashes, in binary format, concatenated into one long string. Hashes are - # sorted in lexicographic order. For JSON API users, hashes are - # base64-encoded. - class RawHashes - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The Rice-Golomb encoded data. Used for sending compressed 4-byte hashes or - # compressed removal indices. - # @!attribute [rw] first_value - # @return [::Integer] - # The offset of the first entry in the encoded data, or, if only a single - # integer was encoded, that single integer's value. If the field is empty or - # missing, assume zero. - # @!attribute [rw] rice_parameter - # @return [::Integer] - # The Golomb-Rice parameter, which is a number between 2 and 28. This field - # is missing (that is, zero) if `num_entries` is zero. - # @!attribute [rw] entry_count - # @return [::Integer] - # The number of entries that are delta encoded in the encoded data. If only a - # single integer was encoded, this will be zero and the single value will be - # stored in `first_value`. - # @!attribute [rw] encoded_data - # @return [::String] - # The encoded deltas that are encoded using the Golomb-Rice coder. - class RiceDeltaEncoding - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Wraps a URI that might be displaying malicious content. - # @!attribute [rw] uri - # @return [::String] - # Required. The URI that is being reported for malicious content to be - # analyzed. - # @!attribute [r] threat_types - # @return [::Array<::Google::Cloud::WebRisk::V1::ThreatType>] - # Output only. ThreatTypes found to be associated with the submitted URI - # after reviewing it. This might be empty if the URI was not added to any - # list. - class Submission - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Context about the submission including the type of abuse found on the URI and - # supporting details. - # @!attribute [rw] abuse_type - # @return [::Google::Cloud::WebRisk::V1::ThreatInfo::AbuseType] - # The type of abuse. - # @!attribute [rw] threat_confidence - # @return [::Google::Cloud::WebRisk::V1::ThreatInfo::Confidence] - # Confidence that the URI is unsafe. - # @!attribute [rw] threat_justification - # @return [::Google::Cloud::WebRisk::V1::ThreatInfo::ThreatJustification] - # Context about why the URI is unsafe. - class ThreatInfo - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Confidence that a URI is unsafe. - # @!attribute [rw] score - # @return [::Float] - # A decimal representation of confidence in the range of 0 - # to 1 where 0 indicates no confidence and 1 indicates - # complete confidence. - # - # Note: The following fields are mutually exclusive: `score`, `level`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] level - # @return [::Google::Cloud::WebRisk::V1::ThreatInfo::Confidence::ConfidenceLevel] - # Enum representation of confidence. - # - # Note: The following fields are mutually exclusive: `level`, `score`. If a field in that set is populated, all other fields in the set will automatically be cleared. - class Confidence - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Enum representation of confidence. - module ConfidenceLevel - # Default. - CONFIDENCE_LEVEL_UNSPECIFIED = 0 - - # Less than 60% confidence that the URI is unsafe. - LOW = 1 - - # Between 60% and 80% confidence that the URI is unsafe. - MEDIUM = 2 - - # Greater than 80% confidence that the URI is unsafe. - HIGH = 3 - end - end - - # Context about why the URI is unsafe. - # @!attribute [rw] labels - # @return [::Array<::Google::Cloud::WebRisk::V1::ThreatInfo::ThreatJustification::JustificationLabel>] - # Labels associated with this URI that explain how it was classified. - # @!attribute [rw] comments - # @return [::Array<::String>] - # Free-form context on why this URI is unsafe. - class ThreatJustification - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Labels that explain how the URI was classified. - module JustificationLabel - # Default. - JUSTIFICATION_LABEL_UNSPECIFIED = 0 - - # The submitter manually verified that the submission is unsafe. - MANUAL_VERIFICATION = 1 - - # The submitter received the submission from an end user. - USER_REPORT = 2 - - # The submitter received the submission from an automated system. - AUTOMATED_REPORT = 3 - end - end - - # The abuse type found on the URI. - module AbuseType - # Default. - ABUSE_TYPE_UNSPECIFIED = 0 - - # The URI contains malware. - MALWARE = 1 - - # The URI contains social engineering. - SOCIAL_ENGINEERING = 2 - - # The URI contains unwanted software. - UNWANTED_SOFTWARE = 3 - end - end - - # Details about how the threat was discovered. - # @!attribute [rw] platform - # @return [::Google::Cloud::WebRisk::V1::ThreatDiscovery::Platform] - # Platform on which the threat was discovered. - # @!attribute [rw] region_codes - # @return [::Array<::String>] - # CLDR region code of the countries/regions the URI poses a threat ordered - # from most impact to least impact. Example: "US" for United States. - class ThreatDiscovery - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Platform types. - module Platform - # Default. - PLATFORM_UNSPECIFIED = 0 - - # General Android platform. - ANDROID = 1 - - # General iOS platform. - IOS = 2 - - # General macOS platform. - MACOS = 3 - - # General Windows platform. - WINDOWS = 4 - end - end - - # Request to send a potentially phishy URI to WebRisk. - # @!attribute [rw] parent - # @return [::String] - # Required. The name of the project that is making the submission. This - # string is in the format "projects/\\{project_number}". - # @!attribute [rw] submission - # @return [::Google::Cloud::WebRisk::V1::Submission] - # Required. The submission that contains the content of the phishing report. - class CreateSubmissionRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request to send a potentially malicious URI to WebRisk. - # @!attribute [rw] parent - # @return [::String] - # Required. The name of the project that is making the submission. This - # string is in the format "projects/\\{project_number}". - # @!attribute [rw] submission - # @return [::Google::Cloud::WebRisk::V1::Submission] - # Required. The submission that contains the URI to be scanned. - # @!attribute [rw] threat_info - # @return [::Google::Cloud::WebRisk::V1::ThreatInfo] - # Provides additional information about the submission. - # @!attribute [rw] threat_discovery - # @return [::Google::Cloud::WebRisk::V1::ThreatDiscovery] - # Provides additional information about how the submission was discovered. - class SubmitUriRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Metadata for the Submit URI long-running operation. - # @!attribute [rw] state - # @return [::Google::Cloud::WebRisk::V1::SubmitUriMetadata::State] - # The state of the operation. - # @!attribute [rw] create_time - # @return [::Google::Protobuf::Timestamp] - # Creation time of the operation. - # @!attribute [rw] update_time - # @return [::Google::Protobuf::Timestamp] - # Latest update time of the operation. - class SubmitUriMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Enum that represents the state of the long-running operation. - module State - # Default unspecified state. - STATE_UNSPECIFIED = 0 - - # The operation is currently running. - RUNNING = 1 - - # The operation finished with a success status. - SUCCEEDED = 2 - - # The operation was cancelled. - CANCELLED = 3 - - # The operation finished with a failure status. - FAILED = 4 - - # The operation was closed with no action taken. - CLOSED = 5 - end - end - - # The type of threat. This maps directly to the threat list a threat may - # belong to. - module ThreatType - # No entries should match this threat type. This threat type is unused. - THREAT_TYPE_UNSPECIFIED = 0 - - # Malware targeting any platform. - MALWARE = 1 - - # Social engineering targeting any platform. - SOCIAL_ENGINEERING = 2 - - # Unwanted software targeting any platform. - UNWANTED_SOFTWARE = 3 - - # A list of extended coverage social engineering URIs targeting any - # platform. - SOCIAL_ENGINEERING_EXTENDED_COVERAGE = 4 - end - - # The ways in which threat entry sets can be compressed. - module CompressionType - # Unknown. - COMPRESSION_TYPE_UNSPECIFIED = 0 - - # Raw, uncompressed data. - RAW = 1 - - # Rice-Golomb encoded data. - RICE = 2 - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-web_risk-v1/proto_docs/google/longrunning/operations.rb b/owl-bot-staging/google-cloud-web_risk-v1/proto_docs/google/longrunning/operations.rb deleted file mode 100644 index 7a757f512165..000000000000 --- a/owl-bot-staging/google-cloud-web_risk-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-web_risk-v1/proto_docs/google/protobuf/any.rb b/owl-bot-staging/google-cloud-web_risk-v1/proto_docs/google/protobuf/any.rb deleted file mode 100644 index 58691995f02e..000000000000 --- a/owl-bot-staging/google-cloud-web_risk-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-web_risk-v1/proto_docs/google/protobuf/duration.rb b/owl-bot-staging/google-cloud-web_risk-v1/proto_docs/google/protobuf/duration.rb deleted file mode 100644 index ea59f1f91daf..000000000000 --- a/owl-bot-staging/google-cloud-web_risk-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-web_risk-v1/proto_docs/google/protobuf/empty.rb b/owl-bot-staging/google-cloud-web_risk-v1/proto_docs/google/protobuf/empty.rb deleted file mode 100644 index 83e4481834a6..000000000000 --- a/owl-bot-staging/google-cloud-web_risk-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-web_risk-v1/proto_docs/google/protobuf/timestamp.rb b/owl-bot-staging/google-cloud-web_risk-v1/proto_docs/google/protobuf/timestamp.rb deleted file mode 100644 index 74352be9c58c..000000000000 --- a/owl-bot-staging/google-cloud-web_risk-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-web_risk-v1/proto_docs/google/rpc/status.rb b/owl-bot-staging/google-cloud-web_risk-v1/proto_docs/google/rpc/status.rb deleted file mode 100644 index c1a1c07eb2db..000000000000 --- a/owl-bot-staging/google-cloud-web_risk-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-web_risk-v1/snippets/Gemfile b/owl-bot-staging/google-cloud-web_risk-v1/snippets/Gemfile deleted file mode 100644 index 6a085ad32072..000000000000 --- a/owl-bot-staging/google-cloud-web_risk-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-web_risk-v1", path: "../" -else - gem "google-cloud-web_risk-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-web_risk-v1/snippets/snippet_metadata_google.cloud.webrisk.v1.json b/owl-bot-staging/google-cloud-web_risk-v1/snippets/snippet_metadata_google.cloud.webrisk.v1.json deleted file mode 100644 index b80bf1f12e06..000000000000 --- a/owl-bot-staging/google-cloud-web_risk-v1/snippets/snippet_metadata_google.cloud.webrisk.v1.json +++ /dev/null @@ -1,215 +0,0 @@ -{ - "client_library": { - "name": "google-cloud-web_risk-v1", - "version": "", - "language": "RUBY", - "apis": [ - { - "id": "google.cloud.webrisk.v1", - "version": "v1" - } - ] - }, - "snippets": [ - { - "region_tag": "webrisk_v1_generated_WebRiskService_ComputeThreatListDiff_sync", - "title": "Snippet for the compute_threat_list_diff call in the WebRiskService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::WebRisk::V1::WebRiskService::Client#compute_threat_list_diff.", - "file": "web_risk_service/compute_threat_list_diff.rb", - "language": "RUBY", - "client_method": { - "short_name": "compute_threat_list_diff", - "full_name": "::Google::Cloud::WebRisk::V1::WebRiskService::Client#compute_threat_list_diff", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::WebRisk::V1::ComputeThreatListDiffRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::WebRisk::V1::ComputeThreatListDiffResponse", - "client": { - "short_name": "WebRiskService::Client", - "full_name": "::Google::Cloud::WebRisk::V1::WebRiskService::Client" - }, - "method": { - "short_name": "ComputeThreatListDiff", - "full_name": "google.cloud.webrisk.v1.WebRiskService.ComputeThreatListDiff", - "service": { - "short_name": "WebRiskService", - "full_name": "google.cloud.webrisk.v1.WebRiskService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "webrisk_v1_generated_WebRiskService_SearchUris_sync", - "title": "Snippet for the search_uris call in the WebRiskService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::WebRisk::V1::WebRiskService::Client#search_uris.", - "file": "web_risk_service/search_uris.rb", - "language": "RUBY", - "client_method": { - "short_name": "search_uris", - "full_name": "::Google::Cloud::WebRisk::V1::WebRiskService::Client#search_uris", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::WebRisk::V1::SearchUrisRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::WebRisk::V1::SearchUrisResponse", - "client": { - "short_name": "WebRiskService::Client", - "full_name": "::Google::Cloud::WebRisk::V1::WebRiskService::Client" - }, - "method": { - "short_name": "SearchUris", - "full_name": "google.cloud.webrisk.v1.WebRiskService.SearchUris", - "service": { - "short_name": "WebRiskService", - "full_name": "google.cloud.webrisk.v1.WebRiskService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "webrisk_v1_generated_WebRiskService_SearchHashes_sync", - "title": "Snippet for the search_hashes call in the WebRiskService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::WebRisk::V1::WebRiskService::Client#search_hashes.", - "file": "web_risk_service/search_hashes.rb", - "language": "RUBY", - "client_method": { - "short_name": "search_hashes", - "full_name": "::Google::Cloud::WebRisk::V1::WebRiskService::Client#search_hashes", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::WebRisk::V1::SearchHashesRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::WebRisk::V1::SearchHashesResponse", - "client": { - "short_name": "WebRiskService::Client", - "full_name": "::Google::Cloud::WebRisk::V1::WebRiskService::Client" - }, - "method": { - "short_name": "SearchHashes", - "full_name": "google.cloud.webrisk.v1.WebRiskService.SearchHashes", - "service": { - "short_name": "WebRiskService", - "full_name": "google.cloud.webrisk.v1.WebRiskService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "webrisk_v1_generated_WebRiskService_CreateSubmission_sync", - "title": "Snippet for the create_submission call in the WebRiskService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::WebRisk::V1::WebRiskService::Client#create_submission.", - "file": "web_risk_service/create_submission.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_submission", - "full_name": "::Google::Cloud::WebRisk::V1::WebRiskService::Client#create_submission", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::WebRisk::V1::CreateSubmissionRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::WebRisk::V1::Submission", - "client": { - "short_name": "WebRiskService::Client", - "full_name": "::Google::Cloud::WebRisk::V1::WebRiskService::Client" - }, - "method": { - "short_name": "CreateSubmission", - "full_name": "google.cloud.webrisk.v1.WebRiskService.CreateSubmission", - "service": { - "short_name": "WebRiskService", - "full_name": "google.cloud.webrisk.v1.WebRiskService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "webrisk_v1_generated_WebRiskService_SubmitUri_sync", - "title": "Snippet for the submit_uri call in the WebRiskService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::WebRisk::V1::WebRiskService::Client#submit_uri.", - "file": "web_risk_service/submit_uri.rb", - "language": "RUBY", - "client_method": { - "short_name": "submit_uri", - "full_name": "::Google::Cloud::WebRisk::V1::WebRiskService::Client#submit_uri", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::WebRisk::V1::SubmitUriRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "WebRiskService::Client", - "full_name": "::Google::Cloud::WebRisk::V1::WebRiskService::Client" - }, - "method": { - "short_name": "SubmitUri", - "full_name": "google.cloud.webrisk.v1.WebRiskService.SubmitUri", - "service": { - "short_name": "WebRiskService", - "full_name": "google.cloud.webrisk.v1.WebRiskService" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - } - ] -} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-web_risk-v1/snippets/web_risk_service/compute_threat_list_diff.rb b/owl-bot-staging/google-cloud-web_risk-v1/snippets/web_risk_service/compute_threat_list_diff.rb deleted file mode 100644 index 7f5a53f82d9a..000000000000 --- a/owl-bot-staging/google-cloud-web_risk-v1/snippets/web_risk_service/compute_threat_list_diff.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 webrisk_v1_generated_WebRiskService_ComputeThreatListDiff_sync] -require "google/cloud/web_risk/v1" - -## -# Snippet for the compute_threat_list_diff call in the WebRiskService 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::WebRisk::V1::WebRiskService::Client#compute_threat_list_diff. -# -def compute_threat_list_diff - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::WebRisk::V1::WebRiskService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::WebRisk::V1::ComputeThreatListDiffRequest.new - - # Call the compute_threat_list_diff method. - result = client.compute_threat_list_diff request - - # The returned object is of type Google::Cloud::WebRisk::V1::ComputeThreatListDiffResponse. - p result -end -# [END webrisk_v1_generated_WebRiskService_ComputeThreatListDiff_sync] diff --git a/owl-bot-staging/google-cloud-web_risk-v1/snippets/web_risk_service/create_submission.rb b/owl-bot-staging/google-cloud-web_risk-v1/snippets/web_risk_service/create_submission.rb deleted file mode 100644 index df7d3813ecdc..000000000000 --- a/owl-bot-staging/google-cloud-web_risk-v1/snippets/web_risk_service/create_submission.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 webrisk_v1_generated_WebRiskService_CreateSubmission_sync] -require "google/cloud/web_risk/v1" - -## -# Snippet for the create_submission call in the WebRiskService 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::WebRisk::V1::WebRiskService::Client#create_submission. -# -def create_submission - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::WebRisk::V1::WebRiskService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::WebRisk::V1::CreateSubmissionRequest.new - - # Call the create_submission method. - result = client.create_submission request - - # The returned object is of type Google::Cloud::WebRisk::V1::Submission. - p result -end -# [END webrisk_v1_generated_WebRiskService_CreateSubmission_sync] diff --git a/owl-bot-staging/google-cloud-web_risk-v1/snippets/web_risk_service/search_hashes.rb b/owl-bot-staging/google-cloud-web_risk-v1/snippets/web_risk_service/search_hashes.rb deleted file mode 100644 index dd666b618ada..000000000000 --- a/owl-bot-staging/google-cloud-web_risk-v1/snippets/web_risk_service/search_hashes.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 webrisk_v1_generated_WebRiskService_SearchHashes_sync] -require "google/cloud/web_risk/v1" - -## -# Snippet for the search_hashes call in the WebRiskService 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::WebRisk::V1::WebRiskService::Client#search_hashes. -# -def search_hashes - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::WebRisk::V1::WebRiskService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::WebRisk::V1::SearchHashesRequest.new - - # Call the search_hashes method. - result = client.search_hashes request - - # The returned object is of type Google::Cloud::WebRisk::V1::SearchHashesResponse. - p result -end -# [END webrisk_v1_generated_WebRiskService_SearchHashes_sync] diff --git a/owl-bot-staging/google-cloud-web_risk-v1/snippets/web_risk_service/search_uris.rb b/owl-bot-staging/google-cloud-web_risk-v1/snippets/web_risk_service/search_uris.rb deleted file mode 100644 index f9689a938b35..000000000000 --- a/owl-bot-staging/google-cloud-web_risk-v1/snippets/web_risk_service/search_uris.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 webrisk_v1_generated_WebRiskService_SearchUris_sync] -require "google/cloud/web_risk/v1" - -## -# Snippet for the search_uris call in the WebRiskService 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::WebRisk::V1::WebRiskService::Client#search_uris. -# -def search_uris - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::WebRisk::V1::WebRiskService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::WebRisk::V1::SearchUrisRequest.new - - # Call the search_uris method. - result = client.search_uris request - - # The returned object is of type Google::Cloud::WebRisk::V1::SearchUrisResponse. - p result -end -# [END webrisk_v1_generated_WebRiskService_SearchUris_sync] diff --git a/owl-bot-staging/google-cloud-web_risk-v1/snippets/web_risk_service/submit_uri.rb b/owl-bot-staging/google-cloud-web_risk-v1/snippets/web_risk_service/submit_uri.rb deleted file mode 100644 index e9576276d743..000000000000 --- a/owl-bot-staging/google-cloud-web_risk-v1/snippets/web_risk_service/submit_uri.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 webrisk_v1_generated_WebRiskService_SubmitUri_sync] -require "google/cloud/web_risk/v1" - -## -# Snippet for the submit_uri call in the WebRiskService 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::WebRisk::V1::WebRiskService::Client#submit_uri. -# -def submit_uri - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::WebRisk::V1::WebRiskService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::WebRisk::V1::SubmitUriRequest.new - - # Call the submit_uri method. - result = client.submit_uri 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 webrisk_v1_generated_WebRiskService_SubmitUri_sync] diff --git a/owl-bot-staging/google-cloud-web_risk-v1/test/google/cloud/web_risk/v1/web_risk_service_operations_test.rb b/owl-bot-staging/google-cloud-web_risk-v1/test/google/cloud/web_risk/v1/web_risk_service_operations_test.rb deleted file mode 100644 index 2dbc348b4d90..000000000000 --- a/owl-bot-staging/google-cloud-web_risk-v1/test/google/cloud/web_risk/v1/web_risk_service_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/webrisk/v1/webrisk_pb" -require "google/cloud/webrisk/v1/webrisk_services_pb" -require "google/cloud/web_risk/v1/web_risk_service" - -class ::Google::Cloud::WebRisk::V1::WebRiskService::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::WebRisk::V1::WebRiskService::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::WebRisk::V1::WebRiskService::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::WebRisk::V1::WebRiskService::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::WebRisk::V1::WebRiskService::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::WebRisk::V1::WebRiskService::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::WebRisk::V1::WebRiskService::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::WebRisk::V1::WebRiskService::Operations::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-web_risk-v1/test/google/cloud/web_risk/v1/web_risk_service_paths_test.rb b/owl-bot-staging/google-cloud-web_risk-v1/test/google/cloud/web_risk/v1/web_risk_service_paths_test.rb deleted file mode 100644 index 4611e7b7e506..000000000000 --- a/owl-bot-staging/google-cloud-web_risk-v1/test/google/cloud/web_risk/v1/web_risk_service_paths_test.rb +++ /dev/null @@ -1,55 +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/web_risk/v1/web_risk_service" - -class ::Google::Cloud::WebRisk::V1::WebRiskService::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_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::WebRisk::V1::WebRiskService::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-web_risk-v1/test/google/cloud/web_risk/v1/web_risk_service_rest_test.rb b/owl-bot-staging/google-cloud-web_risk-v1/test/google/cloud/web_risk/v1/web_risk_service_rest_test.rb deleted file mode 100644 index a4b46ebc0c22..000000000000 --- a/owl-bot-staging/google-cloud-web_risk-v1/test/google/cloud/web_risk/v1/web_risk_service_rest_test.rb +++ /dev/null @@ -1,377 +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/webrisk/v1/webrisk_pb" -require "google/cloud/web_risk/v1/web_risk_service/rest" - - -class ::Google::Cloud::WebRisk::V1::WebRiskService::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_compute_threat_list_diff - # Create test objects. - client_result = ::Google::Cloud::WebRisk::V1::ComputeThreatListDiffResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - threat_type = :THREAT_TYPE_UNSPECIFIED - version_token = "hello world" - constraints = {} - - compute_threat_list_diff_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::WebRisk::V1::WebRiskService::Rest::ServiceStub.stub :transcode_compute_threat_list_diff_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, compute_threat_list_diff_client_stub do - # Create client - client = ::Google::Cloud::WebRisk::V1::WebRiskService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.compute_threat_list_diff({ threat_type: threat_type, version_token: version_token, constraints: constraints }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.compute_threat_list_diff threat_type: threat_type, version_token: version_token, constraints: constraints do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.compute_threat_list_diff ::Google::Cloud::WebRisk::V1::ComputeThreatListDiffRequest.new(threat_type: threat_type, version_token: version_token, constraints: constraints) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.compute_threat_list_diff({ threat_type: threat_type, version_token: version_token, constraints: constraints }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.compute_threat_list_diff(::Google::Cloud::WebRisk::V1::ComputeThreatListDiffRequest.new(threat_type: threat_type, version_token: version_token, constraints: constraints), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, compute_threat_list_diff_client_stub.call_count - end - end - end - - def test_search_uris - # Create test objects. - client_result = ::Google::Cloud::WebRisk::V1::SearchUrisResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - uri = "hello world" - threat_types = [:THREAT_TYPE_UNSPECIFIED] - - search_uris_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::WebRisk::V1::WebRiskService::Rest::ServiceStub.stub :transcode_search_uris_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, search_uris_client_stub do - # Create client - client = ::Google::Cloud::WebRisk::V1::WebRiskService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.search_uris({ uri: uri, threat_types: threat_types }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.search_uris uri: uri, threat_types: threat_types do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.search_uris ::Google::Cloud::WebRisk::V1::SearchUrisRequest.new(uri: uri, threat_types: threat_types) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.search_uris({ uri: uri, threat_types: threat_types }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.search_uris(::Google::Cloud::WebRisk::V1::SearchUrisRequest.new(uri: uri, threat_types: threat_types), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, search_uris_client_stub.call_count - end - end - end - - def test_search_hashes - # Create test objects. - client_result = ::Google::Cloud::WebRisk::V1::SearchHashesResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - hash_prefix = "hello world" - threat_types = [:THREAT_TYPE_UNSPECIFIED] - - search_hashes_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::WebRisk::V1::WebRiskService::Rest::ServiceStub.stub :transcode_search_hashes_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, search_hashes_client_stub do - # Create client - client = ::Google::Cloud::WebRisk::V1::WebRiskService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.search_hashes({ hash_prefix: hash_prefix, threat_types: threat_types }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.search_hashes hash_prefix: hash_prefix, threat_types: threat_types do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.search_hashes ::Google::Cloud::WebRisk::V1::SearchHashesRequest.new(hash_prefix: hash_prefix, threat_types: threat_types) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.search_hashes({ hash_prefix: hash_prefix, threat_types: threat_types }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.search_hashes(::Google::Cloud::WebRisk::V1::SearchHashesRequest.new(hash_prefix: hash_prefix, threat_types: threat_types), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, search_hashes_client_stub.call_count - end - end - end - - def test_create_submission - # Create test objects. - client_result = ::Google::Cloud::WebRisk::V1::Submission.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - submission = {} - - create_submission_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::WebRisk::V1::WebRiskService::Rest::ServiceStub.stub :transcode_create_submission_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_submission_client_stub do - # Create client - client = ::Google::Cloud::WebRisk::V1::WebRiskService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_submission({ parent: parent, submission: submission }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_submission parent: parent, submission: submission do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_submission ::Google::Cloud::WebRisk::V1::CreateSubmissionRequest.new(parent: parent, submission: submission) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_submission({ parent: parent, submission: submission }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_submission(::Google::Cloud::WebRisk::V1::CreateSubmissionRequest.new(parent: parent, submission: submission), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_submission_client_stub.call_count - end - end - end - - def test_submit_uri - # 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" - submission = {} - threat_info = {} - threat_discovery = {} - - submit_uri_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::WebRisk::V1::WebRiskService::Rest::ServiceStub.stub :transcode_submit_uri_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, submit_uri_client_stub do - # Create client - client = ::Google::Cloud::WebRisk::V1::WebRiskService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.submit_uri({ parent: parent, submission: submission, threat_info: threat_info, threat_discovery: threat_discovery }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.submit_uri parent: parent, submission: submission, threat_info: threat_info, threat_discovery: threat_discovery do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.submit_uri ::Google::Cloud::WebRisk::V1::SubmitUriRequest.new(parent: parent, submission: submission, threat_info: threat_info, threat_discovery: threat_discovery) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.submit_uri({ parent: parent, submission: submission, threat_info: threat_info, threat_discovery: threat_discovery }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.submit_uri(::Google::Cloud::WebRisk::V1::SubmitUriRequest.new(parent: parent, submission: submission, threat_info: threat_info, threat_discovery: threat_discovery), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, submit_uri_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::WebRisk::V1::WebRiskService::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::WebRisk::V1::WebRiskService::Rest::Client::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-web_risk-v1/test/google/cloud/web_risk/v1/web_risk_service_test.rb b/owl-bot-staging/google-cloud-web_risk-v1/test/google/cloud/web_risk/v1/web_risk_service_test.rb deleted file mode 100644 index 1d3301dd6810..000000000000 --- a/owl-bot-staging/google-cloud-web_risk-v1/test/google/cloud/web_risk/v1/web_risk_service_test.rb +++ /dev/null @@ -1,429 +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/webrisk/v1/webrisk_pb" -require "google/cloud/web_risk/v1/web_risk_service" - -class ::Google::Cloud::WebRisk::V1::WebRiskService::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_compute_threat_list_diff - # Create GRPC objects. - grpc_response = ::Google::Cloud::WebRisk::V1::ComputeThreatListDiffResponse.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. - threat_type = :THREAT_TYPE_UNSPECIFIED - version_token = "hello world" - constraints = {} - - compute_threat_list_diff_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :compute_threat_list_diff, name - assert_kind_of ::Google::Cloud::WebRisk::V1::ComputeThreatListDiffRequest, request - assert_equal :THREAT_TYPE_UNSPECIFIED, request["threat_type"] - assert_equal "hello world", request["version_token"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::WebRisk::V1::ComputeThreatListDiffRequest::Constraints), request["constraints"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, compute_threat_list_diff_client_stub do - # Create client - client = ::Google::Cloud::WebRisk::V1::WebRiskService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.compute_threat_list_diff({ threat_type: threat_type, version_token: version_token, constraints: constraints }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.compute_threat_list_diff threat_type: threat_type, version_token: version_token, constraints: constraints do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.compute_threat_list_diff ::Google::Cloud::WebRisk::V1::ComputeThreatListDiffRequest.new(threat_type: threat_type, version_token: version_token, constraints: constraints) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.compute_threat_list_diff({ threat_type: threat_type, version_token: version_token, constraints: constraints }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.compute_threat_list_diff(::Google::Cloud::WebRisk::V1::ComputeThreatListDiffRequest.new(threat_type: threat_type, version_token: version_token, constraints: constraints), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, compute_threat_list_diff_client_stub.call_rpc_count - end - end - - def test_search_uris - # Create GRPC objects. - grpc_response = ::Google::Cloud::WebRisk::V1::SearchUrisResponse.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. - uri = "hello world" - threat_types = [:THREAT_TYPE_UNSPECIFIED] - - search_uris_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :search_uris, name - assert_kind_of ::Google::Cloud::WebRisk::V1::SearchUrisRequest, request - assert_equal "hello world", request["uri"] - assert_equal [:THREAT_TYPE_UNSPECIFIED], request["threat_types"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, search_uris_client_stub do - # Create client - client = ::Google::Cloud::WebRisk::V1::WebRiskService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.search_uris({ uri: uri, threat_types: threat_types }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.search_uris uri: uri, threat_types: threat_types do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.search_uris ::Google::Cloud::WebRisk::V1::SearchUrisRequest.new(uri: uri, threat_types: threat_types) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.search_uris({ uri: uri, threat_types: threat_types }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.search_uris(::Google::Cloud::WebRisk::V1::SearchUrisRequest.new(uri: uri, threat_types: threat_types), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, search_uris_client_stub.call_rpc_count - end - end - - def test_search_hashes - # Create GRPC objects. - grpc_response = ::Google::Cloud::WebRisk::V1::SearchHashesResponse.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. - hash_prefix = "hello world" - threat_types = [:THREAT_TYPE_UNSPECIFIED] - - search_hashes_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :search_hashes, name - assert_kind_of ::Google::Cloud::WebRisk::V1::SearchHashesRequest, request - assert_equal "hello world", request["hash_prefix"] - assert_equal [:THREAT_TYPE_UNSPECIFIED], request["threat_types"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, search_hashes_client_stub do - # Create client - client = ::Google::Cloud::WebRisk::V1::WebRiskService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.search_hashes({ hash_prefix: hash_prefix, threat_types: threat_types }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.search_hashes hash_prefix: hash_prefix, threat_types: threat_types do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.search_hashes ::Google::Cloud::WebRisk::V1::SearchHashesRequest.new(hash_prefix: hash_prefix, threat_types: threat_types) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.search_hashes({ hash_prefix: hash_prefix, threat_types: threat_types }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.search_hashes(::Google::Cloud::WebRisk::V1::SearchHashesRequest.new(hash_prefix: hash_prefix, threat_types: threat_types), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, search_hashes_client_stub.call_rpc_count - end - end - - def test_create_submission - # Create GRPC objects. - grpc_response = ::Google::Cloud::WebRisk::V1::Submission.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" - submission = {} - - create_submission_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_submission, name - assert_kind_of ::Google::Cloud::WebRisk::V1::CreateSubmissionRequest, request - assert_equal "hello world", request["parent"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::WebRisk::V1::Submission), request["submission"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_submission_client_stub do - # Create client - client = ::Google::Cloud::WebRisk::V1::WebRiskService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_submission({ parent: parent, submission: submission }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.create_submission parent: parent, submission: submission do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.create_submission ::Google::Cloud::WebRisk::V1::CreateSubmissionRequest.new(parent: parent, submission: submission) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.create_submission({ parent: parent, submission: submission }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.create_submission(::Google::Cloud::WebRisk::V1::CreateSubmissionRequest.new(parent: parent, submission: submission), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, create_submission_client_stub.call_rpc_count - end - end - - def test_submit_uri - # 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" - submission = {} - threat_info = {} - threat_discovery = {} - - submit_uri_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :submit_uri, name - assert_kind_of ::Google::Cloud::WebRisk::V1::SubmitUriRequest, request - assert_equal "hello world", request["parent"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::WebRisk::V1::Submission), request["submission"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::WebRisk::V1::ThreatInfo), request["threat_info"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::WebRisk::V1::ThreatDiscovery), request["threat_discovery"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, submit_uri_client_stub do - # Create client - client = ::Google::Cloud::WebRisk::V1::WebRiskService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.submit_uri({ parent: parent, submission: submission, threat_info: threat_info, threat_discovery: threat_discovery }) 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.submit_uri parent: parent, submission: submission, threat_info: threat_info, threat_discovery: threat_discovery 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.submit_uri ::Google::Cloud::WebRisk::V1::SubmitUriRequest.new(parent: parent, submission: submission, threat_info: threat_info, threat_discovery: threat_discovery) 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.submit_uri({ parent: parent, submission: submission, threat_info: threat_info, threat_discovery: threat_discovery }, 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.submit_uri(::Google::Cloud::WebRisk::V1::SubmitUriRequest.new(parent: parent, submission: submission, threat_info: threat_info, threat_discovery: threat_discovery), 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, submit_uri_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::WebRisk::V1::WebRiskService::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::WebRisk::V1::WebRiskService::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::WebRisk::V1::WebRiskService::Client.new do |config| - config.credentials = creds - end - assert_kind_of ::Google::Cloud::WebRisk::V1::WebRiskService::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::WebRisk::V1::WebRiskService::Client.new do |config| - config.credentials = grpc_channel - end - end - - assert_kind_of ::Google::Cloud::WebRisk::V1::WebRiskService::Operations, client.operations_client - end -end diff --git a/owl-bot-staging/google-cloud-web_risk-v1/test/helper.rb b/owl-bot-staging/google-cloud-web_risk-v1/test/helper.rb deleted file mode 100644 index 672b337030e7..000000000000 --- a/owl-bot-staging/google-cloud-web_risk-v1/test/helper.rb +++ /dev/null @@ -1,26 +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/mock" -require "minitest/rg" - -require "grpc" - -require "ostruct" diff --git a/owl-bot-staging/google-cloud-web_risk-v1beta1/.gitignore b/owl-bot-staging/google-cloud-web_risk-v1beta1/.gitignore deleted file mode 100644 index 0135b6bc6cfc..000000000000 --- a/owl-bot-staging/google-cloud-web_risk-v1beta1/.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-web_risk-v1beta1/.repo-metadata.json b/owl-bot-staging/google-cloud-web_risk-v1beta1/.repo-metadata.json deleted file mode 100644 index fe30af6aa1ab..000000000000 --- a/owl-bot-staging/google-cloud-web_risk-v1beta1/.repo-metadata.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "api_id": "webrisk.googleapis.com", - "api_shortname": "webrisk", - "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-web_risk-v1beta1/latest", - "distribution_name": "google-cloud-web_risk-v1beta1", - "is_cloud": true, - "language": "ruby", - "name": "webrisk", - "name_pretty": "Web Risk V1beta1 API", - "product_documentation": "https://cloud.google.com/web-risk", - "release_level": "unreleased", - "repo": "googleapis/google-cloud-ruby", - "requires_billing": true, - "ruby-cloud-description": "Web Risk is an enterprise security product that lets your client applications check URLs against Google's constantly updated lists of unsafe web resources. Note that google-cloud-web_risk-v1beta1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-web_risk instead. See the readme for more details.", - "ruby-cloud-env-prefix": "WEBRISK", - "ruby-cloud-product-url": "https://cloud.google.com/web-risk", - "ruby-cloud-service-override": "WebRiskServiceV1Beta1=WebRiskService", - "library_type": "GAPIC_AUTO" -} diff --git a/owl-bot-staging/google-cloud-web_risk-v1beta1/.rubocop.yml b/owl-bot-staging/google-cloud-web_risk-v1beta1/.rubocop.yml deleted file mode 100644 index 259ed15aa523..000000000000 --- a/owl-bot-staging/google-cloud-web_risk-v1beta1/.rubocop.yml +++ /dev/null @@ -1,33 +0,0 @@ -inherit_gem: - google-style: google-style.yml - -AllCops: - Exclude: - - "google-cloud-web_risk-v1beta1.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-web_risk-v1beta1.rb" diff --git a/owl-bot-staging/google-cloud-web_risk-v1beta1/.toys.rb b/owl-bot-staging/google-cloud-web_risk-v1beta1/.toys.rb deleted file mode 100644 index 177e22456e8a..000000000000 --- a/owl-bot-staging/google-cloud-web_risk-v1beta1/.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-web_risk-v1beta1/.yardopts b/owl-bot-staging/google-cloud-web_risk-v1beta1/.yardopts deleted file mode 100644 index 70af59b70236..000000000000 --- a/owl-bot-staging/google-cloud-web_risk-v1beta1/.yardopts +++ /dev/null @@ -1,12 +0,0 @@ ---no-private ---title="Web Risk V1beta1 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-web_risk-v1beta1/AUTHENTICATION.md b/owl-bot-staging/google-cloud-web_risk-v1beta1/AUTHENTICATION.md deleted file mode 100644 index 402db6205842..000000000000 --- a/owl-bot-staging/google-cloud-web_risk-v1beta1/AUTHENTICATION.md +++ /dev/null @@ -1,122 +0,0 @@ -# Authentication - -The recommended way to authenticate to the google-cloud-web_risk-v1beta1 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-web_risk-v1beta1 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/web_risk/v1beta1" - -client = ::Google::Cloud::WebRisk::V1beta1::WebRiskService::Client.new do |config| - config.credentials = "path/to/credentialfile.json" -end -``` - -To configure a credentials file globally for all clients: - -```ruby -require "google/cloud/web_risk/v1beta1" - -::Google::Cloud::WebRisk::V1beta1::WebRiskService::Client.configure do |config| - config.credentials = "path/to/credentialfile.json" -end - -client = ::Google::Cloud::WebRisk::V1beta1::WebRiskService::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-web_risk-v1beta1 -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/web_risk/v1beta1" - -ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" - -client = ::Google::Cloud::WebRisk::V1beta1::WebRiskService::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-web_risk-v1beta1/CHANGELOG.md b/owl-bot-staging/google-cloud-web_risk-v1beta1/CHANGELOG.md deleted file mode 100644 index f88957a62ba2..000000000000 --- a/owl-bot-staging/google-cloud-web_risk-v1beta1/CHANGELOG.md +++ /dev/null @@ -1,2 +0,0 @@ -# Release History - diff --git a/owl-bot-staging/google-cloud-web_risk-v1beta1/Gemfile b/owl-bot-staging/google-cloud-web_risk-v1beta1/Gemfile deleted file mode 100644 index 1d08558908d8..000000000000 --- a/owl-bot-staging/google-cloud-web_risk-v1beta1/Gemfile +++ /dev/null @@ -1,14 +0,0 @@ -source "https://rubygems.org" - -gemspec - -gem "google-style", "~> 1.32.0" -gem "irb", "~> 1.17" -gem "minitest", "~> 6.0.2" -gem "minitest-focus", "~> 1.4" -gem "minitest-mock", "~> 5.27" -gem "minitest-rg", "~> 5.3" -gem "ostruct", "~> 0.5.5" -gem "rake", ">= 13.0" -gem "redcarpet", "~> 3.6" -gem "yard", "~> 0.9" diff --git a/owl-bot-staging/google-cloud-web_risk-v1beta1/LICENSE.md b/owl-bot-staging/google-cloud-web_risk-v1beta1/LICENSE.md deleted file mode 100644 index c261857ba6ad..000000000000 --- a/owl-bot-staging/google-cloud-web_risk-v1beta1/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-web_risk-v1beta1/README.md b/owl-bot-staging/google-cloud-web_risk-v1beta1/README.md deleted file mode 100644 index 523339a7d4ad..000000000000 --- a/owl-bot-staging/google-cloud-web_risk-v1beta1/README.md +++ /dev/null @@ -1,154 +0,0 @@ -# Ruby Client for the Web Risk V1beta1 API - -API Client library for the Web Risk V1beta1 API - -Web Risk is an enterprise security product that lets your client applications check URLs against Google's constantly updated lists of unsafe web resources. - -https://github.com/googleapis/google-cloud-ruby - -This gem is a _versioned_ client. It provides basic client classes for a -specific version of the Web Risk V1beta1 API. Most users should consider using -the main client gem, -[google-cloud-web_risk](https://rubygems.org/gems/google-cloud-web_risk). -See the section below titled *Which client should I use?* for more information. - -## Installation - -``` -$ gem install google-cloud-web_risk-v1beta1 -``` - -## 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/webrisk.googleapis.com) -1. [Set up authentication.](AUTHENTICATION.md) - -## Quick Start - -```ruby -require "google/cloud/web_risk/v1beta1" - -client = ::Google::Cloud::WebRisk::V1beta1::WebRiskService::Client.new -request = ::Google::Cloud::WebRisk::V1beta1::ComputeThreatListDiffRequest.new # (request fields as keyword arguments...) -response = client.compute_threat_list_diff request -``` - -View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-web_risk-v1beta1/latest) -for class and method documentation. - -See also the [Product Documentation](https://cloud.google.com/web-risk) -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/web_risk/v1beta1" -require "logger" - -client = ::Google::Cloud::WebRisk::V1beta1::WebRiskService::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-web_risk`, -and lower-level _versioned_ client libraries with names such as -`google-cloud-web_risk-v1beta1`. -_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-web_risk`. -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-web_risk-v1beta1`. - -### 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-web_risk-v1beta1/Rakefile b/owl-bot-staging/google-cloud-web_risk-v1beta1/Rakefile deleted file mode 100644 index c9ba69740a31..000000000000 --- a/owl-bot-staging/google-cloud-web_risk-v1beta1/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-web_risk-v1beta1 acceptance tests." -task :acceptance, :project, :keyfile do |t, args| - project = args[:project] - project ||= - ENV["WEBRISK_TEST_PROJECT"] || - ENV["GCLOUD_TEST_PROJECT"] - keyfile = args[:keyfile] - keyfile ||= - ENV["WEBRISK_TEST_KEYFILE"] || - ENV["GCLOUD_TEST_KEYFILE"] - if keyfile - keyfile = File.read keyfile - else - keyfile ||= - ENV["WEBRISK_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 WEBRISK_TEST_PROJECT=test123 WEBRISK_TEST_KEYFILE=/path/to/keyfile.json rake acceptance" - end - require "google/cloud/web_risk/v1beta1/web_risk_service/credentials" - ::Google::Cloud::WebRisk::V1beta1::WebRiskService::Credentials.env_vars.each do |path| - ENV[path] = nil - end - ENV["WEBRISK_PROJECT"] = project - ENV["WEBRISK_TEST_PROJECT"] = project - ENV["WEBRISK_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-web_risk-v1beta1 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-web_risk-v1beta1 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-web_risk-v1beta1 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-web_risk-v1beta1 gem does not have doctest tests." -end - -desc "Run the CI build" -task :ci do - header "BUILDING google-cloud-web_risk-v1beta1" - header "google-cloud-web_risk-v1beta1 rubocop", "*" - Rake::Task[:rubocop].invoke - header "google-cloud-web_risk-v1beta1 yard", "*" - Rake::Task[:yard].invoke - header "google-cloud-web_risk-v1beta1 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-web_risk-v1beta1 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-web_risk-v1beta1 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-web_risk-v1beta1/gapic_metadata.json b/owl-bot-staging/google-cloud-web_risk-v1beta1/gapic_metadata.json deleted file mode 100644 index 5c1de79e5f6d..000000000000 --- a/owl-bot-staging/google-cloud-web_risk-v1beta1/gapic_metadata.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", - "language": "ruby", - "protoPackage": "google.cloud.webrisk.v1beta1", - "libraryPackage": "::Google::Cloud::WebRisk::V1beta1", - "services": { - "WebRiskServiceV1Beta1": { - "clients": { - "grpc": { - "libraryClient": "::Google::Cloud::WebRisk::V1beta1::WebRiskService::Client", - "rpcs": { - "ComputeThreatListDiff": { - "methods": [ - "compute_threat_list_diff" - ] - }, - "SearchUris": { - "methods": [ - "search_uris" - ] - }, - "SearchHashes": { - "methods": [ - "search_hashes" - ] - } - } - } - } - } - } -} diff --git a/owl-bot-staging/google-cloud-web_risk-v1beta1/google-cloud-web_risk-v1beta1.gemspec b/owl-bot-staging/google-cloud-web_risk-v1beta1/google-cloud-web_risk-v1beta1.gemspec deleted file mode 100644 index 4d0becba1eff..000000000000 --- a/owl-bot-staging/google-cloud-web_risk-v1beta1/google-cloud-web_risk-v1beta1.gemspec +++ /dev/null @@ -1,28 +0,0 @@ -# -*- ruby -*- -# encoding: utf-8 - -require File.expand_path("lib/google/cloud/web_risk/v1beta1/version", __dir__) - -Gem::Specification.new do |gem| - gem.name = "google-cloud-web_risk-v1beta1" - gem.version = Google::Cloud::WebRisk::V1beta1::VERSION - - gem.authors = ["Google LLC"] - gem.email = "googleapis-packages@google.com" - gem.description = "Web Risk is an enterprise security product that lets your client applications check URLs against Google's constantly updated lists of unsafe web resources. Note that google-cloud-web_risk-v1beta1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-web_risk instead. See the readme for more details." - gem.summary = "API Client library for the Web Risk V1beta1 API" - 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.2" - - gem.add_dependency "gapic-common", "~> 1.2" - gem.add_dependency "google-cloud-errors", "~> 1.0" -end diff --git a/owl-bot-staging/google-cloud-web_risk-v1beta1/lib/google-cloud-web_risk-v1beta1.rb b/owl-bot-staging/google-cloud-web_risk-v1beta1/lib/google-cloud-web_risk-v1beta1.rb deleted file mode 100644 index c49ea8ac5445..000000000000 --- a/owl-bot-staging/google-cloud-web_risk-v1beta1/lib/google-cloud-web_risk-v1beta1.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/web_risk/v1beta1" diff --git a/owl-bot-staging/google-cloud-web_risk-v1beta1/lib/google/cloud/web_risk/v1beta1.rb b/owl-bot-staging/google-cloud-web_risk-v1beta1/lib/google/cloud/web_risk/v1beta1.rb deleted file mode 100644 index 05c5ff6acfc4..000000000000 --- a/owl-bot-staging/google-cloud-web_risk-v1beta1/lib/google/cloud/web_risk/v1beta1.rb +++ /dev/null @@ -1,45 +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/web_risk/v1beta1/web_risk_service" -require "google/cloud/web_risk/v1beta1/version" - -module Google - module Cloud - module WebRisk - ## - # API client module. - # - # @example Load this package, including all its services, and instantiate a gRPC client - # - # require "google/cloud/web_risk/v1beta1" - # client = ::Google::Cloud::WebRisk::V1beta1::WebRiskService::Client.new - # - # @example Load this package, including all its services, and instantiate a REST client - # - # require "google/cloud/web_risk/v1beta1" - # client = ::Google::Cloud::WebRisk::V1beta1::WebRiskService::Rest::Client.new - # - module V1beta1 - end - end - end -end - -helper_path = ::File.join __dir__, "v1beta1", "_helpers.rb" -require "google/cloud/web_risk/v1beta1/_helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-web_risk-v1beta1/lib/google/cloud/web_risk/v1beta1/rest.rb b/owl-bot-staging/google-cloud-web_risk-v1beta1/lib/google/cloud/web_risk/v1beta1/rest.rb deleted file mode 100644 index ee8a517b8f9c..000000000000 --- a/owl-bot-staging/google-cloud-web_risk-v1beta1/lib/google/cloud/web_risk/v1beta1/rest.rb +++ /dev/null @@ -1,37 +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/web_risk/v1beta1/web_risk_service/rest" -require "google/cloud/web_risk/v1beta1/version" - -module Google - module Cloud - module WebRisk - ## - # To load just the REST part of this package, including all its services, and instantiate a REST client: - # - # @example - # - # require "google/cloud/web_risk/v1beta1/rest" - # client = ::Google::Cloud::WebRisk::V1beta1::WebRiskService::Rest::Client.new - # - module V1beta1 - end - end - end -end diff --git a/owl-bot-staging/google-cloud-web_risk-v1beta1/lib/google/cloud/web_risk/v1beta1/version.rb b/owl-bot-staging/google-cloud-web_risk-v1beta1/lib/google/cloud/web_risk/v1beta1/version.rb deleted file mode 100644 index 8cfd7d301ca1..000000000000 --- a/owl-bot-staging/google-cloud-web_risk-v1beta1/lib/google/cloud/web_risk/v1beta1/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 WebRisk - module V1beta1 - VERSION = "0.0.1" - end - end - end -end diff --git a/owl-bot-staging/google-cloud-web_risk-v1beta1/lib/google/cloud/web_risk/v1beta1/web_risk_service.rb b/owl-bot-staging/google-cloud-web_risk-v1beta1/lib/google/cloud/web_risk/v1beta1/web_risk_service.rb deleted file mode 100644 index 738b01841c1a..000000000000 --- a/owl-bot-staging/google-cloud-web_risk-v1beta1/lib/google/cloud/web_risk/v1beta1/web_risk_service.rb +++ /dev/null @@ -1,55 +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/web_risk/v1beta1/version" - -require "google/cloud/web_risk/v1beta1/web_risk_service/credentials" -require "google/cloud/web_risk/v1beta1/web_risk_service/client" -require "google/cloud/web_risk/v1beta1/web_risk_service/rest" - -module Google - module Cloud - module WebRisk - module V1beta1 - ## - # Web Risk v1beta1 API defines an interface to detect malicious URLs on your - # website and in client applications. - # - # @example Load this service and instantiate a gRPC client - # - # require "google/cloud/web_risk/v1beta1/web_risk_service" - # client = ::Google::Cloud::WebRisk::V1beta1::WebRiskService::Client.new - # - # @example Load this service and instantiate a REST client - # - # require "google/cloud/web_risk/v1beta1/web_risk_service/rest" - # client = ::Google::Cloud::WebRisk::V1beta1::WebRiskService::Rest::Client.new - # - module WebRiskService - end - end - end - end -end - -helper_path = ::File.join __dir__, "web_risk_service", "helpers.rb" -require "google/cloud/web_risk/v1beta1/web_risk_service/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-web_risk-v1beta1/lib/google/cloud/web_risk/v1beta1/web_risk_service/client.rb b/owl-bot-staging/google-cloud-web_risk-v1beta1/lib/google/cloud/web_risk/v1beta1/web_risk_service/client.rb deleted file mode 100644 index 88d026e5d188..000000000000 --- a/owl-bot-staging/google-cloud-web_risk-v1beta1/lib/google/cloud/web_risk/v1beta1/web_risk_service/client.rb +++ /dev/null @@ -1,662 +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/webrisk/v1beta1/webrisk_pb" - -module Google - module Cloud - module WebRisk - module V1beta1 - module WebRiskService - ## - # Client for the WebRiskService service. - # - # Web Risk v1beta1 API defines an interface to detect malicious URLs on your - # website and in client applications. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "webrisk.$UNIVERSE_DOMAIN$" - - # @private - attr_reader :web_risk_service_stub - - ## - # Configure the WebRiskService Client class. - # - # See {::Google::Cloud::WebRisk::V1beta1::WebRiskService::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all WebRiskService clients - # ::Google::Cloud::WebRisk::V1beta1::WebRiskService::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", "WebRisk", "V1beta1"] - 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.compute_threat_list_diff.timeout = 600.0 - default_config.rpcs.compute_threat_list_diff.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.search_uris.timeout = 600.0 - default_config.rpcs.search_uris.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.search_hashes.timeout = 600.0 - default_config.rpcs.search_hashes.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the WebRiskService 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::WebRisk::V1beta1::WebRiskService::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 - @web_risk_service_stub.universe_domain - end - - ## - # Create a new WebRiskService client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::WebRisk::V1beta1::WebRiskService::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::WebRisk::V1beta1::WebRiskService::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the WebRiskService 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/webrisk/v1beta1/webrisk_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 - - @web_risk_service_stub = ::Gapic::ServiceStub.new( - ::Google::Cloud::WebRisk::V1beta1::WebRiskServiceV1Beta1::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 - ) - - @web_risk_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 - end - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @web_risk_service_stub.logger - end - - # Service calls - - ## - # Gets the most recent threat list diffs. - # - # @overload compute_threat_list_diff(request, options = nil) - # Pass arguments to `compute_threat_list_diff` via a request object, either of type - # {::Google::Cloud::WebRisk::V1beta1::ComputeThreatListDiffRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::WebRisk::V1beta1::ComputeThreatListDiffRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload compute_threat_list_diff(threat_type: nil, version_token: nil, constraints: nil) - # Pass arguments to `compute_threat_list_diff` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param threat_type [::Google::Cloud::WebRisk::V1beta1::ThreatType] - # The ThreatList to update. - # @param version_token [::String] - # The current version token of the client for the requested list (the - # client version that was received from the last successful diff). - # @param constraints [::Google::Cloud::WebRisk::V1beta1::ComputeThreatListDiffRequest::Constraints, ::Hash] - # Required. The constraints associated with this request. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::WebRisk::V1beta1::ComputeThreatListDiffResponse] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::WebRisk::V1beta1::ComputeThreatListDiffResponse] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/web_risk/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::WebRisk::V1beta1::WebRiskService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::WebRisk::V1beta1::ComputeThreatListDiffRequest.new - # - # # Call the compute_threat_list_diff method. - # result = client.compute_threat_list_diff request - # - # # The returned object is of type Google::Cloud::WebRisk::V1beta1::ComputeThreatListDiffResponse. - # p result - # - def compute_threat_list_diff request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::WebRisk::V1beta1::ComputeThreatListDiffRequest - - # Converts hash 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.compute_threat_list_diff.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::WebRisk::V1beta1::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.compute_threat_list_diff.timeout, - metadata: metadata, - retry_policy: @config.rpcs.compute_threat_list_diff.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @web_risk_service_stub.call_rpc :compute_threat_list_diff, 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 - - ## - # This method is used to check whether a URI is on a given threatList. - # - # @overload search_uris(request, options = nil) - # Pass arguments to `search_uris` via a request object, either of type - # {::Google::Cloud::WebRisk::V1beta1::SearchUrisRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::WebRisk::V1beta1::SearchUrisRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload search_uris(uri: nil, threat_types: nil) - # Pass arguments to `search_uris` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param uri [::String] - # Required. The URI to be checked for matches. - # @param threat_types [::Array<::Google::Cloud::WebRisk::V1beta1::ThreatType>] - # Required. The ThreatLists to search in. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::WebRisk::V1beta1::SearchUrisResponse] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::WebRisk::V1beta1::SearchUrisResponse] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/web_risk/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::WebRisk::V1beta1::WebRiskService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::WebRisk::V1beta1::SearchUrisRequest.new - # - # # Call the search_uris method. - # result = client.search_uris request - # - # # The returned object is of type Google::Cloud::WebRisk::V1beta1::SearchUrisResponse. - # p result - # - def search_uris request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::WebRisk::V1beta1::SearchUrisRequest - - # Converts hash 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.search_uris.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::WebRisk::V1beta1::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.search_uris.timeout, - metadata: metadata, - retry_policy: @config.rpcs.search_uris.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @web_risk_service_stub.call_rpc :search_uris, 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 - - ## - # Gets the full hashes that match the requested hash prefix. - # This is used after a hash prefix is looked up in a threatList - # and there is a match. The client side threatList only holds partial hashes - # so the client must query this method to determine if there is a full - # hash match of a threat. - # - # @overload search_hashes(request, options = nil) - # Pass arguments to `search_hashes` via a request object, either of type - # {::Google::Cloud::WebRisk::V1beta1::SearchHashesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::WebRisk::V1beta1::SearchHashesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload search_hashes(hash_prefix: nil, threat_types: nil) - # Pass arguments to `search_hashes` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param hash_prefix [::String] - # A hash prefix, consisting of the most significant 4-32 bytes of a SHA256 - # hash. For JSON requests, this field is base64-encoded. - # @param threat_types [::Array<::Google::Cloud::WebRisk::V1beta1::ThreatType>] - # Required. The ThreatLists to search in. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::WebRisk::V1beta1::SearchHashesResponse] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::WebRisk::V1beta1::SearchHashesResponse] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/web_risk/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::WebRisk::V1beta1::WebRiskService::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::WebRisk::V1beta1::SearchHashesRequest.new - # - # # Call the search_hashes method. - # result = client.search_hashes request - # - # # The returned object is of type Google::Cloud::WebRisk::V1beta1::SearchHashesResponse. - # p result - # - def search_hashes request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::WebRisk::V1beta1::SearchHashesRequest - - # Converts hash 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.search_hashes.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::WebRisk::V1beta1::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.search_hashes.timeout, - metadata: metadata, - retry_policy: @config.rpcs.search_hashes.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @web_risk_service_stub.call_rpc :search_hashes, 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 WebRiskService API. - # - # This class represents the configuration for WebRiskService, - # 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::WebRisk::V1beta1::WebRiskService::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 - # # compute_threat_list_diff to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::WebRisk::V1beta1::WebRiskService::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.compute_threat_list_diff.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::WebRisk::V1beta1::WebRiskService::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.compute_threat_list_diff.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::WebRisk::V1beta1::WebRiskService::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 = "webrisk.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 WebRiskService 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 `compute_threat_list_diff` - # @return [::Gapic::Config::Method] - # - attr_reader :compute_threat_list_diff - ## - # RPC-specific configuration for `search_uris` - # @return [::Gapic::Config::Method] - # - attr_reader :search_uris - ## - # RPC-specific configuration for `search_hashes` - # @return [::Gapic::Config::Method] - # - attr_reader :search_hashes - - # @private - def initialize parent_rpcs = nil - compute_threat_list_diff_config = parent_rpcs.compute_threat_list_diff if parent_rpcs.respond_to? :compute_threat_list_diff - @compute_threat_list_diff = ::Gapic::Config::Method.new compute_threat_list_diff_config - search_uris_config = parent_rpcs.search_uris if parent_rpcs.respond_to? :search_uris - @search_uris = ::Gapic::Config::Method.new search_uris_config - search_hashes_config = parent_rpcs.search_hashes if parent_rpcs.respond_to? :search_hashes - @search_hashes = ::Gapic::Config::Method.new search_hashes_config - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-web_risk-v1beta1/lib/google/cloud/web_risk/v1beta1/web_risk_service/credentials.rb b/owl-bot-staging/google-cloud-web_risk-v1beta1/lib/google/cloud/web_risk/v1beta1/web_risk_service/credentials.rb deleted file mode 100644 index 36e4e8d572dc..000000000000 --- a/owl-bot-staging/google-cloud-web_risk-v1beta1/lib/google/cloud/web_risk/v1beta1/web_risk_service/credentials.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! - -require "googleauth" - -module Google - module Cloud - module WebRisk - module V1beta1 - module WebRiskService - # Credentials for the WebRiskService API. - class Credentials < ::Google::Auth::Credentials - self.scope = [ - "https://www.googleapis.com/auth/cloud-platform" - ] - self.env_vars = [ - "WEBRISK_CREDENTIALS", - "WEBRISK_KEYFILE", - "GOOGLE_CLOUD_CREDENTIALS", - "GOOGLE_CLOUD_KEYFILE", - "GCLOUD_KEYFILE", - "WEBRISK_CREDENTIALS_JSON", - "WEBRISK_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-web_risk-v1beta1/lib/google/cloud/web_risk/v1beta1/web_risk_service/rest.rb b/owl-bot-staging/google-cloud-web_risk-v1beta1/lib/google/cloud/web_risk/v1beta1/web_risk_service/rest.rb deleted file mode 100644 index 641b01af11e5..000000000000 --- a/owl-bot-staging/google-cloud-web_risk-v1beta1/lib/google/cloud/web_risk/v1beta1/web_risk_service/rest.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 "gapic/rest" -require "gapic/config" -require "gapic/config/method" - -require "google/cloud/web_risk/v1beta1/version" - -require "google/cloud/web_risk/v1beta1/web_risk_service/credentials" -require "google/cloud/web_risk/v1beta1/web_risk_service/rest/client" - -module Google - module Cloud - module WebRisk - module V1beta1 - ## - # Web Risk v1beta1 API defines an interface to detect malicious URLs on your - # website and in client applications. - # - # To load this service and instantiate a REST client: - # - # require "google/cloud/web_risk/v1beta1/web_risk_service/rest" - # client = ::Google::Cloud::WebRisk::V1beta1::WebRiskService::Rest::Client.new - # - module WebRiskService - # Client for the REST transport - module Rest - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "rest", "helpers.rb" -require "google/cloud/web_risk/v1beta1/web_risk_service/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-web_risk-v1beta1/lib/google/cloud/web_risk/v1beta1/web_risk_service/rest/client.rb b/owl-bot-staging/google-cloud-web_risk-v1beta1/lib/google/cloud/web_risk/v1beta1/web_risk_service/rest/client.rb deleted file mode 100644 index 1709cfcb3b5f..000000000000 --- a/owl-bot-staging/google-cloud-web_risk-v1beta1/lib/google/cloud/web_risk/v1beta1/web_risk_service/rest/client.rb +++ /dev/null @@ -1,622 +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/webrisk/v1beta1/webrisk_pb" -require "google/cloud/web_risk/v1beta1/web_risk_service/rest/service_stub" - -module Google - module Cloud - module WebRisk - module V1beta1 - module WebRiskService - module Rest - ## - # REST client for the WebRiskService service. - # - # Web Risk v1beta1 API defines an interface to detect malicious URLs on your - # website and in client applications. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "webrisk.$UNIVERSE_DOMAIN$" - - # @private - attr_reader :web_risk_service_stub - - ## - # Configure the WebRiskService Client class. - # - # See {::Google::Cloud::WebRisk::V1beta1::WebRiskService::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all WebRiskService clients - # ::Google::Cloud::WebRisk::V1beta1::WebRiskService::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", "WebRisk", "V1beta1"] - 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.compute_threat_list_diff.timeout = 600.0 - default_config.rpcs.compute_threat_list_diff.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.search_uris.timeout = 600.0 - default_config.rpcs.search_uris.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.search_hashes.timeout = 600.0 - default_config.rpcs.search_hashes.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the WebRiskService 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::WebRisk::V1beta1::WebRiskService::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 - @web_risk_service_stub.universe_domain - end - - ## - # Create a new WebRiskService REST client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::WebRisk::V1beta1::WebRiskService::Rest::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::WebRisk::V1beta1::WebRiskService::Rest::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the WebRiskService 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 - - @web_risk_service_stub = ::Google::Cloud::WebRisk::V1beta1::WebRiskService::Rest::ServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials, - logger: @config.logger - ) - - @web_risk_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 - end - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @web_risk_service_stub.logger - end - - # Service calls - - ## - # Gets the most recent threat list diffs. - # - # @overload compute_threat_list_diff(request, options = nil) - # Pass arguments to `compute_threat_list_diff` via a request object, either of type - # {::Google::Cloud::WebRisk::V1beta1::ComputeThreatListDiffRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::WebRisk::V1beta1::ComputeThreatListDiffRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload compute_threat_list_diff(threat_type: nil, version_token: nil, constraints: nil) - # Pass arguments to `compute_threat_list_diff` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param threat_type [::Google::Cloud::WebRisk::V1beta1::ThreatType] - # The ThreatList to update. - # @param version_token [::String] - # The current version token of the client for the requested list (the - # client version that was received from the last successful diff). - # @param constraints [::Google::Cloud::WebRisk::V1beta1::ComputeThreatListDiffRequest::Constraints, ::Hash] - # Required. The constraints associated with this request. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::WebRisk::V1beta1::ComputeThreatListDiffResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::WebRisk::V1beta1::ComputeThreatListDiffResponse] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/web_risk/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::WebRisk::V1beta1::WebRiskService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::WebRisk::V1beta1::ComputeThreatListDiffRequest.new - # - # # Call the compute_threat_list_diff method. - # result = client.compute_threat_list_diff request - # - # # The returned object is of type Google::Cloud::WebRisk::V1beta1::ComputeThreatListDiffResponse. - # p result - # - def compute_threat_list_diff request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::WebRisk::V1beta1::ComputeThreatListDiffRequest - - # Converts hash 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.compute_threat_list_diff.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::WebRisk::V1beta1::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.compute_threat_list_diff.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.compute_threat_list_diff.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @web_risk_service_stub.compute_threat_list_diff 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 - - ## - # This method is used to check whether a URI is on a given threatList. - # - # @overload search_uris(request, options = nil) - # Pass arguments to `search_uris` via a request object, either of type - # {::Google::Cloud::WebRisk::V1beta1::SearchUrisRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::WebRisk::V1beta1::SearchUrisRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload search_uris(uri: nil, threat_types: nil) - # Pass arguments to `search_uris` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param uri [::String] - # Required. The URI to be checked for matches. - # @param threat_types [::Array<::Google::Cloud::WebRisk::V1beta1::ThreatType>] - # Required. The ThreatLists to search in. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::WebRisk::V1beta1::SearchUrisResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::WebRisk::V1beta1::SearchUrisResponse] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/web_risk/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::WebRisk::V1beta1::WebRiskService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::WebRisk::V1beta1::SearchUrisRequest.new - # - # # Call the search_uris method. - # result = client.search_uris request - # - # # The returned object is of type Google::Cloud::WebRisk::V1beta1::SearchUrisResponse. - # p result - # - def search_uris request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::WebRisk::V1beta1::SearchUrisRequest - - # Converts hash 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.search_uris.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::WebRisk::V1beta1::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.search_uris.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.search_uris.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @web_risk_service_stub.search_uris 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 - - ## - # Gets the full hashes that match the requested hash prefix. - # This is used after a hash prefix is looked up in a threatList - # and there is a match. The client side threatList only holds partial hashes - # so the client must query this method to determine if there is a full - # hash match of a threat. - # - # @overload search_hashes(request, options = nil) - # Pass arguments to `search_hashes` via a request object, either of type - # {::Google::Cloud::WebRisk::V1beta1::SearchHashesRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::WebRisk::V1beta1::SearchHashesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload search_hashes(hash_prefix: nil, threat_types: nil) - # Pass arguments to `search_hashes` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param hash_prefix [::String] - # A hash prefix, consisting of the most significant 4-32 bytes of a SHA256 - # hash. For JSON requests, this field is base64-encoded. - # @param threat_types [::Array<::Google::Cloud::WebRisk::V1beta1::ThreatType>] - # Required. The ThreatLists to search in. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::WebRisk::V1beta1::SearchHashesResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::WebRisk::V1beta1::SearchHashesResponse] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/web_risk/v1beta1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::WebRisk::V1beta1::WebRiskService::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::WebRisk::V1beta1::SearchHashesRequest.new - # - # # Call the search_hashes method. - # result = client.search_hashes request - # - # # The returned object is of type Google::Cloud::WebRisk::V1beta1::SearchHashesResponse. - # p result - # - def search_hashes request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::WebRisk::V1beta1::SearchHashesRequest - - # Converts hash 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.search_hashes.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::WebRisk::V1beta1::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.search_hashes.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.search_hashes.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @web_risk_service_stub.search_hashes 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 WebRiskService REST API. - # - # This class represents the configuration for WebRiskService 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::WebRisk::V1beta1::WebRiskService::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 - # # compute_threat_list_diff to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::WebRisk::V1beta1::WebRiskService::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.compute_threat_list_diff.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::WebRisk::V1beta1::WebRiskService::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.compute_threat_list_diff.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 = "webrisk.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 WebRiskService 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 `compute_threat_list_diff` - # @return [::Gapic::Config::Method] - # - attr_reader :compute_threat_list_diff - ## - # RPC-specific configuration for `search_uris` - # @return [::Gapic::Config::Method] - # - attr_reader :search_uris - ## - # RPC-specific configuration for `search_hashes` - # @return [::Gapic::Config::Method] - # - attr_reader :search_hashes - - # @private - def initialize parent_rpcs = nil - compute_threat_list_diff_config = parent_rpcs.compute_threat_list_diff if parent_rpcs.respond_to? :compute_threat_list_diff - @compute_threat_list_diff = ::Gapic::Config::Method.new compute_threat_list_diff_config - search_uris_config = parent_rpcs.search_uris if parent_rpcs.respond_to? :search_uris - @search_uris = ::Gapic::Config::Method.new search_uris_config - search_hashes_config = parent_rpcs.search_hashes if parent_rpcs.respond_to? :search_hashes - @search_hashes = ::Gapic::Config::Method.new search_hashes_config - - yield self if block_given? - end - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-web_risk-v1beta1/lib/google/cloud/web_risk/v1beta1/web_risk_service/rest/service_stub.rb b/owl-bot-staging/google-cloud-web_risk-v1beta1/lib/google/cloud/web_risk/v1beta1/web_risk_service/rest/service_stub.rb deleted file mode 100644 index 6138c60c8d86..000000000000 --- a/owl-bot-staging/google-cloud-web_risk-v1beta1/lib/google/cloud/web_risk/v1beta1/web_risk_service/rest/service_stub.rb +++ /dev/null @@ -1,258 +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/webrisk/v1beta1/webrisk_pb" - -module Google - module Cloud - module WebRisk - module V1beta1 - module WebRiskService - module Rest - ## - # REST service stub for the WebRiskService 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 compute_threat_list_diff REST call - # - # @param request_pb [::Google::Cloud::WebRisk::V1beta1::ComputeThreatListDiffRequest] - # 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::WebRisk::V1beta1::ComputeThreatListDiffResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::WebRisk::V1beta1::ComputeThreatListDiffResponse] - # A result object deserialized from the server's reply - def compute_threat_list_diff request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_compute_threat_list_diff_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: "compute_threat_list_diff", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::WebRisk::V1beta1::ComputeThreatListDiffResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the search_uris REST call - # - # @param request_pb [::Google::Cloud::WebRisk::V1beta1::SearchUrisRequest] - # 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::WebRisk::V1beta1::SearchUrisResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::WebRisk::V1beta1::SearchUrisResponse] - # A result object deserialized from the server's reply - def search_uris request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_search_uris_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: "search_uris", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::WebRisk::V1beta1::SearchUrisResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the search_hashes REST call - # - # @param request_pb [::Google::Cloud::WebRisk::V1beta1::SearchHashesRequest] - # 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::WebRisk::V1beta1::SearchHashesResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::WebRisk::V1beta1::SearchHashesResponse] - # A result object deserialized from the server's reply - def search_hashes request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_search_hashes_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: "search_hashes", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::WebRisk::V1beta1::SearchHashesResponse.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 compute_threat_list_diff REST call - # - # @param request_pb [::Google::Cloud::WebRisk::V1beta1::ComputeThreatListDiffRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_compute_threat_list_diff_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1beta1/threatLists:computeDiff", - matches: [] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the search_uris REST call - # - # @param request_pb [::Google::Cloud::WebRisk::V1beta1::SearchUrisRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_search_uris_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1beta1/uris:search", - matches: [] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the search_hashes REST call - # - # @param request_pb [::Google::Cloud::WebRisk::V1beta1::SearchHashesRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_search_hashes_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1beta1/hashes:search", - matches: [] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-web_risk-v1beta1/lib/google/cloud/webrisk/v1beta1/webrisk_pb.rb b/owl-bot-staging/google-cloud-web_risk-v1beta1/lib/google/cloud/webrisk/v1beta1/webrisk_pb.rb deleted file mode 100644 index e3a312629374..000000000000 --- a/owl-bot-staging/google-cloud-web_risk-v1beta1/lib/google/cloud/webrisk/v1beta1/webrisk_pb.rb +++ /dev/null @@ -1,43 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/webrisk/v1beta1/webrisk.proto - -require 'google/protobuf' - -require 'google/api/annotations_pb' -require 'google/api/client_pb' -require 'google/api/field_behavior_pb' -require 'google/protobuf/timestamp_pb' - - -descriptor_data = "\n*google/cloud/webrisk/v1beta1/webrisk.proto\x12\x1cgoogle.cloud.webrisk.v1beta1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xf2\x02\n\x1c\x43omputeThreatListDiffRequest\x12\x42\n\x0bthreat_type\x18\x01 \x01(\x0e\x32(.google.cloud.webrisk.v1beta1.ThreatTypeB\x03\xe0\x41\x02\x12\x15\n\rversion_token\x18\x02 \x01(\x0c\x12`\n\x0b\x63onstraints\x18\x03 \x01(\x0b\x32\x46.google.cloud.webrisk.v1beta1.ComputeThreatListDiffRequest.ConstraintsB\x03\xe0\x41\x02\x1a\x94\x01\n\x0b\x43onstraints\x12\x18\n\x10max_diff_entries\x18\x01 \x01(\x05\x12\x1c\n\x14max_database_entries\x18\x02 \x01(\x05\x12M\n\x16supported_compressions\x18\x03 \x03(\x0e\x32-.google.cloud.webrisk.v1beta1.CompressionType\"\x9a\x04\n\x1d\x43omputeThreatListDiffResponse\x12_\n\rresponse_type\x18\x04 \x01(\x0e\x32H.google.cloud.webrisk.v1beta1.ComputeThreatListDiffResponse.ResponseType\x12\x45\n\tadditions\x18\x05 \x01(\x0b\x32\x32.google.cloud.webrisk.v1beta1.ThreatEntryAdditions\x12\x43\n\x08removals\x18\x06 \x01(\x0b\x32\x31.google.cloud.webrisk.v1beta1.ThreatEntryRemovals\x12\x19\n\x11new_version_token\x18\x07 \x01(\x0c\x12V\n\x08\x63hecksum\x18\x08 \x01(\x0b\x32\x44.google.cloud.webrisk.v1beta1.ComputeThreatListDiffResponse.Checksum\x12\x39\n\x15recommended_next_diff\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x1a\x1a\n\x08\x43hecksum\x12\x0e\n\x06sha256\x18\x01 \x01(\x0c\"B\n\x0cResponseType\x12\x1d\n\x19RESPONSE_TYPE_UNSPECIFIED\x10\x00\x12\x08\n\x04\x44IFF\x10\x01\x12\t\n\x05RESET\x10\x02\"j\n\x11SearchUrisRequest\x12\x10\n\x03uri\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x43\n\x0cthreat_types\x18\x02 \x03(\x0e\x32(.google.cloud.webrisk.v1beta1.ThreatTypeB\x03\xe0\x41\x02\"\xde\x01\n\x12SearchUrisResponse\x12J\n\x06threat\x18\x01 \x01(\x0b\x32:.google.cloud.webrisk.v1beta1.SearchUrisResponse.ThreatUri\x1a|\n\tThreatUri\x12>\n\x0cthreat_types\x18\x01 \x03(\x0e\x32(.google.cloud.webrisk.v1beta1.ThreatType\x12/\n\x0b\x65xpire_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"o\n\x13SearchHashesRequest\x12\x13\n\x0bhash_prefix\x18\x01 \x01(\x0c\x12\x43\n\x0cthreat_types\x18\x02 \x03(\x0e\x32(.google.cloud.webrisk.v1beta1.ThreatTypeB\x03\xe0\x41\x02\"\xae\x02\n\x14SearchHashesResponse\x12N\n\x07threats\x18\x01 \x03(\x0b\x32=.google.cloud.webrisk.v1beta1.SearchHashesResponse.ThreatHash\x12\x38\n\x14negative_expire_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x1a\x8b\x01\n\nThreatHash\x12>\n\x0cthreat_types\x18\x01 \x03(\x0e\x32(.google.cloud.webrisk.v1beta1.ThreatType\x12\x0c\n\x04hash\x18\x02 \x01(\x0c\x12/\n\x0b\x65xpire_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"\x99\x01\n\x14ThreatEntryAdditions\x12;\n\nraw_hashes\x18\x01 \x03(\x0b\x32\'.google.cloud.webrisk.v1beta1.RawHashes\x12\x44\n\x0brice_hashes\x18\x02 \x01(\x0b\x32/.google.cloud.webrisk.v1beta1.RiceDeltaEncoding\"\x9b\x01\n\x13ThreatEntryRemovals\x12=\n\x0braw_indices\x18\x01 \x01(\x0b\x32(.google.cloud.webrisk.v1beta1.RawIndices\x12\x45\n\x0crice_indices\x18\x02 \x01(\x0b\x32/.google.cloud.webrisk.v1beta1.RiceDeltaEncoding\"\x1d\n\nRawIndices\x12\x0f\n\x07indices\x18\x01 \x03(\x05\"4\n\tRawHashes\x12\x13\n\x0bprefix_size\x18\x01 \x01(\x05\x12\x12\n\nraw_hashes\x18\x02 \x01(\x0c\"k\n\x11RiceDeltaEncoding\x12\x13\n\x0b\x66irst_value\x18\x01 \x01(\x03\x12\x16\n\x0erice_parameter\x18\x02 \x01(\x05\x12\x13\n\x0b\x65ntry_count\x18\x03 \x01(\x05\x12\x14\n\x0c\x65ncoded_data\x18\x04 \x01(\x0c*e\n\nThreatType\x12\x1b\n\x17THREAT_TYPE_UNSPECIFIED\x10\x00\x12\x0b\n\x07MALWARE\x10\x01\x12\x16\n\x12SOCIAL_ENGINEERING\x10\x02\x12\x15\n\x11UNWANTED_SOFTWARE\x10\x03*F\n\x0f\x43ompressionType\x12 \n\x1c\x43OMPRESSION_TYPE_UNSPECIFIED\x10\x00\x12\x07\n\x03RAW\x10\x01\x12\x08\n\x04RICE\x10\x02\x32\x9e\x05\n\x15WebRiskServiceV1Beta1\x12\xe2\x01\n\x15\x43omputeThreatListDiff\x12:.google.cloud.webrisk.v1beta1.ComputeThreatListDiffRequest\x1a;.google.cloud.webrisk.v1beta1.ComputeThreatListDiffResponse\"P\xda\x41%threat_type,version_token,constraints\x82\xd3\xe4\x93\x02\"\x12 /v1beta1/threatLists:computeDiff\x12\xa0\x01\n\nSearchUris\x12/.google.cloud.webrisk.v1beta1.SearchUrisRequest\x1a\x30.google.cloud.webrisk.v1beta1.SearchUrisResponse\"/\xda\x41\x10uri,threat_types\x82\xd3\xe4\x93\x02\x16\x12\x14/v1beta1/uris:search\x12\xb0\x01\n\x0cSearchHashes\x12\x31.google.cloud.webrisk.v1beta1.SearchHashesRequest\x1a\x32.google.cloud.webrisk.v1beta1.SearchHashesResponse\"9\xda\x41\x18hash_prefix,threat_types\x82\xd3\xe4\x93\x02\x18\x12\x16/v1beta1/hashes:search\x1aJ\xca\x41\x16webrisk.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\xcf\x01\n\x1a\x63om.google.webrisk.v1beta1B\x0cWebRiskProtoP\x01Z:cloud.google.com/go/webrisk/apiv1beta1/webriskpb;webriskpb\xa2\x02\x04GCWR\xaa\x02\x1cGoogle.Cloud.WebRisk.V1Beta1\xca\x02\x1cGoogle\\Cloud\\WebRisk\\V1beta1\xea\x02\x1fGoogle::Cloud::WebRisk::V1beta1b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module WebRisk - module V1beta1 - ComputeThreatListDiffRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.webrisk.v1beta1.ComputeThreatListDiffRequest").msgclass - ComputeThreatListDiffRequest::Constraints = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.webrisk.v1beta1.ComputeThreatListDiffRequest.Constraints").msgclass - ComputeThreatListDiffResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.webrisk.v1beta1.ComputeThreatListDiffResponse").msgclass - ComputeThreatListDiffResponse::Checksum = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.webrisk.v1beta1.ComputeThreatListDiffResponse.Checksum").msgclass - ComputeThreatListDiffResponse::ResponseType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.webrisk.v1beta1.ComputeThreatListDiffResponse.ResponseType").enummodule - SearchUrisRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.webrisk.v1beta1.SearchUrisRequest").msgclass - SearchUrisResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.webrisk.v1beta1.SearchUrisResponse").msgclass - SearchUrisResponse::ThreatUri = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.webrisk.v1beta1.SearchUrisResponse.ThreatUri").msgclass - SearchHashesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.webrisk.v1beta1.SearchHashesRequest").msgclass - SearchHashesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.webrisk.v1beta1.SearchHashesResponse").msgclass - SearchHashesResponse::ThreatHash = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.webrisk.v1beta1.SearchHashesResponse.ThreatHash").msgclass - ThreatEntryAdditions = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.webrisk.v1beta1.ThreatEntryAdditions").msgclass - ThreatEntryRemovals = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.webrisk.v1beta1.ThreatEntryRemovals").msgclass - RawIndices = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.webrisk.v1beta1.RawIndices").msgclass - RawHashes = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.webrisk.v1beta1.RawHashes").msgclass - RiceDeltaEncoding = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.webrisk.v1beta1.RiceDeltaEncoding").msgclass - ThreatType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.webrisk.v1beta1.ThreatType").enummodule - CompressionType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.webrisk.v1beta1.CompressionType").enummodule - end - end - end -end diff --git a/owl-bot-staging/google-cloud-web_risk-v1beta1/lib/google/cloud/webrisk/v1beta1/webrisk_services_pb.rb b/owl-bot-staging/google-cloud-web_risk-v1beta1/lib/google/cloud/webrisk/v1beta1/webrisk_services_pb.rb deleted file mode 100644 index 660324d80adb..000000000000 --- a/owl-bot-staging/google-cloud-web_risk-v1beta1/lib/google/cloud/webrisk/v1beta1/webrisk_services_pb.rb +++ /dev/null @@ -1,55 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# Source: google/cloud/webrisk/v1beta1/webrisk.proto for package 'Google.Cloud.WebRisk.V1beta1' -# 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/webrisk/v1beta1/webrisk_pb' - -module Google - module Cloud - module WebRisk - module V1beta1 - module WebRiskServiceV1Beta1 - # Web Risk v1beta1 API defines an interface to detect malicious URLs on your - # website and in client applications. - class Service - - include ::GRPC::GenericService - - self.marshal_class_method = :encode - self.unmarshal_class_method = :decode - self.service_name = 'google.cloud.webrisk.v1beta1.WebRiskServiceV1Beta1' - - # Gets the most recent threat list diffs. - rpc :ComputeThreatListDiff, ::Google::Cloud::WebRisk::V1beta1::ComputeThreatListDiffRequest, ::Google::Cloud::WebRisk::V1beta1::ComputeThreatListDiffResponse - # This method is used to check whether a URI is on a given threatList. - rpc :SearchUris, ::Google::Cloud::WebRisk::V1beta1::SearchUrisRequest, ::Google::Cloud::WebRisk::V1beta1::SearchUrisResponse - # Gets the full hashes that match the requested hash prefix. - # This is used after a hash prefix is looked up in a threatList - # and there is a match. The client side threatList only holds partial hashes - # so the client must query this method to determine if there is a full - # hash match of a threat. - rpc :SearchHashes, ::Google::Cloud::WebRisk::V1beta1::SearchHashesRequest, ::Google::Cloud::WebRisk::V1beta1::SearchHashesResponse - end - - Stub = Service.rpc_stub_class - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-web_risk-v1beta1/proto_docs/README.md b/owl-bot-staging/google-cloud-web_risk-v1beta1/proto_docs/README.md deleted file mode 100644 index a908c3711de1..000000000000 --- a/owl-bot-staging/google-cloud-web_risk-v1beta1/proto_docs/README.md +++ /dev/null @@ -1,4 +0,0 @@ -# Web Risk V1beta1 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-web_risk-v1beta1/proto_docs/google/api/client.rb b/owl-bot-staging/google-cloud-web_risk-v1beta1/proto_docs/google/api/client.rb deleted file mode 100644 index 3ab0b096d445..000000000000 --- a/owl-bot-staging/google-cloud-web_risk-v1beta1/proto_docs/google/api/client.rb +++ /dev/null @@ -1,593 +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. - # - # Note: This field should not be used in most cases. - 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: - # library_settings: - # 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. - # @!attribute [rw] library_package - # @return [::String] - # The package name to use in Php. Clobbers the php_namespace option - # set in the protobuf. This should be used **only** by APIs - # who have already set the language_settings.php.package_name" field - # in gapic.yaml. API teams should use the protobuf php_namespace option - # where possible. - # - # Example of a YAML configuration:: - # - # publishing: - # library_settings: - # php_settings: - # library_package: Google\Cloud\PubSub\V1 - 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. - # - # Example: - # - # 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 - # @!attribute [rw] batching - # @return [::Google::Api::BatchingConfigProto] - # Batching configuration for an API method in client libraries. - # - # Example of a YAML configuration: - # - # publishing: - # method_settings: - # - selector: google.example.v1.ExampleService.BatchCreateExample - # batching: - # element_count_threshold: 1000 - # request_byte_threshold: 100000000 - # delay_threshold_millis: 10 - 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. - # - # Note: This feature should not be used in most cases. - # @!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 - - # `BatchingConfigProto` defines the batching configuration for an API method. - # @!attribute [rw] thresholds - # @return [::Google::Api::BatchingSettingsProto] - # The thresholds which trigger a batched request to be sent. - # @!attribute [rw] batch_descriptor - # @return [::Google::Api::BatchingDescriptorProto] - # The request and response fields used in batching. - class BatchingConfigProto - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # `BatchingSettingsProto` specifies a set of batching thresholds, each of - # which acts as a trigger to send a batch of messages as a request. At least - # one threshold must be positive nonzero. - # @!attribute [rw] element_count_threshold - # @return [::Integer] - # The number of elements of a field collected into a batch which, if - # exceeded, causes the batch to be sent. - # @!attribute [rw] request_byte_threshold - # @return [::Integer] - # The aggregated size of the batched field which, if exceeded, causes the - # batch to be sent. This size is computed by aggregating the sizes of the - # request field to be batched, not of the entire request message. - # @!attribute [rw] delay_threshold - # @return [::Google::Protobuf::Duration] - # The duration after which a batch should be sent, starting from the addition - # of the first message to that batch. - # @!attribute [rw] element_count_limit - # @return [::Integer] - # The maximum number of elements collected in a batch that could be accepted - # by server. - # @!attribute [rw] request_byte_limit - # @return [::Integer] - # The maximum size of the request that could be accepted by server. - # @!attribute [rw] flow_control_element_limit - # @return [::Integer] - # The maximum number of elements allowed by flow control. - # @!attribute [rw] flow_control_byte_limit - # @return [::Integer] - # The maximum size of data allowed by flow control. - # @!attribute [rw] flow_control_limit_exceeded_behavior - # @return [::Google::Api::FlowControlLimitExceededBehaviorProto] - # The behavior to take when the flow control limit is exceeded. - class BatchingSettingsProto - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # `BatchingDescriptorProto` specifies the fields of the request message to be - # used for batching, and, optionally, the fields of the response message to be - # used for demultiplexing. - # @!attribute [rw] batched_field - # @return [::String] - # The repeated field in the request message to be aggregated by batching. - # @!attribute [rw] discriminator_fields - # @return [::Array<::String>] - # A list of the fields in the request message. Two requests will be batched - # together only if the values of every field specified in - # `request_discriminator_fields` is equal between the two requests. - # @!attribute [rw] subresponse_field - # @return [::String] - # Optional. When present, indicates the field in the response message to be - # used to demultiplex the response into multiple response messages, in - # correspondence with the multiple request messages originally batched - # together. - class BatchingDescriptorProto - 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 - - # The behavior to take when the flow control limit is exceeded. - module FlowControlLimitExceededBehaviorProto - # Default behavior, system-defined. - UNSET_BEHAVIOR = 0 - - # Stop operation, raise error. - THROW_EXCEPTION = 1 - - # Pause operation until limit clears. - BLOCK = 2 - - # Continue operation, disregard limit. - IGNORE = 3 - end - end -end diff --git a/owl-bot-staging/google-cloud-web_risk-v1beta1/proto_docs/google/api/field_behavior.rb b/owl-bot-staging/google-cloud-web_risk-v1beta1/proto_docs/google/api/field_behavior.rb deleted file mode 100644 index 582be187d115..000000000000 --- a/owl-bot-staging/google-cloud-web_risk-v1beta1/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-web_risk-v1beta1/proto_docs/google/api/launch_stage.rb b/owl-bot-staging/google-cloud-web_risk-v1beta1/proto_docs/google/api/launch_stage.rb deleted file mode 100644 index 9392a413fb1b..000000000000 --- a/owl-bot-staging/google-cloud-web_risk-v1beta1/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-web_risk-v1beta1/proto_docs/google/api/resource.rb b/owl-bot-staging/google-cloud-web_risk-v1beta1/proto_docs/google/api/resource.rb deleted file mode 100644 index 25dec4847ac1..000000000000 --- a/owl-bot-staging/google-cloud-web_risk-v1beta1/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-web_risk-v1beta1/proto_docs/google/cloud/webrisk/v1beta1/webrisk.rb b/owl-bot-staging/google-cloud-web_risk-v1beta1/proto_docs/google/cloud/webrisk/v1beta1/webrisk.rb deleted file mode 100644 index c8e4013b59f2..000000000000 --- a/owl-bot-staging/google-cloud-web_risk-v1beta1/proto_docs/google/cloud/webrisk/v1beta1/webrisk.rb +++ /dev/null @@ -1,307 +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 WebRisk - module V1beta1 - # Describes an API diff request. - # @!attribute [rw] threat_type - # @return [::Google::Cloud::WebRisk::V1beta1::ThreatType] - # The ThreatList to update. - # @!attribute [rw] version_token - # @return [::String] - # The current version token of the client for the requested list (the - # client version that was received from the last successful diff). - # @!attribute [rw] constraints - # @return [::Google::Cloud::WebRisk::V1beta1::ComputeThreatListDiffRequest::Constraints] - # Required. The constraints associated with this request. - class ComputeThreatListDiffRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The constraints for this diff. - # @!attribute [rw] max_diff_entries - # @return [::Integer] - # The maximum size in number of entries. The diff will not contain more - # entries than this value. This should be a power of 2 between 2**10 and - # 2**20. If zero, no diff size limit is set. - # @!attribute [rw] max_database_entries - # @return [::Integer] - # Sets the maximum number of entries that the client is willing to have - # in the local database. This should be a power of 2 between 2**10 and - # 2**20. If zero, no database size limit is set. - # @!attribute [rw] supported_compressions - # @return [::Array<::Google::Cloud::WebRisk::V1beta1::CompressionType>] - # The compression types supported by the client. - class Constraints - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # @!attribute [rw] response_type - # @return [::Google::Cloud::WebRisk::V1beta1::ComputeThreatListDiffResponse::ResponseType] - # The type of response. This may indicate that an action must be taken by the - # client when the response is received. - # @!attribute [rw] additions - # @return [::Google::Cloud::WebRisk::V1beta1::ThreatEntryAdditions] - # A set of entries to add to a local threat type's list. - # @!attribute [rw] removals - # @return [::Google::Cloud::WebRisk::V1beta1::ThreatEntryRemovals] - # A set of entries to remove from a local threat type's list. - # This field may be empty. - # @!attribute [rw] new_version_token - # @return [::String] - # The new opaque client version token. - # @!attribute [rw] checksum - # @return [::Google::Cloud::WebRisk::V1beta1::ComputeThreatListDiffResponse::Checksum] - # The expected SHA256 hash of the client state; that is, of the sorted list - # of all hashes present in the database after applying the provided diff. - # If the client state doesn't match the expected state, the client must - # disregard this diff and retry later. - # @!attribute [rw] recommended_next_diff - # @return [::Google::Protobuf::Timestamp] - # The soonest the client should wait before issuing any diff - # request. Querying sooner is unlikely to produce a meaningful diff. - # Waiting longer is acceptable considering the use case. - # If this field is not set clients may update as soon as they want. - class ComputeThreatListDiffResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The expected state of a client's local database. - # @!attribute [rw] sha256 - # @return [::String] - # The SHA256 hash of the client state; that is, of the sorted list of all - # hashes present in the database. - class Checksum - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The type of response sent to the client. - module ResponseType - # Unknown. - RESPONSE_TYPE_UNSPECIFIED = 0 - - # Partial updates are applied to the client's existing local database. - DIFF = 1 - - # Full updates resets the client's entire local database. This means - # that either the client had no state, was seriously out-of-date, - # or the client is believed to be corrupt. - RESET = 2 - end - end - - # Request to check URI entries against threatLists. - # @!attribute [rw] uri - # @return [::String] - # Required. The URI to be checked for matches. - # @!attribute [rw] threat_types - # @return [::Array<::Google::Cloud::WebRisk::V1beta1::ThreatType>] - # Required. The ThreatLists to search in. - class SearchUrisRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # @!attribute [rw] threat - # @return [::Google::Cloud::WebRisk::V1beta1::SearchUrisResponse::ThreatUri] - # The threat list matches. This may be empty if the URI is on no list. - class SearchUrisResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Contains threat information on a matching uri. - # @!attribute [rw] threat_types - # @return [::Array<::Google::Cloud::WebRisk::V1beta1::ThreatType>] - # The ThreatList this threat belongs to. - # @!attribute [rw] expire_time - # @return [::Google::Protobuf::Timestamp] - # The cache lifetime for the returned match. Clients must not cache this - # response past this timestamp to avoid false positives. - class ThreatUri - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Request to return full hashes matched by the provided hash prefixes. - # @!attribute [rw] hash_prefix - # @return [::String] - # A hash prefix, consisting of the most significant 4-32 bytes of a SHA256 - # hash. For JSON requests, this field is base64-encoded. - # @!attribute [rw] threat_types - # @return [::Array<::Google::Cloud::WebRisk::V1beta1::ThreatType>] - # Required. The ThreatLists to search in. - class SearchHashesRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # @!attribute [rw] threats - # @return [::Array<::Google::Cloud::WebRisk::V1beta1::SearchHashesResponse::ThreatHash>] - # The full hashes that matched the requested prefixes. - # The hash will be populated in the key. - # @!attribute [rw] negative_expire_time - # @return [::Google::Protobuf::Timestamp] - # For requested entities that did not match the threat list, how long to - # cache the response until. - class SearchHashesResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Contains threat information on a matching hash. - # @!attribute [rw] threat_types - # @return [::Array<::Google::Cloud::WebRisk::V1beta1::ThreatType>] - # The ThreatList this threat belongs to. - # This must contain at least one entry. - # @!attribute [rw] hash - # @return [::String] - # A 32 byte SHA256 hash. This field is in binary format. For JSON - # requests, hashes are base64-encoded. - # @!attribute [rw] expire_time - # @return [::Google::Protobuf::Timestamp] - # The cache lifetime for the returned match. Clients must not cache this - # response past this timestamp to avoid false positives. - class ThreatHash - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Contains the set of entries to add to a local database. - # May contain a combination of compressed and raw data in a single response. - # @!attribute [rw] raw_hashes - # @return [::Array<::Google::Cloud::WebRisk::V1beta1::RawHashes>] - # The raw SHA256-formatted entries. - # Repeated to allow returning sets of hashes with different prefix sizes. - # @!attribute [rw] rice_hashes - # @return [::Google::Cloud::WebRisk::V1beta1::RiceDeltaEncoding] - # The encoded 4-byte prefixes of SHA256-formatted entries, using a - # Golomb-Rice encoding. The hashes are converted to uint32, sorted in - # ascending order, then delta encoded and stored as encoded_data. - class ThreatEntryAdditions - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Contains the set of entries to remove from a local database. - # @!attribute [rw] raw_indices - # @return [::Google::Cloud::WebRisk::V1beta1::RawIndices] - # The raw removal indices for a local list. - # @!attribute [rw] rice_indices - # @return [::Google::Cloud::WebRisk::V1beta1::RiceDeltaEncoding] - # The encoded local, lexicographically-sorted list indices, using a - # Golomb-Rice encoding. Used for sending compressed removal indices. The - # removal indices (uint32) are sorted in ascending order, then delta encoded - # and stored as encoded_data. - class ThreatEntryRemovals - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A set of raw indices to remove from a local list. - # @!attribute [rw] indices - # @return [::Array<::Integer>] - # The indices to remove from a lexicographically-sorted local list. - class RawIndices - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The uncompressed threat entries in hash format. - # Hashes can be anywhere from 4 to 32 bytes in size. A large majority are 4 - # bytes, but some hashes are lengthened if they collide with the hash of a - # popular URI. - # - # Used for sending ThreatEntryAdditons to clients that do not support - # compression, or when sending non-4-byte hashes to clients that do support - # compression. - # @!attribute [rw] prefix_size - # @return [::Integer] - # The number of bytes for each prefix encoded below. This field can be - # anywhere from 4 (shortest prefix) to 32 (full SHA256 hash). - # @!attribute [rw] raw_hashes - # @return [::String] - # The hashes, in binary format, concatenated into one long string. Hashes are - # sorted in lexicographic order. For JSON API users, hashes are - # base64-encoded. - class RawHashes - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The Rice-Golomb encoded data. Used for sending compressed 4-byte hashes or - # compressed removal indices. - # @!attribute [rw] first_value - # @return [::Integer] - # The offset of the first entry in the encoded data, or, if only a single - # integer was encoded, that single integer's value. If the field is empty or - # missing, assume zero. - # @!attribute [rw] rice_parameter - # @return [::Integer] - # The Golomb-Rice parameter, which is a number between 2 and 28. This field - # is missing (that is, zero) if `num_entries` is zero. - # @!attribute [rw] entry_count - # @return [::Integer] - # The number of entries that are delta encoded in the encoded data. If only a - # single integer was encoded, this will be zero and the single value will be - # stored in `first_value`. - # @!attribute [rw] encoded_data - # @return [::String] - # The encoded deltas that are encoded using the Golomb-Rice coder. - class RiceDeltaEncoding - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The type of threat. This maps dirrectly to the threat list a threat may - # belong to. - module ThreatType - # Unknown. - THREAT_TYPE_UNSPECIFIED = 0 - - # Malware targeting any platform. - MALWARE = 1 - - # Social engineering targeting any platform. - SOCIAL_ENGINEERING = 2 - - # Unwanted software targeting any platform. - UNWANTED_SOFTWARE = 3 - end - - # The ways in which threat entry sets can be compressed. - module CompressionType - # Unknown. - COMPRESSION_TYPE_UNSPECIFIED = 0 - - # Raw, uncompressed data. - RAW = 1 - - # Rice-Golomb encoded data. - RICE = 2 - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-web_risk-v1beta1/proto_docs/google/protobuf/duration.rb b/owl-bot-staging/google-cloud-web_risk-v1beta1/proto_docs/google/protobuf/duration.rb deleted file mode 100644 index ea59f1f91daf..000000000000 --- a/owl-bot-staging/google-cloud-web_risk-v1beta1/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-web_risk-v1beta1/proto_docs/google/protobuf/timestamp.rb b/owl-bot-staging/google-cloud-web_risk-v1beta1/proto_docs/google/protobuf/timestamp.rb deleted file mode 100644 index 74352be9c58c..000000000000 --- a/owl-bot-staging/google-cloud-web_risk-v1beta1/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-web_risk-v1beta1/snippets/Gemfile b/owl-bot-staging/google-cloud-web_risk-v1beta1/snippets/Gemfile deleted file mode 100644 index 9e1e8937a0c4..000000000000 --- a/owl-bot-staging/google-cloud-web_risk-v1beta1/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-web_risk-v1beta1", path: "../" -else - gem "google-cloud-web_risk-v1beta1" -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-web_risk-v1beta1/snippets/snippet_metadata_google.cloud.webrisk.v1beta1.json b/owl-bot-staging/google-cloud-web_risk-v1beta1/snippets/snippet_metadata_google.cloud.webrisk.v1beta1.json deleted file mode 100644 index 5fc454a190f6..000000000000 --- a/owl-bot-staging/google-cloud-web_risk-v1beta1/snippets/snippet_metadata_google.cloud.webrisk.v1beta1.json +++ /dev/null @@ -1,135 +0,0 @@ -{ - "client_library": { - "name": "google-cloud-web_risk-v1beta1", - "version": "", - "language": "RUBY", - "apis": [ - { - "id": "google.cloud.webrisk.v1beta1", - "version": "v1beta1" - } - ] - }, - "snippets": [ - { - "region_tag": "webrisk_v1beta1_generated_WebRiskService_ComputeThreatListDiff_sync", - "title": "Snippet for the compute_threat_list_diff call in the WebRiskService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::WebRisk::V1beta1::WebRiskService::Client#compute_threat_list_diff.", - "file": "web_risk_service/compute_threat_list_diff.rb", - "language": "RUBY", - "client_method": { - "short_name": "compute_threat_list_diff", - "full_name": "::Google::Cloud::WebRisk::V1beta1::WebRiskService::Client#compute_threat_list_diff", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::WebRisk::V1beta1::ComputeThreatListDiffRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::WebRisk::V1beta1::ComputeThreatListDiffResponse", - "client": { - "short_name": "WebRiskService::Client", - "full_name": "::Google::Cloud::WebRisk::V1beta1::WebRiskService::Client" - }, - "method": { - "short_name": "ComputeThreatListDiff", - "full_name": "google.cloud.webrisk.v1beta1.WebRiskServiceV1Beta1.ComputeThreatListDiff", - "service": { - "short_name": "WebRiskService", - "full_name": "google.cloud.webrisk.v1beta1.WebRiskServiceV1Beta1" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "webrisk_v1beta1_generated_WebRiskService_SearchUris_sync", - "title": "Snippet for the search_uris call in the WebRiskService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::WebRisk::V1beta1::WebRiskService::Client#search_uris.", - "file": "web_risk_service/search_uris.rb", - "language": "RUBY", - "client_method": { - "short_name": "search_uris", - "full_name": "::Google::Cloud::WebRisk::V1beta1::WebRiskService::Client#search_uris", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::WebRisk::V1beta1::SearchUrisRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::WebRisk::V1beta1::SearchUrisResponse", - "client": { - "short_name": "WebRiskService::Client", - "full_name": "::Google::Cloud::WebRisk::V1beta1::WebRiskService::Client" - }, - "method": { - "short_name": "SearchUris", - "full_name": "google.cloud.webrisk.v1beta1.WebRiskServiceV1Beta1.SearchUris", - "service": { - "short_name": "WebRiskService", - "full_name": "google.cloud.webrisk.v1beta1.WebRiskServiceV1Beta1" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "webrisk_v1beta1_generated_WebRiskService_SearchHashes_sync", - "title": "Snippet for the search_hashes call in the WebRiskService service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::WebRisk::V1beta1::WebRiskService::Client#search_hashes.", - "file": "web_risk_service/search_hashes.rb", - "language": "RUBY", - "client_method": { - "short_name": "search_hashes", - "full_name": "::Google::Cloud::WebRisk::V1beta1::WebRiskService::Client#search_hashes", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::WebRisk::V1beta1::SearchHashesRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::WebRisk::V1beta1::SearchHashesResponse", - "client": { - "short_name": "WebRiskService::Client", - "full_name": "::Google::Cloud::WebRisk::V1beta1::WebRiskService::Client" - }, - "method": { - "short_name": "SearchHashes", - "full_name": "google.cloud.webrisk.v1beta1.WebRiskServiceV1Beta1.SearchHashes", - "service": { - "short_name": "WebRiskService", - "full_name": "google.cloud.webrisk.v1beta1.WebRiskServiceV1Beta1" - } - } - }, - "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-web_risk-v1beta1/snippets/web_risk_service/compute_threat_list_diff.rb b/owl-bot-staging/google-cloud-web_risk-v1beta1/snippets/web_risk_service/compute_threat_list_diff.rb deleted file mode 100644 index 317d12f0e694..000000000000 --- a/owl-bot-staging/google-cloud-web_risk-v1beta1/snippets/web_risk_service/compute_threat_list_diff.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 webrisk_v1beta1_generated_WebRiskService_ComputeThreatListDiff_sync] -require "google/cloud/web_risk/v1beta1" - -## -# Snippet for the compute_threat_list_diff call in the WebRiskService 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::WebRisk::V1beta1::WebRiskService::Client#compute_threat_list_diff. -# -def compute_threat_list_diff - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::WebRisk::V1beta1::WebRiskService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::WebRisk::V1beta1::ComputeThreatListDiffRequest.new - - # Call the compute_threat_list_diff method. - result = client.compute_threat_list_diff request - - # The returned object is of type Google::Cloud::WebRisk::V1beta1::ComputeThreatListDiffResponse. - p result -end -# [END webrisk_v1beta1_generated_WebRiskService_ComputeThreatListDiff_sync] diff --git a/owl-bot-staging/google-cloud-web_risk-v1beta1/snippets/web_risk_service/search_hashes.rb b/owl-bot-staging/google-cloud-web_risk-v1beta1/snippets/web_risk_service/search_hashes.rb deleted file mode 100644 index 49e9992e8e2a..000000000000 --- a/owl-bot-staging/google-cloud-web_risk-v1beta1/snippets/web_risk_service/search_hashes.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 webrisk_v1beta1_generated_WebRiskService_SearchHashes_sync] -require "google/cloud/web_risk/v1beta1" - -## -# Snippet for the search_hashes call in the WebRiskService 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::WebRisk::V1beta1::WebRiskService::Client#search_hashes. -# -def search_hashes - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::WebRisk::V1beta1::WebRiskService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::WebRisk::V1beta1::SearchHashesRequest.new - - # Call the search_hashes method. - result = client.search_hashes request - - # The returned object is of type Google::Cloud::WebRisk::V1beta1::SearchHashesResponse. - p result -end -# [END webrisk_v1beta1_generated_WebRiskService_SearchHashes_sync] diff --git a/owl-bot-staging/google-cloud-web_risk-v1beta1/snippets/web_risk_service/search_uris.rb b/owl-bot-staging/google-cloud-web_risk-v1beta1/snippets/web_risk_service/search_uris.rb deleted file mode 100644 index 096ea0fa663b..000000000000 --- a/owl-bot-staging/google-cloud-web_risk-v1beta1/snippets/web_risk_service/search_uris.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 webrisk_v1beta1_generated_WebRiskService_SearchUris_sync] -require "google/cloud/web_risk/v1beta1" - -## -# Snippet for the search_uris call in the WebRiskService 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::WebRisk::V1beta1::WebRiskService::Client#search_uris. -# -def search_uris - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::WebRisk::V1beta1::WebRiskService::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::WebRisk::V1beta1::SearchUrisRequest.new - - # Call the search_uris method. - result = client.search_uris request - - # The returned object is of type Google::Cloud::WebRisk::V1beta1::SearchUrisResponse. - p result -end -# [END webrisk_v1beta1_generated_WebRiskService_SearchUris_sync] diff --git a/owl-bot-staging/google-cloud-web_risk-v1beta1/test/google/cloud/web_risk/v1beta1/web_risk_service_rest_test.rb b/owl-bot-staging/google-cloud-web_risk-v1beta1/test/google/cloud/web_risk/v1beta1/web_risk_service_rest_test.rb deleted file mode 100644 index 7c9f01b165dd..000000000000 --- a/owl-bot-staging/google-cloud-web_risk-v1beta1/test/google/cloud/web_risk/v1beta1/web_risk_service_rest_test.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 "helper" -require "gapic/rest" -require "google/cloud/webrisk/v1beta1/webrisk_pb" -require "google/cloud/web_risk/v1beta1/web_risk_service/rest" - - -class ::Google::Cloud::WebRisk::V1beta1::WebRiskService::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_compute_threat_list_diff - # Create test objects. - client_result = ::Google::Cloud::WebRisk::V1beta1::ComputeThreatListDiffResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - threat_type = :THREAT_TYPE_UNSPECIFIED - version_token = "hello world" - constraints = {} - - compute_threat_list_diff_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::WebRisk::V1beta1::WebRiskService::Rest::ServiceStub.stub :transcode_compute_threat_list_diff_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, compute_threat_list_diff_client_stub do - # Create client - client = ::Google::Cloud::WebRisk::V1beta1::WebRiskService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.compute_threat_list_diff({ threat_type: threat_type, version_token: version_token, constraints: constraints }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.compute_threat_list_diff threat_type: threat_type, version_token: version_token, constraints: constraints do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.compute_threat_list_diff ::Google::Cloud::WebRisk::V1beta1::ComputeThreatListDiffRequest.new(threat_type: threat_type, version_token: version_token, constraints: constraints) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.compute_threat_list_diff({ threat_type: threat_type, version_token: version_token, constraints: constraints }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.compute_threat_list_diff(::Google::Cloud::WebRisk::V1beta1::ComputeThreatListDiffRequest.new(threat_type: threat_type, version_token: version_token, constraints: constraints), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, compute_threat_list_diff_client_stub.call_count - end - end - end - - def test_search_uris - # Create test objects. - client_result = ::Google::Cloud::WebRisk::V1beta1::SearchUrisResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - uri = "hello world" - threat_types = [:THREAT_TYPE_UNSPECIFIED] - - search_uris_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::WebRisk::V1beta1::WebRiskService::Rest::ServiceStub.stub :transcode_search_uris_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, search_uris_client_stub do - # Create client - client = ::Google::Cloud::WebRisk::V1beta1::WebRiskService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.search_uris({ uri: uri, threat_types: threat_types }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.search_uris uri: uri, threat_types: threat_types do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.search_uris ::Google::Cloud::WebRisk::V1beta1::SearchUrisRequest.new(uri: uri, threat_types: threat_types) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.search_uris({ uri: uri, threat_types: threat_types }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.search_uris(::Google::Cloud::WebRisk::V1beta1::SearchUrisRequest.new(uri: uri, threat_types: threat_types), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, search_uris_client_stub.call_count - end - end - end - - def test_search_hashes - # Create test objects. - client_result = ::Google::Cloud::WebRisk::V1beta1::SearchHashesResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - hash_prefix = "hello world" - threat_types = [:THREAT_TYPE_UNSPECIFIED] - - search_hashes_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::WebRisk::V1beta1::WebRiskService::Rest::ServiceStub.stub :transcode_search_hashes_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, search_hashes_client_stub do - # Create client - client = ::Google::Cloud::WebRisk::V1beta1::WebRiskService::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.search_hashes({ hash_prefix: hash_prefix, threat_types: threat_types }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.search_hashes hash_prefix: hash_prefix, threat_types: threat_types do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.search_hashes ::Google::Cloud::WebRisk::V1beta1::SearchHashesRequest.new(hash_prefix: hash_prefix, threat_types: threat_types) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.search_hashes({ hash_prefix: hash_prefix, threat_types: threat_types }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.search_hashes(::Google::Cloud::WebRisk::V1beta1::SearchHashesRequest.new(hash_prefix: hash_prefix, threat_types: threat_types), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, search_hashes_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::WebRisk::V1beta1::WebRiskService::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::WebRisk::V1beta1::WebRiskService::Rest::Client::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-web_risk-v1beta1/test/google/cloud/web_risk/v1beta1/web_risk_service_test.rb b/owl-bot-staging/google-cloud-web_risk-v1beta1/test/google/cloud/web_risk/v1beta1/web_risk_service_test.rb deleted file mode 100644 index 51da0e186f5b..000000000000 --- a/owl-bot-staging/google-cloud-web_risk-v1beta1/test/google/cloud/web_risk/v1beta1/web_risk_service_test.rb +++ /dev/null @@ -1,286 +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/webrisk/v1beta1/webrisk_pb" -require "google/cloud/web_risk/v1beta1/web_risk_service" - -class ::Google::Cloud::WebRisk::V1beta1::WebRiskService::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_compute_threat_list_diff - # Create GRPC objects. - grpc_response = ::Google::Cloud::WebRisk::V1beta1::ComputeThreatListDiffResponse.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. - threat_type = :THREAT_TYPE_UNSPECIFIED - version_token = "hello world" - constraints = {} - - compute_threat_list_diff_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :compute_threat_list_diff, name - assert_kind_of ::Google::Cloud::WebRisk::V1beta1::ComputeThreatListDiffRequest, request - assert_equal :THREAT_TYPE_UNSPECIFIED, request["threat_type"] - assert_equal "hello world", request["version_token"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::WebRisk::V1beta1::ComputeThreatListDiffRequest::Constraints), request["constraints"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, compute_threat_list_diff_client_stub do - # Create client - client = ::Google::Cloud::WebRisk::V1beta1::WebRiskService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.compute_threat_list_diff({ threat_type: threat_type, version_token: version_token, constraints: constraints }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.compute_threat_list_diff threat_type: threat_type, version_token: version_token, constraints: constraints do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.compute_threat_list_diff ::Google::Cloud::WebRisk::V1beta1::ComputeThreatListDiffRequest.new(threat_type: threat_type, version_token: version_token, constraints: constraints) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.compute_threat_list_diff({ threat_type: threat_type, version_token: version_token, constraints: constraints }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.compute_threat_list_diff(::Google::Cloud::WebRisk::V1beta1::ComputeThreatListDiffRequest.new(threat_type: threat_type, version_token: version_token, constraints: constraints), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, compute_threat_list_diff_client_stub.call_rpc_count - end - end - - def test_search_uris - # Create GRPC objects. - grpc_response = ::Google::Cloud::WebRisk::V1beta1::SearchUrisResponse.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. - uri = "hello world" - threat_types = [:THREAT_TYPE_UNSPECIFIED] - - search_uris_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :search_uris, name - assert_kind_of ::Google::Cloud::WebRisk::V1beta1::SearchUrisRequest, request - assert_equal "hello world", request["uri"] - assert_equal [:THREAT_TYPE_UNSPECIFIED], request["threat_types"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, search_uris_client_stub do - # Create client - client = ::Google::Cloud::WebRisk::V1beta1::WebRiskService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.search_uris({ uri: uri, threat_types: threat_types }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.search_uris uri: uri, threat_types: threat_types do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.search_uris ::Google::Cloud::WebRisk::V1beta1::SearchUrisRequest.new(uri: uri, threat_types: threat_types) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.search_uris({ uri: uri, threat_types: threat_types }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.search_uris(::Google::Cloud::WebRisk::V1beta1::SearchUrisRequest.new(uri: uri, threat_types: threat_types), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, search_uris_client_stub.call_rpc_count - end - end - - def test_search_hashes - # Create GRPC objects. - grpc_response = ::Google::Cloud::WebRisk::V1beta1::SearchHashesResponse.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. - hash_prefix = "hello world" - threat_types = [:THREAT_TYPE_UNSPECIFIED] - - search_hashes_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :search_hashes, name - assert_kind_of ::Google::Cloud::WebRisk::V1beta1::SearchHashesRequest, request - assert_equal "hello world", request["hash_prefix"] - assert_equal [:THREAT_TYPE_UNSPECIFIED], request["threat_types"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, search_hashes_client_stub do - # Create client - client = ::Google::Cloud::WebRisk::V1beta1::WebRiskService::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.search_hashes({ hash_prefix: hash_prefix, threat_types: threat_types }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.search_hashes hash_prefix: hash_prefix, threat_types: threat_types do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.search_hashes ::Google::Cloud::WebRisk::V1beta1::SearchHashesRequest.new(hash_prefix: hash_prefix, threat_types: threat_types) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.search_hashes({ hash_prefix: hash_prefix, threat_types: threat_types }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.search_hashes(::Google::Cloud::WebRisk::V1beta1::SearchHashesRequest.new(hash_prefix: hash_prefix, threat_types: threat_types), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, search_hashes_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::WebRisk::V1beta1::WebRiskService::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::WebRisk::V1beta1::WebRiskService::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::WebRisk::V1beta1::WebRiskService::Client.new do |config| - config.credentials = creds - end - assert_kind_of ::Google::Cloud::WebRisk::V1beta1::WebRiskService::Client, client - assert_equal creds, client.configure.credentials - end - end -end diff --git a/owl-bot-staging/google-cloud-web_risk-v1beta1/test/helper.rb b/owl-bot-staging/google-cloud-web_risk-v1beta1/test/helper.rb deleted file mode 100644 index 672b337030e7..000000000000 --- a/owl-bot-staging/google-cloud-web_risk-v1beta1/test/helper.rb +++ /dev/null @@ -1,26 +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/mock" -require "minitest/rg" - -require "grpc" - -require "ostruct" diff --git a/owl-bot-staging/google-cloud-web_security_scanner-v1/.gitignore b/owl-bot-staging/google-cloud-web_security_scanner-v1/.gitignore deleted file mode 100644 index 0135b6bc6cfc..000000000000 --- a/owl-bot-staging/google-cloud-web_security_scanner-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-web_security_scanner-v1/.repo-metadata.json b/owl-bot-staging/google-cloud-web_security_scanner-v1/.repo-metadata.json deleted file mode 100644 index ff1da57a74a2..000000000000 --- a/owl-bot-staging/google-cloud-web_security_scanner-v1/.repo-metadata.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "api_id": "websecurityscanner.googleapis.com", - "api_shortname": "websecurityscanner", - "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-web_security_scanner-v1/latest", - "distribution_name": "google-cloud-web_security_scanner-v1", - "is_cloud": true, - "language": "ruby", - "name": "websecurityscanner", - "name_pretty": "Web Security Scanner V1 API", - "product_documentation": "https://cloud.google.com/security-command-center/docs/concepts-web-security-scanner-overview/", - "release_level": "unreleased", - "repo": "googleapis/google-cloud-ruby", - "requires_billing": true, - "ruby-cloud-description": "Web Security Scanner scans your Compute and App Engine apps for common web vulnerabilities. Note that google-cloud-web_security_scanner-v1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-web_security_scanner instead. See the readme for more details.", - "ruby-cloud-env-prefix": "WEB_SECURITY_SCANNER", - "ruby-cloud-product-url": "https://cloud.google.com/security-command-center/docs/concepts-web-security-scanner-overview/", - "library_type": "GAPIC_AUTO" -} diff --git a/owl-bot-staging/google-cloud-web_security_scanner-v1/.rubocop.yml b/owl-bot-staging/google-cloud-web_security_scanner-v1/.rubocop.yml deleted file mode 100644 index d1aa57a60d61..000000000000 --- a/owl-bot-staging/google-cloud-web_security_scanner-v1/.rubocop.yml +++ /dev/null @@ -1,33 +0,0 @@ -inherit_gem: - google-style: google-style.yml - -AllCops: - Exclude: - - "google-cloud-web_security_scanner-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-web_security_scanner-v1.rb" diff --git a/owl-bot-staging/google-cloud-web_security_scanner-v1/.toys.rb b/owl-bot-staging/google-cloud-web_security_scanner-v1/.toys.rb deleted file mode 100644 index 177e22456e8a..000000000000 --- a/owl-bot-staging/google-cloud-web_security_scanner-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-web_security_scanner-v1/.yardopts b/owl-bot-staging/google-cloud-web_security_scanner-v1/.yardopts deleted file mode 100644 index 826dfac587d4..000000000000 --- a/owl-bot-staging/google-cloud-web_security_scanner-v1/.yardopts +++ /dev/null @@ -1,12 +0,0 @@ ---no-private ---title="Web Security Scanner 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-web_security_scanner-v1/AUTHENTICATION.md b/owl-bot-staging/google-cloud-web_security_scanner-v1/AUTHENTICATION.md deleted file mode 100644 index 840d2d274ade..000000000000 --- a/owl-bot-staging/google-cloud-web_security_scanner-v1/AUTHENTICATION.md +++ /dev/null @@ -1,122 +0,0 @@ -# Authentication - -The recommended way to authenticate to the google-cloud-web_security_scanner-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-web_security_scanner-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/web_security_scanner/v1" - -client = ::Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client.new do |config| - config.credentials = "path/to/credentialfile.json" -end -``` - -To configure a credentials file globally for all clients: - -```ruby -require "google/cloud/web_security_scanner/v1" - -::Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client.configure do |config| - config.credentials = "path/to/credentialfile.json" -end - -client = ::Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::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-web_security_scanner-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/web_security_scanner/v1" - -ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" - -client = ::Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::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-web_security_scanner-v1/CHANGELOG.md b/owl-bot-staging/google-cloud-web_security_scanner-v1/CHANGELOG.md deleted file mode 100644 index f88957a62ba2..000000000000 --- a/owl-bot-staging/google-cloud-web_security_scanner-v1/CHANGELOG.md +++ /dev/null @@ -1,2 +0,0 @@ -# Release History - diff --git a/owl-bot-staging/google-cloud-web_security_scanner-v1/Gemfile b/owl-bot-staging/google-cloud-web_security_scanner-v1/Gemfile deleted file mode 100644 index 1d08558908d8..000000000000 --- a/owl-bot-staging/google-cloud-web_security_scanner-v1/Gemfile +++ /dev/null @@ -1,14 +0,0 @@ -source "https://rubygems.org" - -gemspec - -gem "google-style", "~> 1.32.0" -gem "irb", "~> 1.17" -gem "minitest", "~> 6.0.2" -gem "minitest-focus", "~> 1.4" -gem "minitest-mock", "~> 5.27" -gem "minitest-rg", "~> 5.3" -gem "ostruct", "~> 0.5.5" -gem "rake", ">= 13.0" -gem "redcarpet", "~> 3.6" -gem "yard", "~> 0.9" diff --git a/owl-bot-staging/google-cloud-web_security_scanner-v1/LICENSE.md b/owl-bot-staging/google-cloud-web_security_scanner-v1/LICENSE.md deleted file mode 100644 index c261857ba6ad..000000000000 --- a/owl-bot-staging/google-cloud-web_security_scanner-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-web_security_scanner-v1/README.md b/owl-bot-staging/google-cloud-web_security_scanner-v1/README.md deleted file mode 100644 index 58219b923452..000000000000 --- a/owl-bot-staging/google-cloud-web_security_scanner-v1/README.md +++ /dev/null @@ -1,154 +0,0 @@ -# Ruby Client for the Web Security Scanner V1 API - -Scans your Compute and App Engine apps for common web vulnerabilities. - -Web Security Scanner scans your Compute and App Engine apps for common web vulnerabilities. - -https://github.com/googleapis/google-cloud-ruby - -This gem is a _versioned_ client. It provides basic client classes for a -specific version of the Web Security Scanner V1 API. Most users should consider using -the main client gem, -[google-cloud-web_security_scanner](https://rubygems.org/gems/google-cloud-web_security_scanner). -See the section below titled *Which client should I use?* for more information. - -## Installation - -``` -$ gem install google-cloud-web_security_scanner-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/websecurityscanner.googleapis.com) -1. [Set up authentication.](AUTHENTICATION.md) - -## Quick Start - -```ruby -require "google/cloud/web_security_scanner/v1" - -client = ::Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client.new -request = ::Google::Cloud::WebSecurityScanner::V1::CreateScanConfigRequest.new # (request fields as keyword arguments...) -response = client.create_scan_config request -``` - -View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-web_security_scanner-v1/latest) -for class and method documentation. - -See also the [Product Documentation](https://cloud.google.com/security-command-center/docs/concepts-web-security-scanner-overview/) -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/web_security_scanner/v1" -require "logger" - -client = ::Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::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-web_security_scanner`, -and lower-level _versioned_ client libraries with names such as -`google-cloud-web_security_scanner-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-web_security_scanner`. -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-web_security_scanner-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-web_security_scanner-v1/Rakefile b/owl-bot-staging/google-cloud-web_security_scanner-v1/Rakefile deleted file mode 100644 index 4216b0dd6f74..000000000000 --- a/owl-bot-staging/google-cloud-web_security_scanner-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-web_security_scanner-v1 acceptance tests." -task :acceptance, :project, :keyfile do |t, args| - project = args[:project] - project ||= - ENV["WEB_SECURITY_SCANNER_TEST_PROJECT"] || - ENV["GCLOUD_TEST_PROJECT"] - keyfile = args[:keyfile] - keyfile ||= - ENV["WEB_SECURITY_SCANNER_TEST_KEYFILE"] || - ENV["GCLOUD_TEST_KEYFILE"] - if keyfile - keyfile = File.read keyfile - else - keyfile ||= - ENV["WEB_SECURITY_SCANNER_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 WEB_SECURITY_SCANNER_TEST_PROJECT=test123 WEB_SECURITY_SCANNER_TEST_KEYFILE=/path/to/keyfile.json rake acceptance" - end - require "google/cloud/web_security_scanner/v1/web_security_scanner/credentials" - ::Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Credentials.env_vars.each do |path| - ENV[path] = nil - end - ENV["WEB_SECURITY_SCANNER_PROJECT"] = project - ENV["WEB_SECURITY_SCANNER_TEST_PROJECT"] = project - ENV["WEB_SECURITY_SCANNER_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-web_security_scanner-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-web_security_scanner-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-web_security_scanner-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-web_security_scanner-v1 gem does not have doctest tests." -end - -desc "Run the CI build" -task :ci do - header "BUILDING google-cloud-web_security_scanner-v1" - header "google-cloud-web_security_scanner-v1 rubocop", "*" - Rake::Task[:rubocop].invoke - header "google-cloud-web_security_scanner-v1 yard", "*" - Rake::Task[:yard].invoke - header "google-cloud-web_security_scanner-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-web_security_scanner-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-web_security_scanner-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-web_security_scanner-v1/gapic_metadata.json b/owl-bot-staging/google-cloud-web_security_scanner-v1/gapic_metadata.json deleted file mode 100644 index bc19a64a2036..000000000000 --- a/owl-bot-staging/google-cloud-web_security_scanner-v1/gapic_metadata.json +++ /dev/null @@ -1,83 +0,0 @@ -{ - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", - "language": "ruby", - "protoPackage": "google.cloud.websecurityscanner.v1", - "libraryPackage": "::Google::Cloud::WebSecurityScanner::V1", - "services": { - "WebSecurityScanner": { - "clients": { - "grpc": { - "libraryClient": "::Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client", - "rpcs": { - "CreateScanConfig": { - "methods": [ - "create_scan_config" - ] - }, - "DeleteScanConfig": { - "methods": [ - "delete_scan_config" - ] - }, - "GetScanConfig": { - "methods": [ - "get_scan_config" - ] - }, - "ListScanConfigs": { - "methods": [ - "list_scan_configs" - ] - }, - "UpdateScanConfig": { - "methods": [ - "update_scan_config" - ] - }, - "StartScanRun": { - "methods": [ - "start_scan_run" - ] - }, - "GetScanRun": { - "methods": [ - "get_scan_run" - ] - }, - "ListScanRuns": { - "methods": [ - "list_scan_runs" - ] - }, - "StopScanRun": { - "methods": [ - "stop_scan_run" - ] - }, - "ListCrawledUrls": { - "methods": [ - "list_crawled_urls" - ] - }, - "GetFinding": { - "methods": [ - "get_finding" - ] - }, - "ListFindings": { - "methods": [ - "list_findings" - ] - }, - "ListFindingTypeStats": { - "methods": [ - "list_finding_type_stats" - ] - } - } - } - } - } - } -} diff --git a/owl-bot-staging/google-cloud-web_security_scanner-v1/google-cloud-web_security_scanner-v1.gemspec b/owl-bot-staging/google-cloud-web_security_scanner-v1/google-cloud-web_security_scanner-v1.gemspec deleted file mode 100644 index 6040a958dbd4..000000000000 --- a/owl-bot-staging/google-cloud-web_security_scanner-v1/google-cloud-web_security_scanner-v1.gemspec +++ /dev/null @@ -1,28 +0,0 @@ -# -*- ruby -*- -# encoding: utf-8 - -require File.expand_path("lib/google/cloud/web_security_scanner/v1/version", __dir__) - -Gem::Specification.new do |gem| - gem.name = "google-cloud-web_security_scanner-v1" - gem.version = Google::Cloud::WebSecurityScanner::V1::VERSION - - gem.authors = ["Google LLC"] - gem.email = "googleapis-packages@google.com" - gem.description = "Web Security Scanner scans your Compute and App Engine apps for common web vulnerabilities. Note that google-cloud-web_security_scanner-v1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-web_security_scanner instead. See the readme for more details." - gem.summary = "Scans your Compute and App Engine apps for common web vulnerabilities." - 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.2" - - gem.add_dependency "gapic-common", "~> 1.2" - gem.add_dependency "google-cloud-errors", "~> 1.0" -end diff --git a/owl-bot-staging/google-cloud-web_security_scanner-v1/lib/google-cloud-web_security_scanner-v1.rb b/owl-bot-staging/google-cloud-web_security_scanner-v1/lib/google-cloud-web_security_scanner-v1.rb deleted file mode 100644 index 364764ba9da8..000000000000 --- a/owl-bot-staging/google-cloud-web_security_scanner-v1/lib/google-cloud-web_security_scanner-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/web_security_scanner/v1" diff --git a/owl-bot-staging/google-cloud-web_security_scanner-v1/lib/google/cloud/web_security_scanner/v1.rb b/owl-bot-staging/google-cloud-web_security_scanner-v1/lib/google/cloud/web_security_scanner/v1.rb deleted file mode 100644 index 4ddf0087078f..000000000000 --- a/owl-bot-staging/google-cloud-web_security_scanner-v1/lib/google/cloud/web_security_scanner/v1.rb +++ /dev/null @@ -1,45 +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/web_security_scanner/v1/web_security_scanner" -require "google/cloud/web_security_scanner/v1/version" - -module Google - module Cloud - module WebSecurityScanner - ## - # API client module. - # - # @example Load this package, including all its services, and instantiate a gRPC client - # - # require "google/cloud/web_security_scanner/v1" - # client = ::Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client.new - # - # @example Load this package, including all its services, and instantiate a REST client - # - # require "google/cloud/web_security_scanner/v1" - # client = ::Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Rest::Client.new - # - module V1 - end - end - end -end - -helper_path = ::File.join __dir__, "v1", "_helpers.rb" -require "google/cloud/web_security_scanner/v1/_helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-web_security_scanner-v1/lib/google/cloud/web_security_scanner/v1/rest.rb b/owl-bot-staging/google-cloud-web_security_scanner-v1/lib/google/cloud/web_security_scanner/v1/rest.rb deleted file mode 100644 index 7b9965314561..000000000000 --- a/owl-bot-staging/google-cloud-web_security_scanner-v1/lib/google/cloud/web_security_scanner/v1/rest.rb +++ /dev/null @@ -1,37 +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/web_security_scanner/v1/web_security_scanner/rest" -require "google/cloud/web_security_scanner/v1/version" - -module Google - module Cloud - module WebSecurityScanner - ## - # To load just the REST part of this package, including all its services, and instantiate a REST client: - # - # @example - # - # require "google/cloud/web_security_scanner/v1/rest" - # client = ::Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Rest::Client.new - # - module V1 - end - end - end -end diff --git a/owl-bot-staging/google-cloud-web_security_scanner-v1/lib/google/cloud/web_security_scanner/v1/version.rb b/owl-bot-staging/google-cloud-web_security_scanner-v1/lib/google/cloud/web_security_scanner/v1/version.rb deleted file mode 100644 index d7cb02f682fa..000000000000 --- a/owl-bot-staging/google-cloud-web_security_scanner-v1/lib/google/cloud/web_security_scanner/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 WebSecurityScanner - module V1 - VERSION = "0.0.1" - end - end - end -end diff --git a/owl-bot-staging/google-cloud-web_security_scanner-v1/lib/google/cloud/web_security_scanner/v1/web_security_scanner.rb b/owl-bot-staging/google-cloud-web_security_scanner-v1/lib/google/cloud/web_security_scanner/v1/web_security_scanner.rb deleted file mode 100644 index 2f4a9b948057..000000000000 --- a/owl-bot-staging/google-cloud-web_security_scanner-v1/lib/google/cloud/web_security_scanner/v1/web_security_scanner.rb +++ /dev/null @@ -1,56 +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/web_security_scanner/v1/version" - -require "google/cloud/web_security_scanner/v1/web_security_scanner/credentials" -require "google/cloud/web_security_scanner/v1/web_security_scanner/client" -require "google/cloud/web_security_scanner/v1/web_security_scanner/rest" - -module Google - module Cloud - module WebSecurityScanner - module V1 - ## - # Web Security Scanner Service identifies security vulnerabilities in web - # applications hosted on Google Cloud. It crawls your application, and - # attempts to exercise as many user inputs and event handlers as possible. - # - # @example Load this service and instantiate a gRPC client - # - # require "google/cloud/web_security_scanner/v1/web_security_scanner" - # client = ::Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client.new - # - # @example Load this service and instantiate a REST client - # - # require "google/cloud/web_security_scanner/v1/web_security_scanner/rest" - # client = ::Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Rest::Client.new - # - module WebSecurityScanner - end - end - end - end -end - -helper_path = ::File.join __dir__, "web_security_scanner", "helpers.rb" -require "google/cloud/web_security_scanner/v1/web_security_scanner/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-web_security_scanner-v1/lib/google/cloud/web_security_scanner/v1/web_security_scanner/client.rb b/owl-bot-staging/google-cloud-web_security_scanner-v1/lib/google/cloud/web_security_scanner/v1/web_security_scanner/client.rb deleted file mode 100644 index ff36744057f1..000000000000 --- a/owl-bot-staging/google-cloud-web_security_scanner-v1/lib/google/cloud/web_security_scanner/v1/web_security_scanner/client.rb +++ /dev/null @@ -1,1719 +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/websecurityscanner/v1/web_security_scanner_pb" - -module Google - module Cloud - module WebSecurityScanner - module V1 - module WebSecurityScanner - ## - # Client for the WebSecurityScanner service. - # - # Web Security Scanner Service identifies security vulnerabilities in web - # applications hosted on Google Cloud. It crawls your application, and - # attempts to exercise as many user inputs and event handlers as possible. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "websecurityscanner.$UNIVERSE_DOMAIN$" - - # @private - attr_reader :web_security_scanner_stub - - ## - # Configure the WebSecurityScanner Client class. - # - # See {::Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all WebSecurityScanner clients - # ::Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::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", "WebSecurityScanner", "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_scan_config.timeout = 600.0 - - default_config.rpcs.delete_scan_config.timeout = 600.0 - default_config.rpcs.delete_scan_config.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.get_scan_config.timeout = 600.0 - default_config.rpcs.get_scan_config.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.list_scan_configs.timeout = 600.0 - default_config.rpcs.list_scan_configs.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.update_scan_config.timeout = 600.0 - - default_config.rpcs.start_scan_run.timeout = 600.0 - - default_config.rpcs.get_scan_run.timeout = 600.0 - default_config.rpcs.get_scan_run.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.list_scan_runs.timeout = 600.0 - default_config.rpcs.list_scan_runs.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.stop_scan_run.timeout = 600.0 - - default_config.rpcs.list_crawled_urls.timeout = 600.0 - default_config.rpcs.list_crawled_urls.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.get_finding.timeout = 600.0 - default_config.rpcs.get_finding.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.list_findings.timeout = 600.0 - default_config.rpcs.list_findings.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.list_finding_type_stats.timeout = 600.0 - default_config.rpcs.list_finding_type_stats.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the WebSecurityScanner 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::WebSecurityScanner::V1::WebSecurityScanner::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 - @web_security_scanner_stub.universe_domain - end - - ## - # Create a new WebSecurityScanner client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the WebSecurityScanner 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/websecurityscanner/v1/web_security_scanner_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 - - @web_security_scanner_stub = ::Gapic::ServiceStub.new( - ::Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::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 - ) - - @web_security_scanner_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 - end - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @web_security_scanner_stub.logger - end - - # Service calls - - ## - # Creates a new ScanConfig. - # - # @overload create_scan_config(request, options = nil) - # Pass arguments to `create_scan_config` via a request object, either of type - # {::Google::Cloud::WebSecurityScanner::V1::CreateScanConfigRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::WebSecurityScanner::V1::CreateScanConfigRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_scan_config(parent: nil, scan_config: nil) - # Pass arguments to `create_scan_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. The parent resource name where the scan is created, which should be a - # project resource name in the format 'projects/\\{projectId}'. - # @param scan_config [::Google::Cloud::WebSecurityScanner::V1::ScanConfig, ::Hash] - # Required. The ScanConfig to be created. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::WebSecurityScanner::V1::ScanConfig] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::WebSecurityScanner::V1::ScanConfig] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/web_security_scanner/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::WebSecurityScanner::V1::CreateScanConfigRequest.new - # - # # Call the create_scan_config method. - # result = client.create_scan_config request - # - # # The returned object is of type Google::Cloud::WebSecurityScanner::V1::ScanConfig. - # p result - # - def create_scan_config request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::WebSecurityScanner::V1::CreateScanConfigRequest - - # Converts hash 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_scan_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::WebSecurityScanner::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_scan_config.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_scan_config.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @web_security_scanner_stub.call_rpc :create_scan_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 - - ## - # Deletes an existing ScanConfig and its child resources. - # - # @overload delete_scan_config(request, options = nil) - # Pass arguments to `delete_scan_config` via a request object, either of type - # {::Google::Cloud::WebSecurityScanner::V1::DeleteScanConfigRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::WebSecurityScanner::V1::DeleteScanConfigRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_scan_config(name: nil) - # Pass arguments to `delete_scan_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 resource name of the ScanConfig to be deleted. The name follows the - # format of 'projects/\\{projectId}/scanConfigs/\\{scanConfigId}'. - # - # @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/web_security_scanner/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::WebSecurityScanner::V1::DeleteScanConfigRequest.new - # - # # Call the delete_scan_config method. - # result = client.delete_scan_config request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_scan_config request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::WebSecurityScanner::V1::DeleteScanConfigRequest - - # Converts hash 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_scan_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::WebSecurityScanner::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_scan_config.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_scan_config.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @web_security_scanner_stub.call_rpc :delete_scan_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 - - ## - # Gets a ScanConfig. - # - # @overload get_scan_config(request, options = nil) - # Pass arguments to `get_scan_config` via a request object, either of type - # {::Google::Cloud::WebSecurityScanner::V1::GetScanConfigRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::WebSecurityScanner::V1::GetScanConfigRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_scan_config(name: nil) - # Pass arguments to `get_scan_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 resource name of the ScanConfig to be returned. The name follows the - # format of 'projects/\\{projectId}/scanConfigs/\\{scanConfigId}'. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::WebSecurityScanner::V1::ScanConfig] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::WebSecurityScanner::V1::ScanConfig] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/web_security_scanner/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::WebSecurityScanner::V1::GetScanConfigRequest.new - # - # # Call the get_scan_config method. - # result = client.get_scan_config request - # - # # The returned object is of type Google::Cloud::WebSecurityScanner::V1::ScanConfig. - # p result - # - def get_scan_config request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::WebSecurityScanner::V1::GetScanConfigRequest - - # Converts hash 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_scan_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::WebSecurityScanner::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_scan_config.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_scan_config.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @web_security_scanner_stub.call_rpc :get_scan_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 - - ## - # Lists ScanConfigs under a given project. - # - # @overload list_scan_configs(request, options = nil) - # Pass arguments to `list_scan_configs` via a request object, either of type - # {::Google::Cloud::WebSecurityScanner::V1::ListScanConfigsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::WebSecurityScanner::V1::ListScanConfigsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_scan_configs(parent: nil, page_token: nil, page_size: nil) - # Pass arguments to `list_scan_configs` via keyword arguments. Note that at - # least one keyword argument is 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 parent resource name, which should be a project resource name in the - # format 'projects/\\{projectId}'. - # @param page_token [::String] - # A token identifying a page of results to be returned. This should be a - # `next_page_token` value returned from a previous List request. - # If unspecified, the first page of results is returned. - # @param page_size [::Integer] - # The maximum number of ScanConfigs to return, can be limited by server. - # If not specified or not positive, the implementation will select a - # reasonable value. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::WebSecurityScanner::V1::ScanConfig>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::WebSecurityScanner::V1::ScanConfig>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/web_security_scanner/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::WebSecurityScanner::V1::ListScanConfigsRequest.new - # - # # Call the list_scan_configs method. - # result = client.list_scan_configs 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::WebSecurityScanner::V1::ScanConfig. - # p item - # end - # - def list_scan_configs request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::WebSecurityScanner::V1::ListScanConfigsRequest - - # Converts hash 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_scan_configs.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::WebSecurityScanner::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_scan_configs.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_scan_configs.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @web_security_scanner_stub.call_rpc :list_scan_configs, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @web_security_scanner_stub, :list_scan_configs, 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 - - ## - # Updates a ScanConfig. This method support partial update of a ScanConfig. - # - # @overload update_scan_config(request, options = nil) - # Pass arguments to `update_scan_config` via a request object, either of type - # {::Google::Cloud::WebSecurityScanner::V1::UpdateScanConfigRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::WebSecurityScanner::V1::UpdateScanConfigRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_scan_config(scan_config: nil, update_mask: nil) - # Pass arguments to `update_scan_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 scan_config [::Google::Cloud::WebSecurityScanner::V1::ScanConfig, ::Hash] - # Required. The ScanConfig to be updated. The name field must be set to identify the - # resource to be updated. The values of fields not covered by the mask - # will be ignored. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Required. The update mask applies to the resource. For the `FieldMask` definition, - # see - # https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::WebSecurityScanner::V1::ScanConfig] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::WebSecurityScanner::V1::ScanConfig] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/web_security_scanner/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::WebSecurityScanner::V1::UpdateScanConfigRequest.new - # - # # Call the update_scan_config method. - # result = client.update_scan_config request - # - # # The returned object is of type Google::Cloud::WebSecurityScanner::V1::ScanConfig. - # p result - # - def update_scan_config request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::WebSecurityScanner::V1::UpdateScanConfigRequest - - # Converts hash 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_scan_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::WebSecurityScanner::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.scan_config&.name - header_params["scan_config.name"] = request.scan_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_scan_config.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_scan_config.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @web_security_scanner_stub.call_rpc :update_scan_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 - - ## - # Start a ScanRun according to the given ScanConfig. - # - # @overload start_scan_run(request, options = nil) - # Pass arguments to `start_scan_run` via a request object, either of type - # {::Google::Cloud::WebSecurityScanner::V1::StartScanRunRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::WebSecurityScanner::V1::StartScanRunRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload start_scan_run(name: nil) - # Pass arguments to `start_scan_run` via keyword arguments. Note that at - # least one keyword argument is 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 ScanConfig to be used. The name follows the - # format of 'projects/\\{projectId}/scanConfigs/\\{scanConfigId}'. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::WebSecurityScanner::V1::ScanRun] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::WebSecurityScanner::V1::ScanRun] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/web_security_scanner/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::WebSecurityScanner::V1::StartScanRunRequest.new - # - # # Call the start_scan_run method. - # result = client.start_scan_run request - # - # # The returned object is of type Google::Cloud::WebSecurityScanner::V1::ScanRun. - # p result - # - def start_scan_run request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::WebSecurityScanner::V1::StartScanRunRequest - - # Converts hash 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.start_scan_run.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::WebSecurityScanner::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.start_scan_run.timeout, - metadata: metadata, - retry_policy: @config.rpcs.start_scan_run.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @web_security_scanner_stub.call_rpc :start_scan_run, 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 - - ## - # Gets a ScanRun. - # - # @overload get_scan_run(request, options = nil) - # Pass arguments to `get_scan_run` via a request object, either of type - # {::Google::Cloud::WebSecurityScanner::V1::GetScanRunRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::WebSecurityScanner::V1::GetScanRunRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_scan_run(name: nil) - # Pass arguments to `get_scan_run` via keyword arguments. Note that at - # least one keyword argument is 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 ScanRun to be returned. The name follows the - # format of - # 'projects/\\{projectId}/scanConfigs/\\{scanConfigId}/scanRuns/\\{scanRunId}'. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::WebSecurityScanner::V1::ScanRun] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::WebSecurityScanner::V1::ScanRun] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/web_security_scanner/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::WebSecurityScanner::V1::GetScanRunRequest.new - # - # # Call the get_scan_run method. - # result = client.get_scan_run request - # - # # The returned object is of type Google::Cloud::WebSecurityScanner::V1::ScanRun. - # p result - # - def get_scan_run request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::WebSecurityScanner::V1::GetScanRunRequest - - # Converts hash 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_scan_run.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::WebSecurityScanner::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_scan_run.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_scan_run.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @web_security_scanner_stub.call_rpc :get_scan_run, 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 ScanRuns under a given ScanConfig, in descending order of ScanRun - # stop time. - # - # @overload list_scan_runs(request, options = nil) - # Pass arguments to `list_scan_runs` via a request object, either of type - # {::Google::Cloud::WebSecurityScanner::V1::ListScanRunsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::WebSecurityScanner::V1::ListScanRunsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_scan_runs(parent: nil, page_token: nil, page_size: nil) - # Pass arguments to `list_scan_runs` via keyword arguments. Note that at - # least one keyword argument is 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 parent resource name, which should be a scan resource name in the - # format 'projects/\\{projectId}/scanConfigs/\\{scanConfigId}'. - # @param page_token [::String] - # A token identifying a page of results to be returned. This should be a - # `next_page_token` value returned from a previous List request. - # If unspecified, the first page of results is returned. - # @param page_size [::Integer] - # The maximum number of ScanRuns to return, can be limited by server. - # If not specified or not positive, the implementation will select a - # reasonable value. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::WebSecurityScanner::V1::ScanRun>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::WebSecurityScanner::V1::ScanRun>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/web_security_scanner/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::WebSecurityScanner::V1::ListScanRunsRequest.new - # - # # Call the list_scan_runs method. - # result = client.list_scan_runs 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::WebSecurityScanner::V1::ScanRun. - # p item - # end - # - def list_scan_runs request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::WebSecurityScanner::V1::ListScanRunsRequest - - # Converts hash 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_scan_runs.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::WebSecurityScanner::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_scan_runs.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_scan_runs.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @web_security_scanner_stub.call_rpc :list_scan_runs, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @web_security_scanner_stub, :list_scan_runs, 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 - - ## - # Stops a ScanRun. The stopped ScanRun is returned. - # - # @overload stop_scan_run(request, options = nil) - # Pass arguments to `stop_scan_run` via a request object, either of type - # {::Google::Cloud::WebSecurityScanner::V1::StopScanRunRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::WebSecurityScanner::V1::StopScanRunRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload stop_scan_run(name: nil) - # Pass arguments to `stop_scan_run` via keyword arguments. Note that at - # least one keyword argument is 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 ScanRun to be stopped. The name follows the - # format of - # 'projects/\\{projectId}/scanConfigs/\\{scanConfigId}/scanRuns/\\{scanRunId}'. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::WebSecurityScanner::V1::ScanRun] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::WebSecurityScanner::V1::ScanRun] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/web_security_scanner/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::WebSecurityScanner::V1::StopScanRunRequest.new - # - # # Call the stop_scan_run method. - # result = client.stop_scan_run request - # - # # The returned object is of type Google::Cloud::WebSecurityScanner::V1::ScanRun. - # p result - # - def stop_scan_run request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::WebSecurityScanner::V1::StopScanRunRequest - - # Converts hash 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.stop_scan_run.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::WebSecurityScanner::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.stop_scan_run.timeout, - metadata: metadata, - retry_policy: @config.rpcs.stop_scan_run.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @web_security_scanner_stub.call_rpc :stop_scan_run, 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 - - ## - # List CrawledUrls under a given ScanRun. - # - # @overload list_crawled_urls(request, options = nil) - # Pass arguments to `list_crawled_urls` via a request object, either of type - # {::Google::Cloud::WebSecurityScanner::V1::ListCrawledUrlsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::WebSecurityScanner::V1::ListCrawledUrlsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_crawled_urls(parent: nil, page_token: nil, page_size: nil) - # Pass arguments to `list_crawled_urls` via keyword arguments. Note that at - # least one keyword argument is 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 parent resource name, which should be a scan run resource name in the - # format - # 'projects/\\{projectId}/scanConfigs/\\{scanConfigId}/scanRuns/\\{scanRunId}'. - # @param page_token [::String] - # A token identifying a page of results to be returned. This should be a - # `next_page_token` value returned from a previous List request. - # If unspecified, the first page of results is returned. - # @param page_size [::Integer] - # The maximum number of CrawledUrls to return, can be limited by server. - # If not specified or not positive, the implementation will select a - # reasonable value. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::WebSecurityScanner::V1::CrawledUrl>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::WebSecurityScanner::V1::CrawledUrl>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/web_security_scanner/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::WebSecurityScanner::V1::ListCrawledUrlsRequest.new - # - # # Call the list_crawled_urls method. - # result = client.list_crawled_urls 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::WebSecurityScanner::V1::CrawledUrl. - # p item - # end - # - def list_crawled_urls request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::WebSecurityScanner::V1::ListCrawledUrlsRequest - - # Converts hash 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_crawled_urls.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::WebSecurityScanner::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_crawled_urls.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_crawled_urls.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @web_security_scanner_stub.call_rpc :list_crawled_urls, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @web_security_scanner_stub, :list_crawled_urls, 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 - - ## - # Gets a Finding. - # - # @overload get_finding(request, options = nil) - # Pass arguments to `get_finding` via a request object, either of type - # {::Google::Cloud::WebSecurityScanner::V1::GetFindingRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::WebSecurityScanner::V1::GetFindingRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_finding(name: nil) - # Pass arguments to `get_finding` via keyword arguments. Note that at - # least one keyword argument is 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 Finding to be returned. The name follows the - # format of - # 'projects/\\{projectId}/scanConfigs/\\{scanConfigId}/scanRuns/\\{scanRunId}/findings/\\{findingId}'. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::WebSecurityScanner::V1::Finding] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::WebSecurityScanner::V1::Finding] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/web_security_scanner/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::WebSecurityScanner::V1::GetFindingRequest.new - # - # # Call the get_finding method. - # result = client.get_finding request - # - # # The returned object is of type Google::Cloud::WebSecurityScanner::V1::Finding. - # p result - # - def get_finding request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::WebSecurityScanner::V1::GetFindingRequest - - # Converts hash 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_finding.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::WebSecurityScanner::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_finding.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_finding.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @web_security_scanner_stub.call_rpc :get_finding, 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 - - ## - # List Findings under a given ScanRun. - # - # @overload list_findings(request, options = nil) - # Pass arguments to `list_findings` via a request object, either of type - # {::Google::Cloud::WebSecurityScanner::V1::ListFindingsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::WebSecurityScanner::V1::ListFindingsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_findings(parent: nil, filter: nil, page_token: nil, page_size: nil) - # Pass arguments to `list_findings` via keyword arguments. Note that at - # least one keyword argument is 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 parent resource name, which should be a scan run resource name in the - # format - # 'projects/\\{projectId}/scanConfigs/\\{scanConfigId}/scanRuns/\\{scanRunId}'. - # @param filter [::String] - # The filter expression. The expression must be in the format: - # . - # Supported field: 'finding_type'. - # Supported operator: '='. - # @param page_token [::String] - # A token identifying a page of results to be returned. This should be a - # `next_page_token` value returned from a previous List request. - # If unspecified, the first page of results is returned. - # @param page_size [::Integer] - # The maximum number of Findings to return, can be limited by server. - # If not specified or not positive, the implementation will select a - # reasonable value. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::WebSecurityScanner::V1::Finding>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::WebSecurityScanner::V1::Finding>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/web_security_scanner/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::WebSecurityScanner::V1::ListFindingsRequest.new - # - # # Call the list_findings method. - # result = client.list_findings 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::WebSecurityScanner::V1::Finding. - # p item - # end - # - def list_findings request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::WebSecurityScanner::V1::ListFindingsRequest - - # Converts hash 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_findings.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::WebSecurityScanner::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_findings.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_findings.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @web_security_scanner_stub.call_rpc :list_findings, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @web_security_scanner_stub, :list_findings, 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 - - ## - # List all FindingTypeStats under a given ScanRun. - # - # @overload list_finding_type_stats(request, options = nil) - # Pass arguments to `list_finding_type_stats` via a request object, either of type - # {::Google::Cloud::WebSecurityScanner::V1::ListFindingTypeStatsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::WebSecurityScanner::V1::ListFindingTypeStatsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_finding_type_stats(parent: nil) - # Pass arguments to `list_finding_type_stats` via keyword arguments. Note that at - # least one keyword argument is 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 parent resource name, which should be a scan run resource name in the - # format - # 'projects/\\{projectId}/scanConfigs/\\{scanConfigId}/scanRuns/\\{scanRunId}'. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::WebSecurityScanner::V1::ListFindingTypeStatsResponse] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::WebSecurityScanner::V1::ListFindingTypeStatsResponse] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/web_security_scanner/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::WebSecurityScanner::V1::ListFindingTypeStatsRequest.new - # - # # Call the list_finding_type_stats method. - # result = client.list_finding_type_stats request - # - # # The returned object is of type Google::Cloud::WebSecurityScanner::V1::ListFindingTypeStatsResponse. - # p result - # - def list_finding_type_stats request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::WebSecurityScanner::V1::ListFindingTypeStatsRequest - - # Converts hash 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_finding_type_stats.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::WebSecurityScanner::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_finding_type_stats.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_finding_type_stats.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @web_security_scanner_stub.call_rpc :list_finding_type_stats, 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 WebSecurityScanner API. - # - # This class represents the configuration for WebSecurityScanner, - # 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::WebSecurityScanner::V1::WebSecurityScanner::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_scan_config to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.create_scan_config.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.create_scan_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::WebSecurityScanner::V1::WebSecurityScanner::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 = "websecurityscanner.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 WebSecurityScanner 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_scan_config` - # @return [::Gapic::Config::Method] - # - attr_reader :create_scan_config - ## - # RPC-specific configuration for `delete_scan_config` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_scan_config - ## - # RPC-specific configuration for `get_scan_config` - # @return [::Gapic::Config::Method] - # - attr_reader :get_scan_config - ## - # RPC-specific configuration for `list_scan_configs` - # @return [::Gapic::Config::Method] - # - attr_reader :list_scan_configs - ## - # RPC-specific configuration for `update_scan_config` - # @return [::Gapic::Config::Method] - # - attr_reader :update_scan_config - ## - # RPC-specific configuration for `start_scan_run` - # @return [::Gapic::Config::Method] - # - attr_reader :start_scan_run - ## - # RPC-specific configuration for `get_scan_run` - # @return [::Gapic::Config::Method] - # - attr_reader :get_scan_run - ## - # RPC-specific configuration for `list_scan_runs` - # @return [::Gapic::Config::Method] - # - attr_reader :list_scan_runs - ## - # RPC-specific configuration for `stop_scan_run` - # @return [::Gapic::Config::Method] - # - attr_reader :stop_scan_run - ## - # RPC-specific configuration for `list_crawled_urls` - # @return [::Gapic::Config::Method] - # - attr_reader :list_crawled_urls - ## - # RPC-specific configuration for `get_finding` - # @return [::Gapic::Config::Method] - # - attr_reader :get_finding - ## - # RPC-specific configuration for `list_findings` - # @return [::Gapic::Config::Method] - # - attr_reader :list_findings - ## - # RPC-specific configuration for `list_finding_type_stats` - # @return [::Gapic::Config::Method] - # - attr_reader :list_finding_type_stats - - # @private - def initialize parent_rpcs = nil - create_scan_config_config = parent_rpcs.create_scan_config if parent_rpcs.respond_to? :create_scan_config - @create_scan_config = ::Gapic::Config::Method.new create_scan_config_config - delete_scan_config_config = parent_rpcs.delete_scan_config if parent_rpcs.respond_to? :delete_scan_config - @delete_scan_config = ::Gapic::Config::Method.new delete_scan_config_config - get_scan_config_config = parent_rpcs.get_scan_config if parent_rpcs.respond_to? :get_scan_config - @get_scan_config = ::Gapic::Config::Method.new get_scan_config_config - list_scan_configs_config = parent_rpcs.list_scan_configs if parent_rpcs.respond_to? :list_scan_configs - @list_scan_configs = ::Gapic::Config::Method.new list_scan_configs_config - update_scan_config_config = parent_rpcs.update_scan_config if parent_rpcs.respond_to? :update_scan_config - @update_scan_config = ::Gapic::Config::Method.new update_scan_config_config - start_scan_run_config = parent_rpcs.start_scan_run if parent_rpcs.respond_to? :start_scan_run - @start_scan_run = ::Gapic::Config::Method.new start_scan_run_config - get_scan_run_config = parent_rpcs.get_scan_run if parent_rpcs.respond_to? :get_scan_run - @get_scan_run = ::Gapic::Config::Method.new get_scan_run_config - list_scan_runs_config = parent_rpcs.list_scan_runs if parent_rpcs.respond_to? :list_scan_runs - @list_scan_runs = ::Gapic::Config::Method.new list_scan_runs_config - stop_scan_run_config = parent_rpcs.stop_scan_run if parent_rpcs.respond_to? :stop_scan_run - @stop_scan_run = ::Gapic::Config::Method.new stop_scan_run_config - list_crawled_urls_config = parent_rpcs.list_crawled_urls if parent_rpcs.respond_to? :list_crawled_urls - @list_crawled_urls = ::Gapic::Config::Method.new list_crawled_urls_config - get_finding_config = parent_rpcs.get_finding if parent_rpcs.respond_to? :get_finding - @get_finding = ::Gapic::Config::Method.new get_finding_config - list_findings_config = parent_rpcs.list_findings if parent_rpcs.respond_to? :list_findings - @list_findings = ::Gapic::Config::Method.new list_findings_config - list_finding_type_stats_config = parent_rpcs.list_finding_type_stats if parent_rpcs.respond_to? :list_finding_type_stats - @list_finding_type_stats = ::Gapic::Config::Method.new list_finding_type_stats_config - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-web_security_scanner-v1/lib/google/cloud/web_security_scanner/v1/web_security_scanner/credentials.rb b/owl-bot-staging/google-cloud-web_security_scanner-v1/lib/google/cloud/web_security_scanner/v1/web_security_scanner/credentials.rb deleted file mode 100644 index 2112c835a5a7..000000000000 --- a/owl-bot-staging/google-cloud-web_security_scanner-v1/lib/google/cloud/web_security_scanner/v1/web_security_scanner/credentials.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! - -require "googleauth" - -module Google - module Cloud - module WebSecurityScanner - module V1 - module WebSecurityScanner - # Credentials for the WebSecurityScanner API. - class Credentials < ::Google::Auth::Credentials - self.scope = [ - "https://www.googleapis.com/auth/cloud-platform" - ] - self.env_vars = [ - "WEB_SECURITY_SCANNER_CREDENTIALS", - "WEB_SECURITY_SCANNER_KEYFILE", - "GOOGLE_CLOUD_CREDENTIALS", - "GOOGLE_CLOUD_KEYFILE", - "GCLOUD_KEYFILE", - "WEB_SECURITY_SCANNER_CREDENTIALS_JSON", - "WEB_SECURITY_SCANNER_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-web_security_scanner-v1/lib/google/cloud/web_security_scanner/v1/web_security_scanner/rest.rb b/owl-bot-staging/google-cloud-web_security_scanner-v1/lib/google/cloud/web_security_scanner/v1/web_security_scanner/rest.rb deleted file mode 100644 index f23009d99847..000000000000 --- a/owl-bot-staging/google-cloud-web_security_scanner-v1/lib/google/cloud/web_security_scanner/v1/web_security_scanner/rest.rb +++ /dev/null @@ -1,53 +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/web_security_scanner/v1/version" - -require "google/cloud/web_security_scanner/v1/web_security_scanner/credentials" -require "google/cloud/web_security_scanner/v1/web_security_scanner/rest/client" - -module Google - module Cloud - module WebSecurityScanner - module V1 - ## - # Web Security Scanner Service identifies security vulnerabilities in web - # applications hosted on Google Cloud. It crawls your application, and - # attempts to exercise as many user inputs and event handlers as possible. - # - # To load this service and instantiate a REST client: - # - # require "google/cloud/web_security_scanner/v1/web_security_scanner/rest" - # client = ::Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Rest::Client.new - # - module WebSecurityScanner - # Client for the REST transport - module Rest - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "rest", "helpers.rb" -require "google/cloud/web_security_scanner/v1/web_security_scanner/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-web_security_scanner-v1/lib/google/cloud/web_security_scanner/v1/web_security_scanner/rest/client.rb b/owl-bot-staging/google-cloud-web_security_scanner-v1/lib/google/cloud/web_security_scanner/v1/web_security_scanner/rest/client.rb deleted file mode 100644 index 34f66942801b..000000000000 --- a/owl-bot-staging/google-cloud-web_security_scanner-v1/lib/google/cloud/web_security_scanner/v1/web_security_scanner/rest/client.rb +++ /dev/null @@ -1,1585 +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/websecurityscanner/v1/web_security_scanner_pb" -require "google/cloud/web_security_scanner/v1/web_security_scanner/rest/service_stub" - -module Google - module Cloud - module WebSecurityScanner - module V1 - module WebSecurityScanner - module Rest - ## - # REST client for the WebSecurityScanner service. - # - # Web Security Scanner Service identifies security vulnerabilities in web - # applications hosted on Google Cloud. It crawls your application, and - # attempts to exercise as many user inputs and event handlers as possible. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "websecurityscanner.$UNIVERSE_DOMAIN$" - - # @private - attr_reader :web_security_scanner_stub - - ## - # Configure the WebSecurityScanner Client class. - # - # See {::Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all WebSecurityScanner clients - # ::Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::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", "WebSecurityScanner", "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_scan_config.timeout = 600.0 - - default_config.rpcs.delete_scan_config.timeout = 600.0 - default_config.rpcs.delete_scan_config.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.get_scan_config.timeout = 600.0 - default_config.rpcs.get_scan_config.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.list_scan_configs.timeout = 600.0 - default_config.rpcs.list_scan_configs.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.update_scan_config.timeout = 600.0 - - default_config.rpcs.start_scan_run.timeout = 600.0 - - default_config.rpcs.get_scan_run.timeout = 600.0 - default_config.rpcs.get_scan_run.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.list_scan_runs.timeout = 600.0 - default_config.rpcs.list_scan_runs.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.stop_scan_run.timeout = 600.0 - - default_config.rpcs.list_crawled_urls.timeout = 600.0 - default_config.rpcs.list_crawled_urls.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.get_finding.timeout = 600.0 - default_config.rpcs.get_finding.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.list_findings.timeout = 600.0 - default_config.rpcs.list_findings.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.list_finding_type_stats.timeout = 600.0 - default_config.rpcs.list_finding_type_stats.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the WebSecurityScanner 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::WebSecurityScanner::V1::WebSecurityScanner::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 - @web_security_scanner_stub.universe_domain - end - - ## - # Create a new WebSecurityScanner REST client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Rest::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Rest::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the WebSecurityScanner 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 - - @web_security_scanner_stub = ::Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Rest::ServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials, - logger: @config.logger - ) - - @web_security_scanner_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 - end - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @web_security_scanner_stub.logger - end - - # Service calls - - ## - # Creates a new ScanConfig. - # - # @overload create_scan_config(request, options = nil) - # Pass arguments to `create_scan_config` via a request object, either of type - # {::Google::Cloud::WebSecurityScanner::V1::CreateScanConfigRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::WebSecurityScanner::V1::CreateScanConfigRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_scan_config(parent: nil, scan_config: nil) - # Pass arguments to `create_scan_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. The parent resource name where the scan is created, which should be a - # project resource name in the format 'projects/\\{projectId}'. - # @param scan_config [::Google::Cloud::WebSecurityScanner::V1::ScanConfig, ::Hash] - # Required. The ScanConfig to be created. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::WebSecurityScanner::V1::ScanConfig] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::WebSecurityScanner::V1::ScanConfig] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/web_security_scanner/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::WebSecurityScanner::V1::CreateScanConfigRequest.new - # - # # Call the create_scan_config method. - # result = client.create_scan_config request - # - # # The returned object is of type Google::Cloud::WebSecurityScanner::V1::ScanConfig. - # p result - # - def create_scan_config request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::WebSecurityScanner::V1::CreateScanConfigRequest - - # Converts hash 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_scan_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::WebSecurityScanner::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_scan_config.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_scan_config.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @web_security_scanner_stub.create_scan_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 - - ## - # Deletes an existing ScanConfig and its child resources. - # - # @overload delete_scan_config(request, options = nil) - # Pass arguments to `delete_scan_config` via a request object, either of type - # {::Google::Cloud::WebSecurityScanner::V1::DeleteScanConfigRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::WebSecurityScanner::V1::DeleteScanConfigRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_scan_config(name: nil) - # Pass arguments to `delete_scan_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 resource name of the ScanConfig to be deleted. The name follows the - # format of 'projects/\\{projectId}/scanConfigs/\\{scanConfigId}'. - # @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/web_security_scanner/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::WebSecurityScanner::V1::DeleteScanConfigRequest.new - # - # # Call the delete_scan_config method. - # result = client.delete_scan_config request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_scan_config request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::WebSecurityScanner::V1::DeleteScanConfigRequest - - # Converts hash 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_scan_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::WebSecurityScanner::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_scan_config.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_scan_config.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @web_security_scanner_stub.delete_scan_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 - - ## - # Gets a ScanConfig. - # - # @overload get_scan_config(request, options = nil) - # Pass arguments to `get_scan_config` via a request object, either of type - # {::Google::Cloud::WebSecurityScanner::V1::GetScanConfigRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::WebSecurityScanner::V1::GetScanConfigRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_scan_config(name: nil) - # Pass arguments to `get_scan_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 resource name of the ScanConfig to be returned. The name follows the - # format of 'projects/\\{projectId}/scanConfigs/\\{scanConfigId}'. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::WebSecurityScanner::V1::ScanConfig] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::WebSecurityScanner::V1::ScanConfig] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/web_security_scanner/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::WebSecurityScanner::V1::GetScanConfigRequest.new - # - # # Call the get_scan_config method. - # result = client.get_scan_config request - # - # # The returned object is of type Google::Cloud::WebSecurityScanner::V1::ScanConfig. - # p result - # - def get_scan_config request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::WebSecurityScanner::V1::GetScanConfigRequest - - # Converts hash 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_scan_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::WebSecurityScanner::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_scan_config.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_scan_config.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @web_security_scanner_stub.get_scan_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 - - ## - # Lists ScanConfigs under a given project. - # - # @overload list_scan_configs(request, options = nil) - # Pass arguments to `list_scan_configs` via a request object, either of type - # {::Google::Cloud::WebSecurityScanner::V1::ListScanConfigsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::WebSecurityScanner::V1::ListScanConfigsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_scan_configs(parent: nil, page_token: nil, page_size: nil) - # Pass arguments to `list_scan_configs` via keyword arguments. Note that at - # least one keyword argument is 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 parent resource name, which should be a project resource name in the - # format 'projects/\\{projectId}'. - # @param page_token [::String] - # A token identifying a page of results to be returned. This should be a - # `next_page_token` value returned from a previous List request. - # If unspecified, the first page of results is returned. - # @param page_size [::Integer] - # The maximum number of ScanConfigs to return, can be limited by server. - # If not specified or not positive, the implementation will select a - # reasonable value. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::WebSecurityScanner::V1::ScanConfig>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::WebSecurityScanner::V1::ScanConfig>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/web_security_scanner/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::WebSecurityScanner::V1::ListScanConfigsRequest.new - # - # # Call the list_scan_configs method. - # result = client.list_scan_configs 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::WebSecurityScanner::V1::ScanConfig. - # p item - # end - # - def list_scan_configs request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::WebSecurityScanner::V1::ListScanConfigsRequest - - # Converts hash 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_scan_configs.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::WebSecurityScanner::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_scan_configs.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_scan_configs.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @web_security_scanner_stub.list_scan_configs request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @web_security_scanner_stub, :list_scan_configs, "scan_configs", 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 - - ## - # Updates a ScanConfig. This method support partial update of a ScanConfig. - # - # @overload update_scan_config(request, options = nil) - # Pass arguments to `update_scan_config` via a request object, either of type - # {::Google::Cloud::WebSecurityScanner::V1::UpdateScanConfigRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::WebSecurityScanner::V1::UpdateScanConfigRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_scan_config(scan_config: nil, update_mask: nil) - # Pass arguments to `update_scan_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 scan_config [::Google::Cloud::WebSecurityScanner::V1::ScanConfig, ::Hash] - # Required. The ScanConfig to be updated. The name field must be set to identify the - # resource to be updated. The values of fields not covered by the mask - # will be ignored. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Required. The update mask applies to the resource. For the `FieldMask` definition, - # see - # https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::WebSecurityScanner::V1::ScanConfig] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::WebSecurityScanner::V1::ScanConfig] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/web_security_scanner/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::WebSecurityScanner::V1::UpdateScanConfigRequest.new - # - # # Call the update_scan_config method. - # result = client.update_scan_config request - # - # # The returned object is of type Google::Cloud::WebSecurityScanner::V1::ScanConfig. - # p result - # - def update_scan_config request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::WebSecurityScanner::V1::UpdateScanConfigRequest - - # Converts hash 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_scan_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::WebSecurityScanner::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_scan_config.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_scan_config.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @web_security_scanner_stub.update_scan_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 - - ## - # Start a ScanRun according to the given ScanConfig. - # - # @overload start_scan_run(request, options = nil) - # Pass arguments to `start_scan_run` via a request object, either of type - # {::Google::Cloud::WebSecurityScanner::V1::StartScanRunRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::WebSecurityScanner::V1::StartScanRunRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload start_scan_run(name: nil) - # Pass arguments to `start_scan_run` via keyword arguments. Note that at - # least one keyword argument is 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 ScanConfig to be used. The name follows the - # format of 'projects/\\{projectId}/scanConfigs/\\{scanConfigId}'. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::WebSecurityScanner::V1::ScanRun] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::WebSecurityScanner::V1::ScanRun] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/web_security_scanner/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::WebSecurityScanner::V1::StartScanRunRequest.new - # - # # Call the start_scan_run method. - # result = client.start_scan_run request - # - # # The returned object is of type Google::Cloud::WebSecurityScanner::V1::ScanRun. - # p result - # - def start_scan_run request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::WebSecurityScanner::V1::StartScanRunRequest - - # Converts hash 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.start_scan_run.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::WebSecurityScanner::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.start_scan_run.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.start_scan_run.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @web_security_scanner_stub.start_scan_run 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 - - ## - # Gets a ScanRun. - # - # @overload get_scan_run(request, options = nil) - # Pass arguments to `get_scan_run` via a request object, either of type - # {::Google::Cloud::WebSecurityScanner::V1::GetScanRunRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::WebSecurityScanner::V1::GetScanRunRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_scan_run(name: nil) - # Pass arguments to `get_scan_run` via keyword arguments. Note that at - # least one keyword argument is 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 ScanRun to be returned. The name follows the - # format of - # 'projects/\\{projectId}/scanConfigs/\\{scanConfigId}/scanRuns/\\{scanRunId}'. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::WebSecurityScanner::V1::ScanRun] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::WebSecurityScanner::V1::ScanRun] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/web_security_scanner/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::WebSecurityScanner::V1::GetScanRunRequest.new - # - # # Call the get_scan_run method. - # result = client.get_scan_run request - # - # # The returned object is of type Google::Cloud::WebSecurityScanner::V1::ScanRun. - # p result - # - def get_scan_run request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::WebSecurityScanner::V1::GetScanRunRequest - - # Converts hash 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_scan_run.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::WebSecurityScanner::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_scan_run.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_scan_run.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @web_security_scanner_stub.get_scan_run 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 ScanRuns under a given ScanConfig, in descending order of ScanRun - # stop time. - # - # @overload list_scan_runs(request, options = nil) - # Pass arguments to `list_scan_runs` via a request object, either of type - # {::Google::Cloud::WebSecurityScanner::V1::ListScanRunsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::WebSecurityScanner::V1::ListScanRunsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_scan_runs(parent: nil, page_token: nil, page_size: nil) - # Pass arguments to `list_scan_runs` via keyword arguments. Note that at - # least one keyword argument is 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 parent resource name, which should be a scan resource name in the - # format 'projects/\\{projectId}/scanConfigs/\\{scanConfigId}'. - # @param page_token [::String] - # A token identifying a page of results to be returned. This should be a - # `next_page_token` value returned from a previous List request. - # If unspecified, the first page of results is returned. - # @param page_size [::Integer] - # The maximum number of ScanRuns to return, can be limited by server. - # If not specified or not positive, the implementation will select a - # reasonable value. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::WebSecurityScanner::V1::ScanRun>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::WebSecurityScanner::V1::ScanRun>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/web_security_scanner/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::WebSecurityScanner::V1::ListScanRunsRequest.new - # - # # Call the list_scan_runs method. - # result = client.list_scan_runs 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::WebSecurityScanner::V1::ScanRun. - # p item - # end - # - def list_scan_runs request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::WebSecurityScanner::V1::ListScanRunsRequest - - # Converts hash 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_scan_runs.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::WebSecurityScanner::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_scan_runs.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_scan_runs.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @web_security_scanner_stub.list_scan_runs request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @web_security_scanner_stub, :list_scan_runs, "scan_runs", 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 - - ## - # Stops a ScanRun. The stopped ScanRun is returned. - # - # @overload stop_scan_run(request, options = nil) - # Pass arguments to `stop_scan_run` via a request object, either of type - # {::Google::Cloud::WebSecurityScanner::V1::StopScanRunRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::WebSecurityScanner::V1::StopScanRunRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload stop_scan_run(name: nil) - # Pass arguments to `stop_scan_run` via keyword arguments. Note that at - # least one keyword argument is 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 ScanRun to be stopped. The name follows the - # format of - # 'projects/\\{projectId}/scanConfigs/\\{scanConfigId}/scanRuns/\\{scanRunId}'. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::WebSecurityScanner::V1::ScanRun] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::WebSecurityScanner::V1::ScanRun] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/web_security_scanner/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::WebSecurityScanner::V1::StopScanRunRequest.new - # - # # Call the stop_scan_run method. - # result = client.stop_scan_run request - # - # # The returned object is of type Google::Cloud::WebSecurityScanner::V1::ScanRun. - # p result - # - def stop_scan_run request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::WebSecurityScanner::V1::StopScanRunRequest - - # Converts hash 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.stop_scan_run.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::WebSecurityScanner::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.stop_scan_run.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.stop_scan_run.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @web_security_scanner_stub.stop_scan_run 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 - - ## - # List CrawledUrls under a given ScanRun. - # - # @overload list_crawled_urls(request, options = nil) - # Pass arguments to `list_crawled_urls` via a request object, either of type - # {::Google::Cloud::WebSecurityScanner::V1::ListCrawledUrlsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::WebSecurityScanner::V1::ListCrawledUrlsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_crawled_urls(parent: nil, page_token: nil, page_size: nil) - # Pass arguments to `list_crawled_urls` via keyword arguments. Note that at - # least one keyword argument is 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 parent resource name, which should be a scan run resource name in the - # format - # 'projects/\\{projectId}/scanConfigs/\\{scanConfigId}/scanRuns/\\{scanRunId}'. - # @param page_token [::String] - # A token identifying a page of results to be returned. This should be a - # `next_page_token` value returned from a previous List request. - # If unspecified, the first page of results is returned. - # @param page_size [::Integer] - # The maximum number of CrawledUrls to return, can be limited by server. - # If not specified or not positive, the implementation will select a - # reasonable value. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::WebSecurityScanner::V1::CrawledUrl>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::WebSecurityScanner::V1::CrawledUrl>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/web_security_scanner/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::WebSecurityScanner::V1::ListCrawledUrlsRequest.new - # - # # Call the list_crawled_urls method. - # result = client.list_crawled_urls 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::WebSecurityScanner::V1::CrawledUrl. - # p item - # end - # - def list_crawled_urls request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::WebSecurityScanner::V1::ListCrawledUrlsRequest - - # Converts hash 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_crawled_urls.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::WebSecurityScanner::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_crawled_urls.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_crawled_urls.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @web_security_scanner_stub.list_crawled_urls request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @web_security_scanner_stub, :list_crawled_urls, "crawled_urls", 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 a Finding. - # - # @overload get_finding(request, options = nil) - # Pass arguments to `get_finding` via a request object, either of type - # {::Google::Cloud::WebSecurityScanner::V1::GetFindingRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::WebSecurityScanner::V1::GetFindingRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_finding(name: nil) - # Pass arguments to `get_finding` via keyword arguments. Note that at - # least one keyword argument is 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 Finding to be returned. The name follows the - # format of - # 'projects/\\{projectId}/scanConfigs/\\{scanConfigId}/scanRuns/\\{scanRunId}/findings/\\{findingId}'. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::WebSecurityScanner::V1::Finding] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::WebSecurityScanner::V1::Finding] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/web_security_scanner/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::WebSecurityScanner::V1::GetFindingRequest.new - # - # # Call the get_finding method. - # result = client.get_finding request - # - # # The returned object is of type Google::Cloud::WebSecurityScanner::V1::Finding. - # p result - # - def get_finding request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::WebSecurityScanner::V1::GetFindingRequest - - # Converts hash 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_finding.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::WebSecurityScanner::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_finding.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_finding.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @web_security_scanner_stub.get_finding 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 - - ## - # List Findings under a given ScanRun. - # - # @overload list_findings(request, options = nil) - # Pass arguments to `list_findings` via a request object, either of type - # {::Google::Cloud::WebSecurityScanner::V1::ListFindingsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::WebSecurityScanner::V1::ListFindingsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_findings(parent: nil, filter: nil, page_token: nil, page_size: nil) - # Pass arguments to `list_findings` via keyword arguments. Note that at - # least one keyword argument is 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 parent resource name, which should be a scan run resource name in the - # format - # 'projects/\\{projectId}/scanConfigs/\\{scanConfigId}/scanRuns/\\{scanRunId}'. - # @param filter [::String] - # The filter expression. The expression must be in the format: - # . - # Supported field: 'finding_type'. - # Supported operator: '='. - # @param page_token [::String] - # A token identifying a page of results to be returned. This should be a - # `next_page_token` value returned from a previous List request. - # If unspecified, the first page of results is returned. - # @param page_size [::Integer] - # The maximum number of Findings to return, can be limited by server. - # If not specified or not positive, the implementation will select a - # reasonable value. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::WebSecurityScanner::V1::Finding>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::WebSecurityScanner::V1::Finding>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/web_security_scanner/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::WebSecurityScanner::V1::ListFindingsRequest.new - # - # # Call the list_findings method. - # result = client.list_findings 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::WebSecurityScanner::V1::Finding. - # p item - # end - # - def list_findings request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::WebSecurityScanner::V1::ListFindingsRequest - - # Converts hash 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_findings.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::WebSecurityScanner::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_findings.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_findings.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @web_security_scanner_stub.list_findings request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @web_security_scanner_stub, :list_findings, "findings", 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 - - ## - # List all FindingTypeStats under a given ScanRun. - # - # @overload list_finding_type_stats(request, options = nil) - # Pass arguments to `list_finding_type_stats` via a request object, either of type - # {::Google::Cloud::WebSecurityScanner::V1::ListFindingTypeStatsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::WebSecurityScanner::V1::ListFindingTypeStatsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_finding_type_stats(parent: nil) - # Pass arguments to `list_finding_type_stats` via keyword arguments. Note that at - # least one keyword argument is 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 parent resource name, which should be a scan run resource name in the - # format - # 'projects/\\{projectId}/scanConfigs/\\{scanConfigId}/scanRuns/\\{scanRunId}'. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::WebSecurityScanner::V1::ListFindingTypeStatsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::WebSecurityScanner::V1::ListFindingTypeStatsResponse] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/web_security_scanner/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::WebSecurityScanner::V1::ListFindingTypeStatsRequest.new - # - # # Call the list_finding_type_stats method. - # result = client.list_finding_type_stats request - # - # # The returned object is of type Google::Cloud::WebSecurityScanner::V1::ListFindingTypeStatsResponse. - # p result - # - def list_finding_type_stats request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::WebSecurityScanner::V1::ListFindingTypeStatsRequest - - # Converts hash 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_finding_type_stats.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::WebSecurityScanner::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_finding_type_stats.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_finding_type_stats.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @web_security_scanner_stub.list_finding_type_stats 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 WebSecurityScanner REST API. - # - # This class represents the configuration for WebSecurityScanner 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::WebSecurityScanner::V1::WebSecurityScanner::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_scan_config to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.create_scan_config.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.create_scan_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 = "websecurityscanner.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 WebSecurityScanner 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_scan_config` - # @return [::Gapic::Config::Method] - # - attr_reader :create_scan_config - ## - # RPC-specific configuration for `delete_scan_config` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_scan_config - ## - # RPC-specific configuration for `get_scan_config` - # @return [::Gapic::Config::Method] - # - attr_reader :get_scan_config - ## - # RPC-specific configuration for `list_scan_configs` - # @return [::Gapic::Config::Method] - # - attr_reader :list_scan_configs - ## - # RPC-specific configuration for `update_scan_config` - # @return [::Gapic::Config::Method] - # - attr_reader :update_scan_config - ## - # RPC-specific configuration for `start_scan_run` - # @return [::Gapic::Config::Method] - # - attr_reader :start_scan_run - ## - # RPC-specific configuration for `get_scan_run` - # @return [::Gapic::Config::Method] - # - attr_reader :get_scan_run - ## - # RPC-specific configuration for `list_scan_runs` - # @return [::Gapic::Config::Method] - # - attr_reader :list_scan_runs - ## - # RPC-specific configuration for `stop_scan_run` - # @return [::Gapic::Config::Method] - # - attr_reader :stop_scan_run - ## - # RPC-specific configuration for `list_crawled_urls` - # @return [::Gapic::Config::Method] - # - attr_reader :list_crawled_urls - ## - # RPC-specific configuration for `get_finding` - # @return [::Gapic::Config::Method] - # - attr_reader :get_finding - ## - # RPC-specific configuration for `list_findings` - # @return [::Gapic::Config::Method] - # - attr_reader :list_findings - ## - # RPC-specific configuration for `list_finding_type_stats` - # @return [::Gapic::Config::Method] - # - attr_reader :list_finding_type_stats - - # @private - def initialize parent_rpcs = nil - create_scan_config_config = parent_rpcs.create_scan_config if parent_rpcs.respond_to? :create_scan_config - @create_scan_config = ::Gapic::Config::Method.new create_scan_config_config - delete_scan_config_config = parent_rpcs.delete_scan_config if parent_rpcs.respond_to? :delete_scan_config - @delete_scan_config = ::Gapic::Config::Method.new delete_scan_config_config - get_scan_config_config = parent_rpcs.get_scan_config if parent_rpcs.respond_to? :get_scan_config - @get_scan_config = ::Gapic::Config::Method.new get_scan_config_config - list_scan_configs_config = parent_rpcs.list_scan_configs if parent_rpcs.respond_to? :list_scan_configs - @list_scan_configs = ::Gapic::Config::Method.new list_scan_configs_config - update_scan_config_config = parent_rpcs.update_scan_config if parent_rpcs.respond_to? :update_scan_config - @update_scan_config = ::Gapic::Config::Method.new update_scan_config_config - start_scan_run_config = parent_rpcs.start_scan_run if parent_rpcs.respond_to? :start_scan_run - @start_scan_run = ::Gapic::Config::Method.new start_scan_run_config - get_scan_run_config = parent_rpcs.get_scan_run if parent_rpcs.respond_to? :get_scan_run - @get_scan_run = ::Gapic::Config::Method.new get_scan_run_config - list_scan_runs_config = parent_rpcs.list_scan_runs if parent_rpcs.respond_to? :list_scan_runs - @list_scan_runs = ::Gapic::Config::Method.new list_scan_runs_config - stop_scan_run_config = parent_rpcs.stop_scan_run if parent_rpcs.respond_to? :stop_scan_run - @stop_scan_run = ::Gapic::Config::Method.new stop_scan_run_config - list_crawled_urls_config = parent_rpcs.list_crawled_urls if parent_rpcs.respond_to? :list_crawled_urls - @list_crawled_urls = ::Gapic::Config::Method.new list_crawled_urls_config - get_finding_config = parent_rpcs.get_finding if parent_rpcs.respond_to? :get_finding - @get_finding = ::Gapic::Config::Method.new get_finding_config - list_findings_config = parent_rpcs.list_findings if parent_rpcs.respond_to? :list_findings - @list_findings = ::Gapic::Config::Method.new list_findings_config - list_finding_type_stats_config = parent_rpcs.list_finding_type_stats if parent_rpcs.respond_to? :list_finding_type_stats - @list_finding_type_stats = ::Gapic::Config::Method.new list_finding_type_stats_config - - yield self if block_given? - end - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-web_security_scanner-v1/lib/google/cloud/web_security_scanner/v1/web_security_scanner/rest/service_stub.rb b/owl-bot-staging/google-cloud-web_security_scanner-v1/lib/google/cloud/web_security_scanner/v1/web_security_scanner/rest/service_stub.rb deleted file mode 100644 index e6edf6a664f0..000000000000 --- a/owl-bot-staging/google-cloud-web_security_scanner-v1/lib/google/cloud/web_security_scanner/v1/web_security_scanner/rest/service_stub.rb +++ /dev/null @@ -1,878 +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/websecurityscanner/v1/web_security_scanner_pb" - -module Google - module Cloud - module WebSecurityScanner - module V1 - module WebSecurityScanner - module Rest - ## - # REST service stub for the WebSecurityScanner 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_scan_config REST call - # - # @param request_pb [::Google::Cloud::WebSecurityScanner::V1::CreateScanConfigRequest] - # 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::WebSecurityScanner::V1::ScanConfig] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::WebSecurityScanner::V1::ScanConfig] - # A result object deserialized from the server's reply - def create_scan_config request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_scan_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: "create_scan_config", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::WebSecurityScanner::V1::ScanConfig.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_scan_config REST call - # - # @param request_pb [::Google::Cloud::WebSecurityScanner::V1::DeleteScanConfigRequest] - # 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_scan_config request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_delete_scan_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: "delete_scan_config", - 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 get_scan_config REST call - # - # @param request_pb [::Google::Cloud::WebSecurityScanner::V1::GetScanConfigRequest] - # 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::WebSecurityScanner::V1::ScanConfig] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::WebSecurityScanner::V1::ScanConfig] - # A result object deserialized from the server's reply - def get_scan_config request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_scan_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_scan_config", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::WebSecurityScanner::V1::ScanConfig.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_scan_configs REST call - # - # @param request_pb [::Google::Cloud::WebSecurityScanner::V1::ListScanConfigsRequest] - # 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::WebSecurityScanner::V1::ListScanConfigsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::WebSecurityScanner::V1::ListScanConfigsResponse] - # A result object deserialized from the server's reply - def list_scan_configs request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_scan_configs_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_scan_configs", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::WebSecurityScanner::V1::ListScanConfigsResponse.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_scan_config REST call - # - # @param request_pb [::Google::Cloud::WebSecurityScanner::V1::UpdateScanConfigRequest] - # 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::WebSecurityScanner::V1::ScanConfig] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::WebSecurityScanner::V1::ScanConfig] - # A result object deserialized from the server's reply - def update_scan_config request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_scan_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_scan_config", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::WebSecurityScanner::V1::ScanConfig.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the start_scan_run REST call - # - # @param request_pb [::Google::Cloud::WebSecurityScanner::V1::StartScanRunRequest] - # 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::WebSecurityScanner::V1::ScanRun] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::WebSecurityScanner::V1::ScanRun] - # A result object deserialized from the server's reply - def start_scan_run request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_start_scan_run_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: "start_scan_run", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::WebSecurityScanner::V1::ScanRun.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_scan_run REST call - # - # @param request_pb [::Google::Cloud::WebSecurityScanner::V1::GetScanRunRequest] - # 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::WebSecurityScanner::V1::ScanRun] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::WebSecurityScanner::V1::ScanRun] - # A result object deserialized from the server's reply - def get_scan_run request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_scan_run_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_scan_run", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::WebSecurityScanner::V1::ScanRun.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_scan_runs REST call - # - # @param request_pb [::Google::Cloud::WebSecurityScanner::V1::ListScanRunsRequest] - # 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::WebSecurityScanner::V1::ListScanRunsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::WebSecurityScanner::V1::ListScanRunsResponse] - # A result object deserialized from the server's reply - def list_scan_runs request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_scan_runs_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_scan_runs", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::WebSecurityScanner::V1::ListScanRunsResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the stop_scan_run REST call - # - # @param request_pb [::Google::Cloud::WebSecurityScanner::V1::StopScanRunRequest] - # 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::WebSecurityScanner::V1::ScanRun] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::WebSecurityScanner::V1::ScanRun] - # A result object deserialized from the server's reply - def stop_scan_run request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_stop_scan_run_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: "stop_scan_run", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::WebSecurityScanner::V1::ScanRun.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_crawled_urls REST call - # - # @param request_pb [::Google::Cloud::WebSecurityScanner::V1::ListCrawledUrlsRequest] - # 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::WebSecurityScanner::V1::ListCrawledUrlsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::WebSecurityScanner::V1::ListCrawledUrlsResponse] - # A result object deserialized from the server's reply - def list_crawled_urls request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_crawled_urls_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_crawled_urls", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::WebSecurityScanner::V1::ListCrawledUrlsResponse.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_finding REST call - # - # @param request_pb [::Google::Cloud::WebSecurityScanner::V1::GetFindingRequest] - # 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::WebSecurityScanner::V1::Finding] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::WebSecurityScanner::V1::Finding] - # A result object deserialized from the server's reply - def get_finding request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_finding_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_finding", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::WebSecurityScanner::V1::Finding.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_findings REST call - # - # @param request_pb [::Google::Cloud::WebSecurityScanner::V1::ListFindingsRequest] - # 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::WebSecurityScanner::V1::ListFindingsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::WebSecurityScanner::V1::ListFindingsResponse] - # A result object deserialized from the server's reply - def list_findings request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_findings_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_findings", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::WebSecurityScanner::V1::ListFindingsResponse.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_finding_type_stats REST call - # - # @param request_pb [::Google::Cloud::WebSecurityScanner::V1::ListFindingTypeStatsRequest] - # 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::WebSecurityScanner::V1::ListFindingTypeStatsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::WebSecurityScanner::V1::ListFindingTypeStatsResponse] - # A result object deserialized from the server's reply - def list_finding_type_stats request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_finding_type_stats_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_finding_type_stats", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::WebSecurityScanner::V1::ListFindingTypeStatsResponse.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_scan_config REST call - # - # @param request_pb [::Google::Cloud::WebSecurityScanner::V1::CreateScanConfigRequest] - # 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_scan_config_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}/scanConfigs", - body: "scan_config", - matches: [ - ["parent", %r{^projects/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_scan_config REST call - # - # @param request_pb [::Google::Cloud::WebSecurityScanner::V1::DeleteScanConfigRequest] - # 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_scan_config_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/scanConfigs/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_scan_config REST call - # - # @param request_pb [::Google::Cloud::WebSecurityScanner::V1::GetScanConfigRequest] - # 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_scan_config_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/scanConfigs/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_scan_configs REST call - # - # @param request_pb [::Google::Cloud::WebSecurityScanner::V1::ListScanConfigsRequest] - # 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_scan_configs_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/scanConfigs", - matches: [ - ["parent", %r{^projects/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_scan_config REST call - # - # @param request_pb [::Google::Cloud::WebSecurityScanner::V1::UpdateScanConfigRequest] - # 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_scan_config_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v1/{scan_config.name}", - body: "scan_config", - matches: [ - ["scan_config.name", %r{^projects/[^/]+/scanConfigs/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the start_scan_run REST call - # - # @param request_pb [::Google::Cloud::WebSecurityScanner::V1::StartScanRunRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_start_scan_run_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:start", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/scanConfigs/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_scan_run REST call - # - # @param request_pb [::Google::Cloud::WebSecurityScanner::V1::GetScanRunRequest] - # 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_scan_run_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/scanConfigs/[^/]+/scanRuns/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_scan_runs REST call - # - # @param request_pb [::Google::Cloud::WebSecurityScanner::V1::ListScanRunsRequest] - # 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_scan_runs_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/scanRuns", - matches: [ - ["parent", %r{^projects/[^/]+/scanConfigs/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the stop_scan_run REST call - # - # @param request_pb [::Google::Cloud::WebSecurityScanner::V1::StopScanRunRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_stop_scan_run_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:stop", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/scanConfigs/[^/]+/scanRuns/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_crawled_urls REST call - # - # @param request_pb [::Google::Cloud::WebSecurityScanner::V1::ListCrawledUrlsRequest] - # 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_crawled_urls_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/crawledUrls", - matches: [ - ["parent", %r{^projects/[^/]+/scanConfigs/[^/]+/scanRuns/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_finding REST call - # - # @param request_pb [::Google::Cloud::WebSecurityScanner::V1::GetFindingRequest] - # 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_finding_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/scanConfigs/[^/]+/scanRuns/[^/]+/findings/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_findings REST call - # - # @param request_pb [::Google::Cloud::WebSecurityScanner::V1::ListFindingsRequest] - # 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_findings_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/findings", - matches: [ - ["parent", %r{^projects/[^/]+/scanConfigs/[^/]+/scanRuns/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_finding_type_stats REST call - # - # @param request_pb [::Google::Cloud::WebSecurityScanner::V1::ListFindingTypeStatsRequest] - # 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_finding_type_stats_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/findingTypeStats", - matches: [ - ["parent", %r{^projects/[^/]+/scanConfigs/[^/]+/scanRuns/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-web_security_scanner-v1/lib/google/cloud/websecurityscanner/v1/crawled_url_pb.rb b/owl-bot-staging/google-cloud-web_security_scanner-v1/lib/google/cloud/websecurityscanner/v1/crawled_url_pb.rb deleted file mode 100644 index f69c82a54319..000000000000 --- a/owl-bot-staging/google-cloud-web_security_scanner-v1/lib/google/cloud/websecurityscanner/v1/crawled_url_pb.rb +++ /dev/null @@ -1,21 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/websecurityscanner/v1/crawled_url.proto - -require 'google/protobuf' - - -descriptor_data = "\n4google/cloud/websecurityscanner/v1/crawled_url.proto\x12\"google.cloud.websecurityscanner.v1\"<\n\nCrawledUrl\x12\x13\n\x0bhttp_method\x18\x01 \x01(\t\x12\x0b\n\x03url\x18\x02 \x01(\t\x12\x0c\n\x04\x62ody\x18\x03 \x01(\tB\x85\x02\n&com.google.cloud.websecurityscanner.v1B\x0f\x43rawledUrlProtoP\x01ZVcloud.google.com/go/websecurityscanner/apiv1/websecurityscannerpb;websecurityscannerpb\xaa\x02\"Google.Cloud.WebSecurityScanner.V1\xca\x02\"Google\\Cloud\\WebSecurityScanner\\V1\xea\x02%Google::Cloud::WebSecurityScanner::V1b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module WebSecurityScanner - module V1 - CrawledUrl = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.websecurityscanner.v1.CrawledUrl").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-web_security_scanner-v1/lib/google/cloud/websecurityscanner/v1/finding_addon_pb.rb b/owl-bot-staging/google-cloud-web_security_scanner-v1/lib/google/cloud/websecurityscanner/v1/finding_addon_pb.rb deleted file mode 100644 index f4877154eb19..000000000000 --- a/owl-bot-staging/google-cloud-web_security_scanner-v1/lib/google/cloud/websecurityscanner/v1/finding_addon_pb.rb +++ /dev/null @@ -1,30 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/websecurityscanner/v1/finding_addon.proto - -require 'google/protobuf' - - -descriptor_data = "\n6google/cloud/websecurityscanner/v1/finding_addon.proto\x12\"google.cloud.websecurityscanner.v1\"*\n\x04\x46orm\x12\x12\n\naction_uri\x18\x01 \x01(\t\x12\x0e\n\x06\x66ields\x18\x02 \x03(\t\"Q\n\x0fOutdatedLibrary\x12\x14\n\x0clibrary_name\x18\x01 \x01(\t\x12\x0f\n\x07version\x18\x02 \x01(\t\x12\x17\n\x0flearn_more_urls\x18\x03 \x03(\t\"?\n\x11ViolatingResource\x12\x14\n\x0c\x63ontent_type\x18\x01 \x01(\t\x12\x14\n\x0cresource_url\x18\x02 \x01(\t\"/\n\x14VulnerableParameters\x12\x17\n\x0fparameter_names\x18\x01 \x03(\t\"\xe0\x01\n\x11VulnerableHeaders\x12M\n\x07headers\x18\x01 \x03(\x0b\x32<.google.cloud.websecurityscanner.v1.VulnerableHeaders.Header\x12U\n\x0fmissing_headers\x18\x02 \x03(\x0b\x32<.google.cloud.websecurityscanner.v1.VulnerableHeaders.Header\x1a%\n\x06Header\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t\"\xdb\x03\n\x03Xss\x12\x14\n\x0cstack_traces\x18\x01 \x03(\t\x12\x15\n\rerror_message\x18\x02 \x01(\t\x12K\n\rattack_vector\x18\x03 \x01(\x0e\x32\x34.google.cloud.websecurityscanner.v1.Xss.AttackVector\x12\x1e\n\x16stored_xss_seeding_url\x18\x04 \x01(\t\"\xb9\x02\n\x0c\x41ttackVector\x12\x1d\n\x19\x41TTACK_VECTOR_UNSPECIFIED\x10\x00\x12\x11\n\rLOCAL_STORAGE\x10\x01\x12\x13\n\x0fSESSION_STORAGE\x10\x02\x12\x0f\n\x0bWINDOW_NAME\x10\x03\x12\x0c\n\x08REFERRER\x10\x04\x12\x0e\n\nFORM_INPUT\x10\x05\x12\n\n\x06\x43OOKIE\x10\x06\x12\x10\n\x0cPOST_MESSAGE\x10\x07\x12\x12\n\x0eGET_PARAMETERS\x10\x08\x12\x10\n\x0cURL_FRAGMENT\x10\t\x12\x10\n\x0cHTML_COMMENT\x10\n\x12\x13\n\x0fPOST_PARAMETERS\x10\x0b\x12\x0c\n\x08PROTOCOL\x10\x0c\x12\x0e\n\nSTORED_XSS\x10\r\x12\x0f\n\x0bSAME_ORIGIN\x10\x0e\x12\x19\n\x15USER_CONTROLLABLE_URL\x10\x0f\"\xa9\x01\n\x03Xxe\x12\x15\n\rpayload_value\x18\x01 \x01(\t\x12J\n\x10payload_location\x18\x02 \x01(\x0e\x32\x30.google.cloud.websecurityscanner.v1.Xxe.Location\"?\n\x08Location\x12\x18\n\x14LOCATION_UNSPECIFIED\x10\x00\x12\x19\n\x15\x43OMPLETE_REQUEST_BODY\x10\x01\x42\x87\x02\n&com.google.cloud.websecurityscanner.v1B\x11\x46indingAddonProtoP\x01ZVcloud.google.com/go/websecurityscanner/apiv1/websecurityscannerpb;websecurityscannerpb\xaa\x02\"Google.Cloud.WebSecurityScanner.V1\xca\x02\"Google\\Cloud\\WebSecurityScanner\\V1\xea\x02%Google::Cloud::WebSecurityScanner::V1b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module WebSecurityScanner - module V1 - Form = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.websecurityscanner.v1.Form").msgclass - OutdatedLibrary = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.websecurityscanner.v1.OutdatedLibrary").msgclass - ViolatingResource = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.websecurityscanner.v1.ViolatingResource").msgclass - VulnerableParameters = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.websecurityscanner.v1.VulnerableParameters").msgclass - VulnerableHeaders = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.websecurityscanner.v1.VulnerableHeaders").msgclass - VulnerableHeaders::Header = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.websecurityscanner.v1.VulnerableHeaders.Header").msgclass - Xss = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.websecurityscanner.v1.Xss").msgclass - Xss::AttackVector = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.websecurityscanner.v1.Xss.AttackVector").enummodule - Xxe = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.websecurityscanner.v1.Xxe").msgclass - Xxe::Location = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.websecurityscanner.v1.Xxe.Location").enummodule - end - end - end -end diff --git a/owl-bot-staging/google-cloud-web_security_scanner-v1/lib/google/cloud/websecurityscanner/v1/finding_pb.rb b/owl-bot-staging/google-cloud-web_security_scanner-v1/lib/google/cloud/websecurityscanner/v1/finding_pb.rb deleted file mode 100644 index 2c1b16a36903..000000000000 --- a/owl-bot-staging/google-cloud-web_security_scanner-v1/lib/google/cloud/websecurityscanner/v1/finding_pb.rb +++ /dev/null @@ -1,26 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/websecurityscanner/v1/finding.proto - -require 'google/protobuf' - -require 'google/api/field_behavior_pb' -require 'google/api/resource_pb' -require 'google/cloud/websecurityscanner/v1/finding_addon_pb' - - -descriptor_data = "\n0google/cloud/websecurityscanner/v1/finding.proto\x12\"google.cloud.websecurityscanner.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x36google/cloud/websecurityscanner/v1/finding_addon.proto\"\xec\x07\n\x07\x46inding\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x14\n\x0c\x66inding_type\x18\x02 \x01(\t\x12K\n\x08severity\x18\x11 \x01(\x0e\x32\x34.google.cloud.websecurityscanner.v1.Finding.SeverityB\x03\xe0\x41\x03\x12\x13\n\x0bhttp_method\x18\x03 \x01(\t\x12\x12\n\nfuzzed_url\x18\x04 \x01(\t\x12\x0c\n\x04\x62ody\x18\x05 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x06 \x01(\t\x12\x18\n\x10reproduction_url\x18\x07 \x01(\t\x12\x11\n\tframe_url\x18\x08 \x01(\t\x12\x11\n\tfinal_url\x18\t \x01(\t\x12\x13\n\x0btracking_id\x18\n \x01(\t\x12\x36\n\x04\x66orm\x18\x10 \x01(\x0b\x32(.google.cloud.websecurityscanner.v1.Form\x12M\n\x10outdated_library\x18\x0b \x01(\x0b\x32\x33.google.cloud.websecurityscanner.v1.OutdatedLibrary\x12Q\n\x12violating_resource\x18\x0c \x01(\x0b\x32\x35.google.cloud.websecurityscanner.v1.ViolatingResource\x12Q\n\x12vulnerable_headers\x18\x0f \x01(\x0b\x32\x35.google.cloud.websecurityscanner.v1.VulnerableHeaders\x12W\n\x15vulnerable_parameters\x18\r \x01(\x0b\x32\x38.google.cloud.websecurityscanner.v1.VulnerableParameters\x12\x34\n\x03xss\x18\x0e \x01(\x0b\x32\'.google.cloud.websecurityscanner.v1.Xss\x12\x39\n\x03xxe\x18\x12 \x01(\x0b\x32\'.google.cloud.websecurityscanner.v1.XxeB\x03\xe0\x41\x03\"Q\n\x08Severity\x12\x18\n\x14SEVERITY_UNSPECIFIED\x10\x00\x12\x0c\n\x08\x43RITICAL\x10\x01\x12\x08\n\x04HIGH\x10\x02\x12\n\n\x06MEDIUM\x10\x03\x12\x07\n\x03LOW\x10\x04:\x84\x01\xea\x41\x80\x01\n)websecurityscanner.googleapis.com/Finding\x12Sprojects/{project}/scanConfigs/{scan_config}/scanRuns/{scan_run}/findings/{finding}B\x82\x02\n&com.google.cloud.websecurityscanner.v1B\x0c\x46indingProtoP\x01ZVcloud.google.com/go/websecurityscanner/apiv1/websecurityscannerpb;websecurityscannerpb\xaa\x02\"Google.Cloud.WebSecurityScanner.V1\xca\x02\"Google\\Cloud\\WebSecurityScanner\\V1\xea\x02%Google::Cloud::WebSecurityScanner::V1b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module WebSecurityScanner - module V1 - Finding = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.websecurityscanner.v1.Finding").msgclass - Finding::Severity = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.websecurityscanner.v1.Finding.Severity").enummodule - end - end - end -end diff --git a/owl-bot-staging/google-cloud-web_security_scanner-v1/lib/google/cloud/websecurityscanner/v1/finding_type_stats_pb.rb b/owl-bot-staging/google-cloud-web_security_scanner-v1/lib/google/cloud/websecurityscanner/v1/finding_type_stats_pb.rb deleted file mode 100644 index 5c44c6e3e782..000000000000 --- a/owl-bot-staging/google-cloud-web_security_scanner-v1/lib/google/cloud/websecurityscanner/v1/finding_type_stats_pb.rb +++ /dev/null @@ -1,21 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/websecurityscanner/v1/finding_type_stats.proto - -require 'google/protobuf' - - -descriptor_data = "\n;google/cloud/websecurityscanner/v1/finding_type_stats.proto\x12\"google.cloud.websecurityscanner.v1\"?\n\x10\x46indingTypeStats\x12\x14\n\x0c\x66inding_type\x18\x01 \x01(\t\x12\x15\n\rfinding_count\x18\x02 \x01(\x05\x42\x8b\x02\n&com.google.cloud.websecurityscanner.v1B\x15\x46indingTypeStatsProtoP\x01ZVcloud.google.com/go/websecurityscanner/apiv1/websecurityscannerpb;websecurityscannerpb\xaa\x02\"Google.Cloud.WebSecurityScanner.V1\xca\x02\"Google\\Cloud\\WebSecurityScanner\\V1\xea\x02%Google::Cloud::WebSecurityScanner::V1b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module WebSecurityScanner - module V1 - FindingTypeStats = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.websecurityscanner.v1.FindingTypeStats").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-web_security_scanner-v1/lib/google/cloud/websecurityscanner/v1/scan_config_error_pb.rb b/owl-bot-staging/google-cloud-web_security_scanner-v1/lib/google/cloud/websecurityscanner/v1/scan_config_error_pb.rb deleted file mode 100644 index efdc1a76b2a3..000000000000 --- a/owl-bot-staging/google-cloud-web_security_scanner-v1/lib/google/cloud/websecurityscanner/v1/scan_config_error_pb.rb +++ /dev/null @@ -1,22 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/websecurityscanner/v1/scan_config_error.proto - -require 'google/protobuf' - - -descriptor_data = "\n:google/cloud/websecurityscanner/v1/scan_config_error.proto\x12\"google.cloud.websecurityscanner.v1\"\xe9\x0b\n\x0fScanConfigError\x12\x46\n\x04\x63ode\x18\x01 \x01(\x0e\x32\x38.google.cloud.websecurityscanner.v1.ScanConfigError.Code\x12\x12\n\nfield_name\x18\x02 \x01(\t\"\xf9\n\n\x04\x43ode\x12\x14\n\x10\x43ODE_UNSPECIFIED\x10\x00\x12\x06\n\x02OK\x10\x00\x12\x12\n\x0eINTERNAL_ERROR\x10\x01\x12\x1f\n\x1b\x41PPENGINE_API_BACKEND_ERROR\x10\x02\x12 \n\x1c\x41PPENGINE_API_NOT_ACCESSIBLE\x10\x03\x12\"\n\x1e\x41PPENGINE_DEFAULT_HOST_MISSING\x10\x04\x12!\n\x1d\x43\x41NNOT_USE_GOOGLE_COM_ACCOUNT\x10\x06\x12\x1c\n\x18\x43\x41NNOT_USE_OWNER_ACCOUNT\x10\x07\x12\x1d\n\x19\x43OMPUTE_API_BACKEND_ERROR\x10\x08\x12\x1e\n\x1a\x43OMPUTE_API_NOT_ACCESSIBLE\x10\t\x12\x37\n3CUSTOM_LOGIN_URL_DOES_NOT_BELONG_TO_CURRENT_PROJECT\x10\n\x12\x1e\n\x1a\x43USTOM_LOGIN_URL_MALFORMED\x10\x0b\x12\x33\n/CUSTOM_LOGIN_URL_MAPPED_TO_NON_ROUTABLE_ADDRESS\x10\x0c\x12\x31\n-CUSTOM_LOGIN_URL_MAPPED_TO_UNRESERVED_ADDRESS\x10\r\x12\x30\n,CUSTOM_LOGIN_URL_HAS_NON_ROUTABLE_IP_ADDRESS\x10\x0e\x12.\n*CUSTOM_LOGIN_URL_HAS_UNRESERVED_IP_ADDRESS\x10\x0f\x12\x17\n\x13\x44UPLICATE_SCAN_NAME\x10\x10\x12\x17\n\x13INVALID_FIELD_VALUE\x10\x12\x12$\n FAILED_TO_AUTHENTICATE_TO_TARGET\x10\x13\x12\x1c\n\x18\x46INDING_TYPE_UNSPECIFIED\x10\x14\x12\x1d\n\x19\x46ORBIDDEN_TO_SCAN_COMPUTE\x10\x15\x12$\n FORBIDDEN_UPDATE_TO_MANAGED_SCAN\x10+\x12\x14\n\x10MALFORMED_FILTER\x10\x16\x12\x1b\n\x17MALFORMED_RESOURCE_NAME\x10\x17\x12\x14\n\x10PROJECT_INACTIVE\x10\x18\x12\x12\n\x0eREQUIRED_FIELD\x10\x19\x12\x1e\n\x1aRESOURCE_NAME_INCONSISTENT\x10\x1a\x12\x18\n\x14SCAN_ALREADY_RUNNING\x10\x1b\x12\x14\n\x10SCAN_NOT_RUNNING\x10\x1c\x12/\n+SEED_URL_DOES_NOT_BELONG_TO_CURRENT_PROJECT\x10\x1d\x12\x16\n\x12SEED_URL_MALFORMED\x10\x1e\x12+\n\'SEED_URL_MAPPED_TO_NON_ROUTABLE_ADDRESS\x10\x1f\x12)\n%SEED_URL_MAPPED_TO_UNRESERVED_ADDRESS\x10 \x12(\n$SEED_URL_HAS_NON_ROUTABLE_IP_ADDRESS\x10!\x12&\n\"SEED_URL_HAS_UNRESERVED_IP_ADDRESS\x10#\x12\"\n\x1eSERVICE_ACCOUNT_NOT_CONFIGURED\x10$\x12\x12\n\x0eTOO_MANY_SCANS\x10%\x12\"\n\x1eUNABLE_TO_RESOLVE_PROJECT_INFO\x10&\x12(\n$UNSUPPORTED_BLACKLIST_PATTERN_FORMAT\x10\'\x12\x16\n\x12UNSUPPORTED_FILTER\x10(\x12\x1c\n\x18UNSUPPORTED_FINDING_TYPE\x10)\x12\x1a\n\x16UNSUPPORTED_URL_SCHEME\x10*\x1a\x02\x10\x01\x42\x8a\x02\n&com.google.cloud.websecurityscanner.v1B\x14ScanConfigErrorProtoP\x01ZVcloud.google.com/go/websecurityscanner/apiv1/websecurityscannerpb;websecurityscannerpb\xaa\x02\"Google.Cloud.WebSecurityScanner.V1\xca\x02\"Google\\Cloud\\WebSecurityScanner\\V1\xea\x02%Google::Cloud::WebSecurityScanner::V1b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module WebSecurityScanner - module V1 - ScanConfigError = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.websecurityscanner.v1.ScanConfigError").msgclass - ScanConfigError::Code = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.websecurityscanner.v1.ScanConfigError.Code").enummodule - end - end - end -end diff --git a/owl-bot-staging/google-cloud-web_security_scanner-v1/lib/google/cloud/websecurityscanner/v1/scan_config_pb.rb b/owl-bot-staging/google-cloud-web_security_scanner-v1/lib/google/cloud/websecurityscanner/v1/scan_config_pb.rb deleted file mode 100644 index 3100fd42944d..000000000000 --- a/owl-bot-staging/google-cloud-web_security_scanner-v1/lib/google/cloud/websecurityscanner/v1/scan_config_pb.rb +++ /dev/null @@ -1,33 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/websecurityscanner/v1/scan_config.proto - -require 'google/protobuf' - -require 'google/api/field_behavior_pb' -require 'google/protobuf/timestamp_pb' - - -descriptor_data = "\n4google/cloud/websecurityscanner/v1/scan_config.proto\x12\"google.cloud.websecurityscanner.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xc4\r\n\nScanConfig\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x14\n\x0c\x64isplay_name\x18\x02 \x01(\t\x12\x0f\n\x07max_qps\x18\x03 \x01(\x05\x12\x15\n\rstarting_urls\x18\x04 \x03(\t\x12U\n\x0e\x61uthentication\x18\x05 \x01(\x0b\x32=.google.cloud.websecurityscanner.v1.ScanConfig.Authentication\x12L\n\nuser_agent\x18\x06 \x01(\x0e\x32\x38.google.cloud.websecurityscanner.v1.ScanConfig.UserAgent\x12\x1a\n\x12\x62lacklist_patterns\x18\x07 \x03(\t\x12I\n\x08schedule\x18\x08 \x01(\x0b\x32\x37.google.cloud.websecurityscanner.v1.ScanConfig.Schedule\x12w\n!export_to_security_command_center\x18\n \x01(\x0e\x32L.google.cloud.websecurityscanner.v1.ScanConfig.ExportToSecurityCommandCenter\x12L\n\nrisk_level\x18\x0c \x01(\x0e\x32\x38.google.cloud.websecurityscanner.v1.ScanConfig.RiskLevel\x12\x14\n\x0cmanaged_scan\x18\r \x01(\x08\x12\x16\n\x0estatic_ip_scan\x18\x0e \x01(\x08\x12!\n\x19ignore_http_status_errors\x18\x0f \x01(\x08\x1a\xd7\x05\n\x0e\x41uthentication\x12i\n\x0egoogle_account\x18\x01 \x01(\x0b\x32K.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.GoogleAccountB\x02\x18\x01H\x00\x12\x65\n\x0e\x63ustom_account\x18\x02 \x01(\x0b\x32K.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.CustomAccountH\x00\x12\x65\n\x0eiap_credential\x18\x04 \x01(\x0b\x32K.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredentialH\x00\x1a\x37\n\rGoogleAccount\x12\x10\n\x08username\x18\x01 \x01(\t\x12\x10\n\x08password\x18\x02 \x01(\t:\x02\x18\x01\x1a\x46\n\rCustomAccount\x12\x10\n\x08username\x18\x01 \x01(\t\x12\x10\n\x08password\x18\x02 \x01(\t\x12\x11\n\tlogin_url\x18\x03 \x01(\t\x1a\xf8\x01\n\rIapCredential\x12\x8e\x01\n\x1diap_test_service_account_info\x18\x01 \x01(\x0b\x32\x65.google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential.IapTestServiceAccountInfoH\x00\x1a\x43\n\x19IapTestServiceAccountInfo\x12&\n\x19target_audience_client_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x42\x11\n\x0fiap_credentialsB\x10\n\x0e\x61uthentication\x1a]\n\x08Schedule\x12\x31\n\rschedule_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x1e\n\x16interval_duration_days\x18\x02 \x01(\x05\"`\n\tUserAgent\x12\x1a\n\x16USER_AGENT_UNSPECIFIED\x10\x00\x12\x10\n\x0c\x43HROME_LINUX\x10\x01\x12\x12\n\x0e\x43HROME_ANDROID\x10\x02\x12\x11\n\rSAFARI_IPHONE\x10\x03\"<\n\tRiskLevel\x12\x1a\n\x16RISK_LEVEL_UNSPECIFIED\x10\x00\x12\n\n\x06NORMAL\x10\x01\x12\x07\n\x03LOW\x10\x02\"m\n\x1d\x45xportToSecurityCommandCenter\x12\x31\n-EXPORT_TO_SECURITY_COMMAND_CENTER_UNSPECIFIED\x10\x00\x12\x0b\n\x07\x45NABLED\x10\x01\x12\x0c\n\x08\x44ISABLED\x10\x02\x42\x85\x02\n&com.google.cloud.websecurityscanner.v1B\x0fScanConfigProtoP\x01ZVcloud.google.com/go/websecurityscanner/apiv1/websecurityscannerpb;websecurityscannerpb\xaa\x02\"Google.Cloud.WebSecurityScanner.V1\xca\x02\"Google\\Cloud\\WebSecurityScanner\\V1\xea\x02%Google::Cloud::WebSecurityScanner::V1b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module WebSecurityScanner - module V1 - ScanConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.websecurityscanner.v1.ScanConfig").msgclass - ScanConfig::Authentication = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.websecurityscanner.v1.ScanConfig.Authentication").msgclass - ScanConfig::Authentication::GoogleAccount = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.websecurityscanner.v1.ScanConfig.Authentication.GoogleAccount").msgclass - ScanConfig::Authentication::CustomAccount = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.websecurityscanner.v1.ScanConfig.Authentication.CustomAccount").msgclass - ScanConfig::Authentication::IapCredential = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential").msgclass - ScanConfig::Authentication::IapCredential::IapTestServiceAccountInfo = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.websecurityscanner.v1.ScanConfig.Authentication.IapCredential.IapTestServiceAccountInfo").msgclass - ScanConfig::Schedule = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.websecurityscanner.v1.ScanConfig.Schedule").msgclass - ScanConfig::UserAgent = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.websecurityscanner.v1.ScanConfig.UserAgent").enummodule - ScanConfig::RiskLevel = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.websecurityscanner.v1.ScanConfig.RiskLevel").enummodule - ScanConfig::ExportToSecurityCommandCenter = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.websecurityscanner.v1.ScanConfig.ExportToSecurityCommandCenter").enummodule - end - end - end -end diff --git a/owl-bot-staging/google-cloud-web_security_scanner-v1/lib/google/cloud/websecurityscanner/v1/scan_run_error_trace_pb.rb b/owl-bot-staging/google-cloud-web_security_scanner-v1/lib/google/cloud/websecurityscanner/v1/scan_run_error_trace_pb.rb deleted file mode 100644 index 8d9034e3ced3..000000000000 --- a/owl-bot-staging/google-cloud-web_security_scanner-v1/lib/google/cloud/websecurityscanner/v1/scan_run_error_trace_pb.rb +++ /dev/null @@ -1,24 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/websecurityscanner/v1/scan_run_error_trace.proto - -require 'google/protobuf' - -require 'google/cloud/websecurityscanner/v1/scan_config_error_pb' - - -descriptor_data = "\n=google/cloud/websecurityscanner/v1/scan_run_error_trace.proto\x12\"google.cloud.websecurityscanner.v1\x1a:google/cloud/websecurityscanner/v1/scan_config_error.proto\"\x8d\x03\n\x11ScanRunErrorTrace\x12H\n\x04\x63ode\x18\x01 \x01(\x0e\x32:.google.cloud.websecurityscanner.v1.ScanRunErrorTrace.Code\x12N\n\x11scan_config_error\x18\x02 \x01(\x0b\x32\x33.google.cloud.websecurityscanner.v1.ScanConfigError\x12#\n\x1bmost_common_http_error_code\x18\x03 \x01(\x05\"\xb8\x01\n\x04\x43ode\x12\x14\n\x10\x43ODE_UNSPECIFIED\x10\x00\x12\x12\n\x0eINTERNAL_ERROR\x10\x01\x12\x15\n\x11SCAN_CONFIG_ISSUE\x10\x02\x12\x1f\n\x1b\x41UTHENTICATION_CONFIG_ISSUE\x10\x03\x12\x1c\n\x18TIMED_OUT_WHILE_SCANNING\x10\x04\x12\x16\n\x12TOO_MANY_REDIRECTS\x10\x05\x12\x18\n\x14TOO_MANY_HTTP_ERRORS\x10\x06\x42\x8c\x02\n&com.google.cloud.websecurityscanner.v1B\x16ScanRunErrorTraceProtoP\x01ZVcloud.google.com/go/websecurityscanner/apiv1/websecurityscannerpb;websecurityscannerpb\xaa\x02\"Google.Cloud.WebSecurityScanner.V1\xca\x02\"Google\\Cloud\\WebSecurityScanner\\V1\xea\x02%Google::Cloud::WebSecurityScanner::V1b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module WebSecurityScanner - module V1 - ScanRunErrorTrace = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.websecurityscanner.v1.ScanRunErrorTrace").msgclass - ScanRunErrorTrace::Code = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.websecurityscanner.v1.ScanRunErrorTrace.Code").enummodule - end - end - end -end diff --git a/owl-bot-staging/google-cloud-web_security_scanner-v1/lib/google/cloud/websecurityscanner/v1/scan_run_log_pb.rb b/owl-bot-staging/google-cloud-web_security_scanner-v1/lib/google/cloud/websecurityscanner/v1/scan_run_log_pb.rb deleted file mode 100644 index e20e60f2cc2e..000000000000 --- a/owl-bot-staging/google-cloud-web_security_scanner-v1/lib/google/cloud/websecurityscanner/v1/scan_run_log_pb.rb +++ /dev/null @@ -1,24 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/websecurityscanner/v1/scan_run_log.proto - -require 'google/protobuf' - -require 'google/cloud/websecurityscanner/v1/scan_run_pb' -require 'google/cloud/websecurityscanner/v1/scan_run_error_trace_pb' - - -descriptor_data = "\n5google/cloud/websecurityscanner/v1/scan_run_log.proto\x12\"google.cloud.websecurityscanner.v1\x1a\x31google/cloud/websecurityscanner/v1/scan_run.proto\x1a=google/cloud/websecurityscanner/v1/scan_run_error_trace.proto\"\xe8\x02\n\nScanRunLog\x12\x0f\n\x07summary\x18\x01 \x01(\t\x12\x0c\n\x04name\x18\x02 \x01(\t\x12S\n\x0f\x65xecution_state\x18\x03 \x01(\x0e\x32:.google.cloud.websecurityscanner.v1.ScanRun.ExecutionState\x12M\n\x0cresult_state\x18\x04 \x01(\x0e\x32\x37.google.cloud.websecurityscanner.v1.ScanRun.ResultState\x12\x1a\n\x12urls_crawled_count\x18\x05 \x01(\x03\x12\x19\n\x11urls_tested_count\x18\x06 \x01(\x03\x12\x14\n\x0chas_findings\x18\x07 \x01(\x08\x12J\n\x0b\x65rror_trace\x18\x08 \x01(\x0b\x32\x35.google.cloud.websecurityscanner.v1.ScanRunErrorTraceB\x85\x02\n&com.google.cloud.websecurityscanner.v1B\x0fScanRunLogProtoP\x01ZVcloud.google.com/go/websecurityscanner/apiv1/websecurityscannerpb;websecurityscannerpb\xaa\x02\"Google.Cloud.WebSecurityScanner.V1\xca\x02\"Google\\Cloud\\WebSecurityScanner\\V1\xea\x02%Google::Cloud::WebSecurityScanner::V1b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module WebSecurityScanner - module V1 - ScanRunLog = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.websecurityscanner.v1.ScanRunLog").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-web_security_scanner-v1/lib/google/cloud/websecurityscanner/v1/scan_run_pb.rb b/owl-bot-staging/google-cloud-web_security_scanner-v1/lib/google/cloud/websecurityscanner/v1/scan_run_pb.rb deleted file mode 100644 index 3c4d5aca5f5d..000000000000 --- a/owl-bot-staging/google-cloud-web_security_scanner-v1/lib/google/cloud/websecurityscanner/v1/scan_run_pb.rb +++ /dev/null @@ -1,27 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/websecurityscanner/v1/scan_run.proto - -require 'google/protobuf' - -require 'google/cloud/websecurityscanner/v1/scan_run_error_trace_pb' -require 'google/cloud/websecurityscanner/v1/scan_run_warning_trace_pb' -require 'google/protobuf/timestamp_pb' - - -descriptor_data = "\n1google/cloud/websecurityscanner/v1/scan_run.proto\x12\"google.cloud.websecurityscanner.v1\x1a=google/cloud/websecurityscanner/v1/scan_run_error_trace.proto\x1a?google/cloud/websecurityscanner/v1/scan_run_warning_trace.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xd0\x05\n\x07ScanRun\x12\x0c\n\x04name\x18\x01 \x01(\t\x12S\n\x0f\x65xecution_state\x18\x02 \x01(\x0e\x32:.google.cloud.websecurityscanner.v1.ScanRun.ExecutionState\x12M\n\x0cresult_state\x18\x03 \x01(\x0e\x32\x37.google.cloud.websecurityscanner.v1.ScanRun.ResultState\x12.\n\nstart_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12,\n\x08\x65nd_time\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x1a\n\x12urls_crawled_count\x18\x06 \x01(\x03\x12\x19\n\x11urls_tested_count\x18\x07 \x01(\x03\x12\x1b\n\x13has_vulnerabilities\x18\x08 \x01(\x08\x12\x18\n\x10progress_percent\x18\t \x01(\x05\x12J\n\x0b\x65rror_trace\x18\n \x01(\x0b\x32\x35.google.cloud.websecurityscanner.v1.ScanRunErrorTrace\x12O\n\x0ewarning_traces\x18\x0b \x03(\x0b\x32\x37.google.cloud.websecurityscanner.v1.ScanRunWarningTrace\"Y\n\x0e\x45xecutionState\x12\x1f\n\x1b\x45XECUTION_STATE_UNSPECIFIED\x10\x00\x12\n\n\x06QUEUED\x10\x01\x12\x0c\n\x08SCANNING\x10\x02\x12\x0c\n\x08\x46INISHED\x10\x03\"O\n\x0bResultState\x12\x1c\n\x18RESULT_STATE_UNSPECIFIED\x10\x00\x12\x0b\n\x07SUCCESS\x10\x01\x12\t\n\x05\x45RROR\x10\x02\x12\n\n\x06KILLED\x10\x03\x42\x82\x02\n&com.google.cloud.websecurityscanner.v1B\x0cScanRunProtoP\x01ZVcloud.google.com/go/websecurityscanner/apiv1/websecurityscannerpb;websecurityscannerpb\xaa\x02\"Google.Cloud.WebSecurityScanner.V1\xca\x02\"Google\\Cloud\\WebSecurityScanner\\V1\xea\x02%Google::Cloud::WebSecurityScanner::V1b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module WebSecurityScanner - module V1 - ScanRun = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.websecurityscanner.v1.ScanRun").msgclass - ScanRun::ExecutionState = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.websecurityscanner.v1.ScanRun.ExecutionState").enummodule - ScanRun::ResultState = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.websecurityscanner.v1.ScanRun.ResultState").enummodule - end - end - end -end diff --git a/owl-bot-staging/google-cloud-web_security_scanner-v1/lib/google/cloud/websecurityscanner/v1/scan_run_warning_trace_pb.rb b/owl-bot-staging/google-cloud-web_security_scanner-v1/lib/google/cloud/websecurityscanner/v1/scan_run_warning_trace_pb.rb deleted file mode 100644 index d66c3872bc73..000000000000 --- a/owl-bot-staging/google-cloud-web_security_scanner-v1/lib/google/cloud/websecurityscanner/v1/scan_run_warning_trace_pb.rb +++ /dev/null @@ -1,22 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/websecurityscanner/v1/scan_run_warning_trace.proto - -require 'google/protobuf' - - -descriptor_data = "\n?google/cloud/websecurityscanner/v1/scan_run_warning_trace.proto\x12\"google.cloud.websecurityscanner.v1\"\x95\x02\n\x13ScanRunWarningTrace\x12J\n\x04\x63ode\x18\x01 \x01(\x0e\x32<.google.cloud.websecurityscanner.v1.ScanRunWarningTrace.Code\"\xb1\x01\n\x04\x43ode\x12\x14\n\x10\x43ODE_UNSPECIFIED\x10\x00\x12\x1e\n\x1aINSUFFICIENT_CRAWL_RESULTS\x10\x01\x12\x1a\n\x16TOO_MANY_CRAWL_RESULTS\x10\x02\x12\x17\n\x13TOO_MANY_FUZZ_TASKS\x10\x03\x12\x12\n\x0e\x42LOCKED_BY_IAP\x10\x04\x12*\n&NO_STARTING_URL_FOUND_FOR_MANAGED_SCAN\x10\x05\x42\x8e\x02\n&com.google.cloud.websecurityscanner.v1B\x18ScanRunWarningTraceProtoP\x01ZVcloud.google.com/go/websecurityscanner/apiv1/websecurityscannerpb;websecurityscannerpb\xaa\x02\"Google.Cloud.WebSecurityScanner.V1\xca\x02\"Google\\Cloud\\WebSecurityScanner\\V1\xea\x02%Google::Cloud::WebSecurityScanner::V1b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module WebSecurityScanner - module V1 - ScanRunWarningTrace = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.websecurityscanner.v1.ScanRunWarningTrace").msgclass - ScanRunWarningTrace::Code = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.websecurityscanner.v1.ScanRunWarningTrace.Code").enummodule - end - end - end -end diff --git a/owl-bot-staging/google-cloud-web_security_scanner-v1/lib/google/cloud/websecurityscanner/v1/web_security_scanner_pb.rb b/owl-bot-staging/google-cloud-web_security_scanner-v1/lib/google/cloud/websecurityscanner/v1/web_security_scanner_pb.rb deleted file mode 100644 index 46ad835a2559..000000000000 --- a/owl-bot-staging/google-cloud-web_security_scanner-v1/lib/google/cloud/websecurityscanner/v1/web_security_scanner_pb.rb +++ /dev/null @@ -1,48 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/websecurityscanner/v1/web_security_scanner.proto - -require 'google/protobuf' - -require 'google/api/annotations_pb' -require 'google/api/client_pb' -require 'google/cloud/websecurityscanner/v1/crawled_url_pb' -require 'google/cloud/websecurityscanner/v1/finding_pb' -require 'google/cloud/websecurityscanner/v1/finding_type_stats_pb' -require 'google/cloud/websecurityscanner/v1/scan_config_pb' -require 'google/cloud/websecurityscanner/v1/scan_run_pb' -require 'google/protobuf/empty_pb' -require 'google/protobuf/field_mask_pb' - - -descriptor_data = "\n=google/cloud/websecurityscanner/v1/web_security_scanner.proto\x12\"google.cloud.websecurityscanner.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x34google/cloud/websecurityscanner/v1/crawled_url.proto\x1a\x30google/cloud/websecurityscanner/v1/finding.proto\x1a;google/cloud/websecurityscanner/v1/finding_type_stats.proto\x1a\x34google/cloud/websecurityscanner/v1/scan_config.proto\x1a\x31google/cloud/websecurityscanner/v1/scan_run.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\"n\n\x17\x43reateScanConfigRequest\x12\x0e\n\x06parent\x18\x01 \x01(\t\x12\x43\n\x0bscan_config\x18\x02 \x01(\x0b\x32..google.cloud.websecurityscanner.v1.ScanConfig\"\'\n\x17\x44\x65leteScanConfigRequest\x12\x0c\n\x04name\x18\x01 \x01(\t\"$\n\x14GetScanConfigRequest\x12\x0c\n\x04name\x18\x01 \x01(\t\"O\n\x16ListScanConfigsRequest\x12\x0e\n\x06parent\x18\x01 \x01(\t\x12\x12\n\npage_token\x18\x02 \x01(\t\x12\x11\n\tpage_size\x18\x03 \x01(\x05\"\x8f\x01\n\x17UpdateScanConfigRequest\x12\x43\n\x0bscan_config\x18\x02 \x01(\x0b\x32..google.cloud.websecurityscanner.v1.ScanConfig\x12/\n\x0bupdate_mask\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"x\n\x17ListScanConfigsResponse\x12\x44\n\x0cscan_configs\x18\x01 \x03(\x0b\x32..google.cloud.websecurityscanner.v1.ScanConfig\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"#\n\x13StartScanRunRequest\x12\x0c\n\x04name\x18\x01 \x01(\t\"!\n\x11GetScanRunRequest\x12\x0c\n\x04name\x18\x01 \x01(\t\"L\n\x13ListScanRunsRequest\x12\x0e\n\x06parent\x18\x01 \x01(\t\x12\x12\n\npage_token\x18\x02 \x01(\t\x12\x11\n\tpage_size\x18\x03 \x01(\x05\"o\n\x14ListScanRunsResponse\x12>\n\tscan_runs\x18\x01 \x03(\x0b\x32+.google.cloud.websecurityscanner.v1.ScanRun\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\"\n\x12StopScanRunRequest\x12\x0c\n\x04name\x18\x01 \x01(\t\"O\n\x16ListCrawledUrlsRequest\x12\x0e\n\x06parent\x18\x01 \x01(\t\x12\x12\n\npage_token\x18\x02 \x01(\t\x12\x11\n\tpage_size\x18\x03 \x01(\x05\"x\n\x17ListCrawledUrlsResponse\x12\x44\n\x0c\x63rawled_urls\x18\x01 \x03(\x0b\x32..google.cloud.websecurityscanner.v1.CrawledUrl\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"!\n\x11GetFindingRequest\x12\x0c\n\x04name\x18\x01 \x01(\t\"\\\n\x13ListFindingsRequest\x12\x0e\n\x06parent\x18\x01 \x01(\t\x12\x0e\n\x06\x66ilter\x18\x02 \x01(\t\x12\x12\n\npage_token\x18\x03 \x01(\t\x12\x11\n\tpage_size\x18\x04 \x01(\x05\"n\n\x14ListFindingsResponse\x12=\n\x08\x66indings\x18\x01 \x03(\x0b\x32+.google.cloud.websecurityscanner.v1.Finding\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"-\n\x1bListFindingTypeStatsRequest\x12\x0e\n\x06parent\x18\x01 \x01(\t\"p\n\x1cListFindingTypeStatsResponse\x12P\n\x12\x66inding_type_stats\x18\x01 \x03(\x0b\x32\x34.google.cloud.websecurityscanner.v1.FindingTypeStats2\xe9\x13\n\x12WebSecurityScanner\x12\xb9\x01\n\x10\x43reateScanConfig\x12;.google.cloud.websecurityscanner.v1.CreateScanConfigRequest\x1a..google.cloud.websecurityscanner.v1.ScanConfig\"8\x82\xd3\xe4\x93\x02\x32\"#/v1/{parent=projects/*}/scanConfigs:\x0bscan_config\x12\x94\x01\n\x10\x44\x65leteScanConfig\x12;.google.cloud.websecurityscanner.v1.DeleteScanConfigRequest\x1a\x16.google.protobuf.Empty\"+\x82\xd3\xe4\x93\x02%*#/v1/{name=projects/*/scanConfigs/*}\x12\xa6\x01\n\rGetScanConfig\x12\x38.google.cloud.websecurityscanner.v1.GetScanConfigRequest\x1a..google.cloud.websecurityscanner.v1.ScanConfig\"+\x82\xd3\xe4\x93\x02%\x12#/v1/{name=projects/*/scanConfigs/*}\x12\xb7\x01\n\x0fListScanConfigs\x12:.google.cloud.websecurityscanner.v1.ListScanConfigsRequest\x1a;.google.cloud.websecurityscanner.v1.ListScanConfigsResponse\"+\x82\xd3\xe4\x93\x02%\x12#/v1/{parent=projects/*}/scanConfigs\x12\xc5\x01\n\x10UpdateScanConfig\x12;.google.cloud.websecurityscanner.v1.UpdateScanConfigRequest\x1a..google.cloud.websecurityscanner.v1.ScanConfig\"D\x82\xd3\xe4\x93\x02>2//v1/{scan_config.name=projects/*/scanConfigs/*}:\x0bscan_config\x12\xaa\x01\n\x0cStartScanRun\x12\x37.google.cloud.websecurityscanner.v1.StartScanRunRequest\x1a+.google.cloud.websecurityscanner.v1.ScanRun\"4\x82\xd3\xe4\x93\x02.\")/v1/{name=projects/*/scanConfigs/*}:start:\x01*\x12\xa8\x01\n\nGetScanRun\x12\x35.google.cloud.websecurityscanner.v1.GetScanRunRequest\x1a+.google.cloud.websecurityscanner.v1.ScanRun\"6\x82\xd3\xe4\x93\x02\x30\x12./v1/{name=projects/*/scanConfigs/*/scanRuns/*}\x12\xb9\x01\n\x0cListScanRuns\x12\x37.google.cloud.websecurityscanner.v1.ListScanRunsRequest\x1a\x38.google.cloud.websecurityscanner.v1.ListScanRunsResponse\"6\x82\xd3\xe4\x93\x02\x30\x12./v1/{parent=projects/*/scanConfigs/*}/scanRuns\x12\xb2\x01\n\x0bStopScanRun\x12\x36.google.cloud.websecurityscanner.v1.StopScanRunRequest\x1a+.google.cloud.websecurityscanner.v1.ScanRun\">\x82\xd3\xe4\x93\x02\x38\"3/v1/{name=projects/*/scanConfigs/*/scanRuns/*}:stop:\x01*\x12\xd0\x01\n\x0fListCrawledUrls\x12:.google.cloud.websecurityscanner.v1.ListCrawledUrlsRequest\x1a;.google.cloud.websecurityscanner.v1.ListCrawledUrlsResponse\"D\x82\xd3\xe4\x93\x02>\x12] - # 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. - # - # Note: This field should not be used in most cases. - 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: - # library_settings: - # 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. - # @!attribute [rw] library_package - # @return [::String] - # The package name to use in Php. Clobbers the php_namespace option - # set in the protobuf. This should be used **only** by APIs - # who have already set the language_settings.php.package_name" field - # in gapic.yaml. API teams should use the protobuf php_namespace option - # where possible. - # - # Example of a YAML configuration:: - # - # publishing: - # library_settings: - # php_settings: - # library_package: Google\Cloud\PubSub\V1 - 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. - # - # Example: - # - # 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 - # @!attribute [rw] batching - # @return [::Google::Api::BatchingConfigProto] - # Batching configuration for an API method in client libraries. - # - # Example of a YAML configuration: - # - # publishing: - # method_settings: - # - selector: google.example.v1.ExampleService.BatchCreateExample - # batching: - # element_count_threshold: 1000 - # request_byte_threshold: 100000000 - # delay_threshold_millis: 10 - 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. - # - # Note: This feature should not be used in most cases. - # @!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 - - # `BatchingConfigProto` defines the batching configuration for an API method. - # @!attribute [rw] thresholds - # @return [::Google::Api::BatchingSettingsProto] - # The thresholds which trigger a batched request to be sent. - # @!attribute [rw] batch_descriptor - # @return [::Google::Api::BatchingDescriptorProto] - # The request and response fields used in batching. - class BatchingConfigProto - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # `BatchingSettingsProto` specifies a set of batching thresholds, each of - # which acts as a trigger to send a batch of messages as a request. At least - # one threshold must be positive nonzero. - # @!attribute [rw] element_count_threshold - # @return [::Integer] - # The number of elements of a field collected into a batch which, if - # exceeded, causes the batch to be sent. - # @!attribute [rw] request_byte_threshold - # @return [::Integer] - # The aggregated size of the batched field which, if exceeded, causes the - # batch to be sent. This size is computed by aggregating the sizes of the - # request field to be batched, not of the entire request message. - # @!attribute [rw] delay_threshold - # @return [::Google::Protobuf::Duration] - # The duration after which a batch should be sent, starting from the addition - # of the first message to that batch. - # @!attribute [rw] element_count_limit - # @return [::Integer] - # The maximum number of elements collected in a batch that could be accepted - # by server. - # @!attribute [rw] request_byte_limit - # @return [::Integer] - # The maximum size of the request that could be accepted by server. - # @!attribute [rw] flow_control_element_limit - # @return [::Integer] - # The maximum number of elements allowed by flow control. - # @!attribute [rw] flow_control_byte_limit - # @return [::Integer] - # The maximum size of data allowed by flow control. - # @!attribute [rw] flow_control_limit_exceeded_behavior - # @return [::Google::Api::FlowControlLimitExceededBehaviorProto] - # The behavior to take when the flow control limit is exceeded. - class BatchingSettingsProto - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # `BatchingDescriptorProto` specifies the fields of the request message to be - # used for batching, and, optionally, the fields of the response message to be - # used for demultiplexing. - # @!attribute [rw] batched_field - # @return [::String] - # The repeated field in the request message to be aggregated by batching. - # @!attribute [rw] discriminator_fields - # @return [::Array<::String>] - # A list of the fields in the request message. Two requests will be batched - # together only if the values of every field specified in - # `request_discriminator_fields` is equal between the two requests. - # @!attribute [rw] subresponse_field - # @return [::String] - # Optional. When present, indicates the field in the response message to be - # used to demultiplex the response into multiple response messages, in - # correspondence with the multiple request messages originally batched - # together. - class BatchingDescriptorProto - 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 - - # The behavior to take when the flow control limit is exceeded. - module FlowControlLimitExceededBehaviorProto - # Default behavior, system-defined. - UNSET_BEHAVIOR = 0 - - # Stop operation, raise error. - THROW_EXCEPTION = 1 - - # Pause operation until limit clears. - BLOCK = 2 - - # Continue operation, disregard limit. - IGNORE = 3 - end - end -end diff --git a/owl-bot-staging/google-cloud-web_security_scanner-v1/proto_docs/google/api/field_behavior.rb b/owl-bot-staging/google-cloud-web_security_scanner-v1/proto_docs/google/api/field_behavior.rb deleted file mode 100644 index 582be187d115..000000000000 --- a/owl-bot-staging/google-cloud-web_security_scanner-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-web_security_scanner-v1/proto_docs/google/api/launch_stage.rb b/owl-bot-staging/google-cloud-web_security_scanner-v1/proto_docs/google/api/launch_stage.rb deleted file mode 100644 index 9392a413fb1b..000000000000 --- a/owl-bot-staging/google-cloud-web_security_scanner-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-web_security_scanner-v1/proto_docs/google/api/resource.rb b/owl-bot-staging/google-cloud-web_security_scanner-v1/proto_docs/google/api/resource.rb deleted file mode 100644 index 25dec4847ac1..000000000000 --- a/owl-bot-staging/google-cloud-web_security_scanner-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-web_security_scanner-v1/proto_docs/google/cloud/websecurityscanner/v1/crawled_url.rb b/owl-bot-staging/google-cloud-web_security_scanner-v1/proto_docs/google/cloud/websecurityscanner/v1/crawled_url.rb deleted file mode 100644 index 8a90e045f7c6..000000000000 --- a/owl-bot-staging/google-cloud-web_security_scanner-v1/proto_docs/google/cloud/websecurityscanner/v1/crawled_url.rb +++ /dev/null @@ -1,44 +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 WebSecurityScanner - module V1 - # A CrawledUrl resource represents a URL that was crawled during a ScanRun. Web - # Security Scanner Service crawls the web applications, following all links - # within the scope of sites, to find the URLs to test against. - # @!attribute [rw] http_method - # @return [::String] - # Output only. The http method of the request that was used to visit the URL, in - # uppercase. - # @!attribute [rw] url - # @return [::String] - # Output only. The URL that was crawled. - # @!attribute [rw] body - # @return [::String] - # Output only. The body of the request that was used to visit the URL. - class CrawledUrl - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-web_security_scanner-v1/proto_docs/google/cloud/websecurityscanner/v1/finding.rb b/owl-bot-staging/google-cloud-web_security_scanner-v1/proto_docs/google/cloud/websecurityscanner/v1/finding.rb deleted file mode 100644 index a2ddddfdd390..000000000000 --- a/owl-bot-staging/google-cloud-web_security_scanner-v1/proto_docs/google/cloud/websecurityscanner/v1/finding.rb +++ /dev/null @@ -1,117 +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 WebSecurityScanner - module V1 - # A Finding resource represents a vulnerability instance identified during a - # ScanRun. - # @!attribute [rw] name - # @return [::String] - # Output only. The resource name of the Finding. The name follows the format of - # 'projects/\\{projectId}/scanConfigs/\\{scanConfigId}/scanruns/\\{scanRunId}/findings/\\{findingId}'. - # The finding IDs are generated by the system. - # @!attribute [rw] finding_type - # @return [::String] - # Output only. The type of the Finding. - # Detailed and up-to-date information on findings can be found here: - # https://cloud.google.com/security-command-center/docs/how-to-remediate-web-security-scanner-findings - # @!attribute [r] severity - # @return [::Google::Cloud::WebSecurityScanner::V1::Finding::Severity] - # Output only. The severity level of the reported vulnerability. - # @!attribute [rw] http_method - # @return [::String] - # Output only. The http method of the request that triggered the vulnerability, in - # uppercase. - # @!attribute [rw] fuzzed_url - # @return [::String] - # Output only. The URL produced by the server-side fuzzer and used in the request that - # triggered the vulnerability. - # @!attribute [rw] body - # @return [::String] - # Output only. The body of the request that triggered the vulnerability. - # @!attribute [rw] description - # @return [::String] - # Output only. The description of the vulnerability. - # @!attribute [rw] reproduction_url - # @return [::String] - # Output only. The URL containing human-readable payload that user can leverage to - # reproduce the vulnerability. - # @!attribute [rw] frame_url - # @return [::String] - # Output only. If the vulnerability was originated from nested IFrame, the immediate - # parent IFrame is reported. - # @!attribute [rw] final_url - # @return [::String] - # Output only. The URL where the browser lands when the vulnerability is detected. - # @!attribute [rw] tracking_id - # @return [::String] - # Output only. The tracking ID uniquely identifies a vulnerability instance across - # multiple ScanRuns. - # @!attribute [rw] form - # @return [::Google::Cloud::WebSecurityScanner::V1::Form] - # Output only. An addon containing information reported for a vulnerability with an HTML - # form, if any. - # @!attribute [rw] outdated_library - # @return [::Google::Cloud::WebSecurityScanner::V1::OutdatedLibrary] - # Output only. An addon containing information about outdated libraries. - # @!attribute [rw] violating_resource - # @return [::Google::Cloud::WebSecurityScanner::V1::ViolatingResource] - # Output only. An addon containing detailed information regarding any resource causing the - # vulnerability such as JavaScript sources, image, audio files, etc. - # @!attribute [rw] vulnerable_headers - # @return [::Google::Cloud::WebSecurityScanner::V1::VulnerableHeaders] - # Output only. An addon containing information about vulnerable or missing HTTP headers. - # @!attribute [rw] vulnerable_parameters - # @return [::Google::Cloud::WebSecurityScanner::V1::VulnerableParameters] - # Output only. An addon containing information about request parameters which were found - # to be vulnerable. - # @!attribute [rw] xss - # @return [::Google::Cloud::WebSecurityScanner::V1::Xss] - # Output only. An addon containing information reported for an XSS, if any. - # @!attribute [r] xxe - # @return [::Google::Cloud::WebSecurityScanner::V1::Xxe] - # Output only. An addon containing information reported for an XXE, if any. - class Finding - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The severity level of a vulnerability. - module Severity - # No severity specified. The default value. - SEVERITY_UNSPECIFIED = 0 - - # Critical severity. - CRITICAL = 1 - - # High severity. - HIGH = 2 - - # Medium severity. - MEDIUM = 3 - - # Low severity. - LOW = 4 - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-web_security_scanner-v1/proto_docs/google/cloud/websecurityscanner/v1/finding_addon.rb b/owl-bot-staging/google-cloud-web_security_scanner-v1/proto_docs/google/cloud/websecurityscanner/v1/finding_addon.rb deleted file mode 100644 index dbd7c7de4641..000000000000 --- a/owl-bot-staging/google-cloud-web_security_scanner-v1/proto_docs/google/cloud/websecurityscanner/v1/finding_addon.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 Cloud - module WebSecurityScanner - module V1 - # ! Information about a vulnerability with an HTML. - # @!attribute [rw] action_uri - # @return [::String] - # ! The URI where to send the form when it's submitted. - # @!attribute [rw] fields - # @return [::Array<::String>] - # ! The names of form fields related to the vulnerability. - class Form - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Information reported for an outdated library. - # @!attribute [rw] library_name - # @return [::String] - # The name of the outdated library. - # @!attribute [rw] version - # @return [::String] - # The version number. - # @!attribute [rw] learn_more_urls - # @return [::Array<::String>] - # URLs to learn more information about the vulnerabilities in the library. - class OutdatedLibrary - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Information regarding any resource causing the vulnerability such - # as JavaScript sources, image, audio files, etc. - # @!attribute [rw] content_type - # @return [::String] - # The MIME type of this resource. - # @!attribute [rw] resource_url - # @return [::String] - # URL of this violating resource. - class ViolatingResource - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Information about vulnerable request parameters. - # @!attribute [rw] parameter_names - # @return [::Array<::String>] - # The vulnerable parameter names. - class VulnerableParameters - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Information about vulnerable or missing HTTP Headers. - # @!attribute [rw] headers - # @return [::Array<::Google::Cloud::WebSecurityScanner::V1::VulnerableHeaders::Header>] - # List of vulnerable headers. - # @!attribute [rw] missing_headers - # @return [::Array<::Google::Cloud::WebSecurityScanner::V1::VulnerableHeaders::Header>] - # List of missing headers. - class VulnerableHeaders - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Describes a HTTP Header. - # @!attribute [rw] name - # @return [::String] - # Header name. - # @!attribute [rw] value - # @return [::String] - # Header value. - class Header - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Information reported for an XSS. - # @!attribute [rw] stack_traces - # @return [::Array<::String>] - # Stack traces leading to the point where the XSS occurred. - # @!attribute [rw] error_message - # @return [::String] - # An error message generated by a javascript breakage. - # @!attribute [rw] attack_vector - # @return [::Google::Cloud::WebSecurityScanner::V1::Xss::AttackVector] - # The attack vector of the payload triggering this XSS. - # @!attribute [rw] stored_xss_seeding_url - # @return [::String] - # The reproduction url for the seeding POST request of a Stored XSS. - class Xss - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Types of XSS attack vector. - module AttackVector - # Unknown attack vector. - ATTACK_VECTOR_UNSPECIFIED = 0 - - # The attack comes from fuzzing the browser's localStorage. - LOCAL_STORAGE = 1 - - # The attack comes from fuzzing the browser's sessionStorage. - SESSION_STORAGE = 2 - - # The attack comes from fuzzing the window's name property. - WINDOW_NAME = 3 - - # The attack comes from fuzzing the referrer property. - REFERRER = 4 - - # The attack comes from fuzzing an input element. - FORM_INPUT = 5 - - # The attack comes from fuzzing the browser's cookies. - COOKIE = 6 - - # The attack comes from hijacking the post messaging mechanism. - POST_MESSAGE = 7 - - # The attack comes from fuzzing parameters in the url. - GET_PARAMETERS = 8 - - # The attack comes from fuzzing the fragment in the url. - URL_FRAGMENT = 9 - - # The attack comes from fuzzing the HTML comments. - HTML_COMMENT = 10 - - # The attack comes from fuzzing the POST parameters. - POST_PARAMETERS = 11 - - # The attack comes from fuzzing the protocol. - PROTOCOL = 12 - - # The attack comes from the server side and is stored. - STORED_XSS = 13 - - # The attack is a Same-Origin Method Execution attack via a GET parameter. - SAME_ORIGIN = 14 - - # The attack payload is received from a third-party host via a URL that is - # user-controllable - USER_CONTROLLABLE_URL = 15 - end - end - - # Information reported for an XXE. - # @!attribute [rw] payload_value - # @return [::String] - # The XML string that triggered the XXE vulnerability. Non-payload values - # might be redacted. - # @!attribute [rw] payload_location - # @return [::Google::Cloud::WebSecurityScanner::V1::Xxe::Location] - # Location within the request where the payload was placed. - class Xxe - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Locations within a request where XML was substituted. - module Location - # Unknown Location. - LOCATION_UNSPECIFIED = 0 - - # The XML payload replaced the complete request body. - COMPLETE_REQUEST_BODY = 1 - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-web_security_scanner-v1/proto_docs/google/cloud/websecurityscanner/v1/finding_type_stats.rb b/owl-bot-staging/google-cloud-web_security_scanner-v1/proto_docs/google/cloud/websecurityscanner/v1/finding_type_stats.rb deleted file mode 100644 index d7c9d4981c94..000000000000 --- a/owl-bot-staging/google-cloud-web_security_scanner-v1/proto_docs/google/cloud/websecurityscanner/v1/finding_type_stats.rb +++ /dev/null @@ -1,39 +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 WebSecurityScanner - module V1 - # A FindingTypeStats resource represents stats regarding a specific FindingType - # of Findings under a given ScanRun. - # @!attribute [rw] finding_type - # @return [::String] - # Output only. The finding type associated with the stats. - # @!attribute [rw] finding_count - # @return [::Integer] - # Output only. The count of findings belonging to this finding type. - class FindingTypeStats - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-web_security_scanner-v1/proto_docs/google/cloud/websecurityscanner/v1/scan_config.rb b/owl-bot-staging/google-cloud-web_security_scanner-v1/proto_docs/google/cloud/websecurityscanner/v1/scan_config.rb deleted file mode 100644 index b09c2e974d3b..000000000000 --- a/owl-bot-staging/google-cloud-web_security_scanner-v1/proto_docs/google/cloud/websecurityscanner/v1/scan_config.rb +++ /dev/null @@ -1,211 +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 WebSecurityScanner - module V1 - # A ScanConfig resource contains the configurations to launch a scan. - # @!attribute [rw] name - # @return [::String] - # The resource name of the ScanConfig. The name follows the format of - # 'projects/\\{projectId}/scanConfigs/\\{scanConfigId}'. The ScanConfig IDs are - # generated by the system. - # @!attribute [rw] display_name - # @return [::String] - # Required. The user provided display name of the ScanConfig. - # @!attribute [rw] max_qps - # @return [::Integer] - # The maximum QPS during scanning. A valid value ranges from 5 to 20 - # inclusively. If the field is unspecified or its value is set 0, server will - # default to 15. Other values outside of [5, 20] range will be rejected with - # INVALID_ARGUMENT error. - # @!attribute [rw] starting_urls - # @return [::Array<::String>] - # Required. The starting URLs from which the scanner finds site pages. - # @!attribute [rw] authentication - # @return [::Google::Cloud::WebSecurityScanner::V1::ScanConfig::Authentication] - # The authentication configuration. If specified, service will use the - # authentication configuration during scanning. - # @!attribute [rw] user_agent - # @return [::Google::Cloud::WebSecurityScanner::V1::ScanConfig::UserAgent] - # The user agent used during scanning. - # @!attribute [rw] blacklist_patterns - # @return [::Array<::String>] - # The excluded URL patterns as described in - # https://cloud.google.com/security-command-center/docs/how-to-use-web-security-scanner#excluding_urls - # @!attribute [rw] schedule - # @return [::Google::Cloud::WebSecurityScanner::V1::ScanConfig::Schedule] - # The schedule of the ScanConfig. - # @!attribute [rw] export_to_security_command_center - # @return [::Google::Cloud::WebSecurityScanner::V1::ScanConfig::ExportToSecurityCommandCenter] - # Controls export of scan configurations and results to Security - # Command Center. - # @!attribute [rw] risk_level - # @return [::Google::Cloud::WebSecurityScanner::V1::ScanConfig::RiskLevel] - # The risk level selected for the scan - # @!attribute [rw] managed_scan - # @return [::Boolean] - # Whether the scan config is managed by Web Security Scanner, output - # only. - # @!attribute [rw] static_ip_scan - # @return [::Boolean] - # Whether the scan configuration has enabled static IP address scan feature. - # If enabled, the scanner will access applications from static IP addresses. - # @!attribute [rw] ignore_http_status_errors - # @return [::Boolean] - # Whether to keep scanning even if most requests return HTTP error codes. - class ScanConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Scan authentication configuration. - # @!attribute [rw] google_account - # @deprecated This field is deprecated and may be removed in the next major version update. - # @return [::Google::Cloud::WebSecurityScanner::V1::ScanConfig::Authentication::GoogleAccount] - # Authentication using a Google account. - # - # Note: The following fields are mutually exclusive: `google_account`, `custom_account`, `iap_credential`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] custom_account - # @return [::Google::Cloud::WebSecurityScanner::V1::ScanConfig::Authentication::CustomAccount] - # Authentication using a custom account. - # - # Note: The following fields are mutually exclusive: `custom_account`, `google_account`, `iap_credential`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] iap_credential - # @return [::Google::Cloud::WebSecurityScanner::V1::ScanConfig::Authentication::IapCredential] - # Authentication using Identity-Aware-Proxy (IAP). - # - # Note: The following fields are mutually exclusive: `iap_credential`, `google_account`, `custom_account`. If a field in that set is populated, all other fields in the set will automatically be cleared. - class Authentication - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Describes authentication configuration that uses a Google account. - # @deprecated This message is deprecated and may be removed in the next major version update. - # @!attribute [rw] username - # @return [::String] - # Required. The user name of the Google account. - # @!attribute [rw] password - # @return [::String] - # Required. Input only. The password of the Google account. The credential is stored encrypted - # and not returned in any response nor included in audit logs. - class GoogleAccount - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Describes authentication configuration that uses a custom account. - # @!attribute [rw] username - # @return [::String] - # Required. The user name of the custom account. - # @!attribute [rw] password - # @return [::String] - # Required. Input only. The password of the custom account. The credential is stored encrypted - # and not returned in any response nor included in audit logs. - # @!attribute [rw] login_url - # @return [::String] - # Required. The login form URL of the website. - class CustomAccount - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Describes authentication configuration for Identity-Aware-Proxy (IAP). - # @!attribute [rw] iap_test_service_account_info - # @return [::Google::Cloud::WebSecurityScanner::V1::ScanConfig::Authentication::IapCredential::IapTestServiceAccountInfo] - # Authentication configuration when Web-Security-Scanner service - # account is added in Identity-Aware-Proxy (IAP) access policies. - class IapCredential - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Describes authentication configuration when Web-Security-Scanner - # service account is added in Identity-Aware-Proxy (IAP) access policies. - # @!attribute [rw] target_audience_client_id - # @return [::String] - # Required. Describes OAuth2 client id of resources protected by - # Identity-Aware-Proxy (IAP). - class IapTestServiceAccountInfo - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - - # Scan schedule configuration. - # @!attribute [rw] schedule_time - # @return [::Google::Protobuf::Timestamp] - # A timestamp indicates when the next run will be scheduled. The value is - # refreshed by the server after each run. If unspecified, it will default - # to current server time, which means the scan will be scheduled to start - # immediately. - # @!attribute [rw] interval_duration_days - # @return [::Integer] - # Required. The duration of time between executions in days. - class Schedule - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Type of user agents used for scanning. - module UserAgent - # The user agent is unknown. Service will default to CHROME_LINUX. - USER_AGENT_UNSPECIFIED = 0 - - # Chrome on Linux. This is the service default if unspecified. - CHROME_LINUX = 1 - - # Chrome on Android. - CHROME_ANDROID = 2 - - # Safari on IPhone. - SAFARI_IPHONE = 3 - end - - # Scan risk levels supported by Web Security Scanner. LOW impact - # scanning will minimize requests with the potential to modify data. To - # achieve the maximum scan coverage, NORMAL risk level is recommended. - module RiskLevel - # Use default, which is NORMAL. - RISK_LEVEL_UNSPECIFIED = 0 - - # Normal scanning (Recommended) - NORMAL = 1 - - # Lower impact scanning - LOW = 2 - end - - # Controls export of scan configurations and results to Security - # Command Center. - module ExportToSecurityCommandCenter - # Use default, which is ENABLED. - EXPORT_TO_SECURITY_COMMAND_CENTER_UNSPECIFIED = 0 - - # Export results of this scan to Security Command Center. - ENABLED = 1 - - # Do not export results of this scan to Security Command Center. - DISABLED = 2 - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-web_security_scanner-v1/proto_docs/google/cloud/websecurityscanner/v1/scan_config_error.rb b/owl-bot-staging/google-cloud-web_security_scanner-v1/proto_docs/google/cloud/websecurityscanner/v1/scan_config_error.rb deleted file mode 100644 index d8e3b62c7efe..000000000000 --- a/owl-bot-staging/google-cloud-web_security_scanner-v1/proto_docs/google/cloud/websecurityscanner/v1/scan_config_error.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 Cloud - module WebSecurityScanner - module V1 - # Defines a custom error message used by CreateScanConfig and UpdateScanConfig - # APIs when scan configuration validation fails. It is also reported as part of - # a ScanRunErrorTrace message if scan validation fails due to a scan - # configuration error. - # @!attribute [rw] code - # @return [::Google::Cloud::WebSecurityScanner::V1::ScanConfigError::Code] - # Output only. Indicates the reason code for a configuration failure. - # @!attribute [rw] field_name - # @return [::String] - # Output only. Indicates the full name of the ScanConfig field that triggers this error, - # for example "scan_config.max_qps". This field is provided for - # troubleshooting purposes only and its actual value can change in the - # future. - class ScanConfigError - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Output only. - # Defines an error reason code. - # Next id: 44 - module Code - # There is no error. - CODE_UNSPECIFIED = 0 - - # There is no error. - OK = 0 - - # Indicates an internal server error. - # Please DO NOT USE THIS ERROR CODE unless the root cause is truly unknown. - INTERNAL_ERROR = 1 - - # One of the seed URLs is an App Engine URL but we cannot validate the scan - # settings due to an App Engine API backend error. - APPENGINE_API_BACKEND_ERROR = 2 - - # One of the seed URLs is an App Engine URL but we cannot access the - # App Engine API to validate scan settings. - APPENGINE_API_NOT_ACCESSIBLE = 3 - - # One of the seed URLs is an App Engine URL but the Default Host of the - # App Engine is not set. - APPENGINE_DEFAULT_HOST_MISSING = 4 - - # Google corporate accounts can not be used for scanning. - CANNOT_USE_GOOGLE_COM_ACCOUNT = 6 - - # The account of the scan creator can not be used for scanning. - CANNOT_USE_OWNER_ACCOUNT = 7 - - # This scan targets Compute Engine, but we cannot validate scan settings - # due to a Compute Engine API backend error. - COMPUTE_API_BACKEND_ERROR = 8 - - # This scan targets Compute Engine, but we cannot access the Compute Engine - # API to validate the scan settings. - COMPUTE_API_NOT_ACCESSIBLE = 9 - - # The Custom Login URL does not belong to the current project. - CUSTOM_LOGIN_URL_DOES_NOT_BELONG_TO_CURRENT_PROJECT = 10 - - # The Custom Login URL is malformed (can not be parsed). - CUSTOM_LOGIN_URL_MALFORMED = 11 - - # The Custom Login URL is mapped to a non-routable IP address in DNS. - CUSTOM_LOGIN_URL_MAPPED_TO_NON_ROUTABLE_ADDRESS = 12 - - # The Custom Login URL is mapped to an IP address which is not reserved for - # the current project. - CUSTOM_LOGIN_URL_MAPPED_TO_UNRESERVED_ADDRESS = 13 - - # The Custom Login URL has a non-routable IP address. - CUSTOM_LOGIN_URL_HAS_NON_ROUTABLE_IP_ADDRESS = 14 - - # The Custom Login URL has an IP address which is not reserved for the - # current project. - CUSTOM_LOGIN_URL_HAS_UNRESERVED_IP_ADDRESS = 15 - - # Another scan with the same name (case-sensitive) already exists. - DUPLICATE_SCAN_NAME = 16 - - # A field is set to an invalid value. - INVALID_FIELD_VALUE = 18 - - # There was an error trying to authenticate to the scan target. - FAILED_TO_AUTHENTICATE_TO_TARGET = 19 - - # Finding type value is not specified in the list findings request. - FINDING_TYPE_UNSPECIFIED = 20 - - # Scan targets Compute Engine, yet current project was not whitelisted for - # Google Compute Engine Scanning Alpha access. - FORBIDDEN_TO_SCAN_COMPUTE = 21 - - # User tries to update managed scan - FORBIDDEN_UPDATE_TO_MANAGED_SCAN = 43 - - # The supplied filter is malformed. For example, it can not be parsed, does - # not have a filter type in expression, or the same filter type appears - # more than once. - MALFORMED_FILTER = 22 - - # The supplied resource name is malformed (can not be parsed). - MALFORMED_RESOURCE_NAME = 23 - - # The current project is not in an active state. - PROJECT_INACTIVE = 24 - - # A required field is not set. - REQUIRED_FIELD = 25 - - # Project id, scanconfig id, scanrun id, or finding id are not consistent - # with each other in resource name. - RESOURCE_NAME_INCONSISTENT = 26 - - # The scan being requested to start is already running. - SCAN_ALREADY_RUNNING = 27 - - # The scan that was requested to be stopped is not running. - SCAN_NOT_RUNNING = 28 - - # One of the seed URLs does not belong to the current project. - SEED_URL_DOES_NOT_BELONG_TO_CURRENT_PROJECT = 29 - - # One of the seed URLs is malformed (can not be parsed). - SEED_URL_MALFORMED = 30 - - # One of the seed URLs is mapped to a non-routable IP address in DNS. - SEED_URL_MAPPED_TO_NON_ROUTABLE_ADDRESS = 31 - - # One of the seed URLs is mapped to an IP address which is not reserved - # for the current project. - SEED_URL_MAPPED_TO_UNRESERVED_ADDRESS = 32 - - # One of the seed URLs has on-routable IP address. - SEED_URL_HAS_NON_ROUTABLE_IP_ADDRESS = 33 - - # One of the seed URLs has an IP address that is not reserved - # for the current project. - SEED_URL_HAS_UNRESERVED_IP_ADDRESS = 35 - - # The Web Security Scanner service account is not configured under the - # project. - SERVICE_ACCOUNT_NOT_CONFIGURED = 36 - - # A project has reached the maximum number of scans. - TOO_MANY_SCANS = 37 - - # Resolving the details of the current project fails. - UNABLE_TO_RESOLVE_PROJECT_INFO = 38 - - # One or more blacklist patterns were in the wrong format. - UNSUPPORTED_BLACKLIST_PATTERN_FORMAT = 39 - - # The supplied filter is not supported. - UNSUPPORTED_FILTER = 40 - - # The supplied finding type is not supported. For example, we do not - # provide findings of the given finding type. - UNSUPPORTED_FINDING_TYPE = 41 - - # The URL scheme of one or more of the supplied URLs is not supported. - UNSUPPORTED_URL_SCHEME = 42 - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-web_security_scanner-v1/proto_docs/google/cloud/websecurityscanner/v1/scan_run.rb b/owl-bot-staging/google-cloud-web_security_scanner-v1/proto_docs/google/cloud/websecurityscanner/v1/scan_run.rb deleted file mode 100644 index a7b461044a50..000000000000 --- a/owl-bot-staging/google-cloud-web_security_scanner-v1/proto_docs/google/cloud/websecurityscanner/v1/scan_run.rb +++ /dev/null @@ -1,110 +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 WebSecurityScanner - module V1 - # A ScanRun is a output-only resource representing an actual run of the scan. - # Next id: 12 - # @!attribute [rw] name - # @return [::String] - # Output only. The resource name of the ScanRun. The name follows the format of - # 'projects/\\{projectId}/scanConfigs/\\{scanConfigId}/scanRuns/\\{scanRunId}'. - # The ScanRun IDs are generated by the system. - # @!attribute [rw] execution_state - # @return [::Google::Cloud::WebSecurityScanner::V1::ScanRun::ExecutionState] - # Output only. The execution state of the ScanRun. - # @!attribute [rw] result_state - # @return [::Google::Cloud::WebSecurityScanner::V1::ScanRun::ResultState] - # Output only. The result state of the ScanRun. This field is only available after the - # execution state reaches "FINISHED". - # @!attribute [rw] start_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time at which the ScanRun started. - # @!attribute [rw] end_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time at which the ScanRun reached termination state - that the ScanRun - # is either finished or stopped by user. - # @!attribute [rw] urls_crawled_count - # @return [::Integer] - # Output only. The number of URLs crawled during this ScanRun. If the scan is in progress, - # the value represents the number of URLs crawled up to now. - # @!attribute [rw] urls_tested_count - # @return [::Integer] - # Output only. The number of URLs tested during this ScanRun. If the scan is in progress, - # the value represents the number of URLs tested up to now. The number of - # URLs tested is usually larger than the number URLS crawled because - # typically a crawled URL is tested with multiple test payloads. - # @!attribute [rw] has_vulnerabilities - # @return [::Boolean] - # Output only. Whether the scan run has found any vulnerabilities. - # @!attribute [rw] progress_percent - # @return [::Integer] - # Output only. The percentage of total completion ranging from 0 to 100. - # If the scan is in queue, the value is 0. - # If the scan is running, the value ranges from 0 to 100. - # If the scan is finished, the value is 100. - # @!attribute [rw] error_trace - # @return [::Google::Cloud::WebSecurityScanner::V1::ScanRunErrorTrace] - # Output only. If result_state is an ERROR, this field provides the primary reason for - # scan's termination and more details, if such are available. - # @!attribute [rw] warning_traces - # @return [::Array<::Google::Cloud::WebSecurityScanner::V1::ScanRunWarningTrace>] - # Output only. A list of warnings, if such are encountered during this scan run. - class ScanRun - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Types of ScanRun execution state. - module ExecutionState - # Represents an invalid state caused by internal server error. This value - # should never be returned. - EXECUTION_STATE_UNSPECIFIED = 0 - - # The scan is waiting in the queue. - QUEUED = 1 - - # The scan is in progress. - SCANNING = 2 - - # The scan is either finished or stopped by user. - FINISHED = 3 - end - - # Types of ScanRun result state. - module ResultState - # Default value. This value is returned when the ScanRun is not yet - # finished. - RESULT_STATE_UNSPECIFIED = 0 - - # The scan finished without errors. - SUCCESS = 1 - - # The scan finished with errors. - ERROR = 2 - - # The scan was terminated by user. - KILLED = 3 - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-web_security_scanner-v1/proto_docs/google/cloud/websecurityscanner/v1/scan_run_error_trace.rb b/owl-bot-staging/google-cloud-web_security_scanner-v1/proto_docs/google/cloud/websecurityscanner/v1/scan_run_error_trace.rb deleted file mode 100644 index c5e493b73771..000000000000 --- a/owl-bot-staging/google-cloud-web_security_scanner-v1/proto_docs/google/cloud/websecurityscanner/v1/scan_run_error_trace.rb +++ /dev/null @@ -1,77 +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 WebSecurityScanner - module V1 - # Output only. - # Defines an error trace message for a ScanRun. - # @!attribute [rw] code - # @return [::Google::Cloud::WebSecurityScanner::V1::ScanRunErrorTrace::Code] - # Output only. Indicates the error reason code. - # @!attribute [rw] scan_config_error - # @return [::Google::Cloud::WebSecurityScanner::V1::ScanConfigError] - # Output only. If the scan encounters SCAN_CONFIG_ISSUE error, this field has the error - # message encountered during scan configuration validation that is performed - # before each scan run. - # @!attribute [rw] most_common_http_error_code - # @return [::Integer] - # Output only. If the scan encounters TOO_MANY_HTTP_ERRORS, this field indicates the most - # common HTTP error code, if such is available. For example, if this code is - # 404, the scan has encountered too many NOT_FOUND responses. - class ScanRunErrorTrace - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Output only. - # Defines an error reason code. - # Next id: 8 - module Code - # Default value is never used. - CODE_UNSPECIFIED = 0 - - # Indicates that the scan run failed due to an internal server error. - INTERNAL_ERROR = 1 - - # Indicates a scan configuration error, usually due to outdated ScanConfig - # settings, such as starting_urls or the DNS configuration. - SCAN_CONFIG_ISSUE = 2 - - # Indicates an authentication error, usually due to outdated ScanConfig - # authentication settings. - AUTHENTICATION_CONFIG_ISSUE = 3 - - # Indicates a scan operation timeout, usually caused by a very large site. - TIMED_OUT_WHILE_SCANNING = 4 - - # Indicates that a scan encountered excessive redirects, either to - # authentication or some other page outside of the scan scope. - TOO_MANY_REDIRECTS = 5 - - # Indicates that a scan encountered numerous errors from the web site - # pages. When available, most_common_http_error_code field indicates the - # most common HTTP error code encountered during the scan. - TOO_MANY_HTTP_ERRORS = 6 - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-web_security_scanner-v1/proto_docs/google/cloud/websecurityscanner/v1/scan_run_log.rb b/owl-bot-staging/google-cloud-web_security_scanner-v1/proto_docs/google/cloud/websecurityscanner/v1/scan_run_log.rb deleted file mode 100644 index dcf836b52240..000000000000 --- a/owl-bot-staging/google-cloud-web_security_scanner-v1/proto_docs/google/cloud/websecurityscanner/v1/scan_run_log.rb +++ /dev/null @@ -1,56 +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 WebSecurityScanner - module V1 - # A ScanRunLog is an output-only proto used for Stackdriver customer logging. - # It is used for logs covering the start and end of scan pipelines. - # Other than an added summary, this is a subset of the ScanRun. - # Representation in logs is either a proto Struct, or converted to JSON. - # Next id: 9 - # @!attribute [rw] summary - # @return [::String] - # Human friendly message about the event. - # @!attribute [rw] name - # @return [::String] - # The resource name of the ScanRun being logged. - # @!attribute [rw] execution_state - # @return [::Google::Cloud::WebSecurityScanner::V1::ScanRun::ExecutionState] - # The execution state of the ScanRun. - # @!attribute [rw] result_state - # @return [::Google::Cloud::WebSecurityScanner::V1::ScanRun::ResultState] - # The result state of the ScanRun. - # @!attribute [rw] urls_crawled_count - # @return [::Integer] - # @!attribute [rw] urls_tested_count - # @return [::Integer] - # @!attribute [rw] has_findings - # @return [::Boolean] - # @!attribute [rw] error_trace - # @return [::Google::Cloud::WebSecurityScanner::V1::ScanRunErrorTrace] - class ScanRunLog - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-web_security_scanner-v1/proto_docs/google/cloud/websecurityscanner/v1/scan_run_warning_trace.rb b/owl-bot-staging/google-cloud-web_security_scanner-v1/proto_docs/google/cloud/websecurityscanner/v1/scan_run_warning_trace.rb deleted file mode 100644 index c6d38093f5ee..000000000000 --- a/owl-bot-staging/google-cloud-web_security_scanner-v1/proto_docs/google/cloud/websecurityscanner/v1/scan_run_warning_trace.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! - - -module Google - module Cloud - module WebSecurityScanner - module V1 - # Output only. - # Defines a warning trace message for ScanRun. Warning traces provide customers - # with useful information that helps make the scanning process more effective. - # @!attribute [rw] code - # @return [::Google::Cloud::WebSecurityScanner::V1::ScanRunWarningTrace::Code] - # Output only. Indicates the warning code. - class ScanRunWarningTrace - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Output only. - # Defines a warning message code. - # Next id: 6 - module Code - # Default value is never used. - CODE_UNSPECIFIED = 0 - - # Indicates that a scan discovered an unexpectedly low number of URLs. This - # is sometimes caused by complex navigation features or by using a single - # URL for numerous pages. - INSUFFICIENT_CRAWL_RESULTS = 1 - - # Indicates that a scan discovered too many URLs to test, or excessive - # redundant URLs. - TOO_MANY_CRAWL_RESULTS = 2 - - # Indicates that too many tests have been generated for the scan. Customer - # should try reducing the number of starting URLs, increasing the QPS rate, - # or narrowing down the scope of the scan using the excluded patterns. - TOO_MANY_FUZZ_TASKS = 3 - - # Indicates that a scan is blocked by IAP. - BLOCKED_BY_IAP = 4 - - # Indicates that no seeds is found for a scan - NO_STARTING_URL_FOUND_FOR_MANAGED_SCAN = 5 - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-web_security_scanner-v1/proto_docs/google/cloud/websecurityscanner/v1/web_security_scanner.rb b/owl-bot-staging/google-cloud-web_security_scanner-v1/proto_docs/google/cloud/websecurityscanner/v1/web_security_scanner.rb deleted file mode 100644 index 218897aed41e..000000000000 --- a/owl-bot-staging/google-cloud-web_security_scanner-v1/proto_docs/google/cloud/websecurityscanner/v1/web_security_scanner.rb +++ /dev/null @@ -1,278 +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 WebSecurityScanner - module V1 - # Request for the `CreateScanConfig` method. - # @!attribute [rw] parent - # @return [::String] - # Required. The parent resource name where the scan is created, which should be a - # project resource name in the format 'projects/\\{projectId}'. - # @!attribute [rw] scan_config - # @return [::Google::Cloud::WebSecurityScanner::V1::ScanConfig] - # Required. The ScanConfig to be created. - class CreateScanConfigRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request for the `DeleteScanConfig` method. - # @!attribute [rw] name - # @return [::String] - # Required. The resource name of the ScanConfig to be deleted. The name follows the - # format of 'projects/\\{projectId}/scanConfigs/\\{scanConfigId}'. - class DeleteScanConfigRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request for the `GetScanConfig` method. - # @!attribute [rw] name - # @return [::String] - # Required. The resource name of the ScanConfig to be returned. The name follows the - # format of 'projects/\\{projectId}/scanConfigs/\\{scanConfigId}'. - class GetScanConfigRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request for the `ListScanConfigs` method. - # @!attribute [rw] parent - # @return [::String] - # Required. The parent resource name, which should be a project resource name in the - # format 'projects/\\{projectId}'. - # @!attribute [rw] page_token - # @return [::String] - # A token identifying a page of results to be returned. This should be a - # `next_page_token` value returned from a previous List request. - # If unspecified, the first page of results is returned. - # @!attribute [rw] page_size - # @return [::Integer] - # The maximum number of ScanConfigs to return, can be limited by server. - # If not specified or not positive, the implementation will select a - # reasonable value. - class ListScanConfigsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request for the `UpdateScanConfigRequest` method. - # @!attribute [rw] scan_config - # @return [::Google::Cloud::WebSecurityScanner::V1::ScanConfig] - # Required. The ScanConfig to be updated. The name field must be set to identify the - # resource to be updated. The values of fields not covered by the mask - # will be ignored. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # Required. The update mask applies to the resource. For the `FieldMask` definition, - # see - # https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask - class UpdateScanConfigRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response for the `ListScanConfigs` method. - # @!attribute [rw] scan_configs - # @return [::Array<::Google::Cloud::WebSecurityScanner::V1::ScanConfig>] - # The list of ScanConfigs returned. - # @!attribute [rw] next_page_token - # @return [::String] - # Token to retrieve the next page of results, or empty if there are no - # more results in the list. - class ListScanConfigsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request for the `StartScanRun` method. - # @!attribute [rw] name - # @return [::String] - # Required. The resource name of the ScanConfig to be used. The name follows the - # format of 'projects/\\{projectId}/scanConfigs/\\{scanConfigId}'. - class StartScanRunRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request for the `GetScanRun` method. - # @!attribute [rw] name - # @return [::String] - # Required. The resource name of the ScanRun to be returned. The name follows the - # format of - # 'projects/\\{projectId}/scanConfigs/\\{scanConfigId}/scanRuns/\\{scanRunId}'. - class GetScanRunRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request for the `ListScanRuns` method. - # @!attribute [rw] parent - # @return [::String] - # Required. The parent resource name, which should be a scan resource name in the - # format 'projects/\\{projectId}/scanConfigs/\\{scanConfigId}'. - # @!attribute [rw] page_token - # @return [::String] - # A token identifying a page of results to be returned. This should be a - # `next_page_token` value returned from a previous List request. - # If unspecified, the first page of results is returned. - # @!attribute [rw] page_size - # @return [::Integer] - # The maximum number of ScanRuns to return, can be limited by server. - # If not specified or not positive, the implementation will select a - # reasonable value. - class ListScanRunsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response for the `ListScanRuns` method. - # @!attribute [rw] scan_runs - # @return [::Array<::Google::Cloud::WebSecurityScanner::V1::ScanRun>] - # The list of ScanRuns returned. - # @!attribute [rw] next_page_token - # @return [::String] - # Token to retrieve the next page of results, or empty if there are no - # more results in the list. - class ListScanRunsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request for the `StopScanRun` method. - # @!attribute [rw] name - # @return [::String] - # Required. The resource name of the ScanRun to be stopped. The name follows the - # format of - # 'projects/\\{projectId}/scanConfigs/\\{scanConfigId}/scanRuns/\\{scanRunId}'. - class StopScanRunRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request for the `ListCrawledUrls` method. - # @!attribute [rw] parent - # @return [::String] - # Required. The parent resource name, which should be a scan run resource name in the - # format - # 'projects/\\{projectId}/scanConfigs/\\{scanConfigId}/scanRuns/\\{scanRunId}'. - # @!attribute [rw] page_token - # @return [::String] - # A token identifying a page of results to be returned. This should be a - # `next_page_token` value returned from a previous List request. - # If unspecified, the first page of results is returned. - # @!attribute [rw] page_size - # @return [::Integer] - # The maximum number of CrawledUrls to return, can be limited by server. - # If not specified or not positive, the implementation will select a - # reasonable value. - class ListCrawledUrlsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response for the `ListCrawledUrls` method. - # @!attribute [rw] crawled_urls - # @return [::Array<::Google::Cloud::WebSecurityScanner::V1::CrawledUrl>] - # The list of CrawledUrls returned. - # @!attribute [rw] next_page_token - # @return [::String] - # Token to retrieve the next page of results, or empty if there are no - # more results in the list. - class ListCrawledUrlsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request for the `GetFinding` method. - # @!attribute [rw] name - # @return [::String] - # Required. The resource name of the Finding to be returned. The name follows the - # format of - # 'projects/\\{projectId}/scanConfigs/\\{scanConfigId}/scanRuns/\\{scanRunId}/findings/\\{findingId}'. - class GetFindingRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request for the `ListFindings` method. - # @!attribute [rw] parent - # @return [::String] - # Required. The parent resource name, which should be a scan run resource name in the - # format - # 'projects/\\{projectId}/scanConfigs/\\{scanConfigId}/scanRuns/\\{scanRunId}'. - # @!attribute [rw] filter - # @return [::String] - # The filter expression. The expression must be in the format: - # . - # Supported field: 'finding_type'. - # Supported operator: '='. - # @!attribute [rw] page_token - # @return [::String] - # A token identifying a page of results to be returned. This should be a - # `next_page_token` value returned from a previous List request. - # If unspecified, the first page of results is returned. - # @!attribute [rw] page_size - # @return [::Integer] - # The maximum number of Findings to return, can be limited by server. - # If not specified or not positive, the implementation will select a - # reasonable value. - class ListFindingsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response for the `ListFindings` method. - # @!attribute [rw] findings - # @return [::Array<::Google::Cloud::WebSecurityScanner::V1::Finding>] - # The list of Findings returned. - # @!attribute [rw] next_page_token - # @return [::String] - # Token to retrieve the next page of results, or empty if there are no - # more results in the list. - class ListFindingsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request for the `ListFindingTypeStats` method. - # @!attribute [rw] parent - # @return [::String] - # Required. The parent resource name, which should be a scan run resource name in the - # format - # 'projects/\\{projectId}/scanConfigs/\\{scanConfigId}/scanRuns/\\{scanRunId}'. - class ListFindingTypeStatsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response for the `ListFindingTypeStats` method. - # @!attribute [rw] finding_type_stats - # @return [::Array<::Google::Cloud::WebSecurityScanner::V1::FindingTypeStats>] - # The list of FindingTypeStats returned. - class ListFindingTypeStatsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-web_security_scanner-v1/proto_docs/google/protobuf/duration.rb b/owl-bot-staging/google-cloud-web_security_scanner-v1/proto_docs/google/protobuf/duration.rb deleted file mode 100644 index ea59f1f91daf..000000000000 --- a/owl-bot-staging/google-cloud-web_security_scanner-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-web_security_scanner-v1/proto_docs/google/protobuf/empty.rb b/owl-bot-staging/google-cloud-web_security_scanner-v1/proto_docs/google/protobuf/empty.rb deleted file mode 100644 index 83e4481834a6..000000000000 --- a/owl-bot-staging/google-cloud-web_security_scanner-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-web_security_scanner-v1/proto_docs/google/protobuf/field_mask.rb b/owl-bot-staging/google-cloud-web_security_scanner-v1/proto_docs/google/protobuf/field_mask.rb deleted file mode 100644 index 7f3ffc78601a..000000000000 --- a/owl-bot-staging/google-cloud-web_security_scanner-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-web_security_scanner-v1/proto_docs/google/protobuf/timestamp.rb b/owl-bot-staging/google-cloud-web_security_scanner-v1/proto_docs/google/protobuf/timestamp.rb deleted file mode 100644 index 74352be9c58c..000000000000 --- a/owl-bot-staging/google-cloud-web_security_scanner-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-web_security_scanner-v1/snippets/Gemfile b/owl-bot-staging/google-cloud-web_security_scanner-v1/snippets/Gemfile deleted file mode 100644 index 9c79128c7f82..000000000000 --- a/owl-bot-staging/google-cloud-web_security_scanner-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-web_security_scanner-v1", path: "../" -else - gem "google-cloud-web_security_scanner-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-web_security_scanner-v1/snippets/snippet_metadata_google.cloud.websecurityscanner.v1.json b/owl-bot-staging/google-cloud-web_security_scanner-v1/snippets/snippet_metadata_google.cloud.websecurityscanner.v1.json deleted file mode 100644 index ff90b544b895..000000000000 --- a/owl-bot-staging/google-cloud-web_security_scanner-v1/snippets/snippet_metadata_google.cloud.websecurityscanner.v1.json +++ /dev/null @@ -1,535 +0,0 @@ -{ - "client_library": { - "name": "google-cloud-web_security_scanner-v1", - "version": "", - "language": "RUBY", - "apis": [ - { - "id": "google.cloud.websecurityscanner.v1", - "version": "v1" - } - ] - }, - "snippets": [ - { - "region_tag": "websecurityscanner_v1_generated_WebSecurityScanner_CreateScanConfig_sync", - "title": "Snippet for the create_scan_config call in the WebSecurityScanner service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client#create_scan_config.", - "file": "web_security_scanner/create_scan_config.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_scan_config", - "full_name": "::Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client#create_scan_config", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::WebSecurityScanner::V1::CreateScanConfigRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::WebSecurityScanner::V1::ScanConfig", - "client": { - "short_name": "WebSecurityScanner::Client", - "full_name": "::Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client" - }, - "method": { - "short_name": "CreateScanConfig", - "full_name": "google.cloud.websecurityscanner.v1.WebSecurityScanner.CreateScanConfig", - "service": { - "short_name": "WebSecurityScanner", - "full_name": "google.cloud.websecurityscanner.v1.WebSecurityScanner" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "websecurityscanner_v1_generated_WebSecurityScanner_DeleteScanConfig_sync", - "title": "Snippet for the delete_scan_config call in the WebSecurityScanner service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client#delete_scan_config.", - "file": "web_security_scanner/delete_scan_config.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_scan_config", - "full_name": "::Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client#delete_scan_config", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::WebSecurityScanner::V1::DeleteScanConfigRequest", - "name": "request" - } - ], - "result_type": "::Google::Protobuf::Empty", - "client": { - "short_name": "WebSecurityScanner::Client", - "full_name": "::Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client" - }, - "method": { - "short_name": "DeleteScanConfig", - "full_name": "google.cloud.websecurityscanner.v1.WebSecurityScanner.DeleteScanConfig", - "service": { - "short_name": "WebSecurityScanner", - "full_name": "google.cloud.websecurityscanner.v1.WebSecurityScanner" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "websecurityscanner_v1_generated_WebSecurityScanner_GetScanConfig_sync", - "title": "Snippet for the get_scan_config call in the WebSecurityScanner service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client#get_scan_config.", - "file": "web_security_scanner/get_scan_config.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_scan_config", - "full_name": "::Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client#get_scan_config", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::WebSecurityScanner::V1::GetScanConfigRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::WebSecurityScanner::V1::ScanConfig", - "client": { - "short_name": "WebSecurityScanner::Client", - "full_name": "::Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client" - }, - "method": { - "short_name": "GetScanConfig", - "full_name": "google.cloud.websecurityscanner.v1.WebSecurityScanner.GetScanConfig", - "service": { - "short_name": "WebSecurityScanner", - "full_name": "google.cloud.websecurityscanner.v1.WebSecurityScanner" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "websecurityscanner_v1_generated_WebSecurityScanner_ListScanConfigs_sync", - "title": "Snippet for the list_scan_configs call in the WebSecurityScanner service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client#list_scan_configs.", - "file": "web_security_scanner/list_scan_configs.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_scan_configs", - "full_name": "::Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client#list_scan_configs", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::WebSecurityScanner::V1::ListScanConfigsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::WebSecurityScanner::V1::ListScanConfigsResponse", - "client": { - "short_name": "WebSecurityScanner::Client", - "full_name": "::Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client" - }, - "method": { - "short_name": "ListScanConfigs", - "full_name": "google.cloud.websecurityscanner.v1.WebSecurityScanner.ListScanConfigs", - "service": { - "short_name": "WebSecurityScanner", - "full_name": "google.cloud.websecurityscanner.v1.WebSecurityScanner" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "websecurityscanner_v1_generated_WebSecurityScanner_UpdateScanConfig_sync", - "title": "Snippet for the update_scan_config call in the WebSecurityScanner service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client#update_scan_config.", - "file": "web_security_scanner/update_scan_config.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_scan_config", - "full_name": "::Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client#update_scan_config", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::WebSecurityScanner::V1::UpdateScanConfigRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::WebSecurityScanner::V1::ScanConfig", - "client": { - "short_name": "WebSecurityScanner::Client", - "full_name": "::Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client" - }, - "method": { - "short_name": "UpdateScanConfig", - "full_name": "google.cloud.websecurityscanner.v1.WebSecurityScanner.UpdateScanConfig", - "service": { - "short_name": "WebSecurityScanner", - "full_name": "google.cloud.websecurityscanner.v1.WebSecurityScanner" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "websecurityscanner_v1_generated_WebSecurityScanner_StartScanRun_sync", - "title": "Snippet for the start_scan_run call in the WebSecurityScanner service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client#start_scan_run.", - "file": "web_security_scanner/start_scan_run.rb", - "language": "RUBY", - "client_method": { - "short_name": "start_scan_run", - "full_name": "::Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client#start_scan_run", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::WebSecurityScanner::V1::StartScanRunRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::WebSecurityScanner::V1::ScanRun", - "client": { - "short_name": "WebSecurityScanner::Client", - "full_name": "::Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client" - }, - "method": { - "short_name": "StartScanRun", - "full_name": "google.cloud.websecurityscanner.v1.WebSecurityScanner.StartScanRun", - "service": { - "short_name": "WebSecurityScanner", - "full_name": "google.cloud.websecurityscanner.v1.WebSecurityScanner" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "websecurityscanner_v1_generated_WebSecurityScanner_GetScanRun_sync", - "title": "Snippet for the get_scan_run call in the WebSecurityScanner service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client#get_scan_run.", - "file": "web_security_scanner/get_scan_run.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_scan_run", - "full_name": "::Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client#get_scan_run", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::WebSecurityScanner::V1::GetScanRunRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::WebSecurityScanner::V1::ScanRun", - "client": { - "short_name": "WebSecurityScanner::Client", - "full_name": "::Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client" - }, - "method": { - "short_name": "GetScanRun", - "full_name": "google.cloud.websecurityscanner.v1.WebSecurityScanner.GetScanRun", - "service": { - "short_name": "WebSecurityScanner", - "full_name": "google.cloud.websecurityscanner.v1.WebSecurityScanner" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "websecurityscanner_v1_generated_WebSecurityScanner_ListScanRuns_sync", - "title": "Snippet for the list_scan_runs call in the WebSecurityScanner service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client#list_scan_runs.", - "file": "web_security_scanner/list_scan_runs.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_scan_runs", - "full_name": "::Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client#list_scan_runs", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::WebSecurityScanner::V1::ListScanRunsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::WebSecurityScanner::V1::ListScanRunsResponse", - "client": { - "short_name": "WebSecurityScanner::Client", - "full_name": "::Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client" - }, - "method": { - "short_name": "ListScanRuns", - "full_name": "google.cloud.websecurityscanner.v1.WebSecurityScanner.ListScanRuns", - "service": { - "short_name": "WebSecurityScanner", - "full_name": "google.cloud.websecurityscanner.v1.WebSecurityScanner" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "websecurityscanner_v1_generated_WebSecurityScanner_StopScanRun_sync", - "title": "Snippet for the stop_scan_run call in the WebSecurityScanner service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client#stop_scan_run.", - "file": "web_security_scanner/stop_scan_run.rb", - "language": "RUBY", - "client_method": { - "short_name": "stop_scan_run", - "full_name": "::Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client#stop_scan_run", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::WebSecurityScanner::V1::StopScanRunRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::WebSecurityScanner::V1::ScanRun", - "client": { - "short_name": "WebSecurityScanner::Client", - "full_name": "::Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client" - }, - "method": { - "short_name": "StopScanRun", - "full_name": "google.cloud.websecurityscanner.v1.WebSecurityScanner.StopScanRun", - "service": { - "short_name": "WebSecurityScanner", - "full_name": "google.cloud.websecurityscanner.v1.WebSecurityScanner" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "websecurityscanner_v1_generated_WebSecurityScanner_ListCrawledUrls_sync", - "title": "Snippet for the list_crawled_urls call in the WebSecurityScanner service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client#list_crawled_urls.", - "file": "web_security_scanner/list_crawled_urls.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_crawled_urls", - "full_name": "::Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client#list_crawled_urls", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::WebSecurityScanner::V1::ListCrawledUrlsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::WebSecurityScanner::V1::ListCrawledUrlsResponse", - "client": { - "short_name": "WebSecurityScanner::Client", - "full_name": "::Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client" - }, - "method": { - "short_name": "ListCrawledUrls", - "full_name": "google.cloud.websecurityscanner.v1.WebSecurityScanner.ListCrawledUrls", - "service": { - "short_name": "WebSecurityScanner", - "full_name": "google.cloud.websecurityscanner.v1.WebSecurityScanner" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "websecurityscanner_v1_generated_WebSecurityScanner_GetFinding_sync", - "title": "Snippet for the get_finding call in the WebSecurityScanner service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client#get_finding.", - "file": "web_security_scanner/get_finding.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_finding", - "full_name": "::Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client#get_finding", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::WebSecurityScanner::V1::GetFindingRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::WebSecurityScanner::V1::Finding", - "client": { - "short_name": "WebSecurityScanner::Client", - "full_name": "::Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client" - }, - "method": { - "short_name": "GetFinding", - "full_name": "google.cloud.websecurityscanner.v1.WebSecurityScanner.GetFinding", - "service": { - "short_name": "WebSecurityScanner", - "full_name": "google.cloud.websecurityscanner.v1.WebSecurityScanner" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "websecurityscanner_v1_generated_WebSecurityScanner_ListFindings_sync", - "title": "Snippet for the list_findings call in the WebSecurityScanner service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client#list_findings.", - "file": "web_security_scanner/list_findings.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_findings", - "full_name": "::Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client#list_findings", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::WebSecurityScanner::V1::ListFindingsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::WebSecurityScanner::V1::ListFindingsResponse", - "client": { - "short_name": "WebSecurityScanner::Client", - "full_name": "::Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client" - }, - "method": { - "short_name": "ListFindings", - "full_name": "google.cloud.websecurityscanner.v1.WebSecurityScanner.ListFindings", - "service": { - "short_name": "WebSecurityScanner", - "full_name": "google.cloud.websecurityscanner.v1.WebSecurityScanner" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "websecurityscanner_v1_generated_WebSecurityScanner_ListFindingTypeStats_sync", - "title": "Snippet for the list_finding_type_stats call in the WebSecurityScanner service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client#list_finding_type_stats.", - "file": "web_security_scanner/list_finding_type_stats.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_finding_type_stats", - "full_name": "::Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client#list_finding_type_stats", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::WebSecurityScanner::V1::ListFindingTypeStatsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::WebSecurityScanner::V1::ListFindingTypeStatsResponse", - "client": { - "short_name": "WebSecurityScanner::Client", - "full_name": "::Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client" - }, - "method": { - "short_name": "ListFindingTypeStats", - "full_name": "google.cloud.websecurityscanner.v1.WebSecurityScanner.ListFindingTypeStats", - "service": { - "short_name": "WebSecurityScanner", - "full_name": "google.cloud.websecurityscanner.v1.WebSecurityScanner" - } - } - }, - "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-web_security_scanner-v1/snippets/web_security_scanner/create_scan_config.rb b/owl-bot-staging/google-cloud-web_security_scanner-v1/snippets/web_security_scanner/create_scan_config.rb deleted file mode 100644 index 3411dbe3c686..000000000000 --- a/owl-bot-staging/google-cloud-web_security_scanner-v1/snippets/web_security_scanner/create_scan_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 websecurityscanner_v1_generated_WebSecurityScanner_CreateScanConfig_sync] -require "google/cloud/web_security_scanner/v1" - -## -# Snippet for the create_scan_config call in the WebSecurityScanner 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::WebSecurityScanner::V1::WebSecurityScanner::Client#create_scan_config. -# -def create_scan_config - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::WebSecurityScanner::V1::CreateScanConfigRequest.new - - # Call the create_scan_config method. - result = client.create_scan_config request - - # The returned object is of type Google::Cloud::WebSecurityScanner::V1::ScanConfig. - p result -end -# [END websecurityscanner_v1_generated_WebSecurityScanner_CreateScanConfig_sync] diff --git a/owl-bot-staging/google-cloud-web_security_scanner-v1/snippets/web_security_scanner/delete_scan_config.rb b/owl-bot-staging/google-cloud-web_security_scanner-v1/snippets/web_security_scanner/delete_scan_config.rb deleted file mode 100644 index 3c3c38833327..000000000000 --- a/owl-bot-staging/google-cloud-web_security_scanner-v1/snippets/web_security_scanner/delete_scan_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 websecurityscanner_v1_generated_WebSecurityScanner_DeleteScanConfig_sync] -require "google/cloud/web_security_scanner/v1" - -## -# Snippet for the delete_scan_config call in the WebSecurityScanner 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::WebSecurityScanner::V1::WebSecurityScanner::Client#delete_scan_config. -# -def delete_scan_config - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::WebSecurityScanner::V1::DeleteScanConfigRequest.new - - # Call the delete_scan_config method. - result = client.delete_scan_config request - - # The returned object is of type Google::Protobuf::Empty. - p result -end -# [END websecurityscanner_v1_generated_WebSecurityScanner_DeleteScanConfig_sync] diff --git a/owl-bot-staging/google-cloud-web_security_scanner-v1/snippets/web_security_scanner/get_finding.rb b/owl-bot-staging/google-cloud-web_security_scanner-v1/snippets/web_security_scanner/get_finding.rb deleted file mode 100644 index 7264a0da4ec4..000000000000 --- a/owl-bot-staging/google-cloud-web_security_scanner-v1/snippets/web_security_scanner/get_finding.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 websecurityscanner_v1_generated_WebSecurityScanner_GetFinding_sync] -require "google/cloud/web_security_scanner/v1" - -## -# Snippet for the get_finding call in the WebSecurityScanner 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::WebSecurityScanner::V1::WebSecurityScanner::Client#get_finding. -# -def get_finding - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::WebSecurityScanner::V1::GetFindingRequest.new - - # Call the get_finding method. - result = client.get_finding request - - # The returned object is of type Google::Cloud::WebSecurityScanner::V1::Finding. - p result -end -# [END websecurityscanner_v1_generated_WebSecurityScanner_GetFinding_sync] diff --git a/owl-bot-staging/google-cloud-web_security_scanner-v1/snippets/web_security_scanner/get_scan_config.rb b/owl-bot-staging/google-cloud-web_security_scanner-v1/snippets/web_security_scanner/get_scan_config.rb deleted file mode 100644 index e98d311e44c2..000000000000 --- a/owl-bot-staging/google-cloud-web_security_scanner-v1/snippets/web_security_scanner/get_scan_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 websecurityscanner_v1_generated_WebSecurityScanner_GetScanConfig_sync] -require "google/cloud/web_security_scanner/v1" - -## -# Snippet for the get_scan_config call in the WebSecurityScanner 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::WebSecurityScanner::V1::WebSecurityScanner::Client#get_scan_config. -# -def get_scan_config - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::WebSecurityScanner::V1::GetScanConfigRequest.new - - # Call the get_scan_config method. - result = client.get_scan_config request - - # The returned object is of type Google::Cloud::WebSecurityScanner::V1::ScanConfig. - p result -end -# [END websecurityscanner_v1_generated_WebSecurityScanner_GetScanConfig_sync] diff --git a/owl-bot-staging/google-cloud-web_security_scanner-v1/snippets/web_security_scanner/get_scan_run.rb b/owl-bot-staging/google-cloud-web_security_scanner-v1/snippets/web_security_scanner/get_scan_run.rb deleted file mode 100644 index 81e3f63c8ea6..000000000000 --- a/owl-bot-staging/google-cloud-web_security_scanner-v1/snippets/web_security_scanner/get_scan_run.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 websecurityscanner_v1_generated_WebSecurityScanner_GetScanRun_sync] -require "google/cloud/web_security_scanner/v1" - -## -# Snippet for the get_scan_run call in the WebSecurityScanner 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::WebSecurityScanner::V1::WebSecurityScanner::Client#get_scan_run. -# -def get_scan_run - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::WebSecurityScanner::V1::GetScanRunRequest.new - - # Call the get_scan_run method. - result = client.get_scan_run request - - # The returned object is of type Google::Cloud::WebSecurityScanner::V1::ScanRun. - p result -end -# [END websecurityscanner_v1_generated_WebSecurityScanner_GetScanRun_sync] diff --git a/owl-bot-staging/google-cloud-web_security_scanner-v1/snippets/web_security_scanner/list_crawled_urls.rb b/owl-bot-staging/google-cloud-web_security_scanner-v1/snippets/web_security_scanner/list_crawled_urls.rb deleted file mode 100644 index c168ec342ee5..000000000000 --- a/owl-bot-staging/google-cloud-web_security_scanner-v1/snippets/web_security_scanner/list_crawled_urls.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 websecurityscanner_v1_generated_WebSecurityScanner_ListCrawledUrls_sync] -require "google/cloud/web_security_scanner/v1" - -## -# Snippet for the list_crawled_urls call in the WebSecurityScanner 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::WebSecurityScanner::V1::WebSecurityScanner::Client#list_crawled_urls. -# -def list_crawled_urls - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::WebSecurityScanner::V1::ListCrawledUrlsRequest.new - - # Call the list_crawled_urls method. - result = client.list_crawled_urls 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::WebSecurityScanner::V1::CrawledUrl. - p item - end -end -# [END websecurityscanner_v1_generated_WebSecurityScanner_ListCrawledUrls_sync] diff --git a/owl-bot-staging/google-cloud-web_security_scanner-v1/snippets/web_security_scanner/list_finding_type_stats.rb b/owl-bot-staging/google-cloud-web_security_scanner-v1/snippets/web_security_scanner/list_finding_type_stats.rb deleted file mode 100644 index b86e8985075e..000000000000 --- a/owl-bot-staging/google-cloud-web_security_scanner-v1/snippets/web_security_scanner/list_finding_type_stats.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 websecurityscanner_v1_generated_WebSecurityScanner_ListFindingTypeStats_sync] -require "google/cloud/web_security_scanner/v1" - -## -# Snippet for the list_finding_type_stats call in the WebSecurityScanner 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::WebSecurityScanner::V1::WebSecurityScanner::Client#list_finding_type_stats. -# -def list_finding_type_stats - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::WebSecurityScanner::V1::ListFindingTypeStatsRequest.new - - # Call the list_finding_type_stats method. - result = client.list_finding_type_stats request - - # The returned object is of type Google::Cloud::WebSecurityScanner::V1::ListFindingTypeStatsResponse. - p result -end -# [END websecurityscanner_v1_generated_WebSecurityScanner_ListFindingTypeStats_sync] diff --git a/owl-bot-staging/google-cloud-web_security_scanner-v1/snippets/web_security_scanner/list_findings.rb b/owl-bot-staging/google-cloud-web_security_scanner-v1/snippets/web_security_scanner/list_findings.rb deleted file mode 100644 index cfc4dc3cb5fb..000000000000 --- a/owl-bot-staging/google-cloud-web_security_scanner-v1/snippets/web_security_scanner/list_findings.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 websecurityscanner_v1_generated_WebSecurityScanner_ListFindings_sync] -require "google/cloud/web_security_scanner/v1" - -## -# Snippet for the list_findings call in the WebSecurityScanner 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::WebSecurityScanner::V1::WebSecurityScanner::Client#list_findings. -# -def list_findings - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::WebSecurityScanner::V1::ListFindingsRequest.new - - # Call the list_findings method. - result = client.list_findings 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::WebSecurityScanner::V1::Finding. - p item - end -end -# [END websecurityscanner_v1_generated_WebSecurityScanner_ListFindings_sync] diff --git a/owl-bot-staging/google-cloud-web_security_scanner-v1/snippets/web_security_scanner/list_scan_configs.rb b/owl-bot-staging/google-cloud-web_security_scanner-v1/snippets/web_security_scanner/list_scan_configs.rb deleted file mode 100644 index fa3fbb15c6b2..000000000000 --- a/owl-bot-staging/google-cloud-web_security_scanner-v1/snippets/web_security_scanner/list_scan_configs.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 websecurityscanner_v1_generated_WebSecurityScanner_ListScanConfigs_sync] -require "google/cloud/web_security_scanner/v1" - -## -# Snippet for the list_scan_configs call in the WebSecurityScanner 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::WebSecurityScanner::V1::WebSecurityScanner::Client#list_scan_configs. -# -def list_scan_configs - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::WebSecurityScanner::V1::ListScanConfigsRequest.new - - # Call the list_scan_configs method. - result = client.list_scan_configs 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::WebSecurityScanner::V1::ScanConfig. - p item - end -end -# [END websecurityscanner_v1_generated_WebSecurityScanner_ListScanConfigs_sync] diff --git a/owl-bot-staging/google-cloud-web_security_scanner-v1/snippets/web_security_scanner/list_scan_runs.rb b/owl-bot-staging/google-cloud-web_security_scanner-v1/snippets/web_security_scanner/list_scan_runs.rb deleted file mode 100644 index 57fa3759c1f3..000000000000 --- a/owl-bot-staging/google-cloud-web_security_scanner-v1/snippets/web_security_scanner/list_scan_runs.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 websecurityscanner_v1_generated_WebSecurityScanner_ListScanRuns_sync] -require "google/cloud/web_security_scanner/v1" - -## -# Snippet for the list_scan_runs call in the WebSecurityScanner 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::WebSecurityScanner::V1::WebSecurityScanner::Client#list_scan_runs. -# -def list_scan_runs - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::WebSecurityScanner::V1::ListScanRunsRequest.new - - # Call the list_scan_runs method. - result = client.list_scan_runs 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::WebSecurityScanner::V1::ScanRun. - p item - end -end -# [END websecurityscanner_v1_generated_WebSecurityScanner_ListScanRuns_sync] diff --git a/owl-bot-staging/google-cloud-web_security_scanner-v1/snippets/web_security_scanner/start_scan_run.rb b/owl-bot-staging/google-cloud-web_security_scanner-v1/snippets/web_security_scanner/start_scan_run.rb deleted file mode 100644 index 4ec4ae4d692e..000000000000 --- a/owl-bot-staging/google-cloud-web_security_scanner-v1/snippets/web_security_scanner/start_scan_run.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 websecurityscanner_v1_generated_WebSecurityScanner_StartScanRun_sync] -require "google/cloud/web_security_scanner/v1" - -## -# Snippet for the start_scan_run call in the WebSecurityScanner 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::WebSecurityScanner::V1::WebSecurityScanner::Client#start_scan_run. -# -def start_scan_run - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::WebSecurityScanner::V1::StartScanRunRequest.new - - # Call the start_scan_run method. - result = client.start_scan_run request - - # The returned object is of type Google::Cloud::WebSecurityScanner::V1::ScanRun. - p result -end -# [END websecurityscanner_v1_generated_WebSecurityScanner_StartScanRun_sync] diff --git a/owl-bot-staging/google-cloud-web_security_scanner-v1/snippets/web_security_scanner/stop_scan_run.rb b/owl-bot-staging/google-cloud-web_security_scanner-v1/snippets/web_security_scanner/stop_scan_run.rb deleted file mode 100644 index 4c9a5b9df3ef..000000000000 --- a/owl-bot-staging/google-cloud-web_security_scanner-v1/snippets/web_security_scanner/stop_scan_run.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 websecurityscanner_v1_generated_WebSecurityScanner_StopScanRun_sync] -require "google/cloud/web_security_scanner/v1" - -## -# Snippet for the stop_scan_run call in the WebSecurityScanner 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::WebSecurityScanner::V1::WebSecurityScanner::Client#stop_scan_run. -# -def stop_scan_run - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::WebSecurityScanner::V1::StopScanRunRequest.new - - # Call the stop_scan_run method. - result = client.stop_scan_run request - - # The returned object is of type Google::Cloud::WebSecurityScanner::V1::ScanRun. - p result -end -# [END websecurityscanner_v1_generated_WebSecurityScanner_StopScanRun_sync] diff --git a/owl-bot-staging/google-cloud-web_security_scanner-v1/snippets/web_security_scanner/update_scan_config.rb b/owl-bot-staging/google-cloud-web_security_scanner-v1/snippets/web_security_scanner/update_scan_config.rb deleted file mode 100644 index 69d927b6d8f7..000000000000 --- a/owl-bot-staging/google-cloud-web_security_scanner-v1/snippets/web_security_scanner/update_scan_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 websecurityscanner_v1_generated_WebSecurityScanner_UpdateScanConfig_sync] -require "google/cloud/web_security_scanner/v1" - -## -# Snippet for the update_scan_config call in the WebSecurityScanner 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::WebSecurityScanner::V1::WebSecurityScanner::Client#update_scan_config. -# -def update_scan_config - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::WebSecurityScanner::V1::UpdateScanConfigRequest.new - - # Call the update_scan_config method. - result = client.update_scan_config request - - # The returned object is of type Google::Cloud::WebSecurityScanner::V1::ScanConfig. - p result -end -# [END websecurityscanner_v1_generated_WebSecurityScanner_UpdateScanConfig_sync] diff --git a/owl-bot-staging/google-cloud-web_security_scanner-v1/test/google/cloud/web_security_scanner/v1/web_security_scanner_rest_test.rb b/owl-bot-staging/google-cloud-web_security_scanner-v1/test/google/cloud/web_security_scanner/v1/web_security_scanner_rest_test.rb deleted file mode 100644 index 53d4f0c97247..000000000000 --- a/owl-bot-staging/google-cloud-web_security_scanner-v1/test/google/cloud/web_security_scanner/v1/web_security_scanner_rest_test.rb +++ /dev/null @@ -1,812 +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/websecurityscanner/v1/web_security_scanner_pb" -require "google/cloud/web_security_scanner/v1/web_security_scanner/rest" - - -class ::Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::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_scan_config - # Create test objects. - client_result = ::Google::Cloud::WebSecurityScanner::V1::ScanConfig.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - scan_config = {} - - create_scan_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::WebSecurityScanner::V1::WebSecurityScanner::Rest::ServiceStub.stub :transcode_create_scan_config_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_scan_config_client_stub do - # Create client - client = ::Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_scan_config({ parent: parent, scan_config: scan_config }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_scan_config parent: parent, scan_config: scan_config do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_scan_config ::Google::Cloud::WebSecurityScanner::V1::CreateScanConfigRequest.new(parent: parent, scan_config: scan_config) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_scan_config({ parent: parent, scan_config: scan_config }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_scan_config(::Google::Cloud::WebSecurityScanner::V1::CreateScanConfigRequest.new(parent: parent, scan_config: scan_config), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_scan_config_client_stub.call_count - end - end - end - - def test_delete_scan_config - # 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_scan_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::WebSecurityScanner::V1::WebSecurityScanner::Rest::ServiceStub.stub :transcode_delete_scan_config_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_scan_config_client_stub do - # Create client - client = ::Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.delete_scan_config({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.delete_scan_config name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.delete_scan_config ::Google::Cloud::WebSecurityScanner::V1::DeleteScanConfigRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.delete_scan_config({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.delete_scan_config(::Google::Cloud::WebSecurityScanner::V1::DeleteScanConfigRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, delete_scan_config_client_stub.call_count - end - end - end - - def test_get_scan_config - # Create test objects. - client_result = ::Google::Cloud::WebSecurityScanner::V1::ScanConfig.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_scan_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::WebSecurityScanner::V1::WebSecurityScanner::Rest::ServiceStub.stub :transcode_get_scan_config_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_scan_config_client_stub do - # Create client - client = ::Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_scan_config({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_scan_config name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_scan_config ::Google::Cloud::WebSecurityScanner::V1::GetScanConfigRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_scan_config({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_scan_config(::Google::Cloud::WebSecurityScanner::V1::GetScanConfigRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_scan_config_client_stub.call_count - end - end - end - - def test_list_scan_configs - # Create test objects. - client_result = ::Google::Cloud::WebSecurityScanner::V1::ListScanConfigsResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - page_token = "hello world" - page_size = 42 - - list_scan_configs_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::WebSecurityScanner::V1::WebSecurityScanner::Rest::ServiceStub.stub :transcode_list_scan_configs_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_scan_configs_client_stub do - # Create client - client = ::Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_scan_configs({ parent: parent, page_token: page_token, page_size: page_size }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.list_scan_configs parent: parent, page_token: page_token, page_size: page_size do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.list_scan_configs ::Google::Cloud::WebSecurityScanner::V1::ListScanConfigsRequest.new(parent: parent, page_token: page_token, page_size: page_size) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.list_scan_configs({ parent: parent, page_token: page_token, page_size: page_size }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.list_scan_configs(::Google::Cloud::WebSecurityScanner::V1::ListScanConfigsRequest.new(parent: parent, page_token: page_token, page_size: page_size), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, list_scan_configs_client_stub.call_count - end - end - end - - def test_update_scan_config - # Create test objects. - client_result = ::Google::Cloud::WebSecurityScanner::V1::ScanConfig.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - scan_config = {} - update_mask = {} - - update_scan_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::WebSecurityScanner::V1::WebSecurityScanner::Rest::ServiceStub.stub :transcode_update_scan_config_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_scan_config_client_stub do - # Create client - client = ::Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.update_scan_config({ scan_config: scan_config, update_mask: update_mask }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.update_scan_config scan_config: scan_config, update_mask: update_mask do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.update_scan_config ::Google::Cloud::WebSecurityScanner::V1::UpdateScanConfigRequest.new(scan_config: scan_config, update_mask: update_mask) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.update_scan_config({ scan_config: scan_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_scan_config(::Google::Cloud::WebSecurityScanner::V1::UpdateScanConfigRequest.new(scan_config: scan_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_scan_config_client_stub.call_count - end - end - end - - def test_start_scan_run - # Create test objects. - client_result = ::Google::Cloud::WebSecurityScanner::V1::ScanRun.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - start_scan_run_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::WebSecurityScanner::V1::WebSecurityScanner::Rest::ServiceStub.stub :transcode_start_scan_run_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, start_scan_run_client_stub do - # Create client - client = ::Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.start_scan_run({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.start_scan_run name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.start_scan_run ::Google::Cloud::WebSecurityScanner::V1::StartScanRunRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.start_scan_run({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.start_scan_run(::Google::Cloud::WebSecurityScanner::V1::StartScanRunRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, start_scan_run_client_stub.call_count - end - end - end - - def test_get_scan_run - # Create test objects. - client_result = ::Google::Cloud::WebSecurityScanner::V1::ScanRun.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_scan_run_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::WebSecurityScanner::V1::WebSecurityScanner::Rest::ServiceStub.stub :transcode_get_scan_run_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_scan_run_client_stub do - # Create client - client = ::Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_scan_run({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_scan_run name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_scan_run ::Google::Cloud::WebSecurityScanner::V1::GetScanRunRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_scan_run({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_scan_run(::Google::Cloud::WebSecurityScanner::V1::GetScanRunRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_scan_run_client_stub.call_count - end - end - end - - def test_list_scan_runs - # Create test objects. - client_result = ::Google::Cloud::WebSecurityScanner::V1::ListScanRunsResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - page_token = "hello world" - page_size = 42 - - list_scan_runs_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::WebSecurityScanner::V1::WebSecurityScanner::Rest::ServiceStub.stub :transcode_list_scan_runs_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_scan_runs_client_stub do - # Create client - client = ::Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_scan_runs({ parent: parent, page_token: page_token, page_size: page_size }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.list_scan_runs parent: parent, page_token: page_token, page_size: page_size do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.list_scan_runs ::Google::Cloud::WebSecurityScanner::V1::ListScanRunsRequest.new(parent: parent, page_token: page_token, page_size: page_size) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.list_scan_runs({ parent: parent, page_token: page_token, page_size: page_size }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.list_scan_runs(::Google::Cloud::WebSecurityScanner::V1::ListScanRunsRequest.new(parent: parent, page_token: page_token, page_size: page_size), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, list_scan_runs_client_stub.call_count - end - end - end - - def test_stop_scan_run - # Create test objects. - client_result = ::Google::Cloud::WebSecurityScanner::V1::ScanRun.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - stop_scan_run_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::WebSecurityScanner::V1::WebSecurityScanner::Rest::ServiceStub.stub :transcode_stop_scan_run_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, stop_scan_run_client_stub do - # Create client - client = ::Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.stop_scan_run({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.stop_scan_run name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.stop_scan_run ::Google::Cloud::WebSecurityScanner::V1::StopScanRunRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.stop_scan_run({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.stop_scan_run(::Google::Cloud::WebSecurityScanner::V1::StopScanRunRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, stop_scan_run_client_stub.call_count - end - end - end - - def test_list_crawled_urls - # Create test objects. - client_result = ::Google::Cloud::WebSecurityScanner::V1::ListCrawledUrlsResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - page_token = "hello world" - page_size = 42 - - list_crawled_urls_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::WebSecurityScanner::V1::WebSecurityScanner::Rest::ServiceStub.stub :transcode_list_crawled_urls_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_crawled_urls_client_stub do - # Create client - client = ::Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_crawled_urls({ parent: parent, page_token: page_token, page_size: page_size }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.list_crawled_urls parent: parent, page_token: page_token, page_size: page_size do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.list_crawled_urls ::Google::Cloud::WebSecurityScanner::V1::ListCrawledUrlsRequest.new(parent: parent, page_token: page_token, page_size: page_size) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.list_crawled_urls({ parent: parent, page_token: page_token, page_size: page_size }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.list_crawled_urls(::Google::Cloud::WebSecurityScanner::V1::ListCrawledUrlsRequest.new(parent: parent, page_token: page_token, page_size: page_size), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, list_crawled_urls_client_stub.call_count - end - end - end - - def test_get_finding - # Create test objects. - client_result = ::Google::Cloud::WebSecurityScanner::V1::Finding.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_finding_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::WebSecurityScanner::V1::WebSecurityScanner::Rest::ServiceStub.stub :transcode_get_finding_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_finding_client_stub do - # Create client - client = ::Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_finding({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_finding name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_finding ::Google::Cloud::WebSecurityScanner::V1::GetFindingRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_finding({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_finding(::Google::Cloud::WebSecurityScanner::V1::GetFindingRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_finding_client_stub.call_count - end - end - end - - def test_list_findings - # Create test objects. - client_result = ::Google::Cloud::WebSecurityScanner::V1::ListFindingsResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - filter = "hello world" - page_token = "hello world" - page_size = 42 - - list_findings_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::WebSecurityScanner::V1::WebSecurityScanner::Rest::ServiceStub.stub :transcode_list_findings_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_findings_client_stub do - # Create client - client = ::Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_findings({ parent: parent, filter: filter, page_token: page_token, page_size: page_size }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.list_findings parent: parent, filter: filter, page_token: page_token, page_size: page_size do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.list_findings ::Google::Cloud::WebSecurityScanner::V1::ListFindingsRequest.new(parent: parent, filter: filter, page_token: page_token, page_size: page_size) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.list_findings({ parent: parent, filter: filter, page_token: page_token, page_size: page_size }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.list_findings(::Google::Cloud::WebSecurityScanner::V1::ListFindingsRequest.new(parent: parent, filter: filter, page_token: page_token, page_size: page_size), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, list_findings_client_stub.call_count - end - end - end - - def test_list_finding_type_stats - # Create test objects. - client_result = ::Google::Cloud::WebSecurityScanner::V1::ListFindingTypeStatsResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - - list_finding_type_stats_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::WebSecurityScanner::V1::WebSecurityScanner::Rest::ServiceStub.stub :transcode_list_finding_type_stats_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_finding_type_stats_client_stub do - # Create client - client = ::Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_finding_type_stats({ parent: parent }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.list_finding_type_stats parent: parent do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.list_finding_type_stats ::Google::Cloud::WebSecurityScanner::V1::ListFindingTypeStatsRequest.new(parent: parent) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.list_finding_type_stats({ parent: parent }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.list_finding_type_stats(::Google::Cloud::WebSecurityScanner::V1::ListFindingTypeStatsRequest.new(parent: parent), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, list_finding_type_stats_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::WebSecurityScanner::V1::WebSecurityScanner::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::WebSecurityScanner::V1::WebSecurityScanner::Rest::Client::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-web_security_scanner-v1/test/google/cloud/web_security_scanner/v1/web_security_scanner_test.rb b/owl-bot-staging/google-cloud-web_security_scanner-v1/test/google/cloud/web_security_scanner/v1/web_security_scanner_test.rb deleted file mode 100644 index c27970e14144..000000000000 --- a/owl-bot-staging/google-cloud-web_security_scanner-v1/test/google/cloud/web_security_scanner/v1/web_security_scanner_test.rb +++ /dev/null @@ -1,900 +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/websecurityscanner/v1/web_security_scanner_pb" -require "google/cloud/web_security_scanner/v1/web_security_scanner" - -class ::Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::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_scan_config - # Create GRPC objects. - grpc_response = ::Google::Cloud::WebSecurityScanner::V1::ScanConfig.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" - scan_config = {} - - create_scan_config_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_scan_config, name - assert_kind_of ::Google::Cloud::WebSecurityScanner::V1::CreateScanConfigRequest, request - assert_equal "hello world", request["parent"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::WebSecurityScanner::V1::ScanConfig), request["scan_config"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_scan_config_client_stub do - # Create client - client = ::Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_scan_config({ parent: parent, scan_config: scan_config }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.create_scan_config parent: parent, scan_config: scan_config do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.create_scan_config ::Google::Cloud::WebSecurityScanner::V1::CreateScanConfigRequest.new(parent: parent, scan_config: scan_config) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.create_scan_config({ parent: parent, scan_config: scan_config }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.create_scan_config(::Google::Cloud::WebSecurityScanner::V1::CreateScanConfigRequest.new(parent: parent, scan_config: scan_config), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, create_scan_config_client_stub.call_rpc_count - end - end - - def test_delete_scan_config - # 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_scan_config_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_scan_config, name - assert_kind_of ::Google::Cloud::WebSecurityScanner::V1::DeleteScanConfigRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_scan_config_client_stub do - # Create client - client = ::Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_scan_config({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.delete_scan_config name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.delete_scan_config ::Google::Cloud::WebSecurityScanner::V1::DeleteScanConfigRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.delete_scan_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.delete_scan_config(::Google::Cloud::WebSecurityScanner::V1::DeleteScanConfigRequest.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_scan_config_client_stub.call_rpc_count - end - end - - def test_get_scan_config - # Create GRPC objects. - grpc_response = ::Google::Cloud::WebSecurityScanner::V1::ScanConfig.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_scan_config_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_scan_config, name - assert_kind_of ::Google::Cloud::WebSecurityScanner::V1::GetScanConfigRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_scan_config_client_stub do - # Create client - client = ::Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_scan_config({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_scan_config name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_scan_config ::Google::Cloud::WebSecurityScanner::V1::GetScanConfigRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_scan_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_scan_config(::Google::Cloud::WebSecurityScanner::V1::GetScanConfigRequest.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_scan_config_client_stub.call_rpc_count - end - end - - def test_list_scan_configs - # Create GRPC objects. - grpc_response = ::Google::Cloud::WebSecurityScanner::V1::ListScanConfigsResponse.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_token = "hello world" - page_size = 42 - - list_scan_configs_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_scan_configs, name - assert_kind_of ::Google::Cloud::WebSecurityScanner::V1::ListScanConfigsRequest, request - assert_equal "hello world", request["parent"] - assert_equal "hello world", request["page_token"] - assert_equal 42, request["page_size"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_scan_configs_client_stub do - # Create client - client = ::Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_scan_configs({ parent: parent, page_token: page_token, page_size: page_size }) 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_scan_configs parent: parent, page_token: page_token, page_size: page_size 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_scan_configs ::Google::Cloud::WebSecurityScanner::V1::ListScanConfigsRequest.new(parent: parent, page_token: page_token, page_size: page_size) 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_scan_configs({ parent: parent, page_token: page_token, page_size: page_size }, 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_scan_configs(::Google::Cloud::WebSecurityScanner::V1::ListScanConfigsRequest.new(parent: parent, page_token: page_token, page_size: page_size), 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_scan_configs_client_stub.call_rpc_count - end - end - - def test_update_scan_config - # Create GRPC objects. - grpc_response = ::Google::Cloud::WebSecurityScanner::V1::ScanConfig.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. - scan_config = {} - update_mask = {} - - update_scan_config_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_scan_config, name - assert_kind_of ::Google::Cloud::WebSecurityScanner::V1::UpdateScanConfigRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::WebSecurityScanner::V1::ScanConfig), request["scan_config"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_scan_config_client_stub do - # Create client - client = ::Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_scan_config({ scan_config: scan_config, update_mask: update_mask }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.update_scan_config scan_config: scan_config, update_mask: update_mask do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.update_scan_config ::Google::Cloud::WebSecurityScanner::V1::UpdateScanConfigRequest.new(scan_config: scan_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_scan_config({ scan_config: scan_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_scan_config(::Google::Cloud::WebSecurityScanner::V1::UpdateScanConfigRequest.new(scan_config: scan_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_scan_config_client_stub.call_rpc_count - end - end - - def test_start_scan_run - # Create GRPC objects. - grpc_response = ::Google::Cloud::WebSecurityScanner::V1::ScanRun.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" - - start_scan_run_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :start_scan_run, name - assert_kind_of ::Google::Cloud::WebSecurityScanner::V1::StartScanRunRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, start_scan_run_client_stub do - # Create client - client = ::Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.start_scan_run({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.start_scan_run name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.start_scan_run ::Google::Cloud::WebSecurityScanner::V1::StartScanRunRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.start_scan_run({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.start_scan_run(::Google::Cloud::WebSecurityScanner::V1::StartScanRunRequest.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, start_scan_run_client_stub.call_rpc_count - end - end - - def test_get_scan_run - # Create GRPC objects. - grpc_response = ::Google::Cloud::WebSecurityScanner::V1::ScanRun.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_scan_run_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_scan_run, name - assert_kind_of ::Google::Cloud::WebSecurityScanner::V1::GetScanRunRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_scan_run_client_stub do - # Create client - client = ::Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_scan_run({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_scan_run name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_scan_run ::Google::Cloud::WebSecurityScanner::V1::GetScanRunRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_scan_run({ 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_scan_run(::Google::Cloud::WebSecurityScanner::V1::GetScanRunRequest.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_scan_run_client_stub.call_rpc_count - end - end - - def test_list_scan_runs - # Create GRPC objects. - grpc_response = ::Google::Cloud::WebSecurityScanner::V1::ListScanRunsResponse.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_token = "hello world" - page_size = 42 - - list_scan_runs_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_scan_runs, name - assert_kind_of ::Google::Cloud::WebSecurityScanner::V1::ListScanRunsRequest, request - assert_equal "hello world", request["parent"] - assert_equal "hello world", request["page_token"] - assert_equal 42, request["page_size"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_scan_runs_client_stub do - # Create client - client = ::Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_scan_runs({ parent: parent, page_token: page_token, page_size: page_size }) 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_scan_runs parent: parent, page_token: page_token, page_size: page_size 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_scan_runs ::Google::Cloud::WebSecurityScanner::V1::ListScanRunsRequest.new(parent: parent, page_token: page_token, page_size: page_size) 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_scan_runs({ parent: parent, page_token: page_token, page_size: page_size }, 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_scan_runs(::Google::Cloud::WebSecurityScanner::V1::ListScanRunsRequest.new(parent: parent, page_token: page_token, page_size: page_size), 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_scan_runs_client_stub.call_rpc_count - end - end - - def test_stop_scan_run - # Create GRPC objects. - grpc_response = ::Google::Cloud::WebSecurityScanner::V1::ScanRun.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" - - stop_scan_run_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :stop_scan_run, name - assert_kind_of ::Google::Cloud::WebSecurityScanner::V1::StopScanRunRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, stop_scan_run_client_stub do - # Create client - client = ::Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.stop_scan_run({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.stop_scan_run name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.stop_scan_run ::Google::Cloud::WebSecurityScanner::V1::StopScanRunRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.stop_scan_run({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.stop_scan_run(::Google::Cloud::WebSecurityScanner::V1::StopScanRunRequest.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, stop_scan_run_client_stub.call_rpc_count - end - end - - def test_list_crawled_urls - # Create GRPC objects. - grpc_response = ::Google::Cloud::WebSecurityScanner::V1::ListCrawledUrlsResponse.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_token = "hello world" - page_size = 42 - - list_crawled_urls_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_crawled_urls, name - assert_kind_of ::Google::Cloud::WebSecurityScanner::V1::ListCrawledUrlsRequest, request - assert_equal "hello world", request["parent"] - assert_equal "hello world", request["page_token"] - assert_equal 42, request["page_size"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_crawled_urls_client_stub do - # Create client - client = ::Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_crawled_urls({ parent: parent, page_token: page_token, page_size: page_size }) 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_crawled_urls parent: parent, page_token: page_token, page_size: page_size 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_crawled_urls ::Google::Cloud::WebSecurityScanner::V1::ListCrawledUrlsRequest.new(parent: parent, page_token: page_token, page_size: page_size) 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_crawled_urls({ parent: parent, page_token: page_token, page_size: page_size }, 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_crawled_urls(::Google::Cloud::WebSecurityScanner::V1::ListCrawledUrlsRequest.new(parent: parent, page_token: page_token, page_size: page_size), 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_crawled_urls_client_stub.call_rpc_count - end - end - - def test_get_finding - # Create GRPC objects. - grpc_response = ::Google::Cloud::WebSecurityScanner::V1::Finding.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_finding_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_finding, name - assert_kind_of ::Google::Cloud::WebSecurityScanner::V1::GetFindingRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_finding_client_stub do - # Create client - client = ::Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_finding({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_finding name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_finding ::Google::Cloud::WebSecurityScanner::V1::GetFindingRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_finding({ 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_finding(::Google::Cloud::WebSecurityScanner::V1::GetFindingRequest.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_finding_client_stub.call_rpc_count - end - end - - def test_list_findings - # Create GRPC objects. - grpc_response = ::Google::Cloud::WebSecurityScanner::V1::ListFindingsResponse.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" - filter = "hello world" - page_token = "hello world" - page_size = 42 - - list_findings_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_findings, name - assert_kind_of ::Google::Cloud::WebSecurityScanner::V1::ListFindingsRequest, request - assert_equal "hello world", request["parent"] - assert_equal "hello world", request["filter"] - assert_equal "hello world", request["page_token"] - assert_equal 42, request["page_size"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_findings_client_stub do - # Create client - client = ::Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_findings({ parent: parent, filter: filter, page_token: page_token, page_size: page_size }) 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_findings parent: parent, filter: filter, page_token: page_token, page_size: page_size 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_findings ::Google::Cloud::WebSecurityScanner::V1::ListFindingsRequest.new(parent: parent, filter: filter, page_token: page_token, page_size: page_size) 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_findings({ parent: parent, filter: filter, page_token: page_token, page_size: page_size }, 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_findings(::Google::Cloud::WebSecurityScanner::V1::ListFindingsRequest.new(parent: parent, filter: filter, page_token: page_token, page_size: page_size), 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_findings_client_stub.call_rpc_count - end - end - - def test_list_finding_type_stats - # Create GRPC objects. - grpc_response = ::Google::Cloud::WebSecurityScanner::V1::ListFindingTypeStatsResponse.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" - - list_finding_type_stats_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_finding_type_stats, name - assert_kind_of ::Google::Cloud::WebSecurityScanner::V1::ListFindingTypeStatsRequest, request - assert_equal "hello world", request["parent"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_finding_type_stats_client_stub do - # Create client - client = ::Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_finding_type_stats({ parent: parent }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.list_finding_type_stats parent: parent do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.list_finding_type_stats ::Google::Cloud::WebSecurityScanner::V1::ListFindingTypeStatsRequest.new(parent: parent) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.list_finding_type_stats({ parent: parent }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.list_finding_type_stats(::Google::Cloud::WebSecurityScanner::V1::ListFindingTypeStatsRequest.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, list_finding_type_stats_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::WebSecurityScanner::V1::WebSecurityScanner::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::WebSecurityScanner::V1::WebSecurityScanner::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::WebSecurityScanner::V1::WebSecurityScanner::Client.new do |config| - config.credentials = creds - end - assert_kind_of ::Google::Cloud::WebSecurityScanner::V1::WebSecurityScanner::Client, client - assert_equal creds, client.configure.credentials - end - end -end diff --git a/owl-bot-staging/google-cloud-web_security_scanner-v1/test/helper.rb b/owl-bot-staging/google-cloud-web_security_scanner-v1/test/helper.rb deleted file mode 100644 index 672b337030e7..000000000000 --- a/owl-bot-staging/google-cloud-web_security_scanner-v1/test/helper.rb +++ /dev/null @@ -1,26 +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/mock" -require "minitest/rg" - -require "grpc" - -require "ostruct" diff --git a/owl-bot-staging/google-cloud-web_security_scanner-v1beta/.gitignore b/owl-bot-staging/google-cloud-web_security_scanner-v1beta/.gitignore deleted file mode 100644 index 0135b6bc6cfc..000000000000 --- a/owl-bot-staging/google-cloud-web_security_scanner-v1beta/.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-web_security_scanner-v1beta/.repo-metadata.json b/owl-bot-staging/google-cloud-web_security_scanner-v1beta/.repo-metadata.json deleted file mode 100644 index 080aad677a51..000000000000 --- a/owl-bot-staging/google-cloud-web_security_scanner-v1beta/.repo-metadata.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "api_id": "websecurityscanner.googleapis.com", - "api_shortname": "websecurityscanner", - "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-web_security_scanner-v1beta/latest", - "distribution_name": "google-cloud-web_security_scanner-v1beta", - "is_cloud": true, - "language": "ruby", - "name": "websecurityscanner", - "name_pretty": "Web Security Scanner V1beta API", - "product_documentation": "https://cloud.google.com/security-command-center/docs/concepts-web-security-scanner-overview/", - "release_level": "unreleased", - "repo": "googleapis/google-cloud-ruby", - "requires_billing": true, - "ruby-cloud-description": "Web Security Scanner scans your Compute and App Engine apps for common web vulnerabilities. Note that google-cloud-web_security_scanner-v1beta is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-web_security_scanner instead. See the readme for more details.", - "ruby-cloud-env-prefix": "WEB_SECURITY_SCANNER", - "ruby-cloud-product-url": "https://cloud.google.com/security-command-center/docs/concepts-web-security-scanner-overview/", - "library_type": "GAPIC_AUTO" -} diff --git a/owl-bot-staging/google-cloud-web_security_scanner-v1beta/.rubocop.yml b/owl-bot-staging/google-cloud-web_security_scanner-v1beta/.rubocop.yml deleted file mode 100644 index e051a212551a..000000000000 --- a/owl-bot-staging/google-cloud-web_security_scanner-v1beta/.rubocop.yml +++ /dev/null @@ -1,33 +0,0 @@ -inherit_gem: - google-style: google-style.yml - -AllCops: - Exclude: - - "google-cloud-web_security_scanner-v1beta.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-web_security_scanner-v1beta.rb" diff --git a/owl-bot-staging/google-cloud-web_security_scanner-v1beta/.toys.rb b/owl-bot-staging/google-cloud-web_security_scanner-v1beta/.toys.rb deleted file mode 100644 index 177e22456e8a..000000000000 --- a/owl-bot-staging/google-cloud-web_security_scanner-v1beta/.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-web_security_scanner-v1beta/.yardopts b/owl-bot-staging/google-cloud-web_security_scanner-v1beta/.yardopts deleted file mode 100644 index a098711b250d..000000000000 --- a/owl-bot-staging/google-cloud-web_security_scanner-v1beta/.yardopts +++ /dev/null @@ -1,12 +0,0 @@ ---no-private ---title="Web Security Scanner V1beta 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-web_security_scanner-v1beta/AUTHENTICATION.md b/owl-bot-staging/google-cloud-web_security_scanner-v1beta/AUTHENTICATION.md deleted file mode 100644 index e955035f32bf..000000000000 --- a/owl-bot-staging/google-cloud-web_security_scanner-v1beta/AUTHENTICATION.md +++ /dev/null @@ -1,122 +0,0 @@ -# Authentication - -The recommended way to authenticate to the google-cloud-web_security_scanner-v1beta 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-web_security_scanner-v1beta 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/web_security_scanner/v1beta" - -client = ::Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Client.new do |config| - config.credentials = "path/to/credentialfile.json" -end -``` - -To configure a credentials file globally for all clients: - -```ruby -require "google/cloud/web_security_scanner/v1beta" - -::Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Client.configure do |config| - config.credentials = "path/to/credentialfile.json" -end - -client = ::Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::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-web_security_scanner-v1beta -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/web_security_scanner/v1beta" - -ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" - -client = ::Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::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-web_security_scanner-v1beta/CHANGELOG.md b/owl-bot-staging/google-cloud-web_security_scanner-v1beta/CHANGELOG.md deleted file mode 100644 index f88957a62ba2..000000000000 --- a/owl-bot-staging/google-cloud-web_security_scanner-v1beta/CHANGELOG.md +++ /dev/null @@ -1,2 +0,0 @@ -# Release History - diff --git a/owl-bot-staging/google-cloud-web_security_scanner-v1beta/Gemfile b/owl-bot-staging/google-cloud-web_security_scanner-v1beta/Gemfile deleted file mode 100644 index 1d08558908d8..000000000000 --- a/owl-bot-staging/google-cloud-web_security_scanner-v1beta/Gemfile +++ /dev/null @@ -1,14 +0,0 @@ -source "https://rubygems.org" - -gemspec - -gem "google-style", "~> 1.32.0" -gem "irb", "~> 1.17" -gem "minitest", "~> 6.0.2" -gem "minitest-focus", "~> 1.4" -gem "minitest-mock", "~> 5.27" -gem "minitest-rg", "~> 5.3" -gem "ostruct", "~> 0.5.5" -gem "rake", ">= 13.0" -gem "redcarpet", "~> 3.6" -gem "yard", "~> 0.9" diff --git a/owl-bot-staging/google-cloud-web_security_scanner-v1beta/LICENSE.md b/owl-bot-staging/google-cloud-web_security_scanner-v1beta/LICENSE.md deleted file mode 100644 index c261857ba6ad..000000000000 --- a/owl-bot-staging/google-cloud-web_security_scanner-v1beta/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-web_security_scanner-v1beta/README.md b/owl-bot-staging/google-cloud-web_security_scanner-v1beta/README.md deleted file mode 100644 index a908e25d8d6d..000000000000 --- a/owl-bot-staging/google-cloud-web_security_scanner-v1beta/README.md +++ /dev/null @@ -1,154 +0,0 @@ -# Ruby Client for the Web Security Scanner V1beta API - -Scans your Compute and App Engine apps for common web vulnerabilities. - -Web Security Scanner scans your Compute and App Engine apps for common web vulnerabilities. - -https://github.com/googleapis/google-cloud-ruby - -This gem is a _versioned_ client. It provides basic client classes for a -specific version of the Web Security Scanner V1beta API. Most users should consider using -the main client gem, -[google-cloud-web_security_scanner](https://rubygems.org/gems/google-cloud-web_security_scanner). -See the section below titled *Which client should I use?* for more information. - -## Installation - -``` -$ gem install google-cloud-web_security_scanner-v1beta -``` - -## 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/websecurityscanner.googleapis.com) -1. [Set up authentication.](AUTHENTICATION.md) - -## Quick Start - -```ruby -require "google/cloud/web_security_scanner/v1beta" - -client = ::Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Client.new -request = ::Google::Cloud::WebSecurityScanner::V1beta::CreateScanConfigRequest.new # (request fields as keyword arguments...) -response = client.create_scan_config request -``` - -View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-web_security_scanner-v1beta/latest) -for class and method documentation. - -See also the [Product Documentation](https://cloud.google.com/security-command-center/docs/concepts-web-security-scanner-overview/) -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/web_security_scanner/v1beta" -require "logger" - -client = ::Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::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-web_security_scanner`, -and lower-level _versioned_ client libraries with names such as -`google-cloud-web_security_scanner-v1beta`. -_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-web_security_scanner`. -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-web_security_scanner-v1beta`. - -### 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-web_security_scanner-v1beta/Rakefile b/owl-bot-staging/google-cloud-web_security_scanner-v1beta/Rakefile deleted file mode 100644 index 32e97681638d..000000000000 --- a/owl-bot-staging/google-cloud-web_security_scanner-v1beta/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-web_security_scanner-v1beta acceptance tests." -task :acceptance, :project, :keyfile do |t, args| - project = args[:project] - project ||= - ENV["WEB_SECURITY_SCANNER_TEST_PROJECT"] || - ENV["GCLOUD_TEST_PROJECT"] - keyfile = args[:keyfile] - keyfile ||= - ENV["WEB_SECURITY_SCANNER_TEST_KEYFILE"] || - ENV["GCLOUD_TEST_KEYFILE"] - if keyfile - keyfile = File.read keyfile - else - keyfile ||= - ENV["WEB_SECURITY_SCANNER_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 WEB_SECURITY_SCANNER_TEST_PROJECT=test123 WEB_SECURITY_SCANNER_TEST_KEYFILE=/path/to/keyfile.json rake acceptance" - end - require "google/cloud/web_security_scanner/v1beta/web_security_scanner/credentials" - ::Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Credentials.env_vars.each do |path| - ENV[path] = nil - end - ENV["WEB_SECURITY_SCANNER_PROJECT"] = project - ENV["WEB_SECURITY_SCANNER_TEST_PROJECT"] = project - ENV["WEB_SECURITY_SCANNER_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-web_security_scanner-v1beta 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-web_security_scanner-v1beta 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-web_security_scanner-v1beta 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-web_security_scanner-v1beta gem does not have doctest tests." -end - -desc "Run the CI build" -task :ci do - header "BUILDING google-cloud-web_security_scanner-v1beta" - header "google-cloud-web_security_scanner-v1beta rubocop", "*" - Rake::Task[:rubocop].invoke - header "google-cloud-web_security_scanner-v1beta yard", "*" - Rake::Task[:yard].invoke - header "google-cloud-web_security_scanner-v1beta 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-web_security_scanner-v1beta 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-web_security_scanner-v1beta 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-web_security_scanner-v1beta/gapic_metadata.json b/owl-bot-staging/google-cloud-web_security_scanner-v1beta/gapic_metadata.json deleted file mode 100644 index c625db81d1c2..000000000000 --- a/owl-bot-staging/google-cloud-web_security_scanner-v1beta/gapic_metadata.json +++ /dev/null @@ -1,83 +0,0 @@ -{ - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", - "language": "ruby", - "protoPackage": "google.cloud.websecurityscanner.v1beta", - "libraryPackage": "::Google::Cloud::WebSecurityScanner::V1beta", - "services": { - "WebSecurityScanner": { - "clients": { - "grpc": { - "libraryClient": "::Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Client", - "rpcs": { - "CreateScanConfig": { - "methods": [ - "create_scan_config" - ] - }, - "DeleteScanConfig": { - "methods": [ - "delete_scan_config" - ] - }, - "GetScanConfig": { - "methods": [ - "get_scan_config" - ] - }, - "ListScanConfigs": { - "methods": [ - "list_scan_configs" - ] - }, - "UpdateScanConfig": { - "methods": [ - "update_scan_config" - ] - }, - "StartScanRun": { - "methods": [ - "start_scan_run" - ] - }, - "GetScanRun": { - "methods": [ - "get_scan_run" - ] - }, - "ListScanRuns": { - "methods": [ - "list_scan_runs" - ] - }, - "StopScanRun": { - "methods": [ - "stop_scan_run" - ] - }, - "ListCrawledUrls": { - "methods": [ - "list_crawled_urls" - ] - }, - "GetFinding": { - "methods": [ - "get_finding" - ] - }, - "ListFindings": { - "methods": [ - "list_findings" - ] - }, - "ListFindingTypeStats": { - "methods": [ - "list_finding_type_stats" - ] - } - } - } - } - } - } -} diff --git a/owl-bot-staging/google-cloud-web_security_scanner-v1beta/google-cloud-web_security_scanner-v1beta.gemspec b/owl-bot-staging/google-cloud-web_security_scanner-v1beta/google-cloud-web_security_scanner-v1beta.gemspec deleted file mode 100644 index aa2408b30a97..000000000000 --- a/owl-bot-staging/google-cloud-web_security_scanner-v1beta/google-cloud-web_security_scanner-v1beta.gemspec +++ /dev/null @@ -1,28 +0,0 @@ -# -*- ruby -*- -# encoding: utf-8 - -require File.expand_path("lib/google/cloud/web_security_scanner/v1beta/version", __dir__) - -Gem::Specification.new do |gem| - gem.name = "google-cloud-web_security_scanner-v1beta" - gem.version = Google::Cloud::WebSecurityScanner::V1beta::VERSION - - gem.authors = ["Google LLC"] - gem.email = "googleapis-packages@google.com" - gem.description = "Web Security Scanner scans your Compute and App Engine apps for common web vulnerabilities. Note that google-cloud-web_security_scanner-v1beta is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-web_security_scanner instead. See the readme for more details." - gem.summary = "Scans your Compute and App Engine apps for common web vulnerabilities." - 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.2" - - gem.add_dependency "gapic-common", "~> 1.2" - gem.add_dependency "google-cloud-errors", "~> 1.0" -end diff --git a/owl-bot-staging/google-cloud-web_security_scanner-v1beta/lib/google-cloud-web_security_scanner-v1beta.rb b/owl-bot-staging/google-cloud-web_security_scanner-v1beta/lib/google-cloud-web_security_scanner-v1beta.rb deleted file mode 100644 index aa99555f2dd3..000000000000 --- a/owl-bot-staging/google-cloud-web_security_scanner-v1beta/lib/google-cloud-web_security_scanner-v1beta.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/web_security_scanner/v1beta" diff --git a/owl-bot-staging/google-cloud-web_security_scanner-v1beta/lib/google/cloud/web_security_scanner/v1beta.rb b/owl-bot-staging/google-cloud-web_security_scanner-v1beta/lib/google/cloud/web_security_scanner/v1beta.rb deleted file mode 100644 index 42ef3ae8aa7c..000000000000 --- a/owl-bot-staging/google-cloud-web_security_scanner-v1beta/lib/google/cloud/web_security_scanner/v1beta.rb +++ /dev/null @@ -1,45 +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/web_security_scanner/v1beta/web_security_scanner" -require "google/cloud/web_security_scanner/v1beta/version" - -module Google - module Cloud - module WebSecurityScanner - ## - # API client module. - # - # @example Load this package, including all its services, and instantiate a gRPC client - # - # require "google/cloud/web_security_scanner/v1beta" - # client = ::Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Client.new - # - # @example Load this package, including all its services, and instantiate a REST client - # - # require "google/cloud/web_security_scanner/v1beta" - # client = ::Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Rest::Client.new - # - module V1beta - end - end - end -end - -helper_path = ::File.join __dir__, "v1beta", "_helpers.rb" -require "google/cloud/web_security_scanner/v1beta/_helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-web_security_scanner-v1beta/lib/google/cloud/web_security_scanner/v1beta/rest.rb b/owl-bot-staging/google-cloud-web_security_scanner-v1beta/lib/google/cloud/web_security_scanner/v1beta/rest.rb deleted file mode 100644 index 3c7b745ca0ac..000000000000 --- a/owl-bot-staging/google-cloud-web_security_scanner-v1beta/lib/google/cloud/web_security_scanner/v1beta/rest.rb +++ /dev/null @@ -1,37 +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/web_security_scanner/v1beta/web_security_scanner/rest" -require "google/cloud/web_security_scanner/v1beta/version" - -module Google - module Cloud - module WebSecurityScanner - ## - # To load just the REST part of this package, including all its services, and instantiate a REST client: - # - # @example - # - # require "google/cloud/web_security_scanner/v1beta/rest" - # client = ::Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Rest::Client.new - # - module V1beta - end - end - end -end diff --git a/owl-bot-staging/google-cloud-web_security_scanner-v1beta/lib/google/cloud/web_security_scanner/v1beta/version.rb b/owl-bot-staging/google-cloud-web_security_scanner-v1beta/lib/google/cloud/web_security_scanner/v1beta/version.rb deleted file mode 100644 index f0209dccfca1..000000000000 --- a/owl-bot-staging/google-cloud-web_security_scanner-v1beta/lib/google/cloud/web_security_scanner/v1beta/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 WebSecurityScanner - module V1beta - VERSION = "0.0.1" - end - end - end -end diff --git a/owl-bot-staging/google-cloud-web_security_scanner-v1beta/lib/google/cloud/web_security_scanner/v1beta/web_security_scanner.rb b/owl-bot-staging/google-cloud-web_security_scanner-v1beta/lib/google/cloud/web_security_scanner/v1beta/web_security_scanner.rb deleted file mode 100644 index e4d014ad6c61..000000000000 --- a/owl-bot-staging/google-cloud-web_security_scanner-v1beta/lib/google/cloud/web_security_scanner/v1beta/web_security_scanner.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/common" -require "gapic/config" -require "gapic/config/method" - -require "google/cloud/web_security_scanner/v1beta/version" - -require "google/cloud/web_security_scanner/v1beta/web_security_scanner/credentials" -require "google/cloud/web_security_scanner/v1beta/web_security_scanner/paths" -require "google/cloud/web_security_scanner/v1beta/web_security_scanner/client" -require "google/cloud/web_security_scanner/v1beta/web_security_scanner/rest" - -module Google - module Cloud - module WebSecurityScanner - module V1beta - ## - # Cloud Web Security Scanner Service identifies security vulnerabilities in web - # applications hosted on Google Cloud Platform. It crawls your application, and - # attempts to exercise as many user inputs and event handlers as possible. - # - # @example Load this service and instantiate a gRPC client - # - # require "google/cloud/web_security_scanner/v1beta/web_security_scanner" - # client = ::Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Client.new - # - # @example Load this service and instantiate a REST client - # - # require "google/cloud/web_security_scanner/v1beta/web_security_scanner/rest" - # client = ::Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Rest::Client.new - # - module WebSecurityScanner - end - end - end - end -end - -helper_path = ::File.join __dir__, "web_security_scanner", "helpers.rb" -require "google/cloud/web_security_scanner/v1beta/web_security_scanner/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-web_security_scanner-v1beta/lib/google/cloud/web_security_scanner/v1beta/web_security_scanner/client.rb b/owl-bot-staging/google-cloud-web_security_scanner-v1beta/lib/google/cloud/web_security_scanner/v1beta/web_security_scanner/client.rb deleted file mode 100644 index 05285d2d540c..000000000000 --- a/owl-bot-staging/google-cloud-web_security_scanner-v1beta/lib/google/cloud/web_security_scanner/v1beta/web_security_scanner/client.rb +++ /dev/null @@ -1,1721 +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/websecurityscanner/v1beta/web_security_scanner_pb" - -module Google - module Cloud - module WebSecurityScanner - module V1beta - module WebSecurityScanner - ## - # Client for the WebSecurityScanner service. - # - # Cloud Web Security Scanner Service identifies security vulnerabilities in web - # applications hosted on Google Cloud Platform. It crawls your application, and - # attempts to exercise as many user inputs and event handlers as possible. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "websecurityscanner.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :web_security_scanner_stub - - ## - # Configure the WebSecurityScanner Client class. - # - # See {::Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all WebSecurityScanner clients - # ::Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::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", "WebSecurityScanner", "V1beta"] - 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_scan_config.timeout = 600.0 - - default_config.rpcs.delete_scan_config.timeout = 600.0 - default_config.rpcs.delete_scan_config.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.get_scan_config.timeout = 600.0 - default_config.rpcs.get_scan_config.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.list_scan_configs.timeout = 600.0 - default_config.rpcs.list_scan_configs.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.update_scan_config.timeout = 600.0 - - default_config.rpcs.start_scan_run.timeout = 600.0 - - default_config.rpcs.get_scan_run.timeout = 600.0 - default_config.rpcs.get_scan_run.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.list_scan_runs.timeout = 600.0 - default_config.rpcs.list_scan_runs.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.stop_scan_run.timeout = 600.0 - - default_config.rpcs.list_crawled_urls.timeout = 600.0 - default_config.rpcs.list_crawled_urls.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.get_finding.timeout = 600.0 - default_config.rpcs.get_finding.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.list_findings.timeout = 600.0 - default_config.rpcs.list_findings.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.list_finding_type_stats.timeout = 600.0 - default_config.rpcs.list_finding_type_stats.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the WebSecurityScanner 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::WebSecurityScanner::V1beta::WebSecurityScanner::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 - @web_security_scanner_stub.universe_domain - end - - ## - # Create a new WebSecurityScanner client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the WebSecurityScanner 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/websecurityscanner/v1beta/web_security_scanner_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 - - @web_security_scanner_stub = ::Gapic::ServiceStub.new( - ::Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::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 - ) - - @web_security_scanner_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 - end - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @web_security_scanner_stub.logger - end - - # Service calls - - ## - # Creates a new ScanConfig. - # - # @overload create_scan_config(request, options = nil) - # Pass arguments to `create_scan_config` via a request object, either of type - # {::Google::Cloud::WebSecurityScanner::V1beta::CreateScanConfigRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::WebSecurityScanner::V1beta::CreateScanConfigRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_scan_config(parent: nil, scan_config: nil) - # Pass arguments to `create_scan_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. The parent resource name where the scan is created, which should be a - # project resource name in the format 'projects/\\{projectId}'. - # @param scan_config [::Google::Cloud::WebSecurityScanner::V1beta::ScanConfig, ::Hash] - # Required. The ScanConfig to be created. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::WebSecurityScanner::V1beta::ScanConfig] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::WebSecurityScanner::V1beta::ScanConfig] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/web_security_scanner/v1beta" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::WebSecurityScanner::V1beta::CreateScanConfigRequest.new - # - # # Call the create_scan_config method. - # result = client.create_scan_config request - # - # # The returned object is of type Google::Cloud::WebSecurityScanner::V1beta::ScanConfig. - # p result - # - def create_scan_config request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::WebSecurityScanner::V1beta::CreateScanConfigRequest - - # Converts hash 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_scan_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::WebSecurityScanner::V1beta::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_scan_config.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_scan_config.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @web_security_scanner_stub.call_rpc :create_scan_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 - - ## - # Deletes an existing ScanConfig and its child resources. - # - # @overload delete_scan_config(request, options = nil) - # Pass arguments to `delete_scan_config` via a request object, either of type - # {::Google::Cloud::WebSecurityScanner::V1beta::DeleteScanConfigRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::WebSecurityScanner::V1beta::DeleteScanConfigRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_scan_config(name: nil) - # Pass arguments to `delete_scan_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 resource name of the ScanConfig to be deleted. The name follows the - # format of 'projects/\\{projectId}/scanConfigs/\\{scanConfigId}'. - # - # @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/web_security_scanner/v1beta" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::WebSecurityScanner::V1beta::DeleteScanConfigRequest.new - # - # # Call the delete_scan_config method. - # result = client.delete_scan_config request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_scan_config request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::WebSecurityScanner::V1beta::DeleteScanConfigRequest - - # Converts hash 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_scan_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::WebSecurityScanner::V1beta::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_scan_config.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_scan_config.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @web_security_scanner_stub.call_rpc :delete_scan_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 - - ## - # Gets a ScanConfig. - # - # @overload get_scan_config(request, options = nil) - # Pass arguments to `get_scan_config` via a request object, either of type - # {::Google::Cloud::WebSecurityScanner::V1beta::GetScanConfigRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::WebSecurityScanner::V1beta::GetScanConfigRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_scan_config(name: nil) - # Pass arguments to `get_scan_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 resource name of the ScanConfig to be returned. The name follows the - # format of 'projects/\\{projectId}/scanConfigs/\\{scanConfigId}'. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::WebSecurityScanner::V1beta::ScanConfig] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::WebSecurityScanner::V1beta::ScanConfig] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/web_security_scanner/v1beta" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::WebSecurityScanner::V1beta::GetScanConfigRequest.new - # - # # Call the get_scan_config method. - # result = client.get_scan_config request - # - # # The returned object is of type Google::Cloud::WebSecurityScanner::V1beta::ScanConfig. - # p result - # - def get_scan_config request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::WebSecurityScanner::V1beta::GetScanConfigRequest - - # Converts hash 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_scan_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::WebSecurityScanner::V1beta::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_scan_config.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_scan_config.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @web_security_scanner_stub.call_rpc :get_scan_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 - - ## - # Lists ScanConfigs under a given project. - # - # @overload list_scan_configs(request, options = nil) - # Pass arguments to `list_scan_configs` via a request object, either of type - # {::Google::Cloud::WebSecurityScanner::V1beta::ListScanConfigsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::WebSecurityScanner::V1beta::ListScanConfigsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_scan_configs(parent: nil, page_token: nil, page_size: nil) - # Pass arguments to `list_scan_configs` via keyword arguments. Note that at - # least one keyword argument is 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 parent resource name, which should be a project resource name in the - # format 'projects/\\{projectId}'. - # @param page_token [::String] - # A token identifying a page of results to be returned. This should be a - # `next_page_token` value returned from a previous List request. - # If unspecified, the first page of results is returned. - # @param page_size [::Integer] - # The maximum number of ScanConfigs to return, can be limited by server. - # If not specified or not positive, the implementation will select a - # reasonable value. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::WebSecurityScanner::V1beta::ScanConfig>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::WebSecurityScanner::V1beta::ScanConfig>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/web_security_scanner/v1beta" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::WebSecurityScanner::V1beta::ListScanConfigsRequest.new - # - # # Call the list_scan_configs method. - # result = client.list_scan_configs 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::WebSecurityScanner::V1beta::ScanConfig. - # p item - # end - # - def list_scan_configs request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::WebSecurityScanner::V1beta::ListScanConfigsRequest - - # Converts hash 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_scan_configs.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::WebSecurityScanner::V1beta::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_scan_configs.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_scan_configs.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @web_security_scanner_stub.call_rpc :list_scan_configs, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @web_security_scanner_stub, :list_scan_configs, 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 - - ## - # Updates a ScanConfig. This method support partial update of a ScanConfig. - # - # @overload update_scan_config(request, options = nil) - # Pass arguments to `update_scan_config` via a request object, either of type - # {::Google::Cloud::WebSecurityScanner::V1beta::UpdateScanConfigRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::WebSecurityScanner::V1beta::UpdateScanConfigRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_scan_config(scan_config: nil, update_mask: nil) - # Pass arguments to `update_scan_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 scan_config [::Google::Cloud::WebSecurityScanner::V1beta::ScanConfig, ::Hash] - # Required. The ScanConfig to be updated. The name field must be set to identify the - # resource to be updated. The values of fields not covered by the mask - # will be ignored. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Required. The update mask applies to the resource. For the `FieldMask` definition, - # see - # https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::WebSecurityScanner::V1beta::ScanConfig] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::WebSecurityScanner::V1beta::ScanConfig] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/web_security_scanner/v1beta" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::WebSecurityScanner::V1beta::UpdateScanConfigRequest.new - # - # # Call the update_scan_config method. - # result = client.update_scan_config request - # - # # The returned object is of type Google::Cloud::WebSecurityScanner::V1beta::ScanConfig. - # p result - # - def update_scan_config request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::WebSecurityScanner::V1beta::UpdateScanConfigRequest - - # Converts hash 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_scan_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::WebSecurityScanner::V1beta::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.scan_config&.name - header_params["scan_config.name"] = request.scan_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_scan_config.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_scan_config.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @web_security_scanner_stub.call_rpc :update_scan_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 - - ## - # Start a ScanRun according to the given ScanConfig. - # - # @overload start_scan_run(request, options = nil) - # Pass arguments to `start_scan_run` via a request object, either of type - # {::Google::Cloud::WebSecurityScanner::V1beta::StartScanRunRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::WebSecurityScanner::V1beta::StartScanRunRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload start_scan_run(name: nil) - # Pass arguments to `start_scan_run` via keyword arguments. Note that at - # least one keyword argument is 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 ScanConfig to be used. The name follows the - # format of 'projects/\\{projectId}/scanConfigs/\\{scanConfigId}'. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::WebSecurityScanner::V1beta::ScanRun] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::WebSecurityScanner::V1beta::ScanRun] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/web_security_scanner/v1beta" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::WebSecurityScanner::V1beta::StartScanRunRequest.new - # - # # Call the start_scan_run method. - # result = client.start_scan_run request - # - # # The returned object is of type Google::Cloud::WebSecurityScanner::V1beta::ScanRun. - # p result - # - def start_scan_run request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::WebSecurityScanner::V1beta::StartScanRunRequest - - # Converts hash 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.start_scan_run.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::WebSecurityScanner::V1beta::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.start_scan_run.timeout, - metadata: metadata, - retry_policy: @config.rpcs.start_scan_run.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @web_security_scanner_stub.call_rpc :start_scan_run, 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 - - ## - # Gets a ScanRun. - # - # @overload get_scan_run(request, options = nil) - # Pass arguments to `get_scan_run` via a request object, either of type - # {::Google::Cloud::WebSecurityScanner::V1beta::GetScanRunRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::WebSecurityScanner::V1beta::GetScanRunRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_scan_run(name: nil) - # Pass arguments to `get_scan_run` via keyword arguments. Note that at - # least one keyword argument is 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 ScanRun to be returned. The name follows the - # format of - # 'projects/\\{projectId}/scanConfigs/\\{scanConfigId}/scanRuns/\\{scanRunId}'. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::WebSecurityScanner::V1beta::ScanRun] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::WebSecurityScanner::V1beta::ScanRun] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/web_security_scanner/v1beta" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::WebSecurityScanner::V1beta::GetScanRunRequest.new - # - # # Call the get_scan_run method. - # result = client.get_scan_run request - # - # # The returned object is of type Google::Cloud::WebSecurityScanner::V1beta::ScanRun. - # p result - # - def get_scan_run request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::WebSecurityScanner::V1beta::GetScanRunRequest - - # Converts hash 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_scan_run.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::WebSecurityScanner::V1beta::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_scan_run.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_scan_run.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @web_security_scanner_stub.call_rpc :get_scan_run, 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 ScanRuns under a given ScanConfig, in descending order of ScanRun - # stop time. - # - # @overload list_scan_runs(request, options = nil) - # Pass arguments to `list_scan_runs` via a request object, either of type - # {::Google::Cloud::WebSecurityScanner::V1beta::ListScanRunsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::WebSecurityScanner::V1beta::ListScanRunsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_scan_runs(parent: nil, page_token: nil, page_size: nil) - # Pass arguments to `list_scan_runs` via keyword arguments. Note that at - # least one keyword argument is 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 parent resource name, which should be a scan resource name in the - # format 'projects/\\{projectId}/scanConfigs/\\{scanConfigId}'. - # @param page_token [::String] - # A token identifying a page of results to be returned. This should be a - # `next_page_token` value returned from a previous List request. - # If unspecified, the first page of results is returned. - # @param page_size [::Integer] - # The maximum number of ScanRuns to return, can be limited by server. - # If not specified or not positive, the implementation will select a - # reasonable value. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::WebSecurityScanner::V1beta::ScanRun>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::WebSecurityScanner::V1beta::ScanRun>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/web_security_scanner/v1beta" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::WebSecurityScanner::V1beta::ListScanRunsRequest.new - # - # # Call the list_scan_runs method. - # result = client.list_scan_runs 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::WebSecurityScanner::V1beta::ScanRun. - # p item - # end - # - def list_scan_runs request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::WebSecurityScanner::V1beta::ListScanRunsRequest - - # Converts hash 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_scan_runs.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::WebSecurityScanner::V1beta::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_scan_runs.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_scan_runs.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @web_security_scanner_stub.call_rpc :list_scan_runs, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @web_security_scanner_stub, :list_scan_runs, 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 - - ## - # Stops a ScanRun. The stopped ScanRun is returned. - # - # @overload stop_scan_run(request, options = nil) - # Pass arguments to `stop_scan_run` via a request object, either of type - # {::Google::Cloud::WebSecurityScanner::V1beta::StopScanRunRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::WebSecurityScanner::V1beta::StopScanRunRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload stop_scan_run(name: nil) - # Pass arguments to `stop_scan_run` via keyword arguments. Note that at - # least one keyword argument is 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 ScanRun to be stopped. The name follows the - # format of - # 'projects/\\{projectId}/scanConfigs/\\{scanConfigId}/scanRuns/\\{scanRunId}'. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::WebSecurityScanner::V1beta::ScanRun] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::WebSecurityScanner::V1beta::ScanRun] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/web_security_scanner/v1beta" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::WebSecurityScanner::V1beta::StopScanRunRequest.new - # - # # Call the stop_scan_run method. - # result = client.stop_scan_run request - # - # # The returned object is of type Google::Cloud::WebSecurityScanner::V1beta::ScanRun. - # p result - # - def stop_scan_run request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::WebSecurityScanner::V1beta::StopScanRunRequest - - # Converts hash 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.stop_scan_run.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::WebSecurityScanner::V1beta::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.stop_scan_run.timeout, - metadata: metadata, - retry_policy: @config.rpcs.stop_scan_run.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @web_security_scanner_stub.call_rpc :stop_scan_run, 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 - - ## - # List CrawledUrls under a given ScanRun. - # - # @overload list_crawled_urls(request, options = nil) - # Pass arguments to `list_crawled_urls` via a request object, either of type - # {::Google::Cloud::WebSecurityScanner::V1beta::ListCrawledUrlsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::WebSecurityScanner::V1beta::ListCrawledUrlsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_crawled_urls(parent: nil, page_token: nil, page_size: nil) - # Pass arguments to `list_crawled_urls` via keyword arguments. Note that at - # least one keyword argument is 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 parent resource name, which should be a scan run resource name in the - # format - # 'projects/\\{projectId}/scanConfigs/\\{scanConfigId}/scanRuns/\\{scanRunId}'. - # @param page_token [::String] - # A token identifying a page of results to be returned. This should be a - # `next_page_token` value returned from a previous List request. - # If unspecified, the first page of results is returned. - # @param page_size [::Integer] - # The maximum number of CrawledUrls to return, can be limited by server. - # If not specified or not positive, the implementation will select a - # reasonable value. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::WebSecurityScanner::V1beta::CrawledUrl>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::WebSecurityScanner::V1beta::CrawledUrl>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/web_security_scanner/v1beta" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::WebSecurityScanner::V1beta::ListCrawledUrlsRequest.new - # - # # Call the list_crawled_urls method. - # result = client.list_crawled_urls 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::WebSecurityScanner::V1beta::CrawledUrl. - # p item - # end - # - def list_crawled_urls request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::WebSecurityScanner::V1beta::ListCrawledUrlsRequest - - # Converts hash 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_crawled_urls.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::WebSecurityScanner::V1beta::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_crawled_urls.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_crawled_urls.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @web_security_scanner_stub.call_rpc :list_crawled_urls, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @web_security_scanner_stub, :list_crawled_urls, 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 - - ## - # Gets a Finding. - # - # @overload get_finding(request, options = nil) - # Pass arguments to `get_finding` via a request object, either of type - # {::Google::Cloud::WebSecurityScanner::V1beta::GetFindingRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::WebSecurityScanner::V1beta::GetFindingRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_finding(name: nil) - # Pass arguments to `get_finding` via keyword arguments. Note that at - # least one keyword argument is 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 Finding to be returned. The name follows the - # format of - # 'projects/\\{projectId}/scanConfigs/\\{scanConfigId}/scanRuns/\\{scanRunId}/findings/\\{findingId}'. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::WebSecurityScanner::V1beta::Finding] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::WebSecurityScanner::V1beta::Finding] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/web_security_scanner/v1beta" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::WebSecurityScanner::V1beta::GetFindingRequest.new - # - # # Call the get_finding method. - # result = client.get_finding request - # - # # The returned object is of type Google::Cloud::WebSecurityScanner::V1beta::Finding. - # p result - # - def get_finding request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::WebSecurityScanner::V1beta::GetFindingRequest - - # Converts hash 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_finding.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::WebSecurityScanner::V1beta::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_finding.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_finding.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @web_security_scanner_stub.call_rpc :get_finding, 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 - - ## - # List Findings under a given ScanRun. - # - # @overload list_findings(request, options = nil) - # Pass arguments to `list_findings` via a request object, either of type - # {::Google::Cloud::WebSecurityScanner::V1beta::ListFindingsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::WebSecurityScanner::V1beta::ListFindingsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_findings(parent: nil, filter: nil, page_token: nil, page_size: nil) - # Pass arguments to `list_findings` via keyword arguments. Note that at - # least one keyword argument is 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 parent resource name, which should be a scan run resource name in the - # format - # 'projects/\\{projectId}/scanConfigs/\\{scanConfigId}/scanRuns/\\{scanRunId}'. - # @param filter [::String] - # Required. The filter expression. The expression must be in the format: - # . - # Supported field: 'finding_type'. - # Supported operator: '='. - # @param page_token [::String] - # A token identifying a page of results to be returned. This should be a - # `next_page_token` value returned from a previous List request. - # If unspecified, the first page of results is returned. - # @param page_size [::Integer] - # The maximum number of Findings to return, can be limited by server. - # If not specified or not positive, the implementation will select a - # reasonable value. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::WebSecurityScanner::V1beta::Finding>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::WebSecurityScanner::V1beta::Finding>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/web_security_scanner/v1beta" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::WebSecurityScanner::V1beta::ListFindingsRequest.new - # - # # Call the list_findings method. - # result = client.list_findings 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::WebSecurityScanner::V1beta::Finding. - # p item - # end - # - def list_findings request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::WebSecurityScanner::V1beta::ListFindingsRequest - - # Converts hash 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_findings.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::WebSecurityScanner::V1beta::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_findings.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_findings.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @web_security_scanner_stub.call_rpc :list_findings, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @web_security_scanner_stub, :list_findings, 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 - - ## - # List all FindingTypeStats under a given ScanRun. - # - # @overload list_finding_type_stats(request, options = nil) - # Pass arguments to `list_finding_type_stats` via a request object, either of type - # {::Google::Cloud::WebSecurityScanner::V1beta::ListFindingTypeStatsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::WebSecurityScanner::V1beta::ListFindingTypeStatsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_finding_type_stats(parent: nil) - # Pass arguments to `list_finding_type_stats` via keyword arguments. Note that at - # least one keyword argument is 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 parent resource name, which should be a scan run resource name in the - # format - # 'projects/\\{projectId}/scanConfigs/\\{scanConfigId}/scanRuns/\\{scanRunId}'. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::WebSecurityScanner::V1beta::ListFindingTypeStatsResponse] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::WebSecurityScanner::V1beta::ListFindingTypeStatsResponse] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/web_security_scanner/v1beta" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::WebSecurityScanner::V1beta::ListFindingTypeStatsRequest.new - # - # # Call the list_finding_type_stats method. - # result = client.list_finding_type_stats request - # - # # The returned object is of type Google::Cloud::WebSecurityScanner::V1beta::ListFindingTypeStatsResponse. - # p result - # - def list_finding_type_stats request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::WebSecurityScanner::V1beta::ListFindingTypeStatsRequest - - # Converts hash 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_finding_type_stats.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::WebSecurityScanner::V1beta::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_finding_type_stats.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_finding_type_stats.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @web_security_scanner_stub.call_rpc :list_finding_type_stats, 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 WebSecurityScanner API. - # - # This class represents the configuration for WebSecurityScanner, - # 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::WebSecurityScanner::V1beta::WebSecurityScanner::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_scan_config to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.create_scan_config.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.create_scan_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::WebSecurityScanner::V1beta::WebSecurityScanner::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 = "websecurityscanner.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 WebSecurityScanner 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_scan_config` - # @return [::Gapic::Config::Method] - # - attr_reader :create_scan_config - ## - # RPC-specific configuration for `delete_scan_config` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_scan_config - ## - # RPC-specific configuration for `get_scan_config` - # @return [::Gapic::Config::Method] - # - attr_reader :get_scan_config - ## - # RPC-specific configuration for `list_scan_configs` - # @return [::Gapic::Config::Method] - # - attr_reader :list_scan_configs - ## - # RPC-specific configuration for `update_scan_config` - # @return [::Gapic::Config::Method] - # - attr_reader :update_scan_config - ## - # RPC-specific configuration for `start_scan_run` - # @return [::Gapic::Config::Method] - # - attr_reader :start_scan_run - ## - # RPC-specific configuration for `get_scan_run` - # @return [::Gapic::Config::Method] - # - attr_reader :get_scan_run - ## - # RPC-specific configuration for `list_scan_runs` - # @return [::Gapic::Config::Method] - # - attr_reader :list_scan_runs - ## - # RPC-specific configuration for `stop_scan_run` - # @return [::Gapic::Config::Method] - # - attr_reader :stop_scan_run - ## - # RPC-specific configuration for `list_crawled_urls` - # @return [::Gapic::Config::Method] - # - attr_reader :list_crawled_urls - ## - # RPC-specific configuration for `get_finding` - # @return [::Gapic::Config::Method] - # - attr_reader :get_finding - ## - # RPC-specific configuration for `list_findings` - # @return [::Gapic::Config::Method] - # - attr_reader :list_findings - ## - # RPC-specific configuration for `list_finding_type_stats` - # @return [::Gapic::Config::Method] - # - attr_reader :list_finding_type_stats - - # @private - def initialize parent_rpcs = nil - create_scan_config_config = parent_rpcs.create_scan_config if parent_rpcs.respond_to? :create_scan_config - @create_scan_config = ::Gapic::Config::Method.new create_scan_config_config - delete_scan_config_config = parent_rpcs.delete_scan_config if parent_rpcs.respond_to? :delete_scan_config - @delete_scan_config = ::Gapic::Config::Method.new delete_scan_config_config - get_scan_config_config = parent_rpcs.get_scan_config if parent_rpcs.respond_to? :get_scan_config - @get_scan_config = ::Gapic::Config::Method.new get_scan_config_config - list_scan_configs_config = parent_rpcs.list_scan_configs if parent_rpcs.respond_to? :list_scan_configs - @list_scan_configs = ::Gapic::Config::Method.new list_scan_configs_config - update_scan_config_config = parent_rpcs.update_scan_config if parent_rpcs.respond_to? :update_scan_config - @update_scan_config = ::Gapic::Config::Method.new update_scan_config_config - start_scan_run_config = parent_rpcs.start_scan_run if parent_rpcs.respond_to? :start_scan_run - @start_scan_run = ::Gapic::Config::Method.new start_scan_run_config - get_scan_run_config = parent_rpcs.get_scan_run if parent_rpcs.respond_to? :get_scan_run - @get_scan_run = ::Gapic::Config::Method.new get_scan_run_config - list_scan_runs_config = parent_rpcs.list_scan_runs if parent_rpcs.respond_to? :list_scan_runs - @list_scan_runs = ::Gapic::Config::Method.new list_scan_runs_config - stop_scan_run_config = parent_rpcs.stop_scan_run if parent_rpcs.respond_to? :stop_scan_run - @stop_scan_run = ::Gapic::Config::Method.new stop_scan_run_config - list_crawled_urls_config = parent_rpcs.list_crawled_urls if parent_rpcs.respond_to? :list_crawled_urls - @list_crawled_urls = ::Gapic::Config::Method.new list_crawled_urls_config - get_finding_config = parent_rpcs.get_finding if parent_rpcs.respond_to? :get_finding - @get_finding = ::Gapic::Config::Method.new get_finding_config - list_findings_config = parent_rpcs.list_findings if parent_rpcs.respond_to? :list_findings - @list_findings = ::Gapic::Config::Method.new list_findings_config - list_finding_type_stats_config = parent_rpcs.list_finding_type_stats if parent_rpcs.respond_to? :list_finding_type_stats - @list_finding_type_stats = ::Gapic::Config::Method.new list_finding_type_stats_config - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-web_security_scanner-v1beta/lib/google/cloud/web_security_scanner/v1beta/web_security_scanner/credentials.rb b/owl-bot-staging/google-cloud-web_security_scanner-v1beta/lib/google/cloud/web_security_scanner/v1beta/web_security_scanner/credentials.rb deleted file mode 100644 index 9237239dac26..000000000000 --- a/owl-bot-staging/google-cloud-web_security_scanner-v1beta/lib/google/cloud/web_security_scanner/v1beta/web_security_scanner/credentials.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! - -require "googleauth" - -module Google - module Cloud - module WebSecurityScanner - module V1beta - module WebSecurityScanner - # Credentials for the WebSecurityScanner API. - class Credentials < ::Google::Auth::Credentials - self.scope = [ - "https://www.googleapis.com/auth/cloud-platform" - ] - self.env_vars = [ - "WEB_SECURITY_SCANNER_CREDENTIALS", - "WEB_SECURITY_SCANNER_KEYFILE", - "GOOGLE_CLOUD_CREDENTIALS", - "GOOGLE_CLOUD_KEYFILE", - "GCLOUD_KEYFILE", - "WEB_SECURITY_SCANNER_CREDENTIALS_JSON", - "WEB_SECURITY_SCANNER_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-web_security_scanner-v1beta/lib/google/cloud/web_security_scanner/v1beta/web_security_scanner/paths.rb b/owl-bot-staging/google-cloud-web_security_scanner-v1beta/lib/google/cloud/web_security_scanner/v1beta/web_security_scanner/paths.rb deleted file mode 100644 index 035cb9ea1502..000000000000 --- a/owl-bot-staging/google-cloud-web_security_scanner-v1beta/lib/google/cloud/web_security_scanner/v1beta/web_security_scanner/paths.rb +++ /dev/null @@ -1,104 +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 WebSecurityScanner - module V1beta - module WebSecurityScanner - # Path helper methods for the WebSecurityScanner API. - module Paths - ## - # Create a fully-qualified Finding resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/scanConfigs/{scan_config}/scanRuns/{scan_run}/findings/{finding}` - # - # @param project [String] - # @param scan_config [String] - # @param scan_run [String] - # @param finding [String] - # - # @return [::String] - def finding_path project:, scan_config:, scan_run:, finding: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "scan_config cannot contain /" if scan_config.to_s.include? "/" - raise ::ArgumentError, "scan_run cannot contain /" if scan_run.to_s.include? "/" - - "projects/#{project}/scanConfigs/#{scan_config}/scanRuns/#{scan_run}/findings/#{finding}" - 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 - - ## - # Create a fully-qualified ScanConfig resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/scanConfigs/{scan_config}` - # - # @param project [String] - # @param scan_config [String] - # - # @return [::String] - def scan_config_path project:, scan_config: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - - "projects/#{project}/scanConfigs/#{scan_config}" - end - - ## - # Create a fully-qualified ScanRun resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/scanConfigs/{scan_config}/scanRuns/{scan_run}` - # - # @param project [String] - # @param scan_config [String] - # @param scan_run [String] - # - # @return [::String] - def scan_run_path project:, scan_config:, scan_run: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "scan_config cannot contain /" if scan_config.to_s.include? "/" - - "projects/#{project}/scanConfigs/#{scan_config}/scanRuns/#{scan_run}" - end - - extend self - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-web_security_scanner-v1beta/lib/google/cloud/web_security_scanner/v1beta/web_security_scanner/rest.rb b/owl-bot-staging/google-cloud-web_security_scanner-v1beta/lib/google/cloud/web_security_scanner/v1beta/web_security_scanner/rest.rb deleted file mode 100644 index cc7e1c7d1fdd..000000000000 --- a/owl-bot-staging/google-cloud-web_security_scanner-v1beta/lib/google/cloud/web_security_scanner/v1beta/web_security_scanner/rest.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! - -require "gapic/rest" -require "gapic/config" -require "gapic/config/method" - -require "google/cloud/web_security_scanner/v1beta/version" - -require "google/cloud/web_security_scanner/v1beta/web_security_scanner/credentials" -require "google/cloud/web_security_scanner/v1beta/web_security_scanner/paths" -require "google/cloud/web_security_scanner/v1beta/web_security_scanner/rest/client" - -module Google - module Cloud - module WebSecurityScanner - module V1beta - ## - # Cloud Web Security Scanner Service identifies security vulnerabilities in web - # applications hosted on Google Cloud Platform. It crawls your application, and - # attempts to exercise as many user inputs and event handlers as possible. - # - # To load this service and instantiate a REST client: - # - # require "google/cloud/web_security_scanner/v1beta/web_security_scanner/rest" - # client = ::Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Rest::Client.new - # - module WebSecurityScanner - # Client for the REST transport - module Rest - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "rest", "helpers.rb" -require "google/cloud/web_security_scanner/v1beta/web_security_scanner/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-web_security_scanner-v1beta/lib/google/cloud/web_security_scanner/v1beta/web_security_scanner/rest/client.rb b/owl-bot-staging/google-cloud-web_security_scanner-v1beta/lib/google/cloud/web_security_scanner/v1beta/web_security_scanner/rest/client.rb deleted file mode 100644 index ffa4a9d484b1..000000000000 --- a/owl-bot-staging/google-cloud-web_security_scanner-v1beta/lib/google/cloud/web_security_scanner/v1beta/web_security_scanner/rest/client.rb +++ /dev/null @@ -1,1587 +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/websecurityscanner/v1beta/web_security_scanner_pb" -require "google/cloud/web_security_scanner/v1beta/web_security_scanner/rest/service_stub" - -module Google - module Cloud - module WebSecurityScanner - module V1beta - module WebSecurityScanner - module Rest - ## - # REST client for the WebSecurityScanner service. - # - # Cloud Web Security Scanner Service identifies security vulnerabilities in web - # applications hosted on Google Cloud Platform. It crawls your application, and - # attempts to exercise as many user inputs and event handlers as possible. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "websecurityscanner.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :web_security_scanner_stub - - ## - # Configure the WebSecurityScanner Client class. - # - # See {::Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all WebSecurityScanner clients - # ::Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::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", "WebSecurityScanner", "V1beta"] - 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_scan_config.timeout = 600.0 - - default_config.rpcs.delete_scan_config.timeout = 600.0 - default_config.rpcs.delete_scan_config.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.get_scan_config.timeout = 600.0 - default_config.rpcs.get_scan_config.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.list_scan_configs.timeout = 600.0 - default_config.rpcs.list_scan_configs.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.update_scan_config.timeout = 600.0 - - default_config.rpcs.start_scan_run.timeout = 600.0 - - default_config.rpcs.get_scan_run.timeout = 600.0 - default_config.rpcs.get_scan_run.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.list_scan_runs.timeout = 600.0 - default_config.rpcs.list_scan_runs.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.stop_scan_run.timeout = 600.0 - - default_config.rpcs.list_crawled_urls.timeout = 600.0 - default_config.rpcs.list_crawled_urls.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.get_finding.timeout = 600.0 - default_config.rpcs.get_finding.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.list_findings.timeout = 600.0 - default_config.rpcs.list_findings.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config.rpcs.list_finding_type_stats.timeout = 600.0 - default_config.rpcs.list_finding_type_stats.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [4, 14] - } - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the WebSecurityScanner 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::WebSecurityScanner::V1beta::WebSecurityScanner::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 - @web_security_scanner_stub.universe_domain - end - - ## - # Create a new WebSecurityScanner REST client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Rest::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Rest::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the WebSecurityScanner 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 - - @web_security_scanner_stub = ::Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Rest::ServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials, - logger: @config.logger - ) - - @web_security_scanner_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 - end - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @web_security_scanner_stub.logger - end - - # Service calls - - ## - # Creates a new ScanConfig. - # - # @overload create_scan_config(request, options = nil) - # Pass arguments to `create_scan_config` via a request object, either of type - # {::Google::Cloud::WebSecurityScanner::V1beta::CreateScanConfigRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::WebSecurityScanner::V1beta::CreateScanConfigRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_scan_config(parent: nil, scan_config: nil) - # Pass arguments to `create_scan_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. The parent resource name where the scan is created, which should be a - # project resource name in the format 'projects/\\{projectId}'. - # @param scan_config [::Google::Cloud::WebSecurityScanner::V1beta::ScanConfig, ::Hash] - # Required. The ScanConfig to be created. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::WebSecurityScanner::V1beta::ScanConfig] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::WebSecurityScanner::V1beta::ScanConfig] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/web_security_scanner/v1beta" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::WebSecurityScanner::V1beta::CreateScanConfigRequest.new - # - # # Call the create_scan_config method. - # result = client.create_scan_config request - # - # # The returned object is of type Google::Cloud::WebSecurityScanner::V1beta::ScanConfig. - # p result - # - def create_scan_config request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::WebSecurityScanner::V1beta::CreateScanConfigRequest - - # Converts hash 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_scan_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::WebSecurityScanner::V1beta::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_scan_config.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_scan_config.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @web_security_scanner_stub.create_scan_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 - - ## - # Deletes an existing ScanConfig and its child resources. - # - # @overload delete_scan_config(request, options = nil) - # Pass arguments to `delete_scan_config` via a request object, either of type - # {::Google::Cloud::WebSecurityScanner::V1beta::DeleteScanConfigRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::WebSecurityScanner::V1beta::DeleteScanConfigRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_scan_config(name: nil) - # Pass arguments to `delete_scan_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 resource name of the ScanConfig to be deleted. The name follows the - # format of 'projects/\\{projectId}/scanConfigs/\\{scanConfigId}'. - # @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/web_security_scanner/v1beta" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::WebSecurityScanner::V1beta::DeleteScanConfigRequest.new - # - # # Call the delete_scan_config method. - # result = client.delete_scan_config request - # - # # The returned object is of type Google::Protobuf::Empty. - # p result - # - def delete_scan_config request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::WebSecurityScanner::V1beta::DeleteScanConfigRequest - - # Converts hash 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_scan_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::WebSecurityScanner::V1beta::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_scan_config.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_scan_config.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @web_security_scanner_stub.delete_scan_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 - - ## - # Gets a ScanConfig. - # - # @overload get_scan_config(request, options = nil) - # Pass arguments to `get_scan_config` via a request object, either of type - # {::Google::Cloud::WebSecurityScanner::V1beta::GetScanConfigRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::WebSecurityScanner::V1beta::GetScanConfigRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_scan_config(name: nil) - # Pass arguments to `get_scan_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 resource name of the ScanConfig to be returned. The name follows the - # format of 'projects/\\{projectId}/scanConfigs/\\{scanConfigId}'. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::WebSecurityScanner::V1beta::ScanConfig] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::WebSecurityScanner::V1beta::ScanConfig] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/web_security_scanner/v1beta" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::WebSecurityScanner::V1beta::GetScanConfigRequest.new - # - # # Call the get_scan_config method. - # result = client.get_scan_config request - # - # # The returned object is of type Google::Cloud::WebSecurityScanner::V1beta::ScanConfig. - # p result - # - def get_scan_config request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::WebSecurityScanner::V1beta::GetScanConfigRequest - - # Converts hash 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_scan_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::WebSecurityScanner::V1beta::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_scan_config.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_scan_config.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @web_security_scanner_stub.get_scan_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 - - ## - # Lists ScanConfigs under a given project. - # - # @overload list_scan_configs(request, options = nil) - # Pass arguments to `list_scan_configs` via a request object, either of type - # {::Google::Cloud::WebSecurityScanner::V1beta::ListScanConfigsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::WebSecurityScanner::V1beta::ListScanConfigsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_scan_configs(parent: nil, page_token: nil, page_size: nil) - # Pass arguments to `list_scan_configs` via keyword arguments. Note that at - # least one keyword argument is 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 parent resource name, which should be a project resource name in the - # format 'projects/\\{projectId}'. - # @param page_token [::String] - # A token identifying a page of results to be returned. This should be a - # `next_page_token` value returned from a previous List request. - # If unspecified, the first page of results is returned. - # @param page_size [::Integer] - # The maximum number of ScanConfigs to return, can be limited by server. - # If not specified or not positive, the implementation will select a - # reasonable value. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::WebSecurityScanner::V1beta::ScanConfig>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::WebSecurityScanner::V1beta::ScanConfig>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/web_security_scanner/v1beta" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::WebSecurityScanner::V1beta::ListScanConfigsRequest.new - # - # # Call the list_scan_configs method. - # result = client.list_scan_configs 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::WebSecurityScanner::V1beta::ScanConfig. - # p item - # end - # - def list_scan_configs request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::WebSecurityScanner::V1beta::ListScanConfigsRequest - - # Converts hash 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_scan_configs.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::WebSecurityScanner::V1beta::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_scan_configs.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_scan_configs.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @web_security_scanner_stub.list_scan_configs request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @web_security_scanner_stub, :list_scan_configs, "scan_configs", 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 - - ## - # Updates a ScanConfig. This method support partial update of a ScanConfig. - # - # @overload update_scan_config(request, options = nil) - # Pass arguments to `update_scan_config` via a request object, either of type - # {::Google::Cloud::WebSecurityScanner::V1beta::UpdateScanConfigRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::WebSecurityScanner::V1beta::UpdateScanConfigRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_scan_config(scan_config: nil, update_mask: nil) - # Pass arguments to `update_scan_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 scan_config [::Google::Cloud::WebSecurityScanner::V1beta::ScanConfig, ::Hash] - # Required. The ScanConfig to be updated. The name field must be set to identify the - # resource to be updated. The values of fields not covered by the mask - # will be ignored. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Required. The update mask applies to the resource. For the `FieldMask` definition, - # see - # https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::WebSecurityScanner::V1beta::ScanConfig] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::WebSecurityScanner::V1beta::ScanConfig] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/web_security_scanner/v1beta" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::WebSecurityScanner::V1beta::UpdateScanConfigRequest.new - # - # # Call the update_scan_config method. - # result = client.update_scan_config request - # - # # The returned object is of type Google::Cloud::WebSecurityScanner::V1beta::ScanConfig. - # p result - # - def update_scan_config request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::WebSecurityScanner::V1beta::UpdateScanConfigRequest - - # Converts hash 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_scan_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::WebSecurityScanner::V1beta::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_scan_config.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_scan_config.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @web_security_scanner_stub.update_scan_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 - - ## - # Start a ScanRun according to the given ScanConfig. - # - # @overload start_scan_run(request, options = nil) - # Pass arguments to `start_scan_run` via a request object, either of type - # {::Google::Cloud::WebSecurityScanner::V1beta::StartScanRunRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::WebSecurityScanner::V1beta::StartScanRunRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload start_scan_run(name: nil) - # Pass arguments to `start_scan_run` via keyword arguments. Note that at - # least one keyword argument is 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 ScanConfig to be used. The name follows the - # format of 'projects/\\{projectId}/scanConfigs/\\{scanConfigId}'. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::WebSecurityScanner::V1beta::ScanRun] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::WebSecurityScanner::V1beta::ScanRun] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/web_security_scanner/v1beta" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::WebSecurityScanner::V1beta::StartScanRunRequest.new - # - # # Call the start_scan_run method. - # result = client.start_scan_run request - # - # # The returned object is of type Google::Cloud::WebSecurityScanner::V1beta::ScanRun. - # p result - # - def start_scan_run request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::WebSecurityScanner::V1beta::StartScanRunRequest - - # Converts hash 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.start_scan_run.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::WebSecurityScanner::V1beta::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.start_scan_run.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.start_scan_run.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @web_security_scanner_stub.start_scan_run 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 - - ## - # Gets a ScanRun. - # - # @overload get_scan_run(request, options = nil) - # Pass arguments to `get_scan_run` via a request object, either of type - # {::Google::Cloud::WebSecurityScanner::V1beta::GetScanRunRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::WebSecurityScanner::V1beta::GetScanRunRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_scan_run(name: nil) - # Pass arguments to `get_scan_run` via keyword arguments. Note that at - # least one keyword argument is 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 ScanRun to be returned. The name follows the - # format of - # 'projects/\\{projectId}/scanConfigs/\\{scanConfigId}/scanRuns/\\{scanRunId}'. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::WebSecurityScanner::V1beta::ScanRun] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::WebSecurityScanner::V1beta::ScanRun] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/web_security_scanner/v1beta" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::WebSecurityScanner::V1beta::GetScanRunRequest.new - # - # # Call the get_scan_run method. - # result = client.get_scan_run request - # - # # The returned object is of type Google::Cloud::WebSecurityScanner::V1beta::ScanRun. - # p result - # - def get_scan_run request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::WebSecurityScanner::V1beta::GetScanRunRequest - - # Converts hash 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_scan_run.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::WebSecurityScanner::V1beta::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_scan_run.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_scan_run.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @web_security_scanner_stub.get_scan_run 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 ScanRuns under a given ScanConfig, in descending order of ScanRun - # stop time. - # - # @overload list_scan_runs(request, options = nil) - # Pass arguments to `list_scan_runs` via a request object, either of type - # {::Google::Cloud::WebSecurityScanner::V1beta::ListScanRunsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::WebSecurityScanner::V1beta::ListScanRunsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_scan_runs(parent: nil, page_token: nil, page_size: nil) - # Pass arguments to `list_scan_runs` via keyword arguments. Note that at - # least one keyword argument is 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 parent resource name, which should be a scan resource name in the - # format 'projects/\\{projectId}/scanConfigs/\\{scanConfigId}'. - # @param page_token [::String] - # A token identifying a page of results to be returned. This should be a - # `next_page_token` value returned from a previous List request. - # If unspecified, the first page of results is returned. - # @param page_size [::Integer] - # The maximum number of ScanRuns to return, can be limited by server. - # If not specified or not positive, the implementation will select a - # reasonable value. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::WebSecurityScanner::V1beta::ScanRun>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::WebSecurityScanner::V1beta::ScanRun>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/web_security_scanner/v1beta" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::WebSecurityScanner::V1beta::ListScanRunsRequest.new - # - # # Call the list_scan_runs method. - # result = client.list_scan_runs 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::WebSecurityScanner::V1beta::ScanRun. - # p item - # end - # - def list_scan_runs request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::WebSecurityScanner::V1beta::ListScanRunsRequest - - # Converts hash 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_scan_runs.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::WebSecurityScanner::V1beta::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_scan_runs.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_scan_runs.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @web_security_scanner_stub.list_scan_runs request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @web_security_scanner_stub, :list_scan_runs, "scan_runs", 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 - - ## - # Stops a ScanRun. The stopped ScanRun is returned. - # - # @overload stop_scan_run(request, options = nil) - # Pass arguments to `stop_scan_run` via a request object, either of type - # {::Google::Cloud::WebSecurityScanner::V1beta::StopScanRunRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::WebSecurityScanner::V1beta::StopScanRunRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload stop_scan_run(name: nil) - # Pass arguments to `stop_scan_run` via keyword arguments. Note that at - # least one keyword argument is 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 ScanRun to be stopped. The name follows the - # format of - # 'projects/\\{projectId}/scanConfigs/\\{scanConfigId}/scanRuns/\\{scanRunId}'. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::WebSecurityScanner::V1beta::ScanRun] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::WebSecurityScanner::V1beta::ScanRun] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/web_security_scanner/v1beta" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::WebSecurityScanner::V1beta::StopScanRunRequest.new - # - # # Call the stop_scan_run method. - # result = client.stop_scan_run request - # - # # The returned object is of type Google::Cloud::WebSecurityScanner::V1beta::ScanRun. - # p result - # - def stop_scan_run request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::WebSecurityScanner::V1beta::StopScanRunRequest - - # Converts hash 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.stop_scan_run.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::WebSecurityScanner::V1beta::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.stop_scan_run.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.stop_scan_run.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @web_security_scanner_stub.stop_scan_run 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 - - ## - # List CrawledUrls under a given ScanRun. - # - # @overload list_crawled_urls(request, options = nil) - # Pass arguments to `list_crawled_urls` via a request object, either of type - # {::Google::Cloud::WebSecurityScanner::V1beta::ListCrawledUrlsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::WebSecurityScanner::V1beta::ListCrawledUrlsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_crawled_urls(parent: nil, page_token: nil, page_size: nil) - # Pass arguments to `list_crawled_urls` via keyword arguments. Note that at - # least one keyword argument is 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 parent resource name, which should be a scan run resource name in the - # format - # 'projects/\\{projectId}/scanConfigs/\\{scanConfigId}/scanRuns/\\{scanRunId}'. - # @param page_token [::String] - # A token identifying a page of results to be returned. This should be a - # `next_page_token` value returned from a previous List request. - # If unspecified, the first page of results is returned. - # @param page_size [::Integer] - # The maximum number of CrawledUrls to return, can be limited by server. - # If not specified or not positive, the implementation will select a - # reasonable value. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::WebSecurityScanner::V1beta::CrawledUrl>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::WebSecurityScanner::V1beta::CrawledUrl>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/web_security_scanner/v1beta" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::WebSecurityScanner::V1beta::ListCrawledUrlsRequest.new - # - # # Call the list_crawled_urls method. - # result = client.list_crawled_urls 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::WebSecurityScanner::V1beta::CrawledUrl. - # p item - # end - # - def list_crawled_urls request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::WebSecurityScanner::V1beta::ListCrawledUrlsRequest - - # Converts hash 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_crawled_urls.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::WebSecurityScanner::V1beta::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_crawled_urls.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_crawled_urls.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @web_security_scanner_stub.list_crawled_urls request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @web_security_scanner_stub, :list_crawled_urls, "crawled_urls", 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 a Finding. - # - # @overload get_finding(request, options = nil) - # Pass arguments to `get_finding` via a request object, either of type - # {::Google::Cloud::WebSecurityScanner::V1beta::GetFindingRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::WebSecurityScanner::V1beta::GetFindingRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_finding(name: nil) - # Pass arguments to `get_finding` via keyword arguments. Note that at - # least one keyword argument is 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 Finding to be returned. The name follows the - # format of - # 'projects/\\{projectId}/scanConfigs/\\{scanConfigId}/scanRuns/\\{scanRunId}/findings/\\{findingId}'. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::WebSecurityScanner::V1beta::Finding] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::WebSecurityScanner::V1beta::Finding] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/web_security_scanner/v1beta" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::WebSecurityScanner::V1beta::GetFindingRequest.new - # - # # Call the get_finding method. - # result = client.get_finding request - # - # # The returned object is of type Google::Cloud::WebSecurityScanner::V1beta::Finding. - # p result - # - def get_finding request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::WebSecurityScanner::V1beta::GetFindingRequest - - # Converts hash 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_finding.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::WebSecurityScanner::V1beta::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_finding.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_finding.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @web_security_scanner_stub.get_finding 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 - - ## - # List Findings under a given ScanRun. - # - # @overload list_findings(request, options = nil) - # Pass arguments to `list_findings` via a request object, either of type - # {::Google::Cloud::WebSecurityScanner::V1beta::ListFindingsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::WebSecurityScanner::V1beta::ListFindingsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_findings(parent: nil, filter: nil, page_token: nil, page_size: nil) - # Pass arguments to `list_findings` via keyword arguments. Note that at - # least one keyword argument is 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 parent resource name, which should be a scan run resource name in the - # format - # 'projects/\\{projectId}/scanConfigs/\\{scanConfigId}/scanRuns/\\{scanRunId}'. - # @param filter [::String] - # Required. The filter expression. The expression must be in the format: - # . - # Supported field: 'finding_type'. - # Supported operator: '='. - # @param page_token [::String] - # A token identifying a page of results to be returned. This should be a - # `next_page_token` value returned from a previous List request. - # If unspecified, the first page of results is returned. - # @param page_size [::Integer] - # The maximum number of Findings to return, can be limited by server. - # If not specified or not positive, the implementation will select a - # reasonable value. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::WebSecurityScanner::V1beta::Finding>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::WebSecurityScanner::V1beta::Finding>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/web_security_scanner/v1beta" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::WebSecurityScanner::V1beta::ListFindingsRequest.new - # - # # Call the list_findings method. - # result = client.list_findings 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::WebSecurityScanner::V1beta::Finding. - # p item - # end - # - def list_findings request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::WebSecurityScanner::V1beta::ListFindingsRequest - - # Converts hash 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_findings.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::WebSecurityScanner::V1beta::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_findings.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_findings.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @web_security_scanner_stub.list_findings request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @web_security_scanner_stub, :list_findings, "findings", 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 - - ## - # List all FindingTypeStats under a given ScanRun. - # - # @overload list_finding_type_stats(request, options = nil) - # Pass arguments to `list_finding_type_stats` via a request object, either of type - # {::Google::Cloud::WebSecurityScanner::V1beta::ListFindingTypeStatsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::WebSecurityScanner::V1beta::ListFindingTypeStatsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_finding_type_stats(parent: nil) - # Pass arguments to `list_finding_type_stats` via keyword arguments. Note that at - # least one keyword argument is 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 parent resource name, which should be a scan run resource name in the - # format - # 'projects/\\{projectId}/scanConfigs/\\{scanConfigId}/scanRuns/\\{scanRunId}'. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::WebSecurityScanner::V1beta::ListFindingTypeStatsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::WebSecurityScanner::V1beta::ListFindingTypeStatsResponse] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/web_security_scanner/v1beta" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::WebSecurityScanner::V1beta::ListFindingTypeStatsRequest.new - # - # # Call the list_finding_type_stats method. - # result = client.list_finding_type_stats request - # - # # The returned object is of type Google::Cloud::WebSecurityScanner::V1beta::ListFindingTypeStatsResponse. - # p result - # - def list_finding_type_stats request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::WebSecurityScanner::V1beta::ListFindingTypeStatsRequest - - # Converts hash 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_finding_type_stats.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::WebSecurityScanner::V1beta::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_finding_type_stats.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_finding_type_stats.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @web_security_scanner_stub.list_finding_type_stats 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 WebSecurityScanner REST API. - # - # This class represents the configuration for WebSecurityScanner 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::WebSecurityScanner::V1beta::WebSecurityScanner::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_scan_config to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.create_scan_config.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.create_scan_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 = "websecurityscanner.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 WebSecurityScanner 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_scan_config` - # @return [::Gapic::Config::Method] - # - attr_reader :create_scan_config - ## - # RPC-specific configuration for `delete_scan_config` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_scan_config - ## - # RPC-specific configuration for `get_scan_config` - # @return [::Gapic::Config::Method] - # - attr_reader :get_scan_config - ## - # RPC-specific configuration for `list_scan_configs` - # @return [::Gapic::Config::Method] - # - attr_reader :list_scan_configs - ## - # RPC-specific configuration for `update_scan_config` - # @return [::Gapic::Config::Method] - # - attr_reader :update_scan_config - ## - # RPC-specific configuration for `start_scan_run` - # @return [::Gapic::Config::Method] - # - attr_reader :start_scan_run - ## - # RPC-specific configuration for `get_scan_run` - # @return [::Gapic::Config::Method] - # - attr_reader :get_scan_run - ## - # RPC-specific configuration for `list_scan_runs` - # @return [::Gapic::Config::Method] - # - attr_reader :list_scan_runs - ## - # RPC-specific configuration for `stop_scan_run` - # @return [::Gapic::Config::Method] - # - attr_reader :stop_scan_run - ## - # RPC-specific configuration for `list_crawled_urls` - # @return [::Gapic::Config::Method] - # - attr_reader :list_crawled_urls - ## - # RPC-specific configuration for `get_finding` - # @return [::Gapic::Config::Method] - # - attr_reader :get_finding - ## - # RPC-specific configuration for `list_findings` - # @return [::Gapic::Config::Method] - # - attr_reader :list_findings - ## - # RPC-specific configuration for `list_finding_type_stats` - # @return [::Gapic::Config::Method] - # - attr_reader :list_finding_type_stats - - # @private - def initialize parent_rpcs = nil - create_scan_config_config = parent_rpcs.create_scan_config if parent_rpcs.respond_to? :create_scan_config - @create_scan_config = ::Gapic::Config::Method.new create_scan_config_config - delete_scan_config_config = parent_rpcs.delete_scan_config if parent_rpcs.respond_to? :delete_scan_config - @delete_scan_config = ::Gapic::Config::Method.new delete_scan_config_config - get_scan_config_config = parent_rpcs.get_scan_config if parent_rpcs.respond_to? :get_scan_config - @get_scan_config = ::Gapic::Config::Method.new get_scan_config_config - list_scan_configs_config = parent_rpcs.list_scan_configs if parent_rpcs.respond_to? :list_scan_configs - @list_scan_configs = ::Gapic::Config::Method.new list_scan_configs_config - update_scan_config_config = parent_rpcs.update_scan_config if parent_rpcs.respond_to? :update_scan_config - @update_scan_config = ::Gapic::Config::Method.new update_scan_config_config - start_scan_run_config = parent_rpcs.start_scan_run if parent_rpcs.respond_to? :start_scan_run - @start_scan_run = ::Gapic::Config::Method.new start_scan_run_config - get_scan_run_config = parent_rpcs.get_scan_run if parent_rpcs.respond_to? :get_scan_run - @get_scan_run = ::Gapic::Config::Method.new get_scan_run_config - list_scan_runs_config = parent_rpcs.list_scan_runs if parent_rpcs.respond_to? :list_scan_runs - @list_scan_runs = ::Gapic::Config::Method.new list_scan_runs_config - stop_scan_run_config = parent_rpcs.stop_scan_run if parent_rpcs.respond_to? :stop_scan_run - @stop_scan_run = ::Gapic::Config::Method.new stop_scan_run_config - list_crawled_urls_config = parent_rpcs.list_crawled_urls if parent_rpcs.respond_to? :list_crawled_urls - @list_crawled_urls = ::Gapic::Config::Method.new list_crawled_urls_config - get_finding_config = parent_rpcs.get_finding if parent_rpcs.respond_to? :get_finding - @get_finding = ::Gapic::Config::Method.new get_finding_config - list_findings_config = parent_rpcs.list_findings if parent_rpcs.respond_to? :list_findings - @list_findings = ::Gapic::Config::Method.new list_findings_config - list_finding_type_stats_config = parent_rpcs.list_finding_type_stats if parent_rpcs.respond_to? :list_finding_type_stats - @list_finding_type_stats = ::Gapic::Config::Method.new list_finding_type_stats_config - - yield self if block_given? - end - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-web_security_scanner-v1beta/lib/google/cloud/web_security_scanner/v1beta/web_security_scanner/rest/service_stub.rb b/owl-bot-staging/google-cloud-web_security_scanner-v1beta/lib/google/cloud/web_security_scanner/v1beta/web_security_scanner/rest/service_stub.rb deleted file mode 100644 index bcd26bf90ea5..000000000000 --- a/owl-bot-staging/google-cloud-web_security_scanner-v1beta/lib/google/cloud/web_security_scanner/v1beta/web_security_scanner/rest/service_stub.rb +++ /dev/null @@ -1,878 +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/websecurityscanner/v1beta/web_security_scanner_pb" - -module Google - module Cloud - module WebSecurityScanner - module V1beta - module WebSecurityScanner - module Rest - ## - # REST service stub for the WebSecurityScanner 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_scan_config REST call - # - # @param request_pb [::Google::Cloud::WebSecurityScanner::V1beta::CreateScanConfigRequest] - # 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::WebSecurityScanner::V1beta::ScanConfig] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::WebSecurityScanner::V1beta::ScanConfig] - # A result object deserialized from the server's reply - def create_scan_config request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_scan_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: "create_scan_config", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::WebSecurityScanner::V1beta::ScanConfig.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_scan_config REST call - # - # @param request_pb [::Google::Cloud::WebSecurityScanner::V1beta::DeleteScanConfigRequest] - # 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_scan_config request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_delete_scan_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: "delete_scan_config", - 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 get_scan_config REST call - # - # @param request_pb [::Google::Cloud::WebSecurityScanner::V1beta::GetScanConfigRequest] - # 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::WebSecurityScanner::V1beta::ScanConfig] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::WebSecurityScanner::V1beta::ScanConfig] - # A result object deserialized from the server's reply - def get_scan_config request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_scan_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_scan_config", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::WebSecurityScanner::V1beta::ScanConfig.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_scan_configs REST call - # - # @param request_pb [::Google::Cloud::WebSecurityScanner::V1beta::ListScanConfigsRequest] - # 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::WebSecurityScanner::V1beta::ListScanConfigsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::WebSecurityScanner::V1beta::ListScanConfigsResponse] - # A result object deserialized from the server's reply - def list_scan_configs request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_scan_configs_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_scan_configs", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::WebSecurityScanner::V1beta::ListScanConfigsResponse.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_scan_config REST call - # - # @param request_pb [::Google::Cloud::WebSecurityScanner::V1beta::UpdateScanConfigRequest] - # 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::WebSecurityScanner::V1beta::ScanConfig] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::WebSecurityScanner::V1beta::ScanConfig] - # A result object deserialized from the server's reply - def update_scan_config request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_scan_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_scan_config", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::WebSecurityScanner::V1beta::ScanConfig.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the start_scan_run REST call - # - # @param request_pb [::Google::Cloud::WebSecurityScanner::V1beta::StartScanRunRequest] - # 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::WebSecurityScanner::V1beta::ScanRun] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::WebSecurityScanner::V1beta::ScanRun] - # A result object deserialized from the server's reply - def start_scan_run request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_start_scan_run_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: "start_scan_run", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::WebSecurityScanner::V1beta::ScanRun.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_scan_run REST call - # - # @param request_pb [::Google::Cloud::WebSecurityScanner::V1beta::GetScanRunRequest] - # 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::WebSecurityScanner::V1beta::ScanRun] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::WebSecurityScanner::V1beta::ScanRun] - # A result object deserialized from the server's reply - def get_scan_run request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_scan_run_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_scan_run", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::WebSecurityScanner::V1beta::ScanRun.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_scan_runs REST call - # - # @param request_pb [::Google::Cloud::WebSecurityScanner::V1beta::ListScanRunsRequest] - # 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::WebSecurityScanner::V1beta::ListScanRunsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::WebSecurityScanner::V1beta::ListScanRunsResponse] - # A result object deserialized from the server's reply - def list_scan_runs request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_scan_runs_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_scan_runs", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::WebSecurityScanner::V1beta::ListScanRunsResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the stop_scan_run REST call - # - # @param request_pb [::Google::Cloud::WebSecurityScanner::V1beta::StopScanRunRequest] - # 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::WebSecurityScanner::V1beta::ScanRun] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::WebSecurityScanner::V1beta::ScanRun] - # A result object deserialized from the server's reply - def stop_scan_run request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_stop_scan_run_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: "stop_scan_run", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::WebSecurityScanner::V1beta::ScanRun.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_crawled_urls REST call - # - # @param request_pb [::Google::Cloud::WebSecurityScanner::V1beta::ListCrawledUrlsRequest] - # 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::WebSecurityScanner::V1beta::ListCrawledUrlsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::WebSecurityScanner::V1beta::ListCrawledUrlsResponse] - # A result object deserialized from the server's reply - def list_crawled_urls request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_crawled_urls_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_crawled_urls", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::WebSecurityScanner::V1beta::ListCrawledUrlsResponse.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_finding REST call - # - # @param request_pb [::Google::Cloud::WebSecurityScanner::V1beta::GetFindingRequest] - # 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::WebSecurityScanner::V1beta::Finding] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::WebSecurityScanner::V1beta::Finding] - # A result object deserialized from the server's reply - def get_finding request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_finding_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_finding", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::WebSecurityScanner::V1beta::Finding.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_findings REST call - # - # @param request_pb [::Google::Cloud::WebSecurityScanner::V1beta::ListFindingsRequest] - # 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::WebSecurityScanner::V1beta::ListFindingsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::WebSecurityScanner::V1beta::ListFindingsResponse] - # A result object deserialized from the server's reply - def list_findings request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_findings_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_findings", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::WebSecurityScanner::V1beta::ListFindingsResponse.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_finding_type_stats REST call - # - # @param request_pb [::Google::Cloud::WebSecurityScanner::V1beta::ListFindingTypeStatsRequest] - # 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::WebSecurityScanner::V1beta::ListFindingTypeStatsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::WebSecurityScanner::V1beta::ListFindingTypeStatsResponse] - # A result object deserialized from the server's reply - def list_finding_type_stats request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_finding_type_stats_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_finding_type_stats", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::WebSecurityScanner::V1beta::ListFindingTypeStatsResponse.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_scan_config REST call - # - # @param request_pb [::Google::Cloud::WebSecurityScanner::V1beta::CreateScanConfigRequest] - # 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_scan_config_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1beta/{parent}/scanConfigs", - body: "scan_config", - matches: [ - ["parent", %r{^projects/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_scan_config REST call - # - # @param request_pb [::Google::Cloud::WebSecurityScanner::V1beta::DeleteScanConfigRequest] - # 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_scan_config_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v1beta/{name}", - matches: [ - ["name", %r{^projects/[^/]+/scanConfigs/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_scan_config REST call - # - # @param request_pb [::Google::Cloud::WebSecurityScanner::V1beta::GetScanConfigRequest] - # 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_scan_config_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1beta/{name}", - matches: [ - ["name", %r{^projects/[^/]+/scanConfigs/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_scan_configs REST call - # - # @param request_pb [::Google::Cloud::WebSecurityScanner::V1beta::ListScanConfigsRequest] - # 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_scan_configs_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1beta/{parent}/scanConfigs", - matches: [ - ["parent", %r{^projects/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_scan_config REST call - # - # @param request_pb [::Google::Cloud::WebSecurityScanner::V1beta::UpdateScanConfigRequest] - # 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_scan_config_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v1beta/{scan_config.name}", - body: "scan_config", - matches: [ - ["scan_config.name", %r{^projects/[^/]+/scanConfigs/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the start_scan_run REST call - # - # @param request_pb [::Google::Cloud::WebSecurityScanner::V1beta::StartScanRunRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_start_scan_run_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1beta/{name}:start", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/scanConfigs/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_scan_run REST call - # - # @param request_pb [::Google::Cloud::WebSecurityScanner::V1beta::GetScanRunRequest] - # 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_scan_run_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1beta/{name}", - matches: [ - ["name", %r{^projects/[^/]+/scanConfigs/[^/]+/scanRuns/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_scan_runs REST call - # - # @param request_pb [::Google::Cloud::WebSecurityScanner::V1beta::ListScanRunsRequest] - # 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_scan_runs_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1beta/{parent}/scanRuns", - matches: [ - ["parent", %r{^projects/[^/]+/scanConfigs/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the stop_scan_run REST call - # - # @param request_pb [::Google::Cloud::WebSecurityScanner::V1beta::StopScanRunRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_stop_scan_run_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1beta/{name}:stop", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/scanConfigs/[^/]+/scanRuns/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_crawled_urls REST call - # - # @param request_pb [::Google::Cloud::WebSecurityScanner::V1beta::ListCrawledUrlsRequest] - # 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_crawled_urls_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1beta/{parent}/crawledUrls", - matches: [ - ["parent", %r{^projects/[^/]+/scanConfigs/[^/]+/scanRuns/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_finding REST call - # - # @param request_pb [::Google::Cloud::WebSecurityScanner::V1beta::GetFindingRequest] - # 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_finding_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1beta/{name}", - matches: [ - ["name", %r{^projects/[^/]+/scanConfigs/[^/]+/scanRuns/[^/]+/findings/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_findings REST call - # - # @param request_pb [::Google::Cloud::WebSecurityScanner::V1beta::ListFindingsRequest] - # 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_findings_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1beta/{parent}/findings", - matches: [ - ["parent", %r{^projects/[^/]+/scanConfigs/[^/]+/scanRuns/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_finding_type_stats REST call - # - # @param request_pb [::Google::Cloud::WebSecurityScanner::V1beta::ListFindingTypeStatsRequest] - # 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_finding_type_stats_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1beta/{parent}/findingTypeStats", - matches: [ - ["parent", %r{^projects/[^/]+/scanConfigs/[^/]+/scanRuns/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-web_security_scanner-v1beta/lib/google/cloud/websecurityscanner/v1beta/crawled_url_pb.rb b/owl-bot-staging/google-cloud-web_security_scanner-v1beta/lib/google/cloud/websecurityscanner/v1beta/crawled_url_pb.rb deleted file mode 100644 index 300dbef56aa1..000000000000 --- a/owl-bot-staging/google-cloud-web_security_scanner-v1beta/lib/google/cloud/websecurityscanner/v1beta/crawled_url_pb.rb +++ /dev/null @@ -1,21 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/websecurityscanner/v1beta/crawled_url.proto - -require 'google/protobuf' - - -descriptor_data = "\n8google/cloud/websecurityscanner/v1beta/crawled_url.proto\x12&google.cloud.websecurityscanner.v1beta\"<\n\nCrawledUrl\x12\x13\n\x0bhttp_method\x18\x01 \x01(\t\x12\x0b\n\x03url\x18\x02 \x01(\t\x12\x0c\n\x04\x62ody\x18\x03 \x01(\tB\x99\x02\n*com.google.cloud.websecurityscanner.v1betaB\x0f\x43rawledUrlProtoP\x01ZZcloud.google.com/go/websecurityscanner/apiv1beta/websecurityscannerpb;websecurityscannerpb\xaa\x02&Google.Cloud.WebSecurityScanner.V1Beta\xca\x02&Google\\Cloud\\WebSecurityScanner\\V1beta\xea\x02)Google::Cloud::WebSecurityScanner::V1betab\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module WebSecurityScanner - module V1beta - CrawledUrl = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.websecurityscanner.v1beta.CrawledUrl").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-web_security_scanner-v1beta/lib/google/cloud/websecurityscanner/v1beta/finding_addon_pb.rb b/owl-bot-staging/google-cloud-web_security_scanner-v1beta/lib/google/cloud/websecurityscanner/v1beta/finding_addon_pb.rb deleted file mode 100644 index d039df3934ca..000000000000 --- a/owl-bot-staging/google-cloud-web_security_scanner-v1beta/lib/google/cloud/websecurityscanner/v1beta/finding_addon_pb.rb +++ /dev/null @@ -1,27 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/websecurityscanner/v1beta/finding_addon.proto - -require 'google/protobuf' - - -descriptor_data = "\n:google/cloud/websecurityscanner/v1beta/finding_addon.proto\x12&google.cloud.websecurityscanner.v1beta\"*\n\x04\x46orm\x12\x12\n\naction_uri\x18\x01 \x01(\t\x12\x0e\n\x06\x66ields\x18\x02 \x03(\t\"Q\n\x0fOutdatedLibrary\x12\x14\n\x0clibrary_name\x18\x01 \x01(\t\x12\x0f\n\x07version\x18\x02 \x01(\t\x12\x17\n\x0flearn_more_urls\x18\x03 \x03(\t\"?\n\x11ViolatingResource\x12\x14\n\x0c\x63ontent_type\x18\x01 \x01(\t\x12\x14\n\x0cresource_url\x18\x02 \x01(\t\"/\n\x14VulnerableParameters\x12\x17\n\x0fparameter_names\x18\x01 \x03(\t\"\xe8\x01\n\x11VulnerableHeaders\x12Q\n\x07headers\x18\x01 \x03(\x0b\x32@.google.cloud.websecurityscanner.v1beta.VulnerableHeaders.Header\x12Y\n\x0fmissing_headers\x18\x02 \x03(\x0b\x32@.google.cloud.websecurityscanner.v1beta.VulnerableHeaders.Header\x1a%\n\x06Header\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t\"2\n\x03Xss\x12\x14\n\x0cstack_traces\x18\x01 \x03(\t\x12\x15\n\rerror_message\x18\x02 \x01(\tB\x9b\x02\n*com.google.cloud.websecurityscanner.v1betaB\x11\x46indingAddonProtoP\x01ZZcloud.google.com/go/websecurityscanner/apiv1beta/websecurityscannerpb;websecurityscannerpb\xaa\x02&Google.Cloud.WebSecurityScanner.V1Beta\xca\x02&Google\\Cloud\\WebSecurityScanner\\V1beta\xea\x02)Google::Cloud::WebSecurityScanner::V1betab\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module WebSecurityScanner - module V1beta - Form = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.websecurityscanner.v1beta.Form").msgclass - OutdatedLibrary = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.websecurityscanner.v1beta.OutdatedLibrary").msgclass - ViolatingResource = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.websecurityscanner.v1beta.ViolatingResource").msgclass - VulnerableParameters = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.websecurityscanner.v1beta.VulnerableParameters").msgclass - VulnerableHeaders = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.websecurityscanner.v1beta.VulnerableHeaders").msgclass - VulnerableHeaders::Header = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.websecurityscanner.v1beta.VulnerableHeaders.Header").msgclass - Xss = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.websecurityscanner.v1beta.Xss").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-web_security_scanner-v1beta/lib/google/cloud/websecurityscanner/v1beta/finding_pb.rb b/owl-bot-staging/google-cloud-web_security_scanner-v1beta/lib/google/cloud/websecurityscanner/v1beta/finding_pb.rb deleted file mode 100644 index 1a3b0059d4ea..000000000000 --- a/owl-bot-staging/google-cloud-web_security_scanner-v1beta/lib/google/cloud/websecurityscanner/v1beta/finding_pb.rb +++ /dev/null @@ -1,24 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/websecurityscanner/v1beta/finding.proto - -require 'google/protobuf' - -require 'google/api/resource_pb' -require 'google/cloud/websecurityscanner/v1beta/finding_addon_pb' - - -descriptor_data = "\n4google/cloud/websecurityscanner/v1beta/finding.proto\x12&google.cloud.websecurityscanner.v1beta\x1a\x19google/api/resource.proto\x1a:google/cloud/websecurityscanner/v1beta/finding_addon.proto\"\xa9\x06\n\x07\x46inding\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x14\n\x0c\x66inding_type\x18\x02 \x01(\t\x12\x13\n\x0bhttp_method\x18\x03 \x01(\t\x12\x12\n\nfuzzed_url\x18\x04 \x01(\t\x12\x0c\n\x04\x62ody\x18\x05 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x06 \x01(\t\x12\x18\n\x10reproduction_url\x18\x07 \x01(\t\x12\x11\n\tframe_url\x18\x08 \x01(\t\x12\x11\n\tfinal_url\x18\t \x01(\t\x12\x13\n\x0btracking_id\x18\n \x01(\t\x12:\n\x04\x66orm\x18\x10 \x01(\x0b\x32,.google.cloud.websecurityscanner.v1beta.Form\x12Q\n\x10outdated_library\x18\x0b \x01(\x0b\x32\x37.google.cloud.websecurityscanner.v1beta.OutdatedLibrary\x12U\n\x12violating_resource\x18\x0c \x01(\x0b\x32\x39.google.cloud.websecurityscanner.v1beta.ViolatingResource\x12U\n\x12vulnerable_headers\x18\x0f \x01(\x0b\x32\x39.google.cloud.websecurityscanner.v1beta.VulnerableHeaders\x12[\n\x15vulnerable_parameters\x18\r \x01(\x0b\x32<.google.cloud.websecurityscanner.v1beta.VulnerableParameters\x12\x38\n\x03xss\x18\x0e \x01(\x0b\x32+.google.cloud.websecurityscanner.v1beta.Xss:\x84\x01\xea\x41\x80\x01\n)websecurityscanner.googleapis.com/Finding\x12Sprojects/{project}/scanConfigs/{scan_config}/scanRuns/{scan_run}/findings/{finding}B\x96\x02\n*com.google.cloud.websecurityscanner.v1betaB\x0c\x46indingProtoP\x01ZZcloud.google.com/go/websecurityscanner/apiv1beta/websecurityscannerpb;websecurityscannerpb\xaa\x02&Google.Cloud.WebSecurityScanner.V1Beta\xca\x02&Google\\Cloud\\WebSecurityScanner\\V1beta\xea\x02)Google::Cloud::WebSecurityScanner::V1betab\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module WebSecurityScanner - module V1beta - Finding = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.websecurityscanner.v1beta.Finding").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-web_security_scanner-v1beta/lib/google/cloud/websecurityscanner/v1beta/finding_type_stats_pb.rb b/owl-bot-staging/google-cloud-web_security_scanner-v1beta/lib/google/cloud/websecurityscanner/v1beta/finding_type_stats_pb.rb deleted file mode 100644 index 136678f8b4cc..000000000000 --- a/owl-bot-staging/google-cloud-web_security_scanner-v1beta/lib/google/cloud/websecurityscanner/v1beta/finding_type_stats_pb.rb +++ /dev/null @@ -1,21 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/websecurityscanner/v1beta/finding_type_stats.proto - -require 'google/protobuf' - - -descriptor_data = "\n?google/cloud/websecurityscanner/v1beta/finding_type_stats.proto\x12&google.cloud.websecurityscanner.v1beta\"?\n\x10\x46indingTypeStats\x12\x14\n\x0c\x66inding_type\x18\x01 \x01(\t\x12\x15\n\rfinding_count\x18\x02 \x01(\x05\x42\x9f\x02\n*com.google.cloud.websecurityscanner.v1betaB\x15\x46indingTypeStatsProtoP\x01ZZcloud.google.com/go/websecurityscanner/apiv1beta/websecurityscannerpb;websecurityscannerpb\xaa\x02&Google.Cloud.WebSecurityScanner.V1Beta\xca\x02&Google\\Cloud\\WebSecurityScanner\\V1beta\xea\x02)Google::Cloud::WebSecurityScanner::V1betab\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module WebSecurityScanner - module V1beta - FindingTypeStats = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.websecurityscanner.v1beta.FindingTypeStats").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-web_security_scanner-v1beta/lib/google/cloud/websecurityscanner/v1beta/scan_config_error_pb.rb b/owl-bot-staging/google-cloud-web_security_scanner-v1beta/lib/google/cloud/websecurityscanner/v1beta/scan_config_error_pb.rb deleted file mode 100644 index 56270c4fa739..000000000000 --- a/owl-bot-staging/google-cloud-web_security_scanner-v1beta/lib/google/cloud/websecurityscanner/v1beta/scan_config_error_pb.rb +++ /dev/null @@ -1,22 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/websecurityscanner/v1beta/scan_config_error.proto - -require 'google/protobuf' - - -descriptor_data = "\n>google/cloud/websecurityscanner/v1beta/scan_config_error.proto\x12&google.cloud.websecurityscanner.v1beta\"\xed\x0b\n\x0fScanConfigError\x12J\n\x04\x63ode\x18\x01 \x01(\x0e\x32<.google.cloud.websecurityscanner.v1beta.ScanConfigError.Code\x12\x12\n\nfield_name\x18\x02 \x01(\t\"\xf9\n\n\x04\x43ode\x12\x14\n\x10\x43ODE_UNSPECIFIED\x10\x00\x12\x06\n\x02OK\x10\x00\x12\x12\n\x0eINTERNAL_ERROR\x10\x01\x12\x1f\n\x1b\x41PPENGINE_API_BACKEND_ERROR\x10\x02\x12 \n\x1c\x41PPENGINE_API_NOT_ACCESSIBLE\x10\x03\x12\"\n\x1e\x41PPENGINE_DEFAULT_HOST_MISSING\x10\x04\x12!\n\x1d\x43\x41NNOT_USE_GOOGLE_COM_ACCOUNT\x10\x06\x12\x1c\n\x18\x43\x41NNOT_USE_OWNER_ACCOUNT\x10\x07\x12\x1d\n\x19\x43OMPUTE_API_BACKEND_ERROR\x10\x08\x12\x1e\n\x1a\x43OMPUTE_API_NOT_ACCESSIBLE\x10\t\x12\x37\n3CUSTOM_LOGIN_URL_DOES_NOT_BELONG_TO_CURRENT_PROJECT\x10\n\x12\x1e\n\x1a\x43USTOM_LOGIN_URL_MALFORMED\x10\x0b\x12\x33\n/CUSTOM_LOGIN_URL_MAPPED_TO_NON_ROUTABLE_ADDRESS\x10\x0c\x12\x31\n-CUSTOM_LOGIN_URL_MAPPED_TO_UNRESERVED_ADDRESS\x10\r\x12\x30\n,CUSTOM_LOGIN_URL_HAS_NON_ROUTABLE_IP_ADDRESS\x10\x0e\x12.\n*CUSTOM_LOGIN_URL_HAS_UNRESERVED_IP_ADDRESS\x10\x0f\x12\x17\n\x13\x44UPLICATE_SCAN_NAME\x10\x10\x12\x17\n\x13INVALID_FIELD_VALUE\x10\x12\x12$\n FAILED_TO_AUTHENTICATE_TO_TARGET\x10\x13\x12\x1c\n\x18\x46INDING_TYPE_UNSPECIFIED\x10\x14\x12\x1d\n\x19\x46ORBIDDEN_TO_SCAN_COMPUTE\x10\x15\x12$\n FORBIDDEN_UPDATE_TO_MANAGED_SCAN\x10+\x12\x14\n\x10MALFORMED_FILTER\x10\x16\x12\x1b\n\x17MALFORMED_RESOURCE_NAME\x10\x17\x12\x14\n\x10PROJECT_INACTIVE\x10\x18\x12\x12\n\x0eREQUIRED_FIELD\x10\x19\x12\x1e\n\x1aRESOURCE_NAME_INCONSISTENT\x10\x1a\x12\x18\n\x14SCAN_ALREADY_RUNNING\x10\x1b\x12\x14\n\x10SCAN_NOT_RUNNING\x10\x1c\x12/\n+SEED_URL_DOES_NOT_BELONG_TO_CURRENT_PROJECT\x10\x1d\x12\x16\n\x12SEED_URL_MALFORMED\x10\x1e\x12+\n\'SEED_URL_MAPPED_TO_NON_ROUTABLE_ADDRESS\x10\x1f\x12)\n%SEED_URL_MAPPED_TO_UNRESERVED_ADDRESS\x10 \x12(\n$SEED_URL_HAS_NON_ROUTABLE_IP_ADDRESS\x10!\x12&\n\"SEED_URL_HAS_UNRESERVED_IP_ADDRESS\x10#\x12\"\n\x1eSERVICE_ACCOUNT_NOT_CONFIGURED\x10$\x12\x12\n\x0eTOO_MANY_SCANS\x10%\x12\"\n\x1eUNABLE_TO_RESOLVE_PROJECT_INFO\x10&\x12(\n$UNSUPPORTED_BLACKLIST_PATTERN_FORMAT\x10\'\x12\x16\n\x12UNSUPPORTED_FILTER\x10(\x12\x1c\n\x18UNSUPPORTED_FINDING_TYPE\x10)\x12\x1a\n\x16UNSUPPORTED_URL_SCHEME\x10*\x1a\x02\x10\x01\x42\x9e\x02\n*com.google.cloud.websecurityscanner.v1betaB\x14ScanConfigErrorProtoP\x01ZZcloud.google.com/go/websecurityscanner/apiv1beta/websecurityscannerpb;websecurityscannerpb\xaa\x02&Google.Cloud.WebSecurityScanner.V1Beta\xca\x02&Google\\Cloud\\WebSecurityScanner\\V1beta\xea\x02)Google::Cloud::WebSecurityScanner::V1betab\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module WebSecurityScanner - module V1beta - ScanConfigError = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.websecurityscanner.v1beta.ScanConfigError").msgclass - ScanConfigError::Code = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.websecurityscanner.v1beta.ScanConfigError.Code").enummodule - end - end - end -end diff --git a/owl-bot-staging/google-cloud-web_security_scanner-v1beta/lib/google/cloud/websecurityscanner/v1beta/scan_config_pb.rb b/owl-bot-staging/google-cloud-web_security_scanner-v1beta/lib/google/cloud/websecurityscanner/v1beta/scan_config_pb.rb deleted file mode 100644 index c5a7d84f453f..000000000000 --- a/owl-bot-staging/google-cloud-web_security_scanner-v1beta/lib/google/cloud/websecurityscanner/v1beta/scan_config_pb.rb +++ /dev/null @@ -1,34 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/websecurityscanner/v1beta/scan_config.proto - -require 'google/protobuf' - -require 'google/api/field_behavior_pb' -require 'google/api/resource_pb' -require 'google/cloud/websecurityscanner/v1beta/scan_run_pb' -require 'google/protobuf/timestamp_pb' - - -descriptor_data = "\n8google/cloud/websecurityscanner/v1beta/scan_config.proto\x12&google.cloud.websecurityscanner.v1beta\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x35google/cloud/websecurityscanner/v1beta/scan_run.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xa6\r\n\nScanConfig\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x19\n\x0c\x64isplay_name\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x0f\n\x07max_qps\x18\x03 \x01(\x05\x12\x1a\n\rstarting_urls\x18\x04 \x03(\tB\x03\xe0\x41\x02\x12Y\n\x0e\x61uthentication\x18\x05 \x01(\x0b\x32\x41.google.cloud.websecurityscanner.v1beta.ScanConfig.Authentication\x12P\n\nuser_agent\x18\x06 \x01(\x0e\x32<.google.cloud.websecurityscanner.v1beta.ScanConfig.UserAgent\x12\x1a\n\x12\x62lacklist_patterns\x18\x07 \x03(\t\x12M\n\x08schedule\x18\x08 \x01(\x0b\x32;.google.cloud.websecurityscanner.v1beta.ScanConfig.Schedule\x12[\n\x10target_platforms\x18\t \x03(\x0e\x32\x41.google.cloud.websecurityscanner.v1beta.ScanConfig.TargetPlatform\x12{\n!export_to_security_command_center\x18\n \x01(\x0e\x32P.google.cloud.websecurityscanner.v1beta.ScanConfig.ExportToSecurityCommandCenter\x12\x43\n\nlatest_run\x18\x0b \x01(\x0b\x32/.google.cloud.websecurityscanner.v1beta.ScanRun\x12P\n\nrisk_level\x18\x0c \x01(\x0e\x32<.google.cloud.websecurityscanner.v1beta.ScanConfig.RiskLevel\x1a\x94\x03\n\x0e\x41uthentication\x12i\n\x0egoogle_account\x18\x01 \x01(\x0b\x32O.google.cloud.websecurityscanner.v1beta.ScanConfig.Authentication.GoogleAccountH\x00\x12i\n\x0e\x63ustom_account\x18\x02 \x01(\x0b\x32O.google.cloud.websecurityscanner.v1beta.ScanConfig.Authentication.CustomAccountH\x00\x1a@\n\rGoogleAccount\x12\x15\n\x08username\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x18\n\x08password\x18\x02 \x01(\tB\x06\xe0\x41\x02\xe0\x41\x04\x1aX\n\rCustomAccount\x12\x15\n\x08username\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x18\n\x08password\x18\x02 \x01(\tB\x06\xe0\x41\x02\xe0\x41\x04\x12\x16\n\tlogin_url\x18\x03 \x01(\tB\x03\xe0\x41\x02\x42\x10\n\x0e\x61uthentication\x1a\x62\n\x08Schedule\x12\x31\n\rschedule_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12#\n\x16interval_duration_days\x18\x02 \x01(\x05\x42\x03\xe0\x41\x02\"`\n\tUserAgent\x12\x1a\n\x16USER_AGENT_UNSPECIFIED\x10\x00\x12\x10\n\x0c\x43HROME_LINUX\x10\x01\x12\x12\n\x0e\x43HROME_ANDROID\x10\x02\x12\x11\n\rSAFARI_IPHONE\x10\x03\"N\n\x0eTargetPlatform\x12\x1f\n\x1bTARGET_PLATFORM_UNSPECIFIED\x10\x00\x12\x0e\n\nAPP_ENGINE\x10\x01\x12\x0b\n\x07\x43OMPUTE\x10\x02\"<\n\tRiskLevel\x12\x1a\n\x16RISK_LEVEL_UNSPECIFIED\x10\x00\x12\n\n\x06NORMAL\x10\x01\x12\x07\n\x03LOW\x10\x02\"m\n\x1d\x45xportToSecurityCommandCenter\x12\x31\n-EXPORT_TO_SECURITY_COMMAND_CENTER_UNSPECIFIED\x10\x00\x12\x0b\n\x07\x45NABLED\x10\x01\x12\x0c\n\x08\x44ISABLED\x10\x02:_\xea\x41\\\n,websecurityscanner.googleapis.com/ScanConfig\x12,projects/{project}/scanConfigs/{scan_config}B\x99\x02\n*com.google.cloud.websecurityscanner.v1betaB\x0fScanConfigProtoP\x01ZZcloud.google.com/go/websecurityscanner/apiv1beta/websecurityscannerpb;websecurityscannerpb\xaa\x02&Google.Cloud.WebSecurityScanner.V1Beta\xca\x02&Google\\Cloud\\WebSecurityScanner\\V1beta\xea\x02)Google::Cloud::WebSecurityScanner::V1betab\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module WebSecurityScanner - module V1beta - ScanConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.websecurityscanner.v1beta.ScanConfig").msgclass - ScanConfig::Authentication = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.websecurityscanner.v1beta.ScanConfig.Authentication").msgclass - ScanConfig::Authentication::GoogleAccount = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.websecurityscanner.v1beta.ScanConfig.Authentication.GoogleAccount").msgclass - ScanConfig::Authentication::CustomAccount = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.websecurityscanner.v1beta.ScanConfig.Authentication.CustomAccount").msgclass - ScanConfig::Schedule = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.websecurityscanner.v1beta.ScanConfig.Schedule").msgclass - ScanConfig::UserAgent = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.websecurityscanner.v1beta.ScanConfig.UserAgent").enummodule - ScanConfig::TargetPlatform = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.websecurityscanner.v1beta.ScanConfig.TargetPlatform").enummodule - ScanConfig::RiskLevel = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.websecurityscanner.v1beta.ScanConfig.RiskLevel").enummodule - ScanConfig::ExportToSecurityCommandCenter = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.websecurityscanner.v1beta.ScanConfig.ExportToSecurityCommandCenter").enummodule - end - end - end -end diff --git a/owl-bot-staging/google-cloud-web_security_scanner-v1beta/lib/google/cloud/websecurityscanner/v1beta/scan_run_error_trace_pb.rb b/owl-bot-staging/google-cloud-web_security_scanner-v1beta/lib/google/cloud/websecurityscanner/v1beta/scan_run_error_trace_pb.rb deleted file mode 100644 index 08dfdde3eaf9..000000000000 --- a/owl-bot-staging/google-cloud-web_security_scanner-v1beta/lib/google/cloud/websecurityscanner/v1beta/scan_run_error_trace_pb.rb +++ /dev/null @@ -1,24 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/websecurityscanner/v1beta/scan_run_error_trace.proto - -require 'google/protobuf' - -require 'google/cloud/websecurityscanner/v1beta/scan_config_error_pb' - - -descriptor_data = "\nAgoogle/cloud/websecurityscanner/v1beta/scan_run_error_trace.proto\x12&google.cloud.websecurityscanner.v1beta\x1a>google/cloud/websecurityscanner/v1beta/scan_config_error.proto\"\x95\x03\n\x11ScanRunErrorTrace\x12L\n\x04\x63ode\x18\x01 \x01(\x0e\x32>.google.cloud.websecurityscanner.v1beta.ScanRunErrorTrace.Code\x12R\n\x11scan_config_error\x18\x02 \x01(\x0b\x32\x37.google.cloud.websecurityscanner.v1beta.ScanConfigError\x12#\n\x1bmost_common_http_error_code\x18\x03 \x01(\x05\"\xb8\x01\n\x04\x43ode\x12\x14\n\x10\x43ODE_UNSPECIFIED\x10\x00\x12\x12\n\x0eINTERNAL_ERROR\x10\x01\x12\x15\n\x11SCAN_CONFIG_ISSUE\x10\x02\x12\x1f\n\x1b\x41UTHENTICATION_CONFIG_ISSUE\x10\x03\x12\x1c\n\x18TIMED_OUT_WHILE_SCANNING\x10\x04\x12\x16\n\x12TOO_MANY_REDIRECTS\x10\x05\x12\x18\n\x14TOO_MANY_HTTP_ERRORS\x10\x06\x42\xa0\x02\n*com.google.cloud.websecurityscanner.v1betaB\x16ScanRunErrorTraceProtoP\x01ZZcloud.google.com/go/websecurityscanner/apiv1beta/websecurityscannerpb;websecurityscannerpb\xaa\x02&Google.Cloud.WebSecurityScanner.V1Beta\xca\x02&Google\\Cloud\\WebSecurityScanner\\V1beta\xea\x02)Google::Cloud::WebSecurityScanner::V1betab\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module WebSecurityScanner - module V1beta - ScanRunErrorTrace = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.websecurityscanner.v1beta.ScanRunErrorTrace").msgclass - ScanRunErrorTrace::Code = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.websecurityscanner.v1beta.ScanRunErrorTrace.Code").enummodule - end - end - end -end diff --git a/owl-bot-staging/google-cloud-web_security_scanner-v1beta/lib/google/cloud/websecurityscanner/v1beta/scan_run_pb.rb b/owl-bot-staging/google-cloud-web_security_scanner-v1beta/lib/google/cloud/websecurityscanner/v1beta/scan_run_pb.rb deleted file mode 100644 index d0c56927e4c0..000000000000 --- a/owl-bot-staging/google-cloud-web_security_scanner-v1beta/lib/google/cloud/websecurityscanner/v1beta/scan_run_pb.rb +++ /dev/null @@ -1,28 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/websecurityscanner/v1beta/scan_run.proto - -require 'google/protobuf' - -require 'google/api/resource_pb' -require 'google/cloud/websecurityscanner/v1beta/scan_run_error_trace_pb' -require 'google/cloud/websecurityscanner/v1beta/scan_run_warning_trace_pb' -require 'google/protobuf/timestamp_pb' - - -descriptor_data = "\n5google/cloud/websecurityscanner/v1beta/scan_run.proto\x12&google.cloud.websecurityscanner.v1beta\x1a\x19google/api/resource.proto\x1a\x41google/cloud/websecurityscanner/v1beta/scan_run_error_trace.proto\x1a\x43google/cloud/websecurityscanner/v1beta/scan_run_warning_trace.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xd2\x06\n\x07ScanRun\x12\x0c\n\x04name\x18\x01 \x01(\t\x12W\n\x0f\x65xecution_state\x18\x02 \x01(\x0e\x32>.google.cloud.websecurityscanner.v1beta.ScanRun.ExecutionState\x12Q\n\x0cresult_state\x18\x03 \x01(\x0e\x32;.google.cloud.websecurityscanner.v1beta.ScanRun.ResultState\x12.\n\nstart_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12,\n\x08\x65nd_time\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x1a\n\x12urls_crawled_count\x18\x06 \x01(\x03\x12\x19\n\x11urls_tested_count\x18\x07 \x01(\x03\x12\x1b\n\x13has_vulnerabilities\x18\x08 \x01(\x08\x12\x18\n\x10progress_percent\x18\t \x01(\x05\x12N\n\x0b\x65rror_trace\x18\n \x01(\x0b\x32\x39.google.cloud.websecurityscanner.v1beta.ScanRunErrorTrace\x12S\n\x0ewarning_traces\x18\x0b \x03(\x0b\x32;.google.cloud.websecurityscanner.v1beta.ScanRunWarningTrace\"Y\n\x0e\x45xecutionState\x12\x1f\n\x1b\x45XECUTION_STATE_UNSPECIFIED\x10\x00\x12\n\n\x06QUEUED\x10\x01\x12\x0c\n\x08SCANNING\x10\x02\x12\x0c\n\x08\x46INISHED\x10\x03\"O\n\x0bResultState\x12\x1c\n\x18RESULT_STATE_UNSPECIFIED\x10\x00\x12\x0b\n\x07SUCCESS\x10\x01\x12\t\n\x05\x45RROR\x10\x02\x12\n\n\x06KILLED\x10\x03:p\xea\x41m\n)websecurityscanner.googleapis.com/ScanRun\x12@projects/{project}/scanConfigs/{scan_config}/scanRuns/{scan_run}B\x96\x02\n*com.google.cloud.websecurityscanner.v1betaB\x0cScanRunProtoP\x01ZZcloud.google.com/go/websecurityscanner/apiv1beta/websecurityscannerpb;websecurityscannerpb\xaa\x02&Google.Cloud.WebSecurityScanner.V1Beta\xca\x02&Google\\Cloud\\WebSecurityScanner\\V1beta\xea\x02)Google::Cloud::WebSecurityScanner::V1betab\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module WebSecurityScanner - module V1beta - ScanRun = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.websecurityscanner.v1beta.ScanRun").msgclass - ScanRun::ExecutionState = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.websecurityscanner.v1beta.ScanRun.ExecutionState").enummodule - ScanRun::ResultState = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.websecurityscanner.v1beta.ScanRun.ResultState").enummodule - end - end - end -end diff --git a/owl-bot-staging/google-cloud-web_security_scanner-v1beta/lib/google/cloud/websecurityscanner/v1beta/scan_run_warning_trace_pb.rb b/owl-bot-staging/google-cloud-web_security_scanner-v1beta/lib/google/cloud/websecurityscanner/v1beta/scan_run_warning_trace_pb.rb deleted file mode 100644 index 98c499519688..000000000000 --- a/owl-bot-staging/google-cloud-web_security_scanner-v1beta/lib/google/cloud/websecurityscanner/v1beta/scan_run_warning_trace_pb.rb +++ /dev/null @@ -1,22 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/websecurityscanner/v1beta/scan_run_warning_trace.proto - -require 'google/protobuf' - - -descriptor_data = "\nCgoogle/cloud/websecurityscanner/v1beta/scan_run_warning_trace.proto\x12&google.cloud.websecurityscanner.v1beta\"\xed\x01\n\x13ScanRunWarningTrace\x12N\n\x04\x63ode\x18\x01 \x01(\x0e\x32@.google.cloud.websecurityscanner.v1beta.ScanRunWarningTrace.Code\"\x85\x01\n\x04\x43ode\x12\x14\n\x10\x43ODE_UNSPECIFIED\x10\x00\x12\x1e\n\x1aINSUFFICIENT_CRAWL_RESULTS\x10\x01\x12\x1a\n\x16TOO_MANY_CRAWL_RESULTS\x10\x02\x12\x17\n\x13TOO_MANY_FUZZ_TASKS\x10\x03\x12\x12\n\x0e\x42LOCKED_BY_IAP\x10\x04\x42\xa2\x02\n*com.google.cloud.websecurityscanner.v1betaB\x18ScanRunWarningTraceProtoP\x01ZZcloud.google.com/go/websecurityscanner/apiv1beta/websecurityscannerpb;websecurityscannerpb\xaa\x02&Google.Cloud.WebSecurityScanner.V1Beta\xca\x02&Google\\Cloud\\WebSecurityScanner\\V1beta\xea\x02)Google::Cloud::WebSecurityScanner::V1betab\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module WebSecurityScanner - module V1beta - ScanRunWarningTrace = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.websecurityscanner.v1beta.ScanRunWarningTrace").msgclass - ScanRunWarningTrace::Code = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.websecurityscanner.v1beta.ScanRunWarningTrace.Code").enummodule - end - end - end -end diff --git a/owl-bot-staging/google-cloud-web_security_scanner-v1beta/lib/google/cloud/websecurityscanner/v1beta/web_security_scanner_pb.rb b/owl-bot-staging/google-cloud-web_security_scanner-v1beta/lib/google/cloud/websecurityscanner/v1beta/web_security_scanner_pb.rb deleted file mode 100644 index 1c1b2e5600fd..000000000000 --- a/owl-bot-staging/google-cloud-web_security_scanner-v1beta/lib/google/cloud/websecurityscanner/v1beta/web_security_scanner_pb.rb +++ /dev/null @@ -1,50 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/websecurityscanner/v1beta/web_security_scanner.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/websecurityscanner/v1beta/crawled_url_pb' -require 'google/cloud/websecurityscanner/v1beta/finding_pb' -require 'google/cloud/websecurityscanner/v1beta/finding_type_stats_pb' -require 'google/cloud/websecurityscanner/v1beta/scan_config_pb' -require 'google/cloud/websecurityscanner/v1beta/scan_run_pb' -require 'google/protobuf/empty_pb' -require 'google/protobuf/field_mask_pb' - - -descriptor_data = "\nAgoogle/cloud/websecurityscanner/v1beta/web_security_scanner.proto\x12&google.cloud.websecurityscanner.v1beta\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x38google/cloud/websecurityscanner/v1beta/crawled_url.proto\x1a\x34google/cloud/websecurityscanner/v1beta/finding.proto\x1a?google/cloud/websecurityscanner/v1beta/finding_type_stats.proto\x1a\x38google/cloud/websecurityscanner/v1beta/scan_config.proto\x1a\x35google/cloud/websecurityscanner/v1beta/scan_run.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\"\xac\x01\n\x17\x43reateScanConfigRequest\x12\x43\n\x06parent\x18\x01 \x01(\tB3\xe0\x41\x02\xfa\x41-\n+cloudresourcemanager.googleapis.com/Project\x12L\n\x0bscan_config\x18\x02 \x01(\x0b\x32\x32.google.cloud.websecurityscanner.v1beta.ScanConfigB\x03\xe0\x41\x02\"]\n\x17\x44\x65leteScanConfigRequest\x12\x42\n\x04name\x18\x01 \x01(\tB4\xe0\x41\x02\xfa\x41.\n,websecurityscanner.googleapis.com/ScanConfig\"Z\n\x14GetScanConfigRequest\x12\x42\n\x04name\x18\x01 \x01(\tB4\xe0\x41\x02\xfa\x41.\n,websecurityscanner.googleapis.com/ScanConfig\"\x84\x01\n\x16ListScanConfigsRequest\x12\x43\n\x06parent\x18\x01 \x01(\tB3\xe0\x41\x02\xfa\x41-\n+cloudresourcemanager.googleapis.com/Project\x12\x12\n\npage_token\x18\x02 \x01(\t\x12\x11\n\tpage_size\x18\x03 \x01(\x05\"\x9d\x01\n\x17UpdateScanConfigRequest\x12L\n\x0bscan_config\x18\x02 \x01(\x0b\x32\x32.google.cloud.websecurityscanner.v1beta.ScanConfigB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\"|\n\x17ListScanConfigsResponse\x12H\n\x0cscan_configs\x18\x01 \x03(\x0b\x32\x32.google.cloud.websecurityscanner.v1beta.ScanConfig\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"Y\n\x13StartScanRunRequest\x12\x42\n\x04name\x18\x01 \x01(\tB4\xe0\x41\x02\xfa\x41.\n,websecurityscanner.googleapis.com/ScanConfig\"T\n\x11GetScanRunRequest\x12?\n\x04name\x18\x01 \x01(\tB1\xe0\x41\x02\xfa\x41+\n)websecurityscanner.googleapis.com/ScanRun\"\x82\x01\n\x13ListScanRunsRequest\x12\x44\n\x06parent\x18\x01 \x01(\tB4\xe0\x41\x02\xfa\x41.\n,websecurityscanner.googleapis.com/ScanConfig\x12\x12\n\npage_token\x18\x02 \x01(\t\x12\x11\n\tpage_size\x18\x03 \x01(\x05\"s\n\x14ListScanRunsResponse\x12\x42\n\tscan_runs\x18\x01 \x03(\x0b\x32/.google.cloud.websecurityscanner.v1beta.ScanRun\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"U\n\x12StopScanRunRequest\x12?\n\x04name\x18\x01 \x01(\tB1\xe0\x41\x02\xfa\x41+\n)websecurityscanner.googleapis.com/ScanRun\"\x82\x01\n\x16ListCrawledUrlsRequest\x12\x41\n\x06parent\x18\x01 \x01(\tB1\xe0\x41\x02\xfa\x41+\n)websecurityscanner.googleapis.com/ScanRun\x12\x12\n\npage_token\x18\x02 \x01(\t\x12\x11\n\tpage_size\x18\x03 \x01(\x05\"|\n\x17ListCrawledUrlsResponse\x12H\n\x0c\x63rawled_urls\x18\x01 \x03(\x0b\x32\x32.google.cloud.websecurityscanner.v1beta.CrawledUrl\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"T\n\x11GetFindingRequest\x12?\n\x04name\x18\x01 \x01(\tB1\xe0\x41\x02\xfa\x41+\n)websecurityscanner.googleapis.com/Finding\"\x94\x01\n\x13ListFindingsRequest\x12\x41\n\x06parent\x18\x01 \x01(\tB1\xe0\x41\x02\xfa\x41+\n)websecurityscanner.googleapis.com/ScanRun\x12\x13\n\x06\x66ilter\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x12\n\npage_token\x18\x03 \x01(\t\x12\x11\n\tpage_size\x18\x04 \x01(\x05\"r\n\x14ListFindingsResponse\x12\x41\n\x08\x66indings\x18\x01 \x03(\x0b\x32/.google.cloud.websecurityscanner.v1beta.Finding\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"`\n\x1bListFindingTypeStatsRequest\x12\x41\n\x06parent\x18\x01 \x01(\tB1\xe0\x41\x02\xfa\x41+\n)websecurityscanner.googleapis.com/ScanRun\"t\n\x1cListFindingTypeStatsResponse\x12T\n\x12\x66inding_type_stats\x18\x01 \x03(\x0b\x32\x38.google.cloud.websecurityscanner.v1beta.FindingTypeStats2\x8e\x16\n\x12WebSecurityScanner\x12\xda\x01\n\x10\x43reateScanConfig\x12?.google.cloud.websecurityscanner.v1beta.CreateScanConfigRequest\x1a\x32.google.cloud.websecurityscanner.v1beta.ScanConfig\"Q\xda\x41\x12parent,scan_config\x82\xd3\xe4\x93\x02\x36\"\'/v1beta/{parent=projects/*}/scanConfigs:\x0bscan_config\x12\xa3\x01\n\x10\x44\x65leteScanConfig\x12?.google.cloud.websecurityscanner.v1beta.DeleteScanConfigRequest\x1a\x16.google.protobuf.Empty\"6\xda\x41\x04name\x82\xd3\xe4\x93\x02)*\'/v1beta/{name=projects/*/scanConfigs/*}\x12\xb9\x01\n\rGetScanConfig\x12<.google.cloud.websecurityscanner.v1beta.GetScanConfigRequest\x1a\x32.google.cloud.websecurityscanner.v1beta.ScanConfig\"6\xda\x41\x04name\x82\xd3\xe4\x93\x02)\x12\'/v1beta/{name=projects/*/scanConfigs/*}\x12\xcc\x01\n\x0fListScanConfigs\x12>.google.cloud.websecurityscanner.v1beta.ListScanConfigsRequest\x1a?.google.cloud.websecurityscanner.v1beta.ListScanConfigsResponse\"8\xda\x41\x06parent\x82\xd3\xe4\x93\x02)\x12\'/v1beta/{parent=projects/*}/scanConfigs\x12\xeb\x01\n\x10UpdateScanConfig\x12?.google.cloud.websecurityscanner.v1beta.UpdateScanConfigRequest\x1a\x32.google.cloud.websecurityscanner.v1beta.ScanConfig\"b\xda\x41\x17scan_config,update_mask\x82\xd3\xe4\x93\x02\x42\x32\x33/v1beta/{scan_config.name=projects/*/scanConfigs/*}:\x0bscan_config\x12\xbd\x01\n\x0cStartScanRun\x12;.google.cloud.websecurityscanner.v1beta.StartScanRunRequest\x1a/.google.cloud.websecurityscanner.v1beta.ScanRun\"?\xda\x41\x04name\x82\xd3\xe4\x93\x02\x32\"-/v1beta/{name=projects/*/scanConfigs/*}:start:\x01*\x12\xbb\x01\n\nGetScanRun\x12\x39.google.cloud.websecurityscanner.v1beta.GetScanRunRequest\x1a/.google.cloud.websecurityscanner.v1beta.ScanRun\"A\xda\x41\x04name\x82\xd3\xe4\x93\x02\x34\x12\x32/v1beta/{name=projects/*/scanConfigs/*/scanRuns/*}\x12\xce\x01\n\x0cListScanRuns\x12;.google.cloud.websecurityscanner.v1beta.ListScanRunsRequest\x1a<.google.cloud.websecurityscanner.v1beta.ListScanRunsResponse\"C\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x34\x12\x32/v1beta/{parent=projects/*/scanConfigs/*}/scanRuns\x12\xc5\x01\n\x0bStopScanRun\x12:.google.cloud.websecurityscanner.v1beta.StopScanRunRequest\x1a/.google.cloud.websecurityscanner.v1beta.ScanRun\"I\xda\x41\x04name\x82\xd3\xe4\x93\x02<\"7/v1beta/{name=projects/*/scanConfigs/*/scanRuns/*}:stop:\x01*\x12\xe5\x01\n\x0fListCrawledUrls\x12>.google.cloud.websecurityscanner.v1beta.ListCrawledUrlsRequest\x1a?.google.cloud.websecurityscanner.v1beta.ListCrawledUrlsResponse\"Q\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x42\x12@/v1beta/{parent=projects/*/scanConfigs/*/scanRuns/*}/crawledUrls\x12\xc6\x01\n\nGetFinding\x12\x39.google.cloud.websecurityscanner.v1beta.GetFindingRequest\x1a/.google.cloud.websecurityscanner.v1beta.Finding\"L\xda\x41\x04name\x82\xd3\xe4\x93\x02?\x12=/v1beta/{name=projects/*/scanConfigs/*/scanRuns/*/findings/*}\x12\xe0\x01\n\x0cListFindings\x12;.google.cloud.websecurityscanner.v1beta.ListFindingsRequest\x1a<.google.cloud.websecurityscanner.v1beta.ListFindingsResponse\"U\xda\x41\rparent,filter\x82\xd3\xe4\x93\x02?\x12=/v1beta/{parent=projects/*/scanConfigs/*/scanRuns/*}/findings\x12\xf9\x01\n\x14ListFindingTypeStats\x12\x43.google.cloud.websecurityscanner.v1beta.ListFindingTypeStatsRequest\x1a\x44.google.cloud.websecurityscanner.v1beta.ListFindingTypeStatsResponse\"V\xda\x41\x06parent\x82\xd3\xe4\x93\x02G\x12\x45/v1beta/{parent=projects/*/scanConfigs/*/scanRuns/*}/findingTypeStats\x1aU\xca\x41!websecurityscanner.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\xa1\x02\n*com.google.cloud.websecurityscanner.v1betaB\x17WebSecurityScannerProtoP\x01ZZcloud.google.com/go/websecurityscanner/apiv1beta/websecurityscannerpb;websecurityscannerpb\xaa\x02&Google.Cloud.WebSecurityScanner.V1Beta\xca\x02&Google\\Cloud\\WebSecurityScanner\\V1beta\xea\x02)Google::Cloud::WebSecurityScanner::V1betab\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module WebSecurityScanner - module V1beta - CreateScanConfigRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.websecurityscanner.v1beta.CreateScanConfigRequest").msgclass - DeleteScanConfigRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.websecurityscanner.v1beta.DeleteScanConfigRequest").msgclass - GetScanConfigRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.websecurityscanner.v1beta.GetScanConfigRequest").msgclass - ListScanConfigsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.websecurityscanner.v1beta.ListScanConfigsRequest").msgclass - UpdateScanConfigRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.websecurityscanner.v1beta.UpdateScanConfigRequest").msgclass - ListScanConfigsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.websecurityscanner.v1beta.ListScanConfigsResponse").msgclass - StartScanRunRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.websecurityscanner.v1beta.StartScanRunRequest").msgclass - GetScanRunRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.websecurityscanner.v1beta.GetScanRunRequest").msgclass - ListScanRunsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.websecurityscanner.v1beta.ListScanRunsRequest").msgclass - ListScanRunsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.websecurityscanner.v1beta.ListScanRunsResponse").msgclass - StopScanRunRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.websecurityscanner.v1beta.StopScanRunRequest").msgclass - ListCrawledUrlsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.websecurityscanner.v1beta.ListCrawledUrlsRequest").msgclass - ListCrawledUrlsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.websecurityscanner.v1beta.ListCrawledUrlsResponse").msgclass - GetFindingRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.websecurityscanner.v1beta.GetFindingRequest").msgclass - ListFindingsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.websecurityscanner.v1beta.ListFindingsRequest").msgclass - ListFindingsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.websecurityscanner.v1beta.ListFindingsResponse").msgclass - ListFindingTypeStatsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.websecurityscanner.v1beta.ListFindingTypeStatsRequest").msgclass - ListFindingTypeStatsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.websecurityscanner.v1beta.ListFindingTypeStatsResponse").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-web_security_scanner-v1beta/lib/google/cloud/websecurityscanner/v1beta/web_security_scanner_services_pb.rb b/owl-bot-staging/google-cloud-web_security_scanner-v1beta/lib/google/cloud/websecurityscanner/v1beta/web_security_scanner_services_pb.rb deleted file mode 100644 index d1cdbdcd623f..000000000000 --- a/owl-bot-staging/google-cloud-web_security_scanner-v1beta/lib/google/cloud/websecurityscanner/v1beta/web_security_scanner_services_pb.rb +++ /dev/null @@ -1,73 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# Source: google/cloud/websecurityscanner/v1beta/web_security_scanner.proto for package 'Google.Cloud.WebSecurityScanner.V1beta' -# 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/websecurityscanner/v1beta/web_security_scanner_pb' - -module Google - module Cloud - module WebSecurityScanner - module V1beta - module WebSecurityScanner - # Cloud Web Security Scanner Service identifies security vulnerabilities in web - # applications hosted on Google Cloud Platform. It crawls your application, and - # attempts to exercise as many user inputs and event handlers as possible. - class Service - - include ::GRPC::GenericService - - self.marshal_class_method = :encode - self.unmarshal_class_method = :decode - self.service_name = 'google.cloud.websecurityscanner.v1beta.WebSecurityScanner' - - # Creates a new ScanConfig. - rpc :CreateScanConfig, ::Google::Cloud::WebSecurityScanner::V1beta::CreateScanConfigRequest, ::Google::Cloud::WebSecurityScanner::V1beta::ScanConfig - # Deletes an existing ScanConfig and its child resources. - rpc :DeleteScanConfig, ::Google::Cloud::WebSecurityScanner::V1beta::DeleteScanConfigRequest, ::Google::Protobuf::Empty - # Gets a ScanConfig. - rpc :GetScanConfig, ::Google::Cloud::WebSecurityScanner::V1beta::GetScanConfigRequest, ::Google::Cloud::WebSecurityScanner::V1beta::ScanConfig - # Lists ScanConfigs under a given project. - rpc :ListScanConfigs, ::Google::Cloud::WebSecurityScanner::V1beta::ListScanConfigsRequest, ::Google::Cloud::WebSecurityScanner::V1beta::ListScanConfigsResponse - # Updates a ScanConfig. This method support partial update of a ScanConfig. - rpc :UpdateScanConfig, ::Google::Cloud::WebSecurityScanner::V1beta::UpdateScanConfigRequest, ::Google::Cloud::WebSecurityScanner::V1beta::ScanConfig - # Start a ScanRun according to the given ScanConfig. - rpc :StartScanRun, ::Google::Cloud::WebSecurityScanner::V1beta::StartScanRunRequest, ::Google::Cloud::WebSecurityScanner::V1beta::ScanRun - # Gets a ScanRun. - rpc :GetScanRun, ::Google::Cloud::WebSecurityScanner::V1beta::GetScanRunRequest, ::Google::Cloud::WebSecurityScanner::V1beta::ScanRun - # Lists ScanRuns under a given ScanConfig, in descending order of ScanRun - # stop time. - rpc :ListScanRuns, ::Google::Cloud::WebSecurityScanner::V1beta::ListScanRunsRequest, ::Google::Cloud::WebSecurityScanner::V1beta::ListScanRunsResponse - # Stops a ScanRun. The stopped ScanRun is returned. - rpc :StopScanRun, ::Google::Cloud::WebSecurityScanner::V1beta::StopScanRunRequest, ::Google::Cloud::WebSecurityScanner::V1beta::ScanRun - # List CrawledUrls under a given ScanRun. - rpc :ListCrawledUrls, ::Google::Cloud::WebSecurityScanner::V1beta::ListCrawledUrlsRequest, ::Google::Cloud::WebSecurityScanner::V1beta::ListCrawledUrlsResponse - # Gets a Finding. - rpc :GetFinding, ::Google::Cloud::WebSecurityScanner::V1beta::GetFindingRequest, ::Google::Cloud::WebSecurityScanner::V1beta::Finding - # List Findings under a given ScanRun. - rpc :ListFindings, ::Google::Cloud::WebSecurityScanner::V1beta::ListFindingsRequest, ::Google::Cloud::WebSecurityScanner::V1beta::ListFindingsResponse - # List all FindingTypeStats under a given ScanRun. - rpc :ListFindingTypeStats, ::Google::Cloud::WebSecurityScanner::V1beta::ListFindingTypeStatsRequest, ::Google::Cloud::WebSecurityScanner::V1beta::ListFindingTypeStatsResponse - end - - Stub = Service.rpc_stub_class - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-web_security_scanner-v1beta/proto_docs/README.md b/owl-bot-staging/google-cloud-web_security_scanner-v1beta/proto_docs/README.md deleted file mode 100644 index c39a919c1cab..000000000000 --- a/owl-bot-staging/google-cloud-web_security_scanner-v1beta/proto_docs/README.md +++ /dev/null @@ -1,4 +0,0 @@ -# Web Security Scanner V1beta 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-web_security_scanner-v1beta/proto_docs/google/api/client.rb b/owl-bot-staging/google-cloud-web_security_scanner-v1beta/proto_docs/google/api/client.rb deleted file mode 100644 index 3ab0b096d445..000000000000 --- a/owl-bot-staging/google-cloud-web_security_scanner-v1beta/proto_docs/google/api/client.rb +++ /dev/null @@ -1,593 +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. - # - # Note: This field should not be used in most cases. - 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: - # library_settings: - # 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. - # @!attribute [rw] library_package - # @return [::String] - # The package name to use in Php. Clobbers the php_namespace option - # set in the protobuf. This should be used **only** by APIs - # who have already set the language_settings.php.package_name" field - # in gapic.yaml. API teams should use the protobuf php_namespace option - # where possible. - # - # Example of a YAML configuration:: - # - # publishing: - # library_settings: - # php_settings: - # library_package: Google\Cloud\PubSub\V1 - 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. - # - # Example: - # - # 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 - # @!attribute [rw] batching - # @return [::Google::Api::BatchingConfigProto] - # Batching configuration for an API method in client libraries. - # - # Example of a YAML configuration: - # - # publishing: - # method_settings: - # - selector: google.example.v1.ExampleService.BatchCreateExample - # batching: - # element_count_threshold: 1000 - # request_byte_threshold: 100000000 - # delay_threshold_millis: 10 - 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. - # - # Note: This feature should not be used in most cases. - # @!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 - - # `BatchingConfigProto` defines the batching configuration for an API method. - # @!attribute [rw] thresholds - # @return [::Google::Api::BatchingSettingsProto] - # The thresholds which trigger a batched request to be sent. - # @!attribute [rw] batch_descriptor - # @return [::Google::Api::BatchingDescriptorProto] - # The request and response fields used in batching. - class BatchingConfigProto - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # `BatchingSettingsProto` specifies a set of batching thresholds, each of - # which acts as a trigger to send a batch of messages as a request. At least - # one threshold must be positive nonzero. - # @!attribute [rw] element_count_threshold - # @return [::Integer] - # The number of elements of a field collected into a batch which, if - # exceeded, causes the batch to be sent. - # @!attribute [rw] request_byte_threshold - # @return [::Integer] - # The aggregated size of the batched field which, if exceeded, causes the - # batch to be sent. This size is computed by aggregating the sizes of the - # request field to be batched, not of the entire request message. - # @!attribute [rw] delay_threshold - # @return [::Google::Protobuf::Duration] - # The duration after which a batch should be sent, starting from the addition - # of the first message to that batch. - # @!attribute [rw] element_count_limit - # @return [::Integer] - # The maximum number of elements collected in a batch that could be accepted - # by server. - # @!attribute [rw] request_byte_limit - # @return [::Integer] - # The maximum size of the request that could be accepted by server. - # @!attribute [rw] flow_control_element_limit - # @return [::Integer] - # The maximum number of elements allowed by flow control. - # @!attribute [rw] flow_control_byte_limit - # @return [::Integer] - # The maximum size of data allowed by flow control. - # @!attribute [rw] flow_control_limit_exceeded_behavior - # @return [::Google::Api::FlowControlLimitExceededBehaviorProto] - # The behavior to take when the flow control limit is exceeded. - class BatchingSettingsProto - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # `BatchingDescriptorProto` specifies the fields of the request message to be - # used for batching, and, optionally, the fields of the response message to be - # used for demultiplexing. - # @!attribute [rw] batched_field - # @return [::String] - # The repeated field in the request message to be aggregated by batching. - # @!attribute [rw] discriminator_fields - # @return [::Array<::String>] - # A list of the fields in the request message. Two requests will be batched - # together only if the values of every field specified in - # `request_discriminator_fields` is equal between the two requests. - # @!attribute [rw] subresponse_field - # @return [::String] - # Optional. When present, indicates the field in the response message to be - # used to demultiplex the response into multiple response messages, in - # correspondence with the multiple request messages originally batched - # together. - class BatchingDescriptorProto - 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 - - # The behavior to take when the flow control limit is exceeded. - module FlowControlLimitExceededBehaviorProto - # Default behavior, system-defined. - UNSET_BEHAVIOR = 0 - - # Stop operation, raise error. - THROW_EXCEPTION = 1 - - # Pause operation until limit clears. - BLOCK = 2 - - # Continue operation, disregard limit. - IGNORE = 3 - end - end -end diff --git a/owl-bot-staging/google-cloud-web_security_scanner-v1beta/proto_docs/google/api/field_behavior.rb b/owl-bot-staging/google-cloud-web_security_scanner-v1beta/proto_docs/google/api/field_behavior.rb deleted file mode 100644 index 582be187d115..000000000000 --- a/owl-bot-staging/google-cloud-web_security_scanner-v1beta/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-web_security_scanner-v1beta/proto_docs/google/api/launch_stage.rb b/owl-bot-staging/google-cloud-web_security_scanner-v1beta/proto_docs/google/api/launch_stage.rb deleted file mode 100644 index 9392a413fb1b..000000000000 --- a/owl-bot-staging/google-cloud-web_security_scanner-v1beta/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-web_security_scanner-v1beta/proto_docs/google/api/resource.rb b/owl-bot-staging/google-cloud-web_security_scanner-v1beta/proto_docs/google/api/resource.rb deleted file mode 100644 index 25dec4847ac1..000000000000 --- a/owl-bot-staging/google-cloud-web_security_scanner-v1beta/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-web_security_scanner-v1beta/proto_docs/google/cloud/websecurityscanner/v1beta/crawled_url.rb b/owl-bot-staging/google-cloud-web_security_scanner-v1beta/proto_docs/google/cloud/websecurityscanner/v1beta/crawled_url.rb deleted file mode 100644 index 16a4684b0a87..000000000000 --- a/owl-bot-staging/google-cloud-web_security_scanner-v1beta/proto_docs/google/cloud/websecurityscanner/v1beta/crawled_url.rb +++ /dev/null @@ -1,44 +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 WebSecurityScanner - module V1beta - # A CrawledUrl resource represents a URL that was crawled during a ScanRun. Web - # Security Scanner Service crawls the web applications, following all links - # within the scope of sites, to find the URLs to test against. - # @!attribute [rw] http_method - # @return [::String] - # The http method of the request that was used to visit the URL, in - # uppercase. - # @!attribute [rw] url - # @return [::String] - # The URL that was crawled. - # @!attribute [rw] body - # @return [::String] - # The body of the request that was used to visit the URL. - class CrawledUrl - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-web_security_scanner-v1beta/proto_docs/google/cloud/websecurityscanner/v1beta/finding.rb b/owl-bot-staging/google-cloud-web_security_scanner-v1beta/proto_docs/google/cloud/websecurityscanner/v1beta/finding.rb deleted file mode 100644 index b6d583c7a7df..000000000000 --- a/owl-bot-staging/google-cloud-web_security_scanner-v1beta/proto_docs/google/cloud/websecurityscanner/v1beta/finding.rb +++ /dev/null @@ -1,93 +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 WebSecurityScanner - module V1beta - # A Finding resource represents a vulnerability instance identified during a - # ScanRun. - # @!attribute [rw] name - # @return [::String] - # The resource name of the Finding. The name follows the format of - # 'projects/\\{projectId}/scanConfigs/\\{scanConfigId}/scanruns/\\{scanRunId}/findings/\\{findingId}'. - # The finding IDs are generated by the system. - # @!attribute [rw] finding_type - # @return [::String] - # The type of the Finding. - # Detailed and up-to-date information on findings can be found here: - # https://cloud.google.com/security-scanner/docs/scan-result-details - # @!attribute [rw] http_method - # @return [::String] - # The http method of the request that triggered the vulnerability, in - # uppercase. - # @!attribute [rw] fuzzed_url - # @return [::String] - # The URL produced by the server-side fuzzer and used in the request that - # triggered the vulnerability. - # @!attribute [rw] body - # @return [::String] - # The body of the request that triggered the vulnerability. - # @!attribute [rw] description - # @return [::String] - # The description of the vulnerability. - # @!attribute [rw] reproduction_url - # @return [::String] - # The URL containing human-readable payload that user can leverage to - # reproduce the vulnerability. - # @!attribute [rw] frame_url - # @return [::String] - # If the vulnerability was originated from nested IFrame, the immediate - # parent IFrame is reported. - # @!attribute [rw] final_url - # @return [::String] - # The URL where the browser lands when the vulnerability is detected. - # @!attribute [rw] tracking_id - # @return [::String] - # The tracking ID uniquely identifies a vulnerability instance across - # multiple ScanRuns. - # @!attribute [rw] form - # @return [::Google::Cloud::WebSecurityScanner::V1beta::Form] - # An addon containing information reported for a vulnerability with an HTML - # form, if any. - # @!attribute [rw] outdated_library - # @return [::Google::Cloud::WebSecurityScanner::V1beta::OutdatedLibrary] - # An addon containing information about outdated libraries. - # @!attribute [rw] violating_resource - # @return [::Google::Cloud::WebSecurityScanner::V1beta::ViolatingResource] - # An addon containing detailed information regarding any resource causing the - # vulnerability such as JavaScript sources, image, audio files, etc. - # @!attribute [rw] vulnerable_headers - # @return [::Google::Cloud::WebSecurityScanner::V1beta::VulnerableHeaders] - # An addon containing information about vulnerable or missing HTTP headers. - # @!attribute [rw] vulnerable_parameters - # @return [::Google::Cloud::WebSecurityScanner::V1beta::VulnerableParameters] - # An addon containing information about request parameters which were found - # to be vulnerable. - # @!attribute [rw] xss - # @return [::Google::Cloud::WebSecurityScanner::V1beta::Xss] - # An addon containing information reported for an XSS, if any. - class Finding - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-web_security_scanner-v1beta/proto_docs/google/cloud/websecurityscanner/v1beta/finding_addon.rb b/owl-bot-staging/google-cloud-web_security_scanner-v1beta/proto_docs/google/cloud/websecurityscanner/v1beta/finding_addon.rb deleted file mode 100644 index 950dc9db788a..000000000000 --- a/owl-bot-staging/google-cloud-web_security_scanner-v1beta/proto_docs/google/cloud/websecurityscanner/v1beta/finding_addon.rb +++ /dev/null @@ -1,111 +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 WebSecurityScanner - module V1beta - # ! Information about a vulnerability with an HTML. - # @!attribute [rw] action_uri - # @return [::String] - # ! The URI where to send the form when it's submitted. - # @!attribute [rw] fields - # @return [::Array<::String>] - # ! The names of form fields related to the vulnerability. - class Form - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Information reported for an outdated library. - # @!attribute [rw] library_name - # @return [::String] - # The name of the outdated library. - # @!attribute [rw] version - # @return [::String] - # The version number. - # @!attribute [rw] learn_more_urls - # @return [::Array<::String>] - # URLs to learn more information about the vulnerabilities in the library. - class OutdatedLibrary - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Information regarding any resource causing the vulnerability such - # as JavaScript sources, image, audio files, etc. - # @!attribute [rw] content_type - # @return [::String] - # The MIME type of this resource. - # @!attribute [rw] resource_url - # @return [::String] - # URL of this violating resource. - class ViolatingResource - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Information about vulnerable request parameters. - # @!attribute [rw] parameter_names - # @return [::Array<::String>] - # The vulnerable parameter names. - class VulnerableParameters - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Information about vulnerable or missing HTTP Headers. - # @!attribute [rw] headers - # @return [::Array<::Google::Cloud::WebSecurityScanner::V1beta::VulnerableHeaders::Header>] - # List of vulnerable headers. - # @!attribute [rw] missing_headers - # @return [::Array<::Google::Cloud::WebSecurityScanner::V1beta::VulnerableHeaders::Header>] - # List of missing headers. - class VulnerableHeaders - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Describes a HTTP Header. - # @!attribute [rw] name - # @return [::String] - # Header name. - # @!attribute [rw] value - # @return [::String] - # Header value. - class Header - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Information reported for an XSS. - # @!attribute [rw] stack_traces - # @return [::Array<::String>] - # Stack traces leading to the point where the XSS occurred. - # @!attribute [rw] error_message - # @return [::String] - # An error message generated by a javascript breakage. - class Xss - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-web_security_scanner-v1beta/proto_docs/google/cloud/websecurityscanner/v1beta/finding_type_stats.rb b/owl-bot-staging/google-cloud-web_security_scanner-v1beta/proto_docs/google/cloud/websecurityscanner/v1beta/finding_type_stats.rb deleted file mode 100644 index a04437f47106..000000000000 --- a/owl-bot-staging/google-cloud-web_security_scanner-v1beta/proto_docs/google/cloud/websecurityscanner/v1beta/finding_type_stats.rb +++ /dev/null @@ -1,39 +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 WebSecurityScanner - module V1beta - # A FindingTypeStats resource represents stats regarding a specific FindingType - # of Findings under a given ScanRun. - # @!attribute [rw] finding_type - # @return [::String] - # The finding type associated with the stats. - # @!attribute [rw] finding_count - # @return [::Integer] - # The count of findings belonging to this finding type. - class FindingTypeStats - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-web_security_scanner-v1beta/proto_docs/google/cloud/websecurityscanner/v1beta/scan_config.rb b/owl-bot-staging/google-cloud-web_security_scanner-v1beta/proto_docs/google/cloud/websecurityscanner/v1beta/scan_config.rb deleted file mode 100644 index b814049f15c4..000000000000 --- a/owl-bot-staging/google-cloud-web_security_scanner-v1beta/proto_docs/google/cloud/websecurityscanner/v1beta/scan_config.rb +++ /dev/null @@ -1,192 +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 WebSecurityScanner - module V1beta - # A ScanConfig resource contains the configurations to launch a scan. - # @!attribute [rw] name - # @return [::String] - # The resource name of the ScanConfig. The name follows the format of - # 'projects/\\{projectId}/scanConfigs/\\{scanConfigId}'. The ScanConfig IDs are - # generated by the system. - # @!attribute [rw] display_name - # @return [::String] - # Required. The user provided display name of the ScanConfig. - # @!attribute [rw] max_qps - # @return [::Integer] - # The maximum QPS during scanning. A valid value ranges from 5 to 20 - # inclusively. If the field is unspecified or its value is set 0, server will - # default to 15. Other values outside of [5, 20] range will be rejected with - # INVALID_ARGUMENT error. - # @!attribute [rw] starting_urls - # @return [::Array<::String>] - # Required. The starting URLs from which the scanner finds site pages. - # @!attribute [rw] authentication - # @return [::Google::Cloud::WebSecurityScanner::V1beta::ScanConfig::Authentication] - # The authentication configuration. If specified, service will use the - # authentication configuration during scanning. - # @!attribute [rw] user_agent - # @return [::Google::Cloud::WebSecurityScanner::V1beta::ScanConfig::UserAgent] - # The user agent used during scanning. - # @!attribute [rw] blacklist_patterns - # @return [::Array<::String>] - # The blacklist URL patterns as described in - # https://cloud.google.com/security-scanner/docs/excluded-urls - # @!attribute [rw] schedule - # @return [::Google::Cloud::WebSecurityScanner::V1beta::ScanConfig::Schedule] - # The schedule of the ScanConfig. - # @!attribute [rw] target_platforms - # @return [::Array<::Google::Cloud::WebSecurityScanner::V1beta::ScanConfig::TargetPlatform>] - # Set of Cloud Platforms targeted by the scan. If empty, APP_ENGINE will be - # used as a default. - # @!attribute [rw] export_to_security_command_center - # @return [::Google::Cloud::WebSecurityScanner::V1beta::ScanConfig::ExportToSecurityCommandCenter] - # Controls export of scan configurations and results to Cloud Security - # Command Center. - # @!attribute [rw] latest_run - # @return [::Google::Cloud::WebSecurityScanner::V1beta::ScanRun] - # Latest ScanRun if available. - # @!attribute [rw] risk_level - # @return [::Google::Cloud::WebSecurityScanner::V1beta::ScanConfig::RiskLevel] - # The risk level selected for the scan - class ScanConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Scan authentication configuration. - # @!attribute [rw] google_account - # @return [::Google::Cloud::WebSecurityScanner::V1beta::ScanConfig::Authentication::GoogleAccount] - # Authentication using a Google account. - # - # Note: The following fields are mutually exclusive: `google_account`, `custom_account`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] custom_account - # @return [::Google::Cloud::WebSecurityScanner::V1beta::ScanConfig::Authentication::CustomAccount] - # Authentication using a custom account. - # - # Note: The following fields are mutually exclusive: `custom_account`, `google_account`. If a field in that set is populated, all other fields in the set will automatically be cleared. - class Authentication - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Describes authentication configuration that uses a Google account. - # @!attribute [rw] username - # @return [::String] - # Required. The user name of the Google account. - # @!attribute [rw] password - # @return [::String] - # Required. Input only. The password of the Google account. The credential is stored encrypted - # and not returned in any response nor included in audit logs. - class GoogleAccount - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Describes authentication configuration that uses a custom account. - # @!attribute [rw] username - # @return [::String] - # Required. The user name of the custom account. - # @!attribute [rw] password - # @return [::String] - # Required. Input only. The password of the custom account. The credential is stored encrypted - # and not returned in any response nor included in audit logs. - # @!attribute [rw] login_url - # @return [::String] - # Required. The login form URL of the website. - class CustomAccount - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Scan schedule configuration. - # @!attribute [rw] schedule_time - # @return [::Google::Protobuf::Timestamp] - # A timestamp indicates when the next run will be scheduled. The value is - # refreshed by the server after each run. If unspecified, it will default - # to current server time, which means the scan will be scheduled to start - # immediately. - # @!attribute [rw] interval_duration_days - # @return [::Integer] - # Required. The duration of time between executions in days. - class Schedule - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Type of user agents used for scanning. - module UserAgent - # The user agent is unknown. Service will default to CHROME_LINUX. - USER_AGENT_UNSPECIFIED = 0 - - # Chrome on Linux. This is the service default if unspecified. - CHROME_LINUX = 1 - - # Chrome on Android. - CHROME_ANDROID = 2 - - # Safari on IPhone. - SAFARI_IPHONE = 3 - end - - # Cloud platforms supported by Cloud Web Security Scanner. - module TargetPlatform - # The target platform is unknown. Requests with this enum value will be - # rejected with INVALID_ARGUMENT error. - TARGET_PLATFORM_UNSPECIFIED = 0 - - # Google App Engine service. - APP_ENGINE = 1 - - # Google Compute Engine service. - COMPUTE = 2 - end - - # Scan risk levels supported by Cloud Web Security Scanner. LOW impact - # scanning will minimize requests with the potential to modify data. To - # achieve the maximum scan coverage, NORMAL risk level is recommended. - module RiskLevel - # Use default, which is NORMAL. - RISK_LEVEL_UNSPECIFIED = 0 - - # Normal scanning (Recommended) - NORMAL = 1 - - # Lower impact scanning - LOW = 2 - end - - # Controls export of scan configurations and results to Cloud Security - # Command Center. - module ExportToSecurityCommandCenter - # Use default, which is ENABLED. - EXPORT_TO_SECURITY_COMMAND_CENTER_UNSPECIFIED = 0 - - # Export results of this scan to Cloud Security Command Center. - ENABLED = 1 - - # Do not export results of this scan to Cloud Security Command Center. - DISABLED = 2 - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-web_security_scanner-v1beta/proto_docs/google/cloud/websecurityscanner/v1beta/scan_config_error.rb b/owl-bot-staging/google-cloud-web_security_scanner-v1beta/proto_docs/google/cloud/websecurityscanner/v1beta/scan_config_error.rb deleted file mode 100644 index 35cbd2e7b0f4..000000000000 --- a/owl-bot-staging/google-cloud-web_security_scanner-v1beta/proto_docs/google/cloud/websecurityscanner/v1beta/scan_config_error.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 Cloud - module WebSecurityScanner - module V1beta - # Defines a custom error message used by CreateScanConfig and UpdateScanConfig - # APIs when scan configuration validation fails. It is also reported as part of - # a ScanRunErrorTrace message if scan validation fails due to a scan - # configuration error. - # @!attribute [rw] code - # @return [::Google::Cloud::WebSecurityScanner::V1beta::ScanConfigError::Code] - # Indicates the reason code for a configuration failure. - # @!attribute [rw] field_name - # @return [::String] - # Indicates the full name of the ScanConfig field that triggers this error, - # for example "scan_config.max_qps". This field is provided for - # troubleshooting purposes only and its actual value can change in the - # future. - class ScanConfigError - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Output only. - # Defines an error reason code. - # Next id: 44 - module Code - # There is no error. - CODE_UNSPECIFIED = 0 - - # There is no error. - OK = 0 - - # Indicates an internal server error. - # Please DO NOT USE THIS ERROR CODE unless the root cause is truly unknown. - INTERNAL_ERROR = 1 - - # One of the seed URLs is an App Engine URL but we cannot validate the scan - # settings due to an App Engine API backend error. - APPENGINE_API_BACKEND_ERROR = 2 - - # One of the seed URLs is an App Engine URL but we cannot access the - # App Engine API to validate scan settings. - APPENGINE_API_NOT_ACCESSIBLE = 3 - - # One of the seed URLs is an App Engine URL but the Default Host of the - # App Engine is not set. - APPENGINE_DEFAULT_HOST_MISSING = 4 - - # Google corporate accounts can not be used for scanning. - CANNOT_USE_GOOGLE_COM_ACCOUNT = 6 - - # The account of the scan creator can not be used for scanning. - CANNOT_USE_OWNER_ACCOUNT = 7 - - # This scan targets Compute Engine, but we cannot validate scan settings - # due to a Compute Engine API backend error. - COMPUTE_API_BACKEND_ERROR = 8 - - # This scan targets Compute Engine, but we cannot access the Compute Engine - # API to validate the scan settings. - COMPUTE_API_NOT_ACCESSIBLE = 9 - - # The Custom Login URL does not belong to the current project. - CUSTOM_LOGIN_URL_DOES_NOT_BELONG_TO_CURRENT_PROJECT = 10 - - # The Custom Login URL is malformed (can not be parsed). - CUSTOM_LOGIN_URL_MALFORMED = 11 - - # The Custom Login URL is mapped to a non-routable IP address in DNS. - CUSTOM_LOGIN_URL_MAPPED_TO_NON_ROUTABLE_ADDRESS = 12 - - # The Custom Login URL is mapped to an IP address which is not reserved for - # the current project. - CUSTOM_LOGIN_URL_MAPPED_TO_UNRESERVED_ADDRESS = 13 - - # The Custom Login URL has a non-routable IP address. - CUSTOM_LOGIN_URL_HAS_NON_ROUTABLE_IP_ADDRESS = 14 - - # The Custom Login URL has an IP address which is not reserved for the - # current project. - CUSTOM_LOGIN_URL_HAS_UNRESERVED_IP_ADDRESS = 15 - - # Another scan with the same name (case-sensitive) already exists. - DUPLICATE_SCAN_NAME = 16 - - # A field is set to an invalid value. - INVALID_FIELD_VALUE = 18 - - # There was an error trying to authenticate to the scan target. - FAILED_TO_AUTHENTICATE_TO_TARGET = 19 - - # Finding type value is not specified in the list findings request. - FINDING_TYPE_UNSPECIFIED = 20 - - # Scan targets Compute Engine, yet current project was not whitelisted for - # Google Compute Engine Scanning Alpha access. - FORBIDDEN_TO_SCAN_COMPUTE = 21 - - # User tries to update managed scan - FORBIDDEN_UPDATE_TO_MANAGED_SCAN = 43 - - # The supplied filter is malformed. For example, it can not be parsed, does - # not have a filter type in expression, or the same filter type appears - # more than once. - MALFORMED_FILTER = 22 - - # The supplied resource name is malformed (can not be parsed). - MALFORMED_RESOURCE_NAME = 23 - - # The current project is not in an active state. - PROJECT_INACTIVE = 24 - - # A required field is not set. - REQUIRED_FIELD = 25 - - # Project id, scanconfig id, scanrun id, or finding id are not consistent - # with each other in resource name. - RESOURCE_NAME_INCONSISTENT = 26 - - # The scan being requested to start is already running. - SCAN_ALREADY_RUNNING = 27 - - # The scan that was requested to be stopped is not running. - SCAN_NOT_RUNNING = 28 - - # One of the seed URLs does not belong to the current project. - SEED_URL_DOES_NOT_BELONG_TO_CURRENT_PROJECT = 29 - - # One of the seed URLs is malformed (can not be parsed). - SEED_URL_MALFORMED = 30 - - # One of the seed URLs is mapped to a non-routable IP address in DNS. - SEED_URL_MAPPED_TO_NON_ROUTABLE_ADDRESS = 31 - - # One of the seed URLs is mapped to an IP address which is not reserved - # for the current project. - SEED_URL_MAPPED_TO_UNRESERVED_ADDRESS = 32 - - # One of the seed URLs has on-routable IP address. - SEED_URL_HAS_NON_ROUTABLE_IP_ADDRESS = 33 - - # One of the seed URLs has an IP address that is not reserved - # for the current project. - SEED_URL_HAS_UNRESERVED_IP_ADDRESS = 35 - - # The Cloud Security Scanner service account is not configured under the - # project. - SERVICE_ACCOUNT_NOT_CONFIGURED = 36 - - # A project has reached the maximum number of scans. - TOO_MANY_SCANS = 37 - - # Resolving the details of the current project fails. - UNABLE_TO_RESOLVE_PROJECT_INFO = 38 - - # One or more blacklist patterns were in the wrong format. - UNSUPPORTED_BLACKLIST_PATTERN_FORMAT = 39 - - # The supplied filter is not supported. - UNSUPPORTED_FILTER = 40 - - # The supplied finding type is not supported. For example, we do not - # provide findings of the given finding type. - UNSUPPORTED_FINDING_TYPE = 41 - - # The URL scheme of one or more of the supplied URLs is not supported. - UNSUPPORTED_URL_SCHEME = 42 - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-web_security_scanner-v1beta/proto_docs/google/cloud/websecurityscanner/v1beta/scan_run.rb b/owl-bot-staging/google-cloud-web_security_scanner-v1beta/proto_docs/google/cloud/websecurityscanner/v1beta/scan_run.rb deleted file mode 100644 index 2ee0a0f3dc7b..000000000000 --- a/owl-bot-staging/google-cloud-web_security_scanner-v1beta/proto_docs/google/cloud/websecurityscanner/v1beta/scan_run.rb +++ /dev/null @@ -1,110 +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 WebSecurityScanner - module V1beta - # A ScanRun is a output-only resource representing an actual run of the scan. - # Next id: 12 - # @!attribute [rw] name - # @return [::String] - # The resource name of the ScanRun. The name follows the format of - # 'projects/\\{projectId}/scanConfigs/\\{scanConfigId}/scanRuns/\\{scanRunId}'. - # The ScanRun IDs are generated by the system. - # @!attribute [rw] execution_state - # @return [::Google::Cloud::WebSecurityScanner::V1beta::ScanRun::ExecutionState] - # The execution state of the ScanRun. - # @!attribute [rw] result_state - # @return [::Google::Cloud::WebSecurityScanner::V1beta::ScanRun::ResultState] - # The result state of the ScanRun. This field is only available after the - # execution state reaches "FINISHED". - # @!attribute [rw] start_time - # @return [::Google::Protobuf::Timestamp] - # The time at which the ScanRun started. - # @!attribute [rw] end_time - # @return [::Google::Protobuf::Timestamp] - # The time at which the ScanRun reached termination state - that the ScanRun - # is either finished or stopped by user. - # @!attribute [rw] urls_crawled_count - # @return [::Integer] - # The number of URLs crawled during this ScanRun. If the scan is in progress, - # the value represents the number of URLs crawled up to now. - # @!attribute [rw] urls_tested_count - # @return [::Integer] - # The number of URLs tested during this ScanRun. If the scan is in progress, - # the value represents the number of URLs tested up to now. The number of - # URLs tested is usually larger than the number URLS crawled because - # typically a crawled URL is tested with multiple test payloads. - # @!attribute [rw] has_vulnerabilities - # @return [::Boolean] - # Whether the scan run has found any vulnerabilities. - # @!attribute [rw] progress_percent - # @return [::Integer] - # The percentage of total completion ranging from 0 to 100. - # If the scan is in queue, the value is 0. - # If the scan is running, the value ranges from 0 to 100. - # If the scan is finished, the value is 100. - # @!attribute [rw] error_trace - # @return [::Google::Cloud::WebSecurityScanner::V1beta::ScanRunErrorTrace] - # If result_state is an ERROR, this field provides the primary reason for - # scan's termination and more details, if such are available. - # @!attribute [rw] warning_traces - # @return [::Array<::Google::Cloud::WebSecurityScanner::V1beta::ScanRunWarningTrace>] - # A list of warnings, if such are encountered during this scan run. - class ScanRun - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Types of ScanRun execution state. - module ExecutionState - # Represents an invalid state caused by internal server error. This value - # should never be returned. - EXECUTION_STATE_UNSPECIFIED = 0 - - # The scan is waiting in the queue. - QUEUED = 1 - - # The scan is in progress. - SCANNING = 2 - - # The scan is either finished or stopped by user. - FINISHED = 3 - end - - # Types of ScanRun result state. - module ResultState - # Default value. This value is returned when the ScanRun is not yet - # finished. - RESULT_STATE_UNSPECIFIED = 0 - - # The scan finished without errors. - SUCCESS = 1 - - # The scan finished with errors. - ERROR = 2 - - # The scan was terminated by user. - KILLED = 3 - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-web_security_scanner-v1beta/proto_docs/google/cloud/websecurityscanner/v1beta/scan_run_error_trace.rb b/owl-bot-staging/google-cloud-web_security_scanner-v1beta/proto_docs/google/cloud/websecurityscanner/v1beta/scan_run_error_trace.rb deleted file mode 100644 index 9a4290f473e2..000000000000 --- a/owl-bot-staging/google-cloud-web_security_scanner-v1beta/proto_docs/google/cloud/websecurityscanner/v1beta/scan_run_error_trace.rb +++ /dev/null @@ -1,77 +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 WebSecurityScanner - module V1beta - # Output only. - # Defines an error trace message for a ScanRun. - # @!attribute [rw] code - # @return [::Google::Cloud::WebSecurityScanner::V1beta::ScanRunErrorTrace::Code] - # Indicates the error reason code. - # @!attribute [rw] scan_config_error - # @return [::Google::Cloud::WebSecurityScanner::V1beta::ScanConfigError] - # If the scan encounters SCAN_CONFIG_ISSUE error, this field has the error - # message encountered during scan configuration validation that is performed - # before each scan run. - # @!attribute [rw] most_common_http_error_code - # @return [::Integer] - # If the scan encounters TOO_MANY_HTTP_ERRORS, this field indicates the most - # common HTTP error code, if such is available. For example, if this code is - # 404, the scan has encountered too many NOT_FOUND responses. - class ScanRunErrorTrace - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Output only. - # Defines an error reason code. - # Next id: 7 - module Code - # Default value is never used. - CODE_UNSPECIFIED = 0 - - # Indicates that the scan run failed due to an internal server error. - INTERNAL_ERROR = 1 - - # Indicates a scan configuration error, usually due to outdated ScanConfig - # settings, such as starting_urls or the DNS configuration. - SCAN_CONFIG_ISSUE = 2 - - # Indicates an authentication error, usually due to outdated ScanConfig - # authentication settings. - AUTHENTICATION_CONFIG_ISSUE = 3 - - # Indicates a scan operation timeout, usually caused by a very large site. - TIMED_OUT_WHILE_SCANNING = 4 - - # Indicates that a scan encountered excessive redirects, either to - # authentication or some other page outside of the scan scope. - TOO_MANY_REDIRECTS = 5 - - # Indicates that a scan encountered numerous errors from the web site - # pages. When available, most_common_http_error_code field indicates the - # most common HTTP error code encountered during the scan. - TOO_MANY_HTTP_ERRORS = 6 - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-web_security_scanner-v1beta/proto_docs/google/cloud/websecurityscanner/v1beta/scan_run_warning_trace.rb b/owl-bot-staging/google-cloud-web_security_scanner-v1beta/proto_docs/google/cloud/websecurityscanner/v1beta/scan_run_warning_trace.rb deleted file mode 100644 index 14ef8134f765..000000000000 --- a/owl-bot-staging/google-cloud-web_security_scanner-v1beta/proto_docs/google/cloud/websecurityscanner/v1beta/scan_run_warning_trace.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! - - -module Google - module Cloud - module WebSecurityScanner - module V1beta - # Output only. - # Defines a warning trace message for ScanRun. Warning traces provide customers - # with useful information that helps make the scanning process more effective. - # @!attribute [rw] code - # @return [::Google::Cloud::WebSecurityScanner::V1beta::ScanRunWarningTrace::Code] - # Indicates the warning code. - class ScanRunWarningTrace - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Output only. - # Defines a warning message code. - # Next id: 6 - module Code - # Default value is never used. - CODE_UNSPECIFIED = 0 - - # Indicates that a scan discovered an unexpectedly low number of URLs. This - # is sometimes caused by complex navigation features or by using a single - # URL for numerous pages. - INSUFFICIENT_CRAWL_RESULTS = 1 - - # Indicates that a scan discovered too many URLs to test, or excessive - # redundant URLs. - TOO_MANY_CRAWL_RESULTS = 2 - - # Indicates that too many tests have been generated for the scan. Customer - # should try reducing the number of starting URLs, increasing the QPS rate, - # or narrowing down the scope of the scan using the excluded patterns. - TOO_MANY_FUZZ_TASKS = 3 - - # Indicates that a scan is blocked by IAP. - BLOCKED_BY_IAP = 4 - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-web_security_scanner-v1beta/proto_docs/google/cloud/websecurityscanner/v1beta/web_security_scanner.rb b/owl-bot-staging/google-cloud-web_security_scanner-v1beta/proto_docs/google/cloud/websecurityscanner/v1beta/web_security_scanner.rb deleted file mode 100644 index 5c0a8825ce30..000000000000 --- a/owl-bot-staging/google-cloud-web_security_scanner-v1beta/proto_docs/google/cloud/websecurityscanner/v1beta/web_security_scanner.rb +++ /dev/null @@ -1,278 +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 WebSecurityScanner - module V1beta - # Request for the `CreateScanConfig` method. - # @!attribute [rw] parent - # @return [::String] - # Required. The parent resource name where the scan is created, which should be a - # project resource name in the format 'projects/\\{projectId}'. - # @!attribute [rw] scan_config - # @return [::Google::Cloud::WebSecurityScanner::V1beta::ScanConfig] - # Required. The ScanConfig to be created. - class CreateScanConfigRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request for the `DeleteScanConfig` method. - # @!attribute [rw] name - # @return [::String] - # Required. The resource name of the ScanConfig to be deleted. The name follows the - # format of 'projects/\\{projectId}/scanConfigs/\\{scanConfigId}'. - class DeleteScanConfigRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request for the `GetScanConfig` method. - # @!attribute [rw] name - # @return [::String] - # Required. The resource name of the ScanConfig to be returned. The name follows the - # format of 'projects/\\{projectId}/scanConfigs/\\{scanConfigId}'. - class GetScanConfigRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request for the `ListScanConfigs` method. - # @!attribute [rw] parent - # @return [::String] - # Required. The parent resource name, which should be a project resource name in the - # format 'projects/\\{projectId}'. - # @!attribute [rw] page_token - # @return [::String] - # A token identifying a page of results to be returned. This should be a - # `next_page_token` value returned from a previous List request. - # If unspecified, the first page of results is returned. - # @!attribute [rw] page_size - # @return [::Integer] - # The maximum number of ScanConfigs to return, can be limited by server. - # If not specified or not positive, the implementation will select a - # reasonable value. - class ListScanConfigsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request for the `UpdateScanConfigRequest` method. - # @!attribute [rw] scan_config - # @return [::Google::Cloud::WebSecurityScanner::V1beta::ScanConfig] - # Required. The ScanConfig to be updated. The name field must be set to identify the - # resource to be updated. The values of fields not covered by the mask - # will be ignored. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # Required. The update mask applies to the resource. For the `FieldMask` definition, - # see - # https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask - class UpdateScanConfigRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response for the `ListScanConfigs` method. - # @!attribute [rw] scan_configs - # @return [::Array<::Google::Cloud::WebSecurityScanner::V1beta::ScanConfig>] - # The list of ScanConfigs returned. - # @!attribute [rw] next_page_token - # @return [::String] - # Token to retrieve the next page of results, or empty if there are no - # more results in the list. - class ListScanConfigsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request for the `StartScanRun` method. - # @!attribute [rw] name - # @return [::String] - # Required. The resource name of the ScanConfig to be used. The name follows the - # format of 'projects/\\{projectId}/scanConfigs/\\{scanConfigId}'. - class StartScanRunRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request for the `GetScanRun` method. - # @!attribute [rw] name - # @return [::String] - # Required. The resource name of the ScanRun to be returned. The name follows the - # format of - # 'projects/\\{projectId}/scanConfigs/\\{scanConfigId}/scanRuns/\\{scanRunId}'. - class GetScanRunRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request for the `ListScanRuns` method. - # @!attribute [rw] parent - # @return [::String] - # Required. The parent resource name, which should be a scan resource name in the - # format 'projects/\\{projectId}/scanConfigs/\\{scanConfigId}'. - # @!attribute [rw] page_token - # @return [::String] - # A token identifying a page of results to be returned. This should be a - # `next_page_token` value returned from a previous List request. - # If unspecified, the first page of results is returned. - # @!attribute [rw] page_size - # @return [::Integer] - # The maximum number of ScanRuns to return, can be limited by server. - # If not specified or not positive, the implementation will select a - # reasonable value. - class ListScanRunsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response for the `ListScanRuns` method. - # @!attribute [rw] scan_runs - # @return [::Array<::Google::Cloud::WebSecurityScanner::V1beta::ScanRun>] - # The list of ScanRuns returned. - # @!attribute [rw] next_page_token - # @return [::String] - # Token to retrieve the next page of results, or empty if there are no - # more results in the list. - class ListScanRunsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request for the `StopScanRun` method. - # @!attribute [rw] name - # @return [::String] - # Required. The resource name of the ScanRun to be stopped. The name follows the - # format of - # 'projects/\\{projectId}/scanConfigs/\\{scanConfigId}/scanRuns/\\{scanRunId}'. - class StopScanRunRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request for the `ListCrawledUrls` method. - # @!attribute [rw] parent - # @return [::String] - # Required. The parent resource name, which should be a scan run resource name in the - # format - # 'projects/\\{projectId}/scanConfigs/\\{scanConfigId}/scanRuns/\\{scanRunId}'. - # @!attribute [rw] page_token - # @return [::String] - # A token identifying a page of results to be returned. This should be a - # `next_page_token` value returned from a previous List request. - # If unspecified, the first page of results is returned. - # @!attribute [rw] page_size - # @return [::Integer] - # The maximum number of CrawledUrls to return, can be limited by server. - # If not specified or not positive, the implementation will select a - # reasonable value. - class ListCrawledUrlsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response for the `ListCrawledUrls` method. - # @!attribute [rw] crawled_urls - # @return [::Array<::Google::Cloud::WebSecurityScanner::V1beta::CrawledUrl>] - # The list of CrawledUrls returned. - # @!attribute [rw] next_page_token - # @return [::String] - # Token to retrieve the next page of results, or empty if there are no - # more results in the list. - class ListCrawledUrlsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request for the `GetFinding` method. - # @!attribute [rw] name - # @return [::String] - # Required. The resource name of the Finding to be returned. The name follows the - # format of - # 'projects/\\{projectId}/scanConfigs/\\{scanConfigId}/scanRuns/\\{scanRunId}/findings/\\{findingId}'. - class GetFindingRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request for the `ListFindings` method. - # @!attribute [rw] parent - # @return [::String] - # Required. The parent resource name, which should be a scan run resource name in the - # format - # 'projects/\\{projectId}/scanConfigs/\\{scanConfigId}/scanRuns/\\{scanRunId}'. - # @!attribute [rw] filter - # @return [::String] - # Required. The filter expression. The expression must be in the format: - # . - # Supported field: 'finding_type'. - # Supported operator: '='. - # @!attribute [rw] page_token - # @return [::String] - # A token identifying a page of results to be returned. This should be a - # `next_page_token` value returned from a previous List request. - # If unspecified, the first page of results is returned. - # @!attribute [rw] page_size - # @return [::Integer] - # The maximum number of Findings to return, can be limited by server. - # If not specified or not positive, the implementation will select a - # reasonable value. - class ListFindingsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response for the `ListFindings` method. - # @!attribute [rw] findings - # @return [::Array<::Google::Cloud::WebSecurityScanner::V1beta::Finding>] - # The list of Findings returned. - # @!attribute [rw] next_page_token - # @return [::String] - # Token to retrieve the next page of results, or empty if there are no - # more results in the list. - class ListFindingsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request for the `ListFindingTypeStats` method. - # @!attribute [rw] parent - # @return [::String] - # Required. The parent resource name, which should be a scan run resource name in the - # format - # 'projects/\\{projectId}/scanConfigs/\\{scanConfigId}/scanRuns/\\{scanRunId}'. - class ListFindingTypeStatsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response for the `ListFindingTypeStats` method. - # @!attribute [rw] finding_type_stats - # @return [::Array<::Google::Cloud::WebSecurityScanner::V1beta::FindingTypeStats>] - # The list of FindingTypeStats returned. - class ListFindingTypeStatsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-web_security_scanner-v1beta/proto_docs/google/protobuf/duration.rb b/owl-bot-staging/google-cloud-web_security_scanner-v1beta/proto_docs/google/protobuf/duration.rb deleted file mode 100644 index ea59f1f91daf..000000000000 --- a/owl-bot-staging/google-cloud-web_security_scanner-v1beta/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-web_security_scanner-v1beta/proto_docs/google/protobuf/empty.rb b/owl-bot-staging/google-cloud-web_security_scanner-v1beta/proto_docs/google/protobuf/empty.rb deleted file mode 100644 index 83e4481834a6..000000000000 --- a/owl-bot-staging/google-cloud-web_security_scanner-v1beta/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-web_security_scanner-v1beta/proto_docs/google/protobuf/field_mask.rb b/owl-bot-staging/google-cloud-web_security_scanner-v1beta/proto_docs/google/protobuf/field_mask.rb deleted file mode 100644 index 7f3ffc78601a..000000000000 --- a/owl-bot-staging/google-cloud-web_security_scanner-v1beta/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-web_security_scanner-v1beta/proto_docs/google/protobuf/timestamp.rb b/owl-bot-staging/google-cloud-web_security_scanner-v1beta/proto_docs/google/protobuf/timestamp.rb deleted file mode 100644 index 74352be9c58c..000000000000 --- a/owl-bot-staging/google-cloud-web_security_scanner-v1beta/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-web_security_scanner-v1beta/snippets/Gemfile b/owl-bot-staging/google-cloud-web_security_scanner-v1beta/snippets/Gemfile deleted file mode 100644 index 2cf622627fe6..000000000000 --- a/owl-bot-staging/google-cloud-web_security_scanner-v1beta/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-web_security_scanner-v1beta", path: "../" -else - gem "google-cloud-web_security_scanner-v1beta" -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-web_security_scanner-v1beta/snippets/snippet_metadata_google.cloud.websecurityscanner.v1beta.json b/owl-bot-staging/google-cloud-web_security_scanner-v1beta/snippets/snippet_metadata_google.cloud.websecurityscanner.v1beta.json deleted file mode 100644 index 3f5379593bc8..000000000000 --- a/owl-bot-staging/google-cloud-web_security_scanner-v1beta/snippets/snippet_metadata_google.cloud.websecurityscanner.v1beta.json +++ /dev/null @@ -1,535 +0,0 @@ -{ - "client_library": { - "name": "google-cloud-web_security_scanner-v1beta", - "version": "", - "language": "RUBY", - "apis": [ - { - "id": "google.cloud.websecurityscanner.v1beta", - "version": "v1beta" - } - ] - }, - "snippets": [ - { - "region_tag": "websecurityscanner_v1beta_generated_WebSecurityScanner_CreateScanConfig_sync", - "title": "Snippet for the create_scan_config call in the WebSecurityScanner service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Client#create_scan_config.", - "file": "web_security_scanner/create_scan_config.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_scan_config", - "full_name": "::Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Client#create_scan_config", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::WebSecurityScanner::V1beta::CreateScanConfigRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::WebSecurityScanner::V1beta::ScanConfig", - "client": { - "short_name": "WebSecurityScanner::Client", - "full_name": "::Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Client" - }, - "method": { - "short_name": "CreateScanConfig", - "full_name": "google.cloud.websecurityscanner.v1beta.WebSecurityScanner.CreateScanConfig", - "service": { - "short_name": "WebSecurityScanner", - "full_name": "google.cloud.websecurityscanner.v1beta.WebSecurityScanner" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "websecurityscanner_v1beta_generated_WebSecurityScanner_DeleteScanConfig_sync", - "title": "Snippet for the delete_scan_config call in the WebSecurityScanner service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Client#delete_scan_config.", - "file": "web_security_scanner/delete_scan_config.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_scan_config", - "full_name": "::Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Client#delete_scan_config", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::WebSecurityScanner::V1beta::DeleteScanConfigRequest", - "name": "request" - } - ], - "result_type": "::Google::Protobuf::Empty", - "client": { - "short_name": "WebSecurityScanner::Client", - "full_name": "::Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Client" - }, - "method": { - "short_name": "DeleteScanConfig", - "full_name": "google.cloud.websecurityscanner.v1beta.WebSecurityScanner.DeleteScanConfig", - "service": { - "short_name": "WebSecurityScanner", - "full_name": "google.cloud.websecurityscanner.v1beta.WebSecurityScanner" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "websecurityscanner_v1beta_generated_WebSecurityScanner_GetScanConfig_sync", - "title": "Snippet for the get_scan_config call in the WebSecurityScanner service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Client#get_scan_config.", - "file": "web_security_scanner/get_scan_config.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_scan_config", - "full_name": "::Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Client#get_scan_config", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::WebSecurityScanner::V1beta::GetScanConfigRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::WebSecurityScanner::V1beta::ScanConfig", - "client": { - "short_name": "WebSecurityScanner::Client", - "full_name": "::Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Client" - }, - "method": { - "short_name": "GetScanConfig", - "full_name": "google.cloud.websecurityscanner.v1beta.WebSecurityScanner.GetScanConfig", - "service": { - "short_name": "WebSecurityScanner", - "full_name": "google.cloud.websecurityscanner.v1beta.WebSecurityScanner" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "websecurityscanner_v1beta_generated_WebSecurityScanner_ListScanConfigs_sync", - "title": "Snippet for the list_scan_configs call in the WebSecurityScanner service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Client#list_scan_configs.", - "file": "web_security_scanner/list_scan_configs.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_scan_configs", - "full_name": "::Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Client#list_scan_configs", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::WebSecurityScanner::V1beta::ListScanConfigsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::WebSecurityScanner::V1beta::ListScanConfigsResponse", - "client": { - "short_name": "WebSecurityScanner::Client", - "full_name": "::Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Client" - }, - "method": { - "short_name": "ListScanConfigs", - "full_name": "google.cloud.websecurityscanner.v1beta.WebSecurityScanner.ListScanConfigs", - "service": { - "short_name": "WebSecurityScanner", - "full_name": "google.cloud.websecurityscanner.v1beta.WebSecurityScanner" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "websecurityscanner_v1beta_generated_WebSecurityScanner_UpdateScanConfig_sync", - "title": "Snippet for the update_scan_config call in the WebSecurityScanner service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Client#update_scan_config.", - "file": "web_security_scanner/update_scan_config.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_scan_config", - "full_name": "::Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Client#update_scan_config", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::WebSecurityScanner::V1beta::UpdateScanConfigRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::WebSecurityScanner::V1beta::ScanConfig", - "client": { - "short_name": "WebSecurityScanner::Client", - "full_name": "::Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Client" - }, - "method": { - "short_name": "UpdateScanConfig", - "full_name": "google.cloud.websecurityscanner.v1beta.WebSecurityScanner.UpdateScanConfig", - "service": { - "short_name": "WebSecurityScanner", - "full_name": "google.cloud.websecurityscanner.v1beta.WebSecurityScanner" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "websecurityscanner_v1beta_generated_WebSecurityScanner_StartScanRun_sync", - "title": "Snippet for the start_scan_run call in the WebSecurityScanner service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Client#start_scan_run.", - "file": "web_security_scanner/start_scan_run.rb", - "language": "RUBY", - "client_method": { - "short_name": "start_scan_run", - "full_name": "::Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Client#start_scan_run", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::WebSecurityScanner::V1beta::StartScanRunRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::WebSecurityScanner::V1beta::ScanRun", - "client": { - "short_name": "WebSecurityScanner::Client", - "full_name": "::Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Client" - }, - "method": { - "short_name": "StartScanRun", - "full_name": "google.cloud.websecurityscanner.v1beta.WebSecurityScanner.StartScanRun", - "service": { - "short_name": "WebSecurityScanner", - "full_name": "google.cloud.websecurityscanner.v1beta.WebSecurityScanner" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "websecurityscanner_v1beta_generated_WebSecurityScanner_GetScanRun_sync", - "title": "Snippet for the get_scan_run call in the WebSecurityScanner service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Client#get_scan_run.", - "file": "web_security_scanner/get_scan_run.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_scan_run", - "full_name": "::Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Client#get_scan_run", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::WebSecurityScanner::V1beta::GetScanRunRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::WebSecurityScanner::V1beta::ScanRun", - "client": { - "short_name": "WebSecurityScanner::Client", - "full_name": "::Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Client" - }, - "method": { - "short_name": "GetScanRun", - "full_name": "google.cloud.websecurityscanner.v1beta.WebSecurityScanner.GetScanRun", - "service": { - "short_name": "WebSecurityScanner", - "full_name": "google.cloud.websecurityscanner.v1beta.WebSecurityScanner" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "websecurityscanner_v1beta_generated_WebSecurityScanner_ListScanRuns_sync", - "title": "Snippet for the list_scan_runs call in the WebSecurityScanner service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Client#list_scan_runs.", - "file": "web_security_scanner/list_scan_runs.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_scan_runs", - "full_name": "::Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Client#list_scan_runs", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::WebSecurityScanner::V1beta::ListScanRunsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::WebSecurityScanner::V1beta::ListScanRunsResponse", - "client": { - "short_name": "WebSecurityScanner::Client", - "full_name": "::Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Client" - }, - "method": { - "short_name": "ListScanRuns", - "full_name": "google.cloud.websecurityscanner.v1beta.WebSecurityScanner.ListScanRuns", - "service": { - "short_name": "WebSecurityScanner", - "full_name": "google.cloud.websecurityscanner.v1beta.WebSecurityScanner" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "websecurityscanner_v1beta_generated_WebSecurityScanner_StopScanRun_sync", - "title": "Snippet for the stop_scan_run call in the WebSecurityScanner service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Client#stop_scan_run.", - "file": "web_security_scanner/stop_scan_run.rb", - "language": "RUBY", - "client_method": { - "short_name": "stop_scan_run", - "full_name": "::Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Client#stop_scan_run", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::WebSecurityScanner::V1beta::StopScanRunRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::WebSecurityScanner::V1beta::ScanRun", - "client": { - "short_name": "WebSecurityScanner::Client", - "full_name": "::Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Client" - }, - "method": { - "short_name": "StopScanRun", - "full_name": "google.cloud.websecurityscanner.v1beta.WebSecurityScanner.StopScanRun", - "service": { - "short_name": "WebSecurityScanner", - "full_name": "google.cloud.websecurityscanner.v1beta.WebSecurityScanner" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "websecurityscanner_v1beta_generated_WebSecurityScanner_ListCrawledUrls_sync", - "title": "Snippet for the list_crawled_urls call in the WebSecurityScanner service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Client#list_crawled_urls.", - "file": "web_security_scanner/list_crawled_urls.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_crawled_urls", - "full_name": "::Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Client#list_crawled_urls", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::WebSecurityScanner::V1beta::ListCrawledUrlsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::WebSecurityScanner::V1beta::ListCrawledUrlsResponse", - "client": { - "short_name": "WebSecurityScanner::Client", - "full_name": "::Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Client" - }, - "method": { - "short_name": "ListCrawledUrls", - "full_name": "google.cloud.websecurityscanner.v1beta.WebSecurityScanner.ListCrawledUrls", - "service": { - "short_name": "WebSecurityScanner", - "full_name": "google.cloud.websecurityscanner.v1beta.WebSecurityScanner" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "websecurityscanner_v1beta_generated_WebSecurityScanner_GetFinding_sync", - "title": "Snippet for the get_finding call in the WebSecurityScanner service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Client#get_finding.", - "file": "web_security_scanner/get_finding.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_finding", - "full_name": "::Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Client#get_finding", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::WebSecurityScanner::V1beta::GetFindingRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::WebSecurityScanner::V1beta::Finding", - "client": { - "short_name": "WebSecurityScanner::Client", - "full_name": "::Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Client" - }, - "method": { - "short_name": "GetFinding", - "full_name": "google.cloud.websecurityscanner.v1beta.WebSecurityScanner.GetFinding", - "service": { - "short_name": "WebSecurityScanner", - "full_name": "google.cloud.websecurityscanner.v1beta.WebSecurityScanner" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "websecurityscanner_v1beta_generated_WebSecurityScanner_ListFindings_sync", - "title": "Snippet for the list_findings call in the WebSecurityScanner service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Client#list_findings.", - "file": "web_security_scanner/list_findings.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_findings", - "full_name": "::Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Client#list_findings", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::WebSecurityScanner::V1beta::ListFindingsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::WebSecurityScanner::V1beta::ListFindingsResponse", - "client": { - "short_name": "WebSecurityScanner::Client", - "full_name": "::Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Client" - }, - "method": { - "short_name": "ListFindings", - "full_name": "google.cloud.websecurityscanner.v1beta.WebSecurityScanner.ListFindings", - "service": { - "short_name": "WebSecurityScanner", - "full_name": "google.cloud.websecurityscanner.v1beta.WebSecurityScanner" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "websecurityscanner_v1beta_generated_WebSecurityScanner_ListFindingTypeStats_sync", - "title": "Snippet for the list_finding_type_stats call in the WebSecurityScanner service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Client#list_finding_type_stats.", - "file": "web_security_scanner/list_finding_type_stats.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_finding_type_stats", - "full_name": "::Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Client#list_finding_type_stats", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::WebSecurityScanner::V1beta::ListFindingTypeStatsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::WebSecurityScanner::V1beta::ListFindingTypeStatsResponse", - "client": { - "short_name": "WebSecurityScanner::Client", - "full_name": "::Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Client" - }, - "method": { - "short_name": "ListFindingTypeStats", - "full_name": "google.cloud.websecurityscanner.v1beta.WebSecurityScanner.ListFindingTypeStats", - "service": { - "short_name": "WebSecurityScanner", - "full_name": "google.cloud.websecurityscanner.v1beta.WebSecurityScanner" - } - } - }, - "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-web_security_scanner-v1beta/snippets/web_security_scanner/create_scan_config.rb b/owl-bot-staging/google-cloud-web_security_scanner-v1beta/snippets/web_security_scanner/create_scan_config.rb deleted file mode 100644 index 72531ba34f7c..000000000000 --- a/owl-bot-staging/google-cloud-web_security_scanner-v1beta/snippets/web_security_scanner/create_scan_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 websecurityscanner_v1beta_generated_WebSecurityScanner_CreateScanConfig_sync] -require "google/cloud/web_security_scanner/v1beta" - -## -# Snippet for the create_scan_config call in the WebSecurityScanner 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::WebSecurityScanner::V1beta::WebSecurityScanner::Client#create_scan_config. -# -def create_scan_config - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::WebSecurityScanner::V1beta::CreateScanConfigRequest.new - - # Call the create_scan_config method. - result = client.create_scan_config request - - # The returned object is of type Google::Cloud::WebSecurityScanner::V1beta::ScanConfig. - p result -end -# [END websecurityscanner_v1beta_generated_WebSecurityScanner_CreateScanConfig_sync] diff --git a/owl-bot-staging/google-cloud-web_security_scanner-v1beta/snippets/web_security_scanner/delete_scan_config.rb b/owl-bot-staging/google-cloud-web_security_scanner-v1beta/snippets/web_security_scanner/delete_scan_config.rb deleted file mode 100644 index 4edf65f51798..000000000000 --- a/owl-bot-staging/google-cloud-web_security_scanner-v1beta/snippets/web_security_scanner/delete_scan_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 websecurityscanner_v1beta_generated_WebSecurityScanner_DeleteScanConfig_sync] -require "google/cloud/web_security_scanner/v1beta" - -## -# Snippet for the delete_scan_config call in the WebSecurityScanner 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::WebSecurityScanner::V1beta::WebSecurityScanner::Client#delete_scan_config. -# -def delete_scan_config - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::WebSecurityScanner::V1beta::DeleteScanConfigRequest.new - - # Call the delete_scan_config method. - result = client.delete_scan_config request - - # The returned object is of type Google::Protobuf::Empty. - p result -end -# [END websecurityscanner_v1beta_generated_WebSecurityScanner_DeleteScanConfig_sync] diff --git a/owl-bot-staging/google-cloud-web_security_scanner-v1beta/snippets/web_security_scanner/get_finding.rb b/owl-bot-staging/google-cloud-web_security_scanner-v1beta/snippets/web_security_scanner/get_finding.rb deleted file mode 100644 index 31b8a781be9a..000000000000 --- a/owl-bot-staging/google-cloud-web_security_scanner-v1beta/snippets/web_security_scanner/get_finding.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 websecurityscanner_v1beta_generated_WebSecurityScanner_GetFinding_sync] -require "google/cloud/web_security_scanner/v1beta" - -## -# Snippet for the get_finding call in the WebSecurityScanner 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::WebSecurityScanner::V1beta::WebSecurityScanner::Client#get_finding. -# -def get_finding - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::WebSecurityScanner::V1beta::GetFindingRequest.new - - # Call the get_finding method. - result = client.get_finding request - - # The returned object is of type Google::Cloud::WebSecurityScanner::V1beta::Finding. - p result -end -# [END websecurityscanner_v1beta_generated_WebSecurityScanner_GetFinding_sync] diff --git a/owl-bot-staging/google-cloud-web_security_scanner-v1beta/snippets/web_security_scanner/get_scan_config.rb b/owl-bot-staging/google-cloud-web_security_scanner-v1beta/snippets/web_security_scanner/get_scan_config.rb deleted file mode 100644 index 54d205419154..000000000000 --- a/owl-bot-staging/google-cloud-web_security_scanner-v1beta/snippets/web_security_scanner/get_scan_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 websecurityscanner_v1beta_generated_WebSecurityScanner_GetScanConfig_sync] -require "google/cloud/web_security_scanner/v1beta" - -## -# Snippet for the get_scan_config call in the WebSecurityScanner 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::WebSecurityScanner::V1beta::WebSecurityScanner::Client#get_scan_config. -# -def get_scan_config - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::WebSecurityScanner::V1beta::GetScanConfigRequest.new - - # Call the get_scan_config method. - result = client.get_scan_config request - - # The returned object is of type Google::Cloud::WebSecurityScanner::V1beta::ScanConfig. - p result -end -# [END websecurityscanner_v1beta_generated_WebSecurityScanner_GetScanConfig_sync] diff --git a/owl-bot-staging/google-cloud-web_security_scanner-v1beta/snippets/web_security_scanner/get_scan_run.rb b/owl-bot-staging/google-cloud-web_security_scanner-v1beta/snippets/web_security_scanner/get_scan_run.rb deleted file mode 100644 index 849242e39e6a..000000000000 --- a/owl-bot-staging/google-cloud-web_security_scanner-v1beta/snippets/web_security_scanner/get_scan_run.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 websecurityscanner_v1beta_generated_WebSecurityScanner_GetScanRun_sync] -require "google/cloud/web_security_scanner/v1beta" - -## -# Snippet for the get_scan_run call in the WebSecurityScanner 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::WebSecurityScanner::V1beta::WebSecurityScanner::Client#get_scan_run. -# -def get_scan_run - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::WebSecurityScanner::V1beta::GetScanRunRequest.new - - # Call the get_scan_run method. - result = client.get_scan_run request - - # The returned object is of type Google::Cloud::WebSecurityScanner::V1beta::ScanRun. - p result -end -# [END websecurityscanner_v1beta_generated_WebSecurityScanner_GetScanRun_sync] diff --git a/owl-bot-staging/google-cloud-web_security_scanner-v1beta/snippets/web_security_scanner/list_crawled_urls.rb b/owl-bot-staging/google-cloud-web_security_scanner-v1beta/snippets/web_security_scanner/list_crawled_urls.rb deleted file mode 100644 index 5909d290f3fe..000000000000 --- a/owl-bot-staging/google-cloud-web_security_scanner-v1beta/snippets/web_security_scanner/list_crawled_urls.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 websecurityscanner_v1beta_generated_WebSecurityScanner_ListCrawledUrls_sync] -require "google/cloud/web_security_scanner/v1beta" - -## -# Snippet for the list_crawled_urls call in the WebSecurityScanner 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::WebSecurityScanner::V1beta::WebSecurityScanner::Client#list_crawled_urls. -# -def list_crawled_urls - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::WebSecurityScanner::V1beta::ListCrawledUrlsRequest.new - - # Call the list_crawled_urls method. - result = client.list_crawled_urls 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::WebSecurityScanner::V1beta::CrawledUrl. - p item - end -end -# [END websecurityscanner_v1beta_generated_WebSecurityScanner_ListCrawledUrls_sync] diff --git a/owl-bot-staging/google-cloud-web_security_scanner-v1beta/snippets/web_security_scanner/list_finding_type_stats.rb b/owl-bot-staging/google-cloud-web_security_scanner-v1beta/snippets/web_security_scanner/list_finding_type_stats.rb deleted file mode 100644 index c3c3e83e332a..000000000000 --- a/owl-bot-staging/google-cloud-web_security_scanner-v1beta/snippets/web_security_scanner/list_finding_type_stats.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 websecurityscanner_v1beta_generated_WebSecurityScanner_ListFindingTypeStats_sync] -require "google/cloud/web_security_scanner/v1beta" - -## -# Snippet for the list_finding_type_stats call in the WebSecurityScanner 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::WebSecurityScanner::V1beta::WebSecurityScanner::Client#list_finding_type_stats. -# -def list_finding_type_stats - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::WebSecurityScanner::V1beta::ListFindingTypeStatsRequest.new - - # Call the list_finding_type_stats method. - result = client.list_finding_type_stats request - - # The returned object is of type Google::Cloud::WebSecurityScanner::V1beta::ListFindingTypeStatsResponse. - p result -end -# [END websecurityscanner_v1beta_generated_WebSecurityScanner_ListFindingTypeStats_sync] diff --git a/owl-bot-staging/google-cloud-web_security_scanner-v1beta/snippets/web_security_scanner/list_findings.rb b/owl-bot-staging/google-cloud-web_security_scanner-v1beta/snippets/web_security_scanner/list_findings.rb deleted file mode 100644 index 942fcec7e55d..000000000000 --- a/owl-bot-staging/google-cloud-web_security_scanner-v1beta/snippets/web_security_scanner/list_findings.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 websecurityscanner_v1beta_generated_WebSecurityScanner_ListFindings_sync] -require "google/cloud/web_security_scanner/v1beta" - -## -# Snippet for the list_findings call in the WebSecurityScanner 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::WebSecurityScanner::V1beta::WebSecurityScanner::Client#list_findings. -# -def list_findings - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::WebSecurityScanner::V1beta::ListFindingsRequest.new - - # Call the list_findings method. - result = client.list_findings 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::WebSecurityScanner::V1beta::Finding. - p item - end -end -# [END websecurityscanner_v1beta_generated_WebSecurityScanner_ListFindings_sync] diff --git a/owl-bot-staging/google-cloud-web_security_scanner-v1beta/snippets/web_security_scanner/list_scan_configs.rb b/owl-bot-staging/google-cloud-web_security_scanner-v1beta/snippets/web_security_scanner/list_scan_configs.rb deleted file mode 100644 index 654d77988f2c..000000000000 --- a/owl-bot-staging/google-cloud-web_security_scanner-v1beta/snippets/web_security_scanner/list_scan_configs.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 websecurityscanner_v1beta_generated_WebSecurityScanner_ListScanConfigs_sync] -require "google/cloud/web_security_scanner/v1beta" - -## -# Snippet for the list_scan_configs call in the WebSecurityScanner 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::WebSecurityScanner::V1beta::WebSecurityScanner::Client#list_scan_configs. -# -def list_scan_configs - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::WebSecurityScanner::V1beta::ListScanConfigsRequest.new - - # Call the list_scan_configs method. - result = client.list_scan_configs 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::WebSecurityScanner::V1beta::ScanConfig. - p item - end -end -# [END websecurityscanner_v1beta_generated_WebSecurityScanner_ListScanConfigs_sync] diff --git a/owl-bot-staging/google-cloud-web_security_scanner-v1beta/snippets/web_security_scanner/list_scan_runs.rb b/owl-bot-staging/google-cloud-web_security_scanner-v1beta/snippets/web_security_scanner/list_scan_runs.rb deleted file mode 100644 index 37835b22f132..000000000000 --- a/owl-bot-staging/google-cloud-web_security_scanner-v1beta/snippets/web_security_scanner/list_scan_runs.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 websecurityscanner_v1beta_generated_WebSecurityScanner_ListScanRuns_sync] -require "google/cloud/web_security_scanner/v1beta" - -## -# Snippet for the list_scan_runs call in the WebSecurityScanner 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::WebSecurityScanner::V1beta::WebSecurityScanner::Client#list_scan_runs. -# -def list_scan_runs - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::WebSecurityScanner::V1beta::ListScanRunsRequest.new - - # Call the list_scan_runs method. - result = client.list_scan_runs 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::WebSecurityScanner::V1beta::ScanRun. - p item - end -end -# [END websecurityscanner_v1beta_generated_WebSecurityScanner_ListScanRuns_sync] diff --git a/owl-bot-staging/google-cloud-web_security_scanner-v1beta/snippets/web_security_scanner/start_scan_run.rb b/owl-bot-staging/google-cloud-web_security_scanner-v1beta/snippets/web_security_scanner/start_scan_run.rb deleted file mode 100644 index 645b424b6b29..000000000000 --- a/owl-bot-staging/google-cloud-web_security_scanner-v1beta/snippets/web_security_scanner/start_scan_run.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 websecurityscanner_v1beta_generated_WebSecurityScanner_StartScanRun_sync] -require "google/cloud/web_security_scanner/v1beta" - -## -# Snippet for the start_scan_run call in the WebSecurityScanner 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::WebSecurityScanner::V1beta::WebSecurityScanner::Client#start_scan_run. -# -def start_scan_run - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::WebSecurityScanner::V1beta::StartScanRunRequest.new - - # Call the start_scan_run method. - result = client.start_scan_run request - - # The returned object is of type Google::Cloud::WebSecurityScanner::V1beta::ScanRun. - p result -end -# [END websecurityscanner_v1beta_generated_WebSecurityScanner_StartScanRun_sync] diff --git a/owl-bot-staging/google-cloud-web_security_scanner-v1beta/snippets/web_security_scanner/stop_scan_run.rb b/owl-bot-staging/google-cloud-web_security_scanner-v1beta/snippets/web_security_scanner/stop_scan_run.rb deleted file mode 100644 index 894d270fec3b..000000000000 --- a/owl-bot-staging/google-cloud-web_security_scanner-v1beta/snippets/web_security_scanner/stop_scan_run.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 websecurityscanner_v1beta_generated_WebSecurityScanner_StopScanRun_sync] -require "google/cloud/web_security_scanner/v1beta" - -## -# Snippet for the stop_scan_run call in the WebSecurityScanner 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::WebSecurityScanner::V1beta::WebSecurityScanner::Client#stop_scan_run. -# -def stop_scan_run - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::WebSecurityScanner::V1beta::StopScanRunRequest.new - - # Call the stop_scan_run method. - result = client.stop_scan_run request - - # The returned object is of type Google::Cloud::WebSecurityScanner::V1beta::ScanRun. - p result -end -# [END websecurityscanner_v1beta_generated_WebSecurityScanner_StopScanRun_sync] diff --git a/owl-bot-staging/google-cloud-web_security_scanner-v1beta/snippets/web_security_scanner/update_scan_config.rb b/owl-bot-staging/google-cloud-web_security_scanner-v1beta/snippets/web_security_scanner/update_scan_config.rb deleted file mode 100644 index 7803724b8906..000000000000 --- a/owl-bot-staging/google-cloud-web_security_scanner-v1beta/snippets/web_security_scanner/update_scan_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 websecurityscanner_v1beta_generated_WebSecurityScanner_UpdateScanConfig_sync] -require "google/cloud/web_security_scanner/v1beta" - -## -# Snippet for the update_scan_config call in the WebSecurityScanner 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::WebSecurityScanner::V1beta::WebSecurityScanner::Client#update_scan_config. -# -def update_scan_config - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::WebSecurityScanner::V1beta::UpdateScanConfigRequest.new - - # Call the update_scan_config method. - result = client.update_scan_config request - - # The returned object is of type Google::Cloud::WebSecurityScanner::V1beta::ScanConfig. - p result -end -# [END websecurityscanner_v1beta_generated_WebSecurityScanner_UpdateScanConfig_sync] diff --git a/owl-bot-staging/google-cloud-web_security_scanner-v1beta/test/google/cloud/web_security_scanner/v1beta/web_security_scanner_paths_test.rb b/owl-bot-staging/google-cloud-web_security_scanner-v1beta/test/google/cloud/web_security_scanner/v1beta/web_security_scanner_paths_test.rb deleted file mode 100644 index 8b06894bb244..000000000000 --- a/owl-bot-staging/google-cloud-web_security_scanner-v1beta/test/google/cloud/web_security_scanner/v1beta/web_security_scanner_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/web_security_scanner/v1beta/web_security_scanner" - -class ::Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::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_finding_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.finding_path project: "value0", scan_config: "value1", scan_run: "value2", finding: "value3" - assert_equal "projects/value0/scanConfigs/value1/scanRuns/value2/findings/value3", 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::WebSecurityScanner::V1beta::WebSecurityScanner::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.project_path project: "value0" - assert_equal "projects/value0", path - end - end - - def test_scan_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::WebSecurityScanner::V1beta::WebSecurityScanner::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.scan_config_path project: "value0", scan_config: "value1" - assert_equal "projects/value0/scanConfigs/value1", path - end - end - - def test_scan_run_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.scan_run_path project: "value0", scan_config: "value1", scan_run: "value2" - assert_equal "projects/value0/scanConfigs/value1/scanRuns/value2", path - end - end -end diff --git a/owl-bot-staging/google-cloud-web_security_scanner-v1beta/test/google/cloud/web_security_scanner/v1beta/web_security_scanner_rest_test.rb b/owl-bot-staging/google-cloud-web_security_scanner-v1beta/test/google/cloud/web_security_scanner/v1beta/web_security_scanner_rest_test.rb deleted file mode 100644 index 2fe56ab000a3..000000000000 --- a/owl-bot-staging/google-cloud-web_security_scanner-v1beta/test/google/cloud/web_security_scanner/v1beta/web_security_scanner_rest_test.rb +++ /dev/null @@ -1,812 +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/websecurityscanner/v1beta/web_security_scanner_pb" -require "google/cloud/web_security_scanner/v1beta/web_security_scanner/rest" - - -class ::Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::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_scan_config - # Create test objects. - client_result = ::Google::Cloud::WebSecurityScanner::V1beta::ScanConfig.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - scan_config = {} - - create_scan_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::WebSecurityScanner::V1beta::WebSecurityScanner::Rest::ServiceStub.stub :transcode_create_scan_config_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_scan_config_client_stub do - # Create client - client = ::Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_scan_config({ parent: parent, scan_config: scan_config }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_scan_config parent: parent, scan_config: scan_config do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_scan_config ::Google::Cloud::WebSecurityScanner::V1beta::CreateScanConfigRequest.new(parent: parent, scan_config: scan_config) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_scan_config({ parent: parent, scan_config: scan_config }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_scan_config(::Google::Cloud::WebSecurityScanner::V1beta::CreateScanConfigRequest.new(parent: parent, scan_config: scan_config), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_scan_config_client_stub.call_count - end - end - end - - def test_delete_scan_config - # 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_scan_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::WebSecurityScanner::V1beta::WebSecurityScanner::Rest::ServiceStub.stub :transcode_delete_scan_config_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_scan_config_client_stub do - # Create client - client = ::Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.delete_scan_config({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.delete_scan_config name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.delete_scan_config ::Google::Cloud::WebSecurityScanner::V1beta::DeleteScanConfigRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.delete_scan_config({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.delete_scan_config(::Google::Cloud::WebSecurityScanner::V1beta::DeleteScanConfigRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, delete_scan_config_client_stub.call_count - end - end - end - - def test_get_scan_config - # Create test objects. - client_result = ::Google::Cloud::WebSecurityScanner::V1beta::ScanConfig.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_scan_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::WebSecurityScanner::V1beta::WebSecurityScanner::Rest::ServiceStub.stub :transcode_get_scan_config_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_scan_config_client_stub do - # Create client - client = ::Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_scan_config({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_scan_config name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_scan_config ::Google::Cloud::WebSecurityScanner::V1beta::GetScanConfigRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_scan_config({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_scan_config(::Google::Cloud::WebSecurityScanner::V1beta::GetScanConfigRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_scan_config_client_stub.call_count - end - end - end - - def test_list_scan_configs - # Create test objects. - client_result = ::Google::Cloud::WebSecurityScanner::V1beta::ListScanConfigsResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - page_token = "hello world" - page_size = 42 - - list_scan_configs_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::WebSecurityScanner::V1beta::WebSecurityScanner::Rest::ServiceStub.stub :transcode_list_scan_configs_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_scan_configs_client_stub do - # Create client - client = ::Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_scan_configs({ parent: parent, page_token: page_token, page_size: page_size }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.list_scan_configs parent: parent, page_token: page_token, page_size: page_size do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.list_scan_configs ::Google::Cloud::WebSecurityScanner::V1beta::ListScanConfigsRequest.new(parent: parent, page_token: page_token, page_size: page_size) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.list_scan_configs({ parent: parent, page_token: page_token, page_size: page_size }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.list_scan_configs(::Google::Cloud::WebSecurityScanner::V1beta::ListScanConfigsRequest.new(parent: parent, page_token: page_token, page_size: page_size), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, list_scan_configs_client_stub.call_count - end - end - end - - def test_update_scan_config - # Create test objects. - client_result = ::Google::Cloud::WebSecurityScanner::V1beta::ScanConfig.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - scan_config = {} - update_mask = {} - - update_scan_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::WebSecurityScanner::V1beta::WebSecurityScanner::Rest::ServiceStub.stub :transcode_update_scan_config_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_scan_config_client_stub do - # Create client - client = ::Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.update_scan_config({ scan_config: scan_config, update_mask: update_mask }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.update_scan_config scan_config: scan_config, update_mask: update_mask do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.update_scan_config ::Google::Cloud::WebSecurityScanner::V1beta::UpdateScanConfigRequest.new(scan_config: scan_config, update_mask: update_mask) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.update_scan_config({ scan_config: scan_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_scan_config(::Google::Cloud::WebSecurityScanner::V1beta::UpdateScanConfigRequest.new(scan_config: scan_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_scan_config_client_stub.call_count - end - end - end - - def test_start_scan_run - # Create test objects. - client_result = ::Google::Cloud::WebSecurityScanner::V1beta::ScanRun.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - start_scan_run_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::WebSecurityScanner::V1beta::WebSecurityScanner::Rest::ServiceStub.stub :transcode_start_scan_run_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, start_scan_run_client_stub do - # Create client - client = ::Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.start_scan_run({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.start_scan_run name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.start_scan_run ::Google::Cloud::WebSecurityScanner::V1beta::StartScanRunRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.start_scan_run({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.start_scan_run(::Google::Cloud::WebSecurityScanner::V1beta::StartScanRunRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, start_scan_run_client_stub.call_count - end - end - end - - def test_get_scan_run - # Create test objects. - client_result = ::Google::Cloud::WebSecurityScanner::V1beta::ScanRun.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_scan_run_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::WebSecurityScanner::V1beta::WebSecurityScanner::Rest::ServiceStub.stub :transcode_get_scan_run_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_scan_run_client_stub do - # Create client - client = ::Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_scan_run({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_scan_run name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_scan_run ::Google::Cloud::WebSecurityScanner::V1beta::GetScanRunRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_scan_run({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_scan_run(::Google::Cloud::WebSecurityScanner::V1beta::GetScanRunRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_scan_run_client_stub.call_count - end - end - end - - def test_list_scan_runs - # Create test objects. - client_result = ::Google::Cloud::WebSecurityScanner::V1beta::ListScanRunsResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - page_token = "hello world" - page_size = 42 - - list_scan_runs_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::WebSecurityScanner::V1beta::WebSecurityScanner::Rest::ServiceStub.stub :transcode_list_scan_runs_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_scan_runs_client_stub do - # Create client - client = ::Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_scan_runs({ parent: parent, page_token: page_token, page_size: page_size }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.list_scan_runs parent: parent, page_token: page_token, page_size: page_size do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.list_scan_runs ::Google::Cloud::WebSecurityScanner::V1beta::ListScanRunsRequest.new(parent: parent, page_token: page_token, page_size: page_size) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.list_scan_runs({ parent: parent, page_token: page_token, page_size: page_size }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.list_scan_runs(::Google::Cloud::WebSecurityScanner::V1beta::ListScanRunsRequest.new(parent: parent, page_token: page_token, page_size: page_size), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, list_scan_runs_client_stub.call_count - end - end - end - - def test_stop_scan_run - # Create test objects. - client_result = ::Google::Cloud::WebSecurityScanner::V1beta::ScanRun.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - stop_scan_run_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::WebSecurityScanner::V1beta::WebSecurityScanner::Rest::ServiceStub.stub :transcode_stop_scan_run_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, stop_scan_run_client_stub do - # Create client - client = ::Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.stop_scan_run({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.stop_scan_run name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.stop_scan_run ::Google::Cloud::WebSecurityScanner::V1beta::StopScanRunRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.stop_scan_run({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.stop_scan_run(::Google::Cloud::WebSecurityScanner::V1beta::StopScanRunRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, stop_scan_run_client_stub.call_count - end - end - end - - def test_list_crawled_urls - # Create test objects. - client_result = ::Google::Cloud::WebSecurityScanner::V1beta::ListCrawledUrlsResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - page_token = "hello world" - page_size = 42 - - list_crawled_urls_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::WebSecurityScanner::V1beta::WebSecurityScanner::Rest::ServiceStub.stub :transcode_list_crawled_urls_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_crawled_urls_client_stub do - # Create client - client = ::Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_crawled_urls({ parent: parent, page_token: page_token, page_size: page_size }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.list_crawled_urls parent: parent, page_token: page_token, page_size: page_size do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.list_crawled_urls ::Google::Cloud::WebSecurityScanner::V1beta::ListCrawledUrlsRequest.new(parent: parent, page_token: page_token, page_size: page_size) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.list_crawled_urls({ parent: parent, page_token: page_token, page_size: page_size }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.list_crawled_urls(::Google::Cloud::WebSecurityScanner::V1beta::ListCrawledUrlsRequest.new(parent: parent, page_token: page_token, page_size: page_size), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, list_crawled_urls_client_stub.call_count - end - end - end - - def test_get_finding - # Create test objects. - client_result = ::Google::Cloud::WebSecurityScanner::V1beta::Finding.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_finding_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::WebSecurityScanner::V1beta::WebSecurityScanner::Rest::ServiceStub.stub :transcode_get_finding_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_finding_client_stub do - # Create client - client = ::Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_finding({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_finding name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_finding ::Google::Cloud::WebSecurityScanner::V1beta::GetFindingRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_finding({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_finding(::Google::Cloud::WebSecurityScanner::V1beta::GetFindingRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_finding_client_stub.call_count - end - end - end - - def test_list_findings - # Create test objects. - client_result = ::Google::Cloud::WebSecurityScanner::V1beta::ListFindingsResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - filter = "hello world" - page_token = "hello world" - page_size = 42 - - list_findings_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::WebSecurityScanner::V1beta::WebSecurityScanner::Rest::ServiceStub.stub :transcode_list_findings_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_findings_client_stub do - # Create client - client = ::Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_findings({ parent: parent, filter: filter, page_token: page_token, page_size: page_size }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.list_findings parent: parent, filter: filter, page_token: page_token, page_size: page_size do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.list_findings ::Google::Cloud::WebSecurityScanner::V1beta::ListFindingsRequest.new(parent: parent, filter: filter, page_token: page_token, page_size: page_size) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.list_findings({ parent: parent, filter: filter, page_token: page_token, page_size: page_size }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.list_findings(::Google::Cloud::WebSecurityScanner::V1beta::ListFindingsRequest.new(parent: parent, filter: filter, page_token: page_token, page_size: page_size), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, list_findings_client_stub.call_count - end - end - end - - def test_list_finding_type_stats - # Create test objects. - client_result = ::Google::Cloud::WebSecurityScanner::V1beta::ListFindingTypeStatsResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - - list_finding_type_stats_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::WebSecurityScanner::V1beta::WebSecurityScanner::Rest::ServiceStub.stub :transcode_list_finding_type_stats_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_finding_type_stats_client_stub do - # Create client - client = ::Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_finding_type_stats({ parent: parent }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.list_finding_type_stats parent: parent do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.list_finding_type_stats ::Google::Cloud::WebSecurityScanner::V1beta::ListFindingTypeStatsRequest.new(parent: parent) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.list_finding_type_stats({ parent: parent }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.list_finding_type_stats(::Google::Cloud::WebSecurityScanner::V1beta::ListFindingTypeStatsRequest.new(parent: parent), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, list_finding_type_stats_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::WebSecurityScanner::V1beta::WebSecurityScanner::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::WebSecurityScanner::V1beta::WebSecurityScanner::Rest::Client::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-web_security_scanner-v1beta/test/google/cloud/web_security_scanner/v1beta/web_security_scanner_test.rb b/owl-bot-staging/google-cloud-web_security_scanner-v1beta/test/google/cloud/web_security_scanner/v1beta/web_security_scanner_test.rb deleted file mode 100644 index 25a2ab5f9477..000000000000 --- a/owl-bot-staging/google-cloud-web_security_scanner-v1beta/test/google/cloud/web_security_scanner/v1beta/web_security_scanner_test.rb +++ /dev/null @@ -1,900 +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/websecurityscanner/v1beta/web_security_scanner_pb" -require "google/cloud/web_security_scanner/v1beta/web_security_scanner" - -class ::Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::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_scan_config - # Create GRPC objects. - grpc_response = ::Google::Cloud::WebSecurityScanner::V1beta::ScanConfig.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" - scan_config = {} - - create_scan_config_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_scan_config, name - assert_kind_of ::Google::Cloud::WebSecurityScanner::V1beta::CreateScanConfigRequest, request - assert_equal "hello world", request["parent"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::WebSecurityScanner::V1beta::ScanConfig), request["scan_config"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_scan_config_client_stub do - # Create client - client = ::Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_scan_config({ parent: parent, scan_config: scan_config }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.create_scan_config parent: parent, scan_config: scan_config do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.create_scan_config ::Google::Cloud::WebSecurityScanner::V1beta::CreateScanConfigRequest.new(parent: parent, scan_config: scan_config) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.create_scan_config({ parent: parent, scan_config: scan_config }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.create_scan_config(::Google::Cloud::WebSecurityScanner::V1beta::CreateScanConfigRequest.new(parent: parent, scan_config: scan_config), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, create_scan_config_client_stub.call_rpc_count - end - end - - def test_delete_scan_config - # 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_scan_config_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_scan_config, name - assert_kind_of ::Google::Cloud::WebSecurityScanner::V1beta::DeleteScanConfigRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_scan_config_client_stub do - # Create client - client = ::Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_scan_config({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.delete_scan_config name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.delete_scan_config ::Google::Cloud::WebSecurityScanner::V1beta::DeleteScanConfigRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.delete_scan_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.delete_scan_config(::Google::Cloud::WebSecurityScanner::V1beta::DeleteScanConfigRequest.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_scan_config_client_stub.call_rpc_count - end - end - - def test_get_scan_config - # Create GRPC objects. - grpc_response = ::Google::Cloud::WebSecurityScanner::V1beta::ScanConfig.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_scan_config_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_scan_config, name - assert_kind_of ::Google::Cloud::WebSecurityScanner::V1beta::GetScanConfigRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_scan_config_client_stub do - # Create client - client = ::Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_scan_config({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_scan_config name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_scan_config ::Google::Cloud::WebSecurityScanner::V1beta::GetScanConfigRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_scan_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_scan_config(::Google::Cloud::WebSecurityScanner::V1beta::GetScanConfigRequest.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_scan_config_client_stub.call_rpc_count - end - end - - def test_list_scan_configs - # Create GRPC objects. - grpc_response = ::Google::Cloud::WebSecurityScanner::V1beta::ListScanConfigsResponse.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_token = "hello world" - page_size = 42 - - list_scan_configs_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_scan_configs, name - assert_kind_of ::Google::Cloud::WebSecurityScanner::V1beta::ListScanConfigsRequest, request - assert_equal "hello world", request["parent"] - assert_equal "hello world", request["page_token"] - assert_equal 42, request["page_size"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_scan_configs_client_stub do - # Create client - client = ::Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_scan_configs({ parent: parent, page_token: page_token, page_size: page_size }) 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_scan_configs parent: parent, page_token: page_token, page_size: page_size 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_scan_configs ::Google::Cloud::WebSecurityScanner::V1beta::ListScanConfigsRequest.new(parent: parent, page_token: page_token, page_size: page_size) 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_scan_configs({ parent: parent, page_token: page_token, page_size: page_size }, 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_scan_configs(::Google::Cloud::WebSecurityScanner::V1beta::ListScanConfigsRequest.new(parent: parent, page_token: page_token, page_size: page_size), 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_scan_configs_client_stub.call_rpc_count - end - end - - def test_update_scan_config - # Create GRPC objects. - grpc_response = ::Google::Cloud::WebSecurityScanner::V1beta::ScanConfig.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. - scan_config = {} - update_mask = {} - - update_scan_config_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_scan_config, name - assert_kind_of ::Google::Cloud::WebSecurityScanner::V1beta::UpdateScanConfigRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::WebSecurityScanner::V1beta::ScanConfig), request["scan_config"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_scan_config_client_stub do - # Create client - client = ::Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_scan_config({ scan_config: scan_config, update_mask: update_mask }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.update_scan_config scan_config: scan_config, update_mask: update_mask do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.update_scan_config ::Google::Cloud::WebSecurityScanner::V1beta::UpdateScanConfigRequest.new(scan_config: scan_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_scan_config({ scan_config: scan_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_scan_config(::Google::Cloud::WebSecurityScanner::V1beta::UpdateScanConfigRequest.new(scan_config: scan_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_scan_config_client_stub.call_rpc_count - end - end - - def test_start_scan_run - # Create GRPC objects. - grpc_response = ::Google::Cloud::WebSecurityScanner::V1beta::ScanRun.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" - - start_scan_run_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :start_scan_run, name - assert_kind_of ::Google::Cloud::WebSecurityScanner::V1beta::StartScanRunRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, start_scan_run_client_stub do - # Create client - client = ::Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.start_scan_run({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.start_scan_run name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.start_scan_run ::Google::Cloud::WebSecurityScanner::V1beta::StartScanRunRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.start_scan_run({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.start_scan_run(::Google::Cloud::WebSecurityScanner::V1beta::StartScanRunRequest.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, start_scan_run_client_stub.call_rpc_count - end - end - - def test_get_scan_run - # Create GRPC objects. - grpc_response = ::Google::Cloud::WebSecurityScanner::V1beta::ScanRun.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_scan_run_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_scan_run, name - assert_kind_of ::Google::Cloud::WebSecurityScanner::V1beta::GetScanRunRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_scan_run_client_stub do - # Create client - client = ::Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_scan_run({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_scan_run name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_scan_run ::Google::Cloud::WebSecurityScanner::V1beta::GetScanRunRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_scan_run({ 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_scan_run(::Google::Cloud::WebSecurityScanner::V1beta::GetScanRunRequest.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_scan_run_client_stub.call_rpc_count - end - end - - def test_list_scan_runs - # Create GRPC objects. - grpc_response = ::Google::Cloud::WebSecurityScanner::V1beta::ListScanRunsResponse.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_token = "hello world" - page_size = 42 - - list_scan_runs_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_scan_runs, name - assert_kind_of ::Google::Cloud::WebSecurityScanner::V1beta::ListScanRunsRequest, request - assert_equal "hello world", request["parent"] - assert_equal "hello world", request["page_token"] - assert_equal 42, request["page_size"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_scan_runs_client_stub do - # Create client - client = ::Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_scan_runs({ parent: parent, page_token: page_token, page_size: page_size }) 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_scan_runs parent: parent, page_token: page_token, page_size: page_size 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_scan_runs ::Google::Cloud::WebSecurityScanner::V1beta::ListScanRunsRequest.new(parent: parent, page_token: page_token, page_size: page_size) 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_scan_runs({ parent: parent, page_token: page_token, page_size: page_size }, 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_scan_runs(::Google::Cloud::WebSecurityScanner::V1beta::ListScanRunsRequest.new(parent: parent, page_token: page_token, page_size: page_size), 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_scan_runs_client_stub.call_rpc_count - end - end - - def test_stop_scan_run - # Create GRPC objects. - grpc_response = ::Google::Cloud::WebSecurityScanner::V1beta::ScanRun.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" - - stop_scan_run_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :stop_scan_run, name - assert_kind_of ::Google::Cloud::WebSecurityScanner::V1beta::StopScanRunRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, stop_scan_run_client_stub do - # Create client - client = ::Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.stop_scan_run({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.stop_scan_run name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.stop_scan_run ::Google::Cloud::WebSecurityScanner::V1beta::StopScanRunRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.stop_scan_run({ name: name }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.stop_scan_run(::Google::Cloud::WebSecurityScanner::V1beta::StopScanRunRequest.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, stop_scan_run_client_stub.call_rpc_count - end - end - - def test_list_crawled_urls - # Create GRPC objects. - grpc_response = ::Google::Cloud::WebSecurityScanner::V1beta::ListCrawledUrlsResponse.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_token = "hello world" - page_size = 42 - - list_crawled_urls_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_crawled_urls, name - assert_kind_of ::Google::Cloud::WebSecurityScanner::V1beta::ListCrawledUrlsRequest, request - assert_equal "hello world", request["parent"] - assert_equal "hello world", request["page_token"] - assert_equal 42, request["page_size"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_crawled_urls_client_stub do - # Create client - client = ::Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_crawled_urls({ parent: parent, page_token: page_token, page_size: page_size }) 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_crawled_urls parent: parent, page_token: page_token, page_size: page_size 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_crawled_urls ::Google::Cloud::WebSecurityScanner::V1beta::ListCrawledUrlsRequest.new(parent: parent, page_token: page_token, page_size: page_size) 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_crawled_urls({ parent: parent, page_token: page_token, page_size: page_size }, 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_crawled_urls(::Google::Cloud::WebSecurityScanner::V1beta::ListCrawledUrlsRequest.new(parent: parent, page_token: page_token, page_size: page_size), 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_crawled_urls_client_stub.call_rpc_count - end - end - - def test_get_finding - # Create GRPC objects. - grpc_response = ::Google::Cloud::WebSecurityScanner::V1beta::Finding.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_finding_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_finding, name - assert_kind_of ::Google::Cloud::WebSecurityScanner::V1beta::GetFindingRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_finding_client_stub do - # Create client - client = ::Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_finding({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_finding name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_finding ::Google::Cloud::WebSecurityScanner::V1beta::GetFindingRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_finding({ 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_finding(::Google::Cloud::WebSecurityScanner::V1beta::GetFindingRequest.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_finding_client_stub.call_rpc_count - end - end - - def test_list_findings - # Create GRPC objects. - grpc_response = ::Google::Cloud::WebSecurityScanner::V1beta::ListFindingsResponse.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" - filter = "hello world" - page_token = "hello world" - page_size = 42 - - list_findings_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_findings, name - assert_kind_of ::Google::Cloud::WebSecurityScanner::V1beta::ListFindingsRequest, request - assert_equal "hello world", request["parent"] - assert_equal "hello world", request["filter"] - assert_equal "hello world", request["page_token"] - assert_equal 42, request["page_size"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_findings_client_stub do - # Create client - client = ::Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_findings({ parent: parent, filter: filter, page_token: page_token, page_size: page_size }) 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_findings parent: parent, filter: filter, page_token: page_token, page_size: page_size 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_findings ::Google::Cloud::WebSecurityScanner::V1beta::ListFindingsRequest.new(parent: parent, filter: filter, page_token: page_token, page_size: page_size) 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_findings({ parent: parent, filter: filter, page_token: page_token, page_size: page_size }, 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_findings(::Google::Cloud::WebSecurityScanner::V1beta::ListFindingsRequest.new(parent: parent, filter: filter, page_token: page_token, page_size: page_size), 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_findings_client_stub.call_rpc_count - end - end - - def test_list_finding_type_stats - # Create GRPC objects. - grpc_response = ::Google::Cloud::WebSecurityScanner::V1beta::ListFindingTypeStatsResponse.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" - - list_finding_type_stats_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_finding_type_stats, name - assert_kind_of ::Google::Cloud::WebSecurityScanner::V1beta::ListFindingTypeStatsRequest, request - assert_equal "hello world", request["parent"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_finding_type_stats_client_stub do - # Create client - client = ::Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_finding_type_stats({ parent: parent }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.list_finding_type_stats parent: parent do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.list_finding_type_stats ::Google::Cloud::WebSecurityScanner::V1beta::ListFindingTypeStatsRequest.new(parent: parent) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.list_finding_type_stats({ parent: parent }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.list_finding_type_stats(::Google::Cloud::WebSecurityScanner::V1beta::ListFindingTypeStatsRequest.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, list_finding_type_stats_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::WebSecurityScanner::V1beta::WebSecurityScanner::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::WebSecurityScanner::V1beta::WebSecurityScanner::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::WebSecurityScanner::V1beta::WebSecurityScanner::Client.new do |config| - config.credentials = creds - end - assert_kind_of ::Google::Cloud::WebSecurityScanner::V1beta::WebSecurityScanner::Client, client - assert_equal creds, client.configure.credentials - end - end -end diff --git a/owl-bot-staging/google-cloud-web_security_scanner-v1beta/test/helper.rb b/owl-bot-staging/google-cloud-web_security_scanner-v1beta/test/helper.rb deleted file mode 100644 index 672b337030e7..000000000000 --- a/owl-bot-staging/google-cloud-web_security_scanner-v1beta/test/helper.rb +++ /dev/null @@ -1,26 +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/mock" -require "minitest/rg" - -require "grpc" - -require "ostruct" diff --git a/owl-bot-staging/google-cloud-workflows-executions-v1/.gitignore b/owl-bot-staging/google-cloud-workflows-executions-v1/.gitignore deleted file mode 100644 index 0135b6bc6cfc..000000000000 --- a/owl-bot-staging/google-cloud-workflows-executions-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-workflows-executions-v1/.repo-metadata.json b/owl-bot-staging/google-cloud-workflows-executions-v1/.repo-metadata.json deleted file mode 100644 index 29631f032d47..000000000000 --- a/owl-bot-staging/google-cloud-workflows-executions-v1/.repo-metadata.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "api_id": "workflowexecutions.googleapis.com", - "api_shortname": "workflowexecutions", - "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-workflows-executions-v1/latest", - "distribution_name": "google-cloud-workflows-executions-v1", - "is_cloud": true, - "language": "ruby", - "name": "workflowexecutions", - "name_pretty": "Workflows Executions V1 API", - "product_documentation": "https://cloud.google.com/workflows/", - "release_level": "unreleased", - "repo": "googleapis/google-cloud-ruby", - "requires_billing": true, - "ruby-cloud-description": "Workflows link series of serverless tasks together in an order you define. Combine the power of Google Cloud's APIs, serverless products like Cloud Functions and Cloud Run, and calls to external APIs to create flexible serverless applications. Workflows requires no infrastructure management and scales seamlessly with demand, including scaling down to zero.. Note that google-cloud-workflows-executions-v1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-workflows instead. See the readme for more details.", - "ruby-cloud-env-prefix": "WORKFLOWS", - "ruby-cloud-product-url": "https://cloud.google.com/workflows/", - "library_type": "GAPIC_AUTO" -} diff --git a/owl-bot-staging/google-cloud-workflows-executions-v1/.rubocop.yml b/owl-bot-staging/google-cloud-workflows-executions-v1/.rubocop.yml deleted file mode 100644 index ba04c515e3d9..000000000000 --- a/owl-bot-staging/google-cloud-workflows-executions-v1/.rubocop.yml +++ /dev/null @@ -1,33 +0,0 @@ -inherit_gem: - google-style: google-style.yml - -AllCops: - Exclude: - - "google-cloud-workflows-executions-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-workflows-executions-v1.rb" diff --git a/owl-bot-staging/google-cloud-workflows-executions-v1/.toys.rb b/owl-bot-staging/google-cloud-workflows-executions-v1/.toys.rb deleted file mode 100644 index 177e22456e8a..000000000000 --- a/owl-bot-staging/google-cloud-workflows-executions-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-workflows-executions-v1/.yardopts b/owl-bot-staging/google-cloud-workflows-executions-v1/.yardopts deleted file mode 100644 index f0b454dc3245..000000000000 --- a/owl-bot-staging/google-cloud-workflows-executions-v1/.yardopts +++ /dev/null @@ -1,12 +0,0 @@ ---no-private ---title="Workflows Executions 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-workflows-executions-v1/AUTHENTICATION.md b/owl-bot-staging/google-cloud-workflows-executions-v1/AUTHENTICATION.md deleted file mode 100644 index 73a695e2f97f..000000000000 --- a/owl-bot-staging/google-cloud-workflows-executions-v1/AUTHENTICATION.md +++ /dev/null @@ -1,122 +0,0 @@ -# Authentication - -The recommended way to authenticate to the google-cloud-workflows-executions-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-workflows-executions-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/workflows/executions/v1" - -client = ::Google::Cloud::Workflows::Executions::V1::Executions::Client.new do |config| - config.credentials = "path/to/credentialfile.json" -end -``` - -To configure a credentials file globally for all clients: - -```ruby -require "google/cloud/workflows/executions/v1" - -::Google::Cloud::Workflows::Executions::V1::Executions::Client.configure do |config| - config.credentials = "path/to/credentialfile.json" -end - -client = ::Google::Cloud::Workflows::Executions::V1::Executions::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-workflows-executions-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/workflows/executions/v1" - -ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" - -client = ::Google::Cloud::Workflows::Executions::V1::Executions::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-workflows-executions-v1/CHANGELOG.md b/owl-bot-staging/google-cloud-workflows-executions-v1/CHANGELOG.md deleted file mode 100644 index f88957a62ba2..000000000000 --- a/owl-bot-staging/google-cloud-workflows-executions-v1/CHANGELOG.md +++ /dev/null @@ -1,2 +0,0 @@ -# Release History - diff --git a/owl-bot-staging/google-cloud-workflows-executions-v1/Gemfile b/owl-bot-staging/google-cloud-workflows-executions-v1/Gemfile deleted file mode 100644 index 1d08558908d8..000000000000 --- a/owl-bot-staging/google-cloud-workflows-executions-v1/Gemfile +++ /dev/null @@ -1,14 +0,0 @@ -source "https://rubygems.org" - -gemspec - -gem "google-style", "~> 1.32.0" -gem "irb", "~> 1.17" -gem "minitest", "~> 6.0.2" -gem "minitest-focus", "~> 1.4" -gem "minitest-mock", "~> 5.27" -gem "minitest-rg", "~> 5.3" -gem "ostruct", "~> 0.5.5" -gem "rake", ">= 13.0" -gem "redcarpet", "~> 3.6" -gem "yard", "~> 0.9" diff --git a/owl-bot-staging/google-cloud-workflows-executions-v1/LICENSE.md b/owl-bot-staging/google-cloud-workflows-executions-v1/LICENSE.md deleted file mode 100644 index c261857ba6ad..000000000000 --- a/owl-bot-staging/google-cloud-workflows-executions-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-workflows-executions-v1/README.md b/owl-bot-staging/google-cloud-workflows-executions-v1/README.md deleted file mode 100644 index 1fad0660e45e..000000000000 --- a/owl-bot-staging/google-cloud-workflows-executions-v1/README.md +++ /dev/null @@ -1,154 +0,0 @@ -# Ruby Client for the Workflows Executions V1 API - -Execute workflows created with Workflows API. - -Workflows link series of serverless tasks together in an order you define. Combine the power of Google Cloud's APIs, serverless products like Cloud Functions and Cloud Run, and calls to external APIs to create flexible serverless applications. Workflows requires no infrastructure management and scales seamlessly with demand, including scaling down to zero.. - -https://github.com/googleapis/google-cloud-ruby - -This gem is a _versioned_ client. It provides basic client classes for a -specific version of the Workflows Executions V1 API. Most users should consider using -the main client gem, -[google-cloud-workflows](https://rubygems.org/gems/google-cloud-workflows). -See the section below titled *Which client should I use?* for more information. - -## Installation - -``` -$ gem install google-cloud-workflows-executions-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/workflowexecutions.googleapis.com) -1. [Set up authentication.](AUTHENTICATION.md) - -## Quick Start - -```ruby -require "google/cloud/workflows/executions/v1" - -client = ::Google::Cloud::Workflows::Executions::V1::Executions::Client.new -request = ::Google::Cloud::Workflows::Executions::V1::ListExecutionsRequest.new # (request fields as keyword arguments...) -response = client.list_executions request -``` - -View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-workflows-executions-v1/latest) -for class and method documentation. - -See also the [Product Documentation](https://cloud.google.com/workflows/) -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/workflows/executions/v1" -require "logger" - -client = ::Google::Cloud::Workflows::Executions::V1::Executions::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-workflows`, -and lower-level _versioned_ client libraries with names such as -`google-cloud-workflows-executions-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-workflows`. -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-workflows-executions-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-workflows-executions-v1/Rakefile b/owl-bot-staging/google-cloud-workflows-executions-v1/Rakefile deleted file mode 100644 index 44509fa79f79..000000000000 --- a/owl-bot-staging/google-cloud-workflows-executions-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-workflows-executions-v1 acceptance tests." -task :acceptance, :project, :keyfile do |t, args| - project = args[:project] - project ||= - ENV["WORKFLOWS_TEST_PROJECT"] || - ENV["GCLOUD_TEST_PROJECT"] - keyfile = args[:keyfile] - keyfile ||= - ENV["WORKFLOWS_TEST_KEYFILE"] || - ENV["GCLOUD_TEST_KEYFILE"] - if keyfile - keyfile = File.read keyfile - else - keyfile ||= - ENV["WORKFLOWS_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 WORKFLOWS_TEST_PROJECT=test123 WORKFLOWS_TEST_KEYFILE=/path/to/keyfile.json rake acceptance" - end - require "google/cloud/workflows/executions/v1/executions/credentials" - ::Google::Cloud::Workflows::Executions::V1::Executions::Credentials.env_vars.each do |path| - ENV[path] = nil - end - ENV["WORKFLOWS_PROJECT"] = project - ENV["WORKFLOWS_TEST_PROJECT"] = project - ENV["WORKFLOWS_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-workflows-executions-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-workflows-executions-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-workflows-executions-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-workflows-executions-v1 gem does not have doctest tests." -end - -desc "Run the CI build" -task :ci do - header "BUILDING google-cloud-workflows-executions-v1" - header "google-cloud-workflows-executions-v1 rubocop", "*" - Rake::Task[:rubocop].invoke - header "google-cloud-workflows-executions-v1 yard", "*" - Rake::Task[:yard].invoke - header "google-cloud-workflows-executions-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-workflows-executions-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-workflows-executions-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-workflows-executions-v1/gapic_metadata.json b/owl-bot-staging/google-cloud-workflows-executions-v1/gapic_metadata.json deleted file mode 100644 index 7c61feeebf2d..000000000000 --- a/owl-bot-staging/google-cloud-workflows-executions-v1/gapic_metadata.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", - "language": "ruby", - "protoPackage": "google.cloud.workflows.executions.v1", - "libraryPackage": "::Google::Cloud::Workflows::Executions::V1", - "services": { - "Executions": { - "clients": { - "grpc": { - "libraryClient": "::Google::Cloud::Workflows::Executions::V1::Executions::Client", - "rpcs": { - "ListExecutions": { - "methods": [ - "list_executions" - ] - }, - "CreateExecution": { - "methods": [ - "create_execution" - ] - }, - "GetExecution": { - "methods": [ - "get_execution" - ] - }, - "CancelExecution": { - "methods": [ - "cancel_execution" - ] - } - } - } - } - } - } -} diff --git a/owl-bot-staging/google-cloud-workflows-executions-v1/google-cloud-workflows-executions-v1.gemspec b/owl-bot-staging/google-cloud-workflows-executions-v1/google-cloud-workflows-executions-v1.gemspec deleted file mode 100644 index c95047a2fea6..000000000000 --- a/owl-bot-staging/google-cloud-workflows-executions-v1/google-cloud-workflows-executions-v1.gemspec +++ /dev/null @@ -1,28 +0,0 @@ -# -*- ruby -*- -# encoding: utf-8 - -require File.expand_path("lib/google/cloud/workflows/executions/v1/version", __dir__) - -Gem::Specification.new do |gem| - gem.name = "google-cloud-workflows-executions-v1" - gem.version = Google::Cloud::Workflows::Executions::V1::VERSION - - gem.authors = ["Google LLC"] - gem.email = "googleapis-packages@google.com" - gem.description = "Workflows link series of serverless tasks together in an order you define. Combine the power of Google Cloud's APIs, serverless products like Cloud Functions and Cloud Run, and calls to external APIs to create flexible serverless applications. Workflows requires no infrastructure management and scales seamlessly with demand, including scaling down to zero.. Note that google-cloud-workflows-executions-v1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-workflows instead. See the readme for more details." - gem.summary = "Execute workflows created with Workflows API." - 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.2" - - gem.add_dependency "gapic-common", "~> 1.2" - gem.add_dependency "google-cloud-errors", "~> 1.0" -end diff --git a/owl-bot-staging/google-cloud-workflows-executions-v1/lib/google-cloud-workflows-executions-v1.rb b/owl-bot-staging/google-cloud-workflows-executions-v1/lib/google-cloud-workflows-executions-v1.rb deleted file mode 100644 index fc4b162a318b..000000000000 --- a/owl-bot-staging/google-cloud-workflows-executions-v1/lib/google-cloud-workflows-executions-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/workflows/executions/v1" diff --git a/owl-bot-staging/google-cloud-workflows-executions-v1/lib/google/cloud/workflows/executions/v1.rb b/owl-bot-staging/google-cloud-workflows-executions-v1/lib/google/cloud/workflows/executions/v1.rb deleted file mode 100644 index 3c540505d083..000000000000 --- a/owl-bot-staging/google-cloud-workflows-executions-v1/lib/google/cloud/workflows/executions/v1.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! - -require "google/cloud/workflows/executions/v1/executions" -require "google/cloud/workflows/executions/v1/version" - -module Google - module Cloud - module Workflows - module Executions - ## - # API client module. - # - # @example Load this package, including all its services, and instantiate a gRPC client - # - # require "google/cloud/workflows/executions/v1" - # client = ::Google::Cloud::Workflows::Executions::V1::Executions::Client.new - # - # @example Load this package, including all its services, and instantiate a REST client - # - # require "google/cloud/workflows/executions/v1" - # client = ::Google::Cloud::Workflows::Executions::V1::Executions::Rest::Client.new - # - module V1 - end - end - end - end -end - -helper_path = ::File.join __dir__, "v1", "_helpers.rb" -require "google/cloud/workflows/executions/v1/_helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-workflows-executions-v1/lib/google/cloud/workflows/executions/v1/executions.rb b/owl-bot-staging/google-cloud-workflows-executions-v1/lib/google/cloud/workflows/executions/v1/executions.rb deleted file mode 100644 index b39a54aa895b..000000000000 --- a/owl-bot-staging/google-cloud-workflows-executions-v1/lib/google/cloud/workflows/executions/v1/executions.rb +++ /dev/null @@ -1,58 +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/workflows/executions/v1/version" - -require "google/cloud/workflows/executions/v1/executions/credentials" -require "google/cloud/workflows/executions/v1/executions/paths" -require "google/cloud/workflows/executions/v1/executions/client" -require "google/cloud/workflows/executions/v1/executions/rest" - -module Google - module Cloud - module Workflows - module Executions - module V1 - ## - # Executions is used to start and manage running instances of - # [Workflows][google.cloud.workflows.v1.Workflow] called executions. - # - # @example Load this service and instantiate a gRPC client - # - # require "google/cloud/workflows/executions/v1/executions" - # client = ::Google::Cloud::Workflows::Executions::V1::Executions::Client.new - # - # @example Load this service and instantiate a REST client - # - # require "google/cloud/workflows/executions/v1/executions/rest" - # client = ::Google::Cloud::Workflows::Executions::V1::Executions::Rest::Client.new - # - module Executions - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "executions", "helpers.rb" -require "google/cloud/workflows/executions/v1/executions/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-workflows-executions-v1/lib/google/cloud/workflows/executions/v1/executions/client.rb b/owl-bot-staging/google-cloud-workflows-executions-v1/lib/google/cloud/workflows/executions/v1/executions/client.rb deleted file mode 100644 index 96f7f1a299d5..000000000000 --- a/owl-bot-staging/google-cloud-workflows-executions-v1/lib/google/cloud/workflows/executions/v1/executions/client.rb +++ /dev/null @@ -1,802 +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/workflows/executions/v1/executions_pb" - -module Google - module Cloud - module Workflows - module Executions - module V1 - module Executions - ## - # Client for the Executions service. - # - # Executions is used to start and manage running instances of - # [Workflows][google.cloud.workflows.v1.Workflow] called executions. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "workflowexecutions.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :executions_stub - - ## - # Configure the Executions Client class. - # - # See {::Google::Cloud::Workflows::Executions::V1::Executions::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all Executions clients - # ::Google::Cloud::Workflows::Executions::V1::Executions::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", "Workflows", "Executions", "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 - end - yield @configure if block_given? - @configure - end - - ## - # Configure the Executions 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::Workflows::Executions::V1::Executions::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 - @executions_stub.universe_domain - end - - ## - # Create a new Executions client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Workflows::Executions::V1::Executions::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Workflows::Executions::V1::Executions::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Executions 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/workflows/executions/v1/executions_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 - - @executions_stub = ::Gapic::ServiceStub.new( - ::Google::Cloud::Workflows::Executions::V1::Executions::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 - ) - - @executions_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 - end - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @executions_stub.logger - end - - # Service calls - - ## - # Returns a list of executions which belong to the workflow with - # the given name. The method returns executions of all workflow - # revisions. Returned executions are ordered by their start time (newest - # first). - # - # @overload list_executions(request, options = nil) - # Pass arguments to `list_executions` via a request object, either of type - # {::Google::Cloud::Workflows::Executions::V1::ListExecutionsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Workflows::Executions::V1::ListExecutionsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_executions(parent: nil, page_size: nil, page_token: nil, view: nil, filter: nil, order_by: nil) - # Pass arguments to `list_executions` via keyword arguments. Note that at - # least one keyword argument is 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 workflow for which the executions should be listed. - # Format: projects/\\{project}/locations/\\{location}/workflows/\\{workflow} - # @param page_size [::Integer] - # Maximum number of executions to return per call. - # Max supported value depends on the selected Execution view: it's 1000 for - # BASIC and 100 for FULL. The default value used if the field is not - # specified is 100, regardless of the selected view. Values greater than - # the max value will be coerced down to it. - # @param page_token [::String] - # A page token, received from a previous `ListExecutions` call. - # Provide this to retrieve the subsequent page. - # - # When paginating, all other parameters provided to `ListExecutions` must - # match the call that provided the page token. - # - # Note that pagination is applied to dynamic data. The list of executions - # returned can change between page requests. - # @param view [::Google::Cloud::Workflows::Executions::V1::ExecutionView] - # Optional. A view defining which fields should be filled in the returned - # executions. The API will default to the BASIC view. - # @param filter [::String] - # Optional. Filters applied to the [Executions.ListExecutions] results. - # The following fields are supported for filtering: - # executionID, state, startTime, endTime, duration, workflowRevisionID, - # stepName, and label. - # @param order_by [::String] - # Optional. The ordering applied to the [Executions.ListExecutions] results. - # By default the ordering is based on descending start time. - # The following fields are supported for order by: - # executionID, startTime, endTime, duration, state, and workflowRevisionID. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Workflows::Executions::V1::Execution>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::Workflows::Executions::V1::Execution>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/workflows/executions/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Workflows::Executions::V1::Executions::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Workflows::Executions::V1::ListExecutionsRequest.new - # - # # Call the list_executions method. - # result = client.list_executions 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::Workflows::Executions::V1::Execution. - # p item - # end - # - def list_executions request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workflows::Executions::V1::ListExecutionsRequest - - # Converts hash 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_executions.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::Workflows::Executions::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_executions.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_executions.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @executions_stub.call_rpc :list_executions, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @executions_stub, :list_executions, 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 - - ## - # Creates a new execution using the latest revision of the given workflow. - # - # @overload create_execution(request, options = nil) - # Pass arguments to `create_execution` via a request object, either of type - # {::Google::Cloud::Workflows::Executions::V1::CreateExecutionRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Workflows::Executions::V1::CreateExecutionRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_execution(parent: nil, execution: nil) - # Pass arguments to `create_execution` via keyword arguments. Note that at - # least one keyword argument is 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 workflow for which an execution should be created. - # Format: projects/\\{project}/locations/\\{location}/workflows/\\{workflow} - # The latest revision of the workflow will be used. - # @param execution [::Google::Cloud::Workflows::Executions::V1::Execution, ::Hash] - # Required. Execution to be created. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Workflows::Executions::V1::Execution] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Workflows::Executions::V1::Execution] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/workflows/executions/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Workflows::Executions::V1::Executions::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Workflows::Executions::V1::CreateExecutionRequest.new - # - # # Call the create_execution method. - # result = client.create_execution request - # - # # The returned object is of type Google::Cloud::Workflows::Executions::V1::Execution. - # p result - # - def create_execution request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workflows::Executions::V1::CreateExecutionRequest - - # Converts hash 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_execution.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::Workflows::Executions::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_execution.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_execution.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @executions_stub.call_rpc :create_execution, 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 an execution of the given name. - # - # @overload get_execution(request, options = nil) - # Pass arguments to `get_execution` via a request object, either of type - # {::Google::Cloud::Workflows::Executions::V1::GetExecutionRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Workflows::Executions::V1::GetExecutionRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_execution(name: nil, view: nil) - # Pass arguments to `get_execution` via keyword arguments. Note that at - # least one keyword argument is 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 execution to be retrieved. - # Format: - # projects/\\{project}/locations/\\{location}/workflows/\\{workflow}/executions/\\{execution} - # @param view [::Google::Cloud::Workflows::Executions::V1::ExecutionView] - # Optional. A view defining which fields should be filled in the returned - # execution. The API will default to the FULL view. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Workflows::Executions::V1::Execution] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Workflows::Executions::V1::Execution] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/workflows/executions/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Workflows::Executions::V1::Executions::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Workflows::Executions::V1::GetExecutionRequest.new - # - # # Call the get_execution method. - # result = client.get_execution request - # - # # The returned object is of type Google::Cloud::Workflows::Executions::V1::Execution. - # p result - # - def get_execution request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workflows::Executions::V1::GetExecutionRequest - - # Converts hash 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_execution.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::Workflows::Executions::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_execution.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_execution.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @executions_stub.call_rpc :get_execution, 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 - - ## - # Cancels an execution of the given name. - # - # @overload cancel_execution(request, options = nil) - # Pass arguments to `cancel_execution` via a request object, either of type - # {::Google::Cloud::Workflows::Executions::V1::CancelExecutionRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Workflows::Executions::V1::CancelExecutionRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_execution(name: nil) - # Pass arguments to `cancel_execution` via keyword arguments. Note that at - # least one keyword argument is 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 execution to be cancelled. - # Format: - # projects/\\{project}/locations/\\{location}/workflows/\\{workflow}/executions/\\{execution} - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Workflows::Executions::V1::Execution] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Workflows::Executions::V1::Execution] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/workflows/executions/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Workflows::Executions::V1::Executions::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Workflows::Executions::V1::CancelExecutionRequest.new - # - # # Call the cancel_execution method. - # result = client.cancel_execution request - # - # # The returned object is of type Google::Cloud::Workflows::Executions::V1::Execution. - # p result - # - def cancel_execution request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workflows::Executions::V1::CancelExecutionRequest - - # Converts hash 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_execution.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::Workflows::Executions::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_execution.timeout, - metadata: metadata, - retry_policy: @config.rpcs.cancel_execution.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @executions_stub.call_rpc :cancel_execution, 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 Executions API. - # - # This class represents the configuration for Executions, - # 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::Workflows::Executions::V1::Executions::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_executions to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Workflows::Executions::V1::Executions::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_executions.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Workflows::Executions::V1::Executions::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_executions.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::Workflows::Executions::V1::Executions::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 = "workflowexecutions.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 Executions 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_executions` - # @return [::Gapic::Config::Method] - # - attr_reader :list_executions - ## - # RPC-specific configuration for `create_execution` - # @return [::Gapic::Config::Method] - # - attr_reader :create_execution - ## - # RPC-specific configuration for `get_execution` - # @return [::Gapic::Config::Method] - # - attr_reader :get_execution - ## - # RPC-specific configuration for `cancel_execution` - # @return [::Gapic::Config::Method] - # - attr_reader :cancel_execution - - # @private - def initialize parent_rpcs = nil - list_executions_config = parent_rpcs.list_executions if parent_rpcs.respond_to? :list_executions - @list_executions = ::Gapic::Config::Method.new list_executions_config - create_execution_config = parent_rpcs.create_execution if parent_rpcs.respond_to? :create_execution - @create_execution = ::Gapic::Config::Method.new create_execution_config - get_execution_config = parent_rpcs.get_execution if parent_rpcs.respond_to? :get_execution - @get_execution = ::Gapic::Config::Method.new get_execution_config - cancel_execution_config = parent_rpcs.cancel_execution if parent_rpcs.respond_to? :cancel_execution - @cancel_execution = ::Gapic::Config::Method.new cancel_execution_config - - yield self if block_given? - end - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-workflows-executions-v1/lib/google/cloud/workflows/executions/v1/executions/credentials.rb b/owl-bot-staging/google-cloud-workflows-executions-v1/lib/google/cloud/workflows/executions/v1/executions/credentials.rb deleted file mode 100644 index 6a4511ebd935..000000000000 --- a/owl-bot-staging/google-cloud-workflows-executions-v1/lib/google/cloud/workflows/executions/v1/executions/credentials.rb +++ /dev/null @@ -1,53 +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 Workflows - module Executions - module V1 - module Executions - # Credentials for the Executions API. - class Credentials < ::Google::Auth::Credentials - self.scope = [ - "https://www.googleapis.com/auth/cloud-platform" - ] - self.env_vars = [ - "WORKFLOWS_CREDENTIALS", - "WORKFLOWS_KEYFILE", - "GOOGLE_CLOUD_CREDENTIALS", - "GOOGLE_CLOUD_KEYFILE", - "GCLOUD_KEYFILE", - "WORKFLOWS_CREDENTIALS_JSON", - "WORKFLOWS_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 -end diff --git a/owl-bot-staging/google-cloud-workflows-executions-v1/lib/google/cloud/workflows/executions/v1/executions/paths.rb b/owl-bot-staging/google-cloud-workflows-executions-v1/lib/google/cloud/workflows/executions/v1/executions/paths.rb deleted file mode 100644 index 4cbadc66f285..000000000000 --- a/owl-bot-staging/google-cloud-workflows-executions-v1/lib/google/cloud/workflows/executions/v1/executions/paths.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 Cloud - module Workflows - module Executions - module V1 - module Executions - # Path helper methods for the Executions API. - module Paths - ## - # Create a fully-qualified Execution resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/workflows/{workflow}/executions/{execution}` - # - # @param project [String] - # @param location [String] - # @param workflow [String] - # @param execution [String] - # - # @return [::String] - def execution_path project:, location:, workflow:, execution: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "workflow cannot contain /" if workflow.to_s.include? "/" - - "projects/#{project}/locations/#{location}/workflows/#{workflow}/executions/#{execution}" - end - - ## - # Create a fully-qualified Workflow resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/workflows/{workflow}` - # - # @param project [String] - # @param location [String] - # @param workflow [String] - # - # @return [::String] - def workflow_path project:, location:, workflow: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/workflows/#{workflow}" - end - - extend self - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-workflows-executions-v1/lib/google/cloud/workflows/executions/v1/executions/rest.rb b/owl-bot-staging/google-cloud-workflows-executions-v1/lib/google/cloud/workflows/executions/v1/executions/rest.rb deleted file mode 100644 index 46394ec79f74..000000000000 --- a/owl-bot-staging/google-cloud-workflows-executions-v1/lib/google/cloud/workflows/executions/v1/executions/rest.rb +++ /dev/null @@ -1,55 +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/workflows/executions/v1/version" - -require "google/cloud/workflows/executions/v1/executions/credentials" -require "google/cloud/workflows/executions/v1/executions/paths" -require "google/cloud/workflows/executions/v1/executions/rest/client" - -module Google - module Cloud - module Workflows - module Executions - module V1 - ## - # Executions is used to start and manage running instances of - # [Workflows][google.cloud.workflows.v1.Workflow] called executions. - # - # To load this service and instantiate a REST client: - # - # require "google/cloud/workflows/executions/v1/executions/rest" - # client = ::Google::Cloud::Workflows::Executions::V1::Executions::Rest::Client.new - # - module Executions - # Client for the REST transport - module Rest - end - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "rest", "helpers.rb" -require "google/cloud/workflows/executions/v1/executions/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-workflows-executions-v1/lib/google/cloud/workflows/executions/v1/executions/rest/client.rb b/owl-bot-staging/google-cloud-workflows-executions-v1/lib/google/cloud/workflows/executions/v1/executions/rest/client.rb deleted file mode 100644 index 7fc0368a6891..000000000000 --- a/owl-bot-staging/google-cloud-workflows-executions-v1/lib/google/cloud/workflows/executions/v1/executions/rest/client.rb +++ /dev/null @@ -1,731 +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/workflows/executions/v1/executions_pb" -require "google/cloud/workflows/executions/v1/executions/rest/service_stub" - -module Google - module Cloud - module Workflows - module Executions - module V1 - module Executions - module Rest - ## - # REST client for the Executions service. - # - # Executions is used to start and manage running instances of - # [Workflows][google.cloud.workflows.v1.Workflow] called executions. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "workflowexecutions.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :executions_stub - - ## - # Configure the Executions Client class. - # - # See {::Google::Cloud::Workflows::Executions::V1::Executions::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all Executions clients - # ::Google::Cloud::Workflows::Executions::V1::Executions::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", "Workflows", "Executions", "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 - end - yield @configure if block_given? - @configure - end - - ## - # Configure the Executions 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::Workflows::Executions::V1::Executions::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 - @executions_stub.universe_domain - end - - ## - # Create a new Executions REST client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Workflows::Executions::V1::Executions::Rest::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Workflows::Executions::V1::Executions::Rest::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Executions 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 - - @executions_stub = ::Google::Cloud::Workflows::Executions::V1::Executions::Rest::ServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials, - logger: @config.logger - ) - - @executions_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 - end - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @executions_stub.logger - end - - # Service calls - - ## - # Returns a list of executions which belong to the workflow with - # the given name. The method returns executions of all workflow - # revisions. Returned executions are ordered by their start time (newest - # first). - # - # @overload list_executions(request, options = nil) - # Pass arguments to `list_executions` via a request object, either of type - # {::Google::Cloud::Workflows::Executions::V1::ListExecutionsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Workflows::Executions::V1::ListExecutionsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_executions(parent: nil, page_size: nil, page_token: nil, view: nil, filter: nil, order_by: nil) - # Pass arguments to `list_executions` via keyword arguments. Note that at - # least one keyword argument is 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 workflow for which the executions should be listed. - # Format: projects/\\{project}/locations/\\{location}/workflows/\\{workflow} - # @param page_size [::Integer] - # Maximum number of executions to return per call. - # Max supported value depends on the selected Execution view: it's 1000 for - # BASIC and 100 for FULL. The default value used if the field is not - # specified is 100, regardless of the selected view. Values greater than - # the max value will be coerced down to it. - # @param page_token [::String] - # A page token, received from a previous `ListExecutions` call. - # Provide this to retrieve the subsequent page. - # - # When paginating, all other parameters provided to `ListExecutions` must - # match the call that provided the page token. - # - # Note that pagination is applied to dynamic data. The list of executions - # returned can change between page requests. - # @param view [::Google::Cloud::Workflows::Executions::V1::ExecutionView] - # Optional. A view defining which fields should be filled in the returned - # executions. The API will default to the BASIC view. - # @param filter [::String] - # Optional. Filters applied to the [Executions.ListExecutions] results. - # The following fields are supported for filtering: - # executionID, state, startTime, endTime, duration, workflowRevisionID, - # stepName, and label. - # @param order_by [::String] - # Optional. The ordering applied to the [Executions.ListExecutions] results. - # By default the ordering is based on descending start time. - # The following fields are supported for order by: - # executionID, startTime, endTime, duration, state, and workflowRevisionID. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Workflows::Executions::V1::Execution>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Workflows::Executions::V1::Execution>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/workflows/executions/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Workflows::Executions::V1::Executions::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Workflows::Executions::V1::ListExecutionsRequest.new - # - # # Call the list_executions method. - # result = client.list_executions 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::Workflows::Executions::V1::Execution. - # p item - # end - # - def list_executions request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workflows::Executions::V1::ListExecutionsRequest - - # Converts hash 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_executions.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::Workflows::Executions::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_executions.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_executions.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @executions_stub.list_executions request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @executions_stub, :list_executions, "executions", 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 - - ## - # Creates a new execution using the latest revision of the given workflow. - # - # @overload create_execution(request, options = nil) - # Pass arguments to `create_execution` via a request object, either of type - # {::Google::Cloud::Workflows::Executions::V1::CreateExecutionRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Workflows::Executions::V1::CreateExecutionRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_execution(parent: nil, execution: nil) - # Pass arguments to `create_execution` via keyword arguments. Note that at - # least one keyword argument is 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 workflow for which an execution should be created. - # Format: projects/\\{project}/locations/\\{location}/workflows/\\{workflow} - # The latest revision of the workflow will be used. - # @param execution [::Google::Cloud::Workflows::Executions::V1::Execution, ::Hash] - # Required. Execution to be created. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Workflows::Executions::V1::Execution] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Workflows::Executions::V1::Execution] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/workflows/executions/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Workflows::Executions::V1::Executions::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Workflows::Executions::V1::CreateExecutionRequest.new - # - # # Call the create_execution method. - # result = client.create_execution request - # - # # The returned object is of type Google::Cloud::Workflows::Executions::V1::Execution. - # p result - # - def create_execution request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workflows::Executions::V1::CreateExecutionRequest - - # Converts hash 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_execution.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::Workflows::Executions::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_execution.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_execution.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @executions_stub.create_execution 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 an execution of the given name. - # - # @overload get_execution(request, options = nil) - # Pass arguments to `get_execution` via a request object, either of type - # {::Google::Cloud::Workflows::Executions::V1::GetExecutionRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Workflows::Executions::V1::GetExecutionRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_execution(name: nil, view: nil) - # Pass arguments to `get_execution` via keyword arguments. Note that at - # least one keyword argument is 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 execution to be retrieved. - # Format: - # projects/\\{project}/locations/\\{location}/workflows/\\{workflow}/executions/\\{execution} - # @param view [::Google::Cloud::Workflows::Executions::V1::ExecutionView] - # Optional. A view defining which fields should be filled in the returned - # execution. The API will default to the FULL view. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Workflows::Executions::V1::Execution] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Workflows::Executions::V1::Execution] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/workflows/executions/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Workflows::Executions::V1::Executions::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Workflows::Executions::V1::GetExecutionRequest.new - # - # # Call the get_execution method. - # result = client.get_execution request - # - # # The returned object is of type Google::Cloud::Workflows::Executions::V1::Execution. - # p result - # - def get_execution request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workflows::Executions::V1::GetExecutionRequest - - # Converts hash 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_execution.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::Workflows::Executions::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_execution.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_execution.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @executions_stub.get_execution 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 - - ## - # Cancels an execution of the given name. - # - # @overload cancel_execution(request, options = nil) - # Pass arguments to `cancel_execution` via a request object, either of type - # {::Google::Cloud::Workflows::Executions::V1::CancelExecutionRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Workflows::Executions::V1::CancelExecutionRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_execution(name: nil) - # Pass arguments to `cancel_execution` via keyword arguments. Note that at - # least one keyword argument is 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 execution to be cancelled. - # Format: - # projects/\\{project}/locations/\\{location}/workflows/\\{workflow}/executions/\\{execution} - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Workflows::Executions::V1::Execution] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Workflows::Executions::V1::Execution] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/workflows/executions/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Workflows::Executions::V1::Executions::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Workflows::Executions::V1::CancelExecutionRequest.new - # - # # Call the cancel_execution method. - # result = client.cancel_execution request - # - # # The returned object is of type Google::Cloud::Workflows::Executions::V1::Execution. - # p result - # - def cancel_execution request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workflows::Executions::V1::CancelExecutionRequest - - # Converts hash 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_execution.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::Workflows::Executions::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_execution.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.cancel_execution.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @executions_stub.cancel_execution 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 Executions REST API. - # - # This class represents the configuration for Executions 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::Workflows::Executions::V1::Executions::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_executions to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Workflows::Executions::V1::Executions::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_executions.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Workflows::Executions::V1::Executions::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_executions.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 = "workflowexecutions.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 Executions 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_executions` - # @return [::Gapic::Config::Method] - # - attr_reader :list_executions - ## - # RPC-specific configuration for `create_execution` - # @return [::Gapic::Config::Method] - # - attr_reader :create_execution - ## - # RPC-specific configuration for `get_execution` - # @return [::Gapic::Config::Method] - # - attr_reader :get_execution - ## - # RPC-specific configuration for `cancel_execution` - # @return [::Gapic::Config::Method] - # - attr_reader :cancel_execution - - # @private - def initialize parent_rpcs = nil - list_executions_config = parent_rpcs.list_executions if parent_rpcs.respond_to? :list_executions - @list_executions = ::Gapic::Config::Method.new list_executions_config - create_execution_config = parent_rpcs.create_execution if parent_rpcs.respond_to? :create_execution - @create_execution = ::Gapic::Config::Method.new create_execution_config - get_execution_config = parent_rpcs.get_execution if parent_rpcs.respond_to? :get_execution - @get_execution = ::Gapic::Config::Method.new get_execution_config - cancel_execution_config = parent_rpcs.cancel_execution if parent_rpcs.respond_to? :cancel_execution - @cancel_execution = ::Gapic::Config::Method.new cancel_execution_config - - yield self if block_given? - end - end - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-workflows-executions-v1/lib/google/cloud/workflows/executions/v1/executions/rest/service_stub.rb b/owl-bot-staging/google-cloud-workflows-executions-v1/lib/google/cloud/workflows/executions/v1/executions/rest/service_stub.rb deleted file mode 100644 index 5c82daaa16de..000000000000 --- a/owl-bot-staging/google-cloud-workflows-executions-v1/lib/google/cloud/workflows/executions/v1/executions/rest/service_stub.rb +++ /dev/null @@ -1,329 +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/workflows/executions/v1/executions_pb" - -module Google - module Cloud - module Workflows - module Executions - module V1 - module Executions - module Rest - ## - # REST service stub for the Executions 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: false, - 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_executions REST call - # - # @param request_pb [::Google::Cloud::Workflows::Executions::V1::ListExecutionsRequest] - # 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::Workflows::Executions::V1::ListExecutionsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Workflows::Executions::V1::ListExecutionsResponse] - # A result object deserialized from the server's reply - def list_executions request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_executions_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_executions", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Workflows::Executions::V1::ListExecutionsResponse.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_execution REST call - # - # @param request_pb [::Google::Cloud::Workflows::Executions::V1::CreateExecutionRequest] - # 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::Workflows::Executions::V1::Execution] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Workflows::Executions::V1::Execution] - # A result object deserialized from the server's reply - def create_execution request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_execution_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_execution", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Workflows::Executions::V1::Execution.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_execution REST call - # - # @param request_pb [::Google::Cloud::Workflows::Executions::V1::GetExecutionRequest] - # 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::Workflows::Executions::V1::Execution] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Workflows::Executions::V1::Execution] - # A result object deserialized from the server's reply - def get_execution request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_execution_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_execution", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Workflows::Executions::V1::Execution.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_execution REST call - # - # @param request_pb [::Google::Cloud::Workflows::Executions::V1::CancelExecutionRequest] - # 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::Workflows::Executions::V1::Execution] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Workflows::Executions::V1::Execution] - # A result object deserialized from the server's reply - def cancel_execution request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_cancel_execution_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_execution", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Workflows::Executions::V1::Execution.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_executions REST call - # - # @param request_pb [::Google::Cloud::Workflows::Executions::V1::ListExecutionsRequest] - # 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_executions_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/executions", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/workflows/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the create_execution REST call - # - # @param request_pb [::Google::Cloud::Workflows::Executions::V1::CreateExecutionRequest] - # 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_execution_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}/executions", - body: "execution", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/workflows/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_execution REST call - # - # @param request_pb [::Google::Cloud::Workflows::Executions::V1::GetExecutionRequest] - # 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_execution_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/workflows/[^/]+/executions/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the cancel_execution REST call - # - # @param request_pb [::Google::Cloud::Workflows::Executions::V1::CancelExecutionRequest] - # 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_execution_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:cancel", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/workflows/[^/]+/executions/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-workflows-executions-v1/lib/google/cloud/workflows/executions/v1/executions_pb.rb b/owl-bot-staging/google-cloud-workflows-executions-v1/lib/google/cloud/workflows/executions/v1/executions_pb.rb deleted file mode 100644 index 58e6055652da..000000000000 --- a/owl-bot-staging/google-cloud-workflows-executions-v1/lib/google/cloud/workflows/executions/v1/executions_pb.rb +++ /dev/null @@ -1,46 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/workflows/executions/v1/executions.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/duration_pb' -require 'google/protobuf/timestamp_pb' - - -descriptor_data = "\n5google/cloud/workflows/executions/v1/executions.proto\x12$google.cloud.workflows.executions.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xbd\x0e\n\tExecution\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x33\n\nstart_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x31\n\x08\x65nd_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x30\n\x08\x64uration\x18\x0c \x01(\x0b\x32\x19.google.protobuf.DurationB\x03\xe0\x41\x03\x12I\n\x05state\x18\x04 \x01(\x0e\x32\x35.google.cloud.workflows.executions.v1.Execution.StateB\x03\xe0\x41\x03\x12\x10\n\x08\x61rgument\x18\x05 \x01(\t\x12\x13\n\x06result\x18\x06 \x01(\tB\x03\xe0\x41\x03\x12I\n\x05\x65rror\x18\x07 \x01(\x0b\x32\x35.google.cloud.workflows.executions.v1.Execution.ErrorB\x03\xe0\x41\x03\x12!\n\x14workflow_revision_id\x18\x08 \x01(\tB\x03\xe0\x41\x03\x12T\n\x0e\x63\x61ll_log_level\x18\t \x01(\x0e\x32<.google.cloud.workflows.executions.v1.Execution.CallLogLevel\x12K\n\x06status\x18\n \x01(\x0b\x32\x36.google.cloud.workflows.executions.v1.Execution.StatusB\x03\xe0\x41\x03\x12K\n\x06labels\x18\x0b \x03(\x0b\x32;.google.cloud.workflows.executions.v1.Execution.LabelsEntry\x12T\n\x0bstate_error\x18\r \x01(\x0b\x32:.google.cloud.workflows.executions.v1.Execution.StateErrorB\x03\xe0\x41\x03\x1a\xca\x01\n\x11StackTraceElement\x12\x0c\n\x04step\x18\x01 \x01(\t\x12\x0f\n\x07routine\x18\x02 \x01(\t\x12\\\n\x08position\x18\x03 \x01(\x0b\x32J.google.cloud.workflows.executions.v1.Execution.StackTraceElement.Position\x1a\x38\n\x08Position\x12\x0c\n\x04line\x18\x01 \x01(\x03\x12\x0e\n\x06\x63olumn\x18\x02 \x01(\x03\x12\x0e\n\x06length\x18\x03 \x01(\x03\x1a\x61\n\nStackTrace\x12S\n\x08\x65lements\x18\x01 \x03(\x0b\x32\x41.google.cloud.workflows.executions.v1.Execution.StackTraceElement\x1az\n\x05\x45rror\x12\x0f\n\x07payload\x18\x01 \x01(\t\x12\x0f\n\x07\x63ontext\x18\x02 \x01(\t\x12O\n\x0bstack_trace\x18\x03 \x01(\x0b\x32:.google.cloud.workflows.executions.v1.Execution.StackTrace\x1a\x83\x01\n\x06Status\x12R\n\rcurrent_steps\x18\x01 \x03(\x0b\x32;.google.cloud.workflows.executions.v1.Execution.Status.Step\x1a%\n\x04Step\x12\x0f\n\x07routine\x18\x01 \x01(\t\x12\x0c\n\x04step\x18\x02 \x01(\t\x1a\x99\x01\n\nStateError\x12\x0f\n\x07\x64\x65tails\x18\x01 \x01(\t\x12M\n\x04type\x18\x02 \x01(\x0e\x32?.google.cloud.workflows.executions.v1.Execution.StateError.Type\"+\n\x04Type\x12\x14\n\x10TYPE_UNSPECIFIED\x10\x00\x12\r\n\tKMS_ERROR\x10\x01\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"q\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\n\n\x06\x41\x43TIVE\x10\x01\x12\r\n\tSUCCEEDED\x10\x02\x12\n\n\x06\x46\x41ILED\x10\x03\x12\r\n\tCANCELLED\x10\x04\x12\x0f\n\x0bUNAVAILABLE\x10\x05\x12\n\n\x06QUEUED\x10\x06\"d\n\x0c\x43\x61llLogLevel\x12\x1e\n\x1a\x43\x41LL_LOG_LEVEL_UNSPECIFIED\x10\x00\x12\x11\n\rLOG_ALL_CALLS\x10\x01\x12\x13\n\x0fLOG_ERRORS_ONLY\x10\x02\x12\x0c\n\x08LOG_NONE\x10\x03:\x86\x01\xea\x41\x82\x01\n+workflowexecutions.googleapis.com/Execution\x12Sprojects/{project}/locations/{location}/workflows/{workflow}/executions/{execution}\"\xed\x01\n\x15ListExecutionsRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!workflows.googleapis.com/Workflow\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\x12\x46\n\x04view\x18\x04 \x01(\x0e\x32\x33.google.cloud.workflows.executions.v1.ExecutionViewB\x03\xe0\x41\x01\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\"v\n\x16ListExecutionsResponse\x12\x43\n\nexecutions\x18\x01 \x03(\x0b\x32/.google.cloud.workflows.executions.v1.Execution\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\x9c\x01\n\x16\x43reateExecutionRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!workflows.googleapis.com/Workflow\x12G\n\texecution\x18\x02 \x01(\x0b\x32/.google.cloud.workflows.executions.v1.ExecutionB\x03\xe0\x41\x02\"\xa0\x01\n\x13GetExecutionRequest\x12\x41\n\x04name\x18\x01 \x01(\tB3\xe0\x41\x02\xfa\x41-\n+workflowexecutions.googleapis.com/Execution\x12\x46\n\x04view\x18\x02 \x01(\x0e\x32\x33.google.cloud.workflows.executions.v1.ExecutionViewB\x03\xe0\x41\x01\"[\n\x16\x43\x61ncelExecutionRequest\x12\x41\n\x04name\x18\x01 \x01(\tB3\xe0\x41\x02\xfa\x41-\n+workflowexecutions.googleapis.com/Execution*D\n\rExecutionView\x12\x1e\n\x1a\x45XECUTION_VIEW_UNSPECIFIED\x10\x00\x12\t\n\x05\x42\x41SIC\x10\x01\x12\x08\n\x04\x46ULL\x10\x02\x32\xc3\x07\n\nExecutions\x12\xd8\x01\n\x0eListExecutions\x12;.google.cloud.workflows.executions.v1.ListExecutionsRequest\x1a<.google.cloud.workflows.executions.v1.ListExecutionsResponse\"K\xda\x41\x06parent\x82\xd3\xe4\x93\x02<\x12:/v1/{parent=projects/*/locations/*/workflows/*}/executions\x12\xe2\x01\n\x0f\x43reateExecution\x12<.google.cloud.workflows.executions.v1.CreateExecutionRequest\x1a/.google.cloud.workflows.executions.v1.Execution\"`\xda\x41\x10parent,execution\x82\xd3\xe4\x93\x02G\":/v1/{parent=projects/*/locations/*/workflows/*}/executions:\texecution\x12\xc5\x01\n\x0cGetExecution\x12\x39.google.cloud.workflows.executions.v1.GetExecutionRequest\x1a/.google.cloud.workflows.executions.v1.Execution\"I\xda\x41\x04name\x82\xd3\xe4\x93\x02<\x12:/v1/{name=projects/*/locations/*/workflows/*/executions/*}\x12\xd5\x01\n\x0f\x43\x61ncelExecution\x12<.google.cloud.workflows.executions.v1.CancelExecutionRequest\x1a/.google.cloud.workflows.executions.v1.Execution\"S\xda\x41\x04name\x82\xd3\xe4\x93\x02\x46\"A/v1/{name=projects/*/locations/*/workflows/*/executions/*}:cancel:\x01*\x1aU\xca\x41!workflowexecutions.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\xeb\x01\n(com.google.cloud.workflows.executions.v1B\x0f\x45xecutionsProtoP\x01ZHcloud.google.com/go/workflows/executions/apiv1/executionspb;executionspb\xea\x41\x61\n!workflows.googleapis.com/Workflow\x12] - # 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. - # - # Note: This field should not be used in most cases. - 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: - # library_settings: - # 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. - # @!attribute [rw] library_package - # @return [::String] - # The package name to use in Php. Clobbers the php_namespace option - # set in the protobuf. This should be used **only** by APIs - # who have already set the language_settings.php.package_name" field - # in gapic.yaml. API teams should use the protobuf php_namespace option - # where possible. - # - # Example of a YAML configuration:: - # - # publishing: - # library_settings: - # php_settings: - # library_package: Google\Cloud\PubSub\V1 - 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. - # - # Example: - # - # 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 - # @!attribute [rw] batching - # @return [::Google::Api::BatchingConfigProto] - # Batching configuration for an API method in client libraries. - # - # Example of a YAML configuration: - # - # publishing: - # method_settings: - # - selector: google.example.v1.ExampleService.BatchCreateExample - # batching: - # element_count_threshold: 1000 - # request_byte_threshold: 100000000 - # delay_threshold_millis: 10 - 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. - # - # Note: This feature should not be used in most cases. - # @!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 - - # `BatchingConfigProto` defines the batching configuration for an API method. - # @!attribute [rw] thresholds - # @return [::Google::Api::BatchingSettingsProto] - # The thresholds which trigger a batched request to be sent. - # @!attribute [rw] batch_descriptor - # @return [::Google::Api::BatchingDescriptorProto] - # The request and response fields used in batching. - class BatchingConfigProto - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # `BatchingSettingsProto` specifies a set of batching thresholds, each of - # which acts as a trigger to send a batch of messages as a request. At least - # one threshold must be positive nonzero. - # @!attribute [rw] element_count_threshold - # @return [::Integer] - # The number of elements of a field collected into a batch which, if - # exceeded, causes the batch to be sent. - # @!attribute [rw] request_byte_threshold - # @return [::Integer] - # The aggregated size of the batched field which, if exceeded, causes the - # batch to be sent. This size is computed by aggregating the sizes of the - # request field to be batched, not of the entire request message. - # @!attribute [rw] delay_threshold - # @return [::Google::Protobuf::Duration] - # The duration after which a batch should be sent, starting from the addition - # of the first message to that batch. - # @!attribute [rw] element_count_limit - # @return [::Integer] - # The maximum number of elements collected in a batch that could be accepted - # by server. - # @!attribute [rw] request_byte_limit - # @return [::Integer] - # The maximum size of the request that could be accepted by server. - # @!attribute [rw] flow_control_element_limit - # @return [::Integer] - # The maximum number of elements allowed by flow control. - # @!attribute [rw] flow_control_byte_limit - # @return [::Integer] - # The maximum size of data allowed by flow control. - # @!attribute [rw] flow_control_limit_exceeded_behavior - # @return [::Google::Api::FlowControlLimitExceededBehaviorProto] - # The behavior to take when the flow control limit is exceeded. - class BatchingSettingsProto - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # `BatchingDescriptorProto` specifies the fields of the request message to be - # used for batching, and, optionally, the fields of the response message to be - # used for demultiplexing. - # @!attribute [rw] batched_field - # @return [::String] - # The repeated field in the request message to be aggregated by batching. - # @!attribute [rw] discriminator_fields - # @return [::Array<::String>] - # A list of the fields in the request message. Two requests will be batched - # together only if the values of every field specified in - # `request_discriminator_fields` is equal between the two requests. - # @!attribute [rw] subresponse_field - # @return [::String] - # Optional. When present, indicates the field in the response message to be - # used to demultiplex the response into multiple response messages, in - # correspondence with the multiple request messages originally batched - # together. - class BatchingDescriptorProto - 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 - - # The behavior to take when the flow control limit is exceeded. - module FlowControlLimitExceededBehaviorProto - # Default behavior, system-defined. - UNSET_BEHAVIOR = 0 - - # Stop operation, raise error. - THROW_EXCEPTION = 1 - - # Pause operation until limit clears. - BLOCK = 2 - - # Continue operation, disregard limit. - IGNORE = 3 - end - end -end diff --git a/owl-bot-staging/google-cloud-workflows-executions-v1/proto_docs/google/api/field_behavior.rb b/owl-bot-staging/google-cloud-workflows-executions-v1/proto_docs/google/api/field_behavior.rb deleted file mode 100644 index 582be187d115..000000000000 --- a/owl-bot-staging/google-cloud-workflows-executions-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-workflows-executions-v1/proto_docs/google/api/launch_stage.rb b/owl-bot-staging/google-cloud-workflows-executions-v1/proto_docs/google/api/launch_stage.rb deleted file mode 100644 index 9392a413fb1b..000000000000 --- a/owl-bot-staging/google-cloud-workflows-executions-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-workflows-executions-v1/proto_docs/google/api/resource.rb b/owl-bot-staging/google-cloud-workflows-executions-v1/proto_docs/google/api/resource.rb deleted file mode 100644 index 25dec4847ac1..000000000000 --- a/owl-bot-staging/google-cloud-workflows-executions-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-workflows-executions-v1/proto_docs/google/cloud/workflows/executions/v1/executions.rb b/owl-bot-staging/google-cloud-workflows-executions-v1/proto_docs/google/cloud/workflows/executions/v1/executions.rb deleted file mode 100644 index 857f5d110040..000000000000 --- a/owl-bot-staging/google-cloud-workflows-executions-v1/proto_docs/google/cloud/workflows/executions/v1/executions.rb +++ /dev/null @@ -1,369 +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 Workflows - module Executions - module V1 - # A running instance of a - # [Workflow](/workflows/docs/reference/rest/v1/projects.locations.workflows). - # @!attribute [r] name - # @return [::String] - # Output only. The resource name of the execution. - # Format: - # projects/\\{project}/locations/\\{location}/workflows/\\{workflow}/executions/\\{execution} - # @!attribute [r] start_time - # @return [::Google::Protobuf::Timestamp] - # Output only. Marks the beginning of execution. - # @!attribute [r] end_time - # @return [::Google::Protobuf::Timestamp] - # Output only. Marks the end of execution, successful or not. - # @!attribute [r] duration - # @return [::Google::Protobuf::Duration] - # Output only. Measures the duration of the execution. - # @!attribute [r] state - # @return [::Google::Cloud::Workflows::Executions::V1::Execution::State] - # Output only. Current state of the execution. - # @!attribute [rw] argument - # @return [::String] - # Input parameters of the execution represented as a JSON string. - # The size limit is 32KB. - # - # *Note*: If you are using the REST API directly to run your workflow, you - # must escape any JSON string value of `argument`. Example: - # `'{"argument":"{\"firstName\":\"FIRST\",\"lastName\":\"LAST\"}"}'` - # @!attribute [r] result - # @return [::String] - # Output only. Output of the execution represented as a JSON string. The - # value can only be present if the execution's state is `SUCCEEDED`. - # @!attribute [r] error - # @return [::Google::Cloud::Workflows::Executions::V1::Execution::Error] - # Output only. The error which caused the execution to finish prematurely. - # The value is only present if the execution's state is `FAILED` - # or `CANCELLED`. - # @!attribute [r] workflow_revision_id - # @return [::String] - # Output only. Revision of the workflow this execution is using. - # @!attribute [rw] call_log_level - # @return [::Google::Cloud::Workflows::Executions::V1::Execution::CallLogLevel] - # The call logging level associated to this execution. - # @!attribute [r] status - # @return [::Google::Cloud::Workflows::Executions::V1::Execution::Status] - # Output only. Status tracks the current steps and progress data of this - # execution. - # @!attribute [rw] labels - # @return [::Google::Protobuf::Map{::String => ::String}] - # Labels associated with this execution. - # Labels can contain at most 64 entries. Keys and values can be no longer - # than 63 characters and can only contain lowercase letters, numeric - # characters, underscores, and dashes. Label keys must start with a letter. - # International characters are allowed. - # By default, labels are inherited from the workflow but are overridden by - # any labels associated with the execution. - # @!attribute [r] state_error - # @return [::Google::Cloud::Workflows::Executions::V1::Execution::StateError] - # Output only. Error regarding the state of the Execution resource. For - # example, this field will have error details if the execution data is - # unavailable due to revoked KMS key permissions. - class Execution - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # A single stack element (frame) where an error occurred. - # @!attribute [rw] step - # @return [::String] - # The step the error occurred at. - # @!attribute [rw] routine - # @return [::String] - # The routine where the error occurred. - # @!attribute [rw] position - # @return [::Google::Cloud::Workflows::Executions::V1::Execution::StackTraceElement::Position] - # The source position information of the stack trace element. - class StackTraceElement - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Position contains source position information about the stack trace - # element such as line number, column number and length of the code block - # in bytes. - # @!attribute [rw] line - # @return [::Integer] - # The source code line number the current instruction was generated from. - # @!attribute [rw] column - # @return [::Integer] - # The source code column position (of the line) the current instruction - # was generated from. - # @!attribute [rw] length - # @return [::Integer] - # The number of bytes of source code making up this stack trace element. - class Position - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # A collection of stack elements (frames) where an error occurred. - # @!attribute [rw] elements - # @return [::Array<::Google::Cloud::Workflows::Executions::V1::Execution::StackTraceElement>] - # An array of stack elements. - class StackTrace - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Error describes why the execution was abnormally terminated. - # @!attribute [rw] payload - # @return [::String] - # Error message and data returned represented as a JSON string. - # @!attribute [rw] context - # @return [::String] - # Human-readable stack trace string. - # @!attribute [rw] stack_trace - # @return [::Google::Cloud::Workflows::Executions::V1::Execution::StackTrace] - # Stack trace with detailed information of where error was generated. - class Error - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Represents the current status of this execution. - # @!attribute [rw] current_steps - # @return [::Array<::Google::Cloud::Workflows::Executions::V1::Execution::Status::Step>] - # A list of currently executing or last executed step names for the - # workflow execution currently running. If the workflow has succeeded or - # failed, this is the last attempted or executed step. Presently, if the - # current step is inside a subworkflow, the list only includes that step. - # In the future, the list will contain items for each step in the call - # stack, starting with the outermost step in the `main` subworkflow, and - # ending with the most deeply nested step. - class Status - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Represents a step of the workflow this execution is running. - # @!attribute [rw] routine - # @return [::String] - # Name of a routine within the workflow. - # @!attribute [rw] step - # @return [::String] - # Name of a step within the routine. - class Step - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # Describes an error related to the current state of the Execution resource. - # @!attribute [rw] details - # @return [::String] - # Provides specifics about the error. - # @!attribute [rw] type - # @return [::Google::Cloud::Workflows::Executions::V1::Execution::StateError::Type] - # The type of this state error. - class StateError - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Describes the possible types of a state error. - module Type - # No type specified. - TYPE_UNSPECIFIED = 0 - - # Caused by an issue with KMS. - KMS_ERROR = 1 - end - end - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class LabelsEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Describes the current state of the execution. More states might be added - # in the future. - module State - # Invalid state. - STATE_UNSPECIFIED = 0 - - # The execution is in progress. - ACTIVE = 1 - - # The execution finished successfully. - SUCCEEDED = 2 - - # The execution failed with an error. - FAILED = 3 - - # The execution was stopped intentionally. - CANCELLED = 4 - - # Execution data is unavailable. See the `state_error` field. - UNAVAILABLE = 5 - - # Request has been placed in the backlog for processing at a later time. - QUEUED = 6 - end - - # Describes the level of platform logging to apply to calls and call - # responses during workflow executions. - module CallLogLevel - # No call logging level specified. - CALL_LOG_LEVEL_UNSPECIFIED = 0 - - # Log all call steps within workflows, all call returns, and all exceptions - # raised. - LOG_ALL_CALLS = 1 - - # Log only exceptions that are raised from call steps within workflows. - LOG_ERRORS_ONLY = 2 - - # Explicitly log nothing. - LOG_NONE = 3 - end - end - - # Request for the - # [ListExecutions][] - # method. - # @!attribute [rw] parent - # @return [::String] - # Required. Name of the workflow for which the executions should be listed. - # Format: projects/\\{project}/locations/\\{location}/workflows/\\{workflow} - # @!attribute [rw] page_size - # @return [::Integer] - # Maximum number of executions to return per call. - # Max supported value depends on the selected Execution view: it's 1000 for - # BASIC and 100 for FULL. The default value used if the field is not - # specified is 100, regardless of the selected view. Values greater than - # the max value will be coerced down to it. - # @!attribute [rw] page_token - # @return [::String] - # A page token, received from a previous `ListExecutions` call. - # Provide this to retrieve the subsequent page. - # - # When paginating, all other parameters provided to `ListExecutions` must - # match the call that provided the page token. - # - # Note that pagination is applied to dynamic data. The list of executions - # returned can change between page requests. - # @!attribute [rw] view - # @return [::Google::Cloud::Workflows::Executions::V1::ExecutionView] - # Optional. A view defining which fields should be filled in the returned - # executions. The API will default to the BASIC view. - # @!attribute [rw] filter - # @return [::String] - # Optional. Filters applied to the [Executions.ListExecutions] results. - # The following fields are supported for filtering: - # executionID, state, startTime, endTime, duration, workflowRevisionID, - # stepName, and label. - # @!attribute [rw] order_by - # @return [::String] - # Optional. The ordering applied to the [Executions.ListExecutions] results. - # By default the ordering is based on descending start time. - # The following fields are supported for order by: - # executionID, startTime, endTime, duration, state, and workflowRevisionID. - class ListExecutionsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response for the - # {::Google::Cloud::Workflows::Executions::V1::Executions::Client#list_executions ListExecutions} - # method. - # @!attribute [rw] executions - # @return [::Array<::Google::Cloud::Workflows::Executions::V1::Execution>] - # The executions which match the request. - # @!attribute [rw] next_page_token - # @return [::String] - # A token, which can be sent as `page_token` to retrieve the next page. - # If this field is omitted, there are no subsequent pages. - class ListExecutionsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request for the - # {::Google::Cloud::Workflows::Executions::V1::Executions::Client#create_execution CreateExecution} - # method. - # @!attribute [rw] parent - # @return [::String] - # Required. Name of the workflow for which an execution should be created. - # Format: projects/\\{project}/locations/\\{location}/workflows/\\{workflow} - # The latest revision of the workflow will be used. - # @!attribute [rw] execution - # @return [::Google::Cloud::Workflows::Executions::V1::Execution] - # Required. Execution to be created. - class CreateExecutionRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request for the - # {::Google::Cloud::Workflows::Executions::V1::Executions::Client#get_execution GetExecution} - # method. - # @!attribute [rw] name - # @return [::String] - # Required. Name of the execution to be retrieved. - # Format: - # projects/\\{project}/locations/\\{location}/workflows/\\{workflow}/executions/\\{execution} - # @!attribute [rw] view - # @return [::Google::Cloud::Workflows::Executions::V1::ExecutionView] - # Optional. A view defining which fields should be filled in the returned - # execution. The API will default to the FULL view. - class GetExecutionRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request for the - # {::Google::Cloud::Workflows::Executions::V1::Executions::Client#cancel_execution CancelExecution} - # method. - # @!attribute [rw] name - # @return [::String] - # Required. Name of the execution to be cancelled. - # Format: - # projects/\\{project}/locations/\\{location}/workflows/\\{workflow}/executions/\\{execution} - class CancelExecutionRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Defines possible views for execution resource. - module ExecutionView - # The default / unset value. - EXECUTION_VIEW_UNSPECIFIED = 0 - - # Includes only basic metadata about the execution. - # The following fields are returned: name, start_time, end_time, duration, - # state, and workflow_revision_id. - BASIC = 1 - - # Includes all data. - FULL = 2 - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-workflows-executions-v1/proto_docs/google/protobuf/duration.rb b/owl-bot-staging/google-cloud-workflows-executions-v1/proto_docs/google/protobuf/duration.rb deleted file mode 100644 index ea59f1f91daf..000000000000 --- a/owl-bot-staging/google-cloud-workflows-executions-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-workflows-executions-v1/proto_docs/google/protobuf/timestamp.rb b/owl-bot-staging/google-cloud-workflows-executions-v1/proto_docs/google/protobuf/timestamp.rb deleted file mode 100644 index 74352be9c58c..000000000000 --- a/owl-bot-staging/google-cloud-workflows-executions-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-workflows-executions-v1/snippets/Gemfile b/owl-bot-staging/google-cloud-workflows-executions-v1/snippets/Gemfile deleted file mode 100644 index 7daeaea34a37..000000000000 --- a/owl-bot-staging/google-cloud-workflows-executions-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-workflows-executions-v1", path: "../" -else - gem "google-cloud-workflows-executions-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-workflows-executions-v1/snippets/executions/cancel_execution.rb b/owl-bot-staging/google-cloud-workflows-executions-v1/snippets/executions/cancel_execution.rb deleted file mode 100644 index 62751576d96a..000000000000 --- a/owl-bot-staging/google-cloud-workflows-executions-v1/snippets/executions/cancel_execution.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 workflowexecutions_v1_generated_Executions_CancelExecution_sync] -require "google/cloud/workflows/executions/v1" - -## -# Snippet for the cancel_execution call in the Executions 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::Workflows::Executions::V1::Executions::Client#cancel_execution. -# -def cancel_execution - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Workflows::Executions::V1::Executions::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Workflows::Executions::V1::CancelExecutionRequest.new - - # Call the cancel_execution method. - result = client.cancel_execution request - - # The returned object is of type Google::Cloud::Workflows::Executions::V1::Execution. - p result -end -# [END workflowexecutions_v1_generated_Executions_CancelExecution_sync] diff --git a/owl-bot-staging/google-cloud-workflows-executions-v1/snippets/executions/create_execution.rb b/owl-bot-staging/google-cloud-workflows-executions-v1/snippets/executions/create_execution.rb deleted file mode 100644 index e18a26220cc7..000000000000 --- a/owl-bot-staging/google-cloud-workflows-executions-v1/snippets/executions/create_execution.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 workflowexecutions_v1_generated_Executions_CreateExecution_sync] -require "google/cloud/workflows/executions/v1" - -## -# Snippet for the create_execution call in the Executions 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::Workflows::Executions::V1::Executions::Client#create_execution. -# -def create_execution - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Workflows::Executions::V1::Executions::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Workflows::Executions::V1::CreateExecutionRequest.new - - # Call the create_execution method. - result = client.create_execution request - - # The returned object is of type Google::Cloud::Workflows::Executions::V1::Execution. - p result -end -# [END workflowexecutions_v1_generated_Executions_CreateExecution_sync] diff --git a/owl-bot-staging/google-cloud-workflows-executions-v1/snippets/executions/get_execution.rb b/owl-bot-staging/google-cloud-workflows-executions-v1/snippets/executions/get_execution.rb deleted file mode 100644 index 606f5d673467..000000000000 --- a/owl-bot-staging/google-cloud-workflows-executions-v1/snippets/executions/get_execution.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 workflowexecutions_v1_generated_Executions_GetExecution_sync] -require "google/cloud/workflows/executions/v1" - -## -# Snippet for the get_execution call in the Executions 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::Workflows::Executions::V1::Executions::Client#get_execution. -# -def get_execution - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Workflows::Executions::V1::Executions::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Workflows::Executions::V1::GetExecutionRequest.new - - # Call the get_execution method. - result = client.get_execution request - - # The returned object is of type Google::Cloud::Workflows::Executions::V1::Execution. - p result -end -# [END workflowexecutions_v1_generated_Executions_GetExecution_sync] diff --git a/owl-bot-staging/google-cloud-workflows-executions-v1/snippets/executions/list_executions.rb b/owl-bot-staging/google-cloud-workflows-executions-v1/snippets/executions/list_executions.rb deleted file mode 100644 index 71b5474a1300..000000000000 --- a/owl-bot-staging/google-cloud-workflows-executions-v1/snippets/executions/list_executions.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 workflowexecutions_v1_generated_Executions_ListExecutions_sync] -require "google/cloud/workflows/executions/v1" - -## -# Snippet for the list_executions call in the Executions 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::Workflows::Executions::V1::Executions::Client#list_executions. -# -def list_executions - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Workflows::Executions::V1::Executions::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Workflows::Executions::V1::ListExecutionsRequest.new - - # Call the list_executions method. - result = client.list_executions 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::Workflows::Executions::V1::Execution. - p item - end -end -# [END workflowexecutions_v1_generated_Executions_ListExecutions_sync] diff --git a/owl-bot-staging/google-cloud-workflows-executions-v1/snippets/snippet_metadata_google.cloud.workflows.executions.v1.json b/owl-bot-staging/google-cloud-workflows-executions-v1/snippets/snippet_metadata_google.cloud.workflows.executions.v1.json deleted file mode 100644 index 8484d092b98b..000000000000 --- a/owl-bot-staging/google-cloud-workflows-executions-v1/snippets/snippet_metadata_google.cloud.workflows.executions.v1.json +++ /dev/null @@ -1,175 +0,0 @@ -{ - "client_library": { - "name": "google-cloud-workflows-executions-v1", - "version": "", - "language": "RUBY", - "apis": [ - { - "id": "google.cloud.workflows.executions.v1", - "version": "v1" - } - ] - }, - "snippets": [ - { - "region_tag": "workflowexecutions_v1_generated_Executions_ListExecutions_sync", - "title": "Snippet for the list_executions call in the Executions service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Workflows::Executions::V1::Executions::Client#list_executions.", - "file": "executions/list_executions.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_executions", - "full_name": "::Google::Cloud::Workflows::Executions::V1::Executions::Client#list_executions", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Workflows::Executions::V1::ListExecutionsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Workflows::Executions::V1::ListExecutionsResponse", - "client": { - "short_name": "Executions::Client", - "full_name": "::Google::Cloud::Workflows::Executions::V1::Executions::Client" - }, - "method": { - "short_name": "ListExecutions", - "full_name": "google.cloud.workflows.executions.v1.Executions.ListExecutions", - "service": { - "short_name": "Executions", - "full_name": "google.cloud.workflows.executions.v1.Executions" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "workflowexecutions_v1_generated_Executions_CreateExecution_sync", - "title": "Snippet for the create_execution call in the Executions service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Workflows::Executions::V1::Executions::Client#create_execution.", - "file": "executions/create_execution.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_execution", - "full_name": "::Google::Cloud::Workflows::Executions::V1::Executions::Client#create_execution", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Workflows::Executions::V1::CreateExecutionRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Workflows::Executions::V1::Execution", - "client": { - "short_name": "Executions::Client", - "full_name": "::Google::Cloud::Workflows::Executions::V1::Executions::Client" - }, - "method": { - "short_name": "CreateExecution", - "full_name": "google.cloud.workflows.executions.v1.Executions.CreateExecution", - "service": { - "short_name": "Executions", - "full_name": "google.cloud.workflows.executions.v1.Executions" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "workflowexecutions_v1_generated_Executions_GetExecution_sync", - "title": "Snippet for the get_execution call in the Executions service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Workflows::Executions::V1::Executions::Client#get_execution.", - "file": "executions/get_execution.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_execution", - "full_name": "::Google::Cloud::Workflows::Executions::V1::Executions::Client#get_execution", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Workflows::Executions::V1::GetExecutionRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Workflows::Executions::V1::Execution", - "client": { - "short_name": "Executions::Client", - "full_name": "::Google::Cloud::Workflows::Executions::V1::Executions::Client" - }, - "method": { - "short_name": "GetExecution", - "full_name": "google.cloud.workflows.executions.v1.Executions.GetExecution", - "service": { - "short_name": "Executions", - "full_name": "google.cloud.workflows.executions.v1.Executions" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "workflowexecutions_v1_generated_Executions_CancelExecution_sync", - "title": "Snippet for the cancel_execution call in the Executions service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Workflows::Executions::V1::Executions::Client#cancel_execution.", - "file": "executions/cancel_execution.rb", - "language": "RUBY", - "client_method": { - "short_name": "cancel_execution", - "full_name": "::Google::Cloud::Workflows::Executions::V1::Executions::Client#cancel_execution", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Workflows::Executions::V1::CancelExecutionRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Workflows::Executions::V1::Execution", - "client": { - "short_name": "Executions::Client", - "full_name": "::Google::Cloud::Workflows::Executions::V1::Executions::Client" - }, - "method": { - "short_name": "CancelExecution", - "full_name": "google.cloud.workflows.executions.v1.Executions.CancelExecution", - "service": { - "short_name": "Executions", - "full_name": "google.cloud.workflows.executions.v1.Executions" - } - } - }, - "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-workflows-executions-v1/test/google/cloud/workflows/executions/v1/executions_paths_test.rb b/owl-bot-staging/google-cloud-workflows-executions-v1/test/google/cloud/workflows/executions/v1/executions_paths_test.rb deleted file mode 100644 index 72a7af7dcf6e..000000000000 --- a/owl-bot-staging/google-cloud-workflows-executions-v1/test/google/cloud/workflows/executions/v1/executions_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/workflows/executions/v1/executions" - -class ::Google::Cloud::Workflows::Executions::V1::Executions::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_execution_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Workflows::Executions::V1::Executions::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.execution_path project: "value0", location: "value1", workflow: "value2", execution: "value3" - assert_equal "projects/value0/locations/value1/workflows/value2/executions/value3", path - end - end - - def test_workflow_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Workflows::Executions::V1::Executions::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.workflow_path project: "value0", location: "value1", workflow: "value2" - assert_equal "projects/value0/locations/value1/workflows/value2", path - end - end -end diff --git a/owl-bot-staging/google-cloud-workflows-executions-v1/test/google/cloud/workflows/executions/v1/executions_rest_test.rb b/owl-bot-staging/google-cloud-workflows-executions-v1/test/google/cloud/workflows/executions/v1/executions_rest_test.rb deleted file mode 100644 index 999aa8c8b372..000000000000 --- a/owl-bot-staging/google-cloud-workflows-executions-v1/test/google/cloud/workflows/executions/v1/executions_rest_test.rb +++ /dev/null @@ -1,322 +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/workflows/executions/v1/executions_pb" -require "google/cloud/workflows/executions/v1/executions/rest" - - -class ::Google::Cloud::Workflows::Executions::V1::Executions::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_executions - # Create test objects. - client_result = ::Google::Cloud::Workflows::Executions::V1::ListExecutionsResponse.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 = :EXECUTION_VIEW_UNSPECIFIED - filter = "hello world" - order_by = "hello world" - - list_executions_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::Workflows::Executions::V1::Executions::Rest::ServiceStub.stub :transcode_list_executions_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_executions_client_stub do - # Create client - client = ::Google::Cloud::Workflows::Executions::V1::Executions::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_executions({ 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_executions 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_executions ::Google::Cloud::Workflows::Executions::V1::ListExecutionsRequest.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_executions({ 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_executions(::Google::Cloud::Workflows::Executions::V1::ListExecutionsRequest.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_executions_client_stub.call_count - end - end - end - - def test_create_execution - # Create test objects. - client_result = ::Google::Cloud::Workflows::Executions::V1::Execution.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - parent = "hello world" - execution = {} - - create_execution_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::Workflows::Executions::V1::Executions::Rest::ServiceStub.stub :transcode_create_execution_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_execution_client_stub do - # Create client - client = ::Google::Cloud::Workflows::Executions::V1::Executions::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_execution({ parent: parent, execution: execution }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_execution parent: parent, execution: execution do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_execution ::Google::Cloud::Workflows::Executions::V1::CreateExecutionRequest.new(parent: parent, execution: execution) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_execution({ parent: parent, execution: execution }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_execution(::Google::Cloud::Workflows::Executions::V1::CreateExecutionRequest.new(parent: parent, execution: execution), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_execution_client_stub.call_count - end - end - end - - def test_get_execution - # Create test objects. - client_result = ::Google::Cloud::Workflows::Executions::V1::Execution.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - view = :EXECUTION_VIEW_UNSPECIFIED - - get_execution_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::Workflows::Executions::V1::Executions::Rest::ServiceStub.stub :transcode_get_execution_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_execution_client_stub do - # Create client - client = ::Google::Cloud::Workflows::Executions::V1::Executions::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_execution({ name: name, view: view }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_execution name: name, view: view do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_execution ::Google::Cloud::Workflows::Executions::V1::GetExecutionRequest.new(name: name, view: view) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_execution({ name: name, view: view }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_execution(::Google::Cloud::Workflows::Executions::V1::GetExecutionRequest.new(name: name, view: view), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_execution_client_stub.call_count - end - end - end - - def test_cancel_execution - # Create test objects. - client_result = ::Google::Cloud::Workflows::Executions::V1::Execution.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - cancel_execution_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::Workflows::Executions::V1::Executions::Rest::ServiceStub.stub :transcode_cancel_execution_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, cancel_execution_client_stub do - # Create client - client = ::Google::Cloud::Workflows::Executions::V1::Executions::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.cancel_execution({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.cancel_execution name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.cancel_execution ::Google::Cloud::Workflows::Executions::V1::CancelExecutionRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.cancel_execution({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.cancel_execution(::Google::Cloud::Workflows::Executions::V1::CancelExecutionRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, cancel_execution_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::Workflows::Executions::V1::Executions::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::Workflows::Executions::V1::Executions::Rest::Client::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-workflows-executions-v1/test/google/cloud/workflows/executions/v1/executions_test.rb b/owl-bot-staging/google-cloud-workflows-executions-v1/test/google/cloud/workflows/executions/v1/executions_test.rb deleted file mode 100644 index ea4afdcca877..000000000000 --- a/owl-bot-staging/google-cloud-workflows-executions-v1/test/google/cloud/workflows/executions/v1/executions_test.rb +++ /dev/null @@ -1,355 +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/workflows/executions/v1/executions_pb" -require "google/cloud/workflows/executions/v1/executions" - -class ::Google::Cloud::Workflows::Executions::V1::Executions::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_executions - # Create GRPC objects. - grpc_response = ::Google::Cloud::Workflows::Executions::V1::ListExecutionsResponse.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 = :EXECUTION_VIEW_UNSPECIFIED - filter = "hello world" - order_by = "hello world" - - list_executions_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_executions, name - assert_kind_of ::Google::Cloud::Workflows::Executions::V1::ListExecutionsRequest, request - assert_equal "hello world", request["parent"] - assert_equal 42, request["page_size"] - assert_equal "hello world", request["page_token"] - assert_equal :EXECUTION_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_executions_client_stub do - # Create client - client = ::Google::Cloud::Workflows::Executions::V1::Executions::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_executions({ 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_executions 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_executions ::Google::Cloud::Workflows::Executions::V1::ListExecutionsRequest.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_executions({ 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_executions(::Google::Cloud::Workflows::Executions::V1::ListExecutionsRequest.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_executions_client_stub.call_rpc_count - end - end - - def test_create_execution - # Create GRPC objects. - grpc_response = ::Google::Cloud::Workflows::Executions::V1::Execution.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" - execution = {} - - create_execution_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_execution, name - assert_kind_of ::Google::Cloud::Workflows::Executions::V1::CreateExecutionRequest, request - assert_equal "hello world", request["parent"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Workflows::Executions::V1::Execution), request["execution"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_execution_client_stub do - # Create client - client = ::Google::Cloud::Workflows::Executions::V1::Executions::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_execution({ parent: parent, execution: execution }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.create_execution parent: parent, execution: execution do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.create_execution ::Google::Cloud::Workflows::Executions::V1::CreateExecutionRequest.new(parent: parent, execution: execution) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.create_execution({ parent: parent, execution: execution }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.create_execution(::Google::Cloud::Workflows::Executions::V1::CreateExecutionRequest.new(parent: parent, execution: execution), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, create_execution_client_stub.call_rpc_count - end - end - - def test_get_execution - # Create GRPC objects. - grpc_response = ::Google::Cloud::Workflows::Executions::V1::Execution.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" - view = :EXECUTION_VIEW_UNSPECIFIED - - get_execution_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_execution, name - assert_kind_of ::Google::Cloud::Workflows::Executions::V1::GetExecutionRequest, request - assert_equal "hello world", request["name"] - assert_equal :EXECUTION_VIEW_UNSPECIFIED, request["view"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_execution_client_stub do - # Create client - client = ::Google::Cloud::Workflows::Executions::V1::Executions::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_execution({ name: name, view: view }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_execution name: name, view: view do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_execution ::Google::Cloud::Workflows::Executions::V1::GetExecutionRequest.new(name: name, view: view) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_execution({ name: name, view: view }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_execution(::Google::Cloud::Workflows::Executions::V1::GetExecutionRequest.new(name: name, view: view), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, get_execution_client_stub.call_rpc_count - end - end - - def test_cancel_execution - # Create GRPC objects. - grpc_response = ::Google::Cloud::Workflows::Executions::V1::Execution.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_execution_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :cancel_execution, name - assert_kind_of ::Google::Cloud::Workflows::Executions::V1::CancelExecutionRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, cancel_execution_client_stub do - # Create client - client = ::Google::Cloud::Workflows::Executions::V1::Executions::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.cancel_execution({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.cancel_execution name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.cancel_execution ::Google::Cloud::Workflows::Executions::V1::CancelExecutionRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.cancel_execution({ 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_execution(::Google::Cloud::Workflows::Executions::V1::CancelExecutionRequest.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_execution_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::Workflows::Executions::V1::Executions::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::Workflows::Executions::V1::Executions::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::Workflows::Executions::V1::Executions::Client.new do |config| - config.credentials = creds - end - assert_kind_of ::Google::Cloud::Workflows::Executions::V1::Executions::Client, client - assert_equal creds, client.configure.credentials - end - end -end diff --git a/owl-bot-staging/google-cloud-workflows-executions-v1/test/helper.rb b/owl-bot-staging/google-cloud-workflows-executions-v1/test/helper.rb deleted file mode 100644 index 672b337030e7..000000000000 --- a/owl-bot-staging/google-cloud-workflows-executions-v1/test/helper.rb +++ /dev/null @@ -1,26 +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/mock" -require "minitest/rg" - -require "grpc" - -require "ostruct" diff --git a/owl-bot-staging/google-cloud-workflows-executions-v1beta/.gitignore b/owl-bot-staging/google-cloud-workflows-executions-v1beta/.gitignore deleted file mode 100644 index 0135b6bc6cfc..000000000000 --- a/owl-bot-staging/google-cloud-workflows-executions-v1beta/.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-workflows-executions-v1beta/.repo-metadata.json b/owl-bot-staging/google-cloud-workflows-executions-v1beta/.repo-metadata.json deleted file mode 100644 index e81c837b52ed..000000000000 --- a/owl-bot-staging/google-cloud-workflows-executions-v1beta/.repo-metadata.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "api_id": "workflowexecutions.googleapis.com", - "api_shortname": "workflowexecutions", - "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-workflows-executions-v1beta/latest", - "distribution_name": "google-cloud-workflows-executions-v1beta", - "is_cloud": true, - "language": "ruby", - "name": "workflowexecutions", - "name_pretty": "Workflows Executions V1beta API", - "product_documentation": "https://cloud.google.com/workflows/", - "release_level": "unreleased", - "repo": "googleapis/google-cloud-ruby", - "requires_billing": true, - "ruby-cloud-description": "Workflows link series of serverless tasks together in an order you define. Combine the power of Google Cloud's APIs, serverless products like Cloud Functions and Cloud Run, and calls to external APIs to create flexible serverless applications. Workflows requires no infrastructure management and scales seamlessly with demand, including scaling down to zero.. Note that google-cloud-workflows-executions-v1beta is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-workflows instead. See the readme for more details.", - "ruby-cloud-env-prefix": "WORKFLOWS", - "ruby-cloud-product-url": "https://cloud.google.com/workflows/", - "library_type": "GAPIC_AUTO" -} diff --git a/owl-bot-staging/google-cloud-workflows-executions-v1beta/.rubocop.yml b/owl-bot-staging/google-cloud-workflows-executions-v1beta/.rubocop.yml deleted file mode 100644 index 307c124f8568..000000000000 --- a/owl-bot-staging/google-cloud-workflows-executions-v1beta/.rubocop.yml +++ /dev/null @@ -1,33 +0,0 @@ -inherit_gem: - google-style: google-style.yml - -AllCops: - Exclude: - - "google-cloud-workflows-executions-v1beta.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-workflows-executions-v1beta.rb" diff --git a/owl-bot-staging/google-cloud-workflows-executions-v1beta/.toys.rb b/owl-bot-staging/google-cloud-workflows-executions-v1beta/.toys.rb deleted file mode 100644 index 177e22456e8a..000000000000 --- a/owl-bot-staging/google-cloud-workflows-executions-v1beta/.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-workflows-executions-v1beta/.yardopts b/owl-bot-staging/google-cloud-workflows-executions-v1beta/.yardopts deleted file mode 100644 index 59f0a9e09511..000000000000 --- a/owl-bot-staging/google-cloud-workflows-executions-v1beta/.yardopts +++ /dev/null @@ -1,12 +0,0 @@ ---no-private ---title="Workflows Executions V1beta 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-workflows-executions-v1beta/AUTHENTICATION.md b/owl-bot-staging/google-cloud-workflows-executions-v1beta/AUTHENTICATION.md deleted file mode 100644 index 4d061343a486..000000000000 --- a/owl-bot-staging/google-cloud-workflows-executions-v1beta/AUTHENTICATION.md +++ /dev/null @@ -1,122 +0,0 @@ -# Authentication - -The recommended way to authenticate to the google-cloud-workflows-executions-v1beta 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-workflows-executions-v1beta 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/workflows/executions/v1beta" - -client = ::Google::Cloud::Workflows::Executions::V1beta::Executions::Client.new do |config| - config.credentials = "path/to/credentialfile.json" -end -``` - -To configure a credentials file globally for all clients: - -```ruby -require "google/cloud/workflows/executions/v1beta" - -::Google::Cloud::Workflows::Executions::V1beta::Executions::Client.configure do |config| - config.credentials = "path/to/credentialfile.json" -end - -client = ::Google::Cloud::Workflows::Executions::V1beta::Executions::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-workflows-executions-v1beta -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/workflows/executions/v1beta" - -ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" - -client = ::Google::Cloud::Workflows::Executions::V1beta::Executions::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-workflows-executions-v1beta/CHANGELOG.md b/owl-bot-staging/google-cloud-workflows-executions-v1beta/CHANGELOG.md deleted file mode 100644 index f88957a62ba2..000000000000 --- a/owl-bot-staging/google-cloud-workflows-executions-v1beta/CHANGELOG.md +++ /dev/null @@ -1,2 +0,0 @@ -# Release History - diff --git a/owl-bot-staging/google-cloud-workflows-executions-v1beta/Gemfile b/owl-bot-staging/google-cloud-workflows-executions-v1beta/Gemfile deleted file mode 100644 index 1d08558908d8..000000000000 --- a/owl-bot-staging/google-cloud-workflows-executions-v1beta/Gemfile +++ /dev/null @@ -1,14 +0,0 @@ -source "https://rubygems.org" - -gemspec - -gem "google-style", "~> 1.32.0" -gem "irb", "~> 1.17" -gem "minitest", "~> 6.0.2" -gem "minitest-focus", "~> 1.4" -gem "minitest-mock", "~> 5.27" -gem "minitest-rg", "~> 5.3" -gem "ostruct", "~> 0.5.5" -gem "rake", ">= 13.0" -gem "redcarpet", "~> 3.6" -gem "yard", "~> 0.9" diff --git a/owl-bot-staging/google-cloud-workflows-executions-v1beta/LICENSE.md b/owl-bot-staging/google-cloud-workflows-executions-v1beta/LICENSE.md deleted file mode 100644 index c261857ba6ad..000000000000 --- a/owl-bot-staging/google-cloud-workflows-executions-v1beta/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-workflows-executions-v1beta/README.md b/owl-bot-staging/google-cloud-workflows-executions-v1beta/README.md deleted file mode 100644 index 006a8fe26b14..000000000000 --- a/owl-bot-staging/google-cloud-workflows-executions-v1beta/README.md +++ /dev/null @@ -1,154 +0,0 @@ -# Ruby Client for the Workflows Executions V1beta API - -Manages user-provided workflows. - -Workflows link series of serverless tasks together in an order you define. Combine the power of Google Cloud's APIs, serverless products like Cloud Functions and Cloud Run, and calls to external APIs to create flexible serverless applications. Workflows requires no infrastructure management and scales seamlessly with demand, including scaling down to zero.. - -https://github.com/googleapis/google-cloud-ruby - -This gem is a _versioned_ client. It provides basic client classes for a -specific version of the Workflows Executions V1beta API. Most users should consider using -the main client gem, -[google-cloud-workflows](https://rubygems.org/gems/google-cloud-workflows). -See the section below titled *Which client should I use?* for more information. - -## Installation - -``` -$ gem install google-cloud-workflows-executions-v1beta -``` - -## 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/workflowexecutions.googleapis.com) -1. [Set up authentication.](AUTHENTICATION.md) - -## Quick Start - -```ruby -require "google/cloud/workflows/executions/v1beta" - -client = ::Google::Cloud::Workflows::Executions::V1beta::Executions::Client.new -request = ::Google::Cloud::Workflows::Executions::V1beta::ListExecutionsRequest.new # (request fields as keyword arguments...) -response = client.list_executions request -``` - -View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-workflows-executions-v1beta/latest) -for class and method documentation. - -See also the [Product Documentation](https://cloud.google.com/workflows/) -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/workflows/executions/v1beta" -require "logger" - -client = ::Google::Cloud::Workflows::Executions::V1beta::Executions::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-workflows`, -and lower-level _versioned_ client libraries with names such as -`google-cloud-workflows-executions-v1beta`. -_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-workflows`. -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-workflows-executions-v1beta`. - -### 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-workflows-executions-v1beta/Rakefile b/owl-bot-staging/google-cloud-workflows-executions-v1beta/Rakefile deleted file mode 100644 index fa9f3f6dac59..000000000000 --- a/owl-bot-staging/google-cloud-workflows-executions-v1beta/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-workflows-executions-v1beta acceptance tests." -task :acceptance, :project, :keyfile do |t, args| - project = args[:project] - project ||= - ENV["WORKFLOWS_TEST_PROJECT"] || - ENV["GCLOUD_TEST_PROJECT"] - keyfile = args[:keyfile] - keyfile ||= - ENV["WORKFLOWS_TEST_KEYFILE"] || - ENV["GCLOUD_TEST_KEYFILE"] - if keyfile - keyfile = File.read keyfile - else - keyfile ||= - ENV["WORKFLOWS_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 WORKFLOWS_TEST_PROJECT=test123 WORKFLOWS_TEST_KEYFILE=/path/to/keyfile.json rake acceptance" - end - require "google/cloud/workflows/executions/v1beta/executions/credentials" - ::Google::Cloud::Workflows::Executions::V1beta::Executions::Credentials.env_vars.each do |path| - ENV[path] = nil - end - ENV["WORKFLOWS_PROJECT"] = project - ENV["WORKFLOWS_TEST_PROJECT"] = project - ENV["WORKFLOWS_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-workflows-executions-v1beta 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-workflows-executions-v1beta 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-workflows-executions-v1beta 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-workflows-executions-v1beta gem does not have doctest tests." -end - -desc "Run the CI build" -task :ci do - header "BUILDING google-cloud-workflows-executions-v1beta" - header "google-cloud-workflows-executions-v1beta rubocop", "*" - Rake::Task[:rubocop].invoke - header "google-cloud-workflows-executions-v1beta yard", "*" - Rake::Task[:yard].invoke - header "google-cloud-workflows-executions-v1beta 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-workflows-executions-v1beta 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-workflows-executions-v1beta 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-workflows-executions-v1beta/gapic_metadata.json b/owl-bot-staging/google-cloud-workflows-executions-v1beta/gapic_metadata.json deleted file mode 100644 index 48333bd150d0..000000000000 --- a/owl-bot-staging/google-cloud-workflows-executions-v1beta/gapic_metadata.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", - "language": "ruby", - "protoPackage": "google.cloud.workflows.executions.v1beta", - "libraryPackage": "::Google::Cloud::Workflows::Executions::V1beta", - "services": { - "Executions": { - "clients": { - "grpc": { - "libraryClient": "::Google::Cloud::Workflows::Executions::V1beta::Executions::Client", - "rpcs": { - "ListExecutions": { - "methods": [ - "list_executions" - ] - }, - "CreateExecution": { - "methods": [ - "create_execution" - ] - }, - "GetExecution": { - "methods": [ - "get_execution" - ] - }, - "CancelExecution": { - "methods": [ - "cancel_execution" - ] - } - } - } - } - } - } -} diff --git a/owl-bot-staging/google-cloud-workflows-executions-v1beta/google-cloud-workflows-executions-v1beta.gemspec b/owl-bot-staging/google-cloud-workflows-executions-v1beta/google-cloud-workflows-executions-v1beta.gemspec deleted file mode 100644 index 8711f18b4285..000000000000 --- a/owl-bot-staging/google-cloud-workflows-executions-v1beta/google-cloud-workflows-executions-v1beta.gemspec +++ /dev/null @@ -1,28 +0,0 @@ -# -*- ruby -*- -# encoding: utf-8 - -require File.expand_path("lib/google/cloud/workflows/executions/v1beta/version", __dir__) - -Gem::Specification.new do |gem| - gem.name = "google-cloud-workflows-executions-v1beta" - gem.version = Google::Cloud::Workflows::Executions::V1beta::VERSION - - gem.authors = ["Google LLC"] - gem.email = "googleapis-packages@google.com" - gem.description = "Workflows link series of serverless tasks together in an order you define. Combine the power of Google Cloud's APIs, serverless products like Cloud Functions and Cloud Run, and calls to external APIs to create flexible serverless applications. Workflows requires no infrastructure management and scales seamlessly with demand, including scaling down to zero.. Note that google-cloud-workflows-executions-v1beta is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-workflows instead. See the readme for more details." - gem.summary = "Manages user-provided workflows." - 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.2" - - gem.add_dependency "gapic-common", "~> 1.2" - gem.add_dependency "google-cloud-errors", "~> 1.0" -end diff --git a/owl-bot-staging/google-cloud-workflows-executions-v1beta/lib/google-cloud-workflows-executions-v1beta.rb b/owl-bot-staging/google-cloud-workflows-executions-v1beta/lib/google-cloud-workflows-executions-v1beta.rb deleted file mode 100644 index 2e0636bb1b59..000000000000 --- a/owl-bot-staging/google-cloud-workflows-executions-v1beta/lib/google-cloud-workflows-executions-v1beta.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/workflows/executions/v1beta" diff --git a/owl-bot-staging/google-cloud-workflows-executions-v1beta/lib/google/cloud/workflows/executions/v1beta.rb b/owl-bot-staging/google-cloud-workflows-executions-v1beta/lib/google/cloud/workflows/executions/v1beta.rb deleted file mode 100644 index f86ef8bc398c..000000000000 --- a/owl-bot-staging/google-cloud-workflows-executions-v1beta/lib/google/cloud/workflows/executions/v1beta.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/workflows/executions/v1beta/executions" -require "google/cloud/workflows/executions/v1beta/version" - -module Google - module Cloud - module Workflows - module Executions - ## - # API client module. - # - # @example Load this package, including all its services, and instantiate a gRPC client - # - # require "google/cloud/workflows/executions/v1beta" - # client = ::Google::Cloud::Workflows::Executions::V1beta::Executions::Client.new - # - module V1beta - end - end - end - end -end - -helper_path = ::File.join __dir__, "v1beta", "_helpers.rb" -require "google/cloud/workflows/executions/v1beta/_helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-workflows-executions-v1beta/lib/google/cloud/workflows/executions/v1beta/executions.rb b/owl-bot-staging/google-cloud-workflows-executions-v1beta/lib/google/cloud/workflows/executions/v1beta/executions.rb deleted file mode 100644 index 10f6adbe5ec1..000000000000 --- a/owl-bot-staging/google-cloud-workflows-executions-v1beta/lib/google/cloud/workflows/executions/v1beta/executions.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 "gapic/common" -require "gapic/config" -require "gapic/config/method" - -require "google/cloud/workflows/executions/v1beta/version" - -require "google/cloud/workflows/executions/v1beta/executions/credentials" -require "google/cloud/workflows/executions/v1beta/executions/paths" -require "google/cloud/workflows/executions/v1beta/executions/client" - -module Google - module Cloud - module Workflows - module Executions - module V1beta - ## - # Executions is used to start and manage running instances of - # [Workflows][google.cloud.workflows.v1beta.Workflow] called executions. - # - # @example Load this service and instantiate a gRPC client - # - # require "google/cloud/workflows/executions/v1beta/executions" - # client = ::Google::Cloud::Workflows::Executions::V1beta::Executions::Client.new - # - module Executions - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "executions", "helpers.rb" -require "google/cloud/workflows/executions/v1beta/executions/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-workflows-executions-v1beta/lib/google/cloud/workflows/executions/v1beta/executions/client.rb b/owl-bot-staging/google-cloud-workflows-executions-v1beta/lib/google/cloud/workflows/executions/v1beta/executions/client.rb deleted file mode 100644 index 2bfac81e7856..000000000000 --- a/owl-bot-staging/google-cloud-workflows-executions-v1beta/lib/google/cloud/workflows/executions/v1beta/executions/client.rb +++ /dev/null @@ -1,789 +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/workflows/executions/v1beta/executions_pb" - -module Google - module Cloud - module Workflows - module Executions - module V1beta - module Executions - ## - # Client for the Executions service. - # - # Executions is used to start and manage running instances of - # [Workflows][google.cloud.workflows.v1beta.Workflow] called executions. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "workflowexecutions.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :executions_stub - - ## - # Configure the Executions Client class. - # - # See {::Google::Cloud::Workflows::Executions::V1beta::Executions::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all Executions clients - # ::Google::Cloud::Workflows::Executions::V1beta::Executions::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", "Workflows", "Executions", "V1beta"] - 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 - end - yield @configure if block_given? - @configure - end - - ## - # Configure the Executions 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::Workflows::Executions::V1beta::Executions::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 - @executions_stub.universe_domain - end - - ## - # Create a new Executions client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Workflows::Executions::V1beta::Executions::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Workflows::Executions::V1beta::Executions::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Executions 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/workflows/executions/v1beta/executions_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 - - @executions_stub = ::Gapic::ServiceStub.new( - ::Google::Cloud::Workflows::Executions::V1beta::Executions::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 - ) - - @executions_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 - end - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @executions_stub.logger - end - - # Service calls - - ## - # Returns a list of executions which belong to the workflow with - # the given name. The method returns executions of all workflow - # revisions. Returned executions are ordered by their start time (newest - # first). - # - # @overload list_executions(request, options = nil) - # Pass arguments to `list_executions` via a request object, either of type - # {::Google::Cloud::Workflows::Executions::V1beta::ListExecutionsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Workflows::Executions::V1beta::ListExecutionsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_executions(parent: nil, page_size: nil, page_token: nil, view: nil) - # Pass arguments to `list_executions` via keyword arguments. Note that at - # least one keyword argument is 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 workflow for which the executions should be listed. - # Format: projects/\\{project}/locations/\\{location}/workflows/\\{workflow} - # @param page_size [::Integer] - # Maximum number of executions to return per call. - # Max supported value depends on the selected Execution view: it's 10000 for - # BASIC and 100 for FULL. The default value used if the field is not - # specified is 100, regardless of the selected view. Values greater than - # the max value will be coerced down to it. - # @param page_token [::String] - # A page token, received from a previous `ListExecutions` call. - # Provide this to retrieve the subsequent page. - # - # When paginating, all other parameters provided to `ListExecutions` must - # match the call that provided the page token. - # @param view [::Google::Cloud::Workflows::Executions::V1beta::ExecutionView] - # Optional. A view defining which fields should be filled in the returned executions. - # The API will default to the BASIC view. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Workflows::Executions::V1beta::Execution>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::Workflows::Executions::V1beta::Execution>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/workflows/executions/v1beta" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Workflows::Executions::V1beta::Executions::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Workflows::Executions::V1beta::ListExecutionsRequest.new - # - # # Call the list_executions method. - # result = client.list_executions 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::Workflows::Executions::V1beta::Execution. - # p item - # end - # - def list_executions request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workflows::Executions::V1beta::ListExecutionsRequest - - # Converts hash 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_executions.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::Workflows::Executions::V1beta::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_executions.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_executions.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @executions_stub.call_rpc :list_executions, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @executions_stub, :list_executions, 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 - - ## - # Creates a new execution using the latest revision of the given workflow. - # - # @overload create_execution(request, options = nil) - # Pass arguments to `create_execution` via a request object, either of type - # {::Google::Cloud::Workflows::Executions::V1beta::CreateExecutionRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Workflows::Executions::V1beta::CreateExecutionRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_execution(parent: nil, execution: nil) - # Pass arguments to `create_execution` via keyword arguments. Note that at - # least one keyword argument is 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 workflow for which an execution should be created. - # Format: projects/\\{project}/locations/\\{location}/workflows/\\{workflow} - # The latest revision of the workflow will be used. - # @param execution [::Google::Cloud::Workflows::Executions::V1beta::Execution, ::Hash] - # Required. Execution to be created. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Workflows::Executions::V1beta::Execution] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Workflows::Executions::V1beta::Execution] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/workflows/executions/v1beta" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Workflows::Executions::V1beta::Executions::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Workflows::Executions::V1beta::CreateExecutionRequest.new - # - # # Call the create_execution method. - # result = client.create_execution request - # - # # The returned object is of type Google::Cloud::Workflows::Executions::V1beta::Execution. - # p result - # - def create_execution request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workflows::Executions::V1beta::CreateExecutionRequest - - # Converts hash 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_execution.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::Workflows::Executions::V1beta::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_execution.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_execution.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @executions_stub.call_rpc :create_execution, 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 an execution of the given name. - # - # @overload get_execution(request, options = nil) - # Pass arguments to `get_execution` via a request object, either of type - # {::Google::Cloud::Workflows::Executions::V1beta::GetExecutionRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Workflows::Executions::V1beta::GetExecutionRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_execution(name: nil, view: nil) - # Pass arguments to `get_execution` via keyword arguments. Note that at - # least one keyword argument is 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 execution to be retrieved. - # Format: - # projects/\\{project}/locations/\\{location}/workflows/\\{workflow}/executions/\\{execution} - # @param view [::Google::Cloud::Workflows::Executions::V1beta::ExecutionView] - # Optional. A view defining which fields should be filled in the returned execution. - # The API will default to the FULL view. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Workflows::Executions::V1beta::Execution] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Workflows::Executions::V1beta::Execution] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/workflows/executions/v1beta" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Workflows::Executions::V1beta::Executions::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Workflows::Executions::V1beta::GetExecutionRequest.new - # - # # Call the get_execution method. - # result = client.get_execution request - # - # # The returned object is of type Google::Cloud::Workflows::Executions::V1beta::Execution. - # p result - # - def get_execution request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workflows::Executions::V1beta::GetExecutionRequest - - # Converts hash 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_execution.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::Workflows::Executions::V1beta::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_execution.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_execution.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @executions_stub.call_rpc :get_execution, 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 - - ## - # Cancels an execution of the given name. - # - # @overload cancel_execution(request, options = nil) - # Pass arguments to `cancel_execution` via a request object, either of type - # {::Google::Cloud::Workflows::Executions::V1beta::CancelExecutionRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Workflows::Executions::V1beta::CancelExecutionRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_execution(name: nil) - # Pass arguments to `cancel_execution` via keyword arguments. Note that at - # least one keyword argument is 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 execution to be cancelled. - # Format: - # projects/\\{project}/locations/\\{location}/workflows/\\{workflow}/executions/\\{execution} - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Workflows::Executions::V1beta::Execution] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Workflows::Executions::V1beta::Execution] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/workflows/executions/v1beta" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Workflows::Executions::V1beta::Executions::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Workflows::Executions::V1beta::CancelExecutionRequest.new - # - # # Call the cancel_execution method. - # result = client.cancel_execution request - # - # # The returned object is of type Google::Cloud::Workflows::Executions::V1beta::Execution. - # p result - # - def cancel_execution request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workflows::Executions::V1beta::CancelExecutionRequest - - # Converts hash 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_execution.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::Workflows::Executions::V1beta::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_execution.timeout, - metadata: metadata, - retry_policy: @config.rpcs.cancel_execution.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @executions_stub.call_rpc :cancel_execution, 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 Executions API. - # - # This class represents the configuration for Executions, - # 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::Workflows::Executions::V1beta::Executions::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_executions to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Workflows::Executions::V1beta::Executions::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_executions.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Workflows::Executions::V1beta::Executions::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_executions.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::Workflows::Executions::V1beta::Executions::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 = "workflowexecutions.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 Executions 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_executions` - # @return [::Gapic::Config::Method] - # - attr_reader :list_executions - ## - # RPC-specific configuration for `create_execution` - # @return [::Gapic::Config::Method] - # - attr_reader :create_execution - ## - # RPC-specific configuration for `get_execution` - # @return [::Gapic::Config::Method] - # - attr_reader :get_execution - ## - # RPC-specific configuration for `cancel_execution` - # @return [::Gapic::Config::Method] - # - attr_reader :cancel_execution - - # @private - def initialize parent_rpcs = nil - list_executions_config = parent_rpcs.list_executions if parent_rpcs.respond_to? :list_executions - @list_executions = ::Gapic::Config::Method.new list_executions_config - create_execution_config = parent_rpcs.create_execution if parent_rpcs.respond_to? :create_execution - @create_execution = ::Gapic::Config::Method.new create_execution_config - get_execution_config = parent_rpcs.get_execution if parent_rpcs.respond_to? :get_execution - @get_execution = ::Gapic::Config::Method.new get_execution_config - cancel_execution_config = parent_rpcs.cancel_execution if parent_rpcs.respond_to? :cancel_execution - @cancel_execution = ::Gapic::Config::Method.new cancel_execution_config - - yield self if block_given? - end - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-workflows-executions-v1beta/lib/google/cloud/workflows/executions/v1beta/executions/credentials.rb b/owl-bot-staging/google-cloud-workflows-executions-v1beta/lib/google/cloud/workflows/executions/v1beta/executions/credentials.rb deleted file mode 100644 index 82a81fac37cc..000000000000 --- a/owl-bot-staging/google-cloud-workflows-executions-v1beta/lib/google/cloud/workflows/executions/v1beta/executions/credentials.rb +++ /dev/null @@ -1,53 +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 Workflows - module Executions - module V1beta - module Executions - # Credentials for the Executions API. - class Credentials < ::Google::Auth::Credentials - self.scope = [ - "https://www.googleapis.com/auth/cloud-platform" - ] - self.env_vars = [ - "WORKFLOWS_CREDENTIALS", - "WORKFLOWS_KEYFILE", - "GOOGLE_CLOUD_CREDENTIALS", - "GOOGLE_CLOUD_KEYFILE", - "GCLOUD_KEYFILE", - "WORKFLOWS_CREDENTIALS_JSON", - "WORKFLOWS_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 -end diff --git a/owl-bot-staging/google-cloud-workflows-executions-v1beta/lib/google/cloud/workflows/executions/v1beta/executions/paths.rb b/owl-bot-staging/google-cloud-workflows-executions-v1beta/lib/google/cloud/workflows/executions/v1beta/executions/paths.rb deleted file mode 100644 index 91d5836ff754..000000000000 --- a/owl-bot-staging/google-cloud-workflows-executions-v1beta/lib/google/cloud/workflows/executions/v1beta/executions/paths.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 Cloud - module Workflows - module Executions - module V1beta - module Executions - # Path helper methods for the Executions API. - module Paths - ## - # Create a fully-qualified Execution resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/workflows/{workflow}/executions/{execution}` - # - # @param project [String] - # @param location [String] - # @param workflow [String] - # @param execution [String] - # - # @return [::String] - def execution_path project:, location:, workflow:, execution: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "workflow cannot contain /" if workflow.to_s.include? "/" - - "projects/#{project}/locations/#{location}/workflows/#{workflow}/executions/#{execution}" - end - - ## - # Create a fully-qualified Workflow resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/workflows/{workflow}` - # - # @param project [String] - # @param location [String] - # @param workflow [String] - # - # @return [::String] - def workflow_path project:, location:, workflow: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/workflows/#{workflow}" - end - - extend self - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-workflows-executions-v1beta/lib/google/cloud/workflows/executions/v1beta/executions_pb.rb b/owl-bot-staging/google-cloud-workflows-executions-v1beta/lib/google/cloud/workflows/executions/v1beta/executions_pb.rb deleted file mode 100644 index 240d00363b7a..000000000000 --- a/owl-bot-staging/google-cloud-workflows-executions-v1beta/lib/google/cloud/workflows/executions/v1beta/executions_pb.rb +++ /dev/null @@ -1,37 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/workflows/executions/v1beta/executions.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/timestamp_pb' - - -descriptor_data = "\n9google/cloud/workflows/executions/v1beta/executions.proto\x12(google.cloud.workflows.executions.v1beta\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xf8\x04\n\tExecution\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x33\n\nstart_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x31\n\x08\x65nd_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12M\n\x05state\x18\x04 \x01(\x0e\x32\x39.google.cloud.workflows.executions.v1beta.Execution.StateB\x03\xe0\x41\x03\x12\x10\n\x08\x61rgument\x18\x05 \x01(\t\x12\x13\n\x06result\x18\x06 \x01(\tB\x03\xe0\x41\x03\x12M\n\x05\x65rror\x18\x07 \x01(\x0b\x32\x39.google.cloud.workflows.executions.v1beta.Execution.ErrorB\x03\xe0\x41\x03\x12!\n\x14workflow_revision_id\x18\x08 \x01(\tB\x03\xe0\x41\x03\x1a)\n\x05\x45rror\x12\x0f\n\x07payload\x18\x01 \x01(\t\x12\x0f\n\x07\x63ontext\x18\x02 \x01(\t\"T\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\n\n\x06\x41\x43TIVE\x10\x01\x12\r\n\tSUCCEEDED\x10\x02\x12\n\n\x06\x46\x41ILED\x10\x03\x12\r\n\tCANCELLED\x10\x04:\x86\x01\xea\x41\x82\x01\n+workflowexecutions.googleapis.com/Execution\x12Sprojects/{project}/locations/{location}/workflows/{workflow}/executions/{execution}\"\xc5\x01\n\x15ListExecutionsRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!workflows.googleapis.com/Workflow\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\x12J\n\x04view\x18\x04 \x01(\x0e\x32\x37.google.cloud.workflows.executions.v1beta.ExecutionViewB\x03\xe0\x41\x01\"z\n\x16ListExecutionsResponse\x12G\n\nexecutions\x18\x01 \x03(\x0b\x32\x33.google.cloud.workflows.executions.v1beta.Execution\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"\xa0\x01\n\x16\x43reateExecutionRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!workflows.googleapis.com/Workflow\x12K\n\texecution\x18\x02 \x01(\x0b\x32\x33.google.cloud.workflows.executions.v1beta.ExecutionB\x03\xe0\x41\x02\"\xa4\x01\n\x13GetExecutionRequest\x12\x41\n\x04name\x18\x01 \x01(\tB3\xe0\x41\x02\xfa\x41-\n+workflowexecutions.googleapis.com/Execution\x12J\n\x04view\x18\x02 \x01(\x0e\x32\x37.google.cloud.workflows.executions.v1beta.ExecutionViewB\x03\xe0\x41\x01\"[\n\x16\x43\x61ncelExecutionRequest\x12\x41\n\x04name\x18\x01 \x01(\tB3\xe0\x41\x02\xfa\x41-\n+workflowexecutions.googleapis.com/Execution*D\n\rExecutionView\x12\x1e\n\x1a\x45XECUTION_VIEW_UNSPECIFIED\x10\x00\x12\t\n\x05\x42\x41SIC\x10\x01\x12\x08\n\x04\x46ULL\x10\x02\x32\xf3\x07\n\nExecutions\x12\xe4\x01\n\x0eListExecutions\x12?.google.cloud.workflows.executions.v1beta.ListExecutionsRequest\x1a@.google.cloud.workflows.executions.v1beta.ListExecutionsResponse\"O\xda\x41\x06parent\x82\xd3\xe4\x93\x02@\x12>/v1beta/{parent=projects/*/locations/*/workflows/*}/executions\x12\xee\x01\n\x0f\x43reateExecution\x12@.google.cloud.workflows.executions.v1beta.CreateExecutionRequest\x1a\x33.google.cloud.workflows.executions.v1beta.Execution\"d\xda\x41\x10parent,execution\x82\xd3\xe4\x93\x02K\">/v1beta/{parent=projects/*/locations/*/workflows/*}/executions:\texecution\x12\xd1\x01\n\x0cGetExecution\x12=.google.cloud.workflows.executions.v1beta.GetExecutionRequest\x1a\x33.google.cloud.workflows.executions.v1beta.Execution\"M\xda\x41\x04name\x82\xd3\xe4\x93\x02@\x12>/v1beta/{name=projects/*/locations/*/workflows/*/executions/*}\x12\xe1\x01\n\x0f\x43\x61ncelExecution\x12@.google.cloud.workflows.executions.v1beta.CancelExecutionRequest\x1a\x33.google.cloud.workflows.executions.v1beta.Execution\"W\xda\x41\x04name\x82\xd3\xe4\x93\x02J\"E/v1beta/{name=projects/*/locations/*/workflows/*/executions/*}:cancel:\x01*\x1aU\xca\x41!workflowexecutions.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\xf3\x01\n,com.google.cloud.workflows.executions.v1betaB\x0f\x45xecutionsProtoP\x01ZLcloud.google.com/go/workflows/executions/apiv1beta/executionspb;executionspb\xea\x41\x61\n!workflows.googleapis.com/Workflow\x12] - # 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. - # - # Note: This field should not be used in most cases. - 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: - # library_settings: - # 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. - # @!attribute [rw] library_package - # @return [::String] - # The package name to use in Php. Clobbers the php_namespace option - # set in the protobuf. This should be used **only** by APIs - # who have already set the language_settings.php.package_name" field - # in gapic.yaml. API teams should use the protobuf php_namespace option - # where possible. - # - # Example of a YAML configuration:: - # - # publishing: - # library_settings: - # php_settings: - # library_package: Google\Cloud\PubSub\V1 - 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. - # - # Example: - # - # 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 - # @!attribute [rw] batching - # @return [::Google::Api::BatchingConfigProto] - # Batching configuration for an API method in client libraries. - # - # Example of a YAML configuration: - # - # publishing: - # method_settings: - # - selector: google.example.v1.ExampleService.BatchCreateExample - # batching: - # element_count_threshold: 1000 - # request_byte_threshold: 100000000 - # delay_threshold_millis: 10 - 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. - # - # Note: This feature should not be used in most cases. - # @!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 - - # `BatchingConfigProto` defines the batching configuration for an API method. - # @!attribute [rw] thresholds - # @return [::Google::Api::BatchingSettingsProto] - # The thresholds which trigger a batched request to be sent. - # @!attribute [rw] batch_descriptor - # @return [::Google::Api::BatchingDescriptorProto] - # The request and response fields used in batching. - class BatchingConfigProto - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # `BatchingSettingsProto` specifies a set of batching thresholds, each of - # which acts as a trigger to send a batch of messages as a request. At least - # one threshold must be positive nonzero. - # @!attribute [rw] element_count_threshold - # @return [::Integer] - # The number of elements of a field collected into a batch which, if - # exceeded, causes the batch to be sent. - # @!attribute [rw] request_byte_threshold - # @return [::Integer] - # The aggregated size of the batched field which, if exceeded, causes the - # batch to be sent. This size is computed by aggregating the sizes of the - # request field to be batched, not of the entire request message. - # @!attribute [rw] delay_threshold - # @return [::Google::Protobuf::Duration] - # The duration after which a batch should be sent, starting from the addition - # of the first message to that batch. - # @!attribute [rw] element_count_limit - # @return [::Integer] - # The maximum number of elements collected in a batch that could be accepted - # by server. - # @!attribute [rw] request_byte_limit - # @return [::Integer] - # The maximum size of the request that could be accepted by server. - # @!attribute [rw] flow_control_element_limit - # @return [::Integer] - # The maximum number of elements allowed by flow control. - # @!attribute [rw] flow_control_byte_limit - # @return [::Integer] - # The maximum size of data allowed by flow control. - # @!attribute [rw] flow_control_limit_exceeded_behavior - # @return [::Google::Api::FlowControlLimitExceededBehaviorProto] - # The behavior to take when the flow control limit is exceeded. - class BatchingSettingsProto - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # `BatchingDescriptorProto` specifies the fields of the request message to be - # used for batching, and, optionally, the fields of the response message to be - # used for demultiplexing. - # @!attribute [rw] batched_field - # @return [::String] - # The repeated field in the request message to be aggregated by batching. - # @!attribute [rw] discriminator_fields - # @return [::Array<::String>] - # A list of the fields in the request message. Two requests will be batched - # together only if the values of every field specified in - # `request_discriminator_fields` is equal between the two requests. - # @!attribute [rw] subresponse_field - # @return [::String] - # Optional. When present, indicates the field in the response message to be - # used to demultiplex the response into multiple response messages, in - # correspondence with the multiple request messages originally batched - # together. - class BatchingDescriptorProto - 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 - - # The behavior to take when the flow control limit is exceeded. - module FlowControlLimitExceededBehaviorProto - # Default behavior, system-defined. - UNSET_BEHAVIOR = 0 - - # Stop operation, raise error. - THROW_EXCEPTION = 1 - - # Pause operation until limit clears. - BLOCK = 2 - - # Continue operation, disregard limit. - IGNORE = 3 - end - end -end diff --git a/owl-bot-staging/google-cloud-workflows-executions-v1beta/proto_docs/google/api/field_behavior.rb b/owl-bot-staging/google-cloud-workflows-executions-v1beta/proto_docs/google/api/field_behavior.rb deleted file mode 100644 index 582be187d115..000000000000 --- a/owl-bot-staging/google-cloud-workflows-executions-v1beta/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-workflows-executions-v1beta/proto_docs/google/api/launch_stage.rb b/owl-bot-staging/google-cloud-workflows-executions-v1beta/proto_docs/google/api/launch_stage.rb deleted file mode 100644 index 9392a413fb1b..000000000000 --- a/owl-bot-staging/google-cloud-workflows-executions-v1beta/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-workflows-executions-v1beta/proto_docs/google/api/resource.rb b/owl-bot-staging/google-cloud-workflows-executions-v1beta/proto_docs/google/api/resource.rb deleted file mode 100644 index 25dec4847ac1..000000000000 --- a/owl-bot-staging/google-cloud-workflows-executions-v1beta/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-workflows-executions-v1beta/proto_docs/google/cloud/workflows/executions/v1beta/executions.rb b/owl-bot-staging/google-cloud-workflows-executions-v1beta/proto_docs/google/cloud/workflows/executions/v1beta/executions.rb deleted file mode 100644 index 155d545071b2..000000000000 --- a/owl-bot-staging/google-cloud-workflows-executions-v1beta/proto_docs/google/cloud/workflows/executions/v1beta/executions.rb +++ /dev/null @@ -1,200 +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 Workflows - module Executions - module V1beta - # A running instance of a [Workflow][google.cloud.workflows.v1beta.Workflow]. - # @!attribute [r] name - # @return [::String] - # Output only. The resource name of the execution. - # Format: - # projects/\\{project}/locations/\\{location}/workflows/\\{workflow}/executions/\\{execution} - # @!attribute [r] start_time - # @return [::Google::Protobuf::Timestamp] - # Output only. Marks the beginning of execution. - # @!attribute [r] end_time - # @return [::Google::Protobuf::Timestamp] - # Output only. Marks the end of execution, successful or not. - # @!attribute [r] state - # @return [::Google::Cloud::Workflows::Executions::V1beta::Execution::State] - # Output only. Current state of the execution. - # @!attribute [rw] argument - # @return [::String] - # Input parameters of the execution represented as a JSON string. - # The size limit is 32KB. - # @!attribute [r] result - # @return [::String] - # Output only. Output of the execution represented as a JSON string. The - # value can only be present if the execution's state is `SUCCEEDED`. - # @!attribute [r] error - # @return [::Google::Cloud::Workflows::Executions::V1beta::Execution::Error] - # Output only. The error which caused the execution to finish prematurely. - # The value is only present if the execution's state is `FAILED` - # or `CANCELLED`. - # @!attribute [r] workflow_revision_id - # @return [::String] - # Output only. Revision of the workflow this execution is using. - class Execution - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Error describes why the execution was abnormally terminated. - # @!attribute [rw] payload - # @return [::String] - # Error payload returned by the execution, represented as a JSON string. - # @!attribute [rw] context - # @return [::String] - # Human readable error context, helpful for debugging purposes. - class Error - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Describes the current state of the execution. More states may be added - # in the future. - module State - # Invalid state. - STATE_UNSPECIFIED = 0 - - # The execution is in progress. - ACTIVE = 1 - - # The execution finished successfully. - SUCCEEDED = 2 - - # The execution failed with an error. - FAILED = 3 - - # The execution was stopped intentionally. - CANCELLED = 4 - end - end - - # Request for the - # {::Google::Cloud::Workflows::Executions::V1beta::Executions::Client#list_executions ListExecutions} - # method. - # @!attribute [rw] parent - # @return [::String] - # Required. Name of the workflow for which the executions should be listed. - # Format: projects/\\{project}/locations/\\{location}/workflows/\\{workflow} - # @!attribute [rw] page_size - # @return [::Integer] - # Maximum number of executions to return per call. - # Max supported value depends on the selected Execution view: it's 10000 for - # BASIC and 100 for FULL. The default value used if the field is not - # specified is 100, regardless of the selected view. Values greater than - # the max value will be coerced down to it. - # @!attribute [rw] page_token - # @return [::String] - # A page token, received from a previous `ListExecutions` call. - # Provide this to retrieve the subsequent page. - # - # When paginating, all other parameters provided to `ListExecutions` must - # match the call that provided the page token. - # @!attribute [rw] view - # @return [::Google::Cloud::Workflows::Executions::V1beta::ExecutionView] - # Optional. A view defining which fields should be filled in the returned executions. - # The API will default to the BASIC view. - class ListExecutionsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response for the - # {::Google::Cloud::Workflows::Executions::V1beta::Executions::Client#list_executions ListExecutions} - # method. - # @!attribute [rw] executions - # @return [::Array<::Google::Cloud::Workflows::Executions::V1beta::Execution>] - # The executions which match the request. - # @!attribute [rw] next_page_token - # @return [::String] - # A token, which can be sent as `page_token` to retrieve the next page. - # If this field is omitted, there are no subsequent pages. - class ListExecutionsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request for the - # {::Google::Cloud::Workflows::Executions::V1beta::Executions::Client#create_execution CreateExecution} - # method. - # @!attribute [rw] parent - # @return [::String] - # Required. Name of the workflow for which an execution should be created. - # Format: projects/\\{project}/locations/\\{location}/workflows/\\{workflow} - # The latest revision of the workflow will be used. - # @!attribute [rw] execution - # @return [::Google::Cloud::Workflows::Executions::V1beta::Execution] - # Required. Execution to be created. - class CreateExecutionRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request for the - # {::Google::Cloud::Workflows::Executions::V1beta::Executions::Client#get_execution GetExecution} - # method. - # @!attribute [rw] name - # @return [::String] - # Required. Name of the execution to be retrieved. - # Format: - # projects/\\{project}/locations/\\{location}/workflows/\\{workflow}/executions/\\{execution} - # @!attribute [rw] view - # @return [::Google::Cloud::Workflows::Executions::V1beta::ExecutionView] - # Optional. A view defining which fields should be filled in the returned execution. - # The API will default to the FULL view. - class GetExecutionRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request for the - # {::Google::Cloud::Workflows::Executions::V1beta::Executions::Client#cancel_execution CancelExecution} - # method. - # @!attribute [rw] name - # @return [::String] - # Required. Name of the execution to be cancelled. - # Format: - # projects/\\{project}/locations/\\{location}/workflows/\\{workflow}/executions/\\{execution} - class CancelExecutionRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Defines possible views for execution resource. - module ExecutionView - # The default / unset value. - EXECUTION_VIEW_UNSPECIFIED = 0 - - # Includes only basic metadata about the execution. - # Following fields are returned: name, start_time, end_time, state - # and workflow_revision_id. - BASIC = 1 - - # Includes all data. - FULL = 2 - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-workflows-executions-v1beta/proto_docs/google/protobuf/duration.rb b/owl-bot-staging/google-cloud-workflows-executions-v1beta/proto_docs/google/protobuf/duration.rb deleted file mode 100644 index ea59f1f91daf..000000000000 --- a/owl-bot-staging/google-cloud-workflows-executions-v1beta/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-workflows-executions-v1beta/proto_docs/google/protobuf/timestamp.rb b/owl-bot-staging/google-cloud-workflows-executions-v1beta/proto_docs/google/protobuf/timestamp.rb deleted file mode 100644 index 74352be9c58c..000000000000 --- a/owl-bot-staging/google-cloud-workflows-executions-v1beta/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-workflows-executions-v1beta/snippets/Gemfile b/owl-bot-staging/google-cloud-workflows-executions-v1beta/snippets/Gemfile deleted file mode 100644 index 16f945ec033e..000000000000 --- a/owl-bot-staging/google-cloud-workflows-executions-v1beta/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-workflows-executions-v1beta", path: "../" -else - gem "google-cloud-workflows-executions-v1beta" -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-workflows-executions-v1beta/snippets/executions/cancel_execution.rb b/owl-bot-staging/google-cloud-workflows-executions-v1beta/snippets/executions/cancel_execution.rb deleted file mode 100644 index 8f7f3934284c..000000000000 --- a/owl-bot-staging/google-cloud-workflows-executions-v1beta/snippets/executions/cancel_execution.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 workflowexecutions_v1beta_generated_Executions_CancelExecution_sync] -require "google/cloud/workflows/executions/v1beta" - -## -# Snippet for the cancel_execution call in the Executions 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::Workflows::Executions::V1beta::Executions::Client#cancel_execution. -# -def cancel_execution - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Workflows::Executions::V1beta::Executions::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Workflows::Executions::V1beta::CancelExecutionRequest.new - - # Call the cancel_execution method. - result = client.cancel_execution request - - # The returned object is of type Google::Cloud::Workflows::Executions::V1beta::Execution. - p result -end -# [END workflowexecutions_v1beta_generated_Executions_CancelExecution_sync] diff --git a/owl-bot-staging/google-cloud-workflows-executions-v1beta/snippets/executions/create_execution.rb b/owl-bot-staging/google-cloud-workflows-executions-v1beta/snippets/executions/create_execution.rb deleted file mode 100644 index 926c4489f51d..000000000000 --- a/owl-bot-staging/google-cloud-workflows-executions-v1beta/snippets/executions/create_execution.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 workflowexecutions_v1beta_generated_Executions_CreateExecution_sync] -require "google/cloud/workflows/executions/v1beta" - -## -# Snippet for the create_execution call in the Executions 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::Workflows::Executions::V1beta::Executions::Client#create_execution. -# -def create_execution - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Workflows::Executions::V1beta::Executions::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Workflows::Executions::V1beta::CreateExecutionRequest.new - - # Call the create_execution method. - result = client.create_execution request - - # The returned object is of type Google::Cloud::Workflows::Executions::V1beta::Execution. - p result -end -# [END workflowexecutions_v1beta_generated_Executions_CreateExecution_sync] diff --git a/owl-bot-staging/google-cloud-workflows-executions-v1beta/snippets/executions/get_execution.rb b/owl-bot-staging/google-cloud-workflows-executions-v1beta/snippets/executions/get_execution.rb deleted file mode 100644 index 58e0a552a8ab..000000000000 --- a/owl-bot-staging/google-cloud-workflows-executions-v1beta/snippets/executions/get_execution.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 workflowexecutions_v1beta_generated_Executions_GetExecution_sync] -require "google/cloud/workflows/executions/v1beta" - -## -# Snippet for the get_execution call in the Executions 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::Workflows::Executions::V1beta::Executions::Client#get_execution. -# -def get_execution - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Workflows::Executions::V1beta::Executions::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Workflows::Executions::V1beta::GetExecutionRequest.new - - # Call the get_execution method. - result = client.get_execution request - - # The returned object is of type Google::Cloud::Workflows::Executions::V1beta::Execution. - p result -end -# [END workflowexecutions_v1beta_generated_Executions_GetExecution_sync] diff --git a/owl-bot-staging/google-cloud-workflows-executions-v1beta/snippets/executions/list_executions.rb b/owl-bot-staging/google-cloud-workflows-executions-v1beta/snippets/executions/list_executions.rb deleted file mode 100644 index a8f00e5f1390..000000000000 --- a/owl-bot-staging/google-cloud-workflows-executions-v1beta/snippets/executions/list_executions.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 workflowexecutions_v1beta_generated_Executions_ListExecutions_sync] -require "google/cloud/workflows/executions/v1beta" - -## -# Snippet for the list_executions call in the Executions 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::Workflows::Executions::V1beta::Executions::Client#list_executions. -# -def list_executions - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Workflows::Executions::V1beta::Executions::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Workflows::Executions::V1beta::ListExecutionsRequest.new - - # Call the list_executions method. - result = client.list_executions 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::Workflows::Executions::V1beta::Execution. - p item - end -end -# [END workflowexecutions_v1beta_generated_Executions_ListExecutions_sync] diff --git a/owl-bot-staging/google-cloud-workflows-executions-v1beta/snippets/snippet_metadata_google.cloud.workflows.executions.v1beta.json b/owl-bot-staging/google-cloud-workflows-executions-v1beta/snippets/snippet_metadata_google.cloud.workflows.executions.v1beta.json deleted file mode 100644 index 598ce53245c5..000000000000 --- a/owl-bot-staging/google-cloud-workflows-executions-v1beta/snippets/snippet_metadata_google.cloud.workflows.executions.v1beta.json +++ /dev/null @@ -1,175 +0,0 @@ -{ - "client_library": { - "name": "google-cloud-workflows-executions-v1beta", - "version": "", - "language": "RUBY", - "apis": [ - { - "id": "google.cloud.workflows.executions.v1beta", - "version": "v1beta" - } - ] - }, - "snippets": [ - { - "region_tag": "workflowexecutions_v1beta_generated_Executions_ListExecutions_sync", - "title": "Snippet for the list_executions call in the Executions service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Workflows::Executions::V1beta::Executions::Client#list_executions.", - "file": "executions/list_executions.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_executions", - "full_name": "::Google::Cloud::Workflows::Executions::V1beta::Executions::Client#list_executions", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Workflows::Executions::V1beta::ListExecutionsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Workflows::Executions::V1beta::ListExecutionsResponse", - "client": { - "short_name": "Executions::Client", - "full_name": "::Google::Cloud::Workflows::Executions::V1beta::Executions::Client" - }, - "method": { - "short_name": "ListExecutions", - "full_name": "google.cloud.workflows.executions.v1beta.Executions.ListExecutions", - "service": { - "short_name": "Executions", - "full_name": "google.cloud.workflows.executions.v1beta.Executions" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "workflowexecutions_v1beta_generated_Executions_CreateExecution_sync", - "title": "Snippet for the create_execution call in the Executions service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Workflows::Executions::V1beta::Executions::Client#create_execution.", - "file": "executions/create_execution.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_execution", - "full_name": "::Google::Cloud::Workflows::Executions::V1beta::Executions::Client#create_execution", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Workflows::Executions::V1beta::CreateExecutionRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Workflows::Executions::V1beta::Execution", - "client": { - "short_name": "Executions::Client", - "full_name": "::Google::Cloud::Workflows::Executions::V1beta::Executions::Client" - }, - "method": { - "short_name": "CreateExecution", - "full_name": "google.cloud.workflows.executions.v1beta.Executions.CreateExecution", - "service": { - "short_name": "Executions", - "full_name": "google.cloud.workflows.executions.v1beta.Executions" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "workflowexecutions_v1beta_generated_Executions_GetExecution_sync", - "title": "Snippet for the get_execution call in the Executions service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Workflows::Executions::V1beta::Executions::Client#get_execution.", - "file": "executions/get_execution.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_execution", - "full_name": "::Google::Cloud::Workflows::Executions::V1beta::Executions::Client#get_execution", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Workflows::Executions::V1beta::GetExecutionRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Workflows::Executions::V1beta::Execution", - "client": { - "short_name": "Executions::Client", - "full_name": "::Google::Cloud::Workflows::Executions::V1beta::Executions::Client" - }, - "method": { - "short_name": "GetExecution", - "full_name": "google.cloud.workflows.executions.v1beta.Executions.GetExecution", - "service": { - "short_name": "Executions", - "full_name": "google.cloud.workflows.executions.v1beta.Executions" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "workflowexecutions_v1beta_generated_Executions_CancelExecution_sync", - "title": "Snippet for the cancel_execution call in the Executions service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Workflows::Executions::V1beta::Executions::Client#cancel_execution.", - "file": "executions/cancel_execution.rb", - "language": "RUBY", - "client_method": { - "short_name": "cancel_execution", - "full_name": "::Google::Cloud::Workflows::Executions::V1beta::Executions::Client#cancel_execution", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Workflows::Executions::V1beta::CancelExecutionRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Workflows::Executions::V1beta::Execution", - "client": { - "short_name": "Executions::Client", - "full_name": "::Google::Cloud::Workflows::Executions::V1beta::Executions::Client" - }, - "method": { - "short_name": "CancelExecution", - "full_name": "google.cloud.workflows.executions.v1beta.Executions.CancelExecution", - "service": { - "short_name": "Executions", - "full_name": "google.cloud.workflows.executions.v1beta.Executions" - } - } - }, - "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-workflows-executions-v1beta/test/google/cloud/workflows/executions/v1beta/executions_paths_test.rb b/owl-bot-staging/google-cloud-workflows-executions-v1beta/test/google/cloud/workflows/executions/v1beta/executions_paths_test.rb deleted file mode 100644 index d23ec98d8085..000000000000 --- a/owl-bot-staging/google-cloud-workflows-executions-v1beta/test/google/cloud/workflows/executions/v1beta/executions_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/workflows/executions/v1beta/executions" - -class ::Google::Cloud::Workflows::Executions::V1beta::Executions::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_execution_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Workflows::Executions::V1beta::Executions::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.execution_path project: "value0", location: "value1", workflow: "value2", execution: "value3" - assert_equal "projects/value0/locations/value1/workflows/value2/executions/value3", path - end - end - - def test_workflow_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Workflows::Executions::V1beta::Executions::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.workflow_path project: "value0", location: "value1", workflow: "value2" - assert_equal "projects/value0/locations/value1/workflows/value2", path - end - end -end diff --git a/owl-bot-staging/google-cloud-workflows-executions-v1beta/test/google/cloud/workflows/executions/v1beta/executions_test.rb b/owl-bot-staging/google-cloud-workflows-executions-v1beta/test/google/cloud/workflows/executions/v1beta/executions_test.rb deleted file mode 100644 index c293feaf68bc..000000000000 --- a/owl-bot-staging/google-cloud-workflows-executions-v1beta/test/google/cloud/workflows/executions/v1beta/executions_test.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! - -require "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/workflows/executions/v1beta/executions_pb" -require "google/cloud/workflows/executions/v1beta/executions" - -class ::Google::Cloud::Workflows::Executions::V1beta::Executions::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_executions - # Create GRPC objects. - grpc_response = ::Google::Cloud::Workflows::Executions::V1beta::ListExecutionsResponse.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 = :EXECUTION_VIEW_UNSPECIFIED - - list_executions_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_executions, name - assert_kind_of ::Google::Cloud::Workflows::Executions::V1beta::ListExecutionsRequest, request - assert_equal "hello world", request["parent"] - assert_equal 42, request["page_size"] - assert_equal "hello world", request["page_token"] - assert_equal :EXECUTION_VIEW_UNSPECIFIED, request["view"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_executions_client_stub do - # Create client - client = ::Google::Cloud::Workflows::Executions::V1beta::Executions::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_executions({ parent: parent, page_size: page_size, page_token: page_token, view: view }) 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_executions parent: parent, page_size: page_size, page_token: page_token, view: view 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_executions ::Google::Cloud::Workflows::Executions::V1beta::ListExecutionsRequest.new(parent: parent, page_size: page_size, page_token: page_token, view: view) 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_executions({ parent: parent, page_size: page_size, page_token: page_token, view: view }, 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_executions(::Google::Cloud::Workflows::Executions::V1beta::ListExecutionsRequest.new(parent: parent, page_size: page_size, page_token: page_token, view: view), 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_executions_client_stub.call_rpc_count - end - end - - def test_create_execution - # Create GRPC objects. - grpc_response = ::Google::Cloud::Workflows::Executions::V1beta::Execution.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" - execution = {} - - create_execution_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_execution, name - assert_kind_of ::Google::Cloud::Workflows::Executions::V1beta::CreateExecutionRequest, request - assert_equal "hello world", request["parent"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Workflows::Executions::V1beta::Execution), request["execution"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_execution_client_stub do - # Create client - client = ::Google::Cloud::Workflows::Executions::V1beta::Executions::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_execution({ parent: parent, execution: execution }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.create_execution parent: parent, execution: execution do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.create_execution ::Google::Cloud::Workflows::Executions::V1beta::CreateExecutionRequest.new(parent: parent, execution: execution) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.create_execution({ parent: parent, execution: execution }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.create_execution(::Google::Cloud::Workflows::Executions::V1beta::CreateExecutionRequest.new(parent: parent, execution: execution), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, create_execution_client_stub.call_rpc_count - end - end - - def test_get_execution - # Create GRPC objects. - grpc_response = ::Google::Cloud::Workflows::Executions::V1beta::Execution.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" - view = :EXECUTION_VIEW_UNSPECIFIED - - get_execution_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_execution, name - assert_kind_of ::Google::Cloud::Workflows::Executions::V1beta::GetExecutionRequest, request - assert_equal "hello world", request["name"] - assert_equal :EXECUTION_VIEW_UNSPECIFIED, request["view"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_execution_client_stub do - # Create client - client = ::Google::Cloud::Workflows::Executions::V1beta::Executions::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_execution({ name: name, view: view }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_execution name: name, view: view do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_execution ::Google::Cloud::Workflows::Executions::V1beta::GetExecutionRequest.new(name: name, view: view) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_execution({ name: name, view: view }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_execution(::Google::Cloud::Workflows::Executions::V1beta::GetExecutionRequest.new(name: name, view: view), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, get_execution_client_stub.call_rpc_count - end - end - - def test_cancel_execution - # Create GRPC objects. - grpc_response = ::Google::Cloud::Workflows::Executions::V1beta::Execution.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_execution_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :cancel_execution, name - assert_kind_of ::Google::Cloud::Workflows::Executions::V1beta::CancelExecutionRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, cancel_execution_client_stub do - # Create client - client = ::Google::Cloud::Workflows::Executions::V1beta::Executions::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.cancel_execution({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.cancel_execution name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.cancel_execution ::Google::Cloud::Workflows::Executions::V1beta::CancelExecutionRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.cancel_execution({ 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_execution(::Google::Cloud::Workflows::Executions::V1beta::CancelExecutionRequest.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_execution_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::Workflows::Executions::V1beta::Executions::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::Workflows::Executions::V1beta::Executions::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::Workflows::Executions::V1beta::Executions::Client.new do |config| - config.credentials = creds - end - assert_kind_of ::Google::Cloud::Workflows::Executions::V1beta::Executions::Client, client - assert_equal creds, client.configure.credentials - end - end -end diff --git a/owl-bot-staging/google-cloud-workflows-executions-v1beta/test/helper.rb b/owl-bot-staging/google-cloud-workflows-executions-v1beta/test/helper.rb deleted file mode 100644 index 672b337030e7..000000000000 --- a/owl-bot-staging/google-cloud-workflows-executions-v1beta/test/helper.rb +++ /dev/null @@ -1,26 +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/mock" -require "minitest/rg" - -require "grpc" - -require "ostruct" diff --git a/owl-bot-staging/google-cloud-workflows-v1/.gitignore b/owl-bot-staging/google-cloud-workflows-v1/.gitignore deleted file mode 100644 index 0135b6bc6cfc..000000000000 --- a/owl-bot-staging/google-cloud-workflows-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-workflows-v1/.repo-metadata.json b/owl-bot-staging/google-cloud-workflows-v1/.repo-metadata.json deleted file mode 100644 index 69f7509959da..000000000000 --- a/owl-bot-staging/google-cloud-workflows-v1/.repo-metadata.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "api_id": "workflows.googleapis.com", - "api_shortname": "workflows", - "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-workflows-v1/latest", - "distribution_name": "google-cloud-workflows-v1", - "is_cloud": true, - "language": "ruby", - "name": "workflows", - "name_pretty": "Workflows V1 API", - "product_documentation": "https://cloud.google.com/workflows/", - "release_level": "unreleased", - "repo": "googleapis/google-cloud-ruby", - "requires_billing": true, - "ruby-cloud-description": "Workflows link series of serverless tasks together in an order you define. Combine the power of Google Cloud's APIs, serverless products like Cloud Functions and Cloud Run, and calls to external APIs to create flexible serverless applications. Workflows requires no infrastructure management and scales seamlessly with demand, including scaling down to zero.. Note that google-cloud-workflows-v1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-workflows instead. See the readme for more details.", - "ruby-cloud-env-prefix": "WORKFLOWS", - "ruby-cloud-product-url": "https://cloud.google.com/workflows/", - "library_type": "GAPIC_AUTO" -} diff --git a/owl-bot-staging/google-cloud-workflows-v1/.rubocop.yml b/owl-bot-staging/google-cloud-workflows-v1/.rubocop.yml deleted file mode 100644 index f3347d525c00..000000000000 --- a/owl-bot-staging/google-cloud-workflows-v1/.rubocop.yml +++ /dev/null @@ -1,33 +0,0 @@ -inherit_gem: - google-style: google-style.yml - -AllCops: - Exclude: - - "google-cloud-workflows-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-workflows-v1.rb" diff --git a/owl-bot-staging/google-cloud-workflows-v1/.toys.rb b/owl-bot-staging/google-cloud-workflows-v1/.toys.rb deleted file mode 100644 index 177e22456e8a..000000000000 --- a/owl-bot-staging/google-cloud-workflows-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-workflows-v1/.yardopts b/owl-bot-staging/google-cloud-workflows-v1/.yardopts deleted file mode 100644 index 3d801a2a7c84..000000000000 --- a/owl-bot-staging/google-cloud-workflows-v1/.yardopts +++ /dev/null @@ -1,12 +0,0 @@ ---no-private ---title="Workflows 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-workflows-v1/AUTHENTICATION.md b/owl-bot-staging/google-cloud-workflows-v1/AUTHENTICATION.md deleted file mode 100644 index e217594f764c..000000000000 --- a/owl-bot-staging/google-cloud-workflows-v1/AUTHENTICATION.md +++ /dev/null @@ -1,122 +0,0 @@ -# Authentication - -The recommended way to authenticate to the google-cloud-workflows-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-workflows-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/workflows/v1" - -client = ::Google::Cloud::Workflows::V1::Workflows::Client.new do |config| - config.credentials = "path/to/credentialfile.json" -end -``` - -To configure a credentials file globally for all clients: - -```ruby -require "google/cloud/workflows/v1" - -::Google::Cloud::Workflows::V1::Workflows::Client.configure do |config| - config.credentials = "path/to/credentialfile.json" -end - -client = ::Google::Cloud::Workflows::V1::Workflows::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-workflows-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/workflows/v1" - -ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" - -client = ::Google::Cloud::Workflows::V1::Workflows::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-workflows-v1/CHANGELOG.md b/owl-bot-staging/google-cloud-workflows-v1/CHANGELOG.md deleted file mode 100644 index f88957a62ba2..000000000000 --- a/owl-bot-staging/google-cloud-workflows-v1/CHANGELOG.md +++ /dev/null @@ -1,2 +0,0 @@ -# Release History - diff --git a/owl-bot-staging/google-cloud-workflows-v1/Gemfile b/owl-bot-staging/google-cloud-workflows-v1/Gemfile deleted file mode 100644 index 1d08558908d8..000000000000 --- a/owl-bot-staging/google-cloud-workflows-v1/Gemfile +++ /dev/null @@ -1,14 +0,0 @@ -source "https://rubygems.org" - -gemspec - -gem "google-style", "~> 1.32.0" -gem "irb", "~> 1.17" -gem "minitest", "~> 6.0.2" -gem "minitest-focus", "~> 1.4" -gem "minitest-mock", "~> 5.27" -gem "minitest-rg", "~> 5.3" -gem "ostruct", "~> 0.5.5" -gem "rake", ">= 13.0" -gem "redcarpet", "~> 3.6" -gem "yard", "~> 0.9" diff --git a/owl-bot-staging/google-cloud-workflows-v1/LICENSE.md b/owl-bot-staging/google-cloud-workflows-v1/LICENSE.md deleted file mode 100644 index c261857ba6ad..000000000000 --- a/owl-bot-staging/google-cloud-workflows-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-workflows-v1/README.md b/owl-bot-staging/google-cloud-workflows-v1/README.md deleted file mode 100644 index d7ab36838d46..000000000000 --- a/owl-bot-staging/google-cloud-workflows-v1/README.md +++ /dev/null @@ -1,154 +0,0 @@ -# Ruby Client for the Workflows V1 API - -Manage workflow definitions. To execute workflows and manage executions, see the Workflows Executions API. - -Workflows link series of serverless tasks together in an order you define. Combine the power of Google Cloud's APIs, serverless products like Cloud Functions and Cloud Run, and calls to external APIs to create flexible serverless applications. Workflows requires no infrastructure management and scales seamlessly with demand, including scaling down to zero.. - -https://github.com/googleapis/google-cloud-ruby - -This gem is a _versioned_ client. It provides basic client classes for a -specific version of the Workflows V1 API. Most users should consider using -the main client gem, -[google-cloud-workflows](https://rubygems.org/gems/google-cloud-workflows). -See the section below titled *Which client should I use?* for more information. - -## Installation - -``` -$ gem install google-cloud-workflows-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/workflows.googleapis.com) -1. [Set up authentication.](AUTHENTICATION.md) - -## Quick Start - -```ruby -require "google/cloud/workflows/v1" - -client = ::Google::Cloud::Workflows::V1::Workflows::Client.new -request = ::Google::Cloud::Workflows::V1::ListWorkflowsRequest.new # (request fields as keyword arguments...) -response = client.list_workflows request -``` - -View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-workflows-v1/latest) -for class and method documentation. - -See also the [Product Documentation](https://cloud.google.com/workflows/) -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/workflows/v1" -require "logger" - -client = ::Google::Cloud::Workflows::V1::Workflows::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-workflows`, -and lower-level _versioned_ client libraries with names such as -`google-cloud-workflows-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-workflows`. -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-workflows-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-workflows-v1/Rakefile b/owl-bot-staging/google-cloud-workflows-v1/Rakefile deleted file mode 100644 index 13816b0b43f6..000000000000 --- a/owl-bot-staging/google-cloud-workflows-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-workflows-v1 acceptance tests." -task :acceptance, :project, :keyfile do |t, args| - project = args[:project] - project ||= - ENV["WORKFLOWS_TEST_PROJECT"] || - ENV["GCLOUD_TEST_PROJECT"] - keyfile = args[:keyfile] - keyfile ||= - ENV["WORKFLOWS_TEST_KEYFILE"] || - ENV["GCLOUD_TEST_KEYFILE"] - if keyfile - keyfile = File.read keyfile - else - keyfile ||= - ENV["WORKFLOWS_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 WORKFLOWS_TEST_PROJECT=test123 WORKFLOWS_TEST_KEYFILE=/path/to/keyfile.json rake acceptance" - end - require "google/cloud/workflows/v1/workflows/credentials" - ::Google::Cloud::Workflows::V1::Workflows::Credentials.env_vars.each do |path| - ENV[path] = nil - end - ENV["WORKFLOWS_PROJECT"] = project - ENV["WORKFLOWS_TEST_PROJECT"] = project - ENV["WORKFLOWS_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-workflows-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-workflows-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-workflows-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-workflows-v1 gem does not have doctest tests." -end - -desc "Run the CI build" -task :ci do - header "BUILDING google-cloud-workflows-v1" - header "google-cloud-workflows-v1 rubocop", "*" - Rake::Task[:rubocop].invoke - header "google-cloud-workflows-v1 yard", "*" - Rake::Task[:yard].invoke - header "google-cloud-workflows-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-workflows-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-workflows-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-workflows-v1/gapic_metadata.json b/owl-bot-staging/google-cloud-workflows-v1/gapic_metadata.json deleted file mode 100644 index ec6940cb8f05..000000000000 --- a/owl-bot-staging/google-cloud-workflows-v1/gapic_metadata.json +++ /dev/null @@ -1,48 +0,0 @@ -{ - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", - "language": "ruby", - "protoPackage": "google.cloud.workflows.v1", - "libraryPackage": "::Google::Cloud::Workflows::V1", - "services": { - "Workflows": { - "clients": { - "grpc": { - "libraryClient": "::Google::Cloud::Workflows::V1::Workflows::Client", - "rpcs": { - "ListWorkflows": { - "methods": [ - "list_workflows" - ] - }, - "GetWorkflow": { - "methods": [ - "get_workflow" - ] - }, - "CreateWorkflow": { - "methods": [ - "create_workflow" - ] - }, - "DeleteWorkflow": { - "methods": [ - "delete_workflow" - ] - }, - "UpdateWorkflow": { - "methods": [ - "update_workflow" - ] - }, - "ListWorkflowRevisions": { - "methods": [ - "list_workflow_revisions" - ] - } - } - } - } - } - } -} diff --git a/owl-bot-staging/google-cloud-workflows-v1/google-cloud-workflows-v1.gemspec b/owl-bot-staging/google-cloud-workflows-v1/google-cloud-workflows-v1.gemspec deleted file mode 100644 index 8eefcc91c52b..000000000000 --- a/owl-bot-staging/google-cloud-workflows-v1/google-cloud-workflows-v1.gemspec +++ /dev/null @@ -1,29 +0,0 @@ -# -*- ruby -*- -# encoding: utf-8 - -require File.expand_path("lib/google/cloud/workflows/v1/version", __dir__) - -Gem::Specification.new do |gem| - gem.name = "google-cloud-workflows-v1" - gem.version = Google::Cloud::Workflows::V1::VERSION - - gem.authors = ["Google LLC"] - gem.email = "googleapis-packages@google.com" - gem.description = "Workflows link series of serverless tasks together in an order you define. Combine the power of Google Cloud's APIs, serverless products like Cloud Functions and Cloud Run, and calls to external APIs to create flexible serverless applications. Workflows requires no infrastructure management and scales seamlessly with demand, including scaling down to zero.. Note that google-cloud-workflows-v1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-workflows instead. See the readme for more details." - gem.summary = "Manage workflow definitions. To execute workflows and manage executions, see the Workflows Executions API." - 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.2" - - gem.add_dependency "gapic-common", "~> 1.2" - gem.add_dependency "google-cloud-errors", "~> 1.0" - gem.add_dependency "google-cloud-location", "~> 1.0" -end diff --git a/owl-bot-staging/google-cloud-workflows-v1/lib/google-cloud-workflows-v1.rb b/owl-bot-staging/google-cloud-workflows-v1/lib/google-cloud-workflows-v1.rb deleted file mode 100644 index 1b638a3e422e..000000000000 --- a/owl-bot-staging/google-cloud-workflows-v1/lib/google-cloud-workflows-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/workflows/v1" diff --git a/owl-bot-staging/google-cloud-workflows-v1/lib/google/cloud/workflows/v1.rb b/owl-bot-staging/google-cloud-workflows-v1/lib/google/cloud/workflows/v1.rb deleted file mode 100644 index bda78f5b4bc6..000000000000 --- a/owl-bot-staging/google-cloud-workflows-v1/lib/google/cloud/workflows/v1.rb +++ /dev/null @@ -1,45 +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/workflows/v1/workflows" -require "google/cloud/workflows/v1/version" - -module Google - module Cloud - module Workflows - ## - # API client module. - # - # @example Load this package, including all its services, and instantiate a gRPC client - # - # require "google/cloud/workflows/v1" - # client = ::Google::Cloud::Workflows::V1::Workflows::Client.new - # - # @example Load this package, including all its services, and instantiate a REST client - # - # require "google/cloud/workflows/v1" - # client = ::Google::Cloud::Workflows::V1::Workflows::Rest::Client.new - # - module V1 - end - end - end -end - -helper_path = ::File.join __dir__, "v1", "_helpers.rb" -require "google/cloud/workflows/v1/_helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-workflows-v1/lib/google/cloud/workflows/v1/bindings_override.rb b/owl-bot-staging/google-cloud-workflows-v1/lib/google/cloud/workflows/v1/bindings_override.rb deleted file mode 100644 index 793a02bd64cd..000000000000 --- a/owl-bot-staging/google-cloud-workflows-v1/lib/google/cloud/workflows/v1/bindings_override.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! - -require "gapic/rest" - -module Google - module Cloud - module Workflows - ## - # @example Loading just the REST part of this package, including all its services, and instantiating a REST client - # - # require "google/cloud/workflows/v1/rest" - # client = ::Google::Cloud::Workflows::V1::Workflows::Rest::Client.new - # - module V1 - ## - # @private - # Initialize the mixin bindings configuration - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "Workflows"] - 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 - end - yield @configure if block_given? - @configure - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-workflows-v1/lib/google/cloud/workflows/v1/rest.rb b/owl-bot-staging/google-cloud-workflows-v1/lib/google/cloud/workflows/v1/rest.rb deleted file mode 100644 index 16f410759b32..000000000000 --- a/owl-bot-staging/google-cloud-workflows-v1/lib/google/cloud/workflows/v1/rest.rb +++ /dev/null @@ -1,38 +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/workflows/v1/workflows/rest" -require "google/cloud/workflows/v1/bindings_override" -require "google/cloud/workflows/v1/version" - -module Google - module Cloud - module Workflows - ## - # To load just the REST part of this package, including all its services, and instantiate a REST client: - # - # @example - # - # require "google/cloud/workflows/v1/rest" - # client = ::Google::Cloud::Workflows::V1::Workflows::Rest::Client.new - # - module V1 - end - end - end -end diff --git a/owl-bot-staging/google-cloud-workflows-v1/lib/google/cloud/workflows/v1/version.rb b/owl-bot-staging/google-cloud-workflows-v1/lib/google/cloud/workflows/v1/version.rb deleted file mode 100644 index ad8aed01cf91..000000000000 --- a/owl-bot-staging/google-cloud-workflows-v1/lib/google/cloud/workflows/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 Workflows - module V1 - VERSION = "0.0.1" - end - end - end -end diff --git a/owl-bot-staging/google-cloud-workflows-v1/lib/google/cloud/workflows/v1/workflows.rb b/owl-bot-staging/google-cloud-workflows-v1/lib/google/cloud/workflows/v1/workflows.rb deleted file mode 100644 index f4818691ad45..000000000000 --- a/owl-bot-staging/google-cloud-workflows-v1/lib/google/cloud/workflows/v1/workflows.rb +++ /dev/null @@ -1,58 +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/workflows/v1/version" - -require "google/cloud/workflows/v1/workflows/credentials" -require "google/cloud/workflows/v1/workflows/paths" -require "google/cloud/workflows/v1/workflows/operations" -require "google/cloud/workflows/v1/workflows/client" -require "google/cloud/workflows/v1/workflows/rest" - -module Google - module Cloud - module Workflows - module V1 - ## - # Workflows is used to deploy and execute workflow programs. - # Workflows makes sure the program executes reliably, despite hardware and - # networking interruptions. - # - # @example Load this service and instantiate a gRPC client - # - # require "google/cloud/workflows/v1/workflows" - # client = ::Google::Cloud::Workflows::V1::Workflows::Client.new - # - # @example Load this service and instantiate a REST client - # - # require "google/cloud/workflows/v1/workflows/rest" - # client = ::Google::Cloud::Workflows::V1::Workflows::Rest::Client.new - # - module Workflows - end - end - end - end -end - -helper_path = ::File.join __dir__, "workflows", "helpers.rb" -require "google/cloud/workflows/v1/workflows/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-workflows-v1/lib/google/cloud/workflows/v1/workflows/client.rb b/owl-bot-staging/google-cloud-workflows-v1/lib/google/cloud/workflows/v1/workflows/client.rb deleted file mode 100644 index 55f6b6df1255..000000000000 --- a/owl-bot-staging/google-cloud-workflows-v1/lib/google/cloud/workflows/v1/workflows/client.rb +++ /dev/null @@ -1,1074 +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/workflows/v1/workflows_pb" -require "google/cloud/location" - -module Google - module Cloud - module Workflows - module V1 - module Workflows - ## - # Client for the Workflows service. - # - # Workflows is used to deploy and execute workflow programs. - # Workflows makes sure the program executes reliably, despite hardware and - # networking interruptions. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "workflows.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :workflows_stub - - ## - # Configure the Workflows Client class. - # - # See {::Google::Cloud::Workflows::V1::Workflows::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all Workflows clients - # ::Google::Cloud::Workflows::V1::Workflows::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", "Workflows", "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 - end - yield @configure if block_given? - @configure - end - - ## - # Configure the Workflows 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::Workflows::V1::Workflows::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 - @workflows_stub.universe_domain - end - - ## - # Create a new Workflows client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Workflows::V1::Workflows::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Workflows::V1::Workflows::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Workflows 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/workflows/v1/workflows_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 - - @workflows_stub = ::Gapic::ServiceStub.new( - ::Google::Cloud::Workflows::V1::Workflows::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 - ) - - @workflows_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 = @workflows_stub.endpoint - config.universe_domain = @workflows_stub.universe_domain - config.logger = @workflows_stub.logger if config.respond_to? :logger= - end - end - - ## - # Get the associated client for long-running operations. - # - # @return [::Google::Cloud::Workflows::V1::Workflows::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 - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @workflows_stub.logger - end - - # Service calls - - ## - # Lists workflows in a given project and location. - # The default order is not specified. - # - # @overload list_workflows(request, options = nil) - # Pass arguments to `list_workflows` via a request object, either of type - # {::Google::Cloud::Workflows::V1::ListWorkflowsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Workflows::V1::ListWorkflowsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_workflows(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) - # Pass arguments to `list_workflows` via keyword arguments. Note that at - # least one keyword argument is 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. Project and location from which the workflows should be listed. - # Format: projects/\\{project}/locations/\\{location} - # @param page_size [::Integer] - # Maximum number of workflows to return per call. The service might return - # fewer than this value even if not at the end of the collection. If a value - # is not specified, a default value of 500 is used. The maximum permitted - # value is 1000 and values greater than 1000 are coerced down to 1000. - # @param page_token [::String] - # A page token, received from a previous `ListWorkflows` call. - # Provide this to retrieve the subsequent page. - # - # When paginating, all other parameters provided to `ListWorkflows` must - # match the call that provided the page token. - # @param filter [::String] - # Filter to restrict results to specific workflows. - # For details, see AIP-160. - # - # For example, if you are using the Google APIs Explorer: - # - # `state="SUCCEEDED"` - # - # or - # - # `createTime>"2023-08-01" AND state="FAILED"` - # @param order_by [::String] - # Comma-separated list of fields that specify the order of the results. - # Default sorting order for a field is ascending. To specify descending order - # for a field, append a "desc" suffix. - # If not specified, the results are returned in an unspecified order. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Workflows::V1::Workflow>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::Workflows::V1::Workflow>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/workflows/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Workflows::V1::Workflows::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Workflows::V1::ListWorkflowsRequest.new - # - # # Call the list_workflows method. - # result = client.list_workflows 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::Workflows::V1::Workflow. - # p item - # end - # - def list_workflows request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workflows::V1::ListWorkflowsRequest - - # Converts hash 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_workflows.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::Workflows::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_workflows.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_workflows.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @workflows_stub.call_rpc :list_workflows, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @workflows_stub, :list_workflows, 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 - - ## - # Gets details of a single workflow. - # - # @overload get_workflow(request, options = nil) - # Pass arguments to `get_workflow` via a request object, either of type - # {::Google::Cloud::Workflows::V1::GetWorkflowRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Workflows::V1::GetWorkflowRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_workflow(name: nil, revision_id: nil) - # Pass arguments to `get_workflow` via keyword arguments. Note that at - # least one keyword argument is 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 workflow for which information should be retrieved. - # Format: projects/\\{project}/locations/\\{location}/workflows/\\{workflow} - # @param revision_id [::String] - # Optional. The revision of the workflow to retrieve. If the revision_id is - # empty, the latest revision is retrieved. - # The format is "000001-a4d", where the first six characters define - # the zero-padded decimal revision number. They are followed by a hyphen and - # three hexadecimal characters. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Workflows::V1::Workflow] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Workflows::V1::Workflow] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/workflows/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Workflows::V1::Workflows::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Workflows::V1::GetWorkflowRequest.new - # - # # Call the get_workflow method. - # result = client.get_workflow request - # - # # The returned object is of type Google::Cloud::Workflows::V1::Workflow. - # p result - # - def get_workflow request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workflows::V1::GetWorkflowRequest - - # Converts hash 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_workflow.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::Workflows::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_workflow.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_workflow.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @workflows_stub.call_rpc :get_workflow, 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 workflow. If a workflow with the specified name already - # exists in the specified project and location, the long running operation - # returns a [ALREADY_EXISTS][google.rpc.Code.ALREADY_EXISTS] error. - # - # @overload create_workflow(request, options = nil) - # Pass arguments to `create_workflow` via a request object, either of type - # {::Google::Cloud::Workflows::V1::CreateWorkflowRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Workflows::V1::CreateWorkflowRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_workflow(parent: nil, workflow: nil, workflow_id: nil) - # Pass arguments to `create_workflow` via keyword arguments. Note that at - # least one keyword argument is 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. Project and location in which the workflow should be created. - # Format: projects/\\{project}/locations/\\{location} - # @param workflow [::Google::Cloud::Workflows::V1::Workflow, ::Hash] - # Required. Workflow to be created. - # @param workflow_id [::String] - # Required. The ID of the workflow to be created. It has to fulfill the - # following requirements: - # - # * Must contain only letters, numbers, underscores and hyphens. - # * Must start with a letter. - # * Must be between 1-64 characters. - # * Must end with a number or a letter. - # * Must be unique within the customer project and location. - # - # @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/workflows/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Workflows::V1::Workflows::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Workflows::V1::CreateWorkflowRequest.new - # - # # Call the create_workflow method. - # result = client.create_workflow 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_workflow request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workflows::V1::CreateWorkflowRequest - - # Converts hash 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_workflow.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::Workflows::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_workflow.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_workflow.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @workflows_stub.call_rpc :create_workflow, 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 workflow with the specified name. - # This method also cancels and deletes all running executions of the - # workflow. - # - # @overload delete_workflow(request, options = nil) - # Pass arguments to `delete_workflow` via a request object, either of type - # {::Google::Cloud::Workflows::V1::DeleteWorkflowRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Workflows::V1::DeleteWorkflowRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_workflow(name: nil) - # Pass arguments to `delete_workflow` via keyword arguments. Note that at - # least one keyword argument is 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 workflow to be deleted. - # Format: projects/\\{project}/locations/\\{location}/workflows/\\{workflow} - # - # @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/workflows/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Workflows::V1::Workflows::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Workflows::V1::DeleteWorkflowRequest.new - # - # # Call the delete_workflow method. - # result = client.delete_workflow 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_workflow request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workflows::V1::DeleteWorkflowRequest - - # Converts hash 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_workflow.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::Workflows::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_workflow.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_workflow.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @workflows_stub.call_rpc :delete_workflow, 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 - - ## - # Updates an existing workflow. - # Running this method has no impact on already running executions of the - # workflow. A new revision of the workflow might be created as a result of a - # successful update operation. In that case, the new revision is used - # in new workflow executions. - # - # @overload update_workflow(request, options = nil) - # Pass arguments to `update_workflow` via a request object, either of type - # {::Google::Cloud::Workflows::V1::UpdateWorkflowRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Workflows::V1::UpdateWorkflowRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_workflow(workflow: nil, update_mask: nil) - # Pass arguments to `update_workflow` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param workflow [::Google::Cloud::Workflows::V1::Workflow, ::Hash] - # Required. Workflow to be updated. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # List of fields to be updated. If not present, the entire workflow - # will be updated. - # - # @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/workflows/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Workflows::V1::Workflows::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Workflows::V1::UpdateWorkflowRequest.new - # - # # Call the update_workflow method. - # result = client.update_workflow 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 update_workflow request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workflows::V1::UpdateWorkflowRequest - - # Converts hash 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_workflow.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::Workflows::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.workflow&.name - header_params["workflow.name"] = request.workflow.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_workflow.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_workflow.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @workflows_stub.call_rpc :update_workflow, 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 - - ## - # Lists revisions for a given workflow. - # - # @overload list_workflow_revisions(request, options = nil) - # Pass arguments to `list_workflow_revisions` via a request object, either of type - # {::Google::Cloud::Workflows::V1::ListWorkflowRevisionsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Workflows::V1::ListWorkflowRevisionsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_workflow_revisions(name: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_workflow_revisions` via keyword arguments. Note that at - # least one keyword argument is 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. Workflow for which the revisions should be listed. - # Format: projects/\\{project}/locations/\\{location}/workflows/\\{workflow} - # @param page_size [::Integer] - # The maximum number of revisions to return per page. If a value is not - # specified, a default value of 20 is used. The maximum permitted value is - # 100. Values greater than 100 are coerced down to 100. - # @param page_token [::String] - # The page token, received from a previous ListWorkflowRevisions call. - # Provide this to retrieve the subsequent page. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Workflows::V1::Workflow>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::Workflows::V1::Workflow>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/workflows/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Workflows::V1::Workflows::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Workflows::V1::ListWorkflowRevisionsRequest.new - # - # # Call the list_workflow_revisions method. - # result = client.list_workflow_revisions 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::Workflows::V1::Workflow. - # p item - # end - # - def list_workflow_revisions request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workflows::V1::ListWorkflowRevisionsRequest - - # Converts hash 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_workflow_revisions.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::Workflows::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_workflow_revisions.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_workflow_revisions.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @workflows_stub.call_rpc :list_workflow_revisions, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @workflows_stub, :list_workflow_revisions, 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 Workflows API. - # - # This class represents the configuration for Workflows, - # 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::Workflows::V1::Workflows::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_workflows to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Workflows::V1::Workflows::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_workflows.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Workflows::V1::Workflows::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_workflows.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::Workflows::V1::Workflows::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 = "workflows.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 Workflows 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_workflows` - # @return [::Gapic::Config::Method] - # - attr_reader :list_workflows - ## - # RPC-specific configuration for `get_workflow` - # @return [::Gapic::Config::Method] - # - attr_reader :get_workflow - ## - # RPC-specific configuration for `create_workflow` - # @return [::Gapic::Config::Method] - # - attr_reader :create_workflow - ## - # RPC-specific configuration for `delete_workflow` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_workflow - ## - # RPC-specific configuration for `update_workflow` - # @return [::Gapic::Config::Method] - # - attr_reader :update_workflow - ## - # RPC-specific configuration for `list_workflow_revisions` - # @return [::Gapic::Config::Method] - # - attr_reader :list_workflow_revisions - - # @private - def initialize parent_rpcs = nil - list_workflows_config = parent_rpcs.list_workflows if parent_rpcs.respond_to? :list_workflows - @list_workflows = ::Gapic::Config::Method.new list_workflows_config - get_workflow_config = parent_rpcs.get_workflow if parent_rpcs.respond_to? :get_workflow - @get_workflow = ::Gapic::Config::Method.new get_workflow_config - create_workflow_config = parent_rpcs.create_workflow if parent_rpcs.respond_to? :create_workflow - @create_workflow = ::Gapic::Config::Method.new create_workflow_config - delete_workflow_config = parent_rpcs.delete_workflow if parent_rpcs.respond_to? :delete_workflow - @delete_workflow = ::Gapic::Config::Method.new delete_workflow_config - update_workflow_config = parent_rpcs.update_workflow if parent_rpcs.respond_to? :update_workflow - @update_workflow = ::Gapic::Config::Method.new update_workflow_config - list_workflow_revisions_config = parent_rpcs.list_workflow_revisions if parent_rpcs.respond_to? :list_workflow_revisions - @list_workflow_revisions = ::Gapic::Config::Method.new list_workflow_revisions_config - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-workflows-v1/lib/google/cloud/workflows/v1/workflows/credentials.rb b/owl-bot-staging/google-cloud-workflows-v1/lib/google/cloud/workflows/v1/workflows/credentials.rb deleted file mode 100644 index 2c4bc8c1e0e6..000000000000 --- a/owl-bot-staging/google-cloud-workflows-v1/lib/google/cloud/workflows/v1/workflows/credentials.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! - -require "googleauth" - -module Google - module Cloud - module Workflows - module V1 - module Workflows - # Credentials for the Workflows API. - class Credentials < ::Google::Auth::Credentials - self.scope = [ - "https://www.googleapis.com/auth/cloud-platform" - ] - self.env_vars = [ - "WORKFLOWS_CREDENTIALS", - "WORKFLOWS_KEYFILE", - "GOOGLE_CLOUD_CREDENTIALS", - "GOOGLE_CLOUD_KEYFILE", - "GCLOUD_KEYFILE", - "WORKFLOWS_CREDENTIALS_JSON", - "WORKFLOWS_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-workflows-v1/lib/google/cloud/workflows/v1/workflows/operations.rb b/owl-bot-staging/google-cloud-workflows-v1/lib/google/cloud/workflows/v1/workflows/operations.rb deleted file mode 100644 index 8ed984c55f7f..000000000000 --- a/owl-bot-staging/google-cloud-workflows-v1/lib/google/cloud/workflows/v1/workflows/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 Workflows - module V1 - module Workflows - # Service that implements Longrunning Operations API. - class Operations - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "workflows.$UNIVERSE_DOMAIN$" - - # @private - attr_reader :operations_stub - - ## - # Configuration for the Workflows 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 Workflows 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::Workflows::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::Workflows::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::Workflows::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::Workflows::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::Workflows::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 = "workflows.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-workflows-v1/lib/google/cloud/workflows/v1/workflows/paths.rb b/owl-bot-staging/google-cloud-workflows-v1/lib/google/cloud/workflows/v1/workflows/paths.rb deleted file mode 100644 index 7c5a1c321b45..000000000000 --- a/owl-bot-staging/google-cloud-workflows-v1/lib/google/cloud/workflows/v1/workflows/paths.rb +++ /dev/null @@ -1,113 +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 Workflows - module V1 - module Workflows - # Path helper methods for the Workflows 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 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 Workflow resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/workflows/{workflow}` - # - # @param project [String] - # @param location [String] - # @param workflow [String] - # - # @return [::String] - def workflow_path project:, location:, workflow: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/workflows/#{workflow}" - end - - extend self - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-workflows-v1/lib/google/cloud/workflows/v1/workflows/rest.rb b/owl-bot-staging/google-cloud-workflows-v1/lib/google/cloud/workflows/v1/workflows/rest.rb deleted file mode 100644 index 250354de6315..000000000000 --- a/owl-bot-staging/google-cloud-workflows-v1/lib/google/cloud/workflows/v1/workflows/rest.rb +++ /dev/null @@ -1,56 +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/workflows/v1/version" -require "google/cloud/workflows/v1/bindings_override" - -require "google/cloud/workflows/v1/workflows/credentials" -require "google/cloud/workflows/v1/workflows/paths" -require "google/cloud/workflows/v1/workflows/rest/operations" -require "google/cloud/workflows/v1/workflows/rest/client" - -module Google - module Cloud - module Workflows - module V1 - ## - # Workflows is used to deploy and execute workflow programs. - # Workflows makes sure the program executes reliably, despite hardware and - # networking interruptions. - # - # To load this service and instantiate a REST client: - # - # require "google/cloud/workflows/v1/workflows/rest" - # client = ::Google::Cloud::Workflows::V1::Workflows::Rest::Client.new - # - module Workflows - # Client for the REST transport - module Rest - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "rest", "helpers.rb" -require "google/cloud/workflows/v1/workflows/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-workflows-v1/lib/google/cloud/workflows/v1/workflows/rest/client.rb b/owl-bot-staging/google-cloud-workflows-v1/lib/google/cloud/workflows/v1/workflows/rest/client.rb deleted file mode 100644 index d0dd3d1e2592..000000000000 --- a/owl-bot-staging/google-cloud-workflows-v1/lib/google/cloud/workflows/v1/workflows/rest/client.rb +++ /dev/null @@ -1,997 +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/workflows/v1/workflows_pb" -require "google/cloud/workflows/v1/workflows/rest/service_stub" -require "google/cloud/location/rest" - -module Google - module Cloud - module Workflows - module V1 - module Workflows - module Rest - ## - # REST client for the Workflows service. - # - # Workflows is used to deploy and execute workflow programs. - # Workflows makes sure the program executes reliably, despite hardware and - # networking interruptions. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "workflows.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :workflows_stub - - ## - # Configure the Workflows Client class. - # - # See {::Google::Cloud::Workflows::V1::Workflows::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all Workflows clients - # ::Google::Cloud::Workflows::V1::Workflows::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", "Workflows", "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 - end - yield @configure if block_given? - @configure - end - - ## - # Configure the Workflows 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::Workflows::V1::Workflows::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 - @workflows_stub.universe_domain - end - - ## - # Create a new Workflows REST client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Workflows::V1::Workflows::Rest::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Workflows::V1::Workflows::Rest::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Workflows 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::Workflows::V1::Workflows::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 - - @workflows_stub = ::Google::Cloud::Workflows::V1::Workflows::Rest::ServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials, - logger: @config.logger - ) - - @workflows_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 = @workflows_stub.endpoint - config.universe_domain = @workflows_stub.universe_domain - config.bindings_override = @config.bindings_override - config.logger = @workflows_stub.logger if config.respond_to? :logger= - end - end - - ## - # Get the associated client for long-running operations. - # - # @return [::Google::Cloud::Workflows::V1::Workflows::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 - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @workflows_stub.logger - end - - # Service calls - - ## - # Lists workflows in a given project and location. - # The default order is not specified. - # - # @overload list_workflows(request, options = nil) - # Pass arguments to `list_workflows` via a request object, either of type - # {::Google::Cloud::Workflows::V1::ListWorkflowsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Workflows::V1::ListWorkflowsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_workflows(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) - # Pass arguments to `list_workflows` via keyword arguments. Note that at - # least one keyword argument is 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. Project and location from which the workflows should be listed. - # Format: projects/\\{project}/locations/\\{location} - # @param page_size [::Integer] - # Maximum number of workflows to return per call. The service might return - # fewer than this value even if not at the end of the collection. If a value - # is not specified, a default value of 500 is used. The maximum permitted - # value is 1000 and values greater than 1000 are coerced down to 1000. - # @param page_token [::String] - # A page token, received from a previous `ListWorkflows` call. - # Provide this to retrieve the subsequent page. - # - # When paginating, all other parameters provided to `ListWorkflows` must - # match the call that provided the page token. - # @param filter [::String] - # Filter to restrict results to specific workflows. - # For details, see AIP-160. - # - # For example, if you are using the Google APIs Explorer: - # - # `state="SUCCEEDED"` - # - # or - # - # `createTime>"2023-08-01" AND state="FAILED"` - # @param order_by [::String] - # Comma-separated list of fields that specify the order of the results. - # Default sorting order for a field is ascending. To specify descending order - # for a field, append a "desc" suffix. - # If not specified, the results are returned in an unspecified order. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Workflows::V1::Workflow>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Workflows::V1::Workflow>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/workflows/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Workflows::V1::Workflows::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Workflows::V1::ListWorkflowsRequest.new - # - # # Call the list_workflows method. - # result = client.list_workflows 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::Workflows::V1::Workflow. - # p item - # end - # - def list_workflows request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workflows::V1::ListWorkflowsRequest - - # Converts hash 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_workflows.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::Workflows::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_workflows.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_workflows.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @workflows_stub.list_workflows request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @workflows_stub, :list_workflows, "workflows", 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 details of a single workflow. - # - # @overload get_workflow(request, options = nil) - # Pass arguments to `get_workflow` via a request object, either of type - # {::Google::Cloud::Workflows::V1::GetWorkflowRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Workflows::V1::GetWorkflowRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_workflow(name: nil, revision_id: nil) - # Pass arguments to `get_workflow` via keyword arguments. Note that at - # least one keyword argument is 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 workflow for which information should be retrieved. - # Format: projects/\\{project}/locations/\\{location}/workflows/\\{workflow} - # @param revision_id [::String] - # Optional. The revision of the workflow to retrieve. If the revision_id is - # empty, the latest revision is retrieved. - # The format is "000001-a4d", where the first six characters define - # the zero-padded decimal revision number. They are followed by a hyphen and - # three hexadecimal characters. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Workflows::V1::Workflow] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Workflows::V1::Workflow] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/workflows/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Workflows::V1::Workflows::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Workflows::V1::GetWorkflowRequest.new - # - # # Call the get_workflow method. - # result = client.get_workflow request - # - # # The returned object is of type Google::Cloud::Workflows::V1::Workflow. - # p result - # - def get_workflow request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workflows::V1::GetWorkflowRequest - - # Converts hash 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_workflow.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::Workflows::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_workflow.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_workflow.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @workflows_stub.get_workflow 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 workflow. If a workflow with the specified name already - # exists in the specified project and location, the long running operation - # returns a [ALREADY_EXISTS][google.rpc.Code.ALREADY_EXISTS] error. - # - # @overload create_workflow(request, options = nil) - # Pass arguments to `create_workflow` via a request object, either of type - # {::Google::Cloud::Workflows::V1::CreateWorkflowRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Workflows::V1::CreateWorkflowRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_workflow(parent: nil, workflow: nil, workflow_id: nil) - # Pass arguments to `create_workflow` via keyword arguments. Note that at - # least one keyword argument is 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. Project and location in which the workflow should be created. - # Format: projects/\\{project}/locations/\\{location} - # @param workflow [::Google::Cloud::Workflows::V1::Workflow, ::Hash] - # Required. Workflow to be created. - # @param workflow_id [::String] - # Required. The ID of the workflow to be created. It has to fulfill the - # following requirements: - # - # * Must contain only letters, numbers, underscores and hyphens. - # * Must start with a letter. - # * Must be between 1-64 characters. - # * Must end with a number or a letter. - # * Must be unique within the customer project and location. - # @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/workflows/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Workflows::V1::Workflows::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Workflows::V1::CreateWorkflowRequest.new - # - # # Call the create_workflow method. - # result = client.create_workflow 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_workflow request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workflows::V1::CreateWorkflowRequest - - # Converts hash 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_workflow.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::Workflows::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_workflow.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_workflow.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @workflows_stub.create_workflow 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 workflow with the specified name. - # This method also cancels and deletes all running executions of the - # workflow. - # - # @overload delete_workflow(request, options = nil) - # Pass arguments to `delete_workflow` via a request object, either of type - # {::Google::Cloud::Workflows::V1::DeleteWorkflowRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Workflows::V1::DeleteWorkflowRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_workflow(name: nil) - # Pass arguments to `delete_workflow` via keyword arguments. Note that at - # least one keyword argument is 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 workflow to be deleted. - # Format: projects/\\{project}/locations/\\{location}/workflows/\\{workflow} - # @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/workflows/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Workflows::V1::Workflows::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Workflows::V1::DeleteWorkflowRequest.new - # - # # Call the delete_workflow method. - # result = client.delete_workflow 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_workflow request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workflows::V1::DeleteWorkflowRequest - - # Converts hash 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_workflow.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::Workflows::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_workflow.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_workflow.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @workflows_stub.delete_workflow 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 - - ## - # Updates an existing workflow. - # Running this method has no impact on already running executions of the - # workflow. A new revision of the workflow might be created as a result of a - # successful update operation. In that case, the new revision is used - # in new workflow executions. - # - # @overload update_workflow(request, options = nil) - # Pass arguments to `update_workflow` via a request object, either of type - # {::Google::Cloud::Workflows::V1::UpdateWorkflowRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Workflows::V1::UpdateWorkflowRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_workflow(workflow: nil, update_mask: nil) - # Pass arguments to `update_workflow` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param workflow [::Google::Cloud::Workflows::V1::Workflow, ::Hash] - # Required. Workflow to be updated. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # List of fields to be updated. If not present, the entire workflow - # will be updated. - # @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/workflows/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Workflows::V1::Workflows::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Workflows::V1::UpdateWorkflowRequest.new - # - # # Call the update_workflow method. - # result = client.update_workflow 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 update_workflow request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workflows::V1::UpdateWorkflowRequest - - # Converts hash 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_workflow.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::Workflows::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_workflow.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_workflow.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @workflows_stub.update_workflow 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 - - ## - # Lists revisions for a given workflow. - # - # @overload list_workflow_revisions(request, options = nil) - # Pass arguments to `list_workflow_revisions` via a request object, either of type - # {::Google::Cloud::Workflows::V1::ListWorkflowRevisionsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Workflows::V1::ListWorkflowRevisionsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_workflow_revisions(name: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_workflow_revisions` via keyword arguments. Note that at - # least one keyword argument is 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. Workflow for which the revisions should be listed. - # Format: projects/\\{project}/locations/\\{location}/workflows/\\{workflow} - # @param page_size [::Integer] - # The maximum number of revisions to return per page. If a value is not - # specified, a default value of 20 is used. The maximum permitted value is - # 100. Values greater than 100 are coerced down to 100. - # @param page_token [::String] - # The page token, received from a previous ListWorkflowRevisions call. - # Provide this to retrieve the subsequent page. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Workflows::V1::Workflow>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Workflows::V1::Workflow>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/workflows/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Workflows::V1::Workflows::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Workflows::V1::ListWorkflowRevisionsRequest.new - # - # # Call the list_workflow_revisions method. - # result = client.list_workflow_revisions 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::Workflows::V1::Workflow. - # p item - # end - # - def list_workflow_revisions request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workflows::V1::ListWorkflowRevisionsRequest - - # Converts hash 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_workflow_revisions.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::Workflows::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_workflow_revisions.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_workflow_revisions.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @workflows_stub.list_workflow_revisions request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @workflows_stub, :list_workflow_revisions, "workflows", 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 Workflows REST API. - # - # This class represents the configuration for Workflows 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::Workflows::V1::Workflows::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_workflows to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Workflows::V1::Workflows::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_workflows.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Workflows::V1::Workflows::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_workflows.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 = "workflows.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 Workflows 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_workflows` - # @return [::Gapic::Config::Method] - # - attr_reader :list_workflows - ## - # RPC-specific configuration for `get_workflow` - # @return [::Gapic::Config::Method] - # - attr_reader :get_workflow - ## - # RPC-specific configuration for `create_workflow` - # @return [::Gapic::Config::Method] - # - attr_reader :create_workflow - ## - # RPC-specific configuration for `delete_workflow` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_workflow - ## - # RPC-specific configuration for `update_workflow` - # @return [::Gapic::Config::Method] - # - attr_reader :update_workflow - ## - # RPC-specific configuration for `list_workflow_revisions` - # @return [::Gapic::Config::Method] - # - attr_reader :list_workflow_revisions - - # @private - def initialize parent_rpcs = nil - list_workflows_config = parent_rpcs.list_workflows if parent_rpcs.respond_to? :list_workflows - @list_workflows = ::Gapic::Config::Method.new list_workflows_config - get_workflow_config = parent_rpcs.get_workflow if parent_rpcs.respond_to? :get_workflow - @get_workflow = ::Gapic::Config::Method.new get_workflow_config - create_workflow_config = parent_rpcs.create_workflow if parent_rpcs.respond_to? :create_workflow - @create_workflow = ::Gapic::Config::Method.new create_workflow_config - delete_workflow_config = parent_rpcs.delete_workflow if parent_rpcs.respond_to? :delete_workflow - @delete_workflow = ::Gapic::Config::Method.new delete_workflow_config - update_workflow_config = parent_rpcs.update_workflow if parent_rpcs.respond_to? :update_workflow - @update_workflow = ::Gapic::Config::Method.new update_workflow_config - list_workflow_revisions_config = parent_rpcs.list_workflow_revisions if parent_rpcs.respond_to? :list_workflow_revisions - @list_workflow_revisions = ::Gapic::Config::Method.new list_workflow_revisions_config - - yield self if block_given? - end - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-workflows-v1/lib/google/cloud/workflows/v1/workflows/rest/operations.rb b/owl-bot-staging/google-cloud-workflows-v1/lib/google/cloud/workflows/v1/workflows/rest/operations.rb deleted file mode 100644 index 7aead07230f8..000000000000 --- a/owl-bot-staging/google-cloud-workflows-v1/lib/google/cloud/workflows/v1/workflows/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 Workflows - module V1 - module Workflows - module Rest - # Service that implements Longrunning Operations API. - class Operations - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "workflows.$UNIVERSE_DOMAIN$" - - # @private - attr_reader :operations_stub - - ## - # Configuration for the Workflows 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 Workflows 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::Workflows::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::Workflows::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::Workflows::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::Workflows::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 = "workflows.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}/operations", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/?$}, 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{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] - ] - ) - 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-workflows-v1/lib/google/cloud/workflows/v1/workflows/rest/service_stub.rb b/owl-bot-staging/google-cloud-workflows-v1/lib/google/cloud/workflows/v1/workflows/rest/service_stub.rb deleted file mode 100644 index c36b18474d53..000000000000 --- a/owl-bot-staging/google-cloud-workflows-v1/lib/google/cloud/workflows/v1/workflows/rest/service_stub.rb +++ /dev/null @@ -1,449 +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/workflows/v1/workflows_pb" - -module Google - module Cloud - module Workflows - module V1 - module Workflows - module Rest - ## - # REST service stub for the Workflows 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_workflows REST call - # - # @param request_pb [::Google::Cloud::Workflows::V1::ListWorkflowsRequest] - # 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::Workflows::V1::ListWorkflowsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Workflows::V1::ListWorkflowsResponse] - # A result object deserialized from the server's reply - def list_workflows request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_workflows_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_workflows", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Workflows::V1::ListWorkflowsResponse.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_workflow REST call - # - # @param request_pb [::Google::Cloud::Workflows::V1::GetWorkflowRequest] - # 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::Workflows::V1::Workflow] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Workflows::V1::Workflow] - # A result object deserialized from the server's reply - def get_workflow request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_workflow_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_workflow", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Workflows::V1::Workflow.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_workflow REST call - # - # @param request_pb [::Google::Cloud::Workflows::V1::CreateWorkflowRequest] - # 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_workflow request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_workflow_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_workflow", - 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_workflow REST call - # - # @param request_pb [::Google::Cloud::Workflows::V1::DeleteWorkflowRequest] - # 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_workflow request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_delete_workflow_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_workflow", - 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 update_workflow REST call - # - # @param request_pb [::Google::Cloud::Workflows::V1::UpdateWorkflowRequest] - # 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 update_workflow request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_workflow_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_workflow", - 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 list_workflow_revisions REST call - # - # @param request_pb [::Google::Cloud::Workflows::V1::ListWorkflowRevisionsRequest] - # 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::Workflows::V1::ListWorkflowRevisionsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Workflows::V1::ListWorkflowRevisionsResponse] - # A result object deserialized from the server's reply - def list_workflow_revisions request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_workflow_revisions_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_workflow_revisions", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Workflows::V1::ListWorkflowRevisionsResponse.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_workflows REST call - # - # @param request_pb [::Google::Cloud::Workflows::V1::ListWorkflowsRequest] - # 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_workflows_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/workflows", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_workflow REST call - # - # @param request_pb [::Google::Cloud::Workflows::V1::GetWorkflowRequest] - # 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_workflow_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/workflows/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the create_workflow REST call - # - # @param request_pb [::Google::Cloud::Workflows::V1::CreateWorkflowRequest] - # 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_workflow_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}/workflows", - body: "workflow", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_workflow REST call - # - # @param request_pb [::Google::Cloud::Workflows::V1::DeleteWorkflowRequest] - # 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_workflow_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/workflows/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_workflow REST call - # - # @param request_pb [::Google::Cloud::Workflows::V1::UpdateWorkflowRequest] - # 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_workflow_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v1/{workflow.name}", - body: "workflow", - matches: [ - ["workflow.name", %r{^projects/[^/]+/locations/[^/]+/workflows/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_workflow_revisions REST call - # - # @param request_pb [::Google::Cloud::Workflows::V1::ListWorkflowRevisionsRequest] - # 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_workflow_revisions_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}:listRevisions", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/workflows/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-workflows-v1/lib/google/cloud/workflows/v1/workflows_pb.rb b/owl-bot-staging/google-cloud-workflows-v1/lib/google/cloud/workflows/v1/workflows_pb.rb deleted file mode 100644 index 0ccabf5cfd2d..000000000000 --- a/owl-bot-staging/google-cloud-workflows-v1/lib/google/cloud/workflows/v1/workflows_pb.rb +++ /dev/null @@ -1,44 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/workflows/v1/workflows.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/empty_pb' -require 'google/protobuf/field_mask_pb' -require 'google/protobuf/timestamp_pb' - - -descriptor_data = "\n)google/cloud/workflows/v1/workflows.proto\x12\x19google.cloud.workflows.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\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\x8d\r\n\x08Workflow\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x02 \x01(\t\x12=\n\x05state\x18\x03 \x01(\x0e\x32).google.cloud.workflows.v1.Workflow.StateB\x03\xe0\x41\x03\x12\x18\n\x0brevision_id\x18\x04 \x01(\tB\x03\xe0\x41\x03\x12\x34\n\x0b\x63reate_time\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12=\n\x14revision_create_time\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12?\n\x06labels\x18\x08 \x03(\x0b\x32/.google.cloud.workflows.v1.Workflow.LabelsEntry\x12\x17\n\x0fservice_account\x18\t \x01(\t\x12\x19\n\x0fsource_contents\x18\n \x01(\tH\x00\x12\x42\n\x0f\x63rypto_key_name\x18\x0b \x01(\tB)\xe0\x41\x01\xfa\x41#\n!cloudkms.googleapis.com/CryptoKey\x12H\n\x0bstate_error\x18\x0c \x01(\x0b\x32..google.cloud.workflows.v1.Workflow.StateErrorB\x03\xe0\x41\x03\x12M\n\x0e\x63\x61ll_log_level\x18\r \x01(\x0e\x32\x30.google.cloud.workflows.v1.Workflow.CallLogLevelB\x03\xe0\x41\x01\x12P\n\ruser_env_vars\x18\x0e \x03(\x0b\x32\x34.google.cloud.workflows.v1.Workflow.UserEnvVarsEntryB\x03\xe0\x41\x01\x12V\n\x17\x65xecution_history_level\x18\x0f \x01(\x0e\x32\x30.google.cloud.workflows.v1.ExecutionHistoryLevelB\x03\xe0\x41\x01\x12?\n\x0c\x61ll_kms_keys\x18\x10 \x03(\tB)\xe0\x41\x03\xfa\x41#\n!cloudkms.googleapis.com/CryptoKey\x12O\n\x15\x61ll_kms_keys_versions\x18\x11 \x03(\tB0\xe0\x41\x03\xfa\x41*\n(cloudkms.googleapis.com/CryptoKeyVersion\x12L\n\x12\x63rypto_key_version\x18\x12 \x01(\tB0\xe0\x41\x03\xfa\x41*\n(cloudkms.googleapis.com/CryptoKeyVersion\x12\x46\n\x04tags\x18\x13 \x03(\x0b\x32-.google.cloud.workflows.v1.Workflow.TagsEntryB\t\xe0\x41\x04\xe0\x41\x05\xe0\x41\x01\x1a\x8d\x01\n\nStateError\x12\x0f\n\x07\x64\x65tails\x18\x01 \x01(\t\x12\x41\n\x04type\x18\x02 \x01(\x0e\x32\x33.google.cloud.workflows.v1.Workflow.StateError.Type\"+\n\x04Type\x12\x14\n\x10TYPE_UNSPECIFIED\x10\x00\x12\r\n\tKMS_ERROR\x10\x01\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a\x32\n\x10UserEnvVarsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a+\n\tTagsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\";\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\n\n\x06\x41\x43TIVE\x10\x01\x12\x0f\n\x0bUNAVAILABLE\x10\x02\"d\n\x0c\x43\x61llLogLevel\x12\x1e\n\x1a\x43\x41LL_LOG_LEVEL_UNSPECIFIED\x10\x00\x12\x11\n\rLOG_ALL_CALLS\x10\x01\x12\x13\n\x0fLOG_ERRORS_ONLY\x10\x02\x12\x0c\n\x08LOG_NONE\x10\x03:d\xea\x41\x61\n!workflows.googleapis.com/Workflow\x12\xda\x41\x06parent\x82\xd3\xe4\x93\x02/\x12-/v1/{parent=projects/*/locations/*}/workflows\x12\x9f\x01\n\x0bGetWorkflow\x12-.google.cloud.workflows.v1.GetWorkflowRequest\x1a#.google.cloud.workflows.v1.Workflow\"<\xda\x41\x04name\x82\xd3\xe4\x93\x02/\x12-/v1/{name=projects/*/locations/*/workflows/*}\x12\xe0\x01\n\x0e\x43reateWorkflow\x12\x30.google.cloud.workflows.v1.CreateWorkflowRequest\x1a\x1d.google.longrunning.Operation\"}\xca\x41\x1d\n\x08Workflow\x12\x11OperationMetadata\xda\x41\x1bparent,workflow,workflow_id\x82\xd3\xe4\x93\x02\x39\"-/v1/{parent=projects/*/locations/*}/workflows:\x08workflow\x12\xcc\x01\n\x0e\x44\x65leteWorkflow\x12\x30.google.cloud.workflows.v1.DeleteWorkflowRequest\x1a\x1d.google.longrunning.Operation\"i\xca\x41*\n\x15google.protobuf.Empty\x12\x11OperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02/*-/v1/{name=projects/*/locations/*/workflows/*}\x12\xe2\x01\n\x0eUpdateWorkflow\x12\x30.google.cloud.workflows.v1.UpdateWorkflowRequest\x1a\x1d.google.longrunning.Operation\"\x7f\xca\x41\x1d\n\x08Workflow\x12\x11OperationMetadata\xda\x41\x14workflow,update_mask\x82\xd3\xe4\x93\x02\x42\x32\x36/v1/{workflow.name=projects/*/locations/*/workflows/*}:\x08workflow\x12\xcf\x01\n\x15ListWorkflowRevisions\x12\x37.google.cloud.workflows.v1.ListWorkflowRevisionsRequest\x1a\x38.google.cloud.workflows.v1.ListWorkflowRevisionsResponse\"C\x82\xd3\xe4\x93\x02=\x12;/v1/{name=projects/*/locations/*/workflows/*}:listRevisions\x1aL\xca\x41\x18workflows.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\x8d\x03\n\x1d\x63om.google.cloud.workflows.v1B\x0eWorkflowsProtoP\x01Z;cloud.google.com/go/workflows/apiv1/workflowspb;workflowspb\xea\x41v\n!cloudkms.googleapis.com/CryptoKey\x12Qprojects/{project}/locations/{location}/keyRings/{keyRing}/cryptoKeys/{cryptoKey}\xea\x41\xa2\x01\n(cloudkms.googleapis.com/CryptoKeyVersion\x12vprojects/{project}/locations/{location}/keyRings/{keyRing}/cryptoKeys/{cryptoKey}/cryptoKeyVersions/{cryptoKeyVersion}b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module Workflows - module V1 - Workflow = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.workflows.v1.Workflow").msgclass - Workflow::StateError = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.workflows.v1.Workflow.StateError").msgclass - Workflow::StateError::Type = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.workflows.v1.Workflow.StateError.Type").enummodule - Workflow::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.workflows.v1.Workflow.State").enummodule - Workflow::CallLogLevel = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.workflows.v1.Workflow.CallLogLevel").enummodule - ListWorkflowsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.workflows.v1.ListWorkflowsRequest").msgclass - ListWorkflowsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.workflows.v1.ListWorkflowsResponse").msgclass - GetWorkflowRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.workflows.v1.GetWorkflowRequest").msgclass - CreateWorkflowRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.workflows.v1.CreateWorkflowRequest").msgclass - DeleteWorkflowRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.workflows.v1.DeleteWorkflowRequest").msgclass - UpdateWorkflowRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.workflows.v1.UpdateWorkflowRequest").msgclass - OperationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.workflows.v1.OperationMetadata").msgclass - ListWorkflowRevisionsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.workflows.v1.ListWorkflowRevisionsRequest").msgclass - ListWorkflowRevisionsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.workflows.v1.ListWorkflowRevisionsResponse").msgclass - ExecutionHistoryLevel = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.workflows.v1.ExecutionHistoryLevel").enummodule - end - end - end -end diff --git a/owl-bot-staging/google-cloud-workflows-v1/lib/google/cloud/workflows/v1/workflows_services_pb.rb b/owl-bot-staging/google-cloud-workflows-v1/lib/google/cloud/workflows/v1/workflows_services_pb.rb deleted file mode 100644 index d568aa342f04..000000000000 --- a/owl-bot-staging/google-cloud-workflows-v1/lib/google/cloud/workflows/v1/workflows_services_pb.rb +++ /dev/null @@ -1,66 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# Source: google/cloud/workflows/v1/workflows.proto for package 'google.cloud.workflows.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/workflows/v1/workflows_pb' - -module Google - module Cloud - module Workflows - module V1 - module Workflows - # Workflows is used to deploy and execute workflow programs. - # Workflows makes sure the program executes reliably, despite hardware and - # networking interruptions. - class Service - - include ::GRPC::GenericService - - self.marshal_class_method = :encode - self.unmarshal_class_method = :decode - self.service_name = 'google.cloud.workflows.v1.Workflows' - - # Lists workflows in a given project and location. - # The default order is not specified. - rpc :ListWorkflows, ::Google::Cloud::Workflows::V1::ListWorkflowsRequest, ::Google::Cloud::Workflows::V1::ListWorkflowsResponse - # Gets details of a single workflow. - rpc :GetWorkflow, ::Google::Cloud::Workflows::V1::GetWorkflowRequest, ::Google::Cloud::Workflows::V1::Workflow - # Creates a new workflow. If a workflow with the specified name already - # exists in the specified project and location, the long running operation - # returns a [ALREADY_EXISTS][google.rpc.Code.ALREADY_EXISTS] error. - rpc :CreateWorkflow, ::Google::Cloud::Workflows::V1::CreateWorkflowRequest, ::Google::Longrunning::Operation - # Deletes a workflow with the specified name. - # This method also cancels and deletes all running executions of the - # workflow. - rpc :DeleteWorkflow, ::Google::Cloud::Workflows::V1::DeleteWorkflowRequest, ::Google::Longrunning::Operation - # Updates an existing workflow. - # Running this method has no impact on already running executions of the - # workflow. A new revision of the workflow might be created as a result of a - # successful update operation. In that case, the new revision is used - # in new workflow executions. - rpc :UpdateWorkflow, ::Google::Cloud::Workflows::V1::UpdateWorkflowRequest, ::Google::Longrunning::Operation - # Lists revisions for a given workflow. - rpc :ListWorkflowRevisions, ::Google::Cloud::Workflows::V1::ListWorkflowRevisionsRequest, ::Google::Cloud::Workflows::V1::ListWorkflowRevisionsResponse - end - - Stub = Service.rpc_stub_class - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-workflows-v1/proto_docs/README.md b/owl-bot-staging/google-cloud-workflows-v1/proto_docs/README.md deleted file mode 100644 index 5e25ae83a219..000000000000 --- a/owl-bot-staging/google-cloud-workflows-v1/proto_docs/README.md +++ /dev/null @@ -1,4 +0,0 @@ -# Workflows 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-workflows-v1/proto_docs/google/api/client.rb b/owl-bot-staging/google-cloud-workflows-v1/proto_docs/google/api/client.rb deleted file mode 100644 index 3ab0b096d445..000000000000 --- a/owl-bot-staging/google-cloud-workflows-v1/proto_docs/google/api/client.rb +++ /dev/null @@ -1,593 +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. - # - # Note: This field should not be used in most cases. - 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: - # library_settings: - # 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. - # @!attribute [rw] library_package - # @return [::String] - # The package name to use in Php. Clobbers the php_namespace option - # set in the protobuf. This should be used **only** by APIs - # who have already set the language_settings.php.package_name" field - # in gapic.yaml. API teams should use the protobuf php_namespace option - # where possible. - # - # Example of a YAML configuration:: - # - # publishing: - # library_settings: - # php_settings: - # library_package: Google\Cloud\PubSub\V1 - 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. - # - # Example: - # - # 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 - # @!attribute [rw] batching - # @return [::Google::Api::BatchingConfigProto] - # Batching configuration for an API method in client libraries. - # - # Example of a YAML configuration: - # - # publishing: - # method_settings: - # - selector: google.example.v1.ExampleService.BatchCreateExample - # batching: - # element_count_threshold: 1000 - # request_byte_threshold: 100000000 - # delay_threshold_millis: 10 - 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. - # - # Note: This feature should not be used in most cases. - # @!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 - - # `BatchingConfigProto` defines the batching configuration for an API method. - # @!attribute [rw] thresholds - # @return [::Google::Api::BatchingSettingsProto] - # The thresholds which trigger a batched request to be sent. - # @!attribute [rw] batch_descriptor - # @return [::Google::Api::BatchingDescriptorProto] - # The request and response fields used in batching. - class BatchingConfigProto - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # `BatchingSettingsProto` specifies a set of batching thresholds, each of - # which acts as a trigger to send a batch of messages as a request. At least - # one threshold must be positive nonzero. - # @!attribute [rw] element_count_threshold - # @return [::Integer] - # The number of elements of a field collected into a batch which, if - # exceeded, causes the batch to be sent. - # @!attribute [rw] request_byte_threshold - # @return [::Integer] - # The aggregated size of the batched field which, if exceeded, causes the - # batch to be sent. This size is computed by aggregating the sizes of the - # request field to be batched, not of the entire request message. - # @!attribute [rw] delay_threshold - # @return [::Google::Protobuf::Duration] - # The duration after which a batch should be sent, starting from the addition - # of the first message to that batch. - # @!attribute [rw] element_count_limit - # @return [::Integer] - # The maximum number of elements collected in a batch that could be accepted - # by server. - # @!attribute [rw] request_byte_limit - # @return [::Integer] - # The maximum size of the request that could be accepted by server. - # @!attribute [rw] flow_control_element_limit - # @return [::Integer] - # The maximum number of elements allowed by flow control. - # @!attribute [rw] flow_control_byte_limit - # @return [::Integer] - # The maximum size of data allowed by flow control. - # @!attribute [rw] flow_control_limit_exceeded_behavior - # @return [::Google::Api::FlowControlLimitExceededBehaviorProto] - # The behavior to take when the flow control limit is exceeded. - class BatchingSettingsProto - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # `BatchingDescriptorProto` specifies the fields of the request message to be - # used for batching, and, optionally, the fields of the response message to be - # used for demultiplexing. - # @!attribute [rw] batched_field - # @return [::String] - # The repeated field in the request message to be aggregated by batching. - # @!attribute [rw] discriminator_fields - # @return [::Array<::String>] - # A list of the fields in the request message. Two requests will be batched - # together only if the values of every field specified in - # `request_discriminator_fields` is equal between the two requests. - # @!attribute [rw] subresponse_field - # @return [::String] - # Optional. When present, indicates the field in the response message to be - # used to demultiplex the response into multiple response messages, in - # correspondence with the multiple request messages originally batched - # together. - class BatchingDescriptorProto - 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 - - # The behavior to take when the flow control limit is exceeded. - module FlowControlLimitExceededBehaviorProto - # Default behavior, system-defined. - UNSET_BEHAVIOR = 0 - - # Stop operation, raise error. - THROW_EXCEPTION = 1 - - # Pause operation until limit clears. - BLOCK = 2 - - # Continue operation, disregard limit. - IGNORE = 3 - end - end -end diff --git a/owl-bot-staging/google-cloud-workflows-v1/proto_docs/google/api/field_behavior.rb b/owl-bot-staging/google-cloud-workflows-v1/proto_docs/google/api/field_behavior.rb deleted file mode 100644 index 582be187d115..000000000000 --- a/owl-bot-staging/google-cloud-workflows-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-workflows-v1/proto_docs/google/api/launch_stage.rb b/owl-bot-staging/google-cloud-workflows-v1/proto_docs/google/api/launch_stage.rb deleted file mode 100644 index 9392a413fb1b..000000000000 --- a/owl-bot-staging/google-cloud-workflows-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-workflows-v1/proto_docs/google/api/resource.rb b/owl-bot-staging/google-cloud-workflows-v1/proto_docs/google/api/resource.rb deleted file mode 100644 index 25dec4847ac1..000000000000 --- a/owl-bot-staging/google-cloud-workflows-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-workflows-v1/proto_docs/google/cloud/workflows/v1/workflows.rb b/owl-bot-staging/google-cloud-workflows-v1/proto_docs/google/cloud/workflows/v1/workflows.rb deleted file mode 100644 index 78a09faef384..000000000000 --- a/owl-bot-staging/google-cloud-workflows-v1/proto_docs/google/cloud/workflows/v1/workflows.rb +++ /dev/null @@ -1,424 +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 Workflows - module V1 - # Workflow program to be executed by Workflows. - # @!attribute [rw] name - # @return [::String] - # The resource name of the workflow. - # Format: projects/\\{project}/locations/\\{location}/workflows/\\{workflow}. - # This is a workflow-wide field and is not tied to a specific revision. - # @!attribute [rw] description - # @return [::String] - # Description of the workflow provided by the user. - # Must be at most 1000 Unicode characters long. - # This is a workflow-wide field and is not tied to a specific revision. - # @!attribute [r] state - # @return [::Google::Cloud::Workflows::V1::Workflow::State] - # Output only. State of the workflow deployment. - # @!attribute [r] revision_id - # @return [::String] - # Output only. The revision of the workflow. - # A new revision of a workflow is created as a result of updating the - # following properties of a workflow: - # - # - {::Google::Cloud::Workflows::V1::Workflow#service_account Service account} - # - [Workflow code to be - # executed][google.cloud.workflows.v1.Workflow.source_contents] - # - # The format is "000001-a4d", where the first six characters define - # the zero-padded revision ordinal number. They are followed by a hyphen and - # three hexadecimal random characters. - # @!attribute [r] create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The timestamp for when the workflow was created. - # This is a workflow-wide field and is not tied to a specific revision. - # @!attribute [r] update_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The timestamp for when the workflow was last updated. - # This is a workflow-wide field and is not tied to a specific revision. - # @!attribute [r] revision_create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The timestamp for the latest revision of the workflow's - # creation. - # @!attribute [rw] labels - # @return [::Google::Protobuf::Map{::String => ::String}] - # Labels associated with this workflow. - # Labels can contain at most 64 entries. Keys and values can be no longer - # than 63 characters and can only contain lowercase letters, numeric - # characters, underscores, and dashes. Label keys must start with a letter. - # International characters are allowed. - # This is a workflow-wide field and is not tied to a specific revision. - # @!attribute [rw] service_account - # @return [::String] - # The service account associated with the latest workflow version. - # This service account represents the identity of the workflow and determines - # what permissions the workflow has. - # Format: projects/\\{project}/serviceAccounts/\\{account} or \\{account} - # - # Using `-` as a wildcard for the `{project}` or not providing one at all - # will infer the project from the account. The `{account}` value can be the - # `email` address or the `unique_id` of the service account. - # - # If not provided, workflow will use the project's default service account. - # Modifying this field for an existing workflow results in a new workflow - # revision. - # @!attribute [rw] source_contents - # @return [::String] - # Workflow code to be executed. The size limit is 128KB. - # @!attribute [rw] crypto_key_name - # @return [::String] - # Optional. The resource name of a KMS crypto key used to encrypt or decrypt - # the data associated with the workflow. - # - # Format: - # projects/\\{project}/locations/\\{location}/keyRings/\\{keyRing}/cryptoKeys/\\{cryptoKey} - # - # Using `-` as a wildcard for the `{project}` or not providing one at all - # will infer the project from the account. - # - # If not provided, data associated with the workflow will not be - # CMEK-encrypted. - # @!attribute [r] state_error - # @return [::Google::Cloud::Workflows::V1::Workflow::StateError] - # Output only. Error regarding the state of the workflow. For example, this - # field will have error details if the execution data is unavailable due to - # revoked KMS key permissions. - # @!attribute [rw] call_log_level - # @return [::Google::Cloud::Workflows::V1::Workflow::CallLogLevel] - # Optional. Describes the level of platform logging to apply to calls and - # call responses during executions of this workflow. If both the workflow and - # the execution specify a logging level, the execution level takes - # precedence. - # @!attribute [rw] user_env_vars - # @return [::Google::Protobuf::Map{::String => ::String}] - # Optional. User-defined environment variables associated with this workflow - # revision. This map has a maximum length of 20. Each string can take up to - # 4KiB. Keys cannot be empty strings and cannot start with "GOOGLE" or - # "WORKFLOWS". - # @!attribute [rw] execution_history_level - # @return [::Google::Cloud::Workflows::V1::ExecutionHistoryLevel] - # Optional. Describes the execution history level to apply to this workflow. - # @!attribute [r] all_kms_keys - # @return [::Array<::String>] - # Output only. A list of all KMS crypto keys used to encrypt or decrypt the - # data associated with the workflow. - # @!attribute [r] all_kms_keys_versions - # @return [::Array<::String>] - # Output only. A list of all KMS crypto key versions used to encrypt or - # decrypt the data associated with the workflow. - # @!attribute [r] crypto_key_version - # @return [::String] - # Output only. The resource name of a KMS crypto key version used to encrypt - # or decrypt the data associated with the workflow. - # - # Format: - # projects/\\{project}/locations/\\{location}/keyRings/\\{keyRing}/cryptoKeys/\\{cryptoKey}/cryptoKeyVersions/\\{cryptoKeyVersion} - # @!attribute [rw] tags - # @return [::Google::Protobuf::Map{::String => ::String}] - # Optional. Input only. Immutable. Tags associated with this workflow. - class Workflow - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Describes an error related to the current state of the workflow. - # @!attribute [rw] details - # @return [::String] - # Provides specifics about the error. - # @!attribute [rw] type - # @return [::Google::Cloud::Workflows::V1::Workflow::StateError::Type] - # The type of this state error. - class StateError - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Describes the possibled types of a state error. - module Type - # No type specified. - TYPE_UNSPECIFIED = 0 - - # Caused by an issue with KMS. - KMS_ERROR = 1 - end - end - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class LabelsEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class UserEnvVarsEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class TagsEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Describes the current state of workflow deployment. - module State - # Invalid state. - STATE_UNSPECIFIED = 0 - - # The workflow has been deployed successfully and is serving. - ACTIVE = 1 - - # Workflow data is unavailable. See the `state_error` field. - UNAVAILABLE = 2 - end - - # Describes the level of platform logging to apply to calls and call - # responses during workflow executions. - module CallLogLevel - # No call logging level specified. - CALL_LOG_LEVEL_UNSPECIFIED = 0 - - # Log all call steps within workflows, all call returns, and all exceptions - # raised. - LOG_ALL_CALLS = 1 - - # Log only exceptions that are raised from call steps within workflows. - LOG_ERRORS_ONLY = 2 - - # Explicitly log nothing. - LOG_NONE = 3 - end - end - - # Request for the - # {::Google::Cloud::Workflows::V1::Workflows::Client#list_workflows ListWorkflows} - # method. - # @!attribute [rw] parent - # @return [::String] - # Required. Project and location from which the workflows should be listed. - # Format: projects/\\{project}/locations/\\{location} - # @!attribute [rw] page_size - # @return [::Integer] - # Maximum number of workflows to return per call. The service might return - # fewer than this value even if not at the end of the collection. If a value - # is not specified, a default value of 500 is used. The maximum permitted - # value is 1000 and values greater than 1000 are coerced down to 1000. - # @!attribute [rw] page_token - # @return [::String] - # A page token, received from a previous `ListWorkflows` call. - # Provide this to retrieve the subsequent page. - # - # When paginating, all other parameters provided to `ListWorkflows` must - # match the call that provided the page token. - # @!attribute [rw] filter - # @return [::String] - # Filter to restrict results to specific workflows. - # For details, see AIP-160. - # - # For example, if you are using the Google APIs Explorer: - # - # `state="SUCCEEDED"` - # - # or - # - # `createTime>"2023-08-01" AND state="FAILED"` - # @!attribute [rw] order_by - # @return [::String] - # Comma-separated list of fields that specify the order of the results. - # Default sorting order for a field is ascending. To specify descending order - # for a field, append a "desc" suffix. - # If not specified, the results are returned in an unspecified order. - class ListWorkflowsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response for the - # {::Google::Cloud::Workflows::V1::Workflows::Client#list_workflows ListWorkflows} - # method. - # @!attribute [rw] workflows - # @return [::Array<::Google::Cloud::Workflows::V1::Workflow>] - # The workflows that match the request. - # @!attribute [rw] next_page_token - # @return [::String] - # A token, which can be sent as `page_token` to retrieve the next page. - # If this field is omitted, there are no subsequent pages. - # @!attribute [rw] unreachable - # @return [::Array<::String>] - # Unreachable resources. - class ListWorkflowsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request for the - # {::Google::Cloud::Workflows::V1::Workflows::Client#get_workflow GetWorkflow} method. - # @!attribute [rw] name - # @return [::String] - # Required. Name of the workflow for which information should be retrieved. - # Format: projects/\\{project}/locations/\\{location}/workflows/\\{workflow} - # @!attribute [rw] revision_id - # @return [::String] - # Optional. The revision of the workflow to retrieve. If the revision_id is - # empty, the latest revision is retrieved. - # The format is "000001-a4d", where the first six characters define - # the zero-padded decimal revision number. They are followed by a hyphen and - # three hexadecimal characters. - class GetWorkflowRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request for the - # {::Google::Cloud::Workflows::V1::Workflows::Client#create_workflow CreateWorkflow} - # method. - # @!attribute [rw] parent - # @return [::String] - # Required. Project and location in which the workflow should be created. - # Format: projects/\\{project}/locations/\\{location} - # @!attribute [rw] workflow - # @return [::Google::Cloud::Workflows::V1::Workflow] - # Required. Workflow to be created. - # @!attribute [rw] workflow_id - # @return [::String] - # Required. The ID of the workflow to be created. It has to fulfill the - # following requirements: - # - # * Must contain only letters, numbers, underscores and hyphens. - # * Must start with a letter. - # * Must be between 1-64 characters. - # * Must end with a number or a letter. - # * Must be unique within the customer project and location. - class CreateWorkflowRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request for the - # {::Google::Cloud::Workflows::V1::Workflows::Client#delete_workflow DeleteWorkflow} - # method. - # @!attribute [rw] name - # @return [::String] - # Required. Name of the workflow to be deleted. - # Format: projects/\\{project}/locations/\\{location}/workflows/\\{workflow} - class DeleteWorkflowRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request for the - # {::Google::Cloud::Workflows::V1::Workflows::Client#update_workflow UpdateWorkflow} - # method. - # @!attribute [rw] workflow - # @return [::Google::Cloud::Workflows::V1::Workflow] - # Required. Workflow to be updated. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # List of fields to be updated. If not present, the entire workflow - # will be updated. - class UpdateWorkflowRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Represents the metadata of the long-running operation. - # @!attribute [rw] create_time - # @return [::Google::Protobuf::Timestamp] - # The time the operation was created. - # @!attribute [rw] end_time - # @return [::Google::Protobuf::Timestamp] - # The time the operation finished running. - # @!attribute [rw] target - # @return [::String] - # Server-defined resource path for the target of the operation. - # @!attribute [rw] verb - # @return [::String] - # Name of the verb executed by the operation. - # @!attribute [rw] api_version - # @return [::String] - # API version used to start the operation. - class OperationMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request for the - # {::Google::Cloud::Workflows::V1::Workflows::Client#list_workflow_revisions ListWorkflowRevisions} - # method. - # @!attribute [rw] name - # @return [::String] - # Required. Workflow for which the revisions should be listed. - # Format: projects/\\{project}/locations/\\{location}/workflows/\\{workflow} - # @!attribute [rw] page_size - # @return [::Integer] - # The maximum number of revisions to return per page. If a value is not - # specified, a default value of 20 is used. The maximum permitted value is - # 100. Values greater than 100 are coerced down to 100. - # @!attribute [rw] page_token - # @return [::String] - # The page token, received from a previous ListWorkflowRevisions call. - # Provide this to retrieve the subsequent page. - class ListWorkflowRevisionsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response for the - # {::Google::Cloud::Workflows::V1::Workflows::Client#list_workflow_revisions ListWorkflowRevisions} - # method. - # @!attribute [rw] workflows - # @return [::Array<::Google::Cloud::Workflows::V1::Workflow>] - # The revisions of the workflow, ordered in reverse chronological order. - # @!attribute [rw] next_page_token - # @return [::String] - # A token, which can be sent as `page_token` to retrieve the next page. - # If this field is omitted, there are no subsequent pages. - class ListWorkflowRevisionsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Define possible options for enabling the execution history level. - module ExecutionHistoryLevel - # The default/unset value. - EXECUTION_HISTORY_LEVEL_UNSPECIFIED = 0 - - # Enable execution history basic feature. - EXECUTION_HISTORY_BASIC = 1 - - # Enable execution history detailed feature. - EXECUTION_HISTORY_DETAILED = 2 - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-workflows-v1/proto_docs/google/longrunning/operations.rb b/owl-bot-staging/google-cloud-workflows-v1/proto_docs/google/longrunning/operations.rb deleted file mode 100644 index 7a757f512165..000000000000 --- a/owl-bot-staging/google-cloud-workflows-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-workflows-v1/proto_docs/google/protobuf/any.rb b/owl-bot-staging/google-cloud-workflows-v1/proto_docs/google/protobuf/any.rb deleted file mode 100644 index 58691995f02e..000000000000 --- a/owl-bot-staging/google-cloud-workflows-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-workflows-v1/proto_docs/google/protobuf/duration.rb b/owl-bot-staging/google-cloud-workflows-v1/proto_docs/google/protobuf/duration.rb deleted file mode 100644 index ea59f1f91daf..000000000000 --- a/owl-bot-staging/google-cloud-workflows-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-workflows-v1/proto_docs/google/protobuf/empty.rb b/owl-bot-staging/google-cloud-workflows-v1/proto_docs/google/protobuf/empty.rb deleted file mode 100644 index 83e4481834a6..000000000000 --- a/owl-bot-staging/google-cloud-workflows-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-workflows-v1/proto_docs/google/protobuf/field_mask.rb b/owl-bot-staging/google-cloud-workflows-v1/proto_docs/google/protobuf/field_mask.rb deleted file mode 100644 index 7f3ffc78601a..000000000000 --- a/owl-bot-staging/google-cloud-workflows-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-workflows-v1/proto_docs/google/protobuf/timestamp.rb b/owl-bot-staging/google-cloud-workflows-v1/proto_docs/google/protobuf/timestamp.rb deleted file mode 100644 index 74352be9c58c..000000000000 --- a/owl-bot-staging/google-cloud-workflows-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-workflows-v1/proto_docs/google/rpc/status.rb b/owl-bot-staging/google-cloud-workflows-v1/proto_docs/google/rpc/status.rb deleted file mode 100644 index c1a1c07eb2db..000000000000 --- a/owl-bot-staging/google-cloud-workflows-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-workflows-v1/snippets/Gemfile b/owl-bot-staging/google-cloud-workflows-v1/snippets/Gemfile deleted file mode 100644 index 3f40a63d2540..000000000000 --- a/owl-bot-staging/google-cloud-workflows-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-workflows-v1", path: "../" -else - gem "google-cloud-workflows-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-workflows-v1/snippets/snippet_metadata_google.cloud.workflows.v1.json b/owl-bot-staging/google-cloud-workflows-v1/snippets/snippet_metadata_google.cloud.workflows.v1.json deleted file mode 100644 index 64415098c15f..000000000000 --- a/owl-bot-staging/google-cloud-workflows-v1/snippets/snippet_metadata_google.cloud.workflows.v1.json +++ /dev/null @@ -1,255 +0,0 @@ -{ - "client_library": { - "name": "google-cloud-workflows-v1", - "version": "", - "language": "RUBY", - "apis": [ - { - "id": "google.cloud.workflows.v1", - "version": "v1" - } - ] - }, - "snippets": [ - { - "region_tag": "workflows_v1_generated_Workflows_ListWorkflows_sync", - "title": "Snippet for the list_workflows call in the Workflows service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Workflows::V1::Workflows::Client#list_workflows.", - "file": "workflows/list_workflows.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_workflows", - "full_name": "::Google::Cloud::Workflows::V1::Workflows::Client#list_workflows", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Workflows::V1::ListWorkflowsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Workflows::V1::ListWorkflowsResponse", - "client": { - "short_name": "Workflows::Client", - "full_name": "::Google::Cloud::Workflows::V1::Workflows::Client" - }, - "method": { - "short_name": "ListWorkflows", - "full_name": "google.cloud.workflows.v1.Workflows.ListWorkflows", - "service": { - "short_name": "Workflows", - "full_name": "google.cloud.workflows.v1.Workflows" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "workflows_v1_generated_Workflows_GetWorkflow_sync", - "title": "Snippet for the get_workflow call in the Workflows service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Workflows::V1::Workflows::Client#get_workflow.", - "file": "workflows/get_workflow.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_workflow", - "full_name": "::Google::Cloud::Workflows::V1::Workflows::Client#get_workflow", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Workflows::V1::GetWorkflowRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Workflows::V1::Workflow", - "client": { - "short_name": "Workflows::Client", - "full_name": "::Google::Cloud::Workflows::V1::Workflows::Client" - }, - "method": { - "short_name": "GetWorkflow", - "full_name": "google.cloud.workflows.v1.Workflows.GetWorkflow", - "service": { - "short_name": "Workflows", - "full_name": "google.cloud.workflows.v1.Workflows" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "workflows_v1_generated_Workflows_CreateWorkflow_sync", - "title": "Snippet for the create_workflow call in the Workflows service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Workflows::V1::Workflows::Client#create_workflow.", - "file": "workflows/create_workflow.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_workflow", - "full_name": "::Google::Cloud::Workflows::V1::Workflows::Client#create_workflow", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Workflows::V1::CreateWorkflowRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "Workflows::Client", - "full_name": "::Google::Cloud::Workflows::V1::Workflows::Client" - }, - "method": { - "short_name": "CreateWorkflow", - "full_name": "google.cloud.workflows.v1.Workflows.CreateWorkflow", - "service": { - "short_name": "Workflows", - "full_name": "google.cloud.workflows.v1.Workflows" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "workflows_v1_generated_Workflows_DeleteWorkflow_sync", - "title": "Snippet for the delete_workflow call in the Workflows service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Workflows::V1::Workflows::Client#delete_workflow.", - "file": "workflows/delete_workflow.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_workflow", - "full_name": "::Google::Cloud::Workflows::V1::Workflows::Client#delete_workflow", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Workflows::V1::DeleteWorkflowRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "Workflows::Client", - "full_name": "::Google::Cloud::Workflows::V1::Workflows::Client" - }, - "method": { - "short_name": "DeleteWorkflow", - "full_name": "google.cloud.workflows.v1.Workflows.DeleteWorkflow", - "service": { - "short_name": "Workflows", - "full_name": "google.cloud.workflows.v1.Workflows" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "workflows_v1_generated_Workflows_UpdateWorkflow_sync", - "title": "Snippet for the update_workflow call in the Workflows service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Workflows::V1::Workflows::Client#update_workflow.", - "file": "workflows/update_workflow.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_workflow", - "full_name": "::Google::Cloud::Workflows::V1::Workflows::Client#update_workflow", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Workflows::V1::UpdateWorkflowRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "Workflows::Client", - "full_name": "::Google::Cloud::Workflows::V1::Workflows::Client" - }, - "method": { - "short_name": "UpdateWorkflow", - "full_name": "google.cloud.workflows.v1.Workflows.UpdateWorkflow", - "service": { - "short_name": "Workflows", - "full_name": "google.cloud.workflows.v1.Workflows" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "workflows_v1_generated_Workflows_ListWorkflowRevisions_sync", - "title": "Snippet for the list_workflow_revisions call in the Workflows service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Workflows::V1::Workflows::Client#list_workflow_revisions.", - "file": "workflows/list_workflow_revisions.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_workflow_revisions", - "full_name": "::Google::Cloud::Workflows::V1::Workflows::Client#list_workflow_revisions", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Workflows::V1::ListWorkflowRevisionsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Workflows::V1::ListWorkflowRevisionsResponse", - "client": { - "short_name": "Workflows::Client", - "full_name": "::Google::Cloud::Workflows::V1::Workflows::Client" - }, - "method": { - "short_name": "ListWorkflowRevisions", - "full_name": "google.cloud.workflows.v1.Workflows.ListWorkflowRevisions", - "service": { - "short_name": "Workflows", - "full_name": "google.cloud.workflows.v1.Workflows" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - } - ] -} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-workflows-v1/snippets/workflows/create_workflow.rb b/owl-bot-staging/google-cloud-workflows-v1/snippets/workflows/create_workflow.rb deleted file mode 100644 index 57bb5d7052f6..000000000000 --- a/owl-bot-staging/google-cloud-workflows-v1/snippets/workflows/create_workflow.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 workflows_v1_generated_Workflows_CreateWorkflow_sync] -require "google/cloud/workflows/v1" - -## -# Snippet for the create_workflow call in the Workflows 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::Workflows::V1::Workflows::Client#create_workflow. -# -def create_workflow - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Workflows::V1::Workflows::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Workflows::V1::CreateWorkflowRequest.new - - # Call the create_workflow method. - result = client.create_workflow 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 workflows_v1_generated_Workflows_CreateWorkflow_sync] diff --git a/owl-bot-staging/google-cloud-workflows-v1/snippets/workflows/delete_workflow.rb b/owl-bot-staging/google-cloud-workflows-v1/snippets/workflows/delete_workflow.rb deleted file mode 100644 index ee3a675341df..000000000000 --- a/owl-bot-staging/google-cloud-workflows-v1/snippets/workflows/delete_workflow.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 workflows_v1_generated_Workflows_DeleteWorkflow_sync] -require "google/cloud/workflows/v1" - -## -# Snippet for the delete_workflow call in the Workflows 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::Workflows::V1::Workflows::Client#delete_workflow. -# -def delete_workflow - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Workflows::V1::Workflows::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Workflows::V1::DeleteWorkflowRequest.new - - # Call the delete_workflow method. - result = client.delete_workflow 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 workflows_v1_generated_Workflows_DeleteWorkflow_sync] diff --git a/owl-bot-staging/google-cloud-workflows-v1/snippets/workflows/get_workflow.rb b/owl-bot-staging/google-cloud-workflows-v1/snippets/workflows/get_workflow.rb deleted file mode 100644 index 8e945eb77b52..000000000000 --- a/owl-bot-staging/google-cloud-workflows-v1/snippets/workflows/get_workflow.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 workflows_v1_generated_Workflows_GetWorkflow_sync] -require "google/cloud/workflows/v1" - -## -# Snippet for the get_workflow call in the Workflows 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::Workflows::V1::Workflows::Client#get_workflow. -# -def get_workflow - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Workflows::V1::Workflows::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Workflows::V1::GetWorkflowRequest.new - - # Call the get_workflow method. - result = client.get_workflow request - - # The returned object is of type Google::Cloud::Workflows::V1::Workflow. - p result -end -# [END workflows_v1_generated_Workflows_GetWorkflow_sync] diff --git a/owl-bot-staging/google-cloud-workflows-v1/snippets/workflows/list_workflow_revisions.rb b/owl-bot-staging/google-cloud-workflows-v1/snippets/workflows/list_workflow_revisions.rb deleted file mode 100644 index 24fa4adf9ff9..000000000000 --- a/owl-bot-staging/google-cloud-workflows-v1/snippets/workflows/list_workflow_revisions.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 workflows_v1_generated_Workflows_ListWorkflowRevisions_sync] -require "google/cloud/workflows/v1" - -## -# Snippet for the list_workflow_revisions call in the Workflows 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::Workflows::V1::Workflows::Client#list_workflow_revisions. -# -def list_workflow_revisions - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Workflows::V1::Workflows::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Workflows::V1::ListWorkflowRevisionsRequest.new - - # Call the list_workflow_revisions method. - result = client.list_workflow_revisions 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::Workflows::V1::Workflow. - p item - end -end -# [END workflows_v1_generated_Workflows_ListWorkflowRevisions_sync] diff --git a/owl-bot-staging/google-cloud-workflows-v1/snippets/workflows/list_workflows.rb b/owl-bot-staging/google-cloud-workflows-v1/snippets/workflows/list_workflows.rb deleted file mode 100644 index 423d261480f1..000000000000 --- a/owl-bot-staging/google-cloud-workflows-v1/snippets/workflows/list_workflows.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 workflows_v1_generated_Workflows_ListWorkflows_sync] -require "google/cloud/workflows/v1" - -## -# Snippet for the list_workflows call in the Workflows 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::Workflows::V1::Workflows::Client#list_workflows. -# -def list_workflows - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Workflows::V1::Workflows::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Workflows::V1::ListWorkflowsRequest.new - - # Call the list_workflows method. - result = client.list_workflows 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::Workflows::V1::Workflow. - p item - end -end -# [END workflows_v1_generated_Workflows_ListWorkflows_sync] diff --git a/owl-bot-staging/google-cloud-workflows-v1/snippets/workflows/update_workflow.rb b/owl-bot-staging/google-cloud-workflows-v1/snippets/workflows/update_workflow.rb deleted file mode 100644 index 20e240695166..000000000000 --- a/owl-bot-staging/google-cloud-workflows-v1/snippets/workflows/update_workflow.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 workflows_v1_generated_Workflows_UpdateWorkflow_sync] -require "google/cloud/workflows/v1" - -## -# Snippet for the update_workflow call in the Workflows 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::Workflows::V1::Workflows::Client#update_workflow. -# -def update_workflow - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Workflows::V1::Workflows::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Workflows::V1::UpdateWorkflowRequest.new - - # Call the update_workflow method. - result = client.update_workflow 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 workflows_v1_generated_Workflows_UpdateWorkflow_sync] diff --git a/owl-bot-staging/google-cloud-workflows-v1/test/google/cloud/workflows/v1/workflows_operations_test.rb b/owl-bot-staging/google-cloud-workflows-v1/test/google/cloud/workflows/v1/workflows_operations_test.rb deleted file mode 100644 index 733d55434ff1..000000000000 --- a/owl-bot-staging/google-cloud-workflows-v1/test/google/cloud/workflows/v1/workflows_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/workflows/v1/workflows_pb" -require "google/cloud/workflows/v1/workflows_services_pb" -require "google/cloud/workflows/v1/workflows" - -class ::Google::Cloud::Workflows::V1::Workflows::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::Workflows::V1::Workflows::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::Workflows::V1::Workflows::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::Workflows::V1::Workflows::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::Workflows::V1::Workflows::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::Workflows::V1::Workflows::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::Workflows::V1::Workflows::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::Workflows::V1::Workflows::Operations::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-workflows-v1/test/google/cloud/workflows/v1/workflows_paths_test.rb b/owl-bot-staging/google-cloud-workflows-v1/test/google/cloud/workflows/v1/workflows_paths_test.rb deleted file mode 100644 index 940534eeb434..000000000000 --- a/owl-bot-staging/google-cloud-workflows-v1/test/google/cloud/workflows/v1/workflows_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/workflows/v1/workflows" - -class ::Google::Cloud::Workflows::V1::Workflows::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::Workflows::V1::Workflows::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::Workflows::V1::Workflows::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_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::Workflows::V1::Workflows::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_workflow_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Workflows::V1::Workflows::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.workflow_path project: "value0", location: "value1", workflow: "value2" - assert_equal "projects/value0/locations/value1/workflows/value2", path - end - end -end diff --git a/owl-bot-staging/google-cloud-workflows-v1/test/google/cloud/workflows/v1/workflows_rest_test.rb b/owl-bot-staging/google-cloud-workflows-v1/test/google/cloud/workflows/v1/workflows_rest_test.rb deleted file mode 100644 index 475012b3f7fd..000000000000 --- a/owl-bot-staging/google-cloud-workflows-v1/test/google/cloud/workflows/v1/workflows_rest_test.rb +++ /dev/null @@ -1,433 +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/workflows/v1/workflows_pb" -require "google/cloud/workflows/v1/workflows/rest" - - -class ::Google::Cloud::Workflows::V1::Workflows::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_workflows - # Create test objects. - client_result = ::Google::Cloud::Workflows::V1::ListWorkflowsResponse.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_workflows_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::Workflows::V1::Workflows::Rest::ServiceStub.stub :transcode_list_workflows_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_workflows_client_stub do - # Create client - client = ::Google::Cloud::Workflows::V1::Workflows::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_workflows({ 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_workflows 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_workflows ::Google::Cloud::Workflows::V1::ListWorkflowsRequest.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_workflows({ 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_workflows(::Google::Cloud::Workflows::V1::ListWorkflowsRequest.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_workflows_client_stub.call_count - end - end - end - - def test_get_workflow - # Create test objects. - client_result = ::Google::Cloud::Workflows::V1::Workflow.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - revision_id = "hello world" - - get_workflow_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::Workflows::V1::Workflows::Rest::ServiceStub.stub :transcode_get_workflow_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_workflow_client_stub do - # Create client - client = ::Google::Cloud::Workflows::V1::Workflows::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_workflow({ name: name, revision_id: revision_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_workflow name: name, revision_id: revision_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_workflow ::Google::Cloud::Workflows::V1::GetWorkflowRequest.new(name: name, revision_id: revision_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_workflow({ name: name, revision_id: revision_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_workflow(::Google::Cloud::Workflows::V1::GetWorkflowRequest.new(name: name, revision_id: revision_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_workflow_client_stub.call_count - end - end - end - - def test_create_workflow - # 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" - workflow = {} - workflow_id = "hello world" - - create_workflow_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::Workflows::V1::Workflows::Rest::ServiceStub.stub :transcode_create_workflow_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_workflow_client_stub do - # Create client - client = ::Google::Cloud::Workflows::V1::Workflows::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_workflow({ parent: parent, workflow: workflow, workflow_id: workflow_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_workflow parent: parent, workflow: workflow, workflow_id: workflow_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_workflow ::Google::Cloud::Workflows::V1::CreateWorkflowRequest.new(parent: parent, workflow: workflow, workflow_id: workflow_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_workflow({ parent: parent, workflow: workflow, workflow_id: workflow_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_workflow(::Google::Cloud::Workflows::V1::CreateWorkflowRequest.new(parent: parent, workflow: workflow, workflow_id: workflow_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_workflow_client_stub.call_count - end - end - end - - def test_delete_workflow - # 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_workflow_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::Workflows::V1::Workflows::Rest::ServiceStub.stub :transcode_delete_workflow_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_workflow_client_stub do - # Create client - client = ::Google::Cloud::Workflows::V1::Workflows::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.delete_workflow({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.delete_workflow name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.delete_workflow ::Google::Cloud::Workflows::V1::DeleteWorkflowRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.delete_workflow({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.delete_workflow(::Google::Cloud::Workflows::V1::DeleteWorkflowRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, delete_workflow_client_stub.call_count - end - end - end - - def test_update_workflow - # 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. - workflow = {} - update_mask = {} - - update_workflow_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::Workflows::V1::Workflows::Rest::ServiceStub.stub :transcode_update_workflow_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_workflow_client_stub do - # Create client - client = ::Google::Cloud::Workflows::V1::Workflows::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.update_workflow({ workflow: workflow, update_mask: update_mask }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.update_workflow workflow: workflow, update_mask: update_mask do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.update_workflow ::Google::Cloud::Workflows::V1::UpdateWorkflowRequest.new(workflow: workflow, update_mask: update_mask) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.update_workflow({ workflow: workflow, update_mask: update_mask }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.update_workflow(::Google::Cloud::Workflows::V1::UpdateWorkflowRequest.new(workflow: workflow, update_mask: update_mask), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, update_workflow_client_stub.call_count - end - end - end - - def test_list_workflow_revisions - # Create test objects. - client_result = ::Google::Cloud::Workflows::V1::ListWorkflowRevisionsResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - page_size = 42 - page_token = "hello world" - - list_workflow_revisions_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::Workflows::V1::Workflows::Rest::ServiceStub.stub :transcode_list_workflow_revisions_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_workflow_revisions_client_stub do - # Create client - client = ::Google::Cloud::Workflows::V1::Workflows::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_workflow_revisions({ name: name, page_size: page_size, page_token: page_token }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.list_workflow_revisions name: name, page_size: page_size, page_token: page_token do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.list_workflow_revisions ::Google::Cloud::Workflows::V1::ListWorkflowRevisionsRequest.new(name: name, 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_workflow_revisions({ name: name, 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_workflow_revisions(::Google::Cloud::Workflows::V1::ListWorkflowRevisionsRequest.new(name: name, 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_workflow_revisions_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::Workflows::V1::Workflows::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::Workflows::V1::Workflows::Rest::Client::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-workflows-v1/test/google/cloud/workflows/v1/workflows_test.rb b/owl-bot-staging/google-cloud-workflows-v1/test/google/cloud/workflows/v1/workflows_test.rb deleted file mode 100644 index 588d6ca4b23a..000000000000 --- a/owl-bot-staging/google-cloud-workflows-v1/test/google/cloud/workflows/v1/workflows_test.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 "helper" - -require "gapic/grpc/service_stub" - -require "google/cloud/workflows/v1/workflows_pb" -require "google/cloud/workflows/v1/workflows" - -class ::Google::Cloud::Workflows::V1::Workflows::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_workflows - # Create GRPC objects. - grpc_response = ::Google::Cloud::Workflows::V1::ListWorkflowsResponse.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_workflows_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_workflows, name - assert_kind_of ::Google::Cloud::Workflows::V1::ListWorkflowsRequest, 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_workflows_client_stub do - # Create client - client = ::Google::Cloud::Workflows::V1::Workflows::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_workflows({ 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_workflows 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_workflows ::Google::Cloud::Workflows::V1::ListWorkflowsRequest.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_workflows({ 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_workflows(::Google::Cloud::Workflows::V1::ListWorkflowsRequest.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_workflows_client_stub.call_rpc_count - end - end - - def test_get_workflow - # Create GRPC objects. - grpc_response = ::Google::Cloud::Workflows::V1::Workflow.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" - revision_id = "hello world" - - get_workflow_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_workflow, name - assert_kind_of ::Google::Cloud::Workflows::V1::GetWorkflowRequest, request - assert_equal "hello world", request["name"] - assert_equal "hello world", request["revision_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_workflow_client_stub do - # Create client - client = ::Google::Cloud::Workflows::V1::Workflows::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_workflow({ name: name, revision_id: revision_id }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_workflow name: name, revision_id: revision_id do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_workflow ::Google::Cloud::Workflows::V1::GetWorkflowRequest.new(name: name, revision_id: revision_id) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_workflow({ name: name, revision_id: revision_id }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_workflow(::Google::Cloud::Workflows::V1::GetWorkflowRequest.new(name: name, revision_id: revision_id), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, get_workflow_client_stub.call_rpc_count - end - end - - def test_create_workflow - # 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" - workflow = {} - workflow_id = "hello world" - - create_workflow_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_workflow, name - assert_kind_of ::Google::Cloud::Workflows::V1::CreateWorkflowRequest, request - assert_equal "hello world", request["parent"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Workflows::V1::Workflow), request["workflow"] - assert_equal "hello world", request["workflow_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_workflow_client_stub do - # Create client - client = ::Google::Cloud::Workflows::V1::Workflows::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_workflow({ parent: parent, workflow: workflow, workflow_id: workflow_id }) 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_workflow parent: parent, workflow: workflow, workflow_id: workflow_id 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_workflow ::Google::Cloud::Workflows::V1::CreateWorkflowRequest.new(parent: parent, workflow: workflow, workflow_id: workflow_id) 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_workflow({ parent: parent, workflow: workflow, workflow_id: workflow_id }, 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_workflow(::Google::Cloud::Workflows::V1::CreateWorkflowRequest.new(parent: parent, workflow: workflow, workflow_id: workflow_id), 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_workflow_client_stub.call_rpc_count - end - end - - def test_delete_workflow - # 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_workflow_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_workflow, name - assert_kind_of ::Google::Cloud::Workflows::V1::DeleteWorkflowRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_workflow_client_stub do - # Create client - client = ::Google::Cloud::Workflows::V1::Workflows::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_workflow({ 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_workflow 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_workflow ::Google::Cloud::Workflows::V1::DeleteWorkflowRequest.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_workflow({ 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_workflow(::Google::Cloud::Workflows::V1::DeleteWorkflowRequest.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_workflow_client_stub.call_rpc_count - end - end - - def test_update_workflow - # 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. - workflow = {} - update_mask = {} - - update_workflow_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_workflow, name - assert_kind_of ::Google::Cloud::Workflows::V1::UpdateWorkflowRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Workflows::V1::Workflow), request["workflow"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_workflow_client_stub do - # Create client - client = ::Google::Cloud::Workflows::V1::Workflows::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_workflow({ workflow: workflow, update_mask: update_mask }) 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.update_workflow workflow: workflow, update_mask: update_mask 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.update_workflow ::Google::Cloud::Workflows::V1::UpdateWorkflowRequest.new(workflow: workflow, update_mask: update_mask) 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.update_workflow({ workflow: workflow, update_mask: update_mask }, 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.update_workflow(::Google::Cloud::Workflows::V1::UpdateWorkflowRequest.new(workflow: workflow, update_mask: update_mask), 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, update_workflow_client_stub.call_rpc_count - end - end - - def test_list_workflow_revisions - # Create GRPC objects. - grpc_response = ::Google::Cloud::Workflows::V1::ListWorkflowRevisionsResponse.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" - page_size = 42 - page_token = "hello world" - - list_workflow_revisions_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_workflow_revisions, name - assert_kind_of ::Google::Cloud::Workflows::V1::ListWorkflowRevisionsRequest, request - assert_equal "hello world", request["name"] - assert_equal 42, request["page_size"] - assert_equal "hello world", request["page_token"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_workflow_revisions_client_stub do - # Create client - client = ::Google::Cloud::Workflows::V1::Workflows::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_workflow_revisions({ name: name, 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_workflow_revisions name: name, 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_workflow_revisions ::Google::Cloud::Workflows::V1::ListWorkflowRevisionsRequest.new(name: name, 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_workflow_revisions({ name: name, 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_workflow_revisions(::Google::Cloud::Workflows::V1::ListWorkflowRevisionsRequest.new(name: name, 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_workflow_revisions_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::Workflows::V1::Workflows::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::Workflows::V1::Workflows::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::Workflows::V1::Workflows::Client.new do |config| - config.credentials = creds - end - assert_kind_of ::Google::Cloud::Workflows::V1::Workflows::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::Workflows::V1::Workflows::Client.new do |config| - config.credentials = grpc_channel - end - end - - assert_kind_of ::Google::Cloud::Workflows::V1::Workflows::Operations, client.operations_client - end -end diff --git a/owl-bot-staging/google-cloud-workflows-v1/test/helper.rb b/owl-bot-staging/google-cloud-workflows-v1/test/helper.rb deleted file mode 100644 index 672b337030e7..000000000000 --- a/owl-bot-staging/google-cloud-workflows-v1/test/helper.rb +++ /dev/null @@ -1,26 +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/mock" -require "minitest/rg" - -require "grpc" - -require "ostruct" diff --git a/owl-bot-staging/google-cloud-workflows-v1beta/.gitignore b/owl-bot-staging/google-cloud-workflows-v1beta/.gitignore deleted file mode 100644 index 0135b6bc6cfc..000000000000 --- a/owl-bot-staging/google-cloud-workflows-v1beta/.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-workflows-v1beta/.repo-metadata.json b/owl-bot-staging/google-cloud-workflows-v1beta/.repo-metadata.json deleted file mode 100644 index 1d4a95557ac5..000000000000 --- a/owl-bot-staging/google-cloud-workflows-v1beta/.repo-metadata.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "api_id": "workflows.googleapis.com", - "api_shortname": "workflows", - "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-workflows-v1beta/latest", - "distribution_name": "google-cloud-workflows-v1beta", - "is_cloud": true, - "language": "ruby", - "name": "workflows", - "name_pretty": "Workflows V1beta API", - "product_documentation": "https://cloud.google.com/workflows/", - "release_level": "unreleased", - "repo": "googleapis/google-cloud-ruby", - "requires_billing": true, - "ruby-cloud-description": "Workflows link series of serverless tasks together in an order you define. Combine the power of Google Cloud's APIs, serverless products like Cloud Functions and Cloud Run, and calls to external APIs to create flexible serverless applications. Workflows requires no infrastructure management and scales seamlessly with demand, including scaling down to zero.. Note that google-cloud-workflows-v1beta is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-workflows instead. See the readme for more details.", - "ruby-cloud-env-prefix": "WORKFLOWS", - "ruby-cloud-product-url": "https://cloud.google.com/workflows/", - "library_type": "GAPIC_AUTO" -} diff --git a/owl-bot-staging/google-cloud-workflows-v1beta/.rubocop.yml b/owl-bot-staging/google-cloud-workflows-v1beta/.rubocop.yml deleted file mode 100644 index 40c98f2b2441..000000000000 --- a/owl-bot-staging/google-cloud-workflows-v1beta/.rubocop.yml +++ /dev/null @@ -1,33 +0,0 @@ -inherit_gem: - google-style: google-style.yml - -AllCops: - Exclude: - - "google-cloud-workflows-v1beta.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-workflows-v1beta.rb" diff --git a/owl-bot-staging/google-cloud-workflows-v1beta/.toys.rb b/owl-bot-staging/google-cloud-workflows-v1beta/.toys.rb deleted file mode 100644 index 177e22456e8a..000000000000 --- a/owl-bot-staging/google-cloud-workflows-v1beta/.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-workflows-v1beta/.yardopts b/owl-bot-staging/google-cloud-workflows-v1beta/.yardopts deleted file mode 100644 index 56f969dffb3b..000000000000 --- a/owl-bot-staging/google-cloud-workflows-v1beta/.yardopts +++ /dev/null @@ -1,12 +0,0 @@ ---no-private ---title="Workflows V1beta 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-workflows-v1beta/AUTHENTICATION.md b/owl-bot-staging/google-cloud-workflows-v1beta/AUTHENTICATION.md deleted file mode 100644 index 5854f731e93e..000000000000 --- a/owl-bot-staging/google-cloud-workflows-v1beta/AUTHENTICATION.md +++ /dev/null @@ -1,122 +0,0 @@ -# Authentication - -The recommended way to authenticate to the google-cloud-workflows-v1beta 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-workflows-v1beta 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/workflows/v1beta" - -client = ::Google::Cloud::Workflows::V1beta::Workflows::Client.new do |config| - config.credentials = "path/to/credentialfile.json" -end -``` - -To configure a credentials file globally for all clients: - -```ruby -require "google/cloud/workflows/v1beta" - -::Google::Cloud::Workflows::V1beta::Workflows::Client.configure do |config| - config.credentials = "path/to/credentialfile.json" -end - -client = ::Google::Cloud::Workflows::V1beta::Workflows::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-workflows-v1beta -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/workflows/v1beta" - -ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" - -client = ::Google::Cloud::Workflows::V1beta::Workflows::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-workflows-v1beta/CHANGELOG.md b/owl-bot-staging/google-cloud-workflows-v1beta/CHANGELOG.md deleted file mode 100644 index f88957a62ba2..000000000000 --- a/owl-bot-staging/google-cloud-workflows-v1beta/CHANGELOG.md +++ /dev/null @@ -1,2 +0,0 @@ -# Release History - diff --git a/owl-bot-staging/google-cloud-workflows-v1beta/Gemfile b/owl-bot-staging/google-cloud-workflows-v1beta/Gemfile deleted file mode 100644 index 1d08558908d8..000000000000 --- a/owl-bot-staging/google-cloud-workflows-v1beta/Gemfile +++ /dev/null @@ -1,14 +0,0 @@ -source "https://rubygems.org" - -gemspec - -gem "google-style", "~> 1.32.0" -gem "irb", "~> 1.17" -gem "minitest", "~> 6.0.2" -gem "minitest-focus", "~> 1.4" -gem "minitest-mock", "~> 5.27" -gem "minitest-rg", "~> 5.3" -gem "ostruct", "~> 0.5.5" -gem "rake", ">= 13.0" -gem "redcarpet", "~> 3.6" -gem "yard", "~> 0.9" diff --git a/owl-bot-staging/google-cloud-workflows-v1beta/LICENSE.md b/owl-bot-staging/google-cloud-workflows-v1beta/LICENSE.md deleted file mode 100644 index c261857ba6ad..000000000000 --- a/owl-bot-staging/google-cloud-workflows-v1beta/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-workflows-v1beta/README.md b/owl-bot-staging/google-cloud-workflows-v1beta/README.md deleted file mode 100644 index 9bd00b31c471..000000000000 --- a/owl-bot-staging/google-cloud-workflows-v1beta/README.md +++ /dev/null @@ -1,154 +0,0 @@ -# Ruby Client for the Workflows V1beta API - -Manage workflow definitions. To execute workflows and manage executions, see the Workflows Executions API. - -Workflows link series of serverless tasks together in an order you define. Combine the power of Google Cloud's APIs, serverless products like Cloud Functions and Cloud Run, and calls to external APIs to create flexible serverless applications. Workflows requires no infrastructure management and scales seamlessly with demand, including scaling down to zero.. - -https://github.com/googleapis/google-cloud-ruby - -This gem is a _versioned_ client. It provides basic client classes for a -specific version of the Workflows V1beta API. Most users should consider using -the main client gem, -[google-cloud-workflows](https://rubygems.org/gems/google-cloud-workflows). -See the section below titled *Which client should I use?* for more information. - -## Installation - -``` -$ gem install google-cloud-workflows-v1beta -``` - -## 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/workflows.googleapis.com) -1. [Set up authentication.](AUTHENTICATION.md) - -## Quick Start - -```ruby -require "google/cloud/workflows/v1beta" - -client = ::Google::Cloud::Workflows::V1beta::Workflows::Client.new -request = ::Google::Cloud::Workflows::V1beta::ListWorkflowsRequest.new # (request fields as keyword arguments...) -response = client.list_workflows request -``` - -View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-workflows-v1beta/latest) -for class and method documentation. - -See also the [Product Documentation](https://cloud.google.com/workflows/) -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/workflows/v1beta" -require "logger" - -client = ::Google::Cloud::Workflows::V1beta::Workflows::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-workflows`, -and lower-level _versioned_ client libraries with names such as -`google-cloud-workflows-v1beta`. -_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-workflows`. -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-workflows-v1beta`. - -### 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-workflows-v1beta/Rakefile b/owl-bot-staging/google-cloud-workflows-v1beta/Rakefile deleted file mode 100644 index 26a1b0335b69..000000000000 --- a/owl-bot-staging/google-cloud-workflows-v1beta/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-workflows-v1beta acceptance tests." -task :acceptance, :project, :keyfile do |t, args| - project = args[:project] - project ||= - ENV["WORKFLOWS_TEST_PROJECT"] || - ENV["GCLOUD_TEST_PROJECT"] - keyfile = args[:keyfile] - keyfile ||= - ENV["WORKFLOWS_TEST_KEYFILE"] || - ENV["GCLOUD_TEST_KEYFILE"] - if keyfile - keyfile = File.read keyfile - else - keyfile ||= - ENV["WORKFLOWS_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 WORKFLOWS_TEST_PROJECT=test123 WORKFLOWS_TEST_KEYFILE=/path/to/keyfile.json rake acceptance" - end - require "google/cloud/workflows/v1beta/workflows/credentials" - ::Google::Cloud::Workflows::V1beta::Workflows::Credentials.env_vars.each do |path| - ENV[path] = nil - end - ENV["WORKFLOWS_PROJECT"] = project - ENV["WORKFLOWS_TEST_PROJECT"] = project - ENV["WORKFLOWS_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-workflows-v1beta 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-workflows-v1beta 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-workflows-v1beta 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-workflows-v1beta gem does not have doctest tests." -end - -desc "Run the CI build" -task :ci do - header "BUILDING google-cloud-workflows-v1beta" - header "google-cloud-workflows-v1beta rubocop", "*" - Rake::Task[:rubocop].invoke - header "google-cloud-workflows-v1beta yard", "*" - Rake::Task[:yard].invoke - header "google-cloud-workflows-v1beta 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-workflows-v1beta 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-workflows-v1beta 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-workflows-v1beta/gapic_metadata.json b/owl-bot-staging/google-cloud-workflows-v1beta/gapic_metadata.json deleted file mode 100644 index 251ea95013fb..000000000000 --- a/owl-bot-staging/google-cloud-workflows-v1beta/gapic_metadata.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", - "language": "ruby", - "protoPackage": "google.cloud.workflows.v1beta", - "libraryPackage": "::Google::Cloud::Workflows::V1beta", - "services": { - "Workflows": { - "clients": { - "grpc": { - "libraryClient": "::Google::Cloud::Workflows::V1beta::Workflows::Client", - "rpcs": { - "ListWorkflows": { - "methods": [ - "list_workflows" - ] - }, - "GetWorkflow": { - "methods": [ - "get_workflow" - ] - }, - "CreateWorkflow": { - "methods": [ - "create_workflow" - ] - }, - "DeleteWorkflow": { - "methods": [ - "delete_workflow" - ] - }, - "UpdateWorkflow": { - "methods": [ - "update_workflow" - ] - } - } - } - } - } - } -} diff --git a/owl-bot-staging/google-cloud-workflows-v1beta/google-cloud-workflows-v1beta.gemspec b/owl-bot-staging/google-cloud-workflows-v1beta/google-cloud-workflows-v1beta.gemspec deleted file mode 100644 index 7fc0b732d071..000000000000 --- a/owl-bot-staging/google-cloud-workflows-v1beta/google-cloud-workflows-v1beta.gemspec +++ /dev/null @@ -1,29 +0,0 @@ -# -*- ruby -*- -# encoding: utf-8 - -require File.expand_path("lib/google/cloud/workflows/v1beta/version", __dir__) - -Gem::Specification.new do |gem| - gem.name = "google-cloud-workflows-v1beta" - gem.version = Google::Cloud::Workflows::V1beta::VERSION - - gem.authors = ["Google LLC"] - gem.email = "googleapis-packages@google.com" - gem.description = "Workflows link series of serverless tasks together in an order you define. Combine the power of Google Cloud's APIs, serverless products like Cloud Functions and Cloud Run, and calls to external APIs to create flexible serverless applications. Workflows requires no infrastructure management and scales seamlessly with demand, including scaling down to zero.. Note that google-cloud-workflows-v1beta is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-workflows instead. See the readme for more details." - gem.summary = "Manage workflow definitions. To execute workflows and manage executions, see the Workflows Executions API." - 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.2" - - gem.add_dependency "gapic-common", "~> 1.2" - gem.add_dependency "google-cloud-errors", "~> 1.0" - gem.add_dependency "google-cloud-location", "~> 1.0" -end diff --git a/owl-bot-staging/google-cloud-workflows-v1beta/lib/google-cloud-workflows-v1beta.rb b/owl-bot-staging/google-cloud-workflows-v1beta/lib/google-cloud-workflows-v1beta.rb deleted file mode 100644 index 6570d59e4c97..000000000000 --- a/owl-bot-staging/google-cloud-workflows-v1beta/lib/google-cloud-workflows-v1beta.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/workflows/v1beta" diff --git a/owl-bot-staging/google-cloud-workflows-v1beta/lib/google/cloud/workflows/v1beta.rb b/owl-bot-staging/google-cloud-workflows-v1beta/lib/google/cloud/workflows/v1beta.rb deleted file mode 100644 index 8ffa325a3d21..000000000000 --- a/owl-bot-staging/google-cloud-workflows-v1beta/lib/google/cloud/workflows/v1beta.rb +++ /dev/null @@ -1,45 +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/workflows/v1beta/workflows" -require "google/cloud/workflows/v1beta/version" - -module Google - module Cloud - module Workflows - ## - # API client module. - # - # @example Load this package, including all its services, and instantiate a gRPC client - # - # require "google/cloud/workflows/v1beta" - # client = ::Google::Cloud::Workflows::V1beta::Workflows::Client.new - # - # @example Load this package, including all its services, and instantiate a REST client - # - # require "google/cloud/workflows/v1beta" - # client = ::Google::Cloud::Workflows::V1beta::Workflows::Rest::Client.new - # - module V1beta - end - end - end -end - -helper_path = ::File.join __dir__, "v1beta", "_helpers.rb" -require "google/cloud/workflows/v1beta/_helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-workflows-v1beta/lib/google/cloud/workflows/v1beta/bindings_override.rb b/owl-bot-staging/google-cloud-workflows-v1beta/lib/google/cloud/workflows/v1beta/bindings_override.rb deleted file mode 100644 index 89cc4db94d26..000000000000 --- a/owl-bot-staging/google-cloud-workflows-v1beta/lib/google/cloud/workflows/v1beta/bindings_override.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! - -require "gapic/rest" - -module Google - module Cloud - module Workflows - ## - # @example Loading just the REST part of this package, including all its services, and instantiating a REST client - # - # require "google/cloud/workflows/v1beta/rest" - # client = ::Google::Cloud::Workflows::V1beta::Workflows::Rest::Client.new - # - module V1beta - ## - # @private - # Initialize the mixin bindings configuration - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "Workflows"] - 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: "/v1beta/{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: "/v1beta/{name}/locations", - matches: [ - ["name", %r{^projects/[^/]+/?$}, false] - ], - body: nil - ) - ] - default_config - end - yield @configure if block_given? - @configure - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-workflows-v1beta/lib/google/cloud/workflows/v1beta/rest.rb b/owl-bot-staging/google-cloud-workflows-v1beta/lib/google/cloud/workflows/v1beta/rest.rb deleted file mode 100644 index 449f092f35af..000000000000 --- a/owl-bot-staging/google-cloud-workflows-v1beta/lib/google/cloud/workflows/v1beta/rest.rb +++ /dev/null @@ -1,38 +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/workflows/v1beta/workflows/rest" -require "google/cloud/workflows/v1beta/bindings_override" -require "google/cloud/workflows/v1beta/version" - -module Google - module Cloud - module Workflows - ## - # To load just the REST part of this package, including all its services, and instantiate a REST client: - # - # @example - # - # require "google/cloud/workflows/v1beta/rest" - # client = ::Google::Cloud::Workflows::V1beta::Workflows::Rest::Client.new - # - module V1beta - end - end - end -end diff --git a/owl-bot-staging/google-cloud-workflows-v1beta/lib/google/cloud/workflows/v1beta/version.rb b/owl-bot-staging/google-cloud-workflows-v1beta/lib/google/cloud/workflows/v1beta/version.rb deleted file mode 100644 index 0bdbdee492ae..000000000000 --- a/owl-bot-staging/google-cloud-workflows-v1beta/lib/google/cloud/workflows/v1beta/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 Workflows - module V1beta - VERSION = "0.0.1" - end - end - end -end diff --git a/owl-bot-staging/google-cloud-workflows-v1beta/lib/google/cloud/workflows/v1beta/workflows.rb b/owl-bot-staging/google-cloud-workflows-v1beta/lib/google/cloud/workflows/v1beta/workflows.rb deleted file mode 100644 index 0fcbf048c458..000000000000 --- a/owl-bot-staging/google-cloud-workflows-v1beta/lib/google/cloud/workflows/v1beta/workflows.rb +++ /dev/null @@ -1,58 +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/workflows/v1beta/version" - -require "google/cloud/workflows/v1beta/workflows/credentials" -require "google/cloud/workflows/v1beta/workflows/paths" -require "google/cloud/workflows/v1beta/workflows/operations" -require "google/cloud/workflows/v1beta/workflows/client" -require "google/cloud/workflows/v1beta/workflows/rest" - -module Google - module Cloud - module Workflows - module V1beta - ## - # Workflows is used to deploy and execute workflow programs. - # Workflows makes sure the program executes reliably, despite hardware and - # networking interruptions. - # - # @example Load this service and instantiate a gRPC client - # - # require "google/cloud/workflows/v1beta/workflows" - # client = ::Google::Cloud::Workflows::V1beta::Workflows::Client.new - # - # @example Load this service and instantiate a REST client - # - # require "google/cloud/workflows/v1beta/workflows/rest" - # client = ::Google::Cloud::Workflows::V1beta::Workflows::Rest::Client.new - # - module Workflows - end - end - end - end -end - -helper_path = ::File.join __dir__, "workflows", "helpers.rb" -require "google/cloud/workflows/v1beta/workflows/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-workflows-v1beta/lib/google/cloud/workflows/v1beta/workflows/client.rb b/owl-bot-staging/google-cloud-workflows-v1beta/lib/google/cloud/workflows/v1beta/workflows/client.rb deleted file mode 100644 index 9d115ffa4047..000000000000 --- a/owl-bot-staging/google-cloud-workflows-v1beta/lib/google/cloud/workflows/v1beta/workflows/client.rb +++ /dev/null @@ -1,952 +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/workflows/v1beta/workflows_pb" -require "google/cloud/location" - -module Google - module Cloud - module Workflows - module V1beta - module Workflows - ## - # Client for the Workflows service. - # - # Workflows is used to deploy and execute workflow programs. - # Workflows makes sure the program executes reliably, despite hardware and - # networking interruptions. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "workflows.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :workflows_stub - - ## - # Configure the Workflows Client class. - # - # See {::Google::Cloud::Workflows::V1beta::Workflows::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all Workflows clients - # ::Google::Cloud::Workflows::V1beta::Workflows::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", "Workflows", "V1beta"] - 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 - end - yield @configure if block_given? - @configure - end - - ## - # Configure the Workflows 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::Workflows::V1beta::Workflows::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 - @workflows_stub.universe_domain - end - - ## - # Create a new Workflows client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Workflows::V1beta::Workflows::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Workflows::V1beta::Workflows::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Workflows 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/workflows/v1beta/workflows_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 - - @workflows_stub = ::Gapic::ServiceStub.new( - ::Google::Cloud::Workflows::V1beta::Workflows::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 - ) - - @workflows_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 = @workflows_stub.endpoint - config.universe_domain = @workflows_stub.universe_domain - config.logger = @workflows_stub.logger if config.respond_to? :logger= - end - end - - ## - # Get the associated client for long-running operations. - # - # @return [::Google::Cloud::Workflows::V1beta::Workflows::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 - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @workflows_stub.logger - end - - # Service calls - - ## - # Lists Workflows in a given project and location. - # The default order is not specified. - # - # @overload list_workflows(request, options = nil) - # Pass arguments to `list_workflows` via a request object, either of type - # {::Google::Cloud::Workflows::V1beta::ListWorkflowsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Workflows::V1beta::ListWorkflowsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_workflows(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) - # Pass arguments to `list_workflows` via keyword arguments. Note that at - # least one keyword argument is 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. Project and location from which the workflows should be listed. - # Format: projects/\\{project}/locations/\\{location} - # @param page_size [::Integer] - # Maximum number of workflows to return per call. The service may return - # fewer than this value. If the value is not specified, a default value of - # 500 will be used. The maximum permitted value is 1000 and values greater - # than 1000 will be coerced down to 1000. - # @param page_token [::String] - # A page token, received from a previous `ListWorkflows` call. - # Provide this to retrieve the subsequent page. - # - # When paginating, all other parameters provided to `ListWorkflows` must - # match the call that provided the page token. - # @param filter [::String] - # Filter to restrict results to specific workflows. - # @param order_by [::String] - # Comma-separated list of fields that that specify the order of the results. - # Default sorting order for a field is ascending. To specify descending order - # for a field, append a " desc" suffix. - # If not specified, the results will be returned in an unspecified order. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Workflows::V1beta::Workflow>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::Workflows::V1beta::Workflow>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/workflows/v1beta" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Workflows::V1beta::Workflows::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Workflows::V1beta::ListWorkflowsRequest.new - # - # # Call the list_workflows method. - # result = client.list_workflows 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::Workflows::V1beta::Workflow. - # p item - # end - # - def list_workflows request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workflows::V1beta::ListWorkflowsRequest - - # Converts hash 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_workflows.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::Workflows::V1beta::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_workflows.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_workflows.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @workflows_stub.call_rpc :list_workflows, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @workflows_stub, :list_workflows, 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 - - ## - # Gets details of a single Workflow. - # - # @overload get_workflow(request, options = nil) - # Pass arguments to `get_workflow` via a request object, either of type - # {::Google::Cloud::Workflows::V1beta::GetWorkflowRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Workflows::V1beta::GetWorkflowRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_workflow(name: nil) - # Pass arguments to `get_workflow` via keyword arguments. Note that at - # least one keyword argument is 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 workflow which information should be retrieved. - # Format: projects/\\{project}/locations/\\{location}/workflows/\\{workflow} - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Workflows::V1beta::Workflow] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Workflows::V1beta::Workflow] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/workflows/v1beta" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Workflows::V1beta::Workflows::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Workflows::V1beta::GetWorkflowRequest.new - # - # # Call the get_workflow method. - # result = client.get_workflow request - # - # # The returned object is of type Google::Cloud::Workflows::V1beta::Workflow. - # p result - # - def get_workflow request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workflows::V1beta::GetWorkflowRequest - - # Converts hash 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_workflow.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::Workflows::V1beta::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_workflow.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_workflow.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @workflows_stub.call_rpc :get_workflow, 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 workflow. If a workflow with the specified name already - # exists in the specified project and location, the long running operation - # will return [ALREADY_EXISTS][google.rpc.Code.ALREADY_EXISTS] error. - # - # @overload create_workflow(request, options = nil) - # Pass arguments to `create_workflow` via a request object, either of type - # {::Google::Cloud::Workflows::V1beta::CreateWorkflowRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Workflows::V1beta::CreateWorkflowRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_workflow(parent: nil, workflow: nil, workflow_id: nil) - # Pass arguments to `create_workflow` via keyword arguments. Note that at - # least one keyword argument is 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. Project and location in which the workflow should be created. - # Format: projects/\\{project}/locations/\\{location} - # @param workflow [::Google::Cloud::Workflows::V1beta::Workflow, ::Hash] - # Required. Workflow to be created. - # @param workflow_id [::String] - # Required. The ID of the workflow to be created. It has to fulfill the - # following requirements: - # - # * Must contain only letters, numbers, underscores and hyphens. - # * Must start with a letter. - # * Must be between 1-64 characters. - # * Must end with a number or a letter. - # * Must be unique within the customer project and location. - # - # @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/workflows/v1beta" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Workflows::V1beta::Workflows::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Workflows::V1beta::CreateWorkflowRequest.new - # - # # Call the create_workflow method. - # result = client.create_workflow 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_workflow request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workflows::V1beta::CreateWorkflowRequest - - # Converts hash 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_workflow.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::Workflows::V1beta::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_workflow.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_workflow.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @workflows_stub.call_rpc :create_workflow, 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 workflow with the specified name. - # This method also cancels and deletes all running executions of the - # workflow. - # - # @overload delete_workflow(request, options = nil) - # Pass arguments to `delete_workflow` via a request object, either of type - # {::Google::Cloud::Workflows::V1beta::DeleteWorkflowRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Workflows::V1beta::DeleteWorkflowRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_workflow(name: nil) - # Pass arguments to `delete_workflow` via keyword arguments. Note that at - # least one keyword argument is 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 workflow to be deleted. - # Format: projects/\\{project}/locations/\\{location}/workflows/\\{workflow} - # - # @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/workflows/v1beta" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Workflows::V1beta::Workflows::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Workflows::V1beta::DeleteWorkflowRequest.new - # - # # Call the delete_workflow method. - # result = client.delete_workflow 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_workflow request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workflows::V1beta::DeleteWorkflowRequest - - # Converts hash 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_workflow.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::Workflows::V1beta::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_workflow.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_workflow.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @workflows_stub.call_rpc :delete_workflow, 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 - - ## - # Updates an existing workflow. - # Running this method has no impact on already running executions of the - # workflow. A new revision of the workflow may be created as a result of a - # successful update operation. In that case, such revision will be used - # in new workflow executions. - # - # @overload update_workflow(request, options = nil) - # Pass arguments to `update_workflow` via a request object, either of type - # {::Google::Cloud::Workflows::V1beta::UpdateWorkflowRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Workflows::V1beta::UpdateWorkflowRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_workflow(workflow: nil, update_mask: nil) - # Pass arguments to `update_workflow` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param workflow [::Google::Cloud::Workflows::V1beta::Workflow, ::Hash] - # Required. Workflow to be updated. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # List of fields to be updated. If not present, the entire workflow - # will be updated. - # - # @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/workflows/v1beta" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Workflows::V1beta::Workflows::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Workflows::V1beta::UpdateWorkflowRequest.new - # - # # Call the update_workflow method. - # result = client.update_workflow 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 update_workflow request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workflows::V1beta::UpdateWorkflowRequest - - # Converts hash 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_workflow.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::Workflows::V1beta::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.workflow&.name - header_params["workflow.name"] = request.workflow.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_workflow.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_workflow.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @workflows_stub.call_rpc :update_workflow, 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 Workflows API. - # - # This class represents the configuration for Workflows, - # 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::Workflows::V1beta::Workflows::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_workflows to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Workflows::V1beta::Workflows::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_workflows.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Workflows::V1beta::Workflows::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_workflows.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::Workflows::V1beta::Workflows::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 = "workflows.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 Workflows 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_workflows` - # @return [::Gapic::Config::Method] - # - attr_reader :list_workflows - ## - # RPC-specific configuration for `get_workflow` - # @return [::Gapic::Config::Method] - # - attr_reader :get_workflow - ## - # RPC-specific configuration for `create_workflow` - # @return [::Gapic::Config::Method] - # - attr_reader :create_workflow - ## - # RPC-specific configuration for `delete_workflow` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_workflow - ## - # RPC-specific configuration for `update_workflow` - # @return [::Gapic::Config::Method] - # - attr_reader :update_workflow - - # @private - def initialize parent_rpcs = nil - list_workflows_config = parent_rpcs.list_workflows if parent_rpcs.respond_to? :list_workflows - @list_workflows = ::Gapic::Config::Method.new list_workflows_config - get_workflow_config = parent_rpcs.get_workflow if parent_rpcs.respond_to? :get_workflow - @get_workflow = ::Gapic::Config::Method.new get_workflow_config - create_workflow_config = parent_rpcs.create_workflow if parent_rpcs.respond_to? :create_workflow - @create_workflow = ::Gapic::Config::Method.new create_workflow_config - delete_workflow_config = parent_rpcs.delete_workflow if parent_rpcs.respond_to? :delete_workflow - @delete_workflow = ::Gapic::Config::Method.new delete_workflow_config - update_workflow_config = parent_rpcs.update_workflow if parent_rpcs.respond_to? :update_workflow - @update_workflow = ::Gapic::Config::Method.new update_workflow_config - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-workflows-v1beta/lib/google/cloud/workflows/v1beta/workflows/credentials.rb b/owl-bot-staging/google-cloud-workflows-v1beta/lib/google/cloud/workflows/v1beta/workflows/credentials.rb deleted file mode 100644 index 550b00fccd1b..000000000000 --- a/owl-bot-staging/google-cloud-workflows-v1beta/lib/google/cloud/workflows/v1beta/workflows/credentials.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! - -require "googleauth" - -module Google - module Cloud - module Workflows - module V1beta - module Workflows - # Credentials for the Workflows API. - class Credentials < ::Google::Auth::Credentials - self.scope = [ - "https://www.googleapis.com/auth/cloud-platform" - ] - self.env_vars = [ - "WORKFLOWS_CREDENTIALS", - "WORKFLOWS_KEYFILE", - "GOOGLE_CLOUD_CREDENTIALS", - "GOOGLE_CLOUD_KEYFILE", - "GCLOUD_KEYFILE", - "WORKFLOWS_CREDENTIALS_JSON", - "WORKFLOWS_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-workflows-v1beta/lib/google/cloud/workflows/v1beta/workflows/operations.rb b/owl-bot-staging/google-cloud-workflows-v1beta/lib/google/cloud/workflows/v1beta/workflows/operations.rb deleted file mode 100644 index 7011dce23d65..000000000000 --- a/owl-bot-staging/google-cloud-workflows-v1beta/lib/google/cloud/workflows/v1beta/workflows/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 Workflows - module V1beta - module Workflows - # Service that implements Longrunning Operations API. - class Operations - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "workflows.$UNIVERSE_DOMAIN$" - - # @private - attr_reader :operations_stub - - ## - # Configuration for the Workflows 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 Workflows 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::Workflows::V1beta::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::Workflows::V1beta::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::Workflows::V1beta::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::Workflows::V1beta::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::Workflows::V1beta::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 = "workflows.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-workflows-v1beta/lib/google/cloud/workflows/v1beta/workflows/paths.rb b/owl-bot-staging/google-cloud-workflows-v1beta/lib/google/cloud/workflows/v1beta/workflows/paths.rb deleted file mode 100644 index 8e6d9fdd43a9..000000000000 --- a/owl-bot-staging/google-cloud-workflows-v1beta/lib/google/cloud/workflows/v1beta/workflows/paths.rb +++ /dev/null @@ -1,69 +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 Workflows - module V1beta - module Workflows - # Path helper methods for the Workflows 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 Workflow resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/workflows/{workflow}` - # - # @param project [String] - # @param location [String] - # @param workflow [String] - # - # @return [::String] - def workflow_path project:, location:, workflow: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/workflows/#{workflow}" - end - - extend self - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-workflows-v1beta/lib/google/cloud/workflows/v1beta/workflows/rest.rb b/owl-bot-staging/google-cloud-workflows-v1beta/lib/google/cloud/workflows/v1beta/workflows/rest.rb deleted file mode 100644 index c806faf98cba..000000000000 --- a/owl-bot-staging/google-cloud-workflows-v1beta/lib/google/cloud/workflows/v1beta/workflows/rest.rb +++ /dev/null @@ -1,56 +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/workflows/v1beta/version" -require "google/cloud/workflows/v1beta/bindings_override" - -require "google/cloud/workflows/v1beta/workflows/credentials" -require "google/cloud/workflows/v1beta/workflows/paths" -require "google/cloud/workflows/v1beta/workflows/rest/operations" -require "google/cloud/workflows/v1beta/workflows/rest/client" - -module Google - module Cloud - module Workflows - module V1beta - ## - # Workflows is used to deploy and execute workflow programs. - # Workflows makes sure the program executes reliably, despite hardware and - # networking interruptions. - # - # To load this service and instantiate a REST client: - # - # require "google/cloud/workflows/v1beta/workflows/rest" - # client = ::Google::Cloud::Workflows::V1beta::Workflows::Rest::Client.new - # - module Workflows - # Client for the REST transport - module Rest - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "rest", "helpers.rb" -require "google/cloud/workflows/v1beta/workflows/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-workflows-v1beta/lib/google/cloud/workflows/v1beta/workflows/rest/client.rb b/owl-bot-staging/google-cloud-workflows-v1beta/lib/google/cloud/workflows/v1beta/workflows/rest/client.rb deleted file mode 100644 index 129d779d0741..000000000000 --- a/owl-bot-staging/google-cloud-workflows-v1beta/lib/google/cloud/workflows/v1beta/workflows/rest/client.rb +++ /dev/null @@ -1,882 +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/workflows/v1beta/workflows_pb" -require "google/cloud/workflows/v1beta/workflows/rest/service_stub" -require "google/cloud/location/rest" - -module Google - module Cloud - module Workflows - module V1beta - module Workflows - module Rest - ## - # REST client for the Workflows service. - # - # Workflows is used to deploy and execute workflow programs. - # Workflows makes sure the program executes reliably, despite hardware and - # networking interruptions. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "workflows.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :workflows_stub - - ## - # Configure the Workflows Client class. - # - # See {::Google::Cloud::Workflows::V1beta::Workflows::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all Workflows clients - # ::Google::Cloud::Workflows::V1beta::Workflows::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", "Workflows", "V1beta"] - 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 - end - yield @configure if block_given? - @configure - end - - ## - # Configure the Workflows 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::Workflows::V1beta::Workflows::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 - @workflows_stub.universe_domain - end - - ## - # Create a new Workflows REST client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Workflows::V1beta::Workflows::Rest::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Workflows::V1beta::Workflows::Rest::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Workflows 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::Workflows::V1beta::Workflows::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 - - @workflows_stub = ::Google::Cloud::Workflows::V1beta::Workflows::Rest::ServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials, - logger: @config.logger - ) - - @workflows_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 = @workflows_stub.endpoint - config.universe_domain = @workflows_stub.universe_domain - config.bindings_override = @config.bindings_override - config.logger = @workflows_stub.logger if config.respond_to? :logger= - end - end - - ## - # Get the associated client for long-running operations. - # - # @return [::Google::Cloud::Workflows::V1beta::Workflows::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 - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @workflows_stub.logger - end - - # Service calls - - ## - # Lists Workflows in a given project and location. - # The default order is not specified. - # - # @overload list_workflows(request, options = nil) - # Pass arguments to `list_workflows` via a request object, either of type - # {::Google::Cloud::Workflows::V1beta::ListWorkflowsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Workflows::V1beta::ListWorkflowsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_workflows(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) - # Pass arguments to `list_workflows` via keyword arguments. Note that at - # least one keyword argument is 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. Project and location from which the workflows should be listed. - # Format: projects/\\{project}/locations/\\{location} - # @param page_size [::Integer] - # Maximum number of workflows to return per call. The service may return - # fewer than this value. If the value is not specified, a default value of - # 500 will be used. The maximum permitted value is 1000 and values greater - # than 1000 will be coerced down to 1000. - # @param page_token [::String] - # A page token, received from a previous `ListWorkflows` call. - # Provide this to retrieve the subsequent page. - # - # When paginating, all other parameters provided to `ListWorkflows` must - # match the call that provided the page token. - # @param filter [::String] - # Filter to restrict results to specific workflows. - # @param order_by [::String] - # Comma-separated list of fields that that specify the order of the results. - # Default sorting order for a field is ascending. To specify descending order - # for a field, append a " desc" suffix. - # If not specified, the results will be returned in an unspecified order. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Workflows::V1beta::Workflow>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Workflows::V1beta::Workflow>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/workflows/v1beta" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Workflows::V1beta::Workflows::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Workflows::V1beta::ListWorkflowsRequest.new - # - # # Call the list_workflows method. - # result = client.list_workflows 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::Workflows::V1beta::Workflow. - # p item - # end - # - def list_workflows request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workflows::V1beta::ListWorkflowsRequest - - # Converts hash 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_workflows.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::Workflows::V1beta::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_workflows.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_workflows.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @workflows_stub.list_workflows request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @workflows_stub, :list_workflows, "workflows", 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 details of a single Workflow. - # - # @overload get_workflow(request, options = nil) - # Pass arguments to `get_workflow` via a request object, either of type - # {::Google::Cloud::Workflows::V1beta::GetWorkflowRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Workflows::V1beta::GetWorkflowRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_workflow(name: nil) - # Pass arguments to `get_workflow` via keyword arguments. Note that at - # least one keyword argument is 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 workflow which information should be retrieved. - # Format: projects/\\{project}/locations/\\{location}/workflows/\\{workflow} - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Workflows::V1beta::Workflow] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Workflows::V1beta::Workflow] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/workflows/v1beta" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Workflows::V1beta::Workflows::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Workflows::V1beta::GetWorkflowRequest.new - # - # # Call the get_workflow method. - # result = client.get_workflow request - # - # # The returned object is of type Google::Cloud::Workflows::V1beta::Workflow. - # p result - # - def get_workflow request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workflows::V1beta::GetWorkflowRequest - - # Converts hash 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_workflow.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::Workflows::V1beta::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_workflow.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_workflow.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @workflows_stub.get_workflow 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 workflow. If a workflow with the specified name already - # exists in the specified project and location, the long running operation - # will return [ALREADY_EXISTS][google.rpc.Code.ALREADY_EXISTS] error. - # - # @overload create_workflow(request, options = nil) - # Pass arguments to `create_workflow` via a request object, either of type - # {::Google::Cloud::Workflows::V1beta::CreateWorkflowRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Workflows::V1beta::CreateWorkflowRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_workflow(parent: nil, workflow: nil, workflow_id: nil) - # Pass arguments to `create_workflow` via keyword arguments. Note that at - # least one keyword argument is 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. Project and location in which the workflow should be created. - # Format: projects/\\{project}/locations/\\{location} - # @param workflow [::Google::Cloud::Workflows::V1beta::Workflow, ::Hash] - # Required. Workflow to be created. - # @param workflow_id [::String] - # Required. The ID of the workflow to be created. It has to fulfill the - # following requirements: - # - # * Must contain only letters, numbers, underscores and hyphens. - # * Must start with a letter. - # * Must be between 1-64 characters. - # * Must end with a number or a letter. - # * Must be unique within the customer project and location. - # @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/workflows/v1beta" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Workflows::V1beta::Workflows::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Workflows::V1beta::CreateWorkflowRequest.new - # - # # Call the create_workflow method. - # result = client.create_workflow 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_workflow request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workflows::V1beta::CreateWorkflowRequest - - # Converts hash 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_workflow.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::Workflows::V1beta::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_workflow.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_workflow.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @workflows_stub.create_workflow 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 workflow with the specified name. - # This method also cancels and deletes all running executions of the - # workflow. - # - # @overload delete_workflow(request, options = nil) - # Pass arguments to `delete_workflow` via a request object, either of type - # {::Google::Cloud::Workflows::V1beta::DeleteWorkflowRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Workflows::V1beta::DeleteWorkflowRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_workflow(name: nil) - # Pass arguments to `delete_workflow` via keyword arguments. Note that at - # least one keyword argument is 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 workflow to be deleted. - # Format: projects/\\{project}/locations/\\{location}/workflows/\\{workflow} - # @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/workflows/v1beta" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Workflows::V1beta::Workflows::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Workflows::V1beta::DeleteWorkflowRequest.new - # - # # Call the delete_workflow method. - # result = client.delete_workflow 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_workflow request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workflows::V1beta::DeleteWorkflowRequest - - # Converts hash 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_workflow.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::Workflows::V1beta::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_workflow.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_workflow.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @workflows_stub.delete_workflow 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 - - ## - # Updates an existing workflow. - # Running this method has no impact on already running executions of the - # workflow. A new revision of the workflow may be created as a result of a - # successful update operation. In that case, such revision will be used - # in new workflow executions. - # - # @overload update_workflow(request, options = nil) - # Pass arguments to `update_workflow` via a request object, either of type - # {::Google::Cloud::Workflows::V1beta::UpdateWorkflowRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Workflows::V1beta::UpdateWorkflowRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_workflow(workflow: nil, update_mask: nil) - # Pass arguments to `update_workflow` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param workflow [::Google::Cloud::Workflows::V1beta::Workflow, ::Hash] - # Required. Workflow to be updated. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # List of fields to be updated. If not present, the entire workflow - # will be updated. - # @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/workflows/v1beta" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Workflows::V1beta::Workflows::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Workflows::V1beta::UpdateWorkflowRequest.new - # - # # Call the update_workflow method. - # result = client.update_workflow 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 update_workflow request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workflows::V1beta::UpdateWorkflowRequest - - # Converts hash 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_workflow.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::Workflows::V1beta::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_workflow.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_workflow.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @workflows_stub.update_workflow 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 - - ## - # Configuration class for the Workflows REST API. - # - # This class represents the configuration for Workflows 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::Workflows::V1beta::Workflows::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_workflows to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Workflows::V1beta::Workflows::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_workflows.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Workflows::V1beta::Workflows::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_workflows.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 = "workflows.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 Workflows 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_workflows` - # @return [::Gapic::Config::Method] - # - attr_reader :list_workflows - ## - # RPC-specific configuration for `get_workflow` - # @return [::Gapic::Config::Method] - # - attr_reader :get_workflow - ## - # RPC-specific configuration for `create_workflow` - # @return [::Gapic::Config::Method] - # - attr_reader :create_workflow - ## - # RPC-specific configuration for `delete_workflow` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_workflow - ## - # RPC-specific configuration for `update_workflow` - # @return [::Gapic::Config::Method] - # - attr_reader :update_workflow - - # @private - def initialize parent_rpcs = nil - list_workflows_config = parent_rpcs.list_workflows if parent_rpcs.respond_to? :list_workflows - @list_workflows = ::Gapic::Config::Method.new list_workflows_config - get_workflow_config = parent_rpcs.get_workflow if parent_rpcs.respond_to? :get_workflow - @get_workflow = ::Gapic::Config::Method.new get_workflow_config - create_workflow_config = parent_rpcs.create_workflow if parent_rpcs.respond_to? :create_workflow - @create_workflow = ::Gapic::Config::Method.new create_workflow_config - delete_workflow_config = parent_rpcs.delete_workflow if parent_rpcs.respond_to? :delete_workflow - @delete_workflow = ::Gapic::Config::Method.new delete_workflow_config - update_workflow_config = parent_rpcs.update_workflow if parent_rpcs.respond_to? :update_workflow - @update_workflow = ::Gapic::Config::Method.new update_workflow_config - - yield self if block_given? - end - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-workflows-v1beta/lib/google/cloud/workflows/v1beta/workflows/rest/operations.rb b/owl-bot-staging/google-cloud-workflows-v1beta/lib/google/cloud/workflows/v1beta/workflows/rest/operations.rb deleted file mode 100644 index f7964defcdb0..000000000000 --- a/owl-bot-staging/google-cloud-workflows-v1beta/lib/google/cloud/workflows/v1beta/workflows/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 Workflows - module V1beta - module Workflows - module Rest - # Service that implements Longrunning Operations API. - class Operations - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "workflows.$UNIVERSE_DOMAIN$" - - # @private - attr_reader :operations_stub - - ## - # Configuration for the Workflows 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 Workflows 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::Workflows::V1beta::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::Workflows::V1beta::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::Workflows::V1beta::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::Workflows::V1beta::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 = "workflows.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: "/v1beta/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/?$}, 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: "/v1beta/{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: "/v1beta/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] - ] - ) - 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-workflows-v1beta/lib/google/cloud/workflows/v1beta/workflows/rest/service_stub.rb b/owl-bot-staging/google-cloud-workflows-v1beta/lib/google/cloud/workflows/v1beta/workflows/rest/service_stub.rb deleted file mode 100644 index 2b77bde101f9..000000000000 --- a/owl-bot-staging/google-cloud-workflows-v1beta/lib/google/cloud/workflows/v1beta/workflows/rest/service_stub.rb +++ /dev/null @@ -1,388 +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/workflows/v1beta/workflows_pb" - -module Google - module Cloud - module Workflows - module V1beta - module Workflows - module Rest - ## - # REST service stub for the Workflows 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_workflows REST call - # - # @param request_pb [::Google::Cloud::Workflows::V1beta::ListWorkflowsRequest] - # 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::Workflows::V1beta::ListWorkflowsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Workflows::V1beta::ListWorkflowsResponse] - # A result object deserialized from the server's reply - def list_workflows request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_workflows_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_workflows", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Workflows::V1beta::ListWorkflowsResponse.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_workflow REST call - # - # @param request_pb [::Google::Cloud::Workflows::V1beta::GetWorkflowRequest] - # 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::Workflows::V1beta::Workflow] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Workflows::V1beta::Workflow] - # A result object deserialized from the server's reply - def get_workflow request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_workflow_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_workflow", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Workflows::V1beta::Workflow.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_workflow REST call - # - # @param request_pb [::Google::Cloud::Workflows::V1beta::CreateWorkflowRequest] - # 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_workflow request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_workflow_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_workflow", - 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_workflow REST call - # - # @param request_pb [::Google::Cloud::Workflows::V1beta::DeleteWorkflowRequest] - # 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_workflow request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_delete_workflow_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_workflow", - 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 update_workflow REST call - # - # @param request_pb [::Google::Cloud::Workflows::V1beta::UpdateWorkflowRequest] - # 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 update_workflow request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_workflow_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_workflow", - 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 - - ## - # @private - # - # GRPC transcoding helper method for the list_workflows REST call - # - # @param request_pb [::Google::Cloud::Workflows::V1beta::ListWorkflowsRequest] - # 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_workflows_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1beta/{parent}/workflows", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_workflow REST call - # - # @param request_pb [::Google::Cloud::Workflows::V1beta::GetWorkflowRequest] - # 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_workflow_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1beta/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/workflows/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the create_workflow REST call - # - # @param request_pb [::Google::Cloud::Workflows::V1beta::CreateWorkflowRequest] - # 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_workflow_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1beta/{parent}/workflows", - body: "workflow", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_workflow REST call - # - # @param request_pb [::Google::Cloud::Workflows::V1beta::DeleteWorkflowRequest] - # 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_workflow_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v1beta/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/workflows/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_workflow REST call - # - # @param request_pb [::Google::Cloud::Workflows::V1beta::UpdateWorkflowRequest] - # 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_workflow_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v1beta/{workflow.name}", - body: "workflow", - matches: [ - ["workflow.name", %r{^projects/[^/]+/locations/[^/]+/workflows/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-workflows-v1beta/lib/google/cloud/workflows/v1beta/workflows_pb.rb b/owl-bot-staging/google-cloud-workflows-v1beta/lib/google/cloud/workflows/v1beta/workflows_pb.rb deleted file mode 100644 index 7b8323216f07..000000000000 --- a/owl-bot-staging/google-cloud-workflows-v1beta/lib/google/cloud/workflows/v1beta/workflows_pb.rb +++ /dev/null @@ -1,38 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/workflows/v1beta/workflows.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/empty_pb' -require 'google/protobuf/field_mask_pb' -require 'google/protobuf/timestamp_pb' - - -descriptor_data = "\n-google/cloud/workflows/v1beta/workflows.proto\x12\x1dgoogle.cloud.workflows.v1beta\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\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xfe\x04\n\x08Workflow\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x02 \x01(\t\x12\x41\n\x05state\x18\x03 \x01(\x0e\x32-.google.cloud.workflows.v1beta.Workflow.StateB\x03\xe0\x41\x03\x12\x18\n\x0brevision_id\x18\x04 \x01(\tB\x03\xe0\x41\x03\x12\x34\n\x0b\x63reate_time\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12=\n\x14revision_create_time\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x43\n\x06labels\x18\x08 \x03(\x0b\x32\x33.google.cloud.workflows.v1beta.Workflow.LabelsEntry\x12\x17\n\x0fservice_account\x18\t \x01(\t\x12\x19\n\x0fsource_contents\x18\n \x01(\tH\x00\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"*\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\n\n\x06\x41\x43TIVE\x10\x01:d\xea\x41\x61\n!workflows.googleapis.com/Workflow\x12\n\x08workflow\x18\x02 \x01(\x0b\x32\'.google.cloud.workflows.v1beta.WorkflowB\x03\xe0\x41\x02\x12\x18\n\x0bworkflow_id\x18\x03 \x01(\tB\x03\xe0\x41\x02\"P\n\x15\x44\x65leteWorkflowRequest\x12\x37\n\x04name\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!workflows.googleapis.com/Workflow\"\x88\x01\n\x15UpdateWorkflowRequest\x12>\n\x08workflow\x18\x01 \x01(\x0b\x32\'.google.cloud.workflows.v1beta.WorkflowB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"\xa5\x01\n\x11OperationMetadata\x12/\n\x0b\x63reate_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12,\n\x08\x65nd_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x0e\n\x06target\x18\x03 \x01(\t\x12\x0c\n\x04verb\x18\x04 \x01(\t\x12\x13\n\x0b\x61pi_version\x18\x05 \x01(\t2\xf9\x08\n\tWorkflows\x12\xbe\x01\n\rListWorkflows\x12\x33.google.cloud.workflows.v1beta.ListWorkflowsRequest\x1a\x34.google.cloud.workflows.v1beta.ListWorkflowsResponse\"B\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x33\x12\x31/v1beta/{parent=projects/*/locations/*}/workflows\x12\xab\x01\n\x0bGetWorkflow\x12\x31.google.cloud.workflows.v1beta.GetWorkflowRequest\x1a\'.google.cloud.workflows.v1beta.Workflow\"@\xda\x41\x04name\x82\xd3\xe4\x93\x02\x33\x12\x31/v1beta/{name=projects/*/locations/*/workflows/*}\x12\xe9\x01\n\x0e\x43reateWorkflow\x12\x34.google.cloud.workflows.v1beta.CreateWorkflowRequest\x1a\x1d.google.longrunning.Operation\"\x81\x01\xca\x41\x1d\n\x08Workflow\x12\x11OperationMetadata\xda\x41\x1bparent,workflow,workflow_id\x82\xd3\xe4\x93\x02=\"1/v1beta/{parent=projects/*/locations/*}/workflows:\x08workflow\x12\xd4\x01\n\x0e\x44\x65leteWorkflow\x12\x34.google.cloud.workflows.v1beta.DeleteWorkflowRequest\x1a\x1d.google.longrunning.Operation\"m\xca\x41*\n\x15google.protobuf.Empty\x12\x11OperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02\x33*1/v1beta/{name=projects/*/locations/*/workflows/*}\x12\xeb\x01\n\x0eUpdateWorkflow\x12\x34.google.cloud.workflows.v1beta.UpdateWorkflowRequest\x1a\x1d.google.longrunning.Operation\"\x83\x01\xca\x41\x1d\n\x08Workflow\x12\x11OperationMetadata\xda\x41\x14workflow,update_mask\x82\xd3\xe4\x93\x02\x46\x32:/v1beta/{workflow.name=projects/*/locations/*/workflows/*}:\x08workflow\x1aL\xca\x41\x18workflows.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformBv\n!com.google.cloud.workflows.v1betaB\x0eWorkflowsProtoP\x01Z?cloud.google.com/go/workflows/apiv1beta/workflowspb;workflowspbb\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module Workflows - module V1beta - Workflow = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.workflows.v1beta.Workflow").msgclass - Workflow::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.workflows.v1beta.Workflow.State").enummodule - ListWorkflowsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.workflows.v1beta.ListWorkflowsRequest").msgclass - ListWorkflowsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.workflows.v1beta.ListWorkflowsResponse").msgclass - GetWorkflowRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.workflows.v1beta.GetWorkflowRequest").msgclass - CreateWorkflowRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.workflows.v1beta.CreateWorkflowRequest").msgclass - DeleteWorkflowRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.workflows.v1beta.DeleteWorkflowRequest").msgclass - UpdateWorkflowRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.workflows.v1beta.UpdateWorkflowRequest").msgclass - OperationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.workflows.v1beta.OperationMetadata").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-workflows-v1beta/lib/google/cloud/workflows/v1beta/workflows_services_pb.rb b/owl-bot-staging/google-cloud-workflows-v1beta/lib/google/cloud/workflows/v1beta/workflows_services_pb.rb deleted file mode 100644 index c6606ec7ea91..000000000000 --- a/owl-bot-staging/google-cloud-workflows-v1beta/lib/google/cloud/workflows/v1beta/workflows_services_pb.rb +++ /dev/null @@ -1,64 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# Source: google/cloud/workflows/v1beta/workflows.proto for package 'google.cloud.workflows.v1beta' -# 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/workflows/v1beta/workflows_pb' - -module Google - module Cloud - module Workflows - module V1beta - module Workflows - # Workflows is used to deploy and execute workflow programs. - # Workflows makes sure the program executes reliably, despite hardware and - # networking interruptions. - class Service - - include ::GRPC::GenericService - - self.marshal_class_method = :encode - self.unmarshal_class_method = :decode - self.service_name = 'google.cloud.workflows.v1beta.Workflows' - - # Lists Workflows in a given project and location. - # The default order is not specified. - rpc :ListWorkflows, ::Google::Cloud::Workflows::V1beta::ListWorkflowsRequest, ::Google::Cloud::Workflows::V1beta::ListWorkflowsResponse - # Gets details of a single Workflow. - rpc :GetWorkflow, ::Google::Cloud::Workflows::V1beta::GetWorkflowRequest, ::Google::Cloud::Workflows::V1beta::Workflow - # Creates a new workflow. If a workflow with the specified name already - # exists in the specified project and location, the long running operation - # will return [ALREADY_EXISTS][google.rpc.Code.ALREADY_EXISTS] error. - rpc :CreateWorkflow, ::Google::Cloud::Workflows::V1beta::CreateWorkflowRequest, ::Google::Longrunning::Operation - # Deletes a workflow with the specified name. - # This method also cancels and deletes all running executions of the - # workflow. - rpc :DeleteWorkflow, ::Google::Cloud::Workflows::V1beta::DeleteWorkflowRequest, ::Google::Longrunning::Operation - # Updates an existing workflow. - # Running this method has no impact on already running executions of the - # workflow. A new revision of the workflow may be created as a result of a - # successful update operation. In that case, such revision will be used - # in new workflow executions. - rpc :UpdateWorkflow, ::Google::Cloud::Workflows::V1beta::UpdateWorkflowRequest, ::Google::Longrunning::Operation - end - - Stub = Service.rpc_stub_class - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-workflows-v1beta/proto_docs/README.md b/owl-bot-staging/google-cloud-workflows-v1beta/proto_docs/README.md deleted file mode 100644 index 00492e17dd69..000000000000 --- a/owl-bot-staging/google-cloud-workflows-v1beta/proto_docs/README.md +++ /dev/null @@ -1,4 +0,0 @@ -# Workflows V1beta 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-workflows-v1beta/proto_docs/google/api/client.rb b/owl-bot-staging/google-cloud-workflows-v1beta/proto_docs/google/api/client.rb deleted file mode 100644 index 3ab0b096d445..000000000000 --- a/owl-bot-staging/google-cloud-workflows-v1beta/proto_docs/google/api/client.rb +++ /dev/null @@ -1,593 +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. - # - # Note: This field should not be used in most cases. - 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: - # library_settings: - # 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. - # @!attribute [rw] library_package - # @return [::String] - # The package name to use in Php. Clobbers the php_namespace option - # set in the protobuf. This should be used **only** by APIs - # who have already set the language_settings.php.package_name" field - # in gapic.yaml. API teams should use the protobuf php_namespace option - # where possible. - # - # Example of a YAML configuration:: - # - # publishing: - # library_settings: - # php_settings: - # library_package: Google\Cloud\PubSub\V1 - 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. - # - # Example: - # - # 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 - # @!attribute [rw] batching - # @return [::Google::Api::BatchingConfigProto] - # Batching configuration for an API method in client libraries. - # - # Example of a YAML configuration: - # - # publishing: - # method_settings: - # - selector: google.example.v1.ExampleService.BatchCreateExample - # batching: - # element_count_threshold: 1000 - # request_byte_threshold: 100000000 - # delay_threshold_millis: 10 - 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. - # - # Note: This feature should not be used in most cases. - # @!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 - - # `BatchingConfigProto` defines the batching configuration for an API method. - # @!attribute [rw] thresholds - # @return [::Google::Api::BatchingSettingsProto] - # The thresholds which trigger a batched request to be sent. - # @!attribute [rw] batch_descriptor - # @return [::Google::Api::BatchingDescriptorProto] - # The request and response fields used in batching. - class BatchingConfigProto - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # `BatchingSettingsProto` specifies a set of batching thresholds, each of - # which acts as a trigger to send a batch of messages as a request. At least - # one threshold must be positive nonzero. - # @!attribute [rw] element_count_threshold - # @return [::Integer] - # The number of elements of a field collected into a batch which, if - # exceeded, causes the batch to be sent. - # @!attribute [rw] request_byte_threshold - # @return [::Integer] - # The aggregated size of the batched field which, if exceeded, causes the - # batch to be sent. This size is computed by aggregating the sizes of the - # request field to be batched, not of the entire request message. - # @!attribute [rw] delay_threshold - # @return [::Google::Protobuf::Duration] - # The duration after which a batch should be sent, starting from the addition - # of the first message to that batch. - # @!attribute [rw] element_count_limit - # @return [::Integer] - # The maximum number of elements collected in a batch that could be accepted - # by server. - # @!attribute [rw] request_byte_limit - # @return [::Integer] - # The maximum size of the request that could be accepted by server. - # @!attribute [rw] flow_control_element_limit - # @return [::Integer] - # The maximum number of elements allowed by flow control. - # @!attribute [rw] flow_control_byte_limit - # @return [::Integer] - # The maximum size of data allowed by flow control. - # @!attribute [rw] flow_control_limit_exceeded_behavior - # @return [::Google::Api::FlowControlLimitExceededBehaviorProto] - # The behavior to take when the flow control limit is exceeded. - class BatchingSettingsProto - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # `BatchingDescriptorProto` specifies the fields of the request message to be - # used for batching, and, optionally, the fields of the response message to be - # used for demultiplexing. - # @!attribute [rw] batched_field - # @return [::String] - # The repeated field in the request message to be aggregated by batching. - # @!attribute [rw] discriminator_fields - # @return [::Array<::String>] - # A list of the fields in the request message. Two requests will be batched - # together only if the values of every field specified in - # `request_discriminator_fields` is equal between the two requests. - # @!attribute [rw] subresponse_field - # @return [::String] - # Optional. When present, indicates the field in the response message to be - # used to demultiplex the response into multiple response messages, in - # correspondence with the multiple request messages originally batched - # together. - class BatchingDescriptorProto - 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 - - # The behavior to take when the flow control limit is exceeded. - module FlowControlLimitExceededBehaviorProto - # Default behavior, system-defined. - UNSET_BEHAVIOR = 0 - - # Stop operation, raise error. - THROW_EXCEPTION = 1 - - # Pause operation until limit clears. - BLOCK = 2 - - # Continue operation, disregard limit. - IGNORE = 3 - end - end -end diff --git a/owl-bot-staging/google-cloud-workflows-v1beta/proto_docs/google/api/field_behavior.rb b/owl-bot-staging/google-cloud-workflows-v1beta/proto_docs/google/api/field_behavior.rb deleted file mode 100644 index 582be187d115..000000000000 --- a/owl-bot-staging/google-cloud-workflows-v1beta/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-workflows-v1beta/proto_docs/google/api/launch_stage.rb b/owl-bot-staging/google-cloud-workflows-v1beta/proto_docs/google/api/launch_stage.rb deleted file mode 100644 index 9392a413fb1b..000000000000 --- a/owl-bot-staging/google-cloud-workflows-v1beta/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-workflows-v1beta/proto_docs/google/api/resource.rb b/owl-bot-staging/google-cloud-workflows-v1beta/proto_docs/google/api/resource.rb deleted file mode 100644 index 25dec4847ac1..000000000000 --- a/owl-bot-staging/google-cloud-workflows-v1beta/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-workflows-v1beta/proto_docs/google/cloud/workflows/v1beta/workflows.rb b/owl-bot-staging/google-cloud-workflows-v1beta/proto_docs/google/cloud/workflows/v1beta/workflows.rb deleted file mode 100644 index 51dd7e8cb940..000000000000 --- a/owl-bot-staging/google-cloud-workflows-v1beta/proto_docs/google/cloud/workflows/v1beta/workflows.rb +++ /dev/null @@ -1,245 +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 Workflows - module V1beta - # Workflow program to be executed by Workflows. - # @!attribute [rw] name - # @return [::String] - # The resource name of the workflow. - # Format: projects/\\{project}/locations/\\{location}/workflows/\\{workflow} - # @!attribute [rw] description - # @return [::String] - # Description of the workflow provided by the user. - # Must be at most 1000 unicode characters long. - # @!attribute [r] state - # @return [::Google::Cloud::Workflows::V1beta::Workflow::State] - # Output only. State of the workflow deployment. - # @!attribute [r] revision_id - # @return [::String] - # Output only. The revision of the workflow. - # A new revision of a workflow is created as a result of updating the - # following properties of a workflow: - # - # - {::Google::Cloud::Workflows::V1beta::Workflow#service_account Service account} - # - [Workflow code to be - # executed][google.cloud.workflows.v1beta.Workflow.source_contents] - # - # The format is "000001-a4d", where the first 6 characters define - # the zero-padded revision ordinal number. They are followed by a hyphen and - # 3 hexadecimal random characters. - # @!attribute [r] create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The timestamp of when the workflow was created. - # @!attribute [r] update_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The last update timestamp of the workflow. - # @!attribute [r] revision_create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The timestamp that the latest revision of the workflow - # was created. - # @!attribute [rw] labels - # @return [::Google::Protobuf::Map{::String => ::String}] - # Labels associated with this workflow. - # Labels can contain at most 64 entries. Keys and values can be no longer - # than 63 characters and can only contain lowercase letters, numeric - # characters, underscores and dashes. Label keys must start with a letter. - # International characters are allowed. - # @!attribute [rw] service_account - # @return [::String] - # The service account associated with the latest workflow version. - # This service account represents the identity of the workflow and determines - # what permissions the workflow has. - # Format: projects/\\{project}/serviceAccounts/\\{account} or \\{account} - # - # Using `-` as a wildcard for the `{project}` or not providing one at all - # will infer the project from the account. The `{account}` value can be the - # `email` address or the `unique_id` of the service account. - # - # If not provided, workflow will use the project's default service account. - # Modifying this field for an existing workflow results in a new workflow - # revision. - # @!attribute [rw] source_contents - # @return [::String] - # Workflow code to be executed. The size limit is 128KB. - class Workflow - 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 - - # Describes the current state of workflow deployment. More states may be - # added in the future. - module State - # Invalid state. - STATE_UNSPECIFIED = 0 - - # The workflow has been deployed successfully and is serving. - ACTIVE = 1 - end - end - - # Request for the - # {::Google::Cloud::Workflows::V1beta::Workflows::Client#list_workflows ListWorkflows} - # method. - # @!attribute [rw] parent - # @return [::String] - # Required. Project and location from which the workflows should be listed. - # Format: projects/\\{project}/locations/\\{location} - # @!attribute [rw] page_size - # @return [::Integer] - # Maximum number of workflows to return per call. The service may return - # fewer than this value. If the value is not specified, a default value of - # 500 will be used. The maximum permitted value is 1000 and values greater - # than 1000 will be coerced down to 1000. - # @!attribute [rw] page_token - # @return [::String] - # A page token, received from a previous `ListWorkflows` call. - # Provide this to retrieve the subsequent page. - # - # When paginating, all other parameters provided to `ListWorkflows` must - # match the call that provided the page token. - # @!attribute [rw] filter - # @return [::String] - # Filter to restrict results to specific workflows. - # @!attribute [rw] order_by - # @return [::String] - # Comma-separated list of fields that that specify the order of the results. - # Default sorting order for a field is ascending. To specify descending order - # for a field, append a " desc" suffix. - # If not specified, the results will be returned in an unspecified order. - class ListWorkflowsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response for the - # {::Google::Cloud::Workflows::V1beta::Workflows::Client#list_workflows ListWorkflows} - # method. - # @!attribute [rw] workflows - # @return [::Array<::Google::Cloud::Workflows::V1beta::Workflow>] - # The workflows which match the request. - # @!attribute [rw] next_page_token - # @return [::String] - # A token, which can be sent as `page_token` to retrieve the next page. - # If this field is omitted, there are no subsequent pages. - # @!attribute [rw] unreachable - # @return [::Array<::String>] - # Unreachable resources. - class ListWorkflowsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request for the - # {::Google::Cloud::Workflows::V1beta::Workflows::Client#get_workflow GetWorkflow} method. - # @!attribute [rw] name - # @return [::String] - # Required. Name of the workflow which information should be retrieved. - # Format: projects/\\{project}/locations/\\{location}/workflows/\\{workflow} - class GetWorkflowRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request for the - # {::Google::Cloud::Workflows::V1beta::Workflows::Client#create_workflow CreateWorkflow} - # method. - # @!attribute [rw] parent - # @return [::String] - # Required. Project and location in which the workflow should be created. - # Format: projects/\\{project}/locations/\\{location} - # @!attribute [rw] workflow - # @return [::Google::Cloud::Workflows::V1beta::Workflow] - # Required. Workflow to be created. - # @!attribute [rw] workflow_id - # @return [::String] - # Required. The ID of the workflow to be created. It has to fulfill the - # following requirements: - # - # * Must contain only letters, numbers, underscores and hyphens. - # * Must start with a letter. - # * Must be between 1-64 characters. - # * Must end with a number or a letter. - # * Must be unique within the customer project and location. - class CreateWorkflowRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request for the - # {::Google::Cloud::Workflows::V1beta::Workflows::Client#delete_workflow DeleteWorkflow} - # method. - # @!attribute [rw] name - # @return [::String] - # Required. Name of the workflow to be deleted. - # Format: projects/\\{project}/locations/\\{location}/workflows/\\{workflow} - class DeleteWorkflowRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request for the - # {::Google::Cloud::Workflows::V1beta::Workflows::Client#update_workflow UpdateWorkflow} - # method. - # @!attribute [rw] workflow - # @return [::Google::Cloud::Workflows::V1beta::Workflow] - # Required. Workflow to be updated. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # List of fields to be updated. If not present, the entire workflow - # will be updated. - class UpdateWorkflowRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Represents the metadata of the long-running operation. - # @!attribute [rw] create_time - # @return [::Google::Protobuf::Timestamp] - # The time the operation was created. - # @!attribute [rw] end_time - # @return [::Google::Protobuf::Timestamp] - # The time the operation finished running. - # @!attribute [rw] target - # @return [::String] - # Server-defined resource path for the target of the operation. - # @!attribute [rw] verb - # @return [::String] - # Name of the verb executed by the operation. - # @!attribute [rw] api_version - # @return [::String] - # API version used to start the operation. - class OperationMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-workflows-v1beta/proto_docs/google/longrunning/operations.rb b/owl-bot-staging/google-cloud-workflows-v1beta/proto_docs/google/longrunning/operations.rb deleted file mode 100644 index 7a757f512165..000000000000 --- a/owl-bot-staging/google-cloud-workflows-v1beta/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-workflows-v1beta/proto_docs/google/protobuf/any.rb b/owl-bot-staging/google-cloud-workflows-v1beta/proto_docs/google/protobuf/any.rb deleted file mode 100644 index 58691995f02e..000000000000 --- a/owl-bot-staging/google-cloud-workflows-v1beta/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-workflows-v1beta/proto_docs/google/protobuf/duration.rb b/owl-bot-staging/google-cloud-workflows-v1beta/proto_docs/google/protobuf/duration.rb deleted file mode 100644 index ea59f1f91daf..000000000000 --- a/owl-bot-staging/google-cloud-workflows-v1beta/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-workflows-v1beta/proto_docs/google/protobuf/empty.rb b/owl-bot-staging/google-cloud-workflows-v1beta/proto_docs/google/protobuf/empty.rb deleted file mode 100644 index 83e4481834a6..000000000000 --- a/owl-bot-staging/google-cloud-workflows-v1beta/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-workflows-v1beta/proto_docs/google/protobuf/field_mask.rb b/owl-bot-staging/google-cloud-workflows-v1beta/proto_docs/google/protobuf/field_mask.rb deleted file mode 100644 index 7f3ffc78601a..000000000000 --- a/owl-bot-staging/google-cloud-workflows-v1beta/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-workflows-v1beta/proto_docs/google/protobuf/timestamp.rb b/owl-bot-staging/google-cloud-workflows-v1beta/proto_docs/google/protobuf/timestamp.rb deleted file mode 100644 index 74352be9c58c..000000000000 --- a/owl-bot-staging/google-cloud-workflows-v1beta/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-workflows-v1beta/proto_docs/google/rpc/status.rb b/owl-bot-staging/google-cloud-workflows-v1beta/proto_docs/google/rpc/status.rb deleted file mode 100644 index c1a1c07eb2db..000000000000 --- a/owl-bot-staging/google-cloud-workflows-v1beta/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-workflows-v1beta/snippets/Gemfile b/owl-bot-staging/google-cloud-workflows-v1beta/snippets/Gemfile deleted file mode 100644 index 6d0b5707d9d1..000000000000 --- a/owl-bot-staging/google-cloud-workflows-v1beta/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-workflows-v1beta", path: "../" -else - gem "google-cloud-workflows-v1beta" -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-workflows-v1beta/snippets/snippet_metadata_google.cloud.workflows.v1beta.json b/owl-bot-staging/google-cloud-workflows-v1beta/snippets/snippet_metadata_google.cloud.workflows.v1beta.json deleted file mode 100644 index aa4ec480902e..000000000000 --- a/owl-bot-staging/google-cloud-workflows-v1beta/snippets/snippet_metadata_google.cloud.workflows.v1beta.json +++ /dev/null @@ -1,215 +0,0 @@ -{ - "client_library": { - "name": "google-cloud-workflows-v1beta", - "version": "", - "language": "RUBY", - "apis": [ - { - "id": "google.cloud.workflows.v1beta", - "version": "v1beta" - } - ] - }, - "snippets": [ - { - "region_tag": "workflows_v1beta_generated_Workflows_ListWorkflows_sync", - "title": "Snippet for the list_workflows call in the Workflows service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Workflows::V1beta::Workflows::Client#list_workflows.", - "file": "workflows/list_workflows.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_workflows", - "full_name": "::Google::Cloud::Workflows::V1beta::Workflows::Client#list_workflows", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Workflows::V1beta::ListWorkflowsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Workflows::V1beta::ListWorkflowsResponse", - "client": { - "short_name": "Workflows::Client", - "full_name": "::Google::Cloud::Workflows::V1beta::Workflows::Client" - }, - "method": { - "short_name": "ListWorkflows", - "full_name": "google.cloud.workflows.v1beta.Workflows.ListWorkflows", - "service": { - "short_name": "Workflows", - "full_name": "google.cloud.workflows.v1beta.Workflows" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "workflows_v1beta_generated_Workflows_GetWorkflow_sync", - "title": "Snippet for the get_workflow call in the Workflows service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Workflows::V1beta::Workflows::Client#get_workflow.", - "file": "workflows/get_workflow.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_workflow", - "full_name": "::Google::Cloud::Workflows::V1beta::Workflows::Client#get_workflow", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Workflows::V1beta::GetWorkflowRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Workflows::V1beta::Workflow", - "client": { - "short_name": "Workflows::Client", - "full_name": "::Google::Cloud::Workflows::V1beta::Workflows::Client" - }, - "method": { - "short_name": "GetWorkflow", - "full_name": "google.cloud.workflows.v1beta.Workflows.GetWorkflow", - "service": { - "short_name": "Workflows", - "full_name": "google.cloud.workflows.v1beta.Workflows" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "workflows_v1beta_generated_Workflows_CreateWorkflow_sync", - "title": "Snippet for the create_workflow call in the Workflows service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Workflows::V1beta::Workflows::Client#create_workflow.", - "file": "workflows/create_workflow.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_workflow", - "full_name": "::Google::Cloud::Workflows::V1beta::Workflows::Client#create_workflow", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Workflows::V1beta::CreateWorkflowRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "Workflows::Client", - "full_name": "::Google::Cloud::Workflows::V1beta::Workflows::Client" - }, - "method": { - "short_name": "CreateWorkflow", - "full_name": "google.cloud.workflows.v1beta.Workflows.CreateWorkflow", - "service": { - "short_name": "Workflows", - "full_name": "google.cloud.workflows.v1beta.Workflows" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "workflows_v1beta_generated_Workflows_DeleteWorkflow_sync", - "title": "Snippet for the delete_workflow call in the Workflows service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Workflows::V1beta::Workflows::Client#delete_workflow.", - "file": "workflows/delete_workflow.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_workflow", - "full_name": "::Google::Cloud::Workflows::V1beta::Workflows::Client#delete_workflow", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Workflows::V1beta::DeleteWorkflowRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "Workflows::Client", - "full_name": "::Google::Cloud::Workflows::V1beta::Workflows::Client" - }, - "method": { - "short_name": "DeleteWorkflow", - "full_name": "google.cloud.workflows.v1beta.Workflows.DeleteWorkflow", - "service": { - "short_name": "Workflows", - "full_name": "google.cloud.workflows.v1beta.Workflows" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "workflows_v1beta_generated_Workflows_UpdateWorkflow_sync", - "title": "Snippet for the update_workflow call in the Workflows service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Workflows::V1beta::Workflows::Client#update_workflow.", - "file": "workflows/update_workflow.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_workflow", - "full_name": "::Google::Cloud::Workflows::V1beta::Workflows::Client#update_workflow", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Workflows::V1beta::UpdateWorkflowRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "Workflows::Client", - "full_name": "::Google::Cloud::Workflows::V1beta::Workflows::Client" - }, - "method": { - "short_name": "UpdateWorkflow", - "full_name": "google.cloud.workflows.v1beta.Workflows.UpdateWorkflow", - "service": { - "short_name": "Workflows", - "full_name": "google.cloud.workflows.v1beta.Workflows" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - } - ] -} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-workflows-v1beta/snippets/workflows/create_workflow.rb b/owl-bot-staging/google-cloud-workflows-v1beta/snippets/workflows/create_workflow.rb deleted file mode 100644 index 8b8c1e929159..000000000000 --- a/owl-bot-staging/google-cloud-workflows-v1beta/snippets/workflows/create_workflow.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 workflows_v1beta_generated_Workflows_CreateWorkflow_sync] -require "google/cloud/workflows/v1beta" - -## -# Snippet for the create_workflow call in the Workflows 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::Workflows::V1beta::Workflows::Client#create_workflow. -# -def create_workflow - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Workflows::V1beta::Workflows::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Workflows::V1beta::CreateWorkflowRequest.new - - # Call the create_workflow method. - result = client.create_workflow 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 workflows_v1beta_generated_Workflows_CreateWorkflow_sync] diff --git a/owl-bot-staging/google-cloud-workflows-v1beta/snippets/workflows/delete_workflow.rb b/owl-bot-staging/google-cloud-workflows-v1beta/snippets/workflows/delete_workflow.rb deleted file mode 100644 index 95eaf09e0e6f..000000000000 --- a/owl-bot-staging/google-cloud-workflows-v1beta/snippets/workflows/delete_workflow.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 workflows_v1beta_generated_Workflows_DeleteWorkflow_sync] -require "google/cloud/workflows/v1beta" - -## -# Snippet for the delete_workflow call in the Workflows 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::Workflows::V1beta::Workflows::Client#delete_workflow. -# -def delete_workflow - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Workflows::V1beta::Workflows::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Workflows::V1beta::DeleteWorkflowRequest.new - - # Call the delete_workflow method. - result = client.delete_workflow 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 workflows_v1beta_generated_Workflows_DeleteWorkflow_sync] diff --git a/owl-bot-staging/google-cloud-workflows-v1beta/snippets/workflows/get_workflow.rb b/owl-bot-staging/google-cloud-workflows-v1beta/snippets/workflows/get_workflow.rb deleted file mode 100644 index 8d629d661011..000000000000 --- a/owl-bot-staging/google-cloud-workflows-v1beta/snippets/workflows/get_workflow.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 workflows_v1beta_generated_Workflows_GetWorkflow_sync] -require "google/cloud/workflows/v1beta" - -## -# Snippet for the get_workflow call in the Workflows 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::Workflows::V1beta::Workflows::Client#get_workflow. -# -def get_workflow - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Workflows::V1beta::Workflows::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Workflows::V1beta::GetWorkflowRequest.new - - # Call the get_workflow method. - result = client.get_workflow request - - # The returned object is of type Google::Cloud::Workflows::V1beta::Workflow. - p result -end -# [END workflows_v1beta_generated_Workflows_GetWorkflow_sync] diff --git a/owl-bot-staging/google-cloud-workflows-v1beta/snippets/workflows/list_workflows.rb b/owl-bot-staging/google-cloud-workflows-v1beta/snippets/workflows/list_workflows.rb deleted file mode 100644 index 0ed09a7616d6..000000000000 --- a/owl-bot-staging/google-cloud-workflows-v1beta/snippets/workflows/list_workflows.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 workflows_v1beta_generated_Workflows_ListWorkflows_sync] -require "google/cloud/workflows/v1beta" - -## -# Snippet for the list_workflows call in the Workflows 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::Workflows::V1beta::Workflows::Client#list_workflows. -# -def list_workflows - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Workflows::V1beta::Workflows::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Workflows::V1beta::ListWorkflowsRequest.new - - # Call the list_workflows method. - result = client.list_workflows 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::Workflows::V1beta::Workflow. - p item - end -end -# [END workflows_v1beta_generated_Workflows_ListWorkflows_sync] diff --git a/owl-bot-staging/google-cloud-workflows-v1beta/snippets/workflows/update_workflow.rb b/owl-bot-staging/google-cloud-workflows-v1beta/snippets/workflows/update_workflow.rb deleted file mode 100644 index bab5a8ac4c65..000000000000 --- a/owl-bot-staging/google-cloud-workflows-v1beta/snippets/workflows/update_workflow.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 workflows_v1beta_generated_Workflows_UpdateWorkflow_sync] -require "google/cloud/workflows/v1beta" - -## -# Snippet for the update_workflow call in the Workflows 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::Workflows::V1beta::Workflows::Client#update_workflow. -# -def update_workflow - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Workflows::V1beta::Workflows::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Workflows::V1beta::UpdateWorkflowRequest.new - - # Call the update_workflow method. - result = client.update_workflow 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 workflows_v1beta_generated_Workflows_UpdateWorkflow_sync] diff --git a/owl-bot-staging/google-cloud-workflows-v1beta/test/google/cloud/workflows/v1beta/workflows_operations_test.rb b/owl-bot-staging/google-cloud-workflows-v1beta/test/google/cloud/workflows/v1beta/workflows_operations_test.rb deleted file mode 100644 index 7056811966a4..000000000000 --- a/owl-bot-staging/google-cloud-workflows-v1beta/test/google/cloud/workflows/v1beta/workflows_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/workflows/v1beta/workflows_pb" -require "google/cloud/workflows/v1beta/workflows_services_pb" -require "google/cloud/workflows/v1beta/workflows" - -class ::Google::Cloud::Workflows::V1beta::Workflows::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::Workflows::V1beta::Workflows::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::Workflows::V1beta::Workflows::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::Workflows::V1beta::Workflows::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::Workflows::V1beta::Workflows::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::Workflows::V1beta::Workflows::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::Workflows::V1beta::Workflows::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::Workflows::V1beta::Workflows::Operations::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-workflows-v1beta/test/google/cloud/workflows/v1beta/workflows_paths_test.rb b/owl-bot-staging/google-cloud-workflows-v1beta/test/google/cloud/workflows/v1beta/workflows_paths_test.rb deleted file mode 100644 index 79297ed7cc4c..000000000000 --- a/owl-bot-staging/google-cloud-workflows-v1beta/test/google/cloud/workflows/v1beta/workflows_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/workflows/v1beta/workflows" - -class ::Google::Cloud::Workflows::V1beta::Workflows::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::Workflows::V1beta::Workflows::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_workflow_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Workflows::V1beta::Workflows::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.workflow_path project: "value0", location: "value1", workflow: "value2" - assert_equal "projects/value0/locations/value1/workflows/value2", path - end - end -end diff --git a/owl-bot-staging/google-cloud-workflows-v1beta/test/google/cloud/workflows/v1beta/workflows_rest_test.rb b/owl-bot-staging/google-cloud-workflows-v1beta/test/google/cloud/workflows/v1beta/workflows_rest_test.rb deleted file mode 100644 index b88805f29aeb..000000000000 --- a/owl-bot-staging/google-cloud-workflows-v1beta/test/google/cloud/workflows/v1beta/workflows_rest_test.rb +++ /dev/null @@ -1,376 +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/workflows/v1beta/workflows_pb" -require "google/cloud/workflows/v1beta/workflows/rest" - - -class ::Google::Cloud::Workflows::V1beta::Workflows::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_workflows - # Create test objects. - client_result = ::Google::Cloud::Workflows::V1beta::ListWorkflowsResponse.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_workflows_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::Workflows::V1beta::Workflows::Rest::ServiceStub.stub :transcode_list_workflows_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_workflows_client_stub do - # Create client - client = ::Google::Cloud::Workflows::V1beta::Workflows::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_workflows({ 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_workflows 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_workflows ::Google::Cloud::Workflows::V1beta::ListWorkflowsRequest.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_workflows({ 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_workflows(::Google::Cloud::Workflows::V1beta::ListWorkflowsRequest.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_workflows_client_stub.call_count - end - end - end - - def test_get_workflow - # Create test objects. - client_result = ::Google::Cloud::Workflows::V1beta::Workflow.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_workflow_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::Workflows::V1beta::Workflows::Rest::ServiceStub.stub :transcode_get_workflow_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_workflow_client_stub do - # Create client - client = ::Google::Cloud::Workflows::V1beta::Workflows::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_workflow({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_workflow name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_workflow ::Google::Cloud::Workflows::V1beta::GetWorkflowRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_workflow({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_workflow(::Google::Cloud::Workflows::V1beta::GetWorkflowRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_workflow_client_stub.call_count - end - end - end - - def test_create_workflow - # 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" - workflow = {} - workflow_id = "hello world" - - create_workflow_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::Workflows::V1beta::Workflows::Rest::ServiceStub.stub :transcode_create_workflow_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_workflow_client_stub do - # Create client - client = ::Google::Cloud::Workflows::V1beta::Workflows::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_workflow({ parent: parent, workflow: workflow, workflow_id: workflow_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_workflow parent: parent, workflow: workflow, workflow_id: workflow_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_workflow ::Google::Cloud::Workflows::V1beta::CreateWorkflowRequest.new(parent: parent, workflow: workflow, workflow_id: workflow_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_workflow({ parent: parent, workflow: workflow, workflow_id: workflow_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_workflow(::Google::Cloud::Workflows::V1beta::CreateWorkflowRequest.new(parent: parent, workflow: workflow, workflow_id: workflow_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_workflow_client_stub.call_count - end - end - end - - def test_delete_workflow - # 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_workflow_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::Workflows::V1beta::Workflows::Rest::ServiceStub.stub :transcode_delete_workflow_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_workflow_client_stub do - # Create client - client = ::Google::Cloud::Workflows::V1beta::Workflows::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.delete_workflow({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.delete_workflow name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.delete_workflow ::Google::Cloud::Workflows::V1beta::DeleteWorkflowRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.delete_workflow({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.delete_workflow(::Google::Cloud::Workflows::V1beta::DeleteWorkflowRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, delete_workflow_client_stub.call_count - end - end - end - - def test_update_workflow - # 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. - workflow = {} - update_mask = {} - - update_workflow_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::Workflows::V1beta::Workflows::Rest::ServiceStub.stub :transcode_update_workflow_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_workflow_client_stub do - # Create client - client = ::Google::Cloud::Workflows::V1beta::Workflows::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.update_workflow({ workflow: workflow, update_mask: update_mask }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.update_workflow workflow: workflow, update_mask: update_mask do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.update_workflow ::Google::Cloud::Workflows::V1beta::UpdateWorkflowRequest.new(workflow: workflow, update_mask: update_mask) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.update_workflow({ workflow: workflow, update_mask: update_mask }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.update_workflow(::Google::Cloud::Workflows::V1beta::UpdateWorkflowRequest.new(workflow: workflow, update_mask: update_mask), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, update_workflow_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::Workflows::V1beta::Workflows::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::Workflows::V1beta::Workflows::Rest::Client::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-workflows-v1beta/test/google/cloud/workflows/v1beta/workflows_test.rb b/owl-bot-staging/google-cloud-workflows-v1beta/test/google/cloud/workflows/v1beta/workflows_test.rb deleted file mode 100644 index b92f9a575774..000000000000 --- a/owl-bot-staging/google-cloud-workflows-v1beta/test/google/cloud/workflows/v1beta/workflows_test.rb +++ /dev/null @@ -1,442 +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/workflows/v1beta/workflows_pb" -require "google/cloud/workflows/v1beta/workflows" - -class ::Google::Cloud::Workflows::V1beta::Workflows::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_workflows - # Create GRPC objects. - grpc_response = ::Google::Cloud::Workflows::V1beta::ListWorkflowsResponse.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_workflows_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_workflows, name - assert_kind_of ::Google::Cloud::Workflows::V1beta::ListWorkflowsRequest, 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_workflows_client_stub do - # Create client - client = ::Google::Cloud::Workflows::V1beta::Workflows::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_workflows({ 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_workflows 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_workflows ::Google::Cloud::Workflows::V1beta::ListWorkflowsRequest.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_workflows({ 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_workflows(::Google::Cloud::Workflows::V1beta::ListWorkflowsRequest.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_workflows_client_stub.call_rpc_count - end - end - - def test_get_workflow - # Create GRPC objects. - grpc_response = ::Google::Cloud::Workflows::V1beta::Workflow.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_workflow_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_workflow, name - assert_kind_of ::Google::Cloud::Workflows::V1beta::GetWorkflowRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_workflow_client_stub do - # Create client - client = ::Google::Cloud::Workflows::V1beta::Workflows::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_workflow({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_workflow name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_workflow ::Google::Cloud::Workflows::V1beta::GetWorkflowRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_workflow({ 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_workflow(::Google::Cloud::Workflows::V1beta::GetWorkflowRequest.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_workflow_client_stub.call_rpc_count - end - end - - def test_create_workflow - # 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" - workflow = {} - workflow_id = "hello world" - - create_workflow_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_workflow, name - assert_kind_of ::Google::Cloud::Workflows::V1beta::CreateWorkflowRequest, request - assert_equal "hello world", request["parent"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Workflows::V1beta::Workflow), request["workflow"] - assert_equal "hello world", request["workflow_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_workflow_client_stub do - # Create client - client = ::Google::Cloud::Workflows::V1beta::Workflows::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_workflow({ parent: parent, workflow: workflow, workflow_id: workflow_id }) 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_workflow parent: parent, workflow: workflow, workflow_id: workflow_id 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_workflow ::Google::Cloud::Workflows::V1beta::CreateWorkflowRequest.new(parent: parent, workflow: workflow, workflow_id: workflow_id) 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_workflow({ parent: parent, workflow: workflow, workflow_id: workflow_id }, 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_workflow(::Google::Cloud::Workflows::V1beta::CreateWorkflowRequest.new(parent: parent, workflow: workflow, workflow_id: workflow_id), 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_workflow_client_stub.call_rpc_count - end - end - - def test_delete_workflow - # 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_workflow_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_workflow, name - assert_kind_of ::Google::Cloud::Workflows::V1beta::DeleteWorkflowRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_workflow_client_stub do - # Create client - client = ::Google::Cloud::Workflows::V1beta::Workflows::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_workflow({ 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_workflow 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_workflow ::Google::Cloud::Workflows::V1beta::DeleteWorkflowRequest.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_workflow({ 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_workflow(::Google::Cloud::Workflows::V1beta::DeleteWorkflowRequest.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_workflow_client_stub.call_rpc_count - end - end - - def test_update_workflow - # 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. - workflow = {} - update_mask = {} - - update_workflow_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_workflow, name - assert_kind_of ::Google::Cloud::Workflows::V1beta::UpdateWorkflowRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Workflows::V1beta::Workflow), request["workflow"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_workflow_client_stub do - # Create client - client = ::Google::Cloud::Workflows::V1beta::Workflows::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_workflow({ workflow: workflow, update_mask: update_mask }) 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.update_workflow workflow: workflow, update_mask: update_mask 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.update_workflow ::Google::Cloud::Workflows::V1beta::UpdateWorkflowRequest.new(workflow: workflow, update_mask: update_mask) 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.update_workflow({ workflow: workflow, update_mask: update_mask }, 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.update_workflow(::Google::Cloud::Workflows::V1beta::UpdateWorkflowRequest.new(workflow: workflow, update_mask: update_mask), 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, update_workflow_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::Workflows::V1beta::Workflows::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::Workflows::V1beta::Workflows::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::Workflows::V1beta::Workflows::Client.new do |config| - config.credentials = creds - end - assert_kind_of ::Google::Cloud::Workflows::V1beta::Workflows::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::Workflows::V1beta::Workflows::Client.new do |config| - config.credentials = grpc_channel - end - end - - assert_kind_of ::Google::Cloud::Workflows::V1beta::Workflows::Operations, client.operations_client - end -end diff --git a/owl-bot-staging/google-cloud-workflows-v1beta/test/helper.rb b/owl-bot-staging/google-cloud-workflows-v1beta/test/helper.rb deleted file mode 100644 index 672b337030e7..000000000000 --- a/owl-bot-staging/google-cloud-workflows-v1beta/test/helper.rb +++ /dev/null @@ -1,26 +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/mock" -require "minitest/rg" - -require "grpc" - -require "ostruct" diff --git a/owl-bot-staging/google-cloud-workstations-v1/.gitignore b/owl-bot-staging/google-cloud-workstations-v1/.gitignore deleted file mode 100644 index 0135b6bc6cfc..000000000000 --- a/owl-bot-staging/google-cloud-workstations-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-workstations-v1/.repo-metadata.json b/owl-bot-staging/google-cloud-workstations-v1/.repo-metadata.json deleted file mode 100644 index 45c35fe5368d..000000000000 --- a/owl-bot-staging/google-cloud-workstations-v1/.repo-metadata.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "api_id": "workstations.googleapis.com", - "api_shortname": "workstations", - "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-workstations-v1/latest", - "distribution_name": "google-cloud-workstations-v1", - "is_cloud": true, - "language": "ruby", - "name": "workstations", - "name_pretty": "Cloud Workstations V1 API", - "product_documentation": "https://cloud.google.com/workstations/docs", - "release_level": "unreleased", - "repo": "googleapis/google-cloud-ruby", - "requires_billing": true, - "ruby-cloud-description": "Allows administrators to create managed developer environments in the cloud. Note that google-cloud-workstations-v1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-workstations instead. See the readme for more details.", - "ruby-cloud-product-url": "https://cloud.google.com/workstations/docs", - "library_type": "GAPIC_AUTO" -} diff --git a/owl-bot-staging/google-cloud-workstations-v1/.rubocop.yml b/owl-bot-staging/google-cloud-workstations-v1/.rubocop.yml deleted file mode 100644 index a44551c617b3..000000000000 --- a/owl-bot-staging/google-cloud-workstations-v1/.rubocop.yml +++ /dev/null @@ -1,33 +0,0 @@ -inherit_gem: - google-style: google-style.yml - -AllCops: - Exclude: - - "google-cloud-workstations-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-workstations-v1.rb" diff --git a/owl-bot-staging/google-cloud-workstations-v1/.toys.rb b/owl-bot-staging/google-cloud-workstations-v1/.toys.rb deleted file mode 100644 index 177e22456e8a..000000000000 --- a/owl-bot-staging/google-cloud-workstations-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-workstations-v1/.yardopts b/owl-bot-staging/google-cloud-workstations-v1/.yardopts deleted file mode 100644 index 2d5ddbfd78ca..000000000000 --- a/owl-bot-staging/google-cloud-workstations-v1/.yardopts +++ /dev/null @@ -1,12 +0,0 @@ ---no-private ---title="Cloud Workstations 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-workstations-v1/AUTHENTICATION.md b/owl-bot-staging/google-cloud-workstations-v1/AUTHENTICATION.md deleted file mode 100644 index f69ad9397007..000000000000 --- a/owl-bot-staging/google-cloud-workstations-v1/AUTHENTICATION.md +++ /dev/null @@ -1,122 +0,0 @@ -# Authentication - -The recommended way to authenticate to the google-cloud-workstations-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-workstations-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/workstations/v1" - -client = ::Google::Cloud::Workstations::V1::Workstations::Client.new do |config| - config.credentials = "path/to/credentialfile.json" -end -``` - -To configure a credentials file globally for all clients: - -```ruby -require "google/cloud/workstations/v1" - -::Google::Cloud::Workstations::V1::Workstations::Client.configure do |config| - config.credentials = "path/to/credentialfile.json" -end - -client = ::Google::Cloud::Workstations::V1::Workstations::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-workstations-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/workstations/v1" - -ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" - -client = ::Google::Cloud::Workstations::V1::Workstations::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-workstations-v1/CHANGELOG.md b/owl-bot-staging/google-cloud-workstations-v1/CHANGELOG.md deleted file mode 100644 index f88957a62ba2..000000000000 --- a/owl-bot-staging/google-cloud-workstations-v1/CHANGELOG.md +++ /dev/null @@ -1,2 +0,0 @@ -# Release History - diff --git a/owl-bot-staging/google-cloud-workstations-v1/Gemfile b/owl-bot-staging/google-cloud-workstations-v1/Gemfile deleted file mode 100644 index 1d08558908d8..000000000000 --- a/owl-bot-staging/google-cloud-workstations-v1/Gemfile +++ /dev/null @@ -1,14 +0,0 @@ -source "https://rubygems.org" - -gemspec - -gem "google-style", "~> 1.32.0" -gem "irb", "~> 1.17" -gem "minitest", "~> 6.0.2" -gem "minitest-focus", "~> 1.4" -gem "minitest-mock", "~> 5.27" -gem "minitest-rg", "~> 5.3" -gem "ostruct", "~> 0.5.5" -gem "rake", ">= 13.0" -gem "redcarpet", "~> 3.6" -gem "yard", "~> 0.9" diff --git a/owl-bot-staging/google-cloud-workstations-v1/LICENSE.md b/owl-bot-staging/google-cloud-workstations-v1/LICENSE.md deleted file mode 100644 index c261857ba6ad..000000000000 --- a/owl-bot-staging/google-cloud-workstations-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-workstations-v1/README.md b/owl-bot-staging/google-cloud-workstations-v1/README.md deleted file mode 100644 index a82b29f2a4e7..000000000000 --- a/owl-bot-staging/google-cloud-workstations-v1/README.md +++ /dev/null @@ -1,153 +0,0 @@ -# Ruby Client for the Cloud Workstations V1 API - -Allows administrators to create managed developer environments in the cloud. - - -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 Workstations V1 API. Most users should consider using -the main client gem, -[google-cloud-workstations](https://rubygems.org/gems/google-cloud-workstations). -See the section below titled *Which client should I use?* for more information. - -## Installation - -``` -$ gem install google-cloud-workstations-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/workstations.googleapis.com) -1. [Set up authentication.](AUTHENTICATION.md) - -## Quick Start - -```ruby -require "google/cloud/workstations/v1" - -client = ::Google::Cloud::Workstations::V1::Workstations::Client.new -request = ::Google::Cloud::Workstations::V1::GetWorkstationClusterRequest.new # (request fields as keyword arguments...) -response = client.get_workstation_cluster request -``` - -View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-workstations-v1/latest) -for class and method documentation. - -See also the [Product Documentation](https://cloud.google.com/workstations/docs) -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/workstations/v1" -require "logger" - -client = ::Google::Cloud::Workstations::V1::Workstations::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-workstations`, -and lower-level _versioned_ client libraries with names such as -`google-cloud-workstations-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-workstations`. -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-workstations-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-workstations-v1/Rakefile b/owl-bot-staging/google-cloud-workstations-v1/Rakefile deleted file mode 100644 index 2d6588091b1a..000000000000 --- a/owl-bot-staging/google-cloud-workstations-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-workstations-v1 acceptance tests." -task :acceptance, :project, :keyfile do |t, args| - project = args[:project] - project ||= - ENV["GOOGLE_CLOUD_TEST_PROJECT"] || - ENV["GCLOUD_TEST_PROJECT"] - keyfile = args[:keyfile] - keyfile ||= - ENV["GOOGLE_CLOUD_TEST_KEYFILE"] || - ENV["GCLOUD_TEST_KEYFILE"] - if keyfile - keyfile = File.read keyfile - else - keyfile ||= - ENV["GOOGLE_CLOUD_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 GOOGLE_CLOUD_TEST_PROJECT=test123 GOOGLE_CLOUD_TEST_KEYFILE=/path/to/keyfile.json rake acceptance" - end - require "google/cloud/workstations/v1/workstations/credentials" - ::Google::Cloud::Workstations::V1::Workstations::Credentials.env_vars.each do |path| - ENV[path] = nil - end - ENV["GOOGLE_CLOUD_PROJECT"] = project - ENV["GOOGLE_CLOUD_TEST_PROJECT"] = project - ENV["GOOGLE_CLOUD_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-workstations-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-workstations-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-workstations-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-workstations-v1 gem does not have doctest tests." -end - -desc "Run the CI build" -task :ci do - header "BUILDING google-cloud-workstations-v1" - header "google-cloud-workstations-v1 rubocop", "*" - Rake::Task[:rubocop].invoke - header "google-cloud-workstations-v1 yard", "*" - Rake::Task[:yard].invoke - header "google-cloud-workstations-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-workstations-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-workstations-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-workstations-v1/gapic_metadata.json b/owl-bot-staging/google-cloud-workstations-v1/gapic_metadata.json deleted file mode 100644 index 27954dcb3a8f..000000000000 --- a/owl-bot-staging/google-cloud-workstations-v1/gapic_metadata.json +++ /dev/null @@ -1,118 +0,0 @@ -{ - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", - "language": "ruby", - "protoPackage": "google.cloud.workstations.v1", - "libraryPackage": "::Google::Cloud::Workstations::V1", - "services": { - "Workstations": { - "clients": { - "grpc": { - "libraryClient": "::Google::Cloud::Workstations::V1::Workstations::Client", - "rpcs": { - "GetWorkstationCluster": { - "methods": [ - "get_workstation_cluster" - ] - }, - "ListWorkstationClusters": { - "methods": [ - "list_workstation_clusters" - ] - }, - "CreateWorkstationCluster": { - "methods": [ - "create_workstation_cluster" - ] - }, - "UpdateWorkstationCluster": { - "methods": [ - "update_workstation_cluster" - ] - }, - "DeleteWorkstationCluster": { - "methods": [ - "delete_workstation_cluster" - ] - }, - "GetWorkstationConfig": { - "methods": [ - "get_workstation_config" - ] - }, - "ListWorkstationConfigs": { - "methods": [ - "list_workstation_configs" - ] - }, - "ListUsableWorkstationConfigs": { - "methods": [ - "list_usable_workstation_configs" - ] - }, - "CreateWorkstationConfig": { - "methods": [ - "create_workstation_config" - ] - }, - "UpdateWorkstationConfig": { - "methods": [ - "update_workstation_config" - ] - }, - "DeleteWorkstationConfig": { - "methods": [ - "delete_workstation_config" - ] - }, - "GetWorkstation": { - "methods": [ - "get_workstation" - ] - }, - "ListWorkstations": { - "methods": [ - "list_workstations" - ] - }, - "ListUsableWorkstations": { - "methods": [ - "list_usable_workstations" - ] - }, - "CreateWorkstation": { - "methods": [ - "create_workstation" - ] - }, - "UpdateWorkstation": { - "methods": [ - "update_workstation" - ] - }, - "DeleteWorkstation": { - "methods": [ - "delete_workstation" - ] - }, - "StartWorkstation": { - "methods": [ - "start_workstation" - ] - }, - "StopWorkstation": { - "methods": [ - "stop_workstation" - ] - }, - "GenerateAccessToken": { - "methods": [ - "generate_access_token" - ] - } - } - } - } - } - } -} diff --git a/owl-bot-staging/google-cloud-workstations-v1/google-cloud-workstations-v1.gemspec b/owl-bot-staging/google-cloud-workstations-v1/google-cloud-workstations-v1.gemspec deleted file mode 100644 index d1e85aa74e8d..000000000000 --- a/owl-bot-staging/google-cloud-workstations-v1/google-cloud-workstations-v1.gemspec +++ /dev/null @@ -1,30 +0,0 @@ -# -*- ruby -*- -# encoding: utf-8 - -require File.expand_path("lib/google/cloud/workstations/v1/version", __dir__) - -Gem::Specification.new do |gem| - gem.name = "google-cloud-workstations-v1" - gem.version = Google::Cloud::Workstations::V1::VERSION - - gem.authors = ["Google LLC"] - gem.email = "googleapis-packages@google.com" - gem.description = "Allows administrators to create managed developer environments in the cloud. Note that google-cloud-workstations-v1 is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-workstations instead. See the readme for more details." - gem.summary = "Allows administrators to create managed developer environments in the cloud." - 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.2" - - 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-workstations-v1/lib/google-cloud-workstations-v1.rb b/owl-bot-staging/google-cloud-workstations-v1/lib/google-cloud-workstations-v1.rb deleted file mode 100644 index 5432da78d5cb..000000000000 --- a/owl-bot-staging/google-cloud-workstations-v1/lib/google-cloud-workstations-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/workstations/v1" diff --git a/owl-bot-staging/google-cloud-workstations-v1/lib/google/cloud/workstations/v1.rb b/owl-bot-staging/google-cloud-workstations-v1/lib/google/cloud/workstations/v1.rb deleted file mode 100644 index 33d0c263a9f4..000000000000 --- a/owl-bot-staging/google-cloud-workstations-v1/lib/google/cloud/workstations/v1.rb +++ /dev/null @@ -1,45 +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/workstations/v1/workstations" -require "google/cloud/workstations/v1/version" - -module Google - module Cloud - module Workstations - ## - # API client module. - # - # @example Load this package, including all its services, and instantiate a gRPC client - # - # require "google/cloud/workstations/v1" - # client = ::Google::Cloud::Workstations::V1::Workstations::Client.new - # - # @example Load this package, including all its services, and instantiate a REST client - # - # require "google/cloud/workstations/v1" - # client = ::Google::Cloud::Workstations::V1::Workstations::Rest::Client.new - # - module V1 - end - end - end -end - -helper_path = ::File.join __dir__, "v1", "_helpers.rb" -require "google/cloud/workstations/v1/_helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-workstations-v1/lib/google/cloud/workstations/v1/bindings_override.rb b/owl-bot-staging/google-cloud-workstations-v1/lib/google/cloud/workstations/v1/bindings_override.rb deleted file mode 100644 index 4e045e2c88f2..000000000000 --- a/owl-bot-staging/google-cloud-workstations-v1/lib/google/cloud/workstations/v1/bindings_override.rb +++ /dev/null @@ -1,110 +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 Workstations - ## - # @example Loading just the REST part of this package, including all its services, and instantiating a REST client - # - # require "google/cloud/workstations/v1/rest" - # client = ::Google::Cloud::Workstations::V1::Workstations::Rest::Client.new - # - module V1 - ## - # @private - # Initialize the mixin bindings configuration - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "Workstations"] - 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.iam.v1.IAMPolicy.GetIamPolicy"] = [ - Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( - uri_method: :get, - uri_template: "/v1/{resource}:getIamPolicy", - matches: [ - ["resource", %r{^projects/[^/]+/locations/[^/]+/workstationClusters/[^/]+/workstationConfigs/[^/]+/?$}, false] - ], - body: nil - ), - Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( - uri_method: :get, - uri_template: "/v1/{resource}:getIamPolicy", - matches: [ - ["resource", %r{^projects/[^/]+/locations/[^/]+/workstationClusters/[^/]+/workstationConfigs/[^/]+/workstations/[^/]+/?$}, 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/[^/]+/workstationClusters/[^/]+/workstationConfigs/[^/]+/?$}, false] - ], - body: "*" - ), - Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( - uri_method: :post, - uri_template: "/v1/{resource}:setIamPolicy", - matches: [ - ["resource", %r{^projects/[^/]+/locations/[^/]+/workstationClusters/[^/]+/workstationConfigs/[^/]+/workstations/[^/]+/?$}, 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/[^/]+/workstationClusters/[^/]+/workstationConfigs/[^/]+/?$}, false] - ], - body: "*" - ), - Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( - uri_method: :post, - uri_template: "/v1/{resource}:testIamPermissions", - matches: [ - ["resource", %r{^projects/[^/]+/locations/[^/]+/workstationClusters/[^/]+/workstationConfigs/[^/]+/workstations/[^/]+/?$}, false] - ], - body: "*" - ) - ] - default_config - end - yield @configure if block_given? - @configure - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-workstations-v1/lib/google/cloud/workstations/v1/rest.rb b/owl-bot-staging/google-cloud-workstations-v1/lib/google/cloud/workstations/v1/rest.rb deleted file mode 100644 index 4a1cec95dcc9..000000000000 --- a/owl-bot-staging/google-cloud-workstations-v1/lib/google/cloud/workstations/v1/rest.rb +++ /dev/null @@ -1,38 +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/workstations/v1/workstations/rest" -require "google/cloud/workstations/v1/bindings_override" -require "google/cloud/workstations/v1/version" - -module Google - module Cloud - module Workstations - ## - # To load just the REST part of this package, including all its services, and instantiate a REST client: - # - # @example - # - # require "google/cloud/workstations/v1/rest" - # client = ::Google::Cloud::Workstations::V1::Workstations::Rest::Client.new - # - module V1 - end - end - end -end diff --git a/owl-bot-staging/google-cloud-workstations-v1/lib/google/cloud/workstations/v1/version.rb b/owl-bot-staging/google-cloud-workstations-v1/lib/google/cloud/workstations/v1/version.rb deleted file mode 100644 index fda56f15b199..000000000000 --- a/owl-bot-staging/google-cloud-workstations-v1/lib/google/cloud/workstations/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 Workstations - module V1 - VERSION = "0.0.1" - end - end - end -end diff --git a/owl-bot-staging/google-cloud-workstations-v1/lib/google/cloud/workstations/v1/workstations.rb b/owl-bot-staging/google-cloud-workstations-v1/lib/google/cloud/workstations/v1/workstations.rb deleted file mode 100644 index 08a4bda4af66..000000000000 --- a/owl-bot-staging/google-cloud-workstations-v1/lib/google/cloud/workstations/v1/workstations.rb +++ /dev/null @@ -1,56 +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/workstations/v1/version" - -require "google/cloud/workstations/v1/workstations/credentials" -require "google/cloud/workstations/v1/workstations/paths" -require "google/cloud/workstations/v1/workstations/operations" -require "google/cloud/workstations/v1/workstations/client" -require "google/cloud/workstations/v1/workstations/rest" - -module Google - module Cloud - module Workstations - module V1 - ## - # Service for interacting with Cloud Workstations. - # - # @example Load this service and instantiate a gRPC client - # - # require "google/cloud/workstations/v1/workstations" - # client = ::Google::Cloud::Workstations::V1::Workstations::Client.new - # - # @example Load this service and instantiate a REST client - # - # require "google/cloud/workstations/v1/workstations/rest" - # client = ::Google::Cloud::Workstations::V1::Workstations::Rest::Client.new - # - module Workstations - end - end - end - end -end - -helper_path = ::File.join __dir__, "workstations", "helpers.rb" -require "google/cloud/workstations/v1/workstations/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-workstations-v1/lib/google/cloud/workstations/v1/workstations/client.rb b/owl-bot-staging/google-cloud-workstations-v1/lib/google/cloud/workstations/v1/workstations/client.rb deleted file mode 100644 index 0a8ab36092c6..000000000000 --- a/owl-bot-staging/google-cloud-workstations-v1/lib/google/cloud/workstations/v1/workstations/client.rb +++ /dev/null @@ -1,2595 +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/workstations/v1/workstations_pb" -require "google/cloud/location" -require "google/iam/v1" - -module Google - module Cloud - module Workstations - module V1 - module Workstations - ## - # Client for the Workstations service. - # - # Service for interacting with Cloud Workstations. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "workstations.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :workstations_stub - - ## - # Configure the Workstations Client class. - # - # See {::Google::Cloud::Workstations::V1::Workstations::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all Workstations clients - # ::Google::Cloud::Workstations::V1::Workstations::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", "Workstations", "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.get_workstation_cluster.timeout = 60.0 - default_config.rpcs.get_workstation_cluster.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.list_workstation_clusters.timeout = 60.0 - default_config.rpcs.list_workstation_clusters.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.create_workstation_cluster.timeout = 60.0 - - default_config.rpcs.update_workstation_cluster.timeout = 60.0 - - default_config.rpcs.delete_workstation_cluster.timeout = 60.0 - - default_config.rpcs.get_workstation_config.timeout = 60.0 - default_config.rpcs.get_workstation_config.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.list_workstation_configs.timeout = 60.0 - default_config.rpcs.list_workstation_configs.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.list_usable_workstation_configs.timeout = 60.0 - default_config.rpcs.list_usable_workstation_configs.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.create_workstation_config.timeout = 60.0 - - default_config.rpcs.update_workstation_config.timeout = 60.0 - - default_config.rpcs.delete_workstation_config.timeout = 60.0 - - default_config.rpcs.get_workstation.timeout = 60.0 - default_config.rpcs.get_workstation.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.list_workstations.timeout = 60.0 - default_config.rpcs.list_workstations.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.list_usable_workstations.timeout = 60.0 - default_config.rpcs.list_usable_workstations.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.create_workstation.timeout = 60.0 - - default_config.rpcs.update_workstation.timeout = 60.0 - - default_config.rpcs.delete_workstation.timeout = 60.0 - - default_config.rpcs.start_workstation.timeout = 60.0 - - default_config.rpcs.stop_workstation.timeout = 60.0 - - default_config.rpcs.generate_access_token.timeout = 60.0 - default_config.rpcs.generate_access_token.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the Workstations 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::Workstations::V1::Workstations::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 - @workstations_stub.universe_domain - end - - ## - # Create a new Workstations client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Workstations::V1::Workstations::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Workstations::V1::Workstations::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Workstations 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/workstations/v1/workstations_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 - - @workstations_stub = ::Gapic::ServiceStub.new( - ::Google::Cloud::Workstations::V1::Workstations::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 - ) - - @workstations_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 = @workstations_stub.endpoint - config.universe_domain = @workstations_stub.universe_domain - config.logger = @workstations_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 = @workstations_stub.endpoint - config.universe_domain = @workstations_stub.universe_domain - config.logger = @workstations_stub.logger if config.respond_to? :logger= - end - end - - ## - # Get the associated client for long-running operations. - # - # @return [::Google::Cloud::Workstations::V1::Workstations::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 - @workstations_stub.logger - end - - # Service calls - - ## - # Returns the requested workstation cluster. - # - # @overload get_workstation_cluster(request, options = nil) - # Pass arguments to `get_workstation_cluster` via a request object, either of type - # {::Google::Cloud::Workstations::V1::GetWorkstationClusterRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Workstations::V1::GetWorkstationClusterRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_workstation_cluster(name: nil) - # Pass arguments to `get_workstation_cluster` via keyword arguments. Note that at - # least one keyword argument is 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 requested resource. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Workstations::V1::WorkstationCluster] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Workstations::V1::WorkstationCluster] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/workstations/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Workstations::V1::Workstations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Workstations::V1::GetWorkstationClusterRequest.new - # - # # Call the get_workstation_cluster method. - # result = client.get_workstation_cluster request - # - # # The returned object is of type Google::Cloud::Workstations::V1::WorkstationCluster. - # p result - # - def get_workstation_cluster request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workstations::V1::GetWorkstationClusterRequest - - # Converts hash 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_workstation_cluster.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::Workstations::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_workstation_cluster.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_workstation_cluster.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @workstations_stub.call_rpc :get_workstation_cluster, 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 all workstation clusters in the specified location. - # - # @overload list_workstation_clusters(request, options = nil) - # Pass arguments to `list_workstation_clusters` via a request object, either of type - # {::Google::Cloud::Workstations::V1::ListWorkstationClustersRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Workstations::V1::ListWorkstationClustersRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_workstation_clusters(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_workstation_clusters` via keyword arguments. Note that at - # least one keyword argument is 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. Parent resource name. - # @param page_size [::Integer] - # Optional. Maximum number of items to return. - # @param page_token [::String] - # Optional. next_page_token value returned from a previous List request, if - # any. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Workstations::V1::WorkstationCluster>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::Workstations::V1::WorkstationCluster>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/workstations/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Workstations::V1::Workstations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Workstations::V1::ListWorkstationClustersRequest.new - # - # # Call the list_workstation_clusters method. - # result = client.list_workstation_clusters 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::Workstations::V1::WorkstationCluster. - # p item - # end - # - def list_workstation_clusters request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workstations::V1::ListWorkstationClustersRequest - - # Converts hash 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_workstation_clusters.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::Workstations::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_workstation_clusters.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_workstation_clusters.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @workstations_stub.call_rpc :list_workstation_clusters, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @workstations_stub, :list_workstation_clusters, 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 - - ## - # Creates a new workstation cluster. - # - # @overload create_workstation_cluster(request, options = nil) - # Pass arguments to `create_workstation_cluster` via a request object, either of type - # {::Google::Cloud::Workstations::V1::CreateWorkstationClusterRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Workstations::V1::CreateWorkstationClusterRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_workstation_cluster(parent: nil, workstation_cluster_id: nil, workstation_cluster: nil, validate_only: nil) - # Pass arguments to `create_workstation_cluster` via keyword arguments. Note that at - # least one keyword argument is 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. Parent resource name. - # @param workstation_cluster_id [::String] - # Required. ID to use for the workstation cluster. - # @param workstation_cluster [::Google::Cloud::Workstations::V1::WorkstationCluster, ::Hash] - # Required. Workstation cluster to create. - # @param validate_only [::Boolean] - # Optional. If set, validate the request and preview the review, but do not - # actually apply it. - # - # @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/workstations/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Workstations::V1::Workstations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Workstations::V1::CreateWorkstationClusterRequest.new - # - # # Call the create_workstation_cluster method. - # result = client.create_workstation_cluster 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_workstation_cluster request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workstations::V1::CreateWorkstationClusterRequest - - # Converts hash 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_workstation_cluster.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::Workstations::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_workstation_cluster.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_workstation_cluster.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @workstations_stub.call_rpc :create_workstation_cluster, 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 - - ## - # Updates an existing workstation cluster. - # - # @overload update_workstation_cluster(request, options = nil) - # Pass arguments to `update_workstation_cluster` via a request object, either of type - # {::Google::Cloud::Workstations::V1::UpdateWorkstationClusterRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Workstations::V1::UpdateWorkstationClusterRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_workstation_cluster(workstation_cluster: nil, update_mask: nil, validate_only: nil, allow_missing: nil) - # Pass arguments to `update_workstation_cluster` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param workstation_cluster [::Google::Cloud::Workstations::V1::WorkstationCluster, ::Hash] - # Required. Workstation cluster to update. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Required. Mask that specifies which fields in the workstation cluster - # should be updated. - # @param validate_only [::Boolean] - # Optional. If set, validate the request and preview the review, but do not - # actually apply it. - # @param allow_missing [::Boolean] - # Optional. If set, and the workstation cluster is not found, a new - # workstation cluster will be created. In this situation, update_mask is - # ignored. - # - # @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/workstations/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Workstations::V1::Workstations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Workstations::V1::UpdateWorkstationClusterRequest.new - # - # # Call the update_workstation_cluster method. - # result = client.update_workstation_cluster 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 update_workstation_cluster request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workstations::V1::UpdateWorkstationClusterRequest - - # Converts hash 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_workstation_cluster.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::Workstations::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.workstation_cluster&.name - header_params["workstation_cluster.name"] = request.workstation_cluster.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_workstation_cluster.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_workstation_cluster.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @workstations_stub.call_rpc :update_workstation_cluster, 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 the specified workstation cluster. - # - # @overload delete_workstation_cluster(request, options = nil) - # Pass arguments to `delete_workstation_cluster` via a request object, either of type - # {::Google::Cloud::Workstations::V1::DeleteWorkstationClusterRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Workstations::V1::DeleteWorkstationClusterRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_workstation_cluster(name: nil, validate_only: nil, etag: nil, force: nil) - # Pass arguments to `delete_workstation_cluster` via keyword arguments. Note that at - # least one keyword argument is 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 workstation cluster to delete. - # @param validate_only [::Boolean] - # Optional. If set, validate the request and preview the review, but do not - # apply it. - # @param etag [::String] - # Optional. If set, the request will be rejected if the latest version of the - # workstation cluster on the server does not have this ETag. - # @param force [::Boolean] - # Optional. If set, any workstation configurations and workstations in the - # workstation cluster are also deleted. Otherwise, the request only - # works if the workstation cluster has no configurations or workstations. - # - # @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/workstations/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Workstations::V1::Workstations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Workstations::V1::DeleteWorkstationClusterRequest.new - # - # # Call the delete_workstation_cluster method. - # result = client.delete_workstation_cluster 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_workstation_cluster request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workstations::V1::DeleteWorkstationClusterRequest - - # Converts hash 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_workstation_cluster.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::Workstations::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_workstation_cluster.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_workstation_cluster.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @workstations_stub.call_rpc :delete_workstation_cluster, 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 requested workstation configuration. - # - # @overload get_workstation_config(request, options = nil) - # Pass arguments to `get_workstation_config` via a request object, either of type - # {::Google::Cloud::Workstations::V1::GetWorkstationConfigRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Workstations::V1::GetWorkstationConfigRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_workstation_config(name: nil) - # Pass arguments to `get_workstation_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 requested resource. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Workstations::V1::WorkstationConfig] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Workstations::V1::WorkstationConfig] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/workstations/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Workstations::V1::Workstations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Workstations::V1::GetWorkstationConfigRequest.new - # - # # Call the get_workstation_config method. - # result = client.get_workstation_config request - # - # # The returned object is of type Google::Cloud::Workstations::V1::WorkstationConfig. - # p result - # - def get_workstation_config request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workstations::V1::GetWorkstationConfigRequest - - # Converts hash 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_workstation_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::Workstations::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_workstation_config.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_workstation_config.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @workstations_stub.call_rpc :get_workstation_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 all workstation configurations in the specified cluster. - # - # @overload list_workstation_configs(request, options = nil) - # Pass arguments to `list_workstation_configs` via a request object, either of type - # {::Google::Cloud::Workstations::V1::ListWorkstationConfigsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Workstations::V1::ListWorkstationConfigsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_workstation_configs(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_workstation_configs` via keyword arguments. Note that at - # least one keyword argument is 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. Parent resource name. - # @param page_size [::Integer] - # Optional. Maximum number of items to return. - # @param page_token [::String] - # Optional. next_page_token value returned from a previous List request, if - # any. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Workstations::V1::WorkstationConfig>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::Workstations::V1::WorkstationConfig>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/workstations/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Workstations::V1::Workstations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Workstations::V1::ListWorkstationConfigsRequest.new - # - # # Call the list_workstation_configs method. - # result = client.list_workstation_configs 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::Workstations::V1::WorkstationConfig. - # p item - # end - # - def list_workstation_configs request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workstations::V1::ListWorkstationConfigsRequest - - # Converts hash 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_workstation_configs.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::Workstations::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_workstation_configs.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_workstation_configs.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @workstations_stub.call_rpc :list_workstation_configs, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @workstations_stub, :list_workstation_configs, 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 all workstation configurations in the specified cluster on which - # the caller has the "workstations.workstation.create" permission. - # - # @overload list_usable_workstation_configs(request, options = nil) - # Pass arguments to `list_usable_workstation_configs` via a request object, either of type - # {::Google::Cloud::Workstations::V1::ListUsableWorkstationConfigsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Workstations::V1::ListUsableWorkstationConfigsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_usable_workstation_configs(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_usable_workstation_configs` via keyword arguments. Note that at - # least one keyword argument is 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. Parent resource name. - # @param page_size [::Integer] - # Optional. Maximum number of items to return. - # @param page_token [::String] - # Optional. next_page_token value returned from a previous List request, if - # any. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Workstations::V1::WorkstationConfig>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::Workstations::V1::WorkstationConfig>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/workstations/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Workstations::V1::Workstations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Workstations::V1::ListUsableWorkstationConfigsRequest.new - # - # # Call the list_usable_workstation_configs method. - # result = client.list_usable_workstation_configs 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::Workstations::V1::WorkstationConfig. - # p item - # end - # - def list_usable_workstation_configs request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workstations::V1::ListUsableWorkstationConfigsRequest - - # Converts hash 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_usable_workstation_configs.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::Workstations::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_usable_workstation_configs.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_usable_workstation_configs.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @workstations_stub.call_rpc :list_usable_workstation_configs, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @workstations_stub, :list_usable_workstation_configs, 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 - - ## - # Creates a new workstation configuration. - # - # @overload create_workstation_config(request, options = nil) - # Pass arguments to `create_workstation_config` via a request object, either of type - # {::Google::Cloud::Workstations::V1::CreateWorkstationConfigRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Workstations::V1::CreateWorkstationConfigRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_workstation_config(parent: nil, workstation_config_id: nil, workstation_config: nil, validate_only: nil) - # Pass arguments to `create_workstation_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. Parent resource name. - # @param workstation_config_id [::String] - # Required. ID to use for the workstation configuration. - # @param workstation_config [::Google::Cloud::Workstations::V1::WorkstationConfig, ::Hash] - # Required. Config to create. - # @param validate_only [::Boolean] - # Optional. If set, validate the request and preview the review, but do not - # actually apply it. - # - # @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/workstations/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Workstations::V1::Workstations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Workstations::V1::CreateWorkstationConfigRequest.new - # - # # Call the create_workstation_config method. - # result = client.create_workstation_config 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_workstation_config request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workstations::V1::CreateWorkstationConfigRequest - - # Converts hash 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_workstation_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::Workstations::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_workstation_config.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_workstation_config.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @workstations_stub.call_rpc :create_workstation_config, 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 - - ## - # Updates an existing workstation configuration. - # - # @overload update_workstation_config(request, options = nil) - # Pass arguments to `update_workstation_config` via a request object, either of type - # {::Google::Cloud::Workstations::V1::UpdateWorkstationConfigRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Workstations::V1::UpdateWorkstationConfigRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_workstation_config(workstation_config: nil, update_mask: nil, validate_only: nil, allow_missing: nil) - # Pass arguments to `update_workstation_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 workstation_config [::Google::Cloud::Workstations::V1::WorkstationConfig, ::Hash] - # Required. Config to update. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Required. Mask specifying which fields in the workstation configuration - # should be updated. - # @param validate_only [::Boolean] - # Optional. If set, validate the request and preview the review, but do not - # actually apply it. - # @param allow_missing [::Boolean] - # Optional. If set and the workstation configuration is not found, a new - # workstation configuration will be created. In this situation, - # update_mask is ignored. - # - # @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/workstations/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Workstations::V1::Workstations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Workstations::V1::UpdateWorkstationConfigRequest.new - # - # # Call the update_workstation_config method. - # result = client.update_workstation_config 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 update_workstation_config request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workstations::V1::UpdateWorkstationConfigRequest - - # Converts hash 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_workstation_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::Workstations::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.workstation_config&.name - header_params["workstation_config.name"] = request.workstation_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_workstation_config.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_workstation_config.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @workstations_stub.call_rpc :update_workstation_config, 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 the specified workstation configuration. - # - # @overload delete_workstation_config(request, options = nil) - # Pass arguments to `delete_workstation_config` via a request object, either of type - # {::Google::Cloud::Workstations::V1::DeleteWorkstationConfigRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Workstations::V1::DeleteWorkstationConfigRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_workstation_config(name: nil, validate_only: nil, etag: nil, force: nil) - # Pass arguments to `delete_workstation_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 workstation configuration to delete. - # @param validate_only [::Boolean] - # Optional. If set, validate the request and preview the review, but do not - # actually apply it. - # @param etag [::String] - # Optional. If set, the request is rejected if the latest version of the - # workstation configuration on the server does not have this ETag. - # @param force [::Boolean] - # Optional. If set, any workstations in the workstation configuration are - # also deleted. Otherwise, the request works only if the workstation - # configuration has no workstations. - # - # @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/workstations/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Workstations::V1::Workstations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Workstations::V1::DeleteWorkstationConfigRequest.new - # - # # Call the delete_workstation_config method. - # result = client.delete_workstation_config 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_workstation_config request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workstations::V1::DeleteWorkstationConfigRequest - - # Converts hash 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_workstation_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::Workstations::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_workstation_config.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_workstation_config.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @workstations_stub.call_rpc :delete_workstation_config, 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 requested workstation. - # - # @overload get_workstation(request, options = nil) - # Pass arguments to `get_workstation` via a request object, either of type - # {::Google::Cloud::Workstations::V1::GetWorkstationRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Workstations::V1::GetWorkstationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_workstation(name: nil) - # Pass arguments to `get_workstation` via keyword arguments. Note that at - # least one keyword argument is 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 requested resource. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Workstations::V1::Workstation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Workstations::V1::Workstation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/workstations/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Workstations::V1::Workstations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Workstations::V1::GetWorkstationRequest.new - # - # # Call the get_workstation method. - # result = client.get_workstation request - # - # # The returned object is of type Google::Cloud::Workstations::V1::Workstation. - # p result - # - def get_workstation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workstations::V1::GetWorkstationRequest - - # Converts hash 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_workstation.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::Workstations::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_workstation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_workstation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @workstations_stub.call_rpc :get_workstation, 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 all Workstations using the specified workstation configuration. - # - # @overload list_workstations(request, options = nil) - # Pass arguments to `list_workstations` via a request object, either of type - # {::Google::Cloud::Workstations::V1::ListWorkstationsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Workstations::V1::ListWorkstationsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_workstations(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_workstations` via keyword arguments. Note that at - # least one keyword argument is 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. Parent resource name. - # @param page_size [::Integer] - # Optional. Maximum number of items to return. - # @param page_token [::String] - # Optional. next_page_token value returned from a previous List request, if - # any. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Workstations::V1::Workstation>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::Workstations::V1::Workstation>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/workstations/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Workstations::V1::Workstations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Workstations::V1::ListWorkstationsRequest.new - # - # # Call the list_workstations method. - # result = client.list_workstations 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::Workstations::V1::Workstation. - # p item - # end - # - def list_workstations request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workstations::V1::ListWorkstationsRequest - - # Converts hash 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_workstations.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::Workstations::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_workstations.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_workstations.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @workstations_stub.call_rpc :list_workstations, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @workstations_stub, :list_workstations, 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 all workstations using the specified workstation configuration - # on which the caller has the "workstations.workstations.use" permission. - # - # @overload list_usable_workstations(request, options = nil) - # Pass arguments to `list_usable_workstations` via a request object, either of type - # {::Google::Cloud::Workstations::V1::ListUsableWorkstationsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Workstations::V1::ListUsableWorkstationsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_usable_workstations(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_usable_workstations` via keyword arguments. Note that at - # least one keyword argument is 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. Parent resource name. - # @param page_size [::Integer] - # Optional. Maximum number of items to return. - # @param page_token [::String] - # Optional. next_page_token value returned from a previous List request, if - # any. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Workstations::V1::Workstation>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::Workstations::V1::Workstation>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/workstations/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Workstations::V1::Workstations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Workstations::V1::ListUsableWorkstationsRequest.new - # - # # Call the list_usable_workstations method. - # result = client.list_usable_workstations 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::Workstations::V1::Workstation. - # p item - # end - # - def list_usable_workstations request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workstations::V1::ListUsableWorkstationsRequest - - # Converts hash 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_usable_workstations.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::Workstations::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_usable_workstations.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_usable_workstations.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @workstations_stub.call_rpc :list_usable_workstations, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @workstations_stub, :list_usable_workstations, 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 - - ## - # Creates a new workstation. - # - # @overload create_workstation(request, options = nil) - # Pass arguments to `create_workstation` via a request object, either of type - # {::Google::Cloud::Workstations::V1::CreateWorkstationRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Workstations::V1::CreateWorkstationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_workstation(parent: nil, workstation_id: nil, workstation: nil, validate_only: nil) - # Pass arguments to `create_workstation` via keyword arguments. Note that at - # least one keyword argument is 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. Parent resource name. - # @param workstation_id [::String] - # Required. ID to use for the workstation. - # @param workstation [::Google::Cloud::Workstations::V1::Workstation, ::Hash] - # Required. Workstation to create. - # @param validate_only [::Boolean] - # Optional. If set, validate the request and preview the review, but do not - # actually apply it. - # - # @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/workstations/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Workstations::V1::Workstations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Workstations::V1::CreateWorkstationRequest.new - # - # # Call the create_workstation method. - # result = client.create_workstation 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_workstation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workstations::V1::CreateWorkstationRequest - - # Converts hash 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_workstation.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::Workstations::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_workstation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_workstation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @workstations_stub.call_rpc :create_workstation, 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 - - ## - # Updates an existing workstation. - # - # @overload update_workstation(request, options = nil) - # Pass arguments to `update_workstation` via a request object, either of type - # {::Google::Cloud::Workstations::V1::UpdateWorkstationRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Workstations::V1::UpdateWorkstationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_workstation(workstation: nil, update_mask: nil, validate_only: nil, allow_missing: nil) - # Pass arguments to `update_workstation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param workstation [::Google::Cloud::Workstations::V1::Workstation, ::Hash] - # Required. Workstation to update. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Required. Mask specifying which fields in the workstation configuration - # should be updated. - # @param validate_only [::Boolean] - # Optional. If set, validate the request and preview the review, but do not - # actually apply it. - # @param allow_missing [::Boolean] - # Optional. If set and the workstation configuration is not found, a new - # workstation configuration is created. In this situation, update_mask - # is ignored. - # - # @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/workstations/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Workstations::V1::Workstations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Workstations::V1::UpdateWorkstationRequest.new - # - # # Call the update_workstation method. - # result = client.update_workstation 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 update_workstation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workstations::V1::UpdateWorkstationRequest - - # Converts hash 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_workstation.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::Workstations::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.workstation&.name - header_params["workstation.name"] = request.workstation.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_workstation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_workstation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @workstations_stub.call_rpc :update_workstation, 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 the specified workstation. - # - # @overload delete_workstation(request, options = nil) - # Pass arguments to `delete_workstation` via a request object, either of type - # {::Google::Cloud::Workstations::V1::DeleteWorkstationRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Workstations::V1::DeleteWorkstationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_workstation(name: nil, validate_only: nil, etag: nil) - # Pass arguments to `delete_workstation` via keyword arguments. Note that at - # least one keyword argument is 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 workstation to delete. - # @param validate_only [::Boolean] - # Optional. If set, validate the request and preview the review, but do not - # actually apply it. - # @param etag [::String] - # Optional. If set, the request will be rejected if the latest version of the - # workstation on the server does not have this ETag. - # - # @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/workstations/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Workstations::V1::Workstations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Workstations::V1::DeleteWorkstationRequest.new - # - # # Call the delete_workstation method. - # result = client.delete_workstation 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_workstation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workstations::V1::DeleteWorkstationRequest - - # Converts hash 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_workstation.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::Workstations::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_workstation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_workstation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @workstations_stub.call_rpc :delete_workstation, 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 - - ## - # Starts running a workstation so that users can connect to it. - # - # @overload start_workstation(request, options = nil) - # Pass arguments to `start_workstation` via a request object, either of type - # {::Google::Cloud::Workstations::V1::StartWorkstationRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Workstations::V1::StartWorkstationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload start_workstation(name: nil, validate_only: nil, etag: nil) - # Pass arguments to `start_workstation` via keyword arguments. Note that at - # least one keyword argument is 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 workstation to start. - # @param validate_only [::Boolean] - # Optional. If set, validate the request and preview the review, but do not - # actually apply it. - # @param etag [::String] - # Optional. If set, the request will be rejected if the latest version of the - # workstation on the server does not have this ETag. - # - # @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/workstations/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Workstations::V1::Workstations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Workstations::V1::StartWorkstationRequest.new - # - # # Call the start_workstation method. - # result = client.start_workstation 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 start_workstation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workstations::V1::StartWorkstationRequest - - # Converts hash 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.start_workstation.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::Workstations::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.start_workstation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.start_workstation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @workstations_stub.call_rpc :start_workstation, 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 - - ## - # Stops running a workstation, reducing costs. - # - # @overload stop_workstation(request, options = nil) - # Pass arguments to `stop_workstation` via a request object, either of type - # {::Google::Cloud::Workstations::V1::StopWorkstationRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Workstations::V1::StopWorkstationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload stop_workstation(name: nil, validate_only: nil, etag: nil) - # Pass arguments to `stop_workstation` via keyword arguments. Note that at - # least one keyword argument is 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 workstation to stop. - # @param validate_only [::Boolean] - # Optional. If set, validate the request and preview the review, but do not - # actually apply it. - # @param etag [::String] - # Optional. If set, the request will be rejected if the latest version of the - # workstation on the server does not have this ETag. - # - # @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/workstations/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Workstations::V1::Workstations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Workstations::V1::StopWorkstationRequest.new - # - # # Call the stop_workstation method. - # result = client.stop_workstation 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 stop_workstation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workstations::V1::StopWorkstationRequest - - # Converts hash 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.stop_workstation.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::Workstations::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.stop_workstation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.stop_workstation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @workstations_stub.call_rpc :stop_workstation, 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 a short-lived credential that can be used to send authenticated and - # authorized traffic to a workstation. - # - # @overload generate_access_token(request, options = nil) - # Pass arguments to `generate_access_token` via a request object, either of type - # {::Google::Cloud::Workstations::V1::GenerateAccessTokenRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Workstations::V1::GenerateAccessTokenRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_access_token(expire_time: nil, ttl: nil, workstation: nil) - # Pass arguments to `generate_access_token` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param expire_time [::Google::Protobuf::Timestamp, ::Hash] - # Desired expiration time of the access token. This value must - # be at most 24 hours in the future. If a value is not specified, the - # token's expiration time will be set to a default value of 1 hour in the - # future. - # - # Note: The following parameters are mutually exclusive: `expire_time`, `ttl`. 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 ttl [::Google::Protobuf::Duration, ::Hash] - # Desired lifetime duration of the access token. This value must - # be at most 24 hours. If a value is not specified, the token's lifetime - # will be set to a default value of 1 hour. - # - # Note: The following parameters are mutually exclusive: `ttl`, `expire_time`. 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 workstation [::String] - # Required. Name of the workstation for which the access token should be - # generated. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Workstations::V1::GenerateAccessTokenResponse] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Workstations::V1::GenerateAccessTokenResponse] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/workstations/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Workstations::V1::Workstations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Workstations::V1::GenerateAccessTokenRequest.new - # - # # Call the generate_access_token method. - # result = client.generate_access_token request - # - # # The returned object is of type Google::Cloud::Workstations::V1::GenerateAccessTokenResponse. - # p result - # - def generate_access_token request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workstations::V1::GenerateAccessTokenRequest - - # Converts hash 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_access_token.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::Workstations::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.workstation - header_params["workstation"] = request.workstation - 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_access_token.timeout, - metadata: metadata, - retry_policy: @config.rpcs.generate_access_token.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @workstations_stub.call_rpc :generate_access_token, 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 Workstations API. - # - # This class represents the configuration for Workstations, - # 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::Workstations::V1::Workstations::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 - # # get_workstation_cluster to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Workstations::V1::Workstations::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.get_workstation_cluster.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Workstations::V1::Workstations::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.get_workstation_cluster.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::Workstations::V1::Workstations::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 = "workstations.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 Workstations 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 `get_workstation_cluster` - # @return [::Gapic::Config::Method] - # - attr_reader :get_workstation_cluster - ## - # RPC-specific configuration for `list_workstation_clusters` - # @return [::Gapic::Config::Method] - # - attr_reader :list_workstation_clusters - ## - # RPC-specific configuration for `create_workstation_cluster` - # @return [::Gapic::Config::Method] - # - attr_reader :create_workstation_cluster - ## - # RPC-specific configuration for `update_workstation_cluster` - # @return [::Gapic::Config::Method] - # - attr_reader :update_workstation_cluster - ## - # RPC-specific configuration for `delete_workstation_cluster` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_workstation_cluster - ## - # RPC-specific configuration for `get_workstation_config` - # @return [::Gapic::Config::Method] - # - attr_reader :get_workstation_config - ## - # RPC-specific configuration for `list_workstation_configs` - # @return [::Gapic::Config::Method] - # - attr_reader :list_workstation_configs - ## - # RPC-specific configuration for `list_usable_workstation_configs` - # @return [::Gapic::Config::Method] - # - attr_reader :list_usable_workstation_configs - ## - # RPC-specific configuration for `create_workstation_config` - # @return [::Gapic::Config::Method] - # - attr_reader :create_workstation_config - ## - # RPC-specific configuration for `update_workstation_config` - # @return [::Gapic::Config::Method] - # - attr_reader :update_workstation_config - ## - # RPC-specific configuration for `delete_workstation_config` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_workstation_config - ## - # RPC-specific configuration for `get_workstation` - # @return [::Gapic::Config::Method] - # - attr_reader :get_workstation - ## - # RPC-specific configuration for `list_workstations` - # @return [::Gapic::Config::Method] - # - attr_reader :list_workstations - ## - # RPC-specific configuration for `list_usable_workstations` - # @return [::Gapic::Config::Method] - # - attr_reader :list_usable_workstations - ## - # RPC-specific configuration for `create_workstation` - # @return [::Gapic::Config::Method] - # - attr_reader :create_workstation - ## - # RPC-specific configuration for `update_workstation` - # @return [::Gapic::Config::Method] - # - attr_reader :update_workstation - ## - # RPC-specific configuration for `delete_workstation` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_workstation - ## - # RPC-specific configuration for `start_workstation` - # @return [::Gapic::Config::Method] - # - attr_reader :start_workstation - ## - # RPC-specific configuration for `stop_workstation` - # @return [::Gapic::Config::Method] - # - attr_reader :stop_workstation - ## - # RPC-specific configuration for `generate_access_token` - # @return [::Gapic::Config::Method] - # - attr_reader :generate_access_token - - # @private - def initialize parent_rpcs = nil - get_workstation_cluster_config = parent_rpcs.get_workstation_cluster if parent_rpcs.respond_to? :get_workstation_cluster - @get_workstation_cluster = ::Gapic::Config::Method.new get_workstation_cluster_config - list_workstation_clusters_config = parent_rpcs.list_workstation_clusters if parent_rpcs.respond_to? :list_workstation_clusters - @list_workstation_clusters = ::Gapic::Config::Method.new list_workstation_clusters_config - create_workstation_cluster_config = parent_rpcs.create_workstation_cluster if parent_rpcs.respond_to? :create_workstation_cluster - @create_workstation_cluster = ::Gapic::Config::Method.new create_workstation_cluster_config - update_workstation_cluster_config = parent_rpcs.update_workstation_cluster if parent_rpcs.respond_to? :update_workstation_cluster - @update_workstation_cluster = ::Gapic::Config::Method.new update_workstation_cluster_config - delete_workstation_cluster_config = parent_rpcs.delete_workstation_cluster if parent_rpcs.respond_to? :delete_workstation_cluster - @delete_workstation_cluster = ::Gapic::Config::Method.new delete_workstation_cluster_config - get_workstation_config_config = parent_rpcs.get_workstation_config if parent_rpcs.respond_to? :get_workstation_config - @get_workstation_config = ::Gapic::Config::Method.new get_workstation_config_config - list_workstation_configs_config = parent_rpcs.list_workstation_configs if parent_rpcs.respond_to? :list_workstation_configs - @list_workstation_configs = ::Gapic::Config::Method.new list_workstation_configs_config - list_usable_workstation_configs_config = parent_rpcs.list_usable_workstation_configs if parent_rpcs.respond_to? :list_usable_workstation_configs - @list_usable_workstation_configs = ::Gapic::Config::Method.new list_usable_workstation_configs_config - create_workstation_config_config = parent_rpcs.create_workstation_config if parent_rpcs.respond_to? :create_workstation_config - @create_workstation_config = ::Gapic::Config::Method.new create_workstation_config_config - update_workstation_config_config = parent_rpcs.update_workstation_config if parent_rpcs.respond_to? :update_workstation_config - @update_workstation_config = ::Gapic::Config::Method.new update_workstation_config_config - delete_workstation_config_config = parent_rpcs.delete_workstation_config if parent_rpcs.respond_to? :delete_workstation_config - @delete_workstation_config = ::Gapic::Config::Method.new delete_workstation_config_config - get_workstation_config = parent_rpcs.get_workstation if parent_rpcs.respond_to? :get_workstation - @get_workstation = ::Gapic::Config::Method.new get_workstation_config - list_workstations_config = parent_rpcs.list_workstations if parent_rpcs.respond_to? :list_workstations - @list_workstations = ::Gapic::Config::Method.new list_workstations_config - list_usable_workstations_config = parent_rpcs.list_usable_workstations if parent_rpcs.respond_to? :list_usable_workstations - @list_usable_workstations = ::Gapic::Config::Method.new list_usable_workstations_config - create_workstation_config = parent_rpcs.create_workstation if parent_rpcs.respond_to? :create_workstation - @create_workstation = ::Gapic::Config::Method.new create_workstation_config - update_workstation_config = parent_rpcs.update_workstation if parent_rpcs.respond_to? :update_workstation - @update_workstation = ::Gapic::Config::Method.new update_workstation_config - delete_workstation_config = parent_rpcs.delete_workstation if parent_rpcs.respond_to? :delete_workstation - @delete_workstation = ::Gapic::Config::Method.new delete_workstation_config - start_workstation_config = parent_rpcs.start_workstation if parent_rpcs.respond_to? :start_workstation - @start_workstation = ::Gapic::Config::Method.new start_workstation_config - stop_workstation_config = parent_rpcs.stop_workstation if parent_rpcs.respond_to? :stop_workstation - @stop_workstation = ::Gapic::Config::Method.new stop_workstation_config - generate_access_token_config = parent_rpcs.generate_access_token if parent_rpcs.respond_to? :generate_access_token - @generate_access_token = ::Gapic::Config::Method.new generate_access_token_config - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-workstations-v1/lib/google/cloud/workstations/v1/workstations/credentials.rb b/owl-bot-staging/google-cloud-workstations-v1/lib/google/cloud/workstations/v1/workstations/credentials.rb deleted file mode 100644 index dfd9bd39ea0a..000000000000 --- a/owl-bot-staging/google-cloud-workstations-v1/lib/google/cloud/workstations/v1/workstations/credentials.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! - -require "googleauth" - -module Google - module Cloud - module Workstations - module V1 - module Workstations - # Credentials for the Workstations API. - class Credentials < ::Google::Auth::Credentials - self.scope = [ - "https://www.googleapis.com/auth/cloud-platform" - ] - self.env_vars = [ - "GOOGLE_CLOUD_CREDENTIALS", - "GOOGLE_CLOUD_KEYFILE", - "GCLOUD_KEYFILE", - "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-workstations-v1/lib/google/cloud/workstations/v1/workstations/operations.rb b/owl-bot-staging/google-cloud-workstations-v1/lib/google/cloud/workstations/v1/workstations/operations.rb deleted file mode 100644 index 667b9e605bce..000000000000 --- a/owl-bot-staging/google-cloud-workstations-v1/lib/google/cloud/workstations/v1/workstations/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 Workstations - module V1 - module Workstations - # Service that implements Longrunning Operations API. - class Operations - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "workstations.$UNIVERSE_DOMAIN$" - - # @private - attr_reader :operations_stub - - ## - # Configuration for the Workstations 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 Workstations 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::Workstations::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::Workstations::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::Workstations::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::Workstations::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::Workstations::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 = "workstations.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-workstations-v1/lib/google/cloud/workstations/v1/workstations/paths.rb b/owl-bot-staging/google-cloud-workstations-v1/lib/google/cloud/workstations/v1/workstations/paths.rb deleted file mode 100644 index 464e72c7f12e..000000000000 --- a/owl-bot-staging/google-cloud-workstations-v1/lib/google/cloud/workstations/v1/workstations/paths.rb +++ /dev/null @@ -1,113 +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 Workstations - module V1 - module Workstations - # Path helper methods for the Workstations 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 Workstation resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/workstationClusters/{workstation_cluster}/workstationConfigs/{workstation_config}/workstations/{workstation}` - # - # @param project [String] - # @param location [String] - # @param workstation_cluster [String] - # @param workstation_config [String] - # @param workstation [String] - # - # @return [::String] - def workstation_path project:, location:, workstation_cluster:, workstation_config:, workstation: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "workstation_cluster cannot contain /" if workstation_cluster.to_s.include? "/" - raise ::ArgumentError, "workstation_config cannot contain /" if workstation_config.to_s.include? "/" - - "projects/#{project}/locations/#{location}/workstationClusters/#{workstation_cluster}/workstationConfigs/#{workstation_config}/workstations/#{workstation}" - end - - ## - # Create a fully-qualified WorkstationCluster resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/workstationClusters/{workstation_cluster}` - # - # @param project [String] - # @param location [String] - # @param workstation_cluster [String] - # - # @return [::String] - def workstation_cluster_path project:, location:, workstation_cluster: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/workstationClusters/#{workstation_cluster}" - end - - ## - # Create a fully-qualified WorkstationConfig resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/workstationClusters/{workstation_cluster}/workstationConfigs/{workstation_config}` - # - # @param project [String] - # @param location [String] - # @param workstation_cluster [String] - # @param workstation_config [String] - # - # @return [::String] - def workstation_config_path project:, location:, workstation_cluster:, workstation_config: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "workstation_cluster cannot contain /" if workstation_cluster.to_s.include? "/" - - "projects/#{project}/locations/#{location}/workstationClusters/#{workstation_cluster}/workstationConfigs/#{workstation_config}" - end - - extend self - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-workstations-v1/lib/google/cloud/workstations/v1/workstations/rest.rb b/owl-bot-staging/google-cloud-workstations-v1/lib/google/cloud/workstations/v1/workstations/rest.rb deleted file mode 100644 index ba4f83cc6e0c..000000000000 --- a/owl-bot-staging/google-cloud-workstations-v1/lib/google/cloud/workstations/v1/workstations/rest.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! - -require "gapic/rest" -require "gapic/config" -require "gapic/config/method" - -require "google/cloud/workstations/v1/version" -require "google/cloud/workstations/v1/bindings_override" - -require "google/cloud/workstations/v1/workstations/credentials" -require "google/cloud/workstations/v1/workstations/paths" -require "google/cloud/workstations/v1/workstations/rest/operations" -require "google/cloud/workstations/v1/workstations/rest/client" - -module Google - module Cloud - module Workstations - module V1 - ## - # Service for interacting with Cloud Workstations. - # - # To load this service and instantiate a REST client: - # - # require "google/cloud/workstations/v1/workstations/rest" - # client = ::Google::Cloud::Workstations::V1::Workstations::Rest::Client.new - # - module Workstations - # Client for the REST transport - module Rest - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "rest", "helpers.rb" -require "google/cloud/workstations/v1/workstations/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-workstations-v1/lib/google/cloud/workstations/v1/workstations/rest/client.rb b/owl-bot-staging/google-cloud-workstations-v1/lib/google/cloud/workstations/v1/workstations/rest/client.rb deleted file mode 100644 index fe30c7b2e4fe..000000000000 --- a/owl-bot-staging/google-cloud-workstations-v1/lib/google/cloud/workstations/v1/workstations/rest/client.rb +++ /dev/null @@ -1,2420 +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/workstations/v1/workstations_pb" -require "google/cloud/workstations/v1/workstations/rest/service_stub" -require "google/cloud/location/rest" -require "google/iam/v1/rest" - -module Google - module Cloud - module Workstations - module V1 - module Workstations - module Rest - ## - # REST client for the Workstations service. - # - # Service for interacting with Cloud Workstations. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "workstations.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :workstations_stub - - ## - # Configure the Workstations Client class. - # - # See {::Google::Cloud::Workstations::V1::Workstations::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all Workstations clients - # ::Google::Cloud::Workstations::V1::Workstations::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", "Workstations", "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.get_workstation_cluster.timeout = 60.0 - default_config.rpcs.get_workstation_cluster.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.list_workstation_clusters.timeout = 60.0 - default_config.rpcs.list_workstation_clusters.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.create_workstation_cluster.timeout = 60.0 - - default_config.rpcs.update_workstation_cluster.timeout = 60.0 - - default_config.rpcs.delete_workstation_cluster.timeout = 60.0 - - default_config.rpcs.get_workstation_config.timeout = 60.0 - default_config.rpcs.get_workstation_config.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.list_workstation_configs.timeout = 60.0 - default_config.rpcs.list_workstation_configs.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.list_usable_workstation_configs.timeout = 60.0 - default_config.rpcs.list_usable_workstation_configs.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.create_workstation_config.timeout = 60.0 - - default_config.rpcs.update_workstation_config.timeout = 60.0 - - default_config.rpcs.delete_workstation_config.timeout = 60.0 - - default_config.rpcs.get_workstation.timeout = 60.0 - default_config.rpcs.get_workstation.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.list_workstations.timeout = 60.0 - default_config.rpcs.list_workstations.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.list_usable_workstations.timeout = 60.0 - default_config.rpcs.list_usable_workstations.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.create_workstation.timeout = 60.0 - - default_config.rpcs.update_workstation.timeout = 60.0 - - default_config.rpcs.delete_workstation.timeout = 60.0 - - default_config.rpcs.start_workstation.timeout = 60.0 - - default_config.rpcs.stop_workstation.timeout = 60.0 - - default_config.rpcs.generate_access_token.timeout = 60.0 - default_config.rpcs.generate_access_token.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the Workstations 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::Workstations::V1::Workstations::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 - @workstations_stub.universe_domain - end - - ## - # Create a new Workstations REST client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Workstations::V1::Workstations::Rest::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Workstations::V1::Workstations::Rest::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Workstations 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::Workstations::V1::Workstations::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 - - @workstations_stub = ::Google::Cloud::Workstations::V1::Workstations::Rest::ServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials, - logger: @config.logger - ) - - @workstations_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 = @workstations_stub.endpoint - config.universe_domain = @workstations_stub.universe_domain - config.logger = @workstations_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 = @workstations_stub.endpoint - config.universe_domain = @workstations_stub.universe_domain - config.bindings_override = @config.bindings_override - config.logger = @workstations_stub.logger if config.respond_to? :logger= - end - end - - ## - # Get the associated client for long-running operations. - # - # @return [::Google::Cloud::Workstations::V1::Workstations::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 - @workstations_stub.logger - end - - # Service calls - - ## - # Returns the requested workstation cluster. - # - # @overload get_workstation_cluster(request, options = nil) - # Pass arguments to `get_workstation_cluster` via a request object, either of type - # {::Google::Cloud::Workstations::V1::GetWorkstationClusterRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Workstations::V1::GetWorkstationClusterRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_workstation_cluster(name: nil) - # Pass arguments to `get_workstation_cluster` via keyword arguments. Note that at - # least one keyword argument is 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 requested resource. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Workstations::V1::WorkstationCluster] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Workstations::V1::WorkstationCluster] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/workstations/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Workstations::V1::Workstations::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Workstations::V1::GetWorkstationClusterRequest.new - # - # # Call the get_workstation_cluster method. - # result = client.get_workstation_cluster request - # - # # The returned object is of type Google::Cloud::Workstations::V1::WorkstationCluster. - # p result - # - def get_workstation_cluster request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workstations::V1::GetWorkstationClusterRequest - - # Converts hash 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_workstation_cluster.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::Workstations::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_workstation_cluster.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_workstation_cluster.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @workstations_stub.get_workstation_cluster 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 all workstation clusters in the specified location. - # - # @overload list_workstation_clusters(request, options = nil) - # Pass arguments to `list_workstation_clusters` via a request object, either of type - # {::Google::Cloud::Workstations::V1::ListWorkstationClustersRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Workstations::V1::ListWorkstationClustersRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_workstation_clusters(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_workstation_clusters` via keyword arguments. Note that at - # least one keyword argument is 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. Parent resource name. - # @param page_size [::Integer] - # Optional. Maximum number of items to return. - # @param page_token [::String] - # Optional. next_page_token value returned from a previous List request, if - # any. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Workstations::V1::WorkstationCluster>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Workstations::V1::WorkstationCluster>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/workstations/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Workstations::V1::Workstations::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Workstations::V1::ListWorkstationClustersRequest.new - # - # # Call the list_workstation_clusters method. - # result = client.list_workstation_clusters 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::Workstations::V1::WorkstationCluster. - # p item - # end - # - def list_workstation_clusters request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workstations::V1::ListWorkstationClustersRequest - - # Converts hash 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_workstation_clusters.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::Workstations::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_workstation_clusters.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_workstation_clusters.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @workstations_stub.list_workstation_clusters request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @workstations_stub, :list_workstation_clusters, "workstation_clusters", 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 - - ## - # Creates a new workstation cluster. - # - # @overload create_workstation_cluster(request, options = nil) - # Pass arguments to `create_workstation_cluster` via a request object, either of type - # {::Google::Cloud::Workstations::V1::CreateWorkstationClusterRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Workstations::V1::CreateWorkstationClusterRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_workstation_cluster(parent: nil, workstation_cluster_id: nil, workstation_cluster: nil, validate_only: nil) - # Pass arguments to `create_workstation_cluster` via keyword arguments. Note that at - # least one keyword argument is 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. Parent resource name. - # @param workstation_cluster_id [::String] - # Required. ID to use for the workstation cluster. - # @param workstation_cluster [::Google::Cloud::Workstations::V1::WorkstationCluster, ::Hash] - # Required. Workstation cluster to create. - # @param validate_only [::Boolean] - # Optional. If set, validate the request and preview the review, but do not - # actually apply it. - # @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/workstations/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Workstations::V1::Workstations::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Workstations::V1::CreateWorkstationClusterRequest.new - # - # # Call the create_workstation_cluster method. - # result = client.create_workstation_cluster 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_workstation_cluster request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workstations::V1::CreateWorkstationClusterRequest - - # Converts hash 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_workstation_cluster.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::Workstations::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_workstation_cluster.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_workstation_cluster.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @workstations_stub.create_workstation_cluster 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 - - ## - # Updates an existing workstation cluster. - # - # @overload update_workstation_cluster(request, options = nil) - # Pass arguments to `update_workstation_cluster` via a request object, either of type - # {::Google::Cloud::Workstations::V1::UpdateWorkstationClusterRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Workstations::V1::UpdateWorkstationClusterRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_workstation_cluster(workstation_cluster: nil, update_mask: nil, validate_only: nil, allow_missing: nil) - # Pass arguments to `update_workstation_cluster` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param workstation_cluster [::Google::Cloud::Workstations::V1::WorkstationCluster, ::Hash] - # Required. Workstation cluster to update. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Required. Mask that specifies which fields in the workstation cluster - # should be updated. - # @param validate_only [::Boolean] - # Optional. If set, validate the request and preview the review, but do not - # actually apply it. - # @param allow_missing [::Boolean] - # Optional. If set, and the workstation cluster is not found, a new - # workstation cluster will be created. In this situation, update_mask is - # ignored. - # @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/workstations/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Workstations::V1::Workstations::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Workstations::V1::UpdateWorkstationClusterRequest.new - # - # # Call the update_workstation_cluster method. - # result = client.update_workstation_cluster 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 update_workstation_cluster request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workstations::V1::UpdateWorkstationClusterRequest - - # Converts hash 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_workstation_cluster.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::Workstations::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_workstation_cluster.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_workstation_cluster.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @workstations_stub.update_workstation_cluster 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 the specified workstation cluster. - # - # @overload delete_workstation_cluster(request, options = nil) - # Pass arguments to `delete_workstation_cluster` via a request object, either of type - # {::Google::Cloud::Workstations::V1::DeleteWorkstationClusterRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Workstations::V1::DeleteWorkstationClusterRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_workstation_cluster(name: nil, validate_only: nil, etag: nil, force: nil) - # Pass arguments to `delete_workstation_cluster` via keyword arguments. Note that at - # least one keyword argument is 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 workstation cluster to delete. - # @param validate_only [::Boolean] - # Optional. If set, validate the request and preview the review, but do not - # apply it. - # @param etag [::String] - # Optional. If set, the request will be rejected if the latest version of the - # workstation cluster on the server does not have this ETag. - # @param force [::Boolean] - # Optional. If set, any workstation configurations and workstations in the - # workstation cluster are also deleted. Otherwise, the request only - # works if the workstation cluster has no configurations or workstations. - # @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/workstations/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Workstations::V1::Workstations::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Workstations::V1::DeleteWorkstationClusterRequest.new - # - # # Call the delete_workstation_cluster method. - # result = client.delete_workstation_cluster 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_workstation_cluster request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workstations::V1::DeleteWorkstationClusterRequest - - # Converts hash 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_workstation_cluster.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::Workstations::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_workstation_cluster.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_workstation_cluster.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @workstations_stub.delete_workstation_cluster 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 requested workstation configuration. - # - # @overload get_workstation_config(request, options = nil) - # Pass arguments to `get_workstation_config` via a request object, either of type - # {::Google::Cloud::Workstations::V1::GetWorkstationConfigRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Workstations::V1::GetWorkstationConfigRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_workstation_config(name: nil) - # Pass arguments to `get_workstation_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 requested resource. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Workstations::V1::WorkstationConfig] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Workstations::V1::WorkstationConfig] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/workstations/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Workstations::V1::Workstations::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Workstations::V1::GetWorkstationConfigRequest.new - # - # # Call the get_workstation_config method. - # result = client.get_workstation_config request - # - # # The returned object is of type Google::Cloud::Workstations::V1::WorkstationConfig. - # p result - # - def get_workstation_config request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workstations::V1::GetWorkstationConfigRequest - - # Converts hash 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_workstation_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::Workstations::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_workstation_config.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_workstation_config.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @workstations_stub.get_workstation_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 all workstation configurations in the specified cluster. - # - # @overload list_workstation_configs(request, options = nil) - # Pass arguments to `list_workstation_configs` via a request object, either of type - # {::Google::Cloud::Workstations::V1::ListWorkstationConfigsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Workstations::V1::ListWorkstationConfigsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_workstation_configs(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_workstation_configs` via keyword arguments. Note that at - # least one keyword argument is 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. Parent resource name. - # @param page_size [::Integer] - # Optional. Maximum number of items to return. - # @param page_token [::String] - # Optional. next_page_token value returned from a previous List request, if - # any. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Workstations::V1::WorkstationConfig>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Workstations::V1::WorkstationConfig>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/workstations/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Workstations::V1::Workstations::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Workstations::V1::ListWorkstationConfigsRequest.new - # - # # Call the list_workstation_configs method. - # result = client.list_workstation_configs 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::Workstations::V1::WorkstationConfig. - # p item - # end - # - def list_workstation_configs request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workstations::V1::ListWorkstationConfigsRequest - - # Converts hash 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_workstation_configs.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::Workstations::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_workstation_configs.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_workstation_configs.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @workstations_stub.list_workstation_configs request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @workstations_stub, :list_workstation_configs, "workstation_configs", 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 all workstation configurations in the specified cluster on which - # the caller has the "workstations.workstation.create" permission. - # - # @overload list_usable_workstation_configs(request, options = nil) - # Pass arguments to `list_usable_workstation_configs` via a request object, either of type - # {::Google::Cloud::Workstations::V1::ListUsableWorkstationConfigsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Workstations::V1::ListUsableWorkstationConfigsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_usable_workstation_configs(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_usable_workstation_configs` via keyword arguments. Note that at - # least one keyword argument is 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. Parent resource name. - # @param page_size [::Integer] - # Optional. Maximum number of items to return. - # @param page_token [::String] - # Optional. next_page_token value returned from a previous List request, if - # any. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Workstations::V1::WorkstationConfig>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Workstations::V1::WorkstationConfig>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/workstations/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Workstations::V1::Workstations::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Workstations::V1::ListUsableWorkstationConfigsRequest.new - # - # # Call the list_usable_workstation_configs method. - # result = client.list_usable_workstation_configs 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::Workstations::V1::WorkstationConfig. - # p item - # end - # - def list_usable_workstation_configs request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workstations::V1::ListUsableWorkstationConfigsRequest - - # Converts hash 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_usable_workstation_configs.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::Workstations::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_usable_workstation_configs.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_usable_workstation_configs.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @workstations_stub.list_usable_workstation_configs request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @workstations_stub, :list_usable_workstation_configs, "workstation_configs", 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 - - ## - # Creates a new workstation configuration. - # - # @overload create_workstation_config(request, options = nil) - # Pass arguments to `create_workstation_config` via a request object, either of type - # {::Google::Cloud::Workstations::V1::CreateWorkstationConfigRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Workstations::V1::CreateWorkstationConfigRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_workstation_config(parent: nil, workstation_config_id: nil, workstation_config: nil, validate_only: nil) - # Pass arguments to `create_workstation_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. Parent resource name. - # @param workstation_config_id [::String] - # Required. ID to use for the workstation configuration. - # @param workstation_config [::Google::Cloud::Workstations::V1::WorkstationConfig, ::Hash] - # Required. Config to create. - # @param validate_only [::Boolean] - # Optional. If set, validate the request and preview the review, but do not - # actually apply it. - # @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/workstations/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Workstations::V1::Workstations::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Workstations::V1::CreateWorkstationConfigRequest.new - # - # # Call the create_workstation_config method. - # result = client.create_workstation_config 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_workstation_config request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workstations::V1::CreateWorkstationConfigRequest - - # Converts hash 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_workstation_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::Workstations::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_workstation_config.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_workstation_config.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @workstations_stub.create_workstation_config 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 - - ## - # Updates an existing workstation configuration. - # - # @overload update_workstation_config(request, options = nil) - # Pass arguments to `update_workstation_config` via a request object, either of type - # {::Google::Cloud::Workstations::V1::UpdateWorkstationConfigRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Workstations::V1::UpdateWorkstationConfigRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_workstation_config(workstation_config: nil, update_mask: nil, validate_only: nil, allow_missing: nil) - # Pass arguments to `update_workstation_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 workstation_config [::Google::Cloud::Workstations::V1::WorkstationConfig, ::Hash] - # Required. Config to update. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Required. Mask specifying which fields in the workstation configuration - # should be updated. - # @param validate_only [::Boolean] - # Optional. If set, validate the request and preview the review, but do not - # actually apply it. - # @param allow_missing [::Boolean] - # Optional. If set and the workstation configuration is not found, a new - # workstation configuration will be created. In this situation, - # update_mask is ignored. - # @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/workstations/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Workstations::V1::Workstations::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Workstations::V1::UpdateWorkstationConfigRequest.new - # - # # Call the update_workstation_config method. - # result = client.update_workstation_config 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 update_workstation_config request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workstations::V1::UpdateWorkstationConfigRequest - - # Converts hash 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_workstation_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::Workstations::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_workstation_config.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_workstation_config.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @workstations_stub.update_workstation_config 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 the specified workstation configuration. - # - # @overload delete_workstation_config(request, options = nil) - # Pass arguments to `delete_workstation_config` via a request object, either of type - # {::Google::Cloud::Workstations::V1::DeleteWorkstationConfigRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Workstations::V1::DeleteWorkstationConfigRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_workstation_config(name: nil, validate_only: nil, etag: nil, force: nil) - # Pass arguments to `delete_workstation_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 workstation configuration to delete. - # @param validate_only [::Boolean] - # Optional. If set, validate the request and preview the review, but do not - # actually apply it. - # @param etag [::String] - # Optional. If set, the request is rejected if the latest version of the - # workstation configuration on the server does not have this ETag. - # @param force [::Boolean] - # Optional. If set, any workstations in the workstation configuration are - # also deleted. Otherwise, the request works only if the workstation - # configuration has no workstations. - # @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/workstations/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Workstations::V1::Workstations::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Workstations::V1::DeleteWorkstationConfigRequest.new - # - # # Call the delete_workstation_config method. - # result = client.delete_workstation_config 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_workstation_config request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workstations::V1::DeleteWorkstationConfigRequest - - # Converts hash 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_workstation_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::Workstations::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_workstation_config.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_workstation_config.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @workstations_stub.delete_workstation_config 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 requested workstation. - # - # @overload get_workstation(request, options = nil) - # Pass arguments to `get_workstation` via a request object, either of type - # {::Google::Cloud::Workstations::V1::GetWorkstationRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Workstations::V1::GetWorkstationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_workstation(name: nil) - # Pass arguments to `get_workstation` via keyword arguments. Note that at - # least one keyword argument is 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 requested resource. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Workstations::V1::Workstation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Workstations::V1::Workstation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/workstations/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Workstations::V1::Workstations::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Workstations::V1::GetWorkstationRequest.new - # - # # Call the get_workstation method. - # result = client.get_workstation request - # - # # The returned object is of type Google::Cloud::Workstations::V1::Workstation. - # p result - # - def get_workstation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workstations::V1::GetWorkstationRequest - - # Converts hash 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_workstation.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::Workstations::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_workstation.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_workstation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @workstations_stub.get_workstation 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 all Workstations using the specified workstation configuration. - # - # @overload list_workstations(request, options = nil) - # Pass arguments to `list_workstations` via a request object, either of type - # {::Google::Cloud::Workstations::V1::ListWorkstationsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Workstations::V1::ListWorkstationsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_workstations(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_workstations` via keyword arguments. Note that at - # least one keyword argument is 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. Parent resource name. - # @param page_size [::Integer] - # Optional. Maximum number of items to return. - # @param page_token [::String] - # Optional. next_page_token value returned from a previous List request, if - # any. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Workstations::V1::Workstation>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Workstations::V1::Workstation>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/workstations/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Workstations::V1::Workstations::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Workstations::V1::ListWorkstationsRequest.new - # - # # Call the list_workstations method. - # result = client.list_workstations 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::Workstations::V1::Workstation. - # p item - # end - # - def list_workstations request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workstations::V1::ListWorkstationsRequest - - # Converts hash 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_workstations.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::Workstations::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_workstations.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_workstations.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @workstations_stub.list_workstations request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @workstations_stub, :list_workstations, "workstations", 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 all workstations using the specified workstation configuration - # on which the caller has the "workstations.workstations.use" permission. - # - # @overload list_usable_workstations(request, options = nil) - # Pass arguments to `list_usable_workstations` via a request object, either of type - # {::Google::Cloud::Workstations::V1::ListUsableWorkstationsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Workstations::V1::ListUsableWorkstationsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_usable_workstations(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_usable_workstations` via keyword arguments. Note that at - # least one keyword argument is 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. Parent resource name. - # @param page_size [::Integer] - # Optional. Maximum number of items to return. - # @param page_token [::String] - # Optional. next_page_token value returned from a previous List request, if - # any. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Workstations::V1::Workstation>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Workstations::V1::Workstation>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/workstations/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Workstations::V1::Workstations::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Workstations::V1::ListUsableWorkstationsRequest.new - # - # # Call the list_usable_workstations method. - # result = client.list_usable_workstations 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::Workstations::V1::Workstation. - # p item - # end - # - def list_usable_workstations request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workstations::V1::ListUsableWorkstationsRequest - - # Converts hash 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_usable_workstations.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::Workstations::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_usable_workstations.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_usable_workstations.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @workstations_stub.list_usable_workstations request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @workstations_stub, :list_usable_workstations, "workstations", 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 - - ## - # Creates a new workstation. - # - # @overload create_workstation(request, options = nil) - # Pass arguments to `create_workstation` via a request object, either of type - # {::Google::Cloud::Workstations::V1::CreateWorkstationRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Workstations::V1::CreateWorkstationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_workstation(parent: nil, workstation_id: nil, workstation: nil, validate_only: nil) - # Pass arguments to `create_workstation` via keyword arguments. Note that at - # least one keyword argument is 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. Parent resource name. - # @param workstation_id [::String] - # Required. ID to use for the workstation. - # @param workstation [::Google::Cloud::Workstations::V1::Workstation, ::Hash] - # Required. Workstation to create. - # @param validate_only [::Boolean] - # Optional. If set, validate the request and preview the review, but do not - # actually apply it. - # @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/workstations/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Workstations::V1::Workstations::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Workstations::V1::CreateWorkstationRequest.new - # - # # Call the create_workstation method. - # result = client.create_workstation 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_workstation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workstations::V1::CreateWorkstationRequest - - # Converts hash 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_workstation.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::Workstations::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_workstation.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_workstation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @workstations_stub.create_workstation 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 - - ## - # Updates an existing workstation. - # - # @overload update_workstation(request, options = nil) - # Pass arguments to `update_workstation` via a request object, either of type - # {::Google::Cloud::Workstations::V1::UpdateWorkstationRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Workstations::V1::UpdateWorkstationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_workstation(workstation: nil, update_mask: nil, validate_only: nil, allow_missing: nil) - # Pass arguments to `update_workstation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param workstation [::Google::Cloud::Workstations::V1::Workstation, ::Hash] - # Required. Workstation to update. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Required. Mask specifying which fields in the workstation configuration - # should be updated. - # @param validate_only [::Boolean] - # Optional. If set, validate the request and preview the review, but do not - # actually apply it. - # @param allow_missing [::Boolean] - # Optional. If set and the workstation configuration is not found, a new - # workstation configuration is created. In this situation, update_mask - # is ignored. - # @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/workstations/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Workstations::V1::Workstations::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Workstations::V1::UpdateWorkstationRequest.new - # - # # Call the update_workstation method. - # result = client.update_workstation 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 update_workstation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workstations::V1::UpdateWorkstationRequest - - # Converts hash 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_workstation.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::Workstations::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_workstation.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_workstation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @workstations_stub.update_workstation 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 the specified workstation. - # - # @overload delete_workstation(request, options = nil) - # Pass arguments to `delete_workstation` via a request object, either of type - # {::Google::Cloud::Workstations::V1::DeleteWorkstationRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Workstations::V1::DeleteWorkstationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_workstation(name: nil, validate_only: nil, etag: nil) - # Pass arguments to `delete_workstation` via keyword arguments. Note that at - # least one keyword argument is 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 workstation to delete. - # @param validate_only [::Boolean] - # Optional. If set, validate the request and preview the review, but do not - # actually apply it. - # @param etag [::String] - # Optional. If set, the request will be rejected if the latest version of the - # workstation on the server does not have this ETag. - # @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/workstations/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Workstations::V1::Workstations::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Workstations::V1::DeleteWorkstationRequest.new - # - # # Call the delete_workstation method. - # result = client.delete_workstation 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_workstation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workstations::V1::DeleteWorkstationRequest - - # Converts hash 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_workstation.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::Workstations::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_workstation.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_workstation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @workstations_stub.delete_workstation 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 - - ## - # Starts running a workstation so that users can connect to it. - # - # @overload start_workstation(request, options = nil) - # Pass arguments to `start_workstation` via a request object, either of type - # {::Google::Cloud::Workstations::V1::StartWorkstationRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Workstations::V1::StartWorkstationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload start_workstation(name: nil, validate_only: nil, etag: nil) - # Pass arguments to `start_workstation` via keyword arguments. Note that at - # least one keyword argument is 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 workstation to start. - # @param validate_only [::Boolean] - # Optional. If set, validate the request and preview the review, but do not - # actually apply it. - # @param etag [::String] - # Optional. If set, the request will be rejected if the latest version of the - # workstation on the server does not have this ETag. - # @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/workstations/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Workstations::V1::Workstations::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Workstations::V1::StartWorkstationRequest.new - # - # # Call the start_workstation method. - # result = client.start_workstation 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 start_workstation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workstations::V1::StartWorkstationRequest - - # Converts hash 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.start_workstation.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::Workstations::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.start_workstation.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.start_workstation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @workstations_stub.start_workstation 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 - - ## - # Stops running a workstation, reducing costs. - # - # @overload stop_workstation(request, options = nil) - # Pass arguments to `stop_workstation` via a request object, either of type - # {::Google::Cloud::Workstations::V1::StopWorkstationRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Workstations::V1::StopWorkstationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload stop_workstation(name: nil, validate_only: nil, etag: nil) - # Pass arguments to `stop_workstation` via keyword arguments. Note that at - # least one keyword argument is 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 workstation to stop. - # @param validate_only [::Boolean] - # Optional. If set, validate the request and preview the review, but do not - # actually apply it. - # @param etag [::String] - # Optional. If set, the request will be rejected if the latest version of the - # workstation on the server does not have this ETag. - # @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/workstations/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Workstations::V1::Workstations::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Workstations::V1::StopWorkstationRequest.new - # - # # Call the stop_workstation method. - # result = client.stop_workstation 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 stop_workstation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workstations::V1::StopWorkstationRequest - - # Converts hash 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.stop_workstation.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::Workstations::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.stop_workstation.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.stop_workstation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @workstations_stub.stop_workstation 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 a short-lived credential that can be used to send authenticated and - # authorized traffic to a workstation. - # - # @overload generate_access_token(request, options = nil) - # Pass arguments to `generate_access_token` via a request object, either of type - # {::Google::Cloud::Workstations::V1::GenerateAccessTokenRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Workstations::V1::GenerateAccessTokenRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_access_token(expire_time: nil, ttl: nil, workstation: nil) - # Pass arguments to `generate_access_token` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param expire_time [::Google::Protobuf::Timestamp, ::Hash] - # Desired expiration time of the access token. This value must - # be at most 24 hours in the future. If a value is not specified, the - # token's expiration time will be set to a default value of 1 hour in the - # future. - # - # Note: The following parameters are mutually exclusive: `expire_time`, `ttl`. 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 ttl [::Google::Protobuf::Duration, ::Hash] - # Desired lifetime duration of the access token. This value must - # be at most 24 hours. If a value is not specified, the token's lifetime - # will be set to a default value of 1 hour. - # - # Note: The following parameters are mutually exclusive: `ttl`, `expire_time`. 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 workstation [::String] - # Required. Name of the workstation for which the access token should be - # generated. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Workstations::V1::GenerateAccessTokenResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Workstations::V1::GenerateAccessTokenResponse] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/workstations/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Workstations::V1::Workstations::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Workstations::V1::GenerateAccessTokenRequest.new - # - # # Call the generate_access_token method. - # result = client.generate_access_token request - # - # # The returned object is of type Google::Cloud::Workstations::V1::GenerateAccessTokenResponse. - # p result - # - def generate_access_token request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workstations::V1::GenerateAccessTokenRequest - - # Converts hash 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_access_token.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::Workstations::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_access_token.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.generate_access_token.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @workstations_stub.generate_access_token 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 Workstations REST API. - # - # This class represents the configuration for Workstations 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::Workstations::V1::Workstations::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 - # # get_workstation_cluster to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Workstations::V1::Workstations::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.get_workstation_cluster.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Workstations::V1::Workstations::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.get_workstation_cluster.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 = "workstations.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 Workstations 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 `get_workstation_cluster` - # @return [::Gapic::Config::Method] - # - attr_reader :get_workstation_cluster - ## - # RPC-specific configuration for `list_workstation_clusters` - # @return [::Gapic::Config::Method] - # - attr_reader :list_workstation_clusters - ## - # RPC-specific configuration for `create_workstation_cluster` - # @return [::Gapic::Config::Method] - # - attr_reader :create_workstation_cluster - ## - # RPC-specific configuration for `update_workstation_cluster` - # @return [::Gapic::Config::Method] - # - attr_reader :update_workstation_cluster - ## - # RPC-specific configuration for `delete_workstation_cluster` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_workstation_cluster - ## - # RPC-specific configuration for `get_workstation_config` - # @return [::Gapic::Config::Method] - # - attr_reader :get_workstation_config - ## - # RPC-specific configuration for `list_workstation_configs` - # @return [::Gapic::Config::Method] - # - attr_reader :list_workstation_configs - ## - # RPC-specific configuration for `list_usable_workstation_configs` - # @return [::Gapic::Config::Method] - # - attr_reader :list_usable_workstation_configs - ## - # RPC-specific configuration for `create_workstation_config` - # @return [::Gapic::Config::Method] - # - attr_reader :create_workstation_config - ## - # RPC-specific configuration for `update_workstation_config` - # @return [::Gapic::Config::Method] - # - attr_reader :update_workstation_config - ## - # RPC-specific configuration for `delete_workstation_config` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_workstation_config - ## - # RPC-specific configuration for `get_workstation` - # @return [::Gapic::Config::Method] - # - attr_reader :get_workstation - ## - # RPC-specific configuration for `list_workstations` - # @return [::Gapic::Config::Method] - # - attr_reader :list_workstations - ## - # RPC-specific configuration for `list_usable_workstations` - # @return [::Gapic::Config::Method] - # - attr_reader :list_usable_workstations - ## - # RPC-specific configuration for `create_workstation` - # @return [::Gapic::Config::Method] - # - attr_reader :create_workstation - ## - # RPC-specific configuration for `update_workstation` - # @return [::Gapic::Config::Method] - # - attr_reader :update_workstation - ## - # RPC-specific configuration for `delete_workstation` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_workstation - ## - # RPC-specific configuration for `start_workstation` - # @return [::Gapic::Config::Method] - # - attr_reader :start_workstation - ## - # RPC-specific configuration for `stop_workstation` - # @return [::Gapic::Config::Method] - # - attr_reader :stop_workstation - ## - # RPC-specific configuration for `generate_access_token` - # @return [::Gapic::Config::Method] - # - attr_reader :generate_access_token - - # @private - def initialize parent_rpcs = nil - get_workstation_cluster_config = parent_rpcs.get_workstation_cluster if parent_rpcs.respond_to? :get_workstation_cluster - @get_workstation_cluster = ::Gapic::Config::Method.new get_workstation_cluster_config - list_workstation_clusters_config = parent_rpcs.list_workstation_clusters if parent_rpcs.respond_to? :list_workstation_clusters - @list_workstation_clusters = ::Gapic::Config::Method.new list_workstation_clusters_config - create_workstation_cluster_config = parent_rpcs.create_workstation_cluster if parent_rpcs.respond_to? :create_workstation_cluster - @create_workstation_cluster = ::Gapic::Config::Method.new create_workstation_cluster_config - update_workstation_cluster_config = parent_rpcs.update_workstation_cluster if parent_rpcs.respond_to? :update_workstation_cluster - @update_workstation_cluster = ::Gapic::Config::Method.new update_workstation_cluster_config - delete_workstation_cluster_config = parent_rpcs.delete_workstation_cluster if parent_rpcs.respond_to? :delete_workstation_cluster - @delete_workstation_cluster = ::Gapic::Config::Method.new delete_workstation_cluster_config - get_workstation_config_config = parent_rpcs.get_workstation_config if parent_rpcs.respond_to? :get_workstation_config - @get_workstation_config = ::Gapic::Config::Method.new get_workstation_config_config - list_workstation_configs_config = parent_rpcs.list_workstation_configs if parent_rpcs.respond_to? :list_workstation_configs - @list_workstation_configs = ::Gapic::Config::Method.new list_workstation_configs_config - list_usable_workstation_configs_config = parent_rpcs.list_usable_workstation_configs if parent_rpcs.respond_to? :list_usable_workstation_configs - @list_usable_workstation_configs = ::Gapic::Config::Method.new list_usable_workstation_configs_config - create_workstation_config_config = parent_rpcs.create_workstation_config if parent_rpcs.respond_to? :create_workstation_config - @create_workstation_config = ::Gapic::Config::Method.new create_workstation_config_config - update_workstation_config_config = parent_rpcs.update_workstation_config if parent_rpcs.respond_to? :update_workstation_config - @update_workstation_config = ::Gapic::Config::Method.new update_workstation_config_config - delete_workstation_config_config = parent_rpcs.delete_workstation_config if parent_rpcs.respond_to? :delete_workstation_config - @delete_workstation_config = ::Gapic::Config::Method.new delete_workstation_config_config - get_workstation_config = parent_rpcs.get_workstation if parent_rpcs.respond_to? :get_workstation - @get_workstation = ::Gapic::Config::Method.new get_workstation_config - list_workstations_config = parent_rpcs.list_workstations if parent_rpcs.respond_to? :list_workstations - @list_workstations = ::Gapic::Config::Method.new list_workstations_config - list_usable_workstations_config = parent_rpcs.list_usable_workstations if parent_rpcs.respond_to? :list_usable_workstations - @list_usable_workstations = ::Gapic::Config::Method.new list_usable_workstations_config - create_workstation_config = parent_rpcs.create_workstation if parent_rpcs.respond_to? :create_workstation - @create_workstation = ::Gapic::Config::Method.new create_workstation_config - update_workstation_config = parent_rpcs.update_workstation if parent_rpcs.respond_to? :update_workstation - @update_workstation = ::Gapic::Config::Method.new update_workstation_config - delete_workstation_config = parent_rpcs.delete_workstation if parent_rpcs.respond_to? :delete_workstation - @delete_workstation = ::Gapic::Config::Method.new delete_workstation_config - start_workstation_config = parent_rpcs.start_workstation if parent_rpcs.respond_to? :start_workstation - @start_workstation = ::Gapic::Config::Method.new start_workstation_config - stop_workstation_config = parent_rpcs.stop_workstation if parent_rpcs.respond_to? :stop_workstation - @stop_workstation = ::Gapic::Config::Method.new stop_workstation_config - generate_access_token_config = parent_rpcs.generate_access_token if parent_rpcs.respond_to? :generate_access_token - @generate_access_token = ::Gapic::Config::Method.new generate_access_token_config - - yield self if block_given? - end - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-workstations-v1/lib/google/cloud/workstations/v1/workstations/rest/operations.rb b/owl-bot-staging/google-cloud-workstations-v1/lib/google/cloud/workstations/v1/workstations/rest/operations.rb deleted file mode 100644 index 5408543aa712..000000000000 --- a/owl-bot-staging/google-cloud-workstations-v1/lib/google/cloud/workstations/v1/workstations/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 Workstations - module V1 - module Workstations - module Rest - # Service that implements Longrunning Operations API. - class Operations - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "workstations.$UNIVERSE_DOMAIN$" - - # @private - attr_reader :operations_stub - - ## - # Configuration for the Workstations 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 Workstations 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::Workstations::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::Workstations::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::Workstations::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::Workstations::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 = "workstations.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}/operations", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/?$}, 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{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] - ] - ) - 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{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-workstations-v1/lib/google/cloud/workstations/v1/workstations/rest/service_stub.rb b/owl-bot-staging/google-cloud-workstations-v1/lib/google/cloud/workstations/v1/workstations/rest/service_stub.rb deleted file mode 100644 index 420e199f7069..000000000000 --- a/owl-bot-staging/google-cloud-workstations-v1/lib/google/cloud/workstations/v1/workstations/rest/service_stub.rb +++ /dev/null @@ -1,1310 +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/workstations/v1/workstations_pb" - -module Google - module Cloud - module Workstations - module V1 - module Workstations - module Rest - ## - # REST service stub for the Workstations 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 get_workstation_cluster REST call - # - # @param request_pb [::Google::Cloud::Workstations::V1::GetWorkstationClusterRequest] - # 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::Workstations::V1::WorkstationCluster] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Workstations::V1::WorkstationCluster] - # A result object deserialized from the server's reply - def get_workstation_cluster request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_workstation_cluster_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_workstation_cluster", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Workstations::V1::WorkstationCluster.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_workstation_clusters REST call - # - # @param request_pb [::Google::Cloud::Workstations::V1::ListWorkstationClustersRequest] - # 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::Workstations::V1::ListWorkstationClustersResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Workstations::V1::ListWorkstationClustersResponse] - # A result object deserialized from the server's reply - def list_workstation_clusters request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_workstation_clusters_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_workstation_clusters", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Workstations::V1::ListWorkstationClustersResponse.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_workstation_cluster REST call - # - # @param request_pb [::Google::Cloud::Workstations::V1::CreateWorkstationClusterRequest] - # 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_workstation_cluster request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_workstation_cluster_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_workstation_cluster", - 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 update_workstation_cluster REST call - # - # @param request_pb [::Google::Cloud::Workstations::V1::UpdateWorkstationClusterRequest] - # 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 update_workstation_cluster request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_workstation_cluster_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_workstation_cluster", - 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_workstation_cluster REST call - # - # @param request_pb [::Google::Cloud::Workstations::V1::DeleteWorkstationClusterRequest] - # 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_workstation_cluster request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_delete_workstation_cluster_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_workstation_cluster", - 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_workstation_config REST call - # - # @param request_pb [::Google::Cloud::Workstations::V1::GetWorkstationConfigRequest] - # 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::Workstations::V1::WorkstationConfig] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Workstations::V1::WorkstationConfig] - # A result object deserialized from the server's reply - def get_workstation_config request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_workstation_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_workstation_config", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Workstations::V1::WorkstationConfig.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_workstation_configs REST call - # - # @param request_pb [::Google::Cloud::Workstations::V1::ListWorkstationConfigsRequest] - # 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::Workstations::V1::ListWorkstationConfigsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Workstations::V1::ListWorkstationConfigsResponse] - # A result object deserialized from the server's reply - def list_workstation_configs request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_workstation_configs_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_workstation_configs", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Workstations::V1::ListWorkstationConfigsResponse.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_usable_workstation_configs REST call - # - # @param request_pb [::Google::Cloud::Workstations::V1::ListUsableWorkstationConfigsRequest] - # 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::Workstations::V1::ListUsableWorkstationConfigsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Workstations::V1::ListUsableWorkstationConfigsResponse] - # A result object deserialized from the server's reply - def list_usable_workstation_configs request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_usable_workstation_configs_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_usable_workstation_configs", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Workstations::V1::ListUsableWorkstationConfigsResponse.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_workstation_config REST call - # - # @param request_pb [::Google::Cloud::Workstations::V1::CreateWorkstationConfigRequest] - # 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_workstation_config request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_workstation_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: "create_workstation_config", - 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 update_workstation_config REST call - # - # @param request_pb [::Google::Cloud::Workstations::V1::UpdateWorkstationConfigRequest] - # 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 update_workstation_config request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_workstation_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_workstation_config", - 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_workstation_config REST call - # - # @param request_pb [::Google::Cloud::Workstations::V1::DeleteWorkstationConfigRequest] - # 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_workstation_config request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_delete_workstation_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: "delete_workstation_config", - 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_workstation REST call - # - # @param request_pb [::Google::Cloud::Workstations::V1::GetWorkstationRequest] - # 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::Workstations::V1::Workstation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Workstations::V1::Workstation] - # A result object deserialized from the server's reply - def get_workstation request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_workstation_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_workstation", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Workstations::V1::Workstation.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_workstations REST call - # - # @param request_pb [::Google::Cloud::Workstations::V1::ListWorkstationsRequest] - # 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::Workstations::V1::ListWorkstationsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Workstations::V1::ListWorkstationsResponse] - # A result object deserialized from the server's reply - def list_workstations request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_workstations_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_workstations", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Workstations::V1::ListWorkstationsResponse.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_usable_workstations REST call - # - # @param request_pb [::Google::Cloud::Workstations::V1::ListUsableWorkstationsRequest] - # 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::Workstations::V1::ListUsableWorkstationsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Workstations::V1::ListUsableWorkstationsResponse] - # A result object deserialized from the server's reply - def list_usable_workstations request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_usable_workstations_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_usable_workstations", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Workstations::V1::ListUsableWorkstationsResponse.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_workstation REST call - # - # @param request_pb [::Google::Cloud::Workstations::V1::CreateWorkstationRequest] - # 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_workstation request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_workstation_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_workstation", - 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 update_workstation REST call - # - # @param request_pb [::Google::Cloud::Workstations::V1::UpdateWorkstationRequest] - # 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 update_workstation request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_workstation_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_workstation", - 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_workstation REST call - # - # @param request_pb [::Google::Cloud::Workstations::V1::DeleteWorkstationRequest] - # 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_workstation request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_delete_workstation_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_workstation", - 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 start_workstation REST call - # - # @param request_pb [::Google::Cloud::Workstations::V1::StartWorkstationRequest] - # 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 start_workstation request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_start_workstation_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: "start_workstation", - 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 stop_workstation REST call - # - # @param request_pb [::Google::Cloud::Workstations::V1::StopWorkstationRequest] - # 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 stop_workstation request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_stop_workstation_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: "stop_workstation", - 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 generate_access_token REST call - # - # @param request_pb [::Google::Cloud::Workstations::V1::GenerateAccessTokenRequest] - # 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::Workstations::V1::GenerateAccessTokenResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Workstations::V1::GenerateAccessTokenResponse] - # A result object deserialized from the server's reply - def generate_access_token request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_generate_access_token_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_access_token", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Workstations::V1::GenerateAccessTokenResponse.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 get_workstation_cluster REST call - # - # @param request_pb [::Google::Cloud::Workstations::V1::GetWorkstationClusterRequest] - # 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_workstation_cluster_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/workstationClusters/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_workstation_clusters REST call - # - # @param request_pb [::Google::Cloud::Workstations::V1::ListWorkstationClustersRequest] - # 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_workstation_clusters_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/workstationClusters", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the create_workstation_cluster REST call - # - # @param request_pb [::Google::Cloud::Workstations::V1::CreateWorkstationClusterRequest] - # 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_workstation_cluster_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}/workstationClusters", - body: "workstation_cluster", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_workstation_cluster REST call - # - # @param request_pb [::Google::Cloud::Workstations::V1::UpdateWorkstationClusterRequest] - # 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_workstation_cluster_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v1/{workstation_cluster.name}", - body: "workstation_cluster", - matches: [ - ["workstation_cluster.name", %r{^projects/[^/]+/locations/[^/]+/workstationClusters/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_workstation_cluster REST call - # - # @param request_pb [::Google::Cloud::Workstations::V1::DeleteWorkstationClusterRequest] - # 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_workstation_cluster_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/workstationClusters/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_workstation_config REST call - # - # @param request_pb [::Google::Cloud::Workstations::V1::GetWorkstationConfigRequest] - # 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_workstation_config_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/workstationClusters/[^/]+/workstationConfigs/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_workstation_configs REST call - # - # @param request_pb [::Google::Cloud::Workstations::V1::ListWorkstationConfigsRequest] - # 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_workstation_configs_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/workstationConfigs", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/workstationClusters/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_usable_workstation_configs REST call - # - # @param request_pb [::Google::Cloud::Workstations::V1::ListUsableWorkstationConfigsRequest] - # 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_usable_workstation_configs_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/workstationConfigs:listUsable", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/workstationClusters/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the create_workstation_config REST call - # - # @param request_pb [::Google::Cloud::Workstations::V1::CreateWorkstationConfigRequest] - # 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_workstation_config_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}/workstationConfigs", - body: "workstation_config", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/workstationClusters/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_workstation_config REST call - # - # @param request_pb [::Google::Cloud::Workstations::V1::UpdateWorkstationConfigRequest] - # 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_workstation_config_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v1/{workstation_config.name}", - body: "workstation_config", - matches: [ - ["workstation_config.name", %r{^projects/[^/]+/locations/[^/]+/workstationClusters/[^/]+/workstationConfigs/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_workstation_config REST call - # - # @param request_pb [::Google::Cloud::Workstations::V1::DeleteWorkstationConfigRequest] - # 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_workstation_config_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/workstationClusters/[^/]+/workstationConfigs/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_workstation REST call - # - # @param request_pb [::Google::Cloud::Workstations::V1::GetWorkstationRequest] - # 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_workstation_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/workstationClusters/[^/]+/workstationConfigs/[^/]+/workstations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_workstations REST call - # - # @param request_pb [::Google::Cloud::Workstations::V1::ListWorkstationsRequest] - # 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_workstations_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/workstations", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/workstationClusters/[^/]+/workstationConfigs/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_usable_workstations REST call - # - # @param request_pb [::Google::Cloud::Workstations::V1::ListUsableWorkstationsRequest] - # 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_usable_workstations_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1/{parent}/workstations:listUsable", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/workstationClusters/[^/]+/workstationConfigs/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the create_workstation REST call - # - # @param request_pb [::Google::Cloud::Workstations::V1::CreateWorkstationRequest] - # 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_workstation_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{parent}/workstations", - body: "workstation", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/workstationClusters/[^/]+/workstationConfigs/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_workstation REST call - # - # @param request_pb [::Google::Cloud::Workstations::V1::UpdateWorkstationRequest] - # 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_workstation_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v1/{workstation.name}", - body: "workstation", - matches: [ - ["workstation.name", %r{^projects/[^/]+/locations/[^/]+/workstationClusters/[^/]+/workstationConfigs/[^/]+/workstations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_workstation REST call - # - # @param request_pb [::Google::Cloud::Workstations::V1::DeleteWorkstationRequest] - # 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_workstation_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v1/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/workstationClusters/[^/]+/workstationConfigs/[^/]+/workstations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the start_workstation REST call - # - # @param request_pb [::Google::Cloud::Workstations::V1::StartWorkstationRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_start_workstation_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:start", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/workstationClusters/[^/]+/workstationConfigs/[^/]+/workstations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the stop_workstation REST call - # - # @param request_pb [::Google::Cloud::Workstations::V1::StopWorkstationRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_stop_workstation_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:stop", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/workstationClusters/[^/]+/workstationConfigs/[^/]+/workstations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the generate_access_token REST call - # - # @param request_pb [::Google::Cloud::Workstations::V1::GenerateAccessTokenRequest] - # 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_access_token_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{workstation}:generateAccessToken", - body: "*", - matches: [ - ["workstation", %r{^projects/[^/]+/locations/[^/]+/workstationClusters/[^/]+/workstationConfigs/[^/]+/workstations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-workstations-v1/lib/google/cloud/workstations/v1/workstations_pb.rb b/owl-bot-staging/google-cloud-workstations-v1/lib/google/cloud/workstations/v1/workstations_pb.rb deleted file mode 100644 index 609d86ca1a68..000000000000 --- a/owl-bot-staging/google-cloud-workstations-v1/lib/google/cloud/workstations/v1/workstations_pb.rb +++ /dev/null @@ -1,72 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/workstations/v1/workstations.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/field_mask_pb' -require 'google/protobuf/timestamp_pb' -require 'google/rpc/status_pb' - - -descriptor_data = "\n/google/cloud/workstations/v1/workstations.proto\x12\x1cgoogle.cloud.workstations.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 google/protobuf/field_mask.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x17google/rpc/status.proto\"\x87\t\n\x12WorkstationCluster\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x19\n\x0c\x64isplay_name\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x10\n\x03uid\x18\x03 \x01(\tB\x03\xe0\x41\x03\x12\x18\n\x0breconciling\x18\x04 \x01(\x08\x42\x03\xe0\x41\x03\x12[\n\x0b\x61nnotations\x18\x05 \x03(\x0b\x32\x41.google.cloud.workstations.v1.WorkstationCluster.AnnotationsEntryB\x03\xe0\x41\x01\x12Q\n\x06labels\x18\x0f \x03(\x0b\x32<.google.cloud.workstations.v1.WorkstationCluster.LabelsEntryB\x03\xe0\x41\x01\x12\x34\n\x0b\x63reate_time\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0b\x64\x65lete_time\x18\x08 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x11\n\x04\x65tag\x18\t \x01(\tB\x03\xe0\x41\x01\x12\x14\n\x07network\x18\n \x01(\tB\x03\xe0\x41\x05\x12\x17\n\nsubnetwork\x18\x0b \x01(\tB\x03\xe0\x41\x05\x12\x1d\n\x10\x63ontrol_plane_ip\x18\x10 \x01(\tB\x03\xe0\x41\x03\x12j\n\x16private_cluster_config\x18\x0c \x01(\x0b\x32\x45.google.cloud.workstations.v1.WorkstationCluster.PrivateClusterConfigB\x03\xe0\x41\x01\x12\x15\n\x08\x64\x65graded\x18\r \x01(\x08\x42\x03\xe0\x41\x03\x12+\n\nconditions\x18\x0e \x03(\x0b\x32\x12.google.rpc.StatusB\x03\xe0\x41\x03\x1a\x9f\x01\n\x14PrivateClusterConfig\x12$\n\x17\x65nable_private_endpoint\x18\x01 \x01(\x08\x42\x03\xe0\x41\x05\x12\x1d\n\x10\x63luster_hostname\x18\x02 \x01(\tB\x03\xe0\x41\x03\x12#\n\x16service_attachment_uri\x18\x03 \x01(\tB\x03\xe0\x41\x03\x12\x1d\n\x10\x61llowed_projects\x18\x04 \x03(\tB\x03\xe0\x41\x01\x1a\x32\n\x10\x41nnotationsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01:\xb3\x01\xea\x41\xaf\x01\n.workstations.googleapis.com/WorkstationCluster\x12Qprojects/{project}/locations/{location}/workstationClusters/{workstation_cluster}*\x13workstationClusters2\x12workstationClusterR\x01\x01\"\xb2\x19\n\x11WorkstationConfig\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x19\n\x0c\x64isplay_name\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x10\n\x03uid\x18\x03 \x01(\tB\x03\xe0\x41\x03\x12\x18\n\x0breconciling\x18\x04 \x01(\x08\x42\x03\xe0\x41\x03\x12Z\n\x0b\x61nnotations\x18\x05 \x03(\x0b\x32@.google.cloud.workstations.v1.WorkstationConfig.AnnotationsEntryB\x03\xe0\x41\x01\x12P\n\x06labels\x18\x12 \x03(\x0b\x32;.google.cloud.workstations.v1.WorkstationConfig.LabelsEntryB\x03\xe0\x41\x01\x12\x34\n\x0b\x63reate_time\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0b\x64\x65lete_time\x18\x08 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x11\n\x04\x65tag\x18\t \x01(\tB\x03\xe0\x41\x01\x12\x34\n\x0cidle_timeout\x18\n \x01(\x0b\x32\x19.google.protobuf.DurationB\x03\xe0\x41\x01\x12\x37\n\x0frunning_timeout\x18\x0b \x01(\x0b\x32\x19.google.protobuf.DurationB\x03\xe0\x41\x01\x12G\n\x04host\x18\x0c \x01(\x0b\x32\x34.google.cloud.workstations.v1.WorkstationConfig.HostB\x03\xe0\x41\x01\x12h\n\x16persistent_directories\x18\r \x03(\x0b\x32\x43.google.cloud.workstations.v1.WorkstationConfig.PersistentDirectoryB\x03\xe0\x41\x01\x12Q\n\tcontainer\x18\x0e \x01(\x0b\x32\x39.google.cloud.workstations.v1.WorkstationConfig.ContainerB\x03\xe0\x41\x01\x12\x62\n\x0e\x65ncryption_key\x18\x11 \x01(\x0b\x32\x45.google.cloud.workstations.v1.WorkstationConfig.CustomerEncryptionKeyB\x03\xe0\x41\x05\x12]\n\x10readiness_checks\x18\x13 \x03(\x0b\x32>.google.cloud.workstations.v1.WorkstationConfig.ReadinessCheckB\x03\xe0\x41\x01\x12\x1d\n\rreplica_zones\x18\x17 \x03(\tB\x06\xe0\x41\x01\xe0\x41\x05\x12\x15\n\x08\x64\x65graded\x18\x0f \x01(\x08\x42\x03\xe0\x41\x03\x12+\n\nconditions\x18\x10 \x03(\x0b\x32\x12.google.rpc.StatusB\x03\xe0\x41\x03\x1a\xf5\x06\n\x04Host\x12X\n\x0cgce_instance\x18\x01 \x01(\x0b\x32@.google.cloud.workstations.v1.WorkstationConfig.Host.GceInstanceH\x00\x1a\x88\x06\n\x0bGceInstance\x12\x19\n\x0cmachine_type\x18\x01 \x01(\tB\x03\xe0\x41\x01\x12\x1c\n\x0fservice_account\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12#\n\x16service_account_scopes\x18\x03 \x03(\tB\x03\xe0\x41\x01\x12\x11\n\x04tags\x18\x04 \x03(\tB\x03\xe0\x41\x01\x12\x16\n\tpool_size\x18\x05 \x01(\x05\x42\x03\xe0\x41\x01\x12\x1d\n\x10pooled_instances\x18\x0c \x01(\x05\x42\x03\xe0\x41\x03\x12(\n\x1b\x64isable_public_ip_addresses\x18\x06 \x01(\x08\x42\x03\xe0\x41\x01\x12)\n\x1c\x65nable_nested_virtualization\x18\x07 \x01(\x08\x42\x03\xe0\x41\x01\x12\x81\x01\n\x18shielded_instance_config\x18\x08 \x01(\x0b\x32Z.google.cloud.workstations.v1.WorkstationConfig.Host.GceInstance.GceShieldedInstanceConfigB\x03\xe0\x41\x01\x12\x89\x01\n\x1c\x63onfidential_instance_config\x18\n \x01(\x0b\x32^.google.cloud.workstations.v1.WorkstationConfig.Host.GceInstance.GceConfidentialInstanceConfigB\x03\xe0\x41\x01\x12\x1e\n\x11\x62oot_disk_size_gb\x18\t \x01(\x05\x42\x03\xe0\x41\x01\x1a\x80\x01\n\x19GceShieldedInstanceConfig\x12\x1f\n\x12\x65nable_secure_boot\x18\x01 \x01(\x08\x42\x03\xe0\x41\x01\x12\x18\n\x0b\x65nable_vtpm\x18\x02 \x01(\x08\x42\x03\xe0\x41\x01\x12(\n\x1b\x65nable_integrity_monitoring\x18\x03 \x01(\x08\x42\x03\xe0\x41\x01\x1aI\n\x1dGceConfidentialInstanceConfig\x12(\n\x1b\x65nable_confidential_compute\x18\x01 \x01(\x08\x42\x03\xe0\x41\x01\x42\x08\n\x06\x63onfig\x1a\x85\x04\n\x13PersistentDirectory\x12o\n\x06gce_pd\x18\x02 \x01(\x0b\x32].google.cloud.workstations.v1.WorkstationConfig.PersistentDirectory.GceRegionalPersistentDiskH\x00\x12\x17\n\nmount_path\x18\x01 \x01(\tB\x03\xe0\x41\x01\x1a\xd1\x02\n\x19GceRegionalPersistentDisk\x12\x14\n\x07size_gb\x18\x01 \x01(\x05\x42\x03\xe0\x41\x01\x12\x14\n\x07\x66s_type\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x16\n\tdisk_type\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12\x1c\n\x0fsource_snapshot\x18\x05 \x01(\tB\x03\xe0\x41\x01\x12\x88\x01\n\x0ereclaim_policy\x18\x04 \x01(\x0e\x32k.google.cloud.workstations.v1.WorkstationConfig.PersistentDirectory.GceRegionalPersistentDisk.ReclaimPolicyB\x03\xe0\x41\x01\"G\n\rReclaimPolicy\x12\x1e\n\x1aRECLAIM_POLICY_UNSPECIFIED\x10\x00\x12\n\n\x06\x44\x45LETE\x10\x01\x12\n\n\x06RETAIN\x10\x02\x42\x10\n\x0e\x64irectory_type\x1a\xfe\x01\n\tContainer\x12\x12\n\x05image\x18\x01 \x01(\tB\x03\xe0\x41\x01\x12\x14\n\x07\x63ommand\x18\x02 \x03(\tB\x03\xe0\x41\x01\x12\x11\n\x04\x61rgs\x18\x03 \x03(\tB\x03\xe0\x41\x01\x12T\n\x03\x65nv\x18\x04 \x03(\x0b\x32\x42.google.cloud.workstations.v1.WorkstationConfig.Container.EnvEntryB\x03\xe0\x41\x01\x12\x18\n\x0bworking_dir\x18\x05 \x01(\tB\x03\xe0\x41\x01\x12\x18\n\x0brun_as_user\x18\x06 \x01(\x05\x42\x03\xe0\x41\x01\x1a*\n\x08\x45nvEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1aS\n\x15\x43ustomerEncryptionKey\x12\x14\n\x07kms_key\x18\x01 \x01(\tB\x03\xe0\x41\x05\x12$\n\x17kms_key_service_account\x18\x02 \x01(\tB\x03\xe0\x41\x05\x1a\x36\n\x0eReadinessCheck\x12\x11\n\x04path\x18\x01 \x01(\tB\x03\xe0\x41\x01\x12\x11\n\x04port\x18\x02 \x01(\x05\x42\x03\xe0\x41\x01\x1a\x32\n\x10\x41nnotationsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01:\xd8\x01\xea\x41\xd4\x01\n-workstations.googleapis.com/WorkstationConfig\x12yprojects/{project}/locations/{location}/workstationClusters/{workstation_cluster}/workstationConfigs/{workstation_config}*\x12workstationConfigs2\x11workstationConfigR\x01\x01\"\xfc\x07\n\x0bWorkstation\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x19\n\x0c\x64isplay_name\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x10\n\x03uid\x18\x03 \x01(\tB\x03\xe0\x41\x03\x12\x18\n\x0breconciling\x18\x04 \x01(\x08\x42\x03\xe0\x41\x03\x12T\n\x0b\x61nnotations\x18\x05 \x03(\x0b\x32:.google.cloud.workstations.v1.Workstation.AnnotationsEntryB\x03\xe0\x41\x01\x12J\n\x06labels\x18\r \x03(\x0b\x32\x35.google.cloud.workstations.v1.Workstation.LabelsEntryB\x03\xe0\x41\x01\x12\x34\n\x0b\x63reate_time\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x33\n\nstart_time\x18\x0e \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0b\x64\x65lete_time\x18\x08 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x11\n\x04\x65tag\x18\t \x01(\tB\x03\xe0\x41\x01\x12\x43\n\x05state\x18\n \x01(\x0e\x32/.google.cloud.workstations.v1.Workstation.StateB\x03\xe0\x41\x03\x12\x11\n\x04host\x18\x0b \x01(\tB\x03\xe0\x41\x03\x1a\x32\n\x10\x41nnotationsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"l\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x12\n\x0eSTATE_STARTING\x10\x01\x12\x11\n\rSTATE_RUNNING\x10\x02\x12\x12\n\x0eSTATE_STOPPING\x10\x03\x12\x11\n\rSTATE_STOPPED\x10\x04:\xe2\x01\xea\x41\xde\x01\n\'workstations.googleapis.com/Workstation\x12\x94\x01projects/{project}/locations/{location}/workstationClusters/{workstation_cluster}/workstationConfigs/{workstation_config}/workstations/{workstation}*\x0cworkstations2\x0bworkstationR\x01\x01\"d\n\x1cGetWorkstationClusterRequest\x12\x44\n\x04name\x18\x01 \x01(\tB6\xe0\x41\x02\xfa\x41\x30\n.workstations.googleapis.com/WorkstationCluster\"\x99\x01\n\x1eListWorkstationClustersRequest\x12\x46\n\x06parent\x18\x01 \x01(\tB6\xe0\x41\x02\xfa\x41\x30\x12.workstations.googleapis.com/WorkstationCluster\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\"\x9f\x01\n\x1fListWorkstationClustersResponse\x12N\n\x14workstation_clusters\x18\x01 \x03(\x0b\x32\x30.google.cloud.workstations.v1.WorkstationCluster\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x13\n\x0bunreachable\x18\x03 \x03(\t\"\xfe\x01\n\x1f\x43reateWorkstationClusterRequest\x12\x46\n\x06parent\x18\x01 \x01(\tB6\xe0\x41\x02\xfa\x41\x30\x12.workstations.googleapis.com/WorkstationCluster\x12#\n\x16workstation_cluster_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12R\n\x13workstation_cluster\x18\x03 \x01(\x0b\x32\x30.google.cloud.workstations.v1.WorkstationClusterB\x03\xe0\x41\x02\x12\x1a\n\rvalidate_only\x18\x04 \x01(\x08\x42\x03\xe0\x41\x01\"\xe3\x01\n\x1fUpdateWorkstationClusterRequest\x12R\n\x13workstation_cluster\x18\x01 \x01(\x0b\x32\x30.google.cloud.workstations.v1.WorkstationClusterB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\x12\x1a\n\rvalidate_only\x18\x03 \x01(\x08\x42\x03\xe0\x41\x01\x12\x1a\n\rallow_missing\x18\x04 \x01(\x08\x42\x03\xe0\x41\x01\"\xaa\x01\n\x1f\x44\x65leteWorkstationClusterRequest\x12\x44\n\x04name\x18\x01 \x01(\tB6\xe0\x41\x02\xfa\x41\x30\n.workstations.googleapis.com/WorkstationCluster\x12\x1a\n\rvalidate_only\x18\x02 \x01(\x08\x42\x03\xe0\x41\x01\x12\x11\n\x04\x65tag\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12\x12\n\x05\x66orce\x18\x04 \x01(\x08\x42\x03\xe0\x41\x01\"b\n\x1bGetWorkstationConfigRequest\x12\x43\n\x04name\x18\x01 \x01(\tB5\xe0\x41\x02\xfa\x41/\n-workstations.googleapis.com/WorkstationConfig\"\x98\x01\n\x1dListWorkstationConfigsRequest\x12\x46\n\x06parent\x18\x01 \x01(\tB6\xe0\x41\x02\xfa\x41\x30\n.workstations.googleapis.com/WorkstationCluster\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\"\x9c\x01\n\x1eListWorkstationConfigsResponse\x12L\n\x13workstation_configs\x18\x01 \x03(\x0b\x32/.google.cloud.workstations.v1.WorkstationConfig\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x13\n\x0bunreachable\x18\x03 \x03(\t\"\x9e\x01\n#ListUsableWorkstationConfigsRequest\x12\x46\n\x06parent\x18\x01 \x01(\tB6\xe0\x41\x02\xfa\x41\x30\n.workstations.googleapis.com/WorkstationCluster\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\"\xa2\x01\n$ListUsableWorkstationConfigsResponse\x12L\n\x13workstation_configs\x18\x01 \x03(\x0b\x32/.google.cloud.workstations.v1.WorkstationConfig\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x13\n\x0bunreachable\x18\x03 \x03(\t\"\xfa\x01\n\x1e\x43reateWorkstationConfigRequest\x12\x46\n\x06parent\x18\x01 \x01(\tB6\xe0\x41\x02\xfa\x41\x30\n.workstations.googleapis.com/WorkstationCluster\x12\"\n\x15workstation_config_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12P\n\x12workstation_config\x18\x03 \x01(\x0b\x32/.google.cloud.workstations.v1.WorkstationConfigB\x03\xe0\x41\x02\x12\x1a\n\rvalidate_only\x18\x04 \x01(\x08\x42\x03\xe0\x41\x01\"\xe0\x01\n\x1eUpdateWorkstationConfigRequest\x12P\n\x12workstation_config\x18\x01 \x01(\x0b\x32/.google.cloud.workstations.v1.WorkstationConfigB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\x12\x1a\n\rvalidate_only\x18\x03 \x01(\x08\x42\x03\xe0\x41\x01\x12\x1a\n\rallow_missing\x18\x04 \x01(\x08\x42\x03\xe0\x41\x01\"\xa8\x01\n\x1e\x44\x65leteWorkstationConfigRequest\x12\x43\n\x04name\x18\x01 \x01(\tB5\xe0\x41\x02\xfa\x41/\n-workstations.googleapis.com/WorkstationConfig\x12\x1a\n\rvalidate_only\x18\x02 \x01(\x08\x42\x03\xe0\x41\x01\x12\x11\n\x04\x65tag\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12\x12\n\x05\x66orce\x18\x04 \x01(\x08\x42\x03\xe0\x41\x01\"V\n\x15GetWorkstationRequest\x12=\n\x04name\x18\x01 \x01(\tB/\xe0\x41\x02\xfa\x41)\n\'workstations.googleapis.com/Workstation\"\x91\x01\n\x17ListWorkstationsRequest\x12\x45\n\x06parent\x18\x01 \x01(\tB5\xe0\x41\x02\xfa\x41/\n-workstations.googleapis.com/WorkstationConfig\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\"\x93\x01\n\x18ListWorkstationsResponse\x12?\n\x0cworkstations\x18\x01 \x03(\x0b\x32).google.cloud.workstations.v1.Workstation\x12\x1c\n\x0fnext_page_token\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x18\n\x0bunreachable\x18\x03 \x03(\tB\x03\xe0\x41\x01\"\x97\x01\n\x1dListUsableWorkstationsRequest\x12\x45\n\x06parent\x18\x01 \x01(\tB5\xe0\x41\x02\xfa\x41/\n-workstations.googleapis.com/WorkstationConfig\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\"\x8f\x01\n\x1eListUsableWorkstationsResponse\x12?\n\x0cworkstations\x18\x01 \x03(\x0b\x32).google.cloud.workstations.v1.Workstation\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x13\n\x0bunreachable\x18\x03 \x03(\t\"\xdf\x01\n\x18\x43reateWorkstationRequest\x12\x45\n\x06parent\x18\x01 \x01(\tB5\xe0\x41\x02\xfa\x41/\n-workstations.googleapis.com/WorkstationConfig\x12\x1b\n\x0eworkstation_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x43\n\x0bworkstation\x18\x03 \x01(\x0b\x32).google.cloud.workstations.v1.WorkstationB\x03\xe0\x41\x02\x12\x1a\n\rvalidate_only\x18\x04 \x01(\x08\x42\x03\xe0\x41\x01\"\xcd\x01\n\x18UpdateWorkstationRequest\x12\x43\n\x0bworkstation\x18\x01 \x01(\x0b\x32).google.cloud.workstations.v1.WorkstationB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\x12\x1a\n\rvalidate_only\x18\x03 \x01(\x08\x42\x03\xe0\x41\x01\x12\x1a\n\rallow_missing\x18\x04 \x01(\x08\x42\x03\xe0\x41\x01\"\x88\x01\n\x18\x44\x65leteWorkstationRequest\x12=\n\x04name\x18\x01 \x01(\tB/\xe0\x41\x02\xfa\x41)\n\'workstations.googleapis.com/Workstation\x12\x1a\n\rvalidate_only\x18\x02 \x01(\x08\x42\x03\xe0\x41\x01\x12\x11\n\x04\x65tag\x18\x03 \x01(\tB\x03\xe0\x41\x01\"\x87\x01\n\x17StartWorkstationRequest\x12=\n\x04name\x18\x01 \x01(\tB/\xe0\x41\x02\xfa\x41)\n\'workstations.googleapis.com/Workstation\x12\x1a\n\rvalidate_only\x18\x02 \x01(\x08\x42\x03\xe0\x41\x01\x12\x11\n\x04\x65tag\x18\x03 \x01(\tB\x03\xe0\x41\x01\"\x86\x01\n\x16StopWorkstationRequest\x12=\n\x04name\x18\x01 \x01(\tB/\xe0\x41\x02\xfa\x41)\n\'workstations.googleapis.com/Workstation\x12\x1a\n\rvalidate_only\x18\x02 \x01(\x08\x42\x03\xe0\x41\x01\x12\x11\n\x04\x65tag\x18\x03 \x01(\tB\x03\xe0\x41\x01\"\xcd\x01\n\x1aGenerateAccessTokenRequest\x12\x31\n\x0b\x65xpire_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampH\x00\x12(\n\x03ttl\x18\x03 \x01(\x0b\x32\x19.google.protobuf.DurationH\x00\x12\x44\n\x0bworkstation\x18\x01 \x01(\tB/\xe0\x41\x02\xfa\x41)\n\'workstations.googleapis.com/WorkstationB\x0c\n\nexpiration\"d\n\x1bGenerateAccessTokenResponse\x12\x14\n\x0c\x61\x63\x63\x65ss_token\x18\x01 \x01(\t\x12/\n\x0b\x65xpire_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"\x80\x02\n\x11OperationMetadata\x12\x34\n\x0b\x63reate_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x31\n\x08\x65nd_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x13\n\x06target\x18\x03 \x01(\tB\x03\xe0\x41\x03\x12\x11\n\x04verb\x18\x04 \x01(\tB\x03\xe0\x41\x03\x12\x1b\n\x0estatus_message\x18\x05 \x01(\tB\x03\xe0\x41\x03\x12#\n\x16requested_cancellation\x18\x06 \x01(\x08\x42\x03\xe0\x41\x03\x12\x18\n\x0b\x61pi_version\x18\x07 \x01(\tB\x03\xe0\x41\x03\x32\x9b*\n\x0cWorkstations\x12\xcd\x01\n\x15GetWorkstationCluster\x12:.google.cloud.workstations.v1.GetWorkstationClusterRequest\x1a\x30.google.cloud.workstations.v1.WorkstationCluster\"F\xda\x41\x04name\x82\xd3\xe4\x93\x02\x39\x12\x37/v1/{name=projects/*/locations/*/workstationClusters/*}\x12\xe0\x01\n\x17ListWorkstationClusters\x12<.google.cloud.workstations.v1.ListWorkstationClustersRequest\x1a=.google.cloud.workstations.v1.ListWorkstationClustersResponse\"H\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x39\x12\x37/v1/{parent=projects/*/locations/*}/workstationClusters\x12\xad\x02\n\x18\x43reateWorkstationCluster\x12=.google.cloud.workstations.v1.CreateWorkstationClusterRequest\x1a\x1d.google.longrunning.Operation\"\xb2\x01\xca\x41\'\n\x12WorkstationCluster\x12\x11OperationMetadata\xda\x41\x31parent,workstation_cluster,workstation_cluster_id\x82\xd3\xe4\x93\x02N\"7/v1/{parent=projects/*/locations/*}/workstationClusters:\x13workstation_cluster\x12\xaf\x02\n\x18UpdateWorkstationCluster\x12=.google.cloud.workstations.v1.UpdateWorkstationClusterRequest\x1a\x1d.google.longrunning.Operation\"\xb4\x01\xca\x41\'\n\x12WorkstationCluster\x12\x11OperationMetadata\xda\x41\x1fworkstation_cluster,update_mask\x82\xd3\xe4\x93\x02\x62\x32K/v1/{workstation_cluster.name=projects/*/locations/*/workstationClusters/*}:\x13workstation_cluster\x12\xea\x01\n\x18\x44\x65leteWorkstationCluster\x12=.google.cloud.workstations.v1.DeleteWorkstationClusterRequest\x1a\x1d.google.longrunning.Operation\"p\xca\x41\'\n\x12WorkstationCluster\x12\x11OperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02\x39*7/v1/{name=projects/*/locations/*/workstationClusters/*}\x12\xdf\x01\n\x14GetWorkstationConfig\x12\x39.google.cloud.workstations.v1.GetWorkstationConfigRequest\x1a/.google.cloud.workstations.v1.WorkstationConfig\"[\xda\x41\x04name\x82\xd3\xe4\x93\x02N\x12L/v1/{name=projects/*/locations/*/workstationClusters/*/workstationConfigs/*}\x12\xf2\x01\n\x16ListWorkstationConfigs\x12;.google.cloud.workstations.v1.ListWorkstationConfigsRequest\x1a<.google.cloud.workstations.v1.ListWorkstationConfigsResponse\"]\xda\x41\x06parent\x82\xd3\xe4\x93\x02N\x12L/v1/{parent=projects/*/locations/*/workstationClusters/*}/workstationConfigs\x12\x8f\x02\n\x1cListUsableWorkstationConfigs\x12\x41.google.cloud.workstations.v1.ListUsableWorkstationConfigsRequest\x1a\x42.google.cloud.workstations.v1.ListUsableWorkstationConfigsResponse\"h\xda\x41\x06parent\x82\xd3\xe4\x93\x02Y\x12W/v1/{parent=projects/*/locations/*/workstationClusters/*}/workstationConfigs:listUsable\x12\xbc\x02\n\x17\x43reateWorkstationConfig\x12<.google.cloud.workstations.v1.CreateWorkstationConfigRequest\x1a\x1d.google.longrunning.Operation\"\xc3\x01\xca\x41&\n\x11WorkstationConfig\x12\x11OperationMetadata\xda\x41/parent,workstation_config,workstation_config_id\x82\xd3\xe4\x93\x02\x62\"L/v1/{parent=projects/*/locations/*/workstationClusters/*}/workstationConfigs:\x12workstation_config\x12\xbe\x02\n\x17UpdateWorkstationConfig\x12<.google.cloud.workstations.v1.UpdateWorkstationConfigRequest\x1a\x1d.google.longrunning.Operation\"\xc5\x01\xca\x41&\n\x11WorkstationConfig\x12\x11OperationMetadata\xda\x41\x1eworkstation_config,update_mask\x82\xd3\xe4\x93\x02u2_/v1/{workstation_config.name=projects/*/locations/*/workstationClusters/*/workstationConfigs/*}:\x12workstation_config\x12\xfd\x01\n\x17\x44\x65leteWorkstationConfig\x12<.google.cloud.workstations.v1.DeleteWorkstationConfigRequest\x1a\x1d.google.longrunning.Operation\"\x84\x01\xca\x41&\n\x11WorkstationConfig\x12\x11OperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02N*L/v1/{name=projects/*/locations/*/workstationClusters/*/workstationConfigs/*}\x12\xdc\x01\n\x0eGetWorkstation\x12\x33.google.cloud.workstations.v1.GetWorkstationRequest\x1a).google.cloud.workstations.v1.Workstation\"j\xda\x41\x04name\x82\xd3\xe4\x93\x02]\x12[/v1/{name=projects/*/locations/*/workstationClusters/*/workstationConfigs/*/workstations/*}\x12\xef\x01\n\x10ListWorkstations\x12\x35.google.cloud.workstations.v1.ListWorkstationsRequest\x1a\x36.google.cloud.workstations.v1.ListWorkstationsResponse\"l\xda\x41\x06parent\x82\xd3\xe4\x93\x02]\x12[/v1/{parent=projects/*/locations/*/workstationClusters/*/workstationConfigs/*}/workstations\x12\x8c\x02\n\x16ListUsableWorkstations\x12;.google.cloud.workstations.v1.ListUsableWorkstationsRequest\x1a<.google.cloud.workstations.v1.ListUsableWorkstationsResponse\"w\xda\x41\x06parent\x82\xd3\xe4\x93\x02h\x12\x66/v1/{parent=projects/*/locations/*/workstationClusters/*/workstationConfigs/*}/workstations:listUsable\x12\xa4\x02\n\x11\x43reateWorkstation\x12\x36.google.cloud.workstations.v1.CreateWorkstationRequest\x1a\x1d.google.longrunning.Operation\"\xb7\x01\xca\x41 \n\x0bWorkstation\x12\x11OperationMetadata\xda\x41!parent,workstation,workstation_id\x82\xd3\xe4\x93\x02j\"[/v1/{parent=projects/*/locations/*/workstationClusters/*/workstationConfigs/*}/workstations:\x0bworkstation\x12\xa6\x02\n\x11UpdateWorkstation\x12\x36.google.cloud.workstations.v1.UpdateWorkstationRequest\x1a\x1d.google.longrunning.Operation\"\xb9\x01\xca\x41 \n\x0bWorkstation\x12\x11OperationMetadata\xda\x41\x17workstation,update_mask\x82\xd3\xe4\x93\x02v2g/v1/{workstation.name=projects/*/locations/*/workstationClusters/*/workstationConfigs/*/workstations/*}:\x0bworkstation\x12\xfa\x01\n\x11\x44\x65leteWorkstation\x12\x36.google.cloud.workstations.v1.DeleteWorkstationRequest\x1a\x1d.google.longrunning.Operation\"\x8d\x01\xca\x41 \n\x0bWorkstation\x12\x11OperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02]*[/v1/{name=projects/*/locations/*/workstationClusters/*/workstationConfigs/*/workstations/*}\x12\x81\x02\n\x10StartWorkstation\x12\x35.google.cloud.workstations.v1.StartWorkstationRequest\x1a\x1d.google.longrunning.Operation\"\x96\x01\xca\x41 \n\x0bWorkstation\x12\x11OperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02\x66\"a/v1/{name=projects/*/locations/*/workstationClusters/*/workstationConfigs/*/workstations/*}:start:\x01*\x12\xfe\x01\n\x0fStopWorkstation\x12\x34.google.cloud.workstations.v1.StopWorkstationRequest\x1a\x1d.google.longrunning.Operation\"\x95\x01\xca\x41 \n\x0bWorkstation\x12\x11OperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02\x65\"`/v1/{name=projects/*/locations/*/workstationClusters/*/workstationConfigs/*/workstations/*}:stop:\x01*\x12\x9c\x02\n\x13GenerateAccessToken\x12\x38.google.cloud.workstations.v1.GenerateAccessTokenRequest\x1a\x39.google.cloud.workstations.v1.GenerateAccessTokenResponse\"\x8f\x01\xda\x41\x0bworkstation\x82\xd3\xe4\x93\x02{\"v/v1/{workstation=projects/*/locations/*/workstationClusters/*/workstationConfigs/*/workstations/*}:generateAccessToken:\x01*\x1aO\xca\x41\x1bworkstations.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB}\n com.google.cloud.workstations.v1B\x11WorkstationsProtoP\x01ZDcloud.google.com/go/workstations/apiv1/workstationspb;workstationspbb\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module Workstations - module V1 - WorkstationCluster = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.workstations.v1.WorkstationCluster").msgclass - WorkstationCluster::PrivateClusterConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.workstations.v1.WorkstationCluster.PrivateClusterConfig").msgclass - WorkstationConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.workstations.v1.WorkstationConfig").msgclass - WorkstationConfig::Host = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.workstations.v1.WorkstationConfig.Host").msgclass - WorkstationConfig::Host::GceInstance = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.workstations.v1.WorkstationConfig.Host.GceInstance").msgclass - WorkstationConfig::Host::GceInstance::GceShieldedInstanceConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.workstations.v1.WorkstationConfig.Host.GceInstance.GceShieldedInstanceConfig").msgclass - WorkstationConfig::Host::GceInstance::GceConfidentialInstanceConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.workstations.v1.WorkstationConfig.Host.GceInstance.GceConfidentialInstanceConfig").msgclass - WorkstationConfig::PersistentDirectory = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.workstations.v1.WorkstationConfig.PersistentDirectory").msgclass - WorkstationConfig::PersistentDirectory::GceRegionalPersistentDisk = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.workstations.v1.WorkstationConfig.PersistentDirectory.GceRegionalPersistentDisk").msgclass - WorkstationConfig::PersistentDirectory::GceRegionalPersistentDisk::ReclaimPolicy = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.workstations.v1.WorkstationConfig.PersistentDirectory.GceRegionalPersistentDisk.ReclaimPolicy").enummodule - WorkstationConfig::Container = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.workstations.v1.WorkstationConfig.Container").msgclass - WorkstationConfig::CustomerEncryptionKey = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.workstations.v1.WorkstationConfig.CustomerEncryptionKey").msgclass - WorkstationConfig::ReadinessCheck = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.workstations.v1.WorkstationConfig.ReadinessCheck").msgclass - Workstation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.workstations.v1.Workstation").msgclass - Workstation::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.workstations.v1.Workstation.State").enummodule - GetWorkstationClusterRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.workstations.v1.GetWorkstationClusterRequest").msgclass - ListWorkstationClustersRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.workstations.v1.ListWorkstationClustersRequest").msgclass - ListWorkstationClustersResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.workstations.v1.ListWorkstationClustersResponse").msgclass - CreateWorkstationClusterRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.workstations.v1.CreateWorkstationClusterRequest").msgclass - UpdateWorkstationClusterRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.workstations.v1.UpdateWorkstationClusterRequest").msgclass - DeleteWorkstationClusterRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.workstations.v1.DeleteWorkstationClusterRequest").msgclass - GetWorkstationConfigRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.workstations.v1.GetWorkstationConfigRequest").msgclass - ListWorkstationConfigsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.workstations.v1.ListWorkstationConfigsRequest").msgclass - ListWorkstationConfigsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.workstations.v1.ListWorkstationConfigsResponse").msgclass - ListUsableWorkstationConfigsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.workstations.v1.ListUsableWorkstationConfigsRequest").msgclass - ListUsableWorkstationConfigsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.workstations.v1.ListUsableWorkstationConfigsResponse").msgclass - CreateWorkstationConfigRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.workstations.v1.CreateWorkstationConfigRequest").msgclass - UpdateWorkstationConfigRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.workstations.v1.UpdateWorkstationConfigRequest").msgclass - DeleteWorkstationConfigRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.workstations.v1.DeleteWorkstationConfigRequest").msgclass - GetWorkstationRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.workstations.v1.GetWorkstationRequest").msgclass - ListWorkstationsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.workstations.v1.ListWorkstationsRequest").msgclass - ListWorkstationsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.workstations.v1.ListWorkstationsResponse").msgclass - ListUsableWorkstationsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.workstations.v1.ListUsableWorkstationsRequest").msgclass - ListUsableWorkstationsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.workstations.v1.ListUsableWorkstationsResponse").msgclass - CreateWorkstationRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.workstations.v1.CreateWorkstationRequest").msgclass - UpdateWorkstationRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.workstations.v1.UpdateWorkstationRequest").msgclass - DeleteWorkstationRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.workstations.v1.DeleteWorkstationRequest").msgclass - StartWorkstationRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.workstations.v1.StartWorkstationRequest").msgclass - StopWorkstationRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.workstations.v1.StopWorkstationRequest").msgclass - GenerateAccessTokenRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.workstations.v1.GenerateAccessTokenRequest").msgclass - GenerateAccessTokenResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.workstations.v1.GenerateAccessTokenResponse").msgclass - OperationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.workstations.v1.OperationMetadata").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-workstations-v1/lib/google/cloud/workstations/v1/workstations_services_pb.rb b/owl-bot-staging/google-cloud-workstations-v1/lib/google/cloud/workstations/v1/workstations_services_pb.rb deleted file mode 100644 index 023403299d59..000000000000 --- a/owl-bot-staging/google-cloud-workstations-v1/lib/google/cloud/workstations/v1/workstations_services_pb.rb +++ /dev/null @@ -1,86 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# Source: google/cloud/workstations/v1/workstations.proto for package 'google.cloud.workstations.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/workstations/v1/workstations_pb' - -module Google - module Cloud - module Workstations - module V1 - module Workstations - # Service for interacting with Cloud Workstations. - class Service - - include ::GRPC::GenericService - - self.marshal_class_method = :encode - self.unmarshal_class_method = :decode - self.service_name = 'google.cloud.workstations.v1.Workstations' - - # Returns the requested workstation cluster. - rpc :GetWorkstationCluster, ::Google::Cloud::Workstations::V1::GetWorkstationClusterRequest, ::Google::Cloud::Workstations::V1::WorkstationCluster - # Returns all workstation clusters in the specified location. - rpc :ListWorkstationClusters, ::Google::Cloud::Workstations::V1::ListWorkstationClustersRequest, ::Google::Cloud::Workstations::V1::ListWorkstationClustersResponse - # Creates a new workstation cluster. - rpc :CreateWorkstationCluster, ::Google::Cloud::Workstations::V1::CreateWorkstationClusterRequest, ::Google::Longrunning::Operation - # Updates an existing workstation cluster. - rpc :UpdateWorkstationCluster, ::Google::Cloud::Workstations::V1::UpdateWorkstationClusterRequest, ::Google::Longrunning::Operation - # Deletes the specified workstation cluster. - rpc :DeleteWorkstationCluster, ::Google::Cloud::Workstations::V1::DeleteWorkstationClusterRequest, ::Google::Longrunning::Operation - # Returns the requested workstation configuration. - rpc :GetWorkstationConfig, ::Google::Cloud::Workstations::V1::GetWorkstationConfigRequest, ::Google::Cloud::Workstations::V1::WorkstationConfig - # Returns all workstation configurations in the specified cluster. - rpc :ListWorkstationConfigs, ::Google::Cloud::Workstations::V1::ListWorkstationConfigsRequest, ::Google::Cloud::Workstations::V1::ListWorkstationConfigsResponse - # Returns all workstation configurations in the specified cluster on which - # the caller has the "workstations.workstation.create" permission. - rpc :ListUsableWorkstationConfigs, ::Google::Cloud::Workstations::V1::ListUsableWorkstationConfigsRequest, ::Google::Cloud::Workstations::V1::ListUsableWorkstationConfigsResponse - # Creates a new workstation configuration. - rpc :CreateWorkstationConfig, ::Google::Cloud::Workstations::V1::CreateWorkstationConfigRequest, ::Google::Longrunning::Operation - # Updates an existing workstation configuration. - rpc :UpdateWorkstationConfig, ::Google::Cloud::Workstations::V1::UpdateWorkstationConfigRequest, ::Google::Longrunning::Operation - # Deletes the specified workstation configuration. - rpc :DeleteWorkstationConfig, ::Google::Cloud::Workstations::V1::DeleteWorkstationConfigRequest, ::Google::Longrunning::Operation - # Returns the requested workstation. - rpc :GetWorkstation, ::Google::Cloud::Workstations::V1::GetWorkstationRequest, ::Google::Cloud::Workstations::V1::Workstation - # Returns all Workstations using the specified workstation configuration. - rpc :ListWorkstations, ::Google::Cloud::Workstations::V1::ListWorkstationsRequest, ::Google::Cloud::Workstations::V1::ListWorkstationsResponse - # Returns all workstations using the specified workstation configuration - # on which the caller has the "workstations.workstations.use" permission. - rpc :ListUsableWorkstations, ::Google::Cloud::Workstations::V1::ListUsableWorkstationsRequest, ::Google::Cloud::Workstations::V1::ListUsableWorkstationsResponse - # Creates a new workstation. - rpc :CreateWorkstation, ::Google::Cloud::Workstations::V1::CreateWorkstationRequest, ::Google::Longrunning::Operation - # Updates an existing workstation. - rpc :UpdateWorkstation, ::Google::Cloud::Workstations::V1::UpdateWorkstationRequest, ::Google::Longrunning::Operation - # Deletes the specified workstation. - rpc :DeleteWorkstation, ::Google::Cloud::Workstations::V1::DeleteWorkstationRequest, ::Google::Longrunning::Operation - # Starts running a workstation so that users can connect to it. - rpc :StartWorkstation, ::Google::Cloud::Workstations::V1::StartWorkstationRequest, ::Google::Longrunning::Operation - # Stops running a workstation, reducing costs. - rpc :StopWorkstation, ::Google::Cloud::Workstations::V1::StopWorkstationRequest, ::Google::Longrunning::Operation - # Returns a short-lived credential that can be used to send authenticated and - # authorized traffic to a workstation. - rpc :GenerateAccessToken, ::Google::Cloud::Workstations::V1::GenerateAccessTokenRequest, ::Google::Cloud::Workstations::V1::GenerateAccessTokenResponse - end - - Stub = Service.rpc_stub_class - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-workstations-v1/proto_docs/README.md b/owl-bot-staging/google-cloud-workstations-v1/proto_docs/README.md deleted file mode 100644 index 4081c926988b..000000000000 --- a/owl-bot-staging/google-cloud-workstations-v1/proto_docs/README.md +++ /dev/null @@ -1,4 +0,0 @@ -# Cloud Workstations 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-workstations-v1/proto_docs/google/api/client.rb b/owl-bot-staging/google-cloud-workstations-v1/proto_docs/google/api/client.rb deleted file mode 100644 index 3ab0b096d445..000000000000 --- a/owl-bot-staging/google-cloud-workstations-v1/proto_docs/google/api/client.rb +++ /dev/null @@ -1,593 +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. - # - # Note: This field should not be used in most cases. - 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: - # library_settings: - # 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. - # @!attribute [rw] library_package - # @return [::String] - # The package name to use in Php. Clobbers the php_namespace option - # set in the protobuf. This should be used **only** by APIs - # who have already set the language_settings.php.package_name" field - # in gapic.yaml. API teams should use the protobuf php_namespace option - # where possible. - # - # Example of a YAML configuration:: - # - # publishing: - # library_settings: - # php_settings: - # library_package: Google\Cloud\PubSub\V1 - 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. - # - # Example: - # - # 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 - # @!attribute [rw] batching - # @return [::Google::Api::BatchingConfigProto] - # Batching configuration for an API method in client libraries. - # - # Example of a YAML configuration: - # - # publishing: - # method_settings: - # - selector: google.example.v1.ExampleService.BatchCreateExample - # batching: - # element_count_threshold: 1000 - # request_byte_threshold: 100000000 - # delay_threshold_millis: 10 - 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. - # - # Note: This feature should not be used in most cases. - # @!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 - - # `BatchingConfigProto` defines the batching configuration for an API method. - # @!attribute [rw] thresholds - # @return [::Google::Api::BatchingSettingsProto] - # The thresholds which trigger a batched request to be sent. - # @!attribute [rw] batch_descriptor - # @return [::Google::Api::BatchingDescriptorProto] - # The request and response fields used in batching. - class BatchingConfigProto - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # `BatchingSettingsProto` specifies a set of batching thresholds, each of - # which acts as a trigger to send a batch of messages as a request. At least - # one threshold must be positive nonzero. - # @!attribute [rw] element_count_threshold - # @return [::Integer] - # The number of elements of a field collected into a batch which, if - # exceeded, causes the batch to be sent. - # @!attribute [rw] request_byte_threshold - # @return [::Integer] - # The aggregated size of the batched field which, if exceeded, causes the - # batch to be sent. This size is computed by aggregating the sizes of the - # request field to be batched, not of the entire request message. - # @!attribute [rw] delay_threshold - # @return [::Google::Protobuf::Duration] - # The duration after which a batch should be sent, starting from the addition - # of the first message to that batch. - # @!attribute [rw] element_count_limit - # @return [::Integer] - # The maximum number of elements collected in a batch that could be accepted - # by server. - # @!attribute [rw] request_byte_limit - # @return [::Integer] - # The maximum size of the request that could be accepted by server. - # @!attribute [rw] flow_control_element_limit - # @return [::Integer] - # The maximum number of elements allowed by flow control. - # @!attribute [rw] flow_control_byte_limit - # @return [::Integer] - # The maximum size of data allowed by flow control. - # @!attribute [rw] flow_control_limit_exceeded_behavior - # @return [::Google::Api::FlowControlLimitExceededBehaviorProto] - # The behavior to take when the flow control limit is exceeded. - class BatchingSettingsProto - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # `BatchingDescriptorProto` specifies the fields of the request message to be - # used for batching, and, optionally, the fields of the response message to be - # used for demultiplexing. - # @!attribute [rw] batched_field - # @return [::String] - # The repeated field in the request message to be aggregated by batching. - # @!attribute [rw] discriminator_fields - # @return [::Array<::String>] - # A list of the fields in the request message. Two requests will be batched - # together only if the values of every field specified in - # `request_discriminator_fields` is equal between the two requests. - # @!attribute [rw] subresponse_field - # @return [::String] - # Optional. When present, indicates the field in the response message to be - # used to demultiplex the response into multiple response messages, in - # correspondence with the multiple request messages originally batched - # together. - class BatchingDescriptorProto - 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 - - # The behavior to take when the flow control limit is exceeded. - module FlowControlLimitExceededBehaviorProto - # Default behavior, system-defined. - UNSET_BEHAVIOR = 0 - - # Stop operation, raise error. - THROW_EXCEPTION = 1 - - # Pause operation until limit clears. - BLOCK = 2 - - # Continue operation, disregard limit. - IGNORE = 3 - end - end -end diff --git a/owl-bot-staging/google-cloud-workstations-v1/proto_docs/google/api/field_behavior.rb b/owl-bot-staging/google-cloud-workstations-v1/proto_docs/google/api/field_behavior.rb deleted file mode 100644 index 582be187d115..000000000000 --- a/owl-bot-staging/google-cloud-workstations-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-workstations-v1/proto_docs/google/api/launch_stage.rb b/owl-bot-staging/google-cloud-workstations-v1/proto_docs/google/api/launch_stage.rb deleted file mode 100644 index 9392a413fb1b..000000000000 --- a/owl-bot-staging/google-cloud-workstations-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-workstations-v1/proto_docs/google/api/resource.rb b/owl-bot-staging/google-cloud-workstations-v1/proto_docs/google/api/resource.rb deleted file mode 100644 index 25dec4847ac1..000000000000 --- a/owl-bot-staging/google-cloud-workstations-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-workstations-v1/proto_docs/google/cloud/workstations/v1/workstations.rb b/owl-bot-staging/google-cloud-workstations-v1/proto_docs/google/cloud/workstations/v1/workstations.rb deleted file mode 100644 index 97b65f828112..000000000000 --- a/owl-bot-staging/google-cloud-workstations-v1/proto_docs/google/cloud/workstations/v1/workstations.rb +++ /dev/null @@ -1,1177 +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 Workstations - module V1 - # A workstation cluster resource in the Cloud Workstations API. - # - # Defines a group of workstations in a particular region and the - # VPC network they're attached to. - # @!attribute [rw] name - # @return [::String] - # Full name of this workstation cluster. - # @!attribute [rw] display_name - # @return [::String] - # Optional. Human-readable name for this workstation cluster. - # @!attribute [r] uid - # @return [::String] - # Output only. A system-assigned unique identifier for this workstation - # cluster. - # @!attribute [r] reconciling - # @return [::Boolean] - # Output only. Indicates whether this workstation cluster is currently being - # updated to match its intended state. - # @!attribute [rw] annotations - # @return [::Google::Protobuf::Map{::String => ::String}] - # Optional. Client-specified annotations. - # @!attribute [rw] labels - # @return [::Google::Protobuf::Map{::String => ::String}] - # Optional. - # [Labels](https://cloud.google.com/workstations/docs/label-resources) that - # are applied to the workstation cluster and that are also propagated to the - # underlying Compute Engine resources. - # @!attribute [r] create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. Time when this workstation cluster was created. - # @!attribute [r] update_time - # @return [::Google::Protobuf::Timestamp] - # Output only. Time when this workstation cluster was most recently updated. - # @!attribute [r] delete_time - # @return [::Google::Protobuf::Timestamp] - # Output only. Time when this workstation cluster was soft-deleted. - # @!attribute [rw] etag - # @return [::String] - # Optional. Checksum computed by the server. May be sent on update and delete - # requests to make sure that the client has an up-to-date value before - # proceeding. - # @!attribute [rw] network - # @return [::String] - # Immutable. Name of the Compute Engine network in which instances associated - # with this workstation cluster will be created. - # @!attribute [rw] subnetwork - # @return [::String] - # Immutable. Name of the Compute Engine subnetwork in which instances - # associated with this workstation cluster will be created. Must be part of - # the subnetwork specified for this workstation cluster. - # @!attribute [r] control_plane_ip - # @return [::String] - # Output only. The private IP address of the control plane for this - # workstation cluster. Workstation VMs need access to this IP address to work - # with the service, so make sure that your firewall rules allow egress from - # the workstation VMs to this address. - # @!attribute [rw] private_cluster_config - # @return [::Google::Cloud::Workstations::V1::WorkstationCluster::PrivateClusterConfig] - # Optional. Configuration for private workstation cluster. - # @!attribute [r] degraded - # @return [::Boolean] - # Output only. Whether this workstation cluster is in degraded mode, in which - # case it may require user action to restore full functionality. Details can - # be found in - # {::Google::Cloud::Workstations::V1::WorkstationCluster#conditions conditions}. - # @!attribute [r] conditions - # @return [::Array<::Google::Rpc::Status>] - # Output only. Status conditions describing the workstation cluster's current - # state. - class WorkstationCluster - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Configuration options for private workstation clusters. - # @!attribute [rw] enable_private_endpoint - # @return [::Boolean] - # Immutable. Whether Workstations endpoint is private. - # @!attribute [r] cluster_hostname - # @return [::String] - # Output only. Hostname for the workstation cluster. This field will be - # populated only when private endpoint is enabled. To access workstations - # in the workstation cluster, create a new DNS zone mapping this domain - # name to an internal IP address and a forwarding rule mapping that address - # to the service attachment. - # @!attribute [r] service_attachment_uri - # @return [::String] - # Output only. Service attachment URI for the workstation cluster. The - # service attachemnt is created when private endpoint is enabled. To access - # workstations in the workstation cluster, configure access to the managed - # service using [Private Service - # Connect](https://cloud.google.com/vpc/docs/configure-private-service-connect-services). - # @!attribute [rw] allowed_projects - # @return [::Array<::String>] - # Optional. Additional projects that are allowed to attach to the - # workstation cluster's service attachment. By default, the workstation - # cluster's project and the VPC host project (if different) are allowed. - class PrivateClusterConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class AnnotationsEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class LabelsEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # A workstation configuration resource in the Cloud Workstations API. - # - # Workstation configurations act as templates for workstations. The workstation - # configuration defines details such as the workstation virtual machine (VM) - # instance type, persistent storage, container image defining environment, - # which IDE or Code Editor to use, and more. Administrators and platform teams - # can also use [Identity and Access Management - # (IAM)](https://cloud.google.com/iam/docs/overview) rules to grant access to - # teams or to individual developers. - # @!attribute [rw] name - # @return [::String] - # Full name of this workstation configuration. - # @!attribute [rw] display_name - # @return [::String] - # Optional. Human-readable name for this workstation configuration. - # @!attribute [r] uid - # @return [::String] - # Output only. A system-assigned unique identifier for this workstation - # configuration. - # @!attribute [r] reconciling - # @return [::Boolean] - # Output only. Indicates whether this workstation configuration is currently - # being updated to match its intended state. - # @!attribute [rw] annotations - # @return [::Google::Protobuf::Map{::String => ::String}] - # Optional. Client-specified annotations. - # @!attribute [rw] labels - # @return [::Google::Protobuf::Map{::String => ::String}] - # Optional. - # [Labels](https://cloud.google.com/workstations/docs/label-resources) that - # are applied to the workstation configuration and that are also propagated - # to the underlying Compute Engine resources. - # @!attribute [r] create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. Time when this workstation configuration was created. - # @!attribute [r] update_time - # @return [::Google::Protobuf::Timestamp] - # Output only. Time when this workstation configuration was most recently - # updated. - # @!attribute [r] delete_time - # @return [::Google::Protobuf::Timestamp] - # Output only. Time when this workstation configuration was soft-deleted. - # @!attribute [rw] etag - # @return [::String] - # Optional. Checksum computed by the server. May be sent on update and delete - # requests to make sure that the client has an up-to-date value before - # proceeding. - # @!attribute [rw] idle_timeout - # @return [::Google::Protobuf::Duration] - # Optional. Number of seconds to wait before automatically stopping a - # workstation after it last received user traffic. - # - # A value of `"0s"` indicates that Cloud Workstations VMs created with this - # configuration should never time out due to idleness. - # Provide - # [duration](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#duration) - # terminated by `s` for seconds—for example, `"7200s"` (2 hours). - # The default is `"1200s"` (20 minutes). - # @!attribute [rw] running_timeout - # @return [::Google::Protobuf::Duration] - # Optional. Number of seconds that a workstation can run until it is - # automatically shut down. We recommend that workstations be shut down daily - # to reduce costs and so that security updates can be applied upon restart. - # The - # {::Google::Cloud::Workstations::V1::WorkstationConfig#idle_timeout idle_timeout} - # and - # {::Google::Cloud::Workstations::V1::WorkstationConfig#running_timeout running_timeout} - # fields are independent of each other. Note that the - # {::Google::Cloud::Workstations::V1::WorkstationConfig#running_timeout running_timeout} - # field shuts down VMs after the specified time, regardless of whether or not - # the VMs are idle. - # - # Provide duration terminated by `s` for seconds—for example, `"54000s"` - # (15 hours). Defaults to `"43200s"` (12 hours). A value of `"0s"` indicates - # that workstations using this configuration should never time out. If - # {::Google::Cloud::Workstations::V1::WorkstationConfig#encryption_key encryption_key} - # is set, it must be greater than `"0s"` and less than - # `"86400s"` (24 hours). - # - # Warning: A value of `"0s"` indicates that Cloud Workstations VMs created - # with this configuration have no maximum running time. This is strongly - # discouraged because you incur costs and will not pick up security updates. - # @!attribute [rw] host - # @return [::Google::Cloud::Workstations::V1::WorkstationConfig::Host] - # Optional. Runtime host for the workstation. - # @!attribute [rw] persistent_directories - # @return [::Array<::Google::Cloud::Workstations::V1::WorkstationConfig::PersistentDirectory>] - # Optional. Directories to persist across workstation sessions. - # @!attribute [rw] container - # @return [::Google::Cloud::Workstations::V1::WorkstationConfig::Container] - # Optional. Container that runs upon startup for each workstation using this - # workstation configuration. - # @!attribute [rw] encryption_key - # @return [::Google::Cloud::Workstations::V1::WorkstationConfig::CustomerEncryptionKey] - # Immutable. Encrypts resources of this workstation configuration using a - # customer-managed encryption key (CMEK). - # - # If specified, the boot disk of the Compute Engine instance and the - # persistent disk are encrypted using this encryption key. If - # this field is not set, the disks are encrypted using a generated - # key. Customer-managed encryption keys do not protect disk metadata. - # - # If the customer-managed encryption key is rotated, when the workstation - # instance is stopped, the system attempts to recreate the - # persistent disk with the new version of the key. Be sure to keep - # older versions of the key until the persistent disk is recreated. - # Otherwise, data on the persistent disk might be lost. - # - # If the encryption key is revoked, the workstation session automatically - # stops within 7 hours. - # - # Immutable after the workstation configuration is created. - # @!attribute [rw] readiness_checks - # @return [::Array<::Google::Cloud::Workstations::V1::WorkstationConfig::ReadinessCheck>] - # Optional. Readiness checks to perform when starting a workstation using - # this workstation configuration. Mark a workstation as running only after - # all specified readiness checks return 200 status codes. - # @!attribute [rw] replica_zones - # @return [::Array<::String>] - # Optional. Immutable. Specifies the zones used to replicate the VM and disk - # resources within the region. If set, exactly two zones within the - # workstation cluster's region must be specified—for example, - # `['us-central1-a', 'us-central1-f']`. If this field is empty, two default - # zones within the region are used. - # - # Immutable after the workstation configuration is created. - # @!attribute [r] degraded - # @return [::Boolean] - # Output only. Whether this resource is degraded, in which case it may - # require user action to restore full functionality. See also the - # {::Google::Cloud::Workstations::V1::WorkstationConfig#conditions conditions} - # field. - # @!attribute [r] conditions - # @return [::Array<::Google::Rpc::Status>] - # Output only. Status conditions describing the current resource state. - class WorkstationConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Runtime host for a workstation. - # @!attribute [rw] gce_instance - # @return [::Google::Cloud::Workstations::V1::WorkstationConfig::Host::GceInstance] - # Specifies a Compute Engine instance as the host. - class Host - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # A runtime using a Compute Engine instance. - # @!attribute [rw] machine_type - # @return [::String] - # Optional. The type of machine to use for VM instances—for example, - # `"e2-standard-4"`. For more information about machine types that - # Cloud Workstations supports, see the list of - # [available machine - # types](https://cloud.google.com/workstations/docs/available-machine-types). - # @!attribute [rw] service_account - # @return [::String] - # Optional. The email address of the service account for Cloud - # Workstations VMs created with this configuration. When specified, be - # sure that the service account has `logginglogEntries.create` permission - # on the project so it can write logs out to Cloud Logging. If using a - # custom container image, the service account must have permissions to - # pull the specified image. - # - # If you as the administrator want to be able to `ssh` into the - # underlying VM, you need to set this value to a service account - # for which you have the `iam.serviceAccounts.actAs` permission. - # Conversely, if you don't want anyone to be able to `ssh` into the - # underlying VM, use a service account where no one has that - # permission. - # - # If not set, VMs run with a service account provided by the - # Cloud Workstations service, and the image must be publicly - # accessible. - # @!attribute [rw] service_account_scopes - # @return [::Array<::String>] - # Optional. Scopes to grant to the - # {::Google::Cloud::Workstations::V1::WorkstationConfig::Host::GceInstance#service_account service_account}. - # Various scopes are automatically added based on feature usage. When - # specified, users of workstations under this configuration must have - # `iam.serviceAccounts.actAs` on the service account. - # @!attribute [rw] tags - # @return [::Array<::String>] - # Optional. Network tags to add to the Compute Engine VMs backing the - # workstations. This option applies - # [network - # tags](https://cloud.google.com/vpc/docs/add-remove-network-tags) to VMs - # created with this configuration. These network tags enable the creation - # of [firewall - # rules](https://cloud.google.com/workstations/docs/configure-firewall-rules). - # @!attribute [rw] pool_size - # @return [::Integer] - # Optional. The number of VMs that the system should keep idle so that - # new workstations can be started quickly for new users. Defaults to `0` - # in the API. - # @!attribute [r] pooled_instances - # @return [::Integer] - # Output only. Number of instances currently available in the pool for - # faster workstation startup. - # @!attribute [rw] disable_public_ip_addresses - # @return [::Boolean] - # Optional. When set to true, disables public IP addresses for VMs. If - # you disable public IP addresses, you must set up Private Google Access - # or Cloud NAT on your network. If you use Private Google Access and you - # use `private.googleapis.com` or `restricted.googleapis.com` for - # Container Registry and Artifact Registry, make sure that you set - # up DNS records for domains `*.gcr.io` and `*.pkg.dev`. - # Defaults to false (VMs have public IP addresses). - # @!attribute [rw] enable_nested_virtualization - # @return [::Boolean] - # Optional. Whether to enable nested virtualization on Cloud Workstations - # VMs created under this workstation configuration. - # - # Nested virtualization lets you run virtual machine (VM) instances - # inside your workstation. Before enabling nested virtualization, - # consider the following important considerations. Cloud Workstations - # instances are subject to the [same restrictions as Compute Engine - # instances](https://cloud.google.com/compute/docs/instances/nested-virtualization/overview#restrictions): - # - # * **Organization policy**: projects, folders, or - # organizations may be restricted from creating nested VMs if the - # **Disable VM nested virtualization** constraint is enforced in - # the organization policy. For more information, see the - # Compute Engine section, - # [Checking whether nested virtualization is - # allowed](https://cloud.google.com/compute/docs/instances/nested-virtualization/managing-constraint#checking_whether_nested_virtualization_is_allowed). - # * **Performance**: nested VMs might experience a 10% or greater - # decrease in performance for workloads that are CPU-bound and - # possibly greater than a 10% decrease for workloads that are - # input/output bound. - # * **Machine Type**: nested virtualization can only be enabled on - # workstation configurations that specify a - # {::Google::Cloud::Workstations::V1::WorkstationConfig::Host::GceInstance#machine_type machine_type} - # in the N1 or N2 machine series. - # * **GPUs**: nested virtualization may not be enabled on workstation - # configurations with accelerators. - # * **Operating System**: Because - # [Container-Optimized - # OS](https://cloud.google.com/compute/docs/images/os-details#container-optimized_os_cos) - # does not support nested virtualization, when nested virtualization is - # enabled, the underlying Compute Engine VM instances boot from an - # [Ubuntu - # LTS](https://cloud.google.com/compute/docs/images/os-details#ubuntu_lts) - # image. - # @!attribute [rw] shielded_instance_config - # @return [::Google::Cloud::Workstations::V1::WorkstationConfig::Host::GceInstance::GceShieldedInstanceConfig] - # Optional. A set of Compute Engine Shielded instance options. - # @!attribute [rw] confidential_instance_config - # @return [::Google::Cloud::Workstations::V1::WorkstationConfig::Host::GceInstance::GceConfidentialInstanceConfig] - # Optional. A set of Compute Engine Confidential VM instance options. - # @!attribute [rw] boot_disk_size_gb - # @return [::Integer] - # Optional. The size of the boot disk for the VM in gigabytes (GB). - # The minimum boot disk size is `30` GB. Defaults to `50` GB. - class GceInstance - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # A set of Compute Engine Shielded instance options. - # @!attribute [rw] enable_secure_boot - # @return [::Boolean] - # Optional. Whether the instance has Secure Boot enabled. - # @!attribute [rw] enable_vtpm - # @return [::Boolean] - # Optional. Whether the instance has the vTPM enabled. - # @!attribute [rw] enable_integrity_monitoring - # @return [::Boolean] - # Optional. Whether the instance has integrity monitoring enabled. - class GceShieldedInstanceConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A set of Compute Engine Confidential VM instance options. - # @!attribute [rw] enable_confidential_compute - # @return [::Boolean] - # Optional. Whether the instance has confidential compute enabled. - class GceConfidentialInstanceConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - - # A directory to persist across workstation sessions. - # @!attribute [rw] gce_pd - # @return [::Google::Cloud::Workstations::V1::WorkstationConfig::PersistentDirectory::GceRegionalPersistentDisk] - # A PersistentDirectory backed by a Compute Engine persistent disk. - # @!attribute [rw] mount_path - # @return [::String] - # Optional. Location of this directory in the running workstation. - class PersistentDirectory - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # A PersistentDirectory backed by a Compute Engine regional persistent - # disk. The - # {::Google::Cloud::Workstations::V1::WorkstationConfig#persistent_directories persistent_directories} - # field is repeated, but it may contain only one entry. It creates a - # [persistent - # disk](https://cloud.google.com/compute/docs/disks/persistent-disks) that - # mounts to the workstation VM at `/home` when the session starts and - # detaches when the session ends. If this field is empty, workstations - # created with this configuration do not have a persistent home - # directory. - # @!attribute [rw] size_gb - # @return [::Integer] - # Optional. The GB capacity of a persistent home directory for each - # workstation created with this configuration. Must be empty if - # {::Google::Cloud::Workstations::V1::WorkstationConfig::PersistentDirectory::GceRegionalPersistentDisk#source_snapshot source_snapshot} - # is set. - # - # Valid values are `10`, `50`, `100`, `200`, `500`, or `1000`. - # Defaults to `200`. If less than `200` GB, the - # {::Google::Cloud::Workstations::V1::WorkstationConfig::PersistentDirectory::GceRegionalPersistentDisk#disk_type disk_type} - # must be - # `"pd-balanced"` or `"pd-ssd"`. - # @!attribute [rw] fs_type - # @return [::String] - # Optional. Type of file system that the disk should be formatted with. - # The workstation image must support this file system type. Must be empty - # if - # {::Google::Cloud::Workstations::V1::WorkstationConfig::PersistentDirectory::GceRegionalPersistentDisk#source_snapshot source_snapshot} - # is set. Defaults to `"ext4"`. - # @!attribute [rw] disk_type - # @return [::String] - # Optional. The [type of the persistent - # disk](https://cloud.google.com/compute/docs/disks#disk-types) for the - # home directory. Defaults to `"pd-standard"`. - # @!attribute [rw] source_snapshot - # @return [::String] - # Optional. Name of the snapshot to use as the source for the disk. If - # set, - # {::Google::Cloud::Workstations::V1::WorkstationConfig::PersistentDirectory::GceRegionalPersistentDisk#size_gb size_gb} - # and - # {::Google::Cloud::Workstations::V1::WorkstationConfig::PersistentDirectory::GceRegionalPersistentDisk#fs_type fs_type} - # must be empty. - # @!attribute [rw] reclaim_policy - # @return [::Google::Cloud::Workstations::V1::WorkstationConfig::PersistentDirectory::GceRegionalPersistentDisk::ReclaimPolicy] - # Optional. Whether the persistent disk should be deleted when the - # workstation is deleted. Valid values are `DELETE` and `RETAIN`. - # Defaults to `DELETE`. - class GceRegionalPersistentDisk - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Value representing what should happen to the disk after the workstation - # is deleted. - module ReclaimPolicy - # Do not use. - RECLAIM_POLICY_UNSPECIFIED = 0 - - # Delete the persistent disk when deleting the workstation. - DELETE = 1 - - # Keep the persistent disk when deleting the workstation. - # An administrator must manually delete the disk. - RETAIN = 2 - end - end - end - - # A Docker container. - # @!attribute [rw] image - # @return [::String] - # Optional. A Docker container image that defines a custom environment. - # - # Cloud Workstations provides a number of - # [preconfigured - # images](https://cloud.google.com/workstations/docs/preconfigured-base-images), - # but you can create your own - # [custom container - # images](https://cloud.google.com/workstations/docs/custom-container-images). - # If using a private image, the `host.gceInstance.serviceAccount` field - # must be specified in the workstation configuration and must have - # permission to pull the specified image. Otherwise, the image must be - # publicly accessible. - # @!attribute [rw] command - # @return [::Array<::String>] - # Optional. If set, overrides the default ENTRYPOINT specified by the - # image. - # @!attribute [rw] args - # @return [::Array<::String>] - # Optional. Arguments passed to the entrypoint. - # @!attribute [rw] env - # @return [::Google::Protobuf::Map{::String => ::String}] - # Optional. Environment variables passed to the container's entrypoint. - # @!attribute [rw] working_dir - # @return [::String] - # Optional. If set, overrides the default DIR specified by the image. - # @!attribute [rw] run_as_user - # @return [::Integer] - # Optional. If set, overrides the USER specified in the image with the - # given uid. - class Container - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class EnvEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # A customer-managed encryption key (CMEK) for the Compute Engine - # resources of the associated workstation configuration. Specify the name of - # your Cloud KMS encryption key and the default service account. - # We recommend that you use a separate service account and follow - # [Cloud KMS best - # practices](https://cloud.google.com/kms/docs/separation-of-duties). - # @!attribute [rw] kms_key - # @return [::String] - # Immutable. The name of the Google Cloud KMS encryption key. For example, - # `"projects/PROJECT_ID/locations/REGION/keyRings/KEY_RING/cryptoKeys/KEY_NAME"`. - # The key must be in the same region as the workstation configuration. - # @!attribute [rw] kms_key_service_account - # @return [::String] - # Immutable. The service account to use with the specified - # KMS key. We recommend that you use a separate service account - # and follow KMS best practices. For more information, see - # [Separation of - # duties](https://cloud.google.com/kms/docs/separation-of-duties) and - # `gcloud kms keys add-iam-policy-binding` - # [`--member`](https://cloud.google.com/sdk/gcloud/reference/kms/keys/add-iam-policy-binding#--member). - class CustomerEncryptionKey - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A readiness check to be performed on a workstation. - # @!attribute [rw] path - # @return [::String] - # Optional. Path to which the request should be sent. - # @!attribute [rw] port - # @return [::Integer] - # Optional. Port to which the request should be sent. - class ReadinessCheck - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class AnnotationsEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class LabelsEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # A single instance of a developer workstation with its own persistent storage. - # @!attribute [rw] name - # @return [::String] - # Full name of this workstation. - # @!attribute [rw] display_name - # @return [::String] - # Optional. Human-readable name for this workstation. - # @!attribute [r] uid - # @return [::String] - # Output only. A system-assigned unique identifier for this workstation. - # @!attribute [r] reconciling - # @return [::Boolean] - # Output only. Indicates whether this workstation is currently being updated - # to match its intended state. - # @!attribute [rw] annotations - # @return [::Google::Protobuf::Map{::String => ::String}] - # Optional. Client-specified annotations. - # @!attribute [rw] labels - # @return [::Google::Protobuf::Map{::String => ::String}] - # Optional. - # [Labels](https://cloud.google.com/workstations/docs/label-resources) that - # are applied to the workstation and that are also propagated to the - # underlying Compute Engine resources. - # @!attribute [r] create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. Time when this workstation was created. - # @!attribute [r] update_time - # @return [::Google::Protobuf::Timestamp] - # Output only. Time when this workstation was most recently updated. - # @!attribute [r] start_time - # @return [::Google::Protobuf::Timestamp] - # Output only. Time when this workstation was most recently successfully - # started, regardless of the workstation's initial state. - # @!attribute [r] delete_time - # @return [::Google::Protobuf::Timestamp] - # Output only. Time when this workstation was soft-deleted. - # @!attribute [rw] etag - # @return [::String] - # Optional. Checksum computed by the server. May be sent on update and delete - # requests to make sure that the client has an up-to-date value before - # proceeding. - # @!attribute [r] state - # @return [::Google::Cloud::Workstations::V1::Workstation::State] - # Output only. Current state of the workstation. - # @!attribute [r] host - # @return [::String] - # Output only. Host to which clients can send HTTPS traffic that will be - # received by the workstation. Authorized traffic will be received to the - # workstation as HTTP on port 80. To send traffic to a different port, - # clients may prefix the host with the destination port in the format - # `{port}-{host}`. - class Workstation - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class AnnotationsEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class LabelsEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Whether a workstation is running and ready to receive user requests. - module State - # Do not use. - STATE_UNSPECIFIED = 0 - - # The workstation is not yet ready to accept requests from users but will - # be soon. - STATE_STARTING = 1 - - # The workstation is ready to accept requests from users. - STATE_RUNNING = 2 - - # The workstation is being stopped. - STATE_STOPPING = 3 - - # The workstation is stopped and will not be able to receive requests until - # it is started. - STATE_STOPPED = 4 - end - end - - # Request message for GetWorkstationCluster. - # @!attribute [rw] name - # @return [::String] - # Required. Name of the requested resource. - class GetWorkstationClusterRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for ListWorkstationClusters. - # @!attribute [rw] parent - # @return [::String] - # Required. Parent resource name. - # @!attribute [rw] page_size - # @return [::Integer] - # Optional. Maximum number of items to return. - # @!attribute [rw] page_token - # @return [::String] - # Optional. next_page_token value returned from a previous List request, if - # any. - class ListWorkstationClustersRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for ListWorkstationClusters. - # @!attribute [rw] workstation_clusters - # @return [::Array<::Google::Cloud::Workstations::V1::WorkstationCluster>] - # The requested workstation clusters. - # @!attribute [rw] next_page_token - # @return [::String] - # Token to retrieve the next page of results, or empty if there are no more - # results in the list. - # @!attribute [rw] unreachable - # @return [::Array<::String>] - # Unreachable resources. - class ListWorkstationClustersResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Message for creating a CreateWorkstationCluster. - # @!attribute [rw] parent - # @return [::String] - # Required. Parent resource name. - # @!attribute [rw] workstation_cluster_id - # @return [::String] - # Required. ID to use for the workstation cluster. - # @!attribute [rw] workstation_cluster - # @return [::Google::Cloud::Workstations::V1::WorkstationCluster] - # Required. Workstation cluster to create. - # @!attribute [rw] validate_only - # @return [::Boolean] - # Optional. If set, validate the request and preview the review, but do not - # actually apply it. - class CreateWorkstationClusterRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for UpdateWorkstationCluster. - # @!attribute [rw] workstation_cluster - # @return [::Google::Cloud::Workstations::V1::WorkstationCluster] - # Required. Workstation cluster to update. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # Required. Mask that specifies which fields in the workstation cluster - # should be updated. - # @!attribute [rw] validate_only - # @return [::Boolean] - # Optional. If set, validate the request and preview the review, but do not - # actually apply it. - # @!attribute [rw] allow_missing - # @return [::Boolean] - # Optional. If set, and the workstation cluster is not found, a new - # workstation cluster will be created. In this situation, update_mask is - # ignored. - class UpdateWorkstationClusterRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Message for deleting a workstation cluster. - # @!attribute [rw] name - # @return [::String] - # Required. Name of the workstation cluster to delete. - # @!attribute [rw] validate_only - # @return [::Boolean] - # Optional. If set, validate the request and preview the review, but do not - # apply it. - # @!attribute [rw] etag - # @return [::String] - # Optional. If set, the request will be rejected if the latest version of the - # workstation cluster on the server does not have this ETag. - # @!attribute [rw] force - # @return [::Boolean] - # Optional. If set, any workstation configurations and workstations in the - # workstation cluster are also deleted. Otherwise, the request only - # works if the workstation cluster has no configurations or workstations. - class DeleteWorkstationClusterRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for GetWorkstationConfig. - # @!attribute [rw] name - # @return [::String] - # Required. Name of the requested resource. - class GetWorkstationConfigRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for ListWorkstationConfigs. - # @!attribute [rw] parent - # @return [::String] - # Required. Parent resource name. - # @!attribute [rw] page_size - # @return [::Integer] - # Optional. Maximum number of items to return. - # @!attribute [rw] page_token - # @return [::String] - # Optional. next_page_token value returned from a previous List request, if - # any. - class ListWorkstationConfigsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for ListWorkstationConfigs. - # @!attribute [rw] workstation_configs - # @return [::Array<::Google::Cloud::Workstations::V1::WorkstationConfig>] - # The requested configs. - # @!attribute [rw] next_page_token - # @return [::String] - # Token to retrieve the next page of results, or empty if there are no more - # results in the list. - # @!attribute [rw] unreachable - # @return [::Array<::String>] - # Unreachable resources. - class ListWorkstationConfigsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for ListUsableWorkstationConfigs. - # @!attribute [rw] parent - # @return [::String] - # Required. Parent resource name. - # @!attribute [rw] page_size - # @return [::Integer] - # Optional. Maximum number of items to return. - # @!attribute [rw] page_token - # @return [::String] - # Optional. next_page_token value returned from a previous List request, if - # any. - class ListUsableWorkstationConfigsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for ListUsableWorkstationConfigs. - # @!attribute [rw] workstation_configs - # @return [::Array<::Google::Cloud::Workstations::V1::WorkstationConfig>] - # The requested configs. - # @!attribute [rw] next_page_token - # @return [::String] - # Token to retrieve the next page of results, or empty if there are no more - # results in the list. - # @!attribute [rw] unreachable - # @return [::Array<::String>] - # Unreachable resources. - class ListUsableWorkstationConfigsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Message for creating a CreateWorkstationConfig. - # @!attribute [rw] parent - # @return [::String] - # Required. Parent resource name. - # @!attribute [rw] workstation_config_id - # @return [::String] - # Required. ID to use for the workstation configuration. - # @!attribute [rw] workstation_config - # @return [::Google::Cloud::Workstations::V1::WorkstationConfig] - # Required. Config to create. - # @!attribute [rw] validate_only - # @return [::Boolean] - # Optional. If set, validate the request and preview the review, but do not - # actually apply it. - class CreateWorkstationConfigRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for UpdateWorkstationConfig. - # @!attribute [rw] workstation_config - # @return [::Google::Cloud::Workstations::V1::WorkstationConfig] - # Required. Config to update. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # Required. Mask specifying which fields in the workstation configuration - # should be updated. - # @!attribute [rw] validate_only - # @return [::Boolean] - # Optional. If set, validate the request and preview the review, but do not - # actually apply it. - # @!attribute [rw] allow_missing - # @return [::Boolean] - # Optional. If set and the workstation configuration is not found, a new - # workstation configuration will be created. In this situation, - # update_mask is ignored. - class UpdateWorkstationConfigRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Message for deleting a workstation configuration. - # @!attribute [rw] name - # @return [::String] - # Required. Name of the workstation configuration to delete. - # @!attribute [rw] validate_only - # @return [::Boolean] - # Optional. If set, validate the request and preview the review, but do not - # actually apply it. - # @!attribute [rw] etag - # @return [::String] - # Optional. If set, the request is rejected if the latest version of the - # workstation configuration on the server does not have this ETag. - # @!attribute [rw] force - # @return [::Boolean] - # Optional. If set, any workstations in the workstation configuration are - # also deleted. Otherwise, the request works only if the workstation - # configuration has no workstations. - class DeleteWorkstationConfigRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for GetWorkstation. - # @!attribute [rw] name - # @return [::String] - # Required. Name of the requested resource. - class GetWorkstationRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for ListWorkstations. - # @!attribute [rw] parent - # @return [::String] - # Required. Parent resource name. - # @!attribute [rw] page_size - # @return [::Integer] - # Optional. Maximum number of items to return. - # @!attribute [rw] page_token - # @return [::String] - # Optional. next_page_token value returned from a previous List request, if - # any. - class ListWorkstationsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for ListWorkstations. - # @!attribute [rw] workstations - # @return [::Array<::Google::Cloud::Workstations::V1::Workstation>] - # The requested workstations. - # @!attribute [rw] next_page_token - # @return [::String] - # Optional. Token to retrieve the next page of results, or empty if there are - # no more results in the list. - # @!attribute [rw] unreachable - # @return [::Array<::String>] - # Optional. Unreachable resources. - class ListWorkstationsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for ListUsableWorkstations. - # @!attribute [rw] parent - # @return [::String] - # Required. Parent resource name. - # @!attribute [rw] page_size - # @return [::Integer] - # Optional. Maximum number of items to return. - # @!attribute [rw] page_token - # @return [::String] - # Optional. next_page_token value returned from a previous List request, if - # any. - class ListUsableWorkstationsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for ListUsableWorkstations. - # @!attribute [rw] workstations - # @return [::Array<::Google::Cloud::Workstations::V1::Workstation>] - # The requested workstations. - # @!attribute [rw] next_page_token - # @return [::String] - # Token to retrieve the next page of results, or empty if there are no more - # results in the list. - # @!attribute [rw] unreachable - # @return [::Array<::String>] - # Unreachable resources. - class ListUsableWorkstationsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Message for creating a CreateWorkstation. - # @!attribute [rw] parent - # @return [::String] - # Required. Parent resource name. - # @!attribute [rw] workstation_id - # @return [::String] - # Required. ID to use for the workstation. - # @!attribute [rw] workstation - # @return [::Google::Cloud::Workstations::V1::Workstation] - # Required. Workstation to create. - # @!attribute [rw] validate_only - # @return [::Boolean] - # Optional. If set, validate the request and preview the review, but do not - # actually apply it. - class CreateWorkstationRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for UpdateWorkstation. - # @!attribute [rw] workstation - # @return [::Google::Cloud::Workstations::V1::Workstation] - # Required. Workstation to update. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # Required. Mask specifying which fields in the workstation configuration - # should be updated. - # @!attribute [rw] validate_only - # @return [::Boolean] - # Optional. If set, validate the request and preview the review, but do not - # actually apply it. - # @!attribute [rw] allow_missing - # @return [::Boolean] - # Optional. If set and the workstation configuration is not found, a new - # workstation configuration is created. In this situation, update_mask - # is ignored. - class UpdateWorkstationRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for DeleteWorkstation. - # @!attribute [rw] name - # @return [::String] - # Required. Name of the workstation to delete. - # @!attribute [rw] validate_only - # @return [::Boolean] - # Optional. If set, validate the request and preview the review, but do not - # actually apply it. - # @!attribute [rw] etag - # @return [::String] - # Optional. If set, the request will be rejected if the latest version of the - # workstation on the server does not have this ETag. - class DeleteWorkstationRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for StartWorkstation. - # @!attribute [rw] name - # @return [::String] - # Required. Name of the workstation to start. - # @!attribute [rw] validate_only - # @return [::Boolean] - # Optional. If set, validate the request and preview the review, but do not - # actually apply it. - # @!attribute [rw] etag - # @return [::String] - # Optional. If set, the request will be rejected if the latest version of the - # workstation on the server does not have this ETag. - class StartWorkstationRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for StopWorkstation. - # @!attribute [rw] name - # @return [::String] - # Required. Name of the workstation to stop. - # @!attribute [rw] validate_only - # @return [::Boolean] - # Optional. If set, validate the request and preview the review, but do not - # actually apply it. - # @!attribute [rw] etag - # @return [::String] - # Optional. If set, the request will be rejected if the latest version of the - # workstation on the server does not have this ETag. - class StopWorkstationRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for GenerateAccessToken. - # @!attribute [rw] expire_time - # @return [::Google::Protobuf::Timestamp] - # Desired expiration time of the access token. This value must - # be at most 24 hours in the future. If a value is not specified, the - # token's expiration time will be set to a default value of 1 hour in the - # future. - # - # 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] - # Desired lifetime duration of the access token. This value must - # be at most 24 hours. If a value is not specified, the token's lifetime - # will be set to a default value of 1 hour. - # - # 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 [rw] workstation - # @return [::String] - # Required. Name of the workstation for which the access token should be - # generated. - class GenerateAccessTokenRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for GenerateAccessToken. - # @!attribute [rw] access_token - # @return [::String] - # The generated bearer access token. To use this token, include it in an - # Authorization header of an HTTP request sent to the associated - # workstation's hostname—for example, `Authorization: Bearer - # `. - # @!attribute [rw] expire_time - # @return [::Google::Protobuf::Timestamp] - # Time at which the generated token will expire. - class GenerateAccessTokenResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Metadata for long-running operations. - # @!attribute [r] create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. Time that the operation was created. - # @!attribute [r] end_time - # @return [::Google::Protobuf::Timestamp] - # Output only. Time that the operation finished running. - # @!attribute [r] target - # @return [::String] - # Output only. Server-defined resource path for the target of the operation. - # @!attribute [r] verb - # @return [::String] - # Output only. Name of the verb executed by the operation. - # @!attribute [r] status_message - # @return [::String] - # Output only. Human-readable status of the operation, if any. - # @!attribute [r] requested_cancellation - # @return [::Boolean] - # Output only. Identifies whether the user has requested cancellation - # of the operation. - # @!attribute [r] api_version - # @return [::String] - # Output only. API version used to start the operation. - class OperationMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-workstations-v1/proto_docs/google/longrunning/operations.rb b/owl-bot-staging/google-cloud-workstations-v1/proto_docs/google/longrunning/operations.rb deleted file mode 100644 index 7a757f512165..000000000000 --- a/owl-bot-staging/google-cloud-workstations-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-workstations-v1/proto_docs/google/protobuf/any.rb b/owl-bot-staging/google-cloud-workstations-v1/proto_docs/google/protobuf/any.rb deleted file mode 100644 index 58691995f02e..000000000000 --- a/owl-bot-staging/google-cloud-workstations-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-workstations-v1/proto_docs/google/protobuf/duration.rb b/owl-bot-staging/google-cloud-workstations-v1/proto_docs/google/protobuf/duration.rb deleted file mode 100644 index ea59f1f91daf..000000000000 --- a/owl-bot-staging/google-cloud-workstations-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-workstations-v1/proto_docs/google/protobuf/empty.rb b/owl-bot-staging/google-cloud-workstations-v1/proto_docs/google/protobuf/empty.rb deleted file mode 100644 index 83e4481834a6..000000000000 --- a/owl-bot-staging/google-cloud-workstations-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-workstations-v1/proto_docs/google/protobuf/field_mask.rb b/owl-bot-staging/google-cloud-workstations-v1/proto_docs/google/protobuf/field_mask.rb deleted file mode 100644 index 7f3ffc78601a..000000000000 --- a/owl-bot-staging/google-cloud-workstations-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-workstations-v1/proto_docs/google/protobuf/timestamp.rb b/owl-bot-staging/google-cloud-workstations-v1/proto_docs/google/protobuf/timestamp.rb deleted file mode 100644 index 74352be9c58c..000000000000 --- a/owl-bot-staging/google-cloud-workstations-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-workstations-v1/proto_docs/google/rpc/status.rb b/owl-bot-staging/google-cloud-workstations-v1/proto_docs/google/rpc/status.rb deleted file mode 100644 index c1a1c07eb2db..000000000000 --- a/owl-bot-staging/google-cloud-workstations-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-workstations-v1/proto_docs/google/type/expr.rb b/owl-bot-staging/google-cloud-workstations-v1/proto_docs/google/type/expr.rb deleted file mode 100644 index 53e7733b6592..000000000000 --- a/owl-bot-staging/google-cloud-workstations-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-workstations-v1/snippets/Gemfile b/owl-bot-staging/google-cloud-workstations-v1/snippets/Gemfile deleted file mode 100644 index a1469457e584..000000000000 --- a/owl-bot-staging/google-cloud-workstations-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-workstations-v1", path: "../" -else - gem "google-cloud-workstations-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-workstations-v1/snippets/snippet_metadata_google.cloud.workstations.v1.json b/owl-bot-staging/google-cloud-workstations-v1/snippets/snippet_metadata_google.cloud.workstations.v1.json deleted file mode 100644 index e900c252d0bb..000000000000 --- a/owl-bot-staging/google-cloud-workstations-v1/snippets/snippet_metadata_google.cloud.workstations.v1.json +++ /dev/null @@ -1,815 +0,0 @@ -{ - "client_library": { - "name": "google-cloud-workstations-v1", - "version": "", - "language": "RUBY", - "apis": [ - { - "id": "google.cloud.workstations.v1", - "version": "v1" - } - ] - }, - "snippets": [ - { - "region_tag": "workstations_v1_generated_Workstations_GetWorkstationCluster_sync", - "title": "Snippet for the get_workstation_cluster call in the Workstations service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Workstations::V1::Workstations::Client#get_workstation_cluster.", - "file": "workstations/get_workstation_cluster.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_workstation_cluster", - "full_name": "::Google::Cloud::Workstations::V1::Workstations::Client#get_workstation_cluster", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Workstations::V1::GetWorkstationClusterRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Workstations::V1::WorkstationCluster", - "client": { - "short_name": "Workstations::Client", - "full_name": "::Google::Cloud::Workstations::V1::Workstations::Client" - }, - "method": { - "short_name": "GetWorkstationCluster", - "full_name": "google.cloud.workstations.v1.Workstations.GetWorkstationCluster", - "service": { - "short_name": "Workstations", - "full_name": "google.cloud.workstations.v1.Workstations" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "workstations_v1_generated_Workstations_ListWorkstationClusters_sync", - "title": "Snippet for the list_workstation_clusters call in the Workstations service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Workstations::V1::Workstations::Client#list_workstation_clusters.", - "file": "workstations/list_workstation_clusters.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_workstation_clusters", - "full_name": "::Google::Cloud::Workstations::V1::Workstations::Client#list_workstation_clusters", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Workstations::V1::ListWorkstationClustersRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Workstations::V1::ListWorkstationClustersResponse", - "client": { - "short_name": "Workstations::Client", - "full_name": "::Google::Cloud::Workstations::V1::Workstations::Client" - }, - "method": { - "short_name": "ListWorkstationClusters", - "full_name": "google.cloud.workstations.v1.Workstations.ListWorkstationClusters", - "service": { - "short_name": "Workstations", - "full_name": "google.cloud.workstations.v1.Workstations" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "workstations_v1_generated_Workstations_CreateWorkstationCluster_sync", - "title": "Snippet for the create_workstation_cluster call in the Workstations service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Workstations::V1::Workstations::Client#create_workstation_cluster.", - "file": "workstations/create_workstation_cluster.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_workstation_cluster", - "full_name": "::Google::Cloud::Workstations::V1::Workstations::Client#create_workstation_cluster", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Workstations::V1::CreateWorkstationClusterRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "Workstations::Client", - "full_name": "::Google::Cloud::Workstations::V1::Workstations::Client" - }, - "method": { - "short_name": "CreateWorkstationCluster", - "full_name": "google.cloud.workstations.v1.Workstations.CreateWorkstationCluster", - "service": { - "short_name": "Workstations", - "full_name": "google.cloud.workstations.v1.Workstations" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "workstations_v1_generated_Workstations_UpdateWorkstationCluster_sync", - "title": "Snippet for the update_workstation_cluster call in the Workstations service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Workstations::V1::Workstations::Client#update_workstation_cluster.", - "file": "workstations/update_workstation_cluster.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_workstation_cluster", - "full_name": "::Google::Cloud::Workstations::V1::Workstations::Client#update_workstation_cluster", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Workstations::V1::UpdateWorkstationClusterRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "Workstations::Client", - "full_name": "::Google::Cloud::Workstations::V1::Workstations::Client" - }, - "method": { - "short_name": "UpdateWorkstationCluster", - "full_name": "google.cloud.workstations.v1.Workstations.UpdateWorkstationCluster", - "service": { - "short_name": "Workstations", - "full_name": "google.cloud.workstations.v1.Workstations" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "workstations_v1_generated_Workstations_DeleteWorkstationCluster_sync", - "title": "Snippet for the delete_workstation_cluster call in the Workstations service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Workstations::V1::Workstations::Client#delete_workstation_cluster.", - "file": "workstations/delete_workstation_cluster.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_workstation_cluster", - "full_name": "::Google::Cloud::Workstations::V1::Workstations::Client#delete_workstation_cluster", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Workstations::V1::DeleteWorkstationClusterRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "Workstations::Client", - "full_name": "::Google::Cloud::Workstations::V1::Workstations::Client" - }, - "method": { - "short_name": "DeleteWorkstationCluster", - "full_name": "google.cloud.workstations.v1.Workstations.DeleteWorkstationCluster", - "service": { - "short_name": "Workstations", - "full_name": "google.cloud.workstations.v1.Workstations" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "workstations_v1_generated_Workstations_GetWorkstationConfig_sync", - "title": "Snippet for the get_workstation_config call in the Workstations service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Workstations::V1::Workstations::Client#get_workstation_config.", - "file": "workstations/get_workstation_config.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_workstation_config", - "full_name": "::Google::Cloud::Workstations::V1::Workstations::Client#get_workstation_config", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Workstations::V1::GetWorkstationConfigRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Workstations::V1::WorkstationConfig", - "client": { - "short_name": "Workstations::Client", - "full_name": "::Google::Cloud::Workstations::V1::Workstations::Client" - }, - "method": { - "short_name": "GetWorkstationConfig", - "full_name": "google.cloud.workstations.v1.Workstations.GetWorkstationConfig", - "service": { - "short_name": "Workstations", - "full_name": "google.cloud.workstations.v1.Workstations" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "workstations_v1_generated_Workstations_ListWorkstationConfigs_sync", - "title": "Snippet for the list_workstation_configs call in the Workstations service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Workstations::V1::Workstations::Client#list_workstation_configs.", - "file": "workstations/list_workstation_configs.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_workstation_configs", - "full_name": "::Google::Cloud::Workstations::V1::Workstations::Client#list_workstation_configs", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Workstations::V1::ListWorkstationConfigsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Workstations::V1::ListWorkstationConfigsResponse", - "client": { - "short_name": "Workstations::Client", - "full_name": "::Google::Cloud::Workstations::V1::Workstations::Client" - }, - "method": { - "short_name": "ListWorkstationConfigs", - "full_name": "google.cloud.workstations.v1.Workstations.ListWorkstationConfigs", - "service": { - "short_name": "Workstations", - "full_name": "google.cloud.workstations.v1.Workstations" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "workstations_v1_generated_Workstations_ListUsableWorkstationConfigs_sync", - "title": "Snippet for the list_usable_workstation_configs call in the Workstations service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Workstations::V1::Workstations::Client#list_usable_workstation_configs.", - "file": "workstations/list_usable_workstation_configs.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_usable_workstation_configs", - "full_name": "::Google::Cloud::Workstations::V1::Workstations::Client#list_usable_workstation_configs", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Workstations::V1::ListUsableWorkstationConfigsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Workstations::V1::ListUsableWorkstationConfigsResponse", - "client": { - "short_name": "Workstations::Client", - "full_name": "::Google::Cloud::Workstations::V1::Workstations::Client" - }, - "method": { - "short_name": "ListUsableWorkstationConfigs", - "full_name": "google.cloud.workstations.v1.Workstations.ListUsableWorkstationConfigs", - "service": { - "short_name": "Workstations", - "full_name": "google.cloud.workstations.v1.Workstations" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "workstations_v1_generated_Workstations_CreateWorkstationConfig_sync", - "title": "Snippet for the create_workstation_config call in the Workstations service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Workstations::V1::Workstations::Client#create_workstation_config.", - "file": "workstations/create_workstation_config.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_workstation_config", - "full_name": "::Google::Cloud::Workstations::V1::Workstations::Client#create_workstation_config", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Workstations::V1::CreateWorkstationConfigRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "Workstations::Client", - "full_name": "::Google::Cloud::Workstations::V1::Workstations::Client" - }, - "method": { - "short_name": "CreateWorkstationConfig", - "full_name": "google.cloud.workstations.v1.Workstations.CreateWorkstationConfig", - "service": { - "short_name": "Workstations", - "full_name": "google.cloud.workstations.v1.Workstations" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "workstations_v1_generated_Workstations_UpdateWorkstationConfig_sync", - "title": "Snippet for the update_workstation_config call in the Workstations service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Workstations::V1::Workstations::Client#update_workstation_config.", - "file": "workstations/update_workstation_config.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_workstation_config", - "full_name": "::Google::Cloud::Workstations::V1::Workstations::Client#update_workstation_config", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Workstations::V1::UpdateWorkstationConfigRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "Workstations::Client", - "full_name": "::Google::Cloud::Workstations::V1::Workstations::Client" - }, - "method": { - "short_name": "UpdateWorkstationConfig", - "full_name": "google.cloud.workstations.v1.Workstations.UpdateWorkstationConfig", - "service": { - "short_name": "Workstations", - "full_name": "google.cloud.workstations.v1.Workstations" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "workstations_v1_generated_Workstations_DeleteWorkstationConfig_sync", - "title": "Snippet for the delete_workstation_config call in the Workstations service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Workstations::V1::Workstations::Client#delete_workstation_config.", - "file": "workstations/delete_workstation_config.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_workstation_config", - "full_name": "::Google::Cloud::Workstations::V1::Workstations::Client#delete_workstation_config", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Workstations::V1::DeleteWorkstationConfigRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "Workstations::Client", - "full_name": "::Google::Cloud::Workstations::V1::Workstations::Client" - }, - "method": { - "short_name": "DeleteWorkstationConfig", - "full_name": "google.cloud.workstations.v1.Workstations.DeleteWorkstationConfig", - "service": { - "short_name": "Workstations", - "full_name": "google.cloud.workstations.v1.Workstations" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "workstations_v1_generated_Workstations_GetWorkstation_sync", - "title": "Snippet for the get_workstation call in the Workstations service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Workstations::V1::Workstations::Client#get_workstation.", - "file": "workstations/get_workstation.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_workstation", - "full_name": "::Google::Cloud::Workstations::V1::Workstations::Client#get_workstation", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Workstations::V1::GetWorkstationRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Workstations::V1::Workstation", - "client": { - "short_name": "Workstations::Client", - "full_name": "::Google::Cloud::Workstations::V1::Workstations::Client" - }, - "method": { - "short_name": "GetWorkstation", - "full_name": "google.cloud.workstations.v1.Workstations.GetWorkstation", - "service": { - "short_name": "Workstations", - "full_name": "google.cloud.workstations.v1.Workstations" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "workstations_v1_generated_Workstations_ListWorkstations_sync", - "title": "Snippet for the list_workstations call in the Workstations service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Workstations::V1::Workstations::Client#list_workstations.", - "file": "workstations/list_workstations.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_workstations", - "full_name": "::Google::Cloud::Workstations::V1::Workstations::Client#list_workstations", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Workstations::V1::ListWorkstationsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Workstations::V1::ListWorkstationsResponse", - "client": { - "short_name": "Workstations::Client", - "full_name": "::Google::Cloud::Workstations::V1::Workstations::Client" - }, - "method": { - "short_name": "ListWorkstations", - "full_name": "google.cloud.workstations.v1.Workstations.ListWorkstations", - "service": { - "short_name": "Workstations", - "full_name": "google.cloud.workstations.v1.Workstations" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "workstations_v1_generated_Workstations_ListUsableWorkstations_sync", - "title": "Snippet for the list_usable_workstations call in the Workstations service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Workstations::V1::Workstations::Client#list_usable_workstations.", - "file": "workstations/list_usable_workstations.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_usable_workstations", - "full_name": "::Google::Cloud::Workstations::V1::Workstations::Client#list_usable_workstations", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Workstations::V1::ListUsableWorkstationsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Workstations::V1::ListUsableWorkstationsResponse", - "client": { - "short_name": "Workstations::Client", - "full_name": "::Google::Cloud::Workstations::V1::Workstations::Client" - }, - "method": { - "short_name": "ListUsableWorkstations", - "full_name": "google.cloud.workstations.v1.Workstations.ListUsableWorkstations", - "service": { - "short_name": "Workstations", - "full_name": "google.cloud.workstations.v1.Workstations" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "workstations_v1_generated_Workstations_CreateWorkstation_sync", - "title": "Snippet for the create_workstation call in the Workstations service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Workstations::V1::Workstations::Client#create_workstation.", - "file": "workstations/create_workstation.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_workstation", - "full_name": "::Google::Cloud::Workstations::V1::Workstations::Client#create_workstation", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Workstations::V1::CreateWorkstationRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "Workstations::Client", - "full_name": "::Google::Cloud::Workstations::V1::Workstations::Client" - }, - "method": { - "short_name": "CreateWorkstation", - "full_name": "google.cloud.workstations.v1.Workstations.CreateWorkstation", - "service": { - "short_name": "Workstations", - "full_name": "google.cloud.workstations.v1.Workstations" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "workstations_v1_generated_Workstations_UpdateWorkstation_sync", - "title": "Snippet for the update_workstation call in the Workstations service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Workstations::V1::Workstations::Client#update_workstation.", - "file": "workstations/update_workstation.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_workstation", - "full_name": "::Google::Cloud::Workstations::V1::Workstations::Client#update_workstation", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Workstations::V1::UpdateWorkstationRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "Workstations::Client", - "full_name": "::Google::Cloud::Workstations::V1::Workstations::Client" - }, - "method": { - "short_name": "UpdateWorkstation", - "full_name": "google.cloud.workstations.v1.Workstations.UpdateWorkstation", - "service": { - "short_name": "Workstations", - "full_name": "google.cloud.workstations.v1.Workstations" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "workstations_v1_generated_Workstations_DeleteWorkstation_sync", - "title": "Snippet for the delete_workstation call in the Workstations service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Workstations::V1::Workstations::Client#delete_workstation.", - "file": "workstations/delete_workstation.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_workstation", - "full_name": "::Google::Cloud::Workstations::V1::Workstations::Client#delete_workstation", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Workstations::V1::DeleteWorkstationRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "Workstations::Client", - "full_name": "::Google::Cloud::Workstations::V1::Workstations::Client" - }, - "method": { - "short_name": "DeleteWorkstation", - "full_name": "google.cloud.workstations.v1.Workstations.DeleteWorkstation", - "service": { - "short_name": "Workstations", - "full_name": "google.cloud.workstations.v1.Workstations" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "workstations_v1_generated_Workstations_StartWorkstation_sync", - "title": "Snippet for the start_workstation call in the Workstations service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Workstations::V1::Workstations::Client#start_workstation.", - "file": "workstations/start_workstation.rb", - "language": "RUBY", - "client_method": { - "short_name": "start_workstation", - "full_name": "::Google::Cloud::Workstations::V1::Workstations::Client#start_workstation", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Workstations::V1::StartWorkstationRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "Workstations::Client", - "full_name": "::Google::Cloud::Workstations::V1::Workstations::Client" - }, - "method": { - "short_name": "StartWorkstation", - "full_name": "google.cloud.workstations.v1.Workstations.StartWorkstation", - "service": { - "short_name": "Workstations", - "full_name": "google.cloud.workstations.v1.Workstations" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "workstations_v1_generated_Workstations_StopWorkstation_sync", - "title": "Snippet for the stop_workstation call in the Workstations service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Workstations::V1::Workstations::Client#stop_workstation.", - "file": "workstations/stop_workstation.rb", - "language": "RUBY", - "client_method": { - "short_name": "stop_workstation", - "full_name": "::Google::Cloud::Workstations::V1::Workstations::Client#stop_workstation", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Workstations::V1::StopWorkstationRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "Workstations::Client", - "full_name": "::Google::Cloud::Workstations::V1::Workstations::Client" - }, - "method": { - "short_name": "StopWorkstation", - "full_name": "google.cloud.workstations.v1.Workstations.StopWorkstation", - "service": { - "short_name": "Workstations", - "full_name": "google.cloud.workstations.v1.Workstations" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "workstations_v1_generated_Workstations_GenerateAccessToken_sync", - "title": "Snippet for the generate_access_token call in the Workstations service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Workstations::V1::Workstations::Client#generate_access_token.", - "file": "workstations/generate_access_token.rb", - "language": "RUBY", - "client_method": { - "short_name": "generate_access_token", - "full_name": "::Google::Cloud::Workstations::V1::Workstations::Client#generate_access_token", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Workstations::V1::GenerateAccessTokenRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Workstations::V1::GenerateAccessTokenResponse", - "client": { - "short_name": "Workstations::Client", - "full_name": "::Google::Cloud::Workstations::V1::Workstations::Client" - }, - "method": { - "short_name": "GenerateAccessToken", - "full_name": "google.cloud.workstations.v1.Workstations.GenerateAccessToken", - "service": { - "short_name": "Workstations", - "full_name": "google.cloud.workstations.v1.Workstations" - } - } - }, - "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-workstations-v1/snippets/workstations/create_workstation.rb b/owl-bot-staging/google-cloud-workstations-v1/snippets/workstations/create_workstation.rb deleted file mode 100644 index 4031f08e9005..000000000000 --- a/owl-bot-staging/google-cloud-workstations-v1/snippets/workstations/create_workstation.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 workstations_v1_generated_Workstations_CreateWorkstation_sync] -require "google/cloud/workstations/v1" - -## -# Snippet for the create_workstation call in the Workstations 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::Workstations::V1::Workstations::Client#create_workstation. -# -def create_workstation - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Workstations::V1::Workstations::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Workstations::V1::CreateWorkstationRequest.new - - # Call the create_workstation method. - result = client.create_workstation 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 workstations_v1_generated_Workstations_CreateWorkstation_sync] diff --git a/owl-bot-staging/google-cloud-workstations-v1/snippets/workstations/create_workstation_cluster.rb b/owl-bot-staging/google-cloud-workstations-v1/snippets/workstations/create_workstation_cluster.rb deleted file mode 100644 index 6920a957ca47..000000000000 --- a/owl-bot-staging/google-cloud-workstations-v1/snippets/workstations/create_workstation_cluster.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 workstations_v1_generated_Workstations_CreateWorkstationCluster_sync] -require "google/cloud/workstations/v1" - -## -# Snippet for the create_workstation_cluster call in the Workstations 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::Workstations::V1::Workstations::Client#create_workstation_cluster. -# -def create_workstation_cluster - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Workstations::V1::Workstations::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Workstations::V1::CreateWorkstationClusterRequest.new - - # Call the create_workstation_cluster method. - result = client.create_workstation_cluster 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 workstations_v1_generated_Workstations_CreateWorkstationCluster_sync] diff --git a/owl-bot-staging/google-cloud-workstations-v1/snippets/workstations/create_workstation_config.rb b/owl-bot-staging/google-cloud-workstations-v1/snippets/workstations/create_workstation_config.rb deleted file mode 100644 index a4ee1a5ba3bd..000000000000 --- a/owl-bot-staging/google-cloud-workstations-v1/snippets/workstations/create_workstation_config.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 workstations_v1_generated_Workstations_CreateWorkstationConfig_sync] -require "google/cloud/workstations/v1" - -## -# Snippet for the create_workstation_config call in the Workstations 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::Workstations::V1::Workstations::Client#create_workstation_config. -# -def create_workstation_config - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Workstations::V1::Workstations::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Workstations::V1::CreateWorkstationConfigRequest.new - - # Call the create_workstation_config method. - result = client.create_workstation_config 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 workstations_v1_generated_Workstations_CreateWorkstationConfig_sync] diff --git a/owl-bot-staging/google-cloud-workstations-v1/snippets/workstations/delete_workstation.rb b/owl-bot-staging/google-cloud-workstations-v1/snippets/workstations/delete_workstation.rb deleted file mode 100644 index 81660ff7e383..000000000000 --- a/owl-bot-staging/google-cloud-workstations-v1/snippets/workstations/delete_workstation.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 workstations_v1_generated_Workstations_DeleteWorkstation_sync] -require "google/cloud/workstations/v1" - -## -# Snippet for the delete_workstation call in the Workstations 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::Workstations::V1::Workstations::Client#delete_workstation. -# -def delete_workstation - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Workstations::V1::Workstations::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Workstations::V1::DeleteWorkstationRequest.new - - # Call the delete_workstation method. - result = client.delete_workstation 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 workstations_v1_generated_Workstations_DeleteWorkstation_sync] diff --git a/owl-bot-staging/google-cloud-workstations-v1/snippets/workstations/delete_workstation_cluster.rb b/owl-bot-staging/google-cloud-workstations-v1/snippets/workstations/delete_workstation_cluster.rb deleted file mode 100644 index 979c4987b36e..000000000000 --- a/owl-bot-staging/google-cloud-workstations-v1/snippets/workstations/delete_workstation_cluster.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 workstations_v1_generated_Workstations_DeleteWorkstationCluster_sync] -require "google/cloud/workstations/v1" - -## -# Snippet for the delete_workstation_cluster call in the Workstations 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::Workstations::V1::Workstations::Client#delete_workstation_cluster. -# -def delete_workstation_cluster - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Workstations::V1::Workstations::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Workstations::V1::DeleteWorkstationClusterRequest.new - - # Call the delete_workstation_cluster method. - result = client.delete_workstation_cluster 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 workstations_v1_generated_Workstations_DeleteWorkstationCluster_sync] diff --git a/owl-bot-staging/google-cloud-workstations-v1/snippets/workstations/delete_workstation_config.rb b/owl-bot-staging/google-cloud-workstations-v1/snippets/workstations/delete_workstation_config.rb deleted file mode 100644 index 282347e33b9b..000000000000 --- a/owl-bot-staging/google-cloud-workstations-v1/snippets/workstations/delete_workstation_config.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 workstations_v1_generated_Workstations_DeleteWorkstationConfig_sync] -require "google/cloud/workstations/v1" - -## -# Snippet for the delete_workstation_config call in the Workstations 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::Workstations::V1::Workstations::Client#delete_workstation_config. -# -def delete_workstation_config - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Workstations::V1::Workstations::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Workstations::V1::DeleteWorkstationConfigRequest.new - - # Call the delete_workstation_config method. - result = client.delete_workstation_config 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 workstations_v1_generated_Workstations_DeleteWorkstationConfig_sync] diff --git a/owl-bot-staging/google-cloud-workstations-v1/snippets/workstations/generate_access_token.rb b/owl-bot-staging/google-cloud-workstations-v1/snippets/workstations/generate_access_token.rb deleted file mode 100644 index 5ee1e774fee1..000000000000 --- a/owl-bot-staging/google-cloud-workstations-v1/snippets/workstations/generate_access_token.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 workstations_v1_generated_Workstations_GenerateAccessToken_sync] -require "google/cloud/workstations/v1" - -## -# Snippet for the generate_access_token call in the Workstations 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::Workstations::V1::Workstations::Client#generate_access_token. -# -def generate_access_token - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Workstations::V1::Workstations::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Workstations::V1::GenerateAccessTokenRequest.new - - # Call the generate_access_token method. - result = client.generate_access_token request - - # The returned object is of type Google::Cloud::Workstations::V1::GenerateAccessTokenResponse. - p result -end -# [END workstations_v1_generated_Workstations_GenerateAccessToken_sync] diff --git a/owl-bot-staging/google-cloud-workstations-v1/snippets/workstations/get_workstation.rb b/owl-bot-staging/google-cloud-workstations-v1/snippets/workstations/get_workstation.rb deleted file mode 100644 index 3f39180ba50d..000000000000 --- a/owl-bot-staging/google-cloud-workstations-v1/snippets/workstations/get_workstation.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 workstations_v1_generated_Workstations_GetWorkstation_sync] -require "google/cloud/workstations/v1" - -## -# Snippet for the get_workstation call in the Workstations 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::Workstations::V1::Workstations::Client#get_workstation. -# -def get_workstation - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Workstations::V1::Workstations::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Workstations::V1::GetWorkstationRequest.new - - # Call the get_workstation method. - result = client.get_workstation request - - # The returned object is of type Google::Cloud::Workstations::V1::Workstation. - p result -end -# [END workstations_v1_generated_Workstations_GetWorkstation_sync] diff --git a/owl-bot-staging/google-cloud-workstations-v1/snippets/workstations/get_workstation_cluster.rb b/owl-bot-staging/google-cloud-workstations-v1/snippets/workstations/get_workstation_cluster.rb deleted file mode 100644 index 439839d2c17f..000000000000 --- a/owl-bot-staging/google-cloud-workstations-v1/snippets/workstations/get_workstation_cluster.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 workstations_v1_generated_Workstations_GetWorkstationCluster_sync] -require "google/cloud/workstations/v1" - -## -# Snippet for the get_workstation_cluster call in the Workstations 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::Workstations::V1::Workstations::Client#get_workstation_cluster. -# -def get_workstation_cluster - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Workstations::V1::Workstations::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Workstations::V1::GetWorkstationClusterRequest.new - - # Call the get_workstation_cluster method. - result = client.get_workstation_cluster request - - # The returned object is of type Google::Cloud::Workstations::V1::WorkstationCluster. - p result -end -# [END workstations_v1_generated_Workstations_GetWorkstationCluster_sync] diff --git a/owl-bot-staging/google-cloud-workstations-v1/snippets/workstations/get_workstation_config.rb b/owl-bot-staging/google-cloud-workstations-v1/snippets/workstations/get_workstation_config.rb deleted file mode 100644 index 03403b54417f..000000000000 --- a/owl-bot-staging/google-cloud-workstations-v1/snippets/workstations/get_workstation_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 workstations_v1_generated_Workstations_GetWorkstationConfig_sync] -require "google/cloud/workstations/v1" - -## -# Snippet for the get_workstation_config call in the Workstations 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::Workstations::V1::Workstations::Client#get_workstation_config. -# -def get_workstation_config - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Workstations::V1::Workstations::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Workstations::V1::GetWorkstationConfigRequest.new - - # Call the get_workstation_config method. - result = client.get_workstation_config request - - # The returned object is of type Google::Cloud::Workstations::V1::WorkstationConfig. - p result -end -# [END workstations_v1_generated_Workstations_GetWorkstationConfig_sync] diff --git a/owl-bot-staging/google-cloud-workstations-v1/snippets/workstations/list_usable_workstation_configs.rb b/owl-bot-staging/google-cloud-workstations-v1/snippets/workstations/list_usable_workstation_configs.rb deleted file mode 100644 index b829c05c865c..000000000000 --- a/owl-bot-staging/google-cloud-workstations-v1/snippets/workstations/list_usable_workstation_configs.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 workstations_v1_generated_Workstations_ListUsableWorkstationConfigs_sync] -require "google/cloud/workstations/v1" - -## -# Snippet for the list_usable_workstation_configs call in the Workstations 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::Workstations::V1::Workstations::Client#list_usable_workstation_configs. -# -def list_usable_workstation_configs - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Workstations::V1::Workstations::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Workstations::V1::ListUsableWorkstationConfigsRequest.new - - # Call the list_usable_workstation_configs method. - result = client.list_usable_workstation_configs 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::Workstations::V1::WorkstationConfig. - p item - end -end -# [END workstations_v1_generated_Workstations_ListUsableWorkstationConfigs_sync] diff --git a/owl-bot-staging/google-cloud-workstations-v1/snippets/workstations/list_usable_workstations.rb b/owl-bot-staging/google-cloud-workstations-v1/snippets/workstations/list_usable_workstations.rb deleted file mode 100644 index d7266f51ca88..000000000000 --- a/owl-bot-staging/google-cloud-workstations-v1/snippets/workstations/list_usable_workstations.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 workstations_v1_generated_Workstations_ListUsableWorkstations_sync] -require "google/cloud/workstations/v1" - -## -# Snippet for the list_usable_workstations call in the Workstations 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::Workstations::V1::Workstations::Client#list_usable_workstations. -# -def list_usable_workstations - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Workstations::V1::Workstations::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Workstations::V1::ListUsableWorkstationsRequest.new - - # Call the list_usable_workstations method. - result = client.list_usable_workstations 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::Workstations::V1::Workstation. - p item - end -end -# [END workstations_v1_generated_Workstations_ListUsableWorkstations_sync] diff --git a/owl-bot-staging/google-cloud-workstations-v1/snippets/workstations/list_workstation_clusters.rb b/owl-bot-staging/google-cloud-workstations-v1/snippets/workstations/list_workstation_clusters.rb deleted file mode 100644 index 4234e04c9aee..000000000000 --- a/owl-bot-staging/google-cloud-workstations-v1/snippets/workstations/list_workstation_clusters.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 workstations_v1_generated_Workstations_ListWorkstationClusters_sync] -require "google/cloud/workstations/v1" - -## -# Snippet for the list_workstation_clusters call in the Workstations 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::Workstations::V1::Workstations::Client#list_workstation_clusters. -# -def list_workstation_clusters - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Workstations::V1::Workstations::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Workstations::V1::ListWorkstationClustersRequest.new - - # Call the list_workstation_clusters method. - result = client.list_workstation_clusters 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::Workstations::V1::WorkstationCluster. - p item - end -end -# [END workstations_v1_generated_Workstations_ListWorkstationClusters_sync] diff --git a/owl-bot-staging/google-cloud-workstations-v1/snippets/workstations/list_workstation_configs.rb b/owl-bot-staging/google-cloud-workstations-v1/snippets/workstations/list_workstation_configs.rb deleted file mode 100644 index 8810eb261cd2..000000000000 --- a/owl-bot-staging/google-cloud-workstations-v1/snippets/workstations/list_workstation_configs.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 workstations_v1_generated_Workstations_ListWorkstationConfigs_sync] -require "google/cloud/workstations/v1" - -## -# Snippet for the list_workstation_configs call in the Workstations 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::Workstations::V1::Workstations::Client#list_workstation_configs. -# -def list_workstation_configs - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Workstations::V1::Workstations::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Workstations::V1::ListWorkstationConfigsRequest.new - - # Call the list_workstation_configs method. - result = client.list_workstation_configs 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::Workstations::V1::WorkstationConfig. - p item - end -end -# [END workstations_v1_generated_Workstations_ListWorkstationConfigs_sync] diff --git a/owl-bot-staging/google-cloud-workstations-v1/snippets/workstations/list_workstations.rb b/owl-bot-staging/google-cloud-workstations-v1/snippets/workstations/list_workstations.rb deleted file mode 100644 index f667c3ea7346..000000000000 --- a/owl-bot-staging/google-cloud-workstations-v1/snippets/workstations/list_workstations.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 workstations_v1_generated_Workstations_ListWorkstations_sync] -require "google/cloud/workstations/v1" - -## -# Snippet for the list_workstations call in the Workstations 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::Workstations::V1::Workstations::Client#list_workstations. -# -def list_workstations - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Workstations::V1::Workstations::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Workstations::V1::ListWorkstationsRequest.new - - # Call the list_workstations method. - result = client.list_workstations 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::Workstations::V1::Workstation. - p item - end -end -# [END workstations_v1_generated_Workstations_ListWorkstations_sync] diff --git a/owl-bot-staging/google-cloud-workstations-v1/snippets/workstations/start_workstation.rb b/owl-bot-staging/google-cloud-workstations-v1/snippets/workstations/start_workstation.rb deleted file mode 100644 index 8e9f7ff1738c..000000000000 --- a/owl-bot-staging/google-cloud-workstations-v1/snippets/workstations/start_workstation.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 workstations_v1_generated_Workstations_StartWorkstation_sync] -require "google/cloud/workstations/v1" - -## -# Snippet for the start_workstation call in the Workstations 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::Workstations::V1::Workstations::Client#start_workstation. -# -def start_workstation - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Workstations::V1::Workstations::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Workstations::V1::StartWorkstationRequest.new - - # Call the start_workstation method. - result = client.start_workstation 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 workstations_v1_generated_Workstations_StartWorkstation_sync] diff --git a/owl-bot-staging/google-cloud-workstations-v1/snippets/workstations/stop_workstation.rb b/owl-bot-staging/google-cloud-workstations-v1/snippets/workstations/stop_workstation.rb deleted file mode 100644 index 938fb5a5843f..000000000000 --- a/owl-bot-staging/google-cloud-workstations-v1/snippets/workstations/stop_workstation.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 workstations_v1_generated_Workstations_StopWorkstation_sync] -require "google/cloud/workstations/v1" - -## -# Snippet for the stop_workstation call in the Workstations 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::Workstations::V1::Workstations::Client#stop_workstation. -# -def stop_workstation - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Workstations::V1::Workstations::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Workstations::V1::StopWorkstationRequest.new - - # Call the stop_workstation method. - result = client.stop_workstation 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 workstations_v1_generated_Workstations_StopWorkstation_sync] diff --git a/owl-bot-staging/google-cloud-workstations-v1/snippets/workstations/update_workstation.rb b/owl-bot-staging/google-cloud-workstations-v1/snippets/workstations/update_workstation.rb deleted file mode 100644 index 7b34ea13f4bb..000000000000 --- a/owl-bot-staging/google-cloud-workstations-v1/snippets/workstations/update_workstation.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 workstations_v1_generated_Workstations_UpdateWorkstation_sync] -require "google/cloud/workstations/v1" - -## -# Snippet for the update_workstation call in the Workstations 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::Workstations::V1::Workstations::Client#update_workstation. -# -def update_workstation - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Workstations::V1::Workstations::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Workstations::V1::UpdateWorkstationRequest.new - - # Call the update_workstation method. - result = client.update_workstation 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 workstations_v1_generated_Workstations_UpdateWorkstation_sync] diff --git a/owl-bot-staging/google-cloud-workstations-v1/snippets/workstations/update_workstation_cluster.rb b/owl-bot-staging/google-cloud-workstations-v1/snippets/workstations/update_workstation_cluster.rb deleted file mode 100644 index b2c9b129aa80..000000000000 --- a/owl-bot-staging/google-cloud-workstations-v1/snippets/workstations/update_workstation_cluster.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 workstations_v1_generated_Workstations_UpdateWorkstationCluster_sync] -require "google/cloud/workstations/v1" - -## -# Snippet for the update_workstation_cluster call in the Workstations 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::Workstations::V1::Workstations::Client#update_workstation_cluster. -# -def update_workstation_cluster - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Workstations::V1::Workstations::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Workstations::V1::UpdateWorkstationClusterRequest.new - - # Call the update_workstation_cluster method. - result = client.update_workstation_cluster 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 workstations_v1_generated_Workstations_UpdateWorkstationCluster_sync] diff --git a/owl-bot-staging/google-cloud-workstations-v1/snippets/workstations/update_workstation_config.rb b/owl-bot-staging/google-cloud-workstations-v1/snippets/workstations/update_workstation_config.rb deleted file mode 100644 index f2129ee535ec..000000000000 --- a/owl-bot-staging/google-cloud-workstations-v1/snippets/workstations/update_workstation_config.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 workstations_v1_generated_Workstations_UpdateWorkstationConfig_sync] -require "google/cloud/workstations/v1" - -## -# Snippet for the update_workstation_config call in the Workstations 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::Workstations::V1::Workstations::Client#update_workstation_config. -# -def update_workstation_config - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Workstations::V1::Workstations::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Workstations::V1::UpdateWorkstationConfigRequest.new - - # Call the update_workstation_config method. - result = client.update_workstation_config 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 workstations_v1_generated_Workstations_UpdateWorkstationConfig_sync] diff --git a/owl-bot-staging/google-cloud-workstations-v1/test/google/cloud/workstations/v1/workstations_operations_test.rb b/owl-bot-staging/google-cloud-workstations-v1/test/google/cloud/workstations/v1/workstations_operations_test.rb deleted file mode 100644 index c0aa5969d1f8..000000000000 --- a/owl-bot-staging/google-cloud-workstations-v1/test/google/cloud/workstations/v1/workstations_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/workstations/v1/workstations_pb" -require "google/cloud/workstations/v1/workstations_services_pb" -require "google/cloud/workstations/v1/workstations" - -class ::Google::Cloud::Workstations::V1::Workstations::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::Workstations::V1::Workstations::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::Workstations::V1::Workstations::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::Workstations::V1::Workstations::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::Workstations::V1::Workstations::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::Workstations::V1::Workstations::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::Workstations::V1::Workstations::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::Workstations::V1::Workstations::Operations::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-workstations-v1/test/google/cloud/workstations/v1/workstations_paths_test.rb b/owl-bot-staging/google-cloud-workstations-v1/test/google/cloud/workstations/v1/workstations_paths_test.rb deleted file mode 100644 index 2411b91ff053..000000000000 --- a/owl-bot-staging/google-cloud-workstations-v1/test/google/cloud/workstations/v1/workstations_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/workstations/v1/workstations" - -class ::Google::Cloud::Workstations::V1::Workstations::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::Workstations::V1::Workstations::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_workstation_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Workstations::V1::Workstations::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.workstation_path project: "value0", location: "value1", workstation_cluster: "value2", workstation_config: "value3", workstation: "value4" - assert_equal "projects/value0/locations/value1/workstationClusters/value2/workstationConfigs/value3/workstations/value4", path - end - end - - def test_workstation_cluster_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Workstations::V1::Workstations::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.workstation_cluster_path project: "value0", location: "value1", workstation_cluster: "value2" - assert_equal "projects/value0/locations/value1/workstationClusters/value2", path - end - end - - def test_workstation_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::Workstations::V1::Workstations::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.workstation_config_path project: "value0", location: "value1", workstation_cluster: "value2", workstation_config: "value3" - assert_equal "projects/value0/locations/value1/workstationClusters/value2/workstationConfigs/value3", path - end - end -end diff --git a/owl-bot-staging/google-cloud-workstations-v1/test/google/cloud/workstations/v1/workstations_rest_test.rb b/owl-bot-staging/google-cloud-workstations-v1/test/google/cloud/workstations/v1/workstations_rest_test.rb deleted file mode 100644 index 3ac48d97c0c7..000000000000 --- a/owl-bot-staging/google-cloud-workstations-v1/test/google/cloud/workstations/v1/workstations_rest_test.rb +++ /dev/null @@ -1,1220 +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/workstations/v1/workstations_pb" -require "google/cloud/workstations/v1/workstations/rest" - - -class ::Google::Cloud::Workstations::V1::Workstations::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_get_workstation_cluster - # Create test objects. - client_result = ::Google::Cloud::Workstations::V1::WorkstationCluster.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_workstation_cluster_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::Workstations::V1::Workstations::Rest::ServiceStub.stub :transcode_get_workstation_cluster_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_workstation_cluster_client_stub do - # Create client - client = ::Google::Cloud::Workstations::V1::Workstations::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_workstation_cluster({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_workstation_cluster name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_workstation_cluster ::Google::Cloud::Workstations::V1::GetWorkstationClusterRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_workstation_cluster({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_workstation_cluster(::Google::Cloud::Workstations::V1::GetWorkstationClusterRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_workstation_cluster_client_stub.call_count - end - end - end - - def test_list_workstation_clusters - # Create test objects. - client_result = ::Google::Cloud::Workstations::V1::ListWorkstationClustersResponse.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_workstation_clusters_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::Workstations::V1::Workstations::Rest::ServiceStub.stub :transcode_list_workstation_clusters_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_workstation_clusters_client_stub do - # Create client - client = ::Google::Cloud::Workstations::V1::Workstations::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_workstation_clusters({ 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_workstation_clusters 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_workstation_clusters ::Google::Cloud::Workstations::V1::ListWorkstationClustersRequest.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_workstation_clusters({ 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_workstation_clusters(::Google::Cloud::Workstations::V1::ListWorkstationClustersRequest.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_workstation_clusters_client_stub.call_count - end - end - end - - def test_create_workstation_cluster - # 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" - workstation_cluster_id = "hello world" - workstation_cluster = {} - validate_only = true - - create_workstation_cluster_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::Workstations::V1::Workstations::Rest::ServiceStub.stub :transcode_create_workstation_cluster_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_workstation_cluster_client_stub do - # Create client - client = ::Google::Cloud::Workstations::V1::Workstations::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_workstation_cluster({ parent: parent, workstation_cluster_id: workstation_cluster_id, workstation_cluster: workstation_cluster, validate_only: validate_only }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_workstation_cluster parent: parent, workstation_cluster_id: workstation_cluster_id, workstation_cluster: workstation_cluster, validate_only: validate_only do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_workstation_cluster ::Google::Cloud::Workstations::V1::CreateWorkstationClusterRequest.new(parent: parent, workstation_cluster_id: workstation_cluster_id, workstation_cluster: workstation_cluster, validate_only: validate_only) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_workstation_cluster({ parent: parent, workstation_cluster_id: workstation_cluster_id, workstation_cluster: workstation_cluster, validate_only: validate_only }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_workstation_cluster(::Google::Cloud::Workstations::V1::CreateWorkstationClusterRequest.new(parent: parent, workstation_cluster_id: workstation_cluster_id, workstation_cluster: workstation_cluster, validate_only: validate_only), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_workstation_cluster_client_stub.call_count - end - end - end - - def test_update_workstation_cluster - # 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. - workstation_cluster = {} - update_mask = {} - validate_only = true - allow_missing = true - - update_workstation_cluster_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::Workstations::V1::Workstations::Rest::ServiceStub.stub :transcode_update_workstation_cluster_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_workstation_cluster_client_stub do - # Create client - client = ::Google::Cloud::Workstations::V1::Workstations::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.update_workstation_cluster({ workstation_cluster: workstation_cluster, update_mask: update_mask, validate_only: validate_only, allow_missing: allow_missing }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.update_workstation_cluster workstation_cluster: workstation_cluster, update_mask: update_mask, validate_only: validate_only, allow_missing: allow_missing do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.update_workstation_cluster ::Google::Cloud::Workstations::V1::UpdateWorkstationClusterRequest.new(workstation_cluster: workstation_cluster, update_mask: update_mask, validate_only: validate_only, allow_missing: allow_missing) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.update_workstation_cluster({ workstation_cluster: workstation_cluster, update_mask: update_mask, validate_only: validate_only, allow_missing: allow_missing }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.update_workstation_cluster(::Google::Cloud::Workstations::V1::UpdateWorkstationClusterRequest.new(workstation_cluster: workstation_cluster, update_mask: update_mask, validate_only: validate_only, allow_missing: allow_missing), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, update_workstation_cluster_client_stub.call_count - end - end - end - - def test_delete_workstation_cluster - # 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" - validate_only = true - etag = "hello world" - force = true - - delete_workstation_cluster_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::Workstations::V1::Workstations::Rest::ServiceStub.stub :transcode_delete_workstation_cluster_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_workstation_cluster_client_stub do - # Create client - client = ::Google::Cloud::Workstations::V1::Workstations::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.delete_workstation_cluster({ name: name, validate_only: validate_only, etag: etag, force: force }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.delete_workstation_cluster name: name, validate_only: validate_only, etag: etag, force: force do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.delete_workstation_cluster ::Google::Cloud::Workstations::V1::DeleteWorkstationClusterRequest.new(name: name, validate_only: validate_only, etag: etag, force: force) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.delete_workstation_cluster({ name: name, validate_only: validate_only, etag: etag, force: force }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.delete_workstation_cluster(::Google::Cloud::Workstations::V1::DeleteWorkstationClusterRequest.new(name: name, validate_only: validate_only, etag: etag, force: force), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, delete_workstation_cluster_client_stub.call_count - end - end - end - - def test_get_workstation_config - # Create test objects. - client_result = ::Google::Cloud::Workstations::V1::WorkstationConfig.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_workstation_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::Workstations::V1::Workstations::Rest::ServiceStub.stub :transcode_get_workstation_config_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_workstation_config_client_stub do - # Create client - client = ::Google::Cloud::Workstations::V1::Workstations::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_workstation_config({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_workstation_config name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_workstation_config ::Google::Cloud::Workstations::V1::GetWorkstationConfigRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_workstation_config({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_workstation_config(::Google::Cloud::Workstations::V1::GetWorkstationConfigRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_workstation_config_client_stub.call_count - end - end - end - - def test_list_workstation_configs - # Create test objects. - client_result = ::Google::Cloud::Workstations::V1::ListWorkstationConfigsResponse.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_workstation_configs_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::Workstations::V1::Workstations::Rest::ServiceStub.stub :transcode_list_workstation_configs_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_workstation_configs_client_stub do - # Create client - client = ::Google::Cloud::Workstations::V1::Workstations::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_workstation_configs({ 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_workstation_configs 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_workstation_configs ::Google::Cloud::Workstations::V1::ListWorkstationConfigsRequest.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_workstation_configs({ 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_workstation_configs(::Google::Cloud::Workstations::V1::ListWorkstationConfigsRequest.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_workstation_configs_client_stub.call_count - end - end - end - - def test_list_usable_workstation_configs - # Create test objects. - client_result = ::Google::Cloud::Workstations::V1::ListUsableWorkstationConfigsResponse.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_usable_workstation_configs_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::Workstations::V1::Workstations::Rest::ServiceStub.stub :transcode_list_usable_workstation_configs_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_usable_workstation_configs_client_stub do - # Create client - client = ::Google::Cloud::Workstations::V1::Workstations::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_usable_workstation_configs({ 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_usable_workstation_configs 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_usable_workstation_configs ::Google::Cloud::Workstations::V1::ListUsableWorkstationConfigsRequest.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_usable_workstation_configs({ 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_usable_workstation_configs(::Google::Cloud::Workstations::V1::ListUsableWorkstationConfigsRequest.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_usable_workstation_configs_client_stub.call_count - end - end - end - - def test_create_workstation_config - # 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" - workstation_config_id = "hello world" - workstation_config = {} - validate_only = true - - create_workstation_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::Workstations::V1::Workstations::Rest::ServiceStub.stub :transcode_create_workstation_config_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_workstation_config_client_stub do - # Create client - client = ::Google::Cloud::Workstations::V1::Workstations::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_workstation_config({ parent: parent, workstation_config_id: workstation_config_id, workstation_config: workstation_config, validate_only: validate_only }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_workstation_config parent: parent, workstation_config_id: workstation_config_id, workstation_config: workstation_config, validate_only: validate_only do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_workstation_config ::Google::Cloud::Workstations::V1::CreateWorkstationConfigRequest.new(parent: parent, workstation_config_id: workstation_config_id, workstation_config: workstation_config, validate_only: validate_only) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_workstation_config({ parent: parent, workstation_config_id: workstation_config_id, workstation_config: workstation_config, validate_only: validate_only }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_workstation_config(::Google::Cloud::Workstations::V1::CreateWorkstationConfigRequest.new(parent: parent, workstation_config_id: workstation_config_id, workstation_config: workstation_config, validate_only: validate_only), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_workstation_config_client_stub.call_count - end - end - end - - def test_update_workstation_config - # 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. - workstation_config = {} - update_mask = {} - validate_only = true - allow_missing = true - - update_workstation_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::Workstations::V1::Workstations::Rest::ServiceStub.stub :transcode_update_workstation_config_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_workstation_config_client_stub do - # Create client - client = ::Google::Cloud::Workstations::V1::Workstations::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.update_workstation_config({ workstation_config: workstation_config, update_mask: update_mask, validate_only: validate_only, allow_missing: allow_missing }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.update_workstation_config workstation_config: workstation_config, update_mask: update_mask, validate_only: validate_only, allow_missing: allow_missing do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.update_workstation_config ::Google::Cloud::Workstations::V1::UpdateWorkstationConfigRequest.new(workstation_config: workstation_config, update_mask: update_mask, validate_only: validate_only, allow_missing: allow_missing) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.update_workstation_config({ workstation_config: workstation_config, update_mask: update_mask, validate_only: validate_only, allow_missing: allow_missing }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.update_workstation_config(::Google::Cloud::Workstations::V1::UpdateWorkstationConfigRequest.new(workstation_config: workstation_config, update_mask: update_mask, validate_only: validate_only, allow_missing: allow_missing), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, update_workstation_config_client_stub.call_count - end - end - end - - def test_delete_workstation_config - # 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" - validate_only = true - etag = "hello world" - force = true - - delete_workstation_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::Workstations::V1::Workstations::Rest::ServiceStub.stub :transcode_delete_workstation_config_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_workstation_config_client_stub do - # Create client - client = ::Google::Cloud::Workstations::V1::Workstations::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.delete_workstation_config({ name: name, validate_only: validate_only, etag: etag, force: force }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.delete_workstation_config name: name, validate_only: validate_only, etag: etag, force: force do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.delete_workstation_config ::Google::Cloud::Workstations::V1::DeleteWorkstationConfigRequest.new(name: name, validate_only: validate_only, etag: etag, force: force) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.delete_workstation_config({ name: name, validate_only: validate_only, etag: etag, force: force }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.delete_workstation_config(::Google::Cloud::Workstations::V1::DeleteWorkstationConfigRequest.new(name: name, validate_only: validate_only, etag: etag, force: force), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, delete_workstation_config_client_stub.call_count - end - end - end - - def test_get_workstation - # Create test objects. - client_result = ::Google::Cloud::Workstations::V1::Workstation.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_workstation_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::Workstations::V1::Workstations::Rest::ServiceStub.stub :transcode_get_workstation_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_workstation_client_stub do - # Create client - client = ::Google::Cloud::Workstations::V1::Workstations::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_workstation({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_workstation name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_workstation ::Google::Cloud::Workstations::V1::GetWorkstationRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_workstation({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_workstation(::Google::Cloud::Workstations::V1::GetWorkstationRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_workstation_client_stub.call_count - end - end - end - - def test_list_workstations - # Create test objects. - client_result = ::Google::Cloud::Workstations::V1::ListWorkstationsResponse.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_workstations_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::Workstations::V1::Workstations::Rest::ServiceStub.stub :transcode_list_workstations_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_workstations_client_stub do - # Create client - client = ::Google::Cloud::Workstations::V1::Workstations::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_workstations({ 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_workstations 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_workstations ::Google::Cloud::Workstations::V1::ListWorkstationsRequest.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_workstations({ 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_workstations(::Google::Cloud::Workstations::V1::ListWorkstationsRequest.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_workstations_client_stub.call_count - end - end - end - - def test_list_usable_workstations - # Create test objects. - client_result = ::Google::Cloud::Workstations::V1::ListUsableWorkstationsResponse.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_usable_workstations_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::Workstations::V1::Workstations::Rest::ServiceStub.stub :transcode_list_usable_workstations_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_usable_workstations_client_stub do - # Create client - client = ::Google::Cloud::Workstations::V1::Workstations::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_usable_workstations({ 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_usable_workstations 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_usable_workstations ::Google::Cloud::Workstations::V1::ListUsableWorkstationsRequest.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_usable_workstations({ 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_usable_workstations(::Google::Cloud::Workstations::V1::ListUsableWorkstationsRequest.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_usable_workstations_client_stub.call_count - end - end - end - - def test_create_workstation - # 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" - workstation_id = "hello world" - workstation = {} - validate_only = true - - create_workstation_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::Workstations::V1::Workstations::Rest::ServiceStub.stub :transcode_create_workstation_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_workstation_client_stub do - # Create client - client = ::Google::Cloud::Workstations::V1::Workstations::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_workstation({ parent: parent, workstation_id: workstation_id, workstation: workstation, validate_only: validate_only }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_workstation parent: parent, workstation_id: workstation_id, workstation: workstation, validate_only: validate_only do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_workstation ::Google::Cloud::Workstations::V1::CreateWorkstationRequest.new(parent: parent, workstation_id: workstation_id, workstation: workstation, validate_only: validate_only) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_workstation({ parent: parent, workstation_id: workstation_id, workstation: workstation, validate_only: validate_only }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_workstation(::Google::Cloud::Workstations::V1::CreateWorkstationRequest.new(parent: parent, workstation_id: workstation_id, workstation: workstation, validate_only: validate_only), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_workstation_client_stub.call_count - end - end - end - - def test_update_workstation - # 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. - workstation = {} - update_mask = {} - validate_only = true - allow_missing = true - - update_workstation_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::Workstations::V1::Workstations::Rest::ServiceStub.stub :transcode_update_workstation_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_workstation_client_stub do - # Create client - client = ::Google::Cloud::Workstations::V1::Workstations::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.update_workstation({ workstation: workstation, update_mask: update_mask, validate_only: validate_only, allow_missing: allow_missing }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.update_workstation workstation: workstation, update_mask: update_mask, validate_only: validate_only, allow_missing: allow_missing do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.update_workstation ::Google::Cloud::Workstations::V1::UpdateWorkstationRequest.new(workstation: workstation, update_mask: update_mask, validate_only: validate_only, allow_missing: allow_missing) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.update_workstation({ workstation: workstation, update_mask: update_mask, validate_only: validate_only, allow_missing: allow_missing }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.update_workstation(::Google::Cloud::Workstations::V1::UpdateWorkstationRequest.new(workstation: workstation, update_mask: update_mask, validate_only: validate_only, allow_missing: allow_missing), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, update_workstation_client_stub.call_count - end - end - end - - def test_delete_workstation - # 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" - validate_only = true - etag = "hello world" - - delete_workstation_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::Workstations::V1::Workstations::Rest::ServiceStub.stub :transcode_delete_workstation_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_workstation_client_stub do - # Create client - client = ::Google::Cloud::Workstations::V1::Workstations::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.delete_workstation({ name: name, validate_only: validate_only, etag: etag }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.delete_workstation name: name, validate_only: validate_only, etag: etag do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.delete_workstation ::Google::Cloud::Workstations::V1::DeleteWorkstationRequest.new(name: name, validate_only: validate_only, etag: etag) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.delete_workstation({ name: name, validate_only: validate_only, etag: etag }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.delete_workstation(::Google::Cloud::Workstations::V1::DeleteWorkstationRequest.new(name: name, validate_only: validate_only, etag: etag), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, delete_workstation_client_stub.call_count - end - end - end - - def test_start_workstation - # 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" - validate_only = true - etag = "hello world" - - start_workstation_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::Workstations::V1::Workstations::Rest::ServiceStub.stub :transcode_start_workstation_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, start_workstation_client_stub do - # Create client - client = ::Google::Cloud::Workstations::V1::Workstations::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.start_workstation({ name: name, validate_only: validate_only, etag: etag }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.start_workstation name: name, validate_only: validate_only, etag: etag do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.start_workstation ::Google::Cloud::Workstations::V1::StartWorkstationRequest.new(name: name, validate_only: validate_only, etag: etag) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.start_workstation({ name: name, validate_only: validate_only, etag: etag }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.start_workstation(::Google::Cloud::Workstations::V1::StartWorkstationRequest.new(name: name, validate_only: validate_only, etag: etag), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, start_workstation_client_stub.call_count - end - end - end - - def test_stop_workstation - # 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" - validate_only = true - etag = "hello world" - - stop_workstation_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::Workstations::V1::Workstations::Rest::ServiceStub.stub :transcode_stop_workstation_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, stop_workstation_client_stub do - # Create client - client = ::Google::Cloud::Workstations::V1::Workstations::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.stop_workstation({ name: name, validate_only: validate_only, etag: etag }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.stop_workstation name: name, validate_only: validate_only, etag: etag do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.stop_workstation ::Google::Cloud::Workstations::V1::StopWorkstationRequest.new(name: name, validate_only: validate_only, etag: etag) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.stop_workstation({ name: name, validate_only: validate_only, etag: etag }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.stop_workstation(::Google::Cloud::Workstations::V1::StopWorkstationRequest.new(name: name, validate_only: validate_only, etag: etag), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, stop_workstation_client_stub.call_count - end - end - end - - def test_generate_access_token - # Create test objects. - client_result = ::Google::Cloud::Workstations::V1::GenerateAccessTokenResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - expire_time = {} - workstation = "hello world" - - generate_access_token_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::Workstations::V1::Workstations::Rest::ServiceStub.stub :transcode_generate_access_token_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, generate_access_token_client_stub do - # Create client - client = ::Google::Cloud::Workstations::V1::Workstations::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.generate_access_token({ expire_time: expire_time, workstation: workstation }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.generate_access_token expire_time: expire_time, workstation: workstation do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.generate_access_token ::Google::Cloud::Workstations::V1::GenerateAccessTokenRequest.new(expire_time: expire_time, workstation: workstation) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.generate_access_token({ expire_time: expire_time, workstation: workstation }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.generate_access_token(::Google::Cloud::Workstations::V1::GenerateAccessTokenRequest.new(expire_time: expire_time, workstation: workstation), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, generate_access_token_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::Workstations::V1::Workstations::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::Workstations::V1::Workstations::Rest::Client::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-workstations-v1/test/google/cloud/workstations/v1/workstations_test.rb b/owl-bot-staging/google-cloud-workstations-v1/test/google/cloud/workstations/v1/workstations_test.rb deleted file mode 100644 index 18791d244c13..000000000000 --- a/owl-bot-staging/google-cloud-workstations-v1/test/google/cloud/workstations/v1/workstations_test.rb +++ /dev/null @@ -1,1441 +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/workstations/v1/workstations_pb" -require "google/cloud/workstations/v1/workstations" - -class ::Google::Cloud::Workstations::V1::Workstations::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_get_workstation_cluster - # Create GRPC objects. - grpc_response = ::Google::Cloud::Workstations::V1::WorkstationCluster.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_workstation_cluster_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_workstation_cluster, name - assert_kind_of ::Google::Cloud::Workstations::V1::GetWorkstationClusterRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_workstation_cluster_client_stub do - # Create client - client = ::Google::Cloud::Workstations::V1::Workstations::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_workstation_cluster({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_workstation_cluster name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_workstation_cluster ::Google::Cloud::Workstations::V1::GetWorkstationClusterRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_workstation_cluster({ 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_workstation_cluster(::Google::Cloud::Workstations::V1::GetWorkstationClusterRequest.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_workstation_cluster_client_stub.call_rpc_count - end - end - - def test_list_workstation_clusters - # Create GRPC objects. - grpc_response = ::Google::Cloud::Workstations::V1::ListWorkstationClustersResponse.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_workstation_clusters_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_workstation_clusters, name - assert_kind_of ::Google::Cloud::Workstations::V1::ListWorkstationClustersRequest, 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_workstation_clusters_client_stub do - # Create client - client = ::Google::Cloud::Workstations::V1::Workstations::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_workstation_clusters({ 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_workstation_clusters 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_workstation_clusters ::Google::Cloud::Workstations::V1::ListWorkstationClustersRequest.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_workstation_clusters({ 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_workstation_clusters(::Google::Cloud::Workstations::V1::ListWorkstationClustersRequest.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_workstation_clusters_client_stub.call_rpc_count - end - end - - def test_create_workstation_cluster - # 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" - workstation_cluster_id = "hello world" - workstation_cluster = {} - validate_only = true - - create_workstation_cluster_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_workstation_cluster, name - assert_kind_of ::Google::Cloud::Workstations::V1::CreateWorkstationClusterRequest, request - assert_equal "hello world", request["parent"] - assert_equal "hello world", request["workstation_cluster_id"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Workstations::V1::WorkstationCluster), request["workstation_cluster"] - assert_equal true, request["validate_only"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_workstation_cluster_client_stub do - # Create client - client = ::Google::Cloud::Workstations::V1::Workstations::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_workstation_cluster({ parent: parent, workstation_cluster_id: workstation_cluster_id, workstation_cluster: workstation_cluster, validate_only: validate_only }) 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_workstation_cluster parent: parent, workstation_cluster_id: workstation_cluster_id, workstation_cluster: workstation_cluster, validate_only: validate_only 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_workstation_cluster ::Google::Cloud::Workstations::V1::CreateWorkstationClusterRequest.new(parent: parent, workstation_cluster_id: workstation_cluster_id, workstation_cluster: workstation_cluster, validate_only: validate_only) 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_workstation_cluster({ parent: parent, workstation_cluster_id: workstation_cluster_id, workstation_cluster: workstation_cluster, validate_only: validate_only }, 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_workstation_cluster(::Google::Cloud::Workstations::V1::CreateWorkstationClusterRequest.new(parent: parent, workstation_cluster_id: workstation_cluster_id, workstation_cluster: workstation_cluster, validate_only: validate_only), 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_workstation_cluster_client_stub.call_rpc_count - end - end - - def test_update_workstation_cluster - # 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. - workstation_cluster = {} - update_mask = {} - validate_only = true - allow_missing = true - - update_workstation_cluster_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_workstation_cluster, name - assert_kind_of ::Google::Cloud::Workstations::V1::UpdateWorkstationClusterRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Workstations::V1::WorkstationCluster), request["workstation_cluster"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - assert_equal true, request["validate_only"] - assert_equal true, request["allow_missing"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_workstation_cluster_client_stub do - # Create client - client = ::Google::Cloud::Workstations::V1::Workstations::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_workstation_cluster({ workstation_cluster: workstation_cluster, update_mask: update_mask, validate_only: validate_only, allow_missing: allow_missing }) 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.update_workstation_cluster workstation_cluster: workstation_cluster, update_mask: update_mask, validate_only: validate_only, allow_missing: allow_missing 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.update_workstation_cluster ::Google::Cloud::Workstations::V1::UpdateWorkstationClusterRequest.new(workstation_cluster: workstation_cluster, update_mask: update_mask, validate_only: validate_only, allow_missing: allow_missing) 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.update_workstation_cluster({ workstation_cluster: workstation_cluster, update_mask: update_mask, validate_only: validate_only, allow_missing: allow_missing }, 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.update_workstation_cluster(::Google::Cloud::Workstations::V1::UpdateWorkstationClusterRequest.new(workstation_cluster: workstation_cluster, update_mask: update_mask, validate_only: validate_only, allow_missing: allow_missing), 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, update_workstation_cluster_client_stub.call_rpc_count - end - end - - def test_delete_workstation_cluster - # 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" - validate_only = true - etag = "hello world" - force = true - - delete_workstation_cluster_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_workstation_cluster, name - assert_kind_of ::Google::Cloud::Workstations::V1::DeleteWorkstationClusterRequest, request - assert_equal "hello world", request["name"] - assert_equal true, request["validate_only"] - assert_equal "hello world", request["etag"] - assert_equal true, request["force"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_workstation_cluster_client_stub do - # Create client - client = ::Google::Cloud::Workstations::V1::Workstations::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_workstation_cluster({ name: name, validate_only: validate_only, etag: etag, force: force }) 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_workstation_cluster name: name, validate_only: validate_only, etag: etag, force: force 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_workstation_cluster ::Google::Cloud::Workstations::V1::DeleteWorkstationClusterRequest.new(name: name, validate_only: validate_only, etag: etag, force: force) 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_workstation_cluster({ name: name, validate_only: validate_only, etag: etag, force: force }, 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_workstation_cluster(::Google::Cloud::Workstations::V1::DeleteWorkstationClusterRequest.new(name: name, validate_only: validate_only, etag: etag, force: force), 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_workstation_cluster_client_stub.call_rpc_count - end - end - - def test_get_workstation_config - # Create GRPC objects. - grpc_response = ::Google::Cloud::Workstations::V1::WorkstationConfig.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_workstation_config_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_workstation_config, name - assert_kind_of ::Google::Cloud::Workstations::V1::GetWorkstationConfigRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_workstation_config_client_stub do - # Create client - client = ::Google::Cloud::Workstations::V1::Workstations::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_workstation_config({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_workstation_config name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_workstation_config ::Google::Cloud::Workstations::V1::GetWorkstationConfigRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_workstation_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_workstation_config(::Google::Cloud::Workstations::V1::GetWorkstationConfigRequest.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_workstation_config_client_stub.call_rpc_count - end - end - - def test_list_workstation_configs - # Create GRPC objects. - grpc_response = ::Google::Cloud::Workstations::V1::ListWorkstationConfigsResponse.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_workstation_configs_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_workstation_configs, name - assert_kind_of ::Google::Cloud::Workstations::V1::ListWorkstationConfigsRequest, 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_workstation_configs_client_stub do - # Create client - client = ::Google::Cloud::Workstations::V1::Workstations::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_workstation_configs({ 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_workstation_configs 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_workstation_configs ::Google::Cloud::Workstations::V1::ListWorkstationConfigsRequest.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_workstation_configs({ 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_workstation_configs(::Google::Cloud::Workstations::V1::ListWorkstationConfigsRequest.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_workstation_configs_client_stub.call_rpc_count - end - end - - def test_list_usable_workstation_configs - # Create GRPC objects. - grpc_response = ::Google::Cloud::Workstations::V1::ListUsableWorkstationConfigsResponse.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_usable_workstation_configs_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_usable_workstation_configs, name - assert_kind_of ::Google::Cloud::Workstations::V1::ListUsableWorkstationConfigsRequest, 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_usable_workstation_configs_client_stub do - # Create client - client = ::Google::Cloud::Workstations::V1::Workstations::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_usable_workstation_configs({ 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_usable_workstation_configs 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_usable_workstation_configs ::Google::Cloud::Workstations::V1::ListUsableWorkstationConfigsRequest.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_usable_workstation_configs({ 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_usable_workstation_configs(::Google::Cloud::Workstations::V1::ListUsableWorkstationConfigsRequest.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_usable_workstation_configs_client_stub.call_rpc_count - end - end - - def test_create_workstation_config - # 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" - workstation_config_id = "hello world" - workstation_config = {} - validate_only = true - - create_workstation_config_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_workstation_config, name - assert_kind_of ::Google::Cloud::Workstations::V1::CreateWorkstationConfigRequest, request - assert_equal "hello world", request["parent"] - assert_equal "hello world", request["workstation_config_id"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Workstations::V1::WorkstationConfig), request["workstation_config"] - assert_equal true, request["validate_only"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_workstation_config_client_stub do - # Create client - client = ::Google::Cloud::Workstations::V1::Workstations::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_workstation_config({ parent: parent, workstation_config_id: workstation_config_id, workstation_config: workstation_config, validate_only: validate_only }) 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_workstation_config parent: parent, workstation_config_id: workstation_config_id, workstation_config: workstation_config, validate_only: validate_only 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_workstation_config ::Google::Cloud::Workstations::V1::CreateWorkstationConfigRequest.new(parent: parent, workstation_config_id: workstation_config_id, workstation_config: workstation_config, validate_only: validate_only) 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_workstation_config({ parent: parent, workstation_config_id: workstation_config_id, workstation_config: workstation_config, validate_only: validate_only }, 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_workstation_config(::Google::Cloud::Workstations::V1::CreateWorkstationConfigRequest.new(parent: parent, workstation_config_id: workstation_config_id, workstation_config: workstation_config, validate_only: validate_only), 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_workstation_config_client_stub.call_rpc_count - end - end - - def test_update_workstation_config - # 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. - workstation_config = {} - update_mask = {} - validate_only = true - allow_missing = true - - update_workstation_config_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_workstation_config, name - assert_kind_of ::Google::Cloud::Workstations::V1::UpdateWorkstationConfigRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Workstations::V1::WorkstationConfig), request["workstation_config"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - assert_equal true, request["validate_only"] - assert_equal true, request["allow_missing"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_workstation_config_client_stub do - # Create client - client = ::Google::Cloud::Workstations::V1::Workstations::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_workstation_config({ workstation_config: workstation_config, update_mask: update_mask, validate_only: validate_only, allow_missing: allow_missing }) 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.update_workstation_config workstation_config: workstation_config, update_mask: update_mask, validate_only: validate_only, allow_missing: allow_missing 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.update_workstation_config ::Google::Cloud::Workstations::V1::UpdateWorkstationConfigRequest.new(workstation_config: workstation_config, update_mask: update_mask, validate_only: validate_only, allow_missing: allow_missing) 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.update_workstation_config({ workstation_config: workstation_config, update_mask: update_mask, validate_only: validate_only, allow_missing: allow_missing }, 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.update_workstation_config(::Google::Cloud::Workstations::V1::UpdateWorkstationConfigRequest.new(workstation_config: workstation_config, update_mask: update_mask, validate_only: validate_only, allow_missing: allow_missing), 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, update_workstation_config_client_stub.call_rpc_count - end - end - - def test_delete_workstation_config - # 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" - validate_only = true - etag = "hello world" - force = true - - delete_workstation_config_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_workstation_config, name - assert_kind_of ::Google::Cloud::Workstations::V1::DeleteWorkstationConfigRequest, request - assert_equal "hello world", request["name"] - assert_equal true, request["validate_only"] - assert_equal "hello world", request["etag"] - assert_equal true, request["force"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_workstation_config_client_stub do - # Create client - client = ::Google::Cloud::Workstations::V1::Workstations::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_workstation_config({ name: name, validate_only: validate_only, etag: etag, force: force }) 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_workstation_config name: name, validate_only: validate_only, etag: etag, force: force 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_workstation_config ::Google::Cloud::Workstations::V1::DeleteWorkstationConfigRequest.new(name: name, validate_only: validate_only, etag: etag, force: force) 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_workstation_config({ name: name, validate_only: validate_only, etag: etag, force: force }, 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_workstation_config(::Google::Cloud::Workstations::V1::DeleteWorkstationConfigRequest.new(name: name, validate_only: validate_only, etag: etag, force: force), 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_workstation_config_client_stub.call_rpc_count - end - end - - def test_get_workstation - # Create GRPC objects. - grpc_response = ::Google::Cloud::Workstations::V1::Workstation.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_workstation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_workstation, name - assert_kind_of ::Google::Cloud::Workstations::V1::GetWorkstationRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_workstation_client_stub do - # Create client - client = ::Google::Cloud::Workstations::V1::Workstations::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_workstation({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_workstation name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_workstation ::Google::Cloud::Workstations::V1::GetWorkstationRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_workstation({ 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_workstation(::Google::Cloud::Workstations::V1::GetWorkstationRequest.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_workstation_client_stub.call_rpc_count - end - end - - def test_list_workstations - # Create GRPC objects. - grpc_response = ::Google::Cloud::Workstations::V1::ListWorkstationsResponse.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_workstations_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_workstations, name - assert_kind_of ::Google::Cloud::Workstations::V1::ListWorkstationsRequest, 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_workstations_client_stub do - # Create client - client = ::Google::Cloud::Workstations::V1::Workstations::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_workstations({ 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_workstations 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_workstations ::Google::Cloud::Workstations::V1::ListWorkstationsRequest.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_workstations({ 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_workstations(::Google::Cloud::Workstations::V1::ListWorkstationsRequest.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_workstations_client_stub.call_rpc_count - end - end - - def test_list_usable_workstations - # Create GRPC objects. - grpc_response = ::Google::Cloud::Workstations::V1::ListUsableWorkstationsResponse.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_usable_workstations_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_usable_workstations, name - assert_kind_of ::Google::Cloud::Workstations::V1::ListUsableWorkstationsRequest, 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_usable_workstations_client_stub do - # Create client - client = ::Google::Cloud::Workstations::V1::Workstations::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_usable_workstations({ 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_usable_workstations 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_usable_workstations ::Google::Cloud::Workstations::V1::ListUsableWorkstationsRequest.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_usable_workstations({ 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_usable_workstations(::Google::Cloud::Workstations::V1::ListUsableWorkstationsRequest.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_usable_workstations_client_stub.call_rpc_count - end - end - - def test_create_workstation - # 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" - workstation_id = "hello world" - workstation = {} - validate_only = true - - create_workstation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_workstation, name - assert_kind_of ::Google::Cloud::Workstations::V1::CreateWorkstationRequest, request - assert_equal "hello world", request["parent"] - assert_equal "hello world", request["workstation_id"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Workstations::V1::Workstation), request["workstation"] - assert_equal true, request["validate_only"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_workstation_client_stub do - # Create client - client = ::Google::Cloud::Workstations::V1::Workstations::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_workstation({ parent: parent, workstation_id: workstation_id, workstation: workstation, validate_only: validate_only }) 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_workstation parent: parent, workstation_id: workstation_id, workstation: workstation, validate_only: validate_only 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_workstation ::Google::Cloud::Workstations::V1::CreateWorkstationRequest.new(parent: parent, workstation_id: workstation_id, workstation: workstation, validate_only: validate_only) 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_workstation({ parent: parent, workstation_id: workstation_id, workstation: workstation, validate_only: validate_only }, 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_workstation(::Google::Cloud::Workstations::V1::CreateWorkstationRequest.new(parent: parent, workstation_id: workstation_id, workstation: workstation, validate_only: validate_only), 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_workstation_client_stub.call_rpc_count - end - end - - def test_update_workstation - # 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. - workstation = {} - update_mask = {} - validate_only = true - allow_missing = true - - update_workstation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_workstation, name - assert_kind_of ::Google::Cloud::Workstations::V1::UpdateWorkstationRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Workstations::V1::Workstation), request["workstation"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - assert_equal true, request["validate_only"] - assert_equal true, request["allow_missing"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_workstation_client_stub do - # Create client - client = ::Google::Cloud::Workstations::V1::Workstations::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_workstation({ workstation: workstation, update_mask: update_mask, validate_only: validate_only, allow_missing: allow_missing }) 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.update_workstation workstation: workstation, update_mask: update_mask, validate_only: validate_only, allow_missing: allow_missing 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.update_workstation ::Google::Cloud::Workstations::V1::UpdateWorkstationRequest.new(workstation: workstation, update_mask: update_mask, validate_only: validate_only, allow_missing: allow_missing) 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.update_workstation({ workstation: workstation, update_mask: update_mask, validate_only: validate_only, allow_missing: allow_missing }, 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.update_workstation(::Google::Cloud::Workstations::V1::UpdateWorkstationRequest.new(workstation: workstation, update_mask: update_mask, validate_only: validate_only, allow_missing: allow_missing), 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, update_workstation_client_stub.call_rpc_count - end - end - - def test_delete_workstation - # 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" - validate_only = true - etag = "hello world" - - delete_workstation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_workstation, name - assert_kind_of ::Google::Cloud::Workstations::V1::DeleteWorkstationRequest, request - assert_equal "hello world", request["name"] - assert_equal true, request["validate_only"] - assert_equal "hello world", request["etag"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_workstation_client_stub do - # Create client - client = ::Google::Cloud::Workstations::V1::Workstations::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_workstation({ name: name, validate_only: validate_only, etag: etag }) 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_workstation name: name, validate_only: validate_only, etag: etag 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_workstation ::Google::Cloud::Workstations::V1::DeleteWorkstationRequest.new(name: name, validate_only: validate_only, etag: etag) 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_workstation({ name: name, validate_only: validate_only, etag: etag }, 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_workstation(::Google::Cloud::Workstations::V1::DeleteWorkstationRequest.new(name: name, validate_only: validate_only, etag: etag), 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_workstation_client_stub.call_rpc_count - end - end - - def test_start_workstation - # 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" - validate_only = true - etag = "hello world" - - start_workstation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :start_workstation, name - assert_kind_of ::Google::Cloud::Workstations::V1::StartWorkstationRequest, request - assert_equal "hello world", request["name"] - assert_equal true, request["validate_only"] - assert_equal "hello world", request["etag"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, start_workstation_client_stub do - # Create client - client = ::Google::Cloud::Workstations::V1::Workstations::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.start_workstation({ name: name, validate_only: validate_only, etag: etag }) 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.start_workstation name: name, validate_only: validate_only, etag: etag 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.start_workstation ::Google::Cloud::Workstations::V1::StartWorkstationRequest.new(name: name, validate_only: validate_only, etag: etag) 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.start_workstation({ name: name, validate_only: validate_only, etag: etag }, 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.start_workstation(::Google::Cloud::Workstations::V1::StartWorkstationRequest.new(name: name, validate_only: validate_only, etag: etag), 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, start_workstation_client_stub.call_rpc_count - end - end - - def test_stop_workstation - # 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" - validate_only = true - etag = "hello world" - - stop_workstation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :stop_workstation, name - assert_kind_of ::Google::Cloud::Workstations::V1::StopWorkstationRequest, request - assert_equal "hello world", request["name"] - assert_equal true, request["validate_only"] - assert_equal "hello world", request["etag"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, stop_workstation_client_stub do - # Create client - client = ::Google::Cloud::Workstations::V1::Workstations::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.stop_workstation({ name: name, validate_only: validate_only, etag: etag }) 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.stop_workstation name: name, validate_only: validate_only, etag: etag 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.stop_workstation ::Google::Cloud::Workstations::V1::StopWorkstationRequest.new(name: name, validate_only: validate_only, etag: etag) 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.stop_workstation({ name: name, validate_only: validate_only, etag: etag }, 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.stop_workstation(::Google::Cloud::Workstations::V1::StopWorkstationRequest.new(name: name, validate_only: validate_only, etag: etag), 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, stop_workstation_client_stub.call_rpc_count - end - end - - def test_generate_access_token - # Create GRPC objects. - grpc_response = ::Google::Cloud::Workstations::V1::GenerateAccessTokenResponse.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. - expire_time = {} - workstation = "hello world" - - generate_access_token_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :generate_access_token, name - assert_kind_of ::Google::Cloud::Workstations::V1::GenerateAccessTokenRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Timestamp), request["expire_time"] - assert_equal :expire_time, request.expiration - assert_equal "hello world", request["workstation"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, generate_access_token_client_stub do - # Create client - client = ::Google::Cloud::Workstations::V1::Workstations::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.generate_access_token({ expire_time: expire_time, workstation: workstation }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.generate_access_token expire_time: expire_time, workstation: workstation do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.generate_access_token ::Google::Cloud::Workstations::V1::GenerateAccessTokenRequest.new(expire_time: expire_time, workstation: workstation) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.generate_access_token({ expire_time: expire_time, workstation: workstation }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.generate_access_token(::Google::Cloud::Workstations::V1::GenerateAccessTokenRequest.new(expire_time: expire_time, workstation: workstation), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, generate_access_token_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::Workstations::V1::Workstations::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::Workstations::V1::Workstations::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::Workstations::V1::Workstations::Client.new do |config| - config.credentials = creds - end - assert_kind_of ::Google::Cloud::Workstations::V1::Workstations::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::Workstations::V1::Workstations::Client.new do |config| - config.credentials = grpc_channel - end - end - - assert_kind_of ::Google::Cloud::Workstations::V1::Workstations::Operations, client.operations_client - end -end diff --git a/owl-bot-staging/google-cloud-workstations-v1/test/helper.rb b/owl-bot-staging/google-cloud-workstations-v1/test/helper.rb deleted file mode 100644 index 672b337030e7..000000000000 --- a/owl-bot-staging/google-cloud-workstations-v1/test/helper.rb +++ /dev/null @@ -1,26 +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/mock" -require "minitest/rg" - -require "grpc" - -require "ostruct" diff --git a/owl-bot-staging/google-cloud-workstations-v1beta/.gitignore b/owl-bot-staging/google-cloud-workstations-v1beta/.gitignore deleted file mode 100644 index 0135b6bc6cfc..000000000000 --- a/owl-bot-staging/google-cloud-workstations-v1beta/.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-workstations-v1beta/.repo-metadata.json b/owl-bot-staging/google-cloud-workstations-v1beta/.repo-metadata.json deleted file mode 100644 index 1f075089291e..000000000000 --- a/owl-bot-staging/google-cloud-workstations-v1beta/.repo-metadata.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "api_id": "workstations.googleapis.com", - "api_shortname": "workstations", - "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-cloud-workstations-v1beta/latest", - "distribution_name": "google-cloud-workstations-v1beta", - "is_cloud": true, - "language": "ruby", - "name": "workstations", - "name_pretty": "Cloud Workstations V1BETA API", - "product_documentation": "https://cloud.google.com/workstations/docs", - "release_level": "unreleased", - "repo": "googleapis/google-cloud-ruby", - "requires_billing": true, - "ruby-cloud-description": "Allows administrators to create managed developer environments in the cloud. Note that google-cloud-workstations-v1beta is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-workstations instead. See the readme for more details.", - "ruby-cloud-product-url": "https://cloud.google.com/workstations/docs", - "library_type": "GAPIC_AUTO" -} diff --git a/owl-bot-staging/google-cloud-workstations-v1beta/.rubocop.yml b/owl-bot-staging/google-cloud-workstations-v1beta/.rubocop.yml deleted file mode 100644 index 7ef831857790..000000000000 --- a/owl-bot-staging/google-cloud-workstations-v1beta/.rubocop.yml +++ /dev/null @@ -1,33 +0,0 @@ -inherit_gem: - google-style: google-style.yml - -AllCops: - Exclude: - - "google-cloud-workstations-v1beta.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-workstations-v1beta.rb" diff --git a/owl-bot-staging/google-cloud-workstations-v1beta/.toys.rb b/owl-bot-staging/google-cloud-workstations-v1beta/.toys.rb deleted file mode 100644 index 177e22456e8a..000000000000 --- a/owl-bot-staging/google-cloud-workstations-v1beta/.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-workstations-v1beta/.yardopts b/owl-bot-staging/google-cloud-workstations-v1beta/.yardopts deleted file mode 100644 index 760a9a0f14a5..000000000000 --- a/owl-bot-staging/google-cloud-workstations-v1beta/.yardopts +++ /dev/null @@ -1,12 +0,0 @@ ---no-private ---title="Cloud Workstations V1BETA 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-workstations-v1beta/AUTHENTICATION.md b/owl-bot-staging/google-cloud-workstations-v1beta/AUTHENTICATION.md deleted file mode 100644 index 31c9da61967d..000000000000 --- a/owl-bot-staging/google-cloud-workstations-v1beta/AUTHENTICATION.md +++ /dev/null @@ -1,122 +0,0 @@ -# Authentication - -The recommended way to authenticate to the google-cloud-workstations-v1beta 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-workstations-v1beta 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/workstations/v1beta" - -client = ::Google::Cloud::Workstations::V1beta::Workstations::Client.new do |config| - config.credentials = "path/to/credentialfile.json" -end -``` - -To configure a credentials file globally for all clients: - -```ruby -require "google/cloud/workstations/v1beta" - -::Google::Cloud::Workstations::V1beta::Workstations::Client.configure do |config| - config.credentials = "path/to/credentialfile.json" -end - -client = ::Google::Cloud::Workstations::V1beta::Workstations::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-workstations-v1beta -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/workstations/v1beta" - -ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" - -client = ::Google::Cloud::Workstations::V1beta::Workstations::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-workstations-v1beta/CHANGELOG.md b/owl-bot-staging/google-cloud-workstations-v1beta/CHANGELOG.md deleted file mode 100644 index f88957a62ba2..000000000000 --- a/owl-bot-staging/google-cloud-workstations-v1beta/CHANGELOG.md +++ /dev/null @@ -1,2 +0,0 @@ -# Release History - diff --git a/owl-bot-staging/google-cloud-workstations-v1beta/Gemfile b/owl-bot-staging/google-cloud-workstations-v1beta/Gemfile deleted file mode 100644 index 1d08558908d8..000000000000 --- a/owl-bot-staging/google-cloud-workstations-v1beta/Gemfile +++ /dev/null @@ -1,14 +0,0 @@ -source "https://rubygems.org" - -gemspec - -gem "google-style", "~> 1.32.0" -gem "irb", "~> 1.17" -gem "minitest", "~> 6.0.2" -gem "minitest-focus", "~> 1.4" -gem "minitest-mock", "~> 5.27" -gem "minitest-rg", "~> 5.3" -gem "ostruct", "~> 0.5.5" -gem "rake", ">= 13.0" -gem "redcarpet", "~> 3.6" -gem "yard", "~> 0.9" diff --git a/owl-bot-staging/google-cloud-workstations-v1beta/LICENSE.md b/owl-bot-staging/google-cloud-workstations-v1beta/LICENSE.md deleted file mode 100644 index c261857ba6ad..000000000000 --- a/owl-bot-staging/google-cloud-workstations-v1beta/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-workstations-v1beta/README.md b/owl-bot-staging/google-cloud-workstations-v1beta/README.md deleted file mode 100644 index 97a3e0b962f0..000000000000 --- a/owl-bot-staging/google-cloud-workstations-v1beta/README.md +++ /dev/null @@ -1,153 +0,0 @@ -# Ruby Client for the Cloud Workstations V1BETA API - -Allows administrators to create managed developer environments in the cloud. - - -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 Workstations V1BETA API. Most users should consider using -the main client gem, -[google-cloud-workstations](https://rubygems.org/gems/google-cloud-workstations). -See the section below titled *Which client should I use?* for more information. - -## Installation - -``` -$ gem install google-cloud-workstations-v1beta -``` - -## 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/workstations.googleapis.com) -1. [Set up authentication.](AUTHENTICATION.md) - -## Quick Start - -```ruby -require "google/cloud/workstations/v1beta" - -client = ::Google::Cloud::Workstations::V1beta::Workstations::Client.new -request = ::Google::Cloud::Workstations::V1beta::GetWorkstationClusterRequest.new # (request fields as keyword arguments...) -response = client.get_workstation_cluster request -``` - -View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-workstations-v1beta/latest) -for class and method documentation. - -See also the [Product Documentation](https://cloud.google.com/workstations/docs) -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/workstations/v1beta" -require "logger" - -client = ::Google::Cloud::Workstations::V1beta::Workstations::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-workstations`, -and lower-level _versioned_ client libraries with names such as -`google-cloud-workstations-v1beta`. -_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-workstations`. -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-workstations-v1beta`. - -### 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-workstations-v1beta/Rakefile b/owl-bot-staging/google-cloud-workstations-v1beta/Rakefile deleted file mode 100644 index 19a6e40ad1cb..000000000000 --- a/owl-bot-staging/google-cloud-workstations-v1beta/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-workstations-v1beta acceptance tests." -task :acceptance, :project, :keyfile do |t, args| - project = args[:project] - project ||= - ENV["GOOGLE_CLOUD_TEST_PROJECT"] || - ENV["GCLOUD_TEST_PROJECT"] - keyfile = args[:keyfile] - keyfile ||= - ENV["GOOGLE_CLOUD_TEST_KEYFILE"] || - ENV["GCLOUD_TEST_KEYFILE"] - if keyfile - keyfile = File.read keyfile - else - keyfile ||= - ENV["GOOGLE_CLOUD_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 GOOGLE_CLOUD_TEST_PROJECT=test123 GOOGLE_CLOUD_TEST_KEYFILE=/path/to/keyfile.json rake acceptance" - end - require "google/cloud/workstations/v1beta/workstations/credentials" - ::Google::Cloud::Workstations::V1beta::Workstations::Credentials.env_vars.each do |path| - ENV[path] = nil - end - ENV["GOOGLE_CLOUD_PROJECT"] = project - ENV["GOOGLE_CLOUD_TEST_PROJECT"] = project - ENV["GOOGLE_CLOUD_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-workstations-v1beta 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-workstations-v1beta 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-workstations-v1beta 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-workstations-v1beta gem does not have doctest tests." -end - -desc "Run the CI build" -task :ci do - header "BUILDING google-cloud-workstations-v1beta" - header "google-cloud-workstations-v1beta rubocop", "*" - Rake::Task[:rubocop].invoke - header "google-cloud-workstations-v1beta yard", "*" - Rake::Task[:yard].invoke - header "google-cloud-workstations-v1beta 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-workstations-v1beta 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-workstations-v1beta 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-workstations-v1beta/gapic_metadata.json b/owl-bot-staging/google-cloud-workstations-v1beta/gapic_metadata.json deleted file mode 100644 index f14a54eb9f14..000000000000 --- a/owl-bot-staging/google-cloud-workstations-v1beta/gapic_metadata.json +++ /dev/null @@ -1,118 +0,0 @@ -{ - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", - "language": "ruby", - "protoPackage": "google.cloud.workstations.v1beta", - "libraryPackage": "::Google::Cloud::Workstations::V1beta", - "services": { - "Workstations": { - "clients": { - "grpc": { - "libraryClient": "::Google::Cloud::Workstations::V1beta::Workstations::Client", - "rpcs": { - "GetWorkstationCluster": { - "methods": [ - "get_workstation_cluster" - ] - }, - "ListWorkstationClusters": { - "methods": [ - "list_workstation_clusters" - ] - }, - "CreateWorkstationCluster": { - "methods": [ - "create_workstation_cluster" - ] - }, - "UpdateWorkstationCluster": { - "methods": [ - "update_workstation_cluster" - ] - }, - "DeleteWorkstationCluster": { - "methods": [ - "delete_workstation_cluster" - ] - }, - "GetWorkstationConfig": { - "methods": [ - "get_workstation_config" - ] - }, - "ListWorkstationConfigs": { - "methods": [ - "list_workstation_configs" - ] - }, - "ListUsableWorkstationConfigs": { - "methods": [ - "list_usable_workstation_configs" - ] - }, - "CreateWorkstationConfig": { - "methods": [ - "create_workstation_config" - ] - }, - "UpdateWorkstationConfig": { - "methods": [ - "update_workstation_config" - ] - }, - "DeleteWorkstationConfig": { - "methods": [ - "delete_workstation_config" - ] - }, - "GetWorkstation": { - "methods": [ - "get_workstation" - ] - }, - "ListWorkstations": { - "methods": [ - "list_workstations" - ] - }, - "ListUsableWorkstations": { - "methods": [ - "list_usable_workstations" - ] - }, - "CreateWorkstation": { - "methods": [ - "create_workstation" - ] - }, - "UpdateWorkstation": { - "methods": [ - "update_workstation" - ] - }, - "DeleteWorkstation": { - "methods": [ - "delete_workstation" - ] - }, - "StartWorkstation": { - "methods": [ - "start_workstation" - ] - }, - "StopWorkstation": { - "methods": [ - "stop_workstation" - ] - }, - "GenerateAccessToken": { - "methods": [ - "generate_access_token" - ] - } - } - } - } - } - } -} diff --git a/owl-bot-staging/google-cloud-workstations-v1beta/google-cloud-workstations-v1beta.gemspec b/owl-bot-staging/google-cloud-workstations-v1beta/google-cloud-workstations-v1beta.gemspec deleted file mode 100644 index 5c79f5000963..000000000000 --- a/owl-bot-staging/google-cloud-workstations-v1beta/google-cloud-workstations-v1beta.gemspec +++ /dev/null @@ -1,30 +0,0 @@ -# -*- ruby -*- -# encoding: utf-8 - -require File.expand_path("lib/google/cloud/workstations/v1beta/version", __dir__) - -Gem::Specification.new do |gem| - gem.name = "google-cloud-workstations-v1beta" - gem.version = Google::Cloud::Workstations::V1beta::VERSION - - gem.authors = ["Google LLC"] - gem.email = "googleapis-packages@google.com" - gem.description = "Allows administrators to create managed developer environments in the cloud. Note that google-cloud-workstations-v1beta is a version-specific client library. For most uses, we recommend installing the main client library google-cloud-workstations instead. See the readme for more details." - gem.summary = "Allows administrators to create managed developer environments in the cloud." - 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.2" - - 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-workstations-v1beta/lib/google-cloud-workstations-v1beta.rb b/owl-bot-staging/google-cloud-workstations-v1beta/lib/google-cloud-workstations-v1beta.rb deleted file mode 100644 index a0188c280162..000000000000 --- a/owl-bot-staging/google-cloud-workstations-v1beta/lib/google-cloud-workstations-v1beta.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/workstations/v1beta" diff --git a/owl-bot-staging/google-cloud-workstations-v1beta/lib/google/cloud/workstations/v1beta.rb b/owl-bot-staging/google-cloud-workstations-v1beta/lib/google/cloud/workstations/v1beta.rb deleted file mode 100644 index c7ef63fc2912..000000000000 --- a/owl-bot-staging/google-cloud-workstations-v1beta/lib/google/cloud/workstations/v1beta.rb +++ /dev/null @@ -1,45 +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/workstations/v1beta/workstations" -require "google/cloud/workstations/v1beta/version" - -module Google - module Cloud - module Workstations - ## - # API client module. - # - # @example Load this package, including all its services, and instantiate a gRPC client - # - # require "google/cloud/workstations/v1beta" - # client = ::Google::Cloud::Workstations::V1beta::Workstations::Client.new - # - # @example Load this package, including all its services, and instantiate a REST client - # - # require "google/cloud/workstations/v1beta" - # client = ::Google::Cloud::Workstations::V1beta::Workstations::Rest::Client.new - # - module V1beta - end - end - end -end - -helper_path = ::File.join __dir__, "v1beta", "_helpers.rb" -require "google/cloud/workstations/v1beta/_helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-workstations-v1beta/lib/google/cloud/workstations/v1beta/bindings_override.rb b/owl-bot-staging/google-cloud-workstations-v1beta/lib/google/cloud/workstations/v1beta/bindings_override.rb deleted file mode 100644 index 2b52965b4f26..000000000000 --- a/owl-bot-staging/google-cloud-workstations-v1beta/lib/google/cloud/workstations/v1beta/bindings_override.rb +++ /dev/null @@ -1,110 +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 Workstations - ## - # @example Loading just the REST part of this package, including all its services, and instantiating a REST client - # - # require "google/cloud/workstations/v1beta/rest" - # client = ::Google::Cloud::Workstations::V1beta::Workstations::Rest::Client.new - # - module V1beta - ## - # @private - # Initialize the mixin bindings configuration - # - def self.configure - @configure ||= begin - namespace = ["Google", "Cloud", "Workstations"] - 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.iam.v1.IAMPolicy.GetIamPolicy"] = [ - Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( - uri_method: :get, - uri_template: "/v1beta/{resource}:getIamPolicy", - matches: [ - ["resource", %r{^projects/[^/]+/locations/[^/]+/workstationClusters/[^/]+/workstationConfigs/[^/]+/?$}, false] - ], - body: nil - ), - Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( - uri_method: :get, - uri_template: "/v1beta/{resource}:getIamPolicy", - matches: [ - ["resource", %r{^projects/[^/]+/locations/[^/]+/workstationClusters/[^/]+/workstationConfigs/[^/]+/workstations/[^/]+/?$}, false] - ], - body: nil - ) - ] - default_config.bindings_override["google.iam.v1.IAMPolicy.SetIamPolicy"] = [ - - Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( - uri_method: :post, - uri_template: "/v1beta/{resource}:setIamPolicy", - matches: [ - ["resource", %r{^projects/[^/]+/locations/[^/]+/workstationClusters/[^/]+/workstationConfigs/[^/]+/?$}, false] - ], - body: "*" - ), - Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( - uri_method: :post, - uri_template: "/v1beta/{resource}:setIamPolicy", - matches: [ - ["resource", %r{^projects/[^/]+/locations/[^/]+/workstationClusters/[^/]+/workstationConfigs/[^/]+/workstations/[^/]+/?$}, false] - ], - body: "*" - ) - ] - default_config.bindings_override["google.iam.v1.IAMPolicy.TestIamPermissions"] = [ - - Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( - uri_method: :post, - uri_template: "/v1beta/{resource}:testIamPermissions", - matches: [ - ["resource", %r{^projects/[^/]+/locations/[^/]+/workstationClusters/[^/]+/workstationConfigs/[^/]+/?$}, false] - ], - body: "*" - ), - Gapic::Rest::GrpcTranscoder::HttpBinding.create_with_validation( - uri_method: :post, - uri_template: "/v1beta/{resource}:testIamPermissions", - matches: [ - ["resource", %r{^projects/[^/]+/locations/[^/]+/workstationClusters/[^/]+/workstationConfigs/[^/]+/workstations/[^/]+/?$}, false] - ], - body: "*" - ) - ] - default_config - end - yield @configure if block_given? - @configure - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-workstations-v1beta/lib/google/cloud/workstations/v1beta/rest.rb b/owl-bot-staging/google-cloud-workstations-v1beta/lib/google/cloud/workstations/v1beta/rest.rb deleted file mode 100644 index 80bc9428e548..000000000000 --- a/owl-bot-staging/google-cloud-workstations-v1beta/lib/google/cloud/workstations/v1beta/rest.rb +++ /dev/null @@ -1,38 +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/workstations/v1beta/workstations/rest" -require "google/cloud/workstations/v1beta/bindings_override" -require "google/cloud/workstations/v1beta/version" - -module Google - module Cloud - module Workstations - ## - # To load just the REST part of this package, including all its services, and instantiate a REST client: - # - # @example - # - # require "google/cloud/workstations/v1beta/rest" - # client = ::Google::Cloud::Workstations::V1beta::Workstations::Rest::Client.new - # - module V1beta - end - end - end -end diff --git a/owl-bot-staging/google-cloud-workstations-v1beta/lib/google/cloud/workstations/v1beta/version.rb b/owl-bot-staging/google-cloud-workstations-v1beta/lib/google/cloud/workstations/v1beta/version.rb deleted file mode 100644 index 4f71d3f1ee75..000000000000 --- a/owl-bot-staging/google-cloud-workstations-v1beta/lib/google/cloud/workstations/v1beta/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 Workstations - module V1beta - VERSION = "0.0.1" - end - end - end -end diff --git a/owl-bot-staging/google-cloud-workstations-v1beta/lib/google/cloud/workstations/v1beta/workstations.rb b/owl-bot-staging/google-cloud-workstations-v1beta/lib/google/cloud/workstations/v1beta/workstations.rb deleted file mode 100644 index b0c7dfb12bbf..000000000000 --- a/owl-bot-staging/google-cloud-workstations-v1beta/lib/google/cloud/workstations/v1beta/workstations.rb +++ /dev/null @@ -1,56 +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/workstations/v1beta/version" - -require "google/cloud/workstations/v1beta/workstations/credentials" -require "google/cloud/workstations/v1beta/workstations/paths" -require "google/cloud/workstations/v1beta/workstations/operations" -require "google/cloud/workstations/v1beta/workstations/client" -require "google/cloud/workstations/v1beta/workstations/rest" - -module Google - module Cloud - module Workstations - module V1beta - ## - # Service for interacting with Cloud Workstations. - # - # @example Load this service and instantiate a gRPC client - # - # require "google/cloud/workstations/v1beta/workstations" - # client = ::Google::Cloud::Workstations::V1beta::Workstations::Client.new - # - # @example Load this service and instantiate a REST client - # - # require "google/cloud/workstations/v1beta/workstations/rest" - # client = ::Google::Cloud::Workstations::V1beta::Workstations::Rest::Client.new - # - module Workstations - end - end - end - end -end - -helper_path = ::File.join __dir__, "workstations", "helpers.rb" -require "google/cloud/workstations/v1beta/workstations/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-workstations-v1beta/lib/google/cloud/workstations/v1beta/workstations/client.rb b/owl-bot-staging/google-cloud-workstations-v1beta/lib/google/cloud/workstations/v1beta/workstations/client.rb deleted file mode 100644 index 0921d9287c0a..000000000000 --- a/owl-bot-staging/google-cloud-workstations-v1beta/lib/google/cloud/workstations/v1beta/workstations/client.rb +++ /dev/null @@ -1,2595 +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/workstations/v1beta/workstations_pb" -require "google/cloud/location" -require "google/iam/v1" - -module Google - module Cloud - module Workstations - module V1beta - module Workstations - ## - # Client for the Workstations service. - # - # Service for interacting with Cloud Workstations. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "workstations.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :workstations_stub - - ## - # Configure the Workstations Client class. - # - # See {::Google::Cloud::Workstations::V1beta::Workstations::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all Workstations clients - # ::Google::Cloud::Workstations::V1beta::Workstations::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", "Workstations", "V1beta"] - 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.get_workstation_cluster.timeout = 60.0 - default_config.rpcs.get_workstation_cluster.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.list_workstation_clusters.timeout = 60.0 - default_config.rpcs.list_workstation_clusters.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.create_workstation_cluster.timeout = 60.0 - - default_config.rpcs.update_workstation_cluster.timeout = 60.0 - - default_config.rpcs.delete_workstation_cluster.timeout = 60.0 - - default_config.rpcs.get_workstation_config.timeout = 60.0 - default_config.rpcs.get_workstation_config.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.list_workstation_configs.timeout = 60.0 - default_config.rpcs.list_workstation_configs.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.list_usable_workstation_configs.timeout = 60.0 - default_config.rpcs.list_usable_workstation_configs.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.create_workstation_config.timeout = 60.0 - - default_config.rpcs.update_workstation_config.timeout = 60.0 - - default_config.rpcs.delete_workstation_config.timeout = 60.0 - - default_config.rpcs.get_workstation.timeout = 60.0 - default_config.rpcs.get_workstation.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.list_workstations.timeout = 60.0 - default_config.rpcs.list_workstations.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.list_usable_workstations.timeout = 60.0 - default_config.rpcs.list_usable_workstations.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.create_workstation.timeout = 60.0 - - default_config.rpcs.update_workstation.timeout = 60.0 - - default_config.rpcs.delete_workstation.timeout = 60.0 - - default_config.rpcs.start_workstation.timeout = 60.0 - - default_config.rpcs.stop_workstation.timeout = 60.0 - - default_config.rpcs.generate_access_token.timeout = 60.0 - default_config.rpcs.generate_access_token.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the Workstations 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::Workstations::V1beta::Workstations::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 - @workstations_stub.universe_domain - end - - ## - # Create a new Workstations client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Workstations::V1beta::Workstations::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Workstations::V1beta::Workstations::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Workstations 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/workstations/v1beta/workstations_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 - - @workstations_stub = ::Gapic::ServiceStub.new( - ::Google::Cloud::Workstations::V1beta::Workstations::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 - ) - - @workstations_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 = @workstations_stub.endpoint - config.universe_domain = @workstations_stub.universe_domain - config.logger = @workstations_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 = @workstations_stub.endpoint - config.universe_domain = @workstations_stub.universe_domain - config.logger = @workstations_stub.logger if config.respond_to? :logger= - end - end - - ## - # Get the associated client for long-running operations. - # - # @return [::Google::Cloud::Workstations::V1beta::Workstations::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 - @workstations_stub.logger - end - - # Service calls - - ## - # Returns the requested workstation cluster. - # - # @overload get_workstation_cluster(request, options = nil) - # Pass arguments to `get_workstation_cluster` via a request object, either of type - # {::Google::Cloud::Workstations::V1beta::GetWorkstationClusterRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Workstations::V1beta::GetWorkstationClusterRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_workstation_cluster(name: nil) - # Pass arguments to `get_workstation_cluster` via keyword arguments. Note that at - # least one keyword argument is 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 requested resource. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Workstations::V1beta::WorkstationCluster] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Workstations::V1beta::WorkstationCluster] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/workstations/v1beta" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Workstations::V1beta::Workstations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Workstations::V1beta::GetWorkstationClusterRequest.new - # - # # Call the get_workstation_cluster method. - # result = client.get_workstation_cluster request - # - # # The returned object is of type Google::Cloud::Workstations::V1beta::WorkstationCluster. - # p result - # - def get_workstation_cluster request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workstations::V1beta::GetWorkstationClusterRequest - - # Converts hash 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_workstation_cluster.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::Workstations::V1beta::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_workstation_cluster.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_workstation_cluster.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @workstations_stub.call_rpc :get_workstation_cluster, 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 all workstation clusters in the specified location. - # - # @overload list_workstation_clusters(request, options = nil) - # Pass arguments to `list_workstation_clusters` via a request object, either of type - # {::Google::Cloud::Workstations::V1beta::ListWorkstationClustersRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Workstations::V1beta::ListWorkstationClustersRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_workstation_clusters(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_workstation_clusters` via keyword arguments. Note that at - # least one keyword argument is 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. Parent resource name. - # @param page_size [::Integer] - # Optional. Maximum number of items to return. - # @param page_token [::String] - # Optional. next_page_token value returned from a previous List request, if - # any. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Workstations::V1beta::WorkstationCluster>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::Workstations::V1beta::WorkstationCluster>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/workstations/v1beta" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Workstations::V1beta::Workstations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Workstations::V1beta::ListWorkstationClustersRequest.new - # - # # Call the list_workstation_clusters method. - # result = client.list_workstation_clusters 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::Workstations::V1beta::WorkstationCluster. - # p item - # end - # - def list_workstation_clusters request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workstations::V1beta::ListWorkstationClustersRequest - - # Converts hash 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_workstation_clusters.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::Workstations::V1beta::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_workstation_clusters.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_workstation_clusters.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @workstations_stub.call_rpc :list_workstation_clusters, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @workstations_stub, :list_workstation_clusters, 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 - - ## - # Creates a new workstation cluster. - # - # @overload create_workstation_cluster(request, options = nil) - # Pass arguments to `create_workstation_cluster` via a request object, either of type - # {::Google::Cloud::Workstations::V1beta::CreateWorkstationClusterRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Workstations::V1beta::CreateWorkstationClusterRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_workstation_cluster(parent: nil, workstation_cluster_id: nil, workstation_cluster: nil, validate_only: nil) - # Pass arguments to `create_workstation_cluster` via keyword arguments. Note that at - # least one keyword argument is 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. Parent resource name. - # @param workstation_cluster_id [::String] - # Required. ID to use for the workstation cluster. - # @param workstation_cluster [::Google::Cloud::Workstations::V1beta::WorkstationCluster, ::Hash] - # Required. Workstation cluster to create. - # @param validate_only [::Boolean] - # Optional. If set, validate the request and preview the review, but do not - # actually apply it. - # - # @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/workstations/v1beta" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Workstations::V1beta::Workstations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Workstations::V1beta::CreateWorkstationClusterRequest.new - # - # # Call the create_workstation_cluster method. - # result = client.create_workstation_cluster 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_workstation_cluster request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workstations::V1beta::CreateWorkstationClusterRequest - - # Converts hash 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_workstation_cluster.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::Workstations::V1beta::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_workstation_cluster.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_workstation_cluster.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @workstations_stub.call_rpc :create_workstation_cluster, 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 - - ## - # Updates an existing workstation cluster. - # - # @overload update_workstation_cluster(request, options = nil) - # Pass arguments to `update_workstation_cluster` via a request object, either of type - # {::Google::Cloud::Workstations::V1beta::UpdateWorkstationClusterRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Workstations::V1beta::UpdateWorkstationClusterRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_workstation_cluster(workstation_cluster: nil, update_mask: nil, validate_only: nil, allow_missing: nil) - # Pass arguments to `update_workstation_cluster` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param workstation_cluster [::Google::Cloud::Workstations::V1beta::WorkstationCluster, ::Hash] - # Required. Workstation cluster to update. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Required. Mask that specifies which fields in the workstation cluster - # should be updated. - # @param validate_only [::Boolean] - # Optional. If set, validate the request and preview the review, but do not - # actually apply it. - # @param allow_missing [::Boolean] - # Optional. If set, and the workstation cluster is not found, a new - # workstation cluster will be created. In this situation, update_mask is - # ignored. - # - # @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/workstations/v1beta" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Workstations::V1beta::Workstations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Workstations::V1beta::UpdateWorkstationClusterRequest.new - # - # # Call the update_workstation_cluster method. - # result = client.update_workstation_cluster 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 update_workstation_cluster request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workstations::V1beta::UpdateWorkstationClusterRequest - - # Converts hash 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_workstation_cluster.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::Workstations::V1beta::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.workstation_cluster&.name - header_params["workstation_cluster.name"] = request.workstation_cluster.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_workstation_cluster.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_workstation_cluster.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @workstations_stub.call_rpc :update_workstation_cluster, 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 the specified workstation cluster. - # - # @overload delete_workstation_cluster(request, options = nil) - # Pass arguments to `delete_workstation_cluster` via a request object, either of type - # {::Google::Cloud::Workstations::V1beta::DeleteWorkstationClusterRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Workstations::V1beta::DeleteWorkstationClusterRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_workstation_cluster(name: nil, validate_only: nil, etag: nil, force: nil) - # Pass arguments to `delete_workstation_cluster` via keyword arguments. Note that at - # least one keyword argument is 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 workstation cluster to delete. - # @param validate_only [::Boolean] - # Optional. If set, validate the request and preview the review, but do not - # apply it. - # @param etag [::String] - # Optional. If set, the request will be rejected if the latest version of the - # workstation cluster on the server does not have this ETag. - # @param force [::Boolean] - # Optional. If set, any workstation configurations and workstations in the - # workstation cluster are also deleted. Otherwise, the request only - # works if the workstation cluster has no configurations or workstations. - # - # @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/workstations/v1beta" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Workstations::V1beta::Workstations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Workstations::V1beta::DeleteWorkstationClusterRequest.new - # - # # Call the delete_workstation_cluster method. - # result = client.delete_workstation_cluster 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_workstation_cluster request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workstations::V1beta::DeleteWorkstationClusterRequest - - # Converts hash 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_workstation_cluster.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::Workstations::V1beta::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_workstation_cluster.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_workstation_cluster.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @workstations_stub.call_rpc :delete_workstation_cluster, 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 requested workstation configuration. - # - # @overload get_workstation_config(request, options = nil) - # Pass arguments to `get_workstation_config` via a request object, either of type - # {::Google::Cloud::Workstations::V1beta::GetWorkstationConfigRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Workstations::V1beta::GetWorkstationConfigRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_workstation_config(name: nil) - # Pass arguments to `get_workstation_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 requested resource. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Workstations::V1beta::WorkstationConfig] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Workstations::V1beta::WorkstationConfig] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/workstations/v1beta" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Workstations::V1beta::Workstations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Workstations::V1beta::GetWorkstationConfigRequest.new - # - # # Call the get_workstation_config method. - # result = client.get_workstation_config request - # - # # The returned object is of type Google::Cloud::Workstations::V1beta::WorkstationConfig. - # p result - # - def get_workstation_config request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workstations::V1beta::GetWorkstationConfigRequest - - # Converts hash 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_workstation_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::Workstations::V1beta::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_workstation_config.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_workstation_config.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @workstations_stub.call_rpc :get_workstation_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 all workstation configurations in the specified cluster. - # - # @overload list_workstation_configs(request, options = nil) - # Pass arguments to `list_workstation_configs` via a request object, either of type - # {::Google::Cloud::Workstations::V1beta::ListWorkstationConfigsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Workstations::V1beta::ListWorkstationConfigsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_workstation_configs(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_workstation_configs` via keyword arguments. Note that at - # least one keyword argument is 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. Parent resource name. - # @param page_size [::Integer] - # Optional. Maximum number of items to return. - # @param page_token [::String] - # Optional. next_page_token value returned from a previous List request, if - # any. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Workstations::V1beta::WorkstationConfig>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::Workstations::V1beta::WorkstationConfig>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/workstations/v1beta" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Workstations::V1beta::Workstations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Workstations::V1beta::ListWorkstationConfigsRequest.new - # - # # Call the list_workstation_configs method. - # result = client.list_workstation_configs 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::Workstations::V1beta::WorkstationConfig. - # p item - # end - # - def list_workstation_configs request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workstations::V1beta::ListWorkstationConfigsRequest - - # Converts hash 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_workstation_configs.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::Workstations::V1beta::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_workstation_configs.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_workstation_configs.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @workstations_stub.call_rpc :list_workstation_configs, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @workstations_stub, :list_workstation_configs, 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 all workstation configurations in the specified cluster on which - # the caller has the "workstations.workstation.create" permission. - # - # @overload list_usable_workstation_configs(request, options = nil) - # Pass arguments to `list_usable_workstation_configs` via a request object, either of type - # {::Google::Cloud::Workstations::V1beta::ListUsableWorkstationConfigsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Workstations::V1beta::ListUsableWorkstationConfigsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_usable_workstation_configs(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_usable_workstation_configs` via keyword arguments. Note that at - # least one keyword argument is 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. Parent resource name. - # @param page_size [::Integer] - # Optional. Maximum number of items to return. - # @param page_token [::String] - # Optional. next_page_token value returned from a previous List request, if - # any. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Workstations::V1beta::WorkstationConfig>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::Workstations::V1beta::WorkstationConfig>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/workstations/v1beta" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Workstations::V1beta::Workstations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Workstations::V1beta::ListUsableWorkstationConfigsRequest.new - # - # # Call the list_usable_workstation_configs method. - # result = client.list_usable_workstation_configs 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::Workstations::V1beta::WorkstationConfig. - # p item - # end - # - def list_usable_workstation_configs request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workstations::V1beta::ListUsableWorkstationConfigsRequest - - # Converts hash 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_usable_workstation_configs.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::Workstations::V1beta::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_usable_workstation_configs.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_usable_workstation_configs.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @workstations_stub.call_rpc :list_usable_workstation_configs, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @workstations_stub, :list_usable_workstation_configs, 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 - - ## - # Creates a new workstation configuration. - # - # @overload create_workstation_config(request, options = nil) - # Pass arguments to `create_workstation_config` via a request object, either of type - # {::Google::Cloud::Workstations::V1beta::CreateWorkstationConfigRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Workstations::V1beta::CreateWorkstationConfigRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_workstation_config(parent: nil, workstation_config_id: nil, workstation_config: nil, validate_only: nil) - # Pass arguments to `create_workstation_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. Parent resource name. - # @param workstation_config_id [::String] - # Required. ID to use for the workstation configuration. - # @param workstation_config [::Google::Cloud::Workstations::V1beta::WorkstationConfig, ::Hash] - # Required. Config to create. - # @param validate_only [::Boolean] - # Optional. If set, validate the request and preview the review, but do not - # actually apply it. - # - # @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/workstations/v1beta" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Workstations::V1beta::Workstations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Workstations::V1beta::CreateWorkstationConfigRequest.new - # - # # Call the create_workstation_config method. - # result = client.create_workstation_config 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_workstation_config request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workstations::V1beta::CreateWorkstationConfigRequest - - # Converts hash 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_workstation_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::Workstations::V1beta::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_workstation_config.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_workstation_config.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @workstations_stub.call_rpc :create_workstation_config, 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 - - ## - # Updates an existing workstation configuration. - # - # @overload update_workstation_config(request, options = nil) - # Pass arguments to `update_workstation_config` via a request object, either of type - # {::Google::Cloud::Workstations::V1beta::UpdateWorkstationConfigRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Workstations::V1beta::UpdateWorkstationConfigRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_workstation_config(workstation_config: nil, update_mask: nil, validate_only: nil, allow_missing: nil) - # Pass arguments to `update_workstation_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 workstation_config [::Google::Cloud::Workstations::V1beta::WorkstationConfig, ::Hash] - # Required. Config to update. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Required. Mask specifying which fields in the workstation configuration - # should be updated. - # @param validate_only [::Boolean] - # Optional. If set, validate the request and preview the review, but do not - # actually apply it. - # @param allow_missing [::Boolean] - # Optional. If set and the workstation configuration is not found, a new - # workstation configuration will be created. In this situation, - # update_mask is ignored. - # - # @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/workstations/v1beta" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Workstations::V1beta::Workstations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Workstations::V1beta::UpdateWorkstationConfigRequest.new - # - # # Call the update_workstation_config method. - # result = client.update_workstation_config 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 update_workstation_config request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workstations::V1beta::UpdateWorkstationConfigRequest - - # Converts hash 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_workstation_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::Workstations::V1beta::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.workstation_config&.name - header_params["workstation_config.name"] = request.workstation_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_workstation_config.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_workstation_config.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @workstations_stub.call_rpc :update_workstation_config, 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 the specified workstation configuration. - # - # @overload delete_workstation_config(request, options = nil) - # Pass arguments to `delete_workstation_config` via a request object, either of type - # {::Google::Cloud::Workstations::V1beta::DeleteWorkstationConfigRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Workstations::V1beta::DeleteWorkstationConfigRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_workstation_config(name: nil, validate_only: nil, etag: nil, force: nil) - # Pass arguments to `delete_workstation_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 workstation configuration to delete. - # @param validate_only [::Boolean] - # Optional. If set, validate the request and preview the review, but do not - # actually apply it. - # @param etag [::String] - # Optional. If set, the request is rejected if the latest version of the - # workstation configuration on the server does not have this ETag. - # @param force [::Boolean] - # Optional. If set, any workstations in the workstation configuration are - # also deleted. Otherwise, the request works only if the workstation - # configuration has no workstations. - # - # @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/workstations/v1beta" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Workstations::V1beta::Workstations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Workstations::V1beta::DeleteWorkstationConfigRequest.new - # - # # Call the delete_workstation_config method. - # result = client.delete_workstation_config 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_workstation_config request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workstations::V1beta::DeleteWorkstationConfigRequest - - # Converts hash 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_workstation_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::Workstations::V1beta::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_workstation_config.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_workstation_config.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @workstations_stub.call_rpc :delete_workstation_config, 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 requested workstation. - # - # @overload get_workstation(request, options = nil) - # Pass arguments to `get_workstation` via a request object, either of type - # {::Google::Cloud::Workstations::V1beta::GetWorkstationRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Workstations::V1beta::GetWorkstationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_workstation(name: nil) - # Pass arguments to `get_workstation` via keyword arguments. Note that at - # least one keyword argument is 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 requested resource. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Workstations::V1beta::Workstation] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Workstations::V1beta::Workstation] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/workstations/v1beta" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Workstations::V1beta::Workstations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Workstations::V1beta::GetWorkstationRequest.new - # - # # Call the get_workstation method. - # result = client.get_workstation request - # - # # The returned object is of type Google::Cloud::Workstations::V1beta::Workstation. - # p result - # - def get_workstation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workstations::V1beta::GetWorkstationRequest - - # Converts hash 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_workstation.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::Workstations::V1beta::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_workstation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_workstation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @workstations_stub.call_rpc :get_workstation, 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 all Workstations using the specified workstation configuration. - # - # @overload list_workstations(request, options = nil) - # Pass arguments to `list_workstations` via a request object, either of type - # {::Google::Cloud::Workstations::V1beta::ListWorkstationsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Workstations::V1beta::ListWorkstationsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_workstations(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_workstations` via keyword arguments. Note that at - # least one keyword argument is 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. Parent resource name. - # @param page_size [::Integer] - # Optional. Maximum number of items to return. - # @param page_token [::String] - # Optional. next_page_token value returned from a previous List request, if - # any. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Workstations::V1beta::Workstation>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::Workstations::V1beta::Workstation>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/workstations/v1beta" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Workstations::V1beta::Workstations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Workstations::V1beta::ListWorkstationsRequest.new - # - # # Call the list_workstations method. - # result = client.list_workstations 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::Workstations::V1beta::Workstation. - # p item - # end - # - def list_workstations request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workstations::V1beta::ListWorkstationsRequest - - # Converts hash 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_workstations.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::Workstations::V1beta::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_workstations.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_workstations.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @workstations_stub.call_rpc :list_workstations, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @workstations_stub, :list_workstations, 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 all workstations using the specified workstation configuration - # on which the caller has the "workstations.workstations.use" permission. - # - # @overload list_usable_workstations(request, options = nil) - # Pass arguments to `list_usable_workstations` via a request object, either of type - # {::Google::Cloud::Workstations::V1beta::ListUsableWorkstationsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Workstations::V1beta::ListUsableWorkstationsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_usable_workstations(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_usable_workstations` via keyword arguments. Note that at - # least one keyword argument is 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. Parent resource name. - # @param page_size [::Integer] - # Optional. Maximum number of items to return. - # @param page_token [::String] - # Optional. next_page_token value returned from a previous List request, if - # any. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Workstations::V1beta::Workstation>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Cloud::Workstations::V1beta::Workstation>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/workstations/v1beta" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Workstations::V1beta::Workstations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Workstations::V1beta::ListUsableWorkstationsRequest.new - # - # # Call the list_usable_workstations method. - # result = client.list_usable_workstations 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::Workstations::V1beta::Workstation. - # p item - # end - # - def list_usable_workstations request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workstations::V1beta::ListUsableWorkstationsRequest - - # Converts hash 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_usable_workstations.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::Workstations::V1beta::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_usable_workstations.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_usable_workstations.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @workstations_stub.call_rpc :list_usable_workstations, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @workstations_stub, :list_usable_workstations, 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 - - ## - # Creates a new workstation. - # - # @overload create_workstation(request, options = nil) - # Pass arguments to `create_workstation` via a request object, either of type - # {::Google::Cloud::Workstations::V1beta::CreateWorkstationRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Workstations::V1beta::CreateWorkstationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_workstation(parent: nil, workstation_id: nil, workstation: nil, validate_only: nil) - # Pass arguments to `create_workstation` via keyword arguments. Note that at - # least one keyword argument is 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. Parent resource name. - # @param workstation_id [::String] - # Required. ID to use for the workstation. - # @param workstation [::Google::Cloud::Workstations::V1beta::Workstation, ::Hash] - # Required. Workstation to create. - # @param validate_only [::Boolean] - # Optional. If set, validate the request and preview the review, but do not - # actually apply it. - # - # @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/workstations/v1beta" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Workstations::V1beta::Workstations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Workstations::V1beta::CreateWorkstationRequest.new - # - # # Call the create_workstation method. - # result = client.create_workstation 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_workstation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workstations::V1beta::CreateWorkstationRequest - - # Converts hash 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_workstation.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::Workstations::V1beta::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_workstation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_workstation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @workstations_stub.call_rpc :create_workstation, 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 - - ## - # Updates an existing workstation. - # - # @overload update_workstation(request, options = nil) - # Pass arguments to `update_workstation` via a request object, either of type - # {::Google::Cloud::Workstations::V1beta::UpdateWorkstationRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Workstations::V1beta::UpdateWorkstationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_workstation(workstation: nil, update_mask: nil, validate_only: nil, allow_missing: nil) - # Pass arguments to `update_workstation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param workstation [::Google::Cloud::Workstations::V1beta::Workstation, ::Hash] - # Required. Workstation to update. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Required. Mask specifying which fields in the workstation configuration - # should be updated. - # @param validate_only [::Boolean] - # Optional. If set, validate the request and preview the review, but do not - # actually apply it. - # @param allow_missing [::Boolean] - # Optional. If set and the workstation configuration is not found, a new - # workstation configuration is created. In this situation, update_mask - # is ignored. - # - # @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/workstations/v1beta" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Workstations::V1beta::Workstations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Workstations::V1beta::UpdateWorkstationRequest.new - # - # # Call the update_workstation method. - # result = client.update_workstation 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 update_workstation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workstations::V1beta::UpdateWorkstationRequest - - # Converts hash 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_workstation.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::Workstations::V1beta::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.workstation&.name - header_params["workstation.name"] = request.workstation.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_workstation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_workstation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @workstations_stub.call_rpc :update_workstation, 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 the specified workstation. - # - # @overload delete_workstation(request, options = nil) - # Pass arguments to `delete_workstation` via a request object, either of type - # {::Google::Cloud::Workstations::V1beta::DeleteWorkstationRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Workstations::V1beta::DeleteWorkstationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_workstation(name: nil, validate_only: nil, etag: nil) - # Pass arguments to `delete_workstation` via keyword arguments. Note that at - # least one keyword argument is 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 workstation to delete. - # @param validate_only [::Boolean] - # Optional. If set, validate the request and preview the review, but do not - # actually apply it. - # @param etag [::String] - # Optional. If set, the request will be rejected if the latest version of the - # workstation on the server does not have this ETag. - # - # @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/workstations/v1beta" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Workstations::V1beta::Workstations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Workstations::V1beta::DeleteWorkstationRequest.new - # - # # Call the delete_workstation method. - # result = client.delete_workstation 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_workstation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workstations::V1beta::DeleteWorkstationRequest - - # Converts hash 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_workstation.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::Workstations::V1beta::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_workstation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_workstation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @workstations_stub.call_rpc :delete_workstation, 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 - - ## - # Starts running a workstation so that users can connect to it. - # - # @overload start_workstation(request, options = nil) - # Pass arguments to `start_workstation` via a request object, either of type - # {::Google::Cloud::Workstations::V1beta::StartWorkstationRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Workstations::V1beta::StartWorkstationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload start_workstation(name: nil, validate_only: nil, etag: nil) - # Pass arguments to `start_workstation` via keyword arguments. Note that at - # least one keyword argument is 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 workstation to start. - # @param validate_only [::Boolean] - # Optional. If set, validate the request and preview the review, but do not - # actually apply it. - # @param etag [::String] - # Optional. If set, the request will be rejected if the latest version of the - # workstation on the server does not have this ETag. - # - # @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/workstations/v1beta" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Workstations::V1beta::Workstations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Workstations::V1beta::StartWorkstationRequest.new - # - # # Call the start_workstation method. - # result = client.start_workstation 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 start_workstation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workstations::V1beta::StartWorkstationRequest - - # Converts hash 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.start_workstation.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::Workstations::V1beta::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.start_workstation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.start_workstation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @workstations_stub.call_rpc :start_workstation, 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 - - ## - # Stops running a workstation, reducing costs. - # - # @overload stop_workstation(request, options = nil) - # Pass arguments to `stop_workstation` via a request object, either of type - # {::Google::Cloud::Workstations::V1beta::StopWorkstationRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Workstations::V1beta::StopWorkstationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload stop_workstation(name: nil, validate_only: nil, etag: nil) - # Pass arguments to `stop_workstation` via keyword arguments. Note that at - # least one keyword argument is 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 workstation to stop. - # @param validate_only [::Boolean] - # Optional. If set, validate the request and preview the review, but do not - # actually apply it. - # @param etag [::String] - # Optional. If set, the request will be rejected if the latest version of the - # workstation on the server does not have this ETag. - # - # @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/workstations/v1beta" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Workstations::V1beta::Workstations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Workstations::V1beta::StopWorkstationRequest.new - # - # # Call the stop_workstation method. - # result = client.stop_workstation 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 stop_workstation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workstations::V1beta::StopWorkstationRequest - - # Converts hash 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.stop_workstation.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::Workstations::V1beta::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.stop_workstation.timeout, - metadata: metadata, - retry_policy: @config.rpcs.stop_workstation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @workstations_stub.call_rpc :stop_workstation, 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 a short-lived credential that can be used to send authenticated and - # authorized traffic to a workstation. - # - # @overload generate_access_token(request, options = nil) - # Pass arguments to `generate_access_token` via a request object, either of type - # {::Google::Cloud::Workstations::V1beta::GenerateAccessTokenRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Workstations::V1beta::GenerateAccessTokenRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_access_token(expire_time: nil, ttl: nil, workstation: nil) - # Pass arguments to `generate_access_token` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param expire_time [::Google::Protobuf::Timestamp, ::Hash] - # Desired expiration time of the access token. This value must - # be at most 24 hours in the future. If a value is not specified, the - # token's expiration time will be set to a default value of 1 hour in the - # future. - # - # Note: The following parameters are mutually exclusive: `expire_time`, `ttl`. 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 ttl [::Google::Protobuf::Duration, ::Hash] - # Desired lifetime duration of the access token. This value must - # be at most 24 hours. If a value is not specified, the token's lifetime - # will be set to a default value of 1 hour. - # - # Note: The following parameters are mutually exclusive: `ttl`, `expire_time`. 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 workstation [::String] - # Required. Name of the workstation for which the access token should be - # generated. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Cloud::Workstations::V1beta::GenerateAccessTokenResponse] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Cloud::Workstations::V1beta::GenerateAccessTokenResponse] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/cloud/workstations/v1beta" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Workstations::V1beta::Workstations::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Workstations::V1beta::GenerateAccessTokenRequest.new - # - # # Call the generate_access_token method. - # result = client.generate_access_token request - # - # # The returned object is of type Google::Cloud::Workstations::V1beta::GenerateAccessTokenResponse. - # p result - # - def generate_access_token request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workstations::V1beta::GenerateAccessTokenRequest - - # Converts hash 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_access_token.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::Workstations::V1beta::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.workstation - header_params["workstation"] = request.workstation - 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_access_token.timeout, - metadata: metadata, - retry_policy: @config.rpcs.generate_access_token.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @workstations_stub.call_rpc :generate_access_token, 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 Workstations API. - # - # This class represents the configuration for Workstations, - # 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::Workstations::V1beta::Workstations::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 - # # get_workstation_cluster to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Workstations::V1beta::Workstations::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.get_workstation_cluster.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Workstations::V1beta::Workstations::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.get_workstation_cluster.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::Workstations::V1beta::Workstations::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 = "workstations.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 Workstations 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 `get_workstation_cluster` - # @return [::Gapic::Config::Method] - # - attr_reader :get_workstation_cluster - ## - # RPC-specific configuration for `list_workstation_clusters` - # @return [::Gapic::Config::Method] - # - attr_reader :list_workstation_clusters - ## - # RPC-specific configuration for `create_workstation_cluster` - # @return [::Gapic::Config::Method] - # - attr_reader :create_workstation_cluster - ## - # RPC-specific configuration for `update_workstation_cluster` - # @return [::Gapic::Config::Method] - # - attr_reader :update_workstation_cluster - ## - # RPC-specific configuration for `delete_workstation_cluster` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_workstation_cluster - ## - # RPC-specific configuration for `get_workstation_config` - # @return [::Gapic::Config::Method] - # - attr_reader :get_workstation_config - ## - # RPC-specific configuration for `list_workstation_configs` - # @return [::Gapic::Config::Method] - # - attr_reader :list_workstation_configs - ## - # RPC-specific configuration for `list_usable_workstation_configs` - # @return [::Gapic::Config::Method] - # - attr_reader :list_usable_workstation_configs - ## - # RPC-specific configuration for `create_workstation_config` - # @return [::Gapic::Config::Method] - # - attr_reader :create_workstation_config - ## - # RPC-specific configuration for `update_workstation_config` - # @return [::Gapic::Config::Method] - # - attr_reader :update_workstation_config - ## - # RPC-specific configuration for `delete_workstation_config` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_workstation_config - ## - # RPC-specific configuration for `get_workstation` - # @return [::Gapic::Config::Method] - # - attr_reader :get_workstation - ## - # RPC-specific configuration for `list_workstations` - # @return [::Gapic::Config::Method] - # - attr_reader :list_workstations - ## - # RPC-specific configuration for `list_usable_workstations` - # @return [::Gapic::Config::Method] - # - attr_reader :list_usable_workstations - ## - # RPC-specific configuration for `create_workstation` - # @return [::Gapic::Config::Method] - # - attr_reader :create_workstation - ## - # RPC-specific configuration for `update_workstation` - # @return [::Gapic::Config::Method] - # - attr_reader :update_workstation - ## - # RPC-specific configuration for `delete_workstation` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_workstation - ## - # RPC-specific configuration for `start_workstation` - # @return [::Gapic::Config::Method] - # - attr_reader :start_workstation - ## - # RPC-specific configuration for `stop_workstation` - # @return [::Gapic::Config::Method] - # - attr_reader :stop_workstation - ## - # RPC-specific configuration for `generate_access_token` - # @return [::Gapic::Config::Method] - # - attr_reader :generate_access_token - - # @private - def initialize parent_rpcs = nil - get_workstation_cluster_config = parent_rpcs.get_workstation_cluster if parent_rpcs.respond_to? :get_workstation_cluster - @get_workstation_cluster = ::Gapic::Config::Method.new get_workstation_cluster_config - list_workstation_clusters_config = parent_rpcs.list_workstation_clusters if parent_rpcs.respond_to? :list_workstation_clusters - @list_workstation_clusters = ::Gapic::Config::Method.new list_workstation_clusters_config - create_workstation_cluster_config = parent_rpcs.create_workstation_cluster if parent_rpcs.respond_to? :create_workstation_cluster - @create_workstation_cluster = ::Gapic::Config::Method.new create_workstation_cluster_config - update_workstation_cluster_config = parent_rpcs.update_workstation_cluster if parent_rpcs.respond_to? :update_workstation_cluster - @update_workstation_cluster = ::Gapic::Config::Method.new update_workstation_cluster_config - delete_workstation_cluster_config = parent_rpcs.delete_workstation_cluster if parent_rpcs.respond_to? :delete_workstation_cluster - @delete_workstation_cluster = ::Gapic::Config::Method.new delete_workstation_cluster_config - get_workstation_config_config = parent_rpcs.get_workstation_config if parent_rpcs.respond_to? :get_workstation_config - @get_workstation_config = ::Gapic::Config::Method.new get_workstation_config_config - list_workstation_configs_config = parent_rpcs.list_workstation_configs if parent_rpcs.respond_to? :list_workstation_configs - @list_workstation_configs = ::Gapic::Config::Method.new list_workstation_configs_config - list_usable_workstation_configs_config = parent_rpcs.list_usable_workstation_configs if parent_rpcs.respond_to? :list_usable_workstation_configs - @list_usable_workstation_configs = ::Gapic::Config::Method.new list_usable_workstation_configs_config - create_workstation_config_config = parent_rpcs.create_workstation_config if parent_rpcs.respond_to? :create_workstation_config - @create_workstation_config = ::Gapic::Config::Method.new create_workstation_config_config - update_workstation_config_config = parent_rpcs.update_workstation_config if parent_rpcs.respond_to? :update_workstation_config - @update_workstation_config = ::Gapic::Config::Method.new update_workstation_config_config - delete_workstation_config_config = parent_rpcs.delete_workstation_config if parent_rpcs.respond_to? :delete_workstation_config - @delete_workstation_config = ::Gapic::Config::Method.new delete_workstation_config_config - get_workstation_config = parent_rpcs.get_workstation if parent_rpcs.respond_to? :get_workstation - @get_workstation = ::Gapic::Config::Method.new get_workstation_config - list_workstations_config = parent_rpcs.list_workstations if parent_rpcs.respond_to? :list_workstations - @list_workstations = ::Gapic::Config::Method.new list_workstations_config - list_usable_workstations_config = parent_rpcs.list_usable_workstations if parent_rpcs.respond_to? :list_usable_workstations - @list_usable_workstations = ::Gapic::Config::Method.new list_usable_workstations_config - create_workstation_config = parent_rpcs.create_workstation if parent_rpcs.respond_to? :create_workstation - @create_workstation = ::Gapic::Config::Method.new create_workstation_config - update_workstation_config = parent_rpcs.update_workstation if parent_rpcs.respond_to? :update_workstation - @update_workstation = ::Gapic::Config::Method.new update_workstation_config - delete_workstation_config = parent_rpcs.delete_workstation if parent_rpcs.respond_to? :delete_workstation - @delete_workstation = ::Gapic::Config::Method.new delete_workstation_config - start_workstation_config = parent_rpcs.start_workstation if parent_rpcs.respond_to? :start_workstation - @start_workstation = ::Gapic::Config::Method.new start_workstation_config - stop_workstation_config = parent_rpcs.stop_workstation if parent_rpcs.respond_to? :stop_workstation - @stop_workstation = ::Gapic::Config::Method.new stop_workstation_config - generate_access_token_config = parent_rpcs.generate_access_token if parent_rpcs.respond_to? :generate_access_token - @generate_access_token = ::Gapic::Config::Method.new generate_access_token_config - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-workstations-v1beta/lib/google/cloud/workstations/v1beta/workstations/credentials.rb b/owl-bot-staging/google-cloud-workstations-v1beta/lib/google/cloud/workstations/v1beta/workstations/credentials.rb deleted file mode 100644 index cd1d778b15ef..000000000000 --- a/owl-bot-staging/google-cloud-workstations-v1beta/lib/google/cloud/workstations/v1beta/workstations/credentials.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! - -require "googleauth" - -module Google - module Cloud - module Workstations - module V1beta - module Workstations - # Credentials for the Workstations API. - class Credentials < ::Google::Auth::Credentials - self.scope = [ - "https://www.googleapis.com/auth/cloud-platform" - ] - self.env_vars = [ - "GOOGLE_CLOUD_CREDENTIALS", - "GOOGLE_CLOUD_KEYFILE", - "GCLOUD_KEYFILE", - "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-workstations-v1beta/lib/google/cloud/workstations/v1beta/workstations/operations.rb b/owl-bot-staging/google-cloud-workstations-v1beta/lib/google/cloud/workstations/v1beta/workstations/operations.rb deleted file mode 100644 index 59dfe3cc08d6..000000000000 --- a/owl-bot-staging/google-cloud-workstations-v1beta/lib/google/cloud/workstations/v1beta/workstations/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 Workstations - module V1beta - module Workstations - # Service that implements Longrunning Operations API. - class Operations - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "workstations.$UNIVERSE_DOMAIN$" - - # @private - attr_reader :operations_stub - - ## - # Configuration for the Workstations 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 Workstations 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::Workstations::V1beta::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::Workstations::V1beta::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::Workstations::V1beta::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::Workstations::V1beta::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::Workstations::V1beta::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 = "workstations.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-workstations-v1beta/lib/google/cloud/workstations/v1beta/workstations/paths.rb b/owl-bot-staging/google-cloud-workstations-v1beta/lib/google/cloud/workstations/v1beta/workstations/paths.rb deleted file mode 100644 index 651fbc0e8140..000000000000 --- a/owl-bot-staging/google-cloud-workstations-v1beta/lib/google/cloud/workstations/v1beta/workstations/paths.rb +++ /dev/null @@ -1,113 +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 Workstations - module V1beta - module Workstations - # Path helper methods for the Workstations 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 Workstation resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/workstationClusters/{workstation_cluster}/workstationConfigs/{workstation_config}/workstations/{workstation}` - # - # @param project [String] - # @param location [String] - # @param workstation_cluster [String] - # @param workstation_config [String] - # @param workstation [String] - # - # @return [::String] - def workstation_path project:, location:, workstation_cluster:, workstation_config:, workstation: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "workstation_cluster cannot contain /" if workstation_cluster.to_s.include? "/" - raise ::ArgumentError, "workstation_config cannot contain /" if workstation_config.to_s.include? "/" - - "projects/#{project}/locations/#{location}/workstationClusters/#{workstation_cluster}/workstationConfigs/#{workstation_config}/workstations/#{workstation}" - end - - ## - # Create a fully-qualified WorkstationCluster resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/workstationClusters/{workstation_cluster}` - # - # @param project [String] - # @param location [String] - # @param workstation_cluster [String] - # - # @return [::String] - def workstation_cluster_path project:, location:, workstation_cluster: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/workstationClusters/#{workstation_cluster}" - end - - ## - # Create a fully-qualified WorkstationConfig resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/workstationClusters/{workstation_cluster}/workstationConfigs/{workstation_config}` - # - # @param project [String] - # @param location [String] - # @param workstation_cluster [String] - # @param workstation_config [String] - # - # @return [::String] - def workstation_config_path project:, location:, workstation_cluster:, workstation_config: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "workstation_cluster cannot contain /" if workstation_cluster.to_s.include? "/" - - "projects/#{project}/locations/#{location}/workstationClusters/#{workstation_cluster}/workstationConfigs/#{workstation_config}" - end - - extend self - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-workstations-v1beta/lib/google/cloud/workstations/v1beta/workstations/rest.rb b/owl-bot-staging/google-cloud-workstations-v1beta/lib/google/cloud/workstations/v1beta/workstations/rest.rb deleted file mode 100644 index 203469f53bee..000000000000 --- a/owl-bot-staging/google-cloud-workstations-v1beta/lib/google/cloud/workstations/v1beta/workstations/rest.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! - -require "gapic/rest" -require "gapic/config" -require "gapic/config/method" - -require "google/cloud/workstations/v1beta/version" -require "google/cloud/workstations/v1beta/bindings_override" - -require "google/cloud/workstations/v1beta/workstations/credentials" -require "google/cloud/workstations/v1beta/workstations/paths" -require "google/cloud/workstations/v1beta/workstations/rest/operations" -require "google/cloud/workstations/v1beta/workstations/rest/client" - -module Google - module Cloud - module Workstations - module V1beta - ## - # Service for interacting with Cloud Workstations. - # - # To load this service and instantiate a REST client: - # - # require "google/cloud/workstations/v1beta/workstations/rest" - # client = ::Google::Cloud::Workstations::V1beta::Workstations::Rest::Client.new - # - module Workstations - # Client for the REST transport - module Rest - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "rest", "helpers.rb" -require "google/cloud/workstations/v1beta/workstations/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-cloud-workstations-v1beta/lib/google/cloud/workstations/v1beta/workstations/rest/client.rb b/owl-bot-staging/google-cloud-workstations-v1beta/lib/google/cloud/workstations/v1beta/workstations/rest/client.rb deleted file mode 100644 index 914cc70a57bb..000000000000 --- a/owl-bot-staging/google-cloud-workstations-v1beta/lib/google/cloud/workstations/v1beta/workstations/rest/client.rb +++ /dev/null @@ -1,2420 +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/workstations/v1beta/workstations_pb" -require "google/cloud/workstations/v1beta/workstations/rest/service_stub" -require "google/cloud/location/rest" -require "google/iam/v1/rest" - -module Google - module Cloud - module Workstations - module V1beta - module Workstations - module Rest - ## - # REST client for the Workstations service. - # - # Service for interacting with Cloud Workstations. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "workstations.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :workstations_stub - - ## - # Configure the Workstations Client class. - # - # See {::Google::Cloud::Workstations::V1beta::Workstations::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all Workstations clients - # ::Google::Cloud::Workstations::V1beta::Workstations::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", "Workstations", "V1beta"] - 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.get_workstation_cluster.timeout = 60.0 - default_config.rpcs.get_workstation_cluster.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.list_workstation_clusters.timeout = 60.0 - default_config.rpcs.list_workstation_clusters.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.create_workstation_cluster.timeout = 60.0 - - default_config.rpcs.update_workstation_cluster.timeout = 60.0 - - default_config.rpcs.delete_workstation_cluster.timeout = 60.0 - - default_config.rpcs.get_workstation_config.timeout = 60.0 - default_config.rpcs.get_workstation_config.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.list_workstation_configs.timeout = 60.0 - default_config.rpcs.list_workstation_configs.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.list_usable_workstation_configs.timeout = 60.0 - default_config.rpcs.list_usable_workstation_configs.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.create_workstation_config.timeout = 60.0 - - default_config.rpcs.update_workstation_config.timeout = 60.0 - - default_config.rpcs.delete_workstation_config.timeout = 60.0 - - default_config.rpcs.get_workstation.timeout = 60.0 - default_config.rpcs.get_workstation.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.list_workstations.timeout = 60.0 - default_config.rpcs.list_workstations.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.list_usable_workstations.timeout = 60.0 - default_config.rpcs.list_usable_workstations.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.create_workstation.timeout = 60.0 - - default_config.rpcs.update_workstation.timeout = 60.0 - - default_config.rpcs.delete_workstation.timeout = 60.0 - - default_config.rpcs.start_workstation.timeout = 60.0 - - default_config.rpcs.stop_workstation.timeout = 60.0 - - default_config.rpcs.generate_access_token.timeout = 60.0 - default_config.rpcs.generate_access_token.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the Workstations 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::Workstations::V1beta::Workstations::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 - @workstations_stub.universe_domain - end - - ## - # Create a new Workstations REST client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Cloud::Workstations::V1beta::Workstations::Rest::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Cloud::Workstations::V1beta::Workstations::Rest::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Workstations 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::Workstations::V1beta::Workstations::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 - - @workstations_stub = ::Google::Cloud::Workstations::V1beta::Workstations::Rest::ServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials, - logger: @config.logger - ) - - @workstations_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 = @workstations_stub.endpoint - config.universe_domain = @workstations_stub.universe_domain - config.logger = @workstations_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 = @workstations_stub.endpoint - config.universe_domain = @workstations_stub.universe_domain - config.bindings_override = @config.bindings_override - config.logger = @workstations_stub.logger if config.respond_to? :logger= - end - end - - ## - # Get the associated client for long-running operations. - # - # @return [::Google::Cloud::Workstations::V1beta::Workstations::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 - @workstations_stub.logger - end - - # Service calls - - ## - # Returns the requested workstation cluster. - # - # @overload get_workstation_cluster(request, options = nil) - # Pass arguments to `get_workstation_cluster` via a request object, either of type - # {::Google::Cloud::Workstations::V1beta::GetWorkstationClusterRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Workstations::V1beta::GetWorkstationClusterRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_workstation_cluster(name: nil) - # Pass arguments to `get_workstation_cluster` via keyword arguments. Note that at - # least one keyword argument is 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 requested resource. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Workstations::V1beta::WorkstationCluster] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Workstations::V1beta::WorkstationCluster] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/workstations/v1beta" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Workstations::V1beta::Workstations::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Workstations::V1beta::GetWorkstationClusterRequest.new - # - # # Call the get_workstation_cluster method. - # result = client.get_workstation_cluster request - # - # # The returned object is of type Google::Cloud::Workstations::V1beta::WorkstationCluster. - # p result - # - def get_workstation_cluster request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workstations::V1beta::GetWorkstationClusterRequest - - # Converts hash 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_workstation_cluster.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::Workstations::V1beta::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_workstation_cluster.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_workstation_cluster.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @workstations_stub.get_workstation_cluster 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 all workstation clusters in the specified location. - # - # @overload list_workstation_clusters(request, options = nil) - # Pass arguments to `list_workstation_clusters` via a request object, either of type - # {::Google::Cloud::Workstations::V1beta::ListWorkstationClustersRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Workstations::V1beta::ListWorkstationClustersRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_workstation_clusters(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_workstation_clusters` via keyword arguments. Note that at - # least one keyword argument is 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. Parent resource name. - # @param page_size [::Integer] - # Optional. Maximum number of items to return. - # @param page_token [::String] - # Optional. next_page_token value returned from a previous List request, if - # any. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Workstations::V1beta::WorkstationCluster>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Workstations::V1beta::WorkstationCluster>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/workstations/v1beta" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Workstations::V1beta::Workstations::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Workstations::V1beta::ListWorkstationClustersRequest.new - # - # # Call the list_workstation_clusters method. - # result = client.list_workstation_clusters 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::Workstations::V1beta::WorkstationCluster. - # p item - # end - # - def list_workstation_clusters request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workstations::V1beta::ListWorkstationClustersRequest - - # Converts hash 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_workstation_clusters.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::Workstations::V1beta::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_workstation_clusters.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_workstation_clusters.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @workstations_stub.list_workstation_clusters request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @workstations_stub, :list_workstation_clusters, "workstation_clusters", 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 - - ## - # Creates a new workstation cluster. - # - # @overload create_workstation_cluster(request, options = nil) - # Pass arguments to `create_workstation_cluster` via a request object, either of type - # {::Google::Cloud::Workstations::V1beta::CreateWorkstationClusterRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Workstations::V1beta::CreateWorkstationClusterRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_workstation_cluster(parent: nil, workstation_cluster_id: nil, workstation_cluster: nil, validate_only: nil) - # Pass arguments to `create_workstation_cluster` via keyword arguments. Note that at - # least one keyword argument is 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. Parent resource name. - # @param workstation_cluster_id [::String] - # Required. ID to use for the workstation cluster. - # @param workstation_cluster [::Google::Cloud::Workstations::V1beta::WorkstationCluster, ::Hash] - # Required. Workstation cluster to create. - # @param validate_only [::Boolean] - # Optional. If set, validate the request and preview the review, but do not - # actually apply it. - # @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/workstations/v1beta" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Workstations::V1beta::Workstations::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Workstations::V1beta::CreateWorkstationClusterRequest.new - # - # # Call the create_workstation_cluster method. - # result = client.create_workstation_cluster 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_workstation_cluster request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workstations::V1beta::CreateWorkstationClusterRequest - - # Converts hash 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_workstation_cluster.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::Workstations::V1beta::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_workstation_cluster.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_workstation_cluster.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @workstations_stub.create_workstation_cluster 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 - - ## - # Updates an existing workstation cluster. - # - # @overload update_workstation_cluster(request, options = nil) - # Pass arguments to `update_workstation_cluster` via a request object, either of type - # {::Google::Cloud::Workstations::V1beta::UpdateWorkstationClusterRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Workstations::V1beta::UpdateWorkstationClusterRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_workstation_cluster(workstation_cluster: nil, update_mask: nil, validate_only: nil, allow_missing: nil) - # Pass arguments to `update_workstation_cluster` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param workstation_cluster [::Google::Cloud::Workstations::V1beta::WorkstationCluster, ::Hash] - # Required. Workstation cluster to update. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Required. Mask that specifies which fields in the workstation cluster - # should be updated. - # @param validate_only [::Boolean] - # Optional. If set, validate the request and preview the review, but do not - # actually apply it. - # @param allow_missing [::Boolean] - # Optional. If set, and the workstation cluster is not found, a new - # workstation cluster will be created. In this situation, update_mask is - # ignored. - # @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/workstations/v1beta" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Workstations::V1beta::Workstations::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Workstations::V1beta::UpdateWorkstationClusterRequest.new - # - # # Call the update_workstation_cluster method. - # result = client.update_workstation_cluster 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 update_workstation_cluster request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workstations::V1beta::UpdateWorkstationClusterRequest - - # Converts hash 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_workstation_cluster.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::Workstations::V1beta::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_workstation_cluster.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_workstation_cluster.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @workstations_stub.update_workstation_cluster 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 the specified workstation cluster. - # - # @overload delete_workstation_cluster(request, options = nil) - # Pass arguments to `delete_workstation_cluster` via a request object, either of type - # {::Google::Cloud::Workstations::V1beta::DeleteWorkstationClusterRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Workstations::V1beta::DeleteWorkstationClusterRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_workstation_cluster(name: nil, validate_only: nil, etag: nil, force: nil) - # Pass arguments to `delete_workstation_cluster` via keyword arguments. Note that at - # least one keyword argument is 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 workstation cluster to delete. - # @param validate_only [::Boolean] - # Optional. If set, validate the request and preview the review, but do not - # apply it. - # @param etag [::String] - # Optional. If set, the request will be rejected if the latest version of the - # workstation cluster on the server does not have this ETag. - # @param force [::Boolean] - # Optional. If set, any workstation configurations and workstations in the - # workstation cluster are also deleted. Otherwise, the request only - # works if the workstation cluster has no configurations or workstations. - # @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/workstations/v1beta" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Workstations::V1beta::Workstations::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Workstations::V1beta::DeleteWorkstationClusterRequest.new - # - # # Call the delete_workstation_cluster method. - # result = client.delete_workstation_cluster 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_workstation_cluster request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workstations::V1beta::DeleteWorkstationClusterRequest - - # Converts hash 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_workstation_cluster.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::Workstations::V1beta::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_workstation_cluster.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_workstation_cluster.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @workstations_stub.delete_workstation_cluster 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 requested workstation configuration. - # - # @overload get_workstation_config(request, options = nil) - # Pass arguments to `get_workstation_config` via a request object, either of type - # {::Google::Cloud::Workstations::V1beta::GetWorkstationConfigRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Workstations::V1beta::GetWorkstationConfigRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_workstation_config(name: nil) - # Pass arguments to `get_workstation_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 requested resource. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Workstations::V1beta::WorkstationConfig] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Workstations::V1beta::WorkstationConfig] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/workstations/v1beta" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Workstations::V1beta::Workstations::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Workstations::V1beta::GetWorkstationConfigRequest.new - # - # # Call the get_workstation_config method. - # result = client.get_workstation_config request - # - # # The returned object is of type Google::Cloud::Workstations::V1beta::WorkstationConfig. - # p result - # - def get_workstation_config request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workstations::V1beta::GetWorkstationConfigRequest - - # Converts hash 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_workstation_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::Workstations::V1beta::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_workstation_config.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_workstation_config.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @workstations_stub.get_workstation_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 all workstation configurations in the specified cluster. - # - # @overload list_workstation_configs(request, options = nil) - # Pass arguments to `list_workstation_configs` via a request object, either of type - # {::Google::Cloud::Workstations::V1beta::ListWorkstationConfigsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Workstations::V1beta::ListWorkstationConfigsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_workstation_configs(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_workstation_configs` via keyword arguments. Note that at - # least one keyword argument is 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. Parent resource name. - # @param page_size [::Integer] - # Optional. Maximum number of items to return. - # @param page_token [::String] - # Optional. next_page_token value returned from a previous List request, if - # any. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Workstations::V1beta::WorkstationConfig>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Workstations::V1beta::WorkstationConfig>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/workstations/v1beta" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Workstations::V1beta::Workstations::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Workstations::V1beta::ListWorkstationConfigsRequest.new - # - # # Call the list_workstation_configs method. - # result = client.list_workstation_configs 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::Workstations::V1beta::WorkstationConfig. - # p item - # end - # - def list_workstation_configs request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workstations::V1beta::ListWorkstationConfigsRequest - - # Converts hash 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_workstation_configs.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::Workstations::V1beta::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_workstation_configs.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_workstation_configs.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @workstations_stub.list_workstation_configs request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @workstations_stub, :list_workstation_configs, "workstation_configs", 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 all workstation configurations in the specified cluster on which - # the caller has the "workstations.workstation.create" permission. - # - # @overload list_usable_workstation_configs(request, options = nil) - # Pass arguments to `list_usable_workstation_configs` via a request object, either of type - # {::Google::Cloud::Workstations::V1beta::ListUsableWorkstationConfigsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Workstations::V1beta::ListUsableWorkstationConfigsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_usable_workstation_configs(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_usable_workstation_configs` via keyword arguments. Note that at - # least one keyword argument is 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. Parent resource name. - # @param page_size [::Integer] - # Optional. Maximum number of items to return. - # @param page_token [::String] - # Optional. next_page_token value returned from a previous List request, if - # any. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Workstations::V1beta::WorkstationConfig>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Workstations::V1beta::WorkstationConfig>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/workstations/v1beta" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Workstations::V1beta::Workstations::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Workstations::V1beta::ListUsableWorkstationConfigsRequest.new - # - # # Call the list_usable_workstation_configs method. - # result = client.list_usable_workstation_configs 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::Workstations::V1beta::WorkstationConfig. - # p item - # end - # - def list_usable_workstation_configs request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workstations::V1beta::ListUsableWorkstationConfigsRequest - - # Converts hash 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_usable_workstation_configs.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::Workstations::V1beta::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_usable_workstation_configs.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_usable_workstation_configs.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @workstations_stub.list_usable_workstation_configs request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @workstations_stub, :list_usable_workstation_configs, "workstation_configs", 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 - - ## - # Creates a new workstation configuration. - # - # @overload create_workstation_config(request, options = nil) - # Pass arguments to `create_workstation_config` via a request object, either of type - # {::Google::Cloud::Workstations::V1beta::CreateWorkstationConfigRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Workstations::V1beta::CreateWorkstationConfigRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_workstation_config(parent: nil, workstation_config_id: nil, workstation_config: nil, validate_only: nil) - # Pass arguments to `create_workstation_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. Parent resource name. - # @param workstation_config_id [::String] - # Required. ID to use for the workstation configuration. - # @param workstation_config [::Google::Cloud::Workstations::V1beta::WorkstationConfig, ::Hash] - # Required. Config to create. - # @param validate_only [::Boolean] - # Optional. If set, validate the request and preview the review, but do not - # actually apply it. - # @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/workstations/v1beta" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Workstations::V1beta::Workstations::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Workstations::V1beta::CreateWorkstationConfigRequest.new - # - # # Call the create_workstation_config method. - # result = client.create_workstation_config 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_workstation_config request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workstations::V1beta::CreateWorkstationConfigRequest - - # Converts hash 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_workstation_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::Workstations::V1beta::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_workstation_config.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_workstation_config.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @workstations_stub.create_workstation_config 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 - - ## - # Updates an existing workstation configuration. - # - # @overload update_workstation_config(request, options = nil) - # Pass arguments to `update_workstation_config` via a request object, either of type - # {::Google::Cloud::Workstations::V1beta::UpdateWorkstationConfigRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Workstations::V1beta::UpdateWorkstationConfigRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_workstation_config(workstation_config: nil, update_mask: nil, validate_only: nil, allow_missing: nil) - # Pass arguments to `update_workstation_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 workstation_config [::Google::Cloud::Workstations::V1beta::WorkstationConfig, ::Hash] - # Required. Config to update. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Required. Mask specifying which fields in the workstation configuration - # should be updated. - # @param validate_only [::Boolean] - # Optional. If set, validate the request and preview the review, but do not - # actually apply it. - # @param allow_missing [::Boolean] - # Optional. If set and the workstation configuration is not found, a new - # workstation configuration will be created. In this situation, - # update_mask is ignored. - # @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/workstations/v1beta" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Workstations::V1beta::Workstations::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Workstations::V1beta::UpdateWorkstationConfigRequest.new - # - # # Call the update_workstation_config method. - # result = client.update_workstation_config 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 update_workstation_config request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workstations::V1beta::UpdateWorkstationConfigRequest - - # Converts hash 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_workstation_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::Workstations::V1beta::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_workstation_config.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_workstation_config.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @workstations_stub.update_workstation_config 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 the specified workstation configuration. - # - # @overload delete_workstation_config(request, options = nil) - # Pass arguments to `delete_workstation_config` via a request object, either of type - # {::Google::Cloud::Workstations::V1beta::DeleteWorkstationConfigRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Workstations::V1beta::DeleteWorkstationConfigRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_workstation_config(name: nil, validate_only: nil, etag: nil, force: nil) - # Pass arguments to `delete_workstation_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 workstation configuration to delete. - # @param validate_only [::Boolean] - # Optional. If set, validate the request and preview the review, but do not - # actually apply it. - # @param etag [::String] - # Optional. If set, the request is rejected if the latest version of the - # workstation configuration on the server does not have this ETag. - # @param force [::Boolean] - # Optional. If set, any workstations in the workstation configuration are - # also deleted. Otherwise, the request works only if the workstation - # configuration has no workstations. - # @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/workstations/v1beta" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Workstations::V1beta::Workstations::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Workstations::V1beta::DeleteWorkstationConfigRequest.new - # - # # Call the delete_workstation_config method. - # result = client.delete_workstation_config 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_workstation_config request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workstations::V1beta::DeleteWorkstationConfigRequest - - # Converts hash 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_workstation_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::Workstations::V1beta::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_workstation_config.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_workstation_config.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @workstations_stub.delete_workstation_config 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 requested workstation. - # - # @overload get_workstation(request, options = nil) - # Pass arguments to `get_workstation` via a request object, either of type - # {::Google::Cloud::Workstations::V1beta::GetWorkstationRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Workstations::V1beta::GetWorkstationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_workstation(name: nil) - # Pass arguments to `get_workstation` via keyword arguments. Note that at - # least one keyword argument is 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 requested resource. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Workstations::V1beta::Workstation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Workstations::V1beta::Workstation] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/workstations/v1beta" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Workstations::V1beta::Workstations::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Workstations::V1beta::GetWorkstationRequest.new - # - # # Call the get_workstation method. - # result = client.get_workstation request - # - # # The returned object is of type Google::Cloud::Workstations::V1beta::Workstation. - # p result - # - def get_workstation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workstations::V1beta::GetWorkstationRequest - - # Converts hash 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_workstation.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::Workstations::V1beta::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_workstation.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_workstation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @workstations_stub.get_workstation 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 all Workstations using the specified workstation configuration. - # - # @overload list_workstations(request, options = nil) - # Pass arguments to `list_workstations` via a request object, either of type - # {::Google::Cloud::Workstations::V1beta::ListWorkstationsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Workstations::V1beta::ListWorkstationsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_workstations(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_workstations` via keyword arguments. Note that at - # least one keyword argument is 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. Parent resource name. - # @param page_size [::Integer] - # Optional. Maximum number of items to return. - # @param page_token [::String] - # Optional. next_page_token value returned from a previous List request, if - # any. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Workstations::V1beta::Workstation>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Workstations::V1beta::Workstation>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/workstations/v1beta" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Workstations::V1beta::Workstations::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Workstations::V1beta::ListWorkstationsRequest.new - # - # # Call the list_workstations method. - # result = client.list_workstations 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::Workstations::V1beta::Workstation. - # p item - # end - # - def list_workstations request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workstations::V1beta::ListWorkstationsRequest - - # Converts hash 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_workstations.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::Workstations::V1beta::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_workstations.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_workstations.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @workstations_stub.list_workstations request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @workstations_stub, :list_workstations, "workstations", 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 all workstations using the specified workstation configuration - # on which the caller has the "workstations.workstations.use" permission. - # - # @overload list_usable_workstations(request, options = nil) - # Pass arguments to `list_usable_workstations` via a request object, either of type - # {::Google::Cloud::Workstations::V1beta::ListUsableWorkstationsRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Workstations::V1beta::ListUsableWorkstationsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_usable_workstations(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_usable_workstations` via keyword arguments. Note that at - # least one keyword argument is 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. Parent resource name. - # @param page_size [::Integer] - # Optional. Maximum number of items to return. - # @param page_token [::String] - # Optional. next_page_token value returned from a previous List request, if - # any. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Workstations::V1beta::Workstation>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Workstations::V1beta::Workstation>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/workstations/v1beta" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Workstations::V1beta::Workstations::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Workstations::V1beta::ListUsableWorkstationsRequest.new - # - # # Call the list_usable_workstations method. - # result = client.list_usable_workstations 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::Workstations::V1beta::Workstation. - # p item - # end - # - def list_usable_workstations request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workstations::V1beta::ListUsableWorkstationsRequest - - # Converts hash 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_usable_workstations.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::Workstations::V1beta::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_usable_workstations.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_usable_workstations.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @workstations_stub.list_usable_workstations request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @workstations_stub, :list_usable_workstations, "workstations", 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 - - ## - # Creates a new workstation. - # - # @overload create_workstation(request, options = nil) - # Pass arguments to `create_workstation` via a request object, either of type - # {::Google::Cloud::Workstations::V1beta::CreateWorkstationRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Workstations::V1beta::CreateWorkstationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_workstation(parent: nil, workstation_id: nil, workstation: nil, validate_only: nil) - # Pass arguments to `create_workstation` via keyword arguments. Note that at - # least one keyword argument is 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. Parent resource name. - # @param workstation_id [::String] - # Required. ID to use for the workstation. - # @param workstation [::Google::Cloud::Workstations::V1beta::Workstation, ::Hash] - # Required. Workstation to create. - # @param validate_only [::Boolean] - # Optional. If set, validate the request and preview the review, but do not - # actually apply it. - # @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/workstations/v1beta" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Workstations::V1beta::Workstations::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Workstations::V1beta::CreateWorkstationRequest.new - # - # # Call the create_workstation method. - # result = client.create_workstation 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_workstation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workstations::V1beta::CreateWorkstationRequest - - # Converts hash 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_workstation.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::Workstations::V1beta::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_workstation.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_workstation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @workstations_stub.create_workstation 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 - - ## - # Updates an existing workstation. - # - # @overload update_workstation(request, options = nil) - # Pass arguments to `update_workstation` via a request object, either of type - # {::Google::Cloud::Workstations::V1beta::UpdateWorkstationRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Workstations::V1beta::UpdateWorkstationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_workstation(workstation: nil, update_mask: nil, validate_only: nil, allow_missing: nil) - # Pass arguments to `update_workstation` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param workstation [::Google::Cloud::Workstations::V1beta::Workstation, ::Hash] - # Required. Workstation to update. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Required. Mask specifying which fields in the workstation configuration - # should be updated. - # @param validate_only [::Boolean] - # Optional. If set, validate the request and preview the review, but do not - # actually apply it. - # @param allow_missing [::Boolean] - # Optional. If set and the workstation configuration is not found, a new - # workstation configuration is created. In this situation, update_mask - # is ignored. - # @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/workstations/v1beta" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Workstations::V1beta::Workstations::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Workstations::V1beta::UpdateWorkstationRequest.new - # - # # Call the update_workstation method. - # result = client.update_workstation 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 update_workstation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workstations::V1beta::UpdateWorkstationRequest - - # Converts hash 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_workstation.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::Workstations::V1beta::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_workstation.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_workstation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @workstations_stub.update_workstation 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 the specified workstation. - # - # @overload delete_workstation(request, options = nil) - # Pass arguments to `delete_workstation` via a request object, either of type - # {::Google::Cloud::Workstations::V1beta::DeleteWorkstationRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Workstations::V1beta::DeleteWorkstationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_workstation(name: nil, validate_only: nil, etag: nil) - # Pass arguments to `delete_workstation` via keyword arguments. Note that at - # least one keyword argument is 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 workstation to delete. - # @param validate_only [::Boolean] - # Optional. If set, validate the request and preview the review, but do not - # actually apply it. - # @param etag [::String] - # Optional. If set, the request will be rejected if the latest version of the - # workstation on the server does not have this ETag. - # @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/workstations/v1beta" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Workstations::V1beta::Workstations::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Workstations::V1beta::DeleteWorkstationRequest.new - # - # # Call the delete_workstation method. - # result = client.delete_workstation 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_workstation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workstations::V1beta::DeleteWorkstationRequest - - # Converts hash 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_workstation.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::Workstations::V1beta::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_workstation.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_workstation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @workstations_stub.delete_workstation 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 - - ## - # Starts running a workstation so that users can connect to it. - # - # @overload start_workstation(request, options = nil) - # Pass arguments to `start_workstation` via a request object, either of type - # {::Google::Cloud::Workstations::V1beta::StartWorkstationRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Workstations::V1beta::StartWorkstationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload start_workstation(name: nil, validate_only: nil, etag: nil) - # Pass arguments to `start_workstation` via keyword arguments. Note that at - # least one keyword argument is 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 workstation to start. - # @param validate_only [::Boolean] - # Optional. If set, validate the request and preview the review, but do not - # actually apply it. - # @param etag [::String] - # Optional. If set, the request will be rejected if the latest version of the - # workstation on the server does not have this ETag. - # @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/workstations/v1beta" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Workstations::V1beta::Workstations::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Workstations::V1beta::StartWorkstationRequest.new - # - # # Call the start_workstation method. - # result = client.start_workstation 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 start_workstation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workstations::V1beta::StartWorkstationRequest - - # Converts hash 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.start_workstation.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::Workstations::V1beta::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.start_workstation.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.start_workstation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @workstations_stub.start_workstation 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 - - ## - # Stops running a workstation, reducing costs. - # - # @overload stop_workstation(request, options = nil) - # Pass arguments to `stop_workstation` via a request object, either of type - # {::Google::Cloud::Workstations::V1beta::StopWorkstationRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Workstations::V1beta::StopWorkstationRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload stop_workstation(name: nil, validate_only: nil, etag: nil) - # Pass arguments to `stop_workstation` via keyword arguments. Note that at - # least one keyword argument is 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 workstation to stop. - # @param validate_only [::Boolean] - # Optional. If set, validate the request and preview the review, but do not - # actually apply it. - # @param etag [::String] - # Optional. If set, the request will be rejected if the latest version of the - # workstation on the server does not have this ETag. - # @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/workstations/v1beta" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Workstations::V1beta::Workstations::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Workstations::V1beta::StopWorkstationRequest.new - # - # # Call the stop_workstation method. - # result = client.stop_workstation 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 stop_workstation request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workstations::V1beta::StopWorkstationRequest - - # Converts hash 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.stop_workstation.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::Workstations::V1beta::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.stop_workstation.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.stop_workstation.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @workstations_stub.stop_workstation 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 a short-lived credential that can be used to send authenticated and - # authorized traffic to a workstation. - # - # @overload generate_access_token(request, options = nil) - # Pass arguments to `generate_access_token` via a request object, either of type - # {::Google::Cloud::Workstations::V1beta::GenerateAccessTokenRequest} or an equivalent Hash. - # - # @param request [::Google::Cloud::Workstations::V1beta::GenerateAccessTokenRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_access_token(expire_time: nil, ttl: nil, workstation: nil) - # Pass arguments to `generate_access_token` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param expire_time [::Google::Protobuf::Timestamp, ::Hash] - # Desired expiration time of the access token. This value must - # be at most 24 hours in the future. If a value is not specified, the - # token's expiration time will be set to a default value of 1 hour in the - # future. - # - # Note: The following parameters are mutually exclusive: `expire_time`, `ttl`. 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 ttl [::Google::Protobuf::Duration, ::Hash] - # Desired lifetime duration of the access token. This value must - # be at most 24 hours. If a value is not specified, the token's lifetime - # will be set to a default value of 1 hour. - # - # Note: The following parameters are mutually exclusive: `ttl`, `expire_time`. 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 workstation [::String] - # Required. Name of the workstation for which the access token should be - # generated. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Cloud::Workstations::V1beta::GenerateAccessTokenResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Workstations::V1beta::GenerateAccessTokenResponse] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/cloud/workstations/v1beta" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Cloud::Workstations::V1beta::Workstations::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Cloud::Workstations::V1beta::GenerateAccessTokenRequest.new - # - # # Call the generate_access_token method. - # result = client.generate_access_token request - # - # # The returned object is of type Google::Cloud::Workstations::V1beta::GenerateAccessTokenResponse. - # p result - # - def generate_access_token request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Workstations::V1beta::GenerateAccessTokenRequest - - # Converts hash 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_access_token.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::Workstations::V1beta::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_access_token.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.generate_access_token.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @workstations_stub.generate_access_token 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 Workstations REST API. - # - # This class represents the configuration for Workstations 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::Workstations::V1beta::Workstations::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 - # # get_workstation_cluster to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Cloud::Workstations::V1beta::Workstations::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.get_workstation_cluster.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Cloud::Workstations::V1beta::Workstations::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.get_workstation_cluster.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 = "workstations.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 Workstations 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 `get_workstation_cluster` - # @return [::Gapic::Config::Method] - # - attr_reader :get_workstation_cluster - ## - # RPC-specific configuration for `list_workstation_clusters` - # @return [::Gapic::Config::Method] - # - attr_reader :list_workstation_clusters - ## - # RPC-specific configuration for `create_workstation_cluster` - # @return [::Gapic::Config::Method] - # - attr_reader :create_workstation_cluster - ## - # RPC-specific configuration for `update_workstation_cluster` - # @return [::Gapic::Config::Method] - # - attr_reader :update_workstation_cluster - ## - # RPC-specific configuration for `delete_workstation_cluster` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_workstation_cluster - ## - # RPC-specific configuration for `get_workstation_config` - # @return [::Gapic::Config::Method] - # - attr_reader :get_workstation_config - ## - # RPC-specific configuration for `list_workstation_configs` - # @return [::Gapic::Config::Method] - # - attr_reader :list_workstation_configs - ## - # RPC-specific configuration for `list_usable_workstation_configs` - # @return [::Gapic::Config::Method] - # - attr_reader :list_usable_workstation_configs - ## - # RPC-specific configuration for `create_workstation_config` - # @return [::Gapic::Config::Method] - # - attr_reader :create_workstation_config - ## - # RPC-specific configuration for `update_workstation_config` - # @return [::Gapic::Config::Method] - # - attr_reader :update_workstation_config - ## - # RPC-specific configuration for `delete_workstation_config` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_workstation_config - ## - # RPC-specific configuration for `get_workstation` - # @return [::Gapic::Config::Method] - # - attr_reader :get_workstation - ## - # RPC-specific configuration for `list_workstations` - # @return [::Gapic::Config::Method] - # - attr_reader :list_workstations - ## - # RPC-specific configuration for `list_usable_workstations` - # @return [::Gapic::Config::Method] - # - attr_reader :list_usable_workstations - ## - # RPC-specific configuration for `create_workstation` - # @return [::Gapic::Config::Method] - # - attr_reader :create_workstation - ## - # RPC-specific configuration for `update_workstation` - # @return [::Gapic::Config::Method] - # - attr_reader :update_workstation - ## - # RPC-specific configuration for `delete_workstation` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_workstation - ## - # RPC-specific configuration for `start_workstation` - # @return [::Gapic::Config::Method] - # - attr_reader :start_workstation - ## - # RPC-specific configuration for `stop_workstation` - # @return [::Gapic::Config::Method] - # - attr_reader :stop_workstation - ## - # RPC-specific configuration for `generate_access_token` - # @return [::Gapic::Config::Method] - # - attr_reader :generate_access_token - - # @private - def initialize parent_rpcs = nil - get_workstation_cluster_config = parent_rpcs.get_workstation_cluster if parent_rpcs.respond_to? :get_workstation_cluster - @get_workstation_cluster = ::Gapic::Config::Method.new get_workstation_cluster_config - list_workstation_clusters_config = parent_rpcs.list_workstation_clusters if parent_rpcs.respond_to? :list_workstation_clusters - @list_workstation_clusters = ::Gapic::Config::Method.new list_workstation_clusters_config - create_workstation_cluster_config = parent_rpcs.create_workstation_cluster if parent_rpcs.respond_to? :create_workstation_cluster - @create_workstation_cluster = ::Gapic::Config::Method.new create_workstation_cluster_config - update_workstation_cluster_config = parent_rpcs.update_workstation_cluster if parent_rpcs.respond_to? :update_workstation_cluster - @update_workstation_cluster = ::Gapic::Config::Method.new update_workstation_cluster_config - delete_workstation_cluster_config = parent_rpcs.delete_workstation_cluster if parent_rpcs.respond_to? :delete_workstation_cluster - @delete_workstation_cluster = ::Gapic::Config::Method.new delete_workstation_cluster_config - get_workstation_config_config = parent_rpcs.get_workstation_config if parent_rpcs.respond_to? :get_workstation_config - @get_workstation_config = ::Gapic::Config::Method.new get_workstation_config_config - list_workstation_configs_config = parent_rpcs.list_workstation_configs if parent_rpcs.respond_to? :list_workstation_configs - @list_workstation_configs = ::Gapic::Config::Method.new list_workstation_configs_config - list_usable_workstation_configs_config = parent_rpcs.list_usable_workstation_configs if parent_rpcs.respond_to? :list_usable_workstation_configs - @list_usable_workstation_configs = ::Gapic::Config::Method.new list_usable_workstation_configs_config - create_workstation_config_config = parent_rpcs.create_workstation_config if parent_rpcs.respond_to? :create_workstation_config - @create_workstation_config = ::Gapic::Config::Method.new create_workstation_config_config - update_workstation_config_config = parent_rpcs.update_workstation_config if parent_rpcs.respond_to? :update_workstation_config - @update_workstation_config = ::Gapic::Config::Method.new update_workstation_config_config - delete_workstation_config_config = parent_rpcs.delete_workstation_config if parent_rpcs.respond_to? :delete_workstation_config - @delete_workstation_config = ::Gapic::Config::Method.new delete_workstation_config_config - get_workstation_config = parent_rpcs.get_workstation if parent_rpcs.respond_to? :get_workstation - @get_workstation = ::Gapic::Config::Method.new get_workstation_config - list_workstations_config = parent_rpcs.list_workstations if parent_rpcs.respond_to? :list_workstations - @list_workstations = ::Gapic::Config::Method.new list_workstations_config - list_usable_workstations_config = parent_rpcs.list_usable_workstations if parent_rpcs.respond_to? :list_usable_workstations - @list_usable_workstations = ::Gapic::Config::Method.new list_usable_workstations_config - create_workstation_config = parent_rpcs.create_workstation if parent_rpcs.respond_to? :create_workstation - @create_workstation = ::Gapic::Config::Method.new create_workstation_config - update_workstation_config = parent_rpcs.update_workstation if parent_rpcs.respond_to? :update_workstation - @update_workstation = ::Gapic::Config::Method.new update_workstation_config - delete_workstation_config = parent_rpcs.delete_workstation if parent_rpcs.respond_to? :delete_workstation - @delete_workstation = ::Gapic::Config::Method.new delete_workstation_config - start_workstation_config = parent_rpcs.start_workstation if parent_rpcs.respond_to? :start_workstation - @start_workstation = ::Gapic::Config::Method.new start_workstation_config - stop_workstation_config = parent_rpcs.stop_workstation if parent_rpcs.respond_to? :stop_workstation - @stop_workstation = ::Gapic::Config::Method.new stop_workstation_config - generate_access_token_config = parent_rpcs.generate_access_token if parent_rpcs.respond_to? :generate_access_token - @generate_access_token = ::Gapic::Config::Method.new generate_access_token_config - - yield self if block_given? - end - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-workstations-v1beta/lib/google/cloud/workstations/v1beta/workstations/rest/operations.rb b/owl-bot-staging/google-cloud-workstations-v1beta/lib/google/cloud/workstations/v1beta/workstations/rest/operations.rb deleted file mode 100644 index 582c87e5cfde..000000000000 --- a/owl-bot-staging/google-cloud-workstations-v1beta/lib/google/cloud/workstations/v1beta/workstations/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 Workstations - module V1beta - module Workstations - module Rest - # Service that implements Longrunning Operations API. - class Operations - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "workstations.$UNIVERSE_DOMAIN$" - - # @private - attr_reader :operations_stub - - ## - # Configuration for the Workstations 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 Workstations 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::Workstations::V1beta::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::Workstations::V1beta::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::Workstations::V1beta::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::Workstations::V1beta::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 = "workstations.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: "/v1beta/{name}/operations", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/?$}, 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: "/v1beta/{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: "/v1beta/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] - ] - ) - 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: "/v1beta/{name}:cancel", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/operations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-workstations-v1beta/lib/google/cloud/workstations/v1beta/workstations/rest/service_stub.rb b/owl-bot-staging/google-cloud-workstations-v1beta/lib/google/cloud/workstations/v1beta/workstations/rest/service_stub.rb deleted file mode 100644 index 402c25eda4b8..000000000000 --- a/owl-bot-staging/google-cloud-workstations-v1beta/lib/google/cloud/workstations/v1beta/workstations/rest/service_stub.rb +++ /dev/null @@ -1,1310 +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/workstations/v1beta/workstations_pb" - -module Google - module Cloud - module Workstations - module V1beta - module Workstations - module Rest - ## - # REST service stub for the Workstations 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 get_workstation_cluster REST call - # - # @param request_pb [::Google::Cloud::Workstations::V1beta::GetWorkstationClusterRequest] - # 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::Workstations::V1beta::WorkstationCluster] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Workstations::V1beta::WorkstationCluster] - # A result object deserialized from the server's reply - def get_workstation_cluster request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_workstation_cluster_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_workstation_cluster", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Workstations::V1beta::WorkstationCluster.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_workstation_clusters REST call - # - # @param request_pb [::Google::Cloud::Workstations::V1beta::ListWorkstationClustersRequest] - # 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::Workstations::V1beta::ListWorkstationClustersResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Workstations::V1beta::ListWorkstationClustersResponse] - # A result object deserialized from the server's reply - def list_workstation_clusters request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_workstation_clusters_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_workstation_clusters", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Workstations::V1beta::ListWorkstationClustersResponse.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_workstation_cluster REST call - # - # @param request_pb [::Google::Cloud::Workstations::V1beta::CreateWorkstationClusterRequest] - # 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_workstation_cluster request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_workstation_cluster_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_workstation_cluster", - 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 update_workstation_cluster REST call - # - # @param request_pb [::Google::Cloud::Workstations::V1beta::UpdateWorkstationClusterRequest] - # 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 update_workstation_cluster request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_workstation_cluster_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_workstation_cluster", - 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_workstation_cluster REST call - # - # @param request_pb [::Google::Cloud::Workstations::V1beta::DeleteWorkstationClusterRequest] - # 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_workstation_cluster request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_delete_workstation_cluster_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_workstation_cluster", - 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_workstation_config REST call - # - # @param request_pb [::Google::Cloud::Workstations::V1beta::GetWorkstationConfigRequest] - # 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::Workstations::V1beta::WorkstationConfig] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Workstations::V1beta::WorkstationConfig] - # A result object deserialized from the server's reply - def get_workstation_config request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_workstation_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_workstation_config", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Workstations::V1beta::WorkstationConfig.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_workstation_configs REST call - # - # @param request_pb [::Google::Cloud::Workstations::V1beta::ListWorkstationConfigsRequest] - # 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::Workstations::V1beta::ListWorkstationConfigsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Workstations::V1beta::ListWorkstationConfigsResponse] - # A result object deserialized from the server's reply - def list_workstation_configs request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_workstation_configs_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_workstation_configs", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Workstations::V1beta::ListWorkstationConfigsResponse.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_usable_workstation_configs REST call - # - # @param request_pb [::Google::Cloud::Workstations::V1beta::ListUsableWorkstationConfigsRequest] - # 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::Workstations::V1beta::ListUsableWorkstationConfigsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Workstations::V1beta::ListUsableWorkstationConfigsResponse] - # A result object deserialized from the server's reply - def list_usable_workstation_configs request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_usable_workstation_configs_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_usable_workstation_configs", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Workstations::V1beta::ListUsableWorkstationConfigsResponse.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_workstation_config REST call - # - # @param request_pb [::Google::Cloud::Workstations::V1beta::CreateWorkstationConfigRequest] - # 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_workstation_config request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_workstation_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: "create_workstation_config", - 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 update_workstation_config REST call - # - # @param request_pb [::Google::Cloud::Workstations::V1beta::UpdateWorkstationConfigRequest] - # 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 update_workstation_config request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_workstation_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_workstation_config", - 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_workstation_config REST call - # - # @param request_pb [::Google::Cloud::Workstations::V1beta::DeleteWorkstationConfigRequest] - # 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_workstation_config request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_delete_workstation_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: "delete_workstation_config", - 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_workstation REST call - # - # @param request_pb [::Google::Cloud::Workstations::V1beta::GetWorkstationRequest] - # 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::Workstations::V1beta::Workstation] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Workstations::V1beta::Workstation] - # A result object deserialized from the server's reply - def get_workstation request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_workstation_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_workstation", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Workstations::V1beta::Workstation.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_workstations REST call - # - # @param request_pb [::Google::Cloud::Workstations::V1beta::ListWorkstationsRequest] - # 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::Workstations::V1beta::ListWorkstationsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Workstations::V1beta::ListWorkstationsResponse] - # A result object deserialized from the server's reply - def list_workstations request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_workstations_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_workstations", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Workstations::V1beta::ListWorkstationsResponse.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_usable_workstations REST call - # - # @param request_pb [::Google::Cloud::Workstations::V1beta::ListUsableWorkstationsRequest] - # 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::Workstations::V1beta::ListUsableWorkstationsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Workstations::V1beta::ListUsableWorkstationsResponse] - # A result object deserialized from the server's reply - def list_usable_workstations request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_usable_workstations_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_usable_workstations", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Workstations::V1beta::ListUsableWorkstationsResponse.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_workstation REST call - # - # @param request_pb [::Google::Cloud::Workstations::V1beta::CreateWorkstationRequest] - # 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_workstation request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_workstation_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_workstation", - 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 update_workstation REST call - # - # @param request_pb [::Google::Cloud::Workstations::V1beta::UpdateWorkstationRequest] - # 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 update_workstation request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_workstation_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_workstation", - 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_workstation REST call - # - # @param request_pb [::Google::Cloud::Workstations::V1beta::DeleteWorkstationRequest] - # 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_workstation request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_delete_workstation_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_workstation", - 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 start_workstation REST call - # - # @param request_pb [::Google::Cloud::Workstations::V1beta::StartWorkstationRequest] - # 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 start_workstation request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_start_workstation_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: "start_workstation", - 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 stop_workstation REST call - # - # @param request_pb [::Google::Cloud::Workstations::V1beta::StopWorkstationRequest] - # 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 stop_workstation request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_stop_workstation_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: "stop_workstation", - 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 generate_access_token REST call - # - # @param request_pb [::Google::Cloud::Workstations::V1beta::GenerateAccessTokenRequest] - # 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::Workstations::V1beta::GenerateAccessTokenResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Cloud::Workstations::V1beta::GenerateAccessTokenResponse] - # A result object deserialized from the server's reply - def generate_access_token request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_generate_access_token_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_access_token", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Cloud::Workstations::V1beta::GenerateAccessTokenResponse.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 get_workstation_cluster REST call - # - # @param request_pb [::Google::Cloud::Workstations::V1beta::GetWorkstationClusterRequest] - # 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_workstation_cluster_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1beta/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/workstationClusters/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_workstation_clusters REST call - # - # @param request_pb [::Google::Cloud::Workstations::V1beta::ListWorkstationClustersRequest] - # 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_workstation_clusters_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1beta/{parent}/workstationClusters", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the create_workstation_cluster REST call - # - # @param request_pb [::Google::Cloud::Workstations::V1beta::CreateWorkstationClusterRequest] - # 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_workstation_cluster_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1beta/{parent}/workstationClusters", - body: "workstation_cluster", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_workstation_cluster REST call - # - # @param request_pb [::Google::Cloud::Workstations::V1beta::UpdateWorkstationClusterRequest] - # 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_workstation_cluster_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v1beta/{workstation_cluster.name}", - body: "workstation_cluster", - matches: [ - ["workstation_cluster.name", %r{^projects/[^/]+/locations/[^/]+/workstationClusters/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_workstation_cluster REST call - # - # @param request_pb [::Google::Cloud::Workstations::V1beta::DeleteWorkstationClusterRequest] - # 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_workstation_cluster_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v1beta/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/workstationClusters/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_workstation_config REST call - # - # @param request_pb [::Google::Cloud::Workstations::V1beta::GetWorkstationConfigRequest] - # 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_workstation_config_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1beta/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/workstationClusters/[^/]+/workstationConfigs/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_workstation_configs REST call - # - # @param request_pb [::Google::Cloud::Workstations::V1beta::ListWorkstationConfigsRequest] - # 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_workstation_configs_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1beta/{parent}/workstationConfigs", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/workstationClusters/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_usable_workstation_configs REST call - # - # @param request_pb [::Google::Cloud::Workstations::V1beta::ListUsableWorkstationConfigsRequest] - # 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_usable_workstation_configs_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1beta/{parent}/workstationConfigs:listUsable", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/workstationClusters/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the create_workstation_config REST call - # - # @param request_pb [::Google::Cloud::Workstations::V1beta::CreateWorkstationConfigRequest] - # 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_workstation_config_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1beta/{parent}/workstationConfigs", - body: "workstation_config", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/workstationClusters/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_workstation_config REST call - # - # @param request_pb [::Google::Cloud::Workstations::V1beta::UpdateWorkstationConfigRequest] - # 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_workstation_config_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v1beta/{workstation_config.name}", - body: "workstation_config", - matches: [ - ["workstation_config.name", %r{^projects/[^/]+/locations/[^/]+/workstationClusters/[^/]+/workstationConfigs/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_workstation_config REST call - # - # @param request_pb [::Google::Cloud::Workstations::V1beta::DeleteWorkstationConfigRequest] - # 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_workstation_config_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v1beta/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/workstationClusters/[^/]+/workstationConfigs/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_workstation REST call - # - # @param request_pb [::Google::Cloud::Workstations::V1beta::GetWorkstationRequest] - # 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_workstation_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1beta/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/workstationClusters/[^/]+/workstationConfigs/[^/]+/workstations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_workstations REST call - # - # @param request_pb [::Google::Cloud::Workstations::V1beta::ListWorkstationsRequest] - # 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_workstations_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1beta/{parent}/workstations", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/workstationClusters/[^/]+/workstationConfigs/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the list_usable_workstations REST call - # - # @param request_pb [::Google::Cloud::Workstations::V1beta::ListUsableWorkstationsRequest] - # 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_usable_workstations_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v1beta/{parent}/workstations:listUsable", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/workstationClusters/[^/]+/workstationConfigs/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the create_workstation REST call - # - # @param request_pb [::Google::Cloud::Workstations::V1beta::CreateWorkstationRequest] - # 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_workstation_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1beta/{parent}/workstations", - body: "workstation", - matches: [ - ["parent", %r{^projects/[^/]+/locations/[^/]+/workstationClusters/[^/]+/workstationConfigs/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_workstation REST call - # - # @param request_pb [::Google::Cloud::Workstations::V1beta::UpdateWorkstationRequest] - # 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_workstation_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :patch, - uri_template: "/v1beta/{workstation.name}", - body: "workstation", - matches: [ - ["workstation.name", %r{^projects/[^/]+/locations/[^/]+/workstationClusters/[^/]+/workstationConfigs/[^/]+/workstations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_workstation REST call - # - # @param request_pb [::Google::Cloud::Workstations::V1beta::DeleteWorkstationRequest] - # 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_workstation_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v1beta/{name}", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/workstationClusters/[^/]+/workstationConfigs/[^/]+/workstations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the start_workstation REST call - # - # @param request_pb [::Google::Cloud::Workstations::V1beta::StartWorkstationRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_start_workstation_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1beta/{name}:start", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/workstationClusters/[^/]+/workstationConfigs/[^/]+/workstations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the stop_workstation REST call - # - # @param request_pb [::Google::Cloud::Workstations::V1beta::StopWorkstationRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_stop_workstation_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1beta/{name}:stop", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/locations/[^/]+/workstationClusters/[^/]+/workstationConfigs/[^/]+/workstations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the generate_access_token REST call - # - # @param request_pb [::Google::Cloud::Workstations::V1beta::GenerateAccessTokenRequest] - # 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_access_token_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1beta/{workstation}:generateAccessToken", - body: "*", - matches: [ - ["workstation", %r{^projects/[^/]+/locations/[^/]+/workstationClusters/[^/]+/workstationConfigs/[^/]+/workstations/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-workstations-v1beta/lib/google/cloud/workstations/v1beta/workstations_pb.rb b/owl-bot-staging/google-cloud-workstations-v1beta/lib/google/cloud/workstations/v1beta/workstations_pb.rb deleted file mode 100644 index 2e5c104516ba..000000000000 --- a/owl-bot-staging/google-cloud-workstations-v1beta/lib/google/cloud/workstations/v1beta/workstations_pb.rb +++ /dev/null @@ -1,75 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/workstations/v1beta/workstations.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/field_mask_pb' -require 'google/protobuf/timestamp_pb' -require 'google/rpc/status_pb' - - -descriptor_data = "\n3google/cloud/workstations/v1beta/workstations.proto\x12 google.cloud.workstations.v1beta\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 google/protobuf/field_mask.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x17google/rpc/status.proto\"\x93\t\n\x12WorkstationCluster\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x19\n\x0c\x64isplay_name\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x10\n\x03uid\x18\x03 \x01(\tB\x03\xe0\x41\x03\x12\x18\n\x0breconciling\x18\x04 \x01(\x08\x42\x03\xe0\x41\x03\x12_\n\x0b\x61nnotations\x18\x05 \x03(\x0b\x32\x45.google.cloud.workstations.v1beta.WorkstationCluster.AnnotationsEntryB\x03\xe0\x41\x01\x12U\n\x06labels\x18\x0f \x03(\x0b\x32@.google.cloud.workstations.v1beta.WorkstationCluster.LabelsEntryB\x03\xe0\x41\x01\x12\x34\n\x0b\x63reate_time\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0b\x64\x65lete_time\x18\x08 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x11\n\x04\x65tag\x18\t \x01(\tB\x03\xe0\x41\x01\x12\x14\n\x07network\x18\n \x01(\tB\x03\xe0\x41\x05\x12\x17\n\nsubnetwork\x18\x0b \x01(\tB\x03\xe0\x41\x05\x12\x1d\n\x10\x63ontrol_plane_ip\x18\x10 \x01(\tB\x03\xe0\x41\x03\x12n\n\x16private_cluster_config\x18\x0c \x01(\x0b\x32I.google.cloud.workstations.v1beta.WorkstationCluster.PrivateClusterConfigB\x03\xe0\x41\x01\x12\x15\n\x08\x64\x65graded\x18\r \x01(\x08\x42\x03\xe0\x41\x03\x12+\n\nconditions\x18\x0e \x03(\x0b\x32\x12.google.rpc.StatusB\x03\xe0\x41\x03\x1a\x9f\x01\n\x14PrivateClusterConfig\x12$\n\x17\x65nable_private_endpoint\x18\x01 \x01(\x08\x42\x03\xe0\x41\x05\x12\x1d\n\x10\x63luster_hostname\x18\x02 \x01(\tB\x03\xe0\x41\x03\x12#\n\x16service_attachment_uri\x18\x03 \x01(\tB\x03\xe0\x41\x03\x12\x1d\n\x10\x61llowed_projects\x18\x04 \x03(\tB\x03\xe0\x41\x01\x1a\x32\n\x10\x41nnotationsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01:\xb3\x01\xea\x41\xaf\x01\n.workstations.googleapis.com/WorkstationCluster\x12Qprojects/{project}/locations/{location}/workstationClusters/{workstation_cluster}*\x13workstationClusters2\x12workstationClusterR\x01\x01\"\xc2\x1e\n\x11WorkstationConfig\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x19\n\x0c\x64isplay_name\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x10\n\x03uid\x18\x03 \x01(\tB\x03\xe0\x41\x03\x12\x18\n\x0breconciling\x18\x04 \x01(\x08\x42\x03\xe0\x41\x03\x12^\n\x0b\x61nnotations\x18\x05 \x03(\x0b\x32\x44.google.cloud.workstations.v1beta.WorkstationConfig.AnnotationsEntryB\x03\xe0\x41\x01\x12T\n\x06labels\x18\x12 \x03(\x0b\x32?.google.cloud.workstations.v1beta.WorkstationConfig.LabelsEntryB\x03\xe0\x41\x01\x12\x34\n\x0b\x63reate_time\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0b\x64\x65lete_time\x18\x08 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x11\n\x04\x65tag\x18\t \x01(\tB\x03\xe0\x41\x01\x12\x34\n\x0cidle_timeout\x18\n \x01(\x0b\x32\x19.google.protobuf.DurationB\x03\xe0\x41\x01\x12\x37\n\x0frunning_timeout\x18\x0b \x01(\x0b\x32\x19.google.protobuf.DurationB\x03\xe0\x41\x01\x12K\n\x04host\x18\x0c \x01(\x0b\x32\x38.google.cloud.workstations.v1beta.WorkstationConfig.HostB\x03\xe0\x41\x01\x12l\n\x16persistent_directories\x18\r \x03(\x0b\x32G.google.cloud.workstations.v1beta.WorkstationConfig.PersistentDirectoryB\x03\xe0\x41\x01\x12j\n\x15\x65phemeral_directories\x18\x16 \x03(\x0b\x32\x46.google.cloud.workstations.v1beta.WorkstationConfig.EphemeralDirectoryB\x03\xe0\x41\x01\x12U\n\tcontainer\x18\x0e \x01(\x0b\x32=.google.cloud.workstations.v1beta.WorkstationConfig.ContainerB\x03\xe0\x41\x01\x12\x66\n\x0e\x65ncryption_key\x18\x11 \x01(\x0b\x32I.google.cloud.workstations.v1beta.WorkstationConfig.CustomerEncryptionKeyB\x03\xe0\x41\x05\x12\x61\n\x10readiness_checks\x18\x13 \x03(\x0b\x32\x42.google.cloud.workstations.v1beta.WorkstationConfig.ReadinessCheckB\x03\xe0\x41\x01\x12\x1d\n\rreplica_zones\x18\x17 \x03(\tB\x06\xe0\x41\x01\xe0\x41\x05\x12\x15\n\x08\x64\x65graded\x18\x0f \x01(\x08\x42\x03\xe0\x41\x03\x12+\n\nconditions\x18\x10 \x03(\x0b\x32\x12.google.rpc.StatusB\x03\xe0\x41\x03\x12\x1f\n\x12\x65nable_audit_agent\x18\x14 \x01(\x08\x42\x03\xe0\x41\x01\x1a\xa4\x08\n\x04Host\x12\\\n\x0cgce_instance\x18\x01 \x01(\x0b\x32\x44.google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstanceH\x00\x1a\xb3\x07\n\x0bGceInstance\x12\x19\n\x0cmachine_type\x18\x01 \x01(\tB\x03\xe0\x41\x01\x12\x1c\n\x0fservice_account\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12#\n\x16service_account_scopes\x18\x03 \x03(\tB\x03\xe0\x41\x01\x12\x11\n\x04tags\x18\x04 \x03(\tB\x03\xe0\x41\x01\x12\x16\n\tpool_size\x18\x05 \x01(\x05\x42\x03\xe0\x41\x01\x12\x1d\n\x10pooled_instances\x18\x0c \x01(\x05\x42\x03\xe0\x41\x03\x12(\n\x1b\x64isable_public_ip_addresses\x18\x06 \x01(\x08\x42\x03\xe0\x41\x01\x12)\n\x1c\x65nable_nested_virtualization\x18\x07 \x01(\x08\x42\x03\xe0\x41\x01\x12\x85\x01\n\x18shielded_instance_config\x18\x08 \x01(\x0b\x32^.google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance.GceShieldedInstanceConfigB\x03\xe0\x41\x01\x12\x8d\x01\n\x1c\x63onfidential_instance_config\x18\n \x01(\x0b\x32\x62.google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance.GceConfidentialInstanceConfigB\x03\xe0\x41\x01\x12\x1e\n\x11\x62oot_disk_size_gb\x18\t \x01(\x05\x42\x03\xe0\x41\x01\x12k\n\x0c\x61\x63\x63\x65lerators\x18\x0b \x03(\x0b\x32P.google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance.AcceleratorB\x03\xe0\x41\x01\x1a\x80\x01\n\x19GceShieldedInstanceConfig\x12\x1f\n\x12\x65nable_secure_boot\x18\x01 \x01(\x08\x42\x03\xe0\x41\x01\x12\x18\n\x0b\x65nable_vtpm\x18\x02 \x01(\x08\x42\x03\xe0\x41\x01\x12(\n\x1b\x65nable_integrity_monitoring\x18\x03 \x01(\x08\x42\x03\xe0\x41\x01\x1aI\n\x1dGceConfidentialInstanceConfig\x12(\n\x1b\x65nable_confidential_compute\x18\x01 \x01(\x08\x42\x03\xe0\x41\x01\x1a\x34\n\x0b\x41\x63\x63\x65lerator\x12\x11\n\x04type\x18\x01 \x01(\tB\x03\xe0\x41\x01\x12\x12\n\x05\x63ount\x18\x02 \x01(\x05\x42\x03\xe0\x41\x01\x42\x08\n\x06\x63onfig\x1a\x8d\x04\n\x13PersistentDirectory\x12s\n\x06gce_pd\x18\x02 \x01(\x0b\x32\x61.google.cloud.workstations.v1beta.WorkstationConfig.PersistentDirectory.GceRegionalPersistentDiskH\x00\x12\x17\n\nmount_path\x18\x01 \x01(\tB\x03\xe0\x41\x01\x1a\xd5\x02\n\x19GceRegionalPersistentDisk\x12\x14\n\x07size_gb\x18\x01 \x01(\x05\x42\x03\xe0\x41\x01\x12\x14\n\x07\x66s_type\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x16\n\tdisk_type\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12\x1c\n\x0fsource_snapshot\x18\x05 \x01(\tB\x03\xe0\x41\x01\x12\x8c\x01\n\x0ereclaim_policy\x18\x04 \x01(\x0e\x32o.google.cloud.workstations.v1beta.WorkstationConfig.PersistentDirectory.GceRegionalPersistentDisk.ReclaimPolicyB\x03\xe0\x41\x01\"G\n\rReclaimPolicy\x12\x1e\n\x1aRECLAIM_POLICY_UNSPECIFIED\x10\x00\x12\n\n\x06\x44\x45LETE\x10\x01\x12\n\n\x06RETAIN\x10\x02\x42\x10\n\x0e\x64irectory_type\x1a\xa9\x02\n\x12\x45phemeralDirectory\x12j\n\x06gce_pd\x18\x03 \x01(\x0b\x32X.google.cloud.workstations.v1beta.WorkstationConfig.EphemeralDirectory.GcePersistentDiskH\x00\x12\x17\n\nmount_path\x18\x01 \x01(\tB\x03\xe0\x41\x02\x1a|\n\x11GcePersistentDisk\x12\x16\n\tdisk_type\x18\x01 \x01(\tB\x03\xe0\x41\x01\x12\x1c\n\x0fsource_snapshot\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x19\n\x0csource_image\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12\x16\n\tread_only\x18\x04 \x01(\x08\x42\x03\xe0\x41\x01\x42\x10\n\x0e\x64irectory_type\x1a\x82\x02\n\tContainer\x12\x12\n\x05image\x18\x01 \x01(\tB\x03\xe0\x41\x01\x12\x14\n\x07\x63ommand\x18\x02 \x03(\tB\x03\xe0\x41\x01\x12\x11\n\x04\x61rgs\x18\x03 \x03(\tB\x03\xe0\x41\x01\x12X\n\x03\x65nv\x18\x04 \x03(\x0b\x32\x46.google.cloud.workstations.v1beta.WorkstationConfig.Container.EnvEntryB\x03\xe0\x41\x01\x12\x18\n\x0bworking_dir\x18\x05 \x01(\tB\x03\xe0\x41\x01\x12\x18\n\x0brun_as_user\x18\x06 \x01(\x05\x42\x03\xe0\x41\x01\x1a*\n\x08\x45nvEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1aS\n\x15\x43ustomerEncryptionKey\x12\x14\n\x07kms_key\x18\x01 \x01(\tB\x03\xe0\x41\x05\x12$\n\x17kms_key_service_account\x18\x02 \x01(\tB\x03\xe0\x41\x05\x1a\x36\n\x0eReadinessCheck\x12\x11\n\x04path\x18\x01 \x01(\tB\x03\xe0\x41\x01\x12\x11\n\x04port\x18\x02 \x01(\x05\x42\x03\xe0\x41\x01\x1a\x32\n\x10\x41nnotationsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01:\xd8\x01\xea\x41\xd4\x01\n-workstations.googleapis.com/WorkstationConfig\x12yprojects/{project}/locations/{location}/workstationClusters/{workstation_cluster}/workstationConfigs/{workstation_config}*\x12workstationConfigs2\x11workstationConfigR\x01\x01\"\xfe\x08\n\x0bWorkstation\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x19\n\x0c\x64isplay_name\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x10\n\x03uid\x18\x03 \x01(\tB\x03\xe0\x41\x03\x12\x18\n\x0breconciling\x18\x04 \x01(\x08\x42\x03\xe0\x41\x03\x12X\n\x0b\x61nnotations\x18\x05 \x03(\x0b\x32>.google.cloud.workstations.v1beta.Workstation.AnnotationsEntryB\x03\xe0\x41\x01\x12N\n\x06labels\x18\r \x03(\x0b\x32\x39.google.cloud.workstations.v1beta.Workstation.LabelsEntryB\x03\xe0\x41\x01\x12\x34\n\x0b\x63reate_time\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x33\n\nstart_time\x18\x0e \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0b\x64\x65lete_time\x18\x08 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x11\n\x04\x65tag\x18\t \x01(\tB\x03\xe0\x41\x01\x12G\n\x05state\x18\n \x01(\x0e\x32\x33.google.cloud.workstations.v1beta.Workstation.StateB\x03\xe0\x41\x03\x12\x11\n\x04host\x18\x0b \x01(\tB\x03\xe0\x41\x03\x12H\n\x03\x65nv\x18\x0c \x03(\x0b\x32\x36.google.cloud.workstations.v1beta.Workstation.EnvEntryB\x03\xe0\x41\x01\x1a\x32\n\x10\x41nnotationsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a*\n\x08\x45nvEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"l\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x12\n\x0eSTATE_STARTING\x10\x01\x12\x11\n\rSTATE_RUNNING\x10\x02\x12\x12\n\x0eSTATE_STOPPING\x10\x03\x12\x11\n\rSTATE_STOPPED\x10\x04:\xe2\x01\xea\x41\xde\x01\n\'workstations.googleapis.com/Workstation\x12\x94\x01projects/{project}/locations/{location}/workstationClusters/{workstation_cluster}/workstationConfigs/{workstation_config}/workstations/{workstation}*\x0cworkstations2\x0bworkstationR\x01\x01\"d\n\x1cGetWorkstationClusterRequest\x12\x44\n\x04name\x18\x01 \x01(\tB6\xe0\x41\x02\xfa\x41\x30\n.workstations.googleapis.com/WorkstationCluster\"\x99\x01\n\x1eListWorkstationClustersRequest\x12\x46\n\x06parent\x18\x01 \x01(\tB6\xe0\x41\x02\xfa\x41\x30\x12.workstations.googleapis.com/WorkstationCluster\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\"\xa3\x01\n\x1fListWorkstationClustersResponse\x12R\n\x14workstation_clusters\x18\x01 \x03(\x0b\x32\x34.google.cloud.workstations.v1beta.WorkstationCluster\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x13\n\x0bunreachable\x18\x03 \x03(\t\"\x82\x02\n\x1f\x43reateWorkstationClusterRequest\x12\x46\n\x06parent\x18\x01 \x01(\tB6\xe0\x41\x02\xfa\x41\x30\x12.workstations.googleapis.com/WorkstationCluster\x12#\n\x16workstation_cluster_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12V\n\x13workstation_cluster\x18\x03 \x01(\x0b\x32\x34.google.cloud.workstations.v1beta.WorkstationClusterB\x03\xe0\x41\x02\x12\x1a\n\rvalidate_only\x18\x04 \x01(\x08\x42\x03\xe0\x41\x01\"\xe7\x01\n\x1fUpdateWorkstationClusterRequest\x12V\n\x13workstation_cluster\x18\x01 \x01(\x0b\x32\x34.google.cloud.workstations.v1beta.WorkstationClusterB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\x12\x1a\n\rvalidate_only\x18\x03 \x01(\x08\x42\x03\xe0\x41\x01\x12\x1a\n\rallow_missing\x18\x04 \x01(\x08\x42\x03\xe0\x41\x01\"\xaa\x01\n\x1f\x44\x65leteWorkstationClusterRequest\x12\x44\n\x04name\x18\x01 \x01(\tB6\xe0\x41\x02\xfa\x41\x30\n.workstations.googleapis.com/WorkstationCluster\x12\x1a\n\rvalidate_only\x18\x02 \x01(\x08\x42\x03\xe0\x41\x01\x12\x11\n\x04\x65tag\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12\x12\n\x05\x66orce\x18\x04 \x01(\x08\x42\x03\xe0\x41\x01\"b\n\x1bGetWorkstationConfigRequest\x12\x43\n\x04name\x18\x01 \x01(\tB5\xe0\x41\x02\xfa\x41/\n-workstations.googleapis.com/WorkstationConfig\"\x98\x01\n\x1dListWorkstationConfigsRequest\x12\x46\n\x06parent\x18\x01 \x01(\tB6\xe0\x41\x02\xfa\x41\x30\n.workstations.googleapis.com/WorkstationCluster\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\"\xa0\x01\n\x1eListWorkstationConfigsResponse\x12P\n\x13workstation_configs\x18\x01 \x03(\x0b\x32\x33.google.cloud.workstations.v1beta.WorkstationConfig\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x13\n\x0bunreachable\x18\x03 \x03(\t\"\x9e\x01\n#ListUsableWorkstationConfigsRequest\x12\x46\n\x06parent\x18\x01 \x01(\tB6\xe0\x41\x02\xfa\x41\x30\n.workstations.googleapis.com/WorkstationCluster\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\"\xa6\x01\n$ListUsableWorkstationConfigsResponse\x12P\n\x13workstation_configs\x18\x01 \x03(\x0b\x32\x33.google.cloud.workstations.v1beta.WorkstationConfig\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x13\n\x0bunreachable\x18\x03 \x03(\t\"\xfe\x01\n\x1e\x43reateWorkstationConfigRequest\x12\x46\n\x06parent\x18\x01 \x01(\tB6\xe0\x41\x02\xfa\x41\x30\n.workstations.googleapis.com/WorkstationCluster\x12\"\n\x15workstation_config_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12T\n\x12workstation_config\x18\x03 \x01(\x0b\x32\x33.google.cloud.workstations.v1beta.WorkstationConfigB\x03\xe0\x41\x02\x12\x1a\n\rvalidate_only\x18\x04 \x01(\x08\x42\x03\xe0\x41\x01\"\xe4\x01\n\x1eUpdateWorkstationConfigRequest\x12T\n\x12workstation_config\x18\x01 \x01(\x0b\x32\x33.google.cloud.workstations.v1beta.WorkstationConfigB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\x12\x1a\n\rvalidate_only\x18\x03 \x01(\x08\x42\x03\xe0\x41\x01\x12\x1a\n\rallow_missing\x18\x04 \x01(\x08\x42\x03\xe0\x41\x01\"\xa8\x01\n\x1e\x44\x65leteWorkstationConfigRequest\x12\x43\n\x04name\x18\x01 \x01(\tB5\xe0\x41\x02\xfa\x41/\n-workstations.googleapis.com/WorkstationConfig\x12\x1a\n\rvalidate_only\x18\x02 \x01(\x08\x42\x03\xe0\x41\x01\x12\x11\n\x04\x65tag\x18\x03 \x01(\tB\x03\xe0\x41\x01\x12\x12\n\x05\x66orce\x18\x04 \x01(\x08\x42\x03\xe0\x41\x01\"V\n\x15GetWorkstationRequest\x12=\n\x04name\x18\x01 \x01(\tB/\xe0\x41\x02\xfa\x41)\n\'workstations.googleapis.com/Workstation\"\x91\x01\n\x17ListWorkstationsRequest\x12\x45\n\x06parent\x18\x01 \x01(\tB5\xe0\x41\x02\xfa\x41/\n-workstations.googleapis.com/WorkstationConfig\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\"\x97\x01\n\x18ListWorkstationsResponse\x12\x43\n\x0cworkstations\x18\x01 \x03(\x0b\x32-.google.cloud.workstations.v1beta.Workstation\x12\x1c\n\x0fnext_page_token\x18\x02 \x01(\tB\x03\xe0\x41\x01\x12\x18\n\x0bunreachable\x18\x03 \x03(\tB\x03\xe0\x41\x01\"\x97\x01\n\x1dListUsableWorkstationsRequest\x12\x45\n\x06parent\x18\x01 \x01(\tB5\xe0\x41\x02\xfa\x41/\n-workstations.googleapis.com/WorkstationConfig\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\"\x93\x01\n\x1eListUsableWorkstationsResponse\x12\x43\n\x0cworkstations\x18\x01 \x03(\x0b\x32-.google.cloud.workstations.v1beta.Workstation\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12\x13\n\x0bunreachable\x18\x03 \x03(\t\"\xe3\x01\n\x18\x43reateWorkstationRequest\x12\x45\n\x06parent\x18\x01 \x01(\tB5\xe0\x41\x02\xfa\x41/\n-workstations.googleapis.com/WorkstationConfig\x12\x1b\n\x0eworkstation_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12G\n\x0bworkstation\x18\x03 \x01(\x0b\x32-.google.cloud.workstations.v1beta.WorkstationB\x03\xe0\x41\x02\x12\x1a\n\rvalidate_only\x18\x04 \x01(\x08\x42\x03\xe0\x41\x01\"\xd1\x01\n\x18UpdateWorkstationRequest\x12G\n\x0bworkstation\x18\x01 \x01(\x0b\x32-.google.cloud.workstations.v1beta.WorkstationB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\x12\x1a\n\rvalidate_only\x18\x03 \x01(\x08\x42\x03\xe0\x41\x01\x12\x1a\n\rallow_missing\x18\x04 \x01(\x08\x42\x03\xe0\x41\x01\"\x88\x01\n\x18\x44\x65leteWorkstationRequest\x12=\n\x04name\x18\x01 \x01(\tB/\xe0\x41\x02\xfa\x41)\n\'workstations.googleapis.com/Workstation\x12\x1a\n\rvalidate_only\x18\x02 \x01(\x08\x42\x03\xe0\x41\x01\x12\x11\n\x04\x65tag\x18\x03 \x01(\tB\x03\xe0\x41\x01\"\x87\x01\n\x17StartWorkstationRequest\x12=\n\x04name\x18\x01 \x01(\tB/\xe0\x41\x02\xfa\x41)\n\'workstations.googleapis.com/Workstation\x12\x1a\n\rvalidate_only\x18\x02 \x01(\x08\x42\x03\xe0\x41\x01\x12\x11\n\x04\x65tag\x18\x03 \x01(\tB\x03\xe0\x41\x01\"\x86\x01\n\x16StopWorkstationRequest\x12=\n\x04name\x18\x01 \x01(\tB/\xe0\x41\x02\xfa\x41)\n\'workstations.googleapis.com/Workstation\x12\x1a\n\rvalidate_only\x18\x02 \x01(\x08\x42\x03\xe0\x41\x01\x12\x11\n\x04\x65tag\x18\x03 \x01(\tB\x03\xe0\x41\x01\"\xcd\x01\n\x1aGenerateAccessTokenRequest\x12\x31\n\x0b\x65xpire_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampH\x00\x12(\n\x03ttl\x18\x03 \x01(\x0b\x32\x19.google.protobuf.DurationH\x00\x12\x44\n\x0bworkstation\x18\x01 \x01(\tB/\xe0\x41\x02\xfa\x41)\n\'workstations.googleapis.com/WorkstationB\x0c\n\nexpiration\"d\n\x1bGenerateAccessTokenResponse\x12\x14\n\x0c\x61\x63\x63\x65ss_token\x18\x01 \x01(\t\x12/\n\x0b\x65xpire_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"\x80\x02\n\x11OperationMetadata\x12\x34\n\x0b\x63reate_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x31\n\x08\x65nd_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x13\n\x06target\x18\x03 \x01(\tB\x03\xe0\x41\x03\x12\x11\n\x04verb\x18\x04 \x01(\tB\x03\xe0\x41\x03\x12\x1b\n\x0estatus_message\x18\x05 \x01(\tB\x03\xe0\x41\x03\x12#\n\x16requested_cancellation\x18\x06 \x01(\x08\x42\x03\xe0\x41\x03\x12\x18\n\x0b\x61pi_version\x18\x07 \x01(\tB\x03\xe0\x41\x03\x32\xdf+\n\x0cWorkstations\x12\xd9\x01\n\x15GetWorkstationCluster\x12>.google.cloud.workstations.v1beta.GetWorkstationClusterRequest\x1a\x34.google.cloud.workstations.v1beta.WorkstationCluster\"J\xda\x41\x04name\x82\xd3\xe4\x93\x02=\x12;/v1beta/{name=projects/*/locations/*/workstationClusters/*}\x12\xec\x01\n\x17ListWorkstationClusters\x12@.google.cloud.workstations.v1beta.ListWorkstationClustersRequest\x1a\x41.google.cloud.workstations.v1beta.ListWorkstationClustersResponse\"L\xda\x41\x06parent\x82\xd3\xe4\x93\x02=\x12;/v1beta/{parent=projects/*/locations/*}/workstationClusters\x12\xb5\x02\n\x18\x43reateWorkstationCluster\x12\x41.google.cloud.workstations.v1beta.CreateWorkstationClusterRequest\x1a\x1d.google.longrunning.Operation\"\xb6\x01\xca\x41\'\n\x12WorkstationCluster\x12\x11OperationMetadata\xda\x41\x31parent,workstation_cluster,workstation_cluster_id\x82\xd3\xe4\x93\x02R\";/v1beta/{parent=projects/*/locations/*}/workstationClusters:\x13workstation_cluster\x12\xb7\x02\n\x18UpdateWorkstationCluster\x12\x41.google.cloud.workstations.v1beta.UpdateWorkstationClusterRequest\x1a\x1d.google.longrunning.Operation\"\xb8\x01\xca\x41\'\n\x12WorkstationCluster\x12\x11OperationMetadata\xda\x41\x1fworkstation_cluster,update_mask\x82\xd3\xe4\x93\x02\x66\x32O/v1beta/{workstation_cluster.name=projects/*/locations/*/workstationClusters/*}:\x13workstation_cluster\x12\xf2\x01\n\x18\x44\x65leteWorkstationCluster\x12\x41.google.cloud.workstations.v1beta.DeleteWorkstationClusterRequest\x1a\x1d.google.longrunning.Operation\"t\xca\x41\'\n\x12WorkstationCluster\x12\x11OperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02=*;/v1beta/{name=projects/*/locations/*/workstationClusters/*}\x12\xeb\x01\n\x14GetWorkstationConfig\x12=.google.cloud.workstations.v1beta.GetWorkstationConfigRequest\x1a\x33.google.cloud.workstations.v1beta.WorkstationConfig\"_\xda\x41\x04name\x82\xd3\xe4\x93\x02R\x12P/v1beta/{name=projects/*/locations/*/workstationClusters/*/workstationConfigs/*}\x12\xfe\x01\n\x16ListWorkstationConfigs\x12?.google.cloud.workstations.v1beta.ListWorkstationConfigsRequest\x1a@.google.cloud.workstations.v1beta.ListWorkstationConfigsResponse\"a\xda\x41\x06parent\x82\xd3\xe4\x93\x02R\x12P/v1beta/{parent=projects/*/locations/*/workstationClusters/*}/workstationConfigs\x12\x9b\x02\n\x1cListUsableWorkstationConfigs\x12\x45.google.cloud.workstations.v1beta.ListUsableWorkstationConfigsRequest\x1a\x46.google.cloud.workstations.v1beta.ListUsableWorkstationConfigsResponse\"l\xda\x41\x06parent\x82\xd3\xe4\x93\x02]\x12[/v1beta/{parent=projects/*/locations/*/workstationClusters/*}/workstationConfigs:listUsable\x12\xc4\x02\n\x17\x43reateWorkstationConfig\x12@.google.cloud.workstations.v1beta.CreateWorkstationConfigRequest\x1a\x1d.google.longrunning.Operation\"\xc7\x01\xca\x41&\n\x11WorkstationConfig\x12\x11OperationMetadata\xda\x41/parent,workstation_config,workstation_config_id\x82\xd3\xe4\x93\x02\x66\"P/v1beta/{parent=projects/*/locations/*/workstationClusters/*}/workstationConfigs:\x12workstation_config\x12\xc6\x02\n\x17UpdateWorkstationConfig\x12@.google.cloud.workstations.v1beta.UpdateWorkstationConfigRequest\x1a\x1d.google.longrunning.Operation\"\xc9\x01\xca\x41&\n\x11WorkstationConfig\x12\x11OperationMetadata\xda\x41\x1eworkstation_config,update_mask\x82\xd3\xe4\x93\x02y2c/v1beta/{workstation_config.name=projects/*/locations/*/workstationClusters/*/workstationConfigs/*}:\x12workstation_config\x12\x85\x02\n\x17\x44\x65leteWorkstationConfig\x12@.google.cloud.workstations.v1beta.DeleteWorkstationConfigRequest\x1a\x1d.google.longrunning.Operation\"\x88\x01\xca\x41&\n\x11WorkstationConfig\x12\x11OperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02R*P/v1beta/{name=projects/*/locations/*/workstationClusters/*/workstationConfigs/*}\x12\xe8\x01\n\x0eGetWorkstation\x12\x37.google.cloud.workstations.v1beta.GetWorkstationRequest\x1a-.google.cloud.workstations.v1beta.Workstation\"n\xda\x41\x04name\x82\xd3\xe4\x93\x02\x61\x12_/v1beta/{name=projects/*/locations/*/workstationClusters/*/workstationConfigs/*/workstations/*}\x12\xfb\x01\n\x10ListWorkstations\x12\x39.google.cloud.workstations.v1beta.ListWorkstationsRequest\x1a:.google.cloud.workstations.v1beta.ListWorkstationsResponse\"p\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x61\x12_/v1beta/{parent=projects/*/locations/*/workstationClusters/*/workstationConfigs/*}/workstations\x12\x98\x02\n\x16ListUsableWorkstations\x12?.google.cloud.workstations.v1beta.ListUsableWorkstationsRequest\x1a@.google.cloud.workstations.v1beta.ListUsableWorkstationsResponse\"{\xda\x41\x06parent\x82\xd3\xe4\x93\x02l\x12j/v1beta/{parent=projects/*/locations/*/workstationClusters/*/workstationConfigs/*}/workstations:listUsable\x12\xac\x02\n\x11\x43reateWorkstation\x12:.google.cloud.workstations.v1beta.CreateWorkstationRequest\x1a\x1d.google.longrunning.Operation\"\xbb\x01\xca\x41 \n\x0bWorkstation\x12\x11OperationMetadata\xda\x41!parent,workstation,workstation_id\x82\xd3\xe4\x93\x02n\"_/v1beta/{parent=projects/*/locations/*/workstationClusters/*/workstationConfigs/*}/workstations:\x0bworkstation\x12\xae\x02\n\x11UpdateWorkstation\x12:.google.cloud.workstations.v1beta.UpdateWorkstationRequest\x1a\x1d.google.longrunning.Operation\"\xbd\x01\xca\x41 \n\x0bWorkstation\x12\x11OperationMetadata\xda\x41\x17workstation,update_mask\x82\xd3\xe4\x93\x02z2k/v1beta/{workstation.name=projects/*/locations/*/workstationClusters/*/workstationConfigs/*/workstations/*}:\x0bworkstation\x12\x82\x02\n\x11\x44\x65leteWorkstation\x12:.google.cloud.workstations.v1beta.DeleteWorkstationRequest\x1a\x1d.google.longrunning.Operation\"\x91\x01\xca\x41 \n\x0bWorkstation\x12\x11OperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02\x61*_/v1beta/{name=projects/*/locations/*/workstationClusters/*/workstationConfigs/*/workstations/*}\x12\x89\x02\n\x10StartWorkstation\x12\x39.google.cloud.workstations.v1beta.StartWorkstationRequest\x1a\x1d.google.longrunning.Operation\"\x9a\x01\xca\x41 \n\x0bWorkstation\x12\x11OperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02j\"e/v1beta/{name=projects/*/locations/*/workstationClusters/*/workstationConfigs/*/workstations/*}:start:\x01*\x12\x86\x02\n\x0fStopWorkstation\x12\x38.google.cloud.workstations.v1beta.StopWorkstationRequest\x1a\x1d.google.longrunning.Operation\"\x99\x01\xca\x41 \n\x0bWorkstation\x12\x11OperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02i\"d/v1beta/{name=projects/*/locations/*/workstationClusters/*/workstationConfigs/*/workstations/*}:stop:\x01*\x12\xa8\x02\n\x13GenerateAccessToken\x12<.google.cloud.workstations.v1beta.GenerateAccessTokenRequest\x1a=.google.cloud.workstations.v1beta.GenerateAccessTokenResponse\"\x93\x01\xda\x41\x0bworkstation\x82\xd3\xe4\x93\x02\x7f\"z/v1beta/{workstation=projects/*/locations/*/workstationClusters/*/workstationConfigs/*/workstations/*}:generateAccessToken:\x01*\x1aO\xca\x41\x1bworkstations.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\x85\x01\n$com.google.cloud.workstations.v1betaB\x11WorkstationsProtoP\x01ZHcloud.google.com/go/workstations/apiv1beta/workstationspb;workstationspbb\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Cloud - module Workstations - module V1beta - WorkstationCluster = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.workstations.v1beta.WorkstationCluster").msgclass - WorkstationCluster::PrivateClusterConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.workstations.v1beta.WorkstationCluster.PrivateClusterConfig").msgclass - WorkstationConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.workstations.v1beta.WorkstationConfig").msgclass - WorkstationConfig::Host = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.workstations.v1beta.WorkstationConfig.Host").msgclass - WorkstationConfig::Host::GceInstance = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance").msgclass - WorkstationConfig::Host::GceInstance::GceShieldedInstanceConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance.GceShieldedInstanceConfig").msgclass - WorkstationConfig::Host::GceInstance::GceConfidentialInstanceConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance.GceConfidentialInstanceConfig").msgclass - WorkstationConfig::Host::GceInstance::Accelerator = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.workstations.v1beta.WorkstationConfig.Host.GceInstance.Accelerator").msgclass - WorkstationConfig::PersistentDirectory = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.workstations.v1beta.WorkstationConfig.PersistentDirectory").msgclass - WorkstationConfig::PersistentDirectory::GceRegionalPersistentDisk = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.workstations.v1beta.WorkstationConfig.PersistentDirectory.GceRegionalPersistentDisk").msgclass - WorkstationConfig::PersistentDirectory::GceRegionalPersistentDisk::ReclaimPolicy = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.workstations.v1beta.WorkstationConfig.PersistentDirectory.GceRegionalPersistentDisk.ReclaimPolicy").enummodule - WorkstationConfig::EphemeralDirectory = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.workstations.v1beta.WorkstationConfig.EphemeralDirectory").msgclass - WorkstationConfig::EphemeralDirectory::GcePersistentDisk = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.workstations.v1beta.WorkstationConfig.EphemeralDirectory.GcePersistentDisk").msgclass - WorkstationConfig::Container = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.workstations.v1beta.WorkstationConfig.Container").msgclass - WorkstationConfig::CustomerEncryptionKey = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.workstations.v1beta.WorkstationConfig.CustomerEncryptionKey").msgclass - WorkstationConfig::ReadinessCheck = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.workstations.v1beta.WorkstationConfig.ReadinessCheck").msgclass - Workstation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.workstations.v1beta.Workstation").msgclass - Workstation::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.workstations.v1beta.Workstation.State").enummodule - GetWorkstationClusterRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.workstations.v1beta.GetWorkstationClusterRequest").msgclass - ListWorkstationClustersRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.workstations.v1beta.ListWorkstationClustersRequest").msgclass - ListWorkstationClustersResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.workstations.v1beta.ListWorkstationClustersResponse").msgclass - CreateWorkstationClusterRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.workstations.v1beta.CreateWorkstationClusterRequest").msgclass - UpdateWorkstationClusterRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.workstations.v1beta.UpdateWorkstationClusterRequest").msgclass - DeleteWorkstationClusterRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.workstations.v1beta.DeleteWorkstationClusterRequest").msgclass - GetWorkstationConfigRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.workstations.v1beta.GetWorkstationConfigRequest").msgclass - ListWorkstationConfigsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.workstations.v1beta.ListWorkstationConfigsRequest").msgclass - ListWorkstationConfigsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.workstations.v1beta.ListWorkstationConfigsResponse").msgclass - ListUsableWorkstationConfigsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.workstations.v1beta.ListUsableWorkstationConfigsRequest").msgclass - ListUsableWorkstationConfigsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.workstations.v1beta.ListUsableWorkstationConfigsResponse").msgclass - CreateWorkstationConfigRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.workstations.v1beta.CreateWorkstationConfigRequest").msgclass - UpdateWorkstationConfigRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.workstations.v1beta.UpdateWorkstationConfigRequest").msgclass - DeleteWorkstationConfigRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.workstations.v1beta.DeleteWorkstationConfigRequest").msgclass - GetWorkstationRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.workstations.v1beta.GetWorkstationRequest").msgclass - ListWorkstationsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.workstations.v1beta.ListWorkstationsRequest").msgclass - ListWorkstationsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.workstations.v1beta.ListWorkstationsResponse").msgclass - ListUsableWorkstationsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.workstations.v1beta.ListUsableWorkstationsRequest").msgclass - ListUsableWorkstationsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.workstations.v1beta.ListUsableWorkstationsResponse").msgclass - CreateWorkstationRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.workstations.v1beta.CreateWorkstationRequest").msgclass - UpdateWorkstationRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.workstations.v1beta.UpdateWorkstationRequest").msgclass - DeleteWorkstationRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.workstations.v1beta.DeleteWorkstationRequest").msgclass - StartWorkstationRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.workstations.v1beta.StartWorkstationRequest").msgclass - StopWorkstationRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.workstations.v1beta.StopWorkstationRequest").msgclass - GenerateAccessTokenRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.workstations.v1beta.GenerateAccessTokenRequest").msgclass - GenerateAccessTokenResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.workstations.v1beta.GenerateAccessTokenResponse").msgclass - OperationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.workstations.v1beta.OperationMetadata").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-cloud-workstations-v1beta/lib/google/cloud/workstations/v1beta/workstations_services_pb.rb b/owl-bot-staging/google-cloud-workstations-v1beta/lib/google/cloud/workstations/v1beta/workstations_services_pb.rb deleted file mode 100644 index 90f2fe5da085..000000000000 --- a/owl-bot-staging/google-cloud-workstations-v1beta/lib/google/cloud/workstations/v1beta/workstations_services_pb.rb +++ /dev/null @@ -1,86 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# Source: google/cloud/workstations/v1beta/workstations.proto for package 'google.cloud.workstations.v1beta' -# 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/workstations/v1beta/workstations_pb' - -module Google - module Cloud - module Workstations - module V1beta - module Workstations - # Service for interacting with Cloud Workstations. - class Service - - include ::GRPC::GenericService - - self.marshal_class_method = :encode - self.unmarshal_class_method = :decode - self.service_name = 'google.cloud.workstations.v1beta.Workstations' - - # Returns the requested workstation cluster. - rpc :GetWorkstationCluster, ::Google::Cloud::Workstations::V1beta::GetWorkstationClusterRequest, ::Google::Cloud::Workstations::V1beta::WorkstationCluster - # Returns all workstation clusters in the specified location. - rpc :ListWorkstationClusters, ::Google::Cloud::Workstations::V1beta::ListWorkstationClustersRequest, ::Google::Cloud::Workstations::V1beta::ListWorkstationClustersResponse - # Creates a new workstation cluster. - rpc :CreateWorkstationCluster, ::Google::Cloud::Workstations::V1beta::CreateWorkstationClusterRequest, ::Google::Longrunning::Operation - # Updates an existing workstation cluster. - rpc :UpdateWorkstationCluster, ::Google::Cloud::Workstations::V1beta::UpdateWorkstationClusterRequest, ::Google::Longrunning::Operation - # Deletes the specified workstation cluster. - rpc :DeleteWorkstationCluster, ::Google::Cloud::Workstations::V1beta::DeleteWorkstationClusterRequest, ::Google::Longrunning::Operation - # Returns the requested workstation configuration. - rpc :GetWorkstationConfig, ::Google::Cloud::Workstations::V1beta::GetWorkstationConfigRequest, ::Google::Cloud::Workstations::V1beta::WorkstationConfig - # Returns all workstation configurations in the specified cluster. - rpc :ListWorkstationConfigs, ::Google::Cloud::Workstations::V1beta::ListWorkstationConfigsRequest, ::Google::Cloud::Workstations::V1beta::ListWorkstationConfigsResponse - # Returns all workstation configurations in the specified cluster on which - # the caller has the "workstations.workstation.create" permission. - rpc :ListUsableWorkstationConfigs, ::Google::Cloud::Workstations::V1beta::ListUsableWorkstationConfigsRequest, ::Google::Cloud::Workstations::V1beta::ListUsableWorkstationConfigsResponse - # Creates a new workstation configuration. - rpc :CreateWorkstationConfig, ::Google::Cloud::Workstations::V1beta::CreateWorkstationConfigRequest, ::Google::Longrunning::Operation - # Updates an existing workstation configuration. - rpc :UpdateWorkstationConfig, ::Google::Cloud::Workstations::V1beta::UpdateWorkstationConfigRequest, ::Google::Longrunning::Operation - # Deletes the specified workstation configuration. - rpc :DeleteWorkstationConfig, ::Google::Cloud::Workstations::V1beta::DeleteWorkstationConfigRequest, ::Google::Longrunning::Operation - # Returns the requested workstation. - rpc :GetWorkstation, ::Google::Cloud::Workstations::V1beta::GetWorkstationRequest, ::Google::Cloud::Workstations::V1beta::Workstation - # Returns all Workstations using the specified workstation configuration. - rpc :ListWorkstations, ::Google::Cloud::Workstations::V1beta::ListWorkstationsRequest, ::Google::Cloud::Workstations::V1beta::ListWorkstationsResponse - # Returns all workstations using the specified workstation configuration - # on which the caller has the "workstations.workstations.use" permission. - rpc :ListUsableWorkstations, ::Google::Cloud::Workstations::V1beta::ListUsableWorkstationsRequest, ::Google::Cloud::Workstations::V1beta::ListUsableWorkstationsResponse - # Creates a new workstation. - rpc :CreateWorkstation, ::Google::Cloud::Workstations::V1beta::CreateWorkstationRequest, ::Google::Longrunning::Operation - # Updates an existing workstation. - rpc :UpdateWorkstation, ::Google::Cloud::Workstations::V1beta::UpdateWorkstationRequest, ::Google::Longrunning::Operation - # Deletes the specified workstation. - rpc :DeleteWorkstation, ::Google::Cloud::Workstations::V1beta::DeleteWorkstationRequest, ::Google::Longrunning::Operation - # Starts running a workstation so that users can connect to it. - rpc :StartWorkstation, ::Google::Cloud::Workstations::V1beta::StartWorkstationRequest, ::Google::Longrunning::Operation - # Stops running a workstation, reducing costs. - rpc :StopWorkstation, ::Google::Cloud::Workstations::V1beta::StopWorkstationRequest, ::Google::Longrunning::Operation - # Returns a short-lived credential that can be used to send authenticated and - # authorized traffic to a workstation. - rpc :GenerateAccessToken, ::Google::Cloud::Workstations::V1beta::GenerateAccessTokenRequest, ::Google::Cloud::Workstations::V1beta::GenerateAccessTokenResponse - end - - Stub = Service.rpc_stub_class - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-workstations-v1beta/proto_docs/README.md b/owl-bot-staging/google-cloud-workstations-v1beta/proto_docs/README.md deleted file mode 100644 index 3f70f22b3c09..000000000000 --- a/owl-bot-staging/google-cloud-workstations-v1beta/proto_docs/README.md +++ /dev/null @@ -1,4 +0,0 @@ -# Cloud Workstations V1BETA 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-workstations-v1beta/proto_docs/google/api/client.rb b/owl-bot-staging/google-cloud-workstations-v1beta/proto_docs/google/api/client.rb deleted file mode 100644 index 3ab0b096d445..000000000000 --- a/owl-bot-staging/google-cloud-workstations-v1beta/proto_docs/google/api/client.rb +++ /dev/null @@ -1,593 +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. - # - # Note: This field should not be used in most cases. - 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: - # library_settings: - # 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. - # @!attribute [rw] library_package - # @return [::String] - # The package name to use in Php. Clobbers the php_namespace option - # set in the protobuf. This should be used **only** by APIs - # who have already set the language_settings.php.package_name" field - # in gapic.yaml. API teams should use the protobuf php_namespace option - # where possible. - # - # Example of a YAML configuration:: - # - # publishing: - # library_settings: - # php_settings: - # library_package: Google\Cloud\PubSub\V1 - 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. - # - # Example: - # - # 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 - # @!attribute [rw] batching - # @return [::Google::Api::BatchingConfigProto] - # Batching configuration for an API method in client libraries. - # - # Example of a YAML configuration: - # - # publishing: - # method_settings: - # - selector: google.example.v1.ExampleService.BatchCreateExample - # batching: - # element_count_threshold: 1000 - # request_byte_threshold: 100000000 - # delay_threshold_millis: 10 - 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. - # - # Note: This feature should not be used in most cases. - # @!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 - - # `BatchingConfigProto` defines the batching configuration for an API method. - # @!attribute [rw] thresholds - # @return [::Google::Api::BatchingSettingsProto] - # The thresholds which trigger a batched request to be sent. - # @!attribute [rw] batch_descriptor - # @return [::Google::Api::BatchingDescriptorProto] - # The request and response fields used in batching. - class BatchingConfigProto - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # `BatchingSettingsProto` specifies a set of batching thresholds, each of - # which acts as a trigger to send a batch of messages as a request. At least - # one threshold must be positive nonzero. - # @!attribute [rw] element_count_threshold - # @return [::Integer] - # The number of elements of a field collected into a batch which, if - # exceeded, causes the batch to be sent. - # @!attribute [rw] request_byte_threshold - # @return [::Integer] - # The aggregated size of the batched field which, if exceeded, causes the - # batch to be sent. This size is computed by aggregating the sizes of the - # request field to be batched, not of the entire request message. - # @!attribute [rw] delay_threshold - # @return [::Google::Protobuf::Duration] - # The duration after which a batch should be sent, starting from the addition - # of the first message to that batch. - # @!attribute [rw] element_count_limit - # @return [::Integer] - # The maximum number of elements collected in a batch that could be accepted - # by server. - # @!attribute [rw] request_byte_limit - # @return [::Integer] - # The maximum size of the request that could be accepted by server. - # @!attribute [rw] flow_control_element_limit - # @return [::Integer] - # The maximum number of elements allowed by flow control. - # @!attribute [rw] flow_control_byte_limit - # @return [::Integer] - # The maximum size of data allowed by flow control. - # @!attribute [rw] flow_control_limit_exceeded_behavior - # @return [::Google::Api::FlowControlLimitExceededBehaviorProto] - # The behavior to take when the flow control limit is exceeded. - class BatchingSettingsProto - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # `BatchingDescriptorProto` specifies the fields of the request message to be - # used for batching, and, optionally, the fields of the response message to be - # used for demultiplexing. - # @!attribute [rw] batched_field - # @return [::String] - # The repeated field in the request message to be aggregated by batching. - # @!attribute [rw] discriminator_fields - # @return [::Array<::String>] - # A list of the fields in the request message. Two requests will be batched - # together only if the values of every field specified in - # `request_discriminator_fields` is equal between the two requests. - # @!attribute [rw] subresponse_field - # @return [::String] - # Optional. When present, indicates the field in the response message to be - # used to demultiplex the response into multiple response messages, in - # correspondence with the multiple request messages originally batched - # together. - class BatchingDescriptorProto - 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 - - # The behavior to take when the flow control limit is exceeded. - module FlowControlLimitExceededBehaviorProto - # Default behavior, system-defined. - UNSET_BEHAVIOR = 0 - - # Stop operation, raise error. - THROW_EXCEPTION = 1 - - # Pause operation until limit clears. - BLOCK = 2 - - # Continue operation, disregard limit. - IGNORE = 3 - end - end -end diff --git a/owl-bot-staging/google-cloud-workstations-v1beta/proto_docs/google/api/field_behavior.rb b/owl-bot-staging/google-cloud-workstations-v1beta/proto_docs/google/api/field_behavior.rb deleted file mode 100644 index 582be187d115..000000000000 --- a/owl-bot-staging/google-cloud-workstations-v1beta/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-workstations-v1beta/proto_docs/google/api/launch_stage.rb b/owl-bot-staging/google-cloud-workstations-v1beta/proto_docs/google/api/launch_stage.rb deleted file mode 100644 index 9392a413fb1b..000000000000 --- a/owl-bot-staging/google-cloud-workstations-v1beta/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-workstations-v1beta/proto_docs/google/api/resource.rb b/owl-bot-staging/google-cloud-workstations-v1beta/proto_docs/google/api/resource.rb deleted file mode 100644 index 25dec4847ac1..000000000000 --- a/owl-bot-staging/google-cloud-workstations-v1beta/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-workstations-v1beta/proto_docs/google/cloud/workstations/v1beta/workstations.rb b/owl-bot-staging/google-cloud-workstations-v1beta/proto_docs/google/cloud/workstations/v1beta/workstations.rb deleted file mode 100644 index dc2b64da78fb..000000000000 --- a/owl-bot-staging/google-cloud-workstations-v1beta/proto_docs/google/cloud/workstations/v1beta/workstations.rb +++ /dev/null @@ -1,1265 +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 Workstations - module V1beta - # A workstation cluster resource in the Cloud Workstations API. - # - # Defines a group of workstations in a particular region and the - # VPC network they're attached to. - # @!attribute [rw] name - # @return [::String] - # Full name of this workstation cluster. - # @!attribute [rw] display_name - # @return [::String] - # Optional. Human-readable name for this workstation cluster. - # @!attribute [r] uid - # @return [::String] - # Output only. A system-assigned unique identifier for this workstation - # cluster. - # @!attribute [r] reconciling - # @return [::Boolean] - # Output only. Indicates whether this workstation cluster is currently being - # updated to match its intended state. - # @!attribute [rw] annotations - # @return [::Google::Protobuf::Map{::String => ::String}] - # Optional. Client-specified annotations. - # @!attribute [rw] labels - # @return [::Google::Protobuf::Map{::String => ::String}] - # Optional. - # [Labels](https://cloud.google.com/workstations/docs/label-resources) that - # are applied to the workstation cluster and that are also propagated to the - # underlying Compute Engine resources. - # @!attribute [r] create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. Time when this workstation cluster was created. - # @!attribute [r] update_time - # @return [::Google::Protobuf::Timestamp] - # Output only. Time when this workstation cluster was most recently updated. - # @!attribute [r] delete_time - # @return [::Google::Protobuf::Timestamp] - # Output only. Time when this workstation cluster was soft-deleted. - # @!attribute [rw] etag - # @return [::String] - # Optional. Checksum computed by the server. May be sent on update and delete - # requests to make sure that the client has an up-to-date value before - # proceeding. - # @!attribute [rw] network - # @return [::String] - # Immutable. Name of the Compute Engine network in which instances associated - # with this workstation cluster will be created. - # @!attribute [rw] subnetwork - # @return [::String] - # Immutable. Name of the Compute Engine subnetwork in which instances - # associated with this workstation cluster will be created. Must be part of - # the subnetwork specified for this workstation cluster. - # @!attribute [r] control_plane_ip - # @return [::String] - # Output only. The private IP address of the control plane for this - # workstation cluster. Workstation VMs need access to this IP address to work - # with the service, so make sure that your firewall rules allow egress from - # the workstation VMs to this address. - # @!attribute [rw] private_cluster_config - # @return [::Google::Cloud::Workstations::V1beta::WorkstationCluster::PrivateClusterConfig] - # Optional. Configuration for private workstation cluster. - # @!attribute [r] degraded - # @return [::Boolean] - # Output only. Whether this workstation cluster is in degraded mode, in which - # case it may require user action to restore full functionality. Details can - # be found in - # {::Google::Cloud::Workstations::V1beta::WorkstationCluster#conditions conditions}. - # @!attribute [r] conditions - # @return [::Array<::Google::Rpc::Status>] - # Output only. Status conditions describing the workstation cluster's current - # state. - class WorkstationCluster - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Configuration options for private workstation clusters. - # @!attribute [rw] enable_private_endpoint - # @return [::Boolean] - # Immutable. Whether Workstations endpoint is private. - # @!attribute [r] cluster_hostname - # @return [::String] - # Output only. Hostname for the workstation cluster. This field will be - # populated only when private endpoint is enabled. To access workstations - # in the workstation cluster, create a new DNS zone mapping this domain - # name to an internal IP address and a forwarding rule mapping that address - # to the service attachment. - # @!attribute [r] service_attachment_uri - # @return [::String] - # Output only. Service attachment URI for the workstation cluster. The - # service attachemnt is created when private endpoint is enabled. To access - # workstations in the workstation cluster, configure access to the managed - # service using [Private Service - # Connect](https://cloud.google.com/vpc/docs/configure-private-service-connect-services). - # @!attribute [rw] allowed_projects - # @return [::Array<::String>] - # Optional. Additional projects that are allowed to attach to the - # workstation cluster's service attachment. By default, the workstation - # cluster's project and the VPC host project (if different) are allowed. - class PrivateClusterConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class AnnotationsEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class LabelsEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # A workstation configuration resource in the Cloud Workstations API. - # - # Workstation configurations act as templates for workstations. The workstation - # configuration defines details such as the workstation virtual machine (VM) - # instance type, persistent storage, container image defining environment, - # which IDE or Code Editor to use, and more. Administrators and platform teams - # can also use [Identity and Access Management - # (IAM)](https://cloud.google.com/iam/docs/overview) rules to grant access to - # teams or to individual developers. - # @!attribute [rw] name - # @return [::String] - # Full name of this workstation configuration. - # @!attribute [rw] display_name - # @return [::String] - # Optional. Human-readable name for this workstation configuration. - # @!attribute [r] uid - # @return [::String] - # Output only. A system-assigned unique identifier for this workstation - # configuration. - # @!attribute [r] reconciling - # @return [::Boolean] - # Output only. Indicates whether this workstation configuration is currently - # being updated to match its intended state. - # @!attribute [rw] annotations - # @return [::Google::Protobuf::Map{::String => ::String}] - # Optional. Client-specified annotations. - # @!attribute [rw] labels - # @return [::Google::Protobuf::Map{::String => ::String}] - # Optional. - # [Labels](https://cloud.google.com/workstations/docs/label-resources) that - # are applied to the workstation configuration and that are also propagated - # to the underlying Compute Engine resources. - # @!attribute [r] create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. Time when this workstation configuration was created. - # @!attribute [r] update_time - # @return [::Google::Protobuf::Timestamp] - # Output only. Time when this workstation configuration was most recently - # updated. - # @!attribute [r] delete_time - # @return [::Google::Protobuf::Timestamp] - # Output only. Time when this workstation configuration was soft-deleted. - # @!attribute [rw] etag - # @return [::String] - # Optional. Checksum computed by the server. May be sent on update and delete - # requests to make sure that the client has an up-to-date value before - # proceeding. - # @!attribute [rw] idle_timeout - # @return [::Google::Protobuf::Duration] - # Optional. Number of seconds to wait before automatically stopping a - # workstation after it last received user traffic. - # - # A value of `"0s"` indicates that Cloud Workstations VMs created with this - # configuration should never time out due to idleness. - # Provide - # [duration](https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#duration) - # terminated by `s` for seconds—for example, `"7200s"` (2 hours). - # The default is `"1200s"` (20 minutes). - # @!attribute [rw] running_timeout - # @return [::Google::Protobuf::Duration] - # Optional. Number of seconds that a workstation can run until it is - # automatically shut down. We recommend that workstations be shut down daily - # to reduce costs and so that security updates can be applied upon restart. - # The - # {::Google::Cloud::Workstations::V1beta::WorkstationConfig#idle_timeout idle_timeout} - # and - # {::Google::Cloud::Workstations::V1beta::WorkstationConfig#running_timeout running_timeout} - # fields are independent of each other. Note that the - # {::Google::Cloud::Workstations::V1beta::WorkstationConfig#running_timeout running_timeout} - # field shuts down VMs after the specified time, regardless of whether or not - # the VMs are idle. - # - # Provide duration terminated by `s` for seconds—for example, `"54000s"` - # (15 hours). Defaults to `"43200s"` (12 hours). A value of `"0s"` indicates - # that workstations using this configuration should never time out. If - # {::Google::Cloud::Workstations::V1beta::WorkstationConfig#encryption_key encryption_key} - # is set, it must be greater than `"0s"` and less than - # `"86400s"` (24 hours). - # - # Warning: A value of `"0s"` indicates that Cloud Workstations VMs created - # with this configuration have no maximum running time. This is strongly - # discouraged because you incur costs and will not pick up security updates. - # @!attribute [rw] host - # @return [::Google::Cloud::Workstations::V1beta::WorkstationConfig::Host] - # Optional. Runtime host for the workstation. - # @!attribute [rw] persistent_directories - # @return [::Array<::Google::Cloud::Workstations::V1beta::WorkstationConfig::PersistentDirectory>] - # Optional. Directories to persist across workstation sessions. - # @!attribute [rw] ephemeral_directories - # @return [::Array<::Google::Cloud::Workstations::V1beta::WorkstationConfig::EphemeralDirectory>] - # Optional. Ephemeral directories which won't persist across workstation - # sessions. - # @!attribute [rw] container - # @return [::Google::Cloud::Workstations::V1beta::WorkstationConfig::Container] - # Optional. Container that runs upon startup for each workstation using this - # workstation configuration. - # @!attribute [rw] encryption_key - # @return [::Google::Cloud::Workstations::V1beta::WorkstationConfig::CustomerEncryptionKey] - # Immutable. Encrypts resources of this workstation configuration using a - # customer-managed encryption key (CMEK). - # - # If specified, the boot disk of the Compute Engine instance and the - # persistent disk are encrypted using this encryption key. If - # this field is not set, the disks are encrypted using a generated - # key. Customer-managed encryption keys do not protect disk metadata. - # - # If the customer-managed encryption key is rotated, when the workstation - # instance is stopped, the system attempts to recreate the - # persistent disk with the new version of the key. Be sure to keep - # older versions of the key until the persistent disk is recreated. - # Otherwise, data on the persistent disk might be lost. - # - # If the encryption key is revoked, the workstation session automatically - # stops within 7 hours. - # - # Immutable after the workstation configuration is created. - # @!attribute [rw] readiness_checks - # @return [::Array<::Google::Cloud::Workstations::V1beta::WorkstationConfig::ReadinessCheck>] - # Optional. Readiness checks to perform when starting a workstation using - # this workstation configuration. Mark a workstation as running only after - # all specified readiness checks return 200 status codes. - # @!attribute [rw] replica_zones - # @return [::Array<::String>] - # Optional. Immutable. Specifies the zones used to replicate the VM and disk - # resources within the region. If set, exactly two zones within the - # workstation cluster's region must be specified—for example, - # `['us-central1-a', 'us-central1-f']`. If this field is empty, two default - # zones within the region are used. - # - # Immutable after the workstation configuration is created. - # @!attribute [r] degraded - # @return [::Boolean] - # Output only. Whether this resource is degraded, in which case it may - # require user action to restore full functionality. See also the - # {::Google::Cloud::Workstations::V1beta::WorkstationConfig#conditions conditions} - # field. - # @!attribute [r] conditions - # @return [::Array<::Google::Rpc::Status>] - # Output only. Status conditions describing the current resource state. - # @!attribute [rw] enable_audit_agent - # @return [::Boolean] - # Optional. Whether to enable Linux `auditd` logging on the workstation. When - # enabled, a service account must also be specified that has - # `logging.buckets.write` permission on the project. Operating system audit - # logging is distinct from [Cloud Audit - # Logs](https://cloud.google.com/workstations/docs/audit-logging). - class WorkstationConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Runtime host for a workstation. - # @!attribute [rw] gce_instance - # @return [::Google::Cloud::Workstations::V1beta::WorkstationConfig::Host::GceInstance] - # Specifies a Compute Engine instance as the host. - class Host - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # A runtime using a Compute Engine instance. - # @!attribute [rw] machine_type - # @return [::String] - # Optional. The type of machine to use for VM instances—for example, - # `"e2-standard-4"`. For more information about machine types that - # Cloud Workstations supports, see the list of - # [available machine - # types](https://cloud.google.com/workstations/docs/available-machine-types). - # @!attribute [rw] service_account - # @return [::String] - # Optional. The email address of the service account for Cloud - # Workstations VMs created with this configuration. When specified, be - # sure that the service account has `logginglogEntries.create` permission - # on the project so it can write logs out to Cloud Logging. If using a - # custom container image, the service account must have permissions to - # pull the specified image. - # - # If you as the administrator want to be able to `ssh` into the - # underlying VM, you need to set this value to a service account - # for which you have the `iam.serviceAccounts.actAs` permission. - # Conversely, if you don't want anyone to be able to `ssh` into the - # underlying VM, use a service account where no one has that - # permission. - # - # If not set, VMs run with a service account provided by the - # Cloud Workstations service, and the image must be publicly - # accessible. - # @!attribute [rw] service_account_scopes - # @return [::Array<::String>] - # Optional. Scopes to grant to the - # {::Google::Cloud::Workstations::V1beta::WorkstationConfig::Host::GceInstance#service_account service_account}. - # Various scopes are automatically added based on feature usage. When - # specified, users of workstations under this configuration must have - # `iam.serviceAccounts.actAs` on the service account. - # @!attribute [rw] tags - # @return [::Array<::String>] - # Optional. Network tags to add to the Compute Engine VMs backing the - # workstations. This option applies - # [network - # tags](https://cloud.google.com/vpc/docs/add-remove-network-tags) to VMs - # created with this configuration. These network tags enable the creation - # of [firewall - # rules](https://cloud.google.com/workstations/docs/configure-firewall-rules). - # @!attribute [rw] pool_size - # @return [::Integer] - # Optional. The number of VMs that the system should keep idle so that - # new workstations can be started quickly for new users. Defaults to `0` - # in the API. - # @!attribute [r] pooled_instances - # @return [::Integer] - # Output only. Number of instances currently available in the pool for - # faster workstation startup. - # @!attribute [rw] disable_public_ip_addresses - # @return [::Boolean] - # Optional. When set to true, disables public IP addresses for VMs. If - # you disable public IP addresses, you must set up Private Google Access - # or Cloud NAT on your network. If you use Private Google Access and you - # use `private.googleapis.com` or `restricted.googleapis.com` for - # Container Registry and Artifact Registry, make sure that you set - # up DNS records for domains `*.gcr.io` and `*.pkg.dev`. - # Defaults to false (VMs have public IP addresses). - # @!attribute [rw] enable_nested_virtualization - # @return [::Boolean] - # Optional. Whether to enable nested virtualization on Cloud Workstations - # VMs created under this workstation configuration. - # - # Nested virtualization lets you run virtual machine (VM) instances - # inside your workstation. Before enabling nested virtualization, - # consider the following important considerations. Cloud Workstations - # instances are subject to the [same restrictions as Compute Engine - # instances](https://cloud.google.com/compute/docs/instances/nested-virtualization/overview#restrictions): - # - # * **Organization policy**: projects, folders, or - # organizations may be restricted from creating nested VMs if the - # **Disable VM nested virtualization** constraint is enforced in - # the organization policy. For more information, see the - # Compute Engine section, - # [Checking whether nested virtualization is - # allowed](https://cloud.google.com/compute/docs/instances/nested-virtualization/managing-constraint#checking_whether_nested_virtualization_is_allowed). - # * **Performance**: nested VMs might experience a 10% or greater - # decrease in performance for workloads that are CPU-bound and - # possibly greater than a 10% decrease for workloads that are - # input/output bound. - # * **Machine Type**: nested virtualization can only be enabled on - # workstation configurations that specify a - # {::Google::Cloud::Workstations::V1beta::WorkstationConfig::Host::GceInstance#machine_type machine_type} - # in the N1 or N2 machine series. - # * **GPUs**: nested virtualization may not be enabled on workstation - # configurations with accelerators. - # * **Operating System**: Because - # [Container-Optimized - # OS](https://cloud.google.com/compute/docs/images/os-details#container-optimized_os_cos) - # does not support nested virtualization, when nested virtualization is - # enabled, the underlying Compute Engine VM instances boot from an - # [Ubuntu - # LTS](https://cloud.google.com/compute/docs/images/os-details#ubuntu_lts) - # image. - # @!attribute [rw] shielded_instance_config - # @return [::Google::Cloud::Workstations::V1beta::WorkstationConfig::Host::GceInstance::GceShieldedInstanceConfig] - # Optional. A set of Compute Engine Shielded instance options. - # @!attribute [rw] confidential_instance_config - # @return [::Google::Cloud::Workstations::V1beta::WorkstationConfig::Host::GceInstance::GceConfidentialInstanceConfig] - # Optional. A set of Compute Engine Confidential VM instance options. - # @!attribute [rw] boot_disk_size_gb - # @return [::Integer] - # Optional. The size of the boot disk for the VM in gigabytes (GB). - # The minimum boot disk size is `30` GB. Defaults to `50` GB. - # @!attribute [rw] accelerators - # @return [::Array<::Google::Cloud::Workstations::V1beta::WorkstationConfig::Host::GceInstance::Accelerator>] - # Optional. A list of the type and count of accelerator cards attached to - # the instance. - class GceInstance - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # A set of Compute Engine Shielded instance options. - # @!attribute [rw] enable_secure_boot - # @return [::Boolean] - # Optional. Whether the instance has Secure Boot enabled. - # @!attribute [rw] enable_vtpm - # @return [::Boolean] - # Optional. Whether the instance has the vTPM enabled. - # @!attribute [rw] enable_integrity_monitoring - # @return [::Boolean] - # Optional. Whether the instance has integrity monitoring enabled. - class GceShieldedInstanceConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A set of Compute Engine Confidential VM instance options. - # @!attribute [rw] enable_confidential_compute - # @return [::Boolean] - # Optional. Whether the instance has confidential compute enabled. - class GceConfidentialInstanceConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # An accelerator card attached to the instance. - # @!attribute [rw] type - # @return [::String] - # Optional. Type of accelerator resource to attach to the instance, for - # example, - # `"nvidia-tesla-p100"`. - # @!attribute [rw] count - # @return [::Integer] - # Optional. Number of accelerator cards exposed to the instance. - class Accelerator - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - - # A directory to persist across workstation sessions. - # @!attribute [rw] gce_pd - # @return [::Google::Cloud::Workstations::V1beta::WorkstationConfig::PersistentDirectory::GceRegionalPersistentDisk] - # A PersistentDirectory backed by a Compute Engine persistent disk. - # @!attribute [rw] mount_path - # @return [::String] - # Optional. Location of this directory in the running workstation. - class PersistentDirectory - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # A PersistentDirectory backed by a Compute Engine regional persistent - # disk. The - # {::Google::Cloud::Workstations::V1beta::WorkstationConfig#persistent_directories persistent_directories} - # field is repeated, but it may contain only one entry. It creates a - # [persistent - # disk](https://cloud.google.com/compute/docs/disks/persistent-disks) that - # mounts to the workstation VM at `/home` when the session starts and - # detaches when the session ends. If this field is empty, workstations - # created with this configuration do not have a persistent home - # directory. - # @!attribute [rw] size_gb - # @return [::Integer] - # Optional. The GB capacity of a persistent home directory for each - # workstation created with this configuration. Must be empty if - # {::Google::Cloud::Workstations::V1beta::WorkstationConfig::PersistentDirectory::GceRegionalPersistentDisk#source_snapshot source_snapshot} - # is set. - # - # Valid values are `10`, `50`, `100`, `200`, `500`, or `1000`. - # Defaults to `200`. If less than `200` GB, the - # {::Google::Cloud::Workstations::V1beta::WorkstationConfig::PersistentDirectory::GceRegionalPersistentDisk#disk_type disk_type} - # must be - # `"pd-balanced"` or `"pd-ssd"`. - # @!attribute [rw] fs_type - # @return [::String] - # Optional. Type of file system that the disk should be formatted with. - # The workstation image must support this file system type. Must be empty - # if - # {::Google::Cloud::Workstations::V1beta::WorkstationConfig::PersistentDirectory::GceRegionalPersistentDisk#source_snapshot source_snapshot} - # is set. Defaults to `"ext4"`. - # @!attribute [rw] disk_type - # @return [::String] - # Optional. The [type of the persistent - # disk](https://cloud.google.com/compute/docs/disks#disk-types) for the - # home directory. Defaults to `"pd-standard"`. - # @!attribute [rw] source_snapshot - # @return [::String] - # Optional. Name of the snapshot to use as the source for the disk. If - # set, - # {::Google::Cloud::Workstations::V1beta::WorkstationConfig::PersistentDirectory::GceRegionalPersistentDisk#size_gb size_gb} - # and - # {::Google::Cloud::Workstations::V1beta::WorkstationConfig::PersistentDirectory::GceRegionalPersistentDisk#fs_type fs_type} - # must be empty. - # @!attribute [rw] reclaim_policy - # @return [::Google::Cloud::Workstations::V1beta::WorkstationConfig::PersistentDirectory::GceRegionalPersistentDisk::ReclaimPolicy] - # Optional. Whether the persistent disk should be deleted when the - # workstation is deleted. Valid values are `DELETE` and `RETAIN`. - # Defaults to `DELETE`. - class GceRegionalPersistentDisk - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Value representing what should happen to the disk after the workstation - # is deleted. - module ReclaimPolicy - # Do not use. - RECLAIM_POLICY_UNSPECIFIED = 0 - - # Delete the persistent disk when deleting the workstation. - DELETE = 1 - - # Keep the persistent disk when deleting the workstation. - # An administrator must manually delete the disk. - RETAIN = 2 - end - end - end - - # An ephemeral directory which won't persist across workstation sessions. It - # is freshly created on every workstation start operation. - # @!attribute [rw] gce_pd - # @return [::Google::Cloud::Workstations::V1beta::WorkstationConfig::EphemeralDirectory::GcePersistentDisk] - # An EphemeralDirectory backed by a Compute Engine persistent disk. - # @!attribute [rw] mount_path - # @return [::String] - # Required. Location of this directory in the running workstation. - class EphemeralDirectory - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # An EphemeralDirectory is backed by a Compute Engine persistent disk. - # @!attribute [rw] disk_type - # @return [::String] - # Optional. Type of the disk to use. Defaults to `"pd-standard"`. - # @!attribute [rw] source_snapshot - # @return [::String] - # Optional. Name of the snapshot to use as the source for the disk. Must - # be empty if - # {::Google::Cloud::Workstations::V1beta::WorkstationConfig::EphemeralDirectory::GcePersistentDisk#source_image source_image} - # is set. Updating - # {::Google::Cloud::Workstations::V1beta::WorkstationConfig::EphemeralDirectory::GcePersistentDisk#source_snapshot source_snapshot} - # will update content in the ephemeral directory after the workstation is - # restarted. This field is mutable. - # @!attribute [rw] source_image - # @return [::String] - # Optional. Name of the disk image to use as the source for the disk. - # Must be empty if - # {::Google::Cloud::Workstations::V1beta::WorkstationConfig::EphemeralDirectory::GcePersistentDisk#source_snapshot source_snapshot} - # is set. Updating - # {::Google::Cloud::Workstations::V1beta::WorkstationConfig::EphemeralDirectory::GcePersistentDisk#source_image source_image} - # will update content in the ephemeral directory after the workstation is - # restarted. This field is mutable. - # @!attribute [rw] read_only - # @return [::Boolean] - # Optional. Whether the disk is read only. If true, the disk may be - # shared by multiple VMs and - # {::Google::Cloud::Workstations::V1beta::WorkstationConfig::EphemeralDirectory::GcePersistentDisk#source_snapshot source_snapshot} - # must be set. - class GcePersistentDisk - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # A Docker container. - # @!attribute [rw] image - # @return [::String] - # Optional. A Docker container image that defines a custom environment. - # - # Cloud Workstations provides a number of - # [preconfigured - # images](https://cloud.google.com/workstations/docs/preconfigured-base-images), - # but you can create your own - # [custom container - # images](https://cloud.google.com/workstations/docs/custom-container-images). - # If using a private image, the `host.gceInstance.serviceAccount` field - # must be specified in the workstation configuration and must have - # permission to pull the specified image. Otherwise, the image must be - # publicly accessible. - # @!attribute [rw] command - # @return [::Array<::String>] - # Optional. If set, overrides the default ENTRYPOINT specified by the - # image. - # @!attribute [rw] args - # @return [::Array<::String>] - # Optional. Arguments passed to the entrypoint. - # @!attribute [rw] env - # @return [::Google::Protobuf::Map{::String => ::String}] - # Optional. Environment variables passed to the container's entrypoint. - # @!attribute [rw] working_dir - # @return [::String] - # Optional. If set, overrides the default DIR specified by the image. - # @!attribute [rw] run_as_user - # @return [::Integer] - # Optional. If set, overrides the USER specified in the image with the - # given uid. - class Container - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class EnvEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # A customer-managed encryption key (CMEK) for the Compute Engine - # resources of the associated workstation configuration. Specify the name of - # your Cloud KMS encryption key and the default service account. - # We recommend that you use a separate service account and follow - # [Cloud KMS best - # practices](https://cloud.google.com/kms/docs/separation-of-duties). - # @!attribute [rw] kms_key - # @return [::String] - # Immutable. The name of the Google Cloud KMS encryption key. For example, - # `"projects/PROJECT_ID/locations/REGION/keyRings/KEY_RING/cryptoKeys/KEY_NAME"`. - # The key must be in the same region as the workstation configuration. - # @!attribute [rw] kms_key_service_account - # @return [::String] - # Immutable. The service account to use with the specified - # KMS key. We recommend that you use a separate service account - # and follow KMS best practices. For more information, see - # [Separation of - # duties](https://cloud.google.com/kms/docs/separation-of-duties) and - # `gcloud kms keys add-iam-policy-binding` - # [`--member`](https://cloud.google.com/sdk/gcloud/reference/kms/keys/add-iam-policy-binding#--member). - class CustomerEncryptionKey - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # A readiness check to be performed on a workstation. - # @!attribute [rw] path - # @return [::String] - # Optional. Path to which the request should be sent. - # @!attribute [rw] port - # @return [::Integer] - # Optional. Port to which the request should be sent. - class ReadinessCheck - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class AnnotationsEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class LabelsEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # A single instance of a developer workstation with its own persistent storage. - # @!attribute [rw] name - # @return [::String] - # Full name of this workstation. - # @!attribute [rw] display_name - # @return [::String] - # Optional. Human-readable name for this workstation. - # @!attribute [r] uid - # @return [::String] - # Output only. A system-assigned unique identifier for this workstation. - # @!attribute [r] reconciling - # @return [::Boolean] - # Output only. Indicates whether this workstation is currently being updated - # to match its intended state. - # @!attribute [rw] annotations - # @return [::Google::Protobuf::Map{::String => ::String}] - # Optional. Client-specified annotations. - # @!attribute [rw] labels - # @return [::Google::Protobuf::Map{::String => ::String}] - # Optional. - # [Labels](https://cloud.google.com/workstations/docs/label-resources) that - # are applied to the workstation and that are also propagated to the - # underlying Compute Engine resources. - # @!attribute [r] create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. Time when this workstation was created. - # @!attribute [r] update_time - # @return [::Google::Protobuf::Timestamp] - # Output only. Time when this workstation was most recently updated. - # @!attribute [r] start_time - # @return [::Google::Protobuf::Timestamp] - # Output only. Time when this workstation was most recently successfully - # started, regardless of the workstation's initial state. - # @!attribute [r] delete_time - # @return [::Google::Protobuf::Timestamp] - # Output only. Time when this workstation was soft-deleted. - # @!attribute [rw] etag - # @return [::String] - # Optional. Checksum computed by the server. May be sent on update and delete - # requests to make sure that the client has an up-to-date value before - # proceeding. - # @!attribute [r] state - # @return [::Google::Cloud::Workstations::V1beta::Workstation::State] - # Output only. Current state of the workstation. - # @!attribute [r] host - # @return [::String] - # Output only. Host to which clients can send HTTPS traffic that will be - # received by the workstation. Authorized traffic will be received to the - # workstation as HTTP on port 80. To send traffic to a different port, - # clients may prefix the host with the destination port in the format - # `{port}-{host}`. - # @!attribute [rw] env - # @return [::Google::Protobuf::Map{::String => ::String}] - # Optional. Environment variables passed to the workstation container's - # entrypoint. - class Workstation - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class AnnotationsEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class LabelsEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class EnvEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Whether a workstation is running and ready to receive user requests. - module State - # Do not use. - STATE_UNSPECIFIED = 0 - - # The workstation is not yet ready to accept requests from users but will - # be soon. - STATE_STARTING = 1 - - # The workstation is ready to accept requests from users. - STATE_RUNNING = 2 - - # The workstation is being stopped. - STATE_STOPPING = 3 - - # The workstation is stopped and will not be able to receive requests until - # it is started. - STATE_STOPPED = 4 - end - end - - # Request message for GetWorkstationCluster. - # @!attribute [rw] name - # @return [::String] - # Required. Name of the requested resource. - class GetWorkstationClusterRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for ListWorkstationClusters. - # @!attribute [rw] parent - # @return [::String] - # Required. Parent resource name. - # @!attribute [rw] page_size - # @return [::Integer] - # Optional. Maximum number of items to return. - # @!attribute [rw] page_token - # @return [::String] - # Optional. next_page_token value returned from a previous List request, if - # any. - class ListWorkstationClustersRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for ListWorkstationClusters. - # @!attribute [rw] workstation_clusters - # @return [::Array<::Google::Cloud::Workstations::V1beta::WorkstationCluster>] - # The requested workstation clusters. - # @!attribute [rw] next_page_token - # @return [::String] - # Token to retrieve the next page of results, or empty if there are no more - # results in the list. - # @!attribute [rw] unreachable - # @return [::Array<::String>] - # Unreachable resources. - class ListWorkstationClustersResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Message for creating a CreateWorkstationCluster. - # @!attribute [rw] parent - # @return [::String] - # Required. Parent resource name. - # @!attribute [rw] workstation_cluster_id - # @return [::String] - # Required. ID to use for the workstation cluster. - # @!attribute [rw] workstation_cluster - # @return [::Google::Cloud::Workstations::V1beta::WorkstationCluster] - # Required. Workstation cluster to create. - # @!attribute [rw] validate_only - # @return [::Boolean] - # Optional. If set, validate the request and preview the review, but do not - # actually apply it. - class CreateWorkstationClusterRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for UpdateWorkstationCluster. - # @!attribute [rw] workstation_cluster - # @return [::Google::Cloud::Workstations::V1beta::WorkstationCluster] - # Required. Workstation cluster to update. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # Required. Mask that specifies which fields in the workstation cluster - # should be updated. - # @!attribute [rw] validate_only - # @return [::Boolean] - # Optional. If set, validate the request and preview the review, but do not - # actually apply it. - # @!attribute [rw] allow_missing - # @return [::Boolean] - # Optional. If set, and the workstation cluster is not found, a new - # workstation cluster will be created. In this situation, update_mask is - # ignored. - class UpdateWorkstationClusterRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Message for deleting a workstation cluster. - # @!attribute [rw] name - # @return [::String] - # Required. Name of the workstation cluster to delete. - # @!attribute [rw] validate_only - # @return [::Boolean] - # Optional. If set, validate the request and preview the review, but do not - # apply it. - # @!attribute [rw] etag - # @return [::String] - # Optional. If set, the request will be rejected if the latest version of the - # workstation cluster on the server does not have this ETag. - # @!attribute [rw] force - # @return [::Boolean] - # Optional. If set, any workstation configurations and workstations in the - # workstation cluster are also deleted. Otherwise, the request only - # works if the workstation cluster has no configurations or workstations. - class DeleteWorkstationClusterRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for GetWorkstationConfig. - # @!attribute [rw] name - # @return [::String] - # Required. Name of the requested resource. - class GetWorkstationConfigRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for ListWorkstationConfigs. - # @!attribute [rw] parent - # @return [::String] - # Required. Parent resource name. - # @!attribute [rw] page_size - # @return [::Integer] - # Optional. Maximum number of items to return. - # @!attribute [rw] page_token - # @return [::String] - # Optional. next_page_token value returned from a previous List request, if - # any. - class ListWorkstationConfigsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for ListWorkstationConfigs. - # @!attribute [rw] workstation_configs - # @return [::Array<::Google::Cloud::Workstations::V1beta::WorkstationConfig>] - # The requested configs. - # @!attribute [rw] next_page_token - # @return [::String] - # Token to retrieve the next page of results, or empty if there are no more - # results in the list. - # @!attribute [rw] unreachable - # @return [::Array<::String>] - # Unreachable resources. - class ListWorkstationConfigsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for ListUsableWorkstationConfigs. - # @!attribute [rw] parent - # @return [::String] - # Required. Parent resource name. - # @!attribute [rw] page_size - # @return [::Integer] - # Optional. Maximum number of items to return. - # @!attribute [rw] page_token - # @return [::String] - # Optional. next_page_token value returned from a previous List request, if - # any. - class ListUsableWorkstationConfigsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for ListUsableWorkstationConfigs. - # @!attribute [rw] workstation_configs - # @return [::Array<::Google::Cloud::Workstations::V1beta::WorkstationConfig>] - # The requested configs. - # @!attribute [rw] next_page_token - # @return [::String] - # Token to retrieve the next page of results, or empty if there are no more - # results in the list. - # @!attribute [rw] unreachable - # @return [::Array<::String>] - # Unreachable resources. - class ListUsableWorkstationConfigsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Message for creating a CreateWorkstationConfig. - # @!attribute [rw] parent - # @return [::String] - # Required. Parent resource name. - # @!attribute [rw] workstation_config_id - # @return [::String] - # Required. ID to use for the workstation configuration. - # @!attribute [rw] workstation_config - # @return [::Google::Cloud::Workstations::V1beta::WorkstationConfig] - # Required. Config to create. - # @!attribute [rw] validate_only - # @return [::Boolean] - # Optional. If set, validate the request and preview the review, but do not - # actually apply it. - class CreateWorkstationConfigRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for UpdateWorkstationConfig. - # @!attribute [rw] workstation_config - # @return [::Google::Cloud::Workstations::V1beta::WorkstationConfig] - # Required. Config to update. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # Required. Mask specifying which fields in the workstation configuration - # should be updated. - # @!attribute [rw] validate_only - # @return [::Boolean] - # Optional. If set, validate the request and preview the review, but do not - # actually apply it. - # @!attribute [rw] allow_missing - # @return [::Boolean] - # Optional. If set and the workstation configuration is not found, a new - # workstation configuration will be created. In this situation, - # update_mask is ignored. - class UpdateWorkstationConfigRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Message for deleting a workstation configuration. - # @!attribute [rw] name - # @return [::String] - # Required. Name of the workstation configuration to delete. - # @!attribute [rw] validate_only - # @return [::Boolean] - # Optional. If set, validate the request and preview the review, but do not - # actually apply it. - # @!attribute [rw] etag - # @return [::String] - # Optional. If set, the request is rejected if the latest version of the - # workstation configuration on the server does not have this ETag. - # @!attribute [rw] force - # @return [::Boolean] - # Optional. If set, any workstations in the workstation configuration are - # also deleted. Otherwise, the request works only if the workstation - # configuration has no workstations. - class DeleteWorkstationConfigRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for GetWorkstation. - # @!attribute [rw] name - # @return [::String] - # Required. Name of the requested resource. - class GetWorkstationRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for ListWorkstations. - # @!attribute [rw] parent - # @return [::String] - # Required. Parent resource name. - # @!attribute [rw] page_size - # @return [::Integer] - # Optional. Maximum number of items to return. - # @!attribute [rw] page_token - # @return [::String] - # Optional. next_page_token value returned from a previous List request, if - # any. - class ListWorkstationsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for ListWorkstations. - # @!attribute [rw] workstations - # @return [::Array<::Google::Cloud::Workstations::V1beta::Workstation>] - # The requested workstations. - # @!attribute [rw] next_page_token - # @return [::String] - # Optional. Token to retrieve the next page of results, or empty if there are - # no more results in the list. - # @!attribute [rw] unreachable - # @return [::Array<::String>] - # Optional. Unreachable resources. - class ListWorkstationsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for ListUsableWorkstations. - # @!attribute [rw] parent - # @return [::String] - # Required. Parent resource name. - # @!attribute [rw] page_size - # @return [::Integer] - # Optional. Maximum number of items to return. - # @!attribute [rw] page_token - # @return [::String] - # Optional. next_page_token value returned from a previous List request, if - # any. - class ListUsableWorkstationsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for ListUsableWorkstations. - # @!attribute [rw] workstations - # @return [::Array<::Google::Cloud::Workstations::V1beta::Workstation>] - # The requested workstations. - # @!attribute [rw] next_page_token - # @return [::String] - # Token to retrieve the next page of results, or empty if there are no more - # results in the list. - # @!attribute [rw] unreachable - # @return [::Array<::String>] - # Unreachable resources. - class ListUsableWorkstationsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Message for creating a CreateWorkstation. - # @!attribute [rw] parent - # @return [::String] - # Required. Parent resource name. - # @!attribute [rw] workstation_id - # @return [::String] - # Required. ID to use for the workstation. - # @!attribute [rw] workstation - # @return [::Google::Cloud::Workstations::V1beta::Workstation] - # Required. Workstation to create. - # @!attribute [rw] validate_only - # @return [::Boolean] - # Optional. If set, validate the request and preview the review, but do not - # actually apply it. - class CreateWorkstationRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for UpdateWorkstation. - # @!attribute [rw] workstation - # @return [::Google::Cloud::Workstations::V1beta::Workstation] - # Required. Workstation to update. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # Required. Mask specifying which fields in the workstation configuration - # should be updated. - # @!attribute [rw] validate_only - # @return [::Boolean] - # Optional. If set, validate the request and preview the review, but do not - # actually apply it. - # @!attribute [rw] allow_missing - # @return [::Boolean] - # Optional. If set and the workstation configuration is not found, a new - # workstation configuration is created. In this situation, update_mask - # is ignored. - class UpdateWorkstationRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for DeleteWorkstation. - # @!attribute [rw] name - # @return [::String] - # Required. Name of the workstation to delete. - # @!attribute [rw] validate_only - # @return [::Boolean] - # Optional. If set, validate the request and preview the review, but do not - # actually apply it. - # @!attribute [rw] etag - # @return [::String] - # Optional. If set, the request will be rejected if the latest version of the - # workstation on the server does not have this ETag. - class DeleteWorkstationRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for StartWorkstation. - # @!attribute [rw] name - # @return [::String] - # Required. Name of the workstation to start. - # @!attribute [rw] validate_only - # @return [::Boolean] - # Optional. If set, validate the request and preview the review, but do not - # actually apply it. - # @!attribute [rw] etag - # @return [::String] - # Optional. If set, the request will be rejected if the latest version of the - # workstation on the server does not have this ETag. - class StartWorkstationRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for StopWorkstation. - # @!attribute [rw] name - # @return [::String] - # Required. Name of the workstation to stop. - # @!attribute [rw] validate_only - # @return [::Boolean] - # Optional. If set, validate the request and preview the review, but do not - # actually apply it. - # @!attribute [rw] etag - # @return [::String] - # Optional. If set, the request will be rejected if the latest version of the - # workstation on the server does not have this ETag. - class StopWorkstationRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for GenerateAccessToken. - # @!attribute [rw] expire_time - # @return [::Google::Protobuf::Timestamp] - # Desired expiration time of the access token. This value must - # be at most 24 hours in the future. If a value is not specified, the - # token's expiration time will be set to a default value of 1 hour in the - # future. - # - # 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] - # Desired lifetime duration of the access token. This value must - # be at most 24 hours. If a value is not specified, the token's lifetime - # will be set to a default value of 1 hour. - # - # 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 [rw] workstation - # @return [::String] - # Required. Name of the workstation for which the access token should be - # generated. - class GenerateAccessTokenRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for GenerateAccessToken. - # @!attribute [rw] access_token - # @return [::String] - # The generated bearer access token. To use this token, include it in an - # Authorization header of an HTTP request sent to the associated - # workstation's hostname—for example, `Authorization: Bearer - # `. - # @!attribute [rw] expire_time - # @return [::Google::Protobuf::Timestamp] - # Time at which the generated token will expire. - class GenerateAccessTokenResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Metadata for long-running operations. - # @!attribute [r] create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. Time that the operation was created. - # @!attribute [r] end_time - # @return [::Google::Protobuf::Timestamp] - # Output only. Time that the operation finished running. - # @!attribute [r] target - # @return [::String] - # Output only. Server-defined resource path for the target of the operation. - # @!attribute [r] verb - # @return [::String] - # Output only. Name of the verb executed by the operation. - # @!attribute [r] status_message - # @return [::String] - # Output only. Human-readable status of the operation, if any. - # @!attribute [r] requested_cancellation - # @return [::Boolean] - # Output only. Identifies whether the user has requested cancellation - # of the operation. - # @!attribute [r] api_version - # @return [::String] - # Output only. API version used to start the operation. - class OperationMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-cloud-workstations-v1beta/proto_docs/google/longrunning/operations.rb b/owl-bot-staging/google-cloud-workstations-v1beta/proto_docs/google/longrunning/operations.rb deleted file mode 100644 index 7a757f512165..000000000000 --- a/owl-bot-staging/google-cloud-workstations-v1beta/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-workstations-v1beta/proto_docs/google/protobuf/any.rb b/owl-bot-staging/google-cloud-workstations-v1beta/proto_docs/google/protobuf/any.rb deleted file mode 100644 index 58691995f02e..000000000000 --- a/owl-bot-staging/google-cloud-workstations-v1beta/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-workstations-v1beta/proto_docs/google/protobuf/duration.rb b/owl-bot-staging/google-cloud-workstations-v1beta/proto_docs/google/protobuf/duration.rb deleted file mode 100644 index ea59f1f91daf..000000000000 --- a/owl-bot-staging/google-cloud-workstations-v1beta/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-workstations-v1beta/proto_docs/google/protobuf/empty.rb b/owl-bot-staging/google-cloud-workstations-v1beta/proto_docs/google/protobuf/empty.rb deleted file mode 100644 index 83e4481834a6..000000000000 --- a/owl-bot-staging/google-cloud-workstations-v1beta/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-workstations-v1beta/proto_docs/google/protobuf/field_mask.rb b/owl-bot-staging/google-cloud-workstations-v1beta/proto_docs/google/protobuf/field_mask.rb deleted file mode 100644 index 7f3ffc78601a..000000000000 --- a/owl-bot-staging/google-cloud-workstations-v1beta/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-workstations-v1beta/proto_docs/google/protobuf/timestamp.rb b/owl-bot-staging/google-cloud-workstations-v1beta/proto_docs/google/protobuf/timestamp.rb deleted file mode 100644 index 74352be9c58c..000000000000 --- a/owl-bot-staging/google-cloud-workstations-v1beta/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-workstations-v1beta/proto_docs/google/rpc/status.rb b/owl-bot-staging/google-cloud-workstations-v1beta/proto_docs/google/rpc/status.rb deleted file mode 100644 index c1a1c07eb2db..000000000000 --- a/owl-bot-staging/google-cloud-workstations-v1beta/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-workstations-v1beta/proto_docs/google/type/expr.rb b/owl-bot-staging/google-cloud-workstations-v1beta/proto_docs/google/type/expr.rb deleted file mode 100644 index 53e7733b6592..000000000000 --- a/owl-bot-staging/google-cloud-workstations-v1beta/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-workstations-v1beta/snippets/Gemfile b/owl-bot-staging/google-cloud-workstations-v1beta/snippets/Gemfile deleted file mode 100644 index 7a19ba50a0c6..000000000000 --- a/owl-bot-staging/google-cloud-workstations-v1beta/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-workstations-v1beta", path: "../" -else - gem "google-cloud-workstations-v1beta" -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-workstations-v1beta/snippets/snippet_metadata_google.cloud.workstations.v1beta.json b/owl-bot-staging/google-cloud-workstations-v1beta/snippets/snippet_metadata_google.cloud.workstations.v1beta.json deleted file mode 100644 index 46f10e2bfde3..000000000000 --- a/owl-bot-staging/google-cloud-workstations-v1beta/snippets/snippet_metadata_google.cloud.workstations.v1beta.json +++ /dev/null @@ -1,815 +0,0 @@ -{ - "client_library": { - "name": "google-cloud-workstations-v1beta", - "version": "", - "language": "RUBY", - "apis": [ - { - "id": "google.cloud.workstations.v1beta", - "version": "v1beta" - } - ] - }, - "snippets": [ - { - "region_tag": "workstations_v1beta_generated_Workstations_GetWorkstationCluster_sync", - "title": "Snippet for the get_workstation_cluster call in the Workstations service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Workstations::V1beta::Workstations::Client#get_workstation_cluster.", - "file": "workstations/get_workstation_cluster.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_workstation_cluster", - "full_name": "::Google::Cloud::Workstations::V1beta::Workstations::Client#get_workstation_cluster", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Workstations::V1beta::GetWorkstationClusterRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Workstations::V1beta::WorkstationCluster", - "client": { - "short_name": "Workstations::Client", - "full_name": "::Google::Cloud::Workstations::V1beta::Workstations::Client" - }, - "method": { - "short_name": "GetWorkstationCluster", - "full_name": "google.cloud.workstations.v1beta.Workstations.GetWorkstationCluster", - "service": { - "short_name": "Workstations", - "full_name": "google.cloud.workstations.v1beta.Workstations" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "workstations_v1beta_generated_Workstations_ListWorkstationClusters_sync", - "title": "Snippet for the list_workstation_clusters call in the Workstations service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Workstations::V1beta::Workstations::Client#list_workstation_clusters.", - "file": "workstations/list_workstation_clusters.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_workstation_clusters", - "full_name": "::Google::Cloud::Workstations::V1beta::Workstations::Client#list_workstation_clusters", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Workstations::V1beta::ListWorkstationClustersRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Workstations::V1beta::ListWorkstationClustersResponse", - "client": { - "short_name": "Workstations::Client", - "full_name": "::Google::Cloud::Workstations::V1beta::Workstations::Client" - }, - "method": { - "short_name": "ListWorkstationClusters", - "full_name": "google.cloud.workstations.v1beta.Workstations.ListWorkstationClusters", - "service": { - "short_name": "Workstations", - "full_name": "google.cloud.workstations.v1beta.Workstations" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "workstations_v1beta_generated_Workstations_CreateWorkstationCluster_sync", - "title": "Snippet for the create_workstation_cluster call in the Workstations service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Workstations::V1beta::Workstations::Client#create_workstation_cluster.", - "file": "workstations/create_workstation_cluster.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_workstation_cluster", - "full_name": "::Google::Cloud::Workstations::V1beta::Workstations::Client#create_workstation_cluster", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Workstations::V1beta::CreateWorkstationClusterRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "Workstations::Client", - "full_name": "::Google::Cloud::Workstations::V1beta::Workstations::Client" - }, - "method": { - "short_name": "CreateWorkstationCluster", - "full_name": "google.cloud.workstations.v1beta.Workstations.CreateWorkstationCluster", - "service": { - "short_name": "Workstations", - "full_name": "google.cloud.workstations.v1beta.Workstations" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "workstations_v1beta_generated_Workstations_UpdateWorkstationCluster_sync", - "title": "Snippet for the update_workstation_cluster call in the Workstations service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Workstations::V1beta::Workstations::Client#update_workstation_cluster.", - "file": "workstations/update_workstation_cluster.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_workstation_cluster", - "full_name": "::Google::Cloud::Workstations::V1beta::Workstations::Client#update_workstation_cluster", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Workstations::V1beta::UpdateWorkstationClusterRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "Workstations::Client", - "full_name": "::Google::Cloud::Workstations::V1beta::Workstations::Client" - }, - "method": { - "short_name": "UpdateWorkstationCluster", - "full_name": "google.cloud.workstations.v1beta.Workstations.UpdateWorkstationCluster", - "service": { - "short_name": "Workstations", - "full_name": "google.cloud.workstations.v1beta.Workstations" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "workstations_v1beta_generated_Workstations_DeleteWorkstationCluster_sync", - "title": "Snippet for the delete_workstation_cluster call in the Workstations service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Workstations::V1beta::Workstations::Client#delete_workstation_cluster.", - "file": "workstations/delete_workstation_cluster.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_workstation_cluster", - "full_name": "::Google::Cloud::Workstations::V1beta::Workstations::Client#delete_workstation_cluster", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Workstations::V1beta::DeleteWorkstationClusterRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "Workstations::Client", - "full_name": "::Google::Cloud::Workstations::V1beta::Workstations::Client" - }, - "method": { - "short_name": "DeleteWorkstationCluster", - "full_name": "google.cloud.workstations.v1beta.Workstations.DeleteWorkstationCluster", - "service": { - "short_name": "Workstations", - "full_name": "google.cloud.workstations.v1beta.Workstations" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "workstations_v1beta_generated_Workstations_GetWorkstationConfig_sync", - "title": "Snippet for the get_workstation_config call in the Workstations service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Workstations::V1beta::Workstations::Client#get_workstation_config.", - "file": "workstations/get_workstation_config.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_workstation_config", - "full_name": "::Google::Cloud::Workstations::V1beta::Workstations::Client#get_workstation_config", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Workstations::V1beta::GetWorkstationConfigRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Workstations::V1beta::WorkstationConfig", - "client": { - "short_name": "Workstations::Client", - "full_name": "::Google::Cloud::Workstations::V1beta::Workstations::Client" - }, - "method": { - "short_name": "GetWorkstationConfig", - "full_name": "google.cloud.workstations.v1beta.Workstations.GetWorkstationConfig", - "service": { - "short_name": "Workstations", - "full_name": "google.cloud.workstations.v1beta.Workstations" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "workstations_v1beta_generated_Workstations_ListWorkstationConfigs_sync", - "title": "Snippet for the list_workstation_configs call in the Workstations service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Workstations::V1beta::Workstations::Client#list_workstation_configs.", - "file": "workstations/list_workstation_configs.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_workstation_configs", - "full_name": "::Google::Cloud::Workstations::V1beta::Workstations::Client#list_workstation_configs", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Workstations::V1beta::ListWorkstationConfigsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Workstations::V1beta::ListWorkstationConfigsResponse", - "client": { - "short_name": "Workstations::Client", - "full_name": "::Google::Cloud::Workstations::V1beta::Workstations::Client" - }, - "method": { - "short_name": "ListWorkstationConfigs", - "full_name": "google.cloud.workstations.v1beta.Workstations.ListWorkstationConfigs", - "service": { - "short_name": "Workstations", - "full_name": "google.cloud.workstations.v1beta.Workstations" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "workstations_v1beta_generated_Workstations_ListUsableWorkstationConfigs_sync", - "title": "Snippet for the list_usable_workstation_configs call in the Workstations service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Workstations::V1beta::Workstations::Client#list_usable_workstation_configs.", - "file": "workstations/list_usable_workstation_configs.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_usable_workstation_configs", - "full_name": "::Google::Cloud::Workstations::V1beta::Workstations::Client#list_usable_workstation_configs", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Workstations::V1beta::ListUsableWorkstationConfigsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Workstations::V1beta::ListUsableWorkstationConfigsResponse", - "client": { - "short_name": "Workstations::Client", - "full_name": "::Google::Cloud::Workstations::V1beta::Workstations::Client" - }, - "method": { - "short_name": "ListUsableWorkstationConfigs", - "full_name": "google.cloud.workstations.v1beta.Workstations.ListUsableWorkstationConfigs", - "service": { - "short_name": "Workstations", - "full_name": "google.cloud.workstations.v1beta.Workstations" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "workstations_v1beta_generated_Workstations_CreateWorkstationConfig_sync", - "title": "Snippet for the create_workstation_config call in the Workstations service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Workstations::V1beta::Workstations::Client#create_workstation_config.", - "file": "workstations/create_workstation_config.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_workstation_config", - "full_name": "::Google::Cloud::Workstations::V1beta::Workstations::Client#create_workstation_config", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Workstations::V1beta::CreateWorkstationConfigRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "Workstations::Client", - "full_name": "::Google::Cloud::Workstations::V1beta::Workstations::Client" - }, - "method": { - "short_name": "CreateWorkstationConfig", - "full_name": "google.cloud.workstations.v1beta.Workstations.CreateWorkstationConfig", - "service": { - "short_name": "Workstations", - "full_name": "google.cloud.workstations.v1beta.Workstations" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "workstations_v1beta_generated_Workstations_UpdateWorkstationConfig_sync", - "title": "Snippet for the update_workstation_config call in the Workstations service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Workstations::V1beta::Workstations::Client#update_workstation_config.", - "file": "workstations/update_workstation_config.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_workstation_config", - "full_name": "::Google::Cloud::Workstations::V1beta::Workstations::Client#update_workstation_config", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Workstations::V1beta::UpdateWorkstationConfigRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "Workstations::Client", - "full_name": "::Google::Cloud::Workstations::V1beta::Workstations::Client" - }, - "method": { - "short_name": "UpdateWorkstationConfig", - "full_name": "google.cloud.workstations.v1beta.Workstations.UpdateWorkstationConfig", - "service": { - "short_name": "Workstations", - "full_name": "google.cloud.workstations.v1beta.Workstations" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "workstations_v1beta_generated_Workstations_DeleteWorkstationConfig_sync", - "title": "Snippet for the delete_workstation_config call in the Workstations service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Workstations::V1beta::Workstations::Client#delete_workstation_config.", - "file": "workstations/delete_workstation_config.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_workstation_config", - "full_name": "::Google::Cloud::Workstations::V1beta::Workstations::Client#delete_workstation_config", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Workstations::V1beta::DeleteWorkstationConfigRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "Workstations::Client", - "full_name": "::Google::Cloud::Workstations::V1beta::Workstations::Client" - }, - "method": { - "short_name": "DeleteWorkstationConfig", - "full_name": "google.cloud.workstations.v1beta.Workstations.DeleteWorkstationConfig", - "service": { - "short_name": "Workstations", - "full_name": "google.cloud.workstations.v1beta.Workstations" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "workstations_v1beta_generated_Workstations_GetWorkstation_sync", - "title": "Snippet for the get_workstation call in the Workstations service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Workstations::V1beta::Workstations::Client#get_workstation.", - "file": "workstations/get_workstation.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_workstation", - "full_name": "::Google::Cloud::Workstations::V1beta::Workstations::Client#get_workstation", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Workstations::V1beta::GetWorkstationRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Workstations::V1beta::Workstation", - "client": { - "short_name": "Workstations::Client", - "full_name": "::Google::Cloud::Workstations::V1beta::Workstations::Client" - }, - "method": { - "short_name": "GetWorkstation", - "full_name": "google.cloud.workstations.v1beta.Workstations.GetWorkstation", - "service": { - "short_name": "Workstations", - "full_name": "google.cloud.workstations.v1beta.Workstations" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "workstations_v1beta_generated_Workstations_ListWorkstations_sync", - "title": "Snippet for the list_workstations call in the Workstations service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Workstations::V1beta::Workstations::Client#list_workstations.", - "file": "workstations/list_workstations.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_workstations", - "full_name": "::Google::Cloud::Workstations::V1beta::Workstations::Client#list_workstations", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Workstations::V1beta::ListWorkstationsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Workstations::V1beta::ListWorkstationsResponse", - "client": { - "short_name": "Workstations::Client", - "full_name": "::Google::Cloud::Workstations::V1beta::Workstations::Client" - }, - "method": { - "short_name": "ListWorkstations", - "full_name": "google.cloud.workstations.v1beta.Workstations.ListWorkstations", - "service": { - "short_name": "Workstations", - "full_name": "google.cloud.workstations.v1beta.Workstations" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "workstations_v1beta_generated_Workstations_ListUsableWorkstations_sync", - "title": "Snippet for the list_usable_workstations call in the Workstations service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Workstations::V1beta::Workstations::Client#list_usable_workstations.", - "file": "workstations/list_usable_workstations.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_usable_workstations", - "full_name": "::Google::Cloud::Workstations::V1beta::Workstations::Client#list_usable_workstations", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Workstations::V1beta::ListUsableWorkstationsRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Workstations::V1beta::ListUsableWorkstationsResponse", - "client": { - "short_name": "Workstations::Client", - "full_name": "::Google::Cloud::Workstations::V1beta::Workstations::Client" - }, - "method": { - "short_name": "ListUsableWorkstations", - "full_name": "google.cloud.workstations.v1beta.Workstations.ListUsableWorkstations", - "service": { - "short_name": "Workstations", - "full_name": "google.cloud.workstations.v1beta.Workstations" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "workstations_v1beta_generated_Workstations_CreateWorkstation_sync", - "title": "Snippet for the create_workstation call in the Workstations service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Workstations::V1beta::Workstations::Client#create_workstation.", - "file": "workstations/create_workstation.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_workstation", - "full_name": "::Google::Cloud::Workstations::V1beta::Workstations::Client#create_workstation", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Workstations::V1beta::CreateWorkstationRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "Workstations::Client", - "full_name": "::Google::Cloud::Workstations::V1beta::Workstations::Client" - }, - "method": { - "short_name": "CreateWorkstation", - "full_name": "google.cloud.workstations.v1beta.Workstations.CreateWorkstation", - "service": { - "short_name": "Workstations", - "full_name": "google.cloud.workstations.v1beta.Workstations" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "workstations_v1beta_generated_Workstations_UpdateWorkstation_sync", - "title": "Snippet for the update_workstation call in the Workstations service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Workstations::V1beta::Workstations::Client#update_workstation.", - "file": "workstations/update_workstation.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_workstation", - "full_name": "::Google::Cloud::Workstations::V1beta::Workstations::Client#update_workstation", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Workstations::V1beta::UpdateWorkstationRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "Workstations::Client", - "full_name": "::Google::Cloud::Workstations::V1beta::Workstations::Client" - }, - "method": { - "short_name": "UpdateWorkstation", - "full_name": "google.cloud.workstations.v1beta.Workstations.UpdateWorkstation", - "service": { - "short_name": "Workstations", - "full_name": "google.cloud.workstations.v1beta.Workstations" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "workstations_v1beta_generated_Workstations_DeleteWorkstation_sync", - "title": "Snippet for the delete_workstation call in the Workstations service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Workstations::V1beta::Workstations::Client#delete_workstation.", - "file": "workstations/delete_workstation.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_workstation", - "full_name": "::Google::Cloud::Workstations::V1beta::Workstations::Client#delete_workstation", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Workstations::V1beta::DeleteWorkstationRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "Workstations::Client", - "full_name": "::Google::Cloud::Workstations::V1beta::Workstations::Client" - }, - "method": { - "short_name": "DeleteWorkstation", - "full_name": "google.cloud.workstations.v1beta.Workstations.DeleteWorkstation", - "service": { - "short_name": "Workstations", - "full_name": "google.cloud.workstations.v1beta.Workstations" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "workstations_v1beta_generated_Workstations_StartWorkstation_sync", - "title": "Snippet for the start_workstation call in the Workstations service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Workstations::V1beta::Workstations::Client#start_workstation.", - "file": "workstations/start_workstation.rb", - "language": "RUBY", - "client_method": { - "short_name": "start_workstation", - "full_name": "::Google::Cloud::Workstations::V1beta::Workstations::Client#start_workstation", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Workstations::V1beta::StartWorkstationRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "Workstations::Client", - "full_name": "::Google::Cloud::Workstations::V1beta::Workstations::Client" - }, - "method": { - "short_name": "StartWorkstation", - "full_name": "google.cloud.workstations.v1beta.Workstations.StartWorkstation", - "service": { - "short_name": "Workstations", - "full_name": "google.cloud.workstations.v1beta.Workstations" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "workstations_v1beta_generated_Workstations_StopWorkstation_sync", - "title": "Snippet for the stop_workstation call in the Workstations service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Workstations::V1beta::Workstations::Client#stop_workstation.", - "file": "workstations/stop_workstation.rb", - "language": "RUBY", - "client_method": { - "short_name": "stop_workstation", - "full_name": "::Google::Cloud::Workstations::V1beta::Workstations::Client#stop_workstation", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Workstations::V1beta::StopWorkstationRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "Workstations::Client", - "full_name": "::Google::Cloud::Workstations::V1beta::Workstations::Client" - }, - "method": { - "short_name": "StopWorkstation", - "full_name": "google.cloud.workstations.v1beta.Workstations.StopWorkstation", - "service": { - "short_name": "Workstations", - "full_name": "google.cloud.workstations.v1beta.Workstations" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "workstations_v1beta_generated_Workstations_GenerateAccessToken_sync", - "title": "Snippet for the generate_access_token call in the Workstations service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Cloud::Workstations::V1beta::Workstations::Client#generate_access_token.", - "file": "workstations/generate_access_token.rb", - "language": "RUBY", - "client_method": { - "short_name": "generate_access_token", - "full_name": "::Google::Cloud::Workstations::V1beta::Workstations::Client#generate_access_token", - "async": false, - "parameters": [ - { - "type": "::Google::Cloud::Workstations::V1beta::GenerateAccessTokenRequest", - "name": "request" - } - ], - "result_type": "::Google::Cloud::Workstations::V1beta::GenerateAccessTokenResponse", - "client": { - "short_name": "Workstations::Client", - "full_name": "::Google::Cloud::Workstations::V1beta::Workstations::Client" - }, - "method": { - "short_name": "GenerateAccessToken", - "full_name": "google.cloud.workstations.v1beta.Workstations.GenerateAccessToken", - "service": { - "short_name": "Workstations", - "full_name": "google.cloud.workstations.v1beta.Workstations" - } - } - }, - "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-workstations-v1beta/snippets/workstations/create_workstation.rb b/owl-bot-staging/google-cloud-workstations-v1beta/snippets/workstations/create_workstation.rb deleted file mode 100644 index d693d2b46ae5..000000000000 --- a/owl-bot-staging/google-cloud-workstations-v1beta/snippets/workstations/create_workstation.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 workstations_v1beta_generated_Workstations_CreateWorkstation_sync] -require "google/cloud/workstations/v1beta" - -## -# Snippet for the create_workstation call in the Workstations 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::Workstations::V1beta::Workstations::Client#create_workstation. -# -def create_workstation - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Workstations::V1beta::Workstations::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Workstations::V1beta::CreateWorkstationRequest.new - - # Call the create_workstation method. - result = client.create_workstation 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 workstations_v1beta_generated_Workstations_CreateWorkstation_sync] diff --git a/owl-bot-staging/google-cloud-workstations-v1beta/snippets/workstations/create_workstation_cluster.rb b/owl-bot-staging/google-cloud-workstations-v1beta/snippets/workstations/create_workstation_cluster.rb deleted file mode 100644 index 87128b5c9ea7..000000000000 --- a/owl-bot-staging/google-cloud-workstations-v1beta/snippets/workstations/create_workstation_cluster.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 workstations_v1beta_generated_Workstations_CreateWorkstationCluster_sync] -require "google/cloud/workstations/v1beta" - -## -# Snippet for the create_workstation_cluster call in the Workstations 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::Workstations::V1beta::Workstations::Client#create_workstation_cluster. -# -def create_workstation_cluster - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Workstations::V1beta::Workstations::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Workstations::V1beta::CreateWorkstationClusterRequest.new - - # Call the create_workstation_cluster method. - result = client.create_workstation_cluster 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 workstations_v1beta_generated_Workstations_CreateWorkstationCluster_sync] diff --git a/owl-bot-staging/google-cloud-workstations-v1beta/snippets/workstations/create_workstation_config.rb b/owl-bot-staging/google-cloud-workstations-v1beta/snippets/workstations/create_workstation_config.rb deleted file mode 100644 index f2b1d8cd72ce..000000000000 --- a/owl-bot-staging/google-cloud-workstations-v1beta/snippets/workstations/create_workstation_config.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 workstations_v1beta_generated_Workstations_CreateWorkstationConfig_sync] -require "google/cloud/workstations/v1beta" - -## -# Snippet for the create_workstation_config call in the Workstations 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::Workstations::V1beta::Workstations::Client#create_workstation_config. -# -def create_workstation_config - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Workstations::V1beta::Workstations::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Workstations::V1beta::CreateWorkstationConfigRequest.new - - # Call the create_workstation_config method. - result = client.create_workstation_config 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 workstations_v1beta_generated_Workstations_CreateWorkstationConfig_sync] diff --git a/owl-bot-staging/google-cloud-workstations-v1beta/snippets/workstations/delete_workstation.rb b/owl-bot-staging/google-cloud-workstations-v1beta/snippets/workstations/delete_workstation.rb deleted file mode 100644 index 5077d7921393..000000000000 --- a/owl-bot-staging/google-cloud-workstations-v1beta/snippets/workstations/delete_workstation.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 workstations_v1beta_generated_Workstations_DeleteWorkstation_sync] -require "google/cloud/workstations/v1beta" - -## -# Snippet for the delete_workstation call in the Workstations 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::Workstations::V1beta::Workstations::Client#delete_workstation. -# -def delete_workstation - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Workstations::V1beta::Workstations::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Workstations::V1beta::DeleteWorkstationRequest.new - - # Call the delete_workstation method. - result = client.delete_workstation 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 workstations_v1beta_generated_Workstations_DeleteWorkstation_sync] diff --git a/owl-bot-staging/google-cloud-workstations-v1beta/snippets/workstations/delete_workstation_cluster.rb b/owl-bot-staging/google-cloud-workstations-v1beta/snippets/workstations/delete_workstation_cluster.rb deleted file mode 100644 index 102ab70aae42..000000000000 --- a/owl-bot-staging/google-cloud-workstations-v1beta/snippets/workstations/delete_workstation_cluster.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 workstations_v1beta_generated_Workstations_DeleteWorkstationCluster_sync] -require "google/cloud/workstations/v1beta" - -## -# Snippet for the delete_workstation_cluster call in the Workstations 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::Workstations::V1beta::Workstations::Client#delete_workstation_cluster. -# -def delete_workstation_cluster - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Workstations::V1beta::Workstations::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Workstations::V1beta::DeleteWorkstationClusterRequest.new - - # Call the delete_workstation_cluster method. - result = client.delete_workstation_cluster 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 workstations_v1beta_generated_Workstations_DeleteWorkstationCluster_sync] diff --git a/owl-bot-staging/google-cloud-workstations-v1beta/snippets/workstations/delete_workstation_config.rb b/owl-bot-staging/google-cloud-workstations-v1beta/snippets/workstations/delete_workstation_config.rb deleted file mode 100644 index 9ad29224664b..000000000000 --- a/owl-bot-staging/google-cloud-workstations-v1beta/snippets/workstations/delete_workstation_config.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 workstations_v1beta_generated_Workstations_DeleteWorkstationConfig_sync] -require "google/cloud/workstations/v1beta" - -## -# Snippet for the delete_workstation_config call in the Workstations 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::Workstations::V1beta::Workstations::Client#delete_workstation_config. -# -def delete_workstation_config - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Workstations::V1beta::Workstations::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Workstations::V1beta::DeleteWorkstationConfigRequest.new - - # Call the delete_workstation_config method. - result = client.delete_workstation_config 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 workstations_v1beta_generated_Workstations_DeleteWorkstationConfig_sync] diff --git a/owl-bot-staging/google-cloud-workstations-v1beta/snippets/workstations/generate_access_token.rb b/owl-bot-staging/google-cloud-workstations-v1beta/snippets/workstations/generate_access_token.rb deleted file mode 100644 index c810256cd2e2..000000000000 --- a/owl-bot-staging/google-cloud-workstations-v1beta/snippets/workstations/generate_access_token.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 workstations_v1beta_generated_Workstations_GenerateAccessToken_sync] -require "google/cloud/workstations/v1beta" - -## -# Snippet for the generate_access_token call in the Workstations 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::Workstations::V1beta::Workstations::Client#generate_access_token. -# -def generate_access_token - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Workstations::V1beta::Workstations::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Workstations::V1beta::GenerateAccessTokenRequest.new - - # Call the generate_access_token method. - result = client.generate_access_token request - - # The returned object is of type Google::Cloud::Workstations::V1beta::GenerateAccessTokenResponse. - p result -end -# [END workstations_v1beta_generated_Workstations_GenerateAccessToken_sync] diff --git a/owl-bot-staging/google-cloud-workstations-v1beta/snippets/workstations/get_workstation.rb b/owl-bot-staging/google-cloud-workstations-v1beta/snippets/workstations/get_workstation.rb deleted file mode 100644 index ed645c9c161d..000000000000 --- a/owl-bot-staging/google-cloud-workstations-v1beta/snippets/workstations/get_workstation.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 workstations_v1beta_generated_Workstations_GetWorkstation_sync] -require "google/cloud/workstations/v1beta" - -## -# Snippet for the get_workstation call in the Workstations 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::Workstations::V1beta::Workstations::Client#get_workstation. -# -def get_workstation - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Workstations::V1beta::Workstations::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Workstations::V1beta::GetWorkstationRequest.new - - # Call the get_workstation method. - result = client.get_workstation request - - # The returned object is of type Google::Cloud::Workstations::V1beta::Workstation. - p result -end -# [END workstations_v1beta_generated_Workstations_GetWorkstation_sync] diff --git a/owl-bot-staging/google-cloud-workstations-v1beta/snippets/workstations/get_workstation_cluster.rb b/owl-bot-staging/google-cloud-workstations-v1beta/snippets/workstations/get_workstation_cluster.rb deleted file mode 100644 index 665a6a0fe884..000000000000 --- a/owl-bot-staging/google-cloud-workstations-v1beta/snippets/workstations/get_workstation_cluster.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 workstations_v1beta_generated_Workstations_GetWorkstationCluster_sync] -require "google/cloud/workstations/v1beta" - -## -# Snippet for the get_workstation_cluster call in the Workstations 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::Workstations::V1beta::Workstations::Client#get_workstation_cluster. -# -def get_workstation_cluster - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Workstations::V1beta::Workstations::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Workstations::V1beta::GetWorkstationClusterRequest.new - - # Call the get_workstation_cluster method. - result = client.get_workstation_cluster request - - # The returned object is of type Google::Cloud::Workstations::V1beta::WorkstationCluster. - p result -end -# [END workstations_v1beta_generated_Workstations_GetWorkstationCluster_sync] diff --git a/owl-bot-staging/google-cloud-workstations-v1beta/snippets/workstations/get_workstation_config.rb b/owl-bot-staging/google-cloud-workstations-v1beta/snippets/workstations/get_workstation_config.rb deleted file mode 100644 index df2764fba5d2..000000000000 --- a/owl-bot-staging/google-cloud-workstations-v1beta/snippets/workstations/get_workstation_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 workstations_v1beta_generated_Workstations_GetWorkstationConfig_sync] -require "google/cloud/workstations/v1beta" - -## -# Snippet for the get_workstation_config call in the Workstations 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::Workstations::V1beta::Workstations::Client#get_workstation_config. -# -def get_workstation_config - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Workstations::V1beta::Workstations::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Workstations::V1beta::GetWorkstationConfigRequest.new - - # Call the get_workstation_config method. - result = client.get_workstation_config request - - # The returned object is of type Google::Cloud::Workstations::V1beta::WorkstationConfig. - p result -end -# [END workstations_v1beta_generated_Workstations_GetWorkstationConfig_sync] diff --git a/owl-bot-staging/google-cloud-workstations-v1beta/snippets/workstations/list_usable_workstation_configs.rb b/owl-bot-staging/google-cloud-workstations-v1beta/snippets/workstations/list_usable_workstation_configs.rb deleted file mode 100644 index 04c759f7d070..000000000000 --- a/owl-bot-staging/google-cloud-workstations-v1beta/snippets/workstations/list_usable_workstation_configs.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 workstations_v1beta_generated_Workstations_ListUsableWorkstationConfigs_sync] -require "google/cloud/workstations/v1beta" - -## -# Snippet for the list_usable_workstation_configs call in the Workstations 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::Workstations::V1beta::Workstations::Client#list_usable_workstation_configs. -# -def list_usable_workstation_configs - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Workstations::V1beta::Workstations::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Workstations::V1beta::ListUsableWorkstationConfigsRequest.new - - # Call the list_usable_workstation_configs method. - result = client.list_usable_workstation_configs 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::Workstations::V1beta::WorkstationConfig. - p item - end -end -# [END workstations_v1beta_generated_Workstations_ListUsableWorkstationConfigs_sync] diff --git a/owl-bot-staging/google-cloud-workstations-v1beta/snippets/workstations/list_usable_workstations.rb b/owl-bot-staging/google-cloud-workstations-v1beta/snippets/workstations/list_usable_workstations.rb deleted file mode 100644 index ac98db348987..000000000000 --- a/owl-bot-staging/google-cloud-workstations-v1beta/snippets/workstations/list_usable_workstations.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 workstations_v1beta_generated_Workstations_ListUsableWorkstations_sync] -require "google/cloud/workstations/v1beta" - -## -# Snippet for the list_usable_workstations call in the Workstations 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::Workstations::V1beta::Workstations::Client#list_usable_workstations. -# -def list_usable_workstations - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Workstations::V1beta::Workstations::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Workstations::V1beta::ListUsableWorkstationsRequest.new - - # Call the list_usable_workstations method. - result = client.list_usable_workstations 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::Workstations::V1beta::Workstation. - p item - end -end -# [END workstations_v1beta_generated_Workstations_ListUsableWorkstations_sync] diff --git a/owl-bot-staging/google-cloud-workstations-v1beta/snippets/workstations/list_workstation_clusters.rb b/owl-bot-staging/google-cloud-workstations-v1beta/snippets/workstations/list_workstation_clusters.rb deleted file mode 100644 index 339e219b560c..000000000000 --- a/owl-bot-staging/google-cloud-workstations-v1beta/snippets/workstations/list_workstation_clusters.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 workstations_v1beta_generated_Workstations_ListWorkstationClusters_sync] -require "google/cloud/workstations/v1beta" - -## -# Snippet for the list_workstation_clusters call in the Workstations 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::Workstations::V1beta::Workstations::Client#list_workstation_clusters. -# -def list_workstation_clusters - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Workstations::V1beta::Workstations::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Workstations::V1beta::ListWorkstationClustersRequest.new - - # Call the list_workstation_clusters method. - result = client.list_workstation_clusters 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::Workstations::V1beta::WorkstationCluster. - p item - end -end -# [END workstations_v1beta_generated_Workstations_ListWorkstationClusters_sync] diff --git a/owl-bot-staging/google-cloud-workstations-v1beta/snippets/workstations/list_workstation_configs.rb b/owl-bot-staging/google-cloud-workstations-v1beta/snippets/workstations/list_workstation_configs.rb deleted file mode 100644 index e048457320f7..000000000000 --- a/owl-bot-staging/google-cloud-workstations-v1beta/snippets/workstations/list_workstation_configs.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 workstations_v1beta_generated_Workstations_ListWorkstationConfigs_sync] -require "google/cloud/workstations/v1beta" - -## -# Snippet for the list_workstation_configs call in the Workstations 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::Workstations::V1beta::Workstations::Client#list_workstation_configs. -# -def list_workstation_configs - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Workstations::V1beta::Workstations::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Workstations::V1beta::ListWorkstationConfigsRequest.new - - # Call the list_workstation_configs method. - result = client.list_workstation_configs 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::Workstations::V1beta::WorkstationConfig. - p item - end -end -# [END workstations_v1beta_generated_Workstations_ListWorkstationConfigs_sync] diff --git a/owl-bot-staging/google-cloud-workstations-v1beta/snippets/workstations/list_workstations.rb b/owl-bot-staging/google-cloud-workstations-v1beta/snippets/workstations/list_workstations.rb deleted file mode 100644 index cdea490fd7b3..000000000000 --- a/owl-bot-staging/google-cloud-workstations-v1beta/snippets/workstations/list_workstations.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 workstations_v1beta_generated_Workstations_ListWorkstations_sync] -require "google/cloud/workstations/v1beta" - -## -# Snippet for the list_workstations call in the Workstations 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::Workstations::V1beta::Workstations::Client#list_workstations. -# -def list_workstations - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Workstations::V1beta::Workstations::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Workstations::V1beta::ListWorkstationsRequest.new - - # Call the list_workstations method. - result = client.list_workstations 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::Workstations::V1beta::Workstation. - p item - end -end -# [END workstations_v1beta_generated_Workstations_ListWorkstations_sync] diff --git a/owl-bot-staging/google-cloud-workstations-v1beta/snippets/workstations/start_workstation.rb b/owl-bot-staging/google-cloud-workstations-v1beta/snippets/workstations/start_workstation.rb deleted file mode 100644 index 4d0f92d6a22b..000000000000 --- a/owl-bot-staging/google-cloud-workstations-v1beta/snippets/workstations/start_workstation.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 workstations_v1beta_generated_Workstations_StartWorkstation_sync] -require "google/cloud/workstations/v1beta" - -## -# Snippet for the start_workstation call in the Workstations 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::Workstations::V1beta::Workstations::Client#start_workstation. -# -def start_workstation - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Workstations::V1beta::Workstations::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Workstations::V1beta::StartWorkstationRequest.new - - # Call the start_workstation method. - result = client.start_workstation 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 workstations_v1beta_generated_Workstations_StartWorkstation_sync] diff --git a/owl-bot-staging/google-cloud-workstations-v1beta/snippets/workstations/stop_workstation.rb b/owl-bot-staging/google-cloud-workstations-v1beta/snippets/workstations/stop_workstation.rb deleted file mode 100644 index 81426cbc8008..000000000000 --- a/owl-bot-staging/google-cloud-workstations-v1beta/snippets/workstations/stop_workstation.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 workstations_v1beta_generated_Workstations_StopWorkstation_sync] -require "google/cloud/workstations/v1beta" - -## -# Snippet for the stop_workstation call in the Workstations 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::Workstations::V1beta::Workstations::Client#stop_workstation. -# -def stop_workstation - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Workstations::V1beta::Workstations::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Workstations::V1beta::StopWorkstationRequest.new - - # Call the stop_workstation method. - result = client.stop_workstation 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 workstations_v1beta_generated_Workstations_StopWorkstation_sync] diff --git a/owl-bot-staging/google-cloud-workstations-v1beta/snippets/workstations/update_workstation.rb b/owl-bot-staging/google-cloud-workstations-v1beta/snippets/workstations/update_workstation.rb deleted file mode 100644 index 5f5722b2f007..000000000000 --- a/owl-bot-staging/google-cloud-workstations-v1beta/snippets/workstations/update_workstation.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 workstations_v1beta_generated_Workstations_UpdateWorkstation_sync] -require "google/cloud/workstations/v1beta" - -## -# Snippet for the update_workstation call in the Workstations 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::Workstations::V1beta::Workstations::Client#update_workstation. -# -def update_workstation - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Workstations::V1beta::Workstations::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Workstations::V1beta::UpdateWorkstationRequest.new - - # Call the update_workstation method. - result = client.update_workstation 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 workstations_v1beta_generated_Workstations_UpdateWorkstation_sync] diff --git a/owl-bot-staging/google-cloud-workstations-v1beta/snippets/workstations/update_workstation_cluster.rb b/owl-bot-staging/google-cloud-workstations-v1beta/snippets/workstations/update_workstation_cluster.rb deleted file mode 100644 index 9890ea125115..000000000000 --- a/owl-bot-staging/google-cloud-workstations-v1beta/snippets/workstations/update_workstation_cluster.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 workstations_v1beta_generated_Workstations_UpdateWorkstationCluster_sync] -require "google/cloud/workstations/v1beta" - -## -# Snippet for the update_workstation_cluster call in the Workstations 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::Workstations::V1beta::Workstations::Client#update_workstation_cluster. -# -def update_workstation_cluster - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Workstations::V1beta::Workstations::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Workstations::V1beta::UpdateWorkstationClusterRequest.new - - # Call the update_workstation_cluster method. - result = client.update_workstation_cluster 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 workstations_v1beta_generated_Workstations_UpdateWorkstationCluster_sync] diff --git a/owl-bot-staging/google-cloud-workstations-v1beta/snippets/workstations/update_workstation_config.rb b/owl-bot-staging/google-cloud-workstations-v1beta/snippets/workstations/update_workstation_config.rb deleted file mode 100644 index 659a518628ac..000000000000 --- a/owl-bot-staging/google-cloud-workstations-v1beta/snippets/workstations/update_workstation_config.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 workstations_v1beta_generated_Workstations_UpdateWorkstationConfig_sync] -require "google/cloud/workstations/v1beta" - -## -# Snippet for the update_workstation_config call in the Workstations 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::Workstations::V1beta::Workstations::Client#update_workstation_config. -# -def update_workstation_config - # Create a client object. The client can be reused for multiple calls. - client = Google::Cloud::Workstations::V1beta::Workstations::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Cloud::Workstations::V1beta::UpdateWorkstationConfigRequest.new - - # Call the update_workstation_config method. - result = client.update_workstation_config 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 workstations_v1beta_generated_Workstations_UpdateWorkstationConfig_sync] diff --git a/owl-bot-staging/google-cloud-workstations-v1beta/test/google/cloud/workstations/v1beta/workstations_operations_test.rb b/owl-bot-staging/google-cloud-workstations-v1beta/test/google/cloud/workstations/v1beta/workstations_operations_test.rb deleted file mode 100644 index 15f8d121ef95..000000000000 --- a/owl-bot-staging/google-cloud-workstations-v1beta/test/google/cloud/workstations/v1beta/workstations_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/workstations/v1beta/workstations_pb" -require "google/cloud/workstations/v1beta/workstations_services_pb" -require "google/cloud/workstations/v1beta/workstations" - -class ::Google::Cloud::Workstations::V1beta::Workstations::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::Workstations::V1beta::Workstations::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::Workstations::V1beta::Workstations::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::Workstations::V1beta::Workstations::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::Workstations::V1beta::Workstations::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::Workstations::V1beta::Workstations::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::Workstations::V1beta::Workstations::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::Workstations::V1beta::Workstations::Operations::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-workstations-v1beta/test/google/cloud/workstations/v1beta/workstations_paths_test.rb b/owl-bot-staging/google-cloud-workstations-v1beta/test/google/cloud/workstations/v1beta/workstations_paths_test.rb deleted file mode 100644 index b909911491fb..000000000000 --- a/owl-bot-staging/google-cloud-workstations-v1beta/test/google/cloud/workstations/v1beta/workstations_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/workstations/v1beta/workstations" - -class ::Google::Cloud::Workstations::V1beta::Workstations::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::Workstations::V1beta::Workstations::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_workstation_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Workstations::V1beta::Workstations::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.workstation_path project: "value0", location: "value1", workstation_cluster: "value2", workstation_config: "value3", workstation: "value4" - assert_equal "projects/value0/locations/value1/workstationClusters/value2/workstationConfigs/value3/workstations/value4", path - end - end - - def test_workstation_cluster_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Cloud::Workstations::V1beta::Workstations::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.workstation_cluster_path project: "value0", location: "value1", workstation_cluster: "value2" - assert_equal "projects/value0/locations/value1/workstationClusters/value2", path - end - end - - def test_workstation_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::Workstations::V1beta::Workstations::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.workstation_config_path project: "value0", location: "value1", workstation_cluster: "value2", workstation_config: "value3" - assert_equal "projects/value0/locations/value1/workstationClusters/value2/workstationConfigs/value3", path - end - end -end diff --git a/owl-bot-staging/google-cloud-workstations-v1beta/test/google/cloud/workstations/v1beta/workstations_rest_test.rb b/owl-bot-staging/google-cloud-workstations-v1beta/test/google/cloud/workstations/v1beta/workstations_rest_test.rb deleted file mode 100644 index 4700ae680eee..000000000000 --- a/owl-bot-staging/google-cloud-workstations-v1beta/test/google/cloud/workstations/v1beta/workstations_rest_test.rb +++ /dev/null @@ -1,1220 +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/workstations/v1beta/workstations_pb" -require "google/cloud/workstations/v1beta/workstations/rest" - - -class ::Google::Cloud::Workstations::V1beta::Workstations::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_get_workstation_cluster - # Create test objects. - client_result = ::Google::Cloud::Workstations::V1beta::WorkstationCluster.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_workstation_cluster_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::Workstations::V1beta::Workstations::Rest::ServiceStub.stub :transcode_get_workstation_cluster_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_workstation_cluster_client_stub do - # Create client - client = ::Google::Cloud::Workstations::V1beta::Workstations::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_workstation_cluster({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_workstation_cluster name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_workstation_cluster ::Google::Cloud::Workstations::V1beta::GetWorkstationClusterRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_workstation_cluster({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_workstation_cluster(::Google::Cloud::Workstations::V1beta::GetWorkstationClusterRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_workstation_cluster_client_stub.call_count - end - end - end - - def test_list_workstation_clusters - # Create test objects. - client_result = ::Google::Cloud::Workstations::V1beta::ListWorkstationClustersResponse.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_workstation_clusters_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::Workstations::V1beta::Workstations::Rest::ServiceStub.stub :transcode_list_workstation_clusters_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_workstation_clusters_client_stub do - # Create client - client = ::Google::Cloud::Workstations::V1beta::Workstations::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_workstation_clusters({ 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_workstation_clusters 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_workstation_clusters ::Google::Cloud::Workstations::V1beta::ListWorkstationClustersRequest.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_workstation_clusters({ 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_workstation_clusters(::Google::Cloud::Workstations::V1beta::ListWorkstationClustersRequest.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_workstation_clusters_client_stub.call_count - end - end - end - - def test_create_workstation_cluster - # 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" - workstation_cluster_id = "hello world" - workstation_cluster = {} - validate_only = true - - create_workstation_cluster_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::Workstations::V1beta::Workstations::Rest::ServiceStub.stub :transcode_create_workstation_cluster_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_workstation_cluster_client_stub do - # Create client - client = ::Google::Cloud::Workstations::V1beta::Workstations::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_workstation_cluster({ parent: parent, workstation_cluster_id: workstation_cluster_id, workstation_cluster: workstation_cluster, validate_only: validate_only }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_workstation_cluster parent: parent, workstation_cluster_id: workstation_cluster_id, workstation_cluster: workstation_cluster, validate_only: validate_only do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_workstation_cluster ::Google::Cloud::Workstations::V1beta::CreateWorkstationClusterRequest.new(parent: parent, workstation_cluster_id: workstation_cluster_id, workstation_cluster: workstation_cluster, validate_only: validate_only) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_workstation_cluster({ parent: parent, workstation_cluster_id: workstation_cluster_id, workstation_cluster: workstation_cluster, validate_only: validate_only }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_workstation_cluster(::Google::Cloud::Workstations::V1beta::CreateWorkstationClusterRequest.new(parent: parent, workstation_cluster_id: workstation_cluster_id, workstation_cluster: workstation_cluster, validate_only: validate_only), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_workstation_cluster_client_stub.call_count - end - end - end - - def test_update_workstation_cluster - # 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. - workstation_cluster = {} - update_mask = {} - validate_only = true - allow_missing = true - - update_workstation_cluster_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::Workstations::V1beta::Workstations::Rest::ServiceStub.stub :transcode_update_workstation_cluster_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_workstation_cluster_client_stub do - # Create client - client = ::Google::Cloud::Workstations::V1beta::Workstations::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.update_workstation_cluster({ workstation_cluster: workstation_cluster, update_mask: update_mask, validate_only: validate_only, allow_missing: allow_missing }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.update_workstation_cluster workstation_cluster: workstation_cluster, update_mask: update_mask, validate_only: validate_only, allow_missing: allow_missing do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.update_workstation_cluster ::Google::Cloud::Workstations::V1beta::UpdateWorkstationClusterRequest.new(workstation_cluster: workstation_cluster, update_mask: update_mask, validate_only: validate_only, allow_missing: allow_missing) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.update_workstation_cluster({ workstation_cluster: workstation_cluster, update_mask: update_mask, validate_only: validate_only, allow_missing: allow_missing }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.update_workstation_cluster(::Google::Cloud::Workstations::V1beta::UpdateWorkstationClusterRequest.new(workstation_cluster: workstation_cluster, update_mask: update_mask, validate_only: validate_only, allow_missing: allow_missing), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, update_workstation_cluster_client_stub.call_count - end - end - end - - def test_delete_workstation_cluster - # 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" - validate_only = true - etag = "hello world" - force = true - - delete_workstation_cluster_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::Workstations::V1beta::Workstations::Rest::ServiceStub.stub :transcode_delete_workstation_cluster_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_workstation_cluster_client_stub do - # Create client - client = ::Google::Cloud::Workstations::V1beta::Workstations::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.delete_workstation_cluster({ name: name, validate_only: validate_only, etag: etag, force: force }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.delete_workstation_cluster name: name, validate_only: validate_only, etag: etag, force: force do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.delete_workstation_cluster ::Google::Cloud::Workstations::V1beta::DeleteWorkstationClusterRequest.new(name: name, validate_only: validate_only, etag: etag, force: force) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.delete_workstation_cluster({ name: name, validate_only: validate_only, etag: etag, force: force }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.delete_workstation_cluster(::Google::Cloud::Workstations::V1beta::DeleteWorkstationClusterRequest.new(name: name, validate_only: validate_only, etag: etag, force: force), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, delete_workstation_cluster_client_stub.call_count - end - end - end - - def test_get_workstation_config - # Create test objects. - client_result = ::Google::Cloud::Workstations::V1beta::WorkstationConfig.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_workstation_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::Workstations::V1beta::Workstations::Rest::ServiceStub.stub :transcode_get_workstation_config_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_workstation_config_client_stub do - # Create client - client = ::Google::Cloud::Workstations::V1beta::Workstations::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_workstation_config({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_workstation_config name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_workstation_config ::Google::Cloud::Workstations::V1beta::GetWorkstationConfigRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_workstation_config({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_workstation_config(::Google::Cloud::Workstations::V1beta::GetWorkstationConfigRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_workstation_config_client_stub.call_count - end - end - end - - def test_list_workstation_configs - # Create test objects. - client_result = ::Google::Cloud::Workstations::V1beta::ListWorkstationConfigsResponse.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_workstation_configs_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::Workstations::V1beta::Workstations::Rest::ServiceStub.stub :transcode_list_workstation_configs_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_workstation_configs_client_stub do - # Create client - client = ::Google::Cloud::Workstations::V1beta::Workstations::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_workstation_configs({ 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_workstation_configs 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_workstation_configs ::Google::Cloud::Workstations::V1beta::ListWorkstationConfigsRequest.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_workstation_configs({ 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_workstation_configs(::Google::Cloud::Workstations::V1beta::ListWorkstationConfigsRequest.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_workstation_configs_client_stub.call_count - end - end - end - - def test_list_usable_workstation_configs - # Create test objects. - client_result = ::Google::Cloud::Workstations::V1beta::ListUsableWorkstationConfigsResponse.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_usable_workstation_configs_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::Workstations::V1beta::Workstations::Rest::ServiceStub.stub :transcode_list_usable_workstation_configs_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_usable_workstation_configs_client_stub do - # Create client - client = ::Google::Cloud::Workstations::V1beta::Workstations::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_usable_workstation_configs({ 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_usable_workstation_configs 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_usable_workstation_configs ::Google::Cloud::Workstations::V1beta::ListUsableWorkstationConfigsRequest.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_usable_workstation_configs({ 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_usable_workstation_configs(::Google::Cloud::Workstations::V1beta::ListUsableWorkstationConfigsRequest.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_usable_workstation_configs_client_stub.call_count - end - end - end - - def test_create_workstation_config - # 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" - workstation_config_id = "hello world" - workstation_config = {} - validate_only = true - - create_workstation_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::Workstations::V1beta::Workstations::Rest::ServiceStub.stub :transcode_create_workstation_config_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_workstation_config_client_stub do - # Create client - client = ::Google::Cloud::Workstations::V1beta::Workstations::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_workstation_config({ parent: parent, workstation_config_id: workstation_config_id, workstation_config: workstation_config, validate_only: validate_only }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_workstation_config parent: parent, workstation_config_id: workstation_config_id, workstation_config: workstation_config, validate_only: validate_only do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_workstation_config ::Google::Cloud::Workstations::V1beta::CreateWorkstationConfigRequest.new(parent: parent, workstation_config_id: workstation_config_id, workstation_config: workstation_config, validate_only: validate_only) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_workstation_config({ parent: parent, workstation_config_id: workstation_config_id, workstation_config: workstation_config, validate_only: validate_only }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_workstation_config(::Google::Cloud::Workstations::V1beta::CreateWorkstationConfigRequest.new(parent: parent, workstation_config_id: workstation_config_id, workstation_config: workstation_config, validate_only: validate_only), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_workstation_config_client_stub.call_count - end - end - end - - def test_update_workstation_config - # 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. - workstation_config = {} - update_mask = {} - validate_only = true - allow_missing = true - - update_workstation_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::Workstations::V1beta::Workstations::Rest::ServiceStub.stub :transcode_update_workstation_config_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_workstation_config_client_stub do - # Create client - client = ::Google::Cloud::Workstations::V1beta::Workstations::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.update_workstation_config({ workstation_config: workstation_config, update_mask: update_mask, validate_only: validate_only, allow_missing: allow_missing }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.update_workstation_config workstation_config: workstation_config, update_mask: update_mask, validate_only: validate_only, allow_missing: allow_missing do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.update_workstation_config ::Google::Cloud::Workstations::V1beta::UpdateWorkstationConfigRequest.new(workstation_config: workstation_config, update_mask: update_mask, validate_only: validate_only, allow_missing: allow_missing) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.update_workstation_config({ workstation_config: workstation_config, update_mask: update_mask, validate_only: validate_only, allow_missing: allow_missing }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.update_workstation_config(::Google::Cloud::Workstations::V1beta::UpdateWorkstationConfigRequest.new(workstation_config: workstation_config, update_mask: update_mask, validate_only: validate_only, allow_missing: allow_missing), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, update_workstation_config_client_stub.call_count - end - end - end - - def test_delete_workstation_config - # 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" - validate_only = true - etag = "hello world" - force = true - - delete_workstation_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::Workstations::V1beta::Workstations::Rest::ServiceStub.stub :transcode_delete_workstation_config_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_workstation_config_client_stub do - # Create client - client = ::Google::Cloud::Workstations::V1beta::Workstations::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.delete_workstation_config({ name: name, validate_only: validate_only, etag: etag, force: force }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.delete_workstation_config name: name, validate_only: validate_only, etag: etag, force: force do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.delete_workstation_config ::Google::Cloud::Workstations::V1beta::DeleteWorkstationConfigRequest.new(name: name, validate_only: validate_only, etag: etag, force: force) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.delete_workstation_config({ name: name, validate_only: validate_only, etag: etag, force: force }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.delete_workstation_config(::Google::Cloud::Workstations::V1beta::DeleteWorkstationConfigRequest.new(name: name, validate_only: validate_only, etag: etag, force: force), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, delete_workstation_config_client_stub.call_count - end - end - end - - def test_get_workstation - # Create test objects. - client_result = ::Google::Cloud::Workstations::V1beta::Workstation.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_workstation_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::Workstations::V1beta::Workstations::Rest::ServiceStub.stub :transcode_get_workstation_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_workstation_client_stub do - # Create client - client = ::Google::Cloud::Workstations::V1beta::Workstations::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_workstation({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_workstation name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_workstation ::Google::Cloud::Workstations::V1beta::GetWorkstationRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_workstation({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_workstation(::Google::Cloud::Workstations::V1beta::GetWorkstationRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_workstation_client_stub.call_count - end - end - end - - def test_list_workstations - # Create test objects. - client_result = ::Google::Cloud::Workstations::V1beta::ListWorkstationsResponse.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_workstations_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::Workstations::V1beta::Workstations::Rest::ServiceStub.stub :transcode_list_workstations_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_workstations_client_stub do - # Create client - client = ::Google::Cloud::Workstations::V1beta::Workstations::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_workstations({ 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_workstations 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_workstations ::Google::Cloud::Workstations::V1beta::ListWorkstationsRequest.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_workstations({ 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_workstations(::Google::Cloud::Workstations::V1beta::ListWorkstationsRequest.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_workstations_client_stub.call_count - end - end - end - - def test_list_usable_workstations - # Create test objects. - client_result = ::Google::Cloud::Workstations::V1beta::ListUsableWorkstationsResponse.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_usable_workstations_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::Workstations::V1beta::Workstations::Rest::ServiceStub.stub :transcode_list_usable_workstations_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_usable_workstations_client_stub do - # Create client - client = ::Google::Cloud::Workstations::V1beta::Workstations::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_usable_workstations({ 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_usable_workstations 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_usable_workstations ::Google::Cloud::Workstations::V1beta::ListUsableWorkstationsRequest.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_usable_workstations({ 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_usable_workstations(::Google::Cloud::Workstations::V1beta::ListUsableWorkstationsRequest.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_usable_workstations_client_stub.call_count - end - end - end - - def test_create_workstation - # 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" - workstation_id = "hello world" - workstation = {} - validate_only = true - - create_workstation_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::Workstations::V1beta::Workstations::Rest::ServiceStub.stub :transcode_create_workstation_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_workstation_client_stub do - # Create client - client = ::Google::Cloud::Workstations::V1beta::Workstations::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_workstation({ parent: parent, workstation_id: workstation_id, workstation: workstation, validate_only: validate_only }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_workstation parent: parent, workstation_id: workstation_id, workstation: workstation, validate_only: validate_only do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_workstation ::Google::Cloud::Workstations::V1beta::CreateWorkstationRequest.new(parent: parent, workstation_id: workstation_id, workstation: workstation, validate_only: validate_only) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_workstation({ parent: parent, workstation_id: workstation_id, workstation: workstation, validate_only: validate_only }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_workstation(::Google::Cloud::Workstations::V1beta::CreateWorkstationRequest.new(parent: parent, workstation_id: workstation_id, workstation: workstation, validate_only: validate_only), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_workstation_client_stub.call_count - end - end - end - - def test_update_workstation - # 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. - workstation = {} - update_mask = {} - validate_only = true - allow_missing = true - - update_workstation_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::Workstations::V1beta::Workstations::Rest::ServiceStub.stub :transcode_update_workstation_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_workstation_client_stub do - # Create client - client = ::Google::Cloud::Workstations::V1beta::Workstations::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.update_workstation({ workstation: workstation, update_mask: update_mask, validate_only: validate_only, allow_missing: allow_missing }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.update_workstation workstation: workstation, update_mask: update_mask, validate_only: validate_only, allow_missing: allow_missing do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.update_workstation ::Google::Cloud::Workstations::V1beta::UpdateWorkstationRequest.new(workstation: workstation, update_mask: update_mask, validate_only: validate_only, allow_missing: allow_missing) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.update_workstation({ workstation: workstation, update_mask: update_mask, validate_only: validate_only, allow_missing: allow_missing }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.update_workstation(::Google::Cloud::Workstations::V1beta::UpdateWorkstationRequest.new(workstation: workstation, update_mask: update_mask, validate_only: validate_only, allow_missing: allow_missing), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, update_workstation_client_stub.call_count - end - end - end - - def test_delete_workstation - # 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" - validate_only = true - etag = "hello world" - - delete_workstation_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::Workstations::V1beta::Workstations::Rest::ServiceStub.stub :transcode_delete_workstation_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_workstation_client_stub do - # Create client - client = ::Google::Cloud::Workstations::V1beta::Workstations::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.delete_workstation({ name: name, validate_only: validate_only, etag: etag }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.delete_workstation name: name, validate_only: validate_only, etag: etag do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.delete_workstation ::Google::Cloud::Workstations::V1beta::DeleteWorkstationRequest.new(name: name, validate_only: validate_only, etag: etag) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.delete_workstation({ name: name, validate_only: validate_only, etag: etag }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.delete_workstation(::Google::Cloud::Workstations::V1beta::DeleteWorkstationRequest.new(name: name, validate_only: validate_only, etag: etag), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, delete_workstation_client_stub.call_count - end - end - end - - def test_start_workstation - # 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" - validate_only = true - etag = "hello world" - - start_workstation_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::Workstations::V1beta::Workstations::Rest::ServiceStub.stub :transcode_start_workstation_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, start_workstation_client_stub do - # Create client - client = ::Google::Cloud::Workstations::V1beta::Workstations::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.start_workstation({ name: name, validate_only: validate_only, etag: etag }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.start_workstation name: name, validate_only: validate_only, etag: etag do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.start_workstation ::Google::Cloud::Workstations::V1beta::StartWorkstationRequest.new(name: name, validate_only: validate_only, etag: etag) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.start_workstation({ name: name, validate_only: validate_only, etag: etag }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.start_workstation(::Google::Cloud::Workstations::V1beta::StartWorkstationRequest.new(name: name, validate_only: validate_only, etag: etag), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, start_workstation_client_stub.call_count - end - end - end - - def test_stop_workstation - # 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" - validate_only = true - etag = "hello world" - - stop_workstation_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::Workstations::V1beta::Workstations::Rest::ServiceStub.stub :transcode_stop_workstation_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, stop_workstation_client_stub do - # Create client - client = ::Google::Cloud::Workstations::V1beta::Workstations::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.stop_workstation({ name: name, validate_only: validate_only, etag: etag }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.stop_workstation name: name, validate_only: validate_only, etag: etag do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.stop_workstation ::Google::Cloud::Workstations::V1beta::StopWorkstationRequest.new(name: name, validate_only: validate_only, etag: etag) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.stop_workstation({ name: name, validate_only: validate_only, etag: etag }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.stop_workstation(::Google::Cloud::Workstations::V1beta::StopWorkstationRequest.new(name: name, validate_only: validate_only, etag: etag), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, stop_workstation_client_stub.call_count - end - end - end - - def test_generate_access_token - # Create test objects. - client_result = ::Google::Cloud::Workstations::V1beta::GenerateAccessTokenResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - expire_time = {} - workstation = "hello world" - - generate_access_token_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::Workstations::V1beta::Workstations::Rest::ServiceStub.stub :transcode_generate_access_token_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, generate_access_token_client_stub do - # Create client - client = ::Google::Cloud::Workstations::V1beta::Workstations::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.generate_access_token({ expire_time: expire_time, workstation: workstation }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.generate_access_token expire_time: expire_time, workstation: workstation do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.generate_access_token ::Google::Cloud::Workstations::V1beta::GenerateAccessTokenRequest.new(expire_time: expire_time, workstation: workstation) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.generate_access_token({ expire_time: expire_time, workstation: workstation }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.generate_access_token(::Google::Cloud::Workstations::V1beta::GenerateAccessTokenRequest.new(expire_time: expire_time, workstation: workstation), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, generate_access_token_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::Workstations::V1beta::Workstations::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::Workstations::V1beta::Workstations::Rest::Client::Configuration, config - end -end diff --git a/owl-bot-staging/google-cloud-workstations-v1beta/test/google/cloud/workstations/v1beta/workstations_test.rb b/owl-bot-staging/google-cloud-workstations-v1beta/test/google/cloud/workstations/v1beta/workstations_test.rb deleted file mode 100644 index f211534d13c1..000000000000 --- a/owl-bot-staging/google-cloud-workstations-v1beta/test/google/cloud/workstations/v1beta/workstations_test.rb +++ /dev/null @@ -1,1441 +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/workstations/v1beta/workstations_pb" -require "google/cloud/workstations/v1beta/workstations" - -class ::Google::Cloud::Workstations::V1beta::Workstations::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_get_workstation_cluster - # Create GRPC objects. - grpc_response = ::Google::Cloud::Workstations::V1beta::WorkstationCluster.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_workstation_cluster_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_workstation_cluster, name - assert_kind_of ::Google::Cloud::Workstations::V1beta::GetWorkstationClusterRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_workstation_cluster_client_stub do - # Create client - client = ::Google::Cloud::Workstations::V1beta::Workstations::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_workstation_cluster({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_workstation_cluster name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_workstation_cluster ::Google::Cloud::Workstations::V1beta::GetWorkstationClusterRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_workstation_cluster({ 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_workstation_cluster(::Google::Cloud::Workstations::V1beta::GetWorkstationClusterRequest.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_workstation_cluster_client_stub.call_rpc_count - end - end - - def test_list_workstation_clusters - # Create GRPC objects. - grpc_response = ::Google::Cloud::Workstations::V1beta::ListWorkstationClustersResponse.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_workstation_clusters_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_workstation_clusters, name - assert_kind_of ::Google::Cloud::Workstations::V1beta::ListWorkstationClustersRequest, 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_workstation_clusters_client_stub do - # Create client - client = ::Google::Cloud::Workstations::V1beta::Workstations::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_workstation_clusters({ 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_workstation_clusters 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_workstation_clusters ::Google::Cloud::Workstations::V1beta::ListWorkstationClustersRequest.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_workstation_clusters({ 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_workstation_clusters(::Google::Cloud::Workstations::V1beta::ListWorkstationClustersRequest.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_workstation_clusters_client_stub.call_rpc_count - end - end - - def test_create_workstation_cluster - # 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" - workstation_cluster_id = "hello world" - workstation_cluster = {} - validate_only = true - - create_workstation_cluster_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_workstation_cluster, name - assert_kind_of ::Google::Cloud::Workstations::V1beta::CreateWorkstationClusterRequest, request - assert_equal "hello world", request["parent"] - assert_equal "hello world", request["workstation_cluster_id"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Workstations::V1beta::WorkstationCluster), request["workstation_cluster"] - assert_equal true, request["validate_only"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_workstation_cluster_client_stub do - # Create client - client = ::Google::Cloud::Workstations::V1beta::Workstations::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_workstation_cluster({ parent: parent, workstation_cluster_id: workstation_cluster_id, workstation_cluster: workstation_cluster, validate_only: validate_only }) 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_workstation_cluster parent: parent, workstation_cluster_id: workstation_cluster_id, workstation_cluster: workstation_cluster, validate_only: validate_only 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_workstation_cluster ::Google::Cloud::Workstations::V1beta::CreateWorkstationClusterRequest.new(parent: parent, workstation_cluster_id: workstation_cluster_id, workstation_cluster: workstation_cluster, validate_only: validate_only) 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_workstation_cluster({ parent: parent, workstation_cluster_id: workstation_cluster_id, workstation_cluster: workstation_cluster, validate_only: validate_only }, 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_workstation_cluster(::Google::Cloud::Workstations::V1beta::CreateWorkstationClusterRequest.new(parent: parent, workstation_cluster_id: workstation_cluster_id, workstation_cluster: workstation_cluster, validate_only: validate_only), 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_workstation_cluster_client_stub.call_rpc_count - end - end - - def test_update_workstation_cluster - # 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. - workstation_cluster = {} - update_mask = {} - validate_only = true - allow_missing = true - - update_workstation_cluster_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_workstation_cluster, name - assert_kind_of ::Google::Cloud::Workstations::V1beta::UpdateWorkstationClusterRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Workstations::V1beta::WorkstationCluster), request["workstation_cluster"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - assert_equal true, request["validate_only"] - assert_equal true, request["allow_missing"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_workstation_cluster_client_stub do - # Create client - client = ::Google::Cloud::Workstations::V1beta::Workstations::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_workstation_cluster({ workstation_cluster: workstation_cluster, update_mask: update_mask, validate_only: validate_only, allow_missing: allow_missing }) 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.update_workstation_cluster workstation_cluster: workstation_cluster, update_mask: update_mask, validate_only: validate_only, allow_missing: allow_missing 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.update_workstation_cluster ::Google::Cloud::Workstations::V1beta::UpdateWorkstationClusterRequest.new(workstation_cluster: workstation_cluster, update_mask: update_mask, validate_only: validate_only, allow_missing: allow_missing) 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.update_workstation_cluster({ workstation_cluster: workstation_cluster, update_mask: update_mask, validate_only: validate_only, allow_missing: allow_missing }, 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.update_workstation_cluster(::Google::Cloud::Workstations::V1beta::UpdateWorkstationClusterRequest.new(workstation_cluster: workstation_cluster, update_mask: update_mask, validate_only: validate_only, allow_missing: allow_missing), 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, update_workstation_cluster_client_stub.call_rpc_count - end - end - - def test_delete_workstation_cluster - # 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" - validate_only = true - etag = "hello world" - force = true - - delete_workstation_cluster_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_workstation_cluster, name - assert_kind_of ::Google::Cloud::Workstations::V1beta::DeleteWorkstationClusterRequest, request - assert_equal "hello world", request["name"] - assert_equal true, request["validate_only"] - assert_equal "hello world", request["etag"] - assert_equal true, request["force"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_workstation_cluster_client_stub do - # Create client - client = ::Google::Cloud::Workstations::V1beta::Workstations::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_workstation_cluster({ name: name, validate_only: validate_only, etag: etag, force: force }) 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_workstation_cluster name: name, validate_only: validate_only, etag: etag, force: force 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_workstation_cluster ::Google::Cloud::Workstations::V1beta::DeleteWorkstationClusterRequest.new(name: name, validate_only: validate_only, etag: etag, force: force) 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_workstation_cluster({ name: name, validate_only: validate_only, etag: etag, force: force }, 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_workstation_cluster(::Google::Cloud::Workstations::V1beta::DeleteWorkstationClusterRequest.new(name: name, validate_only: validate_only, etag: etag, force: force), 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_workstation_cluster_client_stub.call_rpc_count - end - end - - def test_get_workstation_config - # Create GRPC objects. - grpc_response = ::Google::Cloud::Workstations::V1beta::WorkstationConfig.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_workstation_config_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_workstation_config, name - assert_kind_of ::Google::Cloud::Workstations::V1beta::GetWorkstationConfigRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_workstation_config_client_stub do - # Create client - client = ::Google::Cloud::Workstations::V1beta::Workstations::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_workstation_config({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_workstation_config name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_workstation_config ::Google::Cloud::Workstations::V1beta::GetWorkstationConfigRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_workstation_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_workstation_config(::Google::Cloud::Workstations::V1beta::GetWorkstationConfigRequest.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_workstation_config_client_stub.call_rpc_count - end - end - - def test_list_workstation_configs - # Create GRPC objects. - grpc_response = ::Google::Cloud::Workstations::V1beta::ListWorkstationConfigsResponse.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_workstation_configs_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_workstation_configs, name - assert_kind_of ::Google::Cloud::Workstations::V1beta::ListWorkstationConfigsRequest, 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_workstation_configs_client_stub do - # Create client - client = ::Google::Cloud::Workstations::V1beta::Workstations::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_workstation_configs({ 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_workstation_configs 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_workstation_configs ::Google::Cloud::Workstations::V1beta::ListWorkstationConfigsRequest.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_workstation_configs({ 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_workstation_configs(::Google::Cloud::Workstations::V1beta::ListWorkstationConfigsRequest.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_workstation_configs_client_stub.call_rpc_count - end - end - - def test_list_usable_workstation_configs - # Create GRPC objects. - grpc_response = ::Google::Cloud::Workstations::V1beta::ListUsableWorkstationConfigsResponse.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_usable_workstation_configs_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_usable_workstation_configs, name - assert_kind_of ::Google::Cloud::Workstations::V1beta::ListUsableWorkstationConfigsRequest, 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_usable_workstation_configs_client_stub do - # Create client - client = ::Google::Cloud::Workstations::V1beta::Workstations::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_usable_workstation_configs({ 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_usable_workstation_configs 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_usable_workstation_configs ::Google::Cloud::Workstations::V1beta::ListUsableWorkstationConfigsRequest.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_usable_workstation_configs({ 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_usable_workstation_configs(::Google::Cloud::Workstations::V1beta::ListUsableWorkstationConfigsRequest.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_usable_workstation_configs_client_stub.call_rpc_count - end - end - - def test_create_workstation_config - # 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" - workstation_config_id = "hello world" - workstation_config = {} - validate_only = true - - create_workstation_config_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_workstation_config, name - assert_kind_of ::Google::Cloud::Workstations::V1beta::CreateWorkstationConfigRequest, request - assert_equal "hello world", request["parent"] - assert_equal "hello world", request["workstation_config_id"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Workstations::V1beta::WorkstationConfig), request["workstation_config"] - assert_equal true, request["validate_only"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_workstation_config_client_stub do - # Create client - client = ::Google::Cloud::Workstations::V1beta::Workstations::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_workstation_config({ parent: parent, workstation_config_id: workstation_config_id, workstation_config: workstation_config, validate_only: validate_only }) 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_workstation_config parent: parent, workstation_config_id: workstation_config_id, workstation_config: workstation_config, validate_only: validate_only 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_workstation_config ::Google::Cloud::Workstations::V1beta::CreateWorkstationConfigRequest.new(parent: parent, workstation_config_id: workstation_config_id, workstation_config: workstation_config, validate_only: validate_only) 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_workstation_config({ parent: parent, workstation_config_id: workstation_config_id, workstation_config: workstation_config, validate_only: validate_only }, 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_workstation_config(::Google::Cloud::Workstations::V1beta::CreateWorkstationConfigRequest.new(parent: parent, workstation_config_id: workstation_config_id, workstation_config: workstation_config, validate_only: validate_only), 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_workstation_config_client_stub.call_rpc_count - end - end - - def test_update_workstation_config - # 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. - workstation_config = {} - update_mask = {} - validate_only = true - allow_missing = true - - update_workstation_config_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_workstation_config, name - assert_kind_of ::Google::Cloud::Workstations::V1beta::UpdateWorkstationConfigRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Workstations::V1beta::WorkstationConfig), request["workstation_config"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - assert_equal true, request["validate_only"] - assert_equal true, request["allow_missing"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_workstation_config_client_stub do - # Create client - client = ::Google::Cloud::Workstations::V1beta::Workstations::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_workstation_config({ workstation_config: workstation_config, update_mask: update_mask, validate_only: validate_only, allow_missing: allow_missing }) 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.update_workstation_config workstation_config: workstation_config, update_mask: update_mask, validate_only: validate_only, allow_missing: allow_missing 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.update_workstation_config ::Google::Cloud::Workstations::V1beta::UpdateWorkstationConfigRequest.new(workstation_config: workstation_config, update_mask: update_mask, validate_only: validate_only, allow_missing: allow_missing) 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.update_workstation_config({ workstation_config: workstation_config, update_mask: update_mask, validate_only: validate_only, allow_missing: allow_missing }, 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.update_workstation_config(::Google::Cloud::Workstations::V1beta::UpdateWorkstationConfigRequest.new(workstation_config: workstation_config, update_mask: update_mask, validate_only: validate_only, allow_missing: allow_missing), 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, update_workstation_config_client_stub.call_rpc_count - end - end - - def test_delete_workstation_config - # 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" - validate_only = true - etag = "hello world" - force = true - - delete_workstation_config_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_workstation_config, name - assert_kind_of ::Google::Cloud::Workstations::V1beta::DeleteWorkstationConfigRequest, request - assert_equal "hello world", request["name"] - assert_equal true, request["validate_only"] - assert_equal "hello world", request["etag"] - assert_equal true, request["force"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_workstation_config_client_stub do - # Create client - client = ::Google::Cloud::Workstations::V1beta::Workstations::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_workstation_config({ name: name, validate_only: validate_only, etag: etag, force: force }) 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_workstation_config name: name, validate_only: validate_only, etag: etag, force: force 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_workstation_config ::Google::Cloud::Workstations::V1beta::DeleteWorkstationConfigRequest.new(name: name, validate_only: validate_only, etag: etag, force: force) 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_workstation_config({ name: name, validate_only: validate_only, etag: etag, force: force }, 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_workstation_config(::Google::Cloud::Workstations::V1beta::DeleteWorkstationConfigRequest.new(name: name, validate_only: validate_only, etag: etag, force: force), 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_workstation_config_client_stub.call_rpc_count - end - end - - def test_get_workstation - # Create GRPC objects. - grpc_response = ::Google::Cloud::Workstations::V1beta::Workstation.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_workstation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_workstation, name - assert_kind_of ::Google::Cloud::Workstations::V1beta::GetWorkstationRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_workstation_client_stub do - # Create client - client = ::Google::Cloud::Workstations::V1beta::Workstations::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_workstation({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_workstation name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_workstation ::Google::Cloud::Workstations::V1beta::GetWorkstationRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_workstation({ 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_workstation(::Google::Cloud::Workstations::V1beta::GetWorkstationRequest.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_workstation_client_stub.call_rpc_count - end - end - - def test_list_workstations - # Create GRPC objects. - grpc_response = ::Google::Cloud::Workstations::V1beta::ListWorkstationsResponse.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_workstations_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_workstations, name - assert_kind_of ::Google::Cloud::Workstations::V1beta::ListWorkstationsRequest, 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_workstations_client_stub do - # Create client - client = ::Google::Cloud::Workstations::V1beta::Workstations::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_workstations({ 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_workstations 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_workstations ::Google::Cloud::Workstations::V1beta::ListWorkstationsRequest.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_workstations({ 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_workstations(::Google::Cloud::Workstations::V1beta::ListWorkstationsRequest.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_workstations_client_stub.call_rpc_count - end - end - - def test_list_usable_workstations - # Create GRPC objects. - grpc_response = ::Google::Cloud::Workstations::V1beta::ListUsableWorkstationsResponse.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_usable_workstations_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_usable_workstations, name - assert_kind_of ::Google::Cloud::Workstations::V1beta::ListUsableWorkstationsRequest, 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_usable_workstations_client_stub do - # Create client - client = ::Google::Cloud::Workstations::V1beta::Workstations::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_usable_workstations({ 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_usable_workstations 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_usable_workstations ::Google::Cloud::Workstations::V1beta::ListUsableWorkstationsRequest.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_usable_workstations({ 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_usable_workstations(::Google::Cloud::Workstations::V1beta::ListUsableWorkstationsRequest.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_usable_workstations_client_stub.call_rpc_count - end - end - - def test_create_workstation - # 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" - workstation_id = "hello world" - workstation = {} - validate_only = true - - create_workstation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_workstation, name - assert_kind_of ::Google::Cloud::Workstations::V1beta::CreateWorkstationRequest, request - assert_equal "hello world", request["parent"] - assert_equal "hello world", request["workstation_id"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Workstations::V1beta::Workstation), request["workstation"] - assert_equal true, request["validate_only"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_workstation_client_stub do - # Create client - client = ::Google::Cloud::Workstations::V1beta::Workstations::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_workstation({ parent: parent, workstation_id: workstation_id, workstation: workstation, validate_only: validate_only }) 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_workstation parent: parent, workstation_id: workstation_id, workstation: workstation, validate_only: validate_only 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_workstation ::Google::Cloud::Workstations::V1beta::CreateWorkstationRequest.new(parent: parent, workstation_id: workstation_id, workstation: workstation, validate_only: validate_only) 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_workstation({ parent: parent, workstation_id: workstation_id, workstation: workstation, validate_only: validate_only }, 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_workstation(::Google::Cloud::Workstations::V1beta::CreateWorkstationRequest.new(parent: parent, workstation_id: workstation_id, workstation: workstation, validate_only: validate_only), 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_workstation_client_stub.call_rpc_count - end - end - - def test_update_workstation - # 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. - workstation = {} - update_mask = {} - validate_only = true - allow_missing = true - - update_workstation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_workstation, name - assert_kind_of ::Google::Cloud::Workstations::V1beta::UpdateWorkstationRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Cloud::Workstations::V1beta::Workstation), request["workstation"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - assert_equal true, request["validate_only"] - assert_equal true, request["allow_missing"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_workstation_client_stub do - # Create client - client = ::Google::Cloud::Workstations::V1beta::Workstations::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_workstation({ workstation: workstation, update_mask: update_mask, validate_only: validate_only, allow_missing: allow_missing }) 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.update_workstation workstation: workstation, update_mask: update_mask, validate_only: validate_only, allow_missing: allow_missing 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.update_workstation ::Google::Cloud::Workstations::V1beta::UpdateWorkstationRequest.new(workstation: workstation, update_mask: update_mask, validate_only: validate_only, allow_missing: allow_missing) 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.update_workstation({ workstation: workstation, update_mask: update_mask, validate_only: validate_only, allow_missing: allow_missing }, 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.update_workstation(::Google::Cloud::Workstations::V1beta::UpdateWorkstationRequest.new(workstation: workstation, update_mask: update_mask, validate_only: validate_only, allow_missing: allow_missing), 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, update_workstation_client_stub.call_rpc_count - end - end - - def test_delete_workstation - # 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" - validate_only = true - etag = "hello world" - - delete_workstation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_workstation, name - assert_kind_of ::Google::Cloud::Workstations::V1beta::DeleteWorkstationRequest, request - assert_equal "hello world", request["name"] - assert_equal true, request["validate_only"] - assert_equal "hello world", request["etag"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_workstation_client_stub do - # Create client - client = ::Google::Cloud::Workstations::V1beta::Workstations::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_workstation({ name: name, validate_only: validate_only, etag: etag }) 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_workstation name: name, validate_only: validate_only, etag: etag 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_workstation ::Google::Cloud::Workstations::V1beta::DeleteWorkstationRequest.new(name: name, validate_only: validate_only, etag: etag) 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_workstation({ name: name, validate_only: validate_only, etag: etag }, 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_workstation(::Google::Cloud::Workstations::V1beta::DeleteWorkstationRequest.new(name: name, validate_only: validate_only, etag: etag), 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_workstation_client_stub.call_rpc_count - end - end - - def test_start_workstation - # 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" - validate_only = true - etag = "hello world" - - start_workstation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :start_workstation, name - assert_kind_of ::Google::Cloud::Workstations::V1beta::StartWorkstationRequest, request - assert_equal "hello world", request["name"] - assert_equal true, request["validate_only"] - assert_equal "hello world", request["etag"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, start_workstation_client_stub do - # Create client - client = ::Google::Cloud::Workstations::V1beta::Workstations::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.start_workstation({ name: name, validate_only: validate_only, etag: etag }) 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.start_workstation name: name, validate_only: validate_only, etag: etag 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.start_workstation ::Google::Cloud::Workstations::V1beta::StartWorkstationRequest.new(name: name, validate_only: validate_only, etag: etag) 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.start_workstation({ name: name, validate_only: validate_only, etag: etag }, 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.start_workstation(::Google::Cloud::Workstations::V1beta::StartWorkstationRequest.new(name: name, validate_only: validate_only, etag: etag), 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, start_workstation_client_stub.call_rpc_count - end - end - - def test_stop_workstation - # 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" - validate_only = true - etag = "hello world" - - stop_workstation_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :stop_workstation, name - assert_kind_of ::Google::Cloud::Workstations::V1beta::StopWorkstationRequest, request - assert_equal "hello world", request["name"] - assert_equal true, request["validate_only"] - assert_equal "hello world", request["etag"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, stop_workstation_client_stub do - # Create client - client = ::Google::Cloud::Workstations::V1beta::Workstations::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.stop_workstation({ name: name, validate_only: validate_only, etag: etag }) 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.stop_workstation name: name, validate_only: validate_only, etag: etag 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.stop_workstation ::Google::Cloud::Workstations::V1beta::StopWorkstationRequest.new(name: name, validate_only: validate_only, etag: etag) 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.stop_workstation({ name: name, validate_only: validate_only, etag: etag }, 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.stop_workstation(::Google::Cloud::Workstations::V1beta::StopWorkstationRequest.new(name: name, validate_only: validate_only, etag: etag), 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, stop_workstation_client_stub.call_rpc_count - end - end - - def test_generate_access_token - # Create GRPC objects. - grpc_response = ::Google::Cloud::Workstations::V1beta::GenerateAccessTokenResponse.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. - expire_time = {} - workstation = "hello world" - - generate_access_token_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :generate_access_token, name - assert_kind_of ::Google::Cloud::Workstations::V1beta::GenerateAccessTokenRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Timestamp), request["expire_time"] - assert_equal :expire_time, request.expiration - assert_equal "hello world", request["workstation"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, generate_access_token_client_stub do - # Create client - client = ::Google::Cloud::Workstations::V1beta::Workstations::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.generate_access_token({ expire_time: expire_time, workstation: workstation }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.generate_access_token expire_time: expire_time, workstation: workstation do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.generate_access_token ::Google::Cloud::Workstations::V1beta::GenerateAccessTokenRequest.new(expire_time: expire_time, workstation: workstation) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.generate_access_token({ expire_time: expire_time, workstation: workstation }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.generate_access_token(::Google::Cloud::Workstations::V1beta::GenerateAccessTokenRequest.new(expire_time: expire_time, workstation: workstation), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, generate_access_token_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::Workstations::V1beta::Workstations::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::Workstations::V1beta::Workstations::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::Workstations::V1beta::Workstations::Client.new do |config| - config.credentials = creds - end - assert_kind_of ::Google::Cloud::Workstations::V1beta::Workstations::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::Workstations::V1beta::Workstations::Client.new do |config| - config.credentials = grpc_channel - end - end - - assert_kind_of ::Google::Cloud::Workstations::V1beta::Workstations::Operations, client.operations_client - end -end diff --git a/owl-bot-staging/google-cloud-workstations-v1beta/test/helper.rb b/owl-bot-staging/google-cloud-workstations-v1beta/test/helper.rb deleted file mode 100644 index 672b337030e7..000000000000 --- a/owl-bot-staging/google-cloud-workstations-v1beta/test/helper.rb +++ /dev/null @@ -1,26 +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/mock" -require "minitest/rg" - -require "grpc" - -require "ostruct" diff --git a/owl-bot-staging/google-iam-credentials-v1/.gitignore b/owl-bot-staging/google-iam-credentials-v1/.gitignore deleted file mode 100644 index 0135b6bc6cfc..000000000000 --- a/owl-bot-staging/google-iam-credentials-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-iam-credentials-v1/.repo-metadata.json b/owl-bot-staging/google-iam-credentials-v1/.repo-metadata.json deleted file mode 100644 index 63df137774ef..000000000000 --- a/owl-bot-staging/google-iam-credentials-v1/.repo-metadata.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "api_id": "iamcredentials.googleapis.com", - "api_shortname": "iamcredentials", - "client_documentation": "https://cloud.google.com/ruby/docs/reference/google-iam-credentials-v1/latest", - "distribution_name": "google-iam-credentials-v1", - "is_cloud": true, - "language": "ruby", - "name": "iamcredentials", - "name_pretty": "IAM Service Account Credentials V1 API", - "product_documentation": "https://cloud.google.com/iam", - "release_level": "unreleased", - "repo": "googleapis/google-cloud-ruby", - "requires_billing": true, - "ruby-cloud-description": "The Service Account Credentials API creates short-lived credentials for Identity and Access Management (IAM) service accounts. You can also use this API to sign JSON Web Tokens (JWTs), as well as blobs of binary data that contain other types of tokens. Note that google-iam-credentials-v1 is a version-specific client library. For most uses, we recommend installing the main client library google-iam-credentials instead. See the readme for more details.", - "ruby-cloud-env-prefix": "IAM_CREDENTIALS", - "ruby-cloud-product-url": "https://cloud.google.com/iam", - "library_type": "GAPIC_AUTO" -} diff --git a/owl-bot-staging/google-iam-credentials-v1/.rubocop.yml b/owl-bot-staging/google-iam-credentials-v1/.rubocop.yml deleted file mode 100644 index 9b2a231aba17..000000000000 --- a/owl-bot-staging/google-iam-credentials-v1/.rubocop.yml +++ /dev/null @@ -1,33 +0,0 @@ -inherit_gem: - google-style: google-style.yml - -AllCops: - Exclude: - - "google-iam-credentials-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-iam-credentials-v1.rb" diff --git a/owl-bot-staging/google-iam-credentials-v1/.toys.rb b/owl-bot-staging/google-iam-credentials-v1/.toys.rb deleted file mode 100644 index 177e22456e8a..000000000000 --- a/owl-bot-staging/google-iam-credentials-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-iam-credentials-v1/.yardopts b/owl-bot-staging/google-iam-credentials-v1/.yardopts deleted file mode 100644 index b52365dc43b4..000000000000 --- a/owl-bot-staging/google-iam-credentials-v1/.yardopts +++ /dev/null @@ -1,12 +0,0 @@ ---no-private ---title="IAM Service Account Credentials 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-iam-credentials-v1/AUTHENTICATION.md b/owl-bot-staging/google-iam-credentials-v1/AUTHENTICATION.md deleted file mode 100644 index 1d811fed1a80..000000000000 --- a/owl-bot-staging/google-iam-credentials-v1/AUTHENTICATION.md +++ /dev/null @@ -1,122 +0,0 @@ -# Authentication - -The recommended way to authenticate to the google-iam-credentials-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-iam-credentials-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/iam/credentials/v1" - -client = ::Google::Iam::Credentials::V1::IAMCredentials::Client.new do |config| - config.credentials = "path/to/credentialfile.json" -end -``` - -To configure a credentials file globally for all clients: - -```ruby -require "google/iam/credentials/v1" - -::Google::Iam::Credentials::V1::IAMCredentials::Client.configure do |config| - config.credentials = "path/to/credentialfile.json" -end - -client = ::Google::Iam::Credentials::V1::IAMCredentials::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-iam-credentials-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/iam/credentials/v1" - -ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" - -client = ::Google::Iam::Credentials::V1::IAMCredentials::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-iam-credentials-v1/CHANGELOG.md b/owl-bot-staging/google-iam-credentials-v1/CHANGELOG.md deleted file mode 100644 index f88957a62ba2..000000000000 --- a/owl-bot-staging/google-iam-credentials-v1/CHANGELOG.md +++ /dev/null @@ -1,2 +0,0 @@ -# Release History - diff --git a/owl-bot-staging/google-iam-credentials-v1/Gemfile b/owl-bot-staging/google-iam-credentials-v1/Gemfile deleted file mode 100644 index 1d08558908d8..000000000000 --- a/owl-bot-staging/google-iam-credentials-v1/Gemfile +++ /dev/null @@ -1,14 +0,0 @@ -source "https://rubygems.org" - -gemspec - -gem "google-style", "~> 1.32.0" -gem "irb", "~> 1.17" -gem "minitest", "~> 6.0.2" -gem "minitest-focus", "~> 1.4" -gem "minitest-mock", "~> 5.27" -gem "minitest-rg", "~> 5.3" -gem "ostruct", "~> 0.5.5" -gem "rake", ">= 13.0" -gem "redcarpet", "~> 3.6" -gem "yard", "~> 0.9" diff --git a/owl-bot-staging/google-iam-credentials-v1/LICENSE.md b/owl-bot-staging/google-iam-credentials-v1/LICENSE.md deleted file mode 100644 index c261857ba6ad..000000000000 --- a/owl-bot-staging/google-iam-credentials-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-iam-credentials-v1/README.md b/owl-bot-staging/google-iam-credentials-v1/README.md deleted file mode 100644 index 6e9c7e5f994f..000000000000 --- a/owl-bot-staging/google-iam-credentials-v1/README.md +++ /dev/null @@ -1,154 +0,0 @@ -# Ruby Client for the IAM Service Account Credentials V1 API - -Creates short-lived, limited-privilege credentials for IAM service accounts. - -The Service Account Credentials API creates short-lived credentials for Identity and Access Management (IAM) service accounts. You can also use this API to sign JSON Web Tokens (JWTs), as well as blobs of binary data that contain other types of tokens. - -https://github.com/googleapis/google-cloud-ruby - -This gem is a _versioned_ client. It provides basic client classes for a -specific version of the IAM Service Account Credentials V1 API. Most users should consider using -the main client gem, -[google-iam-credentials](https://rubygems.org/gems/google-iam-credentials). -See the section below titled *Which client should I use?* for more information. - -## Installation - -``` -$ gem install google-iam-credentials-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/iamcredentials.googleapis.com) -1. [Set up authentication.](AUTHENTICATION.md) - -## Quick Start - -```ruby -require "google/iam/credentials/v1" - -client = ::Google::Iam::Credentials::V1::IAMCredentials::Client.new -request = ::Google::Iam::Credentials::V1::GenerateAccessTokenRequest.new # (request fields as keyword arguments...) -response = client.generate_access_token request -``` - -View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-iam-credentials-v1/latest) -for class and method documentation. - -See also the [Product Documentation](https://cloud.google.com/iam) -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/iam/credentials/v1" -require "logger" - -client = ::Google::Iam::Credentials::V1::IAMCredentials::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-iam-credentials`, -and lower-level _versioned_ client libraries with names such as -`google-iam-credentials-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-iam-credentials`. -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-iam-credentials-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-iam-credentials-v1/Rakefile b/owl-bot-staging/google-iam-credentials-v1/Rakefile deleted file mode 100644 index d9311daefed7..000000000000 --- a/owl-bot-staging/google-iam-credentials-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-iam-credentials-v1 acceptance tests." -task :acceptance, :project, :keyfile do |t, args| - project = args[:project] - project ||= - ENV["IAM_CREDENTIALS_TEST_PROJECT"] || - ENV["GCLOUD_TEST_PROJECT"] - keyfile = args[:keyfile] - keyfile ||= - ENV["IAM_CREDENTIALS_TEST_KEYFILE"] || - ENV["GCLOUD_TEST_KEYFILE"] - if keyfile - keyfile = File.read keyfile - else - keyfile ||= - ENV["IAM_CREDENTIALS_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 IAM_CREDENTIALS_TEST_PROJECT=test123 IAM_CREDENTIALS_TEST_KEYFILE=/path/to/keyfile.json rake acceptance" - end - require "google/iam/credentials/v1/iam_credentials/credentials" - ::Google::Iam::Credentials::V1::IAMCredentials::Credentials.env_vars.each do |path| - ENV[path] = nil - end - ENV["IAM_CREDENTIALS_PROJECT"] = project - ENV["IAM_CREDENTIALS_TEST_PROJECT"] = project - ENV["IAM_CREDENTIALS_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-iam-credentials-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-iam-credentials-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-iam-credentials-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-iam-credentials-v1 gem does not have doctest tests." -end - -desc "Run the CI build" -task :ci do - header "BUILDING google-iam-credentials-v1" - header "google-iam-credentials-v1 rubocop", "*" - Rake::Task[:rubocop].invoke - header "google-iam-credentials-v1 yard", "*" - Rake::Task[:yard].invoke - header "google-iam-credentials-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-iam-credentials-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-iam-credentials-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-iam-credentials-v1/gapic_metadata.json b/owl-bot-staging/google-iam-credentials-v1/gapic_metadata.json deleted file mode 100644 index e3528a0323fe..000000000000 --- a/owl-bot-staging/google-iam-credentials-v1/gapic_metadata.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", - "language": "ruby", - "protoPackage": "google.iam.credentials.v1", - "libraryPackage": "::Google::Iam::Credentials::V1", - "services": { - "IAMCredentials": { - "clients": { - "grpc": { - "libraryClient": "::Google::Iam::Credentials::V1::IAMCredentials::Client", - "rpcs": { - "GenerateAccessToken": { - "methods": [ - "generate_access_token" - ] - }, - "GenerateIdToken": { - "methods": [ - "generate_id_token" - ] - }, - "SignBlob": { - "methods": [ - "sign_blob" - ] - }, - "SignJwt": { - "methods": [ - "sign_jwt" - ] - } - } - } - } - } - } -} diff --git a/owl-bot-staging/google-iam-credentials-v1/google-iam-credentials-v1.gemspec b/owl-bot-staging/google-iam-credentials-v1/google-iam-credentials-v1.gemspec deleted file mode 100644 index 545e30f7002b..000000000000 --- a/owl-bot-staging/google-iam-credentials-v1/google-iam-credentials-v1.gemspec +++ /dev/null @@ -1,28 +0,0 @@ -# -*- ruby -*- -# encoding: utf-8 - -require File.expand_path("lib/google/iam/credentials/v1/version", __dir__) - -Gem::Specification.new do |gem| - gem.name = "google-iam-credentials-v1" - gem.version = Google::Iam::Credentials::V1::VERSION - - gem.authors = ["Google LLC"] - gem.email = "googleapis-packages@google.com" - gem.description = "The Service Account Credentials API creates short-lived credentials for Identity and Access Management (IAM) service accounts. You can also use this API to sign JSON Web Tokens (JWTs), as well as blobs of binary data that contain other types of tokens. Note that google-iam-credentials-v1 is a version-specific client library. For most uses, we recommend installing the main client library google-iam-credentials instead. See the readme for more details." - gem.summary = "Creates short-lived, limited-privilege credentials for IAM service accounts." - 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.2" - - gem.add_dependency "gapic-common", "~> 1.2" - gem.add_dependency "google-cloud-errors", "~> 1.0" -end diff --git a/owl-bot-staging/google-iam-credentials-v1/lib/google-iam-credentials-v1.rb b/owl-bot-staging/google-iam-credentials-v1/lib/google-iam-credentials-v1.rb deleted file mode 100644 index ed2f7cb1dc33..000000000000 --- a/owl-bot-staging/google-iam-credentials-v1/lib/google-iam-credentials-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/iam/credentials/v1" diff --git a/owl-bot-staging/google-iam-credentials-v1/lib/google/iam/credentials/v1.rb b/owl-bot-staging/google-iam-credentials-v1/lib/google/iam/credentials/v1.rb deleted file mode 100644 index a614ad91054b..000000000000 --- a/owl-bot-staging/google-iam-credentials-v1/lib/google/iam/credentials/v1.rb +++ /dev/null @@ -1,45 +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/iam/credentials/v1/iam_credentials" -require "google/iam/credentials/v1/version" - -module Google - module Iam - module Credentials - ## - # API client module. - # - # @example Load this package, including all its services, and instantiate a gRPC client - # - # require "google/iam/credentials/v1" - # client = ::Google::Iam::Credentials::V1::IAMCredentials::Client.new - # - # @example Load this package, including all its services, and instantiate a REST client - # - # require "google/iam/credentials/v1" - # client = ::Google::Iam::Credentials::V1::IAMCredentials::Rest::Client.new - # - module V1 - end - end - end -end - -helper_path = ::File.join __dir__, "v1", "_helpers.rb" -require "google/iam/credentials/v1/_helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-iam-credentials-v1/lib/google/iam/credentials/v1/common_pb.rb b/owl-bot-staging/google-iam-credentials-v1/lib/google/iam/credentials/v1/common_pb.rb deleted file mode 100644 index e50c0aa546c8..000000000000 --- a/owl-bot-staging/google-iam-credentials-v1/lib/google/iam/credentials/v1/common_pb.rb +++ /dev/null @@ -1,33 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/iam/credentials/v1/common.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' - - -descriptor_data = "\n&google/iam/credentials/v1/common.proto\x12\x19google.iam.credentials.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xa9\x01\n\x1aGenerateAccessTokenRequest\x12\x37\n\x04name\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!iam.googleapis.com/ServiceAccount\x12\x11\n\tdelegates\x18\x02 \x03(\t\x12\x12\n\x05scope\x18\x04 \x03(\tB\x03\xe0\x41\x02\x12+\n\x08lifetime\x18\x07 \x01(\x0b\x32\x19.google.protobuf.Duration\"d\n\x1bGenerateAccessTokenResponse\x12\x14\n\x0c\x61\x63\x63\x65ss_token\x18\x01 \x01(\t\x12/\n\x0b\x65xpire_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"s\n\x0fSignBlobRequest\x12\x37\n\x04name\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!iam.googleapis.com/ServiceAccount\x12\x11\n\tdelegates\x18\x03 \x03(\t\x12\x14\n\x07payload\x18\x05 \x01(\x0c\x42\x03\xe0\x41\x02\"7\n\x10SignBlobResponse\x12\x0e\n\x06key_id\x18\x01 \x01(\t\x12\x13\n\x0bsigned_blob\x18\x04 \x01(\x0c\"r\n\x0eSignJwtRequest\x12\x37\n\x04name\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!iam.googleapis.com/ServiceAccount\x12\x11\n\tdelegates\x18\x03 \x03(\t\x12\x14\n\x07payload\x18\x05 \x01(\tB\x03\xe0\x41\x02\"5\n\x0fSignJwtResponse\x12\x0e\n\x06key_id\x18\x01 \x01(\t\x12\x12\n\nsigned_jwt\x18\x02 \x01(\t\"\x92\x01\n\x16GenerateIdTokenRequest\x12\x37\n\x04name\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!iam.googleapis.com/ServiceAccount\x12\x11\n\tdelegates\x18\x02 \x03(\t\x12\x15\n\x08\x61udience\x18\x03 \x01(\tB\x03\xe0\x41\x02\x12\x15\n\rinclude_email\x18\x04 \x01(\x08\"(\n\x17GenerateIdTokenResponse\x12\r\n\x05token\x18\x01 \x01(\tB\xac\x02\n#com.google.cloud.iam.credentials.v1B\x19IAMCredentialsCommonProtoP\x01ZEcloud.google.com/go/iam/credentials/apiv1/credentialspb;credentialspb\xf8\x01\x01\xaa\x02\x1fGoogle.Cloud.Iam.Credentials.V1\xca\x02\x1fGoogle\\Cloud\\Iam\\Credentials\\V1\xea\x41Y\n!iam.googleapis.com/ServiceAccount\x12\x34projects/{project}/serviceAccounts/{service_account}b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Iam - module Credentials - module V1 - GenerateAccessTokenRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.iam.credentials.v1.GenerateAccessTokenRequest").msgclass - GenerateAccessTokenResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.iam.credentials.v1.GenerateAccessTokenResponse").msgclass - SignBlobRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.iam.credentials.v1.SignBlobRequest").msgclass - SignBlobResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.iam.credentials.v1.SignBlobResponse").msgclass - SignJwtRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.iam.credentials.v1.SignJwtRequest").msgclass - SignJwtResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.iam.credentials.v1.SignJwtResponse").msgclass - GenerateIdTokenRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.iam.credentials.v1.GenerateIdTokenRequest").msgclass - GenerateIdTokenResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.iam.credentials.v1.GenerateIdTokenResponse").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-iam-credentials-v1/lib/google/iam/credentials/v1/iam_credentials.rb b/owl-bot-staging/google-iam-credentials-v1/lib/google/iam/credentials/v1/iam_credentials.rb deleted file mode 100644 index f97cbb3723e3..000000000000 --- a/owl-bot-staging/google-iam-credentials-v1/lib/google/iam/credentials/v1/iam_credentials.rb +++ /dev/null @@ -1,63 +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/iam/credentials/v1/version" - -require "google/iam/credentials/v1/iam_credentials/credentials" -require "google/iam/credentials/v1/iam_credentials/paths" -require "google/iam/credentials/v1/iam_credentials/client" -require "google/iam/credentials/v1/iam_credentials/rest" - -module Google - module Iam - module Credentials - module V1 - ## - # A service account is a special type of Google account that belongs to your - # application or a virtual machine (VM), instead of to an individual end user. - # Your application assumes the identity of the service account to call Google - # APIs, so that the users aren't directly involved. - # - # Service account credentials are used to temporarily assume the identity - # of the service account. Supported credential types include OAuth 2.0 access - # tokens, OpenID Connect ID tokens, self-signed JSON Web Tokens (JWTs), and - # more. - # - # @example Load this service and instantiate a gRPC client - # - # require "google/iam/credentials/v1/iam_credentials" - # client = ::Google::Iam::Credentials::V1::IAMCredentials::Client.new - # - # @example Load this service and instantiate a REST client - # - # require "google/iam/credentials/v1/iam_credentials/rest" - # client = ::Google::Iam::Credentials::V1::IAMCredentials::Rest::Client.new - # - module IAMCredentials - end - end - end - end -end - -helper_path = ::File.join __dir__, "iam_credentials", "helpers.rb" -require "google/iam/credentials/v1/iam_credentials/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-iam-credentials-v1/lib/google/iam/credentials/v1/iam_credentials/client.rb b/owl-bot-staging/google-iam-credentials-v1/lib/google/iam/credentials/v1/iam_credentials/client.rb deleted file mode 100644 index b1369925485c..000000000000 --- a/owl-bot-staging/google-iam-credentials-v1/lib/google/iam/credentials/v1/iam_credentials/client.rb +++ /dev/null @@ -1,854 +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/iam/credentials/v1/iamcredentials_pb" - -module Google - module Iam - module Credentials - module V1 - module IAMCredentials - ## - # Client for the IAMCredentials service. - # - # A service account is a special type of Google account that belongs to your - # application or a virtual machine (VM), instead of to an individual end user. - # Your application assumes the identity of the service account to call Google - # APIs, so that the users aren't directly involved. - # - # Service account credentials are used to temporarily assume the identity - # of the service account. Supported credential types include OAuth 2.0 access - # tokens, OpenID Connect ID tokens, self-signed JSON Web Tokens (JWTs), and - # more. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "iamcredentials.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :iam_credentials_stub - - ## - # Configure the IAMCredentials Client class. - # - # See {::Google::Iam::Credentials::V1::IAMCredentials::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all IAMCredentials clients - # ::Google::Iam::Credentials::V1::IAMCredentials::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", "Iam", "Credentials", "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.generate_access_token.timeout = 60.0 - default_config.rpcs.generate_access_token.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.generate_id_token.timeout = 60.0 - default_config.rpcs.generate_id_token.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.sign_blob.timeout = 60.0 - default_config.rpcs.sign_blob.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.sign_jwt.timeout = 60.0 - default_config.rpcs.sign_jwt.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 IAMCredentials 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::Iam::Credentials::V1::IAMCredentials::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 - @iam_credentials_stub.universe_domain - end - - ## - # Create a new IAMCredentials client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Iam::Credentials::V1::IAMCredentials::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Iam::Credentials::V1::IAMCredentials::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the IAMCredentials 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/iam/credentials/v1/iamcredentials_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 - - @iam_credentials_stub = ::Gapic::ServiceStub.new( - ::Google::Iam::Credentials::V1::IAMCredentials::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 - ) - - @iam_credentials_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 - end - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @iam_credentials_stub.logger - end - - # Service calls - - ## - # Generates an OAuth 2.0 access token for a service account. - # - # @overload generate_access_token(request, options = nil) - # Pass arguments to `generate_access_token` via a request object, either of type - # {::Google::Iam::Credentials::V1::GenerateAccessTokenRequest} or an equivalent Hash. - # - # @param request [::Google::Iam::Credentials::V1::GenerateAccessTokenRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_access_token(name: nil, delegates: nil, scope: nil, lifetime: nil) - # Pass arguments to `generate_access_token` via keyword arguments. Note that at - # least one keyword argument is 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 service account for which the credentials - # are requested, in the following format: - # `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`. The `-` wildcard - # character is required; replacing it with a project ID is invalid. - # @param delegates [::Array<::String>] - # The sequence of service accounts in a delegation chain. Each service - # account must be granted the `roles/iam.serviceAccountTokenCreator` role - # on its next service account in the chain. The last service account in the - # chain must be granted the `roles/iam.serviceAccountTokenCreator` role - # on the service account that is specified in the `name` field of the - # request. - # - # The delegates must have the following format: - # `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`. The `-` wildcard - # character is required; replacing it with a project ID is invalid. - # @param scope [::Array<::String>] - # Required. Code to identify the scopes to be included in the OAuth 2.0 access token. - # See https://developers.google.com/identity/protocols/googlescopes for more - # information. - # At least one value required. - # @param lifetime [::Google::Protobuf::Duration, ::Hash] - # The desired lifetime duration of the access token in seconds. - # Must be set to a value less than or equal to 3600 (1 hour). If a value is - # not specified, the token's lifetime will be set to a default value of one - # hour. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Iam::Credentials::V1::GenerateAccessTokenResponse] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Iam::Credentials::V1::GenerateAccessTokenResponse] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/iam/credentials/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Iam::Credentials::V1::IAMCredentials::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Iam::Credentials::V1::GenerateAccessTokenRequest.new - # - # # Call the generate_access_token method. - # result = client.generate_access_token request - # - # # The returned object is of type Google::Iam::Credentials::V1::GenerateAccessTokenResponse. - # p result - # - def generate_access_token request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::Credentials::V1::GenerateAccessTokenRequest - - # Converts hash 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_access_token.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::Iam::Credentials::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.generate_access_token.timeout, - metadata: metadata, - retry_policy: @config.rpcs.generate_access_token.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @iam_credentials_stub.call_rpc :generate_access_token, 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 - - ## - # Generates an OpenID Connect ID token for a service account. - # - # @overload generate_id_token(request, options = nil) - # Pass arguments to `generate_id_token` via a request object, either of type - # {::Google::Iam::Credentials::V1::GenerateIdTokenRequest} or an equivalent Hash. - # - # @param request [::Google::Iam::Credentials::V1::GenerateIdTokenRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_id_token(name: nil, delegates: nil, audience: nil, include_email: nil) - # Pass arguments to `generate_id_token` via keyword arguments. Note that at - # least one keyword argument is 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 service account for which the credentials - # are requested, in the following format: - # `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`. The `-` wildcard - # character is required; replacing it with a project ID is invalid. - # @param delegates [::Array<::String>] - # The sequence of service accounts in a delegation chain. Each service - # account must be granted the `roles/iam.serviceAccountTokenCreator` role - # on its next service account in the chain. The last service account in the - # chain must be granted the `roles/iam.serviceAccountTokenCreator` role - # on the service account that is specified in the `name` field of the - # request. - # - # The delegates must have the following format: - # `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`. The `-` wildcard - # character is required; replacing it with a project ID is invalid. - # @param audience [::String] - # Required. The audience for the token, such as the API or account that this token - # grants access to. - # @param include_email [::Boolean] - # Include the service account email in the token. If set to `true`, the - # token will contain `email` and `email_verified` claims. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Iam::Credentials::V1::GenerateIdTokenResponse] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Iam::Credentials::V1::GenerateIdTokenResponse] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/iam/credentials/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Iam::Credentials::V1::IAMCredentials::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Iam::Credentials::V1::GenerateIdTokenRequest.new - # - # # Call the generate_id_token method. - # result = client.generate_id_token request - # - # # The returned object is of type Google::Iam::Credentials::V1::GenerateIdTokenResponse. - # p result - # - def generate_id_token request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::Credentials::V1::GenerateIdTokenRequest - - # Converts hash 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_id_token.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::Iam::Credentials::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.generate_id_token.timeout, - metadata: metadata, - retry_policy: @config.rpcs.generate_id_token.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @iam_credentials_stub.call_rpc :generate_id_token, 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 a blob using a service account's system-managed private key. - # - # @overload sign_blob(request, options = nil) - # Pass arguments to `sign_blob` via a request object, either of type - # {::Google::Iam::Credentials::V1::SignBlobRequest} or an equivalent Hash. - # - # @param request [::Google::Iam::Credentials::V1::SignBlobRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload sign_blob(name: nil, delegates: nil, payload: nil) - # Pass arguments to `sign_blob` via keyword arguments. Note that at - # least one keyword argument is 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 service account for which the credentials - # are requested, in the following format: - # `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`. The `-` wildcard - # character is required; replacing it with a project ID is invalid. - # @param delegates [::Array<::String>] - # The sequence of service accounts in a delegation chain. Each service - # account must be granted the `roles/iam.serviceAccountTokenCreator` role - # on its next service account in the chain. The last service account in the - # chain must be granted the `roles/iam.serviceAccountTokenCreator` role - # on the service account that is specified in the `name` field of the - # request. - # - # The delegates must have the following format: - # `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`. The `-` wildcard - # character is required; replacing it with a project ID is invalid. - # @param payload [::String] - # Required. The bytes to sign. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Iam::Credentials::V1::SignBlobResponse] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Iam::Credentials::V1::SignBlobResponse] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/iam/credentials/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Iam::Credentials::V1::IAMCredentials::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Iam::Credentials::V1::SignBlobRequest.new - # - # # Call the sign_blob method. - # result = client.sign_blob request - # - # # The returned object is of type Google::Iam::Credentials::V1::SignBlobResponse. - # p result - # - def sign_blob request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::Credentials::V1::SignBlobRequest - - # Converts hash 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.sign_blob.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::Iam::Credentials::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.sign_blob.timeout, - metadata: metadata, - retry_policy: @config.rpcs.sign_blob.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @iam_credentials_stub.call_rpc :sign_blob, 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 a JWT using a service account's system-managed private key. - # - # @overload sign_jwt(request, options = nil) - # Pass arguments to `sign_jwt` via a request object, either of type - # {::Google::Iam::Credentials::V1::SignJwtRequest} or an equivalent Hash. - # - # @param request [::Google::Iam::Credentials::V1::SignJwtRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload sign_jwt(name: nil, delegates: nil, payload: nil) - # Pass arguments to `sign_jwt` via keyword arguments. Note that at - # least one keyword argument is 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 service account for which the credentials - # are requested, in the following format: - # `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`. The `-` wildcard - # character is required; replacing it with a project ID is invalid. - # @param delegates [::Array<::String>] - # The sequence of service accounts in a delegation chain. Each service - # account must be granted the `roles/iam.serviceAccountTokenCreator` role - # on its next service account in the chain. The last service account in the - # chain must be granted the `roles/iam.serviceAccountTokenCreator` role - # on the service account that is specified in the `name` field of the - # request. - # - # The delegates must have the following format: - # `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`. The `-` wildcard - # character is required; replacing it with a project ID is invalid. - # @param payload [::String] - # Required. The JWT payload to sign: a JSON object that contains a JWT Claims Set. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Iam::Credentials::V1::SignJwtResponse] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Iam::Credentials::V1::SignJwtResponse] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/iam/credentials/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Iam::Credentials::V1::IAMCredentials::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Iam::Credentials::V1::SignJwtRequest.new - # - # # Call the sign_jwt method. - # result = client.sign_jwt request - # - # # The returned object is of type Google::Iam::Credentials::V1::SignJwtResponse. - # p result - # - def sign_jwt request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::Credentials::V1::SignJwtRequest - - # Converts hash 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.sign_jwt.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::Iam::Credentials::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.sign_jwt.timeout, - metadata: metadata, - retry_policy: @config.rpcs.sign_jwt.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @iam_credentials_stub.call_rpc :sign_jwt, 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 IAMCredentials API. - # - # This class represents the configuration for IAMCredentials, - # 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::Iam::Credentials::V1::IAMCredentials::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 - # # generate_access_token to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Iam::Credentials::V1::IAMCredentials::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.generate_access_token.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Iam::Credentials::V1::IAMCredentials::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.generate_access_token.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::Iam::Credentials::V1::IAMCredentials::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 = "iamcredentials.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 IAMCredentials 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 `generate_access_token` - # @return [::Gapic::Config::Method] - # - attr_reader :generate_access_token - ## - # RPC-specific configuration for `generate_id_token` - # @return [::Gapic::Config::Method] - # - attr_reader :generate_id_token - ## - # RPC-specific configuration for `sign_blob` - # @return [::Gapic::Config::Method] - # - attr_reader :sign_blob - ## - # RPC-specific configuration for `sign_jwt` - # @return [::Gapic::Config::Method] - # - attr_reader :sign_jwt - - # @private - def initialize parent_rpcs = nil - generate_access_token_config = parent_rpcs.generate_access_token if parent_rpcs.respond_to? :generate_access_token - @generate_access_token = ::Gapic::Config::Method.new generate_access_token_config - generate_id_token_config = parent_rpcs.generate_id_token if parent_rpcs.respond_to? :generate_id_token - @generate_id_token = ::Gapic::Config::Method.new generate_id_token_config - sign_blob_config = parent_rpcs.sign_blob if parent_rpcs.respond_to? :sign_blob - @sign_blob = ::Gapic::Config::Method.new sign_blob_config - sign_jwt_config = parent_rpcs.sign_jwt if parent_rpcs.respond_to? :sign_jwt - @sign_jwt = ::Gapic::Config::Method.new sign_jwt_config - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-iam-credentials-v1/lib/google/iam/credentials/v1/iam_credentials/credentials.rb b/owl-bot-staging/google-iam-credentials-v1/lib/google/iam/credentials/v1/iam_credentials/credentials.rb deleted file mode 100644 index 7cb79642525d..000000000000 --- a/owl-bot-staging/google-iam-credentials-v1/lib/google/iam/credentials/v1/iam_credentials/credentials.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! - -require "googleauth" - -module Google - module Iam - module Credentials - module V1 - module IAMCredentials - # Credentials for the IAMCredentials API. - class Credentials < ::Google::Auth::Credentials - self.scope = [ - "https://www.googleapis.com/auth/cloud-platform" - ] - self.env_vars = [ - "IAM_CREDENTIALS_CREDENTIALS", - "IAM_CREDENTIALS_KEYFILE", - "GOOGLE_CLOUD_CREDENTIALS", - "GOOGLE_CLOUD_KEYFILE", - "GCLOUD_KEYFILE", - "IAM_CREDENTIALS_CREDENTIALS_JSON", - "IAM_CREDENTIALS_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-iam-credentials-v1/lib/google/iam/credentials/v1/iam_credentials/paths.rb b/owl-bot-staging/google-iam-credentials-v1/lib/google/iam/credentials/v1/iam_credentials/paths.rb deleted file mode 100644 index a57ff6ec11e5..000000000000 --- a/owl-bot-staging/google-iam-credentials-v1/lib/google/iam/credentials/v1/iam_credentials/paths.rb +++ /dev/null @@ -1,50 +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 Iam - module Credentials - module V1 - module IAMCredentials - # Path helper methods for the IAMCredentials API. - module Paths - ## - # Create a fully-qualified ServiceAccount resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/serviceAccounts/{service_account}` - # - # @param project [String] - # @param service_account [String] - # - # @return [::String] - def service_account_path project:, service_account: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - - "projects/#{project}/serviceAccounts/#{service_account}" - end - - extend self - end - end - end - end - end -end diff --git a/owl-bot-staging/google-iam-credentials-v1/lib/google/iam/credentials/v1/iam_credentials/rest.rb b/owl-bot-staging/google-iam-credentials-v1/lib/google/iam/credentials/v1/iam_credentials/rest.rb deleted file mode 100644 index 80ffb5c62a94..000000000000 --- a/owl-bot-staging/google-iam-credentials-v1/lib/google/iam/credentials/v1/iam_credentials/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/iam/credentials/v1/version" - -require "google/iam/credentials/v1/iam_credentials/credentials" -require "google/iam/credentials/v1/iam_credentials/paths" -require "google/iam/credentials/v1/iam_credentials/rest/client" - -module Google - module Iam - module Credentials - module V1 - ## - # A service account is a special type of Google account that belongs to your - # application or a virtual machine (VM), instead of to an individual end user. - # Your application assumes the identity of the service account to call Google - # APIs, so that the users aren't directly involved. - # - # Service account credentials are used to temporarily assume the identity - # of the service account. Supported credential types include OAuth 2.0 access - # tokens, OpenID Connect ID tokens, self-signed JSON Web Tokens (JWTs), and - # more. - # - # To load this service and instantiate a REST client: - # - # require "google/iam/credentials/v1/iam_credentials/rest" - # client = ::Google::Iam::Credentials::V1::IAMCredentials::Rest::Client.new - # - module IAMCredentials - # Client for the REST transport - module Rest - end - end - end - end - end -end - -helper_path = ::File.join __dir__, "rest", "helpers.rb" -require "google/iam/credentials/v1/iam_credentials/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-iam-credentials-v1/lib/google/iam/credentials/v1/iam_credentials/rest/client.rb b/owl-bot-staging/google-iam-credentials-v1/lib/google/iam/credentials/v1/iam_credentials/rest/client.rb deleted file mode 100644 index 9771a2dee4a6..000000000000 --- a/owl-bot-staging/google-iam-credentials-v1/lib/google/iam/credentials/v1/iam_credentials/rest/client.rb +++ /dev/null @@ -1,783 +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/iam/credentials/v1/iamcredentials_pb" -require "google/iam/credentials/v1/iam_credentials/rest/service_stub" - -module Google - module Iam - module Credentials - module V1 - module IAMCredentials - module Rest - ## - # REST client for the IAMCredentials service. - # - # A service account is a special type of Google account that belongs to your - # application or a virtual machine (VM), instead of to an individual end user. - # Your application assumes the identity of the service account to call Google - # APIs, so that the users aren't directly involved. - # - # Service account credentials are used to temporarily assume the identity - # of the service account. Supported credential types include OAuth 2.0 access - # tokens, OpenID Connect ID tokens, self-signed JSON Web Tokens (JWTs), and - # more. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "iamcredentials.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :iam_credentials_stub - - ## - # Configure the IAMCredentials Client class. - # - # See {::Google::Iam::Credentials::V1::IAMCredentials::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all IAMCredentials clients - # ::Google::Iam::Credentials::V1::IAMCredentials::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", "Iam", "Credentials", "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.generate_access_token.timeout = 60.0 - default_config.rpcs.generate_access_token.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.generate_id_token.timeout = 60.0 - default_config.rpcs.generate_id_token.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.sign_blob.timeout = 60.0 - default_config.rpcs.sign_blob.retry_policy = { - initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.sign_jwt.timeout = 60.0 - default_config.rpcs.sign_jwt.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 IAMCredentials 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::Iam::Credentials::V1::IAMCredentials::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 - @iam_credentials_stub.universe_domain - end - - ## - # Create a new IAMCredentials REST client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Iam::Credentials::V1::IAMCredentials::Rest::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Iam::Credentials::V1::IAMCredentials::Rest::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the IAMCredentials 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 - - @iam_credentials_stub = ::Google::Iam::Credentials::V1::IAMCredentials::Rest::ServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials, - logger: @config.logger - ) - - @iam_credentials_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 - end - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @iam_credentials_stub.logger - end - - # Service calls - - ## - # Generates an OAuth 2.0 access token for a service account. - # - # @overload generate_access_token(request, options = nil) - # Pass arguments to `generate_access_token` via a request object, either of type - # {::Google::Iam::Credentials::V1::GenerateAccessTokenRequest} or an equivalent Hash. - # - # @param request [::Google::Iam::Credentials::V1::GenerateAccessTokenRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_access_token(name: nil, delegates: nil, scope: nil, lifetime: nil) - # Pass arguments to `generate_access_token` via keyword arguments. Note that at - # least one keyword argument is 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 service account for which the credentials - # are requested, in the following format: - # `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`. The `-` wildcard - # character is required; replacing it with a project ID is invalid. - # @param delegates [::Array<::String>] - # The sequence of service accounts in a delegation chain. Each service - # account must be granted the `roles/iam.serviceAccountTokenCreator` role - # on its next service account in the chain. The last service account in the - # chain must be granted the `roles/iam.serviceAccountTokenCreator` role - # on the service account that is specified in the `name` field of the - # request. - # - # The delegates must have the following format: - # `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`. The `-` wildcard - # character is required; replacing it with a project ID is invalid. - # @param scope [::Array<::String>] - # Required. Code to identify the scopes to be included in the OAuth 2.0 access token. - # See https://developers.google.com/identity/protocols/googlescopes for more - # information. - # At least one value required. - # @param lifetime [::Google::Protobuf::Duration, ::Hash] - # The desired lifetime duration of the access token in seconds. - # Must be set to a value less than or equal to 3600 (1 hour). If a value is - # not specified, the token's lifetime will be set to a default value of one - # hour. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Iam::Credentials::V1::GenerateAccessTokenResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Iam::Credentials::V1::GenerateAccessTokenResponse] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/iam/credentials/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Iam::Credentials::V1::IAMCredentials::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Iam::Credentials::V1::GenerateAccessTokenRequest.new - # - # # Call the generate_access_token method. - # result = client.generate_access_token request - # - # # The returned object is of type Google::Iam::Credentials::V1::GenerateAccessTokenResponse. - # p result - # - def generate_access_token request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::Credentials::V1::GenerateAccessTokenRequest - - # Converts hash 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_access_token.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::Iam::Credentials::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_access_token.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.generate_access_token.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @iam_credentials_stub.generate_access_token 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 - - ## - # Generates an OpenID Connect ID token for a service account. - # - # @overload generate_id_token(request, options = nil) - # Pass arguments to `generate_id_token` via a request object, either of type - # {::Google::Iam::Credentials::V1::GenerateIdTokenRequest} or an equivalent Hash. - # - # @param request [::Google::Iam::Credentials::V1::GenerateIdTokenRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_id_token(name: nil, delegates: nil, audience: nil, include_email: nil) - # Pass arguments to `generate_id_token` via keyword arguments. Note that at - # least one keyword argument is 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 service account for which the credentials - # are requested, in the following format: - # `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`. The `-` wildcard - # character is required; replacing it with a project ID is invalid. - # @param delegates [::Array<::String>] - # The sequence of service accounts in a delegation chain. Each service - # account must be granted the `roles/iam.serviceAccountTokenCreator` role - # on its next service account in the chain. The last service account in the - # chain must be granted the `roles/iam.serviceAccountTokenCreator` role - # on the service account that is specified in the `name` field of the - # request. - # - # The delegates must have the following format: - # `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`. The `-` wildcard - # character is required; replacing it with a project ID is invalid. - # @param audience [::String] - # Required. The audience for the token, such as the API or account that this token - # grants access to. - # @param include_email [::Boolean] - # Include the service account email in the token. If set to `true`, the - # token will contain `email` and `email_verified` claims. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Iam::Credentials::V1::GenerateIdTokenResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Iam::Credentials::V1::GenerateIdTokenResponse] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/iam/credentials/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Iam::Credentials::V1::IAMCredentials::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Iam::Credentials::V1::GenerateIdTokenRequest.new - # - # # Call the generate_id_token method. - # result = client.generate_id_token request - # - # # The returned object is of type Google::Iam::Credentials::V1::GenerateIdTokenResponse. - # p result - # - def generate_id_token request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::Credentials::V1::GenerateIdTokenRequest - - # Converts hash 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_id_token.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::Iam::Credentials::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_id_token.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.generate_id_token.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @iam_credentials_stub.generate_id_token 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 a blob using a service account's system-managed private key. - # - # @overload sign_blob(request, options = nil) - # Pass arguments to `sign_blob` via a request object, either of type - # {::Google::Iam::Credentials::V1::SignBlobRequest} or an equivalent Hash. - # - # @param request [::Google::Iam::Credentials::V1::SignBlobRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload sign_blob(name: nil, delegates: nil, payload: nil) - # Pass arguments to `sign_blob` via keyword arguments. Note that at - # least one keyword argument is 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 service account for which the credentials - # are requested, in the following format: - # `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`. The `-` wildcard - # character is required; replacing it with a project ID is invalid. - # @param delegates [::Array<::String>] - # The sequence of service accounts in a delegation chain. Each service - # account must be granted the `roles/iam.serviceAccountTokenCreator` role - # on its next service account in the chain. The last service account in the - # chain must be granted the `roles/iam.serviceAccountTokenCreator` role - # on the service account that is specified in the `name` field of the - # request. - # - # The delegates must have the following format: - # `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`. The `-` wildcard - # character is required; replacing it with a project ID is invalid. - # @param payload [::String] - # Required. The bytes to sign. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Iam::Credentials::V1::SignBlobResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Iam::Credentials::V1::SignBlobResponse] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/iam/credentials/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Iam::Credentials::V1::IAMCredentials::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Iam::Credentials::V1::SignBlobRequest.new - # - # # Call the sign_blob method. - # result = client.sign_blob request - # - # # The returned object is of type Google::Iam::Credentials::V1::SignBlobResponse. - # p result - # - def sign_blob request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::Credentials::V1::SignBlobRequest - - # Converts hash 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.sign_blob.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::Iam::Credentials::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.sign_blob.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.sign_blob.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @iam_credentials_stub.sign_blob 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 a JWT using a service account's system-managed private key. - # - # @overload sign_jwt(request, options = nil) - # Pass arguments to `sign_jwt` via a request object, either of type - # {::Google::Iam::Credentials::V1::SignJwtRequest} or an equivalent Hash. - # - # @param request [::Google::Iam::Credentials::V1::SignJwtRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload sign_jwt(name: nil, delegates: nil, payload: nil) - # Pass arguments to `sign_jwt` via keyword arguments. Note that at - # least one keyword argument is 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 service account for which the credentials - # are requested, in the following format: - # `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`. The `-` wildcard - # character is required; replacing it with a project ID is invalid. - # @param delegates [::Array<::String>] - # The sequence of service accounts in a delegation chain. Each service - # account must be granted the `roles/iam.serviceAccountTokenCreator` role - # on its next service account in the chain. The last service account in the - # chain must be granted the `roles/iam.serviceAccountTokenCreator` role - # on the service account that is specified in the `name` field of the - # request. - # - # The delegates must have the following format: - # `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`. The `-` wildcard - # character is required; replacing it with a project ID is invalid. - # @param payload [::String] - # Required. The JWT payload to sign: a JSON object that contains a JWT Claims Set. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Iam::Credentials::V1::SignJwtResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Iam::Credentials::V1::SignJwtResponse] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/iam/credentials/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Iam::Credentials::V1::IAMCredentials::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Iam::Credentials::V1::SignJwtRequest.new - # - # # Call the sign_jwt method. - # result = client.sign_jwt request - # - # # The returned object is of type Google::Iam::Credentials::V1::SignJwtResponse. - # p result - # - def sign_jwt request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::Credentials::V1::SignJwtRequest - - # Converts hash 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.sign_jwt.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::Iam::Credentials::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.sign_jwt.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.sign_jwt.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @iam_credentials_stub.sign_jwt 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 IAMCredentials REST API. - # - # This class represents the configuration for IAMCredentials 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::Iam::Credentials::V1::IAMCredentials::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 - # # generate_access_token to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Iam::Credentials::V1::IAMCredentials::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.generate_access_token.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Iam::Credentials::V1::IAMCredentials::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.generate_access_token.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 = "iamcredentials.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 IAMCredentials 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 `generate_access_token` - # @return [::Gapic::Config::Method] - # - attr_reader :generate_access_token - ## - # RPC-specific configuration for `generate_id_token` - # @return [::Gapic::Config::Method] - # - attr_reader :generate_id_token - ## - # RPC-specific configuration for `sign_blob` - # @return [::Gapic::Config::Method] - # - attr_reader :sign_blob - ## - # RPC-specific configuration for `sign_jwt` - # @return [::Gapic::Config::Method] - # - attr_reader :sign_jwt - - # @private - def initialize parent_rpcs = nil - generate_access_token_config = parent_rpcs.generate_access_token if parent_rpcs.respond_to? :generate_access_token - @generate_access_token = ::Gapic::Config::Method.new generate_access_token_config - generate_id_token_config = parent_rpcs.generate_id_token if parent_rpcs.respond_to? :generate_id_token - @generate_id_token = ::Gapic::Config::Method.new generate_id_token_config - sign_blob_config = parent_rpcs.sign_blob if parent_rpcs.respond_to? :sign_blob - @sign_blob = ::Gapic::Config::Method.new sign_blob_config - sign_jwt_config = parent_rpcs.sign_jwt if parent_rpcs.respond_to? :sign_jwt - @sign_jwt = ::Gapic::Config::Method.new sign_jwt_config - - yield self if block_given? - end - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-iam-credentials-v1/lib/google/iam/credentials/v1/iam_credentials/rest/service_stub.rb b/owl-bot-staging/google-iam-credentials-v1/lib/google/iam/credentials/v1/iam_credentials/rest/service_stub.rb deleted file mode 100644 index c6cfe4454df2..000000000000 --- a/owl-bot-staging/google-iam-credentials-v1/lib/google/iam/credentials/v1/iam_credentials/rest/service_stub.rb +++ /dev/null @@ -1,329 +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/iam/credentials/v1/iamcredentials_pb" - -module Google - module Iam - module Credentials - module V1 - module IAMCredentials - module Rest - ## - # REST service stub for the IAMCredentials 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 generate_access_token REST call - # - # @param request_pb [::Google::Iam::Credentials::V1::GenerateAccessTokenRequest] - # 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::Iam::Credentials::V1::GenerateAccessTokenResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Iam::Credentials::V1::GenerateAccessTokenResponse] - # A result object deserialized from the server's reply - def generate_access_token request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_generate_access_token_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_access_token", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Iam::Credentials::V1::GenerateAccessTokenResponse.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_id_token REST call - # - # @param request_pb [::Google::Iam::Credentials::V1::GenerateIdTokenRequest] - # 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::Iam::Credentials::V1::GenerateIdTokenResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Iam::Credentials::V1::GenerateIdTokenResponse] - # A result object deserialized from the server's reply - def generate_id_token request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_generate_id_token_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_id_token", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Iam::Credentials::V1::GenerateIdTokenResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the sign_blob REST call - # - # @param request_pb [::Google::Iam::Credentials::V1::SignBlobRequest] - # 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::Iam::Credentials::V1::SignBlobResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Iam::Credentials::V1::SignBlobResponse] - # A result object deserialized from the server's reply - def sign_blob request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_sign_blob_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: "sign_blob", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Iam::Credentials::V1::SignBlobResponse.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the sign_jwt REST call - # - # @param request_pb [::Google::Iam::Credentials::V1::SignJwtRequest] - # 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::Iam::Credentials::V1::SignJwtResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Iam::Credentials::V1::SignJwtResponse] - # A result object deserialized from the server's reply - def sign_jwt request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_sign_jwt_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: "sign_jwt", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Iam::Credentials::V1::SignJwtResponse.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 generate_access_token REST call - # - # @param request_pb [::Google::Iam::Credentials::V1::GenerateAccessTokenRequest] - # 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_access_token_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:generateAccessToken", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/serviceAccounts/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the generate_id_token REST call - # - # @param request_pb [::Google::Iam::Credentials::V1::GenerateIdTokenRequest] - # 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_id_token_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:generateIdToken", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/serviceAccounts/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the sign_blob REST call - # - # @param request_pb [::Google::Iam::Credentials::V1::SignBlobRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_sign_blob_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:signBlob", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/serviceAccounts/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the sign_jwt REST call - # - # @param request_pb [::Google::Iam::Credentials::V1::SignJwtRequest] - # A request object representing the call parameters. Required. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_sign_jwt_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{name}:signJwt", - body: "*", - matches: [ - ["name", %r{^projects/[^/]+/serviceAccounts/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-iam-credentials-v1/lib/google/iam/credentials/v1/iamcredentials_pb.rb b/owl-bot-staging/google-iam-credentials-v1/lib/google/iam/credentials/v1/iamcredentials_pb.rb deleted file mode 100644 index e27e78574f32..000000000000 --- a/owl-bot-staging/google-iam-credentials-v1/lib/google/iam/credentials/v1/iamcredentials_pb.rb +++ /dev/null @@ -1,24 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/iam/credentials/v1/iamcredentials.proto - -require 'google/protobuf' - -require 'google/api/annotations_pb' -require 'google/api/client_pb' -require 'google/iam/credentials/v1/common_pb' - - -descriptor_data = "\n.google/iam/credentials/v1/iamcredentials.proto\x12\x19google.iam.credentials.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a&google/iam/credentials/v1/common.proto2\xad\x07\n\x0eIAMCredentials\x12\xec\x01\n\x13GenerateAccessToken\x12\x35.google.iam.credentials.v1.GenerateAccessTokenRequest\x1a\x36.google.iam.credentials.v1.GenerateAccessTokenResponse\"f\xda\x41\x1dname,delegates,scope,lifetime\x82\xd3\xe4\x93\x02@\";/v1/{name=projects/*/serviceAccounts/*}:generateAccessToken:\x01*\x12\xe4\x01\n\x0fGenerateIdToken\x12\x31.google.iam.credentials.v1.GenerateIdTokenRequest\x1a\x32.google.iam.credentials.v1.GenerateIdTokenResponse\"j\xda\x41%name,delegates,audience,include_email\x82\xd3\xe4\x93\x02<\"7/v1/{name=projects/*/serviceAccounts/*}:generateIdToken:\x01*\x12\xb9\x01\n\x08SignBlob\x12*.google.iam.credentials.v1.SignBlobRequest\x1a+.google.iam.credentials.v1.SignBlobResponse\"T\xda\x41\x16name,delegates,payload\x82\xd3\xe4\x93\x02\x35\"0/v1/{name=projects/*/serviceAccounts/*}:signBlob:\x01*\x12\xb5\x01\n\x07SignJwt\x12).google.iam.credentials.v1.SignJwtRequest\x1a*.google.iam.credentials.v1.SignJwtResponse\"S\xda\x41\x16name,delegates,payload\x82\xd3\xe4\x93\x02\x34\"//v1/{name=projects/*/serviceAccounts/*}:signJwt:\x01*\x1aQ\xca\x41\x1diamcredentials.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\xca\x01\n#com.google.cloud.iam.credentials.v1B\x13IAMCredentialsProtoP\x01ZEcloud.google.com/go/iam/credentials/apiv1/credentialspb;credentialspb\xf8\x01\x01\xaa\x02\x1fGoogle.Cloud.Iam.Credentials.V1\xca\x02\x1fGoogle\\Cloud\\Iam\\Credentials\\V1b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Iam - module Credentials - module V1 - end - end - end -end diff --git a/owl-bot-staging/google-iam-credentials-v1/lib/google/iam/credentials/v1/iamcredentials_services_pb.rb b/owl-bot-staging/google-iam-credentials-v1/lib/google/iam/credentials/v1/iamcredentials_services_pb.rb deleted file mode 100644 index a550a8f0fcfe..000000000000 --- a/owl-bot-staging/google-iam-credentials-v1/lib/google/iam/credentials/v1/iamcredentials_services_pb.rb +++ /dev/null @@ -1,59 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# Source: google/iam/credentials/v1/iamcredentials.proto for package 'google.iam.credentials.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/iam/credentials/v1/iamcredentials_pb' - -module Google - module Iam - module Credentials - module V1 - module IAMCredentials - # A service account is a special type of Google account that belongs to your - # application or a virtual machine (VM), instead of to an individual end user. - # Your application assumes the identity of the service account to call Google - # APIs, so that the users aren't directly involved. - # - # Service account credentials are used to temporarily assume the identity - # of the service account. Supported credential types include OAuth 2.0 access - # tokens, OpenID Connect ID tokens, self-signed JSON Web Tokens (JWTs), and - # more. - class Service - - include ::GRPC::GenericService - - self.marshal_class_method = :encode - self.unmarshal_class_method = :decode - self.service_name = 'google.iam.credentials.v1.IAMCredentials' - - # Generates an OAuth 2.0 access token for a service account. - rpc :GenerateAccessToken, ::Google::Iam::Credentials::V1::GenerateAccessTokenRequest, ::Google::Iam::Credentials::V1::GenerateAccessTokenResponse - # Generates an OpenID Connect ID token for a service account. - rpc :GenerateIdToken, ::Google::Iam::Credentials::V1::GenerateIdTokenRequest, ::Google::Iam::Credentials::V1::GenerateIdTokenResponse - # Signs a blob using a service account's system-managed private key. - rpc :SignBlob, ::Google::Iam::Credentials::V1::SignBlobRequest, ::Google::Iam::Credentials::V1::SignBlobResponse - # Signs a JWT using a service account's system-managed private key. - rpc :SignJwt, ::Google::Iam::Credentials::V1::SignJwtRequest, ::Google::Iam::Credentials::V1::SignJwtResponse - end - - Stub = Service.rpc_stub_class - end - end - end - end -end diff --git a/owl-bot-staging/google-iam-credentials-v1/lib/google/iam/credentials/v1/rest.rb b/owl-bot-staging/google-iam-credentials-v1/lib/google/iam/credentials/v1/rest.rb deleted file mode 100644 index 68ade197545e..000000000000 --- a/owl-bot-staging/google-iam-credentials-v1/lib/google/iam/credentials/v1/rest.rb +++ /dev/null @@ -1,37 +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/iam/credentials/v1/iam_credentials/rest" -require "google/iam/credentials/v1/version" - -module Google - module Iam - module Credentials - ## - # To load just the REST part of this package, including all its services, and instantiate a REST client: - # - # @example - # - # require "google/iam/credentials/v1/rest" - # client = ::Google::Iam::Credentials::V1::IAMCredentials::Rest::Client.new - # - module V1 - end - end - end -end diff --git a/owl-bot-staging/google-iam-credentials-v1/lib/google/iam/credentials/v1/version.rb b/owl-bot-staging/google-iam-credentials-v1/lib/google/iam/credentials/v1/version.rb deleted file mode 100644 index 8e69fe1e8479..000000000000 --- a/owl-bot-staging/google-iam-credentials-v1/lib/google/iam/credentials/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 Iam - module Credentials - module V1 - VERSION = "0.0.1" - end - end - end -end diff --git a/owl-bot-staging/google-iam-credentials-v1/proto_docs/README.md b/owl-bot-staging/google-iam-credentials-v1/proto_docs/README.md deleted file mode 100644 index b9037a182cf2..000000000000 --- a/owl-bot-staging/google-iam-credentials-v1/proto_docs/README.md +++ /dev/null @@ -1,4 +0,0 @@ -# IAM Service Account Credentials 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-iam-credentials-v1/proto_docs/google/api/client.rb b/owl-bot-staging/google-iam-credentials-v1/proto_docs/google/api/client.rb deleted file mode 100644 index 3ab0b096d445..000000000000 --- a/owl-bot-staging/google-iam-credentials-v1/proto_docs/google/api/client.rb +++ /dev/null @@ -1,593 +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. - # - # Note: This field should not be used in most cases. - 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: - # library_settings: - # 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. - # @!attribute [rw] library_package - # @return [::String] - # The package name to use in Php. Clobbers the php_namespace option - # set in the protobuf. This should be used **only** by APIs - # who have already set the language_settings.php.package_name" field - # in gapic.yaml. API teams should use the protobuf php_namespace option - # where possible. - # - # Example of a YAML configuration:: - # - # publishing: - # library_settings: - # php_settings: - # library_package: Google\Cloud\PubSub\V1 - 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. - # - # Example: - # - # 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 - # @!attribute [rw] batching - # @return [::Google::Api::BatchingConfigProto] - # Batching configuration for an API method in client libraries. - # - # Example of a YAML configuration: - # - # publishing: - # method_settings: - # - selector: google.example.v1.ExampleService.BatchCreateExample - # batching: - # element_count_threshold: 1000 - # request_byte_threshold: 100000000 - # delay_threshold_millis: 10 - 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. - # - # Note: This feature should not be used in most cases. - # @!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 - - # `BatchingConfigProto` defines the batching configuration for an API method. - # @!attribute [rw] thresholds - # @return [::Google::Api::BatchingSettingsProto] - # The thresholds which trigger a batched request to be sent. - # @!attribute [rw] batch_descriptor - # @return [::Google::Api::BatchingDescriptorProto] - # The request and response fields used in batching. - class BatchingConfigProto - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # `BatchingSettingsProto` specifies a set of batching thresholds, each of - # which acts as a trigger to send a batch of messages as a request. At least - # one threshold must be positive nonzero. - # @!attribute [rw] element_count_threshold - # @return [::Integer] - # The number of elements of a field collected into a batch which, if - # exceeded, causes the batch to be sent. - # @!attribute [rw] request_byte_threshold - # @return [::Integer] - # The aggregated size of the batched field which, if exceeded, causes the - # batch to be sent. This size is computed by aggregating the sizes of the - # request field to be batched, not of the entire request message. - # @!attribute [rw] delay_threshold - # @return [::Google::Protobuf::Duration] - # The duration after which a batch should be sent, starting from the addition - # of the first message to that batch. - # @!attribute [rw] element_count_limit - # @return [::Integer] - # The maximum number of elements collected in a batch that could be accepted - # by server. - # @!attribute [rw] request_byte_limit - # @return [::Integer] - # The maximum size of the request that could be accepted by server. - # @!attribute [rw] flow_control_element_limit - # @return [::Integer] - # The maximum number of elements allowed by flow control. - # @!attribute [rw] flow_control_byte_limit - # @return [::Integer] - # The maximum size of data allowed by flow control. - # @!attribute [rw] flow_control_limit_exceeded_behavior - # @return [::Google::Api::FlowControlLimitExceededBehaviorProto] - # The behavior to take when the flow control limit is exceeded. - class BatchingSettingsProto - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # `BatchingDescriptorProto` specifies the fields of the request message to be - # used for batching, and, optionally, the fields of the response message to be - # used for demultiplexing. - # @!attribute [rw] batched_field - # @return [::String] - # The repeated field in the request message to be aggregated by batching. - # @!attribute [rw] discriminator_fields - # @return [::Array<::String>] - # A list of the fields in the request message. Two requests will be batched - # together only if the values of every field specified in - # `request_discriminator_fields` is equal between the two requests. - # @!attribute [rw] subresponse_field - # @return [::String] - # Optional. When present, indicates the field in the response message to be - # used to demultiplex the response into multiple response messages, in - # correspondence with the multiple request messages originally batched - # together. - class BatchingDescriptorProto - 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 - - # The behavior to take when the flow control limit is exceeded. - module FlowControlLimitExceededBehaviorProto - # Default behavior, system-defined. - UNSET_BEHAVIOR = 0 - - # Stop operation, raise error. - THROW_EXCEPTION = 1 - - # Pause operation until limit clears. - BLOCK = 2 - - # Continue operation, disregard limit. - IGNORE = 3 - end - end -end diff --git a/owl-bot-staging/google-iam-credentials-v1/proto_docs/google/api/field_behavior.rb b/owl-bot-staging/google-iam-credentials-v1/proto_docs/google/api/field_behavior.rb deleted file mode 100644 index 582be187d115..000000000000 --- a/owl-bot-staging/google-iam-credentials-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-iam-credentials-v1/proto_docs/google/api/launch_stage.rb b/owl-bot-staging/google-iam-credentials-v1/proto_docs/google/api/launch_stage.rb deleted file mode 100644 index 9392a413fb1b..000000000000 --- a/owl-bot-staging/google-iam-credentials-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-iam-credentials-v1/proto_docs/google/api/resource.rb b/owl-bot-staging/google-iam-credentials-v1/proto_docs/google/api/resource.rb deleted file mode 100644 index 25dec4847ac1..000000000000 --- a/owl-bot-staging/google-iam-credentials-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-iam-credentials-v1/proto_docs/google/iam/credentials/v1/common.rb b/owl-bot-staging/google-iam-credentials-v1/proto_docs/google/iam/credentials/v1/common.rb deleted file mode 100644 index 87dc4a4ab1ff..000000000000 --- a/owl-bot-staging/google-iam-credentials-v1/proto_docs/google/iam/credentials/v1/common.rb +++ /dev/null @@ -1,186 +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 Iam - module Credentials - module V1 - # @!attribute [rw] name - # @return [::String] - # Required. The resource name of the service account for which the credentials - # are requested, in the following format: - # `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`. The `-` wildcard - # character is required; replacing it with a project ID is invalid. - # @!attribute [rw] delegates - # @return [::Array<::String>] - # The sequence of service accounts in a delegation chain. Each service - # account must be granted the `roles/iam.serviceAccountTokenCreator` role - # on its next service account in the chain. The last service account in the - # chain must be granted the `roles/iam.serviceAccountTokenCreator` role - # on the service account that is specified in the `name` field of the - # request. - # - # The delegates must have the following format: - # `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`. The `-` wildcard - # character is required; replacing it with a project ID is invalid. - # @!attribute [rw] scope - # @return [::Array<::String>] - # Required. Code to identify the scopes to be included in the OAuth 2.0 access token. - # See https://developers.google.com/identity/protocols/googlescopes for more - # information. - # At least one value required. - # @!attribute [rw] lifetime - # @return [::Google::Protobuf::Duration] - # The desired lifetime duration of the access token in seconds. - # Must be set to a value less than or equal to 3600 (1 hour). If a value is - # not specified, the token's lifetime will be set to a default value of one - # hour. - class GenerateAccessTokenRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # @!attribute [rw] access_token - # @return [::String] - # The OAuth 2.0 access token. - # @!attribute [rw] expire_time - # @return [::Google::Protobuf::Timestamp] - # Token expiration time. - # The expiration time is always set. - class GenerateAccessTokenResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # @!attribute [rw] name - # @return [::String] - # Required. The resource name of the service account for which the credentials - # are requested, in the following format: - # `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`. The `-` wildcard - # character is required; replacing it with a project ID is invalid. - # @!attribute [rw] delegates - # @return [::Array<::String>] - # The sequence of service accounts in a delegation chain. Each service - # account must be granted the `roles/iam.serviceAccountTokenCreator` role - # on its next service account in the chain. The last service account in the - # chain must be granted the `roles/iam.serviceAccountTokenCreator` role - # on the service account that is specified in the `name` field of the - # request. - # - # The delegates must have the following format: - # `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`. The `-` wildcard - # character is required; replacing it with a project ID is invalid. - # @!attribute [rw] payload - # @return [::String] - # Required. The bytes to sign. - class SignBlobRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # @!attribute [rw] key_id - # @return [::String] - # The ID of the key used to sign the blob. - # @!attribute [rw] signed_blob - # @return [::String] - # The signed blob. - class SignBlobResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # @!attribute [rw] name - # @return [::String] - # Required. The resource name of the service account for which the credentials - # are requested, in the following format: - # `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`. The `-` wildcard - # character is required; replacing it with a project ID is invalid. - # @!attribute [rw] delegates - # @return [::Array<::String>] - # The sequence of service accounts in a delegation chain. Each service - # account must be granted the `roles/iam.serviceAccountTokenCreator` role - # on its next service account in the chain. The last service account in the - # chain must be granted the `roles/iam.serviceAccountTokenCreator` role - # on the service account that is specified in the `name` field of the - # request. - # - # The delegates must have the following format: - # `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`. The `-` wildcard - # character is required; replacing it with a project ID is invalid. - # @!attribute [rw] payload - # @return [::String] - # Required. The JWT payload to sign: a JSON object that contains a JWT Claims Set. - class SignJwtRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # @!attribute [rw] key_id - # @return [::String] - # The ID of the key used to sign the JWT. - # @!attribute [rw] signed_jwt - # @return [::String] - # The signed JWT. - class SignJwtResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # @!attribute [rw] name - # @return [::String] - # Required. The resource name of the service account for which the credentials - # are requested, in the following format: - # `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`. The `-` wildcard - # character is required; replacing it with a project ID is invalid. - # @!attribute [rw] delegates - # @return [::Array<::String>] - # The sequence of service accounts in a delegation chain. Each service - # account must be granted the `roles/iam.serviceAccountTokenCreator` role - # on its next service account in the chain. The last service account in the - # chain must be granted the `roles/iam.serviceAccountTokenCreator` role - # on the service account that is specified in the `name` field of the - # request. - # - # The delegates must have the following format: - # `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`. The `-` wildcard - # character is required; replacing it with a project ID is invalid. - # @!attribute [rw] audience - # @return [::String] - # Required. The audience for the token, such as the API or account that this token - # grants access to. - # @!attribute [rw] include_email - # @return [::Boolean] - # Include the service account email in the token. If set to `true`, the - # token will contain `email` and `email_verified` claims. - class GenerateIdTokenRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # @!attribute [rw] token - # @return [::String] - # The OpenId Connect ID token. - class GenerateIdTokenResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end - end -end diff --git a/owl-bot-staging/google-iam-credentials-v1/proto_docs/google/protobuf/duration.rb b/owl-bot-staging/google-iam-credentials-v1/proto_docs/google/protobuf/duration.rb deleted file mode 100644 index ea59f1f91daf..000000000000 --- a/owl-bot-staging/google-iam-credentials-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-iam-credentials-v1/proto_docs/google/protobuf/timestamp.rb b/owl-bot-staging/google-iam-credentials-v1/proto_docs/google/protobuf/timestamp.rb deleted file mode 100644 index 74352be9c58c..000000000000 --- a/owl-bot-staging/google-iam-credentials-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-iam-credentials-v1/snippets/Gemfile b/owl-bot-staging/google-iam-credentials-v1/snippets/Gemfile deleted file mode 100644 index 68414f33ff49..000000000000 --- a/owl-bot-staging/google-iam-credentials-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-iam-credentials-v1", path: "../" -else - gem "google-iam-credentials-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-iam-credentials-v1/snippets/iam_credentials/generate_access_token.rb b/owl-bot-staging/google-iam-credentials-v1/snippets/iam_credentials/generate_access_token.rb deleted file mode 100644 index 9ba589bd6910..000000000000 --- a/owl-bot-staging/google-iam-credentials-v1/snippets/iam_credentials/generate_access_token.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 iamcredentials_v1_generated_IAMCredentials_GenerateAccessToken_sync] -require "google/iam/credentials/v1" - -## -# Snippet for the generate_access_token call in the IAMCredentials 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::Iam::Credentials::V1::IAMCredentials::Client#generate_access_token. -# -def generate_access_token - # Create a client object. The client can be reused for multiple calls. - client = Google::Iam::Credentials::V1::IAMCredentials::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Iam::Credentials::V1::GenerateAccessTokenRequest.new - - # Call the generate_access_token method. - result = client.generate_access_token request - - # The returned object is of type Google::Iam::Credentials::V1::GenerateAccessTokenResponse. - p result -end -# [END iamcredentials_v1_generated_IAMCredentials_GenerateAccessToken_sync] diff --git a/owl-bot-staging/google-iam-credentials-v1/snippets/iam_credentials/generate_id_token.rb b/owl-bot-staging/google-iam-credentials-v1/snippets/iam_credentials/generate_id_token.rb deleted file mode 100644 index 4a1c3491483f..000000000000 --- a/owl-bot-staging/google-iam-credentials-v1/snippets/iam_credentials/generate_id_token.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 iamcredentials_v1_generated_IAMCredentials_GenerateIdToken_sync] -require "google/iam/credentials/v1" - -## -# Snippet for the generate_id_token call in the IAMCredentials 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::Iam::Credentials::V1::IAMCredentials::Client#generate_id_token. -# -def generate_id_token - # Create a client object. The client can be reused for multiple calls. - client = Google::Iam::Credentials::V1::IAMCredentials::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Iam::Credentials::V1::GenerateIdTokenRequest.new - - # Call the generate_id_token method. - result = client.generate_id_token request - - # The returned object is of type Google::Iam::Credentials::V1::GenerateIdTokenResponse. - p result -end -# [END iamcredentials_v1_generated_IAMCredentials_GenerateIdToken_sync] diff --git a/owl-bot-staging/google-iam-credentials-v1/snippets/iam_credentials/sign_blob.rb b/owl-bot-staging/google-iam-credentials-v1/snippets/iam_credentials/sign_blob.rb deleted file mode 100644 index 27272c74919b..000000000000 --- a/owl-bot-staging/google-iam-credentials-v1/snippets/iam_credentials/sign_blob.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 iamcredentials_v1_generated_IAMCredentials_SignBlob_sync] -require "google/iam/credentials/v1" - -## -# Snippet for the sign_blob call in the IAMCredentials 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::Iam::Credentials::V1::IAMCredentials::Client#sign_blob. -# -def sign_blob - # Create a client object. The client can be reused for multiple calls. - client = Google::Iam::Credentials::V1::IAMCredentials::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Iam::Credentials::V1::SignBlobRequest.new - - # Call the sign_blob method. - result = client.sign_blob request - - # The returned object is of type Google::Iam::Credentials::V1::SignBlobResponse. - p result -end -# [END iamcredentials_v1_generated_IAMCredentials_SignBlob_sync] diff --git a/owl-bot-staging/google-iam-credentials-v1/snippets/iam_credentials/sign_jwt.rb b/owl-bot-staging/google-iam-credentials-v1/snippets/iam_credentials/sign_jwt.rb deleted file mode 100644 index 806a57c1515f..000000000000 --- a/owl-bot-staging/google-iam-credentials-v1/snippets/iam_credentials/sign_jwt.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 iamcredentials_v1_generated_IAMCredentials_SignJwt_sync] -require "google/iam/credentials/v1" - -## -# Snippet for the sign_jwt call in the IAMCredentials 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::Iam::Credentials::V1::IAMCredentials::Client#sign_jwt. -# -def sign_jwt - # Create a client object. The client can be reused for multiple calls. - client = Google::Iam::Credentials::V1::IAMCredentials::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Iam::Credentials::V1::SignJwtRequest.new - - # Call the sign_jwt method. - result = client.sign_jwt request - - # The returned object is of type Google::Iam::Credentials::V1::SignJwtResponse. - p result -end -# [END iamcredentials_v1_generated_IAMCredentials_SignJwt_sync] diff --git a/owl-bot-staging/google-iam-credentials-v1/snippets/snippet_metadata_google.iam.credentials.v1.json b/owl-bot-staging/google-iam-credentials-v1/snippets/snippet_metadata_google.iam.credentials.v1.json deleted file mode 100644 index 6ca1e368089a..000000000000 --- a/owl-bot-staging/google-iam-credentials-v1/snippets/snippet_metadata_google.iam.credentials.v1.json +++ /dev/null @@ -1,175 +0,0 @@ -{ - "client_library": { - "name": "google-iam-credentials-v1", - "version": "", - "language": "RUBY", - "apis": [ - { - "id": "google.iam.credentials.v1", - "version": "v1" - } - ] - }, - "snippets": [ - { - "region_tag": "iamcredentials_v1_generated_IAMCredentials_GenerateAccessToken_sync", - "title": "Snippet for the generate_access_token call in the IAMCredentials service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Iam::Credentials::V1::IAMCredentials::Client#generate_access_token.", - "file": "iam_credentials/generate_access_token.rb", - "language": "RUBY", - "client_method": { - "short_name": "generate_access_token", - "full_name": "::Google::Iam::Credentials::V1::IAMCredentials::Client#generate_access_token", - "async": false, - "parameters": [ - { - "type": "::Google::Iam::Credentials::V1::GenerateAccessTokenRequest", - "name": "request" - } - ], - "result_type": "::Google::Iam::Credentials::V1::GenerateAccessTokenResponse", - "client": { - "short_name": "IAMCredentials::Client", - "full_name": "::Google::Iam::Credentials::V1::IAMCredentials::Client" - }, - "method": { - "short_name": "GenerateAccessToken", - "full_name": "google.iam.credentials.v1.IAMCredentials.GenerateAccessToken", - "service": { - "short_name": "IAMCredentials", - "full_name": "google.iam.credentials.v1.IAMCredentials" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "iamcredentials_v1_generated_IAMCredentials_GenerateIdToken_sync", - "title": "Snippet for the generate_id_token call in the IAMCredentials service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Iam::Credentials::V1::IAMCredentials::Client#generate_id_token.", - "file": "iam_credentials/generate_id_token.rb", - "language": "RUBY", - "client_method": { - "short_name": "generate_id_token", - "full_name": "::Google::Iam::Credentials::V1::IAMCredentials::Client#generate_id_token", - "async": false, - "parameters": [ - { - "type": "::Google::Iam::Credentials::V1::GenerateIdTokenRequest", - "name": "request" - } - ], - "result_type": "::Google::Iam::Credentials::V1::GenerateIdTokenResponse", - "client": { - "short_name": "IAMCredentials::Client", - "full_name": "::Google::Iam::Credentials::V1::IAMCredentials::Client" - }, - "method": { - "short_name": "GenerateIdToken", - "full_name": "google.iam.credentials.v1.IAMCredentials.GenerateIdToken", - "service": { - "short_name": "IAMCredentials", - "full_name": "google.iam.credentials.v1.IAMCredentials" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "iamcredentials_v1_generated_IAMCredentials_SignBlob_sync", - "title": "Snippet for the sign_blob call in the IAMCredentials service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Iam::Credentials::V1::IAMCredentials::Client#sign_blob.", - "file": "iam_credentials/sign_blob.rb", - "language": "RUBY", - "client_method": { - "short_name": "sign_blob", - "full_name": "::Google::Iam::Credentials::V1::IAMCredentials::Client#sign_blob", - "async": false, - "parameters": [ - { - "type": "::Google::Iam::Credentials::V1::SignBlobRequest", - "name": "request" - } - ], - "result_type": "::Google::Iam::Credentials::V1::SignBlobResponse", - "client": { - "short_name": "IAMCredentials::Client", - "full_name": "::Google::Iam::Credentials::V1::IAMCredentials::Client" - }, - "method": { - "short_name": "SignBlob", - "full_name": "google.iam.credentials.v1.IAMCredentials.SignBlob", - "service": { - "short_name": "IAMCredentials", - "full_name": "google.iam.credentials.v1.IAMCredentials" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "iamcredentials_v1_generated_IAMCredentials_SignJwt_sync", - "title": "Snippet for the sign_jwt call in the IAMCredentials service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Iam::Credentials::V1::IAMCredentials::Client#sign_jwt.", - "file": "iam_credentials/sign_jwt.rb", - "language": "RUBY", - "client_method": { - "short_name": "sign_jwt", - "full_name": "::Google::Iam::Credentials::V1::IAMCredentials::Client#sign_jwt", - "async": false, - "parameters": [ - { - "type": "::Google::Iam::Credentials::V1::SignJwtRequest", - "name": "request" - } - ], - "result_type": "::Google::Iam::Credentials::V1::SignJwtResponse", - "client": { - "short_name": "IAMCredentials::Client", - "full_name": "::Google::Iam::Credentials::V1::IAMCredentials::Client" - }, - "method": { - "short_name": "SignJwt", - "full_name": "google.iam.credentials.v1.IAMCredentials.SignJwt", - "service": { - "short_name": "IAMCredentials", - "full_name": "google.iam.credentials.v1.IAMCredentials" - } - } - }, - "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-iam-credentials-v1/test/google/iam/credentials/v1/iam_credentials_paths_test.rb b/owl-bot-staging/google-iam-credentials-v1/test/google/iam/credentials/v1/iam_credentials_paths_test.rb deleted file mode 100644 index 3a872d20e5a0..000000000000 --- a/owl-bot-staging/google-iam-credentials-v1/test/google/iam/credentials/v1/iam_credentials_paths_test.rb +++ /dev/null @@ -1,55 +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/iam/credentials/v1/iam_credentials" - -class ::Google::Iam::Credentials::V1::IAMCredentials::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_service_account_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Iam::Credentials::V1::IAMCredentials::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.service_account_path project: "value0", service_account: "value1" - assert_equal "projects/value0/serviceAccounts/value1", path - end - end -end diff --git a/owl-bot-staging/google-iam-credentials-v1/test/google/iam/credentials/v1/iam_credentials_rest_test.rb b/owl-bot-staging/google-iam-credentials-v1/test/google/iam/credentials/v1/iam_credentials_rest_test.rb deleted file mode 100644 index 1c350f0ecfba..000000000000 --- a/owl-bot-staging/google-iam-credentials-v1/test/google/iam/credentials/v1/iam_credentials_rest_test.rb +++ /dev/null @@ -1,325 +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/iam/credentials/v1/iamcredentials_pb" -require "google/iam/credentials/v1/iam_credentials/rest" - - -class ::Google::Iam::Credentials::V1::IAMCredentials::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_generate_access_token - # Create test objects. - client_result = ::Google::Iam::Credentials::V1::GenerateAccessTokenResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - delegates = ["hello world"] - scope = ["hello world"] - lifetime = {} - - generate_access_token_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::Iam::Credentials::V1::IAMCredentials::Rest::ServiceStub.stub :transcode_generate_access_token_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, generate_access_token_client_stub do - # Create client - client = ::Google::Iam::Credentials::V1::IAMCredentials::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.generate_access_token({ name: name, delegates: delegates, scope: scope, lifetime: lifetime }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.generate_access_token name: name, delegates: delegates, scope: scope, lifetime: lifetime do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.generate_access_token ::Google::Iam::Credentials::V1::GenerateAccessTokenRequest.new(name: name, delegates: delegates, scope: scope, lifetime: lifetime) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.generate_access_token({ name: name, delegates: delegates, scope: scope, lifetime: lifetime }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.generate_access_token(::Google::Iam::Credentials::V1::GenerateAccessTokenRequest.new(name: name, delegates: delegates, scope: scope, lifetime: lifetime), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, generate_access_token_client_stub.call_count - end - end - end - - def test_generate_id_token - # Create test objects. - client_result = ::Google::Iam::Credentials::V1::GenerateIdTokenResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - delegates = ["hello world"] - audience = "hello world" - include_email = true - - generate_id_token_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::Iam::Credentials::V1::IAMCredentials::Rest::ServiceStub.stub :transcode_generate_id_token_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, generate_id_token_client_stub do - # Create client - client = ::Google::Iam::Credentials::V1::IAMCredentials::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.generate_id_token({ name: name, delegates: delegates, audience: audience, include_email: include_email }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.generate_id_token name: name, delegates: delegates, audience: audience, include_email: include_email do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.generate_id_token ::Google::Iam::Credentials::V1::GenerateIdTokenRequest.new(name: name, delegates: delegates, audience: audience, include_email: include_email) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.generate_id_token({ name: name, delegates: delegates, audience: audience, include_email: include_email }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.generate_id_token(::Google::Iam::Credentials::V1::GenerateIdTokenRequest.new(name: name, delegates: delegates, audience: audience, include_email: include_email), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, generate_id_token_client_stub.call_count - end - end - end - - def test_sign_blob - # Create test objects. - client_result = ::Google::Iam::Credentials::V1::SignBlobResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - delegates = ["hello world"] - payload = "hello world" - - sign_blob_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::Iam::Credentials::V1::IAMCredentials::Rest::ServiceStub.stub :transcode_sign_blob_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, sign_blob_client_stub do - # Create client - client = ::Google::Iam::Credentials::V1::IAMCredentials::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.sign_blob({ name: name, delegates: delegates, payload: payload }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.sign_blob name: name, delegates: delegates, payload: payload do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.sign_blob ::Google::Iam::Credentials::V1::SignBlobRequest.new(name: name, delegates: delegates, payload: payload) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.sign_blob({ name: name, delegates: delegates, payload: payload }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.sign_blob(::Google::Iam::Credentials::V1::SignBlobRequest.new(name: name, delegates: delegates, payload: payload), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, sign_blob_client_stub.call_count - end - end - end - - def test_sign_jwt - # Create test objects. - client_result = ::Google::Iam::Credentials::V1::SignJwtResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - delegates = ["hello world"] - payload = "hello world" - - sign_jwt_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::Iam::Credentials::V1::IAMCredentials::Rest::ServiceStub.stub :transcode_sign_jwt_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, sign_jwt_client_stub do - # Create client - client = ::Google::Iam::Credentials::V1::IAMCredentials::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.sign_jwt({ name: name, delegates: delegates, payload: payload }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.sign_jwt name: name, delegates: delegates, payload: payload do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.sign_jwt ::Google::Iam::Credentials::V1::SignJwtRequest.new(name: name, delegates: delegates, payload: payload) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.sign_jwt({ name: name, delegates: delegates, payload: payload }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.sign_jwt(::Google::Iam::Credentials::V1::SignJwtRequest.new(name: name, delegates: delegates, payload: payload), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, sign_jwt_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::Iam::Credentials::V1::IAMCredentials::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::Iam::Credentials::V1::IAMCredentials::Rest::Client::Configuration, config - end -end diff --git a/owl-bot-staging/google-iam-credentials-v1/test/google/iam/credentials/v1/iam_credentials_test.rb b/owl-bot-staging/google-iam-credentials-v1/test/google/iam/credentials/v1/iam_credentials_test.rb deleted file mode 100644 index 3953d3ced1aa..000000000000 --- a/owl-bot-staging/google-iam-credentials-v1/test/google/iam/credentials/v1/iam_credentials_test.rb +++ /dev/null @@ -1,356 +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/iam/credentials/v1/iamcredentials_pb" -require "google/iam/credentials/v1/iam_credentials" - -class ::Google::Iam::Credentials::V1::IAMCredentials::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_generate_access_token - # Create GRPC objects. - grpc_response = ::Google::Iam::Credentials::V1::GenerateAccessTokenResponse.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" - delegates = ["hello world"] - scope = ["hello world"] - lifetime = {} - - generate_access_token_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :generate_access_token, name - assert_kind_of ::Google::Iam::Credentials::V1::GenerateAccessTokenRequest, request - assert_equal "hello world", request["name"] - assert_equal ["hello world"], request["delegates"] - assert_equal ["hello world"], request["scope"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::Duration), request["lifetime"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, generate_access_token_client_stub do - # Create client - client = ::Google::Iam::Credentials::V1::IAMCredentials::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.generate_access_token({ name: name, delegates: delegates, scope: scope, lifetime: lifetime }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.generate_access_token name: name, delegates: delegates, scope: scope, lifetime: lifetime do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.generate_access_token ::Google::Iam::Credentials::V1::GenerateAccessTokenRequest.new(name: name, delegates: delegates, scope: scope, lifetime: lifetime) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.generate_access_token({ name: name, delegates: delegates, scope: scope, lifetime: lifetime }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.generate_access_token(::Google::Iam::Credentials::V1::GenerateAccessTokenRequest.new(name: name, delegates: delegates, scope: scope, lifetime: lifetime), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, generate_access_token_client_stub.call_rpc_count - end - end - - def test_generate_id_token - # Create GRPC objects. - grpc_response = ::Google::Iam::Credentials::V1::GenerateIdTokenResponse.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" - delegates = ["hello world"] - audience = "hello world" - include_email = true - - generate_id_token_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :generate_id_token, name - assert_kind_of ::Google::Iam::Credentials::V1::GenerateIdTokenRequest, request - assert_equal "hello world", request["name"] - assert_equal ["hello world"], request["delegates"] - assert_equal "hello world", request["audience"] - assert_equal true, request["include_email"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, generate_id_token_client_stub do - # Create client - client = ::Google::Iam::Credentials::V1::IAMCredentials::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.generate_id_token({ name: name, delegates: delegates, audience: audience, include_email: include_email }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.generate_id_token name: name, delegates: delegates, audience: audience, include_email: include_email do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.generate_id_token ::Google::Iam::Credentials::V1::GenerateIdTokenRequest.new(name: name, delegates: delegates, audience: audience, include_email: include_email) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.generate_id_token({ name: name, delegates: delegates, audience: audience, include_email: include_email }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.generate_id_token(::Google::Iam::Credentials::V1::GenerateIdTokenRequest.new(name: name, delegates: delegates, audience: audience, include_email: include_email), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, generate_id_token_client_stub.call_rpc_count - end - end - - def test_sign_blob - # Create GRPC objects. - grpc_response = ::Google::Iam::Credentials::V1::SignBlobResponse.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" - delegates = ["hello world"] - payload = "hello world" - - sign_blob_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :sign_blob, name - assert_kind_of ::Google::Iam::Credentials::V1::SignBlobRequest, request - assert_equal "hello world", request["name"] - assert_equal ["hello world"], request["delegates"] - assert_equal "hello world", request["payload"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, sign_blob_client_stub do - # Create client - client = ::Google::Iam::Credentials::V1::IAMCredentials::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.sign_blob({ name: name, delegates: delegates, payload: payload }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.sign_blob name: name, delegates: delegates, payload: payload do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.sign_blob ::Google::Iam::Credentials::V1::SignBlobRequest.new(name: name, delegates: delegates, payload: payload) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.sign_blob({ name: name, delegates: delegates, payload: payload }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.sign_blob(::Google::Iam::Credentials::V1::SignBlobRequest.new(name: name, delegates: delegates, payload: payload), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, sign_blob_client_stub.call_rpc_count - end - end - - def test_sign_jwt - # Create GRPC objects. - grpc_response = ::Google::Iam::Credentials::V1::SignJwtResponse.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" - delegates = ["hello world"] - payload = "hello world" - - sign_jwt_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :sign_jwt, name - assert_kind_of ::Google::Iam::Credentials::V1::SignJwtRequest, request - assert_equal "hello world", request["name"] - assert_equal ["hello world"], request["delegates"] - assert_equal "hello world", request["payload"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, sign_jwt_client_stub do - # Create client - client = ::Google::Iam::Credentials::V1::IAMCredentials::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.sign_jwt({ name: name, delegates: delegates, payload: payload }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.sign_jwt name: name, delegates: delegates, payload: payload do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.sign_jwt ::Google::Iam::Credentials::V1::SignJwtRequest.new(name: name, delegates: delegates, payload: payload) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.sign_jwt({ name: name, delegates: delegates, payload: payload }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.sign_jwt(::Google::Iam::Credentials::V1::SignJwtRequest.new(name: name, delegates: delegates, payload: payload), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, sign_jwt_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::Iam::Credentials::V1::IAMCredentials::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::Iam::Credentials::V1::IAMCredentials::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::Iam::Credentials::V1::IAMCredentials::Client.new do |config| - config.credentials = creds - end - assert_kind_of ::Google::Iam::Credentials::V1::IAMCredentials::Client, client - assert_equal creds, client.configure.credentials - end - end -end diff --git a/owl-bot-staging/google-iam-credentials-v1/test/helper.rb b/owl-bot-staging/google-iam-credentials-v1/test/helper.rb deleted file mode 100644 index 672b337030e7..000000000000 --- a/owl-bot-staging/google-iam-credentials-v1/test/helper.rb +++ /dev/null @@ -1,26 +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/mock" -require "minitest/rg" - -require "grpc" - -require "ostruct" diff --git a/owl-bot-staging/google-iam-v1/.gitignore b/owl-bot-staging/google-iam-v1/.gitignore deleted file mode 100644 index 0135b6bc6cfc..000000000000 --- a/owl-bot-staging/google-iam-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-iam-v1/.repo-metadata.json b/owl-bot-staging/google-iam-v1/.repo-metadata.json deleted file mode 100644 index ac8c3d5d4020..000000000000 --- a/owl-bot-staging/google-iam-v1/.repo-metadata.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "api_id": "iam-meta-api.googleapis.com", - "api_shortname": "iam", - "client_documentation": "https://rubydoc.info/gems/google-iam-v1", - "distribution_name": "google-iam-v1", - "is_cloud": false, - "language": "ruby", - "name": "iam", - "name_pretty": "IAM API", - "release_level": "unreleased", - "repo": "googleapis/google-cloud-ruby", - "requires_billing": true, - "ruby-cloud-description": "An add-on interface used by some Google API clients to provide IAM Policy calls. Note that google-iam-v1 is a version-specific client library. For most uses, we recommend installing the main client library google-iam instead. See the readme for more details.", - "library_type": "GAPIC_AUTO" -} diff --git a/owl-bot-staging/google-iam-v1/.rubocop.yml b/owl-bot-staging/google-iam-v1/.rubocop.yml deleted file mode 100644 index b2f162eb67aa..000000000000 --- a/owl-bot-staging/google-iam-v1/.rubocop.yml +++ /dev/null @@ -1,33 +0,0 @@ -inherit_gem: - google-style: google-style.yml - -AllCops: - Exclude: - - "google-iam-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-iam-v1.rb" diff --git a/owl-bot-staging/google-iam-v1/.toys.rb b/owl-bot-staging/google-iam-v1/.toys.rb deleted file mode 100644 index 177e22456e8a..000000000000 --- a/owl-bot-staging/google-iam-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-iam-v1/.yardopts b/owl-bot-staging/google-iam-v1/.yardopts deleted file mode 100644 index ffea73c50984..000000000000 --- a/owl-bot-staging/google-iam-v1/.yardopts +++ /dev/null @@ -1,12 +0,0 @@ ---no-private ---title="IAM 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-iam-v1/AUTHENTICATION.md b/owl-bot-staging/google-iam-v1/AUTHENTICATION.md deleted file mode 100644 index 091be9ba75f1..000000000000 --- a/owl-bot-staging/google-iam-v1/AUTHENTICATION.md +++ /dev/null @@ -1,122 +0,0 @@ -# Authentication - -The recommended way to authenticate to the google-iam-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-iam-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/iam/v1" - -client = ::Google::Iam::V1::IAMPolicy::Client.new do |config| - config.credentials = "path/to/credentialfile.json" -end -``` - -To configure a credentials file globally for all clients: - -```ruby -require "google/iam/v1" - -::Google::Iam::V1::IAMPolicy::Client.configure do |config| - config.credentials = "path/to/credentialfile.json" -end - -client = ::Google::Iam::V1::IAMPolicy::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-iam-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/iam/v1" - -ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" - -client = ::Google::Iam::V1::IAMPolicy::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-iam-v1/CHANGELOG.md b/owl-bot-staging/google-iam-v1/CHANGELOG.md deleted file mode 100644 index f88957a62ba2..000000000000 --- a/owl-bot-staging/google-iam-v1/CHANGELOG.md +++ /dev/null @@ -1,2 +0,0 @@ -# Release History - diff --git a/owl-bot-staging/google-iam-v1/Gemfile b/owl-bot-staging/google-iam-v1/Gemfile deleted file mode 100644 index 1d08558908d8..000000000000 --- a/owl-bot-staging/google-iam-v1/Gemfile +++ /dev/null @@ -1,14 +0,0 @@ -source "https://rubygems.org" - -gemspec - -gem "google-style", "~> 1.32.0" -gem "irb", "~> 1.17" -gem "minitest", "~> 6.0.2" -gem "minitest-focus", "~> 1.4" -gem "minitest-mock", "~> 5.27" -gem "minitest-rg", "~> 5.3" -gem "ostruct", "~> 0.5.5" -gem "rake", ">= 13.0" -gem "redcarpet", "~> 3.6" -gem "yard", "~> 0.9" diff --git a/owl-bot-staging/google-iam-v1/LICENSE.md b/owl-bot-staging/google-iam-v1/LICENSE.md deleted file mode 100644 index c261857ba6ad..000000000000 --- a/owl-bot-staging/google-iam-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-iam-v1/README.md b/owl-bot-staging/google-iam-v1/README.md deleted file mode 100644 index b2f110454aad..000000000000 --- a/owl-bot-staging/google-iam-v1/README.md +++ /dev/null @@ -1,151 +0,0 @@ -# Ruby Client for the IAM API - -Manages access control for Google Cloud Platform resources. - -An add-on interface used by some Google API clients to provide IAM Policy calls. - -https://github.com/googleapis/google-cloud-ruby - -This gem is a _versioned_ client. It provides basic client classes for a -specific version of the IAM API. Most users should consider using -the main client gem, -[google-iam](https://rubygems.org/gems/google-iam). -See the section below titled *Which client should I use?* for more information. - -## Installation - -``` -$ gem install google-iam-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/iam-meta-api.googleapis.com) -1. [Set up authentication.](AUTHENTICATION.md) - -## Quick Start - -```ruby -require "google/iam/v1" - -client = ::Google::Iam::V1::IAMPolicy::Client.new -request = ::Google::Iam::V1::SetIamPolicyRequest.new # (request fields as keyword arguments...) -response = client.set_iam_policy request -``` - -View the [Client Library Documentation](https://rubydoc.info/gems/google-iam-v1) -for class and method documentation. - -## 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/iam/v1" -require "logger" - -client = ::Google::Iam::V1::IAMPolicy::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-iam`, -and lower-level _versioned_ client libraries with names such as -`google-iam-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-iam`. -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-iam-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-iam-v1/Rakefile b/owl-bot-staging/google-iam-v1/Rakefile deleted file mode 100644 index b98eca5ed91e..000000000000 --- a/owl-bot-staging/google-iam-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-iam-v1 acceptance tests." -task :acceptance, :project, :keyfile do |t, args| - project = args[:project] - project ||= - ENV["GOOGLE_CLOUD_TEST_PROJECT"] || - ENV["GCLOUD_TEST_PROJECT"] - keyfile = args[:keyfile] - keyfile ||= - ENV["GOOGLE_CLOUD_TEST_KEYFILE"] || - ENV["GCLOUD_TEST_KEYFILE"] - if keyfile - keyfile = File.read keyfile - else - keyfile ||= - ENV["GOOGLE_CLOUD_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 GOOGLE_CLOUD_TEST_PROJECT=test123 GOOGLE_CLOUD_TEST_KEYFILE=/path/to/keyfile.json rake acceptance" - end - require "google/iam/v1/iam_policy/credentials" - ::Google::Iam::V1::IAMPolicy::Credentials.env_vars.each do |path| - ENV[path] = nil - end - ENV["GOOGLE_CLOUD_PROJECT"] = project - ENV["GOOGLE_CLOUD_TEST_PROJECT"] = project - ENV["GOOGLE_CLOUD_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-iam-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-iam-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-iam-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-iam-v1 gem does not have doctest tests." -end - -desc "Run the CI build" -task :ci do - header "BUILDING google-iam-v1" - header "google-iam-v1 rubocop", "*" - Rake::Task[:rubocop].invoke - header "google-iam-v1 yard", "*" - Rake::Task[:yard].invoke - header "google-iam-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-iam-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-iam-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-iam-v1/gapic_metadata.json b/owl-bot-staging/google-iam-v1/gapic_metadata.json deleted file mode 100644 index 460f0e3504a4..000000000000 --- a/owl-bot-staging/google-iam-v1/gapic_metadata.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", - "language": "ruby", - "protoPackage": "google.iam.v1", - "libraryPackage": "::Google::Iam::V1", - "services": { - "IAMPolicy": { - "clients": { - "grpc": { - "libraryClient": "::Google::Iam::V1::IAMPolicy::Client", - "rpcs": { - "SetIamPolicy": { - "methods": [ - "set_iam_policy" - ] - }, - "GetIamPolicy": { - "methods": [ - "get_iam_policy" - ] - }, - "TestIamPermissions": { - "methods": [ - "test_iam_permissions" - ] - } - } - } - } - } - } -} diff --git a/owl-bot-staging/google-iam-v1/google-iam-v1.gemspec b/owl-bot-staging/google-iam-v1/google-iam-v1.gemspec deleted file mode 100644 index 8a38f57a9e4e..000000000000 --- a/owl-bot-staging/google-iam-v1/google-iam-v1.gemspec +++ /dev/null @@ -1,29 +0,0 @@ -# -*- ruby -*- -# encoding: utf-8 - -require File.expand_path("lib/google/iam/v1/version", __dir__) - -Gem::Specification.new do |gem| - gem.name = "google-iam-v1" - gem.version = Google::Iam::V1::VERSION - - gem.authors = ["Google LLC"] - gem.email = "googleapis-packages@google.com" - gem.description = "An add-on interface used by some Google API clients to provide IAM Policy calls. Note that google-iam-v1 is a version-specific client library. For most uses, we recommend installing the main client library google-iam instead. See the readme for more details." - gem.summary = "Manages access control for Google Cloud Platform resources." - 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.2" - - gem.add_dependency "gapic-common", "~> 1.2" - gem.add_dependency "google-cloud-errors", "~> 1.0" - gem.add_dependency "grpc-google-iam-v1", "~> 1.11" -end diff --git a/owl-bot-staging/google-iam-v1/lib/google-iam-v1.rb b/owl-bot-staging/google-iam-v1/lib/google-iam-v1.rb deleted file mode 100644 index 8535b41b7b04..000000000000 --- a/owl-bot-staging/google-iam-v1/lib/google-iam-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/iam/v1" diff --git a/owl-bot-staging/google-iam-v1/lib/google/iam/v1.rb b/owl-bot-staging/google-iam-v1/lib/google/iam/v1.rb deleted file mode 100644 index 82236fcafd28..000000000000 --- a/owl-bot-staging/google-iam-v1/lib/google/iam/v1.rb +++ /dev/null @@ -1,43 +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/iam/v1/iam_policy" -require "google/iam/v1/version" - -module Google - module Iam - ## - # API client module. - # - # @example Load this package, including all its services, and instantiate a gRPC client - # - # require "google/iam/v1" - # client = ::Google::Iam::V1::IAMPolicy::Client.new - # - # @example Load this package, including all its services, and instantiate a REST client - # - # require "google/iam/v1" - # client = ::Google::Iam::V1::IAMPolicy::Rest::Client.new - # - module V1 - end - end -end - -helper_path = ::File.join __dir__, "v1", "_helpers.rb" -require "google/iam/v1/_helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-iam-v1/lib/google/iam/v1/iam_policy.rb b/owl-bot-staging/google-iam-v1/lib/google/iam/v1/iam_policy.rb deleted file mode 100644 index 548e35457af4..000000000000 --- a/owl-bot-staging/google-iam-v1/lib/google/iam/v1/iam_policy.rb +++ /dev/null @@ -1,76 +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/iam/v1/version" - -require "google/iam/v1/iam_policy/credentials" -require "google/iam/v1/iam_policy/client" -require "google/iam/v1/iam_policy/rest" - -module Google - module Iam - module V1 - ## - # API Overview - # - # Manages Identity and Access Management (IAM) policies. - # - # Any implementation of an API that offers access control features - # implements the google.iam.v1.IAMPolicy interface. - # - # ## Data model - # - # Access control is applied when a principal (user or service account), takes - # some action on a resource exposed by a service. Resources, identified by - # URI-like names, are the unit of access control specification. Service - # implementations can choose the granularity of access control and the - # supported permissions for their resources. - # For example one database service may allow access control to be - # specified only at the Table level, whereas another might allow access control - # to also be specified at the Column level. - # - # ## Policy Structure - # - # See google.iam.v1.Policy - # - # This is intentionally not a CRUD style API because access control policies - # are created and deleted implicitly with the resources to which they are - # attached. - # - # @example Load this service and instantiate a gRPC client - # - # require "google/iam/v1/iam_policy" - # client = ::Google::Iam::V1::IAMPolicy::Client.new - # - # @example Load this service and instantiate a REST client - # - # require "google/iam/v1/iam_policy/rest" - # client = ::Google::Iam::V1::IAMPolicy::Rest::Client.new - # - module IAMPolicy - end - end - end -end - -helper_path = ::File.join __dir__, "iam_policy", "helpers.rb" -require "google/iam/v1/iam_policy/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-iam-v1/lib/google/iam/v1/iam_policy/client.rb b/owl-bot-staging/google-iam-v1/lib/google/iam/v1/iam_policy/client.rb deleted file mode 100644 index 703172dfaf36..000000000000 --- a/owl-bot-staging/google-iam-v1/lib/google/iam/v1/iam_policy/client.rb +++ /dev/null @@ -1,711 +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/iam/v1/iam_policy_pb" - -module Google - module Iam - module V1 - module IAMPolicy - ## - # Client for the IAMPolicy service. - # - # API Overview - # - # Manages Identity and Access Management (IAM) policies. - # - # Any implementation of an API that offers access control features - # implements the google.iam.v1.IAMPolicy interface. - # - # ## Data model - # - # Access control is applied when a principal (user or service account), takes - # some action on a resource exposed by a service. Resources, identified by - # URI-like names, are the unit of access control specification. Service - # implementations can choose the granularity of access control and the - # supported permissions for their resources. - # For example one database service may allow access control to be - # specified only at the Table level, whereas another might allow access control - # to also be specified at the Column level. - # - # ## Policy Structure - # - # See google.iam.v1.Policy - # - # This is intentionally not a CRUD style API because access control policies - # are created and deleted implicitly with the resources to which they are - # attached. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "iam-meta-api.$UNIVERSE_DOMAIN$" - - # @private - attr_reader :iam_policy_stub - - ## - # Configure the IAMPolicy Client class. - # - # See {::Google::Iam::V1::IAMPolicy::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all IAMPolicy clients - # ::Google::Iam::V1::IAMPolicy::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", "Iam", "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 - end - yield @configure if block_given? - @configure - end - - ## - # Configure the IAMPolicy 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::Iam::V1::IAMPolicy::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 - @iam_policy_stub.universe_domain - end - - ## - # Create a new IAMPolicy client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Iam::V1::IAMPolicy::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Iam::V1::IAMPolicy::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the IAMPolicy 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/iam/v1/iam_policy_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 - - @iam_policy_stub = ::Gapic::ServiceStub.new( - ::Google::Iam::V1::IAMPolicy::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 - ) - - @iam_policy_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 - end - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @iam_policy_stub.logger - end - - # Service calls - - ## - # Sets the access control policy on the specified resource. Replaces any - # existing policy. - # - # Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` errors. - # - # @overload set_iam_policy(request, options = nil) - # Pass arguments to `set_iam_policy` via a request object, either of type - # {::Google::Iam::V1::SetIamPolicyRequest} or an equivalent Hash. - # - # @param request [::Google::Iam::V1::SetIamPolicyRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload set_iam_policy(resource: nil, policy: nil, update_mask: nil) - # Pass arguments to `set_iam_policy` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param resource [::String] - # REQUIRED: The resource for which the policy is being specified. - # See the operation documentation for the appropriate value for this field. - # @param policy [::Google::Iam::V1::Policy, ::Hash] - # REQUIRED: The complete policy to be applied to the `resource`. The size of - # the policy is limited to a few 10s of KB. An empty policy is a - # valid policy but certain Cloud Platform services (such as Projects) - # might reject them. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only - # the fields in the mask will be modified. If no mask is provided, the - # following default mask is used: - # - # `paths: "bindings, etag"` - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Iam::V1::Policy] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Iam::V1::Policy] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/iam/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Iam::V1::IAMPolicy::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Iam::V1::SetIamPolicyRequest.new - # - # # Call the set_iam_policy method. - # result = client.set_iam_policy request - # - # # The returned object is of type Google::Iam::V1::Policy. - # p result - # - def set_iam_policy request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::SetIamPolicyRequest - - # Converts hash 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.set_iam_policy.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::Iam::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.resource - header_params["resource"] = request.resource - 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.set_iam_policy.timeout, - metadata: metadata, - retry_policy: @config.rpcs.set_iam_policy.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @iam_policy_stub.call_rpc :set_iam_policy, 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 - - ## - # Gets the access control policy for a resource. - # Returns an empty policy if the resource exists and does not have a policy - # set. - # - # @overload get_iam_policy(request, options = nil) - # Pass arguments to `get_iam_policy` via a request object, either of type - # {::Google::Iam::V1::GetIamPolicyRequest} or an equivalent Hash. - # - # @param request [::Google::Iam::V1::GetIamPolicyRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_iam_policy(resource: nil, options: nil) - # Pass arguments to `get_iam_policy` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param resource [::String] - # REQUIRED: The resource for which the policy is being requested. - # See the operation documentation for the appropriate value for this field. - # @param options [::Google::Iam::V1::GetPolicyOptions, ::Hash] - # OPTIONAL: A `GetPolicyOptions` object for specifying options to - # `GetIamPolicy`. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Iam::V1::Policy] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Iam::V1::Policy] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/iam/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Iam::V1::IAMPolicy::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Iam::V1::GetIamPolicyRequest.new - # - # # Call the get_iam_policy method. - # result = client.get_iam_policy request - # - # # The returned object is of type Google::Iam::V1::Policy. - # p result - # - def get_iam_policy request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::GetIamPolicyRequest - - # Converts hash 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_iam_policy.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::Iam::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.resource - header_params["resource"] = request.resource - 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_iam_policy.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_iam_policy.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @iam_policy_stub.call_rpc :get_iam_policy, 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 permissions that a caller has on the specified resource. - # If the resource does not exist, this will return an empty set of - # permissions, not a `NOT_FOUND` error. - # - # Note: This operation is designed to be used for building permission-aware - # UIs and command-line tools, not for authorization checking. This operation - # may "fail open" without warning. - # - # @overload test_iam_permissions(request, options = nil) - # Pass arguments to `test_iam_permissions` via a request object, either of type - # {::Google::Iam::V1::TestIamPermissionsRequest} or an equivalent Hash. - # - # @param request [::Google::Iam::V1::TestIamPermissionsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload test_iam_permissions(resource: nil, permissions: nil) - # Pass arguments to `test_iam_permissions` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param resource [::String] - # REQUIRED: The resource for which the policy detail is being requested. - # See the operation documentation for the appropriate value for this field. - # @param permissions [::Array<::String>] - # The set of permissions to check for the `resource`. Permissions with - # wildcards (such as '*' or 'storage.*') are not allowed. For more - # information see - # [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Iam::V1::TestIamPermissionsResponse] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Iam::V1::TestIamPermissionsResponse] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/iam/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Iam::V1::IAMPolicy::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Iam::V1::TestIamPermissionsRequest.new - # - # # Call the test_iam_permissions method. - # result = client.test_iam_permissions request - # - # # The returned object is of type Google::Iam::V1::TestIamPermissionsResponse. - # p result - # - def test_iam_permissions request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::TestIamPermissionsRequest - - # Converts hash 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.test_iam_permissions.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::Iam::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.resource - header_params["resource"] = request.resource - 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.test_iam_permissions.timeout, - metadata: metadata, - retry_policy: @config.rpcs.test_iam_permissions.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @iam_policy_stub.call_rpc :test_iam_permissions, 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 IAMPolicy API. - # - # This class represents the configuration for IAMPolicy, - # 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::Iam::V1::IAMPolicy::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 - # # set_iam_policy to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Iam::V1::IAMPolicy::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.set_iam_policy.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Iam::V1::IAMPolicy::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.set_iam_policy.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::Iam::V1::IAMPolicy::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 = "iam-meta-api.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 IAMPolicy 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 `set_iam_policy` - # @return [::Gapic::Config::Method] - # - attr_reader :set_iam_policy - ## - # RPC-specific configuration for `get_iam_policy` - # @return [::Gapic::Config::Method] - # - attr_reader :get_iam_policy - ## - # RPC-specific configuration for `test_iam_permissions` - # @return [::Gapic::Config::Method] - # - attr_reader :test_iam_permissions - - # @private - def initialize parent_rpcs = nil - set_iam_policy_config = parent_rpcs.set_iam_policy if parent_rpcs.respond_to? :set_iam_policy - @set_iam_policy = ::Gapic::Config::Method.new set_iam_policy_config - get_iam_policy_config = parent_rpcs.get_iam_policy if parent_rpcs.respond_to? :get_iam_policy - @get_iam_policy = ::Gapic::Config::Method.new get_iam_policy_config - test_iam_permissions_config = parent_rpcs.test_iam_permissions if parent_rpcs.respond_to? :test_iam_permissions - @test_iam_permissions = ::Gapic::Config::Method.new test_iam_permissions_config - - yield self if block_given? - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-iam-v1/lib/google/iam/v1/iam_policy/credentials.rb b/owl-bot-staging/google-iam-v1/lib/google/iam/v1/iam_policy/credentials.rb deleted file mode 100644 index ae4df78450b3..000000000000 --- a/owl-bot-staging/google-iam-v1/lib/google/iam/v1/iam_policy/credentials.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 "googleauth" - -module Google - module Iam - module V1 - module IAMPolicy - # Credentials for the IAMPolicy API. - class Credentials < ::Google::Auth::Credentials - self.env_vars = [ - "GOOGLE_CLOUD_CREDENTIALS", - "GOOGLE_CLOUD_KEYFILE", - "GCLOUD_KEYFILE", - "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 diff --git a/owl-bot-staging/google-iam-v1/lib/google/iam/v1/iam_policy/rest.rb b/owl-bot-staging/google-iam-v1/lib/google/iam/v1/iam_policy/rest.rb deleted file mode 100644 index ddd2c64fa229..000000000000 --- a/owl-bot-staging/google-iam-v1/lib/google/iam/v1/iam_policy/rest.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/rest" -require "gapic/config" -require "gapic/config/method" - -require "google/iam/v1/version" - -require "google/iam/v1/iam_policy/credentials" -require "google/iam/v1/iam_policy/rest/client" - -module Google - module Iam - module V1 - ## - # API Overview - # - # Manages Identity and Access Management (IAM) policies. - # - # Any implementation of an API that offers access control features - # implements the google.iam.v1.IAMPolicy interface. - # - # ## Data model - # - # Access control is applied when a principal (user or service account), takes - # some action on a resource exposed by a service. Resources, identified by - # URI-like names, are the unit of access control specification. Service - # implementations can choose the granularity of access control and the - # supported permissions for their resources. - # For example one database service may allow access control to be - # specified only at the Table level, whereas another might allow access control - # to also be specified at the Column level. - # - # ## Policy Structure - # - # See google.iam.v1.Policy - # - # This is intentionally not a CRUD style API because access control policies - # are created and deleted implicitly with the resources to which they are - # attached. - # - # To load this service and instantiate a REST client: - # - # require "google/iam/v1/iam_policy/rest" - # client = ::Google::Iam::V1::IAMPolicy::Rest::Client.new - # - module IAMPolicy - # Client for the REST transport - module Rest - end - end - end - end -end - -helper_path = ::File.join __dir__, "rest", "helpers.rb" -require "google/iam/v1/iam_policy/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-iam-v1/lib/google/iam/v1/iam_policy/rest/client.rb b/owl-bot-staging/google-iam-v1/lib/google/iam/v1/iam_policy/rest/client.rb deleted file mode 100644 index 7a09adf098b2..000000000000 --- a/owl-bot-staging/google-iam-v1/lib/google/iam/v1/iam_policy/rest/client.rb +++ /dev/null @@ -1,660 +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/iam/v1/iam_policy_pb" -require "google/iam/v1/iam_policy/rest/service_stub" - -module Google - module Iam - module V1 - module IAMPolicy - module Rest - ## - # REST client for the IAMPolicy service. - # - # API Overview - # - # Manages Identity and Access Management (IAM) policies. - # - # Any implementation of an API that offers access control features - # implements the google.iam.v1.IAMPolicy interface. - # - # ## Data model - # - # Access control is applied when a principal (user or service account), takes - # some action on a resource exposed by a service. Resources, identified by - # URI-like names, are the unit of access control specification. Service - # implementations can choose the granularity of access control and the - # supported permissions for their resources. - # For example one database service may allow access control to be - # specified only at the Table level, whereas another might allow access control - # to also be specified at the Column level. - # - # ## Policy Structure - # - # See google.iam.v1.Policy - # - # This is intentionally not a CRUD style API because access control policies - # are created and deleted implicitly with the resources to which they are - # attached. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "iam-meta-api.$UNIVERSE_DOMAIN$" - - # @private - attr_reader :iam_policy_stub - - ## - # Configure the IAMPolicy Client class. - # - # See {::Google::Iam::V1::IAMPolicy::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all IAMPolicy clients - # ::Google::Iam::V1::IAMPolicy::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", "Iam", "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 - end - yield @configure if block_given? - @configure - end - - ## - # Configure the IAMPolicy 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::Iam::V1::IAMPolicy::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 - @iam_policy_stub.universe_domain - end - - ## - # Create a new IAMPolicy REST client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Iam::V1::IAMPolicy::Rest::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Iam::V1::IAMPolicy::Rest::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the IAMPolicy 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 - - @iam_policy_stub = ::Google::Iam::V1::IAMPolicy::Rest::ServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials, - logger: @config.logger - ) - - @iam_policy_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 - end - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @iam_policy_stub.logger - end - - # Service calls - - ## - # Sets the access control policy on the specified resource. Replaces any - # existing policy. - # - # Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` errors. - # - # @overload set_iam_policy(request, options = nil) - # Pass arguments to `set_iam_policy` via a request object, either of type - # {::Google::Iam::V1::SetIamPolicyRequest} or an equivalent Hash. - # - # @param request [::Google::Iam::V1::SetIamPolicyRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload set_iam_policy(resource: nil, policy: nil, update_mask: nil) - # Pass arguments to `set_iam_policy` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param resource [::String] - # REQUIRED: The resource for which the policy is being specified. - # See the operation documentation for the appropriate value for this field. - # @param policy [::Google::Iam::V1::Policy, ::Hash] - # REQUIRED: The complete policy to be applied to the `resource`. The size of - # the policy is limited to a few 10s of KB. An empty policy is a - # valid policy but certain Cloud Platform services (such as Projects) - # might reject them. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only - # the fields in the mask will be modified. If no mask is provided, the - # following default mask is used: - # - # `paths: "bindings, etag"` - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Iam::V1::Policy] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Iam::V1::Policy] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/iam/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Iam::V1::IAMPolicy::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Iam::V1::SetIamPolicyRequest.new - # - # # Call the set_iam_policy method. - # result = client.set_iam_policy request - # - # # The returned object is of type Google::Iam::V1::Policy. - # p result - # - def set_iam_policy request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::SetIamPolicyRequest - - # Converts hash 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.set_iam_policy.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::Iam::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.set_iam_policy.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.set_iam_policy.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - bindings_override = @config.bindings_override["google.iam.v1.IAMPolicy.SetIamPolicy"] - - @iam_policy_stub.set_iam_policy request, options, bindings_override: bindings_override do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Gets the access control policy for a resource. - # Returns an empty policy if the resource exists and does not have a policy - # set. - # - # @overload get_iam_policy(request, options = nil) - # Pass arguments to `get_iam_policy` via a request object, either of type - # {::Google::Iam::V1::GetIamPolicyRequest} or an equivalent Hash. - # - # @param request [::Google::Iam::V1::GetIamPolicyRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_iam_policy(resource: nil, options: nil) - # Pass arguments to `get_iam_policy` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param resource [::String] - # REQUIRED: The resource for which the policy is being requested. - # See the operation documentation for the appropriate value for this field. - # @param options [::Google::Iam::V1::GetPolicyOptions, ::Hash] - # OPTIONAL: A `GetPolicyOptions` object for specifying options to - # `GetIamPolicy`. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Iam::V1::Policy] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Iam::V1::Policy] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/iam/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Iam::V1::IAMPolicy::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Iam::V1::GetIamPolicyRequest.new - # - # # Call the get_iam_policy method. - # result = client.get_iam_policy request - # - # # The returned object is of type Google::Iam::V1::Policy. - # p result - # - def get_iam_policy request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::GetIamPolicyRequest - - # Converts hash 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_iam_policy.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::Iam::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_iam_policy.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_iam_policy.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - bindings_override = @config.bindings_override["google.iam.v1.IAMPolicy.GetIamPolicy"] - - @iam_policy_stub.get_iam_policy request, options, bindings_override: bindings_override do |result, operation| - yield result, operation if block_given? - end - rescue ::Gapic::Rest::Error => e - raise ::Google::Cloud::Error.from_error(e) - end - - ## - # Returns permissions that a caller has on the specified resource. - # If the resource does not exist, this will return an empty set of - # permissions, not a `NOT_FOUND` error. - # - # Note: This operation is designed to be used for building permission-aware - # UIs and command-line tools, not for authorization checking. This operation - # may "fail open" without warning. - # - # @overload test_iam_permissions(request, options = nil) - # Pass arguments to `test_iam_permissions` via a request object, either of type - # {::Google::Iam::V1::TestIamPermissionsRequest} or an equivalent Hash. - # - # @param request [::Google::Iam::V1::TestIamPermissionsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries etc. Optional. - # - # @overload test_iam_permissions(resource: nil, permissions: nil) - # Pass arguments to `test_iam_permissions` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param resource [::String] - # REQUIRED: The resource for which the policy detail is being requested. - # See the operation documentation for the appropriate value for this field. - # @param permissions [::Array<::String>] - # The set of permissions to check for the `resource`. Permissions with - # wildcards (such as '*' or 'storage.*') are not allowed. For more - # information see - # [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Iam::V1::TestIamPermissionsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Iam::V1::TestIamPermissionsResponse] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/iam/v1" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Iam::V1::IAMPolicy::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Iam::V1::TestIamPermissionsRequest.new - # - # # Call the test_iam_permissions method. - # result = client.test_iam_permissions request - # - # # The returned object is of type Google::Iam::V1::TestIamPermissionsResponse. - # p result - # - def test_iam_permissions request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1::TestIamPermissionsRequest - - # Converts hash 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.test_iam_permissions.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::Iam::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.test_iam_permissions.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.test_iam_permissions.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - bindings_override = @config.bindings_override["google.iam.v1.IAMPolicy.TestIamPermissions"] - - @iam_policy_stub.test_iam_permissions request, options, bindings_override: bindings_override 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 IAMPolicy REST API. - # - # This class represents the configuration for IAMPolicy 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::Iam::V1::IAMPolicy::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 - # # set_iam_policy to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Iam::V1::IAMPolicy::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.set_iam_policy.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Iam::V1::IAMPolicy::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.set_iam_policy.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 = "iam-meta-api.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 IAMPolicy 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 `set_iam_policy` - # @return [::Gapic::Config::Method] - # - attr_reader :set_iam_policy - ## - # RPC-specific configuration for `get_iam_policy` - # @return [::Gapic::Config::Method] - # - attr_reader :get_iam_policy - ## - # RPC-specific configuration for `test_iam_permissions` - # @return [::Gapic::Config::Method] - # - attr_reader :test_iam_permissions - - # @private - def initialize parent_rpcs = nil - set_iam_policy_config = parent_rpcs.set_iam_policy if parent_rpcs.respond_to? :set_iam_policy - @set_iam_policy = ::Gapic::Config::Method.new set_iam_policy_config - get_iam_policy_config = parent_rpcs.get_iam_policy if parent_rpcs.respond_to? :get_iam_policy - @get_iam_policy = ::Gapic::Config::Method.new get_iam_policy_config - test_iam_permissions_config = parent_rpcs.test_iam_permissions if parent_rpcs.respond_to? :test_iam_permissions - @test_iam_permissions = ::Gapic::Config::Method.new test_iam_permissions_config - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-iam-v1/lib/google/iam/v1/iam_policy/rest/service_stub.rb b/owl-bot-staging/google-iam-v1/lib/google/iam/v1/iam_policy/rest/service_stub.rb deleted file mode 100644 index d64e9eeb27e1..000000000000 --- a/owl-bot-staging/google-iam-v1/lib/google/iam/v1/iam_policy/rest/service_stub.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 "google/iam/v1/iam_policy_pb" - -module Google - module Iam - module V1 - module IAMPolicy - module Rest - ## - # REST service stub for the IAMPolicy 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: false, - 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 set_iam_policy REST call - # - # @param request_pb [::Google::Iam::V1::SetIamPolicyRequest] - # 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. - # @param bindings_override [::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>, nil] - # Binding overrides for the transcoding. Only used internally. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Iam::V1::Policy] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Iam::V1::Policy] - # A result object deserialized from the server's reply - def set_iam_policy request_pb, options = nil, bindings_override: nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_set_iam_policy_request request_pb, bindings_override: bindings_override - 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: "set_iam_policy", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Iam::V1::Policy.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_iam_policy REST call - # - # @param request_pb [::Google::Iam::V1::GetIamPolicyRequest] - # 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. - # @param bindings_override [::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>, nil] - # Binding overrides for the transcoding. Only used internally. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Iam::V1::Policy] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Iam::V1::Policy] - # A result object deserialized from the server's reply - def get_iam_policy request_pb, options = nil, bindings_override: nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_iam_policy_request request_pb, bindings_override: bindings_override - 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_iam_policy", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Iam::V1::Policy.decode_json response.body, ignore_unknown_fields: true - catch :response do - yield result, operation if block_given? - result - end - end - - ## - # Baseline implementation for the test_iam_permissions REST call - # - # @param request_pb [::Google::Iam::V1::TestIamPermissionsRequest] - # 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. - # @param bindings_override [::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>, nil] - # Binding overrides for the transcoding. Only used internally. - # - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Iam::V1::TestIamPermissionsResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Iam::V1::TestIamPermissionsResponse] - # A result object deserialized from the server's reply - def test_iam_permissions request_pb, options = nil, bindings_override: nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_test_iam_permissions_request request_pb, bindings_override: bindings_override - 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: "test_iam_permissions", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Iam::V1::TestIamPermissionsResponse.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 set_iam_policy REST call - # - # @param request_pb [::Google::Iam::V1::SetIamPolicyRequest] - # A request object representing the call parameters. Required. - # @param bindings_override [::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>, nil] - # Binding overrides for the transcoding. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_set_iam_policy_request request_pb, bindings_override: nil - transcoder = Gapic::Rest::GrpcTranscoder.new(bindings_override) if bindings_override - transcoder ||= Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{resource}:setIamPolicy", - body: "*", - matches: [ - ["resource", %r{^.*$}, true] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_iam_policy REST call - # - # @param request_pb [::Google::Iam::V1::GetIamPolicyRequest] - # A request object representing the call parameters. Required. - # @param bindings_override [::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>, nil] - # Binding overrides for the transcoding. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_get_iam_policy_request request_pb, bindings_override: nil - transcoder = Gapic::Rest::GrpcTranscoder.new(bindings_override) if bindings_override - transcoder ||= Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{resource}:getIamPolicy", - body: "*", - matches: [ - ["resource", %r{^.*$}, true] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the test_iam_permissions REST call - # - # @param request_pb [::Google::Iam::V1::TestIamPermissionsRequest] - # A request object representing the call parameters. Required. - # @param bindings_override [::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>, nil] - # Binding overrides for the transcoding. - # @return [Array(String, [String, nil], Hash{String => String})] - # Uri, Body, Query string parameters - def self.transcode_test_iam_permissions_request request_pb, bindings_override: nil - transcoder = Gapic::Rest::GrpcTranscoder.new(bindings_override) if bindings_override - transcoder ||= Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v1/{resource}:testIamPermissions", - body: "*", - matches: [ - ["resource", %r{^.*$}, true] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-iam-v1/lib/google/iam/v1/iam_policy_pb.rb b/owl-bot-staging/google-iam-v1/lib/google/iam/v1/iam_policy_pb.rb deleted file mode 100644 index 31791896cf09..000000000000 --- a/owl-bot-staging/google-iam-v1/lib/google/iam/v1/iam_policy_pb.rb +++ /dev/null @@ -1,30 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/iam/v1/iam_policy.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/iam/v1/options_pb' -require 'google/iam/v1/policy_pb' -require 'google/protobuf/field_mask_pb' - - -descriptor_data = "\n\x1egoogle/iam/v1/iam_policy.proto\x12\rgoogle.iam.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x1bgoogle/iam/v1/options.proto\x1a\x1agoogle/iam/v1/policy.proto\x1a google/protobuf/field_mask.proto\"\x8f\x01\n\x13SetIamPolicyRequest\x12\x1b\n\x08resource\x18\x01 \x01(\tB\t\xe0\x41\x02\xfa\x41\x03\n\x01*\x12*\n\x06policy\x18\x02 \x01(\x0b\x32\x15.google.iam.v1.PolicyB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\"d\n\x13GetIamPolicyRequest\x12\x1b\n\x08resource\x18\x01 \x01(\tB\t\xe0\x41\x02\xfa\x41\x03\n\x01*\x12\x30\n\x07options\x18\x02 \x01(\x0b\x32\x1f.google.iam.v1.GetPolicyOptions\"R\n\x19TestIamPermissionsRequest\x12\x1b\n\x08resource\x18\x01 \x01(\tB\t\xe0\x41\x02\xfa\x41\x03\n\x01*\x12\x18\n\x0bpermissions\x18\x02 \x03(\tB\x03\xe0\x41\x02\"1\n\x1aTestIamPermissionsResponse\x12\x13\n\x0bpermissions\x18\x01 \x03(\t2\xb4\x03\n\tIAMPolicy\x12t\n\x0cSetIamPolicy\x12\".google.iam.v1.SetIamPolicyRequest\x1a\x15.google.iam.v1.Policy\")\x82\xd3\xe4\x93\x02#\"\x1e/v1/{resource=**}:setIamPolicy:\x01*\x12t\n\x0cGetIamPolicy\x12\".google.iam.v1.GetIamPolicyRequest\x1a\x15.google.iam.v1.Policy\")\x82\xd3\xe4\x93\x02#\"\x1e/v1/{resource=**}:getIamPolicy:\x01*\x12\x9a\x01\n\x12TestIamPermissions\x12(.google.iam.v1.TestIamPermissionsRequest\x1a).google.iam.v1.TestIamPermissionsResponse\"/\x82\xd3\xe4\x93\x02)\"$/v1/{resource=**}:testIamPermissions:\x01*\x1a\x1e\xca\x41\x1biam-meta-api.googleapis.comB|\n\x11\x63om.google.iam.v1B\x0eIamPolicyProtoP\x01Z)cloud.google.com/go/iam/apiv1/iampb;iampb\xaa\x02\x13Google.Cloud.Iam.V1\xca\x02\x13Google\\Cloud\\Iam\\V1b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Iam - module V1 - SetIamPolicyRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.iam.v1.SetIamPolicyRequest").msgclass - GetIamPolicyRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.iam.v1.GetIamPolicyRequest").msgclass - TestIamPermissionsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.iam.v1.TestIamPermissionsRequest").msgclass - TestIamPermissionsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.iam.v1.TestIamPermissionsResponse").msgclass - end - end -end diff --git a/owl-bot-staging/google-iam-v1/lib/google/iam/v1/iam_policy_services_pb.rb b/owl-bot-staging/google-iam-v1/lib/google/iam/v1/iam_policy_services_pb.rb deleted file mode 100644 index 45ac992e8c4e..000000000000 --- a/owl-bot-staging/google-iam-v1/lib/google/iam/v1/iam_policy_services_pb.rb +++ /dev/null @@ -1,82 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# Source: google/iam/v1/iam_policy.proto for package 'google.iam.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/iam/v1/iam_policy_pb' - -module Google - module Iam - module V1 - module IAMPolicy - # API Overview - # - # Manages Identity and Access Management (IAM) policies. - # - # Any implementation of an API that offers access control features - # implements the google.iam.v1.IAMPolicy interface. - # - # ## Data model - # - # Access control is applied when a principal (user or service account), takes - # some action on a resource exposed by a service. Resources, identified by - # URI-like names, are the unit of access control specification. Service - # implementations can choose the granularity of access control and the - # supported permissions for their resources. - # For example one database service may allow access control to be - # specified only at the Table level, whereas another might allow access control - # to also be specified at the Column level. - # - # ## Policy Structure - # - # See google.iam.v1.Policy - # - # This is intentionally not a CRUD style API because access control policies - # are created and deleted implicitly with the resources to which they are - # attached. - class Service - - include ::GRPC::GenericService - - self.marshal_class_method = :encode - self.unmarshal_class_method = :decode - self.service_name = 'google.iam.v1.IAMPolicy' - - # Sets the access control policy on the specified resource. Replaces any - # existing policy. - # - # Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` errors. - rpc :SetIamPolicy, ::Google::Iam::V1::SetIamPolicyRequest, ::Google::Iam::V1::Policy - # Gets the access control policy for a resource. - # Returns an empty policy if the resource exists and does not have a policy - # set. - rpc :GetIamPolicy, ::Google::Iam::V1::GetIamPolicyRequest, ::Google::Iam::V1::Policy - # Returns permissions that a caller has on the specified resource. - # If the resource does not exist, this will return an empty set of - # permissions, not a `NOT_FOUND` error. - # - # Note: This operation is designed to be used for building permission-aware - # UIs and command-line tools, not for authorization checking. This operation - # may "fail open" without warning. - rpc :TestIamPermissions, ::Google::Iam::V1::TestIamPermissionsRequest, ::Google::Iam::V1::TestIamPermissionsResponse - end - - Stub = Service.rpc_stub_class - end - end - end -end diff --git a/owl-bot-staging/google-iam-v1/lib/google/iam/v1/logging/audit_data_pb.rb b/owl-bot-staging/google-iam-v1/lib/google/iam/v1/logging/audit_data_pb.rb deleted file mode 100644 index bc90a33663bc..000000000000 --- a/owl-bot-staging/google-iam-v1/lib/google/iam/v1/logging/audit_data_pb.rb +++ /dev/null @@ -1,23 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/iam/v1/logging/audit_data.proto - -require 'google/protobuf' - -require 'google/iam/v1/policy_pb' - - -descriptor_data = "\n&google/iam/v1/logging/audit_data.proto\x12\x15google.iam.v1.logging\x1a\x1agoogle/iam/v1/policy.proto\"=\n\tAuditData\x12\x30\n\x0cpolicy_delta\x18\x02 \x01(\x0b\x32\x1a.google.iam.v1.PolicyDeltaB\x86\x01\n\x19\x63om.google.iam.v1.loggingB\x0e\x41uditDataProtoP\x01Z9cloud.google.com/go/iam/apiv1/logging/loggingpb;loggingpb\xaa\x02\x1bGoogle.Cloud.Iam.V1.Loggingb\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Iam - module V1 - module Logging - AuditData = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.iam.v1.logging.AuditData").msgclass - end - end - end -end diff --git a/owl-bot-staging/google-iam-v1/lib/google/iam/v1/options_pb.rb b/owl-bot-staging/google-iam-v1/lib/google/iam/v1/options_pb.rb deleted file mode 100644 index 8293db38efdc..000000000000 --- a/owl-bot-staging/google-iam-v1/lib/google/iam/v1/options_pb.rb +++ /dev/null @@ -1,19 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/iam/v1/options.proto - -require 'google/protobuf' - - -descriptor_data = "\n\x1bgoogle/iam/v1/options.proto\x12\rgoogle.iam.v1\"4\n\x10GetPolicyOptions\x12 \n\x18requested_policy_version\x18\x01 \x01(\x05\x42}\n\x11\x63om.google.iam.v1B\x0cOptionsProtoP\x01Z)cloud.google.com/go/iam/apiv1/iampb;iampb\xf8\x01\x01\xaa\x02\x13Google.Cloud.Iam.V1\xca\x02\x13Google\\Cloud\\Iam\\V1b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Iam - module V1 - GetPolicyOptions = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.iam.v1.GetPolicyOptions").msgclass - end - end -end diff --git a/owl-bot-staging/google-iam-v1/lib/google/iam/v1/policy_pb.rb b/owl-bot-staging/google-iam-v1/lib/google/iam/v1/policy_pb.rb deleted file mode 100644 index 4347360a984e..000000000000 --- a/owl-bot-staging/google-iam-v1/lib/google/iam/v1/policy_pb.rb +++ /dev/null @@ -1,30 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/iam/v1/policy.proto - -require 'google/protobuf' - -require 'google/type/expr_pb' - - -descriptor_data = "\n\x1agoogle/iam/v1/policy.proto\x12\rgoogle.iam.v1\x1a\x16google/type/expr.proto\"\x84\x01\n\x06Policy\x12\x0f\n\x07version\x18\x01 \x01(\x05\x12(\n\x08\x62indings\x18\x04 \x03(\x0b\x32\x16.google.iam.v1.Binding\x12\x31\n\raudit_configs\x18\x06 \x03(\x0b\x32\x1a.google.iam.v1.AuditConfig\x12\x0c\n\x04\x65tag\x18\x03 \x01(\x0c\"N\n\x07\x42inding\x12\x0c\n\x04role\x18\x01 \x01(\t\x12\x0f\n\x07members\x18\x02 \x03(\t\x12$\n\tcondition\x18\x03 \x01(\x0b\x32\x11.google.type.Expr\"X\n\x0b\x41uditConfig\x12\x0f\n\x07service\x18\x01 \x01(\t\x12\x38\n\x11\x61udit_log_configs\x18\x03 \x03(\x0b\x32\x1d.google.iam.v1.AuditLogConfig\"\xb7\x01\n\x0e\x41uditLogConfig\x12\x37\n\x08log_type\x18\x01 \x01(\x0e\x32%.google.iam.v1.AuditLogConfig.LogType\x12\x18\n\x10\x65xempted_members\x18\x02 \x03(\t\"R\n\x07LogType\x12\x18\n\x14LOG_TYPE_UNSPECIFIED\x10\x00\x12\x0e\n\nADMIN_READ\x10\x01\x12\x0e\n\nDATA_WRITE\x10\x02\x12\r\n\tDATA_READ\x10\x03\"\x80\x01\n\x0bPolicyDelta\x12\x33\n\x0e\x62inding_deltas\x18\x01 \x03(\x0b\x32\x1b.google.iam.v1.BindingDelta\x12<\n\x13\x61udit_config_deltas\x18\x02 \x03(\x0b\x32\x1f.google.iam.v1.AuditConfigDelta\"\xbd\x01\n\x0c\x42indingDelta\x12\x32\n\x06\x61\x63tion\x18\x01 \x01(\x0e\x32\".google.iam.v1.BindingDelta.Action\x12\x0c\n\x04role\x18\x02 \x01(\t\x12\x0e\n\x06member\x18\x03 \x01(\t\x12$\n\tcondition\x18\x04 \x01(\x0b\x32\x11.google.type.Expr\"5\n\x06\x41\x63tion\x12\x16\n\x12\x41\x43TION_UNSPECIFIED\x10\x00\x12\x07\n\x03\x41\x44\x44\x10\x01\x12\n\n\x06REMOVE\x10\x02\"\xbd\x01\n\x10\x41uditConfigDelta\x12\x36\n\x06\x61\x63tion\x18\x01 \x01(\x0e\x32&.google.iam.v1.AuditConfigDelta.Action\x12\x0f\n\x07service\x18\x02 \x01(\t\x12\x17\n\x0f\x65xempted_member\x18\x03 \x01(\t\x12\x10\n\x08log_type\x18\x04 \x01(\t\"5\n\x06\x41\x63tion\x12\x16\n\x12\x41\x43TION_UNSPECIFIED\x10\x00\x12\x07\n\x03\x41\x44\x44\x10\x01\x12\n\n\x06REMOVE\x10\x02\x42|\n\x11\x63om.google.iam.v1B\x0bPolicyProtoP\x01Z)cloud.google.com/go/iam/apiv1/iampb;iampb\xf8\x01\x01\xaa\x02\x13Google.Cloud.Iam.V1\xca\x02\x13Google\\Cloud\\Iam\\V1b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Iam - module V1 - Policy = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.iam.v1.Policy").msgclass - Binding = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.iam.v1.Binding").msgclass - AuditConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.iam.v1.AuditConfig").msgclass - AuditLogConfig = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.iam.v1.AuditLogConfig").msgclass - AuditLogConfig::LogType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.iam.v1.AuditLogConfig.LogType").enummodule - PolicyDelta = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.iam.v1.PolicyDelta").msgclass - BindingDelta = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.iam.v1.BindingDelta").msgclass - BindingDelta::Action = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.iam.v1.BindingDelta.Action").enummodule - AuditConfigDelta = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.iam.v1.AuditConfigDelta").msgclass - AuditConfigDelta::Action = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.iam.v1.AuditConfigDelta.Action").enummodule - end - end -end diff --git a/owl-bot-staging/google-iam-v1/lib/google/iam/v1/resource_policy_member_pb.rb b/owl-bot-staging/google-iam-v1/lib/google/iam/v1/resource_policy_member_pb.rb deleted file mode 100644 index 21ae4b08c8dc..000000000000 --- a/owl-bot-staging/google-iam-v1/lib/google/iam/v1/resource_policy_member_pb.rb +++ /dev/null @@ -1,21 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/iam/v1/resource_policy_member.proto - -require 'google/protobuf' - -require 'google/api/field_behavior_pb' - - -descriptor_data = "\n*google/iam/v1/resource_policy_member.proto\x12\rgoogle.iam.v1\x1a\x1fgoogle/api/field_behavior.proto\"e\n\x14ResourcePolicyMember\x12&\n\x19iam_policy_name_principal\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12%\n\x18iam_policy_uid_principal\x18\x02 \x01(\tB\x03\xe0\x41\x03\x42\x87\x01\n\x11\x63om.google.iam.v1B\x19ResourcePolicyMemberProtoP\x01Z)cloud.google.com/go/iam/apiv1/iampb;iampb\xaa\x02\x13Google.Cloud.Iam.V1\xca\x02\x13Google\\Cloud\\Iam\\V1b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Iam - module V1 - ResourcePolicyMember = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.iam.v1.ResourcePolicyMember").msgclass - end - end -end diff --git a/owl-bot-staging/google-iam-v1/lib/google/iam/v1/rest.rb b/owl-bot-staging/google-iam-v1/lib/google/iam/v1/rest.rb deleted file mode 100644 index 6c154f17a54d..000000000000 --- a/owl-bot-staging/google-iam-v1/lib/google/iam/v1/rest.rb +++ /dev/null @@ -1,35 +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/iam/v1/iam_policy/rest" -require "google/iam/v1/version" - -module Google - module Iam - ## - # To load just the REST part of this package, including all its services, and instantiate a REST client: - # - # @example - # - # require "google/iam/v1/rest" - # client = ::Google::Iam::V1::IAMPolicy::Rest::Client.new - # - module V1 - end - end -end diff --git a/owl-bot-staging/google-iam-v1/lib/google/iam/v1/version.rb b/owl-bot-staging/google-iam-v1/lib/google/iam/v1/version.rb deleted file mode 100644 index b2a1323c8493..000000000000 --- a/owl-bot-staging/google-iam-v1/lib/google/iam/v1/version.rb +++ /dev/null @@ -1,26 +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 Iam - module V1 - VERSION = "0.0.1" - end - end -end diff --git a/owl-bot-staging/google-iam-v1/proto_docs/README.md b/owl-bot-staging/google-iam-v1/proto_docs/README.md deleted file mode 100644 index d9dc948b945f..000000000000 --- a/owl-bot-staging/google-iam-v1/proto_docs/README.md +++ /dev/null @@ -1,4 +0,0 @@ -# IAM 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-iam-v1/proto_docs/google/api/client.rb b/owl-bot-staging/google-iam-v1/proto_docs/google/api/client.rb deleted file mode 100644 index 3ab0b096d445..000000000000 --- a/owl-bot-staging/google-iam-v1/proto_docs/google/api/client.rb +++ /dev/null @@ -1,593 +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. - # - # Note: This field should not be used in most cases. - 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: - # library_settings: - # 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. - # @!attribute [rw] library_package - # @return [::String] - # The package name to use in Php. Clobbers the php_namespace option - # set in the protobuf. This should be used **only** by APIs - # who have already set the language_settings.php.package_name" field - # in gapic.yaml. API teams should use the protobuf php_namespace option - # where possible. - # - # Example of a YAML configuration:: - # - # publishing: - # library_settings: - # php_settings: - # library_package: Google\Cloud\PubSub\V1 - 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. - # - # Example: - # - # 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 - # @!attribute [rw] batching - # @return [::Google::Api::BatchingConfigProto] - # Batching configuration for an API method in client libraries. - # - # Example of a YAML configuration: - # - # publishing: - # method_settings: - # - selector: google.example.v1.ExampleService.BatchCreateExample - # batching: - # element_count_threshold: 1000 - # request_byte_threshold: 100000000 - # delay_threshold_millis: 10 - 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. - # - # Note: This feature should not be used in most cases. - # @!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 - - # `BatchingConfigProto` defines the batching configuration for an API method. - # @!attribute [rw] thresholds - # @return [::Google::Api::BatchingSettingsProto] - # The thresholds which trigger a batched request to be sent. - # @!attribute [rw] batch_descriptor - # @return [::Google::Api::BatchingDescriptorProto] - # The request and response fields used in batching. - class BatchingConfigProto - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # `BatchingSettingsProto` specifies a set of batching thresholds, each of - # which acts as a trigger to send a batch of messages as a request. At least - # one threshold must be positive nonzero. - # @!attribute [rw] element_count_threshold - # @return [::Integer] - # The number of elements of a field collected into a batch which, if - # exceeded, causes the batch to be sent. - # @!attribute [rw] request_byte_threshold - # @return [::Integer] - # The aggregated size of the batched field which, if exceeded, causes the - # batch to be sent. This size is computed by aggregating the sizes of the - # request field to be batched, not of the entire request message. - # @!attribute [rw] delay_threshold - # @return [::Google::Protobuf::Duration] - # The duration after which a batch should be sent, starting from the addition - # of the first message to that batch. - # @!attribute [rw] element_count_limit - # @return [::Integer] - # The maximum number of elements collected in a batch that could be accepted - # by server. - # @!attribute [rw] request_byte_limit - # @return [::Integer] - # The maximum size of the request that could be accepted by server. - # @!attribute [rw] flow_control_element_limit - # @return [::Integer] - # The maximum number of elements allowed by flow control. - # @!attribute [rw] flow_control_byte_limit - # @return [::Integer] - # The maximum size of data allowed by flow control. - # @!attribute [rw] flow_control_limit_exceeded_behavior - # @return [::Google::Api::FlowControlLimitExceededBehaviorProto] - # The behavior to take when the flow control limit is exceeded. - class BatchingSettingsProto - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # `BatchingDescriptorProto` specifies the fields of the request message to be - # used for batching, and, optionally, the fields of the response message to be - # used for demultiplexing. - # @!attribute [rw] batched_field - # @return [::String] - # The repeated field in the request message to be aggregated by batching. - # @!attribute [rw] discriminator_fields - # @return [::Array<::String>] - # A list of the fields in the request message. Two requests will be batched - # together only if the values of every field specified in - # `request_discriminator_fields` is equal between the two requests. - # @!attribute [rw] subresponse_field - # @return [::String] - # Optional. When present, indicates the field in the response message to be - # used to demultiplex the response into multiple response messages, in - # correspondence with the multiple request messages originally batched - # together. - class BatchingDescriptorProto - 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 - - # The behavior to take when the flow control limit is exceeded. - module FlowControlLimitExceededBehaviorProto - # Default behavior, system-defined. - UNSET_BEHAVIOR = 0 - - # Stop operation, raise error. - THROW_EXCEPTION = 1 - - # Pause operation until limit clears. - BLOCK = 2 - - # Continue operation, disregard limit. - IGNORE = 3 - end - end -end diff --git a/owl-bot-staging/google-iam-v1/proto_docs/google/api/field_behavior.rb b/owl-bot-staging/google-iam-v1/proto_docs/google/api/field_behavior.rb deleted file mode 100644 index 582be187d115..000000000000 --- a/owl-bot-staging/google-iam-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-iam-v1/proto_docs/google/api/launch_stage.rb b/owl-bot-staging/google-iam-v1/proto_docs/google/api/launch_stage.rb deleted file mode 100644 index 9392a413fb1b..000000000000 --- a/owl-bot-staging/google-iam-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-iam-v1/proto_docs/google/api/resource.rb b/owl-bot-staging/google-iam-v1/proto_docs/google/api/resource.rb deleted file mode 100644 index 25dec4847ac1..000000000000 --- a/owl-bot-staging/google-iam-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-iam-v1/proto_docs/google/iam/v1/iam_policy.rb b/owl-bot-staging/google-iam-v1/proto_docs/google/iam/v1/iam_policy.rb deleted file mode 100644 index 5445c77f8258..000000000000 --- a/owl-bot-staging/google-iam-v1/proto_docs/google/iam/v1/iam_policy.rb +++ /dev/null @@ -1,87 +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 Iam - module V1 - # Request message for `SetIamPolicy` method. - # @!attribute [rw] resource - # @return [::String] - # REQUIRED: The resource for which the policy is being specified. - # See the operation documentation for the appropriate value for this field. - # @!attribute [rw] policy - # @return [::Google::Iam::V1::Policy] - # REQUIRED: The complete policy to be applied to the `resource`. The size of - # the policy is limited to a few 10s of KB. An empty policy is a - # valid policy but certain Cloud Platform services (such as Projects) - # might reject them. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only - # the fields in the mask will be modified. If no mask is provided, the - # following default mask is used: - # - # `paths: "bindings, etag"` - class SetIamPolicyRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for `GetIamPolicy` method. - # @!attribute [rw] resource - # @return [::String] - # REQUIRED: The resource for which the policy is being requested. - # See the operation documentation for the appropriate value for this field. - # @!attribute [rw] options - # @return [::Google::Iam::V1::GetPolicyOptions] - # OPTIONAL: A `GetPolicyOptions` object for specifying options to - # `GetIamPolicy`. - class GetIamPolicyRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for `TestIamPermissions` method. - # @!attribute [rw] resource - # @return [::String] - # REQUIRED: The resource for which the policy detail is being requested. - # See the operation documentation for the appropriate value for this field. - # @!attribute [rw] permissions - # @return [::Array<::String>] - # The set of permissions to check for the `resource`. Permissions with - # wildcards (such as '*' or 'storage.*') are not allowed. For more - # information see - # [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions). - class TestIamPermissionsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for `TestIamPermissions` method. - # @!attribute [rw] permissions - # @return [::Array<::String>] - # A subset of `TestPermissionsRequest.permissions` that the caller is - # allowed. - class TestIamPermissionsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end -end diff --git a/owl-bot-staging/google-iam-v1/proto_docs/google/iam/v1/options.rb b/owl-bot-staging/google-iam-v1/proto_docs/google/iam/v1/options.rb deleted file mode 100644 index 60713d995b86..000000000000 --- a/owl-bot-staging/google-iam-v1/proto_docs/google/iam/v1/options.rb +++ /dev/null @@ -1,50 +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 Iam - module V1 - # Encapsulates settings provided to GetIamPolicy. - # @!attribute [rw] requested_policy_version - # @return [::Integer] - # Optional. The maximum policy version that will be used to format the - # policy. - # - # Valid values are 0, 1, and 3. Requests specifying an invalid value will be - # rejected. - # - # Requests for policies with any conditional role bindings must specify - # version 3. Policies with no conditional role bindings may specify any valid - # value or leave the field unset. - # - # The policy in the response might use the policy version that you specified, - # or it might use a lower policy version. For example, if you specify version - # 3, but the policy has no conditional role bindings, the response uses - # version 1. - # - # To learn which resources support conditions in their IAM policies, see the - # [IAM - # documentation](https://cloud.google.com/iam/help/conditions/resource-policies). - class GetPolicyOptions - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end -end diff --git a/owl-bot-staging/google-iam-v1/proto_docs/google/iam/v1/policy.rb b/owl-bot-staging/google-iam-v1/proto_docs/google/iam/v1/policy.rb deleted file mode 100644 index d693e0c6371c..000000000000 --- a/owl-bot-staging/google-iam-v1/proto_docs/google/iam/v1/policy.rb +++ /dev/null @@ -1,426 +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 Iam - module V1 - # An Identity and Access Management (IAM) policy, which specifies access - # controls for Google Cloud resources. - # - # - # A `Policy` is a collection of `bindings`. A `binding` binds one or more - # `members`, or principals, to a single `role`. Principals can be user - # accounts, service accounts, Google groups, and domains (such as G Suite). A - # `role` is a named list of permissions; each `role` can be an IAM predefined - # role or a user-created custom role. - # - # For some types of Google Cloud resources, a `binding` can also specify a - # `condition`, which is a logical expression that allows access to a resource - # only if the expression evaluates to `true`. A condition can add constraints - # based on attributes of the request, the resource, or both. To learn which - # resources support conditions in their IAM policies, see the - # [IAM - # documentation](https://cloud.google.com/iam/help/conditions/resource-policies). - # - # **JSON example:** - # - # ``` - # { - # "bindings": [ - # { - # "role": "roles/resourcemanager.organizationAdmin", - # "members": [ - # "user:mike@example.com", - # "group:admins@example.com", - # "domain:google.com", - # "serviceAccount:my-project-id@appspot.gserviceaccount.com" - # ] - # }, - # { - # "role": "roles/resourcemanager.organizationViewer", - # "members": [ - # "user:eve@example.com" - # ], - # "condition": { - # "title": "expirable access", - # "description": "Does not grant access after Sep 2020", - # "expression": "request.time < - # timestamp('2020-10-01T00:00:00.000Z')", - # } - # } - # ], - # "etag": "BwWWja0YfJA=", - # "version": 3 - # } - # ``` - # - # **YAML example:** - # - # ``` - # bindings: - # - members: - # - user:mike@example.com - # - group:admins@example.com - # - domain:google.com - # - serviceAccount:my-project-id@appspot.gserviceaccount.com - # role: roles/resourcemanager.organizationAdmin - # - members: - # - user:eve@example.com - # role: roles/resourcemanager.organizationViewer - # condition: - # title: expirable access - # description: Does not grant access after Sep 2020 - # expression: request.time < timestamp('2020-10-01T00:00:00.000Z') - # etag: BwWWja0YfJA= - # version: 3 - # ``` - # - # For a description of IAM and its features, see the - # [IAM documentation](https://cloud.google.com/iam/docs/). - # @!attribute [rw] version - # @return [::Integer] - # Specifies the format of the policy. - # - # Valid values are `0`, `1`, and `3`. Requests that specify an invalid value - # are rejected. - # - # Any operation that affects conditional role bindings must specify version - # `3`. This requirement applies to the following operations: - # - # * Getting a policy that includes a conditional role binding - # * Adding a conditional role binding to a policy - # * Changing a conditional role binding in a policy - # * Removing any role binding, with or without a condition, from a policy - # that includes conditions - # - # **Important:** If you use IAM Conditions, you must include the `etag` field - # whenever you call `setIamPolicy`. If you omit this field, then IAM allows - # you to overwrite a version `3` policy with a version `1` policy, and all of - # the conditions in the version `3` policy are lost. - # - # If a policy does not include any conditions, operations on that policy may - # specify any valid version or leave the field unset. - # - # To learn which resources support conditions in their IAM policies, see the - # [IAM - # documentation](https://cloud.google.com/iam/help/conditions/resource-policies). - # @!attribute [rw] bindings - # @return [::Array<::Google::Iam::V1::Binding>] - # Associates a list of `members`, or principals, with a `role`. Optionally, - # may specify a `condition` that determines how and when the `bindings` are - # applied. Each of the `bindings` must contain at least one principal. - # - # The `bindings` in a `Policy` can refer to up to 1,500 principals; up to 250 - # of these principals can be Google groups. Each occurrence of a principal - # counts towards these limits. For example, if the `bindings` grant 50 - # different roles to `user:alice@example.com`, and not to any other - # principal, then you can add another 1,450 principals to the `bindings` in - # the `Policy`. - # @!attribute [rw] audit_configs - # @return [::Array<::Google::Iam::V1::AuditConfig>] - # Specifies cloud audit logging configuration for this policy. - # @!attribute [rw] etag - # @return [::String] - # `etag` is used for optimistic concurrency control as a way to help - # prevent simultaneous updates of a policy from overwriting each other. - # It is strongly suggested that systems make use of the `etag` in the - # read-modify-write cycle to perform policy updates in order to avoid race - # conditions: An `etag` is returned in the response to `getIamPolicy`, and - # systems are expected to put that etag in the request to `setIamPolicy` to - # ensure that their change will be applied to the same version of the policy. - # - # **Important:** If you use IAM Conditions, you must include the `etag` field - # whenever you call `setIamPolicy`. If you omit this field, then IAM allows - # you to overwrite a version `3` policy with a version `1` policy, and all of - # the conditions in the version `3` policy are lost. - class Policy - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Associates `members`, or principals, with a `role`. - # @!attribute [rw] role - # @return [::String] - # Role that is assigned to the list of `members`, or principals. - # For example, `roles/viewer`, `roles/editor`, or `roles/owner`. - # @!attribute [rw] members - # @return [::Array<::String>] - # Specifies the principals requesting access for a Google Cloud resource. - # `members` can have the following values: - # - # * `allUsers`: A special identifier that represents anyone who is - # on the internet; with or without a Google account. - # - # * `allAuthenticatedUsers`: A special identifier that represents anyone - # who is authenticated with a Google account or a service account. - # - # * `user:{emailid}`: An email address that represents a specific Google - # account. For example, `alice@example.com` . - # - # - # * `serviceAccount:{emailid}`: An email address that represents a service - # account. For example, `my-other-app@appspot.gserviceaccount.com`. - # - # * `group:{emailid}`: An email address that represents a Google group. - # For example, `admins@example.com`. - # - # * `deleted:user:{emailid}?uid={uniqueid}`: An email address (plus unique - # identifier) representing a user that has been recently deleted. For - # example, `alice@example.com?uid=123456789012345678901`. If the user is - # recovered, this value reverts to `user:{emailid}` and the recovered user - # retains the role in the binding. - # - # * `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address (plus - # unique identifier) representing a service account that has been recently - # deleted. For example, - # `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`. - # If the service account is undeleted, this value reverts to - # `serviceAccount:{emailid}` and the undeleted service account retains the - # role in the binding. - # - # * `deleted:group:{emailid}?uid={uniqueid}`: An email address (plus unique - # identifier) representing a Google group that has been recently - # deleted. For example, `admins@example.com?uid=123456789012345678901`. If - # the group is recovered, this value reverts to `group:{emailid}` and the - # recovered group retains the role in the binding. - # - # - # * `domain:{domain}`: The G Suite domain (primary) that represents all the - # users of that domain. For example, `google.com` or `example.com`. - # @!attribute [rw] condition - # @return [::Google::Type::Expr] - # The condition that is associated with this binding. - # - # If the condition evaluates to `true`, then this binding applies to the - # current request. - # - # If the condition evaluates to `false`, then this binding does not apply to - # the current request. However, a different role binding might grant the same - # role to one or more of the principals in this binding. - # - # To learn which resources support conditions in their IAM policies, see the - # [IAM - # documentation](https://cloud.google.com/iam/help/conditions/resource-policies). - class Binding - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Specifies the audit configuration for a service. - # The configuration determines which permission types are logged, and what - # identities, if any, are exempted from logging. - # An AuditConfig must have one or more AuditLogConfigs. - # - # If there are AuditConfigs for both `allServices` and a specific service, - # the union of the two AuditConfigs is used for that service: the log_types - # specified in each AuditConfig are enabled, and the exempted_members in each - # AuditLogConfig are exempted. - # - # Example Policy with multiple AuditConfigs: - # - # { - # "audit_configs": [ - # { - # "service": "allServices", - # "audit_log_configs": [ - # { - # "log_type": "DATA_READ", - # "exempted_members": [ - # "user:jose@example.com" - # ] - # }, - # { - # "log_type": "DATA_WRITE" - # }, - # { - # "log_type": "ADMIN_READ" - # } - # ] - # }, - # { - # "service": "sampleservice.googleapis.com", - # "audit_log_configs": [ - # { - # "log_type": "DATA_READ" - # }, - # { - # "log_type": "DATA_WRITE", - # "exempted_members": [ - # "user:aliya@example.com" - # ] - # } - # ] - # } - # ] - # } - # - # For sampleservice, this policy enables DATA_READ, DATA_WRITE and ADMIN_READ - # logging. It also exempts `jose@example.com` from DATA_READ logging, and - # `aliya@example.com` from DATA_WRITE logging. - # @!attribute [rw] service - # @return [::String] - # Specifies a service that will be enabled for audit logging. - # For example, `storage.googleapis.com`, `cloudsql.googleapis.com`. - # `allServices` is a special value that covers all services. - # @!attribute [rw] audit_log_configs - # @return [::Array<::Google::Iam::V1::AuditLogConfig>] - # The configuration for logging of each type of permission. - class AuditConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Provides the configuration for logging a type of permissions. - # Example: - # - # { - # "audit_log_configs": [ - # { - # "log_type": "DATA_READ", - # "exempted_members": [ - # "user:jose@example.com" - # ] - # }, - # { - # "log_type": "DATA_WRITE" - # } - # ] - # } - # - # This enables 'DATA_READ' and 'DATA_WRITE' logging, while exempting - # jose@example.com from DATA_READ logging. - # @!attribute [rw] log_type - # @return [::Google::Iam::V1::AuditLogConfig::LogType] - # The log type that this config enables. - # @!attribute [rw] exempted_members - # @return [::Array<::String>] - # Specifies the identities that do not cause logging for this type of - # permission. - # Follows the same format of - # {::Google::Iam::V1::Binding#members Binding.members}. - class AuditLogConfig - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The list of valid permission types for which logging can be configured. - # Admin writes are always logged, and are not configurable. - module LogType - # Default case. Should never be this. - LOG_TYPE_UNSPECIFIED = 0 - - # Admin reads. Example: CloudIAM getIamPolicy - ADMIN_READ = 1 - - # Data writes. Example: CloudSQL Users create - DATA_WRITE = 2 - - # Data reads. Example: CloudSQL Users list - DATA_READ = 3 - end - end - - # The difference delta between two policies. - # @!attribute [rw] binding_deltas - # @return [::Array<::Google::Iam::V1::BindingDelta>] - # The delta for Bindings between two policies. - # @!attribute [rw] audit_config_deltas - # @return [::Array<::Google::Iam::V1::AuditConfigDelta>] - # The delta for AuditConfigs between two policies. - class PolicyDelta - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # One delta entry for Binding. Each individual change (only one member in each - # entry) to a binding will be a separate entry. - # @!attribute [rw] action - # @return [::Google::Iam::V1::BindingDelta::Action] - # The action that was performed on a Binding. - # Required - # @!attribute [rw] role - # @return [::String] - # Role that is assigned to `members`. - # For example, `roles/viewer`, `roles/editor`, or `roles/owner`. - # Required - # @!attribute [rw] member - # @return [::String] - # A single identity requesting access for a Google Cloud resource. - # Follows the same format of Binding.members. - # Required - # @!attribute [rw] condition - # @return [::Google::Type::Expr] - # The condition that is associated with this binding. - class BindingDelta - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The type of action performed on a Binding in a policy. - module Action - # Unspecified. - ACTION_UNSPECIFIED = 0 - - # Addition of a Binding. - ADD = 1 - - # Removal of a Binding. - REMOVE = 2 - end - end - - # One delta entry for AuditConfig. Each individual change (only one - # exempted_member in each entry) to a AuditConfig will be a separate entry. - # @!attribute [rw] action - # @return [::Google::Iam::V1::AuditConfigDelta::Action] - # The action that was performed on an audit configuration in a policy. - # Required - # @!attribute [rw] service - # @return [::String] - # Specifies a service that was configured for Cloud Audit Logging. - # For example, `storage.googleapis.com`, `cloudsql.googleapis.com`. - # `allServices` is a special value that covers all services. - # Required - # @!attribute [rw] exempted_member - # @return [::String] - # A single identity that is exempted from "data access" audit - # logging for the `service` specified above. - # Follows the same format of Binding.members. - # @!attribute [rw] log_type - # @return [::String] - # Specifies the log_type that was be enabled. ADMIN_ACTIVITY is always - # enabled, and cannot be configured. - # Required - class AuditConfigDelta - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The type of action performed on an audit configuration in a policy. - module Action - # Unspecified. - ACTION_UNSPECIFIED = 0 - - # Addition of an audit configuration. - ADD = 1 - - # Removal of an audit configuration. - REMOVE = 2 - end - end - end - end -end diff --git a/owl-bot-staging/google-iam-v1/proto_docs/google/iam/v1/resource_policy_member.rb b/owl-bot-staging/google-iam-v1/proto_docs/google/iam/v1/resource_policy_member.rb deleted file mode 100644 index 5f60d79049ba..000000000000 --- a/owl-bot-staging/google-iam-v1/proto_docs/google/iam/v1/resource_policy_member.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! - - -module Google - module Iam - module V1 - # Output-only policy member strings of a Google Cloud resource's built-in - # identity. - # @!attribute [r] iam_policy_name_principal - # @return [::String] - # IAM policy binding member referring to a Google Cloud resource by - # user-assigned name (https://google.aip.dev/122). If a resource is deleted - # and recreated with the same name, the binding will be applicable to the new - # resource. - # - # Example: - # `principal://parametermanager.googleapis.com/projects/12345/name/locations/us-central1-a/parameters/my-parameter` - # @!attribute [r] iam_policy_uid_principal - # @return [::String] - # IAM policy binding member referring to a Google Cloud resource by - # system-assigned unique identifier (https://google.aip.dev/148#uid). If a - # resource is deleted and recreated with the same name, the binding will not - # be applicable to the new resource - # - # Example: - # `principal://parametermanager.googleapis.com/projects/12345/uid/locations/us-central1-a/parameters/a918fed5` - class ResourcePolicyMember - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end -end diff --git a/owl-bot-staging/google-iam-v1/proto_docs/google/protobuf/duration.rb b/owl-bot-staging/google-iam-v1/proto_docs/google/protobuf/duration.rb deleted file mode 100644 index ea59f1f91daf..000000000000 --- a/owl-bot-staging/google-iam-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-iam-v1/proto_docs/google/protobuf/field_mask.rb b/owl-bot-staging/google-iam-v1/proto_docs/google/protobuf/field_mask.rb deleted file mode 100644 index 7f3ffc78601a..000000000000 --- a/owl-bot-staging/google-iam-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-iam-v1/proto_docs/google/type/expr.rb b/owl-bot-staging/google-iam-v1/proto_docs/google/type/expr.rb deleted file mode 100644 index 53e7733b6592..000000000000 --- a/owl-bot-staging/google-iam-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-iam-v1/snippets/Gemfile b/owl-bot-staging/google-iam-v1/snippets/Gemfile deleted file mode 100644 index 222c98f20f3c..000000000000 --- a/owl-bot-staging/google-iam-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-iam-v1", path: "../" -else - gem "google-iam-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-iam-v1/snippets/iam_policy/get_iam_policy.rb b/owl-bot-staging/google-iam-v1/snippets/iam_policy/get_iam_policy.rb deleted file mode 100644 index c1935fa21a05..000000000000 --- a/owl-bot-staging/google-iam-v1/snippets/iam_policy/get_iam_policy.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 iam_v1_generated_IAMPolicy_GetIamPolicy_sync] -require "google/iam/v1" - -## -# Snippet for the get_iam_policy call in the IAMPolicy 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::Iam::V1::IAMPolicy::Client#get_iam_policy. -# -def get_iam_policy - # Create a client object. The client can be reused for multiple calls. - client = Google::Iam::V1::IAMPolicy::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Iam::V1::GetIamPolicyRequest.new - - # Call the get_iam_policy method. - result = client.get_iam_policy request - - # The returned object is of type Google::Iam::V1::Policy. - p result -end -# [END iam_v1_generated_IAMPolicy_GetIamPolicy_sync] diff --git a/owl-bot-staging/google-iam-v1/snippets/iam_policy/set_iam_policy.rb b/owl-bot-staging/google-iam-v1/snippets/iam_policy/set_iam_policy.rb deleted file mode 100644 index 81aaa0bbdad7..000000000000 --- a/owl-bot-staging/google-iam-v1/snippets/iam_policy/set_iam_policy.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 iam_v1_generated_IAMPolicy_SetIamPolicy_sync] -require "google/iam/v1" - -## -# Snippet for the set_iam_policy call in the IAMPolicy 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::Iam::V1::IAMPolicy::Client#set_iam_policy. -# -def set_iam_policy - # Create a client object. The client can be reused for multiple calls. - client = Google::Iam::V1::IAMPolicy::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Iam::V1::SetIamPolicyRequest.new - - # Call the set_iam_policy method. - result = client.set_iam_policy request - - # The returned object is of type Google::Iam::V1::Policy. - p result -end -# [END iam_v1_generated_IAMPolicy_SetIamPolicy_sync] diff --git a/owl-bot-staging/google-iam-v1/snippets/iam_policy/test_iam_permissions.rb b/owl-bot-staging/google-iam-v1/snippets/iam_policy/test_iam_permissions.rb deleted file mode 100644 index 2379ca2c168d..000000000000 --- a/owl-bot-staging/google-iam-v1/snippets/iam_policy/test_iam_permissions.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 iam_v1_generated_IAMPolicy_TestIamPermissions_sync] -require "google/iam/v1" - -## -# Snippet for the test_iam_permissions call in the IAMPolicy 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::Iam::V1::IAMPolicy::Client#test_iam_permissions. -# -def test_iam_permissions - # Create a client object. The client can be reused for multiple calls. - client = Google::Iam::V1::IAMPolicy::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Iam::V1::TestIamPermissionsRequest.new - - # Call the test_iam_permissions method. - result = client.test_iam_permissions request - - # The returned object is of type Google::Iam::V1::TestIamPermissionsResponse. - p result -end -# [END iam_v1_generated_IAMPolicy_TestIamPermissions_sync] diff --git a/owl-bot-staging/google-iam-v1/snippets/snippet_metadata_google.iam.v1.json b/owl-bot-staging/google-iam-v1/snippets/snippet_metadata_google.iam.v1.json deleted file mode 100644 index 93be3207db59..000000000000 --- a/owl-bot-staging/google-iam-v1/snippets/snippet_metadata_google.iam.v1.json +++ /dev/null @@ -1,135 +0,0 @@ -{ - "client_library": { - "name": "google-iam-v1", - "version": "", - "language": "RUBY", - "apis": [ - { - "id": "google.iam.v1", - "version": "v1" - } - ] - }, - "snippets": [ - { - "region_tag": "iam_v1_generated_IAMPolicy_SetIamPolicy_sync", - "title": "Snippet for the set_iam_policy call in the IAMPolicy service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Iam::V1::IAMPolicy::Client#set_iam_policy.", - "file": "iam_policy/set_iam_policy.rb", - "language": "RUBY", - "client_method": { - "short_name": "set_iam_policy", - "full_name": "::Google::Iam::V1::IAMPolicy::Client#set_iam_policy", - "async": false, - "parameters": [ - { - "type": "::Google::Iam::V1::SetIamPolicyRequest", - "name": "request" - } - ], - "result_type": "::Google::Iam::V1::Policy", - "client": { - "short_name": "IAMPolicy::Client", - "full_name": "::Google::Iam::V1::IAMPolicy::Client" - }, - "method": { - "short_name": "SetIamPolicy", - "full_name": "google.iam.v1.IAMPolicy.SetIamPolicy", - "service": { - "short_name": "IAMPolicy", - "full_name": "google.iam.v1.IAMPolicy" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "iam_v1_generated_IAMPolicy_GetIamPolicy_sync", - "title": "Snippet for the get_iam_policy call in the IAMPolicy service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Iam::V1::IAMPolicy::Client#get_iam_policy.", - "file": "iam_policy/get_iam_policy.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_iam_policy", - "full_name": "::Google::Iam::V1::IAMPolicy::Client#get_iam_policy", - "async": false, - "parameters": [ - { - "type": "::Google::Iam::V1::GetIamPolicyRequest", - "name": "request" - } - ], - "result_type": "::Google::Iam::V1::Policy", - "client": { - "short_name": "IAMPolicy::Client", - "full_name": "::Google::Iam::V1::IAMPolicy::Client" - }, - "method": { - "short_name": "GetIamPolicy", - "full_name": "google.iam.v1.IAMPolicy.GetIamPolicy", - "service": { - "short_name": "IAMPolicy", - "full_name": "google.iam.v1.IAMPolicy" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "iam_v1_generated_IAMPolicy_TestIamPermissions_sync", - "title": "Snippet for the test_iam_permissions call in the IAMPolicy service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Iam::V1::IAMPolicy::Client#test_iam_permissions.", - "file": "iam_policy/test_iam_permissions.rb", - "language": "RUBY", - "client_method": { - "short_name": "test_iam_permissions", - "full_name": "::Google::Iam::V1::IAMPolicy::Client#test_iam_permissions", - "async": false, - "parameters": [ - { - "type": "::Google::Iam::V1::TestIamPermissionsRequest", - "name": "request" - } - ], - "result_type": "::Google::Iam::V1::TestIamPermissionsResponse", - "client": { - "short_name": "IAMPolicy::Client", - "full_name": "::Google::Iam::V1::IAMPolicy::Client" - }, - "method": { - "short_name": "TestIamPermissions", - "full_name": "google.iam.v1.IAMPolicy.TestIamPermissions", - "service": { - "short_name": "IAMPolicy", - "full_name": "google.iam.v1.IAMPolicy" - } - } - }, - "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-iam-v1/test/google/iam/v1/iam_policy_rest_test.rb b/owl-bot-staging/google-iam-v1/test/google/iam/v1/iam_policy_rest_test.rb deleted file mode 100644 index 5872de89cd6b..000000000000 --- a/owl-bot-staging/google-iam-v1/test/google/iam/v1/iam_policy_rest_test.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 "helper" -require "gapic/rest" -require "google/iam/v1/iam_policy_pb" -require "google/iam/v1/iam_policy/rest" - - -class ::Google::Iam::V1::IAMPolicy::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_set_iam_policy - # Create test objects. - client_result = ::Google::Iam::V1::Policy.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - resource = "hello world" - policy = {} - update_mask = {} - - set_iam_policy_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::Iam::V1::IAMPolicy::Rest::ServiceStub.stub :transcode_set_iam_policy_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, set_iam_policy_client_stub do - # Create client - client = ::Google::Iam::V1::IAMPolicy::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.set_iam_policy({ resource: resource, policy: policy, update_mask: update_mask }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.set_iam_policy resource: resource, policy: policy, update_mask: update_mask do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.set_iam_policy ::Google::Iam::V1::SetIamPolicyRequest.new(resource: resource, policy: policy, update_mask: update_mask) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.set_iam_policy({ resource: resource, policy: policy, update_mask: update_mask }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.set_iam_policy(::Google::Iam::V1::SetIamPolicyRequest.new(resource: resource, policy: policy, update_mask: update_mask), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, set_iam_policy_client_stub.call_count - end - end - end - - def test_get_iam_policy - # Create test objects. - client_result = ::Google::Iam::V1::Policy.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - resource = "hello world" - options = {} - - get_iam_policy_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::Iam::V1::IAMPolicy::Rest::ServiceStub.stub :transcode_get_iam_policy_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_iam_policy_client_stub do - # Create client - client = ::Google::Iam::V1::IAMPolicy::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_iam_policy({ resource: resource, options: options }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_iam_policy resource: resource, options: options do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_iam_policy ::Google::Iam::V1::GetIamPolicyRequest.new(resource: resource, options: options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_iam_policy({ resource: resource, options: options }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_iam_policy(::Google::Iam::V1::GetIamPolicyRequest.new(resource: resource, options: options), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_iam_policy_client_stub.call_count - end - end - end - - def test_test_iam_permissions - # Create test objects. - client_result = ::Google::Iam::V1::TestIamPermissionsResponse.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - resource = "hello world" - permissions = ["hello world"] - - test_iam_permissions_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::Iam::V1::IAMPolicy::Rest::ServiceStub.stub :transcode_test_iam_permissions_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, test_iam_permissions_client_stub do - # Create client - client = ::Google::Iam::V1::IAMPolicy::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.test_iam_permissions({ resource: resource, permissions: permissions }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.test_iam_permissions resource: resource, permissions: permissions do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.test_iam_permissions ::Google::Iam::V1::TestIamPermissionsRequest.new(resource: resource, permissions: permissions) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.test_iam_permissions({ resource: resource, permissions: permissions }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.test_iam_permissions(::Google::Iam::V1::TestIamPermissionsRequest.new(resource: resource, permissions: permissions), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, test_iam_permissions_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::Iam::V1::IAMPolicy::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::Iam::V1::IAMPolicy::Rest::Client::Configuration, config - end -end diff --git a/owl-bot-staging/google-iam-v1/test/google/iam/v1/iam_policy_test.rb b/owl-bot-staging/google-iam-v1/test/google/iam/v1/iam_policy_test.rb deleted file mode 100644 index fbfb3e8939bd..000000000000 --- a/owl-bot-staging/google-iam-v1/test/google/iam/v1/iam_policy_test.rb +++ /dev/null @@ -1,286 +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/iam/v1/iam_policy_pb" -require "google/iam/v1/iam_policy" - -class ::Google::Iam::V1::IAMPolicy::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_set_iam_policy - # Create GRPC objects. - grpc_response = ::Google::Iam::V1::Policy.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. - resource = "hello world" - policy = {} - update_mask = {} - - set_iam_policy_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :set_iam_policy, name - assert_kind_of ::Google::Iam::V1::SetIamPolicyRequest, request - assert_equal "hello world", request["resource"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Iam::V1::Policy), request["policy"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, set_iam_policy_client_stub do - # Create client - client = ::Google::Iam::V1::IAMPolicy::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.set_iam_policy({ resource: resource, policy: policy, update_mask: update_mask }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.set_iam_policy resource: resource, policy: policy, update_mask: update_mask do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.set_iam_policy ::Google::Iam::V1::SetIamPolicyRequest.new(resource: resource, policy: policy, update_mask: update_mask) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.set_iam_policy({ resource: resource, policy: policy, 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.set_iam_policy(::Google::Iam::V1::SetIamPolicyRequest.new(resource: resource, policy: policy, 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, set_iam_policy_client_stub.call_rpc_count - end - end - - def test_get_iam_policy - # Create GRPC objects. - grpc_response = ::Google::Iam::V1::Policy.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. - resource = "hello world" - options = {} - - get_iam_policy_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_iam_policy, name - assert_kind_of ::Google::Iam::V1::GetIamPolicyRequest, request - assert_equal "hello world", request["resource"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Iam::V1::GetPolicyOptions), request["options"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_iam_policy_client_stub do - # Create client - client = ::Google::Iam::V1::IAMPolicy::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_iam_policy({ resource: resource, options: options }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_iam_policy resource: resource, options: options do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_iam_policy ::Google::Iam::V1::GetIamPolicyRequest.new(resource: resource, options: options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_iam_policy({ resource: resource, options: options }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.get_iam_policy(::Google::Iam::V1::GetIamPolicyRequest.new(resource: resource, options: options), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, get_iam_policy_client_stub.call_rpc_count - end - end - - def test_test_iam_permissions - # Create GRPC objects. - grpc_response = ::Google::Iam::V1::TestIamPermissionsResponse.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. - resource = "hello world" - permissions = ["hello world"] - - test_iam_permissions_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :test_iam_permissions, name - assert_kind_of ::Google::Iam::V1::TestIamPermissionsRequest, request - assert_equal "hello world", request["resource"] - assert_equal ["hello world"], request["permissions"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, test_iam_permissions_client_stub do - # Create client - client = ::Google::Iam::V1::IAMPolicy::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.test_iam_permissions({ resource: resource, permissions: permissions }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.test_iam_permissions resource: resource, permissions: permissions do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.test_iam_permissions ::Google::Iam::V1::TestIamPermissionsRequest.new(resource: resource, permissions: permissions) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.test_iam_permissions({ resource: resource, permissions: permissions }, grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object with options - client.test_iam_permissions(::Google::Iam::V1::TestIamPermissionsRequest.new(resource: resource, permissions: permissions), grpc_options) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Verify method calls - assert_equal 5, test_iam_permissions_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::Iam::V1::IAMPolicy::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::Iam::V1::IAMPolicy::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::Iam::V1::IAMPolicy::Client.new do |config| - config.credentials = creds - end - assert_kind_of ::Google::Iam::V1::IAMPolicy::Client, client - assert_equal creds, client.configure.credentials - end - end -end diff --git a/owl-bot-staging/google-iam-v1/test/helper.rb b/owl-bot-staging/google-iam-v1/test/helper.rb deleted file mode 100644 index 672b337030e7..000000000000 --- a/owl-bot-staging/google-iam-v1/test/helper.rb +++ /dev/null @@ -1,26 +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/mock" -require "minitest/rg" - -require "grpc" - -require "ostruct" diff --git a/owl-bot-staging/google-iam-v1beta/.gitignore b/owl-bot-staging/google-iam-v1beta/.gitignore deleted file mode 100644 index 0135b6bc6cfc..000000000000 --- a/owl-bot-staging/google-iam-v1beta/.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-iam-v1beta/.repo-metadata.json b/owl-bot-staging/google-iam-v1beta/.repo-metadata.json deleted file mode 100644 index 7bc483fbac5e..000000000000 --- a/owl-bot-staging/google-iam-v1beta/.repo-metadata.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "api_id": "iam.googleapis.com", - "api_shortname": "iam", - "client_documentation": "https://rubydoc.info/gems/google-iam-v1beta", - "distribution_name": "google-iam-v1beta", - "is_cloud": false, - "language": "ruby", - "name": "iam", - "name_pretty": "Google IAM V1beta API", - "product_documentation": "https://cloud.google.com/iam/docs/manage-workload-identity-pools-providers", - "release_level": "unreleased", - "repo": "googleapis/google-cloud-ruby", - "requires_billing": true, - "ruby-cloud-description": "Pre-release client for the WorkloadIdentityPools service. Note that google-iam-v1beta is a version-specific client library. For most uses, we recommend installing the main client library google-iam instead. See the readme for more details.", - "ruby-cloud-env-prefix": "IAM", - "ruby-cloud-product-url": "https://cloud.google.com/iam/docs/manage-workload-identity-pools-providers", - "library_type": "GAPIC_AUTO" -} diff --git a/owl-bot-staging/google-iam-v1beta/.rubocop.yml b/owl-bot-staging/google-iam-v1beta/.rubocop.yml deleted file mode 100644 index e1301e1a1ab9..000000000000 --- a/owl-bot-staging/google-iam-v1beta/.rubocop.yml +++ /dev/null @@ -1,33 +0,0 @@ -inherit_gem: - google-style: google-style.yml - -AllCops: - Exclude: - - "google-iam-v1beta.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-iam-v1beta.rb" diff --git a/owl-bot-staging/google-iam-v1beta/.toys.rb b/owl-bot-staging/google-iam-v1beta/.toys.rb deleted file mode 100644 index 177e22456e8a..000000000000 --- a/owl-bot-staging/google-iam-v1beta/.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-iam-v1beta/.yardopts b/owl-bot-staging/google-iam-v1beta/.yardopts deleted file mode 100644 index db01ec47e974..000000000000 --- a/owl-bot-staging/google-iam-v1beta/.yardopts +++ /dev/null @@ -1,12 +0,0 @@ ---no-private ---title="Google IAM V1beta 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-iam-v1beta/AUTHENTICATION.md b/owl-bot-staging/google-iam-v1beta/AUTHENTICATION.md deleted file mode 100644 index b760c7d68202..000000000000 --- a/owl-bot-staging/google-iam-v1beta/AUTHENTICATION.md +++ /dev/null @@ -1,122 +0,0 @@ -# Authentication - -The recommended way to authenticate to the google-iam-v1beta 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-iam-v1beta 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/iam/v1beta" - -client = ::Google::Iam::V1beta::WorkloadIdentityPools::Client.new do |config| - config.credentials = "path/to/credentialfile.json" -end -``` - -To configure a credentials file globally for all clients: - -```ruby -require "google/iam/v1beta" - -::Google::Iam::V1beta::WorkloadIdentityPools::Client.configure do |config| - config.credentials = "path/to/credentialfile.json" -end - -client = ::Google::Iam::V1beta::WorkloadIdentityPools::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-iam-v1beta -checks for credentials are: - -* `GOOGLE_CLOUD_CREDENTIALS` - Path to JSON file, or JSON contents -* `GOOGLE_APPLICATION_CREDENTIALS` - Path to JSON file - -```ruby -require "google/iam/v1beta" - -ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" - -client = ::Google::Iam::V1beta::WorkloadIdentityPools::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-iam-v1beta/CHANGELOG.md b/owl-bot-staging/google-iam-v1beta/CHANGELOG.md deleted file mode 100644 index f88957a62ba2..000000000000 --- a/owl-bot-staging/google-iam-v1beta/CHANGELOG.md +++ /dev/null @@ -1,2 +0,0 @@ -# Release History - diff --git a/owl-bot-staging/google-iam-v1beta/Gemfile b/owl-bot-staging/google-iam-v1beta/Gemfile deleted file mode 100644 index 1d08558908d8..000000000000 --- a/owl-bot-staging/google-iam-v1beta/Gemfile +++ /dev/null @@ -1,14 +0,0 @@ -source "https://rubygems.org" - -gemspec - -gem "google-style", "~> 1.32.0" -gem "irb", "~> 1.17" -gem "minitest", "~> 6.0.2" -gem "minitest-focus", "~> 1.4" -gem "minitest-mock", "~> 5.27" -gem "minitest-rg", "~> 5.3" -gem "ostruct", "~> 0.5.5" -gem "rake", ">= 13.0" -gem "redcarpet", "~> 3.6" -gem "yard", "~> 0.9" diff --git a/owl-bot-staging/google-iam-v1beta/LICENSE.md b/owl-bot-staging/google-iam-v1beta/LICENSE.md deleted file mode 100644 index c261857ba6ad..000000000000 --- a/owl-bot-staging/google-iam-v1beta/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-iam-v1beta/README.md b/owl-bot-staging/google-iam-v1beta/README.md deleted file mode 100644 index d6d0d514aaf4..000000000000 --- a/owl-bot-staging/google-iam-v1beta/README.md +++ /dev/null @@ -1,154 +0,0 @@ -# Ruby Client for the Google IAM V1beta API - -Manages identity and access control for Google Cloud Platform resources, including the creation of service accounts, which you can use to authenticate to Google and make API calls. Note: This API is tied to the IAM service account credentials API (iamcredentials.googleapis.com). Enabling or disabling this API will also enable or disable the IAM service account credentials API. - -Pre-release client for the WorkloadIdentityPools service. - -https://github.com/googleapis/google-cloud-ruby - -This gem is a _versioned_ client. It provides basic client classes for a -specific version of the Google IAM V1beta API. Most users should consider using -the main client gem, -[google-iam](https://rubygems.org/gems/google-iam). -See the section below titled *Which client should I use?* for more information. - -## Installation - -``` -$ gem install google-iam-v1beta -``` - -## 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/iam.googleapis.com) -1. [Set up authentication.](AUTHENTICATION.md) - -## Quick Start - -```ruby -require "google/iam/v1beta" - -client = ::Google::Iam::V1beta::WorkloadIdentityPools::Client.new -request = ::Google::Iam::V1beta::ListWorkloadIdentityPoolsRequest.new # (request fields as keyword arguments...) -response = client.list_workload_identity_pools request -``` - -View the [Client Library Documentation](https://rubydoc.info/gems/google-iam-v1beta) -for class and method documentation. - -See also the [Product Documentation](https://cloud.google.com/iam/docs/manage-workload-identity-pools-providers) -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/iam/v1beta" -require "logger" - -client = ::Google::Iam::V1beta::WorkloadIdentityPools::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-iam`, -and lower-level _versioned_ client libraries with names such as -`google-iam-v1beta`. -_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-iam`. -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-iam-v1beta`. - -### 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-iam-v1beta/Rakefile b/owl-bot-staging/google-iam-v1beta/Rakefile deleted file mode 100644 index e0cb1430b9ad..000000000000 --- a/owl-bot-staging/google-iam-v1beta/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-iam-v1beta acceptance tests." -task :acceptance, :project, :keyfile do |t, args| - project = args[:project] - project ||= - ENV["IAM_TEST_PROJECT"] || - ENV["GCLOUD_TEST_PROJECT"] - keyfile = args[:keyfile] - keyfile ||= - ENV["IAM_TEST_KEYFILE"] || - ENV["GCLOUD_TEST_KEYFILE"] - if keyfile - keyfile = File.read keyfile - else - keyfile ||= - ENV["IAM_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 IAM_TEST_PROJECT=test123 IAM_TEST_KEYFILE=/path/to/keyfile.json rake acceptance" - end - require "google/iam/v1beta/workload_identity_pools/credentials" - ::Google::Iam::V1beta::WorkloadIdentityPools::Credentials.env_vars.each do |path| - ENV[path] = nil - end - ENV["IAM_PROJECT"] = project - ENV["IAM_TEST_PROJECT"] = project - ENV["IAM_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-iam-v1beta 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-iam-v1beta 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-iam-v1beta 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-iam-v1beta gem does not have doctest tests." -end - -desc "Run the CI build" -task :ci do - header "BUILDING google-iam-v1beta" - header "google-iam-v1beta rubocop", "*" - Rake::Task[:rubocop].invoke - header "google-iam-v1beta yard", "*" - Rake::Task[:yard].invoke - header "google-iam-v1beta 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-iam-v1beta 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-iam-v1beta 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-iam-v1beta/gapic_metadata.json b/owl-bot-staging/google-iam-v1beta/gapic_metadata.json deleted file mode 100644 index 20698b70c75f..000000000000 --- a/owl-bot-staging/google-iam-v1beta/gapic_metadata.json +++ /dev/null @@ -1,78 +0,0 @@ -{ - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", - "language": "ruby", - "protoPackage": "google.iam.v1beta", - "libraryPackage": "::Google::Iam::V1beta", - "services": { - "WorkloadIdentityPools": { - "clients": { - "grpc": { - "libraryClient": "::Google::Iam::V1beta::WorkloadIdentityPools::Client", - "rpcs": { - "ListWorkloadIdentityPools": { - "methods": [ - "list_workload_identity_pools" - ] - }, - "GetWorkloadIdentityPool": { - "methods": [ - "get_workload_identity_pool" - ] - }, - "CreateWorkloadIdentityPool": { - "methods": [ - "create_workload_identity_pool" - ] - }, - "UpdateWorkloadIdentityPool": { - "methods": [ - "update_workload_identity_pool" - ] - }, - "DeleteWorkloadIdentityPool": { - "methods": [ - "delete_workload_identity_pool" - ] - }, - "UndeleteWorkloadIdentityPool": { - "methods": [ - "undelete_workload_identity_pool" - ] - }, - "ListWorkloadIdentityPoolProviders": { - "methods": [ - "list_workload_identity_pool_providers" - ] - }, - "GetWorkloadIdentityPoolProvider": { - "methods": [ - "get_workload_identity_pool_provider" - ] - }, - "CreateWorkloadIdentityPoolProvider": { - "methods": [ - "create_workload_identity_pool_provider" - ] - }, - "UpdateWorkloadIdentityPoolProvider": { - "methods": [ - "update_workload_identity_pool_provider" - ] - }, - "DeleteWorkloadIdentityPoolProvider": { - "methods": [ - "delete_workload_identity_pool_provider" - ] - }, - "UndeleteWorkloadIdentityPoolProvider": { - "methods": [ - "undelete_workload_identity_pool_provider" - ] - } - } - } - } - } - } -} diff --git a/owl-bot-staging/google-iam-v1beta/google-iam-v1beta.gemspec b/owl-bot-staging/google-iam-v1beta/google-iam-v1beta.gemspec deleted file mode 100644 index 43e3670d974b..000000000000 --- a/owl-bot-staging/google-iam-v1beta/google-iam-v1beta.gemspec +++ /dev/null @@ -1,28 +0,0 @@ -# -*- ruby -*- -# encoding: utf-8 - -require File.expand_path("lib/google/iam/v1beta/version", __dir__) - -Gem::Specification.new do |gem| - gem.name = "google-iam-v1beta" - gem.version = Google::Iam::V1beta::VERSION - - gem.authors = ["Google LLC"] - gem.email = "googleapis-packages@google.com" - gem.description = "Pre-release client for the WorkloadIdentityPools service. Note that google-iam-v1beta is a version-specific client library. For most uses, we recommend installing the main client library google-iam instead. See the readme for more details." - gem.summary = "Manages identity and access control for Google Cloud Platform resources, including the creation of service accounts, which you can use to authenticate to Google and make API calls. Note: This API is tied to the IAM service account credentials API (iamcredentials.googleapis.com). Enabling or disabling this API will also enable or disable the IAM service account credentials API." - 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.2" - - gem.add_dependency "gapic-common", "~> 1.2" - gem.add_dependency "google-cloud-errors", "~> 1.0" -end diff --git a/owl-bot-staging/google-iam-v1beta/lib/google-iam-v1beta.rb b/owl-bot-staging/google-iam-v1beta/lib/google-iam-v1beta.rb deleted file mode 100644 index 3d3ddff928fb..000000000000 --- a/owl-bot-staging/google-iam-v1beta/lib/google-iam-v1beta.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/iam/v1beta" diff --git a/owl-bot-staging/google-iam-v1beta/lib/google/iam/v1beta.rb b/owl-bot-staging/google-iam-v1beta/lib/google/iam/v1beta.rb deleted file mode 100644 index 4bf8fc10a312..000000000000 --- a/owl-bot-staging/google-iam-v1beta/lib/google/iam/v1beta.rb +++ /dev/null @@ -1,38 +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/iam/v1beta/workload_identity_pools" -require "google/iam/v1beta/version" - -module Google - module Iam - ## - # API client module. - # - # @example Load this package, including all its services, and instantiate a gRPC client - # - # require "google/iam/v1beta" - # client = ::Google::Iam::V1beta::WorkloadIdentityPools::Client.new - # - module V1beta - end - end -end - -helper_path = ::File.join __dir__, "v1beta", "_helpers.rb" -require "google/iam/v1beta/_helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-iam-v1beta/lib/google/iam/v1beta/version.rb b/owl-bot-staging/google-iam-v1beta/lib/google/iam/v1beta/version.rb deleted file mode 100644 index ae41055a7d94..000000000000 --- a/owl-bot-staging/google-iam-v1beta/lib/google/iam/v1beta/version.rb +++ /dev/null @@ -1,26 +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 Iam - module V1beta - VERSION = "0.0.1" - end - end -end diff --git a/owl-bot-staging/google-iam-v1beta/lib/google/iam/v1beta/workload_identity_pool_pb.rb b/owl-bot-staging/google-iam-v1beta/lib/google/iam/v1beta/workload_identity_pool_pb.rb deleted file mode 100644 index 787d1952cd7e..000000000000 --- a/owl-bot-staging/google-iam-v1beta/lib/google/iam/v1beta/workload_identity_pool_pb.rb +++ /dev/null @@ -1,47 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/iam/v1beta/workload_identity_pool.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/field_mask_pb' - - -descriptor_data = "\n.google/iam/v1beta/workload_identity_pool.proto\x12\x11google.iam.v1beta\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 google/protobuf/field_mask.proto\"\xea\x02\n\x14WorkloadIdentityPool\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x14\n\x0c\x64isplay_name\x18\x02 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x03 \x01(\t\x12\x41\n\x05state\x18\x04 \x01(\x0e\x32-.google.iam.v1beta.WorkloadIdentityPool.StateB\x03\xe0\x41\x03\x12\x10\n\x08\x64isabled\x18\x05 \x01(\x08\"7\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\n\n\x06\x41\x43TIVE\x10\x01\x12\x0b\n\x07\x44\x45LETED\x10\x02:\x85\x01\xea\x41\x81\x01\n\'iam.googleapis.com/WorkloadIdentityPool\x12Vprojects/{project}/locations/{location}/workloadIdentityPools/{workload_identity_pool}\"\xe0\x06\n\x1cWorkloadIdentityPoolProvider\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x14\n\x0c\x64isplay_name\x18\x02 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x03 \x01(\t\x12I\n\x05state\x18\x04 \x01(\x0e\x32\x35.google.iam.v1beta.WorkloadIdentityPoolProvider.StateB\x03\xe0\x41\x03\x12\x10\n\x08\x64isabled\x18\x05 \x01(\x08\x12`\n\x11\x61ttribute_mapping\x18\x06 \x03(\x0b\x32\x45.google.iam.v1beta.WorkloadIdentityPoolProvider.AttributeMappingEntry\x12\x1b\n\x13\x61ttribute_condition\x18\x07 \x01(\t\x12\x42\n\x03\x61ws\x18\x08 \x01(\x0b\x32\x33.google.iam.v1beta.WorkloadIdentityPoolProvider.AwsH\x00\x12\x44\n\x04oidc\x18\t \x01(\x0b\x32\x34.google.iam.v1beta.WorkloadIdentityPoolProvider.OidcH\x00\x1a\x1e\n\x03\x41ws\x12\x17\n\naccount_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x1a:\n\x04Oidc\x12\x17\n\nissuer_uri\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x19\n\x11\x61llowed_audiences\x18\x02 \x03(\t\x1a\x37\n\x15\x41ttributeMappingEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"7\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\n\n\x06\x41\x43TIVE\x10\x01\x12\x0b\n\x07\x44\x45LETED\x10\x02:\xba\x01\xea\x41\xb6\x01\n/iam.googleapis.com/WorkloadIdentityPoolProvider\x12\x82\x01projects/{project}/locations/{location}/workloadIdentityPools/{workload_identity_pool}/providers/{workload_identity_pool_provider}B\x11\n\x0fprovider_config\"\xa4\x01\n ListWorkloadIdentityPoolsRequest\x12\x43\n\x06parent\x18\x01 \x01(\tB3\xe0\x41\x02\xfa\x41-\n+cloudresourcemanager.googleapis.com/Project\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\x12\x14\n\x0cshow_deleted\x18\x04 \x01(\x08\"\x86\x01\n!ListWorkloadIdentityPoolsResponse\x12H\n\x17workload_identity_pools\x18\x01 \x03(\x0b\x32\'.google.iam.v1beta.WorkloadIdentityPool\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"_\n\x1eGetWorkloadIdentityPoolRequest\x12=\n\x04name\x18\x01 \x01(\tB/\xe0\x41\x02\xfa\x41)\n\'iam.googleapis.com/WorkloadIdentityPool\"\xde\x01\n!CreateWorkloadIdentityPoolRequest\x12\x43\n\x06parent\x18\x01 \x01(\tB3\xe0\x41\x02\xfa\x41-\n+cloudresourcemanager.googleapis.com/Project\x12L\n\x16workload_identity_pool\x18\x02 \x01(\x0b\x32\'.google.iam.v1beta.WorkloadIdentityPoolB\x03\xe0\x41\x02\x12&\n\x19workload_identity_pool_id\x18\x03 \x01(\tB\x03\xe0\x41\x02\"\xa7\x01\n!UpdateWorkloadIdentityPoolRequest\x12L\n\x16workload_identity_pool\x18\x01 \x01(\x0b\x32\'.google.iam.v1beta.WorkloadIdentityPoolB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\"b\n!DeleteWorkloadIdentityPoolRequest\x12=\n\x04name\x18\x01 \x01(\tB/\xe0\x41\x02\xfa\x41)\n\'iam.googleapis.com/WorkloadIdentityPool\"d\n#UndeleteWorkloadIdentityPoolRequest\x12=\n\x04name\x18\x01 \x01(\tB/\xe0\x41\x02\xfa\x41)\n\'iam.googleapis.com/WorkloadIdentityPool\"\xa8\x01\n(ListWorkloadIdentityPoolProvidersRequest\x12?\n\x06parent\x18\x01 \x01(\tB/\xe0\x41\x02\xfa\x41)\n\'iam.googleapis.com/WorkloadIdentityPool\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\x12\x14\n\x0cshow_deleted\x18\x04 \x01(\x08\"\x9f\x01\n)ListWorkloadIdentityPoolProvidersResponse\x12Y\n workload_identity_pool_providers\x18\x01 \x03(\x0b\x32/.google.iam.v1beta.WorkloadIdentityPoolProvider\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"o\n&GetWorkloadIdentityPoolProviderRequest\x12\x45\n\x04name\x18\x01 \x01(\tB7\xe0\x41\x02\xfa\x41\x31\n/iam.googleapis.com/WorkloadIdentityPoolProvider\"\xfc\x01\n)CreateWorkloadIdentityPoolProviderRequest\x12?\n\x06parent\x18\x01 \x01(\tB/\xe0\x41\x02\xfa\x41)\n\'iam.googleapis.com/WorkloadIdentityPool\x12]\n\x1fworkload_identity_pool_provider\x18\x02 \x01(\x0b\x32/.google.iam.v1beta.WorkloadIdentityPoolProviderB\x03\xe0\x41\x02\x12/\n\"workload_identity_pool_provider_id\x18\x03 \x01(\tB\x03\xe0\x41\x02\"\xc0\x01\n)UpdateWorkloadIdentityPoolProviderRequest\x12]\n\x1fworkload_identity_pool_provider\x18\x01 \x01(\x0b\x32/.google.iam.v1beta.WorkloadIdentityPoolProviderB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02\"r\n)DeleteWorkloadIdentityPoolProviderRequest\x12\x45\n\x04name\x18\x01 \x01(\tB7\xe0\x41\x02\xfa\x41\x31\n/iam.googleapis.com/WorkloadIdentityPoolProvider\"t\n+UndeleteWorkloadIdentityPoolProviderRequest\x12\x45\n\x04name\x18\x01 \x01(\tB7\xe0\x41\x02\xfa\x41\x31\n/iam.googleapis.com/WorkloadIdentityPoolProvider\"\'\n%WorkloadIdentityPoolOperationMetadata\"/\n-WorkloadIdentityPoolProviderOperationMetadata2\xb4\x1c\n\x15WorkloadIdentityPools\x12\xd6\x01\n\x19ListWorkloadIdentityPools\x12\x33.google.iam.v1beta.ListWorkloadIdentityPoolsRequest\x1a\x34.google.iam.v1beta.ListWorkloadIdentityPoolsResponse\"N\xda\x41\x06parent\x82\xd3\xe4\x93\x02?\x12=/v1beta/{parent=projects/*/locations/*}/workloadIdentityPools\x12\xc3\x01\n\x17GetWorkloadIdentityPool\x12\x31.google.iam.v1beta.GetWorkloadIdentityPoolRequest\x1a\'.google.iam.v1beta.WorkloadIdentityPool\"L\xda\x41\x04name\x82\xd3\xe4\x93\x02?\x12=/v1beta/{name=projects/*/locations/*/workloadIdentityPools/*}\x12\xcb\x02\n\x1a\x43reateWorkloadIdentityPool\x12\x34.google.iam.v1beta.CreateWorkloadIdentityPoolRequest\x1a\x1d.google.longrunning.Operation\"\xd7\x01\xca\x41=\n\x14WorkloadIdentityPool\x12%WorkloadIdentityPoolOperationMetadata\xda\x41\x37parent,workload_identity_pool,workload_identity_pool_id\x82\xd3\xe4\x93\x02W\"=/v1beta/{parent=projects/*/locations/*}/workloadIdentityPools:\x16workload_identity_pool\x12\xcd\x02\n\x1aUpdateWorkloadIdentityPool\x12\x34.google.iam.v1beta.UpdateWorkloadIdentityPoolRequest\x1a\x1d.google.longrunning.Operation\"\xd9\x01\xca\x41=\n\x14WorkloadIdentityPool\x12%WorkloadIdentityPoolOperationMetadata\xda\x41\"workload_identity_pool,update_mask\x82\xd3\xe4\x93\x02n2T/v1beta/{workload_identity_pool.name=projects/*/locations/*/workloadIdentityPools/*}:\x16workload_identity_pool\x12\x80\x02\n\x1a\x44\x65leteWorkloadIdentityPool\x12\x34.google.iam.v1beta.DeleteWorkloadIdentityPoolRequest\x1a\x1d.google.longrunning.Operation\"\x8c\x01\xca\x41=\n\x14WorkloadIdentityPool\x12%WorkloadIdentityPoolOperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02?*=/v1beta/{name=projects/*/locations/*/workloadIdentityPools/*}\x12\x90\x02\n\x1cUndeleteWorkloadIdentityPool\x12\x36.google.iam.v1beta.UndeleteWorkloadIdentityPoolRequest\x1a\x1d.google.longrunning.Operation\"\x98\x01\xca\x41=\n\x14WorkloadIdentityPool\x12%WorkloadIdentityPoolOperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02K\"F/v1beta/{name=projects/*/locations/*/workloadIdentityPools/*}:undelete:\x01*\x12\xfa\x01\n!ListWorkloadIdentityPoolProviders\x12;.google.iam.v1beta.ListWorkloadIdentityPoolProvidersRequest\x1a<.google.iam.v1beta.ListWorkloadIdentityPoolProvidersResponse\"Z\xda\x41\x06parent\x82\xd3\xe4\x93\x02K\x12I/v1beta/{parent=projects/*/locations/*/workloadIdentityPools/*}/providers\x12\xe7\x01\n\x1fGetWorkloadIdentityPoolProvider\x12\x39.google.iam.v1beta.GetWorkloadIdentityPoolProviderRequest\x1a/.google.iam.v1beta.WorkloadIdentityPoolProvider\"X\xda\x41\x04name\x82\xd3\xe4\x93\x02K\x12I/v1beta/{name=projects/*/locations/*/workloadIdentityPools/*/providers/*}\x12\x92\x03\n\"CreateWorkloadIdentityPoolProvider\x12<.google.iam.v1beta.CreateWorkloadIdentityPoolProviderRequest\x1a\x1d.google.longrunning.Operation\"\x8e\x02\xca\x41M\n\x1cWorkloadIdentityPoolProvider\x12-WorkloadIdentityPoolProviderOperationMetadata\xda\x41Iparent,workload_identity_pool_provider,workload_identity_pool_provider_id\x82\xd3\xe4\x93\x02l\"I/v1beta/{parent=projects/*/locations/*/workloadIdentityPools/*}/providers:\x1fworkload_identity_pool_provider\x12\x95\x03\n\"UpdateWorkloadIdentityPoolProvider\x12<.google.iam.v1beta.UpdateWorkloadIdentityPoolProviderRequest\x1a\x1d.google.longrunning.Operation\"\x91\x02\xca\x41M\n\x1cWorkloadIdentityPoolProvider\x12-WorkloadIdentityPoolProviderOperationMetadata\xda\x41+workload_identity_pool_provider,update_mask\x82\xd3\xe4\x93\x02\x8c\x01\x32i/v1beta/{workload_identity_pool_provider.name=projects/*/locations/*/workloadIdentityPools/*/providers/*}:\x1fworkload_identity_pool_provider\x12\xac\x02\n\"DeleteWorkloadIdentityPoolProvider\x12<.google.iam.v1beta.DeleteWorkloadIdentityPoolProviderRequest\x1a\x1d.google.longrunning.Operation\"\xa8\x01\xca\x41M\n\x1cWorkloadIdentityPoolProvider\x12-WorkloadIdentityPoolProviderOperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02K*I/v1beta/{name=projects/*/locations/*/workloadIdentityPools/*/providers/*}\x12\xbc\x02\n$UndeleteWorkloadIdentityPoolProvider\x12>.google.iam.v1beta.UndeleteWorkloadIdentityPoolProviderRequest\x1a\x1d.google.longrunning.Operation\"\xb4\x01\xca\x41M\n\x1cWorkloadIdentityPoolProvider\x12-WorkloadIdentityPoolProviderOperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02W\"R/v1beta/{name=projects/*/locations/*/workloadIdentityPools/*/providers/*}:undelete:\x01*\x1a\x46\xca\x41\x12iam.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformBc\n\x15\x63om.google.iam.v1betaB\x19WorkloadIdentityPoolProtoP\x01Z-cloud.google.com/go/iam/apiv1beta/iampb;iampbb\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Iam - module V1beta - WorkloadIdentityPool = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.iam.v1beta.WorkloadIdentityPool").msgclass - WorkloadIdentityPool::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.iam.v1beta.WorkloadIdentityPool.State").enummodule - WorkloadIdentityPoolProvider = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.iam.v1beta.WorkloadIdentityPoolProvider").msgclass - WorkloadIdentityPoolProvider::Aws = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.iam.v1beta.WorkloadIdentityPoolProvider.Aws").msgclass - WorkloadIdentityPoolProvider::Oidc = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.iam.v1beta.WorkloadIdentityPoolProvider.Oidc").msgclass - WorkloadIdentityPoolProvider::State = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.iam.v1beta.WorkloadIdentityPoolProvider.State").enummodule - ListWorkloadIdentityPoolsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.iam.v1beta.ListWorkloadIdentityPoolsRequest").msgclass - ListWorkloadIdentityPoolsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.iam.v1beta.ListWorkloadIdentityPoolsResponse").msgclass - GetWorkloadIdentityPoolRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.iam.v1beta.GetWorkloadIdentityPoolRequest").msgclass - CreateWorkloadIdentityPoolRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.iam.v1beta.CreateWorkloadIdentityPoolRequest").msgclass - UpdateWorkloadIdentityPoolRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.iam.v1beta.UpdateWorkloadIdentityPoolRequest").msgclass - DeleteWorkloadIdentityPoolRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.iam.v1beta.DeleteWorkloadIdentityPoolRequest").msgclass - UndeleteWorkloadIdentityPoolRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.iam.v1beta.UndeleteWorkloadIdentityPoolRequest").msgclass - ListWorkloadIdentityPoolProvidersRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.iam.v1beta.ListWorkloadIdentityPoolProvidersRequest").msgclass - ListWorkloadIdentityPoolProvidersResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.iam.v1beta.ListWorkloadIdentityPoolProvidersResponse").msgclass - GetWorkloadIdentityPoolProviderRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.iam.v1beta.GetWorkloadIdentityPoolProviderRequest").msgclass - CreateWorkloadIdentityPoolProviderRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.iam.v1beta.CreateWorkloadIdentityPoolProviderRequest").msgclass - UpdateWorkloadIdentityPoolProviderRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.iam.v1beta.UpdateWorkloadIdentityPoolProviderRequest").msgclass - DeleteWorkloadIdentityPoolProviderRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.iam.v1beta.DeleteWorkloadIdentityPoolProviderRequest").msgclass - UndeleteWorkloadIdentityPoolProviderRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.iam.v1beta.UndeleteWorkloadIdentityPoolProviderRequest").msgclass - WorkloadIdentityPoolOperationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.iam.v1beta.WorkloadIdentityPoolOperationMetadata").msgclass - WorkloadIdentityPoolProviderOperationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.iam.v1beta.WorkloadIdentityPoolProviderOperationMetadata").msgclass - end - end -end diff --git a/owl-bot-staging/google-iam-v1beta/lib/google/iam/v1beta/workload_identity_pool_services_pb.rb b/owl-bot-staging/google-iam-v1beta/lib/google/iam/v1beta/workload_identity_pool_services_pb.rb deleted file mode 100644 index 86ff8e174977..000000000000 --- a/owl-bot-staging/google-iam-v1beta/lib/google/iam/v1beta/workload_identity_pool_services_pb.rb +++ /dev/null @@ -1,103 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# Source: google/iam/v1beta/workload_identity_pool.proto for package 'google.iam.v1beta' -# 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/iam/v1beta/workload_identity_pool_pb' - -module Google - module Iam - module V1beta - module WorkloadIdentityPools - # Manages WorkloadIdentityPools. - class Service - - include ::GRPC::GenericService - - self.marshal_class_method = :encode - self.unmarshal_class_method = :decode - self.service_name = 'google.iam.v1beta.WorkloadIdentityPools' - - # Lists all non-deleted - # [WorkloadIdentityPool][google.iam.v1beta.WorkloadIdentityPool]s in a - # project. If `show_deleted` is set to `true`, then deleted pools are also - # listed. - rpc :ListWorkloadIdentityPools, ::Google::Iam::V1beta::ListWorkloadIdentityPoolsRequest, ::Google::Iam::V1beta::ListWorkloadIdentityPoolsResponse - # Gets an individual - # [WorkloadIdentityPool][google.iam.v1beta.WorkloadIdentityPool]. - rpc :GetWorkloadIdentityPool, ::Google::Iam::V1beta::GetWorkloadIdentityPoolRequest, ::Google::Iam::V1beta::WorkloadIdentityPool - # Creates a new - # [WorkloadIdentityPool][google.iam.v1beta.WorkloadIdentityPool]. - # - # You cannot reuse the name of a deleted pool until 30 days after deletion. - rpc :CreateWorkloadIdentityPool, ::Google::Iam::V1beta::CreateWorkloadIdentityPoolRequest, ::Google::Longrunning::Operation - # Updates an existing - # [WorkloadIdentityPool][google.iam.v1beta.WorkloadIdentityPool]. - rpc :UpdateWorkloadIdentityPool, ::Google::Iam::V1beta::UpdateWorkloadIdentityPoolRequest, ::Google::Longrunning::Operation - # Deletes a - # [WorkloadIdentityPool][google.iam.v1beta.WorkloadIdentityPool]. - # - # You cannot use a deleted pool to exchange external - # credentials for Google Cloud credentials. However, deletion does - # not revoke credentials that have already been issued. - # Credentials issued for a deleted pool do not grant access to resources. - # If the pool is undeleted, and the credentials are not expired, they - # grant access again. - # You can undelete a pool for 30 days. After 30 days, deletion is - # permanent. - # You cannot update deleted pools. However, you can view and list them. - rpc :DeleteWorkloadIdentityPool, ::Google::Iam::V1beta::DeleteWorkloadIdentityPoolRequest, ::Google::Longrunning::Operation - # Undeletes a [WorkloadIdentityPool][google.iam.v1beta.WorkloadIdentityPool], - # as long as it was deleted fewer than 30 days ago. - rpc :UndeleteWorkloadIdentityPool, ::Google::Iam::V1beta::UndeleteWorkloadIdentityPoolRequest, ::Google::Longrunning::Operation - # Lists all non-deleted - # [WorkloadIdentityPoolProvider][google.iam.v1beta.WorkloadIdentityPoolProvider]s - # in a [WorkloadIdentityPool][google.iam.v1beta.WorkloadIdentityPool]. - # If `show_deleted` is set to `true`, then deleted providers are also listed. - rpc :ListWorkloadIdentityPoolProviders, ::Google::Iam::V1beta::ListWorkloadIdentityPoolProvidersRequest, ::Google::Iam::V1beta::ListWorkloadIdentityPoolProvidersResponse - # Gets an individual - # [WorkloadIdentityPoolProvider][google.iam.v1beta.WorkloadIdentityPoolProvider]. - rpc :GetWorkloadIdentityPoolProvider, ::Google::Iam::V1beta::GetWorkloadIdentityPoolProviderRequest, ::Google::Iam::V1beta::WorkloadIdentityPoolProvider - # Creates a new - # [WorkloadIdentityPoolProvider][google.iam.v1beta.WorkloadIdentityProvider] - # in a [WorkloadIdentityPool][google.iam.v1beta.WorkloadIdentityPool]. - # - # You cannot reuse the name of a deleted provider until 30 days after - # deletion. - rpc :CreateWorkloadIdentityPoolProvider, ::Google::Iam::V1beta::CreateWorkloadIdentityPoolProviderRequest, ::Google::Longrunning::Operation - # Updates an existing - # [WorkloadIdentityPoolProvider][google.iam.v1beta.WorkloadIdentityProvider]. - rpc :UpdateWorkloadIdentityPoolProvider, ::Google::Iam::V1beta::UpdateWorkloadIdentityPoolProviderRequest, ::Google::Longrunning::Operation - # Deletes a - # [WorkloadIdentityPoolProvider][google.iam.v1beta.WorkloadIdentityProvider]. - # Deleting a provider does not revoke credentials that have already been - # issued; they continue to grant access. - # You can undelete a provider for 30 days. After 30 days, deletion is - # permanent. - # You cannot update deleted providers. However, you can view and list them. - rpc :DeleteWorkloadIdentityPoolProvider, ::Google::Iam::V1beta::DeleteWorkloadIdentityPoolProviderRequest, ::Google::Longrunning::Operation - # Undeletes a - # [WorkloadIdentityPoolProvider][google.iam.v1beta.WorkloadIdentityProvider], - # as long as it was deleted fewer than 30 days ago. - rpc :UndeleteWorkloadIdentityPoolProvider, ::Google::Iam::V1beta::UndeleteWorkloadIdentityPoolProviderRequest, ::Google::Longrunning::Operation - end - - Stub = Service.rpc_stub_class - end - end - end -end diff --git a/owl-bot-staging/google-iam-v1beta/lib/google/iam/v1beta/workload_identity_pools.rb b/owl-bot-staging/google-iam-v1beta/lib/google/iam/v1beta/workload_identity_pools.rb deleted file mode 100644 index 2b3f569b9b77..000000000000 --- a/owl-bot-staging/google-iam-v1beta/lib/google/iam/v1beta/workload_identity_pools.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! - -require "gapic/common" -require "gapic/config" -require "gapic/config/method" - -require "google/iam/v1beta/version" - -require "google/iam/v1beta/workload_identity_pools/credentials" -require "google/iam/v1beta/workload_identity_pools/paths" -require "google/iam/v1beta/workload_identity_pools/operations" -require "google/iam/v1beta/workload_identity_pools/client" - -module Google - module Iam - module V1beta - ## - # Manages WorkloadIdentityPools. - # - # @example Load this service and instantiate a gRPC client - # - # require "google/iam/v1beta/workload_identity_pools" - # client = ::Google::Iam::V1beta::WorkloadIdentityPools::Client.new - # - module WorkloadIdentityPools - end - end - end -end - -helper_path = ::File.join __dir__, "workload_identity_pools", "helpers.rb" -require "google/iam/v1beta/workload_identity_pools/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-iam-v1beta/lib/google/iam/v1beta/workload_identity_pools/client.rb b/owl-bot-staging/google-iam-v1beta/lib/google/iam/v1beta/workload_identity_pools/client.rb deleted file mode 100644 index 1408ae58dae9..000000000000 --- a/owl-bot-staging/google-iam-v1beta/lib/google/iam/v1beta/workload_identity_pools/client.rb +++ /dev/null @@ -1,1718 +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/iam/v1beta/workload_identity_pool_pb" - -module Google - module Iam - module V1beta - module WorkloadIdentityPools - ## - # Client for the WorkloadIdentityPools service. - # - # Manages WorkloadIdentityPools. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "iam.$UNIVERSE_DOMAIN$" - - include Paths - - # @private - attr_reader :workload_identity_pools_stub - - ## - # Configure the WorkloadIdentityPools Client class. - # - # See {::Google::Iam::V1beta::WorkloadIdentityPools::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all WorkloadIdentityPools clients - # ::Google::Iam::V1beta::WorkloadIdentityPools::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", "Iam", "V1beta"] - 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_workload_identity_pools.timeout = 60.0 - default_config.rpcs.list_workload_identity_pools.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.get_workload_identity_pool.timeout = 60.0 - default_config.rpcs.get_workload_identity_pool.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.create_workload_identity_pool.timeout = 60.0 - default_config.rpcs.create_workload_identity_pool.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.update_workload_identity_pool.timeout = 60.0 - default_config.rpcs.update_workload_identity_pool.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.delete_workload_identity_pool.timeout = 60.0 - default_config.rpcs.delete_workload_identity_pool.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.undelete_workload_identity_pool.timeout = 60.0 - default_config.rpcs.undelete_workload_identity_pool.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.list_workload_identity_pool_providers.timeout = 60.0 - default_config.rpcs.list_workload_identity_pool_providers.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.get_workload_identity_pool_provider.timeout = 60.0 - default_config.rpcs.get_workload_identity_pool_provider.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.create_workload_identity_pool_provider.timeout = 60.0 - default_config.rpcs.create_workload_identity_pool_provider.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.update_workload_identity_pool_provider.timeout = 60.0 - default_config.rpcs.update_workload_identity_pool_provider.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.delete_workload_identity_pool_provider.timeout = 60.0 - default_config.rpcs.delete_workload_identity_pool_provider.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config.rpcs.undelete_workload_identity_pool_provider.timeout = 60.0 - default_config.rpcs.undelete_workload_identity_pool_provider.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14, 4] - } - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the WorkloadIdentityPools 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::Iam::V1beta::WorkloadIdentityPools::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 - @workload_identity_pools_stub.universe_domain - end - - ## - # Create a new WorkloadIdentityPools client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Iam::V1beta::WorkloadIdentityPools::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Iam::V1beta::WorkloadIdentityPools::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the WorkloadIdentityPools 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/iam/v1beta/workload_identity_pool_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 - - @workload_identity_pools_stub = ::Gapic::ServiceStub.new( - ::Google::Iam::V1beta::WorkloadIdentityPools::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 - ) - - @workload_identity_pools_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 - end - - ## - # Get the associated client for long-running operations. - # - # @return [::Google::Iam::V1beta::WorkloadIdentityPools::Operations] - # - attr_reader :operations_client - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @workload_identity_pools_stub.logger - end - - # Service calls - - ## - # Lists all non-deleted - # {::Google::Iam::V1beta::WorkloadIdentityPool WorkloadIdentityPool}s in a - # project. If `show_deleted` is set to `true`, then deleted pools are also - # listed. - # - # @overload list_workload_identity_pools(request, options = nil) - # Pass arguments to `list_workload_identity_pools` via a request object, either of type - # {::Google::Iam::V1beta::ListWorkloadIdentityPoolsRequest} or an equivalent Hash. - # - # @param request [::Google::Iam::V1beta::ListWorkloadIdentityPoolsRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_workload_identity_pools(parent: nil, page_size: nil, page_token: nil, show_deleted: nil) - # Pass arguments to `list_workload_identity_pools` via keyword arguments. Note that at - # least one keyword argument is 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 parent resource to list pools for. - # @param page_size [::Integer] - # The maximum number of pools to return. - # If unspecified, at most 50 pools are returned. - # The maximum value is 1000; values above are 1000 truncated to 1000. - # @param page_token [::String] - # A page token, received from a previous `ListWorkloadIdentityPools` - # call. Provide this to retrieve the subsequent page. - # @param show_deleted [::Boolean] - # Whether to return soft-deleted pools. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Iam::V1beta::WorkloadIdentityPool>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Iam::V1beta::WorkloadIdentityPool>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/iam/v1beta" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Iam::V1beta::WorkloadIdentityPools::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Iam::V1beta::ListWorkloadIdentityPoolsRequest.new - # - # # Call the list_workload_identity_pools method. - # result = client.list_workload_identity_pools 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::Iam::V1beta::WorkloadIdentityPool. - # p item - # end - # - def list_workload_identity_pools request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1beta::ListWorkloadIdentityPoolsRequest - - # Converts hash 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_workload_identity_pools.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::Iam::V1beta::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_workload_identity_pools.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_workload_identity_pools.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @workload_identity_pools_stub.call_rpc :list_workload_identity_pools, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @workload_identity_pools_stub, :list_workload_identity_pools, 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 - - ## - # Gets an individual - # {::Google::Iam::V1beta::WorkloadIdentityPool WorkloadIdentityPool}. - # - # @overload get_workload_identity_pool(request, options = nil) - # Pass arguments to `get_workload_identity_pool` via a request object, either of type - # {::Google::Iam::V1beta::GetWorkloadIdentityPoolRequest} or an equivalent Hash. - # - # @param request [::Google::Iam::V1beta::GetWorkloadIdentityPoolRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_workload_identity_pool(name: nil) - # Pass arguments to `get_workload_identity_pool` via keyword arguments. Note that at - # least one keyword argument is 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 name of the pool to retrieve. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Iam::V1beta::WorkloadIdentityPool] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Iam::V1beta::WorkloadIdentityPool] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/iam/v1beta" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Iam::V1beta::WorkloadIdentityPools::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Iam::V1beta::GetWorkloadIdentityPoolRequest.new - # - # # Call the get_workload_identity_pool method. - # result = client.get_workload_identity_pool request - # - # # The returned object is of type Google::Iam::V1beta::WorkloadIdentityPool. - # p result - # - def get_workload_identity_pool request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1beta::GetWorkloadIdentityPoolRequest - - # Converts hash 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_workload_identity_pool.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::Iam::V1beta::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_workload_identity_pool.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_workload_identity_pool.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @workload_identity_pools_stub.call_rpc :get_workload_identity_pool, 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::Iam::V1beta::WorkloadIdentityPool WorkloadIdentityPool}. - # - # You cannot reuse the name of a deleted pool until 30 days after deletion. - # - # @overload create_workload_identity_pool(request, options = nil) - # Pass arguments to `create_workload_identity_pool` via a request object, either of type - # {::Google::Iam::V1beta::CreateWorkloadIdentityPoolRequest} or an equivalent Hash. - # - # @param request [::Google::Iam::V1beta::CreateWorkloadIdentityPoolRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_workload_identity_pool(parent: nil, workload_identity_pool: nil, workload_identity_pool_id: nil) - # Pass arguments to `create_workload_identity_pool` via keyword arguments. Note that at - # least one keyword argument is 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 parent resource to create the pool in. The only supported - # location is `global`. - # @param workload_identity_pool [::Google::Iam::V1beta::WorkloadIdentityPool, ::Hash] - # Required. The pool to create. - # @param workload_identity_pool_id [::String] - # Required. The ID to use for the pool, which becomes the - # final component of the resource name. This value should be 4-32 characters, - # and may contain the characters [a-z0-9-]. The prefix `gcp-` is - # reserved for use by Google, and may not be specified. - # - # @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/iam/v1beta" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Iam::V1beta::WorkloadIdentityPools::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Iam::V1beta::CreateWorkloadIdentityPoolRequest.new - # - # # Call the create_workload_identity_pool method. - # result = client.create_workload_identity_pool 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_workload_identity_pool request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1beta::CreateWorkloadIdentityPoolRequest - - # Converts hash 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_workload_identity_pool.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::Iam::V1beta::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_workload_identity_pool.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_workload_identity_pool.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @workload_identity_pools_stub.call_rpc :create_workload_identity_pool, 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 - - ## - # Updates an existing - # {::Google::Iam::V1beta::WorkloadIdentityPool WorkloadIdentityPool}. - # - # @overload update_workload_identity_pool(request, options = nil) - # Pass arguments to `update_workload_identity_pool` via a request object, either of type - # {::Google::Iam::V1beta::UpdateWorkloadIdentityPoolRequest} or an equivalent Hash. - # - # @param request [::Google::Iam::V1beta::UpdateWorkloadIdentityPoolRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_workload_identity_pool(workload_identity_pool: nil, update_mask: nil) - # Pass arguments to `update_workload_identity_pool` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param workload_identity_pool [::Google::Iam::V1beta::WorkloadIdentityPool, ::Hash] - # Required. The pool to update. The `name` field is used to identify the pool. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Required. The list of fields update. - # - # @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/iam/v1beta" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Iam::V1beta::WorkloadIdentityPools::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Iam::V1beta::UpdateWorkloadIdentityPoolRequest.new - # - # # Call the update_workload_identity_pool method. - # result = client.update_workload_identity_pool 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 update_workload_identity_pool request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1beta::UpdateWorkloadIdentityPoolRequest - - # Converts hash 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_workload_identity_pool.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::Iam::V1beta::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.workload_identity_pool&.name - header_params["workload_identity_pool.name"] = request.workload_identity_pool.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_workload_identity_pool.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_workload_identity_pool.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @workload_identity_pools_stub.call_rpc :update_workload_identity_pool, 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 - # {::Google::Iam::V1beta::WorkloadIdentityPool WorkloadIdentityPool}. - # - # You cannot use a deleted pool to exchange external - # credentials for Google Cloud credentials. However, deletion does - # not revoke credentials that have already been issued. - # Credentials issued for a deleted pool do not grant access to resources. - # If the pool is undeleted, and the credentials are not expired, they - # grant access again. - # You can undelete a pool for 30 days. After 30 days, deletion is - # permanent. - # You cannot update deleted pools. However, you can view and list them. - # - # @overload delete_workload_identity_pool(request, options = nil) - # Pass arguments to `delete_workload_identity_pool` via a request object, either of type - # {::Google::Iam::V1beta::DeleteWorkloadIdentityPoolRequest} or an equivalent Hash. - # - # @param request [::Google::Iam::V1beta::DeleteWorkloadIdentityPoolRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_workload_identity_pool(name: nil) - # Pass arguments to `delete_workload_identity_pool` via keyword arguments. Note that at - # least one keyword argument is 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 name of the pool 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/iam/v1beta" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Iam::V1beta::WorkloadIdentityPools::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Iam::V1beta::DeleteWorkloadIdentityPoolRequest.new - # - # # Call the delete_workload_identity_pool method. - # result = client.delete_workload_identity_pool 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_workload_identity_pool request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1beta::DeleteWorkloadIdentityPoolRequest - - # Converts hash 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_workload_identity_pool.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::Iam::V1beta::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_workload_identity_pool.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_workload_identity_pool.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @workload_identity_pools_stub.call_rpc :delete_workload_identity_pool, 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 - - ## - # Undeletes a {::Google::Iam::V1beta::WorkloadIdentityPool WorkloadIdentityPool}, - # as long as it was deleted fewer than 30 days ago. - # - # @overload undelete_workload_identity_pool(request, options = nil) - # Pass arguments to `undelete_workload_identity_pool` via a request object, either of type - # {::Google::Iam::V1beta::UndeleteWorkloadIdentityPoolRequest} or an equivalent Hash. - # - # @param request [::Google::Iam::V1beta::UndeleteWorkloadIdentityPoolRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload undelete_workload_identity_pool(name: nil) - # Pass arguments to `undelete_workload_identity_pool` via keyword arguments. Note that at - # least one keyword argument is 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 name of the pool to undelete. - # - # @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/iam/v1beta" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Iam::V1beta::WorkloadIdentityPools::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Iam::V1beta::UndeleteWorkloadIdentityPoolRequest.new - # - # # Call the undelete_workload_identity_pool method. - # result = client.undelete_workload_identity_pool 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 undelete_workload_identity_pool request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1beta::UndeleteWorkloadIdentityPoolRequest - - # Converts hash 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.undelete_workload_identity_pool.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::Iam::V1beta::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.undelete_workload_identity_pool.timeout, - metadata: metadata, - retry_policy: @config.rpcs.undelete_workload_identity_pool.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @workload_identity_pools_stub.call_rpc :undelete_workload_identity_pool, 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 - - ## - # Lists all non-deleted - # {::Google::Iam::V1beta::WorkloadIdentityPoolProvider WorkloadIdentityPoolProvider}s - # in a {::Google::Iam::V1beta::WorkloadIdentityPool WorkloadIdentityPool}. - # If `show_deleted` is set to `true`, then deleted providers are also listed. - # - # @overload list_workload_identity_pool_providers(request, options = nil) - # Pass arguments to `list_workload_identity_pool_providers` via a request object, either of type - # {::Google::Iam::V1beta::ListWorkloadIdentityPoolProvidersRequest} or an equivalent Hash. - # - # @param request [::Google::Iam::V1beta::ListWorkloadIdentityPoolProvidersRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_workload_identity_pool_providers(parent: nil, page_size: nil, page_token: nil, show_deleted: nil) - # Pass arguments to `list_workload_identity_pool_providers` via keyword arguments. Note that at - # least one keyword argument is 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 pool to list providers for. - # @param page_size [::Integer] - # The maximum number of providers to return. - # If unspecified, at most 50 providers are returned. - # The maximum value is 100; values above 100 are truncated to 100. - # @param page_token [::String] - # A page token, received from a previous - # `ListWorkloadIdentityPoolProviders` call. Provide this to retrieve the - # subsequent page. - # @param show_deleted [::Boolean] - # Whether to return soft-deleted providers. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Iam::V1beta::WorkloadIdentityPoolProvider>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Iam::V1beta::WorkloadIdentityPoolProvider>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/iam/v1beta" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Iam::V1beta::WorkloadIdentityPools::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Iam::V1beta::ListWorkloadIdentityPoolProvidersRequest.new - # - # # Call the list_workload_identity_pool_providers method. - # result = client.list_workload_identity_pool_providers 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::Iam::V1beta::WorkloadIdentityPoolProvider. - # p item - # end - # - def list_workload_identity_pool_providers request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1beta::ListWorkloadIdentityPoolProvidersRequest - - # Converts hash 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_workload_identity_pool_providers.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::Iam::V1beta::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_workload_identity_pool_providers.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_workload_identity_pool_providers.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @workload_identity_pools_stub.call_rpc :list_workload_identity_pool_providers, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @workload_identity_pools_stub, :list_workload_identity_pool_providers, 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 - - ## - # Gets an individual - # {::Google::Iam::V1beta::WorkloadIdentityPoolProvider WorkloadIdentityPoolProvider}. - # - # @overload get_workload_identity_pool_provider(request, options = nil) - # Pass arguments to `get_workload_identity_pool_provider` via a request object, either of type - # {::Google::Iam::V1beta::GetWorkloadIdentityPoolProviderRequest} or an equivalent Hash. - # - # @param request [::Google::Iam::V1beta::GetWorkloadIdentityPoolProviderRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_workload_identity_pool_provider(name: nil) - # Pass arguments to `get_workload_identity_pool_provider` via keyword arguments. Note that at - # least one keyword argument is 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 name of the provider to retrieve. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Iam::V1beta::WorkloadIdentityPoolProvider] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Iam::V1beta::WorkloadIdentityPoolProvider] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/iam/v1beta" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Iam::V1beta::WorkloadIdentityPools::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Iam::V1beta::GetWorkloadIdentityPoolProviderRequest.new - # - # # Call the get_workload_identity_pool_provider method. - # result = client.get_workload_identity_pool_provider request - # - # # The returned object is of type Google::Iam::V1beta::WorkloadIdentityPoolProvider. - # p result - # - def get_workload_identity_pool_provider request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1beta::GetWorkloadIdentityPoolProviderRequest - - # Converts hash 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_workload_identity_pool_provider.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::Iam::V1beta::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_workload_identity_pool_provider.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_workload_identity_pool_provider.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @workload_identity_pools_stub.call_rpc :get_workload_identity_pool_provider, 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 - # [WorkloadIdentityPoolProvider][google.iam.v1beta.WorkloadIdentityProvider] - # in a {::Google::Iam::V1beta::WorkloadIdentityPool WorkloadIdentityPool}. - # - # You cannot reuse the name of a deleted provider until 30 days after - # deletion. - # - # @overload create_workload_identity_pool_provider(request, options = nil) - # Pass arguments to `create_workload_identity_pool_provider` via a request object, either of type - # {::Google::Iam::V1beta::CreateWorkloadIdentityPoolProviderRequest} or an equivalent Hash. - # - # @param request [::Google::Iam::V1beta::CreateWorkloadIdentityPoolProviderRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_workload_identity_pool_provider(parent: nil, workload_identity_pool_provider: nil, workload_identity_pool_provider_id: nil) - # Pass arguments to `create_workload_identity_pool_provider` via keyword arguments. Note that at - # least one keyword argument is 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 pool to create this provider in. - # @param workload_identity_pool_provider [::Google::Iam::V1beta::WorkloadIdentityPoolProvider, ::Hash] - # Required. The provider to create. - # @param workload_identity_pool_provider_id [::String] - # Required. The ID for the provider, which becomes the - # final component of the resource name. This value must be 4-32 characters, - # and may contain the characters [a-z0-9-]. The prefix `gcp-` is - # reserved for use by Google, and may not be specified. - # - # @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/iam/v1beta" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Iam::V1beta::WorkloadIdentityPools::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Iam::V1beta::CreateWorkloadIdentityPoolProviderRequest.new - # - # # Call the create_workload_identity_pool_provider method. - # result = client.create_workload_identity_pool_provider 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_workload_identity_pool_provider request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1beta::CreateWorkloadIdentityPoolProviderRequest - - # Converts hash 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_workload_identity_pool_provider.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::Iam::V1beta::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_workload_identity_pool_provider.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_workload_identity_pool_provider.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @workload_identity_pools_stub.call_rpc :create_workload_identity_pool_provider, 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 - - ## - # Updates an existing - # [WorkloadIdentityPoolProvider][google.iam.v1beta.WorkloadIdentityProvider]. - # - # @overload update_workload_identity_pool_provider(request, options = nil) - # Pass arguments to `update_workload_identity_pool_provider` via a request object, either of type - # {::Google::Iam::V1beta::UpdateWorkloadIdentityPoolProviderRequest} or an equivalent Hash. - # - # @param request [::Google::Iam::V1beta::UpdateWorkloadIdentityPoolProviderRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_workload_identity_pool_provider(workload_identity_pool_provider: nil, update_mask: nil) - # Pass arguments to `update_workload_identity_pool_provider` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param workload_identity_pool_provider [::Google::Iam::V1beta::WorkloadIdentityPoolProvider, ::Hash] - # Required. The provider to update. - # @param update_mask [::Google::Protobuf::FieldMask, ::Hash] - # Required. The list of fields to update. - # - # @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/iam/v1beta" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Iam::V1beta::WorkloadIdentityPools::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Iam::V1beta::UpdateWorkloadIdentityPoolProviderRequest.new - # - # # Call the update_workload_identity_pool_provider method. - # result = client.update_workload_identity_pool_provider 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 update_workload_identity_pool_provider request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1beta::UpdateWorkloadIdentityPoolProviderRequest - - # Converts hash 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_workload_identity_pool_provider.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::Iam::V1beta::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.workload_identity_pool_provider&.name - header_params["workload_identity_pool_provider.name"] = request.workload_identity_pool_provider.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_workload_identity_pool_provider.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_workload_identity_pool_provider.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @workload_identity_pools_stub.call_rpc :update_workload_identity_pool_provider, 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 - # [WorkloadIdentityPoolProvider][google.iam.v1beta.WorkloadIdentityProvider]. - # Deleting a provider does not revoke credentials that have already been - # issued; they continue to grant access. - # You can undelete a provider for 30 days. After 30 days, deletion is - # permanent. - # You cannot update deleted providers. However, you can view and list them. - # - # @overload delete_workload_identity_pool_provider(request, options = nil) - # Pass arguments to `delete_workload_identity_pool_provider` via a request object, either of type - # {::Google::Iam::V1beta::DeleteWorkloadIdentityPoolProviderRequest} or an equivalent Hash. - # - # @param request [::Google::Iam::V1beta::DeleteWorkloadIdentityPoolProviderRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_workload_identity_pool_provider(name: nil) - # Pass arguments to `delete_workload_identity_pool_provider` via keyword arguments. Note that at - # least one keyword argument is 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 name of the provider 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/iam/v1beta" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Iam::V1beta::WorkloadIdentityPools::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Iam::V1beta::DeleteWorkloadIdentityPoolProviderRequest.new - # - # # Call the delete_workload_identity_pool_provider method. - # result = client.delete_workload_identity_pool_provider 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_workload_identity_pool_provider request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1beta::DeleteWorkloadIdentityPoolProviderRequest - - # Converts hash 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_workload_identity_pool_provider.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::Iam::V1beta::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_workload_identity_pool_provider.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_workload_identity_pool_provider.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @workload_identity_pools_stub.call_rpc :delete_workload_identity_pool_provider, 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 - - ## - # Undeletes a - # [WorkloadIdentityPoolProvider][google.iam.v1beta.WorkloadIdentityProvider], - # as long as it was deleted fewer than 30 days ago. - # - # @overload undelete_workload_identity_pool_provider(request, options = nil) - # Pass arguments to `undelete_workload_identity_pool_provider` via a request object, either of type - # {::Google::Iam::V1beta::UndeleteWorkloadIdentityPoolProviderRequest} or an equivalent Hash. - # - # @param request [::Google::Iam::V1beta::UndeleteWorkloadIdentityPoolProviderRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter values, pass an empty Hash. - # @param options [::Gapic::CallOptions, ::Hash] - # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional. - # - # @overload undelete_workload_identity_pool_provider(name: nil) - # Pass arguments to `undelete_workload_identity_pool_provider` via keyword arguments. Note that at - # least one keyword argument is 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 name of the provider to undelete. - # - # @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/iam/v1beta" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Iam::V1beta::WorkloadIdentityPools::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Iam::V1beta::UndeleteWorkloadIdentityPoolProviderRequest.new - # - # # Call the undelete_workload_identity_pool_provider method. - # result = client.undelete_workload_identity_pool_provider 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 undelete_workload_identity_pool_provider request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V1beta::UndeleteWorkloadIdentityPoolProviderRequest - - # Converts hash 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.undelete_workload_identity_pool_provider.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::Iam::V1beta::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.undelete_workload_identity_pool_provider.timeout, - metadata: metadata, - retry_policy: @config.rpcs.undelete_workload_identity_pool_provider.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @workload_identity_pools_stub.call_rpc :undelete_workload_identity_pool_provider, 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 WorkloadIdentityPools API. - # - # This class represents the configuration for WorkloadIdentityPools, - # 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::Iam::V1beta::WorkloadIdentityPools::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_workload_identity_pools to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Iam::V1beta::WorkloadIdentityPools::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_workload_identity_pools.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Iam::V1beta::WorkloadIdentityPools::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_workload_identity_pools.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::Iam::V1beta::WorkloadIdentityPools::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 = "iam.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 WorkloadIdentityPools 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_workload_identity_pools` - # @return [::Gapic::Config::Method] - # - attr_reader :list_workload_identity_pools - ## - # RPC-specific configuration for `get_workload_identity_pool` - # @return [::Gapic::Config::Method] - # - attr_reader :get_workload_identity_pool - ## - # RPC-specific configuration for `create_workload_identity_pool` - # @return [::Gapic::Config::Method] - # - attr_reader :create_workload_identity_pool - ## - # RPC-specific configuration for `update_workload_identity_pool` - # @return [::Gapic::Config::Method] - # - attr_reader :update_workload_identity_pool - ## - # RPC-specific configuration for `delete_workload_identity_pool` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_workload_identity_pool - ## - # RPC-specific configuration for `undelete_workload_identity_pool` - # @return [::Gapic::Config::Method] - # - attr_reader :undelete_workload_identity_pool - ## - # RPC-specific configuration for `list_workload_identity_pool_providers` - # @return [::Gapic::Config::Method] - # - attr_reader :list_workload_identity_pool_providers - ## - # RPC-specific configuration for `get_workload_identity_pool_provider` - # @return [::Gapic::Config::Method] - # - attr_reader :get_workload_identity_pool_provider - ## - # RPC-specific configuration for `create_workload_identity_pool_provider` - # @return [::Gapic::Config::Method] - # - attr_reader :create_workload_identity_pool_provider - ## - # RPC-specific configuration for `update_workload_identity_pool_provider` - # @return [::Gapic::Config::Method] - # - attr_reader :update_workload_identity_pool_provider - ## - # RPC-specific configuration for `delete_workload_identity_pool_provider` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_workload_identity_pool_provider - ## - # RPC-specific configuration for `undelete_workload_identity_pool_provider` - # @return [::Gapic::Config::Method] - # - attr_reader :undelete_workload_identity_pool_provider - - # @private - def initialize parent_rpcs = nil - list_workload_identity_pools_config = parent_rpcs.list_workload_identity_pools if parent_rpcs.respond_to? :list_workload_identity_pools - @list_workload_identity_pools = ::Gapic::Config::Method.new list_workload_identity_pools_config - get_workload_identity_pool_config = parent_rpcs.get_workload_identity_pool if parent_rpcs.respond_to? :get_workload_identity_pool - @get_workload_identity_pool = ::Gapic::Config::Method.new get_workload_identity_pool_config - create_workload_identity_pool_config = parent_rpcs.create_workload_identity_pool if parent_rpcs.respond_to? :create_workload_identity_pool - @create_workload_identity_pool = ::Gapic::Config::Method.new create_workload_identity_pool_config - update_workload_identity_pool_config = parent_rpcs.update_workload_identity_pool if parent_rpcs.respond_to? :update_workload_identity_pool - @update_workload_identity_pool = ::Gapic::Config::Method.new update_workload_identity_pool_config - delete_workload_identity_pool_config = parent_rpcs.delete_workload_identity_pool if parent_rpcs.respond_to? :delete_workload_identity_pool - @delete_workload_identity_pool = ::Gapic::Config::Method.new delete_workload_identity_pool_config - undelete_workload_identity_pool_config = parent_rpcs.undelete_workload_identity_pool if parent_rpcs.respond_to? :undelete_workload_identity_pool - @undelete_workload_identity_pool = ::Gapic::Config::Method.new undelete_workload_identity_pool_config - list_workload_identity_pool_providers_config = parent_rpcs.list_workload_identity_pool_providers if parent_rpcs.respond_to? :list_workload_identity_pool_providers - @list_workload_identity_pool_providers = ::Gapic::Config::Method.new list_workload_identity_pool_providers_config - get_workload_identity_pool_provider_config = parent_rpcs.get_workload_identity_pool_provider if parent_rpcs.respond_to? :get_workload_identity_pool_provider - @get_workload_identity_pool_provider = ::Gapic::Config::Method.new get_workload_identity_pool_provider_config - create_workload_identity_pool_provider_config = parent_rpcs.create_workload_identity_pool_provider if parent_rpcs.respond_to? :create_workload_identity_pool_provider - @create_workload_identity_pool_provider = ::Gapic::Config::Method.new create_workload_identity_pool_provider_config - update_workload_identity_pool_provider_config = parent_rpcs.update_workload_identity_pool_provider if parent_rpcs.respond_to? :update_workload_identity_pool_provider - @update_workload_identity_pool_provider = ::Gapic::Config::Method.new update_workload_identity_pool_provider_config - delete_workload_identity_pool_provider_config = parent_rpcs.delete_workload_identity_pool_provider if parent_rpcs.respond_to? :delete_workload_identity_pool_provider - @delete_workload_identity_pool_provider = ::Gapic::Config::Method.new delete_workload_identity_pool_provider_config - undelete_workload_identity_pool_provider_config = parent_rpcs.undelete_workload_identity_pool_provider if parent_rpcs.respond_to? :undelete_workload_identity_pool_provider - @undelete_workload_identity_pool_provider = ::Gapic::Config::Method.new undelete_workload_identity_pool_provider_config - - yield self if block_given? - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-iam-v1beta/lib/google/iam/v1beta/workload_identity_pools/credentials.rb b/owl-bot-staging/google-iam-v1beta/lib/google/iam/v1beta/workload_identity_pools/credentials.rb deleted file mode 100644 index 860275d22643..000000000000 --- a/owl-bot-staging/google-iam-v1beta/lib/google/iam/v1beta/workload_identity_pools/credentials.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 "googleauth" - -module Google - module Iam - module V1beta - module WorkloadIdentityPools - # Credentials for the WorkloadIdentityPools API. - class Credentials < ::Google::Auth::Credentials - self.scope = [ - "https://www.googleapis.com/auth/cloud-platform" - ] - self.env_vars = [ - "IAM_CREDENTIALS", - "IAM_KEYFILE", - "GOOGLE_CLOUD_CREDENTIALS", - "GOOGLE_CLOUD_KEYFILE", - "GCLOUD_KEYFILE", - "IAM_CREDENTIALS_JSON", - "IAM_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 diff --git a/owl-bot-staging/google-iam-v1beta/lib/google/iam/v1beta/workload_identity_pools/operations.rb b/owl-bot-staging/google-iam-v1beta/lib/google/iam/v1beta/workload_identity_pools/operations.rb deleted file mode 100644 index b3b9896d2daf..000000000000 --- a/owl-bot-staging/google-iam-v1beta/lib/google/iam/v1beta/workload_identity_pools/operations.rb +++ /dev/null @@ -1,839 +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 Iam - module V1beta - module WorkloadIdentityPools - # Service that implements Longrunning Operations API. - class Operations - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "iam.$UNIVERSE_DOMAIN$" - - # @private - attr_reader :operations_stub - - ## - # Configuration for the WorkloadIdentityPools 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 WorkloadIdentityPools 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::Iam::V1beta::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::Iam::V1beta::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::Iam::V1beta::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::Iam::V1beta::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::Iam::V1beta::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 = "iam.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 diff --git a/owl-bot-staging/google-iam-v1beta/lib/google/iam/v1beta/workload_identity_pools/paths.rb b/owl-bot-staging/google-iam-v1beta/lib/google/iam/v1beta/workload_identity_pools/paths.rb deleted file mode 100644 index efdcf8b4dd15..000000000000 --- a/owl-bot-staging/google-iam-v1beta/lib/google/iam/v1beta/workload_identity_pools/paths.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 Iam - module V1beta - module WorkloadIdentityPools - # Path helper methods for the WorkloadIdentityPools API. - module Paths - ## - # 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 - - ## - # Create a fully-qualified WorkloadIdentityPool resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/workloadIdentityPools/{workload_identity_pool}` - # - # @param project [String] - # @param location [String] - # @param workload_identity_pool [String] - # - # @return [::String] - def workload_identity_pool_path project:, location:, workload_identity_pool: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - - "projects/#{project}/locations/#{location}/workloadIdentityPools/#{workload_identity_pool}" - end - - ## - # Create a fully-qualified WorkloadIdentityPoolProvider resource string. - # - # The resource will be in the following format: - # - # `projects/{project}/locations/{location}/workloadIdentityPools/{workload_identity_pool}/providers/{workload_identity_pool_provider}` - # - # @param project [String] - # @param location [String] - # @param workload_identity_pool [String] - # @param workload_identity_pool_provider [String] - # - # @return [::String] - def workload_identity_pool_provider_path project:, location:, workload_identity_pool:, workload_identity_pool_provider: - raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/" - raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/" - raise ::ArgumentError, "workload_identity_pool cannot contain /" if workload_identity_pool.to_s.include? "/" - - "projects/#{project}/locations/#{location}/workloadIdentityPools/#{workload_identity_pool}/providers/#{workload_identity_pool_provider}" - end - - extend self - end - end - end - end -end diff --git a/owl-bot-staging/google-iam-v1beta/proto_docs/README.md b/owl-bot-staging/google-iam-v1beta/proto_docs/README.md deleted file mode 100644 index 2b729bf74b6d..000000000000 --- a/owl-bot-staging/google-iam-v1beta/proto_docs/README.md +++ /dev/null @@ -1,4 +0,0 @@ -# Google IAM V1beta 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-iam-v1beta/proto_docs/google/api/client.rb b/owl-bot-staging/google-iam-v1beta/proto_docs/google/api/client.rb deleted file mode 100644 index 3ab0b096d445..000000000000 --- a/owl-bot-staging/google-iam-v1beta/proto_docs/google/api/client.rb +++ /dev/null @@ -1,593 +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. - # - # Note: This field should not be used in most cases. - 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: - # library_settings: - # 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. - # @!attribute [rw] library_package - # @return [::String] - # The package name to use in Php. Clobbers the php_namespace option - # set in the protobuf. This should be used **only** by APIs - # who have already set the language_settings.php.package_name" field - # in gapic.yaml. API teams should use the protobuf php_namespace option - # where possible. - # - # Example of a YAML configuration:: - # - # publishing: - # library_settings: - # php_settings: - # library_package: Google\Cloud\PubSub\V1 - 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. - # - # Example: - # - # 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 - # @!attribute [rw] batching - # @return [::Google::Api::BatchingConfigProto] - # Batching configuration for an API method in client libraries. - # - # Example of a YAML configuration: - # - # publishing: - # method_settings: - # - selector: google.example.v1.ExampleService.BatchCreateExample - # batching: - # element_count_threshold: 1000 - # request_byte_threshold: 100000000 - # delay_threshold_millis: 10 - 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. - # - # Note: This feature should not be used in most cases. - # @!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 - - # `BatchingConfigProto` defines the batching configuration for an API method. - # @!attribute [rw] thresholds - # @return [::Google::Api::BatchingSettingsProto] - # The thresholds which trigger a batched request to be sent. - # @!attribute [rw] batch_descriptor - # @return [::Google::Api::BatchingDescriptorProto] - # The request and response fields used in batching. - class BatchingConfigProto - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # `BatchingSettingsProto` specifies a set of batching thresholds, each of - # which acts as a trigger to send a batch of messages as a request. At least - # one threshold must be positive nonzero. - # @!attribute [rw] element_count_threshold - # @return [::Integer] - # The number of elements of a field collected into a batch which, if - # exceeded, causes the batch to be sent. - # @!attribute [rw] request_byte_threshold - # @return [::Integer] - # The aggregated size of the batched field which, if exceeded, causes the - # batch to be sent. This size is computed by aggregating the sizes of the - # request field to be batched, not of the entire request message. - # @!attribute [rw] delay_threshold - # @return [::Google::Protobuf::Duration] - # The duration after which a batch should be sent, starting from the addition - # of the first message to that batch. - # @!attribute [rw] element_count_limit - # @return [::Integer] - # The maximum number of elements collected in a batch that could be accepted - # by server. - # @!attribute [rw] request_byte_limit - # @return [::Integer] - # The maximum size of the request that could be accepted by server. - # @!attribute [rw] flow_control_element_limit - # @return [::Integer] - # The maximum number of elements allowed by flow control. - # @!attribute [rw] flow_control_byte_limit - # @return [::Integer] - # The maximum size of data allowed by flow control. - # @!attribute [rw] flow_control_limit_exceeded_behavior - # @return [::Google::Api::FlowControlLimitExceededBehaviorProto] - # The behavior to take when the flow control limit is exceeded. - class BatchingSettingsProto - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # `BatchingDescriptorProto` specifies the fields of the request message to be - # used for batching, and, optionally, the fields of the response message to be - # used for demultiplexing. - # @!attribute [rw] batched_field - # @return [::String] - # The repeated field in the request message to be aggregated by batching. - # @!attribute [rw] discriminator_fields - # @return [::Array<::String>] - # A list of the fields in the request message. Two requests will be batched - # together only if the values of every field specified in - # `request_discriminator_fields` is equal between the two requests. - # @!attribute [rw] subresponse_field - # @return [::String] - # Optional. When present, indicates the field in the response message to be - # used to demultiplex the response into multiple response messages, in - # correspondence with the multiple request messages originally batched - # together. - class BatchingDescriptorProto - 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 - - # The behavior to take when the flow control limit is exceeded. - module FlowControlLimitExceededBehaviorProto - # Default behavior, system-defined. - UNSET_BEHAVIOR = 0 - - # Stop operation, raise error. - THROW_EXCEPTION = 1 - - # Pause operation until limit clears. - BLOCK = 2 - - # Continue operation, disregard limit. - IGNORE = 3 - end - end -end diff --git a/owl-bot-staging/google-iam-v1beta/proto_docs/google/api/field_behavior.rb b/owl-bot-staging/google-iam-v1beta/proto_docs/google/api/field_behavior.rb deleted file mode 100644 index 582be187d115..000000000000 --- a/owl-bot-staging/google-iam-v1beta/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-iam-v1beta/proto_docs/google/api/launch_stage.rb b/owl-bot-staging/google-iam-v1beta/proto_docs/google/api/launch_stage.rb deleted file mode 100644 index 9392a413fb1b..000000000000 --- a/owl-bot-staging/google-iam-v1beta/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-iam-v1beta/proto_docs/google/api/resource.rb b/owl-bot-staging/google-iam-v1beta/proto_docs/google/api/resource.rb deleted file mode 100644 index 25dec4847ac1..000000000000 --- a/owl-bot-staging/google-iam-v1beta/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-iam-v1beta/proto_docs/google/iam/v1beta/workload_identity_pool.rb b/owl-bot-staging/google-iam-v1beta/proto_docs/google/iam/v1beta/workload_identity_pool.rb deleted file mode 100644 index 175cbd0fee65..000000000000 --- a/owl-bot-staging/google-iam-v1beta/proto_docs/google/iam/v1beta/workload_identity_pool.rb +++ /dev/null @@ -1,467 +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 Iam - module V1beta - # Represents a collection of external workload identities. You can define IAM - # policies to grant these identities access to Google Cloud resources. - # @!attribute [r] name - # @return [::String] - # Output only. The resource name of the pool. - # @!attribute [rw] display_name - # @return [::String] - # A display name for the pool. Cannot exceed 32 characters. - # @!attribute [rw] description - # @return [::String] - # A description of the pool. Cannot exceed 256 characters. - # @!attribute [r] state - # @return [::Google::Iam::V1beta::WorkloadIdentityPool::State] - # Output only. The state of the pool. - # @!attribute [rw] disabled - # @return [::Boolean] - # Whether the pool is disabled. You cannot use a disabled pool to exchange - # tokens, or use existing tokens to access resources. If - # the pool is re-enabled, existing tokens grant access again. - class WorkloadIdentityPool - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # The current state of the pool. - module State - # State unspecified. - STATE_UNSPECIFIED = 0 - - # The pool is active, and may be used in Google Cloud policies. - ACTIVE = 1 - - # The pool is soft-deleted. Soft-deleted pools are permanently deleted - # after approximately 30 days. You can restore a soft-deleted pool using - # {::Google::Iam::V1beta::WorkloadIdentityPools::Client#undelete_workload_identity_pool UndeleteWorkloadIdentityPool}. - # - # You cannot reuse the ID of a soft-deleted pool until it is permanently - # deleted. - # - # While a pool is deleted, you cannot use it to exchange tokens, or use - # existing tokens to access resources. If the pool is undeleted, existing - # tokens grant access again. - DELETED = 2 - end - end - - # A configuration for an external identity provider. - # @!attribute [r] name - # @return [::String] - # Output only. The resource name of the provider. - # @!attribute [rw] display_name - # @return [::String] - # A display name for the provider. Cannot exceed 32 characters. - # @!attribute [rw] description - # @return [::String] - # A description for the provider. Cannot exceed 256 characters. - # @!attribute [r] state - # @return [::Google::Iam::V1beta::WorkloadIdentityPoolProvider::State] - # Output only. The state of the provider. - # @!attribute [rw] disabled - # @return [::Boolean] - # Whether the provider is disabled. You cannot use a disabled provider to - # exchange tokens. However, existing tokens still grant access. - # @!attribute [rw] attribute_mapping - # @return [::Google::Protobuf::Map{::String => ::String}] - # Maps attributes from authentication credentials issued by an external - # identity provider to Google Cloud attributes, such as `subject` and - # `segment`. - # - # Each key must be a string specifying the Google Cloud IAM attribute to - # map to. - # - # The following keys are supported: - # - # * `google.subject`: The principal IAM is authenticating. You can reference - # this value in IAM bindings. This is also the - # subject that appears in Cloud Logging logs. - # Cannot exceed 127 characters. - # - # * `google.groups`: Groups the external identity belongs to. You can grant - # groups access to resources using an IAM `principalSet` - # binding; access applies to all members of the group. - # - # You can also provide custom attributes by specifying - # `attribute.{custom_attribute}`, where `{custom_attribute}` is the name of - # the custom attribute to be mapped. You can define a maximum of 50 custom - # attributes. The maximum length of a mapped attribute key is - # 100 characters, and the key may only contain the characters [a-z0-9_]. - # - # You can reference these attributes in IAM policies to define fine-grained - # access for a workload to Google Cloud resources. For example: - # - # * `google.subject`: - # `principal://iam.googleapis.com/projects/{project}/locations/{location}/workloadIdentityPools/{pool}/subject/{value}` - # - # * `google.groups`: - # `principalSet://iam.googleapis.com/projects/{project}/locations/{location}/workloadIdentityPools/{pool}/group/{value}` - # - # * `attribute.{custom_attribute}`: - # `principalSet://iam.googleapis.com/projects/{project}/locations/{location}/workloadIdentityPools/{pool}/attribute.{custom_attribute}/{value}` - # - # Each value must be a [Common Expression Language] - # (https://opensource.google/projects/cel) function that maps an - # identity provider credential to the normalized attribute specified by the - # corresponding map key. - # - # You can use the `assertion` keyword in the expression to access a JSON - # representation of the authentication credential issued by the provider. - # - # The maximum length of an attribute mapping expression is 2048 characters. - # When evaluated, the total size of all mapped attributes must not exceed - # 8KB. - # - # For AWS providers, the following rules apply: - # - # - If no attribute mapping is defined, the following default mapping - # applies: - # - # ``` - # { - # "google.subject":"assertion.arn", - # "attribute.aws_role": - # "assertion.arn.contains('assumed-role')" - # " ? assertion.arn.extract('\\{account_arn}assumed-role/')" - # " + 'assumed-role/'" - # " + assertion.arn.extract('assumed-role/\\{role_name}/')" - # " : assertion.arn", - # } - # ``` - # - # - If any custom attribute mappings are defined, they must include a mapping - # to the `google.subject` attribute. - # - # - # For OIDC providers, the following rules apply: - # - # - Custom attribute mappings must be defined, and must include a mapping to - # the `google.subject` attribute. For example, the following maps the - # `sub` claim of the incoming credential to the `subject` attribute on - # a Google token. - # - # ``` - # \\{"google.subject": "assertion.sub"} - # ``` - # @!attribute [rw] attribute_condition - # @return [::String] - # [A Common Expression Language](https://opensource.google/projects/cel) - # expression, in plain text, to restrict what otherwise valid authentication - # credentials issued by the provider should not be accepted. - # - # The expression must output a boolean representing whether to allow the - # federation. - # - # The following keywords may be referenced in the expressions: - # - # * `assertion`: JSON representing the authentication credential issued by - # the provider. - # * `google`: The Google attributes mapped from the assertion in the - # `attribute_mappings`. - # * `attribute`: The custom attributes mapped from the assertion in the - # `attribute_mappings`. - # - # The maximum length of the attribute condition expression is 4096 - # characters. If unspecified, all valid authentication credential are - # accepted. - # - # The following example shows how to only allow credentials with a mapped - # `google.groups` value of `admins`: - # - # ``` - # "'admins' in google.groups" - # ``` - # @!attribute [rw] aws - # @return [::Google::Iam::V1beta::WorkloadIdentityPoolProvider::Aws] - # An Amazon Web Services identity provider. - # - # Note: The following fields are mutually exclusive: `aws`, `oidc`. If a field in that set is populated, all other fields in the set will automatically be cleared. - # @!attribute [rw] oidc - # @return [::Google::Iam::V1beta::WorkloadIdentityPoolProvider::Oidc] - # An OpenId Connect 1.0 identity provider. - # - # Note: The following fields are mutually exclusive: `oidc`, `aws`. If a field in that set is populated, all other fields in the set will automatically be cleared. - class WorkloadIdentityPoolProvider - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # Represents an Amazon Web Services identity provider. - # @!attribute [rw] account_id - # @return [::String] - # Required. The AWS account ID. - class Aws - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Represents an OpenId Connect 1.0 identity provider. - # @!attribute [rw] issuer_uri - # @return [::String] - # Required. The OIDC issuer URL. - # @!attribute [rw] allowed_audiences - # @return [::Array<::String>] - # Acceptable values for the `aud` field (audience) in the OIDC token. Token - # exchange requests are rejected if the token audience does not match one - # of the configured values. Each audience may be at most 256 characters. A - # maximum of 10 audiences may be configured. - # - # If this list is empty, the OIDC token audience must be equal to - # the full canonical resource name of the WorkloadIdentityPoolProvider, - # with or without the HTTPS prefix. For example: - # - # ``` - # //iam.googleapis.com/projects//locations//workloadIdentityPools//providers/ - # https://iam.googleapis.com/projects//locations//workloadIdentityPools//providers/ - # ``` - class Oidc - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class AttributeMappingEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # The current state of the provider. - module State - # State unspecified. - STATE_UNSPECIFIED = 0 - - # The provider is active, and may be used to validate authentication - # credentials. - ACTIVE = 1 - - # The provider is soft-deleted. Soft-deleted providers are permanently - # deleted after approximately 30 days. You can restore a soft-deleted - # provider using - # {::Google::Iam::V1beta::WorkloadIdentityPools::Client#undelete_workload_identity_pool_provider UndeleteWorkloadIdentityPoolProvider}. - # - # You cannot reuse the ID of a soft-deleted provider until it is - # permanently deleted. - DELETED = 2 - end - end - - # Request message for ListWorkloadIdentityPools. - # @!attribute [rw] parent - # @return [::String] - # Required. The parent resource to list pools for. - # @!attribute [rw] page_size - # @return [::Integer] - # The maximum number of pools to return. - # If unspecified, at most 50 pools are returned. - # The maximum value is 1000; values above are 1000 truncated to 1000. - # @!attribute [rw] page_token - # @return [::String] - # A page token, received from a previous `ListWorkloadIdentityPools` - # call. Provide this to retrieve the subsequent page. - # @!attribute [rw] show_deleted - # @return [::Boolean] - # Whether to return soft-deleted pools. - class ListWorkloadIdentityPoolsRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for ListWorkloadIdentityPools. - # @!attribute [rw] workload_identity_pools - # @return [::Array<::Google::Iam::V1beta::WorkloadIdentityPool>] - # A list of pools. - # @!attribute [rw] next_page_token - # @return [::String] - # A token, which can be sent as `page_token` to retrieve the next page. - # If this field is omitted, there are no subsequent pages. - class ListWorkloadIdentityPoolsResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for GetWorkloadIdentityPool. - # @!attribute [rw] name - # @return [::String] - # Required. The name of the pool to retrieve. - class GetWorkloadIdentityPoolRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for CreateWorkloadIdentityPool. - # @!attribute [rw] parent - # @return [::String] - # Required. The parent resource to create the pool in. The only supported - # location is `global`. - # @!attribute [rw] workload_identity_pool - # @return [::Google::Iam::V1beta::WorkloadIdentityPool] - # Required. The pool to create. - # @!attribute [rw] workload_identity_pool_id - # @return [::String] - # Required. The ID to use for the pool, which becomes the - # final component of the resource name. This value should be 4-32 characters, - # and may contain the characters [a-z0-9-]. The prefix `gcp-` is - # reserved for use by Google, and may not be specified. - class CreateWorkloadIdentityPoolRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for UpdateWorkloadIdentityPool. - # @!attribute [rw] workload_identity_pool - # @return [::Google::Iam::V1beta::WorkloadIdentityPool] - # Required. The pool to update. The `name` field is used to identify the pool. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # Required. The list of fields update. - class UpdateWorkloadIdentityPoolRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for DeleteWorkloadIdentityPool. - # @!attribute [rw] name - # @return [::String] - # Required. The name of the pool to delete. - class DeleteWorkloadIdentityPoolRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for UndeleteWorkloadIdentityPool. - # @!attribute [rw] name - # @return [::String] - # Required. The name of the pool to undelete. - class UndeleteWorkloadIdentityPoolRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for ListWorkloadIdentityPoolProviders. - # @!attribute [rw] parent - # @return [::String] - # Required. The pool to list providers for. - # @!attribute [rw] page_size - # @return [::Integer] - # The maximum number of providers to return. - # If unspecified, at most 50 providers are returned. - # The maximum value is 100; values above 100 are truncated to 100. - # @!attribute [rw] page_token - # @return [::String] - # A page token, received from a previous - # `ListWorkloadIdentityPoolProviders` call. Provide this to retrieve the - # subsequent page. - # @!attribute [rw] show_deleted - # @return [::Boolean] - # Whether to return soft-deleted providers. - class ListWorkloadIdentityPoolProvidersRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for ListWorkloadIdentityPoolProviders. - # @!attribute [rw] workload_identity_pool_providers - # @return [::Array<::Google::Iam::V1beta::WorkloadIdentityPoolProvider>] - # A list of providers. - # @!attribute [rw] next_page_token - # @return [::String] - # A token, which can be sent as `page_token` to retrieve the next page. - # If this field is omitted, there are no subsequent pages. - class ListWorkloadIdentityPoolProvidersResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for GetWorkloadIdentityPoolProvider. - # @!attribute [rw] name - # @return [::String] - # Required. The name of the provider to retrieve. - class GetWorkloadIdentityPoolProviderRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for CreateWorkloadIdentityPoolProvider. - # @!attribute [rw] parent - # @return [::String] - # Required. The pool to create this provider in. - # @!attribute [rw] workload_identity_pool_provider - # @return [::Google::Iam::V1beta::WorkloadIdentityPoolProvider] - # Required. The provider to create. - # @!attribute [rw] workload_identity_pool_provider_id - # @return [::String] - # Required. The ID for the provider, which becomes the - # final component of the resource name. This value must be 4-32 characters, - # and may contain the characters [a-z0-9-]. The prefix `gcp-` is - # reserved for use by Google, and may not be specified. - class CreateWorkloadIdentityPoolProviderRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for UpdateWorkloadIdentityPoolProvider. - # @!attribute [rw] workload_identity_pool_provider - # @return [::Google::Iam::V1beta::WorkloadIdentityPoolProvider] - # Required. The provider to update. - # @!attribute [rw] update_mask - # @return [::Google::Protobuf::FieldMask] - # Required. The list of fields to update. - class UpdateWorkloadIdentityPoolProviderRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for DeleteWorkloadIdentityPoolProvider. - # @!attribute [rw] name - # @return [::String] - # Required. The name of the provider to delete. - class DeleteWorkloadIdentityPoolProviderRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for UndeleteWorkloadIdentityPoolProvider. - # @!attribute [rw] name - # @return [::String] - # Required. The name of the provider to undelete. - class UndeleteWorkloadIdentityPoolProviderRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Metadata for long-running WorkloadIdentityPool operations. - class WorkloadIdentityPoolOperationMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Metadata for long-running WorkloadIdentityPoolProvider operations. - class WorkloadIdentityPoolProviderOperationMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end -end diff --git a/owl-bot-staging/google-iam-v1beta/proto_docs/google/longrunning/operations.rb b/owl-bot-staging/google-iam-v1beta/proto_docs/google/longrunning/operations.rb deleted file mode 100644 index 7a757f512165..000000000000 --- a/owl-bot-staging/google-iam-v1beta/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-iam-v1beta/proto_docs/google/protobuf/any.rb b/owl-bot-staging/google-iam-v1beta/proto_docs/google/protobuf/any.rb deleted file mode 100644 index 58691995f02e..000000000000 --- a/owl-bot-staging/google-iam-v1beta/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-iam-v1beta/proto_docs/google/protobuf/duration.rb b/owl-bot-staging/google-iam-v1beta/proto_docs/google/protobuf/duration.rb deleted file mode 100644 index ea59f1f91daf..000000000000 --- a/owl-bot-staging/google-iam-v1beta/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-iam-v1beta/proto_docs/google/protobuf/empty.rb b/owl-bot-staging/google-iam-v1beta/proto_docs/google/protobuf/empty.rb deleted file mode 100644 index 83e4481834a6..000000000000 --- a/owl-bot-staging/google-iam-v1beta/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-iam-v1beta/proto_docs/google/protobuf/field_mask.rb b/owl-bot-staging/google-iam-v1beta/proto_docs/google/protobuf/field_mask.rb deleted file mode 100644 index 7f3ffc78601a..000000000000 --- a/owl-bot-staging/google-iam-v1beta/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-iam-v1beta/proto_docs/google/rpc/status.rb b/owl-bot-staging/google-iam-v1beta/proto_docs/google/rpc/status.rb deleted file mode 100644 index c1a1c07eb2db..000000000000 --- a/owl-bot-staging/google-iam-v1beta/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-iam-v1beta/snippets/Gemfile b/owl-bot-staging/google-iam-v1beta/snippets/Gemfile deleted file mode 100644 index f4fbd0daaecf..000000000000 --- a/owl-bot-staging/google-iam-v1beta/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-iam-v1beta", path: "../" -else - gem "google-iam-v1beta" -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-iam-v1beta/snippets/snippet_metadata_google.iam.v1beta.json b/owl-bot-staging/google-iam-v1beta/snippets/snippet_metadata_google.iam.v1beta.json deleted file mode 100644 index 0c0f6ad2607f..000000000000 --- a/owl-bot-staging/google-iam-v1beta/snippets/snippet_metadata_google.iam.v1beta.json +++ /dev/null @@ -1,495 +0,0 @@ -{ - "client_library": { - "name": "google-iam-v1beta", - "version": "", - "language": "RUBY", - "apis": [ - { - "id": "google.iam.v1beta", - "version": "v1beta" - } - ] - }, - "snippets": [ - { - "region_tag": "iam_v1beta_generated_WorkloadIdentityPools_ListWorkloadIdentityPools_sync", - "title": "Snippet for the list_workload_identity_pools call in the WorkloadIdentityPools service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Iam::V1beta::WorkloadIdentityPools::Client#list_workload_identity_pools.", - "file": "workload_identity_pools/list_workload_identity_pools.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_workload_identity_pools", - "full_name": "::Google::Iam::V1beta::WorkloadIdentityPools::Client#list_workload_identity_pools", - "async": false, - "parameters": [ - { - "type": "::Google::Iam::V1beta::ListWorkloadIdentityPoolsRequest", - "name": "request" - } - ], - "result_type": "::Google::Iam::V1beta::ListWorkloadIdentityPoolsResponse", - "client": { - "short_name": "WorkloadIdentityPools::Client", - "full_name": "::Google::Iam::V1beta::WorkloadIdentityPools::Client" - }, - "method": { - "short_name": "ListWorkloadIdentityPools", - "full_name": "google.iam.v1beta.WorkloadIdentityPools.ListWorkloadIdentityPools", - "service": { - "short_name": "WorkloadIdentityPools", - "full_name": "google.iam.v1beta.WorkloadIdentityPools" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "iam_v1beta_generated_WorkloadIdentityPools_GetWorkloadIdentityPool_sync", - "title": "Snippet for the get_workload_identity_pool call in the WorkloadIdentityPools service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Iam::V1beta::WorkloadIdentityPools::Client#get_workload_identity_pool.", - "file": "workload_identity_pools/get_workload_identity_pool.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_workload_identity_pool", - "full_name": "::Google::Iam::V1beta::WorkloadIdentityPools::Client#get_workload_identity_pool", - "async": false, - "parameters": [ - { - "type": "::Google::Iam::V1beta::GetWorkloadIdentityPoolRequest", - "name": "request" - } - ], - "result_type": "::Google::Iam::V1beta::WorkloadIdentityPool", - "client": { - "short_name": "WorkloadIdentityPools::Client", - "full_name": "::Google::Iam::V1beta::WorkloadIdentityPools::Client" - }, - "method": { - "short_name": "GetWorkloadIdentityPool", - "full_name": "google.iam.v1beta.WorkloadIdentityPools.GetWorkloadIdentityPool", - "service": { - "short_name": "WorkloadIdentityPools", - "full_name": "google.iam.v1beta.WorkloadIdentityPools" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "iam_v1beta_generated_WorkloadIdentityPools_CreateWorkloadIdentityPool_sync", - "title": "Snippet for the create_workload_identity_pool call in the WorkloadIdentityPools service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Iam::V1beta::WorkloadIdentityPools::Client#create_workload_identity_pool.", - "file": "workload_identity_pools/create_workload_identity_pool.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_workload_identity_pool", - "full_name": "::Google::Iam::V1beta::WorkloadIdentityPools::Client#create_workload_identity_pool", - "async": false, - "parameters": [ - { - "type": "::Google::Iam::V1beta::CreateWorkloadIdentityPoolRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "WorkloadIdentityPools::Client", - "full_name": "::Google::Iam::V1beta::WorkloadIdentityPools::Client" - }, - "method": { - "short_name": "CreateWorkloadIdentityPool", - "full_name": "google.iam.v1beta.WorkloadIdentityPools.CreateWorkloadIdentityPool", - "service": { - "short_name": "WorkloadIdentityPools", - "full_name": "google.iam.v1beta.WorkloadIdentityPools" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "iam_v1beta_generated_WorkloadIdentityPools_UpdateWorkloadIdentityPool_sync", - "title": "Snippet for the update_workload_identity_pool call in the WorkloadIdentityPools service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Iam::V1beta::WorkloadIdentityPools::Client#update_workload_identity_pool.", - "file": "workload_identity_pools/update_workload_identity_pool.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_workload_identity_pool", - "full_name": "::Google::Iam::V1beta::WorkloadIdentityPools::Client#update_workload_identity_pool", - "async": false, - "parameters": [ - { - "type": "::Google::Iam::V1beta::UpdateWorkloadIdentityPoolRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "WorkloadIdentityPools::Client", - "full_name": "::Google::Iam::V1beta::WorkloadIdentityPools::Client" - }, - "method": { - "short_name": "UpdateWorkloadIdentityPool", - "full_name": "google.iam.v1beta.WorkloadIdentityPools.UpdateWorkloadIdentityPool", - "service": { - "short_name": "WorkloadIdentityPools", - "full_name": "google.iam.v1beta.WorkloadIdentityPools" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "iam_v1beta_generated_WorkloadIdentityPools_DeleteWorkloadIdentityPool_sync", - "title": "Snippet for the delete_workload_identity_pool call in the WorkloadIdentityPools service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Iam::V1beta::WorkloadIdentityPools::Client#delete_workload_identity_pool.", - "file": "workload_identity_pools/delete_workload_identity_pool.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_workload_identity_pool", - "full_name": "::Google::Iam::V1beta::WorkloadIdentityPools::Client#delete_workload_identity_pool", - "async": false, - "parameters": [ - { - "type": "::Google::Iam::V1beta::DeleteWorkloadIdentityPoolRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "WorkloadIdentityPools::Client", - "full_name": "::Google::Iam::V1beta::WorkloadIdentityPools::Client" - }, - "method": { - "short_name": "DeleteWorkloadIdentityPool", - "full_name": "google.iam.v1beta.WorkloadIdentityPools.DeleteWorkloadIdentityPool", - "service": { - "short_name": "WorkloadIdentityPools", - "full_name": "google.iam.v1beta.WorkloadIdentityPools" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "iam_v1beta_generated_WorkloadIdentityPools_UndeleteWorkloadIdentityPool_sync", - "title": "Snippet for the undelete_workload_identity_pool call in the WorkloadIdentityPools service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Iam::V1beta::WorkloadIdentityPools::Client#undelete_workload_identity_pool.", - "file": "workload_identity_pools/undelete_workload_identity_pool.rb", - "language": "RUBY", - "client_method": { - "short_name": "undelete_workload_identity_pool", - "full_name": "::Google::Iam::V1beta::WorkloadIdentityPools::Client#undelete_workload_identity_pool", - "async": false, - "parameters": [ - { - "type": "::Google::Iam::V1beta::UndeleteWorkloadIdentityPoolRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "WorkloadIdentityPools::Client", - "full_name": "::Google::Iam::V1beta::WorkloadIdentityPools::Client" - }, - "method": { - "short_name": "UndeleteWorkloadIdentityPool", - "full_name": "google.iam.v1beta.WorkloadIdentityPools.UndeleteWorkloadIdentityPool", - "service": { - "short_name": "WorkloadIdentityPools", - "full_name": "google.iam.v1beta.WorkloadIdentityPools" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "iam_v1beta_generated_WorkloadIdentityPools_ListWorkloadIdentityPoolProviders_sync", - "title": "Snippet for the list_workload_identity_pool_providers call in the WorkloadIdentityPools service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Iam::V1beta::WorkloadIdentityPools::Client#list_workload_identity_pool_providers.", - "file": "workload_identity_pools/list_workload_identity_pool_providers.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_workload_identity_pool_providers", - "full_name": "::Google::Iam::V1beta::WorkloadIdentityPools::Client#list_workload_identity_pool_providers", - "async": false, - "parameters": [ - { - "type": "::Google::Iam::V1beta::ListWorkloadIdentityPoolProvidersRequest", - "name": "request" - } - ], - "result_type": "::Google::Iam::V1beta::ListWorkloadIdentityPoolProvidersResponse", - "client": { - "short_name": "WorkloadIdentityPools::Client", - "full_name": "::Google::Iam::V1beta::WorkloadIdentityPools::Client" - }, - "method": { - "short_name": "ListWorkloadIdentityPoolProviders", - "full_name": "google.iam.v1beta.WorkloadIdentityPools.ListWorkloadIdentityPoolProviders", - "service": { - "short_name": "WorkloadIdentityPools", - "full_name": "google.iam.v1beta.WorkloadIdentityPools" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "iam_v1beta_generated_WorkloadIdentityPools_GetWorkloadIdentityPoolProvider_sync", - "title": "Snippet for the get_workload_identity_pool_provider call in the WorkloadIdentityPools service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Iam::V1beta::WorkloadIdentityPools::Client#get_workload_identity_pool_provider.", - "file": "workload_identity_pools/get_workload_identity_pool_provider.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_workload_identity_pool_provider", - "full_name": "::Google::Iam::V1beta::WorkloadIdentityPools::Client#get_workload_identity_pool_provider", - "async": false, - "parameters": [ - { - "type": "::Google::Iam::V1beta::GetWorkloadIdentityPoolProviderRequest", - "name": "request" - } - ], - "result_type": "::Google::Iam::V1beta::WorkloadIdentityPoolProvider", - "client": { - "short_name": "WorkloadIdentityPools::Client", - "full_name": "::Google::Iam::V1beta::WorkloadIdentityPools::Client" - }, - "method": { - "short_name": "GetWorkloadIdentityPoolProvider", - "full_name": "google.iam.v1beta.WorkloadIdentityPools.GetWorkloadIdentityPoolProvider", - "service": { - "short_name": "WorkloadIdentityPools", - "full_name": "google.iam.v1beta.WorkloadIdentityPools" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "iam_v1beta_generated_WorkloadIdentityPools_CreateWorkloadIdentityPoolProvider_sync", - "title": "Snippet for the create_workload_identity_pool_provider call in the WorkloadIdentityPools service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Iam::V1beta::WorkloadIdentityPools::Client#create_workload_identity_pool_provider.", - "file": "workload_identity_pools/create_workload_identity_pool_provider.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_workload_identity_pool_provider", - "full_name": "::Google::Iam::V1beta::WorkloadIdentityPools::Client#create_workload_identity_pool_provider", - "async": false, - "parameters": [ - { - "type": "::Google::Iam::V1beta::CreateWorkloadIdentityPoolProviderRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "WorkloadIdentityPools::Client", - "full_name": "::Google::Iam::V1beta::WorkloadIdentityPools::Client" - }, - "method": { - "short_name": "CreateWorkloadIdentityPoolProvider", - "full_name": "google.iam.v1beta.WorkloadIdentityPools.CreateWorkloadIdentityPoolProvider", - "service": { - "short_name": "WorkloadIdentityPools", - "full_name": "google.iam.v1beta.WorkloadIdentityPools" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "iam_v1beta_generated_WorkloadIdentityPools_UpdateWorkloadIdentityPoolProvider_sync", - "title": "Snippet for the update_workload_identity_pool_provider call in the WorkloadIdentityPools service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Iam::V1beta::WorkloadIdentityPools::Client#update_workload_identity_pool_provider.", - "file": "workload_identity_pools/update_workload_identity_pool_provider.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_workload_identity_pool_provider", - "full_name": "::Google::Iam::V1beta::WorkloadIdentityPools::Client#update_workload_identity_pool_provider", - "async": false, - "parameters": [ - { - "type": "::Google::Iam::V1beta::UpdateWorkloadIdentityPoolProviderRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "WorkloadIdentityPools::Client", - "full_name": "::Google::Iam::V1beta::WorkloadIdentityPools::Client" - }, - "method": { - "short_name": "UpdateWorkloadIdentityPoolProvider", - "full_name": "google.iam.v1beta.WorkloadIdentityPools.UpdateWorkloadIdentityPoolProvider", - "service": { - "short_name": "WorkloadIdentityPools", - "full_name": "google.iam.v1beta.WorkloadIdentityPools" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "iam_v1beta_generated_WorkloadIdentityPools_DeleteWorkloadIdentityPoolProvider_sync", - "title": "Snippet for the delete_workload_identity_pool_provider call in the WorkloadIdentityPools service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Iam::V1beta::WorkloadIdentityPools::Client#delete_workload_identity_pool_provider.", - "file": "workload_identity_pools/delete_workload_identity_pool_provider.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_workload_identity_pool_provider", - "full_name": "::Google::Iam::V1beta::WorkloadIdentityPools::Client#delete_workload_identity_pool_provider", - "async": false, - "parameters": [ - { - "type": "::Google::Iam::V1beta::DeleteWorkloadIdentityPoolProviderRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "WorkloadIdentityPools::Client", - "full_name": "::Google::Iam::V1beta::WorkloadIdentityPools::Client" - }, - "method": { - "short_name": "DeleteWorkloadIdentityPoolProvider", - "full_name": "google.iam.v1beta.WorkloadIdentityPools.DeleteWorkloadIdentityPoolProvider", - "service": { - "short_name": "WorkloadIdentityPools", - "full_name": "google.iam.v1beta.WorkloadIdentityPools" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "iam_v1beta_generated_WorkloadIdentityPools_UndeleteWorkloadIdentityPoolProvider_sync", - "title": "Snippet for the undelete_workload_identity_pool_provider call in the WorkloadIdentityPools service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Iam::V1beta::WorkloadIdentityPools::Client#undelete_workload_identity_pool_provider.", - "file": "workload_identity_pools/undelete_workload_identity_pool_provider.rb", - "language": "RUBY", - "client_method": { - "short_name": "undelete_workload_identity_pool_provider", - "full_name": "::Google::Iam::V1beta::WorkloadIdentityPools::Client#undelete_workload_identity_pool_provider", - "async": false, - "parameters": [ - { - "type": "::Google::Iam::V1beta::UndeleteWorkloadIdentityPoolProviderRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "WorkloadIdentityPools::Client", - "full_name": "::Google::Iam::V1beta::WorkloadIdentityPools::Client" - }, - "method": { - "short_name": "UndeleteWorkloadIdentityPoolProvider", - "full_name": "google.iam.v1beta.WorkloadIdentityPools.UndeleteWorkloadIdentityPoolProvider", - "service": { - "short_name": "WorkloadIdentityPools", - "full_name": "google.iam.v1beta.WorkloadIdentityPools" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - } - ] -} \ No newline at end of file diff --git a/owl-bot-staging/google-iam-v1beta/snippets/workload_identity_pools/create_workload_identity_pool.rb b/owl-bot-staging/google-iam-v1beta/snippets/workload_identity_pools/create_workload_identity_pool.rb deleted file mode 100644 index fba71e6d0b13..000000000000 --- a/owl-bot-staging/google-iam-v1beta/snippets/workload_identity_pools/create_workload_identity_pool.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 iam_v1beta_generated_WorkloadIdentityPools_CreateWorkloadIdentityPool_sync] -require "google/iam/v1beta" - -## -# Snippet for the create_workload_identity_pool call in the WorkloadIdentityPools 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::Iam::V1beta::WorkloadIdentityPools::Client#create_workload_identity_pool. -# -def create_workload_identity_pool - # Create a client object. The client can be reused for multiple calls. - client = Google::Iam::V1beta::WorkloadIdentityPools::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Iam::V1beta::CreateWorkloadIdentityPoolRequest.new - - # Call the create_workload_identity_pool method. - result = client.create_workload_identity_pool 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 iam_v1beta_generated_WorkloadIdentityPools_CreateWorkloadIdentityPool_sync] diff --git a/owl-bot-staging/google-iam-v1beta/snippets/workload_identity_pools/create_workload_identity_pool_provider.rb b/owl-bot-staging/google-iam-v1beta/snippets/workload_identity_pools/create_workload_identity_pool_provider.rb deleted file mode 100644 index 2b1165c92103..000000000000 --- a/owl-bot-staging/google-iam-v1beta/snippets/workload_identity_pools/create_workload_identity_pool_provider.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 iam_v1beta_generated_WorkloadIdentityPools_CreateWorkloadIdentityPoolProvider_sync] -require "google/iam/v1beta" - -## -# Snippet for the create_workload_identity_pool_provider call in the WorkloadIdentityPools 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::Iam::V1beta::WorkloadIdentityPools::Client#create_workload_identity_pool_provider. -# -def create_workload_identity_pool_provider - # Create a client object. The client can be reused for multiple calls. - client = Google::Iam::V1beta::WorkloadIdentityPools::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Iam::V1beta::CreateWorkloadIdentityPoolProviderRequest.new - - # Call the create_workload_identity_pool_provider method. - result = client.create_workload_identity_pool_provider 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 iam_v1beta_generated_WorkloadIdentityPools_CreateWorkloadIdentityPoolProvider_sync] diff --git a/owl-bot-staging/google-iam-v1beta/snippets/workload_identity_pools/delete_workload_identity_pool.rb b/owl-bot-staging/google-iam-v1beta/snippets/workload_identity_pools/delete_workload_identity_pool.rb deleted file mode 100644 index a2bbb45a5c7d..000000000000 --- a/owl-bot-staging/google-iam-v1beta/snippets/workload_identity_pools/delete_workload_identity_pool.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 iam_v1beta_generated_WorkloadIdentityPools_DeleteWorkloadIdentityPool_sync] -require "google/iam/v1beta" - -## -# Snippet for the delete_workload_identity_pool call in the WorkloadIdentityPools 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::Iam::V1beta::WorkloadIdentityPools::Client#delete_workload_identity_pool. -# -def delete_workload_identity_pool - # Create a client object. The client can be reused for multiple calls. - client = Google::Iam::V1beta::WorkloadIdentityPools::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Iam::V1beta::DeleteWorkloadIdentityPoolRequest.new - - # Call the delete_workload_identity_pool method. - result = client.delete_workload_identity_pool 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 iam_v1beta_generated_WorkloadIdentityPools_DeleteWorkloadIdentityPool_sync] diff --git a/owl-bot-staging/google-iam-v1beta/snippets/workload_identity_pools/delete_workload_identity_pool_provider.rb b/owl-bot-staging/google-iam-v1beta/snippets/workload_identity_pools/delete_workload_identity_pool_provider.rb deleted file mode 100644 index 0dcacc0d7d0f..000000000000 --- a/owl-bot-staging/google-iam-v1beta/snippets/workload_identity_pools/delete_workload_identity_pool_provider.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 iam_v1beta_generated_WorkloadIdentityPools_DeleteWorkloadIdentityPoolProvider_sync] -require "google/iam/v1beta" - -## -# Snippet for the delete_workload_identity_pool_provider call in the WorkloadIdentityPools 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::Iam::V1beta::WorkloadIdentityPools::Client#delete_workload_identity_pool_provider. -# -def delete_workload_identity_pool_provider - # Create a client object. The client can be reused for multiple calls. - client = Google::Iam::V1beta::WorkloadIdentityPools::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Iam::V1beta::DeleteWorkloadIdentityPoolProviderRequest.new - - # Call the delete_workload_identity_pool_provider method. - result = client.delete_workload_identity_pool_provider 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 iam_v1beta_generated_WorkloadIdentityPools_DeleteWorkloadIdentityPoolProvider_sync] diff --git a/owl-bot-staging/google-iam-v1beta/snippets/workload_identity_pools/get_workload_identity_pool.rb b/owl-bot-staging/google-iam-v1beta/snippets/workload_identity_pools/get_workload_identity_pool.rb deleted file mode 100644 index 41e8e125bbc4..000000000000 --- a/owl-bot-staging/google-iam-v1beta/snippets/workload_identity_pools/get_workload_identity_pool.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 iam_v1beta_generated_WorkloadIdentityPools_GetWorkloadIdentityPool_sync] -require "google/iam/v1beta" - -## -# Snippet for the get_workload_identity_pool call in the WorkloadIdentityPools 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::Iam::V1beta::WorkloadIdentityPools::Client#get_workload_identity_pool. -# -def get_workload_identity_pool - # Create a client object. The client can be reused for multiple calls. - client = Google::Iam::V1beta::WorkloadIdentityPools::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Iam::V1beta::GetWorkloadIdentityPoolRequest.new - - # Call the get_workload_identity_pool method. - result = client.get_workload_identity_pool request - - # The returned object is of type Google::Iam::V1beta::WorkloadIdentityPool. - p result -end -# [END iam_v1beta_generated_WorkloadIdentityPools_GetWorkloadIdentityPool_sync] diff --git a/owl-bot-staging/google-iam-v1beta/snippets/workload_identity_pools/get_workload_identity_pool_provider.rb b/owl-bot-staging/google-iam-v1beta/snippets/workload_identity_pools/get_workload_identity_pool_provider.rb deleted file mode 100644 index b3de9d32d877..000000000000 --- a/owl-bot-staging/google-iam-v1beta/snippets/workload_identity_pools/get_workload_identity_pool_provider.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 iam_v1beta_generated_WorkloadIdentityPools_GetWorkloadIdentityPoolProvider_sync] -require "google/iam/v1beta" - -## -# Snippet for the get_workload_identity_pool_provider call in the WorkloadIdentityPools 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::Iam::V1beta::WorkloadIdentityPools::Client#get_workload_identity_pool_provider. -# -def get_workload_identity_pool_provider - # Create a client object. The client can be reused for multiple calls. - client = Google::Iam::V1beta::WorkloadIdentityPools::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Iam::V1beta::GetWorkloadIdentityPoolProviderRequest.new - - # Call the get_workload_identity_pool_provider method. - result = client.get_workload_identity_pool_provider request - - # The returned object is of type Google::Iam::V1beta::WorkloadIdentityPoolProvider. - p result -end -# [END iam_v1beta_generated_WorkloadIdentityPools_GetWorkloadIdentityPoolProvider_sync] diff --git a/owl-bot-staging/google-iam-v1beta/snippets/workload_identity_pools/list_workload_identity_pool_providers.rb b/owl-bot-staging/google-iam-v1beta/snippets/workload_identity_pools/list_workload_identity_pool_providers.rb deleted file mode 100644 index 73859f63733a..000000000000 --- a/owl-bot-staging/google-iam-v1beta/snippets/workload_identity_pools/list_workload_identity_pool_providers.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 iam_v1beta_generated_WorkloadIdentityPools_ListWorkloadIdentityPoolProviders_sync] -require "google/iam/v1beta" - -## -# Snippet for the list_workload_identity_pool_providers call in the WorkloadIdentityPools 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::Iam::V1beta::WorkloadIdentityPools::Client#list_workload_identity_pool_providers. -# -def list_workload_identity_pool_providers - # Create a client object. The client can be reused for multiple calls. - client = Google::Iam::V1beta::WorkloadIdentityPools::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Iam::V1beta::ListWorkloadIdentityPoolProvidersRequest.new - - # Call the list_workload_identity_pool_providers method. - result = client.list_workload_identity_pool_providers 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::Iam::V1beta::WorkloadIdentityPoolProvider. - p item - end -end -# [END iam_v1beta_generated_WorkloadIdentityPools_ListWorkloadIdentityPoolProviders_sync] diff --git a/owl-bot-staging/google-iam-v1beta/snippets/workload_identity_pools/list_workload_identity_pools.rb b/owl-bot-staging/google-iam-v1beta/snippets/workload_identity_pools/list_workload_identity_pools.rb deleted file mode 100644 index f4bfd270a975..000000000000 --- a/owl-bot-staging/google-iam-v1beta/snippets/workload_identity_pools/list_workload_identity_pools.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 iam_v1beta_generated_WorkloadIdentityPools_ListWorkloadIdentityPools_sync] -require "google/iam/v1beta" - -## -# Snippet for the list_workload_identity_pools call in the WorkloadIdentityPools 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::Iam::V1beta::WorkloadIdentityPools::Client#list_workload_identity_pools. -# -def list_workload_identity_pools - # Create a client object. The client can be reused for multiple calls. - client = Google::Iam::V1beta::WorkloadIdentityPools::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Iam::V1beta::ListWorkloadIdentityPoolsRequest.new - - # Call the list_workload_identity_pools method. - result = client.list_workload_identity_pools 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::Iam::V1beta::WorkloadIdentityPool. - p item - end -end -# [END iam_v1beta_generated_WorkloadIdentityPools_ListWorkloadIdentityPools_sync] diff --git a/owl-bot-staging/google-iam-v1beta/snippets/workload_identity_pools/undelete_workload_identity_pool.rb b/owl-bot-staging/google-iam-v1beta/snippets/workload_identity_pools/undelete_workload_identity_pool.rb deleted file mode 100644 index 731613f744e1..000000000000 --- a/owl-bot-staging/google-iam-v1beta/snippets/workload_identity_pools/undelete_workload_identity_pool.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 iam_v1beta_generated_WorkloadIdentityPools_UndeleteWorkloadIdentityPool_sync] -require "google/iam/v1beta" - -## -# Snippet for the undelete_workload_identity_pool call in the WorkloadIdentityPools 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::Iam::V1beta::WorkloadIdentityPools::Client#undelete_workload_identity_pool. -# -def undelete_workload_identity_pool - # Create a client object. The client can be reused for multiple calls. - client = Google::Iam::V1beta::WorkloadIdentityPools::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Iam::V1beta::UndeleteWorkloadIdentityPoolRequest.new - - # Call the undelete_workload_identity_pool method. - result = client.undelete_workload_identity_pool 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 iam_v1beta_generated_WorkloadIdentityPools_UndeleteWorkloadIdentityPool_sync] diff --git a/owl-bot-staging/google-iam-v1beta/snippets/workload_identity_pools/undelete_workload_identity_pool_provider.rb b/owl-bot-staging/google-iam-v1beta/snippets/workload_identity_pools/undelete_workload_identity_pool_provider.rb deleted file mode 100644 index 1c8edd42f39e..000000000000 --- a/owl-bot-staging/google-iam-v1beta/snippets/workload_identity_pools/undelete_workload_identity_pool_provider.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 iam_v1beta_generated_WorkloadIdentityPools_UndeleteWorkloadIdentityPoolProvider_sync] -require "google/iam/v1beta" - -## -# Snippet for the undelete_workload_identity_pool_provider call in the WorkloadIdentityPools 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::Iam::V1beta::WorkloadIdentityPools::Client#undelete_workload_identity_pool_provider. -# -def undelete_workload_identity_pool_provider - # Create a client object. The client can be reused for multiple calls. - client = Google::Iam::V1beta::WorkloadIdentityPools::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Iam::V1beta::UndeleteWorkloadIdentityPoolProviderRequest.new - - # Call the undelete_workload_identity_pool_provider method. - result = client.undelete_workload_identity_pool_provider 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 iam_v1beta_generated_WorkloadIdentityPools_UndeleteWorkloadIdentityPoolProvider_sync] diff --git a/owl-bot-staging/google-iam-v1beta/snippets/workload_identity_pools/update_workload_identity_pool.rb b/owl-bot-staging/google-iam-v1beta/snippets/workload_identity_pools/update_workload_identity_pool.rb deleted file mode 100644 index 61a1f1d9c12c..000000000000 --- a/owl-bot-staging/google-iam-v1beta/snippets/workload_identity_pools/update_workload_identity_pool.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 iam_v1beta_generated_WorkloadIdentityPools_UpdateWorkloadIdentityPool_sync] -require "google/iam/v1beta" - -## -# Snippet for the update_workload_identity_pool call in the WorkloadIdentityPools 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::Iam::V1beta::WorkloadIdentityPools::Client#update_workload_identity_pool. -# -def update_workload_identity_pool - # Create a client object. The client can be reused for multiple calls. - client = Google::Iam::V1beta::WorkloadIdentityPools::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Iam::V1beta::UpdateWorkloadIdentityPoolRequest.new - - # Call the update_workload_identity_pool method. - result = client.update_workload_identity_pool 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 iam_v1beta_generated_WorkloadIdentityPools_UpdateWorkloadIdentityPool_sync] diff --git a/owl-bot-staging/google-iam-v1beta/snippets/workload_identity_pools/update_workload_identity_pool_provider.rb b/owl-bot-staging/google-iam-v1beta/snippets/workload_identity_pools/update_workload_identity_pool_provider.rb deleted file mode 100644 index 5d53d77ebced..000000000000 --- a/owl-bot-staging/google-iam-v1beta/snippets/workload_identity_pools/update_workload_identity_pool_provider.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 iam_v1beta_generated_WorkloadIdentityPools_UpdateWorkloadIdentityPoolProvider_sync] -require "google/iam/v1beta" - -## -# Snippet for the update_workload_identity_pool_provider call in the WorkloadIdentityPools 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::Iam::V1beta::WorkloadIdentityPools::Client#update_workload_identity_pool_provider. -# -def update_workload_identity_pool_provider - # Create a client object. The client can be reused for multiple calls. - client = Google::Iam::V1beta::WorkloadIdentityPools::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Iam::V1beta::UpdateWorkloadIdentityPoolProviderRequest.new - - # Call the update_workload_identity_pool_provider method. - result = client.update_workload_identity_pool_provider 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 iam_v1beta_generated_WorkloadIdentityPools_UpdateWorkloadIdentityPoolProvider_sync] diff --git a/owl-bot-staging/google-iam-v1beta/test/google/iam/v1beta/workload_identity_pools_operations_test.rb b/owl-bot-staging/google-iam-v1beta/test/google/iam/v1beta/workload_identity_pools_operations_test.rb deleted file mode 100644 index 4d405127c64f..000000000000 --- a/owl-bot-staging/google-iam-v1beta/test/google/iam/v1beta/workload_identity_pools_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/iam/v1beta/workload_identity_pool_pb" -require "google/iam/v1beta/workload_identity_pool_services_pb" -require "google/iam/v1beta/workload_identity_pools" - -class ::Google::Iam::V1beta::WorkloadIdentityPools::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::Iam::V1beta::WorkloadIdentityPools::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::Iam::V1beta::WorkloadIdentityPools::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::Iam::V1beta::WorkloadIdentityPools::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::Iam::V1beta::WorkloadIdentityPools::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::Iam::V1beta::WorkloadIdentityPools::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::Iam::V1beta::WorkloadIdentityPools::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::Iam::V1beta::WorkloadIdentityPools::Operations::Configuration, config - end -end diff --git a/owl-bot-staging/google-iam-v1beta/test/google/iam/v1beta/workload_identity_pools_paths_test.rb b/owl-bot-staging/google-iam-v1beta/test/google/iam/v1beta/workload_identity_pools_paths_test.rb deleted file mode 100644 index 209fb00b70a7..000000000000 --- a/owl-bot-staging/google-iam-v1beta/test/google/iam/v1beta/workload_identity_pools_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/iam/v1beta/workload_identity_pools" - -class ::Google::Iam::V1beta::WorkloadIdentityPools::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_project_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Iam::V1beta::WorkloadIdentityPools::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.project_path project: "value0" - assert_equal "projects/value0", path - end - end - - def test_workload_identity_pool_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Iam::V1beta::WorkloadIdentityPools::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.workload_identity_pool_path project: "value0", location: "value1", workload_identity_pool: "value2" - assert_equal "projects/value0/locations/value1/workloadIdentityPools/value2", path - end - end - - def test_workload_identity_pool_provider_path - grpc_channel = ::GRPC::Core::Channel.new "localhost:8888", nil, :this_channel_is_insecure - ::Gapic::ServiceStub.stub :new, DummyStub.new do - client = ::Google::Iam::V1beta::WorkloadIdentityPools::Client.new do |config| - config.credentials = grpc_channel - end - - path = client.workload_identity_pool_provider_path project: "value0", location: "value1", workload_identity_pool: "value2", workload_identity_pool_provider: "value3" - assert_equal "projects/value0/locations/value1/workloadIdentityPools/value2/providers/value3", path - end - end -end diff --git a/owl-bot-staging/google-iam-v1beta/test/google/iam/v1beta/workload_identity_pools_test.rb b/owl-bot-staging/google-iam-v1beta/test/google/iam/v1beta/workload_identity_pools_test.rb deleted file mode 100644 index 2bfd418063ee..000000000000 --- a/owl-bot-staging/google-iam-v1beta/test/google/iam/v1beta/workload_identity_pools_test.rb +++ /dev/null @@ -1,888 +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/iam/v1beta/workload_identity_pool_pb" -require "google/iam/v1beta/workload_identity_pools" - -class ::Google::Iam::V1beta::WorkloadIdentityPools::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_workload_identity_pools - # Create GRPC objects. - grpc_response = ::Google::Iam::V1beta::ListWorkloadIdentityPoolsResponse.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" - show_deleted = true - - list_workload_identity_pools_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_workload_identity_pools, name - assert_kind_of ::Google::Iam::V1beta::ListWorkloadIdentityPoolsRequest, request - assert_equal "hello world", request["parent"] - assert_equal 42, request["page_size"] - assert_equal "hello world", request["page_token"] - assert_equal true, request["show_deleted"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_workload_identity_pools_client_stub do - # Create client - client = ::Google::Iam::V1beta::WorkloadIdentityPools::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_workload_identity_pools({ parent: parent, page_size: page_size, page_token: page_token, 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_workload_identity_pools parent: parent, page_size: page_size, page_token: page_token, 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_workload_identity_pools ::Google::Iam::V1beta::ListWorkloadIdentityPoolsRequest.new(parent: parent, page_size: page_size, page_token: page_token, 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_workload_identity_pools({ parent: parent, page_size: page_size, page_token: page_token, 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_workload_identity_pools(::Google::Iam::V1beta::ListWorkloadIdentityPoolsRequest.new(parent: parent, page_size: page_size, page_token: page_token, 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_workload_identity_pools_client_stub.call_rpc_count - end - end - - def test_get_workload_identity_pool - # Create GRPC objects. - grpc_response = ::Google::Iam::V1beta::WorkloadIdentityPool.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_workload_identity_pool_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_workload_identity_pool, name - assert_kind_of ::Google::Iam::V1beta::GetWorkloadIdentityPoolRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_workload_identity_pool_client_stub do - # Create client - client = ::Google::Iam::V1beta::WorkloadIdentityPools::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_workload_identity_pool({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_workload_identity_pool name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_workload_identity_pool ::Google::Iam::V1beta::GetWorkloadIdentityPoolRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_workload_identity_pool({ 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_workload_identity_pool(::Google::Iam::V1beta::GetWorkloadIdentityPoolRequest.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_workload_identity_pool_client_stub.call_rpc_count - end - end - - def test_create_workload_identity_pool - # 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" - workload_identity_pool = {} - workload_identity_pool_id = "hello world" - - create_workload_identity_pool_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_workload_identity_pool, name - assert_kind_of ::Google::Iam::V1beta::CreateWorkloadIdentityPoolRequest, request - assert_equal "hello world", request["parent"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Iam::V1beta::WorkloadIdentityPool), request["workload_identity_pool"] - assert_equal "hello world", request["workload_identity_pool_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_workload_identity_pool_client_stub do - # Create client - client = ::Google::Iam::V1beta::WorkloadIdentityPools::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_workload_identity_pool({ parent: parent, workload_identity_pool: workload_identity_pool, workload_identity_pool_id: workload_identity_pool_id }) 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_workload_identity_pool parent: parent, workload_identity_pool: workload_identity_pool, workload_identity_pool_id: workload_identity_pool_id 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_workload_identity_pool ::Google::Iam::V1beta::CreateWorkloadIdentityPoolRequest.new(parent: parent, workload_identity_pool: workload_identity_pool, workload_identity_pool_id: workload_identity_pool_id) 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_workload_identity_pool({ parent: parent, workload_identity_pool: workload_identity_pool, workload_identity_pool_id: workload_identity_pool_id }, 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_workload_identity_pool(::Google::Iam::V1beta::CreateWorkloadIdentityPoolRequest.new(parent: parent, workload_identity_pool: workload_identity_pool, workload_identity_pool_id: workload_identity_pool_id), 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_workload_identity_pool_client_stub.call_rpc_count - end - end - - def test_update_workload_identity_pool - # 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. - workload_identity_pool = {} - update_mask = {} - - update_workload_identity_pool_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_workload_identity_pool, name - assert_kind_of ::Google::Iam::V1beta::UpdateWorkloadIdentityPoolRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Iam::V1beta::WorkloadIdentityPool), request["workload_identity_pool"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_workload_identity_pool_client_stub do - # Create client - client = ::Google::Iam::V1beta::WorkloadIdentityPools::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_workload_identity_pool({ workload_identity_pool: workload_identity_pool, update_mask: update_mask }) 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.update_workload_identity_pool workload_identity_pool: workload_identity_pool, update_mask: update_mask 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.update_workload_identity_pool ::Google::Iam::V1beta::UpdateWorkloadIdentityPoolRequest.new(workload_identity_pool: workload_identity_pool, update_mask: update_mask) 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.update_workload_identity_pool({ workload_identity_pool: workload_identity_pool, update_mask: update_mask }, 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.update_workload_identity_pool(::Google::Iam::V1beta::UpdateWorkloadIdentityPoolRequest.new(workload_identity_pool: workload_identity_pool, update_mask: update_mask), 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, update_workload_identity_pool_client_stub.call_rpc_count - end - end - - def test_delete_workload_identity_pool - # 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_workload_identity_pool_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_workload_identity_pool, name - assert_kind_of ::Google::Iam::V1beta::DeleteWorkloadIdentityPoolRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_workload_identity_pool_client_stub do - # Create client - client = ::Google::Iam::V1beta::WorkloadIdentityPools::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_workload_identity_pool({ 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_workload_identity_pool 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_workload_identity_pool ::Google::Iam::V1beta::DeleteWorkloadIdentityPoolRequest.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_workload_identity_pool({ 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_workload_identity_pool(::Google::Iam::V1beta::DeleteWorkloadIdentityPoolRequest.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_workload_identity_pool_client_stub.call_rpc_count - end - end - - def test_undelete_workload_identity_pool - # 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" - - undelete_workload_identity_pool_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :undelete_workload_identity_pool, name - assert_kind_of ::Google::Iam::V1beta::UndeleteWorkloadIdentityPoolRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, undelete_workload_identity_pool_client_stub do - # Create client - client = ::Google::Iam::V1beta::WorkloadIdentityPools::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.undelete_workload_identity_pool({ 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.undelete_workload_identity_pool 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.undelete_workload_identity_pool ::Google::Iam::V1beta::UndeleteWorkloadIdentityPoolRequest.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.undelete_workload_identity_pool({ 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.undelete_workload_identity_pool(::Google::Iam::V1beta::UndeleteWorkloadIdentityPoolRequest.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, undelete_workload_identity_pool_client_stub.call_rpc_count - end - end - - def test_list_workload_identity_pool_providers - # Create GRPC objects. - grpc_response = ::Google::Iam::V1beta::ListWorkloadIdentityPoolProvidersResponse.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" - show_deleted = true - - list_workload_identity_pool_providers_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_workload_identity_pool_providers, name - assert_kind_of ::Google::Iam::V1beta::ListWorkloadIdentityPoolProvidersRequest, request - assert_equal "hello world", request["parent"] - assert_equal 42, request["page_size"] - assert_equal "hello world", request["page_token"] - assert_equal true, request["show_deleted"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, list_workload_identity_pool_providers_client_stub do - # Create client - client = ::Google::Iam::V1beta::WorkloadIdentityPools::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_workload_identity_pool_providers({ parent: parent, page_size: page_size, page_token: page_token, 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_workload_identity_pool_providers parent: parent, page_size: page_size, page_token: page_token, 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_workload_identity_pool_providers ::Google::Iam::V1beta::ListWorkloadIdentityPoolProvidersRequest.new(parent: parent, page_size: page_size, page_token: page_token, 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_workload_identity_pool_providers({ parent: parent, page_size: page_size, page_token: page_token, 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_workload_identity_pool_providers(::Google::Iam::V1beta::ListWorkloadIdentityPoolProvidersRequest.new(parent: parent, page_size: page_size, page_token: page_token, 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_workload_identity_pool_providers_client_stub.call_rpc_count - end - end - - def test_get_workload_identity_pool_provider - # Create GRPC objects. - grpc_response = ::Google::Iam::V1beta::WorkloadIdentityPoolProvider.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_workload_identity_pool_provider_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_workload_identity_pool_provider, name - assert_kind_of ::Google::Iam::V1beta::GetWorkloadIdentityPoolProviderRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_workload_identity_pool_provider_client_stub do - # Create client - client = ::Google::Iam::V1beta::WorkloadIdentityPools::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_workload_identity_pool_provider({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_workload_identity_pool_provider name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_workload_identity_pool_provider ::Google::Iam::V1beta::GetWorkloadIdentityPoolProviderRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_workload_identity_pool_provider({ 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_workload_identity_pool_provider(::Google::Iam::V1beta::GetWorkloadIdentityPoolProviderRequest.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_workload_identity_pool_provider_client_stub.call_rpc_count - end - end - - def test_create_workload_identity_pool_provider - # 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" - workload_identity_pool_provider = {} - workload_identity_pool_provider_id = "hello world" - - create_workload_identity_pool_provider_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_workload_identity_pool_provider, name - assert_kind_of ::Google::Iam::V1beta::CreateWorkloadIdentityPoolProviderRequest, request - assert_equal "hello world", request["parent"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Iam::V1beta::WorkloadIdentityPoolProvider), request["workload_identity_pool_provider"] - assert_equal "hello world", request["workload_identity_pool_provider_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_workload_identity_pool_provider_client_stub do - # Create client - client = ::Google::Iam::V1beta::WorkloadIdentityPools::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_workload_identity_pool_provider({ parent: parent, workload_identity_pool_provider: workload_identity_pool_provider, workload_identity_pool_provider_id: workload_identity_pool_provider_id }) 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_workload_identity_pool_provider parent: parent, workload_identity_pool_provider: workload_identity_pool_provider, workload_identity_pool_provider_id: workload_identity_pool_provider_id 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_workload_identity_pool_provider ::Google::Iam::V1beta::CreateWorkloadIdentityPoolProviderRequest.new(parent: parent, workload_identity_pool_provider: workload_identity_pool_provider, workload_identity_pool_provider_id: workload_identity_pool_provider_id) 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_workload_identity_pool_provider({ parent: parent, workload_identity_pool_provider: workload_identity_pool_provider, workload_identity_pool_provider_id: workload_identity_pool_provider_id }, 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_workload_identity_pool_provider(::Google::Iam::V1beta::CreateWorkloadIdentityPoolProviderRequest.new(parent: parent, workload_identity_pool_provider: workload_identity_pool_provider, workload_identity_pool_provider_id: workload_identity_pool_provider_id), 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_workload_identity_pool_provider_client_stub.call_rpc_count - end - end - - def test_update_workload_identity_pool_provider - # 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. - workload_identity_pool_provider = {} - update_mask = {} - - update_workload_identity_pool_provider_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_workload_identity_pool_provider, name - assert_kind_of ::Google::Iam::V1beta::UpdateWorkloadIdentityPoolProviderRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Iam::V1beta::WorkloadIdentityPoolProvider), request["workload_identity_pool_provider"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Protobuf::FieldMask), request["update_mask"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_workload_identity_pool_provider_client_stub do - # Create client - client = ::Google::Iam::V1beta::WorkloadIdentityPools::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_workload_identity_pool_provider({ workload_identity_pool_provider: workload_identity_pool_provider, update_mask: update_mask }) 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.update_workload_identity_pool_provider workload_identity_pool_provider: workload_identity_pool_provider, update_mask: update_mask 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.update_workload_identity_pool_provider ::Google::Iam::V1beta::UpdateWorkloadIdentityPoolProviderRequest.new(workload_identity_pool_provider: workload_identity_pool_provider, update_mask: update_mask) 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.update_workload_identity_pool_provider({ workload_identity_pool_provider: workload_identity_pool_provider, update_mask: update_mask }, 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.update_workload_identity_pool_provider(::Google::Iam::V1beta::UpdateWorkloadIdentityPoolProviderRequest.new(workload_identity_pool_provider: workload_identity_pool_provider, update_mask: update_mask), 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, update_workload_identity_pool_provider_client_stub.call_rpc_count - end - end - - def test_delete_workload_identity_pool_provider - # 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_workload_identity_pool_provider_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_workload_identity_pool_provider, name - assert_kind_of ::Google::Iam::V1beta::DeleteWorkloadIdentityPoolProviderRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_workload_identity_pool_provider_client_stub do - # Create client - client = ::Google::Iam::V1beta::WorkloadIdentityPools::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_workload_identity_pool_provider({ 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_workload_identity_pool_provider 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_workload_identity_pool_provider ::Google::Iam::V1beta::DeleteWorkloadIdentityPoolProviderRequest.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_workload_identity_pool_provider({ 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_workload_identity_pool_provider(::Google::Iam::V1beta::DeleteWorkloadIdentityPoolProviderRequest.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_workload_identity_pool_provider_client_stub.call_rpc_count - end - end - - def test_undelete_workload_identity_pool_provider - # 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" - - undelete_workload_identity_pool_provider_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :undelete_workload_identity_pool_provider, name - assert_kind_of ::Google::Iam::V1beta::UndeleteWorkloadIdentityPoolProviderRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, undelete_workload_identity_pool_provider_client_stub do - # Create client - client = ::Google::Iam::V1beta::WorkloadIdentityPools::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.undelete_workload_identity_pool_provider({ 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.undelete_workload_identity_pool_provider 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.undelete_workload_identity_pool_provider ::Google::Iam::V1beta::UndeleteWorkloadIdentityPoolProviderRequest.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.undelete_workload_identity_pool_provider({ 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.undelete_workload_identity_pool_provider(::Google::Iam::V1beta::UndeleteWorkloadIdentityPoolProviderRequest.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, undelete_workload_identity_pool_provider_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::Iam::V1beta::WorkloadIdentityPools::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::Iam::V1beta::WorkloadIdentityPools::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::Iam::V1beta::WorkloadIdentityPools::Client.new do |config| - config.credentials = creds - end - assert_kind_of ::Google::Iam::V1beta::WorkloadIdentityPools::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::Iam::V1beta::WorkloadIdentityPools::Client.new do |config| - config.credentials = grpc_channel - end - end - - assert_kind_of ::Google::Iam::V1beta::WorkloadIdentityPools::Operations, client.operations_client - end -end diff --git a/owl-bot-staging/google-iam-v1beta/test/helper.rb b/owl-bot-staging/google-iam-v1beta/test/helper.rb deleted file mode 100644 index 672b337030e7..000000000000 --- a/owl-bot-staging/google-iam-v1beta/test/helper.rb +++ /dev/null @@ -1,26 +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/mock" -require "minitest/rg" - -require "grpc" - -require "ostruct" diff --git a/owl-bot-staging/google-iam-v2/.gitignore b/owl-bot-staging/google-iam-v2/.gitignore deleted file mode 100644 index 0135b6bc6cfc..000000000000 --- a/owl-bot-staging/google-iam-v2/.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-iam-v2/.repo-metadata.json b/owl-bot-staging/google-iam-v2/.repo-metadata.json deleted file mode 100644 index f361454bbf48..000000000000 --- a/owl-bot-staging/google-iam-v2/.repo-metadata.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "api_id": "iam.googleapis.com", - "api_shortname": "iam", - "client_documentation": "https://rubydoc.info/gems/google-iam-v2", - "distribution_name": "google-iam-v2", - "is_cloud": false, - "language": "ruby", - "name": "iam", - "name_pretty": "IAM V2 API", - "product_documentation": "https://cloud.google.com/iam", - "release_level": "unreleased", - "repo": "googleapis/google-cloud-ruby", - "requires_billing": true, - "ruby-cloud-description": "Manages identity and access control policies for Google Cloud Platform resources. Note that google-iam-v2 is a version-specific client library. For most uses, we recommend installing the main client library google-iam-client instead. See the readme for more details.", - "ruby-cloud-product-url": "https://cloud.google.com/iam", - "library_type": "GAPIC_AUTO" -} diff --git a/owl-bot-staging/google-iam-v2/.rubocop.yml b/owl-bot-staging/google-iam-v2/.rubocop.yml deleted file mode 100644 index 34e52b136070..000000000000 --- a/owl-bot-staging/google-iam-v2/.rubocop.yml +++ /dev/null @@ -1,33 +0,0 @@ -inherit_gem: - google-style: google-style.yml - -AllCops: - Exclude: - - "google-iam-v2.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-iam-v2.rb" diff --git a/owl-bot-staging/google-iam-v2/.toys.rb b/owl-bot-staging/google-iam-v2/.toys.rb deleted file mode 100644 index 177e22456e8a..000000000000 --- a/owl-bot-staging/google-iam-v2/.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-iam-v2/.yardopts b/owl-bot-staging/google-iam-v2/.yardopts deleted file mode 100644 index 74817379a031..000000000000 --- a/owl-bot-staging/google-iam-v2/.yardopts +++ /dev/null @@ -1,12 +0,0 @@ ---no-private ---title="IAM V2 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-iam-v2/AUTHENTICATION.md b/owl-bot-staging/google-iam-v2/AUTHENTICATION.md deleted file mode 100644 index 6a0825ac614f..000000000000 --- a/owl-bot-staging/google-iam-v2/AUTHENTICATION.md +++ /dev/null @@ -1,122 +0,0 @@ -# Authentication - -The recommended way to authenticate to the google-iam-v2 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-iam-v2 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/iam/v2" - -client = ::Google::Iam::V2::Policies::Client.new do |config| - config.credentials = "path/to/credentialfile.json" -end -``` - -To configure a credentials file globally for all clients: - -```ruby -require "google/iam/v2" - -::Google::Iam::V2::Policies::Client.configure do |config| - config.credentials = "path/to/credentialfile.json" -end - -client = ::Google::Iam::V2::Policies::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-iam-v2 -checks for credentials are: - -* `GOOGLE_CLOUD_CREDENTIALS` - Path to JSON file, or JSON contents -* `GOOGLE_APPLICATION_CREDENTIALS` - Path to JSON file - -```ruby -require "google/iam/v2" - -ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json" - -client = ::Google::Iam::V2::Policies::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-iam-v2/CHANGELOG.md b/owl-bot-staging/google-iam-v2/CHANGELOG.md deleted file mode 100644 index f88957a62ba2..000000000000 --- a/owl-bot-staging/google-iam-v2/CHANGELOG.md +++ /dev/null @@ -1,2 +0,0 @@ -# Release History - diff --git a/owl-bot-staging/google-iam-v2/Gemfile b/owl-bot-staging/google-iam-v2/Gemfile deleted file mode 100644 index 1d08558908d8..000000000000 --- a/owl-bot-staging/google-iam-v2/Gemfile +++ /dev/null @@ -1,14 +0,0 @@ -source "https://rubygems.org" - -gemspec - -gem "google-style", "~> 1.32.0" -gem "irb", "~> 1.17" -gem "minitest", "~> 6.0.2" -gem "minitest-focus", "~> 1.4" -gem "minitest-mock", "~> 5.27" -gem "minitest-rg", "~> 5.3" -gem "ostruct", "~> 0.5.5" -gem "rake", ">= 13.0" -gem "redcarpet", "~> 3.6" -gem "yard", "~> 0.9" diff --git a/owl-bot-staging/google-iam-v2/LICENSE.md b/owl-bot-staging/google-iam-v2/LICENSE.md deleted file mode 100644 index c261857ba6ad..000000000000 --- a/owl-bot-staging/google-iam-v2/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-iam-v2/README.md b/owl-bot-staging/google-iam-v2/README.md deleted file mode 100644 index 743fbe826f82..000000000000 --- a/owl-bot-staging/google-iam-v2/README.md +++ /dev/null @@ -1,154 +0,0 @@ -# Ruby Client for the IAM V2 API - -Manages identity and access control for Google Cloud Platform resources, including the creation of service accounts, which you can use to authenticate to Google and make API calls. - -Manages identity and access control policies for Google Cloud Platform resources. - -https://github.com/googleapis/google-cloud-ruby - -This gem is a _versioned_ client. It provides basic client classes for a -specific version of the IAM V2 API. Most users should consider using -the main client gem, -[google-iam-client](https://rubygems.org/gems/google-iam-client). -See the section below titled *Which client should I use?* for more information. - -## Installation - -``` -$ gem install google-iam-v2 -``` - -## 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/iam.googleapis.com) -1. [Set up authentication.](AUTHENTICATION.md) - -## Quick Start - -```ruby -require "google/iam/v2" - -client = ::Google::Iam::V2::Policies::Client.new -request = ::Google::Iam::V2::ListPoliciesRequest.new # (request fields as keyword arguments...) -response = client.list_policies request -``` - -View the [Client Library Documentation](https://rubydoc.info/gems/google-iam-v2) -for class and method documentation. - -See also the [Product Documentation](https://cloud.google.com/iam) -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/iam/v2" -require "logger" - -client = ::Google::Iam::V2::Policies::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-iam-client`, -and lower-level _versioned_ client libraries with names such as -`google-iam-v2`. -_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-iam-client`. -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-iam-v2`. - -### 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-iam-v2/Rakefile b/owl-bot-staging/google-iam-v2/Rakefile deleted file mode 100644 index 17091d3aff5d..000000000000 --- a/owl-bot-staging/google-iam-v2/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-iam-v2 acceptance tests." -task :acceptance, :project, :keyfile do |t, args| - project = args[:project] - project ||= - ENV["GOOGLE_CLOUD_TEST_PROJECT"] || - ENV["GCLOUD_TEST_PROJECT"] - keyfile = args[:keyfile] - keyfile ||= - ENV["GOOGLE_CLOUD_TEST_KEYFILE"] || - ENV["GCLOUD_TEST_KEYFILE"] - if keyfile - keyfile = File.read keyfile - else - keyfile ||= - ENV["GOOGLE_CLOUD_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 GOOGLE_CLOUD_TEST_PROJECT=test123 GOOGLE_CLOUD_TEST_KEYFILE=/path/to/keyfile.json rake acceptance" - end - require "google/iam/v2/policies/credentials" - ::Google::Iam::V2::Policies::Credentials.env_vars.each do |path| - ENV[path] = nil - end - ENV["GOOGLE_CLOUD_PROJECT"] = project - ENV["GOOGLE_CLOUD_TEST_PROJECT"] = project - ENV["GOOGLE_CLOUD_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-iam-v2 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-iam-v2 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-iam-v2 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-iam-v2 gem does not have doctest tests." -end - -desc "Run the CI build" -task :ci do - header "BUILDING google-iam-v2" - header "google-iam-v2 rubocop", "*" - Rake::Task[:rubocop].invoke - header "google-iam-v2 yard", "*" - Rake::Task[:yard].invoke - header "google-iam-v2 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-iam-v2 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-iam-v2 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-iam-v2/gapic_metadata.json b/owl-bot-staging/google-iam-v2/gapic_metadata.json deleted file mode 100644 index f9325ed5c881..000000000000 --- a/owl-bot-staging/google-iam-v2/gapic_metadata.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", - "language": "ruby", - "protoPackage": "google.iam.v2", - "libraryPackage": "::Google::Iam::V2", - "services": { - "Policies": { - "clients": { - "grpc": { - "libraryClient": "::Google::Iam::V2::Policies::Client", - "rpcs": { - "ListPolicies": { - "methods": [ - "list_policies" - ] - }, - "GetPolicy": { - "methods": [ - "get_policy" - ] - }, - "CreatePolicy": { - "methods": [ - "create_policy" - ] - }, - "UpdatePolicy": { - "methods": [ - "update_policy" - ] - }, - "DeletePolicy": { - "methods": [ - "delete_policy" - ] - } - } - } - } - } - } -} diff --git a/owl-bot-staging/google-iam-v2/google-iam-v2.gemspec b/owl-bot-staging/google-iam-v2/google-iam-v2.gemspec deleted file mode 100644 index 5624956ca734..000000000000 --- a/owl-bot-staging/google-iam-v2/google-iam-v2.gemspec +++ /dev/null @@ -1,28 +0,0 @@ -# -*- ruby -*- -# encoding: utf-8 - -require File.expand_path("lib/google/iam/v2/version", __dir__) - -Gem::Specification.new do |gem| - gem.name = "google-iam-v2" - gem.version = Google::Iam::V2::VERSION - - gem.authors = ["Google LLC"] - gem.email = "googleapis-packages@google.com" - gem.description = "Manages identity and access control policies for Google Cloud Platform resources. Note that google-iam-v2 is a version-specific client library. For most uses, we recommend installing the main client library google-iam-client instead. See the readme for more details." - gem.summary = "Manages identity and access control for Google Cloud Platform resources, including the creation of service accounts, which you can use to authenticate to Google and make API calls." - 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.2" - - gem.add_dependency "gapic-common", "~> 1.2" - gem.add_dependency "google-cloud-errors", "~> 1.0" -end diff --git a/owl-bot-staging/google-iam-v2/lib/google-iam-v2.rb b/owl-bot-staging/google-iam-v2/lib/google-iam-v2.rb deleted file mode 100644 index 976c5cee3515..000000000000 --- a/owl-bot-staging/google-iam-v2/lib/google-iam-v2.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/iam/v2" diff --git a/owl-bot-staging/google-iam-v2/lib/google/iam/v2.rb b/owl-bot-staging/google-iam-v2/lib/google/iam/v2.rb deleted file mode 100644 index fc5ba38b2a63..000000000000 --- a/owl-bot-staging/google-iam-v2/lib/google/iam/v2.rb +++ /dev/null @@ -1,43 +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/iam/v2/policies" -require "google/iam/v2/version" - -module Google - module Iam - ## - # API client module. - # - # @example Load this package, including all its services, and instantiate a gRPC client - # - # require "google/iam/v2" - # client = ::Google::Iam::V2::Policies::Client.new - # - # @example Load this package, including all its services, and instantiate a REST client - # - # require "google/iam/v2" - # client = ::Google::Iam::V2::Policies::Rest::Client.new - # - module V2 - end - end -end - -helper_path = ::File.join __dir__, "v2", "_helpers.rb" -require "google/iam/v2/_helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-iam-v2/lib/google/iam/v2/deny_pb.rb b/owl-bot-staging/google-iam-v2/lib/google/iam/v2/deny_pb.rb deleted file mode 100644 index 13a714e88610..000000000000 --- a/owl-bot-staging/google-iam-v2/lib/google/iam/v2/deny_pb.rb +++ /dev/null @@ -1,21 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/iam/v2/deny.proto - -require 'google/protobuf' - -require 'google/type/expr_pb' - - -descriptor_data = "\n\x18google/iam/v2/deny.proto\x12\rgoogle.iam.v2\x1a\x16google/type/expr.proto\"\xab\x01\n\x08\x44\x65nyRule\x12\x19\n\x11\x64\x65nied_principals\x18\x01 \x03(\t\x12\x1c\n\x14\x65xception_principals\x18\x02 \x03(\t\x12\x1a\n\x12\x64\x65nied_permissions\x18\x03 \x03(\t\x12\x1d\n\x15\x65xception_permissions\x18\x04 \x03(\t\x12+\n\x10\x64\x65nial_condition\x18\x05 \x01(\x0b\x32\x11.google.type.ExprB{\n\x11\x63om.google.iam.v2B\rDenyRuleProtoP\x01Z)cloud.google.com/go/iam/apiv2/iampb;iampb\xaa\x02\x13Google.Cloud.Iam.V2\xca\x02\x13Google\\Cloud\\Iam\\V2b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Iam - module V2 - DenyRule = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.iam.v2.DenyRule").msgclass - end - end -end diff --git a/owl-bot-staging/google-iam-v2/lib/google/iam/v2/policies.rb b/owl-bot-staging/google-iam-v2/lib/google/iam/v2/policies.rb deleted file mode 100644 index 7c30e2a1e284..000000000000 --- a/owl-bot-staging/google-iam-v2/lib/google/iam/v2/policies.rb +++ /dev/null @@ -1,53 +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/iam/v2/version" - -require "google/iam/v2/policies/credentials" -require "google/iam/v2/policies/operations" -require "google/iam/v2/policies/client" -require "google/iam/v2/policies/rest" - -module Google - module Iam - module V2 - ## - # An interface for managing Identity and Access Management (IAM) policies. - # - # @example Load this service and instantiate a gRPC client - # - # require "google/iam/v2/policies" - # client = ::Google::Iam::V2::Policies::Client.new - # - # @example Load this service and instantiate a REST client - # - # require "google/iam/v2/policies/rest" - # client = ::Google::Iam::V2::Policies::Rest::Client.new - # - module Policies - end - end - end -end - -helper_path = ::File.join __dir__, "policies", "helpers.rb" -require "google/iam/v2/policies/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-iam-v2/lib/google/iam/v2/policies/client.rb b/owl-bot-staging/google-iam-v2/lib/google/iam/v2/policies/client.rb deleted file mode 100644 index 4affa68fa123..000000000000 --- a/owl-bot-staging/google-iam-v2/lib/google/iam/v2/policies/client.rb +++ /dev/null @@ -1,987 +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/iam/v2/policy_pb" - -module Google - module Iam - module V2 - module Policies - ## - # Client for the Policies service. - # - # An interface for managing Identity and Access Management (IAM) policies. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "iam.$UNIVERSE_DOMAIN$" - - # @private - attr_reader :policies_stub - - ## - # Configure the Policies Client class. - # - # See {::Google::Iam::V2::Policies::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all Policies clients - # ::Google::Iam::V2::Policies::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", "Iam", "V2"] - 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_policies.timeout = 60.0 - default_config.rpcs.list_policies.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.get_policy.timeout = 60.0 - default_config.rpcs.get_policy.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.create_policy.timeout = 60.0 - default_config.rpcs.create_policy.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.update_policy.timeout = 60.0 - default_config.rpcs.update_policy.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.delete_policy.timeout = 60.0 - default_config.rpcs.delete_policy.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the Policies 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::Iam::V2::Policies::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 - @policies_stub.universe_domain - end - - ## - # Create a new Policies client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Iam::V2::Policies::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Iam::V2::Policies::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Policies 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/iam/v2/policy_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 - - @policies_stub = ::Gapic::ServiceStub.new( - ::Google::Iam::V2::Policies::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 - ) - - @policies_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 - end - - ## - # Get the associated client for long-running operations. - # - # @return [::Google::Iam::V2::Policies::Operations] - # - attr_reader :operations_client - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @policies_stub.logger - end - - # Service calls - - ## - # Retrieves the policies of the specified kind that are attached to a - # resource. - # - # The response lists only policy metadata. In particular, policy rules are - # omitted. - # - # @overload list_policies(request, options = nil) - # Pass arguments to `list_policies` via a request object, either of type - # {::Google::Iam::V2::ListPoliciesRequest} or an equivalent Hash. - # - # @param request [::Google::Iam::V2::ListPoliciesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_policies(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_policies` via keyword arguments. Note that at - # least one keyword argument is 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 that the policy is attached to, along with the kind of policy - # to list. Format: - # `policies/{attachment_point}/denypolicies` - # - # - # The attachment point is identified by its URL-encoded full resource name, - # which means that the forward-slash character, `/`, must be written as - # `%2F`. For example, - # `policies/cloudresourcemanager.googleapis.com%2Fprojects%2Fmy-project/denypolicies`. - # - # For organizations and folders, use the numeric ID in the full resource - # name. For projects, you can use the alphanumeric or the numeric ID. - # @param page_size [::Integer] - # The maximum number of policies to return. IAM ignores this value and uses - # the value 1000. - # @param page_token [::String] - # A page token received in a {::Google::Iam::V2::ListPoliciesResponse ListPoliciesResponse}. Provide this token to - # retrieve the next page. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Gapic::PagedEnumerable<::Google::Iam::V2::Policy>] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Gapic::PagedEnumerable<::Google::Iam::V2::Policy>] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/iam/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Iam::V2::Policies::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Iam::V2::ListPoliciesRequest.new - # - # # Call the list_policies method. - # result = client.list_policies 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::Iam::V2::Policy. - # p item - # end - # - def list_policies request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V2::ListPoliciesRequest - - # Converts hash 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_policies.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::Iam::V2::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_policies.timeout, - metadata: metadata, - retry_policy: @config.rpcs.list_policies.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @policies_stub.call_rpc :list_policies, request, options: options do |response, operation| - response = ::Gapic::PagedEnumerable.new @policies_stub, :list_policies, 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 - - ## - # Gets a policy. - # - # @overload get_policy(request, options = nil) - # Pass arguments to `get_policy` via a request object, either of type - # {::Google::Iam::V2::GetPolicyRequest} or an equivalent Hash. - # - # @param request [::Google::Iam::V2::GetPolicyRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_policy(name: nil) - # Pass arguments to `get_policy` via keyword arguments. Note that at - # least one keyword argument is 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 policy to retrieve. Format: - # `policies/{attachment_point}/denypolicies/{policy_id}` - # - # - # Use the URL-encoded full resource name, which means that the forward-slash - # character, `/`, must be written as `%2F`. For example, - # `policies/cloudresourcemanager.googleapis.com%2Fprojects%2Fmy-project/denypolicies/my-policy`. - # - # For organizations and folders, use the numeric ID in the full resource - # name. For projects, you can use the alphanumeric or the numeric ID. - # - # @yield [response, operation] Access the result along with the RPC operation - # @yieldparam response [::Google::Iam::V2::Policy] - # @yieldparam operation [::GRPC::ActiveCall::Operation] - # - # @return [::Google::Iam::V2::Policy] - # - # @raise [::Google::Cloud::Error] if the RPC is aborted. - # - # @example Basic example - # require "google/iam/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Iam::V2::Policies::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Iam::V2::GetPolicyRequest.new - # - # # Call the get_policy method. - # result = client.get_policy request - # - # # The returned object is of type Google::Iam::V2::Policy. - # p result - # - def get_policy request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V2::GetPolicyRequest - - # Converts hash 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_policy.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::Iam::V2::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_policy.timeout, - metadata: metadata, - retry_policy: @config.rpcs.get_policy.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @policies_stub.call_rpc :get_policy, 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 policy. - # - # @overload create_policy(request, options = nil) - # Pass arguments to `create_policy` via a request object, either of type - # {::Google::Iam::V2::CreatePolicyRequest} or an equivalent Hash. - # - # @param request [::Google::Iam::V2::CreatePolicyRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_policy(parent: nil, policy: nil, policy_id: nil) - # Pass arguments to `create_policy` via keyword arguments. Note that at - # least one keyword argument is 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 that the policy is attached to, along with the kind of policy - # to create. Format: `policies/{attachment_point}/denypolicies` - # - # - # The attachment point is identified by its URL-encoded full resource name, - # which means that the forward-slash character, `/`, must be written as - # `%2F`. For example, - # `policies/cloudresourcemanager.googleapis.com%2Fprojects%2Fmy-project/denypolicies`. - # - # For organizations and folders, use the numeric ID in the full resource - # name. For projects, you can use the alphanumeric or the numeric ID. - # @param policy [::Google::Iam::V2::Policy, ::Hash] - # Required. The policy to create. - # @param policy_id [::String] - # The ID to use for this policy, which will become the final component of - # the policy's resource name. The ID must contain 3 to 63 characters. It can - # contain lowercase letters and numbers, as well as dashes (`-`) and periods - # (`.`). The first character must be a lowercase letter. - # - # @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/iam/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Iam::V2::Policies::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Iam::V2::CreatePolicyRequest.new - # - # # Call the create_policy method. - # result = client.create_policy 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_policy request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V2::CreatePolicyRequest - - # Converts hash 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_policy.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::Iam::V2::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_policy.timeout, - metadata: metadata, - retry_policy: @config.rpcs.create_policy.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @policies_stub.call_rpc :create_policy, 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 - - ## - # Updates the specified policy. - # - # You can update only the rules and the display name for the policy. - # - # To update a policy, you should use a read-modify-write loop: - # - # 1. Use {::Google::Iam::V2::Policies::Client#get_policy GetPolicy} to read the current version of the policy. - # 2. Modify the policy as needed. - # 3. Use `UpdatePolicy` to write the updated policy. - # - # This pattern helps prevent conflicts between concurrent updates. - # - # @overload update_policy(request, options = nil) - # Pass arguments to `update_policy` via a request object, either of type - # {::Google::Iam::V2::UpdatePolicyRequest} or an equivalent Hash. - # - # @param request [::Google::Iam::V2::UpdatePolicyRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_policy(policy: nil) - # Pass arguments to `update_policy` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param policy [::Google::Iam::V2::Policy, ::Hash] - # Required. The policy to update. - # - # To prevent conflicting updates, the `etag` value must match the value that - # is stored in IAM. If the `etag` values do not match, the request fails with - # a `409` error code and `ABORTED` status. - # - # @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/iam/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Iam::V2::Policies::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Iam::V2::UpdatePolicyRequest.new - # - # # Call the update_policy method. - # result = client.update_policy 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 update_policy request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V2::UpdatePolicyRequest - - # Converts hash 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_policy.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::Iam::V2::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.policy&.name - header_params["policy.name"] = request.policy.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_policy.timeout, - metadata: metadata, - retry_policy: @config.rpcs.update_policy.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @policies_stub.call_rpc :update_policy, 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 policy. This action is permanent. - # - # @overload delete_policy(request, options = nil) - # Pass arguments to `delete_policy` via a request object, either of type - # {::Google::Iam::V2::DeletePolicyRequest} or an equivalent Hash. - # - # @param request [::Google::Iam::V2::DeletePolicyRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_policy(name: nil, etag: nil) - # Pass arguments to `delete_policy` via keyword arguments. Note that at - # least one keyword argument is 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 policy to delete. Format: - # `policies/{attachment_point}/denypolicies/{policy_id}` - # - # - # Use the URL-encoded full resource name, which means that the forward-slash - # character, `/`, must be written as `%2F`. For example, - # `policies/cloudresourcemanager.googleapis.com%2Fprojects%2Fmy-project/denypolicies/my-policy`. - # - # For organizations and folders, use the numeric ID in the full resource - # name. For projects, you can use the alphanumeric or the numeric ID. - # @param etag [::String] - # Optional. The expected `etag` of the policy to delete. If the value does not match - # the value that is stored in IAM, the request fails with a `409` error code - # and `ABORTED` status. - # - # If you omit this field, the policy is deleted regardless of its current - # `etag`. - # - # @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/iam/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Iam::V2::Policies::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Iam::V2::DeletePolicyRequest.new - # - # # Call the delete_policy method. - # result = client.delete_policy 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_policy request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V2::DeletePolicyRequest - - # Converts hash 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_policy.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::Iam::V2::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_policy.timeout, - metadata: metadata, - retry_policy: @config.rpcs.delete_policy.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @policies_stub.call_rpc :delete_policy, 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 Policies API. - # - # This class represents the configuration for Policies, - # 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::Iam::V2::Policies::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_policies to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Iam::V2::Policies::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_policies.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Iam::V2::Policies::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_policies.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::Iam::V2::Policies::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 = "iam.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 Policies 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_policies` - # @return [::Gapic::Config::Method] - # - attr_reader :list_policies - ## - # RPC-specific configuration for `get_policy` - # @return [::Gapic::Config::Method] - # - attr_reader :get_policy - ## - # RPC-specific configuration for `create_policy` - # @return [::Gapic::Config::Method] - # - attr_reader :create_policy - ## - # RPC-specific configuration for `update_policy` - # @return [::Gapic::Config::Method] - # - attr_reader :update_policy - ## - # RPC-specific configuration for `delete_policy` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_policy - - # @private - def initialize parent_rpcs = nil - list_policies_config = parent_rpcs.list_policies if parent_rpcs.respond_to? :list_policies - @list_policies = ::Gapic::Config::Method.new list_policies_config - get_policy_config = parent_rpcs.get_policy if parent_rpcs.respond_to? :get_policy - @get_policy = ::Gapic::Config::Method.new get_policy_config - create_policy_config = parent_rpcs.create_policy if parent_rpcs.respond_to? :create_policy - @create_policy = ::Gapic::Config::Method.new create_policy_config - update_policy_config = parent_rpcs.update_policy if parent_rpcs.respond_to? :update_policy - @update_policy = ::Gapic::Config::Method.new update_policy_config - delete_policy_config = parent_rpcs.delete_policy if parent_rpcs.respond_to? :delete_policy - @delete_policy = ::Gapic::Config::Method.new delete_policy_config - - yield self if block_given? - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-iam-v2/lib/google/iam/v2/policies/credentials.rb b/owl-bot-staging/google-iam-v2/lib/google/iam/v2/policies/credentials.rb deleted file mode 100644 index 99a803e1b8c6..000000000000 --- a/owl-bot-staging/google-iam-v2/lib/google/iam/v2/policies/credentials.rb +++ /dev/null @@ -1,45 +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 Iam - module V2 - module Policies - # Credentials for the Policies API. - class Credentials < ::Google::Auth::Credentials - self.scope = [ - "https://www.googleapis.com/auth/cloud-platform" - ] - self.env_vars = [ - "GOOGLE_CLOUD_CREDENTIALS", - "GOOGLE_CLOUD_KEYFILE", - "GCLOUD_KEYFILE", - "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 diff --git a/owl-bot-staging/google-iam-v2/lib/google/iam/v2/policies/operations.rb b/owl-bot-staging/google-iam-v2/lib/google/iam/v2/policies/operations.rb deleted file mode 100644 index 2f2e84c1ee11..000000000000 --- a/owl-bot-staging/google-iam-v2/lib/google/iam/v2/policies/operations.rb +++ /dev/null @@ -1,839 +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 Iam - module V2 - module Policies - # Service that implements Longrunning Operations API. - class Operations - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "iam.$UNIVERSE_DOMAIN$" - - # @private - attr_reader :operations_stub - - ## - # Configuration for the Policies 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 Policies 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::Iam::V2::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::Iam::V2::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::Iam::V2::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::Iam::V2::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::Iam::V2::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 = "iam.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 diff --git a/owl-bot-staging/google-iam-v2/lib/google/iam/v2/policies/rest.rb b/owl-bot-staging/google-iam-v2/lib/google/iam/v2/policies/rest.rb deleted file mode 100644 index c1f6d1def0ec..000000000000 --- a/owl-bot-staging/google-iam-v2/lib/google/iam/v2/policies/rest.rb +++ /dev/null @@ -1,50 +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/iam/v2/version" - -require "google/iam/v2/policies/credentials" -require "google/iam/v2/policies/rest/operations" -require "google/iam/v2/policies/rest/client" - -module Google - module Iam - module V2 - ## - # An interface for managing Identity and Access Management (IAM) policies. - # - # To load this service and instantiate a REST client: - # - # require "google/iam/v2/policies/rest" - # client = ::Google::Iam::V2::Policies::Rest::Client.new - # - module Policies - # Client for the REST transport - module Rest - end - end - end - end -end - -helper_path = ::File.join __dir__, "rest", "helpers.rb" -require "google/iam/v2/policies/rest/helpers" if ::File.file? helper_path diff --git a/owl-bot-staging/google-iam-v2/lib/google/iam/v2/policies/rest/client.rb b/owl-bot-staging/google-iam-v2/lib/google/iam/v2/policies/rest/client.rb deleted file mode 100644 index fd046205b243..000000000000 --- a/owl-bot-staging/google-iam-v2/lib/google/iam/v2/policies/rest/client.rb +++ /dev/null @@ -1,909 +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/iam/v2/policy_pb" -require "google/iam/v2/policies/rest/service_stub" - -module Google - module Iam - module V2 - module Policies - module Rest - ## - # REST client for the Policies service. - # - # An interface for managing Identity and Access Management (IAM) policies. - # - class Client - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "iam.$UNIVERSE_DOMAIN$" - - # @private - attr_reader :policies_stub - - ## - # Configure the Policies Client class. - # - # See {::Google::Iam::V2::Policies::Rest::Client::Configuration} - # for a description of the configuration fields. - # - # @example - # - # # Modify the configuration for all Policies clients - # ::Google::Iam::V2::Policies::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", "Iam", "V2"] - 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_policies.timeout = 60.0 - default_config.rpcs.list_policies.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.get_policy.timeout = 60.0 - default_config.rpcs.get_policy.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.create_policy.timeout = 60.0 - default_config.rpcs.create_policy.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.update_policy.timeout = 60.0 - default_config.rpcs.update_policy.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config.rpcs.delete_policy.timeout = 60.0 - default_config.rpcs.delete_policy.retry_policy = { - initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14] - } - - default_config - end - yield @configure if block_given? - @configure - end - - ## - # Configure the Policies 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::Iam::V2::Policies::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 - @policies_stub.universe_domain - end - - ## - # Create a new Policies REST client object. - # - # @example - # - # # Create a client using the default configuration - # client = ::Google::Iam::V2::Policies::Rest::Client.new - # - # # Create a client using a custom configuration - # client = ::Google::Iam::V2::Policies::Rest::Client.new do |config| - # config.timeout = 10.0 - # end - # - # @yield [config] Configure the Policies 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::Iam::V2::Policies::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 - - @policies_stub = ::Google::Iam::V2::Policies::Rest::ServiceStub.new( - endpoint: @config.endpoint, - endpoint_template: DEFAULT_ENDPOINT_TEMPLATE, - universe_domain: @config.universe_domain, - credentials: credentials, - logger: @config.logger - ) - - @policies_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 - end - - ## - # Get the associated client for long-running operations. - # - # @return [::Google::Iam::V2::Policies::Rest::Operations] - # - attr_reader :operations_client - - ## - # The logger used for request/response debug logging. - # - # @return [Logger] - # - def logger - @policies_stub.logger - end - - # Service calls - - ## - # Retrieves the policies of the specified kind that are attached to a - # resource. - # - # The response lists only policy metadata. In particular, policy rules are - # omitted. - # - # @overload list_policies(request, options = nil) - # Pass arguments to `list_policies` via a request object, either of type - # {::Google::Iam::V2::ListPoliciesRequest} or an equivalent Hash. - # - # @param request [::Google::Iam::V2::ListPoliciesRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_policies(parent: nil, page_size: nil, page_token: nil) - # Pass arguments to `list_policies` via keyword arguments. Note that at - # least one keyword argument is 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 that the policy is attached to, along with the kind of policy - # to list. Format: - # `policies/{attachment_point}/denypolicies` - # - # - # The attachment point is identified by its URL-encoded full resource name, - # which means that the forward-slash character, `/`, must be written as - # `%2F`. For example, - # `policies/cloudresourcemanager.googleapis.com%2Fprojects%2Fmy-project/denypolicies`. - # - # For organizations and folders, use the numeric ID in the full resource - # name. For projects, you can use the alphanumeric or the numeric ID. - # @param page_size [::Integer] - # The maximum number of policies to return. IAM ignores this value and uses - # the value 1000. - # @param page_token [::String] - # A page token received in a {::Google::Iam::V2::ListPoliciesResponse ListPoliciesResponse}. Provide this token to - # retrieve the next page. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Iam::V2::Policy>] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Gapic::Rest::PagedEnumerable<::Google::Iam::V2::Policy>] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/iam/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Iam::V2::Policies::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Iam::V2::ListPoliciesRequest.new - # - # # Call the list_policies method. - # result = client.list_policies 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::Iam::V2::Policy. - # p item - # end - # - def list_policies request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V2::ListPoliciesRequest - - # Converts hash 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_policies.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::Iam::V2::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_policies.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.list_policies.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @policies_stub.list_policies request, options do |result, operation| - result = ::Gapic::Rest::PagedEnumerable.new @policies_stub, :list_policies, "policies", 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 a policy. - # - # @overload get_policy(request, options = nil) - # Pass arguments to `get_policy` via a request object, either of type - # {::Google::Iam::V2::GetPolicyRequest} or an equivalent Hash. - # - # @param request [::Google::Iam::V2::GetPolicyRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_policy(name: nil) - # Pass arguments to `get_policy` via keyword arguments. Note that at - # least one keyword argument is 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 policy to retrieve. Format: - # `policies/{attachment_point}/denypolicies/{policy_id}` - # - # - # Use the URL-encoded full resource name, which means that the forward-slash - # character, `/`, must be written as `%2F`. For example, - # `policies/cloudresourcemanager.googleapis.com%2Fprojects%2Fmy-project/denypolicies/my-policy`. - # - # For organizations and folders, use the numeric ID in the full resource - # name. For projects, you can use the alphanumeric or the numeric ID. - # @yield [result, operation] Access the result along with the TransportOperation object - # @yieldparam result [::Google::Iam::V2::Policy] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Iam::V2::Policy] - # - # @raise [::Google::Cloud::Error] if the REST call is aborted. - # - # @example Basic example - # require "google/iam/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Iam::V2::Policies::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Iam::V2::GetPolicyRequest.new - # - # # Call the get_policy method. - # result = client.get_policy request - # - # # The returned object is of type Google::Iam::V2::Policy. - # p result - # - def get_policy request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V2::GetPolicyRequest - - # Converts hash 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_policy.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::Iam::V2::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_policy.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.get_policy.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @policies_stub.get_policy 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 policy. - # - # @overload create_policy(request, options = nil) - # Pass arguments to `create_policy` via a request object, either of type - # {::Google::Iam::V2::CreatePolicyRequest} or an equivalent Hash. - # - # @param request [::Google::Iam::V2::CreatePolicyRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_policy(parent: nil, policy: nil, policy_id: nil) - # Pass arguments to `create_policy` via keyword arguments. Note that at - # least one keyword argument is 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 that the policy is attached to, along with the kind of policy - # to create. Format: `policies/{attachment_point}/denypolicies` - # - # - # The attachment point is identified by its URL-encoded full resource name, - # which means that the forward-slash character, `/`, must be written as - # `%2F`. For example, - # `policies/cloudresourcemanager.googleapis.com%2Fprojects%2Fmy-project/denypolicies`. - # - # For organizations and folders, use the numeric ID in the full resource - # name. For projects, you can use the alphanumeric or the numeric ID. - # @param policy [::Google::Iam::V2::Policy, ::Hash] - # Required. The policy to create. - # @param policy_id [::String] - # The ID to use for this policy, which will become the final component of - # the policy's resource name. The ID must contain 3 to 63 characters. It can - # contain lowercase letters and numbers, as well as dashes (`-`) and periods - # (`.`). The first character must be a lowercase letter. - # @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/iam/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Iam::V2::Policies::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Iam::V2::CreatePolicyRequest.new - # - # # Call the create_policy method. - # result = client.create_policy 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_policy request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V2::CreatePolicyRequest - - # Converts hash 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_policy.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::Iam::V2::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_policy.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.create_policy.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @policies_stub.create_policy 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 - - ## - # Updates the specified policy. - # - # You can update only the rules and the display name for the policy. - # - # To update a policy, you should use a read-modify-write loop: - # - # 1. Use {::Google::Iam::V2::Policies::Rest::Client#get_policy GetPolicy} to read the current version of the policy. - # 2. Modify the policy as needed. - # 3. Use `UpdatePolicy` to write the updated policy. - # - # This pattern helps prevent conflicts between concurrent updates. - # - # @overload update_policy(request, options = nil) - # Pass arguments to `update_policy` via a request object, either of type - # {::Google::Iam::V2::UpdatePolicyRequest} or an equivalent Hash. - # - # @param request [::Google::Iam::V2::UpdatePolicyRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_policy(policy: nil) - # Pass arguments to `update_policy` via keyword arguments. Note that at - # least one keyword argument is required. To specify no parameters, or to keep all - # the default parameter values, pass an empty Hash as a request object (see above). - # - # @param policy [::Google::Iam::V2::Policy, ::Hash] - # Required. The policy to update. - # - # To prevent conflicting updates, the `etag` value must match the value that - # is stored in IAM. If the `etag` values do not match, the request fails with - # a `409` error code and `ABORTED` status. - # @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/iam/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Iam::V2::Policies::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Iam::V2::UpdatePolicyRequest.new - # - # # Call the update_policy method. - # result = client.update_policy 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 update_policy request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V2::UpdatePolicyRequest - - # Converts hash 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_policy.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::Iam::V2::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_policy.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.update_policy.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @policies_stub.update_policy 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 policy. This action is permanent. - # - # @overload delete_policy(request, options = nil) - # Pass arguments to `delete_policy` via a request object, either of type - # {::Google::Iam::V2::DeletePolicyRequest} or an equivalent Hash. - # - # @param request [::Google::Iam::V2::DeletePolicyRequest, ::Hash] - # A request object representing the call parameters. Required. To specify no - # parameters, or to keep all the default parameter 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_policy(name: nil, etag: nil) - # Pass arguments to `delete_policy` via keyword arguments. Note that at - # least one keyword argument is 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 policy to delete. Format: - # `policies/{attachment_point}/denypolicies/{policy_id}` - # - # - # Use the URL-encoded full resource name, which means that the forward-slash - # character, `/`, must be written as `%2F`. For example, - # `policies/cloudresourcemanager.googleapis.com%2Fprojects%2Fmy-project/denypolicies/my-policy`. - # - # For organizations and folders, use the numeric ID in the full resource - # name. For projects, you can use the alphanumeric or the numeric ID. - # @param etag [::String] - # Optional. The expected `etag` of the policy to delete. If the value does not match - # the value that is stored in IAM, the request fails with a `409` error code - # and `ABORTED` status. - # - # If you omit this field, the policy is deleted regardless of its current - # `etag`. - # @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/iam/v2" - # - # # Create a client object. The client can be reused for multiple calls. - # client = Google::Iam::V2::Policies::Rest::Client.new - # - # # Create a request. To set request fields, pass in keyword arguments. - # request = Google::Iam::V2::DeletePolicyRequest.new - # - # # Call the delete_policy method. - # result = client.delete_policy 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_policy request, options = nil - raise ::ArgumentError, "request must be provided" if request.nil? - - request = ::Gapic::Protobuf.coerce request, to: ::Google::Iam::V2::DeletePolicyRequest - - # Converts hash 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_policy.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::Iam::V2::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_policy.timeout, - metadata: call_metadata, - retry_policy: @config.rpcs.delete_policy.retry_policy - - options.apply_defaults timeout: @config.timeout, - metadata: @config.metadata, - retry_policy: @config.retry_policy - - @policies_stub.delete_policy 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 - - ## - # Configuration class for the Policies REST API. - # - # This class represents the configuration for Policies 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::Iam::V2::Policies::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_policies to 20 seconds, - # # and all remaining timeouts to 10 seconds. - # ::Google::Iam::V2::Policies::Rest::Client.configure do |config| - # config.timeout = 10.0 - # config.rpcs.list_policies.timeout = 20.0 - # end - # - # # Apply the above configuration only to a new client. - # client = ::Google::Iam::V2::Policies::Rest::Client.new do |config| - # config.timeout = 10.0 - # config.rpcs.list_policies.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 = "iam.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 Policies 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_policies` - # @return [::Gapic::Config::Method] - # - attr_reader :list_policies - ## - # RPC-specific configuration for `get_policy` - # @return [::Gapic::Config::Method] - # - attr_reader :get_policy - ## - # RPC-specific configuration for `create_policy` - # @return [::Gapic::Config::Method] - # - attr_reader :create_policy - ## - # RPC-specific configuration for `update_policy` - # @return [::Gapic::Config::Method] - # - attr_reader :update_policy - ## - # RPC-specific configuration for `delete_policy` - # @return [::Gapic::Config::Method] - # - attr_reader :delete_policy - - # @private - def initialize parent_rpcs = nil - list_policies_config = parent_rpcs.list_policies if parent_rpcs.respond_to? :list_policies - @list_policies = ::Gapic::Config::Method.new list_policies_config - get_policy_config = parent_rpcs.get_policy if parent_rpcs.respond_to? :get_policy - @get_policy = ::Gapic::Config::Method.new get_policy_config - create_policy_config = parent_rpcs.create_policy if parent_rpcs.respond_to? :create_policy - @create_policy = ::Gapic::Config::Method.new create_policy_config - update_policy_config = parent_rpcs.update_policy if parent_rpcs.respond_to? :update_policy - @update_policy = ::Gapic::Config::Method.new update_policy_config - delete_policy_config = parent_rpcs.delete_policy if parent_rpcs.respond_to? :delete_policy - @delete_policy = ::Gapic::Config::Method.new delete_policy_config - - yield self if block_given? - end - end - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-iam-v2/lib/google/iam/v2/policies/rest/operations.rb b/owl-bot-staging/google-iam-v2/lib/google/iam/v2/policies/rest/operations.rb deleted file mode 100644 index 9bb7499864d3..000000000000 --- a/owl-bot-staging/google-iam-v2/lib/google/iam/v2/policies/rest/operations.rb +++ /dev/null @@ -1,923 +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 Iam - module V2 - module Policies - module Rest - # Service that implements Longrunning Operations API. - class Operations - # @private - API_VERSION = "" - - # @private - DEFAULT_ENDPOINT_TEMPLATE = "iam.$UNIVERSE_DOMAIN$" - - # @private - attr_reader :operations_stub - - ## - # Configuration for the Policies 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 Policies 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::Iam::V2::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::Iam::V2::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::Iam::V2::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::Iam::V2::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 = "iam.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: "/v2/{name}", - matches: [ - ["name", %r{^policies/[^/]+/[^/]+/[^/]+/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 diff --git a/owl-bot-staging/google-iam-v2/lib/google/iam/v2/policies/rest/service_stub.rb b/owl-bot-staging/google-iam-v2/lib/google/iam/v2/policies/rest/service_stub.rb deleted file mode 100644 index cfcc7003472b..000000000000 --- a/owl-bot-staging/google-iam-v2/lib/google/iam/v2/policies/rest/service_stub.rb +++ /dev/null @@ -1,386 +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/iam/v2/policy_pb" - -module Google - module Iam - module V2 - module Policies - module Rest - ## - # REST service stub for the Policies 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_policies REST call - # - # @param request_pb [::Google::Iam::V2::ListPoliciesRequest] - # 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::Iam::V2::ListPoliciesResponse] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Iam::V2::ListPoliciesResponse] - # A result object deserialized from the server's reply - def list_policies request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_list_policies_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_policies", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Iam::V2::ListPoliciesResponse.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_policy REST call - # - # @param request_pb [::Google::Iam::V2::GetPolicyRequest] - # 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::Iam::V2::Policy] - # @yieldparam operation [::Gapic::Rest::TransportOperation] - # - # @return [::Google::Iam::V2::Policy] - # A result object deserialized from the server's reply - def get_policy request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_get_policy_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_policy", - options: options - ) - operation = ::Gapic::Rest::TransportOperation.new response - result = ::Google::Iam::V2::Policy.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_policy REST call - # - # @param request_pb [::Google::Iam::V2::CreatePolicyRequest] - # 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_policy request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_create_policy_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_policy", - 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 update_policy REST call - # - # @param request_pb [::Google::Iam::V2::UpdatePolicyRequest] - # 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 update_policy request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_update_policy_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_policy", - 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_policy REST call - # - # @param request_pb [::Google::Iam::V2::DeletePolicyRequest] - # 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_policy request_pb, options = nil - raise ::ArgumentError, "request must be provided" if request_pb.nil? - - verb, uri, query_string_params, body = ServiceStub.transcode_delete_policy_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_policy", - 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 - - ## - # @private - # - # GRPC transcoding helper method for the list_policies REST call - # - # @param request_pb [::Google::Iam::V2::ListPoliciesRequest] - # 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_policies_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v2/{parent}", - matches: [ - ["parent", %r{^policies/[^/]+/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the get_policy REST call - # - # @param request_pb [::Google::Iam::V2::GetPolicyRequest] - # 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_policy_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :get, - uri_template: "/v2/{name}", - matches: [ - ["name", %r{^policies/[^/]+/[^/]+/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the create_policy REST call - # - # @param request_pb [::Google::Iam::V2::CreatePolicyRequest] - # 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_policy_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :post, - uri_template: "/v2/{parent}", - body: "policy", - matches: [ - ["parent", %r{^policies/[^/]+/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the update_policy REST call - # - # @param request_pb [::Google::Iam::V2::UpdatePolicyRequest] - # 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_policy_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :put, - uri_template: "/v2/{policy.name}", - body: "policy", - matches: [ - ["policy.name", %r{^policies/[^/]+/[^/]+/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - - ## - # @private - # - # GRPC transcoding helper method for the delete_policy REST call - # - # @param request_pb [::Google::Iam::V2::DeletePolicyRequest] - # 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_policy_request request_pb - transcoder = Gapic::Rest::GrpcTranscoder.new - .with_bindings( - uri_method: :delete, - uri_template: "/v2/{name}", - matches: [ - ["name", %r{^policies/[^/]+/[^/]+/[^/]+/?$}, false] - ] - ) - transcoder.transcode request_pb - end - end - end - end - end - end -end diff --git a/owl-bot-staging/google-iam-v2/lib/google/iam/v2/policy_pb.rb b/owl-bot-staging/google-iam-v2/lib/google/iam/v2/policy_pb.rb deleted file mode 100644 index ac1b3aaac015..000000000000 --- a/owl-bot-staging/google-iam-v2/lib/google/iam/v2/policy_pb.rb +++ /dev/null @@ -1,34 +0,0 @@ -# frozen_string_literal: true -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/iam/v2/policy.proto - -require 'google/protobuf' - -require 'google/api/annotations_pb' -require 'google/api/client_pb' -require 'google/api/field_behavior_pb' -require 'google/iam/v2/deny_pb' -require 'google/longrunning/operations_pb' -require 'google/protobuf/timestamp_pb' - - -descriptor_data = "\n\x1agoogle/iam/v2/policy.proto\x12\rgoogle.iam.v2\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x18google/iam/v2/deny.proto\x1a#google/longrunning/operations.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"\xc2\x03\n\x06Policy\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x05\x12\x10\n\x03uid\x18\x02 \x01(\tB\x03\xe0\x41\x05\x12\x11\n\x04kind\x18\x03 \x01(\tB\x03\xe0\x41\x03\x12\x14\n\x0c\x64isplay_name\x18\x04 \x01(\t\x12;\n\x0b\x61nnotations\x18\x05 \x03(\x0b\x32&.google.iam.v2.Policy.AnnotationsEntry\x12\x0c\n\x04\x65tag\x18\x06 \x01(\t\x12\x34\n\x0b\x63reate_time\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x08 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0b\x64\x65lete_time\x18\t \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12(\n\x05rules\x18\n \x03(\x0b\x32\x19.google.iam.v2.PolicyRule\x12\x1f\n\x12managing_authority\x18\x0b \x01(\tB\x03\xe0\x41\x05\x1a\x32\n\x10\x41nnotationsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"W\n\nPolicyRule\x12,\n\tdeny_rule\x18\x02 \x01(\x0b\x32\x17.google.iam.v2.DenyRuleH\x00\x12\x13\n\x0b\x64\x65scription\x18\x01 \x01(\tB\x06\n\x04kind\"Q\n\x13ListPoliciesRequest\x12\x13\n\x06parent\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\"X\n\x14ListPoliciesResponse\x12\'\n\x08policies\x18\x01 \x03(\x0b\x32\x15.google.iam.v2.Policy\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"%\n\x10GetPolicyRequest\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x02\"i\n\x13\x43reatePolicyRequest\x12\x13\n\x06parent\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12*\n\x06policy\x18\x02 \x01(\x0b\x32\x15.google.iam.v2.PolicyB\x03\xe0\x41\x02\x12\x11\n\tpolicy_id\x18\x03 \x01(\t\"A\n\x13UpdatePolicyRequest\x12*\n\x06policy\x18\x01 \x01(\x0b\x32\x15.google.iam.v2.PolicyB\x03\xe0\x41\x02\";\n\x13\x44\x65letePolicyRequest\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x11\n\x04\x65tag\x18\x02 \x01(\tB\x03\xe0\x41\x01\"J\n\x17PolicyOperationMetadata\x12/\n\x0b\x63reate_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp2\xd0\x06\n\x08Policies\x12\x83\x01\n\x0cListPolicies\x12\".google.iam.v2.ListPoliciesRequest\x1a#.google.iam.v2.ListPoliciesResponse\"*\xda\x41\x06parent\x82\xd3\xe4\x93\x02\x1b\x12\x19/v2/{parent=policies/*/*}\x12m\n\tGetPolicy\x12\x1f.google.iam.v2.GetPolicyRequest\x1a\x15.google.iam.v2.Policy\"(\xda\x41\x04name\x82\xd3\xe4\x93\x02\x1b\x12\x19/v2/{name=policies/*/*/*}\x12\xba\x01\n\x0c\x43reatePolicy\x12\".google.iam.v2.CreatePolicyRequest\x1a\x1d.google.longrunning.Operation\"g\xca\x41!\n\x06Policy\x12\x17PolicyOperationMetadata\xda\x41\x17parent,policy,policy_id\x82\xd3\xe4\x93\x02#\"\x19/v2/{parent=policies/*/*}:\x06policy\x12\xa7\x01\n\x0cUpdatePolicy\x12\".google.iam.v2.UpdatePolicyRequest\x1a\x1d.google.longrunning.Operation\"T\xca\x41!\n\x06Policy\x12\x17PolicyOperationMetadata\x82\xd3\xe4\x93\x02*\x1a /v2/{policy.name=policies/*/*/*}:\x06policy\x12\x9f\x01\n\x0c\x44\x65letePolicy\x12\".google.iam.v2.DeletePolicyRequest\x1a\x1d.google.longrunning.Operation\"L\xca\x41!\n\x06Policy\x12\x17PolicyOperationMetadata\xda\x41\x04name\x82\xd3\xe4\x93\x02\x1b*\x19/v2/{name=policies/*/*/*}\x1a\x46\xca\x41\x12iam.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformBy\n\x11\x63om.google.iam.v2B\x0bPolicyProtoP\x01Z)cloud.google.com/go/iam/apiv2/iampb;iampb\xaa\x02\x13Google.Cloud.Iam.V2\xca\x02\x13Google\\Cloud\\Iam\\V2b\x06proto3" - -pool = ::Google::Protobuf::DescriptorPool.generated_pool -pool.add_serialized_file(descriptor_data) - -module Google - module Iam - module V2 - Policy = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.iam.v2.Policy").msgclass - PolicyRule = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.iam.v2.PolicyRule").msgclass - ListPoliciesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.iam.v2.ListPoliciesRequest").msgclass - ListPoliciesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.iam.v2.ListPoliciesResponse").msgclass - GetPolicyRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.iam.v2.GetPolicyRequest").msgclass - CreatePolicyRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.iam.v2.CreatePolicyRequest").msgclass - UpdatePolicyRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.iam.v2.UpdatePolicyRequest").msgclass - DeletePolicyRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.iam.v2.DeletePolicyRequest").msgclass - PolicyOperationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.iam.v2.PolicyOperationMetadata").msgclass - end - end -end diff --git a/owl-bot-staging/google-iam-v2/lib/google/iam/v2/policy_services_pb.rb b/owl-bot-staging/google-iam-v2/lib/google/iam/v2/policy_services_pb.rb deleted file mode 100644 index bd26fe57cd18..000000000000 --- a/owl-bot-staging/google-iam-v2/lib/google/iam/v2/policy_services_pb.rb +++ /dev/null @@ -1,65 +0,0 @@ -# Generated by the protocol buffer compiler. DO NOT EDIT! -# Source: google/iam/v2/policy.proto for package 'google.iam.v2' -# 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/iam/v2/policy_pb' - -module Google - module Iam - module V2 - module Policies - # An interface for managing Identity and Access Management (IAM) policies. - class Service - - include ::GRPC::GenericService - - self.marshal_class_method = :encode - self.unmarshal_class_method = :decode - self.service_name = 'google.iam.v2.Policies' - - # Retrieves the policies of the specified kind that are attached to a - # resource. - # - # The response lists only policy metadata. In particular, policy rules are - # omitted. - rpc :ListPolicies, ::Google::Iam::V2::ListPoliciesRequest, ::Google::Iam::V2::ListPoliciesResponse - # Gets a policy. - rpc :GetPolicy, ::Google::Iam::V2::GetPolicyRequest, ::Google::Iam::V2::Policy - # Creates a policy. - rpc :CreatePolicy, ::Google::Iam::V2::CreatePolicyRequest, ::Google::Longrunning::Operation - # Updates the specified policy. - # - # You can update only the rules and the display name for the policy. - # - # To update a policy, you should use a read-modify-write loop: - # - # 1. Use [GetPolicy][google.iam.v2.Policies.GetPolicy] to read the current version of the policy. - # 2. Modify the policy as needed. - # 3. Use `UpdatePolicy` to write the updated policy. - # - # This pattern helps prevent conflicts between concurrent updates. - rpc :UpdatePolicy, ::Google::Iam::V2::UpdatePolicyRequest, ::Google::Longrunning::Operation - # Deletes a policy. This action is permanent. - rpc :DeletePolicy, ::Google::Iam::V2::DeletePolicyRequest, ::Google::Longrunning::Operation - end - - Stub = Service.rpc_stub_class - end - end - end -end diff --git a/owl-bot-staging/google-iam-v2/lib/google/iam/v2/rest.rb b/owl-bot-staging/google-iam-v2/lib/google/iam/v2/rest.rb deleted file mode 100644 index d430e48053e6..000000000000 --- a/owl-bot-staging/google-iam-v2/lib/google/iam/v2/rest.rb +++ /dev/null @@ -1,35 +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/iam/v2/policies/rest" -require "google/iam/v2/version" - -module Google - module Iam - ## - # To load just the REST part of this package, including all its services, and instantiate a REST client: - # - # @example - # - # require "google/iam/v2/rest" - # client = ::Google::Iam::V2::Policies::Rest::Client.new - # - module V2 - end - end -end diff --git a/owl-bot-staging/google-iam-v2/lib/google/iam/v2/version.rb b/owl-bot-staging/google-iam-v2/lib/google/iam/v2/version.rb deleted file mode 100644 index da9bc723e32d..000000000000 --- a/owl-bot-staging/google-iam-v2/lib/google/iam/v2/version.rb +++ /dev/null @@ -1,26 +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 Iam - module V2 - VERSION = "0.0.1" - end - end -end diff --git a/owl-bot-staging/google-iam-v2/proto_docs/README.md b/owl-bot-staging/google-iam-v2/proto_docs/README.md deleted file mode 100644 index 155a17d3cb7c..000000000000 --- a/owl-bot-staging/google-iam-v2/proto_docs/README.md +++ /dev/null @@ -1,4 +0,0 @@ -# IAM V2 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-iam-v2/proto_docs/google/api/client.rb b/owl-bot-staging/google-iam-v2/proto_docs/google/api/client.rb deleted file mode 100644 index 3ab0b096d445..000000000000 --- a/owl-bot-staging/google-iam-v2/proto_docs/google/api/client.rb +++ /dev/null @@ -1,593 +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. - # - # Note: This field should not be used in most cases. - 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: - # library_settings: - # 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. - # @!attribute [rw] library_package - # @return [::String] - # The package name to use in Php. Clobbers the php_namespace option - # set in the protobuf. This should be used **only** by APIs - # who have already set the language_settings.php.package_name" field - # in gapic.yaml. API teams should use the protobuf php_namespace option - # where possible. - # - # Example of a YAML configuration:: - # - # publishing: - # library_settings: - # php_settings: - # library_package: Google\Cloud\PubSub\V1 - 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. - # - # Example: - # - # 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 - # @!attribute [rw] batching - # @return [::Google::Api::BatchingConfigProto] - # Batching configuration for an API method in client libraries. - # - # Example of a YAML configuration: - # - # publishing: - # method_settings: - # - selector: google.example.v1.ExampleService.BatchCreateExample - # batching: - # element_count_threshold: 1000 - # request_byte_threshold: 100000000 - # delay_threshold_millis: 10 - 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. - # - # Note: This feature should not be used in most cases. - # @!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 - - # `BatchingConfigProto` defines the batching configuration for an API method. - # @!attribute [rw] thresholds - # @return [::Google::Api::BatchingSettingsProto] - # The thresholds which trigger a batched request to be sent. - # @!attribute [rw] batch_descriptor - # @return [::Google::Api::BatchingDescriptorProto] - # The request and response fields used in batching. - class BatchingConfigProto - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # `BatchingSettingsProto` specifies a set of batching thresholds, each of - # which acts as a trigger to send a batch of messages as a request. At least - # one threshold must be positive nonzero. - # @!attribute [rw] element_count_threshold - # @return [::Integer] - # The number of elements of a field collected into a batch which, if - # exceeded, causes the batch to be sent. - # @!attribute [rw] request_byte_threshold - # @return [::Integer] - # The aggregated size of the batched field which, if exceeded, causes the - # batch to be sent. This size is computed by aggregating the sizes of the - # request field to be batched, not of the entire request message. - # @!attribute [rw] delay_threshold - # @return [::Google::Protobuf::Duration] - # The duration after which a batch should be sent, starting from the addition - # of the first message to that batch. - # @!attribute [rw] element_count_limit - # @return [::Integer] - # The maximum number of elements collected in a batch that could be accepted - # by server. - # @!attribute [rw] request_byte_limit - # @return [::Integer] - # The maximum size of the request that could be accepted by server. - # @!attribute [rw] flow_control_element_limit - # @return [::Integer] - # The maximum number of elements allowed by flow control. - # @!attribute [rw] flow_control_byte_limit - # @return [::Integer] - # The maximum size of data allowed by flow control. - # @!attribute [rw] flow_control_limit_exceeded_behavior - # @return [::Google::Api::FlowControlLimitExceededBehaviorProto] - # The behavior to take when the flow control limit is exceeded. - class BatchingSettingsProto - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # `BatchingDescriptorProto` specifies the fields of the request message to be - # used for batching, and, optionally, the fields of the response message to be - # used for demultiplexing. - # @!attribute [rw] batched_field - # @return [::String] - # The repeated field in the request message to be aggregated by batching. - # @!attribute [rw] discriminator_fields - # @return [::Array<::String>] - # A list of the fields in the request message. Two requests will be batched - # together only if the values of every field specified in - # `request_discriminator_fields` is equal between the two requests. - # @!attribute [rw] subresponse_field - # @return [::String] - # Optional. When present, indicates the field in the response message to be - # used to demultiplex the response into multiple response messages, in - # correspondence with the multiple request messages originally batched - # together. - class BatchingDescriptorProto - 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 - - # The behavior to take when the flow control limit is exceeded. - module FlowControlLimitExceededBehaviorProto - # Default behavior, system-defined. - UNSET_BEHAVIOR = 0 - - # Stop operation, raise error. - THROW_EXCEPTION = 1 - - # Pause operation until limit clears. - BLOCK = 2 - - # Continue operation, disregard limit. - IGNORE = 3 - end - end -end diff --git a/owl-bot-staging/google-iam-v2/proto_docs/google/api/field_behavior.rb b/owl-bot-staging/google-iam-v2/proto_docs/google/api/field_behavior.rb deleted file mode 100644 index 582be187d115..000000000000 --- a/owl-bot-staging/google-iam-v2/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-iam-v2/proto_docs/google/api/launch_stage.rb b/owl-bot-staging/google-iam-v2/proto_docs/google/api/launch_stage.rb deleted file mode 100644 index 9392a413fb1b..000000000000 --- a/owl-bot-staging/google-iam-v2/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-iam-v2/proto_docs/google/api/resource.rb b/owl-bot-staging/google-iam-v2/proto_docs/google/api/resource.rb deleted file mode 100644 index 25dec4847ac1..000000000000 --- a/owl-bot-staging/google-iam-v2/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-iam-v2/proto_docs/google/iam/v2/deny.rb b/owl-bot-staging/google-iam-v2/proto_docs/google/iam/v2/deny.rb deleted file mode 100644 index 85ac06367665..000000000000 --- a/owl-bot-staging/google-iam-v2/proto_docs/google/iam/v2/deny.rb +++ /dev/null @@ -1,110 +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 Iam - module V2 - # A deny rule in an IAM deny policy. - # @!attribute [rw] denied_principals - # @return [::Array<::String>] - # The identities that are prevented from using one or more permissions on - # Google Cloud resources. This field can contain the following values: - # - # * `principalSet://goog/public:all`: A special identifier that represents - # any principal that is on the internet, even if they do not have a Google - # Account or are not logged in. - # - # * `principal://goog/subject/{email_id}`: A specific Google Account. - # Includes Gmail, Cloud Identity, and Google Workspace user accounts. For - # example, `principal://goog/subject/alice@example.com`. - # - # * `deleted:principal://goog/subject/{email_id}?uid={uid}`: A specific - # Google Account that was deleted recently. For example, - # `deleted:principal://goog/subject/alice@example.com?uid=1234567890`. If - # the Google Account is recovered, this identifier reverts to the standard - # identifier for a Google Account. - # - # * `principalSet://goog/group/{group_id}`: A Google group. For example, - # `principalSet://goog/group/admins@example.com`. - # - # * `deleted:principalSet://goog/group/{group_id}?uid={uid}`: A Google group - # that was deleted recently. For example, - # `deleted:principalSet://goog/group/admins@example.com?uid=1234567890`. If - # the Google group is restored, this identifier reverts to the standard - # identifier for a Google group. - # - # * `principal://iam.googleapis.com/projects/-/serviceAccounts/{service_account_id}`: - # A Google Cloud service account. For example, - # `principal://iam.googleapis.com/projects/-/serviceAccounts/my-service-account@iam.gserviceaccount.com`. - # - # * `deleted:principal://iam.googleapis.com/projects/-/serviceAccounts/{service_account_id}?uid={uid}`: - # A Google Cloud service account that was deleted recently. For example, - # `deleted:principal://iam.googleapis.com/projects/-/serviceAccounts/my-service-account@iam.gserviceaccount.com?uid=1234567890`. - # If the service account is undeleted, this identifier reverts to the - # standard identifier for a service account. - # - # * `principalSet://goog/cloudIdentityCustomerId/{customer_id}`: All of the - # principals associated with the specified Google Workspace or Cloud - # Identity customer ID. For example, - # `principalSet://goog/cloudIdentityCustomerId/C01Abc35`. - # @!attribute [rw] exception_principals - # @return [::Array<::String>] - # The identities that are excluded from the deny rule, even if they are - # listed in the `denied_principals`. For example, you could add a Google - # group to the `denied_principals`, then exclude specific users who belong to - # that group. - # - # This field can contain the same values as the `denied_principals` field, - # excluding `principalSet://goog/public:all`, which represents all users on - # the internet. - # @!attribute [rw] denied_permissions - # @return [::Array<::String>] - # The permissions that are explicitly denied by this rule. Each permission - # uses the format `{service_fqdn}/{resource}.{verb}`, where `{service_fqdn}` - # is the fully qualified domain name for the service. For example, - # `iam.googleapis.com/roles.list`. - # @!attribute [rw] exception_permissions - # @return [::Array<::String>] - # Specifies the permissions that this rule excludes from the set of denied - # permissions given by `denied_permissions`. If a permission appears in - # `denied_permissions` _and_ in `exception_permissions` then it will _not_ be - # denied. - # - # The excluded permissions can be specified using the same syntax as - # `denied_permissions`. - # @!attribute [rw] denial_condition - # @return [::Google::Type::Expr] - # The condition that determines whether this deny rule applies to a request. - # If the condition expression evaluates to `true`, then the deny rule is - # applied; otherwise, the deny rule is not applied. - # - # Each deny rule is evaluated independently. If this deny rule does not apply - # to a request, other deny rules might still apply. - # - # The condition can use CEL functions that evaluate - # [resource - # tags](https://cloud.google.com/iam/help/conditions/resource-tags). Other - # functions and operators are not supported. - class DenyRule - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end -end diff --git a/owl-bot-staging/google-iam-v2/proto_docs/google/iam/v2/policy.rb b/owl-bot-staging/google-iam-v2/proto_docs/google/iam/v2/policy.rb deleted file mode 100644 index 917b870c27c0..000000000000 --- a/owl-bot-staging/google-iam-v2/proto_docs/google/iam/v2/policy.rb +++ /dev/null @@ -1,241 +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 Iam - module V2 - # Data for an IAM policy. - # @!attribute [rw] name - # @return [::String] - # Immutable. The resource name of the `Policy`, which must be unique. Format: - # `policies/{attachment_point}/denypolicies/{policy_id}` - # - # - # The attachment point is identified by its URL-encoded full resource name, - # which means that the forward-slash character, `/`, must be written as - # `%2F`. For example, - # `policies/cloudresourcemanager.googleapis.com%2Fprojects%2Fmy-project/denypolicies/my-deny-policy`. - # - # For organizations and folders, use the numeric ID in the full resource - # name. For projects, requests can use the alphanumeric or the numeric ID. - # Responses always contain the numeric ID. - # @!attribute [rw] uid - # @return [::String] - # Immutable. The globally unique ID of the `Policy`. Assigned automatically when the - # `Policy` is created. - # @!attribute [r] kind - # @return [::String] - # Output only. The kind of the `Policy`. Always contains the value `DenyPolicy`. - # @!attribute [rw] display_name - # @return [::String] - # A user-specified description of the `Policy`. This value can be up to 63 - # characters. - # @!attribute [rw] annotations - # @return [::Google::Protobuf::Map{::String => ::String}] - # A key-value map to store arbitrary metadata for the `Policy`. Keys - # can be up to 63 characters. Values can be up to 255 characters. - # @!attribute [rw] etag - # @return [::String] - # An opaque tag that identifies the current version of the `Policy`. IAM uses - # this value to help manage concurrent updates, so they do not cause one - # update to be overwritten by another. - # - # If this field is present in a [CreatePolicy][] request, the value is - # ignored. - # @!attribute [r] create_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time when the `Policy` was created. - # @!attribute [r] update_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time when the `Policy` was last updated. - # @!attribute [r] delete_time - # @return [::Google::Protobuf::Timestamp] - # Output only. The time when the `Policy` was deleted. Empty if the policy is not deleted. - # @!attribute [rw] rules - # @return [::Array<::Google::Iam::V2::PolicyRule>] - # A list of rules that specify the behavior of the `Policy`. All of the rules - # should be of the `kind` specified in the `Policy`. - # @!attribute [rw] managing_authority - # @return [::String] - # Immutable. Specifies that this policy is managed by an authority and can only be - # modified by that authority. Usage is restricted. - class Policy - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - - # @!attribute [rw] key - # @return [::String] - # @!attribute [rw] value - # @return [::String] - class AnnotationsEntry - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - - # A single rule in a `Policy`. - # @!attribute [rw] deny_rule - # @return [::Google::Iam::V2::DenyRule] - # A rule for a deny policy. - # @!attribute [rw] description - # @return [::String] - # A user-specified description of the rule. This value can be up to 256 - # characters. - class PolicyRule - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for `ListPolicies`. - # @!attribute [rw] parent - # @return [::String] - # Required. The resource that the policy is attached to, along with the kind of policy - # to list. Format: - # `policies/{attachment_point}/denypolicies` - # - # - # The attachment point is identified by its URL-encoded full resource name, - # which means that the forward-slash character, `/`, must be written as - # `%2F`. For example, - # `policies/cloudresourcemanager.googleapis.com%2Fprojects%2Fmy-project/denypolicies`. - # - # For organizations and folders, use the numeric ID in the full resource - # name. For projects, you can use the alphanumeric or the numeric ID. - # @!attribute [rw] page_size - # @return [::Integer] - # The maximum number of policies to return. IAM ignores this value and uses - # the value 1000. - # @!attribute [rw] page_token - # @return [::String] - # A page token received in a {::Google::Iam::V2::ListPoliciesResponse ListPoliciesResponse}. Provide this token to - # retrieve the next page. - class ListPoliciesRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Response message for `ListPolicies`. - # @!attribute [rw] policies - # @return [::Array<::Google::Iam::V2::Policy>] - # Metadata for the policies that are attached to the resource. - # @!attribute [rw] next_page_token - # @return [::String] - # A page token that you can use in a {::Google::Iam::V2::ListPoliciesRequest ListPoliciesRequest} to retrieve the - # next page. If this field is omitted, there are no additional pages. - class ListPoliciesResponse - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for `GetPolicy`. - # @!attribute [rw] name - # @return [::String] - # Required. The resource name of the policy to retrieve. Format: - # `policies/{attachment_point}/denypolicies/{policy_id}` - # - # - # Use the URL-encoded full resource name, which means that the forward-slash - # character, `/`, must be written as `%2F`. For example, - # `policies/cloudresourcemanager.googleapis.com%2Fprojects%2Fmy-project/denypolicies/my-policy`. - # - # For organizations and folders, use the numeric ID in the full resource - # name. For projects, you can use the alphanumeric or the numeric ID. - class GetPolicyRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for `CreatePolicy`. - # @!attribute [rw] parent - # @return [::String] - # Required. The resource that the policy is attached to, along with the kind of policy - # to create. Format: `policies/{attachment_point}/denypolicies` - # - # - # The attachment point is identified by its URL-encoded full resource name, - # which means that the forward-slash character, `/`, must be written as - # `%2F`. For example, - # `policies/cloudresourcemanager.googleapis.com%2Fprojects%2Fmy-project/denypolicies`. - # - # For organizations and folders, use the numeric ID in the full resource - # name. For projects, you can use the alphanumeric or the numeric ID. - # @!attribute [rw] policy - # @return [::Google::Iam::V2::Policy] - # Required. The policy to create. - # @!attribute [rw] policy_id - # @return [::String] - # The ID to use for this policy, which will become the final component of - # the policy's resource name. The ID must contain 3 to 63 characters. It can - # contain lowercase letters and numbers, as well as dashes (`-`) and periods - # (`.`). The first character must be a lowercase letter. - class CreatePolicyRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for `UpdatePolicy`. - # @!attribute [rw] policy - # @return [::Google::Iam::V2::Policy] - # Required. The policy to update. - # - # To prevent conflicting updates, the `etag` value must match the value that - # is stored in IAM. If the `etag` values do not match, the request fails with - # a `409` error code and `ABORTED` status. - class UpdatePolicyRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Request message for `DeletePolicy`. - # @!attribute [rw] name - # @return [::String] - # Required. The resource name of the policy to delete. Format: - # `policies/{attachment_point}/denypolicies/{policy_id}` - # - # - # Use the URL-encoded full resource name, which means that the forward-slash - # character, `/`, must be written as `%2F`. For example, - # `policies/cloudresourcemanager.googleapis.com%2Fprojects%2Fmy-project/denypolicies/my-policy`. - # - # For organizations and folders, use the numeric ID in the full resource - # name. For projects, you can use the alphanumeric or the numeric ID. - # @!attribute [rw] etag - # @return [::String] - # Optional. The expected `etag` of the policy to delete. If the value does not match - # the value that is stored in IAM, the request fails with a `409` error code - # and `ABORTED` status. - # - # If you omit this field, the policy is deleted regardless of its current - # `etag`. - class DeletePolicyRequest - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - - # Metadata for long-running `Policy` operations. - # @!attribute [rw] create_time - # @return [::Google::Protobuf::Timestamp] - # Timestamp when the `google.longrunning.Operation` was created. - class PolicyOperationMetadata - include ::Google::Protobuf::MessageExts - extend ::Google::Protobuf::MessageExts::ClassMethods - end - end - end -end diff --git a/owl-bot-staging/google-iam-v2/proto_docs/google/longrunning/operations.rb b/owl-bot-staging/google-iam-v2/proto_docs/google/longrunning/operations.rb deleted file mode 100644 index 7a757f512165..000000000000 --- a/owl-bot-staging/google-iam-v2/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-iam-v2/proto_docs/google/protobuf/any.rb b/owl-bot-staging/google-iam-v2/proto_docs/google/protobuf/any.rb deleted file mode 100644 index 58691995f02e..000000000000 --- a/owl-bot-staging/google-iam-v2/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-iam-v2/proto_docs/google/protobuf/duration.rb b/owl-bot-staging/google-iam-v2/proto_docs/google/protobuf/duration.rb deleted file mode 100644 index ea59f1f91daf..000000000000 --- a/owl-bot-staging/google-iam-v2/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-iam-v2/proto_docs/google/protobuf/empty.rb b/owl-bot-staging/google-iam-v2/proto_docs/google/protobuf/empty.rb deleted file mode 100644 index 83e4481834a6..000000000000 --- a/owl-bot-staging/google-iam-v2/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-iam-v2/proto_docs/google/protobuf/timestamp.rb b/owl-bot-staging/google-iam-v2/proto_docs/google/protobuf/timestamp.rb deleted file mode 100644 index 74352be9c58c..000000000000 --- a/owl-bot-staging/google-iam-v2/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-iam-v2/proto_docs/google/rpc/status.rb b/owl-bot-staging/google-iam-v2/proto_docs/google/rpc/status.rb deleted file mode 100644 index c1a1c07eb2db..000000000000 --- a/owl-bot-staging/google-iam-v2/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-iam-v2/proto_docs/google/type/expr.rb b/owl-bot-staging/google-iam-v2/proto_docs/google/type/expr.rb deleted file mode 100644 index 53e7733b6592..000000000000 --- a/owl-bot-staging/google-iam-v2/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-iam-v2/snippets/Gemfile b/owl-bot-staging/google-iam-v2/snippets/Gemfile deleted file mode 100644 index 0b586e897f32..000000000000 --- a/owl-bot-staging/google-iam-v2/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-iam-v2", path: "../" -else - gem "google-iam-v2" -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-iam-v2/snippets/policies/create_policy.rb b/owl-bot-staging/google-iam-v2/snippets/policies/create_policy.rb deleted file mode 100644 index 992efa4ac456..000000000000 --- a/owl-bot-staging/google-iam-v2/snippets/policies/create_policy.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 iam_v2_generated_Policies_CreatePolicy_sync] -require "google/iam/v2" - -## -# Snippet for the create_policy call in the Policies 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::Iam::V2::Policies::Client#create_policy. -# -def create_policy - # Create a client object. The client can be reused for multiple calls. - client = Google::Iam::V2::Policies::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Iam::V2::CreatePolicyRequest.new - - # Call the create_policy method. - result = client.create_policy 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 iam_v2_generated_Policies_CreatePolicy_sync] diff --git a/owl-bot-staging/google-iam-v2/snippets/policies/delete_policy.rb b/owl-bot-staging/google-iam-v2/snippets/policies/delete_policy.rb deleted file mode 100644 index 97dbcb650132..000000000000 --- a/owl-bot-staging/google-iam-v2/snippets/policies/delete_policy.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 iam_v2_generated_Policies_DeletePolicy_sync] -require "google/iam/v2" - -## -# Snippet for the delete_policy call in the Policies 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::Iam::V2::Policies::Client#delete_policy. -# -def delete_policy - # Create a client object. The client can be reused for multiple calls. - client = Google::Iam::V2::Policies::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Iam::V2::DeletePolicyRequest.new - - # Call the delete_policy method. - result = client.delete_policy 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 iam_v2_generated_Policies_DeletePolicy_sync] diff --git a/owl-bot-staging/google-iam-v2/snippets/policies/get_policy.rb b/owl-bot-staging/google-iam-v2/snippets/policies/get_policy.rb deleted file mode 100644 index 6820282d9a3b..000000000000 --- a/owl-bot-staging/google-iam-v2/snippets/policies/get_policy.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 iam_v2_generated_Policies_GetPolicy_sync] -require "google/iam/v2" - -## -# Snippet for the get_policy call in the Policies 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::Iam::V2::Policies::Client#get_policy. -# -def get_policy - # Create a client object. The client can be reused for multiple calls. - client = Google::Iam::V2::Policies::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Iam::V2::GetPolicyRequest.new - - # Call the get_policy method. - result = client.get_policy request - - # The returned object is of type Google::Iam::V2::Policy. - p result -end -# [END iam_v2_generated_Policies_GetPolicy_sync] diff --git a/owl-bot-staging/google-iam-v2/snippets/policies/list_policies.rb b/owl-bot-staging/google-iam-v2/snippets/policies/list_policies.rb deleted file mode 100644 index d7d580e8441f..000000000000 --- a/owl-bot-staging/google-iam-v2/snippets/policies/list_policies.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 iam_v2_generated_Policies_ListPolicies_sync] -require "google/iam/v2" - -## -# Snippet for the list_policies call in the Policies 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::Iam::V2::Policies::Client#list_policies. -# -def list_policies - # Create a client object. The client can be reused for multiple calls. - client = Google::Iam::V2::Policies::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Iam::V2::ListPoliciesRequest.new - - # Call the list_policies method. - result = client.list_policies 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::Iam::V2::Policy. - p item - end -end -# [END iam_v2_generated_Policies_ListPolicies_sync] diff --git a/owl-bot-staging/google-iam-v2/snippets/policies/update_policy.rb b/owl-bot-staging/google-iam-v2/snippets/policies/update_policy.rb deleted file mode 100644 index 417fd211883b..000000000000 --- a/owl-bot-staging/google-iam-v2/snippets/policies/update_policy.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 iam_v2_generated_Policies_UpdatePolicy_sync] -require "google/iam/v2" - -## -# Snippet for the update_policy call in the Policies 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::Iam::V2::Policies::Client#update_policy. -# -def update_policy - # Create a client object. The client can be reused for multiple calls. - client = Google::Iam::V2::Policies::Client.new - - # Create a request. To set request fields, pass in keyword arguments. - request = Google::Iam::V2::UpdatePolicyRequest.new - - # Call the update_policy method. - result = client.update_policy 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 iam_v2_generated_Policies_UpdatePolicy_sync] diff --git a/owl-bot-staging/google-iam-v2/snippets/snippet_metadata_google.iam.v2.json b/owl-bot-staging/google-iam-v2/snippets/snippet_metadata_google.iam.v2.json deleted file mode 100644 index a44511598630..000000000000 --- a/owl-bot-staging/google-iam-v2/snippets/snippet_metadata_google.iam.v2.json +++ /dev/null @@ -1,215 +0,0 @@ -{ - "client_library": { - "name": "google-iam-v2", - "version": "", - "language": "RUBY", - "apis": [ - { - "id": "google.iam.v2", - "version": "v2" - } - ] - }, - "snippets": [ - { - "region_tag": "iam_v2_generated_Policies_ListPolicies_sync", - "title": "Snippet for the list_policies call in the Policies service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Iam::V2::Policies::Client#list_policies.", - "file": "policies/list_policies.rb", - "language": "RUBY", - "client_method": { - "short_name": "list_policies", - "full_name": "::Google::Iam::V2::Policies::Client#list_policies", - "async": false, - "parameters": [ - { - "type": "::Google::Iam::V2::ListPoliciesRequest", - "name": "request" - } - ], - "result_type": "::Google::Iam::V2::ListPoliciesResponse", - "client": { - "short_name": "Policies::Client", - "full_name": "::Google::Iam::V2::Policies::Client" - }, - "method": { - "short_name": "ListPolicies", - "full_name": "google.iam.v2.Policies.ListPolicies", - "service": { - "short_name": "Policies", - "full_name": "google.iam.v2.Policies" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 50, - "type": "FULL" - } - ] - }, - { - "region_tag": "iam_v2_generated_Policies_GetPolicy_sync", - "title": "Snippet for the get_policy call in the Policies service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Iam::V2::Policies::Client#get_policy.", - "file": "policies/get_policy.rb", - "language": "RUBY", - "client_method": { - "short_name": "get_policy", - "full_name": "::Google::Iam::V2::Policies::Client#get_policy", - "async": false, - "parameters": [ - { - "type": "::Google::Iam::V2::GetPolicyRequest", - "name": "request" - } - ], - "result_type": "::Google::Iam::V2::Policy", - "client": { - "short_name": "Policies::Client", - "full_name": "::Google::Iam::V2::Policies::Client" - }, - "method": { - "short_name": "GetPolicy", - "full_name": "google.iam.v2.Policies.GetPolicy", - "service": { - "short_name": "Policies", - "full_name": "google.iam.v2.Policies" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 46, - "type": "FULL" - } - ] - }, - { - "region_tag": "iam_v2_generated_Policies_CreatePolicy_sync", - "title": "Snippet for the create_policy call in the Policies service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Iam::V2::Policies::Client#create_policy.", - "file": "policies/create_policy.rb", - "language": "RUBY", - "client_method": { - "short_name": "create_policy", - "full_name": "::Google::Iam::V2::Policies::Client#create_policy", - "async": false, - "parameters": [ - { - "type": "::Google::Iam::V2::CreatePolicyRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "Policies::Client", - "full_name": "::Google::Iam::V2::Policies::Client" - }, - "method": { - "short_name": "CreatePolicy", - "full_name": "google.iam.v2.Policies.CreatePolicy", - "service": { - "short_name": "Policies", - "full_name": "google.iam.v2.Policies" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "iam_v2_generated_Policies_UpdatePolicy_sync", - "title": "Snippet for the update_policy call in the Policies service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Iam::V2::Policies::Client#update_policy.", - "file": "policies/update_policy.rb", - "language": "RUBY", - "client_method": { - "short_name": "update_policy", - "full_name": "::Google::Iam::V2::Policies::Client#update_policy", - "async": false, - "parameters": [ - { - "type": "::Google::Iam::V2::UpdatePolicyRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "Policies::Client", - "full_name": "::Google::Iam::V2::Policies::Client" - }, - "method": { - "short_name": "UpdatePolicy", - "full_name": "google.iam.v2.Policies.UpdatePolicy", - "service": { - "short_name": "Policies", - "full_name": "google.iam.v2.Policies" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - }, - { - "region_tag": "iam_v2_generated_Policies_DeletePolicy_sync", - "title": "Snippet for the delete_policy call in the Policies service", - "description": "This is an auto-generated example demonstrating basic usage of Google::Iam::V2::Policies::Client#delete_policy.", - "file": "policies/delete_policy.rb", - "language": "RUBY", - "client_method": { - "short_name": "delete_policy", - "full_name": "::Google::Iam::V2::Policies::Client#delete_policy", - "async": false, - "parameters": [ - { - "type": "::Google::Iam::V2::DeletePolicyRequest", - "name": "request" - } - ], - "result_type": "::Google::Longrunning::Operation", - "client": { - "short_name": "Policies::Client", - "full_name": "::Google::Iam::V2::Policies::Client" - }, - "method": { - "short_name": "DeletePolicy", - "full_name": "google.iam.v2.Policies.DeletePolicy", - "service": { - "short_name": "Policies", - "full_name": "google.iam.v2.Policies" - } - } - }, - "canonical": true, - "origin": "API_DEFINITION", - "segments": [ - { - "start": 20, - "end": 53, - "type": "FULL" - } - ] - } - ] -} \ No newline at end of file diff --git a/owl-bot-staging/google-iam-v2/test/google/iam/v2/policies_operations_test.rb b/owl-bot-staging/google-iam-v2/test/google/iam/v2/policies_operations_test.rb deleted file mode 100644 index ee66097c2e4e..000000000000 --- a/owl-bot-staging/google-iam-v2/test/google/iam/v2/policies_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/iam/v2/policy_pb" -require "google/iam/v2/policy_services_pb" -require "google/iam/v2/policies" - -class ::Google::Iam::V2::Policies::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::Iam::V2::Policies::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::Iam::V2::Policies::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::Iam::V2::Policies::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::Iam::V2::Policies::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::Iam::V2::Policies::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::Iam::V2::Policies::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::Iam::V2::Policies::Operations::Configuration, config - end -end diff --git a/owl-bot-staging/google-iam-v2/test/google/iam/v2/policies_rest_test.rb b/owl-bot-staging/google-iam-v2/test/google/iam/v2/policies_rest_test.rb deleted file mode 100644 index 9e17bd6ea73b..000000000000 --- a/owl-bot-staging/google-iam-v2/test/google/iam/v2/policies_rest_test.rb +++ /dev/null @@ -1,374 +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/iam/v2/policy_pb" -require "google/iam/v2/policies/rest" - - -class ::Google::Iam::V2::Policies::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_policies - # Create test objects. - client_result = ::Google::Iam::V2::ListPoliciesResponse.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_policies_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::Iam::V2::Policies::Rest::ServiceStub.stub :transcode_list_policies_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, list_policies_client_stub do - # Create client - client = ::Google::Iam::V2::Policies::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.list_policies({ 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_policies 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_policies ::Google::Iam::V2::ListPoliciesRequest.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_policies({ 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_policies(::Google::Iam::V2::ListPoliciesRequest.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_policies_client_stub.call_count - end - end - end - - def test_get_policy - # Create test objects. - client_result = ::Google::Iam::V2::Policy.new - http_response = OpenStruct.new body: client_result.to_json - - call_options = {} - - # Create request parameters for a unary method. - name = "hello world" - - get_policy_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::Iam::V2::Policies::Rest::ServiceStub.stub :transcode_get_policy_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, get_policy_client_stub do - # Create client - client = ::Google::Iam::V2::Policies::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.get_policy({ name: name }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.get_policy name: name do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.get_policy ::Google::Iam::V2::GetPolicyRequest.new(name: name) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.get_policy({ name: name }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.get_policy(::Google::Iam::V2::GetPolicyRequest.new(name: name), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, get_policy_client_stub.call_count - end - end - end - - def test_create_policy - # 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" - policy = {} - policy_id = "hello world" - - create_policy_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::Iam::V2::Policies::Rest::ServiceStub.stub :transcode_create_policy_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, create_policy_client_stub do - # Create client - client = ::Google::Iam::V2::Policies::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.create_policy({ parent: parent, policy: policy, policy_id: policy_id }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.create_policy parent: parent, policy: policy, policy_id: policy_id do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.create_policy ::Google::Iam::V2::CreatePolicyRequest.new(parent: parent, policy: policy, policy_id: policy_id) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.create_policy({ parent: parent, policy: policy, policy_id: policy_id }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.create_policy(::Google::Iam::V2::CreatePolicyRequest.new(parent: parent, policy: policy, policy_id: policy_id), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, create_policy_client_stub.call_count - end - end - end - - def test_update_policy - # 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. - policy = {} - - update_policy_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::Iam::V2::Policies::Rest::ServiceStub.stub :transcode_update_policy_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, update_policy_client_stub do - # Create client - client = ::Google::Iam::V2::Policies::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.update_policy({ policy: policy }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.update_policy policy: policy do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.update_policy ::Google::Iam::V2::UpdatePolicyRequest.new(policy: policy) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.update_policy({ policy: policy }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.update_policy(::Google::Iam::V2::UpdatePolicyRequest.new(policy: policy), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, update_policy_client_stub.call_count - end - end - end - - def test_delete_policy - # 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" - etag = "hello world" - - delete_policy_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::Iam::V2::Policies::Rest::ServiceStub.stub :transcode_delete_policy_request, ["", "", {}] do - Gapic::Rest::ClientStub.stub :new, delete_policy_client_stub do - # Create client - client = ::Google::Iam::V2::Policies::Rest::Client.new do |config| - config.credentials = :dummy_value - end - - # Use hash object - client.delete_policy({ name: name, etag: etag }) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use named arguments - client.delete_policy name: name, etag: etag do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object - client.delete_policy ::Google::Iam::V2::DeletePolicyRequest.new(name: name, etag: etag) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use hash object with options - client.delete_policy({ name: name, etag: etag }, call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Use protobuf object with options - client.delete_policy(::Google::Iam::V2::DeletePolicyRequest.new(name: name, etag: etag), call_options) do |_result, response| - assert_equal http_response, response.underlying_op - end - - # Verify method calls - assert_equal 5, delete_policy_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::Iam::V2::Policies::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::Iam::V2::Policies::Rest::Client::Configuration, config - end -end diff --git a/owl-bot-staging/google-iam-v2/test/google/iam/v2/policies_test.rb b/owl-bot-staging/google-iam-v2/test/google/iam/v2/policies_test.rb deleted file mode 100644 index 1be0f9fd672d..000000000000 --- a/owl-bot-staging/google-iam-v2/test/google/iam/v2/policies_test.rb +++ /dev/null @@ -1,438 +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/iam/v2/policy_pb" -require "google/iam/v2/policies" - -class ::Google::Iam::V2::Policies::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_policies - # Create GRPC objects. - grpc_response = ::Google::Iam::V2::ListPoliciesResponse.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_policies_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :list_policies, name - assert_kind_of ::Google::Iam::V2::ListPoliciesRequest, 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_policies_client_stub do - # Create client - client = ::Google::Iam::V2::Policies::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.list_policies({ 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_policies 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_policies ::Google::Iam::V2::ListPoliciesRequest.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_policies({ 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_policies(::Google::Iam::V2::ListPoliciesRequest.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_policies_client_stub.call_rpc_count - end - end - - def test_get_policy - # Create GRPC objects. - grpc_response = ::Google::Iam::V2::Policy.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_policy_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :get_policy, name - assert_kind_of ::Google::Iam::V2::GetPolicyRequest, request - assert_equal "hello world", request["name"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, get_policy_client_stub do - # Create client - client = ::Google::Iam::V2::Policies::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.get_policy({ name: name }) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use named arguments - client.get_policy name: name do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use protobuf object - client.get_policy ::Google::Iam::V2::GetPolicyRequest.new(name: name) do |response, operation| - assert_equal grpc_response, response - assert_equal grpc_operation, operation - end - - # Use hash object with options - client.get_policy({ 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_policy(::Google::Iam::V2::GetPolicyRequest.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_policy_client_stub.call_rpc_count - end - end - - def test_create_policy - # 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" - policy = {} - policy_id = "hello world" - - create_policy_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :create_policy, name - assert_kind_of ::Google::Iam::V2::CreatePolicyRequest, request - assert_equal "hello world", request["parent"] - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Iam::V2::Policy), request["policy"] - assert_equal "hello world", request["policy_id"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, create_policy_client_stub do - # Create client - client = ::Google::Iam::V2::Policies::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.create_policy({ parent: parent, policy: policy, policy_id: policy_id }) 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_policy parent: parent, policy: policy, policy_id: policy_id 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_policy ::Google::Iam::V2::CreatePolicyRequest.new(parent: parent, policy: policy, policy_id: policy_id) 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_policy({ parent: parent, policy: policy, policy_id: policy_id }, 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_policy(::Google::Iam::V2::CreatePolicyRequest.new(parent: parent, policy: policy, policy_id: policy_id), 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_policy_client_stub.call_rpc_count - end - end - - def test_update_policy - # 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. - policy = {} - - update_policy_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :update_policy, name - assert_kind_of ::Google::Iam::V2::UpdatePolicyRequest, request - assert_equal Gapic::Protobuf.coerce({}, to: ::Google::Iam::V2::Policy), request["policy"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, update_policy_client_stub do - # Create client - client = ::Google::Iam::V2::Policies::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.update_policy({ policy: policy }) 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.update_policy policy: policy 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.update_policy ::Google::Iam::V2::UpdatePolicyRequest.new(policy: policy) 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.update_policy({ policy: policy }, 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.update_policy(::Google::Iam::V2::UpdatePolicyRequest.new(policy: policy), 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, update_policy_client_stub.call_rpc_count - end - end - - def test_delete_policy - # 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" - etag = "hello world" - - delete_policy_client_stub = ClientStub.new grpc_response, grpc_operation do |name, request, options:| - assert_equal :delete_policy, name - assert_kind_of ::Google::Iam::V2::DeletePolicyRequest, request - assert_equal "hello world", request["name"] - assert_equal "hello world", request["etag"] - refute_nil options - end - - Gapic::ServiceStub.stub :new, delete_policy_client_stub do - # Create client - client = ::Google::Iam::V2::Policies::Client.new do |config| - config.credentials = grpc_channel - end - - # Use hash object - client.delete_policy({ name: name, etag: etag }) 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_policy name: name, etag: etag 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_policy ::Google::Iam::V2::DeletePolicyRequest.new(name: name, etag: etag) 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_policy({ name: name, etag: etag }, 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_policy(::Google::Iam::V2::DeletePolicyRequest.new(name: name, etag: etag), 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_policy_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::Iam::V2::Policies::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::Iam::V2::Policies::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::Iam::V2::Policies::Client.new do |config| - config.credentials = creds - end - assert_kind_of ::Google::Iam::V2::Policies::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::Iam::V2::Policies::Client.new do |config| - config.credentials = grpc_channel - end - end - - assert_kind_of ::Google::Iam::V2::Policies::Operations, client.operations_client - end -end diff --git a/owl-bot-staging/google-iam-v2/test/helper.rb b/owl-bot-staging/google-iam-v2/test/helper.rb deleted file mode 100644 index 672b337030e7..000000000000 --- a/owl-bot-staging/google-iam-v2/test/helper.rb +++ /dev/null @@ -1,26 +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/mock" -require "minitest/rg" - -require "grpc" - -require "ostruct"